aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2022-08-29 16:04:28 +0200
committerGitHub <noreply@github.com>2022-08-29 16:04:28 +0200
commit7d1f51a8937e0a86486267437d444696e81e8aa0 (patch)
treea5b145e7271998f7b4b968a2212ed487e54a92b5 /src/main/java
parent5267969156d30b4bb5f4cb2279ebb49db6bd40e2 (diff)
downloadGT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.gz
GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.bz2
GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.zip
Buildscript + Spotless (#318)
* Convert AES.java to readable class * Buildscript * Spotless
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java1331
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/BigintStorage.java8
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java1011
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/Reactor.java214
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/SimulationData.java16
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java7
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/components/Condensator.java17
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java15
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java24
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java48
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/components/Plating.java19
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java1059
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/components/Reflector.java20
-rw-r--r--src/main/java/Ic2ExpReactorPlanner/components/Vent.java31
-rw-r--r--src/main/java/gregtech/api/enums/TAE.java275
-rw-r--r--src/main/java/gregtech/api/util/EmptyRecipeMap.java132
-rw-r--r--src/main/java/gregtech/api/util/FishPondFakeRecipe.java122
-rw-r--r--src/main/java/gregtech/api/util/GTPP_Recipe.java1944
-rw-r--r--src/main/java/gregtech/api/util/GasSpargingRecipe.java171
-rw-r--r--src/main/java/gregtech/api/util/GasSpargingRecipeMap.java81
-rw-r--r--src/main/java/gregtech/api/util/HotFuel.java62
-rw-r--r--src/main/java/gregtech/api/util/SemiFluidFuelHandler.java205
-rw-r--r--src/main/java/gregtech/api/util/ThermalFuel.java67
-rw-r--r--src/main/java/gtPlusPlus/GTplusplus.java1001
-rw-r--r--src/main/java/gtPlusPlus/GenerateDictionaries.java309
-rw-r--r--src/main/java/gtPlusPlus/RoadMap.java124
-rw-r--r--src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java26
-rw-r--r--src/main/java/gtPlusPlus/api/enums/ParticleNames.java64
-rw-r--r--src/main/java/gtPlusPlus/api/enums/Quality.java111
-rw-r--r--src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java387
-rw-r--r--src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java151
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java48
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java5
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java22
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java21
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IGregtechPacketEntity.java5
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java184
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/ILazyCoverable.java265
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IPlugin.java70
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java1
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/ITexturedBlock.java10
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/ITileTooltip.java3
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IToolable.java29
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/RunnableWithInfo.java12
-rw-r--r--src/main/java/gtPlusPlus/api/objects/GregtechException.java39
-rw-r--r--src/main/java/gtPlusPlus/api/objects/Logger.java310
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/AutoMap.java669
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java19
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/ConcurrentSet.java10
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/FlexiblePair.java67
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/ObjMap.java278
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/Pair.java49
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/Quad.java79
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/ReverseAutoMap.java333
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/Triplet.java39
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java331
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java180
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/weakref/WeakAutoMap.java12
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/AABB.java97
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java353
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java446
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java473
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java101
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java78
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java434
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/FakeWorld.java292
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/FluidGT6.java42
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/FormattedTooltipString.java38
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java67
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java97
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java50
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java225
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java92
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java472
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java89
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java174
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoEUBonusMultiBehaviour.java31
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java31
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoSpeedBonusMultiBehaviour.java31
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java57
-rw-r--r--src/main/java/gtPlusPlus/api/objects/random/CSPRNG_DO_NOT_USE.java136
-rw-r--r--src/main/java/gtPlusPlus/api/objects/random/UUIDGenerator.java761
-rw-r--r--src/main/java/gtPlusPlus/api/objects/random/XSTR.java441
-rw-r--r--src/main/java/gtPlusPlus/api/plugin/Sample_Plugin.java77
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalConnection.java4
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalContainerItem.java13
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalHandler.java13
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalProvider.java11
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalReceiver.java11
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalStorage.java13
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorage.java219
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorageAdv.java62
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/sample/ItemThermalContainer.java127
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/sample/TileThermalHandler.java66
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/tileentity/IThermalInfo.java13
-rw-r--r--src/main/java/gtPlusPlus/australia/GTplusplus_Australia.java251
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/CustomDecorator.java652
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/GenLayerAustralia.java42
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/GenLayerBiomesAustraliaDimension.java61
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java586
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java587
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert_Ex.java50
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianForest.java338
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOcean.java46
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOutback.java246
-rw-r--r--src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java94
-rw-r--r--src/main/java/gtPlusPlus/australia/block/AustraliaContentLoader.java87
-rw-r--r--src/main/java/gtPlusPlus/australia/block/BlockAustraliaPortal.java769
-rw-r--r--src/main/java/gtPlusPlus/australia/block/BlockAustraliaSand.java29
-rw-r--r--src/main/java/gtPlusPlus/australia/block/BlockAustraliaTopSoil.java108
-rw-r--r--src/main/java/gtPlusPlus/australia/block/BlockDarkWorldPortalFrame.java40
-rw-r--r--src/main/java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java1595
-rw-r--r--src/main/java/gtPlusPlus/australia/dimension/Dimension_Australia.java21
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/model/ModelAustralianSpider.java277
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/model/ModelBoar.java21
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/model/ModelDingo.java303
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/model/ModelOctopus.java113
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/render/RenderAustralianSpider.java116
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/render/RenderBoar.java37
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/render/RenderDingo.java134
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/render/RenderOctopus.java206
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/type/EntityAustralianSpiderBase.java50
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/type/EntityBoar.java390
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/type/EntityDingo.java1009
-rw-r--r--src/main/java/gtPlusPlus/australia/entity/type/EntityOctopus.java127
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java493
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java88
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java985
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java1066
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/MapGenExtendedVillage.java312
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/MapGenLargeRavine.java428
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java360
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java906
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/component/ComponentShack.java578
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/structure/StructureManager.java20
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/map/structure/type/ComponentVillageBank.java327
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianOre.java132
-rw-r--r--src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianTrees.java492
-rw-r--r--src/main/java/gtPlusPlus/australia/item/ItemAustraliaPortalTrigger.java168
-rw-r--r--src/main/java/gtPlusPlus/australia/item/ItemBlockAustralia.java47
-rw-r--r--src/main/java/gtPlusPlus/australia/world/AustraliaPortalPosition.java17
-rw-r--r--src/main/java/gtPlusPlus/australia/world/AustraliaTeleporterDimensionMod.java917
-rw-r--r--src/main/java/gtPlusPlus/australia/world/AustraliaWorldChunkManager.java459
-rw-r--r--src/main/java/gtPlusPlus/australia/world/AustraliaWorldGenerator.java247
-rw-r--r--src/main/java/gtPlusPlus/australia/world/AustraliaWorldProvider.java106
-rw-r--r--src/main/java/gtPlusPlus/australia/world/AustraliaWorldType.java99
-rw-r--r--src/main/java/gtPlusPlus/core/block/ModBlocks.java266
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/AdvancedBlock.java63
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BasicBlock.java134
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java576
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java147
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java399
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BlockBaseNBT.java114
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java418
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/MetaBlock.java45
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/MultiTextureBlock.java48
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java149
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockNet.java53
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java384
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java350
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/FirePit.java429
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/FluidTankInfinite.java208
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/HellFire.java1088
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/LightGlass.java233
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/MiningExplosives.java325
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java895
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java308
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java519
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/fluids/BlockFluidSludge.java93
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java689
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java226
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneEmitter.java4
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java359
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java67
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/CircuitProgrammer.java279
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/DecayablesChest.java387
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/EggBox.java306
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/FishTrap.java281
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java147
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java162
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_PestKiller.java233
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_PooCollector.java319
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java294
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java227
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java1061
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java132
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java3
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java285
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java298
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java234
-rw-r--r--src/main/java/gtPlusPlus/core/chunkloading/GTPP_ChunkManager.java147
-rw-r--r--src/main/java/gtPlusPlus/core/client/CustomTextureSet.java37
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java59
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java11
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelEggBox.java50
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java61
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java58
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java66
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/tabula/ModelTabulaBase.java16
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java99
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java3572
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java292
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java118
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java5
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java196
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderPlasmaBolt.java317
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java42
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderSickBlaze.java76
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java293
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java47
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/particle/EntityDropParticleFX.java175
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/tabula/RenderTabulaBase.java59
-rw-r--r--src/main/java/gtPlusPlus/core/commands/CommandDebugChunks.java266
-rw-r--r--src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java451
-rw-r--r--src/main/java/gtPlusPlus/core/commands/CommandMath.java166
-rw-r--r--src/main/java/gtPlusPlus/core/commands/CommandUtils.java20
-rw-r--r--src/main/java/gtPlusPlus/core/common/BasePlayer.java402
-rw-r--r--src/main/java/gtPlusPlus/core/common/CommonProxy.java515
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java89
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java21
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java372
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java33
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java47
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_HarvestCraft.java13
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_IC2.java108
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java56
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_OpenBlocks.java35
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_PlayerAPI.java55
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java17
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java18
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_Railcraft.java12
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java18
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java74
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_Witchery.java29
-rw-r--r--src/main/java/gtPlusPlus/core/config/ConfigHandler.java754
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java381
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_CircuitProgrammer.java352
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_DecayablesChest.java238
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_EggBox.java238
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_FishTrap.java247
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_Grindle.java305
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java341
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java443
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_PestKiller.java257
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_ProjectTable.java405
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_RoundRobinator.java442
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_SuperJukebox.java452
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_TradeTable.java414
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java326
-rw-r--r--src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java12
-rw-r--r--src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java12
-rw-r--r--src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java8
-rw-r--r--src/main/java/gtPlusPlus/core/creative/AddToCreativeTab.java50
-rw-r--r--src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java26
-rw-r--r--src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java18
-rw-r--r--src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java17
-rw-r--r--src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java17
-rw-r--r--src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java17
-rw-r--r--src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java597
-rw-r--r--src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java460
-rw-r--r--src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java313
-rw-r--r--src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java168
-rw-r--r--src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java810
-rw-r--r--src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java210
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java1358
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java285
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java427
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java1136
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java237
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java93
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java220
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java410
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java627
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java147
-rw-r--r--src/main/java/gtPlusPlus/core/fluids/BlockFluidBase.java167
-rw-r--r--src/main/java/gtPlusPlus/core/fluids/FactoryFluid.java105
-rw-r--r--src/main/java/gtPlusPlus/core/fluids/FluidFactory.java349
-rw-r--r--src/main/java/gtPlusPlus/core/fluids/FluidPackage.java83
-rw-r--r--src/main/java/gtPlusPlus/core/fluids/FluidRegistryHandler.java80
-rw-r--r--src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java582
-rw-r--r--src/main/java/gtPlusPlus/core/gui/GUI_Base_Tile_Entity.java11
-rw-r--r--src/main/java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java96
-rw-r--r--src/main/java/gtPlusPlus/core/gui/beta/Gui_Types.java11
-rw-r--r--src/main/java/gtPlusPlus/core/gui/beta/MU_GuiId.java43
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java205
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java1125
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java957
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/box/GuiBaseBox.java198
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/box/LunchBoxGui.java6
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/box/MagicBagGui.java6
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/box/ToolBoxGui.java6
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_CircuitProgrammer.java64
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_DecayablesChest.java90
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java89
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_FishTrap.java90
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java53
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java132
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java257
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_ProjectTable.java98
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java201
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_ScrollTest.java146
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_SuperJukebox.java135
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java75
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java473
-rw-r--r--src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java172
-rw-r--r--src/main/java/gtPlusPlus/core/handler/AchievementHandler.java787
-rw-r--r--src/main/java/gtPlusPlus/core/handler/BookHandler.java774
-rw-r--r--src/main/java/gtPlusPlus/core/handler/BurnableFuelHandler.java45
-rw-r--r--src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java500
-rw-r--r--src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java124
-rw-r--r--src/main/java/gtPlusPlus/core/handler/CraftingManager.java16
-rw-r--r--src/main/java/gtPlusPlus/core/handler/EnumHelperHandler.java18
-rw-r--r--src/main/java/gtPlusPlus/core/handler/GuiHandler.java383
-rw-r--r--src/main/java/gtPlusPlus/core/handler/MobMentality.java85
-rw-r--r--src/main/java/gtPlusPlus/core/handler/OldCircuitHandler.java119
-rw-r--r--src/main/java/gtPlusPlus/core/handler/PacketHandler.java132
-rw-r--r--src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java50
-rw-r--r--src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java33
-rw-r--r--src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java31
-rw-r--r--src/main/java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java66
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java411
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java279
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java95
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java211
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java228
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/LoginEventHandler.java225
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/MissingMappingsEvent.java81
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java132
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java168
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/PlayerTickHandler.java12
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/SneakManager.java241
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java242
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java82
-rw-r--r--src/main/java/gtPlusPlus/core/handler/render/CapeHandler.java201
-rw-r--r--src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java223
-rw-r--r--src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java89
-rw-r--r--src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java340
-rw-r--r--src/main/java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java65
-rw-r--r--src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java10
-rw-r--r--src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java2
-rw-r--r--src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java79
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java435
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java420
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java311
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java318
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java318
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java318
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java333
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java359
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java294
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java435
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java332
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java340
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/Inventory_DecayablesChest.java318
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/Inventory_EggBox.java318
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java311
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/Inventory_SuperJukebox.java311
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/Inventory_VolumetricFlaskSetter.java311
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java15
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java15
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java15
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java361
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java359
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java359
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java333
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java359
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java333
-rw-r--r--src/main/java/gtPlusPlus/core/item/ModItems.java2664
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseEuItem.java1197
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java149
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemBrain.java167
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java75
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemColourable.java169
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java2048
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java368
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemGeneric.java34
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemLoot.java193
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemTCShard.java137
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java645
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemWithCharge.java113
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java38
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java458
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/CoreItem.java535
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java97
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java126
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java267
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java68
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustEx.java209
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java288
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java94
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java94
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/foil/BaseItemFoil.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/foods/BaseItemFood.java81
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java131
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/gears/BaseItemGear.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/gears/BaseItemSmallGear.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java23
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java193
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java173
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java111
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java106
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockDoor.java191
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java57
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java337
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java149
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java173
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java180
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java291
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java202
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java51
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java304
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java94
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCrushedOre.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ore/BaseItemMilledOre.java26
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java501
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java22
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java22
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java70
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java157
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/rings/BaseItemRing.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRod.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java17
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java8
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/wire/BaseItemFineWire.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java338
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java457
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java352
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java234
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java46
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java786
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java298
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java1196
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/CoalTar.java710
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java2366
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/IonParticles.java277
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java1565
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java198
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/OilChem.java66
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java2223
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java286
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java587
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java260
-rw-r--r--src/main/java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java432
-rw-r--r--src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java169
-rw-r--r--src/main/java/gtPlusPlus/core/item/effects/RarityEffect.java32
-rw-r--r--src/main/java/gtPlusPlus/core/item/effects/RarityEpic.java28
-rw-r--r--src/main/java/gtPlusPlus/core/item/effects/RarityRare.java28
-rw-r--r--src/main/java/gtPlusPlus/core/item/effects/RarityUncommon.java20
-rw-r--r--src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java928
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java117
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/BedLocator_Base.java184
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/BufferCore.java100
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemAirFilter.java247
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java371
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java157
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java272
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java516
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemCloakingDevice.java496
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java202
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemCreativeTab.java88
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemEmpty.java22
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java139
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java341
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java515
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemHalfCompleteCasings.java97
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java748
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java201
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java447
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java245
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java19
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java366
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java595
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/books/ItemBaseBook.java199
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java463
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/chassis/ItemBoilerChassis.java127
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoil.java140
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoilWire.java140
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java412
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java17
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/rfchargingpack/ChargingPackBase.java133
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java534
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java49
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java49
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java190
-rw-r--r--src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java113
-rw-r--r--src/main/java/gtPlusPlus/core/item/init/ItemsMultiTools.java102
-rw-r--r--src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java159
-rw-r--r--src/main/java/gtPlusPlus/core/item/materials/MaterialHandler.java7
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/ConnectedBlockFinder.java248
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/DebugScanner.java168
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/FakeGregtechTool.java109
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java2562
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java131
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java16
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/box/BaseBoxItem.java90
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/box/ContainerBoxBase.java634
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/box/CustomBoxInventory.java433
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java14
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java17
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java585
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java237
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java648
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java884
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java789
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/WearableLoader.java15
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/armour/ArmourLoader.java56
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmour.java7
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourBoots.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourChest.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourHelm.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourLegs.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/armour/hazmat/ArmourHazmat.java186
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/armour/tinfoil/ArmourTinFoilHat.java290
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/base/BaseItemWearable.java100
-rw-r--r--src/main/java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java37
-rw-r--r--src/main/java/gtPlusPlus/core/lib/CORE.java669
-rw-r--r--src/main/java/gtPlusPlus/core/lib/LoadedMods.java725
-rw-r--r--src/main/java/gtPlusPlus/core/lib/VanillaColours.java51
-rw-r--r--src/main/java/gtPlusPlus/core/material/ALLOY.java2003
-rw-r--r--src/main/java/gtPlusPlus/core/material/ELEMENT.java1157
-rw-r--r--src/main/java/gtPlusPlus/core/material/Ion.java44
-rw-r--r--src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java1188
-rw-r--r--src/main/java/gtPlusPlus/core/material/Material.java3296
-rw-r--r--src/main/java/gtPlusPlus/core/material/MaterialGenerator.java767
-rw-r--r--src/main/java/gtPlusPlus/core/material/MaterialStack.java214
-rw-r--r--src/main/java/gtPlusPlus/core/material/NONMATERIAL.java70
-rw-r--r--src/main/java/gtPlusPlus/core/material/ORES.java1669
-rw-r--r--src/main/java/gtPlusPlus/core/material/Particle.java280
-rw-r--r--src/main/java/gtPlusPlus/core/material/gregtech/CustomGTMaterials.java148
-rw-r--r--src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java510
-rw-r--r--src/main/java/gtPlusPlus/core/material/nuclear/NUCLIDE.java686
-rw-r--r--src/main/java/gtPlusPlus/core/material/state/MaterialState.java30
-rw-r--r--src/main/java/gtPlusPlus/core/network/handler/AbstractClientMessageHandler.java9
-rw-r--r--src/main/java/gtPlusPlus/core/network/handler/AbstractMessageHandler.java45
-rw-r--r--src/main/java/gtPlusPlus/core/network/handler/AbstractServerMessageHandler.java7
-rw-r--r--src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java3
-rw-r--r--src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui.java224
-rw-r--r--src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui2.java222
-rw-r--r--src/main/java/gtPlusPlus/core/players/FakeFarmer.java133
-rw-r--r--src/main/java/gtPlusPlus/core/potion/GtPotionEffect.java7
-rw-r--r--src/main/java/gtPlusPlus/core/proxy/ClientProxy.java460
-rw-r--r--src/main/java/gtPlusPlus/core/proxy/ServerProxy.java34
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java175
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java467
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_Extruder.java81
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java4834
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java1227
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java293
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java40
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java1140
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java7875
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java1092
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java429
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java319
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java50
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java358
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPE_Batteries.java85
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/ShapedRecipeObject.java80
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/common/CI.java2589
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotAirFilter.java35
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotBlueprint.java38
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotBuzzSaw.java122
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java57
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotCrafting.java279
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java271
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotDataStick.java59
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotElectric.java71
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotFrame.java27
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotFuelRod.java88
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotGeneric.java23
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotGtTool.java44
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotGtToolElectric.java169
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java175
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java35
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotJukebox.java52
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotLockedInput.java94
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotLunchBox.java40
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotMagicToolBag.java39
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java44
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java85
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotNoInput.java23
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotNoInputLogging.java44
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotOutput.java159
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotPollutionScrubber.java95
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotRTG.java27
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotToolBox.java204
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotVolumetricFlask.java30
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java75
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java56
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/base/TileBasicTank.java278
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java2017
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/base/TilePoweredGT.java95
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java578
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java692
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java692
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java48
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java797
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java224
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java249
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityPlayerDoorBase.java487
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java558
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java764
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java518
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java762
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java231
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java411
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java922
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java927
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java216
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java558
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java1348
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java235
-rw-r--r--src/main/java/gtPlusPlus/core/util/MovingAverageLong.java3
-rw-r--r--src/main/java/gtPlusPlus/core/util/Utils.java1808
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/AES.java154
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java192
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/EnumUtils.java75
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/FileUtils.java164
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/LocaleUtils.java136
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/LoggingUtils.java76
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/StringUtils.java425
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/UUIDUtils.java29
-rw-r--r--src/main/java/gtPlusPlus/core/util/debug/DEBUG_INIT.java51
-rw-r--r--src/main/java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java83
-rw-r--r--src/main/java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java1849
-rw-r--r--src/main/java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java54
-rw-r--r--src/main/java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java104
-rw-r--r--src/main/java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java1426
-rw-r--r--src/main/java/gtPlusPlus/core/util/math/MathUtils.java1559
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/ClientUtils.java15
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/EnchantingUtils.java173
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/EnergyUtils.java233
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/EntityUtils.java458
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java1446
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/FoodUtils.java94
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java1141
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java131
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java2777
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/LangUtils.java264
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java1012
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java483
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/ModularArmourUtils.java305
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java1128
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/OreDictUtils.java29
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java460
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java1538
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/ShapelessUtils.java72
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java322
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/gregtech/material/MaterialBuilder.java482
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/gregtech/recipehandlers/GregtechRecipe.java2
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/network/CustomPacket.java52
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/network/PacketBuilder.java33
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/network/PacketDispatcher.java127
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/network/PacketHandler.java94
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/network/PacketTileEntity.java114
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/particles/BlockBreakParticles.java16
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/particles/EntityParticleFXMysterious.java25
-rw-r--r--src/main/java/gtPlusPlus/core/util/player/PlayerCache.java289
-rw-r--r--src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java466
-rw-r--r--src/main/java/gtPlusPlus/core/util/reflect/ProxyFinder.java90
-rw-r--r--src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java2172
-rw-r--r--src/main/java/gtPlusPlus/core/util/sys/KeyboardUtils.java61
-rw-r--r--src/main/java/gtPlusPlus/core/util/sys/Log.java26
-rw-r--r--src/main/java/gtPlusPlus/core/util/sys/SystemUtils.java153
-rw-r--r--src/main/java/gtPlusPlus/core/world/damage/BaseCustomDamageSource.java23
-rw-r--r--src/main/java/gtPlusPlus/core/world/explosions/ExplosionHandler.java58
-rw-r--r--src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java626
-rw-r--r--src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java349
-rw-r--r--src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java173
-rw-r--r--src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java255
-rw-r--r--src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java42
-rw-r--r--src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java42
-rw-r--r--src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldGround.java29
-rw-r--r--src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPollutedDirt.java108
-rw-r--r--src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPortalFrame.java40
-rw-r--r--src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldSludgeFluid.java172
-rw-r--r--src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java770
-rw-r--r--src/main/java/gtPlusPlus/everglades/block/DarkWorldContentLoader.java111
-rw-r--r--src/main/java/gtPlusPlus/everglades/dimension/Dimension_Everglades.java34
-rw-r--r--src/main/java/gtPlusPlus/everglades/gen/WorldGenDeadLilly.java12
-rw-r--r--src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java141
-rw-r--r--src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT.java89
-rw-r--r--src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java983
-rw-r--r--src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java1073
-rw-r--r--src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_Ores.java180
-rw-r--r--src/main/java/gtPlusPlus/everglades/item/ItemBlockToxicEverglades.java53
-rw-r--r--src/main/java/gtPlusPlus/everglades/item/ItemEvergladesPortalTrigger.java169
-rw-r--r--src/main/java/gtPlusPlus/everglades/object/BoxedQuad.java101
-rw-r--r--src/main/java/gtPlusPlus/everglades/world/CustomWorldType.java99
-rw-r--r--src/main/java/gtPlusPlus/everglades/world/EvergladesPortalPosition.java16
-rw-r--r--src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java918
-rw-r--r--src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java482
-rw-r--r--src/main/java/gtPlusPlus/everglades/world/WorldProviderMod.java99
-rw-r--r--src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java483
-rw-r--r--src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java86
-rw-r--r--src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java67
-rw-r--r--src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java46
-rw-r--r--src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java659
-rw-r--r--src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java37
-rw-r--r--src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java39
-rw-r--r--src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java79
-rw-r--r--src/main/java/gtPlusPlus/nei/NEI_GT_Config.java172
-rw-r--r--src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java16
-rw-r--r--src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java243
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java107
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java7
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java2695
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java108
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/IAlgalItem.java7
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java149
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/fluids/FluidLoader.java26
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java550
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java410
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java434
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java252
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java4
-rw-r--r--src/main/java/gtPlusPlus/plugin/fishing/Core_Fishing.java91
-rw-r--r--src/main/java/gtPlusPlus/plugin/fishing/block/BlockFishEggs.java9
-rw-r--r--src/main/java/gtPlusPlus/plugin/fishing/item/BaseFish.java59
-rw-r--r--src/main/java/gtPlusPlus/plugin/fishing/misc/BaseFishTypes.java243
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java3
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java150
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java102
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java127
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java210
-rw-r--r--src/main/java/gtPlusPlus/plugin/manager/Core_Manager.java193
-rw-r--r--src/main/java/gtPlusPlus/plugin/sulfurchem/Core_SulfuricChemistry.java547
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/Core_VillagerAdditions.java198
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/NameLists.java10748
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/VillagerEventHandler.java70
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/VillagerObject.java64
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/VillagerUtils.java30
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/block/BlockGenericSpawner.java45
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java1051
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java1024
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/entity/trade/BaseVillagerTrade.java42
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/tile/MobSpawnerCustomLogic.java98
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/tile/TileEntityGenericSpawner.java462
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerAboriginal.java276
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBanker.java30
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBase.java11
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTechnician.java30
-rw-r--r--src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java64
-rw-r--r--src/main/java/gtPlusPlus/plugin/waila/Core_WailaPlugin.java99
-rw-r--r--src/main/java/gtPlusPlus/preloader/CORE_Preloader.java47
-rw-r--r--src/main/java/gtPlusPlus/preloader/ChunkDebugger.java89
-rw-r--r--src/main/java/gtPlusPlus/preloader/CustomClassLoader.java81
-rw-r--r--src/main/java/gtPlusPlus/preloader/DevHelper.java14173
-rw-r--r--src/main/java/gtPlusPlus/preloader/Preloader_GT_OreDict.java366
-rw-r--r--src/main/java/gtPlusPlus/preloader/Preloader_Logger.java98
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java389
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/ClassesToTransform.java137
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/Preloader_DummyContainer.java159
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java111
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/Preloader_SetupClass.java22
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_CC.java24
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_GT.java27
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_CC_GuiContainerManager.java223
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java331
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_ChunkLoading.java1653
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_EntityLivingBase_SetHealth.java221
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_EntityAutoRocket.java1187
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FluidUtil.java525
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FuelLoader.java1591
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements.java4272
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements_CrashFix.java440
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BaseMetaTileEntity.java313
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity.java512
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_NBT.java387
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java353
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client.java764
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_ItemMachines_Tooltip.java268
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_MetaGenerated_Tool.java184
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Packet_TileEntity.java636
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java546
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java404
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_Hazmat.java272
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard.java532
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidCartHandling.java202
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidHelper.java1688
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_InvTools.java428
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java476
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java1216
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TiConFluids.java296
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer.java115
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java21
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java563
-rw-r--r--src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java159
-rw-r--r--src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java11
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartcrops/HANDLER_CropsPlusPlus.java22
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java188
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java55
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java79
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java106
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java86
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java90
-rw-r--r--src/main/java/gtPlusPlus/xmod/bartworks/BW_Utils.java141
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java335
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java490
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java180
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java122
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java338
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java39
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java32
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java75
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LeavesRainforestTree.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LogRainforestTree.java32
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java99
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/creative/MiscUtilsBOPTab.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenPineTree.java316
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java468
-rw-r--r--src/main/java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java11
-rw-r--r--src/main/java/gtPlusPlus/xmod/computronics/HANDLER_Computronics.java81
-rw-r--r--src/main/java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java127
-rw-r--r--src/main/java/gtPlusPlus/xmod/eio/material/MaterialEIO.java216
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java186
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/BlockDenseBeeHouse.java13
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/FR_BlockRegistry.java30
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java119
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java1414
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java306
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Branch_Definition.java128
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/custom/ItemCustomComb.java434
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/gui/ContainerBeeHouse.java34
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/gui/GuiBeeHouse.java55
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java93
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java53
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java89
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java43
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/inventory/InventoryDenseBeeHouse.java146
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java173
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java252
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java251
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java221
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java185
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java117
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java123
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java286
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_AlleleBeeSpecies.java67
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java498
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bee_Mutation.java39
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java63
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java10
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java127
-rw-r--r--src/main/java/gtPlusPlus/xmod/galacticraft/HANDLER_GalactiCraft.java49
-rw-r--r--src/main/java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java132
-rw-r--r--src/main/java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java294
-rw-r--r--src/main/java/gtPlusPlus/xmod/goodgenerator/GG_Utils.java90
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java1112
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java85
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java140
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java142
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomOrePrefix.java230
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java2068
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java33
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java3476
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java298
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java351
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java11
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java53
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java49
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java38
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java110
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java86
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java55
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java41
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java137
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MetaTileMachineLong.java470
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java493
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java24
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java139
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java160
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java143
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java167
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SuperChest.java103
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_TreeFarmer.java109
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedBoiler.java10
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java35
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java56
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Hatch_Muffler_Advanced.java71
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java121
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java58
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java143
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java612
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java42
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java130
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java218
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java79
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java71
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java84
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SuperChest.java55
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_TreeFarmer.java76
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedLong.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedValueManager.java1
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java210
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricInventoryManager.java509
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java84
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricInventoryManager.java218
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java168
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_Container_CropHarvestor.java326
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java118
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java115
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java734
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_RedstoneCircuitBlock.java293
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java349
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java187
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java318
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java220
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java67
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_HatchNbtConsumable.java198
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java10
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_HatchNbtConsumable.java52
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java17
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java14
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java22
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/CONTAINER_BasicTank.java89
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/GUI_BasicTank.java46
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java206
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java202
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java123
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java9
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java49
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IBaseCustomMetaTileEntity.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatSink.java13
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java12
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java861
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java26
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java79
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java34
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java16
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java362
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java347
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java651
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java1399
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java431
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java1115
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java1124
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java184
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java233
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Pump.java275
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java326
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java382
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java552
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java610
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java350
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java71
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java47
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java142
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java539
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java140
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java282
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java371
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java693
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java204
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java46
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java96
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java131
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java318
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java547
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java420
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java366
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java614
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java385
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java427
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java395
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java205
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java505
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java124
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java757
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java382
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java258
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java326
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java250
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java422
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java99
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java74
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java354
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java964
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java125
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java221
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java5472
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java1318
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java861
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java713
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java441
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java731
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java572
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java355
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java60
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java60
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java559
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java37
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java281
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java94
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java30
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/util/GTPP_Config.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java166
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java46
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java28
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java74
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java398
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java82
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java20
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java91
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java56
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java38
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java1176
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java549
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java988
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java457
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java114
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java131
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java693
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java184
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java148
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java260
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java156
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java9
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java53
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java98
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java117
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java204
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java167
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java172
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java266
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java146
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java98
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java118
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java300
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java947
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java957
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java266
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java1578
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java47
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java92
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java601
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java132
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java702
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java269
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java198
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java488
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java342
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java349
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java848
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java58
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java97
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java122
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java55
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java1935
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java305
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java203
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java132
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java476
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java715
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java389
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java1571
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java171
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java147
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java388
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java174
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java226
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java57
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java996
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java1401
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java1586
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java1006
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java1443
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java1151
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java553
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java75
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java93
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java93
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java384
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java647
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java310
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java297
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java300
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java278
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java369
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java751
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java33
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java37
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java424
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java1372
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java613
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java1689
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java294
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java702
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java835
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java935
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java832
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java466
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java239
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java104
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java1283
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java1382
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java1386
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java93
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java104
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java1249
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java1152
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java949
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java737
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java564
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java430
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java818
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java419
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java391
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java728
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java318
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java408
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java388
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java594
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java444
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java398
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java447
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java997
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java414
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java390
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java24
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java377
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java484
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java623
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java347
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java898
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java1296
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java851
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java1302
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java889
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java951
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java199
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java239
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java358
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java259
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java264
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java1223
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java679
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java1376
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java35
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java852
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java111
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java77
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java1046
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java966
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java1070
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java609
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java847
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java1185
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java996
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java1135
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java651
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java1314
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java453
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java1491
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java953
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java1255
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java1936
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java95
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java298
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java150
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java151
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java1620
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java1025
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java1521
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java1812
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java674
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java230
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java436
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java954
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java115
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java288
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java83
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java1069
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java127
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java1101
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java393
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java310
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java897
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java107
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java180
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java693
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java49
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java68
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java87
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java65
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java500
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java351
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java340
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java397
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java330
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java282
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java125
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java541
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java27
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java221
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java215
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java209
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java206
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java174
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java6
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java104
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java119
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Base.java15
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java490
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java351
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java463
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java841
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java311
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java453
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java464
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java424
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java498
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java139
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java342
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java1188
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java71
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java307
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java744
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java588
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java13
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java315
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java367
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java38
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GlueLine.java285
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java275
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java95
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java1311
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java689
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java3992
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java81
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java117
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java167
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java105
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java281
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java251
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedMixer.java358
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java80
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAmazonWarehouse.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java187
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java1249
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java1826
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java423
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCyclotron.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java428
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java315
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java44
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java37
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java82
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java138
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java488
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialArcFurnace.java26
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java30
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java19
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialExtruder.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFishPond.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java30
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java248
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMixer.java30
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiMachine.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java10
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialThermalCentrifuge.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialTreeFarm.java30
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWashPlant.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java30
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java26
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java54
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java40
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java392
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java96
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java74
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java68
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java309
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java325
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSemiFluidgenerators.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java185
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java76
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java63
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java28
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java28
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java170
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java11
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java343
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java93
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTreeFarmerTE.java24
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java115
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/NewHorizonsAccelerator.java295
-rw-r--r--src/main/java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java430
-rw-r--r--src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_New.java145
-rw-r--r--src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java145
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/CustomInternalName.java26
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java33
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java372
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java117
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java48
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java85
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java115
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java48
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java33
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/IC2_ContainerBase.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java135
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java703
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java482
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java57
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java85
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java153
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/IC2_Items.java107
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java85
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/RotorBase.java177
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/RotorIridium.java224
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/item/reactor/IC2_FuelRod_Base.java85
-rw-r--r--src/main/java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java803
-rw-r--r--src/main/java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java625
-rw-r--r--src/main/java/gtPlusPlus/xmod/ob/GliderHandler.java202
-rw-r--r--src/main/java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java41
-rw-r--r--src/main/java/gtPlusPlus/xmod/ob/SprinklerHandler.java89
-rw-r--r--src/main/java/gtPlusPlus/xmod/railcraft/HANDLER_Railcraft.java240
-rw-r--r--src/main/java/gtPlusPlus/xmod/railcraft/utils/RailcraftUtils.java20
-rw-r--r--src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java285
-rw-r--r--src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java77
-rw-r--r--src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java90
-rw-r--r--src/main/java/gtPlusPlus/xmod/sc2/HANDLER_SC2.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java196
-rw-r--r--src/main/java/gtPlusPlus/xmod/sol/HANDLER_SpiceOfLife.java92
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/HANDLER_Thaumcraft.java93
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectCompat.java335
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectStack.java13
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/commands/CommandDumpAspects.java135
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java268
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_AspectList_Wrapper.java56
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_Aspect_Wrapper.java602
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/Base_Recipe_Wrapper.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_CrucibleRecipe_Wrapper.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_IArcaneRecipe_Wrapper.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionEnchantmentRecipe_Wrapper.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionRecipe_Wrapper.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_PageType_Wrapper.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategories_Wrapper.java155
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategoryList_Wrapper.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchItem_Wrapper.java472
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchNoteData_Wrapper.java17
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchPage_Wrapper.java426
-rw-r--r--src/main/java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java905
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java60
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java343
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Ender.java100
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java376
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java34
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java130
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java141
-rw-r--r--src/main/java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java158
-rw-r--r--src/main/java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java159
-rw-r--r--src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java473
-rw-r--r--src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java199
-rw-r--r--src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java1089
-rw-r--r--src/main/java/gtPlusPlus/xmod/witchery/WitchUtils.java159
-rw-r--r--src/main/java/vswe/stevescarts/ModuleData/GppModuleData.java55
1403 files changed, 258137 insertions, 227504 deletions
diff --git a/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java b/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java
index 729642e837..e83e46ce59 100644
--- a/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java
+++ b/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java
@@ -1,13 +1,12 @@
package Ic2ExpReactorPlanner;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.List;
-
import Ic2ExpReactorPlanner.components.ReactorItem;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
/**
*
@@ -15,677 +14,693 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerC
*/
public class AutomationSimulator {
- private final Reactor reactor;
+ private final Reactor reactor;
- private final ArrayList<String> output;
+ private final ArrayList<String> output;
- private final GT_TileEntity_ComputerCube mReactor;
+ private final GT_TileEntity_ComputerCube mReactor;
- private final boolean[][] needsCooldown = new boolean[6][9];
+ private final boolean[][] needsCooldown = new boolean[6][9];
- private final int initialHeat;
+ private final int initialHeat;
- private double minEUoutput = Double.MAX_VALUE;
- private double maxEUoutput = 0.0;
- private double minHeatOutput = Double.MAX_VALUE;
- private double maxHeatOutput = 0.0;
+ private double minEUoutput = Double.MAX_VALUE;
+ private double maxEUoutput = 0.0;
+ private double minHeatOutput = Double.MAX_VALUE;
+ private double maxHeatOutput = 0.0;
- private final int onPulseDuration;
- private final int offPulseDuration;
- private final int clockPeriod;
- private final int suspendTemp;
- private final int resumeTemp;
- private final int maxSimulationTicks;
+ private final int onPulseDuration;
+ private final int offPulseDuration;
+ private final int clockPeriod;
+ private final int suspendTemp;
+ private final int resumeTemp;
+ private final int maxSimulationTicks;
- private boolean reachedBelow50;
- private boolean reachedBurn;
- private boolean reachedEvaporate;
- private boolean reachedHurt;
- private boolean reachedLava;
- private boolean reachedExplode;
+ private boolean reachedBelow50;
+ private boolean reachedBurn;
+ private boolean reachedEvaporate;
+ private boolean reachedHurt;
+ private boolean reachedLava;
+ private boolean reachedExplode;
- private boolean allFuelRodsDepleted = false;
- private boolean componentsIntact = true;
- private boolean anyRodsDepleted = false;
+ private boolean allFuelRodsDepleted = false;
+ private boolean componentsIntact = true;
+ private boolean anyRodsDepleted = false;
- private int activeTime = 0;
- private int inactiveTime = 0;
- private int currentActiveTime = 0;
- private int minActiveTime = Integer.MAX_VALUE;
- private int maxActiveTime = 0;
- private int currentInactiveTime = 0;
- private int minInactiveTime = Integer.MAX_VALUE;
- private int maxInactiveTime = 0;
+ private int activeTime = 0;
+ private int inactiveTime = 0;
+ private int currentActiveTime = 0;
+ private int minActiveTime = Integer.MAX_VALUE;
+ private int maxActiveTime = 0;
+ private int currentInactiveTime = 0;
+ private int minInactiveTime = Integer.MAX_VALUE;
+ private int maxInactiveTime = 0;
- private double totalHullHeating = 0;
- private double totalComponentHeating = 0;
- private double totalHullCooling = 0;
- private double totalVentCooling = 0;
+ private double totalHullHeating = 0;
+ private double totalComponentHeating = 0;
+ private double totalHullCooling = 0;
+ private double totalVentCooling = 0;
- private boolean showHeatingCoolingCalled = false;
+ private boolean showHeatingCoolingCalled = false;
- private boolean active = true;
+ private boolean active = true;
- private int pauseTimer = 0;
+ private int pauseTimer = 0;
- private int redstoneUsed = 0;
+ private int redstoneUsed = 0;
- private int lapisUsed = 0;
+ private int lapisUsed = 0;
+ private boolean completed = false;
- private boolean completed = false;
-
- private boolean mRunning = false;
+ private boolean mRunning = false;
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#,##0.##");
- private final SimulationData data = new SimulationData();
- public SimulationData getData() {
- if (completed) {
- return data;
- }
- return null;
- }
-
- public AutomationSimulator(final Reactor reactor, final ArrayList<String> output2, final GT_TileEntity_ComputerCube aTile) {
- this.reactor = reactor;
- this.output = output2;
- this.mReactor = aTile;
- this.initialHeat = (int) reactor.getCurrentHeat();
- this.onPulseDuration = reactor.getOnPulse();
- this.offPulseDuration = reactor.getOffPulse();
- this.clockPeriod = onPulseDuration + offPulseDuration;
- this.suspendTemp = reactor.getSuspendTemp();
- this.resumeTemp = reactor.getResumeTemp();
- this.maxSimulationTicks = reactor.getMaxSimulationTicks();
- }
-
- public void process() {
-
- mRunning = true;
- completed = false;
- long startTime = System.nanoTime();
- int reactorTicks = 0;
- int cooldownTicks = 0;
- int totalRodCount = 0;
-
- publish(""); // NOI18N
- publish("Simulation.Started");
- reactor.setCurrentHeat(initialHeat);
- reactor.clearVentedHeat();
- double minReactorHeat = initialHeat;
- double maxReactorHeat = initialHeat;
- reachedBelow50 = false;
- reachedBurn = initialHeat >= 0.4 * reactor.getMaxHeat();
- reachedEvaporate = initialHeat >= 0.5 * reactor.getMaxHeat();
- reachedHurt = initialHeat >= 0.7 * reactor.getMaxHeat();
- reachedLava = initialHeat >= 0.85 * reactor.getMaxHeat();
- reachedExplode = false;
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null) {
- component.clearCurrentHeat();
- component.clearDamage();
- totalRodCount += component.getRodCount();
- }
- publish(String.format("R%dC%d:0xC0C0C0", row, col)); // NOI18N
- }
- }
- data.totalRodCount = totalRodCount;
- double lastEUoutput = 0.0;
- double totalEUoutput = 0.0;
- double lastHeatOutput = 0.0;
- double totalHeatOutput = 0.0;
- double maxGeneratedHeat = 0.0;
- double explosionPower = 10.0;
- allFuelRodsDepleted = false;
- componentsIntact = true;
- anyRodsDepleted = false;
- Logger.INFO("Reactor Current Heat: "+reactor.getCurrentHeat());
- Logger.INFO("Reactor Max Heat: "+reactor.getMaxHeat());
- Logger.INFO("Least EU Output: "+lastEUoutput);
- Logger.INFO("Least Heat Output: "+lastHeatOutput);
- Logger.INFO("Reactor Max Ticks: "+maxSimulationTicks);
- Logger.INFO("All Fuel Depleted: "+allFuelRodsDepleted);
- Logger.INFO("Running: "+isRunning());
- Logger.INFO("Stopped: "+hasStopped());
- while (reactor.getCurrentHeat() < reactor.getMaxHeat() && (!allFuelRodsDepleted || lastEUoutput > 0 || lastHeatOutput > 0) && reactorTicks < maxSimulationTicks && isRunning()) {
- //Logger.INFO("Reactor Tick: "+reactorTicks);
- reactorTicks++;
- reactor.clearEUOutput();
- reactor.clearVentedHeat();
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null) {
- component.preReactorTick();
- }
- }
- }
- if (active) {
- allFuelRodsDepleted = true; // assume rods depleted until one is
- // found that isn't.
- }
- double generatedHeat = 0.0;
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null && !component.isBroken()) {
- if (allFuelRodsDepleted && component.getRodCount() > 0) {
- allFuelRodsDepleted = false;
- }
- if (active) {
- generatedHeat += component.generateHeat();
- }
- component.dissipate();
- component.transfer();
- }
- }
- }
- maxReactorHeat = Math.max(reactor.getCurrentHeat(), maxReactorHeat);
- minReactorHeat = Math.min(reactor.getCurrentHeat(), minReactorHeat);
- checkReactorTemperature(reactorTicks);
- maxGeneratedHeat = Math.max(generatedHeat, maxGeneratedHeat);
- if (active) {
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null && !component.isBroken()) {
- component.generateEnergy();
- }
- }
- }
- }
- lastEUoutput = reactor.getCurrentEUoutput();
- totalEUoutput += lastEUoutput;
- lastHeatOutput = reactor.getVentedHeat();
- totalHeatOutput += lastHeatOutput;
- if (reactor.getCurrentHeat() <= reactor.getMaxHeat()) {
- if (reactor.isPulsed() || reactor.isAutomated()) {
- if (active) {
- activeTime++;
- currentActiveTime++;
- if (reactor.isPulsed() && (reactor.getCurrentHeat() >= suspendTemp || (reactorTicks % clockPeriod) >= onPulseDuration)) {
- active = false;
- minActiveTime = Math.min(currentActiveTime, minActiveTime);
- maxActiveTime = Math.max(currentActiveTime, maxActiveTime);
- currentActiveTime = 0;
- }
- }
- else {
- inactiveTime++;
- currentInactiveTime++;
- if (reactor.isAutomated() && pauseTimer > 0) {
- pauseTimer--;
- }
- else if ((reactor.isPulsed() && reactor.getCurrentHeat() <= resumeTemp && (reactorTicks % clockPeriod) < onPulseDuration)) {
- active = true;
- minInactiveTime = Math.min(currentInactiveTime, minInactiveTime);
- maxInactiveTime = Math.max(currentInactiveTime, maxInactiveTime);
- currentInactiveTime = 0;
- }
- }
- }
- minEUoutput = Math.min(lastEUoutput, minEUoutput);
- maxEUoutput = Math.max(lastEUoutput, maxEUoutput);
- minHeatOutput = Math.min(lastHeatOutput, minHeatOutput);
- maxHeatOutput = Math.max(lastHeatOutput, maxHeatOutput);
- }
- calculateHeatingCooling(reactorTicks);
- handleAutomation(reactorTicks);
-
- }
-
- if (hasStopped()) {
- publish("Simulation.CancelledAtTick", reactorTicks);
- }
- data.minTemp = (int) minReactorHeat;
- data.maxTemp = (int) maxReactorHeat;
- publish("Simulation.ReactorMinTemp", minReactorHeat);
- publish("Simulation.ReactorMaxTemp", maxReactorHeat);
- if (reactor.getCurrentHeat() < reactor.getMaxHeat()) {
- publish("Simulation.TimeWithoutExploding", reactorTicks);
- if (reactor.isPulsed()) {
- String rangeString = "";
- if (maxActiveTime > minActiveTime) {
- rangeString = rangeString("Simulation.ActiveTimeRange", minActiveTime, maxActiveTime);
- }
- else if (minActiveTime < activeTime) {
- rangeString = "Simulation.ActiveTimeSingle "+minActiveTime;
- }
- publish("Simulation.ActiveTime", activeTime, rangeString);
- rangeString = "";
- if (maxInactiveTime > minInactiveTime) {
- rangeString = rangeString("Simulation.InactiveTimeRange", minInactiveTime, maxInactiveTime);
- }
- else if (minInactiveTime < inactiveTime) {
- rangeString = "Simulation.InactiveTimeSingle " + minInactiveTime;
- }
- publish("Simulation.InactiveTime", inactiveTime, rangeString);
- }
-
- if (reactorTicks > 0) {
- data.totalReactorTicks = reactorTicks;
- if (reactor.isFluid()) {
- data.totalHUoutput = (int) (40 * totalHeatOutput);
- data.avgHUoutput = (int) (2 * totalHeatOutput / reactorTicks);
- data.minHUoutput = 2 * minHeatOutput;
- data.maxHUoutput = (int) (2 * maxHeatOutput);
- if (totalHeatOutput > 0) {
- publish("Simulation.HeatOutputs", DECIMAL_FORMAT.format(40 * totalHeatOutput), DECIMAL_FORMAT.format(2 * totalHeatOutput / reactorTicks), DECIMAL_FORMAT.format(2
- * minHeatOutput), DECIMAL_FORMAT.format(2 * maxHeatOutput));
- if (totalRodCount > 0) {
- publish("Simulation.Efficiency", totalHeatOutput / reactorTicks / 4 / totalRodCount, minHeatOutput / 4 / totalRodCount, maxHeatOutput / 4 / totalRodCount);
- }
- }
- }
- else {
- data.totalEUoutput = (int) totalEUoutput;
- data.avgEUoutput = MathUtils.roundToClosestInt(Math.ceil(totalEUoutput / (reactorTicks * 20)));
- data.minEUoutput = minEUoutput / 20.0;
- data.maxEUoutput = (int) (maxEUoutput / 20.0);
- if (totalEUoutput > 0) {
- publish("Simulation.EUOutputs", DECIMAL_FORMAT.format(totalEUoutput), DECIMAL_FORMAT.format(totalEUoutput / (reactorTicks * 20)), DECIMAL_FORMAT.format(minEUoutput
- / 20.0), DECIMAL_FORMAT.format(maxEUoutput / 20.0));
- if (totalRodCount > 0) {
- publish("Simulation.Efficiency", totalEUoutput / reactorTicks / 100 / totalRodCount, minEUoutput / 100 / totalRodCount, maxEUoutput / 100 / totalRodCount);
- }
- }
- }
- }
-
- if (reactor.getCurrentHeat() > 0.0) {
- publish("Simulation.ReactorRemainingHeat", reactor.getCurrentHeat());
- }
- double prevReactorHeat = reactor.getCurrentHeat();
- double prevTotalComponentHeat = 0.0;
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null && !component.isBroken()) {
- if (component.getCurrentHeat() > 0.0) {
- prevTotalComponentHeat += component.getCurrentHeat();
- publish(String.format("R%dC%d:0xFFA500", row, col)); // NOI18N
- component.info.append("ComponentInfo.RemainingHeat " + component.getCurrentHeat());
- }
- }
- }
- }
- if (prevReactorHeat == 0.0 && prevTotalComponentHeat == 0.0) {
- publish("Simulation.NoCooldown");
- }
- else if (reactor.getCurrentHeat() < reactor.getMaxHeat()) {
- double currentTotalComponentHeat = prevTotalComponentHeat;
- int reactorCooldownTime = 0;
- do {
- reactor.clearVentedHeat();
- prevReactorHeat = reactor.getCurrentHeat();
- if (prevReactorHeat == 0.0) {
- reactorCooldownTime = cooldownTicks;
- }
- prevTotalComponentHeat = currentTotalComponentHeat;
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null && !component.isBroken()) {
- component.dissipate();
- component.transfer();
- }
- }
- }
- lastHeatOutput = reactor.getVentedHeat();
- totalHeatOutput += lastHeatOutput;
- minEUoutput = Math.min(lastEUoutput, minEUoutput);
- maxEUoutput = Math.max(lastEUoutput, maxEUoutput);
- minHeatOutput = Math.min(lastHeatOutput, minHeatOutput);
- maxHeatOutput = Math.max(lastHeatOutput, maxHeatOutput);
- cooldownTicks++;
- currentTotalComponentHeat = 0.0;
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null && !component.isBroken()) {
- currentTotalComponentHeat += component.getCurrentHeat();
- if (component.getCurrentHeat() == 0.0 && needsCooldown[row][col]) {
- component.info.append("ComponentInfo.CooldownTime " + cooldownTicks);
- needsCooldown[row][col] = false;
- }
- }
- }
- }
- }
- while (lastHeatOutput > 0 && cooldownTicks < 50000);
- if (reactor.getCurrentHeat() < reactor.getMaxHeat()) {
- if (reactor.getCurrentHeat() == 0.0) {
- publish("Simulation.ReactorCooldownTime", reactorCooldownTime);
- }
- else if (reactorCooldownTime > 0) {
- publish("Simulation.ReactorResidualHeat", reactor.getCurrentHeat(), reactorCooldownTime);
- }
- publish("Simulation.TotalCooldownTime", cooldownTicks);
- }
- }
- }
- else {
- publish("Simulation.ReactorOverheatedTime", reactorTicks);
- explosionPower = 10.0;
- double explosionPowerMult = 1.0;
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null) {
- explosionPower += component.getExplosionPowerOffset();
- explosionPowerMult *= component.getExplosionPowerMultiplier();
- }
- }
- }
- explosionPower *= explosionPowerMult;
- publish("Simulation.ExplosionPower", explosionPower);
- }
- double totalEffectiveVentCooling = 0.0;
- double totalVentCoolingCapacity = 0.0;
- double totalCellCooling = 0.0;
- double totalCondensatorCooling = 0.0;
-
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null) {
- if (component.getVentCoolingCapacity() > 0) {
- component.info.append("ComponentInfo.UsedCooling " + component.getBestVentCooling() + " | " + component.getVentCoolingCapacity());
- totalEffectiveVentCooling += component.getBestVentCooling();
- totalVentCoolingCapacity += component.getVentCoolingCapacity();
- }
- else if (component.getBestCellCooling() > 0) {
- component.info.append("ComponentInfo.ReceivedHeat " + component.getBestCellCooling());
- totalCellCooling += component.getBestCellCooling();
- }
- else if (component.getBestCondensatorCooling() > 0) {
- component.info.append("ComponentInfo.ReceivedHeat " + component.getBestCondensatorCooling());
- totalCondensatorCooling += component.getBestCondensatorCooling();
- }
- else if (component.getMaxHeatGenerated() > 0) {
- if (!reactor.isFluid() && component.getMaxEUGenerated() > 0) {
- component.info.append("ComponentInfo.GeneratedEU " + component.getMinEUGenerated() + " | " + component.getMaxEUGenerated());
- }
- component.info.append("ComponentInfo.GeneratedHeat " + component.getMinHeatGenerated() + " | " + component.getMaxHeatGenerated());
- }
- if (component.getMaxReachedHeat() > 0) {
- component.info.append("ComponentInfo.ReachedHeat " + component.getMaxReachedHeat() + " | " + component.getMaxHeat());
- }
- }
- }
- }
-
- // if (totalVentCoolingCapacity > 0) {
- // publish("Simulation.TotalVentCooling",
- // totalEffectiveVentCooling, totalVentCoolingCapacity);
- // }
- showHeatingCooling(reactorTicks); // Call to show this info in case it
- // hasn't already been shown, such
- // as for an automated reactor.
- if (totalCellCooling > 0) {
- publish("Simulation.TotalCellCooling", totalCellCooling);
- }
- if (totalCondensatorCooling > 0) {
- publish("Simulation.TotalCondensatorCooling", totalCondensatorCooling);
- }
- if (maxGeneratedHeat > 0) {
- publish("Simulation.MaxHeatGenerated", maxGeneratedHeat);
- }
- if (redstoneUsed > 0) {
- publish("Simulation.RedstoneUsed", redstoneUsed);
- }
- if (lapisUsed > 0) {
- publish("Simulation.LapisUsed", lapisUsed);
- }
- // double totalCooling = totalEffectiveVentCooling + totalCellCooling +
- // totalCondensatorCooling;
- // if (totalCooling >= maxGeneratedHeat) {
- // publish("Simulation.ExcessCooling", totalCooling -
- // maxGeneratedHeat);
- // } else {
- // publish("Simulation.ExcessHeating", maxGeneratedHeat -
- // totalCooling);
- // }
- // return null;
-
- /* catch (Throwable e) {
- if (cooldownTicks == 0) {
- publish("Simulation.ErrorReactor", reactorTicks);
- } else {
- publish("Simulation.ErrorCooldown", cooldownTicks);
- }
- publish(e.toString(), " ", Arrays.toString(e.getStackTrace()); // NO18N
-
- }*/
- data.explosionPower = (int) explosionPower;
- data.totalReactorTicks = reactorTicks;
- long endTime = System.nanoTime();
- publish("Simulation.ElapsedTime", (endTime - startTime) / 1e9);
- mRunning = false;
- completed = true;
- }
-
-
- public boolean hasStopped() {
- return !mRunning;
- }
-
- public boolean isRunning() {
- return mRunning;
- }
-
- private void handleAutomation(final int reactorTicks) {
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null && reactor.isAutomated()) {
- if (component.getMaxHeat() > 1) {
- if (component.getAutomationThreshold() > component.getInitialHeat() && component.getCurrentHeat() >= component.getAutomationThreshold()) {
- component.clearCurrentHeat();
- component.info.append("ComponentInfo.ReplacedTime | " + reactorTicks);
- if (component.getReactorPause() > 0) {
- active = false;
- pauseTimer = Math.max(pauseTimer, component.getReactorPause());
- minActiveTime = Math.min(currentActiveTime, minActiveTime);
- maxActiveTime = Math.max(currentActiveTime, maxActiveTime);
- currentActiveTime = 0;
- }
- }
- else if (component.getAutomationThreshold() < component.getInitialHeat() && component.getCurrentHeat() <= component.getAutomationThreshold()) {
- component.clearCurrentHeat();
- component.info.append("ComponentInfo.ReplacedTime | " +reactorTicks);
- if (component.getReactorPause() > 0) {
- active = false;
- pauseTimer = Math.max(pauseTimer, component.getReactorPause());
- minActiveTime = Math.min(currentActiveTime, minActiveTime);
- maxActiveTime = Math.max(currentActiveTime, maxActiveTime);
- currentActiveTime = 0;
- }
- }
- }
- else if (component.isBroken() || (component.getMaxDamage() > 1 && component.getCurrentDamage() >= component.getAutomationThreshold())) {
- component.clearDamage();
- component.info.append("ComponentInfo.ReplacedTime | " +reactorTicks);
- if (component.getReactorPause() > 0) {
- active = false;
- pauseTimer = Math.max(pauseTimer, component.getReactorPause());
- minActiveTime = Math.min(currentActiveTime, minActiveTime);
- maxActiveTime = Math.max(currentActiveTime, maxActiveTime);
- currentActiveTime = 0;
- }
- }
- }
- if (reactor.isUsingReactorCoolantInjectors() && component != null && component.needsCoolantInjected()) {
- component.injectCoolant();
- if ("rshCondensator".equals(component.baseName)) {
- redstoneUsed++;
- }
- else if ("lzhCondensator".equals(component.baseName)) {
- lapisUsed++;
- }
- }
- }
- }
- }
-
- private void checkReactorTemperature(final int reactorTicks) {
- if (reactor.getCurrentHeat() < 0.5 * reactor.getMaxHeat() && !reachedBelow50 && reachedEvaporate) {
- publish("Simulation.TimeToBelow50", reactorTicks);
- reachedBelow50 = true;
- data.timeToBelow50 = reactorTicks;
- }
- if (reactor.getCurrentHeat() >= 0.4 * reactor.getMaxHeat() && !reachedBurn) {
- publish("Simulation.TimeToBurn", reactorTicks);
- reachedBurn = true;
- data.timeToBurn = reactorTicks;
- }
- if (reactor.getCurrentHeat() >= 0.5 * reactor.getMaxHeat() && !reachedEvaporate) {
- publish("Simulation.TimeToEvaporate", reactorTicks);
- reachedEvaporate = true;
- data.timeToEvaporate = reactorTicks;
- }
- if (reactor.getCurrentHeat() >= 0.7 * reactor.getMaxHeat() && !reachedHurt) {
- publish("Simulation.TimeToHurt", reactorTicks);
- reachedHurt = true;
- data.timeToHurt = reactorTicks;
- }
- if (reactor.getCurrentHeat() >= 0.85 * reactor.getMaxHeat() && !reachedLava) {
- publish("Simulation.TimeToLava", reactorTicks);
- reachedLava = true;
- data.timeToLava = reactorTicks;
- }
- if (reactor.getCurrentHeat() >= reactor.getMaxHeat() && !reachedExplode) {
- publish("Simulation.TimeToXplode", reactorTicks);
- reachedExplode = true;
- data.timeToXplode = reactorTicks;
- }
- }
-
- private void calculateHeatingCooling(final int reactorTicks) {
- if (reactorTicks > 20) {
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null) {
- totalHullHeating += component.getCurrentHullHeating();
- totalComponentHeating += component.getCurrentComponentHeating();
- totalHullCooling += component.getCurrentHullCooling();
- totalVentCooling += component.getCurrentVentCooling();
- }
- }
- }
- }
- }
-
- private void showHeatingCooling(final int reactorTicks) {
- if (!showHeatingCoolingCalled) {
- showHeatingCoolingCalled = true;
- if (reactorTicks >= 40) {
- double totalHullCoolingCapacity = 0;
- double totalVentCoolingCapacity = 0;
- for (int row = 0; row < 6; row++) {
- for (int col = 0; col < 9; col++) {
- ReactorItem component = reactor.getComponentAt(row, col);
- if (component != null) {
- totalHullCoolingCapacity += component.getHullCoolingCapacity();
- totalVentCoolingCapacity += component.getVentCoolingCapacity();
- }
- }
- }
- data.hullHeating = totalHullHeating / (reactorTicks - 20);
- data.componentHeating = totalComponentHeating / (reactorTicks - 20);
- data.hullCooling = totalHullCooling / (reactorTicks - 20);
- data.hullCoolingCapacity = totalHullCoolingCapacity;
- data.ventCooling = totalVentCooling / (reactorTicks - 20);
- data.ventCoolingCapacity = totalVentCoolingCapacity;
- if (totalHullHeating > 0) {
- publish("Simulation.HullHeating", totalHullHeating / (reactorTicks - 20));
- }
- if (totalComponentHeating > 0) {
- publish("Simulation.ComponentHeating", totalComponentHeating / (reactorTicks - 20));
- }
- if (totalHullCoolingCapacity > 0) {
- publish("Simulation.HullCooling | " +totalHullCooling / (reactorTicks - 20), totalHullCoolingCapacity);
- }
- if (totalVentCoolingCapacity > 0) {
- publish("Simulation.VentCooling | " +totalVentCooling / (reactorTicks - 20), totalVentCoolingCapacity);
- }
- }
- }
- }
-
- private void publish(String string, double currentHeat, int reactorCooldownTime) {
- publish(string + " | "+currentHeat+" | "+reactorCooldownTime);
- }
-
- private void publish(String string, double d, double e, double f) {
- publish(string + " | "+d+" | "+e+" | "+f);
- }
-
- private void publish(String string, String format, String format2, String format3, String format4) {
- publish(string + " | "+format+" | "+format2+" | "+format3+" | "+format4);
- }
-
- private void publish(String string, int activeTime2, String rangeString) {
- publish(string + " | "+activeTime2+" | "+rangeString);
- }
-
- private void publish(String aString, double aData) {
- publish(aString+":"+aData);
- }
-
- private void publish(String aString, long aData) {
- publish(aString+":"+aData);
- }
-
- private void publish(String aString) {
- output.add(aString);
- }
-
- private String rangeString(String string, int aMin, int aMax) {
- return string+" ("+aMin+"-"+aMax+")";
- }
-
-
- protected void process(List<String> chunks) {
- /*
- for (String chunk : chunks) {
- if (chunk.isEmpty()) {
- output.add(""); // NO18N
- }
- else {
- if (chunk.matches("R\\dC\\d:.*")) { // NO18N
- String temp = chunk.substring(5);
- int row = chunk.charAt(1) - '0';
- int col = chunk.charAt(3) - '0';
- if (temp.startsWith("0x")) { // NO18N
- mReactorComponents[row][col].setBackground(Color.decode(temp));
- if ("0xC0C0C0".equals(temp)) {
- mReactorComponents[row][col].setToolTipText(null);
- }
- else if ("0xFF0000".equals(temp)) {
- mReactorComponents[row][col].setToolTipText(getI18n("ComponentTooltip.Broken"));
- }
- else if ("0xFFA500".equals(temp)) {
- mReactorComponents[row][col].setToolTipText(getI18n("ComponentTooltip.ResidualHeat"));
- }
- }
- }
- else {
- output.add(chunk);
- }
- }
- }
- */
- }
-
- public void cancel() {
- Logger.INFO("Stopping Simulation.");
- mRunning = false;
- completed = true;
- }
-
-
+ private final SimulationData data = new SimulationData();
+
+ public SimulationData getData() {
+ if (completed) {
+ return data;
+ }
+ return null;
+ }
+
+ public AutomationSimulator(
+ final Reactor reactor, final ArrayList<String> output2, final GT_TileEntity_ComputerCube aTile) {
+ this.reactor = reactor;
+ this.output = output2;
+ this.mReactor = aTile;
+ this.initialHeat = (int) reactor.getCurrentHeat();
+ this.onPulseDuration = reactor.getOnPulse();
+ this.offPulseDuration = reactor.getOffPulse();
+ this.clockPeriod = onPulseDuration + offPulseDuration;
+ this.suspendTemp = reactor.getSuspendTemp();
+ this.resumeTemp = reactor.getResumeTemp();
+ this.maxSimulationTicks = reactor.getMaxSimulationTicks();
+ }
+
+ public void process() {
+
+ mRunning = true;
+ completed = false;
+ long startTime = System.nanoTime();
+ int reactorTicks = 0;
+ int cooldownTicks = 0;
+ int totalRodCount = 0;
+
+ publish(""); // NOI18N
+ publish("Simulation.Started");
+ reactor.setCurrentHeat(initialHeat);
+ reactor.clearVentedHeat();
+ double minReactorHeat = initialHeat;
+ double maxReactorHeat = initialHeat;
+ reachedBelow50 = false;
+ reachedBurn = initialHeat >= 0.4 * reactor.getMaxHeat();
+ reachedEvaporate = initialHeat >= 0.5 * reactor.getMaxHeat();
+ reachedHurt = initialHeat >= 0.7 * reactor.getMaxHeat();
+ reachedLava = initialHeat >= 0.85 * reactor.getMaxHeat();
+ reachedExplode = false;
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null) {
+ component.clearCurrentHeat();
+ component.clearDamage();
+ totalRodCount += component.getRodCount();
+ }
+ publish(String.format("R%dC%d:0xC0C0C0", row, col)); // NOI18N
+ }
+ }
+ data.totalRodCount = totalRodCount;
+ double lastEUoutput = 0.0;
+ double totalEUoutput = 0.0;
+ double lastHeatOutput = 0.0;
+ double totalHeatOutput = 0.0;
+ double maxGeneratedHeat = 0.0;
+ double explosionPower = 10.0;
+ allFuelRodsDepleted = false;
+ componentsIntact = true;
+ anyRodsDepleted = false;
+ Logger.INFO("Reactor Current Heat: " + reactor.getCurrentHeat());
+ Logger.INFO("Reactor Max Heat: " + reactor.getMaxHeat());
+ Logger.INFO("Least EU Output: " + lastEUoutput);
+ Logger.INFO("Least Heat Output: " + lastHeatOutput);
+ Logger.INFO("Reactor Max Ticks: " + maxSimulationTicks);
+ Logger.INFO("All Fuel Depleted: " + allFuelRodsDepleted);
+ Logger.INFO("Running: " + isRunning());
+ Logger.INFO("Stopped: " + hasStopped());
+ while (reactor.getCurrentHeat() < reactor.getMaxHeat()
+ && (!allFuelRodsDepleted || lastEUoutput > 0 || lastHeatOutput > 0)
+ && reactorTicks < maxSimulationTicks
+ && isRunning()) {
+ // Logger.INFO("Reactor Tick: "+reactorTicks);
+ reactorTicks++;
+ reactor.clearEUOutput();
+ reactor.clearVentedHeat();
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null) {
+ component.preReactorTick();
+ }
+ }
+ }
+ if (active) {
+ allFuelRodsDepleted = true; // assume rods depleted until one is
+ // found that isn't.
+ }
+ double generatedHeat = 0.0;
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null && !component.isBroken()) {
+ if (allFuelRodsDepleted && component.getRodCount() > 0) {
+ allFuelRodsDepleted = false;
+ }
+ if (active) {
+ generatedHeat += component.generateHeat();
+ }
+ component.dissipate();
+ component.transfer();
+ }
+ }
+ }
+ maxReactorHeat = Math.max(reactor.getCurrentHeat(), maxReactorHeat);
+ minReactorHeat = Math.min(reactor.getCurrentHeat(), minReactorHeat);
+ checkReactorTemperature(reactorTicks);
+ maxGeneratedHeat = Math.max(generatedHeat, maxGeneratedHeat);
+ if (active) {
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null && !component.isBroken()) {
+ component.generateEnergy();
+ }
+ }
+ }
+ }
+ lastEUoutput = reactor.getCurrentEUoutput();
+ totalEUoutput += lastEUoutput;
+ lastHeatOutput = reactor.getVentedHeat();
+ totalHeatOutput += lastHeatOutput;
+ if (reactor.getCurrentHeat() <= reactor.getMaxHeat()) {
+ if (reactor.isPulsed() || reactor.isAutomated()) {
+ if (active) {
+ activeTime++;
+ currentActiveTime++;
+ if (reactor.isPulsed()
+ && (reactor.getCurrentHeat() >= suspendTemp
+ || (reactorTicks % clockPeriod) >= onPulseDuration)) {
+ active = false;
+ minActiveTime = Math.min(currentActiveTime, minActiveTime);
+ maxActiveTime = Math.max(currentActiveTime, maxActiveTime);
+ currentActiveTime = 0;
+ }
+ } else {
+ inactiveTime++;
+ currentInactiveTime++;
+ if (reactor.isAutomated() && pauseTimer > 0) {
+ pauseTimer--;
+ } else if ((reactor.isPulsed()
+ && reactor.getCurrentHeat() <= resumeTemp
+ && (reactorTicks % clockPeriod) < onPulseDuration)) {
+ active = true;
+ minInactiveTime = Math.min(currentInactiveTime, minInactiveTime);
+ maxInactiveTime = Math.max(currentInactiveTime, maxInactiveTime);
+ currentInactiveTime = 0;
+ }
+ }
+ }
+ minEUoutput = Math.min(lastEUoutput, minEUoutput);
+ maxEUoutput = Math.max(lastEUoutput, maxEUoutput);
+ minHeatOutput = Math.min(lastHeatOutput, minHeatOutput);
+ maxHeatOutput = Math.max(lastHeatOutput, maxHeatOutput);
+ }
+ calculateHeatingCooling(reactorTicks);
+ handleAutomation(reactorTicks);
+ }
+
+ if (hasStopped()) {
+ publish("Simulation.CancelledAtTick", reactorTicks);
+ }
+ data.minTemp = (int) minReactorHeat;
+ data.maxTemp = (int) maxReactorHeat;
+ publish("Simulation.ReactorMinTemp", minReactorHeat);
+ publish("Simulation.ReactorMaxTemp", maxReactorHeat);
+ if (reactor.getCurrentHeat() < reactor.getMaxHeat()) {
+ publish("Simulation.TimeWithoutExploding", reactorTicks);
+ if (reactor.isPulsed()) {
+ String rangeString = "";
+ if (maxActiveTime > minActiveTime) {
+ rangeString = rangeString("Simulation.ActiveTimeRange", minActiveTime, maxActiveTime);
+ } else if (minActiveTime < activeTime) {
+ rangeString = "Simulation.ActiveTimeSingle " + minActiveTime;
+ }
+ publish("Simulation.ActiveTime", activeTime, rangeString);
+ rangeString = "";
+ if (maxInactiveTime > minInactiveTime) {
+ rangeString = rangeString("Simulation.InactiveTimeRange", minInactiveTime, maxInactiveTime);
+ } else if (minInactiveTime < inactiveTime) {
+ rangeString = "Simulation.InactiveTimeSingle " + minInactiveTime;
+ }
+ publish("Simulation.InactiveTime", inactiveTime, rangeString);
+ }
+
+ if (reactorTicks > 0) {
+ data.totalReactorTicks = reactorTicks;
+ if (reactor.isFluid()) {
+ data.totalHUoutput = (int) (40 * totalHeatOutput);
+ data.avgHUoutput = (int) (2 * totalHeatOutput / reactorTicks);
+ data.minHUoutput = 2 * minHeatOutput;
+ data.maxHUoutput = (int) (2 * maxHeatOutput);
+ if (totalHeatOutput > 0) {
+ publish(
+ "Simulation.HeatOutputs",
+ DECIMAL_FORMAT.format(40 * totalHeatOutput),
+ DECIMAL_FORMAT.format(2 * totalHeatOutput / reactorTicks),
+ DECIMAL_FORMAT.format(2 * minHeatOutput),
+ DECIMAL_FORMAT.format(2 * maxHeatOutput));
+ if (totalRodCount > 0) {
+ publish(
+ "Simulation.Efficiency",
+ totalHeatOutput / reactorTicks / 4 / totalRodCount,
+ minHeatOutput / 4 / totalRodCount,
+ maxHeatOutput / 4 / totalRodCount);
+ }
+ }
+ } else {
+ data.totalEUoutput = (int) totalEUoutput;
+ data.avgEUoutput = MathUtils.roundToClosestInt(Math.ceil(totalEUoutput / (reactorTicks * 20)));
+ data.minEUoutput = minEUoutput / 20.0;
+ data.maxEUoutput = (int) (maxEUoutput / 20.0);
+ if (totalEUoutput > 0) {
+ publish(
+ "Simulation.EUOutputs",
+ DECIMAL_FORMAT.format(totalEUoutput),
+ DECIMAL_FORMAT.format(totalEUoutput / (reactorTicks * 20)),
+ DECIMAL_FORMAT.format(minEUoutput / 20.0),
+ DECIMAL_FORMAT.format(maxEUoutput / 20.0));
+ if (totalRodCount > 0) {
+ publish(
+ "Simulation.Efficiency",
+ totalEUoutput / reactorTicks / 100 / totalRodCount,
+ minEUoutput / 100 / totalRodCount,
+ maxEUoutput / 100 / totalRodCount);
+ }
+ }
+ }
+ }
+
+ if (reactor.getCurrentHeat() > 0.0) {
+ publish("Simulation.ReactorRemainingHeat", reactor.getCurrentHeat());
+ }
+ double prevReactorHeat = reactor.getCurrentHeat();
+ double prevTotalComponentHeat = 0.0;
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null && !component.isBroken()) {
+ if (component.getCurrentHeat() > 0.0) {
+ prevTotalComponentHeat += component.getCurrentHeat();
+ publish(String.format("R%dC%d:0xFFA500", row, col)); // NOI18N
+ component.info.append("ComponentInfo.RemainingHeat " + component.getCurrentHeat());
+ }
+ }
+ }
+ }
+ if (prevReactorHeat == 0.0 && prevTotalComponentHeat == 0.0) {
+ publish("Simulation.NoCooldown");
+ } else if (reactor.getCurrentHeat() < reactor.getMaxHeat()) {
+ double currentTotalComponentHeat = prevTotalComponentHeat;
+ int reactorCooldownTime = 0;
+ do {
+ reactor.clearVentedHeat();
+ prevReactorHeat = reactor.getCurrentHeat();
+ if (prevReactorHeat == 0.0) {
+ reactorCooldownTime = cooldownTicks;
+ }
+ prevTotalComponentHeat = currentTotalComponentHeat;
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null && !component.isBroken()) {
+ component.dissipate();
+ component.transfer();
+ }
+ }
+ }
+ lastHeatOutput = reactor.getVentedHeat();
+ totalHeatOutput += lastHeatOutput;
+ minEUoutput = Math.min(lastEUoutput, minEUoutput);
+ maxEUoutput = Math.max(lastEUoutput, maxEUoutput);
+ minHeatOutput = Math.min(lastHeatOutput, minHeatOutput);
+ maxHeatOutput = Math.max(lastHeatOutput, maxHeatOutput);
+ cooldownTicks++;
+ currentTotalComponentHeat = 0.0;
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null && !component.isBroken()) {
+ currentTotalComponentHeat += component.getCurrentHeat();
+ if (component.getCurrentHeat() == 0.0 && needsCooldown[row][col]) {
+ component.info.append("ComponentInfo.CooldownTime " + cooldownTicks);
+ needsCooldown[row][col] = false;
+ }
+ }
+ }
+ }
+ } while (lastHeatOutput > 0 && cooldownTicks < 50000);
+ if (reactor.getCurrentHeat() < reactor.getMaxHeat()) {
+ if (reactor.getCurrentHeat() == 0.0) {
+ publish("Simulation.ReactorCooldownTime", reactorCooldownTime);
+ } else if (reactorCooldownTime > 0) {
+ publish("Simulation.ReactorResidualHeat", reactor.getCurrentHeat(), reactorCooldownTime);
+ }
+ publish("Simulation.TotalCooldownTime", cooldownTicks);
+ }
+ }
+ } else {
+ publish("Simulation.ReactorOverheatedTime", reactorTicks);
+ explosionPower = 10.0;
+ double explosionPowerMult = 1.0;
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null) {
+ explosionPower += component.getExplosionPowerOffset();
+ explosionPowerMult *= component.getExplosionPowerMultiplier();
+ }
+ }
+ }
+ explosionPower *= explosionPowerMult;
+ publish("Simulation.ExplosionPower", explosionPower);
+ }
+ double totalEffectiveVentCooling = 0.0;
+ double totalVentCoolingCapacity = 0.0;
+ double totalCellCooling = 0.0;
+ double totalCondensatorCooling = 0.0;
+
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null) {
+ if (component.getVentCoolingCapacity() > 0) {
+ component.info.append("ComponentInfo.UsedCooling " + component.getBestVentCooling() + " | "
+ + component.getVentCoolingCapacity());
+ totalEffectiveVentCooling += component.getBestVentCooling();
+ totalVentCoolingCapacity += component.getVentCoolingCapacity();
+ } else if (component.getBestCellCooling() > 0) {
+ component.info.append("ComponentInfo.ReceivedHeat " + component.getBestCellCooling());
+ totalCellCooling += component.getBestCellCooling();
+ } else if (component.getBestCondensatorCooling() > 0) {
+ component.info.append("ComponentInfo.ReceivedHeat " + component.getBestCondensatorCooling());
+ totalCondensatorCooling += component.getBestCondensatorCooling();
+ } else if (component.getMaxHeatGenerated() > 0) {
+ if (!reactor.isFluid() && component.getMaxEUGenerated() > 0) {
+ component.info.append("ComponentInfo.GeneratedEU " + component.getMinEUGenerated() + " | "
+ + component.getMaxEUGenerated());
+ }
+ component.info.append("ComponentInfo.GeneratedHeat " + component.getMinHeatGenerated() + " | "
+ + component.getMaxHeatGenerated());
+ }
+ if (component.getMaxReachedHeat() > 0) {
+ component.info.append("ComponentInfo.ReachedHeat " + component.getMaxReachedHeat() + " | "
+ + component.getMaxHeat());
+ }
+ }
+ }
+ }
+
+ // if (totalVentCoolingCapacity > 0) {
+ // publish("Simulation.TotalVentCooling",
+ // totalEffectiveVentCooling, totalVentCoolingCapacity);
+ // }
+ showHeatingCooling(reactorTicks); // Call to show this info in case it
+ // hasn't already been shown, such
+ // as for an automated reactor.
+ if (totalCellCooling > 0) {
+ publish("Simulation.TotalCellCooling", totalCellCooling);
+ }
+ if (totalCondensatorCooling > 0) {
+ publish("Simulation.TotalCondensatorCooling", totalCondensatorCooling);
+ }
+ if (maxGeneratedHeat > 0) {
+ publish("Simulation.MaxHeatGenerated", maxGeneratedHeat);
+ }
+ if (redstoneUsed > 0) {
+ publish("Simulation.RedstoneUsed", redstoneUsed);
+ }
+ if (lapisUsed > 0) {
+ publish("Simulation.LapisUsed", lapisUsed);
+ }
+ // double totalCooling = totalEffectiveVentCooling + totalCellCooling +
+ // totalCondensatorCooling;
+ // if (totalCooling >= maxGeneratedHeat) {
+ // publish("Simulation.ExcessCooling", totalCooling -
+ // maxGeneratedHeat);
+ // } else {
+ // publish("Simulation.ExcessHeating", maxGeneratedHeat -
+ // totalCooling);
+ // }
+ // return null;
+
+ /* catch (Throwable e) {
+ if (cooldownTicks == 0) {
+ publish("Simulation.ErrorReactor", reactorTicks);
+ } else {
+ publish("Simulation.ErrorCooldown", cooldownTicks);
+ }
+ publish(e.toString(), " ", Arrays.toString(e.getStackTrace()); // NO18N
+
+ }*/
+ data.explosionPower = (int) explosionPower;
+ data.totalReactorTicks = reactorTicks;
+ long endTime = System.nanoTime();
+ publish("Simulation.ElapsedTime", (endTime - startTime) / 1e9);
+ mRunning = false;
+ completed = true;
+ }
+
+ public boolean hasStopped() {
+ return !mRunning;
+ }
+
+ public boolean isRunning() {
+ return mRunning;
+ }
+
+ private void handleAutomation(final int reactorTicks) {
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null && reactor.isAutomated()) {
+ if (component.getMaxHeat() > 1) {
+ if (component.getAutomationThreshold() > component.getInitialHeat()
+ && component.getCurrentHeat() >= component.getAutomationThreshold()) {
+ component.clearCurrentHeat();
+ component.info.append("ComponentInfo.ReplacedTime | " + reactorTicks);
+ if (component.getReactorPause() > 0) {
+ active = false;
+ pauseTimer = Math.max(pauseTimer, component.getReactorPause());
+ minActiveTime = Math.min(currentActiveTime, minActiveTime);
+ maxActiveTime = Math.max(currentActiveTime, maxActiveTime);
+ currentActiveTime = 0;
+ }
+ } else if (component.getAutomationThreshold() < component.getInitialHeat()
+ && component.getCurrentHeat() <= component.getAutomationThreshold()) {
+ component.clearCurrentHeat();
+ component.info.append("ComponentInfo.ReplacedTime | " + reactorTicks);
+ if (component.getReactorPause() > 0) {
+ active = false;
+ pauseTimer = Math.max(pauseTimer, component.getReactorPause());
+ minActiveTime = Math.min(currentActiveTime, minActiveTime);
+ maxActiveTime = Math.max(currentActiveTime, maxActiveTime);
+ currentActiveTime = 0;
+ }
+ }
+ } else if (component.isBroken()
+ || (component.getMaxDamage() > 1
+ && component.getCurrentDamage() >= component.getAutomationThreshold())) {
+ component.clearDamage();
+ component.info.append("ComponentInfo.ReplacedTime | " + reactorTicks);
+ if (component.getReactorPause() > 0) {
+ active = false;
+ pauseTimer = Math.max(pauseTimer, component.getReactorPause());
+ minActiveTime = Math.min(currentActiveTime, minActiveTime);
+ maxActiveTime = Math.max(currentActiveTime, maxActiveTime);
+ currentActiveTime = 0;
+ }
+ }
+ }
+ if (reactor.isUsingReactorCoolantInjectors() && component != null && component.needsCoolantInjected()) {
+ component.injectCoolant();
+ if ("rshCondensator".equals(component.baseName)) {
+ redstoneUsed++;
+ } else if ("lzhCondensator".equals(component.baseName)) {
+ lapisUsed++;
+ }
+ }
+ }
+ }
+ }
+
+ private void checkReactorTemperature(final int reactorTicks) {
+ if (reactor.getCurrentHeat() < 0.5 * reactor.getMaxHeat() && !reachedBelow50 && reachedEvaporate) {
+ publish("Simulation.TimeToBelow50", reactorTicks);
+ reachedBelow50 = true;
+ data.timeToBelow50 = reactorTicks;
+ }
+ if (reactor.getCurrentHeat() >= 0.4 * reactor.getMaxHeat() && !reachedBurn) {
+ publish("Simulation.TimeToBurn", reactorTicks);
+ reachedBurn = true;
+ data.timeToBurn = reactorTicks;
+ }
+ if (reactor.getCurrentHeat() >= 0.5 * reactor.getMaxHeat() && !reachedEvaporate) {
+ publish("Simulation.TimeToEvaporate", reactorTicks);
+ reachedEvaporate = true;
+ data.timeToEvaporate = reactorTicks;
+ }
+ if (reactor.getCurrentHeat() >= 0.7 * reactor.getMaxHeat() && !reachedHurt) {
+ publish("Simulation.TimeToHurt", reactorTicks);
+ reachedHurt = true;
+ data.timeToHurt = reactorTicks;
+ }
+ if (reactor.getCurrentHeat() >= 0.85 * reactor.getMaxHeat() && !reachedLava) {
+ publish("Simulation.TimeToLava", reactorTicks);
+ reachedLava = true;
+ data.timeToLava = reactorTicks;
+ }
+ if (reactor.getCurrentHeat() >= reactor.getMaxHeat() && !reachedExplode) {
+ publish("Simulation.TimeToXplode", reactorTicks);
+ reachedExplode = true;
+ data.timeToXplode = reactorTicks;
+ }
+ }
+
+ private void calculateHeatingCooling(final int reactorTicks) {
+ if (reactorTicks > 20) {
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null) {
+ totalHullHeating += component.getCurrentHullHeating();
+ totalComponentHeating += component.getCurrentComponentHeating();
+ totalHullCooling += component.getCurrentHullCooling();
+ totalVentCooling += component.getCurrentVentCooling();
+ }
+ }
+ }
+ }
+ }
+
+ private void showHeatingCooling(final int reactorTicks) {
+ if (!showHeatingCoolingCalled) {
+ showHeatingCoolingCalled = true;
+ if (reactorTicks >= 40) {
+ double totalHullCoolingCapacity = 0;
+ double totalVentCoolingCapacity = 0;
+ for (int row = 0; row < 6; row++) {
+ for (int col = 0; col < 9; col++) {
+ ReactorItem component = reactor.getComponentAt(row, col);
+ if (component != null) {
+ totalHullCoolingCapacity += component.getHullCoolingCapacity();
+ totalVentCoolingCapacity += component.getVentCoolingCapacity();
+ }
+ }
+ }
+ data.hullHeating = totalHullHeating / (reactorTicks - 20);
+ data.componentHeating = totalComponentHeating / (reactorTicks - 20);
+ data.hullCooling = totalHullCooling / (reactorTicks - 20);
+ data.hullCoolingCapacity = totalHullCoolingCapacity;
+ data.ventCooling = totalVentCooling / (reactorTicks - 20);
+ data.ventCoolingCapacity = totalVentCoolingCapacity;
+ if (totalHullHeating > 0) {
+ publish("Simulation.HullHeating", totalHullHeating / (reactorTicks - 20));
+ }
+ if (totalComponentHeating > 0) {
+ publish("Simulation.ComponentHeating", totalComponentHeating / (reactorTicks - 20));
+ }
+ if (totalHullCoolingCapacity > 0) {
+ publish(
+ "Simulation.HullCooling | " + totalHullCooling / (reactorTicks - 20),
+ totalHullCoolingCapacity);
+ }
+ if (totalVentCoolingCapacity > 0) {
+ publish(
+ "Simulation.VentCooling | " + totalVentCooling / (reactorTicks - 20),
+ totalVentCoolingCapacity);
+ }
+ }
+ }
+ }
+
+ private void publish(String string, double currentHeat, int reactorCooldownTime) {
+ publish(string + " | " + currentHeat + " | " + reactorCooldownTime);
+ }
+
+ private void publish(String string, double d, double e, double f) {
+ publish(string + " | " + d + " | " + e + " | " + f);
+ }
+
+ private void publish(String string, String format, String format2, String format3, String format4) {
+ publish(string + " | " + format + " | " + format2 + " | " + format3 + " | " + format4);
+ }
+
+ private void publish(String string, int activeTime2, String rangeString) {
+ publish(string + " | " + activeTime2 + " | " + rangeString);
+ }
+
+ private void publish(String aString, double aData) {
+ publish(aString + ":" + aData);
+ }
+
+ private void publish(String aString, long aData) {
+ publish(aString + ":" + aData);
+ }
+
+ private void publish(String aString) {
+ output.add(aString);
+ }
+
+ private String rangeString(String string, int aMin, int aMax) {
+ return string + " (" + aMin + "-" + aMax + ")";
+ }
+
+ protected void process(List<String> chunks) {
+ /*
+ for (String chunk : chunks) {
+ if (chunk.isEmpty()) {
+ output.add(""); // NO18N
+ }
+ else {
+ if (chunk.matches("R\\dC\\d:.*")) { // NO18N
+ String temp = chunk.substring(5);
+ int row = chunk.charAt(1) - '0';
+ int col = chunk.charAt(3) - '0';
+ if (temp.startsWith("0x")) { // NO18N
+ mReactorComponents[row][col].setBackground(Color.decode(temp));
+ if ("0xC0C0C0".equals(temp)) {
+ mReactorComponents[row][col].setToolTipText(null);
+ }
+ else if ("0xFF0000".equals(temp)) {
+ mReactorComponents[row][col].setToolTipText(getI18n("ComponentTooltip.Broken"));
+ }
+ else if ("0xFFA500".equals(temp)) {
+ mReactorComponents[row][col].setToolTipText(getI18n("ComponentTooltip.ResidualHeat"));
+ }
+ }
+ }
+ else {
+ output.add(chunk);
+ }
+ }
+ }
+ */
+ }
+
+ public void cancel() {
+ Logger.INFO("Stopping Simulation.");
+ mRunning = false;
+ completed = true;
+ }
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/BigintStorage.java b/src/main/java/Ic2ExpReactorPlanner/BigintStorage.java
index 03960cd7b1..b9ca1760c6 100644
--- a/src/main/java/Ic2ExpReactorPlanner/BigintStorage.java
+++ b/src/main/java/Ic2ExpReactorPlanner/BigintStorage.java
@@ -13,7 +13,7 @@ import java.util.Base64;
*/
public class BigintStorage {
private BigInteger storedValue = BigInteger.ZERO;
-
+
/**
* Stores the specified value. Requires that 0 &lt;= value &lt;= max.
* @param value the value to store.
@@ -25,7 +25,7 @@ public class BigintStorage {
}
storedValue = storedValue.multiply(BigInteger.valueOf(max + 1)).add(BigInteger.valueOf(value));
}
-
+
/**
* Extracts a value based on the specified maximum.
* @param max the expected maximum for the value.
@@ -36,7 +36,7 @@ public class BigintStorage {
storedValue = values[0];
return values[1].intValue();
}
-
+
/**
* Takes input of a Base64 string, and converts it to a BigintStorage.
* @param code the Base64-encoded string (presumed to be from @outputBase64)
@@ -48,7 +48,7 @@ public class BigintStorage {
result.storedValue = new BigInteger(temp);
return result;
}
-
+
/**
* Outputs the current value of this BigintStorage as a Base64-encoded string.
* @return the Base64-encoded string.
diff --git a/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java b/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java
index c613f27a32..865c3d7c41 100644
--- a/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java
+++ b/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java
@@ -5,12 +5,6 @@
*/
package Ic2ExpReactorPlanner;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.stream.Collectors;
-
import Ic2ExpReactorPlanner.components.Condensator;
import Ic2ExpReactorPlanner.components.CoolantCell;
import Ic2ExpReactorPlanner.components.Exchanger;
@@ -28,204 +22,823 @@ import gtPlusPlus.xmod.bartworks.BW_Utils;
import gtPlusPlus.xmod.bartworks.BW_Utils.NonMeta_MaterialItem;
import gtPlusPlus.xmod.goodgenerator.GG_Utils;
import gtPlusPlus.xmod.goodgenerator.GG_Utils.GG_Fuel_Rod;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
/**
* Factory class to handle creating components by id or name.
* @author Brian McCloud
*/
public class ComponentFactory {
-
- public static int MAX_COMPONENT_ID = 64;
-
- static ItemList[] aGtItems = new ItemList[]{
- ItemList.Neutron_Reflector,
- ItemList.Moxcell_1,
- ItemList.Moxcell_2,
- ItemList.Moxcell_4
- };
-
- private ComponentFactory() {
- // do nothing, this class should not be instantiated.
- }
-
- private static LinkedHashMap<Integer, ReactorItem> ITEM_LIST = new LinkedHashMap<Integer, ReactorItem>();
-
- static {
- int aID = 0;
- ITEM_LIST.put(aID++, null);
- ITEM_LIST.put(aID++, new FuelRod(1, "fuelRodUranium", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorUraniumSimple", 1).copy()), 20e3, 1, null, 100, 2, 1, false));
- ITEM_LIST.put(aID++, new FuelRod(2, "dualFuelRodUranium", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorUraniumDual", 1).copy()), 20e3, 1, null, 200, 4, 2, false));
- ITEM_LIST.put(aID++, new FuelRod(3, "quadFuelRodUranium", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorUraniumQuad", 1).copy()), 20e3, 1, null, 400, 8, 4, false));
- ITEM_LIST.put(aID++, new FuelRod(4, "fuelRodMox", new GT_ItemStack(aGtItems[1].get(1).copy()), 10e3, 1, null, 100, 2, 1, true));
- ITEM_LIST.put(aID++, new FuelRod(5, "dualFuelRodMox", new GT_ItemStack(aGtItems[2].get(1).copy()), 10e3, 1, null, 200, 4, 2, true));
- ITEM_LIST.put(aID++, new FuelRod(6, "quadFuelRodMox", new GT_ItemStack(aGtItems[3].get(1).copy()), 10e3, 1, null, 400, 8, 4, true));
- ITEM_LIST.put(aID++, new Reflector(7, "neutronReflector", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorReflector", 1).copy()), 30e3, 1, null));
- ITEM_LIST.put(aID++, new Reflector(8, "thickNeutronReflector", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorReflectorThick", 1).copy()), 120e3, 1, null));
- ITEM_LIST.put(aID++, new Vent(9, "heatVent", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVent", 1).copy()), 1, 1000, null, 6, 0, 0));
- ITEM_LIST.put(aID++, new Vent(10, "advancedHeatVent", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVentDiamond", 1).copy()), 1, 1000, null, 12, 0, 0));
- ITEM_LIST.put(aID++, new Vent(11, "reactorHeatVent", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVentCore", 1).copy()), 1, 1000, null, 5, 5, 0));
- ITEM_LIST.put(aID++, new Vent(12, "componentHeatVent", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVentSpread", 1).copy()), 1, 1, null, 0, 0, 4));
- ITEM_LIST.put(aID++, new Vent(13, "overclockedHeatVent", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVentGold", 1).copy()), 1, 1000, null, 20, 36, 0));
- ITEM_LIST.put(aID++, new CoolantCell(14, "coolantCell10k", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCoolantSimple", 1).copy()), 1, 10e3, null));
- ITEM_LIST.put(aID++, new CoolantCell(15, "coolantCell30k", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCoolantTriple", 1).copy()), 1, 30e3, null));
- ITEM_LIST.put(aID++, new CoolantCell(16, "coolantCell60k", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCoolantSix", 1).copy()), 1, 60e3, null));
- ITEM_LIST.put(aID++, new Exchanger(17, "heatExchanger", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitch", 1).copy()), 1, 2500, null, 12, 4));
- ITEM_LIST.put(aID++, new Exchanger(18, "advancedHeatExchanger", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitchDiamond", 1).copy()), 1, 10e3, null, 24, 8));
- ITEM_LIST.put(aID++, new Exchanger(19, "coreHeatExchanger", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitchCore", 1).copy()), 1, 5000, null, 0, 72));
- ITEM_LIST.put(aID++, new Exchanger(20, "componentHeatExchanger", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitchSpread", 1).copy()), 1, 5000, null, 36, 0));
- ITEM_LIST.put(aID++, new Plating(21, "reactorPlating", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorPlating", 1).copy()), 1, 1, null, 1000, 0.9025));
- ITEM_LIST.put(aID++, new Plating(22, "heatCapacityReactorPlating", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorPlatingHeat", 1).copy()), 1, 1, null, 1700, 0.9801));
- ITEM_LIST.put(aID++, new Plating(23, "containmentReactorPlating", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorPlatingExplosive", 1).copy()), 1, 1, null, 500, 0.81));
- ITEM_LIST.put(aID++, new Condensator(24, "rshCondensator", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCondensator", 1).copy()), 1, 20e3, null));
- ITEM_LIST.put(aID++, new Condensator(25, "lzhCondensator", new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCondensatorLap", 1).copy()), 1, 100e3, null));
- ITEM_LIST.put(aID++, new FuelRod(26, "fuelRodThorium", new GT_ItemStack(ItemList.ThoriumCell_1.get(1).copy()), 50e3, 1, "GregTech", 20, 0.5, 1, false));
- ITEM_LIST.put(aID++, new FuelRod(27, "dualFuelRodThorium", new GT_ItemStack(ItemList.ThoriumCell_2.get(1).copy()), 50e3, 1, "GregTech", 40, 1, 2, false));
- ITEM_LIST.put(aID++, new FuelRod(28, "quadFuelRodThorium", new GT_ItemStack(ItemList.ThoriumCell_4.get(1).copy()), 50e3, 1, "GregTech", 80, 2, 4, false));
- ITEM_LIST.put(aID++, new CoolantCell(29, "coolantCellHelium60k", new GT_ItemStack(ItemList.Reactor_Coolant_He_1.get(1).copy()), 1, 60e3, "GregTech"));
- ITEM_LIST.put(aID++, new CoolantCell(30, "coolantCellHelium180k", new GT_ItemStack(ItemList.Reactor_Coolant_He_3.get(1).copy()), 1, 180e3, "GregTech"));
- ITEM_LIST.put(aID++, new CoolantCell(31, "coolantCellHelium360k", new GT_ItemStack(ItemList.Reactor_Coolant_He_6.get(1).copy()), 1, 360e3, "GregTech"));
- ITEM_LIST.put(aID++, new CoolantCell(32, "coolantCellNak60k", new GT_ItemStack(ItemList.Reactor_Coolant_NaK_1.get(1).copy()), 1, 60e3, "GregTech"));
- ITEM_LIST.put(aID++, new CoolantCell(33, "coolantCellNak180k", new GT_ItemStack(ItemList.Reactor_Coolant_NaK_3.get(1).copy()), 1, 180e3, "GregTech"));
- ITEM_LIST.put(aID++, new CoolantCell(34, "coolantCellNak360k", new GT_ItemStack(ItemList.Reactor_Coolant_NaK_3.get(1).copy()), 1, 360e3, "GregTech"));
- ITEM_LIST.put(aID++, new Reflector(35, "iridiumNeutronReflector", new GT_ItemStack(ItemList.Neutron_Reflector.get(1).copy()), 1, 1, null));
- ITEM_LIST.put(aID++, new FuelRod(36, "fuelRodNaquadah", new GT_ItemStack(ItemList.NaquadahCell_1.get(1).copy()), 100e3, 1, "GregTech", 100, 2, 1, true));
- ITEM_LIST.put(aID++, new FuelRod(37, "dualFuelRodNaquadah", new GT_ItemStack(ItemList.NaquadahCell_2.get(1).copy()), 100e3, 1, "GregTech", 200, 4, 2, true));
- ITEM_LIST.put(aID++, new FuelRod(38, "quadFuelRodNaquadah", new GT_ItemStack(ItemList.NaquadahCell_4.get(1).copy()), 100e3, 1, "GregTech", 400, 8, 4, true));
-
- //aID = 39;
- //ITEM_LIST.put(aID++, new FuelRod(39, "fuelRodCoaxium", null, 20e3, 1, "Coaxium", 100, 0, 1, false));
- //ITEM_LIST.put(aID++, new FuelRod(40, "dualFuelRodCoaxium", null, 20e3, 1, "Coaxium", 200, 0, 2, false));
- //ITEM_LIST.put(aID++, new FuelRod(41, "quadFuelRodCoaxium", null, 20e3, 1, "Coaxium", 400, 0, 4, false));
- //ITEM_LIST.put(aID++, new FuelRod(42, "fuelRodCesium", null, 10861, 1, "Coaxium", 200, 1, 1, false));
- //ITEM_LIST.put(aID++, new FuelRod(43, "dualFuelRodCesium", null, 10861, 1, "Coaxium", 400, 6, 2, false));
- //ITEM_LIST.put(aID++, new FuelRod(44, "quadFuelRodCesium", null, 10861, 1, "Coaxium", 800, 24, 4, false));
-
- aID = 45;
- ITEM_LIST.put(aID++, new FuelRod(45, "fuelRodNaquadahGTNH", new GT_ItemStack(ItemList.NaquadahCell_1.get(1).copy()), 100e3, 1, "GTNH", 100, 2, 1, false));//Naq rods are not MOX-like in GTNH,
- ITEM_LIST.put(aID++, new FuelRod(46, "dualFuelRodNaquadahGTNH", new GT_ItemStack(ItemList.NaquadahCell_2.get(1).copy()), 100e3, 1, "GTNH", 200, 4, 2, false));//we have naquadria for that
- ITEM_LIST.put(aID++, new FuelRod(47, "quadFuelRodNaquadahGTNH", new GT_ItemStack(ItemList.NaquadahCell_4.get(1).copy()), 100e3, 1, "GTNH", 400, 8, 4, false));
- ITEM_LIST.put(aID++, new FuelRod(48, "fuelRodNaquadria", new GT_ItemStack(ItemList.MNqCell_1.get(1).copy()), 100e3, 1, "GTNH", 100, 2, 1, true));
- ITEM_LIST.put(aID++, new FuelRod(49, "dualFuelRodNaquadria", new GT_ItemStack(ItemList.MNqCell_2.get(1).copy()), 100e3, 1, "GTNH", 200, 4, 2, true));
- ITEM_LIST.put(aID++, new FuelRod(50, "quadFuelRodNaquadria", new GT_ItemStack(ItemList.MNqCell_4.get(1).copy()), 100e3, 1, "GTNH", 400, 8, 4, true));
-
- aID = 51;
- if (LoadedMods.BartWorks) {
- ITEM_LIST.put(aID++, new FuelRod(51, "fuelRodTiberium", new GT_ItemStack(BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_1, 1)), 50e3, 1, "Bartworks", 100, 1, 1, false));
- ITEM_LIST.put(aID++, new FuelRod(52, "dualFuelRodTiberium", new GT_ItemStack(BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_2, 1)), 50e3, 1, "Bartworks", 200, 2, 2, false));
- ITEM_LIST.put(aID++, new FuelRod(53, "quadFuelRodTiberium", new GT_ItemStack(BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_4, 1)), 50e3, 1, "Bartworks", 400, 4, 4, false));
- ITEM_LIST.put(aID++, new FuelRod(54, "fuelRodTheCore", new GT_ItemStack(BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TheCoreCell, 1)), 100e3, 1, "Bartworks", 72534, 816, 32, false));
- }
-
- aID = 55;
- ITEM_LIST.put(aID++, new CoolantCell(55, "coolantCellSpace180k", new GT_ItemStack(ItemList.Reactor_Coolant_Sp_1.get(1).copy()), 1, 180e3, "GTNH"));
- ITEM_LIST.put(aID++, new CoolantCell(56, "coolantCellSpace360k", new GT_ItemStack(ItemList.Reactor_Coolant_Sp_2.get(1).copy()), 1, 360e3, "GTNH"));
- ITEM_LIST.put(aID++, new CoolantCell(57, "coolantCellSpace540k", new GT_ItemStack(ItemList.Reactor_Coolant_Sp_3.get(1).copy()), 1, 540e3, "GTNH"));
- ITEM_LIST.put(aID++, new CoolantCell(58, "coolantCellSpace1080k", new GT_ItemStack(ItemList.Reactor_Coolant_Sp_6.get(1).copy()), 1, 1080e3, "GTNH"));
-
- aID = 59;
- if (LoadedMods.GoodGenerator) {
- ITEM_LIST.put(aID++, new FuelRod(59, "fuelRodCompressedUranium", new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium, 1)), 50e3, 1, "GoodGenerator", 100, 1, 1, false));
- ITEM_LIST.put(aID++, new FuelRod(60, "fuelRodDoubleCompressedUranium", new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_2, 1)), 50e3, 1, "GoodGenerator", 100, 1, 2, false));
- ITEM_LIST.put(aID++, new FuelRod(61, "fuelRodQuadCompressedUranium", new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_4, 1)), 50e3, 1, "GoodGenerator", 100, 1, 4, false));
- ITEM_LIST.put(aID++, new FuelRod(62, "fuelRodCompressedPlutonium", new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium, 1)), 50e3, 1, "GoodGenerator", 50, 1, 1, true));
- ITEM_LIST.put(aID++, new FuelRod(63, "fuelRodDoubleCompressedPlutonium", new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_2, 1)), 50e3, 1, "GoodGenerator", 50, 1, 2, true));
- ITEM_LIST.put(aID++, new FuelRod(64, "fuelRodQuadCompressedPlutonium", new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_4, 1)), 50e3, 1, "GoodGenerator", 50, 1, 4, true));
- }
-
- }
-
- private static final Map<String, ReactorItem> ITEM_MAP = makeItemMap();
-
- private static Map<String, ReactorItem> makeItemMap() {
- Map<String, ReactorItem> result = new HashMap<>((int)(ITEM_LIST.size() * 1.5));
- for (ReactorItem reactorItem : ITEM_LIST.values()) {
- if (reactorItem != null) {
- result.put(reactorItem.baseName, reactorItem);
- }
- }
- return Collections.unmodifiableMap(result);
- }
-
- private static ReactorItem copy(ReactorItem source) {
- if (source != null) {
- Class<? extends ReactorItem> aClass = source.getClass();
- if (aClass == Condensator.class) {
- return new Condensator((Condensator) source);
- } else if (aClass == CoolantCell.class) {
- return new CoolantCell((CoolantCell) source);
- } else if (aClass == Exchanger.class) {
- return new Exchanger((Exchanger) source);
- } else if (aClass == FuelRod.class) {
- return new FuelRod((FuelRod) source);
- } else if (aClass == Plating.class) {
- return new Plating((Plating) source);
- } else if (aClass == Reflector.class) {
- return new Reflector((Reflector) source);
- } else if (aClass == Vent.class) {
- return new Vent((Vent) source);
- }
- }
- return null;
- }
-
- /**
- * Gets a default instances of the specified component (such as for drawing button images)
- * @param id the id of the component.
- * @return the component with the specified id, or null if the id is out of range.
- */
- public static ReactorItem getDefaultComponent(int id) {
- ReactorItem aItem = ITEM_LIST.get(id);
- if (aItem != null) {
- return aItem;
- }
- Logger.INFO("Tried to get default component with ID "+id+". This is invalid.");
- return null;
- }
-
- /**
- * Gets a default instances of the specified component (such as for drawing button images)
- * @param name the name of the component.
- * @return the component with the specified name, or null if the name is not found.
- */
- public static ReactorItem getDefaultComponent(String name) {
- if (name != null) {
- return ITEM_MAP.get(name);
- }
- return null;
- }
-
- /**
- * Creates a new instance of the specified component.
- * @param id the id of the component to create.
- * @return a new instance of the specified component, or null if the id is out of range.
- */
- public static ReactorItem createComponent(int id) {
- ReactorItem aItem = ITEM_LIST.get(id);
- if (aItem != null) {
- return copy(aItem);
- }
- Logger.INFO("Tried to create component with ID "+id+". This is invalid.");
- return null;
- }
-
- /**
- * Creates a new instance of the specified component.
- * @param name the name of the component to create.
- * @return a new instance of the specified component, or null if the name is not found.
- */
- public static ReactorItem createComponent(String name) {
- if (name != null) {
- return copy(ITEM_MAP.get(name));
- }
- return null;
- }
-
- /**
- * Get the number of defined components.
- * @return the number of defined components.
- */
- public static int getComponentCount() {
- return ITEM_LIST.size();
- }
+ public static int MAX_COMPONENT_ID = 64;
+
+ static ItemList[] aGtItems =
+ new ItemList[] {ItemList.Neutron_Reflector, ItemList.Moxcell_1, ItemList.Moxcell_2, ItemList.Moxcell_4};
+
+ private ComponentFactory() {
+ // do nothing, this class should not be instantiated.
+ }
+
+ private static LinkedHashMap<Integer, ReactorItem> ITEM_LIST = new LinkedHashMap<Integer, ReactorItem>();
+
+ static {
+ int aID = 0;
+ ITEM_LIST.put(aID++, null);
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 1,
+ "fuelRodUranium",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorUraniumSimple", 1)
+ .copy()),
+ 20e3,
+ 1,
+ null,
+ 100,
+ 2,
+ 1,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 2,
+ "dualFuelRodUranium",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorUraniumDual", 1)
+ .copy()),
+ 20e3,
+ 1,
+ null,
+ 200,
+ 4,
+ 2,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 3,
+ "quadFuelRodUranium",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorUraniumQuad", 1)
+ .copy()),
+ 20e3,
+ 1,
+ null,
+ 400,
+ 8,
+ 4,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 4, "fuelRodMox", new GT_ItemStack(aGtItems[1].get(1).copy()), 10e3, 1, null, 100, 2, 1, true));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 5,
+ "dualFuelRodMox",
+ new GT_ItemStack(aGtItems[2].get(1).copy()),
+ 10e3,
+ 1,
+ null,
+ 200,
+ 4,
+ 2,
+ true));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 6,
+ "quadFuelRodMox",
+ new GT_ItemStack(aGtItems[3].get(1).copy()),
+ 10e3,
+ 1,
+ null,
+ 400,
+ 8,
+ 4,
+ true));
+ ITEM_LIST.put(
+ aID++,
+ new Reflector(
+ 7,
+ "neutronReflector",
+ new GT_ItemStack(
+ GT_ModHandler.getIC2Item("reactorReflector", 1).copy()),
+ 30e3,
+ 1,
+ null));
+ ITEM_LIST.put(
+ aID++,
+ new Reflector(
+ 8,
+ "thickNeutronReflector",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorReflectorThick", 1)
+ .copy()),
+ 120e3,
+ 1,
+ null));
+ ITEM_LIST.put(
+ aID++,
+ new Vent(
+ 9,
+ "heatVent",
+ new GT_ItemStack(
+ GT_ModHandler.getIC2Item("reactorVent", 1).copy()),
+ 1,
+ 1000,
+ null,
+ 6,
+ 0,
+ 0));
+ ITEM_LIST.put(
+ aID++,
+ new Vent(
+ 10,
+ "advancedHeatVent",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVentDiamond", 1)
+ .copy()),
+ 1,
+ 1000,
+ null,
+ 12,
+ 0,
+ 0));
+ ITEM_LIST.put(
+ aID++,
+ new Vent(
+ 11,
+ "reactorHeatVent",
+ new GT_ItemStack(
+ GT_ModHandler.getIC2Item("reactorVentCore", 1).copy()),
+ 1,
+ 1000,
+ null,
+ 5,
+ 5,
+ 0));
+ ITEM_LIST.put(
+ aID++,
+ new Vent(
+ 12,
+ "componentHeatVent",
+ new GT_ItemStack(
+ GT_ModHandler.getIC2Item("reactorVentSpread", 1).copy()),
+ 1,
+ 1,
+ null,
+ 0,
+ 0,
+ 4));
+ ITEM_LIST.put(
+ aID++,
+ new Vent(
+ 13,
+ "overclockedHeatVent",
+ new GT_ItemStack(
+ GT_ModHandler.getIC2Item("reactorVentGold", 1).copy()),
+ 1,
+ 1000,
+ null,
+ 20,
+ 36,
+ 0));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 14,
+ "coolantCell10k",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCoolantSimple", 1)
+ .copy()),
+ 1,
+ 10e3,
+ null));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 15,
+ "coolantCell30k",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCoolantTriple", 1)
+ .copy()),
+ 1,
+ 30e3,
+ null));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 16,
+ "coolantCell60k",
+ new GT_ItemStack(
+ GT_ModHandler.getIC2Item("reactorCoolantSix", 1).copy()),
+ 1,
+ 60e3,
+ null));
+ ITEM_LIST.put(
+ aID++,
+ new Exchanger(
+ 17,
+ "heatExchanger",
+ new GT_ItemStack(
+ GT_ModHandler.getIC2Item("reactorHeatSwitch", 1).copy()),
+ 1,
+ 2500,
+ null,
+ 12,
+ 4));
+ ITEM_LIST.put(
+ aID++,
+ new Exchanger(
+ 18,
+ "advancedHeatExchanger",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitchDiamond", 1)
+ .copy()),
+ 1,
+ 10e3,
+ null,
+ 24,
+ 8));
+ ITEM_LIST.put(
+ aID++,
+ new Exchanger(
+ 19,
+ "coreHeatExchanger",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitchCore", 1)
+ .copy()),
+ 1,
+ 5000,
+ null,
+ 0,
+ 72));
+ ITEM_LIST.put(
+ aID++,
+ new Exchanger(
+ 20,
+ "componentHeatExchanger",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitchSpread", 1)
+ .copy()),
+ 1,
+ 5000,
+ null,
+ 36,
+ 0));
+ ITEM_LIST.put(
+ aID++,
+ new Plating(
+ 21,
+ "reactorPlating",
+ new GT_ItemStack(
+ GT_ModHandler.getIC2Item("reactorPlating", 1).copy()),
+ 1,
+ 1,
+ null,
+ 1000,
+ 0.9025));
+ ITEM_LIST.put(
+ aID++,
+ new Plating(
+ 22,
+ "heatCapacityReactorPlating",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorPlatingHeat", 1)
+ .copy()),
+ 1,
+ 1,
+ null,
+ 1700,
+ 0.9801));
+ ITEM_LIST.put(
+ aID++,
+ new Plating(
+ 23,
+ "containmentReactorPlating",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorPlatingExplosive", 1)
+ .copy()),
+ 1,
+ 1,
+ null,
+ 500,
+ 0.81));
+ ITEM_LIST.put(
+ aID++,
+ new Condensator(
+ 24,
+ "rshCondensator",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCondensator", 1)
+ .copy()),
+ 1,
+ 20e3,
+ null));
+ ITEM_LIST.put(
+ aID++,
+ new Condensator(
+ 25,
+ "lzhCondensator",
+ new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCondensatorLap", 1)
+ .copy()),
+ 1,
+ 100e3,
+ null));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 26,
+ "fuelRodThorium",
+ new GT_ItemStack(ItemList.ThoriumCell_1.get(1).copy()),
+ 50e3,
+ 1,
+ "GregTech",
+ 20,
+ 0.5,
+ 1,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 27,
+ "dualFuelRodThorium",
+ new GT_ItemStack(ItemList.ThoriumCell_2.get(1).copy()),
+ 50e3,
+ 1,
+ "GregTech",
+ 40,
+ 1,
+ 2,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 28,
+ "quadFuelRodThorium",
+ new GT_ItemStack(ItemList.ThoriumCell_4.get(1).copy()),
+ 50e3,
+ 1,
+ "GregTech",
+ 80,
+ 2,
+ 4,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 29,
+ "coolantCellHelium60k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_He_1.get(1).copy()),
+ 1,
+ 60e3,
+ "GregTech"));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 30,
+ "coolantCellHelium180k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_He_3.get(1).copy()),
+ 1,
+ 180e3,
+ "GregTech"));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 31,
+ "coolantCellHelium360k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_He_6.get(1).copy()),
+ 1,
+ 360e3,
+ "GregTech"));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 32,
+ "coolantCellNak60k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_NaK_1.get(1).copy()),
+ 1,
+ 60e3,
+ "GregTech"));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 33,
+ "coolantCellNak180k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_NaK_3.get(1).copy()),
+ 1,
+ 180e3,
+ "GregTech"));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 34,
+ "coolantCellNak360k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_NaK_3.get(1).copy()),
+ 1,
+ 360e3,
+ "GregTech"));
+ ITEM_LIST.put(
+ aID++,
+ new Reflector(
+ 35,
+ "iridiumNeutronReflector",
+ new GT_ItemStack(ItemList.Neutron_Reflector.get(1).copy()),
+ 1,
+ 1,
+ null));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 36,
+ "fuelRodNaquadah",
+ new GT_ItemStack(ItemList.NaquadahCell_1.get(1).copy()),
+ 100e3,
+ 1,
+ "GregTech",
+ 100,
+ 2,
+ 1,
+ true));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 37,
+ "dualFuelRodNaquadah",
+ new GT_ItemStack(ItemList.NaquadahCell_2.get(1).copy()),
+ 100e3,
+ 1,
+ "GregTech",
+ 200,
+ 4,
+ 2,
+ true));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 38,
+ "quadFuelRodNaquadah",
+ new GT_ItemStack(ItemList.NaquadahCell_4.get(1).copy()),
+ 100e3,
+ 1,
+ "GregTech",
+ 400,
+ 8,
+ 4,
+ true));
+
+ // aID = 39;
+ // ITEM_LIST.put(aID++, new FuelRod(39, "fuelRodCoaxium", null, 20e3, 1, "Coaxium", 100, 0, 1, false));
+ // ITEM_LIST.put(aID++, new FuelRod(40, "dualFuelRodCoaxium", null, 20e3, 1, "Coaxium", 200, 0, 2, false));
+ // ITEM_LIST.put(aID++, new FuelRod(41, "quadFuelRodCoaxium", null, 20e3, 1, "Coaxium", 400, 0, 4, false));
+ // ITEM_LIST.put(aID++, new FuelRod(42, "fuelRodCesium", null, 10861, 1, "Coaxium", 200, 1, 1, false));
+ // ITEM_LIST.put(aID++, new FuelRod(43, "dualFuelRodCesium", null, 10861, 1, "Coaxium", 400, 6, 2, false));
+ // ITEM_LIST.put(aID++, new FuelRod(44, "quadFuelRodCesium", null, 10861, 1, "Coaxium", 800, 24, 4, false));
+
+ aID = 45;
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 45,
+ "fuelRodNaquadahGTNH",
+ new GT_ItemStack(ItemList.NaquadahCell_1.get(1).copy()),
+ 100e3,
+ 1,
+ "GTNH",
+ 100,
+ 2,
+ 1,
+ false)); // Naq rods are not MOX-like in GTNH,
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 46,
+ "dualFuelRodNaquadahGTNH",
+ new GT_ItemStack(ItemList.NaquadahCell_2.get(1).copy()),
+ 100e3,
+ 1,
+ "GTNH",
+ 200,
+ 4,
+ 2,
+ false)); // we have naquadria for that
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 47,
+ "quadFuelRodNaquadahGTNH",
+ new GT_ItemStack(ItemList.NaquadahCell_4.get(1).copy()),
+ 100e3,
+ 1,
+ "GTNH",
+ 400,
+ 8,
+ 4,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 48,
+ "fuelRodNaquadria",
+ new GT_ItemStack(ItemList.MNqCell_1.get(1).copy()),
+ 100e3,
+ 1,
+ "GTNH",
+ 100,
+ 2,
+ 1,
+ true));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 49,
+ "dualFuelRodNaquadria",
+ new GT_ItemStack(ItemList.MNqCell_2.get(1).copy()),
+ 100e3,
+ 1,
+ "GTNH",
+ 200,
+ 4,
+ 2,
+ true));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 50,
+ "quadFuelRodNaquadria",
+ new GT_ItemStack(ItemList.MNqCell_4.get(1).copy()),
+ 100e3,
+ 1,
+ "GTNH",
+ 400,
+ 8,
+ 4,
+ true));
+
+ aID = 51;
+ if (LoadedMods.BartWorks) {
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 51,
+ "fuelRodTiberium",
+ new GT_ItemStack(
+ BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_1, 1)),
+ 50e3,
+ 1,
+ "Bartworks",
+ 100,
+ 1,
+ 1,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 52,
+ "dualFuelRodTiberium",
+ new GT_ItemStack(
+ BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_2, 1)),
+ 50e3,
+ 1,
+ "Bartworks",
+ 200,
+ 2,
+ 2,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 53,
+ "quadFuelRodTiberium",
+ new GT_ItemStack(
+ BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_4, 1)),
+ 50e3,
+ 1,
+ "Bartworks",
+ 400,
+ 4,
+ 4,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 54,
+ "fuelRodTheCore",
+ new GT_ItemStack(BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TheCoreCell, 1)),
+ 100e3,
+ 1,
+ "Bartworks",
+ 72534,
+ 816,
+ 32,
+ false));
+ }
+
+ aID = 55;
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 55,
+ "coolantCellSpace180k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_Sp_1.get(1).copy()),
+ 1,
+ 180e3,
+ "GTNH"));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 56,
+ "coolantCellSpace360k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_Sp_2.get(1).copy()),
+ 1,
+ 360e3,
+ "GTNH"));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 57,
+ "coolantCellSpace540k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_Sp_3.get(1).copy()),
+ 1,
+ 540e3,
+ "GTNH"));
+ ITEM_LIST.put(
+ aID++,
+ new CoolantCell(
+ 58,
+ "coolantCellSpace1080k",
+ new GT_ItemStack(ItemList.Reactor_Coolant_Sp_6.get(1).copy()),
+ 1,
+ 1080e3,
+ "GTNH"));
+
+ aID = 59;
+ if (LoadedMods.GoodGenerator) {
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 59,
+ "fuelRodCompressedUranium",
+ new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium, 1)),
+ 50e3,
+ 1,
+ "GoodGenerator",
+ 100,
+ 1,
+ 1,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 60,
+ "fuelRodDoubleCompressedUranium",
+ new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_2, 1)),
+ 50e3,
+ 1,
+ "GoodGenerator",
+ 100,
+ 1,
+ 2,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 61,
+ "fuelRodQuadCompressedUranium",
+ new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_4, 1)),
+ 50e3,
+ 1,
+ "GoodGenerator",
+ 100,
+ 1,
+ 4,
+ false));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 62,
+ "fuelRodCompressedPlutonium",
+ new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium, 1)),
+ 50e3,
+ 1,
+ "GoodGenerator",
+ 50,
+ 1,
+ 1,
+ true));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 63,
+ "fuelRodDoubleCompressedPlutonium",
+ new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_2, 1)),
+ 50e3,
+ 1,
+ "GoodGenerator",
+ 50,
+ 1,
+ 2,
+ true));
+ ITEM_LIST.put(
+ aID++,
+ new FuelRod(
+ 64,
+ "fuelRodQuadCompressedPlutonium",
+ new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_4, 1)),
+ 50e3,
+ 1,
+ "GoodGenerator",
+ 50,
+ 1,
+ 4,
+ true));
+ }
+ }
+
+ private static final Map<String, ReactorItem> ITEM_MAP = makeItemMap();
+
+ private static Map<String, ReactorItem> makeItemMap() {
+ Map<String, ReactorItem> result = new HashMap<>((int) (ITEM_LIST.size() * 1.5));
+ for (ReactorItem reactorItem : ITEM_LIST.values()) {
+ if (reactorItem != null) {
+ result.put(reactorItem.baseName, reactorItem);
+ }
+ }
+ return Collections.unmodifiableMap(result);
+ }
+
+ private static ReactorItem copy(ReactorItem source) {
+ if (source != null) {
+ Class<? extends ReactorItem> aClass = source.getClass();
+ if (aClass == Condensator.class) {
+ return new Condensator((Condensator) source);
+ } else if (aClass == CoolantCell.class) {
+ return new CoolantCell((CoolantCell) source);
+ } else if (aClass == Exchanger.class) {
+ return new Exchanger((Exchanger) source);
+ } else if (aClass == FuelRod.class) {
+ return new FuelRod((FuelRod) source);
+ } else if (aClass == Plating.class) {
+ return new Plating((Plating) source);
+ } else if (aClass == Reflector.class) {
+ return new Reflector((Reflector) source);
+ } else if (aClass == Vent.class) {
+ return new Vent((Vent) source);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets a default instances of the specified component (such as for drawing button images)
+ * @param id the id of the component.
+ * @return the component with the specified id, or null if the id is out of range.
+ */
+ public static ReactorItem getDefaultComponent(int id) {
+ ReactorItem aItem = ITEM_LIST.get(id);
+ if (aItem != null) {
+ return aItem;
+ }
+ Logger.INFO("Tried to get default component with ID " + id + ". This is invalid.");
+ return null;
+ }
+
+ /**
+ * Gets a default instances of the specified component (such as for drawing button images)
+ * @param name the name of the component.
+ * @return the component with the specified name, or null if the name is not found.
+ */
+ public static ReactorItem getDefaultComponent(String name) {
+ if (name != null) {
+ return ITEM_MAP.get(name);
+ }
+ return null;
+ }
+
+ /**
+ * Creates a new instance of the specified component.
+ * @param id the id of the component to create.
+ * @return a new instance of the specified component, or null if the id is out of range.
+ */
+ public static ReactorItem createComponent(int id) {
+ ReactorItem aItem = ITEM_LIST.get(id);
+ if (aItem != null) {
+ return copy(aItem);
+ }
+ Logger.INFO("Tried to create component with ID " + id + ". This is invalid.");
+ return null;
+ }
+
+ /**
+ * Creates a new instance of the specified component.
+ * @param name the name of the component to create.
+ * @return a new instance of the specified component, or null if the name is not found.
+ */
+ public static ReactorItem createComponent(String name) {
+ if (name != null) {
+ return copy(ITEM_MAP.get(name));
+ }
+ return null;
+ }
+
+ /**
+ * Get the number of defined components.
+ * @return the number of defined components.
+ */
+ public static int getComponentCount() {
+ return ITEM_LIST.size();
+ }
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/Reactor.java b/src/main/java/Ic2ExpReactorPlanner/Reactor.java
index 83b6c511ad..6dfc379b8d 100644
--- a/src/main/java/Ic2ExpReactorPlanner/Reactor.java
+++ b/src/main/java/Ic2ExpReactorPlanner/Reactor.java
@@ -5,66 +5,64 @@
*/
package Ic2ExpReactorPlanner;
+import Ic2ExpReactorPlanner.components.ReactorItem;
import java.awt.HeadlessException;
import java.util.ArrayList;
-import Ic2ExpReactorPlanner.components.ReactorItem;
-
-
/**
* Represents an IndustrialCraft2 Nuclear Reactor.
* @author Brian McCloud
*/
public class Reactor {
-
+
private final ReactorItem[][] grid = new ReactorItem[6][9];
-
+
private double currentEUoutput = 0.0;
-
+
private double currentHeat = 0.0;
-
+
private double maxHeat = 10000.0;
-
+
private double ventedHeat = 0.0;
-
+
private boolean fluid = false;
-
+
private boolean pulsed = false;
-
+
private boolean automated = false;
-
+
private boolean usingReactorCoolantInjectors = false;
-
- private static final int DEFAULT_ON_PULSE = (int)5e6;
-
+
+ private static final int DEFAULT_ON_PULSE = (int) 5e6;
+
private int onPulse = DEFAULT_ON_PULSE;
-
+
private static final int DEFAULT_OFF_PULSE = 0;
-
+
private int offPulse = DEFAULT_OFF_PULSE;
-
- private static final int DEFAULT_SUSPEND_TEMP = (int)120e3;
-
+
+ private static final int DEFAULT_SUSPEND_TEMP = (int) 120e3;
+
private int suspendTemp = DEFAULT_SUSPEND_TEMP;
-
- private static final int DEFAULT_RESUME_TEMP = (int)120e3;
-
+
+ private static final int DEFAULT_RESUME_TEMP = (int) 120e3;
+
private int resumeTemp = DEFAULT_RESUME_TEMP;
-
- private int maxSimulationTicks = (int)5e6;
-
+
+ private int maxSimulationTicks = (int) 5e6;
+
// maximum paramatter types for a reactor component (current initial heat, automation threshold, reactor pause
private static final int MAX_PARAM_TYPES = 3;
public static final int MAX_COMPONENT_HEAT = 1_080_000;
-
+
public ReactorItem getComponentAt(final int row, final int column) {
if (row >= 0 && row < grid.length && column >= 0 && column < grid[row].length) {
return grid[row][column];
}
return null;
}
-
+
public void setComponentAt(final int row, final int column, final ReactorItem component) {
if (row >= 0 && row < grid.length && column >= 0 && column < grid[row].length) {
if (grid[row][column] != null) {
@@ -84,7 +82,7 @@ public class Reactor {
}
}
}
-
+
/**
* @return the amount of EU output in the reactor tick just simulated.
*/
@@ -105,7 +103,7 @@ public class Reactor {
public double getMaxHeat() {
return maxHeat;
}
-
+
/**
* Adjust the maximum heat
* @param adjustment the adjustment amount (negative values decrease the max heat).
@@ -121,7 +119,7 @@ public class Reactor {
public void setCurrentHeat(final double currentHeat) {
this.currentHeat = currentHeat;
}
-
+
/**
* Adjusts the reactor's current heat by a specified amount
* @param adjustment the adjustment amount.
@@ -132,7 +130,7 @@ public class Reactor {
currentHeat = 0.0;
}
}
-
+
/**
* add some EU output.
* @param amount the amount of EU to output over 1 reactor tick (20 game ticks).
@@ -140,14 +138,14 @@ public class Reactor {
public void addEUOutput(final double amount) {
currentEUoutput += amount;
}
-
+
/**
* clears the EU output (presumably to start simulating a new reactor tick).
*/
public void clearEUOutput() {
currentEUoutput = 0.0;
}
-
+
/**
* Gets a list of the materials needed to build the components.
* @return a list of the materials needed to build the components.
@@ -157,7 +155,7 @@ public class Reactor {
}
public ArrayList<ReactorItem> getComponentList() {
- ArrayList<ReactorItem> result = new ArrayList<ReactorItem>();
+ ArrayList<ReactorItem> result = new ArrayList<ReactorItem>();
for (int col = 0; col < grid[0].length; col++) {
for (int row = 0; row < grid.length; row++) {
if (getComponentAt(row, col) != null) {
@@ -167,14 +165,14 @@ public class Reactor {
}
return result;
}
-
+
/**
* @return the amount of heat vented this reactor tick.
*/
public double getVentedHeat() {
return ventedHeat;
}
-
+
/**
* Adds to the amount of heat vented this reactor tick, in case it is a new-style reactor with a pressure vessel and outputting heat to fluid instead of EU.
* @param amount the amount to add.
@@ -182,14 +180,14 @@ public class Reactor {
public void ventHeat(final double amount) {
ventedHeat += amount;
}
-
+
/**
* Clears the amount of vented heat, in case a new reactor tick is starting.
*/
public void clearVentedHeat() {
ventedHeat = 0;
}
-
+
/**
* Get a code that represents the component set, which can be passed between forum users, etc.
* @return a code representing some ids for the components and arrangement. Passing the same code to setCode() should re-create an identical reactor setup, even if other changes have happened in the meantime.
@@ -197,7 +195,7 @@ public class Reactor {
public String getCode() {
return "erp=" + buildCodeString();
}
-
+
/**
* Sets a code to configure the entire grid all at once. Expects the code to have originally been output by getCode().
* @param code the code of the reactor setup to use.
@@ -209,7 +207,7 @@ public class Reactor {
int[][][] params = new int[grid.length][grid[0].length][MAX_PARAM_TYPES];
if (code.startsWith("erp=")) {
readCodeString(code.substring(4));
- } else if (code.length() >= 108 && code.matches("[0-9A-Za-z(),|]+")) { //NOI18N
+ } else if (code.length() >= 108 && code.matches("[0-9A-Za-z(),|]+")) { // NOI18N
try {
for (int row = 0; row < grid.length; row++) {
for (int col = 0; col < grid[row].length; col++) {
@@ -330,17 +328,19 @@ public class Reactor {
}
} else {
String tempCode = code;
- if (code.startsWith("http://www.talonfiremage.pwp.blueyonder.co.uk/v3/reactorplanner.html?")) { //NOI18N
- tempCode = code.replace("http://www.talonfiremage.pwp.blueyonder.co.uk/v3/reactorplanner.html?", ""); //NOI18N
+ if (code.startsWith("http://www.talonfiremage.pwp.blueyonder.co.uk/v3/reactorplanner.html?")) { // NOI18N
+ tempCode = code.replace(
+ "http://www.talonfiremage.pwp.blueyonder.co.uk/v3/reactorplanner.html?", ""); // NOI18N
}
- if (tempCode.matches("[0-9a-z]+")) { //NOI18N
+ if (tempCode.matches("[0-9a-z]+")) { // NOI18N
// Possibly a code from Talonius's old planner
handleTaloniusCode(tempCode);
- } else if (code.matches("[0-9A-Za-z+/=]+")) { //NOI18N
+ } else if (code.matches("[0-9A-Za-z+/=]+")) { // NOI18N
// Try to handle it as a newer code with the "erp=" prefix stripped
readCodeString(code);
} else if (!code.isEmpty()) {
- //JOptionPane.showMessageDialog(null, String.format(getI18n("Warning.InvalidReactorCode"), code), getI18n("Warning.Title"), JOptionPane.WARNING_MESSAGE);
+ // JOptionPane.showMessageDialog(null, String.format(getI18n("Warning.InvalidReactorCode"), code),
+ // getI18n("Warning.Title"), JOptionPane.WARNING_MESSAGE);
}
}
}
@@ -354,12 +354,13 @@ public class Reactor {
for (int x = 8; x >= 0; x--) {
for (int y = 5; y >= 0; y--) {
int nextValue = decoder.readInt(7);
-
- // items are no longer stackable in IC2 reactors, but stack sizes from the planner code still need to be handled
+
+ // items are no longer stackable in IC2 reactors, but stack sizes from the planner code still need to be
+ // handled
if (nextValue > 64) {
nextValue = decoder.readInt(7);
}
-
+
switch (nextValue) {
case 0:
setComponentAt(y, x, null);
@@ -479,8 +480,8 @@ public class Reactor {
}
}
if (warnings.length() > 0) {
- warnings.setLength(warnings.length() - 1); // to remove last newline character
- //JOptionPane.showMessageDialog(null, warnings, "Warning.Title", JOptionPane.WARNING_MESSAGE);
+ warnings.setLength(warnings.length() - 1); // to remove last newline character
+ // JOptionPane.showMessageDialog(null, warnings, "Warning.Title", JOptionPane.WARNING_MESSAGE);
}
}
@@ -490,10 +491,8 @@ public class Reactor {
// read the code revision from the code itself instead of making it part of the prefix.
int codeRevision = storage.extract(255);
int maxComponentHeat;
- if (codeRevision == 3)
- maxComponentHeat = (int)1080e3;
- else
- maxComponentHeat = (int)360e3;
+ if (codeRevision == 3) maxComponentHeat = (int) 1080e3;
+ else maxComponentHeat = (int) 360e3;
// Check if the code revision is supported yet.
if (codeRevision > 3) {
throw new IllegalArgumentException("Unsupported code revision in reactor code.");
@@ -507,7 +506,8 @@ public class Reactor {
for (int row = 0; row < grid.length; row++) {
for (int col = 0; col < grid[row].length; col++) {
int componentId = 0;
- // Changes may be coming to the number of components available, so make sure to check the code revision number.
+ // Changes may be coming to the number of components available, so make sure to check the code revision
+ // number.
if (codeRevision <= 1) {
componentId = storage.extract(38);
} else if (codeRevision == 2) {
@@ -522,7 +522,7 @@ public class Reactor {
component.setInitialHeat(storage.extract(maxComponentHeat));
if (codeRevision == 0 || (codeRevision >= 1 && automated)) {
component.setAutomationThreshold(storage.extract(maxComponentHeat));
- component.setReactorPause(storage.extract((int)10e3));
+ component.setReactorPause(storage.extract((int) 10e3));
}
}
setComponentAt(row, col, component);
@@ -532,12 +532,12 @@ public class Reactor {
}
}
// next, read the inital temperature and other details.
- currentHeat = storage.extract((int)120e3);
+ currentHeat = storage.extract((int) 120e3);
if (codeRevision == 0 || (codeRevision >= 1 && pulsed)) {
- onPulse = storage.extract((int)5e6);
- offPulse = storage.extract((int)5e6);
- suspendTemp = storage.extract((int)120e3);
- resumeTemp = storage.extract((int)120e3);
+ onPulse = storage.extract((int) 5e6);
+ offPulse = storage.extract((int) 5e6);
+ suspendTemp = storage.extract((int) 120e3);
+ resumeTemp = storage.extract((int) 120e3);
}
fluid = storage.extract(1) > 0;
usingReactorCoolantInjectors = storage.extract(1) > 0;
@@ -545,36 +545,41 @@ public class Reactor {
pulsed = storage.extract(1) > 0;
automated = storage.extract(1) > 0;
}
- maxSimulationTicks = storage.extract((int)5e6);
+ maxSimulationTicks = storage.extract((int) 5e6);
}
-
+
// builds a Base64 code string, not including the prefix.
private String buildCodeString() {
BigintStorage storage = new BigintStorage();
// first, store the extra details, in reverse order of expected reading.
- storage.store(maxSimulationTicks, (int)5e6);
+ storage.store(maxSimulationTicks, (int) 5e6);
storage.store(usingReactorCoolantInjectors ? 1 : 0, 1);
storage.store(fluid ? 1 : 0, 1);
if (pulsed) {
- storage.store(resumeTemp, (int)120e3);
- storage.store(suspendTemp, (int)120e3);
- storage.store(offPulse, (int)5e6);
- storage.store(onPulse, (int)5e6);
+ storage.store(resumeTemp, (int) 120e3);
+ storage.store(suspendTemp, (int) 120e3);
+ storage.store(offPulse, (int) 5e6);
+ storage.store(onPulse, (int) 5e6);
}
- storage.store((int)currentHeat, (int)120e3);
+ storage.store((int) currentHeat, (int) 120e3);
// grid is read (almost) first, so written (almost) last, and in reverse order
for (int row = grid.length - 1; row >= 0; row--) {
for (int col = grid[row].length - 1; col >= 0; col--) {
ReactorItem component = grid[row][col];
if (component != null) {
int id = component.id;
- // only store automation details for a component if non-default, and add a flag bit to indicate their presence. null components don't even need the flag bit.
- if (component.getInitialHeat() > 0 || component.getAutomationThreshold() != ComponentFactory.getDefaultComponent(id).getAutomationThreshold() || component.getReactorPause() != ComponentFactory.getDefaultComponent(id).getReactorPause()) {
+ // only store automation details for a component if non-default, and add a flag bit to indicate
+ // their presence. null components don't even need the flag bit.
+ if (component.getInitialHeat() > 0
+ || component.getAutomationThreshold()
+ != ComponentFactory.getDefaultComponent(id).getAutomationThreshold()
+ || component.getReactorPause()
+ != ComponentFactory.getDefaultComponent(id).getReactorPause()) {
if (automated) {
- storage.store(component.getReactorPause(), (int)10e3);
- storage.store(component.getAutomationThreshold(), (int)1080e3);
+ storage.store(component.getReactorPause(), (int) 10e3);
+ storage.store(component.getAutomationThreshold(), (int) 1080e3);
}
- storage.store((int)component.getInitialHeat(), (int)1080e3);
+ storage.store((int) component.getInitialHeat(), (int) 1080e3);
storage.store(1, 1);
} else {
storage.store(0, 1);
@@ -599,21 +604,35 @@ public class Reactor {
for (int col = 0; col < grid[row].length; col++) {
final ReactorItem component = getComponentAt(row, col);
final int id = (component != null) ? component.id : 0;
- result.append(String.format("%02X", id)); //NOI18N
- if (component != null && (component.getInitialHeat() > 0
- || (automated && component.getAutomationThreshold() != ComponentFactory.getDefaultComponent(id).getAutomationThreshold())
- || (automated && component.getReactorPause() != ComponentFactory.getDefaultComponent(id).getReactorPause()))) {
+ result.append(String.format("%02X", id)); // NOI18N
+ if (component != null
+ && (component.getInitialHeat() > 0
+ || (automated
+ && component.getAutomationThreshold()
+ != ComponentFactory.getDefaultComponent(id)
+ .getAutomationThreshold())
+ || (automated
+ && component.getReactorPause()
+ != ComponentFactory.getDefaultComponent(id)
+ .getReactorPause()))) {
result.append("(");
if (component.getInitialHeat() > 0) {
- result.append(String.format("h%s,", Integer.toString((int) component.getInitialHeat(), 36))); //NOI18N
+ result.append(String.format(
+ "h%s,", Integer.toString((int) component.getInitialHeat(), 36))); // NOI18N
}
- if (automated && component.getAutomationThreshold() != ComponentFactory.getDefaultComponent(id).getAutomationThreshold()) {
- result.append(String.format("a%s,", Integer.toString(component.getAutomationThreshold(), 36))); //NOI18N
+ if (automated
+ && component.getAutomationThreshold()
+ != ComponentFactory.getDefaultComponent(id).getAutomationThreshold()) {
+ result.append(String.format(
+ "a%s,", Integer.toString(component.getAutomationThreshold(), 36))); // NOI18N
}
- if (automated && component.getReactorPause() != ComponentFactory.getDefaultComponent(id).getReactorPause()) {
- result.append(String.format("p%s,", Integer.toString(component.getReactorPause(), 36))); //NOI18N
+ if (automated
+ && component.getReactorPause()
+ != ComponentFactory.getDefaultComponent(id).getReactorPause()) {
+ result.append(
+ String.format("p%s,", Integer.toString(component.getReactorPause(), 36))); // NOI18N
}
- result.setLength(result.length() - 1); // remove the last comma, whichever parameter it came from.
+ result.setLength(result.length() - 1); // remove the last comma, whichever parameter it came from.
result.append(")");
}
}
@@ -653,7 +672,7 @@ public class Reactor {
}
return result.toString();
}
-
+
/**
* Checks whether the reactor is to simulate a fluid-style reactor, rather than a direct EU-output reactor.
* @return true if this was set to be a fluid-style reactor, false if this was set to be direct EU-output reactor.
@@ -669,7 +688,7 @@ public class Reactor {
public void setFluid(final boolean fluid) {
this.fluid = fluid;
}
-
+
/**
* Checks whether the reactor is using Reactor Coolant Injectors (RCIs)
* @return true if this reactor was set to use RCIs, false otherwise.
@@ -677,7 +696,7 @@ public class Reactor {
public boolean isUsingReactorCoolantInjectors() {
return usingReactorCoolantInjectors;
}
-
+
/**
* Sets whether the reactor is to use Reactor Coolant Injectors (RCIs)
* @param usingReactorCoolantInjectors true if this reactor should use RCIs, false otherwise.
@@ -685,35 +704,35 @@ public class Reactor {
public void setUsingReactorCoolantInjectors(final boolean usingReactorCoolantInjectors) {
this.usingReactorCoolantInjectors = usingReactorCoolantInjectors;
}
-
+
public int getOnPulse() {
return onPulse;
}
-
+
public void setOnPulse(final int onPulse) {
this.onPulse = onPulse;
}
-
+
public int getOffPulse() {
return offPulse;
}
-
+
public void setOffPulse(final int offPulse) {
this.offPulse = offPulse;
}
-
+
public int getSuspendTemp() {
return suspendTemp;
}
-
+
public void setSuspendTemp(final int suspendTemp) {
this.suspendTemp = suspendTemp;
}
-
+
public int getResumeTemp() {
return resumeTemp;
}
-
+
public void setResumeTemp(final int resumeTemp) {
this.resumeTemp = resumeTemp;
}
@@ -741,12 +760,11 @@ public class Reactor {
public void setMaxSimulationTicks(int maxSimulationTicks) {
this.maxSimulationTicks = maxSimulationTicks;
}
-
+
public void resetPulseConfig() {
onPulse = DEFAULT_ON_PULSE;
offPulse = DEFAULT_OFF_PULSE;
suspendTemp = DEFAULT_SUSPEND_TEMP;
resumeTemp = DEFAULT_RESUME_TEMP;
}
-
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/SimulationData.java b/src/main/java/Ic2ExpReactorPlanner/SimulationData.java
index 39ecdbc5f5..0e32a186cb 100644
--- a/src/main/java/Ic2ExpReactorPlanner/SimulationData.java
+++ b/src/main/java/Ic2ExpReactorPlanner/SimulationData.java
@@ -10,9 +10,10 @@ package Ic2ExpReactorPlanner;
* @author Brian McCloud
*/
public class SimulationData {
- // Values should only be written to by the simulator class and read by other classes, but this is not yet strictly enforced.
+ // Values should only be written to by the simulator class and read by other classes, but this is not yet strictly
+ // enforced.
// Enforcement might require refactoring this to be an inner class of the simulator.
-
+
// Times to temperature thresholds
public int timeToBelow50 = Integer.MAX_VALUE;
public int timeToBurn = Integer.MAX_VALUE;
@@ -20,10 +21,10 @@ public class SimulationData {
public int timeToHurt = Integer.MAX_VALUE;
public int timeToLava = Integer.MAX_VALUE;
public int timeToXplode = Integer.MAX_VALUE;
-
+
// Special, for calculating efficiency
public int totalRodCount = 0;
-
+
// First component broken details
public int firstComponentBrokenTime = Integer.MAX_VALUE;
public int firstComponentBrokenRow = -1;
@@ -37,7 +38,7 @@ public class SimulationData {
public double prebreakAvgHUoutput = 0;
public double prebreakMinHUoutput = Double.MAX_VALUE;
public double prebreakMaxHUoutput = 0;
-
+
// First rod depleted details
public int firstRodDepletedTime = Integer.MAX_VALUE;
public int firstRodDepletedRow = -1;
@@ -53,7 +54,7 @@ public class SimulationData {
public double predepleteMaxHUoutput = 0;
public double predepleteMinTemp = Double.MAX_VALUE;
public double predepleteMaxTemp = 0;
-
+
// Completed-simulation details
public int totalReactorTicks = 0;
public int totalEUoutput = 0;
@@ -67,7 +68,7 @@ public class SimulationData {
public int minTemp = (int) Double.MAX_VALUE;
public int maxTemp = 0;
public int explosionPower = 0;
-
+
// Heating and Cooling details
public double hullHeating = 0;
public double componentHeating = 0;
@@ -75,5 +76,4 @@ public class SimulationData {
public double hullCoolingCapacity = 0;
public double ventCooling = 0;
public double ventCoolingCapacity = 0;
-
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java b/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java
index 89232eb007..13d73a3df6 100644
--- a/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java
+++ b/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java
@@ -1,4 +1,3 @@
-
package Ic2ExpReactorPlanner;
import java.math.BigInteger;
@@ -9,15 +8,15 @@ import java.math.BigInteger;
*/
public class TaloniusDecoder {
private BigInteger dataStack = null;
-
+
public TaloniusDecoder(final String dataCode) {
dataStack = new BigInteger(dataCode, 36);
}
-
+
public int readInt(final int bits) {
return readBigInteger(bits).intValue();
}
-
+
private BigInteger readBigInteger(final int bits) {
BigInteger data = dataStack.and(BigInteger.ONE.shiftLeft(bits).subtract(BigInteger.ONE));
dataStack = dataStack.shiftRight(bits);
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java b/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java
index d38db4c704..e4b73aa838 100644
--- a/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java
+++ b/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java
@@ -12,15 +12,21 @@ import gregtech.api.objects.GT_ItemStack;
* @author Brian McCloud
*/
public class Condensator extends ReactorItem {
-
- public Condensator(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, final double maxHeat, final String sourceMod) {
+
+ public Condensator(
+ final int id,
+ final String baseName,
+ GT_ItemStack aItem,
+ final double maxDamage,
+ final double maxHeat,
+ final String sourceMod) {
super(id, baseName, aItem, maxDamage, maxHeat, sourceMod);
}
-
+
public Condensator(final Condensator other) {
super(other);
}
-
+
@Override
public double adjustCurrentHeat(final double heat) {
if (heat < 0.0) {
@@ -39,10 +45,9 @@ public class Condensator extends ReactorItem {
public boolean needsCoolantInjected() {
return currentHeat > 0.85 * getMaxHeat();
}
-
+
@Override
public void injectCoolant() {
currentHeat = 0;
}
-
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java b/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java
index f152b49985..a9a90ceb6b 100644
--- a/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java
+++ b/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java
@@ -12,20 +12,25 @@ import gregtech.api.objects.GT_ItemStack;
* @author Brian McCloud
*/
public class CoolantCell extends ReactorItem {
-
- public CoolantCell(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, final double maxHeat, final String sourceMod) {
+
+ public CoolantCell(
+ final int id,
+ final String baseName,
+ GT_ItemStack aItem,
+ final double maxDamage,
+ final double maxHeat,
+ final String sourceMod) {
super(id, baseName, aItem, maxDamage, maxHeat, sourceMod);
}
-
+
public CoolantCell(final CoolantCell other) {
super(other);
}
-
+
@Override
public double adjustCurrentHeat(final double heat) {
currentCellCooling += heat;
bestCellCooling = Math.max(currentCellCooling, bestCellCooling);
return super.adjustCurrentHeat(heat);
}
-
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java b/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java
index efb9a826e2..9c2f470eba 100644
--- a/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java
+++ b/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java
@@ -5,32 +5,39 @@
*/
package Ic2ExpReactorPlanner.components;
+import gregtech.api.objects.GT_ItemStack;
import java.util.ArrayList;
import java.util.List;
-import gregtech.api.objects.GT_ItemStack;
-
/**
* Represents a heat exchanger of some sort in a reactor.
* @author Brian McCloud
*/
public class Exchanger extends ReactorItem {
-
+
private final int switchSide;
private final int switchReactor;
-
- public Exchanger(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, final double maxHeat, final String sourceMod, final int switchSide, final int switchReactor) {
+
+ public Exchanger(
+ final int id,
+ final String baseName,
+ GT_ItemStack aItem,
+ final double maxDamage,
+ final double maxHeat,
+ final String sourceMod,
+ final int switchSide,
+ final int switchReactor) {
super(id, baseName, aItem, maxDamage, maxHeat, sourceMod);
this.switchSide = switchSide;
this.switchReactor = switchReactor;
}
-
+
public Exchanger(final Exchanger other) {
super(other);
this.switchSide = other.switchSide;
this.switchReactor = other.switchReactor;
}
-
+
@Override
public void transfer() {
List<ReactorItem> heatableNeighbors = new ArrayList<>(4);
@@ -121,10 +128,9 @@ public class Exchanger extends ReactorItem {
}
adjustCurrentHeat(myHeat);
}
-
+
@Override
public double getHullCoolingCapacity() {
return switchReactor;
}
-
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java b/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java
index 588e221424..abeea45a37 100644
--- a/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java
+++ b/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java
@@ -5,42 +5,50 @@
*/
package Ic2ExpReactorPlanner.components;
+import gregtech.api.objects.GT_ItemStack;
import java.util.ArrayList;
import java.util.List;
-import gregtech.api.objects.GT_ItemStack;
-
/**
* Represents some form of fuel rod (may be single, dual, or quad).
* @author Brian McCloud
*/
public class FuelRod extends ReactorItem {
-
+
private final int energyMult;
private final double heatMult;
private final int rodCount;
private final boolean moxStyle;
-
+
private static boolean GT509behavior = false;
private static boolean GTNHbehavior = false;
-
+
public static void setGT509Behavior(boolean value) {
GT509behavior = value;
}
-
+
public static void setGTNHBehavior(boolean value) {
GTNHbehavior = value;
}
-
- public FuelRod(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, final double maxHeat, final String sourceMod,
- final int energyMult, final double heatMult, final int rodCount, final boolean moxStyle) {
+
+ public FuelRod(
+ final int id,
+ final String baseName,
+ GT_ItemStack aItem,
+ final double maxDamage,
+ final double maxHeat,
+ final String sourceMod,
+ final int energyMult,
+ final double heatMult,
+ final int rodCount,
+ final boolean moxStyle) {
super(id, baseName, aItem, maxDamage, maxHeat, sourceMod);
this.energyMult = energyMult;
this.heatMult = heatMult;
this.rodCount = rodCount;
this.moxStyle = moxStyle;
}
-
+
public FuelRod(final FuelRod other) {
super(other);
this.energyMult = other.energyMult;
@@ -48,7 +56,7 @@ public class FuelRod extends ReactorItem {
this.rodCount = other.rodCount;
this.moxStyle = other.moxStyle;
}
-
+
@Override
public boolean isNeutronReflector() {
return !isBroken();
@@ -74,7 +82,7 @@ public class FuelRod extends ReactorItem {
}
return neutronNeighbors;
}
-
+
protected void handleHeat(final int heat) {
List<ReactorItem> heatableNeighbors = new ArrayList<>(4);
ReactorItem component = parent.getComponentAt(row + 1, col);
@@ -105,11 +113,11 @@ public class FuelRod extends ReactorItem {
heatableNeighbors.get(0).adjustCurrentHeat(remainderHeat);
}
}
-
+
@Override
public double generateHeat() {
int pulses = countNeutronNeighbors() + (rodCount == 1 ? 1 : (rodCount == 2) ? 2 : 3);
- int heat = (int)(heatMult * pulses * (pulses + 1));
+ int heat = (int) (heatMult * pulses * (pulses + 1));
if (moxStyle && parent.isFluid() && (parent.getCurrentHeat() / parent.getMaxHeat()) > 0.5) {
heat *= 2;
}
@@ -125,13 +133,12 @@ public class FuelRod extends ReactorItem {
int pulses = countNeutronNeighbors() + (rodCount == 1 ? 1 : (rodCount == 2) ? 2 : 3);
double energy = energyMult * pulses;
if (GT509behavior || "GT5".equals(sourceMod)) {
- energy *= 2;//EUx2 if from GT5.09 or in GT5.09 mode
+ energy *= 2; // EUx2 if from GT5.09 or in GT5.09 mode
if (moxStyle) {
energy *= (1 + 1.5 * parent.getCurrentHeat() / parent.getMaxHeat());
}
- }
- else if (GTNHbehavior || "GTNH".equals(sourceMod)) {
- energy *= 10;//EUx10 if from GTNH or in GTNH mode
+ } else if (GTNHbehavior || "GTNH".equals(sourceMod)) {
+ energy *= 10; // EUx10 if from GTNH or in GTNH mode
if (moxStyle) {
energy *= (1 + 1.5 * parent.getCurrentHeat() / parent.getMaxHeat());
}
@@ -145,12 +152,12 @@ public class FuelRod extends ReactorItem {
applyDamage(1.0);
return energy;
}
-
+
@Override
public int getRodCount() {
return rodCount;
}
-
+
@Override
public double getCurrentOutput() {
if (parent != null) {
@@ -162,5 +169,4 @@ public class FuelRod extends ReactorItem {
}
return 0;
}
-
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Plating.java b/src/main/java/Ic2ExpReactorPlanner/components/Plating.java
index d792e06035..de49dfa13c 100644
--- a/src/main/java/Ic2ExpReactorPlanner/components/Plating.java
+++ b/src/main/java/Ic2ExpReactorPlanner/components/Plating.java
@@ -15,21 +15,29 @@ import gregtech.api.objects.GT_ItemStack;
* @author Brian McCloud
*/
public class Plating extends ReactorItem {
-
+
private final int heatAdjustment;
-
- public Plating(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, final double maxHeat, final String sourceMod, final int heatAdjustment, final double explosionPowerMultiplier) {
+
+ public Plating(
+ final int id,
+ final String baseName,
+ GT_ItemStack aItem,
+ final double maxDamage,
+ final double maxHeat,
+ final String sourceMod,
+ final int heatAdjustment,
+ final double explosionPowerMultiplier) {
super(id, baseName, aItem, maxDamage, maxHeat, sourceMod);
this.heatAdjustment = heatAdjustment;
this.explosionPowerMultiplier = explosionPowerMultiplier;
}
-
+
public Plating(Plating other) {
super(other);
this.heatAdjustment = other.heatAdjustment;
this.explosionPowerMultiplier = other.explosionPowerMultiplier;
}
-
+
@Override
public void addToReactor(final Reactor parent, final int row, final int col) {
super.addToReactor(parent, row, col);
@@ -45,5 +53,4 @@ public class Plating extends ReactorItem {
}
super.removeFromReactor();
}
-
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java b/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java
index 9a9b1ce341..aee7f1c441 100644
--- a/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java
+++ b/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java
@@ -5,527 +5,560 @@
*/
package Ic2ExpReactorPlanner.components;
-import java.util.HashMap;
-import java.util.ResourceBundle;
-
import Ic2ExpReactorPlanner.Reactor;
import gregtech.api.objects.GT_ItemStack;
+import java.util.HashMap;
/**
* Represents an item (component) in an IndustrialCraft2 Experimental Nuclear
* Reactor.
- *
+ *
* @author Brian McCloud
*/
public class ReactorItem {
-
- public static HashMap<String, ReactorItem> sComponentMap = new HashMap<String, ReactorItem>();
- // Fundamental values, set at object instantiation, should never need to be
- // changed.
- public final int id;
- public final String baseName; // this is the non-localized version, for
- // internal program use
- public final String name; // this is expected to be localized, for display
- // usage.
- protected double maxDamage;
-
- public double getMaxDamage() {
- return maxDamage;
- }
-
- protected double maxHeat;
-
- public double getMaxHeat() {
- return maxHeat;
- }
-
- public final String sourceMod; // for potentially adjusting controls based
- // on whether the mod is in use, will be
- // null to indicate the item is part of base
- // IC2.
- public final GT_ItemStack mItem;
-
- // Simulation setting values
- private double initialHeat = 0;
-
- public double getInitialHeat() {
- return initialHeat;
- }
-
- public void setInitialHeat(final double value) {
- if (this.isHeatAcceptor() && value >= 0 && value < this.maxHeat) {
- initialHeat = value;
- }
- }
- private int automationThreshold = 9000;
-
- public int getAutomationThreshold() {
- return automationThreshold;
- }
-
- public void setAutomationThreshold(final int value) {
- if (maxHeat > 1 || maxDamage > 1) {
- automationThreshold = value;
- }
- }
- private int reactorPause = 0;
-
- public int getReactorPause() {
- return reactorPause;
- }
-
- public void setReactorPause(final int value) {
- if (maxHeat > 1 || maxDamage > 1) {
- reactorPause = value;
- }
- }
-
- // fields below here are not to be copied by the copy constructor.
-
- // Parent reactor and position
- protected Reactor parent = null;
- protected int row = -10;
- protected int col = -10;
-
- // Special variable for holding information about this item from last
- // simulation.
- // Usage of StringBuffer instead of StringBuilder is deliberate - this may
- // be accessed by
- // both the simulation worker thread and the event dispatch thread.
- public final StringBuffer info = new StringBuffer(1000);
-
- // Calculated values - readable from outside, but only writable by
- // subclasses.
- protected double currentDamage = 0;
- public double getCurrentDamage() {
- return currentDamage;
- }
- protected double currentHeat = 0;
- public double getCurrentHeat() {
- return currentHeat;
- }
- protected double maxReachedHeat = 0;
- public double getMaxReachedHeat() {
- return maxReachedHeat;
- }
-
- protected double currentEUGenerated = 0;
- public double getCurrentEUGenerated() {
- return currentEUGenerated;
- }
- protected double minEUGenerated = Double.MAX_VALUE;
- public double getMinEUGenerated() {
- return minEUGenerated;
- }
- protected double maxEUGenerated = 0;
- public double getMaxEUGenerated() {
- return maxEUGenerated;
- }
-
- protected double currentHeatGenerated = 0;
- public double getCurrentHeatGenerated() {
- return currentHeatGenerated;
- }
- protected double minHeatGenerated = Double.MAX_VALUE;
- public double getMinHeatGenerated() {
- return minHeatGenerated;
- }
- protected double maxHeatGenerated = 0;
- public double getMaxHeatGenerated() {
- return maxHeatGenerated;
- }
-
- protected double currentHullHeating = 0;
- public double getCurrentHullHeating() {
- return currentHullHeating;
- }
- protected double currentComponentHeating = 0;
- public double getCurrentComponentHeating() {
- return currentComponentHeating;
- }
- protected double currentHullCooling = 0;
- public double getCurrentHullCooling() {
- return currentHullCooling;
- }
- protected double currentVentCooling = 0;
- public double getCurrentVentCooling() {
- return currentVentCooling;
- }
- protected double bestVentCooling = 0;
- public double getBestVentCooling() {
- return bestVentCooling;
- }
-
- protected double currentCellCooling = 0;
- public double getCurrentCellCooling() {
- return currentCellCooling;
- }
- protected double bestCellCooling = 0;
- public double getBestCellCooling() {
- return bestCellCooling;
- }
-
- protected double currentCondensatorCooling = 0;
- public double getCurrentCondensatorCooling() {
- return currentCondensatorCooling;
- }
- protected double bestCondensatorCooling = 0;
- public double getBestCondensatorCooling() {
- return bestCondensatorCooling;
- }
-
- protected double explosionPowerMultiplier = 1;
-
- protected ReactorItem(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, final double maxHeat, String sourceMod) {
- this.id = id;
- this.baseName = baseName;
- this.name = aItem.mItem.getItemStackDisplayName(aItem.toStack());
- this.mItem = aItem;
- this.maxDamage = maxDamage;
- this.maxHeat = maxHeat;
- if (maxHeat > 1) {
- automationThreshold = (int) (maxHeat * 0.9);
- }
- else if (maxDamage > 1) {
- automationThreshold = (int) (maxDamage * 1.1);
- }
- if (sourceMod == null) {
- sourceMod = "IC2";
- }
- this.sourceMod = sourceMod;
- sComponentMap.put(sourceMod+"."+aItem.mItem.getUnlocalizedName()+"."+aItem.mMetaData, this);
- }
-
- // Protected copy constructor for use by subclasses. Generalized copying
- // should be done with a method in ComponentFactory (which can check which
- // subclass copy constructor to use).
- protected ReactorItem(final ReactorItem other) {
- this.id = other.id;
- this.baseName = other.baseName;
- this.name = other.name;
- this.mItem = other.mItem;
- this.maxDamage = other.maxDamage;
- this.maxHeat = other.maxHeat;
- this.initialHeat = other.initialHeat;
- this.automationThreshold = other.automationThreshold;
- this.reactorPause = other.reactorPause;
- this.sourceMod = other.sourceMod;
- }
-
- /**
- * Gets the name of the component, and the initial heat (if applicable).
- *
- * @return the name of this component, and potentially initial heat.
- */
- @Override
- public String toString() {
- String result = name;
- if (initialHeat > 0) {
- result += String.format("\u0020(initial heat: %,d)", (int) initialHeat);
- }
- return result;
- }
-
- /**
- * Checks if this component can accept heat. (e.g. from adjacent fuel rods,
- * or from an exchanger)
- *
- * @return true if this component can accept heat, false otherwise.
- */
- public boolean isHeatAcceptor() {
- // maxHeat of 1 means this component never accepts heat (though it might
- // take damage instead)
- return maxHeat > 1 && !isBroken();
- }
-
- /**
- * Determines if this component can be cooled down, such as by a component
- * heat vent.
- *
- * @return true if this component can be cooled down, false otherwise.
- */
- public boolean isCoolable() {
- return maxHeat > 1 && !(this instanceof Condensator);
- }
-
- /**
- * Checks if this component acts as a neutron reflector, and boosts
- * performance of adjacent fuel rods, either by being a "neutron reflector"
- * item or by being a fuel rod.
- *
- * @return true if this component reflects neutrons, false otherwise.
- */
- public boolean isNeutronReflector() {
- return false;
- }
-
- /**
- * Prepare for a new reactor tick.
- */
- public void preReactorTick() {
- currentHullHeating = 0.0;
- currentComponentHeating = 0.0;
- currentHullCooling = 0.0;
- currentVentCooling = 0.0;
- currentCellCooling = 0.0;
- currentCondensatorCooling = 0.0;
- currentEUGenerated = 0;
- currentHeatGenerated = 0;
- }
-
- /**
- * Generate heat if appropriate for component type, and spread to reactor or
- * adjacent cells.
- *
- * @return the amount of heat generated by this component.
- */
- public double generateHeat() {
- return 0.0;
- }
-
- /**
- * Generate energy if appropriate for component type.
- *
- * @return the number of EU generated by this component during the current
- * reactor tick.
- */
- public double generateEnergy() {
- return 0.0;
- }
-
- /**
- * Dissipate (aka vent) heat if appropriate for component type.
- *
- * @return the amount of heat successfully vented during the current reactor
- * tick.
- */
- public double dissipate() {
- return 0.0;
- }
-
- /**
- * Transfer heat between component, neighbors, and/or reactor, if
- * appropriate for component type.
- */
- public void transfer() {
- // do nothing by default.
- }
-
- /**
- * Adds this component to a new reactor, and applies changes to the reactor
- * when adding this component if appropriate, such as for reactor plating.
- *
- * @param parent
- * the reactor to add this component to.
- * @param row
- * the row this component will be in.
- * @param col
- * the column this component will be in.
- */
- public void addToReactor(final Reactor parent, final int row, final int col) {
- // call removeFromReactor first, in case it had previously been added to
- // a different reactor (unlikely)
- removeFromReactor();
- this.parent = parent;
- this.row = row;
- this.col = col;
- }
-
- /**
- * Removes this component from its reactor (if any), and applies changes to
- * the reactor when removing this component if appropriate, such as for
- * reactor plating.
- */
- public void removeFromReactor() {
- parent = null;
- this.row = -10;
- this.col = -10;
- }
-
- /**
- * Resets heat to 0 (used when resetting simulation).
- */
- public final void clearCurrentHeat() {
- currentHeat = initialHeat;
- bestVentCooling = 0.0;
- bestCondensatorCooling = 0.0;
- bestCellCooling = 0.0;
- minEUGenerated = Double.MAX_VALUE;
- maxEUGenerated = 0.0;
- minHeatGenerated = Double.MAX_VALUE;
- maxHeatGenerated = 0.0;
- maxReachedHeat = initialHeat;
- }
-
- /**
- * Adjusts the component heat up or down
- *
- * @param heat
- * the amount of heat to adjust by (positive to add heat,
- * negative to remove heat).
- * @return the amount of heat adjustment refused. (e.g. due to going below
- * minimum heat, breaking due to excessive heat, or attempting to
- * remove heat from a condensator)
- */
- public double adjustCurrentHeat(final double heat) {
- if (isHeatAcceptor()) {
- double result = 0.0;
- double tempHeat = getCurrentHeat();
- tempHeat += heat;
- if (tempHeat > getMaxHeat()) {
- result = getMaxHeat() - tempHeat + 1;
- tempHeat = getMaxHeat();
- }
- else if (tempHeat < 0.0) {
- result = tempHeat;
- tempHeat = 0.0;
- }
- currentHeat = tempHeat;
- maxReachedHeat = Math.max(maxReachedHeat, currentHeat);
- return result;
- }
- return heat;
- }
-
- /**
- * Clears the damage back to 0 (used when resetting simulation, or replacing
- * the component in an automation simulation).
- */
- public final void clearDamage() {
- currentDamage = 0.0;
- }
-
- /**
- * Applies damage to the component, as opposed to heat. Mainly used for fuel
- * rods and neutron reflectors that lose durability as the reactor runs, but
- * can't recover it via cooling.
- *
- * @param damage
- * the damage to apply (only used if positive).
- */
- public final void applyDamage(final double damage) {
- // maxDamage of 1 is treated as meaning the component doesn't accept
- // damage (though it might accept heat instead)
- // if someone actually writes a mod with such a flimsy component, I
- // might have to rethink this.
- if (maxDamage > 1 && damage > 0.0) {
- currentDamage += damage;
- }
- }
-
- /**
- * Determines if this component is broken in the current tick of the
- * simulation
- *
- * @return true if the component has broken either from damage (e.g. neutron
- * reflectors, fuel rods) or from heat (e.g. heat vents, coolant
- * cells), false otherwise.
- */
- public boolean isBroken() {
- return currentHeat >= getMaxHeat() || currentDamage >= getMaxDamage();
- }
-
- /**
- * The number of fuel rods in this component (0 for non-fuel-rod
- * components).
- *
- * @return The number of fuel rods in this component, or 0 if this component
- * has no fuel rods.
- */
- public int getRodCount() {
- return 0;
- }
-
- /**
- * Gets a value added in the formula for calculating explosion power.
- *
- * @return the additive value for explosion power caused by this component,
- * or 0 if this component doesn't affect the addition part of the
- * explosion calculation.
- */
- public double getExplosionPowerOffset() {
- if (!isBroken()) {
- if (getRodCount() == 0 && isNeutronReflector()) {
- return -1;
- }
- return 2 * getRodCount(); // all known fuel rods (including those
- // from GT) use this formula, and
- // non-rod components return 0 for
- // getRodCount
- }
- return 0;
- }
-
- /**
- * Gets a value multiplied in the formula for calculating explosion power.
- *
- * @return the multiplier value for explosion power caused by this
- * component, or 1 if this component doesn't affect the
- * multiplication part of the explosion calculation.
- */
- public double getExplosionPowerMultiplier() {
- return explosionPowerMultiplier;
- }
-
- /**
- * Finds the theoretical maximum venting of this component, regardless of
- * whether this venting is from itself, directly from the reactor, or from
- * adjacent components.
- *
- * @return the capacity of this component to vent heat.
- */
- public double getVentCoolingCapacity() {
- return 0;
- }
-
- /**
- * Finds the theoretical maximum hull cooling of this component.
- *
- * @return the capacity of this component to remove heat from the reactor
- * hull.
- */
- public double getHullCoolingCapacity() {
- return 0;
- }
-
- /**
- * Gets the current "output" of this component, presumably for writing to
- * CSV data. What this "output" means may vary by component type or reactor
- * type.
- *
- * @return the output of this component for the current reactor tick.
- */
- public double getCurrentOutput() {
- return 0;
- }
-
- /**
- * Determines whether this component expects to produces some sort of output
- * each reactor tick, e.g. for purposes of tracking in a CSV file.
- *
- * @return true if this component produces output (such as EU or vented
- * heat), false otherwise.
- */
- public boolean producesOutput() {
- return getVentCoolingCapacity() > 0 || getRodCount() > 0;
- }
-
- /**
- * Determines if this component needs input from a Reactor Coolant Injector.
- * Simply returns false for non-condensator items.
- *
- * @return true if this is a condensator that has absorbed enough heat to
- * require the appropriate item added to repair it, false otherwise.
- */
- public boolean needsCoolantInjected() {
- return false;
- }
-
- /**
- * Simulates having a coolant item added by a Reactor Coolant Injector.
- */
- public void injectCoolant() {
- // do nothing by default.
- }
+ public static HashMap<String, ReactorItem> sComponentMap = new HashMap<String, ReactorItem>();
+ // Fundamental values, set at object instantiation, should never need to be
+ // changed.
+ public final int id;
+ public final String baseName; // this is the non-localized version, for
+ // internal program use
+ public final String name; // this is expected to be localized, for display
+ // usage.
+ protected double maxDamage;
+
+ public double getMaxDamage() {
+ return maxDamage;
+ }
+
+ protected double maxHeat;
+
+ public double getMaxHeat() {
+ return maxHeat;
+ }
+
+ public final String sourceMod; // for potentially adjusting controls based
+ // on whether the mod is in use, will be
+ // null to indicate the item is part of base
+ // IC2.
+ public final GT_ItemStack mItem;
+
+ // Simulation setting values
+ private double initialHeat = 0;
+
+ public double getInitialHeat() {
+ return initialHeat;
+ }
+
+ public void setInitialHeat(final double value) {
+ if (this.isHeatAcceptor() && value >= 0 && value < this.maxHeat) {
+ initialHeat = value;
+ }
+ }
+
+ private int automationThreshold = 9000;
+
+ public int getAutomationThreshold() {
+ return automationThreshold;
+ }
+
+ public void setAutomationThreshold(final int value) {
+ if (maxHeat > 1 || maxDamage > 1) {
+ automationThreshold = value;
+ }
+ }
+
+ private int reactorPause = 0;
+
+ public int getReactorPause() {
+ return reactorPause;
+ }
+
+ public void setReactorPause(final int value) {
+ if (maxHeat > 1 || maxDamage > 1) {
+ reactorPause = value;
+ }
+ }
+
+ // fields below here are not to be copied by the copy constructor.
+
+ // Parent reactor and position
+ protected Reactor parent = null;
+ protected int row = -10;
+ protected int col = -10;
+
+ // Special variable for holding information about this item from last
+ // simulation.
+ // Usage of StringBuffer instead of StringBuilder is deliberate - this may
+ // be accessed by
+ // both the simulation worker thread and the event dispatch thread.
+ public final StringBuffer info = new StringBuffer(1000);
+
+ // Calculated values - readable from outside, but only writable by
+ // subclasses.
+ protected double currentDamage = 0;
+
+ public double getCurrentDamage() {
+ return currentDamage;
+ }
+
+ protected double currentHeat = 0;
+
+ public double getCurrentHeat() {
+ return currentHeat;
+ }
+
+ protected double maxReachedHeat = 0;
+
+ public double getMaxReachedHeat() {
+ return maxReachedHeat;
+ }
+
+ protected double currentEUGenerated = 0;
+
+ public double getCurrentEUGenerated() {
+ return currentEUGenerated;
+ }
+
+ protected double minEUGenerated = Double.MAX_VALUE;
+
+ public double getMinEUGenerated() {
+ return minEUGenerated;
+ }
+
+ protected double maxEUGenerated = 0;
+
+ public double getMaxEUGenerated() {
+ return maxEUGenerated;
+ }
+
+ protected double currentHeatGenerated = 0;
+
+ public double getCurrentHeatGenerated() {
+ return currentHeatGenerated;
+ }
+
+ protected double minHeatGenerated = Double.MAX_VALUE;
+
+ public double getMinHeatGenerated() {
+ return minHeatGenerated;
+ }
+
+ protected double maxHeatGenerated = 0;
+
+ public double getMaxHeatGenerated() {
+ return maxHeatGenerated;
+ }
+
+ protected double currentHullHeating = 0;
+
+ public double getCurrentHullHeating() {
+ return currentHullHeating;
+ }
+
+ protected double currentComponentHeating = 0;
+
+ public double getCurrentComponentHeating() {
+ return currentComponentHeating;
+ }
+
+ protected double currentHullCooling = 0;
+
+ public double getCurrentHullCooling() {
+ return currentHullCooling;
+ }
+
+ protected double currentVentCooling = 0;
+
+ public double getCurrentVentCooling() {
+ return currentVentCooling;
+ }
+
+ protected double bestVentCooling = 0;
+
+ public double getBestVentCooling() {
+ return bestVentCooling;
+ }
+
+ protected double currentCellCooling = 0;
+
+ public double getCurrentCellCooling() {
+ return currentCellCooling;
+ }
+
+ protected double bestCellCooling = 0;
+
+ public double getBestCellCooling() {
+ return bestCellCooling;
+ }
+
+ protected double currentCondensatorCooling = 0;
+
+ public double getCurrentCondensatorCooling() {
+ return currentCondensatorCooling;
+ }
+
+ protected double bestCondensatorCooling = 0;
+
+ public double getBestCondensatorCooling() {
+ return bestCondensatorCooling;
+ }
+
+ protected double explosionPowerMultiplier = 1;
+
+ protected ReactorItem(
+ final int id,
+ final String baseName,
+ GT_ItemStack aItem,
+ final double maxDamage,
+ final double maxHeat,
+ String sourceMod) {
+ this.id = id;
+ this.baseName = baseName;
+ this.name = aItem.mItem.getItemStackDisplayName(aItem.toStack());
+ this.mItem = aItem;
+ this.maxDamage = maxDamage;
+ this.maxHeat = maxHeat;
+ if (maxHeat > 1) {
+ automationThreshold = (int) (maxHeat * 0.9);
+ } else if (maxDamage > 1) {
+ automationThreshold = (int) (maxDamage * 1.1);
+ }
+ if (sourceMod == null) {
+ sourceMod = "IC2";
+ }
+ this.sourceMod = sourceMod;
+ sComponentMap.put(sourceMod + "." + aItem.mItem.getUnlocalizedName() + "." + aItem.mMetaData, this);
+ }
+
+ // Protected copy constructor for use by subclasses. Generalized copying
+ // should be done with a method in ComponentFactory (which can check which
+ // subclass copy constructor to use).
+ protected ReactorItem(final ReactorItem other) {
+ this.id = other.id;
+ this.baseName = other.baseName;
+ this.name = other.name;
+ this.mItem = other.mItem;
+ this.maxDamage = other.maxDamage;
+ this.maxHeat = other.maxHeat;
+ this.initialHeat = other.initialHeat;
+ this.automationThreshold = other.automationThreshold;
+ this.reactorPause = other.reactorPause;
+ this.sourceMod = other.sourceMod;
+ }
+
+ /**
+ * Gets the name of the component, and the initial heat (if applicable).
+ *
+ * @return the name of this component, and potentially initial heat.
+ */
+ @Override
+ public String toString() {
+ String result = name;
+ if (initialHeat > 0) {
+ result += String.format("\u0020(initial heat: %,d)", (int) initialHeat);
+ }
+ return result;
+ }
+
+ /**
+ * Checks if this component can accept heat. (e.g. from adjacent fuel rods,
+ * or from an exchanger)
+ *
+ * @return true if this component can accept heat, false otherwise.
+ */
+ public boolean isHeatAcceptor() {
+ // maxHeat of 1 means this component never accepts heat (though it might
+ // take damage instead)
+ return maxHeat > 1 && !isBroken();
+ }
+
+ /**
+ * Determines if this component can be cooled down, such as by a component
+ * heat vent.
+ *
+ * @return true if this component can be cooled down, false otherwise.
+ */
+ public boolean isCoolable() {
+ return maxHeat > 1 && !(this instanceof Condensator);
+ }
+
+ /**
+ * Checks if this component acts as a neutron reflector, and boosts
+ * performance of adjacent fuel rods, either by being a "neutron reflector"
+ * item or by being a fuel rod.
+ *
+ * @return true if this component reflects neutrons, false otherwise.
+ */
+ public boolean isNeutronReflector() {
+ return false;
+ }
+
+ /**
+ * Prepare for a new reactor tick.
+ */
+ public void preReactorTick() {
+ currentHullHeating = 0.0;
+ currentComponentHeating = 0.0;
+ currentHullCooling = 0.0;
+ currentVentCooling = 0.0;
+ currentCellCooling = 0.0;
+ currentCondensatorCooling = 0.0;
+ currentEUGenerated = 0;
+ currentHeatGenerated = 0;
+ }
+
+ /**
+ * Generate heat if appropriate for component type, and spread to reactor or
+ * adjacent cells.
+ *
+ * @return the amount of heat generated by this component.
+ */
+ public double generateHeat() {
+ return 0.0;
+ }
+
+ /**
+ * Generate energy if appropriate for component type.
+ *
+ * @return the number of EU generated by this component during the current
+ * reactor tick.
+ */
+ public double generateEnergy() {
+ return 0.0;
+ }
+
+ /**
+ * Dissipate (aka vent) heat if appropriate for component type.
+ *
+ * @return the amount of heat successfully vented during the current reactor
+ * tick.
+ */
+ public double dissipate() {
+ return 0.0;
+ }
+
+ /**
+ * Transfer heat between component, neighbors, and/or reactor, if
+ * appropriate for component type.
+ */
+ public void transfer() {
+ // do nothing by default.
+ }
+
+ /**
+ * Adds this component to a new reactor, and applies changes to the reactor
+ * when adding this component if appropriate, such as for reactor plating.
+ *
+ * @param parent
+ * the reactor to add this component to.
+ * @param row
+ * the row this component will be in.
+ * @param col
+ * the column this component will be in.
+ */
+ public void addToReactor(final Reactor parent, final int row, final int col) {
+ // call removeFromReactor first, in case it had previously been added to
+ // a different reactor (unlikely)
+ removeFromReactor();
+ this.parent = parent;
+ this.row = row;
+ this.col = col;
+ }
+
+ /**
+ * Removes this component from its reactor (if any), and applies changes to
+ * the reactor when removing this component if appropriate, such as for
+ * reactor plating.
+ */
+ public void removeFromReactor() {
+ parent = null;
+ this.row = -10;
+ this.col = -10;
+ }
+
+ /**
+ * Resets heat to 0 (used when resetting simulation).
+ */
+ public final void clearCurrentHeat() {
+ currentHeat = initialHeat;
+ bestVentCooling = 0.0;
+ bestCondensatorCooling = 0.0;
+ bestCellCooling = 0.0;
+ minEUGenerated = Double.MAX_VALUE;
+ maxEUGenerated = 0.0;
+ minHeatGenerated = Double.MAX_VALUE;
+ maxHeatGenerated = 0.0;
+ maxReachedHeat = initialHeat;
+ }
+
+ /**
+ * Adjusts the component heat up or down
+ *
+ * @param heat
+ * the amount of heat to adjust by (positive to add heat,
+ * negative to remove heat).
+ * @return the amount of heat adjustment refused. (e.g. due to going below
+ * minimum heat, breaking due to excessive heat, or attempting to
+ * remove heat from a condensator)
+ */
+ public double adjustCurrentHeat(final double heat) {
+ if (isHeatAcceptor()) {
+ double result = 0.0;
+ double tempHeat = getCurrentHeat();
+ tempHeat += heat;
+ if (tempHeat > getMaxHeat()) {
+ result = getMaxHeat() - tempHeat + 1;
+ tempHeat = getMaxHeat();
+ } else if (tempHeat < 0.0) {
+ result = tempHeat;
+ tempHeat = 0.0;
+ }
+ currentHeat = tempHeat;
+ maxReachedHeat = Math.max(maxReachedHeat, currentHeat);
+ return result;
+ }
+ return heat;
+ }
+
+ /**
+ * Clears the damage back to 0 (used when resetting simulation, or replacing
+ * the component in an automation simulation).
+ */
+ public final void clearDamage() {
+ currentDamage = 0.0;
+ }
+
+ /**
+ * Applies damage to the component, as opposed to heat. Mainly used for fuel
+ * rods and neutron reflectors that lose durability as the reactor runs, but
+ * can't recover it via cooling.
+ *
+ * @param damage
+ * the damage to apply (only used if positive).
+ */
+ public final void applyDamage(final double damage) {
+ // maxDamage of 1 is treated as meaning the component doesn't accept
+ // damage (though it might accept heat instead)
+ // if someone actually writes a mod with such a flimsy component, I
+ // might have to rethink this.
+ if (maxDamage > 1 && damage > 0.0) {
+ currentDamage += damage;
+ }
+ }
+
+ /**
+ * Determines if this component is broken in the current tick of the
+ * simulation
+ *
+ * @return true if the component has broken either from damage (e.g. neutron
+ * reflectors, fuel rods) or from heat (e.g. heat vents, coolant
+ * cells), false otherwise.
+ */
+ public boolean isBroken() {
+ return currentHeat >= getMaxHeat() || currentDamage >= getMaxDamage();
+ }
+
+ /**
+ * The number of fuel rods in this component (0 for non-fuel-rod
+ * components).
+ *
+ * @return The number of fuel rods in this component, or 0 if this component
+ * has no fuel rods.
+ */
+ public int getRodCount() {
+ return 0;
+ }
+
+ /**
+ * Gets a value added in the formula for calculating explosion power.
+ *
+ * @return the additive value for explosion power caused by this component,
+ * or 0 if this component doesn't affect the addition part of the
+ * explosion calculation.
+ */
+ public double getExplosionPowerOffset() {
+ if (!isBroken()) {
+ if (getRodCount() == 0 && isNeutronReflector()) {
+ return -1;
+ }
+ return 2 * getRodCount(); // all known fuel rods (including those
+ // from GT) use this formula, and
+ // non-rod components return 0 for
+ // getRodCount
+ }
+ return 0;
+ }
+
+ /**
+ * Gets a value multiplied in the formula for calculating explosion power.
+ *
+ * @return the multiplier value for explosion power caused by this
+ * component, or 1 if this component doesn't affect the
+ * multiplication part of the explosion calculation.
+ */
+ public double getExplosionPowerMultiplier() {
+ return explosionPowerMultiplier;
+ }
+
+ /**
+ * Finds the theoretical maximum venting of this component, regardless of
+ * whether this venting is from itself, directly from the reactor, or from
+ * adjacent components.
+ *
+ * @return the capacity of this component to vent heat.
+ */
+ public double getVentCoolingCapacity() {
+ return 0;
+ }
+
+ /**
+ * Finds the theoretical maximum hull cooling of this component.
+ *
+ * @return the capacity of this component to remove heat from the reactor
+ * hull.
+ */
+ public double getHullCoolingCapacity() {
+ return 0;
+ }
+
+ /**
+ * Gets the current "output" of this component, presumably for writing to
+ * CSV data. What this "output" means may vary by component type or reactor
+ * type.
+ *
+ * @return the output of this component for the current reactor tick.
+ */
+ public double getCurrentOutput() {
+ return 0;
+ }
+
+ /**
+ * Determines whether this component expects to produces some sort of output
+ * each reactor tick, e.g. for purposes of tracking in a CSV file.
+ *
+ * @return true if this component produces output (such as EU or vented
+ * heat), false otherwise.
+ */
+ public boolean producesOutput() {
+ return getVentCoolingCapacity() > 0 || getRodCount() > 0;
+ }
+
+ /**
+ * Determines if this component needs input from a Reactor Coolant Injector.
+ * Simply returns false for non-condensator items.
+ *
+ * @return true if this is a condensator that has absorbed enough heat to
+ * require the appropriate item added to repair it, false otherwise.
+ */
+ public boolean needsCoolantInjected() {
+ return false;
+ }
+
+ /**
+ * Simulates having a coolant item added by a Reactor Coolant Injector.
+ */
+ public void injectCoolant() {
+ // do nothing by default.
+ }
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java b/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java
index 7851a62804..bca0e9f43a 100644
--- a/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java
+++ b/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java
@@ -12,17 +12,23 @@ import gregtech.api.objects.GT_ItemStack;
* @author Brian McCloud
*/
public class Reflector extends ReactorItem {
-
+
private static String mcVersion = "1.12.2";
-
- public Reflector(final int id, final String baseName, final GT_ItemStack aStack, final double maxDamage, final double maxHeat, final String sourceMod) {
+
+ public Reflector(
+ final int id,
+ final String baseName,
+ final GT_ItemStack aStack,
+ final double maxDamage,
+ final double maxHeat,
+ final String sourceMod) {
super(id, baseName, aStack, maxDamage, maxHeat, sourceMod);
}
-
+
public Reflector(final Reflector other) {
super(other);
}
-
+
@Override
public boolean isNeutronReflector() {
return !isBroken();
@@ -48,7 +54,7 @@ public class Reflector extends ReactorItem {
}
return 0;
}
-
+
@Override
public double getMaxDamage() {
if (maxDamage > 1 && "1.7.10".equals(mcVersion)) {
@@ -56,7 +62,7 @@ public class Reflector extends ReactorItem {
}
return maxDamage;
}
-
+
public static void setMcVersion(String newVersion) {
mcVersion = newVersion;
}
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Vent.java b/src/main/java/Ic2ExpReactorPlanner/components/Vent.java
index a43383f694..9eb9f3aa66 100644
--- a/src/main/java/Ic2ExpReactorPlanner/components/Vent.java
+++ b/src/main/java/Ic2ExpReactorPlanner/components/Vent.java
@@ -5,36 +5,43 @@
*/
package Ic2ExpReactorPlanner.components;
+import gregtech.api.objects.GT_ItemStack;
import java.util.ArrayList;
import java.util.List;
-import gregtech.api.objects.GT_ItemStack;
-
/**
* Represents some kind of vent in a reactor.
* @author Brian McCloud
*/
public class Vent extends ReactorItem {
-
+
private final int selfVent;
private final int hullDraw;
private final int sideVent;
-
- public Vent(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, final double maxHeat, final String sourceMod,
- final int selfVent, final int hullDraw, final int sideVent) {
+
+ public Vent(
+ final int id,
+ final String baseName,
+ GT_ItemStack aItem,
+ final double maxDamage,
+ final double maxHeat,
+ final String sourceMod,
+ final int selfVent,
+ final int hullDraw,
+ final int sideVent) {
super(id, baseName, aItem, maxDamage, maxHeat, sourceMod);
this.selfVent = selfVent;
this.hullDraw = hullDraw;
this.sideVent = sideVent;
}
-
+
public Vent(final Vent other) {
super(other);
this.selfVent = other.selfVent;
this.hullDraw = other.hullDraw;
this.sideVent = other.sideVent;
}
-
+
@Override
public double dissipate() {
double deltaHeat = Math.min(hullDraw, parent.getCurrentHeat());
@@ -73,7 +80,7 @@ public class Vent extends ReactorItem {
bestVentCooling = Math.max(bestVentCooling, currentVentCooling);
return currentDissipation;
}
-
+
@Override
public double getVentCoolingCapacity() {
double result = selfVent;
@@ -97,14 +104,14 @@ public class Vent extends ReactorItem {
}
return result;
}
-
+
@Override
public double getHullCoolingCapacity() {
return hullDraw;
}
-
+
@Override
public double getCurrentOutput() {
return currentVentCooling;
}
- }
+}
diff --git a/src/main/java/gregtech/api/enums/TAE.java b/src/main/java/gregtech/api/enums/TAE.java
index 274a29065b..e45e9e4e58 100644
--- a/src/main/java/gregtech/api/enums/TAE.java
+++ b/src/main/java/gregtech/api/enums/TAE.java
@@ -1,9 +1,5 @@
package gregtech.api.enums;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.HashSet;
-
import gregtech.api.interfaces.ITexture;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -12,141 +8,144 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.HashSet;
public class TAE {
- //TAE stands for Texture Array Expansion.
-
- public static int gtPPLastUsedIndex = 64;
- public static int secondaryIndex = 0;
-
- public static HashMap<Integer, GTPP_CopiedBlockTexture> mTAE = new HashMap<Integer, GTPP_CopiedBlockTexture>();
- private static final HashSet<Integer> mFreeSlots = new HashSet<Integer>(64);
-
- static {
- for (int i=64;i<128;i++) {
- mFreeSlots.add(i);
- }
- Logger.INFO("Initialising TAE.");
- }
-
- /**
- *
- * @param aPage - The Texture page (0-3)
- * @param aID - The ID on the specified page (0-15)
- * @param GTPP_CopiedBlockTexture - The Texture to register
- * @return - Did it register correctly?
- */
- public static boolean registerTexture(int aPage, int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) {
- int aRealID = aID + (aPage * 16);
- return registerTexture(64 + aRealID, GTPP_CopiedBlockTexture);
- }
-
- public static boolean registerTexture(int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) {
- if (mFreeSlots.contains(aID)) {
- mFreeSlots.remove(aID);
- mTAE.put(aID, GTPP_CopiedBlockTexture);
- return true;
- }
- else {
- CORE.crash("Tried to register texture with ID "+aID+" to TAE, but it is already in use.");
- return false; // Dead Code
- }
- }
-
- public static void finalizeTAE() {
- String aFreeSpaces = "";
- String aPageAndSlotFree = "";
- AutoMap<Integer> aTemp = new AutoMap<Integer>(mFreeSlots);
- for (int i = 0; i < mFreeSlots.size() ; i++) {
- int j = aTemp.get(i);
- aFreeSpaces += j;
- aPageAndSlotFree += getPageFromIndex(j);
- if (i != (mFreeSlots.size() - 1)) {
- aFreeSpaces += ", ";
- aPageAndSlotFree += ", ";
- }
- }
- Logger.INFO("Free Indexes within TAE: "+aFreeSpaces);
- Logger.INFO("Free Page slots within TAE: "+aPageAndSlotFree);
- Logger.INFO("Filling them with ERROR textures.");
- for (int aFreeSlot : aTemp.values()) {
- registerTexture(aFreeSlot, new GTPP_CopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15));
- }
- Logger.INFO("Finalising TAE.");
- for (int aKeyTae : mTAE.keySet()) {
- Textures.BlockIcons.setCasingTextureForId(aKeyTae, mTAE.get(aKeyTae));
- }
- Logger.INFO("Finalised TAE.");
- }
-
- private static boolean registerTextures(GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) {
- try {
- //Handle page 2.
- Logger.INFO("[TAE} Registering Texture, Last used casing ID is "+gtPPLastUsedIndex+".");
- if (gtPPLastUsedIndex >= 128) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 30) {
- Field x = ReflectionUtils.getField(Textures.BlockIcons.class, "casingTexturePages");
- if (x != null) {
- ITexture[][] h = (ITexture[][]) x.get(null);
- if (h != null) {
- h[64][secondaryIndex++] = GTPP_CopiedBlockTexture;
- x.set(null, h);
- Logger.INFO("[TAE} Registered Texture with ID "+(secondaryIndex-1)+" in secondary index.");
- return true;
- }
- }
- }
- }
-
- //set to page 1.
- else {
- Textures.BlockIcons.setCasingTextureForId(gtPPLastUsedIndex, GTPP_CopiedBlockTexture);
- Logger.INFO("[TAE} Registered Texture with ID "+(gtPPLastUsedIndex)+" in main index.");
- gtPPLastUsedIndex++;
- return true;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- Logger.INFO("[TAE} Failed to register texture, Last used casing ID is "+gtPPLastUsedIndex+".");
- return false;
- }
-
- public static ITexture getTexture(int index){
- if (gtPPLastUsedIndex >= 128) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 30) {
- return Textures.BlockIcons.getCasingTextureForId(((64*128)+index));
- }
- }
- return Textures.BlockIcons.getCasingTextureForId((64+index));
- }
-
- public static int GTPP_INDEX(int ID){
-
- if (ID >= 64) {
- if (gtPPLastUsedIndex >= 128) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 30) {
- return (128+ID);
- }
- }
- }
- return (64+ID);
- }
-
- public static int getIndexFromPage(int page, int blockMeta) {
- int id = 64;
- id += (page == 0 ? 0 : page == 1 ? 16 : page == 2 ? 32 : page == 3 ? 48 : page == 4 ? 64 : 0);
- id += blockMeta;
- return id;
- }
- public static String getPageFromIndex(int aIndex) {
- int aPage = 0;
- int aSlot = 0;
- int aAdjustedIndex = aIndex > 64 ? (aIndex - 64) : aIndex;
- aPage = aAdjustedIndex / 16;
- aSlot = aAdjustedIndex - (16 * aPage);
- return "["+aIndex+" | "+aPage+", "+aSlot+"]";
- }
+ // TAE stands for Texture Array Expansion.
+
+ public static int gtPPLastUsedIndex = 64;
+ public static int secondaryIndex = 0;
+
+ public static HashMap<Integer, GTPP_CopiedBlockTexture> mTAE = new HashMap<Integer, GTPP_CopiedBlockTexture>();
+ private static final HashSet<Integer> mFreeSlots = new HashSet<Integer>(64);
+
+ static {
+ for (int i = 64; i < 128; i++) {
+ mFreeSlots.add(i);
+ }
+ Logger.INFO("Initialising TAE.");
+ }
+
+ /**
+ *
+ * @param aPage - The Texture page (0-3)
+ * @param aID - The ID on the specified page (0-15)
+ * @param GTPP_CopiedBlockTexture - The Texture to register
+ * @return - Did it register correctly?
+ */
+ public static boolean registerTexture(int aPage, int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) {
+ int aRealID = aID + (aPage * 16);
+ return registerTexture(64 + aRealID, GTPP_CopiedBlockTexture);
+ }
+
+ public static boolean registerTexture(int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) {
+ if (mFreeSlots.contains(aID)) {
+ mFreeSlots.remove(aID);
+ mTAE.put(aID, GTPP_CopiedBlockTexture);
+ return true;
+ } else {
+ CORE.crash("Tried to register texture with ID " + aID + " to TAE, but it is already in use.");
+ return false; // Dead Code
+ }
+ }
+
+ public static void finalizeTAE() {
+ String aFreeSpaces = "";
+ String aPageAndSlotFree = "";
+ AutoMap<Integer> aTemp = new AutoMap<Integer>(mFreeSlots);
+ for (int i = 0; i < mFreeSlots.size(); i++) {
+ int j = aTemp.get(i);
+ aFreeSpaces += j;
+ aPageAndSlotFree += getPageFromIndex(j);
+ if (i != (mFreeSlots.size() - 1)) {
+ aFreeSpaces += ", ";
+ aPageAndSlotFree += ", ";
+ }
+ }
+ Logger.INFO("Free Indexes within TAE: " + aFreeSpaces);
+ Logger.INFO("Free Page slots within TAE: " + aPageAndSlotFree);
+ Logger.INFO("Filling them with ERROR textures.");
+ for (int aFreeSlot : aTemp.values()) {
+ registerTexture(aFreeSlot, new GTPP_CopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15));
+ }
+ Logger.INFO("Finalising TAE.");
+ for (int aKeyTae : mTAE.keySet()) {
+ Textures.BlockIcons.setCasingTextureForId(aKeyTae, mTAE.get(aKeyTae));
+ }
+ Logger.INFO("Finalised TAE.");
+ }
+
+ private static boolean registerTextures(GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) {
+ try {
+ // Handle page 2.
+ Logger.INFO("[TAE} Registering Texture, Last used casing ID is " + gtPPLastUsedIndex + ".");
+ if (gtPPLastUsedIndex >= 128) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 30) {
+ Field x = ReflectionUtils.getField(Textures.BlockIcons.class, "casingTexturePages");
+ if (x != null) {
+ ITexture[][] h = (ITexture[][]) x.get(null);
+ if (h != null) {
+ h[64][secondaryIndex++] = GTPP_CopiedBlockTexture;
+ x.set(null, h);
+ Logger.INFO("[TAE} Registered Texture with ID " + (secondaryIndex - 1)
+ + " in secondary index.");
+ return true;
+ }
+ }
+ }
+ }
+
+ // set to page 1.
+ else {
+ Textures.BlockIcons.setCasingTextureForId(gtPPLastUsedIndex, GTPP_CopiedBlockTexture);
+ Logger.INFO("[TAE} Registered Texture with ID " + (gtPPLastUsedIndex) + " in main index.");
+ gtPPLastUsedIndex++;
+ return true;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ Logger.INFO("[TAE} Failed to register texture, Last used casing ID is " + gtPPLastUsedIndex + ".");
+ return false;
+ }
+
+ public static ITexture getTexture(int index) {
+ if (gtPPLastUsedIndex >= 128) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 30) {
+ return Textures.BlockIcons.getCasingTextureForId(((64 * 128) + index));
+ }
+ }
+ return Textures.BlockIcons.getCasingTextureForId((64 + index));
+ }
+
+ public static int GTPP_INDEX(int ID) {
+
+ if (ID >= 64) {
+ if (gtPPLastUsedIndex >= 128) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 30) {
+ return (128 + ID);
+ }
+ }
+ }
+ return (64 + ID);
+ }
+
+ public static int getIndexFromPage(int page, int blockMeta) {
+ int id = 64;
+ id += (page == 0 ? 0 : page == 1 ? 16 : page == 2 ? 32 : page == 3 ? 48 : page == 4 ? 64 : 0);
+ id += blockMeta;
+ return id;
+ }
+
+ public static String getPageFromIndex(int aIndex) {
+ int aPage = 0;
+ int aSlot = 0;
+ int aAdjustedIndex = aIndex > 64 ? (aIndex - 64) : aIndex;
+ aPage = aAdjustedIndex / 16;
+ aSlot = aAdjustedIndex - (16 * aPage);
+ return "[" + aIndex + " | " + aPage + ", " + aSlot + "]";
+ }
}
diff --git a/src/main/java/gregtech/api/util/EmptyRecipeMap.java b/src/main/java/gregtech/api/util/EmptyRecipeMap.java
index 31e1e3db17..45a31b7c1d 100644
--- a/src/main/java/gregtech/api/util/EmptyRecipeMap.java
+++ b/src/main/java/gregtech/api/util/EmptyRecipeMap.java
@@ -1,51 +1,99 @@
package gregtech.api.util;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import java.util.Collection;
-
import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+public class EmptyRecipeMap extends GT_Recipe_Map {
-import net.minecraftforge.fluids.FluidStack;
+ public EmptyRecipeMap(
+ Collection<GT_Recipe> 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 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(
+ 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;
+ }
-public class EmptyRecipeMap extends GT_Recipe_Map{
-
- public EmptyRecipeMap(Collection<GT_Recipe> 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 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(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
- protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
- return null;
- }
-
- @Override
- public GT_Recipe add(GT_Recipe aRecipe) {
- return null;
- }
+ @Override
+ protected GT_Recipe addRecipe(
+ GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
+ return null;
+ }
+ @Override
+ public GT_Recipe add(GT_Recipe aRecipe) {
+ return null;
+ }
}
diff --git a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java
index bc7cdb4701..14cd00d134 100644
--- a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java
+++ b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java
@@ -1,80 +1,80 @@
package gregtech.api.util;
-import java.util.ArrayList;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.WeightedRandomFishable;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.ArrayList;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.WeightedRandomFishable;
import net.minecraftforge.common.FishingHooks;
import net.minecraftforge.fluids.FluidStack;
public class FishPondFakeRecipe {
- public static ArrayList<WeightedRandomFishable> fish = new ArrayList<WeightedRandomFishable>();
- public static ArrayList<WeightedRandomFishable> junk = new ArrayList<WeightedRandomFishable>();
- public static ArrayList<WeightedRandomFishable> treasure = new ArrayList<WeightedRandomFishable>();
-
- @SuppressWarnings("unchecked")
- public static boolean generateFishPondRecipes() {
+ public static ArrayList<WeightedRandomFishable> fish = new ArrayList<WeightedRandomFishable>();
+ public static ArrayList<WeightedRandomFishable> junk = new ArrayList<WeightedRandomFishable>();
+ public static ArrayList<WeightedRandomFishable> treasure = new ArrayList<WeightedRandomFishable>();
- try {
- fish = (ArrayList<WeightedRandomFishable>) ReflectionUtils.getField(FishingHooks.class, "fish").get(null);
- junk = (ArrayList<WeightedRandomFishable>) ReflectionUtils.getField(FishingHooks.class, "junk").get(null);
- treasure = (ArrayList<WeightedRandomFishable>) ReflectionUtils.getField(FishingHooks.class, "treasure").get(null);
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
- Logger.INFO("Error generating Fish Pond Recipes. [1]");
- e.printStackTrace();
- }
+ @SuppressWarnings("unchecked")
+ public static boolean generateFishPondRecipes() {
- AutoMap<ArrayList<WeightedRandomFishable>> mega = new AutoMap<ArrayList<WeightedRandomFishable>>();
- mega.put(fish);
- mega.put(junk);
- mega.put(treasure);
+ try {
+ fish = (ArrayList<WeightedRandomFishable>)
+ ReflectionUtils.getField(FishingHooks.class, "fish").get(null);
+ junk = (ArrayList<WeightedRandomFishable>)
+ ReflectionUtils.getField(FishingHooks.class, "junk").get(null);
+ treasure = (ArrayList<WeightedRandomFishable>)
+ ReflectionUtils.getField(FishingHooks.class, "treasure").get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ Logger.INFO("Error generating Fish Pond Recipes. [1]");
+ e.printStackTrace();
+ }
- int mType = 14;
- for (ArrayList<WeightedRandomFishable> f : mega.values()) {
- for (int e=0;e<f.size();e++) {
- if (f.get(e) != null) {
- WeightedRandomFishable u = f.get(e);
- try {
- ItemStack t = (ItemStack) ReflectionUtils.getField(WeightedRandomFishable.class, "field_150711_b").get(u);
- addNewFishPondLoot(mType, new ItemStack[]{t}, new int[] {10000});
- }
- catch (IllegalArgumentException | IllegalAccessException e1) {
- Logger.INFO("Error generating Fish Pond Recipes. [2]");
- e1.printStackTrace();
- }
- }
- }
- mType++;
- }
+ AutoMap<ArrayList<WeightedRandomFishable>> mega = new AutoMap<ArrayList<WeightedRandomFishable>>();
+ mega.put(fish);
+ mega.put(junk);
+ mega.put(treasure);
- return true;
- }
+ int mType = 14;
+ for (ArrayList<WeightedRandomFishable> f : mega.values()) {
+ for (int e = 0; e < f.size(); e++) {
+ if (f.get(e) != null) {
+ WeightedRandomFishable u = f.get(e);
+ try {
+ ItemStack t =
+ (ItemStack) ReflectionUtils.getField(WeightedRandomFishable.class, "field_150711_b")
+ .get(u);
+ addNewFishPondLoot(mType, new ItemStack[] {t}, new int[] {10000});
+ } catch (IllegalArgumentException | IllegalAccessException e1) {
+ Logger.INFO("Error generating Fish Pond Recipes. [2]");
+ e1.printStackTrace();
+ }
+ }
+ }
+ mType++;
+ }
- public static void addNewFishPondLoot(int circuit, ItemStack[] outputItems, int[] chances) {
- GTPP_Recipe x = new GTPP_Recipe(
- true,
- new ItemStack[]{CI.getNumberedCircuit(circuit)},
- outputItems,
- null,
- chances,
- new FluidStack[]{null},
- new FluidStack[]{null},
- 100, //1 Tick
- 0, //No Eu produced
- circuit //Magic Number
- );
- if (x != null) {
- Logger.INFO("Fishing ["+circuit+"]: "+ItemUtils.getArrayStackNames(outputItems));
- GTPP_Recipe.GTPP_Recipe_Map.sFishPondRecipes.addRecipe(x);
- }
- }
+ return true;
+ }
+ public static void addNewFishPondLoot(int circuit, ItemStack[] outputItems, int[] chances) {
+ GTPP_Recipe x = new GTPP_Recipe(
+ true,
+ new ItemStack[] {CI.getNumberedCircuit(circuit)},
+ outputItems,
+ null,
+ chances,
+ new FluidStack[] {null},
+ new FluidStack[] {null},
+ 100, // 1 Tick
+ 0, // No Eu produced
+ circuit // Magic Number
+ );
+ if (x != null) {
+ Logger.INFO("Fishing [" + circuit + "]: " + ItemUtils.getArrayStackNames(outputItems));
+ GTPP_Recipe.GTPP_Recipe_Map.sFishPondRecipes.addRecipe(x);
+ }
+ }
}
diff --git a/src/main/java/gregtech/api/util/GTPP_Recipe.java b/src/main/java/gregtech/api/util/GTPP_Recipe.java
index 323977a348..891b5ba0a8 100644
--- a/src/main/java/gregtech/api/util/GTPP_Recipe.java
+++ b/src/main/java/gregtech/api/util/GTPP_Recipe.java
@@ -2,12 +2,8 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.*;
-import java.util.*;
-
import codechicken.nei.PositionedStack;
-import gregtech.api.GregTech_API;
import gregtech.api.interfaces.tileentity.*;
-import gregtech.api.objects.GT_ItemStack;
import gregtech.nei.GT_NEI_DefaultHandler.FixedPositionedStack;
import gtPlusPlus.api.interfaces.IComparableRecipe;
import gtPlusPlus.api.objects.Logger;
@@ -15,6 +11,7 @@ import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import java.util.*;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.*;
@@ -25,542 +22,1405 @@ import net.minecraftforge.fluids.*;
*/
public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe {
- private final String mRecipeHash;
- private final AutoMap<Integer> mHashMap = new AutoMap<Integer>();
-
- public GTPP_Recipe(final boolean aOptimize, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) {
- super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
- //Logger.SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for "+ItemUtils.getArrayStackNames(aInputs), 167);
- this.mRecipeHash = getRecipeHash(this);
- this.mHashMap.addAll(convertStringDataToInts(getEncodedRecipeData(this)));
- }
-
- public GTPP_Recipe(final ItemStack aInput1, final ItemStack aOutput1, final int aFuelValue, final int aType) {
- this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
- }
-
- private static AutoMap<Integer> convertStringDataToInts(AutoMap<String> aData){
- AutoMap<Integer> aMap = new AutoMap<Integer>();
- for (String string : aData) {
- aMap.add(string.hashCode());
- }
- return aMap;
- }
-
- private static AutoMap<String> getEncodedRecipeData(GTPP_Recipe aRecipe){
- AutoMap<String> aData = new AutoMap<String>();
- aData.add(aRecipe.mRecipeHash);
- aData.add(""+aRecipe.mCanBeBuffered);
- aData.add(""+aRecipe.mHidden);
- aData.add(""+aRecipe.mEnabled);
- aData.add(""+aRecipe.mDuration);
- aData.add(""+aRecipe.mEUt);
- aData.add(""+aRecipe.mFakeRecipe);
- aData.add(""+aRecipe.mSpecialItems);
- aData.add(aRecipe.mChances.toString());
- aData.add(aRecipe.mInputs.toString());
- aData.add(aRecipe.mOutputs.toString());
- aData.add(aRecipe.mFluidInputs.toString());
- aData.add(aRecipe.mFluidOutputs.toString());
- return aData;
- }
-
- public static String getRecipeHash(GT_Recipe aRecipe) {
- String aEncoderString = aRecipe.toString();
- return aEncoderString;
- }
-
- private final void checkModified() {
- if (hasBeenModified()) {
- String[] aInfo = RecipeUtils.getRecipeInfo(this);
- for (String s : aInfo) {
- Logger.INFO(s);
- }
- CORE.crash("Someone has edited an internal GT++ recipe, which is no longer allowed. Please complain to whoever has done this, not Alkalus.");
- }
- }
-
- private final boolean hasBeenModified() {
- String aEncoderString = this.toString();
- boolean aBasicHashCheck = this.mRecipeHash.equals(aEncoderString);
- if (!aBasicHashCheck) {
- Logger.INFO("This Recipe Hash: "+aEncoderString);
- Logger.INFO("Expected Hash Code: "+this.mRecipeHash);
- return true;
- }
- AutoMap<Integer> aData = new AutoMap<Integer>();
- aData.addAll(convertStringDataToInts(getEncodedRecipeData(this)));
- long aHashTotal = 0;
- long aExpectedHashTotal = 0;
- for (int a : aData) {
- aHashTotal += a;
- }
- for (int a : this.mHashMap) {
- aExpectedHashTotal += a;
- }
- if (aHashTotal != aExpectedHashTotal) {
- Logger.INFO("This Recipe Hash: "+aEncoderString);
- Logger.INFO("Expected Hash Code: "+this.mRecipeHash);
- Logger.INFO("This Recipe Hash: "+aHashTotal);
- Logger.INFO("Expected Hash Code: "+aExpectedHashTotal);
- return true;
- }
- return false;
- }
-
- // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
- public GTPP_Recipe(final ItemStack aInput1, final ItemStack aOutput1, final ItemStack aOutput2, final ItemStack aOutput3, final ItemStack aOutput4, final int aSpecialValue, final int aType) {
- this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue));
-
- Logger.WARNING("Switch case method for adding fuels");
- if ((this.mInputs.length > 0) && (aSpecialValue > 0)) {
- switch (aType) {
- // Diesel Generator
- case 0:
- Logger.WARNING("Added fuel "+aInput1.getDisplayName()+" is ROCKET FUEL - continuing");
- GTPP_Recipe_Map.sRocketFuels.addRecipe(this);
- break;
- // Gas Turbine
- case 1:
- GTPP_Recipe_Map.sGeoThermalFuels.addRecipe(this);
- break;
- // Thermal Generator
- case 2:
- GTPP_Recipe_Map.sRTGFuels.addRecipe(this);
- break;
- // Plasma Generator
- case 4:
- //Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this);
- break;
- // Magic Generator
- case 5:
- //Gregtech_Recipe_Map.sMagicFuels.addRecipe(this);
- break;
- // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
- default:
- //Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
- break;
- }
- }
- }
-
- public static void reInit() {
- GT_Log.out.println("GT_Mod: Re-Unificating Recipes.");
- for (final GTPP_Recipe_Map_Internal tMapEntry : GTPP_Recipe_Map_Internal.sMappingsEx) {
- //tMapEntry.reInit();
- if (tMapEntry != null && tMapEntry.mRecipeList != null && !tMapEntry.mRecipeList.isEmpty()) {
- for (GT_Recipe aRecipe : tMapEntry.mRecipeList) {
- checkRecipeOwnership(aRecipe);
- }
- }
- }
- }
-
- private final static boolean checkRecipeOwnership(GT_Recipe aRecipe) {
- if (aRecipe != null && aRecipe instanceof GTPP_Recipe) {
- GTPP_Recipe nRecipe = (GTPP_Recipe) aRecipe;
- GTPP_Recipe_Map_Internal.mHashedRecipes.put(nRecipe.hashCode(), nRecipe);
- return true;
- }
- return false;
- }
-
- public final static void checkRecipeModifications() {
- for (GTPP_Recipe aRecipe : GTPP_Recipe_Map_Internal.mHashedRecipes.values()) {
- Logger.INFO("Checking recipe: "+aRecipe.hashCode());
- aRecipe.checkModified();
- }
- }
-
- public static class GTPP_Recipe_Map_Internal extends GT_Recipe_Map {
-
- public static final Collection<GTPP_Recipe_Map_Internal> sMappingsEx = new ArrayList<>();
- private static final HashMap<Integer, GTPP_Recipe> mHashedRecipes = new HashMap<Integer, GTPP_Recipe>();
-
- public GTPP_Recipe_Map_Internal(Collection<GT_Recipe> 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);
- GT_Recipe_Map.sMappings.remove(this);
- GTPP_Recipe_Map_Internal.sMappingsEx.add(this);
- }
- }
-
- public static class GTPP_Recipe_Map {
- //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gtpp.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
- public static final GTPP_Recipe_Map_Internal sCokeOvenRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 1, 0, 1, E, 1, E, true, true);
- public static final GTPP_Recipe_Map_Internal sMatterFab2Recipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 6, 6, 0, 0, 1, E, 1, E, true, true);
- //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe>(200), "gtpp.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true);
-
- public static final GT_Recipe_Map_Fuel sRocketFuels = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gtpp.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true);
-
- public static final GTPP_Recipe_Map_Internal sGeoThermalFuels = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10), "gtpp.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GTPP_Recipe_Map_Internal sChemicalDehydratorRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.chemicaldehydrator", "Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true);
- public static final GTPP_Recipe_Map_Internal sVacuumFurnaceRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(500), "gtpp.recipe.vacfurnace", "Vacuum Furnace", null, RES_PATH_GUI + "basicmachines/FissionFuel", 6, 6, 1, 0, 1, "Heat Capacity: ", 1, " K", false, true);
- public static final GTPP_Recipe_Map_Internal sAlloyBlastSmelterRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(200), "gtpp.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 1, 0, 1, E, 1, E, true, true);
- public static final GTPP_Recipe_Map_Internal sSteamTurbineFuels = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10), "gtpp.recipe.steamturbinefuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, false);
-
- //LFTR recipes
- public static final GTPP_Recipe_Map_Internal sLiquidFluorineThoriumReactorRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(50), "gtpp.recipe.lftr", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 2, 0, "Power: ", 1, " EU/t per Dynamo", true, true);
-
- // Ore Milling Map
- public static final GTPP_Recipe_Map_Internal sOreMillRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.oremill", "Milling", null, RES_PATH_GUI + "basicmachines/LFTR", 3, 4, 1, 0, 1, E, 1, E, true, true);
-
- //Fission Fuel Plant Recipes
- public static final GTPP_Recipe_Map_Internal sFissionFuelProcessing = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(50), "gtpp.recipe.fissionfuel", "Nuclear Fuel Processing", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 0, 1, E, 1, E, true, true);
-
- //Cold Trap
- public static final GTPP_Recipe_Map_Internal sColdTrapRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.coldtrap", "Cold Trap", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true);
-
- //Reactor Processing Unit
- public static final GTPP_Recipe_Map_Internal sReactorProcessingUnitRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.reactorprocessingunit", "Reactor Processing Unit", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true);
-
- //Basic Washer Map
- public static final GTPP_Recipe_Map_Internal sSimpleWasherRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(3), "gtpp.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true);
-
- //Molecular Transformer Map
- public static final GTPP_Recipe_Map_Internal sMolecularTransformerRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(3), "gtpp.recipe.moleculartransformer", "Molecular Transformer", null, RES_PATH_GUI + "basicmachines/Scanner", 1, 1, 0, 0, 1, E, 1, E, true, true);
-
- //Elemental Duplicator Map
- public static final GTPP_Recipe_Map_Internal sElementalDuplicatorRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(3), "gtpp.recipe.elementaldupe", "Elemental Duplicator", null, RES_PATH_GUI + "basicmachines/Replicator", 1, 1, 0, 1, 1, E, 1, E, true, false);
-
-
- //public static final GT_Recipe_Map sSimpleWasherRecipes_FakeFuckBW = new GT_Recipe_Map(new HashSet<GT_Recipe>(3), "gtpp.recipe.simplewasher", "Fuck you Bart", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, false);
-
- public static final GTPP_Recipe_Map_Internal sChemicalPlantRecipes = new GTPP_Recipe_Map_ChemicalPlant(
- new HashSet<GT_Recipe>(100),
- "gtpp.recipe.fluidchemicaleactor",
- "Chemical Plant",
- null,
- CORE.MODID + ":textures/gui/FluidReactor",
- 0,
- 0,
- 0,
- 2,
- 1,
- "Tier: ",
- 1,
- E,
- true,
- true);
-
-
- //RTG Fuel Map
- public static final GT_Recipe.GT_Recipe_Map_Fuel sRTGFuels = new GTPP_Recipe.GT_Recipe_Map_Fuel(
- new HashSet<GT_Recipe>(10), "gtpp.recipe.RTGgenerators", "RTG", null,
- "gregtech:textures/gui/basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 365, " Minecraft Days", true, true);
-
- //Thermal Boiler map
- public static final GTPP_Recipe_Map_Internal sThermalFuels = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(10), "gtpp.recipe.thermalgeneratorfuel",
- "Thermal Generator Fuel", null, RES_PATH_GUI + "basicmachines/FissionFuel", 1, 1, 0, 0, 1,
- null, 1000, null, true, true);
-
- //Solar Tower map
- public static final GTPP_Recipe_Map_Internal sSolarTowerRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(10), "gtpp.recipe.solartower",
- "Solar Tower", null, RES_PATH_GUI + "basicmachines/FissionFuel", 1, 1, 0, 0, 1,
- null, 1000, null, true, true);
-
- //Cyclotron recipe map
- public static final GTPP_Recipe_Map_Internal sCyclotronRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.cyclotron", "COMET - Compact Cyclotron", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 2, 16, 0, 0, 1, E, 1, E, true, true);
-
- //Advanced Mixer
- public static final GTPP_Recipe_Map_Internal sAdvancedMixerRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(1000), "gtpp.recipe.advanced.mixer",
- "Advanced Material Combiner", null, "gregtech:textures/gui/basicmachines/MixerAdvanced", 4, 4, 1, 0, 2, "", 1, "", true, true);
-
-
- //Mini Fusion
- public static final GTPP_Recipe_Map_Internal sSlowFusionRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(50), "gtpp.recipe.slowfusionreactor",
- "Mimir - Slow Fusion", null, "gregtech:textures/gui/basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1,
- " EU", true, true);
-
-
- //Component Assembler
- public static final GT_Recipe_Map sComponentAssemblerRecipes = new GT_Recipe_Map_Assembler(new HashSet<GT_Recipe>(300), "gtpp.recipe.componentassembler", "Component Assembler", null, RES_PATH_GUI + "basicmachines/Assembler", 6, 1, 1, 0, 1, E, 1, E, true, true);
-
- //Special Maps for Multis
- public static final GTPP_Recipe_Map_Internal sFishPondRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(3), "gtpp.recipe.fishpond", "Zhuhai - Fishing Port", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 1, 0, 0, 1, "Requires Circuit: ", 1, ".", true, true);
- public static final GTPP_Recipe_Map_Internal sSpargeTowerRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.spargetower", "Sparging", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, E, 1, E, true, false);
-
- //public static final GTPP_Recipe_Map sMultiblockCentrifugeRecipes = new GT_Recipe_Map_LargeCentrifuge();
- //public static final GTPP_Recipe_Map sMultiblockElectrolyzerRecipes = new GT_Recipe_Map_LargeElectrolyzer();
- //public static final GTPP_Recipe_Map sAdvFreezerRecipes = new GT_Recipe_Map_AdvancedVacuumFreezer();
-
- public static final GTPP_Recipe_Map_Internal sAdvFreezerRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(2000), "gtpp.recipe.cryogenicfreezer", "Cryogenic Freezer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true);
- public static final GTPP_Recipe_Map_Internal sMultiblockCentrifugeRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multicentrifuge", "Multiblock Centrifuge", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true);
- public static final GTPP_Recipe_Map_Internal sMultiblockElectrolyzerRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multielectro", "Multiblock Electrolyzer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true);
- // internal copy of sChemicalPlantRecipes
- public static final GTPP_Recipe_Map_Internal sChemicalPlant_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.temp4", "temp4", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false);
- public static final GTPP_Recipe_Map_Internal sMultiblockMixerRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multimixer", "Multiblock Mixer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 12, 9, 0, 0, 1, "", 0, "", false, true);
-
- //Semi-Fluid Fuel Map
- public static final GT_Recipe_Map_Fuel sSemiFluidLiquidFuels = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gtpp.recipe.semifluidgeneratorfuels", "Semifluid Generator Fuels", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
-
- // Flotation Cell
- public static final GTPP_Recipe_Map_Internal sFlotationCellRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.flotationcell", "Flotation Cell", null, RES_PATH_GUI + "basicmachines/LFTR", 6, 4, 1, 1, 1, "", 1, E, true, true);
-
- // Tree Growth Simulator
- public static final GTPP_Recipe_Map_Internal sTreeSimFakeRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(100), "gtpp.recipe.treefarm", "Tree Growth Simulator", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 1, 0, 1, "", 1, "", false, true);
-
- }
-
- public static class GTPP_Recipe_Map_MultiNoCell extends GTPP_Recipe_Map_Internal {
-
- // region NEI stuff
- private static final HashMap<Integer, Pair<Integer, Integer>> mInputSlotMap = new HashMap<>();
- private static final HashMap<Integer, Pair<Integer, Integer>> mOutputSlotMap = new HashMap<>();
-
- static {
- int[] slotsX = new int[] {12, 30, 48};
- int[] slotsY = new int[] {5, 23, 41, 64};
- // Input slots
- int aIndex = 0;
- for (int slotY : slotsY) {
- for (int slotX : slotsX) {
- mInputSlotMap.put(aIndex++, new Pair<>(slotX, slotY));
- }
- }
- // Output slots
- slotsX = new int[] {102, 120, 138};
- aIndex = 0;
- for (int slotY : slotsY) {
- for (int slotX : slotsX) {
- mOutputSlotMap.put(aIndex++, new Pair<>(slotX, slotY));
- }
- }
- }
-
- // endregion NEI stuff
-
- public GTPP_Recipe_Map_MultiNoCell(Collection<GT_Recipe> 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 addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GTPP_Recipe_MultiNoCell(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- @Override
- public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GTPP_Recipe_MultiNoCell(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
- }
-
- @Override
- 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 GTPP_Recipe_MultiNoCell(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- @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 addFakeRecipe(aCheckForCollisions, new GTPP_Recipe_MultiNoCell(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- @Override
- 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 GTPP_Recipe_MultiNoCell(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- @Override
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue,boolean hidden) {
- return addFakeRecipe(aCheckForCollisions, new GTPP_Recipe_MultiNoCell(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue),hidden);
- }
-
- public static class GTPP_Recipe_MultiNoCell extends GT_Recipe {
-
- public GTPP_Recipe_MultiNoCell(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
- }
-
- @Override
- public ArrayList<PositionedStack> getInputPositionedStacks() {
- int aInputItemsCount = mInputs.length;
- int aInputFluidsCount = mFluidInputs.length;
- int aInputSlotsUsed = 0;
- int aSlotToCheck = 0;
-
- ArrayList<PositionedStack> inputStacks = new ArrayList<>(aInputItemsCount + aInputFluidsCount);
-
- // Special Slot
- if (mSpecialItems != null) {
- inputStacks.add(new FixedPositionedStack(mSpecialItems, 120, 52));
- }
- // Up to 9 Inputs Slots
- if (aInputItemsCount > 0) {
- if (aInputItemsCount > 9) {
- aInputItemsCount = 9;
- }
- for (int i=0;i<aInputItemsCount;i++) {
- int x = mInputSlotMap.get(aInputSlotsUsed).getKey();
- int y = mInputSlotMap.get(aInputSlotsUsed).getValue();
- ItemStack aRepStack = getRepresentativeInput(aSlotToCheck++);
- if (aRepStack != null) {
- inputStacks.add(new FixedPositionedStack(aRepStack, x, y));
- aInputSlotsUsed++;
- }
- }
- }
- // Up to 9 Fluid Inputs Slots
- aSlotToCheck = aInputSlotsUsed;
- if (aInputFluidsCount > 0) {
- for (int i=0;i<aInputFluidsCount;i++) {
- int x = mInputSlotMap.get(aSlotToCheck).getKey();
- int y = mInputSlotMap.get(aSlotToCheck).getValue();
- inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[i], true), x, y));
- aSlotToCheck++;
- aInputSlotsUsed++;
- }
- }
-
- return inputStacks;
- }
-
- @Override
- public ArrayList<PositionedStack> getOutputPositionedStacks() {
- int aOutputItemsCount = mOutputs.length;
- int aOutputFluidsCount = mFluidOutputs.length;
- int aOutputSlotsUsed = 0;
- int aSlotToCheck = 0;
-
- ArrayList<PositionedStack> outputStacks = new ArrayList<>(aOutputItemsCount + aOutputFluidsCount);
-
- // Up to 9 Output Slots
- if (aOutputItemsCount > 0) {
- if (aOutputItemsCount > 9) {
- aOutputItemsCount = 9;
- }
- for (int i=0;i<aOutputItemsCount;i++) {
- int x = mOutputSlotMap.get(aOutputSlotsUsed).getKey();
- int y = mOutputSlotMap.get(aOutputSlotsUsed).getValue();
- ItemStack aRepStack = getOutput(aSlotToCheck);
- if (aRepStack != null) {
- outputStacks.add(new FixedPositionedStack(aRepStack, x, y, getOutputChance(aSlotToCheck)));
- aOutputSlotsUsed++;
- }
- aSlotToCheck++;
- }
- }
- // Up to 9 Fluid Outputs Slots
- aSlotToCheck = aOutputSlotsUsed;
- if (aOutputFluidsCount > 0) {
- for (int i=0;i<aOutputFluidsCount;i++) {
- int x = mOutputSlotMap.get(aSlotToCheck).getKey();
- int y = mOutputSlotMap.get(aSlotToCheck).getValue();
- outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidOutputs[i], true), x, y));
- aSlotToCheck++;
- aOutputSlotsUsed++;
- }
- }
-
- return outputStacks;
- }
- }
- }
-
- public static class GTPP_Recipe_Map_ChemicalPlant extends GTPP_Recipe_Map_Internal {
-
- public GTPP_Recipe_Map_ChemicalPlant(Collection<GT_Recipe> 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 addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GTPP_Recipe_ChemicalPlant(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- @Override
- public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GTPP_Recipe_ChemicalPlant(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
- }
-
- @Override
- 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 GTPP_Recipe_ChemicalPlant(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- public static class GTPP_Recipe_ChemicalPlant extends GT_Recipe {
-
- public GTPP_Recipe_ChemicalPlant(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
- }
-
- @Override
- public ArrayList<PositionedStack> getInputPositionedStacks() {
- int tStartIndex = 0;
- ArrayList<PositionedStack> inputStacks = new ArrayList<>(mInputs.length + mFluidInputs.length);
-
- // Four Input Slots
- if (getRepresentativeInput(tStartIndex) != null) {
- inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 3, -4));
- }
- tStartIndex++;
- if (getRepresentativeInput(tStartIndex) != null) {
- inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 21, -4));
- }
- tStartIndex++;
- if (getRepresentativeInput(tStartIndex) != null) {
- inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 39, -4));
- }
- tStartIndex++;
- if (getRepresentativeInput(tStartIndex) != null) {
- inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 57, -4));
- }
- tStartIndex++;
-
- if (mSpecialItems != null) {
- inputStacks.add(new FixedPositionedStack(mSpecialItems, 120, 52));
- }
-
- //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.)
- if (mFluidInputs.length >= 1) {
- if ((mFluidInputs[0] != null) && (mFluidInputs[0].getFluid() != null)) {
- inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[0], true), 3, 31));
- }
- if ((mFluidInputs.length > 1) && (mFluidInputs[1] != null) && (mFluidInputs[1].getFluid() != null)) {
- inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[1], true), 21, 31));
- }
- if ((mFluidInputs.length > 2) && (mFluidInputs[2] != null) && (mFluidInputs[2].getFluid() != null)) {
- inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[2], true), 39, 31));
- }
- if ((mFluidInputs.length > 3) && (mFluidInputs[3] != null) && (mFluidInputs[3].getFluid() != null)) {
- inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[3], true), 57, 31));
- }
- }
-
- return inputStacks;
- }
-
- @Override
- public ArrayList<PositionedStack> getOutputPositionedStacks() {
- int tStartIndex = 0;
- ArrayList<PositionedStack> outputStacks = new ArrayList<>(mOutputs.length + mFluidOutputs.length);
-
- //Four Output Slots
- if (getOutput(tStartIndex) != null) {
- outputStacks.add(new FixedPositionedStack(getOutput(tStartIndex), 102, 5, getOutputChance(tStartIndex)));
- }
- tStartIndex++;
- if (getOutput(tStartIndex) != null) {
- outputStacks.add(new FixedPositionedStack(getOutput(tStartIndex), 120, 5, getOutputChance(tStartIndex)));
- }
- tStartIndex++;
- if (getOutput(tStartIndex) != null) {
- outputStacks.add(new FixedPositionedStack(getOutput(tStartIndex), 102, 23, getOutputChance(tStartIndex)));
- }
- tStartIndex++;
- if (getOutput(tStartIndex) != null) {
- outputStacks.add(new FixedPositionedStack(getOutput(tStartIndex), 120, 23, getOutputChance(tStartIndex)));
- }
- tStartIndex++;
-
- if (mFluidOutputs.length > 0) {
- if ((mFluidOutputs[0] != null) && (mFluidOutputs[0].getFluid() != null)) {
- outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidOutputs[0], true), 138, 5));
- }
- if ((mFluidOutputs.length > 1) && (mFluidOutputs[1] != null) && (mFluidOutputs[1].getFluid() != null)) {
- outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidOutputs[1], true), 138, 23));
- }
- }
-
- return outputStacks;
- }
- }
- }
+ private final String mRecipeHash;
+ private final AutoMap<Integer> mHashMap = new AutoMap<Integer>();
+
+ public GTPP_Recipe(
+ final boolean aOptimize,
+ final ItemStack[] aInputs,
+ final ItemStack[] aOutputs,
+ final Object aSpecialItems,
+ final int[] aChances,
+ final FluidStack[] aFluidInputs,
+ final FluidStack[] aFluidOutputs,
+ final int aDuration,
+ final int aEUt,
+ final int aSpecialValue) {
+ super(
+ aOptimize,
+ aInputs,
+ aOutputs,
+ aSpecialItems,
+ aChances,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue);
+ // Logger.SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for
+ // "+ItemUtils.getArrayStackNames(aInputs), 167);
+ this.mRecipeHash = getRecipeHash(this);
+ this.mHashMap.addAll(convertStringDataToInts(getEncodedRecipeData(this)));
+ }
+
+ public GTPP_Recipe(final ItemStack aInput1, final ItemStack aOutput1, final int aFuelValue, final int aType) {
+ this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
+ }
+
+ private static AutoMap<Integer> convertStringDataToInts(AutoMap<String> aData) {
+ AutoMap<Integer> aMap = new AutoMap<Integer>();
+ for (String string : aData) {
+ aMap.add(string.hashCode());
+ }
+ return aMap;
+ }
+
+ private static AutoMap<String> getEncodedRecipeData(GTPP_Recipe aRecipe) {
+ AutoMap<String> aData = new AutoMap<String>();
+ aData.add(aRecipe.mRecipeHash);
+ aData.add("" + aRecipe.mCanBeBuffered);
+ aData.add("" + aRecipe.mHidden);
+ aData.add("" + aRecipe.mEnabled);
+ aData.add("" + aRecipe.mDuration);
+ aData.add("" + aRecipe.mEUt);
+ aData.add("" + aRecipe.mFakeRecipe);
+ aData.add("" + aRecipe.mSpecialItems);
+ aData.add(aRecipe.mChances.toString());
+ aData.add(aRecipe.mInputs.toString());
+ aData.add(aRecipe.mOutputs.toString());
+ aData.add(aRecipe.mFluidInputs.toString());
+ aData.add(aRecipe.mFluidOutputs.toString());
+ return aData;
+ }
+
+ public static String getRecipeHash(GT_Recipe aRecipe) {
+ String aEncoderString = aRecipe.toString();
+ return aEncoderString;
+ }
+
+ private final void checkModified() {
+ if (hasBeenModified()) {
+ String[] aInfo = RecipeUtils.getRecipeInfo(this);
+ for (String s : aInfo) {
+ Logger.INFO(s);
+ }
+ CORE.crash(
+ "Someone has edited an internal GT++ recipe, which is no longer allowed. Please complain to whoever has done this, not Alkalus.");
+ }
+ }
+
+ private final boolean hasBeenModified() {
+ String aEncoderString = this.toString();
+ boolean aBasicHashCheck = this.mRecipeHash.equals(aEncoderString);
+ if (!aBasicHashCheck) {
+ Logger.INFO("This Recipe Hash: " + aEncoderString);
+ Logger.INFO("Expected Hash Code: " + this.mRecipeHash);
+ return true;
+ }
+ AutoMap<Integer> aData = new AutoMap<Integer>();
+ aData.addAll(convertStringDataToInts(getEncodedRecipeData(this)));
+ long aHashTotal = 0;
+ long aExpectedHashTotal = 0;
+ for (int a : aData) {
+ aHashTotal += a;
+ }
+ for (int a : this.mHashMap) {
+ aExpectedHashTotal += a;
+ }
+ if (aHashTotal != aExpectedHashTotal) {
+ Logger.INFO("This Recipe Hash: " + aEncoderString);
+ Logger.INFO("Expected Hash Code: " + this.mRecipeHash);
+ Logger.INFO("This Recipe Hash: " + aHashTotal);
+ Logger.INFO("Expected Hash Code: " + aExpectedHashTotal);
+ return true;
+ }
+ return false;
+ }
+
+ // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
+ public GTPP_Recipe(
+ final ItemStack aInput1,
+ final ItemStack aOutput1,
+ final ItemStack aOutput2,
+ final ItemStack aOutput3,
+ final ItemStack aOutput4,
+ final int aSpecialValue,
+ final int aType) {
+ this(
+ true,
+ new ItemStack[] {aInput1},
+ new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4},
+ null,
+ null,
+ null,
+ null,
+ 0,
+ 0,
+ Math.max(1, aSpecialValue));
+
+ Logger.WARNING("Switch case method for adding fuels");
+ if ((this.mInputs.length > 0) && (aSpecialValue > 0)) {
+ switch (aType) {
+ // Diesel Generator
+ case 0:
+ Logger.WARNING("Added fuel " + aInput1.getDisplayName() + " is ROCKET FUEL - continuing");
+ GTPP_Recipe_Map.sRocketFuels.addRecipe(this);
+ break;
+ // Gas Turbine
+ case 1:
+ GTPP_Recipe_Map.sGeoThermalFuels.addRecipe(this);
+ break;
+ // Thermal Generator
+ case 2:
+ GTPP_Recipe_Map.sRTGFuels.addRecipe(this);
+ break;
+ // Plasma Generator
+ case 4:
+ // Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this);
+ break;
+ // Magic Generator
+ case 5:
+ // Gregtech_Recipe_Map.sMagicFuels.addRecipe(this);
+ break;
+ // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
+ default:
+ // Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
+ break;
+ }
+ }
+ }
+
+ public static void reInit() {
+ GT_Log.out.println("GT_Mod: Re-Unificating Recipes.");
+ for (final GTPP_Recipe_Map_Internal tMapEntry : GTPP_Recipe_Map_Internal.sMappingsEx) {
+ // tMapEntry.reInit();
+ if (tMapEntry != null && tMapEntry.mRecipeList != null && !tMapEntry.mRecipeList.isEmpty()) {
+ for (GT_Recipe aRecipe : tMapEntry.mRecipeList) {
+ checkRecipeOwnership(aRecipe);
+ }
+ }
+ }
+ }
+
+ private static final boolean checkRecipeOwnership(GT_Recipe aRecipe) {
+ if (aRecipe != null && aRecipe instanceof GTPP_Recipe) {
+ GTPP_Recipe nRecipe = (GTPP_Recipe) aRecipe;
+ GTPP_Recipe_Map_Internal.mHashedRecipes.put(nRecipe.hashCode(), nRecipe);
+ return true;
+ }
+ return false;
+ }
+
+ public static final void checkRecipeModifications() {
+ for (GTPP_Recipe aRecipe : GTPP_Recipe_Map_Internal.mHashedRecipes.values()) {
+ Logger.INFO("Checking recipe: " + aRecipe.hashCode());
+ aRecipe.checkModified();
+ }
+ }
+
+ public static class GTPP_Recipe_Map_Internal extends GT_Recipe_Map {
+
+ public static final Collection<GTPP_Recipe_Map_Internal> sMappingsEx = new ArrayList<>();
+ private static final HashMap<Integer, GTPP_Recipe> mHashedRecipes = new HashMap<Integer, GTPP_Recipe>();
+
+ public GTPP_Recipe_Map_Internal(
+ Collection<GT_Recipe> 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);
+ GT_Recipe_Map.sMappings.remove(this);
+ GTPP_Recipe_Map_Internal.sMappingsEx.add(this);
+ }
+ }
+
+ public static class GTPP_Recipe_Map {
+ // public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200),
+ // "gtpp.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1,
+ // 1, E, 1, E, true, true);
+ public static final GTPP_Recipe_Map_Internal sCokeOvenRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(200),
+ "gtpp.recipe.cokeoven",
+ "Coke Oven",
+ null,
+ RES_PATH_GUI + "basicmachines/Dehydrator",
+ 2,
+ 9,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+ public static final GTPP_Recipe_Map_Internal sMatterFab2Recipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(200),
+ "gtpp.recipe.matterfab2",
+ "Matter Fabricator",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 6,
+ 6,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+ // public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new
+ // HashSet<GregtechRecipe>(200), "gtpp.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI +
+ // "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true);
+
+ public static final GT_Recipe_Map_Fuel sRocketFuels = new GT_Recipe_Map_Fuel(
+ new HashSet<GT_Recipe>(10),
+ "gtpp.recipe.rocketenginefuel",
+ "Rocket Engine Fuel",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 3000,
+ " EU",
+ true,
+ true);
+
+ public static final GTPP_Recipe_Map_Internal sGeoThermalFuels = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(10),
+ "gtpp.recipe.geothermalfuel",
+ "GeoThermal Fuel",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true);
+ public static final GTPP_Recipe_Map_Internal sChemicalDehydratorRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(200),
+ "gtpp.recipe.chemicaldehydrator",
+ "Dehydrator",
+ null,
+ RES_PATH_GUI + "basicmachines/Dehydrator",
+ 2,
+ 9,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+ public static final GTPP_Recipe_Map_Internal sVacuumFurnaceRecipes = new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(500),
+ "gtpp.recipe.vacfurnace",
+ "Vacuum Furnace",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 6,
+ 6,
+ 1,
+ 0,
+ 1,
+ "Heat Capacity: ",
+ 1,
+ " K",
+ false,
+ true);
+ public static final GTPP_Recipe_Map_Internal sAlloyBlastSmelterRecipes = new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(200),
+ "gtpp.recipe.alloyblastsmelter",
+ "Alloy Blast Smelter",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 9,
+ 9,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+ public static final GTPP_Recipe_Map_Internal sSteamTurbineFuels = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(10),
+ "gtpp.recipe.steamturbinefuel",
+ "GeoThermal Fuel",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ false);
+
+ // LFTR recipes
+ public static final GTPP_Recipe_Map_Internal sLiquidFluorineThoriumReactorRecipes =
+ new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(50),
+ "gtpp.recipe.lftr",
+ "Liquid Fluoride Thorium Reactor",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 0,
+ 0,
+ 0,
+ 2,
+ 0,
+ "Power: ",
+ 1,
+ " EU/t per Dynamo",
+ true,
+ true);
+
+ // Ore Milling Map
+ public static final GTPP_Recipe_Map_Internal sOreMillRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(10000),
+ "gtpp.recipe.oremill",
+ "Milling",
+ null,
+ RES_PATH_GUI + "basicmachines/LFTR",
+ 3,
+ 4,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+
+ // Fission Fuel Plant Recipes
+ public static final GTPP_Recipe_Map_Internal sFissionFuelProcessing = new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(50),
+ "gtpp.recipe.fissionfuel",
+ "Nuclear Fuel Processing",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+
+ // Cold Trap
+ public static final GTPP_Recipe_Map_Internal sColdTrapRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(10000),
+ "gtpp.recipe.coldtrap",
+ "Cold Trap",
+ null,
+ RES_PATH_GUI + "basicmachines/Dehydrator",
+ 2,
+ 9,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+
+ // Reactor Processing Unit
+ public static final GTPP_Recipe_Map_Internal sReactorProcessingUnitRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(10000),
+ "gtpp.recipe.reactorprocessingunit",
+ "Reactor Processing Unit",
+ null,
+ RES_PATH_GUI + "basicmachines/Dehydrator",
+ 2,
+ 9,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+
+ // Basic Washer Map
+ public static final GTPP_Recipe_Map_Internal sSimpleWasherRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(3),
+ "gtpp.recipe.simplewasher",
+ "Simple Dust Washer",
+ null,
+ RES_PATH_GUI + "basicmachines/PotionBrewer",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+
+ // Molecular Transformer Map
+ public static final GTPP_Recipe_Map_Internal sMolecularTransformerRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(3),
+ "gtpp.recipe.moleculartransformer",
+ "Molecular Transformer",
+ null,
+ RES_PATH_GUI + "basicmachines/Scanner",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+
+ // Elemental Duplicator Map
+ public static final GTPP_Recipe_Map_Internal sElementalDuplicatorRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(3),
+ "gtpp.recipe.elementaldupe",
+ "Elemental Duplicator",
+ null,
+ RES_PATH_GUI + "basicmachines/Replicator",
+ 1,
+ 1,
+ 0,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ false);
+
+ // public static final GT_Recipe_Map sSimpleWasherRecipes_FakeFuckBW = new GT_Recipe_Map(new
+ // HashSet<GT_Recipe>(3), "gtpp.recipe.simplewasher", "Fuck you Bart", null, RES_PATH_GUI +
+ // "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, false);
+
+ public static final GTPP_Recipe_Map_Internal sChemicalPlantRecipes = new GTPP_Recipe_Map_ChemicalPlant(
+ new HashSet<GT_Recipe>(100),
+ "gtpp.recipe.fluidchemicaleactor",
+ "Chemical Plant",
+ null,
+ CORE.MODID + ":textures/gui/FluidReactor",
+ 0,
+ 0,
+ 0,
+ 2,
+ 1,
+ "Tier: ",
+ 1,
+ E,
+ true,
+ true);
+
+ // RTG Fuel Map
+ public static final GT_Recipe.GT_Recipe_Map_Fuel sRTGFuels = new GTPP_Recipe.GT_Recipe_Map_Fuel(
+ new HashSet<GT_Recipe>(10),
+ "gtpp.recipe.RTGgenerators",
+ "RTG",
+ null,
+ "gregtech:textures/gui/basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 365,
+ " Minecraft Days",
+ true,
+ true);
+
+ // Thermal Boiler map
+ public static final GTPP_Recipe_Map_Internal sThermalFuels = new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(10),
+ "gtpp.recipe.thermalgeneratorfuel",
+ "Thermal Generator Fuel",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ null,
+ 1000,
+ null,
+ true,
+ true);
+
+ // Solar Tower map
+ public static final GTPP_Recipe_Map_Internal sSolarTowerRecipes = new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(10),
+ "gtpp.recipe.solartower",
+ "Solar Tower",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ null,
+ 1000,
+ null,
+ true,
+ true);
+
+ // Cyclotron recipe map
+ public static final GTPP_Recipe_Map_Internal sCyclotronRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(200),
+ "gtpp.recipe.cyclotron",
+ "COMET - Compact Cyclotron",
+ null,
+ RES_PATH_GUI + "basicmachines/BlastSmelter",
+ 2,
+ 16,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+
+ // Advanced Mixer
+ public static final GTPP_Recipe_Map_Internal sAdvancedMixerRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(1000),
+ "gtpp.recipe.advanced.mixer",
+ "Advanced Material Combiner",
+ null,
+ "gregtech:textures/gui/basicmachines/MixerAdvanced",
+ 4,
+ 4,
+ 1,
+ 0,
+ 2,
+ "",
+ 1,
+ "",
+ true,
+ true);
+
+ // Mini Fusion
+ public static final GTPP_Recipe_Map_Internal sSlowFusionRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(50),
+ "gtpp.recipe.slowfusionreactor",
+ "Mimir - Slow Fusion",
+ null,
+ "gregtech:textures/gui/basicmachines/LFTR",
+ 0,
+ 0,
+ 0,
+ 2,
+ 1,
+ "Start: ",
+ 1,
+ " EU",
+ true,
+ true);
+
+ // Component Assembler
+ public static final GT_Recipe_Map sComponentAssemblerRecipes = new GT_Recipe_Map_Assembler(
+ new HashSet<GT_Recipe>(300),
+ "gtpp.recipe.componentassembler",
+ "Component Assembler",
+ null,
+ RES_PATH_GUI + "basicmachines/Assembler",
+ 6,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true);
+
+ // Special Maps for Multis
+ public static final GTPP_Recipe_Map_Internal sFishPondRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(3),
+ "gtpp.recipe.fishpond",
+ "Zhuhai - Fishing Port",
+ null,
+ RES_PATH_GUI + "basicmachines/PotionBrewer",
+ 0,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Requires Circuit: ",
+ 1,
+ ".",
+ true,
+ true);
+ public static final GTPP_Recipe_Map_Internal sSpargeTowerRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(10000),
+ "gtpp.recipe.spargetower",
+ "Sparging",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 9,
+ 9,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ false);
+
+ // public static final GTPP_Recipe_Map sMultiblockCentrifugeRecipes = new GT_Recipe_Map_LargeCentrifuge();
+ // public static final GTPP_Recipe_Map sMultiblockElectrolyzerRecipes = new GT_Recipe_Map_LargeElectrolyzer();
+ // public static final GTPP_Recipe_Map sAdvFreezerRecipes = new GT_Recipe_Map_AdvancedVacuumFreezer();
+
+ public static final GTPP_Recipe_Map_Internal sAdvFreezerRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(2000),
+ "gtpp.recipe.cryogenicfreezer",
+ "Cryogenic Freezer",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 9,
+ 9,
+ 0,
+ 0,
+ 1,
+ "",
+ 0,
+ "",
+ false,
+ true);
+ public static final GTPP_Recipe_Map_Internal sMultiblockCentrifugeRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(2000),
+ "gtpp.recipe.multicentrifuge",
+ "Multiblock Centrifuge",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 9,
+ 9,
+ 0,
+ 0,
+ 1,
+ "",
+ 0,
+ "",
+ false,
+ true);
+ public static final GTPP_Recipe_Map_Internal sMultiblockElectrolyzerRecipes_GT =
+ new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(2000),
+ "gtpp.recipe.multielectro",
+ "Multiblock Electrolyzer",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 9,
+ 9,
+ 0,
+ 0,
+ 1,
+ "",
+ 0,
+ "",
+ false,
+ true);
+ // internal copy of sChemicalPlantRecipes
+ public static final GTPP_Recipe_Map_Internal sChemicalPlant_GT = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(2000),
+ "gtpp.recipe.temp4",
+ "temp4",
+ null,
+ RES_PATH_GUI + "basicmachines/PotionBrewer",
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ "",
+ 0,
+ "",
+ false,
+ false);
+ public static final GTPP_Recipe_Map_Internal sMultiblockMixerRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(2000),
+ "gtpp.recipe.multimixer",
+ "Multiblock Mixer",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 12,
+ 9,
+ 0,
+ 0,
+ 1,
+ "",
+ 0,
+ "",
+ false,
+ true);
+
+ // Semi-Fluid Fuel Map
+ public static final GT_Recipe_Map_Fuel sSemiFluidLiquidFuels = new GT_Recipe_Map_Fuel(
+ new HashSet<GT_Recipe>(10),
+ "gtpp.recipe.semifluidgeneratorfuels",
+ "Semifluid Generator Fuels",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true);
+
+ // Flotation Cell
+ public static final GTPP_Recipe_Map_Internal sFlotationCellRecipes = new GTPP_Recipe_Map_Internal(
+ new HashSet<GT_Recipe>(10000),
+ "gtpp.recipe.flotationcell",
+ "Flotation Cell",
+ null,
+ RES_PATH_GUI + "basicmachines/LFTR",
+ 6,
+ 4,
+ 1,
+ 1,
+ 1,
+ "",
+ 1,
+ E,
+ true,
+ true);
+
+ // Tree Growth Simulator
+ public static final GTPP_Recipe_Map_Internal sTreeSimFakeRecipes = new GTPP_Recipe_Map_MultiNoCell(
+ new HashSet<GT_Recipe>(100),
+ "gtpp.recipe.treefarm",
+ "Tree Growth Simulator",
+ null,
+ RES_PATH_GUI + "basicmachines/FissionFuel",
+ 9,
+ 9,
+ 1,
+ 0,
+ 1,
+ "",
+ 1,
+ "",
+ false,
+ true);
+ }
+
+ public static class GTPP_Recipe_Map_MultiNoCell extends GTPP_Recipe_Map_Internal {
+
+ // region NEI stuff
+ private static final HashMap<Integer, Pair<Integer, Integer>> mInputSlotMap = new HashMap<>();
+ private static final HashMap<Integer, Pair<Integer, Integer>> mOutputSlotMap = new HashMap<>();
+
+ static {
+ int[] slotsX = new int[] {12, 30, 48};
+ int[] slotsY = new int[] {5, 23, 41, 64};
+ // Input slots
+ int aIndex = 0;
+ for (int slotY : slotsY) {
+ for (int slotX : slotsX) {
+ mInputSlotMap.put(aIndex++, new Pair<>(slotX, slotY));
+ }
+ }
+ // Output slots
+ slotsX = new int[] {102, 120, 138};
+ aIndex = 0;
+ for (int slotY : slotsY) {
+ for (int slotX : slotsX) {
+ mOutputSlotMap.put(aIndex++, new Pair<>(slotX, slotY));
+ }
+ }
+ }
+
+ // endregion NEI stuff
+
+ public GTPP_Recipe_Map_MultiNoCell(
+ Collection<GT_Recipe> 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 addRecipe(
+ boolean aOptimize,
+ ItemStack[] aInputs,
+ ItemStack[] aOutputs,
+ Object aSpecial,
+ int[] aOutputChances,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ return addRecipe(new GTPP_Recipe_MultiNoCell(
+ aOptimize,
+ aInputs,
+ aOutputs,
+ aSpecial,
+ aOutputChances,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue));
+ }
+
+ @Override
+ public GT_Recipe addRecipe(
+ int[] aOutputChances,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ return addRecipe(
+ new GTPP_Recipe_MultiNoCell(
+ false,
+ null,
+ null,
+ null,
+ aOutputChances,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue),
+ false,
+ false,
+ false);
+ }
+
+ @Override
+ 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 GTPP_Recipe_MultiNoCell(
+ aOptimize,
+ aInputs,
+ aOutputs,
+ aSpecial,
+ null,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue));
+ }
+
+ @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 addFakeRecipe(
+ aCheckForCollisions,
+ new GTPP_Recipe_MultiNoCell(
+ false,
+ aInputs,
+ aOutputs,
+ aSpecial,
+ aOutputChances,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue));
+ }
+
+ @Override
+ 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 GTPP_Recipe_MultiNoCell(
+ false,
+ aInputs,
+ aOutputs,
+ aSpecial,
+ null,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue));
+ }
+
+ @Override
+ public GT_Recipe addFakeRecipe(
+ boolean aCheckForCollisions,
+ ItemStack[] aInputs,
+ ItemStack[] aOutputs,
+ Object aSpecial,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue,
+ boolean hidden) {
+ return addFakeRecipe(
+ aCheckForCollisions,
+ new GTPP_Recipe_MultiNoCell(
+ false,
+ aInputs,
+ aOutputs,
+ aSpecial,
+ null,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue),
+ hidden);
+ }
+
+ public static class GTPP_Recipe_MultiNoCell extends GT_Recipe {
+
+ public GTPP_Recipe_MultiNoCell(
+ boolean aOptimize,
+ ItemStack[] aInputs,
+ ItemStack[] aOutputs,
+ Object aSpecialItems,
+ int[] aChances,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ super(
+ aOptimize,
+ aInputs,
+ aOutputs,
+ aSpecialItems,
+ aChances,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue);
+ }
+
+ @Override
+ public ArrayList<PositionedStack> getInputPositionedStacks() {
+ int aInputItemsCount = mInputs.length;
+ int aInputFluidsCount = mFluidInputs.length;
+ int aInputSlotsUsed = 0;
+ int aSlotToCheck = 0;
+
+ ArrayList<PositionedStack> inputStacks = new ArrayList<>(aInputItemsCount + aInputFluidsCount);
+
+ // Special Slot
+ if (mSpecialItems != null) {
+ inputStacks.add(new FixedPositionedStack(mSpecialItems, 120, 52));
+ }
+ // Up to 9 Inputs Slots
+ if (aInputItemsCount > 0) {
+ if (aInputItemsCount > 9) {
+ aInputItemsCount = 9;
+ }
+ for (int i = 0; i < aInputItemsCount; i++) {
+ int x = mInputSlotMap.get(aInputSlotsUsed).getKey();
+ int y = mInputSlotMap.get(aInputSlotsUsed).getValue();
+ ItemStack aRepStack = getRepresentativeInput(aSlotToCheck++);
+ if (aRepStack != null) {
+ inputStacks.add(new FixedPositionedStack(aRepStack, x, y));
+ aInputSlotsUsed++;
+ }
+ }
+ }
+ // Up to 9 Fluid Inputs Slots
+ aSlotToCheck = aInputSlotsUsed;
+ if (aInputFluidsCount > 0) {
+ for (int i = 0; i < aInputFluidsCount; i++) {
+ int x = mInputSlotMap.get(aSlotToCheck).getKey();
+ int y = mInputSlotMap.get(aSlotToCheck).getValue();
+ inputStacks.add(
+ new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[i], true), x, y));
+ aSlotToCheck++;
+ aInputSlotsUsed++;
+ }
+ }
+
+ return inputStacks;
+ }
+
+ @Override
+ public ArrayList<PositionedStack> getOutputPositionedStacks() {
+ int aOutputItemsCount = mOutputs.length;
+ int aOutputFluidsCount = mFluidOutputs.length;
+ int aOutputSlotsUsed = 0;
+ int aSlotToCheck = 0;
+
+ ArrayList<PositionedStack> outputStacks = new ArrayList<>(aOutputItemsCount + aOutputFluidsCount);
+
+ // Up to 9 Output Slots
+ if (aOutputItemsCount > 0) {
+ if (aOutputItemsCount > 9) {
+ aOutputItemsCount = 9;
+ }
+ for (int i = 0; i < aOutputItemsCount; i++) {
+ int x = mOutputSlotMap.get(aOutputSlotsUsed).getKey();
+ int y = mOutputSlotMap.get(aOutputSlotsUsed).getValue();
+ ItemStack aRepStack = getOutput(aSlotToCheck);
+ if (aRepStack != null) {
+ outputStacks.add(new FixedPositionedStack(aRepStack, x, y, getOutputChance(aSlotToCheck)));
+ aOutputSlotsUsed++;
+ }
+ aSlotToCheck++;
+ }
+ }
+ // Up to 9 Fluid Outputs Slots
+ aSlotToCheck = aOutputSlotsUsed;
+ if (aOutputFluidsCount > 0) {
+ for (int i = 0; i < aOutputFluidsCount; i++) {
+ int x = mOutputSlotMap.get(aSlotToCheck).getKey();
+ int y = mOutputSlotMap.get(aSlotToCheck).getValue();
+ outputStacks.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(mFluidOutputs[i], true), x, y));
+ aSlotToCheck++;
+ aOutputSlotsUsed++;
+ }
+ }
+
+ return outputStacks;
+ }
+ }
+ }
+
+ public static class GTPP_Recipe_Map_ChemicalPlant extends GTPP_Recipe_Map_Internal {
+
+ public GTPP_Recipe_Map_ChemicalPlant(
+ Collection<GT_Recipe> 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 addRecipe(
+ boolean aOptimize,
+ ItemStack[] aInputs,
+ ItemStack[] aOutputs,
+ Object aSpecial,
+ int[] aOutputChances,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ return addRecipe(new GTPP_Recipe_ChemicalPlant(
+ aOptimize,
+ aInputs,
+ aOutputs,
+ aSpecial,
+ aOutputChances,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue));
+ }
+
+ @Override
+ public GT_Recipe addRecipe(
+ int[] aOutputChances,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ return addRecipe(
+ new GTPP_Recipe_ChemicalPlant(
+ false,
+ null,
+ null,
+ null,
+ aOutputChances,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue),
+ false,
+ false,
+ false);
+ }
+
+ @Override
+ 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 GTPP_Recipe_ChemicalPlant(
+ aOptimize,
+ aInputs,
+ aOutputs,
+ aSpecial,
+ null,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue));
+ }
+
+ public static class GTPP_Recipe_ChemicalPlant extends GT_Recipe {
+
+ public GTPP_Recipe_ChemicalPlant(
+ boolean aOptimize,
+ ItemStack[] aInputs,
+ ItemStack[] aOutputs,
+ Object aSpecialItems,
+ int[] aChances,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ super(
+ aOptimize,
+ aInputs,
+ aOutputs,
+ aSpecialItems,
+ aChances,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue);
+ }
+
+ @Override
+ public ArrayList<PositionedStack> getInputPositionedStacks() {
+ int tStartIndex = 0;
+ ArrayList<PositionedStack> inputStacks = new ArrayList<>(mInputs.length + mFluidInputs.length);
+
+ // Four Input Slots
+ if (getRepresentativeInput(tStartIndex) != null) {
+ inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 3, -4));
+ }
+ tStartIndex++;
+ if (getRepresentativeInput(tStartIndex) != null) {
+ inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 21, -4));
+ }
+ tStartIndex++;
+ if (getRepresentativeInput(tStartIndex) != null) {
+ inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 39, -4));
+ }
+ tStartIndex++;
+ if (getRepresentativeInput(tStartIndex) != null) {
+ inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 57, -4));
+ }
+ tStartIndex++;
+
+ if (mSpecialItems != null) {
+ inputStacks.add(new FixedPositionedStack(mSpecialItems, 120, 52));
+ }
+
+ // New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for
+ // outputs an the code above for 9 input slots.)
+ if (mFluidInputs.length >= 1) {
+ if ((mFluidInputs[0] != null) && (mFluidInputs[0].getFluid() != null)) {
+ inputStacks.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(mFluidInputs[0], true), 3, 31));
+ }
+ if ((mFluidInputs.length > 1)
+ && (mFluidInputs[1] != null)
+ && (mFluidInputs[1].getFluid() != null)) {
+ inputStacks.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(mFluidInputs[1], true), 21, 31));
+ }
+ if ((mFluidInputs.length > 2)
+ && (mFluidInputs[2] != null)
+ && (mFluidInputs[2].getFluid() != null)) {
+ inputStacks.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(mFluidInputs[2], true), 39, 31));
+ }
+ if ((mFluidInputs.length > 3)
+ && (mFluidInputs[3] != null)
+ && (mFluidInputs[3].getFluid() != null)) {
+ inputStacks.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(mFluidInputs[3], true), 57, 31));
+ }
+ }
+
+ return inputStacks;
+ }
+
+ @Override
+ public ArrayList<PositionedStack> getOutputPositionedStacks() {
+ int tStartIndex = 0;
+ ArrayList<PositionedStack> outputStacks = new ArrayList<>(mOutputs.length + mFluidOutputs.length);
+
+ // Four Output Slots
+ if (getOutput(tStartIndex) != null) {
+ outputStacks.add(
+ new FixedPositionedStack(getOutput(tStartIndex), 102, 5, getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+ if (getOutput(tStartIndex) != null) {
+ outputStacks.add(
+ new FixedPositionedStack(getOutput(tStartIndex), 120, 5, getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+ if (getOutput(tStartIndex) != null) {
+ outputStacks.add(
+ new FixedPositionedStack(getOutput(tStartIndex), 102, 23, getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+ if (getOutput(tStartIndex) != null) {
+ outputStacks.add(
+ new FixedPositionedStack(getOutput(tStartIndex), 120, 23, getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+
+ if (mFluidOutputs.length > 0) {
+ if ((mFluidOutputs[0] != null) && (mFluidOutputs[0].getFluid() != null)) {
+ outputStacks.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(mFluidOutputs[0], true), 138, 5));
+ }
+ if ((mFluidOutputs.length > 1)
+ && (mFluidOutputs[1] != null)
+ && (mFluidOutputs[1].getFluid() != null)) {
+ outputStacks.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(mFluidOutputs[1], true), 138, 23));
+ }
+ }
+
+ return outputStacks;
+ }
+ }
+ }
}
diff --git a/src/main/java/gregtech/api/util/GasSpargingRecipe.java b/src/main/java/gregtech/api/util/GasSpargingRecipe.java
index 493c31dc65..531ea600b6 100644
--- a/src/main/java/gregtech/api/util/GasSpargingRecipe.java
+++ b/src/main/java/gregtech/api/util/GasSpargingRecipe.java
@@ -8,92 +8,99 @@ import net.minecraftforge.fluids.FluidStack;
public class GasSpargingRecipe implements Comparable<GasSpargingRecipe> {
- public final FluidStack mInputGas;
- public final FluidStack mInputSpentFuel;
- public final FluidStack mOutputSpargedFuel;
- public final int[] mMaxOutputQuantity;
- public final FluidStack[] mFluidInputs;
- public final FluidStack[] mFluidOutputs;
- public final int mDuration;
- public final int mEUt;
+ public final FluidStack mInputGas;
+ public final FluidStack mInputSpentFuel;
+ public final FluidStack mOutputSpargedFuel;
+ public final int[] mMaxOutputQuantity;
+ public final FluidStack[] mFluidInputs;
+ public final FluidStack[] mFluidOutputs;
+ public final int mDuration;
+ public final int mEUt;
- public GasSpargingRecipe(FluidStack aSpargeGas, FluidStack aSpentFuel, FluidStack aSpargedFuel, FluidStack[] aOutputs, int[] aMaxOutputQuantity) {
- mInputGas = aSpargeGas;
- mInputSpentFuel = aSpentFuel;
- mOutputSpargedFuel = aSpargedFuel;
- mFluidInputs = new FluidStack[] {mInputGas, mInputSpentFuel};
- aOutputs = ArrayUtils.insertElementAtIndex(aOutputs, 0, aSpargeGas);
- aOutputs = ArrayUtils.insertElementAtIndex(aOutputs, 1, aSpargedFuel);
- mFluidOutputs = aOutputs;
- mMaxOutputQuantity = aMaxOutputQuantity;
- mDuration = 20 * 60 * 5;
- mEUt = MaterialUtils.getVoltageForTier(3);
- }
+ public GasSpargingRecipe(
+ FluidStack aSpargeGas,
+ FluidStack aSpentFuel,
+ FluidStack aSpargedFuel,
+ FluidStack[] aOutputs,
+ int[] aMaxOutputQuantity) {
+ mInputGas = aSpargeGas;
+ mInputSpentFuel = aSpentFuel;
+ mOutputSpargedFuel = aSpargedFuel;
+ mFluidInputs = new FluidStack[] {mInputGas, mInputSpentFuel};
+ aOutputs = ArrayUtils.insertElementAtIndex(aOutputs, 0, aSpargeGas);
+ aOutputs = ArrayUtils.insertElementAtIndex(aOutputs, 1, aSpargedFuel);
+ mFluidOutputs = aOutputs;
+ mMaxOutputQuantity = aMaxOutputQuantity;
+ mDuration = 20 * 60 * 5;
+ mEUt = MaterialUtils.getVoltageForTier(3);
+ }
- @Override
- public boolean equals(Object o) {
- if (o instanceof GasSpargingRecipe) {
- GasSpargingRecipe i = (GasSpargingRecipe) o;
- if (this.mInputGas.equals(i.mInputGas) && this.mInputSpentFuel.equals(i.mInputSpentFuel)) {
- return true;
- }
- }
- return false;
- }
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof GasSpargingRecipe) {
+ GasSpargingRecipe i = (GasSpargingRecipe) o;
+ if (this.mInputGas.equals(i.mInputGas) && this.mInputSpentFuel.equals(i.mInputSpentFuel)) {
+ return true;
+ }
+ }
+ return false;
+ }
- public int getMaxOutput(int aIndex) {
- if (aIndex == 0) {
- return mInputGas.amount * 100;
- }
- else if (aIndex == 1) {
- return mOutputSpargedFuel.amount * 100;
- }
- aIndex -= 2;
- if ((aIndex < 0) || (aIndex >= this.mMaxOutputQuantity.length)) {
- return 10000;
- }
- return this.mMaxOutputQuantity[aIndex];
- }
+ public int getMaxOutput(int aIndex) {
+ if (aIndex == 0) {
+ return mInputGas.amount * 100;
+ } else if (aIndex == 1) {
+ return mOutputSpargedFuel.amount * 100;
+ }
+ aIndex -= 2;
+ if ((aIndex < 0) || (aIndex >= this.mMaxOutputQuantity.length)) {
+ return 10000;
+ }
+ return this.mMaxOutputQuantity[aIndex];
+ }
- public boolean isValid() {
- if (mInputGas == null || mInputGas.amount <= 0 ||
- mInputSpentFuel == null || mInputSpentFuel.amount <= 0 ||
- mFluidOutputs == null || mFluidOutputs.length < 1 ||
- mMaxOutputQuantity == null || mMaxOutputQuantity.length < 1 ||
- mFluidOutputs.length != mMaxOutputQuantity.length) {
- return false;
- }
- return true;
- }
-
- public boolean containsInputs(FluidStack aSpargeGas, FluidStack aSpentFuel) {
- if (aSpargeGas != null && aSpargeGas.getFluid().equals(this.mInputGas.getFluid())) {
- if (aSpentFuel != null && aSpentFuel.getFluid().equals(this.mInputSpentFuel.getFluid())) {
- return true;
- }
- }
- return false;
- }
+ public boolean isValid() {
+ if (mInputGas == null
+ || mInputGas.amount <= 0
+ || mInputSpentFuel == null
+ || mInputSpentFuel.amount <= 0
+ || mFluidOutputs == null
+ || mFluidOutputs.length < 1
+ || mMaxOutputQuantity == null
+ || mMaxOutputQuantity.length < 1
+ || mFluidOutputs.length != mMaxOutputQuantity.length) {
+ return false;
+ }
+ return true;
+ }
- @Override
- public int compareTo(GasSpargingRecipe o) {
- if (o.mFluidOutputs.length > this.mFluidOutputs.length) {
- return 1;
- } else if (o.mFluidOutputs.length == this.mFluidOutputs.length) {
- return 0;
- } else {
- return -1;
- }
- }
-
- public String[] getRecipeInfo() {
- AutoMap<String> result = new AutoMap<String>();
- result.put("Input "+ItemUtils.getArrayStackNames(mFluidInputs));
- result.put("Output "+ItemUtils.getArrayStackNames(mFluidOutputs));
- result.put("Duration: "+mDuration);
- result.put("EU/t: "+mEUt);
- String s[] = result.toArray();
- return s;
- }
+ public boolean containsInputs(FluidStack aSpargeGas, FluidStack aSpentFuel) {
+ if (aSpargeGas != null && aSpargeGas.getFluid().equals(this.mInputGas.getFluid())) {
+ if (aSpentFuel != null && aSpentFuel.getFluid().equals(this.mInputSpentFuel.getFluid())) {
+ return true;
+ }
+ }
+ return false;
+ }
+ @Override
+ public int compareTo(GasSpargingRecipe o) {
+ if (o.mFluidOutputs.length > this.mFluidOutputs.length) {
+ return 1;
+ } else if (o.mFluidOutputs.length == this.mFluidOutputs.length) {
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+
+ public String[] getRecipeInfo() {
+ AutoMap<String> result = new AutoMap<String>();
+ result.put("Input " + ItemUtils.getArrayStackNames(mFluidInputs));
+ result.put("Output " + ItemUtils.getArrayStackNames(mFluidOutputs));
+ result.put("Duration: " + mDuration);
+ result.put("EU/t: " + mEUt);
+ String s[] = result.toArray();
+ return s;
+ }
}
diff --git a/src/main/java/gregtech/api/util/GasSpargingRecipeMap.java b/src/main/java/gregtech/api/util/GasSpargingRecipeMap.java
index 6e60cc7ac3..ec124ae422 100644
--- a/src/main/java/gregtech/api/util/GasSpargingRecipeMap.java
+++ b/src/main/java/gregtech/api/util/GasSpargingRecipeMap.java
@@ -5,44 +5,45 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
import gtPlusPlus.api.objects.data.AutoMap;
import net.minecraftforge.fluids.FluidStack;
-public class GasSpargingRecipeMap extends AutoMap<GasSpargingRecipe>{
-
- public static final AutoMap<GasSpargingRecipe> mRecipes = new AutoMap<GasSpargingRecipe>();
- public static final String mUnlocalizedName = "gtpp.recipe.lftr.sparging";
- public static final String mNEIName = mUnlocalizedName;
- public static final String mNEIDisplayName = "LFTR Gas Sparging";
- public static final String mNEIGUIPath = RES_PATH_GUI + "basicmachines/FissionFuel.png";
-
-
- public static boolean addRecipe(FluidStack aSpargeGas, FluidStack aSpentFuel, FluidStack aSpargedFuel, FluidStack[] aOutputs, int[] aMaxOutputs) {
- if (aSpargeGas == null || aSpargeGas.amount <= 0 ||
- aSpentFuel == null || aSpentFuel.amount <= 0 ||
- aSpargedFuel == null || aSpargedFuel.amount <= 0 ||
- aOutputs == null || aOutputs.length < 1 ||
- aMaxOutputs == null || aMaxOutputs.length < 1 ||
- aOutputs.length != aMaxOutputs.length) {
- return false;
- }
- int aMapSize = mRecipes.size();
- GasSpargingRecipe aRecipe = new GasSpargingRecipe(
- aSpargeGas,
- aSpentFuel,
- aSpargedFuel,
- aOutputs,
- aMaxOutputs
- );
- mRecipes.put(aRecipe);
- return mRecipes.size() > aMapSize;
- }
-
- public static GasSpargingRecipe findRecipe(FluidStack aSpargeGas, FluidStack aSpentFuel) {
- for (GasSpargingRecipe aRecipe : mRecipes) {
- if (aRecipe.containsInputs(aSpargeGas, aSpentFuel)) {
- return aRecipe;
- }
- }
- return null;
- }
+public class GasSpargingRecipeMap extends AutoMap<GasSpargingRecipe> {
+
+ public static final AutoMap<GasSpargingRecipe> mRecipes = new AutoMap<GasSpargingRecipe>();
+ public static final String mUnlocalizedName = "gtpp.recipe.lftr.sparging";
+ public static final String mNEIName = mUnlocalizedName;
+ public static final String mNEIDisplayName = "LFTR Gas Sparging";
+ public static final String mNEIGUIPath = RES_PATH_GUI + "basicmachines/FissionFuel.png";
+
+ public static boolean addRecipe(
+ FluidStack aSpargeGas,
+ FluidStack aSpentFuel,
+ FluidStack aSpargedFuel,
+ FluidStack[] aOutputs,
+ int[] aMaxOutputs) {
+ if (aSpargeGas == null
+ || aSpargeGas.amount <= 0
+ || aSpentFuel == null
+ || aSpentFuel.amount <= 0
+ || aSpargedFuel == null
+ || aSpargedFuel.amount <= 0
+ || aOutputs == null
+ || aOutputs.length < 1
+ || aMaxOutputs == null
+ || aMaxOutputs.length < 1
+ || aOutputs.length != aMaxOutputs.length) {
+ return false;
+ }
+ int aMapSize = mRecipes.size();
+ GasSpargingRecipe aRecipe = new GasSpargingRecipe(aSpargeGas, aSpentFuel, aSpargedFuel, aOutputs, aMaxOutputs);
+ mRecipes.put(aRecipe);
+ return mRecipes.size() > aMapSize;
+ }
+
+ public static GasSpargingRecipe findRecipe(FluidStack aSpargeGas, FluidStack aSpentFuel) {
+ for (GasSpargingRecipe aRecipe : mRecipes) {
+ if (aRecipe.containsInputs(aSpargeGas, aSpentFuel)) {
+ return aRecipe;
+ }
+ }
+ return null;
+ }
}
-
-
diff --git a/src/main/java/gregtech/api/util/HotFuel.java b/src/main/java/gregtech/api/util/HotFuel.java
index 511361f8ae..53ab85a455 100644
--- a/src/main/java/gregtech/api/util/HotFuel.java
+++ b/src/main/java/gregtech/api/util/HotFuel.java
@@ -1,40 +1,38 @@
package gregtech.api.util;
import net.minecraft.item.ItemStack;
-
import net.minecraftforge.fluids.FluidStack;
public class HotFuel {
- public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, ItemStack[] outputItems, int[] chances, int aSpecialValue) {
- GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe(
- true,
- null,
- outputItems,
- null,
- chances,
- new FluidStack[]{aInput1},
- new FluidStack[]{aOutput1},
- 1, //1 Tick
- 0, //No Eu produced
- aSpecialValue //Magic Number
- );
- }
-
- public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, FluidStack aOutput2, int aSpecialValue) {
- GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe(
- false,
- null,
- null,
- null,
- null,
- new FluidStack[]{aInput1},
- new FluidStack[]{aOutput1, aOutput2},
- 20, //1 Second
- 0, //No Eu produced
- aSpecialValue //Magic Number
- );
- }
-
-
+ public static void addNewHotFuel(
+ FluidStack aInput1, FluidStack aOutput1, ItemStack[] outputItems, int[] chances, int aSpecialValue) {
+ GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe(
+ true,
+ null,
+ outputItems,
+ null,
+ chances,
+ new FluidStack[] {aInput1},
+ new FluidStack[] {aOutput1},
+ 1, // 1 Tick
+ 0, // No Eu produced
+ aSpecialValue // Magic Number
+ );
+ }
+
+ public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, FluidStack aOutput2, int aSpecialValue) {
+ GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe(
+ false,
+ null,
+ null,
+ null,
+ null,
+ new FluidStack[] {aInput1},
+ new FluidStack[] {aOutput1, aOutput2},
+ 20, // 1 Second
+ 0, // No Eu produced
+ aSpecialValue // Magic Number
+ );
+ }
}
diff --git a/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java b/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java
index fa01ea9b5d..08a9dbf3af 100644
--- a/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java
+++ b/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java
@@ -2,116 +2,119 @@ package gregtech.api.util;
import static gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sSemiFluidLiquidFuels;
-import java.util.HashMap;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.util.minecraft.FluidUtils;
+import java.util.HashMap;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
public class SemiFluidFuelHandler {
-
- public static boolean addSemiFluidFuel(ItemStack aFuelItem, int aFuelValue) {
- FluidStack p = FluidContainerRegistry.getFluidForFilledItem(aFuelItem);
- if (p != null && aFuelValue > 0) {
- return addSemiFluidFuel(p, aFuelValue);
- } else {
- Logger.INFO("Fuel value for " + aFuelItem.getDisplayName() + " is <= 0, ignoring.");
- }
- return false;
- }
-
-
- public static boolean addSemiFluidFuel(FluidStack aFuel, int aFuelValue) {
- FluidStack p = aFuel;
- if (p != null && aFuelValue > 0) {
- GT_Recipe aRecipe =
- new GTPP_Recipe(true,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] { p },
- null,
- 0,
- 0,
- aFuelValue);
- if (aRecipe.mSpecialValue > 0) {
- Logger.INFO("Added " + aRecipe.mFluidInputs[0].getLocalizedName() + " to the Semi-Fluid Generator fuel map. Fuel Produces "+(aRecipe.mSpecialValue*1000)+"EU per 1000L.");
- sSemiFluidLiquidFuels.add(aRecipe);
- return true;
- }
- } else {
- Logger.INFO("Fuel value for " + p != null ? p.getLocalizedName() : "NULL Fluid" + " is <= 0, ignoring.");
- }
- return false;
- }
-
-
-
-
-
-
- public static boolean generateFuels() {
- final FluidStack aCreosote = FluidUtils.getFluidStack("creosote", 1000);
- final FluidStack aHeavyFuel = FluidUtils.getFluidStack("liquid_heavy_fuel", 1000);
- final FluidStack aHeavyOil = FluidUtils.getFluidStack("liquid_heavy_oil", 1000);
- final HashMap<Integer, Pair<FluidStack, Integer>> aFoundFluidsFromItems = new HashMap<Integer, Pair<FluidStack, Integer>>();
- // Find Fluids From items
- for (final GT_Recipe r : gregtech.api.util.GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList) {
-
- GT_Recipe g = r.copy();
-
-
- if (g != null && g.mEnabled && g.mInputs.length > 0 && g.mInputs[0] != null) {
- for (ItemStack i : g.mInputs) {
- FluidStack f = FluidContainerRegistry.getFluidForFilledItem(i);
- if (f != null) {
- Pair<FluidStack, Integer> aData = new Pair<FluidStack, Integer>(f, g.mSpecialValue);
- aFoundFluidsFromItems.put(aData.hashCode(), aData);
- }
- }
- } else if (g != null && g.mEnabled && g.mFluidInputs.length > 0 && g.mFluidInputs[0] != null) {
- boolean aContainsCreosote = false;
- for (FluidStack f : g.mFluidInputs) {
- if (f.isFluidEqual(aCreosote)) {
- aContainsCreosote = true;
- }
- }
- g.mSpecialValue *= aContainsCreosote ? 6 : 3;
- Logger.INFO("Added " + g.mFluidInputs[0].getLocalizedName() + " to the Semi-Fluid Generator fuel map. Fuel Produces "+g.mSpecialValue+"EU per 1000L.");
- sSemiFluidLiquidFuels.add(g);
- }
- }
- for (Pair<FluidStack, Integer> p : aFoundFluidsFromItems.values()) {
- if (p != null) {
- int aFuelValue = p.getValue();
- if (p.getKey().isFluidEqual(aCreosote)) {
- aFuelValue *= 6;
- }
- else if (p.getKey().isFluidEqual(aHeavyFuel) || p.getKey().isFluidEqual(aHeavyOil)){
- aFuelValue *= 1.5;
- }
- else {
- aFuelValue *= 2;
- }
+ public static boolean addSemiFluidFuel(ItemStack aFuelItem, int aFuelValue) {
+ FluidStack p = FluidContainerRegistry.getFluidForFilledItem(aFuelItem);
+ if (p != null && aFuelValue > 0) {
+ return addSemiFluidFuel(p, aFuelValue);
+ } else {
+ Logger.INFO("Fuel value for " + aFuelItem.getDisplayName() + " is <= 0, ignoring.");
+ }
+ return false;
+ }
+
+ public static boolean addSemiFluidFuel(FluidStack aFuel, int aFuelValue) {
+ FluidStack p = aFuel;
+ if (p != null && aFuelValue > 0) {
+ GT_Recipe aRecipe = new GTPP_Recipe(
+ true,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {p},
+ null,
+ 0,
+ 0,
+ aFuelValue);
+ if (aRecipe.mSpecialValue > 0) {
+ Logger.INFO("Added " + aRecipe.mFluidInputs[0].getLocalizedName()
+ + " to the Semi-Fluid Generator fuel map. Fuel Produces " + (aRecipe.mSpecialValue * 1000)
+ + "EU per 1000L.");
+ sSemiFluidLiquidFuels.add(aRecipe);
+ return true;
+ }
+ } else {
+ Logger.INFO("Fuel value for " + p != null ? p.getLocalizedName() : "NULL Fluid" + " is <= 0, ignoring.");
+ }
+ return false;
+ }
+
+ public static boolean generateFuels() {
+ final FluidStack aCreosote = FluidUtils.getFluidStack("creosote", 1000);
+ final FluidStack aHeavyFuel = FluidUtils.getFluidStack("liquid_heavy_fuel", 1000);
+ final FluidStack aHeavyOil = FluidUtils.getFluidStack("liquid_heavy_oil", 1000);
+ final HashMap<Integer, Pair<FluidStack, Integer>> aFoundFluidsFromItems =
+ new HashMap<Integer, Pair<FluidStack, Integer>>();
+ // Find Fluids From items
+ for (final GT_Recipe r : gregtech.api.util.GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList) {
+
+ GT_Recipe g = r.copy();
- if (aFuelValue <= (128*3)) {
- GT_Recipe aRecipe = new GTPP_Recipe(true, new ItemStack[] {}, new ItemStack[] {}, null, new int[] {},
- new FluidStack[] { p.getKey() }, null, 0, 0, aFuelValue);
- if (aRecipe.mSpecialValue > 0) {
- Logger.INFO("Added " + aRecipe.mFluidInputs[0].getLocalizedName() + " to the Semi-Fluid Generator fuel map. Fuel Produces "+(aRecipe.mSpecialValue*1000)+"EU per 1000L.");
- sSemiFluidLiquidFuels.add(aRecipe);
- }
- } else {
- Logger.INFO("Boosted Fuel value for " + p.getKey().getLocalizedName() + " exceeds 512k, ignoring.");
- }
- }
- }
- return sSemiFluidLiquidFuels.mRecipeList.size() > 0;
- }
+ if (g != null && g.mEnabled && g.mInputs.length > 0 && g.mInputs[0] != null) {
+ for (ItemStack i : g.mInputs) {
+ FluidStack f = FluidContainerRegistry.getFluidForFilledItem(i);
+ if (f != null) {
+ Pair<FluidStack, Integer> aData = new Pair<FluidStack, Integer>(f, g.mSpecialValue);
+ aFoundFluidsFromItems.put(aData.hashCode(), aData);
+ }
+ }
+ } else if (g != null && g.mEnabled && g.mFluidInputs.length > 0 && g.mFluidInputs[0] != null) {
+ boolean aContainsCreosote = false;
+ for (FluidStack f : g.mFluidInputs) {
+ if (f.isFluidEqual(aCreosote)) {
+ aContainsCreosote = true;
+ }
+ }
+ g.mSpecialValue *= aContainsCreosote ? 6 : 3;
+ Logger.INFO("Added " + g.mFluidInputs[0].getLocalizedName()
+ + " to the Semi-Fluid Generator fuel map. Fuel Produces " + g.mSpecialValue + "EU per 1000L.");
+ sSemiFluidLiquidFuels.add(g);
+ }
+ }
+ for (Pair<FluidStack, Integer> p : aFoundFluidsFromItems.values()) {
+ if (p != null) {
+ int aFuelValue = p.getValue();
+ if (p.getKey().isFluidEqual(aCreosote)) {
+ aFuelValue *= 6;
+ } else if (p.getKey().isFluidEqual(aHeavyFuel) || p.getKey().isFluidEqual(aHeavyOil)) {
+ aFuelValue *= 1.5;
+ } else {
+ aFuelValue *= 2;
+ }
+ if (aFuelValue <= (128 * 3)) {
+ GT_Recipe aRecipe = new GTPP_Recipe(
+ true,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {p.getKey()},
+ null,
+ 0,
+ 0,
+ aFuelValue);
+ if (aRecipe.mSpecialValue > 0) {
+ Logger.INFO("Added " + aRecipe.mFluidInputs[0].getLocalizedName()
+ + " to the Semi-Fluid Generator fuel map. Fuel Produces "
+ + (aRecipe.mSpecialValue * 1000) + "EU per 1000L.");
+ sSemiFluidLiquidFuels.add(aRecipe);
+ }
+ } else {
+ Logger.INFO("Boosted Fuel value for " + p.getKey().getLocalizedName() + " exceeds 512k, ignoring.");
+ }
+ }
+ }
+ return sSemiFluidLiquidFuels.mRecipeList.size() > 0;
+ }
}
diff --git a/src/main/java/gregtech/api/util/ThermalFuel.java b/src/main/java/gregtech/api/util/ThermalFuel.java
index d7b732ce5d..f5f882dafb 100644
--- a/src/main/java/gregtech/api/util/ThermalFuel.java
+++ b/src/main/java/gregtech/api/util/ThermalFuel.java
@@ -5,39 +5,36 @@ import net.minecraftforge.fluids.FluidStack;
public class ThermalFuel {
- public static void addThermalFuel(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int euValue, int aSpecialValue) {
- GTPP_Recipe x = new GTPP_Recipe(
- true,
- null,
- null,
- null,
- null,
- new FluidStack[]{aInput1, aInput2},
- new FluidStack[]{aOutput1},
- 20, //1 Tick
- euValue, //No Eu produced
- aSpecialValue //Magic Number
- );
- GTPP_Recipe.GTPP_Recipe_Map.sGeoThermalFuels.addRecipe(x);
- }
-
- public static void addSteamTurbineFuel(FluidStack aInput1) {
- GTPP_Recipe x = new GTPP_Recipe(
- true,
- null,
- null,
- null,
- null,
- new FluidStack[]{aInput1},
- null,
- 20, //1 Tick
- MathUtils.findPercentageOfInt((aInput1.amount/2), 95), //No Eu produced
- 0 //Magic Number
- );
- GTPP_Recipe.GTPP_Recipe_Map.sSteamTurbineFuels.addRecipe(x);
- }
-
-
-
-
+ public static void addThermalFuel(
+ FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int euValue, int aSpecialValue) {
+ GTPP_Recipe x = new GTPP_Recipe(
+ true,
+ null,
+ null,
+ null,
+ null,
+ new FluidStack[] {aInput1, aInput2},
+ new FluidStack[] {aOutput1},
+ 20, // 1 Tick
+ euValue, // No Eu produced
+ aSpecialValue // Magic Number
+ );
+ GTPP_Recipe.GTPP_Recipe_Map.sGeoThermalFuels.addRecipe(x);
+ }
+
+ public static void addSteamTurbineFuel(FluidStack aInput1) {
+ GTPP_Recipe x = new GTPP_Recipe(
+ true,
+ null,
+ null,
+ null,
+ null,
+ new FluidStack[] {aInput1},
+ null,
+ 20, // 1 Tick
+ MathUtils.findPercentageOfInt((aInput1.amount / 2), 95), // No Eu produced
+ 0 // Magic Number
+ );
+ GTPP_Recipe.GTPP_Recipe_Map.sSteamTurbineFuels.addRecipe(x);
+ }
}
diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java
index 48f8139c12..e3272e21ea 100644
--- a/src/main/java/gtPlusPlus/GTplusplus.java
+++ b/src/main/java/gtPlusPlus/GTplusplus.java
@@ -3,11 +3,6 @@ package gtPlusPlus;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableAnimatedTurbines;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustomCapes;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Collection;
-import java.util.HashMap;
-
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.SidedProxy;
@@ -53,537 +48,505 @@ import gtPlusPlus.xmod.gregtech.loaders.GT_Material_Loader;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelterGT_GTNH;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_MultisUsingFluidInsteadOfCells;
import gtPlusPlus.xmod.thaumcraft.commands.CommandDumpAspects;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Collection;
+import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.util.IIcon;
@MCVersion(value = "1.7.10")
-@Mod(modid = CORE.MODID, name = CORE.name, version = CORE.VERSION, dependencies = "required-after:Forge; after:TConstruct; after:PlayerAPI; after:dreamcraft; after:IC2; after:ihl; after:psychedelicraft; required-after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO; after:tectech; after:GTRedtech; after:beyondrealitycore; after:OpenBlocks; after:IC2NuclearControl; after:TGregworks; after:StevesCarts; after:xreliquary;")
+@Mod(
+ modid = CORE.MODID,
+ name = CORE.name,
+ version = CORE.VERSION,
+ dependencies =
+ "required-after:Forge; after:TConstruct; after:PlayerAPI; after:dreamcraft; after:IC2; after:ihl; after:psychedelicraft; required-after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO; after:tectech; after:GTRedtech; after:beyondrealitycore; after:OpenBlocks; after:IC2NuclearControl; after:TGregworks; after:StevesCarts; after:xreliquary;")
public class GTplusplus implements ActionListener {
- public static enum INIT_PHASE {
- SUPER(null), PRE_INIT(SUPER), INIT(PRE_INIT), POST_INIT(
- INIT
- ), SERVER_START(POST_INIT), STARTED(SERVER_START);
- protected boolean mIsPhaseActive = false;
- private final INIT_PHASE mPrev;
-
- private INIT_PHASE(INIT_PHASE aPreviousPhase) {
- mPrev = aPreviousPhase;
- }
-
- public synchronized final boolean isPhaseActive() {
- return mIsPhaseActive;
- }
- public synchronized final void setPhaseActive(boolean aIsPhaseActive) {
- if (mPrev != null && mPrev.isPhaseActive()) {
- mPrev.setPhaseActive(false);
- }
- mIsPhaseActive = aIsPhaseActive;
- if (CURRENT_LOAD_PHASE != this) {
- CURRENT_LOAD_PHASE = this;
- }
- }
- }
-
- public static INIT_PHASE CURRENT_LOAD_PHASE = INIT_PHASE.SUPER;
-
- // Mod Instance
- @Mod.Instance(CORE.MODID)
- public static GTplusplus instance;
-
- // Material Loader
- public static GT_Material_Loader mGregMatLoader;
-
- // GT_Proxy instance
- protected static Meta_GT_Proxy mGregProxy;
-
- // GT++ Proxy Instances
- @SidedProxy(clientSide = "gtPlusPlus.core.proxy.ClientProxy", serverSide = "gtPlusPlus.core.proxy.ServerProxy")
- public static CommonProxy proxy;
-
- // Loads Textures
- @SideOnly(value = Side.CLIENT)
- public static void loadTextures() {
- Logger.INFO("Loading some textures on the client.");
- // Tools
- Logger.WARNING(
- "Processing texture: "
- + TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile().getResourcePath()
- );
- Logger.WARNING(
- "Processing texture: "
- + TexturesGtTools.ANGLE_GRINDER.getTextureFile().getResourcePath()
- );
- Logger.WARNING(
- "Processing texture: "
- + TexturesGtTools.ELECTRIC_SNIPS.getTextureFile().getResourcePath()
- );
- Logger.WARNING(
- "Processing texture: "
- + TexturesGtTools.ELECTRIC_LIGHTER.getTextureFile().getResourcePath()
- );
- Logger.WARNING(
- "Processing texture: "
- + TexturesGtTools.ELECTRIC_BUTCHER_KNIFE.getTextureFile().getResourcePath()
- );
-
- // Blocks
- Logger.WARNING(
- "Processing texture: "
- + TexturesGtBlock.Casing_Machine_Dimensional.getTextureFile().getResourcePath()
- );
- }
-
- public GTplusplus() {
- super();
- INIT_PHASE.SUPER.setPhaseActive(true);
- }
-
- // Pre-Init
- @Mod.EventHandler
- public void preInit(final FMLPreInitializationEvent event) {
- INIT_PHASE.PRE_INIT.setPhaseActive(true);
- Logger.INFO(
- "Loading " + CORE.name + " " + CORE.VERSION + " on Gregtech "
- + Utils.getGregtechVersionAsString()
- );
- // Load all class objects within the plugin package.
- Core_Manager.veryEarlyInit();
- PacketHandler.init();
-
- if (!Utils.isServer()) {
- enableCustomCapes = true;
- }
-
- // Give this a go mate.
- // initAnalytics();
- setupMaterialBlacklist();
- // setupMaterialWhitelist();
-
- // Handle GT++ Config
- ConfigHandler.handleConfigFile(event);
-
- // Check for Dev
- CORE.DEVENV = (Boolean) Launch.blackboard.get(
- "fml.deobfuscatedEnvironment"
- );
- // Utils.LOG_INFO("User's Country: " + CORE.USER_COUNTRY);
-
- Utils.registerEvent(new LoginEventHandler());
- Utils.registerEvent(new MissingMappingsEvent());
- Utils.registerEvent(new MobMentality());
- Logger.INFO("Login Handler Initialized");
-
- proxy.preInit(event);
- Logger.INFO("Setting up our own GT_Proxy.");
- Meta_GT_Proxy.preInit();
- Core_Manager.preInit();
- GTPP_ChunkManager.init();
- }
-
- // Init
- @Mod.EventHandler
- public void init(final FMLInitializationEvent event) {
- INIT_PHASE.INIT.setPhaseActive(true);
- proxy.init(event);
- proxy.registerNetworkStuff();
- Meta_GT_Proxy.init();
- Core_Manager.init();
- NEI_IMC_Sender.IMCSender();
- // Used by foreign players to generate .lang files for translation.
- if (CORE.ConfigSwitches.dumpItemAndBlockData) {
- LocaleUtils.generateFakeLocaleFile();
- }
-
- }
-
- // Post-Init
- @Mod.EventHandler
- public void postInit(final FMLPostInitializationEvent event) {
- INIT_PHASE.POST_INIT.setPhaseActive(true);
- proxy.postInit(event);
- HazmatUtils.init();
- BookHandler.runLater();
- Meta_GT_Proxy.postInit();
- Core_Manager.postInit();
- // SprinklerHandler.registerModFerts();
-
- ItemGiantEgg.postInit(ModItems.itemBigEgg);
- BlockEventHandler.init();
- GTPP_Recipe.reInit();
-
- Logger.INFO(
- "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
- );
- Logger.INFO(
- "| Recipes succesfully Loaded: "
- + RegistrationHandler.recipesSuccess + " | Failed: "
- + RegistrationHandler.recipesFailed + " |"
- );
- Logger.INFO(
- "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
- );
- Logger.INFO(
- "Finally, we are finished. Have some cripsy bacon as a reward."
- );
-
- // Log free GT++ Meta IDs
- if (CORE.DEVENV) {
- // 750 - 999 are reserved for Alkalus.
- for (int i=750; i<1000;i++) {
- if (gregtech.api.GregTech_API.METATILEENTITIES[i] == null) {
- Logger.INFO("MetaID "+i+" is free.");
- }
- }
- // 30000 - 31999 are reserved for Alkalus.
- for (int i=30000; i<32000;i++) {
- if (gregtech.api.GregTech_API.METATILEENTITIES[i] == null) {
- Logger.INFO("MetaID "+i+" is free.");
- }
- }
- }
- }
-
- @EventHandler
- public synchronized void serverStarting(
- final FMLServerStartingEvent event
- ) {
- INIT_PHASE.SERVER_START.setPhaseActive(true);
- event.registerServerCommand(new CommandMath());
- event.registerServerCommand(new CommandEnableDebugWhileRunning());
- event.registerServerCommand(new CommandDebugChunks());
- if (LoadedMods.Thaumcraft) {
- event.registerServerCommand(new CommandDumpAspects());
- }
- Core_Manager.serverStart();
- INIT_PHASE.STARTED.setPhaseActive(true);
- }
-
- @Mod.EventHandler
- public synchronized void serverStopping(
- final FMLServerStoppingEvent event
- ) {
- Core_Manager.serverStop();
- }
-
- @Override
- public void actionPerformed(final ActionEvent arg0) {
-
- }
-
- /**
- * This {@link EventHandler} is called after the
- * {@link FMLPostInitializationEvent} stages of all loaded mods executes
- * successfully. {@link #onLoadComplete(FMLLoadCompleteEvent)} exists to
- * inject recipe generation after Gregtech and all other mods are entirely
- * loaded and initialized.
- *
- * @param event
- * - The {@link EventHandler} object passed through from FML to
- * {@link #GTplusplus()}'s {@link #instance}.
- */
- @Mod.EventHandler
- public void onLoadComplete(FMLLoadCompleteEvent event) {
- proxy.onLoadComplete(event);
- generateGregtechRecipeMaps();
- // Check our maps are untouched
- GTPP_Recipe.checkRecipeModifications();
- Logger.INFO("Passed verification checks.");
- }
-
- @Mod.EventHandler
- public void onIDChangingEvent(FMLModIdMappingEvent aEvent) {
- GTPP_Recipe.reInit();
- }
-
- public static void tryPatchTurbineTextures() {
- if (enableAnimatedTurbines) {
- BlockIcons h = Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE;
- BlockIcons h2 = Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE;
- try {
- Logger.INFO(
- "Trying to patch GT textures to make Turbines animated."
- );
- IIcon aIcon = TexturesGtBlock.Overlay_Machine_Turbine_Active.getIcon();
- if (ReflectionUtils.setField(h, "mIcon", aIcon)) {
- Logger.INFO("Patched Gas Turbine Icon.");
- }
- if (ReflectionUtils.setField(h2, "mIcon", aIcon)) {
- Logger.INFO("Patched Steam Turbine Icon.");
- }
- }
- catch (Throwable e) {
- e.printStackTrace();
- }
- }
- }
-
- protected void generateGregtechRecipeMaps() {
-
- int[] mValidCount = new int[]{
- 0, 0, 0
- };
- int[] mInvalidCount = new int[]{
- 0, 0, 0, 0
- };
- int[] mOriginalCount = new int[]{
- 0, 0, 0
- };
-
- RecipeGen_BlastSmelterGT_GTNH.generateGTNHBlastSmelterRecipesFromEBFList();
- FishPondFakeRecipe.generateFishPondRecipes();
- //GregtechMiniRaFusion.generateSlowFusionrecipes();
- SemiFluidFuelHandler.generateFuels();
- GregtechMTE_ChemicalPlant.generateRecipes();
-
- mInvalidCount[0] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells(
- GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes, GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT
- );
- mInvalidCount[1] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells(
- GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes, GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT
- );
- mInvalidCount[2] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells(
- GT_Recipe.GT_Recipe_Map.sVacuumRecipes, GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT
- );
- mInvalidCount[3] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells(
- GT_Recipe.GT_Recipe_Map.sMixerRecipes, GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT
- );
- /*
-
- //Large Centrifuge generation
- mOriginalCount[0] = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size();
- for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList) {
- if (x != null) {
- if (ItemUtils.checkForInvalidItems(x.mInputs, x.mOutputs)) {
- if (CORE.RA.addMultiblockCentrifugeRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue)) {
- mValidCount[0]++;
- }
- else {
- mInvalidCount[0]++;
- }
- }
- else {
- Logger.INFO("[Recipe] Error generating Large Centrifuge recipe.");
- Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(x.mInputs));
- Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(x.mFluidInputs));
- Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(x.mOutputs));
- Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(x.mFluidOutputs));
- }
- }
- else {
- mInvalidCount[0]++;
- }
- }
-
- if (GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mRecipeList.size() < 1) {
- for (GT_Recipe a : GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mRecipeList) {
- GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.add(a);
- }
- }
-
- //Large Electrolyzer generation
- mOriginalCount[1] = GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size();
- for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList) {
- if (x != null) {
- if (ItemUtils.checkForInvalidItems(x.mInputs, x.mOutputs)) {
- if (CORE.RA.addMultiblockElectrolyzerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue)) {
- mValidCount[1]++;
- }
- else {
- mInvalidCount[1]++;
- }
- }
- else {
- Logger.INFO("[Recipe] Error generating Large Electrolyzer recipe.");
- Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(x.mInputs));
- Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(x.mFluidInputs));
- Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(x.mOutputs));
- Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(x.mFluidOutputs));
- }
- }
- else {
- mInvalidCount[1]++;
- }
- }
-
- if (GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mRecipeList.size() < 1) {
- for (GT_Recipe a : GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mRecipeList) {
- GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.add(a);
- }
- }
-
- //Advanced Vacuum Freezer generation
- mOriginalCount[2] = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList.size();
- for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList) {
- if (x != null && RecipeUtils.doesGregtechRecipeHaveEqualCells(x)) {
- if (ItemUtils.checkForInvalidItems(x.mInputs, x.mOutputs)) {
- if (CORE.RA.addAdvancedFreezerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue)) {
- mValidCount[2]++;
- }
- }
- else {
- mInvalidCount[2]++;
- }
- }
- else {
- mInvalidCount[2]++;
- }
- }
-
- //Redo plasma recipes in Adv. Vac.
- //Meta_GT_Proxy.generatePlasmaRecipesForAdvVacFreezer();
-
-
- String[] machineName = new String[] {"Centrifuge", "Electrolyzer", "Vacuum Freezer"};
- for (int i=0;i<3;i++) {
- Logger.INFO("[Recipe] Generated "+mValidCount[i]+" recipes for the Industrial "+machineName[i]+". The original machine can process "+mOriginalCount[i]+" recipes, meaning "+mInvalidCount[i]+" are invalid for this Multiblock's processing in some way.");
- }*/
- }
-
- protected void dumpGtRecipeMap(final GT_Recipe_Map r) {
- final Collection<GT_Recipe> x = r.mRecipeList;
- Logger.INFO("Dumping " + r.mUnlocalizedName + " Recipes for Debug.");
- for (final GT_Recipe newBo : x) {
- Logger.INFO("========================");
- Logger.INFO(
- "Dumping Input: "
- + ItemUtils.getArrayStackNames(newBo.mInputs)
- );
- Logger.INFO(
- "Dumping Inputs " + ItemUtils.getFluidArrayStackNames(
- newBo.mFluidInputs
- )
- );
- Logger.INFO("Dumping Duration: " + newBo.mDuration);
- Logger.INFO("Dumping EU/t: " + newBo.mEUt);
- Logger.INFO(
- "Dumping Output: "
- + ItemUtils.getArrayStackNames(newBo.mOutputs)
- );
- Logger.INFO(
- "Dumping Output: " + ItemUtils.getFluidArrayStackNames(
- newBo.mFluidOutputs
- )
- );
- Logger.INFO("========================");
- }
- }
-
- private static final boolean setupMaterialBlacklist() {
- Material.invalidMaterials.put(Materials._NULL);
- Material.invalidMaterials.put(Materials.Clay);
- Material.invalidMaterials.put(Materials.Phosphorus);
- Material.invalidMaterials.put(Materials.Steel);
- Material.invalidMaterials.put(Materials.Bronze);
- Material.invalidMaterials.put(Materials.Hydrogen);
- // Infused TC stuff
- Material.invalidMaterials.put(Materials.InfusedAir);
- Material.invalidMaterials.put(Materials.InfusedEarth);
- Material.invalidMaterials.put(Materials.InfusedFire);
- Material.invalidMaterials.put(Materials.InfusedWater);
- // EIO Materials
- Material.invalidMaterials.put(Materials.SoulSand);
- Material.invalidMaterials.put(Materials.EnderPearl);
- Material.invalidMaterials.put(Materials.EnderEye);
- Material.invalidMaterials.put(Materials.Redstone);
- Material.invalidMaterials.put(Materials.Glowstone);
- Material.invalidMaterials.put(Materials.Soularium);
- Material.invalidMaterials.put(Materials.PhasedIron);
-
- if (Material.invalidMaterials.size() > 0) {
- return true;
- }
- return false;
-
- }
-
- @SuppressWarnings("unused")
- private void setupMaterialWhitelist() {
-
- mGregMatLoader = new GT_Material_Loader();
-
- // Non GTNH Materials
- if (!CORE.GTNH) {
- // Mithril - Random Dungeon Loot
- mGregMatLoader.enableMaterial(Materials.Mithril);
- }
-
- // Force - Alloying
- mGregMatLoader.enableMaterial(Materials.Force);
- }
-
- private static final HashMap<String, Item> sMissingItemMappings = new HashMap<String, Item>();
- private static final HashMap<String, Block> sMissingBlockMappings = new HashMap<String, Block>();
-
- private static void processMissingMappings() {
- sMissingItemMappings.put("miscutils:Ammonium", GameRegistry.findItem(CORE.MODID, "itemCellAmmonium"));
- sMissingItemMappings.put("miscutils:Hydroxide", GameRegistry.findItem(CORE.MODID, "itemCellHydroxide"));
- sMissingItemMappings.put("miscutils:BerylliumHydroxide", GameRegistry.findItem(CORE.MODID, "itemCellmiscutils:BerylliumHydroxide"));
- sMissingItemMappings.put("miscutils:Bromine", GameRegistry.findItem(CORE.MODID, "itemCellBromine"));
- sMissingItemMappings.put("miscutils:Krypton", GameRegistry.findItem(CORE.MODID, "itemCellKrypton"));
- sMissingItemMappings.put("miscutils:itemCellZirconiumTetrafluoride", GameRegistry.findItem(CORE.MODID, "ZirconiumTetrafluoride"));
- sMissingItemMappings.put("miscutils:Li2BeF4", GameRegistry.findItem(CORE.MODID, "itemCellLithiumTetrafluoroberyllate"));
-
- // Cryolite
- sMissingBlockMappings.put("miscutils:oreCryolite", GameRegistry.findBlock(CORE.MODID, "oreCryoliteF"));
- sMissingItemMappings.put("miscutils:itemDustTinyCryolite", GameRegistry.findItem(CORE.MODID, "itemDustTinyCryoliteF"));
- sMissingItemMappings.put("miscutils:itemDustSmallCryolite", GameRegistry.findItem(CORE.MODID, "itemDustSmallCryoliteF"));
- sMissingItemMappings.put("miscutils:itemDustCryolite", GameRegistry.findItem(CORE.MODID, "itemDustCryoliteF"));
- sMissingItemMappings.put("miscutils:dustPureCryolite", GameRegistry.findItem(CORE.MODID, "dustPureCryoliteF"));
- sMissingItemMappings.put("miscutils:dustImpureCryolite", GameRegistry.findItem(CORE.MODID, "dustImpureCryoliteF"));
- sMissingItemMappings.put("miscutils:crushedCryolite", GameRegistry.findItem(CORE.MODID, "crushedCryoliteF"));
- sMissingItemMappings.put("miscutils:crushedPurifiedCryolite", GameRegistry.findItem(CORE.MODID, "crushedPurifiedCryoliteF"));
- sMissingItemMappings.put("miscutils:crushedCentrifugedCryolite", GameRegistry.findItem(CORE.MODID, "crushedCentrifugedCryoliteF"));
- sMissingItemMappings.put("miscutils:oreCryolite", GameRegistry.findItem(CORE.MODID, "oreCryoliteF"));
-
- // Fluorite
- sMissingBlockMappings.put("miscutils:oreFluorite", GameRegistry.findBlock(CORE.MODID, "oreFluoriteF"));
- sMissingItemMappings.put("miscutils:itemDustTinyFluorite", GameRegistry.findItem(CORE.MODID, "itemDustTinyFluoriteF"));
- sMissingItemMappings.put("miscutils:itemDustSmallFluorite", GameRegistry.findItem(CORE.MODID, "itemDustSmallFluoriteF"));
- sMissingItemMappings.put("miscutils:itemDustFluorite", GameRegistry.findItem(CORE.MODID, "itemDustFluoriteF"));
- sMissingItemMappings.put("miscutils:dustPureFluorite", GameRegistry.findItem(CORE.MODID, "dustPureFluoriteF"));
- sMissingItemMappings.put("miscutils:dustImpureFluorite", GameRegistry.findItem(CORE.MODID, "dustImpureFluoriteF"));
- sMissingItemMappings.put("miscutils:crushedFluorite", GameRegistry.findItem(CORE.MODID, "crushedFluoriteF"));
- sMissingItemMappings.put("miscutils:crushedPurifiedFluorite", GameRegistry.findItem(CORE.MODID, "crushedPurifiedFluoriteF"));
- sMissingItemMappings.put("miscutils:crushedCentrifugedFluorite", GameRegistry.findItem(CORE.MODID, "crushedCentrifugedFluoriteF"));
- sMissingItemMappings.put("miscutils:oreFluorite", GameRegistry.findItem(CORE.MODID, "oreFluoriteF"));
- }
-
+ public static enum INIT_PHASE {
+ SUPER(null),
+ PRE_INIT(SUPER),
+ INIT(PRE_INIT),
+ POST_INIT(INIT),
+ SERVER_START(POST_INIT),
+ STARTED(SERVER_START);
+ protected boolean mIsPhaseActive = false;
+ private final INIT_PHASE mPrev;
+
+ private INIT_PHASE(INIT_PHASE aPreviousPhase) {
+ mPrev = aPreviousPhase;
+ }
+
+ public final synchronized boolean isPhaseActive() {
+ return mIsPhaseActive;
+ }
+
+ public final synchronized void setPhaseActive(boolean aIsPhaseActive) {
+ if (mPrev != null && mPrev.isPhaseActive()) {
+ mPrev.setPhaseActive(false);
+ }
+ mIsPhaseActive = aIsPhaseActive;
+ if (CURRENT_LOAD_PHASE != this) {
+ CURRENT_LOAD_PHASE = this;
+ }
+ }
+ }
+
+ public static INIT_PHASE CURRENT_LOAD_PHASE = INIT_PHASE.SUPER;
+
+ // Mod Instance
+ @Mod.Instance(CORE.MODID)
+ public static GTplusplus instance;
+
+ // Material Loader
+ public static GT_Material_Loader mGregMatLoader;
+
+ // GT_Proxy instance
+ protected static Meta_GT_Proxy mGregProxy;
+
+ // GT++ Proxy Instances
+ @SidedProxy(clientSide = "gtPlusPlus.core.proxy.ClientProxy", serverSide = "gtPlusPlus.core.proxy.ServerProxy")
+ public static CommonProxy proxy;
+
+ // Loads Textures
+ @SideOnly(value = Side.CLIENT)
+ public static void loadTextures() {
+ Logger.INFO("Loading some textures on the client.");
+ // Tools
+ Logger.WARNING("Processing texture: "
+ + TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile().getResourcePath());
+ Logger.WARNING("Processing texture: "
+ + TexturesGtTools.ANGLE_GRINDER.getTextureFile().getResourcePath());
+ Logger.WARNING("Processing texture: "
+ + TexturesGtTools.ELECTRIC_SNIPS.getTextureFile().getResourcePath());
+ Logger.WARNING("Processing texture: "
+ + TexturesGtTools.ELECTRIC_LIGHTER.getTextureFile().getResourcePath());
+ Logger.WARNING("Processing texture: "
+ + TexturesGtTools.ELECTRIC_BUTCHER_KNIFE.getTextureFile().getResourcePath());
+
+ // Blocks
+ Logger.WARNING("Processing texture: "
+ + TexturesGtBlock.Casing_Machine_Dimensional.getTextureFile().getResourcePath());
+ }
+
+ public GTplusplus() {
+ super();
+ INIT_PHASE.SUPER.setPhaseActive(true);
+ }
+
+ // Pre-Init
+ @Mod.EventHandler
+ public void preInit(final FMLPreInitializationEvent event) {
+ INIT_PHASE.PRE_INIT.setPhaseActive(true);
+ Logger.INFO("Loading " + CORE.name + " " + CORE.VERSION + " on Gregtech " + Utils.getGregtechVersionAsString());
+ // Load all class objects within the plugin package.
+ Core_Manager.veryEarlyInit();
+ PacketHandler.init();
+
+ if (!Utils.isServer()) {
+ enableCustomCapes = true;
+ }
+
+ // Give this a go mate.
+ // initAnalytics();
+ setupMaterialBlacklist();
+ // setupMaterialWhitelist();
+
+ // Handle GT++ Config
+ ConfigHandler.handleConfigFile(event);
+
+ // Check for Dev
+ CORE.DEVENV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
+ // Utils.LOG_INFO("User's Country: " + CORE.USER_COUNTRY);
+
+ Utils.registerEvent(new LoginEventHandler());
+ Utils.registerEvent(new MissingMappingsEvent());
+ Utils.registerEvent(new MobMentality());
+ Logger.INFO("Login Handler Initialized");
+
+ proxy.preInit(event);
+ Logger.INFO("Setting up our own GT_Proxy.");
+ Meta_GT_Proxy.preInit();
+ Core_Manager.preInit();
+ GTPP_ChunkManager.init();
+ }
+
+ // Init
+ @Mod.EventHandler
+ public void init(final FMLInitializationEvent event) {
+ INIT_PHASE.INIT.setPhaseActive(true);
+ proxy.init(event);
+ proxy.registerNetworkStuff();
+ Meta_GT_Proxy.init();
+ Core_Manager.init();
+ NEI_IMC_Sender.IMCSender();
+ // Used by foreign players to generate .lang files for translation.
+ if (CORE.ConfigSwitches.dumpItemAndBlockData) {
+ LocaleUtils.generateFakeLocaleFile();
+ }
+ }
+
+ // Post-Init
+ @Mod.EventHandler
+ public void postInit(final FMLPostInitializationEvent event) {
+ INIT_PHASE.POST_INIT.setPhaseActive(true);
+ proxy.postInit(event);
+ HazmatUtils.init();
+ BookHandler.runLater();
+ Meta_GT_Proxy.postInit();
+ Core_Manager.postInit();
+ // SprinklerHandler.registerModFerts();
+
+ ItemGiantEgg.postInit(ModItems.itemBigEgg);
+ BlockEventHandler.init();
+ GTPP_Recipe.reInit();
+
+ Logger.INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+ Logger.INFO("| Recipes succesfully Loaded: "
+ + RegistrationHandler.recipesSuccess + " | Failed: "
+ + RegistrationHandler.recipesFailed + " |");
+ Logger.INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+ Logger.INFO("Finally, we are finished. Have some cripsy bacon as a reward.");
+
+ // Log free GT++ Meta IDs
+ if (CORE.DEVENV) {
+ // 750 - 999 are reserved for Alkalus.
+ for (int i = 750; i < 1000; i++) {
+ if (gregtech.api.GregTech_API.METATILEENTITIES[i] == null) {
+ Logger.INFO("MetaID " + i + " is free.");
+ }
+ }
+ // 30000 - 31999 are reserved for Alkalus.
+ for (int i = 30000; i < 32000; i++) {
+ if (gregtech.api.GregTech_API.METATILEENTITIES[i] == null) {
+ Logger.INFO("MetaID " + i + " is free.");
+ }
+ }
+ }
+ }
+
+ @EventHandler
+ public synchronized void serverStarting(final FMLServerStartingEvent event) {
+ INIT_PHASE.SERVER_START.setPhaseActive(true);
+ event.registerServerCommand(new CommandMath());
+ event.registerServerCommand(new CommandEnableDebugWhileRunning());
+ event.registerServerCommand(new CommandDebugChunks());
+ if (LoadedMods.Thaumcraft) {
+ event.registerServerCommand(new CommandDumpAspects());
+ }
+ Core_Manager.serverStart();
+ INIT_PHASE.STARTED.setPhaseActive(true);
+ }
+
+ @Mod.EventHandler
+ public synchronized void serverStopping(final FMLServerStoppingEvent event) {
+ Core_Manager.serverStop();
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent arg0) {}
+
+ /**
+ * This {@link EventHandler} is called after the
+ * {@link FMLPostInitializationEvent} stages of all loaded mods executes
+ * successfully. {@link #onLoadComplete(FMLLoadCompleteEvent)} exists to
+ * inject recipe generation after Gregtech and all other mods are entirely
+ * loaded and initialized.
+ *
+ * @param event
+ * - The {@link EventHandler} object passed through from FML to
+ * {@link #GTplusplus()}'s {@link #instance}.
+ */
+ @Mod.EventHandler
+ public void onLoadComplete(FMLLoadCompleteEvent event) {
+ proxy.onLoadComplete(event);
+ generateGregtechRecipeMaps();
+ // Check our maps are untouched
+ GTPP_Recipe.checkRecipeModifications();
+ Logger.INFO("Passed verification checks.");
+ }
+
+ @Mod.EventHandler
+ public void onIDChangingEvent(FMLModIdMappingEvent aEvent) {
+ GTPP_Recipe.reInit();
+ }
+
+ public static void tryPatchTurbineTextures() {
+ if (enableAnimatedTurbines) {
+ BlockIcons h = Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE;
+ BlockIcons h2 = Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE;
+ try {
+ Logger.INFO("Trying to patch GT textures to make Turbines animated.");
+ IIcon aIcon = TexturesGtBlock.Overlay_Machine_Turbine_Active.getIcon();
+ if (ReflectionUtils.setField(h, "mIcon", aIcon)) {
+ Logger.INFO("Patched Gas Turbine Icon.");
+ }
+ if (ReflectionUtils.setField(h2, "mIcon", aIcon)) {
+ Logger.INFO("Patched Steam Turbine Icon.");
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ protected void generateGregtechRecipeMaps() {
+
+ int[] mValidCount = new int[] {0, 0, 0};
+ int[] mInvalidCount = new int[] {0, 0, 0, 0};
+ int[] mOriginalCount = new int[] {0, 0, 0};
+
+ RecipeGen_BlastSmelterGT_GTNH.generateGTNHBlastSmelterRecipesFromEBFList();
+ FishPondFakeRecipe.generateFishPondRecipes();
+ // GregtechMiniRaFusion.generateSlowFusionrecipes();
+ SemiFluidFuelHandler.generateFuels();
+ GregtechMTE_ChemicalPlant.generateRecipes();
+
+ mInvalidCount[0] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells(
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes,
+ GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT);
+ mInvalidCount[1] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells(
+ GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes,
+ GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT);
+ mInvalidCount[2] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells(
+ GT_Recipe.GT_Recipe_Map.sVacuumRecipes, GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT);
+ mInvalidCount[3] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells(
+ GT_Recipe.GT_Recipe_Map.sMixerRecipes, GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT);
+ /*
+
+ //Large Centrifuge generation
+ mOriginalCount[0] = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size();
+ for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList) {
+ if (x != null) {
+ if (ItemUtils.checkForInvalidItems(x.mInputs, x.mOutputs)) {
+ if (CORE.RA.addMultiblockCentrifugeRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue)) {
+ mValidCount[0]++;
+ }
+ else {
+ mInvalidCount[0]++;
+ }
+ }
+ else {
+ Logger.INFO("[Recipe] Error generating Large Centrifuge recipe.");
+ Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(x.mInputs));
+ Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(x.mFluidInputs));
+ Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(x.mOutputs));
+ Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(x.mFluidOutputs));
+ }
+ }
+ else {
+ mInvalidCount[0]++;
+ }
+ }
+
+ if (GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mRecipeList.size() < 1) {
+ for (GT_Recipe a : GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mRecipeList) {
+ GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.add(a);
+ }
+ }
+
+ //Large Electrolyzer generation
+ mOriginalCount[1] = GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size();
+ for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList) {
+ if (x != null) {
+ if (ItemUtils.checkForInvalidItems(x.mInputs, x.mOutputs)) {
+ if (CORE.RA.addMultiblockElectrolyzerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue)) {
+ mValidCount[1]++;
+ }
+ else {
+ mInvalidCount[1]++;
+ }
+ }
+ else {
+ Logger.INFO("[Recipe] Error generating Large Electrolyzer recipe.");
+ Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(x.mInputs));
+ Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(x.mFluidInputs));
+ Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(x.mOutputs));
+ Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(x.mFluidOutputs));
+ }
+ }
+ else {
+ mInvalidCount[1]++;
+ }
+ }
+
+ if (GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mRecipeList.size() < 1) {
+ for (GT_Recipe a : GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mRecipeList) {
+ GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.add(a);
+ }
+ }
+
+ //Advanced Vacuum Freezer generation
+ mOriginalCount[2] = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList.size();
+ for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList) {
+ if (x != null && RecipeUtils.doesGregtechRecipeHaveEqualCells(x)) {
+ if (ItemUtils.checkForInvalidItems(x.mInputs, x.mOutputs)) {
+ if (CORE.RA.addAdvancedFreezerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue)) {
+ mValidCount[2]++;
+ }
+ }
+ else {
+ mInvalidCount[2]++;
+ }
+ }
+ else {
+ mInvalidCount[2]++;
+ }
+ }
+
+ //Redo plasma recipes in Adv. Vac.
+ //Meta_GT_Proxy.generatePlasmaRecipesForAdvVacFreezer();
+
+
+ String[] machineName = new String[] {"Centrifuge", "Electrolyzer", "Vacuum Freezer"};
+ for (int i=0;i<3;i++) {
+ Logger.INFO("[Recipe] Generated "+mValidCount[i]+" recipes for the Industrial "+machineName[i]+". The original machine can process "+mOriginalCount[i]+" recipes, meaning "+mInvalidCount[i]+" are invalid for this Multiblock's processing in some way.");
+ }*/
+ }
+
+ protected void dumpGtRecipeMap(final GT_Recipe_Map r) {
+ final Collection<GT_Recipe> x = r.mRecipeList;
+ Logger.INFO("Dumping " + r.mUnlocalizedName + " Recipes for Debug.");
+ for (final GT_Recipe newBo : x) {
+ Logger.INFO("========================");
+ Logger.INFO("Dumping Input: " + ItemUtils.getArrayStackNames(newBo.mInputs));
+ Logger.INFO("Dumping Inputs " + ItemUtils.getFluidArrayStackNames(newBo.mFluidInputs));
+ Logger.INFO("Dumping Duration: " + newBo.mDuration);
+ Logger.INFO("Dumping EU/t: " + newBo.mEUt);
+ Logger.INFO("Dumping Output: " + ItemUtils.getArrayStackNames(newBo.mOutputs));
+ Logger.INFO("Dumping Output: " + ItemUtils.getFluidArrayStackNames(newBo.mFluidOutputs));
+ Logger.INFO("========================");
+ }
+ }
+
+ private static final boolean setupMaterialBlacklist() {
+ Material.invalidMaterials.put(Materials._NULL);
+ Material.invalidMaterials.put(Materials.Clay);
+ Material.invalidMaterials.put(Materials.Phosphorus);
+ Material.invalidMaterials.put(Materials.Steel);
+ Material.invalidMaterials.put(Materials.Bronze);
+ Material.invalidMaterials.put(Materials.Hydrogen);
+ // Infused TC stuff
+ Material.invalidMaterials.put(Materials.InfusedAir);
+ Material.invalidMaterials.put(Materials.InfusedEarth);
+ Material.invalidMaterials.put(Materials.InfusedFire);
+ Material.invalidMaterials.put(Materials.InfusedWater);
+ // EIO Materials
+ Material.invalidMaterials.put(Materials.SoulSand);
+ Material.invalidMaterials.put(Materials.EnderPearl);
+ Material.invalidMaterials.put(Materials.EnderEye);
+ Material.invalidMaterials.put(Materials.Redstone);
+ Material.invalidMaterials.put(Materials.Glowstone);
+ Material.invalidMaterials.put(Materials.Soularium);
+ Material.invalidMaterials.put(Materials.PhasedIron);
+
+ if (Material.invalidMaterials.size() > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ @SuppressWarnings("unused")
+ private void setupMaterialWhitelist() {
+
+ mGregMatLoader = new GT_Material_Loader();
+
+ // Non GTNH Materials
+ if (!CORE.GTNH) {
+ // Mithril - Random Dungeon Loot
+ mGregMatLoader.enableMaterial(Materials.Mithril);
+ }
+
+ // Force - Alloying
+ mGregMatLoader.enableMaterial(Materials.Force);
+ }
+
+ private static final HashMap<String, Item> sMissingItemMappings = new HashMap<String, Item>();
+ private static final HashMap<String, Block> sMissingBlockMappings = new HashMap<String, Block>();
+
+ private static void processMissingMappings() {
+ sMissingItemMappings.put("miscutils:Ammonium", GameRegistry.findItem(CORE.MODID, "itemCellAmmonium"));
+ sMissingItemMappings.put("miscutils:Hydroxide", GameRegistry.findItem(CORE.MODID, "itemCellHydroxide"));
+ sMissingItemMappings.put(
+ "miscutils:BerylliumHydroxide",
+ GameRegistry.findItem(CORE.MODID, "itemCellmiscutils:BerylliumHydroxide"));
+ sMissingItemMappings.put("miscutils:Bromine", GameRegistry.findItem(CORE.MODID, "itemCellBromine"));
+ sMissingItemMappings.put("miscutils:Krypton", GameRegistry.findItem(CORE.MODID, "itemCellKrypton"));
+ sMissingItemMappings.put(
+ "miscutils:itemCellZirconiumTetrafluoride",
+ GameRegistry.findItem(CORE.MODID, "ZirconiumTetrafluoride"));
+ sMissingItemMappings.put(
+ "miscutils:Li2BeF4", GameRegistry.findItem(CORE.MODID, "itemCellLithiumTetrafluoroberyllate"));
+
+ // Cryolite
+ sMissingBlockMappings.put("miscutils:oreCryolite", GameRegistry.findBlock(CORE.MODID, "oreCryoliteF"));
+ sMissingItemMappings.put(
+ "miscutils:itemDustTinyCryolite", GameRegistry.findItem(CORE.MODID, "itemDustTinyCryoliteF"));
+ sMissingItemMappings.put(
+ "miscutils:itemDustSmallCryolite", GameRegistry.findItem(CORE.MODID, "itemDustSmallCryoliteF"));
+ sMissingItemMappings.put("miscutils:itemDustCryolite", GameRegistry.findItem(CORE.MODID, "itemDustCryoliteF"));
+ sMissingItemMappings.put("miscutils:dustPureCryolite", GameRegistry.findItem(CORE.MODID, "dustPureCryoliteF"));
+ sMissingItemMappings.put(
+ "miscutils:dustImpureCryolite", GameRegistry.findItem(CORE.MODID, "dustImpureCryoliteF"));
+ sMissingItemMappings.put("miscutils:crushedCryolite", GameRegistry.findItem(CORE.MODID, "crushedCryoliteF"));
+ sMissingItemMappings.put(
+ "miscutils:crushedPurifiedCryolite", GameRegistry.findItem(CORE.MODID, "crushedPurifiedCryoliteF"));
+ sMissingItemMappings.put(
+ "miscutils:crushedCentrifugedCryolite",
+ GameRegistry.findItem(CORE.MODID, "crushedCentrifugedCryoliteF"));
+ sMissingItemMappings.put("miscutils:oreCryolite", GameRegistry.findItem(CORE.MODID, "oreCryoliteF"));
+
+ // Fluorite
+ sMissingBlockMappings.put("miscutils:oreFluorite", GameRegistry.findBlock(CORE.MODID, "oreFluoriteF"));
+ sMissingItemMappings.put(
+ "miscutils:itemDustTinyFluorite", GameRegistry.findItem(CORE.MODID, "itemDustTinyFluoriteF"));
+ sMissingItemMappings.put(
+ "miscutils:itemDustSmallFluorite", GameRegistry.findItem(CORE.MODID, "itemDustSmallFluoriteF"));
+ sMissingItemMappings.put("miscutils:itemDustFluorite", GameRegistry.findItem(CORE.MODID, "itemDustFluoriteF"));
+ sMissingItemMappings.put("miscutils:dustPureFluorite", GameRegistry.findItem(CORE.MODID, "dustPureFluoriteF"));
+ sMissingItemMappings.put(
+ "miscutils:dustImpureFluorite", GameRegistry.findItem(CORE.MODID, "dustImpureFluoriteF"));
+ sMissingItemMappings.put("miscutils:crushedFluorite", GameRegistry.findItem(CORE.MODID, "crushedFluoriteF"));
+ sMissingItemMappings.put(
+ "miscutils:crushedPurifiedFluorite", GameRegistry.findItem(CORE.MODID, "crushedPurifiedFluoriteF"));
+ sMissingItemMappings.put(
+ "miscutils:crushedCentrifugedFluorite",
+ GameRegistry.findItem(CORE.MODID, "crushedCentrifugedFluoriteF"));
+ sMissingItemMappings.put("miscutils:oreFluorite", GameRegistry.findItem(CORE.MODID, "oreFluoriteF"));
+ }
+
@Mod.EventHandler
public void missingMapping(FMLMissingMappingsEvent event) {
- processMissingMappings();
- for (FMLMissingMappingsEvent.MissingMapping mapping : event.get()) {
- if (mapping.type == GameRegistry.Type.ITEM) {
- Item aReplacement = sMissingItemMappings.get(mapping.name);
- if (aReplacement != null) {
- remap(aReplacement, mapping);
- }
- else {
- //Logger.INFO("Unable to remap: "+mapping.name+", item has no replacement mapping.");
- }
- }
- else if (mapping.type == GameRegistry.Type.BLOCK) {
- Block aReplacement = sMissingBlockMappings.get(mapping.name);
- if (aReplacement != null) {
- remap(aReplacement, mapping);
- }
- else {
- //Logger.INFO("Unable to remap: "+mapping.name+", block has no replacement mapping.");
- }
- }
- }
+ processMissingMappings();
+ for (FMLMissingMappingsEvent.MissingMapping mapping : event.get()) {
+ if (mapping.type == GameRegistry.Type.ITEM) {
+ Item aReplacement = sMissingItemMappings.get(mapping.name);
+ if (aReplacement != null) {
+ remap(aReplacement, mapping);
+ } else {
+ // Logger.INFO("Unable to remap: "+mapping.name+", item has no replacement mapping.");
+ }
+ } else if (mapping.type == GameRegistry.Type.BLOCK) {
+ Block aReplacement = sMissingBlockMappings.get(mapping.name);
+ if (aReplacement != null) {
+ remap(aReplacement, mapping);
+ } else {
+ // Logger.INFO("Unable to remap: "+mapping.name+", block has no replacement mapping.");
+ }
+ }
+ }
}
-
+
private static void remap(Item item, FMLMissingMappingsEvent.MissingMapping mapping) {
mapping.remap(item);
Logger.INFO("Remapping item " + mapping.name + " to " + CORE.MODID + ":" + item.getUnlocalizedName());
}
-
+
private static void remap(Block block, FMLMissingMappingsEvent.MissingMapping mapping) {
mapping.remap(block);
Logger.INFO("Remapping block " + mapping.name + " to " + CORE.MODID + ":" + block.getUnlocalizedName());
}
-
}
diff --git a/src/main/java/gtPlusPlus/GenerateDictionaries.java b/src/main/java/gtPlusPlus/GenerateDictionaries.java
index abdf4f4027..2298975454 100644
--- a/src/main/java/gtPlusPlus/GenerateDictionaries.java
+++ b/src/main/java/gtPlusPlus/GenerateDictionaries.java
@@ -1,5 +1,6 @@
package gtPlusPlus;
+import gtPlusPlus.api.objects.random.XSTR;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
@@ -13,164 +14,156 @@ import java.util.HashSet;
import java.util.List;
import java.util.Random;
-import gtPlusPlus.api.objects.random.XSTR;
-
public class GenerateDictionaries {
- public static void main(String[] args) {
-
- File aMainDictionary = new File("proguard/DictionaryMain.txt");
- File aMethodDict = new File("proguard/method-dict.txt");
- File aClassDict = new File("proguard/class-dict.txt");
-
- if (Utils.doesFileExist(aMainDictionary)) {
- Utils.log("Found Main Dictionary");
- List<String> aLines = Utils.readLines(aMainDictionary);
-
- ArrayList<String> aLinesToWriteMethods = new ArrayList<String>();
- ArrayList<String> aLinesToWriteClasses = new ArrayList<String>();
-
- if (aLines != null && aLines.size() > 0) {
- Utils.log("Main Dictionary has > 0 keywords ("+aLines.size()+")");
- HashSet<Integer> aUsedIndicies = new HashSet<Integer>();
- int aCount = aLines.size() / 5;
-
- Utils.log("Mapping "+aCount+" to each dict.");
- // Map New Method Names
- for (int i=0;aLinesToWriteMethods.size()<aCount;i++) {
- Integer aIndex = Utils.randInt(0, aLines.size()-1);
- if (!aUsedIndicies.contains(aIndex)) {
- String aLineAtIndex = aLines.get(aIndex);
- if (aLineAtIndex != null && aLineAtIndex.length() > 0) {
- aLinesToWriteMethods.add(aLineAtIndex);
- aUsedIndicies.add(aIndex);
- }
- }
- if (i >= aCount * 5) {
- break;
- }
- }
-
- // Map New Class Names
- for (int i=0;aLinesToWriteClasses.size()<aCount;i++) {
- Integer aIndex = Utils.randInt(0, aLines.size()-1);
- if (!aUsedIndicies.contains(aIndex)) {
- String aLineAtIndex = aLines.get(aIndex);
- if (aLineAtIndex != null && aLineAtIndex.length() > 0) {
- aLinesToWriteClasses.add(aLineAtIndex);
- aUsedIndicies.add(aIndex);
- }
- }
- if (i >= aCount * 5) {
- break;
- }
- }
- }
-
- // Remove old generated Dicts
- if (Utils.doesFileExist(aMethodDict)) {
- aMethodDict.delete();
- Utils.log("Removed old Method-Dict");
- }
- if (Utils.doesFileExist(aClassDict)) {
- aClassDict.delete();
- Utils.log("Removed old Class-Dict");
- }
-
- // Create new empty dict files
- if (!Utils.doesFileExist(aMethodDict)) {
- Utils.createFile(aMethodDict);
- }
- if (!Utils.doesFileExist(aClassDict)) {
- Utils.createFile(aClassDict);
- }
-
- Utils.log("Writing new Dictionaries.");
- // Write
- Utils.appendListToFile(aMethodDict, aLinesToWriteMethods);
- Utils.appendListToFile(aClassDict, aLinesToWriteClasses);
-
- Utils.log("Finished all generation of new Dictionaries.");
-
- }
-
- }
-
-
-
- private static final class Utils {
-
- private static final Charset utf8 = StandardCharsets.UTF_8;
- private static final Random rand = new XSTR();
-
- private static final void log(String s) {
- System.out.println("[GTPP-Proguard] "+s);
- }
-
- public static int randInt(final int min, final int max) {
- return rand.nextInt((max - min) + 1) + min;
- }
-
- public static boolean doesFileExist(File f) {
- if (f != null && f.exists() && !f.isDirectory()) {
- return true;
- }
- return false;
- }
-
- public static File createFile(File aFile) {
- boolean blnCreated = false;
- log("Trying to use relative path "+aFile.getPath());
- try {
- //log("Trying to use path "+aFile.getCanonicalPath());
- //log("Trying to use absolute path "+aFile.getAbsolutePath());
- blnCreated = aFile.createNewFile();
- } catch (IOException ioe) {
- log("Error while creating a new empty file :" + ioe);
- return null;
- }
- return blnCreated ? aFile : null;
- }
-
- public static boolean appendListToFile(File file, List<String> content) {
- try {
- long oldSize;
- long newSize;
- if (doesFileExist(file)) {
- Path p = Paths.get(file.getPath());
- if (p != null && Files.isWritable(p)) {
- oldSize = Files.size(p);
- try {
- Files.write(p, content, utf8, StandardOpenOption.APPEND);
- } catch (IOException e) {
- e.printStackTrace();
- }
- newSize = Files.size(p);
- return newSize > oldSize;
- }
- }
- } catch (IOException e) {
- }
- return false;
- }
-
- /**
- * Reads the contents of a file line by line to a List of Strings using the default encoding for the VM.
- * The file is always closed.
- *
- * @param file the file to read, must not be {@code null}
- * @return the list of Strings representing each line in the file, never {@code null}
- * @throws IOException in case of an I/O error
- * @since 1.3
- */
- public static List<String> readLines(File file) {
- try {
- return org.apache.commons.io.FileUtils.readLines(file, utf8);
- }
- catch (IOException e) {
- return new ArrayList<String>();
- }
- }
- }
-
+ public static void main(String[] args) {
+
+ File aMainDictionary = new File("proguard/DictionaryMain.txt");
+ File aMethodDict = new File("proguard/method-dict.txt");
+ File aClassDict = new File("proguard/class-dict.txt");
+
+ if (Utils.doesFileExist(aMainDictionary)) {
+ Utils.log("Found Main Dictionary");
+ List<String> aLines = Utils.readLines(aMainDictionary);
+
+ ArrayList<String> aLinesToWriteMethods = new ArrayList<String>();
+ ArrayList<String> aLinesToWriteClasses = new ArrayList<String>();
+
+ if (aLines != null && aLines.size() > 0) {
+ Utils.log("Main Dictionary has > 0 keywords (" + aLines.size() + ")");
+ HashSet<Integer> aUsedIndicies = new HashSet<Integer>();
+ int aCount = aLines.size() / 5;
+
+ Utils.log("Mapping " + aCount + " to each dict.");
+ // Map New Method Names
+ for (int i = 0; aLinesToWriteMethods.size() < aCount; i++) {
+ Integer aIndex = Utils.randInt(0, aLines.size() - 1);
+ if (!aUsedIndicies.contains(aIndex)) {
+ String aLineAtIndex = aLines.get(aIndex);
+ if (aLineAtIndex != null && aLineAtIndex.length() > 0) {
+ aLinesToWriteMethods.add(aLineAtIndex);
+ aUsedIndicies.add(aIndex);
+ }
+ }
+ if (i >= aCount * 5) {
+ break;
+ }
+ }
+
+ // Map New Class Names
+ for (int i = 0; aLinesToWriteClasses.size() < aCount; i++) {
+ Integer aIndex = Utils.randInt(0, aLines.size() - 1);
+ if (!aUsedIndicies.contains(aIndex)) {
+ String aLineAtIndex = aLines.get(aIndex);
+ if (aLineAtIndex != null && aLineAtIndex.length() > 0) {
+ aLinesToWriteClasses.add(aLineAtIndex);
+ aUsedIndicies.add(aIndex);
+ }
+ }
+ if (i >= aCount * 5) {
+ break;
+ }
+ }
+ }
+
+ // Remove old generated Dicts
+ if (Utils.doesFileExist(aMethodDict)) {
+ aMethodDict.delete();
+ Utils.log("Removed old Method-Dict");
+ }
+ if (Utils.doesFileExist(aClassDict)) {
+ aClassDict.delete();
+ Utils.log("Removed old Class-Dict");
+ }
+
+ // Create new empty dict files
+ if (!Utils.doesFileExist(aMethodDict)) {
+ Utils.createFile(aMethodDict);
+ }
+ if (!Utils.doesFileExist(aClassDict)) {
+ Utils.createFile(aClassDict);
+ }
+
+ Utils.log("Writing new Dictionaries.");
+ // Write
+ Utils.appendListToFile(aMethodDict, aLinesToWriteMethods);
+ Utils.appendListToFile(aClassDict, aLinesToWriteClasses);
+
+ Utils.log("Finished all generation of new Dictionaries.");
+ }
+ }
+
+ private static final class Utils {
+
+ private static final Charset utf8 = StandardCharsets.UTF_8;
+ private static final Random rand = new XSTR();
+
+ private static final void log(String s) {
+ System.out.println("[GTPP-Proguard] " + s);
+ }
+
+ public static int randInt(final int min, final int max) {
+ return rand.nextInt((max - min) + 1) + min;
+ }
+
+ public static boolean doesFileExist(File f) {
+ if (f != null && f.exists() && !f.isDirectory()) {
+ return true;
+ }
+ return false;
+ }
+
+ public static File createFile(File aFile) {
+ boolean blnCreated = false;
+ log("Trying to use relative path " + aFile.getPath());
+ try {
+ // log("Trying to use path "+aFile.getCanonicalPath());
+ // log("Trying to use absolute path "+aFile.getAbsolutePath());
+ blnCreated = aFile.createNewFile();
+ } catch (IOException ioe) {
+ log("Error while creating a new empty file :" + ioe);
+ return null;
+ }
+ return blnCreated ? aFile : null;
+ }
+
+ public static boolean appendListToFile(File file, List<String> content) {
+ try {
+ long oldSize;
+ long newSize;
+ if (doesFileExist(file)) {
+ Path p = Paths.get(file.getPath());
+ if (p != null && Files.isWritable(p)) {
+ oldSize = Files.size(p);
+ try {
+ Files.write(p, content, utf8, StandardOpenOption.APPEND);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ newSize = Files.size(p);
+ return newSize > oldSize;
+ }
+ }
+ } catch (IOException e) {
+ }
+ return false;
+ }
+
+ /**
+ * Reads the contents of a file line by line to a List of Strings using the default encoding for the VM.
+ * The file is always closed.
+ *
+ * @param file the file to read, must not be {@code null}
+ * @return the list of Strings representing each line in the file, never {@code null}
+ * @throws IOException in case of an I/O error
+ * @since 1.3
+ */
+ public static List<String> readLines(File file) {
+ try {
+ return org.apache.commons.io.FileUtils.readLines(file, utf8);
+ } catch (IOException e) {
+ return new ArrayList<String>();
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/RoadMap.java b/src/main/java/gtPlusPlus/RoadMap.java
index c7bb4d5a22..bd8cee7198 100644
--- a/src/main/java/gtPlusPlus/RoadMap.java
+++ b/src/main/java/gtPlusPlus/RoadMap.java
@@ -1,80 +1,72 @@
package gtPlusPlus;
-import java.util.LinkedHashMap;
-
-import com.google.common.base.Objects;
-
-import gtPlusPlus.api.objects.data.ObjMap;
-import net.minecraft.item.ItemStack;
-
/**
* This Class purely exists to note down ideas and or plans to (re)implement things.
- *
+ *
* @author Alkalus
*
*/
public class RoadMap {
- //Reorganization of Item, Block and Common Class loading.
- /*
- * So, due to the complex/silly way I've done things, I've ran into some circular loading problems around the mod.
- * Issues occur where Classes like CI.java try access the GregtechItemList.java objects before they're actually set.
- * A plan should be created to organize the best scheme to load things in the best order.
- */
-
- //Recreation of GUIs for all Multiblocks
- /*
- * Most Multi's use generic or straight out wrong GUI's on the controller.
- * I'd like to go back and recreate all of these.
- *
- * Some could even benefit from a totally new type of UI (Instead of Text issues, just change a 2x2px area between red and green for status lights)
- * These advanced GUIs are probably out of my capability, but if anyone thinks they're a good idea, I'll give them a go.
- */
+ // Reorganization of Item, Block and Common Class loading.
+ /*
+ * So, due to the complex/silly way I've done things, I've ran into some circular loading problems around the mod.
+ * Issues occur where Classes like CI.java try access the GregtechItemList.java objects before they're actually set.
+ * A plan should be created to organize the best scheme to load things in the best order.
+ */
- //Better Integration with GTNH
- /*
- * Refactor things to be more common, refactor things to automatically switch between GTNH and standard variants
- * without having to over-abuse CORE.GTNH switches everywhere.
- * Most of this can be done via expanding CI.java, so that we have automated handlers for everything
- * (IE. getX(5) will get 5x of the correct version of X)
- */
+ // Recreation of GUIs for all Multiblocks
+ /*
+ * Most Multi's use generic or straight out wrong GUI's on the controller.
+ * I'd like to go back and recreate all of these.
+ *
+ * Some could even benefit from a totally new type of UI (Instead of Text issues, just change a 2x2px area between red and green for status lights)
+ * These advanced GUIs are probably out of my capability, but if anyone thinks they're a good idea, I'll give them a go.
+ */
+ // Better Integration with GTNH
+ /*
+ * Refactor things to be more common, refactor things to automatically switch between GTNH and standard variants
+ * without having to over-abuse CORE.GTNH switches everywhere.
+ * Most of this can be done via expanding CI.java, so that we have automated handlers for everything
+ * (IE. getX(5) will get 5x of the correct version of X)
+ */
- /*
- Thallium - Everglades only. (Mostly useless)
- Technetium - Has some recipes but seem to be dead ends so unobtainable.
- Polonium - Unobtainable. (Radioactive, Mostly Useless)
- Francium - Unobtainable. (Radioactive, Mostly Useless)
- Promethium - Unobtainable.
- Radium - Everglades only. (Do use, Moderately Rare)
- Actinium - Unobtainable. (Radioactive, Do use)
- Proactinium - Unobtainable. (Do use)
- Neptunium - Has some recipes but seem to be dead ends so unobtainable.
- Curium - Fusion only.
- Berkelium - Unobtainable.
- Californium - Fusion only.
- Einsteinium - Unobtainable.
- Fermium - Unobtainable.
- Strontium - Everglades only. (Do use 1)
- Iodine - Everglades only.
- Dysprosium - Everglades only. (Do use 1)
- Rhenium - Weird ABS recipe only.
- Flerovium - Unobtainable.
- Dubnium - Unobtainable.
- Seaborgium - Unobtainable.
- Bohrium - Unobtainable.
- Hassium - Unobtainable.
- Meitnerium - Unobtainable.
- Darmstadtium - Unobtainable.
- Roentgenium - Unobtainable.
- Copernicium - Unobtainable.
- Nihonium - Unobtainable.
- Moscovium - Unobtainable.
- Livermorium - Unobtainable.
- Tennessine - Unobtainable.
- Nobelium - Unobtainable.
- Lawrencium - Unobtainable.
- Astatine - Unobtainable. (Radioactive, Mostly Useless)
- */
+ /*
+ Thallium - Everglades only. (Mostly useless)
+ Technetium - Has some recipes but seem to be dead ends so unobtainable.
+ Polonium - Unobtainable. (Radioactive, Mostly Useless)
+ Francium - Unobtainable. (Radioactive, Mostly Useless)
+ Promethium - Unobtainable.
+ Radium - Everglades only. (Do use, Moderately Rare)
+ Actinium - Unobtainable. (Radioactive, Do use)
+ Proactinium - Unobtainable. (Do use)
+ Neptunium - Has some recipes but seem to be dead ends so unobtainable.
+ Curium - Fusion only.
+ Berkelium - Unobtainable.
+ Californium - Fusion only.
+ Einsteinium - Unobtainable.
+ Fermium - Unobtainable.
+ Strontium - Everglades only. (Do use 1)
+ Iodine - Everglades only.
+ Dysprosium - Everglades only. (Do use 1)
+ Rhenium - Weird ABS recipe only.
+ Flerovium - Unobtainable.
+ Dubnium - Unobtainable.
+ Seaborgium - Unobtainable.
+ Bohrium - Unobtainable.
+ Hassium - Unobtainable.
+ Meitnerium - Unobtainable.
+ Darmstadtium - Unobtainable.
+ Roentgenium - Unobtainable.
+ Copernicium - Unobtainable.
+ Nihonium - Unobtainable.
+ Moscovium - Unobtainable.
+ Livermorium - Unobtainable.
+ Tennessine - Unobtainable.
+ Nobelium - Unobtainable.
+ Lawrencium - Unobtainable.
+ Astatine - Unobtainable. (Radioactive, Mostly Useless)
+ */
}
diff --git a/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java b/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java
index f35c9cbc6b..e37a86aaa5 100644
--- a/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java
+++ b/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java
@@ -1,24 +1,22 @@
package gtPlusPlus.api.damage;
+import gtPlusPlus.core.world.damage.BaseCustomDamageSource;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IChatComponent;
-import gtPlusPlus.core.world.damage.BaseCustomDamageSource;
-
-public class DamageTeslaTower extends BaseCustomDamageSource{
+public class DamageTeslaTower extends BaseCustomDamageSource {
- public DamageTeslaTower(Entity transmitter) {
- super("plasmabolt", transmitter, null);
- this.setDamageBypassesArmor();
- this.setDamageIsAbsolute();
- }
-
- @Override
- public IChatComponent func_151519_b(EntityLivingBase target) {
- String s = "death.attack." + this.damageType;
- return new ChatComponentTranslation(s, target.getCommandSenderName(), "Plasma");
- }
+ public DamageTeslaTower(Entity transmitter) {
+ super("plasmabolt", transmitter, null);
+ this.setDamageBypassesArmor();
+ this.setDamageIsAbsolute();
+ }
+ @Override
+ public IChatComponent func_151519_b(EntityLivingBase target) {
+ String s = "death.attack." + this.damageType;
+ return new ChatComponentTranslation(s, target.getCommandSenderName(), "Plasma");
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/enums/ParticleNames.java b/src/main/java/gtPlusPlus/api/enums/ParticleNames.java
index d082cd6779..335442dbc7 100644
--- a/src/main/java/gtPlusPlus/api/enums/ParticleNames.java
+++ b/src/main/java/gtPlusPlus/api/enums/ParticleNames.java
@@ -1,37 +1,35 @@
package gtPlusPlus.api.enums;
public enum ParticleNames {
-
- explode,
- largeexplode,
- hugeexplosion,
- bubble,
- splash,
- suspended,
- depthsuspend,
- crit,
- magicCrit,
- smoke,
- largesmoke,
- spell,
- instantSpell,
- mobSpell,
- dripWater,
- dripLava,
- townaura,
- note,
- portal,
- enchantmenttable,
- flame,
- lava,
- footstep,
- cloud,
- reddust,
- snowballpoof,
- snowshovel,
- slime,
- heart,
- iconcrack_,
- tilecrack_;
-
+ explode,
+ largeexplode,
+ hugeexplosion,
+ bubble,
+ splash,
+ suspended,
+ depthsuspend,
+ crit,
+ magicCrit,
+ smoke,
+ largesmoke,
+ spell,
+ instantSpell,
+ mobSpell,
+ dripWater,
+ dripLava,
+ townaura,
+ note,
+ portal,
+ enchantmenttable,
+ flame,
+ lava,
+ footstep,
+ cloud,
+ reddust,
+ snowballpoof,
+ snowshovel,
+ slime,
+ heart,
+ iconcrack_,
+ tilecrack_;
}
diff --git a/src/main/java/gtPlusPlus/api/enums/Quality.java b/src/main/java/gtPlusPlus/api/enums/Quality.java
index 050f335b5e..d6f0667e20 100644
--- a/src/main/java/gtPlusPlus/api/enums/Quality.java
+++ b/src/main/java/gtPlusPlus/api/enums/Quality.java
@@ -1,62 +1,65 @@
package gtPlusPlus.api.enums;
-import net.minecraft.util.EnumChatFormatting;
-
import gtPlusPlus.core.util.math.MathUtils;
+import net.minecraft.util.EnumChatFormatting;
public enum Quality {
- // Magic Blue
- // Rare Yellow
- // Set Green
- // Unique Gold/Purple
- // Trade-off Brown
-
- POOR("Poor", EnumChatFormatting.GRAY), COMMON("Common", EnumChatFormatting.WHITE), UNCOMMON("Uncommon",
- EnumChatFormatting.DARK_GREEN), MAGIC("Magic", EnumChatFormatting.BLUE), RARE("Rare",
- EnumChatFormatting.YELLOW), UNIQUE("Unique", EnumChatFormatting.GOLD), ARTIFACT("Artifact",
- EnumChatFormatting.AQUA), SET("Set Piece", EnumChatFormatting.GREEN), TRADEOFF("Trade-off",
- EnumChatFormatting.DARK_RED), EPIC("Epic", EnumChatFormatting.LIGHT_PURPLE);
-
- private String LOOT;
- private EnumChatFormatting COLOUR;
-
- private Quality(final String lootTier, final EnumChatFormatting tooltipColour) {
- this.LOOT = lootTier;
- this.COLOUR = tooltipColour;
- }
-
- public String getQuality() {
- return this.LOOT;
- }
-
- protected EnumChatFormatting getColour() {
- return this.COLOUR;
- }
-
- public String formatted() {
- return this.COLOUR + this.LOOT;
- }
-
- public static Quality getRandomQuality() {
- final int lootChance = MathUtils.randInt(0, 100);
- if (lootChance <= 10) {
- return Quality.POOR;
- } else if (lootChance <= 45) {
- return Quality.COMMON;
- } else if (lootChance <= 65) {
- return Quality.UNCOMMON;
- } else if (lootChance <= 82) {
- return Quality.MAGIC;
- } else if (lootChance <= 92) {
- return Quality.EPIC;
- } else if (lootChance <= 97) {
- return Quality.RARE;
- } else if (lootChance <= 99) {
- return Quality.ARTIFACT;
- } else {
- return null;
- }
- }
+ // Magic Blue
+ // Rare Yellow
+ // Set Green
+ // Unique Gold/Purple
+ // Trade-off Brown
+
+ POOR("Poor", EnumChatFormatting.GRAY),
+ COMMON("Common", EnumChatFormatting.WHITE),
+ UNCOMMON("Uncommon", EnumChatFormatting.DARK_GREEN),
+ MAGIC("Magic", EnumChatFormatting.BLUE),
+ RARE("Rare", EnumChatFormatting.YELLOW),
+ UNIQUE("Unique", EnumChatFormatting.GOLD),
+ ARTIFACT("Artifact", EnumChatFormatting.AQUA),
+ SET("Set Piece", EnumChatFormatting.GREEN),
+ TRADEOFF("Trade-off", EnumChatFormatting.DARK_RED),
+ EPIC("Epic", EnumChatFormatting.LIGHT_PURPLE);
+
+ private String LOOT;
+ private EnumChatFormatting COLOUR;
+
+ private Quality(final String lootTier, final EnumChatFormatting tooltipColour) {
+ this.LOOT = lootTier;
+ this.COLOUR = tooltipColour;
+ }
+
+ public String getQuality() {
+ return this.LOOT;
+ }
+
+ protected EnumChatFormatting getColour() {
+ return this.COLOUR;
+ }
+
+ public String formatted() {
+ return this.COLOUR + this.LOOT;
+ }
+ public static Quality getRandomQuality() {
+ final int lootChance = MathUtils.randInt(0, 100);
+ if (lootChance <= 10) {
+ return Quality.POOR;
+ } else if (lootChance <= 45) {
+ return Quality.COMMON;
+ } else if (lootChance <= 65) {
+ return Quality.UNCOMMON;
+ } else if (lootChance <= 82) {
+ return Quality.MAGIC;
+ } else if (lootChance <= 92) {
+ return Quality.EPIC;
+ } else if (lootChance <= 97) {
+ return Quality.RARE;
+ } else if (lootChance <= 99) {
+ return Quality.ARTIFACT;
+ } else {
+ return null;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java b/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
index 5cf323c7e2..99e14cae01 100644
--- a/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
+++ b/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
@@ -1,7 +1,5 @@
package gtPlusPlus.api.helpers;
-import java.util.HashMap;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.WeightedCollection;
import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour;
@@ -9,205 +7,198 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG;
import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler;
+import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
public class GregtechPlusPlus_API {
-
-
- public static class MolecularTransformer_API {
-
- public static boolean addRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU) {
- return CORE.RA.addMolecularTransformerRecipe(aInput, aOutput, aDuration, aEU, 1);
- }
-
- }
-
- public static class Multiblock_API {
-
- private static final HashMap<String, SpecialMultiBehaviour> mSpecialBehaviourItemMap = new HashMap<String, SpecialMultiBehaviour>();
-
- /**
- * Register a special behaviour for GT++ Multis to listen use.
- * @param aBehaviour - An Object which has extended {@link SpecialMultiBehaviour}'s base implementation.
- * @return - Did this behaviour register properly?
- */
- public static boolean registerSpecialMultiBehaviour(SpecialMultiBehaviour aBehaviour) {
- if (aBehaviour.getTriggerItem() == null || aBehaviour.getTriggerItemTooltip() == null || aBehaviour.getTriggerItemTooltip().length() <= 0) {
- Logger.INFO("Failed to attach custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem()));
- return false;
- }
- mSpecialBehaviourItemMap.put("UniqueKey_"+aBehaviour.hashCode(), aBehaviour);
- SpecialBehaviourTooltipHandler.addTooltipForItem(aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip());
- Logger.INFO("Attached custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem()));
- return true;
- }
-
- public static final HashMap<String, SpecialMultiBehaviour> getSpecialBehaviourItemMap() {
- return mSpecialBehaviourItemMap;
- }
-
- /**
- * Allows RTG Fuel pellets from other mods to be used in the RTG hatch.
- * @param aStack - The Pellet Stack, sanitsed after passing through.
- * @param aFuelValue - The Fuel Value of the Pellet to be added to the energy storage.
- * @return - Did register?
- */
- public static boolean registerPelletForRtgHatch(ItemStack aStack, long aFuelValue) {
- return GT_MetaTileEntity_Hatch_Energy_RTG.registerPelletForHatch(aStack, aFuelValue);
- }
-
- }
-
- public static class VoidMiner_API {
-
- private static final HashMap<Integer, HashMap<String, WeightedCollection<Block>>> mMinerLootCache;
-
- static {
- mMinerLootCache = new HashMap<Integer, HashMap<String, WeightedCollection<Block>>>();
- }
-
-
- /**
- *
- * Registers an ore block for a dimension. Uses a default weight of 100.
- * @param aDim - The Dimension ID
- * @param aOredictName - The OreDict name of the Ore to be mined.
- * @return - If there was a valid Block found in the OreDict for the provided name.
- */
- public static boolean registerOreForVoidMiner(int aDim, String aOredictName) {
- return registerOreForVoidMiner(aDim, aOredictName, 100);
- }
-
- /**
- *
- * Registers an ore block for a dimension. Uses a default weight of 100.
- * @param aDim - The Dimension ID
- * @param aOredictName - The OreDict name of the Ore to be mined.
- * @param aWeight - The weight of this ore Block.
- * @return - If there was a valid Block found in the OreDict for the provided name.
- */
- public static boolean registerOreForVoidMiner(int aDim, String aOredictName, int aWeight) {
- Block b = null;
- ItemStack[] aValidItems = ItemUtils.validItemsForOreDict(aOredictName);
- for (ItemStack g : aValidItems) {
- if (g != null) {
- b = Block.getBlockFromItem(g.getItem());
- if (b != null) {
- break;
- }
- }
- }
- if (b != null) {
- registerOreForVoidMiner(aDim, b, aWeight);
- return true;
- }
- return false;
- }
-
-
- /**
- * Registers an ore block for a dimension. Uses a default weight of 100.
- * @param aDim - The Dimension ID
- * @param aOreBlock - The Ore Block to be mined.
- */
- public static void registerOreForVoidMiner(int aDim, Block aOreBlock) {
- registerOreForVoidMiner(aDim, aOreBlock, 100);
- }
-
- /**
- * Registers an ore block for a dimension.
- * @param aDim - The Dimension ID
- * @param aOreBlock - The Ore Block to be mined.
- * @param aWeight - The weight of this ore Block.
- */
- public static void registerOreForVoidMiner(int aDim, Block aOreBlock, int aWeight) {
- GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aOreBlock, aWeight);
- }
-
- /**
- * Registers a surface block for a dimension. Uses a default weight of 100.
- * @param aDim - The Dimension ID
- * @param aDirtBlock - The Dirt/Grass Block to be mined.
- */
- public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock) {
- registerEarthSurfaceForVoidMiner(aDim, aDirtBlock, 100);
- }
-
- /**
- * Registers a surface block for a dimension.
- * @param aDim - The Dimension ID
- * @param aDirtBlock - The Dirt/Grass Block to be mined.
- * @param aWeight - The weight of this Dirt/Grass Block.
- */
- public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock, int aWeight) {
- GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aDirtBlock, aWeight);
- }
-
- /**
- * Registers a stone block for a dimension. Uses a default weight of 100.
- * @param aDim - The Dimension ID
- * @param aStoneBlock - The Stone Block to be mined.
- */
- public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock) {
- registerEarthStoneForVoidMiner(aDim, aStoneBlock, 100);
- }
-
- /**
- * Registers a stone block for a dimension.
- * @param aDim - The Dimension ID
- * @param aStoneBlock - The Stone Block to be mined.
- * @param aWeight - The weight of this Stone Block.
- */
- public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock, int aWeight) {
- GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aStoneBlock, aWeight);
- }
-
-
-
-
- public static WeightedCollection<Block> getAllRegisteredOresForDimension(int aDim) {
- return mMinerLootCache.get(aDim).get("ore");
- }
-
- public static WeightedCollection<Block> getAllRegisteredDirtTypesForDimension(int aDim) {
- return mMinerLootCache.get(aDim).get("dirt");
- }
-
- public static WeightedCollection<Block> getAllRegisteredStoneTypesForDimension(int aDim) {
- return mMinerLootCache.get(aDim).get("stone");
- }
-
- public static final HashMap<Integer, HashMap<String, WeightedCollection<Block>>> getVoidMinerLootCache() {
- return mMinerLootCache;
- }
-
- }
-
-
- private static class GregtechPlusPlus_API_Internal {
-
- private static void writeBlockToDimensionInCache(int aDim, int aType, Block aBlock, int aWeight) {
- HashMap<String, WeightedCollection<Block>> aDimMap = VoidMiner_API.mMinerLootCache.get(aDim);
- if (aDimMap == null) {
- aDimMap = new HashMap<String, WeightedCollection<Block>>();
- }
- WeightedCollection<Block> aMappedBlocks = getBlockMap(aType, aDimMap);
- aMappedBlocks.put(aWeight, aBlock);
-
- }
-
- private static WeightedCollection<Block> getBlockMap(int aType, HashMap<String, WeightedCollection<Block>> aDimMap){
- WeightedCollection<Block> aMappedBlocks;
- String aTypeName = ((aType == 0) ? "ore" : (aType == 1) ? "dirt" : (aType == 2) ? "stone" : "error");
- aMappedBlocks = aDimMap.get(aTypeName);
- if (aMappedBlocks == null) {
- aMappedBlocks = new WeightedCollection<Block>();
- }
- return aMappedBlocks;
- }
-
- }
-
+ public static class MolecularTransformer_API {
+
+ public static boolean addRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU) {
+ return CORE.RA.addMolecularTransformerRecipe(aInput, aOutput, aDuration, aEU, 1);
+ }
+ }
+
+ public static class Multiblock_API {
+
+ private static final HashMap<String, SpecialMultiBehaviour> mSpecialBehaviourItemMap =
+ new HashMap<String, SpecialMultiBehaviour>();
+
+ /**
+ * Register a special behaviour for GT++ Multis to listen use.
+ * @param aBehaviour - An Object which has extended {@link SpecialMultiBehaviour}'s base implementation.
+ * @return - Did this behaviour register properly?
+ */
+ public static boolean registerSpecialMultiBehaviour(SpecialMultiBehaviour aBehaviour) {
+ if (aBehaviour.getTriggerItem() == null
+ || aBehaviour.getTriggerItemTooltip() == null
+ || aBehaviour.getTriggerItemTooltip().length() <= 0) {
+ Logger.INFO("Failed to attach custom multiblock logic to "
+ + ItemUtils.getItemName(aBehaviour.getTriggerItem()));
+ return false;
+ }
+ mSpecialBehaviourItemMap.put("UniqueKey_" + aBehaviour.hashCode(), aBehaviour);
+ SpecialBehaviourTooltipHandler.addTooltipForItem(
+ aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip());
+ Logger.INFO("Attached custom multiblock logic to " + ItemUtils.getItemName(aBehaviour.getTriggerItem()));
+ return true;
+ }
+
+ public static final HashMap<String, SpecialMultiBehaviour> getSpecialBehaviourItemMap() {
+ return mSpecialBehaviourItemMap;
+ }
+
+ /**
+ * Allows RTG Fuel pellets from other mods to be used in the RTG hatch.
+ * @param aStack - The Pellet Stack, sanitsed after passing through.
+ * @param aFuelValue - The Fuel Value of the Pellet to be added to the energy storage.
+ * @return - Did register?
+ */
+ public static boolean registerPelletForRtgHatch(ItemStack aStack, long aFuelValue) {
+ return GT_MetaTileEntity_Hatch_Energy_RTG.registerPelletForHatch(aStack, aFuelValue);
+ }
+ }
+
+ public static class VoidMiner_API {
+
+ private static final HashMap<Integer, HashMap<String, WeightedCollection<Block>>> mMinerLootCache;
+
+ static {
+ mMinerLootCache = new HashMap<Integer, HashMap<String, WeightedCollection<Block>>>();
+ }
+
+ /**
+ *
+ * Registers an ore block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aOredictName - The OreDict name of the Ore to be mined.
+ * @return - If there was a valid Block found in the OreDict for the provided name.
+ */
+ public static boolean registerOreForVoidMiner(int aDim, String aOredictName) {
+ return registerOreForVoidMiner(aDim, aOredictName, 100);
+ }
+
+ /**
+ *
+ * Registers an ore block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aOredictName - The OreDict name of the Ore to be mined.
+ * @param aWeight - The weight of this ore Block.
+ * @return - If there was a valid Block found in the OreDict for the provided name.
+ */
+ public static boolean registerOreForVoidMiner(int aDim, String aOredictName, int aWeight) {
+ Block b = null;
+ ItemStack[] aValidItems = ItemUtils.validItemsForOreDict(aOredictName);
+ for (ItemStack g : aValidItems) {
+ if (g != null) {
+ b = Block.getBlockFromItem(g.getItem());
+ if (b != null) {
+ break;
+ }
+ }
+ }
+ if (b != null) {
+ registerOreForVoidMiner(aDim, b, aWeight);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Registers an ore block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aOreBlock - The Ore Block to be mined.
+ */
+ public static void registerOreForVoidMiner(int aDim, Block aOreBlock) {
+ registerOreForVoidMiner(aDim, aOreBlock, 100);
+ }
+
+ /**
+ * Registers an ore block for a dimension.
+ * @param aDim - The Dimension ID
+ * @param aOreBlock - The Ore Block to be mined.
+ * @param aWeight - The weight of this ore Block.
+ */
+ public static void registerOreForVoidMiner(int aDim, Block aOreBlock, int aWeight) {
+ GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aOreBlock, aWeight);
+ }
+
+ /**
+ * Registers a surface block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aDirtBlock - The Dirt/Grass Block to be mined.
+ */
+ public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock) {
+ registerEarthSurfaceForVoidMiner(aDim, aDirtBlock, 100);
+ }
+
+ /**
+ * Registers a surface block for a dimension.
+ * @param aDim - The Dimension ID
+ * @param aDirtBlock - The Dirt/Grass Block to be mined.
+ * @param aWeight - The weight of this Dirt/Grass Block.
+ */
+ public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock, int aWeight) {
+ GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aDirtBlock, aWeight);
+ }
+
+ /**
+ * Registers a stone block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aStoneBlock - The Stone Block to be mined.
+ */
+ public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock) {
+ registerEarthStoneForVoidMiner(aDim, aStoneBlock, 100);
+ }
+
+ /**
+ * Registers a stone block for a dimension.
+ * @param aDim - The Dimension ID
+ * @param aStoneBlock - The Stone Block to be mined.
+ * @param aWeight - The weight of this Stone Block.
+ */
+ public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock, int aWeight) {
+ GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aStoneBlock, aWeight);
+ }
+
+ public static WeightedCollection<Block> getAllRegisteredOresForDimension(int aDim) {
+ return mMinerLootCache.get(aDim).get("ore");
+ }
+
+ public static WeightedCollection<Block> getAllRegisteredDirtTypesForDimension(int aDim) {
+ return mMinerLootCache.get(aDim).get("dirt");
+ }
+
+ public static WeightedCollection<Block> getAllRegisteredStoneTypesForDimension(int aDim) {
+ return mMinerLootCache.get(aDim).get("stone");
+ }
+
+ public static final HashMap<Integer, HashMap<String, WeightedCollection<Block>>> getVoidMinerLootCache() {
+ return mMinerLootCache;
+ }
+ }
+
+ private static class GregtechPlusPlus_API_Internal {
+
+ private static void writeBlockToDimensionInCache(int aDim, int aType, Block aBlock, int aWeight) {
+ HashMap<String, WeightedCollection<Block>> aDimMap = VoidMiner_API.mMinerLootCache.get(aDim);
+ if (aDimMap == null) {
+ aDimMap = new HashMap<String, WeightedCollection<Block>>();
+ }
+ WeightedCollection<Block> aMappedBlocks = getBlockMap(aType, aDimMap);
+ aMappedBlocks.put(aWeight, aBlock);
+ }
+
+ private static WeightedCollection<Block> getBlockMap(
+ int aType, HashMap<String, WeightedCollection<Block>> aDimMap) {
+ WeightedCollection<Block> aMappedBlocks;
+ String aTypeName = ((aType == 0) ? "ore" : (aType == 1) ? "dirt" : (aType == 2) ? "stone" : "error");
+ aMappedBlocks = aDimMap.get(aTypeName);
+ if (aMappedBlocks == null) {
+ aMappedBlocks = new WeightedCollection<Block>();
+ }
+ return aMappedBlocks;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java b/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java
index 9d2e894d99..3f14a9de03 100644
--- a/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java
+++ b/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java
@@ -1,76 +1,103 @@
package gtPlusPlus.api.helpers;
-import net.minecraft.item.ItemStack;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import net.minecraft.item.ItemStack;
public class MaterialHelper {
- public static ItemStack getComponentFromMaterial(OrePrefixes oreprefix, Material material, int amount){
- return ItemUtils.getOrePrefixStack(oreprefix, material, amount);
- }
- public static ItemStack getComponentFromGtMaterial(OrePrefixes oreprefix, Materials material, int amount){
- return ItemUtils.getGregtechOreStack(oreprefix, material, amount);
- }
-
- /**
- * Generates a 16 Fluid Pipe
- * @see {@code Example: Copper 16x Pipe (Materials.Copper, Materials.Copper.mName, "Copper", ID, 60, 1000, true)}
- * @param aMaterial - Pipe Material
- * @param name - Pipe Internal name
- * @param displayName - Pipe Display Name
- * @param aID - Pipe's Meta ID
- * @param baseCapacity - Pipes Base Capacity
- * @param heatCapacity - Pipe Max Temp
- * @param gasProof - Is Gas Proof?
- * @return A boolean which corresponds to whether or not the Pipe was registered to the Ore Dictionary.
- */
- public static boolean generateHexadecuplePipe(Materials aMaterial, String name, String displayName, int aID,
- int baseCapacity, int heatCapacity, boolean gasProof) {
- if (Utils.getGregtechVersionAsInt() >= 50930) {
- try {
- Class<GT_MetaPipeEntity_Fluid> aPipeEntity = GT_MetaPipeEntity_Fluid.class;
- Constructor<GT_MetaPipeEntity_Fluid> constructor = aPipeEntity
- .getConstructor(new Class[] { int.class, String.class, String.class, float.class,
- Materials.class, int.class, int.class, boolean.class, int.class });
- if (constructor != null) {
- GT_MetaPipeEntity_Fluid aPipe;
- aPipe = constructor.newInstance(aID, "GT_Pipe_" + name + "_Hexadecuple",
- "Hexadecuple " + displayName + " Fluid Pipe", 1.0F, aMaterial, baseCapacity, heatCapacity,
- gasProof, 16);
- return GT_OreDictUnificator.registerOre("pipeHexadecuple" + aMaterial, aPipe.getStackForm(1L));
- }
+ public static ItemStack getComponentFromMaterial(OrePrefixes oreprefix, Material material, int amount) {
+ return ItemUtils.getOrePrefixStack(oreprefix, material, amount);
+ }
+
+ public static ItemStack getComponentFromGtMaterial(OrePrefixes oreprefix, Materials material, int amount) {
+ return ItemUtils.getGregtechOreStack(oreprefix, material, amount);
+ }
+
+ /**
+ * Generates a 16 Fluid Pipe
+ * @see {@code Example: Copper 16x Pipe (Materials.Copper, Materials.Copper.mName, "Copper", ID, 60, 1000, true)}
+ * @param aMaterial - Pipe Material
+ * @param name - Pipe Internal name
+ * @param displayName - Pipe Display Name
+ * @param aID - Pipe's Meta ID
+ * @param baseCapacity - Pipes Base Capacity
+ * @param heatCapacity - Pipe Max Temp
+ * @param gasProof - Is Gas Proof?
+ * @return A boolean which corresponds to whether or not the Pipe was registered to the Ore Dictionary.
+ */
+ public static boolean generateHexadecuplePipe(
+ Materials aMaterial,
+ String name,
+ String displayName,
+ int aID,
+ int baseCapacity,
+ int heatCapacity,
+ boolean gasProof) {
+ if (Utils.getGregtechVersionAsInt() >= 50930) {
+ try {
+ Class<GT_MetaPipeEntity_Fluid> aPipeEntity = GT_MetaPipeEntity_Fluid.class;
+ Constructor<GT_MetaPipeEntity_Fluid> constructor = aPipeEntity.getConstructor(new Class[] {
+ int.class,
+ String.class,
+ String.class,
+ float.class,
+ Materials.class,
+ int.class,
+ int.class,
+ boolean.class,
+ int.class
+ });
+ if (constructor != null) {
+ GT_MetaPipeEntity_Fluid aPipe;
+ aPipe = constructor.newInstance(
+ aID,
+ "GT_Pipe_" + name + "_Hexadecuple",
+ "Hexadecuple " + displayName + " Fluid Pipe",
+ 1.0F,
+ aMaterial,
+ baseCapacity,
+ heatCapacity,
+ gasProof,
+ 16);
+ return GT_OreDictUnificator.registerOre("pipeHexadecuple" + aMaterial, aPipe.getStackForm(1L));
+ }
+
+ } catch (NoSuchMethodException
+ | SecurityException
+ | InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ }
+ }
+ return false;
+ }
+
+ public static ItemStack getCells(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.cell, aMaterial, i);
+ }
+
+ public static ItemStack getDust(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.dust, aMaterial, i);
+ }
+
+ public static ItemStack getDustSmall(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.dustSmall, aMaterial, i);
+ }
+
+ public static ItemStack getDustTiny(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.dustTiny, aMaterial, i);
+ }
- } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
- | IllegalArgumentException | InvocationTargetException e) {
- }
- }
- return false;
- }
-
- public static ItemStack getCells(Materials aMaterial, int i) {
- return ItemUtils.getOrePrefixStack(OrePrefixes.cell, aMaterial, i);
- }
- public static ItemStack getDust(Materials aMaterial, int i) {
- return ItemUtils.getOrePrefixStack(OrePrefixes.dust, aMaterial, i);
- }
- public static ItemStack getDustSmall(Materials aMaterial, int i) {
- return ItemUtils.getOrePrefixStack(OrePrefixes.dustSmall, aMaterial, i);
- }
- public static ItemStack getDustTiny(Materials aMaterial, int i) {
- return ItemUtils.getOrePrefixStack(OrePrefixes.dustTiny, aMaterial, i);
- }
- public static ItemStack getGems(Materials aMaterial, int i) {
- return ItemUtils.getOrePrefixStack(OrePrefixes.gem, aMaterial, i);
- }
+ public static ItemStack getGems(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.gem, aMaterial, i);
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java b/src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java
index c04e25f570..ad65c03429 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java
@@ -1,33 +1,31 @@
package gtPlusPlus.api.interfaces;
import java.util.Set;
-
import net.minecraft.world.ChunkCoordIntPair;
public interface IChunkLoader {
- public long getTicksRemaining();
-
- public void setTicksRemaining(long aTicks);
-
- public ChunkCoordIntPair getResidingChunk();
-
- public void setResidingChunk(ChunkCoordIntPair aCurrentChunk);
-
- public boolean getChunkLoadingActive();
-
- public void setChunkLoadingActive(boolean aActive);
-
- public boolean getDoesWorkChunkNeedReload();
-
- public void setDoesWorkChunkNeedReload(boolean aActive);
-
- public boolean addChunkToLoadedList(ChunkCoordIntPair aActiveChunk);
-
- public boolean removeChunkFromLoadedList(ChunkCoordIntPair aActiveChunk);
-
- public Set<ChunkCoordIntPair> getManagedChunks();
-
- public int getChunkloaderTier();
-
+ public long getTicksRemaining();
+
+ public void setTicksRemaining(long aTicks);
+
+ public ChunkCoordIntPair getResidingChunk();
+
+ public void setResidingChunk(ChunkCoordIntPair aCurrentChunk);
+
+ public boolean getChunkLoadingActive();
+
+ public void setChunkLoadingActive(boolean aActive);
+
+ public boolean getDoesWorkChunkNeedReload();
+
+ public void setDoesWorkChunkNeedReload(boolean aActive);
+
+ public boolean addChunkToLoadedList(ChunkCoordIntPair aActiveChunk);
+
+ public boolean removeChunkFromLoadedList(ChunkCoordIntPair aActiveChunk);
+
+ public Set<ChunkCoordIntPair> getManagedChunks();
+
+ public int getChunkloaderTier();
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java b/src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java
index ddbf9f38bb..830b34a41d 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java
@@ -1,8 +1,5 @@
package gtPlusPlus.api.interfaces;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GTPP_Recipe;
-public interface IComparableRecipe extends Comparable<GT_Recipe>{
-
-}
+public interface IComparableRecipe extends Comparable<GT_Recipe> {}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java b/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java
index 5ab90d47ce..9e3ea89606 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java
@@ -1,21 +1,19 @@
package gtPlusPlus.api.interfaces;
+import gtPlusPlus.api.objects.minecraft.BlockPos;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-
public interface IEntityCatcher {
- public boolean hasEntity(ItemStack aStack);
-
- public Entity getStoredEntity(World aWorld, ItemStack aStack);
-
- public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity);
-
- public Class<? extends Entity> getStoredEntityClass(ItemStack aStack);
-
- public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos);
-
+ public boolean hasEntity(ItemStack aStack);
+
+ public Entity getStoredEntity(World aWorld, ItemStack aStack);
+
+ public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity);
+
+ public Class<? extends Entity> getStoredEntityClass(ItemStack aStack);
+
+ public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos);
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java b/src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java
index 63f2adbba7..251eaa416c 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java
@@ -3,15 +3,14 @@ package gtPlusPlus.api.interfaces;
import java.util.Random;
import net.minecraft.world.World;
-public abstract interface IGeneratorWorld
-{
- public abstract boolean generate(World paramWorld, Random paramRandom, int paramInt1, int paramInt2);
-
- public abstract void initiate();
-
- public abstract int getExtentX();
-
- public abstract int getExtentZ();
-
- public abstract int getRange();
+public abstract interface IGeneratorWorld {
+ public abstract boolean generate(World paramWorld, Random paramRandom, int paramInt1, int paramInt2);
+
+ public abstract void initiate();
+
+ public abstract int getExtentX();
+
+ public abstract int getExtentZ();
+
+ public abstract int getRange();
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IGregtechPacketEntity.java b/src/main/java/gtPlusPlus/api/interfaces/IGregtechPacketEntity.java
index fa59c58d9f..4a41e47a7b 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/IGregtechPacketEntity.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/IGregtechPacketEntity.java
@@ -6,8 +6,7 @@ import java.io.IOException;
public interface IGregtechPacketEntity {
- public void writePacketData(DataOutputStream data) throws IOException;
+ public void writePacketData(DataOutputStream data) throws IOException;
- public void readPacketData(DataInputStream data) throws IOException;
-
+ public void readPacketData(DataInputStream data) throws IOException;
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java b/src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java
index 4bb29b3354..b4223fb558 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java
@@ -1,145 +1,143 @@
package gtPlusPlus.api.interfaces;
+import gregtech.api.interfaces.IDescribable;
+import gregtech.api.interfaces.tileentity.*;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import gregtech.api.interfaces.IDescribable;
-import gregtech.api.interfaces.tileentity.*;
+public abstract interface IGregtechPower
+ extends IGearEnergyTileEntity, ITurnable, IGregTechDeviceInformation, IDescribable, IBasicEnergyContainer {
-public abstract interface IGregtechPower extends IGearEnergyTileEntity, ITurnable, IGregTechDeviceInformation, IDescribable, IBasicEnergyContainer {
+ @Override
+ public String[] getDescription();
- @Override
- public String[] getDescription();
+ @Override
+ default boolean isUniversalEnergyStored(long p0) {
+ return false;
+ }
- @Override
- default boolean isUniversalEnergyStored(long p0) {
- return false;
- }
+ @Override
+ public long getOutputAmperage();
- @Override
- public long getOutputAmperage();
+ @Override
+ public long getOutputVoltage();
- @Override
- public long getOutputVoltage();
+ @Override
+ public long getInputAmperage();
- @Override
- public long getInputAmperage();
+ @Override
+ public long getInputVoltage();
- @Override
- public long getInputVoltage();
+ @Override
+ public boolean decreaseStoredEnergyUnits(long p0, boolean p1);
- @Override
- public boolean decreaseStoredEnergyUnits(long p0, boolean p1);
+ @Override
+ public boolean increaseStoredEnergyUnits(long p0, boolean p1);
- @Override
- public boolean increaseStoredEnergyUnits(long p0, boolean p1);
+ @Override
+ public boolean drainEnergyUnits(byte p0, long p1, long p2);
- @Override
- public boolean drainEnergyUnits(byte p0, long p1, long p2);
+ @Override
+ public long getAverageElectricInput();
- @Override
- public long getAverageElectricInput();
+ @Override
+ public long getAverageElectricOutput();
- @Override
- public long getAverageElectricOutput();
+ @Override
+ public long getStoredEU();
- @Override
- public long getStoredEU();
+ @Override
+ public long getEUCapacity();
- @Override
- public long getEUCapacity();
+ @Override
+ public long getStoredSteam();
- @Override
- public long getStoredSteam();
+ @Override
+ public long getSteamCapacity();
- @Override
- public long getSteamCapacity();
+ @Override
+ public boolean increaseStoredSteam(long p0, boolean p1);
- @Override
- public boolean increaseStoredSteam(long p0, boolean p1);
+ @Override
+ public Block getBlockAtSide(byte p0);
- @Override
- public Block getBlockAtSide(byte p0);
+ @Override
+ public Block getBlockAtSideAndDistance(byte p0, int p1);
- @Override
- public Block getBlockAtSideAndDistance(byte p0, int p1);
+ @Override
+ public Block getBlockOffset(int p0, int p1, int p2);
- @Override
- public Block getBlockOffset(int p0, int p1, int p2);
+ @Override
+ public TileEntity getTileEntity(int p0, int p1, int p2);
-
- @Override
- public TileEntity getTileEntity(int p0, int p1, int p2);
+ @Override
+ public TileEntity getTileEntityAtSide(byte p0);
- @Override
- public TileEntity getTileEntityAtSide(byte p0);
+ @Override
+ public TileEntity getTileEntityAtSideAndDistance(byte p0, int p1);
- @Override
- public TileEntity getTileEntityAtSideAndDistance(byte p0, int p1);
+ @Override
+ public TileEntity getTileEntityOffset(int p0, int p1, int p2);
- @Override
- public TileEntity getTileEntityOffset(int p0, int p1, int p2);
+ @Override
+ public World getWorld();
- @Override
- public World getWorld();
+ @Override
+ public int getXCoord();
- @Override
- public int getXCoord();
+ @Override
+ public short getYCoord();
- @Override
- public short getYCoord();
+ @Override
+ public int getZCoord();
- @Override
- public int getZCoord();
+ @Override
+ public boolean isClientSide();
- @Override
- public boolean isClientSide();
+ @Override
+ public boolean isDead();
- @Override
- public boolean isDead();
+ @Override
+ public boolean isInvalidTileEntity();
- @Override
- public boolean isInvalidTileEntity();
+ @Override
+ public boolean isServerSide();
- @Override
- public boolean isServerSide();
+ @Override
+ public void readFromNBT(NBTTagCompound p0);
- @Override
- public void readFromNBT(NBTTagCompound p0);
+ @Override
+ public void writeToNBT(NBTTagCompound p0);
- @Override
- public void writeToNBT(NBTTagCompound p0);
-
- @Override
- public boolean acceptsRotationalEnergy(byte p0);
+ @Override
+ public boolean acceptsRotationalEnergy(byte p0);
- @Override
- public boolean injectRotationalEnergy(byte p0, long p1, long p2);
+ @Override
+ public boolean injectRotationalEnergy(byte p0, long p1, long p2);
- @Override
- public long injectEnergyUnits(byte p0, long p1, long p2);
+ @Override
+ public long injectEnergyUnits(byte p0, long p1, long p2);
- @Override
- public boolean inputEnergyFrom(byte p0);
+ @Override
+ public boolean inputEnergyFrom(byte p0);
- @Override
- public boolean outputsEnergyTo(byte p0);
+ @Override
+ public boolean outputsEnergyTo(byte p0);
- @Override
- public String[] getInfoData();
+ @Override
+ public String[] getInfoData();
- @Override
- default public boolean isGivingInformation() {
- return true;
- }
+ @Override
+ public default boolean isGivingInformation() {
+ return true;
+ }
-/* boolean onPreTick(TilePoweredGT tilePoweredGT, long mTickTimer2);
+ /* boolean onPreTick(TilePoweredGT tilePoweredGT, long mTickTimer2);
- boolean onTick(TilePoweredGT iGregTechTileEntity, long mTickTimer2);
-
- boolean onPostTick(TilePoweredGT iGregTechTileEntity, long mTickTimer2);*/
+ boolean onTick(TilePoweredGT iGregTechTileEntity, long mTickTimer2);
+ boolean onPostTick(TilePoweredGT iGregTechTileEntity, long mTickTimer2);*/
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/ILazyCoverable.java b/src/main/java/gtPlusPlus/api/interfaces/ILazyCoverable.java
index 9e1a7431db..a643c86292 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/ILazyCoverable.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/ILazyCoverable.java
@@ -5,140 +5,133 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
public interface ILazyCoverable extends ICoverable {
- @Override
- default byte getColorization() {
- return 0;
- }
-
- @Override
- default byte setColorization(byte arg0) {
- return 0;
- }
-
- @Override
- default byte getInputRedstoneSignal(byte arg0) {
- return 0;
- }
-
- @Override
- default byte getStrongestRedstone() {
- return 0;
- }
-
- @Override
- default boolean getRedstone() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- default boolean getRedstone(byte arg0) {
- return false;
- }
-
- @Override
- default boolean isUniversalEnergyStored(long arg0) {
- return false;
- }
-
- @Override
- default long getUniversalEnergyStored() {
- return 0;
- }
-
- @Override
- default long getUniversalEnergyCapacity() {
- return 0;
- }
-
- @Override
- default long getStoredSteam() {
- return 0;
- }
-
- @Override
- default long getSteamCapacity() {
- return 0;
- }
-
- @Override
- default boolean increaseStoredSteam(long arg0, boolean arg2) {
- return false;
- }
-
- @Override
- default byte getOutputRedstoneSignal(byte arg0) {
- return 0;
- }
-
- @Override
- default void setOutputRedstoneSignal(byte arg0, byte arg1) {
-
- }
-
- @Override
- default byte getStrongOutputRedstoneSignal(byte arg0) {
- return 0;
- }
-
- @Override
- default void setStrongOutputRedstoneSignal(byte arg0, byte arg1) {
-
- }
-
- @Override
- default byte getComparatorValue(byte arg0) {
- return 0;
- }
-
- @Override
- default IGregTechTileEntity getIGregTechTileEntity(int arg0, int arg1, int arg2) {
- return null;
- }
-
- @Override
- default IGregTechTileEntity getIGregTechTileEntityOffset(int arg0, int arg1, int arg2) {
- return null;
- }
-
- @Override
- default IGregTechTileEntity getIGregTechTileEntityAtSide(byte arg0) {
- return null;
- }
-
- @Override
- default IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte arg0, int arg1) {
- return null;
- }
-
- @Override
- default byte getMetaID(int arg0, int arg1, int arg2) {
- return 0;
- }
-
- @Override
- default byte getMetaIDOffset(int arg0, int arg1, int arg2) {
- return 0;
- }
-
- @Override
- default byte getMetaIDAtSide(byte arg0) {
- return 0;
- }
-
- @Override
- default byte getMetaIDAtSideAndDistance(byte arg0, int arg1) {
- return 0;
- }
-
- @Override
- default boolean isDead() {
- return false;
- }
-
- @Override
- default void setLightValue(byte arg0) {
-
- }
-
+ @Override
+ default byte getColorization() {
+ return 0;
+ }
+
+ @Override
+ default byte setColorization(byte arg0) {
+ return 0;
+ }
+
+ @Override
+ default byte getInputRedstoneSignal(byte arg0) {
+ return 0;
+ }
+
+ @Override
+ default byte getStrongestRedstone() {
+ return 0;
+ }
+
+ @Override
+ default boolean getRedstone() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ default boolean getRedstone(byte arg0) {
+ return false;
+ }
+
+ @Override
+ default boolean isUniversalEnergyStored(long arg0) {
+ return false;
+ }
+
+ @Override
+ default long getUniversalEnergyStored() {
+ return 0;
+ }
+
+ @Override
+ default long getUniversalEnergyCapacity() {
+ return 0;
+ }
+
+ @Override
+ default long getStoredSteam() {
+ return 0;
+ }
+
+ @Override
+ default long getSteamCapacity() {
+ return 0;
+ }
+
+ @Override
+ default boolean increaseStoredSteam(long arg0, boolean arg2) {
+ return false;
+ }
+
+ @Override
+ default byte getOutputRedstoneSignal(byte arg0) {
+ return 0;
+ }
+
+ @Override
+ default void setOutputRedstoneSignal(byte arg0, byte arg1) {}
+
+ @Override
+ default byte getStrongOutputRedstoneSignal(byte arg0) {
+ return 0;
+ }
+
+ @Override
+ default void setStrongOutputRedstoneSignal(byte arg0, byte arg1) {}
+
+ @Override
+ default byte getComparatorValue(byte arg0) {
+ return 0;
+ }
+
+ @Override
+ default IGregTechTileEntity getIGregTechTileEntity(int arg0, int arg1, int arg2) {
+ return null;
+ }
+
+ @Override
+ default IGregTechTileEntity getIGregTechTileEntityOffset(int arg0, int arg1, int arg2) {
+ return null;
+ }
+
+ @Override
+ default IGregTechTileEntity getIGregTechTileEntityAtSide(byte arg0) {
+ return null;
+ }
+
+ @Override
+ default IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte arg0, int arg1) {
+ return null;
+ }
+
+ @Override
+ default byte getMetaID(int arg0, int arg1, int arg2) {
+ return 0;
+ }
+
+ @Override
+ default byte getMetaIDOffset(int arg0, int arg1, int arg2) {
+ return 0;
+ }
+
+ @Override
+ default byte getMetaIDAtSide(byte arg0) {
+ return 0;
+ }
+
+ @Override
+ default byte getMetaIDAtSideAndDistance(byte arg0, int arg1) {
+ return 0;
+ }
+
+ @Override
+ default boolean isDead() {
+ return false;
+ }
+
+ @Override
+ default void setLightValue(byte arg0) {}
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java b/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java
index 67be182402..1f7991540a 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java
@@ -3,38 +3,40 @@ package gtPlusPlus.api.interfaces;
import gtPlusPlus.api.objects.Logger;
public interface IPlugin {
-
- /**
- * @return A {@link String} object which returns the {@link IPlugin}'s name.
- */
- public String getPluginName();
-
- /**
- * @return
- * A {@link String} object which returns the {@link IPlugin}'s short name.
- * This String should only contain 4 Characters.
- */
- public String getPluginAbbreviation();
-
- /**
- * @param message - A {@link String} object which holds a message to be logged to console.
- */
- default void log(String message) {
- Logger.INFO("["+getPluginAbbreviation()+"] "+message);
- }
-
- /**
- * @param message - A {@link String} object which holds a warning/error message to be logged to console.
- */
- default void logDebug(String message) {
- Logger.WARNING("["+getPluginAbbreviation()+"] "+message);
- }
-
- public boolean preInit();
- public boolean init();
- public boolean postInit();
-
- public boolean serverStart();
- public boolean serverStop();
-
+
+ /**
+ * @return A {@link String} object which returns the {@link IPlugin}'s name.
+ */
+ public String getPluginName();
+
+ /**
+ * @return
+ * A {@link String} object which returns the {@link IPlugin}'s short name.
+ * This String should only contain 4 Characters.
+ */
+ public String getPluginAbbreviation();
+
+ /**
+ * @param message - A {@link String} object which holds a message to be logged to console.
+ */
+ default void log(String message) {
+ Logger.INFO("[" + getPluginAbbreviation() + "] " + message);
+ }
+
+ /**
+ * @param message - A {@link String} object which holds a warning/error message to be logged to console.
+ */
+ default void logDebug(String message) {
+ Logger.WARNING("[" + getPluginAbbreviation() + "] " + message);
+ }
+
+ public boolean preInit();
+
+ public boolean init();
+
+ public boolean postInit();
+
+ public boolean serverStart();
+
+ public boolean serverStop();
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java b/src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java
index 233fb93d4d..b61528e4b9 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java
@@ -51,5 +51,4 @@ public interface IRandomGenerator {
* @return and int with the LSB being random
*/
public int next(int numBits);
-
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/ITexturedBlock.java b/src/main/java/gtPlusPlus/api/interfaces/ITexturedBlock.java
index 47e692bffb..815c399caf 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/ITexturedBlock.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/ITexturedBlock.java
@@ -1,14 +1,12 @@
package gtPlusPlus.api.interfaces;
-import net.minecraft.block.Block;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ITexturedTileEntity;
+import net.minecraft.block.Block;
-public interface ITexturedBlock extends ITexturedTileEntity{
+public interface ITexturedBlock extends ITexturedTileEntity {
- ITexture[] getTexture(byte side);
-
- ITexture[] getTexture(Block block, byte side);
+ ITexture[] getTexture(byte side);
+ ITexture[] getTexture(Block block, byte side);
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/ITileTooltip.java b/src/main/java/gtPlusPlus/api/interfaces/ITileTooltip.java
index 08866c2712..97c734659d 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/ITileTooltip.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/ITileTooltip.java
@@ -2,6 +2,5 @@ package gtPlusPlus.api.interfaces;
public interface ITileTooltip {
- public abstract int getTooltipID();
-
+ public abstract int getTooltipID();
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IToolable.java b/src/main/java/gtPlusPlus/api/interfaces/IToolable.java
index 24797825a9..d696585b76 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/IToolable.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/IToolable.java
@@ -2,16 +2,21 @@ package gtPlusPlus.api.interfaces;
public interface IToolable {
- public boolean isScrewdriverable();
- public boolean onScrewdriverLMB();
- public boolean onScrewdriverRMB();
-
- public boolean isWrenchable();
- public boolean onWrenchLMB();
- public boolean onWrenchRMB();
-
- public boolean isMalletable();
- public boolean onMalletLMB();
- public boolean onMalletRMB();
-
+ public boolean isScrewdriverable();
+
+ public boolean onScrewdriverLMB();
+
+ public boolean onScrewdriverRMB();
+
+ public boolean isWrenchable();
+
+ public boolean onWrenchLMB();
+
+ public boolean onWrenchRMB();
+
+ public boolean isMalletable();
+
+ public boolean onMalletLMB();
+
+ public boolean onMalletRMB();
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/RunnableWithInfo.java b/src/main/java/gtPlusPlus/api/interfaces/RunnableWithInfo.java
index 4f4b9d7acd..c9415f6155 100644
--- a/src/main/java/gtPlusPlus/api/interfaces/RunnableWithInfo.java
+++ b/src/main/java/gtPlusPlus/api/interfaces/RunnableWithInfo.java
@@ -2,11 +2,9 @@ package gtPlusPlus.api.interfaces;
public interface RunnableWithInfo<V> extends Runnable {
- public V getInfoData();
-
- default public Class<?> getInfoDataType() {
- return getInfoData().getClass();
- }
-
-
+ public V getInfoData();
+
+ public default Class<?> getInfoDataType() {
+ return getInfoData().getClass();
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/GregtechException.java b/src/main/java/gtPlusPlus/api/objects/GregtechException.java
index 916dbc4aaf..083a15f790 100644
--- a/src/main/java/gtPlusPlus/api/objects/GregtechException.java
+++ b/src/main/java/gtPlusPlus/api/objects/GregtechException.java
@@ -2,27 +2,24 @@ package gtPlusPlus.api.objects;
public class GregtechException extends Throwable {
- private static final long serialVersionUID = 3601884582161841486L;
+ private static final long serialVersionUID = 3601884582161841486L;
- public GregtechException(String aError) {
- this(aError, true);
- }
-
- public GregtechException(String aError, boolean aIsVerbose) {
- Logger.ERROR("Throwing GT++ Exception!");
- Logger.ERROR("[EXCEPTION] "+aError);
- if (aIsVerbose) {
- Logger.INFO("Throwing GT++ Exception!");
- Logger.INFO("[EXCEPTION] "+aError);
- printStackTrace();
- }
- }
-
- @Override
- public void printStackTrace() {
- super.printStackTrace();
- }
-
-
+ public GregtechException(String aError) {
+ this(aError, true);
+ }
+ public GregtechException(String aError, boolean aIsVerbose) {
+ Logger.ERROR("Throwing GT++ Exception!");
+ Logger.ERROR("[EXCEPTION] " + aError);
+ if (aIsVerbose) {
+ Logger.INFO("Throwing GT++ Exception!");
+ Logger.INFO("[EXCEPTION] " + aError);
+ printStackTrace();
+ }
+ }
+
+ @Override
+ public void printStackTrace() {
+ super.printStackTrace();
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/Logger.java b/src/main/java/gtPlusPlus/api/objects/Logger.java
index 5824c5260d..78f8ff101b 100644
--- a/src/main/java/gtPlusPlus/api/objects/Logger.java
+++ b/src/main/java/gtPlusPlus/api/objects/Logger.java
@@ -9,167 +9,151 @@ import org.apache.logging.log4j.LogManager;
public class Logger {
- public Logger(String string) {
-
- }
-
- // Logging Functions
- public static final org.apache.logging.log4j.Logger modLogger = Logger.makeLogger();
-
- // Generate GT++ Logger
- public static org.apache.logging.log4j.Logger makeLogger() {
- final org.apache.logging.log4j.Logger gtPlusPlusLogger = LogManager.getLogger("GT++");
- return gtPlusPlusLogger;
- }
-
- private static final boolean enabled = !AsmConfig.disableAllLogging;
-
- public static final org.apache.logging.log4j.Logger getLogger() {
- return modLogger;
- }
-
- // Non-Dev Comments
- public static void INFO(final String s) {
- if (enabled) {
- modLogger.info(s);
- }
- }
-
- // Non-Dev Comments
- public static void MACHINE_INFO(String s, Object... args) {
- if (enabled) {
- boolean localPlayer = CORE_Preloader.DEV_ENVIRONMENT;
- if (CORE.ConfigSwitches.MACHINE_INFO || localPlayer) {
- final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2);
- modLogger.info("Machine Info: " + s + " | " + name1, args);
- }
- }
- }
-
- // Developer Comments
- public static void WARNING(final String s) {
- if (enabled) {
- if (CORE_Preloader.DEBUG_MODE) {
- modLogger.warn(s);
- }
- }
- }
-
- // Errors
- public static void ERROR(final String s) {
- if (enabled) {
- if (CORE_Preloader.DEBUG_MODE) {
- modLogger.fatal(s);
- }
- }
- }
-
- // Developer Logger
- public static void SPECIFIC_WARNING(final String whatToLog, final String msg, final int line) {
- if (enabled) {
- // if (!CORE_Preloader.DEBUG_MODE){
- FMLLog.warning("GT++ |" + line + "| " + whatToLog + " | " + msg);
- // }
- }
- }
-
- // ASM Comments
- public static void LOG_ASM(final String s) {
- if (enabled) {
- FMLRelaunchLog.info("[Special ASM Logging] ", s);
- }
- }
-
-
-
-
-
-
-
-
-
-
- /**
- * Special Loggers
- */
-
- /**
- * Special Logger for Bee related content
- */
- public static void BEES(final String s) {
- modLogger.info("[Bees] "+s);
- }
- /**
- * Special Logger for Debugging Bee related content
- */
- public static void DEBUG_BEES(final String s) {
- if (enabled) {
- if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
- modLogger.info("[Debug][Bees] "+s);
- }
- }
- }
-
-
-
- /**
- * Special Logger for Materials related content
- */
- public static void MATERIALS(final String s) {
- if (enabled) {
- if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
- modLogger.info("[Materials] "+s);
- }
- }
- }
- /**
- * Special Logger for Debugging Materials related content
- */
- public static void DEBUG_MATERIALS(final String s) {
- if (enabled) {
- if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
- modLogger.info("[Debug][Materials] "+s);
- }
- }
- }
-
- /**
- * Special Logger for Reflection related content
- */
- public static void REFLECTION(final String s) {
- if (enabled) {
- if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
- modLogger.info("[Reflection] "+s);
- }
- }
- }
-
-
- /**
- * Special Logger for Darkworld related content
- */
- public static void WORLD(final String s) {
- if (enabled) {
- if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
- modLogger.info("[WorldGen] "+s);
- }
- }
- }
-
- public static void RECIPE(String string) {
- if (enabled) {
- if (/*CORE_Preloader.DEV_ENVIRONMENT || */CORE_Preloader.DEBUG_MODE) {
- modLogger.info("[Recipe] "+string);
- }
- }
- }
-
- public static void SPACE(final String s) {
- if (enabled) {
- modLogger.info("[Space] "+s);
- }
- }
-
-
-
+ public Logger(String string) {}
+
+ // Logging Functions
+ public static final org.apache.logging.log4j.Logger modLogger = Logger.makeLogger();
+
+ // Generate GT++ Logger
+ public static org.apache.logging.log4j.Logger makeLogger() {
+ final org.apache.logging.log4j.Logger gtPlusPlusLogger = LogManager.getLogger("GT++");
+ return gtPlusPlusLogger;
+ }
+
+ private static final boolean enabled = !AsmConfig.disableAllLogging;
+
+ public static final org.apache.logging.log4j.Logger getLogger() {
+ return modLogger;
+ }
+
+ // Non-Dev Comments
+ public static void INFO(final String s) {
+ if (enabled) {
+ modLogger.info(s);
+ }
+ }
+
+ // Non-Dev Comments
+ public static void MACHINE_INFO(String s, Object... args) {
+ if (enabled) {
+ boolean localPlayer = CORE_Preloader.DEV_ENVIRONMENT;
+ if (CORE.ConfigSwitches.MACHINE_INFO || localPlayer) {
+ final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2);
+ modLogger.info("Machine Info: " + s + " | " + name1, args);
+ }
+ }
+ }
+
+ // Developer Comments
+ public static void WARNING(final String s) {
+ if (enabled) {
+ if (CORE_Preloader.DEBUG_MODE) {
+ modLogger.warn(s);
+ }
+ }
+ }
+
+ // Errors
+ public static void ERROR(final String s) {
+ if (enabled) {
+ if (CORE_Preloader.DEBUG_MODE) {
+ modLogger.fatal(s);
+ }
+ }
+ }
+
+ // Developer Logger
+ public static void SPECIFIC_WARNING(final String whatToLog, final String msg, final int line) {
+ if (enabled) {
+ // if (!CORE_Preloader.DEBUG_MODE){
+ FMLLog.warning("GT++ |" + line + "| " + whatToLog + " | " + msg);
+ // }
+ }
+ }
+
+ // ASM Comments
+ public static void LOG_ASM(final String s) {
+ if (enabled) {
+ FMLRelaunchLog.info("[Special ASM Logging] ", s);
+ }
+ }
+
+ /**
+ * Special Loggers
+ */
+
+ /**
+ * Special Logger for Bee related content
+ */
+ public static void BEES(final String s) {
+ modLogger.info("[Bees] " + s);
+ }
+ /**
+ * Special Logger for Debugging Bee related content
+ */
+ public static void DEBUG_BEES(final String s) {
+ if (enabled) {
+ if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
+ modLogger.info("[Debug][Bees] " + s);
+ }
+ }
+ }
+
+ /**
+ * Special Logger for Materials related content
+ */
+ public static void MATERIALS(final String s) {
+ if (enabled) {
+ if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
+ modLogger.info("[Materials] " + s);
+ }
+ }
+ }
+ /**
+ * Special Logger for Debugging Materials related content
+ */
+ public static void DEBUG_MATERIALS(final String s) {
+ if (enabled) {
+ if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
+ modLogger.info("[Debug][Materials] " + s);
+ }
+ }
+ }
+
+ /**
+ * Special Logger for Reflection related content
+ */
+ public static void REFLECTION(final String s) {
+ if (enabled) {
+ if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
+ modLogger.info("[Reflection] " + s);
+ }
+ }
+ }
+
+ /**
+ * Special Logger for Darkworld related content
+ */
+ public static void WORLD(final String s) {
+ if (enabled) {
+ if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) {
+ modLogger.info("[WorldGen] " + s);
+ }
+ }
+ }
+
+ public static void RECIPE(String string) {
+ if (enabled) {
+ if (
+ /*CORE_Preloader.DEV_ENVIRONMENT || */ CORE_Preloader.DEBUG_MODE) {
+ modLogger.info("[Recipe] " + string);
+ }
+ }
+ }
+
+ public static void SPACE(final String s) {
+ if (enabled) {
+ modLogger.info("[Space] " + s);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/AutoMap.java b/src/main/java/gtPlusPlus/api/objects/data/AutoMap.java
index e04f1af03a..f0687fae4f 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/AutoMap.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/AutoMap.java
@@ -5,341 +5,336 @@ import java.util.*;
public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable, Collection<V>, Queue<V>, List<V> {
- /**
- * The Internal Map
- */
- protected final Map<Integer, V> mInternalMap;
- protected final Map<String, Integer> mInternalNameMap;
-
- /**
- * The Internal ID
- */
- private int mInternalID = 0;
- private static final long serialVersionUID = 3771412318075131790L;
-
-
- public AutoMap() {
- this(new LinkedHashMap<Integer, V>());
- }
-
- public Map<Integer, V> getMap(){
- return mInternalMap;
- }
-
- public AutoMap(Map<Integer, V> defaultMapType) {
- mInternalMap = defaultMapType;
- mInternalNameMap = new LinkedHashMap<String, Integer>();
- }
-
- /**
- * Generates an AutoMap from the List.
- * @param aList - Data to be inserted into the AutoMap.
- */
- public AutoMap(List<V> aList) {
- mInternalMap = new LinkedHashMap<Integer, V>();
- mInternalNameMap = new LinkedHashMap<String, Integer>();
- if (aList != null && aList.size() > 0) {
- for (V obj : aList) {
- add(obj);
- }
- }
- }
- /**
- * Generates an AutoMap from a Set.
- * @param aList - Data to be inserted into the AutoMap.
- */
- public AutoMap(Set<V> aList) {
- mInternalMap = new LinkedHashMap<Integer, V>();
- mInternalNameMap = new LinkedHashMap<String, Integer>();
- if (aList != null && aList.size() > 0) {
- for (V obj : aList) {
- add(obj);
- }
- }
- }
- /**
- * Generates an AutoMap from a Collection.
- * @param aList - Data to be inserted into the AutoMap.
- */
- public AutoMap(Collection<V> aList) {
- mInternalMap = new LinkedHashMap<Integer, V>();
- mInternalNameMap = new LinkedHashMap<String, Integer>();
- if (aList != null && aList.size() > 0) {
- for (V obj : aList) {
- add(obj);
- }
- }
- }
-
- /**
- * Generates an AutoMap from a Array.
- * @param aArray - Data to be inserted into the AutoMap.
- */
- public AutoMap(V[] aArray) {
- mInternalMap = new LinkedHashMap<Integer, V>();
- mInternalNameMap = new LinkedHashMap<String, Integer>();
- if (aArray != null && aArray.length > 0) {
- for (V obj : aArray) {
- add(obj);
- }
- }
- }
-
- @Override
- public Iterator<V> iterator() {
- return values().iterator();
- }
-
- public synchronized boolean setValue(V object){
- int mOriginalID = this.mInternalID;
- put(object);
- if (this.mInternalMap.get(mOriginalID).equals(object) || mOriginalID > this.mInternalID){
- return true;
- }
- else {
- return false;
- }
- }
-
- public synchronized V put(V object){
- return set(object);
- }
-
- public synchronized boolean add(V object){
- return set(object) != null;
- }
-
- public synchronized V set(V object){
- if (object == null) {
- return null;
- }
- mInternalNameMap.put(""+object.hashCode(), (mInternalID+1));
- return mInternalMap.put(mInternalID++, object);
- }
-
- public synchronized V get(int id){
- return mInternalMap.get(id);
- }
-
- public synchronized Collection<V> values(){
- return mInternalMap.values();
- }
-
- public synchronized int size(){
- return mInternalMap.size();
- }
-
- public synchronized int hashCode(){
- return mInternalMap.hashCode();
- }
-
- public synchronized boolean containsKey(int key){
- return mInternalMap.containsKey(key);
- }
-
- public synchronized boolean containsValue(V value){
- return mInternalMap.containsValue(value);
- }
-
- public synchronized boolean isEmpty(){
- return mInternalMap.isEmpty();
- }
-
- public synchronized void clear(){
- this.mInternalID = 0;
- this.mInternalMap.clear();
- this.mInternalNameMap.clear();
- return;
- }
-
- @SuppressWarnings("unchecked")
- public V[] toArray() {
- V[] toR = (V[]) java.lang.reflect.Array.newInstance(mInternalMap.get(0).getClass(), mInternalMap.size());
- for (int i = 0; i < mInternalMap.size(); i++) {
- toR[i] = mInternalMap.get(i);
- }
- return toR;
- }
-
- public synchronized final int getInternalID() {
- return mInternalID;
- }
-
- public synchronized final boolean remove(Object value) {
- value.getClass();
- if (this.mInternalMap.containsValue(value)) {
- return this.mInternalMap.remove(mInternalNameMap.get(""+value.hashCode()), value);
- }
- return false;
- }
-
- @Override
- public boolean contains(Object o) {
- for (V g : this.mInternalMap.values()) {
- if (g.equals(o)) {
- return true;
- }
- }
- return false;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <V> V[] toArray(V[] a) {
- return (V[]) toArray();
- }
-
- @Override
- public boolean containsAll(Collection<?> c) {
- boolean aTrue = true;
- for (Object g : c) {
- if (!this.contains(g)) {
- aTrue = false;
- }
- }
- return aTrue;
- }
-
- @Override
- public boolean addAll(Collection<? extends V> c) {
- boolean aTrue = true;
- for (V g : c) {
- if (!this.add(g)) {
- aTrue = false;
- }
- }
- return aTrue;
- }
-
- @Override
- public boolean removeAll(Collection<?> c) {
- boolean aTrue = true;
- for (Object g : c) {
- if (!this.remove(g)) {
- aTrue = false;
- }
- }
- return aTrue;
- }
-
- @Override
- public boolean retainAll(Collection<?> c) {
- AutoMap<?> aTempAllocation = new AutoMap<Object>();
- boolean aTrue = false;
- aTempAllocation = this;
- aTempAllocation.removeAll(c);
- aTempAllocation.clear();
- aTrue = aTempAllocation.isEmpty();
- aTempAllocation.clear();
- return aTrue;
- }
-
- @Override
- public boolean offer(V e) {
- return add(e);
- }
-
- @Override
- public V remove() {
- V y = this.get(0);
- if (remove(y))
- return y;
- else
- return null;
- }
-
- @Override
- public V poll() {
- if (this.mInternalMap.isEmpty()) {
- return null;
- }
- return remove();
- }
-
- @Override
- public V element() {
- if (this.mInternalMap.isEmpty()) {
- return null;
- }
- return this.get(0);
- }
-
- @Override
- public V peek() {
- return element();
- }
-
- @Override
- public boolean addAll(int index, Collection<? extends V> c) {
- for (V y : c) {
- add(y);
- }
- return true;
- }
-
- @Override
- public V set(int index, V element) {
- return mInternalMap.put(index, element);
- }
-
- @Override
- public void add(int index, V element) {
- add(element);
- }
-
- @Override
- public V remove(int index) {
- V h = mInternalMap.get(index);
- set(index, null);
- return h;
- }
-
- @Override
- public int indexOf(Object o) {
- int aCount = 0;
- for (V of : mInternalMap.values()) {
- if (of != o) {
- aCount++;
- continue;
- }
- else {
- return aCount;
- }
- }
- return -1;
- }
-
- @Override
- public int lastIndexOf(Object o) {
- //TODO
- return indexOf(o);
- }
-
- @Override
- public ListIterator<V> listIterator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ListIterator<V> listIterator(int index) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public List<V> subList(int fromIndex, int toIndex) {
- AutoMap<V> aNewSubList = new AutoMap<V>();
- for (int slot=fromIndex; slot<=toIndex; slot++) {
- V obj = mInternalMap.get(slot);
- if (obj == null) {
- continue;
- }
- else {
- aNewSubList.put(obj);
- }
- }
- return aNewSubList;
- }
-
+ /**
+ * The Internal Map
+ */
+ protected final Map<Integer, V> mInternalMap;
+
+ protected final Map<String, Integer> mInternalNameMap;
+
+ /**
+ * The Internal ID
+ */
+ private int mInternalID = 0;
+
+ private static final long serialVersionUID = 3771412318075131790L;
+
+ public AutoMap() {
+ this(new LinkedHashMap<Integer, V>());
+ }
+
+ public Map<Integer, V> getMap() {
+ return mInternalMap;
+ }
+
+ public AutoMap(Map<Integer, V> defaultMapType) {
+ mInternalMap = defaultMapType;
+ mInternalNameMap = new LinkedHashMap<String, Integer>();
+ }
+
+ /**
+ * Generates an AutoMap from the List.
+ * @param aList - Data to be inserted into the AutoMap.
+ */
+ public AutoMap(List<V> aList) {
+ mInternalMap = new LinkedHashMap<Integer, V>();
+ mInternalNameMap = new LinkedHashMap<String, Integer>();
+ if (aList != null && aList.size() > 0) {
+ for (V obj : aList) {
+ add(obj);
+ }
+ }
+ }
+ /**
+ * Generates an AutoMap from a Set.
+ * @param aList - Data to be inserted into the AutoMap.
+ */
+ public AutoMap(Set<V> aList) {
+ mInternalMap = new LinkedHashMap<Integer, V>();
+ mInternalNameMap = new LinkedHashMap<String, Integer>();
+ if (aList != null && aList.size() > 0) {
+ for (V obj : aList) {
+ add(obj);
+ }
+ }
+ }
+ /**
+ * Generates an AutoMap from a Collection.
+ * @param aList - Data to be inserted into the AutoMap.
+ */
+ public AutoMap(Collection<V> aList) {
+ mInternalMap = new LinkedHashMap<Integer, V>();
+ mInternalNameMap = new LinkedHashMap<String, Integer>();
+ if (aList != null && aList.size() > 0) {
+ for (V obj : aList) {
+ add(obj);
+ }
+ }
+ }
+
+ /**
+ * Generates an AutoMap from a Array.
+ * @param aArray - Data to be inserted into the AutoMap.
+ */
+ public AutoMap(V[] aArray) {
+ mInternalMap = new LinkedHashMap<Integer, V>();
+ mInternalNameMap = new LinkedHashMap<String, Integer>();
+ if (aArray != null && aArray.length > 0) {
+ for (V obj : aArray) {
+ add(obj);
+ }
+ }
+ }
+
+ @Override
+ public Iterator<V> iterator() {
+ return values().iterator();
+ }
+
+ public synchronized boolean setValue(V object) {
+ int mOriginalID = this.mInternalID;
+ put(object);
+ if (this.mInternalMap.get(mOriginalID).equals(object) || mOriginalID > this.mInternalID) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public synchronized V put(V object) {
+ return set(object);
+ }
+
+ public synchronized boolean add(V object) {
+ return set(object) != null;
+ }
+
+ public synchronized V set(V object) {
+ if (object == null) {
+ return null;
+ }
+ mInternalNameMap.put("" + object.hashCode(), (mInternalID + 1));
+ return mInternalMap.put(mInternalID++, object);
+ }
+
+ public synchronized V get(int id) {
+ return mInternalMap.get(id);
+ }
+
+ public synchronized Collection<V> values() {
+ return mInternalMap.values();
+ }
+
+ public synchronized int size() {
+ return mInternalMap.size();
+ }
+
+ public synchronized int hashCode() {
+ return mInternalMap.hashCode();
+ }
+
+ public synchronized boolean containsKey(int key) {
+ return mInternalMap.containsKey(key);
+ }
+
+ public synchronized boolean containsValue(V value) {
+ return mInternalMap.containsValue(value);
+ }
+
+ public synchronized boolean isEmpty() {
+ return mInternalMap.isEmpty();
+ }
+
+ public synchronized void clear() {
+ this.mInternalID = 0;
+ this.mInternalMap.clear();
+ this.mInternalNameMap.clear();
+ return;
+ }
+
+ @SuppressWarnings("unchecked")
+ public V[] toArray() {
+ V[] toR = (V[]) java.lang.reflect.Array.newInstance(mInternalMap.get(0).getClass(), mInternalMap.size());
+ for (int i = 0; i < mInternalMap.size(); i++) {
+ toR[i] = mInternalMap.get(i);
+ }
+ return toR;
+ }
+
+ public final synchronized int getInternalID() {
+ return mInternalID;
+ }
+
+ public final synchronized boolean remove(Object value) {
+ value.getClass();
+ if (this.mInternalMap.containsValue(value)) {
+ return this.mInternalMap.remove(mInternalNameMap.get("" + value.hashCode()), value);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ for (V g : this.mInternalMap.values()) {
+ if (g.equals(o)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <V> V[] toArray(V[] a) {
+ return (V[]) toArray();
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> c) {
+ boolean aTrue = true;
+ for (Object g : c) {
+ if (!this.contains(g)) {
+ aTrue = false;
+ }
+ }
+ return aTrue;
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends V> c) {
+ boolean aTrue = true;
+ for (V g : c) {
+ if (!this.add(g)) {
+ aTrue = false;
+ }
+ }
+ return aTrue;
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> c) {
+ boolean aTrue = true;
+ for (Object g : c) {
+ if (!this.remove(g)) {
+ aTrue = false;
+ }
+ }
+ return aTrue;
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> c) {
+ AutoMap<?> aTempAllocation = new AutoMap<Object>();
+ boolean aTrue = false;
+ aTempAllocation = this;
+ aTempAllocation.removeAll(c);
+ aTempAllocation.clear();
+ aTrue = aTempAllocation.isEmpty();
+ aTempAllocation.clear();
+ return aTrue;
+ }
+
+ @Override
+ public boolean offer(V e) {
+ return add(e);
+ }
+
+ @Override
+ public V remove() {
+ V y = this.get(0);
+ if (remove(y)) return y;
+ else return null;
+ }
+
+ @Override
+ public V poll() {
+ if (this.mInternalMap.isEmpty()) {
+ return null;
+ }
+ return remove();
+ }
+
+ @Override
+ public V element() {
+ if (this.mInternalMap.isEmpty()) {
+ return null;
+ }
+ return this.get(0);
+ }
+
+ @Override
+ public V peek() {
+ return element();
+ }
+
+ @Override
+ public boolean addAll(int index, Collection<? extends V> c) {
+ for (V y : c) {
+ add(y);
+ }
+ return true;
+ }
+
+ @Override
+ public V set(int index, V element) {
+ return mInternalMap.put(index, element);
+ }
+
+ @Override
+ public void add(int index, V element) {
+ add(element);
+ }
+
+ @Override
+ public V remove(int index) {
+ V h = mInternalMap.get(index);
+ set(index, null);
+ return h;
+ }
+
+ @Override
+ public int indexOf(Object o) {
+ int aCount = 0;
+ for (V of : mInternalMap.values()) {
+ if (of != o) {
+ aCount++;
+ continue;
+ } else {
+ return aCount;
+ }
+ }
+ return -1;
+ }
+
+ @Override
+ public int lastIndexOf(Object o) {
+ // TODO
+ return indexOf(o);
+ }
+
+ @Override
+ public ListIterator<V> listIterator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ListIterator<V> listIterator(int index) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public List<V> subList(int fromIndex, int toIndex) {
+ AutoMap<V> aNewSubList = new AutoMap<V>();
+ for (int slot = fromIndex; slot <= toIndex; slot++) {
+ V obj = mInternalMap.get(slot);
+ if (obj == null) {
+ continue;
+ } else {
+ aNewSubList.put(obj);
+ }
+ }
+ return aNewSubList;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java b/src/main/java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java
index 991908e402..1d6cad3a38 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java
@@ -5,14 +5,13 @@ import java.util.concurrent.ConcurrentMap;
public class ConcurrentHashSet<V> extends ConcurrentSet<V> {
- private static final long serialVersionUID = -1293478938482781728L;
-
- public ConcurrentHashSet() {
- this(new ConcurrentHashMap<Integer, V>());
- }
-
- public ConcurrentHashSet(ConcurrentMap<Integer, V> defaultMapType) {
- super(defaultMapType);
- }
-
+ private static final long serialVersionUID = -1293478938482781728L;
+
+ public ConcurrentHashSet() {
+ this(new ConcurrentHashMap<Integer, V>());
+ }
+
+ public ConcurrentHashSet(ConcurrentMap<Integer, V> defaultMapType) {
+ super(defaultMapType);
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/ConcurrentSet.java b/src/main/java/gtPlusPlus/api/objects/data/ConcurrentSet.java
index 1d3ffc1c01..aaa759edfa 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/ConcurrentSet.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/ConcurrentSet.java
@@ -10,14 +10,14 @@ public abstract class ConcurrentSet<E> extends AbstractSet<E> implements Seriali
private static final long serialVersionUID = -6761513279741915432L;
private final ConcurrentMap<Integer, E> mInternalMap;
-
- private int mInternalID = 0;
+
+ private int mInternalID = 0;
/**
* Creates a new instance which wraps the specified {@code map}.
- */
+ */
public ConcurrentSet(ConcurrentMap<Integer, E> aMap) {
- mInternalMap = aMap;
+ mInternalMap = aMap;
}
@Override
@@ -42,7 +42,7 @@ public abstract class ConcurrentSet<E> extends AbstractSet<E> implements Seriali
@Override
public void clear() {
- this.mInternalID = 0;
+ this.mInternalID = 0;
mInternalMap.clear();
}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/FlexiblePair.java b/src/main/java/gtPlusPlus/api/objects/data/FlexiblePair.java
index 64f57b4e5a..698e56ae45 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/FlexiblePair.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/FlexiblePair.java
@@ -1,39 +1,38 @@
package gtPlusPlus.api.objects.data;
+import com.google.common.base.Objects;
import java.io.Serializable;
-import com.google.common.base.Objects;
+public class FlexiblePair<K, V> implements Serializable {
+
+ /**
+ * SVUID
+ */
+ private static final long serialVersionUID = 1250550491092812443L;
+
+ private final K key;
+ private V value;
+
+ public FlexiblePair(final K key, final V value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public final K getKey() {
+ return this.key;
+ }
+
+ public final V getValue() {
+ return this.value;
+ }
+
+ public final void setValue(V aObj) {
+ value = aObj;
+ }
-public class FlexiblePair<K,V> implements Serializable {
-
- /**
- * SVUID
- */
- private static final long serialVersionUID = 1250550491092812443L;
- private final K key;
- private V value;
-
- public FlexiblePair(final K key, final V value){
- this.key = key;
- this.value = value;
- }
-
- final public K getKey(){
- return this.key;
- }
-
- final public V getValue(){
- return this.value;
- }
-
- final public void setValue(V aObj) {
- value = aObj;
- }
-
- @Override
- public int hashCode() {
- Integer aCode = Objects.hashCode(getKey(), getValue());
- return aCode != null ? aCode : super.hashCode();
- }
-
-} \ No newline at end of file
+ @Override
+ public int hashCode() {
+ Integer aCode = Objects.hashCode(getKey(), getValue());
+ return aCode != null ? aCode : super.hashCode();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/ObjMap.java b/src/main/java/gtPlusPlus/api/objects/data/ObjMap.java
index 49dd70d2b8..1f8a4baa2c 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/ObjMap.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/ObjMap.java
@@ -5,8 +5,7 @@ import java.util.Arrays;
/**
* Object-2-object map based on IntIntMap4a
*/
-public class ObjMap<K, V>
-{
+public class ObjMap<K, V> {
private static final Object FREE_KEY = new Object();
private static final Object REMOVED_KEY = new Object();
@@ -15,6 +14,7 @@ public class ObjMap<K, V>
/** Value for the null key (if inserted into a map) */
private Object m_nullValue;
+
private boolean m_hasNull;
/** Fill factor, must be between (0 and 1) */
@@ -28,159 +28,120 @@ public class ObjMap<K, V>
/** Mask to wrap the actual array pointer */
private int m_mask2;
- public ObjMap( final int size, final float fillFactor )
- {
- if ( fillFactor <= 0 || fillFactor >= 1 )
- throw new IllegalArgumentException( "FillFactor must be in (0, 1)" );
- if ( size <= 0 )
- throw new IllegalArgumentException( "Size must be positive!" );
+ public ObjMap(final int size, final float fillFactor) {
+ if (fillFactor <= 0 || fillFactor >= 1) throw new IllegalArgumentException("FillFactor must be in (0, 1)");
+ if (size <= 0) throw new IllegalArgumentException("Size must be positive!");
final int capacity = arraySize(size, fillFactor);
m_mask = capacity - 1;
m_mask2 = capacity * 2 - 1;
m_fillFactor = fillFactor;
m_data = new Object[capacity * 2];
- Arrays.fill( m_data, FREE_KEY );
+ Arrays.fill(m_data, FREE_KEY);
m_threshold = (int) (capacity * fillFactor);
}
@SuppressWarnings("unchecked")
- public V get( final K key )
- {
- if ( key == null )
- return (V) m_nullValue; //we null it on remove, so safe not to check a flag here
+ public V get(final K key) {
+ if (key == null) return (V) m_nullValue; // we null it on remove, so safe not to check a flag here
int ptr = (key.hashCode() & m_mask) << 1;
- Object k = m_data[ ptr ];
+ Object k = m_data[ptr];
- if ( k == FREE_KEY )
- return null; //end of chain already
- if ( k.equals( key ) ) //we check FREE and REMOVED prior to this call
- return (V) m_data[ ptr + 1 ];
- while ( true )
- {
- ptr = (ptr + 2) & m_mask2; //that's next index
- k = m_data[ ptr ];
- if ( k == FREE_KEY )
- return null;
- if ( k.equals( key ) )
- return (V) m_data[ ptr + 1 ];
+ if (k == FREE_KEY) return null; // end of chain already
+ if (k.equals(key)) // we check FREE and REMOVED prior to this call
+ return (V) m_data[ptr + 1];
+ while (true) {
+ ptr = (ptr + 2) & m_mask2; // that's next index
+ k = m_data[ptr];
+ if (k == FREE_KEY) return null;
+ if (k.equals(key)) return (V) m_data[ptr + 1];
}
}
@SuppressWarnings("unchecked")
- public V put( final K key, final V value )
- {
- if ( key == null )
- return insertNullKey(value);
+ public V put(final K key, final V value) {
+ if (key == null) return insertNullKey(value);
int ptr = getStartIndex(key) << 1;
Object k = m_data[ptr];
- if ( k == FREE_KEY ) //end of chain already
+ if (k == FREE_KEY) // end of chain already
{
- m_data[ ptr ] = key;
- m_data[ ptr + 1 ] = value;
- if ( m_size >= m_threshold )
- rehash( m_data.length * 2 ); //size is set inside
- else
- ++m_size;
+ m_data[ptr] = key;
+ m_data[ptr + 1] = value;
+ if (m_size >= m_threshold) rehash(m_data.length * 2); // size is set inside
+ else ++m_size;
return null;
- }
- else if ( k.equals( key ) ) //we check FREE and REMOVED prior to this call
+ } else if (k.equals(key)) // we check FREE and REMOVED prior to this call
{
- final Object ret = m_data[ ptr + 1 ];
- m_data[ ptr + 1 ] = value;
+ final Object ret = m_data[ptr + 1];
+ m_data[ptr + 1] = value;
return (V) ret;
}
int firstRemoved = -1;
- if ( k == REMOVED_KEY )
- firstRemoved = ptr; //we may find a key later
-
- while ( true )
- {
- ptr = ( ptr + 2 ) & m_mask2; //that's next index calculation
- k = m_data[ ptr ];
- if ( k == FREE_KEY )
- {
- if ( firstRemoved != -1 )
- ptr = firstRemoved;
- m_data[ ptr ] = key;
- m_data[ ptr + 1 ] = value;
- if ( m_size >= m_threshold )
- rehash( m_data.length * 2 ); //size is set inside
- else
- ++m_size;
+ if (k == REMOVED_KEY) firstRemoved = ptr; // we may find a key later
+
+ while (true) {
+ ptr = (ptr + 2) & m_mask2; // that's next index calculation
+ k = m_data[ptr];
+ if (k == FREE_KEY) {
+ if (firstRemoved != -1) ptr = firstRemoved;
+ m_data[ptr] = key;
+ m_data[ptr + 1] = value;
+ if (m_size >= m_threshold) rehash(m_data.length * 2); // size is set inside
+ else ++m_size;
return null;
- }
- else if ( k.equals( key ) )
- {
- final Object ret = m_data[ ptr + 1 ];
- m_data[ ptr + 1 ] = value;
+ } else if (k.equals(key)) {
+ final Object ret = m_data[ptr + 1];
+ m_data[ptr + 1] = value;
return (V) ret;
- }
- else if ( k == REMOVED_KEY )
- {
- if ( firstRemoved == -1 )
- firstRemoved = ptr;
+ } else if (k == REMOVED_KEY) {
+ if (firstRemoved == -1) firstRemoved = ptr;
}
}
}
@SuppressWarnings("unchecked")
- public V remove( final K key )
- {
- if ( key == null )
- return removeNullKey();
+ public V remove(final K key) {
+ if (key == null) return removeNullKey();
int ptr = getStartIndex(key) << 1;
- Object k = m_data[ ptr ];
- if ( k == FREE_KEY )
- return null; //end of chain already
- else if ( k.equals( key ) ) //we check FREE and REMOVED prior to this call
+ Object k = m_data[ptr];
+ if (k == FREE_KEY) return null; // end of chain already
+ else if (k.equals(key)) // we check FREE and REMOVED prior to this call
{
--m_size;
- if ( m_data[ ( ptr + 2 ) & m_mask2 ] == FREE_KEY )
- m_data[ ptr ] = FREE_KEY;
- else
- m_data[ ptr ] = REMOVED_KEY;
- final V ret = (V) m_data[ ptr + 1 ];
- m_data[ ptr + 1 ] = null;
+ if (m_data[(ptr + 2) & m_mask2] == FREE_KEY) m_data[ptr] = FREE_KEY;
+ else m_data[ptr] = REMOVED_KEY;
+ final V ret = (V) m_data[ptr + 1];
+ m_data[ptr + 1] = null;
return ret;
}
- while ( true )
- {
- ptr = ( ptr + 2 ) & m_mask2; //that's next index calculation
- k = m_data[ ptr ];
- if ( k == FREE_KEY )
- return null;
- else if ( k.equals( key ) )
- {
+ while (true) {
+ ptr = (ptr + 2) & m_mask2; // that's next index calculation
+ k = m_data[ptr];
+ if (k == FREE_KEY) return null;
+ else if (k.equals(key)) {
--m_size;
- if ( m_data[ ( ptr + 2 ) & m_mask2 ] == FREE_KEY )
- m_data[ ptr ] = FREE_KEY;
- else
- m_data[ ptr ] = REMOVED_KEY;
- final V ret = (V) m_data[ ptr + 1 ];
- m_data[ ptr + 1 ] = null;
+ if (m_data[(ptr + 2) & m_mask2] == FREE_KEY) m_data[ptr] = FREE_KEY;
+ else m_data[ptr] = REMOVED_KEY;
+ final V ret = (V) m_data[ptr + 1];
+ m_data[ptr + 1] = null;
return ret;
}
}
}
@SuppressWarnings("unchecked")
- private V insertNullKey(final V value)
- {
- if ( m_hasNull )
- {
+ private V insertNullKey(final V value) {
+ if (m_hasNull) {
final Object ret = m_nullValue;
m_nullValue = value;
return (V) ret;
- }
- else
- {
+ } else {
m_nullValue = value;
++m_size;
return null;
@@ -188,98 +149,91 @@ public class ObjMap<K, V>
}
@SuppressWarnings("unchecked")
- private V removeNullKey()
- {
- if ( m_hasNull )
- {
+ private V removeNullKey() {
+ if (m_hasNull) {
final Object ret = m_nullValue;
m_nullValue = null;
m_hasNull = false;
--m_size;
return (V) ret;
- }
- else
- {
+ } else {
return null;
}
}
- public int size()
- {
+ public int size() {
return m_size;
}
@SuppressWarnings("unchecked")
- private void rehash( final int newCapacity )
- {
- m_threshold = (int) (newCapacity/2 * m_fillFactor);
- m_mask = newCapacity/2 - 1;
+ private void rehash(final int newCapacity) {
+ m_threshold = (int) (newCapacity / 2 * m_fillFactor);
+ m_mask = newCapacity / 2 - 1;
m_mask2 = newCapacity - 1;
final int oldCapacity = m_data.length;
final Object[] oldData = m_data;
- m_data = new Object[ newCapacity ];
- Arrays.fill( m_data, FREE_KEY );
+ m_data = new Object[newCapacity];
+ Arrays.fill(m_data, FREE_KEY);
m_size = m_hasNull ? 1 : 0;
- for ( int i = 0; i < oldCapacity; i += 2 ) {
- final Object oldKey = oldData[ i ];
- if( oldKey != FREE_KEY && oldKey != REMOVED_KEY )
- put( (K)oldKey, (V)oldData[ i + 1 ]);
+ for (int i = 0; i < oldCapacity; i += 2) {
+ final Object oldKey = oldData[i];
+ if (oldKey != FREE_KEY && oldKey != REMOVED_KEY) put((K) oldKey, (V) oldData[i + 1]);
}
}
- public int getStartIndex( final Object key )
- {
- //key is not null here
+ public int getStartIndex(final Object key) {
+ // key is not null here
return key.hashCode() & m_mask;
}
-
+
public Object[] values() {
- return m_data;
+ return m_data;
}
-
+
/** Taken from FastUtil implementation */
/** Return the least power of two greater than or equal to the specified value.
- *
- * <p>Note that this function will return 1 when the argument is 0.
- *
- * @param x a long integer smaller than or equal to 2<sup>62</sup>.
- * @return the least power of two greater than or equal to the specified value.
- */
- public static long nextPowerOfTwo( long x ) {
- if ( x == 0 ) return 1;
- x--;
- x |= x >> 1;
- x |= x >> 2;
- x |= x >> 4;
- x |= x >> 8;
- x |= x >> 16;
- return ( x | x >> 32 ) + 1;
- }
+ *
+ * <p>Note that this function will return 1 when the argument is 0.
+ *
+ * @param x a long integer smaller than or equal to 2<sup>62</sup>.
+ * @return the least power of two greater than or equal to the specified value.
+ */
+ public static long nextPowerOfTwo(long x) {
+ if (x == 0) return 1;
+ x--;
+ x |= x >> 1;
+ x |= x >> 2;
+ x |= x >> 4;
+ x |= x >> 8;
+ x |= x >> 16;
+ return (x | x >> 32) + 1;
+ }
/** Returns the least power of two smaller than or equal to 2<sup>30</sup> and larger than or equal to <code>Math.ceil( expected / f )</code>.
- *
- * @param expected the expected number of elements in a hash table.
- * @param f the load factor.
- * @return the minimum possible size for a backing array.
- * @throws IllegalArgumentException if the necessary size is larger than 2<sup>30</sup>.
- */
- public static int arraySize( final int expected, final float f ) {
- final long s = Math.max( 2, nextPowerOfTwo( (long)Math.ceil( expected / f ) ) );
- if ( s > (1 << 30) ) throw new IllegalArgumentException( "Too large (" + expected + " expected elements with load factor " + f + ")" );
- return (int)s;
- }
-
- //taken from FastUtil
+ *
+ * @param expected the expected number of elements in a hash table.
+ * @param f the load factor.
+ * @return the minimum possible size for a backing array.
+ * @throws IllegalArgumentException if the necessary size is larger than 2<sup>30</sup>.
+ */
+ public static int arraySize(final int expected, final float f) {
+ final long s = Math.max(2, nextPowerOfTwo((long) Math.ceil(expected / f)));
+ if (s > (1 << 30))
+ throw new IllegalArgumentException(
+ "Too large (" + expected + " expected elements with load factor " + f + ")");
+ return (int) s;
+ }
+
+ // taken from FastUtil
private static final int INT_PHI = 0x9E3779B9;
- public static int phiMix( final int x ) {
- final int h = x * INT_PHI;
- return h ^ (h >> 16);
-}
-
+ public static int phiMix(final int x) {
+ final int h = x * INT_PHI;
+ return h ^ (h >> 16);
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/Pair.java b/src/main/java/gtPlusPlus/api/objects/data/Pair.java
index e1d23e6b43..33b2ade368 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/Pair.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/Pair.java
@@ -1,35 +1,34 @@
package gtPlusPlus.api.objects.data;
-import java.io.Serializable;
-
import com.google.common.base.Objects;
+import java.io.Serializable;
-public class Pair<K,V> implements Serializable {
+public class Pair<K, V> implements Serializable {
- /**
- * SVUID
- */
- private static final long serialVersionUID = 1250550491092812443L;
- private final K key;
- private final V value;
+ /**
+ * SVUID
+ */
+ private static final long serialVersionUID = 1250550491092812443L;
- public Pair(final K key, final V value){
- this.key = key;
- this.value = value;
- }
+ private final K key;
+ private final V value;
- final public K getKey(){
- return this.key;
- }
+ public Pair(final K key, final V value) {
+ this.key = key;
+ this.value = value;
+ }
- final public V getValue(){
- return this.value;
- }
+ public final K getKey() {
+ return this.key;
+ }
- @Override
- public int hashCode() {
- Integer aCode = Objects.hashCode(getKey(), getValue());
- return aCode != null ? aCode : super.hashCode();
- }
+ public final V getValue() {
+ return this.value;
+ }
-} \ No newline at end of file
+ @Override
+ public int hashCode() {
+ Integer aCode = Objects.hashCode(getKey(), getValue());
+ return aCode != null ? aCode : super.hashCode();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/Quad.java b/src/main/java/gtPlusPlus/api/objects/data/Quad.java
index fa2e52951e..54839ac930 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/Quad.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/Quad.java
@@ -3,43 +3,42 @@ package gtPlusPlus.api.objects.data;
import java.util.ArrayList;
import java.util.List;
-public class Quad<K,V,C,R> {
-
- private final K key;
- private final V value;
- private final C value2;
- private final R value3;
-
- public Quad(final K key, final V value, final C value2, final R value3){
- this.key = key;
- this.value = value;
- this.value2 = value2;
- this.value3 = value3;
- }
-
- final public K getKey(){
- return this.key;
- }
-
- final public V getValue_1(){
- return this.value;
- }
-
- final public C getValue_2(){
- return this.value2;
- }
-
- final public R getValue_3(){
- return this.value3;
- }
-
- public final List values() {
- List<Object> aVals = new ArrayList<Object>();
- aVals.add(key);
- aVals.add(value);
- aVals.add(value2);
- aVals.add(value3);
- return aVals;
- }
-
-} \ No newline at end of file
+public class Quad<K, V, C, R> {
+
+ private final K key;
+ private final V value;
+ private final C value2;
+ private final R value3;
+
+ public Quad(final K key, final V value, final C value2, final R value3) {
+ this.key = key;
+ this.value = value;
+ this.value2 = value2;
+ this.value3 = value3;
+ }
+
+ public final K getKey() {
+ return this.key;
+ }
+
+ public final V getValue_1() {
+ return this.value;
+ }
+
+ public final C getValue_2() {
+ return this.value2;
+ }
+
+ public final R getValue_3() {
+ return this.value3;
+ }
+
+ public final List values() {
+ List<Object> aVals = new ArrayList<Object>();
+ aVals.add(key);
+ aVals.add(value);
+ aVals.add(value2);
+ aVals.add(value3);
+ return aVals;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/ReverseAutoMap.java b/src/main/java/gtPlusPlus/api/objects/data/ReverseAutoMap.java
index 72ec0bc293..45d8074366 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/ReverseAutoMap.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/ReverseAutoMap.java
@@ -4,172 +4,169 @@ import java.util.*;
public class ReverseAutoMap<N> extends AutoMap<N> {
- /**
- * The Internal Map
- */
- private Map<N, Integer> mInternalMapReverseLookup = new HashMap<N, Integer>();
-
- /**
- * The Internal ID
- */
- private int mInternalID = 0;
- private static final long serialVersionUID = 3771412318075131790L;
-
- @Override
- public Iterator<N> iterator() {
- return values().iterator();
- }
-
- public synchronized boolean setValue(N object){
- int mOriginalID = this.mInternalID;
- put(object);
- if (this.mInternalMap.get(mOriginalID).equals(object) || mOriginalID > this.mInternalID){
- return true;
- }
- else {
- return false;
- }
- }
-
- @Override
- public synchronized N put(N object){
- return set(object);
- }
-
- @Override
- public synchronized N set(N object){
- int newID = getNextFreeMapID();
- mInternalMapReverseLookup.put(object, newID);
- return mInternalMap.put(newID, object);
- }
-
- public synchronized int putToInternalMap(N object){
- return setInternalMap(object);
- }
-
- public synchronized int setInternalMap(N object){
- int newID = getNextFreeMapID();
- mInternalMap.put(newID, object);
- mInternalMapReverseLookup.put(object, newID);
- return newID;
- }
-
- public synchronized boolean injectCleanDataToAutoMap(Integer g, N object){
- if (!mInternalMap.containsKey(g) && !mInternalMapReverseLookup.containsKey(object)) {
- int a1 = 0, a2 = 0, a11 = 0, a22 = 0;
- a1 = mInternalMap.size();
- a2 = mInternalMapReverseLookup.size();
- a11 = a1;
- a22 = a2;
- mInternalMap.put(g, object);
- a1 = mInternalMap.size();
- mInternalMapReverseLookup.put(object, g);
- a2 = mInternalMapReverseLookup.size();
- if (a1 > a11 && a2 > a22)
- return true;
- }
- return false;
- }
-
- public synchronized boolean injectDataToAutoMap(Integer g, N object){
- int a1 = 0, a2 = 0, a11 = 0, a22 = 0;
- a1 = mInternalMap.size();
- a2 = mInternalMapReverseLookup.size();
- a11 = a1;
- a22 = a2;
- mInternalMap.put(g, object);
- a1 = mInternalMap.size();
- mInternalMapReverseLookup.put(object, g);
- a2 = mInternalMapReverseLookup.size();
- if (a1 > a11 && a2 > a22)
- return true;
- return false;
- }
-
- private boolean raiseInternalID() {
- int mOld = mInternalID;
- mInternalID++;
- return mInternalID > mOld;
- }
-
- public synchronized int getNextFreeMapID() {
- if (raiseInternalID()) {
- return mInternalID;
- }
- return Short.MIN_VALUE;
- }
-
- @Override
- public synchronized N get(int id){
- return mInternalMap.get(id);
- }
-
- public synchronized int get(N key) {
- return mInternalMapReverseLookup.get(key);
- }
-
- @Override
- public synchronized Collection<N> values(){
- return mInternalMap.values();
- }
-
- public synchronized Collection<Integer> keys(){
- return mInternalMapReverseLookup.values();
- }
-
- @Override
- public synchronized int size(){
- return mInternalMap.size();
- }
-
- @Override
- public synchronized int hashCode(){
- return mInternalMap.hashCode()+mInternalMapReverseLookup.hashCode();
- }
-
- @Override
- public synchronized boolean containsKey(int key){
- return mInternalMap.containsKey(key);
- }
-
- @Override
- public synchronized boolean containsValue(N value){
- return mInternalMap.containsValue(value);
- }
-
- public synchronized boolean containsKey(N key){
- return mInternalMapReverseLookup.containsKey(key);
- }
-
- public synchronized boolean containsValue(int value){
- return mInternalMapReverseLookup.containsValue(value);
- }
-
- @Override
- public synchronized boolean isEmpty(){
- return mInternalMap.isEmpty() && mInternalMapReverseLookup.isEmpty();
- }
-
- @Override
- public synchronized void clear(){
- this.mInternalID = 0;
- this.mInternalMap.clear();
- this.mInternalMapReverseLookup.clear();
- return;
- }
-
- @Override
- public synchronized N[] toArray() {
- Collection<N> col = this.mInternalMap.values();
- @SuppressWarnings("unchecked")
- N[] val = (N[]) col.toArray();
- return val;
- }
-
- public synchronized Integer[] toArrayInternalMap() {
- Collection<Integer> col = this.mInternalMapReverseLookup.values();
- Integer[] val = col.toArray(new Integer[col.size()]);
- return val;
- }
-
+ /**
+ * The Internal Map
+ */
+ private Map<N, Integer> mInternalMapReverseLookup = new HashMap<N, Integer>();
+
+ /**
+ * The Internal ID
+ */
+ private int mInternalID = 0;
+
+ private static final long serialVersionUID = 3771412318075131790L;
+
+ @Override
+ public Iterator<N> iterator() {
+ return values().iterator();
+ }
+
+ public synchronized boolean setValue(N object) {
+ int mOriginalID = this.mInternalID;
+ put(object);
+ if (this.mInternalMap.get(mOriginalID).equals(object) || mOriginalID > this.mInternalID) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public synchronized N put(N object) {
+ return set(object);
+ }
+
+ @Override
+ public synchronized N set(N object) {
+ int newID = getNextFreeMapID();
+ mInternalMapReverseLookup.put(object, newID);
+ return mInternalMap.put(newID, object);
+ }
+
+ public synchronized int putToInternalMap(N object) {
+ return setInternalMap(object);
+ }
+
+ public synchronized int setInternalMap(N object) {
+ int newID = getNextFreeMapID();
+ mInternalMap.put(newID, object);
+ mInternalMapReverseLookup.put(object, newID);
+ return newID;
+ }
+
+ public synchronized boolean injectCleanDataToAutoMap(Integer g, N object) {
+ if (!mInternalMap.containsKey(g) && !mInternalMapReverseLookup.containsKey(object)) {
+ int a1 = 0, a2 = 0, a11 = 0, a22 = 0;
+ a1 = mInternalMap.size();
+ a2 = mInternalMapReverseLookup.size();
+ a11 = a1;
+ a22 = a2;
+ mInternalMap.put(g, object);
+ a1 = mInternalMap.size();
+ mInternalMapReverseLookup.put(object, g);
+ a2 = mInternalMapReverseLookup.size();
+ if (a1 > a11 && a2 > a22) return true;
+ }
+ return false;
+ }
+
+ public synchronized boolean injectDataToAutoMap(Integer g, N object) {
+ int a1 = 0, a2 = 0, a11 = 0, a22 = 0;
+ a1 = mInternalMap.size();
+ a2 = mInternalMapReverseLookup.size();
+ a11 = a1;
+ a22 = a2;
+ mInternalMap.put(g, object);
+ a1 = mInternalMap.size();
+ mInternalMapReverseLookup.put(object, g);
+ a2 = mInternalMapReverseLookup.size();
+ if (a1 > a11 && a2 > a22) return true;
+ return false;
+ }
+
+ private boolean raiseInternalID() {
+ int mOld = mInternalID;
+ mInternalID++;
+ return mInternalID > mOld;
+ }
+
+ public synchronized int getNextFreeMapID() {
+ if (raiseInternalID()) {
+ return mInternalID;
+ }
+ return Short.MIN_VALUE;
+ }
+
+ @Override
+ public synchronized N get(int id) {
+ return mInternalMap.get(id);
+ }
+
+ public synchronized int get(N key) {
+ return mInternalMapReverseLookup.get(key);
+ }
+
+ @Override
+ public synchronized Collection<N> values() {
+ return mInternalMap.values();
+ }
+
+ public synchronized Collection<Integer> keys() {
+ return mInternalMapReverseLookup.values();
+ }
+
+ @Override
+ public synchronized int size() {
+ return mInternalMap.size();
+ }
+
+ @Override
+ public synchronized int hashCode() {
+ return mInternalMap.hashCode() + mInternalMapReverseLookup.hashCode();
+ }
+
+ @Override
+ public synchronized boolean containsKey(int key) {
+ return mInternalMap.containsKey(key);
+ }
+
+ @Override
+ public synchronized boolean containsValue(N value) {
+ return mInternalMap.containsValue(value);
+ }
+
+ public synchronized boolean containsKey(N key) {
+ return mInternalMapReverseLookup.containsKey(key);
+ }
+
+ public synchronized boolean containsValue(int value) {
+ return mInternalMapReverseLookup.containsValue(value);
+ }
+
+ @Override
+ public synchronized boolean isEmpty() {
+ return mInternalMap.isEmpty() && mInternalMapReverseLookup.isEmpty();
+ }
+
+ @Override
+ public synchronized void clear() {
+ this.mInternalID = 0;
+ this.mInternalMap.clear();
+ this.mInternalMapReverseLookup.clear();
+ return;
+ }
+
+ @Override
+ public synchronized N[] toArray() {
+ Collection<N> col = this.mInternalMap.values();
+ @SuppressWarnings("unchecked")
+ N[] val = (N[]) col.toArray();
+ return val;
+ }
+
+ public synchronized Integer[] toArrayInternalMap() {
+ Collection<Integer> col = this.mInternalMapReverseLookup.values();
+ Integer[] val = col.toArray(new Integer[col.size()]);
+ return val;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/Triplet.java b/src/main/java/gtPlusPlus/api/objects/data/Triplet.java
index affb03d868..625ec630aa 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/Triplet.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/Triplet.java
@@ -1,27 +1,26 @@
package gtPlusPlus.api.objects.data;
-public class Triplet<K,V,C> {
+public class Triplet<K, V, C> {
- private final K key;
- private final V value;
- private final C count;
+ private final K key;
+ private final V value;
+ private final C count;
- public Triplet(final K key, final V value, final C value2){
- this.key = key;
- this.value = value;
- this.count = value2;
- }
+ public Triplet(final K key, final V value, final C value2) {
+ this.key = key;
+ this.value = value;
+ this.count = value2;
+ }
- final public K getValue_1(){
- return this.key;
- }
+ public final K getValue_1() {
+ return this.key;
+ }
- final public V getValue_2(){
- return this.value;
- }
+ public final V getValue_2() {
+ return this.value;
+ }
- final public C getValue_3(){
- return this.count;
- }
-
-} \ No newline at end of file
+ public final C getValue_3() {
+ return this.count;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java b/src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java
index 601a51392f..6acf62aa53 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java
@@ -1,178 +1,175 @@
package gtPlusPlus.api.objects.data;
+import gtPlusPlus.api.objects.Logger;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
-import gtPlusPlus.api.objects.Logger;
-
-
public class TypeCounter<V> implements Set<V> {
- private Map<String, InternalTypeCounterObject<V>> mInternalMap = new LinkedHashMap<String, InternalTypeCounterObject<V>>();
- private String mHighestValueKey;
- private int mHighestValue = 0;
- private final Class mClass;
-
- public TypeCounter(Class o) {
- Logger.WARNING("Created new TypeCounter for "+o.getName());
- mClass = o;
- }
-
- public static class InternalTypeCounterObject<Z> {
- private final Z mObject;
- private int mCounter = 0;
-
- public InternalTypeCounterObject(Z o) {
- mObject = o;
- }
-
- public String hash() {
- return String.valueOf(mObject.hashCode());
- }
-
- public Z get() {
- return mObject;
- }
-
- public void add() {
- mCounter++;
- }
-
- public int count() {
- return mCounter;
- }
-
- }
-
- public boolean add(V arg0) {
- return add(arg0, null);
- }
-
- public boolean add(V arg0, String aKeyName) {
- String aKey = aKeyName != null ? aKeyName : arg0.toString();
- InternalTypeCounterObject<V> aValue = mInternalMap.get(aKey);
- if (aValue == null) {
- aValue = new InternalTypeCounterObject<V>((V) arg0);
- Logger.WARNING("Adding new key to map: "+aKey);
- }
- aValue.add();
- int a = aValue.count();
- if (a > mHighestValue) {
- mHighestValue = a;
- mHighestValueKey = aKey;
- Logger.WARNING("New Highest Count - "+aKey+":"+a);
- }
- mInternalMap.put(aKey, aValue);
- Logger.WARNING(aKey+":"+a);
- return true;
- }
-
- @Override
- public boolean addAll(Collection arg0) {
- boolean aReturn = true;
- for (Object o : arg0) {
- if (mClass.isInstance(o)) {
- V j = (V) o;
- boolean b = add(j);
- if (!b) {
- aReturn = false;
- }
- }
- }
- return aReturn;
- }
-
- @Override
- public void clear() {
- mInternalMap.clear();
- }
-
- @Override
- public boolean contains(Object arg0) {
- return mInternalMap.containsKey(arg0.toString());
- }
-
- @Override
- public boolean containsAll(Collection arg0) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean isEmpty() {
- return mInternalMap.isEmpty();
- }
-
- @Override
- public Iterator iterator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean remove(Object arg0) {
- InternalTypeCounterObject<V> aValue = mInternalMap.remove(arg0.toString());
- if (aValue != null) {
- return true;
- }
- else {
- return false;
- }
- }
-
- @Override
- public boolean removeAll(Collection arg0) {
- boolean aReturn = true;
- for (Object o : arg0) {
- boolean a = remove(o);
- if (!a) {
- aReturn = false;
- }
- }
- return aReturn;
- }
-
- @Override
- public boolean retainAll(Collection arg0) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public int size() {
- return this.mInternalMap.size();
- }
-
- @Override
- public Object[] toArray() {
- Object[] aArray = new Object[this.mInternalMap.size()];
- int aPos = 0;
- for (String k : this.mInternalMap.keySet()) {
- if (k != null) {
- InternalTypeCounterObject<V> aVal = this.mInternalMap.get(k);
- aArray[aPos++] = new Pair<String, InternalTypeCounterObject<V>>(k, aVal);
- }
- }
- return aArray;
- }
-
- @Override
- public V[] toArray(Object[] a) {
- Object[] aArray = new Object[a.length];
- int aPos = 0;
- for (Object k : a) {
- if (k != null) {
- aArray[aPos++] = k;
- }
- }
- return (V[]) aArray;
- }
-
- public V getResults() {
- InternalTypeCounterObject<V> x = mInternalMap.get(mHighestValueKey);
- return x.get();
- }
+ private Map<String, InternalTypeCounterObject<V>> mInternalMap =
+ new LinkedHashMap<String, InternalTypeCounterObject<V>>();
+ private String mHighestValueKey;
+ private int mHighestValue = 0;
+ private final Class mClass;
+
+ public TypeCounter(Class o) {
+ Logger.WARNING("Created new TypeCounter for " + o.getName());
+ mClass = o;
+ }
+
+ public static class InternalTypeCounterObject<Z> {
+ private final Z mObject;
+ private int mCounter = 0;
+
+ public InternalTypeCounterObject(Z o) {
+ mObject = o;
+ }
+
+ public String hash() {
+ return String.valueOf(mObject.hashCode());
+ }
+
+ public Z get() {
+ return mObject;
+ }
+
+ public void add() {
+ mCounter++;
+ }
+
+ public int count() {
+ return mCounter;
+ }
+ }
+
+ public boolean add(V arg0) {
+ return add(arg0, null);
+ }
+
+ public boolean add(V arg0, String aKeyName) {
+ String aKey = aKeyName != null ? aKeyName : arg0.toString();
+ InternalTypeCounterObject<V> aValue = mInternalMap.get(aKey);
+ if (aValue == null) {
+ aValue = new InternalTypeCounterObject<V>((V) arg0);
+ Logger.WARNING("Adding new key to map: " + aKey);
+ }
+ aValue.add();
+ int a = aValue.count();
+ if (a > mHighestValue) {
+ mHighestValue = a;
+ mHighestValueKey = aKey;
+ Logger.WARNING("New Highest Count - " + aKey + ":" + a);
+ }
+ mInternalMap.put(aKey, aValue);
+ Logger.WARNING(aKey + ":" + a);
+ return true;
+ }
+
+ @Override
+ public boolean addAll(Collection arg0) {
+ boolean aReturn = true;
+ for (Object o : arg0) {
+ if (mClass.isInstance(o)) {
+ V j = (V) o;
+ boolean b = add(j);
+ if (!b) {
+ aReturn = false;
+ }
+ }
+ }
+ return aReturn;
+ }
+
+ @Override
+ public void clear() {
+ mInternalMap.clear();
+ }
+
+ @Override
+ public boolean contains(Object arg0) {
+ return mInternalMap.containsKey(arg0.toString());
+ }
+
+ @Override
+ public boolean containsAll(Collection arg0) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return mInternalMap.isEmpty();
+ }
+
+ @Override
+ public Iterator iterator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean remove(Object arg0) {
+ InternalTypeCounterObject<V> aValue = mInternalMap.remove(arg0.toString());
+ if (aValue != null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean removeAll(Collection arg0) {
+ boolean aReturn = true;
+ for (Object o : arg0) {
+ boolean a = remove(o);
+ if (!a) {
+ aReturn = false;
+ }
+ }
+ return aReturn;
+ }
+
+ @Override
+ public boolean retainAll(Collection arg0) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public int size() {
+ return this.mInternalMap.size();
+ }
+
+ @Override
+ public Object[] toArray() {
+ Object[] aArray = new Object[this.mInternalMap.size()];
+ int aPos = 0;
+ for (String k : this.mInternalMap.keySet()) {
+ if (k != null) {
+ InternalTypeCounterObject<V> aVal = this.mInternalMap.get(k);
+ aArray[aPos++] = new Pair<String, InternalTypeCounterObject<V>>(k, aVal);
+ }
+ }
+ return aArray;
+ }
+
+ @Override
+ public V[] toArray(Object[] a) {
+ Object[] aArray = new Object[a.length];
+ int aPos = 0;
+ for (Object k : a) {
+ if (k != null) {
+ aArray[aPos++] = k;
+ }
+ }
+ return (V[]) aArray;
+ }
+
+ public V getResults() {
+ InternalTypeCounterObject<V> x = mInternalMap.get(mHighestValueKey);
+ return x.get();
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java b/src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java
index f9966474b0..20eed5cdc5 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java
@@ -1,5 +1,6 @@
package gtPlusPlus.api.objects.data;
+import gtPlusPlus.api.objects.random.XSTR;
import java.util.Collection;
import java.util.Map;
import java.util.NavigableMap;
@@ -7,96 +8,93 @@ import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
-import gtPlusPlus.api.objects.random.XSTR;
-
public class WeightedCollection<E> implements Map<Integer, E> {
- private NavigableMap<Integer, E> map = new TreeMap<Integer, E>();
- private Random random;
- private int total = 0;
-
- public WeightedCollection() {
- this(new XSTR());
- }
-
- public WeightedCollection(Random random) {
- this.random = random;
- }
-
- public E add(int weight, E object) {
- if (weight <= 0) return null;
- total += weight;
- return map.put(total, object);
- }
-
- private E next() {
- int value = random.nextInt(total) + 1; // Can also use floating-point weights
- return map.ceilingEntry(value).getValue();
- }
-
- @Override
- public int size() {
- return map.size();
- }
-
- @Override
- public boolean isEmpty() {
- return map.isEmpty();
- }
-
- @Override
- public boolean containsKey(Object key) {
- return map.containsKey(key);
- }
-
- @Override
- public boolean containsValue(Object value) {
- return map.containsValue(value);
- }
-
- public E get() {
- return next();
- }
-
- @Override
- public E get(Object key) {
- return next();
- }
-
- @Override
- public void putAll(Map m) {
- map.putAll(m);
- }
-
- @Override
- public void clear() {
- map.clear();
- this.total = 0;
- }
-
- @Override
- public Set keySet() {
- return map.keySet();
- }
-
- @Override
- public Collection values() {
- return map.values();
- }
-
- @Override
- public Set entrySet() {
- return map.entrySet();
- }
-
- @Override
- public E put(Integer key, E value) {
- return add(key, value);
- }
-
- @Override
- public E remove(Object key) {
- return map.remove(key);
- }
-
-} \ No newline at end of file
+ private NavigableMap<Integer, E> map = new TreeMap<Integer, E>();
+ private Random random;
+ private int total = 0;
+
+ public WeightedCollection() {
+ this(new XSTR());
+ }
+
+ public WeightedCollection(Random random) {
+ this.random = random;
+ }
+
+ public E add(int weight, E object) {
+ if (weight <= 0) return null;
+ total += weight;
+ return map.put(total, object);
+ }
+
+ private E next() {
+ int value = random.nextInt(total) + 1; // Can also use floating-point weights
+ return map.ceilingEntry(value).getValue();
+ }
+
+ @Override
+ public int size() {
+ return map.size();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return map.isEmpty();
+ }
+
+ @Override
+ public boolean containsKey(Object key) {
+ return map.containsKey(key);
+ }
+
+ @Override
+ public boolean containsValue(Object value) {
+ return map.containsValue(value);
+ }
+
+ public E get() {
+ return next();
+ }
+
+ @Override
+ public E get(Object key) {
+ return next();
+ }
+
+ @Override
+ public void putAll(Map m) {
+ map.putAll(m);
+ }
+
+ @Override
+ public void clear() {
+ map.clear();
+ this.total = 0;
+ }
+
+ @Override
+ public Set keySet() {
+ return map.keySet();
+ }
+
+ @Override
+ public Collection values() {
+ return map.values();
+ }
+
+ @Override
+ public Set entrySet() {
+ return map.entrySet();
+ }
+
+ @Override
+ public E put(Integer key, E value) {
+ return add(key, value);
+ }
+
+ @Override
+ public E remove(Object key) {
+ return map.remove(key);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/objects/data/weakref/WeakAutoMap.java b/src/main/java/gtPlusPlus/api/objects/data/weakref/WeakAutoMap.java
index 6c55822ca9..fcf6131611 100644
--- a/src/main/java/gtPlusPlus/api/objects/data/weakref/WeakAutoMap.java
+++ b/src/main/java/gtPlusPlus/api/objects/data/weakref/WeakAutoMap.java
@@ -1,12 +1,12 @@
package gtPlusPlus.api.objects.data.weakref;
-import java.util.WeakHashMap;
-
import gtPlusPlus.api.objects.data.AutoMap;
+import java.util.WeakHashMap;
public class WeakAutoMap<T> extends AutoMap<T> {
- private static final long serialVersionUID = 8328345351801363386L;
- public WeakAutoMap() {
- super(new WeakHashMap<Integer, T>());
- }
+ private static final long serialVersionUID = 8328345351801363386L;
+
+ public WeakAutoMap() {
+ super(new WeakHashMap<Integer, T>());
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/AABB.java b/src/main/java/gtPlusPlus/api/objects/minecraft/AABB.java
index 722ac00b64..cefc4fce37 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/AABB.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/AABB.java
@@ -11,55 +11,52 @@ import net.minecraft.world.World;
*
*/
public class AABB {
-
- private final AxisAlignedBB mAabb;
- private final World mWorld;
-
- /**
- * Creates a AxisAlignedBB based around an Entity.
- * @param aEntity - The Entity to work with.
- * @param x - Maximum X from origin.
- * @param y - Maximum Y from origin.
- * @param z - Maximum Z from origin.
- */
- public AABB(Entity aEntity, int x, int y, int z) {
- if (aEntity == null) {
- mAabb = null;
- mWorld = null;
- }
- else {
- mWorld = aEntity.worldObj;
- BlockPos aEntityLocation = EntityUtils.findBlockPosUnderEntity(aEntity);
- int xMin, xMax, yMin, yMax, zMin, zMax;
- xMin = aEntityLocation.xPos;
- yMin = aEntityLocation.yPos;
- zMin = aEntityLocation.zPos;
- xMax = aEntityLocation.xPos + x;
- yMax = aEntityLocation.yPos + y;
- zMax = aEntityLocation.zPos + z;
- mAabb = AxisAlignedBB.getBoundingBox(xMin, yMin, zMin, xMax, yMax, zMax);
- }
- }
-
- /**
- * Used to get the AxisAlignedBB from this class.
- * @return
- */
- public AxisAlignedBB get() {
- return mAabb;
- }
-
- /**
- * Used to determine if this object is valid or not.
- * @return
- */
- public boolean valid() {
- return mAabb != null && mWorld != null;
- }
-
- public World world() {
- return mWorld;
- }
-
+ private final AxisAlignedBB mAabb;
+ private final World mWorld;
+
+ /**
+ * Creates a AxisAlignedBB based around an Entity.
+ * @param aEntity - The Entity to work with.
+ * @param x - Maximum X from origin.
+ * @param y - Maximum Y from origin.
+ * @param z - Maximum Z from origin.
+ */
+ public AABB(Entity aEntity, int x, int y, int z) {
+ if (aEntity == null) {
+ mAabb = null;
+ mWorld = null;
+ } else {
+ mWorld = aEntity.worldObj;
+ BlockPos aEntityLocation = EntityUtils.findBlockPosUnderEntity(aEntity);
+ int xMin, xMax, yMin, yMax, zMin, zMax;
+ xMin = aEntityLocation.xPos;
+ yMin = aEntityLocation.yPos;
+ zMin = aEntityLocation.zPos;
+ xMax = aEntityLocation.xPos + x;
+ yMax = aEntityLocation.yPos + y;
+ zMax = aEntityLocation.zPos + z;
+ mAabb = AxisAlignedBB.getBoundingBox(xMin, yMin, zMin, xMax, yMax, zMax);
+ }
+ }
+
+ /**
+ * Used to get the AxisAlignedBB from this class.
+ * @return
+ */
+ public AxisAlignedBB get() {
+ return mAabb;
+ }
+
+ /**
+ * Used to determine if this object is valid or not.
+ * @return
+ */
+ public boolean valid() {
+ return mAabb != null && mWorld != null;
+ }
+
+ public World world() {
+ return mWorld;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java
index 0b8f97b378..f7d29e1200 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java
@@ -1,6 +1,5 @@
package gtPlusPlus.api.objects.minecraft;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
@@ -8,181 +7,179 @@ import net.minecraftforge.fluids.FluidTankInfo;
public class BTF_FluidTank extends FluidTank {
- public FluidStack mFluid;
-
- public BTF_FluidTank(int capacity) {
- super(capacity);
- }
-
- /**
- * Let's replace the Default handling with GT's own handling code, because it's probably better, right?
- * @author Alkalus/GregoriusT
- */
-
-
- public FluidStack getFluid() {
- return this.getDrainableStack();
- }
-
- public int getFluidAmount() {
- return this.getDrainableStack() != null ? this.getDrainableStack().amount : 0;
- }
-
- public NBTTagCompound writeToNBT(NBTTagCompound aNBT) {
- super.writeToNBT(aNBT);
- if (this.mFluid != null) {
- aNBT.setTag("mFluid", this.mFluid.writeToNBT(new NBTTagCompound()));
- }
- return aNBT;
- }
-
- public FluidTank readFromNBT(NBTTagCompound aNBT) {
- this.mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- return this;
- }
-
-/* public abstract boolean isLiquidInput(byte arg0);
-
- public abstract boolean isLiquidOutput(byte arg0);
-
- public abstract boolean doesFillContainers();
-
- public abstract boolean doesEmptyContainers();*/
-
- public boolean canTankBeFilled() {
- return true;
- }
-
- public boolean canTankBeEmptied() {
- return true;
- }
-
-
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return true;
- }
-
- public FluidStack getFillableStack() {
- return this.mFluid;
- }
-
- public FluidStack setFillableStack(FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
- }
-
- public FluidStack getDrainableStack() {
- return this.mFluid;
- }
-
- public FluidStack setDrainableStack(FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
- }
-
- public FluidStack getDisplayedFluid() {
- return this.getDrainableStack();
- }
-
- public boolean isFluidChangingAllowed() {
- return true;
- }
-
- public int fill(FluidStack aFluid, boolean doFill) {
- if (aFluid != null && aFluid.getFluid().getID() > 0 && aFluid.amount > 0 && this.canTankBeFilled()
- && this.isFluidInputAllowed(aFluid)) {
- if (this.getFillableStack() != null && this.getFillableStack().getFluid().getID() > 0) {
- if (!this.getFillableStack().isFluidEqual(aFluid)) {
- return 0;
- } else {
- int space = this.getCapacity() - this.getFillableStack().amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- FluidStack arg9999 = this.getFillableStack();
- arg9999.amount += aFluid.amount;
- }
-
- return aFluid.amount;
- } else {
- if (doFill) {
- this.getFillableStack().amount = this.getCapacity();
- }
-
- return space;
- }
- }
- } else if (aFluid.amount <= this.getCapacity()) {
- if (doFill) {
- this.setFillableStack(aFluid.copy());
- }
-
- return aFluid.amount;
- } else {
- if (doFill) {
- this.setFillableStack(aFluid.copy());
- this.getFillableStack().amount = this.getCapacity();
- }
-
- return this.getCapacity();
- }
- } else {
- return 0;
- }
- }
-
- public FluidStack drain(int maxDrain, boolean doDrain) {
- if (this.getDrainableStack() != null && this.canTankBeEmptied()) {
- if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack((FluidStack) null);
- return null;
- } else {
- int used = maxDrain;
- if (this.getDrainableStack().amount < maxDrain) {
- used = this.getDrainableStack().amount;
- }
-
- if (doDrain) {
- FluidStack arg9999 = this.getDrainableStack();
- arg9999.amount -= used;
- }
-
- FluidStack drained = this.getDrainableStack().copy();
- drained.amount = used;
- if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack((FluidStack) null);
- }
-
- return drained;
- }
- } else {
- return null;
- }
- }
-
- @Override
- public int getCapacity() {
- return super.getCapacity();
- }
-
- @Override
- public FluidTankInfo getInfo() {
- return new FluidTankInfo(this);
- }
-
- @Override
- public void setFluid(FluidStack fluid) {
- setFillableStack(fluid);
- }
-
- @Override
- public void setCapacity(int capacity) {
- super.setCapacity(capacity);
- }
-
- public FluidStack drain(FluidStack aFluid, boolean doDrain) {
- return drain(aFluid.amount, doDrain);
- }
-
-
-
+ public FluidStack mFluid;
+
+ public BTF_FluidTank(int capacity) {
+ super(capacity);
+ }
+
+ /**
+ * Let's replace the Default handling with GT's own handling code, because it's probably better, right?
+ * @author Alkalus/GregoriusT
+ */
+ public FluidStack getFluid() {
+ return this.getDrainableStack();
+ }
+
+ public int getFluidAmount() {
+ return this.getDrainableStack() != null ? this.getDrainableStack().amount : 0;
+ }
+
+ public NBTTagCompound writeToNBT(NBTTagCompound aNBT) {
+ super.writeToNBT(aNBT);
+ if (this.mFluid != null) {
+ aNBT.setTag("mFluid", this.mFluid.writeToNBT(new NBTTagCompound()));
+ }
+ return aNBT;
+ }
+
+ public FluidTank readFromNBT(NBTTagCompound aNBT) {
+ this.mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ return this;
+ }
+
+ /* public abstract boolean isLiquidInput(byte arg0);
+
+ public abstract boolean isLiquidOutput(byte arg0);
+
+ public abstract boolean doesFillContainers();
+
+ public abstract boolean doesEmptyContainers();*/
+
+ public boolean canTankBeFilled() {
+ return true;
+ }
+
+ public boolean canTankBeEmptied() {
+ return true;
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return true;
+ }
+
+ public FluidStack getFillableStack() {
+ return this.mFluid;
+ }
+
+ public FluidStack setFillableStack(FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+ public FluidStack getDrainableStack() {
+ return this.mFluid;
+ }
+
+ public FluidStack setDrainableStack(FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+ public FluidStack getDisplayedFluid() {
+ return this.getDrainableStack();
+ }
+
+ public boolean isFluidChangingAllowed() {
+ return true;
+ }
+
+ public int fill(FluidStack aFluid, boolean doFill) {
+ if (aFluid != null
+ && aFluid.getFluid().getID() > 0
+ && aFluid.amount > 0
+ && this.canTankBeFilled()
+ && this.isFluidInputAllowed(aFluid)) {
+ if (this.getFillableStack() != null
+ && this.getFillableStack().getFluid().getID() > 0) {
+ if (!this.getFillableStack().isFluidEqual(aFluid)) {
+ return 0;
+ } else {
+ int space = this.getCapacity() - this.getFillableStack().amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ FluidStack arg9999 = this.getFillableStack();
+ arg9999.amount += aFluid.amount;
+ }
+
+ return aFluid.amount;
+ } else {
+ if (doFill) {
+ this.getFillableStack().amount = this.getCapacity();
+ }
+
+ return space;
+ }
+ }
+ } else if (aFluid.amount <= this.getCapacity()) {
+ if (doFill) {
+ this.setFillableStack(aFluid.copy());
+ }
+
+ return aFluid.amount;
+ } else {
+ if (doFill) {
+ this.setFillableStack(aFluid.copy());
+ this.getFillableStack().amount = this.getCapacity();
+ }
+
+ return this.getCapacity();
+ }
+ } else {
+ return 0;
+ }
+ }
+
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ if (this.getDrainableStack() != null && this.canTankBeEmptied()) {
+ if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
+ this.setDrainableStack((FluidStack) null);
+ return null;
+ } else {
+ int used = maxDrain;
+ if (this.getDrainableStack().amount < maxDrain) {
+ used = this.getDrainableStack().amount;
+ }
+
+ if (doDrain) {
+ FluidStack arg9999 = this.getDrainableStack();
+ arg9999.amount -= used;
+ }
+
+ FluidStack drained = this.getDrainableStack().copy();
+ drained.amount = used;
+ if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
+ this.setDrainableStack((FluidStack) null);
+ }
+
+ return drained;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public int getCapacity() {
+ return super.getCapacity();
+ }
+
+ @Override
+ public FluidTankInfo getInfo() {
+ return new FluidTankInfo(this);
+ }
+
+ @Override
+ public void setFluid(FluidStack fluid) {
+ setFillableStack(fluid);
+ }
+
+ @Override
+ public void setCapacity(int capacity) {
+ super.setCapacity(capacity);
+ }
+
+ public FluidStack drain(FluidStack aFluid, boolean doDrain) {
+ return drain(aFluid.amount, doDrain);
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java
index 04ce0dff19..d23ea97072 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java
@@ -1,228 +1,244 @@
package gtPlusPlus.api.objects.minecraft;
-import java.util.ArrayList;
-
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.tileentities.base.TileEntityBase;
import gtPlusPlus.core.util.data.ArrayUtils;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
-public class BTF_Inventory implements ISidedInventory{
-
- public final ItemStack[] mInventory;
- public final TileEntityBase mTile;
-
- public BTF_Inventory(int aSlots, TileEntityBase tile) {
- this.mInventory = new ItemStack[aSlots];
- this.mTile = tile;
- }
-
- public ItemStack[] getRealInventory() {
- purgeNulls();
- return this.mInventory;
- }
-
- public int getSizeInventory() {
- return this.mInventory.length;
- }
-
- public ItemStack getStackInSlot(int aIndex) {
- return aIndex >= 0 && aIndex < this.mInventory.length ? this.mInventory[aIndex] : null;
- }
-
- public void setInventorySlotContents(int aIndex, ItemStack aStack) {
- if (aIndex >= 0 && aIndex < this.mInventory.length) {
- this.mInventory[aIndex] = aStack;
- }
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- public int getInventoryStackLimit() {
- return 64;
- }
-
-
- public boolean setStackToZeroInsteadOfNull(int aIndex) {
- return false;
-}
+public class BTF_Inventory implements ISidedInventory {
+
+ public final ItemStack[] mInventory;
+ public final TileEntityBase mTile;
+
+ public BTF_Inventory(int aSlots, TileEntityBase tile) {
+ this.mInventory = new ItemStack[aSlots];
+ this.mTile = tile;
+ }
- public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
- return isValidSlot(aIndex);
- }
-
- public ItemStack decrStackSize(int aIndex, int aAmount) {
- ItemStack tStack = this.getStackInSlot(aIndex);
- ItemStack rStack = GT_Utility.copy(new Object[]{tStack});
- if (tStack != null) {
- if (tStack.stackSize <= aAmount) {
- if (this.setStackToZeroInsteadOfNull(aIndex)) {
- tStack.stackSize = 0;
- } else {
- this.setInventorySlotContents(aIndex, (ItemStack) null);
- }
- } else {
- rStack = tStack.splitStack(aAmount);
- if (tStack.stackSize == 0 && !this.setStackToZeroInsteadOfNull(aIndex)) {
- this.setInventorySlotContents(aIndex, (ItemStack) null);
- }
- }
- }
-
- return rStack;
- }
-
- public int[] getAccessibleSlotsFromSide(int aSide) {
- ArrayList<Integer> tList = new ArrayList<Integer>();
- TileEntityBase tTileEntity = this.mTile;
- 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 rArray = 0; rArray < this.getSizeInventory(); ++rArray) {
- if (this.isValidSlot(rArray) && (tSkip
- || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide),
- rArray, tTileEntity)
- || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide),
- rArray, tTileEntity))) {
- tList.add(Integer.valueOf(rArray));
- }
- }
-
- int[] arg6 = new int[tList.size()];
-
- for (int i = 0; i < arg6.length; ++i) {
- arg6[i] = ((Integer) tList.get(i)).intValue();
- }
-
- return arg6;
- }
-
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return this.isValidSlot(aIndex) && aStack != null && aIndex < this.mInventory.length
- && (this.mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, this.mInventory[aIndex]))
- && this.allowPutStack(this.mTile, aIndex, (byte) aSide, aStack);
- }
-
- public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
- return this.isValidSlot(aIndex) && aStack != null && aIndex < this.mInventory.length
- && this.allowPullStack(this.mTile, aIndex, (byte) aSide, aStack);
- }
-
- public boolean allowPullStack(TileEntityBase mTile2, int aIndex, byte aSide, ItemStack aStack) {
- return aIndex >= 0 && aIndex < this.getSizeInventory();
- }
-
- public boolean allowPutStack(TileEntityBase aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return (aIndex >= 0 && aIndex < this.getSizeInventory()) && (this.mInventory[aIndex] == null || GT_Utility.areStacksEqual(this.mInventory[aIndex], aStack));
- }
-
- public ItemStack getStackInSlotOnClosing(int i) {
- return null;
- }
-
- public final boolean hasCustomInventoryName() {
- return mTile != null ? mTile.hasCustomInventoryName() : false;
- }
-
-
- public void markDirty() {
- if (mTile != null) {
- purgeNulls();
- mTile.markDirty();
- }
- }
-
- public boolean isUseableByPlayer(EntityPlayer entityplayer) {
- return true;
- }
-
- public void openInventory() {
-
- }
-
- public void closeInventory() {
-
- }
-
- @Override
- public final String getInventoryName() {
- return this.mTile != null ? mTile.getInventoryName() : "";
- }
-
- public boolean isFull() {
- for (int s=0;s<this.getSizeInventory();s++) {
- ItemStack slot = mInventory[s];
- if (slot == null || slot.stackSize != slot.getMaxStackSize()) {
- return false;
- }
- }
- return true;
- }
-
- public boolean isEmpty() {
- for (int s=0;s<this.getSizeInventory();s++) {
- ItemStack slot = mInventory[s];
- if (slot == null) {
- continue;
- }
- else {
- return false;
- }
- }
- return true;
- }
-
- public boolean addItemStack(ItemStack aInput) {
- if (aInput != null & (isEmpty() || !isFull())) {
- for (int s = 0; s < this.getSizeInventory(); s++) {
- if (mInventory != null && mInventory[s] != null) {
- ItemStack slot = mInventory[s];
- if (slot == null || (slot != null && GT_Utility.areStacksEqual(aInput, slot) && slot.stackSize != slot.getItem().getItemStackLimit(slot))) {
- if (slot == null) {
- slot = aInput.copy();
- } else {
- slot.stackSize++;
- }
- this.setInventorySlotContents(s, slot);
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public final void purgeNulls() {
- ItemStack[] aTemp = ArrayUtils.removeNulls(this.mInventory);
- for (int g=0;g<this.getSizeInventory();g++) {
- if (aTemp.length < this.getSizeInventory()) {
- if (g <= aTemp.length-1) {
- this.mInventory[g] = aTemp[g];
- }
- else {
- this.mInventory[g] = null;
- }
- }
- else {
- this.mInventory[g] = aTemp[g];
- }
- }
-
- }
+ public ItemStack[] getRealInventory() {
+ purgeNulls();
+ return this.mInventory;
+ }
+ public int getSizeInventory() {
+ return this.mInventory.length;
+ }
+ public ItemStack getStackInSlot(int aIndex) {
+ return aIndex >= 0 && aIndex < this.mInventory.length ? this.mInventory[aIndex] : null;
+ }
+
+ public void setInventorySlotContents(int aIndex, ItemStack aStack) {
+ if (aIndex >= 0 && aIndex < this.mInventory.length) {
+ this.mInventory[aIndex] = aStack;
+ }
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ public boolean setStackToZeroInsteadOfNull(int aIndex) {
+ return false;
+ }
+
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ return isValidSlot(aIndex);
+ }
+
+ public ItemStack decrStackSize(int aIndex, int aAmount) {
+ ItemStack tStack = this.getStackInSlot(aIndex);
+ ItemStack rStack = GT_Utility.copy(new Object[] {tStack});
+ if (tStack != null) {
+ if (tStack.stackSize <= aAmount) {
+ if (this.setStackToZeroInsteadOfNull(aIndex)) {
+ tStack.stackSize = 0;
+ } else {
+ this.setInventorySlotContents(aIndex, (ItemStack) null);
+ }
+ } else {
+ rStack = tStack.splitStack(aAmount);
+ if (tStack.stackSize == 0 && !this.setStackToZeroInsteadOfNull(aIndex)) {
+ this.setInventorySlotContents(aIndex, (ItemStack) null);
+ }
+ }
+ }
+
+ return rStack;
+ }
+
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ ArrayList<Integer> tList = new ArrayList<Integer>();
+ TileEntityBase tTileEntity = this.mTile;
+ 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 rArray = 0; rArray < this.getSizeInventory(); ++rArray) {
+ if (this.isValidSlot(rArray)
+ && (tSkip
+ || tTileEntity
+ .getCoverBehaviorAtSide((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getCoverDataAtSide((byte) aSide),
+ rArray,
+ tTileEntity)
+ || tTileEntity
+ .getCoverBehaviorAtSide((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getCoverDataAtSide((byte) aSide),
+ rArray,
+ tTileEntity))) {
+ tList.add(Integer.valueOf(rArray));
+ }
+ }
+
+ int[] arg6 = new int[tList.size()];
+
+ for (int i = 0; i < arg6.length; ++i) {
+ arg6[i] = ((Integer) tList.get(i)).intValue();
+ }
+
+ return arg6;
+ }
+
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ return this.isValidSlot(aIndex)
+ && aStack != null
+ && aIndex < this.mInventory.length
+ && (this.mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, this.mInventory[aIndex]))
+ && this.allowPutStack(this.mTile, aIndex, (byte) aSide, aStack);
+ }
+
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ return this.isValidSlot(aIndex)
+ && aStack != null
+ && aIndex < this.mInventory.length
+ && this.allowPullStack(this.mTile, aIndex, (byte) aSide, aStack);
+ }
+
+ public boolean allowPullStack(TileEntityBase mTile2, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex >= 0 && aIndex < this.getSizeInventory();
+ }
+
+ public boolean allowPutStack(TileEntityBase aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (aIndex >= 0 && aIndex < this.getSizeInventory())
+ && (this.mInventory[aIndex] == null || GT_Utility.areStacksEqual(this.mInventory[aIndex], aStack));
+ }
+
+ public ItemStack getStackInSlotOnClosing(int i) {
+ return null;
+ }
+
+ public final boolean hasCustomInventoryName() {
+ return mTile != null ? mTile.hasCustomInventoryName() : false;
+ }
+
+ public void markDirty() {
+ if (mTile != null) {
+ purgeNulls();
+ mTile.markDirty();
+ }
+ }
+
+ public boolean isUseableByPlayer(EntityPlayer entityplayer) {
+ return true;
+ }
+
+ public void openInventory() {}
+
+ public void closeInventory() {}
+
+ @Override
+ public final String getInventoryName() {
+ return this.mTile != null ? mTile.getInventoryName() : "";
+ }
+
+ public boolean isFull() {
+ for (int s = 0; s < this.getSizeInventory(); s++) {
+ ItemStack slot = mInventory[s];
+ if (slot == null || slot.stackSize != slot.getMaxStackSize()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public boolean isEmpty() {
+ for (int s = 0; s < this.getSizeInventory(); s++) {
+ ItemStack slot = mInventory[s];
+ if (slot == null) {
+ continue;
+ } else {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public boolean addItemStack(ItemStack aInput) {
+ if (aInput != null & (isEmpty() || !isFull())) {
+ for (int s = 0; s < this.getSizeInventory(); s++) {
+ if (mInventory != null && mInventory[s] != null) {
+ ItemStack slot = mInventory[s];
+ if (slot == null
+ || (slot != null
+ && GT_Utility.areStacksEqual(aInput, slot)
+ && slot.stackSize != slot.getItem().getItemStackLimit(slot))) {
+ if (slot == null) {
+ slot = aInput.copy();
+ } else {
+ slot.stackSize++;
+ }
+ this.setInventorySlotContents(s, slot);
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public final void purgeNulls() {
+ ItemStack[] aTemp = ArrayUtils.removeNulls(this.mInventory);
+ for (int g = 0; g < this.getSizeInventory(); g++) {
+ if (aTemp.length < this.getSizeInventory()) {
+ if (g <= aTemp.length - 1) {
+ this.mInventory[g] = aTemp[g];
+ } else {
+ this.mInventory[g] = null;
+ }
+ } else {
+ this.mInventory[g] = aTemp[g];
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java b/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java
index ab359c3853..451d1aca77 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java
@@ -1,250 +1,245 @@
package gtPlusPlus.api.objects.minecraft;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.api.objects.data.AutoMap;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.data.AutoMap;
import net.minecraftforge.common.DimensionManager;
-public class BlockPos implements Serializable{
-
- private static final long serialVersionUID = -7271947491316682006L;
- public final int xPos;
- public final int yPos;
- public final int zPos;
- public final int dim;
- public final transient World world;
-
- public static BlockPos generateBlockPos(String sUUID) {
- String[] s2 = sUUID.split("@");
- return new BlockPos(s2);
- }
-
- public BlockPos(String[] s){
- this(Integer.parseInt(s[1]), Integer.parseInt(s[2]), Integer.parseInt(s[3]), Integer.parseInt(s[0]));
- }
-
- public BlockPos(int x, int y, int z){
- this(x, y, z, 0);
- }
-
- public BlockPos(int x, int y, int z, int dim){
- this(x, y, z, DimensionManager.getWorld(dim));
- }
-
- public BlockPos(int x, int y, int z, World dim){
- this.xPos = x;
- this.yPos = y;
- this.zPos = z;
-
- if (dim != null) {
- this.dim = dim.provider.dimensionId;
- this.world = dim;
- }
- else {
- this.dim = 0;
- this.world = null;
- }
-
- }
-
- public BlockPos(IGregTechTileEntity b) {
- this (b.getXCoord(), b.getYCoord(), b.getZCoord(), b.getWorld());
- }
-
- public BlockPos(TileEntity b) {
- this (b.xCoord, b.yCoord, b.zCoord, b.getWorldObj());
- }
-
- public String getLocationString() {
- return "[X: "+this.xPos+"][Y: "+this.yPos+"][Z: "+this.zPos+"][Dim: "+this.dim+"]";
- }
-
- public String getUniqueIdentifier() {
- String S = ""+this.dim+"@"+this.xPos+"@"+this.yPos+"@"+this.zPos;
- return S;
- }
-
- @Override
- public int hashCode() {
- int hash = 5;
- hash += (13 * this.xPos);
- hash += (19 * this.yPos);
- hash += (31 * this.zPos);
- hash += (17 * this.dim);
- return hash;
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == null) {
- return false;
- }
- if (other == this) {
- return true;
- }
- if(!(other instanceof BlockPos)) {
- return false;
- }
- BlockPos otherPoint = (BlockPos)other;
- return this.xPos == otherPoint.xPos && this.yPos == otherPoint.yPos && this.zPos == otherPoint.zPos && this.dim == otherPoint.dim;
- }
-
- public int distanceFrom(BlockPos target) {
- if (target.dim != this.dim) {
- return Short.MIN_VALUE;
- }
- return distanceFrom(target.xPos, target.yPos, target.zPos);
- }
-
- /**
- *
- * @param x X coordinate of target.
- * @param y Y coordinate of target.
- * @param z Z coordinate of target.
- * @return square of distance
- */
- public int distanceFrom(int x, int y, int z) {
- int distanceX = this.xPos - x;
- int distanceY = this.yPos - y;
- int distanceZ = this.zPos - z;
- return distanceX * distanceX + distanceY * distanceY + distanceZ * distanceZ;
- }
-
- public boolean isWithinRange(BlockPos target, int range) {
- if (target.dim != this.dim) {
- return false;
- }
- return isWithinRange(target.xPos, target.yPos, target.zPos, range);
- }
-
- public boolean isWithinRange(int x, int y, int z, int range) {
- return distanceFrom(x, y, z) <= (range * range);
- }
-
-
- public BlockPos getUp() {
- return new BlockPos(this.xPos, this.yPos+1, this.zPos, this.dim);
- }
-
- public BlockPos getDown() {
- return new BlockPos(this.xPos, this.yPos-1, this.zPos, this.dim);
- }
-
- public BlockPos getXPos() {
- return new BlockPos(this.xPos+1, this.yPos, this.zPos, this.dim);
- }
-
- public BlockPos getXNeg() {
- return new BlockPos(this.xPos-1, this.yPos, this.zPos, this.dim);
- }
-
- public BlockPos getZPos() {
- return new BlockPos(this.xPos, this.yPos, this.zPos+1, this.dim);
- }
-
- public BlockPos getZNeg() {
- return new BlockPos(this.xPos, this.yPos, this.zPos-1, this.dim);
- }
-
- public AutoMap<BlockPos> getSurroundingBlocks(){
- AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
- sides.put(getUp());
- sides.put(getDown());
- sides.put(getXPos());
- sides.put(getXNeg());
- sides.put(getZPos());
- sides.put(getZNeg());
- return sides;
- }
-
- public Block getBlockAtPos() {
- return getBlockAtPos(this);
- }
-
- public Block getBlockAtPos(BlockPos pos) {
- return getBlockAtPos(world, pos);
- }
-
- public Block getBlockAtPos(World world, BlockPos pos) {
- return world.getBlock(pos.xPos, pos.yPos, pos.zPos);
- }
-
- public int getMetaAtPos() {
- return getMetaAtPos(this);
- }
-
- public int getMetaAtPos(BlockPos pos) {
- return getMetaAtPos(world, pos);
- }
-
- public int getMetaAtPos(World world, BlockPos pos) {
- return world.getBlockMetadata(pos.xPos, pos.yPos, pos.zPos);
- }
-
- public boolean hasSimilarNeighbour() {
- return hasSimilarNeighbour(false);
- }
-
- /**
- * @param strict - Does this check Meta Data?
- * @return - Does this block have a neighbour that is the same?
- */
- public boolean hasSimilarNeighbour(boolean strict) {
- for (BlockPos g : getSurroundingBlocks().values()) {
- if (getBlockAtPos(g) == getBlockAtPos()) {
- if (!strict) {
- return true;
- }
- else {
- if (getMetaAtPos() == getMetaAtPos(g)) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public AutoMap<BlockPos> getSimilarNeighbour() {
- return getSimilarNeighbour(false);
- }
-
- /**
- * @param strict - Does this check Meta Data?
- * @return - Does this block have a neighbour that is the same?
- */
- public AutoMap<BlockPos> getSimilarNeighbour(boolean strict) {
- AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
- for (BlockPos g : getSurroundingBlocks().values()) {
- if (getBlockAtPos(g) == getBlockAtPos()) {
- if (!strict) {
- sides.put(g);
- }
- else {
- if (getMetaAtPos() == getMetaAtPos(g)) {
- sides.put(g);
- }
- }
- }
- }
- return sides;
- }
-
- public Set<BlockPos> getValidNeighboursAndSelf(){
- AutoMap<BlockPos> h = getSimilarNeighbour(true);
- h.put(this);
- Set<BlockPos> result = new HashSet<BlockPos>();
- for (BlockPos f : h.values()) {
- result.add(f);
- }
- return result;
- }
-
+public class BlockPos implements Serializable {
+
+ private static final long serialVersionUID = -7271947491316682006L;
+ public final int xPos;
+ public final int yPos;
+ public final int zPos;
+ public final int dim;
+ public final transient World world;
+
+ public static BlockPos generateBlockPos(String sUUID) {
+ String[] s2 = sUUID.split("@");
+ return new BlockPos(s2);
+ }
+
+ public BlockPos(String[] s) {
+ this(Integer.parseInt(s[1]), Integer.parseInt(s[2]), Integer.parseInt(s[3]), Integer.parseInt(s[0]));
+ }
+
+ public BlockPos(int x, int y, int z) {
+ this(x, y, z, 0);
+ }
+
+ public BlockPos(int x, int y, int z, int dim) {
+ this(x, y, z, DimensionManager.getWorld(dim));
+ }
+
+ public BlockPos(int x, int y, int z, World dim) {
+ this.xPos = x;
+ this.yPos = y;
+ this.zPos = z;
+
+ if (dim != null) {
+ this.dim = dim.provider.dimensionId;
+ this.world = dim;
+ } else {
+ this.dim = 0;
+ this.world = null;
+ }
+ }
+
+ public BlockPos(IGregTechTileEntity b) {
+ this(b.getXCoord(), b.getYCoord(), b.getZCoord(), b.getWorld());
+ }
+
+ public BlockPos(TileEntity b) {
+ this(b.xCoord, b.yCoord, b.zCoord, b.getWorldObj());
+ }
+
+ public String getLocationString() {
+ return "[X: " + this.xPos + "][Y: " + this.yPos + "][Z: " + this.zPos + "][Dim: " + this.dim + "]";
+ }
+
+ public String getUniqueIdentifier() {
+ String S = "" + this.dim + "@" + this.xPos + "@" + this.yPos + "@" + this.zPos;
+ return S;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 5;
+ hash += (13 * this.xPos);
+ hash += (19 * this.yPos);
+ hash += (31 * this.zPos);
+ hash += (17 * this.dim);
+ return hash;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == null) {
+ return false;
+ }
+ if (other == this) {
+ return true;
+ }
+ if (!(other instanceof BlockPos)) {
+ return false;
+ }
+ BlockPos otherPoint = (BlockPos) other;
+ return this.xPos == otherPoint.xPos
+ && this.yPos == otherPoint.yPos
+ && this.zPos == otherPoint.zPos
+ && this.dim == otherPoint.dim;
+ }
+
+ public int distanceFrom(BlockPos target) {
+ if (target.dim != this.dim) {
+ return Short.MIN_VALUE;
+ }
+ return distanceFrom(target.xPos, target.yPos, target.zPos);
+ }
+
+ /**
+ *
+ * @param x X coordinate of target.
+ * @param y Y coordinate of target.
+ * @param z Z coordinate of target.
+ * @return square of distance
+ */
+ public int distanceFrom(int x, int y, int z) {
+ int distanceX = this.xPos - x;
+ int distanceY = this.yPos - y;
+ int distanceZ = this.zPos - z;
+ return distanceX * distanceX + distanceY * distanceY + distanceZ * distanceZ;
+ }
+
+ public boolean isWithinRange(BlockPos target, int range) {
+ if (target.dim != this.dim) {
+ return false;
+ }
+ return isWithinRange(target.xPos, target.yPos, target.zPos, range);
+ }
+
+ public boolean isWithinRange(int x, int y, int z, int range) {
+ return distanceFrom(x, y, z) <= (range * range);
+ }
+
+ public BlockPos getUp() {
+ return new BlockPos(this.xPos, this.yPos + 1, this.zPos, this.dim);
+ }
+
+ public BlockPos getDown() {
+ return new BlockPos(this.xPos, this.yPos - 1, this.zPos, this.dim);
+ }
+
+ public BlockPos getXPos() {
+ return new BlockPos(this.xPos + 1, this.yPos, this.zPos, this.dim);
+ }
+
+ public BlockPos getXNeg() {
+ return new BlockPos(this.xPos - 1, this.yPos, this.zPos, this.dim);
+ }
+
+ public BlockPos getZPos() {
+ return new BlockPos(this.xPos, this.yPos, this.zPos + 1, this.dim);
+ }
+
+ public BlockPos getZNeg() {
+ return new BlockPos(this.xPos, this.yPos, this.zPos - 1, this.dim);
+ }
+
+ public AutoMap<BlockPos> getSurroundingBlocks() {
+ AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
+ sides.put(getUp());
+ sides.put(getDown());
+ sides.put(getXPos());
+ sides.put(getXNeg());
+ sides.put(getZPos());
+ sides.put(getZNeg());
+ return sides;
+ }
+
+ public Block getBlockAtPos() {
+ return getBlockAtPos(this);
+ }
+
+ public Block getBlockAtPos(BlockPos pos) {
+ return getBlockAtPos(world, pos);
+ }
+
+ public Block getBlockAtPos(World world, BlockPos pos) {
+ return world.getBlock(pos.xPos, pos.yPos, pos.zPos);
+ }
+
+ public int getMetaAtPos() {
+ return getMetaAtPos(this);
+ }
+
+ public int getMetaAtPos(BlockPos pos) {
+ return getMetaAtPos(world, pos);
+ }
+
+ public int getMetaAtPos(World world, BlockPos pos) {
+ return world.getBlockMetadata(pos.xPos, pos.yPos, pos.zPos);
+ }
+
+ public boolean hasSimilarNeighbour() {
+ return hasSimilarNeighbour(false);
+ }
+
+ /**
+ * @param strict - Does this check Meta Data?
+ * @return - Does this block have a neighbour that is the same?
+ */
+ public boolean hasSimilarNeighbour(boolean strict) {
+ for (BlockPos g : getSurroundingBlocks().values()) {
+ if (getBlockAtPos(g) == getBlockAtPos()) {
+ if (!strict) {
+ return true;
+ } else {
+ if (getMetaAtPos() == getMetaAtPos(g)) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public AutoMap<BlockPos> getSimilarNeighbour() {
+ return getSimilarNeighbour(false);
+ }
+
+ /**
+ * @param strict - Does this check Meta Data?
+ * @return - Does this block have a neighbour that is the same?
+ */
+ public AutoMap<BlockPos> getSimilarNeighbour(boolean strict) {
+ AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
+ for (BlockPos g : getSurroundingBlocks().values()) {
+ if (getBlockAtPos(g) == getBlockAtPos()) {
+ if (!strict) {
+ sides.put(g);
+ } else {
+ if (getMetaAtPos() == getMetaAtPos(g)) {
+ sides.put(g);
+ }
+ }
+ }
+ }
+ return sides;
+ }
+
+ public Set<BlockPos> getValidNeighboursAndSelf() {
+ AutoMap<BlockPos> h = getSimilarNeighbour(true);
+ h.put(this);
+ Set<BlockPos> result = new HashSet<BlockPos>();
+ for (BlockPos f : h.values()) {
+ result.add(f);
+ }
+ return result;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java b/src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java
index 8c76513d09..04b1f2b59b 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java
@@ -5,58 +5,51 @@ import net.minecraftforge.common.util.ForgeDirection;
public class CubicObject<T> {
- public final T NORTH;
- public final T SOUTH;
-
- public final T WEST;
- public final T EAST;
-
- public final T UP;
- public final T DOWN;
-
- public CubicObject(AutoMap<T> aDataSet) {
- this(aDataSet.get(0), aDataSet.get(1), aDataSet.get(2), aDataSet.get(3), aDataSet.get(4), aDataSet.get(5));
- }
-
- public CubicObject(T[] aDataSet) {
- this(aDataSet[0], aDataSet[1], aDataSet[2], aDataSet[3], aDataSet[4], aDataSet[5]);
- }
-
- public CubicObject(T aDOWN, T aUP, T aNORTH, T aSOUTH, T aWEST, T aEAST) {
- DOWN = aDOWN;
- UP = aUP;
- NORTH = aNORTH;
- SOUTH = aSOUTH;
- WEST = aWEST;
- EAST = aEAST;
- }
-
- public T get(int aSide) {
- return get(ForgeDirection.getOrientation(aSide));
- }
-
- public T get(ForgeDirection aSide) {
- if (aSide == ForgeDirection.DOWN) {
- return DOWN;
- }
- else if (aSide == ForgeDirection.UP) {
- return UP;
- }
- else if (aSide == ForgeDirection.NORTH) {
- return NORTH;
- }
- else if (aSide == ForgeDirection.SOUTH) {
- return SOUTH;
- }
- else if (aSide == ForgeDirection.WEST) {
- return WEST;
- }
- else if (aSide == ForgeDirection.EAST) {
- return EAST;
- }
- else {
- return null;
- }
- }
-
+ public final T NORTH;
+ public final T SOUTH;
+
+ public final T WEST;
+ public final T EAST;
+
+ public final T UP;
+ public final T DOWN;
+
+ public CubicObject(AutoMap<T> aDataSet) {
+ this(aDataSet.get(0), aDataSet.get(1), aDataSet.get(2), aDataSet.get(3), aDataSet.get(4), aDataSet.get(5));
+ }
+
+ public CubicObject(T[] aDataSet) {
+ this(aDataSet[0], aDataSet[1], aDataSet[2], aDataSet[3], aDataSet[4], aDataSet[5]);
+ }
+
+ public CubicObject(T aDOWN, T aUP, T aNORTH, T aSOUTH, T aWEST, T aEAST) {
+ DOWN = aDOWN;
+ UP = aUP;
+ NORTH = aNORTH;
+ SOUTH = aSOUTH;
+ WEST = aWEST;
+ EAST = aEAST;
+ }
+
+ public T get(int aSide) {
+ return get(ForgeDirection.getOrientation(aSide));
+ }
+
+ public T get(ForgeDirection aSide) {
+ if (aSide == ForgeDirection.DOWN) {
+ return DOWN;
+ } else if (aSide == ForgeDirection.UP) {
+ return UP;
+ } else if (aSide == ForgeDirection.NORTH) {
+ return NORTH;
+ } else if (aSide == ForgeDirection.SOUTH) {
+ return SOUTH;
+ } else if (aSide == ForgeDirection.WEST) {
+ return WEST;
+ } else if (aSide == ForgeDirection.EAST) {
+ return EAST;
+ } else {
+ return null;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java b/src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java
index 010e522a14..492d0b3aeb 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java
@@ -7,46 +7,48 @@ import net.minecraft.world.chunk.Chunk;
public class DimChunkPos {
- public final int dimension;
- public final int xPos;
- public final int zPos;
- public final Chunk mainChunk;
+ public final int dimension;
+ public final int xPos;
+ public final int zPos;
+ public final Chunk mainChunk;
+ public DimChunkPos(World world, BlockPos block) {
+ this.dimension = world.provider.dimensionId;
+ this.mainChunk = world.getChunkFromBlockCoords(block.xPos, block.zPos);
+ this.xPos = this.mainChunk.xPosition;
+ this.zPos = this.mainChunk.zPosition;
+ }
- public DimChunkPos(World world, BlockPos block){
- this.dimension = world.provider.dimensionId;
- this.mainChunk = world.getChunkFromBlockCoords(block.xPos, block.zPos);
- this.xPos = this.mainChunk.xPosition;
- this.zPos = this.mainChunk.zPosition;
- }
-
+ public DimChunkPos(TileEntity tile) {
+ this.dimension = tile.getWorldObj().provider.dimensionId;
+ this.mainChunk = tile.getWorldObj().getChunkFromBlockCoords(tile.xCoord, tile.zCoord);
+ this.xPos = this.mainChunk.xPosition;
+ this.zPos = this.mainChunk.zPosition;
+ }
- public DimChunkPos(TileEntity tile){
- this.dimension = tile.getWorldObj().provider.dimensionId;
- this.mainChunk = tile.getWorldObj().getChunkFromBlockCoords(tile.xCoord, tile.zCoord);
- this.xPos = this.mainChunk.xPosition;
- this.zPos = this.mainChunk.zPosition;
- }
-
- public DimChunkPos(int dim, int x, int z){
- this.dimension = dim;
- this.xPos = x;
- this.zPos = z;
- Chunk h = Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(dim).getChunkFromChunkCoords(xPos, zPos);
- if (h == null) {
- this.mainChunk = null;
- }
- else {
- this.mainChunk = h;
- }
- }
-
- public Chunk getChunk() {
- if (this.mainChunk != null) {
- return this.mainChunk;
- }
- Chunk h = Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(this.dimension).getChunkFromChunkCoords(xPos, zPos);
- return h;
- }
+ public DimChunkPos(int dim, int x, int z) {
+ this.dimension = dim;
+ this.xPos = x;
+ this.zPos = z;
+ Chunk h = Minecraft.getMinecraft()
+ .getIntegratedServer()
+ .worldServerForDimension(dim)
+ .getChunkFromChunkCoords(xPos, zPos);
+ if (h == null) {
+ this.mainChunk = null;
+ } else {
+ this.mainChunk = h;
+ }
+ }
+ public Chunk getChunk() {
+ if (this.mainChunk != null) {
+ return this.mainChunk;
+ }
+ Chunk h = Minecraft.getMinecraft()
+ .getIntegratedServer()
+ .worldServerForDimension(this.dimension)
+ .getChunkFromChunkCoords(xPos, zPos);
+ return h;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java b/src/main/java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java
index d5db8081dc..40f78763d0 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java
@@ -1,9 +1,8 @@
package gtPlusPlus.api.objects.minecraft;
+import gtPlusPlus.api.objects.data.AutoMap;
import java.util.HashSet;
import java.util.Set;
-
-import gtPlusPlus.api.objects.data.AutoMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
@@ -11,219 +10,217 @@ import net.minecraftforge.common.DimensionManager;
public class FakeBlockPos extends BlockPos {
- private static final long serialVersionUID = -6442245826092414593L;
- private transient Block aBlockAtPos;
- private int aBlockMetaAtPos = 0;
-
- public static FakeBlockPos generateBlockPos(String sUUID) {
- String[] s2 = sUUID.split("@");
- return new FakeBlockPos(s2);
- }
-
- public FakeBlockPos(String[] s){
- this(Integer.parseInt(s[1]), Integer.parseInt(s[2]), Integer.parseInt(s[3]), Integer.parseInt(s[0]));
- }
-
- public FakeBlockPos(int x, int y, int z, Block aBlock, int aMeta){
- this(x, y, z, 0);
- aBlockAtPos = aBlock;
- aBlockMetaAtPos = aMeta;
- }
-
- private FakeBlockPos(int x, int y, int z, int dim){
- this(x, y, z, DimensionManager.getWorld(dim));
- }
-
- private FakeBlockPos(int x, int y, int z, World dim){
- super(x, y, z, null);
- }
-
- public String getLocationString() {
- String S = ""+this.xPos+"@"+this.yPos+"@"+this.zPos;
- return S;
- }
-
- public String getUniqueIdentifier() {
- String S = ""+this.xPos+"@"+this.yPos+"@"+this.zPos+this.aBlockAtPos.getLocalizedName()+"@"+this.aBlockMetaAtPos;
- return S;
- }
-
- @Override
- public int hashCode() {
- int hash = 5;
- hash += (13 * this.xPos);
- hash += (19 * this.yPos);
- hash += (31 * this.zPos);
- hash += (17 * this.dim);
- return hash;
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == null) {
- return false;
- }
- if (other == this) {
- return true;
- }
- if(!(other instanceof FakeBlockPos)) {
- return false;
- }
- FakeBlockPos otherPoint = (FakeBlockPos) other;
- return this.xPos == otherPoint.xPos && this.yPos == otherPoint.yPos && this.zPos == otherPoint.zPos;
- }
-
- public int distanceFrom(FakeBlockPos target) {
- if (target.dim != this.dim) {
- return Short.MIN_VALUE;
- }
- return distanceFrom(target.xPos, target.yPos, target.zPos);
- }
-
- /**
- *
- * @param x X coordinate of target.
- * @param y Y coordinate of target.
- * @param z Z coordinate of target.
- * @return square of distance
- */
- public int distanceFrom(int x, int y, int z) {
- int distanceX = this.xPos - x;
- int distanceY = this.yPos - y;
- int distanceZ = this.zPos - z;
- return distanceX * distanceX + distanceY * distanceY + distanceZ * distanceZ;
- }
-
- public boolean isWithinRange(FakeBlockPos target, int range) {
- if (target.dim != this.dim) {
- return false;
- }
- return isWithinRange(target.xPos, target.yPos, target.zPos, range);
- }
-
- public boolean isWithinRange(int x, int y, int z, int range) {
- return distanceFrom(x, y, z) <= (range * range);
- }
-
-
- public FakeBlockPos getUp() {
- return new FakeBlockPos(this.xPos, this.yPos+1, this.zPos, this.dim);
- }
-
- public FakeBlockPos getDown() {
- return new FakeBlockPos(this.xPos, this.yPos-1, this.zPos, this.dim);
- }
-
- public FakeBlockPos getXPos() {
- return new FakeBlockPos(this.xPos+1, this.yPos, this.zPos, this.dim);
- }
-
- public FakeBlockPos getXNeg() {
- return new FakeBlockPos(this.xPos-1, this.yPos, this.zPos, this.dim);
- }
-
- public FakeBlockPos getZPos() {
- return new FakeBlockPos(this.xPos, this.yPos, this.zPos+1, this.dim);
- }
-
- public FakeBlockPos getZNeg() {
- return new FakeBlockPos(this.xPos, this.yPos, this.zPos-1, this.dim);
- }
-
- public AutoMap<BlockPos> getSurroundingBlocks(){
- AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
- sides.put(getUp());
- sides.put(getDown());
- sides.put(getXPos());
- sides.put(getXNeg());
- sides.put(getZPos());
- sides.put(getZNeg());
- return sides;
- }
-
- public Block getBlockAtPos() {
- return getBlockAtPos(this);
- }
-
- public Block getBlockAtPos(FakeBlockPos pos) {
- return getBlockAtPos(world, pos);
- }
-
- public Block getBlockAtPos(World world, FakeBlockPos pos) {
- return aBlockAtPos;
- }
-
- public int getMetaAtPos() {
- return getMetaAtPos(this);
- }
-
- public int getMetaAtPos(FakeBlockPos pos) {
- return getMetaAtPos(world, pos);
- }
-
- public int getMetaAtPos(World world, FakeBlockPos pos) {
- return aBlockMetaAtPos;
- }
-
- public boolean hasSimilarNeighbour() {
- return hasSimilarNeighbour(false);
- }
-
- /**
- * @param strict - Does this check Meta Data?
- * @return - Does this block have a neighbour that is the same?
- */
- public boolean hasSimilarNeighbour(boolean strict) {
- for (BlockPos g : getSurroundingBlocks().values()) {
- if (getBlockAtPos(g) == getBlockAtPos()) {
- if (!strict) {
- return true;
- }
- else {
- if (getMetaAtPos() == getMetaAtPos(g)) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public AutoMap<BlockPos> getSimilarNeighbour() {
- return getSimilarNeighbour(false);
- }
-
- /**
- * @param strict - Does this check Meta Data?
- * @return - Does this block have a neighbour that is the same?
- */
- public AutoMap<BlockPos> getSimilarNeighbour(boolean strict) {
- AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
- for (BlockPos g : getSurroundingBlocks().values()) {
- if (getBlockAtPos(g) == getBlockAtPos()) {
- if (!strict) {
- sides.put(g);
- }
- else {
- if (getMetaAtPos() == getMetaAtPos(g)) {
- sides.put(g);
- }
- }
- }
- }
- return sides;
- }
-
- public Set<BlockPos> getValidNeighboursAndSelf(){
- AutoMap<BlockPos> h = getSimilarNeighbour(true);
- h.put(this);
- Set<BlockPos> result = new HashSet<BlockPos>();
- for (BlockPos f : h.values()) {
- result.add(f);
- }
- return result;
- }
-
+ private static final long serialVersionUID = -6442245826092414593L;
+ private transient Block aBlockAtPos;
+ private int aBlockMetaAtPos = 0;
+
+ public static FakeBlockPos generateBlockPos(String sUUID) {
+ String[] s2 = sUUID.split("@");
+ return new FakeBlockPos(s2);
+ }
+
+ public FakeBlockPos(String[] s) {
+ this(Integer.parseInt(s[1]), Integer.parseInt(s[2]), Integer.parseInt(s[3]), Integer.parseInt(s[0]));
+ }
+
+ public FakeBlockPos(int x, int y, int z, Block aBlock, int aMeta) {
+ this(x, y, z, 0);
+ aBlockAtPos = aBlock;
+ aBlockMetaAtPos = aMeta;
+ }
+
+ private FakeBlockPos(int x, int y, int z, int dim) {
+ this(x, y, z, DimensionManager.getWorld(dim));
+ }
+
+ private FakeBlockPos(int x, int y, int z, World dim) {
+ super(x, y, z, null);
+ }
+
+ public String getLocationString() {
+ String S = "" + this.xPos + "@" + this.yPos + "@" + this.zPos;
+ return S;
+ }
+
+ public String getUniqueIdentifier() {
+ String S = "" + this.xPos + "@" + this.yPos + "@" + this.zPos + this.aBlockAtPos.getLocalizedName() + "@"
+ + this.aBlockMetaAtPos;
+ return S;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 5;
+ hash += (13 * this.xPos);
+ hash += (19 * this.yPos);
+ hash += (31 * this.zPos);
+ hash += (17 * this.dim);
+ return hash;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == null) {
+ return false;
+ }
+ if (other == this) {
+ return true;
+ }
+ if (!(other instanceof FakeBlockPos)) {
+ return false;
+ }
+ FakeBlockPos otherPoint = (FakeBlockPos) other;
+ return this.xPos == otherPoint.xPos && this.yPos == otherPoint.yPos && this.zPos == otherPoint.zPos;
+ }
+
+ public int distanceFrom(FakeBlockPos target) {
+ if (target.dim != this.dim) {
+ return Short.MIN_VALUE;
+ }
+ return distanceFrom(target.xPos, target.yPos, target.zPos);
+ }
+
+ /**
+ *
+ * @param x X coordinate of target.
+ * @param y Y coordinate of target.
+ * @param z Z coordinate of target.
+ * @return square of distance
+ */
+ public int distanceFrom(int x, int y, int z) {
+ int distanceX = this.xPos - x;
+ int distanceY = this.yPos - y;
+ int distanceZ = this.zPos - z;
+ return distanceX * distanceX + distanceY * distanceY + distanceZ * distanceZ;
+ }
+
+ public boolean isWithinRange(FakeBlockPos target, int range) {
+ if (target.dim != this.dim) {
+ return false;
+ }
+ return isWithinRange(target.xPos, target.yPos, target.zPos, range);
+ }
+
+ public boolean isWithinRange(int x, int y, int z, int range) {
+ return distanceFrom(x, y, z) <= (range * range);
+ }
+
+ public FakeBlockPos getUp() {
+ return new FakeBlockPos(this.xPos, this.yPos + 1, this.zPos, this.dim);
+ }
+
+ public FakeBlockPos getDown() {
+ return new FakeBlockPos(this.xPos, this.yPos - 1, this.zPos, this.dim);
+ }
+
+ public FakeBlockPos getXPos() {
+ return new FakeBlockPos(this.xPos + 1, this.yPos, this.zPos, this.dim);
+ }
+
+ public FakeBlockPos getXNeg() {
+ return new FakeBlockPos(this.xPos - 1, this.yPos, this.zPos, this.dim);
+ }
+
+ public FakeBlockPos getZPos() {
+ return new FakeBlockPos(this.xPos, this.yPos, this.zPos + 1, this.dim);
+ }
+
+ public FakeBlockPos getZNeg() {
+ return new FakeBlockPos(this.xPos, this.yPos, this.zPos - 1, this.dim);
+ }
+
+ public AutoMap<BlockPos> getSurroundingBlocks() {
+ AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
+ sides.put(getUp());
+ sides.put(getDown());
+ sides.put(getXPos());
+ sides.put(getXNeg());
+ sides.put(getZPos());
+ sides.put(getZNeg());
+ return sides;
+ }
+
+ public Block getBlockAtPos() {
+ return getBlockAtPos(this);
+ }
+
+ public Block getBlockAtPos(FakeBlockPos pos) {
+ return getBlockAtPos(world, pos);
+ }
+
+ public Block getBlockAtPos(World world, FakeBlockPos pos) {
+ return aBlockAtPos;
+ }
+
+ public int getMetaAtPos() {
+ return getMetaAtPos(this);
+ }
+
+ public int getMetaAtPos(FakeBlockPos pos) {
+ return getMetaAtPos(world, pos);
+ }
+
+ public int getMetaAtPos(World world, FakeBlockPos pos) {
+ return aBlockMetaAtPos;
+ }
+
+ public boolean hasSimilarNeighbour() {
+ return hasSimilarNeighbour(false);
+ }
+
+ /**
+ * @param strict - Does this check Meta Data?
+ * @return - Does this block have a neighbour that is the same?
+ */
+ public boolean hasSimilarNeighbour(boolean strict) {
+ for (BlockPos g : getSurroundingBlocks().values()) {
+ if (getBlockAtPos(g) == getBlockAtPos()) {
+ if (!strict) {
+ return true;
+ } else {
+ if (getMetaAtPos() == getMetaAtPos(g)) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public AutoMap<BlockPos> getSimilarNeighbour() {
+ return getSimilarNeighbour(false);
+ }
+
+ /**
+ * @param strict - Does this check Meta Data?
+ * @return - Does this block have a neighbour that is the same?
+ */
+ public AutoMap<BlockPos> getSimilarNeighbour(boolean strict) {
+ AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
+ for (BlockPos g : getSurroundingBlocks().values()) {
+ if (getBlockAtPos(g) == getBlockAtPos()) {
+ if (!strict) {
+ sides.put(g);
+ } else {
+ if (getMetaAtPos() == getMetaAtPos(g)) {
+ sides.put(g);
+ }
+ }
+ }
+ }
+ return sides;
+ }
+
+ public Set<BlockPos> getValidNeighboursAndSelf() {
+ AutoMap<BlockPos> h = getSimilarNeighbour(true);
+ h.put(this);
+ Set<BlockPos> result = new HashSet<BlockPos>();
+ for (BlockPos f : h.values()) {
+ result.add(f);
+ }
+ return result;
+ }
+
/**
* Called when a plant grows on this block, only implemented for saplings using the WorldGen*Trees classes right now.
* Modder may implement this for custom plants.
@@ -241,13 +238,10 @@ public class FakeBlockPos extends BlockPos {
* @param sourceY Plant growth location Y
* @param sourceZ Plant growth location Z
*/
- public void onPlantGrow(FakeWorld world, int x, int y, int z, int sourceX, int sourceY, int sourceZ)
- {
- if (getBlockAtPos() == Blocks.grass || getBlockAtPos() == Blocks.farmland)
- {
+ public void onPlantGrow(FakeWorld world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) {
+ if (getBlockAtPos() == Blocks.grass || getBlockAtPos() == Blocks.farmland) {
this.aBlockAtPos = Blocks.dirt;
this.aBlockMetaAtPos = 0;
}
}
-
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/FakeWorld.java b/src/main/java/gtPlusPlus/api/objects/minecraft/FakeWorld.java
index 8ee033a341..2a55282623 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/FakeWorld.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/FakeWorld.java
@@ -1,12 +1,10 @@
package gtPlusPlus.api.objects.minecraft;
-import java.util.HashMap;
-
-import gregtech.api.enums.Materials;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
@@ -18,156 +16,140 @@ import net.minecraftforge.common.util.ForgeDirection;
public class FakeWorld implements IBlockAccess {
- public static HashMap<String, FakeBlockPos> mStaticFakeWorldData;
-
- public HashMap<String, FakeBlockPos> mFakeWorldData = new HashMap<String, FakeBlockPos>();
-
- /**
- * Must be an odd number
- */
- private int aWorldSize = 99;
- private final int aDistanceFromOrigin;
- private final int aWorldHeight;
-
- public FakeWorld() {
- this(99);
- }
-
- public FakeWorld(int aSize) {
- if (MathUtils.isNumberEven(aSize)) {
- aSize++;
- }
- aWorldSize = aSize;
- aDistanceFromOrigin = ((aWorldSize-1)/2);
- aWorldHeight = aDistanceFromOrigin >= 255 ? 255 : aDistanceFromOrigin;
- Logger.WARNING("Created a Fake World with data:");
- Logger.WARNING("World Size: "+aWorldSize);
- Logger.WARNING("Distance from Origin in each dir: "+aDistanceFromOrigin);
- Logger.WARNING("World Height: "+aWorldHeight);
- init();
- }
-
- public void init() {
-
- /*if (mStaticFakeWorldData == null) {
- Logger.WARNING("Setting all Blocks in Fake World to Air.");
- mStaticFakeWorldData = new HashMap<String, FakeBlockPos>();
- for (int y=0;y<=aWorldHeight;y++) {
- for (int x=-aDistanceFromOrigin;x<=aDistanceFromOrigin;x++) {
- for (int z=-aDistanceFromOrigin;z<=aDistanceFromOrigin;z++) {
- FakeBlockPos aTempPos = new FakeBlockPos(x, y, z, Blocks.air, 0);
- mStaticFakeWorldData.put(aTempPos.getLocationString(), aTempPos);
- }
- }
- }
- }*/
- //if (mStaticFakeWorldData != null) {
- //Logger.WARNING(" Instancing static air world.");
- mFakeWorldData = new HashMap<String, FakeBlockPos>();
- //mFakeWorldData = (HashMap<String, FakeBlockPos>) mStaticFakeWorldData.clone();
- //}
-
-
- //Logger.WARNING("Initialisation of FakeWorld is now complete.");
- }
-
- public FakeBlockPos getBlockAtCoords(int x, int y, int z) {
- String S = ""+x+"@"+y+"@"+z;
- FakeBlockPos aBlock = mFakeWorldData.get(S);
- if (aBlock == null) {
- return new FakeBlockPos(x, y, z, Blocks.air, 0);
- }
- return aBlock;
- }
-
- public void setBlockAtCoords(int x, int y, int z, Block aBlock, int aMeta) {
- FakeBlockPos aTempPos = new FakeBlockPos(x, y, z, aBlock, aMeta);
- Logger.WARNING("Setting "+x+", "+y+", "+z+" to "+aBlock.getLocalizedName()+":"+aMeta);
- mFakeWorldData.put(aTempPos.getLocationString(), aTempPos);
- }
-
- public AutoMap<ItemStack> getAllBlocksStoredInFakeWorld(){
- AutoMap<ItemStack> aOutput = new AutoMap<ItemStack>();
- for (FakeBlockPos aPos : mFakeWorldData.values()) {
- if (aPos == null || aPos.getBlockAtPos() == Blocks.air) {
- continue;
- }
- else {
- ItemStack aTempStack = ItemUtils.simpleMetaStack(aPos.getBlockAtPos(), aPos.getMetaAtPos(), 1);
- if (ItemUtils.checkForInvalidItems(aTempStack)) {
- //Logger.WARNING("Output: "+aTempStack.getDisplayName());
- aOutput.put(aTempStack);
- }
- }
- }
- return aOutput;
- }
-
- public Block getBlock(int x, int y, int z) {
- FakeBlockPos aPos = getBlockAtCoords(x, y, z);
- return aPos.getBlockAtPos();
- }
-
- public boolean isAirBlock(int x, int y, int z) {
- Block aBlock = getBlock(x, y, z);
- return aBlock == Blocks.air || aBlock.getMaterial() == Material.air;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- @Override
- public TileEntity getTileEntity(int p_147438_1_, int p_147438_2_, int p_147438_3_) {
- return null;
- }
-
- @Override
- public int getLightBrightnessForSkyBlocks(int p_72802_1_, int p_72802_2_, int p_72802_3_, int p_72802_4_) {
- return 0;
- }
-
- @Override
- public int getBlockMetadata(int x, int y, int z) {
- return getBlockAtCoords(x, y, z).getMetaAtPos();
- }
-
- @Override
- public int isBlockProvidingPowerTo(int p_72879_1_, int p_72879_2_, int p_72879_3_, int p_72879_4_) {
- return 0;
- }
-
- @Override
- public BiomeGenBase getBiomeGenForCoords(int p_72807_1_, int p_72807_2_) {
- return BiomeGenBase.plains;
- }
-
- @Override
- public int getHeight() {
- return aWorldHeight;
- }
-
- @Override
- public boolean extendedLevelsInChunkCache() {
- return false;
- }
-
- @Override
- public boolean isSideSolid(int x, int y, int z, ForgeDirection side, boolean _default) {
- if (!isAirBlock(x, y, z)) {
- return true;
- }
- return false;
- }
-
-
-
+ public static HashMap<String, FakeBlockPos> mStaticFakeWorldData;
+
+ public HashMap<String, FakeBlockPos> mFakeWorldData = new HashMap<String, FakeBlockPos>();
+
+ /**
+ * Must be an odd number
+ */
+ private int aWorldSize = 99;
+
+ private final int aDistanceFromOrigin;
+ private final int aWorldHeight;
+
+ public FakeWorld() {
+ this(99);
+ }
+
+ public FakeWorld(int aSize) {
+ if (MathUtils.isNumberEven(aSize)) {
+ aSize++;
+ }
+ aWorldSize = aSize;
+ aDistanceFromOrigin = ((aWorldSize - 1) / 2);
+ aWorldHeight = aDistanceFromOrigin >= 255 ? 255 : aDistanceFromOrigin;
+ Logger.WARNING("Created a Fake World with data:");
+ Logger.WARNING("World Size: " + aWorldSize);
+ Logger.WARNING("Distance from Origin in each dir: " + aDistanceFromOrigin);
+ Logger.WARNING("World Height: " + aWorldHeight);
+ init();
+ }
+
+ public void init() {
+
+ /*if (mStaticFakeWorldData == null) {
+ Logger.WARNING("Setting all Blocks in Fake World to Air.");
+ mStaticFakeWorldData = new HashMap<String, FakeBlockPos>();
+ for (int y=0;y<=aWorldHeight;y++) {
+ for (int x=-aDistanceFromOrigin;x<=aDistanceFromOrigin;x++) {
+ for (int z=-aDistanceFromOrigin;z<=aDistanceFromOrigin;z++) {
+ FakeBlockPos aTempPos = new FakeBlockPos(x, y, z, Blocks.air, 0);
+ mStaticFakeWorldData.put(aTempPos.getLocationString(), aTempPos);
+ }
+ }
+ }
+ }*/
+ // if (mStaticFakeWorldData != null) {
+ // Logger.WARNING(" Instancing static air world.");
+ mFakeWorldData = new HashMap<String, FakeBlockPos>();
+ // mFakeWorldData = (HashMap<String, FakeBlockPos>) mStaticFakeWorldData.clone();
+ // }
+
+ // Logger.WARNING("Initialisation of FakeWorld is now complete.");
+ }
+
+ public FakeBlockPos getBlockAtCoords(int x, int y, int z) {
+ String S = "" + x + "@" + y + "@" + z;
+ FakeBlockPos aBlock = mFakeWorldData.get(S);
+ if (aBlock == null) {
+ return new FakeBlockPos(x, y, z, Blocks.air, 0);
+ }
+ return aBlock;
+ }
+
+ public void setBlockAtCoords(int x, int y, int z, Block aBlock, int aMeta) {
+ FakeBlockPos aTempPos = new FakeBlockPos(x, y, z, aBlock, aMeta);
+ Logger.WARNING("Setting " + x + ", " + y + ", " + z + " to " + aBlock.getLocalizedName() + ":" + aMeta);
+ mFakeWorldData.put(aTempPos.getLocationString(), aTempPos);
+ }
+
+ public AutoMap<ItemStack> getAllBlocksStoredInFakeWorld() {
+ AutoMap<ItemStack> aOutput = new AutoMap<ItemStack>();
+ for (FakeBlockPos aPos : mFakeWorldData.values()) {
+ if (aPos == null || aPos.getBlockAtPos() == Blocks.air) {
+ continue;
+ } else {
+ ItemStack aTempStack = ItemUtils.simpleMetaStack(aPos.getBlockAtPos(), aPos.getMetaAtPos(), 1);
+ if (ItemUtils.checkForInvalidItems(aTempStack)) {
+ // Logger.WARNING("Output: "+aTempStack.getDisplayName());
+ aOutput.put(aTempStack);
+ }
+ }
+ }
+ return aOutput;
+ }
+
+ public Block getBlock(int x, int y, int z) {
+ FakeBlockPos aPos = getBlockAtCoords(x, y, z);
+ return aPos.getBlockAtPos();
+ }
+
+ public boolean isAirBlock(int x, int y, int z) {
+ Block aBlock = getBlock(x, y, z);
+ return aBlock == Blocks.air || aBlock.getMaterial() == Material.air;
+ }
+
+ @Override
+ public TileEntity getTileEntity(int p_147438_1_, int p_147438_2_, int p_147438_3_) {
+ return null;
+ }
+
+ @Override
+ public int getLightBrightnessForSkyBlocks(int p_72802_1_, int p_72802_2_, int p_72802_3_, int p_72802_4_) {
+ return 0;
+ }
+
+ @Override
+ public int getBlockMetadata(int x, int y, int z) {
+ return getBlockAtCoords(x, y, z).getMetaAtPos();
+ }
+
+ @Override
+ public int isBlockProvidingPowerTo(int p_72879_1_, int p_72879_2_, int p_72879_3_, int p_72879_4_) {
+ return 0;
+ }
+
+ @Override
+ public BiomeGenBase getBiomeGenForCoords(int p_72807_1_, int p_72807_2_) {
+ return BiomeGenBase.plains;
+ }
+
+ @Override
+ public int getHeight() {
+ return aWorldHeight;
+ }
+
+ @Override
+ public boolean extendedLevelsInChunkCache() {
+ return false;
+ }
+
+ @Override
+ public boolean isSideSolid(int x, int y, int z, ForgeDirection side, boolean _default) {
+ if (!isAirBlock(x, y, z)) {
+ return true;
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/FluidGT6.java b/src/main/java/gtPlusPlus/api/objects/minecraft/FluidGT6.java
index 2535046792..1cc3c2c0aa 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/FluidGT6.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/FluidGT6.java
@@ -1,31 +1,31 @@
package gtPlusPlus.api.objects.minecraft;
import gregtech.api.GregTech_API;
-
import gtPlusPlus.core.lib.CORE;
import net.minecraftforge.fluids.Fluid;
-public class FluidGT6 extends Fluid implements Runnable
-{
- private final short[] mRGBa;
- public final String mTextureName;
+public class FluidGT6 extends Fluid implements Runnable {
+ private final short[] mRGBa;
+ public final String mTextureName;
- public FluidGT6(final String aName, final String aTextureName, final short[] aRGBa) {
- super(aName);
- this.mRGBa = aRGBa;
- this.mTextureName = aTextureName;
- if (GregTech_API.sGTBlockIconload != null) {
- GregTech_API.sGTBlockIconload.add(this);
- }
- }
+ public FluidGT6(final String aName, final String aTextureName, final short[] aRGBa) {
+ super(aName);
+ this.mRGBa = aRGBa;
+ this.mTextureName = aTextureName;
+ if (GregTech_API.sGTBlockIconload != null) {
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+ }
- @Override
- public int getColor() {
- return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16) | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8) | Math.max(0, Math.min(255, this.mRGBa[2]));
- }
+ @Override
+ public int getColor() {
+ return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16)
+ | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8)
+ | Math.max(0, Math.min(255, this.mRGBa[2]));
+ }
- @Override
- public void run() {
- this.setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID+ ":" + "fluids/fluid." + this.mTextureName));
- }
+ @Override
+ public void run() {
+ this.setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + "fluids/fluid." + this.mTextureName));
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/FormattedTooltipString.java b/src/main/java/gtPlusPlus/api/objects/minecraft/FormattedTooltipString.java
index ec13c82ea0..73d17aba39 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/FormattedTooltipString.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/FormattedTooltipString.java
@@ -2,24 +2,22 @@ package gtPlusPlus.api.objects.minecraft;
public class FormattedTooltipString {
- public final String mText;
- public final boolean mPrefix;
-
- public FormattedTooltipString(String aText, boolean aPrefix) {
- mText = aText;
- mPrefix = aPrefix;
- }
-
- public String getTooltip(Object aTagValue) {
- String aTip;
-
- if (mPrefix) {
- aTip = mText+": "+aTagValue.toString();
- }
- else {
- aTip = ""+aTagValue.toString()+": "+mText;
- }
- return aTip;
- }
-
+ public final String mText;
+ public final boolean mPrefix;
+
+ public FormattedTooltipString(String aText, boolean aPrefix) {
+ mText = aText;
+ mPrefix = aPrefix;
+ }
+
+ public String getTooltip(Object aTagValue) {
+ String aTip;
+
+ if (mPrefix) {
+ aTip = mText + ": " + aTagValue.toString();
+ } else {
+ aTip = "" + aTagValue.toString() + ": " + mText;
+ }
+ return aTip;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java b/src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java
index 9c1b231961..b49114e610 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java
@@ -1,42 +1,41 @@
package gtPlusPlus.api.objects.minecraft;
import net.minecraft.item.ItemStack;
-
import net.minecraftforge.fluids.FluidStack;
public class GenericStack {
- private ItemStack mItemStack;
- private FluidStack mFluidStack;
-
- public GenericStack(ItemStack s){
- this.mItemStack = s;
- this.mFluidStack = null;
- }
-
- public GenericStack(FluidStack f){
- this.mItemStack = null;
- this.mFluidStack = f;
- }
-
- public GenericStack() {
- this.mItemStack = null;
- this.mFluidStack = null;
- }
-
- public synchronized final FluidStack getFluidStack() {
- return mFluidStack;
- }
-
- public synchronized final ItemStack getItemStack() {
- return mItemStack;
- }
-
- public synchronized final void setItemStack(ItemStack mItemStack) {
- this.mItemStack = mItemStack;
- }
-
- public synchronized final void setFluidStack(FluidStack mFluidStack) {
- this.mFluidStack = mFluidStack;
- }
+ private ItemStack mItemStack;
+ private FluidStack mFluidStack;
+
+ public GenericStack(ItemStack s) {
+ this.mItemStack = s;
+ this.mFluidStack = null;
+ }
+
+ public GenericStack(FluidStack f) {
+ this.mItemStack = null;
+ this.mFluidStack = f;
+ }
+
+ public GenericStack() {
+ this.mItemStack = null;
+ this.mFluidStack = null;
+ }
+
+ public final synchronized FluidStack getFluidStack() {
+ return mFluidStack;
+ }
+
+ public final synchronized ItemStack getItemStack() {
+ return mItemStack;
+ }
+
+ public final synchronized void setItemStack(ItemStack mItemStack) {
+ this.mItemStack = mItemStack;
+ }
+
+ public final synchronized void setFluidStack(FluidStack mFluidStack) {
+ this.mFluidStack = mFluidStack;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
index fa85f23cf3..9500d862fa 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
@@ -6,53 +6,52 @@ import gtPlusPlus.core.handler.COMPAT_HANDLER;
public abstract class ItemPackage implements RunnableWithInfo<String> {
- public ItemPackage() {
- this(false);
- }
-
- public ItemPackage(boolean hasExtraLateRun) {
- // Register for late run
- COMPAT_HANDLER.mObjectsToRunInPostInit.put(this);
- if (hasExtraLateRun) {
- COMPAT_HANDLER.mObjectsToRunInOnLoadComplete.put(this);
- }
- init();
- }
-
- @Override
- public final void run() {
- generateRecipes();
- }
-
- @Override
- public final String getInfoData() {
- return errorMessage();
- }
-
- public abstract String errorMessage();
-
- public abstract boolean generateRecipes();
-
- private final void init() {
- items();
- blocks();
- fluids();
- }
-
- public abstract void items();
-
- public abstract void blocks();
-
- public abstract void fluids();
-
- /**
- * Override this to handle GT Recipe map manipulation after they're Baked.
- * @param event - the {@link FMLLoadCompleteEvent}.
- * @return - Did we do anything?
- */
- public boolean onLoadComplete(FMLLoadCompleteEvent event) {
- return false;
- };
-
-
+ public ItemPackage() {
+ this(false);
+ }
+
+ public ItemPackage(boolean hasExtraLateRun) {
+ // Register for late run
+ COMPAT_HANDLER.mObjectsToRunInPostInit.put(this);
+ if (hasExtraLateRun) {
+ COMPAT_HANDLER.mObjectsToRunInOnLoadComplete.put(this);
+ }
+ init();
+ }
+
+ @Override
+ public final void run() {
+ generateRecipes();
+ }
+
+ @Override
+ public final String getInfoData() {
+ return errorMessage();
+ }
+
+ public abstract String errorMessage();
+
+ public abstract boolean generateRecipes();
+
+ private final void init() {
+ items();
+ blocks();
+ fluids();
+ }
+
+ public abstract void items();
+
+ public abstract void blocks();
+
+ public abstract void fluids();
+
+ /**
+ * Override this to handle GT Recipe map manipulation after they're Baked.
+ * @param event - the {@link FMLLoadCompleteEvent}.
+ * @return - Did we do anything?
+ */
+ public boolean onLoadComplete(FMLLoadCompleteEvent event) {
+ return false;
+ }
+ ;
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java
index 476926826b..7e0e0bb9ea 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java
@@ -1,35 +1,33 @@
package gtPlusPlus.api.objects.minecraft;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
public class ItemStackData {
- protected final Item mItem;
- protected final int mDamage;
- protected final int mStackSize;
- protected final NBTTagCompound mNBT;
- protected final String mUniqueDataTag;
-
- public ItemStackData (ItemStack aStack) {
- mItem = aStack.getItem();
- mDamage = aStack.getItemDamage();
- mStackSize = aStack.stackSize;
- mNBT = (aStack.getTagCompound() != null ? aStack.getTagCompound() : new NBTTagCompound());
- mUniqueDataTag = ""+Item.getIdFromItem(mItem)+""+mDamage+""+mStackSize+""+mNBT.getId();
- }
-
- public String getUniqueDataIdentifier() {
- return this.mUniqueDataTag;
- }
-
- public ItemStack getStack() {
- ItemStack aTemp = ItemUtils.simpleMetaStack(mItem, mDamage, mStackSize);
- aTemp.setTagCompound(mNBT);
- return aTemp;
- }
-
+ protected final Item mItem;
+ protected final int mDamage;
+ protected final int mStackSize;
+ protected final NBTTagCompound mNBT;
+ protected final String mUniqueDataTag;
+
+ public ItemStackData(ItemStack aStack) {
+ mItem = aStack.getItem();
+ mDamage = aStack.getItemDamage();
+ mStackSize = aStack.stackSize;
+ mNBT = (aStack.getTagCompound() != null ? aStack.getTagCompound() : new NBTTagCompound());
+ mUniqueDataTag = "" + Item.getIdFromItem(mItem) + "" + mDamage + "" + mStackSize + "" + mNBT.getId();
+ }
+
+ public String getUniqueDataIdentifier() {
+ return this.mUniqueDataTag;
+ }
+
+ public ItemStack getStack() {
+ ItemStack aTemp = ItemUtils.simpleMetaStack(mItem, mDamage, mStackSize);
+ aTemp.setTagCompound(mNBT);
+ return aTemp;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java b/src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java
index 78e925fe04..a8768f7604 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java
@@ -1,123 +1,120 @@
package gtPlusPlus.api.objects.minecraft;
-import java.util.Collection;
-import java.util.Iterator;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Recipe;
-
import gtPlusPlus.api.objects.data.AutoMap;
+import java.util.Collection;
+import java.util.Iterator;
public class NoConflictGTRecipeMap implements Collection<GT_Recipe> {
- private AutoMap<GT_Recipe> mRecipeCache = new AutoMap<GT_Recipe>();
- private final IGregTechTileEntity mMachineType;
-
- public NoConflictGTRecipeMap () {
- this(null);
- }
-
- public NoConflictGTRecipeMap (IGregTechTileEntity tile0) {
- this.mMachineType = tile0;
- }
- public boolean put(GT_Recipe recipe) {
- return add(recipe);
- }
-
- public boolean add(GT_Recipe recipe) {
- return mRecipeCache.setValue(recipe);
- }
-
- public Collection<GT_Recipe> getRecipeMap() {
- return mRecipeCache.values();
- }
-
- public boolean isMapValidForMachine(IGregTechTileEntity tile) {
- return tile == mMachineType;
- }
-
- @Override
- public boolean addAll(Collection<? extends GT_Recipe> arg0) {
- int a = 0;
- for (Object v : arg0) {
- if (!this.mRecipeCache.containsValue((GT_Recipe) v)) {
- this.mRecipeCache.put((GT_Recipe) v);
- a++;
- }
- }
- return a > 0;
- }
-
- @Override
- public void clear() {
- mRecipeCache.clear();
- }
-
- @Override
- public boolean contains(Object arg0) {
- return mRecipeCache.containsValue((GT_Recipe) arg0);
- }
-
- @Override
- public boolean containsAll(Collection<?> arg0) {
- int a = 0;
- for (Object v : arg0) {
- if (this.mRecipeCache.containsValue((GT_Recipe) v)) {
- a++;
- }
- }
- return a == arg0.size();
- }
-
- @Override
- public boolean isEmpty() {
- return mRecipeCache.isEmpty();
- }
-
- @Override
- public Iterator<GT_Recipe> iterator() {
- return mRecipeCache.iterator();
- }
-
- @Override
- public boolean remove(Object arg0) {
- return mRecipeCache.remove((GT_Recipe) arg0);
- }
-
- @Override
- public boolean removeAll(Collection<?> arg0) {
- int a = 0;
- for (Object v : arg0) {
- if (this.mRecipeCache.containsValue((GT_Recipe) v)) {
- this.mRecipeCache.remove((GT_Recipe) v);
- a++;
- }
- }
- return a > 0;
- }
-
- @Override
- public boolean retainAll(Collection<?> arg0) {
- int mStartSize = this.mRecipeCache.size();
- this.mRecipeCache = (AutoMap<GT_Recipe>) arg0;
- int mEndsize = this.mRecipeCache.size();
- return mStartSize != mEndsize;
- }
-
- @Override
- public int size() {
- return this.mRecipeCache.size();
- }
-
- @Override
- public Object[] toArray() {
- return this.mRecipeCache.toArray();
- }
-
- @Override
- public <T> T[] toArray(T[] arg0) {
- return (T[]) this.mRecipeCache.toArray();
- }
-
-
+ private AutoMap<GT_Recipe> mRecipeCache = new AutoMap<GT_Recipe>();
+ private final IGregTechTileEntity mMachineType;
+
+ public NoConflictGTRecipeMap() {
+ this(null);
+ }
+
+ public NoConflictGTRecipeMap(IGregTechTileEntity tile0) {
+ this.mMachineType = tile0;
+ }
+
+ public boolean put(GT_Recipe recipe) {
+ return add(recipe);
+ }
+
+ public boolean add(GT_Recipe recipe) {
+ return mRecipeCache.setValue(recipe);
+ }
+
+ public Collection<GT_Recipe> getRecipeMap() {
+ return mRecipeCache.values();
+ }
+
+ public boolean isMapValidForMachine(IGregTechTileEntity tile) {
+ return tile == mMachineType;
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends GT_Recipe> arg0) {
+ int a = 0;
+ for (Object v : arg0) {
+ if (!this.mRecipeCache.containsValue((GT_Recipe) v)) {
+ this.mRecipeCache.put((GT_Recipe) v);
+ a++;
+ }
+ }
+ return a > 0;
+ }
+
+ @Override
+ public void clear() {
+ mRecipeCache.clear();
+ }
+
+ @Override
+ public boolean contains(Object arg0) {
+ return mRecipeCache.containsValue((GT_Recipe) arg0);
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> arg0) {
+ int a = 0;
+ for (Object v : arg0) {
+ if (this.mRecipeCache.containsValue((GT_Recipe) v)) {
+ a++;
+ }
+ }
+ return a == arg0.size();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return mRecipeCache.isEmpty();
+ }
+
+ @Override
+ public Iterator<GT_Recipe> iterator() {
+ return mRecipeCache.iterator();
+ }
+
+ @Override
+ public boolean remove(Object arg0) {
+ return mRecipeCache.remove((GT_Recipe) arg0);
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> arg0) {
+ int a = 0;
+ for (Object v : arg0) {
+ if (this.mRecipeCache.containsValue((GT_Recipe) v)) {
+ this.mRecipeCache.remove((GT_Recipe) v);
+ a++;
+ }
+ }
+ return a > 0;
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> arg0) {
+ int mStartSize = this.mRecipeCache.size();
+ this.mRecipeCache = (AutoMap<GT_Recipe>) arg0;
+ int mEndsize = this.mRecipeCache.size();
+ return mStartSize != mEndsize;
+ }
+
+ @Override
+ public int size() {
+ return this.mRecipeCache.size();
+ }
+
+ @Override
+ public Object[] toArray() {
+ return this.mRecipeCache.toArray();
+ }
+
+ @Override
+ public <T> T[] toArray(T[] arg0) {
+ return (T[]) this.mRecipeCache.toArray();
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java b/src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java
index 7c418b5a77..0ec01e3825 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java
@@ -1,11 +1,10 @@
package gtPlusPlus.api.objects.minecraft;
-import java.util.HashMap;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
import gtPlusPlus.core.util.Utils;
+import java.util.HashMap;
import net.minecraft.util.IIcon;
/**
@@ -13,52 +12,51 @@ import net.minecraft.util.IIcon;
* @author Alkalus
*
*/
-public class SafeTexture implements Runnable {
+public class SafeTexture implements Runnable {
+
+ @SideOnly(Side.CLIENT)
+ private static final HashMap<Integer, IIcon> mHashToIconCache = new HashMap<Integer, IIcon>();
+
+ @SideOnly(Side.CLIENT)
+ private static final HashMap<String, Integer> mPathToHashCash = new HashMap<String, Integer>();
+
+ private static final HashMap<String, SafeTexture> mTextureObjectCache = new HashMap<String, SafeTexture>();
+
+ private final int mHash;
+
+ private final String mTextureName;
+
+ private static final String getKey(String aTexPath) {
+ String aNameKey = Utils.sanitizeString(aTexPath);
+ aNameKey = aNameKey.replace('/', ' ');
+ aNameKey = aNameKey.toLowerCase();
+ return aNameKey;
+ }
+
+ public static SafeTexture register(String aTexturePath) {
+ String aNameKey = getKey(aTexturePath);
+ SafeTexture g = mTextureObjectCache.get(aNameKey);
+ if (g == null) {
+ g = new SafeTexture(aTexturePath);
+ mTextureObjectCache.put(aNameKey, g);
+ mPathToHashCash.put(aTexturePath, aTexturePath.hashCode());
+ }
+ return g;
+ }
- @SideOnly(Side.CLIENT)
- private static final HashMap<Integer, IIcon> mHashToIconCache = new HashMap<Integer, IIcon>();
-
- @SideOnly(Side.CLIENT)
- private static final HashMap<String, Integer> mPathToHashCash = new HashMap<String, Integer>();
-
- private static final HashMap<String, SafeTexture> mTextureObjectCache = new HashMap<String, SafeTexture>();
-
- private final int mHash;
-
- private final String mTextureName;
-
- private final static String getKey(String aTexPath) {
- String aNameKey = Utils.sanitizeString(aTexPath);
- aNameKey = aNameKey.replace('/', ' ');
- aNameKey = aNameKey.toLowerCase();
- return aNameKey;
- }
-
- public static SafeTexture register(String aTexturePath) {
- String aNameKey = getKey(aTexturePath);
- SafeTexture g = mTextureObjectCache.get(aNameKey);
- if (g == null) {
- g = new SafeTexture(aTexturePath);
- mTextureObjectCache.put(aNameKey, g);
- mPathToHashCash.put(aTexturePath, aTexturePath.hashCode());
- }
- return g;
- }
-
- private SafeTexture(String aTexturePath) {
- mTextureName = aTexturePath;
- mHash = getKey(aTexturePath).hashCode();
- GregTech_API.sGTBlockIconload.add(this);
- }
+ private SafeTexture(String aTexturePath) {
+ mTextureName = aTexturePath;
+ mHash = getKey(aTexturePath).hashCode();
+ GregTech_API.sGTBlockIconload.add(this);
+ }
- @SideOnly(Side.CLIENT)
- public IIcon getIcon() {
- return mHashToIconCache.get(mHash);
- }
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon() {
+ return mHashToIconCache.get(mHash);
+ }
- @Override
- public void run() {
- mHashToIconCache.put(getKey(mTextureName).hashCode(), GregTech_API.sBlockIcons.registerIcon(mTextureName));
- }
-
+ @Override
+ public void run() {
+ mHashToIconCache.put(getKey(mTextureName).hashCode(), GregTech_API.sBlockIcons.registerIcon(mTextureName));
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
index c0e9b20c54..98232fb4c4 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
@@ -10,241 +10,239 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
public class ShapedRecipe {
- private final static String CHARS = "abcdefghijklmnop";
- public ShapedOreRecipe mRecipe;
-
- ItemStack[] mBlackList = null;
-
- public ShapedRecipe(
- Object aInput1, Object aInput2, Object aInput3,
- Object aInput4, Object aInput5, Object aInput6,
- Object aInput7, Object aInput8, Object aInput9,
- ItemStack aOutput) {
-
- this(new Object[] {aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, aOutput);
-
- }
-
- public ShapedRecipe(Object[] aInputs, ItemStack aOutput) {
- String aGridWhole = "";
- String aGrid[] = new String[3];
- char[] aChar = new char[9];
- String[] aLoggingInfo = new String[9];
-
- if (mBlackList == null) {
- mBlackList = new ItemStack[] {};
- }
-
- //Just to be safe
- try {
- int xSlot = 0;
- int xNull = 0;
- for (Object u : aInputs) {
- String mInfo = "";
- if (u instanceof String) {
- mInfo = (String) u;
- Logger.RECIPE("Input slot "+xSlot+++" contains "+mInfo);
- }
- else if (u instanceof ItemStack || u instanceof Item) {
- if (u instanceof Item) {
- u = ItemUtils.getSimpleStack((Item) u);
- }
- mInfo = ((ItemStack) u).getDisplayName();
- Logger.RECIPE("Input slot "+xSlot+++" contains "+mInfo);
- }
- else if (u == null) {
- xNull++;
- }
- }
- Logger.RECIPE("Found "+xNull+" null inputs.");
- //Check if the output is invalid
- if (aOutput != null && xNull < 9) {
-
- for (ItemStack q : mBlackList) {
- if (q != null) {
- if (q.isItemEqual(aOutput)) {
- Logger.RECIPE("Found recipe Alkalus is Debugging.");
- }
- }
- }
-
- Object[] mVarags2 = null;
- Logger.RECIPE("Generating Shaped Crafting Recipe for "+aOutput.getDisplayName());
-
- if (aInputs.length < 9 || aInputs.length > 9) {
- Logger.RECIPE("[Fix] Recipe for "+aOutput.getDisplayName()+" has incorrect number of inputs. Size: "+aInputs.length+".");
- //Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(1));
- //Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(2));
- //Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(3));
- //Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(4));
- //Logger.RECIPE("Reciped exists at location: "+ReflectionUtils.getMethodName(1));
- }
-
-
- //Build a Pair for each slot
- AutoMap<Pair<Character, Object>> aRecipePairs = new AutoMap<Pair<Character, Object>>();
- int aCharSlot = 0;
- int aMemSlot = 0;
- int aInfoSlot = 0;
- for (Object stack : aInputs) {
- if (stack != null) {
- String mInfo = "";
- if (stack instanceof String) {
- mInfo = (String) stack;
- }
- else if (stack instanceof ItemStack || stack instanceof Item) {
- if (stack instanceof Item) {
- stack = ItemUtils.getSimpleStack((Item) stack);
- }
- mInfo = ((ItemStack) stack).getDisplayName();
- }
- aRecipePairs.put(new Pair<Character, Object>(CHARS.charAt(aCharSlot), stack));
- Logger.RECIPE("Storing '"+CHARS.charAt(aCharSlot)+"' with an object of type "+stack.getClass().getSimpleName()+" and a value of "+mInfo);
- aChar[aMemSlot++] = CHARS.charAt(aCharSlot);
- aCharSlot++;
- aLoggingInfo[aInfoSlot++] = mInfo;
- }
- else {
- aRecipePairs.put(new Pair<Character, Object>(' ', (ItemStack) null));
- Logger.RECIPE("Storing ' ' with an object of type null");
- aChar[aMemSlot++] = ' ';
- aLoggingInfo[aInfoSlot++] = "Empty";
- }
- }
-
- Logger.RECIPE(aRecipePairs.size()+" Char|Object pairs registered for recipe.");
- //If we have enough valid slots, iterate them and build a String which represents the entire grid.
- //If this String is the correct length, we will split it into thirds and build the grid String array.
- if (aRecipePairs.size() == 9) {
-
- for (Pair<Character, Object> h : aRecipePairs) {
- if (h.getKey() != null) {
- aGridWhole += String.valueOf(h.getKey());
- Logger.RECIPE("Adding '"+String.valueOf(h.getKey())+"' to aGridWhole.");
- }
- }
-
- Logger.RECIPE("aGridWhole: "+aGridWhole+" | size: "+aGridWhole.length());
-
- //Build crafting grid
- if (aGridWhole.length() == 9) {
- Logger.RECIPE("aGridWhole size == 9");
- aGrid[0] = ""+aGridWhole.charAt(0)+aGridWhole.charAt(1)+aGridWhole.charAt(2);
- aGrid[1] = ""+aGridWhole.charAt(3)+aGridWhole.charAt(4)+aGridWhole.charAt(5);
- aGrid[2] = ""+aGridWhole.charAt(6)+aGridWhole.charAt(7)+aGridWhole.charAt(8);
- }
- else {
- Logger.RECIPE("[Fix] Grid length for recipe outputting "+aOutput.getDisplayName()+" is not 9.");
- }
-
- //Rebuild the Map without spaces
- aRecipePairs.clear();
- aCharSlot = 0;
-
- //The amount of spaces in the Varags that the Shape strings takes.
- //Currently they are inserted as a single array into index 0.
- final int KEY_COUNTER = 1;
-
- int counter = KEY_COUNTER;
- for (Object stack : aInputs) {
- if (stack != null) {
- String mInfo = "";
- if (stack instanceof String) {
- mInfo = (String) stack;
- }
- else if (stack instanceof ItemStack || stack instanceof Item) {
- if (stack instanceof Item) {
- stack = ItemUtils.getSimpleStack((Item) stack);
- }
- mInfo = ((ItemStack) stack).getDisplayName();
- }
- aRecipePairs.put(new Pair<Character, Object>(CHARS.charAt(aCharSlot), stack));
- Logger.RECIPE("Registering Pair of '"+CHARS.charAt(aCharSlot)+"' and a "+stack.getClass().getSimpleName()+" object. Object has a value of "+mInfo);
- aCharSlot++;
- counter++;
- }
- }
-
- Logger.RECIPE("Counter started at "+KEY_COUNTER+", counter is now at "+counter+". Trying to create Varag array with a size of "+(KEY_COUNTER+(counter-KEY_COUNTER)*2));
- //Counter started at 3, counter is now at 4. Trying to create Varag array with a size of 2
-
- //Register the shaped grid straight to the varags
- mVarags2 = new Object[(KEY_COUNTER+(counter-KEY_COUNTER)*2)];
- /*mVarags2[0] = aGrid[0];
- mVarags2[1] = aGrid[1];
- mVarags2[2] = aGrid[2];*/
- mVarags2[0] = aGrid;
-
- //Add Each Char, then Item to the varags, sequentially.
- int counter2 = KEY_COUNTER;
- for (Pair<Character, Object> r : aRecipePairs) {
- char c = r.getKey();
- Object o = r.getValue();
-
- if (o instanceof ItemStack || o instanceof Item) {
- if (o instanceof Item) {
- o = ItemUtils.getSimpleStack((Item) o);
- }
- o = ((ItemStack) o).copy();
- }
-
- mVarags2[counter2] = (char) c;
- mVarags2[counter2+1] = o;
- counter2 += 2;
- }
-
- Logger.RECIPE("Recipe Summary");
- Logger.RECIPE("+ = + = + = +");
- Logger.RECIPE("= "+aChar[0]+" = "+aChar[1]+" = "+aChar[2]+" =");
- Logger.RECIPE("+ = + = + = +");
- Logger.RECIPE("= "+aChar[3]+" = "+aChar[4]+" = "+aChar[5]+" =");
- Logger.RECIPE("+ = + = + = +");
- Logger.RECIPE("= "+aChar[6]+" = "+aChar[7]+" = "+aChar[8]+" =");
- Logger.RECIPE("+ = + = + = +");
- for (int r=0;r<9;r++) {
- if (aChar[r] != ' ') {
- Logger.RECIPE(""+aChar[r]+" : "+aLoggingInfo[r]);
- }
- }
-
- }
- else {
- Logger.RECIPE("[Fix] Recipe for "+aOutput.getDisplayName()+" contains a strange number of inputs.");
- }
-
- //Try set the recipe for this object.
- ShapedOreRecipe testRecipe = null;
- try {
- testRecipe = new ShapedOreRecipe(aOutput, mVarags2);
- }
- catch (Throwable t) {
- Logger.RECIPE("[Fix][0] Error thrown when making a ShapedOreRecipe object.");
- t.printStackTrace();
- }
- if (testRecipe == null) {
- this.mRecipe = null;
- Logger.RECIPE("[Fix] Failed to generate a shaped recipe.");
- }
- else {
- this.mRecipe = testRecipe;
- Logger.RECIPE("Generated a shaped recipe successfully.");
- }
- }
-
- //Output was not valid
- else {
- this.mRecipe = null;
- Logger.RECIPE("[Fix] Failed to generate a shaped recipe. Output was not valid.");
- }
-
-
- }
- catch(Throwable t) {
- this.mRecipe = null;
- Logger.RECIPE("[Fix][1] Error thrown when making a ShapedOreRecipe object.");
- t.printStackTrace();
- }
-
- }
-
+ private static final String CHARS = "abcdefghijklmnop";
+ public ShapedOreRecipe mRecipe;
+
+ ItemStack[] mBlackList = null;
+
+ public ShapedRecipe(
+ Object aInput1,
+ Object aInput2,
+ Object aInput3,
+ Object aInput4,
+ Object aInput5,
+ Object aInput6,
+ Object aInput7,
+ Object aInput8,
+ Object aInput9,
+ ItemStack aOutput) {
+
+ this(new Object[] {aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, aOutput);
+ }
+
+ public ShapedRecipe(Object[] aInputs, ItemStack aOutput) {
+ String aGridWhole = "";
+ String aGrid[] = new String[3];
+ char[] aChar = new char[9];
+ String[] aLoggingInfo = new String[9];
+
+ if (mBlackList == null) {
+ mBlackList = new ItemStack[] {};
+ }
+
+ // Just to be safe
+ try {
+ int xSlot = 0;
+ int xNull = 0;
+ for (Object u : aInputs) {
+ String mInfo = "";
+ if (u instanceof String) {
+ mInfo = (String) u;
+ Logger.RECIPE("Input slot " + xSlot++ + " contains " + mInfo);
+ } else if (u instanceof ItemStack || u instanceof Item) {
+ if (u instanceof Item) {
+ u = ItemUtils.getSimpleStack((Item) u);
+ }
+ mInfo = ((ItemStack) u).getDisplayName();
+ Logger.RECIPE("Input slot " + xSlot++ + " contains " + mInfo);
+ } else if (u == null) {
+ xNull++;
+ }
+ }
+ Logger.RECIPE("Found " + xNull + " null inputs.");
+ // Check if the output is invalid
+ if (aOutput != null && xNull < 9) {
+
+ for (ItemStack q : mBlackList) {
+ if (q != null) {
+ if (q.isItemEqual(aOutput)) {
+ Logger.RECIPE("Found recipe Alkalus is Debugging.");
+ }
+ }
+ }
+
+ Object[] mVarags2 = null;
+ Logger.RECIPE("Generating Shaped Crafting Recipe for " + aOutput.getDisplayName());
+
+ if (aInputs.length < 9 || aInputs.length > 9) {
+ Logger.RECIPE("[Fix] Recipe for " + aOutput.getDisplayName()
+ + " has incorrect number of inputs. Size: " + aInputs.length + ".");
+ // Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(1));
+ // Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(2));
+ // Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(3));
+ // Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(4));
+ // Logger.RECIPE("Reciped exists at location: "+ReflectionUtils.getMethodName(1));
+ }
+
+ // Build a Pair for each slot
+ AutoMap<Pair<Character, Object>> aRecipePairs = new AutoMap<Pair<Character, Object>>();
+ int aCharSlot = 0;
+ int aMemSlot = 0;
+ int aInfoSlot = 0;
+ for (Object stack : aInputs) {
+ if (stack != null) {
+ String mInfo = "";
+ if (stack instanceof String) {
+ mInfo = (String) stack;
+ } else if (stack instanceof ItemStack || stack instanceof Item) {
+ if (stack instanceof Item) {
+ stack = ItemUtils.getSimpleStack((Item) stack);
+ }
+ mInfo = ((ItemStack) stack).getDisplayName();
+ }
+ aRecipePairs.put(new Pair<Character, Object>(CHARS.charAt(aCharSlot), stack));
+ Logger.RECIPE("Storing '" + CHARS.charAt(aCharSlot) + "' with an object of type "
+ + stack.getClass().getSimpleName() + " and a value of " + mInfo);
+ aChar[aMemSlot++] = CHARS.charAt(aCharSlot);
+ aCharSlot++;
+ aLoggingInfo[aInfoSlot++] = mInfo;
+ } else {
+ aRecipePairs.put(new Pair<Character, Object>(' ', (ItemStack) null));
+ Logger.RECIPE("Storing ' ' with an object of type null");
+ aChar[aMemSlot++] = ' ';
+ aLoggingInfo[aInfoSlot++] = "Empty";
+ }
+ }
+
+ Logger.RECIPE(aRecipePairs.size() + " Char|Object pairs registered for recipe.");
+ // If we have enough valid slots, iterate them and build a String which represents the entire grid.
+ // If this String is the correct length, we will split it into thirds and build the grid String array.
+ if (aRecipePairs.size() == 9) {
+
+ for (Pair<Character, Object> h : aRecipePairs) {
+ if (h.getKey() != null) {
+ aGridWhole += String.valueOf(h.getKey());
+ Logger.RECIPE("Adding '" + String.valueOf(h.getKey()) + "' to aGridWhole.");
+ }
+ }
+
+ Logger.RECIPE("aGridWhole: " + aGridWhole + " | size: " + aGridWhole.length());
+
+ // Build crafting grid
+ if (aGridWhole.length() == 9) {
+ Logger.RECIPE("aGridWhole size == 9");
+ aGrid[0] = "" + aGridWhole.charAt(0) + aGridWhole.charAt(1) + aGridWhole.charAt(2);
+ aGrid[1] = "" + aGridWhole.charAt(3) + aGridWhole.charAt(4) + aGridWhole.charAt(5);
+ aGrid[2] = "" + aGridWhole.charAt(6) + aGridWhole.charAt(7) + aGridWhole.charAt(8);
+ } else {
+ Logger.RECIPE(
+ "[Fix] Grid length for recipe outputting " + aOutput.getDisplayName() + " is not 9.");
+ }
+
+ // Rebuild the Map without spaces
+ aRecipePairs.clear();
+ aCharSlot = 0;
+
+ // The amount of spaces in the Varags that the Shape strings takes.
+ // Currently they are inserted as a single array into index 0.
+ final int KEY_COUNTER = 1;
+
+ int counter = KEY_COUNTER;
+ for (Object stack : aInputs) {
+ if (stack != null) {
+ String mInfo = "";
+ if (stack instanceof String) {
+ mInfo = (String) stack;
+ } else if (stack instanceof ItemStack || stack instanceof Item) {
+ if (stack instanceof Item) {
+ stack = ItemUtils.getSimpleStack((Item) stack);
+ }
+ mInfo = ((ItemStack) stack).getDisplayName();
+ }
+ aRecipePairs.put(new Pair<Character, Object>(CHARS.charAt(aCharSlot), stack));
+ Logger.RECIPE("Registering Pair of '" + CHARS.charAt(aCharSlot) + "' and a "
+ + stack.getClass().getSimpleName() + " object. Object has a value of " + mInfo);
+ aCharSlot++;
+ counter++;
+ }
+ }
+
+ Logger.RECIPE("Counter started at " + KEY_COUNTER + ", counter is now at " + counter
+ + ". Trying to create Varag array with a size of "
+ + (KEY_COUNTER + (counter - KEY_COUNTER) * 2));
+ // Counter started at 3, counter is now at 4. Trying to create Varag array with a size of 2
+
+ // Register the shaped grid straight to the varags
+ mVarags2 = new Object[(KEY_COUNTER + (counter - KEY_COUNTER) * 2)];
+ /*mVarags2[0] = aGrid[0];
+ mVarags2[1] = aGrid[1];
+ mVarags2[2] = aGrid[2];*/
+ mVarags2[0] = aGrid;
+
+ // Add Each Char, then Item to the varags, sequentially.
+ int counter2 = KEY_COUNTER;
+ for (Pair<Character, Object> r : aRecipePairs) {
+ char c = r.getKey();
+ Object o = r.getValue();
+
+ if (o instanceof ItemStack || o instanceof Item) {
+ if (o instanceof Item) {
+ o = ItemUtils.getSimpleStack((Item) o);
+ }
+ o = ((ItemStack) o).copy();
+ }
+
+ mVarags2[counter2] = (char) c;
+ mVarags2[counter2 + 1] = o;
+ counter2 += 2;
+ }
+
+ Logger.RECIPE("Recipe Summary");
+ Logger.RECIPE("+ = + = + = +");
+ Logger.RECIPE("= " + aChar[0] + " = " + aChar[1] + " = " + aChar[2] + " =");
+ Logger.RECIPE("+ = + = + = +");
+ Logger.RECIPE("= " + aChar[3] + " = " + aChar[4] + " = " + aChar[5] + " =");
+ Logger.RECIPE("+ = + = + = +");
+ Logger.RECIPE("= " + aChar[6] + " = " + aChar[7] + " = " + aChar[8] + " =");
+ Logger.RECIPE("+ = + = + = +");
+ for (int r = 0; r < 9; r++) {
+ if (aChar[r] != ' ') {
+ Logger.RECIPE("" + aChar[r] + " : " + aLoggingInfo[r]);
+ }
+ }
+
+ } else {
+ Logger.RECIPE(
+ "[Fix] Recipe for " + aOutput.getDisplayName() + " contains a strange number of inputs.");
+ }
+
+ // Try set the recipe for this object.
+ ShapedOreRecipe testRecipe = null;
+ try {
+ testRecipe = new ShapedOreRecipe(aOutput, mVarags2);
+ } catch (Throwable t) {
+ Logger.RECIPE("[Fix][0] Error thrown when making a ShapedOreRecipe object.");
+ t.printStackTrace();
+ }
+ if (testRecipe == null) {
+ this.mRecipe = null;
+ Logger.RECIPE("[Fix] Failed to generate a shaped recipe.");
+ } else {
+ this.mRecipe = testRecipe;
+ Logger.RECIPE("Generated a shaped recipe successfully.");
+ }
+ }
+
+ // Output was not valid
+ else {
+ this.mRecipe = null;
+ Logger.RECIPE("[Fix] Failed to generate a shaped recipe. Output was not valid.");
+ }
+
+ } catch (Throwable t) {
+ this.mRecipe = null;
+ Logger.RECIPE("[Fix][1] Error thrown when making a ShapedOreRecipe object.");
+ t.printStackTrace();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java b/src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java
index e610f8fdf0..c5703d12fb 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java
@@ -1,55 +1,52 @@
package gtPlusPlus.api.objects.minecraft;
+import gtPlusPlus.api.objects.data.AutoMap;
import java.util.LinkedHashMap;
import java.util.Set;
-
-import gtPlusPlus.api.objects.data.AutoMap;
import net.minecraft.util.IIcon;
public class TexturePackage {
- private AutoMap<IIcon> mAnimationArray = new AutoMap<IIcon>();
-
- public IIcon getFrame(int aFrame) {
- if (aFrame < 0 || aFrame >= mAnimationArray.size()) {
- return mAnimationArray.get(0);
- }
- return mAnimationArray.get(aFrame);
- }
-
- public boolean addFrame(IIcon aFrame) {
- if (aFrame != null) {
- return mAnimationArray.add(aFrame);
- }
- return false;
- }
-
- public boolean addFrames(AutoMap<IIcon> aFrames) {
- for (IIcon h : aFrames) {
- if (!addFrame(h)) {
- return false;
- }
- }
- return true;
- }
-
- public boolean addFrames(LinkedHashMap<?, IIcon> aFrames) {
- for (IIcon h : aFrames.values()) {
- if (!addFrame(h)) {
- return false;
- }
- }
- return true;
- }
-
- public boolean addFrames(Set<IIcon> aFrames) {
- for (IIcon h : aFrames) {
- if (!addFrame(h)) {
- return false;
- }
- }
- return true;
- }
-
-
+ private AutoMap<IIcon> mAnimationArray = new AutoMap<IIcon>();
+
+ public IIcon getFrame(int aFrame) {
+ if (aFrame < 0 || aFrame >= mAnimationArray.size()) {
+ return mAnimationArray.get(0);
+ }
+ return mAnimationArray.get(aFrame);
+ }
+
+ public boolean addFrame(IIcon aFrame) {
+ if (aFrame != null) {
+ return mAnimationArray.add(aFrame);
+ }
+ return false;
+ }
+
+ public boolean addFrames(AutoMap<IIcon> aFrames) {
+ for (IIcon h : aFrames) {
+ if (!addFrame(h)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public boolean addFrames(LinkedHashMap<?, IIcon> aFrames) {
+ for (IIcon h : aFrames.values()) {
+ if (!addFrame(h)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public boolean addFrames(Set<IIcon> aFrames) {
+ for (IIcon h : aFrames) {
+ if (!addFrame(h)) {
+ return false;
+ }
+ }
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java
index 0ff6e112ac..b40696747b 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java
@@ -1,14 +1,13 @@
package gtPlusPlus.api.objects.minecraft;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-
import gtPlusPlus.GTplusplus;
import gtPlusPlus.GTplusplus.INIT_PHASE;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.tileentities.machines.TileEntityPooCollector;
import gtPlusPlus.core.util.Utils;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
@@ -16,96 +15,93 @@ import net.minecraft.world.chunk.Chunk;
public class ThreadPooCollector extends Thread {
- public boolean canRun = true;
+ public boolean canRun = true;
public boolean isRunning = false;
-
+
private static final long INIT_TIME;
private static long internalTickCounter = 0;
- private static final ThreadPooCollector mThread;
- private static final HashMap<String, Pair<BlockPos, TileEntityPooCollector>> mPooCollectors = new LinkedHashMap<String, Pair<BlockPos, TileEntityPooCollector>>();
-
-
- static {
- mThread = new ThreadPooCollector();
- INIT_TIME = (System.currentTimeMillis());
- }
-
- public ThreadPooCollector() {
+ private static final ThreadPooCollector mThread;
+ private static final HashMap<String, Pair<BlockPos, TileEntityPooCollector>> mPooCollectors =
+ new LinkedHashMap<String, Pair<BlockPos, TileEntityPooCollector>>();
+
+ static {
+ mThread = new ThreadPooCollector();
+ INIT_TIME = (System.currentTimeMillis());
+ }
+
+ public ThreadPooCollector() {
setName("gtpp.handler.poop");
start();
- }
-
- public static ThreadPooCollector getInstance() {
- return mThread;
- }
-
- public static void addTask(TileEntityPooCollector aTile) {
- BlockPos aTempPos = new BlockPos(aTile);
- mPooCollectors.put(aTempPos.getUniqueIdentifier(), new Pair<BlockPos, TileEntityPooCollector>(aTempPos, aTile));
- }
-
- public static void stopThread() {
- mThread.canRun = false;
- }
-
-
- @Override
- public void run() {
-
- if (!isRunning) {
- isRunning = true;
- }
- else {
- return;
- }
+ }
+
+ public static ThreadPooCollector getInstance() {
+ return mThread;
+ }
+
+ public static void addTask(TileEntityPooCollector aTile) {
+ BlockPos aTempPos = new BlockPos(aTile);
+ mPooCollectors.put(aTempPos.getUniqueIdentifier(), new Pair<BlockPos, TileEntityPooCollector>(aTempPos, aTile));
+ }
+
+ public static void stopThread() {
+ mThread.canRun = false;
+ }
+
+ @Override
+ public void run() {
+
+ if (!isRunning) {
+ isRunning = true;
+ } else {
+ return;
+ }
- while (canRun) {
- if (mPooCollectors.isEmpty() || GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED) {
- continue;
- } else {
- internalTickCounter = Utils.getTicksFromSeconds(
- Utils.getSecondsFromMillis(Utils.getMillisSince(INIT_TIME, System.currentTimeMillis())));
- if (internalTickCounter % 100 == 0) {
- for (Pair<BlockPos, TileEntityPooCollector> pair : mPooCollectors.values()) {
- if (pair != null) {
- BlockPos p = pair.getKey();
- if (p != null) {
- if (p.world != null) {
- World w = p.world;
- if (w == null) {
- continue;
- }
- Chunk c = w.getChunkFromBlockCoords(p.xPos, p.zPos);
- if (c != null) {
- if (c.isChunkLoaded) {
- int startX = p.xPos - 2;
- int startY = p.yPos;
- int startZ = p.zPos - 2;
- int endX = p.xPos + 3;
- int endY = p.yPos + 5;
- int endZ = p.zPos + 3;
- AxisAlignedBB box = AxisAlignedBB.getBoundingBox(startX, startY, startZ,
- endX, endY, endZ);
- if (box != null) {
- @SuppressWarnings("unchecked")
- List<EntityAnimal> animals = w.getEntitiesWithinAABB(EntityAnimal.class, box);
- if (animals != null && !animals.isEmpty()) {
- pair.getValue().onPostTick(animals);
- }
- } else {
- continue;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
-
+ while (canRun) {
+ if (mPooCollectors.isEmpty() || GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED) {
+ continue;
+ } else {
+ internalTickCounter = Utils.getTicksFromSeconds(
+ Utils.getSecondsFromMillis(Utils.getMillisSince(INIT_TIME, System.currentTimeMillis())));
+ if (internalTickCounter % 100 == 0) {
+ for (Pair<BlockPos, TileEntityPooCollector> pair : mPooCollectors.values()) {
+ if (pair != null) {
+ BlockPos p = pair.getKey();
+ if (p != null) {
+ if (p.world != null) {
+ World w = p.world;
+ if (w == null) {
+ continue;
+ }
+ Chunk c = w.getChunkFromBlockCoords(p.xPos, p.zPos);
+ if (c != null) {
+ if (c.isChunkLoaded) {
+ int startX = p.xPos - 2;
+ int startY = p.yPos;
+ int startZ = p.zPos - 2;
+ int endX = p.xPos + 3;
+ int endY = p.yPos + 5;
+ int endZ = p.zPos + 3;
+ AxisAlignedBB box = AxisAlignedBB.getBoundingBox(
+ startX, startY, startZ, endX, endY, endZ);
+ if (box != null) {
+ @SuppressWarnings("unchecked")
+ List<EntityAnimal> animals =
+ w.getEntitiesWithinAABB(EntityAnimal.class, box);
+ if (animals != null && !animals.isEmpty()) {
+ pair.getValue().onPostTick(animals);
+ }
+ } else {
+ continue;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoEUBonusMultiBehaviour.java b/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoEUBonusMultiBehaviour.java
index 78341db7a1..4dea1c22d6 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoEUBonusMultiBehaviour.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoEUBonusMultiBehaviour.java
@@ -5,23 +5,22 @@ import net.minecraft.item.ItemStack;
public class NoEUBonusMultiBehaviour extends SpecialMultiBehaviour {
- public NoEUBonusMultiBehaviour() {
- // Used by other mods which may wish to not obtain bonus outputs on their Sifting or Maceration recipes.
- }
-
- @Override
- public ItemStack getTriggerItem() {
- return GregtechItemList.Chip_MultiNerf_NoEuBonus.get(1);
- }
+ public NoEUBonusMultiBehaviour() {
+ // Used by other mods which may wish to not obtain bonus outputs on their Sifting or Maceration recipes.
+ }
- @Override
- public String getTriggerItemTooltip() {
- return "Prevents EU discounts on GT++ multiblocks when used";
- }
+ @Override
+ public ItemStack getTriggerItem() {
+ return GregtechItemList.Chip_MultiNerf_NoEuBonus.get(1);
+ }
- @Override
- public int getEUPercent() {
- return 0;
- }
+ @Override
+ public String getTriggerItemTooltip() {
+ return "Prevents EU discounts on GT++ multiblocks when used";
+ }
+ @Override
+ public int getEUPercent() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java b/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java
index 8137f2573d..d8ddbea5e7 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java
@@ -5,23 +5,22 @@ import net.minecraft.item.ItemStack;
public class NoOutputBonusMultiBehaviour extends SpecialMultiBehaviour {
- public NoOutputBonusMultiBehaviour() {
- // Used by other mods which may wish to not obtain bonus outputs on their Sifting or Maceration recipes.
- }
-
- @Override
- public ItemStack getTriggerItem() {
- return GregtechItemList.Chip_MultiNerf_NoOutputBonus.get(1);
- }
+ public NoOutputBonusMultiBehaviour() {
+ // Used by other mods which may wish to not obtain bonus outputs on their Sifting or Maceration recipes.
+ }
- @Override
- public String getTriggerItemTooltip() {
- return "Prevents bonus output % on GT++ multiblocks when used";
- }
+ @Override
+ public ItemStack getTriggerItem() {
+ return GregtechItemList.Chip_MultiNerf_NoOutputBonus.get(1);
+ }
- @Override
- public int getOutputChanceRoll() {
- return 10000;
- }
+ @Override
+ public String getTriggerItemTooltip() {
+ return "Prevents bonus output % on GT++ multiblocks when used";
+ }
+ @Override
+ public int getOutputChanceRoll() {
+ return 10000;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoSpeedBonusMultiBehaviour.java b/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoSpeedBonusMultiBehaviour.java
index fe7a90960d..834c93890d 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoSpeedBonusMultiBehaviour.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoSpeedBonusMultiBehaviour.java
@@ -5,23 +5,22 @@ import net.minecraft.item.ItemStack;
public class NoSpeedBonusMultiBehaviour extends SpecialMultiBehaviour {
- public NoSpeedBonusMultiBehaviour() {
- // Used by other mods which may wish to not obtain bonus outputs on their Sifting or Maceration recipes.
- }
-
- @Override
- public ItemStack getTriggerItem() {
- return GregtechItemList.Chip_MultiNerf_NoSpeedBonus.get(1);
- }
+ public NoSpeedBonusMultiBehaviour() {
+ // Used by other mods which may wish to not obtain bonus outputs on their Sifting or Maceration recipes.
+ }
- @Override
- public String getTriggerItemTooltip() {
- return "Prevents speed bonuses on GT++ multiblocks when used";
- }
+ @Override
+ public ItemStack getTriggerItem() {
+ return GregtechItemList.Chip_MultiNerf_NoSpeedBonus.get(1);
+ }
- @Override
- public int getSpeedBonusPercent() {
- return 0;
- }
+ @Override
+ public String getTriggerItemTooltip() {
+ return "Prevents speed bonuses on GT++ multiblocks when used";
+ }
+ @Override
+ public int getSpeedBonusPercent() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java b/src/main/java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java
index e562ccc40b..03f000fcc2 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java
@@ -12,33 +12,32 @@ import net.minecraft.item.ItemStack;
*/
public abstract class SpecialMultiBehaviour {
- private final int mMaxParallelRecipes = Short.MIN_VALUE;
- private final int mEUPercent = Short.MIN_VALUE;
- private final int mSpeedBonusPercent = Short.MIN_VALUE;
- private final int mOutputChanceRoll = Short.MIN_VALUE;
-
- public abstract ItemStack getTriggerItem();
-
- public abstract String getTriggerItemTooltip();
-
- public int getMaxParallelRecipes() {
- return this.mMaxParallelRecipes;
- }
-
- public int getEUPercent() {
- return this.mEUPercent;
- }
-
- public int getSpeedBonusPercent() {
- return this.mSpeedBonusPercent;
- }
-
- public int getOutputChanceRoll() {
- return this.mOutputChanceRoll;
- }
-
- public final boolean isTriggerItem(ItemStack aToMatch) {
- return GT_Utility.areStacksEqual(getTriggerItem(), aToMatch, false);
- }
-
+ private final int mMaxParallelRecipes = Short.MIN_VALUE;
+ private final int mEUPercent = Short.MIN_VALUE;
+ private final int mSpeedBonusPercent = Short.MIN_VALUE;
+ private final int mOutputChanceRoll = Short.MIN_VALUE;
+
+ public abstract ItemStack getTriggerItem();
+
+ public abstract String getTriggerItemTooltip();
+
+ public int getMaxParallelRecipes() {
+ return this.mMaxParallelRecipes;
+ }
+
+ public int getEUPercent() {
+ return this.mEUPercent;
+ }
+
+ public int getSpeedBonusPercent() {
+ return this.mSpeedBonusPercent;
+ }
+
+ public int getOutputChanceRoll() {
+ return this.mOutputChanceRoll;
+ }
+
+ public final boolean isTriggerItem(ItemStack aToMatch) {
+ return GT_Utility.areStacksEqual(getTriggerItem(), aToMatch, false);
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/objects/random/CSPRNG_DO_NOT_USE.java b/src/main/java/gtPlusPlus/api/objects/random/CSPRNG_DO_NOT_USE.java
index b2dc984456..86ea4b4ad6 100644
--- a/src/main/java/gtPlusPlus/api/objects/random/CSPRNG_DO_NOT_USE.java
+++ b/src/main/java/gtPlusPlus/api/objects/random/CSPRNG_DO_NOT_USE.java
@@ -34,12 +34,12 @@
*/
package gtPlusPlus.api.objects.random;
-import java.math.BigInteger;
-import java.security.SecureRandom;
-import java.util.Random;
import gtPlusPlus.api.interfaces.IRandomGenerator;
import gtPlusPlus.core.util.Utils;
+import java.math.BigInteger;
+import java.security.SecureRandom;
+import java.util.Random;
/**
* The Blum-Blum-Shub random number generator.
@@ -112,13 +112,12 @@ public class CSPRNG_DO_NOT_USE extends Random implements IRandomGenerator {
* @param rand A source of randomness
*/
private static BigInteger getPrime(int bits, Random rand) {
- BigInteger p;
- while (true) {
- p = new BigInteger(bits, 100, rand);
- if (p.mod(four).equals(three))
- break;
- }
- return p;
+ BigInteger p;
+ while (true) {
+ p = new BigInteger(bits, 100, rand);
+ if (p.mod(four).equals(three)) break;
+ }
+ return p;
}
/**
@@ -132,14 +131,14 @@ public class CSPRNG_DO_NOT_USE extends Random implements IRandomGenerator {
* @return A BigInteger, the <i>n</i>.
*/
public static BigInteger generateN(int bits, Random rand) {
- BigInteger p = getPrime(bits/2, rand);
- BigInteger q = getPrime(bits/2, rand);
+ BigInteger p = getPrime(bits / 2, rand);
+ BigInteger q = getPrime(bits / 2, rand);
- // make sure p != q (almost always true, but just in case, check)
- while (p.equals(q)) {
- q = getPrime(bits, rand);
- }
- return p.multiply(q);
+ // make sure p != q (almost always true, but just in case, check)
+ while (p.equals(q)) {
+ q = getPrime(bits, rand);
+ }
+ return p.multiply(q);
}
/**
@@ -148,7 +147,7 @@ public class CSPRNG_DO_NOT_USE extends Random implements IRandomGenerator {
* @param bits number of bits
*/
public CSPRNG_DO_NOT_USE(int bits) {
- this(bits, new Random());
+ this(bits, new Random());
}
/**
@@ -158,7 +157,7 @@ public class CSPRNG_DO_NOT_USE extends Random implements IRandomGenerator {
* @param rand
*/
public CSPRNG_DO_NOT_USE(int bits, Random rand) {
- this(generateN(bits, rand));
+ this(generateN(bits, rand));
}
/**
@@ -170,7 +169,7 @@ public class CSPRNG_DO_NOT_USE extends Random implements IRandomGenerator {
* The n-value.
*/
public CSPRNG_DO_NOT_USE(BigInteger n) {
- this(n, SecureRandom.getSeed(n.bitLength() / 8));
+ this(n, SecureRandom.getSeed(n.bitLength() / 8));
}
/**
@@ -183,8 +182,8 @@ public class CSPRNG_DO_NOT_USE extends Random implements IRandomGenerator {
* The seed value using a byte[] array.
*/
public CSPRNG_DO_NOT_USE(BigInteger n, byte[] seed) {
- this.n = n;
- setSeed(seed);
+ this.n = n;
+ setSeed(seed);
}
/**
@@ -194,9 +193,9 @@ public class CSPRNG_DO_NOT_USE extends Random implements IRandomGenerator {
* The new seed.
*/
public void setSeed(byte[] seedBytes) {
- // ADD: use hardwired default for n
- BigInteger seed = new BigInteger(1, seedBytes);
- state = seed.mod(n);
+ // ADD: use hardwired default for n
+ BigInteger seed = new BigInteger(1, seedBytes);
+ state = seed.mod(n);
}
/**
@@ -205,67 +204,64 @@ public class CSPRNG_DO_NOT_USE extends Random implements IRandomGenerator {
* @return int
*/
@Override
- public int next(int numBits) {
- // TODO: find out how many LSB one can extract per cycle.
- // it is more than one.
- int result = 0;
- for (int i = numBits; i != 0; --i) {
- state = state.modPow(two, n);
- result = (result << 1) | (state.testBit(0) == true ? 1 : 0);
- }
- return result;
+ public int next(int numBits) {
+ // TODO: find out how many LSB one can extract per cycle.
+ // it is more than one.
+ int result = 0;
+ for (int i = numBits; i != 0; --i) {
+ state = state.modPow(two, n);
+ result = (result << 1) | (state.testBit(0) == true ? 1 : 0);
+ }
+ return result;
}
-
- public static CSPRNG_DO_NOT_USE generate(){
- return generate(512);
+ public static CSPRNG_DO_NOT_USE generate() {
+ return generate(512);
}
-
+
/**
* @return CSPRNG_DO_NOT_USE
* @Author Draknyte1/Alkalus
*/
- public static CSPRNG_DO_NOT_USE generate(int bitsize){
- // First use the internal, stock "true" random number
- // generator to get a "true random seed"
- SecureRandom r = Utils.generateSecureRandom();
- r.nextInt(); // need to do something for SR to be triggered.
- // Use this seed to generate a n-value for Blum-Blum-Shub
- // This value can be re-used if desired.
- BigInteger nval = CSPRNG_DO_NOT_USE.generateN(bitsize, r);
- // now get a seed
- byte[] seed = new byte[bitsize/8];
- r.nextBytes(seed);
- // now create an instance of BlumBlumShub
- CSPRNG_DO_NOT_USE bbs = new CSPRNG_DO_NOT_USE(nval, seed);
- return bbs;
+ public static CSPRNG_DO_NOT_USE generate(int bitsize) {
+ // First use the internal, stock "true" random number
+ // generator to get a "true random seed"
+ SecureRandom r = Utils.generateSecureRandom();
+ r.nextInt(); // need to do something for SR to be triggered.
+ // Use this seed to generate a n-value for Blum-Blum-Shub
+ // This value can be re-used if desired.
+ BigInteger nval = CSPRNG_DO_NOT_USE.generateN(bitsize, r);
+ // now get a seed
+ byte[] seed = new byte[bitsize / 8];
+ r.nextBytes(seed);
+ // now create an instance of BlumBlumShub
+ CSPRNG_DO_NOT_USE bbs = new CSPRNG_DO_NOT_USE(nval, seed);
+ return bbs;
}
-
-
+
/**
* @return CSPRNG_DO_NOT_USE
* @Author Draknyte1/Alkalus
*/
- public static CSPRNG_DO_NOT_USE generate(Random aRandom){
- return generate(512, aRandom);
+ public static CSPRNG_DO_NOT_USE generate(Random aRandom) {
+ return generate(512, aRandom);
}
-
+
/**
* @return CSPRNG_DO_NOT_USE
* @Author Draknyte1/Alkalus
*/
- public static CSPRNG_DO_NOT_USE generate(int aBitSize, Random aRandom){
- // First use the internal, stock "true" random number
- // generator to get a "true random seed"
- SecureRandom r = Utils.generateSecureRandom();
- r.nextInt(); // need to do something for SR to be triggered.
- // Use this seed to generate a n-value for Blum-Blum-Shub
- // This value can be re-used if desired.
- int bitsize = aBitSize;
- // now create an instance of BlumBlumShub
- // do everything almost automatically
- CSPRNG_DO_NOT_USE bbs = new CSPRNG_DO_NOT_USE(bitsize, aRandom);
- return bbs;
+ public static CSPRNG_DO_NOT_USE generate(int aBitSize, Random aRandom) {
+ // First use the internal, stock "true" random number
+ // generator to get a "true random seed"
+ SecureRandom r = Utils.generateSecureRandom();
+ r.nextInt(); // need to do something for SR to be triggered.
+ // Use this seed to generate a n-value for Blum-Blum-Shub
+ // This value can be re-used if desired.
+ int bitsize = aBitSize;
+ // now create an instance of BlumBlumShub
+ // do everything almost automatically
+ CSPRNG_DO_NOT_USE bbs = new CSPRNG_DO_NOT_USE(bitsize, aRandom);
+ return bbs;
}
-
}
diff --git a/src/main/java/gtPlusPlus/api/objects/random/UUIDGenerator.java b/src/main/java/gtPlusPlus/api/objects/random/UUIDGenerator.java
index fec92368f8..8b70955e63 100644
--- a/src/main/java/gtPlusPlus/api/objects/random/UUIDGenerator.java
+++ b/src/main/java/gtPlusPlus/api/objects/random/UUIDGenerator.java
@@ -6,16 +6,16 @@ import java.util.Random;
import java.util.UUID;
/**
- *
+ *
* Implement modified version of Apache's OpenJPA UUID generator.
* This UUID generator is paired with a Blum-Blum-Shub random number generator
* which in itself is seeded by custom SecureRandom.
- *
+ *
* The UUID generator class has been converted from a static factory to an instanced factory.
- *
+ *
*/
-//========================================= APACHE BLOCK =========================================
+// ========================================= APACHE BLOCK =========================================
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -33,7 +33,7 @@ import java.util.UUID;
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
+ * under the License.
*/
/**
@@ -41,8 +41,8 @@ import java.util.UUID;
* in the Apache Commons Id project: http://jakarta.apache.org/commons/sandbox
* /id/uuid.html The type 4 generator uses the standard Java UUID generator.
*
- * The type 1 code has been vastly simplified and modified to replace the
- * ethernet address of the host machine with the IP, since we do not want to
+ * The type 1 code has been vastly simplified and modified to replace the
+ * ethernet address of the host machine with the IP, since we do not want to
* require native libs and Java cannot access the MAC address directly.
*
* In spirit, implements the IETF UUID draft specification, found here:<br />
@@ -54,396 +54,383 @@ import java.util.UUID;
*/
public class UUIDGenerator {
- // supported UUID types
- public static final int TYPE1 = 1;
- public static final int TYPE4 = 4;
- // indexes within the uuid array for certain boundaries
- private static final byte IDX_TIME_HI = 6;
- private static final byte IDX_TYPE = 6; // multiplexed
- private static final byte IDX_TIME_MID = 4;
- private static final byte IDX_TIME_LO = 0;
- private static final byte IDX_TIME_SEQ = 8;
- private static final byte IDX_VARIATION = 8; // multiplexed
- // indexes and lengths within the timestamp for certain boundaries
- private static final byte TS_TIME_LO_IDX = 4;
- private static final byte TS_TIME_LO_LEN = 4;
- private static final byte TS_TIME_MID_IDX = 2;
- private static final byte TS_TIME_MID_LEN = 2;
- private static final byte TS_TIME_HI_IDX = 0;
- private static final byte TS_TIME_HI_LEN = 2;
- // offset to move from 1/1/1970, which is 0-time for Java, to gregorian
- // 0-time 10/15/1582, and multiplier to go from 100nsec to msec units
- private static final long GREG_OFFSET = 0xB1D069B5400L;
- private static final long MILLI_MULT = 10000L;
- // type of UUID -- time based
- private final static byte TYPE_TIME_BASED = 0x10;
- // random number generator used to reduce conflicts with other JVMs, and
- // hasher for strings.
- private Random RANDOM;
- // 4-byte IP address + 2 random bytes to compensate for the fact that
- // the MAC address is usually 6 bytes
- private byte[] IP;
- // counter is initialized to 0 and is incremented for each uuid request
- // within the same timestamp window.
- private int _counter;
- // current timestamp (used to detect multiple uuid requests within same
- // timestamp)
- private long _currentMillis;
- // last used millis time, and a semi-random sequence that gets reset
- // when it overflows
- private long _lastMillis = 0L;
- private static final int MAX_14BIT = 0x3FFF;
- private short _seq = 0;
- private boolean type1Initialized = false; /*
+ // supported UUID types
+ public static final int TYPE1 = 1;
+ public static final int TYPE4 = 4;
+ // indexes within the uuid array for certain boundaries
+ private static final byte IDX_TIME_HI = 6;
+ private static final byte IDX_TYPE = 6; // multiplexed
+ private static final byte IDX_TIME_MID = 4;
+ private static final byte IDX_TIME_LO = 0;
+ private static final byte IDX_TIME_SEQ = 8;
+ private static final byte IDX_VARIATION = 8; // multiplexed
+ // indexes and lengths within the timestamp for certain boundaries
+ private static final byte TS_TIME_LO_IDX = 4;
+ private static final byte TS_TIME_LO_LEN = 4;
+ private static final byte TS_TIME_MID_IDX = 2;
+ private static final byte TS_TIME_MID_LEN = 2;
+ private static final byte TS_TIME_HI_IDX = 0;
+ private static final byte TS_TIME_HI_LEN = 2;
+ // offset to move from 1/1/1970, which is 0-time for Java, to gregorian
+ // 0-time 10/15/1582, and multiplier to go from 100nsec to msec units
+ private static final long GREG_OFFSET = 0xB1D069B5400L;
+ private static final long MILLI_MULT = 10000L;
+ // type of UUID -- time based
+ private static final byte TYPE_TIME_BASED = 0x10;
+ // random number generator used to reduce conflicts with other JVMs, and
+ // hasher for strings.
+ private Random RANDOM;
+ // 4-byte IP address + 2 random bytes to compensate for the fact that
+ // the MAC address is usually 6 bytes
+ private byte[] IP;
+ // counter is initialized to 0 and is incremented for each uuid request
+ // within the same timestamp window.
+ private int _counter;
+ // current timestamp (used to detect multiple uuid requests within same
+ // timestamp)
+ private long _currentMillis;
+ // last used millis time, and a semi-random sequence that gets reset
+ // when it overflows
+ private long _lastMillis = 0L;
+ private static final int MAX_14BIT = 0x3FFF;
+ private short _seq = 0;
+ private boolean type1Initialized = false; /*
* Initializer for type 1 UUIDs. Creates random generator and genenerates
* the node portion of the UUID using the IP address.
*/
- private synchronized void initializeForType1() {
- if (type1Initialized == true) {
- return;
- }
- // note that secure random is very slow the first time
- // it is used; consider switching to a standard random
- RANDOM = CSPRNG_DO_NOT_USE.generate();
- _seq = (short) RANDOM.nextInt(MAX_14BIT);
- byte[] ip = null;
- try {
- ip = InetAddress.getLocalHost().getAddress();
- } catch (IOException ioe) {
- throw new RuntimeException(ioe);
- }
- IP = new byte[6];
- RANDOM.nextBytes(IP);
- //OPENJPA-2055: account for the fact that 'getAddress'
- //may return an IPv6 address which is 16 bytes wide.
- for( int i = 0 ; i < ip.length; ++i ) {
- IP[2+(i%4)] ^= ip[i];
- }
- type1Initialized = true;
- }
- /**
- * Return a unique UUID value.
- */
- public byte[] next(int type) {
- if (type == TYPE4) {
- return createType4();
- }
- return createType1();
- }
- /*
- * Creates a type 1 UUID
- */
- public byte[] createType1() {
- if (type1Initialized == false) {
- initializeForType1();
- }
- // set ip addr
- byte[] uuid = new byte[16];
- System.arraycopy(IP, 0, uuid, 10, IP.length);
- // Set time info. Have to do this processing within a synchronized
- // block because of the statics...
- long now = 0;
- synchronized (UUIDGenerator.class) {
- // Get the time to use for this uuid. This method has the side
- // effect of modifying the clock sequence, as well.
- now = getTime();
- // Insert the resulting clock sequence into the uuid
- uuid[IDX_TIME_SEQ] = (byte) ((_seq & 0x3F00) >>> 8);
- uuid[IDX_VARIATION] |= 0x80;
- uuid[IDX_TIME_SEQ+1] = (byte) (_seq & 0xFF);
- }
- // have to break up time because bytes are spread through uuid
- byte[] timeBytes = Bytes.toBytes(now);
- // Copy time low
- System.arraycopy(timeBytes, TS_TIME_LO_IDX, uuid, IDX_TIME_LO,
- TS_TIME_LO_LEN);
- // Copy time mid
- System.arraycopy(timeBytes, TS_TIME_MID_IDX, uuid, IDX_TIME_MID,
- TS_TIME_MID_LEN);
- // Copy time hi
- System.arraycopy(timeBytes, TS_TIME_HI_IDX, uuid, IDX_TIME_HI,
- TS_TIME_HI_LEN);
- //Set version (time-based)
- uuid[IDX_TYPE] |= TYPE_TIME_BASED; // 0001 0000
- return uuid;
- }
- /*
- * Creates a type 4 UUID
- */
- private byte[] createType4() {
- UUID type4 = UUID.randomUUID();
- byte[] uuid = new byte[16];
- longToBytes(type4.getMostSignificantBits(), uuid, 0);
- longToBytes(type4.getLeastSignificantBits(), uuid, 8);
- return uuid;
- }
- /*
- * Converts a long to byte values, setting them in a byte array
- * at a given starting position.
- */
- private void longToBytes(long longVal, byte[] buf, int sPos) {
- sPos += 7;
- for(int i = 0; i < 8; i++)
- buf[sPos-i] = (byte)(longVal >>> (i * 8));
- }
+ private synchronized void initializeForType1() {
+ if (type1Initialized == true) {
+ return;
+ }
+ // note that secure random is very slow the first time
+ // it is used; consider switching to a standard random
+ RANDOM = CSPRNG_DO_NOT_USE.generate();
+ _seq = (short) RANDOM.nextInt(MAX_14BIT);
- /**
- * Return the next unique uuid value as a 16-character string.
- */
- public String nextString(int type) {
- byte[] bytes = next(type);
- try {
- return new String(bytes, "ISO-8859-1");
- } catch (Exception e) {
- return new String(bytes);
- }
- }
- /**
- * Return the next unique uuid value as a 32-character hex string.
- */
- public String nextHex(int type) {
- return Base16Encoder.encode(next(type));
- }
- /**
- * Get the timestamp to be used for this uuid. Must be called from
- * a synchronized block.
- *
- * @return long timestamp
- */
- // package-visibility for testing
- private long getTime() {
- if (RANDOM == null)
- initializeForType1();
- long newTime = getUUIDTime();
- if (newTime <= _lastMillis) {
- incrementSequence();
- newTime = getUUIDTime();
- }
- _lastMillis = newTime;
- return newTime;
- }
- /**
- * Gets the appropriately modified timestamep for the UUID. Must be called
- * from a synchronized block.
- *
- * @return long timestamp in 100ns intervals since the Gregorian change
- * offset
- */
- private long getUUIDTime() {
- if (_currentMillis != System.currentTimeMillis()) {
- _currentMillis = System.currentTimeMillis();
- _counter = 0; // reset counter
- }
- // check to see if we have created too many uuid's for this timestamp
- if (_counter + 1 >= MILLI_MULT) {
- // Original algorithm threw exception. Seemed like overkill.
- // Let's just increment the timestamp instead and start over...
- _currentMillis++;
- _counter = 0;
- }
- // calculate time as current millis plus offset times 100 ns ticks
- long currentTime = (_currentMillis + GREG_OFFSET) * MILLI_MULT;
- // return the uuid time plus the artificial tick counter incremented
- return currentTime + _counter++;
- }
- /**
- * Increments the clock sequence for this uuid. Must be called from a
- * synchronized block.
- */
- private void incrementSequence() {
- // increment, but if it's greater than its 14-bits, reset it
- if (++_seq > MAX_14BIT) {
- _seq = (short) RANDOM.nextInt(MAX_14BIT); // semi-random
- }
- }
-
- //Add Dependant classes internally
+ byte[] ip = null;
+ try {
+ ip = InetAddress.getLocalHost().getAddress();
+ } catch (IOException ioe) {
+ throw new RuntimeException(ioe);
+ }
+ IP = new byte[6];
+ RANDOM.nextBytes(IP);
+ // OPENJPA-2055: account for the fact that 'getAddress'
+ // may return an IPv6 address which is 16 bytes wide.
+ for (int i = 0; i < ip.length; ++i) {
+ IP[2 + (i % 4)] ^= ip[i];
+ }
+ type1Initialized = true;
+ }
+ /**
+ * Return a unique UUID value.
+ */
+ public byte[] next(int type) {
+ if (type == TYPE4) {
+ return createType4();
+ }
+ return createType1();
+ }
+ /*
+ * Creates a type 1 UUID
+ */
+ public byte[] createType1() {
+ if (type1Initialized == false) {
+ initializeForType1();
+ }
+ // set ip addr
+ byte[] uuid = new byte[16];
+ System.arraycopy(IP, 0, uuid, 10, IP.length);
+ // Set time info. Have to do this processing within a synchronized
+ // block because of the statics...
+ long now = 0;
+ synchronized (UUIDGenerator.class) {
+ // Get the time to use for this uuid. This method has the side
+ // effect of modifying the clock sequence, as well.
+ now = getTime();
+ // Insert the resulting clock sequence into the uuid
+ uuid[IDX_TIME_SEQ] = (byte) ((_seq & 0x3F00) >>> 8);
+ uuid[IDX_VARIATION] |= 0x80;
+ uuid[IDX_TIME_SEQ + 1] = (byte) (_seq & 0xFF);
+ }
+ // have to break up time because bytes are spread through uuid
+ byte[] timeBytes = Bytes.toBytes(now);
+ // Copy time low
+ System.arraycopy(timeBytes, TS_TIME_LO_IDX, uuid, IDX_TIME_LO, TS_TIME_LO_LEN);
+ // Copy time mid
+ System.arraycopy(timeBytes, TS_TIME_MID_IDX, uuid, IDX_TIME_MID, TS_TIME_MID_LEN);
+ // Copy time hi
+ System.arraycopy(timeBytes, TS_TIME_HI_IDX, uuid, IDX_TIME_HI, TS_TIME_HI_LEN);
+ // Set version (time-based)
+ uuid[IDX_TYPE] |= TYPE_TIME_BASED; // 0001 0000
+ return uuid;
+ }
+ /*
+ * Creates a type 4 UUID
+ */
+ private byte[] createType4() {
+ UUID type4 = UUID.randomUUID();
+ byte[] uuid = new byte[16];
+ longToBytes(type4.getMostSignificantBits(), uuid, 0);
+ longToBytes(type4.getLeastSignificantBits(), uuid, 8);
+ return uuid;
+ }
+ /*
+ * Converts a long to byte values, setting them in a byte array
+ * at a given starting position.
+ */
+ private void longToBytes(long longVal, byte[] buf, int sPos) {
+ sPos += 7;
+ for (int i = 0; i < 8; i++) buf[sPos - i] = (byte) (longVal >>> (i * 8));
+ }
- /**
- * This class came from the Apache Commons Id sandbox project in support
- * of the UUIDGenerator implementation.
- *
- * <p>Static methods for managing byte arrays (all methods follow Big
- * Endian order where most significant bits are in front).</p>
- */
- public static final class Bytes {
- /**
- * <p>Hide constructor in utility class.</p>
- */
- private Bytes() {
- }
- /**
- * Appends two bytes array into one.
- *
- * @param a A byte[].
- * @param b A byte[].
- * @return A byte[].
- */
- public static byte[] append(byte[] a, byte[] b) {
- byte[] z = new byte[a.length + b.length];
- System.arraycopy(a, 0, z, 0, a.length);
- System.arraycopy(b, 0, z, a.length, b.length);
- return z;
- }
- /**
- * Returns a 8-byte array built from a long.
- *
- * @param n The number to convert.
- * @return A byte[].
- */
- public static byte[] toBytes(long n) {
- return toBytes(n, new byte[8]);
- }
- /**
- * Build a 8-byte array from a long. No check is performed on the
- * array length.
- *
- * @param n The number to convert.
- * @param b The array to fill.
- * @return A byte[].
- */
- public static byte[] toBytes(long n, byte[] b) {
- b[7] = (byte) (n);
- n >>>= 8;
- b[6] = (byte) (n);
- n >>>= 8;
- b[5] = (byte) (n);
- n >>>= 8;
- b[4] = (byte) (n);
- n >>>= 8;
- b[3] = (byte) (n);
- n >>>= 8;
- b[2] = (byte) (n);
- n >>>= 8;
- b[1] = (byte) (n);
- n >>>= 8;
- b[0] = (byte) (n);
-
- return b;
- }
- /**
- * Build a long from first 8 bytes of the array.
- *
- * @param b The byte[] to convert.
- * @return A long.
- */
- public static long toLong(byte[] b) {
- return ((((long) b[7]) & 0xFF)
- + ((((long) b[6]) & 0xFF) << 8)
- + ((((long) b[5]) & 0xFF) << 16)
- + ((((long) b[4]) & 0xFF) << 24)
- + ((((long) b[3]) & 0xFF) << 32)
- + ((((long) b[2]) & 0xFF) << 40)
- + ((((long) b[1]) & 0xFF) << 48)
- + ((((long) b[0]) & 0xFF) << 56));
- }
- /**
- * Compares two byte arrays for equality.
- *
- * @param a A byte[].
- * @param b A byte[].
- * @return True if the arrays have identical contents.
- */
- public static boolean areEqual(byte[] a, byte[] b) {
- int aLength = a.length;
- if (aLength != b.length) {
- return false;
- }
- for (int i = 0; i < aLength; i++) {
- if (a[i] != b[i]) {
- return false;
- }
- }
- return true;
- }
- /**
- * <p>Compares two byte arrays as specified by <code>Comparable</code>.
- *
- * @param lhs - left hand value in the comparison operation.
- * @param rhs - right hand value in the comparison operation.
- * @return a negative integer, zero, or a positive integer as
- * <code>lhs</code> is less than, equal to, or greater than
- * <code>rhs</code>.
- */
- public static int compareTo(byte[] lhs, byte[] rhs) {
- if (lhs == rhs) {
- return 0;
- }
- if (lhs == null) {
- return -1;
- }
- if (rhs == null) {
- return +1;
- }
- if (lhs.length != rhs.length) {
- return ((lhs.length < rhs.length) ? -1 : +1);
- }
- for (int i = 0; i < lhs.length; i++) {
- if (lhs[i] < rhs[i]) {
- return -1;
- } else if (lhs[i] > rhs[i]) {
- return 1;
- }
- }
- return 0;
- }
- /**
- * Build a short from first 2 bytes of the array.
- *
- * @param b The byte[] to convert.
- * @return A short.
- */
- public static short toShort(byte[] b) {
- return (short) ((b[1] & 0xFF) + ((b[0] & 0xFF) << 8));
- }
- }
- /**
- * Base 16 encoder.
- *
- * @author Marc Prud'hommeaux
- */
- public static final class Base16Encoder {
+ /**
+ * Return the next unique uuid value as a 16-character string.
+ */
+ public String nextString(int type) {
+ byte[] bytes = next(type);
+ try {
+ return new String(bytes, "ISO-8859-1");
+ } catch (Exception e) {
+ return new String(bytes);
+ }
+ }
+ /**
+ * Return the next unique uuid value as a 32-character hex string.
+ */
+ public String nextHex(int type) {
+ return Base16Encoder.encode(next(type));
+ }
+ /**
+ * Get the timestamp to be used for this uuid. Must be called from
+ * a synchronized block.
+ *
+ * @return long timestamp
+ */
+ // package-visibility for testing
+ private long getTime() {
+ if (RANDOM == null) initializeForType1();
+ long newTime = getUUIDTime();
+ if (newTime <= _lastMillis) {
+ incrementSequence();
+ newTime = getUUIDTime();
+ }
+ _lastMillis = newTime;
+ return newTime;
+ }
+ /**
+ * Gets the appropriately modified timestamep for the UUID. Must be called
+ * from a synchronized block.
+ *
+ * @return long timestamp in 100ns intervals since the Gregorian change
+ * offset
+ */
+ private long getUUIDTime() {
+ if (_currentMillis != System.currentTimeMillis()) {
+ _currentMillis = System.currentTimeMillis();
+ _counter = 0; // reset counter
+ }
+ // check to see if we have created too many uuid's for this timestamp
+ if (_counter + 1 >= MILLI_MULT) {
+ // Original algorithm threw exception. Seemed like overkill.
+ // Let's just increment the timestamp instead and start over...
+ _currentMillis++;
+ _counter = 0;
+ }
+ // calculate time as current millis plus offset times 100 ns ticks
+ long currentTime = (_currentMillis + GREG_OFFSET) * MILLI_MULT;
+ // return the uuid time plus the artificial tick counter incremented
+ return currentTime + _counter++;
+ }
+ /**
+ * Increments the clock sequence for this uuid. Must be called from a
+ * synchronized block.
+ */
+ private void incrementSequence() {
+ // increment, but if it's greater than its 14-bits, reset it
+ if (++_seq > MAX_14BIT) {
+ _seq = (short) RANDOM.nextInt(MAX_14BIT); // semi-random
+ }
+ }
- private final static char[] HEX = new char[]{
- '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
- /**
- * Convert bytes to a base16 string.
- */
- public static String encode(byte[] byteArray) {
- StringBuilder hexBuffer = new StringBuilder(byteArray.length * 2);
- for (int i = 0; i < byteArray.length; i++)
- for (int j = 1; j >= 0; j--)
- hexBuffer.append(HEX[(byteArray[i] >> (j * 4)) & 0xF]);
- return hexBuffer.toString();
- }
- /**
- * Convert a base16 string into a byte array.
- */
- public static byte[] decode(String s) {
- int len = s.length();
- byte[] r = new byte[len / 2];
- for (int i = 0; i < r.length; i++) {
- int digit1 = s.charAt(i * 2), digit2 = s.charAt(i * 2 + 1);
- if (digit1 >= '0' && digit1 <= '9')
- digit1 -= '0';
- else if (digit1 >= 'A' && digit1 <= 'F')
- digit1 -= 'A' - 10;
- if (digit2 >= '0' && digit2 <= '9')
- digit2 -= '0';
- else if (digit2 >= 'A' && digit2 <= 'F')
- digit2 -= 'A' - 10;
+ // Add Dependant classes internally
- r[i] = (byte) ((digit1 << 4) + digit2);
- }
- return r;
- }
- }
+ /**
+ * This class came from the Apache Commons Id sandbox project in support
+ * of the UUIDGenerator implementation.
+ *
+ * <p>Static methods for managing byte arrays (all methods follow Big
+ * Endian order where most significant bits are in front).</p>
+ */
+ public static final class Bytes {
+ /**
+ * <p>Hide constructor in utility class.</p>
+ */
+ private Bytes() {}
+ /**
+ * Appends two bytes array into one.
+ *
+ * @param a A byte[].
+ * @param b A byte[].
+ * @return A byte[].
+ */
+ public static byte[] append(byte[] a, byte[] b) {
+ byte[] z = new byte[a.length + b.length];
+ System.arraycopy(a, 0, z, 0, a.length);
+ System.arraycopy(b, 0, z, a.length, b.length);
+ return z;
+ }
+ /**
+ * Returns a 8-byte array built from a long.
+ *
+ * @param n The number to convert.
+ * @return A byte[].
+ */
+ public static byte[] toBytes(long n) {
+ return toBytes(n, new byte[8]);
+ }
+ /**
+ * Build a 8-byte array from a long. No check is performed on the
+ * array length.
+ *
+ * @param n The number to convert.
+ * @param b The array to fill.
+ * @return A byte[].
+ */
+ public static byte[] toBytes(long n, byte[] b) {
+ b[7] = (byte) (n);
+ n >>>= 8;
+ b[6] = (byte) (n);
+ n >>>= 8;
+ b[5] = (byte) (n);
+ n >>>= 8;
+ b[4] = (byte) (n);
+ n >>>= 8;
+ b[3] = (byte) (n);
+ n >>>= 8;
+ b[2] = (byte) (n);
+ n >>>= 8;
+ b[1] = (byte) (n);
+ n >>>= 8;
+ b[0] = (byte) (n);
+ return b;
+ }
+ /**
+ * Build a long from first 8 bytes of the array.
+ *
+ * @param b The byte[] to convert.
+ * @return A long.
+ */
+ public static long toLong(byte[] b) {
+ return ((((long) b[7]) & 0xFF)
+ + ((((long) b[6]) & 0xFF) << 8)
+ + ((((long) b[5]) & 0xFF) << 16)
+ + ((((long) b[4]) & 0xFF) << 24)
+ + ((((long) b[3]) & 0xFF) << 32)
+ + ((((long) b[2]) & 0xFF) << 40)
+ + ((((long) b[1]) & 0xFF) << 48)
+ + ((((long) b[0]) & 0xFF) << 56));
+ }
+ /**
+ * Compares two byte arrays for equality.
+ *
+ * @param a A byte[].
+ * @param b A byte[].
+ * @return True if the arrays have identical contents.
+ */
+ public static boolean areEqual(byte[] a, byte[] b) {
+ int aLength = a.length;
+ if (aLength != b.length) {
+ return false;
+ }
+ for (int i = 0; i < aLength; i++) {
+ if (a[i] != b[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+ /**
+ * <p>Compares two byte arrays as specified by <code>Comparable</code>.
+ *
+ * @param lhs - left hand value in the comparison operation.
+ * @param rhs - right hand value in the comparison operation.
+ * @return a negative integer, zero, or a positive integer as
+ * <code>lhs</code> is less than, equal to, or greater than
+ * <code>rhs</code>.
+ */
+ public static int compareTo(byte[] lhs, byte[] rhs) {
+ if (lhs == rhs) {
+ return 0;
+ }
+ if (lhs == null) {
+ return -1;
+ }
+ if (rhs == null) {
+ return +1;
+ }
+ if (lhs.length != rhs.length) {
+ return ((lhs.length < rhs.length) ? -1 : +1);
+ }
+ for (int i = 0; i < lhs.length; i++) {
+ if (lhs[i] < rhs[i]) {
+ return -1;
+ } else if (lhs[i] > rhs[i]) {
+ return 1;
+ }
+ }
+ return 0;
+ }
+ /**
+ * Build a short from first 2 bytes of the array.
+ *
+ * @param b The byte[] to convert.
+ * @return A short.
+ */
+ public static short toShort(byte[] b) {
+ return (short) ((b[1] & 0xFF) + ((b[0] & 0xFF) << 8));
+ }
+ }
+ /**
+ * Base 16 encoder.
+ *
+ * @author Marc Prud'hommeaux
+ */
+ public static final class Base16Encoder {
+ private static final char[] HEX = new char[] {
+ '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
+ };
+ /**
+ * Convert bytes to a base16 string.
+ */
+ public static String encode(byte[] byteArray) {
+ StringBuilder hexBuffer = new StringBuilder(byteArray.length * 2);
+ for (int i = 0; i < byteArray.length; i++)
+ for (int j = 1; j >= 0; j--) hexBuffer.append(HEX[(byteArray[i] >> (j * 4)) & 0xF]);
+ return hexBuffer.toString();
+ }
+ /**
+ * Convert a base16 string into a byte array.
+ */
+ public static byte[] decode(String s) {
+ int len = s.length();
+ byte[] r = new byte[len / 2];
+ for (int i = 0; i < r.length; i++) {
+ int digit1 = s.charAt(i * 2), digit2 = s.charAt(i * 2 + 1);
+ if (digit1 >= '0' && digit1 <= '9') digit1 -= '0';
+ else if (digit1 >= 'A' && digit1 <= 'F') digit1 -= 'A' - 10;
+ if (digit2 >= '0' && digit2 <= '9') digit2 -= '0';
+ else if (digit2 >= 'A' && digit2 <= 'F') digit2 -= 'A' - 10;
+ r[i] = (byte) ((digit1 << 4) + digit2);
+ }
+ return r;
+ }
+ }
}
-//========================================= APACHE BLOCK =========================================
-
+// ========================================= APACHE BLOCK =========================================
diff --git a/src/main/java/gtPlusPlus/api/objects/random/XSTR.java b/src/main/java/gtPlusPlus/api/objects/random/XSTR.java
index 6ce1cbeb6c..aaaa7a4d1d 100644
--- a/src/main/java/gtPlusPlus/api/objects/random/XSTR.java
+++ b/src/main/java/gtPlusPlus/api/objects/random/XSTR.java
@@ -23,7 +23,6 @@ package gtPlusPlus.api.objects.random;
* This code is released under the GNU Lesser General Public License Version 3
* http://www.gnu.org/licenses/lgpl-3.0.txt
*/
-
import java.util.Random;
import java.util.concurrent.atomic.AtomicLong;
@@ -35,201 +34,202 @@ import java.util.concurrent.atomic.AtomicLong;
*/
public class XSTR extends Random implements Cloneable {
- private static final long serialVersionUID = 6208727693524452904L;
- private long seed;
- private long last;
- private static final long GAMMA = 0x9e3779b97f4a7c15L;
- private static final int PROBE_INCREMENT = 0x9e3779b9;
- private static final long SEEDER_INCREMENT = 0xbb67ae8584caa73bL;
- private static final double DOUBLE_UNIT = 0x1.0p-53; // 1.0 / (1L << 53)
- private static final float FLOAT_UNIT = 0x1.0p-24f; // 1.0f / (1 << 24)
+ private static final long serialVersionUID = 6208727693524452904L;
+ private long seed;
+ private long last;
+ private static final long GAMMA = 0x9e3779b97f4a7c15L;
+ private static final int PROBE_INCREMENT = 0x9e3779b9;
+ private static final long SEEDER_INCREMENT = 0xbb67ae8584caa73bL;
+ private static final double DOUBLE_UNIT = 0x1.0p-53; // 1.0 / (1L << 53)
+ private static final float FLOAT_UNIT = 0x1.0p-24f; // 1.0f / (1 << 24)
+
+ /*
+ MODIFIED BY: Robotia
+ Modification: Implemented Random class seed generator
+ */
+ /**
+ * Creates a new pseudo random number generator. The seed is initialized to
+ * the current time, as if by
+ * <code>setSeed(System.currentTimeMillis());</code>.
+ */
+ public XSTR() {
+ this(seedUniquifier() ^ System.nanoTime());
+ }
+
+ private static final AtomicLong seedUniquifier = new AtomicLong(8682522807148012L);
+
+ private static long seedUniquifier() {
+ // L'Ecuyer, "Tables of Linear Congruential Generators of
+ // Different Sizes and Good Lattice Structure", 1999
+ for (; ; ) {
+ final long current = seedUniquifier.get();
+ final long next = current * 181783497276652981L;
+ if (seedUniquifier.compareAndSet(current, next)) {
+ return next;
+ }
+ }
+ }
+
+ /**
+ * Creates a new pseudo random number generator, starting with the specified
+ * seed, using <code>setSeed(seed);</code>.
+ *
+ * @param seed the initial seed
+ */
+ public XSTR(final long seed) {
+ this.seed = seed;
+ }
- /*
- MODIFIED BY: Robotia
- Modification: Implemented Random class seed generator
- */
- /**
- * Creates a new pseudo random number generator. The seed is initialized to
- * the current time, as if by
- * <code>setSeed(System.currentTimeMillis());</code>.
- */
- public XSTR() {
- this(seedUniquifier() ^ System.nanoTime());
- }
- private static final AtomicLong seedUniquifier
- = new AtomicLong(8682522807148012L);
+ @Override
+ public boolean nextBoolean() {
+ return this.next(1) != 0;
+ }
- private static long seedUniquifier() {
- // L'Ecuyer, "Tables of Linear Congruential Generators of
- // Different Sizes and Good Lattice Structure", 1999
- for (;;) {
- final long current = seedUniquifier.get();
- final long next = current * 181783497276652981L;
- if (seedUniquifier.compareAndSet(current, next)) {
- return next;
- }
- }
- }
+ @Override
+ public double nextDouble() {
+ return (((long) (this.next(26)) << 27) + this.next(27)) * DOUBLE_UNIT;
+ }
+ /**
+ * Returns the current state of the seed, can be used to clone the object
+ *
+ * @return the current seed
+ */
+ public synchronized long getSeed() {
+ return this.seed;
+ }
- /**
- * Creates a new pseudo random number generator, starting with the specified
- * seed, using <code>setSeed(seed);</code>.
- *
- * @param seed the initial seed
- */
- public XSTR(final long seed) {
- this.seed = seed;
- }
- @Override
- public boolean nextBoolean() {
- return this.next(1) != 0;
- }
+ /**
+ * Sets the seed for this pseudo random number generator. As described
+ * above, two instances of the same random class, starting with the same
+ * seed, produce the same results, if the same methods are called.
+ *
+ * @param seed the new seed
+ */
+ @Override
+ public synchronized void setSeed(final long seed) {
+ this.seed = seed;
+ }
- @Override
- public double nextDouble() {
- return (((long)(this.next(26)) << 27) + this.next(27)) * DOUBLE_UNIT;
- }
- /**
- * Returns the current state of the seed, can be used to clone the object
- *
- * @return the current seed
- */
- public synchronized long getSeed() {
- return this.seed;
- }
+ /**
+ * @return Returns an XSRandom object with the same state as the original
+ */
+ @Override
+ public XSTR clone() {
+ try {
+ super.clone();
+ } catch (CloneNotSupportedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return new XSTR(this.getSeed());
+ }
- /**
- * Sets the seed for this pseudo random number generator. As described
- * above, two instances of the same random class, starting with the same
- * seed, produce the same results, if the same methods are called.
- *
- * @param seed the new seed
- */
- @Override
- public synchronized void setSeed(final long seed) {
- this.seed = seed;
- }
+ /**
+ * Implementation of George Marsaglia's elegant Xorshift random generator
+ * 30% faster and better quality than the built-in java.util.random see also
+ * see http://www.javamex.com/tutorials/random_numbers/xorshift.shtml
+ *
+ * @param nbits
+ * @return
+ */
+ @Override
+ public int next(final int nbits) {
+ long x = this.seed;
+ x ^= (x << 21);
+ x ^= (x >>> 35);
+ x ^= (x << 4);
+ this.seed = x;
+ x &= ((1L << nbits) - 1);
+ return (int) x;
+ }
- /**
- * @return Returns an XSRandom object with the same state as the original
- */
- @Override
- public XSTR clone() {
- try {
- super.clone();
- }
- catch (CloneNotSupportedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return new XSTR(this.getSeed());
- }
+ boolean haveNextNextGaussian = false;
+ double nextNextGaussian = 0;
- /**
- * Implementation of George Marsaglia's elegant Xorshift random generator
- * 30% faster and better quality than the built-in java.util.random see also
- * see http://www.javamex.com/tutorials/random_numbers/xorshift.shtml
- *
- * @param nbits
- * @return
- */
- @Override
- public int next(final int nbits) {
- long x = this.seed;
- x ^= (x << 21);
- x ^= (x >>> 35);
- x ^= (x << 4);
- this.seed = x;
- x &= ((1L << nbits) - 1);
- return (int) x;
- }
- boolean haveNextNextGaussian = false;
- double nextNextGaussian = 0;
- @Override
- synchronized public double nextGaussian() {
- // See Knuth, ACP, Section 3.4.1 Algorithm C.
- if (this.haveNextNextGaussian) {
- this.haveNextNextGaussian = false;
- return this.nextNextGaussian;
- }
- double v1, v2, s;
- do {
- v1 = (2 * this.nextDouble()) - 1; // between -1 and 1
- v2 = (2 * this.nextDouble()) - 1; // between -1 and 1
- s = (v1 * v1) + (v2 * v2);
- } while ((s >= 1) || (s == 0));
- final double multiplier = StrictMath.sqrt((-2 * StrictMath.log(s))/s);
- this.nextNextGaussian = v2 * multiplier;
- this.haveNextNextGaussian = true;
- return v1 * multiplier;
- }
- /**
- * Returns a pseudorandom, uniformly distributed {@code int} value between 0
- * (inclusive) and the specified value (exclusive), drawn from this random
- * number generator's sequence. The general contract of {@code nextInt} is
- * that one {@code int} value in the specified range is pseudorandomly
- * generated and returned. All {@code bound} possible {@code int} values are
- * produced with (approximately) equal probability. The method
- * {@code nextInt(int bound)} is implemented by class {@code Random} as if
- * by:
- * <pre> {@code
- * public int nextInt(int bound) {
- * if (bound <= 0)
- * throw new IllegalArgumentException("bound must be positive");
- *
- * if ((bound & -bound) == bound) // i.e., bound is a power of 2
- * return (int)((bound * (long)next(31)) >> 31);
- *
- * int bits, val;
- * do {
- * bits = next(31);
- * val = bits % bound;
- * } while (bits - val + (bound-1) < 0);
- * return val;
- * }}</pre>
- *
- * <p>The hedge "approx
- * imately" is used in the foregoing description only because the next
- * method is only approximately an unbiased source of independently chosen
- * bits. If it were a perfect source of randomly chosen bits, then the
- * algorithm shown would choose {@code int} values from the stated range
- * with perfect uniformity.
- * <p>
- * The algorithm is slightly tricky. It rejects values that would result in
- * an uneven distribution (due to the fact that 2^31 is not divisible by n).
- * The probability of a value being rejected depends on n. The worst case is
- * n=2^30+1, for which the probability of a reject is 1/2, and the expected
- * number of iterations before the loop terminates is 2.
- * <p>
- * The algorithm treats the case where n is a power of two specially: it
- * returns the correct number of high-order bits from the underlying
- * pseudo-random number generator. In the absence of special treatment, the
- * correct number of <i>low-order</i> bits would be returned. Linear
- * congruential pseudo-random number generators such as the one implemented
- * by this class are known to have short periods in the sequence of values
- * of their low-order bits. Thus, this special case greatly increases the
- * length of the sequence of values returned by successive calls to this
- * method if n is a small power of two.
- *
- * @param bound the upper bound (exclusive). Must be positive.
- * @return the next pseudorandom, uniformly distributed {@code int} value
- * between zero (inclusive) and {@code bound} (exclusive) from this random
- * number generator's sequence
- * @throws IllegalArgumentException if bound is not positive
- * @since 1.2
- */
- @Override
- public int nextInt(final int bound) {
- final int newBound;
- if (bound <= 0) {
- newBound = 1;
- //throw new RuntimeException("BadBound");
- }
- else {
- newBound = bound;
- }
+ @Override
+ public synchronized double nextGaussian() {
+ // See Knuth, ACP, Section 3.4.1 Algorithm C.
+ if (this.haveNextNextGaussian) {
+ this.haveNextNextGaussian = false;
+ return this.nextNextGaussian;
+ }
+ double v1, v2, s;
+ do {
+ v1 = (2 * this.nextDouble()) - 1; // between -1 and 1
+ v2 = (2 * this.nextDouble()) - 1; // between -1 and 1
+ s = (v1 * v1) + (v2 * v2);
+ } while ((s >= 1) || (s == 0));
+ final double multiplier = StrictMath.sqrt((-2 * StrictMath.log(s)) / s);
+ this.nextNextGaussian = v2 * multiplier;
+ this.haveNextNextGaussian = true;
+ return v1 * multiplier;
+ }
+ /**
+ * Returns a pseudorandom, uniformly distributed {@code int} value between 0
+ * (inclusive) and the specified value (exclusive), drawn from this random
+ * number generator's sequence. The general contract of {@code nextInt} is
+ * that one {@code int} value in the specified range is pseudorandomly
+ * generated and returned. All {@code bound} possible {@code int} values are
+ * produced with (approximately) equal probability. The method
+ * {@code nextInt(int bound)} is implemented by class {@code Random} as if
+ * by:
+ * <pre> {@code
+ * public int nextInt(int bound) {
+ * if (bound <= 0)
+ * throw new IllegalArgumentException("bound must be positive");
+ *
+ * if ((bound & -bound) == bound) // i.e., bound is a power of 2
+ * return (int)((bound * (long)next(31)) >> 31);
+ *
+ * int bits, val;
+ * do {
+ * bits = next(31);
+ * val = bits % bound;
+ * } while (bits - val + (bound-1) < 0);
+ * return val;
+ * }}</pre>
+ *
+ * <p>The hedge "approx
+ * imately" is used in the foregoing description only because the next
+ * method is only approximately an unbiased source of independently chosen
+ * bits. If it were a perfect source of randomly chosen bits, then the
+ * algorithm shown would choose {@code int} values from the stated range
+ * with perfect uniformity.
+ * <p>
+ * The algorithm is slightly tricky. It rejects values that would result in
+ * an uneven distribution (due to the fact that 2^31 is not divisible by n).
+ * The probability of a value being rejected depends on n. The worst case is
+ * n=2^30+1, for which the probability of a reject is 1/2, and the expected
+ * number of iterations before the loop terminates is 2.
+ * <p>
+ * The algorithm treats the case where n is a power of two specially: it
+ * returns the correct number of high-order bits from the underlying
+ * pseudo-random number generator. In the absence of special treatment, the
+ * correct number of <i>low-order</i> bits would be returned. Linear
+ * congruential pseudo-random number generators such as the one implemented
+ * by this class are known to have short periods in the sequence of values
+ * of their low-order bits. Thus, this special case greatly increases the
+ * length of the sequence of values returned by successive calls to this
+ * method if n is a small power of two.
+ *
+ * @param bound the upper bound (exclusive). Must be positive.
+ * @return the next pseudorandom, uniformly distributed {@code int} value
+ * between zero (inclusive) and {@code bound} (exclusive) from this random
+ * number generator's sequence
+ * @throws IllegalArgumentException if bound is not positive
+ * @since 1.2
+ */
+ @Override
+ public int nextInt(final int bound) {
+ final int newBound;
+ if (bound <= 0) {
+ newBound = 1;
+ // throw new RuntimeException("BadBound");
+ } else {
+ newBound = bound;
+ }
- /*int r = next(31);
+ /*int r = next(31);
int m = bound - 1;
if ((bound & m) == 0) // i.e., bound is a power of 2
{
@@ -241,38 +241,39 @@ public class XSTR extends Random implements Cloneable {
;
}
return r;*/
- //speedup, new nextInt ~+40%
- this.last = this.seed ^ (this.seed << 21);
- this.last ^= (this.last >>> 35);
- this.last ^= (this.last << 4);
- this.seed = this.last;
- final int out = (int) this.last % newBound;
- return (out < 0) ? -out : out;
- }
- @Override
- public int nextInt() {
- return this.next(32);
- }
+ // speedup, new nextInt ~+40%
+ this.last = this.seed ^ (this.seed << 21);
+ this.last ^= (this.last >>> 35);
+ this.last ^= (this.last << 4);
+ this.seed = this.last;
+ final int out = (int) this.last % newBound;
+ return (out < 0) ? -out : out;
+ }
+
+ @Override
+ public int nextInt() {
+ return this.next(32);
+ }
- @Override
- public float nextFloat() {
- return this.next(24) * FLOAT_UNIT;
- }
+ @Override
+ public float nextFloat() {
+ return this.next(24) * FLOAT_UNIT;
+ }
- @Override
- public long nextLong() {
- // it's okay that the bottom word remains signed.
- return ((long)(this.next(32)) << 32) + this.next(32);
- }
+ @Override
+ public long nextLong() {
+ // it's okay that the bottom word remains signed.
+ return ((long) (this.next(32)) << 32) + this.next(32);
+ }
- @Override
- public void nextBytes(final byte[] bytes_arr) {
- for (int iba = 0, lenba = bytes_arr.length; iba < lenba; ) {
- for (int rndba = this.nextInt(),
- nba = Math.min(lenba - iba, Integer.SIZE/Byte.SIZE);
- nba-- > 0; rndba >>= Byte.SIZE) {
- bytes_arr[iba++] = (byte)rndba;
- }
- }
- }
-} \ No newline at end of file
+ @Override
+ public void nextBytes(final byte[] bytes_arr) {
+ for (int iba = 0, lenba = bytes_arr.length; iba < lenba; ) {
+ for (int rndba = this.nextInt(), nba = Math.min(lenba - iba, Integer.SIZE / Byte.SIZE);
+ nba-- > 0;
+ rndba >>= Byte.SIZE) {
+ bytes_arr[iba++] = (byte) rndba;
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/plugin/Sample_Plugin.java b/src/main/java/gtPlusPlus/api/plugin/Sample_Plugin.java
index 543ec8e1fa..0822ec31a2 100644
--- a/src/main/java/gtPlusPlus/api/plugin/Sample_Plugin.java
+++ b/src/main/java/gtPlusPlus/api/plugin/Sample_Plugin.java
@@ -5,43 +5,42 @@ import gtPlusPlus.plugin.manager.Core_Manager;
public final class Sample_Plugin implements IPlugin {
- public Sample_Plugin() {
- Core_Manager.registerPlugin(this); //This must be called, else it won't load.
- }
-
- @Override
- public boolean preInit() {
- return true;
- }
-
- @Override
- public boolean init() {
- return true;
- }
-
- @Override
- public boolean postInit() {
- return true;
- }
-
- @Override
- public boolean serverStart() {
- return true;
- }
-
- @Override
- public boolean serverStop() {
- return true;
- }
-
- @Override
- public String getPluginName() {
- return "Sample Plugin";
- }
-
- @Override
- public String getPluginAbbreviation() {
- return "Test";
- }
-
+ public Sample_Plugin() {
+ Core_Manager.registerPlugin(this); // This must be called, else it won't load.
+ }
+
+ @Override
+ public boolean preInit() {
+ return true;
+ }
+
+ @Override
+ public boolean init() {
+ return true;
+ }
+
+ @Override
+ public boolean postInit() {
+ return true;
+ }
+
+ @Override
+ public boolean serverStart() {
+ return true;
+ }
+
+ @Override
+ public boolean serverStop() {
+ return true;
+ }
+
+ @Override
+ public String getPluginName() {
+ return "Sample Plugin";
+ }
+
+ @Override
+ public String getPluginAbbreviation() {
+ return "Test";
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalConnection.java b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalConnection.java
index d8573000fc..c495f4856b 100644
--- a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalConnection.java
+++ b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalConnection.java
@@ -3,5 +3,5 @@ package gtPlusPlus.api.thermal.energy;
import net.minecraftforge.common.util.ForgeDirection;
public interface IThermalConnection {
- boolean canConnectThermalEnergy(ForgeDirection arg0);
-} \ No newline at end of file
+ boolean canConnectThermalEnergy(ForgeDirection arg0);
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalContainerItem.java b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalContainerItem.java
index 072695bd76..14f566c1a7 100644
--- a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalContainerItem.java
+++ b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalContainerItem.java
@@ -3,13 +3,12 @@ package gtPlusPlus.api.thermal.energy;
import net.minecraft.item.ItemStack;
public interface IThermalContainerItem {
-
- int receiveThermalEnergy(ItemStack arg0, int arg1, boolean arg2);
- int extractThermalEnergy(ItemStack arg0, int arg1, boolean arg2);
+ int receiveThermalEnergy(ItemStack arg0, int arg1, boolean arg2);
- int getThermalEnergyStored(ItemStack arg0);
+ int extractThermalEnergy(ItemStack arg0, int arg1, boolean arg2);
- int getMaxThermalEnergyStored(ItemStack arg0);
-
-} \ No newline at end of file
+ int getThermalEnergyStored(ItemStack arg0);
+
+ int getMaxThermalEnergyStored(ItemStack arg0);
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalHandler.java b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalHandler.java
index 3ab7127757..6f0235f4d7 100644
--- a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalHandler.java
+++ b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalHandler.java
@@ -3,13 +3,12 @@ package gtPlusPlus.api.thermal.energy;
import net.minecraftforge.common.util.ForgeDirection;
public interface IThermalHandler extends IThermalProvider, IThermalReceiver {
-
- int receiveThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2);
- int extractThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2);
+ int receiveThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2);
- int getThermalEnergyStored(ForgeDirection arg0);
+ int extractThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2);
- int getMaxThermalEnergyStored(ForgeDirection arg0);
-
-} \ No newline at end of file
+ int getThermalEnergyStored(ForgeDirection arg0);
+
+ int getMaxThermalEnergyStored(ForgeDirection arg0);
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalProvider.java b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalProvider.java
index 0e4a060b23..a13a041176 100644
--- a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalProvider.java
+++ b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalProvider.java
@@ -3,11 +3,10 @@ package gtPlusPlus.api.thermal.energy;
import net.minecraftforge.common.util.ForgeDirection;
public interface IThermalProvider extends IThermalConnection {
-
- int extractThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2);
- int getThermalEnergyStored(ForgeDirection arg0);
+ int extractThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2);
- int getMaxThermalEnergyStored(ForgeDirection arg0);
-
-} \ No newline at end of file
+ int getThermalEnergyStored(ForgeDirection arg0);
+
+ int getMaxThermalEnergyStored(ForgeDirection arg0);
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalReceiver.java b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalReceiver.java
index e08ce48a06..85be402658 100644
--- a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalReceiver.java
+++ b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalReceiver.java
@@ -3,11 +3,10 @@ package gtPlusPlus.api.thermal.energy;
import net.minecraftforge.common.util.ForgeDirection;
public interface IThermalReceiver extends IThermalConnection {
-
- int receiveThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2);
- int getThermalEnergyStored(ForgeDirection arg0);
+ int receiveThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2);
- int getMaxThermalEnergyStored(ForgeDirection arg0);
-
-} \ No newline at end of file
+ int getThermalEnergyStored(ForgeDirection arg0);
+
+ int getMaxThermalEnergyStored(ForgeDirection arg0);
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalStorage.java b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalStorage.java
index db3e6c8966..43d76b73ec 100644
--- a/src/main/java/gtPlusPlus/api/thermal/energy/IThermalStorage.java
+++ b/src/main/java/gtPlusPlus/api/thermal/energy/IThermalStorage.java
@@ -1,13 +1,12 @@
package gtPlusPlus.api.thermal.energy;
public interface IThermalStorage {
-
- int receiveThermalEnergy(int arg0, boolean arg1);
- int extractThermalEnergy(int arg0, boolean arg1);
+ int receiveThermalEnergy(int arg0, boolean arg1);
- int getThermalEnergyStored();
+ int extractThermalEnergy(int arg0, boolean arg1);
- int getMaxThermalEnergyStored();
-
-} \ No newline at end of file
+ int getThermalEnergyStored();
+
+ int getMaxThermalEnergyStored();
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorage.java b/src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorage.java
index 9c7bb0066c..60efc687dc 100644
--- a/src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorage.java
+++ b/src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorage.java
@@ -3,114 +3,111 @@ package gtPlusPlus.api.thermal.energy;
import net.minecraft.nbt.NBTTagCompound;
public class ThermalStorage implements IThermalStorage {
-
- protected int thermal_energy;
- protected int capacity;
- protected int maxReceive;
- protected int maxExtract;
-
- public ThermalStorage(int arg0) {
- this(arg0, arg0, arg0);
- }
-
- public ThermalStorage(int arg0, int arg1) {
- this(arg0, arg1, arg1);
- }
-
- public ThermalStorage(int arg0, int arg1, int arg2) {
- this.capacity = arg0;
- this.maxReceive = arg1;
- this.maxExtract = arg2;
- }
-
- public ThermalStorage readFromNBT(NBTTagCompound arg0) {
- this.thermal_energy = arg0.getInteger("ThermalEnergy");
- if (this.thermal_energy > this.capacity) {
- this.thermal_energy = this.capacity;
- }
- return this;
- }
-
- public NBTTagCompound writeToNBT(NBTTagCompound arg0) {
- if (this.thermal_energy < 0) {
- this.thermal_energy = 0;
- }
- arg0.setInteger("ThermalEnergy", this.thermal_energy);
- return arg0;
- }
-
- public void setCapacity(int arg0) {
- this.capacity = arg0;
- if (this.thermal_energy > arg0) {
- this.thermal_energy = arg0;
- }
-
- }
-
- public void setMaxTransfer(int arg0) {
- this.setMaxReceive(arg0);
- this.setMaxExtract(arg0);
- }
-
- public void setMaxReceive(int arg0) {
- this.maxReceive = arg0;
- }
-
- public void setMaxExtract(int arg0) {
- this.maxExtract = arg0;
- }
-
- public int getMaxReceive() {
- return this.maxReceive;
- }
-
- public int getMaxExtract() {
- return this.maxExtract;
- }
-
- public void setEnergyStored(int arg0) {
- this.thermal_energy = arg0;
- if (this.thermal_energy > this.capacity) {
- this.thermal_energy = this.capacity;
- } else if (this.thermal_energy < 0) {
- this.thermal_energy = 0;
- }
-
- }
-
- public void modifyEnergyStored(int arg0) {
- this.thermal_energy += arg0;
- if (this.thermal_energy > this.capacity) {
- this.thermal_energy = this.capacity;
- } else if (this.thermal_energy < 0) {
- this.thermal_energy = 0;
- }
-
- }
-
- public int receiveThermalEnergy(int arg0, boolean arg1) {
- int arg2 = Math.min(this.capacity - this.thermal_energy, Math.min(this.maxReceive, arg0));
- if (!arg1) {
- this.thermal_energy += arg2;
- }
-
- return arg2;
- }
-
- public int extractThermalEnergy(int arg0, boolean arg1) {
- int arg2 = Math.min(this.thermal_energy, Math.min(this.maxExtract, arg0));
- if (!arg1) {
- this.thermal_energy -= arg2;
- }
-
- return arg2;
- }
-
- public int getThermalEnergyStored() {
- return this.thermal_energy;
- }
-
- public int getMaxThermalEnergyStored() {
- return this.capacity;
- }
-} \ No newline at end of file
+
+ protected int thermal_energy;
+ protected int capacity;
+ protected int maxReceive;
+ protected int maxExtract;
+
+ public ThermalStorage(int arg0) {
+ this(arg0, arg0, arg0);
+ }
+
+ public ThermalStorage(int arg0, int arg1) {
+ this(arg0, arg1, arg1);
+ }
+
+ public ThermalStorage(int arg0, int arg1, int arg2) {
+ this.capacity = arg0;
+ this.maxReceive = arg1;
+ this.maxExtract = arg2;
+ }
+
+ public ThermalStorage readFromNBT(NBTTagCompound arg0) {
+ this.thermal_energy = arg0.getInteger("ThermalEnergy");
+ if (this.thermal_energy > this.capacity) {
+ this.thermal_energy = this.capacity;
+ }
+ return this;
+ }
+
+ public NBTTagCompound writeToNBT(NBTTagCompound arg0) {
+ if (this.thermal_energy < 0) {
+ this.thermal_energy = 0;
+ }
+ arg0.setInteger("ThermalEnergy", this.thermal_energy);
+ return arg0;
+ }
+
+ public void setCapacity(int arg0) {
+ this.capacity = arg0;
+ if (this.thermal_energy > arg0) {
+ this.thermal_energy = arg0;
+ }
+ }
+
+ public void setMaxTransfer(int arg0) {
+ this.setMaxReceive(arg0);
+ this.setMaxExtract(arg0);
+ }
+
+ public void setMaxReceive(int arg0) {
+ this.maxReceive = arg0;
+ }
+
+ public void setMaxExtract(int arg0) {
+ this.maxExtract = arg0;
+ }
+
+ public int getMaxReceive() {
+ return this.maxReceive;
+ }
+
+ public int getMaxExtract() {
+ return this.maxExtract;
+ }
+
+ public void setEnergyStored(int arg0) {
+ this.thermal_energy = arg0;
+ if (this.thermal_energy > this.capacity) {
+ this.thermal_energy = this.capacity;
+ } else if (this.thermal_energy < 0) {
+ this.thermal_energy = 0;
+ }
+ }
+
+ public void modifyEnergyStored(int arg0) {
+ this.thermal_energy += arg0;
+ if (this.thermal_energy > this.capacity) {
+ this.thermal_energy = this.capacity;
+ } else if (this.thermal_energy < 0) {
+ this.thermal_energy = 0;
+ }
+ }
+
+ public int receiveThermalEnergy(int arg0, boolean arg1) {
+ int arg2 = Math.min(this.capacity - this.thermal_energy, Math.min(this.maxReceive, arg0));
+ if (!arg1) {
+ this.thermal_energy += arg2;
+ }
+
+ return arg2;
+ }
+
+ public int extractThermalEnergy(int arg0, boolean arg1) {
+ int arg2 = Math.min(this.thermal_energy, Math.min(this.maxExtract, arg0));
+ if (!arg1) {
+ this.thermal_energy -= arg2;
+ }
+
+ return arg2;
+ }
+
+ public int getThermalEnergyStored() {
+ return this.thermal_energy;
+ }
+
+ public int getMaxThermalEnergyStored() {
+ return this.capacity;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorageAdv.java b/src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorageAdv.java
index 47af7e79a6..54fa147efe 100644
--- a/src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorageAdv.java
+++ b/src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorageAdv.java
@@ -1,34 +1,34 @@
package gtPlusPlus.api.thermal.energy;
public class ThermalStorageAdv extends ThermalStorage {
-
- public ThermalStorageAdv(int arg0) {
- this(arg0, arg0, arg0);
- }
-
- public ThermalStorageAdv(int arg0, int arg1) {
- this(arg0, arg1, arg1);
- }
-
- public ThermalStorageAdv(int arg0, int arg1, int arg2) {
- super(arg0, arg1, arg2);
- }
-
- public int receiveEnergyNoLimit(int arg0, boolean arg1) {
- int arg2 = Math.min(super.capacity - super.thermal_energy, arg0);
- if (!arg1) {
- super.thermal_energy += arg2;
- }
-
- return arg2;
- }
-
- public int extractEnergyNoLimit(int arg0, boolean arg1) {
- int arg2 = Math.min(super.thermal_energy, arg0);
- if (!arg1) {
- super.thermal_energy -= arg2;
- }
-
- return arg2;
- }
-} \ No newline at end of file
+
+ public ThermalStorageAdv(int arg0) {
+ this(arg0, arg0, arg0);
+ }
+
+ public ThermalStorageAdv(int arg0, int arg1) {
+ this(arg0, arg1, arg1);
+ }
+
+ public ThermalStorageAdv(int arg0, int arg1, int arg2) {
+ super(arg0, arg1, arg2);
+ }
+
+ public int receiveEnergyNoLimit(int arg0, boolean arg1) {
+ int arg2 = Math.min(super.capacity - super.thermal_energy, arg0);
+ if (!arg1) {
+ super.thermal_energy += arg2;
+ }
+
+ return arg2;
+ }
+
+ public int extractEnergyNoLimit(int arg0, boolean arg1) {
+ int arg2 = Math.min(super.thermal_energy, arg0);
+ if (!arg1) {
+ super.thermal_energy -= arg2;
+ }
+
+ return arg2;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/sample/ItemThermalContainer.java b/src/main/java/gtPlusPlus/api/thermal/sample/ItemThermalContainer.java
index 015e5fd5f3..eb4b42259d 100644
--- a/src/main/java/gtPlusPlus/api/thermal/sample/ItemThermalContainer.java
+++ b/src/main/java/gtPlusPlus/api/thermal/sample/ItemThermalContainer.java
@@ -6,79 +6,78 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class ItemThermalContainer extends Item implements IThermalContainerItem {
- protected int capacity;
- protected int maxReceive;
- protected int maxExtract;
+ protected int capacity;
+ protected int maxReceive;
+ protected int maxExtract;
- public ItemThermalContainer() {
- }
+ public ItemThermalContainer() {}
- public ItemThermalContainer(int arg0) {
- this(arg0, arg0, arg0);
- }
+ public ItemThermalContainer(int arg0) {
+ this(arg0, arg0, arg0);
+ }
- public ItemThermalContainer(int arg0, int arg1) {
- this(arg0, arg1, arg1);
- }
+ public ItemThermalContainer(int arg0, int arg1) {
+ this(arg0, arg1, arg1);
+ }
- public ItemThermalContainer(int arg0, int arg1, int arg2) {
- this.capacity = arg0;
- this.maxReceive = arg1;
- this.maxExtract = arg2;
- }
+ public ItemThermalContainer(int arg0, int arg1, int arg2) {
+ this.capacity = arg0;
+ this.maxReceive = arg1;
+ this.maxExtract = arg2;
+ }
- public ItemThermalContainer setCapacity(int arg0) {
- this.capacity = arg0;
- return this;
- }
+ public ItemThermalContainer setCapacity(int arg0) {
+ this.capacity = arg0;
+ return this;
+ }
- public void setMaxTransfer(int arg0) {
- this.setMaxReceive(arg0);
- this.setMaxExtract(arg0);
- }
+ public void setMaxTransfer(int arg0) {
+ this.setMaxReceive(arg0);
+ this.setMaxExtract(arg0);
+ }
- public void setMaxReceive(int arg0) {
- this.maxReceive = arg0;
- }
+ public void setMaxReceive(int arg0) {
+ this.maxReceive = arg0;
+ }
- public void setMaxExtract(int arg0) {
- this.maxExtract = arg0;
- }
+ public void setMaxExtract(int arg0) {
+ this.maxExtract = arg0;
+ }
- public int receiveThermalEnergy(ItemStack arg0, int arg1, boolean arg2) {
- if (arg0.getTagCompound() == null) {
- arg0.stackTagCompound = new NBTTagCompound();
- }
- int arg3 = arg0.stackTagCompound.getInteger("ThermalEnergy");
- int arg4 = Math.min(this.capacity - arg3, Math.min(this.maxReceive, arg1));
- if (!arg2) {
- arg3 += arg4;
- arg0.stackTagCompound.setInteger("ThermalEnergy", arg3);
- }
- return arg4;
- }
+ public int receiveThermalEnergy(ItemStack arg0, int arg1, boolean arg2) {
+ if (arg0.getTagCompound() == null) {
+ arg0.stackTagCompound = new NBTTagCompound();
+ }
+ int arg3 = arg0.stackTagCompound.getInteger("ThermalEnergy");
+ int arg4 = Math.min(this.capacity - arg3, Math.min(this.maxReceive, arg1));
+ if (!arg2) {
+ arg3 += arg4;
+ arg0.stackTagCompound.setInteger("ThermalEnergy", arg3);
+ }
+ return arg4;
+ }
- public int extractThermalEnergy(ItemStack arg0, int arg1, boolean arg2) {
- if (arg0.stackTagCompound != null && arg0.stackTagCompound.hasKey("ThermalEnergy")) {
- int arg3 = arg0.stackTagCompound.getInteger("ThermalEnergy");
- int arg4 = Math.min(arg3, Math.min(this.maxExtract, arg1));
- if (!arg2) {
- arg3 -= arg4;
- arg0.stackTagCompound.setInteger("ThermalEnergy", arg3);
- }
- return arg4;
- } else {
- return 0;
- }
- }
+ public int extractThermalEnergy(ItemStack arg0, int arg1, boolean arg2) {
+ if (arg0.stackTagCompound != null && arg0.stackTagCompound.hasKey("ThermalEnergy")) {
+ int arg3 = arg0.stackTagCompound.getInteger("ThermalEnergy");
+ int arg4 = Math.min(arg3, Math.min(this.maxExtract, arg1));
+ if (!arg2) {
+ arg3 -= arg4;
+ arg0.stackTagCompound.setInteger("ThermalEnergy", arg3);
+ }
+ return arg4;
+ } else {
+ return 0;
+ }
+ }
- public int getThermalEnergyStored(ItemStack arg0) {
- return arg0.stackTagCompound != null && arg0.stackTagCompound.hasKey("ThermalEnergy")
- ? arg0.stackTagCompound.getInteger("ThermalEnergy")
- : 0;
- }
+ public int getThermalEnergyStored(ItemStack arg0) {
+ return arg0.stackTagCompound != null && arg0.stackTagCompound.hasKey("ThermalEnergy")
+ ? arg0.stackTagCompound.getInteger("ThermalEnergy")
+ : 0;
+ }
- public int getMaxThermalEnergyStored(ItemStack arg0) {
- return this.capacity;
- }
-} \ No newline at end of file
+ public int getMaxThermalEnergyStored(ItemStack arg0) {
+ return this.capacity;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/sample/TileThermalHandler.java b/src/main/java/gtPlusPlus/api/thermal/sample/TileThermalHandler.java
index e2e3c50ab7..57f1d64f16 100644
--- a/src/main/java/gtPlusPlus/api/thermal/sample/TileThermalHandler.java
+++ b/src/main/java/gtPlusPlus/api/thermal/sample/TileThermalHandler.java
@@ -7,36 +7,36 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TileThermalHandler extends TileEntity implements IThermalHandler {
-
- protected ThermalStorage storage = new ThermalStorage(32000);
-
- public void readFromNBT(NBTTagCompound arg0) {
- super.readFromNBT(arg0);
- this.storage.readFromNBT(arg0);
- }
-
- public void writeToNBT(NBTTagCompound arg0) {
- super.writeToNBT(arg0);
- this.storage.writeToNBT(arg0);
- }
-
- public boolean canConnectThermalEnergy(ForgeDirection arg0) {
- return true;
- }
-
- public int receiveThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2) {
- return this.storage.receiveThermalEnergy(arg1, arg2);
- }
-
- public int extractThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2) {
- return this.storage.extractThermalEnergy(arg1, arg2);
- }
-
- public int getThermalEnergyStored(ForgeDirection arg0) {
- return this.storage.getThermalEnergyStored();
- }
-
- public int getMaxThermalEnergyStored(ForgeDirection arg0) {
- return this.storage.getMaxThermalEnergyStored();
- }
-} \ No newline at end of file
+
+ protected ThermalStorage storage = new ThermalStorage(32000);
+
+ public void readFromNBT(NBTTagCompound arg0) {
+ super.readFromNBT(arg0);
+ this.storage.readFromNBT(arg0);
+ }
+
+ public void writeToNBT(NBTTagCompound arg0) {
+ super.writeToNBT(arg0);
+ this.storage.writeToNBT(arg0);
+ }
+
+ public boolean canConnectThermalEnergy(ForgeDirection arg0) {
+ return true;
+ }
+
+ public int receiveThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2) {
+ return this.storage.receiveThermalEnergy(arg1, arg2);
+ }
+
+ public int extractThermalEnergy(ForgeDirection arg0, int arg1, boolean arg2) {
+ return this.storage.extractThermalEnergy(arg1, arg2);
+ }
+
+ public int getThermalEnergyStored(ForgeDirection arg0) {
+ return this.storage.getThermalEnergyStored();
+ }
+
+ public int getMaxThermalEnergyStored(ForgeDirection arg0) {
+ return this.storage.getMaxThermalEnergyStored();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/thermal/tileentity/IThermalInfo.java b/src/main/java/gtPlusPlus/api/thermal/tileentity/IThermalInfo.java
index a40535887c..2172ff385b 100644
--- a/src/main/java/gtPlusPlus/api/thermal/tileentity/IThermalInfo.java
+++ b/src/main/java/gtPlusPlus/api/thermal/tileentity/IThermalInfo.java
@@ -1,13 +1,12 @@
package gtPlusPlus.api.thermal.tileentity;
public interface IThermalInfo {
-
- int getInfoEnergyPerTick();
- int getInfoMaxEnergyPerTick();
+ int getInfoEnergyPerTick();
- int getInfoEnergyStored();
+ int getInfoMaxEnergyPerTick();
- int getInfoMaxEnergyStored();
-
-} \ No newline at end of file
+ int getInfoEnergyStored();
+
+ int getInfoMaxEnergyStored();
+}
diff --git a/src/main/java/gtPlusPlus/australia/GTplusplus_Australia.java b/src/main/java/gtPlusPlus/australia/GTplusplus_Australia.java
index 9a16ad1785..16b54138e2 100644
--- a/src/main/java/gtPlusPlus/australia/GTplusplus_Australia.java
+++ b/src/main/java/gtPlusPlus/australia/GTplusplus_Australia.java
@@ -1,9 +1,5 @@
package gtPlusPlus.australia;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
@@ -28,131 +24,136 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.CORE.Australia;
import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.config.Configuration;
@MCVersion(value = "1.7.10")
-@Mod(modid = Australia.MODID, name = Australia.NAME, version = Australia.VERSION, dependencies = "required-after:Forge; after:dreamcraft; after:IC2; after:ihl; required-after:gregtech; required-after:miscutils;")
+@Mod(
+ modid = Australia.MODID,
+ name = Australia.NAME,
+ version = Australia.VERSION,
+ dependencies =
+ "required-after:Forge; after:dreamcraft; after:IC2; after:ihl; required-after:gregtech; required-after:miscutils;")
public class GTplusplus_Australia implements ActionListener {
- //Mod Instance
- @Mod.Instance(Australia.MODID)
- public static GTplusplus_Australia instance;
- public static GTPP_Config sCustomWorldgenFile = null;
-
- // Dark World Handler
- //protected static volatile Biome_AustralianDesert Australian_Desert_Biome_1;
- //protected static volatile Biome_AustralianDesert2 Australian_Desert_Biome_2;
-
- public static volatile Biome_AustralianDesert_Ex Australian_Desert_Biome_3;
- public static volatile Biome_AustralianForest Australian_Forest_Biome;
- public static volatile Biome_AustralianOcean Australian_Ocean_Biome;
- public static volatile Biome_AustralianOutback Australian_Outback_Biome;
- public static volatile Biome_AustralianPlains Australian_Plains_Biome;
-
- public static volatile Dimension_Australia Australia_Dimension;
- public static AustraliaWorldGenerator Australia_World_Generator;
- public static int globalAustraliaPortalSpawnTimer = 0;
-
- // Pre-Init
- @Mod.EventHandler
- public void preInit(final FMLPreInitializationEvent event) {
- Logger.INFO("Loading " + Australia.MODID + " V" + Australia.VERSION);
-
- //Setup
- setVars(event);
-
- Australia_Dimension = new Dimension_Australia();
- Australia_Dimension.instance = instance;
-
- //Australian_Desert_Biome_1 = (new Biome_AustralianDesert());
- //Australian_Desert_Biome_2 = (new Biome_AustralianDesert2());
- //Australian_Desert_Biome_1.instance = instance;
- //Australian_Desert_Biome_2.instance = instance;
- //Australian_Desert_Biome_1.preInit(event);
- //Australian_Desert_Biome_2.preInit(event);
-
-
- Australian_Desert_Biome_3 = (Biome_AustralianDesert_Ex.biome);
- Australian_Forest_Biome = (Biome_AustralianForest.biome);
- Australian_Ocean_Biome = (Biome_AustralianOcean.biome);
- Australian_Outback_Biome = (Biome_AustralianOutback.biome);
- Australian_Plains_Biome = Biome_AustralianPlains.biome;
-
- //Load Villages
- StructureManager.registerVillageComponents();
-
- setupWorldGenerator();
-
- //Load/Set Custom Ore Gen
- sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg")));
-
- }
-
- @EventHandler
- public void load(final FMLInitializationEvent e) {
- Logger.INFO("Begin resource allocation for " + Australia.MODID + " V" +Australia.VERSION);
-
- //Load World and Biome
- GameRegistry.registerWorldGenerator(new WorldGen_GT_Australia_Base(), Short.MAX_VALUE);
-
- //Australian_Desert_Biome_1.load();
- //Australian_Desert_Biome_2.load();
- Australian_Desert_Biome_3.load();
- Australian_Forest_Biome.load();
- Australian_Ocean_Biome.load();
- Australian_Outback_Biome.load();
- Australian_Plains_Biome.load();
-
- Australia_Dimension.load();
-
- }
-
- public static synchronized void GenerateOreMaterials() {
-
- }
-
- protected synchronized void setVars(FMLPreInitializationEvent event){
-
- sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg")));
-
- if (DimensionManager.isDimensionRegistered(Dimension_Australia.DIMID)){
- Dimension_Australia.DIMID = DimensionManager.getNextFreeDimId();
- }
-
- /*
- * Set World Generation Values
- */
- WorldGen_Australia_Ores.generateValidOreVeins();
- WorldGen_GT_Australia_Base.oreveinPercentage = 16;
- WorldGen_GT_Australia_Base.oreveinAttempts = 16;
- WorldGen_GT_Australia_Base.oreveinMaxPlacementAttempts = 2;
- if (CORE_Preloader.DEBUG_MODE || CORE.DEVENV){
- WorldGen_GT_Australia_Base.debugWorldGen = true;
- }
- AustraliaContentLoader.run();
- }
-
- @EventHandler
- public void serverLoad(FMLServerStartingEvent event) {
- Australia_World_Generator.initiate();
- }
-
- @EventHandler
- public static void postInit(final FMLPostInitializationEvent e) {
- Logger.INFO("Finished loading Australia plugin for GT++.");
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- private void setupWorldGenerator() {
- Logger.INFO("Registering World Generator for Australia.");
- Australia_World_Generator = new AustraliaWorldGenerator();
- GameRegistry.registerWorldGenerator(Australia_World_Generator, 0);
- }
-
+ // Mod Instance
+ @Mod.Instance(Australia.MODID)
+ public static GTplusplus_Australia instance;
+
+ public static GTPP_Config sCustomWorldgenFile = null;
+
+ // Dark World Handler
+ // protected static volatile Biome_AustralianDesert Australian_Desert_Biome_1;
+ // protected static volatile Biome_AustralianDesert2 Australian_Desert_Biome_2;
+
+ public static volatile Biome_AustralianDesert_Ex Australian_Desert_Biome_3;
+ public static volatile Biome_AustralianForest Australian_Forest_Biome;
+ public static volatile Biome_AustralianOcean Australian_Ocean_Biome;
+ public static volatile Biome_AustralianOutback Australian_Outback_Biome;
+ public static volatile Biome_AustralianPlains Australian_Plains_Biome;
+
+ public static volatile Dimension_Australia Australia_Dimension;
+ public static AustraliaWorldGenerator Australia_World_Generator;
+ public static int globalAustraliaPortalSpawnTimer = 0;
+
+ // Pre-Init
+ @Mod.EventHandler
+ public void preInit(final FMLPreInitializationEvent event) {
+ Logger.INFO("Loading " + Australia.MODID + " V" + Australia.VERSION);
+
+ // Setup
+ setVars(event);
+
+ Australia_Dimension = new Dimension_Australia();
+ Australia_Dimension.instance = instance;
+
+ // Australian_Desert_Biome_1 = (new Biome_AustralianDesert());
+ // Australian_Desert_Biome_2 = (new Biome_AustralianDesert2());
+ // Australian_Desert_Biome_1.instance = instance;
+ // Australian_Desert_Biome_2.instance = instance;
+ // Australian_Desert_Biome_1.preInit(event);
+ // Australian_Desert_Biome_2.preInit(event);
+
+ Australian_Desert_Biome_3 = (Biome_AustralianDesert_Ex.biome);
+ Australian_Forest_Biome = (Biome_AustralianForest.biome);
+ Australian_Ocean_Biome = (Biome_AustralianOcean.biome);
+ Australian_Outback_Biome = (Biome_AustralianOutback.biome);
+ Australian_Plains_Biome = Biome_AustralianPlains.biome;
+
+ // Load Villages
+ StructureManager.registerVillageComponents();
+
+ setupWorldGenerator();
+
+ // Load/Set Custom Ore Gen
+ sCustomWorldgenFile = new GTPP_Config(new Configuration(
+ new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg")));
+ }
+
+ @EventHandler
+ public void load(final FMLInitializationEvent e) {
+ Logger.INFO("Begin resource allocation for " + Australia.MODID + " V" + Australia.VERSION);
+
+ // Load World and Biome
+ GameRegistry.registerWorldGenerator(new WorldGen_GT_Australia_Base(), Short.MAX_VALUE);
+
+ // Australian_Desert_Biome_1.load();
+ // Australian_Desert_Biome_2.load();
+ Australian_Desert_Biome_3.load();
+ Australian_Forest_Biome.load();
+ Australian_Ocean_Biome.load();
+ Australian_Outback_Biome.load();
+ Australian_Plains_Biome.load();
+
+ Australia_Dimension.load();
+ }
+
+ public static synchronized void GenerateOreMaterials() {}
+
+ protected synchronized void setVars(FMLPreInitializationEvent event) {
+
+ sCustomWorldgenFile = new GTPP_Config(new Configuration(
+ new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg")));
+
+ if (DimensionManager.isDimensionRegistered(Dimension_Australia.DIMID)) {
+ Dimension_Australia.DIMID = DimensionManager.getNextFreeDimId();
+ }
+
+ /*
+ * Set World Generation Values
+ */
+ WorldGen_Australia_Ores.generateValidOreVeins();
+ WorldGen_GT_Australia_Base.oreveinPercentage = 16;
+ WorldGen_GT_Australia_Base.oreveinAttempts = 16;
+ WorldGen_GT_Australia_Base.oreveinMaxPlacementAttempts = 2;
+ if (CORE_Preloader.DEBUG_MODE || CORE.DEVENV) {
+ WorldGen_GT_Australia_Base.debugWorldGen = true;
+ }
+ AustraliaContentLoader.run();
+ }
+
+ @EventHandler
+ public void serverLoad(FMLServerStartingEvent event) {
+ Australia_World_Generator.initiate();
+ }
+
+ @EventHandler
+ public static void postInit(final FMLPostInitializationEvent e) {
+ Logger.INFO("Finished loading Australia plugin for GT++.");
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ private void setupWorldGenerator() {
+ Logger.INFO("Registering World Generator for Australia.");
+ Australia_World_Generator = new AustraliaWorldGenerator();
+ GameRegistry.registerWorldGenerator(Australia_World_Generator, 0);
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/biome/CustomDecorator.java b/src/main/java/gtPlusPlus/australia/biome/CustomDecorator.java
index 2d9b335d52..ea6b50a478 100644
--- a/src/main/java/gtPlusPlus/australia/biome/CustomDecorator.java
+++ b/src/main/java/gtPlusPlus/australia/biome/CustomDecorator.java
@@ -1,11 +1,12 @@
package gtPlusPlus.australia.biome;
-import java.util.Random;
+import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*;
+import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*;
-import gtPlusPlus.api.interfaces.IGeneratorWorld;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.australia.GTplusplus_Australia;
import gtPlusPlus.australia.gen.world.WorldGenAustralianOre;
+import java.util.Random;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
@@ -24,332 +25,331 @@ import net.minecraft.world.gen.feature.WorldGenReed;
import net.minecraft.world.gen.feature.WorldGenSand;
import net.minecraft.world.gen.feature.WorldGenWaterlily;
import net.minecraft.world.gen.feature.WorldGenerator;
-
-import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*;
-import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*;
import net.minecraftforge.common.*;
import net.minecraftforge.event.terraingen.*;
public class CustomDecorator extends BiomeDecorator {
-
- public CustomDecorator() {
- this.sandGen = new WorldGenSand(Blocks.sand, 10);
- this.gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6);
- this.dirtGen = new WorldGenMinable(Blocks.dirt, 16);
- this.gravelGen = new WorldGenMinable(Blocks.gravel, 16);
-
- this.coalGen = new WorldGenAustralianOre(Blocks.coal_ore, 4);
- this.ironGen = new WorldGenAustralianOre(Blocks.clay, 4);
- this.goldGen = new WorldGenAustralianOre(Blocks.soul_sand, 20);
- this.redstoneGen = new WorldGenAustralianOre(Blocks.bedrock, 8);
- this.diamondGen = new WorldGenAustralianOre(Blocks.diamond_ore, 1);
- this.lapisGen = new WorldGenAustralianOre(Blocks.lava, 16);
-
- this.yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower);
- this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom);
- this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom);
- this.bigMushroomGen = new WorldGenBigMushroom();
- this.reedGen = new WorldGenReed();
- this.cactusGen = new WorldGenCactus();
- this.waterlilyGen = new WorldGenWaterlily();
- this.flowersPerChunk = 2;
- this.grassPerChunk = 1;
- this.sandPerChunk = 1;
- this.sandPerChunk2 = 3;
- this.clayPerChunk = 2;
- this.generateLakes = true;
- }
-
- int mDecoratorTimeout = 0;
-
- public void decorateChunk(World aWorld, Random aRand, BiomeGenBase aGen, int aX, int aZ) {
- if (this.currentWorld != null && this.chunk_X == aX && this.chunk_Z == aZ) {
- try {
- while (this.currentWorld != null) {
- if (mDecoratorTimeout % 1000 == 0) {
- Logger.WORLD("Waiting for chunk @ "+aX+", "+aZ+" to generate. Waited "+mDecoratorTimeout+"ms already.");
- }
- if (this.currentWorld == null) {
- break;
- }
- if (mDecoratorTimeout >= 5000) {
- throw new RuntimeException("Already decorating!!");
- }
- mDecoratorTimeout++;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- throw new RuntimeException("Already decorating!!");
- }
- }
- if (this.currentWorld == null) {
- this.currentWorld = aWorld;
- this.randomGenerator = aRand;
- this.chunk_X = aX;
- this.chunk_Z = aZ;
- this.genDecorations(aGen);
- this.currentWorld = null;
- this.randomGenerator = null;
- }
- }
-
- protected void genDecorations(BiomeGenBase p_150513_1_) {
- MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
- this.generateOres();
- int i;
- int j;
- int k;
-
- boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND);
- for (i = 0; doGen && i < this.sandPerChunk2; ++i) {
- j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- this.sandGen.generate(this.currentWorld, this.randomGenerator, j,
- this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY);
- for (i = 0; doGen && i < this.clayPerChunk; ++i) {
- j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- this.clayGen.generate(this.currentWorld, this.randomGenerator, j,
- this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2);
- for (i = 0; doGen && i < this.sandPerChunk; ++i) {
- j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- this.gravelAsSandGen.generate(this.currentWorld, this.randomGenerator, j,
- this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
- }
-
- i = this.treesPerChunk;
-
- if (this.randomGenerator.nextInt(10) == 0) {
- ++i;
- }
-
- int l;
- int i1;
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE);
- for (j = 0; doGen && j < i; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- i1 = this.currentWorld.getHeightValue(k, l);
- WorldGenAbstractTree worldgenabstracttree = p_150513_1_.func_150567_a(this.randomGenerator);
- worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);
-
- if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, k, i1, l)) {
- worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, k, i1, l);
- }
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, BIG_SHROOM);
- for (j = 0; doGen && j < this.bigMushroomsPerChunk; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, k,
- this.currentWorld.getHeightValue(k, l), l);
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS);
- for (j = 0; doGen && j < this.flowersPerChunk; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- i1 = nextInt(this.currentWorld.getHeightValue(k, l) + 32);
- String s = p_150513_1_.func_150572_a(this.randomGenerator, k, i1, l);
- BlockFlower blockflower = BlockFlower.func_149857_e(s);
-
- if (blockflower.getMaterial() != Material.air) {
- this.yellowFlowerGen.func_150550_a(blockflower, BlockFlower.func_149856_f(s));
- this.yellowFlowerGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
- }
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS);
- for (j = 0; doGen && j < this.grassPerChunk; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
- WorldGenerator worldgenerator = p_150513_1_.getRandomWorldGenForGrass(this.randomGenerator);
- worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l);
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH);
- for (j = 0; doGen && j < this.deadBushPerChunk; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
- (new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, k, i1, l);
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD);
- for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
-
- for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); i1 > 0
- && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1) {
- ;
- }
-
- this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM);
- for (j = 0; doGen && j < this.mushroomsPerChunk; ++j) {
- if (this.randomGenerator.nextInt(4) == 0) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- i1 = this.currentWorld.getHeightValue(k, l);
- this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
- }
-
- if (this.randomGenerator.nextInt(8) == 0) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
- this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
- }
- }
-
- if (doGen && this.randomGenerator.nextInt(4) == 0) {
- j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
- this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k);
- }
-
- if (doGen && this.randomGenerator.nextInt(8) == 0) {
- j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
- this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k);
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED);
- for (j = 0; doGen && j < this.reedsPerChunk; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
- this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
- }
-
- for (j = 0; doGen && j < 10; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
- this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, PUMPKIN);
- if (doGen && this.randomGenerator.nextInt(32) == 0) {
- j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
- (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, j, l, k);
- }
-
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS);
- for (j = 0; doGen && j < this.cactiPerChunk; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
- this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
- }
-
- try {
- int midX = Math.max(0, 7 / 2);
- int midZ = Math.max(0, 7 / 2);
- int mCurrentBiomeID = Integer.valueOf(currentWorld.getBiomeGenForCoords(chunk_X+midX, chunk_Z+midZ).biomeID);
-
- if (mCurrentBiomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
- this.generateLakes = false;
- }
-
- if (mCurrentBiomeID != GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
- doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE);
- if (doGen && this.generateLakes) {
- for (j = 0; j < 50; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8);
- i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- (new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, k, l, i1);
- }
-
- for (j = 0; j < 20; ++j) {
- k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.randomGenerator
- .nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8);
- i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, k, l, i1);
- }
- }
- }
- }
- catch (Throwable t) {
-
- }
-
- MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
- }
-
- /**
- * Standard ore generation helper. Generates most ores.
- */
- protected void genStandardOre1(int aAmount, WorldGenerator aOreGenerator, int p_76795_3_, int p_76795_4_) {
- for (int l = 0; l < aAmount; ++l) {
- int i1 = this.chunk_X + this.randomGenerator.nextInt(16);
- int j1 = this.randomGenerator.nextInt(p_76795_4_ - p_76795_3_) + p_76795_3_;
- int k1 = this.chunk_Z + this.randomGenerator.nextInt(16);
- aOreGenerator.generate(this.currentWorld, this.randomGenerator, i1, j1, k1);
- }
- }
-
- /**
- * Standard ore generation helper. Generates Lapis Lazuli.
- */
- protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) {
- for (int l = 0; l < p_76793_1_; ++l) {
- int i1 = this.chunk_X + this.randomGenerator.nextInt(16);
- int j1 = this.randomGenerator.nextInt(p_76793_4_) + this.randomGenerator.nextInt(p_76793_4_)
- + (p_76793_3_ - p_76793_4_);
- int k1 = this.chunk_Z + this.randomGenerator.nextInt(16);
- p_76793_2_.generate(this.currentWorld, this.randomGenerator, i1, j1, k1);
- }
- }
-
- /**
- * Generates ores in the current chunk
- */
- protected void generateOres() {
- MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
- if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT))
- this.genStandardOre1(20, this.dirtGen, 0, 256);
- if (TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen, chunk_X, chunk_Z, GRAVEL))
- this.genStandardOre1(10, this.gravelGen, 0, 256);
- if (TerrainGen.generateOre(currentWorld, randomGenerator, coalGen, chunk_X, chunk_Z, COAL))
- this.genStandardOre1(20, this.coalGen, 0, 128);
- if (TerrainGen.generateOre(currentWorld, randomGenerator, ironGen, chunk_X, chunk_Z, IRON))
- this.genStandardOre1(10, this.ironGen, 0, 64);
- if (TerrainGen.generateOre(currentWorld, randomGenerator, goldGen, chunk_X, chunk_Z, GOLD))
- this.genStandardOre1(15, this.goldGen, 0, 32);
- if (TerrainGen.generateOre(currentWorld, randomGenerator, redstoneGen, chunk_X, chunk_Z, REDSTONE))
- this.genStandardOre1(10, this.redstoneGen, 0, 16);
- if (TerrainGen.generateOre(currentWorld, randomGenerator, diamondGen, chunk_X, chunk_Z, DIAMOND))
- this.genStandardOre1(1, this.diamondGen, 0, 16);
- if (TerrainGen.generateOre(currentWorld, randomGenerator, lapisGen, chunk_X, chunk_Z, LAPIS))
- this.genStandardOre2(10, this.lapisGen, 16, 16);
- MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
- }
-
- private int nextInt(int i) {
- if (i <= 1)
- return 0;
- return this.randomGenerator.nextInt(i);
- }
-} \ No newline at end of file
+ public CustomDecorator() {
+ this.sandGen = new WorldGenSand(Blocks.sand, 10);
+ this.gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6);
+ this.dirtGen = new WorldGenMinable(Blocks.dirt, 16);
+ this.gravelGen = new WorldGenMinable(Blocks.gravel, 16);
+
+ this.coalGen = new WorldGenAustralianOre(Blocks.coal_ore, 4);
+ this.ironGen = new WorldGenAustralianOre(Blocks.clay, 4);
+ this.goldGen = new WorldGenAustralianOre(Blocks.soul_sand, 20);
+ this.redstoneGen = new WorldGenAustralianOre(Blocks.bedrock, 8);
+ this.diamondGen = new WorldGenAustralianOre(Blocks.diamond_ore, 1);
+ this.lapisGen = new WorldGenAustralianOre(Blocks.lava, 16);
+
+ this.yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower);
+ this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom);
+ this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom);
+ this.bigMushroomGen = new WorldGenBigMushroom();
+ this.reedGen = new WorldGenReed();
+ this.cactusGen = new WorldGenCactus();
+ this.waterlilyGen = new WorldGenWaterlily();
+ this.flowersPerChunk = 2;
+ this.grassPerChunk = 1;
+ this.sandPerChunk = 1;
+ this.sandPerChunk2 = 3;
+ this.clayPerChunk = 2;
+ this.generateLakes = true;
+ }
+
+ int mDecoratorTimeout = 0;
+
+ public void decorateChunk(World aWorld, Random aRand, BiomeGenBase aGen, int aX, int aZ) {
+ if (this.currentWorld != null && this.chunk_X == aX && this.chunk_Z == aZ) {
+ try {
+ while (this.currentWorld != null) {
+ if (mDecoratorTimeout % 1000 == 0) {
+ Logger.WORLD("Waiting for chunk @ " + aX + ", " + aZ + " to generate. Waited "
+ + mDecoratorTimeout + "ms already.");
+ }
+ if (this.currentWorld == null) {
+ break;
+ }
+ if (mDecoratorTimeout >= 5000) {
+ throw new RuntimeException("Already decorating!!");
+ }
+ mDecoratorTimeout++;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ throw new RuntimeException("Already decorating!!");
+ }
+ }
+ if (this.currentWorld == null) {
+ this.currentWorld = aWorld;
+ this.randomGenerator = aRand;
+ this.chunk_X = aX;
+ this.chunk_Z = aZ;
+ this.genDecorations(aGen);
+ this.currentWorld = null;
+ this.randomGenerator = null;
+ }
+ }
+
+ protected void genDecorations(BiomeGenBase p_150513_1_) {
+ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
+ this.generateOres();
+ int i;
+ int j;
+ int k;
+
+ boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND);
+ for (i = 0; doGen && i < this.sandPerChunk2; ++i) {
+ j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ this.sandGen.generate(
+ this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY);
+ for (i = 0; doGen && i < this.clayPerChunk; ++i) {
+ j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ this.clayGen.generate(
+ this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2);
+ for (i = 0; doGen && i < this.sandPerChunk; ++i) {
+ j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ this.gravelAsSandGen.generate(
+ this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
+ }
+
+ i = this.treesPerChunk;
+
+ if (this.randomGenerator.nextInt(10) == 0) {
+ ++i;
+ }
+
+ int l;
+ int i1;
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE);
+ for (j = 0; doGen && j < i; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ i1 = this.currentWorld.getHeightValue(k, l);
+ WorldGenAbstractTree worldgenabstracttree = p_150513_1_.func_150567_a(this.randomGenerator);
+ worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);
+
+ if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, k, i1, l)) {
+ worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, BIG_SHROOM);
+ for (j = 0; doGen && j < this.bigMushroomsPerChunk; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ this.bigMushroomGen.generate(
+ this.currentWorld, this.randomGenerator, k, this.currentWorld.getHeightValue(k, l), l);
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS);
+ for (j = 0; doGen && j < this.flowersPerChunk; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ i1 = nextInt(this.currentWorld.getHeightValue(k, l) + 32);
+ String s = p_150513_1_.func_150572_a(this.randomGenerator, k, i1, l);
+ BlockFlower blockflower = BlockFlower.func_149857_e(s);
+
+ if (blockflower.getMaterial() != Material.air) {
+ this.yellowFlowerGen.func_150550_a(blockflower, BlockFlower.func_149856_f(s));
+ this.yellowFlowerGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS);
+ for (j = 0; doGen && j < this.grassPerChunk; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
+ WorldGenerator worldgenerator = p_150513_1_.getRandomWorldGenForGrass(this.randomGenerator);
+ worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH);
+ for (j = 0; doGen && j < this.deadBushPerChunk; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
+ (new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD);
+ for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+
+ for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
+ i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l);
+ --i1) {
+ ;
+ }
+
+ this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM);
+ for (j = 0; doGen && j < this.mushroomsPerChunk; ++j) {
+ if (this.randomGenerator.nextInt(4) == 0) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ i1 = this.currentWorld.getHeightValue(k, l);
+ this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+
+ if (this.randomGenerator.nextInt(8) == 0) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
+ this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+ }
+
+ if (doGen && this.randomGenerator.nextInt(4) == 0) {
+ j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
+ this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k);
+ }
+
+ if (doGen && this.randomGenerator.nextInt(8) == 0) {
+ j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
+ this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k);
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED);
+ for (j = 0; doGen && j < this.reedsPerChunk; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
+ this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+
+ for (j = 0; doGen && j < 10; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
+ this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, PUMPKIN);
+ if (doGen && this.randomGenerator.nextInt(32) == 0) {
+ j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
+ (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, j, l, k);
+ }
+
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS);
+ for (j = 0; doGen && j < this.cactiPerChunk; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
+ this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
+ }
+
+ try {
+ int midX = Math.max(0, 7 / 2);
+ int midZ = Math.max(0, 7 / 2);
+ int mCurrentBiomeID =
+ Integer.valueOf(currentWorld.getBiomeGenForCoords(chunk_X + midX, chunk_Z + midZ).biomeID);
+
+ if (mCurrentBiomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
+ this.generateLakes = false;
+ }
+
+ if (mCurrentBiomeID != GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE);
+ if (doGen && this.generateLakes) {
+ for (j = 0; j < 50; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8);
+ i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ (new WorldGenLiquids(Blocks.flowing_water))
+ .generate(this.currentWorld, this.randomGenerator, k, l, i1);
+ }
+
+ for (j = 0; j < 20; ++j) {
+ k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
+ l = this.randomGenerator.nextInt(
+ this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8);
+ i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
+ (new WorldGenLiquids(Blocks.flowing_lava))
+ .generate(this.currentWorld, this.randomGenerator, k, l, i1);
+ }
+ }
+ }
+ } catch (Throwable t) {
+
+ }
+
+ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
+ }
+
+ /**
+ * Standard ore generation helper. Generates most ores.
+ */
+ protected void genStandardOre1(int aAmount, WorldGenerator aOreGenerator, int p_76795_3_, int p_76795_4_) {
+ for (int l = 0; l < aAmount; ++l) {
+ int i1 = this.chunk_X + this.randomGenerator.nextInt(16);
+ int j1 = this.randomGenerator.nextInt(p_76795_4_ - p_76795_3_) + p_76795_3_;
+ int k1 = this.chunk_Z + this.randomGenerator.nextInt(16);
+ aOreGenerator.generate(this.currentWorld, this.randomGenerator, i1, j1, k1);
+ }
+ }
+
+ /**
+ * Standard ore generation helper. Generates Lapis Lazuli.
+ */
+ protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) {
+ for (int l = 0; l < p_76793_1_; ++l) {
+ int i1 = this.chunk_X + this.randomGenerator.nextInt(16);
+ int j1 = this.randomGenerator.nextInt(p_76793_4_)
+ + this.randomGenerator.nextInt(p_76793_4_)
+ + (p_76793_3_ - p_76793_4_);
+ int k1 = this.chunk_Z + this.randomGenerator.nextInt(16);
+ p_76793_2_.generate(this.currentWorld, this.randomGenerator, i1, j1, k1);
+ }
+ }
+
+ /**
+ * Generates ores in the current chunk
+ */
+ protected void generateOres() {
+ MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
+ if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT))
+ this.genStandardOre1(20, this.dirtGen, 0, 256);
+ if (TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen, chunk_X, chunk_Z, GRAVEL))
+ this.genStandardOre1(10, this.gravelGen, 0, 256);
+ if (TerrainGen.generateOre(currentWorld, randomGenerator, coalGen, chunk_X, chunk_Z, COAL))
+ this.genStandardOre1(20, this.coalGen, 0, 128);
+ if (TerrainGen.generateOre(currentWorld, randomGenerator, ironGen, chunk_X, chunk_Z, IRON))
+ this.genStandardOre1(10, this.ironGen, 0, 64);
+ if (TerrainGen.generateOre(currentWorld, randomGenerator, goldGen, chunk_X, chunk_Z, GOLD))
+ this.genStandardOre1(15, this.goldGen, 0, 32);
+ if (TerrainGen.generateOre(currentWorld, randomGenerator, redstoneGen, chunk_X, chunk_Z, REDSTONE))
+ this.genStandardOre1(10, this.redstoneGen, 0, 16);
+ if (TerrainGen.generateOre(currentWorld, randomGenerator, diamondGen, chunk_X, chunk_Z, DIAMOND))
+ this.genStandardOre1(1, this.diamondGen, 0, 16);
+ if (TerrainGen.generateOre(currentWorld, randomGenerator, lapisGen, chunk_X, chunk_Z, LAPIS))
+ this.genStandardOre2(10, this.lapisGen, 16, 16);
+ MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
+ }
+
+ private int nextInt(int i) {
+ if (i <= 1) return 0;
+ return this.randomGenerator.nextInt(i);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/biome/GenLayerAustralia.java b/src/main/java/gtPlusPlus/australia/biome/GenLayerAustralia.java
index d9c328d756..598c402c60 100644
--- a/src/main/java/gtPlusPlus/australia/biome/GenLayerAustralia.java
+++ b/src/main/java/gtPlusPlus/australia/biome/GenLayerAustralia.java
@@ -7,26 +7,26 @@ import net.minecraft.world.gen.layer.GenLayerZoom;
public class GenLayerAustralia extends GenLayer {
- public GenLayerAustralia(long seed) {
- super(seed);
- }
+ public GenLayerAustralia(long seed) {
+ super(seed);
+ }
- public static GenLayer[] makeTheWorld(long seed, WorldType type) {
- GenLayer biomes = new GenLayerBiomesAustraliaDimension(1L);
- biomes = new GenLayerZoom(1000L, biomes);
- biomes = new GenLayerZoom(1001L, biomes);
- biomes = new GenLayerZoom(1002L, biomes);
- biomes = new GenLayerZoom(1003L, biomes);
- biomes = new GenLayerZoom(1004L, biomes);
- biomes = new GenLayerZoom(1005L, biomes);
- GenLayer genlayervoronoizoom = new GenLayerVoronoiZoom(10L, biomes);
- biomes.initWorldGenSeed(seed);
- genlayervoronoizoom.initWorldGenSeed(seed);
- return new GenLayer[] { biomes, genlayervoronoizoom };
- }
+ public static GenLayer[] makeTheWorld(long seed, WorldType type) {
+ GenLayer biomes = new GenLayerBiomesAustraliaDimension(1L);
+ biomes = new GenLayerZoom(1000L, biomes);
+ biomes = new GenLayerZoom(1001L, biomes);
+ biomes = new GenLayerZoom(1002L, biomes);
+ biomes = new GenLayerZoom(1003L, biomes);
+ biomes = new GenLayerZoom(1004L, biomes);
+ biomes = new GenLayerZoom(1005L, biomes);
+ GenLayer genlayervoronoizoom = new GenLayerVoronoiZoom(10L, biomes);
+ biomes.initWorldGenSeed(seed);
+ genlayervoronoizoom.initWorldGenSeed(seed);
+ return new GenLayer[] {biomes, genlayervoronoizoom};
+ }
- @Override
- public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) {
- return new int[] {};
- }
-} \ No newline at end of file
+ @Override
+ public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) {
+ return new int[] {};
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/biome/GenLayerBiomesAustraliaDimension.java b/src/main/java/gtPlusPlus/australia/biome/GenLayerBiomesAustraliaDimension.java
index 571ae636e0..8a1f99239f 100644
--- a/src/main/java/gtPlusPlus/australia/biome/GenLayerBiomesAustraliaDimension.java
+++ b/src/main/java/gtPlusPlus/australia/biome/GenLayerBiomesAustraliaDimension.java
@@ -11,37 +11,36 @@ import net.minecraft.world.gen.layer.IntCache;
public class GenLayerBiomesAustraliaDimension extends GenLayer {
- protected BiomeGenBase[] allowedBiomes = {
- Biome_AustralianDesert_Ex.biome,
- Biome_AustralianDesert_Ex.biome,
- Biome_AustralianOutback.biome,
- Biome_AustralianOutback.biome,
- Biome_AustralianForest.biome,
- Biome_AustralianForest.biome,
- Biome_AustralianPlains.biome,
- Biome_AustralianPlains.biome,
- Biome_AustralianOcean.biome,
- };
+ protected BiomeGenBase[] allowedBiomes = {
+ Biome_AustralianDesert_Ex.biome,
+ Biome_AustralianDesert_Ex.biome,
+ Biome_AustralianOutback.biome,
+ Biome_AustralianOutback.biome,
+ Biome_AustralianForest.biome,
+ Biome_AustralianForest.biome,
+ Biome_AustralianPlains.biome,
+ Biome_AustralianPlains.biome,
+ Biome_AustralianOcean.biome,
+ };
- public GenLayerBiomesAustraliaDimension(long seed) {
- super(seed);
- }
+ public GenLayerBiomesAustraliaDimension(long seed) {
+ super(seed);
+ }
- public GenLayerBiomesAustraliaDimension(long seed, GenLayer genlayer) {
- super(seed);
- this.parent = genlayer;
- }
+ public GenLayerBiomesAustraliaDimension(long seed, GenLayer genlayer) {
+ super(seed);
+ this.parent = genlayer;
+ }
- @Override
- public int[] getInts(int x, int z, int width, int depth) {
- int[] dest = IntCache.getIntCache(width * depth);
- for (int dz = 0; dz < depth; dz++) {
- for (int dx = 0; dx < width; dx++) {
- this.initChunkSeed(dx + x, dz + z);
- dest[(dx + dz * width)] = this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
- }
- }
- return dest;
- }
-
-} \ No newline at end of file
+ @Override
+ public int[] getInts(int x, int z, int width, int depth) {
+ int[] dest = IntCache.getIntCache(width * depth);
+ for (int dz = 0; dz < depth; dz++) {
+ for (int dx = 0; dx < width; dx++) {
+ this.initChunkSeed(dx + x, dz + z);
+ dest[(dx + dz * width)] = this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
+ }
+ }
+ return dest;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java
index 666360f058..585aafe308 100644
--- a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java
+++ b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java
@@ -1,8 +1,5 @@
package gtPlusPlus.australia.biome.type;
-import java.lang.reflect.Field;
-import java.util.Random;
-
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.relauncher.Side;
@@ -10,6 +7,8 @@ import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySilverfish;
@@ -35,321 +34,318 @@ import net.minecraftforge.common.BiomeManager;
public class Biome_AustralianDesert {
+ public Object instance;
- public Object instance;
-
- public static Block blockTopLayer;
- public static Block blockSecondLayer;
- public static Block blockMainFiller = Blocks.stone;
- public static Block blockSecondaryFiller;
- public static Block blockFluidLakes;
+ public static Block blockTopLayer;
+ public static Block blockSecondLayer;
+ public static Block blockMainFiller = Blocks.stone;
+ public static Block blockSecondaryFiller;
+ public static Block blockFluidLakes;
- public Biome_AustralianDesert() {
-
- }
+ public Biome_AustralianDesert() {}
- public static BiomeGenAustralianDesert biome = new BiomeGenAustralianDesert();
- public void load() {
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.HOT);
- BiomeManager.addSpawnBiome(biome);
- }
+ public static BiomeGenAustralianDesert biome = new BiomeGenAustralianDesert();
- public void generateNether(World world, Random random, int chunkX, int chunkZ) {
- }
+ public void load() {
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.HOT);
+ BiomeManager.addSpawnBiome(biome);
+ }
- public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
- }
+ public void generateNether(World world, Random random, int chunkX, int chunkZ) {}
- public void registerRenderers() {
- }
+ public void generateSurface(World world, Random random, int chunkX, int chunkZ) {}
- public int addFuel(ItemStack fuel) {
- return 0;
- }
+ public void registerRenderers() {}
- public void serverLoad(FMLServerStartingEvent event) {
- }
+ public int addFuel(ItemStack fuel) {
+ return 0;
+ }
- public void preInit(FMLPreInitializationEvent event) {
- }
+ public void serverLoad(FMLServerStartingEvent event) {}
- static class BiomeGenAustralianDesert extends BiomeGenBase {
- @SuppressWarnings("unchecked")
- public BiomeGenAustralianDesert() {
- super(CORE.AUSTRALIA_BIOME_DESERT_1_ID);
- this.setBiomeName("Australian Desert");
- //this.setBiomeID();
- this.enableRain = true;
- this.enableSnow = false;
- this.topBlock = blockTopLayer;
- this.fillerBlock = blockSecondLayer;
- //this.theBiomeDecorator = new BiomeGenerator_Custom();
- this.theBiomeDecorator.generateLakes = true;
- this.theBiomeDecorator.treesPerChunk = 20;
- this.theBiomeDecorator.flowersPerChunk = 0;
- this.theBiomeDecorator.grassPerChunk = 5;
- this.theBiomeDecorator.deadBushPerChunk = 63;
- this.theBiomeDecorator.mushroomsPerChunk = 0;
- this.theBiomeDecorator.reedsPerChunk = 42;
- this.theBiomeDecorator.cactiPerChunk = 56;
- this.theBiomeDecorator.sandPerChunk = 84;
- this.rainfall = 0.1F;
- this.waterColorMultiplier = 13434879;
- setHeight(new BiomeGenBase.Height(0.15F, 0.45F));
- this.rootHeight = -0.25f; //Ground level
+ public void preInit(FMLPreInitializationEvent event) {}
- this.spawnableMonsterList.clear();
- this.spawnableCreatureList.clear();
- this.spawnableWaterCreatureList.clear();
- this.spawnableCaveCreatureList.clear();
+ static class BiomeGenAustralianDesert extends BiomeGenBase {
+ @SuppressWarnings("unchecked")
+ public BiomeGenAustralianDesert() {
+ super(CORE.AUSTRALIA_BIOME_DESERT_1_ID);
+ this.setBiomeName("Australian Desert");
+ // this.setBiomeID();
+ this.enableRain = true;
+ this.enableSnow = false;
+ this.topBlock = blockTopLayer;
+ this.fillerBlock = blockSecondLayer;
+ // this.theBiomeDecorator = new BiomeGenerator_Custom();
+ this.theBiomeDecorator.generateLakes = true;
+ this.theBiomeDecorator.treesPerChunk = 20;
+ this.theBiomeDecorator.flowersPerChunk = 0;
+ this.theBiomeDecorator.grassPerChunk = 5;
+ this.theBiomeDecorator.deadBushPerChunk = 63;
+ this.theBiomeDecorator.mushroomsPerChunk = 0;
+ this.theBiomeDecorator.reedsPerChunk = 42;
+ this.theBiomeDecorator.cactiPerChunk = 56;
+ this.theBiomeDecorator.sandPerChunk = 84;
+ this.rainfall = 0.1F;
+ this.waterColorMultiplier = 13434879;
+ setHeight(new BiomeGenBase.Height(0.15F, 0.45F));
+ this.rootHeight = -0.25f; // Ground level
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySilverfish.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 5, 1, 5));
-
- this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 5, 1, 5));
+ this.spawnableMonsterList.clear();
+ this.spawnableCreatureList.clear();
+ this.spawnableWaterCreatureList.clear();
+ this.spawnableCaveCreatureList.clear();
- }
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySilverfish.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 5, 1, 5));
- private synchronized boolean setBiomeID() {
- try {
- Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList");
- Field mClone = mInternalBiomeList;
- BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null);
- BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length];
- for (int index=0;index<mTempList.length;index++) {
- mTempList[index] = mOriginalList[index];
- }
- if (mTempList != null){
- mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this;
- mInternalBiomeList.set(null, mTempList);
- if (mTempList != mInternalBiomeList.get(null)){
- ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList);
- Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
- return true;
- }
- else {
- Logger.REFLECTION("Failed to set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
- }
- }
- return false;
- }
- catch (Exception e) {
- Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+".");
- e.printStackTrace();
- return false;
- }
- }
+ this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 5, 1, 5));
+ }
- @SideOnly(Side.CLIENT)
- public int getBiomeGrassColor() {
- return 6697728;
- }
+ private synchronized boolean setBiomeID() {
+ try {
+ Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList");
+ Field mClone = mInternalBiomeList;
+ BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null);
+ BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length];
+ for (int index = 0; index < mTempList.length; index++) {
+ mTempList[index] = mOriginalList[index];
+ }
+ if (mTempList != null) {
+ mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this;
+ mInternalBiomeList.set(null, mTempList);
+ if (mTempList != mInternalBiomeList.get(null)) {
+ ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList);
+ Logger.REFLECTION(
+ "Set Biome ID for " + this.biomeName + " Biome internally in 'biomeList' field from "
+ + BiomeGenBase.class.getCanonicalName() + ".");
+ return true;
+ } else {
+ Logger.REFLECTION("Failed to set Biome ID for " + this.biomeName
+ + " Biome internally in 'biomeList' field from " + BiomeGenBase.class.getCanonicalName()
+ + ".");
+ }
+ }
+ return false;
+ } catch (Exception e) {
+ Logger.REFLECTION(
+ "Could not access 'biomeList' field in " + BiomeGenBase.class.getCanonicalName() + ".");
+ e.printStackTrace();
+ return false;
+ }
+ }
- @SideOnly(Side.CLIENT)
- public int getBiomeFoliageColor() {
- return 6697728;
- }
+ @SideOnly(Side.CLIENT)
+ public int getBiomeGrassColor() {
+ return 6697728;
+ }
- @SideOnly(Side.CLIENT)
- public int getSkyColorByTemp(float par1) {
- return 13421772;
- }
+ @SideOnly(Side.CLIENT)
+ public int getBiomeFoliageColor() {
+ return 6697728;
+ }
- @SuppressWarnings({ "unchecked", "unused" })
- private boolean addToMonsterSpawnLists(Class<?> EntityClass, int a, int b, int c){
- //this.spawnableMonsterList.add(new SpawnListEntry(EntityClass, a, b, c));
- this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c));
- return true;
- }
-
- @Override
- public WorldGenAbstractTree func_150567_a(Random par1Random){
- return (WorldGenAbstractTree)(getRandomWorldGenForTrees(par1Random));
- }
-
+ @SideOnly(Side.CLIENT)
+ public int getSkyColorByTemp(float par1) {
+ return 13421772;
+ }
- //TODO - DOES THIS WORK?
- public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
- {
- return new Tree();
- }
+ @SuppressWarnings({"unchecked", "unused"})
+ private boolean addToMonsterSpawnLists(Class<?> EntityClass, int a, int b, int c) {
+ // this.spawnableMonsterList.add(new SpawnListEntry(EntityClass, a, b, c));
+ this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c));
+ return true;
+ }
- class Tree
- extends WorldGenAbstractTree
- {
- private final int minTreeHeight;
- private final boolean vinesGrow;
- private final int metaWood;
- private final int metaLeaves;
+ @Override
+ public WorldGenAbstractTree func_150567_a(Random par1Random) {
+ return (WorldGenAbstractTree) (getRandomWorldGenForTrees(par1Random));
+ }
- public Tree()
- {
- super(false);
- this.minTreeHeight = 5;
- this.metaWood = 0;
- this.metaLeaves = 0;
- this.vinesGrow = false;
- }
+ // TODO - DOES THIS WORK?
+ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) {
+ return new Tree();
+ }
- public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
- {
- int var6 = par2Random.nextInt(3) + this.minTreeHeight;
- boolean var7 = true;
- if ((par4 >= 1) && (par4 + var6 + 1 <= 256))
- {
- for (int var8 = par4; var8 <= par4 + 1 + var6; var8++)
- {
- byte var9 = 1;
- if (var8 == par4) {
- var9 = 0;
- }
- if (var8 >= par4 + 1 + var6 - 2) {
- var9 = 2;
- }
- for (int var10 = par3 - var9; (var10 <= par3 + var9) && (var7); var10++) {
- for (int var11 = par5 - var9; (var11 <= par5 + var9) && (var7); var11++) {
- if ((var8 >= 0) && (var8 < 256))
- {
- Block var12s = par1World.getBlock(var10, var8, var11);
- int var12 = Block.getIdFromBlock(var12s);
- if ((var12 != 0) && (var12s != Blocks.air) && (var12s != Blocks.grass) && (var12s != Blocks.dirt) && (var12s != Blocks.cactus)) {
- var7 = false;
- }
- }
- else
- {
- var7 = false;
- }
- }
- }
- }
- if (!var7) {
- return false;
- }
- Block var8s = par1World.getBlock(par3, par4 - 1, par5);
- int var8 = Block.getIdFromBlock(var8s);
- if (((var8s == Blocks.grass) || (var8s == Blocks.dirt)) && (par4 < 256 - var6 - 1))
- {
- par1World.setBlock(par3, par4 - 1, par5, Blocks.dirt, 0, 2);
- byte var9 = 3;
- byte var18 = 0;
- for (int var11 = par4 - var9 + var6; var11 <= par4 + var6; var11++)
- {
- int var12 = var11 - (par4 + var6);
- int var13 = var18 + 1 - var12 / 2;
- for (int var14 = par3 - var13; var14 <= par3 + var13; var14++)
- {
- int var15 = var14 - par3;
- for (int var16 = par5 - var13; var16 <= par5 + var13; var16++)
- {
- int var17 = var16 - par5;
- if ((Math.abs(var15) != var13) || (Math.abs(var17) != var13) || ((par2Random.nextInt(2) != 0) && (var12 != 0))) {
- par1World.setBlock(var14, var11, var16, Blocks.air, this.metaLeaves, 2);
- }
- }
- }
- }
- for (int var11 = 0; var11 < var6; var11++)
- {
- Block var12s = par1World.getBlock(par3, par4 + var11, par5);
- int var12 = Block.getIdFromBlock(var12s);
- if ((var12 == 0) || (var12s == Blocks.air))
- {
- par1World.setBlock(par3, par4 + var11, par5, Blocks.cactus, this.metaWood, 2);
- if ((this.vinesGrow) && (var11 > 0))
- {
- if ((par2Random.nextInt(3) > 0) && (par1World.isAirBlock(par3 - 1, par4 + var11, par5))) {
- par1World.setBlock(par3 - 1, par4 + var11, par5, Blocks.air, 8, 2);
- }
- if ((par2Random.nextInt(3) > 0) && (par1World.isAirBlock(par3 + 1, par4 + var11, par5))) {
- par1World.setBlock(par3 + 1, par4 + var11, par5, Blocks.air, 2, 2);
- }
- if ((par2Random.nextInt(3) > 0) && (par1World.isAirBlock(par3, par4 + var11, par5 - 1))) {
- par1World.setBlock(par3, par4 + var11, par5 - 1, Blocks.air, 1, 2);
- }
- if ((par2Random.nextInt(3) > 0) && (par1World.isAirBlock(par3, par4 + var11, par5 + 1))) {
- par1World.setBlock(par3, par4 + var11, par5 + 1, Blocks.air, 4, 2);
- }
- }
- }
- }
- if (this.vinesGrow)
- {
- for (int var11 = par4 - 3 + var6; var11 <= par4 + var6; var11++)
- {
- int var12 = var11 - (par4 + var6);
- int var13 = 2 - var12 / 2;
- for (int var14 = par3 - var13; var14 <= par3 + var13; var14++) {
- for (int var15 = par5 - var13; var15 <= par5 + var13; var15++) {
- if (par1World.getBlock(var14, var11, var15) == Blocks.air)
- {
- if ((par2Random.nextInt(4) == 0) &&
- (Block.getIdFromBlock(par1World.getBlock(var14 - 1, var11, var15)) == 0)) {
- growVines(par1World, var14 - 1, var11, var15, 8);
- }
- if ((par2Random.nextInt(4) == 0) &&
- (Block.getIdFromBlock(par1World.getBlock(var14 + 1, var11, var15)) == 0)) {
- growVines(par1World, var14 + 1, var11, var15, 2);
- }
- if ((par2Random.nextInt(4) == 0) &&
- (Block.getIdFromBlock(par1World.getBlock(var14, var11, var15 - 1)) == 0)) {
- growVines(par1World, var14, var11, var15 - 1, 1);
- }
- if ((par2Random.nextInt(4) == 0) &&
- (Block.getIdFromBlock(par1World.getBlock(var14, var11, var15 + 1)) == 0)) {
- growVines(par1World, var14, var11, var15 + 1, 4);
- }
- }
- }
- }
- }
- if ((par2Random.nextInt(5) == 0) && (var6 > 5)) {
- for (int var11 = 0; var11 < 2; var11++) {
- for (int var12 = 0; var12 < 4; var12++) {
- if (par2Random.nextInt(4 - var11) == 0)
- {
- int var13 = par2Random.nextInt(3);
- par1World.setBlock(par3 + net.minecraft.util.Direction.offsetX[net.minecraft.util.Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + net.minecraft.util.Direction.offsetZ[net.minecraft.util.Direction.rotateOpposite[var12]], Blocks.air, var13 << 2 | var12, 2);
- }
- }
- }
- }
- }
- return true;
- }
- return false;
- }
- return false;
- }
+ class Tree extends WorldGenAbstractTree {
+ private final int minTreeHeight;
+ private final boolean vinesGrow;
+ private final int metaWood;
+ private final int metaLeaves;
- private void growVines(World par1World, int par2, int par3, int par4, int par5)
- {
- par1World.setBlock(par2, par3, par4, Blocks.vine, par5, 2);
- int var6 = 4;
- for (;;)
- {
- par3--;
- if ((Block.getIdFromBlock(par1World.getBlock(par2, par3, par4)) != 0) || (var6 <= 0)) {
- return;
- }
- par1World.setBlock(par2, par3, par4, Blocks.air, par5, 2);
- var6--;
- }
- }
- }
+ public Tree() {
+ super(false);
+ this.minTreeHeight = 5;
+ this.metaWood = 0;
+ this.metaLeaves = 0;
+ this.vinesGrow = false;
+ }
- }
+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
+ int var6 = par2Random.nextInt(3) + this.minTreeHeight;
+ boolean var7 = true;
+ if ((par4 >= 1) && (par4 + var6 + 1 <= 256)) {
+ for (int var8 = par4; var8 <= par4 + 1 + var6; var8++) {
+ byte var9 = 1;
+ if (var8 == par4) {
+ var9 = 0;
+ }
+ if (var8 >= par4 + 1 + var6 - 2) {
+ var9 = 2;
+ }
+ for (int var10 = par3 - var9; (var10 <= par3 + var9) && (var7); var10++) {
+ for (int var11 = par5 - var9; (var11 <= par5 + var9) && (var7); var11++) {
+ if ((var8 >= 0) && (var8 < 256)) {
+ Block var12s = par1World.getBlock(var10, var8, var11);
+ int var12 = Block.getIdFromBlock(var12s);
+ if ((var12 != 0)
+ && (var12s != Blocks.air)
+ && (var12s != Blocks.grass)
+ && (var12s != Blocks.dirt)
+ && (var12s != Blocks.cactus)) {
+ var7 = false;
+ }
+ } else {
+ var7 = false;
+ }
+ }
+ }
+ }
+ if (!var7) {
+ return false;
+ }
+ Block var8s = par1World.getBlock(par3, par4 - 1, par5);
+ int var8 = Block.getIdFromBlock(var8s);
+ if (((var8s == Blocks.grass) || (var8s == Blocks.dirt)) && (par4 < 256 - var6 - 1)) {
+ par1World.setBlock(par3, par4 - 1, par5, Blocks.dirt, 0, 2);
+ byte var9 = 3;
+ byte var18 = 0;
+ for (int var11 = par4 - var9 + var6; var11 <= par4 + var6; var11++) {
+ int var12 = var11 - (par4 + var6);
+ int var13 = var18 + 1 - var12 / 2;
+ for (int var14 = par3 - var13; var14 <= par3 + var13; var14++) {
+ int var15 = var14 - par3;
+ for (int var16 = par5 - var13; var16 <= par5 + var13; var16++) {
+ int var17 = var16 - par5;
+ if ((Math.abs(var15) != var13)
+ || (Math.abs(var17) != var13)
+ || ((par2Random.nextInt(2) != 0) && (var12 != 0))) {
+ par1World.setBlock(var14, var11, var16, Blocks.air, this.metaLeaves, 2);
+ }
+ }
+ }
+ }
+ for (int var11 = 0; var11 < var6; var11++) {
+ Block var12s = par1World.getBlock(par3, par4 + var11, par5);
+ int var12 = Block.getIdFromBlock(var12s);
+ if ((var12 == 0) || (var12s == Blocks.air)) {
+ par1World.setBlock(par3, par4 + var11, par5, Blocks.cactus, this.metaWood, 2);
+ if ((this.vinesGrow) && (var11 > 0)) {
+ if ((par2Random.nextInt(3) > 0)
+ && (par1World.isAirBlock(par3 - 1, par4 + var11, par5))) {
+ par1World.setBlock(par3 - 1, par4 + var11, par5, Blocks.air, 8, 2);
+ }
+ if ((par2Random.nextInt(3) > 0)
+ && (par1World.isAirBlock(par3 + 1, par4 + var11, par5))) {
+ par1World.setBlock(par3 + 1, par4 + var11, par5, Blocks.air, 2, 2);
+ }
+ if ((par2Random.nextInt(3) > 0)
+ && (par1World.isAirBlock(par3, par4 + var11, par5 - 1))) {
+ par1World.setBlock(par3, par4 + var11, par5 - 1, Blocks.air, 1, 2);
+ }
+ if ((par2Random.nextInt(3) > 0)
+ && (par1World.isAirBlock(par3, par4 + var11, par5 + 1))) {
+ par1World.setBlock(par3, par4 + var11, par5 + 1, Blocks.air, 4, 2);
+ }
+ }
+ }
+ }
+ if (this.vinesGrow) {
+ for (int var11 = par4 - 3 + var6; var11 <= par4 + var6; var11++) {
+ int var12 = var11 - (par4 + var6);
+ int var13 = 2 - var12 / 2;
+ for (int var14 = par3 - var13; var14 <= par3 + var13; var14++) {
+ for (int var15 = par5 - var13; var15 <= par5 + var13; var15++) {
+ if (par1World.getBlock(var14, var11, var15) == Blocks.air) {
+ if ((par2Random.nextInt(4) == 0)
+ && (Block.getIdFromBlock(
+ par1World.getBlock(var14 - 1, var11, var15))
+ == 0)) {
+ growVines(par1World, var14 - 1, var11, var15, 8);
+ }
+ if ((par2Random.nextInt(4) == 0)
+ && (Block.getIdFromBlock(
+ par1World.getBlock(var14 + 1, var11, var15))
+ == 0)) {
+ growVines(par1World, var14 + 1, var11, var15, 2);
+ }
+ if ((par2Random.nextInt(4) == 0)
+ && (Block.getIdFromBlock(
+ par1World.getBlock(var14, var11, var15 - 1))
+ == 0)) {
+ growVines(par1World, var14, var11, var15 - 1, 1);
+ }
+ if ((par2Random.nextInt(4) == 0)
+ && (Block.getIdFromBlock(
+ par1World.getBlock(var14, var11, var15 + 1))
+ == 0)) {
+ growVines(par1World, var14, var11, var15 + 1, 4);
+ }
+ }
+ }
+ }
+ }
+ if ((par2Random.nextInt(5) == 0) && (var6 > 5)) {
+ for (int var11 = 0; var11 < 2; var11++) {
+ for (int var12 = 0; var12 < 4; var12++) {
+ if (par2Random.nextInt(4 - var11) == 0) {
+ int var13 = par2Random.nextInt(3);
+ par1World.setBlock(
+ par3
+ + net.minecraft.util.Direction.offsetX[
+ net.minecraft.util.Direction.rotateOpposite[var12]],
+ par4 + var6 - 5 + var11,
+ par5
+ + net.minecraft.util.Direction.offsetZ[
+ net.minecraft.util.Direction.rotateOpposite[var12]],
+ Blocks.air,
+ var13 << 2 | var12,
+ 2);
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+ return false;
+ }
+ private void growVines(World par1World, int par2, int par3, int par4, int par5) {
+ par1World.setBlock(par2, par3, par4, Blocks.vine, par5, 2);
+ int var6 = 4;
+ for (; ; ) {
+ par3--;
+ if ((Block.getIdFromBlock(par1World.getBlock(par2, par3, par4)) != 0) || (var6 <= 0)) {
+ return;
+ }
+ par1World.setBlock(par2, par3, par4, Blocks.air, par5, 2);
+ var6--;
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java
index 2ac11bb412..4704b97be6 100644
--- a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java
+++ b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java
@@ -1,8 +1,5 @@
package gtPlusPlus.australia.biome.type;
-import java.lang.reflect.Field;
-import java.util.Random;
-
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.relauncher.Side;
@@ -11,6 +8,8 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySilverfish;
@@ -30,326 +29,324 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
-import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeManager;
public class Biome_AustralianDesert2 {
- public static BiomeGenAustralianDesert2 biome = new BiomeGenAustralianDesert2();
-
- public Object instance;
+ public static BiomeGenAustralianDesert2 biome = new BiomeGenAustralianDesert2();
- public static Block blockTopLayer;
- public static Block blockSecondLayer;
- public static Block blockMainFiller = Blocks.stone;
- public static Block blockSecondaryFiller;
- public static Block blockFluidLakes;
+ public Object instance;
- public Biome_AustralianDesert2() {
- }
+ public static Block blockTopLayer;
+ public static Block blockSecondLayer;
+ public static Block blockMainFiller = Blocks.stone;
+ public static Block blockSecondaryFiller;
+ public static Block blockFluidLakes;
- public void load() {
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.HOT);
- BiomeManager.addSpawnBiome(biome);
- }
+ public Biome_AustralianDesert2() {}
- public void generateNether(World world, Random random, int chunkX, int chunkZ) {
- }
+ public void load() {
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.HOT);
+ BiomeManager.addSpawnBiome(biome);
+ }
- public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
- }
+ public void generateNether(World world, Random random, int chunkX, int chunkZ) {}
- public void registerRenderers() {
- }
+ public void generateSurface(World world, Random random, int chunkX, int chunkZ) {}
- public int addFuel(ItemStack fuel) {
- return 0;
- }
+ public void registerRenderers() {}
- public void serverLoad(FMLServerStartingEvent event) {
- }
+ public int addFuel(ItemStack fuel) {
+ return 0;
+ }
- public void preInit(FMLPreInitializationEvent event) {
- }
+ public void serverLoad(FMLServerStartingEvent event) {}
- static class BiomeGenAustralianDesert2 extends BiomeGenBase {
- @SuppressWarnings("unchecked")
- public BiomeGenAustralianDesert2() {
- super(CORE.AUSTRALIA_BIOME_DESERT_2_ID);
- this.setBiomeName("Australian Desert II");
- //this.setBiomeID();
- this.enableRain = true;
- this.enableSnow = false;
- this.topBlock = blockTopLayer;
- this.fillerBlock = blockSecondLayer;
- //this.theBiomeDecorator = new BiomeGenerator_Custom();
- this.theBiomeDecorator.generateLakes = true;
- this.theBiomeDecorator.treesPerChunk = 40;
- this.theBiomeDecorator.flowersPerChunk = 0;
- this.theBiomeDecorator.grassPerChunk = 0;
- this.theBiomeDecorator.deadBushPerChunk = 63;
- this.theBiomeDecorator.mushroomsPerChunk = 0;
- this.theBiomeDecorator.reedsPerChunk = 42;
- this.theBiomeDecorator.cactiPerChunk = 84;
- this.theBiomeDecorator.sandPerChunk = 84;
- this.rainfall = 0.1F;
- this.waterColorMultiplier = 13434879;
- setHeight(new BiomeGenBase.Height(0.10F, 0.35F));
- this.rootHeight = -0.15f; //Ground level
+ public void preInit(FMLPreInitializationEvent event) {}
- this.spawnableMonsterList.clear();
- this.spawnableCreatureList.clear();
- this.spawnableWaterCreatureList.clear();
- this.spawnableCaveCreatureList.clear();
+ static class BiomeGenAustralianDesert2 extends BiomeGenBase {
+ @SuppressWarnings("unchecked")
+ public BiomeGenAustralianDesert2() {
+ super(CORE.AUSTRALIA_BIOME_DESERT_2_ID);
+ this.setBiomeName("Australian Desert II");
+ // this.setBiomeID();
+ this.enableRain = true;
+ this.enableSnow = false;
+ this.topBlock = blockTopLayer;
+ this.fillerBlock = blockSecondLayer;
+ // this.theBiomeDecorator = new BiomeGenerator_Custom();
+ this.theBiomeDecorator.generateLakes = true;
+ this.theBiomeDecorator.treesPerChunk = 40;
+ this.theBiomeDecorator.flowersPerChunk = 0;
+ this.theBiomeDecorator.grassPerChunk = 0;
+ this.theBiomeDecorator.deadBushPerChunk = 63;
+ this.theBiomeDecorator.mushroomsPerChunk = 0;
+ this.theBiomeDecorator.reedsPerChunk = 42;
+ this.theBiomeDecorator.cactiPerChunk = 84;
+ this.theBiomeDecorator.sandPerChunk = 84;
+ this.rainfall = 0.1F;
+ this.waterColorMultiplier = 13434879;
+ setHeight(new BiomeGenBase.Height(0.10F, 0.35F));
+ this.rootHeight = -0.15f; // Ground level
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySilverfish.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 1, 5));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 5, 1, 5));
-
- this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 5, 1, 5));
+ this.spawnableMonsterList.clear();
+ this.spawnableCreatureList.clear();
+ this.spawnableWaterCreatureList.clear();
+ this.spawnableCaveCreatureList.clear();
- }
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySilverfish.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 1, 5));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 5, 1, 5));
- private synchronized boolean setBiomeID() {
- try {
- Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList");
- Field mClone = mInternalBiomeList;
- BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null);
- BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length];
- for (int index=0;index<mTempList.length;index++) {
- mTempList[index] = mOriginalList[index];
- }
- if (mTempList != null){
- mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this;
- mInternalBiomeList.set(null, mTempList);
- if (mTempList != mInternalBiomeList.get(null)){
- ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList);
- Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
- return true;
- }
- else {
- Logger.REFLECTION("Failed to set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
- }
- }
- return false;
- }
- catch (Exception e) {
- Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+".");
- e.printStackTrace();
- return false;
- }
- }
+ this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 5, 1, 5));
+ }
- @SideOnly(Side.CLIENT)
- public int getBiomeGrassColor() {
- return 6697728;
- }
+ private synchronized boolean setBiomeID() {
+ try {
+ Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList");
+ Field mClone = mInternalBiomeList;
+ BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null);
+ BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length];
+ for (int index = 0; index < mTempList.length; index++) {
+ mTempList[index] = mOriginalList[index];
+ }
+ if (mTempList != null) {
+ mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this;
+ mInternalBiomeList.set(null, mTempList);
+ if (mTempList != mInternalBiomeList.get(null)) {
+ ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList);
+ Logger.REFLECTION(
+ "Set Biome ID for " + this.biomeName + " Biome internally in 'biomeList' field from "
+ + BiomeGenBase.class.getCanonicalName() + ".");
+ return true;
+ } else {
+ Logger.REFLECTION("Failed to set Biome ID for " + this.biomeName
+ + " Biome internally in 'biomeList' field from " + BiomeGenBase.class.getCanonicalName()
+ + ".");
+ }
+ }
+ return false;
+ } catch (Exception e) {
+ Logger.REFLECTION(
+ "Could not access 'biomeList' field in " + BiomeGenBase.class.getCanonicalName() + ".");
+ e.printStackTrace();
+ return false;
+ }
+ }
- @SideOnly(Side.CLIENT)
- public int getBiomeFoliageColor() {
- return 6697728;
- }
+ @SideOnly(Side.CLIENT)
+ public int getBiomeGrassColor() {
+ return 6697728;
+ }
- @SideOnly(Side.CLIENT)
- public int getSkyColorByTemp(float par1) {
- return 13421772;
- }
+ @SideOnly(Side.CLIENT)
+ public int getBiomeFoliageColor() {
+ return 6697728;
+ }
- @SuppressWarnings({ "unchecked", "unused" })
- private boolean addToMonsterSpawnLists(Class<?> EntityClass, int a, int b, int c){
- //this.spawnableMonsterList.add(new SpawnListEntry(EntityClass, a, b, c));
- this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c));
- return true;
- }
-
- @Override
- public WorldGenAbstractTree func_150567_a(Random par1Random){
- boolean a = (MathUtils.randInt(0, 100) < MathUtils.randInt(30, 65));
- return a ? getRandomWorldGenForTrees(par1Random) : super.func_150567_a(par1Random);
- }
+ @SideOnly(Side.CLIENT)
+ public int getSkyColorByTemp(float par1) {
+ return 13421772;
+ }
- //TODO - DOES THIS WORK?
- public WorldGenAbstractTree getRandomWorldGenForTrees(Random par1Random)
- {
- return new Tree();
- }
+ @SuppressWarnings({"unchecked", "unused"})
+ private boolean addToMonsterSpawnLists(Class<?> EntityClass, int a, int b, int c) {
+ // this.spawnableMonsterList.add(new SpawnListEntry(EntityClass, a, b, c));
+ this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c));
+ return true;
+ }
- class Tree
- extends WorldGenAbstractTree
- {
- private final int minTreeHeight;
- private final boolean vinesGrow;
- private final int metaWood;
- private final int metaLeaves;
+ @Override
+ public WorldGenAbstractTree func_150567_a(Random par1Random) {
+ boolean a = (MathUtils.randInt(0, 100) < MathUtils.randInt(30, 65));
+ return a ? getRandomWorldGenForTrees(par1Random) : super.func_150567_a(par1Random);
+ }
- public Tree()
- {
- super(false);
- this.minTreeHeight = 3;
- this.metaWood = 0;
- this.metaLeaves = 0;
- this.vinesGrow = false;
- }
+ // TODO - DOES THIS WORK?
+ public WorldGenAbstractTree getRandomWorldGenForTrees(Random par1Random) {
+ return new Tree();
+ }
- public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
- {
- int var6 = par2Random.nextInt(3) + this.minTreeHeight;
- boolean var7 = true;
- if ((par4 >= 1) && (par4 + var6 + 1 <= 256))
- {
- for (int var8 = par4; var8 <= par4 + 1 + var6; var8++)
- {
- byte var9 = 1;
- if (var8 == par4) {
- var9 = 0;
- }
- if (var8 >= par4 + 1 + var6 - 2) {
- var9 = 2;
- }
- for (int var10 = par3 - var9; (var10 <= par3 + var9) && (var7); var10++) {
- for (int var11 = par5 - var9; (var11 <= par5 + var9) && (var7); var11++) {
- if ((var8 >= 0) && (var8 < 256))
- {
- Block var12s = par1World.getBlock(var10, var8, var11);
- int var12 = Block.getIdFromBlock(var12s);
- if ((var12 != 0) && (var12s != Blocks.air) && (var12s != Blocks.grass) && (var12s != Blocks.dirt) && (var12s != Blocks.cactus)) {
- var7 = false;
- }
- }
- else
- {
- var7 = false;
- }
- }
- }
- }
- if (!var7) {
- return false;
- }
- Block var8s = par1World.getBlock(par3, par4 - 1, par5);
- int var8 = Block.getIdFromBlock(var8s);
- if (((var8s == Blocks.grass) || (var8s == Blocks.dirt)) && (par4 < 256 - var6 - 1))
- {
- par1World.setBlock(par3, par4 - 1, par5, Blocks.dirt, 0, 2);
- byte var9 = 3;
- byte var18 = 0;
- for (int var11 = par4 - var9 + var6; var11 <= par4 + var6; var11++)
- {
- int var12 = var11 - (par4 + var6);
- int var13 = var18 + 1 - var12 / 2;
- for (int var14 = par3 - var13; var14 <= par3 + var13; var14++)
- {
- int var15 = var14 - par3;
- for (int var16 = par5 - var13; var16 <= par5 + var13; var16++)
- {
- int var17 = var16 - par5;
- if ((Math.abs(var15) != var13) || (Math.abs(var17) != var13) || ((par2Random.nextInt(2) != 0) && (var12 != 0))) {
- par1World.setBlock(var14, var11, var16, Blocks.air, this.metaLeaves, 2);
- }
- }
- }
- }
- for (int var11 = 0; var11 < var6; var11++)
- {
- Block var12s = par1World.getBlock(par3, par4 + var11, par5);
- int var12 = Block.getIdFromBlock(var12s);
- if ((var12 == 0) || (var12s == Blocks.air))
- {
- par1World.setBlock(par3, par4 + var11, par5, Blocks.cactus, this.metaWood, 2);
- if ((this.vinesGrow) && (var11 > 0))
- {
- if ((par2Random.nextInt(3) > 0) && (par1World.isAirBlock(par3 - 1, par4 + var11, par5))) {
- par1World.setBlock(par3 - 1, par4 + var11, par5, Blocks.air, 8, 2);
- }
- if ((par2Random.nextInt(3) > 0) && (par1World.isAirBlock(par3 + 1, par4 + var11, par5))) {
- par1World.setBlock(par3 + 1, par4 + var11, par5, Blocks.air, 2, 2);
- }
- if ((par2Random.nextInt(3) > 0) && (par1World.isAirBlock(par3, par4 + var11, par5 - 1))) {
- par1World.setBlock(par3, par4 + var11, par5 - 1, Blocks.air, 1, 2);
- }
- if ((par2Random.nextInt(3) > 0) && (par1World.isAirBlock(par3, par4 + var11, par5 + 1))) {
- par1World.setBlock(par3, par4 + var11, par5 + 1, Blocks.air, 4, 2);
- }
- }
- }
- }
- if (this.vinesGrow)
- {
- for (int var11 = par4 - 3 + var6; var11 <= par4 + var6; var11++)
- {
- int var12 = var11 - (par4 + var6);
- int var13 = 2 - var12 / 2;
- for (int var14 = par3 - var13; var14 <= par3 + var13; var14++) {
- for (int var15 = par5 - var13; var15 <= par5 + var13; var15++) {
- if (par1World.getBlock(var14, var11, var15) == Blocks.air)
- {
- if ((par2Random.nextInt(4) == 0) &&
- (Block.getIdFromBlock(par1World.getBlock(var14 - 1, var11, var15)) == 0)) {
- growVines(par1World, var14 - 1, var11, var15, 8);
- }
- if ((par2Random.nextInt(4) == 0) &&
- (Block.getIdFromBlock(par1World.getBlock(var14 + 1, var11, var15)) == 0)) {
- growVines(par1World, var14 + 1, var11, var15, 2);
- }
- if ((par2Random.nextInt(4) == 0) &&
- (Block.getIdFromBlock(par1World.getBlock(var14, var11, var15 - 1)) == 0)) {
- growVines(par1World, var14, var11, var15 - 1, 1);
- }
- if ((par2Random.nextInt(4) == 0) &&
- (Block.getIdFromBlock(par1World.getBlock(var14, var11, var15 + 1)) == 0)) {
- growVines(par1World, var14, var11, var15 + 1, 4);
- }
- }
- }
- }
- }
- if ((par2Random.nextInt(5) == 0) && (var6 > 5)) {
- for (int var11 = 0; var11 < 2; var11++) {
- for (int var12 = 0; var12 < 4; var12++) {
- if (par2Random.nextInt(4 - var11) == 0)
- {
- int var13 = par2Random.nextInt(3);
- par1World.setBlock(par3 + net.minecraft.util.Direction.offsetX[net.minecraft.util.Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + net.minecraft.util.Direction.offsetZ[net.minecraft.util.Direction.rotateOpposite[var12]], Blocks.air, var13 << 2 | var12, 2);
- }
- }
- }
- }
- }
- return true;
- }
- return false;
- }
- return false;
- }
+ class Tree extends WorldGenAbstractTree {
+ private final int minTreeHeight;
+ private final boolean vinesGrow;
+ private final int metaWood;
+ private final int metaLeaves;
- private void growVines(World par1World, int par2, int par3, int par4, int par5)
- {
- par1World.setBlock(par2, par3, par4, Blocks.vine, par5, 2);
- int var6 = 4;
- for (;;)
- {
- par3--;
- if ((Block.getIdFromBlock(par1World.getBlock(par2, par3, par4)) != 0) || (var6 <= 0)) {
- return;
- }
- par1World.setBlock(par2, par3, par4, Blocks.air, par5, 2);
- var6--;
- }
- }
- }
+ public Tree() {
+ super(false);
+ this.minTreeHeight = 3;
+ this.metaWood = 0;
+ this.metaLeaves = 0;
+ this.vinesGrow = false;
+ }
- }
+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
+ int var6 = par2Random.nextInt(3) + this.minTreeHeight;
+ boolean var7 = true;
+ if ((par4 >= 1) && (par4 + var6 + 1 <= 256)) {
+ for (int var8 = par4; var8 <= par4 + 1 + var6; var8++) {
+ byte var9 = 1;
+ if (var8 == par4) {
+ var9 = 0;
+ }
+ if (var8 >= par4 + 1 + var6 - 2) {
+ var9 = 2;
+ }
+ for (int var10 = par3 - var9; (var10 <= par3 + var9) && (var7); var10++) {
+ for (int var11 = par5 - var9; (var11 <= par5 + var9) && (var7); var11++) {
+ if ((var8 >= 0) && (var8 < 256)) {
+ Block var12s = par1World.getBlock(var10, var8, var11);
+ int var12 = Block.getIdFromBlock(var12s);
+ if ((var12 != 0)
+ && (var12s != Blocks.air)
+ && (var12s != Blocks.grass)
+ && (var12s != Blocks.dirt)
+ && (var12s != Blocks.cactus)) {
+ var7 = false;
+ }
+ } else {
+ var7 = false;
+ }
+ }
+ }
+ }
+ if (!var7) {
+ return false;
+ }
+ Block var8s = par1World.getBlock(par3, par4 - 1, par5);
+ int var8 = Block.getIdFromBlock(var8s);
+ if (((var8s == Blocks.grass) || (var8s == Blocks.dirt)) && (par4 < 256 - var6 - 1)) {
+ par1World.setBlock(par3, par4 - 1, par5, Blocks.dirt, 0, 2);
+ byte var9 = 3;
+ byte var18 = 0;
+ for (int var11 = par4 - var9 + var6; var11 <= par4 + var6; var11++) {
+ int var12 = var11 - (par4 + var6);
+ int var13 = var18 + 1 - var12 / 2;
+ for (int var14 = par3 - var13; var14 <= par3 + var13; var14++) {
+ int var15 = var14 - par3;
+ for (int var16 = par5 - var13; var16 <= par5 + var13; var16++) {
+ int var17 = var16 - par5;
+ if ((Math.abs(var15) != var13)
+ || (Math.abs(var17) != var13)
+ || ((par2Random.nextInt(2) != 0) && (var12 != 0))) {
+ par1World.setBlock(var14, var11, var16, Blocks.air, this.metaLeaves, 2);
+ }
+ }
+ }
+ }
+ for (int var11 = 0; var11 < var6; var11++) {
+ Block var12s = par1World.getBlock(par3, par4 + var11, par5);
+ int var12 = Block.getIdFromBlock(var12s);
+ if ((var12 == 0) || (var12s == Blocks.air)) {
+ par1World.setBlock(par3, par4 + var11, par5, Blocks.cactus, this.metaWood, 2);
+ if ((this.vinesGrow) && (var11 > 0)) {
+ if ((par2Random.nextInt(3) > 0)
+ && (par1World.isAirBlock(par3 - 1, par4 + var11, par5))) {
+ par1World.setBlock(par3 - 1, par4 + var11, par5, Blocks.air, 8, 2);
+ }
+ if ((par2Random.nextInt(3) > 0)
+ && (par1World.isAirBlock(par3 + 1, par4 + var11, par5))) {
+ par1World.setBlock(par3 + 1, par4 + var11, par5, Blocks.air, 2, 2);
+ }
+ if ((par2Random.nextInt(3) > 0)
+ && (par1World.isAirBlock(par3, par4 + var11, par5 - 1))) {
+ par1World.setBlock(par3, par4 + var11, par5 - 1, Blocks.air, 1, 2);
+ }
+ if ((par2Random.nextInt(3) > 0)
+ && (par1World.isAirBlock(par3, par4 + var11, par5 + 1))) {
+ par1World.setBlock(par3, par4 + var11, par5 + 1, Blocks.air, 4, 2);
+ }
+ }
+ }
+ }
+ if (this.vinesGrow) {
+ for (int var11 = par4 - 3 + var6; var11 <= par4 + var6; var11++) {
+ int var12 = var11 - (par4 + var6);
+ int var13 = 2 - var12 / 2;
+ for (int var14 = par3 - var13; var14 <= par3 + var13; var14++) {
+ for (int var15 = par5 - var13; var15 <= par5 + var13; var15++) {
+ if (par1World.getBlock(var14, var11, var15) == Blocks.air) {
+ if ((par2Random.nextInt(4) == 0)
+ && (Block.getIdFromBlock(
+ par1World.getBlock(var14 - 1, var11, var15))
+ == 0)) {
+ growVines(par1World, var14 - 1, var11, var15, 8);
+ }
+ if ((par2Random.nextInt(4) == 0)
+ && (Block.getIdFromBlock(
+ par1World.getBlock(var14 + 1, var11, var15))
+ == 0)) {
+ growVines(par1World, var14 + 1, var11, var15, 2);
+ }
+ if ((par2Random.nextInt(4) == 0)
+ && (Block.getIdFromBlock(
+ par1World.getBlock(var14, var11, var15 - 1))
+ == 0)) {
+ growVines(par1World, var14, var11, var15 - 1, 1);
+ }
+ if ((par2Random.nextInt(4) == 0)
+ && (Block.getIdFromBlock(
+ par1World.getBlock(var14, var11, var15 + 1))
+ == 0)) {
+ growVines(par1World, var14, var11, var15 + 1, 4);
+ }
+ }
+ }
+ }
+ }
+ if ((par2Random.nextInt(5) == 0) && (var6 > 5)) {
+ for (int var11 = 0; var11 < 2; var11++) {
+ for (int var12 = 0; var12 < 4; var12++) {
+ if (par2Random.nextInt(4 - var11) == 0) {
+ int var13 = par2Random.nextInt(3);
+ par1World.setBlock(
+ par3
+ + net.minecraft.util.Direction.offsetX[
+ net.minecraft.util.Direction.rotateOpposite[var12]],
+ par4 + var6 - 5 + var11,
+ par5
+ + net.minecraft.util.Direction.offsetZ[
+ net.minecraft.util.Direction.rotateOpposite[var12]],
+ Blocks.air,
+ var13 << 2 | var12,
+ 2);
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+ return false;
+ }
+ private void growVines(World par1World, int par2, int par3, int par4, int par5) {
+ par1World.setBlock(par2, par3, par4, Blocks.vine, par5, 2);
+ int var6 = 4;
+ for (; ; ) {
+ par3--;
+ if ((Block.getIdFromBlock(par1World.getBlock(par2, par3, par4)) != 0) || (var6 <= 0)) {
+ return;
+ }
+ par1World.setBlock(par2, par3, par4, Blocks.air, par5, 2);
+ var6--;
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert_Ex.java b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert_Ex.java
index bfb0fb8631..476e990b3c 100644
--- a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert_Ex.java
+++ b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert_Ex.java
@@ -1,9 +1,8 @@
package gtPlusPlus.australia.biome.type;
-import java.util.Random;
-
import gtPlusPlus.australia.biome.CustomDecorator;
import gtPlusPlus.core.lib.CORE;
+import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeDecorator;
@@ -14,8 +13,7 @@ import net.minecraftforge.common.BiomeManager;
public class Biome_AustralianDesert_Ex extends BiomeGenDesert {
- public Biome_AustralianDesert_Ex(int aID)
- {
+ public Biome_AustralianDesert_Ex(int aID) {
super(aID);
this.spawnableCreatureList.clear();
this.topBlock = Blocks.sand;
@@ -23,30 +21,29 @@ public class Biome_AustralianDesert_Ex extends BiomeGenDesert {
this.theBiomeDecorator.treesPerChunk = -999;
this.theBiomeDecorator.deadBushPerChunk = 2;
this.theBiomeDecorator.reedsPerChunk = 50;
- this.theBiomeDecorator.cactiPerChunk = 20;
+ this.theBiomeDecorator.cactiPerChunk = 20;
this.setColor(16421912);
this.setBiomeName("Australian Desert III");
this.setDisableRain();
this.setTemperatureRainfall(2.0F, 0.0F);
- this.setHeight(height_LowPlains);
+ this.setHeight(height_LowPlains);
this.spawnableCreatureList.clear();
}
- public static Biome_AustralianDesert_Ex biome = new Biome_AustralianDesert_Ex(CORE.AUSTRALIA_BIOME_DESERT_3_ID);
- public void load() {
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.SPARSE);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.HOT);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
- BiomeManager.addSpawnBiome(biome);
- }
+ public static Biome_AustralianDesert_Ex biome = new Biome_AustralianDesert_Ex(CORE.AUSTRALIA_BIOME_DESERT_3_ID);
- public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_)
- {
+ public void load() {
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.SPARSE);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.HOT);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
+ BiomeManager.addSpawnBiome(biome);
+ }
+
+ public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) {
super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_);
- if (p_76728_2_.nextInt(850) == 0)
- {
+ if (p_76728_2_.nextInt(850) == 0) {
int k = p_76728_3_ + p_76728_2_.nextInt(16) + 8;
int l = p_76728_4_ + p_76728_2_.nextInt(16) + 8;
WorldGenDesertWells worldgendesertwells = new WorldGenDesertWells();
@@ -54,12 +51,11 @@ public class Biome_AustralianDesert_Ex extends BiomeGenDesert {
}
}
- /**
- * Allocate a new BiomeDecorator for this BiomeGenBase
- */
- @Override
- public BiomeDecorator createBiomeDecorator()
- {
- return getModdedBiomeDecorator(new CustomDecorator());
- }
-} \ No newline at end of file
+ /**
+ * Allocate a new BiomeDecorator for this BiomeGenBase
+ */
+ @Override
+ public BiomeDecorator createBiomeDecorator() {
+ return getModdedBiomeDecorator(new CustomDecorator());
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianForest.java b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianForest.java
index c00fd5edef..ed828ed09a 100644
--- a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianForest.java
+++ b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianForest.java
@@ -6,7 +6,6 @@ import gtPlusPlus.australia.biome.CustomDecorator;
import gtPlusPlus.australia.gen.world.WorldGenAustralianTrees;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
-
import java.util.Random;
import net.minecraft.block.BlockFlower;
import net.minecraft.entity.passive.EntityWolf;
@@ -24,175 +23,168 @@ import net.minecraftforge.common.BiomeManager;
public class Biome_AustralianForest extends BiomeGenForest {
- private int mWoodMeta;
- protected static final WorldGenForest mGenTreeForest = new WorldGenForest(false, true);
- protected static final WorldGenForest mGenTreeForest2 = new WorldGenForest(false, false);
- protected static final WorldGenCanopyTree mGenTreeCanopy = new WorldGenCanopyTree(false);
- protected static final WorldGenAustralianTrees mGenTreeAustralian = new WorldGenAustralianTrees(true);
-
- public static Biome_AustralianForest biome = new Biome_AustralianForest(CORE.AUSTRALIA_BIOME_FOREST_ID, 2);
-
- public void load() {
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.FOREST);
- BiomeManager.addSpawnBiome(biome);
- }
-
- public Biome_AustralianForest(int p_i45377_1_, int aWoodMeta) {
- super(p_i45377_1_, aWoodMeta);
- this.mWoodMeta = aWoodMeta;
- this.setColor(353825);
- this.setBiomeName("Australian Forest");
- this.setTemperatureRainfall(1.1F, 0.75F);
- this.theBiomeDecorator.treesPerChunk = 16;
- this.theBiomeDecorator.grassPerChunk = 5;
- this.theBiomeDecorator.flowersPerChunk = 2;
- this.func_76733_a(5159473);
- this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 4, 4));
- }
-
- public BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) {
- if (this.mWoodMeta == 2) {
- this.field_150609_ah = 353825;
- this.color = p_150557_1_;
-
- if (p_150557_2_) {
- this.field_150609_ah = (this.field_150609_ah & 16711422) >> 1;
- }
-
- return this;
- } else {
- return super.func_150557_a(p_150557_1_, p_150557_2_);
- }
- }
-
- public WorldGenAbstractTree func_150567_a(Random p_150567_1_) {
- int mTreeType = MathUtils.getRandomFromArray(new int[] {
- 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5
- });
- if (mTreeType == 0) {
- return mGenTreeCanopy;
- }
- else if (mTreeType == 1) {
- return mGenTreeAustralian;
- }
- else if (mTreeType == 2) {
- return mGenTreeForest;
- }
- else if (mTreeType == 3) {
- return mGenTreeForest2;
- }
- else if (mTreeType == 4) {
- return this.worldGeneratorSwamp;
- }
- else {
- return MathUtils.randInt(0, 1) == 0 ? this.worldGeneratorTrees : this.worldGeneratorBigTree;
- }
- }
-
- public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) {
- if (this.mWoodMeta == 1) {
- double d0 = MathHelper.clamp_double(
- (1.0D + plantNoise.func_151601_a((double) p_150572_2_ / 48.0D, (double) p_150572_4_ / 48.0D))
- / 2.0D,
- 0.0D, 0.9999D);
- int l = (int) (d0 * (double) BlockFlower.field_149859_a.length);
-
- if (l == 1) {
- l = 0;
- }
-
- return BlockFlower.field_149859_a[l];
- } else {
- return super.func_150572_a(p_150572_1_, p_150572_2_, p_150572_3_, p_150572_4_);
- }
- }
-
- public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) {
- int k;
- int l;
- int i1;
- int j1;
- int k1;
-
- if (this.mWoodMeta == 3) {
- for (k = 0; k < 4; ++k) {
- for (l = 0; l < 4; ++l) {
- i1 = p_76728_3_ + k * 4 + 1 + 8 + p_76728_2_.nextInt(3);
- j1 = p_76728_4_ + l * 4 + 1 + 8 + p_76728_2_.nextInt(3);
- k1 = p_76728_1_.getHeightValue(i1, j1);
-
- if (p_76728_2_.nextInt(20) == 0) {
- WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom();
- worldgenbigmushroom.generate(p_76728_1_, p_76728_2_, i1, k1, j1);
- } else {
- WorldGenAbstractTree worldgenabstracttree = this.func_150567_a(p_76728_2_);
- worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);
-
- if (worldgenabstracttree.generate(p_76728_1_, p_76728_2_, i1, k1, j1)) {
- worldgenabstracttree.func_150524_b(p_76728_1_, p_76728_2_, i1, k1, j1);
- }
- }
- }
- }
- }
-
- k = p_76728_2_.nextInt(5) - 3;
-
- if (this.mWoodMeta == 1) {
- k += 2;
- }
-
- l = 0;
-
- while (l < k) {
- i1 = p_76728_2_.nextInt(3);
-
- if (i1 == 0) {
- genTallFlowers.func_150548_a(1);
- } else if (i1 == 1) {
- genTallFlowers.func_150548_a(4);
- } else if (i1 == 2) {
- genTallFlowers.func_150548_a(5);
- }
-
- j1 = 0;
-
- while (true) {
- if (j1 < 5) {
- k1 = p_76728_3_ + p_76728_2_.nextInt(16) + 8;
- int i2 = p_76728_4_ + p_76728_2_.nextInt(16) + 8;
- int l1 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(k1, i2) + 32);
-
- if (!genTallFlowers.generate(p_76728_1_, p_76728_2_, k1, l1, i2)) {
- ++j1;
- continue;
- }
- }
-
- ++l;
- break;
- }
- }
-
- super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_);
- }
-
- /**
- * Provides the basic grass color based on the biome temperature and rainfall
- */
- @SideOnly(Side.CLIENT)
- public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) {
- int l = super.getBiomeGrassColor(p_150558_1_, p_150558_2_, p_150558_3_);
- return this.mWoodMeta == 3 ? (l & 16711422) + 2634762 >> 1 : l;
- }
-
- /**
- * Allocate a new BiomeDecorator for this BiomeGenBase
- */
- @Override
- public BiomeDecorator createBiomeDecorator()
- {
- return getModdedBiomeDecorator(new CustomDecorator());
- }
-
-} \ No newline at end of file
+ private int mWoodMeta;
+ protected static final WorldGenForest mGenTreeForest = new WorldGenForest(false, true);
+ protected static final WorldGenForest mGenTreeForest2 = new WorldGenForest(false, false);
+ protected static final WorldGenCanopyTree mGenTreeCanopy = new WorldGenCanopyTree(false);
+ protected static final WorldGenAustralianTrees mGenTreeAustralian = new WorldGenAustralianTrees(true);
+
+ public static Biome_AustralianForest biome = new Biome_AustralianForest(CORE.AUSTRALIA_BIOME_FOREST_ID, 2);
+
+ public void load() {
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.FOREST);
+ BiomeManager.addSpawnBiome(biome);
+ }
+
+ public Biome_AustralianForest(int p_i45377_1_, int aWoodMeta) {
+ super(p_i45377_1_, aWoodMeta);
+ this.mWoodMeta = aWoodMeta;
+ this.setColor(353825);
+ this.setBiomeName("Australian Forest");
+ this.setTemperatureRainfall(1.1F, 0.75F);
+ this.theBiomeDecorator.treesPerChunk = 16;
+ this.theBiomeDecorator.grassPerChunk = 5;
+ this.theBiomeDecorator.flowersPerChunk = 2;
+ this.func_76733_a(5159473);
+ this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 4, 4));
+ }
+
+ public BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) {
+ if (this.mWoodMeta == 2) {
+ this.field_150609_ah = 353825;
+ this.color = p_150557_1_;
+
+ if (p_150557_2_) {
+ this.field_150609_ah = (this.field_150609_ah & 16711422) >> 1;
+ }
+
+ return this;
+ } else {
+ return super.func_150557_a(p_150557_1_, p_150557_2_);
+ }
+ }
+
+ public WorldGenAbstractTree func_150567_a(Random p_150567_1_) {
+ int mTreeType = MathUtils.getRandomFromArray(
+ new int[] {0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5});
+ if (mTreeType == 0) {
+ return mGenTreeCanopy;
+ } else if (mTreeType == 1) {
+ return mGenTreeAustralian;
+ } else if (mTreeType == 2) {
+ return mGenTreeForest;
+ } else if (mTreeType == 3) {
+ return mGenTreeForest2;
+ } else if (mTreeType == 4) {
+ return this.worldGeneratorSwamp;
+ } else {
+ return MathUtils.randInt(0, 1) == 0 ? this.worldGeneratorTrees : this.worldGeneratorBigTree;
+ }
+ }
+
+ public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) {
+ if (this.mWoodMeta == 1) {
+ double d0 = MathHelper.clamp_double(
+ (1.0D + plantNoise.func_151601_a((double) p_150572_2_ / 48.0D, (double) p_150572_4_ / 48.0D))
+ / 2.0D,
+ 0.0D,
+ 0.9999D);
+ int l = (int) (d0 * (double) BlockFlower.field_149859_a.length);
+
+ if (l == 1) {
+ l = 0;
+ }
+
+ return BlockFlower.field_149859_a[l];
+ } else {
+ return super.func_150572_a(p_150572_1_, p_150572_2_, p_150572_3_, p_150572_4_);
+ }
+ }
+
+ public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) {
+ int k;
+ int l;
+ int i1;
+ int j1;
+ int k1;
+
+ if (this.mWoodMeta == 3) {
+ for (k = 0; k < 4; ++k) {
+ for (l = 0; l < 4; ++l) {
+ i1 = p_76728_3_ + k * 4 + 1 + 8 + p_76728_2_.nextInt(3);
+ j1 = p_76728_4_ + l * 4 + 1 + 8 + p_76728_2_.nextInt(3);
+ k1 = p_76728_1_.getHeightValue(i1, j1);
+
+ if (p_76728_2_.nextInt(20) == 0) {
+ WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom();
+ worldgenbigmushroom.generate(p_76728_1_, p_76728_2_, i1, k1, j1);
+ } else {
+ WorldGenAbstractTree worldgenabstracttree = this.func_150567_a(p_76728_2_);
+ worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);
+
+ if (worldgenabstracttree.generate(p_76728_1_, p_76728_2_, i1, k1, j1)) {
+ worldgenabstracttree.func_150524_b(p_76728_1_, p_76728_2_, i1, k1, j1);
+ }
+ }
+ }
+ }
+ }
+
+ k = p_76728_2_.nextInt(5) - 3;
+
+ if (this.mWoodMeta == 1) {
+ k += 2;
+ }
+
+ l = 0;
+
+ while (l < k) {
+ i1 = p_76728_2_.nextInt(3);
+
+ if (i1 == 0) {
+ genTallFlowers.func_150548_a(1);
+ } else if (i1 == 1) {
+ genTallFlowers.func_150548_a(4);
+ } else if (i1 == 2) {
+ genTallFlowers.func_150548_a(5);
+ }
+
+ j1 = 0;
+
+ while (true) {
+ if (j1 < 5) {
+ k1 = p_76728_3_ + p_76728_2_.nextInt(16) + 8;
+ int i2 = p_76728_4_ + p_76728_2_.nextInt(16) + 8;
+ int l1 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(k1, i2) + 32);
+
+ if (!genTallFlowers.generate(p_76728_1_, p_76728_2_, k1, l1, i2)) {
+ ++j1;
+ continue;
+ }
+ }
+
+ ++l;
+ break;
+ }
+ }
+
+ super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_);
+ }
+
+ /**
+ * Provides the basic grass color based on the biome temperature and rainfall
+ */
+ @SideOnly(Side.CLIENT)
+ public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) {
+ int l = super.getBiomeGrassColor(p_150558_1_, p_150558_2_, p_150558_3_);
+ return this.mWoodMeta == 3 ? (l & 16711422) + 2634762 >> 1 : l;
+ }
+
+ /**
+ * Allocate a new BiomeDecorator for this BiomeGenBase
+ */
+ @Override
+ public BiomeDecorator createBiomeDecorator() {
+ return getModdedBiomeDecorator(new CustomDecorator());
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOcean.java b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOcean.java
index ebfb455882..0cba0efab8 100644
--- a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOcean.java
+++ b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOcean.java
@@ -1,9 +1,8 @@
package gtPlusPlus.australia.biome.type;
-import java.util.Random;
-
import gtPlusPlus.australia.biome.CustomDecorator;
import gtPlusPlus.core.lib.CORE;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeDecorator;
@@ -14,8 +13,7 @@ import net.minecraftforge.common.BiomeManager;
public class Biome_AustralianOcean extends BiomeGenOcean {
- public Biome_AustralianOcean(int p_i1985_1_)
- {
+ public Biome_AustralianOcean(int p_i1985_1_) {
super(p_i1985_1_);
this.setColor(48);
this.setBiomeName("Australian Ocean");
@@ -23,30 +21,36 @@ public class Biome_AustralianOcean extends BiomeGenOcean {
this.spawnableCreatureList.clear();
}
- public static Biome_AustralianOcean biome = new Biome_AustralianOcean(CORE.AUSTRALIA_BIOME_OCEAN_ID);
- public void load() {
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.SPARSE);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.COLD);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.OCEAN);
- BiomeManager.addSpawnBiome(biome);
- }
+ public static Biome_AustralianOcean biome = new Biome_AustralianOcean(CORE.AUSTRALIA_BIOME_OCEAN_ID);
+
+ public void load() {
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.SPARSE);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.COLD);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.OCEAN);
+ BiomeManager.addSpawnBiome(biome);
+ }
- public BiomeGenBase.TempCategory getTempCategory()
- {
+ public BiomeGenBase.TempCategory getTempCategory() {
return BiomeGenBase.TempCategory.OCEAN;
}
- public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_)
- {
- super.genTerrainBlocks(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_);
+ public void genTerrainBlocks(
+ World p_150573_1_,
+ Random p_150573_2_,
+ Block[] p_150573_3_,
+ byte[] p_150573_4_,
+ int p_150573_5_,
+ int p_150573_6_,
+ double p_150573_7_) {
+ super.genTerrainBlocks(
+ p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_);
}
- /**
+ /**
* Allocate a new BiomeDecorator for this BiomeGenBase
*/
- @Override
- public BiomeDecorator createBiomeDecorator()
- {
+ @Override
+ public BiomeDecorator createBiomeDecorator() {
return getModdedBiomeDecorator(new CustomDecorator());
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOutback.java b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOutback.java
index 439c213ac7..58533728a5 100644
--- a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOutback.java
+++ b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianOutback.java
@@ -4,7 +4,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.australia.biome.CustomDecorator;
import gtPlusPlus.core.lib.CORE;
-
import java.util.Arrays;
import java.util.Random;
import net.minecraft.block.Block;
@@ -12,15 +11,13 @@ import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeDecorator;
-import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenMesa;
import net.minecraft.world.gen.NoiseGeneratorPerlin;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeManager;
-public class Biome_AustralianOutback extends BiomeGenMesa
-{
+public class Biome_AustralianOutback extends BiomeGenMesa {
private byte[] field_150621_aC;
private long field_150622_aD;
private NoiseGeneratorPerlin field_150623_aE;
@@ -29,7 +26,7 @@ public class Biome_AustralianOutback extends BiomeGenMesa
private boolean field_150626_aH;
private boolean field_150620_aI;
- public Biome_AustralianOutback(int p_i45380_1_){
+ public Biome_AustralianOutback(int p_i45380_1_) {
super(p_i45380_1_, false, false);
this.setColor(14238997);
this.setBiomeName("Australian Outback");
@@ -47,37 +44,42 @@ public class Biome_AustralianOutback extends BiomeGenMesa
this.theBiomeDecorator.cactiPerChunk = 20;
this.theBiomeDecorator.flowersPerChunk = 0;
this.spawnableCreatureList.clear();
- this.theBiomeDecorator.treesPerChunk = 5;
+ this.theBiomeDecorator.treesPerChunk = 5;
}
- public static Biome_AustralianOutback biome = new Biome_AustralianOutback(CORE.AUSTRALIA_BIOME_OUTBACK_ID);
- public void load() {
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.SPARSE);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.HOT);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
- BiomeManager.addSpawnBiome(biome);
- }
-
- public WorldGenAbstractTree func_150567_a(Random p_150567_1_)
- {
+ public static Biome_AustralianOutback biome = new Biome_AustralianOutback(CORE.AUSTRALIA_BIOME_OUTBACK_ID);
+
+ public void load() {
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.SPARSE);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.HOT);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
+ BiomeManager.addSpawnBiome(biome);
+ }
+
+ public WorldGenAbstractTree func_150567_a(Random p_150567_1_) {
return this.worldGeneratorTrees;
}
- public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_)
- {
+ public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) {
super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_);
}
- public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_)
- {
- if (this.field_150621_aC == null || this.field_150622_aD != p_150573_1_.getSeed())
- {
+ public void genTerrainBlocks(
+ World p_150573_1_,
+ Random p_150573_2_,
+ Block[] p_150573_3_,
+ byte[] p_150573_4_,
+ int p_150573_5_,
+ int p_150573_6_,
+ double p_150573_7_) {
+ if (this.field_150621_aC == null || this.field_150622_aD != p_150573_1_.getSeed()) {
this.func_150619_a(p_150573_1_.getSeed());
}
- if (this.field_150623_aE == null || this.field_150624_aF == null || this.field_150622_aD != p_150573_1_.getSeed())
- {
+ if (this.field_150623_aE == null
+ || this.field_150624_aF == null
+ || this.field_150622_aD != p_150573_1_.getSeed()) {
Random random1 = new Random(this.field_150622_aD);
this.field_150623_aE = new NoiseGeneratorPerlin(random1, 3);
this.field_150624_aF = new NoiseGeneratorPerlin(random1, 3);
@@ -88,21 +90,19 @@ public class Biome_AustralianOutback extends BiomeGenMesa
int k;
int l;
- if (this.field_150626_aH)
- {
+ if (this.field_150626_aH) {
k = (p_150573_5_ & -16) + (p_150573_6_ & 15);
l = (p_150573_6_ & -16) + (p_150573_5_ & 15);
- double d1 = Math.min(Math.abs(p_150573_7_), this.field_150623_aE.func_151601_a((double)k * 0.25D, (double)l * 0.25D));
+ double d1 = Math.min(
+ Math.abs(p_150573_7_), this.field_150623_aE.func_151601_a((double) k * 0.25D, (double) l * 0.25D));
- if (d1 > 0.0D)
- {
+ if (d1 > 0.0D) {
double d2 = 0.001953125D;
- double d3 = Math.abs(this.field_150624_aF.func_151601_a((double)k * d2, (double)l * d2));
+ double d3 = Math.abs(this.field_150624_aF.func_151601_a((double) k * d2, (double) l * d2));
d5 = d1 * d1 * 2.5D;
double d4 = Math.ceil(d3 * 50.0D) + 32.0D;
- if (d5 > d4)
- {
+ if (d5 > d4) {
d5 = d4;
}
@@ -115,163 +115,120 @@ public class Biome_AustralianOutback extends BiomeGenMesa
boolean flag = true;
Block block = Blocks.stained_hardened_clay;
Block block2 = this.fillerBlock;
- int i1 = (int)(p_150573_7_ / 3.0D + 3.0D + p_150573_2_.nextDouble() * 0.25D);
+ int i1 = (int) (p_150573_7_ / 3.0D + 3.0D + p_150573_2_.nextDouble() * 0.25D);
boolean flag1 = Math.cos(p_150573_7_ / 3.0D * Math.PI) > 0.0D;
int j1 = -1;
boolean flag2 = false;
int k1 = p_150573_3_.length / 256;
- for (int l1 = 255; l1 >= 0; --l1)
- {
+ for (int l1 = 255; l1 >= 0; --l1) {
int i2 = (l * 16 + k) * k1 + l1;
- if ((p_150573_3_[i2] == null || p_150573_3_[i2].getMaterial() == Material.air) && l1 < (int)d5)
- {
+ if ((p_150573_3_[i2] == null || p_150573_3_[i2].getMaterial() == Material.air) && l1 < (int) d5) {
p_150573_3_[i2] = Blocks.stone;
}
- if (l1 <= 0 + p_150573_2_.nextInt(5))
- {
+ if (l1 <= 0 + p_150573_2_.nextInt(5)) {
p_150573_3_[i2] = Blocks.bedrock;
- }
- else
- {
+ } else {
Block block1 = p_150573_3_[i2];
- if (block1 != null && block1.getMaterial() != Material.air)
- {
- if (block1 == Blocks.stone)
- {
+ if (block1 != null && block1.getMaterial() != Material.air) {
+ if (block1 == Blocks.stone) {
byte b0;
- if (j1 == -1)
- {
+ if (j1 == -1) {
flag2 = false;
- if (i1 <= 0)
- {
+ if (i1 <= 0) {
block = null;
block2 = Blocks.stone;
- }
- else if (l1 >= 59 && l1 <= 64)
- {
+ } else if (l1 >= 59 && l1 <= 64) {
block = Blocks.stained_hardened_clay;
block2 = this.fillerBlock;
}
- if (l1 < 63 && (block == null || block.getMaterial() == Material.air))
- {
+ if (l1 < 63 && (block == null || block.getMaterial() == Material.air)) {
block = Blocks.sandstone;
}
j1 = i1 + Math.max(0, l1 - 63);
- if (l1 >= 62)
- {
- if (this.field_150620_aI && l1 > 86 + i1 * 2)
- {
- if (flag1)
- {
+ if (l1 >= 62) {
+ if (this.field_150620_aI && l1 > 86 + i1 * 2) {
+ if (flag1) {
p_150573_3_[i2] = Blocks.dirt;
p_150573_4_[i2] = 1;
- }
- else
- {
+ } else {
p_150573_3_[i2] = Blocks.grass;
}
- }
- else if (l1 > 66 + i1)
- {
+ } else if (l1 > 66 + i1) {
b0 = 16;
- if (l1 >= 64 && l1 <= 127)
- {
- if (!flag1)
- {
+ if (l1 >= 64 && l1 <= 127) {
+ if (!flag1) {
b0 = this.func_150618_d(p_150573_5_, l1, p_150573_6_);
}
- }
- else
- {
+ } else {
b0 = 1;
}
- if (b0 < 16)
- {
+ if (b0 < 16) {
p_150573_3_[i2] = Blocks.stained_hardened_clay;
- p_150573_4_[i2] = (byte)b0;
- }
- else
- {
+ p_150573_4_[i2] = (byte) b0;
+ } else {
p_150573_3_[i2] = Blocks.hardened_clay;
}
- }
- else
- {
+ } else {
p_150573_3_[i2] = this.topBlock;
- p_150573_4_[i2] = (byte)this.field_150604_aj;
+ p_150573_4_[i2] = (byte) this.field_150604_aj;
flag2 = true;
}
- }
- else
- {
+ } else {
p_150573_3_[i2] = block2;
- if (block2 == Blocks.stained_hardened_clay)
- {
+ if (block2 == Blocks.stained_hardened_clay) {
p_150573_4_[i2] = 1;
}
}
- }
- else if (j1 > 0)
- {
+ } else if (j1 > 0) {
--j1;
- if (flag2)
- {
+ if (flag2) {
p_150573_3_[i2] = Blocks.stained_hardened_clay;
p_150573_4_[i2] = 1;
- }
- else
- {
+ } else {
b0 = this.func_150618_d(p_150573_5_, l1, p_150573_6_);
- if (b0 < 16)
- {
+ if (b0 < 16) {
p_150573_3_[i2] = Blocks.stained_hardened_clay;
p_150573_4_[i2] = b0;
- }
- else
- {
+ } else {
p_150573_3_[i2] = Blocks.hardened_clay;
}
}
}
}
- }
- else
- {
+ } else {
j1 = -1;
}
}
}
- super.genTerrainBlocks(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_);
+ super.genTerrainBlocks(
+ p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_);
}
- public void func_150619_a(long p_150619_1_)
- {
+ public void func_150619_a(long p_150619_1_) {
this.field_150621_aC = new byte[128];
- Arrays.fill(this.field_150621_aC, (byte)16);
+ Arrays.fill(this.field_150621_aC, (byte) 16);
Random random = new Random(p_150619_1_);
this.field_150625_aG = new NoiseGeneratorPerlin(random, 3);
int j;
- for (j = 0; j < 128; ++j)
- {
+ for (j = 0; j < 128; ++j) {
j += random.nextInt(8) + 1;
- if (j < 128)
- {
+ if (j < 128) {
this.field_150621_aC[j] = 1;
}
}
@@ -282,13 +239,11 @@ public class Biome_AustralianOutback extends BiomeGenMesa
int i1;
int j1;
- for (k = 0; k < j; ++k)
- {
+ for (k = 0; k < j; ++k) {
l = random.nextInt(7) + 1;
i1 = random.nextInt(128);
- for (j1 = 0; i1 + j1 < 128 && j1 < l; ++j1)
- {
+ for (j1 = 0; i1 + j1 < 128 && j1 < l; ++j1) {
this.field_150621_aC[i1 + j1] = 4;
}
}
@@ -296,26 +251,22 @@ public class Biome_AustralianOutback extends BiomeGenMesa
k = random.nextInt(6) + 2;
int k1;
- for (l = 0; l < k; ++l)
- {
+ for (l = 0; l < k; ++l) {
i1 = random.nextInt(7) + 2;
j1 = random.nextInt(128);
- for (k1 = 0; j1 + k1 < 128 && k1 < i1; ++k1)
- {
+ for (k1 = 0; j1 + k1 < 128 && k1 < i1; ++k1) {
this.field_150621_aC[j1 + k1] = 12;
}
}
l = random.nextInt(7) + 2;
- for (i1 = 0; i1 < l; ++i1)
- {
+ for (i1 = 0; i1 < l; ++i1) {
j1 = random.nextInt(5) + 1;
k1 = random.nextInt(128);
- for (int l1 = 0; k1 + l1 < 128 && l1 < j1; ++l1)
- {
+ for (int l1 = 0; k1 + l1 < 128 && l1 < j1; ++l1) {
this.field_150621_aC[k1 + l1] = 14;
}
}
@@ -323,22 +274,18 @@ public class Biome_AustralianOutback extends BiomeGenMesa
i1 = random.nextInt(8) + 3;
j1 = 0;
- for (k1 = 0; k1 < i1; ++k1)
- {
+ for (k1 = 0; k1 < i1; ++k1) {
byte b0 = 1;
j1 += random.nextInt(8) + 4;
- for (int i2 = 0; j1 + i2 < 128 && i2 < b0; ++i2)
- {
+ for (int i2 = 0; j1 + i2 < 128 && i2 < b0; ++i2) {
this.field_150621_aC[j1 + i2] = 0;
- if (j1 + i2 > 1 && random.nextBoolean())
- {
+ if (j1 + i2 > 1 && random.nextBoolean()) {
this.field_150621_aC[j1 + i2 - 1] = 8;
}
- if (j1 + i2 < 63 && random.nextBoolean())
- {
+ if (j1 + i2 < 63 && random.nextBoolean()) {
this.field_150621_aC[j1 + i2 + 1] = 8;
}
}
@@ -349,8 +296,7 @@ public class Biome_AustralianOutback extends BiomeGenMesa
* Provides the basic foliage color based on the biome temperature and rainfall
*/
@SideOnly(Side.CLIENT)
- public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_)
- {
+ public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_) {
return 10387789;
}
@@ -358,24 +304,22 @@ public class Biome_AustralianOutback extends BiomeGenMesa
* Provides the basic grass color based on the biome temperature and rainfall
*/
@SideOnly(Side.CLIENT)
- public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_)
- {
+ public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) {
return 9470285;
}
- public byte func_150618_d(int p_150618_1_, int p_150618_2_, int p_150618_3_)
- {
- int l = (int)Math.round(this.field_150625_aG.func_151601_a((double)p_150618_1_ * 1.0D / 512.0D, (double)p_150618_1_ * 1.0D / 512.0D) * 2.0D);
+ public byte func_150618_d(int p_150618_1_, int p_150618_2_, int p_150618_3_) {
+ int l = (int) Math.round(this.field_150625_aG.func_151601_a(
+ (double) p_150618_1_ * 1.0D / 512.0D, (double) p_150618_1_ * 1.0D / 512.0D)
+ * 2.0D);
return this.field_150621_aC[(p_150618_2_ + l + 64) % 64];
}
- /**
- * Allocate a new BiomeDecorator for this BiomeGenBase
- */
- @Override
- public BiomeDecorator createBiomeDecorator()
- {
- return getModdedBiomeDecorator(new CustomDecorator());
- }
-
-} \ No newline at end of file
+ /**
+ * Allocate a new BiomeDecorator for this BiomeGenBase
+ */
+ @Override
+ public BiomeDecorator createBiomeDecorator() {
+ return getModdedBiomeDecorator(new CustomDecorator());
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java
index c04f211fd3..23da681eab 100644
--- a/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java
+++ b/src/main/java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java
@@ -1,9 +1,8 @@
package gtPlusPlus.australia.biome.type;
-import java.util.Random;
-
import gtPlusPlus.australia.biome.CustomDecorator;
import gtPlusPlus.core.lib.CORE;
+import java.util.Random;
import net.minecraft.block.BlockFlower;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.init.Blocks;
@@ -14,11 +13,9 @@ import net.minecraft.world.biome.BiomeGenPlains;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeManager;
-public class Biome_AustralianPlains extends BiomeGenPlains
-{
+public class Biome_AustralianPlains extends BiomeGenPlains {
- public Biome_AustralianPlains(int p_i1986_1_)
- {
+ public Biome_AustralianPlains(int p_i1986_1_) {
super(p_i1986_1_);
this.setTemperatureRainfall(0.8F, 0.4F);
this.setColor(9286496);
@@ -29,65 +26,57 @@ public class Biome_AustralianPlains extends BiomeGenPlains
this.theBiomeDecorator.flowersPerChunk = 4;
this.theBiomeDecorator.grassPerChunk = 20;
this.flowers.clear();
- this.addFlower(Blocks.red_flower, 4, 3);
- this.addFlower(Blocks.red_flower, 5, 3);
- this.addFlower(Blocks.red_flower, 6, 3);
- this.addFlower(Blocks.red_flower, 7, 3);
- this.addFlower(Blocks.red_flower, 0, 20);
- this.addFlower(Blocks.red_flower, 3, 20);
- this.addFlower(Blocks.red_flower, 8, 20);
+ this.addFlower(Blocks.red_flower, 4, 3);
+ this.addFlower(Blocks.red_flower, 5, 3);
+ this.addFlower(Blocks.red_flower, 6, 3);
+ this.addFlower(Blocks.red_flower, 7, 3);
+ this.addFlower(Blocks.red_flower, 0, 20);
+ this.addFlower(Blocks.red_flower, 3, 20);
+ this.addFlower(Blocks.red_flower, 8, 20);
this.addFlower(Blocks.yellow_flower, 0, 30);
}
- public static Biome_AustralianPlains biome = new Biome_AustralianPlains(CORE.AUSTRALIA_BIOME_PLAINS_ID);
- public void load() {
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.SPARSE);
- BiomeManager.addSpawnBiome(biome);
- }
+ public static Biome_AustralianPlains biome = new Biome_AustralianPlains(CORE.AUSTRALIA_BIOME_PLAINS_ID);
+
+ public void load() {
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DRY);
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.SPARSE);
+ BiomeManager.addSpawnBiome(biome);
+ }
- public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_)
- {
- double d0 = plantNoise.func_151601_a((double)p_150572_2_ / 200.0D, (double)p_150572_4_ / 200.0D);
+ public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) {
+ double d0 = plantNoise.func_151601_a((double) p_150572_2_ / 200.0D, (double) p_150572_4_ / 200.0D);
int l;
- if (d0 < -0.8D)
- {
+ if (d0 < -0.8D) {
l = p_150572_1_.nextInt(4);
return BlockFlower.field_149859_a[4 + l];
- }
- else if (p_150572_1_.nextInt(3) > 0)
- {
+ } else if (p_150572_1_.nextInt(3) > 0) {
l = p_150572_1_.nextInt(3);
- return l == 0 ? BlockFlower.field_149859_a[0] : (l == 1 ? BlockFlower.field_149859_a[3] : BlockFlower.field_149859_a[8]);
- }
- else
- {
+ return l == 0
+ ? BlockFlower.field_149859_a[0]
+ : (l == 1 ? BlockFlower.field_149859_a[3] : BlockFlower.field_149859_a[8]);
+ } else {
return BlockFlower.field_149858_b[0];
}
}
- public void decorate(World aWorld, Random aRand, int aX, int aZ)
- {
- double d0 = plantNoise.func_151601_a((double)(aX + 8) / 200.0D, (double)(aZ + 8) / 200.0D);
+ public void decorate(World aWorld, Random aRand, int aX, int aZ) {
+ double d0 = plantNoise.func_151601_a((double) (aX + 8) / 200.0D, (double) (aZ + 8) / 200.0D);
int k;
int l;
int i1;
int j1;
- if (d0 < -0.8D)
- {
+ if (d0 < -0.8D) {
this.theBiomeDecorator.flowersPerChunk = 15;
this.theBiomeDecorator.grassPerChunk = 5;
- }
- else
- {
+ } else {
this.theBiomeDecorator.flowersPerChunk = 4;
this.theBiomeDecorator.grassPerChunk = 10;
genTallFlowers.func_150548_a(2);
- for (k = 0; k < 7; ++k)
- {
+ for (k = 0; k < 7; ++k) {
l = aX + aRand.nextInt(16) + 8;
i1 = aZ + aRand.nextInt(16) + 8;
j1 = aRand.nextInt(aWorld.getHeightValue(l, i1) + 32);
@@ -95,12 +84,10 @@ public class Biome_AustralianPlains extends BiomeGenPlains
}
}
- if (this.field_150628_aC)
- {
+ if (this.field_150628_aC) {
genTallFlowers.func_150548_a(0);
- for (k = 0; k < 10; ++k)
- {
+ for (k = 0; k < 10; ++k) {
l = aX + aRand.nextInt(16) + 8;
i1 = aZ + aRand.nextInt(16) + 8;
j1 = aRand.nextInt(aWorld.getHeightValue(l, i1) + 32);
@@ -111,12 +98,11 @@ public class Biome_AustralianPlains extends BiomeGenPlains
this.theBiomeDecorator.decorateChunk(aWorld, aRand, this, aX, aZ);
}
- /**
- * Allocate a new BiomeDecorator for this BiomeGenBase
- */
- @Override
- public BiomeDecorator createBiomeDecorator()
- {
- return getModdedBiomeDecorator(new CustomDecorator());
- }
-} \ No newline at end of file
+ /**
+ * Allocate a new BiomeDecorator for this BiomeGenBase
+ */
+ @Override
+ public BiomeDecorator createBiomeDecorator() {
+ return getModdedBiomeDecorator(new CustomDecorator());
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/block/AustraliaContentLoader.java b/src/main/java/gtPlusPlus/australia/block/AustraliaContentLoader.java
index 0df84500e1..b1a1d7b66e 100644
--- a/src/main/java/gtPlusPlus/australia/block/AustraliaContentLoader.java
+++ b/src/main/java/gtPlusPlus/australia/block/AustraliaContentLoader.java
@@ -3,65 +3,64 @@ package gtPlusPlus.australia.block;
import static gtPlusPlus.australia.dimension.Dimension_Australia.*;
import cpw.mods.fml.common.registry.GameRegistry;
-import net.minecraft.block.Block;
-import net.minecraft.init.Blocks;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.australia.biome.type.Biome_AustralianDesert;
import gtPlusPlus.australia.biome.type.Biome_AustralianDesert2;
import gtPlusPlus.australia.item.ItemAustraliaPortalTrigger;
import gtPlusPlus.australia.item.ItemBlockAustralia;
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
public class AustraliaContentLoader {
- private static Block blockAustralianSand;
- private static Block blockAustralianTopSoil;
-
- public static AutoMap<Block> mValidGenerationBlocks = new AutoMap<Block>();
+ private static Block blockAustralianSand;
+ private static Block blockAustralianTopSoil;
+
+ public static AutoMap<Block> mValidGenerationBlocks = new AutoMap<Block>();
+
+ public static synchronized void run() {
+ initMisc();
+ initItems();
+ initBlocks();
+ }
- public synchronized static void run() {
- initMisc();
- initItems();
- initBlocks();
- }
+ public static synchronized boolean initMisc() {
+ return true;
+ }
- public synchronized static boolean initMisc(){
- return true;
- }
+ public static synchronized boolean initItems() {
+ portalItem =
+ (ItemAustraliaPortalTrigger) (new ItemAustraliaPortalTrigger().setUnlocalizedName("australia.trigger"));
+ GameRegistry.registerItem(portalItem, "australia.trigger");
+ return true;
+ }
- public synchronized static boolean initItems(){
- portalItem = (ItemAustraliaPortalTrigger) (new ItemAustraliaPortalTrigger().setUnlocalizedName("australia.trigger"));
- GameRegistry.registerItem(portalItem, "australia.trigger");
- return true;
- }
+ public static synchronized boolean initBlocks() {
- public synchronized static boolean initBlocks(){
+ // Create Block Instances
+ portalBlock = new BlockAustraliaPortal();
+ blockPortalFrame = new BlockDarkWorldPortalFrame();
+ blockAustralianSand = new BlockAustraliaSand();
+ blockAustralianTopSoil = new BlockAustraliaTopSoil();
+ mValidGenerationBlocks.put(blockAustralianSand);
+ mValidGenerationBlocks.put(blockAustralianTopSoil);
- //Create Block Instances
- portalBlock = new BlockAustraliaPortal();
- blockPortalFrame = new BlockDarkWorldPortalFrame();
- blockAustralianSand = new BlockAustraliaSand();
- blockAustralianTopSoil = new BlockAustraliaTopSoil();
- mValidGenerationBlocks.put(blockAustralianSand);
- mValidGenerationBlocks.put(blockAustralianTopSoil);
-
- //Registry
- GameRegistry.registerBlock(portalBlock, ItemBlockAustralia.class, "dimensionAustraliaPortalBlock");
- GameRegistry.registerBlock(blockPortalFrame, ItemBlockAustralia.class, "blockAustraliaPortalFrame");
-
- GameRegistry.registerBlock(blockAustralianSand, ItemBlockAustralia.class, "blockAustralianTopSoil");
- GameRegistry.registerBlock(blockAustralianTopSoil, ItemBlockAustralia.class, "blockAustralianSand");
+ // Registry
+ GameRegistry.registerBlock(portalBlock, ItemBlockAustralia.class, "dimensionAustraliaPortalBlock");
+ GameRegistry.registerBlock(blockPortalFrame, ItemBlockAustralia.class, "blockAustraliaPortalFrame");
- //Set Biome Blocks up
- Biome_AustralianDesert.blockFluidLakes = Blocks.water;
- Biome_AustralianDesert.blockTopLayer = blockAustralianSand;
- Biome_AustralianDesert.blockSecondLayer = blockAustralianTopSoil;
-
- Biome_AustralianDesert2.blockFluidLakes = Blocks.water;
- Biome_AustralianDesert2.blockTopLayer = blockAustralianSand;
- Biome_AustralianDesert2.blockSecondLayer = blockAustralianTopSoil;
+ GameRegistry.registerBlock(blockAustralianSand, ItemBlockAustralia.class, "blockAustralianTopSoil");
+ GameRegistry.registerBlock(blockAustralianTopSoil, ItemBlockAustralia.class, "blockAustralianSand");
- return true;
- }
+ // Set Biome Blocks up
+ Biome_AustralianDesert.blockFluidLakes = Blocks.water;
+ Biome_AustralianDesert.blockTopLayer = blockAustralianSand;
+ Biome_AustralianDesert.blockSecondLayer = blockAustralianTopSoil;
+ Biome_AustralianDesert2.blockFluidLakes = Blocks.water;
+ Biome_AustralianDesert2.blockTopLayer = blockAustralianSand;
+ Biome_AustralianDesert2.blockSecondLayer = blockAustralianTopSoil;
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/block/BlockAustraliaPortal.java b/src/main/java/gtPlusPlus/australia/block/BlockAustraliaPortal.java
index 44ece25e43..a5c7356620 100644
--- a/src/main/java/gtPlusPlus/australia/block/BlockAustraliaPortal.java
+++ b/src/main/java/gtPlusPlus/australia/block/BlockAustraliaPortal.java
@@ -1,10 +1,14 @@
package gtPlusPlus.australia.block;
-import java.util.Random;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.australia.dimension.Dimension_Australia;
+import gtPlusPlus.australia.world.AustraliaTeleporterDimensionMod;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
@@ -19,385 +23,382 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.australia.dimension.Dimension_Australia;
-import gtPlusPlus.australia.world.AustraliaTeleporterDimensionMod;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
-public class BlockAustraliaPortal extends BlockBreakable implements ITileTooltip{
- IIcon gor = null, dol = null, st1 = null, st2 = null, st3 = null, st4 = null;
-
- public BlockAustraliaPortal() {
- super("portal", Material.portal, false);
- this.setTickRandomly(true);
- this.setHardness(-1.0F);
- this.setLightLevel(0.75F);
- this.setCreativeTab(CreativeTabs.tabBlock);
- this.setBlockName("dimensionAustraliaPortalBlock");
-
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public IIcon getIcon(int i, int par2) {
-
- if (i == 0)
- return gor;
-
- else if (i == 1)
- return dol;
-
- else if (i == 2)
- return st1;
-
- else if (i == 3)
- return st2;
-
- else if (i == 4)
- return st4;
-
- else if (i == 5)
- return st3;
-
- else
- return gor;
-
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(IIconRegister reg) {
- this.gor = reg.registerIcon("portal");
- this.dol = reg.registerIcon("portal");
- this.st1 = reg.registerIcon("portal");
- this.st2 = reg.registerIcon("portal");
- this.st3 = reg.registerIcon("portal");
- this.st4 = reg.registerIcon("portal");
- }
-
- /**
- * Ticks the block if it's been scheduled
- */
- @Override
- public void updateTick(World par1World, int x, int y, int z, Random par5Random) {
- super.updateTick(par1World, x, y, z, par5Random);
-
- int blockCount = 0;
- BlockPos portal = new BlockPos(x, y, z, par1World.provider.dimensionId);
-
- for (BlockPos side : portal.getSurroundingBlocks()) {
- Block b = side.getBlockAtPos();
- if (b == Dimension_Australia.blockPortalFrame || b == Dimension_Australia.portalBlock) {
- blockCount++;
- }
- }
- if (blockCount < 4) {
- par1World.setBlockToAir(x, y, z);
- }
-
- }
-
- /**
- * Returns a bounding box from the pool of bounding boxes (this means
- * this box can change after the pool has been cleared to be reused)
- */
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
- return null;
- }
-
- /**
- * Updates the blocks bounds based on its current state. Args: world, x,
- * y, z
- */
- @Override
- public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
- float f;
- float f1;
- if (par1IBlockAccess.getBlock(par2 - 1, par3, par4) != this && par1IBlockAccess.getBlock(par2 + 1, par3, par4) != this) {
- f = 0.125F;
- f1 = 0.5F;
- this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
- } else {
- f = 0.5F;
- f1 = 0.125F;
- this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
- }
- }
-
- /**
- * 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;
- }
-
- /**
- * Checks to see if this location is valid to create a portal and will
- * return True if it does. Args: world, x, y, z
- */
- public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) {
- byte b0 = 0;
- byte b1 = 0;
- if (par1World.getBlock(par2 - 1, par3, par4) == Dimension_Australia.blockPortalFrame
- || par1World.getBlock(par2 + 1, par3, par4) == Dimension_Australia.blockPortalFrame) {
- b0 = 1;
- }
- if (par1World.getBlock(par2, par3, par4 - 1) == Dimension_Australia.blockPortalFrame
- || par1World.getBlock(par2, par3, par4 + 1) == Dimension_Australia.blockPortalFrame) {
- b1 = 1;
- }
- if (b0 == b1) {
- return false;
- } else {
- if (par1World.getBlock(par2 - b0, par3, par4 - b1) == Blocks.air) {
- par2 -= b0;
- par4 -= b1;
- }
- int l;
- int i1;
- for (l = -1; l <= 2; ++l) {
- for (i1 = -1; i1 <= 3; ++i1) {
- boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;
- if (l != -1 && l != 2 || i1 != -1 && i1 != 3) {
- Block j1 = par1World.getBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l);
- if (flag) {
- if (j1 != Dimension_Australia.blockPortalFrame) {
- return false;
- }
- }
- /*
- * else if (j1 != 0 && j1 !=
- * Main.TutorialFire.blockID) { return false; }
- */
- }
- }
- }
- for (l = 0; l < 2; ++l) {
- for (i1 = 0; i1 < 3; ++i1) {
- par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, this, 0, 2);
- }
- }
- return true;
- }
- }
-
- /**
- * Lets the block know when one of its neighbor changes. Doesn't know
- * which neighbor changed (coordinates passed are their own) Args: x, y,
- * z, neighbor blockID
- */
- public void onNeighborBlockChange(BlockPos pos) {
- int x = pos.xPos, y = pos.yPos, z = pos.zPos;
- //Logger.INFO("Trigger");
- int blockCount = 0;
- BlockPos portal = pos;
- World par1World = portal.world;
- for (BlockPos side : portal.getSurroundingBlocks()) {
- Block b = side.getBlockAtPos();
- if (b == Dimension_Australia.blockPortalFrame || b == Dimension_Australia.portalBlock) {
- blockCount++;
- }
- }
- if (blockCount < 4) {
- par1World.setBlockToAir(x, y, z);
- par1World.scheduleBlockUpdate(x, y, z, portal.getBlockAtPos(), 0);
- }
-
-
-
- byte b0 = 0;
- byte b1 = 1;
- if (par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this) {
- b0 = 1;
- b1 = 0;
- }
- int i1;
- for (i1 = y; par1World.getBlock(x, i1 - 1, z) == this; --i1) {
- ;
- }
- if (par1World.getBlock(x, i1 - 1, z) != Dimension_Australia.blockPortalFrame) {
- par1World.setBlockToAir(x, y, z);
- } else {
- int j1;
- for (j1 = 1; j1 < 4 && par1World.getBlock(x, i1 + j1, z) == this; ++j1) {
- ;
- }
- if (j1 == 3 && par1World.getBlock(x, i1 + j1, z) == Dimension_Australia.blockPortalFrame) {
- boolean flag = par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this;
- boolean flag1 = par1World.getBlock(x, y, z - 1) == this || par1World.getBlock(x, y, z + 1) == this;
- if (flag && flag1) {
- par1World.setBlockToAir(x, y, z);
- } else {
- if ((par1World.getBlock(x + b0, y, z + b1) != Dimension_Australia.blockPortalFrame || par1World
- .getBlock(x - b0, y, z - b1) != this)
- && (par1World.getBlock(x - b0, y, z - b1) != Dimension_Australia.blockPortalFrame || par1World.getBlock(x + b0, y,
- z + b1) != this)) {
- par1World.setBlockToAir(x, y, z);
- }
- }
- } else {
- par1World.setBlockToAir(x, y, z);
- }
- }
- }
-
- @Override
- public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
- onNeighborBlockChange(new BlockPos(x, y, z, world.provider.dimensionId));
- super.onNeighborBlockChange(world, x, y, z, block);
- }
-
- /*@Override
- public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) {
- onNeighborBlockChange(new BlockPos(x, y, z, world.));
- super.onNeighborChange(world, x, y, z, tileX, tileY, tileZ);
- }*/
-
- @Override
- @SideOnly(Side.CLIENT)
- /**
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
- * coordinates. Args: blockAccess, x, y, z, side
- */
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
- if (par1IBlockAccess.getBlock(par2, par3, par4) == this) {
- return false;
- } else {
- boolean flag = par1IBlockAccess.getBlock(par2 - 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 - 2, par3, par4) != this;
- boolean flag1 = par1IBlockAccess.getBlock(par2 + 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 + 2, par3, par4) != this;
- boolean flag2 = par1IBlockAccess.getBlock(par2, par3, par4 - 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 - 2) != this;
- boolean flag3 = par1IBlockAccess.getBlock(par2, par3, par4 + 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 + 2) != this;
- boolean flag4 = flag || flag1;
- boolean flag5 = flag2 || flag3;
- return flag4 && par5 == 4 ? true : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3));
- }
- }
-
- /**
- * Returns the quantity of items to drop on block destruction.
- */
- @Override
- public int quantityDropped(Random par1Random) {
- return 0;
- }
-
- /**
- * Triggered whenever an entity collides with this block (enters into
- * the block). Args: world, x, y, z, entity
- */
- @Override
- public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
- if ((par5Entity.ridingEntity == null) && (par5Entity.riddenByEntity == null) && ((par5Entity instanceof EntityPlayerMP))) {
- EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity;
- if (thePlayer.timeUntilPortal > 0) {
- thePlayer.timeUntilPortal = 100;
- } else if (thePlayer.dimension != Dimension_Australia.DIMID) {
- thePlayer.timeUntilPortal = 100;
- thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, Dimension_Australia.DIMID,
- new AustraliaTeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(Dimension_Australia.DIMID)));
- } else {
- thePlayer.timeUntilPortal = 100;
- thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0,
- new AustraliaTeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(0)));
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- /**
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
- */
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- /**
- * A randomly called display update to be able to add particles or other items for display
- */
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
- if (CORE.RANDOM.nextInt(100) == 0) {
- par1World.playSound(par2 + 0.5D, par3 + 0.5D, par4 + 0.5D, "portal.portal", 0.5F,
- CORE.RANDOM.nextFloat() * 0.4F + 0.8F, false);
- }
- for (int l = 0; l < 4; ++l) {
- double d0 = par2 + CORE.RANDOM.nextFloat();
- double d1 = par3 + CORE.RANDOM.nextFloat();
- double d2 = par4 + CORE.RANDOM.nextFloat();
- double d3 = 0.0D;
- double d4 = 0.0D;
- double d5 = 0.0D;
- int i1 = CORE.RANDOM.nextInt(2) * 2 - 1;
- d3 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
- d4 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
- d5 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
- if (par1World.getBlock(par2 - 1, par3, par4) != this && par1World.getBlock(par2 + 1, par3, par4) != this) {
- d0 = par2 + 0.5D + 0.25D * i1;
- d3 = CORE.RANDOM.nextFloat() * 2.0F * i1;
- } else {
- d2 = par4 + 0.5D + 0.25D * i1;
- d5 = CORE.RANDOM.nextFloat() * 2.0F * i1;
- }
- par1World.spawnParticle("reddust", d0+0.1D, d1, d2, d3, d4, d5);
- par1World.spawnParticle("smoke", d0, d1+0.1D, d2, 0, 0, 0);
-
- Random R = new Random();
-
- if (R.nextInt(10) == 0){
- par1World.spawnParticle("largesmoke", d0, d1, d2, 0, 0+0.2D, 0);
- }
- else if (R.nextInt(5)==1){
- par1World.spawnParticle("flame", d0, d1, d2, 0, 0+0.1D, 0);
- }
- }
- }
-
- @SideOnly(Side.CLIENT)
- /**
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
- */
- public int idPicked(World par1World, int par2, int par3, int par4) {
- return 0;
- }
-
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){
- return Utils.rgbtoHexValue(0, 255, 0);
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- return Utils.rgbtoHexValue(0, 255, 0);
- }
-
- @Override
- public String getLocalizedName() {
- return EnumChatFormatting.OBFUSCATED+super.getLocalizedName();
- }
-
- @Override
- public int getTooltipID() {
- return 1;
- }
+public class BlockAustraliaPortal extends BlockBreakable implements ITileTooltip {
+ IIcon gor = null, dol = null, st1 = null, st2 = null, st3 = null, st4 = null;
+
+ public BlockAustraliaPortal() {
+ super("portal", Material.portal, false);
+ this.setTickRandomly(true);
+ this.setHardness(-1.0F);
+ this.setLightLevel(0.75F);
+ this.setCreativeTab(CreativeTabs.tabBlock);
+ this.setBlockName("dimensionAustraliaPortalBlock");
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public IIcon getIcon(int i, int par2) {
+
+ if (i == 0) return gor;
+ else if (i == 1) return dol;
+ else if (i == 2) return st1;
+ else if (i == 3) return st2;
+ else if (i == 4) return st4;
+ else if (i == 5) return st3;
+ else return gor;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister reg) {
+ this.gor = reg.registerIcon("portal");
+ this.dol = reg.registerIcon("portal");
+ this.st1 = reg.registerIcon("portal");
+ this.st2 = reg.registerIcon("portal");
+ this.st3 = reg.registerIcon("portal");
+ this.st4 = reg.registerIcon("portal");
+ }
+
+ /**
+ * Ticks the block if it's been scheduled
+ */
+ @Override
+ public void updateTick(World par1World, int x, int y, int z, Random par5Random) {
+ super.updateTick(par1World, x, y, z, par5Random);
+
+ int blockCount = 0;
+ BlockPos portal = new BlockPos(x, y, z, par1World.provider.dimensionId);
+
+ for (BlockPos side : portal.getSurroundingBlocks()) {
+ Block b = side.getBlockAtPos();
+ if (b == Dimension_Australia.blockPortalFrame || b == Dimension_Australia.portalBlock) {
+ blockCount++;
+ }
+ }
+ if (blockCount < 4) {
+ par1World.setBlockToAir(x, y, z);
+ }
+ }
+
+ /**
+ * Returns a bounding box from the pool of bounding boxes (this means
+ * this box can change after the pool has been cleared to be reused)
+ */
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
+ return null;
+ }
+
+ /**
+ * Updates the blocks bounds based on its current state. Args: world, x,
+ * y, z
+ */
+ @Override
+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
+ float f;
+ float f1;
+ if (par1IBlockAccess.getBlock(par2 - 1, par3, par4) != this
+ && par1IBlockAccess.getBlock(par2 + 1, par3, par4) != this) {
+ f = 0.125F;
+ f1 = 0.5F;
+ this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
+ } else {
+ f = 0.5F;
+ f1 = 0.125F;
+ this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
+ }
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Checks to see if this location is valid to create a portal and will
+ * return True if it does. Args: world, x, y, z
+ */
+ public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) {
+ byte b0 = 0;
+ byte b1 = 0;
+ if (par1World.getBlock(par2 - 1, par3, par4) == Dimension_Australia.blockPortalFrame
+ || par1World.getBlock(par2 + 1, par3, par4) == Dimension_Australia.blockPortalFrame) {
+ b0 = 1;
+ }
+ if (par1World.getBlock(par2, par3, par4 - 1) == Dimension_Australia.blockPortalFrame
+ || par1World.getBlock(par2, par3, par4 + 1) == Dimension_Australia.blockPortalFrame) {
+ b1 = 1;
+ }
+ if (b0 == b1) {
+ return false;
+ } else {
+ if (par1World.getBlock(par2 - b0, par3, par4 - b1) == Blocks.air) {
+ par2 -= b0;
+ par4 -= b1;
+ }
+ int l;
+ int i1;
+ for (l = -1; l <= 2; ++l) {
+ for (i1 = -1; i1 <= 3; ++i1) {
+ boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;
+ if (l != -1 && l != 2 || i1 != -1 && i1 != 3) {
+ Block j1 = par1World.getBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l);
+ if (flag) {
+ if (j1 != Dimension_Australia.blockPortalFrame) {
+ return false;
+ }
+ }
+ /*
+ * else if (j1 != 0 && j1 !=
+ * Main.TutorialFire.blockID) { return false; }
+ */
+ }
+ }
+ }
+ for (l = 0; l < 2; ++l) {
+ for (i1 = 0; i1 < 3; ++i1) {
+ par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, this, 0, 2);
+ }
+ }
+ return true;
+ }
+ }
+
+ /**
+ * Lets the block know when one of its neighbor changes. Doesn't know
+ * which neighbor changed (coordinates passed are their own) Args: x, y,
+ * z, neighbor blockID
+ */
+ public void onNeighborBlockChange(BlockPos pos) {
+ int x = pos.xPos, y = pos.yPos, z = pos.zPos;
+ // Logger.INFO("Trigger");
+ int blockCount = 0;
+ BlockPos portal = pos;
+ World par1World = portal.world;
+ for (BlockPos side : portal.getSurroundingBlocks()) {
+ Block b = side.getBlockAtPos();
+ if (b == Dimension_Australia.blockPortalFrame || b == Dimension_Australia.portalBlock) {
+ blockCount++;
+ }
+ }
+ if (blockCount < 4) {
+ par1World.setBlockToAir(x, y, z);
+ par1World.scheduleBlockUpdate(x, y, z, portal.getBlockAtPos(), 0);
+ }
+
+ byte b0 = 0;
+ byte b1 = 1;
+ if (par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this) {
+ b0 = 1;
+ b1 = 0;
+ }
+ int i1;
+ for (i1 = y; par1World.getBlock(x, i1 - 1, z) == this; --i1) {
+ ;
+ }
+ if (par1World.getBlock(x, i1 - 1, z) != Dimension_Australia.blockPortalFrame) {
+ par1World.setBlockToAir(x, y, z);
+ } else {
+ int j1;
+ for (j1 = 1; j1 < 4 && par1World.getBlock(x, i1 + j1, z) == this; ++j1) {
+ ;
+ }
+ if (j1 == 3 && par1World.getBlock(x, i1 + j1, z) == Dimension_Australia.blockPortalFrame) {
+ boolean flag = par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this;
+ boolean flag1 = par1World.getBlock(x, y, z - 1) == this || par1World.getBlock(x, y, z + 1) == this;
+ if (flag && flag1) {
+ par1World.setBlockToAir(x, y, z);
+ } else {
+ if ((par1World.getBlock(x + b0, y, z + b1) != Dimension_Australia.blockPortalFrame
+ || par1World.getBlock(x - b0, y, z - b1) != this)
+ && (par1World.getBlock(x - b0, y, z - b1) != Dimension_Australia.blockPortalFrame
+ || par1World.getBlock(x + b0, y, z + b1) != this)) {
+ par1World.setBlockToAir(x, y, z);
+ }
+ }
+ } else {
+ par1World.setBlockToAir(x, y, z);
+ }
+ }
+ }
+
+ @Override
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
+ onNeighborBlockChange(new BlockPos(x, y, z, world.provider.dimensionId));
+ super.onNeighborBlockChange(world, x, y, z, block);
+ }
+
+ /*@Override
+ public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) {
+ onNeighborBlockChange(new BlockPos(x, y, z, world.));
+ super.onNeighborChange(world, x, y, z, tileX, tileY, tileZ);
+ }*/
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ /**
+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
+ * coordinates. Args: blockAccess, x, y, z, side
+ */
+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
+ if (par1IBlockAccess.getBlock(par2, par3, par4) == this) {
+ return false;
+ } else {
+ boolean flag = par1IBlockAccess.getBlock(par2 - 1, par3, par4) == this
+ && par1IBlockAccess.getBlock(par2 - 2, par3, par4) != this;
+ boolean flag1 = par1IBlockAccess.getBlock(par2 + 1, par3, par4) == this
+ && par1IBlockAccess.getBlock(par2 + 2, par3, par4) != this;
+ boolean flag2 = par1IBlockAccess.getBlock(par2, par3, par4 - 1) == this
+ && par1IBlockAccess.getBlock(par2, par3, par4 - 2) != this;
+ boolean flag3 = par1IBlockAccess.getBlock(par2, par3, par4 + 1) == this
+ && par1IBlockAccess.getBlock(par2, par3, par4 + 2) != this;
+ boolean flag4 = flag || flag1;
+ boolean flag5 = flag2 || flag3;
+ return flag4 && par5 == 4
+ ? true
+ : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3));
+ }
+ }
+
+ /**
+ * Returns the quantity of items to drop on block destruction.
+ */
+ @Override
+ public int quantityDropped(Random par1Random) {
+ return 0;
+ }
+
+ /**
+ * Triggered whenever an entity collides with this block (enters into
+ * the block). Args: world, x, y, z, entity
+ */
+ @Override
+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
+ if ((par5Entity.ridingEntity == null)
+ && (par5Entity.riddenByEntity == null)
+ && ((par5Entity instanceof EntityPlayerMP))) {
+ EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity;
+ if (thePlayer.timeUntilPortal > 0) {
+ thePlayer.timeUntilPortal = 100;
+ } else if (thePlayer.dimension != Dimension_Australia.DIMID) {
+ thePlayer.timeUntilPortal = 100;
+ thePlayer
+ .mcServer
+ .getConfigurationManager()
+ .transferPlayerToDimension(
+ thePlayer,
+ Dimension_Australia.DIMID,
+ new AustraliaTeleporterDimensionMod(
+ thePlayer.mcServer.worldServerForDimension(Dimension_Australia.DIMID)));
+ } else {
+ thePlayer.timeUntilPortal = 100;
+ thePlayer
+ .mcServer
+ .getConfigurationManager()
+ .transferPlayerToDimension(
+ thePlayer,
+ 0,
+ new AustraliaTeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(0)));
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ /**
+ * A randomly called display update to be able to add particles or other items for display
+ */
+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
+ if (CORE.RANDOM.nextInt(100) == 0) {
+ par1World.playSound(
+ par2 + 0.5D,
+ par3 + 0.5D,
+ par4 + 0.5D,
+ "portal.portal",
+ 0.5F,
+ CORE.RANDOM.nextFloat() * 0.4F + 0.8F,
+ false);
+ }
+ for (int l = 0; l < 4; ++l) {
+ double d0 = par2 + CORE.RANDOM.nextFloat();
+ double d1 = par3 + CORE.RANDOM.nextFloat();
+ double d2 = par4 + CORE.RANDOM.nextFloat();
+ double d3 = 0.0D;
+ double d4 = 0.0D;
+ double d5 = 0.0D;
+ int i1 = CORE.RANDOM.nextInt(2) * 2 - 1;
+ d3 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
+ d4 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
+ d5 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
+ if (par1World.getBlock(par2 - 1, par3, par4) != this && par1World.getBlock(par2 + 1, par3, par4) != this) {
+ d0 = par2 + 0.5D + 0.25D * i1;
+ d3 = CORE.RANDOM.nextFloat() * 2.0F * i1;
+ } else {
+ d2 = par4 + 0.5D + 0.25D * i1;
+ d5 = CORE.RANDOM.nextFloat() * 2.0F * i1;
+ }
+ par1World.spawnParticle("reddust", d0 + 0.1D, d1, d2, d3, d4, d5);
+ par1World.spawnParticle("smoke", d0, d1 + 0.1D, d2, 0, 0, 0);
+
+ Random R = new Random();
+
+ if (R.nextInt(10) == 0) {
+ par1World.spawnParticle("largesmoke", d0, d1, d2, 0, 0 + 0.2D, 0);
+ } else if (R.nextInt(5) == 1) {
+ par1World.spawnParticle("flame", d0, d1, d2, 0, 0 + 0.1D, 0);
+ }
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ /**
+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
+ */
+ public int idPicked(World par1World, int par2, int par3, int par4) {
+ return 0;
+ }
+
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
+ return Utils.rgbtoHexValue(0, 255, 0);
+ }
+
+ @Override
+ public int getRenderColor(final int aMeta) {
+ return Utils.rgbtoHexValue(0, 255, 0);
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return EnumChatFormatting.OBFUSCATED + super.getLocalizedName();
+ }
+
+ @Override
+ public int getTooltipID() {
+ return 1;
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/australia/block/BlockAustraliaSand.java b/src/main/java/gtPlusPlus/australia/block/BlockAustraliaSand.java
index 62d443bc13..99a7a45668 100644
--- a/src/main/java/gtPlusPlus/australia/block/BlockAustraliaSand.java
+++ b/src/main/java/gtPlusPlus/australia/block/BlockAustraliaSand.java
@@ -1,25 +1,22 @@
package gtPlusPlus.australia.block;
import cpw.mods.fml.common.registry.LanguageRegistry;
-
-import net.minecraft.block.BlockGrass;
-import net.minecraft.block.BlockSand;
import gtPlusPlus.api.interfaces.ITileTooltip;
import gtPlusPlus.core.creative.AddToCreativeTab;
+import net.minecraft.block.BlockSand;
-public class BlockAustraliaSand extends BlockSand implements ITileTooltip{
-
- public BlockAustraliaSand() {
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setBlockName("blockAustralianSand");
- this.setHardness(0.1F);
- this.setBlockTextureName("minecraft" + ":" + "sand");
- LanguageRegistry.addName(this, "Sandy Earth");
- }
+public class BlockAustraliaSand extends BlockSand implements ITileTooltip {
- @Override
- public int getTooltipID() {
- return 2;
- }
+ public BlockAustraliaSand() {
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setBlockName("blockAustralianSand");
+ this.setHardness(0.1F);
+ this.setBlockTextureName("minecraft" + ":" + "sand");
+ LanguageRegistry.addName(this, "Sandy Earth");
+ }
+ @Override
+ public int getTooltipID() {
+ return 2;
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/block/BlockAustraliaTopSoil.java b/src/main/java/gtPlusPlus/australia/block/BlockAustraliaTopSoil.java
index 09c7dbf22d..80a4c4f001 100644
--- a/src/main/java/gtPlusPlus/australia/block/BlockAustraliaTopSoil.java
+++ b/src/main/java/gtPlusPlus/australia/block/BlockAustraliaTopSoil.java
@@ -3,74 +3,66 @@ package gtPlusPlus.australia.block;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.block.BlockDirt;
+import gtPlusPlus.api.interfaces.ITileTooltip;
import net.minecraft.block.BlockSand;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-
-public class BlockAustraliaTopSoil extends BlockSand implements ITileTooltip{
+public class BlockAustraliaTopSoil extends BlockSand implements ITileTooltip {
- public BlockAustraliaTopSoil() {
- this.setHardness(0.5F);
- this.setBlockTextureName("minecraft" + ":" + "dirt");
- this.setCreativeTab(CreativeTabs.tabBlock);
- this.setBlockName("blockAustralianTopSoil");
- LanguageRegistry.addName(this, "Desert Earth");
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getBlockColor()
- {
- double d0 = 0.5D;
- double d1 = 1.0D;
- return ColorizerGrass.getGrassColor(d0, d1);
- }
+ public BlockAustraliaTopSoil() {
+ this.setHardness(0.5F);
+ this.setBlockTextureName("minecraft" + ":" + "dirt");
+ this.setCreativeTab(CreativeTabs.tabBlock);
+ this.setBlockName("blockAustralianTopSoil");
+ LanguageRegistry.addName(this, "Desert Earth");
+ }
- /**
- * Returns the color this block should be rendered. Used by leaves.
- */
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderColor(int p_149741_1_)
- {
- return this.getBlockColor();
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getBlockColor() {
+ double d0 = 0.5D;
+ double d1 = 1.0D;
+ return ColorizerGrass.getGrassColor(d0, d1);
+ }
- /**
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
- * when first determining what to render.
- */
- @Override
- @SideOnly(Side.CLIENT)
- public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_)
- {
- int l = 0;
- int i1 = 0;
- int j1 = 0;
+ /**
+ * Returns the color this block should be rendered. Used by leaves.
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderColor(int p_149741_1_) {
+ return this.getBlockColor();
+ }
- for (int k1 = -1; k1 <= 1; ++k1)
- {
- for (int l1 = -1; l1 <= 1; ++l1)
- {
- int i2 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1).getBiomeGrassColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1);
- l += (i2 & 16711680) >> 16;
- i1 += (i2 & 65280) >> 8;
- j1 += i2 & 255;
- }
- }
+ /**
+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
+ * when first determining what to render.
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) {
+ int l = 0;
+ int i1 = 0;
+ int j1 = 0;
- return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255;
- }
+ for (int k1 = -1; k1 <= 1; ++k1) {
+ for (int l1 = -1; l1 <= 1; ++l1) {
+ int i2 = p_149720_1_
+ .getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1)
+ .getBiomeGrassColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1);
+ l += (i2 & 16711680) >> 16;
+ i1 += (i2 & 65280) >> 8;
+ j1 += i2 & 255;
+ }
+ }
- @Override
- public int getTooltipID() {
- return 3;
- }
+ return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255;
+ }
+ @Override
+ public int getTooltipID() {
+ return 3;
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/block/BlockDarkWorldPortalFrame.java b/src/main/java/gtPlusPlus/australia/block/BlockDarkWorldPortalFrame.java
index 1de7425f6a..34845f5266 100644
--- a/src/main/java/gtPlusPlus/australia/block/BlockDarkWorldPortalFrame.java
+++ b/src/main/java/gtPlusPlus/australia/block/BlockDarkWorldPortalFrame.java
@@ -1,30 +1,26 @@
package gtPlusPlus.australia.block;
import cpw.mods.fml.common.registry.LanguageRegistry;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-
import gtPlusPlus.api.interfaces.ITileTooltip;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
-public class BlockDarkWorldPortalFrame extends Block implements ITileTooltip{
-
- public BlockDarkWorldPortalFrame() {
- super(Material.iron);
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setBlockName("blockAustraliaPortalFrame");
- this.setHardness(3.0F);
- this.setLightLevel(0.5F);
- this.setBlockTextureName(CORE.MODID + ":" + "metro/TEXTURE_TECH_PANEL_A");
- LanguageRegistry.addName(this, "Containment Frame");
-
- }
-
- @Override
- public int getTooltipID() {
- return 0;
- }
-
+public class BlockDarkWorldPortalFrame extends Block implements ITileTooltip {
+
+ public BlockDarkWorldPortalFrame() {
+ super(Material.iron);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setBlockName("blockAustraliaPortalFrame");
+ this.setHardness(3.0F);
+ this.setLightLevel(0.5F);
+ this.setBlockTextureName(CORE.MODID + ":" + "metro/TEXTURE_TECH_PANEL_A");
+ LanguageRegistry.addName(this, "Containment Frame");
+ }
+
+ @Override
+ public int getTooltipID() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java b/src/main/java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java
index 07f5f969e2..5649cc4c78 100644
--- a/src/main/java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java
+++ b/src/main/java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java
@@ -3,14 +3,13 @@ package gtPlusPlus.australia.chunk;
import static net.minecraft.world.gen.structure.MapGenVillage.villageSpawnBiomes;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS;
+import cpw.mods.fml.common.eventhandler.Event.Result;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.australia.gen.map.MapGenLargeRavine;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
-
-import cpw.mods.fml.common.eventhandler.Event.Result;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.australia.gen.map.MapGenLargeRavine;
import net.minecraft.block.Block;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
@@ -38,784 +37,810 @@ import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.TerrainGen;
public class ChunkProviderAustralia extends ChunkProviderGenerate implements IChunkProvider {
- private Random rand;
- private NoiseGeneratorOctaves noiseGen1;
- private NoiseGeneratorOctaves noiseGen2;
- private NoiseGeneratorOctaves noiseGen3;
- private NoiseGeneratorPerlin noiseGen4;
- /**
- * Reference to the World object.
- */
- private World worldObj;
- private WorldType worldType;
- private final double[] field_147434_q;
- private final float[] parabolicField;
- private double[] stoneNoise = new double[256];
- private MapGenBase caveGenerator = new MapGenCaves();
- /**
- * Holds Stronghold Generator
- */
- // private MapGenStronghold strongholdGenerator = new
- // MapGenStronghold();
-
- /**
- * Holds Mineshaft Generator
- */
- private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
- private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
- /**
- * Holds ravine generator
- */
- private MapGenBase ravineGenerator = new MapGenLargeRavine();
- /**
- * The biomes that are used to generate the chunk
- */
- private BiomeGenBase[] biomesForGeneration;
- double[] doubleArray1;
- double[] doubleArray2;
- double[] doubleArray3;
- double[] doubleArray4;
-
- int[][] field_73219_j = new int[32][32];
- Map map;
-
- // Some Init Field?
- {
-
- try {
- List<BiomeGenBase> y = new ArrayList<BiomeGenBase>();
- if (!villageSpawnBiomes.isEmpty()) {
- y.addAll(villageSpawnBiomes);
- }
-
- for (BiomeGenBase h : gtPlusPlus.australia.gen.map.MapGenExtendedVillage.villageSpawnBiomes) {
- if (!y.contains(h)) {
- if (h instanceof BiomeGenBase) {
- try {
- y.add(h);
- }
- catch (Throwable t) {}
- }
- }
- }
- if (y.size() > villageSpawnBiomes.size()) {
- villageSpawnBiomes = y;
- }
- }
- catch (Throwable t) {}
-
- caveGenerator = TerrainGen.getModdedMapGen(caveGenerator,
- net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE);
- mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator,
- net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT);
- scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator,
- net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE);
- ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator,
- net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE);
- }
-
- public ChunkProviderAustralia(World par1World, long par2) {
- super(par1World, par2, true);
- this.worldObj = par1World;
- this.worldType = par1World.getWorldInfo().getTerrainType();
- this.rand = new Random(par2);
- this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
- this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
- this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
- this.noiseGen4 = new NoiseGeneratorPerlin(this.rand, 4);
- this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
- this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
- this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
- this.field_147434_q = new double[2500];
- this.parabolicField = new float[25];
- for (int j = -2; j <= 2; j++) {
- for (int k = -2; k <= 2; k++) {
- float f = 10.0F / MathHelper.sqrt_float(j * j + k * k + 0.2F);
- this.parabolicField[(j + 2 + (k + 2) * 5)] = f;
- }
- }
- NoiseGenerator[] noiseGens = { this.noiseGen1, this.noiseGen2, this.noiseGen3, this.noiseGen4, this.noiseGen5,
- this.noiseGen6, this.mobSpawnerNoise };
- noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);
- this.noiseGen1 = ((NoiseGeneratorOctaves) noiseGens[0]);
- this.noiseGen2 = ((NoiseGeneratorOctaves) noiseGens[1]);
- this.noiseGen3 = ((NoiseGeneratorOctaves) noiseGens[2]);
- this.noiseGen4 = ((NoiseGeneratorPerlin) noiseGens[3]);
- this.noiseGen5 = ((NoiseGeneratorOctaves) noiseGens[4]);
- this.noiseGen6 = ((NoiseGeneratorOctaves) noiseGens[5]);
- this.mobSpawnerNoise = ((NoiseGeneratorOctaves) noiseGens[6]);
- }
-
- public void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_) {
- byte b0 = 63;
- this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration,
- p_147424_1_ * 4 - 2, p_147424_2_ * 4 - 2, 10, 10);
-
- func_147423_a(p_147424_1_ * 4, 0, p_147424_2_ * 4);
- for (int k = 0; k < 4; k++) {
- int l = k * 5;
- int i1 = (k + 1) * 5;
- for (int j1 = 0; j1 < 4; j1++) {
- int k1 = (l + j1) * 33;
- int l1 = (l + j1 + 1) * 33;
- int i2 = (i1 + j1) * 33;
- int j2 = (i1 + j1 + 1) * 33;
- for (int k2 = 0; k2 < 32; k2++) {
- double d0 = 0.125D;
- double d1 = this.field_147434_q[(k1 + k2)];
- double d2 = this.field_147434_q[(l1 + k2)];
- double d3 = this.field_147434_q[(i2 + k2)];
- double d4 = this.field_147434_q[(j2 + k2)];
- double d5 = (this.field_147434_q[(k1 + k2 + 1)] - d1) * d0;
- double d6 = (this.field_147434_q[(l1 + k2 + 1)] - d2) * d0;
- double d7 = (this.field_147434_q[(i2 + k2 + 1)] - d3) * d0;
- double d8 = (this.field_147434_q[(j2 + k2 + 1)] - d4) * d0;
- for (int l2 = 0; l2 < 8; l2++) {
- double d9 = 0.25D;
- double d10 = d1;
- double d11 = d2;
- double d12 = (d3 - d1) * d9;
- double d13 = (d4 - d2) * d9;
- for (int i3 = 0; i3 < 4; i3++) {
- int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2;
- short short1 = 256;
- j3 -= short1;
- double d14 = 0.25D;
- double d16 = (d11 - d10) * d14;
- double d15 = d10 - d16;
- for (int k3 = 0; k3 < 4; k3++) {
- if ((d15 += d16) > 0.0D) {
- p_147424_3_[(j3 += short1)] = Blocks.stone;
- } else if (k2 * 8 + l2 < b0) {
- p_147424_3_[(j3 += short1)] = Blocks.water;
- } else {
- p_147424_3_[(j3 += short1)] = null;
- }
- }
- d10 += d12;
- d11 += d13;
- }
- d1 += d5;
- d2 += d6;
- d3 += d7;
- d4 += d8;
- }
- }
- }
- }
- }
-
- public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_,
- BiomeGenBase[] p_147422_5_) {
- ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_,
- p_147422_2_, p_147422_3_, p_147422_5_);
- MinecraftForge.EVENT_BUS.post(event);
- if (event.getResult() == Result.DENY) {
- return;
- }
- double d0 = 0.03125D;
- this.stoneNoise = this.noiseGen4.func_151599_a(this.stoneNoise, p_147422_1_ * 16, p_147422_2_ * 16, 16, 16,
- d0 * 2.0D, d0 * 2.0D, 1.0D);
- for (int k = 0; k < 16; k++) {
- for (int l = 0; l < 16; l++) {
- BiomeGenBase biomegenbase = p_147422_5_[(l + k * 16)];
- biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k,
- p_147422_2_ * 16 + l, this.stoneNoise[(l + k * 16)]);
- }
- }
- }
-
- /**
- * loads or generates the chunk at the chunk location specified
- */
- @Override
- public Chunk loadChunk(int par1, int par2) {
- return this.provideChunk(par1, par2);
- }
-
- /**
- * Will return back a chunk, if it doesn't exist and its not a MP client it will
- * generates all the blocks for the specified chunk from the map seed and chunk
- * seed
- */
- @Override
- public Chunk provideChunk(int x, int z) {
- try {
- Block[] ablock = new Block[65536];
- //generateTerrain(x, z, ablock);
- caveGenerator.func_151539_a(this, worldObj, x, z, ablock);
- ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return super.provideChunk(x, z);
- /*
- * rand.setSeed(x * 341873128712L + z * 132897987541L); Block[] ablock = new
- * Block[65536]; byte[] abyte = new byte[65536]; generateTerrain(x, z, ablock);
- * biomesForGeneration =
- * worldObj.getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, x
- * * 16, z * 16, 16, 16); replaceBlocksForBiome(x, z, ablock, abyte,
- * biomesForGeneration);
- *
- * caveGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * caveGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * //villageGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
- * mineshaftGenerator.func_151539_a(this, worldObj, x, z, ablock);
- *
- * Chunk chunk = new Chunk(worldObj, ablock, abyte, x, z); byte[] abyte1 =
- * chunk.getBiomeArray();
- *
- * for (int k = 0; k < abyte1.length; ++k) abyte1[k] =
- * (byte)biomesForGeneration[k].biomeID;
- *
- * chunk.generateSkylightMap(); return chunk;
- */
- }
-
- public void generateTerrain(int x, int z, Block[] par3BlockArray) {
- byte b0 = 63;
- biomesForGeneration = worldObj.getWorldChunkManager().getBiomesForGeneration(biomesForGeneration, x * 4 - 2,
- z * 4 - 2, 10, 10);
- generateNoise(x * 4, 0, z * 4);
-
- for (int k = 0; k < 4; ++k) {
- int l = k * 5;
- int i1 = (k + 1) * 5;
-
- for (int j1 = 0; j1 < 4; ++j1) {
- int k1 = (l + j1) * 33;
- int l1 = (l + j1 + 1) * 33;
- int i2 = (i1 + j1) * 33;
- int j2 = (i1 + j1 + 1) * 33;
-
- for (int k2 = 0; k2 < 32; ++k2) {
- double d0 = 0.125D;
- double d1 = field_147434_q[k1 + k2];
- double d2 = field_147434_q[l1 + k2];
- double d3 = field_147434_q[i2 + k2];
- double d4 = field_147434_q[j2 + k2];
- double d5 = (field_147434_q[k1 + k2 + 1] - d1) * d0;
- double d6 = (field_147434_q[l1 + k2 + 1] - d2) * d0;
- double d7 = (field_147434_q[i2 + k2 + 1] - d3) * d0;
- double d8 = (field_147434_q[j2 + k2 + 1] - d4) * d0;
-
- for (int l2 = 0; l2 < 8; ++l2) {
- double d9 = 0.25D;
- double d10 = d1;
- double d11 = d2;
- double d12 = (d3 - d1) * d9;
- double d13 = (d4 - d2) * d9;
-
- for (int i3 = 0; i3 < 4; ++i3) {
- int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2;
- short short1 = 256;
- j3 -= short1;
- double d14 = 0.25D;
- double d16 = (d11 - d10) * d14;
- double d15 = d10 - d16;
-
- for (int k3 = 0; k3 < 4; ++k3)
- if ((d15 += d16) > 0.0D)
- par3BlockArray[j3 += short1] = Blocks.stone;
- else if (k2 * 8 + l2 < b0)
- par3BlockArray[j3 += short1] = Blocks.water;
- else
- par3BlockArray[j3 += short1] = null;
-
- d10 += d12;
- d11 += d13;
- }
-
- d1 += d5;
- d2 += d6;
- d3 += d7;
- d4 += d8;
- }
- }
- }
- }
- }
-
- private void generateNoise(int x, int y, int z) {
- doubleArray4 = noiseGen6.generateNoiseOctaves(doubleArray4, x, z, 5, 5, 200.0D, 200.0D, 0.5D);
- doubleArray1 = noiseGen3.generateNoiseOctaves(doubleArray1, x, y, z, 5, 33, 5, 8.555150000000001D,
- 4.277575000000001D, 8.555150000000001D);
- doubleArray2 = noiseGen1.generateNoiseOctaves(doubleArray2, x, y, z, 5, 33, 5, 684.412D, 684.412D, 684.412D);
- doubleArray3 = noiseGen2.generateNoiseOctaves(doubleArray3, x, y, z, 5, 33, 5, 684.412D, 684.412D, 684.412D);
- int l = 0;
- int i1 = 0;
- for (int j1 = 0; j1 < 5; ++j1)
- for (int k1 = 0; k1 < 5; ++k1) {
- float f = 0.0F;
- float f1 = 0.0F;
- float f2 = 0.0F;
- byte b0 = 2;
- BiomeGenBase biomegenbase = biomesForGeneration[j1 + 2 + (k1 + 2) * 10];
-
- for (int l1 = -b0; l1 <= b0; ++l1)
- for (int i2 = -b0; i2 <= b0; ++i2) {
- BiomeGenBase biomegenbase1 = biomesForGeneration[j1 + l1 + 2 + (k1 + i2 + 2) * 10];
- float f3 = biomegenbase1.rootHeight;
- float f4 = biomegenbase1.heightVariation;
-
- if (worldType == WorldType.AMPLIFIED && f3 > 0.0F) {
- f3 = 1.0F + f3 * 2.0F;
- f4 = 1.0F + f4 * 4.0F;
- }
-
- float f5 = parabolicField[l1 + 2 + (i2 + 2) * 5] / (f3 + 2.0F);
-
- if (biomegenbase1.rootHeight > biomegenbase.rootHeight)
- f5 /= 2.0F;
-
- f += f4 * f5;
- f1 += f3 * f5;
- f2 += f5;
- }
-
- f /= f2;
- f1 /= f2;
- f = f * 0.9F + 0.1F;
- f1 = (f1 * 4.0F - 1.0F) / 8.0F;
- double d13 = doubleArray4[i1] / 8000.0D;
-
- if (d13 < 0.0D)
- d13 = -d13 * 0.3D;
-
- d13 = d13 * 3.0D - 2.0D;
-
- if (d13 < 0.0D) {
- d13 /= 2.0D;
-
- if (d13 < -1.0D)
- d13 = -1.0D;
-
- d13 /= 1.4D;
- d13 /= 2.0D;
- } else {
- if (d13 > 1.0D)
- d13 = 1.0D;
-
- d13 /= 8.0D;
- }
-
- ++i1;
- double d12 = f1;
- double d14 = f;
- d12 += d13 * 0.2D;
- d12 = d12 * 8.5D / 8.0D;
- double d5 = 8.5D + d12 * 4.0D;
-
- for (int j2 = 0; j2 < 33; ++j2) {
- double d6 = (j2 - d5) * 12.0D * 128.0D / 256.0D / d14;
-
- if (d6 < 0.0D)
- d6 *= 4.0D;
-
- double d7 = doubleArray2[l] / 512.0D;
- double d8 = doubleArray3[l] / 512.0D;
- double d9 = (doubleArray1[l] / 10.0D + 1.0D) / 2.0D;
- double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6;
-
- if (j2 > 29) {
- double d11 = (j2 - 29) / 3.0F;
- d10 = d10 * (1.0D - d11) + -10.0D * d11;
- }
-
- field_147434_q[l] = d10;
- ++l;
- }
- }
- }
-
- private void func_147423_a(int p_147423_1_, int p_147423_2_, int p_147423_3_) {
- double d0 = 684.412D;
- double d1 = 684.412D;
- double d2 = 512.0D;
- double d3 = 512.0D;
- this.doubleArray4 = this.noiseGen6.generateNoiseOctaves(this.doubleArray4, p_147423_1_, p_147423_3_, 5, 5,
- 200.0D, 200.0D, 0.5D);
- this.doubleArray1 = this.noiseGen3.generateNoiseOctaves(this.doubleArray1, p_147423_1_, p_147423_2_,
- p_147423_3_, 5, 33, 5, 8.555150000000001D, 4.277575000000001D, 8.555150000000001D);
-
- this.doubleArray2 = this.noiseGen1.generateNoiseOctaves(this.doubleArray2, p_147423_1_, p_147423_2_,
- p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D);
-
- this.doubleArray3 = this.noiseGen2.generateNoiseOctaves(this.doubleArray3, p_147423_1_, p_147423_2_,
- p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D);
-
- boolean flag1 = false;
- boolean flag = false;
- int l = 0;
- int i1 = 0;
- double d4 = 8.5D;
- for (int j1 = 0; j1 < 5; j1++) {
- for (int k1 = 0; k1 < 5; k1++) {
- float f = 0.0F;
- float f1 = 0.0F;
- float f2 = 0.0F;
- byte b0 = 2;
- BiomeGenBase biomegenbase = this.biomesForGeneration[(j1 + 2 + (k1 + 2) * 10)];
- for (int l1 = -b0; l1 <= b0; l1++) {
- for (int i2 = -b0; i2 <= b0; i2++) {
- BiomeGenBase biomegenbase1 = this.biomesForGeneration[(j1 + l1 + 2 + (k1 + i2 + 2) * 10)];
- float f3 = biomegenbase1.rootHeight;
- float f4 = biomegenbase1.heightVariation;
- if ((this.worldType == WorldType.AMPLIFIED) && (f3 > 0.0F)) {
- f3 = 1.0F + f3 * 2.0F;
- f4 = 1.0F + f4 * 4.0F;
- }
- float f5 = this.parabolicField[(l1 + 2 + (i2 + 2) * 5)] / (f3 + 2.0F);
- if (biomegenbase1.rootHeight > biomegenbase.rootHeight) {
- f5 /= 2.0F;
- }
- f += f4 * f5;
- f1 += f3 * f5;
- f2 += f5;
- }
- }
- f /= f2;
- f1 /= f2;
- f = f * 0.9F + 0.1F;
- f1 = (f1 * 4.0F - 1.0F) / 8.0F;
- double d13 = this.doubleArray4[i1] / 8000.0D;
- if (d13 < 0.0D) {
- d13 = -d13 * 0.3D;
- }
- d13 = d13 * 3.0D - 2.0D;
- if (d13 < 0.0D) {
- d13 /= 2.0D;
- if (d13 < -1.0D) {
- d13 = -1.0D;
- }
- d13 /= 1.4D;
- d13 /= 2.0D;
- } else {
- if (d13 > 1.0D) {
- d13 = 1.0D;
- }
- d13 /= 8.0D;
- }
- i1++;
- double d12 = f1;
- double d14 = f;
- d12 += d13 * 0.2D;
- d12 = d12 * 8.5D / 8.0D;
- double d5 = 8.5D + d12 * 4.0D;
- for (int j2 = 0; j2 < 33; j2++) {
- double d6 = (j2 - d5) * 12.0D * 128.0D / 256.0D / d14;
- if (d6 < 0.0D) {
- d6 *= 4.0D;
- }
- double d7 = this.doubleArray2[l] / 512.0D;
- double d8 = this.doubleArray3[l] / 512.0D;
- double d9 = (this.doubleArray1[l] / 10.0D + 1.0D) / 2.0D;
- double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6;
- if (j2 > 29) {
- double d11 = (j2 - 29) / 3.0F;
- d10 = d10 * (1.0D - d11) + -10.0D * d11;
- }
- this.field_147434_q[l] = d10;
- l++;
- }
- }
- }
- }
-
- /**
- * Checks to see if a chunk exists at x, y
- */
- @Override
- public boolean chunkExists(int par1, int par2) {
- return super.chunkExists(par1, par2);
- }
-
- /**
- * Populates chunk with ores etc etc
- */
- @Override
- public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
-
- if (this.worldObj.getChunkFromChunkCoords(par2, par3) != null) {
- super.populate(par1IChunkProvider, par2, par3);
- try {
- //Maybe Custom stuff?
- boolean doGen = false;
- boolean flag = false;
- int k1;
- int l1;
- int i2;
- int x = par2 * 16;
- int z = par3 * 16;
- BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(x + 16, z + 16);
- MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));
- doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON);
- for (k1 = 0; doGen && k1 < 8; ++k1) {
- l1 = x + this.rand.nextInt(16) + 8;
- i2 = this.rand.nextInt(256);
- int j2 = z + this.rand.nextInt(16) + 8;
- (new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2);
- }
-
- if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, ANIMALS)) {
- SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, x + 8, z + 8, 16, 16, this.rand);
- SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, x + 8, z + 8, 16, 16, this.rand);
- }
- MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
-
-
- /*boolean generateStructures = true;
-
- BlockFalling.fallInstantly = true;
- int x = par2 * 16;
- int z = par3 * 16;
- BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(x + 16, z + 16);
- this.rand.setSeed(this.worldObj.getSeed());
- long i1 = this.rand.nextLong() / 2L * 2L + 1L;
- long j1 = this.rand.nextLong() / 2L * 2L + 1L;
- this.rand.setSeed(par2 * i1 + par3 * j1 ^ this.worldObj.getSeed());
- boolean flag = false;
-
- MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));
-
- if (generateStructures) {
- this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
- // flag = this.villageGenerator.generateStructuresInChunk(this.worldObj,
- // this.rand, par2, par3);
- this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
- }
-
- int k1;
- int l1;
- int i2;
-
- if (generateStructures) {
- if (generateStructures) {
- // No specific liquid dimlets specified: we generate default lakes (water and
- // lava were appropriate).
- if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag
- && this.rand.nextInt(4) == 0
- && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag,
- net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE)) {
- k1 = x + this.rand.nextInt(16) + 8;
- l1 = this.rand.nextInt(256);
- i2 = z + this.rand.nextInt(16) + 8;
- (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2);
- }
-
- if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag,
- net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA) && !flag
- && this.rand.nextInt(8) == 0) {
- k1 = x + this.rand.nextInt(16) + 8;
- l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
- i2 = z + this.rand.nextInt(16) + 8;
-
- if (l1 < 63 || this.rand.nextInt(10) == 0) {
- (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2);
- }
- }
- }
- * else { // Generate lakes for the specified biomes. for (Block liquid :
- * dimensionInformation.getFluidsForLakes()) { if (!flag && this.rand.nextInt(4)
- * == 0 && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3,
- * flag,
- * net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.
- * LAKE)) { k1 = x + this.rand.nextInt(16) + 8; l1 = this.rand.nextInt(256); i2
- * = z + this.rand.nextInt(16) + 8; (new
- * WorldGenLakes(liquid)).generate(this.worldObj, this.rand, k1, l1, i2); } } }
-
- }
-
- boolean doGen = false;
- if (generateStructures) {
- doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag,
- net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON);
- for (k1 = 0; doGen && k1 < 8; ++k1) {
- l1 = x + this.rand.nextInt(16) + 8;
- i2 = this.rand.nextInt(256);
- int j2 = z + this.rand.nextInt(16) + 8;
- (new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2);
- }
- }
-
- biomegenbase.decorate(this.worldObj, this.rand, x, z);
- if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, ANIMALS)) {
- SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, x + 8, z + 8, 16, 16, this.rand);
- }
- x += 8;
- z += 8;
-
- doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag,
- net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE);
- for (k1 = 0; doGen && k1 < 16; ++k1) {
- for (l1 = 0; l1 < 16; ++l1) {
- i2 = this.worldObj.getPrecipitationHeight(x + k1, z + l1);
-
- if (this.worldObj.isBlockFreezable(k1 + x, i2 - 1, l1 + z)) {
- this.worldObj.setBlock(k1 + x, i2 - 1, l1 + z, Blocks.ice, 0, 2);
- }
-
- if (this.worldObj.func_147478_e(k1 + x, i2, l1 + z, true)) {
- this.worldObj.setBlock(k1 + x, i2, l1 + z, Blocks.snow_layer, 0, 2);
- }
- }
- }
-
- MinecraftForge.EVENT_BUS
- .post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
-
- BlockFalling.fallInstantly = false;*/
- // super.populate(par1IChunkProvider, par2, par3);
- /*
- * net.minecraft.block.BlockFalling.fallInstantly = false; int k = par2 * 16;
- * int l = par3 * 16; BiomeGenBase biomegenbase =
- * this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
- * this.rand.setSeed(this.worldObj.getSeed()); long i1 = this.rand.nextLong() /
- * 2L * 2L + 1L; long j1 = this.rand.nextLong() / 2L * 2L + 1L;
- * this.rand.setSeed(par2 * i1 + par3 * j1 ^ this.worldObj.getSeed()); boolean
- * flag = false;
- *
- * MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider,
- * this.worldObj, this.rand, par2, par3, flag));
- *
- *
- * this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand,
- * par2, par3); flag =
- * this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand,
- * par2, par3);
- * this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj,
- * this.rand, par2, par3); if (flag) { Logger.INFO("Did Generate? "+flag); }
- * else {
- * //Logger.INFO("Can village spawn here? "+villageGenerator.villageSpawnBiomes.
- * contains(biomegenbase)); }
- *
- *
- * if ((biomegenbase != BiomeGenBase.desert) && (biomegenbase !=
- * BiomeGenBase.desertHills) && (!flag)) { if ((this.rand.nextInt(4) == 0) &&
- * (TerrainGen.populate(par1IChunkProvider, this.worldObj, this.rand, par2,
- * par3, flag, PopulateChunkEvent.Populate.EventType.LAKE))) { int k1 = k +
- * this.rand.nextInt(16) + 8; int l1 = this.rand.nextInt(256); int i2 = l +
- * this.rand.nextInt(16) + 8; new
- * WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, k1, l1, i2); }
- * } if ((TerrainGen.populate(par1IChunkProvider, this.worldObj, this.rand,
- * par2, par3, flag, PopulateChunkEvent.Populate.EventType.LAVA)) && (!flag) &&
- * (this.rand.nextInt(8) == 0)) { int k1 = k + this.rand.nextInt(16) + 8; int l1
- * = this.rand.nextInt(this.rand.nextInt(248) + 8); int i2 = l +
- * this.rand.nextInt(16) + 8; if ((l1 < 63) || (this.rand.nextInt(10) == 0)) {
- * new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, k1, l1,
- * i2); } } int var4 = par2 * 16; int var5 = par3 * 16;
- *
- * biomegenbase.decorate(this.worldObj, this.rand, k, l);
- * SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l
- * + 8, 16, 16, this.rand); if (TerrainGen.populate(this, worldObj, rand, par2,
- * par3, flag, ANIMALS)) { SpawnerAnimals.performWorldGenSpawning(this.worldObj,
- * biomegenbase, k + 8, l + 8, 16, 16, this.rand); } k += 8; l += 8;
- *
- * MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider,
- * this.worldObj, this.rand, par2, par3, flag));
- *
- * net.minecraft.block.BlockFalling.fallInstantly = false;
- */
- }
-
- /**
- * Two modes of operation: if passed true, save all Chunks in one go. If passed
- * false, save up to two chunks. Return true if all chunks have been saved.
- */
- @Override
- public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) {
- return super.saveChunks(par1, par2IProgressUpdate);
- }
-
- /**
- * Save extra data not associated with any Chunk. Not saved during autosave,
- * only during world unload. Currently unimplemented.
- */
- @Override
- public void saveExtraData() {
- super.saveExtraData();
- }
-
- /**
- * Unloads chunks that are marked to be unloaded. This is not guaranteed to
- * unload every such chunk.
- */
- @Override
- public boolean unloadQueuedChunks() {
- return super.unloadQueuedChunks();
- }
-
- /**
- * Returns if the IChunkProvider supports saving.
- */
- @Override
- public boolean canSave() {
- return super.canSave();
- }
-
- /**
- * Converts the instance data to a readable string.
- */
- @Override
- public String makeString() {
- return "RandomLevelSource";
- }
-
- /**
- * Returns a list of creatures of the specified type that can spawn at the given
- * location.
- */
- @SuppressWarnings("rawtypes")
- @Override
- public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) {
- BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(par2, par4);
- return (par1EnumCreatureType == EnumCreatureType.monster)
- && (this.scatteredFeatureGenerator.func_143030_a(par2, par3, par4))
- ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList()
- : biomegenbase.getSpawnableList(par1EnumCreatureType);
- }
-
- @Override
- public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_,
- int p_147416_5_) {
- Logger.INFO("func_147416_a: " + p_147416_2_);
- return super.func_147416_a(p_147416_1_, p_147416_2_, p_147416_3_, p_147416_4_, p_147416_5_);
- /*
- * return "ExtendedVillage".equals(p_147416_2_) && this.villageGenerator != null
- * ? this.villageGenerator.func_151545_a(p_147416_1_, p_147416_3_, p_147416_4_,
- * p_147416_5_) : null;
- */
- }
-
- @Override
- public int getLoadedChunkCount() {
- return super.getLoadedChunkCount();
- }
-
- @Override
- public void recreateStructures(int par1, int par2) {
- super.recreateStructures(par1, par2);
- // this.mineshaftGenerator.func_151539_a(this, this.worldObj, par1, par2,
- // (Block[])null);
- // this.villageGenerator.func_151539_a(this, this.worldObj, par1, par2,
- // (Block[])null);
- // this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, par1, par2,
- // (Block[])null);
-
- }
-} \ No newline at end of file
+ private Random rand;
+ private NoiseGeneratorOctaves noiseGen1;
+ private NoiseGeneratorOctaves noiseGen2;
+ private NoiseGeneratorOctaves noiseGen3;
+ private NoiseGeneratorPerlin noiseGen4;
+ /**
+ * Reference to the World object.
+ */
+ private World worldObj;
+
+ private WorldType worldType;
+ private final double[] field_147434_q;
+ private final float[] parabolicField;
+ private double[] stoneNoise = new double[256];
+ private MapGenBase caveGenerator = new MapGenCaves();
+ /**
+ * Holds Stronghold Generator
+ */
+ // private MapGenStronghold strongholdGenerator = new
+ // MapGenStronghold();
+
+ /**
+ * Holds Mineshaft Generator
+ */
+ private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
+
+ private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
+ /**
+ * Holds ravine generator
+ */
+ private MapGenBase ravineGenerator = new MapGenLargeRavine();
+ /**
+ * The biomes that are used to generate the chunk
+ */
+ private BiomeGenBase[] biomesForGeneration;
+
+ double[] doubleArray1;
+ double[] doubleArray2;
+ double[] doubleArray3;
+ double[] doubleArray4;
+
+ int[][] field_73219_j = new int[32][32];
+ Map map;
+
+ // Some Init Field?
+ {
+ try {
+ List<BiomeGenBase> y = new ArrayList<BiomeGenBase>();
+ if (!villageSpawnBiomes.isEmpty()) {
+ y.addAll(villageSpawnBiomes);
+ }
+
+ for (BiomeGenBase h : gtPlusPlus.australia.gen.map.MapGenExtendedVillage.villageSpawnBiomes) {
+ if (!y.contains(h)) {
+ if (h instanceof BiomeGenBase) {
+ try {
+ y.add(h);
+ } catch (Throwable t) {
+ }
+ }
+ }
+ }
+ if (y.size() > villageSpawnBiomes.size()) {
+ villageSpawnBiomes = y;
+ }
+ } catch (Throwable t) {
+ }
+
+ caveGenerator = TerrainGen.getModdedMapGen(
+ caveGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE);
+ mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(
+ mineshaftGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT);
+ scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(
+ scatteredFeatureGenerator,
+ net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE);
+ ravineGenerator = TerrainGen.getModdedMapGen(
+ ravineGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE);
+ }
+
+ public ChunkProviderAustralia(World par1World, long par2) {
+ super(par1World, par2, true);
+ this.worldObj = par1World;
+ this.worldType = par1World.getWorldInfo().getTerrainType();
+ this.rand = new Random(par2);
+ this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
+ this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
+ this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
+ this.noiseGen4 = new NoiseGeneratorPerlin(this.rand, 4);
+ this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
+ this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
+ this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
+ this.field_147434_q = new double[2500];
+ this.parabolicField = new float[25];
+ for (int j = -2; j <= 2; j++) {
+ for (int k = -2; k <= 2; k++) {
+ float f = 10.0F / MathHelper.sqrt_float(j * j + k * k + 0.2F);
+ this.parabolicField[(j + 2 + (k + 2) * 5)] = f;
+ }
+ }
+ NoiseGenerator[] noiseGens = {
+ this.noiseGen1,
+ this.noiseGen2,
+ this.noiseGen3,
+ this.noiseGen4,
+ this.noiseGen5,
+ this.noiseGen6,
+ this.mobSpawnerNoise
+ };
+ noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);
+ this.noiseGen1 = ((NoiseGeneratorOctaves) noiseGens[0]);
+ this.noiseGen2 = ((NoiseGeneratorOctaves) noiseGens[1]);
+ this.noiseGen3 = ((NoiseGeneratorOctaves) noiseGens[2]);
+ this.noiseGen4 = ((NoiseGeneratorPerlin) noiseGens[3]);
+ this.noiseGen5 = ((NoiseGeneratorOctaves) noiseGens[4]);
+ this.noiseGen6 = ((NoiseGeneratorOctaves) noiseGens[5]);
+ this.mobSpawnerNoise = ((NoiseGeneratorOctaves) noiseGens[6]);
+ }
+
+ public void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_) {
+ byte b0 = 63;
+ this.biomesForGeneration = this.worldObj
+ .getWorldChunkManager()
+ .getBiomesForGeneration(this.biomesForGeneration, p_147424_1_ * 4 - 2, p_147424_2_ * 4 - 2, 10, 10);
+
+ func_147423_a(p_147424_1_ * 4, 0, p_147424_2_ * 4);
+ for (int k = 0; k < 4; k++) {
+ int l = k * 5;
+ int i1 = (k + 1) * 5;
+ for (int j1 = 0; j1 < 4; j1++) {
+ int k1 = (l + j1) * 33;
+ int l1 = (l + j1 + 1) * 33;
+ int i2 = (i1 + j1) * 33;
+ int j2 = (i1 + j1 + 1) * 33;
+ for (int k2 = 0; k2 < 32; k2++) {
+ double d0 = 0.125D;
+ double d1 = this.field_147434_q[(k1 + k2)];
+ double d2 = this.field_147434_q[(l1 + k2)];
+ double d3 = this.field_147434_q[(i2 + k2)];
+ double d4 = this.field_147434_q[(j2 + k2)];
+ double d5 = (this.field_147434_q[(k1 + k2 + 1)] - d1) * d0;
+ double d6 = (this.field_147434_q[(l1 + k2 + 1)] - d2) * d0;
+ double d7 = (this.field_147434_q[(i2 + k2 + 1)] - d3) * d0;
+ double d8 = (this.field_147434_q[(j2 + k2 + 1)] - d4) * d0;
+ for (int l2 = 0; l2 < 8; l2++) {
+ double d9 = 0.25D;
+ double d10 = d1;
+ double d11 = d2;
+ double d12 = (d3 - d1) * d9;
+ double d13 = (d4 - d2) * d9;
+ for (int i3 = 0; i3 < 4; i3++) {
+ int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2;
+ short short1 = 256;
+ j3 -= short1;
+ double d14 = 0.25D;
+ double d16 = (d11 - d10) * d14;
+ double d15 = d10 - d16;
+ for (int k3 = 0; k3 < 4; k3++) {
+ if ((d15 += d16) > 0.0D) {
+ p_147424_3_[(j3 += short1)] = Blocks.stone;
+ } else if (k2 * 8 + l2 < b0) {
+ p_147424_3_[(j3 += short1)] = Blocks.water;
+ } else {
+ p_147424_3_[(j3 += short1)] = null;
+ }
+ }
+ d10 += d12;
+ d11 += d13;
+ }
+ d1 += d5;
+ d2 += d6;
+ d3 += d7;
+ d4 += d8;
+ }
+ }
+ }
+ }
+ }
+
+ public void replaceBlocksForBiome(
+ int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) {
+ ChunkProviderEvent.ReplaceBiomeBlocks event =
+ new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_5_);
+ MinecraftForge.EVENT_BUS.post(event);
+ if (event.getResult() == Result.DENY) {
+ return;
+ }
+ double d0 = 0.03125D;
+ this.stoneNoise = this.noiseGen4.func_151599_a(
+ this.stoneNoise, p_147422_1_ * 16, p_147422_2_ * 16, 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);
+ for (int k = 0; k < 16; k++) {
+ for (int l = 0; l < 16; l++) {
+ BiomeGenBase biomegenbase = p_147422_5_[(l + k * 16)];
+ biomegenbase.genTerrainBlocks(
+ this.worldObj,
+ this.rand,
+ p_147422_3_,
+ p_147422_4_,
+ p_147422_1_ * 16 + k,
+ p_147422_2_ * 16 + l,
+ this.stoneNoise[(l + k * 16)]);
+ }
+ }
+ }
+
+ /**
+ * loads or generates the chunk at the chunk location specified
+ */
+ @Override
+ public Chunk loadChunk(int par1, int par2) {
+ return this.provideChunk(par1, par2);
+ }
+
+ /**
+ * Will return back a chunk, if it doesn't exist and its not a MP client it will
+ * generates all the blocks for the specified chunk from the map seed and chunk
+ * seed
+ */
+ @Override
+ public Chunk provideChunk(int x, int z) {
+ try {
+ Block[] ablock = new Block[65536];
+ // generateTerrain(x, z, ablock);
+ caveGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return super.provideChunk(x, z);
+ /*
+ * rand.setSeed(x * 341873128712L + z * 132897987541L); Block[] ablock = new
+ * Block[65536]; byte[] abyte = new byte[65536]; generateTerrain(x, z, ablock);
+ * biomesForGeneration =
+ * worldObj.getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, x
+ * * 16, z * 16, 16, 16); replaceBlocksForBiome(x, z, ablock, abyte,
+ * biomesForGeneration);
+ *
+ * caveGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * caveGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * ravineGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * //villageGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ * mineshaftGenerator.func_151539_a(this, worldObj, x, z, ablock);
+ *
+ * Chunk chunk = new Chunk(worldObj, ablock, abyte, x, z); byte[] abyte1 =
+ * chunk.getBiomeArray();
+ *
+ * for (int k = 0; k < abyte1.length; ++k) abyte1[k] =
+ * (byte)biomesForGeneration[k].biomeID;
+ *
+ * chunk.generateSkylightMap(); return chunk;
+ */
+ }
+
+ public void generateTerrain(int x, int z, Block[] par3BlockArray) {
+ byte b0 = 63;
+ biomesForGeneration = worldObj.getWorldChunkManager()
+ .getBiomesForGeneration(biomesForGeneration, x * 4 - 2, z * 4 - 2, 10, 10);
+ generateNoise(x * 4, 0, z * 4);
+
+ for (int k = 0; k < 4; ++k) {
+ int l = k * 5;
+ int i1 = (k + 1) * 5;
+
+ for (int j1 = 0; j1 < 4; ++j1) {
+ int k1 = (l + j1) * 33;
+ int l1 = (l + j1 + 1) * 33;
+ int i2 = (i1 + j1) * 33;
+ int j2 = (i1 + j1 + 1) * 33;
+
+ for (int k2 = 0; k2 < 32; ++k2) {
+ double d0 = 0.125D;
+ double d1 = field_147434_q[k1 + k2];
+ double d2 = field_147434_q[l1 + k2];
+ double d3 = field_147434_q[i2 + k2];
+ double d4 = field_147434_q[j2 + k2];
+ double d5 = (field_147434_q[k1 + k2 + 1] - d1) * d0;
+ double d6 = (field_147434_q[l1 + k2 + 1] - d2) * d0;
+ double d7 = (field_147434_q[i2 + k2 + 1] - d3) * d0;
+ double d8 = (field_147434_q[j2 + k2 + 1] - d4) * d0;
+
+ for (int l2 = 0; l2 < 8; ++l2) {
+ double d9 = 0.25D;
+ double d10 = d1;
+ double d11 = d2;
+ double d12 = (d3 - d1) * d9;
+ double d13 = (d4 - d2) * d9;
+
+ for (int i3 = 0; i3 < 4; ++i3) {
+ int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2;
+ short short1 = 256;
+ j3 -= short1;
+ double d14 = 0.25D;
+ double d16 = (d11 - d10) * d14;
+ double d15 = d10 - d16;
+
+ for (int k3 = 0; k3 < 4; ++k3)
+ if ((d15 += d16) > 0.0D) par3BlockArray[j3 += short1] = Blocks.stone;
+ else if (k2 * 8 + l2 < b0) par3BlockArray[j3 += short1] = Blocks.water;
+ else par3BlockArray[j3 += short1] = null;
+
+ d10 += d12;
+ d11 += d13;
+ }
+
+ d1 += d5;
+ d2 += d6;
+ d3 += d7;
+ d4 += d8;
+ }
+ }
+ }
+ }
+ }
+
+ private void generateNoise(int x, int y, int z) {
+ doubleArray4 = noiseGen6.generateNoiseOctaves(doubleArray4, x, z, 5, 5, 200.0D, 200.0D, 0.5D);
+ doubleArray1 = noiseGen3.generateNoiseOctaves(
+ doubleArray1, x, y, z, 5, 33, 5, 8.555150000000001D, 4.277575000000001D, 8.555150000000001D);
+ doubleArray2 = noiseGen1.generateNoiseOctaves(doubleArray2, x, y, z, 5, 33, 5, 684.412D, 684.412D, 684.412D);
+ doubleArray3 = noiseGen2.generateNoiseOctaves(doubleArray3, x, y, z, 5, 33, 5, 684.412D, 684.412D, 684.412D);
+ int l = 0;
+ int i1 = 0;
+ for (int j1 = 0; j1 < 5; ++j1)
+ for (int k1 = 0; k1 < 5; ++k1) {
+ float f = 0.0F;
+ float f1 = 0.0F;
+ float f2 = 0.0F;
+ byte b0 = 2;
+ BiomeGenBase biomegenbase = biomesForGeneration[j1 + 2 + (k1 + 2) * 10];
+
+ for (int l1 = -b0; l1 <= b0; ++l1)
+ for (int i2 = -b0; i2 <= b0; ++i2) {
+ BiomeGenBase biomegenbase1 = biomesForGeneration[j1 + l1 + 2 + (k1 + i2 + 2) * 10];
+ float f3 = biomegenbase1.rootHeight;
+ float f4 = biomegenbase1.heightVariation;
+
+ if (worldType == WorldType.AMPLIFIED && f3 > 0.0F) {
+ f3 = 1.0F + f3 * 2.0F;
+ f4 = 1.0F + f4 * 4.0F;
+ }
+
+ float f5 = parabolicField[l1 + 2 + (i2 + 2) * 5] / (f3 + 2.0F);
+
+ if (biomegenbase1.rootHeight > biomegenbase.rootHeight) f5 /= 2.0F;
+
+ f += f4 * f5;
+ f1 += f3 * f5;
+ f2 += f5;
+ }
+
+ f /= f2;
+ f1 /= f2;
+ f = f * 0.9F + 0.1F;
+ f1 = (f1 * 4.0F - 1.0F) / 8.0F;
+ double d13 = doubleArray4[i1] / 8000.0D;
+
+ if (d13 < 0.0D) d13 = -d13 * 0.3D;
+
+ d13 = d13 * 3.0D - 2.0D;
+
+ if (d13 < 0.0D) {
+ d13 /= 2.0D;
+
+ if (d13 < -1.0D) d13 = -1.0D;
+
+ d13 /= 1.4D;
+ d13 /= 2.0D;
+ } else {
+ if (d13 > 1.0D) d13 = 1.0D;
+
+ d13 /= 8.0D;
+ }
+
+ ++i1;
+ double d12 = f1;
+ double d14 = f;
+ d12 += d13 * 0.2D;
+ d12 = d12 * 8.5D / 8.0D;
+ double d5 = 8.5D + d12 * 4.0D;
+
+ for (int j2 = 0; j2 < 33; ++j2) {
+ double d6 = (j2 - d5) * 12.0D * 128.0D / 256.0D / d14;
+
+ if (d6 < 0.0D) d6 *= 4.0D;
+
+ double d7 = doubleArray2[l] / 512.0D;
+ double d8 = doubleArray3[l] / 512.0D;
+ double d9 = (doubleArray1[l] / 10.0D + 1.0D) / 2.0D;
+ double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6;
+
+ if (j2 > 29) {
+ double d11 = (j2 - 29) / 3.0F;
+ d10 = d10 * (1.0D - d11) + -10.0D * d11;
+ }
+
+ field_147434_q[l] = d10;
+ ++l;
+ }
+ }
+ }
+
+ private void func_147423_a(int p_147423_1_, int p_147423_2_, int p_147423_3_) {
+ double d0 = 684.412D;
+ double d1 = 684.412D;
+ double d2 = 512.0D;
+ double d3 = 512.0D;
+ this.doubleArray4 = this.noiseGen6.generateNoiseOctaves(
+ this.doubleArray4, p_147423_1_, p_147423_3_, 5, 5, 200.0D, 200.0D, 0.5D);
+ this.doubleArray1 = this.noiseGen3.generateNoiseOctaves(
+ this.doubleArray1,
+ p_147423_1_,
+ p_147423_2_,
+ p_147423_3_,
+ 5,
+ 33,
+ 5,
+ 8.555150000000001D,
+ 4.277575000000001D,
+ 8.555150000000001D);
+
+ this.doubleArray2 = this.noiseGen1.generateNoiseOctaves(
+ this.doubleArray2, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D);
+
+ this.doubleArray3 = this.noiseGen2.generateNoiseOctaves(
+ this.doubleArray3, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D);
+
+ boolean flag1 = false;
+ boolean flag = false;
+ int l = 0;
+ int i1 = 0;
+ double d4 = 8.5D;
+ for (int j1 = 0; j1 < 5; j1++) {
+ for (int k1 = 0; k1 < 5; k1++) {
+ float f = 0.0F;
+ float f1 = 0.0F;
+ float f2 = 0.0F;
+ byte b0 = 2;
+ BiomeGenBase biomegenbase = this.biomesForGeneration[(j1 + 2 + (k1 + 2) * 10)];
+ for (int l1 = -b0; l1 <= b0; l1++) {
+ for (int i2 = -b0; i2 <= b0; i2++) {
+ BiomeGenBase biomegenbase1 = this.biomesForGeneration[(j1 + l1 + 2 + (k1 + i2 + 2) * 10)];
+ float f3 = biomegenbase1.rootHeight;
+ float f4 = biomegenbase1.heightVariation;
+ if ((this.worldType == WorldType.AMPLIFIED) && (f3 > 0.0F)) {
+ f3 = 1.0F + f3 * 2.0F;
+ f4 = 1.0F + f4 * 4.0F;
+ }
+ float f5 = this.parabolicField[(l1 + 2 + (i2 + 2) * 5)] / (f3 + 2.0F);
+ if (biomegenbase1.rootHeight > biomegenbase.rootHeight) {
+ f5 /= 2.0F;
+ }
+ f += f4 * f5;
+ f1 += f3 * f5;
+ f2 += f5;
+ }
+ }
+ f /= f2;
+ f1 /= f2;
+ f = f * 0.9F + 0.1F;
+ f1 = (f1 * 4.0F - 1.0F) / 8.0F;
+ double d13 = this.doubleArray4[i1] / 8000.0D;
+ if (d13 < 0.0D) {
+ d13 = -d13 * 0.3D;
+ }
+ d13 = d13 * 3.0D - 2.0D;
+ if (d13 < 0.0D) {
+ d13 /= 2.0D;
+ if (d13 < -1.0D) {
+ d13 = -1.0D;
+ }
+ d13 /= 1.4D;
+ d13 /= 2.0D;
+ } else {
+ if (d13 > 1.0D) {
+ d13 = 1.0D;
+ }
+ d13 /= 8.0D;
+ }
+ i1++;
+ double d12 = f1;
+ double d14 = f;
+ d12 += d13 * 0.2D;
+ d12 = d12 * 8.5D / 8.0D;
+ double d5 = 8.5D + d12 * 4.0D;
+ for (int j2 = 0; j2 < 33; j2++) {
+ double d6 = (j2 - d5) * 12.0D * 128.0D / 256.0D / d14;
+ if (d6 < 0.0D) {
+ d6 *= 4.0D;
+ }
+ double d7 = this.doubleArray2[l] / 512.0D;
+ double d8 = this.doubleArray3[l] / 512.0D;
+ double d9 = (this.doubleArray1[l] / 10.0D + 1.0D) / 2.0D;
+ double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6;
+ if (j2 > 29) {
+ double d11 = (j2 - 29) / 3.0F;
+ d10 = d10 * (1.0D - d11) + -10.0D * d11;
+ }
+ this.field_147434_q[l] = d10;
+ l++;
+ }
+ }
+ }
+ }
+
+ /**
+ * Checks to see if a chunk exists at x, y
+ */
+ @Override
+ public boolean chunkExists(int par1, int par2) {
+ return super.chunkExists(par1, par2);
+ }
+
+ /**
+ * Populates chunk with ores etc etc
+ */
+ @Override
+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
+
+ if (this.worldObj.getChunkFromChunkCoords(par2, par3) != null) {
+ super.populate(par1IChunkProvider, par2, par3);
+ try {
+ // Maybe Custom stuff?
+ boolean doGen = false;
+ boolean flag = false;
+ int k1;
+ int l1;
+ int i2;
+ int x = par2 * 16;
+ int z = par3 * 16;
+ BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(x + 16, z + 16);
+ MinecraftForge.EVENT_BUS.post(
+ new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));
+ doGen = TerrainGen.populate(
+ par1IChunkProvider,
+ worldObj,
+ rand,
+ par2,
+ par3,
+ flag,
+ net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON);
+ for (k1 = 0; doGen && k1 < 8; ++k1) {
+ l1 = x + this.rand.nextInt(16) + 8;
+ i2 = this.rand.nextInt(256);
+ int j2 = z + this.rand.nextInt(16) + 8;
+ (new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2);
+ }
+
+ if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, ANIMALS)) {
+ SpawnerAnimals.performWorldGenSpawning(
+ this.worldObj, biomegenbase, x + 8, z + 8, 16, 16, this.rand);
+ SpawnerAnimals.performWorldGenSpawning(
+ this.worldObj, biomegenbase, x + 8, z + 8, 16, 16, this.rand);
+ }
+ MinecraftForge.EVENT_BUS.post(
+ new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ /*boolean generateStructures = true;
+
+ BlockFalling.fallInstantly = true;
+ int x = par2 * 16;
+ int z = par3 * 16;
+ BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(x + 16, z + 16);
+ this.rand.setSeed(this.worldObj.getSeed());
+ long i1 = this.rand.nextLong() / 2L * 2L + 1L;
+ long j1 = this.rand.nextLong() / 2L * 2L + 1L;
+ this.rand.setSeed(par2 * i1 + par3 * j1 ^ this.worldObj.getSeed());
+ boolean flag = false;
+
+ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));
+
+ if (generateStructures) {
+ this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
+ // flag = this.villageGenerator.generateStructuresInChunk(this.worldObj,
+ // this.rand, par2, par3);
+ this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
+ }
+
+ int k1;
+ int l1;
+ int i2;
+
+ if (generateStructures) {
+ if (generateStructures) {
+ // No specific liquid dimlets specified: we generate default lakes (water and
+ // lava were appropriate).
+ if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag
+ && this.rand.nextInt(4) == 0
+ && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag,
+ net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE)) {
+ k1 = x + this.rand.nextInt(16) + 8;
+ l1 = this.rand.nextInt(256);
+ i2 = z + this.rand.nextInt(16) + 8;
+ (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2);
+ }
+
+ if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag,
+ net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA) && !flag
+ && this.rand.nextInt(8) == 0) {
+ k1 = x + this.rand.nextInt(16) + 8;
+ l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
+ i2 = z + this.rand.nextInt(16) + 8;
+
+ if (l1 < 63 || this.rand.nextInt(10) == 0) {
+ (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2);
+ }
+ }
+ }
+ * else { // Generate lakes for the specified biomes. for (Block liquid :
+ * dimensionInformation.getFluidsForLakes()) { if (!flag && this.rand.nextInt(4)
+ * == 0 && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3,
+ * flag,
+ * net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.
+ * LAKE)) { k1 = x + this.rand.nextInt(16) + 8; l1 = this.rand.nextInt(256); i2
+ * = z + this.rand.nextInt(16) + 8; (new
+ * WorldGenLakes(liquid)).generate(this.worldObj, this.rand, k1, l1, i2); } } }
+
+ }
+
+ boolean doGen = false;
+ if (generateStructures) {
+ doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag,
+ net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON);
+ for (k1 = 0; doGen && k1 < 8; ++k1) {
+ l1 = x + this.rand.nextInt(16) + 8;
+ i2 = this.rand.nextInt(256);
+ int j2 = z + this.rand.nextInt(16) + 8;
+ (new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2);
+ }
+ }
+
+ biomegenbase.decorate(this.worldObj, this.rand, x, z);
+ if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, ANIMALS)) {
+ SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, x + 8, z + 8, 16, 16, this.rand);
+ }
+ x += 8;
+ z += 8;
+
+ doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag,
+ net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE);
+ for (k1 = 0; doGen && k1 < 16; ++k1) {
+ for (l1 = 0; l1 < 16; ++l1) {
+ i2 = this.worldObj.getPrecipitationHeight(x + k1, z + l1);
+
+ if (this.worldObj.isBlockFreezable(k1 + x, i2 - 1, l1 + z)) {
+ this.worldObj.setBlock(k1 + x, i2 - 1, l1 + z, Blocks.ice, 0, 2);
+ }
+
+ if (this.worldObj.func_147478_e(k1 + x, i2, l1 + z, true)) {
+ this.worldObj.setBlock(k1 + x, i2, l1 + z, Blocks.snow_layer, 0, 2);
+ }
+ }
+ }
+
+ MinecraftForge.EVENT_BUS
+ .post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
+
+ BlockFalling.fallInstantly = false;*/
+ // super.populate(par1IChunkProvider, par2, par3);
+ /*
+ * net.minecraft.block.BlockFalling.fallInstantly = false; int k = par2 * 16;
+ * int l = par3 * 16; BiomeGenBase biomegenbase =
+ * this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
+ * this.rand.setSeed(this.worldObj.getSeed()); long i1 = this.rand.nextLong() /
+ * 2L * 2L + 1L; long j1 = this.rand.nextLong() / 2L * 2L + 1L;
+ * this.rand.setSeed(par2 * i1 + par3 * j1 ^ this.worldObj.getSeed()); boolean
+ * flag = false;
+ *
+ * MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider,
+ * this.worldObj, this.rand, par2, par3, flag));
+ *
+ *
+ * this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand,
+ * par2, par3); flag =
+ * this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand,
+ * par2, par3);
+ * this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj,
+ * this.rand, par2, par3); if (flag) { Logger.INFO("Did Generate? "+flag); }
+ * else {
+ * //Logger.INFO("Can village spawn here? "+villageGenerator.villageSpawnBiomes.
+ * contains(biomegenbase)); }
+ *
+ *
+ * if ((biomegenbase != BiomeGenBase.desert) && (biomegenbase !=
+ * BiomeGenBase.desertHills) && (!flag)) { if ((this.rand.nextInt(4) == 0) &&
+ * (TerrainGen.populate(par1IChunkProvider, this.worldObj, this.rand, par2,
+ * par3, flag, PopulateChunkEvent.Populate.EventType.LAKE))) { int k1 = k +
+ * this.rand.nextInt(16) + 8; int l1 = this.rand.nextInt(256); int i2 = l +
+ * this.rand.nextInt(16) + 8; new
+ * WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, k1, l1, i2); }
+ * } if ((TerrainGen.populate(par1IChunkProvider, this.worldObj, this.rand,
+ * par2, par3, flag, PopulateChunkEvent.Populate.EventType.LAVA)) && (!flag) &&
+ * (this.rand.nextInt(8) == 0)) { int k1 = k + this.rand.nextInt(16) + 8; int l1
+ * = this.rand.nextInt(this.rand.nextInt(248) + 8); int i2 = l +
+ * this.rand.nextInt(16) + 8; if ((l1 < 63) || (this.rand.nextInt(10) == 0)) {
+ * new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, k1, l1,
+ * i2); } } int var4 = par2 * 16; int var5 = par3 * 16;
+ *
+ * biomegenbase.decorate(this.worldObj, this.rand, k, l);
+ * SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l
+ * + 8, 16, 16, this.rand); if (TerrainGen.populate(this, worldObj, rand, par2,
+ * par3, flag, ANIMALS)) { SpawnerAnimals.performWorldGenSpawning(this.worldObj,
+ * biomegenbase, k + 8, l + 8, 16, 16, this.rand); } k += 8; l += 8;
+ *
+ * MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider,
+ * this.worldObj, this.rand, par2, par3, flag));
+ *
+ * net.minecraft.block.BlockFalling.fallInstantly = false;
+ */
+ }
+
+ /**
+ * Two modes of operation: if passed true, save all Chunks in one go. If passed
+ * false, save up to two chunks. Return true if all chunks have been saved.
+ */
+ @Override
+ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) {
+ return super.saveChunks(par1, par2IProgressUpdate);
+ }
+
+ /**
+ * Save extra data not associated with any Chunk. Not saved during autosave,
+ * only during world unload. Currently unimplemented.
+ */
+ @Override
+ public void saveExtraData() {
+ super.saveExtraData();
+ }
+
+ /**
+ * Unloads chunks that are marked to be unloaded. This is not guaranteed to
+ * unload every such chunk.
+ */
+ @Override
+ public boolean unloadQueuedChunks() {
+ return super.unloadQueuedChunks();
+ }
+
+ /**
+ * Returns if the IChunkProvider supports saving.
+ */
+ @Override
+ public boolean canSave() {
+ return super.canSave();
+ }
+
+ /**
+ * Converts the instance data to a readable string.
+ */
+ @Override
+ public String makeString() {
+ return "RandomLevelSource";
+ }
+
+ /**
+ * Returns a list of creatures of the specified type that can spawn at the given
+ * location.
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) {
+ BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(par2, par4);
+ return (par1EnumCreatureType == EnumCreatureType.monster)
+ && (this.scatteredFeatureGenerator.func_143030_a(par2, par3, par4))
+ ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList()
+ : biomegenbase.getSpawnableList(par1EnumCreatureType);
+ }
+
+ @Override
+ public ChunkPosition func_147416_a(
+ World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) {
+ Logger.INFO("func_147416_a: " + p_147416_2_);
+ return super.func_147416_a(p_147416_1_, p_147416_2_, p_147416_3_, p_147416_4_, p_147416_5_);
+ /*
+ * return "ExtendedVillage".equals(p_147416_2_) && this.villageGenerator != null
+ * ? this.villageGenerator.func_151545_a(p_147416_1_, p_147416_3_, p_147416_4_,
+ * p_147416_5_) : null;
+ */
+ }
+
+ @Override
+ public int getLoadedChunkCount() {
+ return super.getLoadedChunkCount();
+ }
+
+ @Override
+ public void recreateStructures(int par1, int par2) {
+ super.recreateStructures(par1, par2);
+ // this.mineshaftGenerator.func_151539_a(this, this.worldObj, par1, par2,
+ // (Block[])null);
+ // this.villageGenerator.func_151539_a(this, this.worldObj, par1, par2,
+ // (Block[])null);
+ // this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, par1, par2,
+ // (Block[])null);
+
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/dimension/Dimension_Australia.java b/src/main/java/gtPlusPlus/australia/dimension/Dimension_Australia.java
index ff9e81085d..f08fa2585a 100644
--- a/src/main/java/gtPlusPlus/australia/dimension/Dimension_Australia.java
+++ b/src/main/java/gtPlusPlus/australia/dimension/Dimension_Australia.java
@@ -1,23 +1,22 @@
package gtPlusPlus.australia.dimension;
-import net.minecraft.block.Block;
import gtPlusPlus.australia.block.BlockAustraliaPortal;
import gtPlusPlus.australia.item.ItemAustraliaPortalTrigger;
import gtPlusPlus.australia.world.AustraliaWorldProvider;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.Block;
import net.minecraftforge.common.DimensionManager;
public class Dimension_Australia {
- public Object instance;
- public static int DIMID = CORE.AUSTRALIA_ID;
- public static BlockAustraliaPortal portalBlock;
- public static ItemAustraliaPortalTrigger portalItem;
- public static Block blockPortalFrame;
-
- public void load() {
- DimensionManager.registerProviderType(DIMID, AustraliaWorldProvider.class, false);
- DimensionManager.registerDimension(DIMID, DIMID);
- }
+ public Object instance;
+ public static int DIMID = CORE.AUSTRALIA_ID;
+ public static BlockAustraliaPortal portalBlock;
+ public static ItemAustraliaPortalTrigger portalItem;
+ public static Block blockPortalFrame;
+ public void load() {
+ DimensionManager.registerProviderType(DIMID, AustraliaWorldProvider.class, false);
+ DimensionManager.registerDimension(DIMID, DIMID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/entity/model/ModelAustralianSpider.java b/src/main/java/gtPlusPlus/australia/entity/model/ModelAustralianSpider.java
index 05b43b7558..c9ab30bc4f 100644
--- a/src/main/java/gtPlusPlus/australia/entity/model/ModelAustralianSpider.java
+++ b/src/main/java/gtPlusPlus/australia/entity/model/ModelAustralianSpider.java
@@ -10,139 +10,150 @@ import net.minecraft.util.MathHelper;
@SideOnly(Side.CLIENT)
public class ModelAustralianSpider extends ModelBase {
- /** The spider's head box */
- public ModelRenderer spiderHead;
- /** The spider's neck box */
- public ModelRenderer spiderNeck;
- /** The spider's body box */
- public ModelRenderer spiderBody;
- /** Spider's first leg */
- public ModelRenderer spiderLeg1;
- /** Spider's second leg */
- public ModelRenderer spiderLeg2;
- /** Spider's third leg */
- public ModelRenderer spiderLeg3;
- /** Spider's fourth leg */
- public ModelRenderer spiderLeg4;
- /** Spider's fifth leg */
- public ModelRenderer spiderLeg5;
- /** Spider's sixth leg */
- public ModelRenderer spiderLeg6;
- /** Spider's seventh leg */
- public ModelRenderer spiderLeg7;
- /** Spider's eight leg */
- public ModelRenderer spiderLeg8;
+ /** The spider's head box */
+ public ModelRenderer spiderHead;
+ /** The spider's neck box */
+ public ModelRenderer spiderNeck;
+ /** The spider's body box */
+ public ModelRenderer spiderBody;
+ /** Spider's first leg */
+ public ModelRenderer spiderLeg1;
+ /** Spider's second leg */
+ public ModelRenderer spiderLeg2;
+ /** Spider's third leg */
+ public ModelRenderer spiderLeg3;
+ /** Spider's fourth leg */
+ public ModelRenderer spiderLeg4;
+ /** Spider's fifth leg */
+ public ModelRenderer spiderLeg5;
+ /** Spider's sixth leg */
+ public ModelRenderer spiderLeg6;
+ /** Spider's seventh leg */
+ public ModelRenderer spiderLeg7;
+ /** Spider's eight leg */
+ public ModelRenderer spiderLeg8;
- public ModelAustralianSpider() {
- float f = 0.0F;
- byte b0 = 15;
- this.spiderHead = new ModelRenderer(this, 32, 4);
- this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, f);
- this.spiderHead.setRotationPoint(0.0F, (float) b0, -3.0F);
- this.spiderNeck = new ModelRenderer(this, 0, 0);
- this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, f);
- this.spiderNeck.setRotationPoint(0.0F, (float) b0, 0.0F);
- this.spiderBody = new ModelRenderer(this, 0, 12);
- this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, f);
- this.spiderBody.setRotationPoint(0.0F, (float) b0, 9.0F);
- this.spiderLeg1 = new ModelRenderer(this, 18, 0);
- this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f);
- this.spiderLeg1.setRotationPoint(-4.0F, (float) b0, 2.0F);
- this.spiderLeg2 = new ModelRenderer(this, 18, 0);
- this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f);
- this.spiderLeg2.setRotationPoint(4.0F, (float) b0, 2.0F);
- this.spiderLeg3 = new ModelRenderer(this, 18, 0);
- this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f);
- this.spiderLeg3.setRotationPoint(-4.0F, (float) b0, 1.0F);
- this.spiderLeg4 = new ModelRenderer(this, 18, 0);
- this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f);
- this.spiderLeg4.setRotationPoint(4.0F, (float) b0, 1.0F);
- this.spiderLeg5 = new ModelRenderer(this, 18, 0);
- this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f);
- this.spiderLeg5.setRotationPoint(-4.0F, (float) b0, 0.0F);
- this.spiderLeg6 = new ModelRenderer(this, 18, 0);
- this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f);
- this.spiderLeg6.setRotationPoint(4.0F, (float) b0, 0.0F);
- this.spiderLeg7 = new ModelRenderer(this, 18, 0);
- this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f);
- this.spiderLeg7.setRotationPoint(-4.0F, (float) b0, -1.0F);
- this.spiderLeg8 = new ModelRenderer(this, 18, 0);
- this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f);
- this.spiderLeg8.setRotationPoint(4.0F, (float) b0, -1.0F);
- }
+ public ModelAustralianSpider() {
+ float f = 0.0F;
+ byte b0 = 15;
+ this.spiderHead = new ModelRenderer(this, 32, 4);
+ this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, f);
+ this.spiderHead.setRotationPoint(0.0F, (float) b0, -3.0F);
+ this.spiderNeck = new ModelRenderer(this, 0, 0);
+ this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, f);
+ this.spiderNeck.setRotationPoint(0.0F, (float) b0, 0.0F);
+ this.spiderBody = new ModelRenderer(this, 0, 12);
+ this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, f);
+ this.spiderBody.setRotationPoint(0.0F, (float) b0, 9.0F);
+ this.spiderLeg1 = new ModelRenderer(this, 18, 0);
+ this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f);
+ this.spiderLeg1.setRotationPoint(-4.0F, (float) b0, 2.0F);
+ this.spiderLeg2 = new ModelRenderer(this, 18, 0);
+ this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f);
+ this.spiderLeg2.setRotationPoint(4.0F, (float) b0, 2.0F);
+ this.spiderLeg3 = new ModelRenderer(this, 18, 0);
+ this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f);
+ this.spiderLeg3.setRotationPoint(-4.0F, (float) b0, 1.0F);
+ this.spiderLeg4 = new ModelRenderer(this, 18, 0);
+ this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f);
+ this.spiderLeg4.setRotationPoint(4.0F, (float) b0, 1.0F);
+ this.spiderLeg5 = new ModelRenderer(this, 18, 0);
+ this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f);
+ this.spiderLeg5.setRotationPoint(-4.0F, (float) b0, 0.0F);
+ this.spiderLeg6 = new ModelRenderer(this, 18, 0);
+ this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f);
+ this.spiderLeg6.setRotationPoint(4.0F, (float) b0, 0.0F);
+ this.spiderLeg7 = new ModelRenderer(this, 18, 0);
+ this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f);
+ this.spiderLeg7.setRotationPoint(-4.0F, (float) b0, -1.0F);
+ this.spiderLeg8 = new ModelRenderer(this, 18, 0);
+ this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f);
+ this.spiderLeg8.setRotationPoint(4.0F, (float) b0, -1.0F);
+ }
- /**
- * Sets the models various rotation angles then renders the model.
- */
- public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
- float p_78088_6_, float p_78088_7_) {
- this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
- this.spiderHead.render(p_78088_7_);
- this.spiderNeck.render(p_78088_7_);
- this.spiderBody.render(p_78088_7_);
- this.spiderLeg1.render(p_78088_7_);
- this.spiderLeg2.render(p_78088_7_);
- this.spiderLeg3.render(p_78088_7_);
- this.spiderLeg4.render(p_78088_7_);
- this.spiderLeg5.render(p_78088_7_);
- this.spiderLeg6.render(p_78088_7_);
- this.spiderLeg7.render(p_78088_7_);
- this.spiderLeg8.render(p_78088_7_);
- }
+ /**
+ * Sets the models various rotation angles then renders the model.
+ */
+ public void render(
+ Entity p_78088_1_,
+ float p_78088_2_,
+ float p_78088_3_,
+ float p_78088_4_,
+ float p_78088_5_,
+ float p_78088_6_,
+ float p_78088_7_) {
+ this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
+ this.spiderHead.render(p_78088_7_);
+ this.spiderNeck.render(p_78088_7_);
+ this.spiderBody.render(p_78088_7_);
+ this.spiderLeg1.render(p_78088_7_);
+ this.spiderLeg2.render(p_78088_7_);
+ this.spiderLeg3.render(p_78088_7_);
+ this.spiderLeg4.render(p_78088_7_);
+ this.spiderLeg5.render(p_78088_7_);
+ this.spiderLeg6.render(p_78088_7_);
+ this.spiderLeg7.render(p_78088_7_);
+ this.spiderLeg8.render(p_78088_7_);
+ }
- /**
- * Sets the model's various rotation angles. For bipeds, par1 and par2 are used
- * for animating the movement of arms and legs, where par1 represents the
- * time(so that arms and legs swing back and forth) and par2 represents how
- * "far" arms and legs can swing at most.
- */
- public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
- float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
- this.spiderHead.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
- this.spiderHead.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
- float f6 = ((float) Math.PI / 4F);
- this.spiderLeg1.rotateAngleZ = -f6;
- this.spiderLeg2.rotateAngleZ = f6;
- this.spiderLeg3.rotateAngleZ = -f6 * 0.74F;
- this.spiderLeg4.rotateAngleZ = f6 * 0.74F;
- this.spiderLeg5.rotateAngleZ = -f6 * 0.74F;
- this.spiderLeg6.rotateAngleZ = f6 * 0.74F;
- this.spiderLeg7.rotateAngleZ = -f6;
- this.spiderLeg8.rotateAngleZ = f6;
- float f7 = -0.0F;
- float f8 = 0.3926991F;
- this.spiderLeg1.rotateAngleY = f8 * 2.0F + f7;
- this.spiderLeg2.rotateAngleY = -f8 * 2.0F - f7;
- this.spiderLeg3.rotateAngleY = f8 * 1.0F + f7;
- this.spiderLeg4.rotateAngleY = -f8 * 1.0F - f7;
- this.spiderLeg5.rotateAngleY = -f8 * 1.0F + f7;
- this.spiderLeg6.rotateAngleY = f8 * 1.0F - f7;
- this.spiderLeg7.rotateAngleY = -f8 * 2.0F + f7;
- this.spiderLeg8.rotateAngleY = f8 * 2.0F - f7;
- float f9 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + 0.0F) * 0.4F) * p_78087_2_;
- float f10 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + (float) Math.PI) * 0.4F) * p_78087_2_;
- float f11 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + ((float) Math.PI / 2F)) * 0.4F) * p_78087_2_;
- float f12 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + ((float) Math.PI * 3F / 2F)) * 0.4F) * p_78087_2_;
- float f13 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + 0.0F) * 0.4F) * p_78087_2_;
- float f14 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + (float) Math.PI) * 0.4F) * p_78087_2_;
- float f15 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + ((float) Math.PI / 2F)) * 0.4F) * p_78087_2_;
- float f16 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + ((float) Math.PI * 3F / 2F)) * 0.4F) * p_78087_2_;
- this.spiderLeg1.rotateAngleY += f9;
- this.spiderLeg2.rotateAngleY += -f9;
- this.spiderLeg3.rotateAngleY += f10;
- this.spiderLeg4.rotateAngleY += -f10;
- this.spiderLeg5.rotateAngleY += f11;
- this.spiderLeg6.rotateAngleY += -f11;
- this.spiderLeg7.rotateAngleY += f12;
- this.spiderLeg8.rotateAngleY += -f12;
- this.spiderLeg1.rotateAngleZ += f13;
- this.spiderLeg2.rotateAngleZ += -f13;
- this.spiderLeg3.rotateAngleZ += f14;
- this.spiderLeg4.rotateAngleZ += -f14;
- this.spiderLeg5.rotateAngleZ += f15;
- this.spiderLeg6.rotateAngleZ += -f15;
- this.spiderLeg7.rotateAngleZ += f16;
- this.spiderLeg8.rotateAngleZ += -f16;
- }
-
-} \ No newline at end of file
+ /**
+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used
+ * for animating the movement of arms and legs, where par1 represents the
+ * time(so that arms and legs swing back and forth) and par2 represents how
+ * "far" arms and legs can swing at most.
+ */
+ public void setRotationAngles(
+ float p_78087_1_,
+ float p_78087_2_,
+ float p_78087_3_,
+ float p_78087_4_,
+ float p_78087_5_,
+ float p_78087_6_,
+ Entity p_78087_7_) {
+ this.spiderHead.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
+ this.spiderHead.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
+ float f6 = ((float) Math.PI / 4F);
+ this.spiderLeg1.rotateAngleZ = -f6;
+ this.spiderLeg2.rotateAngleZ = f6;
+ this.spiderLeg3.rotateAngleZ = -f6 * 0.74F;
+ this.spiderLeg4.rotateAngleZ = f6 * 0.74F;
+ this.spiderLeg5.rotateAngleZ = -f6 * 0.74F;
+ this.spiderLeg6.rotateAngleZ = f6 * 0.74F;
+ this.spiderLeg7.rotateAngleZ = -f6;
+ this.spiderLeg8.rotateAngleZ = f6;
+ float f7 = -0.0F;
+ float f8 = 0.3926991F;
+ this.spiderLeg1.rotateAngleY = f8 * 2.0F + f7;
+ this.spiderLeg2.rotateAngleY = -f8 * 2.0F - f7;
+ this.spiderLeg3.rotateAngleY = f8 * 1.0F + f7;
+ this.spiderLeg4.rotateAngleY = -f8 * 1.0F - f7;
+ this.spiderLeg5.rotateAngleY = -f8 * 1.0F + f7;
+ this.spiderLeg6.rotateAngleY = f8 * 1.0F - f7;
+ this.spiderLeg7.rotateAngleY = -f8 * 2.0F + f7;
+ this.spiderLeg8.rotateAngleY = f8 * 2.0F - f7;
+ float f9 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + 0.0F) * 0.4F) * p_78087_2_;
+ float f10 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + (float) Math.PI) * 0.4F) * p_78087_2_;
+ float f11 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + ((float) Math.PI / 2F)) * 0.4F) * p_78087_2_;
+ float f12 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + ((float) Math.PI * 3F / 2F)) * 0.4F) * p_78087_2_;
+ float f13 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + 0.0F) * 0.4F) * p_78087_2_;
+ float f14 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + (float) Math.PI) * 0.4F) * p_78087_2_;
+ float f15 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + ((float) Math.PI / 2F)) * 0.4F) * p_78087_2_;
+ float f16 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + ((float) Math.PI * 3F / 2F)) * 0.4F) * p_78087_2_;
+ this.spiderLeg1.rotateAngleY += f9;
+ this.spiderLeg2.rotateAngleY += -f9;
+ this.spiderLeg3.rotateAngleY += f10;
+ this.spiderLeg4.rotateAngleY += -f10;
+ this.spiderLeg5.rotateAngleY += f11;
+ this.spiderLeg6.rotateAngleY += -f11;
+ this.spiderLeg7.rotateAngleY += f12;
+ this.spiderLeg8.rotateAngleY += -f12;
+ this.spiderLeg1.rotateAngleZ += f13;
+ this.spiderLeg2.rotateAngleZ += -f13;
+ this.spiderLeg3.rotateAngleZ += f14;
+ this.spiderLeg4.rotateAngleZ += -f14;
+ this.spiderLeg5.rotateAngleZ += f15;
+ this.spiderLeg6.rotateAngleZ += -f15;
+ this.spiderLeg7.rotateAngleZ += f16;
+ this.spiderLeg8.rotateAngleZ += -f16;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/model/ModelBoar.java b/src/main/java/gtPlusPlus/australia/entity/model/ModelBoar.java
index 7d858e39f0..3d1a5b5ef7 100644
--- a/src/main/java/gtPlusPlus/australia/entity/model/ModelBoar.java
+++ b/src/main/java/gtPlusPlus/australia/entity/model/ModelBoar.java
@@ -6,15 +6,14 @@ import net.minecraft.client.model.ModelQuadruped;
@SideOnly(Side.CLIENT)
public class ModelBoar extends ModelQuadruped {
-
- public ModelBoar() {
- this(0.0F);
- }
- public ModelBoar(float p_i1151_1_) {
- super(6, p_i1151_1_);
- this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, p_i1151_1_);
- this.field_78145_g = 4.0F;
- }
-
-} \ No newline at end of file
+ public ModelBoar() {
+ this(0.0F);
+ }
+
+ public ModelBoar(float p_i1151_1_) {
+ super(6, p_i1151_1_);
+ this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, p_i1151_1_);
+ this.field_78145_g = 4.0F;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/model/ModelDingo.java b/src/main/java/gtPlusPlus/australia/entity/model/ModelDingo.java
index 2999cdf2dd..51bce24794 100644
--- a/src/main/java/gtPlusPlus/australia/entity/model/ModelDingo.java
+++ b/src/main/java/gtPlusPlus/australia/entity/model/ModelDingo.java
@@ -12,157 +12,168 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class ModelDingo extends ModelBase {
-
- /** main box for the dingo head */
- public ModelRenderer dingoHeadMain;
- /** The dingo's body */
- public ModelRenderer dingoBody;
- /** dingo'se first leg */
- public ModelRenderer dingoLeg1;
- /** dingo's second leg */
- public ModelRenderer dingoLeg2;
- /** dingo's third leg */
- public ModelRenderer dingoLeg3;
- /** dingo's fourth leg */
- public ModelRenderer dingoLeg4;
- /** The dingo's tail */
- ModelRenderer dingoTail;
- /** The dingo's mane */
- ModelRenderer dingoMane;
- public ModelDingo() {
- float f = 0.0F;
- float f1 = 13.5F;
- this.dingoHeadMain = new ModelRenderer(this, 0, 0);
- this.dingoHeadMain.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4, f);
- this.dingoHeadMain.setRotationPoint(-1.0F, f1, -7.0F);
- this.dingoBody = new ModelRenderer(this, 18, 14);
- this.dingoBody.addBox(-4.0F, -2.0F, -3.0F, 6, 9, 6, f);
- this.dingoBody.setRotationPoint(0.0F, 14.0F, 2.0F);
- this.dingoMane = new ModelRenderer(this, 21, 0);
- this.dingoMane.addBox(-4.0F, -3.0F, -3.0F, 8, 6, 7, f);
- this.dingoMane.setRotationPoint(-1.0F, 14.0F, 2.0F);
- this.dingoLeg1 = new ModelRenderer(this, 0, 18);
- this.dingoLeg1.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
- this.dingoLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
- this.dingoLeg2 = new ModelRenderer(this, 0, 18);
- this.dingoLeg2.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
- this.dingoLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
- this.dingoLeg3 = new ModelRenderer(this, 0, 18);
- this.dingoLeg3.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
- this.dingoLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
- this.dingoLeg4 = new ModelRenderer(this, 0, 18);
- this.dingoLeg4.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
- this.dingoLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
- this.dingoTail = new ModelRenderer(this, 9, 18);
- this.dingoTail.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
- this.dingoTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
- this.dingoHeadMain.setTextureOffset(16, 14).addBox(-3.0F, -5.0F, 0.0F, 2, 2, 1, f);
- this.dingoHeadMain.setTextureOffset(16, 14).addBox(1.0F, -5.0F, 0.0F, 2, 2, 1, f);
- this.dingoHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, f);
- }
+ /** main box for the dingo head */
+ public ModelRenderer dingoHeadMain;
+ /** The dingo's body */
+ public ModelRenderer dingoBody;
+ /** dingo'se first leg */
+ public ModelRenderer dingoLeg1;
+ /** dingo's second leg */
+ public ModelRenderer dingoLeg2;
+ /** dingo's third leg */
+ public ModelRenderer dingoLeg3;
+ /** dingo's fourth leg */
+ public ModelRenderer dingoLeg4;
+ /** The dingo's tail */
+ ModelRenderer dingoTail;
+ /** The dingo's mane */
+ ModelRenderer dingoMane;
- /**
- * Sets the models various rotation angles then renders the model.
- */
- public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
- float p_78088_6_, float p_78088_7_) {
- super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_);
- this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
+ public ModelDingo() {
+ float f = 0.0F;
+ float f1 = 13.5F;
+ this.dingoHeadMain = new ModelRenderer(this, 0, 0);
+ this.dingoHeadMain.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4, f);
+ this.dingoHeadMain.setRotationPoint(-1.0F, f1, -7.0F);
+ this.dingoBody = new ModelRenderer(this, 18, 14);
+ this.dingoBody.addBox(-4.0F, -2.0F, -3.0F, 6, 9, 6, f);
+ this.dingoBody.setRotationPoint(0.0F, 14.0F, 2.0F);
+ this.dingoMane = new ModelRenderer(this, 21, 0);
+ this.dingoMane.addBox(-4.0F, -3.0F, -3.0F, 8, 6, 7, f);
+ this.dingoMane.setRotationPoint(-1.0F, 14.0F, 2.0F);
+ this.dingoLeg1 = new ModelRenderer(this, 0, 18);
+ this.dingoLeg1.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
+ this.dingoLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
+ this.dingoLeg2 = new ModelRenderer(this, 0, 18);
+ this.dingoLeg2.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
+ this.dingoLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
+ this.dingoLeg3 = new ModelRenderer(this, 0, 18);
+ this.dingoLeg3.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
+ this.dingoLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
+ this.dingoLeg4 = new ModelRenderer(this, 0, 18);
+ this.dingoLeg4.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
+ this.dingoLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
+ this.dingoTail = new ModelRenderer(this, 9, 18);
+ this.dingoTail.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
+ this.dingoTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
+ this.dingoHeadMain.setTextureOffset(16, 14).addBox(-3.0F, -5.0F, 0.0F, 2, 2, 1, f);
+ this.dingoHeadMain.setTextureOffset(16, 14).addBox(1.0F, -5.0F, 0.0F, 2, 2, 1, f);
+ this.dingoHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, f);
+ }
- if (this.isChild) {
- float f6 = 2.0F;
- GL11.glPushMatrix();
- GL11.glTranslatef(0.0F, 5.0F * p_78088_7_, 2.0F * p_78088_7_);
- this.dingoHeadMain.renderWithRotation(p_78088_7_);
- GL11.glPopMatrix();
- GL11.glPushMatrix();
- GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
- GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F);
- this.dingoBody.render(p_78088_7_);
- this.dingoLeg1.render(p_78088_7_);
- this.dingoLeg2.render(p_78088_7_);
- this.dingoLeg3.render(p_78088_7_);
- this.dingoLeg4.render(p_78088_7_);
- this.dingoTail.renderWithRotation(p_78088_7_);
- this.dingoMane.render(p_78088_7_);
- GL11.glPopMatrix();
- } else {
- this.dingoHeadMain.renderWithRotation(p_78088_7_);
- this.dingoBody.render(p_78088_7_);
- this.dingoLeg1.render(p_78088_7_);
- this.dingoLeg2.render(p_78088_7_);
- this.dingoLeg3.render(p_78088_7_);
- this.dingoLeg4.render(p_78088_7_);
- this.dingoTail.renderWithRotation(p_78088_7_);
- this.dingoMane.render(p_78088_7_);
- }
- }
+ /**
+ * Sets the models various rotation angles then renders the model.
+ */
+ public void render(
+ Entity p_78088_1_,
+ float p_78088_2_,
+ float p_78088_3_,
+ float p_78088_4_,
+ float p_78088_5_,
+ float p_78088_6_,
+ float p_78088_7_) {
+ super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_);
+ this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
- /**
- * Used for easily adding entity-dependent animations. The second and third
- * float params here are the same second and third as in the setRotationAngles
- * method.
- */
- public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) {
- EntityWolf entitydingo = (EntityWolf) p_78086_1_;
+ if (this.isChild) {
+ float f6 = 2.0F;
+ GL11.glPushMatrix();
+ GL11.glTranslatef(0.0F, 5.0F * p_78088_7_, 2.0F * p_78088_7_);
+ this.dingoHeadMain.renderWithRotation(p_78088_7_);
+ GL11.glPopMatrix();
+ GL11.glPushMatrix();
+ GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
+ GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F);
+ this.dingoBody.render(p_78088_7_);
+ this.dingoLeg1.render(p_78088_7_);
+ this.dingoLeg2.render(p_78088_7_);
+ this.dingoLeg3.render(p_78088_7_);
+ this.dingoLeg4.render(p_78088_7_);
+ this.dingoTail.renderWithRotation(p_78088_7_);
+ this.dingoMane.render(p_78088_7_);
+ GL11.glPopMatrix();
+ } else {
+ this.dingoHeadMain.renderWithRotation(p_78088_7_);
+ this.dingoBody.render(p_78088_7_);
+ this.dingoLeg1.render(p_78088_7_);
+ this.dingoLeg2.render(p_78088_7_);
+ this.dingoLeg3.render(p_78088_7_);
+ this.dingoLeg4.render(p_78088_7_);
+ this.dingoTail.renderWithRotation(p_78088_7_);
+ this.dingoMane.render(p_78088_7_);
+ }
+ }
- if (entitydingo.isAngry()) {
- this.dingoTail.rotateAngleY = 0.0F;
- } else {
- this.dingoTail.rotateAngleY = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
- }
+ /**
+ * Used for easily adding entity-dependent animations. The second and third
+ * float params here are the same second and third as in the setRotationAngles
+ * method.
+ */
+ public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) {
+ EntityWolf entitydingo = (EntityWolf) p_78086_1_;
- if (entitydingo.isSitting()) {
- this.dingoMane.setRotationPoint(-1.0F, 16.0F, -3.0F);
- this.dingoMane.rotateAngleX = ((float) Math.PI * 2F / 5F);
- this.dingoMane.rotateAngleY = 0.0F;
- this.dingoBody.setRotationPoint(0.0F, 18.0F, 0.0F);
- this.dingoBody.rotateAngleX = ((float) Math.PI / 4F);
- this.dingoTail.setRotationPoint(-1.0F, 21.0F, 6.0F);
- this.dingoLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F);
- this.dingoLeg1.rotateAngleX = ((float) Math.PI * 3F / 2F);
- this.dingoLeg2.setRotationPoint(0.5F, 22.0F, 2.0F);
- this.dingoLeg2.rotateAngleX = ((float) Math.PI * 3F / 2F);
- this.dingoLeg3.rotateAngleX = 5.811947F;
- this.dingoLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F);
- this.dingoLeg4.rotateAngleX = 5.811947F;
- this.dingoLeg4.setRotationPoint(0.51F, 17.0F, -4.0F);
- } else {
- this.dingoBody.setRotationPoint(0.0F, 14.0F, 2.0F);
- this.dingoBody.rotateAngleX = ((float) Math.PI / 2F);
- this.dingoMane.setRotationPoint(-1.0F, 14.0F, -3.0F);
- this.dingoMane.rotateAngleX = this.dingoBody.rotateAngleX;
- this.dingoTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
- this.dingoLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
- this.dingoLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
- this.dingoLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
- this.dingoLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
- this.dingoLeg1.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
- this.dingoLeg2.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float) Math.PI) * 1.4F * p_78086_3_;
- this.dingoLeg3.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float) Math.PI) * 1.4F * p_78086_3_;
- this.dingoLeg4.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
- }
+ if (entitydingo.isAngry()) {
+ this.dingoTail.rotateAngleY = 0.0F;
+ } else {
+ this.dingoTail.rotateAngleY = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
+ }
- this.dingoHeadMain.rotateAngleZ = entitydingo.getInterestedAngle(p_78086_4_)
- + entitydingo.getShakeAngle(p_78086_4_, 0.0F);
- this.dingoMane.rotateAngleZ = entitydingo.getShakeAngle(p_78086_4_, -0.08F);
- this.dingoBody.rotateAngleZ = entitydingo.getShakeAngle(p_78086_4_, -0.16F);
- this.dingoTail.rotateAngleZ = entitydingo.getShakeAngle(p_78086_4_, -0.2F);
- }
+ if (entitydingo.isSitting()) {
+ this.dingoMane.setRotationPoint(-1.0F, 16.0F, -3.0F);
+ this.dingoMane.rotateAngleX = ((float) Math.PI * 2F / 5F);
+ this.dingoMane.rotateAngleY = 0.0F;
+ this.dingoBody.setRotationPoint(0.0F, 18.0F, 0.0F);
+ this.dingoBody.rotateAngleX = ((float) Math.PI / 4F);
+ this.dingoTail.setRotationPoint(-1.0F, 21.0F, 6.0F);
+ this.dingoLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F);
+ this.dingoLeg1.rotateAngleX = ((float) Math.PI * 3F / 2F);
+ this.dingoLeg2.setRotationPoint(0.5F, 22.0F, 2.0F);
+ this.dingoLeg2.rotateAngleX = ((float) Math.PI * 3F / 2F);
+ this.dingoLeg3.rotateAngleX = 5.811947F;
+ this.dingoLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F);
+ this.dingoLeg4.rotateAngleX = 5.811947F;
+ this.dingoLeg4.setRotationPoint(0.51F, 17.0F, -4.0F);
+ } else {
+ this.dingoBody.setRotationPoint(0.0F, 14.0F, 2.0F);
+ this.dingoBody.rotateAngleX = ((float) Math.PI / 2F);
+ this.dingoMane.setRotationPoint(-1.0F, 14.0F, -3.0F);
+ this.dingoMane.rotateAngleX = this.dingoBody.rotateAngleX;
+ this.dingoTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
+ this.dingoLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
+ this.dingoLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
+ this.dingoLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
+ this.dingoLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
+ this.dingoLeg1.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
+ this.dingoLeg2.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float) Math.PI) * 1.4F * p_78086_3_;
+ this.dingoLeg3.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float) Math.PI) * 1.4F * p_78086_3_;
+ this.dingoLeg4.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
+ }
- /**
- * Sets the model's various rotation angles. For bipeds, par1 and par2 are used
- * for animating the movement of arms and legs, where par1 represents the
- * time(so that arms and legs swing back and forth) and par2 represents how
- * "far" arms and legs can swing at most.
- */
- public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
- float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
- super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_);
- this.dingoHeadMain.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
- this.dingoHeadMain.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
- this.dingoTail.rotateAngleX = p_78087_3_;
- }
-
-} \ No newline at end of file
+ this.dingoHeadMain.rotateAngleZ =
+ entitydingo.getInterestedAngle(p_78086_4_) + entitydingo.getShakeAngle(p_78086_4_, 0.0F);
+ this.dingoMane.rotateAngleZ = entitydingo.getShakeAngle(p_78086_4_, -0.08F);
+ this.dingoBody.rotateAngleZ = entitydingo.getShakeAngle(p_78086_4_, -0.16F);
+ this.dingoTail.rotateAngleZ = entitydingo.getShakeAngle(p_78086_4_, -0.2F);
+ }
+
+ /**
+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used
+ * for animating the movement of arms and legs, where par1 represents the
+ * time(so that arms and legs swing back and forth) and par2 represents how
+ * "far" arms and legs can swing at most.
+ */
+ public void setRotationAngles(
+ float p_78087_1_,
+ float p_78087_2_,
+ float p_78087_3_,
+ float p_78087_4_,
+ float p_78087_5_,
+ float p_78087_6_,
+ Entity p_78087_7_) {
+ super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_);
+ this.dingoHeadMain.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
+ this.dingoHeadMain.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
+ this.dingoTail.rotateAngleX = p_78087_3_;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/model/ModelOctopus.java b/src/main/java/gtPlusPlus/australia/entity/model/ModelOctopus.java
index f820d0ad85..aaec9f8dc4 100644
--- a/src/main/java/gtPlusPlus/australia/entity/model/ModelOctopus.java
+++ b/src/main/java/gtPlusPlus/australia/entity/model/ModelOctopus.java
@@ -8,60 +8,71 @@ import net.minecraft.entity.Entity;
@SideOnly(Side.CLIENT)
public class ModelOctopus extends ModelBase {
-
- /** The squid's body */
- ModelRenderer octopusBody;
- /** The squid's tentacles */
- ModelRenderer[] octoTentacles = new ModelRenderer[8];
- public ModelOctopus() {
- byte b0 = -16;
- this.octopusBody = new ModelRenderer(this, 0, 0);
- this.octopusBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12);
- this.octopusBody.rotationPointY += (float) (24 + b0);
+ /** The squid's body */
+ ModelRenderer octopusBody;
+ /** The squid's tentacles */
+ ModelRenderer[] octoTentacles = new ModelRenderer[8];
- for (int i = 0; i < this.octoTentacles.length; ++i) {
- this.octoTentacles[i] = new ModelRenderer(this, 48, 0);
- double d0 = (double) i * Math.PI * 2.0D / (double) this.octoTentacles.length;
- float f = (float) Math.cos(d0) * 5.0F;
- float f1 = (float) Math.sin(d0) * 5.0F;
- this.octoTentacles[i].addBox(-1.0F, 0.0F, -1.0F, 2, 18, 2);
- this.octoTentacles[i].rotationPointX = f;
- this.octoTentacles[i].rotationPointZ = f1;
- this.octoTentacles[i].rotationPointY = (float) (31 + b0);
- d0 = (double) i * Math.PI * -2.0D / (double) this.octoTentacles.length + (Math.PI / 2D);
- this.octoTentacles[i].rotateAngleY = (float) d0;
- }
- }
+ public ModelOctopus() {
+ byte b0 = -16;
+ this.octopusBody = new ModelRenderer(this, 0, 0);
+ this.octopusBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12);
+ this.octopusBody.rotationPointY += (float) (24 + b0);
- /**
- * Sets the model's various rotation angles. For bipeds, par1 and par2 are used
- * for animating the movement of arms and legs, where par1 represents the
- * time(so that arms and legs swing back and forth) and par2 represents how
- * "far" arms and legs can swing at most.
- */
- public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
- float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
- ModelRenderer[] amodelrenderer = this.octoTentacles;
- int i = amodelrenderer.length;
+ for (int i = 0; i < this.octoTentacles.length; ++i) {
+ this.octoTentacles[i] = new ModelRenderer(this, 48, 0);
+ double d0 = (double) i * Math.PI * 2.0D / (double) this.octoTentacles.length;
+ float f = (float) Math.cos(d0) * 5.0F;
+ float f1 = (float) Math.sin(d0) * 5.0F;
+ this.octoTentacles[i].addBox(-1.0F, 0.0F, -1.0F, 2, 18, 2);
+ this.octoTentacles[i].rotationPointX = f;
+ this.octoTentacles[i].rotationPointZ = f1;
+ this.octoTentacles[i].rotationPointY = (float) (31 + b0);
+ d0 = (double) i * Math.PI * -2.0D / (double) this.octoTentacles.length + (Math.PI / 2D);
+ this.octoTentacles[i].rotateAngleY = (float) d0;
+ }
+ }
- for (int j = 0; j < i; ++j) {
- ModelRenderer modelrenderer = amodelrenderer[j];
- modelrenderer.rotateAngleX = p_78087_3_;
- }
- }
+ /**
+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used
+ * for animating the movement of arms and legs, where par1 represents the
+ * time(so that arms and legs swing back and forth) and par2 represents how
+ * "far" arms and legs can swing at most.
+ */
+ public void setRotationAngles(
+ float p_78087_1_,
+ float p_78087_2_,
+ float p_78087_3_,
+ float p_78087_4_,
+ float p_78087_5_,
+ float p_78087_6_,
+ Entity p_78087_7_) {
+ ModelRenderer[] amodelrenderer = this.octoTentacles;
+ int i = amodelrenderer.length;
- /**
- * Sets the models various rotation angles then renders the model.
- */
- public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
- float p_78088_6_, float p_78088_7_) {
- this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
- this.octopusBody.render(p_78088_7_);
+ for (int j = 0; j < i; ++j) {
+ ModelRenderer modelrenderer = amodelrenderer[j];
+ modelrenderer.rotateAngleX = p_78087_3_;
+ }
+ }
- for (int i = 0; i < this.octoTentacles.length; ++i) {
- this.octoTentacles[i].render(p_78088_7_);
- }
- }
-
-} \ No newline at end of file
+ /**
+ * Sets the models various rotation angles then renders the model.
+ */
+ public void render(
+ Entity p_78088_1_,
+ float p_78088_2_,
+ float p_78088_3_,
+ float p_78088_4_,
+ float p_78088_5_,
+ float p_78088_6_,
+ float p_78088_7_) {
+ this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
+ this.octopusBody.render(p_78088_7_);
+
+ for (int i = 0; i < this.octoTentacles.length; ++i) {
+ this.octoTentacles[i].render(p_78088_7_);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/render/RenderAustralianSpider.java b/src/main/java/gtPlusPlus/australia/entity/render/RenderAustralianSpider.java
index af432e04b9..01b4b8ac4b 100644
--- a/src/main/java/gtPlusPlus/australia/entity/render/RenderAustralianSpider.java
+++ b/src/main/java/gtPlusPlus/australia/entity/render/RenderAustralianSpider.java
@@ -15,70 +15,70 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderAustralianSpider extends RenderLiving {
- private static final ResourceLocation spiderEyesTextures = new ResourceLocation("textures/entity/spider_eyes.png");
- private static final ResourceLocation spiderTextures = new ResourceLocation(CORE.MODID+":"+"textures/entity/australia/bush_spider.png");
+ private static final ResourceLocation spiderEyesTextures = new ResourceLocation("textures/entity/spider_eyes.png");
+ private static final ResourceLocation spiderTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/australia/bush_spider.png");
- public RenderAustralianSpider() {
- super(new ModelAustralianSpider(), 1.0F);
- this.setRenderPassModel(new ModelAustralianSpider());
- }
+ public RenderAustralianSpider() {
+ super(new ModelAustralianSpider(), 1.0F);
+ this.setRenderPassModel(new ModelAustralianSpider());
+ }
- protected float getDeathMaxRotation(EntityAustralianSpiderBase p_77037_1_) {
- return 180.0F;
- }
+ protected float getDeathMaxRotation(EntityAustralianSpiderBase p_77037_1_) {
+ return 180.0F;
+ }
- /**
- * Queries whether should render the specified pass or not.
- */
- protected int shouldRenderPass(EntityAustralianSpiderBase p_77032_1_, int p_77032_2_, float p_77032_3_) {
- if (p_77032_2_ != 0) {
- return -1;
- } else {
- this.bindTexture(spiderEyesTextures);
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_ALPHA_TEST);
- GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
+ /**
+ * Queries whether should render the specified pass or not.
+ */
+ protected int shouldRenderPass(EntityAustralianSpiderBase p_77032_1_, int p_77032_2_, float p_77032_3_) {
+ if (p_77032_2_ != 0) {
+ return -1;
+ } else {
+ this.bindTexture(spiderEyesTextures);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
- if (p_77032_1_.isInvisible()) {
- GL11.glDepthMask(false);
- } else {
- GL11.glDepthMask(true);
- }
+ if (p_77032_1_.isInvisible()) {
+ GL11.glDepthMask(false);
+ } else {
+ GL11.glDepthMask(true);
+ }
- char c0 = 61680;
- int j = c0 % 65536;
- int k = c0 / 65536;
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- return 1;
- }
- }
+ char c0 = 61680;
+ int j = c0 % 65536;
+ int k = c0 / 65536;
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ return 1;
+ }
+ }
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless
- * you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(EntityAustralianSpiderBase p_110775_1_) {
- return spiderTextures;
- }
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless
+ * you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(EntityAustralianSpiderBase p_110775_1_) {
+ return spiderTextures;
+ }
- protected float getDeathMaxRotation(EntityLivingBase p_77037_1_) {
- return this.getDeathMaxRotation((EntityAustralianSpiderBase) p_77037_1_);
- }
+ protected float getDeathMaxRotation(EntityLivingBase p_77037_1_) {
+ return this.getDeathMaxRotation((EntityAustralianSpiderBase) p_77037_1_);
+ }
- /**
- * Queries whether should render the specified pass or not.
- */
- protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) {
- return this.shouldRenderPass((EntityAustralianSpiderBase) p_77032_1_, p_77032_2_, p_77032_3_);
- }
+ /**
+ * Queries whether should render the specified pass or not.
+ */
+ protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) {
+ return this.shouldRenderPass((EntityAustralianSpiderBase) p_77032_1_, p_77032_2_, p_77032_3_);
+ }
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless
- * you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
- return this.getEntityTexture((EntityAustralianSpiderBase) p_110775_1_);
- }
-
-} \ No newline at end of file
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless
+ * you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ return this.getEntityTexture((EntityAustralianSpiderBase) p_110775_1_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/render/RenderBoar.java b/src/main/java/gtPlusPlus/australia/entity/render/RenderBoar.java
index cc4bfa8906..c3a730492c 100644
--- a/src/main/java/gtPlusPlus/australia/entity/render/RenderBoar.java
+++ b/src/main/java/gtPlusPlus/australia/entity/render/RenderBoar.java
@@ -11,13 +11,13 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
@SideOnly(Side.CLIENT)
-public class RenderBoar extends RenderLiving
-{
- private static final ResourceLocation saddledBoarTextures = new ResourceLocation("textures/entity/boar/boar_saddle.png");
- private static final ResourceLocation boarTextures = new ResourceLocation(CORE.MODID+":"+"textures/entity/australia/boar.png");
+public class RenderBoar extends RenderLiving {
+ private static final ResourceLocation saddledBoarTextures =
+ new ResourceLocation("textures/entity/boar/boar_saddle.png");
+ private static final ResourceLocation boarTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/australia/boar.png");
- public RenderBoar(ModelBase p_i1265_1_, ModelBase p_i1265_2_, float p_i1265_3_)
- {
+ public RenderBoar(ModelBase p_i1265_1_, ModelBase p_i1265_2_, float p_i1265_3_) {
super(p_i1265_1_, p_i1265_3_);
this.setRenderPassModel(p_i1265_2_);
}
@@ -25,15 +25,11 @@ public class RenderBoar extends RenderLiving
/**
* Queries whether should render the specified pass or not.
*/
- protected int shouldRenderPass(EntityBoar p_77032_1_, int p_77032_2_, float p_77032_3_)
- {
- if (p_77032_2_ == 0 && p_77032_1_.getSaddled())
- {
+ protected int shouldRenderPass(EntityBoar p_77032_1_, int p_77032_2_, float p_77032_3_) {
+ if (p_77032_2_ == 0 && p_77032_1_.getSaddled()) {
this.bindTexture(saddledBoarTextures);
return 1;
- }
- else
- {
+ } else {
return -1;
}
}
@@ -41,24 +37,21 @@ public class RenderBoar extends RenderLiving
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
- protected ResourceLocation getEntityTexture(EntityBoar p_110775_1_)
- {
+ protected ResourceLocation getEntityTexture(EntityBoar p_110775_1_) {
return boarTextures;
}
/**
* Queries whether should render the specified pass or not.
*/
- protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
- {
- return this.shouldRenderPass((EntityBoar)p_77032_1_, p_77032_2_, p_77032_3_);
+ protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) {
+ return this.shouldRenderPass((EntityBoar) p_77032_1_, p_77032_2_, p_77032_3_);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
- protected ResourceLocation getEntityTexture(Entity p_110775_1_)
- {
- return this.getEntityTexture((EntityBoar)p_110775_1_);
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ return this.getEntityTexture((EntityBoar) p_110775_1_);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/render/RenderDingo.java b/src/main/java/gtPlusPlus/australia/entity/render/RenderDingo.java
index 8bbf0392cd..37511355e6 100644
--- a/src/main/java/gtPlusPlus/australia/entity/render/RenderDingo.java
+++ b/src/main/java/gtPlusPlus/australia/entity/render/RenderDingo.java
@@ -15,76 +15,78 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderDingo extends RenderLiving {
- private static final ResourceLocation dingoTextures = new ResourceLocation(
- CORE.MODID + ":" + "textures/entity/australia/dingo/dingo.png");
- private static final ResourceLocation tamedDingoTextures = new ResourceLocation(
- CORE.MODID + ":" + "textures/entity/australia/dingo/wdingo_tame.png");
- private static final ResourceLocation anrgyDingoTextures = new ResourceLocation(
- CORE.MODID + ":" + "textures/entity/australia/dingo/dingo_angry.png");
- private static final ResourceLocation dingoCollarTextures = new ResourceLocation(
- CORE.MODID + ":" + "textures/entity/australia/wdingoolf/dingo_collar.png");
+ private static final ResourceLocation dingoTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/australia/dingo/dingo.png");
+ private static final ResourceLocation tamedDingoTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/australia/dingo/wdingo_tame.png");
+ private static final ResourceLocation anrgyDingoTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/australia/dingo/dingo_angry.png");
+ private static final ResourceLocation dingoCollarTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/australia/wdingoolf/dingo_collar.png");
- public RenderDingo(ModelBase p_i1269_1_, ModelBase p_i1269_2_, float p_i1269_3_) {
- super(p_i1269_1_, p_i1269_3_);
- this.setRenderPassModel(p_i1269_2_);
- }
+ public RenderDingo(ModelBase p_i1269_1_, ModelBase p_i1269_2_, float p_i1269_3_) {
+ super(p_i1269_1_, p_i1269_3_);
+ this.setRenderPassModel(p_i1269_2_);
+ }
- /**
- * Defines what float the third param in setRotationAngles of ModelBase is
- */
- protected float handleRotationFloat(EntityDingo p_77044_1_, float p_77044_2_) {
- return p_77044_1_.getTailRotation();
- }
+ /**
+ * Defines what float the third param in setRotationAngles of ModelBase is
+ */
+ protected float handleRotationFloat(EntityDingo p_77044_1_, float p_77044_2_) {
+ return p_77044_1_.getTailRotation();
+ }
- /**
- * Queries whether should render the specified pass or not.
- */
- protected int shouldRenderPass(EntityDingo p_77032_1_, int p_77032_2_, float p_77032_3_) {
- if (p_77032_2_ == 0 && p_77032_1_.getWolfShaking()) {
- float f1 = p_77032_1_.getBrightness(p_77032_3_) * p_77032_1_.getShadingWhileShaking(p_77032_3_);
- this.bindTexture(dingoTextures);
- GL11.glColor3f(f1, f1, f1);
- return 1;
- } else if (p_77032_2_ == 1 && p_77032_1_.isTamed()) {
- this.bindTexture(dingoCollarTextures);
- int j = p_77032_1_.getCollarColor();
- GL11.glColor3f(EntitySheep.fleeceColorTable[j][0], EntitySheep.fleeceColorTable[j][1],
- EntitySheep.fleeceColorTable[j][2]);
- return 1;
- } else {
- return -1;
- }
- }
+ /**
+ * Queries whether should render the specified pass or not.
+ */
+ protected int shouldRenderPass(EntityDingo p_77032_1_, int p_77032_2_, float p_77032_3_) {
+ if (p_77032_2_ == 0 && p_77032_1_.getWolfShaking()) {
+ float f1 = p_77032_1_.getBrightness(p_77032_3_) * p_77032_1_.getShadingWhileShaking(p_77032_3_);
+ this.bindTexture(dingoTextures);
+ GL11.glColor3f(f1, f1, f1);
+ return 1;
+ } else if (p_77032_2_ == 1 && p_77032_1_.isTamed()) {
+ this.bindTexture(dingoCollarTextures);
+ int j = p_77032_1_.getCollarColor();
+ GL11.glColor3f(
+ EntitySheep.fleeceColorTable[j][0],
+ EntitySheep.fleeceColorTable[j][1],
+ EntitySheep.fleeceColorTable[j][2]);
+ return 1;
+ } else {
+ return -1;
+ }
+ }
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless
- * you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(EntityDingo p_110775_1_) {
- return p_110775_1_.isTamed() ? tamedDingoTextures
- : (p_110775_1_.isAngry() ? anrgyDingoTextures : dingoTextures);
- }
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless
+ * you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(EntityDingo p_110775_1_) {
+ return p_110775_1_.isTamed()
+ ? tamedDingoTextures
+ : (p_110775_1_.isAngry() ? anrgyDingoTextures : dingoTextures);
+ }
- /**
- * Queries whether should render the specified pass or not.
- */
- protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) {
- return this.shouldRenderPass((EntityDingo) p_77032_1_, p_77032_2_, p_77032_3_);
- }
+ /**
+ * Queries whether should render the specified pass or not.
+ */
+ protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) {
+ return this.shouldRenderPass((EntityDingo) p_77032_1_, p_77032_2_, p_77032_3_);
+ }
- /**
- * Defines what float the third param in setRotationAngles of ModelBase is
- */
- protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) {
- return this.handleRotationFloat((EntityDingo) p_77044_1_, p_77044_2_);
- }
+ /**
+ * Defines what float the third param in setRotationAngles of ModelBase is
+ */
+ protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) {
+ return this.handleRotationFloat((EntityDingo) p_77044_1_, p_77044_2_);
+ }
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless
- * you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
- return this.getEntityTexture((EntityDingo) p_110775_1_);
- }
-
-} \ No newline at end of file
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless
+ * you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ return this.getEntityTexture((EntityDingo) p_110775_1_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/render/RenderOctopus.java b/src/main/java/gtPlusPlus/australia/entity/render/RenderOctopus.java
index 592ef9391a..89888140f2 100644
--- a/src/main/java/gtPlusPlus/australia/entity/render/RenderOctopus.java
+++ b/src/main/java/gtPlusPlus/australia/entity/render/RenderOctopus.java
@@ -14,107 +14,127 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderOctopus extends RenderLiving {
-
- private static final ResourceLocation octopusTextures = new ResourceLocation(CORE.MODID+":"+"textures/entity/australia/octopus.png");
- public RenderOctopus(ModelBase p_i1268_1_, float p_i1268_2_) {
- super(p_i1268_1_, p_i1268_2_);
- }
+ private static final ResourceLocation octopusTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/australia/octopus.png");
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker function
- * which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void
- * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
- * But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(EntityOctopus p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- super.doRender((EntityLiving) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
+ public RenderOctopus(ModelBase p_i1268_1_, float p_i1268_2_) {
+ super(p_i1268_1_, p_i1268_2_);
+ }
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless
- * you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(EntityOctopus p_110775_1_) {
- return octopusTextures;
- }
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker function
+ * which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void
+ * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
+ * But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ EntityOctopus p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ super.doRender((EntityLiving) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
- protected void rotateCorpse(EntityOctopus p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
- float f3 = p_77043_1_.prevSquidPitch + (p_77043_1_.octopusPitch - p_77043_1_.prevSquidPitch) * p_77043_4_;
- float f4 = p_77043_1_.prevSquidYaw + (p_77043_1_.octopusYaw - p_77043_1_.prevSquidYaw) * p_77043_4_;
- GL11.glTranslatef(0.0F, 0.5F, 0.0F);
- GL11.glRotatef(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(f3, 1.0F, 0.0F, 0.0F);
- GL11.glRotatef(f4, 0.0F, 1.0F, 0.0F);
- GL11.glTranslatef(0.0F, -1.2F, 0.0F);
- }
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless
+ * you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(EntityOctopus p_110775_1_) {
+ return octopusTextures;
+ }
- /**
- * Defines what float the third param in setRotationAngles of ModelBase is
- */
- protected float handleRotationFloat(EntityOctopus p_77044_1_, float p_77044_2_) {
- return p_77044_1_.lastTentacleAngle + (p_77044_1_.tentacleAngle - p_77044_1_.lastTentacleAngle) * p_77044_2_;
- }
+ protected void rotateCorpse(EntityOctopus p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
+ float f3 = p_77043_1_.prevSquidPitch + (p_77043_1_.octopusPitch - p_77043_1_.prevSquidPitch) * p_77043_4_;
+ float f4 = p_77043_1_.prevSquidYaw + (p_77043_1_.octopusYaw - p_77043_1_.prevSquidYaw) * p_77043_4_;
+ GL11.glTranslatef(0.0F, 0.5F, 0.0F);
+ GL11.glRotatef(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(f3, 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(f4, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(0.0F, -1.2F, 0.0F);
+ }
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker function
- * which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void
- * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
- * But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- this.doRender((EntityOctopus) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
+ /**
+ * Defines what float the third param in setRotationAngles of ModelBase is
+ */
+ protected float handleRotationFloat(EntityOctopus p_77044_1_, float p_77044_2_) {
+ return p_77044_1_.lastTentacleAngle + (p_77044_1_.tentacleAngle - p_77044_1_.lastTentacleAngle) * p_77044_2_;
+ }
- /**
- * Defines what float the third param in setRotationAngles of ModelBase is
- */
- protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) {
- return this.handleRotationFloat((EntityOctopus) p_77044_1_, p_77044_2_);
- }
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker function
+ * which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void
+ * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
+ * But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ EntityLiving p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntityOctopus) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
- protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
- this.rotateCorpse((EntityOctopus) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
- }
+ /**
+ * Defines what float the third param in setRotationAngles of ModelBase is
+ */
+ protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) {
+ return this.handleRotationFloat((EntityOctopus) p_77044_1_, p_77044_2_);
+ }
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker function
- * which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void
- * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
- * But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- this.doRender((EntityOctopus) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
+ protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
+ this.rotateCorpse((EntityOctopus) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
+ }
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless
- * you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
- return this.getEntityTexture((EntityOctopus) p_110775_1_);
- }
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker function
+ * which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void
+ * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
+ * But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ EntityLivingBase p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntityOctopus) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker function
- * which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void
- * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
- * But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
- float p_76986_9_) {
- this.doRender((EntityOctopus) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
-} \ No newline at end of file
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless
+ * you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ return this.getEntityTexture((EntityOctopus) p_110775_1_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker function
+ * which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void
+ * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
+ * But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ Entity p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntityOctopus) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/type/EntityAustralianSpiderBase.java b/src/main/java/gtPlusPlus/australia/entity/type/EntityAustralianSpiderBase.java
index 5aa78203a3..9f4963e2fc 100644
--- a/src/main/java/gtPlusPlus/australia/entity/type/EntityAustralianSpiderBase.java
+++ b/src/main/java/gtPlusPlus/australia/entity/type/EntityAustralianSpiderBase.java
@@ -11,31 +11,31 @@ import net.minecraft.world.World;
public class EntityAustralianSpiderBase extends EntitySpider {
- public EntityAustralianSpiderBase(World p_i1732_1_) {
- super(p_i1732_1_);
- this.setSize(0.7F, 0.5F);
- }
+ public EntityAustralianSpiderBase(World p_i1732_1_) {
+ super(p_i1732_1_);
+ this.setSize(0.7F, 0.5F);
+ }
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(12.0D);
- }
+ protected void applyEntityAttributes() {
+ super.applyEntityAttributes();
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(12.0D);
+ }
- public boolean attackEntityAsMob(Entity p_70652_1_) {
- if (super.attackEntityAsMob(p_70652_1_)) {
- if (p_70652_1_ instanceof EntityLivingBase) {
- byte b0 = 45;
- if (b0 > 0) {
- ((EntityLivingBase) p_70652_1_).addPotionEffect(new PotionEffect(Potion.poison.id, b0 * 20, 0));
- }
- }
- return true;
- } else {
- return false;
- }
- }
+ public boolean attackEntityAsMob(Entity p_70652_1_) {
+ if (super.attackEntityAsMob(p_70652_1_)) {
+ if (p_70652_1_ instanceof EntityLivingBase) {
+ byte b0 = 45;
+ if (b0 > 0) {
+ ((EntityLivingBase) p_70652_1_).addPotionEffect(new PotionEffect(Potion.poison.id, b0 * 20, 0));
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
- public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) {
- return p_110161_1_;
- }
-} \ No newline at end of file
+ public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) {
+ return p_110161_1_;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/type/EntityBoar.java b/src/main/java/gtPlusPlus/australia/entity/type/EntityBoar.java
index 871b1a5356..fddde70116 100644
--- a/src/main/java/gtPlusPlus/australia/entity/type/EntityBoar.java
+++ b/src/main/java/gtPlusPlus/australia/entity/type/EntityBoar.java
@@ -7,7 +7,6 @@ import net.minecraft.entity.ai.EntityAIControlledByPlayer;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
-import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWander;
@@ -24,197 +23,198 @@ import net.minecraft.stats.AchievementList;
import net.minecraft.world.World;
public class EntityBoar extends EntityAnimal {
- /** AI task for player control. */
- private final EntityAIControlledByPlayer aiControlledByPlayer;
-
- public EntityBoar(World p_i1689_1_) {
- super(p_i1689_1_);
- this.setSize(0.9F, 0.9F);
- this.getNavigator().setAvoidsWater(true);
- this.tasks.addTask(0, new EntityAISwimming(this));
- //this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
- this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.3F));
- this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
- this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false));
- this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot, false));
- this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
- this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
- this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
- this.tasks.addTask(8, new EntityAILookIdle(this));
- }
-
- /**
- * Returns true if the newer Entity AI code should be run
- */
- public boolean isAIEnabled() {
- return true;
- }
-
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
- }
-
- protected void updateAITasks() {
- super.updateAITasks();
- }
-
- /**
- * returns true if all the conditions for steering the entity are met. For pigs,
- * this is true if it is being ridden by a player and the player is holding a
- * carrot-on-a-stick
- */
- public boolean canBeSteered() {
- ItemStack itemstack = ((EntityPlayer) this.riddenByEntity).getHeldItem();
- return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick;
- }
-
- protected void entityInit() {
- super.entityInit();
- this.dataWatcher.addObject(16, Byte.valueOf((byte) 0));
- }
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
- super.writeEntityToNBT(p_70014_1_);
- p_70014_1_.setBoolean("Saddle", this.getSaddled());
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
- super.readEntityFromNBT(p_70037_1_);
- this.setSaddled(p_70037_1_.getBoolean("Saddle"));
- }
-
- /**
- * Returns the sound this mob makes while it's alive.
- */
- protected String getLivingSound() {
- return "mob.pig.say";
- }
-
- /**
- * Returns the sound this mob makes when it is hurt.
- */
- protected String getHurtSound() {
- return "mob.pig.say";
- }
-
- /**
- * Returns the sound this mob makes on death.
- */
- protected String getDeathSound() {
- return "mob.pig.death";
- }
-
- protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) {
- this.playSound("mob.pig.step", 0.15F, 1.0F);
- }
-
- /**
- * Called when a player interacts with a mob. e.g. gets milk from a cow, gets
- * into the saddle on a pig.
- */
- public boolean interact(EntityPlayer p_70085_1_) {
- if (super.interact(p_70085_1_)) {
- return true;
- } else if (this.getSaddled() && !this.worldObj.isRemote
- && (this.riddenByEntity == null || this.riddenByEntity == p_70085_1_)) {
- p_70085_1_.mountEntity(this);
- return true;
- } else {
- return false;
- }
- }
-
- protected Item getDropItem() {
- return this.isBurning() ? Items.cooked_porkchop : Items.porkchop;
- }
-
- /**
- * Drop 0-2 items of this living's type. @param par1 - Whether this entity has
- * recently been hit by a player. @param par2 - Level of Looting used to kill
- * this mob.
- */
- protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
- int j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_);
-
- for (int k = 0; k < j; ++k) {
- if (this.isBurning()) {
- this.dropItem(Items.cooked_porkchop, 1);
- } else {
- this.dropItem(Items.porkchop, 1);
- }
- }
-
- if (this.getSaddled()) {
- this.dropItem(Items.saddle, 1);
- }
- }
-
- /**
- * Returns true if the pig is saddled.
- */
- public boolean getSaddled() {
- return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0;
- }
-
- /**
- * Set or remove the saddle of the pig.
- */
- public void setSaddled(boolean p_70900_1_) {
- if (p_70900_1_) {
- this.dataWatcher.updateObject(16, Byte.valueOf((byte) 1));
- } else {
- this.dataWatcher.updateObject(16, Byte.valueOf((byte) 0));
- }
- }
-
- /**
- * Called when a lightning bolt hits the entity.
- */
- public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
- if (!this.worldObj.isRemote) {
- EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
- entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
- entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
- this.worldObj.spawnEntityInWorld(entitypigzombie);
- this.setDead();
- }
- }
-
- /**
- * Called when the mob is falling. Calculates and applies fall damage.
- */
- protected void fall(float p_70069_1_) {
- super.fall(p_70069_1_);
-
- if (p_70069_1_ > 5.0F && this.riddenByEntity instanceof EntityPlayer) {
- ((EntityPlayer) this.riddenByEntity).triggerAchievement(AchievementList.flyPig);
- }
- }
-
- public EntityBoar createChild(EntityAgeable p_90011_1_) {
- return new EntityBoar(this.worldObj);
- }
-
- /**
- * Checks if the parameter is an item which this animal can be fed to breed it
- * (wheat, carrots or seeds depending on the animal type)
- */
- public boolean isBreedingItem(ItemStack p_70877_1_) {
- return p_70877_1_ != null && p_70877_1_.getItem() == Items.carrot;
- }
-
- /**
- * Return the AI task for player control.
- */
- public EntityAIControlledByPlayer getAIControlledByPlayer() {
- return this.aiControlledByPlayer;
- }
-} \ No newline at end of file
+ /** AI task for player control. */
+ private final EntityAIControlledByPlayer aiControlledByPlayer;
+
+ public EntityBoar(World p_i1689_1_) {
+ super(p_i1689_1_);
+ this.setSize(0.9F, 0.9F);
+ this.getNavigator().setAvoidsWater(true);
+ this.tasks.addTask(0, new EntityAISwimming(this));
+ // this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
+ this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.3F));
+ this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
+ this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false));
+ this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot, false));
+ this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
+ this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
+ this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
+ this.tasks.addTask(8, new EntityAILookIdle(this));
+ }
+
+ /**
+ * Returns true if the newer Entity AI code should be run
+ */
+ public boolean isAIEnabled() {
+ return true;
+ }
+
+ protected void applyEntityAttributes() {
+ super.applyEntityAttributes();
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
+ }
+
+ protected void updateAITasks() {
+ super.updateAITasks();
+ }
+
+ /**
+ * returns true if all the conditions for steering the entity are met. For pigs,
+ * this is true if it is being ridden by a player and the player is holding a
+ * carrot-on-a-stick
+ */
+ public boolean canBeSteered() {
+ ItemStack itemstack = ((EntityPlayer) this.riddenByEntity).getHeldItem();
+ return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick;
+ }
+
+ protected void entityInit() {
+ super.entityInit();
+ this.dataWatcher.addObject(16, Byte.valueOf((byte) 0));
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
+ super.writeEntityToNBT(p_70014_1_);
+ p_70014_1_.setBoolean("Saddle", this.getSaddled());
+ }
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
+ super.readEntityFromNBT(p_70037_1_);
+ this.setSaddled(p_70037_1_.getBoolean("Saddle"));
+ }
+
+ /**
+ * Returns the sound this mob makes while it's alive.
+ */
+ protected String getLivingSound() {
+ return "mob.pig.say";
+ }
+
+ /**
+ * Returns the sound this mob makes when it is hurt.
+ */
+ protected String getHurtSound() {
+ return "mob.pig.say";
+ }
+
+ /**
+ * Returns the sound this mob makes on death.
+ */
+ protected String getDeathSound() {
+ return "mob.pig.death";
+ }
+
+ protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) {
+ this.playSound("mob.pig.step", 0.15F, 1.0F);
+ }
+
+ /**
+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets
+ * into the saddle on a pig.
+ */
+ public boolean interact(EntityPlayer p_70085_1_) {
+ if (super.interact(p_70085_1_)) {
+ return true;
+ } else if (this.getSaddled()
+ && !this.worldObj.isRemote
+ && (this.riddenByEntity == null || this.riddenByEntity == p_70085_1_)) {
+ p_70085_1_.mountEntity(this);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected Item getDropItem() {
+ return this.isBurning() ? Items.cooked_porkchop : Items.porkchop;
+ }
+
+ /**
+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has
+ * recently been hit by a player. @param par2 - Level of Looting used to kill
+ * this mob.
+ */
+ protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
+ int j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_);
+
+ for (int k = 0; k < j; ++k) {
+ if (this.isBurning()) {
+ this.dropItem(Items.cooked_porkchop, 1);
+ } else {
+ this.dropItem(Items.porkchop, 1);
+ }
+ }
+
+ if (this.getSaddled()) {
+ this.dropItem(Items.saddle, 1);
+ }
+ }
+
+ /**
+ * Returns true if the pig is saddled.
+ */
+ public boolean getSaddled() {
+ return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0;
+ }
+
+ /**
+ * Set or remove the saddle of the pig.
+ */
+ public void setSaddled(boolean p_70900_1_) {
+ if (p_70900_1_) {
+ this.dataWatcher.updateObject(16, Byte.valueOf((byte) 1));
+ } else {
+ this.dataWatcher.updateObject(16, Byte.valueOf((byte) 0));
+ }
+ }
+
+ /**
+ * Called when a lightning bolt hits the entity.
+ */
+ public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
+ if (!this.worldObj.isRemote) {
+ EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
+ entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
+ entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
+ this.worldObj.spawnEntityInWorld(entitypigzombie);
+ this.setDead();
+ }
+ }
+
+ /**
+ * Called when the mob is falling. Calculates and applies fall damage.
+ */
+ protected void fall(float p_70069_1_) {
+ super.fall(p_70069_1_);
+
+ if (p_70069_1_ > 5.0F && this.riddenByEntity instanceof EntityPlayer) {
+ ((EntityPlayer) this.riddenByEntity).triggerAchievement(AchievementList.flyPig);
+ }
+ }
+
+ public EntityBoar createChild(EntityAgeable p_90011_1_) {
+ return new EntityBoar(this.worldObj);
+ }
+
+ /**
+ * Checks if the parameter is an item which this animal can be fed to breed it
+ * (wheat, carrots or seeds depending on the animal type)
+ */
+ public boolean isBreedingItem(ItemStack p_70877_1_) {
+ return p_70877_1_ != null && p_70877_1_.getItem() == Items.carrot;
+ }
+
+ /**
+ * Return the AI task for player control.
+ */
+ public EntityAIControlledByPlayer getAIControlledByPlayer() {
+ return this.aiControlledByPlayer;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/type/EntityDingo.java b/src/main/java/gtPlusPlus/australia/entity/type/EntityDingo.java
index 11b9737c4f..ad95631652 100644
--- a/src/main/java/gtPlusPlus/australia/entity/type/EntityDingo.java
+++ b/src/main/java/gtPlusPlus/australia/entity/type/EntityDingo.java
@@ -26,7 +26,6 @@ import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntitySheep;
-import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
@@ -42,495 +41,519 @@ import net.minecraft.world.World;
public class EntityDingo extends EntityWolf {
- private float mPrivateField1;
- private float mPrivateField2;
- private boolean mPrivateField3;
-
- /** true is the dingo is wet else false */
- private boolean isShaking;
- /** This time increases while dingo is shaking and emitting water particles. */
- private float timeWolfIsShaking;
- private float prevTimeWolfIsShaking;
-
- public EntityDingo(World p_i1696_1_) {
- super(p_i1696_1_);
- this.setSize(0.6F, 0.8F);
- this.getNavigator().setAvoidsWater(true);
- this.tasks.addTask(1, new EntityAISwimming(this));
- this.tasks.addTask(2, this.aiSit);
- this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
- this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
- this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
- this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
- this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
- this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
- this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
- this.tasks.addTask(9, new EntityAILookIdle(this));
- this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
- this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
- this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
- this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
- this.setTamed(false);
- }
-
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D);
-
- if (this.isTamed()) {
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
- } else {
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D);
- }
- }
-
- /**
- * Returns true if the newer Entity AI code should be run
- */
- public boolean isAIEnabled() {
- return true;
- }
-
- /**
- * Sets the active target the Task system uses for tracking
- */
- public void setAttackTarget(EntityLivingBase p_70624_1_) {
- super.setAttackTarget(p_70624_1_);
-
- if (p_70624_1_ == null) {
- this.setAngry(false);
- } else if (!this.isTamed()) {
- this.setAngry(true);
- }
- }
-
- /**
- * main AI tick function, replaces updateEntityActionState
- */
- protected void updateAITick() {
- this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
- }
-
- protected void entityInit() {
- super.entityInit();
- }
-
- protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) {
- this.playSound("mob.wolf.step", 0.15F, 1.0F);
- }
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
- super.writeEntityToNBT(p_70014_1_);
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
- super.readEntityFromNBT(p_70037_1_);
- }
-
- /**
- * Returns the sound this mob makes while it's alive.
- */
- protected String getLivingSound() {
- return this.isAngry() ? "mob.wolf.growl"
- : (this.rand.nextInt(3) == 0
- ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine"
- : "mob.wolf.panting")
- : "mob.wolf.bark");
- }
-
- /**
- * Returns the sound this mob makes when it is hurt.
- */
- protected String getHurtSound() {
- return "mob.wolf.hurt";
- }
-
- /**
- * Returns the sound this mob makes on death.
- */
- protected String getDeathSound() {
- return "mob.wolf.death";
- }
-
- /**
- * Returns the volume for the sounds this mob makes.
- */
- protected float getSoundVolume() {
- return 0.4F;
- }
-
- protected Item getDropItem() {
- return Item.getItemById(-1);
- }
-
- /**
- * Called frequently so the entity can update its state every tick as required.
- * For example, zombies and skeletons use this to react to sunlight and start to
- * burn.
- */
- public void onLivingUpdate() {
- super.onLivingUpdate();
-
- if (!this.worldObj.isRemote && this.isShaking && !this.mPrivateField3 && !this.hasPath() && this.onGround) {
- this.mPrivateField3 = true;
- this.timeWolfIsShaking = 0.0F;
- this.prevTimeWolfIsShaking = 0.0F;
- this.worldObj.setEntityState(this, (byte) 8);
- }
- }
-
- /**
- * Called to update the entity's position/logic.
- */
- public void onUpdate() {
- super.onUpdate();
- this.mPrivateField2 = this.mPrivateField1;
-
- if (this.func_70922_bv()) {
- this.mPrivateField1 += (1.0F - this.mPrivateField1) * 0.4F;
- } else {
- this.mPrivateField1 += (0.0F - this.mPrivateField1) * 0.4F;
- }
-
- if (this.func_70922_bv()) {
- this.numTicksToChaseTarget = 10;
- }
-
- if (this.isWet()) {
- this.isShaking = true;
- this.mPrivateField3 = false;
- this.timeWolfIsShaking = 0.0F;
- this.prevTimeWolfIsShaking = 0.0F;
- } else if ((this.isShaking || this.mPrivateField3) && this.mPrivateField3) {
- if (this.timeWolfIsShaking == 0.0F) {
- this.playSound("mob.wolf.shake", this.getSoundVolume(),
- (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
- }
-
- this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
- this.timeWolfIsShaking += 0.05F;
-
- if (this.prevTimeWolfIsShaking >= 2.0F) {
- this.isShaking = false;
- this.mPrivateField3 = false;
- this.prevTimeWolfIsShaking = 0.0F;
- this.timeWolfIsShaking = 0.0F;
- }
-
- if (this.timeWolfIsShaking > 0.4F) {
- float f = (float) this.boundingBox.minY;
- int i = (int) (MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float) Math.PI) * 7.0F);
-
- for (int j = 0; j < i; ++j) {
- float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
- float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
- this.worldObj.spawnParticle("splash", this.posX + (double) f1, (double) (f + 0.8F),
- this.posZ + (double) f2, this.motionX, this.motionY, this.motionZ);
- }
- }
- }
- }
-
- @SideOnly(Side.CLIENT)
- public boolean getWolfShaking() {
- return this.isShaking;
- }
-
- /**
- * Used when calculating the amount of shading to apply while the dingo is
- * shaking.
- */
- @SideOnly(Side.CLIENT)
- public float getShadingWhileShaking(float p_70915_1_) {
- return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_)
- / 2.0F * 0.25F;
- }
-
- @SideOnly(Side.CLIENT)
- public float getShakeAngle(float p_70923_1_, float p_70923_2_) {
- float f2 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_
- + p_70923_2_) / 1.8F;
-
- if (f2 < 0.0F) {
- f2 = 0.0F;
- } else if (f2 > 1.0F) {
- f2 = 1.0F;
- }
-
- return MathHelper.sin(f2 * (float) Math.PI) * MathHelper.sin(f2 * (float) Math.PI * 11.0F) * 0.15F
- * (float) Math.PI;
- }
-
- public float getEyeHeight() {
- return this.height * 0.8F;
- }
-
- @SideOnly(Side.CLIENT)
- public float getInterestedAngle(float p_70917_1_) {
- return (this.mPrivateField2 + (this.mPrivateField1 - this.mPrivateField2) * p_70917_1_) * 0.15F
- * (float) Math.PI;
- }
-
- /**
- * The speed it takes to move the entityliving's rotationPitch through the
- * faceEntity method. This is only currently use in wolves.
- */
- public int getVerticalFaceSpeed() {
- return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
- }
-
- /**
- * Called when the entity is attacked.
- */
- public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
- if (this.isEntityInvulnerable()) {
- return false;
- } else {
- Entity entity = p_70097_1_.getEntity();
- this.aiSit.setSitting(false);
-
- if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) {
- p_70097_2_ = (p_70097_2_ + 1.0F) / 2.0F;
- }
-
- return super.attackEntityFrom(p_70097_1_, p_70097_2_);
- }
- }
-
- public boolean attackEntityAsMob(Entity p_70652_1_) {
- int i = this.isTamed() ? 4 : 2;
- return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i);
- }
-
- public void setTamed(boolean p_70903_1_) {
- super.setTamed(p_70903_1_);
-
- if (p_70903_1_) {
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
- } else {
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D);
- }
- }
-
- /**
- * Called when a player interacts with a mob. e.g. gets milk from a cow, gets
- * into the saddle on a pig.
- */
- public boolean interact(EntityPlayer p_70085_1_) {
- ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
-
- if (this.isTamed()) {
- if (itemstack != null) {
- if (itemstack.getItem() instanceof ItemFood) {
- ItemFood itemfood = (ItemFood) itemstack.getItem();
-
- if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) {
- if (!p_70085_1_.capabilities.isCreativeMode) {
- --itemstack.stackSize;
- }
-
- this.heal((float) itemfood.func_150905_g(itemstack));
-
- if (itemstack.stackSize <= 0) {
- p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem,
- (ItemStack) null);
- }
-
- return true;
- }
- } else if (itemstack.getItem() == Items.dye) {
- int i = BlockColored.func_150032_b(itemstack.getItemDamage());
-
- if (i != this.getCollarColor()) {
- this.setCollarColor(i);
-
- if (!p_70085_1_.capabilities.isCreativeMode && --itemstack.stackSize <= 0) {
- p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem,
- (ItemStack) null);
- }
-
- return true;
- }
- }
- }
-
- if (this.func_152114_e(p_70085_1_) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack)) {
- this.aiSit.setSitting(!this.isSitting());
- this.isJumping = false;
- this.setPathToEntity((PathEntity) null);
- this.setTarget((Entity) null);
- this.setAttackTarget((EntityLivingBase) null);
- }
- } else if (itemstack != null && itemstack.getItem() == Items.bone && !this.isAngry()) {
- if (!p_70085_1_.capabilities.isCreativeMode) {
- --itemstack.stackSize;
- }
-
- if (itemstack.stackSize <= 0) {
- p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack) null);
- }
-
- if (!this.worldObj.isRemote) {
- if (this.rand.nextInt(3) == 0) {
- this.setTamed(true);
- this.setPathToEntity((PathEntity) null);
- this.setAttackTarget((EntityLivingBase) null);
- this.aiSit.setSitting(true);
- this.setHealth(20.0F);
- this.func_152115_b(p_70085_1_.getUniqueID().toString());
- this.playTameEffect(true);
- this.worldObj.setEntityState(this, (byte) 7);
- } else {
- this.playTameEffect(false);
- this.worldObj.setEntityState(this, (byte) 6);
- }
- }
-
- return true;
- }
-
- return super.interact(p_70085_1_);
- }
-
- @SideOnly(Side.CLIENT)
- public void handleHealthUpdate(byte p_70103_1_) {
- if (p_70103_1_ == 8) {
- this.mPrivateField3 = true;
- this.timeWolfIsShaking = 0.0F;
- this.prevTimeWolfIsShaking = 0.0F;
- } else {
- super.handleHealthUpdate(p_70103_1_);
- }
- }
-
- @SideOnly(Side.CLIENT)
- public float getTailRotation() {
- return this.isAngry() ? 1.5393804F
- : (this.isTamed()
- ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float) Math.PI
- : ((float) Math.PI / 5F));
- }
-
- /**
- * Checks if the parameter is an item which this animal can be fed to breed it
- * (wheat, carrots or seeds depending on the animal type)
- */
- public boolean isBreedingItem(ItemStack p_70877_1_) {
- return p_70877_1_ == null ? false
- : (!(p_70877_1_.getItem() instanceof ItemFood) ? false
- : ((ItemFood) p_70877_1_.getItem()).isWolfsFavoriteMeat());
- }
-
- /**
- * Will return how many at most can spawn in a chunk at once.
- */
- public int getMaxSpawnedInChunk() {
- return 8;
- }
-
- /**
- * Determines whether this dingo is angry or not.
- */
- public boolean isAngry() {
- return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0;
- }
-
- /**
- * Sets whether this dingo is angry or not.
- */
- public void setAngry(boolean p_70916_1_) {
- byte b0 = this.dataWatcher.getWatchableObjectByte(16);
-
- if (p_70916_1_) {
- this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
- } else {
- this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
- }
- }
-
- /**
- * Return this dingo's collar color.
- */
- public int getCollarColor() {
- return this.dataWatcher.getWatchableObjectByte(20) & 15;
- }
-
- /**
- * Set this dingo's collar color.
- */
- public void setCollarColor(int p_82185_1_) {
- this.dataWatcher.updateObject(20, Byte.valueOf((byte) (p_82185_1_ & 15)));
- }
-
- public EntityDingo createChild(EntityAgeable p_90011_1_) {
- EntityDingo entitydingo = new EntityDingo(this.worldObj);
- String s = this.func_152113_b();
-
- if (s != null && s.trim().length() > 0) {
- entitydingo.func_152115_b(s);
- entitydingo.setTamed(true);
- }
-
- return entitydingo;
- }
-
- public void func_70918_i(boolean p_70918_1_) {
- if (p_70918_1_) {
- this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
- } else {
- this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
- }
- }
-
- /**
- * Returns true if the mob is currently able to mate with the specified mob.
- */
- public boolean canMateWith(EntityAnimal p_70878_1_) {
- if (p_70878_1_ == this) {
- return false;
- } else if (!this.isTamed()) {
- return false;
- } else if (!(p_70878_1_ instanceof EntityDingo)) {
- return false;
- } else {
- EntityDingo entitydingo = (EntityDingo) p_70878_1_;
- return !entitydingo.isTamed() ? false
- : (entitydingo.isSitting() ? false : this.isInLove() && entitydingo.isInLove());
- }
- }
-
- public boolean func_70922_bv() {
- return this.dataWatcher.getWatchableObjectByte(19) == 1;
- }
-
- /**
- * Determines if an entity can be despawned, used on idle far away entities
- */
- protected boolean canDespawn() {
- return !this.isTamed() && this.ticksExisted > 2400;
- }
-
- public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
- if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
- if (p_142018_1_ instanceof EntityDingo) {
- EntityDingo entitydingo = (EntityDingo) p_142018_1_;
-
- if (entitydingo.isTamed() && entitydingo.getOwner() == p_142018_2_) {
- return false;
- }
- }
-
- return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer
- && !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false
- : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
- } else {
- return false;
- }
- }
-} \ No newline at end of file
+ private float mPrivateField1;
+ private float mPrivateField2;
+ private boolean mPrivateField3;
+
+ /** true is the dingo is wet else false */
+ private boolean isShaking;
+ /** This time increases while dingo is shaking and emitting water particles. */
+ private float timeWolfIsShaking;
+
+ private float prevTimeWolfIsShaking;
+
+ public EntityDingo(World p_i1696_1_) {
+ super(p_i1696_1_);
+ this.setSize(0.6F, 0.8F);
+ this.getNavigator().setAvoidsWater(true);
+ this.tasks.addTask(1, new EntityAISwimming(this));
+ this.tasks.addTask(2, this.aiSit);
+ this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
+ this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
+ this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
+ this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
+ this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
+ this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
+ this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
+ this.tasks.addTask(9, new EntityAILookIdle(this));
+ this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
+ this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
+ this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
+ this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
+ this.setTamed(false);
+ }
+
+ protected void applyEntityAttributes() {
+ super.applyEntityAttributes();
+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D);
+
+ if (this.isTamed()) {
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
+ } else {
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D);
+ }
+ }
+
+ /**
+ * Returns true if the newer Entity AI code should be run
+ */
+ public boolean isAIEnabled() {
+ return true;
+ }
+
+ /**
+ * Sets the active target the Task system uses for tracking
+ */
+ public void setAttackTarget(EntityLivingBase p_70624_1_) {
+ super.setAttackTarget(p_70624_1_);
+
+ if (p_70624_1_ == null) {
+ this.setAngry(false);
+ } else if (!this.isTamed()) {
+ this.setAngry(true);
+ }
+ }
+
+ /**
+ * main AI tick function, replaces updateEntityActionState
+ */
+ protected void updateAITick() {
+ this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
+ }
+
+ protected void entityInit() {
+ super.entityInit();
+ }
+
+ protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) {
+ this.playSound("mob.wolf.step", 0.15F, 1.0F);
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
+ super.writeEntityToNBT(p_70014_1_);
+ }
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
+ super.readEntityFromNBT(p_70037_1_);
+ }
+
+ /**
+ * Returns the sound this mob makes while it's alive.
+ */
+ protected String getLivingSound() {
+ return this.isAngry()
+ ? "mob.wolf.growl"
+ : (this.rand.nextInt(3) == 0
+ ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F
+ ? "mob.wolf.whine"
+ : "mob.wolf.panting")
+ : "mob.wolf.bark");
+ }
+
+ /**
+ * Returns the sound this mob makes when it is hurt.
+ */
+ protected String getHurtSound() {
+ return "mob.wolf.hurt";
+ }
+
+ /**
+ * Returns the sound this mob makes on death.
+ */
+ protected String getDeathSound() {
+ return "mob.wolf.death";
+ }
+
+ /**
+ * Returns the volume for the sounds this mob makes.
+ */
+ protected float getSoundVolume() {
+ return 0.4F;
+ }
+
+ protected Item getDropItem() {
+ return Item.getItemById(-1);
+ }
+
+ /**
+ * Called frequently so the entity can update its state every tick as required.
+ * For example, zombies and skeletons use this to react to sunlight and start to
+ * burn.
+ */
+ public void onLivingUpdate() {
+ super.onLivingUpdate();
+
+ if (!this.worldObj.isRemote && this.isShaking && !this.mPrivateField3 && !this.hasPath() && this.onGround) {
+ this.mPrivateField3 = true;
+ this.timeWolfIsShaking = 0.0F;
+ this.prevTimeWolfIsShaking = 0.0F;
+ this.worldObj.setEntityState(this, (byte) 8);
+ }
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ public void onUpdate() {
+ super.onUpdate();
+ this.mPrivateField2 = this.mPrivateField1;
+
+ if (this.func_70922_bv()) {
+ this.mPrivateField1 += (1.0F - this.mPrivateField1) * 0.4F;
+ } else {
+ this.mPrivateField1 += (0.0F - this.mPrivateField1) * 0.4F;
+ }
+
+ if (this.func_70922_bv()) {
+ this.numTicksToChaseTarget = 10;
+ }
+
+ if (this.isWet()) {
+ this.isShaking = true;
+ this.mPrivateField3 = false;
+ this.timeWolfIsShaking = 0.0F;
+ this.prevTimeWolfIsShaking = 0.0F;
+ } else if ((this.isShaking || this.mPrivateField3) && this.mPrivateField3) {
+ if (this.timeWolfIsShaking == 0.0F) {
+ this.playSound(
+ "mob.wolf.shake",
+ this.getSoundVolume(),
+ (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ }
+
+ this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
+ this.timeWolfIsShaking += 0.05F;
+
+ if (this.prevTimeWolfIsShaking >= 2.0F) {
+ this.isShaking = false;
+ this.mPrivateField3 = false;
+ this.prevTimeWolfIsShaking = 0.0F;
+ this.timeWolfIsShaking = 0.0F;
+ }
+
+ if (this.timeWolfIsShaking > 0.4F) {
+ float f = (float) this.boundingBox.minY;
+ int i = (int) (MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float) Math.PI) * 7.0F);
+
+ for (int j = 0; j < i; ++j) {
+ float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
+ float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
+ this.worldObj.spawnParticle(
+ "splash",
+ this.posX + (double) f1,
+ (double) (f + 0.8F),
+ this.posZ + (double) f2,
+ this.motionX,
+ this.motionY,
+ this.motionZ);
+ }
+ }
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public boolean getWolfShaking() {
+ return this.isShaking;
+ }
+
+ /**
+ * Used when calculating the amount of shading to apply while the dingo is
+ * shaking.
+ */
+ @SideOnly(Side.CLIENT)
+ public float getShadingWhileShaking(float p_70915_1_) {
+ return 0.75F
+ + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_)
+ / 2.0F
+ * 0.25F;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public float getShakeAngle(float p_70923_1_, float p_70923_2_) {
+ float f2 = (this.prevTimeWolfIsShaking
+ + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_
+ + p_70923_2_)
+ / 1.8F;
+
+ if (f2 < 0.0F) {
+ f2 = 0.0F;
+ } else if (f2 > 1.0F) {
+ f2 = 1.0F;
+ }
+
+ return MathHelper.sin(f2 * (float) Math.PI)
+ * MathHelper.sin(f2 * (float) Math.PI * 11.0F)
+ * 0.15F
+ * (float) Math.PI;
+ }
+
+ public float getEyeHeight() {
+ return this.height * 0.8F;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public float getInterestedAngle(float p_70917_1_) {
+ return (this.mPrivateField2 + (this.mPrivateField1 - this.mPrivateField2) * p_70917_1_)
+ * 0.15F
+ * (float) Math.PI;
+ }
+
+ /**
+ * The speed it takes to move the entityliving's rotationPitch through the
+ * faceEntity method. This is only currently use in wolves.
+ */
+ public int getVerticalFaceSpeed() {
+ return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
+ }
+
+ /**
+ * Called when the entity is attacked.
+ */
+ public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
+ if (this.isEntityInvulnerable()) {
+ return false;
+ } else {
+ Entity entity = p_70097_1_.getEntity();
+ this.aiSit.setSitting(false);
+
+ if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) {
+ p_70097_2_ = (p_70097_2_ + 1.0F) / 2.0F;
+ }
+
+ return super.attackEntityFrom(p_70097_1_, p_70097_2_);
+ }
+ }
+
+ public boolean attackEntityAsMob(Entity p_70652_1_) {
+ int i = this.isTamed() ? 4 : 2;
+ return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i);
+ }
+
+ public void setTamed(boolean p_70903_1_) {
+ super.setTamed(p_70903_1_);
+
+ if (p_70903_1_) {
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
+ } else {
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D);
+ }
+ }
+
+ /**
+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets
+ * into the saddle on a pig.
+ */
+ public boolean interact(EntityPlayer p_70085_1_) {
+ ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
+
+ if (this.isTamed()) {
+ if (itemstack != null) {
+ if (itemstack.getItem() instanceof ItemFood) {
+ ItemFood itemfood = (ItemFood) itemstack.getItem();
+
+ if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) {
+ if (!p_70085_1_.capabilities.isCreativeMode) {
+ --itemstack.stackSize;
+ }
+
+ this.heal((float) itemfood.func_150905_g(itemstack));
+
+ if (itemstack.stackSize <= 0) {
+ p_70085_1_.inventory.setInventorySlotContents(
+ p_70085_1_.inventory.currentItem, (ItemStack) null);
+ }
+
+ return true;
+ }
+ } else if (itemstack.getItem() == Items.dye) {
+ int i = BlockColored.func_150032_b(itemstack.getItemDamage());
+
+ if (i != this.getCollarColor()) {
+ this.setCollarColor(i);
+
+ if (!p_70085_1_.capabilities.isCreativeMode && --itemstack.stackSize <= 0) {
+ p_70085_1_.inventory.setInventorySlotContents(
+ p_70085_1_.inventory.currentItem, (ItemStack) null);
+ }
+
+ return true;
+ }
+ }
+ }
+
+ if (this.func_152114_e(p_70085_1_) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack)) {
+ this.aiSit.setSitting(!this.isSitting());
+ this.isJumping = false;
+ this.setPathToEntity((PathEntity) null);
+ this.setTarget((Entity) null);
+ this.setAttackTarget((EntityLivingBase) null);
+ }
+ } else if (itemstack != null && itemstack.getItem() == Items.bone && !this.isAngry()) {
+ if (!p_70085_1_.capabilities.isCreativeMode) {
+ --itemstack.stackSize;
+ }
+
+ if (itemstack.stackSize <= 0) {
+ p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack) null);
+ }
+
+ if (!this.worldObj.isRemote) {
+ if (this.rand.nextInt(3) == 0) {
+ this.setTamed(true);
+ this.setPathToEntity((PathEntity) null);
+ this.setAttackTarget((EntityLivingBase) null);
+ this.aiSit.setSitting(true);
+ this.setHealth(20.0F);
+ this.func_152115_b(p_70085_1_.getUniqueID().toString());
+ this.playTameEffect(true);
+ this.worldObj.setEntityState(this, (byte) 7);
+ } else {
+ this.playTameEffect(false);
+ this.worldObj.setEntityState(this, (byte) 6);
+ }
+ }
+
+ return true;
+ }
+
+ return super.interact(p_70085_1_);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void handleHealthUpdate(byte p_70103_1_) {
+ if (p_70103_1_ == 8) {
+ this.mPrivateField3 = true;
+ this.timeWolfIsShaking = 0.0F;
+ this.prevTimeWolfIsShaking = 0.0F;
+ } else {
+ super.handleHealthUpdate(p_70103_1_);
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public float getTailRotation() {
+ return this.isAngry()
+ ? 1.5393804F
+ : (this.isTamed()
+ ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float) Math.PI
+ : ((float) Math.PI / 5F));
+ }
+
+ /**
+ * Checks if the parameter is an item which this animal can be fed to breed it
+ * (wheat, carrots or seeds depending on the animal type)
+ */
+ public boolean isBreedingItem(ItemStack p_70877_1_) {
+ return p_70877_1_ == null
+ ? false
+ : (!(p_70877_1_.getItem() instanceof ItemFood)
+ ? false
+ : ((ItemFood) p_70877_1_.getItem()).isWolfsFavoriteMeat());
+ }
+
+ /**
+ * Will return how many at most can spawn in a chunk at once.
+ */
+ public int getMaxSpawnedInChunk() {
+ return 8;
+ }
+
+ /**
+ * Determines whether this dingo is angry or not.
+ */
+ public boolean isAngry() {
+ return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0;
+ }
+
+ /**
+ * Sets whether this dingo is angry or not.
+ */
+ public void setAngry(boolean p_70916_1_) {
+ byte b0 = this.dataWatcher.getWatchableObjectByte(16);
+
+ if (p_70916_1_) {
+ this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
+ } else {
+ this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
+ }
+ }
+
+ /**
+ * Return this dingo's collar color.
+ */
+ public int getCollarColor() {
+ return this.dataWatcher.getWatchableObjectByte(20) & 15;
+ }
+
+ /**
+ * Set this dingo's collar color.
+ */
+ public void setCollarColor(int p_82185_1_) {
+ this.dataWatcher.updateObject(20, Byte.valueOf((byte) (p_82185_1_ & 15)));
+ }
+
+ public EntityDingo createChild(EntityAgeable p_90011_1_) {
+ EntityDingo entitydingo = new EntityDingo(this.worldObj);
+ String s = this.func_152113_b();
+
+ if (s != null && s.trim().length() > 0) {
+ entitydingo.func_152115_b(s);
+ entitydingo.setTamed(true);
+ }
+
+ return entitydingo;
+ }
+
+ public void func_70918_i(boolean p_70918_1_) {
+ if (p_70918_1_) {
+ this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
+ } else {
+ this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
+ }
+ }
+
+ /**
+ * Returns true if the mob is currently able to mate with the specified mob.
+ */
+ public boolean canMateWith(EntityAnimal p_70878_1_) {
+ if (p_70878_1_ == this) {
+ return false;
+ } else if (!this.isTamed()) {
+ return false;
+ } else if (!(p_70878_1_ instanceof EntityDingo)) {
+ return false;
+ } else {
+ EntityDingo entitydingo = (EntityDingo) p_70878_1_;
+ return !entitydingo.isTamed()
+ ? false
+ : (entitydingo.isSitting() ? false : this.isInLove() && entitydingo.isInLove());
+ }
+ }
+
+ public boolean func_70922_bv() {
+ return this.dataWatcher.getWatchableObjectByte(19) == 1;
+ }
+
+ /**
+ * Determines if an entity can be despawned, used on idle far away entities
+ */
+ protected boolean canDespawn() {
+ return !this.isTamed() && this.ticksExisted > 2400;
+ }
+
+ public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
+ if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
+ if (p_142018_1_ instanceof EntityDingo) {
+ EntityDingo entitydingo = (EntityDingo) p_142018_1_;
+
+ if (entitydingo.isTamed() && entitydingo.getOwner() == p_142018_2_) {
+ return false;
+ }
+ }
+
+ return p_142018_1_ instanceof EntityPlayer
+ && p_142018_2_ instanceof EntityPlayer
+ && !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_)
+ ? false
+ : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/entity/type/EntityOctopus.java b/src/main/java/gtPlusPlus/australia/entity/type/EntityOctopus.java
index f88d931b52..9d9f883865 100644
--- a/src/main/java/gtPlusPlus/australia/entity/type/EntityOctopus.java
+++ b/src/main/java/gtPlusPlus/australia/entity/type/EntityOctopus.java
@@ -9,8 +9,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
-public class EntityOctopus extends EntityWaterMob
-{
+public class EntityOctopus extends EntityWaterMob {
public float octopusPitch;
public float prevSquidPitch;
public float octopusYaw;
@@ -23,23 +22,23 @@ public class EntityOctopus extends EntityWaterMob
public float tentacleAngle;
/** the last calculated angle of the tentacles in radians */
public float lastTentacleAngle;
+
private float randomMotionSpeed;
/** change in octopusRotation in radians. */
private float rotationVelocity;
+
private float field_70871_bB;
private float randomMotionVecX;
private float randomMotionVecY;
private float randomMotionVecZ;
- public EntityOctopus(World p_i1693_1_)
- {
+ public EntityOctopus(World p_i1693_1_) {
super(p_i1693_1_);
this.setSize(0.95F, 0.95F);
this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F;
}
- protected void applyEntityAttributes()
- {
+ protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
}
@@ -47,37 +46,32 @@ public class EntityOctopus extends EntityWaterMob
/**
* Returns the sound this mob makes while it's alive.
*/
- protected String getLivingSound()
- {
+ protected String getLivingSound() {
return null;
}
/**
* Returns the sound this mob makes when it is hurt.
*/
- protected String getHurtSound()
- {
+ protected String getHurtSound() {
return null;
}
/**
* Returns the sound this mob makes on death.
*/
- protected String getDeathSound()
- {
+ protected String getDeathSound() {
return null;
}
/**
* Returns the volume for the sounds this mob makes.
*/
- protected float getSoundVolume()
- {
+ protected float getSoundVolume() {
return 0.4F;
}
- protected Item getDropItem()
- {
+ protected Item getDropItem() {
return Item.getItemById(0);
}
@@ -85,8 +79,7 @@ public class EntityOctopus extends EntityWaterMob
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
* prevent them from trampling crops
*/
- protected boolean canTriggerWalking()
- {
+ protected boolean canTriggerWalking() {
return false;
}
@@ -94,12 +87,10 @@ public class EntityOctopus extends EntityWaterMob
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
- protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
- {
+ protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
int j = this.rand.nextInt(3 + p_70628_2_) + 1;
- for (int k = 0; k < j; ++k)
- {
+ for (int k = 0; k < j; ++k) {
this.entityDropItem(new ItemStack(Items.dye, 1, 0), 0.0F);
}
}
@@ -108,17 +99,16 @@ public class EntityOctopus extends EntityWaterMob
* Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning
* true)
*/
- public boolean isInWater()
- {
- return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.6000000238418579D, 0.0D), Material.water, this);
+ public boolean isInWater() {
+ return this.worldObj.handleMaterialAcceleration(
+ this.boundingBox.expand(0.0D, -0.6000000238418579D, 0.0D), Material.water, this);
}
/**
* Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
* use this to react to sunlight and start to burn.
*/
- public void onLivingUpdate()
- {
+ public void onLivingUpdate() {
super.onLivingUpdate();
this.prevSquidPitch = this.octopusPitch;
this.prevSquidYaw = this.octopusYaw;
@@ -126,90 +116,78 @@ public class EntityOctopus extends EntityWaterMob
this.lastTentacleAngle = this.tentacleAngle;
this.octopusRotation += this.rotationVelocity;
- if (this.octopusRotation > ((float)Math.PI * 2F))
- {
- this.octopusRotation -= ((float)Math.PI * 2F);
+ if (this.octopusRotation > ((float) Math.PI * 2F)) {
+ this.octopusRotation -= ((float) Math.PI * 2F);
- if (this.rand.nextInt(10) == 0)
- {
+ if (this.rand.nextInt(10) == 0) {
this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F;
}
}
- if (this.isInWater())
- {
+ if (this.isInWater()) {
float f;
- if (this.octopusRotation < (float)Math.PI)
- {
- f = this.octopusRotation / (float)Math.PI;
- this.tentacleAngle = MathHelper.sin(f * f * (float)Math.PI) * (float)Math.PI * 0.25F;
+ if (this.octopusRotation < (float) Math.PI) {
+ f = this.octopusRotation / (float) Math.PI;
+ this.tentacleAngle = MathHelper.sin(f * f * (float) Math.PI) * (float) Math.PI * 0.25F;
- if ((double)f > 0.75D)
- {
+ if ((double) f > 0.75D) {
this.randomMotionSpeed = 1.0F;
this.field_70871_bB = 1.0F;
- }
- else
- {
+ } else {
this.field_70871_bB *= 0.8F;
}
- }
- else
- {
+ } else {
this.tentacleAngle = 0.0F;
this.randomMotionSpeed *= 0.9F;
this.field_70871_bB *= 0.99F;
}
- if (!this.worldObj.isRemote)
- {
- this.motionX = (double)(this.randomMotionVecX * this.randomMotionSpeed);
- this.motionY = (double)(this.randomMotionVecY * this.randomMotionSpeed);
- this.motionZ = (double)(this.randomMotionVecZ * this.randomMotionSpeed);
+ if (!this.worldObj.isRemote) {
+ this.motionX = (double) (this.randomMotionVecX * this.randomMotionSpeed);
+ this.motionY = (double) (this.randomMotionVecY * this.randomMotionSpeed);
+ this.motionZ = (double) (this.randomMotionVecZ * this.randomMotionSpeed);
}
f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
- this.renderYawOffset += (-((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI - this.renderYawOffset) * 0.1F;
+ this.renderYawOffset += (-((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI
+ - this.renderYawOffset)
+ * 0.1F;
this.rotationYaw = this.renderYawOffset;
- this.octopusYaw += (float)Math.PI * this.field_70871_bB * 1.5F;
- this.octopusPitch += (-((float)Math.atan2((double)f, this.motionY)) * 180.0F / (float)Math.PI - this.octopusPitch) * 0.1F;
- }
- else
- {
- this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.octopusRotation)) * (float)Math.PI * 0.25F;
-
- if (!this.worldObj.isRemote)
- {
+ this.octopusYaw += (float) Math.PI * this.field_70871_bB * 1.5F;
+ this.octopusPitch +=
+ (-((float) Math.atan2((double) f, this.motionY)) * 180.0F / (float) Math.PI - this.octopusPitch)
+ * 0.1F;
+ } else {
+ this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.octopusRotation)) * (float) Math.PI * 0.25F;
+
+ if (!this.worldObj.isRemote) {
this.motionX = 0.0D;
this.motionY -= 0.08D;
this.motionY *= 0.9800000190734863D;
this.motionZ = 0.0D;
}
- this.octopusPitch = (float)((double)this.octopusPitch + (double)(-90.0F - this.octopusPitch) * 0.02D);
+ this.octopusPitch = (float) ((double) this.octopusPitch + (double) (-90.0F - this.octopusPitch) * 0.02D);
}
}
/**
* Moves the entity based on the specified heading. Args: strafe, forward
*/
- public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_)
- {
+ public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) {
this.moveEntity(this.motionX, this.motionY, this.motionZ);
}
- protected void updateEntityActionState()
- {
+ protected void updateEntityActionState() {
++this.entityAge;
- if (this.entityAge > 100)
- {
+ if (this.entityAge > 100) {
this.randomMotionVecX = this.randomMotionVecY = this.randomMotionVecZ = 0.0F;
- }
- else if (this.rand.nextInt(50) == 0 || !this.inWater || this.randomMotionVecX == 0.0F && this.randomMotionVecY == 0.0F && this.randomMotionVecZ == 0.0F)
- {
- float f = this.rand.nextFloat() * (float)Math.PI * 2.0F;
+ } else if (this.rand.nextInt(50) == 0
+ || !this.inWater
+ || this.randomMotionVecX == 0.0F && this.randomMotionVecY == 0.0F && this.randomMotionVecZ == 0.0F) {
+ float f = this.rand.nextFloat() * (float) Math.PI * 2.0F;
this.randomMotionVecX = MathHelper.cos(f) * 0.2F;
this.randomMotionVecY = -0.1F + this.rand.nextFloat() * 0.2F;
this.randomMotionVecZ = MathHelper.sin(f) * 0.2F;
@@ -221,8 +199,7 @@ public class EntityOctopus extends EntityWaterMob
/**
* Checks if the entity's current position is a valid location to spawn this entity.
*/
- public boolean getCanSpawnHere()
- {
+ public boolean getCanSpawnHere() {
return this.posY > 45.0D && this.posY < 63.0D && super.getCanSpawnHere();
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java b/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java
index 18f9e6684f..cd88940e11 100644
--- a/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java
+++ b/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java
@@ -1,294 +1,235 @@
package gtPlusPlus.australia.gen.gt;
-import java.util.Hashtable;
-
import gregtech.api.enums.Materials;
-
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.everglades.object.BoxedQuad;
+import java.util.Hashtable;
public class WorldGen_Australia_Ores {
-
- /**
- * Set Ore Types on by one.
- */
- private static final Material PYRITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Pyrite);
- private static final Material PYROPE = MaterialUtils.generateMaterialFromGtENUM(Materials.Pyrope);
- private static final Material ALMANDINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Almandine);
- private static final Material RUBY = MaterialUtils.generateMaterialFromGtENUM(Materials.Ruby);
- private static final Material CHALCOPYRITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Chalcopyrite);
- private static final Material TOPAZ = MaterialUtils.generateMaterialFromGtENUM(Materials.Topaz);
- private static final Material SAPPHIRE_GREEN = MaterialUtils.generateMaterialFromGtENUM(Materials.GreenSapphire);
- private static final Material SAPPHIRE_BLUE = MaterialUtils.generateMaterialFromGtENUM(Materials.Sapphire);
-
-
- private static final Material EMERALD = MaterialUtils.generateMaterialFromGtENUM(Materials.Emerald);
- private static final Material DIAMOND = MaterialUtils.generateMaterialFromGtENUM(Materials.Diamond);
- private static final Material BANDED_IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.BandedIron);
- private static final Material LIM_YELLOW = MaterialUtils.generateMaterialFromGtENUM(Materials.YellowLimonite);
- private static final Material LIM_BROWN = MaterialUtils.generateMaterialFromGtENUM(Materials.BrownLimonite);
- private static final Material TETRAHEDRITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Tetrahedrite);
- private static final Material COAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Coal);
- private static final Material SHIT_COAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Lignite);
- private static final Material GRAPHITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Graphite);
-
-
-
- public static WorldGen_GT_Australia_Ore_Layer BaseVein = new WorldGen_GT_Australia_Ore_Layer(
- "veinA",
- 0, 128,
- 5,
- 8,
- 32,
- ELEMENT.getInstance().IRON,
- BANDED_IRON,
- LIM_YELLOW,
- TETRAHEDRITE);
-
-
-
- /**
- * Custom ore Veins
- */
-
- public static WorldGen_GT_Australia_Ore_Layer Vein1 = new WorldGen_GT_Australia_Ore_Layer(
- "vein1",
- 0, 10,
- 1,
- 8,
- 16,
- EMERALD,
- SHIT_COAL,
- TOPAZ,
- DIAMOND);
-
- public static WorldGen_GT_Australia_Ore_Layer Vein2 = new WorldGen_GT_Australia_Ore_Layer(
- "vein2",
- 0, 128,
- 20,
- 16,
- 64,
- COAL,
- COAL,
- SHIT_COAL,
- SHIT_COAL);
+ /**
+ * Set Ore Types on by one.
+ */
+ private static final Material PYRITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Pyrite);
+
+ private static final Material PYROPE = MaterialUtils.generateMaterialFromGtENUM(Materials.Pyrope);
+ private static final Material ALMANDINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Almandine);
+ private static final Material RUBY = MaterialUtils.generateMaterialFromGtENUM(Materials.Ruby);
+ private static final Material CHALCOPYRITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Chalcopyrite);
+ private static final Material TOPAZ = MaterialUtils.generateMaterialFromGtENUM(Materials.Topaz);
+ private static final Material SAPPHIRE_GREEN = MaterialUtils.generateMaterialFromGtENUM(Materials.GreenSapphire);
+ private static final Material SAPPHIRE_BLUE = MaterialUtils.generateMaterialFromGtENUM(Materials.Sapphire);
+
+ private static final Material EMERALD = MaterialUtils.generateMaterialFromGtENUM(Materials.Emerald);
+ private static final Material DIAMOND = MaterialUtils.generateMaterialFromGtENUM(Materials.Diamond);
+ private static final Material BANDED_IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.BandedIron);
+ private static final Material LIM_YELLOW = MaterialUtils.generateMaterialFromGtENUM(Materials.YellowLimonite);
+ private static final Material LIM_BROWN = MaterialUtils.generateMaterialFromGtENUM(Materials.BrownLimonite);
+ private static final Material TETRAHEDRITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Tetrahedrite);
+ private static final Material COAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Coal);
+ private static final Material SHIT_COAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Lignite);
+ private static final Material GRAPHITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Graphite);
+
+ public static WorldGen_GT_Australia_Ore_Layer BaseVein = new WorldGen_GT_Australia_Ore_Layer(
+ "veinA", 0, 128, 5, 8, 32, ELEMENT.getInstance().IRON, BANDED_IRON, LIM_YELLOW, TETRAHEDRITE);
+
+ /**
+ * Custom ore Veins
+ */
+ public static WorldGen_GT_Australia_Ore_Layer Vein1 =
+ new WorldGen_GT_Australia_Ore_Layer("vein1", 0, 10, 1, 8, 16, EMERALD, SHIT_COAL, TOPAZ, DIAMOND);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein2 =
+ new WorldGen_GT_Australia_Ore_Layer("vein2", 0, 128, 20, 16, 64, COAL, COAL, SHIT_COAL, SHIT_COAL);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein3 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein3",
+ 0,
+ 128,
+ 5,
+ 8,
+ 32,
+ ELEMENT.getInstance().IRON,
+ ELEMENT.getInstance().TIN,
+ ELEMENT.getInstance().GOLD,
+ ELEMENT.getInstance().LEAD);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein4 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein4",
+ 0,
+ 128,
+ 5,
+ 8,
+ 32,
+ ELEMENT.getInstance().GOLD,
+ ELEMENT.getInstance().COPPER,
+ ELEMENT.getInstance().COBALT,
+ ALMANDINE);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein5 =
+ new WorldGen_GT_Australia_Ore_Layer("vein5", 0, 128, 15, 8, 16, PYRITE, PYROPE, LIM_YELLOW, CHALCOPYRITE);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein6 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein6",
+ 0,
+ 128,
+ 5,
+ 8,
+ 32,
+ LIM_BROWN,
+ SAPPHIRE_GREEN,
+ ELEMENT.getInstance().IRON,
+ ELEMENT.getInstance().COPPER);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein7 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein7", 0, 128, 5, 8, 32, GRAPHITE, RUBY, LIM_YELLOW, ELEMENT.getInstance().NICKEL);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein8 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein8", 0, 128, 5, 8, 32, ELEMENT.getInstance().IRON, SAPPHIRE_BLUE, LIM_YELLOW, GRAPHITE);
+
+ /*public static WorldGen_GT_Australia_Ore_Layer Vein9 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein9",
+ 10, 30,
+ 20,
+ 4,
+ 64,
+ ORES.LANTHANITE_CE,
+ FLUORIDES.FLUORITE,
+ PLATINUM,
+ ORES.FLORENCITE);
+ public static WorldGen_GT_Australia_Ore_Layer Vein10 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein10",
+ 20, 50,
+ 20,
+ 8,
+ 32,
+ ORES.GEIKIELITE,
+ ORES.YTTROCERITE,
+ ORES.LANTHANITE_LA,
+ BAUXITE);
+ public static WorldGen_GT_Australia_Ore_Layer Vein11 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein11",
+ 30, 70,
+ 20,
+ 5,
+ 64,
+ FLUORIDES.FLUORITE,
+ SAPPHIRE_BLUE,
+ ORES.ZIRCON,
+ ORES.CRYOLITE);
+ public static WorldGen_GT_Australia_Ore_Layer Vein12 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein12",
+ 40, 80,
+ 20,
+ 8,
+ 32,
+ ORES.CERITE,
+ SAPPHIRE_GREEN,
+ CHALCOPYRITE,
+ ORES.HIBONITE);
+
+ */
+ /**
+ * Best Rarest Veins 2017
+ */
+ /*
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein13 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein13",
+ 5, 15,
+ 5,
+ 5,
+ 16,
+ ORES.CRYOLITE,
+ NAQPLUS,
+ NAQUADRIA,
+ ORES.FLORENCITE);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein14 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein14",
+ 10, 20,
+ 8,
+ 3,
+ 16,
+ URNAIUM235,
+ PLUTONIUM,
+ OSMIUM,
+ AMETHYST);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein15 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein15",
+ 5, 25,
+ 5,
+ 6,
+ 24,
+ ORES.FLUORCAPHITE,
+ BISMUTH,
+ ORES.GADOLINITE_CE,
+ ORES.GADOLINITE_Y);
+
+ public static WorldGen_GT_Australia_Ore_Layer Vein16 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein16",
+ 0, 25,
+ 4,
+ 6,
+ 32,
+ ORES.YTTROCERITE,
+ ORES.LEPERSONNITE,
+ INFUSEDGOLD,
+ FLUORIDES.FLUORITE);
- public static WorldGen_GT_Australia_Ore_Layer Vein3 = new WorldGen_GT_Australia_Ore_Layer(
- "vein3",
- 0, 128,
- 5,
- 8,
- 32,
- ELEMENT.getInstance().IRON,
- ELEMENT.getInstance().TIN,
- ELEMENT.getInstance().GOLD,
- ELEMENT.getInstance().LEAD);
+ public static WorldGen_GT_Australia_Ore_Layer Vein17 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein17",
+ 10, 35,
+ 4,
+ 5,
+ 32,
+ ORES.FLORENCITE,
+ URNAIUM235,
+ ORES.SAMARSKITE_YB,
+ ORES.POLYCRASE);
+ public static WorldGen_GT_Australia_Ore_Layer Vein18 = new WorldGen_GT_Australia_Ore_Layer(
+ "vein18",
+ 15, 40,
+ 4,
+ 4,
+ 64,
+ ORES.GADOLINITE_CE,
+ ORES.GADOLINITE_Y,
+ ORES.AGARDITE_LA,
+ ORES.AGARDITE_CD);*/
- public static WorldGen_GT_Australia_Ore_Layer Vein4 = new WorldGen_GT_Australia_Ore_Layer(
- "vein4",
- 0, 128,
- 5,
- 8,
- 32,
- ELEMENT.getInstance().GOLD,
- ELEMENT.getInstance().COPPER,
- ELEMENT.getInstance().COBALT,
- ALMANDINE);
-
-
-
- public static WorldGen_GT_Australia_Ore_Layer Vein5 = new WorldGen_GT_Australia_Ore_Layer(
- "vein5",
- 0, 128,
- 15,
- 8,
- 16,
- PYRITE,
- PYROPE,
- LIM_YELLOW,
- CHALCOPYRITE);
-
- public static WorldGen_GT_Australia_Ore_Layer Vein6 = new WorldGen_GT_Australia_Ore_Layer(
- "vein6",
- 0, 128,
- 5,
- 8,
- 32,
- LIM_BROWN,
- SAPPHIRE_GREEN,
- ELEMENT.getInstance().IRON,
- ELEMENT.getInstance().COPPER);
-
- public static WorldGen_GT_Australia_Ore_Layer Vein7 = new WorldGen_GT_Australia_Ore_Layer(
- "vein7",
- 0, 128,
- 5,
- 8,
- 32,
- GRAPHITE,
- RUBY,
- LIM_YELLOW,
- ELEMENT.getInstance().NICKEL);
-
- public static WorldGen_GT_Australia_Ore_Layer Vein8 = new WorldGen_GT_Australia_Ore_Layer(
- "vein8",
- 0, 128,
- 5,
- 8,
- 32,
- ELEMENT.getInstance().IRON,
- SAPPHIRE_BLUE,
- LIM_YELLOW,
- GRAPHITE);
-
-
-
+ public static Hashtable<Long, WorldGen_GT_Australia_Ore_Layer> validOreveins =
+ new Hashtable<Long, WorldGen_GT_Australia_Ore_Layer>(1024);
- /*public static WorldGen_GT_Australia_Ore_Layer Vein9 = new WorldGen_GT_Australia_Ore_Layer(
- "vein9",
- 10, 30,
- 20,
- 4,
- 64,
- ORES.LANTHANITE_CE,
- FLUORIDES.FLUORITE,
- PLATINUM,
- ORES.FLORENCITE);
- public static WorldGen_GT_Australia_Ore_Layer Vein10 = new WorldGen_GT_Australia_Ore_Layer(
- "vein10",
- 20, 50,
- 20,
- 8,
- 32,
- ORES.GEIKIELITE,
- ORES.YTTROCERITE,
- ORES.LANTHANITE_LA,
- BAUXITE);
- public static WorldGen_GT_Australia_Ore_Layer Vein11 = new WorldGen_GT_Australia_Ore_Layer(
- "vein11",
- 30, 70,
- 20,
- 5,
- 64,
- FLUORIDES.FLUORITE,
- SAPPHIRE_BLUE,
- ORES.ZIRCON,
- ORES.CRYOLITE);
- public static WorldGen_GT_Australia_Ore_Layer Vein12 = new WorldGen_GT_Australia_Ore_Layer(
- "vein12",
- 40, 80,
- 20,
- 8,
- 32,
- ORES.CERITE,
- SAPPHIRE_GREEN,
- CHALCOPYRITE,
- ORES.HIBONITE);
-
- *//**
- * Best Rarest Veins 2017
- *//*
-
- public static WorldGen_GT_Australia_Ore_Layer Vein13 = new WorldGen_GT_Australia_Ore_Layer(
- "vein13",
- 5, 15,
- 5,
- 5,
- 16,
- ORES.CRYOLITE,
- NAQPLUS,
- NAQUADRIA,
- ORES.FLORENCITE);
+ public static volatile BoxedQuad<Integer, Integer, Integer, Integer> OreVein1 =
+ new BoxedQuad<Integer, Integer, Integer, Integer>(null, null, null, null);
- public static WorldGen_GT_Australia_Ore_Layer Vein14 = new WorldGen_GT_Australia_Ore_Layer(
- "vein14",
- 10, 20,
- 8,
- 3,
- 16,
- URNAIUM235,
- PLUTONIUM,
- OSMIUM,
- AMETHYST);
+ static long ID = 0;
- public static WorldGen_GT_Australia_Ore_Layer Vein15 = new WorldGen_GT_Australia_Ore_Layer(
- "vein15",
- 5, 25,
- 5,
- 6,
- 24,
- ORES.FLUORCAPHITE,
- BISMUTH,
- ORES.GADOLINITE_CE,
- ORES.GADOLINITE_Y);
+ public static void generateValidOreVeins() {
+ validOreveins.put(ID++, BaseVein);
- public static WorldGen_GT_Australia_Ore_Layer Vein16 = new WorldGen_GT_Australia_Ore_Layer(
- "vein16",
- 0, 25,
- 4,
- 6,
- 32,
- ORES.YTTROCERITE,
- ORES.LEPERSONNITE,
- INFUSEDGOLD,
- FLUORIDES.FLUORITE);
-
- public static WorldGen_GT_Australia_Ore_Layer Vein17 = new WorldGen_GT_Australia_Ore_Layer(
- "vein17",
- 10, 35,
- 4,
- 5,
- 32,
- ORES.FLORENCITE,
- URNAIUM235,
- ORES.SAMARSKITE_YB,
- ORES.POLYCRASE);
- public static WorldGen_GT_Australia_Ore_Layer Vein18 = new WorldGen_GT_Australia_Ore_Layer(
- "vein18",
- 15, 40,
- 4,
- 4,
- 64,
- ORES.GADOLINITE_CE,
- ORES.GADOLINITE_Y,
- ORES.AGARDITE_LA,
- ORES.AGARDITE_CD);*/
-
-
-
-
- public static Hashtable<Long, WorldGen_GT_Australia_Ore_Layer> validOreveins = new Hashtable<Long, WorldGen_GT_Australia_Ore_Layer>(
- 1024);
-
+ validOreveins.put(ID++, Vein1);
+ validOreveins.put(ID++, Vein2);
+ validOreveins.put(ID++, Vein3);
+ validOreveins.put(ID++, Vein4);
+ validOreveins.put(ID++, Vein5);
+ validOreveins.put(ID++, Vein6);
+ validOreveins.put(ID++, Vein7);
+ validOreveins.put(ID++, Vein8);
- public static volatile BoxedQuad<Integer, Integer, Integer, Integer> OreVein1 = new BoxedQuad<Integer, Integer, Integer, Integer>(null, null, null, null);
-
- static long ID = 0;
- public static void generateValidOreVeins(){
- validOreveins.put(ID++, BaseVein);
-
- validOreveins.put(ID++, Vein1);
- validOreveins.put(ID++, Vein2);
- validOreveins.put(ID++, Vein3);
- validOreveins.put(ID++, Vein4);
- validOreveins.put(ID++, Vein5);
- validOreveins.put(ID++, Vein6);
- validOreveins.put(ID++, Vein7);
- validOreveins.put(ID++, Vein8);
-
- /*validOreveins.put(ID++, Vein9);
- validOreveins.put(ID++, Vein10);
- validOreveins.put(ID++, Vein11);
- validOreveins.put(ID++, Vein12);
- validOreveins.put(ID++, Vein13);
- validOreveins.put(ID++, Vein14);
- validOreveins.put(ID++, Vein15);
- validOreveins.put(ID++, Vein16);
- validOreveins.put(ID++, Vein17);
- validOreveins.put(ID++, Vein18);*/
- }
-
+ /*validOreveins.put(ID++, Vein9);
+ validOreveins.put(ID++, Vein10);
+ validOreveins.put(ID++, Vein11);
+ validOreveins.put(ID++, Vein12);
+ validOreveins.put(ID++, Vein13);
+ validOreveins.put(ID++, Vein14);
+ validOreveins.put(ID++, Vein15);
+ validOreveins.put(ID++, Vein16);
+ validOreveins.put(ID++, Vein17);
+ validOreveins.put(ID++, Vein18);*/
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java b/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java
index 93d5524a66..988e455aa7 100644
--- a/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java
+++ b/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java
@@ -1,48 +1,60 @@
package gtPlusPlus.australia.gen.gt;
+import gtPlusPlus.australia.GTplusplus_Australia;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
-
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
-import gtPlusPlus.australia.GTplusplus_Australia;
public abstract class WorldGen_GT_Australia {
- public final String mWorldGenName;
- public final boolean mEnabled;
- private final Map<String, Boolean> mDimensionMap = new ConcurrentHashMap<String, Boolean>();
-
- public WorldGen_GT_Australia(String aName, List aList, boolean aDefault) {
- this.mWorldGenName = aName;
- this.mEnabled = GTplusplus_Australia.sCustomWorldgenFile.get("worldgen", this.mWorldGenName, aDefault);
- if (this.mEnabled) {
- aList.add(this);
- }
-
- }
-
- public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX,
- int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
- return false;
- }
-
- 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 = (Boolean) this.mDimensionMap.get(aDimName);
- if (tAllowed == null) {
- boolean tValue = GTplusplus_Australia.sCustomWorldgenFile.get("worldgen.dimensions." + this.mWorldGenName, aDimName,
- aDimensionType == aAllowedDimensionType);
- this.mDimensionMap.put(aDimName, Boolean.valueOf(tValue));
- return tValue;
- } else {
- return tAllowed.booleanValue();
- }
- }
-} \ No newline at end of file
+ public final String mWorldGenName;
+ public final boolean mEnabled;
+ private final Map<String, Boolean> mDimensionMap = new ConcurrentHashMap<String, Boolean>();
+
+ public WorldGen_GT_Australia(String aName, List aList, boolean aDefault) {
+ this.mWorldGenName = aName;
+ this.mEnabled = GTplusplus_Australia.sCustomWorldgenFile.get("worldgen", this.mWorldGenName, aDefault);
+ if (this.mEnabled) {
+ aList.add(this);
+ }
+ }
+
+ public boolean executeWorldgen(
+ World aWorld,
+ Random aRandom,
+ String aBiome,
+ int aDimensionType,
+ int aChunkX,
+ int aChunkZ,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider) {
+ return false;
+ }
+
+ 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 = (Boolean) this.mDimensionMap.get(aDimName);
+ if (tAllowed == null) {
+ boolean tValue = GTplusplus_Australia.sCustomWorldgenFile.get(
+ "worldgen.dimensions." + this.mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType);
+ this.mDimensionMap.put(aDimName, Boolean.valueOf(tValue));
+ return tValue;
+ } else {
+ return tAllowed.booleanValue();
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java b/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java
index 917c1eb746..86a16d7569 100644
--- a/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java
+++ b/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java
@@ -1,471 +1,540 @@
package gtPlusPlus.australia.gen.gt;
-import java.util.*;
-
import cpw.mods.fml.common.IWorldGenerator;
-
-import net.minecraft.block.Block;
-import net.minecraft.world.World;
-import net.minecraft.world.chunk.Chunk;
-import net.minecraft.world.chunk.IChunkProvider;
-import net.minecraft.world.gen.feature.WorldGenMinable;
-
import gregtech.api.util.GT_Log;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.australia.dimension.Dimension_Australia;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.xmod.gregtech.HANDLER_GT;
+import java.util.*;
+import net.minecraft.block.Block;
+import net.minecraft.world.World;
+import net.minecraft.world.chunk.Chunk;
+import net.minecraft.world.chunk.IChunkProvider;
+import net.minecraft.world.gen.feature.WorldGenMinable;
public class WorldGen_GT_Australia_Base implements IWorldGenerator {
- /**
- * Class Variables
- */
-
- /**
- * Control percentage of filled 3x3 chunks. Lower number means less oreveins
- * spawn
- */
- public static int oreveinPercentage;
- /**
- * Control number of attempts to find a valid orevein. Generally this
- * maximum limit isn't hit, selecting a vein is cheap
- */
- public static int oreveinAttempts;
- /**
- * Control number of attempts to place a valid orevein. If a vein wasn't
- * placed due to height restrictions, completely in the water, etc, another
- * attempt is tried.
- */
- public static int oreveinMaxPlacementAttempts;
- /**
- * Debug parameter for world generation. Tracks chunks added/removed from
- * run queue.
- */
- public static boolean debugWorldGen = false;
- /**
- * Try re-implement Richard Hendrick's Chunk by Chunk Ore Generation from
- * his GT5u fork.
- */
-
- public static List<Runnable> mList = new ArrayList<Runnable>();
- public static HashSet<Long> ProcChunks = new HashSet<Long>();
- // This is probably not going to work. Trying to create a fake orevein to
- // put into hashtable when there will be no ores in a vein.
- public static WorldGen_GT_Australia_Ore_Layer noOresInVein = new WorldGen_GT_Australia_Ore_Layer("vein0", 0, 255, 0, 0,
- 0, ELEMENT.getInstance().IRON, ELEMENT.getInstance().GOLD, ELEMENT.getInstance().LEAD, ELEMENT.getInstance().TIN);
-
- public static Hashtable<Long, WorldGen_GT_Australia_Ore_Layer> validOreveins = new Hashtable<Long, WorldGen_GT_Australia_Ore_Layer>(
- 1024);
-
- public boolean mIsGenerating = false;
- public static final Object listLock = new Object();
- // private static boolean gcAsteroids = true;
-
- public WorldGen_GT_Australia_Base() {
- if (debugWorldGen) {
- GT_Log.out.println("GTPP_Worldgenerator created");
- }
- }
-
- @Override
- public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
- IChunkProvider chunkProvider) {
- if (world.provider.dimensionId == Dimension_Australia.DIMID) {
- generateSafely(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
- }
- }
-
- public synchronized void generateSafely(Random random, int chunkX, int chunkZ, World world,
- IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
- int xDim = Dimension_Australia.DIMID;
- switch (world.provider.dimensionId) {
- case -1: // Nether
- // generateNether(world, random, chunkX * 16, chunkZ * 16);
- break;
- case 0: // Overworld
- // generateSurface(world, random, chunkX * 16, chunkZ * 16);
- break;
- case 1: // End
- // generateEnd(world, random, chunkX * 16, chunkZ * 16);
- break;
- default: // Any other dimension
- if (world.provider.dimensionId != xDim) {
- break;
- }
- else {
- generateEverglades(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
- break;
- }
- }
- }
-
- private synchronized void generateEverglades(Random aRandom, int aX, int aZ, World aWorld,
- IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
- Logger.WARNING("Trying to Generate Dimension.");
- synchronized (listLock) {
- Logger.WARNING("Locked List addition.");
- if (WorldGen_GT_Australia_Base.mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) + 1), aX, aZ,
- Dimension_Australia.DIMID,
- aWorld, aChunkGenerator, aChunkProvider,
- aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName))){
- Logger.WARNING("Locked List addition. Success.");
- }
- else {
- Logger.WARNING("Locked List addition. Fail.");
- }
- if (debugWorldGen)
- GT_Log.out.println("ADD WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId
- + " chunk x:" + aX + " z:" + aZ + " SIZE: " + WorldGen_GT_Australia_Base.mList.size());
- }
-
- if (!this.mIsGenerating) {
- Logger.WARNING("Is not generating.");
- this.mIsGenerating = true;
- Logger.WARNING("Setting Generation to true.");
- int mList_sS = WorldGen_GT_Australia_Base.mList.size();
- mList_sS = Math.min(mList_sS, 3); // Run a maximum of 3 chunks at a
- // time through worldgen. Extra
- // chunks get done later.
- for (int i = 0; i < mList_sS; i++) {
- WorldGenContainer toRun = (WorldGenContainer) WorldGen_GT_Australia_Base.mList.get(0);
- if (debugWorldGen)
- GT_Log.out.println("RUN WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId
- + " chunk x:" + toRun.mX + " z:" + toRun.mZ + " SIZE: " + WorldGen_GT_Australia_Base.mList.size()
- + " i: " + i);
- synchronized (listLock) {
- Logger.WARNING("Locked List Removal.");
- WorldGen_GT_Australia_Base.mList.remove(0);
- }
- toRun.run();
- }
- this.mIsGenerating = false;
- Logger.WARNING("Is Generating now set to false..");
- }
- }
-
- public void generateOre(Block block, World world, Random random, int chunk_x, int chunk_z, int maxX, int maxZ,
- int maxVeinSize, int chancesToSpawn, int minY, int maxY, Block generateIn) {
- int heightRange = maxY - minY;
- WorldGenMinable worldgenminable = new WorldGenMinable(block, maxVeinSize, generateIn);
- for (int k1 = 0; k1 < chancesToSpawn; ++k1) {
- int xrand = random.nextInt(16);
- int yrand = random.nextInt(heightRange) + minY;
- int zrand = random.nextInt(16);
- worldgenminable.generate(world, random, chunk_x + xrand, yrand, chunk_z + zrand);
- }
- }
-
- public static class WorldGenContainer implements Runnable {
- public final Random mRandom;
- public final int mX;
- public final int mZ;
- public final int mDimensionType;
- public final World mWorld;
- public final IChunkProvider mChunkGenerator;
- public final IChunkProvider mChunkProvider;
- public final String mBiome;
-
- // Local class to track which orevein seeds must be checked when doing
- // chunkified worldgen
- class NearbySeeds {
- public int mX;
- public int mZ;
-
- NearbySeeds(int x, int z) {
- this.mX = x;
- this.mZ = z;
- }
- };
-
- public static ArrayList<NearbySeeds> seedList = new ArrayList<NearbySeeds>();
-
- // aX and aZ are now the by-chunk X and Z for the chunk of interest
- public WorldGenContainer(Random aRandom, int aX, int aZ, int aDimensionType, World aWorld,
- IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider, String aBiome) {
- this.mRandom = aRandom;
- this.mX = aX;
- this.mZ = aZ;
- this.mDimensionType = aDimensionType;
- this.mWorld = aWorld;
- this.mChunkGenerator = aChunkGenerator;
- this.mChunkProvider = aChunkProvider;
- this.mBiome = aBiome;
- }
-
- public void worldGenFindVein(int oreseedX, int oreseedZ) {
- // Explanation of oreveinseed implementation.
- // (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen
- // passes, one with getSeed set to +1 the original world seed. This
- // pushes that +1 off the low bits of oreseedZ, so that the hashes
- // are far apart for the two passes.
- // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the
- // dimension in the top bits of the hash, to make sure to get unique
- // hashes per dimension
- // ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in
- // the bits 29-55. Cuts off the top few bits of the chunk so we have
- // bits for dimension.
- // ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the
- // bits 0-27. Cuts off the top few bits of the chunk so we have bits
- // for dimension.
- long oreveinSeed = (this.mWorld.getSeed() << 16) ^ ((this.mWorld.provider.dimensionId & 0xffL) << 56
- | ((oreseedX & 0x000000000fffffffL) << 28) | (oreseedZ & 0x000000000fffffffL)); // Use
- // an
- // RNG
- // that
- // is
- // identical
- // every
- // time
- // it
- // is
- // called
- // for
- // this
- // oreseed.
- XSTR oreveinRNG = new XSTR(oreveinSeed);
- int oreveinPercentageRoll = oreveinRNG.nextInt(100); // Roll the
- // dice, see
- // if we get
- // an
- // orevein
- // here at
- // all
- int noOrePlacedCount = 0;
- String tDimensionName = "";
- if (debugWorldGen) {
- tDimensionName = this.mWorld.provider.getDimensionName();
- }
-
- if (debugWorldGen){
- GT_Log.out.println(" Finding oreveins for oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ="
- + this.mZ + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " worldSeed="
- + this.mWorld.getSeed());
- }
-
- Logger.WARNING("[World Generation Debug] !validOreveins.containsKey(oreveinSeed) | oreveinSeed: "+oreveinSeed);
- // Search for a valid orevein for this dimension
- if (!validOreveins.containsKey(oreveinSeed)) {
-
-
- Logger.WARNING("[World Generation Debug] oreveinPercentageRoll < oreveinPercentage? "+((oreveinPercentageRoll < oreveinPercentage)));
- Logger.WARNING("[World Generation Debug] WorldGen_GT_Ore_Layer.sWeight > 0? "+(WorldGen_GT_Australia_Ore_Layer.sWeight > 0));
- Logger.WARNING("[World Generation Debug] WorldGen_GT_Ore_Layer.sList.size() > 0? "+(WorldGen_GT_Australia_Ore_Layer.sList.size() > 0));
- if ((oreveinPercentageRoll < oreveinPercentage) && (WorldGen_GT_Australia_Ore_Layer.sWeight > 0)
- && (WorldGen_GT_Australia_Ore_Layer.sList.size() > 0)) {
- int placementAttempts = 0;
- boolean oreveinFound = false;
- int i;
- for (i = 0; (i < oreveinAttempts) && (!oreveinFound)
- && (placementAttempts < oreveinMaxPlacementAttempts); i++) {
- Logger.WARNING("[World Generation Debug] i: "+i);
- Logger.WARNING("[World Generation Debug] placementAttempts: "+placementAttempts);
- Logger.WARNING("[World Generation Debug] oreveinAttempts: "+oreveinAttempts);
- Logger.WARNING("[World Generation Debug] (placementAttempts < oreveinMaxPlacementAttempts): "+(placementAttempts < oreveinMaxPlacementAttempts));
- Logger.WARNING("[World Generation Debug] oreveinFound: "+oreveinFound);
- int tRandomWeight = oreveinRNG.nextInt(WorldGen_GT_Australia_Ore_Layer.sWeight);
- for (WorldGen_GT_Australia_Ore_Layer tWorldGen : WorldGen_GT_Australia_Ore_Layer.sList) {
- Logger.WARNING("[World Generation Debug] Iterating sList - Size: "+WorldGen_GT_Australia_Ore_Layer.sList.size());
- tRandomWeight -= (tWorldGen).mWeight;
- if (tRandomWeight <= 0) {
- try {
- // Adjust the seed so that this layer has a
- // series of unique random numbers.
- // Otherwise multiple attempts at this same
- // oreseed will get the same offset and X/Z
- // values. If an orevein failed, any orevein
- // with the
- // same minimum heights would fail as well.
- // This prevents that, giving each orevein a
- // unique height each pass through here.
- int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld,
- new XSTR(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))), this.mBiome,
- this.mDimensionType, this.mX * 16, this.mZ * 16, oreseedX * 16,
- oreseedZ * 16, this.mChunkGenerator, this.mChunkProvider);
- switch (placementResult) {
- case WorldGen_GT_Australia_Ore_Layer.ORE_PLACED:
- if (debugWorldGen)
- GT_Log.out.println(" Added oreveinSeed=" + oreveinSeed
- + " tries at oremix=" + i + " placementAttempts="
- + placementAttempts + " dimensionName=" + tDimensionName);
- validOreveins.put(oreveinSeed, tWorldGen);
- oreveinFound = true;
- Logger.WARNING("[World Generation Debug] ORE_PLACED");
- break;
- case WorldGen_GT_Australia_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
- placementAttempts++;
- Logger.WARNING("[World Generation Debug] NO_ORE_IN_BOTTOM_LAYER | Attempts: "+placementAttempts);
- // SHould do retry in this case
- // until out of chances
- break;
- case WorldGen_GT_Australia_Ore_Layer.NO_OVERLAP:
- // Orevein didn't reach this chunk,
- // can't add it yet to the hash
- Logger.WARNING("[World Generation Debug] NO_OVERLAP");
- if (debugWorldGen) GT_Log.out.println(
- " Added far oreveinSeed=" + oreveinSeed + " " +
- ( tWorldGen).mWorldGenName +
- " tries at oremix=" + i +
- " placementAttempts=" + placementAttempts +
- " dimensionName=" + tDimensionName
- );
- validOreveins.put(oreveinSeed, tWorldGen);
- oreveinFound = true;
- break;
- case WorldGen_GT_Australia_Ore_Layer.NO_OVERLAP_AIR_BLOCK:
- if (debugWorldGen) GT_Log.out.println(
- " No overlap and air block in test spot=" + oreveinSeed + " " +
- ( tWorldGen).mWorldGenName +
- " tries at oremix=" + i +
- " placementAttempts=" + placementAttempts +
- " dimensionName=" + tDimensionName
- );
- // SHould do retry in this case until out of chances
- Logger.WARNING("[World Generation Debug] NO_OVERLAP_AIR_BLOCK");
- placementAttempts++;
- break;
- }
- break; // Try the next orevein
- }
- catch (Throwable e) {
- if (debugWorldGen)
- GT_Log.out.println("Exception occurred on oreVein" + tWorldGen + " oreveinSeed="
- + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ + " oreseedX="
- + oreseedX + " oreseedZ=" + oreseedZ);
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- // Only add an empty orevein if are unable to place a vein
- // at the oreseed chunk.
- if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)) {
- if (debugWorldGen)
- GT_Log.out.println(" Empty oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ
- + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " tries at oremix=" + i
- + " placementAttempts=" + placementAttempts + " dimensionName=" + tDimensionName);
- validOreveins.put(oreveinSeed, noOresInVein);
- }
- }
- else if (oreveinPercentageRoll >= oreveinPercentage) {
- if (debugWorldGen)
- GT_Log.out.println(" Skipped oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ
- + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " RNG=" + oreveinPercentageRoll
- + " %=" + oreveinPercentage + " dimensionName=" + tDimensionName);
- validOreveins.put(oreveinSeed, noOresInVein);
- }
- }
- else {
- // oreseed is located in the previously processed table
- if (debugWorldGen)
- GT_Log.out.print(" Valid oreveinSeed=" + oreveinSeed + " validOreveins.size()="
- + validOreveins.size() + " ");
- WorldGen_GT_Australia_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed);
- oreveinRNG.setSeed(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))); // Reset
- // RNG
- // to
- // only
- // be
- // based
- // on
- // oreseed
- // X/Z
- // and
- // type
- // of
- // vein
- int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, oreveinRNG, this.mBiome,
- this.mDimensionType, this.mX * 16, this.mZ * 16, oreseedX * 16, oreseedZ * 16,
- this.mChunkGenerator, this.mChunkProvider);
- switch (placementResult) {
- case WorldGen_GT_Australia_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
- if (debugWorldGen)
- GT_Log.out.println(" No ore in bottom layer");
- break;
- case WorldGen_GT_Australia_Ore_Layer.NO_OVERLAP:
- if (debugWorldGen)
- GT_Log.out.println(" No overlap");
- break;
- }
- }
- }
-
- @Override
- public void run() {
- long startTime = System.nanoTime();
- int oreveinMaxSize;
-
- // Determine bounding box on how far out to check for oreveins
- // affecting this chunk
- // For now, manually reducing oreveinMaxSize when not in the
- // Underdark for performance
- if (this.mWorld.provider.getDimensionName().equals("Underdark")) {
- oreveinMaxSize = 24; // Leave Deep Dark/Underdark max oregen at
- // 32, instead of 64
- }
- else {
- oreveinMaxSize = 48;
- }
-
- int wXbox = this.mX - (oreveinMaxSize / 16);
- int eXbox = this.mX + (oreveinMaxSize / 16 + 1); // Need to add 1
- // since it is
- // compared
- // using a <
- int nZbox = this.mZ - (oreveinMaxSize / 16);
- int sZbox = this.mZ + (oreveinMaxSize / 16 + 1);
-
- // Search for orevein seeds and add to the list;
- for (int x = wXbox; x < eXbox; x++) {
- for (int z = nZbox; z < sZbox; z++) {
- // Determine if this X/Z is an orevein seed
- if (((Math.abs(x) % 3) == 1) && ((Math.abs(z) % 3) == 1)) {
- if (debugWorldGen)
- GT_Log.out.println("Adding seed x=" + x + " z=" + z);
- seedList.add(new NearbySeeds(x, z));
- }
- }
- }
-
- // Now process each oreseed vs this requested chunk
- for (; seedList.size() != 0; seedList.remove(0)) {
- if (debugWorldGen)
- GT_Log.out.println("Processing seed x=" + seedList.get(0).mX + " z=" + seedList.get(0).mZ);
- worldGenFindVein(seedList.get(0).mX, seedList.get(0).mZ);
- }
-
- long oregenTime = System.nanoTime();
-
- // Do leftover worldgen for this chunk (GT_Stones and GT_small_ores)
- try {
- for (WorldGen_GT_Australia tWorldGen : HANDLER_GT.sWorldgenListAustralia) {
- /*
- * if (debugWorldGen) GT_Log.out.println(
- * "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName );
- */
- tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, this.mX * 16,
- this.mZ * 16, this.mChunkGenerator, this.mChunkProvider);
- }
- }
- catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
-
- long leftOverTime = System.nanoTime();
-
- Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ);
- if (tChunk != null) {
- tChunk.isModified = true;
- }
- long endTime = System.nanoTime();
- long duration = (endTime - startTime);
- if (debugWorldGen) {
- GT_Log.out.println(" Oregen took " + (oregenTime - startTime) + " Leftover gen took "
- + (leftOverTime - oregenTime) + " Worldgen took " + duration + " nanoseconds");
- }
- }
- }
-
+ /**
+ * Class Variables
+ */
+
+ /**
+ * Control percentage of filled 3x3 chunks. Lower number means less oreveins
+ * spawn
+ */
+ public static int oreveinPercentage;
+ /**
+ * Control number of attempts to find a valid orevein. Generally this
+ * maximum limit isn't hit, selecting a vein is cheap
+ */
+ public static int oreveinAttempts;
+ /**
+ * Control number of attempts to place a valid orevein. If a vein wasn't
+ * placed due to height restrictions, completely in the water, etc, another
+ * attempt is tried.
+ */
+ public static int oreveinMaxPlacementAttempts;
+ /**
+ * Debug parameter for world generation. Tracks chunks added/removed from
+ * run queue.
+ */
+ public static boolean debugWorldGen = false;
+ /**
+ * Try re-implement Richard Hendrick's Chunk by Chunk Ore Generation from
+ * his GT5u fork.
+ */
+ public static List<Runnable> mList = new ArrayList<Runnable>();
+
+ public static HashSet<Long> ProcChunks = new HashSet<Long>();
+ // This is probably not going to work. Trying to create a fake orevein to
+ // put into hashtable when there will be no ores in a vein.
+ public static WorldGen_GT_Australia_Ore_Layer noOresInVein = new WorldGen_GT_Australia_Ore_Layer(
+ "vein0",
+ 0,
+ 255,
+ 0,
+ 0,
+ 0,
+ ELEMENT.getInstance().IRON,
+ ELEMENT.getInstance().GOLD,
+ ELEMENT.getInstance().LEAD,
+ ELEMENT.getInstance().TIN);
+
+ public static Hashtable<Long, WorldGen_GT_Australia_Ore_Layer> validOreveins =
+ new Hashtable<Long, WorldGen_GT_Australia_Ore_Layer>(1024);
+
+ public boolean mIsGenerating = false;
+ public static final Object listLock = new Object();
+ // private static boolean gcAsteroids = true;
+
+ public WorldGen_GT_Australia_Base() {
+ if (debugWorldGen) {
+ GT_Log.out.println("GTPP_Worldgenerator created");
+ }
+ }
+
+ @Override
+ public void generate(
+ Random random,
+ int chunkX,
+ int chunkZ,
+ World world,
+ IChunkProvider chunkGenerator,
+ IChunkProvider chunkProvider) {
+ if (world.provider.dimensionId == Dimension_Australia.DIMID) {
+ generateSafely(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
+ }
+ }
+
+ public synchronized void generateSafely(
+ Random random,
+ int chunkX,
+ int chunkZ,
+ World world,
+ IChunkProvider chunkGenerator,
+ IChunkProvider chunkProvider) {
+ int xDim = Dimension_Australia.DIMID;
+ switch (world.provider.dimensionId) {
+ case -1: // Nether
+ // generateNether(world, random, chunkX * 16, chunkZ * 16);
+ break;
+ case 0: // Overworld
+ // generateSurface(world, random, chunkX * 16, chunkZ * 16);
+ break;
+ case 1: // End
+ // generateEnd(world, random, chunkX * 16, chunkZ * 16);
+ break;
+ default: // Any other dimension
+ if (world.provider.dimensionId != xDim) {
+ break;
+ } else {
+ generateEverglades(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
+ break;
+ }
+ }
+ }
+
+ private synchronized void generateEverglades(
+ Random aRandom,
+ int aX,
+ int aZ,
+ World aWorld,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider) {
+ Logger.WARNING("Trying to Generate Dimension.");
+ synchronized (listLock) {
+ Logger.WARNING("Locked List addition.");
+ if (WorldGen_GT_Australia_Base.mList.add(new WorldGenContainer(
+ new XSTR(Math.abs(aRandom.nextInt()) + 1),
+ aX,
+ aZ,
+ Dimension_Australia.DIMID,
+ aWorld,
+ aChunkGenerator,
+ aChunkProvider,
+ aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName))) {
+ Logger.WARNING("Locked List addition. Success.");
+ } else {
+ Logger.WARNING("Locked List addition. Fail.");
+ }
+ if (debugWorldGen)
+ GT_Log.out.println("ADD WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId
+ + " chunk x:" + aX + " z:" + aZ + " SIZE: " + WorldGen_GT_Australia_Base.mList.size());
+ }
+
+ if (!this.mIsGenerating) {
+ Logger.WARNING("Is not generating.");
+ this.mIsGenerating = true;
+ Logger.WARNING("Setting Generation to true.");
+ int mList_sS = WorldGen_GT_Australia_Base.mList.size();
+ mList_sS = Math.min(mList_sS, 3); // Run a maximum of 3 chunks at a
+ // time through worldgen. Extra
+ // chunks get done later.
+ for (int i = 0; i < mList_sS; i++) {
+ WorldGenContainer toRun = (WorldGenContainer) WorldGen_GT_Australia_Base.mList.get(0);
+ if (debugWorldGen)
+ GT_Log.out.println("RUN WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId
+ + " chunk x:" + toRun.mX + " z:" + toRun.mZ + " SIZE: "
+ + WorldGen_GT_Australia_Base.mList.size()
+ + " i: " + i);
+ synchronized (listLock) {
+ Logger.WARNING("Locked List Removal.");
+ WorldGen_GT_Australia_Base.mList.remove(0);
+ }
+ toRun.run();
+ }
+ this.mIsGenerating = false;
+ Logger.WARNING("Is Generating now set to false..");
+ }
+ }
+
+ public void generateOre(
+ Block block,
+ World world,
+ Random random,
+ int chunk_x,
+ int chunk_z,
+ int maxX,
+ int maxZ,
+ int maxVeinSize,
+ int chancesToSpawn,
+ int minY,
+ int maxY,
+ Block generateIn) {
+ int heightRange = maxY - minY;
+ WorldGenMinable worldgenminable = new WorldGenMinable(block, maxVeinSize, generateIn);
+ for (int k1 = 0; k1 < chancesToSpawn; ++k1) {
+ int xrand = random.nextInt(16);
+ int yrand = random.nextInt(heightRange) + minY;
+ int zrand = random.nextInt(16);
+ worldgenminable.generate(world, random, chunk_x + xrand, yrand, chunk_z + zrand);
+ }
+ }
+
+ public static class WorldGenContainer implements Runnable {
+ public final Random mRandom;
+ public final int mX;
+ public final int mZ;
+ public final int mDimensionType;
+ public final World mWorld;
+ public final IChunkProvider mChunkGenerator;
+ public final IChunkProvider mChunkProvider;
+ public final String mBiome;
+
+ // Local class to track which orevein seeds must be checked when doing
+ // chunkified worldgen
+ class NearbySeeds {
+ public int mX;
+ public int mZ;
+
+ NearbySeeds(int x, int z) {
+ this.mX = x;
+ this.mZ = z;
+ }
+ }
+ ;
+
+ public static ArrayList<NearbySeeds> seedList = new ArrayList<NearbySeeds>();
+
+ // aX and aZ are now the by-chunk X and Z for the chunk of interest
+ public WorldGenContainer(
+ Random aRandom,
+ int aX,
+ int aZ,
+ int aDimensionType,
+ World aWorld,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider,
+ String aBiome) {
+ this.mRandom = aRandom;
+ this.mX = aX;
+ this.mZ = aZ;
+ this.mDimensionType = aDimensionType;
+ this.mWorld = aWorld;
+ this.mChunkGenerator = aChunkGenerator;
+ this.mChunkProvider = aChunkProvider;
+ this.mBiome = aBiome;
+ }
+
+ public void worldGenFindVein(int oreseedX, int oreseedZ) {
+ // Explanation of oreveinseed implementation.
+ // (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen
+ // passes, one with getSeed set to +1 the original world seed. This
+ // pushes that +1 off the low bits of oreseedZ, so that the hashes
+ // are far apart for the two passes.
+ // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the
+ // dimension in the top bits of the hash, to make sure to get unique
+ // hashes per dimension
+ // ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in
+ // the bits 29-55. Cuts off the top few bits of the chunk so we have
+ // bits for dimension.
+ // ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the
+ // bits 0-27. Cuts off the top few bits of the chunk so we have bits
+ // for dimension.
+ long oreveinSeed = (this.mWorld.getSeed() << 16)
+ ^ ((this.mWorld.provider.dimensionId & 0xffL) << 56
+ | ((oreseedX & 0x000000000fffffffL) << 28)
+ | (oreseedZ & 0x000000000fffffffL)); // Use
+ // an
+ // RNG
+ // that
+ // is
+ // identical
+ // every
+ // time
+ // it
+ // is
+ // called
+ // for
+ // this
+ // oreseed.
+ XSTR oreveinRNG = new XSTR(oreveinSeed);
+ int oreveinPercentageRoll = oreveinRNG.nextInt(100); // Roll the
+ // dice, see
+ // if we get
+ // an
+ // orevein
+ // here at
+ // all
+ int noOrePlacedCount = 0;
+ String tDimensionName = "";
+ if (debugWorldGen) {
+ tDimensionName = this.mWorld.provider.getDimensionName();
+ }
+
+ if (debugWorldGen) {
+ GT_Log.out.println(" Finding oreveins for oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ="
+ + this.mZ + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " worldSeed="
+ + this.mWorld.getSeed());
+ }
+
+ Logger.WARNING(
+ "[World Generation Debug] !validOreveins.containsKey(oreveinSeed) | oreveinSeed: " + oreveinSeed);
+ // Search for a valid orevein for this dimension
+ if (!validOreveins.containsKey(oreveinSeed)) {
+
+ Logger.WARNING("[World Generation Debug] oreveinPercentageRoll < oreveinPercentage? "
+ + ((oreveinPercentageRoll < oreveinPercentage)));
+ Logger.WARNING("[World Generation Debug] WorldGen_GT_Ore_Layer.sWeight > 0? "
+ + (WorldGen_GT_Australia_Ore_Layer.sWeight > 0));
+ Logger.WARNING("[World Generation Debug] WorldGen_GT_Ore_Layer.sList.size() > 0? "
+ + (WorldGen_GT_Australia_Ore_Layer.sList.size() > 0));
+ if ((oreveinPercentageRoll < oreveinPercentage)
+ && (WorldGen_GT_Australia_Ore_Layer.sWeight > 0)
+ && (WorldGen_GT_Australia_Ore_Layer.sList.size() > 0)) {
+ int placementAttempts = 0;
+ boolean oreveinFound = false;
+ int i;
+ for (i = 0;
+ (i < oreveinAttempts)
+ && (!oreveinFound)
+ && (placementAttempts < oreveinMaxPlacementAttempts);
+ i++) {
+ Logger.WARNING("[World Generation Debug] i: " + i);
+ Logger.WARNING("[World Generation Debug] placementAttempts: " + placementAttempts);
+ Logger.WARNING("[World Generation Debug] oreveinAttempts: " + oreveinAttempts);
+ Logger.WARNING("[World Generation Debug] (placementAttempts < oreveinMaxPlacementAttempts): "
+ + (placementAttempts < oreveinMaxPlacementAttempts));
+ Logger.WARNING("[World Generation Debug] oreveinFound: " + oreveinFound);
+ int tRandomWeight = oreveinRNG.nextInt(WorldGen_GT_Australia_Ore_Layer.sWeight);
+ for (WorldGen_GT_Australia_Ore_Layer tWorldGen : WorldGen_GT_Australia_Ore_Layer.sList) {
+ Logger.WARNING("[World Generation Debug] Iterating sList - Size: "
+ + WorldGen_GT_Australia_Ore_Layer.sList.size());
+ tRandomWeight -= (tWorldGen).mWeight;
+ if (tRandomWeight <= 0) {
+ try {
+ // Adjust the seed so that this layer has a
+ // series of unique random numbers.
+ // Otherwise multiple attempts at this same
+ // oreseed will get the same offset and X/Z
+ // values. If an orevein failed, any orevein
+ // with the
+ // same minimum heights would fail as well.
+ // This prevents that, giving each orevein a
+ // unique height each pass through here.
+ int placementResult = tWorldGen.executeWorldgenChunkified(
+ this.mWorld,
+ new XSTR(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))),
+ this.mBiome,
+ this.mDimensionType,
+ this.mX * 16,
+ this.mZ * 16,
+ oreseedX * 16,
+ oreseedZ * 16,
+ this.mChunkGenerator,
+ this.mChunkProvider);
+ switch (placementResult) {
+ case WorldGen_GT_Australia_Ore_Layer.ORE_PLACED:
+ if (debugWorldGen)
+ GT_Log.out.println(" Added oreveinSeed=" + oreveinSeed
+ + " tries at oremix=" + i + " placementAttempts="
+ + placementAttempts + " dimensionName=" + tDimensionName);
+ validOreveins.put(oreveinSeed, tWorldGen);
+ oreveinFound = true;
+ Logger.WARNING("[World Generation Debug] ORE_PLACED");
+ break;
+ case WorldGen_GT_Australia_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
+ placementAttempts++;
+ Logger.WARNING(
+ "[World Generation Debug] NO_ORE_IN_BOTTOM_LAYER | Attempts: "
+ + placementAttempts);
+ // SHould do retry in this case
+ // until out of chances
+ break;
+ case WorldGen_GT_Australia_Ore_Layer.NO_OVERLAP:
+ // Orevein didn't reach this chunk,
+ // can't add it yet to the hash
+ Logger.WARNING("[World Generation Debug] NO_OVERLAP");
+ if (debugWorldGen)
+ GT_Log.out.println(" Added far oreveinSeed=" + oreveinSeed + " "
+ + (tWorldGen).mWorldGenName
+ + " tries at oremix="
+ + i + " placementAttempts="
+ + placementAttempts + " dimensionName="
+ + tDimensionName);
+ validOreveins.put(oreveinSeed, tWorldGen);
+ oreveinFound = true;
+ break;
+ case WorldGen_GT_Australia_Ore_Layer.NO_OVERLAP_AIR_BLOCK:
+ if (debugWorldGen)
+ GT_Log.out.println(" No overlap and air block in test spot="
+ + oreveinSeed + " " + (tWorldGen).mWorldGenName
+ + " tries at oremix="
+ + i + " placementAttempts="
+ + placementAttempts + " dimensionName="
+ + tDimensionName);
+ // SHould do retry in this case until out of chances
+ Logger.WARNING("[World Generation Debug] NO_OVERLAP_AIR_BLOCK");
+ placementAttempts++;
+ break;
+ }
+ break; // Try the next orevein
+ } catch (Throwable e) {
+ if (debugWorldGen)
+ GT_Log.out.println("Exception occurred on oreVein" + tWorldGen + " oreveinSeed="
+ + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ + " oreseedX="
+ + oreseedX + " oreseedZ=" + oreseedZ);
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ }
+ // Only add an empty orevein if are unable to place a vein
+ // at the oreseed chunk.
+ if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)) {
+ if (debugWorldGen)
+ GT_Log.out.println(" Empty oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ
+ + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " tries at oremix=" + i
+ + " placementAttempts=" + placementAttempts + " dimensionName=" + tDimensionName);
+ validOreveins.put(oreveinSeed, noOresInVein);
+ }
+ } else if (oreveinPercentageRoll >= oreveinPercentage) {
+ if (debugWorldGen)
+ GT_Log.out.println(" Skipped oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ
+ + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " RNG=" + oreveinPercentageRoll
+ + " %=" + oreveinPercentage + " dimensionName=" + tDimensionName);
+ validOreveins.put(oreveinSeed, noOresInVein);
+ }
+ } else {
+ // oreseed is located in the previously processed table
+ if (debugWorldGen)
+ GT_Log.out.print(" Valid oreveinSeed=" + oreveinSeed + " validOreveins.size()="
+ + validOreveins.size() + " ");
+ WorldGen_GT_Australia_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed);
+ oreveinRNG.setSeed(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))); // Reset
+ // RNG
+ // to
+ // only
+ // be
+ // based
+ // on
+ // oreseed
+ // X/Z
+ // and
+ // type
+ // of
+ // vein
+ int placementResult = tWorldGen.executeWorldgenChunkified(
+ this.mWorld,
+ oreveinRNG,
+ this.mBiome,
+ this.mDimensionType,
+ this.mX * 16,
+ this.mZ * 16,
+ oreseedX * 16,
+ oreseedZ * 16,
+ this.mChunkGenerator,
+ this.mChunkProvider);
+ switch (placementResult) {
+ case WorldGen_GT_Australia_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
+ if (debugWorldGen) GT_Log.out.println(" No ore in bottom layer");
+ break;
+ case WorldGen_GT_Australia_Ore_Layer.NO_OVERLAP:
+ if (debugWorldGen) GT_Log.out.println(" No overlap");
+ break;
+ }
+ }
+ }
+
+ @Override
+ public void run() {
+ long startTime = System.nanoTime();
+ int oreveinMaxSize;
+
+ // Determine bounding box on how far out to check for oreveins
+ // affecting this chunk
+ // For now, manually reducing oreveinMaxSize when not in the
+ // Underdark for performance
+ if (this.mWorld.provider.getDimensionName().equals("Underdark")) {
+ oreveinMaxSize = 24; // Leave Deep Dark/Underdark max oregen at
+ // 32, instead of 64
+ } else {
+ oreveinMaxSize = 48;
+ }
+
+ int wXbox = this.mX - (oreveinMaxSize / 16);
+ int eXbox = this.mX + (oreveinMaxSize / 16 + 1); // Need to add 1
+ // since it is
+ // compared
+ // using a <
+ int nZbox = this.mZ - (oreveinMaxSize / 16);
+ int sZbox = this.mZ + (oreveinMaxSize / 16 + 1);
+
+ // Search for orevein seeds and add to the list;
+ for (int x = wXbox; x < eXbox; x++) {
+ for (int z = nZbox; z < sZbox; z++) {
+ // Determine if this X/Z is an orevein seed
+ if (((Math.abs(x) % 3) == 1) && ((Math.abs(z) % 3) == 1)) {
+ if (debugWorldGen) GT_Log.out.println("Adding seed x=" + x + " z=" + z);
+ seedList.add(new NearbySeeds(x, z));
+ }
+ }
+ }
+
+ // Now process each oreseed vs this requested chunk
+ for (; seedList.size() != 0; seedList.remove(0)) {
+ if (debugWorldGen)
+ GT_Log.out.println("Processing seed x=" + seedList.get(0).mX + " z=" + seedList.get(0).mZ);
+ worldGenFindVein(seedList.get(0).mX, seedList.get(0).mZ);
+ }
+
+ long oregenTime = System.nanoTime();
+
+ // Do leftover worldgen for this chunk (GT_Stones and GT_small_ores)
+ try {
+ for (WorldGen_GT_Australia tWorldGen : HANDLER_GT.sWorldgenListAustralia) {
+ /*
+ * if (debugWorldGen) GT_Log.out.println(
+ * "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName );
+ */
+ tWorldGen.executeWorldgen(
+ this.mWorld,
+ this.mRandom,
+ this.mBiome,
+ this.mDimensionType,
+ this.mX * 16,
+ this.mZ * 16,
+ this.mChunkGenerator,
+ this.mChunkProvider);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+
+ long leftOverTime = System.nanoTime();
+
+ Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ);
+ if (tChunk != null) {
+ tChunk.isModified = true;
+ }
+ long endTime = System.nanoTime();
+ long duration = (endTime - startTime);
+ if (debugWorldGen) {
+ GT_Log.out.println(" Oregen took " + (oregenTime - startTime) + " Leftover gen took "
+ + (leftOverTime - oregenTime) + " Worldgen took " + duration + " nanoseconds");
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java b/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java
index a5e5f8b245..f88cd0edbe 100644
--- a/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java
+++ b/src/main/java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java
@@ -2,23 +2,11 @@ package gtPlusPlus.australia.gen.gt;
import static gtPlusPlus.australia.gen.gt.WorldGen_GT_Australia_Base.debugWorldGen;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.*;
-
-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;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_Log;
import gregtech.common.blocks.GT_Block_Ores;
import gregtech.common.blocks.GT_TileEntity_Ores;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.australia.GTplusplus_Australia;
import gtPlusPlus.australia.dimension.Dimension_Australia;
@@ -26,486 +14,602 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.*;
+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 WorldGen_GT_Australia_Ore_Layer
-extends WorldGen_GT_Australia {
- public static ArrayList<WorldGen_GT_Australia_Ore_Layer> sList = new ArrayList<WorldGen_GT_Australia_Ore_Layer>();
- public static int sWeight = 0;
- public final short mMinY;
- public final short mMaxY;
- public final short mWeight;
- public final short mDensity;
- public final short mSize;
- public Block mPrimaryMeta;
- public Block mSecondaryMeta;
- public Block mBetweenMeta;
- public Block mSporadicMeta;
- public final Material mPrimary;
- public final Material mSecondary;
- public final Material mBetween;
- public final Material mSporadic;
-
- public static boolean mUpdated = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK;
- public static final Block mStoneTypes;
-
- //public final String mBiome;
- public final String mRestrictBiome;
- public final boolean mOverworld;
- public final boolean mNether;
- public final boolean mEnd;
- public static final int WRONG_BIOME=0;
- public static final int WRONG_DIMENSION=1;
- public static final int NO_ORE_IN_BOTTOM_LAYER=2;
- public static final int NO_OVERLAP=3;
- public static final int ORE_PLACED=4;
- public static final int NO_OVERLAP_AIR_BLOCK=5;
-
- //public final boolean mMoon;
- //public final boolean mMars;
- //public final boolean mAsteroid;
- public final String aTextWorldgen = "worldgen.";
-
- static {
- if (mUpdated) {
- Object tempBlock = null;
- try {
- Field temp = ReflectionUtils.getField(GregTech_API.class, "sBlockStones");
- tempBlock = temp.get(null);
- }
- catch (IllegalArgumentException | IllegalAccessException e) {}
- mStoneTypes = (Block) tempBlock;
- }
- else {
- mStoneTypes = null;
- }
- }
-
-
- public WorldGen_GT_Australia_Ore_Layer(String aName, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) {
- this(aName, true, aMinY, aMaxY, aWeight, aDensity, aSize, false, false, false, false, false, false, aPrimary, aSecondary, aBetween, aSporadic);
- }
-
-
- public WorldGen_GT_Australia_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) {
- super(aName, sList, aDefault);
- Logger.WARNING("Creating Ore Layer Object");
- this.mOverworld = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
- this.mNether = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether);
- this.mEnd = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd);
- //this.mMoon = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon);
- //this.mMars = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars);
- //this.mAsteroid = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid);
- this.mMinY = 5;
- short mMaxY = 14;
- if (mMaxY < (this.mMinY + 7)) {
- GT_Log.out.println(
- "Oremix " + this.mWorldGenName +
- " has invalid Min/Max heights!"
- );
- mMaxY = (short) (this.mMinY + 7);
- }
- this.mMaxY = mMaxY;
- this.mWeight = ((short) GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
- this.mDensity = ((short) GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
- this.mSize = ((short) Math.max(1, GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
- this.mPrimary = aPrimary;
- this.mSecondary = aSecondary;
- this.mBetween = aBetween;
- this.mSporadic = aSporadic;
- this.mPrimaryMeta = aPrimary.getOreBlock(1);
- this.mSecondaryMeta = aSecondary.getOreBlock(1);
- this.mBetweenMeta = aBetween.getOreBlock(1);
- this.mSporadicMeta = aSporadic.getOreBlock(1);
- this.mRestrictBiome = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
-
- //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does not exist");
- //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist");
- //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist");
- //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist");
-
- if (this.mEnabled) {
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- sWeight += this.mWeight;
- }
- }
-
- public int executeWorldgenChunkified(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, int aSeedX, int aSeedZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
-
- //Debug Handler
- /**
- * This handles Variables that are null during Init
- */
-
- if (this.mPrimaryMeta == Blocks.stone || this.mSecondaryMeta == Blocks.stone
- || this.mBetweenMeta == Blocks.stone || this.mSporadicMeta == Blocks.stone){
- this.mPrimaryMeta = this.mPrimary.getOreBlock(1);
- this.mSecondaryMeta = this.mSecondary.getOreBlock(1);
- this.mBetweenMeta = this.mBetween.getOreBlock(1);
- this.mSporadicMeta = this.mSporadic.getOreBlock(1);
- Logger.WARNING("[Vein Generator] An Ore in a Vein had defaulted back to a default value, so they have now been reset to correct values.");
- }
-
- if( mWorldGenName.equals("vein0") ) {
- if (debugWorldGen) GT_Log.out.println(
- " NoOresInVein-vein0"
- );
- // This is a special empty orevein
- Logger.WARNING("[World Generation Debug] Special Empty Vein placed.");
- return ORE_PLACED;
- }
- if (aDimensionType != Dimension_Australia.DIMID) {
- /* // Debug code, but spams log
- if (debugWorldGen) {
- GT_Log.out.println(
- "Wrong dimension"
- );
+public class WorldGen_GT_Australia_Ore_Layer extends WorldGen_GT_Australia {
+ public static ArrayList<WorldGen_GT_Australia_Ore_Layer> sList = new ArrayList<WorldGen_GT_Australia_Ore_Layer>();
+ public static int sWeight = 0;
+ public final short mMinY;
+ public final short mMaxY;
+ public final short mWeight;
+ public final short mDensity;
+ public final short mSize;
+ public Block mPrimaryMeta;
+ public Block mSecondaryMeta;
+ public Block mBetweenMeta;
+ public Block mSporadicMeta;
+ public final Material mPrimary;
+ public final Material mSecondary;
+ public final Material mBetween;
+ public final Material mSporadic;
+
+ public static boolean mUpdated = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK;
+ public static final Block mStoneTypes;
+
+ // public final String mBiome;
+ public final String mRestrictBiome;
+ public final boolean mOverworld;
+ public final boolean mNether;
+ public final boolean mEnd;
+ public static final int WRONG_BIOME = 0;
+ public static final int WRONG_DIMENSION = 1;
+ public static final int NO_ORE_IN_BOTTOM_LAYER = 2;
+ public static final int NO_OVERLAP = 3;
+ public static final int ORE_PLACED = 4;
+ public static final int NO_OVERLAP_AIR_BLOCK = 5;
+
+ // public final boolean mMoon;
+ // public final boolean mMars;
+ // public final boolean mAsteroid;
+ public final String aTextWorldgen = "worldgen.";
+
+ static {
+ if (mUpdated) {
+ Object tempBlock = null;
+ try {
+ Field temp = ReflectionUtils.getField(GregTech_API.class, "sBlockStones");
+ tempBlock = temp.get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
}
- */
- Logger.WARNING("[World Generation Debug] Wrong dimension.");
- return WRONG_DIMENSION;
- }
- if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
- return WRONG_BIOME;
- }
- int[] placeCount=new int[4];
-
- int tMinY = mMinY + aRandom.nextInt(mMaxY - mMinY - 5);
- // Determine West/East ends of orevein
- int wXVein = aSeedX - aRandom.nextInt(mSize); // West side
- int eXVein = aSeedX + 16 + aRandom.nextInt(mSize);
- // Limit Orevein to only blocks present in current chunk
- int wX = Math.max( wXVein, aChunkX + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
- int eX = Math.min( eXVein, aChunkX + 2 + 16);
- if (wX >= eX) { //No overlap between orevein and this chunk exists in X
- Block tBlock = aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8);
- if (tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.netherrack) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.end_stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, GregTech_API.sBlockGranites) ||
- (mUpdated && tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, mStoneTypes)) ) {
- // Didn't reach, but could have placed. Save orevein for future use.
- return NO_OVERLAP;
- } else {
- // Didn't reach, but couldn't place in test spot anywys, try for another orevein
- return NO_OVERLAP_AIR_BLOCK;
- }
- }
- // Determine North/Sound ends of orevein
- int nZVein = aSeedZ - aRandom.nextInt(mSize);
- int sZVein = aSeedZ + 16 + aRandom.nextInt(mSize);
-
- int nZ = Math.max(nZVein, aChunkZ + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
- int sZ = Math.min(sZVein, aChunkZ + 2 + 16);
- if (nZ >= sZ) { //No overlap between orevein and this chunk exists in Z
- Block tBlock = aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8);
- if (tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.netherrack) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.end_stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, GregTech_API.sBlockGranites) ||
- (mUpdated && tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, mStoneTypes)) ) {
- // Didn't reach, but could have placed. Save orevein for future use.
- return NO_OVERLAP;
- } else {
- // Didn't reach, but couldn't place in test spot anywys, try for another orevein
- return NO_OVERLAP_AIR_BLOCK;
- }
-
- }
-
- if (debugWorldGen) {
- String tDimensionName = aWorld.provider.getDimensionName();
- GT_Log.out.print(
- "Trying Orevein:" + this.mWorldGenName +
- " Dimension=" + tDimensionName +
- " mX="+aChunkX/16+
- " mZ="+aChunkZ/16+
- " oreseedX="+ aSeedX/16 +
- " oreseedZ="+ aSeedZ/16 +
- " cY="+tMinY
- );
- }
- // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed should always be max density due to truncation of Math.sqrt().
- int localDensity = (Math.max(1, this.mDensity / ((int)Math.sqrt(2 + Math.pow(aChunkX/16 - aSeedX/16, 2) + Math.pow(aChunkZ/16 - aSeedZ/16, 2)))));
-
- // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll 1 pass through the loop
- // Now we do bottom-level-first oregen, and work our way upwards.
- int level = tMinY - 1; //Dunno why, but the first layer is actually played one below tMinY. Go figure.
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta != null) ) {
- if (setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- /*if ((placeCount[1]+placeCount[3])==0) {
+ mStoneTypes = (Block) tempBlock;
+ } else {
+ mStoneTypes = null;
+ }
+ }
+
+ public WorldGen_GT_Australia_Ore_Layer(
+ String aName,
+ int aMinY,
+ int aMaxY,
+ int aWeight,
+ int aDensity,
+ int aSize,
+ Material aPrimary,
+ Material aSecondary,
+ Material aBetween,
+ Material aSporadic) {
+ this(
+ aName,
+ true,
+ aMinY,
+ aMaxY,
+ aWeight,
+ aDensity,
+ aSize,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ aPrimary,
+ aSecondary,
+ aBetween,
+ aSporadic);
+ }
+
+ public WorldGen_GT_Australia_Ore_Layer(
+ String aName,
+ boolean aDefault,
+ int aMinY,
+ int aMaxY,
+ int aWeight,
+ int aDensity,
+ int aSize,
+ boolean aOverworld,
+ boolean aNether,
+ boolean aEnd,
+ boolean GC_UNUSED1,
+ boolean GC_UNUSED2,
+ boolean GC_UNUSED3,
+ Material aPrimary,
+ Material aSecondary,
+ Material aBetween,
+ Material aSporadic) {
+ super(aName, sList, aDefault);
+ Logger.WARNING("Creating Ore Layer Object");
+ this.mOverworld = GTplusplus_Australia.sCustomWorldgenFile.get(
+ aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
+ this.mNether =
+ GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether);
+ this.mEnd = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd);
+ // this.mMoon = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon);
+ // this.mMars = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars);
+ // this.mAsteroid = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid",
+ // aAsteroid);
+ this.mMinY = 5;
+ short mMaxY = 14;
+ if (mMaxY < (this.mMinY + 7)) {
+ GT_Log.out.println("Oremix " + this.mWorldGenName + " has invalid Min/Max heights!");
+ mMaxY = (short) (this.mMinY + 7);
+ }
+ this.mMaxY = mMaxY;
+ this.mWeight = ((short) GTplusplus_Australia.sCustomWorldgenFile.get(
+ aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
+ this.mDensity = ((short)
+ GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
+ this.mSize = ((short) Math.max(
+ 1, GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
+ this.mPrimary = aPrimary;
+ this.mSecondary = aSecondary;
+ this.mBetween = aBetween;
+ this.mSporadic = aSporadic;
+ this.mPrimaryMeta = aPrimary.getOreBlock(1);
+ this.mSecondaryMeta = aSecondary.getOreBlock(1);
+ this.mBetweenMeta = aBetween.getOreBlock(1);
+ this.mSporadicMeta = aSporadic.getOreBlock(1);
+ this.mRestrictBiome = GTplusplus_Australia.sCustomWorldgenFile.get(
+ aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
+
+ // if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new
+ // IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does
+ // not exist");
+ // if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new
+ // IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + "
+ // does not exist");
+ // if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new
+ // IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does
+ // not exist");
+ // if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new
+ // IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does
+ // not exist");
+
+ if (this.mEnabled) {
+ // GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY,
+ // aWeight, aOverworld, aNether, aEnd);
+ // GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY,
+ // aWeight, aOverworld, aNether, aEnd);
+ // GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY,
+ // aWeight, aOverworld, aNether, aEnd);
+ // GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY,
+ // aWeight, aOverworld, aNether, aEnd);
+ sWeight += this.mWeight;
+ }
+ }
+
+ public int executeWorldgenChunkified(
+ World aWorld,
+ Random aRandom,
+ String aBiome,
+ int aDimensionType,
+ int aChunkX,
+ int aChunkZ,
+ int aSeedX,
+ int aSeedZ,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider) {
+
+ // Debug Handler
+ /**
+ * This handles Variables that are null during Init
+ */
+ if (this.mPrimaryMeta == Blocks.stone
+ || this.mSecondaryMeta == Blocks.stone
+ || this.mBetweenMeta == Blocks.stone
+ || this.mSporadicMeta == Blocks.stone) {
+ this.mPrimaryMeta = this.mPrimary.getOreBlock(1);
+ this.mSecondaryMeta = this.mSecondary.getOreBlock(1);
+ this.mBetweenMeta = this.mBetween.getOreBlock(1);
+ this.mSporadicMeta = this.mSporadic.getOreBlock(1);
+ Logger.WARNING(
+ "[Vein Generator] An Ore in a Vein had defaulted back to a default value, so they have now been reset to correct values.");
+ }
+
+ if (mWorldGenName.equals("vein0")) {
+ if (debugWorldGen) GT_Log.out.println(" NoOresInVein-vein0");
+ // This is a special empty orevein
+ Logger.WARNING("[World Generation Debug] Special Empty Vein placed.");
+ return ORE_PLACED;
+ }
+ if (aDimensionType != Dimension_Australia.DIMID) {
+ /* // Debug code, but spams log
+ if (debugWorldGen) {
+ GT_Log.out.println(
+ "Wrong dimension"
+ );
+ }
+ */
+ Logger.WARNING("[World Generation Debug] Wrong dimension.");
+ return WRONG_DIMENSION;
+ }
+ if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
+ return WRONG_BIOME;
+ }
+ int[] placeCount = new int[4];
+
+ int tMinY = mMinY + aRandom.nextInt(mMaxY - mMinY - 5);
+ // Determine West/East ends of orevein
+ int wXVein = aSeedX - aRandom.nextInt(mSize); // West side
+ int eXVein = aSeedX + 16 + aRandom.nextInt(mSize);
+ // Limit Orevein to only blocks present in current chunk
+ int wX = Math.max(wXVein, aChunkX + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
+ int eX = Math.min(eXVein, aChunkX + 2 + 16);
+ if (wX >= eX) { // No overlap between orevein and this chunk exists in X
+ Block tBlock = aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8);
+ if (tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.stone)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.netherrack)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.end_stone)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, GregTech_API.sBlockGranites)
+ || (mUpdated && tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, mStoneTypes))) {
+ // Didn't reach, but could have placed. Save orevein for future use.
+ return NO_OVERLAP;
+ } else {
+ // Didn't reach, but couldn't place in test spot anywys, try for another orevein
+ return NO_OVERLAP_AIR_BLOCK;
+ }
+ }
+ // Determine North/Sound ends of orevein
+ int nZVein = aSeedZ - aRandom.nextInt(mSize);
+ int sZVein = aSeedZ + 16 + aRandom.nextInt(mSize);
+
+ int nZ = Math.max(nZVein, aChunkZ + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
+ int sZ = Math.min(sZVein, aChunkZ + 2 + 16);
+ if (nZ >= sZ) { // No overlap between orevein and this chunk exists in Z
+ Block tBlock = aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8);
+ if (tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.stone)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.netherrack)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.end_stone)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, GregTech_API.sBlockGranites)
+ || (mUpdated && tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, mStoneTypes))) {
+ // Didn't reach, but could have placed. Save orevein for future use.
+ return NO_OVERLAP;
+ } else {
+ // Didn't reach, but couldn't place in test spot anywys, try for another orevein
+ return NO_OVERLAP_AIR_BLOCK;
+ }
+ }
+
+ if (debugWorldGen) {
+ String tDimensionName = aWorld.provider.getDimensionName();
+ GT_Log.out.print("Trying Orevein:" + this.mWorldGenName + " Dimension="
+ + tDimensionName + " mX="
+ + aChunkX / 16 + " mZ="
+ + aChunkZ / 16 + " oreseedX="
+ + aSeedX / 16 + " oreseedZ="
+ + aSeedZ / 16 + " cY="
+ + tMinY);
+ }
+ // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed
+ // should always be max density due to truncation of Math.sqrt().
+ int localDensity = (Math.max(
+ 1,
+ this.mDensity
+ / ((int) Math.sqrt(2
+ + Math.pow(aChunkX / 16 - aSeedX / 16, 2)
+ + Math.pow(aChunkZ / 16 - aSeedZ / 16, 2)))));
+
+ // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll
+ // 1 pass through the loop
+ // Now we do bottom-level-first oregen, and work our way upwards.
+ int level = tMinY - 1; // Dunno why, but the first layer is actually played one below tMinY. Go figure.
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSecondaryMeta != null)) {
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
+ placeCount[1]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ /*if ((placeCount[1]+placeCount[3])==0) {
if (debugWorldGen) GT_Log.out.println(
" No ore in bottom layer"
);
return NO_ORE_IN_BOTTOM_LAYER; // Exit early, didn't place anything in the bottom layer
}*/
- Logger.WARNING("[World Generation Debug] Trying to set Ores?");
- for (level = tMinY; level < (tMinY-1+3); level++) {
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta != null) ) {
- if (setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- }
- // Low Middle layer is between + sporadic
- // level should be = tMinY-1+3 from end of for loop
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta != null) ) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
- placeCount[2]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- // High Middle layer is between + primary + sporadic
- level++; // Increment level to next layer
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta != null) ) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
- placeCount[2]++;
- }
- }
- else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta != null) ) {
- if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
- placeCount[0]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- // Top two layers are primary + sporadic
- level++; // Increment level to next layer
- for( ; level < (tMinY + 6); level++){ // should do two layers
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta != null) ) {
- if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
- placeCount[0]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- }
- if (debugWorldGen) {
- String tDimensionName = aWorld.provider.getDimensionName();
- GT_Log.out.println(
- "Generated Orevein:" + this.mWorldGenName +
- " Dimension=" + tDimensionName +
- " mX="+aChunkX/16+
- " mZ="+aChunkZ/16+
- " oreseedX="+ aSeedX/16 +
- " oreseedZ="+ aSeedZ/16 +
- " cY="+tMinY+
- " wXVein" + wXVein +
- " eXVein" + eXVein +
- " nZVein" + nZVein +
- " sZVein" + sZVein +
- " locDen=" + localDensity +
- " Den=" + this.mDensity +
- " Sec="+placeCount[1]+
- " Spo="+placeCount[3]+
- " Bet="+placeCount[2]+
- " Pri="+placeCount[0]
- );
- }
- // Something (at least the bottom layer must have 1 block) must have been placed, return true
- return ORE_PLACED;
- }
-
- private String fString = "unset", ore1String = "unset", ore2String = "unset", ore3String = "unset", ore4String = "unset";
- Map<Materials, String> gtOreMap = new HashMap<Materials, String>();
-
- @SuppressWarnings("deprecation")
- public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, Block aMetaData, boolean isSmallOre,
- boolean air) {
- if (!air) {
- aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1));
- }
-
- //Set GT ORE
- if (aMetaData instanceof GT_Block_Ores){
- if (ore1String.equals("unset")) {
- ore1String = Utils.sanitizeString(this.mPrimary.getLocalizedName().toLowerCase());
- }
- if (ore2String.equals("unset")) {
- ore2String = Utils.sanitizeString(this.mSecondaryMeta.getLocalizedName().toLowerCase());
- }
- if (ore3String.equals("unset")) {
- ore3String = Utils.sanitizeString(this.mBetweenMeta.getLocalizedName().toLowerCase());
- }
- if (ore4String.equals("unset")) {
- ore4String = Utils.sanitizeString(this.mSporadicMeta.getLocalizedName().toLowerCase());
- }
-
- if (this.mPrimaryMeta == aMetaData){
- for (Materials f : Materials.values()){
- if (!gtOreMap.containsKey(f)) {
- gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
- }
- fString = gtOreMap.get(f);
- if (fString.contains(ore1String)){
- int r = f.mMetaItemSubID;
- if (setOreBlock(aWorld, aX, aY, aZ, r, false)){
- Logger.WARNING("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- }
- }
- if (this.mSecondaryMeta == aMetaData){
- for (Materials f : Materials.values()){
- if (!gtOreMap.containsKey(f)) {
- gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
- }
- fString = gtOreMap.get(f);
- if (fString.contains(ore2String)){
- int r = f.mMetaItemSubID;
- if (setOreBlock(aWorld, aX, aY, aZ, r, false)){
- Logger.WARNING("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- }
- }
- if (this.mBetweenMeta == aMetaData){
- for (Materials f : Materials.values()){
- if (!gtOreMap.containsKey(f)) {
- gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
- }
- fString = gtOreMap.get(f);
- if (fString.contains(ore3String)){
- int r = f.mMetaItemSubID;
- if (setOreBlock(aWorld, aX, aY, aZ, r, false)){
- Logger.WARNING("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- }
- }
- if (this.mSporadicMeta == aMetaData){
- for (Materials f : Materials.values()){
- if (!gtOreMap.containsKey(f)) {
- gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
- }
- fString = gtOreMap.get(f);
- if (fString.contains(ore4String)){
- int r = f.mMetaItemSubID;
- if (setOreBlock(aWorld, aX, aY, aZ, r, false)){
- Logger.WARNING("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- }
- }
-
- }
-
- Block tBlock = aWorld.getBlock(aX, aY, aZ);
- Block tOreBlock = aMetaData;
- int BlockMeta = aWorld.getBlockMetadata(aX, aY, aZ);
- String BlockName = tBlock.getUnlocalizedName();
- if (
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sand) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites) ||
- (mUpdated && tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, mStoneTypes)) ||/*
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockSecondLayer) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockMainFiller) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockSecondaryFiller) ||*/
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sandstone)) {
-
- if (aWorld.setBlock(aX, aY, aZ, tOreBlock, 0, 3)){
- Logger.WARNING("[World Generation Debug] Set "+tOreBlock.getLocalizedName()+" at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- return false;
- }
-
+ Logger.WARNING("[World Generation Debug] Trying to set Ores?");
+ for (level = tMinY; level < (tMinY - 1 + 3); level++) {
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSecondaryMeta != null)) {
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
+ placeCount[1]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ }
+ // Low Middle layer is between + sporadic
+ // level should be = tMinY-1+3 from end of for loop
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if ((aRandom.nextInt(2) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mBetweenMeta
+ != null)) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
+ placeCount[2]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ // High Middle layer is between + primary + sporadic
+ level++; // Increment level to next layer
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if ((aRandom.nextInt(2) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mBetweenMeta
+ != null)) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
+ placeCount[2]++;
+ }
+ } else if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mPrimaryMeta != null)) {
+ if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
+ placeCount[0]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ // Top two layers are primary + sporadic
+ level++; // Increment level to next layer
+ for (; level < (tMinY + 6); level++) { // should do two layers
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mPrimaryMeta != null)) {
+ if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
+ placeCount[0]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ }
+ if (debugWorldGen) {
+ String tDimensionName = aWorld.provider.getDimensionName();
+ GT_Log.out.println("Generated Orevein:" + this.mWorldGenName + " Dimension="
+ + tDimensionName + " mX="
+ + aChunkX / 16 + " mZ="
+ + aChunkZ / 16 + " oreseedX="
+ + aSeedX / 16 + " oreseedZ="
+ + aSeedZ / 16 + " cY="
+ + tMinY + " wXVein"
+ + wXVein + " eXVein"
+ + eXVein + " nZVein"
+ + nZVein + " sZVein"
+ + sZVein + " locDen="
+ + localDensity + " Den="
+ + this.mDensity + " Sec="
+ + placeCount[1] + " Spo="
+ + placeCount[3] + " Bet="
+ + placeCount[2] + " Pri="
+ + placeCount[0]);
+ }
+ // Something (at least the bottom layer must have 1 block) must have been placed, return true
+ return ORE_PLACED;
+ }
+
+ private String fString = "unset",
+ ore1String = "unset",
+ ore2String = "unset",
+ ore3String = "unset",
+ ore4String = "unset";
+ Map<Materials, String> gtOreMap = new HashMap<Materials, String>();
+
+ @SuppressWarnings("deprecation")
+ public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, Block aMetaData, boolean isSmallOre, boolean air) {
+ if (!air) {
+ aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1));
+ }
+
+ // Set GT ORE
+ if (aMetaData instanceof GT_Block_Ores) {
+ if (ore1String.equals("unset")) {
+ ore1String =
+ Utils.sanitizeString(this.mPrimary.getLocalizedName().toLowerCase());
+ }
+ if (ore2String.equals("unset")) {
+ ore2String = Utils.sanitizeString(
+ this.mSecondaryMeta.getLocalizedName().toLowerCase());
+ }
+ if (ore3String.equals("unset")) {
+ ore3String = Utils.sanitizeString(
+ this.mBetweenMeta.getLocalizedName().toLowerCase());
+ }
+ if (ore4String.equals("unset")) {
+ ore4String = Utils.sanitizeString(
+ this.mSporadicMeta.getLocalizedName().toLowerCase());
+ }
- private boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int mMetaItemSubID, boolean useless){
+ if (this.mPrimaryMeta == aMetaData) {
+ for (Materials f : Materials.values()) {
+ if (!gtOreMap.containsKey(f)) {
+ gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
+ }
+ fString = gtOreMap.get(f);
+ if (fString.contains(ore1String)) {
+ int r = f.mMetaItemSubID;
+ if (setOreBlock(aWorld, aX, aY, aZ, r, false)) {
+ Logger.WARNING("[World Generation Debug] Set " + f.mDefaultLocalName + " Ore at X: " + aX
+ + " | Y: " + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ }
+ }
+ if (this.mSecondaryMeta == aMetaData) {
+ for (Materials f : Materials.values()) {
+ if (!gtOreMap.containsKey(f)) {
+ gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
+ }
+ fString = gtOreMap.get(f);
+ if (fString.contains(ore2String)) {
+ int r = f.mMetaItemSubID;
+ if (setOreBlock(aWorld, aX, aY, aZ, r, false)) {
+ Logger.WARNING("[World Generation Debug] Set " + f.mDefaultLocalName + " Ore at X: " + aX
+ + " | Y: " + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ }
+ }
+ if (this.mBetweenMeta == aMetaData) {
+ for (Materials f : Materials.values()) {
+ if (!gtOreMap.containsKey(f)) {
+ gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
+ }
+ fString = gtOreMap.get(f);
+ if (fString.contains(ore3String)) {
+ int r = f.mMetaItemSubID;
+ if (setOreBlock(aWorld, aX, aY, aZ, r, false)) {
+ Logger.WARNING("[World Generation Debug] Set " + f.mDefaultLocalName + " Ore at X: " + aX
+ + " | Y: " + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ }
+ }
+ if (this.mSporadicMeta == aMetaData) {
+ for (Materials f : Materials.values()) {
+ if (!gtOreMap.containsKey(f)) {
+ gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
+ }
+ fString = gtOreMap.get(f);
+ if (fString.contains(ore4String)) {
+ int r = f.mMetaItemSubID;
+ if (setOreBlock(aWorld, aX, aY, aZ, r, false)) {
+ Logger.WARNING("[World Generation Debug] Set " + f.mDefaultLocalName + " Ore at X: " + aX
+ + " | Y: " + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ Block tBlock = aWorld.getBlock(aX, aY, aZ);
+ Block tOreBlock = aMetaData;
+ int BlockMeta = aWorld.getBlockMetadata(aX, aY, aZ);
+ String BlockName = tBlock.getUnlocalizedName();
+ if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sand)
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt)
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)
+ || (mUpdated && tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, mStoneTypes))
+ || /*
+ tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockSecondLayer) ||
+ tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockMainFiller) ||
+ tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockSecondaryFiller) ||*/ tBlock
+ .isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sandstone)) {
+
+ if (aWorld.setBlock(aX, aY, aZ, tOreBlock, 0, 3)) {
+ Logger.WARNING("[World Generation Debug] Set " + tOreBlock.getLocalizedName() + " at X: " + aX
+ + " | Y: " + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ return false;
+ }
- //Get Class and Methods
- Method setOres = null;
- boolean is08 = !CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK;
+ private boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int mMetaItemSubID, boolean useless) {
- //GT 5.08
- if (is08){
- try {
- setOres = GT_TileEntity_Ores.class.getDeclaredMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class);
- }
- catch (NoSuchMethodException | SecurityException e) {
+ // Get Class and Methods
+ Method setOres = null;
+ boolean is08 = !CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK;
- }
- }
- //GT 5.09
- else {
- try {
- setOres = GT_TileEntity_Ores.class.getDeclaredMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class, boolean.class);
- }
- catch (NoSuchMethodException | SecurityException e) {
+ // GT 5.08
+ if (is08) {
+ try {
+ setOres = GT_TileEntity_Ores.class.getDeclaredMethod(
+ "setOreBlock", World.class, int.class, int.class, int.class, int.class);
+ } catch (NoSuchMethodException | SecurityException e) {
- }
- }
+ }
+ }
+ // GT 5.09
+ else {
+ try {
+ setOres = GT_TileEntity_Ores.class.getDeclaredMethod(
+ "setOreBlock", World.class, int.class, int.class, int.class, int.class, boolean.class);
+ } catch (NoSuchMethodException | SecurityException e) {
- try {
- if (is08 && setOres != null){
- setOres.invoke(null, aWorld, aX, aY, aZ, mMetaItemSubID);
- }
- else if (!is08 && setOres != null){
- setOres.invoke(null, aWorld, aX, aY, aZ, mMetaItemSubID, useless);
- }
- else {
- return false;
- }}
- catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+
+ try {
+ if (is08 && setOres != null) {
+ setOres.invoke(null, aWorld, aX, aY, aZ, mMetaItemSubID);
+ } else if (!is08 && setOres != null) {
+ setOres.invoke(null, aWorld, aX, aY, aZ, mMetaItemSubID, useless);
+ } else {
+ return false;
+ }
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- return false;
- }
-} \ No newline at end of file
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/gen/map/MapGenExtendedVillage.java b/src/main/java/gtPlusPlus/australia/gen/map/MapGenExtendedVillage.java
index 8fc6940242..72b303ff69 100644
--- a/src/main/java/gtPlusPlus/australia/gen/map/MapGenExtendedVillage.java
+++ b/src/main/java/gtPlusPlus/australia/gen/map/MapGenExtendedVillage.java
@@ -1,17 +1,15 @@
package gtPlusPlus.australia.gen.map;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.australia.GTplusplus_Australia;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Random;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.australia.GTplusplus_Australia;
-
import java.util.Map.Entry;
+import java.util.Random;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@@ -22,60 +20,57 @@ import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraft.world.gen.structure.StructureStart;
import net.minecraft.world.gen.structure.StructureVillagePieces;
-public class MapGenExtendedVillage extends MapGenStructure
-{
+public class MapGenExtendedVillage extends MapGenStructure {
/** A list of all the biomes villages can spawn in. */
- public static List<BiomeGenBase> villageSpawnBiomes = Arrays.asList(new BiomeGenBase[] {GTplusplus_Australia.Australian_Desert_Biome_3, GTplusplus_Australia.Australian_Plains_Biome, GTplusplus_Australia.Australian_Forest_Biome, GTplusplus_Australia.Australian_Outback_Biome});
+ public static List<BiomeGenBase> villageSpawnBiomes = Arrays.asList(new BiomeGenBase[] {
+ GTplusplus_Australia.Australian_Desert_Biome_3,
+ GTplusplus_Australia.Australian_Plains_Biome,
+ GTplusplus_Australia.Australian_Forest_Biome,
+ GTplusplus_Australia.Australian_Outback_Biome
+ });
/** World terrain type, 0 for normal, 1 for flat map */
private int terrainType;
+
private int field_82665_g;
private int field_82666_h;
- public MapGenExtendedVillage(){
+ public MapGenExtendedVillage() {
this.field_82665_g = 8;
this.field_82666_h = 4;
}
- public MapGenExtendedVillage(Map<?, ?> p_i2093_1_){
+ public MapGenExtendedVillage(Map<?, ?> p_i2093_1_) {
this();
Iterator<?> iterator = p_i2093_1_.entrySet().iterator();
Logger.INFO("Created Extended Village Object.");
-
- while (iterator.hasNext())
- {
- Entry<?, ?> entry = (Entry<?, ?>)iterator.next();
-
- if (((String)entry.getKey()).equals("size"))
- {
- this.terrainType = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.terrainType, 0);
- }
- else if (((String)entry.getKey()).equals("distance"))
- {
- this.field_82665_g = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.field_82665_g, this.field_82666_h + 1);
+
+ while (iterator.hasNext()) {
+ Entry<?, ?> entry = (Entry<?, ?>) iterator.next();
+
+ if (((String) entry.getKey()).equals("size")) {
+ this.terrainType = MathHelper.parseIntWithDefaultAndMax((String) entry.getValue(), this.terrainType, 0);
+ } else if (((String) entry.getKey()).equals("distance")) {
+ this.field_82665_g = MathHelper.parseIntWithDefaultAndMax(
+ (String) entry.getValue(), this.field_82665_g, this.field_82666_h + 1);
}
}
}
- public String func_143025_a()
- {
+ public String func_143025_a() {
return "ExtendedVillage";
}
- protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_)
- {
-
-
+ protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) {
+
int k = p_75047_1_;
int l = p_75047_2_;
- if (p_75047_1_ < 0)
- {
+ if (p_75047_1_ < 0) {
p_75047_1_ -= this.field_82665_g - 1;
}
- if (p_75047_2_ < 0)
- {
+ if (p_75047_2_ < 0) {
p_75047_2_ -= this.field_82665_g - 1;
}
@@ -87,13 +82,12 @@ public class MapGenExtendedVillage extends MapGenStructure
i1 += random.nextInt(this.field_82665_g - this.field_82666_h);
j1 += random.nextInt(this.field_82665_g - this.field_82666_h);
- if (k == i1 && l == j1)
- {
- boolean flag = this.worldObj.getWorldChunkManager().areBiomesViable(k * 16 + 8, l * 16 + 8, 0, villageSpawnBiomes);
+ if (k == i1 && l == j1) {
+ boolean flag =
+ this.worldObj.getWorldChunkManager().areBiomesViable(k * 16 + 8, l * 16 + 8, 0, villageSpawnBiomes);
- if (flag)
- {
- Logger.INFO("Found viable biome(s) for custom village");
+ if (flag) {
+ Logger.INFO("Found viable biome(s) for custom village");
return true;
}
}
@@ -101,122 +95,118 @@ public class MapGenExtendedVillage extends MapGenStructure
return false;
}
- protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_)
- {
+ protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) {
return new MapGenExtendedVillage.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_, this.terrainType);
}
- public static class Start extends StructureStart
- {
- /** well ... thats what it does */
- private boolean hasMoreThanTwoComponents;
+ public static class Start extends StructureStart {
+ /** well ... thats what it does */
+ private boolean hasMoreThanTwoComponents;
- public Start() {
- }
+ public Start() {}
- public Start(World p_i2092_1_, Random p_i2092_2_, int p_i2092_3_, int p_i2092_4_, int p_i2092_5_)
- {
- super(p_i2092_3_, p_i2092_4_);
- Logger.INFO("Trying to Start Village Builder.");
- List<?> list = StructureVillagePieces.getStructureVillageWeightedPieceList(p_i2092_2_, p_i2092_5_);
- StructureVillagePieces.Start start = new StructureVillagePieces.Start(p_i2092_1_.getWorldChunkManager(), 0, p_i2092_2_, (p_i2092_3_ << 4) + 2, (p_i2092_4_ << 4) + 2, list, p_i2092_5_);
- this.components.add(start);
- start.buildComponent(start, this.components, p_i2092_2_);
- List<?> list1 = start.field_74930_j;
- List<?> list2 = start.field_74932_i;
- int l;
- Logger.INFO("List1: "+list1.size()+" | List2: "+list2.size());
-
- while (!list1.isEmpty() || !list2.isEmpty())
- {
- Logger.INFO("Iterating non empty list.");
- StructureComponent structurecomponent;
-
- if (list1.isEmpty())
- {
- l = p_i2092_2_.nextInt(list2.size());
- structurecomponent = (StructureComponent)list2.remove(l);
- structurecomponent.buildComponent(start, this.components, p_i2092_2_);
- }
- else
- {
- l = p_i2092_2_.nextInt(list1.size());
- structurecomponent = (StructureComponent)list1.remove(l);
- structurecomponent.buildComponent(start, this.components, p_i2092_2_);
- }
+ public Start(World p_i2092_1_, Random p_i2092_2_, int p_i2092_3_, int p_i2092_4_, int p_i2092_5_) {
+ super(p_i2092_3_, p_i2092_4_);
+ Logger.INFO("Trying to Start Village Builder.");
+ List<?> list = StructureVillagePieces.getStructureVillageWeightedPieceList(p_i2092_2_, p_i2092_5_);
+ StructureVillagePieces.Start start = new StructureVillagePieces.Start(
+ p_i2092_1_.getWorldChunkManager(),
+ 0,
+ p_i2092_2_,
+ (p_i2092_3_ << 4) + 2,
+ (p_i2092_4_ << 4) + 2,
+ list,
+ p_i2092_5_);
+ this.components.add(start);
+ start.buildComponent(start, this.components, p_i2092_2_);
+ List<?> list1 = start.field_74930_j;
+ List<?> list2 = start.field_74932_i;
+ int l;
+ Logger.INFO("List1: " + list1.size() + " | List2: " + list2.size());
+
+ while (!list1.isEmpty() || !list2.isEmpty()) {
+ Logger.INFO("Iterating non empty list.");
+ StructureComponent structurecomponent;
+
+ if (list1.isEmpty()) {
+ l = p_i2092_2_.nextInt(list2.size());
+ structurecomponent = (StructureComponent) list2.remove(l);
+ structurecomponent.buildComponent(start, this.components, p_i2092_2_);
+ } else {
+ l = p_i2092_2_.nextInt(list1.size());
+ structurecomponent = (StructureComponent) list1.remove(l);
+ structurecomponent.buildComponent(start, this.components, p_i2092_2_);
}
- Logger.INFO("Finished iterating lists, updating bounding box for structure.");
+ }
+ Logger.INFO("Finished iterating lists, updating bounding box for structure.");
- this.updateBoundingBox();
- l = 0;
- Iterator iterator = this.components.iterator();
+ this.updateBoundingBox();
+ l = 0;
+ Iterator iterator = this.components.iterator();
- while (iterator.hasNext())
- {
- Logger.INFO("Iterating Components.");
- StructureComponent structurecomponent1 = (StructureComponent)iterator.next();
+ while (iterator.hasNext()) {
+ Logger.INFO("Iterating Components.");
+ StructureComponent structurecomponent1 = (StructureComponent) iterator.next();
- if (!(structurecomponent1 instanceof StructureVillagePieces.Road))
- {
- ++l;
- }
+ if (!(structurecomponent1 instanceof StructureVillagePieces.Road)) {
+ ++l;
}
-
- Logger.INFO("hasMoreThanTwoComponents? "+(l > 2));
- this.hasMoreThanTwoComponents = l > 2;
}
- /**
- * currently only defined for Villages, returns true if Village has more than 2 non-road components
- */
- public boolean isSizeableStructure()
- {
- //return this.hasMoreThanTwoComponents;
- return true;
- }
+ Logger.INFO("hasMoreThanTwoComponents? " + (l > 2));
+ this.hasMoreThanTwoComponents = l > 2;
+ }
- public void func_143022_a(NBTTagCompound p_143022_1_)
- {
- super.func_143022_a(p_143022_1_);
- p_143022_1_.setBoolean("Valid", this.hasMoreThanTwoComponents);
- }
+ /**
+ * currently only defined for Villages, returns true if Village has more than 2 non-road components
+ */
+ public boolean isSizeableStructure() {
+ // return this.hasMoreThanTwoComponents;
+ return true;
+ }
- public void func_143017_b(NBTTagCompound p_143017_1_)
- {
- super.func_143017_b(p_143017_1_);
- this.hasMoreThanTwoComponents = p_143017_1_.getBoolean("Valid");
- }
+ public void func_143022_a(NBTTagCompound p_143022_1_) {
+ super.func_143022_a(p_143022_1_);
+ p_143022_1_.setBoolean("Valid", this.hasMoreThanTwoComponents);
+ }
+
+ public void func_143017_b(NBTTagCompound p_143017_1_) {
+ super.func_143017_b(p_143017_1_);
+ this.hasMoreThanTwoComponents = p_143017_1_.getBoolean("Valid");
}
-
+ }
+
/**
* Generates structures in specified chunk next to existing structures. Does *not* generate StructureStarts.
*/
@Override
- public boolean generateStructuresInChunk(World p_75051_1_, Random p_75051_2_, int p_75051_3_, int p_75051_4_){
- //Logger.INFO("Try generate Structs in chunk.");
+ public boolean generateStructuresInChunk(World p_75051_1_, Random p_75051_2_, int p_75051_3_, int p_75051_4_) {
+ // Logger.INFO("Try generate Structs in chunk.");
this.callPrivateFunction1(p_75051_1_);
int k = (p_75051_3_ << 4) + 8;
int l = (p_75051_4_ << 4) + 8;
boolean flag = false;
Iterator iterator = this.structureMap.values().iterator();
-
- //Logger.INFO("Iteration Size: "+this.structureMap.values().size());
- while (iterator.hasNext())
- {
- //Logger.INFO("Iterating.");
- StructureStart structurestart = (StructureStart)iterator.next();
-
- if (structurestart.isSizeableStructure() && (structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15) || structurestart.getBoundingBox().intersectsWith(k, l, k - 15, l - 15)))
- {
- Logger.INFO("Iterating. 2");
- structurestart.generateStructure(p_75051_1_, p_75051_2_, new StructureBoundingBox(k, l, k + 15, l + 15));
+
+ // Logger.INFO("Iteration Size: "+this.structureMap.values().size());
+ while (iterator.hasNext()) {
+ // Logger.INFO("Iterating.");
+ StructureStart structurestart = (StructureStart) iterator.next();
+
+ if (structurestart.isSizeableStructure()
+ && (structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15)
+ || structurestart.getBoundingBox().intersectsWith(k, l, k - 15, l - 15))) {
+ Logger.INFO("Iterating. 2");
+ structurestart.generateStructure(
+ p_75051_1_, p_75051_2_, new StructureBoundingBox(k, l, k + 15, l + 15));
flag = true;
- this.callPrivateFunction2(structurestart.func_143019_e(), structurestart.func_143018_f(), structurestart);
+ this.callPrivateFunction2(
+ structurestart.func_143019_e(), structurestart.func_143018_f(), structurestart);
}
- /* else {
+ /* else {
Logger.INFO("Iterating. 3");
Logger.INFO("structurestart.isSizeableStructure()? "+structurestart.isSizeableStructure());
- Logger.INFO("structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15)? "+(structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15) || structurestart.getBoundingBox().intersectsWith(k, l, k - 15, l - 15)));
+ Logger.INFO("structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15)? "+(structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15) || structurestart.getBoundingBox().intersectsWith(k, l, k - 15, l - 15)));
Logger.INFO("K: "+k+" | L: "+l);
Logger.INFO("structure bounding box info: x-:"+structurestart.getBoundingBox().minX+" y-:"+structurestart.getBoundingBox().minY+" x+:"+structurestart.getBoundingBox().maxX+" y+:"+structurestart.getBoundingBox().maxY);
}*/
@@ -224,42 +214,46 @@ public class MapGenExtendedVillage extends MapGenStructure
return flag;
}
-
+
Method mMethod1;
Method mMethod2;
+
private boolean callPrivateFunction1(World aWorld) {
- if (mMethod1 == null) {
- try {
- mMethod1 = MapGenStructure.class.getDeclaredMethod("func_143027_a", World.class);
- } catch (NoSuchMethodException | SecurityException e) {
- return false;
- }
- }
- if (mMethod1 != null) {
- try {
- //Logger.INFO("Invoking func_143027_a");
- mMethod1.invoke(this, aWorld);
- return true;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
- }
- return false;
+ if (mMethod1 == null) {
+ try {
+ mMethod1 = MapGenStructure.class.getDeclaredMethod("func_143027_a", World.class);
+ } catch (NoSuchMethodException | SecurityException e) {
+ return false;
+ }
+ }
+ if (mMethod1 != null) {
+ try {
+ // Logger.INFO("Invoking func_143027_a");
+ mMethod1.invoke(this, aWorld);
+ return true;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+ return false;
}
-
+
private boolean callPrivateFunction2(int aInt1, int aInt2, StructureStart aStruct) {
- if (mMethod2 == null) {
- try {
- mMethod2 = MapGenStructure.class.getDeclaredMethod("func_143026_a", int.class, int.class, StructureStart.class);
- } catch (NoSuchMethodException | SecurityException e) {
- return false;
- }
- }
- if (mMethod2 != null) {
- try {
- Logger.INFO("Invoking func_143026_a");
- mMethod2.invoke(this, aInt1, aInt2, aStruct);
- return true;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
- }
- return false;
+ if (mMethod2 == null) {
+ try {
+ mMethod2 = MapGenStructure.class.getDeclaredMethod(
+ "func_143026_a", int.class, int.class, StructureStart.class);
+ } catch (NoSuchMethodException | SecurityException e) {
+ return false;
+ }
+ }
+ if (mMethod2 != null) {
+ try {
+ Logger.INFO("Invoking func_143026_a");
+ mMethod2.invoke(this, aInt1, aInt2, aStruct);
+ return true;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+ return false;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/australia/gen/map/MapGenLargeRavine.java b/src/main/java/gtPlusPlus/australia/gen/map/MapGenLargeRavine.java
index 0eab94c5d1..78c7e3b4c1 100644
--- a/src/main/java/gtPlusPlus/australia/gen/map/MapGenLargeRavine.java
+++ b/src/main/java/gtPlusPlus/australia/gen/map/MapGenLargeRavine.java
@@ -1,217 +1,233 @@
package gtPlusPlus.australia.gen.map;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Random;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.MapGenRavine;
public class MapGenLargeRavine extends MapGenRavine {
- private float[] field_75046_d = new float[1024];
-
- @Override
- protected void func_151540_a(long aSeed, int var1, int var2, Block[] aBlocksInChunkOrPassedIn, double p_151540_6_,
- double p_151540_8_, double p_151540_10_, float p_151540_12_, float p_151540_13_, float p_151540_14_,
- int possibleCurrentY, int possibleMaxY, double p_151540_17_) {
- Random random = CORE.RANDOM;
- //gtPlusPlus.api.objects.Logger.WORLD("Generating Large Ravine. 1");
- this.range *= 2;
- double d4 = (double) (var1 * 24 + 16);
- double d5 = (double) (var2 * 24 + 16);
- float f3 = 0.0F;
- float f4 = 0.0F;
-
- if (possibleMaxY <= 25) {
- int j1 = Math.min(this.range * 16 - 32, 200);
- possibleMaxY = j1 - random.nextInt(j1 / 4);
- }
-
- boolean possibleIsUnderGroundFlag = false;
-
- if (possibleCurrentY <= -1) {
- possibleCurrentY = possibleMaxY / 3;
- possibleIsUnderGroundFlag = true;
- }
-
- float f5 = 1.0F;
-
- for (int k1 = 0; k1 < 256; ++k1) {
- if (k1 == 0 || random.nextInt(3) == 0) {
- f5 = 1.0F + random.nextFloat() * random.nextFloat() * 1.0F;
- }
-
- this.field_75046_d[k1] = f5 * f5;
- }
-
- for (; possibleCurrentY < possibleMaxY; ++possibleCurrentY) {
- double d12 = 3.5D + (double) (MathHelper.sin((float) possibleCurrentY * CORE.PI / (float) possibleMaxY)
- * p_151540_12_ * 1.0F);
- double d6 = d12 * p_151540_17_;
- d12 *= (double) random.nextFloat() * 0.55D + 0.75D;
- d6 *= (double) random.nextFloat() * 0.55D + 0.75D;
- float f6 = MathHelper.cos(p_151540_14_);
- float f7 = MathHelper.sin(p_151540_14_);
- p_151540_6_ += (double) (MathHelper.cos(p_151540_13_) * f6);
- p_151540_8_ += (double) f7;
- p_151540_10_ += (double) (MathHelper.sin(p_151540_13_) * f6);
- p_151540_14_ *= 1.7F;
- p_151540_14_ += f4 * 0.25F;
- p_151540_13_ += f3 * 0.25F;
- f4 *= 0.8F;
- f3 *= 0.5F;
- f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;
- f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F;
-
- if (possibleIsUnderGroundFlag || random.nextInt(4) != 0) {
- double d7 = p_151540_6_ - d4;
- double d8 = p_151540_10_ - d5;
- double d9 = (double) (possibleMaxY - possibleCurrentY);
- double d10 = (double) (p_151540_12_ + 2.0F + 16.0F);
-
- if (d7 * d7 + d8 * d8 - d9 * d9 > d10 * d10) {
- return;
- }
-
- if (p_151540_6_ >= d4 - 16.0D - d12 * 2.0D && p_151540_10_ >= d5 - 16.0D - d12 * 2.0D
- && p_151540_6_ <= d4 + 16.0D + d12 * 2.0D && p_151540_10_ <= d5 + 16.0D + d12 * 2.0D) {
- int i4 = MathHelper.floor_double(p_151540_6_ - d12) - var1 * 16 - 1;
- int l1 = MathHelper.floor_double(p_151540_6_ + d12) - var1 * 16 + 1;
- int j4 = MathHelper.floor_double(p_151540_8_ - d6) - 1;
- int i2 = MathHelper.floor_double(p_151540_8_ + d6) + 1;
- int k4 = MathHelper.floor_double(p_151540_10_ - d12) - var2 * 16 - 1;
- int j2 = MathHelper.floor_double(p_151540_10_ + d12) - var2 * 16 + 1;
-
- if (i4 < 0) {
- i4 = 0;
- }
-
- if (l1 > 16) {
- l1 = 16;
- }
-
- if (j4 < 1) {
- j4 = 1;
- }
-
- if (i2 > 248) {
- i2 = 248;
- }
-
- if (k4 < 0) {
- k4 = 0;
- }
-
- if (j2 > 16) {
- j2 = 16;
- }
-
- boolean flag2 = false;
- int k2;
- int j3;
-
- for (k2 = i4; !flag2 && k2 < l1; ++k2) {
- for (int l2 = k4; !flag2 && l2 < j2; ++l2) {
- for (int i3 = i2 + 1; !flag2 && i3 >= j4 - 1; --i3) {
- j3 = (k2 * 16 + l2) * 256 + i3;
-
- if (i3 >= 0 && i3 < 256) {
- Block block = aBlocksInChunkOrPassedIn[j3];
-
- if (isOceanBlock(aBlocksInChunkOrPassedIn, j3, k2, i3, l2, var1, var2)) {
- flag2 = true;
- }
-
- if (i3 != j4 - 1 && k2 != i4 && k2 != l1 - 1 && l2 != k4 && l2 != j2 - 1) {
- i3 = j4;
- }
- }
- }
- }
- }
-
- if (!flag2) {
- for (k2 = i4; k2 < l1; ++k2) {
- double d13 = ((double) (k2 + var1 * 16) + 0.5D - p_151540_6_) / d12;
-
- for (j3 = k4; j3 < j2; ++j3) {
- double d14 = ((double) (j3 + var2 * 16) + 0.5D - p_151540_10_) / d12;
- int k3 = (k2 * 16 + j3) * 256 + i2;
- boolean flag = false;
-
- if (d13 * d13 + d14 * d14 < 1.0D) {
- for (int l3 = i2 - 1; l3 >= j4; --l3) {
- double d11 = ((double) l3 + 0.5D - p_151540_8_) / d6;
-
- if ((d13 * d13 + d14 * d14) * (double) this.field_75046_d[l3]
- + d11 * d11 / 6.0D < 1.0D) {
- Block block1 = aBlocksInChunkOrPassedIn[k3];
-
- if (checkIfTopBlock(aBlocksInChunkOrPassedIn, k3, k2, l3, j3, var1, var2)) {
- flag = true;
- }
-
- Logger.WORLD("Generating Large Ravine. 2");
- digBlock(aBlocksInChunkOrPassedIn, k3, k2, l3, j3, var1, var2, flag);
- }
-
- --k3;
- }
- }
- }
- }
-
- if (possibleIsUnderGroundFlag) {
- break;
- }
- }
- }
- }
- }
- }
-
- // generate?
- @Override
- protected void func_151538_a(World p_151538_1_, int p_151538_2_, int p_151538_3_, int chunkX, int chunkZ,
- Block[] blocks) {
- if (this.rand.nextInt(50) == 0) {
- double d0 = (double) (p_151538_2_ * 16 + this.rand.nextInt(16));
- double d1 = (double) (this.rand.nextInt(this.rand.nextInt(40) + 8) + 20);
- double d2 = (double) (p_151538_3_ * 16 + this.rand.nextInt(16));
- byte b0 = 1;
-
- for (int i1 = 0; i1 < b0; ++i1) {
- float f = this.rand.nextFloat() * (float) Math.PI * 2.0F;
- float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
- float f2 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F;
- this.func_151540_a(this.rand.nextLong(), chunkX, chunkZ, blocks, d0, d1, d2, f2, f, f1, 0, 0, 3.0D);
- }
- }
- }
-
- private static Method isTopBlock;
-
- // Determine if the block at the specified location is the top block for the
- // biome, we take into account
- private synchronized boolean checkIfTopBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) {
- try {
- if (isTopBlock == null) {
- isTopBlock = MapGenRavine.class.getDeclaredMethod("isTopBlock", Block[].class, int.class, int.class,
- int.class, int.class, int.class, int.class);
- }
- if (isTopBlock != null) {
- return (boolean) isTopBlock.invoke(this, data, index, x, y, z, chunkX, chunkZ);
- } else {
- return false;
- }
- } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException n) {
- return false;
- }
- }
-
-} \ No newline at end of file
+ private float[] field_75046_d = new float[1024];
+
+ @Override
+ protected void func_151540_a(
+ long aSeed,
+ int var1,
+ int var2,
+ Block[] aBlocksInChunkOrPassedIn,
+ double p_151540_6_,
+ double p_151540_8_,
+ double p_151540_10_,
+ float p_151540_12_,
+ float p_151540_13_,
+ float p_151540_14_,
+ int possibleCurrentY,
+ int possibleMaxY,
+ double p_151540_17_) {
+ Random random = CORE.RANDOM;
+ // gtPlusPlus.api.objects.Logger.WORLD("Generating Large Ravine. 1");
+ this.range *= 2;
+ double d4 = (double) (var1 * 24 + 16);
+ double d5 = (double) (var2 * 24 + 16);
+ float f3 = 0.0F;
+ float f4 = 0.0F;
+
+ if (possibleMaxY <= 25) {
+ int j1 = Math.min(this.range * 16 - 32, 200);
+ possibleMaxY = j1 - random.nextInt(j1 / 4);
+ }
+
+ boolean possibleIsUnderGroundFlag = false;
+
+ if (possibleCurrentY <= -1) {
+ possibleCurrentY = possibleMaxY / 3;
+ possibleIsUnderGroundFlag = true;
+ }
+
+ float f5 = 1.0F;
+
+ for (int k1 = 0; k1 < 256; ++k1) {
+ if (k1 == 0 || random.nextInt(3) == 0) {
+ f5 = 1.0F + random.nextFloat() * random.nextFloat() * 1.0F;
+ }
+
+ this.field_75046_d[k1] = f5 * f5;
+ }
+
+ for (; possibleCurrentY < possibleMaxY; ++possibleCurrentY) {
+ double d12 = 3.5D
+ + (double) (MathHelper.sin((float) possibleCurrentY * CORE.PI / (float) possibleMaxY)
+ * p_151540_12_
+ * 1.0F);
+ double d6 = d12 * p_151540_17_;
+ d12 *= (double) random.nextFloat() * 0.55D + 0.75D;
+ d6 *= (double) random.nextFloat() * 0.55D + 0.75D;
+ float f6 = MathHelper.cos(p_151540_14_);
+ float f7 = MathHelper.sin(p_151540_14_);
+ p_151540_6_ += (double) (MathHelper.cos(p_151540_13_) * f6);
+ p_151540_8_ += (double) f7;
+ p_151540_10_ += (double) (MathHelper.sin(p_151540_13_) * f6);
+ p_151540_14_ *= 1.7F;
+ p_151540_14_ += f4 * 0.25F;
+ p_151540_13_ += f3 * 0.25F;
+ f4 *= 0.8F;
+ f3 *= 0.5F;
+ f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;
+ f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F;
+
+ if (possibleIsUnderGroundFlag || random.nextInt(4) != 0) {
+ double d7 = p_151540_6_ - d4;
+ double d8 = p_151540_10_ - d5;
+ double d9 = (double) (possibleMaxY - possibleCurrentY);
+ double d10 = (double) (p_151540_12_ + 2.0F + 16.0F);
+
+ if (d7 * d7 + d8 * d8 - d9 * d9 > d10 * d10) {
+ return;
+ }
+
+ if (p_151540_6_ >= d4 - 16.0D - d12 * 2.0D
+ && p_151540_10_ >= d5 - 16.0D - d12 * 2.0D
+ && p_151540_6_ <= d4 + 16.0D + d12 * 2.0D
+ && p_151540_10_ <= d5 + 16.0D + d12 * 2.0D) {
+ int i4 = MathHelper.floor_double(p_151540_6_ - d12) - var1 * 16 - 1;
+ int l1 = MathHelper.floor_double(p_151540_6_ + d12) - var1 * 16 + 1;
+ int j4 = MathHelper.floor_double(p_151540_8_ - d6) - 1;
+ int i2 = MathHelper.floor_double(p_151540_8_ + d6) + 1;
+ int k4 = MathHelper.floor_double(p_151540_10_ - d12) - var2 * 16 - 1;
+ int j2 = MathHelper.floor_double(p_151540_10_ + d12) - var2 * 16 + 1;
+
+ if (i4 < 0) {
+ i4 = 0;
+ }
+
+ if (l1 > 16) {
+ l1 = 16;
+ }
+
+ if (j4 < 1) {
+ j4 = 1;
+ }
+
+ if (i2 > 248) {
+ i2 = 248;
+ }
+
+ if (k4 < 0) {
+ k4 = 0;
+ }
+
+ if (j2 > 16) {
+ j2 = 16;
+ }
+
+ boolean flag2 = false;
+ int k2;
+ int j3;
+
+ for (k2 = i4; !flag2 && k2 < l1; ++k2) {
+ for (int l2 = k4; !flag2 && l2 < j2; ++l2) {
+ for (int i3 = i2 + 1; !flag2 && i3 >= j4 - 1; --i3) {
+ j3 = (k2 * 16 + l2) * 256 + i3;
+
+ if (i3 >= 0 && i3 < 256) {
+ Block block = aBlocksInChunkOrPassedIn[j3];
+
+ if (isOceanBlock(aBlocksInChunkOrPassedIn, j3, k2, i3, l2, var1, var2)) {
+ flag2 = true;
+ }
+
+ if (i3 != j4 - 1 && k2 != i4 && k2 != l1 - 1 && l2 != k4 && l2 != j2 - 1) {
+ i3 = j4;
+ }
+ }
+ }
+ }
+ }
+
+ if (!flag2) {
+ for (k2 = i4; k2 < l1; ++k2) {
+ double d13 = ((double) (k2 + var1 * 16) + 0.5D - p_151540_6_) / d12;
+
+ for (j3 = k4; j3 < j2; ++j3) {
+ double d14 = ((double) (j3 + var2 * 16) + 0.5D - p_151540_10_) / d12;
+ int k3 = (k2 * 16 + j3) * 256 + i2;
+ boolean flag = false;
+
+ if (d13 * d13 + d14 * d14 < 1.0D) {
+ for (int l3 = i2 - 1; l3 >= j4; --l3) {
+ double d11 = ((double) l3 + 0.5D - p_151540_8_) / d6;
+
+ if ((d13 * d13 + d14 * d14) * (double) this.field_75046_d[l3] + d11 * d11 / 6.0D
+ < 1.0D) {
+ Block block1 = aBlocksInChunkOrPassedIn[k3];
+
+ if (checkIfTopBlock(aBlocksInChunkOrPassedIn, k3, k2, l3, j3, var1, var2)) {
+ flag = true;
+ }
+
+ Logger.WORLD("Generating Large Ravine. 2");
+ digBlock(aBlocksInChunkOrPassedIn, k3, k2, l3, j3, var1, var2, flag);
+ }
+
+ --k3;
+ }
+ }
+ }
+ }
+
+ if (possibleIsUnderGroundFlag) {
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // generate?
+ @Override
+ protected void func_151538_a(
+ World p_151538_1_, int p_151538_2_, int p_151538_3_, int chunkX, int chunkZ, Block[] blocks) {
+ if (this.rand.nextInt(50) == 0) {
+ double d0 = (double) (p_151538_2_ * 16 + this.rand.nextInt(16));
+ double d1 = (double) (this.rand.nextInt(this.rand.nextInt(40) + 8) + 20);
+ double d2 = (double) (p_151538_3_ * 16 + this.rand.nextInt(16));
+ byte b0 = 1;
+
+ for (int i1 = 0; i1 < b0; ++i1) {
+ float f = this.rand.nextFloat() * (float) Math.PI * 2.0F;
+ float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
+ float f2 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F;
+ this.func_151540_a(this.rand.nextLong(), chunkX, chunkZ, blocks, d0, d1, d2, f2, f, f1, 0, 0, 3.0D);
+ }
+ }
+ }
+
+ private static Method isTopBlock;
+
+ // Determine if the block at the specified location is the top block for the
+ // biome, we take into account
+ private synchronized boolean checkIfTopBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) {
+ try {
+ if (isTopBlock == null) {
+ isTopBlock = MapGenRavine.class.getDeclaredMethod(
+ "isTopBlock", Block[].class, int.class, int.class, int.class, int.class, int.class, int.class);
+ }
+ if (isTopBlock != null) {
+ return (boolean) isTopBlock.invoke(this, data, index, x, y, z, chunkX, chunkZ);
+ } else {
+ return false;
+ }
+ } catch (NoSuchMethodException
+ | SecurityException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException n) {
+ return false;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java b/src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java
index b6b83d997b..98eb22f760 100644
--- a/src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java
+++ b/src/main/java/gtPlusPlus/australia/gen/map/component/AustraliaComponent.java
@@ -1,8 +1,7 @@
package gtPlusPlus.australia.gen.map.component;
-import java.util.Random;
-
import gtPlusPlus.api.objects.Logger;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
@@ -17,180 +16,185 @@ import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraftforge.common.ChestGenHooks;
public class AustraliaComponent extends StructureComponent {
- public AustraliaComponent() {
- }
-
- public AustraliaComponent(int direction, Random random, int x, int z, int dimX, int dimY, int dimZ) {
- super(direction);
- this.coordBaseMode = direction;
- this.boundingBox = calcBox(direction, x + (16 - dimX) / 2, 64, z + (16 - dimZ) / 2, dimX, dimY, dimZ, 0);
- }
-
- public boolean addComponentParts(World world, Random random) {
- return true;
- }
-
- protected void func_151554_b(World par1World, Block par2, int par3, int par4, int par5, int par6,
- StructureBoundingBox par7StructureBoundingBox) {
- int j1 = getXWithOffset(par4, par6);
- int k0 = getYWithOffset(par5);
- int k1 = k0;
- int l1 = getZWithOffset(par4, par6);
- if (par7StructureBoundingBox.isVecInside(j1, k1, l1)) {
- if (par1World.isAirBlock(j1, k1, l1)) {
- return;
- }
- k1--;
- while (((par1World.isAirBlock(j1, k1, l1)) || (!par1World.getBlock(j1, k1, l1).getMaterial().isSolid())
- || (par1World.getBlock(j1, k1, l1) == Blocks.ice)) && (k1 > 1)) {
- par1World.setBlock(j1, k1, l1, par2, par3, 2);
-
- k1--;
- }
- }
- }
-
- protected void clearCurrentPositionBlocksUpwards(World par1World, int par2, int par3, int par4,
- StructureBoundingBox par5StructureBoundingBox) {
- int l = getXWithOffset(par2, par4);
- int i1 = getYWithOffset(par3);
- int j1 = getZWithOffset(par2, par4);
- if (par5StructureBoundingBox.isVecInside(l, i1, j1)) {
- int i = 0;
- for (;;) {
- i++;
- if (((i >= 20) && (par1World.isAirBlock(l, i1, j1))) || (i1 >= 255)) {
- break;
- }
- par1World.setBlock(l, i1, j1, Blocks.air, 0, 2);
- i1++;
- }
- }
- }
-
- protected boolean isWaterBelow(World par1World, int par4, int par5, int par6,
- StructureBoundingBox par7StructureBoundingBox) {
- int j1 = getXWithOffset(par4, par6);
- int k1 = getYWithOffset(par5);
- int l1 = getZWithOffset(par4, par6);
- for (int i = 0; i < 10; i++) {
- Material material = par1World.getBlock(j1, k1, l1).getMaterial();
- if ((material.isLiquid()) || (material == Material.ice)) {
- return true;
- }
- if (!par1World.isAirBlock(j1, k1, l1)) {
- return false;
- }
- }
- return false;
- }
-
- public void setDispenser(int x, int y, int z, Random random, World world, int facing) {
- int i1 = getXWithOffset(x, z);
- int j1 = getYWithOffset(y);
- int k1 = getZWithOffset(x, z);
-
- world.setBlock(i1, j1, k1, Blocks.dispenser, facing, 0);
- TileEntity tileDispenser = world.getTileEntity(i1, j1, k1);
- if ((tileDispenser != null) && ((tileDispenser instanceof TileEntityDispenser))) {
- ChestGenHooks info = ChestGenHooks.getInfo("mineshaftCorridor");
- WeightedRandomChestContent.generateChestContents(random, info.getItems(random),
- (TileEntityDispenser) tileDispenser, info.getCount(random));
- } else {
- Logger.WARNING("Failed to fetch dispenser entity at (" + i1 + ", " + j1 + ", " + k1 + ")");
- }
- }
-
- protected void setSpawner(int x, int y, int z, String mobName, World world) {
- int i1 = getXWithOffset(x, z);
- int j1 = getYWithOffset(y);
- int k1 = getZWithOffset(x, z);
-
- world.setBlock(i1, j1, k1, Blocks.mob_spawner, 0, 2);
- TileEntity tileSpawner = world.getTileEntity(i1, j1, k1);
- if ((tileSpawner != null) && ((tileSpawner instanceof TileEntityMobSpawner))) {
- ((TileEntityMobSpawner) tileSpawner).func_145881_a().setEntityName(mobName);
- } else {
- Logger.WARNING("Failed to fetch mob spawner entity at (" + i1 + ", " + j1 + ", " + k1 + ")");
- }
- }
-
- protected void setFurnace(int x, int y, int z, World world) {
- int i1 = getXWithOffset(x, z);
- int j1 = getYWithOffset(y);
- int k1 = getZWithOffset(x, z);
-
- world.setBlock(i1, j1, k1, Blocks.furnace, getMetadataWithOffset(Blocks.piston, 3), 2);
- }
-
- protected void placeAirBlockAtPos(int x, int y, int z, StructureBoundingBox bounds, World world) {
- placeBlockAtCurrentPosition(world, Blocks.air, 0, x, y, z, bounds);
- }
-
- protected void place(Block block, int meta, int x, int y, int z, StructureBoundingBox bounds, World world) {
- placeBlockAtCurrentPosition(world, block, meta, x, y, z, bounds);
- }
-
- protected StructureBoundingBox calcBox(int direction, int x, int y, int z, int xLength, int height, int zLength,
- int xShift) {
- int minX = 0;
- int maxX = 0;
- int minY = y;
- int maxY = y + height;
- int minZ = 0;
- int maxZ = 0;
- switch (direction) {
- case 0:
- minX = x - xShift;
- maxX = x - xShift + xLength;
- minZ = z;
- maxZ = z + zLength;
- break;
- case 1:
- minX = x - zLength;
- maxX = x;
- minZ = z - xShift;
- maxZ = z - xShift + xLength;
- break;
- case 2:
- minX = x - xShift;
- maxX = x - xShift + xLength;
- minZ = z - zLength;
- maxZ = z;
- break;
- case 3:
- minX = x;
- maxX = x + zLength;
- minZ = z - xShift;
- maxZ = z - xShift + xLength;
- }
- return new StructureBoundingBox(minX, minY, minZ, maxX, maxY, maxZ);
- }
-
- protected int calcGroundHeight(World world, StructureBoundingBox boundingBox) {
- int height = 0;
- int count = 0;
- for (int z = boundingBox.minZ; z <= boundingBox.maxZ; z++) {
- for (int x = boundingBox.minX; x <= boundingBox.maxX; x++) {
- if (boundingBox.isVecInside(x, 64, z)) {
- height += Math.max(world.getTopSolidOrLiquidBlock(x, z), world.provider.getAverageGroundLevel());
- count++;
- }
- }
- }
- if (count == 0) {
- return -1;
- }
- return height / count;
- }
-
- protected void func_143012_a(NBTTagCompound nbttagcompound) {
- }
-
- protected void func_143011_b(NBTTagCompound nbttagcompound) {
- }
-
- public boolean addComponentParts(World world, Random random, StructureBoundingBox structureboundingbox) {
- return true;
- }
+ public AustraliaComponent() {}
+
+ public AustraliaComponent(int direction, Random random, int x, int z, int dimX, int dimY, int dimZ) {
+ super(direction);
+ this.coordBaseMode = direction;
+ this.boundingBox = calcBox(direction, x + (16 - dimX) / 2, 64, z + (16 - dimZ) / 2, dimX, dimY, dimZ, 0);
+ }
+
+ public boolean addComponentParts(World world, Random random) {
+ return true;
+ }
+
+ protected void func_151554_b(
+ World par1World,
+ Block par2,
+ int par3,
+ int par4,
+ int par5,
+ int par6,
+ StructureBoundingBox par7StructureBoundingBox) {
+ int j1 = getXWithOffset(par4, par6);
+ int k0 = getYWithOffset(par5);
+ int k1 = k0;
+ int l1 = getZWithOffset(par4, par6);
+ if (par7StructureBoundingBox.isVecInside(j1, k1, l1)) {
+ if (par1World.isAirBlock(j1, k1, l1)) {
+ return;
+ }
+ k1--;
+ while (((par1World.isAirBlock(j1, k1, l1))
+ || (!par1World.getBlock(j1, k1, l1).getMaterial().isSolid())
+ || (par1World.getBlock(j1, k1, l1) == Blocks.ice))
+ && (k1 > 1)) {
+ par1World.setBlock(j1, k1, l1, par2, par3, 2);
+
+ k1--;
+ }
+ }
+ }
+
+ protected void clearCurrentPositionBlocksUpwards(
+ World par1World, int par2, int par3, int par4, StructureBoundingBox par5StructureBoundingBox) {
+ int l = getXWithOffset(par2, par4);
+ int i1 = getYWithOffset(par3);
+ int j1 = getZWithOffset(par2, par4);
+ if (par5StructureBoundingBox.isVecInside(l, i1, j1)) {
+ int i = 0;
+ for (; ; ) {
+ i++;
+ if (((i >= 20) && (par1World.isAirBlock(l, i1, j1))) || (i1 >= 255)) {
+ break;
+ }
+ par1World.setBlock(l, i1, j1, Blocks.air, 0, 2);
+ i1++;
+ }
+ }
+ }
+
+ protected boolean isWaterBelow(
+ World par1World, int par4, int par5, int par6, StructureBoundingBox par7StructureBoundingBox) {
+ int j1 = getXWithOffset(par4, par6);
+ int k1 = getYWithOffset(par5);
+ int l1 = getZWithOffset(par4, par6);
+ for (int i = 0; i < 10; i++) {
+ Material material = par1World.getBlock(j1, k1, l1).getMaterial();
+ if ((material.isLiquid()) || (material == Material.ice)) {
+ return true;
+ }
+ if (!par1World.isAirBlock(j1, k1, l1)) {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ public void setDispenser(int x, int y, int z, Random random, World world, int facing) {
+ int i1 = getXWithOffset(x, z);
+ int j1 = getYWithOffset(y);
+ int k1 = getZWithOffset(x, z);
+
+ world.setBlock(i1, j1, k1, Blocks.dispenser, facing, 0);
+ TileEntity tileDispenser = world.getTileEntity(i1, j1, k1);
+ if ((tileDispenser != null) && ((tileDispenser instanceof TileEntityDispenser))) {
+ ChestGenHooks info = ChestGenHooks.getInfo("mineshaftCorridor");
+ WeightedRandomChestContent.generateChestContents(
+ random, info.getItems(random), (TileEntityDispenser) tileDispenser, info.getCount(random));
+ } else {
+ Logger.WARNING("Failed to fetch dispenser entity at (" + i1 + ", " + j1 + ", " + k1 + ")");
+ }
+ }
+
+ protected void setSpawner(int x, int y, int z, String mobName, World world) {
+ int i1 = getXWithOffset(x, z);
+ int j1 = getYWithOffset(y);
+ int k1 = getZWithOffset(x, z);
+
+ world.setBlock(i1, j1, k1, Blocks.mob_spawner, 0, 2);
+ TileEntity tileSpawner = world.getTileEntity(i1, j1, k1);
+ if ((tileSpawner != null) && ((tileSpawner instanceof TileEntityMobSpawner))) {
+ ((TileEntityMobSpawner) tileSpawner).func_145881_a().setEntityName(mobName);
+ } else {
+ Logger.WARNING("Failed to fetch mob spawner entity at (" + i1 + ", " + j1 + ", " + k1 + ")");
+ }
+ }
+
+ protected void setFurnace(int x, int y, int z, World world) {
+ int i1 = getXWithOffset(x, z);
+ int j1 = getYWithOffset(y);
+ int k1 = getZWithOffset(x, z);
+
+ world.setBlock(i1, j1, k1, Blocks.furnace, getMetadataWithOffset(Blocks.piston, 3), 2);
+ }
+
+ protected void placeAirBlockAtPos(int x, int y, int z, StructureBoundingBox bounds, World world) {
+ placeBlockAtCurrentPosition(world, Blocks.air, 0, x, y, z, bounds);
+ }
+
+ protected void place(Block block, int meta, int x, int y, int z, StructureBoundingBox bounds, World world) {
+ placeBlockAtCurrentPosition(world, block, meta, x, y, z, bounds);
+ }
+
+ protected StructureBoundingBox calcBox(
+ int direction, int x, int y, int z, int xLength, int height, int zLength, int xShift) {
+ int minX = 0;
+ int maxX = 0;
+ int minY = y;
+ int maxY = y + height;
+ int minZ = 0;
+ int maxZ = 0;
+ switch (direction) {
+ case 0:
+ minX = x - xShift;
+ maxX = x - xShift + xLength;
+ minZ = z;
+ maxZ = z + zLength;
+ break;
+ case 1:
+ minX = x - zLength;
+ maxX = x;
+ minZ = z - xShift;
+ maxZ = z - xShift + xLength;
+ break;
+ case 2:
+ minX = x - xShift;
+ maxX = x - xShift + xLength;
+ minZ = z - zLength;
+ maxZ = z;
+ break;
+ case 3:
+ minX = x;
+ maxX = x + zLength;
+ minZ = z - xShift;
+ maxZ = z - xShift + xLength;
+ }
+ return new StructureBoundingBox(minX, minY, minZ, maxX, maxY, maxZ);
+ }
+
+ protected int calcGroundHeight(World world, StructureBoundingBox boundingBox) {
+ int height = 0;
+ int count = 0;
+ for (int z = boundingBox.minZ; z <= boundingBox.maxZ; z++) {
+ for (int x = boundingBox.minX; x <= boundingBox.maxX; x++) {
+ if (boundingBox.isVecInside(x, 64, z)) {
+ height += Math.max(world.getTopSolidOrLiquidBlock(x, z), world.provider.getAverageGroundLevel());
+ count++;
+ }
+ }
+ }
+ if (count == 0) {
+ return -1;
+ }
+ return height / count;
+ }
+
+ protected void func_143012_a(NBTTagCompound nbttagcompound) {}
+
+ protected void func_143011_b(NBTTagCompound nbttagcompound) {}
+
+ public boolean addComponentParts(World world, Random random, StructureBoundingBox structureboundingbox) {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java b/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java
index 1f5dd59667..c43a201fd1 100644
--- a/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java
+++ b/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentHut.java
@@ -1,14 +1,12 @@
package gtPlusPlus.australia.gen.map.component;
-import java.util.Random;
-
import gtPlusPlus.api.interfaces.IGeneratorWorld;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.australia.GTplusplus_Australia;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.plugin.villagers.entity.EntityNativeAustralian;
+import java.util.Random;
import net.minecraft.block.Block;
-import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
@@ -19,456 +17,454 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.structure.StructureBoundingBox;
public class ComponentHut extends AustraliaComponent {
- public static final int DIM_X = 7;
- public static final int DIM_Y = 10;
- public static final int DIM_Z = 7;
-
- public ComponentHut() {
- }
-
- public ComponentHut(int direction, Random random, int x, int z) {
- super(direction, random, x, z, 7, 10, 7);
- }
-
- public boolean addComponentParts(World world, Random random) {
-
- BiomeGenBase biom = world.getBiomeGenForCoords(getXWithOffset(0, 0), getZWithOffset(0, 0));
- int groundAvg = calcGroundHeight(world, this.boundingBox);
- if (groundAvg < 0) {
- return true;
- }
- this.boundingBox.offset(0, groundAvg - this.boundingBox.maxY + 10 - 1, 0);
- if ((isWaterBelow(world, 0, -1, 0, this.boundingBox)) || (isWaterBelow(world, 0, -1, 6, this.boundingBox))
- || (isWaterBelow(world, 6, -1, 0, this.boundingBox))
- || (isWaterBelow(world, 6, -1, 6, this.boundingBox))) {
- return false;
- }
-
- Block aWall1, aWall2, aRoof, aFloor;
-
- if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) {
- aWall1 = Blocks.sand;
- aWall2 = Blocks.sandstone;
- aRoof = Blocks.sandstone;
- aFloor = Blocks.sandstone;
- }
- else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
- aWall1 = Blocks.clay;
- aWall2 = Blocks.hardened_clay;
- aRoof = Blocks.hardened_clay;
- aFloor = Blocks.stained_hardened_clay;
- }
- else {
- aWall1 = Blocks.sand;
- aWall2 = Blocks.sandstone;
- aRoof = Blocks.sandstone;
- aFloor = Blocks.sandstone;
- }
-
- //Empty Area
- fillWithAir(world, this.boundingBox, 0, 1, 0, 6, 9, 6);
-
- //Build Floor
- fillWithMetadataBlocks(world, this.boundingBox, 0, 0, 0, 6, 0, 6, aFloor, 0, aFloor, 1, false);
-
- //Layer 2
- int dir = MathUtils.randInt(0, 3);
-
- //Door First
- if (dir == 0) {
- placeDoorAtCurrentPosition(
- world, this.boundingBox, random, 0, 1, 3, getMetadataWithOffset(Blocks.wooden_door, 1));
- }
- else if (dir == 1) {
- placeDoorAtCurrentPosition(
- world, this.boundingBox, random, 3, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1));
- }
- else if (dir == 2) {
- placeDoorAtCurrentPosition(
- world, this.boundingBox, random, 6, 1, 3, getMetadataWithOffset(Blocks.wooden_door, 1));
- }
- else {
- placeDoorAtCurrentPosition(
- world, this.boundingBox, random, 3, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1));
- }
-
- //Layer 1
- //Wall Top
- place(aWall1, 0, 0, 1, 2, this.boundingBox, world);
- if (dir != 0) place(aWall1, 0, 0, 1, 3, this.boundingBox, world);
- place(aWall1, 0, 0, 1, 4, this.boundingBox, world);
- //Wall Right
- place(aWall1, 0, 2, 1, 6, this.boundingBox, world);
- if (dir != 1) place(aWall2, 0, 3, 1, 6, this.boundingBox, world);
- place(aWall1, 0, 4, 1, 6, this.boundingBox, world);
- //Wall Bottom
- place(aWall2, 0, 6, 1, 4, this.boundingBox, world);
- if (dir != 2) place(aWall1, 0, 6, 1, 3, this.boundingBox, world);
- place(aWall1, 0, 6, 1, 2, this.boundingBox, world);
- //Wall Left
- place(aWall1, 0, 4, 1, 0, this.boundingBox, world);
- if (dir != 3) place(aWall1, 0, 3, 1, 0, this.boundingBox, world);
- place(aWall2, 0, 2, 1, 0, this.boundingBox, world);
- //Corners
- place(aWall1, 0, 1, 1, 5, this.boundingBox, world);
- place(aWall2, 0, 5, 1, 5, this.boundingBox, world);
- place(aWall1, 0, 5, 1, 1, this.boundingBox, world);
- place(aWall1, 0, 1, 1, 1, this.boundingBox, world);
-
-
- //Wall Top
- place(aWall1, 0, 0, 2, 2, this.boundingBox, world);
- //place(aWall1, 0, 0, 2, 3, this.boundingBox, world);
- place(aWall2, 0, 0, 2, 4, this.boundingBox, world);
-
- //Wall Right
- place(aWall2, 0, 2, 2, 6, this.boundingBox, world);
- //place(aWall1, 0, 3, 2, 6, this.boundingBox, world);
- place(aWall1, 0, 4, 2, 6, this.boundingBox, world);
-
- //Wall Bottom
- place(aWall1, 0, 6, 2, 4, this.boundingBox, world);
- //place(aWall1, 0, 6, 2, 3, this.boundingBox, world);
- place(aWall2, 0, 6, 2, 2, this.boundingBox, world);
-
- //Wall Left
- place(aWall1, 0, 4, 2, 0, this.boundingBox, world);
- //place(aWall2, 0, 4, 2, 0, this.boundingBox, world);
- place(aWall1, 0, 2, 2, 0, this.boundingBox, world);
-
- //Corners
- place(aWall1, 0, 1, 2, 5, this.boundingBox, world);
- place(aWall1, 0, 5, 2, 5, this.boundingBox, world);
- place(aWall2, 0, 5, 2, 1, this.boundingBox, world);
- place(aWall2, 0, 1, 2, 1, this.boundingBox, world);
-
- //Layer 3
- //Wall Top
- place(aWall2, 0, 0, 3, 2, this.boundingBox, world);
- place(aWall1, 0, 0, 3, 3, this.boundingBox, world);
- place(aWall1, 0, 0, 3, 4, this.boundingBox, world);
- //Wall Right
- place(aWall1, 0, 2, 3, 6, this.boundingBox, world);
- place(aWall1, 0, 3, 3, 6, this.boundingBox, world);
- place(aWall1, 0, 4, 3, 6, this.boundingBox, world);
- //Wall Bottom
- place(aWall1, 0, 6, 3, 4, this.boundingBox, world);
- place(aWall2, 0, 6, 3, 3, this.boundingBox, world);
- place(aWall1, 0, 6, 3, 2, this.boundingBox, world);
- //Wall Left
- place(aWall1, 0, 4, 3, 0, this.boundingBox, world);
- place(aWall2, 0, 3, 3, 0, this.boundingBox, world);
- place(aWall1, 0, 2, 3, 0, this.boundingBox, world);
- //Corners
- place(aWall1, 0, 1, 3, 5, this.boundingBox, world);
- place(aWall2, 0, 5, 3, 5, this.boundingBox, world);
- place(aWall1, 0, 5, 3, 1, this.boundingBox, world);
- place(aWall1, 0, 1, 3, 1, this.boundingBox, world);
-
- //Roof
- //Roof 1 Top
- place(aRoof, 0, 1, 4, 2, this.boundingBox, world);
- place(aRoof, 0, 1, 4, 3, this.boundingBox, world);
- place(aRoof, 0, 1, 4, 4, this.boundingBox, world);
- //Roof 1 Right
- place(aRoof, 0, 2, 4, 5, this.boundingBox, world);
- place(aRoof, 0, 3, 4, 5, this.boundingBox, world);
- place(aRoof, 0, 4, 4, 5, this.boundingBox, world);
- //Roof 1 Bottom
- place(aRoof, 0, 5, 4, 4, this.boundingBox, world);
- place(aRoof, 0, 5, 4, 3, this.boundingBox, world);
- place(aRoof, 0, 5, 4, 2, this.boundingBox, world);
- //Roof 1 Left
- place(aRoof, 0, 4, 4, 1, this.boundingBox, world);
- place(aRoof, 0, 3, 4, 1, this.boundingBox, world);
- place(aRoof, 0, 2, 4, 1, this.boundingBox, world);
-
- //Roof 2 Top
- place(aRoof, 0, 2, 5, 2, this.boundingBox, world);
- place(aRoof, 0, 2, 5, 3, this.boundingBox, world);
- place(aRoof, 0, 2, 5, 4, this.boundingBox, world);
-
- //Roof 2 Right
- //place(aWall1, 0, 2, 5, 4, this.boundingBox, world);
- place(aRoof, 0, 3, 5, 4, this.boundingBox, world);
- //place(aWall1, 0, 4, 5, 4, this.boundingBox, world);
-
- //Roof 2 Bottom
- place(aRoof, 0, 4, 5, 4, this.boundingBox, world);
- place(aRoof, 0, 4, 5, 3, this.boundingBox, world);
- place(aRoof, 0, 4, 5, 2, this.boundingBox, world);
-
- //Roof 2 Left
- //place(aWall1, 0, 4, 5, 2, this.boundingBox, world);
- place(aRoof, 0, 3, 5, 2, this.boundingBox, world);
- //place(aWall1, 0, 2, 5, 2, this.boundingBox, world);
-
- //Roof 3 Top
- place(Blocks.glowstone, 0, 3, 5, 3, this.boundingBox, world);
- /*
- int logID = MathUtils.randInt(0, 1);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 1, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 1, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 1, this.boundingBox, world);
-
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 5, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 5, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 5, this.boundingBox, world);
-
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 1, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 1, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 1, this.boundingBox, world);
-
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 5, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 5, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 5, this.boundingBox, world);
-
- int meta = (this.coordBaseMode == 3) || (this.coordBaseMode == 1) ? 4 : 8;
-
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 2, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 3, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 4, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 2, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 3, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 4, this.boundingBox, world);
-
- for (int x = -2; x < 9; x++) {
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 0, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 1, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 2, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 3, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 4, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 5, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 6, this.boundingBox, world);
- }
-
- int glassMeta = Math.min(16, (coordBaseMode+MathUtils.randInt(0, 8)));
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 2, 2, 1, this.boundingBox, world);
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 2, 2, 5, this.boundingBox, world);
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 4, 2, 5, this.boundingBox, world);
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 0, 2, 3, this.boundingBox, world);
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 6, 2, 3, this.boundingBox, world);
-
- placeDoorAtCurrentPosition(world, this.boundingBox, random, 4, 1, 1,
- getMetadataWithOffset(Blocks.wooden_door, 1));
-
- place(Blocks.leaves, MathUtils.randInt(0, 3), 1, 1, 4, this.boundingBox, world);
- place(Blocks.torch, 0, 1, 2, 3, this.boundingBox, world);
- place(Blocks.torch, 0, 3, 2, 2, this.boundingBox, world);
- if (!this.hasMadeChest) {
- int ic = getYWithOffset(0);
- int jc = getXWithOffset(7, 1);
- int kc = getZWithOffset(7, 1);
- if (this.boundingBox.isVecInside(jc, ic, kc)) {
- this.hasMadeChest = true;
- generateStructureChestContents(world, this.boundingBox, random, 1, 1, 2, shackChestContents,
- 1 + random.nextInt(3));
- }
- }*/
- for (int i = 0; i < 7; i++) {
- for (int j = 0; j < 7; j++) {
- clearCurrentPositionBlocksUpwards(world, j, 6, i, this.boundingBox);
- func_151554_b(world, aFloor, 0, j, 0, i, this.boundingBox);
- }
- }
- spawnNatives(world, this.boundingBox, 4, 1, 3, MathUtils.randInt(3, 5));
-
- return true;
-
- /*
- BiomeGenBase biom = world.getBiomeGenForCoords(getXWithOffset(0, 0), getZWithOffset(0, 0));
- int groundAvg = calcGroundHeight(world, this.boundingBox);
- if (groundAvg < 0) {
- return true;
- }
- this.boundingBox.offset(0, groundAvg - this.boundingBox.maxY + 10 - 1, 0);
- if ((isWaterBelow(world, 0, -1, 0, this.boundingBox)) || (isWaterBelow(world, 0, -1, 6, this.boundingBox))
- || (isWaterBelow(world, 6, -1, 0, this.boundingBox))
- || (isWaterBelow(world, 6, -1, 6, this.boundingBox))) {
- return false;
- }
- Block groundID = Blocks.grass;
- Block undergroundID = Blocks.dirt;
- if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) {
- groundID = Blocks.sand;
- undergroundID = Blocks.sand;
- }
- else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
- groundID = Blocks.hardened_clay;
- undergroundID = Blocks.stained_hardened_clay;
- }
-
-
- fillWithAir(world, this.boundingBox, 0, 1, 0, 6, 9, 6);
- fillWithMetadataBlocks(world, this.boundingBox, 0, 0, 1, 6, 1, 5, Blocks.dirt, 0, Blocks.dirt, 1, false);
- fillWithMetadataBlocks(world, this.boundingBox, 0, 2, 1, 6, 3, 5, Blocks.cobblestone, 0, Blocks.cobblestone, 0, false);
- fillWithAir(world, this.boundingBox, 1, 1, 2, 5, 3, 4);
-
- int logID = MathUtils.randInt(0, 1);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 1, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 1, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 1, this.boundingBox, world);
-
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 5, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 5, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 5, this.boundingBox, world);
-
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 1, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 1, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 1, this.boundingBox, world);
-
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 5, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 5, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 5, this.boundingBox, world);
-
- int meta = (this.coordBaseMode == 3) || (this.coordBaseMode == 1) ? 4 : 8;
-
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 2, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 3, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 4, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 2, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 3, this.boundingBox, world);
- place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 4, this.boundingBox, world);
-
- for (int x = -2; x < 9; x++) {
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 0, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 1, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 2, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 3, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 4, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 5, this.boundingBox, world);
- place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 6, this.boundingBox, world);
- }
-
- int glassMeta = Math.min(16, (coordBaseMode+MathUtils.randInt(0, 8)));
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 2, 2, 1, this.boundingBox, world);
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 2, 2, 5, this.boundingBox, world);
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 4, 2, 5, this.boundingBox, world);
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 0, 2, 3, this.boundingBox, world);
- if (MathUtils.randInt(0, 5) > 4)
- place(Blocks.stained_glass, glassMeta, 6, 2, 3, this.boundingBox, world);
-
- placeDoorAtCurrentPosition(world, this.boundingBox, random, 4, 1, 1,
- getMetadataWithOffset(Blocks.wooden_door, 1));
-
- place(Blocks.leaves, MathUtils.randInt(0, 3), 1, 1, 4, this.boundingBox, world);
- place(Blocks.torch, 0, 1, 2, 3, this.boundingBox, world);
- place(Blocks.torch, 0, 3, 2, 2, this.boundingBox, world);
- if (!this.hasMadeChest) {
- int ic = getYWithOffset(0);
- int jc = getXWithOffset(7, 1);
- int kc = getZWithOffset(7, 1);
- if (this.boundingBox.isVecInside(jc, ic, kc)) {
- this.hasMadeChest = true;
- generateStructureChestContents(world, this.boundingBox, random, 1, 1, 2, shackChestContents,
- 1 + random.nextInt(3));
- }
- }
- for (int i = 0; i < 7; i++) {
- for (int j = 0; j < 7; j++) {
- clearCurrentPositionBlocksUpwards(world, j, 6, i, this.boundingBox);
- func_151554_b(world, undergroundID, 0, j, 0, i, this.boundingBox);
- }
- }
- spawnNatives(world, this.boundingBox, 4, 1, 3, MathUtils.randInt(3, 5));
-
- return true;
- */}
-
- private int nativesSpawned = 0;
-
- private void spawnNatives(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4,
- int par5, int maxSpawned) {
- if (this.nativesSpawned < maxSpawned) {
- for (int i1 = this.nativesSpawned; i1 < maxSpawned; i1++) {
- int j1 = getXWithOffset(par3 + i1, par5);
- int k1 = getYWithOffset(par4);
- int l1 = getZWithOffset(par3 + i1, par5);
- if (!par2StructureBoundingBox.isVecInside(j1, k1, l1)) {
- break;
- }
- if (par1World.rand.nextInt(MathUtils.randInt(3, 5)) != 0) {
- EntityNativeAustralian entityvillager = new EntityNativeAustralian(par1World);
- entityvillager.func_110163_bv();
- entityvillager.setLocationAndAngles(j1 + 0.5D, k1, l1 + 0.5D, 0.0F, 0.0F);
- par1World.spawnEntityInWorld(entityvillager);
- this.nativesSpawned += 1;
- }
- }
- }
- }
-
- public static final WeightedRandomChestContent[] shackChestContents = {
- new WeightedRandomChestContent(Items.glass_bottle, 0, 1, 1, 10),
- new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15),
- new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15),
- new WeightedRandomChestContent(Items.cooked_fished, 0, 1, 3, 10),
- new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 1, 1, 1, 15),
- // new WeightedRandomChestContent(Witchery.Items.GENERIC,
- // Witchery.Items.GENERIC.itemRowanBerries.damageValue, 1, 2, 10),
- new WeightedRandomChestContent(Items.iron_shovel, 0, 1, 1, 5),
- new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5) };
- private boolean hasMadeChest;
- private static final String CHEST_KEY = "AUSShackChest";
-
- protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {
- super.func_143012_a(par1NBTTagCompound);
- par1NBTTagCompound.setBoolean("AUSShackChest", this.hasMadeChest);
- par1NBTTagCompound.setInteger("AUSWCount", this.nativesSpawned);
- }
-
- protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {
- super.func_143011_b(par1NBTTagCompound);
- this.hasMadeChest = par1NBTTagCompound.getBoolean("AUSShackChest");
- if (par1NBTTagCompound.hasKey("AUSWCount")) {
- this.nativesSpawned = par1NBTTagCompound.getInteger("AUSWCount");
- } else {
- this.nativesSpawned = 0;
- }
- }
-
- public static class WorldHandlerHut implements IGeneratorWorld {
- private final double chance;
- private final int range;
-
- public WorldHandlerHut(double chance) {
- this.chance = chance;
- this.range = 400;
- }
-
- public int getExtentX() {
- return 7;
- }
-
- public int getExtentZ() {
- return 7;
- }
-
- public int getRange() {
- return this.range;
- }
-
- public boolean generate(World world, Random random, int x, int z) {
- if ((MathUtils.randInt(0, 100) < (this.chance/5))) {
- int direction = MathUtils.randInt(0, 3);
- new ComponentHut(direction, random, x, z).addComponentParts(world, random);
- Logger.WORLD("NativeHut x: " + x + " | z: " + z + " | Dir: " + direction);
- return true;
- }
- return false;
- }
-
- public void initiate() {
- }
- }
-
+ public static final int DIM_X = 7;
+ public static final int DIM_Y = 10;
+ public static final int DIM_Z = 7;
+
+ public ComponentHut() {}
+
+ public ComponentHut(int direction, Random random, int x, int z) {
+ super(direction, random, x, z, 7, 10, 7);
+ }
+
+ public boolean addComponentParts(World world, Random random) {
+
+ BiomeGenBase biom = world.getBiomeGenForCoords(getXWithOffset(0, 0), getZWithOffset(0, 0));
+ int groundAvg = calcGroundHeight(world, this.boundingBox);
+ if (groundAvg < 0) {
+ return true;
+ }
+ this.boundingBox.offset(0, groundAvg - this.boundingBox.maxY + 10 - 1, 0);
+ if ((isWaterBelow(world, 0, -1, 0, this.boundingBox))
+ || (isWaterBelow(world, 0, -1, 6, this.boundingBox))
+ || (isWaterBelow(world, 6, -1, 0, this.boundingBox))
+ || (isWaterBelow(world, 6, -1, 6, this.boundingBox))) {
+ return false;
+ }
+
+ Block aWall1, aWall2, aRoof, aFloor;
+
+ if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) {
+ aWall1 = Blocks.sand;
+ aWall2 = Blocks.sandstone;
+ aRoof = Blocks.sandstone;
+ aFloor = Blocks.sandstone;
+ } else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
+ aWall1 = Blocks.clay;
+ aWall2 = Blocks.hardened_clay;
+ aRoof = Blocks.hardened_clay;
+ aFloor = Blocks.stained_hardened_clay;
+ } else {
+ aWall1 = Blocks.sand;
+ aWall2 = Blocks.sandstone;
+ aRoof = Blocks.sandstone;
+ aFloor = Blocks.sandstone;
+ }
+
+ // Empty Area
+ fillWithAir(world, this.boundingBox, 0, 1, 0, 6, 9, 6);
+
+ // Build Floor
+ fillWithMetadataBlocks(world, this.boundingBox, 0, 0, 0, 6, 0, 6, aFloor, 0, aFloor, 1, false);
+
+ // Layer 2
+ int dir = MathUtils.randInt(0, 3);
+
+ // Door First
+ if (dir == 0) {
+ placeDoorAtCurrentPosition(
+ world, this.boundingBox, random, 0, 1, 3, getMetadataWithOffset(Blocks.wooden_door, 1));
+ } else if (dir == 1) {
+ placeDoorAtCurrentPosition(
+ world, this.boundingBox, random, 3, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1));
+ } else if (dir == 2) {
+ placeDoorAtCurrentPosition(
+ world, this.boundingBox, random, 6, 1, 3, getMetadataWithOffset(Blocks.wooden_door, 1));
+ } else {
+ placeDoorAtCurrentPosition(
+ world, this.boundingBox, random, 3, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1));
+ }
+
+ // Layer 1
+ // Wall Top
+ place(aWall1, 0, 0, 1, 2, this.boundingBox, world);
+ if (dir != 0) place(aWall1, 0, 0, 1, 3, this.boundingBox, world);
+ place(aWall1, 0, 0, 1, 4, this.boundingBox, world);
+ // Wall Right
+ place(aWall1, 0, 2, 1, 6, this.boundingBox, world);
+ if (dir != 1) place(aWall2, 0, 3, 1, 6, this.boundingBox, world);
+ place(aWall1, 0, 4, 1, 6, this.boundingBox, world);
+ // Wall Bottom
+ place(aWall2, 0, 6, 1, 4, this.boundingBox, world);
+ if (dir != 2) place(aWall1, 0, 6, 1, 3, this.boundingBox, world);
+ place(aWall1, 0, 6, 1, 2, this.boundingBox, world);
+ // Wall Left
+ place(aWall1, 0, 4, 1, 0, this.boundingBox, world);
+ if (dir != 3) place(aWall1, 0, 3, 1, 0, this.boundingBox, world);
+ place(aWall2, 0, 2, 1, 0, this.boundingBox, world);
+ // Corners
+ place(aWall1, 0, 1, 1, 5, this.boundingBox, world);
+ place(aWall2, 0, 5, 1, 5, this.boundingBox, world);
+ place(aWall1, 0, 5, 1, 1, this.boundingBox, world);
+ place(aWall1, 0, 1, 1, 1, this.boundingBox, world);
+
+ // Wall Top
+ place(aWall1, 0, 0, 2, 2, this.boundingBox, world);
+ // place(aWall1, 0, 0, 2, 3, this.boundingBox, world);
+ place(aWall2, 0, 0, 2, 4, this.boundingBox, world);
+
+ // Wall Right
+ place(aWall2, 0, 2, 2, 6, this.boundingBox, world);
+ // place(aWall1, 0, 3, 2, 6, this.boundingBox, world);
+ place(aWall1, 0, 4, 2, 6, this.boundingBox, world);
+
+ // Wall Bottom
+ place(aWall1, 0, 6, 2, 4, this.boundingBox, world);
+ // place(aWall1, 0, 6, 2, 3, this.boundingBox, world);
+ place(aWall2, 0, 6, 2, 2, this.boundingBox, world);
+
+ // Wall Left
+ place(aWall1, 0, 4, 2, 0, this.boundingBox, world);
+ // place(aWall2, 0, 4, 2, 0, this.boundingBox, world);
+ place(aWall1, 0, 2, 2, 0, this.boundingBox, world);
+
+ // Corners
+ place(aWall1, 0, 1, 2, 5, this.boundingBox, world);
+ place(aWall1, 0, 5, 2, 5, this.boundingBox, world);
+ place(aWall2, 0, 5, 2, 1, this.boundingBox, world);
+ place(aWall2, 0, 1, 2, 1, this.boundingBox, world);
+
+ // Layer 3
+ // Wall Top
+ place(aWall2, 0, 0, 3, 2, this.boundingBox, world);
+ place(aWall1, 0, 0, 3, 3, this.boundingBox, world);
+ place(aWall1, 0, 0, 3, 4, this.boundingBox, world);
+ // Wall Right
+ place(aWall1, 0, 2, 3, 6, this.boundingBox, world);
+ place(aWall1, 0, 3, 3, 6, this.boundingBox, world);
+ place(aWall1, 0, 4, 3, 6, this.boundingBox, world);
+ // Wall Bottom
+ place(aWall1, 0, 6, 3, 4, this.boundingBox, world);
+ place(aWall2, 0, 6, 3, 3, this.boundingBox, world);
+ place(aWall1, 0, 6, 3, 2, this.boundingBox, world);
+ // Wall Left
+ place(aWall1, 0, 4, 3, 0, this.boundingBox, world);
+ place(aWall2, 0, 3, 3, 0, this.boundingBox, world);
+ place(aWall1, 0, 2, 3, 0, this.boundingBox, world);
+ // Corners
+ place(aWall1, 0, 1, 3, 5, this.boundingBox, world);
+ place(aWall2, 0, 5, 3, 5, this.boundingBox, world);
+ place(aWall1, 0, 5, 3, 1, this.boundingBox, world);
+ place(aWall1, 0, 1, 3, 1, this.boundingBox, world);
+
+ // Roof
+ // Roof 1 Top
+ place(aRoof, 0, 1, 4, 2, this.boundingBox, world);
+ place(aRoof, 0, 1, 4, 3, this.boundingBox, world);
+ place(aRoof, 0, 1, 4, 4, this.boundingBox, world);
+ // Roof 1 Right
+ place(aRoof, 0, 2, 4, 5, this.boundingBox, world);
+ place(aRoof, 0, 3, 4, 5, this.boundingBox, world);
+ place(aRoof, 0, 4, 4, 5, this.boundingBox, world);
+ // Roof 1 Bottom
+ place(aRoof, 0, 5, 4, 4, this.boundingBox, world);
+ place(aRoof, 0, 5, 4, 3, this.boundingBox, world);
+ place(aRoof, 0, 5, 4, 2, this.boundingBox, world);
+ // Roof 1 Left
+ place(aRoof, 0, 4, 4, 1, this.boundingBox, world);
+ place(aRoof, 0, 3, 4, 1, this.boundingBox, world);
+ place(aRoof, 0, 2, 4, 1, this.boundingBox, world);
+
+ // Roof 2 Top
+ place(aRoof, 0, 2, 5, 2, this.boundingBox, world);
+ place(aRoof, 0, 2, 5, 3, this.boundingBox, world);
+ place(aRoof, 0, 2, 5, 4, this.boundingBox, world);
+
+ // Roof 2 Right
+ // place(aWall1, 0, 2, 5, 4, this.boundingBox, world);
+ place(aRoof, 0, 3, 5, 4, this.boundingBox, world);
+ // place(aWall1, 0, 4, 5, 4, this.boundingBox, world);
+
+ // Roof 2 Bottom
+ place(aRoof, 0, 4, 5, 4, this.boundingBox, world);
+ place(aRoof, 0, 4, 5, 3, this.boundingBox, world);
+ place(aRoof, 0, 4, 5, 2, this.boundingBox, world);
+
+ // Roof 2 Left
+ // place(aWall1, 0, 4, 5, 2, this.boundingBox, world);
+ place(aRoof, 0, 3, 5, 2, this.boundingBox, world);
+ // place(aWall1, 0, 2, 5, 2, this.boundingBox, world);
+
+ // Roof 3 Top
+ place(Blocks.glowstone, 0, 3, 5, 3, this.boundingBox, world);
+ /*
+ int logID = MathUtils.randInt(0, 1);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 1, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 1, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 1, this.boundingBox, world);
+
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 5, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 5, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 5, this.boundingBox, world);
+
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 1, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 1, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 1, this.boundingBox, world);
+
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 5, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 5, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 5, this.boundingBox, world);
+
+ int meta = (this.coordBaseMode == 3) || (this.coordBaseMode == 1) ? 4 : 8;
+
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 2, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 3, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 4, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 2, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 3, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 4, this.boundingBox, world);
+
+ for (int x = -2; x < 9; x++) {
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 0, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 1, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 2, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 3, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 4, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 5, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 6, this.boundingBox, world);
+ }
+
+ int glassMeta = Math.min(16, (coordBaseMode+MathUtils.randInt(0, 8)));
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 2, 2, 1, this.boundingBox, world);
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 2, 2, 5, this.boundingBox, world);
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 4, 2, 5, this.boundingBox, world);
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 0, 2, 3, this.boundingBox, world);
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 6, 2, 3, this.boundingBox, world);
+
+ placeDoorAtCurrentPosition(world, this.boundingBox, random, 4, 1, 1,
+ getMetadataWithOffset(Blocks.wooden_door, 1));
+
+ place(Blocks.leaves, MathUtils.randInt(0, 3), 1, 1, 4, this.boundingBox, world);
+ place(Blocks.torch, 0, 1, 2, 3, this.boundingBox, world);
+ place(Blocks.torch, 0, 3, 2, 2, this.boundingBox, world);
+ if (!this.hasMadeChest) {
+ int ic = getYWithOffset(0);
+ int jc = getXWithOffset(7, 1);
+ int kc = getZWithOffset(7, 1);
+ if (this.boundingBox.isVecInside(jc, ic, kc)) {
+ this.hasMadeChest = true;
+ generateStructureChestContents(world, this.boundingBox, random, 1, 1, 2, shackChestContents,
+ 1 + random.nextInt(3));
+ }
+ }*/
+ for (int i = 0; i < 7; i++) {
+ for (int j = 0; j < 7; j++) {
+ clearCurrentPositionBlocksUpwards(world, j, 6, i, this.boundingBox);
+ func_151554_b(world, aFloor, 0, j, 0, i, this.boundingBox);
+ }
+ }
+ spawnNatives(world, this.boundingBox, 4, 1, 3, MathUtils.randInt(3, 5));
+
+ return true;
+
+ /*
+ BiomeGenBase biom = world.getBiomeGenForCoords(getXWithOffset(0, 0), getZWithOffset(0, 0));
+ int groundAvg = calcGroundHeight(world, this.boundingBox);
+ if (groundAvg < 0) {
+ return true;
+ }
+ this.boundingBox.offset(0, groundAvg - this.boundingBox.maxY + 10 - 1, 0);
+ if ((isWaterBelow(world, 0, -1, 0, this.boundingBox)) || (isWaterBelow(world, 0, -1, 6, this.boundingBox))
+ || (isWaterBelow(world, 6, -1, 0, this.boundingBox))
+ || (isWaterBelow(world, 6, -1, 6, this.boundingBox))) {
+ return false;
+ }
+ Block groundID = Blocks.grass;
+ Block undergroundID = Blocks.dirt;
+ if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) {
+ groundID = Blocks.sand;
+ undergroundID = Blocks.sand;
+ }
+ else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
+ groundID = Blocks.hardened_clay;
+ undergroundID = Blocks.stained_hardened_clay;
+ }
+
+
+ fillWithAir(world, this.boundingBox, 0, 1, 0, 6, 9, 6);
+ fillWithMetadataBlocks(world, this.boundingBox, 0, 0, 1, 6, 1, 5, Blocks.dirt, 0, Blocks.dirt, 1, false);
+ fillWithMetadataBlocks(world, this.boundingBox, 0, 2, 1, 6, 3, 5, Blocks.cobblestone, 0, Blocks.cobblestone, 0, false);
+ fillWithAir(world, this.boundingBox, 1, 1, 2, 5, 3, 4);
+
+ int logID = MathUtils.randInt(0, 1);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 1, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 1, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 1, this.boundingBox, world);
+
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 1, 5, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 2, 5, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 3, 5, this.boundingBox, world);
+
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 1, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 1, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 1, this.boundingBox, world);
+
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 1, 5, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 2, 5, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 3, 5, this.boundingBox, world);
+
+ int meta = (this.coordBaseMode == 3) || (this.coordBaseMode == 1) ? 4 : 8;
+
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 2, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 3, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 0, 4, 4, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 2, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 3, this.boundingBox, world);
+ place(Blocks.dirt, MathUtils.randInt(0, 1), 6, 4, 4, this.boundingBox, world);
+
+ for (int x = -2; x < 9; x++) {
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 0, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 1, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 2, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 3, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 5, 4, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 4, 5, this.boundingBox, world);
+ place(Blocks.leaves, MathUtils.randInt(0, 3), x, 3, 6, this.boundingBox, world);
+ }
+
+ int glassMeta = Math.min(16, (coordBaseMode+MathUtils.randInt(0, 8)));
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 2, 2, 1, this.boundingBox, world);
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 2, 2, 5, this.boundingBox, world);
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 4, 2, 5, this.boundingBox, world);
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 0, 2, 3, this.boundingBox, world);
+ if (MathUtils.randInt(0, 5) > 4)
+ place(Blocks.stained_glass, glassMeta, 6, 2, 3, this.boundingBox, world);
+
+ placeDoorAtCurrentPosition(world, this.boundingBox, random, 4, 1, 1,
+ getMetadataWithOffset(Blocks.wooden_door, 1));
+
+ place(Blocks.leaves, MathUtils.randInt(0, 3), 1, 1, 4, this.boundingBox, world);
+ place(Blocks.torch, 0, 1, 2, 3, this.boundingBox, world);
+ place(Blocks.torch, 0, 3, 2, 2, this.boundingBox, world);
+ if (!this.hasMadeChest) {
+ int ic = getYWithOffset(0);
+ int jc = getXWithOffset(7, 1);
+ int kc = getZWithOffset(7, 1);
+ if (this.boundingBox.isVecInside(jc, ic, kc)) {
+ this.hasMadeChest = true;
+ generateStructureChestContents(world, this.boundingBox, random, 1, 1, 2, shackChestContents,
+ 1 + random.nextInt(3));
+ }
+ }
+ for (int i = 0; i < 7; i++) {
+ for (int j = 0; j < 7; j++) {
+ clearCurrentPositionBlocksUpwards(world, j, 6, i, this.boundingBox);
+ func_151554_b(world, undergroundID, 0, j, 0, i, this.boundingBox);
+ }
+ }
+ spawnNatives(world, this.boundingBox, 4, 1, 3, MathUtils.randInt(3, 5));
+
+ return true;
+ */ }
+
+ private int nativesSpawned = 0;
+
+ private void spawnNatives(
+ World par1World,
+ StructureBoundingBox par2StructureBoundingBox,
+ int par3,
+ int par4,
+ int par5,
+ int maxSpawned) {
+ if (this.nativesSpawned < maxSpawned) {
+ for (int i1 = this.nativesSpawned; i1 < maxSpawned; i1++) {
+ int j1 = getXWithOffset(par3 + i1, par5);
+ int k1 = getYWithOffset(par4);
+ int l1 = getZWithOffset(par3 + i1, par5);
+ if (!par2StructureBoundingBox.isVecInside(j1, k1, l1)) {
+ break;
+ }
+ if (par1World.rand.nextInt(MathUtils.randInt(3, 5)) != 0) {
+ EntityNativeAustralian entityvillager = new EntityNativeAustralian(par1World);
+ entityvillager.func_110163_bv();
+ entityvillager.setLocationAndAngles(j1 + 0.5D, k1, l1 + 0.5D, 0.0F, 0.0F);
+ par1World.spawnEntityInWorld(entityvillager);
+ this.nativesSpawned += 1;
+ }
+ }
+ }
+ }
+
+ public static final WeightedRandomChestContent[] shackChestContents = {
+ new WeightedRandomChestContent(Items.glass_bottle, 0, 1, 1, 10),
+ new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15),
+ new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15),
+ new WeightedRandomChestContent(Items.cooked_fished, 0, 1, 3, 10),
+ new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 1, 1, 1, 15),
+ // new WeightedRandomChestContent(Witchery.Items.GENERIC,
+ // Witchery.Items.GENERIC.itemRowanBerries.damageValue, 1, 2, 10),
+ new WeightedRandomChestContent(Items.iron_shovel, 0, 1, 1, 5),
+ new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5)
+ };
+ private boolean hasMadeChest;
+ private static final String CHEST_KEY = "AUSShackChest";
+
+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {
+ super.func_143012_a(par1NBTTagCompound);
+ par1NBTTagCompound.setBoolean("AUSShackChest", this.hasMadeChest);
+ par1NBTTagCompound.setInteger("AUSWCount", this.nativesSpawned);
+ }
+
+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {
+ super.func_143011_b(par1NBTTagCompound);
+ this.hasMadeChest = par1NBTTagCompound.getBoolean("AUSShackChest");
+ if (par1NBTTagCompound.hasKey("AUSWCount")) {
+ this.nativesSpawned = par1NBTTagCompound.getInteger("AUSWCount");
+ } else {
+ this.nativesSpawned = 0;
+ }
+ }
+
+ public static class WorldHandlerHut implements IGeneratorWorld {
+ private final double chance;
+ private final int range;
+
+ public WorldHandlerHut(double chance) {
+ this.chance = chance;
+ this.range = 400;
+ }
+
+ public int getExtentX() {
+ return 7;
+ }
+
+ public int getExtentZ() {
+ return 7;
+ }
+
+ public int getRange() {
+ return this.range;
+ }
+
+ public boolean generate(World world, Random random, int x, int z) {
+ if ((MathUtils.randInt(0, 100) < (this.chance / 5))) {
+ int direction = MathUtils.randInt(0, 3);
+ new ComponentHut(direction, random, x, z).addComponentParts(world, random);
+ Logger.WORLD("NativeHut x: " + x + " | z: " + z + " | Dir: " + direction);
+ return true;
+ }
+ return false;
+ }
+
+ public void initiate() {}
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentShack.java b/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentShack.java
index e3f501468b..acf222f655 100644
--- a/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentShack.java
+++ b/src/main/java/gtPlusPlus/australia/gen/map/component/ComponentShack.java
@@ -1,7 +1,5 @@
package gtPlusPlus.australia.gen.map.component;
-import java.util.Random;
-
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gtPlusPlus.api.interfaces.IGeneratorWorld;
@@ -10,6 +8,7 @@ import gtPlusPlus.australia.GTplusplus_Australia;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Blocks;
@@ -20,260 +19,325 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.structure.StructureBoundingBox;
public class ComponentShack extends AustraliaComponent {
- public static final int DIM_X = 9;
- public static final int DIM_Y = 10;
- public static final int DIM_Z = 9;
-
- public ComponentShack() {
- }
-
- public ComponentShack(int direction, Random random, int x, int z) {
- super(direction, random, x, z, DIM_X, DIM_Y, DIM_Z);
- }
-
- public boolean addComponentParts(World world, Random random) {
- BiomeGenBase biom = world.getBiomeGenForCoords(getXWithOffset(0, 0), getZWithOffset(0, 0));
- int groundAvg = calcGroundHeight(world, this.boundingBox);
- if (groundAvg < 0) {
- return true;
- }
- this.boundingBox.offset(0, groundAvg - this.boundingBox.maxY + 10 - 1, 0);
- if ((isWaterBelow(world, 0, -1, 0, this.boundingBox)) || (isWaterBelow(world, 0, -1, 6, this.boundingBox))
- || (isWaterBelow(world, 6, -1, 0, this.boundingBox))
- || (isWaterBelow(world, 6, -1, 6, this.boundingBox))) {
- return false;
- }
- Block mStone;
- Block groundID = Blocks.grass;
- Block undergroundID = Blocks.dirt;
- if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) {
- groundID = Blocks.sand;
- undergroundID = Blocks.sand;
- mStone = Blocks.sandstone;
- }
- else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
- groundID = Blocks.hardened_clay;
- undergroundID = Blocks.stained_hardened_clay;
- mStone = Blocks.stained_hardened_clay;
- }
- else {
- mStone = Blocks.stonebrick;
- }
-
- int mWoodType = MathUtils.randInt(0, 5);
- int logID;
- Block mWoodenStairs;
- Block mLog;
- if (mWoodType == 1) {
- mWoodenStairs = Blocks.spruce_stairs;
- logID = 1;
- }
- else if (mWoodType == 2) {
- mWoodenStairs = Blocks.birch_stairs;
- logID = 2;
-
- }
- else if (mWoodType == 3) {
- mWoodenStairs = Blocks.jungle_stairs;
- logID = 3;
- }
- else if (mWoodType == 4) {
- mWoodenStairs = Blocks.acacia_stairs;
- logID = 0;
- }
- else if (mWoodType == 5) {
- mWoodenStairs = Blocks.dark_oak_stairs;
- logID = 1;
- }
- else {
- mWoodenStairs = Blocks.oak_stairs;
- logID = 0;
- }
- if (mWoodType >= 4) {
- mLog = Blocks.log2;
- }
- else {
- mLog = Blocks.log;
- }
-
- int mStoneMeta = MathUtils.randInt(0, mStone == Blocks.stained_hardened_clay ? 15 : mStone == Blocks.sandstone ? 2 : 3);
-
- fillWithAir(world, this.boundingBox, 0, 1, 0, 7, 7, 4);
- fillWithMetadataBlocks(world, this.boundingBox, 1, 0, 1, 7, 1, 5, mStone, mStoneMeta, mStone, mStoneMeta, false);
- fillWithMetadataBlocks(world, this.boundingBox, 1, 2, 1, 7, 3, 5, Blocks.planks, mWoodType, Blocks.planks, mWoodType, false);
- fillWithAir(world, this.boundingBox, 2, 1, 2, 6, 3, 4);
-
- place(mLog, logID, 1, 1, 1, this.boundingBox, world);
- place(mLog, logID, 1, 2, 1, this.boundingBox, world);
- place(mLog, logID, 1, 3, 1, this.boundingBox, world);
-
- place(mLog, logID, 1, 1, 5, this.boundingBox, world);
- place(mLog, logID, 1, 2, 5, this.boundingBox, world);
- place(mLog, logID, 1, 3, 5, this.boundingBox, world);
-
- place(mLog, logID, 7, 1, 1, this.boundingBox, world);
- place(mLog, logID, 7, 2, 1, this.boundingBox, world);
- place(mLog, logID, 7, 3, 1, this.boundingBox, world);
-
- place(mLog, logID, 7, 1, 5, this.boundingBox, world);
- place(mLog, logID, 7, 2, 5, this.boundingBox, world);
- place(mLog, logID, 7, 3, 5, this.boundingBox, world);
-
- int meta = (this.coordBaseMode == 3) || (this.coordBaseMode == 1) ? 4 : 8;
-
- place(mLog, logID, 1, 4, 2, this.boundingBox, world);
- place(mLog, logID, 1, 4, 3, this.boundingBox, world);
- place(mLog, logID, 1, 4, 4, this.boundingBox, world);
- place(mLog, logID, 7, 4, 2, this.boundingBox, world);
- place(mLog, logID, 7, 4, 3, this.boundingBox, world);
- place(mLog, logID, 7, 4, 4, this.boundingBox, world);
-
- for (int x = 0; x < 9; x++) {
- place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 3), x, 3, 0, this.boundingBox, world);
- place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 3), x, 4, 1, this.boundingBox, world);
- place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 3), x, 5, 2, this.boundingBox, world);
- place(Blocks.planks, mWoodType, x, 5, 3, this.boundingBox, world);
- place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 2), x, 5, 4, this.boundingBox, world);
- place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 2), x, 4, 5, this.boundingBox, world);
- place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 2), x, 3, 6, this.boundingBox, world);
- }
-
- int glassMeta = Math.min(16, (coordBaseMode+MathUtils.randInt(0, 8)));
-
- place(Blocks.stained_glass_pane, glassMeta, 3, 2, 1, this.boundingBox, world);
- place(Blocks.stained_glass_pane, glassMeta, 3, 2, 5, this.boundingBox, world);
- place(Blocks.stained_glass_pane, glassMeta, 5, 2, 5, this.boundingBox, world);
- place(Blocks.stained_glass_pane, glassMeta, 1, 2, 3, this.boundingBox, world);
- place(Blocks.stained_glass_pane, glassMeta, 7, 2, 3, this.boundingBox, world);
-
- placeDoorAtCurrentPosition(world, this.boundingBox, random, 5, 1, 1,
- getMetadataWithOffset(Blocks.wooden_door, 1));
-
- place(Blocks.redstone_lamp, mWoodType, 2, 1, 4, this.boundingBox, world);
- place(Blocks.redstone_torch, 0, 2, 2, 4, this.boundingBox, world);
- place(mWoodenStairs, getMetadataWithOffset(mWoodenStairs, 1), 2, 1, 3, this.boundingBox, world);
- place(mWoodenStairs, getMetadataWithOffset(mWoodenStairs, 3), 3, 1, 4, this.boundingBox, world);
- place(Blocks.fence, 0, 3, 1, 3, this.boundingBox, world);
- place(Blocks.heavy_weighted_pressure_plate, 0, 3, 2, 3, this.boundingBox, world);
- if (!this.hasMadeChest) {
- int ic = getYWithOffset(0);
- int jc = getXWithOffset(7, 1);
- int kc = getZWithOffset(7, 1);
- if (this.boundingBox.isVecInside(jc, ic, kc)) {
- this.hasMadeChest = true;
- generateStructureChestContents(world, this.boundingBox, random, 2, 1, 2, shackChestContents,
- 1 + random.nextInt(3));
- }
- }
- for (int i = 0; i < 9; i++) {
- for (int j = 0; j < 9; j++) {
- clearCurrentPositionBlocksUpwards(world, j, 6, i, this.boundingBox);
- func_151554_b(world, undergroundID, 0, j, 0, i, this.boundingBox);
- }
- }
- spawnNatives(world, this.boundingBox, 3, 2, 3, MathUtils.randInt(3, 5));
-
- return true;
- }
-
- private int nativesSpawned = 0;
-
- private void spawnNatives(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4,
- int par5, int maxSpawned) {
- if (this.nativesSpawned < maxSpawned) {
- for (int i1 = this.nativesSpawned; i1 < maxSpawned; i1++) {
- int j1 = getXWithOffset(par3 + i1, par5);
- int k1 = getYWithOffset(par4);
- int l1 = getZWithOffset(par3 + i1, par5);
- if (!par2StructureBoundingBox.isVecInside(j1, k1, l1)) {
- break;
- }
- if (par1World.rand.nextInt(MathUtils.randInt(1, 3)) != 0) {
- EntityVillager entityvillager = new EntityVillager(par1World, 7736+(MathUtils.randInt(0, 1)));
- entityvillager.func_110163_bv();
- entityvillager.setLocationAndAngles(j1 + 0.5D, k1, l1 + 0.5D, 0.0F, 0.0F);
- par1World.spawnEntityInWorld(entityvillager);
- this.nativesSpawned += 1;
- }
- }
- }
- }
-
- //Min, max, Weight
- public static final WeightedRandomChestContent[] shackChestContents = {
- new WeightedRandomChestContent(ItemUtils.getItemStackOfAmountFromOreDict("dustIron", MathUtils.randInt(1, 4)), 0, MathUtils.randInt(1, 9), 50),
- new WeightedRandomChestContent(ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", MathUtils.randInt(1, 4)), 0, MathUtils.randInt(1, 6), 50),
- new WeightedRandomChestContent(ItemUtils.getItemStackOfAmountFromOreDict("dustTin", MathUtils.randInt(1, 4)), 0, MathUtils.randInt(1, 6), 50),
- new WeightedRandomChestContent(ItemUtils.getItemStackOfAmountFromOreDict("dustGold", MathUtils.randInt(1, 4)), 0, MathUtils.randInt(1, 3), 30),
- new WeightedRandomChestContent(ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", MathUtils.randInt(1, 4)), 0, MathUtils.randInt(1, 3), 30),
- new WeightedRandomChestContent(ItemUtils.getItemStackOfAmountFromOreDict("gemDiamond", MathUtils.randInt(1, 2)), 0, MathUtils.randInt(1, 2), 5),
- new WeightedRandomChestContent(ItemUtils.getItemStackOfAmountFromOreDict("gemEmerald", MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 5),
- new WeightedRandomChestContent(ItemUtils.getItemStackOfAmountFromOreDict("gemRuby", MathUtils.randInt(1, 4)), 0, MathUtils.randInt(1, 4), 15),
- new WeightedRandomChestContent(ItemUtils.getItemStackOfAmountFromOreDict("gemSapphire", MathUtils.randInt(1, 4)), 0, MathUtils.randInt(1, 4), 15),
- new WeightedRandomChestContent(ItemUtils.getSimpleStack(CI.electricMotor_LV, MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 5),
- new WeightedRandomChestContent(ItemUtils.getSimpleStack(CI.electricPiston_LV, MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 5),
- new WeightedRandomChestContent(ItemUtils.getSimpleStack(CI.robotArm_LV, MathUtils.randInt(1, 2)), 0, MathUtils.randInt(1, 2), 2),
- new WeightedRandomChestContent(ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, Materials.Copper, MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 25),
- new WeightedRandomChestContent(ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, Materials.Tin, MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 25),
- new WeightedRandomChestContent(ItemUtils.getGregtechOreStack(OrePrefixes.wireGt01, Materials.Copper, MathUtils.randInt(2, 5)), 0, MathUtils.randInt(2, 5), 35),
- new WeightedRandomChestContent(ItemUtils.getGregtechOreStack(OrePrefixes.wireGt01, Materials.Tin, MathUtils.randInt(2, 5)), 0, MathUtils.randInt(2, 5), 35),
- new WeightedRandomChestContent(ItemUtils.getGregtechOreStack(OrePrefixes.pipeSmall, Materials.Copper, MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 25),
- new WeightedRandomChestContent(ItemUtils.getGregtechOreStack(OrePrefixes.pipeSmall, Materials.Bronze, MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 15),
- new WeightedRandomChestContent(ItemUtils.getGregtechOreStack(OrePrefixes.pipeTiny, Materials.Steel, MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 5),
- };
-
- private boolean hasMadeChest;
- private static final String CHEST_KEY = "AUSShackChest";
-
- protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {
- super.func_143012_a(par1NBTTagCompound);
- par1NBTTagCompound.setBoolean("AUSShackChest", this.hasMadeChest);
- par1NBTTagCompound.setInteger("AUSWCount", this.nativesSpawned);
- }
-
- protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {
- super.func_143011_b(par1NBTTagCompound);
- this.hasMadeChest = par1NBTTagCompound.getBoolean("AUSShackChest");
- if (par1NBTTagCompound.hasKey("AUSWCount")) {
- this.nativesSpawned = par1NBTTagCompound.getInteger("AUSWCount");
- } else {
- this.nativesSpawned = 0;
- }
- }
-
- public static class WorldHandlerShack implements IGeneratorWorld {
- private final double chance;
- private final int range;
-
- public WorldHandlerShack(double chance) {
- this.chance = chance;
- this.range = 400;
- }
-
- public int getExtentX() {
- return 7;
- }
-
- public int getExtentZ() {
- return 7;
- }
-
- public int getRange() {
- return this.range;
- }
-
- public boolean generate(World world, Random random, int x, int z) {
- if ((MathUtils.randInt(0, 100) < (this.chance/5))) {
- int direction = MathUtils.randInt(0, 3);
- new ComponentShack(direction, random, x, z).addComponentParts(world, random);
- Logger.WORLD("NativeShack x: " + x + " | z: " + z + " | dir: " + direction);
- return true;
- }
- return false;
- }
-
- public void initiate() {
- }
- }
+ public static final int DIM_X = 9;
+ public static final int DIM_Y = 10;
+ public static final int DIM_Z = 9;
+
+ public ComponentShack() {}
+
+ public ComponentShack(int direction, Random random, int x, int z) {
+ super(direction, random, x, z, DIM_X, DIM_Y, DIM_Z);
+ }
+
+ public boolean addComponentParts(World world, Random random) {
+ BiomeGenBase biom = world.getBiomeGenForCoords(getXWithOffset(0, 0), getZWithOffset(0, 0));
+ int groundAvg = calcGroundHeight(world, this.boundingBox);
+ if (groundAvg < 0) {
+ return true;
+ }
+ this.boundingBox.offset(0, groundAvg - this.boundingBox.maxY + 10 - 1, 0);
+ if ((isWaterBelow(world, 0, -1, 0, this.boundingBox))
+ || (isWaterBelow(world, 0, -1, 6, this.boundingBox))
+ || (isWaterBelow(world, 6, -1, 0, this.boundingBox))
+ || (isWaterBelow(world, 6, -1, 6, this.boundingBox))) {
+ return false;
+ }
+ Block mStone;
+ Block groundID = Blocks.grass;
+ Block undergroundID = Blocks.dirt;
+ if (biom.biomeID == GTplusplus_Australia.Australian_Desert_Biome_3.biomeID) {
+ groundID = Blocks.sand;
+ undergroundID = Blocks.sand;
+ mStone = Blocks.sandstone;
+ } else if (biom.biomeID == GTplusplus_Australia.Australian_Outback_Biome.biomeID) {
+ groundID = Blocks.hardened_clay;
+ undergroundID = Blocks.stained_hardened_clay;
+ mStone = Blocks.stained_hardened_clay;
+ } else {
+ mStone = Blocks.stonebrick;
+ }
+
+ int mWoodType = MathUtils.randInt(0, 5);
+ int logID;
+ Block mWoodenStairs;
+ Block mLog;
+ if (mWoodType == 1) {
+ mWoodenStairs = Blocks.spruce_stairs;
+ logID = 1;
+ } else if (mWoodType == 2) {
+ mWoodenStairs = Blocks.birch_stairs;
+ logID = 2;
+
+ } else if (mWoodType == 3) {
+ mWoodenStairs = Blocks.jungle_stairs;
+ logID = 3;
+ } else if (mWoodType == 4) {
+ mWoodenStairs = Blocks.acacia_stairs;
+ logID = 0;
+ } else if (mWoodType == 5) {
+ mWoodenStairs = Blocks.dark_oak_stairs;
+ logID = 1;
+ } else {
+ mWoodenStairs = Blocks.oak_stairs;
+ logID = 0;
+ }
+ if (mWoodType >= 4) {
+ mLog = Blocks.log2;
+ } else {
+ mLog = Blocks.log;
+ }
+
+ int mStoneMeta =
+ MathUtils.randInt(0, mStone == Blocks.stained_hardened_clay ? 15 : mStone == Blocks.sandstone ? 2 : 3);
+
+ fillWithAir(world, this.boundingBox, 0, 1, 0, 7, 7, 4);
+ fillWithMetadataBlocks(
+ world, this.boundingBox, 1, 0, 1, 7, 1, 5, mStone, mStoneMeta, mStone, mStoneMeta, false);
+ fillWithMetadataBlocks(
+ world, this.boundingBox, 1, 2, 1, 7, 3, 5, Blocks.planks, mWoodType, Blocks.planks, mWoodType, false);
+ fillWithAir(world, this.boundingBox, 2, 1, 2, 6, 3, 4);
+
+ place(mLog, logID, 1, 1, 1, this.boundingBox, world);
+ place(mLog, logID, 1, 2, 1, this.boundingBox, world);
+ place(mLog, logID, 1, 3, 1, this.boundingBox, world);
+
+ place(mLog, logID, 1, 1, 5, this.boundingBox, world);
+ place(mLog, logID, 1, 2, 5, this.boundingBox, world);
+ place(mLog, logID, 1, 3, 5, this.boundingBox, world);
+
+ place(mLog, logID, 7, 1, 1, this.boundingBox, world);
+ place(mLog, logID, 7, 2, 1, this.boundingBox, world);
+ place(mLog, logID, 7, 3, 1, this.boundingBox, world);
+
+ place(mLog, logID, 7, 1, 5, this.boundingBox, world);
+ place(mLog, logID, 7, 2, 5, this.boundingBox, world);
+ place(mLog, logID, 7, 3, 5, this.boundingBox, world);
+
+ int meta = (this.coordBaseMode == 3) || (this.coordBaseMode == 1) ? 4 : 8;
+
+ place(mLog, logID, 1, 4, 2, this.boundingBox, world);
+ place(mLog, logID, 1, 4, 3, this.boundingBox, world);
+ place(mLog, logID, 1, 4, 4, this.boundingBox, world);
+ place(mLog, logID, 7, 4, 2, this.boundingBox, world);
+ place(mLog, logID, 7, 4, 3, this.boundingBox, world);
+ place(mLog, logID, 7, 4, 4, this.boundingBox, world);
+
+ for (int x = 0; x < 9; x++) {
+ place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 3), x, 3, 0, this.boundingBox, world);
+ place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 3), x, 4, 1, this.boundingBox, world);
+ place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 3), x, 5, 2, this.boundingBox, world);
+ place(Blocks.planks, mWoodType, x, 5, 3, this.boundingBox, world);
+ place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 2), x, 5, 4, this.boundingBox, world);
+ place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 2), x, 4, 5, this.boundingBox, world);
+ place(mWoodenStairs, getMetadataWithOffset(Blocks.oak_stairs, 2), x, 3, 6, this.boundingBox, world);
+ }
+
+ int glassMeta = Math.min(16, (coordBaseMode + MathUtils.randInt(0, 8)));
+
+ place(Blocks.stained_glass_pane, glassMeta, 3, 2, 1, this.boundingBox, world);
+ place(Blocks.stained_glass_pane, glassMeta, 3, 2, 5, this.boundingBox, world);
+ place(Blocks.stained_glass_pane, glassMeta, 5, 2, 5, this.boundingBox, world);
+ place(Blocks.stained_glass_pane, glassMeta, 1, 2, 3, this.boundingBox, world);
+ place(Blocks.stained_glass_pane, glassMeta, 7, 2, 3, this.boundingBox, world);
+
+ placeDoorAtCurrentPosition(
+ world, this.boundingBox, random, 5, 1, 1, getMetadataWithOffset(Blocks.wooden_door, 1));
+
+ place(Blocks.redstone_lamp, mWoodType, 2, 1, 4, this.boundingBox, world);
+ place(Blocks.redstone_torch, 0, 2, 2, 4, this.boundingBox, world);
+ place(mWoodenStairs, getMetadataWithOffset(mWoodenStairs, 1), 2, 1, 3, this.boundingBox, world);
+ place(mWoodenStairs, getMetadataWithOffset(mWoodenStairs, 3), 3, 1, 4, this.boundingBox, world);
+ place(Blocks.fence, 0, 3, 1, 3, this.boundingBox, world);
+ place(Blocks.heavy_weighted_pressure_plate, 0, 3, 2, 3, this.boundingBox, world);
+ if (!this.hasMadeChest) {
+ int ic = getYWithOffset(0);
+ int jc = getXWithOffset(7, 1);
+ int kc = getZWithOffset(7, 1);
+ if (this.boundingBox.isVecInside(jc, ic, kc)) {
+ this.hasMadeChest = true;
+ generateStructureChestContents(
+ world, this.boundingBox, random, 2, 1, 2, shackChestContents, 1 + random.nextInt(3));
+ }
+ }
+ for (int i = 0; i < 9; i++) {
+ for (int j = 0; j < 9; j++) {
+ clearCurrentPositionBlocksUpwards(world, j, 6, i, this.boundingBox);
+ func_151554_b(world, undergroundID, 0, j, 0, i, this.boundingBox);
+ }
+ }
+ spawnNatives(world, this.boundingBox, 3, 2, 3, MathUtils.randInt(3, 5));
+
+ return true;
+ }
+
+ private int nativesSpawned = 0;
+
+ private void spawnNatives(
+ World par1World,
+ StructureBoundingBox par2StructureBoundingBox,
+ int par3,
+ int par4,
+ int par5,
+ int maxSpawned) {
+ if (this.nativesSpawned < maxSpawned) {
+ for (int i1 = this.nativesSpawned; i1 < maxSpawned; i1++) {
+ int j1 = getXWithOffset(par3 + i1, par5);
+ int k1 = getYWithOffset(par4);
+ int l1 = getZWithOffset(par3 + i1, par5);
+ if (!par2StructureBoundingBox.isVecInside(j1, k1, l1)) {
+ break;
+ }
+ if (par1World.rand.nextInt(MathUtils.randInt(1, 3)) != 0) {
+ EntityVillager entityvillager = new EntityVillager(par1World, 7736 + (MathUtils.randInt(0, 1)));
+ entityvillager.func_110163_bv();
+ entityvillager.setLocationAndAngles(j1 + 0.5D, k1, l1 + 0.5D, 0.0F, 0.0F);
+ par1World.spawnEntityInWorld(entityvillager);
+ this.nativesSpawned += 1;
+ }
+ }
+ }
+ }
+
+ // Min, max, Weight
+ public static final WeightedRandomChestContent[] shackChestContents = {
+ new WeightedRandomChestContent(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustIron", MathUtils.randInt(1, 4)),
+ 0,
+ MathUtils.randInt(1, 9),
+ 50),
+ new WeightedRandomChestContent(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", MathUtils.randInt(1, 4)),
+ 0,
+ MathUtils.randInt(1, 6),
+ 50),
+ new WeightedRandomChestContent(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTin", MathUtils.randInt(1, 4)),
+ 0,
+ MathUtils.randInt(1, 6),
+ 50),
+ new WeightedRandomChestContent(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustGold", MathUtils.randInt(1, 4)),
+ 0,
+ MathUtils.randInt(1, 3),
+ 30),
+ new WeightedRandomChestContent(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", MathUtils.randInt(1, 4)),
+ 0,
+ MathUtils.randInt(1, 3),
+ 30),
+ new WeightedRandomChestContent(
+ ItemUtils.getItemStackOfAmountFromOreDict("gemDiamond", MathUtils.randInt(1, 2)),
+ 0,
+ MathUtils.randInt(1, 2),
+ 5),
+ new WeightedRandomChestContent(
+ ItemUtils.getItemStackOfAmountFromOreDict("gemEmerald", MathUtils.randInt(1, 3)),
+ 0,
+ MathUtils.randInt(1, 3),
+ 5),
+ new WeightedRandomChestContent(
+ ItemUtils.getItemStackOfAmountFromOreDict("gemRuby", MathUtils.randInt(1, 4)),
+ 0,
+ MathUtils.randInt(1, 4),
+ 15),
+ new WeightedRandomChestContent(
+ ItemUtils.getItemStackOfAmountFromOreDict("gemSapphire", MathUtils.randInt(1, 4)),
+ 0,
+ MathUtils.randInt(1, 4),
+ 15),
+ new WeightedRandomChestContent(
+ ItemUtils.getSimpleStack(CI.electricMotor_LV, MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 5),
+ new WeightedRandomChestContent(
+ ItemUtils.getSimpleStack(CI.electricPiston_LV, MathUtils.randInt(1, 3)), 0, MathUtils.randInt(1, 3), 5),
+ new WeightedRandomChestContent(
+ ItemUtils.getSimpleStack(CI.robotArm_LV, MathUtils.randInt(1, 2)), 0, MathUtils.randInt(1, 2), 2),
+ new WeightedRandomChestContent(
+ ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, Materials.Copper, MathUtils.randInt(1, 3)),
+ 0,
+ MathUtils.randInt(1, 3),
+ 25),
+ new WeightedRandomChestContent(
+ ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, Materials.Tin, MathUtils.randInt(1, 3)),
+ 0,
+ MathUtils.randInt(1, 3),
+ 25),
+ new WeightedRandomChestContent(
+ ItemUtils.getGregtechOreStack(OrePrefixes.wireGt01, Materials.Copper, MathUtils.randInt(2, 5)),
+ 0,
+ MathUtils.randInt(2, 5),
+ 35),
+ new WeightedRandomChestContent(
+ ItemUtils.getGregtechOreStack(OrePrefixes.wireGt01, Materials.Tin, MathUtils.randInt(2, 5)),
+ 0,
+ MathUtils.randInt(2, 5),
+ 35),
+ new WeightedRandomChestContent(
+ ItemUtils.getGregtechOreStack(OrePrefixes.pipeSmall, Materials.Copper, MathUtils.randInt(1, 3)),
+ 0,
+ MathUtils.randInt(1, 3),
+ 25),
+ new WeightedRandomChestContent(
+ ItemUtils.getGregtechOreStack(OrePrefixes.pipeSmall, Materials.Bronze, MathUtils.randInt(1, 3)),
+ 0,
+ MathUtils.randInt(1, 3),
+ 15),
+ new WeightedRandomChestContent(
+ ItemUtils.getGregtechOreStack(OrePrefixes.pipeTiny, Materials.Steel, MathUtils.randInt(1, 3)),
+ 0,
+ MathUtils.randInt(1, 3),
+ 5),
+ };
+
+ private boolean hasMadeChest;
+ private static final String CHEST_KEY = "AUSShackChest";
+
+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {
+ super.func_143012_a(par1NBTTagCompound);
+ par1NBTTagCompound.setBoolean("AUSShackChest", this.hasMadeChest);
+ par1NBTTagCompound.setInteger("AUSWCount", this.nativesSpawned);
+ }
+
+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {
+ super.func_143011_b(par1NBTTagCompound);
+ this.hasMadeChest = par1NBTTagCompound.getBoolean("AUSShackChest");
+ if (par1NBTTagCompound.hasKey("AUSWCount")) {
+ this.nativesSpawned = par1NBTTagCompound.getInteger("AUSWCount");
+ } else {
+ this.nativesSpawned = 0;
+ }
+ }
+
+ public static class WorldHandlerShack implements IGeneratorWorld {
+ private final double chance;
+ private final int range;
+
+ public WorldHandlerShack(double chance) {
+ this.chance = chance;
+ this.range = 400;
+ }
+
+ public int getExtentX() {
+ return 7;
+ }
+
+ public int getExtentZ() {
+ return 7;
+ }
+
+ public int getRange() {
+ return this.range;
+ }
+
+ public boolean generate(World world, Random random, int x, int z) {
+ if ((MathUtils.randInt(0, 100) < (this.chance / 5))) {
+ int direction = MathUtils.randInt(0, 3);
+ new ComponentShack(direction, random, x, z).addComponentParts(world, random);
+ Logger.WORLD("NativeShack x: " + x + " | z: " + z + " | dir: " + direction);
+ return true;
+ }
+ return false;
+ }
+ public void initiate() {}
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/gen/map/structure/StructureManager.java b/src/main/java/gtPlusPlus/australia/gen/map/structure/StructureManager.java
index b3238a5903..16d9034b5b 100644
--- a/src/main/java/gtPlusPlus/australia/gen/map/structure/StructureManager.java
+++ b/src/main/java/gtPlusPlus/australia/gen/map/structure/StructureManager.java
@@ -7,14 +7,14 @@ import net.minecraft.world.gen.structure.MapGenStructureIO;
public class StructureManager {
- public static void registerVillageComponents() {
- try {
- //Register Village
- MapGenStructureIO.registerStructure(MapGenExtendedVillage.Start.class, "ExtendedVillage");
-
- //Register Structures within village
- MapGenStructureIO.func_143031_a(ComponentVillageBank.class, CORE.MODID+":"+"Bank");
- } catch (Throwable e) {}
- }
-
+ public static void registerVillageComponents() {
+ try {
+ // Register Village
+ MapGenStructureIO.registerStructure(MapGenExtendedVillage.Start.class, "ExtendedVillage");
+
+ // Register Structures within village
+ MapGenStructureIO.func_143031_a(ComponentVillageBank.class, CORE.MODID + ":" + "Bank");
+ } catch (Throwable e) {
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/gen/map/structure/type/ComponentVillageBank.java b/src/main/java/gtPlusPlus/australia/gen/map/structure/type/ComponentVillageBank.java
index 5b7017aaf0..b88c6bfda9 100644
--- a/src/main/java/gtPlusPlus/australia/gen/map/structure/type/ComponentVillageBank.java
+++ b/src/main/java/gtPlusPlus/australia/gen/map/structure/type/ComponentVillageBank.java
@@ -2,10 +2,9 @@ package gtPlusPlus.australia.gen.map.structure.type;
import static net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH;
+import gtPlusPlus.api.objects.Logger;
import java.util.List;
import java.util.Random;
-
-import gtPlusPlus.api.objects.Logger;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -21,155 +20,177 @@ import net.minecraftforge.common.ChestGenHooks;
public class ComponentVillageBank extends House2 {
- /** List of items that Village's Blacksmith chest can contain. */
- public static final WeightedRandomChestContent[] villageBlacksmithChestContents = new WeightedRandomChestContent[] {
- new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3),
- new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10),
- new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5),
- new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15),
- new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15),
- new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5),
- new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5),
- new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5),
- new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5),
- new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5),
- new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5),
- new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 3, 7, 5),
- new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 0, 3, 7, 5),
- new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3),
- new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1),
- new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1),
- new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)
- };
-
- private boolean hasMadeChest;
-
- public ComponentVillageBank() {
- Logger.INFO("Created a Bank.");
- }
-
- public ComponentVillageBank(StructureVillagePieces.Start aStart, int p_i2103_2_, Random aRand,
- StructureBoundingBox aBox, int aCoordBaseMode) {
- super(aStart, p_i2103_2_, aRand, aBox, aCoordBaseMode);
- this.coordBaseMode = aCoordBaseMode;
- this.boundingBox = aBox;
- }
-
- public static StructureVillagePieces.House2 func_74915_a(StructureVillagePieces.Start p_74915_0_, List p_74915_1_,
- Random p_74915_2_, int p_74915_3_, int p_74915_4_, int p_74915_5_, int p_74915_6_, int p_74915_7_) {
- StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74915_3_,
- p_74915_4_, p_74915_5_, 0, 0, 0, 10, 6, 7, p_74915_6_);
- Logger.INFO("12334453");
- return canVillageGoDeeper(structureboundingbox)
- && StructureComponent.findIntersecting(p_74915_1_, structureboundingbox) == null
- ? new StructureVillagePieces.House2(p_74915_0_, p_74915_7_, p_74915_2_, structureboundingbox,
- p_74915_6_)
- : null;
- }
-
- protected void func_143012_a(NBTTagCompound aNBT) {
- super.func_143012_a(aNBT);
- aNBT.setBoolean("Chest", this.hasMadeChest);
- }
-
- protected void func_143011_b(NBTTagCompound aNBT) {
- super.func_143011_b(aNBT);
- this.hasMadeChest = aNBT.getBoolean("Chest");
- }
-
- /**
- * second Part of Structure generating, this for example places Spiderwebs, Mob
- * Spawners, it closes Mineshafts at the end, it adds Fences...
- */
- public boolean addComponentParts(World aWorld, Random aRand, StructureBoundingBox aBox) {
- if (this.field_143015_k < 0) {
- this.field_143015_k = this.getAverageGroundLevel(aWorld, aBox);
-
- if (this.field_143015_k < 0) {
- return true;
- }
-
- this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0);
- }
-
- this.fillWithBlocks(aWorld, aBox, 0, 1, 0, 9, 4, 6, Blocks.air, Blocks.air, false);
- this.fillWithBlocks(aWorld, aBox, 0, 0, 0, 9, 0, 6, Blocks.cobblestone, Blocks.cobblestone, false);
- this.fillWithBlocks(aWorld, aBox, 0, 4, 0, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false);
- this.fillWithBlocks(aWorld, aBox, 0, 5, 0, 9, 5, 6, Blocks.stone_slab, Blocks.stone_slab, false);
- this.fillWithBlocks(aWorld, aBox, 1, 5, 1, 8, 5, 5, Blocks.air, Blocks.air, false);
- this.fillWithBlocks(aWorld, aBox, 1, 1, 0, 2, 3, 0, Blocks.planks, Blocks.planks, false);
- this.fillWithBlocks(aWorld, aBox, 0, 1, 0, 0, 4, 0, Blocks.log, Blocks.log, false);
- this.fillWithBlocks(aWorld, aBox, 3, 1, 0, 3, 4, 0, Blocks.log, Blocks.log, false);
- this.fillWithBlocks(aWorld, aBox, 0, 1, 6, 0, 4, 6, Blocks.log, Blocks.log, false);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.planks, 0, 3, 3, 1, aBox);
- this.fillWithBlocks(aWorld, aBox, 3, 1, 2, 3, 3, 2, Blocks.planks, Blocks.planks, false);
- this.fillWithBlocks(aWorld, aBox, 4, 1, 3, 5, 3, 3, Blocks.planks, Blocks.planks, false);
- this.fillWithBlocks(aWorld, aBox, 0, 1, 1, 0, 3, 5, Blocks.planks, Blocks.planks, false);
- this.fillWithBlocks(aWorld, aBox, 1, 1, 6, 5, 3, 6, Blocks.planks, Blocks.planks, false);
- this.fillWithBlocks(aWorld, aBox, 5, 1, 0, 5, 3, 0, Blocks.fence, Blocks.fence, false);
- this.fillWithBlocks(aWorld, aBox, 9, 1, 0, 9, 3, 0, Blocks.fence, Blocks.fence, false);
- this.fillWithBlocks(aWorld, aBox, 6, 1, 4, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.flowing_lava, 0, 7, 1, 5, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.flowing_lava, 0, 8, 1, 5, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.iron_bars, 0, 9, 2, 5, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.iron_bars, 0, 9, 2, 4, aBox);
- this.fillWithBlocks(aWorld, aBox, 7, 2, 4, 8, 2, 5, Blocks.air, Blocks.air, false);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.cobblestone, 0, 6, 1, 3, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.furnace, 0, 6, 2, 3, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.furnace, 0, 6, 3, 3, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.double_stone_slab, 0, 8, 1, 1, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 0, 2, 2, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 0, 2, 4, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 2, 2, 6, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 4, 2, 6, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.fence, 0, 2, 1, 4, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.wooden_pressure_plate, 0, 2, 2, 4, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.planks, 0, 1, 1, 5, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.oak_stairs,
- this.getMetadataWithOffset(Blocks.oak_stairs, 3), 2, 1, 5, aBox);
- this.placeBlockAtCurrentPosition(aWorld, Blocks.oak_stairs,
- this.getMetadataWithOffset(Blocks.oak_stairs, 1), 1, 1, 4, aBox);
- int i;
- int j;
-
- if (!this.hasMadeChest) {
- i = this.getYWithOffset(1);
- j = this.getXWithOffset(5, 5);
- int k = this.getZWithOffset(5, 5);
-
- if (aBox.isVecInside(j, i, k)) {
- this.hasMadeChest = true;
- this.generateStructureChestContents(aWorld, aBox, aRand, 5, 1, 5,
- ChestGenHooks.getItems(VILLAGE_BLACKSMITH, aRand),
- ChestGenHooks.getCount(VILLAGE_BLACKSMITH, aRand));
- }
- }
-
- for (i = 6; i <= 8; ++i) {
- if (this.getBlockAtCurrentPosition(aWorld, i, 0, -1, aBox).getMaterial() == Material.air && this
- .getBlockAtCurrentPosition(aWorld, i, -1, -1, aBox).getMaterial() != Material.air) {
- this.placeBlockAtCurrentPosition(aWorld, Blocks.stone_stairs,
- this.getMetadataWithOffset(Blocks.stone_stairs, 3), i, 0, -1, aBox);
- }
- }
-
- for (i = 0; i < 7; ++i) {
- for (j = 0; j < 10; ++j) {
- this.clearCurrentPositionBlocksUpwards(aWorld, j, 6, i, aBox);
- this.func_151554_b(aWorld, Blocks.cobblestone, 0, j, -1, i, aBox);
- }
- }
-
- this.spawnVillagers(aWorld, aBox, 7, 1, 1, 1);
- return true;
- }
-
- /**
- * Returns the villager type to spawn in this component, based on the number of
- * villagers already spawned.
- */
- protected int getVillagerType(int p_74888_1_) {
- return 7735;
- }
-
+ /** List of items that Village's Blacksmith chest can contain. */
+ public static final WeightedRandomChestContent[] villageBlacksmithChestContents = new WeightedRandomChestContent[] {
+ new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3),
+ new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10),
+ new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5),
+ new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15),
+ new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15),
+ new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5),
+ new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5),
+ new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5),
+ new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5),
+ new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5),
+ new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5),
+ new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 3, 7, 5),
+ new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 0, 3, 7, 5),
+ new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3),
+ new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1),
+ new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1),
+ new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)
+ };
+
+ private boolean hasMadeChest;
+
+ public ComponentVillageBank() {
+ Logger.INFO("Created a Bank.");
+ }
+
+ public ComponentVillageBank(
+ StructureVillagePieces.Start aStart,
+ int p_i2103_2_,
+ Random aRand,
+ StructureBoundingBox aBox,
+ int aCoordBaseMode) {
+ super(aStart, p_i2103_2_, aRand, aBox, aCoordBaseMode);
+ this.coordBaseMode = aCoordBaseMode;
+ this.boundingBox = aBox;
+ }
+
+ public static StructureVillagePieces.House2 func_74915_a(
+ StructureVillagePieces.Start p_74915_0_,
+ List p_74915_1_,
+ Random p_74915_2_,
+ int p_74915_3_,
+ int p_74915_4_,
+ int p_74915_5_,
+ int p_74915_6_,
+ int p_74915_7_) {
+ StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(
+ p_74915_3_, p_74915_4_, p_74915_5_, 0, 0, 0, 10, 6, 7, p_74915_6_);
+ Logger.INFO("12334453");
+ return canVillageGoDeeper(structureboundingbox)
+ && StructureComponent.findIntersecting(p_74915_1_, structureboundingbox) == null
+ ? new StructureVillagePieces.House2(
+ p_74915_0_, p_74915_7_, p_74915_2_, structureboundingbox, p_74915_6_)
+ : null;
+ }
+
+ protected void func_143012_a(NBTTagCompound aNBT) {
+ super.func_143012_a(aNBT);
+ aNBT.setBoolean("Chest", this.hasMadeChest);
+ }
+
+ protected void func_143011_b(NBTTagCompound aNBT) {
+ super.func_143011_b(aNBT);
+ this.hasMadeChest = aNBT.getBoolean("Chest");
+ }
+
+ /**
+ * second Part of Structure generating, this for example places Spiderwebs, Mob
+ * Spawners, it closes Mineshafts at the end, it adds Fences...
+ */
+ public boolean addComponentParts(World aWorld, Random aRand, StructureBoundingBox aBox) {
+ if (this.field_143015_k < 0) {
+ this.field_143015_k = this.getAverageGroundLevel(aWorld, aBox);
+
+ if (this.field_143015_k < 0) {
+ return true;
+ }
+
+ this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0);
+ }
+
+ this.fillWithBlocks(aWorld, aBox, 0, 1, 0, 9, 4, 6, Blocks.air, Blocks.air, false);
+ this.fillWithBlocks(aWorld, aBox, 0, 0, 0, 9, 0, 6, Blocks.cobblestone, Blocks.cobblestone, false);
+ this.fillWithBlocks(aWorld, aBox, 0, 4, 0, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false);
+ this.fillWithBlocks(aWorld, aBox, 0, 5, 0, 9, 5, 6, Blocks.stone_slab, Blocks.stone_slab, false);
+ this.fillWithBlocks(aWorld, aBox, 1, 5, 1, 8, 5, 5, Blocks.air, Blocks.air, false);
+ this.fillWithBlocks(aWorld, aBox, 1, 1, 0, 2, 3, 0, Blocks.planks, Blocks.planks, false);
+ this.fillWithBlocks(aWorld, aBox, 0, 1, 0, 0, 4, 0, Blocks.log, Blocks.log, false);
+ this.fillWithBlocks(aWorld, aBox, 3, 1, 0, 3, 4, 0, Blocks.log, Blocks.log, false);
+ this.fillWithBlocks(aWorld, aBox, 0, 1, 6, 0, 4, 6, Blocks.log, Blocks.log, false);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.planks, 0, 3, 3, 1, aBox);
+ this.fillWithBlocks(aWorld, aBox, 3, 1, 2, 3, 3, 2, Blocks.planks, Blocks.planks, false);
+ this.fillWithBlocks(aWorld, aBox, 4, 1, 3, 5, 3, 3, Blocks.planks, Blocks.planks, false);
+ this.fillWithBlocks(aWorld, aBox, 0, 1, 1, 0, 3, 5, Blocks.planks, Blocks.planks, false);
+ this.fillWithBlocks(aWorld, aBox, 1, 1, 6, 5, 3, 6, Blocks.planks, Blocks.planks, false);
+ this.fillWithBlocks(aWorld, aBox, 5, 1, 0, 5, 3, 0, Blocks.fence, Blocks.fence, false);
+ this.fillWithBlocks(aWorld, aBox, 9, 1, 0, 9, 3, 0, Blocks.fence, Blocks.fence, false);
+ this.fillWithBlocks(aWorld, aBox, 6, 1, 4, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.flowing_lava, 0, 7, 1, 5, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.flowing_lava, 0, 8, 1, 5, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.iron_bars, 0, 9, 2, 5, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.iron_bars, 0, 9, 2, 4, aBox);
+ this.fillWithBlocks(aWorld, aBox, 7, 2, 4, 8, 2, 5, Blocks.air, Blocks.air, false);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.cobblestone, 0, 6, 1, 3, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.furnace, 0, 6, 2, 3, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.furnace, 0, 6, 3, 3, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.double_stone_slab, 0, 8, 1, 1, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 0, 2, 2, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 0, 2, 4, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 2, 2, 6, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 4, 2, 6, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.fence, 0, 2, 1, 4, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.wooden_pressure_plate, 0, 2, 2, 4, aBox);
+ this.placeBlockAtCurrentPosition(aWorld, Blocks.planks, 0, 1, 1, 5, aBox);
+ this.placeBlockAtCurrentPosition(
+ aWorld, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), 2, 1, 5, aBox);
+ this.placeBlockAtCurrentPosition(
+ aWorld, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 1), 1, 1, 4, aBox);
+ int i;
+ int j;
+
+ if (!this.hasMadeChest) {
+ i = this.getYWithOffset(1);
+ j = this.getXWithOffset(5, 5);
+ int k = this.getZWithOffset(5, 5);
+
+ if (aBox.isVecInside(j, i, k)) {
+ this.hasMadeChest = true;
+ this.generateStructureChestContents(
+ aWorld,
+ aBox,
+ aRand,
+ 5,
+ 1,
+ 5,
+ ChestGenHooks.getItems(VILLAGE_BLACKSMITH, aRand),
+ ChestGenHooks.getCount(VILLAGE_BLACKSMITH, aRand));
+ }
+ }
+
+ for (i = 6; i <= 8; ++i) {
+ if (this.getBlockAtCurrentPosition(aWorld, i, 0, -1, aBox).getMaterial() == Material.air
+ && this.getBlockAtCurrentPosition(aWorld, i, -1, -1, aBox).getMaterial() != Material.air) {
+ this.placeBlockAtCurrentPosition(
+ aWorld,
+ Blocks.stone_stairs,
+ this.getMetadataWithOffset(Blocks.stone_stairs, 3),
+ i,
+ 0,
+ -1,
+ aBox);
+ }
+ }
+
+ for (i = 0; i < 7; ++i) {
+ for (j = 0; j < 10; ++j) {
+ this.clearCurrentPositionBlocksUpwards(aWorld, j, 6, i, aBox);
+ this.func_151554_b(aWorld, Blocks.cobblestone, 0, j, -1, i, aBox);
+ }
+ }
+
+ this.spawnVillagers(aWorld, aBox, 7, 1, 1, 1);
+ return true;
+ }
+
+ /**
+ * Returns the villager type to spawn in this component, based on the number of
+ * villagers already spawned.
+ */
+ protected int getVillagerType(int p_74888_1_) {
+ return 7735;
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianOre.java b/src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianOre.java
index 9adb84eef2..d2f3b7e5cb 100644
--- a/src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianOre.java
+++ b/src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianOre.java
@@ -1,9 +1,8 @@
package gtPlusPlus.australia.gen.world;
-import java.util.Random;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
@@ -11,77 +10,78 @@ import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenAustralianOre extends WorldGenerator {
-
- private Block mOreToSpawn;
- private int numberOfBlocks;
- private Block mBlockToReplace;
- private int mineableBlockMeta;
- public WorldGenAustralianOre(Block aBlock, int aNumber) {
- this(aBlock, aNumber, Blocks.stone);
- this.mineableBlockMeta = 0;
- }
+ private Block mOreToSpawn;
+ private int numberOfBlocks;
+ private Block mBlockToReplace;
+ private int mineableBlockMeta;
+
+ public WorldGenAustralianOre(Block aBlock, int aNumber) {
+ this(aBlock, aNumber, Blocks.stone);
+ this.mineableBlockMeta = 0;
+ }
- public WorldGenAustralianOre(Block aBlock, int aNumber, Block aReplace) {
- this.mOreToSpawn = aBlock;
- this.numberOfBlocks = aNumber;
- this.mBlockToReplace = aReplace;
- }
+ public WorldGenAustralianOre(Block aBlock, int aNumber, Block aReplace) {
+ this.mOreToSpawn = aBlock;
+ this.numberOfBlocks = aNumber;
+ this.mBlockToReplace = aReplace;
+ }
- public WorldGenAustralianOre(Block block, int meta, int number, Block target) {
- this(block, number, target);
- this.mineableBlockMeta = meta;
- }
-
-
+ public WorldGenAustralianOre(Block block, int meta, int number, Block target) {
+ this(block, number, target);
+ this.mineableBlockMeta = meta;
+ }
- public boolean generate(World aWorld, Random aRand, int aX, int aY, int aZ) {
- float f = MathUtils.randFloat(0f, 1.5f) * CORE.PI;
- double d0 = (double) ((float) (aX + 8) + MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F);
- double d1 = (double) ((float) (aX + 8) - MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F);
- double d2 = (double) ((float) (aZ + 8) + MathHelper.cos(f) * (float) this.numberOfBlocks / 8.0F);
- double d3 = (double) ((float) (aZ + 8) - MathHelper.cos(f) * (float) this.numberOfBlocks / 8.0F);
- double d4 = (double) (aY + aRand.nextInt(MathUtils.randInt(3, 6)) - 2);
- double d5 = (double) (aY + aRand.nextInt(MathUtils.randInt(3, 6)) - 2);
+ public boolean generate(World aWorld, Random aRand, int aX, int aY, int aZ) {
+ float f = MathUtils.randFloat(0f, 1.5f) * CORE.PI;
+ double d0 = (double) ((float) (aX + 8) + MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F);
+ double d1 = (double) ((float) (aX + 8) - MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F);
+ double d2 = (double) ((float) (aZ + 8) + MathHelper.cos(f) * (float) this.numberOfBlocks / 8.0F);
+ double d3 = (double) ((float) (aZ + 8) - MathHelper.cos(f) * (float) this.numberOfBlocks / 8.0F);
+ double d4 = (double) (aY + aRand.nextInt(MathUtils.randInt(3, 6)) - 2);
+ double d5 = (double) (aY + aRand.nextInt(MathUtils.randInt(3, 6)) - 2);
- for (int aOreGenerated = 0; aOreGenerated <= this.numberOfBlocks; ++aOreGenerated) {
- double d6 = d0 + (d1 - d0) * (double) aOreGenerated / (double) this.numberOfBlocks;
- double d7 = d4 + (d5 - d4) * (double) aOreGenerated / (double) this.numberOfBlocks;
- double d8 = d2 + (d3 - d2) * (double) aOreGenerated / (double) this.numberOfBlocks;
- double d9 = aRand.nextDouble() * (double) this.numberOfBlocks / 16.0D;
- double d10 = (double) (MathHelper.sin((float) aOreGenerated * CORE.PI / (float) this.numberOfBlocks) + 1.0F)
- * d9 + 1.0D;
- double d11 = (double) (MathHelper.sin((float) aOreGenerated * CORE.PI / (float) this.numberOfBlocks) + 1.0F)
- * d9 + 1.0D;
- int i1 = MathHelper.floor_double(d6 - d10 / 2.0D);
- int j1 = MathHelper.floor_double(d7 - d11 / 2.0D);
- int k1 = MathHelper.floor_double(d8 - d10 / 2.0D);
- int l1 = MathHelper.floor_double(d6 + d10 / 2.0D);
- int i2 = MathHelper.floor_double(d7 + d11 / 2.0D);
- int j2 = MathHelper.floor_double(d8 + d10 / 2.0D);
+ for (int aOreGenerated = 0; aOreGenerated <= this.numberOfBlocks; ++aOreGenerated) {
+ double d6 = d0 + (d1 - d0) * (double) aOreGenerated / (double) this.numberOfBlocks;
+ double d7 = d4 + (d5 - d4) * (double) aOreGenerated / (double) this.numberOfBlocks;
+ double d8 = d2 + (d3 - d2) * (double) aOreGenerated / (double) this.numberOfBlocks;
+ double d9 = aRand.nextDouble() * (double) this.numberOfBlocks / 16.0D;
+ double d10 =
+ (double) (MathHelper.sin((float) aOreGenerated * CORE.PI / (float) this.numberOfBlocks) + 1.0F) * d9
+ + 1.0D;
+ double d11 =
+ (double) (MathHelper.sin((float) aOreGenerated * CORE.PI / (float) this.numberOfBlocks) + 1.0F) * d9
+ + 1.0D;
+ int i1 = MathHelper.floor_double(d6 - d10 / 2.0D);
+ int j1 = MathHelper.floor_double(d7 - d11 / 2.0D);
+ int k1 = MathHelper.floor_double(d8 - d10 / 2.0D);
+ int l1 = MathHelper.floor_double(d6 + d10 / 2.0D);
+ int i2 = MathHelper.floor_double(d7 + d11 / 2.0D);
+ int j2 = MathHelper.floor_double(d8 + d10 / 2.0D);
- for (int k2 = i1; k2 <= l1; ++k2) {
- double d12 = ((double) k2 + 0.5D - d6) / (d10 / 2.0D);
+ for (int k2 = i1; k2 <= l1; ++k2) {
+ double d12 = ((double) k2 + 0.5D - d6) / (d10 / 2.0D);
- if (d12 * d12 < 1.0D) {
- for (int l2 = j1; l2 <= i2; ++l2) {
- double d13 = ((double) l2 + 0.5D - d7) / (d11 / 2.0D);
+ if (d12 * d12 < 1.0D) {
+ for (int l2 = j1; l2 <= i2; ++l2) {
+ double d13 = ((double) l2 + 0.5D - d7) / (d11 / 2.0D);
- if (d12 * d12 + d13 * d13 < 1.0D) {
- for (int i3 = k1; i3 <= j2; ++i3) {
- double d14 = ((double) i3 + 0.5D - d8) / (d10 / 2.0D);
+ if (d12 * d12 + d13 * d13 < 1.0D) {
+ for (int i3 = k1; i3 <= j2; ++i3) {
+ double d14 = ((double) i3 + 0.5D - d8) / (d10 / 2.0D);
- if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && aWorld.getBlock(k2, l2, i3)
- .isReplaceableOreGen(aWorld, k2, l2, i3, mBlockToReplace)) {
- aWorld.setBlock(k2, l2, i3, this.mOreToSpawn, mineableBlockMeta, 2);
- }
- }
- }
- }
- }
- }
- }
+ if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D
+ && aWorld.getBlock(k2, l2, i3)
+ .isReplaceableOreGen(aWorld, k2, l2, i3, mBlockToReplace)) {
+ aWorld.setBlock(k2, l2, i3, this.mOreToSpawn, mineableBlockMeta, 2);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
- return true;
- }
-} \ No newline at end of file
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianTrees.java b/src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianTrees.java
index f3529aff0b..da0830d982 100644
--- a/src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianTrees.java
+++ b/src/main/java/gtPlusPlus/australia/gen/world/WorldGenAustralianTrees.java
@@ -1,11 +1,9 @@
package gtPlusPlus.australia.gen.world;
-import java.util.Random;
-
import gtPlusPlus.core.util.math.MathUtils;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling;
-import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.util.Direction;
import net.minecraft.world.World;
@@ -14,237 +12,257 @@ import net.minecraftforge.common.util.ForgeDirection;
public class WorldGenAustralianTrees extends WorldGenTrees {
- /** The minimum height of a generated tree. */
- private final int minHeight;
- /** True if this tree should grow Vines. */
- private final boolean growVines;
- /** The metadata value of the wood to use in tree generation. */
- private final int woodMeta;
- /** The metadata value of the leaves to use in tree generation. */
- private final int leavesMeta;
-
- public WorldGenAustralianTrees(boolean p_i2027_1_) {
- this(p_i2027_1_, 4, false);
- }
-
- public WorldGenAustralianTrees(boolean p_i2028_1_, int aMinHeight, boolean aVinesGrow) {
- super(p_i2028_1_, aMinHeight, 0, 0, aVinesGrow);
- this.minHeight = aMinHeight;
- this.woodMeta = 0;
- this.leavesMeta = 0;
- this.growVines = aVinesGrow;
- }
-
- public boolean generate(World aWorld, Random aRand, int aX, int aY, int aZ) {
- int aActualMinHeight = MathUtils.randInt(4, 8) + this.minHeight;
- boolean flag = true;
-
- if (aY >= 1 && aY + aActualMinHeight + 1 <= 256) {
- byte b0;
- int k1;
- Block block;
-
- for (int i1 = aY; i1 <= aY + 1 + aActualMinHeight; ++i1) {
- b0 = 1;
-
- if (i1 == aY) {
- b0 = 0;
- }
-
- if (i1 >= aY + 1 + aActualMinHeight - 2) {
- b0 = 2;
- }
-
- for (int j1 = aX - b0; j1 <= aX + b0 && flag; ++j1) {
- for (k1 = aZ - b0; k1 <= aZ + b0 && flag; ++k1) {
- if (i1 >= 0 && i1 < 256) {
- block = aWorld.getBlock(j1, i1, k1);
-
- if (!this.isReplaceable(aWorld, j1, i1, k1)) {
- flag = false;
- }
- } else {
- flag = false;
- }
- }
- }
- }
-
- if (!flag) {
- return false;
- } else {
- Block block2 = aWorld.getBlock(aX, aY - 1, aZ);
- boolean isSoil = true;
- for (int gh = 0; gh < 5; gh++) {
- int xMod, zMod;
- if (gh == 0) {
- xMod = 1;
- zMod = 0;
- }
- else if (gh == 1) {
- xMod = 0;
- zMod = 1;
- }
- else if (gh == 2) {
- xMod = -1;
- zMod = 0;
- }
- else if (gh == 3) {
- xMod = 0;
- zMod = -1;
- }
- else {
- xMod = 0;
- zMod = 0;
- }
- block2 = aWorld.getBlock(aX+xMod, aY - 1, aZ+zMod);
- if (block2 == Blocks.air || !block2.canSustainPlant(aWorld, aX+xMod, aY - 1, aZ+zMod, ForgeDirection.UP, (BlockSapling) Blocks.sapling)) {
- isSoil = false;
- break;
- }
- }
-
- if (isSoil && aY < 256 - aActualMinHeight - 1) {
- block2.onPlantGrow(aWorld, aX, aY - 1, aZ, aX, aY, aZ);
- b0 = 5;
- byte b1 = 0;
- int l1;
- int i2;
- int j2;
- int i3;
-
- for (k1 = aY - b0 + aActualMinHeight; k1 <= aY + aActualMinHeight; ++k1) {
- i3 = k1 - (aY + aActualMinHeight);
- l1 = b1 + 3 - i3 / 2;
-
- for (i2 = aX - l1; i2 <= aX + l1; ++i2) {
- j2 = i2 - aX;
-
- for (int k2 = aZ - l1; k2 <= aZ + l1; ++k2) {
- int l2 = k2 - aZ;
-
- if (Math.abs(j2) != l1 || Math.abs(l2) != l1 || aRand.nextInt(2) != 0 && i3 != 0) {
- Block block1 = aWorld.getBlock(i2, k1, k2);
-
- if (block1.isAir(aWorld, i2, k1, k2) || block1.isLeaves(aWorld, i2, k1, k2)) {
- this.setBlockAndNotifyAdequately(aWorld, i2, k1, k2, Blocks.leaves,
- this.leavesMeta);
- }
- }
- }
- }
- }
-
- for (k1 = 0; k1 < aActualMinHeight; ++k1) {
- block = aWorld.getBlock(aX, aY + k1, aZ);
-
- if (block.isAir(aWorld, aX, aY + k1, aZ) || block.isLeaves(aWorld, aX, aY + k1, aZ)) {
-
- //Set Middle Trunk
- this.setBlockAndNotifyAdequately(aWorld, aX, aY + k1, aZ, Blocks.log, this.woodMeta);
- //Set Sides
- if (k1 < (aActualMinHeight - 2)) {
- if (aWorld.isAirBlock(aX+1, aY + k1, aZ) || block.isLeaves(aWorld, aX+1, aY + k1, aZ)) this.setBlockAndNotifyAdequately(aWorld, aX+1, aY + k1, aZ, Blocks.log, this.woodMeta);
- if (aWorld.isAirBlock(aX-1, aY + k1, aZ) || block.isLeaves(aWorld, aX-1, aY + k1, aZ)) this.setBlockAndNotifyAdequately(aWorld, aX-1, aY + k1, aZ, Blocks.log, this.woodMeta);
- if (aWorld.isAirBlock(aX, aY + k1, aZ+1) || block.isLeaves(aWorld, aX, aY + k1, aZ+1)) this.setBlockAndNotifyAdequately(aWorld, aX, aY + k1, aZ+1, Blocks.log, this.woodMeta);
- if (aWorld.isAirBlock(aX, aY + k1, aZ-1) || block.isLeaves(aWorld, aX, aY + k1, aZ-1)) this.setBlockAndNotifyAdequately(aWorld, aX, aY + k1, aZ-1, Blocks.log, this.woodMeta);
- }
-
- if (this.growVines && k1 > 0) {
- if (aRand.nextInt(3) > 0 && aWorld.isAirBlock(aX - 1, aY + k1, aZ)) {
- this.setBlockAndNotifyAdequately(aWorld, aX - 1, aY + k1, aZ, Blocks.vine, 8);
- }
-
- if (aRand.nextInt(3) > 0 && aWorld.isAirBlock(aX + 1, aY + k1, aZ)) {
- this.setBlockAndNotifyAdequately(aWorld, aX + 1, aY + k1, aZ, Blocks.vine, 2);
- }
-
- if (aRand.nextInt(3) > 0 && aWorld.isAirBlock(aX, aY + k1, aZ - 1)) {
- this.setBlockAndNotifyAdequately(aWorld, aX, aY + k1, aZ - 1, Blocks.vine, 1);
- }
-
- if (aRand.nextInt(3) > 0 && aWorld.isAirBlock(aX, aY + k1, aZ + 1)) {
- this.setBlockAndNotifyAdequately(aWorld, aX, aY + k1, aZ + 1, Blocks.vine, 4);
- }
- }
- }
- }
-
- if (this.growVines) {
- for (k1 = aY - 3 + aActualMinHeight; k1 <= aY + aActualMinHeight; ++k1) {
- i3 = k1 - (aY + aActualMinHeight);
- l1 = 2 - i3 / 2;
-
- for (i2 = aX - l1; i2 <= aX + l1; ++i2) {
- for (j2 = aZ - l1; j2 <= aZ + l1; ++j2) {
- if (aWorld.getBlock(i2, k1, j2).isLeaves(aWorld, i2, k1, j2)) {
- if (aRand.nextInt(4) == 0
- && aWorld.getBlock(i2 - 1, k1, j2).isAir(aWorld, i2 - 1, k1, j2)) {
- this.growVines(aWorld, i2 - 1, k1, j2, 8);
- }
-
- if (aRand.nextInt(4) == 0
- && aWorld.getBlock(i2 + 1, k1, j2).isAir(aWorld, i2 + 1, k1, j2)) {
- this.growVines(aWorld, i2 + 1, k1, j2, 2);
- }
-
- if (aRand.nextInt(4) == 0
- && aWorld.getBlock(i2, k1, j2 - 1).isAir(aWorld, i2, k1, j2 - 1)) {
- this.growVines(aWorld, i2, k1, j2 - 1, 1);
- }
-
- if (aRand.nextInt(4) == 0
- && aWorld.getBlock(i2, k1, j2 + 1).isAir(aWorld, i2, k1, j2 + 1)) {
- this.growVines(aWorld, i2, k1, j2 + 1, 4);
- }
- }
- }
- }
- }
-
- if (aRand.nextInt(5) == 0 && aActualMinHeight > 5) {
- for (k1 = 0; k1 < 2; ++k1) {
- for (i3 = 0; i3 < 4; ++i3) {
- if (aRand.nextInt(4 - k1) == 0) {
- l1 = aRand.nextInt(3);
- this.setBlockAndNotifyAdequately(aWorld,
- aX + Direction.offsetX[Direction.rotateOpposite[i3]], aY + aActualMinHeight - 5 + k1,
- aZ + Direction.offsetZ[Direction.rotateOpposite[i3]], Blocks.cocoa,
- l1 << 2 | i3);
- }
- }
- }
- }
- }
-
- return true;
- } else {
- return false;
- }
- }
- } else {
- return false;
- }
- }
-
- /**
- * Grows vines downward from the given block for a given length. Args: World, x,
- * starty, z, vine-length
- */
- private void growVines(World p_76529_1_, int p_76529_2_, int p_76529_3_, int p_76529_4_, int p_76529_5_) {
- this.setBlockAndNotifyAdequately(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_, Blocks.vine, p_76529_5_);
- int i1 = 4;
-
- while (true) {
- --p_76529_3_;
-
- if (!p_76529_1_.getBlock(p_76529_2_, p_76529_3_, p_76529_4_).isAir(p_76529_1_, p_76529_2_, p_76529_3_,
- p_76529_4_) || i1 <= 0) {
- return;
- }
-
- this.setBlockAndNotifyAdequately(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_, Blocks.vine, p_76529_5_);
- --i1;
- }
- }
-} \ No newline at end of file
+ /** The minimum height of a generated tree. */
+ private final int minHeight;
+ /** True if this tree should grow Vines. */
+ private final boolean growVines;
+ /** The metadata value of the wood to use in tree generation. */
+ private final int woodMeta;
+ /** The metadata value of the leaves to use in tree generation. */
+ private final int leavesMeta;
+
+ public WorldGenAustralianTrees(boolean p_i2027_1_) {
+ this(p_i2027_1_, 4, false);
+ }
+
+ public WorldGenAustralianTrees(boolean p_i2028_1_, int aMinHeight, boolean aVinesGrow) {
+ super(p_i2028_1_, aMinHeight, 0, 0, aVinesGrow);
+ this.minHeight = aMinHeight;
+ this.woodMeta = 0;
+ this.leavesMeta = 0;
+ this.growVines = aVinesGrow;
+ }
+
+ public boolean generate(World aWorld, Random aRand, int aX, int aY, int aZ) {
+ int aActualMinHeight = MathUtils.randInt(4, 8) + this.minHeight;
+ boolean flag = true;
+
+ if (aY >= 1 && aY + aActualMinHeight + 1 <= 256) {
+ byte b0;
+ int k1;
+ Block block;
+
+ for (int i1 = aY; i1 <= aY + 1 + aActualMinHeight; ++i1) {
+ b0 = 1;
+
+ if (i1 == aY) {
+ b0 = 0;
+ }
+
+ if (i1 >= aY + 1 + aActualMinHeight - 2) {
+ b0 = 2;
+ }
+
+ for (int j1 = aX - b0; j1 <= aX + b0 && flag; ++j1) {
+ for (k1 = aZ - b0; k1 <= aZ + b0 && flag; ++k1) {
+ if (i1 >= 0 && i1 < 256) {
+ block = aWorld.getBlock(j1, i1, k1);
+
+ if (!this.isReplaceable(aWorld, j1, i1, k1)) {
+ flag = false;
+ }
+ } else {
+ flag = false;
+ }
+ }
+ }
+ }
+
+ if (!flag) {
+ return false;
+ } else {
+ Block block2 = aWorld.getBlock(aX, aY - 1, aZ);
+ boolean isSoil = true;
+ for (int gh = 0; gh < 5; gh++) {
+ int xMod, zMod;
+ if (gh == 0) {
+ xMod = 1;
+ zMod = 0;
+ } else if (gh == 1) {
+ xMod = 0;
+ zMod = 1;
+ } else if (gh == 2) {
+ xMod = -1;
+ zMod = 0;
+ } else if (gh == 3) {
+ xMod = 0;
+ zMod = -1;
+ } else {
+ xMod = 0;
+ zMod = 0;
+ }
+ block2 = aWorld.getBlock(aX + xMod, aY - 1, aZ + zMod);
+ if (block2 == Blocks.air
+ || !block2.canSustainPlant(
+ aWorld, aX + xMod, aY - 1, aZ + zMod, ForgeDirection.UP, (BlockSapling)
+ Blocks.sapling)) {
+ isSoil = false;
+ break;
+ }
+ }
+
+ if (isSoil && aY < 256 - aActualMinHeight - 1) {
+ block2.onPlantGrow(aWorld, aX, aY - 1, aZ, aX, aY, aZ);
+ b0 = 5;
+ byte b1 = 0;
+ int l1;
+ int i2;
+ int j2;
+ int i3;
+
+ for (k1 = aY - b0 + aActualMinHeight; k1 <= aY + aActualMinHeight; ++k1) {
+ i3 = k1 - (aY + aActualMinHeight);
+ l1 = b1 + 3 - i3 / 2;
+
+ for (i2 = aX - l1; i2 <= aX + l1; ++i2) {
+ j2 = i2 - aX;
+
+ for (int k2 = aZ - l1; k2 <= aZ + l1; ++k2) {
+ int l2 = k2 - aZ;
+
+ if (Math.abs(j2) != l1 || Math.abs(l2) != l1 || aRand.nextInt(2) != 0 && i3 != 0) {
+ Block block1 = aWorld.getBlock(i2, k1, k2);
+
+ if (block1.isAir(aWorld, i2, k1, k2) || block1.isLeaves(aWorld, i2, k1, k2)) {
+ this.setBlockAndNotifyAdequately(
+ aWorld, i2, k1, k2, Blocks.leaves, this.leavesMeta);
+ }
+ }
+ }
+ }
+ }
+
+ for (k1 = 0; k1 < aActualMinHeight; ++k1) {
+ block = aWorld.getBlock(aX, aY + k1, aZ);
+
+ if (block.isAir(aWorld, aX, aY + k1, aZ) || block.isLeaves(aWorld, aX, aY + k1, aZ)) {
+
+ // Set Middle Trunk
+ this.setBlockAndNotifyAdequately(aWorld, aX, aY + k1, aZ, Blocks.log, this.woodMeta);
+ // Set Sides
+ if (k1 < (aActualMinHeight - 2)) {
+ if (aWorld.isAirBlock(aX + 1, aY + k1, aZ)
+ || block.isLeaves(aWorld, aX + 1, aY + k1, aZ))
+ this.setBlockAndNotifyAdequately(
+ aWorld, aX + 1, aY + k1, aZ, Blocks.log, this.woodMeta);
+ if (aWorld.isAirBlock(aX - 1, aY + k1, aZ)
+ || block.isLeaves(aWorld, aX - 1, aY + k1, aZ))
+ this.setBlockAndNotifyAdequately(
+ aWorld, aX - 1, aY + k1, aZ, Blocks.log, this.woodMeta);
+ if (aWorld.isAirBlock(aX, aY + k1, aZ + 1)
+ || block.isLeaves(aWorld, aX, aY + k1, aZ + 1))
+ this.setBlockAndNotifyAdequately(
+ aWorld, aX, aY + k1, aZ + 1, Blocks.log, this.woodMeta);
+ if (aWorld.isAirBlock(aX, aY + k1, aZ - 1)
+ || block.isLeaves(aWorld, aX, aY + k1, aZ - 1))
+ this.setBlockAndNotifyAdequately(
+ aWorld, aX, aY + k1, aZ - 1, Blocks.log, this.woodMeta);
+ }
+
+ if (this.growVines && k1 > 0) {
+ if (aRand.nextInt(3) > 0 && aWorld.isAirBlock(aX - 1, aY + k1, aZ)) {
+ this.setBlockAndNotifyAdequately(aWorld, aX - 1, aY + k1, aZ, Blocks.vine, 8);
+ }
+
+ if (aRand.nextInt(3) > 0 && aWorld.isAirBlock(aX + 1, aY + k1, aZ)) {
+ this.setBlockAndNotifyAdequately(aWorld, aX + 1, aY + k1, aZ, Blocks.vine, 2);
+ }
+
+ if (aRand.nextInt(3) > 0 && aWorld.isAirBlock(aX, aY + k1, aZ - 1)) {
+ this.setBlockAndNotifyAdequately(aWorld, aX, aY + k1, aZ - 1, Blocks.vine, 1);
+ }
+
+ if (aRand.nextInt(3) > 0 && aWorld.isAirBlock(aX, aY + k1, aZ + 1)) {
+ this.setBlockAndNotifyAdequately(aWorld, aX, aY + k1, aZ + 1, Blocks.vine, 4);
+ }
+ }
+ }
+ }
+
+ if (this.growVines) {
+ for (k1 = aY - 3 + aActualMinHeight; k1 <= aY + aActualMinHeight; ++k1) {
+ i3 = k1 - (aY + aActualMinHeight);
+ l1 = 2 - i3 / 2;
+
+ for (i2 = aX - l1; i2 <= aX + l1; ++i2) {
+ for (j2 = aZ - l1; j2 <= aZ + l1; ++j2) {
+ if (aWorld.getBlock(i2, k1, j2).isLeaves(aWorld, i2, k1, j2)) {
+ if (aRand.nextInt(4) == 0
+ && aWorld.getBlock(i2 - 1, k1, j2)
+ .isAir(aWorld, i2 - 1, k1, j2)) {
+ this.growVines(aWorld, i2 - 1, k1, j2, 8);
+ }
+
+ if (aRand.nextInt(4) == 0
+ && aWorld.getBlock(i2 + 1, k1, j2)
+ .isAir(aWorld, i2 + 1, k1, j2)) {
+ this.growVines(aWorld, i2 + 1, k1, j2, 2);
+ }
+
+ if (aRand.nextInt(4) == 0
+ && aWorld.getBlock(i2, k1, j2 - 1)
+ .isAir(aWorld, i2, k1, j2 - 1)) {
+ this.growVines(aWorld, i2, k1, j2 - 1, 1);
+ }
+
+ if (aRand.nextInt(4) == 0
+ && aWorld.getBlock(i2, k1, j2 + 1)
+ .isAir(aWorld, i2, k1, j2 + 1)) {
+ this.growVines(aWorld, i2, k1, j2 + 1, 4);
+ }
+ }
+ }
+ }
+ }
+
+ if (aRand.nextInt(5) == 0 && aActualMinHeight > 5) {
+ for (k1 = 0; k1 < 2; ++k1) {
+ for (i3 = 0; i3 < 4; ++i3) {
+ if (aRand.nextInt(4 - k1) == 0) {
+ l1 = aRand.nextInt(3);
+ this.setBlockAndNotifyAdequately(
+ aWorld,
+ aX + Direction.offsetX[Direction.rotateOpposite[i3]],
+ aY + aActualMinHeight - 5 + k1,
+ aZ + Direction.offsetZ[Direction.rotateOpposite[i3]],
+ Blocks.cocoa,
+ l1 << 2 | i3);
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Grows vines downward from the given block for a given length. Args: World, x,
+ * starty, z, vine-length
+ */
+ private void growVines(World p_76529_1_, int p_76529_2_, int p_76529_3_, int p_76529_4_, int p_76529_5_) {
+ this.setBlockAndNotifyAdequately(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_, Blocks.vine, p_76529_5_);
+ int i1 = 4;
+
+ while (true) {
+ --p_76529_3_;
+
+ if (!p_76529_1_
+ .getBlock(p_76529_2_, p_76529_3_, p_76529_4_)
+ .isAir(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_)
+ || i1 <= 0) {
+ return;
+ }
+
+ this.setBlockAndNotifyAdequately(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_, Blocks.vine, p_76529_5_);
+ --i1;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/item/ItemAustraliaPortalTrigger.java b/src/main/java/gtPlusPlus/australia/item/ItemAustraliaPortalTrigger.java
index 5100ed31c5..064c6a3149 100644
--- a/src/main/java/gtPlusPlus/australia/item/ItemAustraliaPortalTrigger.java
+++ b/src/main/java/gtPlusPlus/australia/item/ItemAustraliaPortalTrigger.java
@@ -1,7 +1,10 @@
package gtPlusPlus.australia.item;
+import gtPlusPlus.australia.dimension.Dimension_Australia;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,90 +14,97 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.australia.dimension.Dimension_Australia;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
public class ItemAustraliaPortalTrigger extends Item {
- public ItemAustraliaPortalTrigger() {
- super();
- this.maxStackSize = 1;
- setMaxDamage(64);
- setCreativeTab(CreativeTabs.tabTools);
- this.setTextureName(CORE.MODID + ":" + "itemAlkalusDisk");
- }
+ public ItemAustraliaPortalTrigger() {
+ super();
+ this.maxStackSize = 1;
+ setMaxDamage(64);
+ setCreativeTab(CreativeTabs.tabTools);
+ this.setTextureName(CORE.MODID + ":" + "itemAlkalusDisk");
+ }
- @Override
- public Item setMaxStackSize(int int1) {
- return super.setMaxStackSize(1);
- }
+ @Override
+ public Item setMaxStackSize(int int1) {
+ return super.setMaxStackSize(1);
+ }
- @Override
- public EnumRarity getRarity(ItemStack thisItem) {
- return EnumRarity.rare;
- }
+ @Override
+ public EnumRarity getRarity(ItemStack thisItem) {
+ return EnumRarity.rare;
+ }
- @Override
- public boolean hasEffect(ItemStack par1ItemStack, int pass) {
- return false;
- }
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack, int pass) {
+ return false;
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return EnumChatFormatting.GOLD+"Alkalus ROM ["+EnumChatFormatting.RED+"Activated"+EnumChatFormatting.GOLD+"]";
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return EnumChatFormatting.GOLD + "Alkalus ROM [" + EnumChatFormatting.RED + "Activated"
+ + EnumChatFormatting.GOLD + "]";
+ }
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GREEN+"Shows a glipse of the past.");
- list.add(EnumChatFormatting.GREEN+"This item produces such a temperature, that you'd hate to use it incorrectly.");
- super.addInformation(stack, aPlayer, list, bool);
- }
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GREEN + "Shows a glipse of the past.");
+ list.add(EnumChatFormatting.GREEN
+ + "This item produces such a temperature, that you'd hate to use it incorrectly.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- return Utils.rgbtoHexValue(128, 192, 64);
- }
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ return Utils.rgbtoHexValue(128, 192, 64);
+ }
- @Override
- public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7,
- float par8, float par9, float par10) {
- if (par7 == 0) {
- par5--;
- }
- if (par7 == 1) {
- par5++;
- }
- if (par7 == 2) {
- par6--;
- }
- if (par7 == 3) {
- par6++;
- }
- if (par7 == 4) {
- par4--;
- }
- if (par7 == 5) {
- par4++;
- }
- if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
- return false;
- }
- Block i1 = par3World.getBlock(par4, par5, par6);
- if (i1 == Blocks.air) {
- par3World.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
- if (Dimension_Australia.portalBlock.tryToCreatePortal(par3World, par4, par5, par6)){
- //Make a Portal
- }
- else {
- if (!par3World.isRemote){
- par3World.setBlock(par4, par5, par6, ModBlocks.blockHellfire, 0, 3);
- }
- }
- }
- par1ItemStack.damageItem(1, par2EntityPlayer);
- return true;
- }
-} \ No newline at end of file
+ @Override
+ public boolean onItemUse(
+ ItemStack par1ItemStack,
+ EntityPlayer par2EntityPlayer,
+ World par3World,
+ int par4,
+ int par5,
+ int par6,
+ int par7,
+ float par8,
+ float par9,
+ float par10) {
+ if (par7 == 0) {
+ par5--;
+ }
+ if (par7 == 1) {
+ par5++;
+ }
+ if (par7 == 2) {
+ par6--;
+ }
+ if (par7 == 3) {
+ par6++;
+ }
+ if (par7 == 4) {
+ par4--;
+ }
+ if (par7 == 5) {
+ par4++;
+ }
+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
+ return false;
+ }
+ Block i1 = par3World.getBlock(par4, par5, par6);
+ if (i1 == Blocks.air) {
+ par3World.playSoundEffect(
+ par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
+ if (Dimension_Australia.portalBlock.tryToCreatePortal(par3World, par4, par5, par6)) {
+ // Make a Portal
+ } else {
+ if (!par3World.isRemote) {
+ par3World.setBlock(par4, par5, par6, ModBlocks.blockHellfire, 0, 3);
+ }
+ }
+ }
+ par1ItemStack.damageItem(1, par2EntityPlayer);
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/item/ItemBlockAustralia.java b/src/main/java/gtPlusPlus/australia/item/ItemBlockAustralia.java
index 9854f9fa6a..b7c84bb6f0 100644
--- a/src/main/java/gtPlusPlus/australia/item/ItemBlockAustralia.java
+++ b/src/main/java/gtPlusPlus/australia/item/ItemBlockAustralia.java
@@ -1,39 +1,32 @@
package gtPlusPlus.australia.item;
+import gtPlusPlus.api.interfaces.ITileTooltip;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-
public class ItemBlockAustralia extends ItemBlock {
-
- protected final int mID;
-
- public ItemBlockAustralia(final Block block) {
- super(block);
- this.mID = ((ITileTooltip) block).getTooltipID();
- }
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.mID == 0){ //blockDarkWorldPortalFrame
- list.add("Use this to access Australia.");
- list.add("Assembled in the same shape as the Nether Portal.");
- }
- else if (this.mID == 1){ //blockDarkWorldPortal
- list.add("Place this if you are lazy to create the portal structure, slacker.");
- }
- else if (this.mID == 2){ //blockDarkWorldGround
- list.add("Pure Australian Outback.");
- }
- else if (this.mID == 3){ //blockDarkWorldPollutedDirt
- list.add("Maybe you can do something with this?.");
- }
- }
-
+ protected final int mID;
+
+ public ItemBlockAustralia(final Block block) {
+ super(block);
+ this.mID = ((ITileTooltip) block).getTooltipID();
+ }
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.mID == 0) { // blockDarkWorldPortalFrame
+ list.add("Use this to access Australia.");
+ list.add("Assembled in the same shape as the Nether Portal.");
+ } else if (this.mID == 1) { // blockDarkWorldPortal
+ list.add("Place this if you are lazy to create the portal structure, slacker.");
+ } else if (this.mID == 2) { // blockDarkWorldGround
+ list.add("Pure Australian Outback.");
+ } else if (this.mID == 3) { // blockDarkWorldPollutedDirt
+ list.add("Maybe you can do something with this?.");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/world/AustraliaPortalPosition.java b/src/main/java/gtPlusPlus/australia/world/AustraliaPortalPosition.java
index 865c0c3bb2..cc7ae1c37d 100644
--- a/src/main/java/gtPlusPlus/australia/world/AustraliaPortalPosition.java
+++ b/src/main/java/gtPlusPlus/australia/world/AustraliaPortalPosition.java
@@ -3,12 +3,13 @@ package gtPlusPlus.australia.world;
import net.minecraft.util.ChunkCoordinates;
public class AustraliaPortalPosition extends ChunkCoordinates {
- public long field_85087_d;
- final AustraliaTeleporterDimensionMod field_85088_e;
+ public long field_85087_d;
+ final AustraliaTeleporterDimensionMod field_85088_e;
- public AustraliaPortalPosition(AustraliaTeleporterDimensionMod gladesTeleporter, int par2, int par3, int par4, long par5) {
- super(par2, par3, par4);
- this.field_85088_e = gladesTeleporter;
- this.field_85087_d = par5;
- }
-} \ No newline at end of file
+ public AustraliaPortalPosition(
+ AustraliaTeleporterDimensionMod gladesTeleporter, int par2, int par3, int par4, long par5) {
+ super(par2, par3, par4);
+ this.field_85088_e = gladesTeleporter;
+ this.field_85087_d = par5;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/world/AustraliaTeleporterDimensionMod.java b/src/main/java/gtPlusPlus/australia/world/AustraliaTeleporterDimensionMod.java
index 4ad693263e..f277800b72 100644
--- a/src/main/java/gtPlusPlus/australia/world/AustraliaTeleporterDimensionMod.java
+++ b/src/main/java/gtPlusPlus/australia/world/AustraliaTeleporterDimensionMod.java
@@ -1,470 +1,471 @@
package gtPlusPlus.australia.world;
+import gtPlusPlus.australia.dimension.Dimension_Australia;
import java.util.*;
-
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.*;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.Teleporter;
import net.minecraft.world.WorldServer;
-import gtPlusPlus.australia.dimension.Dimension_Australia;
public class AustraliaTeleporterDimensionMod extends Teleporter {
- private final WorldServer worldServerInstance;
- /**
- * A private Random() function in Teleporter
- */
- private final Random random;
- /**
- * Stores successful portal placement locations for rapid lookup.
- */
- private final LongHashMap destinationCoordinateCache = new LongHashMap();
- /**
- * A list of valid keys for the destinationCoordainteCache. These are
- * based on the X & Z of the players initial location.
- */
- @SuppressWarnings("rawtypes")
- private final List destinationCoordinateKeys = new ArrayList();
-
- public AustraliaTeleporterDimensionMod(WorldServer par1WorldServer) {
- super(par1WorldServer);
- this.worldServerInstance = par1WorldServer;
- this.random = new Random(par1WorldServer.getSeed());
- }
-
- /**
- * Place an entity in a nearby portal, creating one if necessary.
- */
- @Override
- public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
- if (this.worldServerInstance.provider.dimensionId != 1) {
- if (!this.placeInExistingPortal(par1Entity, par2, par4, par6, par8)) {
- this.makePortal(par1Entity);
- this.placeInExistingPortal(par1Entity, par2, par4, par6, par8);
- }
- }
- else {
- int i = MathHelper.floor_double(par1Entity.posX);
- int j = MathHelper.floor_double(par1Entity.posY) - 1;
- int k = MathHelper.floor_double(par1Entity.posZ);
- byte b0 = 1;
- byte b1 = 0;
-
- for (int l = -2; l <= 2; ++l) {
- for (int i1 = -2; i1 <= 2; ++i1) {
- for (int j1 = -1; j1 < 3; ++j1) {
- int k1 = i + i1 * b0 + l * b1;
- int l1 = j + j1;
- int i2 = k + i1 * b1 - l * b0;
- boolean flag = j1 < 0;
- this.worldServerInstance.setBlock(k1, l1, i2, flag ? Dimension_Australia.blockPortalFrame : Blocks.air);
- }
- }
- }
-
- par1Entity.setLocationAndAngles(i, j, k, par1Entity.rotationYaw, 0.0F);
- par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
- }
- }
-
- /**
- * Place an entity in a nearby portal which already exists.
- */
- @Override
- public boolean placeInExistingPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
- short short1 = 128;
- double d3 = -1.0D;
- int i = 0;
- int j = 0;
- int k = 0;
- int l = MathHelper.floor_double(par1Entity.posX);
- int i1 = MathHelper.floor_double(par1Entity.posZ);
- long j1 = ChunkCoordIntPair.chunkXZ2Int(l, i1);
- boolean flag = true;
- double d7;
- int l3;
-
- if (this.destinationCoordinateCache.containsItem(j1)) {
- Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition) this.destinationCoordinateCache
- .getValueByKey(j1);
- d3 = 0.0D;
- i = portalposition.posX;
- j = portalposition.posY;
- k = portalposition.posZ;
- portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
- flag = false;
- }
- else {
- for (l3 = l - short1; l3 <= l + short1; ++l3) {
- double d4 = l3 + 0.5D - par1Entity.posX;
-
- for (int l1 = i1 - short1; l1 <= i1 + short1; ++l1) {
- double d5 = l1 + 0.5D - par1Entity.posZ;
-
- for (int i2 = this.worldServerInstance.getActualHeight() - 1; i2 >= 0; --i2) {
- if (this.worldServerInstance.getBlock(l3, i2, l1) == Dimension_Australia.portalBlock) {
- while (this.worldServerInstance.getBlock(l3, i2 - 1, l1) == Dimension_Australia.portalBlock) {
- --i2;
- }
-
- d7 = i2 + 0.5D - par1Entity.posY;
- double d8 = d4 * d4 + d7 * d7 + d5 * d5;
-
- if (d3 < 0.0D || d8 < d3) {
- d3 = d8;
- i = l3;
- j = i2;
- k = l1;
- }
- }
- }
- }
- }
- }
-
- if (d3 >= 0.0D) {
- if (flag) {
- this.destinationCoordinateCache.add(j1,
- new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime()));
- this.destinationCoordinateKeys.add(Long.valueOf(j1));
- }
-
- double d11 = i + 0.5D;
- double d6 = j + 0.5D;
- d7 = k + 0.5D;
- int i4 = -1;
-
- if (this.worldServerInstance.getBlock(i - 1, j, k) == Dimension_Australia.portalBlock) {
- i4 = 2;
- }
-
- if (this.worldServerInstance.getBlock(i + 1, j, k) == Dimension_Australia.portalBlock) {
- i4 = 0;
- }
-
- if (this.worldServerInstance.getBlock(i, j, k - 1) == Dimension_Australia.portalBlock) {
- i4 = 3;
- }
-
- if (this.worldServerInstance.getBlock(i, j, k + 1) == Dimension_Australia.portalBlock) {
- i4 = 1;
- }
-
- int j2 = par1Entity.getTeleportDirection();
-
- if (i4 > -1) {
- int k2 = Direction.rotateLeft[i4];
- int l2 = Direction.offsetX[i4];
- int i3 = Direction.offsetZ[i4];
- int j3 = Direction.offsetX[k2];
- int k3 = Direction.offsetZ[k2];
- boolean flag1 = !this.worldServerInstance.isAirBlock(i + l2 + j3, j, k + i3 + k3)
- || !this.worldServerInstance.isAirBlock(i + l2 + j3, j + 1, k + i3 + k3);
- boolean flag2 = !this.worldServerInstance.isAirBlock(i + l2, j, k + i3)
- || !this.worldServerInstance.isAirBlock(i + l2, j + 1, k + i3);
-
- if (flag1 && flag2) {
- i4 = Direction.rotateOpposite[i4];
- k2 = Direction.rotateOpposite[k2];
- l2 = Direction.offsetX[i4];
- i3 = Direction.offsetZ[i4];
- j3 = Direction.offsetX[k2];
- k3 = Direction.offsetZ[k2];
- l3 = i - j3;
- d11 -= j3;
- int k1 = k - k3;
- d7 -= k3;
- flag1 = !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j, k1 + i3 + k3)
- || !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j + 1, k1 + i3 + k3);
- flag2 = !this.worldServerInstance.isAirBlock(l3 + l2, j, k1 + i3)
- || !this.worldServerInstance.isAirBlock(l3 + l2, j + 1, k1 + i3);
- }
-
- float f1 = 0.5F;
- float f2 = 0.5F;
-
- if (!flag1 && flag2) {
- f1 = 1.0F;
- }
- else if (flag1 && !flag2) {
- f1 = 0.0F;
- }
- else if (flag1 && flag2) {
- f2 = 0.0F;
- }
-
- d11 += j3 * f1 + f2 * l2;
- d7 += k3 * f1 + f2 * i3;
- float f3 = 0.0F;
- float f4 = 0.0F;
- float f5 = 0.0F;
- float f6 = 0.0F;
-
- if (i4 == j2) {
- f3 = 1.0F;
- f4 = 1.0F;
- }
- else if (i4 == Direction.rotateOpposite[j2]) {
- f3 = -1.0F;
- f4 = -1.0F;
- }
- else if (i4 == Direction.rotateRight[j2]) {
- f5 = 1.0F;
- f6 = -1.0F;
- }
- else {
- f5 = -1.0F;
- f6 = 1.0F;
- }
-
- double d9 = par1Entity.motionX;
- double d10 = par1Entity.motionZ;
- par1Entity.motionX = d9 * f3 + d10 * f6;
- par1Entity.motionZ = d9 * f5 + d10 * f4;
- par1Entity.rotationYaw = par8 - j2 * 90 + i4 * 90;
- }
- else {
- par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
- }
-
- par1Entity.setLocationAndAngles(d11, d6, d7, par1Entity.rotationYaw, par1Entity.rotationPitch);
- return true;
- }
- else {
- return false;
- }
- }
-
- @Override
- public boolean makePortal(Entity par1Entity) {
- byte b0 = 16;
- double d0 = -1.0D;
- int i = MathHelper.floor_double(par1Entity.posX);
- int j = MathHelper.floor_double(par1Entity.posY);
- int k = MathHelper.floor_double(par1Entity.posZ);
- int l = i;
- int i1 = j;
- int j1 = k;
- int k1 = 0;
- int l1 = this.random.nextInt(4);
- int i2;
- double d1;
- double d2;
- int k2;
- int i3;
- int k3;
- int j3;
- int i4;
- int l3;
- int k4;
- int j4;
- int i5;
- int l4;
- double d3;
- double d4;
-
- for (i2 = i - b0; i2 <= i + b0; ++i2) {
- d1 = i2 + 0.5D - par1Entity.posX;
-
- for (k2 = k - b0; k2 <= k + b0; ++k2) {
- d2 = k2 + 0.5D - par1Entity.posZ;
- label274:
-
- for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) {
- if (this.worldServerInstance.isAirBlock(i2, i3, k2)) {
- while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) {
- --i3;
- }
-
- for (j3 = l1; j3 < l1 + 4; ++j3) {
- k3 = j3 % 2;
- l3 = 1 - k3;
-
- if (j3 % 4 >= 2) {
- k3 = -k3;
- l3 = -l3;
- }
-
- for (i4 = 0; i4 < 3; ++i4) {
- for (j4 = 0; j4 < 4; ++j4) {
- for (k4 = -1; k4 < 4; ++k4) {
- l4 = i2 + (j4 - 1) * k3 + i4 * l3;
- i5 = i3 + k4;
- int j5 = k2 + (j4 - 1) * l3 - i4 * k3;
-
- if (k4 < 0
- && !this.worldServerInstance.getBlock(l4, i5, j5).getMaterial()
- .isSolid()
- || k4 >= 0 && !this.worldServerInstance.isAirBlock(l4, i5, j5)) {
- continue label274;
- }
- }
- }
- }
-
- d4 = i3 + 0.5D - par1Entity.posY;
- d3 = d1 * d1 + d4 * d4 + d2 * d2;
-
- if (d0 < 0.0D || d3 < d0) {
- d0 = d3;
- l = i2;
- i1 = i3;
- j1 = k2;
- k1 = j3 % 4;
- }
- }
- }
- }
- }
- }
-
- if (d0 < 0.0D) {
- for (i2 = i - b0; i2 <= i + b0; ++i2) {
- d1 = i2 + 0.5D - par1Entity.posX;
-
- for (k2 = k - b0; k2 <= k + b0; ++k2) {
- d2 = k2 + 0.5D - par1Entity.posZ;
- label222:
-
- for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) {
- if (this.worldServerInstance.isAirBlock(i2, i3, k2)) {
- while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) {
- --i3;
- }
-
- for (j3 = l1; j3 < l1 + 2; ++j3) {
- k3 = j3 % 2;
- l3 = 1 - k3;
-
- for (i4 = 0; i4 < 4; ++i4) {
- for (j4 = -1; j4 < 4; ++j4) {
- k4 = i2 + (i4 - 1) * k3;
- l4 = i3 + j4;
- i5 = k2 + (i4 - 1) * l3;
-
- if (j4 < 0
- && !this.worldServerInstance.getBlock(k4, l4, i5).getMaterial()
- .isSolid()
- || j4 >= 0 && !this.worldServerInstance.isAirBlock(k4, l4, i5)) {
- continue label222;
- }
- }
- }
-
- d4 = i3 + 0.5D - par1Entity.posY;
- d3 = d1 * d1 + d4 * d4 + d2 * d2;
-
- if (d0 < 0.0D || d3 < d0) {
- d0 = d3;
- l = i2;
- i1 = i3;
- j1 = k2;
- k1 = j3 % 2;
- }
- }
- }
- }
- }
- }
- }
-
- int k5 = l;
- int j2 = i1;
- k2 = j1;
- int l5 = k1 % 2;
- int l2 = 1 - l5;
-
- if (k1 % 4 >= 2) {
- l5 = -l5;
- l2 = -l2;
- }
-
- boolean flag;
-
- if (d0 < 0.0D) {
- if (i1 < 70) {
- i1 = 70;
- }
-
- if (i1 > this.worldServerInstance.getActualHeight() - 10) {
- i1 = this.worldServerInstance.getActualHeight() - 10;
- }
-
- j2 = i1;
-
- for (i3 = -1; i3 <= 1; ++i3) {
- for (j3 = 1; j3 < 3; ++j3) {
- for (k3 = -1; k3 < 3; ++k3) {
- l3 = k5 + (j3 - 1) * l5 + i3 * l2;
- i4 = j2 + k3;
- j4 = k2 + (j3 - 1) * l2 - i3 * l5;
- flag = k3 < 0;
- this.worldServerInstance.setBlock(l3, i4, j4, flag ? Dimension_Australia.blockPortalFrame : Blocks.air);
- }
- }
- }
- }
-
- for (i3 = 0; i3 < 4; ++i3) {
- for (j3 = 0; j3 < 4; ++j3) {
- for (k3 = -1; k3 < 4; ++k3) {
- l3 = k5 + (j3 - 1) * l5;
- i4 = j2 + k3;
- j4 = k2 + (j3 - 1) * l2;
- flag = j3 == 0 || j3 == 3 || k3 == -1 || k3 == 3;
- this.worldServerInstance.setBlock(l3, i4, j4, flag ? Dimension_Australia.blockPortalFrame : Dimension_Australia.portalBlock, 0, 2);
- }
- }
-
- for (j3 = 0; j3 < 4; ++j3) {
- for (k3 = -1; k3 < 4; ++k3) {
- l3 = k5 + (j3 - 1) * l5;
- i4 = j2 + k3;
- j4 = k2 + (j3 - 1) * l2;
- this.worldServerInstance.notifyBlocksOfNeighborChange(l3, i4, j4,
- this.worldServerInstance.getBlock(l3, i4, j4));
- }
- }
- }
-
- return true;
- }
-
- /**
- * called periodically to remove out-of-date portal locations from the
- * cache list. Argument par1 is a WorldServer.getTotalWorldTime() value.
- */
- @Override
- public void removeStalePortalLocations(long par1) {
- if (par1 % 100L == 0L) {
- @SuppressWarnings("rawtypes")
- Iterator iterator = this.destinationCoordinateKeys.iterator();
- long j = par1 - 600L;
-
- while (iterator.hasNext()) {
- Long olong = (Long) iterator.next();
- Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition) this.destinationCoordinateCache
- .getValueByKey(olong.longValue());
-
- if (portalposition == null || portalposition.lastUpdateTime < j) {
- iterator.remove();
- this.destinationCoordinateCache.remove(olong.longValue());
- }
- }
- }
- }
-
- public class PortalPosition extends ChunkCoordinates {
- /**
- * The worldtime at which this PortalPosition was last verified
- */
- public long lastUpdateTime;
-
- public PortalPosition(int par2, int par3, int par4, long par5) {
- super(par2, par3, par4);
- this.lastUpdateTime = par5;
- }
- }
-} \ No newline at end of file
+ private final WorldServer worldServerInstance;
+ /**
+ * A private Random() function in Teleporter
+ */
+ private final Random random;
+ /**
+ * Stores successful portal placement locations for rapid lookup.
+ */
+ private final LongHashMap destinationCoordinateCache = new LongHashMap();
+ /**
+ * A list of valid keys for the destinationCoordainteCache. These are
+ * based on the X & Z of the players initial location.
+ */
+ @SuppressWarnings("rawtypes")
+ private final List destinationCoordinateKeys = new ArrayList();
+
+ public AustraliaTeleporterDimensionMod(WorldServer par1WorldServer) {
+ super(par1WorldServer);
+ this.worldServerInstance = par1WorldServer;
+ this.random = new Random(par1WorldServer.getSeed());
+ }
+
+ /**
+ * Place an entity in a nearby portal, creating one if necessary.
+ */
+ @Override
+ public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
+ if (this.worldServerInstance.provider.dimensionId != 1) {
+ if (!this.placeInExistingPortal(par1Entity, par2, par4, par6, par8)) {
+ this.makePortal(par1Entity);
+ this.placeInExistingPortal(par1Entity, par2, par4, par6, par8);
+ }
+ } else {
+ int i = MathHelper.floor_double(par1Entity.posX);
+ int j = MathHelper.floor_double(par1Entity.posY) - 1;
+ int k = MathHelper.floor_double(par1Entity.posZ);
+ byte b0 = 1;
+ byte b1 = 0;
+
+ for (int l = -2; l <= 2; ++l) {
+ for (int i1 = -2; i1 <= 2; ++i1) {
+ for (int j1 = -1; j1 < 3; ++j1) {
+ int k1 = i + i1 * b0 + l * b1;
+ int l1 = j + j1;
+ int i2 = k + i1 * b1 - l * b0;
+ boolean flag = j1 < 0;
+ this.worldServerInstance.setBlock(
+ k1, l1, i2, flag ? Dimension_Australia.blockPortalFrame : Blocks.air);
+ }
+ }
+ }
+
+ par1Entity.setLocationAndAngles(i, j, k, par1Entity.rotationYaw, 0.0F);
+ par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
+ }
+ }
+
+ /**
+ * Place an entity in a nearby portal which already exists.
+ */
+ @Override
+ public boolean placeInExistingPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
+ short short1 = 128;
+ double d3 = -1.0D;
+ int i = 0;
+ int j = 0;
+ int k = 0;
+ int l = MathHelper.floor_double(par1Entity.posX);
+ int i1 = MathHelper.floor_double(par1Entity.posZ);
+ long j1 = ChunkCoordIntPair.chunkXZ2Int(l, i1);
+ boolean flag = true;
+ double d7;
+ int l3;
+
+ if (this.destinationCoordinateCache.containsItem(j1)) {
+ Teleporter.PortalPosition portalposition =
+ (Teleporter.PortalPosition) this.destinationCoordinateCache.getValueByKey(j1);
+ d3 = 0.0D;
+ i = portalposition.posX;
+ j = portalposition.posY;
+ k = portalposition.posZ;
+ portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
+ flag = false;
+ } else {
+ for (l3 = l - short1; l3 <= l + short1; ++l3) {
+ double d4 = l3 + 0.5D - par1Entity.posX;
+
+ for (int l1 = i1 - short1; l1 <= i1 + short1; ++l1) {
+ double d5 = l1 + 0.5D - par1Entity.posZ;
+
+ for (int i2 = this.worldServerInstance.getActualHeight() - 1; i2 >= 0; --i2) {
+ if (this.worldServerInstance.getBlock(l3, i2, l1) == Dimension_Australia.portalBlock) {
+ while (this.worldServerInstance.getBlock(l3, i2 - 1, l1)
+ == Dimension_Australia.portalBlock) {
+ --i2;
+ }
+
+ d7 = i2 + 0.5D - par1Entity.posY;
+ double d8 = d4 * d4 + d7 * d7 + d5 * d5;
+
+ if (d3 < 0.0D || d8 < d3) {
+ d3 = d8;
+ i = l3;
+ j = i2;
+ k = l1;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (d3 >= 0.0D) {
+ if (flag) {
+ this.destinationCoordinateCache.add(
+ j1, new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime()));
+ this.destinationCoordinateKeys.add(Long.valueOf(j1));
+ }
+
+ double d11 = i + 0.5D;
+ double d6 = j + 0.5D;
+ d7 = k + 0.5D;
+ int i4 = -1;
+
+ if (this.worldServerInstance.getBlock(i - 1, j, k) == Dimension_Australia.portalBlock) {
+ i4 = 2;
+ }
+
+ if (this.worldServerInstance.getBlock(i + 1, j, k) == Dimension_Australia.portalBlock) {
+ i4 = 0;
+ }
+
+ if (this.worldServerInstance.getBlock(i, j, k - 1) == Dimension_Australia.portalBlock) {
+ i4 = 3;
+ }
+
+ if (this.worldServerInstance.getBlock(i, j, k + 1) == Dimension_Australia.portalBlock) {
+ i4 = 1;
+ }
+
+ int j2 = par1Entity.getTeleportDirection();
+
+ if (i4 > -1) {
+ int k2 = Direction.rotateLeft[i4];
+ int l2 = Direction.offsetX[i4];
+ int i3 = Direction.offsetZ[i4];
+ int j3 = Direction.offsetX[k2];
+ int k3 = Direction.offsetZ[k2];
+ boolean flag1 = !this.worldServerInstance.isAirBlock(i + l2 + j3, j, k + i3 + k3)
+ || !this.worldServerInstance.isAirBlock(i + l2 + j3, j + 1, k + i3 + k3);
+ boolean flag2 = !this.worldServerInstance.isAirBlock(i + l2, j, k + i3)
+ || !this.worldServerInstance.isAirBlock(i + l2, j + 1, k + i3);
+
+ if (flag1 && flag2) {
+ i4 = Direction.rotateOpposite[i4];
+ k2 = Direction.rotateOpposite[k2];
+ l2 = Direction.offsetX[i4];
+ i3 = Direction.offsetZ[i4];
+ j3 = Direction.offsetX[k2];
+ k3 = Direction.offsetZ[k2];
+ l3 = i - j3;
+ d11 -= j3;
+ int k1 = k - k3;
+ d7 -= k3;
+ flag1 = !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j, k1 + i3 + k3)
+ || !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j + 1, k1 + i3 + k3);
+ flag2 = !this.worldServerInstance.isAirBlock(l3 + l2, j, k1 + i3)
+ || !this.worldServerInstance.isAirBlock(l3 + l2, j + 1, k1 + i3);
+ }
+
+ float f1 = 0.5F;
+ float f2 = 0.5F;
+
+ if (!flag1 && flag2) {
+ f1 = 1.0F;
+ } else if (flag1 && !flag2) {
+ f1 = 0.0F;
+ } else if (flag1 && flag2) {
+ f2 = 0.0F;
+ }
+
+ d11 += j3 * f1 + f2 * l2;
+ d7 += k3 * f1 + f2 * i3;
+ float f3 = 0.0F;
+ float f4 = 0.0F;
+ float f5 = 0.0F;
+ float f6 = 0.0F;
+
+ if (i4 == j2) {
+ f3 = 1.0F;
+ f4 = 1.0F;
+ } else if (i4 == Direction.rotateOpposite[j2]) {
+ f3 = -1.0F;
+ f4 = -1.0F;
+ } else if (i4 == Direction.rotateRight[j2]) {
+ f5 = 1.0F;
+ f6 = -1.0F;
+ } else {
+ f5 = -1.0F;
+ f6 = 1.0F;
+ }
+
+ double d9 = par1Entity.motionX;
+ double d10 = par1Entity.motionZ;
+ par1Entity.motionX = d9 * f3 + d10 * f6;
+ par1Entity.motionZ = d9 * f5 + d10 * f4;
+ par1Entity.rotationYaw = par8 - j2 * 90 + i4 * 90;
+ } else {
+ par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
+ }
+
+ par1Entity.setLocationAndAngles(d11, d6, d7, par1Entity.rotationYaw, par1Entity.rotationPitch);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean makePortal(Entity par1Entity) {
+ byte b0 = 16;
+ double d0 = -1.0D;
+ int i = MathHelper.floor_double(par1Entity.posX);
+ int j = MathHelper.floor_double(par1Entity.posY);
+ int k = MathHelper.floor_double(par1Entity.posZ);
+ int l = i;
+ int i1 = j;
+ int j1 = k;
+ int k1 = 0;
+ int l1 = this.random.nextInt(4);
+ int i2;
+ double d1;
+ double d2;
+ int k2;
+ int i3;
+ int k3;
+ int j3;
+ int i4;
+ int l3;
+ int k4;
+ int j4;
+ int i5;
+ int l4;
+ double d3;
+ double d4;
+
+ for (i2 = i - b0; i2 <= i + b0; ++i2) {
+ d1 = i2 + 0.5D - par1Entity.posX;
+
+ for (k2 = k - b0; k2 <= k + b0; ++k2) {
+ d2 = k2 + 0.5D - par1Entity.posZ;
+ label274:
+ for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) {
+ if (this.worldServerInstance.isAirBlock(i2, i3, k2)) {
+ while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) {
+ --i3;
+ }
+
+ for (j3 = l1; j3 < l1 + 4; ++j3) {
+ k3 = j3 % 2;
+ l3 = 1 - k3;
+
+ if (j3 % 4 >= 2) {
+ k3 = -k3;
+ l3 = -l3;
+ }
+
+ for (i4 = 0; i4 < 3; ++i4) {
+ for (j4 = 0; j4 < 4; ++j4) {
+ for (k4 = -1; k4 < 4; ++k4) {
+ l4 = i2 + (j4 - 1) * k3 + i4 * l3;
+ i5 = i3 + k4;
+ int j5 = k2 + (j4 - 1) * l3 - i4 * k3;
+
+ if (k4 < 0
+ && !this.worldServerInstance
+ .getBlock(l4, i5, j5)
+ .getMaterial()
+ .isSolid()
+ || k4 >= 0 && !this.worldServerInstance.isAirBlock(l4, i5, j5)) {
+ continue label274;
+ }
+ }
+ }
+ }
+
+ d4 = i3 + 0.5D - par1Entity.posY;
+ d3 = d1 * d1 + d4 * d4 + d2 * d2;
+
+ if (d0 < 0.0D || d3 < d0) {
+ d0 = d3;
+ l = i2;
+ i1 = i3;
+ j1 = k2;
+ k1 = j3 % 4;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (d0 < 0.0D) {
+ for (i2 = i - b0; i2 <= i + b0; ++i2) {
+ d1 = i2 + 0.5D - par1Entity.posX;
+
+ for (k2 = k - b0; k2 <= k + b0; ++k2) {
+ d2 = k2 + 0.5D - par1Entity.posZ;
+ label222:
+ for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) {
+ if (this.worldServerInstance.isAirBlock(i2, i3, k2)) {
+ while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) {
+ --i3;
+ }
+
+ for (j3 = l1; j3 < l1 + 2; ++j3) {
+ k3 = j3 % 2;
+ l3 = 1 - k3;
+
+ for (i4 = 0; i4 < 4; ++i4) {
+ for (j4 = -1; j4 < 4; ++j4) {
+ k4 = i2 + (i4 - 1) * k3;
+ l4 = i3 + j4;
+ i5 = k2 + (i4 - 1) * l3;
+
+ if (j4 < 0
+ && !this.worldServerInstance
+ .getBlock(k4, l4, i5)
+ .getMaterial()
+ .isSolid()
+ || j4 >= 0 && !this.worldServerInstance.isAirBlock(k4, l4, i5)) {
+ continue label222;
+ }
+ }
+ }
+
+ d4 = i3 + 0.5D - par1Entity.posY;
+ d3 = d1 * d1 + d4 * d4 + d2 * d2;
+
+ if (d0 < 0.0D || d3 < d0) {
+ d0 = d3;
+ l = i2;
+ i1 = i3;
+ j1 = k2;
+ k1 = j3 % 2;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ int k5 = l;
+ int j2 = i1;
+ k2 = j1;
+ int l5 = k1 % 2;
+ int l2 = 1 - l5;
+
+ if (k1 % 4 >= 2) {
+ l5 = -l5;
+ l2 = -l2;
+ }
+
+ boolean flag;
+
+ if (d0 < 0.0D) {
+ if (i1 < 70) {
+ i1 = 70;
+ }
+
+ if (i1 > this.worldServerInstance.getActualHeight() - 10) {
+ i1 = this.worldServerInstance.getActualHeight() - 10;
+ }
+
+ j2 = i1;
+
+ for (i3 = -1; i3 <= 1; ++i3) {
+ for (j3 = 1; j3 < 3; ++j3) {
+ for (k3 = -1; k3 < 3; ++k3) {
+ l3 = k5 + (j3 - 1) * l5 + i3 * l2;
+ i4 = j2 + k3;
+ j4 = k2 + (j3 - 1) * l2 - i3 * l5;
+ flag = k3 < 0;
+ this.worldServerInstance.setBlock(
+ l3, i4, j4, flag ? Dimension_Australia.blockPortalFrame : Blocks.air);
+ }
+ }
+ }
+ }
+
+ for (i3 = 0; i3 < 4; ++i3) {
+ for (j3 = 0; j3 < 4; ++j3) {
+ for (k3 = -1; k3 < 4; ++k3) {
+ l3 = k5 + (j3 - 1) * l5;
+ i4 = j2 + k3;
+ j4 = k2 + (j3 - 1) * l2;
+ flag = j3 == 0 || j3 == 3 || k3 == -1 || k3 == 3;
+ this.worldServerInstance.setBlock(
+ l3,
+ i4,
+ j4,
+ flag ? Dimension_Australia.blockPortalFrame : Dimension_Australia.portalBlock,
+ 0,
+ 2);
+ }
+ }
+
+ for (j3 = 0; j3 < 4; ++j3) {
+ for (k3 = -1; k3 < 4; ++k3) {
+ l3 = k5 + (j3 - 1) * l5;
+ i4 = j2 + k3;
+ j4 = k2 + (j3 - 1) * l2;
+ this.worldServerInstance.notifyBlocksOfNeighborChange(
+ l3, i4, j4, this.worldServerInstance.getBlock(l3, i4, j4));
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * called periodically to remove out-of-date portal locations from the
+ * cache list. Argument par1 is a WorldServer.getTotalWorldTime() value.
+ */
+ @Override
+ public void removeStalePortalLocations(long par1) {
+ if (par1 % 100L == 0L) {
+ @SuppressWarnings("rawtypes")
+ Iterator iterator = this.destinationCoordinateKeys.iterator();
+ long j = par1 - 600L;
+
+ while (iterator.hasNext()) {
+ Long olong = (Long) iterator.next();
+ Teleporter.PortalPosition portalposition =
+ (Teleporter.PortalPosition) this.destinationCoordinateCache.getValueByKey(olong.longValue());
+
+ if (portalposition == null || portalposition.lastUpdateTime < j) {
+ iterator.remove();
+ this.destinationCoordinateCache.remove(olong.longValue());
+ }
+ }
+ }
+ }
+
+ public class PortalPosition extends ChunkCoordinates {
+ /**
+ * The worldtime at which this PortalPosition was last verified
+ */
+ public long lastUpdateTime;
+
+ public PortalPosition(int par2, int par3, int par4, long par5) {
+ super(par2, par3, par4);
+ this.lastUpdateTime = par5;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/world/AustraliaWorldChunkManager.java b/src/main/java/gtPlusPlus/australia/world/AustraliaWorldChunkManager.java
index f0bd35a8b9..2b3a02203f 100644
--- a/src/main/java/gtPlusPlus/australia/world/AustraliaWorldChunkManager.java
+++ b/src/main/java/gtPlusPlus/australia/world/AustraliaWorldChunkManager.java
@@ -1,12 +1,11 @@
package gtPlusPlus.australia.world;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.australia.biome.GenLayerAustralia;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.util.ReportedException;
@@ -18,240 +17,224 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
-import gtPlusPlus.australia.biome.GenLayerAustralia;
public class AustraliaWorldChunkManager extends WorldChunkManager {
- private GenLayer genBiomes;
- /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
- private GenLayer biomeIndexLayer;
- /** The BiomeCache object for this world. */
- private BiomeCache biomeCache;
- /** A list of biomes that the player can spawn in. */
- private List<BiomeGenBase> biomesToSpawnIn;
-
- @SuppressWarnings({ "rawtypes" })
- public AustraliaWorldChunkManager() {
- this.biomeCache = new BiomeCache(this);
- this.biomesToSpawnIn = new ArrayList();
- this.biomesToSpawnIn.addAll(allowedBiomes); // TODO
- }
-
- public AustraliaWorldChunkManager(long seed, WorldType worldType) {
- this();
- // i changed this to my GenLayerDarkWorld
- GenLayer[] agenlayer = GenLayerAustralia.makeTheWorld(seed, worldType);
-
- agenlayer = getModdedBiomeGenerators(worldType, seed, agenlayer);
- this.genBiomes = agenlayer[0];
- this.biomeIndexLayer = agenlayer[1];
-
-
-
- }
-
- public AustraliaWorldChunkManager(World world) {
- this(world.getSeed(), world.getWorldInfo().getTerrainType());
-
- }
-
- /**
- * Gets the list of valid biomes for the player to spawn in.
- */
- @Override
- public List<BiomeGenBase> getBiomesToSpawnIn() {
- return this.biomesToSpawnIn;
- }
-
- /**
- * Returns a list of rainfall values for the specified blocks. Args:
- * listToReuse, x, z, width, length.
- */
- @Override
- public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length) {
- IntCache.resetIntCache();
-
- if ((listToReuse == null) || (listToReuse.length < width * length)) {
- listToReuse = new float[width * length];
- }
- int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);
- for (int i1 = 0; i1 < width * length; i1++) {
- try
- {
- float f = BiomeGenBase.getBiome(aint[i1]).getIntRainfall() / 65536.0F;
- if (f > 1.0F) {
- f = 1.0F;
- }
- listToReuse[i1] = f;
- }
- catch (Throwable throwable)
- {
- CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
- CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock");
- crashreportcategory.addCrashSection("biome id", Integer.valueOf(i1));
- crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(listToReuse.length));
- crashreportcategory.addCrashSection("x", Integer.valueOf(x));
- crashreportcategory.addCrashSection("z", Integer.valueOf(z));
- crashreportcategory.addCrashSection("w", Integer.valueOf(width));
- crashreportcategory.addCrashSection("h", Integer.valueOf(length));
- throw new ReportedException(crashreport);
- }
- }
- return listToReuse;
- }
-
- /**
- * Return an adjusted version of a given temperature based on the y
- * height
- */
- @Override
- @SideOnly(Side.CLIENT)
- public float getTemperatureAtHeight(float par1, int par2) {
- return par1;
- }
-
- /**
- * Returns an array of biomes for the location input.
- */
- @Override
- public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) {
- IntCache.resetIntCache();
-
- if ((par1ArrayOfBiomeGenBase == null) || (par1ArrayOfBiomeGenBase.length < par4 * par5)) {
- par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
- }
- int[] aint = this.genBiomes.getInts(par2, par3, par4, par5);
- try
- {
- for (int i = 0; i < par4 * par5; i++) {
- par1ArrayOfBiomeGenBase[i] = BiomeGenBase.getBiome(aint[i]);
- }
- return par1ArrayOfBiomeGenBase;
- }
- catch (Throwable throwable)
- {
- CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
- CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
- crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(par1ArrayOfBiomeGenBase.length));
- crashreportcategory.addCrashSection("x", Integer.valueOf(par2));
- crashreportcategory.addCrashSection("z", Integer.valueOf(par3));
- crashreportcategory.addCrashSection("w", Integer.valueOf(par4));
- crashreportcategory.addCrashSection("h", Integer.valueOf(par5));
- throw new ReportedException(crashreport);
- }
-
- }
-
- /**
- * Returns biomes to use for the blocks and loads the other data like
- * temperature and humidity onto the WorldChunkManager Args:
- * oldBiomeList, x, z, width, depth
- */
- @Override
- public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth) {
- return this.getBiomeGenAt(oldBiomeList, x, z, width, depth, true);
- }
-
- /**
- * Return a list of biomes for the specified blocks. Args: listToReuse,
- * x, y, width, length, cacheFlag (if false, don't check biomeCache to
- * avoid infinite loop in BiomeCacheBlock)
- */
- @Override
- public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] listToReuse, int x, int y, int width, int length, boolean cacheFlag) {
- IntCache.resetIntCache();
- if ((listToReuse == null) || (listToReuse.length < width * length)) {
- listToReuse = new BiomeGenBase[width * length];
- }
- if ((cacheFlag) && (width == 16) && (length == 16) && ((x & 0xF) == 0) && ((y & 0xF) == 0))
- {
- BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(x, y);
- System.arraycopy(abiomegenbase1, 0, listToReuse, 0, width * length);
- return listToReuse;
- }
- int[] aint = this.biomeIndexLayer.getInts(x, y, width, length);
- for (int i = 0; i < width * length; i++) {
- listToReuse[i] = BiomeGenBase.getBiome(aint[i]);
- }
- return listToReuse;
- }
-
- /**
- * checks given Chunk's Biomes against List of allowed ones
- */
- @Override
- @SuppressWarnings("rawtypes")
- public boolean areBiomesViable(int x, int y, int z, List par4List) {
- IntCache.resetIntCache();
- int l = x - z >> 2;
- int i1 = y - z >> 2;
- int j1 = x + z >> 2;
- int k1 = y + z >> 2;
- int l1 = j1 - l + 1;
- int i2 = k1 - i1 + 1;
- int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
- try
- {
- for (int j2 = 0; j2 < l1 * i2; j2++)
- {
- BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[j2]);
- if (!par4List.contains(biomegenbase)) {
- return false;
- }
- }
- return true;
- }
- catch (Throwable throwable)
- {
- CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
- CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer");
- crashreportcategory.addCrashSection("Layer", this.genBiomes.toString());
- crashreportcategory.addCrashSection("x", Integer.valueOf(x));
- crashreportcategory.addCrashSection("z", Integer.valueOf(y));
- crashreportcategory.addCrashSection("radius", Integer.valueOf(z));
- crashreportcategory.addCrashSection("allowed", par4List);
- throw new ReportedException(crashreport);
- }
- }
-
- /**
- * Finds a valid position within a range, that is in one of the listed
- * biomes. Searches {par1,par2} +-par3 blocks. Strongly favors positive
- * y positions.
- */
- @Override
- @SuppressWarnings("rawtypes")
- public ChunkPosition findBiomePosition(int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, Random p_150795_5_) {
- IntCache.resetIntCache();
- int l = p_150795_1_ - p_150795_3_ >> 2;
- int i1 = p_150795_2_ - p_150795_3_ >> 2;
- int j1 = p_150795_1_ + p_150795_3_ >> 2;
- int k1 = p_150795_2_ + p_150795_3_ >> 2;
- int l1 = j1 - l + 1;
- int i2 = k1 - i1 + 1;
- int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
- ChunkPosition chunkposition = null;
- int j2 = 0;
- for (int k2 = 0; k2 < l1 * i2; k2++)
- {
- int l2 = l + k2 % l1 << 2;
- int i3 = i1 + k2 / l1 << 2;
- BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[k2]);
- if ((p_150795_4_.contains(biomegenbase)) && ((chunkposition == null) || (p_150795_5_.nextInt(j2 + 1) == 0)))
- {
- chunkposition = new ChunkPosition(l2, 0, i3);
- j2++;
- }
- }
- return chunkposition;
- }
-
- /**
- * Calls the WorldChunkManager's biomeCache.cleanupCache()
- */
- @Override
- public void cleanupCache() {
- this.biomeCache.cleanupCache();
- }
-
-} \ No newline at end of file
+ private GenLayer genBiomes;
+ /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
+ private GenLayer biomeIndexLayer;
+ /** The BiomeCache object for this world. */
+ private BiomeCache biomeCache;
+ /** A list of biomes that the player can spawn in. */
+ private List<BiomeGenBase> biomesToSpawnIn;
+
+ @SuppressWarnings({"rawtypes"})
+ public AustraliaWorldChunkManager() {
+ this.biomeCache = new BiomeCache(this);
+ this.biomesToSpawnIn = new ArrayList();
+ this.biomesToSpawnIn.addAll(allowedBiomes); // TODO
+ }
+
+ public AustraliaWorldChunkManager(long seed, WorldType worldType) {
+ this();
+ // i changed this to my GenLayerDarkWorld
+ GenLayer[] agenlayer = GenLayerAustralia.makeTheWorld(seed, worldType);
+
+ agenlayer = getModdedBiomeGenerators(worldType, seed, agenlayer);
+ this.genBiomes = agenlayer[0];
+ this.biomeIndexLayer = agenlayer[1];
+ }
+
+ public AustraliaWorldChunkManager(World world) {
+ this(world.getSeed(), world.getWorldInfo().getTerrainType());
+ }
+
+ /**
+ * Gets the list of valid biomes for the player to spawn in.
+ */
+ @Override
+ public List<BiomeGenBase> getBiomesToSpawnIn() {
+ return this.biomesToSpawnIn;
+ }
+
+ /**
+ * Returns a list of rainfall values for the specified blocks. Args:
+ * listToReuse, x, z, width, length.
+ */
+ @Override
+ public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length) {
+ IntCache.resetIntCache();
+
+ if ((listToReuse == null) || (listToReuse.length < width * length)) {
+ listToReuse = new float[width * length];
+ }
+ int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);
+ for (int i1 = 0; i1 < width * length; i1++) {
+ try {
+ float f = BiomeGenBase.getBiome(aint[i1]).getIntRainfall() / 65536.0F;
+ if (f > 1.0F) {
+ f = 1.0F;
+ }
+ listToReuse[i1] = f;
+ } catch (Throwable throwable) {
+ CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
+ CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock");
+ crashreportcategory.addCrashSection("biome id", Integer.valueOf(i1));
+ crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(listToReuse.length));
+ crashreportcategory.addCrashSection("x", Integer.valueOf(x));
+ crashreportcategory.addCrashSection("z", Integer.valueOf(z));
+ crashreportcategory.addCrashSection("w", Integer.valueOf(width));
+ crashreportcategory.addCrashSection("h", Integer.valueOf(length));
+ throw new ReportedException(crashreport);
+ }
+ }
+ return listToReuse;
+ }
+
+ /**
+ * Return an adjusted version of a given temperature based on the y
+ * height
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public float getTemperatureAtHeight(float par1, int par2) {
+ return par1;
+ }
+
+ /**
+ * Returns an array of biomes for the location input.
+ */
+ @Override
+ public BiomeGenBase[] getBiomesForGeneration(
+ BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) {
+ IntCache.resetIntCache();
+
+ if ((par1ArrayOfBiomeGenBase == null) || (par1ArrayOfBiomeGenBase.length < par4 * par5)) {
+ par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
+ }
+ int[] aint = this.genBiomes.getInts(par2, par3, par4, par5);
+ try {
+ for (int i = 0; i < par4 * par5; i++) {
+ par1ArrayOfBiomeGenBase[i] = BiomeGenBase.getBiome(aint[i]);
+ }
+ return par1ArrayOfBiomeGenBase;
+ } catch (Throwable throwable) {
+ CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
+ CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
+ crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(par1ArrayOfBiomeGenBase.length));
+ crashreportcategory.addCrashSection("x", Integer.valueOf(par2));
+ crashreportcategory.addCrashSection("z", Integer.valueOf(par3));
+ crashreportcategory.addCrashSection("w", Integer.valueOf(par4));
+ crashreportcategory.addCrashSection("h", Integer.valueOf(par5));
+ throw new ReportedException(crashreport);
+ }
+ }
+
+ /**
+ * Returns biomes to use for the blocks and loads the other data like
+ * temperature and humidity onto the WorldChunkManager Args:
+ * oldBiomeList, x, z, width, depth
+ */
+ @Override
+ public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth) {
+ return this.getBiomeGenAt(oldBiomeList, x, z, width, depth, true);
+ }
+
+ /**
+ * Return a list of biomes for the specified blocks. Args: listToReuse,
+ * x, y, width, length, cacheFlag (if false, don't check biomeCache to
+ * avoid infinite loop in BiomeCacheBlock)
+ */
+ @Override
+ public BiomeGenBase[] getBiomeGenAt(
+ BiomeGenBase[] listToReuse, int x, int y, int width, int length, boolean cacheFlag) {
+ IntCache.resetIntCache();
+ if ((listToReuse == null) || (listToReuse.length < width * length)) {
+ listToReuse = new BiomeGenBase[width * length];
+ }
+ if ((cacheFlag) && (width == 16) && (length == 16) && ((x & 0xF) == 0) && ((y & 0xF) == 0)) {
+ BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(x, y);
+ System.arraycopy(abiomegenbase1, 0, listToReuse, 0, width * length);
+ return listToReuse;
+ }
+ int[] aint = this.biomeIndexLayer.getInts(x, y, width, length);
+ for (int i = 0; i < width * length; i++) {
+ listToReuse[i] = BiomeGenBase.getBiome(aint[i]);
+ }
+ return listToReuse;
+ }
+
+ /**
+ * checks given Chunk's Biomes against List of allowed ones
+ */
+ @Override
+ @SuppressWarnings("rawtypes")
+ public boolean areBiomesViable(int x, int y, int z, List par4List) {
+ IntCache.resetIntCache();
+ int l = x - z >> 2;
+ int i1 = y - z >> 2;
+ int j1 = x + z >> 2;
+ int k1 = y + z >> 2;
+ int l1 = j1 - l + 1;
+ int i2 = k1 - i1 + 1;
+ int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
+ try {
+ for (int j2 = 0; j2 < l1 * i2; j2++) {
+ BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[j2]);
+ if (!par4List.contains(biomegenbase)) {
+ return false;
+ }
+ }
+ return true;
+ } catch (Throwable throwable) {
+ CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
+ CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer");
+ crashreportcategory.addCrashSection("Layer", this.genBiomes.toString());
+ crashreportcategory.addCrashSection("x", Integer.valueOf(x));
+ crashreportcategory.addCrashSection("z", Integer.valueOf(y));
+ crashreportcategory.addCrashSection("radius", Integer.valueOf(z));
+ crashreportcategory.addCrashSection("allowed", par4List);
+ throw new ReportedException(crashreport);
+ }
+ }
+
+ /**
+ * Finds a valid position within a range, that is in one of the listed
+ * biomes. Searches {par1,par2} +-par3 blocks. Strongly favors positive
+ * y positions.
+ */
+ @Override
+ @SuppressWarnings("rawtypes")
+ public ChunkPosition findBiomePosition(
+ int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, Random p_150795_5_) {
+ IntCache.resetIntCache();
+ int l = p_150795_1_ - p_150795_3_ >> 2;
+ int i1 = p_150795_2_ - p_150795_3_ >> 2;
+ int j1 = p_150795_1_ + p_150795_3_ >> 2;
+ int k1 = p_150795_2_ + p_150795_3_ >> 2;
+ int l1 = j1 - l + 1;
+ int i2 = k1 - i1 + 1;
+ int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
+ ChunkPosition chunkposition = null;
+ int j2 = 0;
+ for (int k2 = 0; k2 < l1 * i2; k2++) {
+ int l2 = l + k2 % l1 << 2;
+ int i3 = i1 + k2 / l1 << 2;
+ BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[k2]);
+ if ((p_150795_4_.contains(biomegenbase))
+ && ((chunkposition == null) || (p_150795_5_.nextInt(j2 + 1) == 0))) {
+ chunkposition = new ChunkPosition(l2, 0, i3);
+ j2++;
+ }
+ }
+ return chunkposition;
+ }
+
+ /**
+ * Calls the WorldChunkManager's biomeCache.cleanupCache()
+ */
+ @Override
+ public void cleanupCache() {
+ this.biomeCache.cleanupCache();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/world/AustraliaWorldGenerator.java b/src/main/java/gtPlusPlus/australia/world/AustraliaWorldGenerator.java
index 93112bb30f..d3fe343d80 100644
--- a/src/main/java/gtPlusPlus/australia/world/AustraliaWorldGenerator.java
+++ b/src/main/java/gtPlusPlus/australia/world/AustraliaWorldGenerator.java
@@ -2,14 +2,11 @@ package gtPlusPlus.australia.world;
import cpw.mods.fml.common.IWorldGenerator;
import gtPlusPlus.api.interfaces.IGeneratorWorld;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.australia.GTplusplus_Australia;
-import gtPlusPlus.australia.gen.map.MapGenExtendedVillage;
import gtPlusPlus.australia.gen.map.component.ComponentHut.WorldHandlerHut;
import gtPlusPlus.australia.gen.map.component.ComponentShack.WorldHandlerShack;
import gtPlusPlus.core.lib.CORE;
-
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
@@ -17,126 +14,132 @@ import java.util.List;
import java.util.Random;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
-import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.IChunkProvider;
public class AustraliaWorldGenerator implements IWorldGenerator {
- private LinkedList<ChunkCoordIntPair> structuresList = new LinkedList<ChunkCoordIntPair>();
- //private final WorldHandlerCoven covenGen;
- //private final WorldHandlerWickerMan wickerManGen;
- private final WorldHandlerShack shackGen;
- private final WorldHandlerHut hutGen;
- private final List<IGeneratorWorld> generators;
- private int midX;
- private int midZ;
- int field_82665_g;
- int field_82666_h = 8;
-
- public static final AutoMap<Integer> SHACK_ALLOWED_BIOMES = new AutoMap<Integer>();
- public static final AutoMap<Integer> HUT_ALLOWED_BIOMES = new AutoMap<Integer>();
- public static final AutoMap<Integer> ALLOWED_BIOMES = new AutoMap<Integer>();
-
- public AustraliaWorldGenerator() {
-
- SHACK_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Plains_Biome.biomeID);
- SHACK_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Forest_Biome.biomeID);
- HUT_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Desert_Biome_3.biomeID);
- HUT_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Outback_Biome.biomeID);
-
- ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Plains_Biome.biomeID);
- ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Forest_Biome.biomeID);
- ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Desert_Biome_3.biomeID);
- ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Outback_Biome.biomeID);
-
-
- this.shackGen = new WorldHandlerShack(3);
- this.hutGen = new WorldHandlerHut(5);
-
- //IGeneratorWorld goblinHut = new WorldHandlerClonedStructure(ComponentGoblinHut.class, 1.0D, 400, 7, 7, 7);
- this.generators = Arrays
- .asList(new IGeneratorWorld[] { this.shackGen, this.hutGen });
-
- this.field_82665_g = (8 + Math.max(gtPlusPlus.core.util.math.MathUtils.randInt(/*Config.instance().worldGenFrequency*/32, 64), 1));
-
- this.midX = 0;
- this.midZ = 0;
- for (IGeneratorWorld gen : this.generators) {
- this.midX = Math.max(this.midX, gen.getExtentX() / 2);
- this.midZ = Math.max(this.midZ, gen.getExtentZ() / 2);
- }
- }
-
- public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
- IChunkProvider chunkProvider) {
- if (world.provider.dimensionId == CORE.AUSTRALIA_ID) {
- generateOverworld(world, world.rand, chunkX * 16, chunkZ * 16);
- }
- }
-
- private void generateOverworld(World world, Random random, int x, int z) {
- boolean gen = false;
- try {
- if (ALLOWED_BIOMES.containsValue(Integer.valueOf(world.getBiomeGenForCoords(x + this.midX, z + this.midZ).biomeID))) {
- Collections.shuffle(this.generators, random);
- for (IGeneratorWorld generator : this.generators) {
- boolean canGenerate = false;
-
- if (generator instanceof WorldHandlerShack) {
- if (SHACK_ALLOWED_BIOMES.containsValue(Integer.valueOf(world.getBiomeGenForCoords(x + this.midX, z + this.midZ).biomeID))) {
- canGenerate = true;
- }
- }
- else if (generator instanceof WorldHandlerHut) {
- if (HUT_ALLOWED_BIOMES.containsValue(Integer.valueOf(world.getBiomeGenForCoords(x + this.midX, z + this.midZ).biomeID))) {
- canGenerate = true;
- }
- }
-
- if (canGenerate) {
- //Logger.WORLD("Running World Generator on Australia.");
- boolean a1, a2;
- a1 = generator.generate(world, random, x, z);
- a2 = nonInRange(world, x, z, generator.getRange());
- //Logger.INFO("A1: "+a1+" | A2: "+a2);
- if (a1 && a2) {
- this.structuresList.add(new ChunkCoordIntPair(x, z));
- gen = true;
- //Logger.INFO("Generated a structure");
- break;
- }
- }
- }
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- protected boolean nonInRange(World worldObj, int x, int z, int range) {
- int par1 = x / 16;
- int par2 = z / 16;
-
- int k = par1;
- int l = par2;
- if (par1 < 0) {
- par1 -= this.field_82665_g - 1;
- }
- if (par2 < 0) {
- par2 -= this.field_82665_g - 1;
- }
- int i1 = par1 / this.field_82665_g;
- int j1 = par2 / this.field_82665_g;
- Random random = worldObj.setRandomSeed(i1, j1, 10387312);
- i1 *= this.field_82665_g;
- j1 *= this.field_82665_g;
- i1 += random.nextInt(this.field_82665_g - this.field_82666_h);
- j1 += random.nextInt(this.field_82665_g - this.field_82666_h);
-
- return (k == i1) && (l == j1);
- }
-
- public void initiate() {
- this.structuresList.clear();
- }
+ private LinkedList<ChunkCoordIntPair> structuresList = new LinkedList<ChunkCoordIntPair>();
+ // private final WorldHandlerCoven covenGen;
+ // private final WorldHandlerWickerMan wickerManGen;
+ private final WorldHandlerShack shackGen;
+ private final WorldHandlerHut hutGen;
+ private final List<IGeneratorWorld> generators;
+ private int midX;
+ private int midZ;
+ int field_82665_g;
+ int field_82666_h = 8;
+
+ public static final AutoMap<Integer> SHACK_ALLOWED_BIOMES = new AutoMap<Integer>();
+ public static final AutoMap<Integer> HUT_ALLOWED_BIOMES = new AutoMap<Integer>();
+ public static final AutoMap<Integer> ALLOWED_BIOMES = new AutoMap<Integer>();
+
+ public AustraliaWorldGenerator() {
+
+ SHACK_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Plains_Biome.biomeID);
+ SHACK_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Forest_Biome.biomeID);
+ HUT_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Desert_Biome_3.biomeID);
+ HUT_ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Outback_Biome.biomeID);
+
+ ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Plains_Biome.biomeID);
+ ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Forest_Biome.biomeID);
+ ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Desert_Biome_3.biomeID);
+ ALLOWED_BIOMES.put(GTplusplus_Australia.Australian_Outback_Biome.biomeID);
+
+ this.shackGen = new WorldHandlerShack(3);
+ this.hutGen = new WorldHandlerHut(5);
+
+ // IGeneratorWorld goblinHut = new WorldHandlerClonedStructure(ComponentGoblinHut.class, 1.0D, 400, 7, 7, 7);
+ this.generators = Arrays.asList(new IGeneratorWorld[] {this.shackGen, this.hutGen});
+
+ this.field_82665_g = (8
+ + Math.max(
+ gtPlusPlus.core.util.math.MathUtils.randInt(/*Config.instance().worldGenFrequency*/ 32, 64),
+ 1));
+
+ this.midX = 0;
+ this.midZ = 0;
+ for (IGeneratorWorld gen : this.generators) {
+ this.midX = Math.max(this.midX, gen.getExtentX() / 2);
+ this.midZ = Math.max(this.midZ, gen.getExtentZ() / 2);
+ }
+ }
+
+ public void generate(
+ Random random,
+ int chunkX,
+ int chunkZ,
+ World world,
+ IChunkProvider chunkGenerator,
+ IChunkProvider chunkProvider) {
+ if (world.provider.dimensionId == CORE.AUSTRALIA_ID) {
+ generateOverworld(world, world.rand, chunkX * 16, chunkZ * 16);
+ }
+ }
+
+ private void generateOverworld(World world, Random random, int x, int z) {
+ boolean gen = false;
+ try {
+ if (ALLOWED_BIOMES.containsValue(
+ Integer.valueOf(world.getBiomeGenForCoords(x + this.midX, z + this.midZ).biomeID))) {
+ Collections.shuffle(this.generators, random);
+ for (IGeneratorWorld generator : this.generators) {
+ boolean canGenerate = false;
+
+ if (generator instanceof WorldHandlerShack) {
+ if (SHACK_ALLOWED_BIOMES.containsValue(
+ Integer.valueOf(world.getBiomeGenForCoords(x + this.midX, z + this.midZ).biomeID))) {
+ canGenerate = true;
+ }
+ } else if (generator instanceof WorldHandlerHut) {
+ if (HUT_ALLOWED_BIOMES.containsValue(
+ Integer.valueOf(world.getBiomeGenForCoords(x + this.midX, z + this.midZ).biomeID))) {
+ canGenerate = true;
+ }
+ }
+
+ if (canGenerate) {
+ // Logger.WORLD("Running World Generator on Australia.");
+ boolean a1, a2;
+ a1 = generator.generate(world, random, x, z);
+ a2 = nonInRange(world, x, z, generator.getRange());
+ // Logger.INFO("A1: "+a1+" | A2: "+a2);
+ if (a1 && a2) {
+ this.structuresList.add(new ChunkCoordIntPair(x, z));
+ gen = true;
+ // Logger.INFO("Generated a structure");
+ break;
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ protected boolean nonInRange(World worldObj, int x, int z, int range) {
+ int par1 = x / 16;
+ int par2 = z / 16;
+
+ int k = par1;
+ int l = par2;
+ if (par1 < 0) {
+ par1 -= this.field_82665_g - 1;
+ }
+ if (par2 < 0) {
+ par2 -= this.field_82665_g - 1;
+ }
+ int i1 = par1 / this.field_82665_g;
+ int j1 = par2 / this.field_82665_g;
+ Random random = worldObj.setRandomSeed(i1, j1, 10387312);
+ i1 *= this.field_82665_g;
+ j1 *= this.field_82665_g;
+ i1 += random.nextInt(this.field_82665_g - this.field_82666_h);
+ j1 += random.nextInt(this.field_82665_g - this.field_82666_h);
+
+ return (k == i1) && (l == j1);
+ }
+
+ public void initiate() {
+ this.structuresList.clear();
+ }
}
diff --git a/src/main/java/gtPlusPlus/australia/world/AustraliaWorldProvider.java b/src/main/java/gtPlusPlus/australia/world/AustraliaWorldProvider.java
index af1ca90cc9..39d7db9a0b 100644
--- a/src/main/java/gtPlusPlus/australia/world/AustraliaWorldProvider.java
+++ b/src/main/java/gtPlusPlus/australia/world/AustraliaWorldProvider.java
@@ -2,79 +2,69 @@ package gtPlusPlus.australia.world;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.australia.chunk.ChunkProviderAustralia;
+import gtPlusPlus.australia.dimension.Dimension_Australia;
import net.minecraft.util.Vec3;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldType;
import net.minecraft.world.chunk.IChunkProvider;
-import gtPlusPlus.australia.chunk.ChunkProviderAustralia;
-import gtPlusPlus.australia.dimension.Dimension_Australia;
public class AustraliaWorldProvider extends WorldProvider {
- @Override
- public void registerWorldChunkManager() {
- this.worldChunkMgr = new AustraliaWorldChunkManager(this.worldObj.getSeed(), WorldType.LARGE_BIOMES);
- this.isHellWorld = false;
- this.hasNoSky = false;
- this.dimensionId = Dimension_Australia.DIMID;
- }
+ @Override
+ public void registerWorldChunkManager() {
+ this.worldChunkMgr = new AustraliaWorldChunkManager(this.worldObj.getSeed(), WorldType.LARGE_BIOMES);
+ this.isHellWorld = false;
+ this.hasNoSky = false;
+ this.dimensionId = Dimension_Australia.DIMID;
+ }
+
+ @Override
+ public float getSunBrightness(float par1) {
+ return (par1 * 2F);
+ }
+
+ @Override
+ public float getStarBrightness(float par1) {
+ return (par1 * 5F);
+ }
- @Override
- public float getSunBrightness(float par1) {
- return (par1*2F);
- }
+ @SideOnly(Side.CLIENT)
+ public Vec3 getFogColor(float par1, float par2) {
+ return Vec3.createVectorHelper(0.8D, 0.8D, 0.8D);
+ }
- @Override
- public float getStarBrightness(float par1) {
- return (par1*5F);
- }
-
- @SideOnly(Side.CLIENT)
- public Vec3 getFogColor(float par1, float par2)
- {
- return Vec3.createVectorHelper(0.8D, 0.8D, 0.8D);
+ @Override
+ public IChunkProvider createChunkGenerator() {
+ return new ChunkProviderAustralia(this.worldObj, this.worldObj.getSeed() - 15726L);
}
- @Override
- public IChunkProvider createChunkGenerator() {
- return new ChunkProviderAustralia(this.worldObj, this.worldObj.getSeed() - 15726L);
- }
-
- public boolean isSurfaceWorld()
- {
- return true;
+ public boolean isSurfaceWorld() {
+ return true;
}
-
- public boolean canCoordinateBeSpawn(int par1, int par2)
- {
- return false;
+
+ public boolean canCoordinateBeSpawn(int par1, int par2) {
+ return false;
}
-
- public boolean canRespawnHere()
- {
- return true;
+
+ public boolean canRespawnHere() {
+ return true;
}
-
+
@SideOnly(Side.CLIENT)
- public boolean doesXZShowFog(int par1, int par2)
- {
- return false;
- }
-
- public String getDimensionName()
- {
- return "Australia";
+ public boolean doesXZShowFog(int par1, int par2) {
+ return false;
}
-
- protected void generateLightBrightnessTable()
- {
- float f = 0.5F;
- for (int i = 0; i <= 15; i++)
- {
- float f1 = 1.0F - i / 15.0F;
- this.lightBrightnessTable[i] = ((1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f);
- }
+
+ public String getDimensionName() {
+ return "Australia";
}
-} \ No newline at end of file
+ protected void generateLightBrightnessTable() {
+ float f = 0.5F;
+ for (int i = 0; i <= 15; i++) {
+ float f1 = 1.0F - i / 15.0F;
+ this.lightBrightnessTable[i] = ((1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/australia/world/AustraliaWorldType.java b/src/main/java/gtPlusPlus/australia/world/AustraliaWorldType.java
index e8c8af4f76..71f1db5870 100644
--- a/src/main/java/gtPlusPlus/australia/world/AustraliaWorldType.java
+++ b/src/main/java/gtPlusPlus/australia/world/AustraliaWorldType.java
@@ -3,57 +3,54 @@ package gtPlusPlus.australia.world;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-
import net.minecraft.world.WorldType;
-public class AustraliaWorldType extends WorldType{
-
- public AustraliaWorldType(String name) {
- super(name);
- }
-
- public AustraliaWorldType(int p_i1959_1_, String p_i1959_2_){
- this("test");
- try {
- //System.out.println(Arrays.toString(getClass().getSuperclass().getMethods()));
- Method m = getClass().getSuperclass().getDeclaredMethod("WorldType", new Class<?>[]{});
- m.setAccessible(true);
- m.invoke(this, p_i1959_1_, p_i1959_2_, 0);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public AustraliaWorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_){
- this("test2");
- try {
- //System.out.println(Arrays.toString(getClass().getSuperclass().getMethods()));
- Method m = getClass().getSuperclass().getDeclaredMethod("WorldType", new Class<?>[]{});
- m.setAccessible(true);
- m.invoke(this, p_i1960_1_, p_i1960_2_, p_i1960_3_);
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
- private WorldType getMC(){
- try {
- Constructor<WorldType> c = WorldType.class.getDeclaredConstructor();
- c.setAccessible(true); // solution
- return c.newInstance();
-
- // production code should handle these exceptions more gracefully
- } catch (InvocationTargetException x) {
- x.printStackTrace();
- } catch (NoSuchMethodException x) {
- x.printStackTrace();
- } catch (InstantiationException x) {
- x.printStackTrace();
- } catch (IllegalAccessException x) {
- x.printStackTrace();
- }
- return null;
- }
+public class AustraliaWorldType extends WorldType {
+
+ public AustraliaWorldType(String name) {
+ super(name);
+ }
+
+ public AustraliaWorldType(int p_i1959_1_, String p_i1959_2_) {
+ this("test");
+ try {
+ // System.out.println(Arrays.toString(getClass().getSuperclass().getMethods()));
+ Method m = getClass().getSuperclass().getDeclaredMethod("WorldType", new Class<?>[] {});
+ m.setAccessible(true);
+ m.invoke(this, p_i1959_1_, p_i1959_2_, 0);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public AustraliaWorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_) {
+ this("test2");
+ try {
+ // System.out.println(Arrays.toString(getClass().getSuperclass().getMethods()));
+ Method m = getClass().getSuperclass().getDeclaredMethod("WorldType", new Class<?>[] {});
+ m.setAccessible(true);
+ m.invoke(this, p_i1960_1_, p_i1960_2_, p_i1960_3_);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private WorldType getMC() {
+ try {
+ Constructor<WorldType> c = WorldType.class.getDeclaredConstructor();
+ c.setAccessible(true); // solution
+ return c.newInstance();
+
+ // production code should handle these exceptions more gracefully
+ } catch (InvocationTargetException x) {
+ x.printStackTrace();
+ } catch (NoSuchMethodException x) {
+ x.printStackTrace();
+ } catch (InstantiationException x) {
+ x.printStackTrace();
+ } catch (IllegalAccessException x) {
+ x.printStackTrace();
+ }
+ return null;
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/core/block/ModBlocks.java b/src/main/java/gtPlusPlus/core/block/ModBlocks.java
index 4842cb891e..1a93d35ce2 100644
--- a/src/main/java/gtPlusPlus/core/block/ModBlocks.java
+++ b/src/main/java/gtPlusPlus/core/block/ModBlocks.java
@@ -36,136 +36,136 @@ import net.minecraftforge.fluids.Fluid;
public final class ModBlocks {
- public static Block blockRoundRobinator;
- public static Block blockCircuitProgrammer;
- public static Block blockVolumetricFlaskSetter;
- public static Block blockFakeMiningPipe;
- public static Block blockFakeMiningHead;
-
- public static Block blockFishTrap;
- public static Block blockDecayablesChest;
- public static Block blockEggBox;
-
- //Blocks
- //public static Block blockBloodSteel;
- //public static Block blockStaballoy;
- // WIP TODO public static Block blockToolBuilder;
- public static Block blockGriefSaver;
-
- public static Block blockCasingsMisc;
- public static Block blockCasings2Misc;
- public static Block blockCasings3Misc;
- public static Block blockCasings4Misc;
- public static Block blockCasings5Misc;
- public static Block blockCasingsTieredGTPP;
- public static Block blockSpecialMultiCasings;
- public static Block blockSpecialMultiCasings2;
- public static Block blockCustomMachineCasings;
- public static Block blockCustomPipeGearCasings;
-
- public static Block blockMetaTileEntity;
- public static Block blockHeliumGenerator;
- public static Block blockNHG;
- public static Block blockCharger;
-
- public static Block MatterFabricatorEffectBlock;
-
- public static Fluid fluidSludge = new Fluid("fluid.sludge");
- public static Block blockFluidSludge;
-
- public static Block blockFirePit;
-
- public static Block blockOreFluorite;
-
- public static Block blockMiningExplosive;
-
- public static Block blockHellfire;
- public static Block blockInfiniteFLuidTank;
- public static Block blockProjectTable;
- public static Block blockTradeTable;
- public static Block blockModularTable;
-
- public static Block blockWitherGuard;
- public static Block blockXpConverter;
- public static Block blockCompressedObsidian;
- public static Block blockNet;
-
- public static Block blockPlayerDoorWooden;
- public static Block blockPlayerDoorIron;
- public static Block blockPlayerDoorCustom_Glass;
- public static Block blockPlayerDoorCustom_Ice;
- public static Block blockPlayerDoorCustom_Cactus;
-
- public static Block blockCustomMobSpawner;
- public static Block blockCustomSuperLight;
- public static Block blockCustomJukebox;
-
- public static Block blockPooCollector;
-
- public static Block blockPestKiller;
-
- public static void init() {
- Logger.INFO("Initializing Blocks.");
- //blockGriefSaver = new TowerDevice().setBlockName("blockGriefSaver").setCreativeTab(AddToCreativeTab.tabBlock).setBlockTextureName("blockDefault");
-
- registerBlocks();
- }
-
- public static void registerBlocks(){
-
- Logger.INFO("Registering Blocks.");
- MatterFabricatorEffectBlock = new LightGlass(false);
-
- //Fluids
- FluidRegistryHandler.registerFluids();
-
- //Workbench
- blockHeliumGenerator = new HeliumGenerator();
- blockFirePit = new FirePit();
- blockFishTrap = new FishTrap();
- blockInfiniteFLuidTank = new FluidTankInfinite();
- //blockOreFluorite = new BlockBaseOre.oldOreBlock("oreFluorite", "Fluorite", Material.rock, BlockTypes.ORE, Utils.rgbtoHexValue(120, 120, 30), 3);
- blockMiningExplosive = new MiningExplosives();
- blockHellfire = new HellFire();
- blockProjectTable = new Machine_ProjectTable();
- blockTradeTable = new Machine_TradeTable();
- blockModularTable = new Machine_ModularityTable();
- blockWitherGuard = new BlockWitherProof();
- blockXpConverter = new BlockTankXpConverter();
- blockCompressedObsidian = new BlockCompressedObsidian();
- blockNet = new BlockNet();
-
- blockFakeMiningPipe = new Mining_Pipe_Fake();
- blockFakeMiningHead = new Mining_Head_Fake();
-
- blockCircuitProgrammer = new CircuitProgrammer();
-
- blockDecayablesChest = new DecayablesChest();
- blockEggBox = new EggBox();
-
- blockPlayerDoorWooden = new PlayerDoors(Material.wood, "door_wood", true);
- blockPlayerDoorIron = new PlayerDoors(Material.iron, "door_iron", true);
- blockPlayerDoorCustom_Glass = new PlayerDoors(Material.glass, "door_glass", false);
- blockPlayerDoorCustom_Ice = new PlayerDoors(Material.ice, "door_ice", false);
- blockPlayerDoorCustom_Cactus = new PlayerDoors(Material.cactus, "door_cactus", false, 0.6f, Block.soundTypeGrass, "Cactus");
-
- //blockCustomSuperLight = new BlockSuperLight();
- blockCustomJukebox = new Machine_SuperJukebox();
-
- blockPooCollector = new Machine_PooCollector();
-
- blockPestKiller = new Machine_PestKiller();
-
- blockRoundRobinator = new Machine_RoundRobinator();
-
- if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
- blockVolumetricFlaskSetter = new VolumetricFlaskSetter();
- }
-
- new BlockGenericRedstoneDetector();
- new BlockGenericRedstoneTest();
-
- }
-
-
-} \ No newline at end of file
+ public static Block blockRoundRobinator;
+ public static Block blockCircuitProgrammer;
+ public static Block blockVolumetricFlaskSetter;
+ public static Block blockFakeMiningPipe;
+ public static Block blockFakeMiningHead;
+
+ public static Block blockFishTrap;
+ public static Block blockDecayablesChest;
+ public static Block blockEggBox;
+
+ // Blocks
+ // public static Block blockBloodSteel;
+ // public static Block blockStaballoy;
+ // WIP TODO public static Block blockToolBuilder;
+ public static Block blockGriefSaver;
+
+ public static Block blockCasingsMisc;
+ public static Block blockCasings2Misc;
+ public static Block blockCasings3Misc;
+ public static Block blockCasings4Misc;
+ public static Block blockCasings5Misc;
+ public static Block blockCasingsTieredGTPP;
+ public static Block blockSpecialMultiCasings;
+ public static Block blockSpecialMultiCasings2;
+ public static Block blockCustomMachineCasings;
+ public static Block blockCustomPipeGearCasings;
+
+ public static Block blockMetaTileEntity;
+ public static Block blockHeliumGenerator;
+ public static Block blockNHG;
+ public static Block blockCharger;
+
+ public static Block MatterFabricatorEffectBlock;
+
+ public static Fluid fluidSludge = new Fluid("fluid.sludge");
+ public static Block blockFluidSludge;
+
+ public static Block blockFirePit;
+
+ public static Block blockOreFluorite;
+
+ public static Block blockMiningExplosive;
+
+ public static Block blockHellfire;
+ public static Block blockInfiniteFLuidTank;
+ public static Block blockProjectTable;
+ public static Block blockTradeTable;
+ public static Block blockModularTable;
+
+ public static Block blockWitherGuard;
+ public static Block blockXpConverter;
+ public static Block blockCompressedObsidian;
+ public static Block blockNet;
+
+ public static Block blockPlayerDoorWooden;
+ public static Block blockPlayerDoorIron;
+ public static Block blockPlayerDoorCustom_Glass;
+ public static Block blockPlayerDoorCustom_Ice;
+ public static Block blockPlayerDoorCustom_Cactus;
+
+ public static Block blockCustomMobSpawner;
+ public static Block blockCustomSuperLight;
+ public static Block blockCustomJukebox;
+
+ public static Block blockPooCollector;
+
+ public static Block blockPestKiller;
+
+ public static void init() {
+ Logger.INFO("Initializing Blocks.");
+ // blockGriefSaver = new
+ // TowerDevice().setBlockName("blockGriefSaver").setCreativeTab(AddToCreativeTab.tabBlock).setBlockTextureName("blockDefault");
+
+ registerBlocks();
+ }
+
+ public static void registerBlocks() {
+
+ Logger.INFO("Registering Blocks.");
+ MatterFabricatorEffectBlock = new LightGlass(false);
+
+ // Fluids
+ FluidRegistryHandler.registerFluids();
+
+ // Workbench
+ blockHeliumGenerator = new HeliumGenerator();
+ blockFirePit = new FirePit();
+ blockFishTrap = new FishTrap();
+ blockInfiniteFLuidTank = new FluidTankInfinite();
+ // blockOreFluorite = new BlockBaseOre.oldOreBlock("oreFluorite", "Fluorite", Material.rock, BlockTypes.ORE,
+ // Utils.rgbtoHexValue(120, 120, 30), 3);
+ blockMiningExplosive = new MiningExplosives();
+ blockHellfire = new HellFire();
+ blockProjectTable = new Machine_ProjectTable();
+ blockTradeTable = new Machine_TradeTable();
+ blockModularTable = new Machine_ModularityTable();
+ blockWitherGuard = new BlockWitherProof();
+ blockXpConverter = new BlockTankXpConverter();
+ blockCompressedObsidian = new BlockCompressedObsidian();
+ blockNet = new BlockNet();
+
+ blockFakeMiningPipe = new Mining_Pipe_Fake();
+ blockFakeMiningHead = new Mining_Head_Fake();
+
+ blockCircuitProgrammer = new CircuitProgrammer();
+
+ blockDecayablesChest = new DecayablesChest();
+ blockEggBox = new EggBox();
+
+ blockPlayerDoorWooden = new PlayerDoors(Material.wood, "door_wood", true);
+ blockPlayerDoorIron = new PlayerDoors(Material.iron, "door_iron", true);
+ blockPlayerDoorCustom_Glass = new PlayerDoors(Material.glass, "door_glass", false);
+ blockPlayerDoorCustom_Ice = new PlayerDoors(Material.ice, "door_ice", false);
+ blockPlayerDoorCustom_Cactus =
+ new PlayerDoors(Material.cactus, "door_cactus", false, 0.6f, Block.soundTypeGrass, "Cactus");
+
+ // blockCustomSuperLight = new BlockSuperLight();
+ blockCustomJukebox = new Machine_SuperJukebox();
+
+ blockPooCollector = new Machine_PooCollector();
+
+ blockPestKiller = new Machine_PestKiller();
+
+ blockRoundRobinator = new Machine_RoundRobinator();
+
+ if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
+ blockVolumetricFlaskSetter = new VolumetricFlaskSetter();
+ }
+
+ new BlockGenericRedstoneDetector();
+ new BlockGenericRedstoneTest();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/base/AdvancedBlock.java b/src/main/java/gtPlusPlus/core/block/base/AdvancedBlock.java
index f63762a2d7..61c7071a3e 100644
--- a/src/main/java/gtPlusPlus/core/block/base/AdvancedBlock.java
+++ b/src/main/java/gtPlusPlus/core/block/base/AdvancedBlock.java
@@ -1,5 +1,6 @@
package gtPlusPlus.core.block.base;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -8,32 +9,46 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.core.lib.CORE;
-
public class AdvancedBlock extends Block {
- protected AdvancedBlock(final String unlocalizedName, final Material material, final CreativeTabs x, final float blockHardness, final float blockResistance, final float blockLightLevel,
- final String blockHarvestTool, final int blockHarvestLevel, final SoundType BlockSound) {
- super(material);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(x);
- this.setHardness(blockHardness); //block Hardness
- this.setResistance(blockResistance);
- this.setLightLevel(blockLightLevel);
- this.setHarvestLevel(blockHarvestTool, blockHarvestLevel);
- this.setStepSound(BlockSound);
- }
-
- @Override
- public boolean onBlockActivated(final World p_149727_1_, final int p_149727_2_, final int p_149727_3_, final int p_149727_4_, final EntityPlayer p_149727_5_, final int p_149727_6_, final float p_149727_7_, final float p_149727_8_, final float p_149727_9_)
- {
- return false;
- }
+ protected AdvancedBlock(
+ final String unlocalizedName,
+ final Material material,
+ final CreativeTabs x,
+ final float blockHardness,
+ final float blockResistance,
+ final float blockLightLevel,
+ final String blockHarvestTool,
+ final int blockHarvestLevel,
+ final SoundType BlockSound) {
+ super(material);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(x);
+ this.setHardness(blockHardness); // block Hardness
+ this.setResistance(blockResistance);
+ this.setLightLevel(blockLightLevel);
+ this.setHarvestLevel(blockHarvestTool, blockHarvestLevel);
+ this.setStepSound(BlockSound);
+ }
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
+ @Override
+ public boolean onBlockActivated(
+ final World p_149727_1_,
+ final int p_149727_2_,
+ final int p_149727_3_,
+ final int p_149727_4_,
+ final EntityPlayer p_149727_5_,
+ final int p_149727_6_,
+ final float p_149727_7_,
+ final float p_149727_8_,
+ final float p_149727_9_) {
+ return false;
+ }
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java b/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java
index 6014388cda..876f27e5b6 100644
--- a/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java
+++ b/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java
@@ -1,5 +1,8 @@
package gtPlusPlus.core.block.base;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EnumCreatureType;
@@ -7,75 +10,68 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
public class BasicBlock extends BlockContainer {
- public BasicBlock(final String unlocalizedName, final Material material) {
- this(BlockTypes.STANDARD, unlocalizedName, material, 2);
- }
-
- public BasicBlock(final BlockTypes type, final String unlocalizedName, final Material material) {
- this(type, unlocalizedName, material, 2);
- }
-
- public BasicBlock(BlockTypes type, final String unlocalizedName, final Material material, final int harvestLevel) {
- super(material);
- this.setBlockName(Utils.sanitizeString(unlocalizedName));
-
- if (type != BlockTypes.ORE && !unlocalizedName.toLowerCase().contains("ore")) {
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- }
-
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setResistance(6.0F);
- this.setLightLevel(0.0F);
- this.setHardness(1.0f*harvestLevel);
- this.setHarvestLevel("pickaxe", harvestLevel);
- this.setStepSound(soundTypeMetal);
- }
-
-
- public static enum BlockTypes {
- STANDARD("blockBlock", "pickaxe", soundTypeMetal),
- FRAME("blockFrameGt", "wrench", soundTypeMetal),
- ORE("blockStone", "pickaxe", soundTypeStone);
-
- private String TEXTURE_NAME;
- private String HARVEST_TOOL;
- private SoundType soundOfBlock;
- private BlockTypes (final String textureName, final String harvestTool, final SoundType blockSound)
- {
- this.TEXTURE_NAME = textureName;
- this.HARVEST_TOOL = harvestTool;
- this.soundOfBlock = blockSound;
- }
-
- public String getTexture() {
- return this.TEXTURE_NAME;
- }
-
- public String getHarvestTool(){
- return this.HARVEST_TOOL;
- }
-
- public SoundType getBlockSoundType(){
- return this.soundOfBlock;
- }
-
- }
-
-
- @Override
- public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
- return null;
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
+ public BasicBlock(final String unlocalizedName, final Material material) {
+ this(BlockTypes.STANDARD, unlocalizedName, material, 2);
+ }
+
+ public BasicBlock(final BlockTypes type, final String unlocalizedName, final Material material) {
+ this(type, unlocalizedName, material, 2);
+ }
+
+ public BasicBlock(BlockTypes type, final String unlocalizedName, final Material material, final int harvestLevel) {
+ super(material);
+ this.setBlockName(Utils.sanitizeString(unlocalizedName));
+
+ if (type != BlockTypes.ORE && !unlocalizedName.toLowerCase().contains("ore")) {
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ }
+
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setResistance(6.0F);
+ this.setLightLevel(0.0F);
+ this.setHardness(1.0f * harvestLevel);
+ this.setHarvestLevel("pickaxe", harvestLevel);
+ this.setStepSound(soundTypeMetal);
+ }
+
+ public static enum BlockTypes {
+ STANDARD("blockBlock", "pickaxe", soundTypeMetal),
+ FRAME("blockFrameGt", "wrench", soundTypeMetal),
+ ORE("blockStone", "pickaxe", soundTypeStone);
+
+ private String TEXTURE_NAME;
+ private String HARVEST_TOOL;
+ private SoundType soundOfBlock;
+
+ private BlockTypes(final String textureName, final String harvestTool, final SoundType blockSound) {
+ this.TEXTURE_NAME = textureName;
+ this.HARVEST_TOOL = harvestTool;
+ this.soundOfBlock = blockSound;
+ }
+
+ public String getTexture() {
+ return this.TEXTURE_NAME;
+ }
+
+ public String getHarvestTool() {
+ return this.HARVEST_TOOL;
+ }
+
+ public SoundType getBlockSoundType() {
+ return this.soundOfBlock;
+ }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
+ return null;
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
index 2bfd09d848..05a995cbb5 100644
--- a/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
+++ b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.block.base;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -16,6 +12,9 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.InventoryUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -32,297 +31,284 @@ import net.minecraft.world.World;
public abstract class BasicTileBlockWithTooltip extends BlockContainer implements ITileTooltip {
- /**
- * Each mapped object holds the data for the six sides.
- */
- @SideOnly(Side.CLIENT)
- private AutoMap<CubicObject<SafeTexture>> mSidedTextureArray;
-
- /**
- * Holds the data for the six sides, each side holds an array of data for each respective meta.
- */
- @SideOnly(Side.CLIENT)
- private AutoMap<CubicObject<String>> mSidedTexturePathArray;
-
- /**
- * Does this block have any meta at all?
- * @return
- */
- public final boolean hasMeta() {
- return getMetaCount() > 0;
- }
-
- /**
- * The amount of meta this block has.
- * @return
- */
- public abstract int getMetaCount();
-
- /**
- * Does this {@link Block} require special {@link ItemBlock} handling?
- * @return The {@link Class} that will be used for this {@link Block}.
- */
- public Class<? extends ItemBlock> getItemBlockClass() {
- return ItemBlock.class;
- }
-
- /**
- * A lazy way to declare the unlocal name for the block, makes boilerplating easy.
- * @return The internal name for this block.
- */
- public abstract String getUnlocalBlockName();
-
- /**
- * Does this Block have {@link ITileTooltip} support?
- * @return {@link boolean} that represents if this block supports {@link ITileTooltip} or not.
- */
- public final boolean hasTooltip() {
- return getTooltipID() >= -1;
- }
-
- /**
- * Lazy Boilerplating.
- * @return Block Hardness.
- */
- protected abstract float initBlockHardness();
-
- /**
- * Lazy Boilerplating.
- * @return Block Resistance.
- */
- protected abstract float initBlockResistance();
-
- /**
- * Lazy Boilerplating.
- * @return The {@link CreativeTab} this Block is shown on.
- */
- protected abstract CreativeTabs initCreativeTab();
-
- /**
- * The ID used by the {@link ITileTooltip} handler. Return -1 if you are not providing a custom {@link ItemBlock} in {@link #getItemBlockClass}().
- * @return
- */
- @Override
- public abstract int getTooltipID();
-
- public BasicTileBlockWithTooltip(Material aBlockMat){
- super(aBlockMat);
- //Use Abstract method values
- this.setHardness(initBlockHardness());
- this.setResistance(initBlockResistance());
- this.setBlockName(getUnlocalBlockName());
- this.setCreativeTab(initCreativeTab());
- // Register the block last.
- GameRegistry.registerBlock(this, getItemBlockClass(), getUnlocalBlockName());
- Logger.INFO("Registered "+getTileEntityName()+".");
- if (Utils.isClient()) {
- // Handle Textures
- handleTextures();
- }
- }
-
- /**
- * The name of the Tile Entity.
- * @return
- */
- protected abstract String getTileEntityName();
-
- /**
- * The String used for texture pathing.
- * @return Sanitized {@link String}, containing no spaces or illegal characters.
- */
- private final String getTileEntityNameForTexturePathing() {
- return Utils.sanitizeString(getTileEntityName().replace(" ", ""));
- }
-
- /**
- * An array of CubicObjects, one for each meta, else just a single cell array.
- * Expected to be null regularly, as the default texture handling should suffice.
- * Handy if re-using textures or using a non-standard structure for them. FULL texture path must be used,
- * inclusive of the MODID and a colon.
- * @return
- */
- public CubicObject<String>[] getCustomTextureDirectoryObject(){
- return null;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final IIcon getIcon(final int aSide, final int aMeta) {
- return mSidedTextureArray.get(aMeta).get(aSide).getIcon();
- }
-
- @Override
- public IIcon getIcon(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
- return super.getIcon(aWorld, aX, aY, aZ, aSide);
- }
-
- @SideOnly(Side.CLIENT)
- private final void handleTextures() {
-
- Logger.INFO("[TeTexture] Building Texture Maps for "+getTileEntityName()+".");
-
- // Init on the Client side only, to prevent Field initialisers existing in the Server side bytecode.
- mSidedTextureArray = new AutoMap<CubicObject<SafeTexture>>();
- mSidedTexturePathArray = new AutoMap<CubicObject<String>>();
-
-
- //Store them in forge order
- //DOWN, UP, NORTH, SOUTH, WEST, EAST
-
- // Default Path Name, this will make us look inside 'miscutils\textures\blocks'
- final String aPrefixTexPath = CORE.MODID + ":";
- // Default Path Name, this will make us look in the sub-directory for this Tile Entity.
- final String aTexPathMid = "TileEntities"+CORE.SEPERATOR+getTileEntityNameForTexturePathing()+CORE.SEPERATOR;
- // Construct a full path
- String aTexPathBuilt = aPrefixTexPath + aTexPathMid;
- // File Name Suffixes, without meta tags
- String aStringBot;
- String aStringTop;
- String aStringBack;
- String aStringFront;
- String aStringLeft;
- String aStringRight;
- // Do we provide a matrix of custom data to be used for texture processing instead?
- if (getCustomTextureDirectoryObject() != null) {
- // Get custom provided texture data.
- CubicObject<String>[] aDataMap = getCustomTextureDirectoryObject();
- Logger.INFO("[TeTexture] Found custom texture data, using this instead. Size: "+aDataMap.length);
- // Map each meta string data to the main map.
- for (int i=0;i<aDataMap.length;i++) {
- mSidedTexturePathArray.put(aDataMap[i]);
- Logger.INFO("Mapped value for meta "+i+".");
- }
- }
- else {
- Logger.INFO("[TeTexture] Processing "+(1+getMetaCount())+" sets.");
- // Iterate once for each meta
- for (int i=0;i<(1+getMetaCount());i++) {
-
- // File Name Suffixes, without meta tags
- aStringBot = "Bottom";
- aStringTop = "Top";
- aStringBack = "Back";
- aStringFront = "Front";
- aStringLeft = "Left";
- aStringRight = "Right";
-
- // Add tails if we have meta
- if (hasMeta()) {
- aStringBot = aStringBot + "_"+i;
- aStringTop = aStringTop + "_"+i;
- aStringBack = aStringBack + "_"+i;
- aStringFront = aStringFront + "_"+i;
- aStringLeft = aStringLeft + "_"+i;
- aStringRight = aStringRight + "_"+i;
- }
- // Append the full path
- aStringBot = aTexPathBuilt + aStringBot;
- aStringTop = aTexPathBuilt + aStringTop;
- aStringBack = aTexPathBuilt + aStringBack;
- aStringFront = aTexPathBuilt + aStringFront;
- aStringLeft = aTexPathBuilt + aStringLeft;
- aStringRight = aTexPathBuilt + aStringRight;
- // Convenience Blob
- CubicObject<String> aMetaBlob = new CubicObject<String>(aStringBot, aStringTop, aStringBack, aStringFront, aStringLeft, aStringRight);
- mSidedTexturePathArray.put(aMetaBlob);
- Logger.INFO("[TeTexture] Added Texture Path data to map for meta "+i);
- }
- }
- Logger.INFO("[TeTexture] Map size for pathing: "+mSidedTexturePathArray.size());
-
- // Iteration Index
- int aIndex = 0;
-
- // Iterate each CubicObject, holding the six texture paths for each meta.
- for (CubicObject<String> aMetaBlob : mSidedTexturePathArray) {
- // Make a Safe Texture for each side
- SafeTexture aBottom = SafeTexture.register(aMetaBlob.DOWN);
- SafeTexture aTop = SafeTexture.register(aMetaBlob.UP);
- SafeTexture aBack = SafeTexture.register(aMetaBlob.NORTH);
- SafeTexture aFont = SafeTexture.register(aMetaBlob.SOUTH);
- SafeTexture aWest = SafeTexture.register(aMetaBlob.WEST);
- SafeTexture aEast = SafeTexture.register(aMetaBlob.EAST);
- // Store them in an Array
- SafeTexture[] aInjectBlob = new SafeTexture[] {
- aBottom,
- aTop,
- aBack,
- aFont,
- aWest,
- aEast
- };
- // Convenience Blob
- CubicObject<SafeTexture> aMetaBlob2 = new CubicObject<SafeTexture>(aInjectBlob);
- // Store this Blob into
- mSidedTextureArray.put(aMetaBlob2);
- Logger.INFO("[TeTexture] Added SafeTexture data to map for meta "+(aIndex++));
- }
- Logger.INFO("[TeTexture] Map size for registration: "+mSidedTextureArray.size());
-
-
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerBlockIcons(final IIconRegister aRegisterer){
- this.blockIcon = aRegisterer.registerIcon(CORE.MODID + ":" + "net");
- }
-
- @Override
- public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_);
-
- /**
- * Called when {@link #breakBlock}() is called, but before {@link InventoryUtils#dropInventoryItems} and the super call.
- */
- public void onBlockBreak() {
-
- }
-
- @Override
- public final void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) {
- onBlockBreak();
- InventoryUtils.dropInventoryItems(world, x, y, z, block);
- super.breakBlock(world, x, y, z, block, number);
- }
-
- @SuppressWarnings({"unchecked", "rawtypes"})
- @Override
- public final void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) {
- if (hasMeta()) {
- for (int i=0;i<getMetaCount();i++) {
- aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
- }
- }
- else {
- aList.add(ItemUtils.getSimpleStack(aItem));
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
-
-
- /**
- * Get the block's damage value (for use with pick block).
- */
- @Override
- public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
- int l = aWorld.getBlockMetadata(aX, aY, aZ);
- return l;
- }
-
-
- public Item getItemDropped(int meta, Random rand, int p_149650_3_){
+ /**
+ * Each mapped object holds the data for the six sides.
+ */
+ @SideOnly(Side.CLIENT)
+ private AutoMap<CubicObject<SafeTexture>> mSidedTextureArray;
+
+ /**
+ * Holds the data for the six sides, each side holds an array of data for each respective meta.
+ */
+ @SideOnly(Side.CLIENT)
+ private AutoMap<CubicObject<String>> mSidedTexturePathArray;
+
+ /**
+ * Does this block have any meta at all?
+ * @return
+ */
+ public final boolean hasMeta() {
+ return getMetaCount() > 0;
+ }
+
+ /**
+ * The amount of meta this block has.
+ * @return
+ */
+ public abstract int getMetaCount();
+
+ /**
+ * Does this {@link Block} require special {@link ItemBlock} handling?
+ * @return The {@link Class} that will be used for this {@link Block}.
+ */
+ public Class<? extends ItemBlock> getItemBlockClass() {
+ return ItemBlock.class;
+ }
+
+ /**
+ * A lazy way to declare the unlocal name for the block, makes boilerplating easy.
+ * @return The internal name for this block.
+ */
+ public abstract String getUnlocalBlockName();
+
+ /**
+ * Does this Block have {@link ITileTooltip} support?
+ * @return {@link boolean} that represents if this block supports {@link ITileTooltip} or not.
+ */
+ public final boolean hasTooltip() {
+ return getTooltipID() >= -1;
+ }
+
+ /**
+ * Lazy Boilerplating.
+ * @return Block Hardness.
+ */
+ protected abstract float initBlockHardness();
+
+ /**
+ * Lazy Boilerplating.
+ * @return Block Resistance.
+ */
+ protected abstract float initBlockResistance();
+
+ /**
+ * Lazy Boilerplating.
+ * @return The {@link CreativeTab} this Block is shown on.
+ */
+ protected abstract CreativeTabs initCreativeTab();
+
+ /**
+ * The ID used by the {@link ITileTooltip} handler. Return -1 if you are not providing a custom {@link ItemBlock} in {@link #getItemBlockClass}().
+ * @return
+ */
+ @Override
+ public abstract int getTooltipID();
+
+ public BasicTileBlockWithTooltip(Material aBlockMat) {
+ super(aBlockMat);
+ // Use Abstract method values
+ this.setHardness(initBlockHardness());
+ this.setResistance(initBlockResistance());
+ this.setBlockName(getUnlocalBlockName());
+ this.setCreativeTab(initCreativeTab());
+ // Register the block last.
+ GameRegistry.registerBlock(this, getItemBlockClass(), getUnlocalBlockName());
+ Logger.INFO("Registered " + getTileEntityName() + ".");
+ if (Utils.isClient()) {
+ // Handle Textures
+ handleTextures();
+ }
+ }
+
+ /**
+ * The name of the Tile Entity.
+ * @return
+ */
+ protected abstract String getTileEntityName();
+
+ /**
+ * The String used for texture pathing.
+ * @return Sanitized {@link String}, containing no spaces or illegal characters.
+ */
+ private final String getTileEntityNameForTexturePathing() {
+ return Utils.sanitizeString(getTileEntityName().replace(" ", ""));
+ }
+
+ /**
+ * An array of CubicObjects, one for each meta, else just a single cell array.
+ * Expected to be null regularly, as the default texture handling should suffice.
+ * Handy if re-using textures or using a non-standard structure for them. FULL texture path must be used,
+ * inclusive of the MODID and a colon.
+ * @return
+ */
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ return null;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final IIcon getIcon(final int aSide, final int aMeta) {
+ return mSidedTextureArray.get(aMeta).get(aSide).getIcon();
+ }
+
+ @Override
+ public IIcon getIcon(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
+ return super.getIcon(aWorld, aX, aY, aZ, aSide);
+ }
+
+ @SideOnly(Side.CLIENT)
+ private final void handleTextures() {
+
+ Logger.INFO("[TeTexture] Building Texture Maps for " + getTileEntityName() + ".");
+
+ // Init on the Client side only, to prevent Field initialisers existing in the Server side bytecode.
+ mSidedTextureArray = new AutoMap<CubicObject<SafeTexture>>();
+ mSidedTexturePathArray = new AutoMap<CubicObject<String>>();
+
+ // Store them in forge order
+ // DOWN, UP, NORTH, SOUTH, WEST, EAST
+
+ // Default Path Name, this will make us look inside 'miscutils\textures\blocks'
+ final String aPrefixTexPath = CORE.MODID + ":";
+ // Default Path Name, this will make us look in the sub-directory for this Tile Entity.
+ final String aTexPathMid =
+ "TileEntities" + CORE.SEPERATOR + getTileEntityNameForTexturePathing() + CORE.SEPERATOR;
+ // Construct a full path
+ String aTexPathBuilt = aPrefixTexPath + aTexPathMid;
+ // File Name Suffixes, without meta tags
+ String aStringBot;
+ String aStringTop;
+ String aStringBack;
+ String aStringFront;
+ String aStringLeft;
+ String aStringRight;
+ // Do we provide a matrix of custom data to be used for texture processing instead?
+ if (getCustomTextureDirectoryObject() != null) {
+ // Get custom provided texture data.
+ CubicObject<String>[] aDataMap = getCustomTextureDirectoryObject();
+ Logger.INFO("[TeTexture] Found custom texture data, using this instead. Size: " + aDataMap.length);
+ // Map each meta string data to the main map.
+ for (int i = 0; i < aDataMap.length; i++) {
+ mSidedTexturePathArray.put(aDataMap[i]);
+ Logger.INFO("Mapped value for meta " + i + ".");
+ }
+ } else {
+ Logger.INFO("[TeTexture] Processing " + (1 + getMetaCount()) + " sets.");
+ // Iterate once for each meta
+ for (int i = 0; i < (1 + getMetaCount()); i++) {
+
+ // File Name Suffixes, without meta tags
+ aStringBot = "Bottom";
+ aStringTop = "Top";
+ aStringBack = "Back";
+ aStringFront = "Front";
+ aStringLeft = "Left";
+ aStringRight = "Right";
+
+ // Add tails if we have meta
+ if (hasMeta()) {
+ aStringBot = aStringBot + "_" + i;
+ aStringTop = aStringTop + "_" + i;
+ aStringBack = aStringBack + "_" + i;
+ aStringFront = aStringFront + "_" + i;
+ aStringLeft = aStringLeft + "_" + i;
+ aStringRight = aStringRight + "_" + i;
+ }
+ // Append the full path
+ aStringBot = aTexPathBuilt + aStringBot;
+ aStringTop = aTexPathBuilt + aStringTop;
+ aStringBack = aTexPathBuilt + aStringBack;
+ aStringFront = aTexPathBuilt + aStringFront;
+ aStringLeft = aTexPathBuilt + aStringLeft;
+ aStringRight = aTexPathBuilt + aStringRight;
+ // Convenience Blob
+ CubicObject<String> aMetaBlob = new CubicObject<String>(
+ aStringBot, aStringTop, aStringBack, aStringFront, aStringLeft, aStringRight);
+ mSidedTexturePathArray.put(aMetaBlob);
+ Logger.INFO("[TeTexture] Added Texture Path data to map for meta " + i);
+ }
+ }
+ Logger.INFO("[TeTexture] Map size for pathing: " + mSidedTexturePathArray.size());
+
+ // Iteration Index
+ int aIndex = 0;
+
+ // Iterate each CubicObject, holding the six texture paths for each meta.
+ for (CubicObject<String> aMetaBlob : mSidedTexturePathArray) {
+ // Make a Safe Texture for each side
+ SafeTexture aBottom = SafeTexture.register(aMetaBlob.DOWN);
+ SafeTexture aTop = SafeTexture.register(aMetaBlob.UP);
+ SafeTexture aBack = SafeTexture.register(aMetaBlob.NORTH);
+ SafeTexture aFont = SafeTexture.register(aMetaBlob.SOUTH);
+ SafeTexture aWest = SafeTexture.register(aMetaBlob.WEST);
+ SafeTexture aEast = SafeTexture.register(aMetaBlob.EAST);
+ // Store them in an Array
+ SafeTexture[] aInjectBlob = new SafeTexture[] {aBottom, aTop, aBack, aFont, aWest, aEast};
+ // Convenience Blob
+ CubicObject<SafeTexture> aMetaBlob2 = new CubicObject<SafeTexture>(aInjectBlob);
+ // Store this Blob into
+ mSidedTextureArray.put(aMetaBlob2);
+ Logger.INFO("[TeTexture] Added SafeTexture data to map for meta " + (aIndex++));
+ }
+ Logger.INFO("[TeTexture] Map size for registration: " + mSidedTextureArray.size());
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerBlockIcons(final IIconRegister aRegisterer) {
+ this.blockIcon = aRegisterer.registerIcon(CORE.MODID + ":" + "net");
+ }
+
+ @Override
+ public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_);
+
+ /**
+ * Called when {@link #breakBlock}() is called, but before {@link InventoryUtils#dropInventoryItems} and the super call.
+ */
+ public void onBlockBreak() {}
+
+ @Override
+ public final void breakBlock(
+ final World world, final int x, final int y, final int z, final Block block, final int number) {
+ onBlockBreak();
+ InventoryUtils.dropInventoryItems(world, x, y, z, block);
+ super.breakBlock(world, x, y, z, block, number);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public final void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) {
+ if (hasMeta()) {
+ for (int i = 0; i < getMetaCount(); i++) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ } else {
+ aList.add(ItemUtils.getSimpleStack(aItem));
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ /**
+ * Get the block's damage value (for use with pick block).
+ */
+ @Override
+ public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
+ int l = aWorld.getBlockMetadata(aX, aY, aZ);
+ return l;
+ }
+
+ public Item getItemDropped(int meta, Random rand, int p_149650_3_) {
return ItemUtils.getSimpleStack(this, 1).getItem();
}
-
- public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune){
- ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
- drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
- return drops;
+
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
+ ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
+ drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
+ return drops;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java
index db37e18a32..f48601447a 100644
--- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java
+++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java
@@ -1,103 +1,104 @@
package gtPlusPlus.core.block.base;
-import java.util.Random;
-
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.client.renderer.particle.EntityDropParticleFX;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.core.client.renderer.particle.EntityDropParticleFX;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
public class BlockBaseFluid extends BlockFluidClassic {
- private final String name;
- private final IIcon textureArray[] = new IIcon[6];
-
- protected float particleRed = 1.0F;
- protected float particleGreen = 1.0F;
- protected float particleBlue = 1.0F;
-
- public BlockBaseFluid(String materialName, Fluid fluid, Material material) {
- super(fluid, material);
- this.setLightOpacity(2);
- this.name = Utils.sanitizeString(materialName);
- this.setBlockName("fluid"+this.name);
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- GameRegistry.registerBlock(this, ItemBlockMeta.class, "fluid"+this.name);
- }
+ private final String name;
+ private final IIcon textureArray[] = new IIcon[6];
- public BlockFluidClassic setParticleColor(int arg0) {
- return this.setParticleColor((arg0 >> 16 & 255) / 255.0F, (arg0 >> 8 & 255) / 255.0F,
- (arg0 >> 0 & 255) / 255.0F);
- }
+ protected float particleRed = 1.0F;
+ protected float particleGreen = 1.0F;
+ protected float particleBlue = 1.0F;
- public BlockFluidClassic setParticleColor(float arg0, float arg1, float arg2) {
- this.particleRed = arg0;
- this.particleGreen = arg1;
- this.particleBlue = arg2;
- return this;
- }
+ public BlockBaseFluid(String materialName, Fluid fluid, Material material) {
+ super(fluid, material);
+ this.setLightOpacity(2);
+ this.name = Utils.sanitizeString(materialName);
+ this.setBlockName("fluid" + this.name);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ GameRegistry.registerBlock(this, ItemBlockMeta.class, "fluid" + this.name);
+ }
- @Override
- public boolean canCreatureSpawn(EnumCreatureType arg0, IBlockAccess arg1, int arg2, int arg3, int arg4) {
- return false;
- }
+ public BlockFluidClassic setParticleColor(int arg0) {
+ return this.setParticleColor(
+ (arg0 >> 16 & 255) / 255.0F, (arg0 >> 8 & 255) / 255.0F, (arg0 >> 0 & 255) / 255.0F);
+ }
- public boolean preInit() {
- return true;
- }
+ public BlockFluidClassic setParticleColor(float arg0, float arg1, float arg2) {
+ this.particleRed = arg0;
+ this.particleGreen = arg1;
+ this.particleBlue = arg2;
+ return this;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int side, int meta) {
- return side <= 1 ? this.textureArray[0] : this.textureArray[1];
- }
+ @Override
+ public boolean canCreatureSpawn(EnumCreatureType arg0, IBlockAccess arg1, int arg2, int arg3, int arg4) {
+ return false;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister iicon) {
- this.textureArray[0] = iicon.registerIcon(CORE.MODID + ":" + "fluid/" + "Fluid_" + this.name + "_Still");
- this.textureArray[1] = iicon.registerIcon(CORE.MODID + ":" + "fluid/" + "Fluid_" + this.name + "_Flow");
- //IconRegistry.addIcon("Fluid" + this.name, this.modName + ":fluid/Fluid_" + this.name + "_Still", arg0);
- //IconRegistry.addIcon("Fluid" + this.name + "1", this.modName + ":fluid/Fluid_" + this.name + "_Flow", arg0);
- }
+ public boolean preInit() {
+ return true;
+ }
- @Override
- @Optional.Method(modid = "CoFHCore")
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(World arg0, int arg1, int arg2, int arg3, Random arg4) {
- super.randomDisplayTick(arg0, arg1, arg2, arg3, arg4);
- double arg5 = arg1 + arg4.nextFloat();
- double arg7 = arg2 - 1.05D;
- double arg9 = arg3 + arg4.nextFloat();
- if (super.density < 0) {
- arg7 = arg2 + 2.1D;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(int side, int meta) {
+ return side <= 1 ? this.textureArray[0] : this.textureArray[1];
+ }
- if (arg4.nextInt(20) == 0
- && arg0.isSideSolid(arg1, arg2 + super.densityDir, arg3,
- super.densityDir == -1 ? ForgeDirection.UP : ForgeDirection.DOWN)
- && !arg0.getBlock(arg1, arg2 + 2 * super.densityDir, arg3).getMaterial().blocksMovement()) {
- EntityDropParticleFX arg11 = new EntityDropParticleFX(arg0, arg5, arg7, arg9, this.particleRed,
- this.particleGreen, this.particleBlue, super.densityDir);
- FMLClientHandler.instance().getClient().effectRenderer.addEffect(arg11);
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister iicon) {
+ this.textureArray[0] = iicon.registerIcon(CORE.MODID + ":" + "fluid/" + "Fluid_" + this.name + "_Still");
+ this.textureArray[1] = iicon.registerIcon(CORE.MODID + ":" + "fluid/" + "Fluid_" + this.name + "_Flow");
+ // IconRegistry.addIcon("Fluid" + this.name, this.modName + ":fluid/Fluid_" + this.name + "_Still", arg0);
+ // IconRegistry.addIcon("Fluid" + this.name + "1", this.modName + ":fluid/Fluid_" + this.name + "_Flow", arg0);
+ }
- }
+ @Override
+ @Optional.Method(modid = "CoFHCore")
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(World arg0, int arg1, int arg2, int arg3, Random arg4) {
+ super.randomDisplayTick(arg0, arg1, arg2, arg3, arg4);
+ double arg5 = arg1 + arg4.nextFloat();
+ double arg7 = arg2 - 1.05D;
+ double arg9 = arg3 + arg4.nextFloat();
+ if (super.density < 0) {
+ arg7 = arg2 + 2.1D;
+ }
+ if (arg4.nextInt(20) == 0
+ && arg0.isSideSolid(
+ arg1,
+ arg2 + super.densityDir,
+ arg3,
+ super.densityDir == -1 ? ForgeDirection.UP : ForgeDirection.DOWN)
+ && !arg0.getBlock(arg1, arg2 + 2 * super.densityDir, arg3)
+ .getMaterial()
+ .blocksMovement()) {
+ EntityDropParticleFX arg11 = new EntityDropParticleFX(
+ arg0, arg5, arg7, arg9, this.particleRed, this.particleGreen, this.particleBlue, super.densityDir);
+ FMLClientHandler.instance().getClient().effectRenderer.addEffect(arg11);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java
index f1e415ae76..14e4fb6067 100644
--- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java
+++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.block.base;
-import java.util.HashMap;
-import java.util.Map;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -17,6 +14,8 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashMap;
+import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
@@ -24,195 +23,207 @@ import net.minecraft.world.IBlockAccess;
public class BlockBaseModular extends BasicBlock {
- protected Material blockMaterial;
-
- protected int blockColour;
- public BlockTypes thisBlock;
- protected String thisBlockMaterial;
- protected final String thisBlockType;
-
- private static HashMap<String, Block> sBlockCache = new HashMap<String, Block>();
-
- public static Block getMaterialBlock(Material aMaterial, BlockTypes aType) {
- return sBlockCache.get(aMaterial.getUnlocalizedName()+"."+aType.name());
- }
-
- public BlockBaseModular(final Material material, final BlockTypes blockType) {
- this(material, blockType, material.getRgbAsHex());
- }
-
- public BlockBaseModular(final Material material, final BlockTypes blockType, final int colour) {
- this(material.getUnlocalizedName(), material.getLocalizedName(), net.minecraft.block.material.Material.iron,
- blockType, colour, Math.min(Math.max(material.vTier, 1), 6));
- blockMaterial = material;
- registerComponent();
- if (material != null) {
- sBlockCache.put(material.getUnlocalizedName()+"."+blockType.name(), this);
- }
- }
-
- protected BlockBaseModular(final String unlocalizedName, final String blockMaterialString,
- final net.minecraft.block.material.Material vanillaMaterial, final BlockTypes blockType, final int colour,
- final int miningLevel) {
- super(blockType, unlocalizedName, vanillaMaterial, miningLevel);
- this.setHarvestLevel(blockType.getHarvestTool(), miningLevel);
- this.setBlockTextureName(CORE.MODID + ":" + blockType.getTexture());
- this.blockColour = colour;
- this.thisBlock = blockType;
- this.thisBlockMaterial = blockMaterialString;
- this.thisBlockType = blockType.name().toUpperCase();
- this.setBlockName(this.GetProperName());
- int fx = getBlockTypeMeta();
- //ItemBlockGtBlock.sNameCache.put("block."+blockMaterial.getUnlocalizedName()+"."+this.thisBlock.name().toLowerCase(), GetProperName());
- GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
- if (fx == 0) {
- GT_OreDictUnificator.registerOre("block" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
- }
- else if (fx == 1) {
- GT_OreDictUnificator.registerOre("frameGt" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
- }
- else if (fx == 2) {
- GT_OreDictUnificator.registerOre("frameGt" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
- }
- }
-
- public static String unifyMaterialName(String rawMaterName) {
- return rawMaterName.replace(" ", "").replace("-", "").replace("_", "");
- }
-
- public boolean registerComponent() {
- Logger.MATERIALS("Attempting to register "+this.getUnlocalizedName()+".");
- if (this.blockMaterial == null) {
- Logger.MATERIALS("Tried to register "+this.getUnlocalizedName()+" but the material was null.");
- return false;
- }
- String aName = blockMaterial.getUnlocalizedName();
- //Register Component
- Map<String, ItemStack> aMap = Material.mComponentMap.get(aName);
- if (aMap == null) {
- aMap = new HashMap<String, ItemStack>();
- }
- int fx = getBlockTypeMeta();
- String aKey = (fx == 0 ? OrePrefixes.block.name() : ( fx == 1 ? OrePrefixes.frameGt.name() : OrePrefixes.ore.name()));
- ItemStack x = aMap.get(aKey);
- if (x == null) {
- aMap.put(aKey, ItemUtils.getSimpleStack(this));
- Logger.MATERIALS("Registering a material component. Item: ["+aName+"] Map: ["+aKey+"]");
- Material.mComponentMap.put(aName, aMap);
- return true;
- }
- else {
- //Bad
- Logger.MATERIALS("Tried to double register a material component.");
- return false;
- }
- }
-
- public int getBlockTypeMeta() {
- if (this.thisBlockType.equals(BlockTypes.STANDARD.name().toUpperCase())) {
- return 0;
- }
- else if (this.thisBlockType.equals(BlockTypes.FRAME.name().toUpperCase())) {
- return 1;
- }
- else if (this.thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())) {
- return 2;
- }
- return 0;
- }
-
- /**
- * Returns which pass should this block be rendered on. 0 for solids and 1
- * for alpha
- */
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderBlockPass() {
- if (this.thisBlock == BlockTypes.FRAME) {
- return 1;
- }
- return 0;
- }
-
- public String GetProperName() {
- String tempIngot = null;
- if (this.thisBlock == BlockTypes.STANDARD) {
- tempIngot = "Block of " + this.thisBlockMaterial;
- }
- else if (this.thisBlock == BlockTypes.FRAME) {
- tempIngot = this.thisBlockMaterial + " Frame Box";
- }
- else if (this.thisBlock == BlockTypes.ORE) {
- tempIngot = this.thisBlockMaterial + " Ore [Old]";
- }
- return tempIngot;
- }
-
- @Override
- public String getLocalizedName() {
- String aFormattedLangName = GetProperName();
- return GT_LanguageManager.addStringLocalization("block."+blockMaterial.getUnlocalizedName()+"."+this.thisBlock.name().toLowerCase()+".name", aFormattedLangName);
- }
-
- @Override
- public String getUnlocalizedName() {
- return "block."+blockMaterial.getUnlocalizedName()+"."+this.thisBlock.name().toLowerCase();
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- public Material getMaterialEx(){
- return this.blockMaterial;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon) {
- if (!CORE.ConfigSwitches.useGregtechTextures || this.blockMaterial == null || this.thisBlock == BlockTypes.ORE){
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture());
- }
- String metType = "9j4852jyo3rjmh3owlhw9oe";
- if (this.blockMaterial != null) {
- TextureSet u = this.blockMaterial.getTextureSet();
- if (u != null) {
- metType = u.mSetName;
- }
- }
- metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
- int tier = blockMaterial != null ? this.blockMaterial.vTier : 0;
- String aType = (this.thisBlock == BlockTypes.FRAME) ? "frameGt" : (tier <= 4 ? "block1" : "block5");
- this.blockIcon = iIcon.registerIcon("gregtech" + ":" + "materialicons/"+ metType +"/" + aType);
- }
-
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
-
- if (this.blockColour == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
-
- return this.blockColour;
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- if (this.blockColour == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
-
- return this.blockColour;
- }
-
- @Override
- public int getBlockColor() {
- if (this.blockColour == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
-
- return this.blockColour;
- }
-
+ protected Material blockMaterial;
+
+ protected int blockColour;
+ public BlockTypes thisBlock;
+ protected String thisBlockMaterial;
+ protected final String thisBlockType;
+
+ private static HashMap<String, Block> sBlockCache = new HashMap<String, Block>();
+
+ public static Block getMaterialBlock(Material aMaterial, BlockTypes aType) {
+ return sBlockCache.get(aMaterial.getUnlocalizedName() + "." + aType.name());
+ }
+
+ public BlockBaseModular(final Material material, final BlockTypes blockType) {
+ this(material, blockType, material.getRgbAsHex());
+ }
+
+ public BlockBaseModular(final Material material, final BlockTypes blockType, final int colour) {
+ this(
+ material.getUnlocalizedName(),
+ material.getLocalizedName(),
+ net.minecraft.block.material.Material.iron,
+ blockType,
+ colour,
+ Math.min(Math.max(material.vTier, 1), 6));
+ blockMaterial = material;
+ registerComponent();
+ if (material != null) {
+ sBlockCache.put(material.getUnlocalizedName() + "." + blockType.name(), this);
+ }
+ }
+
+ protected BlockBaseModular(
+ final String unlocalizedName,
+ final String blockMaterialString,
+ final net.minecraft.block.material.Material vanillaMaterial,
+ final BlockTypes blockType,
+ final int colour,
+ final int miningLevel) {
+ super(blockType, unlocalizedName, vanillaMaterial, miningLevel);
+ this.setHarvestLevel(blockType.getHarvestTool(), miningLevel);
+ this.setBlockTextureName(CORE.MODID + ":" + blockType.getTexture());
+ this.blockColour = colour;
+ this.thisBlock = blockType;
+ this.thisBlockMaterial = blockMaterialString;
+ this.thisBlockType = blockType.name().toUpperCase();
+ this.setBlockName(this.GetProperName());
+ int fx = getBlockTypeMeta();
+ // ItemBlockGtBlock.sNameCache.put("block."+blockMaterial.getUnlocalizedName()+"."+this.thisBlock.name().toLowerCase(), GetProperName());
+ GameRegistry.registerBlock(
+ this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
+ if (fx == 0) {
+ GT_OreDictUnificator.registerOre(
+ "block" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
+ } else if (fx == 1) {
+ GT_OreDictUnificator.registerOre(
+ "frameGt" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
+ } else if (fx == 2) {
+ GT_OreDictUnificator.registerOre(
+ "frameGt" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
+ }
+ }
+
+ public static String unifyMaterialName(String rawMaterName) {
+ return rawMaterName.replace(" ", "").replace("-", "").replace("_", "");
+ }
+
+ public boolean registerComponent() {
+ Logger.MATERIALS("Attempting to register " + this.getUnlocalizedName() + ".");
+ if (this.blockMaterial == null) {
+ Logger.MATERIALS("Tried to register " + this.getUnlocalizedName() + " but the material was null.");
+ return false;
+ }
+ String aName = blockMaterial.getUnlocalizedName();
+ // Register Component
+ Map<String, ItemStack> aMap = Material.mComponentMap.get(aName);
+ if (aMap == null) {
+ aMap = new HashMap<String, ItemStack>();
+ }
+ int fx = getBlockTypeMeta();
+ String aKey =
+ (fx == 0 ? OrePrefixes.block.name() : (fx == 1 ? OrePrefixes.frameGt.name() : OrePrefixes.ore.name()));
+ ItemStack x = aMap.get(aKey);
+ if (x == null) {
+ aMap.put(aKey, ItemUtils.getSimpleStack(this));
+ Logger.MATERIALS("Registering a material component. Item: [" + aName + "] Map: [" + aKey + "]");
+ Material.mComponentMap.put(aName, aMap);
+ return true;
+ } else {
+ // Bad
+ Logger.MATERIALS("Tried to double register a material component.");
+ return false;
+ }
+ }
+
+ public int getBlockTypeMeta() {
+ if (this.thisBlockType.equals(BlockTypes.STANDARD.name().toUpperCase())) {
+ return 0;
+ } else if (this.thisBlockType.equals(BlockTypes.FRAME.name().toUpperCase())) {
+ return 1;
+ } else if (this.thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())) {
+ return 2;
+ }
+ return 0;
+ }
+
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1
+ * for alpha
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass() {
+ if (this.thisBlock == BlockTypes.FRAME) {
+ return 1;
+ }
+ return 0;
+ }
+
+ public String GetProperName() {
+ String tempIngot = null;
+ if (this.thisBlock == BlockTypes.STANDARD) {
+ tempIngot = "Block of " + this.thisBlockMaterial;
+ } else if (this.thisBlock == BlockTypes.FRAME) {
+ tempIngot = this.thisBlockMaterial + " Frame Box";
+ } else if (this.thisBlock == BlockTypes.ORE) {
+ tempIngot = this.thisBlockMaterial + " Ore [Old]";
+ }
+ return tempIngot;
+ }
+
+ @Override
+ public String getLocalizedName() {
+ String aFormattedLangName = GetProperName();
+ return GT_LanguageManager.addStringLocalization(
+ "block." + blockMaterial.getUnlocalizedName() + "."
+ + this.thisBlock.name().toLowerCase() + ".name",
+ aFormattedLangName);
+ }
+
+ @Override
+ public String getUnlocalizedName() {
+ return "block." + blockMaterial.getUnlocalizedName() + "."
+ + this.thisBlock.name().toLowerCase();
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public Material getMaterialEx() {
+ return this.blockMaterial;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iIcon) {
+ if (!CORE.ConfigSwitches.useGregtechTextures
+ || this.blockMaterial == null
+ || this.thisBlock == BlockTypes.ORE) {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture());
+ }
+ String metType = "9j4852jyo3rjmh3owlhw9oe";
+ if (this.blockMaterial != null) {
+ TextureSet u = this.blockMaterial.getTextureSet();
+ if (u != null) {
+ metType = u.mSetName;
+ }
+ }
+ metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
+ int tier = blockMaterial != null ? this.blockMaterial.vTier : 0;
+ String aType = (this.thisBlock == BlockTypes.FRAME) ? "frameGt" : (tier <= 4 ? "block1" : "block5");
+ this.blockIcon = iIcon.registerIcon("gregtech" + ":" + "materialicons/" + metType + "/" + aType);
+ }
+
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
+
+ if (this.blockColour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
+
+ @Override
+ public int getRenderColor(final int aMeta) {
+ if (this.blockColour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
+
+ @Override
+ public int getBlockColor() {
+ if (this.blockColour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseNBT.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseNBT.java
index e4dff82ec4..1697244ff5 100644
--- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseNBT.java
+++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseNBT.java
@@ -3,7 +3,8 @@ package gtPlusPlus.core.block.base;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockNBT;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -15,67 +16,72 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockNBT;
+public abstract class BlockBaseNBT extends BlockContainer {
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
-public abstract class BlockBaseNBT extends BlockContainer
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
- @SuppressWarnings("deprecation")
- public BlockBaseNBT(final Material material, final String unlocalName, final String displayName){
- super(material);
- this.setBlockName(unlocalName);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockNBT.class, unlocalName);
- //LanguageRegistry.addName(this, displayName);
- }
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_){
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
- }
+ @SuppressWarnings("deprecation")
+ public BlockBaseNBT(final Material material, final String unlocalName, final String displayName) {
+ super(material);
+ this.setBlockName(unlocalName);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockNBT.class, unlocalName);
+ // LanguageRegistry.addName(this, displayName);
+ }
- @Override
- public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_);
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 1
+ ? this.textureTop
+ : (p_149691_1_ == 0
+ ? this.textureBottom
+ : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
+ }
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int meta) {
- super.breakBlock(world, x, y, z, block, meta);
- }
+ @Override
+ public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_);
- @Override
- public void onBlockDestroyedByPlayer(final World world, final int x, final int y, final int z, final int meta) {
- super.onBlockDestroyedByPlayer(world, x, y, z, meta);
- }
+ @Override
+ public void breakBlock(
+ final World world, final int x, final int y, final int z, final Block block, final int meta) {
+ super.breakBlock(world, x, y, z, block, meta);
+ }
- @Override
- public void onBlockDestroyedByExplosion(final World world, final int x, final int y, final int z, final Explosion explosion) {
- super.onBlockDestroyedByExplosion(world, x, y, z, explosion);
- }
+ @Override
+ public void onBlockDestroyedByPlayer(final World world, final int x, final int y, final int z, final int meta) {
+ super.onBlockDestroyedByPlayer(world, x, y, z, meta);
+ }
- @Override
- public void onBlockHarvested(final World world, final int x, final int y, final int z, final int meta, final EntityPlayer player) {
- super.onBlockHarvested(world, x, y, z, meta, player);
- }
+ @Override
+ public void onBlockDestroyedByExplosion(
+ final World world, final int x, final int y, final int z, final Explosion explosion) {
+ super.onBlockDestroyedByExplosion(world, x, y, z, explosion);
+ }
- @Override
- public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion) {
- super.onBlockExploded(world, x, y, z, explosion);
- }
+ @Override
+ public void onBlockHarvested(
+ final World world, final int x, final int y, final int z, final int meta, final EntityPlayer player) {
+ super.onBlockHarvested(world, x, y, z, meta, player);
+ }
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
+ @Override
+ public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion) {
+ super.onBlockExploded(world, x, y, z, explosion);
+ }
-} \ No newline at end of file
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java
index df69a050a6..81f1737f8c 100644
--- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java
+++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.block.base;
-import java.lang.reflect.Field;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
@@ -18,6 +16,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture;
import gtPlusPlus.xmod.gregtech.api.objects.GTPP_RenderedTexture;
+import java.lang.reflect.Field;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EnumCreatureType;
@@ -27,203 +26,220 @@ import net.minecraft.world.IBlockAccess;
public class BlockBaseOre extends BasicBlock implements ITexturedBlock {
- private final Material blockMaterial;
-
- public BlockBaseOre(final Material material, final BlockTypes blockType, final int colour) {
- super(blockType, Utils.sanitizeString(material.getUnlocalizedName()), net.minecraft.block.material.Material.rock, Math.min(Math.max(material.vTier, 1), 6));
- int aMaterialTierForMining = Math.min(Math.max(material.vTier, 1), 6);
- this.blockMaterial = material;
- this.setHardness(1.0f*aMaterialTierForMining);
- this.setResistance(6.0F);
- this.setLightLevel(0.0F);
- this.setHarvestLevel("pickaxe", aMaterialTierForMining);
- this.setStepSound(soundTypeStone);
- this.setBlockName("Ore"+Utils.sanitizeString(Utils.sanitizeString(material.getUnlocalizedName())));
- this.setBlockTextureName("stone");
- try {
- GameRegistry.registerBlock(this, ItemBlockOre.class, Utils.sanitizeString("ore"+Utils.sanitizeString(this.blockMaterial.getLocalizedName())));
- GT_OreDictUnificator.registerOre("ore"+Utils.sanitizeString(this.blockMaterial.getLocalizedName()), ItemUtils.getSimpleStack(this));
- }
- catch (Throwable t){
- t.printStackTrace();
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- public Material getMaterialEx(){
- return this.blockMaterial;
- }
-
- @Override
- public int getRenderType() {
- try {
- if (CustomOreBlockRenderer.INSTANCE != null){
- return CustomOreBlockRenderer.INSTANCE.mRenderID;
- }
- return super.getRenderType();
- }
- catch (NullPointerException n) {
- return 0;
- }
- }
-
- @Override
- public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) {
- return Blocks.stone.getIcon(0, 0);
- }
-
- @Override
- public IIcon getIcon(int aSide, int aMeta) {
- return Blocks.stone.getIcon(0, 0);
- }
-
- /**
- * GT Texture Handler
- */
-
- //.08 compat
- public static IIconContainer[] hiddenTextureArray;
- public ITexture[] getTexture(byte arg0) {
- return getTexture(null, arg0);
- }
-
- public ITexture[] getTexture(Block block, byte side) {
- if (this.blockMaterial != null){
- GTPP_RenderedTexture aIconSet = new GTPP_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA());
- if (aIconSet != null){
- return new ITexture[]{new GTPP_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet};
- }
- }
-
- if (hiddenTextureArray == null){
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- hiddenTextureArray = Textures.BlockIcons.GRANITES;
- }
- else {
- try {
- Field o = ReflectionUtils.getField(Textures.BlockIcons.class, "STONES");
- if (o != null){
- hiddenTextureArray = (IIconContainer[]) o.get(Textures.BlockIcons.class);
- }
- if (hiddenTextureArray == null){
- hiddenTextureArray = new IIconContainer[6];
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
- hiddenTextureArray = new IIconContainer[6];
- }
- }
- }
- return new ITexture[]{new GTPP_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})};
- }
-
- @Override
- public void registerBlockIcons(IIconRegister p_149651_1_) {
-
- }
-
- public static class oldOreBlock extends BlockBaseModular implements ITexturedBlock{
-
- public oldOreBlock(final String unlocalizedName, final String blockMaterial, final BlockTypes blockType, final int colour) {
- this(unlocalizedName, blockMaterial, net.minecraft.block.material.Material.iron, blockType, colour, 2);
- }
-
- public oldOreBlock(final String unlocalizedName, final String blockMaterial, final net.minecraft.block.material.Material vanillaMaterial, final BlockTypes blockType, final int colour, final int miningLevel) {
- super(unlocalizedName, blockMaterial, vanillaMaterial, blockType, colour, miningLevel);
- }
-
- /*@Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon)
- {
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture());
- //this.base = iIcon.registerIcon(CORE.MODID + ":" + "blockStone");
- //this.overlay = iIcon.registerIcon(CORE.MODID + ":" + "blockOre_Overlay");
- }
-
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){
- if (this.blockColour == 0){
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.blockColour;
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- if (this.blockColour == 0){
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.blockColour;
- }*/
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- @Override
- public int getRenderType() {
- if (CustomOreBlockRenderer.INSTANCE != null){
- return CustomOreBlockRenderer.INSTANCE.mRenderID;
- }
- return super.getRenderType();
- }
-
- @Override
- public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) {
- return Blocks.stone.getIcon(0, 0);
- }
-
- @Override
- public IIcon getIcon(int aSide, int aMeta) {
- return Blocks.stone.getIcon(0, 0);
- }
-
- /**
- * GT Texture Handler
- */
-
- //.08 compat
- IIconContainer[] hiddenTextureArray;
- public ITexture[] getTexture(byte arg0) {
- return getTexture(null, arg0);
- }
-
- public ITexture[] getTexture(Block block, byte side) {
- if (this.blockMaterial != null){
- GTPP_RenderedTexture aIconSet = new GTPP_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA());
- if (aIconSet != null){
- return new ITexture[]{new GTPP_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet};
- }
- }
-
- if (hiddenTextureArray == null){
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- hiddenTextureArray = Textures.BlockIcons.GRANITES;
- }
- else {
- try {
- Field o = ReflectionUtils.getField(Textures.BlockIcons.class, "STONES");
- if (o != null){
- hiddenTextureArray = (IIconContainer[]) o.get(Textures.BlockIcons.class);
- }
- if (hiddenTextureArray == null){
- hiddenTextureArray = new IIconContainer[6];
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
- hiddenTextureArray = new IIconContainer[6];
- }
- }
- }
- return new ITexture[]{new GTPP_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})};
- }
-
- }
-
+ private final Material blockMaterial;
+
+ public BlockBaseOre(final Material material, final BlockTypes blockType, final int colour) {
+ super(
+ blockType,
+ Utils.sanitizeString(material.getUnlocalizedName()),
+ net.minecraft.block.material.Material.rock,
+ Math.min(Math.max(material.vTier, 1), 6));
+ int aMaterialTierForMining = Math.min(Math.max(material.vTier, 1), 6);
+ this.blockMaterial = material;
+ this.setHardness(1.0f * aMaterialTierForMining);
+ this.setResistance(6.0F);
+ this.setLightLevel(0.0F);
+ this.setHarvestLevel("pickaxe", aMaterialTierForMining);
+ this.setStepSound(soundTypeStone);
+ this.setBlockName("Ore" + Utils.sanitizeString(Utils.sanitizeString(material.getUnlocalizedName())));
+ this.setBlockTextureName("stone");
+ try {
+ GameRegistry.registerBlock(
+ this,
+ ItemBlockOre.class,
+ Utils.sanitizeString("ore" + Utils.sanitizeString(this.blockMaterial.getLocalizedName())));
+ GT_OreDictUnificator.registerOre(
+ "ore" + Utils.sanitizeString(this.blockMaterial.getLocalizedName()),
+ ItemUtils.getSimpleStack(this));
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ public Material getMaterialEx() {
+ return this.blockMaterial;
+ }
+
+ @Override
+ public int getRenderType() {
+ try {
+ if (CustomOreBlockRenderer.INSTANCE != null) {
+ return CustomOreBlockRenderer.INSTANCE.mRenderID;
+ }
+ return super.getRenderType();
+ } catch (NullPointerException n) {
+ return 0;
+ }
+ }
+
+ @Override
+ public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) {
+ return Blocks.stone.getIcon(0, 0);
+ }
+
+ @Override
+ public IIcon getIcon(int aSide, int aMeta) {
+ return Blocks.stone.getIcon(0, 0);
+ }
+
+ /**
+ * GT Texture Handler
+ */
+
+ // .08 compat
+ public static IIconContainer[] hiddenTextureArray;
+
+ public ITexture[] getTexture(byte arg0) {
+ return getTexture(null, arg0);
+ }
+
+ public ITexture[] getTexture(Block block, byte side) {
+ if (this.blockMaterial != null) {
+ GTPP_RenderedTexture aIconSet = new GTPP_RenderedTexture(
+ blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex],
+ this.blockMaterial.getRGBA());
+ if (aIconSet != null) {
+ return new ITexture[] {new GTPP_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet};
+ }
+ }
+
+ if (hiddenTextureArray == null) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ hiddenTextureArray = Textures.BlockIcons.GRANITES;
+ } else {
+ try {
+ Field o = ReflectionUtils.getField(Textures.BlockIcons.class, "STONES");
+ if (o != null) {
+ hiddenTextureArray = (IIconContainer[]) o.get(Textures.BlockIcons.class);
+ }
+ if (hiddenTextureArray == null) {
+ hiddenTextureArray = new IIconContainer[6];
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ hiddenTextureArray = new IIconContainer[6];
+ }
+ }
+ }
+ return new ITexture[] {new GTPP_RenderedTexture(hiddenTextureArray[0], new short[] {240, 240, 240, 0})};
+ }
+
+ @Override
+ public void registerBlockIcons(IIconRegister p_149651_1_) {}
+
+ public static class oldOreBlock extends BlockBaseModular implements ITexturedBlock {
+
+ public oldOreBlock(
+ final String unlocalizedName,
+ final String blockMaterial,
+ final BlockTypes blockType,
+ final int colour) {
+ this(unlocalizedName, blockMaterial, net.minecraft.block.material.Material.iron, blockType, colour, 2);
+ }
+
+ public oldOreBlock(
+ final String unlocalizedName,
+ final String blockMaterial,
+ final net.minecraft.block.material.Material vanillaMaterial,
+ final BlockTypes blockType,
+ final int colour,
+ final int miningLevel) {
+ super(unlocalizedName, blockMaterial, vanillaMaterial, blockType, colour, miningLevel);
+ }
+
+ /*@Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iIcon)
+ {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture());
+ //this.base = iIcon.registerIcon(CORE.MODID + ":" + "blockStone");
+ //this.overlay = iIcon.registerIcon(CORE.MODID + ":" + "blockOre_Overlay");
+ }
+
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){
+ if (this.blockColour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.blockColour;
+ }
+
+ @Override
+ public int getRenderColor(final int aMeta) {
+ if (this.blockColour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.blockColour;
+ }*/
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ @Override
+ public int getRenderType() {
+ if (CustomOreBlockRenderer.INSTANCE != null) {
+ return CustomOreBlockRenderer.INSTANCE.mRenderID;
+ }
+ return super.getRenderType();
+ }
+
+ @Override
+ public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) {
+ return Blocks.stone.getIcon(0, 0);
+ }
+
+ @Override
+ public IIcon getIcon(int aSide, int aMeta) {
+ return Blocks.stone.getIcon(0, 0);
+ }
+
+ /**
+ * GT Texture Handler
+ */
+
+ // .08 compat
+ IIconContainer[] hiddenTextureArray;
+
+ public ITexture[] getTexture(byte arg0) {
+ return getTexture(null, arg0);
+ }
+
+ public ITexture[] getTexture(Block block, byte side) {
+ if (this.blockMaterial != null) {
+ GTPP_RenderedTexture aIconSet = new GTPP_RenderedTexture(
+ blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex],
+ this.blockMaterial.getRGBA());
+ if (aIconSet != null) {
+ return new ITexture[] {new GTPP_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet};
+ }
+ }
+
+ if (hiddenTextureArray == null) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ hiddenTextureArray = Textures.BlockIcons.GRANITES;
+ } else {
+ try {
+ Field o = ReflectionUtils.getField(Textures.BlockIcons.class, "STONES");
+ if (o != null) {
+ hiddenTextureArray = (IIconContainer[]) o.get(Textures.BlockIcons.class);
+ }
+ if (hiddenTextureArray == null) {
+ hiddenTextureArray = new IIconContainer[6];
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ hiddenTextureArray = new IIconContainer[6];
+ }
+ }
+ }
+ return new ITexture[] {new GTPP_RenderedTexture(hiddenTextureArray[0], new short[] {240, 240, 240, 0})};
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/base/MetaBlock.java b/src/main/java/gtPlusPlus/core/block/base/MetaBlock.java
index 880bb3a597..68ddd47547 100644
--- a/src/main/java/gtPlusPlus/core/block/base/MetaBlock.java
+++ b/src/main/java/gtPlusPlus/core/block/base/MetaBlock.java
@@ -1,7 +1,6 @@
package gtPlusPlus.core.block.base;
import java.util.List;
-
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EnumCreatureType;
@@ -11,25 +10,25 @@ import net.minecraft.world.IBlockAccess;
public class MetaBlock extends MultiTextureBlock {
- protected MetaBlock(final String unlocalizedName, final Material material, final SoundType soundType) {
- super(unlocalizedName, material, soundType);
- }
-
- @Override
- public int damageDropped(final int meta) {
- return meta;
- }
-
- @Override
- public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
- for (int i = 0; i < 6; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
-} \ No newline at end of file
+ protected MetaBlock(final String unlocalizedName, final Material material, final SoundType soundType) {
+ super(unlocalizedName, material, soundType);
+ }
+
+ @Override
+ public int damageDropped(final int meta) {
+ return meta;
+ }
+
+ @Override
+ public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
+ for (int i = 0; i < 6; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/base/MultiTextureBlock.java b/src/main/java/gtPlusPlus/core/block/base/MultiTextureBlock.java
index a04bf841ba..dfacc26b62 100644
--- a/src/main/java/gtPlusPlus/core/block/base/MultiTextureBlock.java
+++ b/src/main/java/gtPlusPlus/core/block/base/MultiTextureBlock.java
@@ -1,37 +1,35 @@
package gtPlusPlus.core.block.base;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-
public class MultiTextureBlock extends Block {
- public IIcon[] icons = new IIcon[6];
+ public IIcon[] icons = new IIcon[6];
- protected MultiTextureBlock(final String unlocalizedName, final Material material, final SoundType blockSound)
- {
- super(material);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(2.0F);
- this.setResistance(6.0F);
- this.setStepSound(blockSound);
- }
+ protected MultiTextureBlock(final String unlocalizedName, final Material material, final SoundType blockSound) {
+ super(material);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(2.0F);
+ this.setResistance(6.0F);
+ this.setStepSound(blockSound);
+ }
- @Override
- public void registerBlockIcons(final IIconRegister reg) {
- for (int i = 0; i < 6; i ++) {
- this.icons[i] = reg.registerIcon(this.textureName + "_" + i);
- }
- }
+ @Override
+ public void registerBlockIcons(final IIconRegister reg) {
+ for (int i = 0; i < 6; i++) {
+ this.icons[i] = reg.registerIcon(this.textureName + "_" + i);
+ }
+ }
- @Override
- public IIcon getIcon(final int side, final int meta) {
- return this.icons[side];
- }
-} \ No newline at end of file
+ @Override
+ public IIcon getIcon(final int side, final int meta) {
+ return this.icons[side];
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java b/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java
index 2cf40160a3..3bb09962b5 100644
--- a/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java
+++ b/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java
@@ -1,13 +1,14 @@
package gtPlusPlus.core.block.general;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
+import gtPlusPlus.core.lib.CORE;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
import net.minecraft.block.BlockObsidian;
import net.minecraft.block.material.MapColor;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -17,86 +18,80 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
-import gtPlusPlus.core.lib.CORE;
-
public class BlockCompressedObsidian extends BlockObsidian {
- private final IIcon textureArray[] = new IIcon[11];
-
- public BlockCompressedObsidian() {
- this.setBlockName("blockCompressedObsidian");
- this.setHardness(50.0F);
- this.setResistance(2000.0F);
- this.setStepSound(soundTypePiston);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockCompressedObsidian");
- }
+ private final IIcon textureArray[] = new IIcon[11];
- @Override
- public MapColor getMapColor(final int meta) {
- if (meta < 5) {
- return MapColor.obsidianColor;
- }
- if (meta > 5) {
- return MapColor.goldColor;
- }
- else {
- return MapColor.sandColor;
- }
- }
+ public BlockCompressedObsidian() {
+ this.setBlockName("blockCompressedObsidian");
+ this.setHardness(50.0F);
+ this.setResistance(2000.0F);
+ this.setStepSound(soundTypePiston);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockCompressedObsidian");
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iicon) {
- this.textureArray[0] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian1");
- this.textureArray[1] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian2");
- this.textureArray[2] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian3");
- this.textureArray[3] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian4");
- this.textureArray[4] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian5");
- this.textureArray[5] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian_invert");
- this.textureArray[6] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone1");
- this.textureArray[7] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone2");
- this.textureArray[8] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone3");
- this.textureArray[9] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone4");
- this.textureArray[10] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone5");
- }
+ @Override
+ public MapColor getMapColor(final int meta) {
+ if (meta < 5) {
+ return MapColor.obsidianColor;
+ }
+ if (meta > 5) {
+ return MapColor.goldColor;
+ } else {
+ return MapColor.sandColor;
+ }
+ }
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int side, final int meta) {
- return this.textureArray[meta];
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iicon) {
+ this.textureArray[0] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian1");
+ this.textureArray[1] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian2");
+ this.textureArray[2] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian3");
+ this.textureArray[3] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian4");
+ this.textureArray[4] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian5");
+ this.textureArray[5] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian_invert");
+ this.textureArray[6] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone1");
+ this.textureArray[7] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone2");
+ this.textureArray[8] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone3");
+ this.textureArray[9] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone4");
+ this.textureArray[10] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone5");
+ }
- @Override
- public int damageDropped(final int damage) {
- return damage;
- }
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int side, final int meta) {
+ return this.textureArray[meta];
+ }
- @Override
- public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
- for (int i = 0; i < 11; i++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
+ @Override
+ public int damageDropped(final int damage) {
+ return damage;
+ }
- @Override
- public Item getItemDropped(final int meta, final Random rand, final int fortune) {
- return Item.getItemFromBlock(this);
- }
+ @Override
+ public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
+ for (int i = 0; i < 11; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int metadata,
- final int fortune) {
- int m = metadata;
- if (m == 5) {
- m = 1;
- }
- return super.getDrops(world, x, y, z, m, fortune);
- }
+ @Override
+ public Item getItemDropped(final int meta, final Random rand, final int fortune) {
+ return Item.getItemFromBlock(this);
+ }
+ @Override
+ public ArrayList<ItemStack> getDrops(
+ final World world, final int x, final int y, final int z, final int metadata, final int fortune) {
+ int m = metadata;
+ if (m == 5) {
+ m = 1;
+ }
+ return super.getDrops(world, x, y, z, m, fortune);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockNet.java b/src/main/java/gtPlusPlus/core/block/general/BlockNet.java
index 1f0f145392..53adacac84 100644
--- a/src/main/java/gtPlusPlus/core/block/general/BlockNet.java
+++ b/src/main/java/gtPlusPlus/core/block/general/BlockNet.java
@@ -1,37 +1,34 @@
package gtPlusPlus.core.block.general;
-import java.util.Random;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.block.BlockWeb;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.item.Item;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
+import java.util.Random;
+import net.minecraft.block.BlockWeb;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.Item;
-public class BlockNet extends BlockWeb{
-
- public BlockNet(){
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setLightOpacity(1);
- this.setHardness(4.0F);
- this.setBlockName("blockNet");
- GameRegistry.registerBlock(this, "blockNet");
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon){
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "net");
- }
-
- @Override
- public Item getItemDropped(final int p_149650_1_, final Random p_149650_2_, final int p_149650_3_){
- return ModItems.itemRope;
- }
-
-} \ No newline at end of file
+public class BlockNet extends BlockWeb {
+
+ public BlockNet() {
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setLightOpacity(1);
+ this.setHardness(4.0F);
+ this.setBlockName("blockNet");
+ GameRegistry.registerBlock(this, "blockNet");
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iIcon) {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "net");
+ }
+
+ @Override
+ public Item getItemDropped(final int p_149650_1_, final Random p_149650_2_, final int p_149650_3_) {
+ return ModItems.itemRope;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
index a1ba3be487..5357bd2622 100644
--- a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
+++ b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
@@ -23,198 +23,196 @@ import net.minecraft.world.World;
public class BlockSuperLight extends BlockContainer {
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- //propecia (Inhibit DHD - recover hair get depression)
-
- public BlockSuperLight() {
- super(Material.circuits);
- this.setBlockName("blockSuperLight");
- this.setCreativeTab(CreativeTabs.tabRedstone);
- GameRegistry.registerBlock(this, "blockSuperLight");
- LanguageRegistry.addName(this, "Shining Star");
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
- return this.blockIcon;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlBigBlue");
- }
-
- /**
- * Returns a new instance of a block's tile entity class. Called on placing the
- * block.
- */
- public TileEntity createNewTileEntity(World aWorld, int p_149915_2_) {
- return new TileEntitySuperLight();
- }
-
- public static class TileEntitySuperLight extends TileEntity {
-
- private long mCreated;
-
- private long mLastUpdateTick = 0;
-
- private int mLitBlockCount = 0;
-
- private int[][][][] aLitBlocks = new int[50][10][50][1];
-
- private boolean mPowered = false;
-
- public TileEntitySuperLight() {
- mCreated = System.currentTimeMillis();
- Logger.INFO("Created Super-Lamp");
- }
-
- public void readFromNBT(NBTTagCompound aNBT) {
- super.readFromNBT(aNBT);
- mCreated = aNBT.getLong("mCreated");
- mPowered = aNBT.getBoolean("mPowered");
- NBTTagCompound aLightingData = aNBT.getCompoundTag("lighting");
- for (int x = 0; x < 50; x++) {
- for (int y = 0; y < 10; y++) {
- for (int z = 0; z < 50; z++) {
- int aData = aLightingData.getInteger("["+x+"]["+y+"]["+z+"]");
- aLitBlocks[x][y][z][0] = aData;
- }
- }
- }
- }
-
- public void writeToNBT(NBTTagCompound aNBT) {
- super.writeToNBT(aNBT);
- aNBT.setLong("mCreated", mCreated);
- aNBT.setBoolean("mPowered", mPowered);
- NBTTagCompound aLightingData = new NBTTagCompound();
- for (int x = 0; x < 50; x++) {
- for (int y = 0; y < 10; y++) {
- for (int z = 0; z < 50; z++) {
- int aFlag = aLitBlocks[x][y][z][0];
- aLightingData.setInteger("["+x+"]["+y+"]["+z+"]", aFlag);
- }
- }
- }
- aNBT.setTag("lighting", aLightingData);
- }
-
- @Override
- public void updateEntity() {
- super.updateEntity();
-
- if (this.worldObj.isRemote) {
- return;
- }
-
- try {
- if (mLastUpdateTick == 0 || (System.currentTimeMillis() - mLastUpdateTick) >= 30000) {
- boolean powered = (this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord));
- boolean aLastState = mPowered;
- //Logger.INFO("Powered: "+powered);
- mPowered = powered;
- if (mPowered != aLastState) {
- updateLighting(powered);
- }
- }
- } catch (Throwable t) {
- }
- }
-
- @Override
- public void markDirty() {
- super.markDirty();
- }
-
- @Override
- public boolean canUpdate() {
- return super.canUpdate();
- }
-
- public void updateLighting(boolean enable) {
-
-
- mLastUpdateTick = System.currentTimeMillis();
-
- if (false) {
- return;
- }
-
- aLitBlocks = new int[50][10][50][1];
- int aLitCounter = 0;
- AutoMap<BlockPos> aBlocksToUpdate = new AutoMap<BlockPos>();
- Logger.INFO("Trying to relight area.");
-
- BlockPos aStartIterationPoint = new BlockPos(this.xCoord-24, this.yCoord-4, this.zCoord-24, this.worldObj);
- for (int x = 0; x < 50; x++) {
- for (int y = 0; y < 10; y++) {
- for (int z = 0; z < 50; z++) {
- int xOff = aStartIterationPoint.xPos + x;
- int yOff = aStartIterationPoint.yPos + y;
- int zOff = aStartIterationPoint.zPos + z;
- Block aBlockGet = this.worldObj.getBlock(xOff, yOff, zOff);
- if (aBlockGet != null) {
- if (aBlockGet instanceof BlockAir || aBlockGet instanceof LightGlass) {
-
- int aLight = aBlockGet.getLightValue();
-
- //Don't Need to relight anything.
- if ((enable && aLight > 0) || (!enable && aLight == 0)) {
- continue;
- }
- //Turning Lights on
- else if (enable && aLight == 0) {
- aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj));
- if (aBlockGet instanceof BlockAir) {
- Logger.INFO("Lit air.");
- this.worldObj.setBlock(xOff, yOff, zOff, ModBlocks.MatterFabricatorEffectBlock, 0, 3);
- }
- //aBlockGet.setLightLevel(15);
- aLitCounter++;
- }
- //Turning Lights off
- else if (!enable && aLight > 0) {
- aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj));
- if (aBlockGet instanceof LightGlass) {
- Logger.INFO("Dimmed air.");
- this.worldObj.setBlock(xOff, yOff, zOff, Blocks.air, 0, 3);
- }
- //aBlockGet.setLightLevel(0);
- }
- aLitBlocks[x][y][z][0] = enable ? 15 : 0;
- }
- else {
- aLitBlocks[x][y][z][0] = -1;
- }
- }
- else {
- aLitBlocks[x][y][z][0] = -1;
- }
- }
- }
- }
- mLitBlockCount = aLitCounter;
- doLargeBlockUpdate(aBlocksToUpdate);
- }
-
- public void doLargeBlockUpdate(AutoMap<BlockPos> aUpdateMap) {
- if (aUpdateMap.isEmpty()) {
- return;
- }
- for (BlockPos p : aUpdateMap) {
- //this.worldObj.markBlockForUpdate(p.xPos, p.yPos, p.zPos);
- //this.worldObj.markBlocksDirtyVertical(p_72975_1_, p_72975_2_, p_72975_3_, p_72975_4_);
- }
- }
-
- }
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+ // propecia (Inhibit DHD - recover hair get depression)
+
+ public BlockSuperLight() {
+ super(Material.circuits);
+ this.setBlockName("blockSuperLight");
+ this.setCreativeTab(CreativeTabs.tabRedstone);
+ GameRegistry.registerBlock(this, "blockSuperLight");
+ LanguageRegistry.addName(this, "Shining Star");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return this.blockIcon;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlBigBlue");
+ }
+
+ /**
+ * Returns a new instance of a block's tile entity class. Called on placing the
+ * block.
+ */
+ public TileEntity createNewTileEntity(World aWorld, int p_149915_2_) {
+ return new TileEntitySuperLight();
+ }
+
+ public static class TileEntitySuperLight extends TileEntity {
+
+ private long mCreated;
+
+ private long mLastUpdateTick = 0;
+
+ private int mLitBlockCount = 0;
+
+ private int[][][][] aLitBlocks = new int[50][10][50][1];
+
+ private boolean mPowered = false;
+
+ public TileEntitySuperLight() {
+ mCreated = System.currentTimeMillis();
+ Logger.INFO("Created Super-Lamp");
+ }
+
+ public void readFromNBT(NBTTagCompound aNBT) {
+ super.readFromNBT(aNBT);
+ mCreated = aNBT.getLong("mCreated");
+ mPowered = aNBT.getBoolean("mPowered");
+ NBTTagCompound aLightingData = aNBT.getCompoundTag("lighting");
+ for (int x = 0; x < 50; x++) {
+ for (int y = 0; y < 10; y++) {
+ for (int z = 0; z < 50; z++) {
+ int aData = aLightingData.getInteger("[" + x + "][" + y + "][" + z + "]");
+ aLitBlocks[x][y][z][0] = aData;
+ }
+ }
+ }
+ }
+
+ public void writeToNBT(NBTTagCompound aNBT) {
+ super.writeToNBT(aNBT);
+ aNBT.setLong("mCreated", mCreated);
+ aNBT.setBoolean("mPowered", mPowered);
+ NBTTagCompound aLightingData = new NBTTagCompound();
+ for (int x = 0; x < 50; x++) {
+ for (int y = 0; y < 10; y++) {
+ for (int z = 0; z < 50; z++) {
+ int aFlag = aLitBlocks[x][y][z][0];
+ aLightingData.setInteger("[" + x + "][" + y + "][" + z + "]", aFlag);
+ }
+ }
+ }
+ aNBT.setTag("lighting", aLightingData);
+ }
+
+ @Override
+ public void updateEntity() {
+ super.updateEntity();
+
+ if (this.worldObj.isRemote) {
+ return;
+ }
+
+ try {
+ if (mLastUpdateTick == 0 || (System.currentTimeMillis() - mLastUpdateTick) >= 30000) {
+ boolean powered =
+ (this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord));
+ boolean aLastState = mPowered;
+ // Logger.INFO("Powered: "+powered);
+ mPowered = powered;
+ if (mPowered != aLastState) {
+ updateLighting(powered);
+ }
+ }
+ } catch (Throwable t) {
+ }
+ }
+
+ @Override
+ public void markDirty() {
+ super.markDirty();
+ }
+
+ @Override
+ public boolean canUpdate() {
+ return super.canUpdate();
+ }
+
+ public void updateLighting(boolean enable) {
+
+ mLastUpdateTick = System.currentTimeMillis();
+
+ if (false) {
+ return;
+ }
+
+ aLitBlocks = new int[50][10][50][1];
+ int aLitCounter = 0;
+ AutoMap<BlockPos> aBlocksToUpdate = new AutoMap<BlockPos>();
+ Logger.INFO("Trying to relight area.");
+
+ BlockPos aStartIterationPoint =
+ new BlockPos(this.xCoord - 24, this.yCoord - 4, this.zCoord - 24, this.worldObj);
+ for (int x = 0; x < 50; x++) {
+ for (int y = 0; y < 10; y++) {
+ for (int z = 0; z < 50; z++) {
+ int xOff = aStartIterationPoint.xPos + x;
+ int yOff = aStartIterationPoint.yPos + y;
+ int zOff = aStartIterationPoint.zPos + z;
+ Block aBlockGet = this.worldObj.getBlock(xOff, yOff, zOff);
+ if (aBlockGet != null) {
+ if (aBlockGet instanceof BlockAir || aBlockGet instanceof LightGlass) {
+
+ int aLight = aBlockGet.getLightValue();
+
+ // Don't Need to relight anything.
+ if ((enable && aLight > 0) || (!enable && aLight == 0)) {
+ continue;
+ }
+ // Turning Lights on
+ else if (enable && aLight == 0) {
+ aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj));
+ if (aBlockGet instanceof BlockAir) {
+ Logger.INFO("Lit air.");
+ this.worldObj.setBlock(
+ xOff, yOff, zOff, ModBlocks.MatterFabricatorEffectBlock, 0, 3);
+ }
+ // aBlockGet.setLightLevel(15);
+ aLitCounter++;
+ }
+ // Turning Lights off
+ else if (!enable && aLight > 0) {
+ aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj));
+ if (aBlockGet instanceof LightGlass) {
+ Logger.INFO("Dimmed air.");
+ this.worldObj.setBlock(xOff, yOff, zOff, Blocks.air, 0, 3);
+ }
+ // aBlockGet.setLightLevel(0);
+ }
+ aLitBlocks[x][y][z][0] = enable ? 15 : 0;
+ } else {
+ aLitBlocks[x][y][z][0] = -1;
+ }
+ } else {
+ aLitBlocks[x][y][z][0] = -1;
+ }
+ }
+ }
+ }
+ mLitBlockCount = aLitCounter;
+ doLargeBlockUpdate(aBlocksToUpdate);
+ }
+
+ public void doLargeBlockUpdate(AutoMap<BlockPos> aUpdateMap) {
+ if (aUpdateMap.isEmpty()) {
+ return;
+ }
+ for (BlockPos p : aUpdateMap) {
+ // this.worldObj.markBlockForUpdate(p.xPos, p.yPos, p.zPos);
+ // this.worldObj.markBlocksDirtyVertical(p_72975_1_, p_72975_2_, p_72975_3_, p_72975_4_);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java b/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java
index f7f0b446ce..05d83cf133 100644
--- a/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java
+++ b/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.block.general;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -9,6 +7,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.itemblock.ItemBlockEntityBase;
import gtPlusPlus.core.lib.CORE;
+import java.util.Random;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -21,172 +20,183 @@ import net.minecraft.world.World;
public class BlockTankXpConverter extends BlockContainer {
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- @SuppressWarnings("deprecation")
- public BlockTankXpConverter() {
- super(Material.iron);
- this.setBlockName("blockTankXpConverter");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockEntityBase.class, "blockTankXpConverter");
- LanguageRegistry.addName(this, "Xp Converter");
- this.generateRainbowMap();
- if (!this.getTickRandomly()) {
- this.setTickRandomly(true);
- }
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
- return p_149691_1_ == 1 ? this.textureTop
- : (p_149691_1_ == 0 ? this.textureBottom
- : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlGray");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlGray");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlGray");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlGray");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int side, final float lx, final float ly, final float lz) {
-
- return true;
-
- /*
- if (world.isRemote) {
- return true;
- }
- else {
- boolean mDidScrewDriver = false;
- // Check For Screwdriver
- try {
- final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
- final Item mHandItem = mHandStack.getItem();
- if (((mHandItem instanceof GT_MetaGenerated_Tool_01)
- && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) {
- final TileEntityXpConverter tile = (TileEntityXpConverter) world.getTileEntity(x, y, z);
- if (tile != null) {
- mDidScrewDriver = true;
- tile.onScrewdriverRightClick((byte) side, player, x, y, z);
- }
-
- }
- }
- catch (final Throwable t) {
- mDidScrewDriver = false;
- }
-
- if (!mDidScrewDriver) {
-
- try {
- final TileEntityXpConverter tile = (TileEntityXpConverter) world.getTileEntity(x, y, z);
- if (tile != null) {
- tile.onRightClick((byte) side, player, x, y, z);
- }
- }
- catch (final Throwable t) {
- }
-
- final TileEntityXpConverter tank = (TileEntityXpConverter) world.getTileEntity(x, y, z);
- if (tank != null) {
- if (tank.tankEssence.getFluid() != null) {
- PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankEssence.getFluidAmount()
- + "L of " + tank.tankEssence.getFluid().getLocalizedName());
- }
- if (tank.tankLiquidXp.getFluid() != null) {
- PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankLiquidXp.getFluidAmount()
- + "L of " + tank.tankLiquidXp.getFluid().getLocalizedName());
- }
- if ((tank.tankEssence.getFluid() != null) && (tank.tankLiquidXp.getFluid() != null)) {
- PlayerUtils.messagePlayer(player, "This is worth "
- + EnchantingUtils.getLevelForLiquid(tank.tankLiquidXp.getFluidAmount()) + " levels.");
- }
- }
- }
- }
- return true;
- */}
-
- @Override
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- //return new TileEntityXpConverter();
- return null;
- }
-
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-
- private final boolean generateRainbowMap() {
- return true;
- }
-
- @Override
- public int getBlockColor() {
- return super.getBlockColor();
- }
-
- @Override
- public int colorMultiplier(final IBlockAccess p_149720_1_, final int p_149720_2_, final int p_149720_3_,
- final int p_149720_4_) {
- return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_);
- }
-
- @Override
- public void updateTick(final World world, final int x, final int y, final int z, final Random rand) {
- // this.mRainbowTick++;
- super.updateTick(world, x, y, z, rand);
- }
-
- @Override
- public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
- //this.mRainbowTick++;
- super.randomDisplayTick(world, x, y, z, rand);
- }
-
- @Override
- public int tickRate(final World p_149738_1_) {
- return 20;
- }
-
- @Override
- public int getLightValue() {
- return 6;
- }
-
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+
+ @SuppressWarnings("deprecation")
+ public BlockTankXpConverter() {
+ super(Material.iron);
+ this.setBlockName("blockTankXpConverter");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockEntityBase.class, "blockTankXpConverter");
+ LanguageRegistry.addName(this, "Xp Converter");
+ this.generateRainbowMap();
+ if (!this.getTickRandomly()) {
+ this.setTickRandomly(true);
+ }
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 1
+ ? this.textureTop
+ : (p_149691_1_ == 0
+ ? this.textureBottom
+ : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlGray");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlGray");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlGray");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlGray");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+
+ return true;
+
+ /*
+ if (world.isRemote) {
+ return true;
+ }
+ else {
+ boolean mDidScrewDriver = false;
+ // Check For Screwdriver
+ try {
+ final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
+ final Item mHandItem = mHandStack.getItem();
+ if (((mHandItem instanceof GT_MetaGenerated_Tool_01)
+ && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) {
+ final TileEntityXpConverter tile = (TileEntityXpConverter) world.getTileEntity(x, y, z);
+ if (tile != null) {
+ mDidScrewDriver = true;
+ tile.onScrewdriverRightClick((byte) side, player, x, y, z);
+ }
+
+ }
+ }
+ catch (final Throwable t) {
+ mDidScrewDriver = false;
+ }
+
+ if (!mDidScrewDriver) {
+
+ try {
+ final TileEntityXpConverter tile = (TileEntityXpConverter) world.getTileEntity(x, y, z);
+ if (tile != null) {
+ tile.onRightClick((byte) side, player, x, y, z);
+ }
+ }
+ catch (final Throwable t) {
+ }
+
+ final TileEntityXpConverter tank = (TileEntityXpConverter) world.getTileEntity(x, y, z);
+ if (tank != null) {
+ if (tank.tankEssence.getFluid() != null) {
+ PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankEssence.getFluidAmount()
+ + "L of " + tank.tankEssence.getFluid().getLocalizedName());
+ }
+ if (tank.tankLiquidXp.getFluid() != null) {
+ PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankLiquidXp.getFluidAmount()
+ + "L of " + tank.tankLiquidXp.getFluid().getLocalizedName());
+ }
+ if ((tank.tankEssence.getFluid() != null) && (tank.tankLiquidXp.getFluid() != null)) {
+ PlayerUtils.messagePlayer(player, "This is worth "
+ + EnchantingUtils.getLevelForLiquid(tank.tankLiquidXp.getFluidAmount()) + " levels.");
+ }
+ }
+ }
+ }
+ return true;
+ */ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ // return new TileEntityXpConverter();
+ return null;
+ }
+
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ private final boolean generateRainbowMap() {
+ return true;
+ }
+
+ @Override
+ public int getBlockColor() {
+ return super.getBlockColor();
+ }
+
+ @Override
+ public int colorMultiplier(
+ final IBlockAccess p_149720_1_, final int p_149720_2_, final int p_149720_3_, final int p_149720_4_) {
+ return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_);
+ }
+
+ @Override
+ public void updateTick(final World world, final int x, final int y, final int z, final Random rand) {
+ // this.mRainbowTick++;
+ super.updateTick(world, x, y, z, rand);
+ }
+
+ @Override
+ public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
+ // this.mRainbowTick++;
+ super.randomDisplayTick(world, x, y, z, rand);
+ }
+
+ @Override
+ public int tickRate(final World p_149738_1_) {
+ return 20;
+ }
+
+ @Override
+ public int getLightValue() {
+ return 6;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/FirePit.java b/src/main/java/gtPlusPlus/core/block/general/FirePit.java
index 6f35715c48..92a22c5d7f 100644
--- a/src/main/java/gtPlusPlus/core/block/general/FirePit.java
+++ b/src/main/java/gtPlusPlus/core/block/general/FirePit.java
@@ -2,14 +2,15 @@ package gtPlusPlus.core.block.general;
import static net.minecraftforge.common.util.ForgeDirection.*;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.block.base.BasicBlock;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.tileentities.general.TileEntityFirepit;
+import java.util.List;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -20,211 +21,221 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-
-import gtPlusPlus.core.block.base.BasicBlock;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.tileentities.general.TileEntityFirepit;
import net.minecraftforge.common.util.ForgeDirection;
-public class FirePit extends BasicBlock{
- private static IIcon[] TEXTURE;
- public static final int META_ANTIBUILDER = 2;
- private int meta;
-
- @SuppressWarnings("deprecation")
- public FirePit() {
- super("blockFirePit", Material.wood);
- this.setBlockName("blockFirePit");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setHardness(10.0F);
- this.setResistance(35.0F);
- this.setStepSound(Block.soundTypeWood);
- GameRegistry.registerBlock(this, "blockFirePit");
- LanguageRegistry.addName(this, "Fire Pit");
- }
-
- @Override
- public int tickRate(final World aParWorld) {
- return 30;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int i) {
- return new TileEntityFirepit();
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister par1IconRegister){
- TEXTURE = new IIcon[] {par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"), par1IconRegister.registerIcon(this.getTextureName() + "_layer_1")};
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List){
- par3List.add(new ItemStack(par1, 1, 2));
- }
-
- @Override
- public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random){
- if (!par1World.isRemote){
- //Sets meta.
- this.meta = par1World.getBlockMetadata(x, y, z);
- //If Raining, Put out.
- if (par1World.isRaining()
- && (par1World.canLightningStrikeAt(x, y, z)
- || par1World.canLightningStrikeAt(x - 1, y, z)
- || par1World.canLightningStrikeAt(x + 1, y, z)
- || par1World.canLightningStrikeAt(x, y, z - 1)
- || par1World.canLightningStrikeAt(x, y, z + 1))){
- //Fire goes out
- par1World.setBlockMetadataWithNotify(x, y, z, 1, 4);
- }
- if (isNeighborBurning(par1World, x, y, z)){
- //Fire can ignite from a nearby flame source.
- par1World.setBlockMetadataWithNotify(x, y, z, 2, 4);
- }
- }
- }
-
- @Override
- public Item getItemDropped(final int meta, final Random par2Random, final int par3){
- switch (meta){
- case 0:
- return null;
- default:
- break;
- }
- return Item.getItemFromBlock(this);
- }
-
- @Override
- public int damageDropped(final int meta){
- return meta;
- }
-
- @Override
- public boolean isOpaqueCube(){
- return false;
- }
-
- @Override
- public int getRenderType(){
- return -1;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderBlockPass(){
- return 1;
- }
-
- @Override
- public boolean renderAsNormalBlock(){
- return false;
- }
-
- /*@Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aParWorld, int x, int y, int z){
- return null;
- }*/
-
- @Override
- protected boolean canSilkHarvest(){
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(final World p_149734_1_, final int p_149734_2_, final int p_149734_3_, final int p_149734_4_, final Random p_149734_5_){
- int l;
- float f;
- float f1;
- float f2;
- if (this.meta == 2) {
- if (p_149734_5_.nextInt(24) == 0){
- p_149734_1_.playSound(p_149734_2_ + 0.5F, p_149734_3_ + 0.5F, p_149734_4_ + 0.5F, "fire.fire", 1.0F + p_149734_5_.nextFloat(), (p_149734_5_.nextFloat() * 0.7F) + 0.3F, false);
- }
- }
- if (this.meta == 2) {
- if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)){
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)){
- for (l = 0; l < 2; ++l){
- f = p_149734_2_ + (p_149734_5_.nextFloat() * 0.1F);
- f1 = p_149734_3_ + p_149734_5_.nextFloat();
- f2 = p_149734_4_ + p_149734_5_.nextFloat();
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)){
- for (l = 0; l < 2; ++l){
- f = p_149734_2_ + 1 - (p_149734_5_.nextFloat() * 0.1F);
- f1 = p_149734_3_ + p_149734_5_.nextFloat();
- f2 = p_149734_4_ + p_149734_5_.nextFloat();
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)){
- for (l = 0; l < 2; ++l){
- f = p_149734_2_ + p_149734_5_.nextFloat();
- f1 = p_149734_3_ + p_149734_5_.nextFloat();
- f2 = p_149734_4_ + (p_149734_5_.nextFloat() * 0.1F);
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)){
- for (l = 0; l < 2; ++l){
- f = p_149734_2_ + p_149734_5_.nextFloat();
- f1 = p_149734_3_ + p_149734_5_.nextFloat();
- f2 = p_149734_4_ + 1 - (p_149734_5_.nextFloat() * 0.1F);
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)){
- for (l = 0; l < 2; ++l){
- f = p_149734_2_ + p_149734_5_.nextFloat();
- f1 = p_149734_3_ + 1 - (p_149734_5_.nextFloat() * 0.1F);
- f2 = p_149734_4_ + p_149734_5_.nextFloat();
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- }
- else{
- if (this.meta == 2) {
- for (l = 0; l < 3; ++l){
- f = p_149734_2_ + p_149734_5_.nextFloat();
- f1 = p_149734_3_ + (p_149734_5_.nextFloat() * 0.5F) + 0.5F;
- f2 = p_149734_4_ + p_149734_5_.nextFloat();
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- }
- }
- }
-
- @SideOnly(Side.CLIENT)
- public static IIcon getFireIcon(final int p_149840_1_){
- return FirePit.TEXTURE[p_149840_1_];
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_){
- return FirePit.TEXTURE[0];
- }
-
- private static boolean isNeighborBurning(final World world, final int x, final int y, final int z){
- return canCatchFire(world, x + 1, y, z, WEST ) ||
- canCatchFire(world, x - 1, y, z, EAST ) ||
- canCatchFire(world, x, y - 1, z, UP ) ||
- canCatchFire(world, x, y + 1, z, DOWN ) ||
- canCatchFire(world, x, y, z - 1, SOUTH) ||
- canCatchFire(world, x, y, z + 1, NORTH);
- }
-
- public static boolean canCatchFire(final World world, final int x, final int y, final int z, final ForgeDirection face)
- {
- return world.getBlock(x, y, z).isFireSource(world, x, y, z, face);
- }
-
+public class FirePit extends BasicBlock {
+ private static IIcon[] TEXTURE;
+ public static final int META_ANTIBUILDER = 2;
+ private int meta;
+
+ @SuppressWarnings("deprecation")
+ public FirePit() {
+ super("blockFirePit", Material.wood);
+ this.setBlockName("blockFirePit");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setHardness(10.0F);
+ this.setResistance(35.0F);
+ this.setStepSound(Block.soundTypeWood);
+ GameRegistry.registerBlock(this, "blockFirePit");
+ LanguageRegistry.addName(this, "Fire Pit");
+ }
+
+ @Override
+ public int tickRate(final World aParWorld) {
+ return 30;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int i) {
+ return new TileEntityFirepit();
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister par1IconRegister) {
+ TEXTURE = new IIcon[] {
+ par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"),
+ par1IconRegister.registerIcon(this.getTextureName() + "_layer_1")
+ };
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
+ par3List.add(new ItemStack(par1, 1, 2));
+ }
+
+ @Override
+ public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random) {
+ if (!par1World.isRemote) {
+ // Sets meta.
+ this.meta = par1World.getBlockMetadata(x, y, z);
+ // If Raining, Put out.
+ if (par1World.isRaining()
+ && (par1World.canLightningStrikeAt(x, y, z)
+ || par1World.canLightningStrikeAt(x - 1, y, z)
+ || par1World.canLightningStrikeAt(x + 1, y, z)
+ || par1World.canLightningStrikeAt(x, y, z - 1)
+ || par1World.canLightningStrikeAt(x, y, z + 1))) {
+ // Fire goes out
+ par1World.setBlockMetadataWithNotify(x, y, z, 1, 4);
+ }
+ if (isNeighborBurning(par1World, x, y, z)) {
+ // Fire can ignite from a nearby flame source.
+ par1World.setBlockMetadataWithNotify(x, y, z, 2, 4);
+ }
+ }
+ }
+
+ @Override
+ public Item getItemDropped(final int meta, final Random par2Random, final int par3) {
+ switch (meta) {
+ case 0:
+ return null;
+ default:
+ break;
+ }
+ return Item.getItemFromBlock(this);
+ }
+
+ @Override
+ public int damageDropped(final int meta) {
+ return meta;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ public int getRenderType() {
+ return -1;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ /*@Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aParWorld, int x, int y, int z){
+ return null;
+ }*/
+
+ @Override
+ protected boolean canSilkHarvest() {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(
+ final World p_149734_1_,
+ final int p_149734_2_,
+ final int p_149734_3_,
+ final int p_149734_4_,
+ final Random p_149734_5_) {
+ int l;
+ float f;
+ float f1;
+ float f2;
+ if (this.meta == 2) {
+ if (p_149734_5_.nextInt(24) == 0) {
+ p_149734_1_.playSound(
+ p_149734_2_ + 0.5F,
+ p_149734_3_ + 0.5F,
+ p_149734_4_ + 0.5F,
+ "fire.fire",
+ 1.0F + p_149734_5_.nextFloat(),
+ (p_149734_5_.nextFloat() * 0.7F) + 0.3F,
+ false);
+ }
+ }
+ if (this.meta == 2) {
+ if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_)
+ && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)) {
+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)) {
+ for (l = 0; l < 2; ++l) {
+ f = p_149734_2_ + (p_149734_5_.nextFloat() * 0.1F);
+ f1 = p_149734_3_ + p_149734_5_.nextFloat();
+ f2 = p_149734_4_ + p_149734_5_.nextFloat();
+ p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)) {
+ for (l = 0; l < 2; ++l) {
+ f = p_149734_2_ + 1 - (p_149734_5_.nextFloat() * 0.1F);
+ f1 = p_149734_3_ + p_149734_5_.nextFloat();
+ f2 = p_149734_4_ + p_149734_5_.nextFloat();
+ p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)) {
+ for (l = 0; l < 2; ++l) {
+ f = p_149734_2_ + p_149734_5_.nextFloat();
+ f1 = p_149734_3_ + p_149734_5_.nextFloat();
+ f2 = p_149734_4_ + (p_149734_5_.nextFloat() * 0.1F);
+ p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)) {
+ for (l = 0; l < 2; ++l) {
+ f = p_149734_2_ + p_149734_5_.nextFloat();
+ f1 = p_149734_3_ + p_149734_5_.nextFloat();
+ f2 = p_149734_4_ + 1 - (p_149734_5_.nextFloat() * 0.1F);
+ p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)) {
+ for (l = 0; l < 2; ++l) {
+ f = p_149734_2_ + p_149734_5_.nextFloat();
+ f1 = p_149734_3_ + 1 - (p_149734_5_.nextFloat() * 0.1F);
+ f2 = p_149734_4_ + p_149734_5_.nextFloat();
+ p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ } else {
+ if (this.meta == 2) {
+ for (l = 0; l < 3; ++l) {
+ f = p_149734_2_ + p_149734_5_.nextFloat();
+ f1 = p_149734_3_ + (p_149734_5_.nextFloat() * 0.5F) + 0.5F;
+ f2 = p_149734_4_ + p_149734_5_.nextFloat();
+ p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public static IIcon getFireIcon(final int p_149840_1_) {
+ return FirePit.TEXTURE[p_149840_1_];
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return FirePit.TEXTURE[0];
+ }
+
+ private static boolean isNeighborBurning(final World world, final int x, final int y, final int z) {
+ return canCatchFire(world, x + 1, y, z, WEST)
+ || canCatchFire(world, x - 1, y, z, EAST)
+ || canCatchFire(world, x, y - 1, z, UP)
+ || canCatchFire(world, x, y + 1, z, DOWN)
+ || canCatchFire(world, x, y, z - 1, SOUTH)
+ || canCatchFire(world, x, y, z + 1, NORTH);
+ }
+
+ public static boolean canCatchFire(
+ final World world, final int x, final int y, final int z, final ForgeDirection face) {
+ return world.getBlock(x, y, z).isFireSource(world, x, y, z, face);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/FluidTankInfinite.java b/src/main/java/gtPlusPlus/core/block/general/FluidTankInfinite.java
index b979f7864b..3f4a057221 100644
--- a/src/main/java/gtPlusPlus/core/block/general/FluidTankInfinite.java
+++ b/src/main/java/gtPlusPlus/core/block/general/FluidTankInfinite.java
@@ -24,113 +24,125 @@ import net.minecraftforge.fluids.ItemFluidContainer;
public class FluidTankInfinite extends BlockContainer {
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
- @SuppressWarnings("deprecation")
- public FluidTankInfinite() {
- super(Material.iron);
- this.setBlockName("blockInfiniteFluidTank");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, "blockInfiniteFluidTank");
- LanguageRegistry.addName(this, "Infinite Fluid Tank");
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
- }
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
- return p_149691_1_ == 1 ? this.textureTop
- : (p_149691_1_ == 0 ? this.textureBottom
- : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
- }
+ @SuppressWarnings("deprecation")
+ public FluidTankInfinite() {
+ super(Material.iron);
+ this.setBlockName("blockInfiniteFluidTank");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, "blockInfiniteFluidTank");
+ LanguageRegistry.addName(this, "Infinite Fluid Tank");
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "Generic_Creative_Texture");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "Generic_Creative_Texture");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "Generic_Creative_Texture");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "Generic_Creative_Texture");
- }
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 1
+ ? this.textureTop
+ : (p_149691_1_ == 0
+ ? this.textureBottom
+ : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
+ }
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int side, final float lx, final float ly, final float lz) {
- if (world.isRemote) {
- return true;
- } else {
- TileEntityInfiniteFluid tank = (TileEntityInfiniteFluid) world.getTileEntity(x, y, z);
- if (tank != null) {
- Item handItem;
- try {
- handItem = player.getHeldItem().getItem();
- } catch (Throwable t) {
- handItem = null;
- }
- if (handItem != null
- && (handItem instanceof IFluidContainerItem || handItem instanceof ItemFluidContainer
- || FluidContainerRegistry.isFilledContainer(player.getHeldItem()))) {
- if (tank.tank.getFluid() == null) {
- try {
- if (!FluidContainerRegistry.isFilledContainer(player.getHeldItem())) {
- ItemStack handItemStack = player.getHeldItem();
- IFluidContainerItem container = (IFluidContainerItem) handItem;
- FluidStack containerFluid = container.getFluid(handItemStack);
- container.drain(handItemStack, container.getFluid(handItemStack).amount, true);
- tank.tank.setFluid(containerFluid);
- } else {
- ItemStack handItemStack = player.getHeldItem();
- FluidContainerRegistry.drainFluidContainer(handItemStack);
- FluidStack containerFluid = FluidContainerRegistry.getFluidForFilledItem(handItemStack);
- ItemStack emptyContainer = FluidContainerRegistry.drainFluidContainer(handItemStack);
- player.setItemInUse(emptyContainer, 0);
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "Generic_Creative_Texture");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "Generic_Creative_Texture");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "Generic_Creative_Texture");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "Generic_Creative_Texture");
+ }
- tank.tank.setFluid(containerFluid);
- }
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ } else {
+ TileEntityInfiniteFluid tank = (TileEntityInfiniteFluid) world.getTileEntity(x, y, z);
+ if (tank != null) {
+ Item handItem;
+ try {
+ handItem = player.getHeldItem().getItem();
+ } catch (Throwable t) {
+ handItem = null;
+ }
+ if (handItem != null
+ && (handItem instanceof IFluidContainerItem
+ || handItem instanceof ItemFluidContainer
+ || FluidContainerRegistry.isFilledContainer(player.getHeldItem()))) {
+ if (tank.tank.getFluid() == null) {
+ try {
+ if (!FluidContainerRegistry.isFilledContainer(player.getHeldItem())) {
+ ItemStack handItemStack = player.getHeldItem();
+ IFluidContainerItem container = (IFluidContainerItem) handItem;
+ FluidStack containerFluid = container.getFluid(handItemStack);
+ container.drain(handItemStack, container.getFluid(handItemStack).amount, true);
+ tank.tank.setFluid(containerFluid);
+ } else {
+ ItemStack handItemStack = player.getHeldItem();
+ FluidContainerRegistry.drainFluidContainer(handItemStack);
+ FluidStack containerFluid = FluidContainerRegistry.getFluidForFilledItem(handItemStack);
+ ItemStack emptyContainer = FluidContainerRegistry.drainFluidContainer(handItemStack);
+ player.setItemInUse(emptyContainer, 0);
- }
- if (tank.tank.getFluid() != null) {
- PlayerUtils.messagePlayer(player, "This tank contains " + tank.tank.getFluidAmount() + "L of "
- + tank.tank.getFluid().getLocalizedName());
- }
- }
- }
- return true;
- }
+ tank.tank.setFluid(containerFluid);
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ if (tank.tank.getFluid() != null) {
+ PlayerUtils.messagePlayer(
+ player,
+ "This tank contains " + tank.tank.getFluidAmount() + "L of "
+ + tank.tank.getFluid().getLocalizedName());
+ }
+ }
+ }
+ return true;
+ }
- @Override
- public int getRenderBlockPass() {
- return 1;
- }
+ @Override
+ public int getRenderBlockPass() {
+ return 1;
+ }
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityInfiniteFluid();
- }
-
- @Override
- public void onBlockAdded(World world, int x, int y, int z) {
- super.onBlockAdded(world, x, y, z);
- }
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityInfiniteFluid();
+ }
+ @Override
+ public void onBlockAdded(World world, int x, int y, int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/HellFire.java b/src/main/java/gtPlusPlus/core/block/general/HellFire.java
index 233f200815..f2c9c1a319 100644
--- a/src/main/java/gtPlusPlus/core/block/general/HellFire.java
+++ b/src/main/java/gtPlusPlus/core/block/general/HellFire.java
@@ -2,17 +2,18 @@ package gtPlusPlus.core.block.general;
import static net.minecraftforge.common.util.ForgeDirection.*;
-import java.util.IdentityHashMap;
-import java.util.Map.Entry;
-import java.util.Random;
-
import com.google.common.collect.Maps;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.random.XSTR;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.math.MathUtils;
+import java.util.IdentityHashMap;
+import java.util.Map.Entry;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFire;
import net.minecraft.block.material.MapColor;
@@ -23,535 +24,552 @@ import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.random.XSTR;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.math.MathUtils;
import net.minecraftforge.common.util.ForgeDirection;
public class HellFire extends BlockFire {
- @Deprecated
- private final int[] field_149849_a = new int[Short.MAX_VALUE];
- @Deprecated
- private final int[] field_149848_b = new int[Short.MAX_VALUE];
- @SideOnly(Side.CLIENT)
- private IIcon[] IIconArray;
-
- public HellFire() {
- this.setTickRandomly(true);
- this.setLightLevel(1F);
- this.setLightOpacity(0);
- //this.setBlockTextureName(CORE.MODID + "hellfire/blockHellFire");
- this.setBlockName("blockHellFire");
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- GameRegistry.registerBlock(this, "blockHellFire");
- LanguageRegistry.addName(this, "Hellish Fire");
- this.enableBrutalFire();
- }
-
- private void enableBrutalFire() {
- for (final Object o : Block.blockRegistry.getKeys())
- {
-
- try {
-
- final String name = (String)o;
- final Block b = Block.getBlockFromName(name);
- if (b != Blocks.air)
- {
- final int spread = Blocks.fire.getEncouragement(b);
- final int flamm = Blocks.fire.getFlammability(b);
- if (flamm > 0 && spread > 0) {
- this.setFireInfo(b, spread * 4, flamm * 4);
- }
- }
-
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- //Special Case madness
- this.setFireInfo(Blocks.brown_mushroom_block, 20, 100);
- this.setFireInfo(Blocks.red_mushroom_block, 20, 100);
- this.setFireInfo(Blocks.grass, 20, 100);
- this.setFireInfo(Blocks.mycelium, 20, 100);
-
- }
-
- /**
- * How many world ticks before ticking
- */
- @Override
- public int tickRate(final World world) {
- return 5;
- }
-
- /**
- * Ticks the block if it's been scheduled
- */
- @Override
- public void updateTick(final World world, final int x, final int y, final int z, Random random) {
-
- random = new XSTR();
-
- if (world.getGameRules().getGameRuleBooleanValue("doFireTick")) {
- final boolean flag = world.getBlock(x, y - 1, z).isFireSource(world, x, y - 1, z, UP);
-
- if (!this.canPlaceBlockAt(world, x, y, z)) {
- world.setBlockToAir(x, y, z);
- }
-
- if (!flag && world.isRaining()
- && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z)
- || world.canLightningStrikeAt(x + 1, y, z) || world.canLightningStrikeAt(x, y, z - 1)
- || world.canLightningStrikeAt(x, y, z + 1))) {
-
- if (MathUtils.randInt(0, 100) >= 90){
- world.setBlockToAir(x, y, z);
- }
- }
- else {
- final int blockMeta = world.getBlockMetadata(x, y, z);
-
- if (blockMeta < 15) {
- world.setBlockMetadataWithNotify(x, y, z, blockMeta + (random.nextInt(3) / 2), 4);
- }
-
- world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + random.nextInt(10));
-
- if (!flag && !this.canNeighborBurn(world, x, y, z)) {
- if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) || (blockMeta > 3)) {
- world.setBlockToAir(x, y, z);
- }
- }
- else if (!flag && !this.canCatchFire(world, x, y - 1, z, UP) && (blockMeta == 15) && (random.nextInt(4) == 0)) {
- world.setBlockToAir(x, y, z);
- }
- else {
- final boolean flag1 = world.isBlockHighHumidity(x, y, z);
- byte b0 = 0;
-
- if (flag1) {
- b0 = -50;
- }
-
- this.tryCatchFire(world, x + 1, y, z, 300 + b0, random, blockMeta, WEST);
- this.tryCatchFire(world, x - 1, y, z, 300 + b0, random, blockMeta, EAST);
- this.tryCatchFire(world, x, y - 1, z, 250 + b0, random, blockMeta, UP);
- this.tryCatchFire(world, x, y + 1, z, 250 + b0, random, blockMeta, DOWN);
- this.tryCatchFire(world, x, y, z - 1, 300 + b0, random, blockMeta, SOUTH);
- this.tryCatchFire(world, x, y, z + 1, 300 + b0, random, blockMeta, NORTH);
-
- for (int i1 = x - 1; i1 <= (x + 1); ++i1) {
- for (int j1 = z - 1; j1 <= (z + 1); ++j1) {
- for (int k1 = y - 1; k1 <= (y + 4); ++k1) {
- if ((i1 != x) || (k1 != y) || (j1 != z)) {
- int l1 = 100;
-
- if (k1 > (y + 1)) {
- l1 += (k1 - (y + 1)) * 100;
- }
-
- final int neighbourFireChance = this.getChanceOfNeighborsEncouragingFire(world, i1, k1, j1);
-
- if (neighbourFireChance > 0) {
- int j2 = (neighbourFireChance + 40 + (world.difficultySetting.getDifficultyId() * 14)) / (blockMeta + 30);
-
- if (flag1) {
- j2 /= 2;
- }
-
- if ((j2 > 0) && (random.nextInt(l1) <= j2)
- && (!world.isRaining() || !world.canLightningStrikeAt(i1, k1, j1))
- && !world.canLightningStrikeAt(i1 - 1, k1, z)
- && !world.canLightningStrikeAt(i1 + 1, k1, j1)
- && !world.canLightningStrikeAt(i1, k1, j1 - 1)
- && !world.canLightningStrikeAt(i1, k1, j1 + 1)) {
- int k2 = blockMeta + (random.nextInt(5) / 4);
-
- if (k2 > 15) {
- k2 = 15;
- }
-
- world.setBlock(i1, k1, j1, this, k2, 3);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- private void tryCatchFire(final World world, final int p_149841_2_, final int p_149841_3_, final int p_149841_4_, final int p_149841_5_, final Random p_149841_6_, final int p_149841_7_, final ForgeDirection face) {
- final int j1 = world.getBlock(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(world, p_149841_2_,
- p_149841_3_, p_149841_4_, face);
-
- if (p_149841_6_.nextInt(p_149841_5_) < j1) {
- final boolean flag = world.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt;
-
- if ((p_149841_6_.nextInt(p_149841_7_ + 10) < 5)
- && !world.canLightningStrikeAt(p_149841_2_, p_149841_3_, p_149841_4_)) {
- int k1 = p_149841_7_ + (p_149841_6_.nextInt(5) / 4);
-
- if (k1 > 15) {
- k1 = 15;
- }
-
- world.setBlock(p_149841_2_, p_149841_3_, p_149841_4_, this, k1, 3);
- }
- else {
- world.setBlockToAir(p_149841_2_, p_149841_3_, p_149841_4_);
- }
-
- if (flag) {
- Blocks.tnt.onBlockDestroyedByPlayer(world, p_149841_2_, p_149841_3_, p_149841_4_, 1);
- }
- }
- }
-
- /**
- * Returns true if at least one block next to this one can burn.
- */
- private boolean canNeighborBurn(final World world, final int x, final int y, final int z) {
- return this.canCatchFire(world, x + 1, y, z, WEST)
- || this.canCatchFire(world, x - 1, y, z, EAST)
- || this.canCatchFire(world, x, y - 1, z, UP)
- || this.canCatchFire(world, x, y + 1, z, DOWN)
- || this.canCatchFire(world, x, y, z - 1, SOUTH)
- || this.canCatchFire(world, x, y, z + 1, NORTH);
- }
-
- /**
- * Gets the highest chance of a neighbor block encouraging this block to
- * catch fire
- */
- private int getChanceOfNeighborsEncouragingFire(final World world, final int x, final int y, final int z) {
- final byte b0 = 0;
-
- if (!world.isAirBlock(x, y, z)) {
- return 0;
- }
- else {
- int l = b0;
- l = this.getChanceToEncourageFire(world, x + 1, y, z, l, WEST);
- l = this.getChanceToEncourageFire(world, x - 1, y, z, l, EAST);
- l = this.getChanceToEncourageFire(world, x, y - 1, z, l, UP);
- l = this.getChanceToEncourageFire(world, x, y + 1, z, l, DOWN);
- l = this.getChanceToEncourageFire(world, x, y, z - 1, l, SOUTH);
- l = this.getChanceToEncourageFire(world, x, y, z + 1, l, NORTH);
- return l;
- }
- }
-
- /**
- * Checks the specified block coordinate to see if it can catch fire. Args:
- * blockAccess, x, y, z
- */
- @Override
- @Deprecated
- public boolean canBlockCatchFire(final IBlockAccess p_149844_1_, final int p_149844_2_, final int p_149844_3_, final int p_149844_4_) {
- return this.canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
- }
-
- /**
- * Checks to see if its valid to put this block at the specified
- * coordinates. Args: world, x, y, z
- */
- @Override
- public boolean canPlaceBlockAt(final World worldObj, final int x, final int y, final int z) {
- return World.doesBlockHaveSolidTopSurface(worldObj, x, y - 1, z)
- || this.canNeighborBurn(worldObj, x, y, z);
- }
-
- /**
- * Lets the block know when one of its neighbor changes. Doesn't know which
- * neighbor changed (coordinates passed are their own) Args: x, y, z,
- * neighbor Block
- */
- @Override
- public void onNeighborBlockChange(final World worldObj, final int x, final int y, final int z, final Block blockObj) {
- if (!World.doesBlockHaveSolidTopSurface(worldObj, x, y - 1, z)
- && !this.canNeighborBurn(worldObj, x, y, z)) {
- worldObj.setBlockToAir(x, y, z);
- }
- }
-
- /**
- * Called whenever the block is added into the world. Args: world, x, y, z
- */
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- if ((world.provider.dimensionId > 0)
- || !Blocks.portal.func_150000_e(world, x, y, z)) {
- if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)
- && !this.canNeighborBurn(world, x, y, z)) {
- world.setBlockToAir(x, y, z);
- }
- else {
- world.scheduleBlockUpdate(x, y, z, this,
- this.tickRate(world) + world.rand.nextInt(10));
- }
- }
- }
-
- //Burn
- @Override
- public void onEntityWalking(final World world, final int i, final int j, final int k, final Entity entity) {
- entity.setFire(10);
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- //Burn
- @Override
- public void onEntityCollidedWithBlock(final World world, final int i, final int j, final int k, final Entity entity) {
- entity.setFire(10);
- }
-
- /**
- * A randomly called display update to be able to add particles or other
- * items for display
- */
- @Override
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(final World world, final int x, final int y, final int z, Random randomObj) {
-
- randomObj = new XSTR();
-
- if (randomObj.nextInt(24) == 0) {
- world.playSound(x + 0.5F, y + 0.5F, z + 0.5F, "fire.fire",
- 1.0F + randomObj.nextFloat(), (randomObj.nextFloat() * 0.7F) + 0.3F, false);
- }
-
- int l;
- float f;
- float f1;
- float f2;
-
- if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)
- && !Blocks.fire.canCatchFire(world, x, y - 1, z, UP)) {
- if (Blocks.fire.canCatchFire(world, x - 1, y, z, EAST)) {
- for (l = 0; l < 2; ++l) {
- f = x + (randomObj.nextFloat() * 0.1F);
- f1 = y + randomObj.nextFloat();
- f2 = z + randomObj.nextFloat();
- world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1+0.5F, f2, 0.0D, 0.0D, 0.0D);
-
- }
- }
-
- if (Blocks.fire.canCatchFire(world, x + 1, y, z, WEST)) {
- for (l = 0; l < 2; ++l) {
- f = (x + 1) - (randomObj.nextFloat() * 0.1F);
- f1 = y + randomObj.nextFloat();
- f2 = z + randomObj.nextFloat();
- world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1+0.5F, f2, 0.0D, 0.0D, 0.0D);
- }
- }
-
- if (Blocks.fire.canCatchFire(world, x, y, z - 1, SOUTH)) {
- for (l = 0; l < 2; ++l) {
- f = x + randomObj.nextFloat();
- f1 = y + randomObj.nextFloat();
- f2 = z + (randomObj.nextFloat() * 0.1F);
- world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1+0.5F, f2, 0.0D, 0.0D, 0.0D);
- }
- }
-
- if (Blocks.fire.canCatchFire(world, x, y, z + 1, NORTH)) {
- for (l = 0; l < 2; ++l) {
- f = x + randomObj.nextFloat();
- f1 = y + randomObj.nextFloat();
- f2 = (z + 1) - (randomObj.nextFloat() * 0.1F);
- world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1+0.5F, f2, 0.0D, 0.0D, 0.0D);
- }
- }
-
- if (Blocks.fire.canCatchFire(world, x, y + 1, z, DOWN)) {
- for (l = 0; l < 2; ++l) {
- f = x + randomObj.nextFloat();
- f1 = (y + 1) - (randomObj.nextFloat() * 0.1F);
- f2 = z + randomObj.nextFloat();
- world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1+0.5F, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- }
- else {
- for (l = 0; l < 5; ++l) {
- f = x + randomObj.nextFloat();
- f1 = y + (randomObj.nextFloat() * 0.5F) + 0.5F;
- f2 = z + randomObj.nextFloat();
- world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("largesmoke", f, f1+0.5F, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister IIconRegister) {
- this.IIconArray = new IIcon[] {
- IIconRegister.registerIcon(CORE.MODID + ":" + "hellfire/" + "blockHellFire" + "_layer_0"),
- IIconRegister.registerIcon(CORE.MODID + ":" + "hellfire/" + "blockHellFire" + "_layer_1") };
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getFireIcon(final int p_149840_1_) {
- return this.IIconArray[p_149840_1_];
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
- return this.IIconArray[0];
- }
-
- @Override
- public MapColor getMapColor(final int p_149728_1_) {
- return MapColor.snowColor;
- }
-
- /*
- * ================================= Forge Start
- * ======================================
- */
- private static class FireInfo {
- private int encouragement = 0;
- private int flammibility = 0;
- }
-
- private final IdentityHashMap<Block, FireInfo> blockInfo = Maps.newIdentityHashMap();
-
- @Override
- public void setFireInfo(final Block block, final int encouragement, final int flammibility) {
- try {
- if (block == Blocks.air) {
- throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
- }
- final int id = Block.getIdFromBlock(block);
- if (id >= 4096 || id >= field_149849_a.length || id >= field_149848_b.length) {
- return;
- }
- this.field_149849_a[id] = encouragement;
- this.field_149848_b[id] = flammibility;
-
- final FireInfo info = this.getInfo(block, true);
- info.encouragement = encouragement;
- info.flammibility = flammibility;
- }
- catch (Throwable t) {}
- }
-
- private FireInfo getInfo(final Block block, final boolean garentee) {
- FireInfo ret = this.blockInfo.get(block);
- if ((ret == null) && garentee) {
- ret = new FireInfo();
- this.blockInfo.put(block, ret);
- }
- return ret;
- }
-
- @Override
- public void rebuildFireInfo() {
- for (int x = 0; x < 4096; x++) {
- // If we care.. we could detect changes in here and make sure we
- // keep them, however
- // it's my thinking that anyone who hacks into the private variables
- // should DIAF and we don't care about them.
- this.field_149849_a[x] = 0;
- this.field_149848_b[x] = 0;
- }
-
- for (final Entry<Block, FireInfo> e : this.blockInfo.entrySet()) {
- final int id = Block.getIdFromBlock(e.getKey());
- if ((id >= 0) && (id < 4096)) {
- this.field_149849_a[id] = e.getValue().encouragement;
- this.field_149848_b[id] = e.getValue().flammibility;
- }
- }
- }
-
- @Override
- public int getFlammability(final Block block) {
- final int id = Block.getIdFromBlock(block);
- return (id >= 0) && (id < 4096) ? this.field_149848_b[id] : 0;
- }
-
- @Override
- public int getEncouragement(final Block block) {
- final int id = Block.getIdFromBlock(block);
- return (id >= 0) && (id < 4096) ? this.field_149849_a[id] : 0;
- }
-
- /**
- * Side sensitive version that calls the block function.
- *
- * @param world
- * The current world
- * @param x
- * X Position
- * @param y
- * Y Position
- * @param z
- * Z Position
- * @param face
- * The side the fire is coming from
- * @return True if the face can catch fire.
- */
- @Override
- public boolean canCatchFire(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
- return world.getBlock(x, y, z).isFlammable(world, x, y, z, face);
- }
-
- /**
- * Side sensitive version that calls the block function.
- *
- * @param world
- * The current world
- * @param x
- * X Position
- * @param y
- * Y Position
- * @param z
- * Z Position
- * @param oldChance
- * The previous maximum chance.
- * @param face
- * The side the fire is coming from
- * @return The chance of the block catching fire, or oldChance if it is
- * higher
- */
- @Override
- public int getChanceToEncourageFire(final IBlockAccess world, final int x, final int y, final int z, final int oldChance, final ForgeDirection face) {
- final int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
- return (newChance > oldChance ? newChance : oldChance);
- }
- /*
- * ================================= Forge Start
- * ======================================
- */
-} \ No newline at end of file
+ @Deprecated
+ private final int[] field_149849_a = new int[Short.MAX_VALUE];
+
+ @Deprecated
+ private final int[] field_149848_b = new int[Short.MAX_VALUE];
+
+ @SideOnly(Side.CLIENT)
+ private IIcon[] IIconArray;
+
+ public HellFire() {
+ this.setTickRandomly(true);
+ this.setLightLevel(1F);
+ this.setLightOpacity(0);
+ // this.setBlockTextureName(CORE.MODID + "hellfire/blockHellFire");
+ this.setBlockName("blockHellFire");
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ GameRegistry.registerBlock(this, "blockHellFire");
+ LanguageRegistry.addName(this, "Hellish Fire");
+ this.enableBrutalFire();
+ }
+
+ private void enableBrutalFire() {
+ for (final Object o : Block.blockRegistry.getKeys()) {
+
+ try {
+
+ final String name = (String) o;
+ final Block b = Block.getBlockFromName(name);
+ if (b != Blocks.air) {
+ final int spread = Blocks.fire.getEncouragement(b);
+ final int flamm = Blocks.fire.getFlammability(b);
+ if (flamm > 0 && spread > 0) {
+ this.setFireInfo(b, spread * 4, flamm * 4);
+ }
+ }
+
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ // Special Case madness
+ this.setFireInfo(Blocks.brown_mushroom_block, 20, 100);
+ this.setFireInfo(Blocks.red_mushroom_block, 20, 100);
+ this.setFireInfo(Blocks.grass, 20, 100);
+ this.setFireInfo(Blocks.mycelium, 20, 100);
+ }
+
+ /**
+ * How many world ticks before ticking
+ */
+ @Override
+ public int tickRate(final World world) {
+ return 5;
+ }
+
+ /**
+ * Ticks the block if it's been scheduled
+ */
+ @Override
+ public void updateTick(final World world, final int x, final int y, final int z, Random random) {
+
+ random = new XSTR();
+
+ if (world.getGameRules().getGameRuleBooleanValue("doFireTick")) {
+ final boolean flag = world.getBlock(x, y - 1, z).isFireSource(world, x, y - 1, z, UP);
+
+ if (!this.canPlaceBlockAt(world, x, y, z)) {
+ world.setBlockToAir(x, y, z);
+ }
+
+ if (!flag
+ && world.isRaining()
+ && (world.canLightningStrikeAt(x, y, z)
+ || world.canLightningStrikeAt(x - 1, y, z)
+ || world.canLightningStrikeAt(x + 1, y, z)
+ || world.canLightningStrikeAt(x, y, z - 1)
+ || world.canLightningStrikeAt(x, y, z + 1))) {
+
+ if (MathUtils.randInt(0, 100) >= 90) {
+ world.setBlockToAir(x, y, z);
+ }
+ } else {
+ final int blockMeta = world.getBlockMetadata(x, y, z);
+
+ if (blockMeta < 15) {
+ world.setBlockMetadataWithNotify(x, y, z, blockMeta + (random.nextInt(3) / 2), 4);
+ }
+
+ world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + random.nextInt(10));
+
+ if (!flag && !this.canNeighborBurn(world, x, y, z)) {
+ if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) || (blockMeta > 3)) {
+ world.setBlockToAir(x, y, z);
+ }
+ } else if (!flag
+ && !this.canCatchFire(world, x, y - 1, z, UP)
+ && (blockMeta == 15)
+ && (random.nextInt(4) == 0)) {
+ world.setBlockToAir(x, y, z);
+ } else {
+ final boolean flag1 = world.isBlockHighHumidity(x, y, z);
+ byte b0 = 0;
+
+ if (flag1) {
+ b0 = -50;
+ }
+
+ this.tryCatchFire(world, x + 1, y, z, 300 + b0, random, blockMeta, WEST);
+ this.tryCatchFire(world, x - 1, y, z, 300 + b0, random, blockMeta, EAST);
+ this.tryCatchFire(world, x, y - 1, z, 250 + b0, random, blockMeta, UP);
+ this.tryCatchFire(world, x, y + 1, z, 250 + b0, random, blockMeta, DOWN);
+ this.tryCatchFire(world, x, y, z - 1, 300 + b0, random, blockMeta, SOUTH);
+ this.tryCatchFire(world, x, y, z + 1, 300 + b0, random, blockMeta, NORTH);
+
+ for (int i1 = x - 1; i1 <= (x + 1); ++i1) {
+ for (int j1 = z - 1; j1 <= (z + 1); ++j1) {
+ for (int k1 = y - 1; k1 <= (y + 4); ++k1) {
+ if ((i1 != x) || (k1 != y) || (j1 != z)) {
+ int l1 = 100;
+
+ if (k1 > (y + 1)) {
+ l1 += (k1 - (y + 1)) * 100;
+ }
+
+ final int neighbourFireChance =
+ this.getChanceOfNeighborsEncouragingFire(world, i1, k1, j1);
+
+ if (neighbourFireChance > 0) {
+ int j2 = (neighbourFireChance
+ + 40
+ + (world.difficultySetting.getDifficultyId() * 14))
+ / (blockMeta + 30);
+
+ if (flag1) {
+ j2 /= 2;
+ }
+
+ if ((j2 > 0)
+ && (random.nextInt(l1) <= j2)
+ && (!world.isRaining() || !world.canLightningStrikeAt(i1, k1, j1))
+ && !world.canLightningStrikeAt(i1 - 1, k1, z)
+ && !world.canLightningStrikeAt(i1 + 1, k1, j1)
+ && !world.canLightningStrikeAt(i1, k1, j1 - 1)
+ && !world.canLightningStrikeAt(i1, k1, j1 + 1)) {
+ int k2 = blockMeta + (random.nextInt(5) / 4);
+
+ if (k2 > 15) {
+ k2 = 15;
+ }
+
+ world.setBlock(i1, k1, j1, this, k2, 3);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void tryCatchFire(
+ final World world,
+ final int p_149841_2_,
+ final int p_149841_3_,
+ final int p_149841_4_,
+ final int p_149841_5_,
+ final Random p_149841_6_,
+ final int p_149841_7_,
+ final ForgeDirection face) {
+ final int j1 = world.getBlock(p_149841_2_, p_149841_3_, p_149841_4_)
+ .getFlammability(world, p_149841_2_, p_149841_3_, p_149841_4_, face);
+
+ if (p_149841_6_.nextInt(p_149841_5_) < j1) {
+ final boolean flag = world.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt;
+
+ if ((p_149841_6_.nextInt(p_149841_7_ + 10) < 5)
+ && !world.canLightningStrikeAt(p_149841_2_, p_149841_3_, p_149841_4_)) {
+ int k1 = p_149841_7_ + (p_149841_6_.nextInt(5) / 4);
+
+ if (k1 > 15) {
+ k1 = 15;
+ }
+
+ world.setBlock(p_149841_2_, p_149841_3_, p_149841_4_, this, k1, 3);
+ } else {
+ world.setBlockToAir(p_149841_2_, p_149841_3_, p_149841_4_);
+ }
+
+ if (flag) {
+ Blocks.tnt.onBlockDestroyedByPlayer(world, p_149841_2_, p_149841_3_, p_149841_4_, 1);
+ }
+ }
+ }
+
+ /**
+ * Returns true if at least one block next to this one can burn.
+ */
+ private boolean canNeighborBurn(final World world, final int x, final int y, final int z) {
+ return this.canCatchFire(world, x + 1, y, z, WEST)
+ || this.canCatchFire(world, x - 1, y, z, EAST)
+ || this.canCatchFire(world, x, y - 1, z, UP)
+ || this.canCatchFire(world, x, y + 1, z, DOWN)
+ || this.canCatchFire(world, x, y, z - 1, SOUTH)
+ || this.canCatchFire(world, x, y, z + 1, NORTH);
+ }
+
+ /**
+ * Gets the highest chance of a neighbor block encouraging this block to
+ * catch fire
+ */
+ private int getChanceOfNeighborsEncouragingFire(final World world, final int x, final int y, final int z) {
+ final byte b0 = 0;
+
+ if (!world.isAirBlock(x, y, z)) {
+ return 0;
+ } else {
+ int l = b0;
+ l = this.getChanceToEncourageFire(world, x + 1, y, z, l, WEST);
+ l = this.getChanceToEncourageFire(world, x - 1, y, z, l, EAST);
+ l = this.getChanceToEncourageFire(world, x, y - 1, z, l, UP);
+ l = this.getChanceToEncourageFire(world, x, y + 1, z, l, DOWN);
+ l = this.getChanceToEncourageFire(world, x, y, z - 1, l, SOUTH);
+ l = this.getChanceToEncourageFire(world, x, y, z + 1, l, NORTH);
+ return l;
+ }
+ }
+
+ /**
+ * Checks the specified block coordinate to see if it can catch fire. Args:
+ * blockAccess, x, y, z
+ */
+ @Override
+ @Deprecated
+ public boolean canBlockCatchFire(
+ final IBlockAccess p_149844_1_, final int p_149844_2_, final int p_149844_3_, final int p_149844_4_) {
+ return this.canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
+ }
+
+ /**
+ * Checks to see if its valid to put this block at the specified
+ * coordinates. Args: world, x, y, z
+ */
+ @Override
+ public boolean canPlaceBlockAt(final World worldObj, final int x, final int y, final int z) {
+ return World.doesBlockHaveSolidTopSurface(worldObj, x, y - 1, z) || this.canNeighborBurn(worldObj, x, y, z);
+ }
+
+ /**
+ * Lets the block know when one of its neighbor changes. Doesn't know which
+ * neighbor changed (coordinates passed are their own) Args: x, y, z,
+ * neighbor Block
+ */
+ @Override
+ public void onNeighborBlockChange(
+ final World worldObj, final int x, final int y, final int z, final Block blockObj) {
+ if (!World.doesBlockHaveSolidTopSurface(worldObj, x, y - 1, z) && !this.canNeighborBurn(worldObj, x, y, z)) {
+ worldObj.setBlockToAir(x, y, z);
+ }
+ }
+
+ /**
+ * Called whenever the block is added into the world. Args: world, x, y, z
+ */
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ if ((world.provider.dimensionId > 0) || !Blocks.portal.func_150000_e(world, x, y, z)) {
+ if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && !this.canNeighborBurn(world, x, y, z)) {
+ world.setBlockToAir(x, y, z);
+ } else {
+ world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + world.rand.nextInt(10));
+ }
+ }
+ }
+
+ // Burn
+ @Override
+ public void onEntityWalking(final World world, final int i, final int j, final int k, final Entity entity) {
+ entity.setFire(10);
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ // Burn
+ @Override
+ public void onEntityCollidedWithBlock(
+ final World world, final int i, final int j, final int k, final Entity entity) {
+ entity.setFire(10);
+ }
+
+ /**
+ * A randomly called display update to be able to add particles or other
+ * items for display
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(final World world, final int x, final int y, final int z, Random randomObj) {
+
+ randomObj = new XSTR();
+
+ if (randomObj.nextInt(24) == 0) {
+ world.playSound(
+ x + 0.5F,
+ y + 0.5F,
+ z + 0.5F,
+ "fire.fire",
+ 1.0F + randomObj.nextFloat(),
+ (randomObj.nextFloat() * 0.7F) + 0.3F,
+ false);
+ }
+
+ int l;
+ float f;
+ float f1;
+ float f2;
+
+ if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)
+ && !Blocks.fire.canCatchFire(world, x, y - 1, z, UP)) {
+ if (Blocks.fire.canCatchFire(world, x - 1, y, z, EAST)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + (randomObj.nextFloat() * 0.1F);
+ f1 = y + randomObj.nextFloat();
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x + 1, y, z, WEST)) {
+ for (l = 0; l < 2; ++l) {
+ f = (x + 1) - (randomObj.nextFloat() * 0.1F);
+ f1 = y + randomObj.nextFloat();
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x, y, z - 1, SOUTH)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = y + randomObj.nextFloat();
+ f2 = z + (randomObj.nextFloat() * 0.1F);
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x, y, z + 1, NORTH)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = y + randomObj.nextFloat();
+ f2 = (z + 1) - (randomObj.nextFloat() * 0.1F);
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x, y + 1, z, DOWN)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = (y + 1) - (randomObj.nextFloat() * 0.1F);
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ } else {
+ for (l = 0; l < 5; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = y + (randomObj.nextFloat() * 0.5F) + 0.5F;
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister IIconRegister) {
+ this.IIconArray = new IIcon[] {
+ IIconRegister.registerIcon(CORE.MODID + ":" + "hellfire/" + "blockHellFire" + "_layer_0"),
+ IIconRegister.registerIcon(CORE.MODID + ":" + "hellfire/" + "blockHellFire" + "_layer_1")
+ };
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getFireIcon(final int p_149840_1_) {
+ return this.IIconArray[p_149840_1_];
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return this.IIconArray[0];
+ }
+
+ @Override
+ public MapColor getMapColor(final int p_149728_1_) {
+ return MapColor.snowColor;
+ }
+
+ /*
+ * ================================= Forge Start
+ * ======================================
+ */
+ private static class FireInfo {
+ private int encouragement = 0;
+ private int flammibility = 0;
+ }
+
+ private final IdentityHashMap<Block, FireInfo> blockInfo = Maps.newIdentityHashMap();
+
+ @Override
+ public void setFireInfo(final Block block, final int encouragement, final int flammibility) {
+ try {
+ if (block == Blocks.air) {
+ throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
+ }
+ final int id = Block.getIdFromBlock(block);
+ if (id >= 4096 || id >= field_149849_a.length || id >= field_149848_b.length) {
+ return;
+ }
+ this.field_149849_a[id] = encouragement;
+ this.field_149848_b[id] = flammibility;
+
+ final FireInfo info = this.getInfo(block, true);
+ info.encouragement = encouragement;
+ info.flammibility = flammibility;
+ } catch (Throwable t) {
+ }
+ }
+
+ private FireInfo getInfo(final Block block, final boolean garentee) {
+ FireInfo ret = this.blockInfo.get(block);
+ if ((ret == null) && garentee) {
+ ret = new FireInfo();
+ this.blockInfo.put(block, ret);
+ }
+ return ret;
+ }
+
+ @Override
+ public void rebuildFireInfo() {
+ for (int x = 0; x < 4096; x++) {
+ // If we care.. we could detect changes in here and make sure we
+ // keep them, however
+ // it's my thinking that anyone who hacks into the private variables
+ // should DIAF and we don't care about them.
+ this.field_149849_a[x] = 0;
+ this.field_149848_b[x] = 0;
+ }
+
+ for (final Entry<Block, FireInfo> e : this.blockInfo.entrySet()) {
+ final int id = Block.getIdFromBlock(e.getKey());
+ if ((id >= 0) && (id < 4096)) {
+ this.field_149849_a[id] = e.getValue().encouragement;
+ this.field_149848_b[id] = e.getValue().flammibility;
+ }
+ }
+ }
+
+ @Override
+ public int getFlammability(final Block block) {
+ final int id = Block.getIdFromBlock(block);
+ return (id >= 0) && (id < 4096) ? this.field_149848_b[id] : 0;
+ }
+
+ @Override
+ public int getEncouragement(final Block block) {
+ final int id = Block.getIdFromBlock(block);
+ return (id >= 0) && (id < 4096) ? this.field_149849_a[id] : 0;
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world
+ * The current world
+ * @param x
+ * X Position
+ * @param y
+ * Y Position
+ * @param z
+ * Z Position
+ * @param face
+ * The side the fire is coming from
+ * @return True if the face can catch fire.
+ */
+ @Override
+ public boolean canCatchFire(
+ final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
+ return world.getBlock(x, y, z).isFlammable(world, x, y, z, face);
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world
+ * The current world
+ * @param x
+ * X Position
+ * @param y
+ * Y Position
+ * @param z
+ * Z Position
+ * @param oldChance
+ * The previous maximum chance.
+ * @param face
+ * The side the fire is coming from
+ * @return The chance of the block catching fire, or oldChance if it is
+ * higher
+ */
+ @Override
+ public int getChanceToEncourageFire(
+ final IBlockAccess world,
+ final int x,
+ final int y,
+ final int z,
+ final int oldChance,
+ final ForgeDirection face) {
+ final int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
+ return (newChance > oldChance ? newChance : oldChance);
+ }
+ /*
+ * ================================= Forge Start
+ * ======================================
+ */
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/LightGlass.java b/src/main/java/gtPlusPlus/core/block/general/LightGlass.java
index 30da7f1d56..df2ec518ce 100644
--- a/src/main/java/gtPlusPlus/core/block/general/LightGlass.java
+++ b/src/main/java/gtPlusPlus/core/block/general/LightGlass.java
@@ -1,144 +1,135 @@
package gtPlusPlus.core.block.general;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-
/*public class LightGlass extends BlockBreakable
{*/
-public class LightGlass extends BlockAir
-{
+public class LightGlass extends BlockAir {
+
+ private int state = 0;
+ private final int a = 255;
+ private int r = 255;
+ private int g = 0;
+ private int b = 0;
+ private int hex;
-private int state = 0;
- private final int a = 255;
- private int r = 255;
- private int g = 0;
- private int b = 0;
- private int hex;
+ public LightGlass(final boolean bool) {
+ // super("blockMFEffect", Material.air, bool);
+ super();
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setBlockName("blockMFEffect");
+ this.setLightLevel(12F);
+ setHardness(0.1F);
+ setBlockTextureName(CORE.MODID + ":" + "blockMFEffect");
+ setStepSound(Block.soundTypeGlass);
+ GameRegistry.registerBlock(this, "blockMFEffect");
- public LightGlass(final boolean bool)
- {
- //super("blockMFEffect", Material.air, bool);
- super();
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setBlockName("blockMFEffect");
- this.setLightLevel(12F);
- setHardness(0.1F);
- setBlockTextureName(CORE.MODID + ":" + "blockMFEffect");
- setStepSound(Block.soundTypeGlass);
- GameRegistry.registerBlock(this, "blockMFEffect");
-
- /*
- this.setLightOpacity(0);
- this.setTickRandomly(true);
- this.setResistance(1);*/
- }
+ /*
+ this.setLightOpacity(0);
+ this.setTickRandomly(true);
+ this.setResistance(1);*/
+ }
- /**
- * Returns the quantity of items to drop on block destruction.
- */
- @Override
- public int quantityDropped(final Random rand)
- {
- return 0;
- }
+ /**
+ * Returns the quantity of items to drop on block destruction.
+ */
+ @Override
+ public int quantityDropped(final Random rand) {
+ return 0;
+ }
- /**
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
- */
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderBlockPass()
- {
- return 0;
- }
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass() {
+ return 0;
+ }
- /**
- * 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;
- }
+ /**
+ * 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;
+ }
- /**
- * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.
- */
- @Override
- protected boolean canSilkHarvest()
- {
- return false;
- }
+ /**
+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.
+ */
+ @Override
+ protected boolean canSilkHarvest() {
+ return false;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon)
- {
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockMFEffect");
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iIcon) {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockMFEffect");
+ }
- @Override
- //http://stackoverflow.com/questions/31784658/how-can-i-loop-through-all-rgb-combinations-in-rainbow-order-in-java
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4)
- {
- if(this.state == 0){
- this.g++;
- if(this.g == 255) {
- this.state = 1;
- }
- }
- if(this.state == 1){
- this.r--;
- if(this.r == 0) {
- this.state = 2;
- }
- }
- if(this.state == 2){
- this.b++;
- if(this.b == 255) {
- this.state = 3;
- }
- }
- if(this.state == 3){
- this.g--;
- if(this.g == 0) {
- this.state = 4;
- }
- }
- if(this.state == 4){
- this.r++;
- if(this.r == 255) {
- this.state = 5;
- }
- }
- if(this.state == 5){
- this.b--;
- if(this.b == 0) {
- this.state = 0;
- }
- }
- this.hex = (this.a << 24) + (this.r << 16) + (this.g << 8) + (this.b);
- return this.hex;
- }
+ @Override
+ // http://stackoverflow.com/questions/31784658/how-can-i-loop-through-all-rgb-combinations-in-rainbow-order-in-java
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
+ if (this.state == 0) {
+ this.g++;
+ if (this.g == 255) {
+ this.state = 1;
+ }
+ }
+ if (this.state == 1) {
+ this.r--;
+ if (this.r == 0) {
+ this.state = 2;
+ }
+ }
+ if (this.state == 2) {
+ this.b++;
+ if (this.b == 255) {
+ this.state = 3;
+ }
+ }
+ if (this.state == 3) {
+ this.g--;
+ if (this.g == 0) {
+ this.state = 4;
+ }
+ }
+ if (this.state == 4) {
+ this.r++;
+ if (this.r == 255) {
+ this.state = 5;
+ }
+ }
+ if (this.state == 5) {
+ this.b--;
+ if (this.b == 0) {
+ this.state = 0;
+ }
+ }
+ this.hex = (this.a << 24) + (this.r << 16) + (this.g << 8) + (this.b);
+ return this.hex;
+ }
- /**
- * A randomly called display update to be able to add particles or other items for display
- */
- @Override
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(final World world, final int posX, final int posY, final int posZ, final Random random){
- //Utils.spawnFX(world, posX, posY, posZ, "smoke", "cloud");
+ /**
+ * A randomly called display update to be able to add particles or other items for display
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(
+ final World world, final int posX, final int posY, final int posZ, final Random random) {
+ // Utils.spawnFX(world, posX, posY, posZ, "smoke", "cloud");
- }
-} \ No newline at end of file
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/MiningExplosives.java b/src/main/java/gtPlusPlus/core/block/general/MiningExplosives.java
index 8925962e4e..2b71f12f6d 100644
--- a/src/main/java/gtPlusPlus/core/block/general/MiningExplosives.java
+++ b/src/main/java/gtPlusPlus/core/block/general/MiningExplosives.java
@@ -1,12 +1,13 @@
package gtPlusPlus.core.block.general;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
+import gtPlusPlus.core.lib.CORE;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockTNT;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -19,154 +20,172 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
-import gtPlusPlus.core.lib.CORE;
-
public class MiningExplosives extends BlockTNT {
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
-
- public MiningExplosives(){
- this.setBlockName("blockMiningExplosives");
- GameRegistry.registerBlock(this, "blockMiningExplosives");
- LanguageRegistry.addName(this, "Earth Blasting Explosives");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_){
- return p_149691_1_ == 0 ? this.textureBottom : (p_149691_1_ == 1 ? this.textureTop : this.blockIcon);
- }
-
- /**
- * Called whenever the block is added into the world. Args: world, x, y, z
- */
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z){
- super.onBlockAdded(world, x, y, z);
-
- if (world.isBlockIndirectlyGettingPowered(x, y, z))
- {
- this.onBlockDestroyedByPlayer(world, x, y, z, 1);
- world.setBlockToAir(x, y, z);
- }
- }
-
- /**
- * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
- * their own) Args: x, y, z, neighbor Block
- */
- @Override
- public void onNeighborBlockChange(final World world, final int x, final int y, final int z, final Block neighbourblock){
- if (world.isBlockIndirectlyGettingPowered(x, y, z))
- {
- this.onBlockDestroyedByPlayer(world, x, y, z, 1);
- world.setBlockToAir(x, y, z);
- }
- }
-
- /**
- * Returns the quantity of items to drop on block destruction.
- */
- @Override
- public int quantityDropped(final Random random){
- return 1;
- }
-
- /**
- * Called upon the block being destroyed by an explosion
- */
- @Override
- public void onBlockDestroyedByExplosion(final World world, final int x, final int y, final int z, final Explosion bang){
- if (!world.isRemote)
- {
- final EntityPrimedMiningExplosive EntityPrimedMiningExplosive = new EntityPrimedMiningExplosive(world, x + 0.5F, y + 0.5F, z + 0.5F, bang.getExplosivePlacedBy());
- EntityPrimedMiningExplosive.fuse = world.rand.nextInt(EntityPrimedMiningExplosive.fuse / 4) + (EntityPrimedMiningExplosive.fuse / 8);
- world.spawnEntityInWorld(EntityPrimedMiningExplosive);
- }
- }
-
- /**
- * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData
- */
- @Override
- public void onBlockDestroyedByPlayer(final World world, final int x, final int y, final int z, final int meta){
- this.func_150114_a(world, x, y, z, meta, (EntityLivingBase)null);
- }
-
- //TODO Spawns Primed TNT?
- @Override
- public void func_150114_a(final World world, final int p_150114_2_, final int p_150114_3_, final int p_150114_4_, final int p_150114_5_, final EntityLivingBase entityLiving){
- if (!world.isRemote)
- {
- if ((p_150114_5_ & 1) == 1)
- {
- final EntityPrimedMiningExplosive EntityPrimedMiningExplosive = new EntityPrimedMiningExplosive(world, p_150114_2_ + 0.5F, p_150114_3_ + 0.5F, p_150114_4_ + 0.5F, entityLiving);
- world.spawnEntityInWorld(EntityPrimedMiningExplosive);
- world.playSoundAtEntity(EntityPrimedMiningExplosive, "game.tnt.primed", 1.0F, 1.0F);
- }
- }
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer clickingPlayer, final int p_149727_6_, final float p_149727_7_, final float p_149727_8_, final float p_149727_9_){
- if ((clickingPlayer.getCurrentEquippedItem() != null) && (clickingPlayer.getCurrentEquippedItem().getItem() == Items.flint_and_steel))
- {
- this.func_150114_a(world, x, y, z, 1, clickingPlayer);
- world.setBlockToAir(x, y, z);
- clickingPlayer.getCurrentEquippedItem().damageItem(1, clickingPlayer);
- return true;
- }
- else
- {
- return super.onBlockActivated(world, x, y, z, clickingPlayer, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_);
- }
- }
-
- /**
- * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
- */
- @Override
- public void onEntityCollidedWithBlock(final World world, final int x, final int y, final int z, final Entity entityTriggering){
- if ((entityTriggering instanceof EntityArrow) && !world.isRemote)
- {
- final EntityArrow entityarrow = (EntityArrow)entityTriggering;
-
- if (entityarrow.isBurning())
- {
- this.func_150114_a(world, x, y, z, 1, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)entityarrow.shootingEntity : null);
- world.setBlockToAir(x, y, z);
- }
- }
- }
-
- /**
- * Return whether this block can drop from an explosion.
- */
- @Override
- public boolean canDropFromExplosion(final Explosion bang){
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iconRegister){
- //
- /*this.blockIcon = iconRegister.registerIcon(this.getTextureName() + "_side");
- this.textureTop = iconRegister.registerIcon(this.getTextureName() + "_top");
- this.textureBottom = iconRegister.registerIcon(this.getTextureName() + "_bottom");*/
- this.blockIcon = iconRegister.registerIcon(CORE.MODID + ":" + "chrono/" + "MetalSheet2");
- this.textureTop = iconRegister.registerIcon(CORE.MODID + ":" + "chrono/" + "MetalFunnel");
- this.textureBottom = iconRegister.registerIcon(CORE.MODID + ":" + "chrono/" + "MetalPanel");
- }
-} \ No newline at end of file
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+
+ public MiningExplosives() {
+ this.setBlockName("blockMiningExplosives");
+ GameRegistry.registerBlock(this, "blockMiningExplosives");
+ LanguageRegistry.addName(this, "Earth Blasting Explosives");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 0 ? this.textureBottom : (p_149691_1_ == 1 ? this.textureTop : this.blockIcon);
+ }
+
+ /**
+ * Called whenever the block is added into the world. Args: world, x, y, z
+ */
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ super.onBlockAdded(world, x, y, z);
+
+ if (world.isBlockIndirectlyGettingPowered(x, y, z)) {
+ this.onBlockDestroyedByPlayer(world, x, y, z, 1);
+ world.setBlockToAir(x, y, z);
+ }
+ }
+
+ /**
+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
+ * their own) Args: x, y, z, neighbor Block
+ */
+ @Override
+ public void onNeighborBlockChange(
+ final World world, final int x, final int y, final int z, final Block neighbourblock) {
+ if (world.isBlockIndirectlyGettingPowered(x, y, z)) {
+ this.onBlockDestroyedByPlayer(world, x, y, z, 1);
+ world.setBlockToAir(x, y, z);
+ }
+ }
+
+ /**
+ * Returns the quantity of items to drop on block destruction.
+ */
+ @Override
+ public int quantityDropped(final Random random) {
+ return 1;
+ }
+
+ /**
+ * Called upon the block being destroyed by an explosion
+ */
+ @Override
+ public void onBlockDestroyedByExplosion(
+ final World world, final int x, final int y, final int z, final Explosion bang) {
+ if (!world.isRemote) {
+ final EntityPrimedMiningExplosive EntityPrimedMiningExplosive =
+ new EntityPrimedMiningExplosive(world, x + 0.5F, y + 0.5F, z + 0.5F, bang.getExplosivePlacedBy());
+ EntityPrimedMiningExplosive.fuse =
+ world.rand.nextInt(EntityPrimedMiningExplosive.fuse / 4) + (EntityPrimedMiningExplosive.fuse / 8);
+ world.spawnEntityInWorld(EntityPrimedMiningExplosive);
+ }
+ }
+
+ /**
+ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData
+ */
+ @Override
+ public void onBlockDestroyedByPlayer(final World world, final int x, final int y, final int z, final int meta) {
+ this.func_150114_a(world, x, y, z, meta, (EntityLivingBase) null);
+ }
+
+ // TODO Spawns Primed TNT?
+ @Override
+ public void func_150114_a(
+ final World world,
+ final int p_150114_2_,
+ final int p_150114_3_,
+ final int p_150114_4_,
+ final int p_150114_5_,
+ final EntityLivingBase entityLiving) {
+ if (!world.isRemote) {
+ if ((p_150114_5_ & 1) == 1) {
+ final EntityPrimedMiningExplosive EntityPrimedMiningExplosive = new EntityPrimedMiningExplosive(
+ world, p_150114_2_ + 0.5F, p_150114_3_ + 0.5F, p_150114_4_ + 0.5F, entityLiving);
+ world.spawnEntityInWorld(EntityPrimedMiningExplosive);
+ world.playSoundAtEntity(EntityPrimedMiningExplosive, "game.tnt.primed", 1.0F, 1.0F);
+ }
+ }
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer clickingPlayer,
+ final int p_149727_6_,
+ final float p_149727_7_,
+ final float p_149727_8_,
+ final float p_149727_9_) {
+ if ((clickingPlayer.getCurrentEquippedItem() != null)
+ && (clickingPlayer.getCurrentEquippedItem().getItem() == Items.flint_and_steel)) {
+ this.func_150114_a(world, x, y, z, 1, clickingPlayer);
+ world.setBlockToAir(x, y, z);
+ clickingPlayer.getCurrentEquippedItem().damageItem(1, clickingPlayer);
+ return true;
+ } else {
+ return super.onBlockActivated(
+ world, x, y, z, clickingPlayer, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_);
+ }
+ }
+
+ /**
+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
+ */
+ @Override
+ public void onEntityCollidedWithBlock(
+ final World world, final int x, final int y, final int z, final Entity entityTriggering) {
+ if ((entityTriggering instanceof EntityArrow) && !world.isRemote) {
+ final EntityArrow entityarrow = (EntityArrow) entityTriggering;
+
+ if (entityarrow.isBurning()) {
+ this.func_150114_a(
+ world,
+ x,
+ y,
+ z,
+ 1,
+ entityarrow.shootingEntity instanceof EntityLivingBase
+ ? (EntityLivingBase) entityarrow.shootingEntity
+ : null);
+ world.setBlockToAir(x, y, z);
+ }
+ }
+ }
+
+ /**
+ * Return whether this block can drop from an explosion.
+ */
+ @Override
+ public boolean canDropFromExplosion(final Explosion bang) {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iconRegister) {
+ //
+ /*this.blockIcon = iconRegister.registerIcon(this.getTextureName() + "_side");
+ this.textureTop = iconRegister.registerIcon(this.getTextureName() + "_top");
+ this.textureBottom = iconRegister.registerIcon(this.getTextureName() + "_bottom");*/
+ this.blockIcon = iconRegister.registerIcon(CORE.MODID + ":" + "chrono/" + "MetalSheet2");
+ this.textureTop = iconRegister.registerIcon(CORE.MODID + ":" + "chrono/" + "MetalFunnel");
+ this.textureBottom = iconRegister.registerIcon(CORE.MODID + ":" + "chrono/" + "MetalPanel");
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java b/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java
index a4c0c1a0a5..01e63676cc 100644
--- a/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java
+++ b/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java
@@ -1,16 +1,14 @@
package gtPlusPlus.core.block.general;
-import java.util.HashMap;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.base.itemblock.ItemBlockDoor;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.general.TileEntityPlayerDoorBase;
import gtPlusPlus.core.util.Utils;
+import java.util.HashMap;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.ITileEntityProvider;
@@ -29,439 +27,458 @@ import net.minecraft.world.World;
public class PlayerDoors extends BlockDoor implements ITileEntityProvider {
- @SideOnly(Side.CLIENT)
- private IIcon[] aTextureUpper;
- @SideOnly(Side.CLIENT)
- private IIcon[] aTextureLower;
-
- private final static HashMap<Material, BlockDoor> mDoorMap = new HashMap<Material, BlockDoor>();
-
- public PlayerDoors(Material aMaterial, String aTextureName, boolean vanillaType) {
- this(aMaterial, aTextureName, vanillaType, 0f, null, null);
- }
-
- public PlayerDoors(Material aMaterial, String aTextureName, boolean vanillaType, float aHardness,
- SoundType aStepSound, String aBlockExtensionName) {
- super(aMaterial);
- this.disableStats();
- this.isBlockContainer = true;
- if (mDoorMap.get(aMaterial) == null) {
- mDoorMap.put(aMaterial, this);
- }
- float f = 0.5F;
- float f1 = 1.0F;
- this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
-
- this.setBlockName("playerDoor_" + aTextureName);
- if (aMaterial == Material.wood) {
- setHardness(3.0F);
- setStepSound(soundTypeWood);
- setBlockName("playerDoor" + "Wood");
- this.setHarvestLevel("axe", 1);
- } else if (aMaterial == Material.iron) {
- setHardness(5.0F);
- setStepSound(Block.soundTypeMetal);
- setBlockName("playerDoor" + "Iron");
- this.setHarvestLevel("pickaxe", 1);
-
- } else if (aMaterial == Material.glass) {
- setHardness(0.1F);
- setStepSound(Block.soundTypeGlass);
- setBlockName("playerDoor" + "Glass");
- this.setHarvestLevel("pickaxe", 1);
-
- } else if (aMaterial == Material.ice) {
- setHardness(0.5F);
- setStepSound(Block.soundTypeSnow);
- setBlockName("playerDoor" + "Ice");
- this.setHarvestLevel("pickaxe", 1);
- } else {
- setHardness(aHardness);
- setStepSound(aStepSound);
- setBlockName("playerDoor" + aBlockExtensionName);
- this.setHarvestLevel("axe", 1);
-
- }
- this.setBlockTextureName(vanillaType ? aTextureName : CORE.MODID + ":" + aTextureName);
- GameRegistry.registerBlock(this, ItemBlockDoor.class, Utils.sanitizeString(this.getUnlocalizedName()));
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
- return this.aTextureLower[0];
- }
-
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(IBlockAccess aAccess, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) {
- if (p_149673_5_ != 1 && p_149673_5_ != 0) {
- int i1 = this.getState(aAccess, p_149673_2_, p_149673_3_, p_149673_4_);
- int j1 = i1 & 3;
- boolean flag = (i1 & 4) != 0;
- boolean flag1 = false;
- boolean flag2 = (i1 & 8) != 0;
-
- if (flag) {
- if (j1 == 0 && p_149673_5_ == 2) {
- flag1 = !flag1;
- } else if (j1 == 1 && p_149673_5_ == 5) {
- flag1 = !flag1;
- } else if (j1 == 2 && p_149673_5_ == 3) {
- flag1 = !flag1;
- } else if (j1 == 3 && p_149673_5_ == 4) {
- flag1 = !flag1;
- }
- } else {
- if (j1 == 0 && p_149673_5_ == 5) {
- flag1 = !flag1;
- } else if (j1 == 1 && p_149673_5_ == 3) {
- flag1 = !flag1;
- } else if (j1 == 2 && p_149673_5_ == 4) {
- flag1 = !flag1;
- } else if (j1 == 3 && p_149673_5_ == 2) {
- flag1 = !flag1;
- }
-
- if ((i1 & 16) != 0) {
- flag1 = !flag1;
- }
- }
-
- return flag2 ? this.aTextureUpper[flag1 ? 1 : 0] : this.aTextureLower[flag1 ? 1 : 0];
- } else {
- return this.aTextureLower[0];
- }
- }
-
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister p_149651_1_) {
- this.aTextureUpper = new IIcon[2];
- this.aTextureLower = new IIcon[2];
- this.aTextureUpper[0] = p_149651_1_.registerIcon(this.getTextureName() + "_upper");
- this.aTextureLower[0] = p_149651_1_.registerIcon(this.getTextureName() + "_lower");
- this.aTextureUpper[1] = new IconFlipped(this.aTextureUpper[0], true, false);
- this.aTextureLower[1] = new IconFlipped(this.aTextureLower[0], true, false);
- }
-
- public boolean getBlocksMovement(IBlockAccess aAccess, int aX, int aY, int aZ) {
- int l = this.getState(aAccess, aX, aY, aZ);
- return (l & 4) != 0;
- }
-
- /**
- * If this block doesn't render as an ordinary block it will return False
- * (examples: signs, buttons, stairs, etc)
- */
- public boolean renderAsNormalBlock() {
- return false;
- }
-
- /**
- * The type of render function that is called for this block
- */
- public int getRenderType() {
- return 7;
- }
-
- /**
- * Returns the bounding box of the wired rectangular prism to render.
- */
- @SideOnly(Side.CLIENT)
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- this.setBlockBoundsBasedOnState(aWorld, aX, aY, aZ);
- return super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- /**
- * Returns a bounding box from the pool of bounding boxes (this means this box
- * can change after the pool has been cleared to be reused)
- */
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- this.setBlockBoundsBasedOnState(aWorld, aX, aY, aZ);
- return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- /**
- * Updates the blocks bounds based on its current state. Args: world, x, y, z
- */
- public void setBlockBoundsBasedOnState(IBlockAccess aAccess, int aX, int aY, int aZ) {
- this.setBounds(this.getState(aAccess, aX, aY, aZ));
- }
-
- public int func_150013_e(IBlockAccess p_150013_1_, int p_150013_2_, int p_150013_3_, int p_150013_4_) {
- return this.getState(p_150013_1_, p_150013_2_, p_150013_3_, p_150013_4_) & 3;
- }
-
- public boolean func_150015_f(IBlockAccess p_150015_1_, int p_150015_2_, int p_150015_3_, int p_150015_4_) {
- return (this.getState(p_150015_1_, p_150015_2_, p_150015_3_, p_150015_4_) & 4) != 0;
- }
-
- private void setBounds(int aState) {
- float f = 0.1875F;
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
- int j = aState & 3;
- boolean flag = (aState & 4) != 0;
- boolean flag1 = (aState & 16) != 0;
-
- if (j == 0) {
- if (flag) {
- if (!flag1) {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
- } else {
- this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
- }
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
- }
- } else if (j == 1) {
- if (flag) {
- if (!flag1) {
- this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
- }
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
- }
- } else if (j == 2) {
- if (flag) {
- if (!flag1) {
- this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
- }
- } else {
- this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
- } else if (j == 3) {
- if (flag) {
- if (!flag1) {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
- } else {
- this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
- } else {
- this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
- }
- }
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int p_149727_6_,
- float p_149727_7_, float p_149727_8_, float p_149727_9_) {
- if (this.blockMaterial == Material.iron) {
- return false; // Allow items to interact with the door
- } else {
- int i1 = this.getState(aWorld, aX, aY, aZ);
- int j1 = i1 & 7;
- j1 ^= 4;
-
- if ((i1 & 8) == 0) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, j1, 2);
- aWorld.markBlockRangeForRenderUpdate(aX, aY, aZ, aX, aY, aZ);
- } else {
- aWorld.setBlockMetadataWithNotify(aX, aY - 1, aZ, j1, 2);
- aWorld.markBlockRangeForRenderUpdate(aX, aY - 1, aZ, aX, aY, aZ);
- }
-
- aWorld.playAuxSFXAtEntity(aPlayer, 1003, aX, aY, aZ, 0);
- return true;
- }
- }
-
- public void func_150014_a(World aWorld, int aX, int aY, int aZ, boolean aFlag) {
- int l = this.getState(aWorld, aX, aY, aZ);
- boolean flag1 = (l & 4) != 0;
-
- if (flag1 != aFlag) {
- int i1 = l & 7;
- i1 ^= 4;
-
- if ((l & 8) == 0) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, i1, 2);
- aWorld.markBlockRangeForRenderUpdate(aX, aY, aZ, aX, aY, aZ);
- } else {
- aWorld.setBlockMetadataWithNotify(aX, aY - 1, aZ, i1, 2);
- aWorld.markBlockRangeForRenderUpdate(aX, aY - 1, aZ, aX, aY, aZ);
- }
-
- aWorld.playAuxSFXAtEntity((EntityPlayer) null, 1003, aX, aY, aZ, 0);
- }
- }
-
- /**
- * Lets the block know when one of its neighbor changes. Doesn't know which
- * neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
- * Block
- */
- public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aNeighbour) {
- int l = aWorld.getBlockMetadata(aX, aY, aZ);
-
- if ((l & 8) == 0) {
- boolean flag = false;
-
- if (aWorld.getBlock(aX, aY + 1, aZ) != this) {
- aWorld.setBlockToAir(aX, aY, aZ);
- flag = true;
- }
-
- if (!World.doesBlockHaveSolidTopSurface(aWorld, aX, aY - 1, aZ)) {
- aWorld.setBlockToAir(aX, aY, aZ);
- flag = true;
-
- if (aWorld.getBlock(aX, aY + 1, aZ) == this) {
- aWorld.setBlockToAir(aX, aY + 1, aZ);
- }
- }
-
- if (flag) {
- if (!aWorld.isRemote) {
- this.dropBlockAsItem(aWorld, aX, aY, aZ, l, 0);
- }
- } else {
- boolean flag1 = aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)
- || aWorld.isBlockIndirectlyGettingPowered(aX, aY + 1, aZ);
-
- if ((flag1 || aNeighbour.canProvidePower()) && aNeighbour != this) {
- this.func_150014_a(aWorld, aX, aY, aZ, flag1);
- }
- }
- } else {
- if (aWorld.getBlock(aX, aY - 1, aZ) != this) {
- aWorld.setBlockToAir(aX, aY, aZ);
- }
-
- if (aNeighbour != this) {
- this.onNeighborBlockChange(aWorld, aX, aY - 1, aZ, aNeighbour);
- }
- }
- }
-
- public Item getItemDropped(int p_149650_1_, Random aRand, int p_149650_3_) {
- if ((p_149650_1_ & 8) != 0) {
- return null;
- } else {
- Block b = mDoorMap.get(this.blockMaterial);
- if (b != null) {
- return Item.getItemFromBlock(b);
- }
- }
- return null;
- }
-
- /**
- * Ray traces through the blocks collision from start vector to end vector
- * returning a ray trace hit. Args: world, x, y, z, startVec, endVec
- */
- public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_,
- Vec3 p_149731_5_, Vec3 p_149731_6_) {
- this.setBlockBoundsBasedOnState(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_);
- return super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_);
- }
-
- /**
- * Checks to see if its valid to put this block at the specified coordinates.
- * Args: world, x, y, z
- */
- public boolean canPlaceBlockAt(World aWorld, int aX, int aY, int aZ) {
- boolean aHeight = (aY < aWorld.getHeight() - 1);
- boolean aSolidTopSurface = World.doesBlockHaveSolidTopSurface(aWorld, aX, aY - 1, aZ);
-
- boolean aCanPlace = aWorld.getBlock(aX, aY, aZ).isReplaceable(aWorld, aX, aY, aZ);
- boolean aCanPlace2 = aWorld.getBlock(aX, aY, aZ).isReplaceable(aWorld, aX, aY + 1, aZ);
-
- // Logger.INFO(""+aY+"/"+aWorld.getHeight()+" | Trying to place door. Good
- // height? "+aHeight+" | Solid top surface? "+aSolidTopSurface+" | Can Place?
- // "+aCanPlace+"|"+aCanPlace2);
-
- return aHeight && aSolidTopSurface && aCanPlace && aCanPlace2;
- }
-
- /**
- * Returns the mobility information of the block, 0 = free, 1 = can't push but
- * can move over, 2 = total immobility and stop pistons
- */
- public int getMobilityFlag() {
- return 1;
- }
-
- public int getState(IBlockAccess aAccess, int aX, int aY, int aZ) {
- int l = aAccess.getBlockMetadata(aX, aY, aZ);
- boolean flag = (l & 8) != 0;
- int i1;
- int j1;
-
- if (flag) {
- i1 = aAccess.getBlockMetadata(aX, aY - 1, aZ);
- j1 = l;
- } else {
- i1 = l;
- j1 = aAccess.getBlockMetadata(aX, aY + 1, aZ);
- }
-
- boolean flag1 = (j1 & 1) != 0;
- return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
- }
-
- /**
- * Gets an item for the block being called on. Args: world, x, y, z
- */
- @SideOnly(Side.CLIENT)
- public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
- Block b = mDoorMap.get(this.blockMaterial);
- if (b != null) {
- return Item.getItemFromBlock(b);
- }
- // return this.blockMaterial == Material.iron ? Items.iron_door :
- // Items.wooden_door;
- return null;
- }
-
- /**
- * Called when the block is attempted to be harvested
- */
- public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_,
- EntityPlayer p_149681_6_) {
- if (p_149681_6_.capabilities.isCreativeMode && (p_149681_5_ & 8) != 0
- && p_149681_1_.getBlock(p_149681_2_, p_149681_3_ - 1, p_149681_4_) == this) {
- p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_);
- }
- }
-
- /**
- * Called whenever the block is added into the world. Args: world, x, y, z
- */
- @Override
- public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {
- super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_);
- }
-
- @Override
- public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_,
- int p_149749_6_) {
- super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
- p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
- }
-
- @Override
- public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_,
- int p_149696_5_, int p_149696_6_) {
- super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_);
- TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_);
- return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false;
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int metadata) {
- return new TileEntityPlayerDoorBase(this, metadata);
- }
-
- @Override
- public TileEntity createTileEntity(World world, int metadata) {
- return new TileEntityPlayerDoorBase(this, metadata);
- }
+ @SideOnly(Side.CLIENT)
+ private IIcon[] aTextureUpper;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon[] aTextureLower;
+
+ private static final HashMap<Material, BlockDoor> mDoorMap = new HashMap<Material, BlockDoor>();
+
+ public PlayerDoors(Material aMaterial, String aTextureName, boolean vanillaType) {
+ this(aMaterial, aTextureName, vanillaType, 0f, null, null);
+ }
+
+ public PlayerDoors(
+ Material aMaterial,
+ String aTextureName,
+ boolean vanillaType,
+ float aHardness,
+ SoundType aStepSound,
+ String aBlockExtensionName) {
+ super(aMaterial);
+ this.disableStats();
+ this.isBlockContainer = true;
+ if (mDoorMap.get(aMaterial) == null) {
+ mDoorMap.put(aMaterial, this);
+ }
+ float f = 0.5F;
+ float f1 = 1.0F;
+ this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
+
+ this.setBlockName("playerDoor_" + aTextureName);
+ if (aMaterial == Material.wood) {
+ setHardness(3.0F);
+ setStepSound(soundTypeWood);
+ setBlockName("playerDoor" + "Wood");
+ this.setHarvestLevel("axe", 1);
+ } else if (aMaterial == Material.iron) {
+ setHardness(5.0F);
+ setStepSound(Block.soundTypeMetal);
+ setBlockName("playerDoor" + "Iron");
+ this.setHarvestLevel("pickaxe", 1);
+
+ } else if (aMaterial == Material.glass) {
+ setHardness(0.1F);
+ setStepSound(Block.soundTypeGlass);
+ setBlockName("playerDoor" + "Glass");
+ this.setHarvestLevel("pickaxe", 1);
+
+ } else if (aMaterial == Material.ice) {
+ setHardness(0.5F);
+ setStepSound(Block.soundTypeSnow);
+ setBlockName("playerDoor" + "Ice");
+ this.setHarvestLevel("pickaxe", 1);
+ } else {
+ setHardness(aHardness);
+ setStepSound(aStepSound);
+ setBlockName("playerDoor" + aBlockExtensionName);
+ this.setHarvestLevel("axe", 1);
+ }
+ this.setBlockTextureName(vanillaType ? aTextureName : CORE.MODID + ":" + aTextureName);
+ GameRegistry.registerBlock(this, ItemBlockDoor.class, Utils.sanitizeString(this.getUnlocalizedName()));
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
+ return this.aTextureLower[0];
+ }
+
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(IBlockAccess aAccess, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) {
+ if (p_149673_5_ != 1 && p_149673_5_ != 0) {
+ int i1 = this.getState(aAccess, p_149673_2_, p_149673_3_, p_149673_4_);
+ int j1 = i1 & 3;
+ boolean flag = (i1 & 4) != 0;
+ boolean flag1 = false;
+ boolean flag2 = (i1 & 8) != 0;
+
+ if (flag) {
+ if (j1 == 0 && p_149673_5_ == 2) {
+ flag1 = !flag1;
+ } else if (j1 == 1 && p_149673_5_ == 5) {
+ flag1 = !flag1;
+ } else if (j1 == 2 && p_149673_5_ == 3) {
+ flag1 = !flag1;
+ } else if (j1 == 3 && p_149673_5_ == 4) {
+ flag1 = !flag1;
+ }
+ } else {
+ if (j1 == 0 && p_149673_5_ == 5) {
+ flag1 = !flag1;
+ } else if (j1 == 1 && p_149673_5_ == 3) {
+ flag1 = !flag1;
+ } else if (j1 == 2 && p_149673_5_ == 4) {
+ flag1 = !flag1;
+ } else if (j1 == 3 && p_149673_5_ == 2) {
+ flag1 = !flag1;
+ }
+
+ if ((i1 & 16) != 0) {
+ flag1 = !flag1;
+ }
+ }
+
+ return flag2 ? this.aTextureUpper[flag1 ? 1 : 0] : this.aTextureLower[flag1 ? 1 : 0];
+ } else {
+ return this.aTextureLower[0];
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister p_149651_1_) {
+ this.aTextureUpper = new IIcon[2];
+ this.aTextureLower = new IIcon[2];
+ this.aTextureUpper[0] = p_149651_1_.registerIcon(this.getTextureName() + "_upper");
+ this.aTextureLower[0] = p_149651_1_.registerIcon(this.getTextureName() + "_lower");
+ this.aTextureUpper[1] = new IconFlipped(this.aTextureUpper[0], true, false);
+ this.aTextureLower[1] = new IconFlipped(this.aTextureLower[0], true, false);
+ }
+
+ public boolean getBlocksMovement(IBlockAccess aAccess, int aX, int aY, int aZ) {
+ int l = this.getState(aAccess, aX, aY, aZ);
+ return (l & 4) != 0;
+ }
+
+ /**
+ * If this block doesn't render as an ordinary block it will return False
+ * (examples: signs, buttons, stairs, etc)
+ */
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ /**
+ * The type of render function that is called for this block
+ */
+ public int getRenderType() {
+ return 7;
+ }
+
+ /**
+ * Returns the bounding box of the wired rectangular prism to render.
+ */
+ @SideOnly(Side.CLIENT)
+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ this.setBlockBoundsBasedOnState(aWorld, aX, aY, aZ);
+ return super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ /**
+ * Returns a bounding box from the pool of bounding boxes (this means this box
+ * can change after the pool has been cleared to be reused)
+ */
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ this.setBlockBoundsBasedOnState(aWorld, aX, aY, aZ);
+ return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ /**
+ * Updates the blocks bounds based on its current state. Args: world, x, y, z
+ */
+ public void setBlockBoundsBasedOnState(IBlockAccess aAccess, int aX, int aY, int aZ) {
+ this.setBounds(this.getState(aAccess, aX, aY, aZ));
+ }
+
+ public int func_150013_e(IBlockAccess p_150013_1_, int p_150013_2_, int p_150013_3_, int p_150013_4_) {
+ return this.getState(p_150013_1_, p_150013_2_, p_150013_3_, p_150013_4_) & 3;
+ }
+
+ public boolean func_150015_f(IBlockAccess p_150015_1_, int p_150015_2_, int p_150015_3_, int p_150015_4_) {
+ return (this.getState(p_150015_1_, p_150015_2_, p_150015_3_, p_150015_4_) & 4) != 0;
+ }
+
+ private void setBounds(int aState) {
+ float f = 0.1875F;
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
+ int j = aState & 3;
+ boolean flag = (aState & 4) != 0;
+ boolean flag1 = (aState & 16) != 0;
+
+ if (j == 0) {
+ if (flag) {
+ if (!flag1) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
+ } else {
+ this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
+ }
+ } else {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
+ }
+ } else if (j == 1) {
+ if (flag) {
+ if (!flag1) {
+ this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ } else {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
+ }
+ } else {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
+ }
+ } else if (j == 2) {
+ if (flag) {
+ if (!flag1) {
+ this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
+ } else {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
+ }
+ } else {
+ this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+ } else if (j == 3) {
+ if (flag) {
+ if (!flag1) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
+ } else {
+ this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+ } else {
+ this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
+ }
+ }
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ public boolean onBlockActivated(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ EntityPlayer aPlayer,
+ int p_149727_6_,
+ float p_149727_7_,
+ float p_149727_8_,
+ float p_149727_9_) {
+ if (this.blockMaterial == Material.iron) {
+ return false; // Allow items to interact with the door
+ } else {
+ int i1 = this.getState(aWorld, aX, aY, aZ);
+ int j1 = i1 & 7;
+ j1 ^= 4;
+
+ if ((i1 & 8) == 0) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, j1, 2);
+ aWorld.markBlockRangeForRenderUpdate(aX, aY, aZ, aX, aY, aZ);
+ } else {
+ aWorld.setBlockMetadataWithNotify(aX, aY - 1, aZ, j1, 2);
+ aWorld.markBlockRangeForRenderUpdate(aX, aY - 1, aZ, aX, aY, aZ);
+ }
+
+ aWorld.playAuxSFXAtEntity(aPlayer, 1003, aX, aY, aZ, 0);
+ return true;
+ }
+ }
+
+ public void func_150014_a(World aWorld, int aX, int aY, int aZ, boolean aFlag) {
+ int l = this.getState(aWorld, aX, aY, aZ);
+ boolean flag1 = (l & 4) != 0;
+
+ if (flag1 != aFlag) {
+ int i1 = l & 7;
+ i1 ^= 4;
+
+ if ((l & 8) == 0) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, i1, 2);
+ aWorld.markBlockRangeForRenderUpdate(aX, aY, aZ, aX, aY, aZ);
+ } else {
+ aWorld.setBlockMetadataWithNotify(aX, aY - 1, aZ, i1, 2);
+ aWorld.markBlockRangeForRenderUpdate(aX, aY - 1, aZ, aX, aY, aZ);
+ }
+
+ aWorld.playAuxSFXAtEntity((EntityPlayer) null, 1003, aX, aY, aZ, 0);
+ }
+ }
+
+ /**
+ * Lets the block know when one of its neighbor changes. Doesn't know which
+ * neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
+ * Block
+ */
+ public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aNeighbour) {
+ int l = aWorld.getBlockMetadata(aX, aY, aZ);
+
+ if ((l & 8) == 0) {
+ boolean flag = false;
+
+ if (aWorld.getBlock(aX, aY + 1, aZ) != this) {
+ aWorld.setBlockToAir(aX, aY, aZ);
+ flag = true;
+ }
+
+ if (!World.doesBlockHaveSolidTopSurface(aWorld, aX, aY - 1, aZ)) {
+ aWorld.setBlockToAir(aX, aY, aZ);
+ flag = true;
+
+ if (aWorld.getBlock(aX, aY + 1, aZ) == this) {
+ aWorld.setBlockToAir(aX, aY + 1, aZ);
+ }
+ }
+
+ if (flag) {
+ if (!aWorld.isRemote) {
+ this.dropBlockAsItem(aWorld, aX, aY, aZ, l, 0);
+ }
+ } else {
+ boolean flag1 = aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)
+ || aWorld.isBlockIndirectlyGettingPowered(aX, aY + 1, aZ);
+
+ if ((flag1 || aNeighbour.canProvidePower()) && aNeighbour != this) {
+ this.func_150014_a(aWorld, aX, aY, aZ, flag1);
+ }
+ }
+ } else {
+ if (aWorld.getBlock(aX, aY - 1, aZ) != this) {
+ aWorld.setBlockToAir(aX, aY, aZ);
+ }
+
+ if (aNeighbour != this) {
+ this.onNeighborBlockChange(aWorld, aX, aY - 1, aZ, aNeighbour);
+ }
+ }
+ }
+
+ public Item getItemDropped(int p_149650_1_, Random aRand, int p_149650_3_) {
+ if ((p_149650_1_ & 8) != 0) {
+ return null;
+ } else {
+ Block b = mDoorMap.get(this.blockMaterial);
+ if (b != null) {
+ return Item.getItemFromBlock(b);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Ray traces through the blocks collision from start vector to end vector
+ * returning a ray trace hit. Args: world, x, y, z, startVec, endVec
+ */
+ public MovingObjectPosition collisionRayTrace(
+ World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_, Vec3 p_149731_5_, Vec3 p_149731_6_) {
+ this.setBlockBoundsBasedOnState(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_);
+ return super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_);
+ }
+
+ /**
+ * Checks to see if its valid to put this block at the specified coordinates.
+ * Args: world, x, y, z
+ */
+ public boolean canPlaceBlockAt(World aWorld, int aX, int aY, int aZ) {
+ boolean aHeight = (aY < aWorld.getHeight() - 1);
+ boolean aSolidTopSurface = World.doesBlockHaveSolidTopSurface(aWorld, aX, aY - 1, aZ);
+
+ boolean aCanPlace = aWorld.getBlock(aX, aY, aZ).isReplaceable(aWorld, aX, aY, aZ);
+ boolean aCanPlace2 = aWorld.getBlock(aX, aY, aZ).isReplaceable(aWorld, aX, aY + 1, aZ);
+
+ // Logger.INFO(""+aY+"/"+aWorld.getHeight()+" | Trying to place door. Good
+ // height? "+aHeight+" | Solid top surface? "+aSolidTopSurface+" | Can Place?
+ // "+aCanPlace+"|"+aCanPlace2);
+
+ return aHeight && aSolidTopSurface && aCanPlace && aCanPlace2;
+ }
+
+ /**
+ * Returns the mobility information of the block, 0 = free, 1 = can't push but
+ * can move over, 2 = total immobility and stop pistons
+ */
+ public int getMobilityFlag() {
+ return 1;
+ }
+
+ public int getState(IBlockAccess aAccess, int aX, int aY, int aZ) {
+ int l = aAccess.getBlockMetadata(aX, aY, aZ);
+ boolean flag = (l & 8) != 0;
+ int i1;
+ int j1;
+
+ if (flag) {
+ i1 = aAccess.getBlockMetadata(aX, aY - 1, aZ);
+ j1 = l;
+ } else {
+ i1 = l;
+ j1 = aAccess.getBlockMetadata(aX, aY + 1, aZ);
+ }
+
+ boolean flag1 = (j1 & 1) != 0;
+ return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
+ }
+
+ /**
+ * Gets an item for the block being called on. Args: world, x, y, z
+ */
+ @SideOnly(Side.CLIENT)
+ public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
+ Block b = mDoorMap.get(this.blockMaterial);
+ if (b != null) {
+ return Item.getItemFromBlock(b);
+ }
+ // return this.blockMaterial == Material.iron ? Items.iron_door :
+ // Items.wooden_door;
+ return null;
+ }
+
+ /**
+ * Called when the block is attempted to be harvested
+ */
+ public void onBlockHarvested(
+ World p_149681_1_,
+ int p_149681_2_,
+ int p_149681_3_,
+ int p_149681_4_,
+ int p_149681_5_,
+ EntityPlayer p_149681_6_) {
+ if (p_149681_6_.capabilities.isCreativeMode
+ && (p_149681_5_ & 8) != 0
+ && p_149681_1_.getBlock(p_149681_2_, p_149681_3_ - 1, p_149681_4_) == this) {
+ p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_);
+ }
+ }
+
+ /**
+ * Called whenever the block is added into the world. Args: world, x, y, z
+ */
+ @Override
+ public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {
+ super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_);
+ }
+
+ @Override
+ public void breakBlock(
+ World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
+ super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
+ p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
+ }
+
+ @Override
+ public boolean onBlockEventReceived(
+ World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) {
+ super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_);
+ TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_);
+ return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int metadata) {
+ return new TileEntityPlayerDoorBase(this, metadata);
+ }
+
+ @Override
+ public TileEntity createTileEntity(World world, int metadata) {
+ return new TileEntityPlayerDoorBase(this, metadata);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java b/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
index 2210e68e8a..4d11a8ac66 100644
--- a/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
+++ b/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
@@ -3,7 +3,9 @@ package gtPlusPlus.core.block.general.antigrief;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -18,149 +20,163 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
-public class BlockWitherProof extends Block{
-
- public BlockWitherProof(){
- super(Material.redstoneLight);
- this.setBlockName(Utils.sanitizeString("blockBlackGate"));
- this.setBlockTextureName(CORE.MODID + ":" + "blockFrameGt");
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(-1F);
- this.setResistance(5000.0F);
- this.setHarvestLevel("pickaxe", 3);
- this.setStepSound(soundTypeMetal);
- //LanguageRegistry.addName(this, "Wither Cage");
- GameRegistry.registerBlock(this, Utils.sanitizeString("blockBlackGate"));
- }
-
- public String GetProperName(){
- return "Wither Cage";
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderBlockPass(){
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube(){
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon){
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockFrameGt");
- }
-
- @Override
- public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion){
- //prevent from being destroyed by wither and nukes.
- }
-
- @Override
- public void onBlockDestroyedByExplosion(final World p_149723_1_, final int p_149723_2_,
- final int p_149723_3_, final int p_149723_4_, final Explosion p_149723_5_) {
-
- }
-
- @Override
- public boolean canDropFromExplosion(final Explosion p_149659_1_) {
- return false;
- }
-
- @Override
- public boolean canEntityDestroy(final IBlockAccess world, final int x, final int y, final int z,
- final Entity entity) {
- if ((entity == null) || !entity.isEntityAlive()){
- return false;
- }
- if ((entity instanceof EntityWither) || (entity instanceof EntityDragon) || (entity instanceof IBossDisplayData)){
- return false;
- }
- else {
- return super.canEntityDestroy(world, x, y, z, entity);
- }
- }
-
-
- //Colour Handling
- private static final int mWitherColour = Utils.rgbtoHexValue(32, 32, 32);
-
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){
- return mWitherColour;
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- return mWitherColour;
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- @Override
- public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
- super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
- }
-
- @Override
- public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World p_149737_2_, int p_149737_3_, int p_149737_4_, int p_149737_5_) {
- if (aPlayer != null && aPlayer instanceof EntityPlayerMP) {
- return 1f;
- }
- return -1f;
- }
-
- @Override
- public float getExplosionResistance(Entity p_149638_1_) {
- return Float.MAX_VALUE;
- }
-
- @Override
- public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) {
- super.onBlockClicked(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_, p_149699_5_);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
- if ((entity == null) || !entity.isEntityAlive()){
- return;
- }
- if ((entity instanceof EntityWither) || (entity instanceof EntityDragon) || (entity instanceof IBossDisplayData)){
- return;
- }
- else {
- super.onEntityCollidedWithBlock(world, x, y, z, entity);
- }
- }
-
- @Override
- public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) {
- super.harvestBlock( p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
- }
-
- @Override
- public boolean canHarvestBlock(EntityPlayer player, int meta) {
- if (player != null && player instanceof EntityPlayerMP) {
- return true;
- }
- return super.canHarvestBlock(player, meta);
- }
-
- @Override
- public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) {
- return Float.MAX_VALUE;
- }
-
-
-
+public class BlockWitherProof extends Block {
+
+ public BlockWitherProof() {
+ super(Material.redstoneLight);
+ this.setBlockName(Utils.sanitizeString("blockBlackGate"));
+ this.setBlockTextureName(CORE.MODID + ":" + "blockFrameGt");
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(-1F);
+ this.setResistance(5000.0F);
+ this.setHarvestLevel("pickaxe", 3);
+ this.setStepSound(soundTypeMetal);
+ // LanguageRegistry.addName(this, "Wither Cage");
+ GameRegistry.registerBlock(this, Utils.sanitizeString("blockBlackGate"));
+ }
+
+ public String GetProperName() {
+ return "Wither Cage";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iIcon) {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockFrameGt");
+ }
+
+ @Override
+ public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion) {
+ // prevent from being destroyed by wither and nukes.
+ }
+
+ @Override
+ public void onBlockDestroyedByExplosion(
+ final World p_149723_1_,
+ final int p_149723_2_,
+ final int p_149723_3_,
+ final int p_149723_4_,
+ final Explosion p_149723_5_) {}
+
+ @Override
+ public boolean canDropFromExplosion(final Explosion p_149659_1_) {
+ return false;
+ }
+
+ @Override
+ public boolean canEntityDestroy(
+ final IBlockAccess world, final int x, final int y, final int z, final Entity entity) {
+ if ((entity == null) || !entity.isEntityAlive()) {
+ return false;
+ }
+ if ((entity instanceof EntityWither)
+ || (entity instanceof EntityDragon)
+ || (entity instanceof IBossDisplayData)) {
+ return false;
+ } else {
+ return super.canEntityDestroy(world, x, y, z, entity);
+ }
+ }
+
+ // Colour Handling
+ private static final int mWitherColour = Utils.rgbtoHexValue(32, 32, 32);
+
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
+ return mWitherColour;
+ }
+
+ @Override
+ public int getRenderColor(final int aMeta) {
+ return mWitherColour;
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ @Override
+ public void breakBlock(
+ World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
+ super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
+ }
+
+ @Override
+ public float getPlayerRelativeBlockHardness(
+ EntityPlayer aPlayer, World p_149737_2_, int p_149737_3_, int p_149737_4_, int p_149737_5_) {
+ if (aPlayer != null && aPlayer instanceof EntityPlayerMP) {
+ return 1f;
+ }
+ return -1f;
+ }
+
+ @Override
+ public float getExplosionResistance(Entity p_149638_1_) {
+ return Float.MAX_VALUE;
+ }
+
+ @Override
+ public void onBlockClicked(
+ World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) {
+ super.onBlockClicked(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_, p_149699_5_);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
+ if ((entity == null) || !entity.isEntityAlive()) {
+ return;
+ }
+ if ((entity instanceof EntityWither)
+ || (entity instanceof EntityDragon)
+ || (entity instanceof IBossDisplayData)) {
+ return;
+ } else {
+ super.onEntityCollidedWithBlock(world, x, y, z, entity);
+ }
+ }
+
+ @Override
+ public void harvestBlock(
+ World p_149636_1_,
+ EntityPlayer p_149636_2_,
+ int p_149636_3_,
+ int p_149636_4_,
+ int p_149636_5_,
+ int p_149636_6_) {
+ super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
+ }
+
+ @Override
+ public boolean canHarvestBlock(EntityPlayer player, int meta) {
+ if (player != null && player instanceof EntityPlayerMP) {
+ return true;
+ }
+ return super.canHarvestBlock(player, meta);
+ }
+
+ @Override
+ public float getExplosionResistance(
+ Entity par1Entity,
+ World world,
+ int x,
+ int y,
+ int z,
+ double explosionX,
+ double explosionY,
+ double explosionZ) {
+ return Float.MAX_VALUE;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java b/src/main/java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java
index 01a2116a0b..b3bf56e3f5 100644
--- a/src/main/java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java
+++ b/src/main/java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java
@@ -2,12 +2,14 @@ package gtPlusPlus.core.block.general.antigrief;
import static gtPlusPlus.core.block.ModBlocks.blockGriefSaver;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.general.TileEntityReverter;
+import java.util.List;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -23,271 +25,248 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.general.TileEntityReverter;
-
public class TowerDevice extends Block {
- private static IIcon TEX_ANTIBUILDER;
- public static final int META_ANTIBUILDER = 9;
- private boolean bUnbreakable;
-
- public TowerDevice()
- {
- super(Material.wood);
- this.setHardness(10.0F);
- this.setResistance(35.0F);
- this.setStepSound(Block.soundTypeWood);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- public int tickRate()
- {
- return 15;
- }
-
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setBoolean("bUnbreakable", this.bUnbreakable);
- }
-
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.bUnbreakable = aNBT.getBoolean("bUnbreakable");
- }
-
- @Override
- public IIcon getIcon(final int side, final int meta)
- {
- return TEX_ANTIBUILDER;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister par1IconRegister)
- {
- TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief");
- }
-
- @Override
- public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List)
- {
- par3List.add(new ItemStack(par1, 1, 9));
- }
-
- @Override
- public boolean onBlockActivated(final World par1World, final int x, final int y, final int z, final EntityPlayer par5EntityPlayer, final int par6, final float par7, final float par8, final float par9)
- {
- final int meta = par1World.getBlockMetadata(x, y, z);
- return false;
- }
-
- @Override
- public float getExplosionResistance(final Entity par1Entity, final World world, final int x, final int y, final int z, final double explosionX, final double explosionY, final double explosionZ)
- {
- final int meta = world.getBlockMetadata(x, y, z);
- return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ);
- }
-
- @Override
- public float getBlockHardness(final World world, final int x, final int y, final int z)
- {
- final int meta = world.getBlockMetadata(x, y, z);
- return super.getBlockHardness(world, x, y, z);
- }
-
- public static boolean areNearbyLockBlocks(final World world, final int x, final int y, final int z)
- {
- boolean locked = false;
- for (int dx = x - 2; dx <= (x + 2); dx++) {
- for (int dy = y - 2; dy <= (y + 2); dy++) {
- for (int dz = z - 2; dz <= (z + 2); dz++) {
- if ((world.getBlock(dx, dy, dz) == blockGriefSaver) && (world.getBlockMetadata(dx, dy, dz) == 4)) {
- locked = true;
- }
- }
- }
- }
- return locked;
- }
-
- public static void unlockBlock(final World par1World, final int x, final int y, final int z)
- {
- final Block thereBlockID = par1World.getBlock(x, y, z);
- final int thereBlockMeta = par1World.getBlockMetadata(x, y, z);
- if ((thereBlockID == blockGriefSaver) || (thereBlockMeta == 4))
- {
- changeToBlockMeta(par1World, x, y, z, 5);
- par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F);
- }
- }
-
- private static void changeToBlockMeta(final World par1World, final int x, final int y, final int z, final int meta)
- {
- final Block thereBlockID = par1World.getBlock(x, y, z);
- if ((thereBlockID == blockGriefSaver))
- {
- par1World.setBlock(x, y, z, thereBlockID, meta, 3);
- par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
- par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID);
- }
- }
-
- @Override
- public void onBlockAdded(final World par1World, final int x, final int y, final int z)
- {
- final int meta = par1World.getBlockMetadata(x, y, z);
- if (!par1World.isRemote) {
-
- }
- }
-
- @Override
- public void onNeighborBlockChange(final World par1World, final int x, final int y, final int z, final Block myBlockID)
- {
- final int meta = par1World.getBlockMetadata(x, y, z);
- if (!par1World.isRemote)
- {
-
- }
- }
-
- @Override
- public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random)
- {
- if (!par1World.isRemote)
- {
- final int meta = par1World.getBlockMetadata(x, y, z);
- }
- }
-
- private void letsBuild(final World par1World, final int x, final int y, final int z)
- {
-
- }
-
- private boolean isInactiveTrapCharged(final World par1World, final int x, final int y, final int z)
- {
- return false;
- }
-
- private boolean isReactorReady(final World world, final int x, final int y, final int z)
- {
- if ((world.getBlock(x, y + 1, z) != Blocks.redstone_block) ||
- (world.getBlock(x, y - 1, z) != Blocks.redstone_block) ||
- (world.getBlock(x + 1, y, z) != Blocks.redstone_block) ||
- (world.getBlock(x - 1, y, z) != Blocks.redstone_block) ||
- (world.getBlock(x, y, z + 1) != Blocks.redstone_block) ||
- (world.getBlock(x, y, z - 1) != Blocks.redstone_block)) {
- return false;
- }
- return true;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(final World par1World, final int x, final int y, final int z, final Random par5Random)
- {
- final int meta = par1World.getBlockMetadata(x, y, z);
- if ((meta == 3) || (meta == 1) || (meta == 9)) {
- for (int i = 0; i < 1; i++) {
- this.sparkle(par1World, x, y, z, par5Random);
- }
- }
- }
-
- public void sparkle(final World world, final int x, final int y, final int z, final Random rand)
- {
- final double offset = 0.0625D;
- for (int side = 0; side < 6; side++)
- {
- double rx = x + rand.nextFloat();
- double ry = y + rand.nextFloat();
- double rz = z + rand.nextFloat();
- if ((side == 0) && (!world.getBlock(x, y + 1, z).isOpaqueCube())) {
- ry = y + 1 + offset;
- }
- if ((side == 1) && (!world.getBlock(x, y - 1, z).isOpaqueCube())) {
- ry = (y + 0) - offset;
- }
- if ((side == 2) && (!world.getBlock(x, y, z + 1).isOpaqueCube())) {
- rz = z + 1 + offset;
- }
- if ((side == 3) && (!world.getBlock(x, y, z - 1).isOpaqueCube())) {
- rz = (z + 0) - offset;
- }
- if ((side == 4) && (!world.getBlock(x + 1, y, z).isOpaqueCube())) {
- rx = x + 1 + offset;
- }
- if ((side == 5) && (!world.getBlock(x - 1, y, z).isOpaqueCube())) {
- rx = (x + 0) - offset;
- }
- if ((rx < x) || (rx > (x + 1)) || (ry < 0.0D) || (ry > (y + 1)) || (rz < z) || (rz > (z + 1))) {
- world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D);
- }
- }
- }
-
- public static void checkAndActivateVanishBlock(final World world, final int x, final int y, final int z)
- {
- final Block thereID = world.getBlock(x, y, z);
- final int thereMeta = world.getBlockMetadata(x, y, z);
- }
-
- public static void changeToActiveVanishBlock(final World par1World, final int x, final int y, final int z, final int meta)
- {
- changeToBlockMeta(par1World, x, y, z, meta);
- par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F);
-
- final Block thereBlockID = par1World.getBlock(x, y, z);
- par1World.scheduleBlockUpdate(x, y, z, thereBlockID, getTickRateFor(thereBlockID, meta, par1World.rand));
- }
-
- private static int getTickRateFor(final Block thereBlockID, final int meta, final Random rand)
- {
- return 15;
- }
-
- @Override
- public int getLightValue(final IBlockAccess world, final int x, final int y, final int z)
- {
- final Block blockID = world.getBlock(x, y, z);
- final int meta = world.getBlockMetadata(x, y, z);
- if (blockID != this) {
- return 0;
- }
- return 10;
- }
-
- @Override
- public boolean hasTileEntity(final int metadata)
- {
- return (metadata == 0);
- }
-
- @Override
- public TileEntity createTileEntity(final World world, final int metadata)
- {
- if (metadata == 0) {
- Logger.INFO("I have been created. [Antigriefer]"+this.getLocalizedName());
- return new TileEntityReverter();
- }
- return null;
- }
-
- @Override
- public Item getItemDropped(final int meta, final Random par2Random, final int par3)
- {
- switch (meta)
- {
- case 0:
- return null;
- }
- return Item.getItemFromBlock(this);
- }
-
- @Override
- public int damageDropped(final int meta)
- {
- return meta;
- }
+ private static IIcon TEX_ANTIBUILDER;
+ public static final int META_ANTIBUILDER = 9;
+ private boolean bUnbreakable;
+
+ public TowerDevice() {
+ super(Material.wood);
+ this.setHardness(10.0F);
+ this.setResistance(35.0F);
+ this.setStepSound(Block.soundTypeWood);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ public int tickRate() {
+ return 15;
+ }
+
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setBoolean("bUnbreakable", this.bUnbreakable);
+ }
+
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.bUnbreakable = aNBT.getBoolean("bUnbreakable");
+ }
+
+ @Override
+ public IIcon getIcon(final int side, final int meta) {
+ return TEX_ANTIBUILDER;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister par1IconRegister) {
+ TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief");
+ }
+
+ @Override
+ public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
+ par3List.add(new ItemStack(par1, 1, 9));
+ }
+
+ @Override
+ public boolean onBlockActivated(
+ final World par1World,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer par5EntityPlayer,
+ final int par6,
+ final float par7,
+ final float par8,
+ final float par9) {
+ final int meta = par1World.getBlockMetadata(x, y, z);
+ return false;
+ }
+
+ @Override
+ public float getExplosionResistance(
+ final Entity par1Entity,
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final double explosionX,
+ final double explosionY,
+ final double explosionZ) {
+ final int meta = world.getBlockMetadata(x, y, z);
+ return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ);
+ }
+
+ @Override
+ public float getBlockHardness(final World world, final int x, final int y, final int z) {
+ final int meta = world.getBlockMetadata(x, y, z);
+ return super.getBlockHardness(world, x, y, z);
+ }
+
+ public static boolean areNearbyLockBlocks(final World world, final int x, final int y, final int z) {
+ boolean locked = false;
+ for (int dx = x - 2; dx <= (x + 2); dx++) {
+ for (int dy = y - 2; dy <= (y + 2); dy++) {
+ for (int dz = z - 2; dz <= (z + 2); dz++) {
+ if ((world.getBlock(dx, dy, dz) == blockGriefSaver) && (world.getBlockMetadata(dx, dy, dz) == 4)) {
+ locked = true;
+ }
+ }
+ }
+ }
+ return locked;
+ }
+
+ public static void unlockBlock(final World par1World, final int x, final int y, final int z) {
+ final Block thereBlockID = par1World.getBlock(x, y, z);
+ final int thereBlockMeta = par1World.getBlockMetadata(x, y, z);
+ if ((thereBlockID == blockGriefSaver) || (thereBlockMeta == 4)) {
+ changeToBlockMeta(par1World, x, y, z, 5);
+ par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F);
+ }
+ }
+
+ private static void changeToBlockMeta(
+ final World par1World, final int x, final int y, final int z, final int meta) {
+ final Block thereBlockID = par1World.getBlock(x, y, z);
+ if ((thereBlockID == blockGriefSaver)) {
+ par1World.setBlock(x, y, z, thereBlockID, meta, 3);
+ par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
+ par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID);
+ }
+ }
+
+ @Override
+ public void onBlockAdded(final World par1World, final int x, final int y, final int z) {
+ final int meta = par1World.getBlockMetadata(x, y, z);
+ if (!par1World.isRemote) {}
+ }
+
+ @Override
+ public void onNeighborBlockChange(
+ final World par1World, final int x, final int y, final int z, final Block myBlockID) {
+ final int meta = par1World.getBlockMetadata(x, y, z);
+ if (!par1World.isRemote) {}
+ }
+
+ @Override
+ public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random) {
+ if (!par1World.isRemote) {
+ final int meta = par1World.getBlockMetadata(x, y, z);
+ }
+ }
+
+ private void letsBuild(final World par1World, final int x, final int y, final int z) {}
+
+ private boolean isInactiveTrapCharged(final World par1World, final int x, final int y, final int z) {
+ return false;
+ }
+
+ private boolean isReactorReady(final World world, final int x, final int y, final int z) {
+ if ((world.getBlock(x, y + 1, z) != Blocks.redstone_block)
+ || (world.getBlock(x, y - 1, z) != Blocks.redstone_block)
+ || (world.getBlock(x + 1, y, z) != Blocks.redstone_block)
+ || (world.getBlock(x - 1, y, z) != Blocks.redstone_block)
+ || (world.getBlock(x, y, z + 1) != Blocks.redstone_block)
+ || (world.getBlock(x, y, z - 1) != Blocks.redstone_block)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(
+ final World par1World, final int x, final int y, final int z, final Random par5Random) {
+ final int meta = par1World.getBlockMetadata(x, y, z);
+ if ((meta == 3) || (meta == 1) || (meta == 9)) {
+ for (int i = 0; i < 1; i++) {
+ this.sparkle(par1World, x, y, z, par5Random);
+ }
+ }
+ }
+
+ public void sparkle(final World world, final int x, final int y, final int z, final Random rand) {
+ final double offset = 0.0625D;
+ for (int side = 0; side < 6; side++) {
+ double rx = x + rand.nextFloat();
+ double ry = y + rand.nextFloat();
+ double rz = z + rand.nextFloat();
+ if ((side == 0) && (!world.getBlock(x, y + 1, z).isOpaqueCube())) {
+ ry = y + 1 + offset;
+ }
+ if ((side == 1) && (!world.getBlock(x, y - 1, z).isOpaqueCube())) {
+ ry = (y + 0) - offset;
+ }
+ if ((side == 2) && (!world.getBlock(x, y, z + 1).isOpaqueCube())) {
+ rz = z + 1 + offset;
+ }
+ if ((side == 3) && (!world.getBlock(x, y, z - 1).isOpaqueCube())) {
+ rz = (z + 0) - offset;
+ }
+ if ((side == 4) && (!world.getBlock(x + 1, y, z).isOpaqueCube())) {
+ rx = x + 1 + offset;
+ }
+ if ((side == 5) && (!world.getBlock(x - 1, y, z).isOpaqueCube())) {
+ rx = (x + 0) - offset;
+ }
+ if ((rx < x) || (rx > (x + 1)) || (ry < 0.0D) || (ry > (y + 1)) || (rz < z) || (rz > (z + 1))) {
+ world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ public static void checkAndActivateVanishBlock(final World world, final int x, final int y, final int z) {
+ final Block thereID = world.getBlock(x, y, z);
+ final int thereMeta = world.getBlockMetadata(x, y, z);
+ }
+
+ public static void changeToActiveVanishBlock(
+ final World par1World, final int x, final int y, final int z, final int meta) {
+ changeToBlockMeta(par1World, x, y, z, meta);
+ par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F);
+
+ final Block thereBlockID = par1World.getBlock(x, y, z);
+ par1World.scheduleBlockUpdate(x, y, z, thereBlockID, getTickRateFor(thereBlockID, meta, par1World.rand));
+ }
+
+ private static int getTickRateFor(final Block thereBlockID, final int meta, final Random rand) {
+ return 15;
+ }
+
+ @Override
+ public int getLightValue(final IBlockAccess world, final int x, final int y, final int z) {
+ final Block blockID = world.getBlock(x, y, z);
+ final int meta = world.getBlockMetadata(x, y, z);
+ if (blockID != this) {
+ return 0;
+ }
+ return 10;
+ }
+
+ @Override
+ public boolean hasTileEntity(final int metadata) {
+ return (metadata == 0);
+ }
+
+ @Override
+ public TileEntity createTileEntity(final World world, final int metadata) {
+ if (metadata == 0) {
+ Logger.INFO("I have been created. [Antigriefer]" + this.getLocalizedName());
+ return new TileEntityReverter();
+ }
+ return null;
+ }
+
+ @Override
+ public Item getItemDropped(final int meta, final Random par2Random, final int par3) {
+ switch (meta) {
+ case 0:
+ return null;
+ }
+ return Item.getItemFromBlock(this);
+ }
+
+ @Override
+ public int damageDropped(final int meta) {
+ return meta;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/fluids/BlockFluidSludge.java b/src/main/java/gtPlusPlus/core/block/general/fluids/BlockFluidSludge.java
index 6af27639ae..fcce29d164 100644
--- a/src/main/java/gtPlusPlus/core/block/general/fluids/BlockFluidSludge.java
+++ b/src/main/java/gtPlusPlus/core/block/general/fluids/BlockFluidSludge.java
@@ -2,62 +2,61 @@ package gtPlusPlus.core.block.general.fluids;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
public class BlockFluidSludge extends BlockFluidClassic {
- @SideOnly(Side.CLIENT)
- protected IIcon stillIcon;
- @SideOnly(Side.CLIENT)
- protected IIcon flowingIcon;
-
- public BlockFluidSludge(final Fluid fluid, final Material material) {
- super(fluid, material);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- }
-
- @Override
- public IIcon getIcon(final int side, final int meta) {
- return ((side == 0) || (side == 1))? this.stillIcon : this.flowingIcon;
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(final IIconRegister register) {
- this.stillIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels");
- this.flowingIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels");
- }
-
- @Override
- public boolean canDisplace(final IBlockAccess world, final int x, final int y, final int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
- return false;
- }
- return super.canDisplace(world, x, y, z);
- }
-
- @Override
- public boolean displaceIfPossible(final World world, final int x, final int y, final int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
- return false;
- }
- return super.displaceIfPossible(world, x, y, z);
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
+ @SideOnly(Side.CLIENT)
+ protected IIcon stillIcon;
+
+ @SideOnly(Side.CLIENT)
+ protected IIcon flowingIcon;
+
+ public BlockFluidSludge(final Fluid fluid, final Material material) {
+ super(fluid, material);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ }
+
+ @Override
+ public IIcon getIcon(final int side, final int meta) {
+ return ((side == 0) || (side == 1)) ? this.stillIcon : this.flowingIcon;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(final IIconRegister register) {
+ this.stillIcon = register.registerIcon(CORE.MODID + ":fluids/fluid.jackdaniels");
+ this.flowingIcon = register.registerIcon(CORE.MODID + ":fluids/fluid.jackdaniels");
+ }
+
+ @Override
+ public boolean canDisplace(final IBlockAccess world, final int x, final int y, final int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
+ return false;
+ }
+ return super.canDisplace(world, x, y, z);
+ }
+
+ @Override
+ public boolean displaceIfPossible(final World world, final int x, final int y, final int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
+ return false;
+ }
+ return super.displaceIfPossible(world, x, y, z);
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java
index b84c96be99..1c1434b741 100644
--- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java
+++ b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java
@@ -1,10 +1,5 @@
package gtPlusPlus.core.block.general.redstone;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -17,6 +12,10 @@ import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler;
import gtPlusPlus.core.util.minecraft.InventoryUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -36,335 +35,353 @@ import net.minecraftforge.common.util.ForgeDirection;
public abstract class BlockGenericRedstone extends BlockContainer {
-
- @SuppressWarnings("deprecation")
- public BlockGenericRedstone(String aUnlocalizedSuffix, String aDisplayName) {
- super(Material.redstoneLight);
- this.setBlockName("blockGenericRedstone." + aUnlocalizedSuffix);
- this.setHardness(3f);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockGenericRedstone." + aUnlocalizedSuffix);
- LanguageRegistry.addName(this, aDisplayName);
-
- }
-
-
- private final HashMap<Integer, HashMap<ForgeDirection, IIcon>> mTextures = new HashMap<Integer, HashMap<ForgeDirection, IIcon>>();
-
- /**
- * A map of the textures used for this blocks. The key is the meta, then each internal map holds textures tied to each forge direction. Do not use unknown direction.
- * @return
- */
- public HashMap<Integer, HashMap<ForgeDirection, IIcon>> getTextureArray() {
- return mTextures;
- }
-
- public abstract void generateTextureArray(final IIconRegister iicon);
-
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerBlockIcons(final IIconRegister iicon) {
- generateTextureArray(iicon);
- this.blockIcon = iicon.registerIcon("redstone_block");
- }
-
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int side, final float lx, final float ly, final float lz) {
-
- if (world.isRemote) {
- return true;
- }
-
- boolean mDidTool = false;
- // Check For Tools
- try {
- final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
- final Item mHandItem = mHandStack.getItem();
- if (ItemUtils.isItemGregtechTool(mHandStack)) {
-
- Logger.INFO("Found Tool in players hand!");
-
- final TileEntityRedstoneHandler tile = (TileEntityRedstoneHandler) world.getTileEntity(x, y, z);
- if (tile != null) {
- if (tile.isScrewdriverable()) {
- if (ItemUtils.isToolScrewdriver(mHandStack)){
- mDidTool = tile.onScrewdriverRMB();
- PlayerUtils.messagePlayer(player, "Adjusted Light level by 0.0625f. "+tile.getLightBrightness());
- }
- }
- if (tile.isMalletable()) {
- if (ItemUtils.isToolMallet(mHandStack)){
- mDidTool = tile.onMalletRMB();
- PlayerUtils.messagePlayer(player, "Light Mode active: "+mDidTool);
- }
- }
- if (tile.isWrenchable()) {
- if (ItemUtils.isToolWrench(mHandStack)){
- mDidTool = tile.onWrenchRMB();
- }
- }
- }
- }
- }
- catch (final Throwable t) {}
- if (mDidTool) {
- return true;
- }
-
- return false;
- }
-
-
-
- @Override
- public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
-
- boolean mDidTool = false;
- // Check For Tools
- try {
- final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(aWorld, aPlayer.getDisplayName());
- final Item mHandItem = mHandStack.getItem();
- if (mHandItem instanceof GT_MetaGenerated_Tool_01) {
-
- final TileEntityRedstoneHandler tile = (TileEntityRedstoneHandler) aWorld.getTileEntity(aX, aY, aZ);
- if (tile != null) {
- if (tile.isScrewdriverable()) {
- if (ItemUtils.isToolScrewdriver(mHandStack)){
- mDidTool = tile.onScrewdriverLMB();
- }
- }
- if (tile.isMalletable()) {
- if (ItemUtils.isToolMallet(mHandStack)){
- mDidTool = tile.onMalletLMB();
- }
- }
- if (tile.isWrenchable()) {
- if (ItemUtils.isToolWrench(mHandStack)){
- mDidTool = tile.onWrenchLMB();
- }
- }
- }
- }
- }
- catch (Throwable t) {}
-
- if (!mDidTool && !aPlayer.capabilities.isCreativeMode) {
- super.onBlockClicked(aWorld, aX, aY, aZ, aPlayer);
- }
- else {
- return;
- }
- }
-
- @Override
- public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_);
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block,
- final int number) {
- InventoryUtils.dropInventoryItems(world, x, y, z, block);
- super.breakBlock(world, x, y, z, block, number);
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity,
- final ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityRedstoneHandler) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-
- @Override
- public int getLightValue() {
- return super.getLightValue();
- }
-
- @Override
- public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_,
- float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) {
- // TODO Auto-generated method stub
- return super.onBlockPlaced(p_149660_1_, p_149660_2_, p_149660_3_, p_149660_4_, p_149660_5_, p_149660_6_,
- p_149660_7_, p_149660_8_, p_149660_9_);
- }
-
- @Override
- public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.isProvidingWeakPower(world, x, y, z, side);
- }
- return 0;
- }
-
- @Override
- public boolean canProvidePower() {
- return false;
- }
-
- @Override
- public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.isProvidingStrongPower(world, x, y, z, side);
- }
- return 0;
- }
-
- @Override
- public boolean hasComparatorInputOverride() {
- // TODO Auto-generated method stub
- return super.hasComparatorInputOverride();
- }
-
- @Override
- public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_,
- int p_149736_5_) {
- // TODO Auto-generated method stub
- return super.getComparatorInputOverride(p_149736_1_, p_149736_2_, p_149736_3_, p_149736_4_, p_149736_5_);
- }
-
- @Override
- public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.canConnectRedstone(world, x, y, z, side);
- }
- return false;
- }
-
- @Override
- public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.shouldCheckWeakPower(world, x, y, z, side);
- }
+ @SuppressWarnings("deprecation")
+ public BlockGenericRedstone(String aUnlocalizedSuffix, String aDisplayName) {
+ super(Material.redstoneLight);
+ this.setBlockName("blockGenericRedstone." + aUnlocalizedSuffix);
+ this.setHardness(3f);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockGenericRedstone." + aUnlocalizedSuffix);
+ LanguageRegistry.addName(this, aDisplayName);
+ }
+
+ private final HashMap<Integer, HashMap<ForgeDirection, IIcon>> mTextures =
+ new HashMap<Integer, HashMap<ForgeDirection, IIcon>>();
+
+ /**
+ * A map of the textures used for this blocks. The key is the meta, then each internal map holds textures tied to each forge direction. Do not use unknown direction.
+ * @return
+ */
+ public HashMap<Integer, HashMap<ForgeDirection, IIcon>> getTextureArray() {
+ return mTextures;
+ }
+
+ public abstract void generateTextureArray(final IIconRegister iicon);
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerBlockIcons(final IIconRegister iicon) {
+ generateTextureArray(iicon);
+ this.blockIcon = iicon.registerIcon("redstone_block");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+
+ if (world.isRemote) {
+ return true;
+ }
+
+ boolean mDidTool = false;
+ // Check For Tools
+ try {
+ final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
+ final Item mHandItem = mHandStack.getItem();
+ if (ItemUtils.isItemGregtechTool(mHandStack)) {
+
+ Logger.INFO("Found Tool in players hand!");
+
+ final TileEntityRedstoneHandler tile = (TileEntityRedstoneHandler) world.getTileEntity(x, y, z);
+ if (tile != null) {
+ if (tile.isScrewdriverable()) {
+ if (ItemUtils.isToolScrewdriver(mHandStack)) {
+ mDidTool = tile.onScrewdriverRMB();
+ PlayerUtils.messagePlayer(
+ player, "Adjusted Light level by 0.0625f. " + tile.getLightBrightness());
+ }
+ }
+ if (tile.isMalletable()) {
+ if (ItemUtils.isToolMallet(mHandStack)) {
+ mDidTool = tile.onMalletRMB();
+ PlayerUtils.messagePlayer(player, "Light Mode active: " + mDidTool);
+ }
+ }
+ if (tile.isWrenchable()) {
+ if (ItemUtils.isToolWrench(mHandStack)) {
+ mDidTool = tile.onWrenchRMB();
+ }
+ }
+ }
+ }
+ } catch (final Throwable t) {
+ }
+ if (mDidTool) {
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
+
+ boolean mDidTool = false;
+ // Check For Tools
+ try {
+ final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(aWorld, aPlayer.getDisplayName());
+ final Item mHandItem = mHandStack.getItem();
+ if (mHandItem instanceof GT_MetaGenerated_Tool_01) {
+
+ final TileEntityRedstoneHandler tile = (TileEntityRedstoneHandler) aWorld.getTileEntity(aX, aY, aZ);
+ if (tile != null) {
+ if (tile.isScrewdriverable()) {
+ if (ItemUtils.isToolScrewdriver(mHandStack)) {
+ mDidTool = tile.onScrewdriverLMB();
+ }
+ }
+ if (tile.isMalletable()) {
+ if (ItemUtils.isToolMallet(mHandStack)) {
+ mDidTool = tile.onMalletLMB();
+ }
+ }
+ if (tile.isWrenchable()) {
+ if (ItemUtils.isToolWrench(mHandStack)) {
+ mDidTool = tile.onWrenchLMB();
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ }
+
+ if (!mDidTool && !aPlayer.capabilities.isCreativeMode) {
+ super.onBlockClicked(aWorld, aX, aY, aZ, aPlayer);
+ } else {
+ return;
+ }
+ }
+
+ @Override
+ public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_);
+
+ @Override
+ public void breakBlock(
+ final World world, final int x, final int y, final int z, final Block block, final int number) {
+ InventoryUtils.dropInventoryItems(world, x, y, z, block);
+ super.breakBlock(world, x, y, z, block, number);
+ }
+
+ @Override
+ public void onBlockPlacedBy(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityLivingBase entity,
+ final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityRedstoneHandler) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ @Override
+ public int getLightValue() {
+ return super.getLightValue();
+ }
+
+ @Override
+ public int onBlockPlaced(
+ World p_149660_1_,
+ int p_149660_2_,
+ int p_149660_3_,
+ int p_149660_4_,
+ int p_149660_5_,
+ float p_149660_6_,
+ float p_149660_7_,
+ float p_149660_8_,
+ int p_149660_9_) {
+ // TODO Auto-generated method stub
+ return super.onBlockPlaced(
+ p_149660_1_,
+ p_149660_2_,
+ p_149660_3_,
+ p_149660_4_,
+ p_149660_5_,
+ p_149660_6_,
+ p_149660_7_,
+ p_149660_8_,
+ p_149660_9_);
+ }
+
+ @Override
+ public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
+ TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
+ if (aThis != null) {
+ return aThis.isProvidingWeakPower(world, x, y, z, side);
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean canProvidePower() {
+ return false;
+ }
+
+ @Override
+ public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
+ TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
+ if (aThis != null) {
+ return aThis.isProvidingStrongPower(world, x, y, z, side);
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean hasComparatorInputOverride() {
+ // TODO Auto-generated method stub
+ return super.hasComparatorInputOverride();
+ }
+
+ @Override
+ public int getComparatorInputOverride(
+ World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) {
+ // TODO Auto-generated method stub
+ return super.getComparatorInputOverride(p_149736_1_, p_149736_2_, p_149736_3_, p_149736_4_, p_149736_5_);
+ }
+
+ @Override
+ public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) {
+ TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
+ if (aThis != null) {
+ return aThis.canConnectRedstone(world, x, y, z, side);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) {
+ TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
+ if (aThis != null) {
+ return aThis.shouldCheckWeakPower(world, x, y, z, side);
+ }
return isNormalCube();
- }
-
- @Override
- public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.getWeakChanges(world, x, y, z);
- }
- return false;
- }
-
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public abstract IIcon getIcon(final int side, final int meta);
-
- @Override
- public int damageDropped(final int damage) {
- return damage;
- }
-
- @Override
- public abstract void getSubBlocks(final Item item, final CreativeTabs tab, final List list);
-
-
- /**
- * Called whenever the block is added into the world. Args: world, x, y, z
- */
- public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
- TileEntityRedstoneHandler aThis = getTileEntity(aWorld, aX, aY, aZ);
-
- if (!aWorld.isRemote) {
- if (aThis.hasUpdatedRecently() && !aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
- aWorld.scheduleBlockUpdate(aX, aY, aZ, this, 4);
- } else if (!aThis.hasUpdatedRecently() && aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
- aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 2);
- }
- }
- }
-
- /**
- * Lets the block know when one of its neighbor changes. Doesn't know which
- * neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
- * Block
- */
- public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) {
-
- TileEntityRedstoneHandler aThis = getTileEntity(aWorld, aX, aY, aZ);
-
- if (!aWorld.isRemote) {
- if (aThis.hasUpdatedRecently() && !aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
- aWorld.scheduleBlockUpdate(aX, aY, aZ, this, 4);
- } else if (!aThis.hasUpdatedRecently() && aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
- aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 2);
- }
- }
- }
-
- /**
- * Ticks the block if it's been scheduled
- */
- public void updateTick(World aWorld, int aX, int aY, int aZ, Random p_149674_5_) {
- TileEntityRedstoneHandler aTile = getTileEntity(aWorld, aX, aY, aZ);
- // Client side handling
- if (aTile != null) {
- this.setLightLevel(aTile.getLightBrightness());
- }
- // Only continue on server
- if (aWorld.isRemote) {
- return;
- }
- if (aTile != null) {
- if (aTile.isGettingIndirectlyPowered()) {
- }
- }
- }
-
- public TileEntityRedstoneHandler getTileEntity(IBlockAccess world, int aX, int aY, int aZ) {
- TileEntity aTemp = world.getTileEntity(aX, aY, aZ);
- if (aTemp != null) {
- if (aTemp instanceof TileEntityRedstoneHandler) {
- TileEntityRedstoneHandler g = (TileEntityRedstoneHandler) aTemp;
- if (g != null) {
- return g;
- }
- }
- }
- return null;
- }
-
-
- /**
- * Gets an item for the block being called on. Args: world, x, y, z
- */
- @SideOnly(Side.CLIENT)
- @Override
- public abstract Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_);
-
- /**
- * Returns an item stack containing a single instance of the current block type.
- * 'i' is the block's subtype/damage and is ignored for blocks which do not
- * support subtypes. Blocks which cannot be harvested should return null.
- */
- @Override
- protected abstract ItemStack createStackedBlock(int p_149644_1_);
-
- @Override
- public abstract ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int metadata, final int fortune);
-
- @Override
- public abstract Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_);
-
-
-} \ No newline at end of file
+ }
+
+ @Override
+ public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) {
+ TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
+ if (aThis != null) {
+ return aThis.getWeakChanges(world, x, y, z);
+ }
+ return false;
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public abstract IIcon getIcon(final int side, final int meta);
+
+ @Override
+ public int damageDropped(final int damage) {
+ return damage;
+ }
+
+ @Override
+ public abstract void getSubBlocks(final Item item, final CreativeTabs tab, final List list);
+
+ /**
+ * Called whenever the block is added into the world. Args: world, x, y, z
+ */
+ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
+ TileEntityRedstoneHandler aThis = getTileEntity(aWorld, aX, aY, aZ);
+
+ if (!aWorld.isRemote) {
+ if (aThis.hasUpdatedRecently() && !aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
+ aWorld.scheduleBlockUpdate(aX, aY, aZ, this, 4);
+ } else if (!aThis.hasUpdatedRecently() && aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
+ aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 2);
+ }
+ }
+ }
+
+ /**
+ * Lets the block know when one of its neighbor changes. Doesn't know which
+ * neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
+ * Block
+ */
+ public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) {
+
+ TileEntityRedstoneHandler aThis = getTileEntity(aWorld, aX, aY, aZ);
+
+ if (!aWorld.isRemote) {
+ if (aThis.hasUpdatedRecently() && !aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
+ aWorld.scheduleBlockUpdate(aX, aY, aZ, this, 4);
+ } else if (!aThis.hasUpdatedRecently() && aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
+ aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 2);
+ }
+ }
+ }
+
+ /**
+ * Ticks the block if it's been scheduled
+ */
+ public void updateTick(World aWorld, int aX, int aY, int aZ, Random p_149674_5_) {
+ TileEntityRedstoneHandler aTile = getTileEntity(aWorld, aX, aY, aZ);
+ // Client side handling
+ if (aTile != null) {
+ this.setLightLevel(aTile.getLightBrightness());
+ }
+ // Only continue on server
+ if (aWorld.isRemote) {
+ return;
+ }
+ if (aTile != null) {
+ if (aTile.isGettingIndirectlyPowered()) {}
+ }
+ }
+
+ public TileEntityRedstoneHandler getTileEntity(IBlockAccess world, int aX, int aY, int aZ) {
+ TileEntity aTemp = world.getTileEntity(aX, aY, aZ);
+ if (aTemp != null) {
+ if (aTemp instanceof TileEntityRedstoneHandler) {
+ TileEntityRedstoneHandler g = (TileEntityRedstoneHandler) aTemp;
+ if (g != null) {
+ return g;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets an item for the block being called on. Args: world, x, y, z
+ */
+ @SideOnly(Side.CLIENT)
+ @Override
+ public abstract Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_);
+
+ /**
+ * Returns an item stack containing a single instance of the current block type.
+ * 'i' is the block's subtype/damage and is ignored for blocks which do not
+ * support subtypes. Blocks which cannot be harvested should return null.
+ */
+ @Override
+ protected abstract ItemStack createStackedBlock(int p_149644_1_);
+
+ @Override
+ public abstract ArrayList<ItemStack> getDrops(
+ final World world, final int x, final int y, final int z, final int metadata, final int fortune);
+
+ @Override
+ public abstract Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_);
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java
index 43247110f1..406b53fb59 100644
--- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java
+++ b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java
@@ -1,13 +1,12 @@
package gtPlusPlus.core.block.general.redstone;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
-
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@@ -19,113 +18,114 @@ import net.minecraftforge.common.util.ForgeDirection;
public class BlockGenericRedstoneDetector extends BlockGenericRedstone {
- public BlockGenericRedstoneDetector() {
- super("detector", "Redstone Detector");
- setTickRandomly(true);
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int p_149915_2_) {
- return new TileEntityRedstoneDetector();
- }
-
- public class TileEntityRedstoneDetector extends TileEntityRedstoneHandler {
- public TileEntityRedstoneDetector() {
- super(0);
- }
-
- @Override
- protected Class<? extends TileEntity> getTileEntityClass() {
- return this.getClass();
- }
-
- @Override
- protected String getTileEntityNameForRegistration() {
- return "TileEntityRedstoneDetector";
- }
- }
-
- @Override
- public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List aList) {
- aList.add(ItemUtils.getSimpleStack(this));
- }
-
-
- @Override
- public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) {
- super.updateTick(aWorld, aX, aY, aZ, aRand);
- }
-
- @Override
- public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
- // TODO Auto-generated method stub
- return ItemUtils.getSimpleStack(this).getItem();
- }
-
- @Override
- public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
- // TODO Auto-generated method stub
- return ItemUtils.getSimpleStack(this).getItem();
- }
-
- @Override
- protected ItemStack createStackedBlock(int p_149644_1_) {
- return ItemUtils.simpleMetaStack(this, p_149644_1_, 1);
- }
-
- public void generateTextureArray(final IIconRegister iicon) {
- HashMap<Integer, HashMap<ForgeDirection, IIcon>> aTextures = new HashMap<Integer, HashMap<ForgeDirection, IIcon>>();
-
-
- //New Block for Each Meta
- int aMeta = 0;
- {
- HashMap<ForgeDirection, IIcon> aTempMap = new HashMap<ForgeDirection, IIcon>();
- aTempMap.put(ForgeDirection.UP, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.DOWN, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.NORTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.SOUTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.EAST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.WEST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTextures.put(aMeta++, aTempMap);
- }
-
- }
-
- @Override
- public IIcon getIcon(int side, int meta) {
- HashMap<ForgeDirection, IIcon> aTemp = getTextureArray().get(meta);
- if (aTemp != null) {
- IIcon aSide = aTemp.get(ForgeDirection.getOrientation(side));
- if (aSide != null) {
- return aSide;
- }
- else {
- //Smart calculate missing sides
- if (side <= 1) {
- for (int ss = 0; ss < 2; ss++) {
- aSide = aTemp.get(ForgeDirection.getOrientation(side));
- if (aSide != null) {
- return aSide;
- }
- }
- }
- for (int ss = 2; ss < 6; ss++) {
- aSide = aTemp.get(ForgeDirection.getOrientation(side));
- if (aSide != null) {
- return aSide;
- }
- }
- }
- }
- return blockIcon;
- }
-
- @Override
- public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
- ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
- aDrops.add(ItemUtils.getSimpleStack(this));
- return aDrops;
- }
-
+ public BlockGenericRedstoneDetector() {
+ super("detector", "Redstone Detector");
+ setTickRandomly(true);
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int p_149915_2_) {
+ return new TileEntityRedstoneDetector();
+ }
+
+ public class TileEntityRedstoneDetector extends TileEntityRedstoneHandler {
+ public TileEntityRedstoneDetector() {
+ super(0);
+ }
+
+ @Override
+ protected Class<? extends TileEntity> getTileEntityClass() {
+ return this.getClass();
+ }
+
+ @Override
+ protected String getTileEntityNameForRegistration() {
+ return "TileEntityRedstoneDetector";
+ }
+ }
+
+ @Override
+ public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List aList) {
+ aList.add(ItemUtils.getSimpleStack(this));
+ }
+
+ @Override
+ public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) {
+ super.updateTick(aWorld, aX, aY, aZ, aRand);
+ }
+
+ @Override
+ public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
+ // TODO Auto-generated method stub
+ return ItemUtils.getSimpleStack(this).getItem();
+ }
+
+ @Override
+ public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
+ // TODO Auto-generated method stub
+ return ItemUtils.getSimpleStack(this).getItem();
+ }
+
+ @Override
+ protected ItemStack createStackedBlock(int p_149644_1_) {
+ return ItemUtils.simpleMetaStack(this, p_149644_1_, 1);
+ }
+
+ public void generateTextureArray(final IIconRegister iicon) {
+ HashMap<Integer, HashMap<ForgeDirection, IIcon>> aTextures =
+ new HashMap<Integer, HashMap<ForgeDirection, IIcon>>();
+
+ // New Block for Each Meta
+ int aMeta = 0;
+ {
+ HashMap<ForgeDirection, IIcon> aTempMap = new HashMap<ForgeDirection, IIcon>();
+ aTempMap.put(ForgeDirection.UP, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.DOWN, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.NORTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.SOUTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.EAST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.WEST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTextures.put(aMeta++, aTempMap);
+ }
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ HashMap<ForgeDirection, IIcon> aTemp = getTextureArray().get(meta);
+ if (aTemp != null) {
+ IIcon aSide = aTemp.get(ForgeDirection.getOrientation(side));
+ if (aSide != null) {
+ return aSide;
+ } else {
+ // Smart calculate missing sides
+ if (side <= 1) {
+ for (int ss = 0; ss < 2; ss++) {
+ aSide = aTemp.get(ForgeDirection.getOrientation(side));
+ if (aSide != null) {
+ return aSide;
+ }
+ }
+ }
+ for (int ss = 2; ss < 6; ss++) {
+ aSide = aTemp.get(ForgeDirection.getOrientation(side));
+ if (aSide != null) {
+ return aSide;
+ }
+ }
+ }
+ }
+ return blockIcon;
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
+ ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
+ aDrops.add(ItemUtils.getSimpleStack(this));
+ return aDrops;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneEmitter.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneEmitter.java
index df8a929302..c732ed216b 100644
--- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneEmitter.java
+++ b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneEmitter.java
@@ -1,5 +1,3 @@
package gtPlusPlus.core.block.general.redstone;
-public class BlockGenericRedstoneEmitter {
-
-}
+public class BlockGenericRedstoneEmitter {}
diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java
index 0f1f983cd0..85c2506359 100644
--- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java
+++ b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java
@@ -1,16 +1,15 @@
package gtPlusPlus.core.block.general.redstone;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Random;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.world.explosions.ExplosionHandler;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@@ -23,179 +22,179 @@ import net.minecraftforge.common.util.ForgeDirection;
public class BlockGenericRedstoneTest extends BlockGenericRedstone {
- public BlockGenericRedstoneTest() {
- super("test", "Redstone Test");
- setTickRandomly(true);
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int p_149915_2_) {
- return new TileEntityRedstoneTest();
- }
-
- public class TileEntityRedstoneTest extends TileEntityRedstoneHandler {
- public TileEntityRedstoneTest() {
- super(2);
- }
-
- @Override
- public boolean isScrewdriverable() {
- return true;
- }
-
- @Override
- public boolean onScrewdriverLMB() {
- return super.onScrewdriverLMB();
- }
-
- @Override
- public boolean onScrewdriverRMB() {
- if (this.mLightValue + 0.0625f <= 1) {
- this.mLightValue += 0.0625f;
- }
- else {
- this.mLightValue = 0;
- }
- this.markForUpdate();
- return true;
- }
-
- @Override
- public boolean isMalletable() {
- return true;
- }
-
- @Override
- public boolean onMalletLMB() {
- return super.onMalletLMB();
- }
-
- @Override
- public boolean onMalletRMB() {
- this.mLightMode = Utils.invertBoolean(mLightMode);
- this.markForUpdate();
- return mLightMode;
- }
-
- @Override
- public boolean isWrenchable() {
- return true;
- }
-
- @Override
- public boolean onWrenchLMB() {
- return super.onWrenchLMB();
- }
-
- @Override
- public boolean onWrenchRMB() {
- Logger.INFO("Found Wrench");
- ExplosionHandler explode = new ExplosionHandler();
- explode.createExplosion(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, 1f, false, true);
- return true;
- }
-
- @Override
- protected Class<? extends TileEntity> getTileEntityClass() {
- return this.getClass();
- }
-
- @Override
- protected String getTileEntityNameForRegistration() {
- return "TileEntityRedstoneTest";
- }
-
- @Override
- public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
- return super.isProvidingWeakPower(world, x, y, z, side);
- }
-
- @Override
- public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
- return super.isProvidingStrongPower(world, x, y, z, side);
- }
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List aList) {
- aList.add(ItemUtils.getSimpleStack(this));
- }
-
-
- @Override
- public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) {
- super.updateTick(aWorld, aX, aY, aZ, aRand);
- }
-
- @Override
- public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
- return ItemUtils.getSimpleStack(this).getItem();
- }
-
- @Override
- public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
- return ItemUtils.getSimpleStack(this).getItem();
- }
-
- @Override
- protected ItemStack createStackedBlock(int p_149644_1_) {
- return ItemUtils.simpleMetaStack(this, p_149644_1_, 1);
- }
-
- public void generateTextureArray(final IIconRegister iicon) {
- HashMap<Integer, HashMap<ForgeDirection, IIcon>> aTextures = new HashMap<Integer, HashMap<ForgeDirection, IIcon>>();
-
-
- //New Block for Each Meta
- int aMeta = 0;
- {
- HashMap<ForgeDirection, IIcon> aTempMap = new HashMap<ForgeDirection, IIcon>();
- aTempMap.put(ForgeDirection.UP, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.DOWN, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.NORTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.SOUTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.EAST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(ForgeDirection.WEST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
- aTextures.put(aMeta++, aTempMap);
- }
-
- }
-
- @Override
- public IIcon getIcon(int side, int meta) {
- HashMap<ForgeDirection, IIcon> aTemp = getTextureArray().get(meta);
- if (aTemp != null) {
- IIcon aSide = aTemp.get(ForgeDirection.getOrientation(side));
- if (aSide != null) {
- return aSide;
- }
- else {
- //Smart calculate missing sides
- if (side <= 1) {
- for (int ss = 0; ss < 2; ss++) {
- aSide = aTemp.get(ForgeDirection.getOrientation(side));
- if (aSide != null) {
- return aSide;
- }
- }
- }
- for (int ss = 2; ss < 6; ss++) {
- aSide = aTemp.get(ForgeDirection.getOrientation(side));
- if (aSide != null) {
- return aSide;
- }
- }
- }
- }
- return blockIcon;
- }
-
- @Override
- public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
- ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
- aDrops.add(ItemUtils.getSimpleStack(this));
- return aDrops;
- }
-
+ public BlockGenericRedstoneTest() {
+ super("test", "Redstone Test");
+ setTickRandomly(true);
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int p_149915_2_) {
+ return new TileEntityRedstoneTest();
+ }
+
+ public class TileEntityRedstoneTest extends TileEntityRedstoneHandler {
+ public TileEntityRedstoneTest() {
+ super(2);
+ }
+
+ @Override
+ public boolean isScrewdriverable() {
+ return true;
+ }
+
+ @Override
+ public boolean onScrewdriverLMB() {
+ return super.onScrewdriverLMB();
+ }
+
+ @Override
+ public boolean onScrewdriverRMB() {
+ if (this.mLightValue + 0.0625f <= 1) {
+ this.mLightValue += 0.0625f;
+ } else {
+ this.mLightValue = 0;
+ }
+ this.markForUpdate();
+ return true;
+ }
+
+ @Override
+ public boolean isMalletable() {
+ return true;
+ }
+
+ @Override
+ public boolean onMalletLMB() {
+ return super.onMalletLMB();
+ }
+
+ @Override
+ public boolean onMalletRMB() {
+ this.mLightMode = Utils.invertBoolean(mLightMode);
+ this.markForUpdate();
+ return mLightMode;
+ }
+
+ @Override
+ public boolean isWrenchable() {
+ return true;
+ }
+
+ @Override
+ public boolean onWrenchLMB() {
+ return super.onWrenchLMB();
+ }
+
+ @Override
+ public boolean onWrenchRMB() {
+ Logger.INFO("Found Wrench");
+ ExplosionHandler explode = new ExplosionHandler();
+ explode.createExplosion(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, 1f, false, true);
+ return true;
+ }
+
+ @Override
+ protected Class<? extends TileEntity> getTileEntityClass() {
+ return this.getClass();
+ }
+
+ @Override
+ protected String getTileEntityNameForRegistration() {
+ return "TileEntityRedstoneTest";
+ }
+
+ @Override
+ public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
+ return super.isProvidingWeakPower(world, x, y, z, side);
+ }
+
+ @Override
+ public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
+ return super.isProvidingStrongPower(world, x, y, z, side);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List aList) {
+ aList.add(ItemUtils.getSimpleStack(this));
+ }
+
+ @Override
+ public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) {
+ super.updateTick(aWorld, aX, aY, aZ, aRand);
+ }
+
+ @Override
+ public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
+ return ItemUtils.getSimpleStack(this).getItem();
+ }
+
+ @Override
+ public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
+ return ItemUtils.getSimpleStack(this).getItem();
+ }
+
+ @Override
+ protected ItemStack createStackedBlock(int p_149644_1_) {
+ return ItemUtils.simpleMetaStack(this, p_149644_1_, 1);
+ }
+
+ public void generateTextureArray(final IIconRegister iicon) {
+ HashMap<Integer, HashMap<ForgeDirection, IIcon>> aTextures =
+ new HashMap<Integer, HashMap<ForgeDirection, IIcon>>();
+
+ // New Block for Each Meta
+ int aMeta = 0;
+ {
+ HashMap<ForgeDirection, IIcon> aTempMap = new HashMap<ForgeDirection, IIcon>();
+ aTempMap.put(ForgeDirection.UP, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.DOWN, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.NORTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.SOUTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.EAST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTempMap.put(
+ ForgeDirection.WEST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top"));
+ aTextures.put(aMeta++, aTempMap);
+ }
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ HashMap<ForgeDirection, IIcon> aTemp = getTextureArray().get(meta);
+ if (aTemp != null) {
+ IIcon aSide = aTemp.get(ForgeDirection.getOrientation(side));
+ if (aSide != null) {
+ return aSide;
+ } else {
+ // Smart calculate missing sides
+ if (side <= 1) {
+ for (int ss = 0; ss < 2; ss++) {
+ aSide = aTemp.get(ForgeDirection.getOrientation(side));
+ if (aSide != null) {
+ return aSide;
+ }
+ }
+ }
+ for (int ss = 2; ss < 6; ss++) {
+ aSide = aTemp.get(ForgeDirection.getOrientation(side));
+ if (aSide != null) {
+ return aSide;
+ }
+ }
+ }
+ }
+ return blockIcon;
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
+ ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
+ aDrops.add(ItemUtils.getSimpleStack(this));
+ return aDrops;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java b/src/main/java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java
index a4ed895b13..289b5e5c1c 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java
@@ -1,42 +1,43 @@
package gtPlusPlus.core.block.machine;
-import net.minecraft.block.material.Material;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.world.IBlockAccess;
-
import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
import gtPlusPlus.core.block.base.MetaBlock;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.world.IBlockAccess;
public class BlockGtFrameBox extends MetaBlock {
- private int[] colours;
- private int totalColours;
-
- public BlockGtFrameBox(
- final String unlocalizedName, final Material material,
- final BlockTypes blockTypeENUM, final boolean recolour, final int... colour) {
- super(unlocalizedName, material, blockTypeENUM.getBlockSoundType());
- this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame");
- this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2);
- if (recolour && ((colour != null) && (colour.length > 0))){
- this.colours = colour;
- this.totalColours = this.colours.length;
- }
- }
-
- @Override
- public int colorMultiplier(final IBlockAccess p_149720_1_, final int p_149720_2_,
- final int p_149720_3_, final int p_149720_4_) {
- for (final int i : this.colours){
-
- }
- return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_);
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
+ private int[] colours;
+ private int totalColours;
+
+ public BlockGtFrameBox(
+ final String unlocalizedName,
+ final Material material,
+ final BlockTypes blockTypeENUM,
+ final boolean recolour,
+ final int... colour) {
+ super(unlocalizedName, material, blockTypeENUM.getBlockSoundType());
+ this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame");
+ this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2);
+ if (recolour && ((colour != null) && (colour.length > 0))) {
+ this.colours = colour;
+ this.totalColours = this.colours.length;
+ }
+ }
+
+ @Override
+ public int colorMultiplier(
+ final IBlockAccess p_149720_1_, final int p_149720_2_, final int p_149720_3_, final int p_149720_4_) {
+ for (final int i : this.colours) {}
+
+ return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_);
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/CircuitProgrammer.java b/src/main/java/gtPlusPlus/core/block/machine/CircuitProgrammer.java
index 7d8b3eb708..4cc3afec22 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/CircuitProgrammer.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/CircuitProgrammer.java
@@ -23,137 +23,148 @@ import net.minecraft.world.World;
public class CircuitProgrammer extends BasicTileBlockWithTooltip {
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 4;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- @SuppressWarnings("deprecation")
- public CircuitProgrammer(){
- super(Material.iron);
- LanguageRegistry.addName(this, "Circuit Programmer");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
- if (world.isRemote) {
- return true;
- }
- else {
-
- boolean mDidScrewDriver = false;
- // Check For Screwdriver
- try {
- final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
- final Item mHandItem = mHandStack.getItem();
- if (((mHandItem instanceof GT_MetaGenerated_Tool_01)
- && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) {
- final TileEntityCircuitProgrammer tile = (TileEntityCircuitProgrammer) world.getTileEntity(x, y, z);
- if (tile != null) {
- mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z);
- }
- }
- }
- catch (final Throwable t) {}
-
- if (!mDidScrewDriver) {
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityCircuitProgrammer)){
- player.openGui(GTplusplus.instance, GuiHandler.GUI8, world, x, y, z);
- return true;
- }
- }
- else {
- return true;
- }
-
- }
- return false;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityCircuitProgrammer();
- }
-
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityCircuitProgrammer) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName());
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- @Override
- public int getMetaCount() {
- return 0;
- }
-
- @Override
- public String getUnlocalBlockName() {
- return "blockCircuitProgrammer";
- }
-
- @Override
- protected float initBlockHardness() {
- return 5f;
- }
-
- @Override
- protected float initBlockResistance() {
- return 1f;
- }
-
- @Override
- protected CreativeTabs initCreativeTab() {
- return AddToCreativeTab.tabMachines;
- }
-
- @Override
- protected String getTileEntityName() {
- return "Circuit Programmer";
- }
-
- @Override
- public CubicObject<String>[] getCustomTextureDirectoryObject() {
- String[] aTexData = new String[] {
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G",
- CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B",
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I"
- };
- CubicObject<String>[] aTextureData = new CubicObject[] {new CubicObject<String>(aTexData)};
- return aTextureData;
- }
-
-} \ No newline at end of file
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 4;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ @SuppressWarnings("deprecation")
+ public CircuitProgrammer() {
+ super(Material.iron);
+ LanguageRegistry.addName(this, "Circuit Programmer");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ } else {
+
+ boolean mDidScrewDriver = false;
+ // Check For Screwdriver
+ try {
+ final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
+ final Item mHandItem = mHandStack.getItem();
+ if (((mHandItem instanceof GT_MetaGenerated_Tool_01)
+ && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) {
+ final TileEntityCircuitProgrammer tile = (TileEntityCircuitProgrammer) world.getTileEntity(x, y, z);
+ if (tile != null) {
+ mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z);
+ }
+ }
+ } catch (final Throwable t) {
+ }
+
+ if (!mDidScrewDriver) {
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityCircuitProgrammer)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI8, world, x, y, z);
+ return true;
+ }
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityCircuitProgrammer();
+ }
+
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+
+ @Override
+ public void onBlockPlacedBy(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityLivingBase entity,
+ final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityCircuitProgrammer) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ @Override
+ public int getMetaCount() {
+ return 0;
+ }
+
+ @Override
+ public String getUnlocalBlockName() {
+ return "blockCircuitProgrammer";
+ }
+
+ @Override
+ protected float initBlockHardness() {
+ return 5f;
+ }
+
+ @Override
+ protected float initBlockResistance() {
+ return 1f;
+ }
+
+ @Override
+ protected CreativeTabs initCreativeTab() {
+ return AddToCreativeTab.tabMachines;
+ }
+
+ @Override
+ protected String getTileEntityName() {
+ return "Circuit Programmer";
+ }
+
+ @Override
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ String[] aTexData = new String[] {
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I"
+ };
+ CubicObject<String>[] aTextureData = new CubicObject[] {new CubicObject<String>(aTexData)};
+ return aTextureData;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/DecayablesChest.java b/src/main/java/gtPlusPlus/core/block/machine/DecayablesChest.java
index 15d330defc..c3c49ff03f 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/DecayablesChest.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/DecayablesChest.java
@@ -26,198 +26,195 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-public class DecayablesChest extends BlockContainer implements ITileTooltip
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 5;
- public final int field_149956_a = 0;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- @SuppressWarnings("deprecation")
- public DecayablesChest()
- {
- super(Material.iron);
- this.setBlockName("blockDecayablesChest");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setHardness(5f);
- this.setResistance(1f);
- GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockDecayablesChest");
- LanguageRegistry.addName(this, "Lead Lined Box");
- this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
-
- }
-
- /**
- * 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.
- */
- public boolean isOpaqueCube()
- {
- return false;
- }
-
- /**
- * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
- */
- public boolean renderAsNormalBlock()
- {
- return false;
- }
-
- /**
- * The type of render function that is called for this block
- */
- @SideOnly(Side.CLIENT)
- public int getRenderType(){
- try {
- if (RenderDecayChest.INSTANCE != null){
- return RenderDecayChest.INSTANCE.mRenderID;
- }
- return super.getRenderType();
- }
- catch (NullPointerException n) {
- return 0;
- }
- }
-
- /**
- * Updates the blocks bounds based on its current state. Args: world, x, y, z
- */
- public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
- {
- if (p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ - 1) == this)
- {
- this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F);
- }
- else if (p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ + 1) == this)
- {
- this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F);
- }
- else if (p_149719_1_.getBlock(p_149719_2_ - 1, p_149719_3_, p_149719_4_) == this)
- {
- this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
- }
- else if (p_149719_1_.getBlock(p_149719_2_ + 1, p_149719_3_, p_149719_4_) == this)
- {
- this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F);
- }
- else
- {
- this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
- }
- }
-
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : this.textureFront);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "DecayablesChest_top");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "DecayablesChest_top");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "DecayablesChest_side");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "DecayablesChest_bottom");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityDecayablesChest)){
- player.openGui(GTplusplus.instance, GuiHandler.GUI13, world, x, y, z);
- return true;
- }
- return false;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityDecayablesChest();
- }
-
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) {
- InventoryUtils.dropInventoryItems(world, x, y, z, block);
- super.breakBlock(world, x, y, z, block, number);
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityDecayablesChest) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName());
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- /*@Override
- public void breakBlock(World world, BlockPos pos, IBlockState blockstate) {
- TileEntityFishTrap te = (TileEntityFishTrap) world.getTileEntity(pos);
- InventoryHelper.dropInventoryItems(world, pos, te);
- super.breakBlock(world, pos, blockstate);
- }
-
-
- @Override
- public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityFishTrap) worldIn.getTileEntity(pos)).setCustomName(stack.getDisplayName());
- }
- }*/
-
- /**
- * Update Chest Meta - Stub
- * @param aWorld
- * @param xPos
- * @param yPos
- * @param zPos
- */
- @Deprecated
- public void func_149954_e(World aWorld, int xPos, int yPos, int zPos)
- {
-
- }
-
-} \ No newline at end of file
+public class DecayablesChest extends BlockContainer implements ITileTooltip {
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 5;
+
+ public final int field_149956_a = 0;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ @SuppressWarnings("deprecation")
+ public DecayablesChest() {
+ super(Material.iron);
+ this.setBlockName("blockDecayablesChest");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setHardness(5f);
+ this.setResistance(1f);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockDecayablesChest");
+ LanguageRegistry.addName(this, "Lead Lined Box");
+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
+ }
+
+ /**
+ * 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.
+ */
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ /**
+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
+ */
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ /**
+ * The type of render function that is called for this block
+ */
+ @SideOnly(Side.CLIENT)
+ public int getRenderType() {
+ try {
+ if (RenderDecayChest.INSTANCE != null) {
+ return RenderDecayChest.INSTANCE.mRenderID;
+ }
+ return super.getRenderType();
+ } catch (NullPointerException n) {
+ return 0;
+ }
+ }
+
+ /**
+ * Updates the blocks bounds based on its current state. Args: world, x, y, z
+ */
+ public void setBlockBoundsBasedOnState(
+ IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) {
+ if (p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ - 1) == this) {
+ this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F);
+ } else if (p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ + 1) == this) {
+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F);
+ } else if (p_149719_1_.getBlock(p_149719_2_ - 1, p_149719_3_, p_149719_4_) == this) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
+ } else if (p_149719_1_.getBlock(p_149719_2_ + 1, p_149719_3_, p_149719_4_) == this) {
+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F);
+ } else {
+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
+ }
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : this.textureFront);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "DecayablesChest_top");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "DecayablesChest_top");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "DecayablesChest_side");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "DecayablesChest_bottom");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ }
+
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityDecayablesChest)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI13, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityDecayablesChest();
+ }
+
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+
+ @Override
+ public void breakBlock(
+ final World world, final int x, final int y, final int z, final Block block, final int number) {
+ InventoryUtils.dropInventoryItems(world, x, y, z, block);
+ super.breakBlock(world, x, y, z, block, number);
+ }
+
+ @Override
+ public void onBlockPlacedBy(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityLivingBase entity,
+ final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityDecayablesChest) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ /*@Override
+ public void breakBlock(World world, BlockPos pos, IBlockState blockstate) {
+ TileEntityFishTrap te = (TileEntityFishTrap) world.getTileEntity(pos);
+ InventoryHelper.dropInventoryItems(world, pos, te);
+ super.breakBlock(world, pos, blockstate);
+ }
+
+
+ @Override
+ public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityFishTrap) worldIn.getTileEntity(pos)).setCustomName(stack.getDisplayName());
+ }
+ }*/
+
+ /**
+ * Update Chest Meta - Stub
+ * @param aWorld
+ * @param xPos
+ * @param yPos
+ * @param zPos
+ */
+ @Deprecated
+ public void func_149954_e(World aWorld, int xPos, int yPos, int zPos) {}
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/EggBox.java b/src/main/java/gtPlusPlus/core/block/machine/EggBox.java
index 630c4b5bc2..2950eeae98 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/EggBox.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/EggBox.java
@@ -25,151 +25,161 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-public class EggBox extends BlockContainer implements ITileTooltip
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 7;
- public final int field_149956_a = 0;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- @SuppressWarnings("deprecation")
- public EggBox(){
- super(Material.wood);
- this.setBlockName("blockEggBox");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setHardness(5f);
- this.setResistance(1f);
- GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockEggBox");
- LanguageRegistry.addName(this, "Egg Box");
-
- }
-
- /**
- * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
- */
- public boolean renderAsNormalBlock()
- {
- return true;
- }
-
- /**
- * The type of render function that is called for this block
- */
- @SideOnly(Side.CLIENT)
- public int getRenderType(){
- return super.getRenderType();
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : this.textureFront;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "EggBox_top");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "EggBox_top");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "EggBox_side");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "EggBox_side");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityEggBox)){
- player.openGui(GTplusplus.instance, GuiHandler.GUI17, world, x, y, z);
- return true;
- }
- return false;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 0;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityEggBox();
- }
-
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) {
- InventoryUtils.dropInventoryItems(world, x, y, z, block);
- super.breakBlock(world, x, y, z, block, number);
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityEggBox) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName());
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- /*@Override
- public void breakBlock(World world, BlockPos pos, IBlockState blockstate) {
- TileEntityFishTrap te = (TileEntityFishTrap) world.getTileEntity(pos);
- InventoryHelper.dropInventoryItems(world, pos, te);
- super.breakBlock(world, pos, blockstate);
- }
-
-
- @Override
- public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityFishTrap) worldIn.getTileEntity(pos)).setCustomName(stack.getDisplayName());
- }
- }*/
-
- /**
- * Update Chest Meta - Stub
- * @param aWorld
- * @param xPos
- * @param yPos
- * @param zPos
- */
- @Deprecated
- public void func_149954_e(World aWorld, int xPos, int yPos, int zPos)
- {
-
- }
-
-} \ No newline at end of file
+public class EggBox extends BlockContainer implements ITileTooltip {
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 7;
+
+ public final int field_149956_a = 0;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ @SuppressWarnings("deprecation")
+ public EggBox() {
+ super(Material.wood);
+ this.setBlockName("blockEggBox");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setHardness(5f);
+ this.setResistance(1f);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockEggBox");
+ LanguageRegistry.addName(this, "Egg Box");
+ }
+
+ /**
+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
+ */
+ public boolean renderAsNormalBlock() {
+ return true;
+ }
+
+ /**
+ * The type of render function that is called for this block
+ */
+ @SideOnly(Side.CLIENT)
+ public int getRenderType() {
+ return super.getRenderType();
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 1 ? this.textureTop : this.textureFront;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "EggBox_top");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "EggBox_top");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "EggBox_side");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "EggBox_side");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ }
+
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityEggBox)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI17, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityEggBox();
+ }
+
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+
+ @Override
+ public void breakBlock(
+ final World world, final int x, final int y, final int z, final Block block, final int number) {
+ InventoryUtils.dropInventoryItems(world, x, y, z, block);
+ super.breakBlock(world, x, y, z, block, number);
+ }
+
+ @Override
+ public void onBlockPlacedBy(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityLivingBase entity,
+ final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityEggBox) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ /*@Override
+ public void breakBlock(World world, BlockPos pos, IBlockState blockstate) {
+ TileEntityFishTrap te = (TileEntityFishTrap) world.getTileEntity(pos);
+ InventoryHelper.dropInventoryItems(world, pos, te);
+ super.breakBlock(world, pos, blockstate);
+ }
+
+
+ @Override
+ public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityFishTrap) worldIn.getTileEntity(pos)).setCustomName(stack.getDisplayName());
+ }
+ }*/
+
+ /**
+ * Update Chest Meta - Stub
+ * @param aWorld
+ * @param xPos
+ * @param yPos
+ * @param zPos
+ */
+ @Deprecated
+ public void func_149954_e(World aWorld, int xPos, int yPos, int zPos) {}
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/FishTrap.java b/src/main/java/gtPlusPlus/core/block/machine/FishTrap.java
index 037ec61ced..0975b71ace 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/FishTrap.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/FishTrap.java
@@ -4,7 +4,13 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
+import gtPlusPlus.core.util.minecraft.InventoryUtils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -18,135 +24,144 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
-import gtPlusPlus.core.util.minecraft.InventoryUtils;
-
-public class FishTrap extends BlockContainer implements ITileTooltip
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 0;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- @SuppressWarnings("deprecation")
- public FishTrap()
- {
- super(Material.iron);
- this.setBlockName("blockFishTrap");
- this.setHardness(5f);
- this.setResistance(1f);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockFishTrap");
- LanguageRegistry.addName(this, "Fish Catcher");
-
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityFishTrap)){
- player.openGui(GTplusplus.instance, 5, world, x, y, z);
- return true;
- }
- return false;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityFishTrap();
- }
-
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) {
- InventoryUtils.dropInventoryItems(world, x, y, z, block);
- super.breakBlock(world, x, y, z, block, number);
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityFishTrap) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName());
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- /*@Override
- public void breakBlock(World world, BlockPos pos, IBlockState blockstate) {
- TileEntityFishTrap te = (TileEntityFishTrap) world.getTileEntity(pos);
- InventoryHelper.dropInventoryItems(world, pos, te);
- super.breakBlock(world, pos, blockstate);
- }
-
-
- @Override
- public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityFishTrap) worldIn.getTileEntity(pos)).setCustomName(stack.getDisplayName());
- }
- }*/
-
-} \ No newline at end of file
+public class FishTrap extends BlockContainer implements ITileTooltip {
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 0;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ @SuppressWarnings("deprecation")
+ public FishTrap() {
+ super(Material.iron);
+ this.setBlockName("blockFishTrap");
+ this.setHardness(5f);
+ this.setResistance(1f);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockFishTrap");
+ LanguageRegistry.addName(this, "Fish Catcher");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 1
+ ? this.textureTop
+ : (p_149691_1_ == 0
+ ? this.textureBottom
+ : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ }
+
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityFishTrap)) {
+ player.openGui(GTplusplus.instance, 5, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityFishTrap();
+ }
+
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+
+ @Override
+ public void breakBlock(
+ final World world, final int x, final int y, final int z, final Block block, final int number) {
+ InventoryUtils.dropInventoryItems(world, x, y, z, block);
+ super.breakBlock(world, x, y, z, block, number);
+ }
+
+ @Override
+ public void onBlockPlacedBy(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityLivingBase entity,
+ final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityFishTrap) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ /*@Override
+ public void breakBlock(World world, BlockPos pos, IBlockState blockstate) {
+ TileEntityFishTrap te = (TileEntityFishTrap) world.getTileEntity(pos);
+ InventoryHelper.dropInventoryItems(world, pos, te);
+ super.breakBlock(world, pos, blockstate);
+ }
+
+
+ @Override
+ public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityFishTrap) worldIn.getTileEntity(pos)).setCustomName(stack.getDisplayName());
+ }
+ }*/
+
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java b/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java
index 5dc8604a93..4c7668b9e0 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java
@@ -4,7 +4,10 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -13,83 +16,85 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator;
-
-public class HeliumGenerator extends BlockContainer
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
+public class HeliumGenerator extends BlockContainer {
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
- @SuppressWarnings("deprecation")
- public HeliumGenerator()
- {
- super(Material.wood);
- this.setBlockName("blockHeliumGenerator");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, "blockHeliumGenerator");
- LanguageRegistry.addName(this, "Helium Generator");
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
- }
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
- }
+ @SuppressWarnings("deprecation")
+ public HeliumGenerator() {
+ super(Material.wood);
+ this.setBlockName("blockHeliumGenerator");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, "blockHeliumGenerator");
+ LanguageRegistry.addName(this, "Helium Generator");
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "Chrono/" + "CyberPanel");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "Chrono/" + "CyberPanel");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "Chrono/" + "CyberPanel");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "Chrono/" + "CyberPanel");
- }
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 1
+ ? this.textureTop
+ : (p_149691_1_ == 0
+ ? this.textureBottom
+ : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
+ }
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
- if (world.isRemote) {
- return true;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "Chrono/" + "CyberPanel");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "Chrono/" + "CyberPanel");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "Chrono/" + "CyberPanel");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "Chrono/" + "CyberPanel");
+ }
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityHeliumGenerator)){ //TODO
- player.openGui(GTplusplus.instance, 1, world, x, y, z); //TODO
- return true;
- }
- return false;
- }
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ }
- @Override
- public int getRenderBlockPass() {
- return 1;
- }
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityHeliumGenerator)) { // TODO
+ player.openGui(GTplusplus.instance, 1, world, x, y, z); // TODO
+ return true;
+ }
+ return false;
+ }
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
+ @Override
+ public int getRenderBlockPass() {
+ return 1;
+ }
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityHeliumGenerator();
- }
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
-} \ No newline at end of file
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityHeliumGenerator();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java
index 6f60d39ce7..124860cb27 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java
@@ -4,7 +4,13 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -15,89 +21,91 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
-
-public class Machine_ModularityTable extends BlockContainer implements ITileTooltip
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
+public class Machine_ModularityTable extends BlockContainer implements ITileTooltip {
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 1;
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
- @SuppressWarnings("deprecation")
- public Machine_ModularityTable()
- {
- super(Material.iron);
- this.setBlockName("blockModularity");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockModularity");
- LanguageRegistry.addName(this, "Modularity Configurator");
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 1;
- }
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
- }
+ @SuppressWarnings("deprecation")
+ public Machine_ModularityTable() {
+ super(Material.iron);
+ this.setBlockName("blockModularity");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockModularity");
+ LanguageRegistry.addName(this, "Modularity Configurator");
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "ModularTable_side");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "ModularTable_top");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "ModularTable_output");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "ModularTable_side");
- }
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 1
+ ? this.textureTop
+ : (p_149691_1_ == 0
+ ? this.textureBottom
+ : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
+ }
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz){
- if (world.isRemote) {
- return true;
- }
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityModularityTable)){
- player.openGui(GTplusplus.instance, 1, world, x, y, z);
- Logger.INFO("Player opened GUI");
- return true;
- }
- return false;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "ModularTable_side");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "ModularTable_top");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "ModularTable_output");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "ModularTable_side");
+ }
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityModularityTable();
- }
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ }
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityModularityTable)) {
+ player.openGui(GTplusplus.instance, 1, world, x, y, z);
+ Logger.INFO("Player opened GUI");
+ return true;
+ }
+ return false;
+ }
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityModularityTable();
+ }
-} \ No newline at end of file
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_PestKiller.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_PestKiller.java
index 11fa80f439..96fe4e20b1 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_PestKiller.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_PestKiller.java
@@ -6,7 +6,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.handler.GuiHandler;
import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
@@ -26,112 +25,126 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-public class Machine_PestKiller extends BlockContainer implements ITileTooltip
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 6;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- @SuppressWarnings("deprecation")
- public Machine_PestKiller()
- {
- super(Material.wood);
- this.setBlockName("blockPestKiller");
- this.setHardness(5f);
- this.setResistance(1f);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockPestKiller");
- LanguageRegistry.addName(this, "Pest Killer");
-
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int aSide, final int p_149691_2_)
- {
- return aSide == 1 ? this.textureTop : (aSide == 0 ? this.textureBottom : this.textureFront);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "MACHINE_CASING_FARM_MANAGER_STRUCTURAL");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "MACHINE_PESTKILLER_TOP");
- this.textureBottom = p_149651_1_.registerIcon("planks_acacia");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "MACHINE_CASING_FARM_MANAGER_STRUCTURAL");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityPestKiller)){
- player.openGui(GTplusplus.instance, GuiHandler.GUI15, world, x, y, z);
- return true;
- }
- return false;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 0;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityPestKiller();
- }
-
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) {
- InventoryUtils.dropInventoryItems(world, x, y, z, block);
- super.breakBlock(world, x, y, z, block, number);
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityPestKiller) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName());
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
-} \ No newline at end of file
+public class Machine_PestKiller extends BlockContainer implements ITileTooltip {
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 6;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ @SuppressWarnings("deprecation")
+ public Machine_PestKiller() {
+ super(Material.wood);
+ this.setBlockName("blockPestKiller");
+ this.setHardness(5f);
+ this.setResistance(1f);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockPestKiller");
+ LanguageRegistry.addName(this, "Pest Killer");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int aSide, final int p_149691_2_) {
+ return aSide == 1 ? this.textureTop : (aSide == 0 ? this.textureBottom : this.textureFront);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon =
+ p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "MACHINE_CASING_FARM_MANAGER_STRUCTURAL");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "MACHINE_PESTKILLER_TOP");
+ this.textureBottom = p_149651_1_.registerIcon("planks_acacia");
+ this.textureFront =
+ p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "MACHINE_CASING_FARM_MANAGER_STRUCTURAL");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ }
+
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityPestKiller)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI15, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityPestKiller();
+ }
+
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+
+ @Override
+ public void breakBlock(
+ final World world, final int x, final int y, final int z, final Block block, final int number) {
+ InventoryUtils.dropInventoryItems(world, x, y, z, block);
+ super.breakBlock(world, x, y, z, block, number);
+ }
+
+ @Override
+ public void onBlockPlacedBy(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityLivingBase entity,
+ final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityPestKiller) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_PooCollector.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_PooCollector.java
index 945cf7b581..374694ff48 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_PooCollector.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_PooCollector.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.block.machine;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -14,6 +11,8 @@ import gtPlusPlus.core.tileentities.machines.TileEntityBaseFluidCollector;
import gtPlusPlus.core.tileentities.machines.TileEntityPooCollector;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.List;
+import java.util.Random;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -27,156 +26,166 @@ import net.minecraft.world.World;
public class Machine_PooCollector extends BlockContainer {
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureTop2;
- @SideOnly(Side.CLIENT)
- private IIcon textureSide;
- @SideOnly(Side.CLIENT)
- private IIcon textureSide2;
-
- public Machine_PooCollector() {
- super(Material.iron);
- this.setHardness(5f);
- this.setResistance(1f);
- this.setBlockName("blockPooCollector");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockMeta.class,"blockPooCollector");
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int aSide, final int aMeta) {
- if (aMeta <= 7) {
- blockIcon = textureSide;
- return aSide <= 1 ? this.textureTop : this.textureSide;
- }
- else {
- blockIcon = textureSide2;
- return aSide <= 1 ? this.textureTop2 : this.textureSide2;
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "sewer_top");
- this.textureTop2 = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "sewer_adv_top");
- this.textureSide = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "sewer_sides");
- this.textureSide2 = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "sewer_adv_sides");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int side, final float lx, final float ly, final float lz) {
- if (world.isRemote) {
- return true;
- } else {
- TileEntityBaseFluidCollector tank = (TileEntityBaseFluidCollector) world.getTileEntity(x, y, z);
- if (tank != null) {
- Item handItem;
- try {
- handItem = player.getHeldItem().getItem();
- } catch (Throwable t) {
- handItem = null;
- }
-
- //Fluid container code
- /*if (handItem != null
- && (handItem instanceof IFluidContainerItem || handItem instanceof ItemFluidContainer
- || FluidContainerRegistry.isFilledContainer(player.getHeldItem()))) {
- if (tank.tank.getFluid() == null) {
- try {
- if (!FluidContainerRegistry.isFilledContainer(player.getHeldItem())) {
- ItemStack handItemStack = player.getHeldItem();
- IFluidContainerItem container = (IFluidContainerItem) handItem;
- FluidStack containerFluid = container.getFluid(handItemStack);
- container.drain(handItemStack, container.getFluid(handItemStack).amount, true);
- tank.tank.setFluid(containerFluid);
- } else {
- ItemStack handItemStack = player.getHeldItem();
- FluidContainerRegistry.drainFluidContainer(handItemStack);
- FluidStack containerFluid = FluidContainerRegistry.getFluidForFilledItem(handItemStack);
- ItemStack emptyContainer = FluidContainerRegistry.drainFluidContainer(handItemStack);
- player.setItemInUse(emptyContainer, 0);
-
- tank.tank.setFluid(containerFluid);
- }
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- }*/
-
- if (!tank.mInventory.isEmpty()) {
- PlayerUtils.messagePlayer(player, "Inventory contains:");
- PlayerUtils.messagePlayer(player, ItemUtils.getArrayStackNames(tank.mInventory.getRealInventory()));
- }
- else {
- PlayerUtils.messagePlayer(player, "No solids collected yet.");
- }
- if (tank.tank.getFluid() != null) {
- PlayerUtils.messagePlayer(player, "Tank contains " + tank.tank.getFluidAmount() + "L of "
- + tank.tank.getFluid().getLocalizedName());
- }
- }
- }
- return true;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 0;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return super.isOpaqueCube();
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int aMeta) {
- return aMeta <= 7 ? new TileEntityPooCollector() : new TileEntityAdvPooCollector();
- }
-
- @Override
- public void onBlockAdded(World world, int x, int y, int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public int getBlockColor() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public int damageDropped(final int damage) {
- return damage;
- }
-
- @Override
- public Item getItemDropped(final int meta, final Random rand, final int fortune) {
- return Item.getItemFromBlock(this);
- }
-
- @Override
- public int getRenderColor(int aMeta) {
- return super.getRenderColor(aMeta);
- }
-
- @Override
- public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
- aList.add(new ItemStack(aItem, 1, 0));
- aList.add(new ItemStack(aItem, 1, 8));
- }
-
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop2;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureSide;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureSide2;
+
+ public Machine_PooCollector() {
+ super(Material.iron);
+ this.setHardness(5f);
+ this.setResistance(1f);
+ this.setBlockName("blockPooCollector");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockPooCollector");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int aSide, final int aMeta) {
+ if (aMeta <= 7) {
+ blockIcon = textureSide;
+ return aSide <= 1 ? this.textureTop : this.textureSide;
+ } else {
+ blockIcon = textureSide2;
+ return aSide <= 1 ? this.textureTop2 : this.textureSide2;
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "sewer_top");
+ this.textureTop2 = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "sewer_adv_top");
+ this.textureSide = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "sewer_sides");
+ this.textureSide2 = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "sewer_adv_sides");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ } else {
+ TileEntityBaseFluidCollector tank = (TileEntityBaseFluidCollector) world.getTileEntity(x, y, z);
+ if (tank != null) {
+ Item handItem;
+ try {
+ handItem = player.getHeldItem().getItem();
+ } catch (Throwable t) {
+ handItem = null;
+ }
+
+ // Fluid container code
+ /*if (handItem != null
+ && (handItem instanceof IFluidContainerItem || handItem instanceof ItemFluidContainer
+ || FluidContainerRegistry.isFilledContainer(player.getHeldItem()))) {
+ if (tank.tank.getFluid() == null) {
+ try {
+ if (!FluidContainerRegistry.isFilledContainer(player.getHeldItem())) {
+ ItemStack handItemStack = player.getHeldItem();
+ IFluidContainerItem container = (IFluidContainerItem) handItem;
+ FluidStack containerFluid = container.getFluid(handItemStack);
+ container.drain(handItemStack, container.getFluid(handItemStack).amount, true);
+ tank.tank.setFluid(containerFluid);
+ } else {
+ ItemStack handItemStack = player.getHeldItem();
+ FluidContainerRegistry.drainFluidContainer(handItemStack);
+ FluidStack containerFluid = FluidContainerRegistry.getFluidForFilledItem(handItemStack);
+ ItemStack emptyContainer = FluidContainerRegistry.drainFluidContainer(handItemStack);
+ player.setItemInUse(emptyContainer, 0);
+
+ tank.tank.setFluid(containerFluid);
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ }*/
+
+ if (!tank.mInventory.isEmpty()) {
+ PlayerUtils.messagePlayer(player, "Inventory contains:");
+ PlayerUtils.messagePlayer(player, ItemUtils.getArrayStackNames(tank.mInventory.getRealInventory()));
+ } else {
+ PlayerUtils.messagePlayer(player, "No solids collected yet.");
+ }
+ if (tank.tank.getFluid() != null) {
+ PlayerUtils.messagePlayer(
+ player,
+ "Tank contains " + tank.tank.getFluidAmount() + "L of "
+ + tank.tank.getFluid().getLocalizedName());
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return super.isOpaqueCube();
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int aMeta) {
+ return aMeta <= 7 ? new TileEntityPooCollector() : new TileEntityAdvPooCollector();
+ }
+
+ @Override
+ public void onBlockAdded(World world, int x, int y, int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+
+ @Override
+ public int getBlockColor() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int damageDropped(final int damage) {
+ return damage;
+ }
+
+ @Override
+ public Item getItemDropped(final int meta, final Random rand, final int fortune) {
+ return Item.getItemFromBlock(this);
+ }
+
+ @Override
+ public int getRenderColor(int aMeta) {
+ return super.getRenderColor(aMeta);
+ }
+
+ @Override
+ public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
+ aList.add(new ItemStack(aItem, 1, 0));
+ aList.add(new ItemStack(aItem, 1, 8));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java
index fdb6b1a0a8..1959c20f70 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java
@@ -5,18 +5,6 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.interfaces.ITileTooltip;
import gtPlusPlus.api.objects.Logger;
@@ -28,137 +16,155 @@ import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import ic2.core.item.tool.ItemToolWrench;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
@Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO")
-public class Machine_ProjectTable extends BlockContainer implements ITileTooltip
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 3;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- @SuppressWarnings("deprecation")
- public Machine_ProjectTable()
- {
- super(Material.iron);
- this.setBlockName("blockProjectBench");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockProjectBench");
- LanguageRegistry.addName(this, "Project Workbench");
-
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "cover_crafting");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
-
- ItemStack heldItem = null;
- if (world.isRemote){
- heldItem = PlayerUtils.getItemStackInPlayersHand();
- }
-
- boolean holdingWrench = false;
-
- if (heldItem != null){
- holdingWrench = isWrench(heldItem);
- }
-
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityProjectTable))
- {
- if (!holdingWrench){
- player.openGui(GTplusplus.instance, 0, world, x, y, z);
- return true;
- }
- Logger.INFO("Holding a Wrench, doing wrench things instead.");
- }
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityProjectTable();
- }
-
- public static boolean isWrench(final ItemStack item){
- if (item.getItem() instanceof ItemToolWrench){
- return true;
- }
- if (LoadedMods.BuildCraft){
- return checkBuildcraftWrench(item);
- }
- if (LoadedMods.EnderIO){
- return checkEnderIOWrench(item);
- }
- return false;
- }
-
- @Optional.Method(modid = "EnderIO")
- private static boolean checkEnderIOWrench(final ItemStack item) {
- if (ReflectionUtils.doesClassExist("crazypants.enderio.api.tool.ITool")) {
- Class<?> wrenchClass;
- wrenchClass = ReflectionUtils.getClass("crazypants.enderio.api.tool.ITool");
- if (wrenchClass.isInstance(item.getItem())) {
- return true;
- }
- }
- return false;
- }
-
- @Optional.Method(modid = "Buildcraft")
- private static boolean checkBuildcraftWrench(final ItemStack item) {
- if (ReflectionUtils.doesClassExist("buildcraft.api.tools.IToolWrench")) {
- Class<?> wrenchClass;
- wrenchClass = ReflectionUtils.getClass("buildcraft.api.tools.IToolWrench");
- if (wrenchClass.isInstance(item.getItem())) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
-} \ No newline at end of file
+public class Machine_ProjectTable extends BlockContainer implements ITileTooltip {
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 3;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ @SuppressWarnings("deprecation")
+ public Machine_ProjectTable() {
+ super(Material.iron);
+ this.setBlockName("blockProjectBench");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockProjectBench");
+ LanguageRegistry.addName(this, "Project Workbench");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return p_149691_1_ == 1
+ ? this.textureTop
+ : (p_149691_1_ == 0
+ ? this.textureBottom
+ : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "cover_crafting");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+
+ ItemStack heldItem = null;
+ if (world.isRemote) {
+ heldItem = PlayerUtils.getItemStackInPlayersHand();
+ }
+
+ boolean holdingWrench = false;
+
+ if (heldItem != null) {
+ holdingWrench = isWrench(heldItem);
+ }
+
+ if (world.isRemote) {
+ return true;
+ }
+
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityProjectTable)) {
+ if (!holdingWrench) {
+ player.openGui(GTplusplus.instance, 0, world, x, y, z);
+ return true;
+ }
+ Logger.INFO("Holding a Wrench, doing wrench things instead.");
+ }
+ return false;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityProjectTable();
+ }
+
+ public static boolean isWrench(final ItemStack item) {
+ if (item.getItem() instanceof ItemToolWrench) {
+ return true;
+ }
+ if (LoadedMods.BuildCraft) {
+ return checkBuildcraftWrench(item);
+ }
+ if (LoadedMods.EnderIO) {
+ return checkEnderIOWrench(item);
+ }
+ return false;
+ }
+
+ @Optional.Method(modid = "EnderIO")
+ private static boolean checkEnderIOWrench(final ItemStack item) {
+ if (ReflectionUtils.doesClassExist("crazypants.enderio.api.tool.ITool")) {
+ Class<?> wrenchClass;
+ wrenchClass = ReflectionUtils.getClass("crazypants.enderio.api.tool.ITool");
+ if (wrenchClass.isInstance(item.getItem())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Optional.Method(modid = "Buildcraft")
+ private static boolean checkBuildcraftWrench(final ItemStack item) {
+ if (ReflectionUtils.doesClassExist("buildcraft.api.tools.IToolWrench")) {
+ Class<?> wrenchClass;
+ wrenchClass = ReflectionUtils.getClass("buildcraft.api.tools.IToolWrench");
+ if (wrenchClass.isInstance(item.getItem())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java
index dc87b885b9..caf961f91f 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java
@@ -18,114 +18,119 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class Machine_RoundRobinator extends BasicTileBlockWithTooltip {
-
-
- public Machine_RoundRobinator(){
- super(Material.iron);
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
- if (world.isRemote) {
- return true;
- }
- else {
-
- boolean mDidScrewDriver = false;
- // Check For Screwdriver
- try {
- final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
- if (ItemUtils.isToolScrewdriver(mHandStack)) {
- final TileEntityRoundRobinator tile = (TileEntityRoundRobinator) world.getTileEntity(x, y, z);
- if (tile != null) {
- mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z);
- }
- }
- }
- catch (final Throwable t) {}
-
- if (!mDidScrewDriver) {
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityRoundRobinator)){
- return ((TileEntityRoundRobinator) te).onRightClick((byte) side, player, x, y, z);
- }
- return false;
- }
- else {
- return true;
- }
- }
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityRoundRobinator();
- }
-
- @Override
- public int getMetaCount() {
- return 5;
- }
-
- @Override
- public String getUnlocalBlockName() {
- return "blockRoundRobinator";
- }
-
- @Override
- protected float initBlockHardness() {
- return 1;
- }
-
- @Override
- protected float initBlockResistance() {
- return 1;
- }
-
- @Override
- protected CreativeTabs initCreativeTab() {
- return AddToCreativeTab.tabMachines;
- }
-
- @Override
- public int getTooltipID() {
- return -1;
- }
-
- @Override
- protected String getTileEntityName() {
- return "Round Robinator";
- }
-
- @Override
- public Class<? extends ItemBlock> getItemBlockClass() {
- return ItemBlockRoundRobinator.class;
- }
-
- @Override
- public CubicObject<String>[] getCustomTextureDirectoryObject() {
- AutoMap<String[]> aTemp = new AutoMap<String[]>();
- for (int i=0;i<5;i++) {
- String[] aTexData = new String[] {
- CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i,
- CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i,
- CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i,
- CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i,
- CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i,
- CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i,
- };
- aTemp.put(aTexData);
- }
- AutoMap<CubicObject<String>> aTemp2 = new AutoMap<CubicObject<String>>();
- for (String[] y : aTemp) {
- aTemp2.put(new CubicObject<String>(y));
- }
- CubicObject<String>[] aTextureData = new CubicObject[] {aTemp2.get(0), aTemp2.get(1), aTemp2.get(2), aTemp2.get(3), aTemp2.get(4)};
- return aTextureData;
- }
-
-} \ No newline at end of file
+
+ public Machine_RoundRobinator() {
+ super(Material.iron);
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ } else {
+
+ boolean mDidScrewDriver = false;
+ // Check For Screwdriver
+ try {
+ final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
+ if (ItemUtils.isToolScrewdriver(mHandStack)) {
+ final TileEntityRoundRobinator tile = (TileEntityRoundRobinator) world.getTileEntity(x, y, z);
+ if (tile != null) {
+ mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z);
+ }
+ }
+ } catch (final Throwable t) {
+ }
+
+ if (!mDidScrewDriver) {
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityRoundRobinator)) {
+ return ((TileEntityRoundRobinator) te).onRightClick((byte) side, player, x, y, z);
+ }
+ return false;
+ } else {
+ return true;
+ }
+ }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityRoundRobinator();
+ }
+
+ @Override
+ public int getMetaCount() {
+ return 5;
+ }
+
+ @Override
+ public String getUnlocalBlockName() {
+ return "blockRoundRobinator";
+ }
+
+ @Override
+ protected float initBlockHardness() {
+ return 1;
+ }
+
+ @Override
+ protected float initBlockResistance() {
+ return 1;
+ }
+
+ @Override
+ protected CreativeTabs initCreativeTab() {
+ return AddToCreativeTab.tabMachines;
+ }
+
+ @Override
+ public int getTooltipID() {
+ return -1;
+ }
+
+ @Override
+ protected String getTileEntityName() {
+ return "Round Robinator";
+ }
+
+ @Override
+ public Class<? extends ItemBlock> getItemBlockClass() {
+ return ItemBlockRoundRobinator.class;
+ }
+
+ @Override
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ AutoMap<String[]> aTemp = new AutoMap<String[]>();
+ for (int i = 0; i < 5; i++) {
+ String[] aTexData = new String[] {
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_" + i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_" + i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_" + i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_" + i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_" + i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_" + i,
+ };
+ aTemp.put(aTexData);
+ }
+ AutoMap<CubicObject<String>> aTemp2 = new AutoMap<CubicObject<String>>();
+ for (String[] y : aTemp) {
+ aTemp2.put(new CubicObject<String>(y));
+ }
+ CubicObject<String>[] aTextureData =
+ new CubicObject[] {aTemp2.get(0), aTemp2.get(1), aTemp2.get(2), aTemp2.get(3), aTemp2.get(4)};
+ return aTextureData;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java
index 021279f820..cbf8323c07 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java
@@ -26,50 +26,55 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-public class Machine_SuperJukebox extends BlockJukebox
-{
- @SideOnly(Side.CLIENT)
- private IIcon mIcon;
-
- public Machine_SuperJukebox(){
- this.setBlockName("blockSuperJukebox");
- this.setCreativeTab(CreativeTabs.tabRedstone);
- setHardness(2.0F);
- setResistance(10.0F);
- setStepSound(soundTypePiston);
- setBlockTextureName("jukebox");
- GameRegistry.registerBlock(this, "blockSuperJukebox");
- LanguageRegistry.addName(this, "Sir Mixalot [Jukebox]");
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int aSide, int aMeta)
- {
- return aSide == 1 ? this.mIcon : this.blockIcon;
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntitySuperJukebox)){
- player.openGui(GTplusplus.instance, GuiHandler.GUI14, world, x, y, z);
- return true;
- }
- return false;
-
-
- /* if (aWorld.getBlockMetadata(aX, aY, aZ) == 0)
+public class Machine_SuperJukebox extends BlockJukebox {
+ @SideOnly(Side.CLIENT)
+ private IIcon mIcon;
+
+ public Machine_SuperJukebox() {
+ this.setBlockName("blockSuperJukebox");
+ this.setCreativeTab(CreativeTabs.tabRedstone);
+ setHardness(2.0F);
+ setResistance(10.0F);
+ setStepSound(soundTypePiston);
+ setBlockTextureName("jukebox");
+ GameRegistry.registerBlock(this, "blockSuperJukebox");
+ LanguageRegistry.addName(this, "Sir Mixalot [Jukebox]");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(int aSide, int aMeta) {
+ return aSide == 1 ? this.mIcon : this.blockIcon;
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ }
+
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntitySuperJukebox)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI14, world, x, y, z);
+ return true;
+ }
+ return false;
+
+ /* if (aWorld.getBlockMetadata(aX, aY, aZ) == 0)
{
return false;
}
@@ -78,502 +83,472 @@ public class Machine_SuperJukebox extends BlockJukebox
this.func_149925_e(aWorld, aX, aY, aZ);
return true;
}*/
- }
-
- /**
- * Set the record in the {@link SuperJukebox} {@link TileEntity}.
- */
- @Override
- public final void func_149926_b(World aWorld, int aX, int aY, int aZ, ItemStack aStackToSet) {
- setRecordInJukeBox(aWorld, aX, aY, aZ, aStackToSet);
- }
-
- public void setRecordInJukeBox(World aWorld, int aX, int aY, int aZ, ItemStack aStackToSet) {
- if (!aWorld.isRemote) {
- TileEntitySuperJukebox tileentityjukebox = (TileEntitySuperJukebox) aWorld.getTileEntity(aX, aY, aZ);
- if (tileentityjukebox != null && aStackToSet.getItem() instanceof ItemRecord) {
- tileentityjukebox.setCurrentRecord(aStackToSet.copy());
- //aWorld.setBlockMetadataWithNotify(aX, aY, aZ, 1, 2);
- }
- }
- }
-
- /**
- * Function to handle playing of records.
- */
- @Override
- public final void func_149925_e(World aWorld, int aX, int aY, int aZ) {
- playJukeboxRecord(aWorld, aX, aY, aZ);
- }
-
- public void playJukeboxRecord(World aWorld, int aX, int aY, int aZ) {
- if (!aWorld.isRemote) {
- TileEntitySuperJukebox tileentityjukebox = (TileEntitySuperJukebox) aWorld.getTileEntity(aX,
- aY, aZ);
-
- if (tileentityjukebox != null) {
- ItemStack itemstack = tileentityjukebox.func_145856_a();
-
- if (itemstack != null) {
-
-
-
- aWorld.playAuxSFX(1005, aX, aY, aZ, Item.getIdFromItem(itemstack.getItem()));
- //aWorld.playRecord((String) null, aX, aY, aZ);
- //tileentityjukebox.func_145857_a((ItemStack) null);
- //aWorld.setBlockMetadataWithNotify(aX, aY, aZ, 0, 2);
- /*float f = 0.7F;
- double d0 = (double) (aWorld.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
- double d1 = (double) (aWorld.rand.nextFloat() * f) + (double) (1.0F - f) * 0.2D + 0.6D;
- double d2 = (double) (aWorld.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
- ItemStack itemstack1 = itemstack.copy();
- EntityItem entityitem = new EntityItem(aWorld, (double) aX + d0,
- (double) aY + d1, (double) aZ + d2, itemstack1);
- entityitem.delayBeforeCanPickup = 10;
- aWorld.spawnEntityInWorld(entityitem);*/
- }
- }
- }
- }
-
- @Override
- public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
- {
- this.func_149925_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_);
- super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
- }
-
- /**
- * Drops the block items with a specified chance of dropping the specified items
- */
- @Override
- public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
- {
- if (!p_149690_1_.isRemote)
- {
- super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0);
- }
- }
-
- /**
- * Returns a new instance of a block's tile entity class. Called on placing the block.
- */
- @Override
- public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
- {
- return new TileEntitySuperJukebox();
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side");
- this.mIcon = p_149651_1_.registerIcon(this.getTextureName() + "_top");
- }
-
- public static class TileEntitySuperJukebox extends TileEntityJukebox implements ISidedInventory {
-
- /** The number of players currently using this chest */
- public int numPlayersUsing;
- private ItemStack mCurrentlyPlayingStack;
- private final Inventory_SuperJukebox inventoryContents;
- private String customName;
-
-
- /*
- * Important Data
- */
-
- public int a_TEST_INT_VAR_1;
- public int a_TEST_INT_VAR_2;
- public int a_TEST_INT_VAR_3;
- public int a_TEST_INT_VAR_4;
-
- public boolean mIsPlaying = false;
- public boolean mIsLooping = false;
- public boolean a_TEST_BOOL_VAR_3;
- public boolean a_TEST_BOOL_VAR_4;
-
-
-
- public TileEntitySuperJukebox() {
- this.inventoryContents = new Inventory_SuperJukebox();
- }
-
- @Override
- public void readFromNBT(NBTTagCompound aNBT) {
- super.readFromNBT(aNBT);
-
- if (aNBT.hasKey("RecordItem", 10)) {
- this.func_145857_a(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("RecordItem")));
- } else if (aNBT.getInteger("Record") > 0) {
- this.func_145857_a(new ItemStack(Item.getItemById(aNBT.getInteger("Record")), 1, 0));
- }
-
- this.inventoryContents.readFromNBT(aNBT.getCompoundTag("ContentsChest"));
- if (aNBT.hasKey("CustomName", 8)) {
- this.setCustomName(aNBT.getString("CustomName"));
- }
-
- mIsPlaying = aNBT.getBoolean("mIsPlaying");
- mIsLooping = aNBT.getBoolean("mIsLooping");
-
-
- }
-
- @Override
- public void writeToNBT(NBTTagCompound aNBT) {
- super.writeToNBT(aNBT);
-
- if (this.getCurrentRecord() != null) {
- aNBT.setTag("RecordItem", this.func_145856_a().writeToNBT(new NBTTagCompound()));
- aNBT.setInteger("Record", Item.getIdFromItem(this.func_145856_a().getItem()));
- }
-
- final NBTTagCompound chestData = new NBTTagCompound();
- this.inventoryContents.writeToNBT(chestData);
- aNBT.setTag("ContentsChest", chestData);
- if (this.hasCustomInventoryName()) {
- aNBT.setString("CustomName", this.getCustomName());
- }
-
- aNBT.setBoolean("mIsPlaying", mIsPlaying);
- aNBT.setBoolean("mIsLooping", mIsLooping);
-
- }
-
- /**
- * Called to get the internal stack
- */
- @Override
- public ItemStack func_145856_a() {
- return this.mCurrentlyPlayingStack;
- }
-
- /**
- * Called to get the internal stack, wraps vanilla function
- * {@link func_145856_a}.
- */
- public ItemStack getCurrentRecord() {
- return func_145856_a();
- }
-
- /**
- * Called to set the internal stack
- */
- @Override
- public void func_145857_a(ItemStack p_145857_1_) {
- this.mCurrentlyPlayingStack = p_145857_1_;
- this.markDirty();
- }
-
- /**
- * Called to set the internal stack, wraps vanilla function
- * {@link func_145857_a}.
- */
- public void setCurrentRecord(ItemStack aStack) {
- func_145857_a(aStack);
- this.markDirty();
- }
-
- public Inventory_SuperJukebox getInventory() {
- return this.inventoryContents;
- }
-
-
-
-
-
- public boolean playRecord(ItemStack aRecord) {
-
-
-
- return false;
- }
-
- public boolean stopRecord() {
- return openDiscDrive();
- }
-
- public void setLoopState(boolean isShufflingForever) {
-
-
-
- }
-
-
- //Play button pressed
- public boolean jukeboxLogicUpdate() {
-
- if (this.worldObj.isRemote) {
- return true;
- }
-
- Logger.INFO("a");
- if (this.mIsPlaying || this.mIsLooping) {
- return selectRecordToPlayFromInventoryAndSetViaVanillaHandler();
- }
- else {
- return stopRecord();
- }
- }
-
-
- //Determine which record to play
- public boolean selectRecordToPlayFromInventoryAndSetViaVanillaHandler() {
- AutoMap<ItemStack> mValidRecords = new AutoMap<ItemStack>();
- for (ItemStack g : this.getInventory().getInventory()) {
- if (g != null) {
- if (g.getItem() instanceof ItemRecord) {
- mValidRecords.put(g);
- }
- }
- }
-
- Logger.INFO("b1");
- //Select First Record
- ItemStack aRecordToPlay;
- if (mValidRecords.size() == 0) {
- Logger.INFO("bX");
- return false;
- }
- else {
- aRecordToPlay = mValidRecords.get(!mIsLooping ? 0 : MathUtils.randInt(0, (mValidRecords.size()-1)));
- }
- Logger.INFO("b2 - "+aRecordToPlay.getDisplayName());
-
- int aSlotCounter = 0;
- for (ItemStack g : this.getInventory().getInventory()) {
- if (g != null && aSlotCounter <= 17) {
- Logger.INFO("b3 - "+g.getDisplayName());
- if (GT_Utility.areStacksEqual(g, aRecordToPlay, true)) {
- IInventory aThisInv = this.getInventory();
- if (aThisInv.getStackInSlot(20) != null) {
- openDiscDrive();
- }
-
- GT_Utility.moveStackFromSlotAToSlotB(aThisInv, aThisInv, aSlotCounter, 20, (byte) 1, (byte) 1, (byte) 1, (byte) 1);
- setCurrentRecord(aThisInv.getStackInSlot(20));
-
- World aWorld = this.worldObj;
- int aX = this.xCoord;
- int aY = this.yCoord;
- int aZ = this.zCoord;
- if (!aWorld.isRemote) {
- aRecordToPlay = this.func_145856_a();
- if (aRecordToPlay != null) {
- aWorld.playAuxSFX(1005, aX, aY, aZ, Item.getIdFromItem(aRecordToPlay.getItem()));
- this.markDirty();
- return true;
- }
- }
-
- Logger.INFO("b++");
- this.markDirty();
- return false;
- }
- }
- aSlotCounter++;
- }
-
-
- Logger.INFO("b4");
- this.markDirty();
- return false;
- }
-
-
- public boolean genericMethodThree(Object a1, Object a2, Object a3, Object a4) {
- return false;
- }
-
-
- public void vanillaStopJukebox() {
- World aWorld = this.worldObj;
- int aX = this.xCoord;
- int aY = this.yCoord;
- int aZ = this.zCoord;
- if (!aWorld.isRemote) {
- TileEntitySuperJukebox tileentityjukebox = (TileEntitySuperJukebox) aWorld.getTileEntity(aX, aY, aZ);
- if (tileentityjukebox != null) {
- ItemStack aRecordToPlay = tileentityjukebox.func_145856_a();
- if (aRecordToPlay != null) {
- aWorld.playAuxSFX(1005, aX, aY, aZ, 0);
- aWorld.playRecord((String) null, aX, aY, aZ);
- tileentityjukebox.func_145857_a((ItemStack) null);
- this.markDirty();
- }
- }
- }
- }
-
- public boolean openDiscDrive() {
- int aSlotCounter = 17;
-
- ItemStack g;
-
- for (int i = 17; i >= 0; i--) {
- g = this.getInventory().getInventory()[i];
- if (g == null && aSlotCounter >= 0) {
- IInventory aThisInv = this.getInventory();
- GT_Utility.moveStackFromSlotAToSlotB(aThisInv, aThisInv, 20, i, (byte) 1, (byte) 1, (byte) 1, (byte) 1);
- vanillaStopJukebox();
- Logger.INFO("b++");
- this.markDirty();
- return true;
-
- }
- }
-
-
- /*for (ItemStack g : this.getInventory().getInventory()) {
- if (g == null && aSlotCounter >= 0) {
- IInventory aThisInv = this.getInventory();
- GT_Utility.moveStackFromSlotAToSlotB(aThisInv, aThisInv, 20, aSlotCounter, (byte) 1, (byte) 1, (byte) 1, (byte) 1);
- vanillaStopJukebox();
- Logger.INFO("b++");
- return true;
-
- }
- aSlotCounter--;
- } */
- this.markDirty();
- return false;
- }
-
-
-
-
-
-
-
-
-
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D,
- 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public int getSizeInventory() {
- return this.getInventory().getSizeInventory()-3;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.getInventory().getStackInSlot(slot);
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int count) {
- return this.getInventory().decrStackSize(slot, count);
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- return this.getInventory().getStackInSlotOnClosing(slot);
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.getInventory().setInventorySlotContents(slot, stack);
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 1;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return this.getInventory().isUseableByPlayer(entityplayer);
- }
-
- @Override
- public void openInventory() {
- if (this.numPlayersUsing < 0) {
- this.numPlayersUsing = 0;
- }
- if (!this.worldObj.isRemote) {
- this.numPlayersUsing++;
- }
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1,
- this.numPlayersUsing);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().openInventory();
- }
-
- @Override
- public void closeInventory() {
- if (!this.worldObj.isRemote) {
- this.numPlayersUsing--;
- }
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1,
- this.numPlayersUsing);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().closeInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- if (slot >= 18) {
- return false;
- }
- return this.getInventory().isItemValidForSlot(slot, itemstack);
- }
-
- private final static int[] SIDED_SLOTS = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- return SIDED_SLOTS;
-
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- if (p_102007_1_ >= 18) {
- return false;
- }
- return this.getInventory().isItemValidForSlot(p_102007_1_, p_102007_2_);
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- if (p_102008_1_ >= 18) {
- return false;
- }
- return this.getInventory().isItemValidForSlot(p_102008_1_, p_102008_2_);
- }
-
- public String getCustomName() {
- return this.customName;
- }
-
- public void setCustomName(final String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.SuperJukebox";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
- }
-
- }
-} \ No newline at end of file
+ }
+
+ /**
+ * Set the record in the {@link SuperJukebox} {@link TileEntity}.
+ */
+ @Override
+ public final void func_149926_b(World aWorld, int aX, int aY, int aZ, ItemStack aStackToSet) {
+ setRecordInJukeBox(aWorld, aX, aY, aZ, aStackToSet);
+ }
+
+ public void setRecordInJukeBox(World aWorld, int aX, int aY, int aZ, ItemStack aStackToSet) {
+ if (!aWorld.isRemote) {
+ TileEntitySuperJukebox tileentityjukebox = (TileEntitySuperJukebox) aWorld.getTileEntity(aX, aY, aZ);
+ if (tileentityjukebox != null && aStackToSet.getItem() instanceof ItemRecord) {
+ tileentityjukebox.setCurrentRecord(aStackToSet.copy());
+ // aWorld.setBlockMetadataWithNotify(aX, aY, aZ, 1, 2);
+ }
+ }
+ }
+
+ /**
+ * Function to handle playing of records.
+ */
+ @Override
+ public final void func_149925_e(World aWorld, int aX, int aY, int aZ) {
+ playJukeboxRecord(aWorld, aX, aY, aZ);
+ }
+
+ public void playJukeboxRecord(World aWorld, int aX, int aY, int aZ) {
+ if (!aWorld.isRemote) {
+ TileEntitySuperJukebox tileentityjukebox = (TileEntitySuperJukebox) aWorld.getTileEntity(aX, aY, aZ);
+
+ if (tileentityjukebox != null) {
+ ItemStack itemstack = tileentityjukebox.func_145856_a();
+
+ if (itemstack != null) {
+
+ aWorld.playAuxSFX(1005, aX, aY, aZ, Item.getIdFromItem(itemstack.getItem()));
+ // aWorld.playRecord((String) null, aX, aY, aZ);
+ // tileentityjukebox.func_145857_a((ItemStack) null);
+ // aWorld.setBlockMetadataWithNotify(aX, aY, aZ, 0, 2);
+ /*float f = 0.7F;
+ double d0 = (double) (aWorld.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
+ double d1 = (double) (aWorld.rand.nextFloat() * f) + (double) (1.0F - f) * 0.2D + 0.6D;
+ double d2 = (double) (aWorld.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
+ ItemStack itemstack1 = itemstack.copy();
+ EntityItem entityitem = new EntityItem(aWorld, (double) aX + d0,
+ (double) aY + d1, (double) aZ + d2, itemstack1);
+ entityitem.delayBeforeCanPickup = 10;
+ aWorld.spawnEntityInWorld(entityitem);*/
+ }
+ }
+ }
+ }
+
+ @Override
+ public void breakBlock(
+ World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
+ this.func_149925_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_);
+ super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
+ }
+
+ /**
+ * Drops the block items with a specified chance of dropping the specified items
+ */
+ @Override
+ public void dropBlockAsItemWithChance(
+ World p_149690_1_,
+ int p_149690_2_,
+ int p_149690_3_,
+ int p_149690_4_,
+ int p_149690_5_,
+ float p_149690_6_,
+ int p_149690_7_) {
+ if (!p_149690_1_.isRemote) {
+ super.dropBlockAsItemWithChance(
+ p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0);
+ }
+ }
+
+ /**
+ * Returns a new instance of a block's tile entity class. Called on placing the block.
+ */
+ @Override
+ public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
+ return new TileEntitySuperJukebox();
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side");
+ this.mIcon = p_149651_1_.registerIcon(this.getTextureName() + "_top");
+ }
+
+ public static class TileEntitySuperJukebox extends TileEntityJukebox implements ISidedInventory {
+
+ /** The number of players currently using this chest */
+ public int numPlayersUsing;
+
+ private ItemStack mCurrentlyPlayingStack;
+ private final Inventory_SuperJukebox inventoryContents;
+ private String customName;
+
+ /*
+ * Important Data
+ */
+
+ public int a_TEST_INT_VAR_1;
+ public int a_TEST_INT_VAR_2;
+ public int a_TEST_INT_VAR_3;
+ public int a_TEST_INT_VAR_4;
+
+ public boolean mIsPlaying = false;
+ public boolean mIsLooping = false;
+ public boolean a_TEST_BOOL_VAR_3;
+ public boolean a_TEST_BOOL_VAR_4;
+
+ public TileEntitySuperJukebox() {
+ this.inventoryContents = new Inventory_SuperJukebox();
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ super.readFromNBT(aNBT);
+
+ if (aNBT.hasKey("RecordItem", 10)) {
+ this.func_145857_a(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("RecordItem")));
+ } else if (aNBT.getInteger("Record") > 0) {
+ this.func_145857_a(new ItemStack(Item.getItemById(aNBT.getInteger("Record")), 1, 0));
+ }
+
+ this.inventoryContents.readFromNBT(aNBT.getCompoundTag("ContentsChest"));
+ if (aNBT.hasKey("CustomName", 8)) {
+ this.setCustomName(aNBT.getString("CustomName"));
+ }
+
+ mIsPlaying = aNBT.getBoolean("mIsPlaying");
+ mIsLooping = aNBT.getBoolean("mIsLooping");
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ super.writeToNBT(aNBT);
+
+ if (this.getCurrentRecord() != null) {
+ aNBT.setTag("RecordItem", this.func_145856_a().writeToNBT(new NBTTagCompound()));
+ aNBT.setInteger(
+ "Record", Item.getIdFromItem(this.func_145856_a().getItem()));
+ }
+
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.inventoryContents.writeToNBT(chestData);
+ aNBT.setTag("ContentsChest", chestData);
+ if (this.hasCustomInventoryName()) {
+ aNBT.setString("CustomName", this.getCustomName());
+ }
+
+ aNBT.setBoolean("mIsPlaying", mIsPlaying);
+ aNBT.setBoolean("mIsLooping", mIsLooping);
+ }
+
+ /**
+ * Called to get the internal stack
+ */
+ @Override
+ public ItemStack func_145856_a() {
+ return this.mCurrentlyPlayingStack;
+ }
+
+ /**
+ * Called to get the internal stack, wraps vanilla function
+ * {@link func_145856_a}.
+ */
+ public ItemStack getCurrentRecord() {
+ return func_145856_a();
+ }
+
+ /**
+ * Called to set the internal stack
+ */
+ @Override
+ public void func_145857_a(ItemStack p_145857_1_) {
+ this.mCurrentlyPlayingStack = p_145857_1_;
+ this.markDirty();
+ }
+
+ /**
+ * Called to set the internal stack, wraps vanilla function
+ * {@link func_145857_a}.
+ */
+ public void setCurrentRecord(ItemStack aStack) {
+ func_145857_a(aStack);
+ this.markDirty();
+ }
+
+ public Inventory_SuperJukebox getInventory() {
+ return this.inventoryContents;
+ }
+
+ public boolean playRecord(ItemStack aRecord) {
+
+ return false;
+ }
+
+ public boolean stopRecord() {
+ return openDiscDrive();
+ }
+
+ public void setLoopState(boolean isShufflingForever) {}
+
+ // Play button pressed
+ public boolean jukeboxLogicUpdate() {
+
+ if (this.worldObj.isRemote) {
+ return true;
+ }
+
+ Logger.INFO("a");
+ if (this.mIsPlaying || this.mIsLooping) {
+ return selectRecordToPlayFromInventoryAndSetViaVanillaHandler();
+ } else {
+ return stopRecord();
+ }
+ }
+
+ // Determine which record to play
+ public boolean selectRecordToPlayFromInventoryAndSetViaVanillaHandler() {
+ AutoMap<ItemStack> mValidRecords = new AutoMap<ItemStack>();
+ for (ItemStack g : this.getInventory().getInventory()) {
+ if (g != null) {
+ if (g.getItem() instanceof ItemRecord) {
+ mValidRecords.put(g);
+ }
+ }
+ }
+
+ Logger.INFO("b1");
+ // Select First Record
+ ItemStack aRecordToPlay;
+ if (mValidRecords.size() == 0) {
+ Logger.INFO("bX");
+ return false;
+ } else {
+ aRecordToPlay = mValidRecords.get(!mIsLooping ? 0 : MathUtils.randInt(0, (mValidRecords.size() - 1)));
+ }
+ Logger.INFO("b2 - " + aRecordToPlay.getDisplayName());
+
+ int aSlotCounter = 0;
+ for (ItemStack g : this.getInventory().getInventory()) {
+ if (g != null && aSlotCounter <= 17) {
+ Logger.INFO("b3 - " + g.getDisplayName());
+ if (GT_Utility.areStacksEqual(g, aRecordToPlay, true)) {
+ IInventory aThisInv = this.getInventory();
+ if (aThisInv.getStackInSlot(20) != null) {
+ openDiscDrive();
+ }
+
+ GT_Utility.moveStackFromSlotAToSlotB(
+ aThisInv, aThisInv, aSlotCounter, 20, (byte) 1, (byte) 1, (byte) 1, (byte) 1);
+ setCurrentRecord(aThisInv.getStackInSlot(20));
+
+ World aWorld = this.worldObj;
+ int aX = this.xCoord;
+ int aY = this.yCoord;
+ int aZ = this.zCoord;
+ if (!aWorld.isRemote) {
+ aRecordToPlay = this.func_145856_a();
+ if (aRecordToPlay != null) {
+ aWorld.playAuxSFX(1005, aX, aY, aZ, Item.getIdFromItem(aRecordToPlay.getItem()));
+ this.markDirty();
+ return true;
+ }
+ }
+
+ Logger.INFO("b++");
+ this.markDirty();
+ return false;
+ }
+ }
+ aSlotCounter++;
+ }
+
+ Logger.INFO("b4");
+ this.markDirty();
+ return false;
+ }
+
+ public boolean genericMethodThree(Object a1, Object a2, Object a3, Object a4) {
+ return false;
+ }
+
+ public void vanillaStopJukebox() {
+ World aWorld = this.worldObj;
+ int aX = this.xCoord;
+ int aY = this.yCoord;
+ int aZ = this.zCoord;
+ if (!aWorld.isRemote) {
+ TileEntitySuperJukebox tileentityjukebox = (TileEntitySuperJukebox) aWorld.getTileEntity(aX, aY, aZ);
+ if (tileentityjukebox != null) {
+ ItemStack aRecordToPlay = tileentityjukebox.func_145856_a();
+ if (aRecordToPlay != null) {
+ aWorld.playAuxSFX(1005, aX, aY, aZ, 0);
+ aWorld.playRecord((String) null, aX, aY, aZ);
+ tileentityjukebox.func_145857_a((ItemStack) null);
+ this.markDirty();
+ }
+ }
+ }
+ }
+
+ public boolean openDiscDrive() {
+ int aSlotCounter = 17;
+
+ ItemStack g;
+
+ for (int i = 17; i >= 0; i--) {
+ g = this.getInventory().getInventory()[i];
+ if (g == null && aSlotCounter >= 0) {
+ IInventory aThisInv = this.getInventory();
+ GT_Utility.moveStackFromSlotAToSlotB(
+ aThisInv, aThisInv, 20, i, (byte) 1, (byte) 1, (byte) 1, (byte) 1);
+ vanillaStopJukebox();
+ Logger.INFO("b++");
+ this.markDirty();
+ return true;
+ }
+ }
+
+ /*for (ItemStack g : this.getInventory().getInventory()) {
+ if (g == null && aSlotCounter >= 0) {
+ IInventory aThisInv = this.getInventory();
+ GT_Utility.moveStackFromSlotAToSlotB(aThisInv, aThisInv, 20, aSlotCounter, (byte) 1, (byte) 1, (byte) 1, (byte) 1);
+ vanillaStopJukebox();
+ Logger.INFO("b++");
+ return true;
+
+ }
+ aSlotCounter--;
+ } */
+ this.markDirty();
+ return false;
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32)
+ != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.getInventory().getSizeInventory() - 3;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.getInventory().getStackInSlot(slot);
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int count) {
+ return this.getInventory().decrStackSize(slot, count);
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ return this.getInventory().getStackInSlotOnClosing(slot);
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.getInventory().setInventorySlotContents(slot, stack);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 1;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return this.getInventory().isUseableByPlayer(entityplayer);
+ }
+
+ @Override
+ public void openInventory() {
+ if (this.numPlayersUsing < 0) {
+ this.numPlayersUsing = 0;
+ }
+ if (!this.worldObj.isRemote) {
+ this.numPlayersUsing++;
+ }
+ this.worldObj.addBlockEvent(
+ this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ if (!this.worldObj.isRemote) {
+ this.numPlayersUsing--;
+ }
+ this.worldObj.addBlockEvent(
+ this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().closeInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ if (slot >= 18) {
+ return false;
+ }
+ return this.getInventory().isItemValidForSlot(slot, itemstack);
+ }
+
+ private static final int[] SIDED_SLOTS =
+ new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ return SIDED_SLOTS;
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ if (p_102007_1_ >= 18) {
+ return false;
+ }
+ return this.getInventory().isItemValidForSlot(p_102007_1_, p_102007_2_);
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ if (p_102008_1_ >= 18) {
+ return false;
+ }
+ return this.getInventory().isItemValidForSlot(p_102008_1_, p_102008_2_);
+ }
+
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ public void setCustomName(final String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.SuperJukebox";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.customName != null) && !this.customName.equals("");
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java
index 5195e0f18c..96102017a3 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java
@@ -2,7 +2,12 @@ package gtPlusPlus.core.block.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.base.BlockBaseNBT;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EnumCreatureType;
@@ -12,75 +17,76 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.base.BlockBaseNBT;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
+public class Machine_TradeTable extends BlockBaseNBT implements ITileTooltip {
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
-public class Machine_TradeTable extends BlockBaseNBT implements ITileTooltip
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 2;
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 2;
- public Machine_TradeTable(){
- super(Material.leaves, "blockTradeBench", "Trade-o-Mat");
- }
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_){
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlYellow");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "workbench_top");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlYellow");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlYellow");
- }
+ public Machine_TradeTable() {
+ super(Material.leaves, "blockTradeBench", "Trade-o-Mat");
+ }
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz){
- if (world.isRemote) {
- return true;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlYellow");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "workbench_top");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlYellow");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlYellow");
+ }
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityTradeTable))
- {
- //Utils.LOG_INFO("Clicked on TE - ok");
- player.openGui(GTplusplus.instance, 6, world, x, y, z);
- return true;
- }
- else {
- Logger.INFO("Bad TE");
- }
- return false;
- }
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ }
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityTradeTable();
- }
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityTradeTable)) {
+ // Utils.LOG_INFO("Clicked on TE - ok");
+ player.openGui(GTplusplus.instance, 6, world, x, y, z);
+ return true;
+ } else {
+ Logger.INFO("Bad TE");
+ }
+ return false;
+ }
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityTradeTable();
+ }
-} \ No newline at end of file
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java
index e964a9da01..688dfbb742 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java
@@ -1,5 +1,4 @@
package gtPlusPlus.core.block.machine;
-public class Machine_WireiusDeletus { //A Block that removes GT Cable and Wire from it's inventory.
-
+public class Machine_WireiusDeletus { // A Block that removes GT Cable and Wire from it's inventory.
}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java
index 90f9c1056a..f4c4d4e17f 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java
@@ -9,7 +9,6 @@ import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.handler.GuiHandler;
import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.network.packet.Packet_VolumetricFlaskGui2;
import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import net.minecraft.block.material.Material;
@@ -26,139 +25,151 @@ import net.minecraft.world.World;
public class VolumetricFlaskSetter extends BasicTileBlockWithTooltip {
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 8;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- @Override
- public Class<? extends ItemBlock> getItemBlockClass() {
- return ItemBlockBasicTile.class;
- }
-
- @SuppressWarnings("deprecation")
- public VolumetricFlaskSetter(){
- super(Material.iron);
- LanguageRegistry.addName(this, "Volumetric Flask Configurator");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
- if (world.isRemote) {
- return true;
- }
- else {
-
- boolean mDidScrewDriver = false;
- // Check For Screwdriver
- try {
- final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
- final Item mHandItem = mHandStack.getItem();
- if (((mHandItem instanceof GT_MetaGenerated_Tool_01)
- && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) {
- final TileEntityVolumetricFlaskSetter tile = (TileEntityVolumetricFlaskSetter) world.getTileEntity(x, y, z);
- if (tile != null) {
- mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z);
- }
- }
- }
- catch (final Throwable t) {}
-
- if (!mDidScrewDriver) {
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityVolumetricFlaskSetter)){
- player.openGui(GTplusplus.instance, GuiHandler.GUI18, world, x, y, z);
- TileEntityVolumetricFlaskSetter aTile = (TileEntityVolumetricFlaskSetter) te;
- //new Packet_VolumetricFlaskGui2(aTile, aTile.getCustomValue());
- return true;
- }
- }
- else {
- return true;
- }
-
- }
- return false;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 0;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityVolumetricFlaskSetter();
- }
-
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityVolumetricFlaskSetter) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName());
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- @Override
- public int getMetaCount() {
- return 0;
- }
-
- @Override
- public String getUnlocalBlockName() {
- return "blockVolumetricFlaskSetter";
- }
-
- @Override
- protected float initBlockHardness() {
- return 5f;
- }
-
- @Override
- protected float initBlockResistance() {
- return 1f;
- }
-
- @Override
- protected CreativeTabs initCreativeTab() {
- return AddToCreativeTab.tabMachines;
- }
-
- @Override
- protected String getTileEntityName() {
- return "Volumetric Flask Configurator";
- }
-
- @Override
- public CubicObject<String>[] getCustomTextureDirectoryObject() {
- String[] aTexData = new String[] {
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_A",
- CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_C",
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
- CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H"
- };
- CubicObject<String>[] aTextureData = new CubicObject[] {new CubicObject<String>(aTexData)};
- return aTextureData;
- }
-
-} \ No newline at end of file
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 8;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ @Override
+ public Class<? extends ItemBlock> getItemBlockClass() {
+ return ItemBlockBasicTile.class;
+ }
+
+ @SuppressWarnings("deprecation")
+ public VolumetricFlaskSetter() {
+ super(Material.iron);
+ LanguageRegistry.addName(this, "Volumetric Flask Configurator");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer player,
+ final int side,
+ final float lx,
+ final float ly,
+ final float lz) {
+ if (world.isRemote) {
+ return true;
+ } else {
+
+ boolean mDidScrewDriver = false;
+ // Check For Screwdriver
+ try {
+ final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
+ final Item mHandItem = mHandStack.getItem();
+ if (((mHandItem instanceof GT_MetaGenerated_Tool_01)
+ && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) {
+ final TileEntityVolumetricFlaskSetter tile =
+ (TileEntityVolumetricFlaskSetter) world.getTileEntity(x, y, z);
+ if (tile != null) {
+ mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z);
+ }
+ }
+ } catch (final Throwable t) {
+ }
+
+ if (!mDidScrewDriver) {
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityVolumetricFlaskSetter)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI18, world, x, y, z);
+ TileEntityVolumetricFlaskSetter aTile = (TileEntityVolumetricFlaskSetter) te;
+ // new Packet_VolumetricFlaskGui2(aTile, aTile.getCustomValue());
+ return true;
+ }
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityVolumetricFlaskSetter();
+ }
+
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+
+ @Override
+ public void onBlockPlacedBy(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityLivingBase entity,
+ final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityVolumetricFlaskSetter) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ @Override
+ public int getMetaCount() {
+ return 0;
+ }
+
+ @Override
+ public String getUnlocalBlockName() {
+ return "blockVolumetricFlaskSetter";
+ }
+
+ @Override
+ protected float initBlockHardness() {
+ return 5f;
+ }
+
+ @Override
+ protected float initBlockResistance() {
+ return 1f;
+ }
+
+ @Override
+ protected CreativeTabs initCreativeTab() {
+ return AddToCreativeTab.tabMachines;
+ }
+
+ @Override
+ protected String getTileEntityName() {
+ return "Volumetric Flask Configurator";
+ }
+
+ @Override
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ String[] aTexData = new String[] {
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_A",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_C",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H"
+ };
+ CubicObject<String>[] aTextureData = new CubicObject[] {new CubicObject<String>(aTexData)};
+ return aTextureData;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java b/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java
index b8f9662ac7..00a5b97e2c 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java
@@ -1,11 +1,15 @@
package gtPlusPlus.core.block.machine.bedrock;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -17,143 +21,153 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.api.objects.random.XSTR;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
-public class Mining_Head_Fake extends Block{
-
- public Mining_Head_Fake(){
- super(Material.lava);
- this.setBlockName(Utils.sanitizeString("blockMiningHeadFake"));
- this.setBlockTextureName(CORE.MODID + ":" + "blockFrameGt");
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(-1F);
- this.setResistance(50000.0F);
- this.setHarvestLevel("pickaxe", 10);
- this.setStepSound(soundTypeMetal);
- //LanguageRegistry.addName(this, "Wither Cage");
- GameRegistry.registerBlock(this, Utils.sanitizeString("blockMiningHeadFake"));
- }
-
- public String GetProperName(){
- return "Hardened Mining Head";
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderBlockPass(){
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube(){
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon){
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockFrameGt");
- }
-
- @Override
- public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion){
- //prevent from being destroyed by wither and nukes.
- }
-
- @Override
- public void onBlockDestroyedByExplosion(final World p_149723_1_, final int p_149723_2_,
- final int p_149723_3_, final int p_149723_4_, final Explosion p_149723_5_) {
-
- }
-
- @Override
- public boolean canDropFromExplosion(final Explosion p_149659_1_) {
- return false;
- }
-
- @Override
- public boolean canEntityDestroy(final IBlockAccess world, final int x, final int y, final int z,
- final Entity entity) {
- return false;
- }
-
-
- //Colour Handling
- private static final int mWitherColour = Utils.rgbtoHexValue(175, 64, 32);
-
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){
- return mWitherColour;
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- return mWitherColour;
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- @Override
- public boolean isCollidable() {
- return true;
- }
-
- @Override
- public void randomDisplayTick(World world, int posX, int posY, int posZ,
- Random rand) {
- generateVoidParticlesAroundBlockPos(new BlockPos(posX, posY, posZ, world), 2);
- super.randomDisplayTick(world, posX, posY, posZ, rand);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_,
- Entity ent) {
- EntityUtils.doDamage(ent, DamageSource.outOfWorld, 20);
- EntityUtils.setEntityOnFire(ent, 100);
- super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, ent);
- }
-
- @Override
- protected boolean canSilkHarvest() {
- return false;
- }
-
- @Override
- public boolean canHarvestBlock(EntityPlayer player, int meta) {
- return false;
- }
-
- public static void generateVoidParticlesAroundBlockPos(BlockPos Pos, int range){
- for (BlockPos G : Pos.getSurroundingBlocks()) {
- int i1 = G.xPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range);
- int j1 = G.yPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range);
- int k1 = G.zPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range);
-
- Block block = Pos.world.getBlock(i1, j1, k1);
-
- if (block.getMaterial() == Material.air){
-
- //lava
- if (Pos.yPos <= 7) {
- Pos.world.spawnParticle("portal", (double)((float)i1 + CORE.RANDOM.nextFloat()), (double)((float)j1 + CORE.RANDOM.nextFloat()), (double)((float)k1 + CORE.RANDOM.nextFloat()), 0.0D, 0.0D, 0.0D);
- Pos.world.spawnParticle("lava", (double)((float)i1 + CORE.RANDOM.nextFloat()), (double)((float)j1 + CORE.RANDOM.nextFloat()), (double)((float)k1 + CORE.RANDOM.nextFloat()), 0.0D, 0.0D, 0.0D);
- }
- else {
- Pos.world.spawnParticle("portal", (double)((float)i1 + CORE.RANDOM.nextFloat()), (double)((float)j1 + CORE.RANDOM.nextFloat()), (double)((float)k1 + CORE.RANDOM.nextFloat()), 0.0D, 0.0D, 0.0D);
- }
-
- }
- }
- }
-
-
+public class Mining_Head_Fake extends Block {
+
+ public Mining_Head_Fake() {
+ super(Material.lava);
+ this.setBlockName(Utils.sanitizeString("blockMiningHeadFake"));
+ this.setBlockTextureName(CORE.MODID + ":" + "blockFrameGt");
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(-1F);
+ this.setResistance(50000.0F);
+ this.setHarvestLevel("pickaxe", 10);
+ this.setStepSound(soundTypeMetal);
+ // LanguageRegistry.addName(this, "Wither Cage");
+ GameRegistry.registerBlock(this, Utils.sanitizeString("blockMiningHeadFake"));
+ }
+
+ public String GetProperName() {
+ return "Hardened Mining Head";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iIcon) {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockFrameGt");
+ }
+
+ @Override
+ public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion) {
+ // prevent from being destroyed by wither and nukes.
+ }
+
+ @Override
+ public void onBlockDestroyedByExplosion(
+ final World p_149723_1_,
+ final int p_149723_2_,
+ final int p_149723_3_,
+ final int p_149723_4_,
+ final Explosion p_149723_5_) {}
+
+ @Override
+ public boolean canDropFromExplosion(final Explosion p_149659_1_) {
+ return false;
+ }
+
+ @Override
+ public boolean canEntityDestroy(
+ final IBlockAccess world, final int x, final int y, final int z, final Entity entity) {
+ return false;
+ }
+
+ // Colour Handling
+ private static final int mWitherColour = Utils.rgbtoHexValue(175, 64, 32);
+
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
+ return mWitherColour;
+ }
+
+ @Override
+ public int getRenderColor(final int aMeta) {
+ return mWitherColour;
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ @Override
+ public boolean isCollidable() {
+ return true;
+ }
+
+ @Override
+ public void randomDisplayTick(World world, int posX, int posY, int posZ, Random rand) {
+ generateVoidParticlesAroundBlockPos(new BlockPos(posX, posY, posZ, world), 2);
+ super.randomDisplayTick(world, posX, posY, posZ, rand);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(
+ World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity ent) {
+ EntityUtils.doDamage(ent, DamageSource.outOfWorld, 20);
+ EntityUtils.setEntityOnFire(ent, 100);
+ super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, ent);
+ }
+
+ @Override
+ protected boolean canSilkHarvest() {
+ return false;
+ }
+
+ @Override
+ public boolean canHarvestBlock(EntityPlayer player, int meta) {
+ return false;
+ }
+
+ public static void generateVoidParticlesAroundBlockPos(BlockPos Pos, int range) {
+ for (BlockPos G : Pos.getSurroundingBlocks()) {
+ int i1 = G.xPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range);
+ int j1 = G.yPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range);
+ int k1 = G.zPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range);
+
+ Block block = Pos.world.getBlock(i1, j1, k1);
+
+ if (block.getMaterial() == Material.air) {
+
+ // lava
+ if (Pos.yPos <= 7) {
+ Pos.world.spawnParticle(
+ "portal",
+ (double) ((float) i1 + CORE.RANDOM.nextFloat()),
+ (double) ((float) j1 + CORE.RANDOM.nextFloat()),
+ (double) ((float) k1 + CORE.RANDOM.nextFloat()),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ Pos.world.spawnParticle(
+ "lava",
+ (double) ((float) i1 + CORE.RANDOM.nextFloat()),
+ (double) ((float) j1 + CORE.RANDOM.nextFloat()),
+ (double) ((float) k1 + CORE.RANDOM.nextFloat()),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ } else {
+ Pos.world.spawnParticle(
+ "portal",
+ (double) ((float) i1 + CORE.RANDOM.nextFloat()),
+ (double) ((float) j1 + CORE.RANDOM.nextFloat()),
+ (double) ((float) k1 + CORE.RANDOM.nextFloat()),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java b/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java
index bba185a0c1..0da1650edf 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java
@@ -1,11 +1,15 @@
package gtPlusPlus.core.block.machine.bedrock;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -17,120 +21,112 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
-public class Mining_Pipe_Fake extends Block{
-
- public Mining_Pipe_Fake(){
- super(Material.cactus);
- this.setBlockName(Utils.sanitizeString("blockMiningPipeFake"));
- this.setBlockTextureName(CORE.MODID + ":" + "blockFrameGt");
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(-1F);
- this.setResistance(50000.0F);
- this.setHarvestLevel("pickaxe", 8);
- this.setStepSound(soundTypeMetal);
- //LanguageRegistry.addName(this, "Wither Cage");
- GameRegistry.registerBlock(this, Utils.sanitizeString("blockMiningPipeFake"));
- }
-
- public String GetProperName(){
- return "Hardened Mining Pipe";
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderBlockPass(){
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube(){
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon){
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockFrameGt");
- }
-
- @Override
- public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion){
- //prevent from being destroyed by wither and nukes.
- }
-
- @Override
- public void onBlockDestroyedByExplosion(final World p_149723_1_, final int p_149723_2_,
- final int p_149723_3_, final int p_149723_4_, final Explosion p_149723_5_) {
-
- }
-
- @Override
- public boolean canDropFromExplosion(final Explosion p_149659_1_) {
- return false;
- }
-
- @Override
- public boolean canEntityDestroy(final IBlockAccess world, final int x, final int y, final int z,
- final Entity entity) {
- return false;
- }
-
-
- //Colour Handling
- private static final int mWitherColour = Utils.rgbtoHexValue(32, 32, 32);
-
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){
- return mWitherColour;
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- return mWitherColour;
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- @Override
- public boolean isCollidable() {
- return true;
- }
-
- @Override
- public void randomDisplayTick(World world, int posX, int posY, int posZ,
- Random rand) {
- Mining_Head_Fake.generateVoidParticlesAroundBlockPos(new BlockPos(posX, posY, posZ, world), 2);
- super.randomDisplayTick(world, posX, posY, posZ, rand);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity ent) {
- if (MathUtils.randInt(0, 100) < 5) {
- EntityUtils.doDamage(ent, DamageSource.outOfWorld, 1);
- }
- super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, ent);
- }
-
- @Override
- protected boolean canSilkHarvest() {
- return false;
- }
-
- @Override
- public boolean canHarvestBlock(EntityPlayer player, int meta) {
- return false;
- }
-
-
-
+public class Mining_Pipe_Fake extends Block {
+
+ public Mining_Pipe_Fake() {
+ super(Material.cactus);
+ this.setBlockName(Utils.sanitizeString("blockMiningPipeFake"));
+ this.setBlockTextureName(CORE.MODID + ":" + "blockFrameGt");
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(-1F);
+ this.setResistance(50000.0F);
+ this.setHarvestLevel("pickaxe", 8);
+ this.setStepSound(soundTypeMetal);
+ // LanguageRegistry.addName(this, "Wither Cage");
+ GameRegistry.registerBlock(this, Utils.sanitizeString("blockMiningPipeFake"));
+ }
+
+ public String GetProperName() {
+ return "Hardened Mining Pipe";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iIcon) {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockFrameGt");
+ }
+
+ @Override
+ public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion) {
+ // prevent from being destroyed by wither and nukes.
+ }
+
+ @Override
+ public void onBlockDestroyedByExplosion(
+ final World p_149723_1_,
+ final int p_149723_2_,
+ final int p_149723_3_,
+ final int p_149723_4_,
+ final Explosion p_149723_5_) {}
+
+ @Override
+ public boolean canDropFromExplosion(final Explosion p_149659_1_) {
+ return false;
+ }
+
+ @Override
+ public boolean canEntityDestroy(
+ final IBlockAccess world, final int x, final int y, final int z, final Entity entity) {
+ return false;
+ }
+
+ // Colour Handling
+ private static final int mWitherColour = Utils.rgbtoHexValue(32, 32, 32);
+
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
+ return mWitherColour;
+ }
+
+ @Override
+ public int getRenderColor(final int aMeta) {
+ return mWitherColour;
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ @Override
+ public boolean isCollidable() {
+ return true;
+ }
+
+ @Override
+ public void randomDisplayTick(World world, int posX, int posY, int posZ, Random rand) {
+ Mining_Head_Fake.generateVoidParticlesAroundBlockPos(new BlockPos(posX, posY, posZ, world), 2);
+ super.randomDisplayTick(world, posX, posY, posZ, rand);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(
+ World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity ent) {
+ if (MathUtils.randInt(0, 100) < 5) {
+ EntityUtils.doDamage(ent, DamageSource.outOfWorld, 1);
+ }
+ super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, ent);
+ }
+
+ @Override
+ protected boolean canSilkHarvest() {
+ return false;
+ }
+
+ @Override
+ public boolean canHarvestBlock(EntityPlayer player, int meta) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/chunkloading/GTPP_ChunkManager.java b/src/main/java/gtPlusPlus/core/chunkloading/GTPP_ChunkManager.java
index b403646a2a..3322f3924c 100644
--- a/src/main/java/gtPlusPlus/core/chunkloading/GTPP_ChunkManager.java
+++ b/src/main/java/gtPlusPlus/core/chunkloading/GTPP_ChunkManager.java
@@ -1,11 +1,11 @@
package gtPlusPlus.core.chunkloading;
import com.google.common.collect.LinkedListMultimap;
+import com.google.common.collect.ListMultimap;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.GTplusplus;
-
-import com.google.common.collect.ListMultimap;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntityChunkLoader;
+import java.util.*;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.ChunkCoordIntPair;
@@ -14,91 +14,92 @@ import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.MinecraftForge;
-import java.util.*;
-
/**
- *
+ *
* This class handles re-initializing chunks after a server restart
* Credits to Repo-Alt for the original implementation.
* @author Repo-Alt, Alkalus
*
*/
-public class GTPP_ChunkManager implements ForgeChunkManager.LoadingCallback, ForgeChunkManager.OrderedLoadingCallback, ForgeChunkManager.PlayerOrderedLoadingCallback {
- private static GTPP_ChunkManager instance;
+public class GTPP_ChunkManager
+ implements ForgeChunkManager.LoadingCallback,
+ ForgeChunkManager.OrderedLoadingCallback,
+ ForgeChunkManager.PlayerOrderedLoadingCallback {
+ private static GTPP_ChunkManager instance;
- public static boolean enableChunkloaders = true;
- public static boolean alwaysReloadChunkloaders = false;
- public static boolean debugChunkloaders = false;
+ public static boolean enableChunkloaders = true;
+ public static boolean alwaysReloadChunkloaders = false;
+ public static boolean debugChunkloaders = false;
- public static GTPP_ChunkManager getInstance() {
- if (instance == null) {
- instance = new GTPP_ChunkManager();
- }
- return instance;
- }
+ public static GTPP_ChunkManager getInstance() {
+ if (instance == null) {
+ instance = new GTPP_ChunkManager();
+ }
+ return instance;
+ }
- public static void init() {
- if (enableChunkloaders) {
- ForgeChunkManager.setForcedChunkLoadingCallback(GTplusplus.instance, getInstance());
- MinecraftForge.EVENT_BUS.register(getInstance());
- }
- }
+ public static void init() {
+ if (enableChunkloaders) {
+ ForgeChunkManager.setForcedChunkLoadingCallback(GTplusplus.instance, getInstance());
+ MinecraftForge.EVENT_BUS.register(getInstance());
+ }
+ }
- @Override
- public void ticketsLoaded(List<Ticket> tickets, World world) {
- for (Ticket ticket : tickets) {
- if (ticket.isPlayerTicket())
- continue;
- Entity entity = ticket.getEntity();
- if (entity == null) {
- int x = ticket.getModData().getInteger("xCoord");
- int y = ticket.getModData().getInteger("yCoord");
- int z = ticket.getModData().getInteger("zCoord");
+ @Override
+ public void ticketsLoaded(List<Ticket> tickets, World world) {
+ for (Ticket ticket : tickets) {
+ if (ticket.isPlayerTicket()) continue;
+ Entity entity = ticket.getEntity();
+ if (entity == null) {
+ int x = ticket.getModData().getInteger("xCoord");
+ int y = ticket.getModData().getInteger("yCoord");
+ int z = ticket.getModData().getInteger("zCoord");
- if (y >= 0) {
- TileEntity tile = world.getTileEntity(x, y, z);
- if (((IGregTechTileEntity)tile).getMetaTileEntity() instanceof GregtechMetaTileEntityChunkLoader) {
- ((GregtechMetaTileEntityChunkLoader)((IGregTechTileEntity)tile).getMetaTileEntity()).forceChunkLoading(ticket);
- }
- }
- }
- }
- }
+ if (y >= 0) {
+ TileEntity tile = world.getTileEntity(x, y, z);
+ if (((IGregTechTileEntity) tile).getMetaTileEntity() instanceof GregtechMetaTileEntityChunkLoader) {
+ ((GregtechMetaTileEntityChunkLoader) ((IGregTechTileEntity) tile).getMetaTileEntity())
+ .forceChunkLoading(ticket);
+ }
+ }
+ }
+ }
+ }
- @Override
- public List<Ticket> ticketsLoaded(List<Ticket> tickets, World world, int maxTicketCount) {
- Set<Ticket> validTickets = new HashSet<>();
- for (Ticket ticket : tickets) {
- Entity entity = ticket.getEntity();
- if (entity == null) {
- int x = ticket.getModData().getInteger("xCoord");
- int y = ticket.getModData().getInteger("yCoord");
- int z = ticket.getModData().getInteger("zCoord");
+ @Override
+ public List<Ticket> ticketsLoaded(List<Ticket> tickets, World world, int maxTicketCount) {
+ Set<Ticket> validTickets = new HashSet<>();
+ for (Ticket ticket : tickets) {
+ Entity entity = ticket.getEntity();
+ if (entity == null) {
+ int x = ticket.getModData().getInteger("xCoord");
+ int y = ticket.getModData().getInteger("yCoord");
+ int z = ticket.getModData().getInteger("zCoord");
- if (y >= 0) {
- TileEntity tile = world.getTileEntity(x, y, z);
- if (((IGregTechTileEntity)tile).getMetaTileEntity() instanceof GregtechMetaTileEntityChunkLoader) {
- validTickets.add(ticket);
- }
- }
- }
- }
+ if (y >= 0) {
+ TileEntity tile = world.getTileEntity(x, y, z);
+ if (((IGregTechTileEntity) tile).getMetaTileEntity() instanceof GregtechMetaTileEntityChunkLoader) {
+ validTickets.add(ticket);
+ }
+ }
+ }
+ }
- return new LinkedList<>(validTickets);
- }
+ return new LinkedList<>(validTickets);
+ }
- @Override
- public ListMultimap<String, Ticket> playerTicketsLoaded(ListMultimap<String, Ticket> tickets, World world) {
- return LinkedListMultimap.create();
- }
+ @Override
+ public ListMultimap<String, Ticket> playerTicketsLoaded(ListMultimap<String, Ticket> tickets, World world) {
+ return LinkedListMultimap.create();
+ }
- public static Set<ChunkCoordIntPair> getChunksAround(int xChunk, int zChunk, int radius) {
- Set<ChunkCoordIntPair> chunkList = new HashSet<>();
- for (int xx = xChunk - radius; xx <= xChunk + radius; xx++) {
- for (int zz = zChunk - radius; zz <= zChunk + radius; zz++) {
- chunkList.add(new ChunkCoordIntPair(xx, zz));
- }
- }
- return chunkList;
- }
+ public static Set<ChunkCoordIntPair> getChunksAround(int xChunk, int zChunk, int radius) {
+ Set<ChunkCoordIntPair> chunkList = new HashSet<>();
+ for (int xx = xChunk - radius; xx <= xChunk + radius; xx++) {
+ for (int zz = zChunk - radius; zz <= zChunk + radius; zz++) {
+ chunkList.add(new ChunkCoordIntPair(xx, zz));
+ }
+ }
+ return chunkList;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java b/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java
index 400503b2fa..687dc65fb1 100644
--- a/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java
+++ b/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java
@@ -4,25 +4,24 @@ import gregtech.api.enums.TextureSet;
public class CustomTextureSet extends TextureSet {
- public static enum TextureSets {
-
- REFINED(),
- GEM_A(),
- ENRICHED(),
- NUCLEAR;
+ public static enum TextureSets {
+ REFINED(),
+ GEM_A(),
+ ENRICHED(),
+ NUCLEAR;
- private final CustomTextureSet A;
-
- private TextureSets (){
- A = new CustomTextureSet(this.name().toUpperCase());
- }
- public CustomTextureSet get() {
- return A;
- }
- }
-
- public CustomTextureSet(String aSetName) {
- super(aSetName);
- }
+ private final CustomTextureSet A;
+ private TextureSets() {
+ A = new CustomTextureSet(this.name().toUpperCase());
+ }
+
+ public CustomTextureSet get() {
+ return A;
+ }
+ }
+
+ public CustomTextureSet(String aSetName) {
+ super(aSetName);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java b/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java
index ac64dee26a..590345e8e6 100644
--- a/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java
@@ -1,19 +1,16 @@
package gtPlusPlus.core.client.model;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.entity.monster.EntityBatKing;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
-import net.minecraft.entity.passive.EntityBat;
import net.minecraft.util.MathHelper;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
-public class ModelBatKing extends ModelBase
-{
+public class ModelBatKing extends ModelBase {
private ModelRenderer batHead;
/** The body box of the bat model. */
private ModelRenderer batBody;
@@ -26,11 +23,10 @@ public class ModelBatKing extends ModelBase
/** The outer left wing box of the bat model. */
private ModelRenderer batOuterLeftWing;
- public ModelBatKing()
- {
+ public ModelBatKing() {
this.textureWidth = 64;
this.textureHeight = 64;
-
+
this.batHead = new ModelRenderer(this, 0, 0);
this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6);
ModelRenderer modelrenderer = new ModelRenderer(this, 24, 0);
@@ -65,56 +61,57 @@ public class ModelBatKing extends ModelBase
* not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and
* it seems a good match for a bats size
*/
- public int getBatSize()
- {
+ public int getBatSize() {
return 72;
}
/**
* Sets the models various rotation angles then renders the model.
*/
- public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
- {
- EntityBatKing entitybat = (EntityBatKing)p_78088_1_;
+ public void render(
+ Entity p_78088_1_,
+ float p_78088_2_,
+ float p_78088_3_,
+ float p_78088_4_,
+ float p_78088_5_,
+ float p_78088_6_,
+ float p_78088_7_) {
+ EntityBatKing entitybat = (EntityBatKing) p_78088_1_;
float f6;
- if (entitybat.getIsBatHanging())
- {
- f6 = (180F / (float)Math.PI);
- this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI);
- this.batHead.rotateAngleY = (float)Math.PI - p_78088_5_ / (180F / (float)Math.PI);
- this.batHead.rotateAngleZ = (float)Math.PI;
+ if (entitybat.getIsBatHanging()) {
+ f6 = (180F / (float) Math.PI);
+ this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI);
+ this.batHead.rotateAngleY = (float) Math.PI - p_78088_5_ / (180F / (float) Math.PI);
+ this.batHead.rotateAngleZ = (float) Math.PI;
this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F);
this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F);
this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F);
- this.batBody.rotateAngleX = (float)Math.PI;
+ this.batBody.rotateAngleX = (float) Math.PI;
this.batRightWing.rotateAngleX = -0.15707964F;
- this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F);
+ this.batRightWing.rotateAngleY = -((float) Math.PI * 2F / 5F);
this.batOuterRightWing.rotateAngleY = -1.7278761F;
this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX;
this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY;
this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY;
- }
- else
- {
- f6 = (180F / (float)Math.PI);
- this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI);
- this.batHead.rotateAngleY = p_78088_5_ / (180F / (float)Math.PI);
+ } else {
+ f6 = (180F / (float) Math.PI);
+ this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI);
+ this.batHead.rotateAngleY = p_78088_5_ / (180F / (float) Math.PI);
this.batHead.rotateAngleZ = 0.0F;
this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F);
this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F);
this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(p_78088_4_ * 0.1F) * 0.15F;
+ this.batBody.rotateAngleX = ((float) Math.PI / 4F) + MathHelper.cos(p_78088_4_ * 0.1F) * 0.15F;
this.batBody.rotateAngleY = 0.0F;
- this.batRightWing.rotateAngleY = MathHelper.cos(p_78088_4_ * 1.3F) * (float)Math.PI * 0.25F;
+ this.batRightWing.rotateAngleY = MathHelper.cos(p_78088_4_ * 1.3F) * (float) Math.PI * 0.25F;
this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY;
this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F;
this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F;
}
-
GL11.glScalef(4, 4, 4);
this.batHead.render(p_78088_7_);
this.batBody.render(p_78088_7_);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java b/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java
index c116dcf115..98c474a160 100644
--- a/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java
@@ -6,8 +6,7 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
@SideOnly(Side.CLIENT)
-public class ModelDecayChest extends ModelBase
-{
+public class ModelDecayChest extends ModelBase {
/** The chest lid in the chest's model. */
public ModelRenderer chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64);
/** The model of the bottom of the chest. */
@@ -15,8 +14,7 @@ public class ModelDecayChest extends ModelBase
/** The chest's knob in the chest model. */
public ModelRenderer chestKnob;
- public ModelDecayChest()
- {
+ public ModelDecayChest() {
this.chestLid.addBox(0.0F, -5.0F, -14.0F, 14, 5, 14, 0.0F);
this.chestLid.rotationPointX = 1.0F;
this.chestLid.rotationPointY = 7.0F;
@@ -36,11 +34,10 @@ public class ModelDecayChest extends ModelBase
/**
* This method renders out all parts of the chest model.
*/
- public void renderAll()
- {
+ public void renderAll() {
this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX;
this.chestLid.render(0.0625F);
this.chestKnob.render(0.0625F);
this.chestBelow.render(0.0625F);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelEggBox.java b/src/main/java/gtPlusPlus/core/client/model/ModelEggBox.java
index 0aef4eb7b0..a12b48c7d2 100644
--- a/src/main/java/gtPlusPlus/core/client/model/ModelEggBox.java
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelEggBox.java
@@ -1,6 +1,5 @@
package gtPlusPlus.core.client.model;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.client.model.tabula.ModelTabulaBase;
@@ -14,19 +13,19 @@ import net.minecraft.entity.Entity;
* Created using Tabula 4.1.1
*/
public class ModelEggBox extends ModelTabulaBase {
-
- private final AutoMap<Pair<ModelRenderer, Float>> mParts = new AutoMap<Pair<ModelRenderer, Float>>();
-
- private static RenderTabulaBase mRendererInstance;
-
+
+ private final AutoMap<Pair<ModelRenderer, Float>> mParts = new AutoMap<Pair<ModelRenderer, Float>>();
+
+ private static RenderTabulaBase mRendererInstance;
+
public ModelRenderer bottom;
- //EggBox_full.png
+ // EggBox_full.png
public ModelEggBox() {
- super(64, 64);
+ super(64, 64);
this.textureWidth = 64;
this.textureHeight = 64;
-
+
this.bottom = new ModelRenderer(this, 0, 19);
this.bottom.setRotationPoint(1.0F, 6.0F, 1.0F);
this.bottom.addBox(0.0F, 0.0F, 0.0F, 14, 10, 14, 0.0F);
@@ -34,8 +33,8 @@ public class ModelEggBox extends ModelTabulaBase {
}
@Override
- public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
- //Logger.INFO("Rendering EggBox");
+ public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
+ // Logger.INFO("Rendering EggBox");
this.bottom.render(f5);
}
@@ -48,18 +47,19 @@ public class ModelEggBox extends ModelTabulaBase {
modelRenderer.rotateAngleZ = z;
}
- @Override
- protected AutoMap<Pair<ModelRenderer, Float>> getModelParts() {
- AutoMap<Pair<ModelRenderer, Float>> aParts = new AutoMap<Pair<ModelRenderer, Float>>();
- aParts.add(new Pair<ModelRenderer, Float>(bottom, 0.0625F));
- return aParts;
- //return mParts;
- }
-
- public static RenderTabulaBase getRenderer() {
- if (mRendererInstance == null) {
- mRendererInstance = new RenderTabulaBase(new ModelEggBox(), "textures/blocks/TileEntities/EggBox_full.png", TileEntityEggBox.class);
- }
- return mRendererInstance;
- }
+ @Override
+ protected AutoMap<Pair<ModelRenderer, Float>> getModelParts() {
+ AutoMap<Pair<ModelRenderer, Float>> aParts = new AutoMap<Pair<ModelRenderer, Float>>();
+ aParts.add(new Pair<ModelRenderer, Float>(bottom, 0.0625F));
+ return aParts;
+ // return mParts;
+ }
+
+ public static RenderTabulaBase getRenderer() {
+ if (mRendererInstance == null) {
+ mRendererInstance = new RenderTabulaBase(
+ new ModelEggBox(), "textures/blocks/TileEntities/EggBox_full.png", TileEntityEggBox.class);
+ }
+ return mRendererInstance;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java b/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java
index f7fb92f550..586dfec2db 100644
--- a/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java
@@ -2,7 +2,6 @@ package gtPlusPlus.core.client.model;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.client.model.ModelChicken;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
@@ -10,46 +9,50 @@ import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
-public class ModelGiantChicken extends ModelChicken{
+public class ModelGiantChicken extends ModelChicken {
- public ModelGiantChicken()
- {
+ public ModelGiantChicken() {
byte b0 = 16;
this.head = new ModelRenderer(this, 0, 0);
this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F);
- this.head.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F);
+ this.head.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F);
this.bill = new ModelRenderer(this, 14, 0);
this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F);
- this.bill.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F);
+ this.bill.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F);
this.chin = new ModelRenderer(this, 14, 4);
this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F);
- this.chin.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F);
+ this.chin.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F);
this.body = new ModelRenderer(this, 0, 9);
this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F);
- this.body.setRotationPoint(0.0F, (float)b0, 0.0F);
+ this.body.setRotationPoint(0.0F, (float) b0, 0.0F);
this.rightLeg = new ModelRenderer(this, 26, 0);
this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3);
- this.rightLeg.setRotationPoint(-2.0F, (float)(3 + b0), 1.0F);
+ this.rightLeg.setRotationPoint(-2.0F, (float) (3 + b0), 1.0F);
this.leftLeg = new ModelRenderer(this, 26, 0);
this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3);
- this.leftLeg.setRotationPoint(1.0F, (float)(3 + b0), 1.0F);
+ this.leftLeg.setRotationPoint(1.0F, (float) (3 + b0), 1.0F);
this.rightWing = new ModelRenderer(this, 24, 13);
this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6);
- this.rightWing.setRotationPoint(-4.0F, (float)(-3 + b0), 0.0F);
+ this.rightWing.setRotationPoint(-4.0F, (float) (-3 + b0), 0.0F);
this.leftWing = new ModelRenderer(this, 24, 13);
this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6);
- this.leftWing.setRotationPoint(4.0F, (float)(-3 + b0), 0.0F);
+ this.leftWing.setRotationPoint(4.0F, (float) (-3 + b0), 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
- public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
- {
+ public void render(
+ Entity p_78088_1_,
+ float p_78088_2_,
+ float p_78088_3_,
+ float p_78088_4_,
+ float p_78088_5_,
+ float p_78088_6_,
+ float p_78088_7_) {
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
- if (this.isChild)
- {
+ if (this.isChild) {
float f6 = 1.0F;
GL11.glPushMatrix();
GL11.glTranslatef(0.0F, 0F, 0F);
@@ -66,10 +69,8 @@ public class ModelGiantChicken extends ModelChicken{
this.rightWing.render(p_78088_7_);
this.leftWing.render(p_78088_7_);
GL11.glPopMatrix();
- //super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_);
- }
- else
- {
+ // super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_);
+ } else {
float f6 = 2.0F;
GL11.glPushMatrix();
GL11.glScalef(1.0F * f6, 1.0F * f6, 1.0F * f6);
@@ -95,18 +96,24 @@ public class ModelGiantChicken extends ModelChicken{
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
- public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_)
- {
- this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI);
- this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI);
+ public void setRotationAngles(
+ float p_78087_1_,
+ float p_78087_2_,
+ float p_78087_3_,
+ float p_78087_4_,
+ float p_78087_5_,
+ float p_78087_6_,
+ Entity p_78087_7_) {
+ this.head.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
+ this.head.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
this.bill.rotateAngleX = this.head.rotateAngleX;
this.bill.rotateAngleY = this.head.rotateAngleY;
this.chin.rotateAngleX = this.head.rotateAngleX;
this.chin.rotateAngleY = this.head.rotateAngleY;
- this.body.rotateAngleX = ((float)Math.PI / 2F);
+ this.body.rotateAngleX = ((float) Math.PI / 2F);
this.rightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_;
- this.leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_;
+ this.leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float) Math.PI) * 1.4F * p_78087_2_;
this.rightWing.rotateAngleZ = p_78087_3_;
this.leftWing.rotateAngleZ = -p_78087_3_;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java b/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java
index 455df761cb..7cfb7ec2ea 100644
--- a/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java
@@ -2,23 +2,20 @@ package gtPlusPlus.core.client.model;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.client.model.ModelBlaze;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
@SideOnly(Side.CLIENT)
-public class ModelSickBlaze extends ModelBlaze
-{
+public class ModelSickBlaze extends ModelBlaze {
/** The sticks that fly around the Blaze. */
private ModelRenderer[] blazeSticks = new ModelRenderer[24];
+
private ModelRenderer blazeHead;
- public ModelSickBlaze()
- {
- for (int i = 0; i < this.blazeSticks.length; ++i)
- {
+ public ModelSickBlaze() {
+ for (int i = 0; i < this.blazeSticks.length; ++i) {
this.blazeSticks[i] = new ModelRenderer(this, 0, 16);
this.blazeSticks[i].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2);
}
@@ -28,8 +25,7 @@ public class ModelSickBlaze extends ModelBlaze
}
@Override
- public int func_78104_a()
- {
+ public int func_78104_a() {
return 8;
}
@@ -37,13 +33,18 @@ public class ModelSickBlaze extends ModelBlaze
* Sets the models various rotation angles then renders the model.
*/
@Override
- public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
- {
+ public void render(
+ Entity p_78088_1_,
+ float p_78088_2_,
+ float p_78088_3_,
+ float p_78088_4_,
+ float p_78088_5_,
+ float p_78088_6_,
+ float p_78088_7_) {
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
this.blazeHead.render(p_78088_7_);
- for (int i = 0; i < this.blazeSticks.length; ++i)
- {
+ for (int i = 0; i < this.blazeSticks.length; ++i) {
this.blazeSticks[i].render(p_78088_7_);
}
}
@@ -54,40 +55,43 @@ public class ModelSickBlaze extends ModelBlaze
* "far" arms and legs can swing at most.
*/
@Override
- public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_)
- {
- float f6 = p_78087_3_ * (float)Math.PI * -0.1F;
+ public void setRotationAngles(
+ float p_78087_1_,
+ float p_78087_2_,
+ float p_78087_3_,
+ float p_78087_4_,
+ float p_78087_5_,
+ float p_78087_6_,
+ Entity p_78087_7_) {
+ float f6 = p_78087_3_ * (float) Math.PI * -0.1F;
int i;
- for (i = 0; i < 4; ++i)
- {
+ for (i = 0; i < 4; ++i) {
this.blazeSticks[i].rotationPointY = -2.0F + MathHelper.cos((i * 2 + p_78087_3_) * 0.25F);
this.blazeSticks[i].rotationPointX = MathHelper.cos(f6) * 9.0F;
this.blazeSticks[i].rotationPointZ = MathHelper.sin(f6) * 9.0F;
++f6;
}
- f6 = ((float)Math.PI / 4F) + p_78087_3_ * (float)Math.PI * 0.03F;
+ f6 = ((float) Math.PI / 4F) + p_78087_3_ * (float) Math.PI * 0.03F;
- for (i = 4; i < 8; ++i)
- {
+ for (i = 4; i < 8; ++i) {
this.blazeSticks[i].rotationPointY = 2.0F + MathHelper.cos((i * 2 + p_78087_3_) * 0.25F);
this.blazeSticks[i].rotationPointX = MathHelper.cos(f6) * 7.0F;
this.blazeSticks[i].rotationPointZ = MathHelper.sin(f6) * 7.0F;
++f6;
}
- f6 = 0.47123894F + p_78087_3_ * (float)Math.PI * -0.05F;
+ f6 = 0.47123894F + p_78087_3_ * (float) Math.PI * -0.05F;
- for (i = 8; i < 12; ++i)
- {
+ for (i = 8; i < 12; ++i) {
this.blazeSticks[i].rotationPointY = 11.0F + MathHelper.cos((i * 1.5F + p_78087_3_) * 0.5F);
this.blazeSticks[i].rotationPointX = MathHelper.cos(f6) * 5.0F;
this.blazeSticks[i].rotationPointZ = MathHelper.sin(f6) * 5.0F;
++f6;
}
- this.blazeHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI);
- this.blazeHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI);
+ this.blazeHead.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
+ this.blazeHead.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java b/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java
index aa23635b4d..879e06516a 100644
--- a/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java
@@ -2,7 +2,6 @@ package gtPlusPlus.core.client.model;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.client.model.ModelIronGolem;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
@@ -10,21 +9,17 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityIronGolem;
@SideOnly(Side.CLIENT)
-public class ModelStaballoyConstruct extends ModelIronGolem
-{
-
- public ModelStaballoyConstruct()
- {
+public class ModelStaballoyConstruct extends ModelIronGolem {
+
+ public ModelStaballoyConstruct() {
this(0.0F);
}
- public ModelStaballoyConstruct(float p_i1161_1_)
- {
+ public ModelStaballoyConstruct(float p_i1161_1_) {
this(p_i1161_1_, -7.0F);
}
- public ModelStaballoyConstruct(float p_i1162_1_, float p_i1162_2_)
- {
+ public ModelStaballoyConstruct(float p_i1162_1_, float p_i1162_2_) {
short short1 = 128;
short short2 = 128;
this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(short1, short2);
@@ -54,8 +49,14 @@ public class ModelStaballoyConstruct extends ModelIronGolem
* Sets the models various rotation angles then renders the model.
*/
@Override
- public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
- {
+ public void render(
+ Entity p_78088_1_,
+ float p_78088_2_,
+ float p_78088_3_,
+ float p_78088_4_,
+ float p_78088_5_,
+ float p_78088_6_,
+ float p_78088_7_) {
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
this.ironGolemHead.render(p_78088_7_);
this.ironGolemBody.render(p_78088_7_);
@@ -71,10 +72,16 @@ public class ModelStaballoyConstruct extends ModelIronGolem
* "far" arms and legs can swing at most.
*/
@Override
- public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_)
- {
- this.ironGolemHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI);
- this.ironGolemHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI);
+ public void setRotationAngles(
+ float p_78087_1_,
+ float p_78087_2_,
+ float p_78087_3_,
+ float p_78087_4_,
+ float p_78087_5_,
+ float p_78087_6_,
+ Entity p_78087_7_) {
+ this.ironGolemHead.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
+ this.ironGolemHead.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(p_78087_1_, 13.0F) * p_78087_2_;
this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(p_78087_1_, 13.0F) * p_78087_2_;
this.ironGolemLeftLeg.rotateAngleY = 0.0F;
@@ -86,35 +93,28 @@ public class ModelStaballoyConstruct extends ModelIronGolem
* and third as in the setRotationAngles method.
*/
@Override
- public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_)
- {
- EntityIronGolem entityirongolem = (EntityIronGolem)p_78086_1_;
+ public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) {
+ EntityIronGolem entityirongolem = (EntityIronGolem) p_78086_1_;
int i = entityirongolem.getAttackTimer();
- if (i > 0)
- {
+ if (i > 0) {
this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a(i - p_78086_4_, 10.0F);
this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a(i - p_78086_4_, 10.0F);
- }
- else
- {
+ } else {
int j = entityirongolem.getHoldRoseTick();
- if (j > 0)
- {
+ if (j > 0) {
this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a(j, 70.0F);
this.ironGolemLeftArm.rotateAngleX = 0.0F;
- }
- else
- {
- this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_;
+ } else {
+ this.ironGolemRightArm.rotateAngleX =
+ (-0.2F + 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_;
this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_;
}
}
}
- private float func_78172_a(float p_78172_1_, float p_78172_2_)
- {
+ private float func_78172_a(float p_78172_1_, float p_78172_2_) {
return (Math.abs(p_78172_1_ % p_78172_2_ - p_78172_2_ * 0.5F) - p_78172_2_ * 0.25F) / (p_78172_2_ * 0.25F);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/client/model/tabula/ModelTabulaBase.java b/src/main/java/gtPlusPlus/core/client/model/tabula/ModelTabulaBase.java
index 3a0cbb636b..2ec6e4f06d 100644
--- a/src/main/java/gtPlusPlus/core/client/model/tabula/ModelTabulaBase.java
+++ b/src/main/java/gtPlusPlus/core/client/model/tabula/ModelTabulaBase.java
@@ -1,6 +1,5 @@
package gtPlusPlus.core.client.model.tabula;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
import net.minecraft.client.model.ModelBase;
@@ -11,20 +10,19 @@ import net.minecraft.client.model.ModelRenderer;
* Created using Tabula 4.1.1
*/
public abstract class ModelTabulaBase extends ModelBase {
-
-
+
public ModelTabulaBase(int aTexWidth, int aTexHeight) {
this.textureWidth = aTexWidth;
this.textureHeight = aTexHeight;
}
-
+
protected abstract AutoMap<Pair<ModelRenderer, Float>> getModelParts();
-
+
public void renderAll() {
- for (Pair<ModelRenderer, Float> part : getModelParts()) {
- //Logger.INFO("Rendering EggBox");
- part.getKey().render(part.getValue());
- }
+ for (Pair<ModelRenderer, Float> part : getModelParts()) {
+ // Logger.INFO("Rendering EggBox");
+ part.getKey().render(part.getValue());
+ }
}
/**
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java b/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java
index f40357495a..b24bc48dbd 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java
@@ -7,79 +7,78 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.IItemRenderer;
-
import org.lwjgl.opengl.GL11;
-
/**
* Easy way of rendering an item which should look like a block.
* Borrowed.
- *
+ *
* @author King Lemming
- *
+ *
*/
public class CustomItemBlockRenderer implements IItemRenderer {
- public static CustomItemBlockRenderer instance = new CustomItemBlockRenderer();
+ public static CustomItemBlockRenderer instance = new CustomItemBlockRenderer();
- @Override
- public boolean handleRenderType(ItemStack item, ItemRenderType type) {
- return true;
- }
+ @Override
+ public boolean handleRenderType(ItemStack item, ItemRenderType type) {
+ return true;
+ }
- @Override
- public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
- return true;
- }
+ @Override
+ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
+ return true;
+ }
- @Override
- public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
+ @Override
+ public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
- double offset = -0.5;
- if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
- offset = 0;
- } else if (type == ItemRenderType.ENTITY) {
- GL11.glScalef(0.5F, 0.5F, 0.5F);
- }
- renderItemAsBlock((RenderBlocks) data[0], item, offset, offset, offset);
- }
-
- public static void renderItemAsBlock(RenderBlocks renderer, ItemStack item, double translateX, double translateY, double translateZ) {
+ double offset = -0.5;
+ if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
+ offset = 0;
+ } else if (type == ItemRenderType.ENTITY) {
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ }
+ renderItemAsBlock((RenderBlocks) data[0], item, offset, offset, offset);
+ }
- renderTextureAsBlock(renderer, item.getIconIndex(), translateX, translateY, translateZ);
- }
+ public static void renderItemAsBlock(
+ RenderBlocks renderer, ItemStack item, double translateX, double translateY, double translateZ) {
- public static void renderTextureAsBlock(RenderBlocks renderer, IIcon texture, double translateX, double translateY, double translateZ) {
+ renderTextureAsBlock(renderer, item.getIconIndex(), translateX, translateY, translateZ);
+ }
- Tessellator tessellator = Tessellator.instance;
- Block block = Blocks.stone;
+ public static void renderTextureAsBlock(
+ RenderBlocks renderer, IIcon texture, double translateX, double translateY, double translateZ) {
- if (texture == null) {
- return;
- }
- renderer.setRenderBoundsFromBlock(block);
- GL11.glTranslated(translateX, translateY, translateZ);
- tessellator.startDrawingQuads();
+ Tessellator tessellator = Tessellator.instance;
+ Block block = Blocks.stone;
- tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, texture);
+ if (texture == null) {
+ return;
+ }
+ renderer.setRenderBoundsFromBlock(block);
+ GL11.glTranslated(translateX, translateY, translateZ);
+ tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, texture);
+ tessellator.setNormal(0.0F, -1.0F, 0.0F);
+ renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, texture);
- tessellator.setNormal(0.0F, 0.0F, -1.0F);
- renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, texture);
+ tessellator.setNormal(0.0F, 1.0F, 0.0F);
+ renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, texture);
- tessellator.setNormal(0.0F, 0.0F, 1.0F);
- renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, texture);
+ tessellator.setNormal(0.0F, 0.0F, -1.0F);
+ renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, texture);
- tessellator.setNormal(-1.0F, 0.0F, 0.0F);
- renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, texture);
+ tessellator.setNormal(0.0F, 0.0F, 1.0F);
+ renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, texture);
- tessellator.setNormal(1.0F, 0.0F, 0.0F);
- renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, texture);
+ tessellator.setNormal(-1.0F, 0.0F, 0.0F);
+ renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, texture);
- tessellator.draw();
- }
+ tessellator.setNormal(1.0F, 0.0F, 0.0F);
+ renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, texture);
+ tessellator.draw();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java b/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java
index a0b34d3b0b..793e7093cb 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.client.renderer;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import gregtech.api.interfaces.ITexture;
@@ -14,443 +12,537 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
+import org.lwjgl.opengl.GL11;
public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
- public static CustomOreBlockRenderer INSTANCE;
- public final int mRenderID;
-
- public CustomOreBlockRenderer() {
- INSTANCE = this;
- this.mRenderID = RenderingRegistry.getNextAvailableRenderId();
- RenderingRegistry.registerBlockHandler(this);
- Logger.INFO("Registered Custom Ore Block Renderer.");
- }
-
- public boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
- Block tTileEntity = aBlock;
- if ((tTileEntity instanceof ITexturedBlock)) {
- return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{((ITexturedBlock) tTileEntity).getTexture((byte) 0), ((ITexturedBlock) tTileEntity).getTexture((byte) 1), ((ITexturedBlock) tTileEntity).getTexture((byte) 2), ((ITexturedBlock) tTileEntity).getTexture((byte) 3), ((ITexturedBlock) tTileEntity).getTexture((byte) 4), ((ITexturedBlock) tTileEntity).getTexture((byte) 5)});
- }
- return false;
- }
-
- public boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) {
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- int l = aBlock.colorMultiplier(aWorld, aX, aY, aZ);
- float RED = (float)(l >> 16 & 255) / 255.0F;
- float GREEN = (float)(l >> 8 & 255) / 255.0F;
- float BLUE = (float)(l & 255) / 255.0F;
-
- if (Minecraft.isAmbientOcclusionEnabled() && aBlock.getLightValue() == 0){
- if (RenderBlocks.getInstance().partialRenderBounds){
- return INSTANCE.renderStandardBlockWithAmbientOcclusionPartial(aWorld, aRenderer, aTextures, aBlock, aX, aY, aZ, RED, GREEN, BLUE);
- }
- else {
- return INSTANCE.renderStandardBlockWithAmbientOcclusion(aWorld, aRenderer, aTextures, aBlock, aX, aY, aZ, RED, GREEN, BLUE);
- }
- }
- else {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[0], true);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[1], true);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[2], true);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[3], true);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[4], true);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[5], true);
- }
- return true;
- }
-
- public static void renderFaceYNeg(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[0], true);
- }
- public static void renderFaceYPos(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[1], true);
- }
- public static void renderFaceZNeg(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[2], true);
- }
- public static void renderFaceZPos(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[3], true);
- }
- public static void renderFaceXNeg(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[4], true);
- }
- public static void renderFaceXPos(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[5], true);
- }
-
- public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) {
- return;
- }
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ));
- }
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; i++) {
- if (aIcon[i] != null) {
- aIcon[i].renderYNeg(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
- aRenderer.flipTexture = false;
- }
-
- public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1))) {
- return;
- }
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ));
- }
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; i++) {
- if (aIcon[i] != null) {
- aIcon[i].renderYPos(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
- aRenderer.flipTexture = false;
- }
-
- public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2))) {
- return;
- }
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ));
- }
- aRenderer.flipTexture = (!aFullBlock);
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; i++) {
- if (aIcon[i] != null) {
- aIcon[i].renderZNeg(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
- aRenderer.flipTexture = false;
- }
-
- public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3))) {
- return;
- }
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ));
- }
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; i++) {
- if (aIcon[i] != null) {
- aIcon[i].renderZPos(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
- aRenderer.flipTexture = false;
- }
-
- public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4))) {
- return;
- }
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ));
- }
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; i++) {
- if (aIcon[i] != null) {
- aIcon[i].renderXNeg(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
- aRenderer.flipTexture = false;
- }
-
- public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5))) {
- return;
- }
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ));
- }
- aRenderer.flipTexture = (!aFullBlock);
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; i++) {
- if (aIcon[i] != null) {
- aIcon[i].renderXPos(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
- aRenderer.flipTexture = false;
- }
-
- public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) {
- aBlock.setBlockBoundsForItemRender();
- aRenderer.setRenderBoundsFromBlock(aBlock);
- GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
- renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 0), true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
- renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 1), true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
- renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 2), true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
- renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 3), true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
- renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 4), true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
- renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 5), true);
- Tessellator.instance.draw();
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
- }
-
- public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) {
- blockAccess = aWorld;
- return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
- }
-
- public boolean shouldRender3DInInventory(int aModel) {
- return true;
- }
-
- public int getRenderId() {
- return this.mRenderID;
- }
-
- public void setRenderBounds(double p_147782_1_, double p_147782_3_, double p_147782_5_, double p_147782_7_, double p_147782_9_, double p_147782_11_)
- {
- if (!this.lockBlockBounds)
- {
- this.renderMinX = p_147782_1_;
- this.renderMaxX = p_147782_7_;
- this.renderMinY = p_147782_3_;
- this.renderMaxY = p_147782_9_;
- this.renderMinZ = p_147782_5_;
- this.renderMaxZ = p_147782_11_;
- this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D);
- }
- }
-
- /**
- * Like setRenderBounds, but automatically pulling the bounds from the given Block.
- */
- public void setRenderBoundsFromBlock(Block block)
- {
- if (!this.lockBlockBounds)
- {
- this.renderMinX = block.getBlockBoundsMinX();
- this.renderMaxX = block.getBlockBoundsMaxX();
- this.renderMinY = block.getBlockBoundsMinY();
- this.renderMaxY = block.getBlockBoundsMaxY();
- this.renderMinZ = block.getBlockBoundsMinZ();
- this.renderMaxZ = block.getBlockBoundsMaxZ();
- this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D);
- }
- }
-
- /**
- * Vanilla Variables
- */
-
- /** The minimum X value for rendering (default 0.0). */
- public double renderMinX;
- /** The maximum X value for rendering (default 1.0). */
- public double renderMaxX;
- /** The minimum Y value for rendering (default 0.0). */
- public double renderMinY;
- /** The maximum Y value for rendering (default 1.0). */
- public double renderMaxY;
- /** The minimum Z value for rendering (default 0.0). */
- public double renderMinZ;
- /** The maximum Z value for rendering (default 1.0). */
- public double renderMaxZ;
- public boolean lockBlockBounds;
- public boolean partialRenderBounds;
- public final Minecraft minecraftRB = RenderBlocks.getInstance().minecraftRB;
- public int uvRotateEast;
- public int uvRotateWest;
- public int uvRotateSouth;
- public int uvRotateNorth;
- public int uvRotateTop;
- public int uvRotateBottom;
- /** Whether ambient occlusion is enabled or not */
- public boolean enableAO;
- /** Used as a scratch variable for ambient occlusion on the north/bottom/east corner. */
- public float aoLightValueScratchXYZNNN;
- /** Used as a scratch variable for ambient occlusion between the bottom face and the north face. */
- public float aoLightValueScratchXYNN;
- /** Used as a scratch variable for ambient occlusion on the north/bottom/west corner. */
- public float aoLightValueScratchXYZNNP;
- /** Used as a scratch variable for ambient occlusion between the bottom face and the east face. */
- public float aoLightValueScratchYZNN;
- /** Used as a scratch variable for ambient occlusion between the bottom face and the west face. */
- public float aoLightValueScratchYZNP;
- /** Used as a scratch variable for ambient occlusion on the south/bottom/east corner. */
- public float aoLightValueScratchXYZPNN;
- /** Used as a scratch variable for ambient occlusion between the bottom face and the south face. */
- public float aoLightValueScratchXYPN;
- /** Used as a scratch variable for ambient occlusion on the south/bottom/west corner. */
- public float aoLightValueScratchXYZPNP;
- /** Used as a scratch variable for ambient occlusion on the north/top/east corner. */
- public float aoLightValueScratchXYZNPN;
- /** Used as a scratch variable for ambient occlusion between the top face and the north face. */
- public float aoLightValueScratchXYNP;
- /** Used as a scratch variable for ambient occlusion on the north/top/west corner. */
- public float aoLightValueScratchXYZNPP;
- /** Used as a scratch variable for ambient occlusion between the top face and the east face. */
- public float aoLightValueScratchYZPN;
- /** Used as a scratch variable for ambient occlusion on the south/top/east corner. */
- public float aoLightValueScratchXYZPPN;
- /** Used as a scratch variable for ambient occlusion between the top face and the south face. */
- public float aoLightValueScratchXYPP;
- /** Used as a scratch variable for ambient occlusion between the top face and the west face. */
- public float aoLightValueScratchYZPP;
- /** Used as a scratch variable for ambient occlusion on the south/top/west corner. */
- public float aoLightValueScratchXYZPPP;
- /** Used as a scratch variable for ambient occlusion between the north face and the east face. */
- public float aoLightValueScratchXZNN;
- /** Used as a scratch variable for ambient occlusion between the south face and the east face. */
- public float aoLightValueScratchXZPN;
- /** Used as a scratch variable for ambient occlusion between the north face and the west face. */
- public float aoLightValueScratchXZNP;
- /** Used as a scratch variable for ambient occlusion between the south face and the west face. */
- public float aoLightValueScratchXZPP;
- /** Ambient occlusion brightness XYZNNN */
- public int aoBrightnessXYZNNN;
- /** Ambient occlusion brightness XYNN */
- public int aoBrightnessXYNN;
- /** Ambient occlusion brightness XYZNNP */
- public int aoBrightnessXYZNNP;
- /** Ambient occlusion brightness YZNN */
- public int aoBrightnessYZNN;
- /** Ambient occlusion brightness YZNP */
- public int aoBrightnessYZNP;
- /** Ambient occlusion brightness XYZPNN */
- public int aoBrightnessXYZPNN;
- /** Ambient occlusion brightness XYPN */
- public int aoBrightnessXYPN;
- /** Ambient occlusion brightness XYZPNP */
- public int aoBrightnessXYZPNP;
- /** Ambient occlusion brightness XYZNPN */
- public int aoBrightnessXYZNPN;
- /** Ambient occlusion brightness XYNP */
- public int aoBrightnessXYNP;
- /** Ambient occlusion brightness XYZNPP */
- public int aoBrightnessXYZNPP;
- /** Ambient occlusion brightness YZPN */
- public int aoBrightnessYZPN;
- /** Ambient occlusion brightness XYZPPN */
- public int aoBrightnessXYZPPN;
- /** Ambient occlusion brightness XYPP */
- public int aoBrightnessXYPP;
- /** Ambient occlusion brightness YZPP */
- public int aoBrightnessYZPP;
- /** Ambient occlusion brightness XYZPPP */
- public int aoBrightnessXYZPPP;
- /** Ambient occlusion brightness XZNN */
- public int aoBrightnessXZNN;
- /** Ambient occlusion brightness XZPN */
- public int aoBrightnessXZPN;
- /** Ambient occlusion brightness XZNP */
- public int aoBrightnessXZNP;
- /** Ambient occlusion brightness XZPP */
- public int aoBrightnessXZPP;
- /** Brightness top left */
- public int brightnessTopLeft;
- /** Brightness bottom left */
- public int brightnessBottomLeft;
- /** Brightness bottom right */
- public int brightnessBottomRight;
- /** Brightness top right */
- public int brightnessTopRight;
- /** Red color value for the top left corner */
- public float colorRedTopLeft;
- /** Red color value for the bottom left corner */
- public float colorRedBottomLeft;
- /** Red color value for the bottom right corner */
- public float colorRedBottomRight;
- /** Red color value for the top right corner */
- public float colorRedTopRight;
- /** Green color value for the top left corner */
- public float colorGreenTopLeft;
- /** Green color value for the bottom left corner */
- public float colorGreenBottomLeft;
- /** Green color value for the bottom right corner */
- public float colorGreenBottomRight;
- /** Green color value for the top right corner */
- public float colorGreenTopRight;
- /** Blue color value for the top left corner */
- public float colorBlueTopLeft;
- /** Blue color value for the bottom left corner */
- public float colorBlueBottomLeft;
- /** Blue color value for the bottom right corner */
- public float colorBlueBottomRight;
- /** Blue color value for the top right corner */
- public float colorBlueTopRight;
- /** If set to >=0, all block faces will be rendered using this texture index */
- public IIcon overrideBlockTexture;
- /**
- * Clear override block texture
- */
- public void clearOverrideBlockTexture()
- {
- this.overrideBlockTexture = null;
- }
-
- public boolean hasOverrideBlockTexture()
- {
- return this.overrideBlockTexture != null;
- }
-
- public IIcon getBlockIcon(Block block, IBlockAccess access, int x, int y, int z, int side)
- {
- return this.getIconSafe(block.getIcon(access, x, y, z, side));
- }
-
- public IIcon getBlockIconFromSideAndMetadata(Block block, int side, int meta)
- {
- return this.getIconSafe(block.getIcon(side, meta));
- }
-
- public IIcon getBlockIconFromSide(Block block, int side)
- {
- return this.getIconSafe(block.getBlockTextureFromSide(side));
- }
-
- public IIcon getBlockIcon(Block block)
- {
- return this.getIconSafe(block.getBlockTextureFromSide(1));
- }
-
- public IIcon getIconSafe(IIcon iicon)
- {
- if (iicon == null)
- {
- iicon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
- }
-
- return (IIcon)iicon;
- }
-
- IBlockAccess blockAccess = RenderBlocks.getInstance().blockAccess;
-
- public boolean renderStandardBlockWithAmbientOcclusion(IBlockAccess aWorld, RenderBlocks aRenderer, ITexture[][] aTextures, Block block, int xPos, int yPos, int zPos, float R, float G, float B)
- {
+ public static CustomOreBlockRenderer INSTANCE;
+ public final int mRenderID;
+
+ public CustomOreBlockRenderer() {
+ INSTANCE = this;
+ this.mRenderID = RenderingRegistry.getNextAvailableRenderId();
+ RenderingRegistry.registerBlockHandler(this);
+ Logger.INFO("Registered Custom Ore Block Renderer.");
+ }
+
+ public boolean renderStandardBlock(
+ IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
+ Block tTileEntity = aBlock;
+ if ((tTileEntity instanceof ITexturedBlock)) {
+ return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][] {
+ ((ITexturedBlock) tTileEntity).getTexture((byte) 0),
+ ((ITexturedBlock) tTileEntity).getTexture((byte) 1),
+ ((ITexturedBlock) tTileEntity).getTexture((byte) 2),
+ ((ITexturedBlock) tTileEntity).getTexture((byte) 3),
+ ((ITexturedBlock) tTileEntity).getTexture((byte) 4),
+ ((ITexturedBlock) tTileEntity).getTexture((byte) 5)
+ });
+ }
+ return false;
+ }
+
+ public boolean renderStandardBlock(
+ IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) {
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ int l = aBlock.colorMultiplier(aWorld, aX, aY, aZ);
+ float RED = (float) (l >> 16 & 255) / 255.0F;
+ float GREEN = (float) (l >> 8 & 255) / 255.0F;
+ float BLUE = (float) (l & 255) / 255.0F;
+
+ if (Minecraft.isAmbientOcclusionEnabled() && aBlock.getLightValue() == 0) {
+ if (RenderBlocks.getInstance().partialRenderBounds) {
+ return INSTANCE.renderStandardBlockWithAmbientOcclusionPartial(
+ aWorld, aRenderer, aTextures, aBlock, aX, aY, aZ, RED, GREEN, BLUE);
+ } else {
+ return INSTANCE.renderStandardBlockWithAmbientOcclusion(
+ aWorld, aRenderer, aTextures, aBlock, aX, aY, aZ, RED, GREEN, BLUE);
+ }
+ } else {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[0], true);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[1], true);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[2], true);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[3], true);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[4], true);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[5], true);
+ }
+ return true;
+ }
+
+ public static void renderFaceYNeg(
+ IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[0], true);
+ }
+
+ public static void renderFaceYPos(
+ IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[1], true);
+ }
+
+ public static void renderFaceZNeg(
+ IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[2], true);
+ }
+
+ public static void renderFaceZPos(
+ IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[3], true);
+ }
+
+ public static void renderFaceXNeg(
+ IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[4], true);
+ }
+
+ public static void renderFaceXPos(
+ IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[][] aIcon) {
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[5], true);
+ }
+
+ public static void renderNegativeYFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) {
+ return;
+ }
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ));
+ }
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; i++) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderYNeg(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderPositiveYFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1))) {
+ return;
+ }
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ));
+ }
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; i++) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderYPos(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderNegativeZFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2))) {
+ return;
+ }
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ));
+ }
+ aRenderer.flipTexture = (!aFullBlock);
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; i++) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderZNeg(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderPositiveZFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3))) {
+ return;
+ }
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ));
+ }
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; i++) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderZPos(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderNegativeXFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4))) {
+ return;
+ }
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ));
+ }
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; i++) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderXNeg(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderPositiveXFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5))) {
+ return;
+ }
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ));
+ }
+ aRenderer.flipTexture = (!aFullBlock);
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; i++) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderXPos(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) {
+ aBlock.setBlockBoundsForItemRender();
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
+ renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 0), true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
+ renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 1), true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
+ renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 2), true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
+ renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 3), true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
+ renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 4), true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
+ renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedBlock) aBlock).getTexture((byte) 5), true);
+ Tessellator.instance.draw();
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ }
+
+ public boolean renderWorldBlock(
+ IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) {
+ blockAccess = aWorld;
+ return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
+ }
+
+ public boolean shouldRender3DInInventory(int aModel) {
+ return true;
+ }
+
+ public int getRenderId() {
+ return this.mRenderID;
+ }
+
+ public void setRenderBounds(
+ double p_147782_1_,
+ double p_147782_3_,
+ double p_147782_5_,
+ double p_147782_7_,
+ double p_147782_9_,
+ double p_147782_11_) {
+ if (!this.lockBlockBounds) {
+ this.renderMinX = p_147782_1_;
+ this.renderMaxX = p_147782_7_;
+ this.renderMinY = p_147782_3_;
+ this.renderMaxY = p_147782_9_;
+ this.renderMinZ = p_147782_5_;
+ this.renderMaxZ = p_147782_11_;
+ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2
+ && (this.renderMinX > 0.0D
+ || this.renderMaxX < 1.0D
+ || this.renderMinY > 0.0D
+ || this.renderMaxY < 1.0D
+ || this.renderMinZ > 0.0D
+ || this.renderMaxZ < 1.0D);
+ }
+ }
+
+ /**
+ * Like setRenderBounds, but automatically pulling the bounds from the given Block.
+ */
+ public void setRenderBoundsFromBlock(Block block) {
+ if (!this.lockBlockBounds) {
+ this.renderMinX = block.getBlockBoundsMinX();
+ this.renderMaxX = block.getBlockBoundsMaxX();
+ this.renderMinY = block.getBlockBoundsMinY();
+ this.renderMaxY = block.getBlockBoundsMaxY();
+ this.renderMinZ = block.getBlockBoundsMinZ();
+ this.renderMaxZ = block.getBlockBoundsMaxZ();
+ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2
+ && (this.renderMinX > 0.0D
+ || this.renderMaxX < 1.0D
+ || this.renderMinY > 0.0D
+ || this.renderMaxY < 1.0D
+ || this.renderMinZ > 0.0D
+ || this.renderMaxZ < 1.0D);
+ }
+ }
+
+ /**
+ * Vanilla Variables
+ */
+
+ /** The minimum X value for rendering (default 0.0). */
+ public double renderMinX;
+ /** The maximum X value for rendering (default 1.0). */
+ public double renderMaxX;
+ /** The minimum Y value for rendering (default 0.0). */
+ public double renderMinY;
+ /** The maximum Y value for rendering (default 1.0). */
+ public double renderMaxY;
+ /** The minimum Z value for rendering (default 0.0). */
+ public double renderMinZ;
+ /** The maximum Z value for rendering (default 1.0). */
+ public double renderMaxZ;
+
+ public boolean lockBlockBounds;
+ public boolean partialRenderBounds;
+ public final Minecraft minecraftRB = RenderBlocks.getInstance().minecraftRB;
+ public int uvRotateEast;
+ public int uvRotateWest;
+ public int uvRotateSouth;
+ public int uvRotateNorth;
+ public int uvRotateTop;
+ public int uvRotateBottom;
+ /** Whether ambient occlusion is enabled or not */
+ public boolean enableAO;
+ /** Used as a scratch variable for ambient occlusion on the north/bottom/east corner. */
+ public float aoLightValueScratchXYZNNN;
+ /** Used as a scratch variable for ambient occlusion between the bottom face and the north face. */
+ public float aoLightValueScratchXYNN;
+ /** Used as a scratch variable for ambient occlusion on the north/bottom/west corner. */
+ public float aoLightValueScratchXYZNNP;
+ /** Used as a scratch variable for ambient occlusion between the bottom face and the east face. */
+ public float aoLightValueScratchYZNN;
+ /** Used as a scratch variable for ambient occlusion between the bottom face and the west face. */
+ public float aoLightValueScratchYZNP;
+ /** Used as a scratch variable for ambient occlusion on the south/bottom/east corner. */
+ public float aoLightValueScratchXYZPNN;
+ /** Used as a scratch variable for ambient occlusion between the bottom face and the south face. */
+ public float aoLightValueScratchXYPN;
+ /** Used as a scratch variable for ambient occlusion on the south/bottom/west corner. */
+ public float aoLightValueScratchXYZPNP;
+ /** Used as a scratch variable for ambient occlusion on the north/top/east corner. */
+ public float aoLightValueScratchXYZNPN;
+ /** Used as a scratch variable for ambient occlusion between the top face and the north face. */
+ public float aoLightValueScratchXYNP;
+ /** Used as a scratch variable for ambient occlusion on the north/top/west corner. */
+ public float aoLightValueScratchXYZNPP;
+ /** Used as a scratch variable for ambient occlusion between the top face and the east face. */
+ public float aoLightValueScratchYZPN;
+ /** Used as a scratch variable for ambient occlusion on the south/top/east corner. */
+ public float aoLightValueScratchXYZPPN;
+ /** Used as a scratch variable for ambient occlusion between the top face and the south face. */
+ public float aoLightValueScratchXYPP;
+ /** Used as a scratch variable for ambient occlusion between the top face and the west face. */
+ public float aoLightValueScratchYZPP;
+ /** Used as a scratch variable for ambient occlusion on the south/top/west corner. */
+ public float aoLightValueScratchXYZPPP;
+ /** Used as a scratch variable for ambient occlusion between the north face and the east face. */
+ public float aoLightValueScratchXZNN;
+ /** Used as a scratch variable for ambient occlusion between the south face and the east face. */
+ public float aoLightValueScratchXZPN;
+ /** Used as a scratch variable for ambient occlusion between the north face and the west face. */
+ public float aoLightValueScratchXZNP;
+ /** Used as a scratch variable for ambient occlusion between the south face and the west face. */
+ public float aoLightValueScratchXZPP;
+ /** Ambient occlusion brightness XYZNNN */
+ public int aoBrightnessXYZNNN;
+ /** Ambient occlusion brightness XYNN */
+ public int aoBrightnessXYNN;
+ /** Ambient occlusion brightness XYZNNP */
+ public int aoBrightnessXYZNNP;
+ /** Ambient occlusion brightness YZNN */
+ public int aoBrightnessYZNN;
+ /** Ambient occlusion brightness YZNP */
+ public int aoBrightnessYZNP;
+ /** Ambient occlusion brightness XYZPNN */
+ public int aoBrightnessXYZPNN;
+ /** Ambient occlusion brightness XYPN */
+ public int aoBrightnessXYPN;
+ /** Ambient occlusion brightness XYZPNP */
+ public int aoBrightnessXYZPNP;
+ /** Ambient occlusion brightness XYZNPN */
+ public int aoBrightnessXYZNPN;
+ /** Ambient occlusion brightness XYNP */
+ public int aoBrightnessXYNP;
+ /** Ambient occlusion brightness XYZNPP */
+ public int aoBrightnessXYZNPP;
+ /** Ambient occlusion brightness YZPN */
+ public int aoBrightnessYZPN;
+ /** Ambient occlusion brightness XYZPPN */
+ public int aoBrightnessXYZPPN;
+ /** Ambient occlusion brightness XYPP */
+ public int aoBrightnessXYPP;
+ /** Ambient occlusion brightness YZPP */
+ public int aoBrightnessYZPP;
+ /** Ambient occlusion brightness XYZPPP */
+ public int aoBrightnessXYZPPP;
+ /** Ambient occlusion brightness XZNN */
+ public int aoBrightnessXZNN;
+ /** Ambient occlusion brightness XZPN */
+ public int aoBrightnessXZPN;
+ /** Ambient occlusion brightness XZNP */
+ public int aoBrightnessXZNP;
+ /** Ambient occlusion brightness XZPP */
+ public int aoBrightnessXZPP;
+ /** Brightness top left */
+ public int brightnessTopLeft;
+ /** Brightness bottom left */
+ public int brightnessBottomLeft;
+ /** Brightness bottom right */
+ public int brightnessBottomRight;
+ /** Brightness top right */
+ public int brightnessTopRight;
+ /** Red color value for the top left corner */
+ public float colorRedTopLeft;
+ /** Red color value for the bottom left corner */
+ public float colorRedBottomLeft;
+ /** Red color value for the bottom right corner */
+ public float colorRedBottomRight;
+ /** Red color value for the top right corner */
+ public float colorRedTopRight;
+ /** Green color value for the top left corner */
+ public float colorGreenTopLeft;
+ /** Green color value for the bottom left corner */
+ public float colorGreenBottomLeft;
+ /** Green color value for the bottom right corner */
+ public float colorGreenBottomRight;
+ /** Green color value for the top right corner */
+ public float colorGreenTopRight;
+ /** Blue color value for the top left corner */
+ public float colorBlueTopLeft;
+ /** Blue color value for the bottom left corner */
+ public float colorBlueBottomLeft;
+ /** Blue color value for the bottom right corner */
+ public float colorBlueBottomRight;
+ /** Blue color value for the top right corner */
+ public float colorBlueTopRight;
+ /** If set to >=0, all block faces will be rendered using this texture index */
+ public IIcon overrideBlockTexture;
+ /**
+ * Clear override block texture
+ */
+ public void clearOverrideBlockTexture() {
+ this.overrideBlockTexture = null;
+ }
+
+ public boolean hasOverrideBlockTexture() {
+ return this.overrideBlockTexture != null;
+ }
+
+ public IIcon getBlockIcon(Block block, IBlockAccess access, int x, int y, int z, int side) {
+ return this.getIconSafe(block.getIcon(access, x, y, z, side));
+ }
+
+ public IIcon getBlockIconFromSideAndMetadata(Block block, int side, int meta) {
+ return this.getIconSafe(block.getIcon(side, meta));
+ }
+
+ public IIcon getBlockIconFromSide(Block block, int side) {
+ return this.getIconSafe(block.getBlockTextureFromSide(side));
+ }
+
+ public IIcon getBlockIcon(Block block) {
+ return this.getIconSafe(block.getBlockTextureFromSide(1));
+ }
+
+ public IIcon getIconSafe(IIcon iicon) {
+ if (iicon == null) {
+ iicon = ((TextureMap)
+ Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture))
+ .getAtlasSprite("missingno");
+ }
+
+ return (IIcon) iicon;
+ }
+
+ IBlockAccess blockAccess = RenderBlocks.getInstance().blockAccess;
+
+ public boolean renderStandardBlockWithAmbientOcclusion(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ ITexture[][] aTextures,
+ Block block,
+ int xPos,
+ int yPos,
+ int zPos,
+ float R,
+ float G,
+ float B) {
this.enableAO = true;
boolean flag = false;
float f3 = 0.0F;
@@ -462,12 +554,9 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(983055);
- if (this.getBlockIcon(block).getIconName().equals("grass_top"))
- {
+ if (this.getBlockIcon(block).getIconName().equals("grass_top")) {
flag1 = false;
- }
- else if (this.hasOverrideBlockTexture())
- {
+ } else if (this.hasOverrideBlockTexture()) {
flag1 = false;
}
@@ -478,10 +567,9 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
int i1;
float f7;
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos, yPos - 1, zPos, 0))
- {
- if (this.renderMinY <= 0.0D)
- {
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos - 1, zPos, 0)) {
+ if (this.renderMinY <= 0.0D) {
--yPos;
}
@@ -489,92 +577,98 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
- this.aoLightValueScratchXYNN = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZNN = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZNP = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXYPN = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYNN =
+ blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNN =
+ blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNP =
+ blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPN =
+ blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
flag2 = blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getCanBlockGrass();
flag3 = blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getCanBlockGrass();
flag4 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getCanBlockGrass();
flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getCanBlockGrass();
- if (!flag5 && !flag3)
- {
+ if (!flag5 && !flag3) {
this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN;
this.aoBrightnessXYZNNN = this.aoBrightnessXYNN;
- }
- else
- {
- this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNNN =
+ blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
}
- if (!flag4 && !flag3)
- {
+ if (!flag4 && !flag3) {
this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN;
this.aoBrightnessXYZNNP = this.aoBrightnessXYNN;
- }
- else
- {
- this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNNP =
+ blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
}
- if (!flag5 && !flag2)
- {
+ if (!flag5 && !flag2) {
this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN;
this.aoBrightnessXYZPNN = this.aoBrightnessXYPN;
- }
- else
- {
- this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPNN =
+ blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
}
- if (!flag4 && !flag2)
- {
+ if (!flag4 && !flag2) {
this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN;
this.aoBrightnessXYZPNP = this.aoBrightnessXYPN;
- }
- else
- {
- this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPNP =
+ blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
}
- if (this.renderMinY <= 0.0D)
- {
+ if (this.renderMinY <= 0.0D) {
++yPos;
}
i1 = l;
- if (this.renderMinY <= 0.0D || !blockAccess.getBlock(xPos, yPos - 1, zPos).isOpaqueCube())
- {
+ if (this.renderMinY <= 0.0D
+ || !blockAccess.getBlock(xPos, yPos - 1, zPos).isOpaqueCube()) {
i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
}
f7 = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- f3 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + f7) / 4.0F;
- f6 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F;
- f5 = (f7 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F;
- f4 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + f7 + this.aoLightValueScratchYZNN) / 4.0F;
- this.brightnessTopLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, i1);
- this.brightnessTopRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, i1);
- this.brightnessBottomRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, i1);
- this.brightnessBottomLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, i1);
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.5F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.5F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.5F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F;
+ f3 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + f7)
+ / 4.0F;
+ f6 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN)
+ / 4.0F;
+ f5 = (f7 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + f7 + this.aoLightValueScratchYZNN)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.5F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.5F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.5F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F;
}
this.colorRedTopLeft *= f3;
@@ -593,10 +687,9 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
flag = true;
}
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos, yPos + 1, zPos, 1))
- {
- if (this.renderMaxY >= 1.0D)
- {
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos + 1, zPos, 1)) {
+ if (this.renderMaxY >= 1.0D) {
++yPos;
}
@@ -604,82 +697,86 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
this.aoBrightnessXYPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
this.aoBrightnessYZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
- this.aoLightValueScratchXYNP = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXYPP = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZPN = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZPP = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYNP =
+ blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPP =
+ blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPN =
+ blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPP =
+ blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
flag2 = blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getCanBlockGrass();
flag3 = blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getCanBlockGrass();
flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getCanBlockGrass();
flag5 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getCanBlockGrass();
- if (!flag5 && !flag3)
- {
+ if (!flag5 && !flag3) {
this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP;
this.aoBrightnessXYZNPN = this.aoBrightnessXYNP;
- }
- else
- {
- this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNPN =
+ blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
}
- if (!flag5 && !flag2)
- {
+ if (!flag5 && !flag2) {
this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP;
this.aoBrightnessXYZPPN = this.aoBrightnessXYPP;
- }
- else
- {
- this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPPN =
+ blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
}
- if (!flag4 && !flag3)
- {
+ if (!flag4 && !flag3) {
this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP;
this.aoBrightnessXYZNPP = this.aoBrightnessXYNP;
- }
- else
- {
- this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNPP =
+ blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
}
- if (!flag4 && !flag2)
- {
+ if (!flag4 && !flag2) {
this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP;
this.aoBrightnessXYZPPP = this.aoBrightnessXYPP;
- }
- else
- {
- this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPPP =
+ blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
}
- if (this.renderMaxY >= 1.0D)
- {
+ if (this.renderMaxY >= 1.0D) {
--yPos;
}
i1 = l;
- if (this.renderMaxY >= 1.0D || !blockAccess.getBlock(xPos, yPos + 1, zPos).isOpaqueCube())
- {
+ if (this.renderMaxY >= 1.0D
+ || !blockAccess.getBlock(xPos, yPos + 1, zPos).isOpaqueCube()) {
i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
}
f7 = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
- f6 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + f7) / 4.0F;
- f3 = (this.aoLightValueScratchYZPP + f7 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F;
- f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F;
- f5 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN) / 4.0F;
- this.brightnessTopRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, i1);
- this.brightnessTopLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, i1);
- this.brightnessBottomLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, i1);
- this.brightnessBottomRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
+ f6 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + f7)
+ / 4.0F;
+ f3 = (this.aoLightValueScratchYZPP + f7 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP)
+ / 4.0F;
+ f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN)
+ / 4.0F;
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G;
this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B;
this.colorRedTopLeft *= f3;
this.colorGreenTopLeft *= f3;
@@ -699,17 +796,20 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
IIcon iicon;
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos - 1, 2))
- {
- if (this.renderMinZ <= 0.0D)
- {
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos - 1, 2)) {
+ if (this.renderMinZ <= 0.0D) {
--zPos;
}
- this.aoLightValueScratchXZNN = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZNN = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZPN = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZPN = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNN =
+ blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPN =
+ blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPN =
+ blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
@@ -719,83 +819,85 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getCanBlockGrass();
flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getCanBlockGrass();
- if (!flag3 && !flag5)
- {
+ if (!flag3 && !flag5) {
this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
- }
- else
- {
- this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNNN =
+ blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
}
- if (!flag3 && !flag4)
- {
+ if (!flag3 && !flag4) {
this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
- }
- else
- {
- this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNPN =
+ blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
}
- if (!flag2 && !flag5)
- {
+ if (!flag2 && !flag5) {
this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
- }
- else
- {
- this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPNN =
+ blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
}
- if (!flag2 && !flag4)
- {
+ if (!flag2 && !flag4) {
this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
- }
- else
- {
- this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPPN =
+ blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
}
- if (this.renderMinZ <= 0.0D)
- {
+ if (this.renderMinZ <= 0.0D) {
++zPos;
}
i1 = l;
- if (this.renderMinZ <= 0.0D || !blockAccess.getBlock(xPos, yPos, zPos - 1).isOpaqueCube())
- {
+ if (this.renderMinZ <= 0.0D
+ || !blockAccess.getBlock(xPos, yPos, zPos - 1).isOpaqueCube()) {
i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
}
f7 = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- f3 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN) / 4.0F;
- f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F;
- f5 = (this.aoLightValueScratchYZNN + f7 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F;
- f6 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + f7) / 4.0F;
- this.brightnessTopLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
- this.brightnessBottomLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, i1);
- this.brightnessBottomRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, i1);
- this.brightnessTopRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, i1);
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.8F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.8F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.8F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
+ f3 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN)
+ / 4.0F;
+ f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchYZNN + f7 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN)
+ / 4.0F;
+ f6 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + f7)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.8F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.8F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.8F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
}
this.colorRedTopLeft *= f3;
@@ -814,8 +916,9 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
CustomOreBlockRenderer.renderFaceZNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
RenderBlocks.getInstance();
- if (RenderBlocks.fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture())
- {
+ if (RenderBlocks.fancyGrass
+ && iicon.getIconName().equals("grass_side")
+ && !this.hasOverrideBlockTexture()) {
this.colorRedTopLeft *= R;
this.colorRedBottomLeft *= R;
this.colorRedBottomRight *= R;
@@ -834,17 +937,20 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
flag = true;
}
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos + 1, 3))
- {
- if (this.renderMaxZ >= 1.0D)
- {
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos + 1, 3)) {
+ if (this.renderMaxZ >= 1.0D) {
++zPos;
}
- this.aoLightValueScratchXZNP = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZPP = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZNP = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZPP = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNP =
+ blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPP =
+ blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNP =
+ blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
@@ -854,83 +960,85 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getCanBlockGrass();
flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getCanBlockGrass();
- if (!flag3 && !flag5)
- {
+ if (!flag3 && !flag5) {
this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
- }
- else
- {
- this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNNP =
+ blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
}
- if (!flag3 && !flag4)
- {
+ if (!flag3 && !flag4) {
this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
- }
- else
- {
- this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNPP =
+ blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
}
- if (!flag2 && !flag5)
- {
+ if (!flag2 && !flag5) {
this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
- }
- else
- {
- this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPNP =
+ blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
}
- if (!flag2 && !flag4)
- {
+ if (!flag2 && !flag4) {
this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
- }
- else
- {
- this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPPP =
+ blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
}
- if (this.renderMaxZ >= 1.0D)
- {
+ if (this.renderMaxZ >= 1.0D) {
--zPos;
}
i1 = l;
- if (this.renderMaxZ >= 1.0D || !blockAccess.getBlock(xPos, yPos, zPos + 1).isOpaqueCube())
- {
+ if (this.renderMaxZ >= 1.0D
+ || !blockAccess.getBlock(xPos, yPos, zPos + 1).isOpaqueCube()) {
i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
}
f7 = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
- f3 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + f7 + this.aoLightValueScratchYZPP) / 4.0F;
- f6 = (f7 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F;
- f5 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F;
- f4 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + f7) / 4.0F;
- this.brightnessTopLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, i1);
- this.brightnessTopRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, i1);
- this.brightnessBottomRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
- this.brightnessBottomLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, i1);
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.8F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.8F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.8F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
+ f3 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + f7 + this.aoLightValueScratchYZPP)
+ / 4.0F;
+ f6 = (f7 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + f7)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.8F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.8F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.8F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
}
this.colorRedTopLeft *= f3;
@@ -949,8 +1057,9 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
CustomOreBlockRenderer.renderFaceZPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
RenderBlocks.getInstance();
- if (RenderBlocks.fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture())
- {
+ if (RenderBlocks.fancyGrass
+ && iicon.getIconName().equals("grass_side")
+ && !this.hasOverrideBlockTexture()) {
this.colorRedTopLeft *= R;
this.colorRedBottomLeft *= R;
this.colorRedBottomRight *= R;
@@ -969,17 +1078,20 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
flag = true;
}
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos - 1, yPos, zPos, 4))
- {
- if (this.renderMinX <= 0.0D)
- {
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos - 1, yPos, zPos, 4)) {
+ if (this.renderMinX <= 0.0D) {
--xPos;
}
- this.aoLightValueScratchXYNN = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZNN = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZNP = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXYNP = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYNN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNN =
+ blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNP =
+ blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYNP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
@@ -989,83 +1101,85 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
flag4 = blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getCanBlockGrass();
flag5 = blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getCanBlockGrass();
- if (!flag4 && !flag3)
- {
+ if (!flag4 && !flag3) {
this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
- }
- else
- {
- this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNNN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
}
- if (!flag5 && !flag3)
- {
+ if (!flag5 && !flag3) {
this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
- }
- else
- {
- this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNNP =
+ blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
}
- if (!flag4 && !flag2)
- {
+ if (!flag4 && !flag2) {
this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
- }
- else
- {
- this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNPN =
+ blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
}
- if (!flag5 && !flag2)
- {
+ if (!flag5 && !flag2) {
this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
- }
- else
- {
- this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZNPP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
}
- if (this.renderMinX <= 0.0D)
- {
+ if (this.renderMinX <= 0.0D) {
++xPos;
}
i1 = l;
- if (this.renderMinX <= 0.0D || !blockAccess.getBlock(xPos - 1, yPos, zPos).isOpaqueCube())
- {
+ if (this.renderMinX <= 0.0D
+ || !blockAccess.getBlock(xPos - 1, yPos, zPos).isOpaqueCube()) {
i1 = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
}
f7 = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- f6 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + f7 + this.aoLightValueScratchXZNP) / 4.0F;
- f3 = (f7 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F;
- f4 = (this.aoLightValueScratchXZNN + f7 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F;
- f5 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + f7) / 4.0F;
- this.brightnessTopRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, i1);
- this.brightnessTopLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, i1);
- this.brightnessBottomLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, i1);
- this.brightnessBottomRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, i1);
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.6F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.6F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.6F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
+ f6 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + f7 + this.aoLightValueScratchXZNP)
+ / 4.0F;
+ f3 = (f7 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXZNN + f7 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + f7)
+ / 4.0F;
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.6F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.6F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.6F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
}
this.colorRedTopLeft *= f3;
@@ -1084,8 +1198,9 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
CustomOreBlockRenderer.renderFaceXNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
RenderBlocks.getInstance();
- if (RenderBlocks.fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture())
- {
+ if (RenderBlocks.fancyGrass
+ && iicon.getIconName().equals("grass_side")
+ && !this.hasOverrideBlockTexture()) {
this.colorRedTopLeft *= R;
this.colorRedBottomLeft *= R;
this.colorRedBottomRight *= R;
@@ -1104,17 +1219,20 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
flag = true;
}
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos + 1, yPos, zPos, 5))
- {
- if (this.renderMaxX >= 1.0D)
- {
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos + 1, yPos, zPos, 5)) {
+ if (this.renderMaxX >= 1.0D) {
++xPos;
}
- this.aoLightValueScratchXYPN = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZPN = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZPP = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXYPP = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPN =
+ blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPP =
+ blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
this.aoBrightnessXZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
@@ -1124,83 +1242,85 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
flag4 = blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getCanBlockGrass();
flag5 = blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getCanBlockGrass();
- if (!flag3 && !flag5)
- {
+ if (!flag3 && !flag5) {
this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
- }
- else
- {
- this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPNN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
}
- if (!flag3 && !flag4)
- {
+ if (!flag3 && !flag4) {
this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
- }
- else
- {
- this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPNP =
+ blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
}
- if (!flag2 && !flag5)
- {
+ if (!flag2 && !flag5) {
this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
- }
- else
- {
- this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPPN =
+ blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
}
- if (!flag2 && !flag4)
- {
+ if (!flag2 && !flag4) {
this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
- }
- else
- {
- this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getAmbientOcclusionLightValue();
+ } else {
+ this.aoLightValueScratchXYZPPP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getAmbientOcclusionLightValue();
this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
}
- if (this.renderMaxX >= 1.0D)
- {
+ if (this.renderMaxX >= 1.0D) {
--xPos;
}
i1 = l;
- if (this.renderMaxX >= 1.0D || !blockAccess.getBlock(xPos + 1, yPos, zPos).isOpaqueCube())
- {
+ if (this.renderMaxX >= 1.0D
+ || !blockAccess.getBlock(xPos + 1, yPos, zPos).isOpaqueCube()) {
i1 = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
}
f7 = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
- f3 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + f7 + this.aoLightValueScratchXZPP) / 4.0F;
- f4 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + f7) / 4.0F;
- f5 = (this.aoLightValueScratchXZPN + f7 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F;
- f6 = (f7 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP) / 4.0F;
- this.brightnessTopLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
- this.brightnessTopRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, i1);
- this.brightnessBottomRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, i1);
- this.brightnessBottomLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, i1);
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.6F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.6F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.6F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
+ f3 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + f7 + this.aoLightValueScratchXZPP)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + f7)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchXZPN + f7 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP)
+ / 4.0F;
+ f6 = (f7 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.6F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.6F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.6F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
}
this.colorRedTopLeft *= f3;
@@ -1219,8 +1339,9 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
CustomOreBlockRenderer.renderFaceXPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
RenderBlocks.getInstance();
- if (RenderBlocks.fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture())
- {
+ if (RenderBlocks.fancyGrass
+ && iicon.getIconName().equals("grass_side")
+ && !this.hasOverrideBlockTexture()) {
this.colorRedTopLeft *= R;
this.colorRedBottomLeft *= R;
this.colorRedBottomRight *= R;
@@ -1242,842 +1363,1071 @@ public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
this.enableAO = false;
return flag;
}
-
- /**
- * Renders non-full-cube block with ambient occusion. Args: block, x, y, z, red, green, blue (lighting)
- */
- public boolean renderStandardBlockWithAmbientOcclusionPartial(IBlockAccess aWorld, RenderBlocks aRenderer, ITexture[][] aTextures, Block block, int xPos, int yPos, int zPos, float R, float G, float B)
- {
- this.enableAO = true;
- boolean flag = false;
- float f3 = 0.0F;
- float f4 = 0.0F;
- float f5 = 0.0F;
- float f6 = 0.0F;
- boolean flag1 = true;
- int l = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos);
- Tessellator tessellator = Tessellator.instance;
- tessellator.setBrightness(983055);
-
- if (this.getBlockIcon(block).getIconName().equals("grass_top"))
- {
- flag1 = false;
- }
- else if (this.hasOverrideBlockTexture())
- {
- flag1 = false;
- }
-
- boolean flag2;
- boolean flag3;
- boolean flag4;
- boolean flag5;
- int i1;
- float f7;
-
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos, yPos - 1, zPos, 0))
- {
- if (this.renderMinY <= 0.0D)
- {
- --yPos;
- }
-
- this.aoBrightnessXYNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
- this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
- this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
- this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
- this.aoLightValueScratchXYNN = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZNN = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZNP = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXYPN = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
- flag2 = blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getCanBlockGrass();
- flag3 = blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getCanBlockGrass();
- flag4 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getCanBlockGrass();
- flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getCanBlockGrass();
-
- if (!flag5 && !flag3)
- {
- this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN;
- this.aoBrightnessXYZNNN = this.aoBrightnessXYNN;
- }
- else
- {
- this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
- }
-
- if (!flag4 && !flag3)
- {
- this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN;
- this.aoBrightnessXYZNNP = this.aoBrightnessXYNN;
- }
- else
- {
- this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
- }
-
- if (!flag5 && !flag2)
- {
- this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN;
- this.aoBrightnessXYZPNN = this.aoBrightnessXYPN;
- }
- else
- {
- this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
- }
-
- if (!flag4 && !flag2)
- {
- this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN;
- this.aoBrightnessXYZPNP = this.aoBrightnessXYPN;
- }
- else
- {
- this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
- }
-
- if (this.renderMinY <= 0.0D)
- {
- ++yPos;
- }
-
- i1 = l;
-
- if (this.renderMinY <= 0.0D || !blockAccess.getBlock(xPos, yPos - 1, zPos).isOpaqueCube())
- {
- i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
- }
-
- f7 = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- f3 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + f7) / 4.0F;
- f6 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F;
- f5 = (f7 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F;
- f4 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + f7 + this.aoLightValueScratchYZNN) / 4.0F;
- this.brightnessTopLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, i1);
- this.brightnessTopRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, i1);
- this.brightnessBottomRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, i1);
- this.brightnessBottomLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, i1);
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.5F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.5F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.5F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F;
- }
-
- this.colorRedTopLeft *= f3;
- this.colorGreenTopLeft *= f3;
- this.colorBlueTopLeft *= f3;
- this.colorRedBottomLeft *= f4;
- this.colorGreenBottomLeft *= f4;
- this.colorBlueBottomLeft *= f4;
- this.colorRedBottomRight *= f5;
- this.colorGreenBottomRight *= f5;
- this.colorBlueBottomRight *= f5;
- this.colorRedTopRight *= f6;
- this.colorGreenTopRight *= f6;
- this.colorBlueTopRight *= f6;
- CustomOreBlockRenderer.renderFaceYNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
- flag = true;
- }
-
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos, yPos + 1, zPos, 1))
- {
- if (this.renderMaxY >= 1.0D)
- {
- ++yPos;
- }
-
- this.aoBrightnessXYNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
- this.aoBrightnessXYPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
- this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
- this.aoBrightnessYZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
- this.aoLightValueScratchXYNP = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXYPP = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZPN = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZPP = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
- flag2 = blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getCanBlockGrass();
- flag3 = blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getCanBlockGrass();
- flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getCanBlockGrass();
- flag5 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getCanBlockGrass();
-
- if (!flag5 && !flag3)
- {
- this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP;
- this.aoBrightnessXYZNPN = this.aoBrightnessXYNP;
- }
- else
- {
- this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
- }
-
- if (!flag5 && !flag2)
- {
- this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP;
- this.aoBrightnessXYZPPN = this.aoBrightnessXYPP;
- }
- else
- {
- this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
- }
-
- if (!flag4 && !flag3)
- {
- this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP;
- this.aoBrightnessXYZNPP = this.aoBrightnessXYNP;
- }
- else
- {
- this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
- }
-
- if (!flag4 && !flag2)
- {
- this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP;
- this.aoBrightnessXYZPPP = this.aoBrightnessXYPP;
- }
- else
- {
- this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
- }
-
- if (this.renderMaxY >= 1.0D)
- {
- --yPos;
- }
-
- i1 = l;
-
- if (this.renderMaxY >= 1.0D || !blockAccess.getBlock(xPos, yPos + 1, zPos).isOpaqueCube())
- {
- i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
- }
-
- f7 = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
- f6 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + f7) / 4.0F;
- f3 = (this.aoLightValueScratchYZPP + f7 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F;
- f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F;
- f5 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN) / 4.0F;
- this.brightnessTopRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, i1);
- this.brightnessTopLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, i1);
- this.brightnessBottomLeft = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, i1);
- this.brightnessBottomRight = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B;
- this.colorRedTopLeft *= f3;
- this.colorGreenTopLeft *= f3;
- this.colorBlueTopLeft *= f3;
- this.colorRedBottomLeft *= f4;
- this.colorGreenBottomLeft *= f4;
- this.colorBlueBottomLeft *= f4;
- this.colorRedBottomRight *= f5;
- this.colorGreenBottomRight *= f5;
- this.colorBlueBottomRight *= f5;
- this.colorRedTopRight *= f6;
- this.colorGreenTopRight *= f6;
- this.colorBlueTopRight *= f6;
- CustomOreBlockRenderer.renderFaceYPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
- flag = true;
- }
-
- float f8;
- float f9;
- float f10;
- float f11;
- int j1;
- int k1;
- int l1;
- int i2;
- IIcon iicon;
-
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos - 1, 2))
- {
- if (this.renderMinZ <= 0.0D)
- {
- --zPos;
- }
-
- this.aoLightValueScratchXZNN = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZNN = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZPN = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZPN = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
- this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
- this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
- this.aoBrightnessXZPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
- flag2 = blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getCanBlockGrass();
- flag3 = blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getCanBlockGrass();
- flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getCanBlockGrass();
- flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getCanBlockGrass();
-
- if (!flag3 && !flag5)
- {
- this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
- this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
- }
- else
- {
- this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
- }
-
- if (!flag3 && !flag4)
- {
- this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
- this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
- }
- else
- {
- this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
- }
-
- if (!flag2 && !flag5)
- {
- this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
- this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
- }
- else
- {
- this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
- }
-
- if (!flag2 && !flag4)
- {
- this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
- this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
- }
- else
- {
- this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
- }
-
- if (this.renderMinZ <= 0.0D)
- {
- ++zPos;
- }
-
- i1 = l;
-
- if (this.renderMinZ <= 0.0D || !blockAccess.getBlock(xPos, yPos, zPos - 1).isOpaqueCube())
- {
- i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
- }
-
- f7 = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- f8 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN) / 4.0F;
- f9 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F;
- f10 = (this.aoLightValueScratchYZNN + f7 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F;
- f11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + f7) / 4.0F;
- f3 = (float)((double)f8 * this.renderMaxY * (1.0D - this.renderMinX) + (double)f9 * this.renderMaxY * this.renderMinX + (double)f10 * (1.0D - this.renderMaxY) * this.renderMinX + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX));
- f4 = (float)((double)f8 * this.renderMaxY * (1.0D - this.renderMaxX) + (double)f9 * this.renderMaxY * this.renderMaxX + (double)f10 * (1.0D - this.renderMaxY) * this.renderMaxX + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX));
- f5 = (float)((double)f8 * this.renderMinY * (1.0D - this.renderMaxX) + (double)f9 * this.renderMinY * this.renderMaxX + (double)f10 * (1.0D - this.renderMinY) * this.renderMaxX + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX));
- f6 = (float)((double)f8 * this.renderMinY * (1.0D - this.renderMinX) + (double)f9 * this.renderMinY * this.renderMinX + (double)f10 * (1.0D - this.renderMinY) * this.renderMinX + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX));
- j1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
- k1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, i1);
- l1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, i1);
- i2 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, i1);
- this.brightnessTopLeft = RenderBlocks.getInstance().mixAoBrightness(j1, k1, l1, i2, this.renderMaxY * (1.0D - this.renderMinX), this.renderMaxY * this.renderMinX, (1.0D - this.renderMaxY) * this.renderMinX, (1.0D - this.renderMaxY) * (1.0D - this.renderMinX));
- this.brightnessBottomLeft = RenderBlocks.getInstance().mixAoBrightness(j1, k1, l1, i2, this.renderMaxY * (1.0D - this.renderMaxX), this.renderMaxY * this.renderMaxX, (1.0D - this.renderMaxY) * this.renderMaxX, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX));
- this.brightnessBottomRight = RenderBlocks.getInstance().mixAoBrightness(j1, k1, l1, i2, this.renderMinY * (1.0D - this.renderMaxX), this.renderMinY * this.renderMaxX, (1.0D - this.renderMinY) * this.renderMaxX, (1.0D - this.renderMinY) * (1.0D - this.renderMaxX));
- this.brightnessTopRight = RenderBlocks.getInstance().mixAoBrightness(j1, k1, l1, i2, this.renderMinY * (1.0D - this.renderMinX), this.renderMinY * this.renderMinX, (1.0D - this.renderMinY) * this.renderMinX, (1.0D - this.renderMinY) * (1.0D - this.renderMinX));
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.8F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.8F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.8F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
- }
-
- this.colorRedTopLeft *= f3;
- this.colorGreenTopLeft *= f3;
- this.colorBlueTopLeft *= f3;
- this.colorRedBottomLeft *= f4;
- this.colorGreenBottomLeft *= f4;
- this.colorBlueBottomLeft *= f4;
- this.colorRedBottomRight *= f5;
- this.colorGreenBottomRight *= f5;
- this.colorBlueBottomRight *= f5;
- this.colorRedTopRight *= f6;
- this.colorGreenTopRight *= f6;
- this.colorBlueTopRight *= f6;
- iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 2);
- CustomOreBlockRenderer.renderFaceZNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
-
- RenderBlocks.getInstance();
- if (RenderBlocks.fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture())
- {
- this.colorRedTopLeft *= R;
- this.colorRedBottomLeft *= R;
- this.colorRedBottomRight *= R;
- this.colorRedTopRight *= R;
- this.colorGreenTopLeft *= G;
- this.colorGreenBottomLeft *= G;
- this.colorGreenBottomRight *= G;
- this.colorGreenTopRight *= G;
- this.colorBlueTopLeft *= B;
- this.colorBlueBottomLeft *= B;
- this.colorBlueBottomRight *= B;
- this.colorBlueTopRight *= B;
- CustomOreBlockRenderer.renderFaceZNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
- }
-
- flag = true;
- }
-
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos + 1, 3))
- {
- if (this.renderMaxZ >= 1.0D)
- {
- ++zPos;
- }
-
- this.aoLightValueScratchXZNP = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZPP = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZNP = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchYZPP = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
- this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
- this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
- this.aoBrightnessYZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
- flag2 = blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getCanBlockGrass();
- flag3 = blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getCanBlockGrass();
- flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getCanBlockGrass();
- flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getCanBlockGrass();
-
- if (!flag3 && !flag5)
- {
- this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
- this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
- }
- else
- {
- this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
- }
-
- if (!flag3 && !flag4)
- {
- this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
- this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
- }
- else
- {
- this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
- }
-
- if (!flag2 && !flag5)
- {
- this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
- this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
- }
- else
- {
- this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
- }
-
- if (!flag2 && !flag4)
- {
- this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
- this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
- }
- else
- {
- this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
- }
-
- if (this.renderMaxZ >= 1.0D)
- {
- --zPos;
- }
-
- i1 = l;
-
- if (this.renderMaxZ >= 1.0D || !blockAccess.getBlock(xPos, yPos, zPos + 1).isOpaqueCube())
- {
- i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
- }
-
- f7 = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
- f8 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + f7 + this.aoLightValueScratchYZPP) / 4.0F;
- f9 = (f7 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F;
- f10 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F;
- f11 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + f7) / 4.0F;
- f3 = (float)((double)f8 * this.renderMaxY * (1.0D - this.renderMinX) + (double)f9 * this.renderMaxY * this.renderMinX + (double)f10 * (1.0D - this.renderMaxY) * this.renderMinX + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX));
- f4 = (float)((double)f8 * this.renderMinY * (1.0D - this.renderMinX) + (double)f9 * this.renderMinY * this.renderMinX + (double)f10 * (1.0D - this.renderMinY) * this.renderMinX + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX));
- f5 = (float)((double)f8 * this.renderMinY * (1.0D - this.renderMaxX) + (double)f9 * this.renderMinY * this.renderMaxX + (double)f10 * (1.0D - this.renderMinY) * this.renderMaxX + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX));
- f6 = (float)((double)f8 * this.renderMaxY * (1.0D - this.renderMaxX) + (double)f9 * this.renderMaxY * this.renderMaxX + (double)f10 * (1.0D - this.renderMaxY) * this.renderMaxX + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX));
- j1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, i1);
- k1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, i1);
- l1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
- i2 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, i1);
- this.brightnessTopLeft = RenderBlocks.getInstance().mixAoBrightness(j1, i2, l1, k1, this.renderMaxY * (1.0D - this.renderMinX), (1.0D - this.renderMaxY) * (1.0D - this.renderMinX), (1.0D - this.renderMaxY) * this.renderMinX, this.renderMaxY * this.renderMinX);
- this.brightnessBottomLeft = RenderBlocks.getInstance().mixAoBrightness(j1, i2, l1, k1, this.renderMinY * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * this.renderMinX, this.renderMinY * this.renderMinX);
- this.brightnessBottomRight = RenderBlocks.getInstance().mixAoBrightness(j1, i2, l1, k1, this.renderMinY * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * this.renderMaxX, this.renderMinY * this.renderMaxX);
- this.brightnessTopRight = RenderBlocks.getInstance().mixAoBrightness(j1, i2, l1, k1, this.renderMaxY * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * this.renderMaxX, this.renderMaxY * this.renderMaxX);
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.8F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.8F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.8F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
- }
-
- this.colorRedTopLeft *= f3;
- this.colorGreenTopLeft *= f3;
- this.colorBlueTopLeft *= f3;
- this.colorRedBottomLeft *= f4;
- this.colorGreenBottomLeft *= f4;
- this.colorBlueBottomLeft *= f4;
- this.colorRedBottomRight *= f5;
- this.colorGreenBottomRight *= f5;
- this.colorBlueBottomRight *= f5;
- this.colorRedTopRight *= f6;
- this.colorGreenTopRight *= f6;
- this.colorBlueTopRight *= f6;
- iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 3);
- CustomOreBlockRenderer.renderFaceZPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
-
- RenderBlocks.getInstance();
- if (RenderBlocks.fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture())
- {
- this.colorRedTopLeft *= R;
- this.colorRedBottomLeft *= R;
- this.colorRedBottomRight *= R;
- this.colorRedTopRight *= R;
- this.colorGreenTopLeft *= G;
- this.colorGreenBottomLeft *= G;
- this.colorGreenBottomRight *= G;
- this.colorGreenTopRight *= G;
- this.colorBlueTopLeft *= B;
- this.colorBlueBottomLeft *= B;
- this.colorBlueBottomRight *= B;
- this.colorBlueTopRight *= B;
- CustomOreBlockRenderer.renderFaceZPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
- }
-
- flag = true;
- }
-
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos - 1, yPos, zPos, 4))
- {
- if (this.renderMinX <= 0.0D)
- {
- --xPos;
- }
-
- this.aoLightValueScratchXYNN = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZNN = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZNP = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXYNP = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
- this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
- this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
- this.aoBrightnessXYNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
- flag2 = blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getCanBlockGrass();
- flag3 = blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getCanBlockGrass();
- flag4 = blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getCanBlockGrass();
- flag5 = blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getCanBlockGrass();
-
- if (!flag4 && !flag3)
- {
- this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
- this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
- }
- else
- {
- this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
- }
-
- if (!flag5 && !flag3)
- {
- this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
- this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
- }
- else
- {
- this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
- }
-
- if (!flag4 && !flag2)
- {
- this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
- this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
- }
- else
- {
- this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
- }
-
- if (!flag5 && !flag2)
- {
- this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
- this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
- }
- else
- {
- this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
- }
-
- if (this.renderMinX <= 0.0D)
- {
- ++xPos;
- }
-
- i1 = l;
-
- if (this.renderMinX <= 0.0D || !blockAccess.getBlock(xPos - 1, yPos, zPos).isOpaqueCube())
- {
- i1 = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
- }
-
- f7 = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
- f8 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + f7 + this.aoLightValueScratchXZNP) / 4.0F;
- f9 = (f7 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F;
- f10 = (this.aoLightValueScratchXZNN + f7 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F;
- f11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + f7) / 4.0F;
- f3 = (float)((double)f9 * this.renderMaxY * this.renderMaxZ + (double)f10 * this.renderMaxY * (1.0D - this.renderMaxZ) + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ) + (double)f8 * (1.0D - this.renderMaxY) * this.renderMaxZ);
- f4 = (float)((double)f9 * this.renderMaxY * this.renderMinZ + (double)f10 * this.renderMaxY * (1.0D - this.renderMinZ) + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ) + (double)f8 * (1.0D - this.renderMaxY) * this.renderMinZ);
- f5 = (float)((double)f9 * this.renderMinY * this.renderMinZ + (double)f10 * this.renderMinY * (1.0D - this.renderMinZ) + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ) + (double)f8 * (1.0D - this.renderMinY) * this.renderMinZ);
- f6 = (float)((double)f9 * this.renderMinY * this.renderMaxZ + (double)f10 * this.renderMinY * (1.0D - this.renderMaxZ) + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ) + (double)f8 * (1.0D - this.renderMinY) * this.renderMaxZ);
- j1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, i1);
- k1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, i1);
- l1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, i1);
- i2 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, i1);
- this.brightnessTopLeft = RenderBlocks.getInstance().mixAoBrightness(k1, l1, i2, j1, this.renderMaxY * this.renderMaxZ, this.renderMaxY * (1.0D - this.renderMaxZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMaxY) * this.renderMaxZ);
- this.brightnessBottomLeft = RenderBlocks.getInstance().mixAoBrightness(k1, l1, i2, j1, this.renderMaxY * this.renderMinZ, this.renderMaxY * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * this.renderMinZ);
- this.brightnessBottomRight = RenderBlocks.getInstance().mixAoBrightness(k1, l1, i2, j1, this.renderMinY * this.renderMinZ, this.renderMinY * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * this.renderMinZ);
- this.brightnessTopRight = RenderBlocks.getInstance().mixAoBrightness(k1, l1, i2, j1, this.renderMinY * this.renderMaxZ, this.renderMinY * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * this.renderMaxZ);
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.6F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.6F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.6F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
- }
-
- this.colorRedTopLeft *= f3;
- this.colorGreenTopLeft *= f3;
- this.colorBlueTopLeft *= f3;
- this.colorRedBottomLeft *= f4;
- this.colorGreenBottomLeft *= f4;
- this.colorBlueBottomLeft *= f4;
- this.colorRedBottomRight *= f5;
- this.colorGreenBottomRight *= f5;
- this.colorBlueBottomRight *= f5;
- this.colorRedTopRight *= f6;
- this.colorGreenTopRight *= f6;
- this.colorBlueTopRight *= f6;
- iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 4);
- CustomOreBlockRenderer.renderFaceXNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
-
- RenderBlocks.getInstance();
- if (RenderBlocks.fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture())
- {
- this.colorRedTopLeft *= R;
- this.colorRedBottomLeft *= R;
- this.colorRedBottomRight *= R;
- this.colorRedTopRight *= R;
- this.colorGreenTopLeft *= G;
- this.colorGreenBottomLeft *= G;
- this.colorGreenBottomRight *= G;
- this.colorGreenTopRight *= G;
- this.colorBlueTopLeft *= B;
- this.colorBlueBottomLeft *= B;
- this.colorBlueBottomRight *= B;
- this.colorBlueTopRight *= B;
- CustomOreBlockRenderer.renderFaceXNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
- }
-
- flag = true;
- }
-
- if (RenderBlocks.getInstance().renderAllFaces || block.shouldSideBeRendered(blockAccess, xPos + 1, yPos, zPos, 5))
- {
- if (this.renderMaxX >= 1.0D)
- {
- ++xPos;
- }
-
- this.aoLightValueScratchXYPN = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZPN = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXZPP = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
- this.aoLightValueScratchXYPP = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
- this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
- this.aoBrightnessXZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
- this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
- this.aoBrightnessXYPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
- flag2 = blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getCanBlockGrass();
- flag3 = blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getCanBlockGrass();
- flag4 = blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getCanBlockGrass();
- flag5 = blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getCanBlockGrass();
-
- if (!flag3 && !flag5)
- {
- this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
- this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
- }
- else
- {
- this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
- }
-
- if (!flag3 && !flag4)
- {
- this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
- this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
- }
- else
- {
- this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
- }
-
- if (!flag2 && !flag5)
- {
- this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
- this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
- }
- else
- {
- this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
- }
-
- if (!flag2 && !flag4)
- {
- this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
- this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
- }
- else
- {
- this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getAmbientOcclusionLightValue();
- this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
- }
-
- if (this.renderMaxX >= 1.0D)
- {
- --xPos;
- }
-
- i1 = l;
-
- if (this.renderMaxX >= 1.0D || !blockAccess.getBlock(xPos + 1, yPos, zPos).isOpaqueCube())
- {
- i1 = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
- }
-
- f7 = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
- f8 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + f7 + this.aoLightValueScratchXZPP) / 4.0F;
- f9 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + f7) / 4.0F;
- f10 = (this.aoLightValueScratchXZPN + f7 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F;
- f11 = (f7 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP) / 4.0F;
- f3 = (float)((double)f8 * (1.0D - this.renderMinY) * this.renderMaxZ + (double)f9 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ) + (double)f10 * this.renderMinY * (1.0D - this.renderMaxZ) + (double)f11 * this.renderMinY * this.renderMaxZ);
- f4 = (float)((double)f8 * (1.0D - this.renderMinY) * this.renderMinZ + (double)f9 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ) + (double)f10 * this.renderMinY * (1.0D - this.renderMinZ) + (double)f11 * this.renderMinY * this.renderMinZ);
- f5 = (float)((double)f8 * (1.0D - this.renderMaxY) * this.renderMinZ + (double)f9 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ) + (double)f10 * this.renderMaxY * (1.0D - this.renderMinZ) + (double)f11 * this.renderMaxY * this.renderMinZ);
- f6 = (float)((double)f8 * (1.0D - this.renderMaxY) * this.renderMaxZ + (double)f9 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ) + (double)f10 * this.renderMaxY * (1.0D - this.renderMaxZ) + (double)f11 * this.renderMaxY * this.renderMaxZ);
- j1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
- k1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, i1);
- l1 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, i1);
- i2 = RenderBlocks.getInstance().getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, i1);
- this.brightnessTopLeft = RenderBlocks.getInstance().mixAoBrightness(j1, i2, l1, k1, (1.0D - this.renderMinY) * this.renderMaxZ, (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), this.renderMinY * (1.0D - this.renderMaxZ), this.renderMinY * this.renderMaxZ);
- this.brightnessBottomLeft = RenderBlocks.getInstance().mixAoBrightness(j1, i2, l1, k1, (1.0D - this.renderMinY) * this.renderMinZ, (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), this.renderMinY * (1.0D - this.renderMinZ), this.renderMinY * this.renderMinZ);
- this.brightnessBottomRight = RenderBlocks.getInstance().mixAoBrightness(j1, i2, l1, k1, (1.0D - this.renderMaxY) * this.renderMinZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), this.renderMaxY * (1.0D - this.renderMinZ), this.renderMaxY * this.renderMinZ);
- this.brightnessTopRight = RenderBlocks.getInstance().mixAoBrightness(j1, i2, l1, k1, (1.0D - this.renderMaxY) * this.renderMaxZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), this.renderMaxY * (1.0D - this.renderMaxZ), this.renderMaxY * this.renderMaxZ);
-
- if (flag1)
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.6F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.6F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.6F;
- }
- else
- {
- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
- }
-
- this.colorRedTopLeft *= f3;
- this.colorGreenTopLeft *= f3;
- this.colorBlueTopLeft *= f3;
- this.colorRedBottomLeft *= f4;
- this.colorGreenBottomLeft *= f4;
- this.colorBlueBottomLeft *= f4;
- this.colorRedBottomRight *= f5;
- this.colorGreenBottomRight *= f5;
- this.colorBlueBottomRight *= f5;
- this.colorRedTopRight *= f6;
- this.colorGreenTopRight *= f6;
- this.colorBlueTopRight *= f6;
- iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 5);
- CustomOreBlockRenderer.renderFaceXPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
-
- RenderBlocks.getInstance();
- if (RenderBlocks.fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture())
- {
- this.colorRedTopLeft *= R;
- this.colorRedBottomLeft *= R;
- this.colorRedBottomRight *= R;
- this.colorRedTopRight *= R;
- this.colorGreenTopLeft *= G;
- this.colorGreenBottomLeft *= G;
- this.colorGreenBottomRight *= G;
- this.colorGreenTopRight *= G;
- this.colorBlueTopLeft *= B;
- this.colorBlueBottomLeft *= B;
- this.colorBlueBottomRight *= B;
- this.colorBlueTopRight *= B;
- CustomOreBlockRenderer.renderFaceXPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
- }
-
- flag = true;
- }
-
- this.enableAO = false;
- return flag;
- }
+ /**
+ * Renders non-full-cube block with ambient occusion. Args: block, x, y, z, red, green, blue (lighting)
+ */
+ public boolean renderStandardBlockWithAmbientOcclusionPartial(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ ITexture[][] aTextures,
+ Block block,
+ int xPos,
+ int yPos,
+ int zPos,
+ float R,
+ float G,
+ float B) {
+ this.enableAO = true;
+ boolean flag = false;
+ float f3 = 0.0F;
+ float f4 = 0.0F;
+ float f5 = 0.0F;
+ float f6 = 0.0F;
+ boolean flag1 = true;
+ int l = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos);
+ Tessellator tessellator = Tessellator.instance;
+ tessellator.setBrightness(983055);
+
+ if (this.getBlockIcon(block).getIconName().equals("grass_top")) {
+ flag1 = false;
+ } else if (this.hasOverrideBlockTexture()) {
+ flag1 = false;
+ }
+
+ boolean flag2;
+ boolean flag3;
+ boolean flag4;
+ boolean flag5;
+ int i1;
+ float f7;
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos - 1, zPos, 0)) {
+ if (this.renderMinY <= 0.0D) {
+ --yPos;
+ }
+
+ this.aoBrightnessXYNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ this.aoLightValueScratchXYNN =
+ blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNN =
+ blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNP =
+ blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPN =
+ blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
+ flag2 = blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getCanBlockGrass();
+
+ if (!flag5 && !flag3) {
+ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN;
+ this.aoBrightnessXYZNNN = this.aoBrightnessXYNN;
+ } else {
+ this.aoLightValueScratchXYZNNN =
+ blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
+ }
+
+ if (!flag4 && !flag3) {
+ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN;
+ this.aoBrightnessXYZNNP = this.aoBrightnessXYNN;
+ } else {
+ this.aoLightValueScratchXYZNNP =
+ blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
+ }
+
+ if (!flag5 && !flag2) {
+ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN;
+ this.aoBrightnessXYZPNN = this.aoBrightnessXYPN;
+ } else {
+ this.aoLightValueScratchXYZPNN =
+ blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
+ }
+
+ if (!flag4 && !flag2) {
+ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN;
+ this.aoBrightnessXYZPNP = this.aoBrightnessXYPN;
+ } else {
+ this.aoLightValueScratchXYZPNP =
+ blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
+ }
+
+ if (this.renderMinY <= 0.0D) {
+ ++yPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMinY <= 0.0D
+ || !blockAccess.getBlock(xPos, yPos - 1, zPos).isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ f3 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + f7)
+ / 4.0F;
+ f6 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN)
+ / 4.0F;
+ f5 = (f7 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + f7 + this.aoLightValueScratchYZNN)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.5F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.5F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.5F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ CustomOreBlockRenderer.renderFaceYNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos + 1, zPos, 1)) {
+ if (this.renderMaxY >= 1.0D) {
+ ++yPos;
+ }
+
+ this.aoBrightnessXYNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessXYPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessYZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoLightValueScratchXYNP =
+ blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPP =
+ blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPN =
+ blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPP =
+ blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ flag2 = blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getCanBlockGrass();
+
+ if (!flag5 && !flag3) {
+ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP;
+ this.aoBrightnessXYZNPN = this.aoBrightnessXYNP;
+ } else {
+ this.aoLightValueScratchXYZNPN =
+ blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
+ }
+
+ if (!flag5 && !flag2) {
+ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP;
+ this.aoBrightnessXYZPPN = this.aoBrightnessXYPP;
+ } else {
+ this.aoLightValueScratchXYZPPN =
+ blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
+ }
+
+ if (!flag4 && !flag3) {
+ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP;
+ this.aoBrightnessXYZNPP = this.aoBrightnessXYNP;
+ } else {
+ this.aoLightValueScratchXYZNPP =
+ blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
+ }
+
+ if (!flag4 && !flag2) {
+ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP;
+ this.aoBrightnessXYZPPP = this.aoBrightnessXYPP;
+ } else {
+ this.aoLightValueScratchXYZPPP =
+ blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
+ }
+
+ if (this.renderMaxY >= 1.0D) {
+ --yPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMaxY >= 1.0D
+ || !blockAccess.getBlock(xPos, yPos + 1, zPos).isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ f6 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + f7)
+ / 4.0F;
+ f3 = (this.aoLightValueScratchYZPP + f7 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP)
+ / 4.0F;
+ f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN)
+ / 4.0F;
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B;
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ CustomOreBlockRenderer.renderFaceYPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ flag = true;
+ }
+
+ float f8;
+ float f9;
+ float f10;
+ float f11;
+ int j1;
+ int k1;
+ int l1;
+ int i2;
+ IIcon iicon;
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos - 1, 2)) {
+ if (this.renderMinZ <= 0.0D) {
+ --zPos;
+ }
+
+ this.aoLightValueScratchXZNN =
+ blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPN =
+ blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPN =
+ blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ this.aoBrightnessXZPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ flag2 = blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getCanBlockGrass();
+
+ if (!flag3 && !flag5) {
+ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNNN =
+ blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
+ }
+
+ if (!flag3 && !flag4) {
+ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNPN =
+ blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
+ }
+
+ if (!flag2 && !flag5) {
+ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPNN =
+ blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
+ }
+
+ if (!flag2 && !flag4) {
+ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPPN =
+ blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
+ }
+
+ if (this.renderMinZ <= 0.0D) {
+ ++zPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMinZ <= 0.0D
+ || !blockAccess.getBlock(xPos, yPos, zPos - 1).isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ f8 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN)
+ / 4.0F;
+ f9 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN)
+ / 4.0F;
+ f10 = (this.aoLightValueScratchYZNN + f7 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN)
+ / 4.0F;
+ f11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + f7)
+ / 4.0F;
+ f3 = (float) ((double) f8 * this.renderMaxY * (1.0D - this.renderMinX)
+ + (double) f9 * this.renderMaxY * this.renderMinX
+ + (double) f10 * (1.0D - this.renderMaxY) * this.renderMinX
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX));
+ f4 = (float) ((double) f8 * this.renderMaxY * (1.0D - this.renderMaxX)
+ + (double) f9 * this.renderMaxY * this.renderMaxX
+ + (double) f10 * (1.0D - this.renderMaxY) * this.renderMaxX
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX));
+ f5 = (float) ((double) f8 * this.renderMinY * (1.0D - this.renderMaxX)
+ + (double) f9 * this.renderMinY * this.renderMaxX
+ + (double) f10 * (1.0D - this.renderMinY) * this.renderMaxX
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX));
+ f6 = (float) ((double) f8 * this.renderMinY * (1.0D - this.renderMinX)
+ + (double) f9 * this.renderMinY * this.renderMinX
+ + (double) f10 * (1.0D - this.renderMinY) * this.renderMinX
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX));
+ j1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
+ k1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, i1);
+ l1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, i1);
+ i2 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ k1,
+ l1,
+ i2,
+ this.renderMaxY * (1.0D - this.renderMinX),
+ this.renderMaxY * this.renderMinX,
+ (1.0D - this.renderMaxY) * this.renderMinX,
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMinX));
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ k1,
+ l1,
+ i2,
+ this.renderMaxY * (1.0D - this.renderMaxX),
+ this.renderMaxY * this.renderMaxX,
+ (1.0D - this.renderMaxY) * this.renderMaxX,
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX));
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ k1,
+ l1,
+ i2,
+ this.renderMinY * (1.0D - this.renderMaxX),
+ this.renderMinY * this.renderMaxX,
+ (1.0D - this.renderMinY) * this.renderMaxX,
+ (1.0D - this.renderMinY) * (1.0D - this.renderMaxX));
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ k1,
+ l1,
+ i2,
+ this.renderMinY * (1.0D - this.renderMinX),
+ this.renderMinY * this.renderMinX,
+ (1.0D - this.renderMinY) * this.renderMinX,
+ (1.0D - this.renderMinY) * (1.0D - this.renderMinX));
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.8F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.8F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.8F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 2);
+ CustomOreBlockRenderer.renderFaceZNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass
+ && iicon.getIconName().equals("grass_side")
+ && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceZNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos + 1, 3)) {
+ if (this.renderMaxZ >= 1.0D) {
+ ++zPos;
+ }
+
+ this.aoLightValueScratchXZNP =
+ blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPP =
+ blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNP =
+ blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessYZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ flag2 = blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getCanBlockGrass();
+
+ if (!flag3 && !flag5) {
+ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNNP =
+ blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
+ }
+
+ if (!flag3 && !flag4) {
+ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNPP =
+ blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
+ }
+
+ if (!flag2 && !flag5) {
+ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPNP =
+ blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
+ }
+
+ if (!flag2 && !flag4) {
+ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPPP =
+ blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
+ }
+
+ if (this.renderMaxZ >= 1.0D) {
+ --zPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMaxZ >= 1.0D
+ || !blockAccess.getBlock(xPos, yPos, zPos + 1).isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ f8 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + f7 + this.aoLightValueScratchYZPP)
+ / 4.0F;
+ f9 = (f7 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP)
+ / 4.0F;
+ f10 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP)
+ / 4.0F;
+ f11 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + f7)
+ / 4.0F;
+ f3 = (float) ((double) f8 * this.renderMaxY * (1.0D - this.renderMinX)
+ + (double) f9 * this.renderMaxY * this.renderMinX
+ + (double) f10 * (1.0D - this.renderMaxY) * this.renderMinX
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX));
+ f4 = (float) ((double) f8 * this.renderMinY * (1.0D - this.renderMinX)
+ + (double) f9 * this.renderMinY * this.renderMinX
+ + (double) f10 * (1.0D - this.renderMinY) * this.renderMinX
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX));
+ f5 = (float) ((double) f8 * this.renderMinY * (1.0D - this.renderMaxX)
+ + (double) f9 * this.renderMinY * this.renderMaxX
+ + (double) f10 * (1.0D - this.renderMinY) * this.renderMaxX
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX));
+ f6 = (float) ((double) f8 * this.renderMaxY * (1.0D - this.renderMaxX)
+ + (double) f9 * this.renderMaxY * this.renderMaxX
+ + (double) f10 * (1.0D - this.renderMaxY) * this.renderMaxX
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX));
+ j1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, i1);
+ k1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, i1);
+ l1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
+ i2 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ this.renderMaxY * (1.0D - this.renderMinX),
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMinX),
+ (1.0D - this.renderMaxY) * this.renderMinX,
+ this.renderMaxY * this.renderMinX);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ this.renderMinY * (1.0D - this.renderMinX),
+ (1.0D - this.renderMinY) * (1.0D - this.renderMinX),
+ (1.0D - this.renderMinY) * this.renderMinX,
+ this.renderMinY * this.renderMinX);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ this.renderMinY * (1.0D - this.renderMaxX),
+ (1.0D - this.renderMinY) * (1.0D - this.renderMaxX),
+ (1.0D - this.renderMinY) * this.renderMaxX,
+ this.renderMinY * this.renderMaxX);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ this.renderMaxY * (1.0D - this.renderMaxX),
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX),
+ (1.0D - this.renderMaxY) * this.renderMaxX,
+ this.renderMaxY * this.renderMaxX);
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.8F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.8F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.8F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 3);
+ CustomOreBlockRenderer.renderFaceZPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass
+ && iicon.getIconName().equals("grass_side")
+ && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceZPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos - 1, yPos, zPos, 4)) {
+ if (this.renderMinX <= 0.0D) {
+ --xPos;
+ }
+
+ this.aoLightValueScratchXYNN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNN =
+ blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNP =
+ blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYNP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoBrightnessXYNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ flag2 = blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getCanBlockGrass();
+
+ if (!flag4 && !flag3) {
+ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNNN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
+ }
+
+ if (!flag5 && !flag3) {
+ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNNP =
+ blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
+ }
+
+ if (!flag4 && !flag2) {
+ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNPN =
+ blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
+ }
+
+ if (!flag5 && !flag2) {
+ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNPP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
+ }
+
+ if (this.renderMinX <= 0.0D) {
+ ++xPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMinX <= 0.0D
+ || !blockAccess.getBlock(xPos - 1, yPos, zPos).isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos - 1, yPos, zPos).getAmbientOcclusionLightValue();
+ f8 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + f7 + this.aoLightValueScratchXZNP)
+ / 4.0F;
+ f9 = (f7 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP)
+ / 4.0F;
+ f10 = (this.aoLightValueScratchXZNN + f7 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP)
+ / 4.0F;
+ f11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + f7)
+ / 4.0F;
+ f3 = (float) ((double) f9 * this.renderMaxY * this.renderMaxZ
+ + (double) f10 * this.renderMaxY * (1.0D - this.renderMaxZ)
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ)
+ + (double) f8 * (1.0D - this.renderMaxY) * this.renderMaxZ);
+ f4 = (float) ((double) f9 * this.renderMaxY * this.renderMinZ
+ + (double) f10 * this.renderMaxY * (1.0D - this.renderMinZ)
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ)
+ + (double) f8 * (1.0D - this.renderMaxY) * this.renderMinZ);
+ f5 = (float) ((double) f9 * this.renderMinY * this.renderMinZ
+ + (double) f10 * this.renderMinY * (1.0D - this.renderMinZ)
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ)
+ + (double) f8 * (1.0D - this.renderMinY) * this.renderMinZ);
+ f6 = (float) ((double) f9 * this.renderMinY * this.renderMaxZ
+ + (double) f10 * this.renderMinY * (1.0D - this.renderMaxZ)
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ)
+ + (double) f8 * (1.0D - this.renderMinY) * this.renderMaxZ);
+ j1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, i1);
+ k1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, i1);
+ l1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, i1);
+ i2 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ k1,
+ l1,
+ i2,
+ j1,
+ this.renderMaxY * this.renderMaxZ,
+ this.renderMaxY * (1.0D - this.renderMaxZ),
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ),
+ (1.0D - this.renderMaxY) * this.renderMaxZ);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ k1,
+ l1,
+ i2,
+ j1,
+ this.renderMaxY * this.renderMinZ,
+ this.renderMaxY * (1.0D - this.renderMinZ),
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ),
+ (1.0D - this.renderMaxY) * this.renderMinZ);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ k1,
+ l1,
+ i2,
+ j1,
+ this.renderMinY * this.renderMinZ,
+ this.renderMinY * (1.0D - this.renderMinZ),
+ (1.0D - this.renderMinY) * (1.0D - this.renderMinZ),
+ (1.0D - this.renderMinY) * this.renderMinZ);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ k1,
+ l1,
+ i2,
+ j1,
+ this.renderMinY * this.renderMaxZ,
+ this.renderMinY * (1.0D - this.renderMaxZ),
+ (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ),
+ (1.0D - this.renderMinY) * this.renderMaxZ);
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.6F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.6F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.6F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 4);
+ CustomOreBlockRenderer.renderFaceXNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass
+ && iicon.getIconName().equals("grass_side")
+ && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceXNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos + 1, yPos, zPos, 5)) {
+ if (this.renderMaxX >= 1.0D) {
+ ++xPos;
+ }
+
+ this.aoLightValueScratchXYPN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPN =
+ blockAccess.getBlock(xPos, yPos, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPP =
+ blockAccess.getBlock(xPos, yPos, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessXZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoBrightnessXYPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ flag2 = blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getCanBlockGrass();
+
+ if (!flag3 && !flag5) {
+ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPNN =
+ blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
+ }
+
+ if (!flag3 && !flag4) {
+ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPNP =
+ blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
+ }
+
+ if (!flag2 && !flag5) {
+ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPPN =
+ blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
+ }
+
+ if (!flag2 && !flag4) {
+ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPPP =
+ blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
+ }
+
+ if (this.renderMaxX >= 1.0D) {
+ --xPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMaxX >= 1.0D
+ || !blockAccess.getBlock(xPos + 1, yPos, zPos).isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos + 1, yPos, zPos).getAmbientOcclusionLightValue();
+ f8 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + f7 + this.aoLightValueScratchXZPP)
+ / 4.0F;
+ f9 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + f7)
+ / 4.0F;
+ f10 = (this.aoLightValueScratchXZPN + f7 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP)
+ / 4.0F;
+ f11 = (f7 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP)
+ / 4.0F;
+ f3 = (float) ((double) f8 * (1.0D - this.renderMinY) * this.renderMaxZ
+ + (double) f9 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ)
+ + (double) f10 * this.renderMinY * (1.0D - this.renderMaxZ)
+ + (double) f11 * this.renderMinY * this.renderMaxZ);
+ f4 = (float) ((double) f8 * (1.0D - this.renderMinY) * this.renderMinZ
+ + (double) f9 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ)
+ + (double) f10 * this.renderMinY * (1.0D - this.renderMinZ)
+ + (double) f11 * this.renderMinY * this.renderMinZ);
+ f5 = (float) ((double) f8 * (1.0D - this.renderMaxY) * this.renderMinZ
+ + (double) f9 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ)
+ + (double) f10 * this.renderMaxY * (1.0D - this.renderMinZ)
+ + (double) f11 * this.renderMaxY * this.renderMinZ);
+ f6 = (float) ((double) f8 * (1.0D - this.renderMaxY) * this.renderMaxZ
+ + (double) f9 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ)
+ + (double) f10 * this.renderMaxY * (1.0D - this.renderMaxZ)
+ + (double) f11 * this.renderMaxY * this.renderMaxZ);
+ j1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
+ k1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, i1);
+ l1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, i1);
+ i2 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ (1.0D - this.renderMinY) * this.renderMaxZ,
+ (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ),
+ this.renderMinY * (1.0D - this.renderMaxZ),
+ this.renderMinY * this.renderMaxZ);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ (1.0D - this.renderMinY) * this.renderMinZ,
+ (1.0D - this.renderMinY) * (1.0D - this.renderMinZ),
+ this.renderMinY * (1.0D - this.renderMinZ),
+ this.renderMinY * this.renderMinZ);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ (1.0D - this.renderMaxY) * this.renderMinZ,
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ),
+ this.renderMaxY * (1.0D - this.renderMinZ),
+ this.renderMaxY * this.renderMinZ);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ (1.0D - this.renderMaxY) * this.renderMaxZ,
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ),
+ this.renderMaxY * (1.0D - this.renderMaxZ),
+ this.renderMaxY * this.renderMaxZ);
+
+ if (flag1) {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R * 0.6F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G * 0.6F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B * 0.6F;
+ } else {
+ this.colorRedTopLeft =
+ this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
+ this.colorGreenTopLeft =
+ this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
+ this.colorBlueTopLeft =
+ this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 5);
+ CustomOreBlockRenderer.renderFaceXPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass
+ && iicon.getIconName().equals("grass_side")
+ && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceXPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ this.enableAO = false;
+ return flag;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java
index 000badb80f..6654ff5c8d 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.client.renderer;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.client.model.ModelBatKing;
@@ -13,140 +11,162 @@ import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderBatKing extends RenderLiving {
-
- private static final ResourceLocation batTextures = new ResourceLocation(CORE.MODID+":"+"textures/entity/batKing.png");
-
- /**
- * not actually sure this is size, is not used as of now, but the model would be
- * recreated if the value changed and it seems a good match for a bats size
- */
- private int renderedBatSize;
-
- public RenderBatKing() {
- super(new ModelBatKing(), 0.7F);
- this.renderedBatSize = (((ModelBatKing) this.mainModel).getBatSize());
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker function
- * which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void
- * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
- * But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(EntityBatKing p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- int i = ((ModelBatKing) this.mainModel).getBatSize();
-
- if (i != this.renderedBatSize) {
- this.renderedBatSize = i;
- this.mainModel = new ModelBatKing();
- }
-
- super.doRender((EntityLiving) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless
- * you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(EntityBatKing p_110775_1_) {
- return batTextures;
- }
-
- /**
- * Allows the render to do any OpenGL state modifications necessary before the
- * model is rendered. Args: entityLiving, partialTickTime
- */
- protected void preRenderCallback(EntityBatKing p_77041_1_, float p_77041_2_) {
- GL11.glScalef(0.35F, 0.35F, 0.35F);
- }
-
- /**
- * Sets a simple glTranslate on a LivingEntity.
- */
- protected void renderLivingAt(EntityBatKing p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) {
- super.renderLivingAt(p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_);
- }
-
- protected void rotateCorpse(EntityBatKing p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
- if (!p_77043_1_.getIsBatHanging()) {
- GL11.glTranslatef(0.0F, MathHelper.cos(p_77043_2_ * 0.3F) * 0.1F, 0.0F);
- } else {
- GL11.glTranslatef(0.0F, -0.1F, 0.0F);
- }
-
- super.rotateCorpse(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker function
- * which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void
- * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
- * But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- this.doRender((EntityBatKing) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
- /**
- * Allows the render to do any OpenGL state modifications necessary before the
- * model is rendered. Args: entityLiving, partialTickTime
- */
- protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) {
- this.preRenderCallback((EntityBatKing) p_77041_1_, p_77041_2_);
- }
-
- protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
- this.rotateCorpse((EntityBatKing) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
- }
-
- /**
- * Sets a simple glTranslate on a LivingEntity.
- */
- protected void renderLivingAt(EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_,
- double p_77039_6_) {
- this.renderLivingAt((EntityBatKing) p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker function
- * which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void
- * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
- * But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- this.doRender((EntityBatKing) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless
- * you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
- return this.getEntityTexture((EntityBatKing) p_110775_1_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker function
- * which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void
- * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
- * But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
- float p_76986_9_) {
- this.doRender((EntityBatKing) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-} \ No newline at end of file
+
+ private static final ResourceLocation batTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/batKing.png");
+
+ /**
+ * not actually sure this is size, is not used as of now, but the model would be
+ * recreated if the value changed and it seems a good match for a bats size
+ */
+ private int renderedBatSize;
+
+ public RenderBatKing() {
+ super(new ModelBatKing(), 0.7F);
+ this.renderedBatSize = (((ModelBatKing) this.mainModel).getBatSize());
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker function
+ * which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void
+ * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
+ * But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ EntityBatKing p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ int i = ((ModelBatKing) this.mainModel).getBatSize();
+
+ if (i != this.renderedBatSize) {
+ this.renderedBatSize = i;
+ this.mainModel = new ModelBatKing();
+ }
+
+ super.doRender((EntityLiving) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless
+ * you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(EntityBatKing p_110775_1_) {
+ return batTextures;
+ }
+
+ /**
+ * Allows the render to do any OpenGL state modifications necessary before the
+ * model is rendered. Args: entityLiving, partialTickTime
+ */
+ protected void preRenderCallback(EntityBatKing p_77041_1_, float p_77041_2_) {
+ GL11.glScalef(0.35F, 0.35F, 0.35F);
+ }
+
+ /**
+ * Sets a simple glTranslate on a LivingEntity.
+ */
+ protected void renderLivingAt(EntityBatKing p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) {
+ super.renderLivingAt(p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_);
+ }
+
+ protected void rotateCorpse(EntityBatKing p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
+ if (!p_77043_1_.getIsBatHanging()) {
+ GL11.glTranslatef(0.0F, MathHelper.cos(p_77043_2_ * 0.3F) * 0.1F, 0.0F);
+ } else {
+ GL11.glTranslatef(0.0F, -0.1F, 0.0F);
+ }
+
+ super.rotateCorpse(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker function
+ * which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void
+ * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
+ * But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ EntityLiving p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntityBatKing) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ /**
+ * Allows the render to do any OpenGL state modifications necessary before the
+ * model is rendered. Args: entityLiving, partialTickTime
+ */
+ protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) {
+ this.preRenderCallback((EntityBatKing) p_77041_1_, p_77041_2_);
+ }
+
+ protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
+ this.rotateCorpse((EntityBatKing) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
+ }
+
+ /**
+ * Sets a simple glTranslate on a LivingEntity.
+ */
+ protected void renderLivingAt(
+ EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) {
+ this.renderLivingAt((EntityBatKing) p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker function
+ * which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void
+ * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
+ * But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ EntityLivingBase p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntityBatKing) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless
+ * you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ return this.getEntityTexture((EntityBatKing) p_110775_1_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker function
+ * which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void
+ * func_76986_a(T entity, double d, double d1, double d2, float f, float f1).
+ * But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ Entity p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntityBatKing) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
index 73ab4093eb..0629db3a3c 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.client.renderer;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -13,70 +10,77 @@ import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
@SideOnly(Side.CLIENT)
public class RenderDecayChest extends TileEntitySpecialRenderer {
- private static final ResourceLocation mChestTexture = new ResourceLocation(CORE.MODID, "textures/blocks/TileEntities/DecayablesChest_full.png");
- private ModelDecayChest mChestModel = new ModelDecayChest();
-
- public static RenderDecayChest INSTANCE;
- public final int mRenderID;
+ private static final ResourceLocation mChestTexture =
+ new ResourceLocation(CORE.MODID, "textures/blocks/TileEntities/DecayablesChest_full.png");
+ private ModelDecayChest mChestModel = new ModelDecayChest();
+
+ public static RenderDecayChest INSTANCE;
+ public final int mRenderID;
+
+ public RenderDecayChest() {
+ INSTANCE = this;
+ this.mRenderID = RenderingRegistry.getNextAvailableRenderId();
+ Logger.INFO("Registered Lead Lined Chest Renderer.");
+ }
+
+ public void renderTileEntityAt(
+ TileEntityDecayablesChest p_147500_1_,
+ double p_147500_2_,
+ double p_147500_4_,
+ double p_147500_6_,
+ float p_147500_8_) {
- public RenderDecayChest() {
- INSTANCE = this;
- this.mRenderID = RenderingRegistry.getNextAvailableRenderId();
- Logger.INFO("Registered Lead Lined Chest Renderer.");
-
- }
-
- public void renderTileEntityAt(TileEntityDecayablesChest p_147500_1_, double p_147500_2_, double p_147500_4_,
- double p_147500_6_, float p_147500_8_) {
-
- int i = 0;
+ int i = 0;
- if (true) {
- this.bindTexture(mChestTexture);
- GL11.glPushMatrix();
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- GL11.glTranslatef((float) p_147500_2_, (float) p_147500_4_ + 1.0F, (float) p_147500_6_ + 1.0F);
- GL11.glScalef(1.0F, -1.0F, -1.0F);
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
- short short1 = 0;
+ if (true) {
+ this.bindTexture(mChestTexture);
+ GL11.glPushMatrix();
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glTranslatef((float) p_147500_2_, (float) p_147500_4_ + 1.0F, (float) p_147500_6_ + 1.0F);
+ GL11.glScalef(1.0F, -1.0F, -1.0F);
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ short short1 = 0;
- if (i == 2) {
- short1 = 180;
- }
+ if (i == 2) {
+ short1 = 180;
+ }
- if (i == 3) {
- short1 = 0;
- }
+ if (i == 3) {
+ short1 = 0;
+ }
- if (i == 4) {
- short1 = 90;
- }
+ if (i == 4) {
+ short1 = 90;
+ }
- if (i == 5) {
- short1 = -90;
- }
+ if (i == 5) {
+ short1 = -90;
+ }
- GL11.glRotatef((float) short1, 0.0F, 1.0F, 0.0F);
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- float f1 = p_147500_1_.prevLidAngle + (p_147500_1_.lidAngle - p_147500_1_.prevLidAngle) * p_147500_8_;
+ GL11.glRotatef((float) short1, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ float f1 = p_147500_1_.prevLidAngle + (p_147500_1_.lidAngle - p_147500_1_.prevLidAngle) * p_147500_8_;
- f1 = 1.0F - f1;
- f1 = 1.0F - f1 * f1 * f1;
- mChestModel.chestLid.rotateAngleX = -(f1 * CORE.PI / 2.0F);
- mChestModel.renderAll();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- GL11.glPopMatrix();
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- }
- }
+ f1 = 1.0F - f1;
+ f1 = 1.0F - f1 * f1 * f1;
+ mChestModel.chestLid.rotateAngleX = -(f1 * CORE.PI / 2.0F);
+ mChestModel.renderAll();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ }
+ }
- public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_,
- float p_147500_8_) {
- this.renderTileEntityAt((TileEntityDecayablesChest) p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_);
- }
-} \ No newline at end of file
+ public void renderTileEntityAt(
+ TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) {
+ this.renderTileEntityAt(
+ (TileEntityDecayablesChest) p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java
index cc1249280b..ecc2675b1d 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java
@@ -8,8 +8,7 @@ import net.minecraft.client.renderer.entity.RenderChicken;
@SideOnly(Side.CLIENT)
public class RenderGiantChicken extends RenderChicken {
- public RenderGiantChicken(ModelBase p_i1252_1_, float p_i1252_2_)
- {
+ public RenderGiantChicken(ModelBase p_i1252_1_, float p_i1252_2_) {
super(p_i1252_1_, p_i1252_2_);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java
index 893982e8ac..11c01b8c41 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java
@@ -1,107 +1,113 @@
package gtPlusPlus.core.client.renderer;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.entity.RenderTNTPrimed;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderMiningExplosivesPrimed extends RenderTNTPrimed {
- private final RenderBlocks blockRenderer = new RenderBlocks();
-
- public RenderMiningExplosivesPrimed(){
- this.shadowSize = 0.5F;
- Logger.WARNING("Rendering Mining Explosion. 1");
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
- * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
- * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(final EntityPrimedMiningExplosive entity, final double p_76986_2_, final double p_76986_4_, final double p_76986_6_, final float p_76986_8_, final float p_76986_9_){
- Logger.WARNING("Rendering Mining Explosion. 2");
- GL11.glPushMatrix();
- GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
- float f2;
-
- if (((entity.fuse - p_76986_9_) + 1.0F) < 10.0F)
- {
- f2 = 1.0F - (((entity.fuse - p_76986_9_) + 1.0F) / 10.0F);
-
- if (f2 < 0.0F)
- {
- f2 = 0.0F;
- }
-
- if (f2 > 1.0F)
- {
- f2 = 1.0F;
- }
-
- f2 *= f2;
- f2 *= f2;
- final float f3 = 1.0F + (f2 * 0.3F);
- GL11.glScalef(f3, f3, f3);
- }
-
- f2 = (1.0F - (((entity.fuse - p_76986_9_) + 1.0F) / 100.0F)) * 0.8F;
- this.bindEntityTexture(entity);
- this.blockRenderer.renderBlockAsItem(ModBlocks.blockMiningExplosive, 0, entity.getBrightness(p_76986_9_));
-
- if (((entity.fuse / 5) % 2) == 0)
- {
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);
- this.blockRenderer.renderBlockAsItem(ModBlocks.blockMiningExplosive, 0, 1.0F);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- }
-
- GL11.glPopMatrix();
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(final EntityPrimedMiningExplosive p_110775_1_){
- return TextureMap.locationBlocksTexture;
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
- */
- @Override
- protected ResourceLocation getEntityTexture(final Entity p_110775_1_){
- Logger.WARNING("Rendering Mining Explosion. 4");
- return this.getEntityTexture((EntityPrimedMiningExplosive)p_110775_1_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
- * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
- * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
- */
- @Override
- public void doRender(final Entity p_76986_1_, final double p_76986_2_, final double p_76986_4_, final double p_76986_6_, final float p_76986_8_, final float p_76986_9_){
- Logger.WARNING("Rendering Mining Explosion. 3");
- this.doRender((EntityPrimedMiningExplosive)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-} \ No newline at end of file
+ private final RenderBlocks blockRenderer = new RenderBlocks();
+
+ public RenderMiningExplosivesPrimed() {
+ this.shadowSize = 0.5F;
+ Logger.WARNING("Rendering Mining Explosion. 1");
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ final EntityPrimedMiningExplosive entity,
+ final double p_76986_2_,
+ final double p_76986_4_,
+ final double p_76986_6_,
+ final float p_76986_8_,
+ final float p_76986_9_) {
+ Logger.WARNING("Rendering Mining Explosion. 2");
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
+ float f2;
+
+ if (((entity.fuse - p_76986_9_) + 1.0F) < 10.0F) {
+ f2 = 1.0F - (((entity.fuse - p_76986_9_) + 1.0F) / 10.0F);
+
+ if (f2 < 0.0F) {
+ f2 = 0.0F;
+ }
+
+ if (f2 > 1.0F) {
+ f2 = 1.0F;
+ }
+
+ f2 *= f2;
+ f2 *= f2;
+ final float f3 = 1.0F + (f2 * 0.3F);
+ GL11.glScalef(f3, f3, f3);
+ }
+
+ f2 = (1.0F - (((entity.fuse - p_76986_9_) + 1.0F) / 100.0F)) * 0.8F;
+ this.bindEntityTexture(entity);
+ this.blockRenderer.renderBlockAsItem(ModBlocks.blockMiningExplosive, 0, entity.getBrightness(p_76986_9_));
+
+ if (((entity.fuse / 5) % 2) == 0) {
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);
+ this.blockRenderer.renderBlockAsItem(ModBlocks.blockMiningExplosive, 0, 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(final EntityPrimedMiningExplosive p_110775_1_) {
+ return TextureMap.locationBlocksTexture;
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ @Override
+ protected ResourceLocation getEntityTexture(final Entity p_110775_1_) {
+ Logger.WARNING("Rendering Mining Explosion. 4");
+ return this.getEntityTexture((EntityPrimedMiningExplosive) p_110775_1_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(
+ final Entity p_76986_1_,
+ final double p_76986_2_,
+ final double p_76986_4_,
+ final double p_76986_6_,
+ final float p_76986_8_,
+ final float p_76986_9_) {
+ Logger.WARNING("Rendering Mining Explosion. 3");
+ this.doRender(
+ (EntityPrimedMiningExplosive) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderPlasmaBolt.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderPlasmaBolt.java
index b73154da10..61c1052859 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderPlasmaBolt.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderPlasmaBolt.java
@@ -1,168 +1,173 @@
package gtPlusPlus.core.client.renderer;
-import java.util.Random;
-
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.random.XSTR;
+import gtPlusPlus.core.entity.EntityTeslaTowerLightning;
+import java.util.Random;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.random.XSTR;
-import gtPlusPlus.core.entity.EntityTeslaTowerLightning;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderPlasmaBolt extends Render {
- public RenderPlasmaBolt(){
- Logger.INFO("[Render] Create custom lightning renderer.");
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker
- * function which does the actual work. In all probabilty, the class Render
- * is generic (Render<T extends Entity) and this method has signature public
- * void func_76986_a(T entity, double d, double d1, double d2, float f,
- * float f1). But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(EntityTeslaTowerLightning p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- Logger.INFO("Render Plasma. 1");
- Tessellator tessellator = Tessellator.instance;
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
- double[] adouble = new double[8];
- double[] adouble1 = new double[8];
- double d3 = 0.0D;
- double d4 = 0.0D;
- Random random = new XSTR(p_76986_1_.boltVertex);
-
- for (int i = 7; i >= 0; --i) {
- adouble[i] = d3;
- adouble1[i] = d4;
- d3 += (double) (random.nextInt(11) - 5);
- d4 += (double) (random.nextInt(11) - 5);
- }
-
- for (int k1 = 0; k1 < 4; ++k1) {
- Random random1 = new XSTR(p_76986_1_.boltVertex);
-
- for (int j = 0; j < 3; ++j) {
- int k = 7;
- int l = 0;
-
- if (j > 0) {
- k = 7 - j;
- }
-
- if (j > 0) {
- l = k - 2;
- }
-
- double d5 = adouble[k] - d3;
- double d6 = adouble1[k] - d4;
-
- for (int i1 = k; i1 >= l; --i1) {
- double d7 = d5;
- double d8 = d6;
-
- if (j == 0) {
- d5 += (double) (random1.nextInt(11) - 5);
- d6 += (double) (random1.nextInt(11) - 5);
- }
- else {
- d5 += (double) (random1.nextInt(31) - 15);
- d6 += (double) (random1.nextInt(31) - 15);
- }
-
- tessellator.startDrawing(5);
- float f2 = 0.5F;
- tessellator.setColorRGBA_F(0.9F * f2, 0.9F * f2, 1.0F * f2, 0.3F);
- double d9 = 0.1D + (double) k1 * 0.2D;
-
- if (j == 0) {
- d9 *= (double) i1 * 0.1D + 1.0D;
- }
-
- double d10 = 0.1D + (double) k1 * 0.2D;
-
- if (j == 0) {
- d10 *= (double) (i1 - 1) * 0.1D + 1.0D;
- }
-
- for (int j1 = 0; j1 < 5; ++j1) {
- double d11 = p_76986_2_ + 0.5D - d9;
- double d12 = p_76986_6_ + 0.5D - d9;
-
- if (j1 == 1 || j1 == 2) {
- d11 += d9 * 2.0D;
- }
-
- if (j1 == 2 || j1 == 3) {
- d12 += d9 * 2.0D;
- }
-
- double d13 = p_76986_2_ + 0.5D - d10;
- double d14 = p_76986_6_ + 0.5D - d10;
-
- if (j1 == 1 || j1 == 2) {
- d13 += d10 * 2.0D;
- }
-
- if (j1 == 2 || j1 == 3) {
- d14 += d10 * 2.0D;
- }
-
- tessellator.addVertex(d13 + d5, p_76986_4_ + (double) (i1 * 16), d14 + d6);
- tessellator.addVertex(d11 + d7, p_76986_4_ + (double) ((i1 + 1) * 16), d12 + d8);
- }
-
- tessellator.draw();
- }
- }
- }
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called
- * unless you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(EntityTeslaTowerLightning p_110775_1_) {
- return null;
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called
- * unless you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
- Logger.INFO("Render Plasma. 5");
- return this.getEntityTexture((EntityTeslaTowerLightning) p_110775_1_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker
- * function which does the actual work. In all probabilty, the class Render
- * is generic (Render<T extends Entity) and this method has signature public
- * void func_76986_a(T entity, double d, double d1, double d2, float f,
- * float f1). But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
- float p_76986_9_) {
- Logger.INFO("Render Plasma. 2");
- this.doRender((EntityTeslaTowerLightning) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_,
- p_76986_9_);
- }
-} \ No newline at end of file
+ public RenderPlasmaBolt() {
+ Logger.INFO("[Render] Create custom lightning renderer.");
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker
+ * function which does the actual work. In all probabilty, the class Render
+ * is generic (Render<T extends Entity) and this method has signature public
+ * void func_76986_a(T entity, double d, double d1, double d2, float f,
+ * float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ EntityTeslaTowerLightning p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ Logger.INFO("Render Plasma. 1");
+ Tessellator tessellator = Tessellator.instance;
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
+ double[] adouble = new double[8];
+ double[] adouble1 = new double[8];
+ double d3 = 0.0D;
+ double d4 = 0.0D;
+ Random random = new XSTR(p_76986_1_.boltVertex);
+
+ for (int i = 7; i >= 0; --i) {
+ adouble[i] = d3;
+ adouble1[i] = d4;
+ d3 += (double) (random.nextInt(11) - 5);
+ d4 += (double) (random.nextInt(11) - 5);
+ }
+
+ for (int k1 = 0; k1 < 4; ++k1) {
+ Random random1 = new XSTR(p_76986_1_.boltVertex);
+
+ for (int j = 0; j < 3; ++j) {
+ int k = 7;
+ int l = 0;
+
+ if (j > 0) {
+ k = 7 - j;
+ }
+
+ if (j > 0) {
+ l = k - 2;
+ }
+
+ double d5 = adouble[k] - d3;
+ double d6 = adouble1[k] - d4;
+
+ for (int i1 = k; i1 >= l; --i1) {
+ double d7 = d5;
+ double d8 = d6;
+
+ if (j == 0) {
+ d5 += (double) (random1.nextInt(11) - 5);
+ d6 += (double) (random1.nextInt(11) - 5);
+ } else {
+ d5 += (double) (random1.nextInt(31) - 15);
+ d6 += (double) (random1.nextInt(31) - 15);
+ }
+
+ tessellator.startDrawing(5);
+ float f2 = 0.5F;
+ tessellator.setColorRGBA_F(0.9F * f2, 0.9F * f2, 1.0F * f2, 0.3F);
+ double d9 = 0.1D + (double) k1 * 0.2D;
+
+ if (j == 0) {
+ d9 *= (double) i1 * 0.1D + 1.0D;
+ }
+
+ double d10 = 0.1D + (double) k1 * 0.2D;
+
+ if (j == 0) {
+ d10 *= (double) (i1 - 1) * 0.1D + 1.0D;
+ }
+
+ for (int j1 = 0; j1 < 5; ++j1) {
+ double d11 = p_76986_2_ + 0.5D - d9;
+ double d12 = p_76986_6_ + 0.5D - d9;
+
+ if (j1 == 1 || j1 == 2) {
+ d11 += d9 * 2.0D;
+ }
+
+ if (j1 == 2 || j1 == 3) {
+ d12 += d9 * 2.0D;
+ }
+
+ double d13 = p_76986_2_ + 0.5D - d10;
+ double d14 = p_76986_6_ + 0.5D - d10;
+
+ if (j1 == 1 || j1 == 2) {
+ d13 += d10 * 2.0D;
+ }
+
+ if (j1 == 2 || j1 == 3) {
+ d14 += d10 * 2.0D;
+ }
+
+ tessellator.addVertex(d13 + d5, p_76986_4_ + (double) (i1 * 16), d14 + d6);
+ tessellator.addVertex(d11 + d7, p_76986_4_ + (double) ((i1 + 1) * 16), d12 + d8);
+ }
+
+ tessellator.draw();
+ }
+ }
+ }
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called
+ * unless you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(EntityTeslaTowerLightning p_110775_1_) {
+ return null;
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called
+ * unless you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ Logger.INFO("Render Plasma. 5");
+ return this.getEntityTexture((EntityTeslaTowerLightning) p_110775_1_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker
+ * function which does the actual work. In all probabilty, the class Render
+ * is generic (Render<T extends Entity) and this method has signature public
+ * void func_76986_a(T entity, double d, double d1, double d2, float f,
+ * float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ Entity p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ Logger.INFO("Render Plasma. 2");
+ this.doRender(
+ (EntityTeslaTowerLightning) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java
index a0e396bc23..e0b62b4a33 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java
@@ -1,11 +1,7 @@
package gtPlusPlus.core.client.renderer;
-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.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
@@ -16,21 +12,20 @@ import net.minecraft.item.ItemPotion;
import net.minecraft.potion.PotionHelper;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
@SideOnly(Side.CLIENT)
-public class RenderPotionthrow extends Render
-{
+public class RenderPotionthrow extends Render {
private Item mRenderItem;
private int mDamage;
- public RenderPotionthrow(Item p_i1259_1_, int p_i1259_2_)
- {
+ public RenderPotionthrow(Item p_i1259_1_, int p_i1259_2_) {
this.mRenderItem = p_i1259_1_;
this.mDamage = p_i1259_2_;
}
- public RenderPotionthrow(Item p_i1260_1_)
- {
+ public RenderPotionthrow(Item p_i1260_1_) {
this(p_i1260_1_, 0);
}
@@ -41,22 +36,25 @@ public class RenderPotionthrow extends Render
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
@Override
- public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
- {
+ public void doRender(
+ Entity p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
IIcon iicon = this.mRenderItem.getIconFromDamage(this.mDamage);
- if (iicon != null)
- {
+ if (iicon != null) {
GL11.glPushMatrix();
- GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
+ GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
this.bindEntityTexture(p_76986_1_);
Tessellator tessellator = Tessellator.instance;
- if (iicon == ItemPotion.func_94589_d("bottle_splash"))
- {
- int i = PotionHelper.func_77915_a(((EntityPotion)p_76986_1_).getPotionDamage(), false);
+ if (iicon == ItemPotion.func_94589_d("bottle_splash")) {
+ int i = PotionHelper.func_77915_a(((EntityPotion) p_76986_1_).getPotionDamage(), false);
float f2 = (i >> 16 & 255) / 255.0F;
float f3 = (i >> 8 & 255) / 255.0F;
float f4 = (i & 255) / 255.0F;
@@ -77,13 +75,11 @@ public class RenderPotionthrow extends Render
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
@Override
- protected ResourceLocation getEntityTexture(Entity p_110775_1_)
- {
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return TextureMap.locationItemsTexture;
}
- private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_)
- {
+ private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) {
float f = p_77026_2_.getMinU();
float f1 = p_77026_2_.getMaxU();
float f2 = p_77026_2_.getMinV();
@@ -101,4 +97,4 @@ public class RenderPotionthrow extends Render
p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
p_77026_1_.draw();
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderSickBlaze.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderSickBlaze.java
index e1e8360840..960451514d 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderSickBlaze.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderSickBlaze.java
@@ -2,27 +2,24 @@ package gtPlusPlus.core.client.renderer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.client.model.ModelSickBlaze;
+import gtPlusPlus.core.entity.monster.EntitySickBlaze;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
-import gtPlusPlus.core.client.model.ModelSickBlaze;
-import gtPlusPlus.core.entity.monster.EntitySickBlaze;
-import gtPlusPlus.core.lib.CORE;
-
@SideOnly(Side.CLIENT)
-public class RenderSickBlaze extends RenderLiving
-{
- private static final ResourceLocation blazeTextures = new ResourceLocation(CORE.MODID+":"+"textures/entity/sickBlaze.png");
+public class RenderSickBlaze extends RenderLiving {
+ private static final ResourceLocation blazeTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/sickBlaze.png");
private int field_77068_a;
- public RenderSickBlaze()
- {
+ public RenderSickBlaze() {
super(new ModelSickBlaze(), 0.5F);
- this.field_77068_a = ((ModelSickBlaze)this.mainModel).func_78104_a();
+ this.field_77068_a = ((ModelSickBlaze) this.mainModel).func_78104_a();
}
/**
@@ -31,12 +28,16 @@ public class RenderSickBlaze extends RenderLiving
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
- public void doRender(EntitySickBlaze p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
- {
- int i = ((ModelSickBlaze)this.mainModel).func_78104_a();
+ public void doRender(
+ EntitySickBlaze p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ int i = ((ModelSickBlaze) this.mainModel).func_78104_a();
- if (i != this.field_77068_a)
- {
+ if (i != this.field_77068_a) {
this.field_77068_a = i;
this.mainModel = new ModelSickBlaze();
}
@@ -47,8 +48,7 @@ public class RenderSickBlaze extends RenderLiving
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
- protected ResourceLocation getEntityTexture(EntitySickBlaze p_110775_1_)
- {
+ protected ResourceLocation getEntityTexture(EntitySickBlaze p_110775_1_) {
return blazeTextures;
}
@@ -59,9 +59,14 @@ public class RenderSickBlaze extends RenderLiving
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
@Override
- public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
- {
- this.doRender((EntitySickBlaze)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ public void doRender(
+ EntityLiving p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntitySickBlaze) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
/**
@@ -71,18 +76,22 @@ public class RenderSickBlaze extends RenderLiving
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
@Override
- public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
- {
- this.doRender((EntitySickBlaze)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ public void doRender(
+ EntityLivingBase p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntitySickBlaze) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
@Override
- protected ResourceLocation getEntityTexture(Entity p_110775_1_)
- {
- return this.getEntityTexture((EntitySickBlaze)p_110775_1_);
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ return this.getEntityTexture((EntitySickBlaze) p_110775_1_);
}
/**
@@ -92,8 +101,13 @@ public class RenderSickBlaze extends RenderLiving
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
@Override
- public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
- {
- this.doRender((EntitySickBlaze)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ public void doRender(
+ Entity p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntitySickBlaze) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java
index c1fd88773d..da2f33a4c4 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java
@@ -1,11 +1,10 @@
package gtPlusPlus.core.client.renderer;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.client.model.ModelStaballoyConstruct;
+import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.texture.TextureMap;
@@ -14,136 +13,162 @@ import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.util.ResourceLocation;
-
-import gtPlusPlus.core.client.model.ModelStaballoyConstruct;
-import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
-import gtPlusPlus.core.lib.CORE;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
@SideOnly(Side.CLIENT)
public class RenderStaballoyConstruct extends RenderLiving {
- private static final ResourceLocation staballoyGolemTextures = new ResourceLocation(CORE.MODID+":"+"textures/entity/golemStaballoy.png");
- /** Staballoy Golem's Model. */
- private final ModelStaballoyConstruct staballoyGolemModel;
-
- public RenderStaballoyConstruct() {
- super(new ModelStaballoyConstruct(), 0.8F);
- this.staballoyGolemModel = (ModelStaballoyConstruct) this.mainModel;
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker
- * function which does the actual work. In all probabilty, the class Render
- * is generic (Render<T extends Entity) and this method has signature public
- * void func_76986_a(T entity, double d, double d1, double d2, float f,
- * float f1). But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(EntityStaballoyConstruct p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called
- * unless you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(EntityStaballoyConstruct p_110775_1_) {
- return staballoyGolemTextures;
- }
-
- protected void rotateCorpse(EntityStaballoyConstruct p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
- super.rotateCorpse(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
-
- if (p_77043_1_.limbSwingAmount >= 0.01D) {
- float f3 = 13.0F;
- float f4 = p_77043_1_.limbSwing - p_77043_1_.limbSwingAmount * (1.0F - p_77043_4_) + 6.0F;
- float f5 = (Math.abs(f4 % f3 - f3 * 0.5F) - f3 * 0.25F) / (f3 * 0.25F);
- GL11.glRotatef(6.5F * f5, 0.0F, 0.0F, 1.0F);
- }
- }
-
- protected void renderEquippedItems(EntityStaballoyConstruct p_77029_1_, float p_77029_2_) {
- super.renderEquippedItems(p_77029_1_, p_77029_2_);
-
- if (p_77029_1_.getHoldRoseTick() != 0) {
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glPushMatrix();
- GL11.glRotatef(5.0F + 180.0F * this.staballoyGolemModel.ironGolemRightArm.rotateAngleX / (float) Math.PI, 1.0F,
- 0.0F, 0.0F);
- GL11.glTranslatef(-0.6875F, 1.25F, -0.9375F);
- GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
- float f1 = 0.8F;
- GL11.glScalef(f1, -f1, f1);
- int i = p_77029_1_.getBrightnessForRender(p_77029_2_);
- int j = i % 65536;
- int k = i / 65536;
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.bindTexture(TextureMap.locationBlocksTexture);
- this.field_147909_c.renderBlockAsItem(Blocks.red_flower, 0, 1.0F);
- GL11.glPopMatrix();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- }
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker
- * function which does the actual work. In all probabilty, the class Render
- * is generic (Render<T extends Entity) and this method has signature public
- * void func_76986_a(T entity, double d, double d1, double d2, float f,
- * float f1). But JAD is pre 1.5 so doesn't do that.
- */
- @Override
- public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- this.doRender((EntityStaballoyConstruct) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
- @Override
- protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) {
- this.renderEquippedItems((EntityStaballoyConstruct) p_77029_1_, p_77029_2_);
- }
-
- @Override
- protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
- this.rotateCorpse((EntityStaballoyConstruct) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker
- * function which does the actual work. In all probabilty, the class Render
- * is generic (Render<T extends Entity) and this method has signature public
- * void func_76986_a(T entity, double d, double d1, double d2, float f,
- * float f1). But JAD is pre 1.5 so doesn't do that.
- */
- @Override
- public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- this.doRender((EntityStaballoyConstruct) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called
- * unless you call Render.bindEntityTexture.
- */
- @Override
- protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
- return this.getEntityTexture((EntityStaballoyConstruct) p_110775_1_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method,
- * always casting down its argument and then handing it off to a worker
- * function which does the actual work. In all probabilty, the class Render
- * is generic (Render<T extends Entity) and this method has signature public
- * void func_76986_a(T entity, double d, double d1, double d2, float f,
- * float f1). But JAD is pre 1.5 so doesn't do that.
- */
- @Override
- public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
- float p_76986_9_) {
- this.doRender((EntityStaballoyConstruct) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-} \ No newline at end of file
+ private static final ResourceLocation staballoyGolemTextures =
+ new ResourceLocation(CORE.MODID + ":" + "textures/entity/golemStaballoy.png");
+ /** Staballoy Golem's Model. */
+ private final ModelStaballoyConstruct staballoyGolemModel;
+
+ public RenderStaballoyConstruct() {
+ super(new ModelStaballoyConstruct(), 0.8F);
+ this.staballoyGolemModel = (ModelStaballoyConstruct) this.mainModel;
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker
+ * function which does the actual work. In all probabilty, the class Render
+ * is generic (Render<T extends Entity) and this method has signature public
+ * void func_76986_a(T entity, double d, double d1, double d2, float f,
+ * float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(
+ EntityStaballoyConstruct p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called
+ * unless you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(EntityStaballoyConstruct p_110775_1_) {
+ return staballoyGolemTextures;
+ }
+
+ protected void rotateCorpse(
+ EntityStaballoyConstruct p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
+ super.rotateCorpse(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
+
+ if (p_77043_1_.limbSwingAmount >= 0.01D) {
+ float f3 = 13.0F;
+ float f4 = p_77043_1_.limbSwing - p_77043_1_.limbSwingAmount * (1.0F - p_77043_4_) + 6.0F;
+ float f5 = (Math.abs(f4 % f3 - f3 * 0.5F) - f3 * 0.25F) / (f3 * 0.25F);
+ GL11.glRotatef(6.5F * f5, 0.0F, 0.0F, 1.0F);
+ }
+ }
+
+ protected void renderEquippedItems(EntityStaballoyConstruct p_77029_1_, float p_77029_2_) {
+ super.renderEquippedItems(p_77029_1_, p_77029_2_);
+
+ if (p_77029_1_.getHoldRoseTick() != 0) {
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPushMatrix();
+ GL11.glRotatef(
+ 5.0F + 180.0F * this.staballoyGolemModel.ironGolemRightArm.rotateAngleX / (float) Math.PI,
+ 1.0F,
+ 0.0F,
+ 0.0F);
+ GL11.glTranslatef(-0.6875F, 1.25F, -0.9375F);
+ GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
+ float f1 = 0.8F;
+ GL11.glScalef(f1, -f1, f1);
+ int i = p_77029_1_.getBrightnessForRender(p_77029_2_);
+ int j = i % 65536;
+ int k = i / 65536;
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.bindTexture(TextureMap.locationBlocksTexture);
+ this.field_147909_c.renderBlockAsItem(Blocks.red_flower, 0, 1.0F);
+ GL11.glPopMatrix();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ }
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker
+ * function which does the actual work. In all probabilty, the class Render
+ * is generic (Render<T extends Entity) and this method has signature public
+ * void func_76986_a(T entity, double d, double d1, double d2, float f,
+ * float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(
+ EntityLiving p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender(
+ (EntityStaballoyConstruct) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ @Override
+ protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) {
+ this.renderEquippedItems((EntityStaballoyConstruct) p_77029_1_, p_77029_2_);
+ }
+
+ @Override
+ protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
+ this.rotateCorpse((EntityStaballoyConstruct) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker
+ * function which does the actual work. In all probabilty, the class Render
+ * is generic (Render<T extends Entity) and this method has signature public
+ * void func_76986_a(T entity, double d, double d1, double d2, float f,
+ * float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(
+ EntityLivingBase p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender(
+ (EntityStaballoyConstruct) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called
+ * unless you call Render.bindEntityTexture.
+ */
+ @Override
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ return this.getEntityTexture((EntityStaballoyConstruct) p_110775_1_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method,
+ * always casting down its argument and then handing it off to a worker
+ * function which does the actual work. In all probabilty, the class Render
+ * is generic (Render<T extends Entity) and this method has signature public
+ * void func_76986_a(T entity, double d, double d1, double d2, float f,
+ * float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(
+ Entity p_76986_1_,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender(
+ (EntityStaballoyConstruct) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java
index 711cec169b..f06f15980c 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java
@@ -1,11 +1,8 @@
package gtPlusPlus.core.client.renderer;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.entity.projectile.EntityToxinball;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
@@ -13,16 +10,14 @@ import net.minecraft.entity.Entity;
import net.minecraft.init.Items;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
-
-import gtPlusPlus.core.entity.projectile.EntityToxinball;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
@SideOnly(Side.CLIENT)
-public class RenderToxinball extends Render
-{
+public class RenderToxinball extends Render {
private float mSize;
- public RenderToxinball(float scale)
- {
+ public RenderToxinball(float scale) {
this.mSize = scale;
}
@@ -32,11 +27,16 @@ public class RenderToxinball extends Render
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
- public void doRender(EntityToxinball entity, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
- {
+ public void doRender(
+ EntityToxinball entity,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
GL11.glPushMatrix();
this.bindEntityTexture(entity);
- GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
+ GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
float f2 = this.mSize;
GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
@@ -65,8 +65,7 @@ public class RenderToxinball extends Render
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
- protected ResourceLocation getEntityTexture(EntityToxinball entity)
- {
+ protected ResourceLocation getEntityTexture(EntityToxinball entity) {
return TextureMap.locationItemsTexture;
}
@@ -74,9 +73,8 @@ public class RenderToxinball extends Render
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
@Override
- protected ResourceLocation getEntityTexture(Entity entity)
- {
- return this.getEntityTexture((EntityToxinball)entity);
+ protected ResourceLocation getEntityTexture(Entity entity) {
+ return this.getEntityTexture((EntityToxinball) entity);
}
/**
@@ -86,8 +84,13 @@ public class RenderToxinball extends Render
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
@Override
- public void doRender(Entity entity, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
- {
- this.doRender((EntityToxinball)entity, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ public void doRender(
+ Entity entity,
+ double p_76986_2_,
+ double p_76986_4_,
+ double p_76986_6_,
+ float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntityToxinball) entity, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/particle/EntityDropParticleFX.java b/src/main/java/gtPlusPlus/core/client/renderer/particle/EntityDropParticleFX.java
index ed2fdff272..9610fa1c18 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/particle/EntityDropParticleFX.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/particle/EntityDropParticleFX.java
@@ -3,7 +3,6 @@ package gtPlusPlus.core.client.renderer.particle;
import cofh.lib.util.helpers.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EntityFX;
@@ -12,85 +11,97 @@ import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public class EntityDropParticleFX extends EntityFX {
- private int bobTimer;
-
- public EntityDropParticleFX(World world, double x, double y, double z, float particleRed, float particleGreen, float particleBlue) {
-
- this(world, x, y, z, particleRed, particleGreen, particleBlue, -1);
- }
-
- public EntityDropParticleFX(World world, double x, double y, double z, float particleRed, float particleGreen, float particleBlue, int gravityMod) {
-
- super(world, x, y, z, 0.0D, 0.0D, 0.0D);
- this.motionX = this.motionY = this.motionZ = 0.0D;
-
- this.particleRed = particleRed;
- this.particleGreen = particleGreen;
- this.particleBlue = particleBlue;
-
- this.setParticleTextureIndex(113);
- this.setSize(0.01F, 0.01F);
- this.particleGravity = -0.06F * gravityMod;
- this.bobTimer = 40;
- this.particleMaxAge = (int) (48.0D / (Math.random() * 0.8D + 0.2D));
- this.motionX = this.motionY = this.motionZ = 0.0D;
- }
-
- @Override
- public void onUpdate() {
-
- this.prevPosX = this.posX;
- this.prevPosY = this.posY;
- this.prevPosZ = this.posZ;
-
- this.motionY -= this.particleGravity;
-
- if (this.bobTimer-- > 0) {
- this.motionX *= 0.02D;
- this.motionY *= 0.02D;
- this.motionZ *= 0.02D;
- this.setParticleTextureIndex(113);
- } else {
- this.setParticleTextureIndex(112);
- }
- this.moveEntity(this.motionX, this.motionY, this.motionZ);
- this.motionX *= 0.9800000190734863D;
- this.motionY *= 0.9800000190734863D;
- this.motionZ *= 0.9800000190734863D;
-
- if (this.particleMaxAge-- <= 0) {
- this.setDead();
- }
- if (this.onGround) {
- this.setParticleTextureIndex(114);
- this.motionX *= 0.699999988079071D;
- this.motionZ *= 0.699999988079071D;
- }
- if (this.particleGravity > 0) {
- Material material = this.worldObj.getBlock(MathHelper.floor(this.posX), MathHelper.floor(this.posY), MathHelper.floor(this.posZ)).getMaterial();
-
- if (material.isLiquid() || material.isSolid()) {
- double d0 = MathHelper.floor(this.posY)
- + 1
- - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor(this.posX), MathHelper.floor(this.posY),
- MathHelper.floor(this.posZ)));
- if (this.posY < d0) {
- this.setDead();
- }
- }
- } else {
- Material material = this.worldObj.getBlock(MathHelper.ceil(this.posX), MathHelper.ceil(this.posY), MathHelper.ceil(this.posZ)).getMaterial();
-
- if (material.isLiquid() || material.isSolid()) {
- double d0 = MathHelper.ceil(this.posY)
- + 1
- - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.ceil(this.posX), MathHelper.ceil(this.posY),
- MathHelper.ceil(this.posZ)));
- if (this.posY > d0) {
- this.setDead();
- }
- }
- }
- }
-
+ private int bobTimer;
+
+ public EntityDropParticleFX(
+ World world, double x, double y, double z, float particleRed, float particleGreen, float particleBlue) {
+
+ this(world, x, y, z, particleRed, particleGreen, particleBlue, -1);
+ }
+
+ public EntityDropParticleFX(
+ World world,
+ double x,
+ double y,
+ double z,
+ float particleRed,
+ float particleGreen,
+ float particleBlue,
+ int gravityMod) {
+
+ super(world, x, y, z, 0.0D, 0.0D, 0.0D);
+ this.motionX = this.motionY = this.motionZ = 0.0D;
+
+ this.particleRed = particleRed;
+ this.particleGreen = particleGreen;
+ this.particleBlue = particleBlue;
+
+ this.setParticleTextureIndex(113);
+ this.setSize(0.01F, 0.01F);
+ this.particleGravity = -0.06F * gravityMod;
+ this.bobTimer = 40;
+ this.particleMaxAge = (int) (48.0D / (Math.random() * 0.8D + 0.2D));
+ this.motionX = this.motionY = this.motionZ = 0.0D;
+ }
+
+ @Override
+ public void onUpdate() {
+
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+
+ this.motionY -= this.particleGravity;
+
+ if (this.bobTimer-- > 0) {
+ this.motionX *= 0.02D;
+ this.motionY *= 0.02D;
+ this.motionZ *= 0.02D;
+ this.setParticleTextureIndex(113);
+ } else {
+ this.setParticleTextureIndex(112);
+ }
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ this.motionX *= 0.9800000190734863D;
+ this.motionY *= 0.9800000190734863D;
+ this.motionZ *= 0.9800000190734863D;
+
+ if (this.particleMaxAge-- <= 0) {
+ this.setDead();
+ }
+ if (this.onGround) {
+ this.setParticleTextureIndex(114);
+ this.motionX *= 0.699999988079071D;
+ this.motionZ *= 0.699999988079071D;
+ }
+ if (this.particleGravity > 0) {
+ Material material = this.worldObj
+ .getBlock(MathHelper.floor(this.posX), MathHelper.floor(this.posY), MathHelper.floor(this.posZ))
+ .getMaterial();
+
+ if (material.isLiquid() || material.isSolid()) {
+ double d0 = MathHelper.floor(this.posY)
+ + 1
+ - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(
+ MathHelper.floor(this.posX), MathHelper.floor(this.posY), MathHelper.floor(this.posZ)));
+ if (this.posY < d0) {
+ this.setDead();
+ }
+ }
+ } else {
+ Material material = this.worldObj
+ .getBlock(MathHelper.ceil(this.posX), MathHelper.ceil(this.posY), MathHelper.ceil(this.posZ))
+ .getMaterial();
+
+ if (material.isLiquid() || material.isSolid()) {
+ double d0 = MathHelper.ceil(this.posY)
+ + 1
+ - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(
+ MathHelper.ceil(this.posX), MathHelper.ceil(this.posY), MathHelper.ceil(this.posZ)));
+ if (this.posY > d0) {
+ this.setDead();
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/tabula/RenderTabulaBase.java b/src/main/java/gtPlusPlus/core/client/renderer/tabula/RenderTabulaBase.java
index b4f64f9b35..ad2d90f482 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/tabula/RenderTabulaBase.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/tabula/RenderTabulaBase.java
@@ -3,7 +3,6 @@ package gtPlusPlus.core.client.renderer.tabula;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.client.model.tabula.ModelTabulaBase;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
@@ -13,34 +12,36 @@ import net.minecraft.util.ResourceLocation;
@SideOnly(Side.CLIENT)
public class RenderTabulaBase extends TileEntitySpecialRenderer {
- private final ModelTabulaBase mModel;
- private final ResourceLocation mTexture;
- private final Class mTileClass;
-
- public final int mRenderID;
- public final RenderTabulaBase mInstance;
+ private final ModelTabulaBase mModel;
+ private final ResourceLocation mTexture;
+ private final Class mTileClass;
- public RenderTabulaBase(ModelTabulaBase aModel, String aTexturePath, Class aTileClass) {
- mModel = aModel;
- mTexture = new ResourceLocation(CORE.MODID, aTexturePath);
- mTileClass = aTileClass;
- this.mRenderID = RenderingRegistry.getNextAvailableRenderId();
- mInstance = this;
- }
+ public final int mRenderID;
+ public final RenderTabulaBase mInstance;
- public void renderTileEntityAt(Object aTile, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) {
- if (mTileClass.isInstance(aTile)) {
- //Logger.INFO("Rendering EggBox");
- this.bindTexture(mTexture);
- mModel.renderAll();
- }
- }
+ public RenderTabulaBase(ModelTabulaBase aModel, String aTexturePath, Class aTileClass) {
+ mModel = aModel;
+ mTexture = new ResourceLocation(CORE.MODID, aTexturePath);
+ mTileClass = aTileClass;
+ this.mRenderID = RenderingRegistry.getNextAvailableRenderId();
+ mInstance = this;
+ }
- public void renderTileEntityAt(TileEntity aTile, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) {
- if (mTileClass != null && aTile != null) {
- if (mTileClass.isInstance(aTile)) {
- this.renderTileEntityAt((Object) aTile, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_);
- }
- }
- }
-} \ No newline at end of file
+ public void renderTileEntityAt(
+ Object aTile, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) {
+ if (mTileClass.isInstance(aTile)) {
+ // Logger.INFO("Rendering EggBox");
+ this.bindTexture(mTexture);
+ mModel.renderAll();
+ }
+ }
+
+ public void renderTileEntityAt(
+ TileEntity aTile, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) {
+ if (mTileClass != null && aTile != null) {
+ if (mTileClass.isInstance(aTile)) {
+ this.renderTileEntityAt((Object) aTile, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_);
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/commands/CommandDebugChunks.java b/src/main/java/gtPlusPlus/core/commands/CommandDebugChunks.java
index 8e86bcdcd6..f86476b91a 100644
--- a/src/main/java/gtPlusPlus/core/commands/CommandDebugChunks.java
+++ b/src/main/java/gtPlusPlus/core/commands/CommandDebugChunks.java
@@ -1,152 +1,138 @@
package gtPlusPlus.core.commands;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.Pair;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.preloader.ChunkDebugger;
+import gtPlusPlus.preloader.asm.AsmConfig;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gtPlusPlus.preloader.ChunkDebugger;
-import gtPlusPlus.preloader.asm.AsmConfig;
-
-
-public class CommandDebugChunks implements ICommand
-{
- private final List<String> aliases;
-
- protected String fullEntityName;
- protected Entity conjuredEntity;
-
- public CommandDebugChunks(){
- this.aliases = new ArrayList<>();
- aliases.add("debugchunks");
- aliases.add("DC");
- }
-
- @Override
- public int compareTo(final Object o){
- return 0;
-
- }
-
- @Override
- public String getCommandName(){
- return "DebugChunks";
-
- }
-
- @Override
- public String getCommandUsage(final ICommandSender var1){
- return "/DebugChunks";
-
- }
-
- @Override
- public List<String> getCommandAliases(){
- return this.aliases;
-
- }
-
- @Override
- public void processCommand(final ICommandSender S, final String[] argString){
- Logger.INFO("Debug Command");
-
- final World W = S.getEntityWorld();
- final EntityPlayer P = CommandUtils.getPlayer(S);
-
- if (!AsmConfig.enableChunkDebugging) {
- PlayerUtils.messagePlayer(P, "Chunk Debugging is disabled.");
- return;
- }
-
-
- Map<String, Integer> aTicketCounter = new LinkedHashMap<String, Integer>();
- for (Pair<String, String> f : ChunkDebugger.mChunkTicketsMap.values()) {
- String aMod = f.getKey();
- String aDim = f.getValue();
- if (aMod != null) {
- if (aTicketCounter.containsKey(aMod)) {
- int aModTicketCount = aTicketCounter.get(aMod);
- aModTicketCount++;
- aTicketCounter.put(aMod, aModTicketCount);
- }
- else {
- aTicketCounter.put(aMod, 1);
- }
- }
- }
- if (aTicketCounter.isEmpty()) {
- PlayerUtils.messagePlayer(P, "No forced chunk tickets active.");
- }
- for (String x : aTicketCounter.keySet()) {
- PlayerUtils.messagePlayer(P, x+" has "+aTicketCounter.get(x)+" tickets active.");
- }
-
-
- Map<String, Integer> aChunkCounter = new LinkedHashMap<String, Integer>();
- for (Pair<String, String> f : ChunkDebugger.mChunksLoadedByModsMap.values()) {
- String aMod = f.getKey();
- String aDim = f.getValue();
- if (aMod == null) {
- aMod = "Bad ModId";
- }
-
- if (aMod != null) {
- //PlayerUtils.messagePlayer(P, aMod+" has "+aDim+" active.");
- if (aChunkCounter.containsKey(aMod)) {
- int aModTicketCount = aChunkCounter.get(aMod);
- aModTicketCount = aModTicketCount + 1;
- aChunkCounter.put(aMod, aModTicketCount);
- Logger.INFO("Counting +1 for "+aMod+", total of "+aModTicketCount);
- }
- else {
- aChunkCounter.put(aMod, 1);
- Logger.INFO("Counting +1 for "+aMod);
- }
- }
- }
- if (aChunkCounter.isEmpty()) {
- PlayerUtils.messagePlayer(P, "No chunks force loaded.");
- }
- for (String x : aChunkCounter.keySet()) {
- PlayerUtils.messagePlayer(P, x+" has "+aChunkCounter.get(x)+" chunks active.");
- }
-
- }
-
- @Override
- public boolean canCommandSenderUseCommand(final ICommandSender var1){
- final EntityPlayer P = CommandUtils.getPlayer(var1);
- if (P == null){
- return false;
- }
- if (PlayerUtils.isPlayerOP(P)) {
- return true;
- }
- return false;
- }
-
- @Override
- public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2){
- return new ArrayList<>();
- }
-
- @Override
- public boolean isUsernameIndex(final String[] var1, final int var2){
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost){
- return true;
- }
-
-} \ No newline at end of file
+public class CommandDebugChunks implements ICommand {
+ private final List<String> aliases;
+
+ protected String fullEntityName;
+ protected Entity conjuredEntity;
+
+ public CommandDebugChunks() {
+ this.aliases = new ArrayList<>();
+ aliases.add("debugchunks");
+ aliases.add("DC");
+ }
+
+ @Override
+ public int compareTo(final Object o) {
+ return 0;
+ }
+
+ @Override
+ public String getCommandName() {
+ return "DebugChunks";
+ }
+
+ @Override
+ public String getCommandUsage(final ICommandSender var1) {
+ return "/DebugChunks";
+ }
+
+ @Override
+ public List<String> getCommandAliases() {
+ return this.aliases;
+ }
+
+ @Override
+ public void processCommand(final ICommandSender S, final String[] argString) {
+ Logger.INFO("Debug Command");
+
+ final World W = S.getEntityWorld();
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+
+ if (!AsmConfig.enableChunkDebugging) {
+ PlayerUtils.messagePlayer(P, "Chunk Debugging is disabled.");
+ return;
+ }
+
+ Map<String, Integer> aTicketCounter = new LinkedHashMap<String, Integer>();
+ for (Pair<String, String> f : ChunkDebugger.mChunkTicketsMap.values()) {
+ String aMod = f.getKey();
+ String aDim = f.getValue();
+ if (aMod != null) {
+ if (aTicketCounter.containsKey(aMod)) {
+ int aModTicketCount = aTicketCounter.get(aMod);
+ aModTicketCount++;
+ aTicketCounter.put(aMod, aModTicketCount);
+ } else {
+ aTicketCounter.put(aMod, 1);
+ }
+ }
+ }
+ if (aTicketCounter.isEmpty()) {
+ PlayerUtils.messagePlayer(P, "No forced chunk tickets active.");
+ }
+ for (String x : aTicketCounter.keySet()) {
+ PlayerUtils.messagePlayer(P, x + " has " + aTicketCounter.get(x) + " tickets active.");
+ }
+
+ Map<String, Integer> aChunkCounter = new LinkedHashMap<String, Integer>();
+ for (Pair<String, String> f : ChunkDebugger.mChunksLoadedByModsMap.values()) {
+ String aMod = f.getKey();
+ String aDim = f.getValue();
+ if (aMod == null) {
+ aMod = "Bad ModId";
+ }
+
+ if (aMod != null) {
+ // PlayerUtils.messagePlayer(P, aMod+" has "+aDim+" active.");
+ if (aChunkCounter.containsKey(aMod)) {
+ int aModTicketCount = aChunkCounter.get(aMod);
+ aModTicketCount = aModTicketCount + 1;
+ aChunkCounter.put(aMod, aModTicketCount);
+ Logger.INFO("Counting +1 for " + aMod + ", total of " + aModTicketCount);
+ } else {
+ aChunkCounter.put(aMod, 1);
+ Logger.INFO("Counting +1 for " + aMod);
+ }
+ }
+ }
+ if (aChunkCounter.isEmpty()) {
+ PlayerUtils.messagePlayer(P, "No chunks force loaded.");
+ }
+ for (String x : aChunkCounter.keySet()) {
+ PlayerUtils.messagePlayer(P, x + " has " + aChunkCounter.get(x) + " chunks active.");
+ }
+ }
+
+ @Override
+ public boolean canCommandSenderUseCommand(final ICommandSender var1) {
+ final EntityPlayer P = CommandUtils.getPlayer(var1);
+ if (P == null) {
+ return false;
+ }
+ if (PlayerUtils.isPlayerOP(P)) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2) {
+ return new ArrayList<>();
+ }
+
+ @Override
+ public boolean isUsernameIndex(final String[] var1, final int var2) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost) {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
index 4f5615b60a..43b9de8c58 100644
--- a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
+++ b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
@@ -1,13 +1,8 @@
package gtPlusPlus.core.commands;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
@@ -16,6 +11,9 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.preloader.asm.AsmConfig;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
@@ -27,245 +25,238 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
+public class CommandEnableDebugWhileRunning implements ICommand {
+ private final List<String> aliases;
-public class CommandEnableDebugWhileRunning implements ICommand
-{
- private final List<String> aliases;
-
- public CommandEnableDebugWhileRunning(){
- this.aliases = new ArrayList<>();
- this.aliases.add("gtplusplus");
- }
-
- @Override
- public int compareTo(final Object o){
- if (o instanceof Comparable<?>) {
- @SuppressWarnings("unchecked")
- Comparable<ICommand> a = (Comparable<ICommand>) o;
- if (a.equals(this)) {
- return 0;
- }
- else {
- return -1;
- }
- }
- return -1;
- }
-
- @Override
- public String getCommandName(){
- return "gtpp";
-
- }
+ public CommandEnableDebugWhileRunning() {
+ this.aliases = new ArrayList<>();
+ this.aliases.add("gtplusplus");
+ }
+ @Override
+ public int compareTo(final Object o) {
+ if (o instanceof Comparable<?>) {
+ @SuppressWarnings("unchecked")
+ Comparable<ICommand> a = (Comparable<ICommand>) o;
+ if (a.equals(this)) {
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return -1;
+ }
- // Use '/gtpp' along with 'logging' or 'debug' to toggle Debug mode and Logging.
- // Using nothing after the command toggles both to their opposite states respectively.
- @Override
- public String getCommandUsage(final ICommandSender var1){
- return "/gtpp ?";
- }
+ @Override
+ public String getCommandName() {
+ return "gtpp";
+ }
- @Override
- public List<String> getCommandAliases(){
- return this.aliases;
- }
+ // Use '/gtpp' along with 'logging' or 'debug' to toggle Debug mode and Logging.
+ // Using nothing after the command toggles both to their opposite states respectively.
+ @Override
+ public String getCommandUsage(final ICommandSender var1) {
+ return "/gtpp ?";
+ }
- @Override
- public void processCommand(final ICommandSender S, final String[] argString){
- int aMaxArgumentsAllowed = 2;
+ @Override
+ public List<String> getCommandAliases() {
+ return this.aliases;
+ }
- if ((argString == null || argString.length == 0 || argString.length > aMaxArgumentsAllowed) || argString[0].toLowerCase().equals("?")) {
- Logger.INFO("Listing commands and their uses.");
- final EntityPlayer P = CommandUtils.getPlayer(S);
- AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
- PlayerUtils.messagePlayer(P, "The following are valid args for the '/gtpp' command:");
- PlayerUtils.messagePlayer(P, "? - This help command.");
- PlayerUtils.messagePlayer(P, "logging - Toggles ALL GT++ logging for current session.");
- PlayerUtils.messagePlayer(P, "hand - Lists information about held item.");
- PlayerUtils.messagePlayer(P, "fuid xxx - Tries to find the fluid in the FluidRegistry.");
- PlayerUtils.messagePlayer(P, "debug - Toggles GT++ Debug Mode. Only use when advised, may break everything. (OP)");
- }
- else if (argString[0].toLowerCase().equals("debug")) {
- Logger.INFO("Toggling Debug Mode.");
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (PlayerUtils.isPlayerOP(P)) {
- CORE_Preloader.DEBUG_MODE = Utils.invertBoolean(CORE_Preloader.DEBUG_MODE);
- PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE_Preloader.DEBUG_MODE);
- }
- }
- else if (argString[0].toLowerCase().equals("logging")) {
- Logger.INFO("Toggling Logging.");
- final EntityPlayer P = CommandUtils.getPlayer(S);
- AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
- PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: "+(!AsmConfig.disableAllLogging));
- }
- /* else if (argString[0].toLowerCase().equals("test")) {
- ItemStack mSemiFluidgen = ItemUtils.simpleMetaStack("IC2:blockGenerator", 7, 1);
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if(mSemiFluidgen != null) {
- PlayerUtils.messagePlayer(P, ItemUtils.getItemName(mSemiFluidgen));
- }
- }*/
+ @Override
+ public void processCommand(final ICommandSender S, final String[] argString) {
+ int aMaxArgumentsAllowed = 2;
- else if (argString[0].toLowerCase().equals("inv")) {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (P != null && !P.worldObj.isRemote) {
- ItemStack[] aInv = P.inventory.mainInventory;
- for (ItemStack aItem : aInv) {
- if (aItem != null) {
- String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId;
- String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name;
- Logger.INFO(aModID+":"+aRegistryName+":"+aItem.getItemDamage()+" | "+aItem.getDisplayName());
- }
- }
- PlayerUtils.messagePlayer(P, "Dumped Inventory.");
- }
- }
- else if (argString[0].toLowerCase().equals("hand")) {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (P != null) {
- ItemStack aHeldItem = PlayerUtils.getItemStackInPlayersHand(P);
- if (aHeldItem != null) {
- String aItemDisplayName = ItemUtils.getItemName(aHeldItem);
- String aItemUnlocalName = ItemUtils.getUnlocalizedItemName(aHeldItem);
- String aNbtString = tryIterateNBTData(aHeldItem);
- AutoMap<String> aOreDictNames = new AutoMap<String>();
+ if ((argString == null || argString.length == 0 || argString.length > aMaxArgumentsAllowed)
+ || argString[0].toLowerCase().equals("?")) {
+ Logger.INFO("Listing commands and their uses.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
+ PlayerUtils.messagePlayer(P, "The following are valid args for the '/gtpp' command:");
+ PlayerUtils.messagePlayer(P, "? - This help command.");
+ PlayerUtils.messagePlayer(P, "logging - Toggles ALL GT++ logging for current session.");
+ PlayerUtils.messagePlayer(P, "hand - Lists information about held item.");
+ PlayerUtils.messagePlayer(P, "fuid xxx - Tries to find the fluid in the FluidRegistry.");
+ PlayerUtils.messagePlayer(
+ P, "debug - Toggles GT++ Debug Mode. Only use when advised, may break everything. (OP)");
+ } else if (argString[0].toLowerCase().equals("debug")) {
+ Logger.INFO("Toggling Debug Mode.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (PlayerUtils.isPlayerOP(P)) {
+ CORE_Preloader.DEBUG_MODE = Utils.invertBoolean(CORE_Preloader.DEBUG_MODE);
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: " + CORE_Preloader.DEBUG_MODE);
+ }
+ } else if (argString[0].toLowerCase().equals("logging")) {
+ Logger.INFO("Toggling Logging.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: " + (!AsmConfig.disableAllLogging));
+ }
+ /* else if (argString[0].toLowerCase().equals("test")) {
+ ItemStack mSemiFluidgen = ItemUtils.simpleMetaStack("IC2:blockGenerator", 7, 1);
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if(mSemiFluidgen != null) {
+ PlayerUtils.messagePlayer(P, ItemUtils.getItemName(mSemiFluidgen));
+ }
+ }*/
- int[] aOreIDs = OreDictionary.getOreIDs(aHeldItem);
- for (int id : aOreIDs) {
- String aOreNameFromID = OreDictionary.getOreName(id);
- if (aOreNameFromID != null && aOreNameFromID.length() > 0 && !aOreNameFromID.equals("Unknown")) {
- aOreDictNames.add(aOreNameFromID);
- }
- }
+ else if (argString[0].toLowerCase().equals("inv")) {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (P != null && !P.worldObj.isRemote) {
+ ItemStack[] aInv = P.inventory.mainInventory;
+ for (ItemStack aItem : aInv) {
+ if (aItem != null) {
+ String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId;
+ String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name;
+ Logger.INFO(aModID + ":" + aRegistryName + ":" + aItem.getItemDamage() + " | "
+ + aItem.getDisplayName());
+ }
+ }
+ PlayerUtils.messagePlayer(P, "Dumped Inventory.");
+ }
+ } else if (argString[0].toLowerCase().equals("hand")) {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (P != null) {
+ ItemStack aHeldItem = PlayerUtils.getItemStackInPlayersHand(P);
+ if (aHeldItem != null) {
+ String aItemDisplayName = ItemUtils.getItemName(aHeldItem);
+ String aItemUnlocalName = ItemUtils.getUnlocalizedItemName(aHeldItem);
+ String aNbtString = tryIterateNBTData(aHeldItem);
+ AutoMap<String> aOreDictNames = new AutoMap<String>();
- String aOreDictData = "";
- if (!aOreDictNames.isEmpty()) {
- for (String tag : aOreDictNames) {
- aOreDictData += (tag+", ");
- }
- if (aOreDictData.endsWith(", ")) {
- aOreDictData = aOreDictData.substring(0, aOreDictData.length()-2);
- }
- }
-
- AutoMap<String> aFluidContainerData = new AutoMap<String>();
- FluidStack aHeldItemFluid = FluidContainerRegistry.getFluidForFilledItem(aHeldItem);
- if (aHeldItemFluid != null) {
- aFluidContainerData.put("FluidStack Unlocal Name: "+aHeldItemFluid.getUnlocalizedName());
- aFluidContainerData.put("FluidStack Local Name: "+aHeldItemFluid.getLocalizedName());
- aFluidContainerData.put("Fluid Unlocal Name: "+aHeldItemFluid.getFluid().getUnlocalizedName());
- aFluidContainerData.put("Fluid Local Name: "+aHeldItemFluid.getFluid().getLocalizedName());
- aFluidContainerData.put("Fluid Name: "+aHeldItemFluid.getFluid().getName());
- }
+ int[] aOreIDs = OreDictionary.getOreIDs(aHeldItem);
+ for (int id : aOreIDs) {
+ String aOreNameFromID = OreDictionary.getOreName(id);
+ if (aOreNameFromID != null
+ && aOreNameFromID.length() > 0
+ && !aOreNameFromID.equals("Unknown")) {
+ aOreDictNames.add(aOreNameFromID);
+ }
+ }
- PlayerUtils.messagePlayer(P, "["+aItemUnlocalName+"]"+"["+aItemDisplayName+"] ");
- if (aFluidContainerData.size() > 0) {
- for (String s : aFluidContainerData) {
- PlayerUtils.messagePlayer(P, ""+s);
- }
- }
- if (!aOreDictNames.isEmpty()) {
- PlayerUtils.messagePlayer(P, ""+aOreDictData);
- }
- if (aNbtString.length() > 0) {
- PlayerUtils.messagePlayer(P, ""+aNbtString);
- }
- }
- else {
- PlayerUtils.messagePlayer(P, "No item held.");
- }
- }
- }
- else if (argString[0].toLowerCase().equals("fluid")) {
- if (argString.length > 1 && argString[1] != null && argString[1].length() > 0) {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- FluidStack aFluid = FluidUtils.getWildcardFluidStack(argString[1], 1);
- if (P != null && aFluid != null) {
- PlayerUtils.messagePlayer(P, "Found fluid stack: "+FluidRegistry.getFluidName(aFluid));
- }
- else if (P != null && aFluid == null) {
- PlayerUtils.messagePlayer(P, "Could not find any fluids.");
- }
- }
- }
- else if (argString[0].toLowerCase().equals("item")) {
- if (argString.length > 1 && argString[1] != null && argString[1].length() > 0) {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- ItemStack aTest = ItemUtils.getItemStackFromFQRN(argString[1], 1);
- if (P != null && aTest != null) {
- PlayerUtils.messagePlayer(P, "Found fluid stack: "+ItemUtils.getItemName(aTest));
- }
- else if (P != null && aTest == null) {
- PlayerUtils.messagePlayer(P, "Could not find valid item.");
- }
- }
- }
- else {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'");
- }
+ String aOreDictData = "";
+ if (!aOreDictNames.isEmpty()) {
+ for (String tag : aOreDictNames) {
+ aOreDictData += (tag + ", ");
+ }
+ if (aOreDictData.endsWith(", ")) {
+ aOreDictData = aOreDictData.substring(0, aOreDictData.length() - 2);
+ }
+ }
- }
+ AutoMap<String> aFluidContainerData = new AutoMap<String>();
+ FluidStack aHeldItemFluid = FluidContainerRegistry.getFluidForFilledItem(aHeldItem);
+ if (aHeldItemFluid != null) {
+ aFluidContainerData.put("FluidStack Unlocal Name: " + aHeldItemFluid.getUnlocalizedName());
+ aFluidContainerData.put("FluidStack Local Name: " + aHeldItemFluid.getLocalizedName());
+ aFluidContainerData.put("Fluid Unlocal Name: "
+ + aHeldItemFluid.getFluid().getUnlocalizedName());
+ aFluidContainerData.put(
+ "Fluid Local Name: " + aHeldItemFluid.getFluid().getLocalizedName());
+ aFluidContainerData.put(
+ "Fluid Name: " + aHeldItemFluid.getFluid().getName());
+ }
- @Override
- public boolean canCommandSenderUseCommand(final ICommandSender var1){
- if (var1 == null || CommandUtils.getPlayer(var1) == null) {
- return false;
- }
- return true;
- }
+ PlayerUtils.messagePlayer(P, "[" + aItemUnlocalName + "]" + "[" + aItemDisplayName + "] ");
+ if (aFluidContainerData.size() > 0) {
+ for (String s : aFluidContainerData) {
+ PlayerUtils.messagePlayer(P, "" + s);
+ }
+ }
+ if (!aOreDictNames.isEmpty()) {
+ PlayerUtils.messagePlayer(P, "" + aOreDictData);
+ }
+ if (aNbtString.length() > 0) {
+ PlayerUtils.messagePlayer(P, "" + aNbtString);
+ }
+ } else {
+ PlayerUtils.messagePlayer(P, "No item held.");
+ }
+ }
+ } else if (argString[0].toLowerCase().equals("fluid")) {
+ if (argString.length > 1 && argString[1] != null && argString[1].length() > 0) {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ FluidStack aFluid = FluidUtils.getWildcardFluidStack(argString[1], 1);
+ if (P != null && aFluid != null) {
+ PlayerUtils.messagePlayer(P, "Found fluid stack: " + FluidRegistry.getFluidName(aFluid));
+ } else if (P != null && aFluid == null) {
+ PlayerUtils.messagePlayer(P, "Could not find any fluids.");
+ }
+ }
+ } else if (argString[0].toLowerCase().equals("item")) {
+ if (argString.length > 1 && argString[1] != null && argString[1].length() > 0) {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ ItemStack aTest = ItemUtils.getItemStackFromFQRN(argString[1], 1);
+ if (P != null && aTest != null) {
+ PlayerUtils.messagePlayer(P, "Found fluid stack: " + ItemUtils.getItemName(aTest));
+ } else if (P != null && aTest == null) {
+ PlayerUtils.messagePlayer(P, "Could not find valid item.");
+ }
+ }
+ } else {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'");
+ }
+ }
- @Override
- public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2){
- ArrayList<String> aTabCompletes = new ArrayList<String>();
- aTabCompletes.add("?");
- aTabCompletes.add("logging");
- aTabCompletes.add("debug");
- aTabCompletes.add("hand");
- aTabCompletes.add("fluid");
- return aTabCompletes;
- }
+ @Override
+ public boolean canCommandSenderUseCommand(final ICommandSender var1) {
+ if (var1 == null || CommandUtils.getPlayer(var1) == null) {
+ return false;
+ }
+ return true;
+ }
- @Override
- public boolean isUsernameIndex(final String[] var1, final int var2){
- // TODO Auto-generated method stub
- return false;
- }
+ @Override
+ public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2) {
+ ArrayList<String> aTabCompletes = new ArrayList<String>();
+ aTabCompletes.add("?");
+ aTabCompletes.add("logging");
+ aTabCompletes.add("debug");
+ aTabCompletes.add("hand");
+ aTabCompletes.add("fluid");
+ return aTabCompletes;
+ }
- public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost){
- return true;
- }
+ @Override
+ public boolean isUsernameIndex(final String[] var1, final int var2) {
+ // TODO Auto-generated method stub
+ return false;
+ }
- public static String tryIterateNBTData(ItemStack aStack) {
- try {
- AutoMap<String> aItemDataTags = new AutoMap<String>();
- NBTTagCompound aNBT = NBTUtils.getNBT(aStack);
- if (aNBT != null) {
- if (!aNBT.hasNoTags()) {
- Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
- if (mInternalMap != null) {
- for (Map.Entry<?, ?> e : mInternalMap.entrySet()) {
- aItemDataTags.add(e.getKey().toString()+":"+e.getValue());
- }
- int a = 0;
- String data = "";
- for (String tag : aItemDataTags) {
- data += (tag+", ");
- }
- if (data.endsWith(", ")) {
- data = data.substring(0, data.length()-2);
- }
- return data;
- } else {
- Logger.INFO("Data map reflected from NBTTagCompound was not valid.");
- return "Bad NBT";
- }
- }
- }
- } catch (Throwable t) {}
- return "";
- }
+ public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost) {
+ return true;
+ }
-} \ No newline at end of file
+ public static String tryIterateNBTData(ItemStack aStack) {
+ try {
+ AutoMap<String> aItemDataTags = new AutoMap<String>();
+ NBTTagCompound aNBT = NBTUtils.getNBT(aStack);
+ if (aNBT != null) {
+ if (!aNBT.hasNoTags()) {
+ Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
+ if (mInternalMap != null) {
+ for (Map.Entry<?, ?> e : mInternalMap.entrySet()) {
+ aItemDataTags.add(e.getKey().toString() + ":" + e.getValue());
+ }
+ int a = 0;
+ String data = "";
+ for (String tag : aItemDataTags) {
+ data += (tag + ", ");
+ }
+ if (data.endsWith(", ")) {
+ data = data.substring(0, data.length() - 2);
+ }
+ return data;
+ } else {
+ Logger.INFO("Data map reflected from NBTTagCompound was not valid.");
+ return "Bad NBT";
+ }
+ }
+ }
+ } catch (Throwable t) {
+ }
+ return "";
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/commands/CommandMath.java b/src/main/java/gtPlusPlus/core/commands/CommandMath.java
index 5ccfb3397f..b26f93c56a 100644
--- a/src/main/java/gtPlusPlus/core/commands/CommandMath.java
+++ b/src/main/java/gtPlusPlus/core/commands/CommandMath.java
@@ -1,100 +1,86 @@
package gtPlusPlus.core.commands;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.MiningUtils;
import java.util.ArrayList;
-import java.util.LinkedHashMap;
import java.util.List;
-import java.util.Map;
-
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.MiningUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gtPlusPlus.preloader.ChunkDebugger;
-
-
-public class CommandMath implements ICommand
-{
- private final List<String> aliases;
-
- protected String fullEntityName;
- protected Entity conjuredEntity;
-
- public CommandMath(){
- this.aliases = new ArrayList<>();
- //this.aliases.add("hometele");
- //this.aliases.add("warphome");
- }
-
- @Override
- public int compareTo(final Object o){
- return 0;
-
- }
-
- @Override
- public String getCommandName(){
- return "alkalus";
-
- }
-
- @Override
- public String getCommandUsage(final ICommandSender var1){
- return "/alkalus [Dev Command]";
-
- }
-
- @Override
- public List<String> getCommandAliases(){
- return this.aliases;
-
- }
-
- @Override
- public void processCommand(final ICommandSender S, final String[] argString){
- Logger.INFO("Debug Command");
- final World W = S.getEntityWorld();
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (P.getDisplayName().equalsIgnoreCase("draknyte1")) {
- Logger.INFO("[Bedrock Miner] OreType Scan");
- MiningUtils.iterateAllOreTypes();
- }
-
- }
-
- @Override
- public boolean canCommandSenderUseCommand(final ICommandSender var1){
- final EntityPlayer P = CommandUtils.getPlayer(var1);
- if (P == null){
- return false;
- }
- if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1") || CORE.DEVENV) {
- return true;
- }
- return false;
- }
-
- @Override
- public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2){
- return null;
- }
-
- @Override
- public boolean isUsernameIndex(final String[] var1, final int var2){
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost){
-
-
- return true;
- }
-
-} \ No newline at end of file
+public class CommandMath implements ICommand {
+ private final List<String> aliases;
+
+ protected String fullEntityName;
+ protected Entity conjuredEntity;
+
+ public CommandMath() {
+ this.aliases = new ArrayList<>();
+ // this.aliases.add("hometele");
+ // this.aliases.add("warphome");
+ }
+
+ @Override
+ public int compareTo(final Object o) {
+ return 0;
+ }
+
+ @Override
+ public String getCommandName() {
+ return "alkalus";
+ }
+
+ @Override
+ public String getCommandUsage(final ICommandSender var1) {
+ return "/alkalus [Dev Command]";
+ }
+
+ @Override
+ public List<String> getCommandAliases() {
+ return this.aliases;
+ }
+
+ @Override
+ public void processCommand(final ICommandSender S, final String[] argString) {
+ Logger.INFO("Debug Command");
+ final World W = S.getEntityWorld();
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (P.getDisplayName().equalsIgnoreCase("draknyte1")) {
+ Logger.INFO("[Bedrock Miner] OreType Scan");
+ MiningUtils.iterateAllOreTypes();
+ }
+ }
+
+ @Override
+ public boolean canCommandSenderUseCommand(final ICommandSender var1) {
+ final EntityPlayer P = CommandUtils.getPlayer(var1);
+ if (P == null) {
+ return false;
+ }
+ if (P.getDisplayName().toLowerCase().equals("draknyte1")
+ || P.getCommandSenderName().toLowerCase().equals("draknyte1")
+ || CORE.DEVENV) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2) {
+ return null;
+ }
+
+ @Override
+ public boolean isUsernameIndex(final String[] var1, final int var2) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost) {
+
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/commands/CommandUtils.java b/src/main/java/gtPlusPlus/core/commands/CommandUtils.java
index 175925d40c..931ac5239f 100644
--- a/src/main/java/gtPlusPlus/core/commands/CommandUtils.java
+++ b/src/main/java/gtPlusPlus/core/commands/CommandUtils.java
@@ -5,16 +5,14 @@ import net.minecraft.entity.player.EntityPlayer;
public class CommandUtils {
- public static EntityPlayer getPlayer(final ICommandSender icommandsender){
- EntityPlayer player;
-
- if(icommandsender instanceof EntityPlayer){
- player = (EntityPlayer)icommandsender;
- return player;
- }
- else {
- return null;
- }
- }
+ public static EntityPlayer getPlayer(final ICommandSender icommandsender) {
+ EntityPlayer player;
+ if (icommandsender instanceof EntityPlayer) {
+ player = (EntityPlayer) icommandsender;
+ return player;
+ } else {
+ return null;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/BasePlayer.java b/src/main/java/gtPlusPlus/core/common/BasePlayer.java
index 4686f34207..69cd46178a 100644
--- a/src/main/java/gtPlusPlus/core/common/BasePlayer.java
+++ b/src/main/java/gtPlusPlus/core/common/BasePlayer.java
@@ -10,203 +10,205 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.util.MovementInputFromOptions;
-public class BasePlayer extends ClientPlayerBase
-{
- private final Minecraft mc = Minecraft.getMinecraft();
- private final CustomMovementHandler customMovementInput = new CustomMovementHandler();
- private final GameSettings settings = this.mc.gameSettings;
-
- public BasePlayer(final ClientPlayerAPI api)
- {
- super(api);
- }
-
- /*
- * EntityPlayerSP.onLivingUpdate() - Adapted to PlayerAPI
- */
- @Override
- public void onLivingUpdate() {
-
- super.onLivingUpdate();
- EntityPlayer aPlayer = this.player;
- if (aPlayer != null) {
- SneakManager aSneak = SneakManager.get(aPlayer);
- if (!aSneak.isWearingRing()) {
- return;
- }
- }
-
- if(this.player.sprintingTicksLeft > 0)
- {
- --this.player.sprintingTicksLeft;
- if(this.player.sprintingTicksLeft == 0)
- {
- this.player.setSprinting(false);
- }
- }
-
- if(this.playerAPI.getSprintToggleTimerField() > 0)
- {
- this.playerAPI.setSprintToggleTimerField(this.playerAPI.getSprintToggleTimerField() - 1);
- }
-
- if(this.mc.playerController.enableEverythingIsScrewedUpMode())
- {
- this.player.posX = this.player.posZ = 0.5D;
- this.player.posX = 0.0D;
- this.player.posZ = 0.0D;
- this.player.rotationYaw = this.player.ticksExisted / 12.0F;
- this.player.rotationPitch = 10.0F;
- this.player.posY = 68.5D;
- }
- else
- {
-
-
-
-
- final boolean isJumping = this.player.movementInput.jump;
-
- final float minSpeed = 0.8F;
- final boolean isMovingForward = this.player.movementInput.moveForward >= minSpeed;
- this.customMovementInput.update(this.mc, (MovementInputFromOptions)this.player.movementInput, this.player);
-
-
- /*
- * Begin ToggleSneak Changes - ToggleSprint
- */
- SneakManager aSneak = SneakManager.get(this.player);
-
- final boolean isSprintDisabled = false;
- final boolean canDoubleTap = aSneak.optionDoubleTap;
-
-
- // Detect when ToggleSprint was disabled in the in-game options menu
- if(aSneak.wasSprintDisabled)
- {
- this.player.setSprinting(false);
- this.customMovementInput.UpdateSprint(false, false, aSneak);
- aSneak.wasSprintDisabled = false;
- }
-
- // Default Sprint routine converted to PlayerAPI, use if ToggleSprint is disabled - TODO - Disable sprinting as a whole
- if(isSprintDisabled)
- {
- //Utils.LOG_INFO("Sprint pressed");
- if(aSneak.optionDoubleTap && this.player.onGround && !isMovingForward && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isSprinting() && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness))
- {
- if((this.playerAPI.getSprintToggleTimerField() <= 0) && !this.settings.keyBindSprint.getIsKeyPressed())
- {
- this.playerAPI.setSprintToggleTimerField(7);
- }
- else
- {
- if (aSneak.Sprinting()){
- this.player.setSprinting(true);
- this.customMovementInput.UpdateSprint(true, false, aSneak);
- }
- else {
- this.player.setSprinting(false);
- this.customMovementInput.UpdateSprint(false, false, aSneak);
- }
- }
- }
-
- if(!this.player.isSprinting() && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && this.settings.keyBindSprint.getIsKeyPressed())
- {
- if (aSneak.Sprinting()){
- this.player.setSprinting(true);
- this.customMovementInput.UpdateSprint(true, false, aSneak);
- }
- else {
- this.player.setSprinting(false);
- this.customMovementInput.UpdateSprint(false, false, aSneak);
- }
- }
- }
- else
- {
- final boolean state = this.customMovementInput.sprint;
-
- // Only handle changes in state under the following conditions:
- // On ground, not hungry, not eating/using item, not blind, and not Vanilla
- //
- // 5/6/14 - onGround check removed to match vanilla's 'start sprint while jumping' behavior.
- //if(this.player.onGround && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased)
-
- if(!this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased)
- {
- if((canDoubleTap && !this.player.isSprinting()) || !canDoubleTap)
- {
- if (aSneak.Sprinting()){
- this.player.setSprinting(state);
- } else {
- this.player.setSprinting(false);
- }
- }
- }
-
- if(canDoubleTap && !state && this.player.onGround && !isMovingForward && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isSprinting() && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness))
- {
- if(this.playerAPI.getSprintToggleTimerField() == 0)
- {
- this.playerAPI.setSprintToggleTimerField(7);
- }
- else
- {
- if (aSneak.Sprinting()){
- this.player.setSprinting(true);
- this.customMovementInput.UpdateSprint(true, true, aSneak);
- this.playerAPI.setSprintToggleTimerField(0);
- }
- }
- }
- }
-
- // If sprinting, break the sprint in appropriate circumstances:
- // Player stops moving forward, runs into something, or gets too hungry
- if(this.player.isSprinting() && ((this.player.movementInput.moveForward < minSpeed) || this.player.isCollidedHorizontally))
- {
- this.player.setSprinting(false);
-
- // Undo toggle if we resumed vanilla operation due to Hold&Release, DoubleTap, Fly, Ride
- if ((this.customMovementInput.sprintHeldAndReleased == true) || isSprintDisabled || this.customMovementInput.sprintDoubleTapped || this.player.capabilities.isFlying || this.player.isRiding())
- {
- this.customMovementInput.UpdateSprint(false, false, aSneak);
- }
- }
-
- /*
- * End ToggleSneak Changes - ToggleSprint
- */
-
- // //
- // // Debug Framework - Added 5/7/2014
- // //
- // if (this.showDebug && this.settings.keyBindPickBlock.getIsKeyPressed() && !this.handledDebugPress)
- // {
- // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+"));
- // this.player.addChatMessage(new ChatComponentText("| ToggleSneak Debug Info |"));
- // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+"));
- // this.player.addChatMessage(new ChatComponentText(" "));
- // this.player.addChatMessage(new ChatComponentText("isFlying - " + (this.player.capabilities.isFlying == true ? "True" : "False")));
- // this.player.addChatMessage(new ChatComponentText("isCreative - " + (this.player.capabilities.isCreativeMode == true ? "True" : "False")));
- // this.player.addChatMessage(new ChatComponentText("enableFlyBoost - " + (SneakManager.optionEnableFlyBoost == true ? "True" : "False")));
- // this.player.addChatMessage(new ChatComponentText("flyBoostAmount - " + SneakManager.optionFlyBoostAmount));
- // this.player.addChatMessage(new ChatComponentText(" "));
- // this.player.addChatMessage(new ChatComponentText("keybindSprint - " + (this.settings.keyBindSprint.getIsKeyPressed() == true ? "True" : "False")));
- // this.player.addChatMessage(new ChatComponentText("keybindSneak - " + (this.settings.keyBindSneak.getIsKeyPressed() == true ? "True" : "False")));
- // this.player.addChatMessage(new ChatComponentText("keybindJump - " + (this.settings.keyBindJump.getIsKeyPressed() == true ? "True" : "False")));
- // this.player.addChatMessage(new ChatComponentText(" "));
- // this.player.addChatMessage(new ChatComponentText(" "));
- //
- // this.handledDebugPress = true;
- // }
- // else if (this.showDebug && !this.settings.keyBindPickBlock.getIsKeyPressed() && this.handledDebugPress)
- // {
- // this.handledDebugPress = false;
- // }
-
- }
- }
-} \ No newline at end of file
+public class BasePlayer extends ClientPlayerBase {
+ private final Minecraft mc = Minecraft.getMinecraft();
+ private final CustomMovementHandler customMovementInput = new CustomMovementHandler();
+ private final GameSettings settings = this.mc.gameSettings;
+
+ public BasePlayer(final ClientPlayerAPI api) {
+ super(api);
+ }
+
+ /*
+ * EntityPlayerSP.onLivingUpdate() - Adapted to PlayerAPI
+ */
+ @Override
+ public void onLivingUpdate() {
+
+ super.onLivingUpdate();
+ EntityPlayer aPlayer = this.player;
+ if (aPlayer != null) {
+ SneakManager aSneak = SneakManager.get(aPlayer);
+ if (!aSneak.isWearingRing()) {
+ return;
+ }
+ }
+
+ if (this.player.sprintingTicksLeft > 0) {
+ --this.player.sprintingTicksLeft;
+ if (this.player.sprintingTicksLeft == 0) {
+ this.player.setSprinting(false);
+ }
+ }
+
+ if (this.playerAPI.getSprintToggleTimerField() > 0) {
+ this.playerAPI.setSprintToggleTimerField(this.playerAPI.getSprintToggleTimerField() - 1);
+ }
+
+ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) {
+ this.player.posX = this.player.posZ = 0.5D;
+ this.player.posX = 0.0D;
+ this.player.posZ = 0.0D;
+ this.player.rotationYaw = this.player.ticksExisted / 12.0F;
+ this.player.rotationPitch = 10.0F;
+ this.player.posY = 68.5D;
+ } else {
+
+ final boolean isJumping = this.player.movementInput.jump;
+
+ final float minSpeed = 0.8F;
+ final boolean isMovingForward = this.player.movementInput.moveForward >= minSpeed;
+ this.customMovementInput.update(this.mc, (MovementInputFromOptions) this.player.movementInput, this.player);
+
+ /*
+ * Begin ToggleSneak Changes - ToggleSprint
+ */
+ SneakManager aSneak = SneakManager.get(this.player);
+
+ final boolean isSprintDisabled = false;
+ final boolean canDoubleTap = aSneak.optionDoubleTap;
+
+ // Detect when ToggleSprint was disabled in the in-game options menu
+ if (aSneak.wasSprintDisabled) {
+ this.player.setSprinting(false);
+ this.customMovementInput.UpdateSprint(false, false, aSneak);
+ aSneak.wasSprintDisabled = false;
+ }
+
+ // Default Sprint routine converted to PlayerAPI, use if ToggleSprint is disabled - TODO - Disable sprinting
+ // as a whole
+ if (isSprintDisabled) {
+ // Utils.LOG_INFO("Sprint pressed");
+ if (aSneak.optionDoubleTap
+ && this.player.onGround
+ && !isMovingForward
+ && (this.player.movementInput.moveForward >= minSpeed)
+ && !this.player.isSprinting()
+ && !this.player.isUsingItem()
+ && !this.player.isPotionActive(Potion.blindness)) {
+ if ((this.playerAPI.getSprintToggleTimerField() <= 0)
+ && !this.settings.keyBindSprint.getIsKeyPressed()) {
+ this.playerAPI.setSprintToggleTimerField(7);
+ } else {
+ if (aSneak.Sprinting()) {
+ this.player.setSprinting(true);
+ this.customMovementInput.UpdateSprint(true, false, aSneak);
+ } else {
+ this.player.setSprinting(false);
+ this.customMovementInput.UpdateSprint(false, false, aSneak);
+ }
+ }
+ }
+
+ if (!this.player.isSprinting()
+ && (this.player.movementInput.moveForward >= minSpeed)
+ && !this.player.isUsingItem()
+ && !this.player.isPotionActive(Potion.blindness)
+ && this.settings.keyBindSprint.getIsKeyPressed()) {
+ if (aSneak.Sprinting()) {
+ this.player.setSprinting(true);
+ this.customMovementInput.UpdateSprint(true, false, aSneak);
+ } else {
+ this.player.setSprinting(false);
+ this.customMovementInput.UpdateSprint(false, false, aSneak);
+ }
+ }
+ } else {
+ final boolean state = this.customMovementInput.sprint;
+
+ // Only handle changes in state under the following conditions:
+ // On ground, not hungry, not eating/using item, not blind, and not Vanilla
+ //
+ // 5/6/14 - onGround check removed to match vanilla's 'start sprint while jumping' behavior.
+ // if(this.player.onGround && enoughHunger && !this.player.isUsingItem() &&
+ // !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased)
+
+ if (!this.player.isUsingItem()
+ && !this.player.isPotionActive(Potion.blindness)
+ && !this.customMovementInput.sprintHeldAndReleased) {
+ if ((canDoubleTap && !this.player.isSprinting()) || !canDoubleTap) {
+ if (aSneak.Sprinting()) {
+ this.player.setSprinting(state);
+ } else {
+ this.player.setSprinting(false);
+ }
+ }
+ }
+
+ if (canDoubleTap
+ && !state
+ && this.player.onGround
+ && !isMovingForward
+ && (this.player.movementInput.moveForward >= minSpeed)
+ && !this.player.isSprinting()
+ && !this.player.isUsingItem()
+ && !this.player.isPotionActive(Potion.blindness)) {
+ if (this.playerAPI.getSprintToggleTimerField() == 0) {
+ this.playerAPI.setSprintToggleTimerField(7);
+ } else {
+ if (aSneak.Sprinting()) {
+ this.player.setSprinting(true);
+ this.customMovementInput.UpdateSprint(true, true, aSneak);
+ this.playerAPI.setSprintToggleTimerField(0);
+ }
+ }
+ }
+ }
+
+ // If sprinting, break the sprint in appropriate circumstances:
+ // Player stops moving forward, runs into something, or gets too hungry
+ if (this.player.isSprinting()
+ && ((this.player.movementInput.moveForward < minSpeed) || this.player.isCollidedHorizontally)) {
+ this.player.setSprinting(false);
+
+ // Undo toggle if we resumed vanilla operation due to Hold&Release, DoubleTap, Fly, Ride
+ if ((this.customMovementInput.sprintHeldAndReleased == true)
+ || isSprintDisabled
+ || this.customMovementInput.sprintDoubleTapped
+ || this.player.capabilities.isFlying
+ || this.player.isRiding()) {
+ this.customMovementInput.UpdateSprint(false, false, aSneak);
+ }
+ }
+
+ /*
+ * End ToggleSneak Changes - ToggleSprint
+ */
+
+ // //
+ // // Debug Framework - Added 5/7/2014
+ // //
+ // if (this.showDebug && this.settings.keyBindPickBlock.getIsKeyPressed() && !this.handledDebugPress)
+ // {
+ // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+"));
+ // this.player.addChatMessage(new ChatComponentText("| ToggleSneak Debug Info |"));
+ // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+"));
+ // this.player.addChatMessage(new ChatComponentText(" "));
+ // this.player.addChatMessage(new ChatComponentText("isFlying - " +
+ // (this.player.capabilities.isFlying == true ? "True" : "False")));
+ // this.player.addChatMessage(new ChatComponentText("isCreative - " +
+ // (this.player.capabilities.isCreativeMode == true ? "True" : "False")));
+ // this.player.addChatMessage(new ChatComponentText("enableFlyBoost - " +
+ // (SneakManager.optionEnableFlyBoost == true ? "True" : "False")));
+ // this.player.addChatMessage(new ChatComponentText("flyBoostAmount - " +
+ // SneakManager.optionFlyBoostAmount));
+ // this.player.addChatMessage(new ChatComponentText(" "));
+ // this.player.addChatMessage(new ChatComponentText("keybindSprint - " +
+ // (this.settings.keyBindSprint.getIsKeyPressed() == true ? "True" : "False")));
+ // this.player.addChatMessage(new ChatComponentText("keybindSneak - " +
+ // (this.settings.keyBindSneak.getIsKeyPressed() == true ? "True" : "False")));
+ // this.player.addChatMessage(new ChatComponentText("keybindJump - " +
+ // (this.settings.keyBindJump.getIsKeyPressed() == true ? "True" : "False")));
+ // this.player.addChatMessage(new ChatComponentText(" "));
+ // this.player.addChatMessage(new ChatComponentText(" "));
+ //
+ // this.handledDebugPress = true;
+ // }
+ // else if (this.showDebug && !this.settings.keyBindPickBlock.getIsKeyPressed() && this.handledDebugPress)
+ // {
+ // this.handledDebugPress = false;
+ // }
+
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/common/CommonProxy.java b/src/main/java/gtPlusPlus/core/common/CommonProxy.java
index 2909ef3541..421dd05b8f 100644
--- a/src/main/java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/main/java/gtPlusPlus/core/common/CommonProxy.java
@@ -3,7 +3,6 @@ package gtPlusPlus.core.common;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.enums.OrePrefixes;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -18,12 +17,10 @@ import gtPlusPlus.core.fluids.FluidFactory;
import gtPlusPlus.core.handler.*;
import gtPlusPlus.core.handler.events.*;
import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.item.chemistry.GenericChem;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
-import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.tileentities.ModTileEntities;
import gtPlusPlus.core.util.Utils;
@@ -36,7 +33,6 @@ import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner;
import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.xmod.eio.handler.HandlerTooltip_EIO;
import gtPlusPlus.xmod.galacticraft.handler.HandlerTooltip_GC;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
@@ -50,261 +46,258 @@ import net.minecraftforge.client.IItemRenderer;
public class CommonProxy {
- public CommonProxy() {
- // Should Register Gregtech Materials I've Made
- Utils.registerEvent(this);
- if (!CORE.GTNH) {
- Logger.INFO("We're using Gregtech " + Utils.getGregtechVersionAsString());
- } else {
- Logger.INFO("We're using GTNH's Gregtech " + Utils.getGregtechVersionAsString());
- }
- }
-
- public void preInit(final FMLPreInitializationEvent e) {
- Logger.INFO("Doing some house cleaning.");
- LoadedMods.checkLoaded();
- Logger.INFO("Making sure we're ready to party!");
-
- if (!CORE_Preloader.DEBUG_MODE) {
- Logger.WARNING("Development mode not enabled.");
- } else if (CORE_Preloader.DEBUG_MODE) {
- Logger.INFO("Development mode enabled.");
- } else {
- Logger.WARNING("Development mode not set.");
- }
-
- AddToCreativeTab.initialiseTabs();
- EnumHelperHandler.init();
-
- // Moved from Init after Debug Loading.
- // 29/01/18 - Alkalus
- // Moved earlier into PreInit, so that Items exist before they're called upon in
- // recipes.
- // 20/03/18 - Alkalus
- ModItems.init();
- ModBlocks.init();
- CI.preInit();
- FluidFactory.preInit();
- COMPAT_IntermodStaging.preInit(e);
- BookHandler.run();
- // Registration of entities and renderers
- Logger.INFO("[Proxy] Calling Entity registrator.");
- registerEntities();
- Logger.INFO("[Proxy] Calling Tile Entity registrator.");
- registerTileEntities();
-
- Logger.INFO("[Proxy] Calling Render registrator.");
- registerRenderThings();
-
- }
-
- public void init(final FMLInitializationEvent e) {
- // Debug Loading
- if (CORE_Preloader.DEBUG_MODE) {
- DEBUG_INIT.registerHandlers();
- }
-
- registerCustomItemsForMaterials();
- ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner();
- CI.init();
- FluidFactory.init();
-
- /**
- * Register the Event Handlers.
- */
-
- // Prevents my Safes being destroyed.
- Utils.registerEvent(new PickaxeBlockBreakEventHandler());
- // Block Handler for all events.
- Utils.registerEvent(new BlockEventHandler());
- Utils.registerEvent(new GeneralTooltipEventHandler());
- // Handles Tooltips for items giving custom multiblock behaviour
- Utils.registerEvent(new SpecialBehaviourTooltipHandler());
- // Handles Custom tooltips for EIO.
- Utils.registerEvent(new HandlerTooltip_EIO());
- // Handles Custom Tooltips for GC
- Utils.registerEvent(new HandlerTooltip_GC());
- // Handles Sleep Benefits
- PlayerSleepEventHandler.init();
- // Handles Magic Feather
- Utils.registerEvent(ModItems.itemMagicFeather);
-
- if (CORE.DEVENV) {
- Utils.registerEvent(new StopAnnoyingFuckingAchievements());
- }
-
- Utils.registerEvent(new EnderDragonDeathHandler());
- Utils.registerEvent(new EntityDeathHandler());
-
- if (ConfigSwitches.disableZombieReinforcement) {
- // Make Zombie reinforcements fuck off.
- Utils.registerEvent(new ZombieBackupSpawnEventHandler());
- }
-
- /**
- * End of Subscribe Event registration.
- */
-
- // Compat Handling
- COMPAT_HANDLER.registerMyModsOreDictEntries();
- COMPAT_HANDLER.intermodOreDictionarySupport();
- COMPAT_IntermodStaging.init(e);
- }
-
- public void postInit(final FMLPostInitializationEvent e) {
- Logger.INFO("Cleaning up, doing postInit.");
- PlayerCache.initCache();
- FluidFactory.postInit();
-
- // Make Burnables burnable
- if (!CORE.burnables.isEmpty()) {
- BurnableFuelHandler fuelHandler = new BurnableFuelHandler();
- GameRegistry.registerFuelHandler(fuelHandler);
- Logger.INFO("[Fuel Handler] Registering " + fuelHandler.getClass().getName());
- }
-
- // Compat Handling
- Logger.INFO("Removing recipes from other mods.");
- COMPAT_HANDLER.RemoveRecipesFromOtherMods();
- Logger.INFO("Initialising Handler, Then Adding Recipes");
- COMPAT_HANDLER.InitialiseHandlerThenAddRecipes();
- Logger.INFO("Loading Intermod staging.");
- COMPAT_IntermodStaging.postInit(e);
- Logger.INFO("Loading queued recipes.");
- COMPAT_HANDLER.runQueuedRecipes();
- Logger.INFO("Registering custom mob drops.");
- registerCustomMobDrops();
-
- // Moved last in postInit().
- // 12/12/19 - Alkalus
- // Moved last, to prevent recipes being generated post initialisation.
- Logger.INFO("Loading Gregtech API recipes.");
- COMPAT_HANDLER.startLoadingGregAPIBasedRecipes();
- }
-
- public void serverStarting(final FMLServerStartingEvent e) {
- COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes();
- }
-
- public void onLoadComplete(FMLLoadCompleteEvent event) {
- COMPAT_IntermodStaging.onLoadComplete(event);
- COMPAT_HANDLER.onLoadComplete(event);
- }
-
- public void registerNetworkStuff() {
- GuiHandler.init();
- }
-
- public void registerEntities() {
- InternalEntityRegistry.registerEntities();
- }
-
- public void registerTileEntities() {
- ModTileEntities.init();
- }
-
- public void registerRenderThings() {
-
- }
-
- public int addArmor(final String armor) {
- return 0;
- }
-
- public void generateMysteriousParticles(final Entity entity) {
-
- }
-
- public void generateMobSpawners() {
- // Try register some test spawners
- Utils.createNewMobSpawner(0, EntityGiantChickenBase.class);
- Utils.createNewMobSpawner(1, EntitySickBlaze.class);
- Utils.createNewMobSpawner(2, EntityStaballoyConstruct.class);
- }
-
- public void registerCustomItemsForMaterials() {
- //Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, GregtechItemList.Carbyne_Sheet_Finished.get(1));
- }
-
- public void registerCustomMobDrops() {
-
- //Zombie
- EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemRope), 3, 100);
- EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemFiber), 5, 250);
- EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemSandstoneHammer), 1, 10);
- EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemBomb), 2, 10);
- EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.TUMBAGA.getTinyDust(1), 1, 10);
- EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.POTIN.getTinyDust(1), 1, 10);
-
- //Blazes
- if (ItemUtils.doesOreDictHaveEntryFor("dustPyrotheum")) {
- EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10);
- EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10);
- }
-
-
- //Special mobs Support
- if (ReflectionUtils.doesClassExist("toast.specialMobs.entity.zombie.EntityBrutishZombie")) {
- Class<?> aBrutishZombie = ReflectionUtils.getClass("toast.specialMobs.entity.zombie.EntityBrutishZombie");
- ItemStack aFortune1 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1);
- ItemStack aFortune2 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1);
- ItemStack aFortune3 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1);
- EntityUtils.registerDropsForMob(aBrutishZombie, aFortune1, 1, 100);
- EntityUtils.registerDropsForMob(aBrutishZombie, aFortune2, 1, 50);
- EntityUtils.registerDropsForMob(aBrutishZombie, aFortune3, 1, 1);
- EntityUtils.registerDropsForMob(aBrutishZombie, ItemUtils.getItemStackOfAmountFromOreDict("ingotRedAlloy", 1), 3, 200);
- }
-
- //GalaxySpace Support
- if (ReflectionUtils.doesClassExist("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze")) {
- Class<?> aColdBlaze = ReflectionUtils.getClass("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze");
- ItemStack aSmallBlizz, aTinyBlizz, aSmallCryo, aTinyCryo;
- aSmallBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallBlizz", 1);
- aTinyBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBlizz", 1);
- aSmallCryo = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallCryotheum", 1);
- aTinyCryo = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCryotheum", 1);
- EntityUtils.registerDropsForMob(aColdBlaze, ItemUtils.getItemStackOfAmountFromOreDict("stickBlizz", 1), 2, 500);
- if (aSmallBlizz != null) {
- EntityUtils.registerDropsForMob(aColdBlaze, aSmallBlizz, 2, 750);
- }
- if (aTinyBlizz != null) {
- EntityUtils.registerDropsForMob(aColdBlaze, aTinyBlizz, 4, 1500);
- }
- if (aSmallCryo != null) {
- EntityUtils.registerDropsForMob(aColdBlaze, aSmallCryo, 1, 50);
- }
- if (aTinyCryo != null) {
- EntityUtils.registerDropsForMob(aColdBlaze, aTinyCryo, 2, 100);
- }
- }
-
- }
-
- protected final AutoMap<Pair<Item, IItemRenderer>> mItemRenderMappings = new AutoMap<Pair<Item, IItemRenderer>>();
-
-
- public static void registerItemRendererGlobal(Item aItem, IItemRenderer aRenderer) {
- GTplusplus.proxy.registerItemRenderer(aItem, aRenderer);
- }
-
- public void registerItemRenderer(Item aItem, IItemRenderer aRenderer) {
- if (Utils.isServer()) {
- return;
- }
- else {
- mItemRenderMappings.add(new Pair<Item, IItemRenderer>(aItem, aRenderer));
- }
- }
-
- public World getClientWorld() {
- return null;
- }
-
- /**
- * Returns a side-appropriate EntityPlayer for use during message handling
- */
- public EntityPlayer getPlayerEntity(MessageContext ctx) {
- return ctx.getServerHandler().playerEntity;
- }
-
+ public CommonProxy() {
+ // Should Register Gregtech Materials I've Made
+ Utils.registerEvent(this);
+ if (!CORE.GTNH) {
+ Logger.INFO("We're using Gregtech " + Utils.getGregtechVersionAsString());
+ } else {
+ Logger.INFO("We're using GTNH's Gregtech " + Utils.getGregtechVersionAsString());
+ }
+ }
+
+ public void preInit(final FMLPreInitializationEvent e) {
+ Logger.INFO("Doing some house cleaning.");
+ LoadedMods.checkLoaded();
+ Logger.INFO("Making sure we're ready to party!");
+
+ if (!CORE_Preloader.DEBUG_MODE) {
+ Logger.WARNING("Development mode not enabled.");
+ } else if (CORE_Preloader.DEBUG_MODE) {
+ Logger.INFO("Development mode enabled.");
+ } else {
+ Logger.WARNING("Development mode not set.");
+ }
+
+ AddToCreativeTab.initialiseTabs();
+ EnumHelperHandler.init();
+
+ // Moved from Init after Debug Loading.
+ // 29/01/18 - Alkalus
+ // Moved earlier into PreInit, so that Items exist before they're called upon in
+ // recipes.
+ // 20/03/18 - Alkalus
+ ModItems.init();
+ ModBlocks.init();
+ CI.preInit();
+ FluidFactory.preInit();
+ COMPAT_IntermodStaging.preInit(e);
+ BookHandler.run();
+ // Registration of entities and renderers
+ Logger.INFO("[Proxy] Calling Entity registrator.");
+ registerEntities();
+ Logger.INFO("[Proxy] Calling Tile Entity registrator.");
+ registerTileEntities();
+
+ Logger.INFO("[Proxy] Calling Render registrator.");
+ registerRenderThings();
+ }
+
+ public void init(final FMLInitializationEvent e) {
+ // Debug Loading
+ if (CORE_Preloader.DEBUG_MODE) {
+ DEBUG_INIT.registerHandlers();
+ }
+
+ registerCustomItemsForMaterials();
+ ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner();
+ CI.init();
+ FluidFactory.init();
+
+ /**
+ * Register the Event Handlers.
+ */
+
+ // Prevents my Safes being destroyed.
+ Utils.registerEvent(new PickaxeBlockBreakEventHandler());
+ // Block Handler for all events.
+ Utils.registerEvent(new BlockEventHandler());
+ Utils.registerEvent(new GeneralTooltipEventHandler());
+ // Handles Tooltips for items giving custom multiblock behaviour
+ Utils.registerEvent(new SpecialBehaviourTooltipHandler());
+ // Handles Custom tooltips for EIO.
+ Utils.registerEvent(new HandlerTooltip_EIO());
+ // Handles Custom Tooltips for GC
+ Utils.registerEvent(new HandlerTooltip_GC());
+ // Handles Sleep Benefits
+ PlayerSleepEventHandler.init();
+ // Handles Magic Feather
+ Utils.registerEvent(ModItems.itemMagicFeather);
+
+ if (CORE.DEVENV) {
+ Utils.registerEvent(new StopAnnoyingFuckingAchievements());
+ }
+
+ Utils.registerEvent(new EnderDragonDeathHandler());
+ Utils.registerEvent(new EntityDeathHandler());
+
+ if (ConfigSwitches.disableZombieReinforcement) {
+ // Make Zombie reinforcements fuck off.
+ Utils.registerEvent(new ZombieBackupSpawnEventHandler());
+ }
+
+ /**
+ * End of Subscribe Event registration.
+ */
+
+ // Compat Handling
+ COMPAT_HANDLER.registerMyModsOreDictEntries();
+ COMPAT_HANDLER.intermodOreDictionarySupport();
+ COMPAT_IntermodStaging.init(e);
+ }
+
+ public void postInit(final FMLPostInitializationEvent e) {
+ Logger.INFO("Cleaning up, doing postInit.");
+ PlayerCache.initCache();
+ FluidFactory.postInit();
+
+ // Make Burnables burnable
+ if (!CORE.burnables.isEmpty()) {
+ BurnableFuelHandler fuelHandler = new BurnableFuelHandler();
+ GameRegistry.registerFuelHandler(fuelHandler);
+ Logger.INFO("[Fuel Handler] Registering " + fuelHandler.getClass().getName());
+ }
+
+ // Compat Handling
+ Logger.INFO("Removing recipes from other mods.");
+ COMPAT_HANDLER.RemoveRecipesFromOtherMods();
+ Logger.INFO("Initialising Handler, Then Adding Recipes");
+ COMPAT_HANDLER.InitialiseHandlerThenAddRecipes();
+ Logger.INFO("Loading Intermod staging.");
+ COMPAT_IntermodStaging.postInit(e);
+ Logger.INFO("Loading queued recipes.");
+ COMPAT_HANDLER.runQueuedRecipes();
+ Logger.INFO("Registering custom mob drops.");
+ registerCustomMobDrops();
+
+ // Moved last in postInit().
+ // 12/12/19 - Alkalus
+ // Moved last, to prevent recipes being generated post initialisation.
+ Logger.INFO("Loading Gregtech API recipes.");
+ COMPAT_HANDLER.startLoadingGregAPIBasedRecipes();
+ }
+
+ public void serverStarting(final FMLServerStartingEvent e) {
+ COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes();
+ }
+
+ public void onLoadComplete(FMLLoadCompleteEvent event) {
+ COMPAT_IntermodStaging.onLoadComplete(event);
+ COMPAT_HANDLER.onLoadComplete(event);
+ }
+
+ public void registerNetworkStuff() {
+ GuiHandler.init();
+ }
+
+ public void registerEntities() {
+ InternalEntityRegistry.registerEntities();
+ }
+
+ public void registerTileEntities() {
+ ModTileEntities.init();
+ }
+
+ public void registerRenderThings() {}
+
+ public int addArmor(final String armor) {
+ return 0;
+ }
+
+ public void generateMysteriousParticles(final Entity entity) {}
+
+ public void generateMobSpawners() {
+ // Try register some test spawners
+ Utils.createNewMobSpawner(0, EntityGiantChickenBase.class);
+ Utils.createNewMobSpawner(1, EntitySickBlaze.class);
+ Utils.createNewMobSpawner(2, EntityStaballoyConstruct.class);
+ }
+
+ public void registerCustomItemsForMaterials() {
+ // Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate,
+ // GregtechItemList.Carbyne_Sheet_Finished.get(1));
+ }
+
+ public void registerCustomMobDrops() {
+
+ // Zombie
+ EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemRope), 3, 100);
+ EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemFiber), 5, 250);
+ EntityUtils.registerDropsForMob(
+ EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemSandstoneHammer), 1, 10);
+ EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemBomb), 2, 10);
+ EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.TUMBAGA.getTinyDust(1), 1, 10);
+ EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.POTIN.getTinyDust(1), 1, 10);
+
+ // Blazes
+ if (ItemUtils.doesOreDictHaveEntryFor("dustPyrotheum")) {
+ EntityUtils.registerDropsForMob(
+ EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10);
+ EntityUtils.registerDropsForMob(
+ EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10);
+ }
+
+ // Special mobs Support
+ if (ReflectionUtils.doesClassExist("toast.specialMobs.entity.zombie.EntityBrutishZombie")) {
+ Class<?> aBrutishZombie = ReflectionUtils.getClass("toast.specialMobs.entity.zombie.EntityBrutishZombie");
+ ItemStack aFortune1 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1);
+ ItemStack aFortune2 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1);
+ ItemStack aFortune3 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1);
+ EntityUtils.registerDropsForMob(aBrutishZombie, aFortune1, 1, 100);
+ EntityUtils.registerDropsForMob(aBrutishZombie, aFortune2, 1, 50);
+ EntityUtils.registerDropsForMob(aBrutishZombie, aFortune3, 1, 1);
+ EntityUtils.registerDropsForMob(
+ aBrutishZombie, ItemUtils.getItemStackOfAmountFromOreDict("ingotRedAlloy", 1), 3, 200);
+ }
+
+ // GalaxySpace Support
+ if (ReflectionUtils.doesClassExist("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze")) {
+ Class<?> aColdBlaze =
+ ReflectionUtils.getClass("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze");
+ ItemStack aSmallBlizz, aTinyBlizz, aSmallCryo, aTinyCryo;
+ aSmallBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallBlizz", 1);
+ aTinyBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBlizz", 1);
+ aSmallCryo = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallCryotheum", 1);
+ aTinyCryo = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCryotheum", 1);
+ EntityUtils.registerDropsForMob(
+ aColdBlaze, ItemUtils.getItemStackOfAmountFromOreDict("stickBlizz", 1), 2, 500);
+ if (aSmallBlizz != null) {
+ EntityUtils.registerDropsForMob(aColdBlaze, aSmallBlizz, 2, 750);
+ }
+ if (aTinyBlizz != null) {
+ EntityUtils.registerDropsForMob(aColdBlaze, aTinyBlizz, 4, 1500);
+ }
+ if (aSmallCryo != null) {
+ EntityUtils.registerDropsForMob(aColdBlaze, aSmallCryo, 1, 50);
+ }
+ if (aTinyCryo != null) {
+ EntityUtils.registerDropsForMob(aColdBlaze, aTinyCryo, 2, 100);
+ }
+ }
+ }
+
+ protected final AutoMap<Pair<Item, IItemRenderer>> mItemRenderMappings = new AutoMap<Pair<Item, IItemRenderer>>();
+
+ public static void registerItemRendererGlobal(Item aItem, IItemRenderer aRenderer) {
+ GTplusplus.proxy.registerItemRenderer(aItem, aRenderer);
+ }
+
+ public void registerItemRenderer(Item aItem, IItemRenderer aRenderer) {
+ if (Utils.isServer()) {
+ return;
+ } else {
+ mItemRenderMappings.add(new Pair<Item, IItemRenderer>(aItem, aRenderer));
+ }
+ }
+
+ public World getClientWorld() {
+ return null;
+ }
+
+ /**
+ * Returns a side-appropriate EntityPlayer for use during message handling
+ */
+ public EntityPlayer getPlayerEntity(MessageContext ctx) {
+ return ctx.getServerHandler().playerEntity;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
index c9704603af..4af788a9df 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
@@ -21,51 +21,56 @@ import net.minecraft.entity.monster.EntityZombie;
public class COMPAT_Baubles {
- public static void run(){
- if (LoadedMods.Baubles){
- baublesLoaded();
- }
- else {
- baublesNotLoaded();
- }
- }
+ public static void run() {
+ if (LoadedMods.Baubles) {
+ baublesLoaded();
+ } else {
+ baublesNotLoaded();
+ }
+ }
- public static void baublesLoaded(){
- Logger.INFO("Baubles Found - Loading Wearables.");
- ModItems.itemPersonalCloakingDevice = new ItemCloakingDevice(0);
- //itemPersonalCloakingDeviceCharged = new ItemCloakingDevice(0).set;
- ModItems.itemPersonalHealingDevice = new ItemHealingDevice();
- ModItems.itemPersonalFireProofDevice = new FireProtectionBauble();
+ public static void baublesLoaded() {
+ Logger.INFO("Baubles Found - Loading Wearables.");
+ ModItems.itemPersonalCloakingDevice = new ItemCloakingDevice(0);
+ // itemPersonalCloakingDeviceCharged = new ItemCloakingDevice(0).set;
+ ModItems.itemPersonalHealingDevice = new ItemHealingDevice();
+ ModItems.itemPersonalFireProofDevice = new FireProtectionBauble();
- try {
- ModItems.itemChargePack_Low_1 = new BatteryPackBaseBauble(1);
- ModItems.itemChargePack_Low_2 = new BatteryPackBaseBauble(2);
- ModItems.itemChargePack_Low_3 = new BatteryPackBaseBauble(3);
- ModItems.itemChargePack_Low_4 = new BatteryPackBaseBauble(4);
- ModItems.itemChargePack_Low_5 = new BatteryPackBaseBauble(5);
- ModItems.itemChargePack_High_1 = new BatteryPackBaseBauble(6);
- ModItems.itemChargePack_High_2 = new BatteryPackBaseBauble(7);
- ModItems.itemChargePack_High_3 = new BatteryPackBaseBauble(8);
- ModItems.itemChargePack_High_4 = new BatteryPackBaseBauble(9);
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
+ try {
+ ModItems.itemChargePack_Low_1 = new BatteryPackBaseBauble(1);
+ ModItems.itemChargePack_Low_2 = new BatteryPackBaseBauble(2);
+ ModItems.itemChargePack_Low_3 = new BatteryPackBaseBauble(3);
+ ModItems.itemChargePack_Low_4 = new BatteryPackBaseBauble(4);
+ ModItems.itemChargePack_Low_5 = new BatteryPackBaseBauble(5);
+ ModItems.itemChargePack_High_1 = new BatteryPackBaseBauble(6);
+ ModItems.itemChargePack_High_2 = new BatteryPackBaseBauble(7);
+ ModItems.itemChargePack_High_3 = new BatteryPackBaseBauble(8);
+ ModItems.itemChargePack_High_4 = new BatteryPackBaseBauble(9);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
- ModItems.itemAmuletMonsterKiller_Zombie = new MonsterKillerBaseBauble(new Class[] {EntityZombie.class}, "Zombie", 3);
- ModItems.itemAmuletMonsterKiller_Skeleton = new MonsterKillerBaseBauble(new Class[] {EntitySkeleton.class}, "Skeleton", 3);
- ModItems.itemAmuletMonsterKiller_Spider = new MonsterKillerBaseBauble(new Class[] {EntitySpider.class}, "Spider", 3);
- ModItems.itemAmuletMonsterKiller_Creeper = new MonsterKillerBaseBauble(new Class[] {EntityCreeper.class}, "Creeper", 4);
- ModItems.itemAmuletMonsterKiller_Enderman = new MonsterKillerBaseBauble(new Class[] {EntityEnderman.class}, "Enderman", 4);
- ModItems.itemAmuletMonsterKiller_Nether = new MonsterKillerBaseBauble(new Class[] {EntityPigZombie.class, EntityGhast.class, EntityMagmaCube.class, EntityBlaze.class}, "Hellish", 6);
-
- if (LoadedMods.PlayerAPI){
- ModItems.itemSlowBuildingRing = new ItemSlowBuildingRing();
- }
- }
+ ModItems.itemAmuletMonsterKiller_Zombie =
+ new MonsterKillerBaseBauble(new Class[] {EntityZombie.class}, "Zombie", 3);
+ ModItems.itemAmuletMonsterKiller_Skeleton =
+ new MonsterKillerBaseBauble(new Class[] {EntitySkeleton.class}, "Skeleton", 3);
+ ModItems.itemAmuletMonsterKiller_Spider =
+ new MonsterKillerBaseBauble(new Class[] {EntitySpider.class}, "Spider", 3);
+ ModItems.itemAmuletMonsterKiller_Creeper =
+ new MonsterKillerBaseBauble(new Class[] {EntityCreeper.class}, "Creeper", 4);
+ ModItems.itemAmuletMonsterKiller_Enderman =
+ new MonsterKillerBaseBauble(new Class[] {EntityEnderman.class}, "Enderman", 4);
+ ModItems.itemAmuletMonsterKiller_Nether = new MonsterKillerBaseBauble(
+ new Class[] {EntityPigZombie.class, EntityGhast.class, EntityMagmaCube.class, EntityBlaze.class},
+ "Hellish",
+ 6);
- public static void baublesNotLoaded(){
- Logger.INFO("Baubles Not Found - Skipping Resources.");
- }
+ if (LoadedMods.PlayerAPI) {
+ ModItems.itemSlowBuildingRing = new ItemSlowBuildingRing();
+ }
+ }
+ public static void baublesNotLoaded() {
+ Logger.INFO("Baubles Not Found - Skipping Resources.");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java
index 3854f6612f..fcaf76e81c 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java
@@ -1,21 +1,18 @@
package gtPlusPlus.core.common.compat;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.core.item.ModItems;
+import net.minecraft.item.ItemStack;
public class COMPAT_BigReactors {
- public static void OreDict(){
- run();
- }
-
- private static final void run(){
- GT_OreDictUnificator.registerOre("plateBlutonium", new ItemStack(ModItems.itemPlateBlutonium));
- GT_OreDictUnificator.registerOre("plateCyanite", new ItemStack(ModItems.itemPlateCyanite));
- GT_OreDictUnificator.registerOre("plateLudicrite", new ItemStack(ModItems.itemPlateLudicrite));
- }
+ public static void OreDict() {
+ run();
+ }
+ private static final void run() {
+ GT_OreDictUnificator.registerOre("plateBlutonium", new ItemStack(ModItems.itemPlateBlutonium));
+ GT_OreDictUnificator.registerOre("plateCyanite", new ItemStack(ModItems.itemPlateCyanite));
+ GT_OreDictUnificator.registerOre("plateLudicrite", new ItemStack(ModItems.itemPlateLudicrite));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java
index cd5d36b653..3f097eed4a 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java
@@ -2,171 +2,219 @@ package gtPlusPlus.core.common.compat;
import static gtPlusPlus.core.handler.COMPAT_HANDLER.*;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.core.recipe.ShapedRecipeObject;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-
+import net.minecraft.item.ItemStack;
public class COMPAT_CompactWindmills {
- //Change IC2 Upgrades
- public static ItemStack kineticWind = ItemUtils.simpleMetaStack("IC2:blockKineticGenerator", 0, 1);
- public static ItemStack shaftIron = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 11, 1);
- public static ItemStack cableCopper = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 1367, 1);
- public static String plateRubber = "ore:plateRubber";
-
- //Machine Casings
- public static ItemStack elvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 0, 1);
- public static ItemStack lvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 1, 1);
- public static ItemStack mvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 2, 1);
- public static ItemStack hvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 3, 1);
- public static ItemStack evCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 4, 1);
- public static ItemStack ivCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 5, 1);
-
- //GT Transformers
- public static ItemStack elvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 20, 1);
- public static ItemStack lvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 21, 1);
- public static ItemStack mvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 22, 1);
- public static ItemStack hvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 23, 1);
- public static ItemStack evTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 24, 1);
-
- //Compact Windmills
- public static ItemStack elvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 0, 1);
- public static ItemStack lvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 1, 1);
- public static ItemStack mvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 2, 1);
- public static ItemStack hvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 3, 1);
- public static ItemStack evWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 4, 1);
-
- //Compact Rotors
- public static ItemStack rotor2 = ItemUtils.getItemStackFromFQRN("CompactWindmills:WOOL", 1);
- public static ItemStack rotor1 = ItemUtils.getItemStackFromFQRN("CompactWindmills:WOOD", 1);
- public static ItemStack rotor3 = ItemUtils.getItemStackFromFQRN("CompactWindmills:ALLOY", 1);
- public static ItemStack rotor4 = ItemUtils.getItemStackFromFQRN("CompactWindmills:CARBON", 1);
- public static ItemStack rotor5 = ItemUtils.getItemStackFromFQRN("CompactWindmills:IRIDIUM", 1);
-
- //IC2 Rotors
- public static ItemStack rotorIC1 = ItemUtils.getItemStackFromFQRN("IC2:itemwoodrotor", 1);
- public static ItemStack rotorIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemironrotor", 1);
- public static ItemStack rotorIC3 = ItemUtils.getItemStackFromFQRN("IC2:itemsteelrotor", 1);
- public static ItemStack rotorIC4 = ItemUtils.getItemStackFromFQRN("IC2:itemwcarbonrotor", 1);
- public static ItemStack rotorBlade1 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 7, 1);
- public static ItemStack rotorBlade2 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 8, 1);
- public static ItemStack rotorBlade3 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 10, 1);
- public static ItemStack rotorBlade4 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 9, 1);
-
- //Plates
- public static String plateTier1 = "ore:plateMagnalium";
- public static String plateTier2 = "ore:plateStainlessSteel";
- public static String plateTier3 = "ore:plateTitanium";
- public static String plateTier4 = "ore:plateTungstenSteel";
- public static String plateTier5 = "ore:plateNichrome";
- public static String plateCarbon = "ore:plateAlloyCarbon";
- public static String plateAlloy = "ore:plateAlloyAdvanced";
-
- //Circuits
- public static String circuitTier1 = "ore:circuitGood";
- public static String circuitTier2 = "ore:circuitAdvanced";
- public static String circuitTier3 = "ore:circuitData";
- public static String circuitTier4 = "ore:circuitElite";
- public static String circuitTier5 = "ore:circuitMaster";
-
- //Wooden Rotor
- public static ShapedRecipeObject Wooden_Rotor = new ShapedRecipeObject(
- rotorBlade1, "ore:plateAnyIron", "ore:plateAnyIron",
- "ore:screwAluminium", rotorIC1, "ore:screwAluminium",
- rotorBlade1, "plateAnyIron", rotorBlade1,
- rotor1);
- //Alloy Rotor
- public static ShapedRecipeObject Alloy_Rotor = new ShapedRecipeObject(
- plateAlloy, plateAlloy, plateAlloy,
- plateAlloy, rotorIC3, plateAlloy,
- plateAlloy,plateAlloy, plateAlloy,
- rotor3);
- //Carbon Rotor
- public static ShapedRecipeObject Carbon_Rotor = new ShapedRecipeObject(
- plateCarbon, rotorBlade4, plateCarbon,
- rotorBlade4, rotor3, rotorBlade4,
- plateCarbon, rotorBlade4, plateCarbon,
- rotor4);
-
- //Kinetic Wind Turbine
- public static ShapedRecipeObject KWT = new ShapedRecipeObject(
- plateCarbon, shaftIron, plateCarbon,
- cableCopper, mvCasing, cableCopper,
- plateRubber, plateCarbon, plateRubber,
- kineticWind);
-
- //ELV Windmill
- public static ShapedRecipeObject WM_ELV = new ShapedRecipeObject(
-
- circuitTier1, elvTransformer, circuitTier1,
- plateTier1, lvCasing, plateTier1,
- plateTier1, rotor1, plateTier1,
- elvWindmill);
-
-
- //LV Windmill
- public static ShapedRecipeObject WM_LV = new ShapedRecipeObject(
- circuitTier2, lvTransformer, circuitTier2,
- plateTier2, mvCasing, plateTier2,
- plateTier2, rotor2, plateTier2,
- lvWindmill);
-
- //MV Windmill
- public static ShapedRecipeObject WM_MV = new ShapedRecipeObject(
- circuitTier3, mvTransformer, circuitTier3,
- plateTier3, hvCasing, plateTier3,
- plateTier3, rotor3, plateTier3,
- mvWindmill);
-
- //HV Windmill
- public static ShapedRecipeObject WM_HV = new ShapedRecipeObject(
- circuitTier4, hvTransformer, circuitTier4,
- plateTier4, evCasing, plateTier4,
- plateTier4, rotor4, plateTier4,
- hvWindmill);
-
- //EV Windmill
- public static ShapedRecipeObject WM_EV = new ShapedRecipeObject(
- circuitTier5, evTransformer, circuitTier5,
- plateTier5, ivCasing, plateTier5,
- plateTier5, rotor5, plateTier5,
- evWindmill);
-
- public static void OreDict(){
- run();
- }
-
- private static final void run(){
- //RemoveRecipeQueue.add("CompactWindmills:WOOL");
- //RemoveRecipeQueue.add("CompactWindmills:WOOD");
- //RemoveRecipeQueue.add("CompactWindmills:ALLOY");
- //RemoveRecipeQueue.add("CompactWindmills:CARBON");
- //RemoveRecipeQueue.add("CompactWindmills:IRIDIUM");
-
- //Remove Recipes
- RemoveRecipeQueue.add(kineticWind);
- RemoveRecipeQueue.add(elvWindmill);
- RemoveRecipeQueue.add(lvWindmill);
- RemoveRecipeQueue.add(mvWindmill);
- RemoveRecipeQueue.add(hvWindmill);
- RemoveRecipeQueue.add(evWindmill);
- RemoveRecipeQueue.add(rotor1);
- RemoveRecipeQueue.add(rotor3);
- RemoveRecipeQueue.add(rotor4);
-
- //Add Recipes
- AddRecipeQueue.add(Wooden_Rotor);
- AddRecipeQueue.add(Alloy_Rotor);
- AddRecipeQueue.add(Carbon_Rotor);
- AddRecipeQueue.add(KWT);
- AddRecipeQueue.add(WM_ELV);
- AddRecipeQueue.add(WM_LV);
- AddRecipeQueue.add(WM_MV);
- AddRecipeQueue.add(WM_HV);
- AddRecipeQueue.add(WM_EV);
-
- }
+ // Change IC2 Upgrades
+ public static ItemStack kineticWind = ItemUtils.simpleMetaStack("IC2:blockKineticGenerator", 0, 1);
+ public static ItemStack shaftIron = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 11, 1);
+ public static ItemStack cableCopper = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 1367, 1);
+ public static String plateRubber = "ore:plateRubber";
+
+ // Machine Casings
+ public static ItemStack elvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 0, 1);
+ public static ItemStack lvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 1, 1);
+ public static ItemStack mvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 2, 1);
+ public static ItemStack hvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 3, 1);
+ public static ItemStack evCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 4, 1);
+ public static ItemStack ivCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 5, 1);
+
+ // GT Transformers
+ public static ItemStack elvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 20, 1);
+ public static ItemStack lvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 21, 1);
+ public static ItemStack mvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 22, 1);
+ public static ItemStack hvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 23, 1);
+ public static ItemStack evTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 24, 1);
+
+ // Compact Windmills
+ public static ItemStack elvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 0, 1);
+ public static ItemStack lvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 1, 1);
+ public static ItemStack mvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 2, 1);
+ public static ItemStack hvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 3, 1);
+ public static ItemStack evWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 4, 1);
+
+ // Compact Rotors
+ public static ItemStack rotor2 = ItemUtils.getItemStackFromFQRN("CompactWindmills:WOOL", 1);
+ public static ItemStack rotor1 = ItemUtils.getItemStackFromFQRN("CompactWindmills:WOOD", 1);
+ public static ItemStack rotor3 = ItemUtils.getItemStackFromFQRN("CompactWindmills:ALLOY", 1);
+ public static ItemStack rotor4 = ItemUtils.getItemStackFromFQRN("CompactWindmills:CARBON", 1);
+ public static ItemStack rotor5 = ItemUtils.getItemStackFromFQRN("CompactWindmills:IRIDIUM", 1);
+
+ // IC2 Rotors
+ public static ItemStack rotorIC1 = ItemUtils.getItemStackFromFQRN("IC2:itemwoodrotor", 1);
+ public static ItemStack rotorIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemironrotor", 1);
+ public static ItemStack rotorIC3 = ItemUtils.getItemStackFromFQRN("IC2:itemsteelrotor", 1);
+ public static ItemStack rotorIC4 = ItemUtils.getItemStackFromFQRN("IC2:itemwcarbonrotor", 1);
+ public static ItemStack rotorBlade1 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 7, 1);
+ public static ItemStack rotorBlade2 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 8, 1);
+ public static ItemStack rotorBlade3 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 10, 1);
+ public static ItemStack rotorBlade4 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 9, 1);
+
+ // Plates
+ public static String plateTier1 = "ore:plateMagnalium";
+ public static String plateTier2 = "ore:plateStainlessSteel";
+ public static String plateTier3 = "ore:plateTitanium";
+ public static String plateTier4 = "ore:plateTungstenSteel";
+ public static String plateTier5 = "ore:plateNichrome";
+ public static String plateCarbon = "ore:plateAlloyCarbon";
+ public static String plateAlloy = "ore:plateAlloyAdvanced";
+
+ // Circuits
+ public static String circuitTier1 = "ore:circuitGood";
+ public static String circuitTier2 = "ore:circuitAdvanced";
+ public static String circuitTier3 = "ore:circuitData";
+ public static String circuitTier4 = "ore:circuitElite";
+ public static String circuitTier5 = "ore:circuitMaster";
+
+ // Wooden Rotor
+ public static ShapedRecipeObject Wooden_Rotor = new ShapedRecipeObject(
+ rotorBlade1,
+ "ore:plateAnyIron",
+ "ore:plateAnyIron",
+ "ore:screwAluminium",
+ rotorIC1,
+ "ore:screwAluminium",
+ rotorBlade1,
+ "plateAnyIron",
+ rotorBlade1,
+ rotor1);
+ // Alloy Rotor
+ public static ShapedRecipeObject Alloy_Rotor = new ShapedRecipeObject(
+ plateAlloy,
+ plateAlloy,
+ plateAlloy,
+ plateAlloy,
+ rotorIC3,
+ plateAlloy,
+ plateAlloy,
+ plateAlloy,
+ plateAlloy,
+ rotor3);
+ // Carbon Rotor
+ public static ShapedRecipeObject Carbon_Rotor = new ShapedRecipeObject(
+ plateCarbon,
+ rotorBlade4,
+ plateCarbon,
+ rotorBlade4,
+ rotor3,
+ rotorBlade4,
+ plateCarbon,
+ rotorBlade4,
+ plateCarbon,
+ rotor4);
+
+ // Kinetic Wind Turbine
+ public static ShapedRecipeObject KWT = new ShapedRecipeObject(
+ plateCarbon,
+ shaftIron,
+ plateCarbon,
+ cableCopper,
+ mvCasing,
+ cableCopper,
+ plateRubber,
+ plateCarbon,
+ plateRubber,
+ kineticWind);
+
+ // ELV Windmill
+ public static ShapedRecipeObject WM_ELV = new ShapedRecipeObject(
+ circuitTier1,
+ elvTransformer,
+ circuitTier1,
+ plateTier1,
+ lvCasing,
+ plateTier1,
+ plateTier1,
+ rotor1,
+ plateTier1,
+ elvWindmill);
+
+ // LV Windmill
+ public static ShapedRecipeObject WM_LV = new ShapedRecipeObject(
+ circuitTier2,
+ lvTransformer,
+ circuitTier2,
+ plateTier2,
+ mvCasing,
+ plateTier2,
+ plateTier2,
+ rotor2,
+ plateTier2,
+ lvWindmill);
+
+ // MV Windmill
+ public static ShapedRecipeObject WM_MV = new ShapedRecipeObject(
+ circuitTier3,
+ mvTransformer,
+ circuitTier3,
+ plateTier3,
+ hvCasing,
+ plateTier3,
+ plateTier3,
+ rotor3,
+ plateTier3,
+ mvWindmill);
+
+ // HV Windmill
+ public static ShapedRecipeObject WM_HV = new ShapedRecipeObject(
+ circuitTier4,
+ hvTransformer,
+ circuitTier4,
+ plateTier4,
+ evCasing,
+ plateTier4,
+ plateTier4,
+ rotor4,
+ plateTier4,
+ hvWindmill);
+
+ // EV Windmill
+ public static ShapedRecipeObject WM_EV = new ShapedRecipeObject(
+ circuitTier5,
+ evTransformer,
+ circuitTier5,
+ plateTier5,
+ ivCasing,
+ plateTier5,
+ plateTier5,
+ rotor5,
+ plateTier5,
+ evWindmill);
+
+ public static void OreDict() {
+ run();
+ }
+
+ private static final void run() {
+ // RemoveRecipeQueue.add("CompactWindmills:WOOL");
+ // RemoveRecipeQueue.add("CompactWindmills:WOOD");
+ // RemoveRecipeQueue.add("CompactWindmills:ALLOY");
+ // RemoveRecipeQueue.add("CompactWindmills:CARBON");
+ // RemoveRecipeQueue.add("CompactWindmills:IRIDIUM");
+
+ // Remove Recipes
+ RemoveRecipeQueue.add(kineticWind);
+ RemoveRecipeQueue.add(elvWindmill);
+ RemoveRecipeQueue.add(lvWindmill);
+ RemoveRecipeQueue.add(mvWindmill);
+ RemoveRecipeQueue.add(hvWindmill);
+ RemoveRecipeQueue.add(evWindmill);
+ RemoveRecipeQueue.add(rotor1);
+ RemoveRecipeQueue.add(rotor3);
+ RemoveRecipeQueue.add(rotor4);
+
+ // Add Recipes
+ AddRecipeQueue.add(Wooden_Rotor);
+ AddRecipeQueue.add(Alloy_Rotor);
+ AddRecipeQueue.add(Carbon_Rotor);
+ AddRecipeQueue.add(KWT);
+ AddRecipeQueue.add(WM_ELV);
+ AddRecipeQueue.add(WM_LV);
+ AddRecipeQueue.add(WM_MV);
+ AddRecipeQueue.add(WM_HV);
+ AddRecipeQueue.add(WM_EV);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
index 6598a7e21e..31c2943f24 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
@@ -1,28 +1,25 @@
package gtPlusPlus.core.common.compat;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.item.ItemStack;
public class COMPAT_EnderIO {
- public static void OreDict(){
- run();
- }
-
- private static final void run(){
- ItemUtils.getItemForOreDict("EnderIO:itemAlloy", "ingotVibrantAlloy", "Vibrant Alloy Ingot", 2);
- GT_OreDictUnificator.registerOre("plateConductiveIron", new ItemStack(ModItems.itemPlateConductiveIron));
- GT_OreDictUnificator.registerOre("plateDarkSteel", new ItemStack(ModItems.itemPlateDarkSteel));
- GT_OreDictUnificator.registerOre("plateElectricalSteel", new ItemStack(ModItems.itemPlateElectricalSteel));
- GT_OreDictUnificator.registerOre("plateEnergeticAlloy", new ItemStack(ModItems.itemPlateEnergeticAlloy));
- GT_OreDictUnificator.registerOre("platePulsatingIron", new ItemStack(ModItems.itemPlatePulsatingIron));
- GT_OreDictUnificator.registerOre("plateRedstoneAlloy", new ItemStack(ModItems.itemPlateRedstoneAlloy));
- GT_OreDictUnificator.registerOre("plateSoularium", new ItemStack(ModItems.itemPlateSoularium));
- GT_OreDictUnificator.registerOre("plateVibrantAlloy", new ItemStack(ModItems.itemPlateVibrantAlloy));
- }
+ public static void OreDict() {
+ run();
+ }
+ private static final void run() {
+ ItemUtils.getItemForOreDict("EnderIO:itemAlloy", "ingotVibrantAlloy", "Vibrant Alloy Ingot", 2);
+ GT_OreDictUnificator.registerOre("plateConductiveIron", new ItemStack(ModItems.itemPlateConductiveIron));
+ GT_OreDictUnificator.registerOre("plateDarkSteel", new ItemStack(ModItems.itemPlateDarkSteel));
+ GT_OreDictUnificator.registerOre("plateElectricalSteel", new ItemStack(ModItems.itemPlateElectricalSteel));
+ GT_OreDictUnificator.registerOre("plateEnergeticAlloy", new ItemStack(ModItems.itemPlateEnergeticAlloy));
+ GT_OreDictUnificator.registerOre("platePulsatingIron", new ItemStack(ModItems.itemPlatePulsatingIron));
+ GT_OreDictUnificator.registerOre("plateRedstoneAlloy", new ItemStack(ModItems.itemPlateRedstoneAlloy));
+ GT_OreDictUnificator.registerOre("plateSoularium", new ItemStack(ModItems.itemPlateSoularium));
+ GT_OreDictUnificator.registerOre("plateVibrantAlloy", new ItemStack(ModItems.itemPlateVibrantAlloy));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
index d5ee51f61a..70c342453c 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
@@ -1,32 +1,35 @@
package gtPlusPlus.core.common.compat;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.recipe.RECIPES_Tools;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import net.minecraft.item.ItemStack;
public class COMPAT_ExtraUtils {
- public static void OreDict(){
- RECIPES_Tools.RECIPE_DivisionSigil = new ItemStack(ItemUtils.getItemFromFQRN("ExtraUtilities:divisionSigil"));
- run();
-
- }
-
- private static final void run(){
- ItemUtils.getItemForOreDict("ExtraUtilities:bedrockiumIngot", "ingotBedrockium", "Bedrockium Ingot", 0);
- //GT_OreDictUnificator.registerOre("plateBedrockium", new ItemStack(ModItems.itemPlateBedrockium));
-
- if (ConfigSwitches.enableAlternativeDivisionSigilRecipe){
- //Division Sigil
- RecipeUtils.addShapedRecipe(
- "plateNetherStar", "gemIridium", "plateNetherStar",
- "plateIridium", RECIPES_Tools.craftingToolHardHammer, "plateIridium",
- "plateNetherStar", "gemIridium", "plateNetherStar",
- RECIPES_Tools.RECIPE_DivisionSigil);
- }
- }
-
+ public static void OreDict() {
+ RECIPES_Tools.RECIPE_DivisionSigil = new ItemStack(ItemUtils.getItemFromFQRN("ExtraUtilities:divisionSigil"));
+ run();
+ }
+
+ private static final void run() {
+ ItemUtils.getItemForOreDict("ExtraUtilities:bedrockiumIngot", "ingotBedrockium", "Bedrockium Ingot", 0);
+ // GT_OreDictUnificator.registerOre("plateBedrockium", new ItemStack(ModItems.itemPlateBedrockium));
+
+ if (ConfigSwitches.enableAlternativeDivisionSigilRecipe) {
+ // Division Sigil
+ RecipeUtils.addShapedRecipe(
+ "plateNetherStar",
+ "gemIridium",
+ "plateNetherStar",
+ "plateIridium",
+ RECIPES_Tools.craftingToolHardHammer,
+ "plateIridium",
+ "plateNetherStar",
+ "gemIridium",
+ "plateNetherStar",
+ RECIPES_Tools.RECIPE_DivisionSigil);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_HarvestCraft.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_HarvestCraft.java
index 9e148f0102..fa2beb54ad 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_HarvestCraft.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_HarvestCraft.java
@@ -4,12 +4,11 @@ import gtPlusPlus.xmod.growthcraft.fishtrap.FishTrapHandler;
public class COMPAT_HarvestCraft {
- public static void OreDict(){
- run();
- }
-
- private static final void run(){
- FishTrapHandler.pamsHarvestCraftCompat();
- }
+ public static void OreDict() {
+ run();
+ }
+ private static final void run() {
+ FishTrapHandler.pamsHarvestCraftCompat();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_IC2.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_IC2.java
index e1ed2a666a..1169473d85 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_IC2.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_IC2.java
@@ -1,64 +1,68 @@
package gtPlusPlus.core.common.compat;
-
import static gtPlusPlus.core.handler.COMPAT_HANDLER.RemoveRecipeQueue;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.recipe.ShapedRecipeObject;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-
+import net.minecraft.item.ItemStack;
public class COMPAT_IC2 {
- private static ItemStack itemCropnalyzer = ItemUtils.simpleMetaStack("IC2:itemCropnalyzer", 0, 1);
- private static ItemStack itemSolarHelmet = ItemUtils.simpleMetaStack("IC2:itemSolarHelmet", 0, 1);
-
- public static ShapedRecipeObject Cropnalyzer = new ShapedRecipeObject(
- "ore:cableGt02Copper", "ore:cableGt02Copper", null,
- "minecraft:redstone", "ore:blockGlass", "minecraft:redstone",
- "minecraft:redstone", "ore:circuitBasic", "minecraft:redstone",
- itemCropnalyzer);
- public static ShapedRecipeObject SolarHelmet = new ShapedRecipeObject(
- "ore:plateIron", "ore:plateIron", "ore:plateIron",
- "ore:plateIron", "gregtech:gt.metaitem.01:32750", "ore:plateIron",
- "ore:craftingWireCopper", "ore:craftingWireCopper", "ore:craftingWireCopper",
- itemSolarHelmet);
-
-
-
- public static void OreDict(){
- //Get ItemStacks for results
- /*itemCropnalyzer = UtilsItems.getItemStack("IC2:itemCropnalyzer", 1);
- itemSolarHelmet = UtilsItems.getItemStack("IC2:itemSolarHelmet", 1); */
- run();
- }
-
- private static final void run(){
-
- if (ConfigSwitches.disableIC2Recipes){
-
-
-
- if (LoadedMods.Gregtech){
- //Fuck these right off.
- RemoveRecipeQueue.add("IC2:itemCable");
- RemoveRecipeQueue.add("IC2:itemCable:1");
- RemoveRecipeQueue.add("IC2:itemCable:2");
- RemoveRecipeQueue.add("IC2:itemCable:3");
- RemoveRecipeQueue.add("IC2:itemCable:5");
- RemoveRecipeQueue.add("IC2:itemCable:6");
- RemoveRecipeQueue.add("IC2:itemCable:10");
- RemoveRecipeQueue.add("IC2:itemCable:13");
- //RemoveRecipeQueue.add(itemCropnalyzer);
- //RemoveRecipeQueue.add(itemSolarHelmet);
-
- //AddRecipeQueue.add(Cropnalyzer);
- //AddRecipeQueue.add(SolarHelmet);
- }
- }
- }
-
+ private static ItemStack itemCropnalyzer = ItemUtils.simpleMetaStack("IC2:itemCropnalyzer", 0, 1);
+ private static ItemStack itemSolarHelmet = ItemUtils.simpleMetaStack("IC2:itemSolarHelmet", 0, 1);
+
+ public static ShapedRecipeObject Cropnalyzer = new ShapedRecipeObject(
+ "ore:cableGt02Copper",
+ "ore:cableGt02Copper",
+ null,
+ "minecraft:redstone",
+ "ore:blockGlass",
+ "minecraft:redstone",
+ "minecraft:redstone",
+ "ore:circuitBasic",
+ "minecraft:redstone",
+ itemCropnalyzer);
+ public static ShapedRecipeObject SolarHelmet = new ShapedRecipeObject(
+ "ore:plateIron",
+ "ore:plateIron",
+ "ore:plateIron",
+ "ore:plateIron",
+ "gregtech:gt.metaitem.01:32750",
+ "ore:plateIron",
+ "ore:craftingWireCopper",
+ "ore:craftingWireCopper",
+ "ore:craftingWireCopper",
+ itemSolarHelmet);
+
+ public static void OreDict() {
+ // Get ItemStacks for results
+ /*itemCropnalyzer = UtilsItems.getItemStack("IC2:itemCropnalyzer", 1);
+ itemSolarHelmet = UtilsItems.getItemStack("IC2:itemSolarHelmet", 1); */
+ run();
+ }
+
+ private static final void run() {
+
+ if (ConfigSwitches.disableIC2Recipes) {
+
+ if (LoadedMods.Gregtech) {
+ // Fuck these right off.
+ RemoveRecipeQueue.add("IC2:itemCable");
+ RemoveRecipeQueue.add("IC2:itemCable:1");
+ RemoveRecipeQueue.add("IC2:itemCable:2");
+ RemoveRecipeQueue.add("IC2:itemCable:3");
+ RemoveRecipeQueue.add("IC2:itemCable:5");
+ RemoveRecipeQueue.add("IC2:itemCable:6");
+ RemoveRecipeQueue.add("IC2:itemCable:10");
+ RemoveRecipeQueue.add("IC2:itemCable:13");
+ // RemoveRecipeQueue.add(itemCropnalyzer);
+ // RemoveRecipeQueue.add(itemSolarHelmet);
+
+ // AddRecipeQueue.add(Cropnalyzer);
+ // AddRecipeQueue.add(SolarHelmet);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java
index b7da7c436e..3e9c6da4ec 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java
@@ -4,34 +4,34 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
public class COMPAT_MorePlanets {
+ public static void OreDict() {
+ run();
+ }
- public static void OreDict(){
- run();
- }
-
- private final static void run(){
- //Metals
- ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotFrozenIron", "Frozen Iron Ingot", 0);
- ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotAnyIron", "Frozen Iron Ingot", 0);
- ItemUtils.getItemForOreDict("MorePlanet:polongnius_item", "ingotPalladium", "Palladium Ingot", 5);
- ItemUtils.getItemForOreDict("MorePlanet:fronos_item", "ingotIridium", "Iridium Ingot", 3);
- ItemUtils.getItemForOreDict("MorePlanet:nibiru_item", "ingotNorium", "Norium Ingot", 1);
- ItemUtils.getItemForOreDict("MorePlanet:venus_item", "ingotLead", "Lead Ingot", 0);
- ItemUtils.getItemForOreDict("MorePlanet:diona_item", "ingotQuontonium", "Quontonium Ingot", 0);
- ItemUtils.getItemForOreDict("MorePlanet:diona_item", "ingotFronisium", "Fronisium Ingot", 1);
- ItemUtils.getItemForOreDict("MorePlanet:sirius-b_item", "ingotSulfur", "Sulfur Ingot", 3);
- ItemUtils.getItemForOreDict("MorePlanet:koentus_item", "ingotKoentusMeteoricIron", "Koentus Meteoric Iron Ingot", 4);
- ItemUtils.getItemForOreDict("MorePlanet:mercury_item", "ingotMetallic", "Metallic Ingot", 2);
- ItemUtils.getItemForOreDict("MorePlanet:polongnius_item", "ingotPolongiusMeteoricIron", "Polongius Meteoric Iron Ingot", 4);
- ItemUtils.getItemForOreDict("MorePlanet:mercury_item", "ingotMeteoricSteel", "Meteoric Steel Ingot", 3);
- ItemUtils.getItemForOreDict("MorePlanet:sirius-b_item", "dustSulfur", "Sulfur Dust", 2);
-
- //Gems
- ItemUtils.getItemForOreDict("MorePlanet:fronos_item", "gemBlackDiamond", "Black Diamond Gem", 2);
- ItemUtils.getItemForOreDict("MorePlanet:koentus_item", "gemWhiteCrystal", "White Crystal", 0);
- ItemUtils.getItemForOreDict("MorePlanet:nibiru_item", "gemRedCrystal", "Red Crystal", 0);
- ItemUtils.getItemForOreDict("MorePlanet:pluto_item", "gemXeonius", "Xeonius Gem", 0);
- ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "gemUranium", "Uranium Gem", 1);
- }
+ private static final void run() {
+ // Metals
+ ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotFrozenIron", "Frozen Iron Ingot", 0);
+ ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotAnyIron", "Frozen Iron Ingot", 0);
+ ItemUtils.getItemForOreDict("MorePlanet:polongnius_item", "ingotPalladium", "Palladium Ingot", 5);
+ ItemUtils.getItemForOreDict("MorePlanet:fronos_item", "ingotIridium", "Iridium Ingot", 3);
+ ItemUtils.getItemForOreDict("MorePlanet:nibiru_item", "ingotNorium", "Norium Ingot", 1);
+ ItemUtils.getItemForOreDict("MorePlanet:venus_item", "ingotLead", "Lead Ingot", 0);
+ ItemUtils.getItemForOreDict("MorePlanet:diona_item", "ingotQuontonium", "Quontonium Ingot", 0);
+ ItemUtils.getItemForOreDict("MorePlanet:diona_item", "ingotFronisium", "Fronisium Ingot", 1);
+ ItemUtils.getItemForOreDict("MorePlanet:sirius-b_item", "ingotSulfur", "Sulfur Ingot", 3);
+ ItemUtils.getItemForOreDict(
+ "MorePlanet:koentus_item", "ingotKoentusMeteoricIron", "Koentus Meteoric Iron Ingot", 4);
+ ItemUtils.getItemForOreDict("MorePlanet:mercury_item", "ingotMetallic", "Metallic Ingot", 2);
+ ItemUtils.getItemForOreDict(
+ "MorePlanet:polongnius_item", "ingotPolongiusMeteoricIron", "Polongius Meteoric Iron Ingot", 4);
+ ItemUtils.getItemForOreDict("MorePlanet:mercury_item", "ingotMeteoricSteel", "Meteoric Steel Ingot", 3);
+ ItemUtils.getItemForOreDict("MorePlanet:sirius-b_item", "dustSulfur", "Sulfur Dust", 2);
+ // Gems
+ ItemUtils.getItemForOreDict("MorePlanet:fronos_item", "gemBlackDiamond", "Black Diamond Gem", 2);
+ ItemUtils.getItemForOreDict("MorePlanet:koentus_item", "gemWhiteCrystal", "White Crystal", 0);
+ ItemUtils.getItemForOreDict("MorePlanet:nibiru_item", "gemRedCrystal", "Red Crystal", 0);
+ ItemUtils.getItemForOreDict("MorePlanet:pluto_item", "gemXeonius", "Xeonius Gem", 0);
+ ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "gemUranium", "Uranium Gem", 1);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_OpenBlocks.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_OpenBlocks.java
index 6381a6705e..cade4c4418 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_OpenBlocks.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_OpenBlocks.java
@@ -1,29 +1,28 @@
package gtPlusPlus.core.common.compat;
-import net.minecraft.block.Block;
-import net.minecraft.item.Item;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.block.Block;
+import net.minecraft.item.Item;
public class COMPAT_OpenBlocks {
- public static void OreDict(){
- run();
- }
+ public static void OreDict() {
+ run();
+ }
- private static final void run(){
+ private static final void run() {
- Item aGraveItem = ItemUtils.getItemFromFQRN("OpenBlocks:grave");
- if (aGraveItem == null) {
- return;
- }
- Block aGraveBlock = Block.getBlockFromItem(aGraveItem);
- if (aGraveBlock == null) {
- return;
- }
-
- Logger.INFO("[Hungry Node Blacklist] Setting the Hardness of the OpenBlocks Grave to 6.");
- aGraveBlock.setHardness(6f);
- }
+ Item aGraveItem = ItemUtils.getItemFromFQRN("OpenBlocks:grave");
+ if (aGraveItem == null) {
+ return;
+ }
+ Block aGraveBlock = Block.getBlockFromItem(aGraveItem);
+ if (aGraveBlock == null) {
+ return;
+ }
+ Logger.INFO("[Hungry Node Blacklist] Setting the Hardness of the OpenBlocks Grave to 6.");
+ aGraveBlock.setHardness(6f);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_PlayerAPI.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_PlayerAPI.java
index 12b3a94083..762ffe79a1 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_PlayerAPI.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_PlayerAPI.java
@@ -2,51 +2,34 @@ package gtPlusPlus.core.common.compat;
import api.player.client.ClientPlayerAPI;
import gtPlusPlus.core.common.BasePlayer;
-import gtPlusPlus.core.handler.events.SneakManager;
-import gtPlusPlus.core.util.Utils;
public class COMPAT_PlayerAPI {
- public static class commonProxy{
- public static void initPre(){
+ public static class commonProxy {
+ public static void initPre() {}
- }
+ public static void Init() {}
- public static void Init(){
+ public static void initPost() {}
+ }
- }
+ public static class clientProxy {
+ public static void initPre() {
+ // Utils.registerEvent(SneakManager.instance);
+ }
- public static void initPost(){
+ public static void Init() {
+ ClientPlayerAPI.register("SneakManager", BasePlayer.class);
+ }
- }
- }
+ public static void initPost() {}
+ }
- public static class clientProxy{
- public static void initPre(){
- //Utils.registerEvent(SneakManager.instance);
- }
+ public static class serverProxy {
+ public static void initPre() {}
- public static void Init(){
- ClientPlayerAPI.register("SneakManager", BasePlayer.class);
- }
-
- public static void initPost(){
-
- }
- }
-
- public static class serverProxy{
- public static void initPre(){
-
- }
-
- public static void Init(){
-
- }
-
- public static void initPost(){
-
- }
- }
+ public static void Init() {}
+ public static void initPost() {}
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java
index 0f80dc8be4..5b29345b9d 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java
@@ -1,19 +1,16 @@
package gtPlusPlus.core.common.compat;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.core.item.ModItems;
+import net.minecraft.item.ItemStack;
public class COMPAT_PneumaticCraft {
- public static void OreDict(){
- run();
- }
-
- private static final void run(){
- GT_OreDictUnificator.registerOre("plateCompressedIron", new ItemStack(ModItems.itemPlateCompressedIron));
- }
+ public static void OreDict() {
+ run();
+ }
+ private static final void run() {
+ GT_OreDictUnificator.registerOre("plateCompressedIron", new ItemStack(ModItems.itemPlateCompressedIron));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java
index 37c87ad99d..05e32b21fd 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java
@@ -1,20 +1,16 @@
package gtPlusPlus.core.common.compat;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.core.item.ModItems;
+import net.minecraft.item.ItemStack;
public class COMPAT_RFTools {
- public static void OreDict(){
- run();
- }
-
- private static final void run(){
- GT_OreDictUnificator.registerOre("plateDimensionShard", new ItemStack(ModItems.itemPlateDimensionShard));
-
- }
+ public static void OreDict() {
+ run();
+ }
+ private static final void run() {
+ GT_OreDictUnificator.registerOre("plateDimensionShard", new ItemStack(ModItems.itemPlateDimensionShard));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Railcraft.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Railcraft.java
index f6c8e86808..69fa7674c6 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Railcraft.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Railcraft.java
@@ -2,13 +2,9 @@ package gtPlusPlus.core.common.compat;
public class COMPAT_Railcraft {
- public static void OreDict(){
- run();
- }
-
- private static final void run(){
-
-
- }
+ public static void OreDict() {
+ run();
+ }
+ private static final void run() {}
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java
index 5f9976acb0..c93d522c40 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java
@@ -1,20 +1,16 @@
package gtPlusPlus.core.common.compat;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.core.item.ModItems;
+import net.minecraft.item.ItemStack;
public class COMPAT_SimplyJetpacks {
- public static void OreDict(){
- run();
- }
-
- private static final void run(){
- GT_OreDictUnificator.registerOre("plateEnrichedSoularium", new ItemStack(ModItems.itemPlateEnrichedSoularium));
-
- }
+ public static void OreDict() {
+ run();
+ }
+ private static final void run() {
+ GT_OreDictUnificator.registerOre("plateEnrichedSoularium", new ItemStack(ModItems.itemPlateEnrichedSoularium));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java
index b78c10c8ce..75e7707a01 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java
@@ -1,45 +1,49 @@
package gtPlusPlus.core.common.compat;
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.minecraft.ItemUtils;
public class COMPAT_Thaumcraft {
- public static void OreDict(){
-
- if (ConfigSwitches.enableThaumcraftShardUnification){
- run();
- }
- }
-
- private static final void run(){
-
- for(int i=0; i<=6; i++){
- //Utils.LOG_INFO(""+i);
- ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "shardAny", "TC Shard "+i, i);
- GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStackFromFQRN("Thaumcraft:ItemShard:"+i, 1));
- ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "gemInfusedAnything", "TC Shard "+i, i);
- GT_OreDictUnificator.registerOre("gemInfusedAnything", ItemUtils.getItemStackFromFQRN("Thaumcraft:ItemShard:"+i, 1));
- //System.out.println("TC Shard registration count is: "+i);
- }
-
- if (LoadedMods.ForbiddenMagic){
- for(int i=0; i<=6; i++){
- //Utils.LOG_INFO(""+i);
- ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "shardAny", "FM Shard "+i, i);
- GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStackFromFQRN("ForbiddenMagic:NetherShard:"+i, 1));
- ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "gemInfusedAnything", "FM Shard "+i, i);
- GT_OreDictUnificator.registerOre("gemInfusedAnything", ItemUtils.getItemStackFromFQRN("ForbiddenMagic:NetherShard:"+i, 1));
- //System.out.println("TC Shard registration count is: "+i);
- }
- ItemUtils.getItemForOreDict("ForbiddenMagic:GluttonyShard", "shardAny", "FM Gluttony Shard", 0);
- GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStackFromFQRN("ForbiddenMagic:GluttonyShard", 1));
- ItemUtils.getItemForOreDict("ForbiddenMagic:GluttonyShard", "gemInfusedAnything", "FM Gluttony Shard", 0);
- GT_OreDictUnificator.registerOre("gemInfusedAnything", ItemUtils.getItemStackFromFQRN("ForbiddenMagic:GluttonyShard", 1));
- }
- }
-
+ public static void OreDict() {
+
+ if (ConfigSwitches.enableThaumcraftShardUnification) {
+ run();
+ }
+ }
+
+ private static final void run() {
+
+ for (int i = 0; i <= 6; i++) {
+ // Utils.LOG_INFO(""+i);
+ ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "shardAny", "TC Shard " + i, i);
+ GT_OreDictUnificator.registerOre(
+ "shardAny", ItemUtils.getItemStackFromFQRN("Thaumcraft:ItemShard:" + i, 1));
+ ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "gemInfusedAnything", "TC Shard " + i, i);
+ GT_OreDictUnificator.registerOre(
+ "gemInfusedAnything", ItemUtils.getItemStackFromFQRN("Thaumcraft:ItemShard:" + i, 1));
+ // System.out.println("TC Shard registration count is: "+i);
+ }
+
+ if (LoadedMods.ForbiddenMagic) {
+ for (int i = 0; i <= 6; i++) {
+ // Utils.LOG_INFO(""+i);
+ ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "shardAny", "FM Shard " + i, i);
+ GT_OreDictUnificator.registerOre(
+ "shardAny", ItemUtils.getItemStackFromFQRN("ForbiddenMagic:NetherShard:" + i, 1));
+ ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "gemInfusedAnything", "FM Shard " + i, i);
+ GT_OreDictUnificator.registerOre(
+ "gemInfusedAnything", ItemUtils.getItemStackFromFQRN("ForbiddenMagic:NetherShard:" + i, 1));
+ // System.out.println("TC Shard registration count is: "+i);
+ }
+ ItemUtils.getItemForOreDict("ForbiddenMagic:GluttonyShard", "shardAny", "FM Gluttony Shard", 0);
+ GT_OreDictUnificator.registerOre(
+ "shardAny", ItemUtils.getItemStackFromFQRN("ForbiddenMagic:GluttonyShard", 1));
+ ItemUtils.getItemForOreDict("ForbiddenMagic:GluttonyShard", "gemInfusedAnything", "FM Gluttony Shard", 0);
+ GT_OreDictUnificator.registerOre(
+ "gemInfusedAnything", ItemUtils.getItemStackFromFQRN("ForbiddenMagic:GluttonyShard", 1));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Witchery.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Witchery.java
index cde6e3ae98..9af582e0de 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Witchery.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Witchery.java
@@ -3,24 +3,25 @@ package gtPlusPlus.core.common.compat;
import static gtPlusPlus.core.lib.LoadedMods.Witchery;
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraft.item.ItemStack;
public class COMPAT_Witchery {
- public static void OreDict(){
- run();
- }
-
- private static final void run(){
- //Koboldite
- ItemStack aKobolditeDust = ItemUtils.getItemStackWithMeta(Witchery, "witchery:ingredient", "Koboldite Dust", 148, 1);
- ItemStack aKobolditeNugget = ItemUtils.getItemStackWithMeta(Witchery, "witchery:ingredient", "Koboldite Nugget", 149, 1);
- ItemStack aKobolditeIngot = ItemUtils.getItemStackWithMeta(Witchery, "witchery:ingredient", "Koboldite Ingot", 150, 1);
- if (aKobolditeDust != null) GT_OreDictUnificator.registerOre("dust"+"Koboldite", aKobolditeDust);
- if (aKobolditeNugget != null) GT_OreDictUnificator.registerOre("nugget"+"Koboldite", aKobolditeNugget);
- if (aKobolditeIngot != null) GT_OreDictUnificator.registerOre("ingot"+"Koboldite", aKobolditeIngot);
- }
+ public static void OreDict() {
+ run();
+ }
+ private static final void run() {
+ // Koboldite
+ ItemStack aKobolditeDust =
+ ItemUtils.getItemStackWithMeta(Witchery, "witchery:ingredient", "Koboldite Dust", 148, 1);
+ ItemStack aKobolditeNugget =
+ ItemUtils.getItemStackWithMeta(Witchery, "witchery:ingredient", "Koboldite Nugget", 149, 1);
+ ItemStack aKobolditeIngot =
+ ItemUtils.getItemStackWithMeta(Witchery, "witchery:ingredient", "Koboldite Ingot", 150, 1);
+ if (aKobolditeDust != null) GT_OreDictUnificator.registerOre("dust" + "Koboldite", aKobolditeDust);
+ if (aKobolditeNugget != null) GT_OreDictUnificator.registerOre("nugget" + "Koboldite", aKobolditeNugget);
+ if (aKobolditeIngot != null) GT_OreDictUnificator.registerOre("ingot" + "Koboldite", aKobolditeIngot);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java
index 951b10b432..f2126417c7 100644
--- a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java
+++ b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java
@@ -5,173 +5,601 @@ import static gtPlusPlus.core.lib.CORE.*;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.*;
import static gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames;
-import java.io.File;
-
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-
+import java.io.File;
import net.minecraftforge.common.config.Configuration;
public class ConfigHandler {
- public static void handleConfigFile(final FMLPreInitializationEvent event) {
- final Configuration config = new Configuration(new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg"));
- config.load();
-
- // Debug
- /* DEBUG = config.getBoolean("debugMode", "debug", false,
- "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)");*/
- disableEnderIOIntegration = config.getBoolean("disableEnderIO", "debug", false, "Disables EnderIO Integration.");
- disableEnderIOIngotTooltips = config.getBoolean("disableEnderIOIngotTooltips", "debug", false, "Disables EnderIO Ingot Tooltips. These apparently may cause issues for a very small number of users.");
- MACHINE_INFO = config.getBoolean("enableMachineInfoLogging", "debug", false, "Makes many machines display lots of debug logging.");
- showHiddenNEIItems = config.getBoolean("showHiddenNEIItems", "debug", false, "Makes all items hidden from NEI display.");
- dumpItemAndBlockData = config.getBoolean("dumpItemAndBlockData", "debug", false, "Dumps all GT++ and Toxic Everglade Data to en_US.lang in the config folder. This config option can be used by foreign players to generate blank .lang files, which they can populate with their language of choice.");
-
- // Machines
- enableThaumcraftShardUnification = config.getBoolean("enableThaumcraftShardUnification", "machines", false, "Allows the use of TC shards across many recipes by oreDicting them into a common group.");
- enableAlternativeBatteryAlloy = config.getBoolean("enableAlternativeBatteryAlloy", "machines", false, "Adds a non-Antimony using Battery Alloy. Not Balanced at all..");
- disableIC2Recipes = config.getBoolean("disableIC2Recipes", "machines", false, "Alkaluscraft Related - Removes IC2 Cables Except glass fibre. Few other Misc Tweaks.");
- enableAlternativeDivisionSigilRecipe = config.getBoolean("enableAlternativeDivisionSigilRecipe", "machines", false, "Utilizes Neutronium instead.");
- boilerSteamPerSecond = config.getInt("boilerSteamPerSecond", "machines", 750, 0, 10000, "Sets the steam per second value in LV,MV,HV boilers (respectively 1x,2x,3x this number for the tiers)");
-
- // requireControlCores
- boolean temp = config.getBoolean("requireControlCores", "machines", true, "Multiblocks Require Control Cores");
-
- // Circuits
- enableCustomCircuits = config.getBoolean("enableCustomCircuits", "gregtech", false, "Adds custom circuits to expand past the Master Tier. Only really recommended to enable if enableOldGTcircuits is enabled.");
- enableOldGTcircuits = config.getBoolean("enableOldGTcircuits", "gregtech", false, "Restores circuits and their recipes from Pre-5.09.28 times.");
-
- // Tools
- enableSkookumChoochers = config.getBoolean("enableSkookumChoochers", "gregtech", true, "Adds Custom GT Tools, called Skookum Choochers, functioning as a hard hammer and a wrench.");
- enableMultiSizeTools = config.getBoolean("enableMultiSizeTools", "gregtech", true, "Adds Custom GT Shovels and Pickaxes which mine in a 3x3 style. One of each whill be generated for each Gregtech Material which has Dense Plates and Long Rods available.");
-
- // GT-Fixes
- enableNitroFix = config.getBoolean("enableNitroFix", "gregtech", false, "Restores the old Nitro-Diesel recipes.");
- enableSulfuricAcidFix = config.getBoolean("enableSulfuricAcidFix", "gregtech", false, "Adds GT6 recipes for Sulfuric Acid. Should remove all pre-existing recipes.");
- enableAnimatedTurbines = config.getBoolean("enableAnimatedTurbines", "gregtech", true, "Gives GT Gas/Steam turbines animated textures while running.");
- turbineCutoffBase = config.getInt("turbineCutoffBase", "gregtech", 75000, 0, Integer.MAX_VALUE, "Rotors below this durability will be removed, prevents NEI clutter. Minimum Durability is N * x, where N is the new value set and x is the turbine size, where 1 is Tiny and 4 is Huge. Set to 0 to disable.");
-
- enableHarderRecipesForHighTierCasings = config.getBoolean("enableHarderRecipesForHighTierCasings", "gregtech", false, "Makes LuV+ Casings and Hulls more difficult to craft.");
-
- // Pipes & Cables
- enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true, "Adds Custom GT Fluid Pipes.");
- enableCustom_Cables = config.getBoolean("enableCustom_Cables", "gregtech", true, "Adds Custom GT Cables.");
-
- // Block Drops
- chanceToDropDrainedShard = config.getInt("chanceToDropDrainedShard", "blockdrops", 196, 0, 10000, "Drained shards have a 1 in X chance to drop.");
- chanceToDropFluoriteOre = config.getInt("chanceToDropFluoriteOre", "blockdrops", 32, 0, 10000, "Fluorite Ore has a 1 in X chance to drop from Limestone and a 1 in X*20 from Sandstone..");
-
- // Single machines
- enableMachine_SolarGenerators = config.getBoolean("enableSolarGenerators", "gregtech", false, "These may be overpowered, Consult a local electrician.");
- enableMachine_ComponentAssemblers = config.getBoolean("enableComponentAssemblers", "gregtech", true, "These construct machine components.");
- enableMachine_Safes = config.getBoolean("enableMachineSafes", "gregtech", true, "These protect your goodies/rare stuff.");
- enableMachine_Dehydrators = config.getBoolean("enableMachineDehydrators", "gregtech", true, "These dehydrate stuff.");
- enableMachine_SteamConverter = config.getBoolean("enableMachineSteamConverter", "gregtech", true, "Converts IC2 steam -> Railcraft steam.");
- enableMachine_FluidTanks = config.getBoolean("enableMachineFluidTanks", "gregtech", true, "Portable fluid tanks.");
- enableMachine_RocketEngines = config.getBoolean("enableMachineRocketEngines", "gregtech", true, "Diesel egines with different internals, they consume less fuel overall.");
- enableMachine_GeothermalEngines = config.getBoolean("enableMachineGeothermalEngines", "gregtech", true, "These may be overpowered, Consult a local geologist.");
- enableMachine_WorldAccelerators = config.getBoolean("enableMachineWorldAccelerators", "gregtech", true, "These allow boosting Block/TileEntity Tick times [OP].");
- enableMachine_Tesseracts = config.getBoolean("enableMachineTesseracts", "gregtech", true, "Tesseracts for wireless item/fluid movement.");
- enableMachine_SimpleWasher = config.getBoolean("enableMachineSimpleWasher", "gregtech", true, "Very basic automated cauldron for dust washing.");
- enableMachine_Pollution = config.getBoolean("enableMachinePollution", "gregtech", true, "Pollution Detector & Scrubbers.");
- enableMachine_RF_Convetor = config.getBoolean("enableMachineRFConvetor", "gregtech", true, "Converts RF to GTEU. Requires COFH-Core to be installed.");
-
- // Multi machines
- enableMultiblock_AlloyBlastSmelter = config.getBoolean("enableMultiblockAlloyBlastSmelter", "gregtech", true, "Required to smelt most high tier materials from GT++. Also smelts everything else to molten metal.");
- enableMultiblock_IndustrialCentrifuge = config.getBoolean("enableMultiblockIndustrialCentrifuge", "gregtech", true, "Spin, Spin, Spiiiin.");
- enableMultiblock_IndustrialCokeOven = config.getBoolean("enableMultiblockIndustrialCokeOven", "gregtech", true, "Pyro Oven Alternative, older, more realistic, better.");
- enableMultiblock_IndustrialElectrolyzer = config.getBoolean("enableMultiblockIndustrialElectrolyzer", "gregtech", true, "Electrolyzes things with extra bling factor.");
- enableMultiblock_IndustrialMacerationStack = config.getBoolean("enableMultiblockIndustrialMacerationStack", "gregtech", true, "A hyper efficient maceration tower, nets more bonus outputs.");
- enableMultiblock_IndustrialPlatePress = config.getBoolean("enableMultiblockIndustrialPlatePress", "gregtech", true, "Industrial bendering machine thingo.");
- enableMultiblock_IndustrialWireMill = config.getBoolean("enableMultiblockIndustrialWireMill", "gregtech", true, "Produces fine wire and exotic cables.");
- enableMultiblock_IronBlastFurnace = config.getBoolean("enableMultiblockIronBlastFurnace", "gregtech", true, "Skip the Bronze age, very slowly.");
- enableMultiblock_MatterFabricator = config.getBoolean("enableMultiblockMatterFabricator", "gregtech", true, "?FAB?RIC?ATE MA?TT?ER.");
- enableMultiblock_MultiTank = config.getBoolean("enableMultiblockMultiTank", "gregtech", true, "Tall tanks, each layer adds extra fluid storage.");
- enableMultiblock_PowerSubstation = config.getBoolean("enableMultiblockPowerSubstation", "gregtech", true, "For managing large power grids.");
- enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean("enableMultiblockLiquidFluorideThoriumReactor", "gregtech", true, "For supplying large power grids.");
- enableMultiblock_NuclearFuelRefinery = config.getBoolean("enableMultiblock_NuclearFuelRefinery", "gregtech", true, "Refines molten chemicals into nuclear fuels.");
- enableMultiblock_IndustrialSifter = config.getBoolean("enableMultiblock_IndustrialSifter", "gregtech", true, "Large scale sifting.");
- enableMultiblock_LargeAutoCrafter = config.getBoolean("enableMultiblock_LargeAutoCrafter", "gregtech", true, "Can Assemble, Disassemble and Craft Project data from Data Sticks.");
- enableMultiblock_IndustrialThermalCentrifuge = config.getBoolean("enableMultiblock_IndustrialThermalCentrifuge", "gregtech", true, "Your warm spin for the ore thing.");
- enableMultiblock_IndustrialWashPlant = config.getBoolean("enableMultiblock_IndustrialWashPlant", "gregtech", true, "Used to wash the dirt, riiiiight offff..");
- enableMultiblock_ThermalBoiler = config.getBoolean("enableMachineThermalBoiler", "gregtech", true, "Thermal Boiler from GT4. Can Filter Lava for resources.");
- enableMultiblock_IndustrialCuttingMachine = config.getBoolean("enableMultiblock_IndustrialCuttingMachine", "gregtech", true, "Very fast and efficient Cutting Machine.");
- enableMultiblock_IndustrialFishingPort = config.getBoolean("enableMultiblock_IndustrialFishingPort", "gregtech", true, "Fish the seas, except on land.");
- enableMultiblock_IndustrialExtrudingMachine = config.getBoolean("enableMultiblock_IndustrialExtrudingMachine", "gregtech", true, "Very fast and efficient Extruding Machine.");
- enableMultiblock_IndustrialMultiMachine = config.getBoolean("enableMultiblock_IndustrialMultiMachine", "gregtech", true, "Can run recipes for 9 different types of machines.");
- enableMultiblock_Cyclotron = config.getBoolean("enableMultiblock_Cyclotron", "gregtech", true, "COMET - Scientific Cyclotron.");
-
- // Options
- rfPerEU = config.getInt("rfUsedPerEUForUniversalBatteries", "configurables", 4, 1, 1000, "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)");
-
- // Features
- enableCustomCapes = config.getBoolean("enableSupporterCape", "features", true, "Enables Custom GT++ Cape.");
- disableZombieReinforcement = config.getBoolean("disableZombieReinforcement", "features", false, "Disables Zombie Reinforcement on hard difficutly.");
- enableWatchdogBGM = config.getInt("enableWatchdogBGM", "features", 0, 0, Short.MAX_VALUE, "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s.");
- hideUniversalCells = config.getBoolean("hideUniversalCells", "features", true, "Hides every filled IC2 Universal Cell from NEI.");
-
- // Biomes
- EVERGLADES_ID = config.getInt("darkworld_ID", "worldgen", 227, 1, 254, "The ID of the Dark Dimension.");
- EVERGLADESBIOME_ID = config.getInt("darkbiome_ID", "worldgen", 238, 1, 254, "The biome within the Dark Dimension.");
-
- // Blacklisted Accelerator TileEntities
- BlacklistedTileEntiyClassNames = new String[]{"com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry"};
- BlacklistedTileEntiyClassNames = config.getStringList("BlacklistedTileEntiyClassNames", "gregtech", BlacklistedTileEntiyClassNames, "The Canonical Class-Names of TileEntities that should be ignored by the WorldAccelerator");
-
- // Pollution
- pollutionPerSecondMultiPackager = config.get("pollution", "pollutionPerSecondMultiPackager", pollutionPerSecondMultiPackager, "pollution rate in gibbl/s for the Amazon warehousing depot").getInt(pollutionPerSecondMultiPackager);
- pollutionPerSecondMultiIndustrialAlloySmelter = config.get("pollution", "pollutionPerSecondMultiIndustrialAlloySmelter", pollutionPerSecondMultiIndustrialAlloySmelter, "pollution rate in gibbl/s for the Alloy blast smelter").getInt(pollutionPerSecondMultiIndustrialAlloySmelter);
- pollutionPerSecondMultiIndustrialArcFurnace = config.get("pollution", "pollutionPerSecondMultiIndustrialArcFurnace", pollutionPerSecondMultiIndustrialArcFurnace, "pollution rate in gibbl/s for the High current arc furnace").getInt(pollutionPerSecondMultiIndustrialArcFurnace);
- pollutionPerSecondMultiIndustrialCentrifuge = config.get("pollution", "pollutionPerSecondMultiIndustrialCentrifuge", pollutionPerSecondMultiIndustrialCentrifuge, "pollution rate in gibbl/s for the Industrial centrifuge").getInt(pollutionPerSecondMultiIndustrialCentrifuge);
- pollutionPerSecondMultiIndustrialCokeOven = config.get("pollution", "pollutionPerSecondMultiIndustrialCokeOven", pollutionPerSecondMultiIndustrialCokeOven, "pollution rate in gibbl/s for the Industrial coke oven").getInt(pollutionPerSecondMultiIndustrialCokeOven);
- pollutionPerSecondMultiIndustrialCuttingMachine = config.get("pollution", "pollutionPerSecondMultiIndustrialCuttingMachine", pollutionPerSecondMultiIndustrialCuttingMachine, "pollution rate in gibbl/s for the Cutting factory").getInt(pollutionPerSecondMultiIndustrialCuttingMachine);
- pollutionPerSecondMultiIndustrialDehydrator = config.get("pollution", "pollutionPerSecondMultiIndustrialDehydrator", pollutionPerSecondMultiIndustrialDehydrator, "pollution rate in gibbl/s for the Utupu-Tanuri").getInt(pollutionPerSecondMultiIndustrialDehydrator);
- pollutionPerSecondMultiIndustrialElectrolyzer = config.get("pollution", "pollutionPerSecondMultiIndustrialElectrolyzer", pollutionPerSecondMultiIndustrialElectrolyzer, "pollution rate in gibbl/s for the Industrial electrolyzer").getInt(pollutionPerSecondMultiIndustrialElectrolyzer);
- pollutionPerSecondMultiIndustrialExtruder = config.get("pollution", "pollutionPerSecondMultiIndustrialExtruder", pollutionPerSecondMultiIndustrialExtruder, "pollution rate in gibbl/s for the Industrial extrusion machine").getInt(pollutionPerSecondMultiIndustrialExtruder);
- pollutionPerSecondMultiIndustrialMacerator = config.get("pollution", "pollutionPerSecondMultiIndustrialMacerator", pollutionPerSecondMultiIndustrialMacerator, "pollution rate in gibbl/s for the Maceration stack").getInt(pollutionPerSecondMultiIndustrialMacerator);
- pollutionPerSecondMultiIndustrialMixer = config.get("pollution", "pollutionPerSecondMultiIndustrialMixer", pollutionPerSecondMultiIndustrialMixer, "pollution rate in gibbl/s for the Industrial mixing machine").getInt(pollutionPerSecondMultiIndustrialMixer);
- pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal", pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal, "pollution rate in gibbl/s for the Large processing factory in metal mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal);
- pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid", pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid, "pollution rate in gibbl/s for the Large processing factory in fluid mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid);
- pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc", pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc, "pollution rate in gibbl/s for the Large processing factory in misc mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc);
- pollutionPerSecondMultiIndustrialPlatePress_ModeForming = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeForming", pollutionPerSecondMultiIndustrialPlatePress_ModeForming, "pollution rate in gibbl/s for the Industrial material press in forming mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeForming);
- pollutionPerSecondMultiIndustrialPlatePress_ModeBending = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeBending", pollutionPerSecondMultiIndustrialPlatePress_ModeBending, "pollution rate in gibbl/s for the Industrial material press in bending mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeBending);
- pollutionPerSecondMultiIndustrialForgeHammer = config.get("pollution", "pollutionPerSecondMultiIndustrialForgeHammer", pollutionPerSecondMultiIndustrialForgeHammer, "pollution rate in gibbl/s for the Industrial Forge Hammer").getInt(pollutionPerSecondMultiIndustrialForgeHammer);
- pollutionPerSecondMultiIndustrialSifter = config.get("pollution", "pollutionPerSecondMultiIndustrialSifter", pollutionPerSecondMultiIndustrialSifter, "pollution rate in gibbl/s for the Large Sifter").getInt(pollutionPerSecondMultiIndustrialSifter);
- pollutionPerSecondMultiIndustrialThermalCentrifuge = config.get("pollution", "pollutionPerSecondMultiIndustrialThermalCentrifuge", pollutionPerSecondMultiIndustrialThermalCentrifuge, "pollution rate in gibbl/s for the Large thermal refinery").getInt(pollutionPerSecondMultiIndustrialThermalCentrifuge);
- pollutionPerSecondMultiIndustrialVacuumFreezer = config.get("pollution", "pollutionPerSecondMultiIndustrialVacuumFreezer", pollutionPerSecondMultiIndustrialVacuumFreezer, "pollution rate in gibbl/s for the Cryogenic freezer").getInt(pollutionPerSecondMultiIndustrialVacuumFreezer);
- pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath = config.get("pollution", "pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath", pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath, "pollution rate in gibbl/s for the Ore washing plant in chemical bath mode").getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath);
- pollutionPerSecondMultiIndustrialWashPlant_ModeWasher = config.get("pollution", "pollutionPerSecondMultiIndustrialWashPlant_ModeWasher", pollutionPerSecondMultiIndustrialWashPlant_ModeWasher, "pollution rate in gibbl/s for the Ore washing plant in ore washer mode").getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeWasher);
- pollutionPerSecondMultiIndustrialWireMill = config.get("pollution", "pollutionPerSecondMultiIndustrialWireMill", pollutionPerSecondMultiIndustrialWireMill, "pollution rate in gibbl/s for the Wire factory").getInt(pollutionPerSecondMultiIndustrialWireMill);
- pollutionPerSecondMultiIsaMill = config.get("pollution", "pollutionPerSecondMultiIsaMill", pollutionPerSecondMultiIsaMill, "pollution rate in gibbl/s for the IsaMill grinding machine").getInt(pollutionPerSecondMultiIsaMill);
- pollutionPerSecondMultiAdvDistillationTower_ModeDistillery = config.get("pollution", "pollutionPerSecondMultiAdvDistillationTower_ModeDistillery", pollutionPerSecondMultiAdvDistillationTower_ModeDistillery, "pollution rate in gibbl/s for the Dangote distillus in distillery mode").getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDistillery);
- pollutionPerSecondMultiAdvDistillationTower_ModeDT = config.get("pollution", "pollutionPerSecondMultiAdvDistillationTower_ModeDT", pollutionPerSecondMultiAdvDistillationTower_ModeDT, "pollution rate in gibbl/s for the Dangote distillus in distillation tower mode").getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDT);
- pollutionPerSecondMultiAdvEBF = config.get("pollution", "pollutionPerSecondMultiAdvEBF", pollutionPerSecondMultiAdvEBF, "pollution rate in gibbl/s for the Volcanus").getInt(pollutionPerSecondMultiAdvEBF);
- pollutionPerSecondMultiAdvImplosion = config.get("pollution", "pollutionPerSecondMultiAdvImplosion", pollutionPerSecondMultiAdvImplosion, "pollution rate in gibbl/s for the Density^2").getInt(pollutionPerSecondMultiAdvImplosion);
- pollutionPerSecondMultiABS = config.get("pollution", "pollutionPerSecondMultiABS", pollutionPerSecondMultiABS, "pollution rate in gibbl/s for the Alloy blast furnace").getInt(pollutionPerSecondMultiABS);
- pollutionPerSecondMultiCyclotron = config.get("pollution", "pollutionPerSecondMultiCyclotron", pollutionPerSecondMultiCyclotron, "pollution rate in gibbl/s for the Cyclotron").getInt(pollutionPerSecondMultiCyclotron);
- pollutionPerSecondMultiIndustrialFishingPond = config.get("pollution", "pollutionPerSecondMultiIndustrialFishingPond", pollutionPerSecondMultiIndustrialFishingPond, "pollution rate in gibbl/s for the Zuhai - fishing port").getInt(pollutionPerSecondMultiIndustrialFishingPond);
- // pollutionPerSecondMultiLargeRocketEngine;
- pollutionPerSecondMultiLargeSemiFluidGenerator = config.get("pollution", "pollutionPerSecondMultiLargeSemiFluidGenerator", pollutionPerSecondMultiLargeSemiFluidGenerator, "pollution rate in gibbl/s for the Large semifluid burner").getInt(pollutionPerSecondMultiLargeSemiFluidGenerator);
- pollutionPerSecondMultiMassFabricator = config.get("pollution", "pollutionPerSecondMultiMassFabricator", pollutionPerSecondMultiMassFabricator, "pollution rate in gibbl/s for the Matter fabrication CPU").getInt(pollutionPerSecondMultiMassFabricator);
- pollutionPerSecondMultiRefinery = config.get("pollution", "pollutionPerSecondMultiRefinery", pollutionPerSecondMultiRefinery, "pollution rate in gibbl/s for the Reactor fuel processing plant").getInt(pollutionPerSecondMultiRefinery);
- // pollutionPerSecondMultiGeneratorArray;
- pollutionPerSecondMultiIndustrialRockBreaker = config.get("pollution", "pollutionPerSecondMultiIndustrialRockBreaker", pollutionPerSecondMultiIndustrialRockBreaker, "pollution rate in gibbl/s for the Industrial Rock Breaker").getInt(pollutionPerSecondMultiIndustrialRockBreaker);
- pollutionPerSecondMultiIndustrialChisel = config.get("pollution", "pollutionPerSecondMultiIndustrialChisel", pollutionPerSecondMultiIndustrialChisel, "pollution rate in gibbl/s for the Industrial Chisel").getInt(pollutionPerSecondMultiIndustrialChisel);
- pollutionPerSecondMultiTreeFarm = config.get("pollution", "pollutionPerSecondMultiTreeFarm", pollutionPerSecondMultiTreeFarm, "pollution rate in gibbl/s for the Tree growth simulator").getInt(pollutionPerSecondMultiTreeFarm);
- pollutionPerSecondMultiFrothFlotationCell = config.get("pollution", "pollutionPerSecondMultiFrothFlotationCell", pollutionPerSecondMultiFrothFlotationCell, "pollution rate in gibbl/s for the Flotation cell regulator").getInt(pollutionPerSecondMultiFrothFlotationCell);
- pollutionPerSecondMultiAutoCrafter = config.get("pollution", "pollutionPerSecondMultiAutoCrafter", pollutionPerSecondMultiAutoCrafter, "pollution rate in gibbl/s for the Large-Scale auto assembler v1.01").getInt(pollutionPerSecondMultiAutoCrafter);
- pollutionPerSecondMultiMolecularTransformer = config.get("pollution", "pollutionPerSecondMultiMolecularTransformer", pollutionPerSecondMultiMolecularTransformer, "pollution rate in gibbl/s for the Multiblock Molecular Transformer").getInt(pollutionPerSecondMultiMolecularTransformer);
- pollutionPerSecondMultiThermalBoiler = config.get("pollution", "pollutionPerSecondMultiThermalBoiler", pollutionPerSecondMultiThermalBoiler, "pollution rate in gibbl/s for the Thermal boiler").getInt(pollutionPerSecondMultiThermalBoiler);
- pollutionPerSecondMultiAlgaePond = config.get("pollution", "pollutionPerSecondMultiAlgaePond", pollutionPerSecondMultiAlgaePond, "pollution rate in gibbl/s for the Algae farm").getInt(pollutionPerSecondMultiAlgaePond);
- basePollutionPerSecondSemiFluidGenerator = config.get("pollution", "basePollutionPerSecondSemiFluidGenerator", basePollutionPerSecondSemiFluidGenerator, "base pollution rate in gibbl/s for the single block semi fluid generators").getInt(basePollutionPerSecondSemiFluidGenerator);
- pollutionReleasedByTierSemiFluidGenerator = config.get("pollution", "pollutionReleasedByTierSemiFluidGenerator", pollutionReleasedByTierSemiFluidGenerator, "coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)").getDoubleList();
- basePollutionPerSecondBoiler = config.get("pollution", "basePollutionPerSecondBoiler", basePollutionPerSecondBoiler, "base pollution rate in gibbl/s for the single block boilers").getInt(basePollutionPerSecondBoiler);
- pollutionReleasedByTierBoiler = config.get("pollution", "pollutionReleasedByTierBoiler", pollutionReleasedByTierBoiler, "coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)").getDoubleList();
- baseMinPollutionPerSecondRocketFuelGenerator = config.get("pollution", "baseMinPollutionPerSecondRocketFuelGenerator", baseMinPollutionPerSecondRocketFuelGenerator, "minimum base pollution rate in gibbl/s for the single block rocket engines").getInt(baseMinPollutionPerSecondRocketFuelGenerator);
- baseMaxPollutionPerSecondRocketFuelGenerator = config.get("pollution", "baseMaxPollutionPerSecondRocketFuelGenerator", baseMaxPollutionPerSecondRocketFuelGenerator, "maximum base pollution rate in gibbl/s for the single block rocket engines").getInt(baseMaxPollutionPerSecondRocketFuelGenerator);
- pollutionReleasedByTierRocketFuelGenerator = config.get("pollution", "pollutionReleasedByTierRocketFuelGenerator", pollutionReleasedByTierRocketFuelGenerator, "coefficient applied to the base rate of the single block rocket engines based on its tier (first is tier 0 aka ULV)").getDoubleList();
- basePollutionPerSecondGeothermalGenerator = config.get("pollution", "basePollutionPerSecondGeothermalGenerator", basePollutionPerSecondGeothermalGenerator, "base pollution rate in gibbl/s for the geothermal engines").getInt(basePollutionPerSecondGeothermalGenerator);
- pollutionReleasedByTierGeothermalGenerator = config.get("pollution", "pollutionReleasedByTierGeothermalGenerator", pollutionReleasedByTierGeothermalGenerator, "coefficient applied to the base rate of the single block geothermal engines based on its tier (first is tier 0 aka ULV)").getDoubleList();
- config.save();
- }
+ public static void handleConfigFile(final FMLPreInitializationEvent event) {
+ final Configuration config =
+ new Configuration(new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg"));
+ config.load();
+
+ // Debug
+ /* DEBUG = config.getBoolean("debugMode", "debug", false,
+ "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)");*/
+ disableEnderIOIntegration =
+ config.getBoolean("disableEnderIO", "debug", false, "Disables EnderIO Integration.");
+ disableEnderIOIngotTooltips = config.getBoolean(
+ "disableEnderIOIngotTooltips",
+ "debug",
+ false,
+ "Disables EnderIO Ingot Tooltips. These apparently may cause issues for a very small number of users.");
+ MACHINE_INFO = config.getBoolean(
+ "enableMachineInfoLogging", "debug", false, "Makes many machines display lots of debug logging.");
+ showHiddenNEIItems =
+ config.getBoolean("showHiddenNEIItems", "debug", false, "Makes all items hidden from NEI display.");
+ dumpItemAndBlockData = config.getBoolean(
+ "dumpItemAndBlockData",
+ "debug",
+ false,
+ "Dumps all GT++ and Toxic Everglade Data to en_US.lang in the config folder. This config option can be used by foreign players to generate blank .lang files, which they can populate with their language of choice.");
+
+ // Machines
+ enableThaumcraftShardUnification = config.getBoolean(
+ "enableThaumcraftShardUnification",
+ "machines",
+ false,
+ "Allows the use of TC shards across many recipes by oreDicting them into a common group.");
+ enableAlternativeBatteryAlloy = config.getBoolean(
+ "enableAlternativeBatteryAlloy",
+ "machines",
+ false,
+ "Adds a non-Antimony using Battery Alloy. Not Balanced at all..");
+ disableIC2Recipes = config.getBoolean(
+ "disableIC2Recipes",
+ "machines",
+ false,
+ "Alkaluscraft Related - Removes IC2 Cables Except glass fibre. Few other Misc Tweaks.");
+ enableAlternativeDivisionSigilRecipe = config.getBoolean(
+ "enableAlternativeDivisionSigilRecipe", "machines", false, "Utilizes Neutronium instead.");
+ boilerSteamPerSecond = config.getInt(
+ "boilerSteamPerSecond",
+ "machines",
+ 750,
+ 0,
+ 10000,
+ "Sets the steam per second value in LV,MV,HV boilers (respectively 1x,2x,3x this number for the tiers)");
+
+ // requireControlCores
+ boolean temp = config.getBoolean("requireControlCores", "machines", true, "Multiblocks Require Control Cores");
+
+ // Circuits
+ enableCustomCircuits = config.getBoolean(
+ "enableCustomCircuits",
+ "gregtech",
+ false,
+ "Adds custom circuits to expand past the Master Tier. Only really recommended to enable if enableOldGTcircuits is enabled.");
+ enableOldGTcircuits = config.getBoolean(
+ "enableOldGTcircuits",
+ "gregtech",
+ false,
+ "Restores circuits and their recipes from Pre-5.09.28 times.");
+
+ // Tools
+ enableSkookumChoochers = config.getBoolean(
+ "enableSkookumChoochers",
+ "gregtech",
+ true,
+ "Adds Custom GT Tools, called Skookum Choochers, functioning as a hard hammer and a wrench.");
+ enableMultiSizeTools = config.getBoolean(
+ "enableMultiSizeTools",
+ "gregtech",
+ true,
+ "Adds Custom GT Shovels and Pickaxes which mine in a 3x3 style. One of each whill be generated for each Gregtech Material which has Dense Plates and Long Rods available.");
+
+ // GT-Fixes
+ enableNitroFix =
+ config.getBoolean("enableNitroFix", "gregtech", false, "Restores the old Nitro-Diesel recipes.");
+ enableSulfuricAcidFix = config.getBoolean(
+ "enableSulfuricAcidFix",
+ "gregtech",
+ false,
+ "Adds GT6 recipes for Sulfuric Acid. Should remove all pre-existing recipes.");
+ enableAnimatedTurbines = config.getBoolean(
+ "enableAnimatedTurbines",
+ "gregtech",
+ true,
+ "Gives GT Gas/Steam turbines animated textures while running.");
+ turbineCutoffBase = config.getInt(
+ "turbineCutoffBase",
+ "gregtech",
+ 75000,
+ 0,
+ Integer.MAX_VALUE,
+ "Rotors below this durability will be removed, prevents NEI clutter. Minimum Durability is N * x, where N is the new value set and x is the turbine size, where 1 is Tiny and 4 is Huge. Set to 0 to disable.");
+
+ enableHarderRecipesForHighTierCasings = config.getBoolean(
+ "enableHarderRecipesForHighTierCasings",
+ "gregtech",
+ false,
+ "Makes LuV+ Casings and Hulls more difficult to craft.");
+
+ // Pipes & Cables
+ enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true, "Adds Custom GT Fluid Pipes.");
+ enableCustom_Cables = config.getBoolean("enableCustom_Cables", "gregtech", true, "Adds Custom GT Cables.");
+
+ // Block Drops
+ chanceToDropDrainedShard = config.getInt(
+ "chanceToDropDrainedShard",
+ "blockdrops",
+ 196,
+ 0,
+ 10000,
+ "Drained shards have a 1 in X chance to drop.");
+ chanceToDropFluoriteOre = config.getInt(
+ "chanceToDropFluoriteOre",
+ "blockdrops",
+ 32,
+ 0,
+ 10000,
+ "Fluorite Ore has a 1 in X chance to drop from Limestone and a 1 in X*20 from Sandstone..");
+
+ // Single machines
+ enableMachine_SolarGenerators = config.getBoolean(
+ "enableSolarGenerators", "gregtech", false, "These may be overpowered, Consult a local electrician.");
+ enableMachine_ComponentAssemblers =
+ config.getBoolean("enableComponentAssemblers", "gregtech", true, "These construct machine components.");
+ enableMachine_Safes =
+ config.getBoolean("enableMachineSafes", "gregtech", true, "These protect your goodies/rare stuff.");
+ enableMachine_Dehydrators =
+ config.getBoolean("enableMachineDehydrators", "gregtech", true, "These dehydrate stuff.");
+ enableMachine_SteamConverter = config.getBoolean(
+ "enableMachineSteamConverter", "gregtech", true, "Converts IC2 steam -> Railcraft steam.");
+ enableMachine_FluidTanks =
+ config.getBoolean("enableMachineFluidTanks", "gregtech", true, "Portable fluid tanks.");
+ enableMachine_RocketEngines = config.getBoolean(
+ "enableMachineRocketEngines",
+ "gregtech",
+ true,
+ "Diesel egines with different internals, they consume less fuel overall.");
+ enableMachine_GeothermalEngines = config.getBoolean(
+ "enableMachineGeothermalEngines",
+ "gregtech",
+ true,
+ "These may be overpowered, Consult a local geologist.");
+ enableMachine_WorldAccelerators = config.getBoolean(
+ "enableMachineWorldAccelerators",
+ "gregtech",
+ true,
+ "These allow boosting Block/TileEntity Tick times [OP].");
+ enableMachine_Tesseracts = config.getBoolean(
+ "enableMachineTesseracts", "gregtech", true, "Tesseracts for wireless item/fluid movement.");
+ enableMachine_SimpleWasher = config.getBoolean(
+ "enableMachineSimpleWasher", "gregtech", true, "Very basic automated cauldron for dust washing.");
+ enableMachine_Pollution =
+ config.getBoolean("enableMachinePollution", "gregtech", true, "Pollution Detector & Scrubbers.");
+ enableMachine_RF_Convetor = config.getBoolean(
+ "enableMachineRFConvetor",
+ "gregtech",
+ true,
+ "Converts RF to GTEU. Requires COFH-Core to be installed.");
+
+ // Multi machines
+ enableMultiblock_AlloyBlastSmelter = config.getBoolean(
+ "enableMultiblockAlloyBlastSmelter",
+ "gregtech",
+ true,
+ "Required to smelt most high tier materials from GT++. Also smelts everything else to molten metal.");
+ enableMultiblock_IndustrialCentrifuge =
+ config.getBoolean("enableMultiblockIndustrialCentrifuge", "gregtech", true, "Spin, Spin, Spiiiin.");
+ enableMultiblock_IndustrialCokeOven = config.getBoolean(
+ "enableMultiblockIndustrialCokeOven",
+ "gregtech",
+ true,
+ "Pyro Oven Alternative, older, more realistic, better.");
+ enableMultiblock_IndustrialElectrolyzer = config.getBoolean(
+ "enableMultiblockIndustrialElectrolyzer",
+ "gregtech",
+ true,
+ "Electrolyzes things with extra bling factor.");
+ enableMultiblock_IndustrialMacerationStack = config.getBoolean(
+ "enableMultiblockIndustrialMacerationStack",
+ "gregtech",
+ true,
+ "A hyper efficient maceration tower, nets more bonus outputs.");
+ enableMultiblock_IndustrialPlatePress = config.getBoolean(
+ "enableMultiblockIndustrialPlatePress", "gregtech", true, "Industrial bendering machine thingo.");
+ enableMultiblock_IndustrialWireMill = config.getBoolean(
+ "enableMultiblockIndustrialWireMill", "gregtech", true, "Produces fine wire and exotic cables.");
+ enableMultiblock_IronBlastFurnace = config.getBoolean(
+ "enableMultiblockIronBlastFurnace", "gregtech", true, "Skip the Bronze age, very slowly.");
+ enableMultiblock_MatterFabricator =
+ config.getBoolean("enableMultiblockMatterFabricator", "gregtech", true, "?FAB?RIC?ATE MA?TT?ER.");
+ enableMultiblock_MultiTank = config.getBoolean(
+ "enableMultiblockMultiTank", "gregtech", true, "Tall tanks, each layer adds extra fluid storage.");
+ enableMultiblock_PowerSubstation = config.getBoolean(
+ "enableMultiblockPowerSubstation", "gregtech", true, "For managing large power grids.");
+ enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean(
+ "enableMultiblockLiquidFluorideThoriumReactor", "gregtech", true, "For supplying large power grids.");
+ enableMultiblock_NuclearFuelRefinery = config.getBoolean(
+ "enableMultiblock_NuclearFuelRefinery",
+ "gregtech",
+ true,
+ "Refines molten chemicals into nuclear fuels.");
+ enableMultiblock_IndustrialSifter =
+ config.getBoolean("enableMultiblock_IndustrialSifter", "gregtech", true, "Large scale sifting.");
+ enableMultiblock_LargeAutoCrafter = config.getBoolean(
+ "enableMultiblock_LargeAutoCrafter",
+ "gregtech",
+ true,
+ "Can Assemble, Disassemble and Craft Project data from Data Sticks.");
+ enableMultiblock_IndustrialThermalCentrifuge = config.getBoolean(
+ "enableMultiblock_IndustrialThermalCentrifuge", "gregtech", true, "Your warm spin for the ore thing.");
+ enableMultiblock_IndustrialWashPlant = config.getBoolean(
+ "enableMultiblock_IndustrialWashPlant", "gregtech", true, "Used to wash the dirt, riiiiight offff..");
+ enableMultiblock_ThermalBoiler = config.getBoolean(
+ "enableMachineThermalBoiler",
+ "gregtech",
+ true,
+ "Thermal Boiler from GT4. Can Filter Lava for resources.");
+ enableMultiblock_IndustrialCuttingMachine = config.getBoolean(
+ "enableMultiblock_IndustrialCuttingMachine",
+ "gregtech",
+ true,
+ "Very fast and efficient Cutting Machine.");
+ enableMultiblock_IndustrialFishingPort = config.getBoolean(
+ "enableMultiblock_IndustrialFishingPort", "gregtech", true, "Fish the seas, except on land.");
+ enableMultiblock_IndustrialExtrudingMachine = config.getBoolean(
+ "enableMultiblock_IndustrialExtrudingMachine",
+ "gregtech",
+ true,
+ "Very fast and efficient Extruding Machine.");
+ enableMultiblock_IndustrialMultiMachine = config.getBoolean(
+ "enableMultiblock_IndustrialMultiMachine",
+ "gregtech",
+ true,
+ "Can run recipes for 9 different types of machines.");
+ enableMultiblock_Cyclotron =
+ config.getBoolean("enableMultiblock_Cyclotron", "gregtech", true, "COMET - Scientific Cyclotron.");
+
+ // Options
+ rfPerEU = config.getInt(
+ "rfUsedPerEUForUniversalBatteries",
+ "configurables",
+ 4,
+ 1,
+ 1000,
+ "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)");
+
+ // Features
+ enableCustomCapes = config.getBoolean("enableSupporterCape", "features", true, "Enables Custom GT++ Cape.");
+ disableZombieReinforcement = config.getBoolean(
+ "disableZombieReinforcement", "features", false, "Disables Zombie Reinforcement on hard difficutly.");
+ enableWatchdogBGM = config.getInt(
+ "enableWatchdogBGM",
+ "features",
+ 0,
+ 0,
+ Short.MAX_VALUE,
+ "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s.");
+ hideUniversalCells = config.getBoolean(
+ "hideUniversalCells", "features", true, "Hides every filled IC2 Universal Cell from NEI.");
+
+ // Biomes
+ EVERGLADES_ID = config.getInt("darkworld_ID", "worldgen", 227, 1, 254, "The ID of the Dark Dimension.");
+ EVERGLADESBIOME_ID =
+ config.getInt("darkbiome_ID", "worldgen", 238, 1, 254, "The biome within the Dark Dimension.");
+
+ // Blacklisted Accelerator TileEntities
+ BlacklistedTileEntiyClassNames =
+ new String[] {"com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry"};
+ BlacklistedTileEntiyClassNames = config.getStringList(
+ "BlacklistedTileEntiyClassNames",
+ "gregtech",
+ BlacklistedTileEntiyClassNames,
+ "The Canonical Class-Names of TileEntities that should be ignored by the WorldAccelerator");
+ // Pollution
+ pollutionPerSecondMultiPackager = config.get(
+ "pollution",
+ "pollutionPerSecondMultiPackager",
+ pollutionPerSecondMultiPackager,
+ "pollution rate in gibbl/s for the Amazon warehousing depot")
+ .getInt(pollutionPerSecondMultiPackager);
+ pollutionPerSecondMultiIndustrialAlloySmelter = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialAlloySmelter",
+ pollutionPerSecondMultiIndustrialAlloySmelter,
+ "pollution rate in gibbl/s for the Alloy blast smelter")
+ .getInt(pollutionPerSecondMultiIndustrialAlloySmelter);
+ pollutionPerSecondMultiIndustrialArcFurnace = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialArcFurnace",
+ pollutionPerSecondMultiIndustrialArcFurnace,
+ "pollution rate in gibbl/s for the High current arc furnace")
+ .getInt(pollutionPerSecondMultiIndustrialArcFurnace);
+ pollutionPerSecondMultiIndustrialCentrifuge = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialCentrifuge",
+ pollutionPerSecondMultiIndustrialCentrifuge,
+ "pollution rate in gibbl/s for the Industrial centrifuge")
+ .getInt(pollutionPerSecondMultiIndustrialCentrifuge);
+ pollutionPerSecondMultiIndustrialCokeOven = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialCokeOven",
+ pollutionPerSecondMultiIndustrialCokeOven,
+ "pollution rate in gibbl/s for the Industrial coke oven")
+ .getInt(pollutionPerSecondMultiIndustrialCokeOven);
+ pollutionPerSecondMultiIndustrialCuttingMachine = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialCuttingMachine",
+ pollutionPerSecondMultiIndustrialCuttingMachine,
+ "pollution rate in gibbl/s for the Cutting factory")
+ .getInt(pollutionPerSecondMultiIndustrialCuttingMachine);
+ pollutionPerSecondMultiIndustrialDehydrator = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialDehydrator",
+ pollutionPerSecondMultiIndustrialDehydrator,
+ "pollution rate in gibbl/s for the Utupu-Tanuri")
+ .getInt(pollutionPerSecondMultiIndustrialDehydrator);
+ pollutionPerSecondMultiIndustrialElectrolyzer = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialElectrolyzer",
+ pollutionPerSecondMultiIndustrialElectrolyzer,
+ "pollution rate in gibbl/s for the Industrial electrolyzer")
+ .getInt(pollutionPerSecondMultiIndustrialElectrolyzer);
+ pollutionPerSecondMultiIndustrialExtruder = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialExtruder",
+ pollutionPerSecondMultiIndustrialExtruder,
+ "pollution rate in gibbl/s for the Industrial extrusion machine")
+ .getInt(pollutionPerSecondMultiIndustrialExtruder);
+ pollutionPerSecondMultiIndustrialMacerator = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialMacerator",
+ pollutionPerSecondMultiIndustrialMacerator,
+ "pollution rate in gibbl/s for the Maceration stack")
+ .getInt(pollutionPerSecondMultiIndustrialMacerator);
+ pollutionPerSecondMultiIndustrialMixer = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialMixer",
+ pollutionPerSecondMultiIndustrialMixer,
+ "pollution rate in gibbl/s for the Industrial mixing machine")
+ .getInt(pollutionPerSecondMultiIndustrialMixer);
+ pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal",
+ pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal,
+ "pollution rate in gibbl/s for the Large processing factory in metal mode")
+ .getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal);
+ pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid",
+ pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid,
+ "pollution rate in gibbl/s for the Large processing factory in fluid mode")
+ .getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid);
+ pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc",
+ pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc,
+ "pollution rate in gibbl/s for the Large processing factory in misc mode")
+ .getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc);
+ pollutionPerSecondMultiIndustrialPlatePress_ModeForming = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialPlatePress_ModeForming",
+ pollutionPerSecondMultiIndustrialPlatePress_ModeForming,
+ "pollution rate in gibbl/s for the Industrial material press in forming mode")
+ .getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeForming);
+ pollutionPerSecondMultiIndustrialPlatePress_ModeBending = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialPlatePress_ModeBending",
+ pollutionPerSecondMultiIndustrialPlatePress_ModeBending,
+ "pollution rate in gibbl/s for the Industrial material press in bending mode")
+ .getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeBending);
+ pollutionPerSecondMultiIndustrialForgeHammer = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialForgeHammer",
+ pollutionPerSecondMultiIndustrialForgeHammer,
+ "pollution rate in gibbl/s for the Industrial Forge Hammer")
+ .getInt(pollutionPerSecondMultiIndustrialForgeHammer);
+ pollutionPerSecondMultiIndustrialSifter = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialSifter",
+ pollutionPerSecondMultiIndustrialSifter,
+ "pollution rate in gibbl/s for the Large Sifter")
+ .getInt(pollutionPerSecondMultiIndustrialSifter);
+ pollutionPerSecondMultiIndustrialThermalCentrifuge = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialThermalCentrifuge",
+ pollutionPerSecondMultiIndustrialThermalCentrifuge,
+ "pollution rate in gibbl/s for the Large thermal refinery")
+ .getInt(pollutionPerSecondMultiIndustrialThermalCentrifuge);
+ pollutionPerSecondMultiIndustrialVacuumFreezer = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialVacuumFreezer",
+ pollutionPerSecondMultiIndustrialVacuumFreezer,
+ "pollution rate in gibbl/s for the Cryogenic freezer")
+ .getInt(pollutionPerSecondMultiIndustrialVacuumFreezer);
+ pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath",
+ pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath,
+ "pollution rate in gibbl/s for the Ore washing plant in chemical bath mode")
+ .getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath);
+ pollutionPerSecondMultiIndustrialWashPlant_ModeWasher = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialWashPlant_ModeWasher",
+ pollutionPerSecondMultiIndustrialWashPlant_ModeWasher,
+ "pollution rate in gibbl/s for the Ore washing plant in ore washer mode")
+ .getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeWasher);
+ pollutionPerSecondMultiIndustrialWireMill = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialWireMill",
+ pollutionPerSecondMultiIndustrialWireMill,
+ "pollution rate in gibbl/s for the Wire factory")
+ .getInt(pollutionPerSecondMultiIndustrialWireMill);
+ pollutionPerSecondMultiIsaMill = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIsaMill",
+ pollutionPerSecondMultiIsaMill,
+ "pollution rate in gibbl/s for the IsaMill grinding machine")
+ .getInt(pollutionPerSecondMultiIsaMill);
+ pollutionPerSecondMultiAdvDistillationTower_ModeDistillery = config.get(
+ "pollution",
+ "pollutionPerSecondMultiAdvDistillationTower_ModeDistillery",
+ pollutionPerSecondMultiAdvDistillationTower_ModeDistillery,
+ "pollution rate in gibbl/s for the Dangote distillus in distillery mode")
+ .getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDistillery);
+ pollutionPerSecondMultiAdvDistillationTower_ModeDT = config.get(
+ "pollution",
+ "pollutionPerSecondMultiAdvDistillationTower_ModeDT",
+ pollutionPerSecondMultiAdvDistillationTower_ModeDT,
+ "pollution rate in gibbl/s for the Dangote distillus in distillation tower mode")
+ .getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDT);
+ pollutionPerSecondMultiAdvEBF = config.get(
+ "pollution",
+ "pollutionPerSecondMultiAdvEBF",
+ pollutionPerSecondMultiAdvEBF,
+ "pollution rate in gibbl/s for the Volcanus")
+ .getInt(pollutionPerSecondMultiAdvEBF);
+ pollutionPerSecondMultiAdvImplosion = config.get(
+ "pollution",
+ "pollutionPerSecondMultiAdvImplosion",
+ pollutionPerSecondMultiAdvImplosion,
+ "pollution rate in gibbl/s for the Density^2")
+ .getInt(pollutionPerSecondMultiAdvImplosion);
+ pollutionPerSecondMultiABS = config.get(
+ "pollution",
+ "pollutionPerSecondMultiABS",
+ pollutionPerSecondMultiABS,
+ "pollution rate in gibbl/s for the Alloy blast furnace")
+ .getInt(pollutionPerSecondMultiABS);
+ pollutionPerSecondMultiCyclotron = config.get(
+ "pollution",
+ "pollutionPerSecondMultiCyclotron",
+ pollutionPerSecondMultiCyclotron,
+ "pollution rate in gibbl/s for the Cyclotron")
+ .getInt(pollutionPerSecondMultiCyclotron);
+ pollutionPerSecondMultiIndustrialFishingPond = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialFishingPond",
+ pollutionPerSecondMultiIndustrialFishingPond,
+ "pollution rate in gibbl/s for the Zuhai - fishing port")
+ .getInt(pollutionPerSecondMultiIndustrialFishingPond);
+ // pollutionPerSecondMultiLargeRocketEngine;
+ pollutionPerSecondMultiLargeSemiFluidGenerator = config.get(
+ "pollution",
+ "pollutionPerSecondMultiLargeSemiFluidGenerator",
+ pollutionPerSecondMultiLargeSemiFluidGenerator,
+ "pollution rate in gibbl/s for the Large semifluid burner")
+ .getInt(pollutionPerSecondMultiLargeSemiFluidGenerator);
+ pollutionPerSecondMultiMassFabricator = config.get(
+ "pollution",
+ "pollutionPerSecondMultiMassFabricator",
+ pollutionPerSecondMultiMassFabricator,
+ "pollution rate in gibbl/s for the Matter fabrication CPU")
+ .getInt(pollutionPerSecondMultiMassFabricator);
+ pollutionPerSecondMultiRefinery = config.get(
+ "pollution",
+ "pollutionPerSecondMultiRefinery",
+ pollutionPerSecondMultiRefinery,
+ "pollution rate in gibbl/s for the Reactor fuel processing plant")
+ .getInt(pollutionPerSecondMultiRefinery);
+ // pollutionPerSecondMultiGeneratorArray;
+ pollutionPerSecondMultiIndustrialRockBreaker = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialRockBreaker",
+ pollutionPerSecondMultiIndustrialRockBreaker,
+ "pollution rate in gibbl/s for the Industrial Rock Breaker")
+ .getInt(pollutionPerSecondMultiIndustrialRockBreaker);
+ pollutionPerSecondMultiIndustrialChisel = config.get(
+ "pollution",
+ "pollutionPerSecondMultiIndustrialChisel",
+ pollutionPerSecondMultiIndustrialChisel,
+ "pollution rate in gibbl/s for the Industrial Chisel")
+ .getInt(pollutionPerSecondMultiIndustrialChisel);
+ pollutionPerSecondMultiTreeFarm = config.get(
+ "pollution",
+ "pollutionPerSecondMultiTreeFarm",
+ pollutionPerSecondMultiTreeFarm,
+ "pollution rate in gibbl/s for the Tree growth simulator")
+ .getInt(pollutionPerSecondMultiTreeFarm);
+ pollutionPerSecondMultiFrothFlotationCell = config.get(
+ "pollution",
+ "pollutionPerSecondMultiFrothFlotationCell",
+ pollutionPerSecondMultiFrothFlotationCell,
+ "pollution rate in gibbl/s for the Flotation cell regulator")
+ .getInt(pollutionPerSecondMultiFrothFlotationCell);
+ pollutionPerSecondMultiAutoCrafter = config.get(
+ "pollution",
+ "pollutionPerSecondMultiAutoCrafter",
+ pollutionPerSecondMultiAutoCrafter,
+ "pollution rate in gibbl/s for the Large-Scale auto assembler v1.01")
+ .getInt(pollutionPerSecondMultiAutoCrafter);
+ pollutionPerSecondMultiMolecularTransformer = config.get(
+ "pollution",
+ "pollutionPerSecondMultiMolecularTransformer",
+ pollutionPerSecondMultiMolecularTransformer,
+ "pollution rate in gibbl/s for the Multiblock Molecular Transformer")
+ .getInt(pollutionPerSecondMultiMolecularTransformer);
+ pollutionPerSecondMultiThermalBoiler = config.get(
+ "pollution",
+ "pollutionPerSecondMultiThermalBoiler",
+ pollutionPerSecondMultiThermalBoiler,
+ "pollution rate in gibbl/s for the Thermal boiler")
+ .getInt(pollutionPerSecondMultiThermalBoiler);
+ pollutionPerSecondMultiAlgaePond = config.get(
+ "pollution",
+ "pollutionPerSecondMultiAlgaePond",
+ pollutionPerSecondMultiAlgaePond,
+ "pollution rate in gibbl/s for the Algae farm")
+ .getInt(pollutionPerSecondMultiAlgaePond);
+ basePollutionPerSecondSemiFluidGenerator = config.get(
+ "pollution",
+ "basePollutionPerSecondSemiFluidGenerator",
+ basePollutionPerSecondSemiFluidGenerator,
+ "base pollution rate in gibbl/s for the single block semi fluid generators")
+ .getInt(basePollutionPerSecondSemiFluidGenerator);
+ pollutionReleasedByTierSemiFluidGenerator = config.get(
+ "pollution",
+ "pollutionReleasedByTierSemiFluidGenerator",
+ pollutionReleasedByTierSemiFluidGenerator,
+ "coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)")
+ .getDoubleList();
+ basePollutionPerSecondBoiler = config.get(
+ "pollution",
+ "basePollutionPerSecondBoiler",
+ basePollutionPerSecondBoiler,
+ "base pollution rate in gibbl/s for the single block boilers")
+ .getInt(basePollutionPerSecondBoiler);
+ pollutionReleasedByTierBoiler = config.get(
+ "pollution",
+ "pollutionReleasedByTierBoiler",
+ pollutionReleasedByTierBoiler,
+ "coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)")
+ .getDoubleList();
+ baseMinPollutionPerSecondRocketFuelGenerator = config.get(
+ "pollution",
+ "baseMinPollutionPerSecondRocketFuelGenerator",
+ baseMinPollutionPerSecondRocketFuelGenerator,
+ "minimum base pollution rate in gibbl/s for the single block rocket engines")
+ .getInt(baseMinPollutionPerSecondRocketFuelGenerator);
+ baseMaxPollutionPerSecondRocketFuelGenerator = config.get(
+ "pollution",
+ "baseMaxPollutionPerSecondRocketFuelGenerator",
+ baseMaxPollutionPerSecondRocketFuelGenerator,
+ "maximum base pollution rate in gibbl/s for the single block rocket engines")
+ .getInt(baseMaxPollutionPerSecondRocketFuelGenerator);
+ pollutionReleasedByTierRocketFuelGenerator = config.get(
+ "pollution",
+ "pollutionReleasedByTierRocketFuelGenerator",
+ pollutionReleasedByTierRocketFuelGenerator,
+ "coefficient applied to the base rate of the single block rocket engines based on its tier (first is tier 0 aka ULV)")
+ .getDoubleList();
+ basePollutionPerSecondGeothermalGenerator = config.get(
+ "pollution",
+ "basePollutionPerSecondGeothermalGenerator",
+ basePollutionPerSecondGeothermalGenerator,
+ "base pollution rate in gibbl/s for the geothermal engines")
+ .getInt(basePollutionPerSecondGeothermalGenerator);
+ pollutionReleasedByTierGeothermalGenerator = config.get(
+ "pollution",
+ "pollutionReleasedByTierGeothermalGenerator",
+ pollutionReleasedByTierGeothermalGenerator,
+ "coefficient applied to the base rate of the single block geothermal engines based on its tier (first is tier 0 aka ULV)")
+ .getDoubleList();
+ config.save();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java b/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java
index ad76bebe81..e3ed090b0c 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java
@@ -1,208 +1,191 @@
package gtPlusPlus.core.container;
+import gtPlusPlus.core.inventories.BaseInventoryBackpack;
+import gtPlusPlus.core.slots.SlotItemBackpackInv;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.inventories.BaseInventoryBackpack;
-import gtPlusPlus.core.slots.SlotItemBackpackInv;
-
-public class Container_BackpackBase extends Container
-{
- /** The Item Inventory for this Container, only needed if you want to reference isUseableByPlayer */
- public final BaseInventoryBackpack inventory;
-
- /** Using these will make transferStackInSlot easier to understand and implement
- * INV_START is the index of the first slot in the Player's Inventory, so our
- * BaseInventoryBackpack's number of slots (e.g. 5 slots is array indices 0-4, so start at 5)
- * Notice how we don't have to remember how many slots we made? We can just use
- * BaseInventoryBackpack.INV_SIZE and if we ever change it, the Container updates automatically. */
- private static final int INV_START = BaseInventoryBackpack.INV_SIZE, INV_END = INV_START+26,
- HOTBAR_START = INV_END+1, HOTBAR_END = HOTBAR_START+8;
-
- // If you're planning to add armor slots, put those first like this:
- // ARMOR_START = BaseInventoryBackpack.INV_SIZE, ARMOR_END = ARMOR_START+3,
- // INV_START = ARMOR_END+1, and then carry on like above.
-
- public Container_BackpackBase(final EntityPlayer par1Player, final InventoryPlayer inventoryPlayer, final BaseInventoryBackpack inventoryItem)
- {
- this.inventory = inventoryItem;
-
- int i;
-
- // ITEM INVENTORY - you'll need to adjust the slot locations to match your texture file
- // I have them set vertically in columns of 4 to the right of the player model
- for (i = 0; i < BaseInventoryBackpack.INV_SIZE; ++i)
- {
- // You can make a custom Slot if you need different behavior,
- // such as only certain item types can be put into this slot
- // We made a custom slot to prevent our inventory-storing item
- // from being stored within itself, but if you want to allow that and
- // you followed my advice at the end of the above step, then you
- // could get away with using the vanilla Slot class
- this.addSlotToContainer(new SlotItemBackpackInv(this.inventory, i, 80 + (18 * (i/4)), 8 + (18*(i%4))));
- }
-
- // If you want, you can add ARMOR SLOTS here as well, but you need to
- // make a public version of SlotArmor. I won't be doing that in this tutorial.
- /*
- for (i = 0; i < 4; ++i)
- {
- // These are the standard positions for survival inventory layout
- this.addSlotToContainer(new SlotArmor(this.player, inventoryPlayer, inventoryPlayer.getSizeInventory() - 1 - i, 8, 8 + i * 18, i));
- }
- */
-
- // PLAYER INVENTORY - uses default locations for standard inventory texture file
- for (i = 0; i < 3; ++i)
- {
- for (int j = 0; j < 9; ++j)
- {
- this.addSlotToContainer(new Slot(inventoryPlayer, j + (i * 9) + 9, 8 + (j * 18), 84 + (i * 18)));
- }
- }
-
- // PLAYER ACTION BAR - uses default locations for standard action bar texture file
- for (i = 0; i < 9; ++i)
- {
- this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + (i * 18), 142));
- }
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer entityplayer)
- {
- // be sure to return the inventory's isUseableByPlayer method
- // if you defined special behavior there:
- return this.inventory.isUseableByPlayer(entityplayer);
- }
-
- /**
- * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
- */
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int index)
- {
- ItemStack itemstack = null;
- final Slot slot = (Slot) this.inventorySlots.get(index);
-
- if ((slot != null) && slot.getHasStack())
- {
- final ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
-
- // If item is in our custom Inventory or armor slot
- if (index < INV_START)
- {
- // try to place in player inventory / action bar
- if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END+1, true))
- {
- return null;
- }
-
- slot.onSlotChange(itemstack1, itemstack);
- }
- // Item is in inventory / hotbar, try to place in custom inventory or armor slots
- else
- {
- /*
- If your inventory only stores certain instances of Items,
- you can implement shift-clicking to your inventory like this:
-
- // Check that the item is the right type
- if (itemstack1.getItem() instanceof ItemCustom)
- {
- // Try to merge into your custom inventory slots
- // We use 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in case
- // you also add armor or other custom slots
- if (!this.mergeItemStack(itemstack1, 0, BaseInventoryBackpack.INV_SIZE, false))
- {
- return null;
- }
- }
- // If you added armor slots, check them here as well:
- // Item being shift-clicked is armor - try to put in armor slot
- if (itemstack1.getItem() instanceof ItemArmor)
- {
- int type = ((ItemArmor) itemstack1.getItem()).armorType;
- if (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START + type + 1, false))
- {
- return null;
- }
- }
- Otherwise, you have basically 2 choices:
- 1. shift-clicking between player inventory and custom inventory
- 2. shift-clicking between action bar and inventory
-
- Be sure to choose only ONE of the following implementations!!!
- */
- /**
- * Implementation number 1: Shift-click into your custom inventory
- */
- if (index >= INV_START)
- {
- // place in custom inventory
- if (!this.mergeItemStack(itemstack1, 0, INV_START, false))
- {
- return null;
- }
- }
-
- /**
- * Implementation number 2: Shift-click items between action bar and inventory
- */
- // item is in player's inventory, but not in action bar
- if ((index >= INV_START) && (index < HOTBAR_START))
- {
- // place in action bar
- if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END+1, false))
- {
- return null;
- }
- }
- // item in action bar - place in player inventory
- else if ((index >= HOTBAR_START) && (index < (HOTBAR_END+1)))
- {
- if (!this.mergeItemStack(itemstack1, INV_START, INV_END+1, false))
- {
- return null;
- }
- }
- }
-
- if (itemstack1.stackSize == 0)
- {
- slot.putStack((ItemStack) null);
- }
- else
- {
- slot.onSlotChanged();
- }
-
- if (itemstack1.stackSize == itemstack.stackSize)
- {
- return null;
- }
-
- slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
- }
-
- return itemstack;
- }
-
- /**
- * You should override this method to prevent the player from moving the stack that
- * opened the inventory, otherwise if the player moves it, the inventory will not
- * be able to save properly
- */
- @Override
- public ItemStack slotClick(final int slot, final int button, final int flag, final EntityPlayer player) {
- // this will prevent the player from interacting with the item that opened the inventory:
- if ((slot >= 0) && (this.getSlot(slot) != null) && (this.getSlot(slot).getStack() == player.getHeldItem())) {
- return null;
- }
- return super.slotClick(slot, button, flag, player);
- }
+public class Container_BackpackBase extends Container {
+ /** The Item Inventory for this Container, only needed if you want to reference isUseableByPlayer */
+ public final BaseInventoryBackpack inventory;
+
+ /** Using these will make transferStackInSlot easier to understand and implement
+ * INV_START is the index of the first slot in the Player's Inventory, so our
+ * BaseInventoryBackpack's number of slots (e.g. 5 slots is array indices 0-4, so start at 5)
+ * Notice how we don't have to remember how many slots we made? We can just use
+ * BaseInventoryBackpack.INV_SIZE and if we ever change it, the Container updates automatically. */
+ private static final int INV_START = BaseInventoryBackpack.INV_SIZE,
+ INV_END = INV_START + 26,
+ HOTBAR_START = INV_END + 1,
+ HOTBAR_END = HOTBAR_START + 8;
+
+ // If you're planning to add armor slots, put those first like this:
+ // ARMOR_START = BaseInventoryBackpack.INV_SIZE, ARMOR_END = ARMOR_START+3,
+ // INV_START = ARMOR_END+1, and then carry on like above.
+
+ public Container_BackpackBase(
+ final EntityPlayer par1Player,
+ final InventoryPlayer inventoryPlayer,
+ final BaseInventoryBackpack inventoryItem) {
+ this.inventory = inventoryItem;
+
+ int i;
+
+ // ITEM INVENTORY - you'll need to adjust the slot locations to match your texture file
+ // I have them set vertically in columns of 4 to the right of the player model
+ for (i = 0; i < BaseInventoryBackpack.INV_SIZE; ++i) {
+ // You can make a custom Slot if you need different behavior,
+ // such as only certain item types can be put into this slot
+ // We made a custom slot to prevent our inventory-storing item
+ // from being stored within itself, but if you want to allow that and
+ // you followed my advice at the end of the above step, then you
+ // could get away with using the vanilla Slot class
+ this.addSlotToContainer(
+ new SlotItemBackpackInv(this.inventory, i, 80 + (18 * (i / 4)), 8 + (18 * (i % 4))));
+ }
+
+ // If you want, you can add ARMOR SLOTS here as well, but you need to
+ // make a public version of SlotArmor. I won't be doing that in this tutorial.
+ /*
+ for (i = 0; i < 4; ++i)
+ {
+ // These are the standard positions for survival inventory layout
+ this.addSlotToContainer(new SlotArmor(this.player, inventoryPlayer, inventoryPlayer.getSizeInventory() - 1 - i, 8, 8 + i * 18, i));
+ }
+ */
+
+ // PLAYER INVENTORY - uses default locations for standard inventory texture file
+ for (i = 0; i < 3; ++i) {
+ for (int j = 0; j < 9; ++j) {
+ this.addSlotToContainer(new Slot(inventoryPlayer, j + (i * 9) + 9, 8 + (j * 18), 84 + (i * 18)));
+ }
+ }
+
+ // PLAYER ACTION BAR - uses default locations for standard action bar texture file
+ for (i = 0; i < 9; ++i) {
+ this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + (i * 18), 142));
+ }
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer entityplayer) {
+ // be sure to return the inventory's isUseableByPlayer method
+ // if you defined special behavior there:
+ return this.inventory.isUseableByPlayer(entityplayer);
+ }
+
+ /**
+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
+ */
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int index) {
+ ItemStack itemstack = null;
+ final Slot slot = (Slot) this.inventorySlots.get(index);
+
+ if ((slot != null) && slot.getHasStack()) {
+ final ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+
+ // If item is in our custom Inventory or armor slot
+ if (index < INV_START) {
+ // try to place in player inventory / action bar
+ if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END + 1, true)) {
+ return null;
+ }
+
+ slot.onSlotChange(itemstack1, itemstack);
+ }
+ // Item is in inventory / hotbar, try to place in custom inventory or armor slots
+ else {
+ /*
+ If your inventory only stores certain instances of Items,
+ you can implement shift-clicking to your inventory like this:
+
+ // Check that the item is the right type
+ if (itemstack1.getItem() instanceof ItemCustom)
+ {
+ // Try to merge into your custom inventory slots
+ // We use 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in case
+ // you also add armor or other custom slots
+ if (!this.mergeItemStack(itemstack1, 0, BaseInventoryBackpack.INV_SIZE, false))
+ {
+ return null;
+ }
+ }
+ // If you added armor slots, check them here as well:
+ // Item being shift-clicked is armor - try to put in armor slot
+ if (itemstack1.getItem() instanceof ItemArmor)
+ {
+ int type = ((ItemArmor) itemstack1.getItem()).armorType;
+ if (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START + type + 1, false))
+ {
+ return null;
+ }
+ }
+ Otherwise, you have basically 2 choices:
+ 1. shift-clicking between player inventory and custom inventory
+ 2. shift-clicking between action bar and inventory
+
+ Be sure to choose only ONE of the following implementations!!!
+ */
+ /**
+ * Implementation number 1: Shift-click into your custom inventory
+ */
+ if (index >= INV_START) {
+ // place in custom inventory
+ if (!this.mergeItemStack(itemstack1, 0, INV_START, false)) {
+ return null;
+ }
+ }
+
+ /**
+ * Implementation number 2: Shift-click items between action bar and inventory
+ */
+ // item is in player's inventory, but not in action bar
+ if ((index >= INV_START) && (index < HOTBAR_START)) {
+ // place in action bar
+ if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END + 1, false)) {
+ return null;
+ }
+ }
+ // item in action bar - place in player inventory
+ else if ((index >= HOTBAR_START) && (index < (HOTBAR_END + 1))) {
+ if (!this.mergeItemStack(itemstack1, INV_START, INV_END + 1, false)) {
+ return null;
+ }
+ }
+ }
+
+ if (itemstack1.stackSize == 0) {
+ slot.putStack((ItemStack) null);
+ } else {
+ slot.onSlotChanged();
+ }
+
+ if (itemstack1.stackSize == itemstack.stackSize) {
+ return null;
+ }
+
+ slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
+ }
+
+ return itemstack;
+ }
+
+ /**
+ * You should override this method to prevent the player from moving the stack that
+ * opened the inventory, otherwise if the player moves it, the inventory will not
+ * be able to save properly
+ */
+ @Override
+ public ItemStack slotClick(final int slot, final int button, final int flag, final EntityPlayer player) {
+ // this will prevent the player from interacting with the item that opened the inventory:
+ if ((slot >= 0) && (this.getSlot(slot) != null) && (this.getSlot(slot).getStack() == player.getHeldItem())) {
+ return null;
+ }
+ return super.slotClick(slot, button, flag, player);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_CircuitProgrammer.java b/src/main/java/gtPlusPlus/core/container/Container_CircuitProgrammer.java
index d8ce521fb5..73f7eefe8d 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_CircuitProgrammer.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_CircuitProgrammer.java
@@ -1,190 +1,184 @@
package gtPlusPlus.core.container;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.inventories.InventoryCircuitProgrammer;
import gtPlusPlus.core.slots.SlotIntegratedCircuit;
import gtPlusPlus.core.slots.SlotNoInput;
import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
public class Container_CircuitProgrammer extends Container {
- protected TileEntityCircuitProgrammer tile_entity;
- public final InventoryCircuitProgrammer inventoryChest;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- public static final int SLOT_OUTPUT = 25;
-
- public static int StorageSlotNumber = 26; // Number of slots in storage area
- public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
- // and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
- // slots
-
- public Container_CircuitProgrammer(final InventoryPlayer inventory, final TileEntityCircuitProgrammer te) {
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
-
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
- Logger.INFO("1");
-
- int o = 0;
-
- // Storage Side
- /*for (var6 = 0; var6 < 3; var6++) {
- for (var7 = 0; var7 < 5; var7++) {
- this.addSlotToContainer(new SlotIntegratedCircuit(o, this.inventoryChest, o, 44 + (var7 * 18), 15 + (var6 * 18)));
- o++;
- }
- }*/
-
-
- int xStart = 8;
- int yStart = 5;
-
- try {
- //0
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart, yStart));
- //1-10
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+18));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+18));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+18));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+18));
- //11-20
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+18));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+18));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+36));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+36));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+36));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+36));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+36));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+36));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+54));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+54));
- //21-24
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+54));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+54));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+54));
- this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+54));
- Logger.INFO("2");
-
- //Add Output
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_OUTPUT, xStart+(8*18), yStart+54));
- o++;
- Logger.INFO("3");
-
-
-
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
-
-
- Logger.INFO("4");
- }
- catch (Throwable t) {}
-
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
- final EntityPlayer aPlayer) {
-
- if (!aPlayer.worldObj.isRemote) {
- if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
- // Utils.LOG_WARNING("??? - "+aSlotIndex);
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockCircuitProgrammer) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
- ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*
- * if (par2 == 0) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
- *
- * var4.onSlotChange(var5, var3); } else if (par2 >=
- * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
- * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
- * FullSlotNumber, false)) { return null; } } else if (par2 >=
- * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
- * (!this.mergeItemStack(var5, InOutputSlotNumber,
- * InventoryOutSlotNumber, false)) { return null; } } else if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
- * false)) { return null; }
- */
-
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
- } else {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-
-} \ No newline at end of file
+ protected TileEntityCircuitProgrammer tile_entity;
+ public final InventoryCircuitProgrammer inventoryChest;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ public static final int SLOT_OUTPUT = 25;
+
+ public static int StorageSlotNumber = 26; // Number of slots in storage area
+ public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
+ // and Hotbar)
+ public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
+ // slots
+
+ public Container_CircuitProgrammer(final InventoryPlayer inventory, final TileEntityCircuitProgrammer te) {
+ this.tile_entity = te;
+ this.inventoryChest = te.getInventory();
+
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+ Logger.INFO("1");
+
+ int o = 0;
+
+ // Storage Side
+ /*for (var6 = 0; var6 < 3; var6++) {
+ for (var7 = 0; var7 < 5; var7++) {
+ this.addSlotToContainer(new SlotIntegratedCircuit(o, this.inventoryChest, o, 44 + (var7 * 18), 15 + (var6 * 18)));
+ o++;
+ }
+ }*/
+
+ int xStart = 8;
+ int yStart = 5;
+
+ try {
+ // 0
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart, yStart));
+ // 1-10
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 18, yStart));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 36, yStart));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 54, yStart));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 72, yStart));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 90, yStart));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 108, yStart));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 18, yStart + 18));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 36, yStart + 18));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 54, yStart + 18));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 72, yStart + 18));
+ // 11-20
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 90, yStart + 18));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 108, yStart + 18));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 18, yStart + 36));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 36, yStart + 36));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 54, yStart + 36));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 72, yStart + 36));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 90, yStart + 36));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 108, yStart + 36));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 18, yStart + 54));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 36, yStart + 54));
+ // 21-24
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 54, yStart + 54));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 72, yStart + 54));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 90, yStart + 54));
+ this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart + 108, yStart + 54));
+ Logger.INFO("2");
+
+ // Add Output
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_OUTPUT, xStart + (8 * 18), yStart + 54));
+ o++;
+ Logger.INFO("3");
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(
+ new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+
+ Logger.INFO("4");
+ } catch (Throwable t) {
+ }
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
+ // Utils.LOG_WARNING("??? - "+aSlotIndex);
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
+ super.onContainerClosed(par1EntityPlayer);
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockCircuitProgrammer) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ ItemStack var3 = null;
+ final Slot var4 = (Slot) this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack()) {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ /*
+ * if (par2 == 0) { if (!this.mergeItemStack(var5,
+ * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
+ *
+ * var4.onSlotChange(var5, var3); } else if (par2 >=
+ * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
+ * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
+ * FullSlotNumber, false)) { return null; } } else if (par2 >=
+ * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber,
+ * InventoryOutSlotNumber, false)) { return null; } } else if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
+ * false)) { return null; }
+ */
+
+ if (var5.stackSize == 0) {
+ var4.putStack((ItemStack) null);
+ } else {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize) {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;
+ }
+
+ // Can merge Slot
+ @Override
+ public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
+ return super.func_94530_a(p_94530_1_, p_94530_2_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_DecayablesChest.java b/src/main/java/gtPlusPlus/core/container/Container_DecayablesChest.java
index 5bc384cd29..ac755d71aa 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_DecayablesChest.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_DecayablesChest.java
@@ -12,129 +12,127 @@ import net.minecraft.world.World;
public class Container_DecayablesChest extends Container {
- protected TileEntityDecayablesChest tile_entity;
- public final Inventory_DecayablesChest inventoryChest;
+ protected TileEntityDecayablesChest tile_entity;
+ public final Inventory_DecayablesChest inventoryChest;
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
- public static int StorageSlotNumber = 15; // Number of slots in storage area
- public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
- // and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
- // slots
+ public static int StorageSlotNumber = 15; // Number of slots in storage area
+ public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
+ // and Hotbar)
+ public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
+ // slots
- private final int[] slotStorage = new int[15];
+ private final int[] slotStorage = new int[15];
- public Container_DecayablesChest(final InventoryPlayer inventory, final TileEntityDecayablesChest te) {
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
+ public Container_DecayablesChest(final InventoryPlayer inventory, final TileEntityDecayablesChest te) {
+ this.tile_entity = te;
+ this.inventoryChest = te.getInventory();
te.openInventory();
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
-
- int o = 0;
-
- // Storage Side
- for (var6 = 0; var6 < 3; var6++) {
- for (var7 = 0; var7 < 5; var7++) {
- this.slotStorage[o] = o;
- this.addSlotToContainer(new Slot(this.inventoryChest, o++, 44 + (var7 * 18), 15 + (var6 * 18)));
- }
- }
-
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
-
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
- final EntityPlayer aPlayer) {
-
- if (!aPlayer.worldObj.isRemote) {
- if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
- // Utils.LOG_WARNING("??? - "+aSlotIndex);
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- tile_entity.closeInventory();
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockDecayablesChest) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
- ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*
- * if (par2 == 0) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
- *
- * var4.onSlotChange(var5, var3); } else if (par2 >=
- * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
- * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
- * FullSlotNumber, false)) { return null; } } else if (par2 >=
- * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
- * (!this.mergeItemStack(var5, InOutputSlotNumber,
- * InventoryOutSlotNumber, false)) { return null; } } else if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
- * false)) { return null; }
- */
-
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
- } else {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-
-} \ No newline at end of file
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+
+ int o = 0;
+
+ // Storage Side
+ for (var6 = 0; var6 < 3; var6++) {
+ for (var7 = 0; var7 < 5; var7++) {
+ this.slotStorage[o] = o;
+ this.addSlotToContainer(new Slot(this.inventoryChest, o++, 44 + (var7 * 18), 15 + (var6 * 18)));
+ }
+ }
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
+ // Utils.LOG_WARNING("??? - "+aSlotIndex);
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
+ super.onContainerClosed(par1EntityPlayer);
+ tile_entity.closeInventory();
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockDecayablesChest) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ ItemStack var3 = null;
+ final Slot var4 = (Slot) this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack()) {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ /*
+ * if (par2 == 0) { if (!this.mergeItemStack(var5,
+ * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
+ *
+ * var4.onSlotChange(var5, var3); } else if (par2 >=
+ * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
+ * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
+ * FullSlotNumber, false)) { return null; } } else if (par2 >=
+ * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber,
+ * InventoryOutSlotNumber, false)) { return null; } } else if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
+ * false)) { return null; }
+ */
+
+ if (var5.stackSize == 0) {
+ var4.putStack((ItemStack) null);
+ } else {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize) {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;
+ }
+
+ // Can merge Slot
+ @Override
+ public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
+ return super.func_94530_a(p_94530_1_, p_94530_2_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_EggBox.java b/src/main/java/gtPlusPlus/core/container/Container_EggBox.java
index c4396cca6f..26815d2b7b 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_EggBox.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_EggBox.java
@@ -12,129 +12,127 @@ import net.minecraft.world.World;
public class Container_EggBox extends Container {
- protected TileEntityEggBox tile_entity;
- public final Inventory_EggBox inventoryChest;
+ protected TileEntityEggBox tile_entity;
+ public final Inventory_EggBox inventoryChest;
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
- public static int StorageSlotNumber = 15; // Number of slots in storage area
- public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
- // and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
- // slots
+ public static int StorageSlotNumber = 15; // Number of slots in storage area
+ public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
+ // and Hotbar)
+ public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
+ // slots
- private final int[] slotStorage = new int[15];
+ private final int[] slotStorage = new int[15];
- public Container_EggBox(final InventoryPlayer inventory, final TileEntityEggBox te) {
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
+ public Container_EggBox(final InventoryPlayer inventory, final TileEntityEggBox te) {
+ this.tile_entity = te;
+ this.inventoryChest = te.getInventory();
te.openInventory();
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
-
- int o = 0;
-
- // Storage Side
- for (var6 = 0; var6 < 3; var6++) {
- for (var7 = 0; var7 < 5; var7++) {
- this.slotStorage[o] = o;
- this.addSlotToContainer(new Slot(this.inventoryChest, o++, 44 + (var7 * 18), 15 + (var6 * 18)));
- }
- }
-
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
-
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
- final EntityPlayer aPlayer) {
-
- if (!aPlayer.worldObj.isRemote) {
- if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
- // Utils.LOG_WARNING("??? - "+aSlotIndex);
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- tile_entity.closeInventory();
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockEggBox) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
- ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*
- * if (par2 == 0) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
- *
- * var4.onSlotChange(var5, var3); } else if (par2 >=
- * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
- * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
- * FullSlotNumber, false)) { return null; } } else if (par2 >=
- * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
- * (!this.mergeItemStack(var5, InOutputSlotNumber,
- * InventoryOutSlotNumber, false)) { return null; } } else if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
- * false)) { return null; }
- */
-
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
- } else {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-
-} \ No newline at end of file
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+
+ int o = 0;
+
+ // Storage Side
+ for (var6 = 0; var6 < 3; var6++) {
+ for (var7 = 0; var7 < 5; var7++) {
+ this.slotStorage[o] = o;
+ this.addSlotToContainer(new Slot(this.inventoryChest, o++, 44 + (var7 * 18), 15 + (var6 * 18)));
+ }
+ }
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
+ // Utils.LOG_WARNING("??? - "+aSlotIndex);
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
+ super.onContainerClosed(par1EntityPlayer);
+ tile_entity.closeInventory();
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockEggBox) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ ItemStack var3 = null;
+ final Slot var4 = (Slot) this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack()) {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ /*
+ * if (par2 == 0) { if (!this.mergeItemStack(var5,
+ * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
+ *
+ * var4.onSlotChange(var5, var3); } else if (par2 >=
+ * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
+ * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
+ * FullSlotNumber, false)) { return null; } } else if (par2 >=
+ * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber,
+ * InventoryOutSlotNumber, false)) { return null; } } else if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
+ * false)) { return null; }
+ */
+
+ if (var5.stackSize == 0) {
+ var4.putStack((ItemStack) null);
+ } else {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize) {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;
+ }
+
+ // Can merge Slot
+ @Override
+ public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
+ return super.func_94530_a(p_94530_1_, p_94530_2_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_FishTrap.java b/src/main/java/gtPlusPlus/core/container/Container_FishTrap.java
index a2f44441d9..44079d21e5 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_FishTrap.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_FishTrap.java
@@ -1,5 +1,9 @@
package gtPlusPlus.core.container;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.inventories.InventoryFishTrap;
+import gtPlusPlus.core.slots.SlotNoInput;
+import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -7,136 +11,129 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.inventories.InventoryFishTrap;
-import gtPlusPlus.core.slots.SlotNoInput;
-import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
-
public class Container_FishTrap extends Container {
- protected TileEntityFishTrap tile_entity;
- public final InventoryFishTrap inventoryChest;
+ protected TileEntityFishTrap tile_entity;
+ public final InventoryFishTrap inventoryChest;
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
- public static int StorageSlotNumber = 15; // Number of slots in storage area
- public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
- // and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
- // slots
+ public static int StorageSlotNumber = 15; // Number of slots in storage area
+ public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
+ // and Hotbar)
+ public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
+ // slots
- private final int[] slotStorage = new int[15];
+ private final int[] slotStorage = new int[15];
- public Container_FishTrap(final InventoryPlayer inventory, final TileEntityFishTrap te) {
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
+ public Container_FishTrap(final InventoryPlayer inventory, final TileEntityFishTrap te) {
+ this.tile_entity = te;
+ this.inventoryChest = te.getInventory();
te.openInventory();
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
-
- int o = 0;
-
- // Storage Side
- for (var6 = 0; var6 < 3; var6++) {
- for (var7 = 0; var7 < 5; var7++) {
- this.slotStorage[o] = o;
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, 44 + (var7 * 18), 15 + (var6 * 18)));
- }
- }
-
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
-
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
- final EntityPlayer aPlayer) {
-
- if (!aPlayer.worldObj.isRemote) {
- if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
- // Utils.LOG_WARNING("??? - "+aSlotIndex);
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- tile_entity.closeInventory();
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockFishTrap) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
- ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*
- * if (par2 == 0) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
- *
- * var4.onSlotChange(var5, var3); } else if (par2 >=
- * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
- * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
- * FullSlotNumber, false)) { return null; } } else if (par2 >=
- * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
- * (!this.mergeItemStack(var5, InOutputSlotNumber,
- * InventoryOutSlotNumber, false)) { return null; } } else if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
- * false)) { return null; }
- */
-
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
- } else {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-
-} \ No newline at end of file
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+
+ int o = 0;
+
+ // Storage Side
+ for (var6 = 0; var6 < 3; var6++) {
+ for (var7 = 0; var7 < 5; var7++) {
+ this.slotStorage[o] = o;
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, 44 + (var7 * 18), 15 + (var6 * 18)));
+ }
+ }
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
+ // Utils.LOG_WARNING("??? - "+aSlotIndex);
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
+ super.onContainerClosed(par1EntityPlayer);
+ tile_entity.closeInventory();
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockFishTrap) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ ItemStack var3 = null;
+ final Slot var4 = (Slot) this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack()) {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ /*
+ * if (par2 == 0) { if (!this.mergeItemStack(var5,
+ * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
+ *
+ * var4.onSlotChange(var5, var3); } else if (par2 >=
+ * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
+ * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
+ * FullSlotNumber, false)) { return null; } } else if (par2 >=
+ * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber,
+ * InventoryOutSlotNumber, false)) { return null; } } else if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
+ * false)) { return null; }
+ */
+
+ if (var5.stackSize == 0) {
+ var4.putStack((ItemStack) null);
+ } else {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize) {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;
+ }
+
+ // Can merge Slot
+ @Override
+ public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
+ return super.func_94530_a(p_94530_1_, p_94530_2_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_Grindle.java b/src/main/java/gtPlusPlus/core/container/Container_Grindle.java
index 4ab79322c9..f0580abb24 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_Grindle.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_Grindle.java
@@ -1,160 +1,165 @@
package gtPlusPlus.core.container;
+import gtPlusPlus.core.inventories.BaseInventoryGrindle;
+import gtPlusPlus.core.slots.SlotDataStick;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.inventories.BaseInventoryGrindle;
-import gtPlusPlus.core.slots.SlotDataStick;
-
public class Container_Grindle extends Container {
- /**
- * The Item Inventory for this Container, only needed if you want to reference
- * isUseableByPlayer
- */
- public final BaseInventoryGrindle inventory;
-
- /**
- * Using these will make transferStackInSlot easier to understand and implement
- * INV_START is the index of the first slot in the Player's Inventory, so our
- * BaseInventoryBackpack's number of slots (e.g. 5 slots is array indices 0-4,
- * so start at 5) Notice how we don't have to remember how many slots we made?
- * We can just use BaseInventoryBackpack.INV_SIZE and if we ever change it, the
- * Container updates automatically.
- */
- private static final int
- INV_START = BaseInventoryGrindle.INV_SIZE,
- INV_END = INV_START + 0,
- HOTBAR_START = INV_END,
- HOTBAR_END = HOTBAR_START + 8;
-
- public Container_Grindle(final EntityPlayer par1Player, final InventoryPlayer inventoryPlayer,
- final BaseInventoryGrindle inventoryItem) {
- this.inventory = inventoryItem;
-
- int i;
-
- // Actual Scan Slot
- this.addSlotToContainer(new SlotDataStick(this.inventory, 0, 152, 5));
-
- for (i = 1; i < BaseInventoryGrindle.INV_SIZE; ++i) {
- this.addSlotToContainer(new SlotDataStick(this.inventory, i, 153, 30 + (18 * i)));
- }
-
- // PLAYER ACTION BAR - uses default locations for standard action bar texture
- // file
- for (i = 0; i < 9; ++i) {
- this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + (i * 18), 142));
- }
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer entityplayer) {
- return this.inventory.isUseableByPlayer(entityplayer);
- }
-
- /**
- * Called when a player shift-clicks on a slot. You must override this or you
- * will crash when someone does that.
- */
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int index) {
- ItemStack itemstack = null;
- final Slot slot = (Slot) this.inventorySlots.get(index);
-
- if ((slot != null) && slot.getHasStack()) {
- final ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
-
- // If item is in our custom Inventory or armor slot
- if (index < INV_START) {
- // try to place in player inventory / action bar
- if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END + 1, true)) {
- return null;
- }
-
- slot.onSlotChange(itemstack1, itemstack);
- }
- // Item is in inventory / hotbar, try to place in custom inventory or armor
- // slots
- else {/*
-
- * If your inventory only stores certain instances of Items, you can implement
- * shift-clicking to your inventory like this:
- *
- * // Check that the item is the right type if (itemstack1.getItem() instanceof
- * ItemCustom) { // Try to merge into your custom inventory slots // We use
- * 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in case // you
- * also add armor or other custom slots if (!this.mergeItemStack(itemstack1, 0,
- * BaseInventoryBackpack.INV_SIZE, false)) { return null; } } // If you added
- * armor slots, check them here as well: // Item being shift-clicked is armor -
- * try to put in armor slot if (itemstack1.getItem() instanceof ItemArmor) { int
- * type = ((ItemArmor) itemstack1.getItem()).armorType; if
- * (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START + type + 1,
- * false)) { return null; } } Otherwise, you have basically 2 choices: 1.
- * shift-clicking between player inventory and custom inventory 2.
- * shift-clicking between action bar and inventory
- *
- * Be sure to choose only ONE of the following implementations!!!
-
- *//**
- * Implementation number 1: Shift-click into your custom inventory
- *//*
- if (index >= INV_START) {
- // place in custom inventory
- if (!this.mergeItemStack(itemstack1, 0, INV_START, false)) {
- return null;
- }
- }
-
- *//**
- * Implementation number 2: Shift-click items between action bar and inventory
- *//*
- // item is in player's inventory, but not in action bar
- if ((index >= INV_START) && (index < HOTBAR_START)) {
- // place in action bar
- if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END + 1, false)) {
- return null;
- }
- }
- // item in action bar - place in player inventory
- else if ((index >= HOTBAR_START) && (index < (HOTBAR_END + 1))) {
- if (!this.mergeItemStack(itemstack1, INV_START, INV_END + 1, false)) {
- return null;
- }
- }
- */}
-
- if (itemstack1.stackSize == 0) {
- slot.putStack((ItemStack) null);
- } else {
- slot.onSlotChanged();
- }
-
- if (itemstack1.stackSize == itemstack.stackSize) {
- return null;
- }
-
- slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
- }
-
- return itemstack;
- }
-
- /**
- * You should override this method to prevent the player from moving the stack
- * that opened the inventory, otherwise if the player moves it, the inventory
- * will not be able to save properly
- */
- @Override
- public ItemStack slotClick(final int slot, final int button, final int flag, final EntityPlayer player) {
- // this will prevent the player from interacting with the item that opened the
- // inventory:
- if ((slot >= 0) && (this.getSlot(slot) != null) && (this.getSlot(slot).getStack() == player.getHeldItem())) {
- return null;
- }
- return super.slotClick(slot, button, flag, player);
- }
+ /**
+ * The Item Inventory for this Container, only needed if you want to reference
+ * isUseableByPlayer
+ */
+ public final BaseInventoryGrindle inventory;
+
+ /**
+ * Using these will make transferStackInSlot easier to understand and implement
+ * INV_START is the index of the first slot in the Player's Inventory, so our
+ * BaseInventoryBackpack's number of slots (e.g. 5 slots is array indices 0-4,
+ * so start at 5) Notice how we don't have to remember how many slots we made?
+ * We can just use BaseInventoryBackpack.INV_SIZE and if we ever change it, the
+ * Container updates automatically.
+ */
+ private static final int INV_START = BaseInventoryGrindle.INV_SIZE,
+ INV_END = INV_START + 0,
+ HOTBAR_START = INV_END,
+ HOTBAR_END = HOTBAR_START + 8;
+
+ public Container_Grindle(
+ final EntityPlayer par1Player,
+ final InventoryPlayer inventoryPlayer,
+ final BaseInventoryGrindle inventoryItem) {
+ this.inventory = inventoryItem;
+
+ int i;
+
+ // Actual Scan Slot
+ this.addSlotToContainer(new SlotDataStick(this.inventory, 0, 152, 5));
+
+ for (i = 1; i < BaseInventoryGrindle.INV_SIZE; ++i) {
+ this.addSlotToContainer(new SlotDataStick(this.inventory, i, 153, 30 + (18 * i)));
+ }
+
+ // PLAYER ACTION BAR - uses default locations for standard action bar texture
+ // file
+ for (i = 0; i < 9; ++i) {
+ this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + (i * 18), 142));
+ }
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer entityplayer) {
+ return this.inventory.isUseableByPlayer(entityplayer);
+ }
+
+ /**
+ * Called when a player shift-clicks on a slot. You must override this or you
+ * will crash when someone does that.
+ */
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int index) {
+ ItemStack itemstack = null;
+ final Slot slot = (Slot) this.inventorySlots.get(index);
+
+ if ((slot != null) && slot.getHasStack()) {
+ final ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+
+ // If item is in our custom Inventory or armor slot
+ if (index < INV_START) {
+ // try to place in player inventory / action bar
+ if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END + 1, true)) {
+ return null;
+ }
+
+ slot.onSlotChange(itemstack1, itemstack);
+ }
+ // Item is in inventory / hotbar, try to place in custom inventory or armor
+ // slots
+ else {
+ /*
+
+ * If your inventory only stores certain instances of Items, you can implement
+ * shift-clicking to your inventory like this:
+ *
+ * // Check that the item is the right type if (itemstack1.getItem() instanceof
+ * ItemCustom) { // Try to merge into your custom inventory slots // We use
+ * 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in case // you
+ * also add armor or other custom slots if (!this.mergeItemStack(itemstack1, 0,
+ * BaseInventoryBackpack.INV_SIZE, false)) { return null; } } // If you added
+ * armor slots, check them here as well: // Item being shift-clicked is armor -
+ * try to put in armor slot if (itemstack1.getItem() instanceof ItemArmor) { int
+ * type = ((ItemArmor) itemstack1.getItem()).armorType; if
+ * (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START + type + 1,
+ * false)) { return null; } } Otherwise, you have basically 2 choices: 1.
+ * shift-clicking between player inventory and custom inventory 2.
+ * shift-clicking between action bar and inventory
+ *
+ * Be sure to choose only ONE of the following implementations!!!
+
+ */
+ /**
+ * Implementation number 1: Shift-click into your custom inventory
+ */
+ /*
+ if (index >= INV_START) {
+ // place in custom inventory
+ if (!this.mergeItemStack(itemstack1, 0, INV_START, false)) {
+ return null;
+ }
+ }
+
+ */
+ /**
+ * Implementation number 2: Shift-click items between action bar and inventory
+ */
+ /*
+ // item is in player's inventory, but not in action bar
+ if ((index >= INV_START) && (index < HOTBAR_START)) {
+ // place in action bar
+ if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END + 1, false)) {
+ return null;
+ }
+ }
+ // item in action bar - place in player inventory
+ else if ((index >= HOTBAR_START) && (index < (HOTBAR_END + 1))) {
+ if (!this.mergeItemStack(itemstack1, INV_START, INV_END + 1, false)) {
+ return null;
+ }
+ }
+ */ }
+
+ if (itemstack1.stackSize == 0) {
+ slot.putStack((ItemStack) null);
+ } else {
+ slot.onSlotChanged();
+ }
+
+ if (itemstack1.stackSize == itemstack.stackSize) {
+ return null;
+ }
+
+ slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
+ }
+
+ return itemstack;
+ }
+
+ /**
+ * You should override this method to prevent the player from moving the stack
+ * that opened the inventory, otherwise if the player moves it, the inventory
+ * will not be able to save properly
+ */
+ @Override
+ public ItemStack slotClick(final int slot, final int button, final int flag, final EntityPlayer player) {
+ // this will prevent the player from interacting with the item that opened the
+ // inventory:
+ if ((slot >= 0) && (this.getSlot(slot) != null) && (this.getSlot(slot).getStack() == player.getHeldItem())) {
+ return null;
+ }
+ return super.slotClick(slot, button, flag, player);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java b/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java
index 39e07f2f0e..3bda62a403 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java
@@ -1,193 +1,170 @@
package gtPlusPlus.core.container;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.inventories.InventoryHeliumGenerator;
import gtPlusPlus.core.slots.SlotFuelRod;
import gtPlusPlus.core.slots.SlotNoInput;
import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
public class Container_HeliumGenerator extends Container {
- protected TileEntityHeliumGenerator tile_entity;
- public final InventoryHeliumGenerator inventoryChest;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
-
- public static int StorageSlotNumber = 19; //Number of slots in storage area
- public static int InventorySlotNumber = 36; //Inventory Slots (Inventory and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; //All slots
-
- //0 Is output, 1-18 are input.
- private final int[] slotStorage = new int[19];
-
- public Container_HeliumGenerator(final InventoryPlayer inventory, final TileEntityHeliumGenerator te){
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
-
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
-
- int o=0;
-
- //Output
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, 0, 80, 53));
- this.slotStorage[o] = o;
- o++;
-
- //Side A
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 3; ++var7)
- {
- Logger.INFO("Adding slots at var:"+(o)+" x:"+(8 + var7 * 18)+" y:"+(9 + var6 * 18));
- this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 8 + (var7 * 18), 18 + (var6 * 18)));
- this.slotStorage[o] = o;
- o++;
- }
- }
-
- //Side B
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 3; ++var7)
- {
- Logger.INFO("Adding slots at var:"+(o)+" x:"+(90+8+(var7 * 18))+" y:"+(9 + var6 * 18));
- this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 116 + (var7 * 18), 18 + (var6 * 18)));
- this.slotStorage[o] = o;
- o++;
- }
- }
-
- o=0;
-
- //Player Inventory
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 9; ++var7)
- {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
-
- //Player Hotbar
- for (var6 = 0; var6 < 9; ++var6)
- {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer){
-
- if (!aPlayer.worldObj.isRemote){
- if ((aSlotIndex == 999) || (aSlotIndex == -999)){
- //Utils.LOG_WARNING("??? - "+aSlotIndex);
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
-
-
-
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer){
- super.onContainerClosed(par1EntityPlayer);
- }
-
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer){
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockHeliumGenerator){
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2)
- {
- ItemStack var3 = null;
- final Slot var4 = (Slot)this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack())
- {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*if (par2 == 0)
- {
- if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
- {
- return null;
- }
-
- var4.onSlotChange(var5, var3);
- }
- else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber)
- {
- if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
- {
- return null;
- }
- }
- else if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber)
- {
- if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
- {
- return null;
- }
- }
- else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
- {
- return null;
- }*/
-
- if (var5.stackSize == 0)
- {
- var4.putStack((ItemStack)null);
- }
- else
- {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize)
- {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- //Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-
-
-} \ No newline at end of file
+ protected TileEntityHeliumGenerator tile_entity;
+ public final InventoryHeliumGenerator inventoryChest;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ public static int StorageSlotNumber = 19; // Number of slots in storage area
+ public static int InventorySlotNumber = 36; // Inventory Slots (Inventory and Hotbar)
+ public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All slots
+
+ // 0 Is output, 1-18 are input.
+ private final int[] slotStorage = new int[19];
+
+ public Container_HeliumGenerator(final InventoryPlayer inventory, final TileEntityHeliumGenerator te) {
+ this.tile_entity = te;
+ this.inventoryChest = te.getInventory();
+
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+
+ int o = 0;
+
+ // Output
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, 0, 80, 53));
+ this.slotStorage[o] = o;
+ o++;
+
+ // Side A
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 3; ++var7) {
+ Logger.INFO("Adding slots at var:" + (o) + " x:" + (8 + var7 * 18) + " y:" + (9 + var6 * 18));
+ this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 8 + (var7 * 18), 18 + (var6 * 18)));
+ this.slotStorage[o] = o;
+ o++;
+ }
+ }
+
+ // Side B
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 3; ++var7) {
+ Logger.INFO("Adding slots at var:" + (o) + " x:" + (90 + 8 + (var7 * 18)) + " y:" + (9 + var6 * 18));
+ this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 116 + (var7 * 18), 18 + (var6 * 18)));
+ this.slotStorage[o] = o;
+ o++;
+ }
+ }
+
+ o = 0;
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
+ // Utils.LOG_WARNING("??? - "+aSlotIndex);
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
+ super.onContainerClosed(par1EntityPlayer);
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockHeliumGenerator) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ ItemStack var3 = null;
+ final Slot var4 = (Slot) this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack()) {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ /*if (par2 == 0)
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
+ {
+ return null;
+ }
+
+ var4.onSlotChange(var5, var3);
+ }
+ else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber)
+ {
+ if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
+ {
+ return null;
+ }
+ }
+ else if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber)
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
+ {
+ return null;
+ }
+ }
+ else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
+ {
+ return null;
+ }*/
+
+ if (var5.stackSize == 0) {
+ var4.putStack((ItemStack) null);
+ } else {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize) {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;
+ }
+
+ // Can merge Slot
+ @Override
+ public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
+ return super.func_94530_a(p_94530_1_, p_94530_2_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java b/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java
index e0fb51fe61..602de2447b 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java
@@ -1,12 +1,5 @@
package gtPlusPlus.core.container;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.inventories.modulartable.InventoryModularMain;
@@ -15,238 +8,234 @@ import gtPlusPlus.core.slots.SlotModularBauble;
import gtPlusPlus.core.slots.SlotModularBaubleUpgrades;
import gtPlusPlus.core.slots.SlotNoInput;
import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
public class Container_ModularityTable extends Container {
- /** The crafting matrix inventory (3x3). */
-
- protected TileEntityModularityTable tile_entity;
- public final InventoryModularMain inventoryGrid;
- public final InventoryModularOutput inventoryOutputs;
- public int mRecipeTime;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- private final int[] slotOutputs = new int[3];
- private final int[] slotGrid = new int[9];
-
-
- public Container_ModularityTable(final InventoryPlayer inventory, final TileEntityModularityTable tile){
- this.tile_entity = tile;
- this.inventoryGrid = tile.inventoryGrid;
- this.inventoryOutputs = tile.inventoryOutputs;
- this.tile_entity.setContainer(this);
- this.mRecipeTime = this.tile_entity.getRecipeTime();
- Logger.INFO("Container: "+this.mRecipeTime);
-
- int var6;
- int var7;
- this.worldObj = tile.getWorldObj();
- this.posX = tile.xCoord;
- this.posY = tile.yCoord;
- this.posZ = tile.zCoord;
-
- int nextFreeSlot = 0;
-
-
- //Output slots
- this.addSlotToContainer(new SlotModularBauble(this.inventoryOutputs, 0, 26+(18*6), 8));
- this.addSlotToContainer(new SlotModularBaubleUpgrades(this.inventoryOutputs, 1, 26+(18*5), 8));
- this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 2, 26+(18*6), 44));
-
- int o = 0;
-
- //Storage Side
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 3; ++var7)
- {
- //Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18));
- this.addSlotToContainer(new SlotModularBaubleUpgrades(this.inventoryGrid, nextFreeSlot, 8+18 + (var7 * 18), 17 + (var6 * 18)));
- this.slotGrid[o] = nextFreeSlot;
- nextFreeSlot++;
- o++;
- }
- }
-
- //Player Inventory
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 9; ++var7)
- {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
-
- //Player Hotbar
- for (var6 = 0; var6 < 9; ++var6)
- {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
- //this.onCraftMatrixChanged(this.craftMatrix);
-
- }
-
- /**
- * Callback for when the crafting matrix is changed.
- */
- /* public void onCraftMatrixChanged(IInventory p_75130_1_)
+ /** The crafting matrix inventory (3x3). */
+ protected TileEntityModularityTable tile_entity;
+
+ public final InventoryModularMain inventoryGrid;
+ public final InventoryModularOutput inventoryOutputs;
+ public int mRecipeTime;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ private final int[] slotOutputs = new int[3];
+ private final int[] slotGrid = new int[9];
+
+ public Container_ModularityTable(final InventoryPlayer inventory, final TileEntityModularityTable tile) {
+ this.tile_entity = tile;
+ this.inventoryGrid = tile.inventoryGrid;
+ this.inventoryOutputs = tile.inventoryOutputs;
+ this.tile_entity.setContainer(this);
+ this.mRecipeTime = this.tile_entity.getRecipeTime();
+ Logger.INFO("Container: " + this.mRecipeTime);
+
+ int var6;
+ int var7;
+ this.worldObj = tile.getWorldObj();
+ this.posX = tile.xCoord;
+ this.posY = tile.yCoord;
+ this.posZ = tile.zCoord;
+
+ int nextFreeSlot = 0;
+
+ // Output slots
+ this.addSlotToContainer(new SlotModularBauble(this.inventoryOutputs, 0, 26 + (18 * 6), 8));
+ this.addSlotToContainer(new SlotModularBaubleUpgrades(this.inventoryOutputs, 1, 26 + (18 * 5), 8));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 2, 26 + (18 * 6), 44));
+
+ int o = 0;
+
+ // Storage Side
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 3; ++var7) {
+ // Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 *
+ // 18));
+ this.addSlotToContainer(new SlotModularBaubleUpgrades(
+ this.inventoryGrid, nextFreeSlot, 8 + 18 + (var7 * 18), 17 + (var6 * 18)));
+ this.slotGrid[o] = nextFreeSlot;
+ nextFreeSlot++;
+ o++;
+ }
+ }
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+
+ // this.onCraftMatrixChanged(this.craftMatrix);
+
+ }
+
+ /**
+ * Callback for when the crafting matrix is changed.
+ */
+ /* public void onCraftMatrixChanged(IInventory p_75130_1_)
{
this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
}*/
- /**
- * Called when the container is closed.
- */
- @Override
- public void onContainerClosed(EntityPlayer p_75134_1_){
- super.onContainerClosed(p_75134_1_);
- if (!this.worldObj.isRemote){
- /* for (int i = 0; i < 9; ++i){
+ /**
+ * Called when the container is closed.
+ */
+ @Override
+ public void onContainerClosed(EntityPlayer p_75134_1_) {
+ super.onContainerClosed(p_75134_1_);
+ if (!this.worldObj.isRemote) {
+ /* for (int i = 0; i < 9; ++i){
ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);
if (itemstack != null){
p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false);
}
}*/
- }
- }
-
- public TileEntityModularityTable getTileentityViaContainer(){
- if (this.tile_entity != null){
- return this.tile_entity;
- }
- return null;
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer){
-
- if (!aPlayer.worldObj.isRemote){
- if ((aSlotIndex == 999) || (aSlotIndex == -999)){
- //Utils.LOG_WARNING("??? - "+aSlotIndex);
- }
-
- if (aSlotIndex == 0){
- Logger.INFO("Player Clicked on the bauble slot");
- //TODO
- }
- else if (aSlotIndex == 1){
- Logger.INFO("Player Clicked on the upgrade slot");
- //TODO
- }
- else if (aSlotIndex == 2){
- Logger.INFO("Player Clicked on the output slot");
- //TODO
- }
- else {
- for (final int x : this.slotGrid){
- if (aSlotIndex == x){
- Logger.INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid");
- }
- }
- }
- }
- //Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer){
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockModularTable){
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2)
- {
-
- return null;
-
- /*ItemStack var3 = null;
- final Slot var4 = (Slot)this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack())
- {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- if (par2 == 0)
- {
- if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
- {
- return null;
- }
-
- var4.onSlotChange(var5, var3);
- }
- else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber))
- {
- if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
- {
- return null;
- }
- }
- else if ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber))
- {
- if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
- {
- return null;
- }
- }
- else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
- {
- return null;
- }
-
- if (var5.stackSize == 0)
- {
- var4.putStack((ItemStack)null);
- }
- else
- {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize)
- {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;*/
- }
-
- //Can merge Slot
- /*public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_){
+ }
+ }
+
+ public TileEntityModularityTable getTileentityViaContainer() {
+ if (this.tile_entity != null) {
+ return this.tile_entity;
+ }
+ return null;
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
+ // Utils.LOG_WARNING("??? - "+aSlotIndex);
+ }
+
+ if (aSlotIndex == 0) {
+ Logger.INFO("Player Clicked on the bauble slot");
+ // TODO
+ } else if (aSlotIndex == 1) {
+ Logger.INFO("Player Clicked on the upgrade slot");
+ // TODO
+ } else if (aSlotIndex == 2) {
+ Logger.INFO("Player Clicked on the output slot");
+ // TODO
+ } else {
+ for (final int x : this.slotGrid) {
+ if (aSlotIndex == x) {
+ Logger.INFO("Player Clicked slot " + aSlotIndex + " in the crafting Grid");
+ }
+ }
+ }
+ }
+ // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockModularTable) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+
+ return null;
+
+ /*ItemStack var3 = null;
+ final Slot var4 = (Slot)this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack())
+ {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ if (par2 == 0)
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
+ {
+ return null;
+ }
+
+ var4.onSlotChange(var5, var3);
+ }
+ else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber))
+ {
+ if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
+ {
+ return null;
+ }
+ }
+ else if ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber))
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
+ {
+ return null;
+ }
+ }
+ else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
+ {
+ return null;
+ }
+
+ if (var5.stackSize == 0)
+ {
+ var4.putStack((ItemStack)null);
+ }
+ else
+ {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize)
+ {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;*/
+ }
+
+ // Can merge Slot
+ /*public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_){
return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_);
}*/
- /*public ItemStack getOutputContent(){
- ItemStack output = this.craftResult.getStackInSlot(0);
- if (output != null){
- return output;
- }
- return null;
- }
-
- public ItemStack[] getInputComponents(){
- ItemStack inputs[] = new ItemStack[9];
- for (int r=0;r<this.craftMatrix.getSizeInventory();r++){
- ItemStack temp = this.craftMatrix.getStackInSlot(r);
- inputs[r] = temp;
- }
- return inputs;
- }*/
-
-
-} \ No newline at end of file
+ /*public ItemStack getOutputContent(){
+ ItemStack output = this.craftResult.getStackInSlot(0);
+ if (output != null){
+ return output;
+ }
+ return null;
+ }
+
+ public ItemStack[] getInputComponents(){
+ ItemStack inputs[] = new ItemStack[9];
+ for (int r=0;r<this.craftMatrix.getSizeInventory();r++){
+ ItemStack temp = this.craftMatrix.getStackInSlot(r);
+ inputs[r] = temp;
+ }
+ return inputs;
+ }*/
+
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_PestKiller.java b/src/main/java/gtPlusPlus/core/container/Container_PestKiller.java
index 2f25c5aace..d33d30f731 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_PestKiller.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_PestKiller.java
@@ -1,7 +1,6 @@
package gtPlusPlus.core.container;
import gregtech.api.gui.GT_Slot_Render;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.inventories.InventoryPestKiller;
import gtPlusPlus.core.slots.SlotGeneric;
@@ -17,138 +16,136 @@ import net.minecraftforge.fluids.FluidStack;
public class Container_PestKiller extends Container {
- public TileEntityPestKiller tile_entity;
- public final InventoryPestKiller inventoryChest;
+ public TileEntityPestKiller tile_entity;
+ public final InventoryPestKiller inventoryChest;
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
- public static int StorageSlotNumber = 3; // Number of slots in storage area
- public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
- // and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
- // slots
+ public static int StorageSlotNumber = 3; // Number of slots in storage area
+ public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
+ // and Hotbar)
+ public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
+ // slots
- public Container_PestKiller(final InventoryPlayer inventory, final TileEntityPestKiller te) {
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
+ public Container_PestKiller(final InventoryPlayer inventory, final TileEntityPestKiller te) {
+ this.tile_entity = te;
+ this.inventoryChest = te.getInventory();
te.openInventory();
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
- int o = 0;
-
- int aSlotX = 134;
-
- this.addSlotToContainer(new SlotGeneric(this.inventoryChest, o++, aSlotX, 10));
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, aSlotX, 60));
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+ int o = 0;
+
+ int aSlotX = 134;
+
+ this.addSlotToContainer(new SlotGeneric(this.inventoryChest, o++, aSlotX, 10));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, aSlotX, 60));
addSlotToContainer(new GT_Slot_Render(tile_entity, o++, aSlotX, 35));
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
-
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
- }
-
- public FluidStack getFluidOfStoredTank() {
- if (tile_entity != null) {
- if (tile_entity.getTank() != null) {
- return tile_entity.getTank().getFluid();
- }
- }
- return null;
- }
-
- public int getFluidStoredAmount() {
- FluidStack f = getFluidOfStoredTank();
- return f == null ? 0 : f.amount;
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
- boolean fluid = false;
- if (aSlotIndex == 2) {
- fluid = true;
- }
- if (!fluid) {
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
- else {
- return null;
- }
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- tile_entity.closeInventory();
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockPestKiller) {
- return false;
- }
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
- ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*
- * if (par2 == 0) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
- *
- * var4.onSlotChange(var5, var3); } else if (par2 >=
- * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
- * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
- * FullSlotNumber, false)) { return null; } } else if (par2 >=
- * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
- * (!this.mergeItemStack(var5, InOutputSlotNumber,
- * InventoryOutSlotNumber, false)) { return null; } } else if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
- * false)) { return null; }
- */
-
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
- } else {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-
-} \ No newline at end of file
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+ }
+
+ public FluidStack getFluidOfStoredTank() {
+ if (tile_entity != null) {
+ if (tile_entity.getTank() != null) {
+ return tile_entity.getTank().getFluid();
+ }
+ }
+ return null;
+ }
+
+ public int getFluidStoredAmount() {
+ FluidStack f = getFluidOfStoredTank();
+ return f == null ? 0 : f.amount;
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+ boolean fluid = false;
+ if (aSlotIndex == 2) {
+ fluid = true;
+ }
+ if (!fluid) {
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
+ super.onContainerClosed(par1EntityPlayer);
+ tile_entity.closeInventory();
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockPestKiller) {
+ return false;
+ }
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ ItemStack var3 = null;
+ final Slot var4 = (Slot) this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack()) {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ /*
+ * if (par2 == 0) { if (!this.mergeItemStack(var5,
+ * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
+ *
+ * var4.onSlotChange(var5, var3); } else if (par2 >=
+ * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
+ * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
+ * FullSlotNumber, false)) { return null; } } else if (par2 >=
+ * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber,
+ * InventoryOutSlotNumber, false)) { return null; } } else if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
+ * false)) { return null; }
+ */
+
+ if (var5.stackSize == 0) {
+ var4.putStack((ItemStack) null);
+ } else {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize) {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;
+ }
+
+ // Can merge Slot
+ @Override
+ public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
+ return super.func_94530_a(p_94530_1_, p_94530_2_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_ProjectTable.java b/src/main/java/gtPlusPlus/core/container/Container_ProjectTable.java
index 2cdf7ee783..63eeb3fcae 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_ProjectTable.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_ProjectTable.java
@@ -1,12 +1,5 @@
package gtPlusPlus.core.container;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.*;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.CraftingManager;
-import net.minecraft.world.World;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.inventories.projecttable.InventoryProjectMain;
@@ -15,228 +8,226 @@ import gtPlusPlus.core.slots.SlotCraftingNoCollect;
import gtPlusPlus.core.slots.SlotDataStick;
import gtPlusPlus.core.slots.SlotNoInput;
import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.*;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.crafting.CraftingManager;
+import net.minecraft.world.World;
public class Container_ProjectTable extends Container {
- /** The crafting matrix inventory (3x3). */
+ /** The crafting matrix inventory (3x3). */
public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
+
public IInventory craftResult = new InventoryCraftResult();
-
- protected TileEntityProjectTable tile_entity;
- public final InventoryProjectMain inventoryGrid;
- public final InventoryProjectOutput inventoryOutputs;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- private final int[] slotOutputs = new int[2];
- private final int[] slotGrid = new int[9];
-
-
- public Container_ProjectTable(final InventoryPlayer inventory, final TileEntityProjectTable tile){
- this.tile_entity = tile;
- this.inventoryGrid = tile.inventoryGrid;
- this.inventoryOutputs = tile.inventoryOutputs;
- this.tile_entity.setContainer(this);
-
- int var6;
- int var7;
- this.worldObj = tile.getWorldObj();
- this.posX = tile.xCoord;
- this.posY = tile.yCoord;
- this.posZ = tile.zCoord;
-
- int nextFreeSlot = 0;
-
-
- //Output slots
- this.addSlotToContainer(new SlotDataStick(this.inventoryOutputs, 0, 26+(18*6), 8));
- this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 1, 26+(18*6), 44));
-
- this.addSlotToContainer(new SlotCraftingNoCollect(inventory.player, this.craftMatrix, this.craftResult, 0, 26+(18*4), 25));
-
-
- int o = 0;
- //Storage Side
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 3; ++var7)
- {
- //Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18));
- this.addSlotToContainer(new Slot(this.craftMatrix, nextFreeSlot, 8+18 + (var7 * 18), 8 + (var6 * 18)));
- this.slotGrid[o] = nextFreeSlot;
- nextFreeSlot++;
- o++;
- }
- }
-
-
- //Player Inventory
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 9; ++var7)
- {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
-
- //Player Hotbar
- for (var6 = 0; var6 < 9; ++var6)
- {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
+
+ protected TileEntityProjectTable tile_entity;
+ public final InventoryProjectMain inventoryGrid;
+ public final InventoryProjectOutput inventoryOutputs;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ private final int[] slotOutputs = new int[2];
+ private final int[] slotGrid = new int[9];
+
+ public Container_ProjectTable(final InventoryPlayer inventory, final TileEntityProjectTable tile) {
+ this.tile_entity = tile;
+ this.inventoryGrid = tile.inventoryGrid;
+ this.inventoryOutputs = tile.inventoryOutputs;
+ this.tile_entity.setContainer(this);
+
+ int var6;
+ int var7;
+ this.worldObj = tile.getWorldObj();
+ this.posX = tile.xCoord;
+ this.posY = tile.yCoord;
+ this.posZ = tile.zCoord;
+
+ int nextFreeSlot = 0;
+
+ // Output slots
+ this.addSlotToContainer(new SlotDataStick(this.inventoryOutputs, 0, 26 + (18 * 6), 8));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 1, 26 + (18 * 6), 44));
+
+ this.addSlotToContainer(
+ new SlotCraftingNoCollect(inventory.player, this.craftMatrix, this.craftResult, 0, 26 + (18 * 4), 25));
+
+ int o = 0;
+ // Storage Side
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 3; ++var7) {
+ // Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 *
+ // 18));
+ this.addSlotToContainer(
+ new Slot(this.craftMatrix, nextFreeSlot, 8 + 18 + (var7 * 18), 8 + (var6 * 18)));
+ this.slotGrid[o] = nextFreeSlot;
+ nextFreeSlot++;
+ o++;
+ }
+ }
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+
this.onCraftMatrixChanged(this.craftMatrix);
+ }
- }
-
- /**
+ /**
* Callback for when the crafting matrix is changed.
*/
@Override
- public void onCraftMatrixChanged(IInventory p_75130_1_)
- {
- this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
+ public void onCraftMatrixChanged(IInventory p_75130_1_) {
+ this.craftResult.setInventorySlotContents(
+ 0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
}
-
+
/**
* Called when the container is closed.
*/
@Override
- public void onContainerClosed(EntityPlayer p_75134_1_){
+ public void onContainerClosed(EntityPlayer p_75134_1_) {
super.onContainerClosed(p_75134_1_);
- if (!this.worldObj.isRemote){
- for (int i = 0; i < 9; ++i){
+ if (!this.worldObj.isRemote) {
+ for (int i = 0; i < 9; ++i) {
ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);
- if (itemstack != null){
+ if (itemstack != null) {
p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false);
}
}
}
}
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer){
-
- if (!aPlayer.worldObj.isRemote){
- if ((aSlotIndex == 999) || (aSlotIndex == -999)){
- //Utils.LOG_WARNING("??? - "+aSlotIndex);
- }
-
- if (aSlotIndex == 0){
- Logger.INFO("Player Clicked on the Data Stick slot");
- //TODO
- }if (aSlotIndex == 1){
- Logger.INFO("Player Clicked on the output slot");
- //TODO
- }
-
- for (final int x : this.slotGrid){
- if (aSlotIndex == x){
- Logger.INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid");
- }
- }
- }
- //Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer){
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockProjectTable){
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2)
- {
-
- return null;
-
- /*ItemStack var3 = null;
- final Slot var4 = (Slot)this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack())
- {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- if (par2 == 0)
- {
- if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
- {
- return null;
- }
-
- var4.onSlotChange(var5, var3);
- }
- else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber))
- {
- if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
- {
- return null;
- }
- }
- else if ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber))
- {
- if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
- {
- return null;
- }
- }
- else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
- {
- return null;
- }
-
- if (var5.stackSize == 0)
- {
- var4.putStack((ItemStack)null);
- }
- else
- {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize)
- {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;*/
- }
-
- //Can merge Slot
- @Override
- public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_){
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
+ // Utils.LOG_WARNING("??? - "+aSlotIndex);
+ }
+
+ if (aSlotIndex == 0) {
+ Logger.INFO("Player Clicked on the Data Stick slot");
+ // TODO
+ }
+ if (aSlotIndex == 1) {
+ Logger.INFO("Player Clicked on the output slot");
+ // TODO
+ }
+
+ for (final int x : this.slotGrid) {
+ if (aSlotIndex == x) {
+ Logger.INFO("Player Clicked slot " + aSlotIndex + " in the crafting Grid");
+ }
+ }
+ }
+ // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockProjectTable) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+
+ return null;
+
+ /*ItemStack var3 = null;
+ final Slot var4 = (Slot)this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack())
+ {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ if (par2 == 0)
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
+ {
+ return null;
+ }
+
+ var4.onSlotChange(var5, var3);
+ }
+ else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber))
+ {
+ if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
+ {
+ return null;
+ }
+ }
+ else if ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber))
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
+ {
+ return null;
+ }
+ }
+ else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
+ {
+ return null;
+ }
+
+ if (var5.stackSize == 0)
+ {
+ var4.putStack((ItemStack)null);
+ }
+ else
+ {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize)
+ {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;*/
+ }
+
+ // Can merge Slot
+ @Override
+ public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) {
return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_);
}
-
- public ItemStack getOutputContent(){
- ItemStack output = this.craftResult.getStackInSlot(0);
- if (output != null){
- return output;
- }
- return null;
- }
-
- public ItemStack[] getInputComponents(){
- ItemStack inputs[] = new ItemStack[9];
- for (int r=0;r<this.craftMatrix.getSizeInventory();r++){
- ItemStack temp = this.craftMatrix.getStackInSlot(r);
- inputs[r] = temp;
- }
- return inputs;
- }
-
-
-} \ No newline at end of file
+
+ public ItemStack getOutputContent() {
+ ItemStack output = this.craftResult.getStackInSlot(0);
+ if (output != null) {
+ return output;
+ }
+ return null;
+ }
+
+ public ItemStack[] getInputComponents() {
+ ItemStack inputs[] = new ItemStack[9];
+ for (int r = 0; r < this.craftMatrix.getSizeInventory(); r++) {
+ ItemStack temp = this.craftMatrix.getStackInSlot(r);
+ inputs[r] = temp;
+ }
+ return inputs;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_RoundRobinator.java b/src/main/java/gtPlusPlus/core/container/Container_RoundRobinator.java
index cbd08c2cca..3baaeac983 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_RoundRobinator.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_RoundRobinator.java
@@ -1,17 +1,13 @@
package gtPlusPlus.core.container;
-import java.util.Iterator;
-
-import org.apache.commons.lang3.ArrayUtils;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.GT_Values;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.inventories.Inventory_RoundRobinator;
import gtPlusPlus.core.slots.SlotNoInput;
import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
+import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -22,225 +18,217 @@ import net.minecraft.world.World;
public class Container_RoundRobinator extends Container {
- public TileEntityRoundRobinator tile_entity;
- public final Inventory_RoundRobinator inventoryChest;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- private final boolean[] mActiveData = new boolean[] {false, false, false, false};
-
- public static int mStorageSlotNumber = 4; // Number of slots in storage area
- public static int mInventorySlotNumber = 36; // Inventory Slots (Inventory
- // and Hotbar)
- public static int mFullSlotNumber = mInventorySlotNumber + mStorageSlotNumber; // All
- // slots
-
- public Container_RoundRobinator(final InventoryPlayer inventory, final TileEntityRoundRobinator te) {
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
- boolean [] aTemp = te.getActiveSides();
- if (aTemp != null && aTemp.length == 4) {
- for (int i=0;i<4;i++) {
- mActiveData[i] = aTemp[i];
- }
- }
-
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
-
- int o = 0;
- int xStart = 134;
- int yStart = 32;
-
- try {
- //0
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart));
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart));
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart+17));
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart+17));
-
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- this.detectAndSendChanges();
-
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
- final EntityPlayer aPlayer) {
-
- if (!aPlayer.worldObj.isRemote) {
- if (aSlotIndex < 4) {
- this.tile_entity.toggleSide(aSlotIndex+2);
- //Logger.INFO("Toggling side: "+(aSlotIndex+2)+" | Active: "+this.tile_entity.getSideActive(aSlotIndex+2)+" | Data:"+this.tile_entity.getDataString());
- }
- }
- return GT_Values.NI;
- //return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockRoundRobinator) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
-
-
- public final void addCraftingToCrafters(ICrafting par1ICrafting) {
- try {
- super.addCraftingToCrafters(par1ICrafting);
- } catch (Throwable var3) {
- var3.printStackTrace();
- }
- }
-
- public final void removeCraftingFromCrafters(ICrafting par1ICrafting) {
- try {
- super.removeCraftingFromCrafters(par1ICrafting);
- } catch (Throwable var3) {
- var3.printStackTrace();
- }
- }
-
- public final void detectAndSendChanges() {
- try {
- super.detectAndSendChanges();
- detectAndSendChangesEx();
- } catch (Throwable var2) {
- var2.printStackTrace();
- }
- }
-
- public final void updateProgressBar(int par1, int par2) {
- try {
- super.updateProgressBar(par1, par2);
- updateProgressBarEx(par1, par2);
- } catch (Throwable var4) {
- var4.printStackTrace();
- }
- }
-
-
- public int mSide_1 = 0;
- public int mSide_2 = 0;
- public int mSide_3 = 0;
- public int mSide_4 = 0;
- public int mTier = 1;
- public int mTickRate = 50;
-
- private int oSide_1 = 0;
- private int oSide_2 = 0;
- private int oSide_3 = 0;
- private int oSide_4 = 0;
- private int oTier = 1;
- private int oTickRate = 50;
-
- private int mTimer = 0;
-
-
-
- public void detectAndSendChangesEx() {
- super.detectAndSendChanges();
- if (!this.tile_entity.getWorldObj().isRemote) {
- boolean [] aTemp = tile_entity.getActiveSides();
- for (int i=0;i<4;i++) {
- mActiveData[i] = aTemp[i];
- }
- this.mSide_1 = aTemp[0] ? 1 : 0;
- this.mSide_2 = aTemp[1] ? 1 : 0;
- this.mSide_3 = aTemp[2] ? 1 : 0;
- this.mSide_4 = aTemp[3] ? 1 : 0;
- this.mTier = this.tile_entity.getTier();
- this.mTickRate = this.tile_entity.getTickRate();
- ++this.mTimer;
- Iterator var2 = this.crafters.iterator();
-
- while (true) {
- ICrafting var1;
- do {
- if (!var2.hasNext()) {
- this.oSide_1 = this.mSide_1;
- this.oSide_2 = this.mSide_2;
- this.oSide_3 = this.mSide_3;
- this.oSide_4 = this.mSide_4;
- this.oTier = this.mTier;
- this.oTickRate = this.mTickRate;
- return;
- }
- var1 = (ICrafting) var2.next();
- if (this.mTimer % 500 == 10 || this.oSide_1 != this.mSide_1) {
- var1.sendProgressBarUpdate(this, 2, this.mSide_1);
- }
- if (this.mTimer % 500 == 10 || this.oSide_2 != this.mSide_2) {
- var1.sendProgressBarUpdate(this, 4, this.mSide_2);
- }
- if (this.mTimer % 500 == 10 || this.oSide_3 != this.mSide_3) {
- var1.sendProgressBarUpdate(this, 6, this.mSide_3);
- }
- if (this.mTimer % 500 == 10 || this.oSide_4 != this.mSide_4) {
- var1.sendProgressBarUpdate(this, 8, this.mSide_4);
- }
- if (this.mTimer % 500 == 10 || this.oTier != this.mTier) {
- var1.sendProgressBarUpdate(this, 10, this.mTier);
- }
- if (this.mTimer % 500 == 10 || this.oTickRate != this.mTickRate) {
- var1.sendProgressBarUpdate(this, 12, this.mTickRate);
- }
- } while (this.mTimer % 500 != 10);
-
- }
- }
- }
-
- @SideOnly(Side.CLIENT)
- public void updateProgressBarEx(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 2 :
- this.mSide_1 = par2;
- break;
- case 4 :
- this.mSide_2 = par2;
- break;
- case 6 :
- this.mSide_3 = par2;
- case 8 :
- this.mSide_4 = par2;
- case 10 :
- this.mTier = par2;
- case 12 :
- this.mTickRate = par2;
- break;
- }
-
- }
-
-} \ No newline at end of file
+ public TileEntityRoundRobinator tile_entity;
+ public final Inventory_RoundRobinator inventoryChest;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ private final boolean[] mActiveData = new boolean[] {false, false, false, false};
+
+ public static int mStorageSlotNumber = 4; // Number of slots in storage area
+ public static int mInventorySlotNumber = 36; // Inventory Slots (Inventory
+ // and Hotbar)
+ public static int mFullSlotNumber = mInventorySlotNumber + mStorageSlotNumber; // All
+ // slots
+
+ public Container_RoundRobinator(final InventoryPlayer inventory, final TileEntityRoundRobinator te) {
+ this.tile_entity = te;
+ this.inventoryChest = te.getInventory();
+ boolean[] aTemp = te.getActiveSides();
+ if (aTemp != null && aTemp.length == 4) {
+ for (int i = 0; i < 4; i++) {
+ mActiveData[i] = aTemp[i];
+ }
+ }
+
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+
+ int o = 0;
+ int xStart = 134;
+ int yStart = 32;
+
+ try {
+ // 0
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart + 18, yStart));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart + 17));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart + 18, yStart + 17));
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(
+ new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ this.detectAndSendChanges();
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if (aSlotIndex < 4) {
+ this.tile_entity.toggleSide(aSlotIndex + 2);
+ // Logger.INFO("Toggling side: "+(aSlotIndex+2)+" | Active:
+ // "+this.tile_entity.getSideActive(aSlotIndex+2)+" | Data:"+this.tile_entity.getDataString());
+ }
+ }
+ return GT_Values.NI;
+ // return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
+ super.onContainerClosed(par1EntityPlayer);
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockRoundRobinator) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ public final void addCraftingToCrafters(ICrafting par1ICrafting) {
+ try {
+ super.addCraftingToCrafters(par1ICrafting);
+ } catch (Throwable var3) {
+ var3.printStackTrace();
+ }
+ }
+
+ public final void removeCraftingFromCrafters(ICrafting par1ICrafting) {
+ try {
+ super.removeCraftingFromCrafters(par1ICrafting);
+ } catch (Throwable var3) {
+ var3.printStackTrace();
+ }
+ }
+
+ public final void detectAndSendChanges() {
+ try {
+ super.detectAndSendChanges();
+ detectAndSendChangesEx();
+ } catch (Throwable var2) {
+ var2.printStackTrace();
+ }
+ }
+
+ public final void updateProgressBar(int par1, int par2) {
+ try {
+ super.updateProgressBar(par1, par2);
+ updateProgressBarEx(par1, par2);
+ } catch (Throwable var4) {
+ var4.printStackTrace();
+ }
+ }
+
+ public int mSide_1 = 0;
+ public int mSide_2 = 0;
+ public int mSide_3 = 0;
+ public int mSide_4 = 0;
+ public int mTier = 1;
+ public int mTickRate = 50;
+
+ private int oSide_1 = 0;
+ private int oSide_2 = 0;
+ private int oSide_3 = 0;
+ private int oSide_4 = 0;
+ private int oTier = 1;
+ private int oTickRate = 50;
+
+ private int mTimer = 0;
+
+ public void detectAndSendChangesEx() {
+ super.detectAndSendChanges();
+ if (!this.tile_entity.getWorldObj().isRemote) {
+ boolean[] aTemp = tile_entity.getActiveSides();
+ for (int i = 0; i < 4; i++) {
+ mActiveData[i] = aTemp[i];
+ }
+ this.mSide_1 = aTemp[0] ? 1 : 0;
+ this.mSide_2 = aTemp[1] ? 1 : 0;
+ this.mSide_3 = aTemp[2] ? 1 : 0;
+ this.mSide_4 = aTemp[3] ? 1 : 0;
+ this.mTier = this.tile_entity.getTier();
+ this.mTickRate = this.tile_entity.getTickRate();
+ ++this.mTimer;
+ Iterator var2 = this.crafters.iterator();
+
+ while (true) {
+ ICrafting var1;
+ do {
+ if (!var2.hasNext()) {
+ this.oSide_1 = this.mSide_1;
+ this.oSide_2 = this.mSide_2;
+ this.oSide_3 = this.mSide_3;
+ this.oSide_4 = this.mSide_4;
+ this.oTier = this.mTier;
+ this.oTickRate = this.mTickRate;
+ return;
+ }
+ var1 = (ICrafting) var2.next();
+ if (this.mTimer % 500 == 10 || this.oSide_1 != this.mSide_1) {
+ var1.sendProgressBarUpdate(this, 2, this.mSide_1);
+ }
+ if (this.mTimer % 500 == 10 || this.oSide_2 != this.mSide_2) {
+ var1.sendProgressBarUpdate(this, 4, this.mSide_2);
+ }
+ if (this.mTimer % 500 == 10 || this.oSide_3 != this.mSide_3) {
+ var1.sendProgressBarUpdate(this, 6, this.mSide_3);
+ }
+ if (this.mTimer % 500 == 10 || this.oSide_4 != this.mSide_4) {
+ var1.sendProgressBarUpdate(this, 8, this.mSide_4);
+ }
+ if (this.mTimer % 500 == 10 || this.oTier != this.mTier) {
+ var1.sendProgressBarUpdate(this, 10, this.mTier);
+ }
+ if (this.mTimer % 500 == 10 || this.oTickRate != this.mTickRate) {
+ var1.sendProgressBarUpdate(this, 12, this.mTickRate);
+ }
+ } while (this.mTimer % 500 != 10);
+ }
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBarEx(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 2:
+ this.mSide_1 = par2;
+ break;
+ case 4:
+ this.mSide_2 = par2;
+ break;
+ case 6:
+ this.mSide_3 = par2;
+ case 8:
+ this.mSide_4 = par2;
+ case 10:
+ this.mTier = par2;
+ case 12:
+ this.mTickRate = par2;
+ break;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_SuperJukebox.java b/src/main/java/gtPlusPlus/core/container/Container_SuperJukebox.java
index f9bf617e1b..d1b8d1ee6d 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_SuperJukebox.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_SuperJukebox.java
@@ -1,16 +1,14 @@
package gtPlusPlus.core.container;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox;
import gtPlusPlus.core.inventories.Inventory_SuperJukebox;
-import gtPlusPlus.core.slots.SlotIntegratedCircuit;
import gtPlusPlus.core.slots.SlotJukebox;
import gtPlusPlus.core.slots.SlotNoInput;
+import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -21,231 +19,223 @@ import net.minecraft.world.World;
public class Container_SuperJukebox extends Container {
- protected TileEntitySuperJukebox tile_entity;
- public final Inventory_SuperJukebox inventoryChest;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
-
- public static final int SLOT_HOLO_PLAY = 18;
- public static final int SLOT_HOLO_LOOP = 19;
- public static final int SLOT_OUTPUT = 20;
-
- public static int StorageSlotNumber = 26; // Number of slots in storage area
- public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
- // and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
- // slots
-
- public Container_SuperJukebox(final InventoryPlayer inventory, final TileEntitySuperJukebox te) {
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
-
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
- Logger.INFO("1");
-
- int o = 0;
-
- // Storage Side
- /*for (var6 = 0; var6 < 3; var6++) {
- for (var7 = 0; var7 < 5; var7++) {
- this.addSlotToContainer(new SlotIntegratedCircuit(o, this.inventoryChest, o, 44 + (var7 * 18), 15 + (var6 * 18)));
- o++;
- }
- }*/
-
-
- int xStart = 9;
- int yStart = 20;
-
- try {
-
- //Row One
- for (int c = 0; c < 9; c++) {
- if (c >= 3 && c < 6) {
- continue;
- }
- this.addSlotToContainer(new SlotJukebox(this.inventoryChest, o++, xStart+(18*c), yStart));
- }
-
- //Row Two
- for (int c = 0; c < 9; c++) {
- if (c >= 3 && c < 6) {
- continue;
- }
- this.addSlotToContainer(new SlotJukebox(this.inventoryChest, o++, xStart+(18*c), yStart+18));
- }
-
- //Row Two
- for (int c = 0; c < 9; c++) {
- if (c >= 3 && c < 6) {
- continue;
- }
- this.addSlotToContainer(new SlotJukebox(this.inventoryChest, o++, xStart+(18*c), yStart+36));
- }
-
-
- //Controls
- int c = 4;
-
- //Two Control Buttons
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_HOLO_PLAY, xStart+(18*c), 12));
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_HOLO_LOOP, xStart+(18*c), 12+(1*18)));
-
- //Active playing slot for visual
- this.addSlotToContainer(new SlotJukebox(this.inventoryChest, SLOT_OUTPUT, xStart+(18*c), 18+(2*18), true));
-
-
-
-
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
-
- Logger.INFO("3");
-
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
-
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockCustomJukebox) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
- ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*
- * if (par2 == 0) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
- *
- * var4.onSlotChange(var5, var3); } else if (par2 >=
- * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
- * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
- * FullSlotNumber, false)) { return null; } } else if (par2 >=
- * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
- * (!this.mergeItemStack(var5, InOutputSlotNumber,
- * InventoryOutSlotNumber, false)) { return null; } } else if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
- * false)) { return null; }
- */
-
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
- } else {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-
-
-
- @Override
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (tile_entity == null || tile_entity.getWorldObj().isRemote) return null;
- switch (aSlotIndex) {
- case SLOT_HOLO_PLAY:
- if (tile_entity == null) return null;
- tile_entity.mIsPlaying = !tile_entity.mIsPlaying;
- Logger.INFO("Jukebox | Playing: "+tile_entity.mIsPlaying);
- tile_entity.jukeboxLogicUpdate();
- return null;
- case SLOT_HOLO_LOOP:
- if (tile_entity == null) return null;
- tile_entity.mIsLooping = !tile_entity.mIsLooping;
- Logger.INFO("Jukebox | Looping: "+tile_entity.mIsLooping);
- return null;
- case 20:
- return null;
- default:
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
- }
-
- public boolean isPlaying;
- public boolean isLooping;
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (tile_entity == null || tile_entity.getWorldObj().isRemote) return;
-
- isPlaying = tile_entity.mIsPlaying;
- isLooping = tile_entity.mIsLooping;
-
- Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 102, isPlaying ? 1 : 0);
- var1.sendProgressBarUpdate(this, 103, isLooping ? 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:
- isPlaying = (par2 != 0);
- break;
- case 103:
- isLooping = (par2 != 0);
- break;
- }
- }
-} \ No newline at end of file
+ protected TileEntitySuperJukebox tile_entity;
+ public final Inventory_SuperJukebox inventoryChest;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ public static final int SLOT_HOLO_PLAY = 18;
+ public static final int SLOT_HOLO_LOOP = 19;
+ public static final int SLOT_OUTPUT = 20;
+
+ public static int StorageSlotNumber = 26; // Number of slots in storage area
+ public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
+ // and Hotbar)
+ public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
+ // slots
+
+ public Container_SuperJukebox(final InventoryPlayer inventory, final TileEntitySuperJukebox te) {
+ this.tile_entity = te;
+ this.inventoryChest = te.getInventory();
+
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+ Logger.INFO("1");
+
+ int o = 0;
+
+ // Storage Side
+ /*for (var6 = 0; var6 < 3; var6++) {
+ for (var7 = 0; var7 < 5; var7++) {
+ this.addSlotToContainer(new SlotIntegratedCircuit(o, this.inventoryChest, o, 44 + (var7 * 18), 15 + (var6 * 18)));
+ o++;
+ }
+ }*/
+
+ int xStart = 9;
+ int yStart = 20;
+
+ try {
+
+ // Row One
+ for (int c = 0; c < 9; c++) {
+ if (c >= 3 && c < 6) {
+ continue;
+ }
+ this.addSlotToContainer(new SlotJukebox(this.inventoryChest, o++, xStart + (18 * c), yStart));
+ }
+
+ // Row Two
+ for (int c = 0; c < 9; c++) {
+ if (c >= 3 && c < 6) {
+ continue;
+ }
+ this.addSlotToContainer(new SlotJukebox(this.inventoryChest, o++, xStart + (18 * c), yStart + 18));
+ }
+
+ // Row Two
+ for (int c = 0; c < 9; c++) {
+ if (c >= 3 && c < 6) {
+ continue;
+ }
+ this.addSlotToContainer(new SlotJukebox(this.inventoryChest, o++, xStart + (18 * c), yStart + 36));
+ }
+
+ // Controls
+ int c = 4;
+
+ // Two Control Buttons
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_HOLO_PLAY, xStart + (18 * c), 12));
+ this.addSlotToContainer(
+ new SlotNoInput(this.inventoryChest, SLOT_HOLO_LOOP, xStart + (18 * c), 12 + (1 * 18)));
+
+ // Active playing slot for visual
+ this.addSlotToContainer(
+ new SlotJukebox(this.inventoryChest, SLOT_OUTPUT, xStart + (18 * c), 18 + (2 * 18), true));
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(
+ new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+
+ Logger.INFO("3");
+
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
+ super.onContainerClosed(par1EntityPlayer);
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockCustomJukebox) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ ItemStack var3 = null;
+ final Slot var4 = (Slot) this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack()) {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ /*
+ * if (par2 == 0) { if (!this.mergeItemStack(var5,
+ * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
+ *
+ * var4.onSlotChange(var5, var3); } else if (par2 >=
+ * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
+ * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
+ * FullSlotNumber, false)) { return null; } } else if (par2 >=
+ * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber,
+ * InventoryOutSlotNumber, false)) { return null; } } else if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
+ * false)) { return null; }
+ */
+
+ if (var5.stackSize == 0) {
+ var4.putStack((ItemStack) null);
+ } else {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize) {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;
+ }
+
+ // Can merge Slot
+ @Override
+ public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
+ return super.func_94530_a(p_94530_1_, p_94530_2_);
+ }
+
+ @Override
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ if (tile_entity == null || tile_entity.getWorldObj().isRemote) return null;
+ switch (aSlotIndex) {
+ case SLOT_HOLO_PLAY:
+ if (tile_entity == null) return null;
+ tile_entity.mIsPlaying = !tile_entity.mIsPlaying;
+ Logger.INFO("Jukebox | Playing: " + tile_entity.mIsPlaying);
+ tile_entity.jukeboxLogicUpdate();
+ return null;
+ case SLOT_HOLO_LOOP:
+ if (tile_entity == null) return null;
+ tile_entity.mIsLooping = !tile_entity.mIsLooping;
+ Logger.INFO("Jukebox | Looping: " + tile_entity.mIsLooping);
+ return null;
+ case 20:
+ return null;
+ default:
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ }
+
+ public boolean isPlaying;
+ public boolean isLooping;
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (tile_entity == null || tile_entity.getWorldObj().isRemote) return;
+
+ isPlaying = tile_entity.mIsPlaying;
+ isLooping = tile_entity.mIsLooping;
+
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 102, isPlaying ? 1 : 0);
+ var1.sendProgressBarUpdate(this, 103, isLooping ? 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:
+ isPlaying = (par2 != 0);
+ break;
+ case 103:
+ isLooping = (par2 != 0);
+ break;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java b/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java
index f812e384a7..14515c25f3 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java
@@ -1,12 +1,5 @@
package gtPlusPlus.core.container;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.inventories.tradetable.InventoryTradeMain;
@@ -14,210 +7,209 @@ import gtPlusPlus.core.inventories.tradetable.InventoryTradeOutput;
import gtPlusPlus.core.slots.SlotGeneric;
import gtPlusPlus.core.slots.SlotNoInput;
import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
public class Container_TradeTable extends Container {
- protected TileEntityTradeTable tile_entity;
- public final InventoryTradeMain inventoryChest;
- public final InventoryTradeOutput inventoryOutputs;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- private final int[] slotOutputs = new int[2];
- private final int[] slotGrid = new int[9];
-
-
- public Container_TradeTable(final InventoryPlayer inventory, final TileEntityTradeTable te){
-
- this.tile_entity = te;
- this.inventoryChest = te.inventoryGrid;
- this.inventoryOutputs = te.inventoryOutputs;
- this.tile_entity.setContainer(this);
-
- if (te.isServerSide())
- Logger.INFO("Container - "+te.mOwnerName);
-
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
-
- int nextFreeSlot = 0;
-
-
- //Output slots
- this.addSlotToContainer(new SlotGeneric(this.inventoryOutputs, 0, 26+(18*6), 8));
- this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 1, 26+(18*6), 44));
-
- //this.addSlotToContainer(new SlotCraftingNoCollect(inventory.player, this.craftMatrix, this.craftResult, 0, 26+(18*4), 25));
-
- int o = 0;
- //Storage Side
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 3; ++var7)
- {
- //Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18));
- this.addSlotToContainer(new Slot(this.inventoryChest, nextFreeSlot, 8+18 + (var7 * 18), 8 + (var6 * 18)));
- this.slotGrid[o] = nextFreeSlot;
- nextFreeSlot++;
- o++;
- }
- }
-
- //Player Inventory
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 9; ++var7)
- {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
-
- //Player Hotbar
- for (var6 = 0; var6 < 9; ++var6)
- {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
- //this.onCraftMatrixChanged(this.craftMatrix);
- }
-
- /**
- * Called when the container is closed.
- */
- @Override
- public void onContainerClosed(EntityPlayer p_75134_1_){
- super.onContainerClosed(p_75134_1_);
- if (!this.worldObj.isRemote){
- for (int i = 0; i < 9; ++i){
- ItemStack itemstack = this.inventoryChest.getStackInSlotOnClosing(i);
- if (itemstack != null){
- p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false);
- }
- }
- }
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer){
-
- if (!aPlayer.worldObj.isRemote){
- if ((aSlotIndex == 999) || (aSlotIndex == -999)){
- //Utils.LOG_WARNING("??? - "+aSlotIndex);
- }
-
- if (aSlotIndex == 0){
- Logger.INFO("Player Clicked on the Data Stick slot");
- //TODO
- }if (aSlotIndex == 1){
- Logger.INFO("Player Clicked on the output slot");
- //TODO
- }
-
- for (final int x : this.slotGrid){
- if (aSlotIndex == x){
- Logger.INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid");
- }
- }
- }
- //Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer){
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockTradeTable){
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2)
- {
-
- return null;
-
- /*ItemStack var3 = null;
- final Slot var4 = (Slot)this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack())
- {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- if (par2 == 0)
- {
- if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
- {
- return null;
- }
-
- var4.onSlotChange(var5, var3);
- }
- else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber))
- {
- if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
- {
- return null;
- }
- }
- else if ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber))
- {
- if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
- {
- return null;
- }
- }
- else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
- {
- return null;
- }
-
- if (var5.stackSize == 0)
- {
- var4.putStack((ItemStack)null);
- }
- else
- {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize)
- {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;*/
- }
-
- public ItemStack getOutputContent(){
- ItemStack output = this.inventoryOutputs.getStackInSlot(0);
- if (output != null){
- return output;
- }
- return null;
- }
-
- public ItemStack[] getInputComponents(){
- ItemStack inputs[] = new ItemStack[9];
- for (int r=0;r<this.inventoryChest.getSizeInventory();r++){
- ItemStack temp = this.inventoryChest.getStackInSlot(r);
- inputs[r] = temp;
- }
- return inputs;
- }
-
-
-} \ No newline at end of file
+ protected TileEntityTradeTable tile_entity;
+ public final InventoryTradeMain inventoryChest;
+ public final InventoryTradeOutput inventoryOutputs;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ private final int[] slotOutputs = new int[2];
+ private final int[] slotGrid = new int[9];
+
+ public Container_TradeTable(final InventoryPlayer inventory, final TileEntityTradeTable te) {
+
+ this.tile_entity = te;
+ this.inventoryChest = te.inventoryGrid;
+ this.inventoryOutputs = te.inventoryOutputs;
+ this.tile_entity.setContainer(this);
+
+ if (te.isServerSide()) Logger.INFO("Container - " + te.mOwnerName);
+
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+
+ int nextFreeSlot = 0;
+
+ // Output slots
+ this.addSlotToContainer(new SlotGeneric(this.inventoryOutputs, 0, 26 + (18 * 6), 8));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 1, 26 + (18 * 6), 44));
+
+ // this.addSlotToContainer(new SlotCraftingNoCollect(inventory.player, this.craftMatrix, this.craftResult, 0,
+ // 26+(18*4), 25));
+
+ int o = 0;
+ // Storage Side
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 3; ++var7) {
+ // Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 *
+ // 18));
+ this.addSlotToContainer(
+ new Slot(this.inventoryChest, nextFreeSlot, 8 + 18 + (var7 * 18), 8 + (var6 * 18)));
+ this.slotGrid[o] = nextFreeSlot;
+ nextFreeSlot++;
+ o++;
+ }
+ }
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+
+ // this.onCraftMatrixChanged(this.craftMatrix);
+ }
+
+ /**
+ * Called when the container is closed.
+ */
+ @Override
+ public void onContainerClosed(EntityPlayer p_75134_1_) {
+ super.onContainerClosed(p_75134_1_);
+ if (!this.worldObj.isRemote) {
+ for (int i = 0; i < 9; ++i) {
+ ItemStack itemstack = this.inventoryChest.getStackInSlotOnClosing(i);
+ if (itemstack != null) {
+ p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false);
+ }
+ }
+ }
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if ((aSlotIndex == 999) || (aSlotIndex == -999)) {
+ // Utils.LOG_WARNING("??? - "+aSlotIndex);
+ }
+
+ if (aSlotIndex == 0) {
+ Logger.INFO("Player Clicked on the Data Stick slot");
+ // TODO
+ }
+ if (aSlotIndex == 1) {
+ Logger.INFO("Player Clicked on the output slot");
+ // TODO
+ }
+
+ for (final int x : this.slotGrid) {
+ if (aSlotIndex == x) {
+ Logger.INFO("Player Clicked slot " + aSlotIndex + " in the crafting Grid");
+ }
+ }
+ }
+ // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockTradeTable) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+
+ return null;
+
+ /*ItemStack var3 = null;
+ final Slot var4 = (Slot)this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack())
+ {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ if (par2 == 0)
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
+ {
+ return null;
+ }
+
+ var4.onSlotChange(var5, var3);
+ }
+ else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber))
+ {
+ if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
+ {
+ return null;
+ }
+ }
+ else if ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber))
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
+ {
+ return null;
+ }
+ }
+ else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
+ {
+ return null;
+ }
+
+ if (var5.stackSize == 0)
+ {
+ var4.putStack((ItemStack)null);
+ }
+ else
+ {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize)
+ {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;*/
+ }
+
+ public ItemStack getOutputContent() {
+ ItemStack output = this.inventoryOutputs.getStackInSlot(0);
+ if (output != null) {
+ return output;
+ }
+ return null;
+ }
+
+ public ItemStack[] getInputComponents() {
+ ItemStack inputs[] = new ItemStack[9];
+ for (int r = 0; r < this.inventoryChest.getSizeInventory(); r++) {
+ ItemStack temp = this.inventoryChest.getStackInSlot(r);
+ inputs[r] = temp;
+ }
+ return inputs;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java
index 65e84d7272..740048f88d 100644
--- a/src/main/java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.container;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.api.objects.Logger;
@@ -11,6 +9,7 @@ import gtPlusPlus.core.slots.SlotNoInput;
import gtPlusPlus.core.slots.SlotVolumetricFlask;
import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter;
import gtPlusPlus.core.util.Utils;
+import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -21,170 +20,163 @@ import net.minecraft.world.World;
public class Container_VolumetricFlaskSetter extends Container {
- public TileEntityVolumetricFlaskSetter mTileEntity;
- public final Inventory_VolumetricFlaskSetter inventoryChest;
-
-
- public int mCustomValue;
- private int oCustomValue;
- private int mTimer;
-
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- public static final int SLOT_OUTPUT = 8;
-
- public static int StorageSlotNumber = 8; // Number of slots in storage area
- public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
- // and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
- // slots
-
- public Container_VolumetricFlaskSetter(final InventoryPlayer inventory, final TileEntityVolumetricFlaskSetter te) {
- this.mTileEntity = te;
- this.inventoryChest = te.getInventory();
-
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
- //mCustomValue = te.getCustomValue();
-
- int o = 0;
-
- // Storage Side
- /*for (var6 = 0; var6 < 3; var6++) {
- for (var7 = 0; var7 < 5; var7++) {
- this.addSlotToContainer(new SlotIntegratedCircuit(o, this.inventoryChest, o, 44 + (var7 * 18), 15 + (var6 * 18)));
- o++;
- }
- }*/
-
-
- int xStart = 26;
- int yStart = 12;
-
- try {
- //0
- this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart, yStart));
- this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
- this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
- this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
- this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
- this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
- this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
- this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart, yStart+18));
-
- //Add Output
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, 8+(8*18), 59));
- o++;
-
-
-
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
- this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
- }
- }
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
- detectAndSendChanges();
- }
- catch (Throwable t) {}
-
- }
-
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockVolumetricFlaskSetter) {
- return false;
- }
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
- ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*
- * if (par2 == 0) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
- *
- * var4.onSlotChange(var5, var3); } else if (par2 >=
- * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
- * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
- * FullSlotNumber, false)) { return null; } } else if (par2 >=
- * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
- * (!this.mergeItemStack(var5, InOutputSlotNumber,
- * InventoryOutSlotNumber, false)) { return null; } } else if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
- * false)) { return null; }
- */
-
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
- } else {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if ((Utils.isClient()) || (this.mTileEntity == null)) {
- return;
- }
-
- mCustomValue = mTileEntity.getCustomValue();
+ public TileEntityVolumetricFlaskSetter mTileEntity;
+ public final Inventory_VolumetricFlaskSetter inventoryChest;
+
+ public int mCustomValue;
+ private int oCustomValue;
+ private int mTimer;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ public static final int SLOT_OUTPUT = 8;
+
+ public static int StorageSlotNumber = 8; // Number of slots in storage area
+ public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
+ // and Hotbar)
+ public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
+ // slots
+
+ public Container_VolumetricFlaskSetter(final InventoryPlayer inventory, final TileEntityVolumetricFlaskSetter te) {
+ this.mTileEntity = te;
+ this.inventoryChest = te.getInventory();
+
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+ // mCustomValue = te.getCustomValue();
+
+ int o = 0;
+
+ // Storage Side
+ /*for (var6 = 0; var6 < 3; var6++) {
+ for (var7 = 0; var7 < 5; var7++) {
+ this.addSlotToContainer(new SlotIntegratedCircuit(o, this.inventoryChest, o, 44 + (var7 * 18), 15 + (var6 * 18)));
+ o++;
+ }
+ }*/
+
+ int xStart = 26;
+ int yStart = 12;
+
+ try {
+ // 0
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart += 18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart += 18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart += 18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart += 18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart += 18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart += 18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart, yStart + 18));
+
+ // Add Output
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, 8 + (8 * 18), 59));
+ o++;
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(
+ new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+ detectAndSendChanges();
+ } catch (Throwable t) {
+ }
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockVolumetricFlaskSetter) {
+ return false;
+ }
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ ItemStack var3 = null;
+ final Slot var4 = (Slot) this.inventorySlots.get(par2);
+
+ if ((var4 != null) && var4.getHasStack()) {
+ final ItemStack var5 = var4.getStack();
+ var3 = var5.copy();
+
+ /*
+ * if (par2 == 0) { if (!this.mergeItemStack(var5,
+ * InOutputSlotNumber, FullSlotNumber, true)) { return null; }
+ *
+ * var4.onSlotChange(var5, var3); } else if (par2 >=
+ * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if
+ * (!this.mergeItemStack(var5, InventoryOutSlotNumber,
+ * FullSlotNumber, false)) { return null; } } else if (par2 >=
+ * InventoryOutSlotNumber && par2 < FullSlotNumber) { if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber,
+ * InventoryOutSlotNumber, false)) { return null; } } else if
+ * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber,
+ * false)) { return null; }
+ */
+
+ if (var5.stackSize == 0) {
+ var4.putStack((ItemStack) null);
+ } else {
+ var4.onSlotChanged();
+ }
+
+ if (var5.stackSize == var3.stackSize) {
+ return null;
+ }
+
+ var4.onPickupFromSlot(par1EntityPlayer, var5);
+ }
+
+ return var3;
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if ((Utils.isClient()) || (this.mTileEntity == null)) {
+ return;
+ }
+
+ mCustomValue = mTileEntity.getCustomValue();
mTimer++;
- Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- if (mTimer % 20 == 10 || oCustomValue != mCustomValue) {
- var1.sendProgressBarUpdate(this, 0, mCustomValue);
- }
- }
-
- oCustomValue = mCustomValue;
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 0:
- mCustomValue = (short) par2;
- break;
- }
- }
-
- public void log(String aString) {
- Logger.INFO("[Flask-Container] "+aString);
- }
-
-} \ No newline at end of file
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ if (mTimer % 20 == 10 || oCustomValue != mCustomValue) {
+ var1.sendProgressBarUpdate(this, 0, mCustomValue);
+ }
+ }
+
+ oCustomValue = mCustomValue;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 0:
+ mCustomValue = (short) par2;
+ break;
+ }
+ }
+
+ public void log(String aString) {
+ Logger.INFO("[Flask-Container] " + aString);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java b/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java
index 8e56c661f2..51bc85a6ae 100644
--- a/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java
+++ b/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java
@@ -7,7 +7,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
public class LunchBoxContainer extends ContainerBoxBase {
- public LunchBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, CustomBoxInventory CustomBoxInventory) {
- super(par1Player, inventoryPlayer, CustomBoxInventory, SlotLunchBox.class, gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
- }
+ public LunchBoxContainer(
+ EntityPlayer par1Player, InventoryPlayer inventoryPlayer, CustomBoxInventory CustomBoxInventory) {
+ super(
+ par1Player,
+ inventoryPlayer,
+ CustomBoxInventory,
+ SlotLunchBox.class,
+ gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java b/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java
index 7820d56814..294836ded4 100644
--- a/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java
+++ b/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java
@@ -7,7 +7,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
public class MagicBagContainer extends ContainerBoxBase {
- public MagicBagContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, CustomBoxInventory CustomBoxInventory) {
- super(par1Player, inventoryPlayer, CustomBoxInventory, SlotMagicToolBag.class, gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
- }
+ public MagicBagContainer(
+ EntityPlayer par1Player, InventoryPlayer inventoryPlayer, CustomBoxInventory CustomBoxInventory) {
+ super(
+ par1Player,
+ inventoryPlayer,
+ CustomBoxInventory,
+ SlotMagicToolBag.class,
+ gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java b/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java
index 49719aa9ba..e2c8841266 100644
--- a/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java
+++ b/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java
@@ -8,8 +8,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
public class ToolBoxContainer extends ContainerBoxBase {
- public ToolBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer,
- CustomBoxInventory CustomBoxInventory) {
- super(par1Player, inventoryPlayer, CustomBoxInventory, SlotToolBox.class, UniversalToolBox.SLOTS);
- }
+ public ToolBoxContainer(
+ EntityPlayer par1Player, InventoryPlayer inventoryPlayer, CustomBoxInventory CustomBoxInventory) {
+ super(par1Player, inventoryPlayer, CustomBoxInventory, SlotToolBox.class, UniversalToolBox.SLOTS);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/creative/AddToCreativeTab.java b/src/main/java/gtPlusPlus/core/creative/AddToCreativeTab.java
index 218bef46bd..f0fb71112b 100644
--- a/src/main/java/gtPlusPlus/core/creative/AddToCreativeTab.java
+++ b/src/main/java/gtPlusPlus/core/creative/AddToCreativeTab.java
@@ -1,35 +1,33 @@
package gtPlusPlus.core.creative;
-import net.minecraft.creativetab.CreativeTabs;
import gregtech.api.util.GT_CreativeTab;
import gtPlusPlus.core.creative.tabs.*;
-import gtPlusPlus.xmod.bop.creative.MiscUtilsBOPTab;
+import net.minecraft.creativetab.CreativeTabs;
public class AddToCreativeTab {
- public static CreativeTabs tabBlock;
- public static CreativeTabs tabMisc;
- public static CreativeTabs tabCombat;
- public static CreativeTabs tabTools;
- public static CreativeTabs tabMachines;
- public static CreativeTabs tabOther;
- public static CreativeTabs tabBOP;
+ public static CreativeTabs tabBlock;
+ public static CreativeTabs tabMisc;
+ public static CreativeTabs tabCombat;
+ public static CreativeTabs tabTools;
+ public static CreativeTabs tabMachines;
+ public static CreativeTabs tabOther;
+ public static CreativeTabs tabBOP;
+
+ public static void initialiseTabs() {
+ // GT_CreativeTab
+ /*tabBlock = new MiscUtilCreativeTabBlock("MiscUtilBlockTab");
+ tabMisc = new MiscUtilCreativeTabMisc("MiscUtilMiscTab");
+ tabTools = new MiscUtilCreativeTabTools("MiscUtilToolsTab");
+ tabMachines = new MiscUtilCreativeTabMachines("MiscUtilMachineTab");
+ tabOther = new MiscUtilCreativeTabOther("MiscUtilOtherTab");
+ tabBOP = new MiscUtilsBOPTab("MiscUtilBOP");*/
- public static void initialiseTabs() {
- //GT_CreativeTab
- /*tabBlock = new MiscUtilCreativeTabBlock("MiscUtilBlockTab");
- tabMisc = new MiscUtilCreativeTabMisc("MiscUtilMiscTab");
- tabTools = new MiscUtilCreativeTabTools("MiscUtilToolsTab");
- tabMachines = new MiscUtilCreativeTabMachines("MiscUtilMachineTab");
- tabOther = new MiscUtilCreativeTabOther("MiscUtilOtherTab");
- tabBOP = new MiscUtilsBOPTab("MiscUtilBOP");*/
-
- tabBlock = new GT_CreativeTab("GTPP_BLOCKS", "GT++ Blocks");
- tabMisc = new GT_CreativeTab("GTPP_MISC", "GT++ Misc");
- tabTools = new GT_CreativeTab("GTPP_TOOLS", "GT++ Tools");
- tabMachines = new GT_CreativeTab("GTPP_MACHINES", "GT++ Machines");
- tabOther = new GT_CreativeTab("GTPP_OTHER", "GT++ Other");
- tabBOP = new GT_CreativeTab("GTPP_OTHER_2", "GT++ Other II");
-
- }
+ tabBlock = new GT_CreativeTab("GTPP_BLOCKS", "GT++ Blocks");
+ tabMisc = new GT_CreativeTab("GTPP_MISC", "GT++ Misc");
+ tabTools = new GT_CreativeTab("GTPP_TOOLS", "GT++ Tools");
+ tabMachines = new GT_CreativeTab("GTPP_MACHINES", "GT++ Machines");
+ tabOther = new GT_CreativeTab("GTPP_OTHER", "GT++ Other");
+ tabBOP = new GT_CreativeTab("GTPP_OTHER_2", "GT++ Other II");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
index 2851a514d0..7cb10f1092 100644
--- a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
+++ b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
@@ -1,27 +1,25 @@
package gtPlusPlus.core.creative.tabs;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.block.ModBlocks;
public class MiscUtilCreativeTabBlock extends CreativeTabs {
- public MiscUtilCreativeTabBlock(final String lable) {
- super(lable);
- }
+ public MiscUtilCreativeTabBlock(final String lable) {
+ super(lable);
+ }
+
+ @Override
+ public Item getTabIconItem() {
+ return Item.getItemFromBlock(Blocks.bedrock);
+ }
- @Override
- public Item getTabIconItem() {
- return Item.getItemFromBlock(Blocks.bedrock);
- }
-
@SideOnly(Side.CLIENT)
- @Override
- public int func_151243_f(){
+ @Override
+ public int func_151243_f() {
return 0;
}
-
}
diff --git a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
index 96c809c4da..57fb663d40 100644
--- a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
+++ b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
@@ -4,18 +4,14 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
-import gtPlusPlus.core.item.ModItems;
-
public class MiscUtilCreativeTabMachines extends CreativeTabs {
+ public MiscUtilCreativeTabMachines(final String lable) {
+ super(lable);
+ }
- public MiscUtilCreativeTabMachines(final String lable) {
- super(lable);
- }
-
- @Override
- public Item getTabIconItem() {
- return Items.netherbrick;
- }
-
+ @Override
+ public Item getTabIconItem() {
+ return Items.netherbrick;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
index a67668bbf0..397474065f 100644
--- a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
+++ b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
@@ -4,17 +4,14 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
-import gtPlusPlus.core.item.ModItems;
-
public class MiscUtilCreativeTabMisc extends CreativeTabs {
- public MiscUtilCreativeTabMisc(final String lable) {
- super(lable);
- }
-
- @Override
- public Item getTabIconItem() {
- return Items.painting;
- }
+ public MiscUtilCreativeTabMisc(final String lable) {
+ super(lable);
+ }
+ @Override
+ public Item getTabIconItem() {
+ return Items.painting;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
index afd89346c0..7fb99db6f0 100644
--- a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
+++ b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
@@ -4,17 +4,14 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
-import gtPlusPlus.core.item.ModItems;
-
public class MiscUtilCreativeTabOther extends CreativeTabs {
- public MiscUtilCreativeTabOther(final String lable) {
- super(lable);
- }
-
- @Override
- public Item getTabIconItem() {
- return Items.repeater;
- }
+ public MiscUtilCreativeTabOther(final String lable) {
+ super(lable);
+ }
+ @Override
+ public Item getTabIconItem() {
+ return Items.repeater;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
index ab1ab069de..1c81c6b952 100644
--- a/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
+++ b/src/main/java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
@@ -4,17 +4,14 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
-import gtPlusPlus.core.item.ModItems;
-
public class MiscUtilCreativeTabTools extends CreativeTabs {
- public MiscUtilCreativeTabTools(final String lable) {
- super(lable);
- }
-
- @Override
- public Item getTabIconItem() {
- return Items.diamond_pickaxe;
- }
+ public MiscUtilCreativeTabTools(final String lable) {
+ super(lable);
+ }
+ @Override
+ public Item getTabIconItem() {
+ return Items.diamond_pickaxe;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java b/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java
index 9abd07392d..63d94fafee 100644
--- a/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java
+++ b/src/main/java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java
@@ -1,216 +1,397 @@
package gtPlusPlus.core.entity;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.world.explosions.ExplosionHandler;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.world.explosions.ExplosionHandler;
+public class EntityPrimedMiningExplosive extends EntityTNTPrimed {
+ /** How long the fuse is */
+ private EntityLivingBase tntPlacedBy;
+
+ public EntityPrimedMiningExplosive(final World world) {
+ super(world);
+ this.fuse = 160;
+ this.preventEntitySpawning = true;
+ this.setSize(0.98F, 0.98F);
+ this.yOffset = this.height / 2.0F;
+ }
+
+ public EntityPrimedMiningExplosive(
+ final World world, final double x, final double y, final double z, final EntityLivingBase placingEntity) {
+ this(world);
+ this.setPosition(x, y, z);
+ final float f = (float) (Math.random() * Math.PI * 2.0D);
+ this.motionX = -((float) Math.sin(f)) * 0.02F;
+ this.motionY = 0.20000000298023224D;
+ this.motionZ = -((float) Math.cos(f)) * 0.02F;
+ this.fuse = 160;
+ this.prevPosX = x;
+ this.prevPosY = y;
+ this.prevPosZ = z;
+ this.tntPlacedBy = placingEntity;
+ }
+
+ @Override
+ protected void entityInit() {}
+
+ /**
+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
+ * prevent them from trampling crops
+ */
+ @Override
+ protected boolean canTriggerWalking() {
+ return false;
+ }
+
+ /**
+ * Returns true if other Entities should be prevented from moving through this Entity.
+ */
+ @Override
+ public boolean canBeCollidedWith() {
+ return !this.isDead;
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ @Override
+ public void onUpdate() {
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.motionY -= 0.03999999910593033D;
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ this.motionX *= 0.9800000190734863D;
+ this.motionY *= 0.9800000190734863D;
+ this.motionZ *= 0.9800000190734863D;
+
+ if (this.onGround) {
+ this.motionX *= 0.699999988079071D;
+ this.motionZ *= 0.699999988079071D;
+ this.motionY *= -0.5D;
+ }
+
+ if (this.fuse-- <= 0) {
+ this.setDead();
+
+ if (!this.worldObj.isRemote) {
+ this.explode();
+ }
+ } else {
+
+ int t = MathUtils.randInt(0, 15);
+
+ if (t <= 2) {
+ int e = MathUtils.randInt(0, 3);
+ if (e <= 1) {
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ } else if (e == 2) {
+ this.worldObj.spawnParticle(
+ "explode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "hugeexplosion",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ } else if (t <= 4) {
+ int e = MathUtils.randInt(0, 5);
+ if (e <= 1) {
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ } else if (e == 2) {
+ this.worldObj.spawnParticle(
+ "explode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "hugeexplosion",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ } else if (t <= 6) {
+ int e = MathUtils.randInt(0, 4);
+ if (e <= 1) {
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ } else if (e == 2) {
+ this.worldObj.spawnParticle(
+ "explode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "hugeexplosion",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ } else if (t <= 8) {
+ int e = MathUtils.randInt(0, 1);
+ if (e <= 1) {
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ } else if (e == 2) {
+ this.worldObj.spawnParticle(
+ "explode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "hugeexplosion",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ } else if (t <= 10) {
+ int e = MathUtils.randInt(0, 6);
+ if (e <= 1) {
+ this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ } else if (e >= 2) {
+ this.worldObj.spawnParticle(
+ "explode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "hugeexplosion",
+ this.posX + MathUtils.randDouble(0, 1),
+ this.posY + MathUtils.randDouble(0, 1),
+ this.posZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
+ }
+ }
+
+ private void explode() {
+ final float f = 100.0F;
+
+ ExplosionHandler explode = new ExplosionHandler();
+ explode.createExplosion(this.worldObj, this, this.posX, this.posY, this.posZ, f, false, true);
+
+ /*this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true);
+ this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);
+ this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);
+ this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);
+ this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);*/
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ @Override
+ protected void writeEntityToNBT(final NBTTagCompound tag) {
+ tag.setByte("Fuse", (byte) this.fuse);
+ }
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ @Override
+ protected void readEntityFromNBT(final NBTTagCompound tag) {
+ this.fuse = tag.getByte("Fuse");
+ }
-public class EntityPrimedMiningExplosive extends EntityTNTPrimed
-{
- /** How long the fuse is */
- private EntityLivingBase tntPlacedBy;
-
- public EntityPrimedMiningExplosive(final World world){
- super(world);
- this.fuse = 160;
- this.preventEntitySpawning = true;
- this.setSize(0.98F, 0.98F);
- this.yOffset = this.height / 2.0F;
- }
-
- public EntityPrimedMiningExplosive(final World world, final double x, final double y, final double z, final EntityLivingBase placingEntity)
- {
- this(world);
- this.setPosition(x, y, z);
- final float f = (float)(Math.random() * Math.PI * 2.0D);
- this.motionX = -((float)Math.sin(f)) * 0.02F;
- this.motionY = 0.20000000298023224D;
- this.motionZ = -((float)Math.cos(f)) * 0.02F;
- this.fuse = 160;
- this.prevPosX = x;
- this.prevPosY = y;
- this.prevPosZ = z;
- this.tntPlacedBy = placingEntity;
- }
-
- @Override
- protected void entityInit() {}
-
- /**
- * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
- * prevent them from trampling crops
- */
- @Override
- protected boolean canTriggerWalking()
- {
- return false;
- }
-
- /**
- * Returns true if other Entities should be prevented from moving through this Entity.
- */
- @Override
- public boolean canBeCollidedWith()
- {
- return !this.isDead;
- }
-
- /**
- * Called to update the entity's position/logic.
- */
- @Override
- public void onUpdate()
- {
- this.prevPosX = this.posX;
- this.prevPosY = this.posY;
- this.prevPosZ = this.posZ;
- this.motionY -= 0.03999999910593033D;
- this.moveEntity(this.motionX, this.motionY, this.motionZ);
- this.motionX *= 0.9800000190734863D;
- this.motionY *= 0.9800000190734863D;
- this.motionZ *= 0.9800000190734863D;
-
- if (this.onGround)
- {
- this.motionX *= 0.699999988079071D;
- this.motionZ *= 0.699999988079071D;
- this.motionY *= -0.5D;
- }
-
- if (this.fuse-- <= 0)
- {
- this.setDead();
-
- if (!this.worldObj.isRemote)
- {
- this.explode();
- }
- }
- else
- {
-
- int t = MathUtils.randInt(0, 15);
-
- if (t <= 2){
- int e = MathUtils.randInt(0, 3);
- if (e <= 1){
- this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- }
- else if (e == 2){
- this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
-
- }
- }
- else if (t <= 4){
- int e = MathUtils.randInt(0, 5);
- if (e <= 1){
- this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- }
- else if (e == 2){
- this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
-
- }
- }
- else if (t <= 6){
- int e = MathUtils.randInt(0, 4);
- if (e <= 1){
- this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- }
- else if (e == 2){
- this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
-
- }
- }
- else if (t <= 8){
- int e = MathUtils.randInt(0, 1);
- if (e <= 1){
- this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- }
- else if (e == 2){
- this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
-
- }
- }
- else if (t <= 10){
- int e = MathUtils.randInt(0, 6);
- if (e <= 1){
- this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- }
- else if (e >= 2){
- this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(0, 1), this.posY+MathUtils.randDouble(0, 1), this.posZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
-
- }
- }
-
- }
- }
-
- private void explode()
- {
- final float f = 100.0F;
-
- ExplosionHandler explode = new ExplosionHandler();
- explode.createExplosion(this.worldObj, this, this.posX, this.posY, this.posZ, f, false, true);
-
- /*this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true);
- this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);
- this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);
- this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);
- this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);*/
- }
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- @Override
- protected void writeEntityToNBT(final NBTTagCompound tag)
- {
- tag.setByte("Fuse", (byte)this.fuse);
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- @Override
- protected void readEntityFromNBT(final NBTTagCompound tag)
- {
- this.fuse = tag.getByte("Fuse");
- }
-
- /**
- * returns null or the entityliving it was placed or ignited by
- */
- @Override
- public EntityLivingBase getTntPlacedBy()
- {
- return this.tntPlacedBy;
- }
-} \ No newline at end of file
+ /**
+ * returns null or the entityliving it was placed or ignited by
+ */
+ @Override
+ public EntityLivingBase getTntPlacedBy() {
+ return this.tntPlacedBy;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java b/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java
index ea667b8667..ca4229bec3 100644
--- a/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java
+++ b/src/main/java/gtPlusPlus/core/entity/EntityTeleportFX.java
@@ -2,7 +2,6 @@ package gtPlusPlus.core.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
@@ -11,237 +10,228 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
-public class EntityTeleportFX extends Entity
-{
- /** 'x' location the eye should float towards. */
- private double targetX;
- /** 'y' location the eye should float towards. */
- private double targetY;
- /** 'z' location the eye should float towards. */
- private double targetZ;
- private int despawnTimer;
- private boolean shatterOrDrop;
- private static final String __OBFID = "CL_00001716";
-
- public EntityTeleportFX(final World p_i1757_1_)
- {
- super(p_i1757_1_);
- this.setSize(0.25F, 0.25F);
- }
-
- @Override
- protected void entityInit() {}
-
- /**
- * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
- * length * 64 * renderDistanceWeight Args: distance
- */
- @Override
- @SideOnly(Side.CLIENT)
- public boolean isInRangeToRenderDist(final double p_70112_1_)
- {
- double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
- d1 *= 64.0D;
- return p_70112_1_ < (d1 * d1);
- }
-
- public EntityTeleportFX(final World p_i1758_1_, final double p_i1758_2_, final double p_i1758_4_, final double p_i1758_6_)
- {
- super(p_i1758_1_);
- this.despawnTimer = 0;
- this.setSize(0.25F, 0.25F);
- this.setPosition(p_i1758_2_, p_i1758_4_, p_i1758_6_);
- this.yOffset = 0.0F;
- }
-
- /**
- * The location the eye should float/move towards. Currently used for moving towards the nearest stronghold. Args:
- * strongholdX, strongholdY, strongholdZ
- */
- public void moveTowards(final double p_70220_1_, final int p_70220_3_, final double p_70220_4_)
- {
- final double d2 = p_70220_1_ - this.posX;
- final double d3 = p_70220_4_ - this.posZ;
- final float f = MathHelper.sqrt_double((d2 * d2) + (d3 * d3));
-
- if (f > 12.0F)
- {
- this.targetX = this.posX + ((d2 / f) * 12.0D);
- this.targetZ = this.posZ + ((d3 / f) * 12.0D);
- this.targetY = this.posY + 8.0D;
- }
- else
- {
- this.targetX = p_70220_1_;
- this.targetY = p_70220_3_;
- this.targetZ = p_70220_4_;
- }
-
- this.despawnTimer = 0;
- this.shatterOrDrop = this.rand.nextInt(5) > 0;
- }
-
- /**
- * Sets the velocity to the args. Args: x, y, z
- */
- @Override
- @SideOnly(Side.CLIENT)
- public void setVelocity(final double p_70016_1_, final double p_70016_3_, final double p_70016_5_)
- {
- this.motionX = p_70016_1_;
- this.motionY = p_70016_3_;
- this.motionZ = p_70016_5_;
-
- if ((this.prevRotationPitch == 0.0F) && (this.prevRotationYaw == 0.0F))
- {
- final float f = MathHelper.sqrt_double((p_70016_1_ * p_70016_1_) + (p_70016_5_ * p_70016_5_));
- this.prevRotationYaw = this.rotationYaw = (float)((Math.atan2(p_70016_1_, p_70016_5_) * 180.0D) / Math.PI);
- this.prevRotationPitch = this.rotationPitch = (float)((Math.atan2(p_70016_3_, f) * 180.0D) / Math.PI);
- }
- }
-
- /**
- * Called to update the entity's position/logic.
- */
- @Override
- public void onUpdate()
- {
- this.lastTickPosX = this.posX;
- this.lastTickPosY = this.posY;
- this.lastTickPosZ = this.posZ;
- super.onUpdate();
- this.posX += this.motionX;
- this.posY += this.motionY;
- this.posZ += this.motionZ;
- final float f = MathHelper.sqrt_double((this.motionX * this.motionX) + (this.motionZ * this.motionZ));
- this.rotationYaw = (float)((Math.atan2(this.motionX, this.motionZ) * 180.0D) / Math.PI);
-
- for (this.rotationPitch = (float)((Math.atan2(this.motionY, f) * 180.0D) / Math.PI); (this.rotationPitch - this.prevRotationPitch) < -180.0F; this.prevRotationPitch -= 360.0F)
- {
- ;
- }
-
- while ((this.rotationPitch - this.prevRotationPitch) >= 180.0F)
- {
- this.prevRotationPitch += 360.0F;
- }
-
- while ((this.rotationYaw - this.prevRotationYaw) < -180.0F)
- {
- this.prevRotationYaw -= 360.0F;
- }
-
- while ((this.rotationYaw - this.prevRotationYaw) >= 180.0F)
- {
- this.prevRotationYaw += 360.0F;
- }
-
- this.rotationPitch = this.prevRotationPitch + ((this.rotationPitch - this.prevRotationPitch) * 0.2F);
- this.rotationYaw = this.prevRotationYaw + ((this.rotationYaw - this.prevRotationYaw) * 0.2F);
-
- if (!this.worldObj.isRemote)
- {
- final double d0 = this.targetX - this.posX;
- final double d1 = this.targetZ - this.posZ;
- final float f1 = (float)Math.sqrt((d0 * d0) + (d1 * d1));
- final float f2 = (float)Math.atan2(d1, d0);
- double d2 = f + ((f1 - f) * 0.0025D);
-
- if (f1 < 1.0F)
- {
- d2 *= 0.8D;
- this.motionY *= 0.8D;
- }
-
- this.motionX = Math.cos(f2) * d2;
- this.motionZ = Math.sin(f2) * d2;
-
- if (this.posY < this.targetY)
- {
- this.motionY += (1.0D - this.motionY) * 0.014999999664723873D;
- }
- else
- {
- this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D;
- }
- }
-
- final float f3 = 0.25F;
-
- if (this.isInWater())
- {
- for (int i = 0; i < 4; ++i)
- {
- this.worldObj.spawnParticle("bubble", this.posX - (this.motionX * f3), this.posY - (this.motionY * f3), this.posZ - (this.motionZ * f3), this.motionX, this.motionY, this.motionZ);
- }
- }
- else
- {
- this.worldObj.spawnParticle("portal", ((this.posX - (this.motionX * f3)) + (this.rand.nextDouble() * 0.6D)) - 0.3D, this.posY - (this.motionY * f3) - 0.5D, ((this.posZ - (this.motionZ * f3)) + (this.rand.nextDouble() * 0.6D)) - 0.3D, this.motionX, this.motionY, this.motionZ);
- }
-
- if (!this.worldObj.isRemote)
- {
- this.setPosition(this.posX, this.posY, this.posZ);
- ++this.despawnTimer;
-
- if ((this.despawnTimer > 80) && !this.worldObj.isRemote)
- {
- this.setDead();
-
- if (this.shatterOrDrop)
- {
- this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye)));
- }
- else
- {
- this.worldObj.playAuxSFX(2003, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0);
- }
- }
- }
- }
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- @Override
- public void writeEntityToNBT(final NBTTagCompound p_70014_1_) {}
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- @Override
- public void readEntityFromNBT(final NBTTagCompound p_70037_1_) {}
-
- @Override
- @SideOnly(Side.CLIENT)
- public float getShadowSize()
- {
- return 0.0F;
- }
-
- /**
- * Gets how bright this entity is.
- */
- @Override
- public float getBrightness(final float p_70013_1_)
- {
- return 1.0F;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getBrightnessForRender(final float p_70070_1_)
- {
- return 15728880;
- }
-
- /**
- * If returns false, the item will not inflict any damage against entities.
- */
- @Override
- public boolean canAttackWithItem()
- {
- return false;
- }
-} \ No newline at end of file
+public class EntityTeleportFX extends Entity {
+ /** 'x' location the eye should float towards. */
+ private double targetX;
+ /** 'y' location the eye should float towards. */
+ private double targetY;
+ /** 'z' location the eye should float towards. */
+ private double targetZ;
+
+ private int despawnTimer;
+ private boolean shatterOrDrop;
+ private static final String __OBFID = "CL_00001716";
+
+ public EntityTeleportFX(final World p_i1757_1_) {
+ super(p_i1757_1_);
+ this.setSize(0.25F, 0.25F);
+ }
+
+ @Override
+ protected void entityInit() {}
+
+ /**
+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
+ * length * 64 * renderDistanceWeight Args: distance
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean isInRangeToRenderDist(final double p_70112_1_) {
+ double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
+ d1 *= 64.0D;
+ return p_70112_1_ < (d1 * d1);
+ }
+
+ public EntityTeleportFX(
+ final World p_i1758_1_, final double p_i1758_2_, final double p_i1758_4_, final double p_i1758_6_) {
+ super(p_i1758_1_);
+ this.despawnTimer = 0;
+ this.setSize(0.25F, 0.25F);
+ this.setPosition(p_i1758_2_, p_i1758_4_, p_i1758_6_);
+ this.yOffset = 0.0F;
+ }
+
+ /**
+ * The location the eye should float/move towards. Currently used for moving towards the nearest stronghold. Args:
+ * strongholdX, strongholdY, strongholdZ
+ */
+ public void moveTowards(final double p_70220_1_, final int p_70220_3_, final double p_70220_4_) {
+ final double d2 = p_70220_1_ - this.posX;
+ final double d3 = p_70220_4_ - this.posZ;
+ final float f = MathHelper.sqrt_double((d2 * d2) + (d3 * d3));
+
+ if (f > 12.0F) {
+ this.targetX = this.posX + ((d2 / f) * 12.0D);
+ this.targetZ = this.posZ + ((d3 / f) * 12.0D);
+ this.targetY = this.posY + 8.0D;
+ } else {
+ this.targetX = p_70220_1_;
+ this.targetY = p_70220_3_;
+ this.targetZ = p_70220_4_;
+ }
+
+ this.despawnTimer = 0;
+ this.shatterOrDrop = this.rand.nextInt(5) > 0;
+ }
+
+ /**
+ * Sets the velocity to the args. Args: x, y, z
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void setVelocity(final double p_70016_1_, final double p_70016_3_, final double p_70016_5_) {
+ this.motionX = p_70016_1_;
+ this.motionY = p_70016_3_;
+ this.motionZ = p_70016_5_;
+
+ if ((this.prevRotationPitch == 0.0F) && (this.prevRotationYaw == 0.0F)) {
+ final float f = MathHelper.sqrt_double((p_70016_1_ * p_70016_1_) + (p_70016_5_ * p_70016_5_));
+ this.prevRotationYaw = this.rotationYaw = (float) ((Math.atan2(p_70016_1_, p_70016_5_) * 180.0D) / Math.PI);
+ this.prevRotationPitch = this.rotationPitch = (float) ((Math.atan2(p_70016_3_, f) * 180.0D) / Math.PI);
+ }
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ @Override
+ public void onUpdate() {
+ this.lastTickPosX = this.posX;
+ this.lastTickPosY = this.posY;
+ this.lastTickPosZ = this.posZ;
+ super.onUpdate();
+ this.posX += this.motionX;
+ this.posY += this.motionY;
+ this.posZ += this.motionZ;
+ final float f = MathHelper.sqrt_double((this.motionX * this.motionX) + (this.motionZ * this.motionZ));
+ this.rotationYaw = (float) ((Math.atan2(this.motionX, this.motionZ) * 180.0D) / Math.PI);
+
+ for (this.rotationPitch = (float) ((Math.atan2(this.motionY, f) * 180.0D) / Math.PI);
+ (this.rotationPitch - this.prevRotationPitch) < -180.0F;
+ this.prevRotationPitch -= 360.0F) {
+ ;
+ }
+
+ while ((this.rotationPitch - this.prevRotationPitch) >= 180.0F) {
+ this.prevRotationPitch += 360.0F;
+ }
+
+ while ((this.rotationYaw - this.prevRotationYaw) < -180.0F) {
+ this.prevRotationYaw -= 360.0F;
+ }
+
+ while ((this.rotationYaw - this.prevRotationYaw) >= 180.0F) {
+ this.prevRotationYaw += 360.0F;
+ }
+
+ this.rotationPitch = this.prevRotationPitch + ((this.rotationPitch - this.prevRotationPitch) * 0.2F);
+ this.rotationYaw = this.prevRotationYaw + ((this.rotationYaw - this.prevRotationYaw) * 0.2F);
+
+ if (!this.worldObj.isRemote) {
+ final double d0 = this.targetX - this.posX;
+ final double d1 = this.targetZ - this.posZ;
+ final float f1 = (float) Math.sqrt((d0 * d0) + (d1 * d1));
+ final float f2 = (float) Math.atan2(d1, d0);
+ double d2 = f + ((f1 - f) * 0.0025D);
+
+ if (f1 < 1.0F) {
+ d2 *= 0.8D;
+ this.motionY *= 0.8D;
+ }
+
+ this.motionX = Math.cos(f2) * d2;
+ this.motionZ = Math.sin(f2) * d2;
+
+ if (this.posY < this.targetY) {
+ this.motionY += (1.0D - this.motionY) * 0.014999999664723873D;
+ } else {
+ this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D;
+ }
+ }
+
+ final float f3 = 0.25F;
+
+ if (this.isInWater()) {
+ for (int i = 0; i < 4; ++i) {
+ this.worldObj.spawnParticle(
+ "bubble",
+ this.posX - (this.motionX * f3),
+ this.posY - (this.motionY * f3),
+ this.posZ - (this.motionZ * f3),
+ this.motionX,
+ this.motionY,
+ this.motionZ);
+ }
+ } else {
+ this.worldObj.spawnParticle(
+ "portal",
+ ((this.posX - (this.motionX * f3)) + (this.rand.nextDouble() * 0.6D)) - 0.3D,
+ this.posY - (this.motionY * f3) - 0.5D,
+ ((this.posZ - (this.motionZ * f3)) + (this.rand.nextDouble() * 0.6D)) - 0.3D,
+ this.motionX,
+ this.motionY,
+ this.motionZ);
+ }
+
+ if (!this.worldObj.isRemote) {
+ this.setPosition(this.posX, this.posY, this.posZ);
+ ++this.despawnTimer;
+
+ if ((this.despawnTimer > 80) && !this.worldObj.isRemote) {
+ this.setDead();
+
+ if (this.shatterOrDrop) {
+ this.worldObj.spawnEntityInWorld(new EntityItem(
+ this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye)));
+ } else {
+ this.worldObj.playAuxSFX(
+ 2003,
+ (int) Math.round(this.posX),
+ (int) Math.round(this.posY),
+ (int) Math.round(this.posZ),
+ 0);
+ }
+ }
+ }
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ @Override
+ public void writeEntityToNBT(final NBTTagCompound p_70014_1_) {}
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ @Override
+ public void readEntityFromNBT(final NBTTagCompound p_70037_1_) {}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public float getShadowSize() {
+ return 0.0F;
+ }
+
+ /**
+ * Gets how bright this entity is.
+ */
+ @Override
+ public float getBrightness(final float p_70013_1_) {
+ return 1.0F;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getBrightnessForRender(final float p_70070_1_) {
+ return 15728880;
+ }
+
+ /**
+ * If returns false, the item will not inflict any damage against entities.
+ */
+ @Override
+ public boolean canAttackWithItem() {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java b/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java
index bf629bd147..7d471bff4a 100644
--- a/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java
+++ b/src/main/java/gtPlusPlus/core/entity/EntityTeslaTowerLightning.java
@@ -1,8 +1,12 @@
package gtPlusPlus.core.entity;
+
+import gtPlusPlus.api.damage.DamageTeslaTower;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.random.XSTR;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
import java.util.List;
import java.util.Random;
import java.util.UUID;
-
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.effect.EntityWeatherEffect;
@@ -13,156 +17,157 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;
-import gtPlusPlus.api.damage.DamageTeslaTower;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.random.XSTR;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
-public class EntityTeslaTowerLightning extends EntityWeatherEffect
-{
- /** Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. */
- private int lightningState;
- /** A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt */
- public long boltVertex;
- /** Determines the time before the EntityLightningBolt is destroyed. It is a random integer decremented over time. */
- private int boltLivingTime;
-
- private final UUID boltID;
- private final UUID boltOwnerID;
-
- private final Entity boltValidDamageTarget;
-
-
- public EntityTeslaTowerLightning(World p_i1703_1_, double p_i1703_2_, double p_i1703_4_, double p_i1703_6_, Entity valid, UUID owner)
- {
- super(p_i1703_1_);
- Logger.INFO("Plasma Bolt - Created.");
- Random rand = new XSTR(p_i1703_1_.getSeed());
- this.setLocationAndAngles(p_i1703_2_, p_i1703_4_, p_i1703_6_, 0.0F, 0.0F);
- this.lightningState = 2;
- this.boltVertex = rand.nextLong();
- this.boltLivingTime = (1) + rand.nextInt(3) + 1;
- this.boltValidDamageTarget = valid;
- this.boltID = UUID.randomUUID();
- this.boltOwnerID = owner;
-
- //Puts fires out
- if (!p_i1703_1_.isRemote && p_i1703_1_.getGameRules().getGameRuleBooleanValue("doFireTick") && (p_i1703_1_.difficultySetting == EnumDifficulty.NORMAL || p_i1703_1_.difficultySetting == EnumDifficulty.HARD) && p_i1703_1_.doChunksNearChunkExist(MathHelper.floor_double(p_i1703_2_), MathHelper.floor_double(p_i1703_4_), MathHelper.floor_double(p_i1703_6_), 10))
- {
- Logger.INFO("Plasma Bolt - Putting out fires?.");
- int i = MathHelper.floor_double(p_i1703_2_);
- int j = MathHelper.floor_double(p_i1703_4_);
- int k = MathHelper.floor_double(p_i1703_6_);
-
- if (p_i1703_1_.getBlock(i, j, k).getMaterial() == Material.fire)
- {
- p_i1703_1_.setBlock(i, j, k, Blocks.air);
- }
-
- for (i = 0; i < 4; ++i)
- {
- j = MathHelper.floor_double(p_i1703_2_) + rand.nextInt(3) - 1;
- k = MathHelper.floor_double(p_i1703_4_) + rand.nextInt(3) - 1;
- int l = MathHelper.floor_double(p_i1703_6_) + rand.nextInt(3) - 1;
-
- if (p_i1703_1_.getBlock(j, k, l).getMaterial() == Material.fire)
- {
- p_i1703_1_.setBlock(j, k, l, Blocks.air);
- }
- }
- }
- }
-
- /**
- * Called to update the entity's position/logic.
- */
- public void onUpdate()
- {
- //Logger.INFO("Zap");
- super.onUpdate();
- Logger.INFO("Plasma Bolt - Tick.");
- Random rand = new XSTR(this.worldObj.getSeed());
-
- if (this.lightningState == 2)
- {
- Logger.INFO("Plasma Bolt - Playing Sound.");
- this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + rand.nextFloat() * 0.2F);
- }
- --this.lightningState;
-
-
- if (this.lightningState >= 0)
- {
- Logger.INFO("Plasma Bolt - state >= 0.");
- if (this.worldObj.isRemote)
- {
- Logger.INFO("Plasma Bolt - World is remote, resetting state to 2.");
- this.worldObj.lastLightningBolt = 2;
- }
- else
- {
- Logger.INFO("Plasma Bolt - World is server side.");
- double d0 = 3.0D;
- List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0D + d0, this.posZ + d0));
-
- for (int l = 0; l < list.size(); ++l)
- {
- Entity entity = list.get(l);
- if (this.boltValidDamageTarget.getUniqueID().equals(entity.getUniqueID())){
- if (!entity.getUniqueID().equals(boltOwnerID)){
- Logger.INFO("Plasma Bolt - Hurting Entity.");
- Logger.INFO("Plasma Bolt - "+entity.getCommandSenderName()+".");
- //if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this))
- EntityUtils.doFireDamage(entity, 5);
- EntityUtils.doDamage(entity, new DamageTeslaTower(entity), 20);
- }
- }
- }
-
- }
- }
-
- if (this.lightningState < 0)
- {
- Logger.INFO("Plasma Bolt - state < 0.");
- if (this.boltLivingTime == 0)
- {
- Logger.INFO("Plasma Bolt - setting dead.");
- this.setDead();
- }
- else if (this.lightningState < -rand.nextInt(10))
- {
- Logger.INFO("Plasma Bolt - dunno.");
- --this.boltLivingTime;
- this.lightningState = 1;
- this.boltVertex = rand.nextLong();
- //Puts fires out.
- if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10))
- {
- Logger.INFO("Plasma Bolt - Putting fires out [2].");
- int i = MathHelper.floor_double(this.posX);
- int j = MathHelper.floor_double(this.posY);
- int k = MathHelper.floor_double(this.posZ);
-
- if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.fire)
- {
- this.worldObj.setBlock(i, j, k, Blocks.air);
- }
- }
-
- }
- }
- }
-
- protected void entityInit() {}
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {}
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {}
-} \ No newline at end of file
+public class EntityTeslaTowerLightning extends EntityWeatherEffect {
+ /** Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. */
+ private int lightningState;
+ /** A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt */
+ public long boltVertex;
+ /** Determines the time before the EntityLightningBolt is destroyed. It is a random integer decremented over time. */
+ private int boltLivingTime;
+
+ private final UUID boltID;
+ private final UUID boltOwnerID;
+
+ private final Entity boltValidDamageTarget;
+
+ public EntityTeslaTowerLightning(
+ World p_i1703_1_, double p_i1703_2_, double p_i1703_4_, double p_i1703_6_, Entity valid, UUID owner) {
+ super(p_i1703_1_);
+ Logger.INFO("Plasma Bolt - Created.");
+ Random rand = new XSTR(p_i1703_1_.getSeed());
+ this.setLocationAndAngles(p_i1703_2_, p_i1703_4_, p_i1703_6_, 0.0F, 0.0F);
+ this.lightningState = 2;
+ this.boltVertex = rand.nextLong();
+ this.boltLivingTime = (1) + rand.nextInt(3) + 1;
+ this.boltValidDamageTarget = valid;
+ this.boltID = UUID.randomUUID();
+ this.boltOwnerID = owner;
+
+ // Puts fires out
+ if (!p_i1703_1_.isRemote
+ && p_i1703_1_.getGameRules().getGameRuleBooleanValue("doFireTick")
+ && (p_i1703_1_.difficultySetting == EnumDifficulty.NORMAL
+ || p_i1703_1_.difficultySetting == EnumDifficulty.HARD)
+ && p_i1703_1_.doChunksNearChunkExist(
+ MathHelper.floor_double(p_i1703_2_),
+ MathHelper.floor_double(p_i1703_4_),
+ MathHelper.floor_double(p_i1703_6_),
+ 10)) {
+ Logger.INFO("Plasma Bolt - Putting out fires?.");
+ int i = MathHelper.floor_double(p_i1703_2_);
+ int j = MathHelper.floor_double(p_i1703_4_);
+ int k = MathHelper.floor_double(p_i1703_6_);
+
+ if (p_i1703_1_.getBlock(i, j, k).getMaterial() == Material.fire) {
+ p_i1703_1_.setBlock(i, j, k, Blocks.air);
+ }
+
+ for (i = 0; i < 4; ++i) {
+ j = MathHelper.floor_double(p_i1703_2_) + rand.nextInt(3) - 1;
+ k = MathHelper.floor_double(p_i1703_4_) + rand.nextInt(3) - 1;
+ int l = MathHelper.floor_double(p_i1703_6_) + rand.nextInt(3) - 1;
+
+ if (p_i1703_1_.getBlock(j, k, l).getMaterial() == Material.fire) {
+ p_i1703_1_.setBlock(j, k, l, Blocks.air);
+ }
+ }
+ }
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ public void onUpdate() {
+ // Logger.INFO("Zap");
+ super.onUpdate();
+ Logger.INFO("Plasma Bolt - Tick.");
+ Random rand = new XSTR(this.worldObj.getSeed());
+
+ if (this.lightningState == 2) {
+ Logger.INFO("Plasma Bolt - Playing Sound.");
+ this.worldObj.playSoundEffect(
+ this.posX,
+ this.posY,
+ this.posZ,
+ "ambient.weather.thunder",
+ 10000.0F,
+ 0.8F + rand.nextFloat() * 0.2F);
+ }
+ --this.lightningState;
+
+ if (this.lightningState >= 0) {
+ Logger.INFO("Plasma Bolt - state >= 0.");
+ if (this.worldObj.isRemote) {
+ Logger.INFO("Plasma Bolt - World is remote, resetting state to 2.");
+ this.worldObj.lastLightningBolt = 2;
+ } else {
+ Logger.INFO("Plasma Bolt - World is server side.");
+ double d0 = 3.0D;
+ List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
+ this,
+ AxisAlignedBB.getBoundingBox(
+ this.posX - d0,
+ this.posY - d0,
+ this.posZ - d0,
+ this.posX + d0,
+ this.posY + 6.0D + d0,
+ this.posZ + d0));
+
+ for (int l = 0; l < list.size(); ++l) {
+ Entity entity = list.get(l);
+ if (this.boltValidDamageTarget.getUniqueID().equals(entity.getUniqueID())) {
+ if (!entity.getUniqueID().equals(boltOwnerID)) {
+ Logger.INFO("Plasma Bolt - Hurting Entity.");
+ Logger.INFO("Plasma Bolt - " + entity.getCommandSenderName() + ".");
+ // if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this))
+ EntityUtils.doFireDamage(entity, 5);
+ EntityUtils.doDamage(entity, new DamageTeslaTower(entity), 20);
+ }
+ }
+ }
+ }
+ }
+
+ if (this.lightningState < 0) {
+ Logger.INFO("Plasma Bolt - state < 0.");
+ if (this.boltLivingTime == 0) {
+ Logger.INFO("Plasma Bolt - setting dead.");
+ this.setDead();
+ } else if (this.lightningState < -rand.nextInt(10)) {
+ Logger.INFO("Plasma Bolt - dunno.");
+ --this.boltLivingTime;
+ this.lightningState = 1;
+ this.boltVertex = rand.nextLong();
+ // Puts fires out.
+ if (!this.worldObj.isRemote
+ && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick")
+ && this.worldObj.doChunksNearChunkExist(
+ MathHelper.floor_double(this.posX),
+ MathHelper.floor_double(this.posY),
+ MathHelper.floor_double(this.posZ),
+ 10)) {
+ Logger.INFO("Plasma Bolt - Putting fires out [2].");
+ int i = MathHelper.floor_double(this.posX);
+ int j = MathHelper.floor_double(this.posY);
+ int k = MathHelper.floor_double(this.posZ);
+
+ if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.fire) {
+ this.worldObj.setBlock(i, j, k, Blocks.air);
+ }
+ }
+ }
+ }
+ }
+
+ protected void entityInit() {}
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {}
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {}
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java
index 6b88d5775c..fcfcbc0b68 100644
--- a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java
+++ b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java
@@ -1,7 +1,6 @@
package gtPlusPlus.core.entity;
import cpw.mods.fml.common.registry.EntityRegistry;
-
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.australia.entity.type.EntityAustralianSpiderBase;
@@ -22,75 +21,110 @@ import gtPlusPlus.core.util.Utils;
public class InternalEntityRegistry {
- static int mEntityID = 0;
-
- public static void registerEntities(){
- Logger.INFO("Registering GT++ Entities.");
-
- //EntityRegistry.registerGlobalEntityID(EntityPrimedMiningExplosive.class, "MiningCharge", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 0, 0), Utils.rgbtoHexValue(125, 125, 125));
- EntityRegistry.registerModEntity(EntityPrimedMiningExplosive.class, "MiningCharge", mEntityID++, GTplusplus.instance, 64, 20, true);
-
- //EntityRegistry.registerGlobalEntityID(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(200, 0, 200), Utils.rgbtoHexValue(125, 125, 125));
- EntityRegistry.registerModEntity(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", mEntityID++, GTplusplus.instance, 64, 20, true);
-
-
- //EntityRegistry.registerGlobalEntityID(EntityHydrofluoricAcidPotion.class, "throwablePotionHydrofluoric", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 0, 0), Utils.rgbtoHexValue(255, 255, 255));
- EntityRegistry.registerModEntity(EntityHydrofluoricAcidPotion.class, "throwablePotionHydrofluoric", mEntityID++, GTplusplus.instance, 64, 20, true);
-
-
- //EntityRegistry.registerGlobalEntityID(EntityToxinballSmall.class, "toxinBall", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 25, 0), Utils.rgbtoHexValue(0, 125, 0));
- EntityRegistry.registerModEntity(EntityToxinballSmall.class, "toxinBall", mEntityID++, GTplusplus.instance, 64, 20, true);
-
-
- //EntityRegistry.registerGlobalEntityID(EntityStaballoyConstruct.class, "constructStaballoy", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 75, 0), Utils.rgbtoHexValue(50, 220, 50));
- EntityRegistry.registerModEntity(EntityStaballoyConstruct.class, "constructStaballoy", mEntityID++, GTplusplus.instance, 64, 20, true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(0, "constructStaballoy", Utils.rgbtoHexValue(20, 200, 20), Utils.rgbtoHexValue(20, 20, 20));
-
- //EntityRegistry.registerGlobalEntityID(EntitySickBlaze.class, "sickBlaze", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 75, 0), Utils.rgbtoHexValue(75, 175, 75));
- EntityRegistry.registerModEntity(EntitySickBlaze.class, "sickBlaze", mEntityID++, GTplusplus.instance, 64, 20, true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(1, "sickBlaze", Utils.rgbtoHexValue(40, 180, 40), Utils.rgbtoHexValue(75, 75, 75));
-
- //EntityRegistry.registerGlobalEntityID(EntityTeslaTowerLightning.class, "plasmaBolt", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(125, 125, 125));
- EntityRegistry.registerModEntity(EntityTeslaTowerLightning.class, "plasmaBolt", mEntityID++, GTplusplus.instance, 64, 5, true);
-
- EntityRegistry.registerModEntity(EntityThrowableBomb.class, "EntityThrowableBomb", mEntityID++, GTplusplus.instance, 64, 10, true);
-
- EntityRegistry.registerModEntity(EntityLightningAttack.class, "EntityLightningAttack", mEntityID++, GTplusplus.instance, 64, 20, true);
-
+ static int mEntityID = 0;
+
+ public static void registerEntities() {
+ Logger.INFO("Registering GT++ Entities.");
+
+ // EntityRegistry.registerGlobalEntityID(EntityPrimedMiningExplosive.class, "MiningCharge",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 0, 0), Utils.rgbtoHexValue(125, 125, 125));
+ EntityRegistry.registerModEntity(
+ EntityPrimedMiningExplosive.class, "MiningCharge", mEntityID++, GTplusplus.instance, 64, 20, true);
+
+ // EntityRegistry.registerGlobalEntityID(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(200, 0, 200), Utils.rgbtoHexValue(125, 125,
+ // 125));
+ EntityRegistry.registerModEntity(
+ EntitySulfuricAcidPotion.class,
+ "throwablePotionSulfuric",
+ mEntityID++,
+ GTplusplus.instance,
+ 64,
+ 20,
+ true);
+
+ // EntityRegistry.registerGlobalEntityID(EntityHydrofluoricAcidPotion.class, "throwablePotionHydrofluoric",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 0, 0), Utils.rgbtoHexValue(255, 255, 255));
+ EntityRegistry.registerModEntity(
+ EntityHydrofluoricAcidPotion.class,
+ "throwablePotionHydrofluoric",
+ mEntityID++,
+ GTplusplus.instance,
+ 64,
+ 20,
+ true);
+
+ // EntityRegistry.registerGlobalEntityID(EntityToxinballSmall.class, "toxinBall",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 25, 0), Utils.rgbtoHexValue(0, 125, 0));
+ EntityRegistry.registerModEntity(
+ EntityToxinballSmall.class, "toxinBall", mEntityID++, GTplusplus.instance, 64, 20, true);
+
+ // EntityRegistry.registerGlobalEntityID(EntityStaballoyConstruct.class, "constructStaballoy",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 75, 0), Utils.rgbtoHexValue(50, 220, 50));
+ EntityRegistry.registerModEntity(
+ EntityStaballoyConstruct.class, "constructStaballoy", mEntityID++, GTplusplus.instance, 64, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(
+ 0, "constructStaballoy", Utils.rgbtoHexValue(20, 200, 20), Utils.rgbtoHexValue(20, 20, 20));
+
+ // EntityRegistry.registerGlobalEntityID(EntitySickBlaze.class, "sickBlaze",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 75, 0), Utils.rgbtoHexValue(75, 175, 75));
+ EntityRegistry.registerModEntity(
+ EntitySickBlaze.class, "sickBlaze", mEntityID++, GTplusplus.instance, 64, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(
+ 1, "sickBlaze", Utils.rgbtoHexValue(40, 180, 40), Utils.rgbtoHexValue(75, 75, 75));
+
+ // EntityRegistry.registerGlobalEntityID(EntityTeslaTowerLightning.class, "plasmaBolt",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(125, 125,
+ // 125));
+ EntityRegistry.registerModEntity(
+ EntityTeslaTowerLightning.class, "plasmaBolt", mEntityID++, GTplusplus.instance, 64, 5, true);
+
+ EntityRegistry.registerModEntity(
+ EntityThrowableBomb.class, "EntityThrowableBomb", mEntityID++, GTplusplus.instance, 64, 10, true);
+
+ EntityRegistry.registerModEntity(
+ EntityLightningAttack.class, "EntityLightningAttack", mEntityID++, GTplusplus.instance, 64, 20, true);
+
/**
* Globals, which generate spawn eggs. (Currently required for Giant chicken spawning)
*/
-
- EntityRegistry.registerModEntity(EntityGiantChickenBase.class, "bigChickenFriendly", mEntityID++, GTplusplus.instance, 64, 20, true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(2, "bigChickenFriendly", Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
- EntityRegistry.registerModEntity(EntityBatKing.class, "batKing", mEntityID++, GTplusplus.instance, 64, 20, true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(3, "batKing", Utils.rgbtoHexValue(175, 175, 0), Utils.rgbtoHexValue(0, 175, 175));
- //EntityRegistry.registerModEntity(EntityGiantChickenBase.class, "bigChickenFriendly", mEntityID++, GTplusplus.instance, 64, 20, true);
-
-
-
-
-
- //Australia
- EntityRegistry.registerModEntity(EntityAustralianSpiderBase.class, "AusSpider", mEntityID++, GTplusplus.instance, 64, 20, true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(30, "AusSpider", Utils.rgbtoHexValue(125, 0, 125), Utils.rgbtoHexValue(175, 175, 175));
+ EntityRegistry.registerModEntity(
+ EntityGiantChickenBase.class, "bigChickenFriendly", mEntityID++, GTplusplus.instance, 64, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(
+ 2, "bigChickenFriendly", Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
+ EntityRegistry.registerModEntity(
+ EntityBatKing.class, "batKing", mEntityID++, GTplusplus.instance, 64, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(
+ 3, "batKing", Utils.rgbtoHexValue(175, 175, 0), Utils.rgbtoHexValue(0, 175, 175));
+ // EntityRegistry.registerModEntity(EntityGiantChickenBase.class, "bigChickenFriendly", mEntityID++,
+ // GTplusplus.instance, 64, 20, true);
+
+ // Australia
+ EntityRegistry.registerModEntity(
+ EntityAustralianSpiderBase.class, "AusSpider", mEntityID++, GTplusplus.instance, 64, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(
+ 30, "AusSpider", Utils.rgbtoHexValue(125, 0, 125), Utils.rgbtoHexValue(175, 175, 175));
EntityRegistry.registerModEntity(EntityBoar.class, "AusBoar", mEntityID++, GTplusplus.instance, 64, 20, true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(31, "AusBoar", Utils.rgbtoHexValue(75, 75, 0), Utils.rgbtoHexValue(175, 175, 75));
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(
+ 31, "AusBoar", Utils.rgbtoHexValue(75, 75, 0), Utils.rgbtoHexValue(175, 175, 75));
EntityRegistry.registerModEntity(EntityDingo.class, "AusDingo", mEntityID++, GTplusplus.instance, 64, 20, true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(32, "AusDingo", Utils.rgbtoHexValue(175, 125, 0), Utils.rgbtoHexValue(175, 75, 175));
- EntityRegistry.registerModEntity(EntityOctopus.class, "AusOctopus", mEntityID++, GTplusplus.instance, 32, 20, true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(33, "AusOctopus", Utils.rgbtoHexValue(150, 50, 150), Utils.rgbtoHexValue(75, 175, 175));
- //EntityRegistry.registerGlobalEntityID(EntityAustralianSpiderBase.class, "AusSpider", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
- //EntityRegistry.registerGlobalEntityID(EntityBoar.class, "AusBoar", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
- //EntityRegistry.registerGlobalEntityID(EntityDingo.class, "AusDingo", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
- //EntityRegistry.registerGlobalEntityID(EntityOctopus.class, "AusOctopus", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
-
-
-
-
-
-
-
- }
-
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(
+ 32, "AusDingo", Utils.rgbtoHexValue(175, 125, 0), Utils.rgbtoHexValue(175, 75, 175));
+ EntityRegistry.registerModEntity(
+ EntityOctopus.class, "AusOctopus", mEntityID++, GTplusplus.instance, 32, 20, true);
+ ItemCustomSpawnEgg.registerEntityForSpawnEgg(
+ 33, "AusOctopus", Utils.rgbtoHexValue(150, 50, 150), Utils.rgbtoHexValue(75, 175, 175));
+ // EntityRegistry.registerGlobalEntityID(EntityAustralianSpiderBase.class, "AusSpider",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175,
+ // 175));
+ // EntityRegistry.registerGlobalEntityID(EntityBoar.class, "AusBoar", EntityRegistry.findGlobalUniqueEntityId(),
+ // Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175));
+ // EntityRegistry.registerGlobalEntityID(EntityDingo.class, "AusDingo",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175,
+ // 175));
+ // EntityRegistry.registerGlobalEntityID(EntityOctopus.class, "AusOctopus",
+ // EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175,
+ // 175));
+
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java b/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java
index 52d1d6100c..810c3eadff 100644
--- a/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java
+++ b/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java
@@ -13,394 +13,422 @@ import net.minecraft.util.MathHelper;
public class EntityAIBatKingAttack extends EntityAIBase {
- private final Ranged mRangedAI;
- private final Melee mMeleeAI;
- private boolean mIsMelee = false;
-
- /** The Bat King in control of this AI. */
- private final EntityBatKing mAttackingEntity;
-
- /** The PathEntity of our entity. */
- private PathEntity mEntityPathEntity;
-
- /** The current target of Bat King in control of this AI. */
- private EntityLivingBase mEntityTarget;
-
- private final Class mClassTarget;
-
- public EntityAIBatKingAttack(EntityBatKing aAttacker, Class aClassTarget,
- double aMovementSpeed, int someInt, int aMaxRangedAttackTime, float someFloat, boolean aLongMemory) {
- mRangedAI = new Ranged(this, aMovementSpeed, someInt, 5, someFloat);
- mMeleeAI = new Melee(this, aClassTarget, aMovementSpeed, aLongMemory);
- mAttackingEntity = aAttacker;
- mClassTarget = aClassTarget;
- }
-
- @Override
- public boolean shouldExecute() {
- determineCombatStyle();
- EntityLivingBase entitylivingbase = this.mAttackingEntity.getAttackTarget();
- if (entitylivingbase == null) {
- this.mEntityTarget = null;
- return false;
- } else if (!entitylivingbase.isEntityAlive()) {
- return false;
- } else if (this.mClassTarget != null && !this.mClassTarget.isAssignableFrom(entitylivingbase.getClass())) {
- return false;
- } else {
- if (this.mIsMelee) {
- return this.mMeleeAI.shouldExecute();
- }
- else {
- this.mEntityTarget = entitylivingbase;
- this.mEntityPathEntity = this.mAttackingEntity.getNavigator().getPathToEntityLiving(entitylivingbase);
- return mRangedAI != null && mMeleeAI != null && hasValidTarget();
- }
- }
- }
-
- public EntityBatKing getBatKing() {
- return this.mAttackingEntity;
- }
-
- public IRangedAttackMob getBatKingAsIRangedAttackMob() {
- return this.mAttackingEntity;
- }
-
- public boolean hasValidTarget() {
- return this.mEntityTarget != null;
- }
-
- public EntityLivingBase getTarget() {
- return mEntityTarget;
- }
-
- @Override
- public boolean continueExecuting() {
- determineCombatStyle();
- if (mIsMelee) {
- return mMeleeAI.continueExecuting();
- } else {
- return mRangedAI.continueExecuting();
- }
- }
-
- @Override
- public boolean isInterruptible() {
- if (mIsMelee) {
-
- } else {
-
- }
- return super.isInterruptible();
- }
-
- @Override
- public void startExecuting() {
- determineCombatStyle();
- if (mIsMelee) {
- mMeleeAI.startExecuting();
- } else {
- mRangedAI.startExecuting();
- }
- }
-
- @Override
- public void resetTask() {
- determineCombatStyle();
- if (mIsMelee) {
- mMeleeAI.resetTask();
- } else {
- mRangedAI.resetTask();
- }
- }
-
- @Override
- public void updateTask() {
- determineCombatStyle();
- if (mIsMelee) {
- mMeleeAI.updateTask();
- } else {
- mRangedAI.updateTask();
- }
- }
-
-
- private final void determineCombatStyle() {
- boolean aisMeleeNow = this.mIsMelee;
- if (this.mEntityTarget != null && EntityUtils.getDistance(getBatKing(), mEntityTarget) < 4) {
- this.mIsMelee = true;
- }
- else {
- this.mIsMelee = false;
- }
- if (aisMeleeNow != this.mIsMelee) {
- Logger.INFO("Bat King changed combat style from "+(aisMeleeNow ? "Melee" : "Ranged")+" to "+(this.mIsMelee ? "Melee" : "Ranged"));
- }
- }
-
- private class Ranged {
-
- private final EntityAIBatKingAttack parentAI;
-
- /**
- * A decrementing tick that spawns a ranged attack once this value reaches 0. It
- * is then set back to the maxRangedAttackTime.
- */
- private int rangedAttackTime;
- private double entityMoveSpeed;
- private int mCooldownTime;
- private int field_96561_g;
- /**
- * The maximum time the AI has to wait before performing another ranged attack.
- */
- private int maxRangedAttackTime;
- private float field_96562_i;
- private float field_82642_h; //Max range
-
- public Ranged(EntityAIBatKingAttack aParent, double aMovementSpeed, int someInt,
- int aMaxRangedAttackTime, float someFloat) {
- this.rangedAttackTime = -1;
- this.parentAI = aParent;
- this.entityMoveSpeed = aMovementSpeed;
- this.field_96561_g = someInt;
- this.maxRangedAttackTime = aMaxRangedAttackTime;
- this.field_96562_i = someFloat;
- this.field_82642_h = someFloat * someFloat * 8;
- parentAI.setMutexBits(3);
-
- }
-
- /**
- * Execute a one shot task or start executing a continuous task
- */
- public void startExecuting() {
- parentAI.getBatKing().getNavigator().setPath(parentAI.mEntityPathEntity, this.entityMoveSpeed);
- }
-
- /**
- * Returns whether an in-progress EntityAIBase should continue executing
- */
- public boolean continueExecuting() {
- return parentAI.shouldExecute() || !parentAI.getBatKing().getNavigator().noPath();
- }
-
- /**
- * Resets the task
- */
- public void resetTask() {
- parentAI.mEntityTarget = null;
- this.mCooldownTime = 0;
- this.rangedAttackTime = -1;
- }
-
- /**
- * Updates the task
- */
- public void updateTask() {
-
- if (MathUtils.randInt(0, 100) == 0) {
- maxRangedAttackTime = MathUtils.balance(maxRangedAttackTime, 20, 40);
- }
-
- double d0 = parentAI.getBatKing().getDistanceSq(parentAI.mEntityTarget.posX, parentAI.mEntityTarget.boundingBox.minY,
- parentAI.mEntityTarget.posZ);
- boolean flag = parentAI.getBatKing().getEntitySenses().canSee(parentAI.mEntityTarget);
-
- if (flag) {
- ++this.mCooldownTime;
- } else {
- this.mCooldownTime = 0;
- }
-
- if (d0 <= (double) this.field_82642_h && this.mCooldownTime >= 20) {
- parentAI.getBatKing().getNavigator().clearPathEntity();
- } else {
- if (parentAI.getBatKing().getNavigator().tryMoveToEntityLiving(parentAI.mEntityTarget, this.entityMoveSpeed)) {
- Logger.INFO("Doing Ranged Ai Task.");
- }
- else {
- Logger.INFO("Not Doing Ranged Ai Task.");
- }
- }
-
- parentAI.getBatKing().getLookHelper().setLookPositionWithEntity(parentAI.mEntityTarget, 30.0F, 30.0F);
- float f;
- Logger.INFO("Ranged AI - "+rangedAttackTime);
-
- if (--this.rangedAttackTime == 0) {
- if (d0 > (double) this.field_82642_h || !flag) {
- Logger.INFO("Stopping ranged attack. "+flag+"|"+(d0 > (double) this.field_82642_h)+"|"+d0+"|"+(double) this.field_82642_h);
- return;
- }
-
- f = MathHelper.sqrt_double(d0) / this.field_96562_i;
- float f1 = f;
-
- if (f < 0.1F) {
- f1 = 0.1F;
- }
-
- if (f1 > 1.0F) {
- f1 = 1.0F;
- }
- Logger.INFO("Trying to do a ranged attack.");
- parentAI.getBatKingAsIRangedAttackMob().attackEntityWithRangedAttack(parentAI.mEntityTarget, f1);
- this.rangedAttackTime = MathHelper.floor_float(
- f * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g);
- } else if (this.rangedAttackTime < 0) {
- f = MathHelper.sqrt_double(d0) / this.field_96562_i;
- this.rangedAttackTime = MathHelper.floor_float(
- f * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g);
- }
- }
-
- }
-
- private class Melee {
-
- private final EntityAIBatKingAttack parentAI;
-
- /**
- * An amount of decrementing ticks that allows the entity to attack once the
- * tick reaches 0.
- */
- int attackTick;
- /** The speed with which the mob will approach the target */
- double speedTowardsTarget;
- /**
- * When true, the mob will continue chasing its target, even if it can't find a
- * path to them right now.
- */
- boolean longMemory;
- Class classTarget;
- private int field_75445_i;
- private double field_151497_i;
- private double field_151495_j;
- private double field_151496_k;
-
- private int failedPathFindingPenalty;
-
- public Melee(EntityAIBatKingAttack aParent, Class aClassTarget,
- double aMoveToTargetSpeed, boolean aLongMemory) {
- this.parentAI = aParent;
- this.classTarget = aClassTarget;
- this.speedTowardsTarget = aMoveToTargetSpeed;
- this.longMemory = aLongMemory;
- parentAI.setMutexBits(3);
- }
-
- /**
- * Returns whether the EntityAIBase should begin execution.
- */
- public boolean shouldExecute() {
- if (!parentAI.hasValidTarget()) {
- return false;
- }
- EntityLivingBase entitylivingbase = parentAI.getTarget();
-
- if (entitylivingbase == null) {
- return false;
- } else if (!entitylivingbase.isEntityAlive()) {
- return false;
- } else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) {
- return false;
- } else {
- if (--this.field_75445_i <= 0) {
- parentAI.mEntityPathEntity = parentAI.mAttackingEntity.getNavigator().getPathToEntityLiving(entitylivingbase);
- this.field_75445_i = 4 + parentAI.mAttackingEntity.getRNG().nextInt(7);
- return parentAI.mEntityPathEntity != null;
- } else {
- return true;
- }
- }
- }
-
- /**
- * Returns whether an in-progress EntityAIBase should continue executing
- */
- public boolean continueExecuting() {
- EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget();
- return entitylivingbase == null ? false
- : (!entitylivingbase.isEntityAlive() ? false
- : (!this.longMemory ? !parentAI.mAttackingEntity.getNavigator().noPath()
- : parentAI.mAttackingEntity.isWithinHomeDistance(MathHelper.floor_double(entitylivingbase.posX),
- MathHelper.floor_double(entitylivingbase.posY),
- MathHelper.floor_double(entitylivingbase.posZ))));
- }
-
- /**
- * Execute a one shot task or start executing a continuous task
- */
- public void startExecuting() {
- parentAI.mAttackingEntity.getNavigator().setPath(parentAI.mEntityPathEntity, this.speedTowardsTarget);
- this.field_75445_i = 0;
- }
-
- /**
- * Resets the task
- */
- public void resetTask() {
- parentAI.mAttackingEntity.getNavigator().clearPathEntity();
- }
-
- /**
- * Updates the task
- */
- public void updateTask() {
- EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget();
- parentAI.mAttackingEntity.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F);
- double d0 = parentAI.mAttackingEntity.getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY,
- entitylivingbase.posZ);
- double d1 = (double) (parentAI.mAttackingEntity.width * 2.0F * parentAI.mAttackingEntity.width * 2.0F + entitylivingbase.width);
- --this.field_75445_i;
-
- if ((this.longMemory || parentAI.mAttackingEntity.getEntitySenses().canSee(entitylivingbase)) && this.field_75445_i <= 0
- && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D
- || entitylivingbase.getDistanceSq(this.field_151497_i, this.field_151495_j,
- this.field_151496_k) >= 1.0D
- || parentAI.mAttackingEntity.getRNG().nextFloat() < 0.05F)) {
- this.field_151497_i = entitylivingbase.posX;
- this.field_151495_j = entitylivingbase.boundingBox.minY;
- this.field_151496_k = entitylivingbase.posZ;
- this.field_75445_i = failedPathFindingPenalty + 4 + parentAI.mAttackingEntity.getRNG().nextInt(7);
-
- if (parentAI.mAttackingEntity.getNavigator().getPath() != null) {
- PathPoint finalPathPoint = parentAI.mAttackingEntity.getNavigator().getPath().getFinalPathPoint();
- if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord,
- finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) {
- failedPathFindingPenalty = 0;
- } else {
- failedPathFindingPenalty += 10;
- }
- } else {
- failedPathFindingPenalty += 10;
- }
-
- if (d0 > 1024.0D) {
- this.field_75445_i += 10;
- } else if (d0 > 256.0D) {
- this.field_75445_i += 5;
- }
-
- if (!parentAI.mAttackingEntity.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) {
- this.field_75445_i += 15;
- }
- }
-
- this.attackTick = Math.max(this.attackTick - 1, 0);
-
- if (d0 <= d1 && this.attackTick <= 20) {
- this.attackTick = 20;
-
- if (parentAI.mAttackingEntity.getHeldItem() != null) {
- parentAI.mAttackingEntity.swingItem();
- }
-
- parentAI.mAttackingEntity.attackEntityAsMob(entitylivingbase);
- }
- }
-
- }
-
-} \ No newline at end of file
+ private final Ranged mRangedAI;
+ private final Melee mMeleeAI;
+ private boolean mIsMelee = false;
+
+ /** The Bat King in control of this AI. */
+ private final EntityBatKing mAttackingEntity;
+
+ /** The PathEntity of our entity. */
+ private PathEntity mEntityPathEntity;
+
+ /** The current target of Bat King in control of this AI. */
+ private EntityLivingBase mEntityTarget;
+
+ private final Class mClassTarget;
+
+ public EntityAIBatKingAttack(
+ EntityBatKing aAttacker,
+ Class aClassTarget,
+ double aMovementSpeed,
+ int someInt,
+ int aMaxRangedAttackTime,
+ float someFloat,
+ boolean aLongMemory) {
+ mRangedAI = new Ranged(this, aMovementSpeed, someInt, 5, someFloat);
+ mMeleeAI = new Melee(this, aClassTarget, aMovementSpeed, aLongMemory);
+ mAttackingEntity = aAttacker;
+ mClassTarget = aClassTarget;
+ }
+
+ @Override
+ public boolean shouldExecute() {
+ determineCombatStyle();
+ EntityLivingBase entitylivingbase = this.mAttackingEntity.getAttackTarget();
+ if (entitylivingbase == null) {
+ this.mEntityTarget = null;
+ return false;
+ } else if (!entitylivingbase.isEntityAlive()) {
+ return false;
+ } else if (this.mClassTarget != null && !this.mClassTarget.isAssignableFrom(entitylivingbase.getClass())) {
+ return false;
+ } else {
+ if (this.mIsMelee) {
+ return this.mMeleeAI.shouldExecute();
+ } else {
+ this.mEntityTarget = entitylivingbase;
+ this.mEntityPathEntity = this.mAttackingEntity.getNavigator().getPathToEntityLiving(entitylivingbase);
+ return mRangedAI != null && mMeleeAI != null && hasValidTarget();
+ }
+ }
+ }
+
+ public EntityBatKing getBatKing() {
+ return this.mAttackingEntity;
+ }
+
+ public IRangedAttackMob getBatKingAsIRangedAttackMob() {
+ return this.mAttackingEntity;
+ }
+
+ public boolean hasValidTarget() {
+ return this.mEntityTarget != null;
+ }
+
+ public EntityLivingBase getTarget() {
+ return mEntityTarget;
+ }
+
+ @Override
+ public boolean continueExecuting() {
+ determineCombatStyle();
+ if (mIsMelee) {
+ return mMeleeAI.continueExecuting();
+ } else {
+ return mRangedAI.continueExecuting();
+ }
+ }
+
+ @Override
+ public boolean isInterruptible() {
+ if (mIsMelee) {
+
+ } else {
+
+ }
+ return super.isInterruptible();
+ }
+
+ @Override
+ public void startExecuting() {
+ determineCombatStyle();
+ if (mIsMelee) {
+ mMeleeAI.startExecuting();
+ } else {
+ mRangedAI.startExecuting();
+ }
+ }
+
+ @Override
+ public void resetTask() {
+ determineCombatStyle();
+ if (mIsMelee) {
+ mMeleeAI.resetTask();
+ } else {
+ mRangedAI.resetTask();
+ }
+ }
+
+ @Override
+ public void updateTask() {
+ determineCombatStyle();
+ if (mIsMelee) {
+ mMeleeAI.updateTask();
+ } else {
+ mRangedAI.updateTask();
+ }
+ }
+
+ private final void determineCombatStyle() {
+ boolean aisMeleeNow = this.mIsMelee;
+ if (this.mEntityTarget != null && EntityUtils.getDistance(getBatKing(), mEntityTarget) < 4) {
+ this.mIsMelee = true;
+ } else {
+ this.mIsMelee = false;
+ }
+ if (aisMeleeNow != this.mIsMelee) {
+ Logger.INFO("Bat King changed combat style from " + (aisMeleeNow ? "Melee" : "Ranged") + " to "
+ + (this.mIsMelee ? "Melee" : "Ranged"));
+ }
+ }
+
+ private class Ranged {
+
+ private final EntityAIBatKingAttack parentAI;
+
+ /**
+ * A decrementing tick that spawns a ranged attack once this value reaches 0. It
+ * is then set back to the maxRangedAttackTime.
+ */
+ private int rangedAttackTime;
+
+ private double entityMoveSpeed;
+ private int mCooldownTime;
+ private int field_96561_g;
+ /**
+ * The maximum time the AI has to wait before performing another ranged attack.
+ */
+ private int maxRangedAttackTime;
+
+ private float field_96562_i;
+ private float field_82642_h; // Max range
+
+ public Ranged(
+ EntityAIBatKingAttack aParent,
+ double aMovementSpeed,
+ int someInt,
+ int aMaxRangedAttackTime,
+ float someFloat) {
+ this.rangedAttackTime = -1;
+ this.parentAI = aParent;
+ this.entityMoveSpeed = aMovementSpeed;
+ this.field_96561_g = someInt;
+ this.maxRangedAttackTime = aMaxRangedAttackTime;
+ this.field_96562_i = someFloat;
+ this.field_82642_h = someFloat * someFloat * 8;
+ parentAI.setMutexBits(3);
+ }
+
+ /**
+ * Execute a one shot task or start executing a continuous task
+ */
+ public void startExecuting() {
+ parentAI.getBatKing().getNavigator().setPath(parentAI.mEntityPathEntity, this.entityMoveSpeed);
+ }
+
+ /**
+ * Returns whether an in-progress EntityAIBase should continue executing
+ */
+ public boolean continueExecuting() {
+ return parentAI.shouldExecute()
+ || !parentAI.getBatKing().getNavigator().noPath();
+ }
+
+ /**
+ * Resets the task
+ */
+ public void resetTask() {
+ parentAI.mEntityTarget = null;
+ this.mCooldownTime = 0;
+ this.rangedAttackTime = -1;
+ }
+
+ /**
+ * Updates the task
+ */
+ public void updateTask() {
+
+ if (MathUtils.randInt(0, 100) == 0) {
+ maxRangedAttackTime = MathUtils.balance(maxRangedAttackTime, 20, 40);
+ }
+
+ double d0 = parentAI.getBatKing()
+ .getDistanceSq(
+ parentAI.mEntityTarget.posX,
+ parentAI.mEntityTarget.boundingBox.minY,
+ parentAI.mEntityTarget.posZ);
+ boolean flag = parentAI.getBatKing().getEntitySenses().canSee(parentAI.mEntityTarget);
+
+ if (flag) {
+ ++this.mCooldownTime;
+ } else {
+ this.mCooldownTime = 0;
+ }
+
+ if (d0 <= (double) this.field_82642_h && this.mCooldownTime >= 20) {
+ parentAI.getBatKing().getNavigator().clearPathEntity();
+ } else {
+ if (parentAI.getBatKing()
+ .getNavigator()
+ .tryMoveToEntityLiving(parentAI.mEntityTarget, this.entityMoveSpeed)) {
+ Logger.INFO("Doing Ranged Ai Task.");
+ } else {
+ Logger.INFO("Not Doing Ranged Ai Task.");
+ }
+ }
+
+ parentAI.getBatKing().getLookHelper().setLookPositionWithEntity(parentAI.mEntityTarget, 30.0F, 30.0F);
+ float f;
+ Logger.INFO("Ranged AI - " + rangedAttackTime);
+
+ if (--this.rangedAttackTime == 0) {
+ if (d0 > (double) this.field_82642_h || !flag) {
+ Logger.INFO("Stopping ranged attack. " + flag + "|" + (d0 > (double) this.field_82642_h) + "|" + d0
+ + "|" + (double) this.field_82642_h);
+ return;
+ }
+
+ f = MathHelper.sqrt_double(d0) / this.field_96562_i;
+ float f1 = f;
+
+ if (f < 0.1F) {
+ f1 = 0.1F;
+ }
+
+ if (f1 > 1.0F) {
+ f1 = 1.0F;
+ }
+ Logger.INFO("Trying to do a ranged attack.");
+ parentAI.getBatKingAsIRangedAttackMob().attackEntityWithRangedAttack(parentAI.mEntityTarget, f1);
+ this.rangedAttackTime = MathHelper.floor_float(
+ f * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g);
+ } else if (this.rangedAttackTime < 0) {
+ f = MathHelper.sqrt_double(d0) / this.field_96562_i;
+ this.rangedAttackTime = MathHelper.floor_float(
+ f * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g);
+ }
+ }
+ }
+
+ private class Melee {
+
+ private final EntityAIBatKingAttack parentAI;
+
+ /**
+ * An amount of decrementing ticks that allows the entity to attack once the
+ * tick reaches 0.
+ */
+ int attackTick;
+ /** The speed with which the mob will approach the target */
+ double speedTowardsTarget;
+ /**
+ * When true, the mob will continue chasing its target, even if it can't find a
+ * path to them right now.
+ */
+ boolean longMemory;
+
+ Class classTarget;
+ private int field_75445_i;
+ private double field_151497_i;
+ private double field_151495_j;
+ private double field_151496_k;
+
+ private int failedPathFindingPenalty;
+
+ public Melee(
+ EntityAIBatKingAttack aParent, Class aClassTarget, double aMoveToTargetSpeed, boolean aLongMemory) {
+ this.parentAI = aParent;
+ this.classTarget = aClassTarget;
+ this.speedTowardsTarget = aMoveToTargetSpeed;
+ this.longMemory = aLongMemory;
+ parentAI.setMutexBits(3);
+ }
+
+ /**
+ * Returns whether the EntityAIBase should begin execution.
+ */
+ public boolean shouldExecute() {
+ if (!parentAI.hasValidTarget()) {
+ return false;
+ }
+ EntityLivingBase entitylivingbase = parentAI.getTarget();
+
+ if (entitylivingbase == null) {
+ return false;
+ } else if (!entitylivingbase.isEntityAlive()) {
+ return false;
+ } else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) {
+ return false;
+ } else {
+ if (--this.field_75445_i <= 0) {
+ parentAI.mEntityPathEntity =
+ parentAI.mAttackingEntity.getNavigator().getPathToEntityLiving(entitylivingbase);
+ this.field_75445_i = 4 + parentAI.mAttackingEntity.getRNG().nextInt(7);
+ return parentAI.mEntityPathEntity != null;
+ } else {
+ return true;
+ }
+ }
+ }
+
+ /**
+ * Returns whether an in-progress EntityAIBase should continue executing
+ */
+ public boolean continueExecuting() {
+ EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget();
+ return entitylivingbase == null
+ ? false
+ : (!entitylivingbase.isEntityAlive()
+ ? false
+ : (!this.longMemory
+ ? !parentAI.mAttackingEntity.getNavigator().noPath()
+ : parentAI.mAttackingEntity.isWithinHomeDistance(
+ MathHelper.floor_double(entitylivingbase.posX),
+ MathHelper.floor_double(entitylivingbase.posY),
+ MathHelper.floor_double(entitylivingbase.posZ))));
+ }
+
+ /**
+ * Execute a one shot task or start executing a continuous task
+ */
+ public void startExecuting() {
+ parentAI.mAttackingEntity.getNavigator().setPath(parentAI.mEntityPathEntity, this.speedTowardsTarget);
+ this.field_75445_i = 0;
+ }
+
+ /**
+ * Resets the task
+ */
+ public void resetTask() {
+ parentAI.mAttackingEntity.getNavigator().clearPathEntity();
+ }
+
+ /**
+ * Updates the task
+ */
+ public void updateTask() {
+ EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget();
+ parentAI.mAttackingEntity.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F);
+ double d0 = parentAI.mAttackingEntity.getDistanceSq(
+ entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ);
+ double d1 = (double) (parentAI.mAttackingEntity.width * 2.0F * parentAI.mAttackingEntity.width * 2.0F
+ + entitylivingbase.width);
+ --this.field_75445_i;
+
+ if ((this.longMemory || parentAI.mAttackingEntity.getEntitySenses().canSee(entitylivingbase))
+ && this.field_75445_i <= 0
+ && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D
+ || entitylivingbase.getDistanceSq(
+ this.field_151497_i, this.field_151495_j, this.field_151496_k)
+ >= 1.0D
+ || parentAI.mAttackingEntity.getRNG().nextFloat() < 0.05F)) {
+ this.field_151497_i = entitylivingbase.posX;
+ this.field_151495_j = entitylivingbase.boundingBox.minY;
+ this.field_151496_k = entitylivingbase.posZ;
+ this.field_75445_i = failedPathFindingPenalty
+ + 4
+ + parentAI.mAttackingEntity.getRNG().nextInt(7);
+
+ if (parentAI.mAttackingEntity.getNavigator().getPath() != null) {
+ PathPoint finalPathPoint =
+ parentAI.mAttackingEntity.getNavigator().getPath().getFinalPathPoint();
+ if (finalPathPoint != null
+ && entitylivingbase.getDistanceSq(
+ finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord)
+ < 1) {
+ failedPathFindingPenalty = 0;
+ } else {
+ failedPathFindingPenalty += 10;
+ }
+ } else {
+ failedPathFindingPenalty += 10;
+ }
+
+ if (d0 > 1024.0D) {
+ this.field_75445_i += 10;
+ } else if (d0 > 256.0D) {
+ this.field_75445_i += 5;
+ }
+
+ if (!parentAI.mAttackingEntity
+ .getNavigator()
+ .tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) {
+ this.field_75445_i += 15;
+ }
+ }
+
+ this.attackTick = Math.max(this.attackTick - 1, 0);
+
+ if (d0 <= d1 && this.attackTick <= 20) {
+ this.attackTick = 20;
+
+ if (parentAI.mAttackingEntity.getHeldItem() != null) {
+ parentAI.mAttackingEntity.swingItem();
+ }
+
+ parentAI.mAttackingEntity.attackEntityAsMob(entitylivingbase);
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java b/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java
index 8e0b1b48ce..95693d24c9 100644
--- a/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java
+++ b/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java
@@ -1,117 +1,117 @@
package gtPlusPlus.core.entity.item;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.entity.monster.EntityGiantChickenBase;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.NBTUtils;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.World;
public class ItemEntityGiantEgg extends EntityItem {
- /**
- * The maximum age of this Chicken Egg. The item will try hatch once this is reached.
- */
- public int mEggAge = 10000;
- public int mEggSize = -1;
-
- public ItemEntityGiantEgg(World aWorld) {
- super(aWorld);
- }
-
- public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ) {
- super(aWorld, aX, aY, aZ);
- }
-
- public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ, ItemStack aStack) {
- super(aWorld, aX, aY, aZ, aStack);
- }
-
- private boolean spawnGiantChicken() {
- try {
- EntityGiantChickenBase entitychicken = new EntityGiantChickenBase(this.worldObj);
- entitychicken.setGrowingAge(-MathUtils.randInt(20000, 40000));
- entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
- return this.worldObj.spawnEntityInWorld(entitychicken);
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- //These eggs also do not combine.
- @Override
- public boolean combineItems(EntityItem p_70289_1_) {
- return false;
- }
-
- @Override
- public void writeEntityToNBT(NBTTagCompound aNBT) {
- super.writeEntityToNBT(aNBT);
- aNBT.setInteger("mEggAge", mEggAge);
- aNBT.setInteger("mTicksExisted", this.age);
- }
-
- @Override
- public void readEntityFromNBT(NBTTagCompound aNBT) {
- super.readEntityFromNBT(aNBT);
- mEggAge = aNBT.getInteger("mEggAge");
- }
-
- //They're fireproof
- @Override
- public void setFire(int p_70015_1_) {
- }
-
- @Override
- public boolean isBurning() {
- return false;
- }
-
- @Override
- public void onEntityUpdate() {
- super.onEntityUpdate();
- Logger.INFO("1");
- //Large eggs don't despawn, because they will try hatch first.
- if (this.lifespan != Integer.MAX_VALUE-1) {
- this.lifespan = Integer.MAX_VALUE-1;
- }
-
- if (this.getEntityItem() != null) {
- ItemStack g = this.getEntityItem();
- NBTUtils.setInteger(g, "mTicksExisted", this.age);
- NBTUtils.setInteger(g, "lifespan", this.lifespan);
- NBTUtils.setBoolean(g, "playerHeld", false);
- this.setEntityItemStack(g);
- Logger.INFO("Writing age to NBT of stored stack item.");
- }
- else {
- ItemStack g = ItemUtils.getSimpleStack(ModItems.itemBigEgg);
- NBTUtils.setInteger(g, "mTicksExisted", this.age);
- NBTUtils.setInteger(g, "lifespan", this.lifespan);
- NBTUtils.setBoolean(g, "playerHeld", false);
- this.setEntityItemStack(g);
- Logger.INFO("Writing age to NBT of new stack item.");
-
- }
-
- if (this.age >= 1000) {
- //Cache the value for efficiency
- if (mEggSize == -1)
- mEggSize = (this.getEntityItem() != null ? (this.getEntityItem().hasTagCompound() ? (this.getEntityItem().getTagCompound().hasKey("size") ? this.getEntityItem().getTagCompound().getInteger("size") : 1) : 1) : 1);
- if (MathUtils.randInt(100*mEggSize, 1000) >= MathUtils.randInt(950, 1000)) {
- //Spawn Chicken
- if (spawnGiantChicken()) {
- this.kill();
- }
- }
- }
- }
-
-
+ /**
+ * The maximum age of this Chicken Egg. The item will try hatch once this is reached.
+ */
+ public int mEggAge = 10000;
+
+ public int mEggSize = -1;
+
+ public ItemEntityGiantEgg(World aWorld) {
+ super(aWorld);
+ }
+
+ public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ) {
+ super(aWorld, aX, aY, aZ);
+ }
+
+ public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ, ItemStack aStack) {
+ super(aWorld, aX, aY, aZ, aStack);
+ }
+
+ private boolean spawnGiantChicken() {
+ try {
+ EntityGiantChickenBase entitychicken = new EntityGiantChickenBase(this.worldObj);
+ entitychicken.setGrowingAge(-MathUtils.randInt(20000, 40000));
+ entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
+ return this.worldObj.spawnEntityInWorld(entitychicken);
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ // These eggs also do not combine.
+ @Override
+ public boolean combineItems(EntityItem p_70289_1_) {
+ return false;
+ }
+
+ @Override
+ public void writeEntityToNBT(NBTTagCompound aNBT) {
+ super.writeEntityToNBT(aNBT);
+ aNBT.setInteger("mEggAge", mEggAge);
+ aNBT.setInteger("mTicksExisted", this.age);
+ }
+
+ @Override
+ public void readEntityFromNBT(NBTTagCompound aNBT) {
+ super.readEntityFromNBT(aNBT);
+ mEggAge = aNBT.getInteger("mEggAge");
+ }
+
+ // They're fireproof
+ @Override
+ public void setFire(int p_70015_1_) {}
+
+ @Override
+ public boolean isBurning() {
+ return false;
+ }
+
+ @Override
+ public void onEntityUpdate() {
+ super.onEntityUpdate();
+ Logger.INFO("1");
+ // Large eggs don't despawn, because they will try hatch first.
+ if (this.lifespan != Integer.MAX_VALUE - 1) {
+ this.lifespan = Integer.MAX_VALUE - 1;
+ }
+
+ if (this.getEntityItem() != null) {
+ ItemStack g = this.getEntityItem();
+ NBTUtils.setInteger(g, "mTicksExisted", this.age);
+ NBTUtils.setInteger(g, "lifespan", this.lifespan);
+ NBTUtils.setBoolean(g, "playerHeld", false);
+ this.setEntityItemStack(g);
+ Logger.INFO("Writing age to NBT of stored stack item.");
+ } else {
+ ItemStack g = ItemUtils.getSimpleStack(ModItems.itemBigEgg);
+ NBTUtils.setInteger(g, "mTicksExisted", this.age);
+ NBTUtils.setInteger(g, "lifespan", this.lifespan);
+ NBTUtils.setBoolean(g, "playerHeld", false);
+ this.setEntityItemStack(g);
+ Logger.INFO("Writing age to NBT of new stack item.");
+ }
+
+ if (this.age >= 1000) {
+ // Cache the value for efficiency
+ if (mEggSize == -1)
+ mEggSize = (this.getEntityItem() != null
+ ? (this.getEntityItem().hasTagCompound()
+ ? (this.getEntityItem().getTagCompound().hasKey("size")
+ ? this.getEntityItem().getTagCompound().getInteger("size")
+ : 1)
+ : 1)
+ : 1);
+ if (MathUtils.randInt(100 * mEggSize, 1000) >= MathUtils.randInt(950, 1000)) {
+ // Spawn Chicken
+ if (spawnGiantChicken()) {
+ this.kill();
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java
index 55e0f4c571..0a35d550a4 100644
--- a/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java
+++ b/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.entity.monster;
-import java.lang.reflect.Field;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.entity.ai.batking.EntityAIBatKingAttack;
@@ -9,6 +7,7 @@ import gtPlusPlus.core.entity.projectile.EntityThrowableBomb;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EnumCreatureAttribute;
@@ -36,677 +35,684 @@ import net.minecraft.world.World;
public class EntityBatKing extends EntityMob implements IRangedAttackMob {
- public int courseChangeCooldown;
- public double waypointX;
- public double waypointY;
- public double waypointZ;
- private Entity targetedEntity;
- private int aggroCooldown;
- public int prevAttackCounter;
- public int attackCounter;
- private int explosionStrength = 1;
-
- private EntityAIBatKingAttack aiAttack = new EntityAIBatKingAttack(this, null, 1.0D, 20, 60, 15.0F, true);
- private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D,
- false);
-
- public EntityBatKing(World p_i1680_1_) {
- super(p_i1680_1_);
- this.setSize(2.5F, 1.5F);
-
- this.setIsBatHanging(false);
- this.isImmuneToFire = true;
- this.experienceValue = 1000;
-
- this.tasks.addTask(3, this.aiAttack);
- //this.tasks.addTask(4, this.aiAttackOnCollide);
- //this.tasks.addTask(4, new EntityAIRestrictSun(this));
- //this.tasks.addTask(5, new EntityAIFleeSun(this, 1.0D));
- this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
- //this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
- //this.tasks.addTask(6, new EntityAILookIdle(this));
-
- this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
- //this.targetTasks.addTask(2, this.aiAttack);
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
- this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityBat.class, 0, false));
-
- }
-
- protected void entityInit() {
- super.entityInit();
- }
-
- /**
- * Get this Entity's EnumCreatureAttribute
- */
- public EnumCreatureAttribute getCreatureAttribute() {
- return EnumCreatureAttribute.UNDEAD;
- }
-
- /**
- * Gets the pitch of living sounds in living entities.
- */
- protected float getSoundPitch() {
- return super.getSoundPitch() * 0.15F;
- }
-
- /**
- * Returns the sound this mob makes while it's alive.
- */
- protected String getLivingSound() {
- int aRand = MathUtils.randInt(0, 10);
- if (aRand < 6) {
- return null;
- } else if (aRand <= 8) {
- return "mob.bat.idle";
- } else {
- return "mob.blaze.breathe";
- }
- }
-
- /**
- * Returns the sound this mob makes when it is hurt.
- */
- protected String getHurtSound() {
- return "mob.blaze.hit";
- }
-
- /**
- * Returns the sound this mob makes on death.
- */
- protected String getDeathSound() {
- return "mob.bat.death";
- }
-
- /**
- * Returns true if this entity should push and be pushed by other entities when
- * colliding.
- */
- public boolean canBePushed() {
- return true;
- }
-
- protected void collideWithEntity(Entity aEntity) {
- if (aEntity != null) {
- if (aEntity instanceof EntityPlayer) {
- EntityUtils.doDamage(aEntity, DamageSource.magic, (int) (((EntityPlayer) aEntity).getHealth() / 20));
- }
- }
- }
-
- protected void collideWithNearbyEntities() {
- }
-
- protected void applyEntityAttributes() {
-
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.maxHealth);
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage);
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.knockbackResistance);
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed);
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange);
-
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(250.0D);
- this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1D);
- this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(120.0D);
- }
-
- public boolean getIsBatHanging() {
- return false;
- }
-
- public void setIsBatHanging(boolean p_82236_1_) {
- generateParticles(this);
- generateParticles(this);
- generateParticles(this);
- for (int i = 0; i < 32; ++i) {
- //
- String particleName = "lava";
- if (MathUtils.randInt(0, 3) <= 2) {
- particleName = "crit";
- }
- this.worldObj.spawnParticle(particleName,
- this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width,
- this.posY + this.rand.nextDouble() * (double) this.height,
- this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, 0.0D, 0.0D, 0.0D);
- }
-
- }
-
- /**
- * Returns true if the newer Entity AI code should be run
- */
- protected boolean isAIEnabled() {
- return true;
- }
-
- /**
- * Called to update the entity's position/logic.
- */
- public void onUpdate() {
- super.onUpdate();
- generateParticles(this);
-
- if (!this.worldObj.isRemote && (this.targetedEntity == null || this.aggroCooldown-- <= 0)) {
- this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D);
-
- if (this.targetedEntity != null) {
- this.aggroCooldown = 30;
- if (aiAttack.hasValidTarget()) {
- this.setAttackTarget(aiAttack.getTarget());
- }
- else {
- Logger.INFO("No valid target.");
- if (ReflectionUtils.doesFieldExist(aiAttack.getClass(), "mEntityTarget")) {
- Logger.INFO("Found field.");
- }
- else {
- Logger.INFO("Did not find field.");
- }
- Field target = ReflectionUtils.getField(EntityAIBatKingAttack.class, "mEntityTarget");
- if (target != null) {
- ReflectionUtils.setField(aiAttack, target, this.targetedEntity);
- Logger.INFO("Set target.");
- }
- else {
- Logger.INFO("Could not set via reflection.");
- }
-
-
- }
- }
- else {
- Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this, 32, 20);
- if (vec3 != null) {
- double xPosition = vec3.xCoord;
- double yPosition = vec3.yCoord;
- double zPosition = vec3.zCoord;
- this.getNavigator().tryMoveToXYZ(xPosition, yPosition, zPosition, 3);
- }
- }
- }
-
- }
-
- private static void generateParticles(EntityBatKing aKing) {
- for (int i = 0; i < 20; ++i) {
- //
- if (MathUtils.randInt(0, 50) <= 1) {
- String particleName = "smoke";
- if (MathUtils.randInt(0, 3) <= 2) {
- particleName = "largesmoke";
- }
- aKing.worldObj.spawnParticle(particleName,
- aKing.posX + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
- aKing.posY + aKing.rand.nextDouble() * (double) aKing.height,
- aKing.posZ + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width, 0.0D, 0.0D, 0.0D);
- }
- if (MathUtils.randInt(0, 100) <= 1) {
- String particleName = "smoke";
- int test2 = MathUtils.randInt(0, 3);
- if (test2 == 2) {
- particleName = "dripLava";
- } else if (test2 == 3) {
- particleName = "portal";
- }
- aKing.worldObj.spawnParticle(particleName,
- aKing.posX + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
- aKing.posY + aKing.rand.nextDouble() * (double) aKing.height,
- aKing.posZ + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width, 0.0D, 0.0D, 0.0D);
- }
- }
- }
-
- protected void updateAITasks() {
- super.updateAITasks();
- }
-
- private boolean isFlying() {
- if (this.onGround) {
- return false;
- }
- return true;
- }
-
- private boolean hasAir() {
- BlockPos p = EntityUtils.findBlockPosUnderEntity(this);
- int y = p.yPos;
- int yOriginal = p.yPos;
-
- for (int u = 0; u<5;u++) {
- if (u > 50 || y <= 0) {
- break;
- }
- if (!this.worldObj.isAirBlock(p.xPos, y, p.zPos)) {
- break;
- }
- y--;
- }
- if (yOriginal != y) {
- for (int i = 0; i < y; y++) {
- this.jump();
- }
- return true;
- }
- return false;
- }
-
- /**
- * returns if this entity triggers Block.onEntityWalking on the blocks they walk
- * on. used for spiders and wolves to prevent them from trampling crops
- */
- protected boolean canTriggerWalking() {
- return false;
- }
-
- /**
- * Return whether this entity should NOT trigger a pressure plate or a tripwire.
- */
- public boolean doesEntityNotTriggerPressurePlate() {
- return true;
- }
-
- /**
- * Called when the entity is attacked.
- */
- public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
- if (this.isEntityInvulnerable()) {
- return false;
- } else {
- if (!this.worldObj.isRemote && this.getIsBatHanging()) {
- this.setIsBatHanging(false);
- }
-
- return super.attackEntityFrom(p_70097_1_, p_70097_2_);
- }
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
- super.readEntityFromNBT(p_70037_1_);
- if (p_70037_1_.hasKey("ExplosionPower", 99)) {
- this.explosionStrength = p_70037_1_.getInteger("ExplosionPower");
- }
- }
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
- super.writeEntityToNBT(p_70014_1_);
- p_70014_1_.setInteger("ExplosionPower", this.explosionStrength);
- }
-
- /**
- * Attack the specified entity using a ranged attack.
- */
- @Override
- public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
- Logger.INFO("Trying to do ranged attack 1 |"+(this.targetedEntity != null)+"|");
-
- if (!this.isFlying() || !this.isAirBorne) {
- //this.hasAir();
- /*
- * for (int i=0;i<3;i++) { this.jump(); }
- */
- }
-
-
- double d4 = 64.0D;
- if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4 * 8) {
- Logger.INFO("Trying to do ranged attack 2");
- double d5 = this.targetedEntity.posX - this.posX;
- double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F)
- - (this.posY + (double) (this.height / 2.0F));
- double d7 = this.targetedEntity.posZ - this.posZ;
- this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI;
-
- ++this.attackCounter;
-
- if (this.canEntityBeSeen(this.targetedEntity)) {
- Logger.INFO("Trying to do ranged attack 3a | "+attackCounter);
-
-
- if (this.attackCounter >= 2) {
- Logger.INFO("Trying to do ranged attack 3a1");
-
- this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY,
- (int) this.posZ, 0);
- setIsBatHanging(true);
-
- EntityThrowableBomb entitylargefireball = new EntityThrowableBomb(this.worldObj, this/*d5, d6, d7*/);
- //entitylargefireball.field_92057_e = this.explosionStrength;
- //entitylargefireball.accelerationX *= 2;
- //entitylargefireball.accelerationY *= 2;
- //entitylargefireball.accelerationZ *= 2;
- double d8 = 4.0D;
- Vec3 vec3 = this.getLook(1.0F);
- entitylargefireball.posX = this.posX + vec3.xCoord * d8;
- entitylargefireball.posY = this.posY + (double) (this.height / 2.0F) + 0.5D;
- entitylargefireball.posZ = this.posZ + vec3.zCoord * d8;
- this.worldObj.spawnEntityInWorld(entitylargefireball);
-
- for (int u=0; u<MathUtils.randInt(2, 10);u++) {
- if (this.attackCounter > 0) {
- Logger.INFO("Trying to do ranged attack 5a");
- --this.attackCounter;
- EntityArrow entityarrow = new EntityArrow(this.worldObj, this, p_82196_1_, MathUtils.randFloat(1f, 3f),
- (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
- int i = MathUtils.randInt(0, 4);
- int j = MathUtils.randInt(0, 3);
- int k = MathUtils.randInt(0, 3);
- entityarrow.setDamage((double) (p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D
- + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
-
- boolean boostAttack = MathUtils.randInt(0, 100) <= 21;
- if (boostAttack) {
- if (i > 0) {
- entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
- }
-
- if (j > 0) {
- entityarrow.setKnockbackStrength(j);
- }
- if (k > 0) {
- entityarrow.setFire(50 * k);
- }
- }
-
- this.playSound("mob.skeleton.say", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
- this.worldObj.spawnEntityInWorld(entityarrow);
- Logger.INFO("Trying to do ranged attack 5a done");
- }
- }
-
-
-
-
- this.attackCounter = 0;
- }
- } else if (this.attackCounter > 0) {
- Logger.INFO("Trying to do ranged attack 3b");
- --this.attackCounter;
- }
- } else {
- Logger.INFO("Trying to do ranged attack 4a");
- this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F
- / (float) Math.PI;
-
- if (this.attackCounter > 0) {
- Logger.INFO("Trying to do ranged attack 5a");
- --this.attackCounter;
- EntityArrow entityarrow = new EntityArrow(this.worldObj, this, p_82196_1_, 1.6F,
- (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
- int i = MathUtils.randInt(0, 4);
- int j = MathUtils.randInt(0, 3);
- int k = MathUtils.randInt(0, 3);
- entityarrow.setDamage((double) (p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D
- + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
-
- boolean boostAttack = MathUtils.randInt(0, 100) <= 21;
- if (boostAttack) {
- if (i > 0) {
- entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
- }
-
- if (j > 0) {
- entityarrow.setKnockbackStrength(j);
- }
- if (k > 0) {
- entityarrow.setFire(50 * k);
- }
- }
-
- this.playSound("mob.skeleton.say", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
- this.worldObj.spawnEntityInWorld(entityarrow);
- Logger.INFO("Trying to do ranged attack 5a done");
- }
-
- }
-
- }
-
- /**
- * Returns the volume for the sounds this mob makes.
- */
- protected float getSoundVolume() {
- return 10.0F;
- }
-
- /**
- * Checks if the entity's current position is a valid location to spawn this
- * entity.
- */
- public boolean getCanSpawnHere() {
- return super.getCanSpawnHere() && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL;
- }
-
- /**
- * Will return how many at most can spawn in a chunk at once.
- */
- public int getMaxSpawnedInChunk() {
- return 1;
- }
-
- protected Item getDropItem() {
- return Items.gunpowder;
- }
-
- /**
- * Drop 0-2 items of this living's type. @param par1 - Whether this entity has
- * recently been hit by a player. @param par2 - Level of Looting used to kill
- * this mob.
- */
- protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
- int j = this.rand.nextInt(2) + this.rand.nextInt(1 + p_70628_2_);
- int k;
-
- for (k = 0; k < j; ++k) {
- this.dropItem(Items.ghast_tear, 1);
- }
-
- j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_);
-
- for (k = 0; k < j; ++k) {
- this.dropItem(Items.gunpowder, 1);
- }
- }
-
- @Override
- protected void updateEntityActionState() {
- if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) {
- this.setDead();
- }
-
- this.despawnEntity();
- this.prevAttackCounter = this.attackCounter;
- double d0 = this.waypointX - this.posX;
- double d1 = this.waypointY - this.posY;
- double d2 = this.waypointZ - this.posZ;
- double d3 = d0 * d0 + d1 * d1 + d2 * d2;
-
- if (d3 < 1.0D || d3 > 3600.0D) {
- this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F);
- this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F);
- this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F);
- }
-
- if (this.courseChangeCooldown-- <= 0) {
- this.courseChangeCooldown += this.rand.nextInt(5) + 2;
- d3 = (double) MathHelper.sqrt_double(d3);
-
- if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, d3)) {
- this.motionX += d0 / d3 * 0.1D;
- this.motionY += d1 / d3 * 0.1D;
- this.motionZ += d2 / d3 * 0.1D;
- } else {
- this.waypointX = this.posX;
- this.waypointY = this.posY;
- this.waypointZ = this.posZ;
- }
- }
-
- if (this.targetedEntity != null && this.targetedEntity.isDead) {
- 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 d4 = 64.0D;
-
- if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4) {
- double d5 = this.targetedEntity.posX - this.posX;
- double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F)
- - (this.posY + (double) (this.height / 2.0F));
- double d7 = this.targetedEntity.posZ - this.posZ;
- this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI;
-
- if (this.canEntityBeSeen(this.targetedEntity)) {
- if (this.attackCounter == 10) {
- this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1007, (int) this.posX, (int) this.posY,
- (int) this.posZ, 0);
- }
-
- ++this.attackCounter;
-
- if (this.attackCounter == 20) {
- this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY,
- (int) this.posZ, 0);
- EntityLargeFireball entitylargefireball = new EntityLargeFireball(this.worldObj, this, d5, d6, d7);
- entitylargefireball.field_92057_e = this.explosionStrength;
- double d8 = 4.0D;
- Vec3 vec3 = this.getLook(1.0F);
- entitylargefireball.posX = this.posX + vec3.xCoord * d8;
- entitylargefireball.posY = this.posY + (double) (this.height / 2.0F) + 0.5D;
- entitylargefireball.posZ = this.posZ + vec3.zCoord * d8;
- this.worldObj.spawnEntityInWorld(entitylargefireball);
- this.attackCounter = -40;
- }
- } else if (this.attackCounter > 0) {
- --this.attackCounter;
- }
- } else {
- this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F
- / (float) Math.PI;
-
- if (this.attackCounter > 0) {
- --this.attackCounter;
- }
- }
-
- if (!this.worldObj.isRemote) {
- byte b1 = this.dataWatcher.getWatchableObjectByte(16);
- byte b0 = (byte) (this.attackCounter > 10 ? 1 : 0);
-
- if (b1 != b0) {
- this.dataWatcher.updateObject(16, Byte.valueOf(b0));
- }
- }
- }
-
- /**
- * True if the ghast has an unobstructed line of travel to the waypoint.
- */
- private boolean isCourseTraversable(double p_70790_1_, double p_70790_3_, double p_70790_5_, double p_70790_7_) {
- double d4 = (this.waypointX - this.posX) / p_70790_7_;
- double d5 = (this.waypointY - this.posY) / p_70790_7_;
- double d6 = (this.waypointZ - this.posZ) / p_70790_7_;
- AxisAlignedBB axisalignedbb = this.boundingBox.copy();
-
- for (int i = 1; (double) i < p_70790_7_; ++i) {
- axisalignedbb.offset(d4, d5, d6);
-
- /*
- * if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty())
- * { return false; }
- */
- }
-
- return true;
- }
-
- /**
- * Called when the mob is falling. Calculates and applies fall damage.
- */
- protected void fall(float p_70069_1_) {
- }
-
- /**
- * Takes in the distance the entity has fallen this tick and whether its on the
- * ground to update the fall distance and deal fall damage if landing on the
- * ground. Args: distanceFallenThisTick, onGround
- */
- protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {
- }
-
- /**
- * Moves the entity based on the specified heading. Args: strafe, forward
- */
- public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) {
- if (this.isInWater()) {
- this.moveFlying(p_70612_1_, p_70612_2_, 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(p_70612_1_, p_70612_2_, 0.02F);
- this.moveEntity(this.motionX, this.motionY, this.motionZ);
- this.motionX *= 0.5D;
- this.motionY *= 0.5D;
- this.motionZ *= 0.5D;
- } else {
- float f2 = 0.91F;
-
- if (this.onGround) {
- f2 = this.worldObj.getBlock(MathHelper.floor_double(this.posX),
- MathHelper.floor_double(this.boundingBox.minY) - 1,
- MathHelper.floor_double(this.posZ)).slipperiness * 0.91F;
- }
-
- float f3 = 0.16277136F / (f2 * f2 * f2);
- this.moveFlying(p_70612_1_, p_70612_2_, this.onGround ? 0.1F * f3 : 0.02F);
- f2 = 0.91F;
-
- if (this.onGround) {
- f2 = 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 *= (double) f2;
- this.motionY *= (double) f2;
- this.motionZ *= (double) f2;
- }
-
- this.prevLimbSwingAmount = this.limbSwingAmount;
- double d1 = this.posX - this.prevPosX;
- double d0 = this.posZ - this.prevPosZ;
- float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F;
-
- if (f4 > 1.0F) {
- f4 = 1.0F;
- }
-
- this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F;
- this.limbSwing += this.limbSwingAmount;
- }
-
- /**
- * returns true if this entity is by a ladder, false otherwise
- */
- public boolean isOnLadder() {
- return false;
- }
-
-} \ No newline at end of file
+ public int courseChangeCooldown;
+ public double waypointX;
+ public double waypointY;
+ public double waypointZ;
+ private Entity targetedEntity;
+ private int aggroCooldown;
+ public int prevAttackCounter;
+ public int attackCounter;
+ private int explosionStrength = 1;
+
+ private EntityAIBatKingAttack aiAttack = new EntityAIBatKingAttack(this, null, 1.0D, 20, 60, 15.0F, true);
+ private EntityAIAttackOnCollide aiAttackOnCollide =
+ new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
+
+ public EntityBatKing(World p_i1680_1_) {
+ super(p_i1680_1_);
+ this.setSize(2.5F, 1.5F);
+
+ this.setIsBatHanging(false);
+ this.isImmuneToFire = true;
+ this.experienceValue = 1000;
+
+ this.tasks.addTask(3, this.aiAttack);
+ // this.tasks.addTask(4, this.aiAttackOnCollide);
+ // this.tasks.addTask(4, new EntityAIRestrictSun(this));
+ // this.tasks.addTask(5, new EntityAIFleeSun(this, 1.0D));
+ this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
+ // this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
+ // this.tasks.addTask(6, new EntityAILookIdle(this));
+
+ this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
+ // this.targetTasks.addTask(2, this.aiAttack);
+ this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
+ this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityBat.class, 0, false));
+ }
+
+ protected void entityInit() {
+ super.entityInit();
+ }
+
+ /**
+ * Get this Entity's EnumCreatureAttribute
+ */
+ public EnumCreatureAttribute getCreatureAttribute() {
+ return EnumCreatureAttribute.UNDEAD;
+ }
+
+ /**
+ * Gets the pitch of living sounds in living entities.
+ */
+ protected float getSoundPitch() {
+ return super.getSoundPitch() * 0.15F;
+ }
+
+ /**
+ * Returns the sound this mob makes while it's alive.
+ */
+ protected String getLivingSound() {
+ int aRand = MathUtils.randInt(0, 10);
+ if (aRand < 6) {
+ return null;
+ } else if (aRand <= 8) {
+ return "mob.bat.idle";
+ } else {
+ return "mob.blaze.breathe";
+ }
+ }
+
+ /**
+ * Returns the sound this mob makes when it is hurt.
+ */
+ protected String getHurtSound() {
+ return "mob.blaze.hit";
+ }
+
+ /**
+ * Returns the sound this mob makes on death.
+ */
+ protected String getDeathSound() {
+ return "mob.bat.death";
+ }
+
+ /**
+ * Returns true if this entity should push and be pushed by other entities when
+ * colliding.
+ */
+ public boolean canBePushed() {
+ return true;
+ }
+
+ protected void collideWithEntity(Entity aEntity) {
+ if (aEntity != null) {
+ if (aEntity instanceof EntityPlayer) {
+ EntityUtils.doDamage(aEntity, DamageSource.magic, (int) (((EntityPlayer) aEntity).getHealth() / 20));
+ }
+ }
+ }
+
+ protected void collideWithNearbyEntities() {}
+
+ protected void applyEntityAttributes() {
+
+ this.getAttributeMap().registerAttribute(SharedMonsterAttributes.maxHealth);
+ this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage);
+ this.getAttributeMap().registerAttribute(SharedMonsterAttributes.knockbackResistance);
+ this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed);
+ this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange);
+
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(250.0D);
+ this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D);
+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1D);
+ this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(120.0D);
+ }
+
+ public boolean getIsBatHanging() {
+ return false;
+ }
+
+ public void setIsBatHanging(boolean p_82236_1_) {
+ generateParticles(this);
+ generateParticles(this);
+ generateParticles(this);
+ for (int i = 0; i < 32; ++i) {
+ //
+ String particleName = "lava";
+ if (MathUtils.randInt(0, 3) <= 2) {
+ particleName = "crit";
+ }
+ this.worldObj.spawnParticle(
+ particleName,
+ this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width,
+ this.posY + this.rand.nextDouble() * (double) this.height,
+ this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width,
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
+
+ /**
+ * Returns true if the newer Entity AI code should be run
+ */
+ protected boolean isAIEnabled() {
+ return true;
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ public void onUpdate() {
+ super.onUpdate();
+ generateParticles(this);
+
+ if (!this.worldObj.isRemote && (this.targetedEntity == null || this.aggroCooldown-- <= 0)) {
+ this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D);
+
+ if (this.targetedEntity != null) {
+ this.aggroCooldown = 30;
+ if (aiAttack.hasValidTarget()) {
+ this.setAttackTarget(aiAttack.getTarget());
+ } else {
+ Logger.INFO("No valid target.");
+ if (ReflectionUtils.doesFieldExist(aiAttack.getClass(), "mEntityTarget")) {
+ Logger.INFO("Found field.");
+ } else {
+ Logger.INFO("Did not find field.");
+ }
+ Field target = ReflectionUtils.getField(EntityAIBatKingAttack.class, "mEntityTarget");
+ if (target != null) {
+ ReflectionUtils.setField(aiAttack, target, this.targetedEntity);
+ Logger.INFO("Set target.");
+ } else {
+ Logger.INFO("Could not set via reflection.");
+ }
+ }
+ } else {
+ Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this, 32, 20);
+ if (vec3 != null) {
+ double xPosition = vec3.xCoord;
+ double yPosition = vec3.yCoord;
+ double zPosition = vec3.zCoord;
+ this.getNavigator().tryMoveToXYZ(xPosition, yPosition, zPosition, 3);
+ }
+ }
+ }
+ }
+
+ private static void generateParticles(EntityBatKing aKing) {
+ for (int i = 0; i < 20; ++i) {
+ //
+ if (MathUtils.randInt(0, 50) <= 1) {
+ String particleName = "smoke";
+ if (MathUtils.randInt(0, 3) <= 2) {
+ particleName = "largesmoke";
+ }
+ aKing.worldObj.spawnParticle(
+ particleName,
+ aKing.posX + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
+ aKing.posY + aKing.rand.nextDouble() * (double) aKing.height,
+ aKing.posZ + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ if (MathUtils.randInt(0, 100) <= 1) {
+ String particleName = "smoke";
+ int test2 = MathUtils.randInt(0, 3);
+ if (test2 == 2) {
+ particleName = "dripLava";
+ } else if (test2 == 3) {
+ particleName = "portal";
+ }
+ aKing.worldObj.spawnParticle(
+ particleName,
+ aKing.posX + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
+ aKing.posY + aKing.rand.nextDouble() * (double) aKing.height,
+ aKing.posZ + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
+ }
+
+ protected void updateAITasks() {
+ super.updateAITasks();
+ }
+
+ private boolean isFlying() {
+ if (this.onGround) {
+ return false;
+ }
+ return true;
+ }
+
+ private boolean hasAir() {
+ BlockPos p = EntityUtils.findBlockPosUnderEntity(this);
+ int y = p.yPos;
+ int yOriginal = p.yPos;
+
+ for (int u = 0; u < 5; u++) {
+ if (u > 50 || y <= 0) {
+ break;
+ }
+ if (!this.worldObj.isAirBlock(p.xPos, y, p.zPos)) {
+ break;
+ }
+ y--;
+ }
+ if (yOriginal != y) {
+ for (int i = 0; i < y; y++) {
+ this.jump();
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk
+ * on. used for spiders and wolves to prevent them from trampling crops
+ */
+ protected boolean canTriggerWalking() {
+ return false;
+ }
+
+ /**
+ * Return whether this entity should NOT trigger a pressure plate or a tripwire.
+ */
+ public boolean doesEntityNotTriggerPressurePlate() {
+ return true;
+ }
+
+ /**
+ * Called when the entity is attacked.
+ */
+ public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
+ if (this.isEntityInvulnerable()) {
+ return false;
+ } else {
+ if (!this.worldObj.isRemote && this.getIsBatHanging()) {
+ this.setIsBatHanging(false);
+ }
+
+ return super.attackEntityFrom(p_70097_1_, p_70097_2_);
+ }
+ }
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
+ super.readEntityFromNBT(p_70037_1_);
+ if (p_70037_1_.hasKey("ExplosionPower", 99)) {
+ this.explosionStrength = p_70037_1_.getInteger("ExplosionPower");
+ }
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
+ super.writeEntityToNBT(p_70014_1_);
+ p_70014_1_.setInteger("ExplosionPower", this.explosionStrength);
+ }
+
+ /**
+ * Attack the specified entity using a ranged attack.
+ */
+ @Override
+ public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
+ Logger.INFO("Trying to do ranged attack 1 |" + (this.targetedEntity != null) + "|");
+
+ if (!this.isFlying() || !this.isAirBorne) {
+ // this.hasAir();
+ /*
+ * for (int i=0;i<3;i++) { this.jump(); }
+ */
+ }
+
+ double d4 = 64.0D;
+ if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4 * 8) {
+ Logger.INFO("Trying to do ranged attack 2");
+ double d5 = this.targetedEntity.posX - this.posX;
+ double d6 = this.targetedEntity.boundingBox.minY
+ + (double) (this.targetedEntity.height / 2.0F)
+ - (this.posY + (double) (this.height / 2.0F));
+ double d7 = this.targetedEntity.posZ - this.posZ;
+ this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI;
+
+ ++this.attackCounter;
+
+ if (this.canEntityBeSeen(this.targetedEntity)) {
+ Logger.INFO("Trying to do ranged attack 3a | " + attackCounter);
+
+ if (this.attackCounter >= 2) {
+ Logger.INFO("Trying to do ranged attack 3a1");
+
+ this.worldObj.playAuxSFXAtEntity(
+ (EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
+ setIsBatHanging(true);
+
+ EntityThrowableBomb entitylargefireball =
+ new EntityThrowableBomb(this.worldObj, this /*d5, d6, d7*/);
+ // entitylargefireball.field_92057_e = this.explosionStrength;
+ // entitylargefireball.accelerationX *= 2;
+ // entitylargefireball.accelerationY *= 2;
+ // entitylargefireball.accelerationZ *= 2;
+ double d8 = 4.0D;
+ Vec3 vec3 = this.getLook(1.0F);
+ entitylargefireball.posX = this.posX + vec3.xCoord * d8;
+ entitylargefireball.posY = this.posY + (double) (this.height / 2.0F) + 0.5D;
+ entitylargefireball.posZ = this.posZ + vec3.zCoord * d8;
+ this.worldObj.spawnEntityInWorld(entitylargefireball);
+
+ for (int u = 0; u < MathUtils.randInt(2, 10); u++) {
+ if (this.attackCounter > 0) {
+ Logger.INFO("Trying to do ranged attack 5a");
+ --this.attackCounter;
+ EntityArrow entityarrow = new EntityArrow(
+ this.worldObj, this, p_82196_1_, MathUtils.randFloat(1f, 3f), (float)
+ (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
+ int i = MathUtils.randInt(0, 4);
+ int j = MathUtils.randInt(0, 3);
+ int k = MathUtils.randInt(0, 3);
+ entityarrow.setDamage((double) (p_82196_2_ * 2.0F)
+ + this.rand.nextGaussian() * 0.25D
+ + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
+
+ boolean boostAttack = MathUtils.randInt(0, 100) <= 21;
+ if (boostAttack) {
+ if (i > 0) {
+ entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
+ }
+
+ if (j > 0) {
+ entityarrow.setKnockbackStrength(j);
+ }
+ if (k > 0) {
+ entityarrow.setFire(50 * k);
+ }
+ }
+
+ this.playSound(
+ "mob.skeleton.say",
+ 1.0F,
+ 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
+ this.worldObj.spawnEntityInWorld(entityarrow);
+ Logger.INFO("Trying to do ranged attack 5a done");
+ }
+ }
+
+ this.attackCounter = 0;
+ }
+ } else if (this.attackCounter > 0) {
+ Logger.INFO("Trying to do ranged attack 3b");
+ --this.attackCounter;
+ }
+ } else {
+ Logger.INFO("Trying to do ranged attack 4a");
+ this.renderYawOffset =
+ this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI;
+
+ if (this.attackCounter > 0) {
+ Logger.INFO("Trying to do ranged attack 5a");
+ --this.attackCounter;
+ EntityArrow entityarrow = new EntityArrow(this.worldObj, this, p_82196_1_, 1.6F, (float)
+ (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
+ int i = MathUtils.randInt(0, 4);
+ int j = MathUtils.randInt(0, 3);
+ int k = MathUtils.randInt(0, 3);
+ entityarrow.setDamage((double) (p_82196_2_ * 2.0F)
+ + this.rand.nextGaussian() * 0.25D
+ + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
+
+ boolean boostAttack = MathUtils.randInt(0, 100) <= 21;
+ if (boostAttack) {
+ if (i > 0) {
+ entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
+ }
+
+ if (j > 0) {
+ entityarrow.setKnockbackStrength(j);
+ }
+ if (k > 0) {
+ entityarrow.setFire(50 * k);
+ }
+ }
+
+ this.playSound("mob.skeleton.say", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
+ this.worldObj.spawnEntityInWorld(entityarrow);
+ Logger.INFO("Trying to do ranged attack 5a done");
+ }
+ }
+ }
+
+ /**
+ * Returns the volume for the sounds this mob makes.
+ */
+ protected float getSoundVolume() {
+ return 10.0F;
+ }
+
+ /**
+ * Checks if the entity's current position is a valid location to spawn this
+ * entity.
+ */
+ public boolean getCanSpawnHere() {
+ return super.getCanSpawnHere() && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL;
+ }
+
+ /**
+ * Will return how many at most can spawn in a chunk at once.
+ */
+ public int getMaxSpawnedInChunk() {
+ return 1;
+ }
+
+ protected Item getDropItem() {
+ return Items.gunpowder;
+ }
+
+ /**
+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has
+ * recently been hit by a player. @param par2 - Level of Looting used to kill
+ * this mob.
+ */
+ protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
+ int j = this.rand.nextInt(2) + this.rand.nextInt(1 + p_70628_2_);
+ int k;
+
+ for (k = 0; k < j; ++k) {
+ this.dropItem(Items.ghast_tear, 1);
+ }
+
+ j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_);
+
+ for (k = 0; k < j; ++k) {
+ this.dropItem(Items.gunpowder, 1);
+ }
+ }
+
+ @Override
+ protected void updateEntityActionState() {
+ if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) {
+ this.setDead();
+ }
+
+ this.despawnEntity();
+ this.prevAttackCounter = this.attackCounter;
+ double d0 = this.waypointX - this.posX;
+ double d1 = this.waypointY - this.posY;
+ double d2 = this.waypointZ - this.posZ;
+ double d3 = d0 * d0 + d1 * d1 + d2 * d2;
+
+ if (d3 < 1.0D || d3 > 3600.0D) {
+ this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F);
+ this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F);
+ this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F);
+ }
+
+ if (this.courseChangeCooldown-- <= 0) {
+ this.courseChangeCooldown += this.rand.nextInt(5) + 2;
+ d3 = (double) MathHelper.sqrt_double(d3);
+
+ if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, d3)) {
+ this.motionX += d0 / d3 * 0.1D;
+ this.motionY += d1 / d3 * 0.1D;
+ this.motionZ += d2 / d3 * 0.1D;
+ } else {
+ this.waypointX = this.posX;
+ this.waypointY = this.posY;
+ this.waypointZ = this.posZ;
+ }
+ }
+
+ if (this.targetedEntity != null && this.targetedEntity.isDead) {
+ 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 d4 = 64.0D;
+
+ if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4) {
+ double d5 = this.targetedEntity.posX - this.posX;
+ double d6 = this.targetedEntity.boundingBox.minY
+ + (double) (this.targetedEntity.height / 2.0F)
+ - (this.posY + (double) (this.height / 2.0F));
+ double d7 = this.targetedEntity.posZ - this.posZ;
+ this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI;
+
+ if (this.canEntityBeSeen(this.targetedEntity)) {
+ if (this.attackCounter == 10) {
+ this.worldObj.playAuxSFXAtEntity(
+ (EntityPlayer) null, 1007, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
+ }
+
+ ++this.attackCounter;
+
+ if (this.attackCounter == 20) {
+ this.worldObj.playAuxSFXAtEntity(
+ (EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
+ EntityLargeFireball entitylargefireball = new EntityLargeFireball(this.worldObj, this, d5, d6, d7);
+ entitylargefireball.field_92057_e = this.explosionStrength;
+ double d8 = 4.0D;
+ Vec3 vec3 = this.getLook(1.0F);
+ entitylargefireball.posX = this.posX + vec3.xCoord * d8;
+ entitylargefireball.posY = this.posY + (double) (this.height / 2.0F) + 0.5D;
+ entitylargefireball.posZ = this.posZ + vec3.zCoord * d8;
+ this.worldObj.spawnEntityInWorld(entitylargefireball);
+ this.attackCounter = -40;
+ }
+ } else if (this.attackCounter > 0) {
+ --this.attackCounter;
+ }
+ } else {
+ this.renderYawOffset =
+ this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI;
+
+ if (this.attackCounter > 0) {
+ --this.attackCounter;
+ }
+ }
+
+ if (!this.worldObj.isRemote) {
+ byte b1 = this.dataWatcher.getWatchableObjectByte(16);
+ byte b0 = (byte) (this.attackCounter > 10 ? 1 : 0);
+
+ if (b1 != b0) {
+ this.dataWatcher.updateObject(16, Byte.valueOf(b0));
+ }
+ }
+ }
+
+ /**
+ * True if the ghast has an unobstructed line of travel to the waypoint.
+ */
+ private boolean isCourseTraversable(double p_70790_1_, double p_70790_3_, double p_70790_5_, double p_70790_7_) {
+ double d4 = (this.waypointX - this.posX) / p_70790_7_;
+ double d5 = (this.waypointY - this.posY) / p_70790_7_;
+ double d6 = (this.waypointZ - this.posZ) / p_70790_7_;
+ AxisAlignedBB axisalignedbb = this.boundingBox.copy();
+
+ for (int i = 1; (double) i < p_70790_7_; ++i) {
+ axisalignedbb.offset(d4, d5, d6);
+
+ /*
+ * if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty())
+ * { return false; }
+ */
+ }
+
+ return true;
+ }
+
+ /**
+ * Called when the mob is falling. Calculates and applies fall damage.
+ */
+ protected void fall(float p_70069_1_) {}
+
+ /**
+ * Takes in the distance the entity has fallen this tick and whether its on the
+ * ground to update the fall distance and deal fall damage if landing on the
+ * ground. Args: distanceFallenThisTick, onGround
+ */
+ protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {}
+
+ /**
+ * Moves the entity based on the specified heading. Args: strafe, forward
+ */
+ public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) {
+ if (this.isInWater()) {
+ this.moveFlying(p_70612_1_, p_70612_2_, 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(p_70612_1_, p_70612_2_, 0.02F);
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ this.motionX *= 0.5D;
+ this.motionY *= 0.5D;
+ this.motionZ *= 0.5D;
+ } else {
+ float f2 = 0.91F;
+
+ if (this.onGround) {
+ f2 = this.worldObj.getBlock(
+ MathHelper.floor_double(this.posX),
+ MathHelper.floor_double(this.boundingBox.minY) - 1,
+ MathHelper.floor_double(this.posZ))
+ .slipperiness
+ * 0.91F;
+ }
+
+ float f3 = 0.16277136F / (f2 * f2 * f2);
+ this.moveFlying(p_70612_1_, p_70612_2_, this.onGround ? 0.1F * f3 : 0.02F);
+ f2 = 0.91F;
+
+ if (this.onGround) {
+ f2 = 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 *= (double) f2;
+ this.motionY *= (double) f2;
+ this.motionZ *= (double) f2;
+ }
+
+ this.prevLimbSwingAmount = this.limbSwingAmount;
+ double d1 = this.posX - this.prevPosX;
+ double d0 = this.posZ - this.prevPosZ;
+ float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F;
+
+ if (f4 > 1.0F) {
+ f4 = 1.0F;
+ }
+
+ this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F;
+ this.limbSwing += this.limbSwingAmount;
+ }
+
+ /**
+ * returns true if this entity is by a ladder, false otherwise
+ */
+ public boolean isOnLadder() {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java
index 3a094e129b..e75a7664bc 100644
--- a/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java
+++ b/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java
@@ -1,5 +1,8 @@
package gtPlusPlus.core.entity.monster;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.item.general.ItemGemShards;
+import gtPlusPlus.core.util.math.MathUtils;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.effect.EntityLightningBolt;
@@ -13,21 +16,16 @@ import net.minecraft.potion.Potion;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
-
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.item.general.ItemGemShards;
-import gtPlusPlus.core.util.math.MathUtils;
import net.minecraftforge.common.ForgeHooks;
public class EntityGiantChickenBase extends EntityChicken {
-
+
/** The time until the next egg is spawned. */
public int timeUntilNextBigEgg;
- public EntityGiantChickenBase(World aWorld)
- {
+ public EntityGiantChickenBase(World aWorld) {
super(aWorld);
- this.setSize(0.6F, 1.4F); //Double
+ this.setSize(0.6F, 1.4F); // Double
this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
this.timeUntilNextBigEgg = this.rand.nextInt(16000) + 4000;
this.tasks.addTask(0, new EntityAISwimming(this));
@@ -39,11 +37,9 @@ public class EntityGiantChickenBase extends EntityChicken {
this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
this.tasks.addTask(5, new EntityAILookIdle(this));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
-
}
- protected void applyEntityAttributes()
- {
+ protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D);
@@ -53,49 +49,42 @@ public class EntityGiantChickenBase extends EntityChicken {
* Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
* use this to react to sunlight and start to burn.
*/
- public void onLivingUpdate()
- {
+ public void onLivingUpdate() {
super.onLivingUpdate();
this.field_70888_h = this.field_70886_e;
this.field_70884_g = this.destPos;
- this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D);
+ this.destPos = (float) ((double) this.destPos + (double) (this.onGround ? -1 : 4) * 0.3D);
- if (this.destPos < 0.0F)
- {
+ if (this.destPos < 0.0F) {
this.destPos = 0.0F;
}
- if (this.destPos > 1.0F)
- {
+ if (this.destPos > 1.0F) {
this.destPos = 1.0F;
}
- if (!this.onGround && this.field_70889_i < 1.0F)
- {
+ if (!this.onGround && this.field_70889_i < 1.0F) {
this.field_70889_i = 1.0F;
}
- this.field_70889_i = (float)((double)this.field_70889_i * 0.9D);
+ this.field_70889_i = (float) ((double) this.field_70889_i * 0.9D);
- if (!this.onGround && this.motionY < 0.0D)
- {
+ if (!this.onGround && this.motionY < 0.0D) {
this.motionY *= 0.6D;
}
-
+
if (MathUtils.randInt(0, 10000) <= 5) {
- jump();
+ jump();
}
this.field_70886_e += this.field_70889_i * 2.0F;
- if (!this.worldObj.isRemote && --this.timeUntilNextEgg <= 0)
- {
+ if (!this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) {
this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
this.dropItem(Items.egg, 1);
this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
}
- if (!this.worldObj.isRemote && !this.isChild() && --this.timeUntilNextEgg <= 0)
- {
+ if (!this.worldObj.isRemote && !this.isChild() && --this.timeUntilNextEgg <= 0) {
this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
this.dropItem(ModItems.itemBigEgg, MathUtils.randInt(1, 4));
this.timeUntilNextBigEgg = this.rand.nextInt(16000) + 4000;
@@ -105,16 +94,14 @@ public class EntityGiantChickenBase extends EntityChicken {
/**
* Called when the mob is falling. Calculates and applies fall damage.
*/
- protected void fall(float p_70069_1_) {
+ protected void fall(float p_70069_1_) {
if (MathUtils.randInt(0, 10) <= 5) {
- jump();
+ jump();
}
-
}
- protected Item getDropItem()
- {
+ protected Item getDropItem() {
return ModItems.itemBigEgg;
}
@@ -122,35 +109,33 @@ public class EntityGiantChickenBase extends EntityChicken {
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
- protected void dropFewItems(boolean recentHit, int lootLevel)
- {
+ protected void dropFewItems(boolean recentHit, int lootLevel) {
int j = this.rand.nextInt(3) + this.rand.nextInt(1 + lootLevel);
- for (int k = 0; k < j; ++k)
- {
+ for (int k = 0; k < j; ++k) {
this.dropItem(Items.feather, 1);
}
-
- //Large Egg Chance
- for (int k = 0; k < j*2; ++k)
- {
- this.dropItem(ModItems.itemBigEgg, MathUtils.getRandomFromArray(new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2}));
+
+ // Large Egg Chance
+ for (int k = 0; k < j * 2; ++k) {
+ this.dropItem(
+ ModItems.itemBigEgg,
+ MathUtils.getRandomFromArray(new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2}));
}
- //Chicken Corpses Dropped
- int mBodies = MathUtils.getRandomFromArray(new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6});
- if (this.isBurning())
- {
+ // Chicken Corpses Dropped
+ int mBodies = MathUtils.getRandomFromArray(new int[] {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5,
+ 6
+ });
+ if (this.isBurning()) {
this.dropItem(Items.cooked_chicken, mBodies);
- }
- else
- {
+ } else {
this.dropItem(Items.chicken, mBodies);
}
}
- public EntityGiantChickenBase createChild(EntityAgeable p_90011_1_)
- {
+ public EntityGiantChickenBase createChild(EntityAgeable p_90011_1_) {
return new EntityGiantChickenBase(this.worldObj);
}
@@ -158,16 +143,14 @@ public class EntityGiantChickenBase extends EntityChicken {
* Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
* the animal type)
*/
- public boolean isBreedingItem(ItemStack aStack)
- {
+ public boolean isBreedingItem(ItemStack aStack) {
return aStack != null && aStack.getItem() instanceof ItemGemShards;
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
- public void readEntityFromNBT(NBTTagCompound aNBT)
- {
+ public void readEntityFromNBT(NBTTagCompound aNBT) {
super.readEntityFromNBT(aNBT);
timeUntilNextBigEgg = aNBT.getInteger("timeUntilNextBigEgg");
}
@@ -175,137 +158,135 @@ public class EntityGiantChickenBase extends EntityChicken {
/**
* Get the experience points the entity currently has.
*/
- protected int getExperiencePoints(EntityPlayer p_70693_1_)
- {
+ protected int getExperiencePoints(EntityPlayer p_70693_1_) {
return this.isChickenJockey() ? 20 : super.getExperiencePoints(p_70693_1_);
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
- public void writeEntityToNBT(NBTTagCompound aNBT)
- {
+ public void writeEntityToNBT(NBTTagCompound aNBT) {
super.writeEntityToNBT(aNBT);
- aNBT.setInteger("timeUntilNextBigEgg", timeUntilNextBigEgg);
+ aNBT.setInteger("timeUntilNextBigEgg", timeUntilNextBigEgg);
}
/**
* Determines if an entity can be despawned, used on idle far away entities
*/
- protected boolean canDespawn()
- {
+ protected boolean canDespawn() {
return this.isChickenJockey() && this.riddenByEntity == null;
}
- public void updateRiderPosition()
- {
+ public void updateRiderPosition() {
super.updateRiderPosition();
- float f = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F);
- float f1 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F);
+ float f = MathHelper.sin(this.renderYawOffset * (float) Math.PI / 180.0F);
+ float f1 = MathHelper.cos(this.renderYawOffset * (float) Math.PI / 180.0F);
float f2 = 0.1F;
float f3 = 0.0F;
- this.riddenByEntity.setPosition(this.posX + (double)(f2 * f), this.posY + (double)(this.height * 0.5F) + this.riddenByEntity.getYOffset() + (double)f3, this.posZ - (double)(f2 * f1));
+ this.riddenByEntity.setPosition(
+ this.posX + (double) (f2 * f),
+ this.posY + (double) (this.height * 0.5F) + this.riddenByEntity.getYOffset() + (double) f3,
+ this.posZ - (double) (f2 * f1));
- if (this.riddenByEntity instanceof EntityLivingBase)
- {
- ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset;
+ if (this.riddenByEntity instanceof EntityLivingBase) {
+ ((EntityLivingBase) this.riddenByEntity).renderYawOffset = this.renderYawOffset;
}
}
-
+
public boolean isChickenJockey() {
- return func_152116_bZ();
+ return func_152116_bZ();
}
+
public void setIsChickenJockey(boolean isJockey) {
- func_152117_i(isJockey);
+ func_152117_i(isJockey);
+ }
+
+ @Override
+ protected Entity findPlayerToAttack() {
+ // TODO Auto-generated method stub
+ return super.findPlayerToAttack();
+ }
+
+ @Override
+ public boolean interact(EntityPlayer p_70085_1_) {
+ // TODO Auto-generated method stub
+ return super.interact(p_70085_1_);
+ }
+
+ @Override
+ public void setHomeArea(int p_110171_1_, int p_110171_2_, int p_110171_3_, int p_110171_4_) {
+ // TODO Auto-generated method stub
+ super.setHomeArea(p_110171_1_, p_110171_2_, p_110171_3_, p_110171_4_);
+ }
+
+ @Override
+ public ChunkCoordinates getHomePosition() {
+ // TODO Auto-generated method stub
+ return super.getHomePosition();
+ }
+
+ @Override
+ public void detachHome() {
+ // TODO Auto-generated method stub
+ super.detachHome();
}
- @Override
- protected Entity findPlayerToAttack() {
- // TODO Auto-generated method stub
- return super.findPlayerToAttack();
- }
-
- @Override
- public boolean interact(EntityPlayer p_70085_1_) {
- // TODO Auto-generated method stub
- return super.interact(p_70085_1_);
- }
-
- @Override
- public void setHomeArea(int p_110171_1_, int p_110171_2_, int p_110171_3_, int p_110171_4_) {
- // TODO Auto-generated method stub
- super.setHomeArea(p_110171_1_, p_110171_2_, p_110171_3_, p_110171_4_);
- }
-
- @Override
- public ChunkCoordinates getHomePosition() {
- // TODO Auto-generated method stub
- return super.getHomePosition();
- }
-
- @Override
- public void detachHome() {
- // TODO Auto-generated method stub
- super.detachHome();
- }
-
- @Override
- public boolean hasHome() {
- // TODO Auto-generated method stub
- return super.hasHome();
- }
-
- @Override
- public void eatGrassBonus() {
+ @Override
+ public boolean hasHome() {
+ // TODO Auto-generated method stub
+ return super.hasHome();
+ }
+
+ @Override
+ public void eatGrassBonus() {
if (this.isChild()) {
this.addGrowth(60);
}
- }
-
- @Override
- public float getRenderSizeModifier() {
- return 1.0f;
- }
-
- @Override
- protected void jump() {
- this.motionY = 0.68999998688697815D;
- this.motionY += 0.068999998688697815D;
- if (this.isPotionActive(Potion.jump))
- {
- this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.5F);
+ }
+
+ @Override
+ public float getRenderSizeModifier() {
+ return 1.0f;
+ }
+
+ @Override
+ protected void jump() {
+ this.motionY = 0.68999998688697815D;
+ this.motionY += 0.068999998688697815D;
+ if (this.isPotionActive(Potion.jump)) {
+ this.motionY +=
+ (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.5F);
}
- if (this.isSprinting())
- {
+ if (this.isSprinting()) {
float f = this.rotationYaw * 0.017453292F;
- this.motionX -= (double)(MathHelper.sin(f) * 0.2F);
- this.motionZ += (double)(MathHelper.cos(f) * 0.2F);
+ this.motionX -= (double) (MathHelper.sin(f) * 0.2F);
+ this.motionZ += (double) (MathHelper.cos(f) * 0.2F);
}
this.isAirBorne = true;
-
+
if (MathUtils.randInt(0, 10) < 10) {
- jump();
+ jump();
}
-
+
ForgeHooks.onLivingJump(this);
- }
-
- @Override
- public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- super.onStruckByLightning(p_70077_1_);
- }
-
- @Override
- public boolean shouldDismountInWater(Entity rider) {
- return true;
- }
-} \ No newline at end of file
+ }
+
+ @Override
+ public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
+ this.spawnExplosionParticle();
+ this.spawnExplosionParticle();
+ this.spawnExplosionParticle();
+ this.spawnExplosionParticle();
+ this.spawnExplosionParticle();
+ this.spawnExplosionParticle();
+ this.spawnExplosionParticle();
+ super.onStruckByLightning(p_70077_1_);
+ }
+
+ @Override
+ public boolean shouldDismountInWater(Entity rider) {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java b/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java
index a530f294e1..2abc2bd6a1 100644
--- a/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java
+++ b/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java
@@ -2,7 +2,7 @@ package gtPlusPlus.core.entity.monster;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.entity.projectile.EntityToxinballSmall;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityMob;
@@ -13,213 +13,220 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
-import gtPlusPlus.core.entity.projectile.EntityToxinballSmall;
-
public class EntitySickBlaze extends EntityMob {
- /** Random offset used in floating behaviour */
- private float heightOffset = 0.5F;
- /** ticks until heightOffset is randomized */
- private int heightOffsetUpdateTime;
- private int field_70846_g;
- private final int mDataWatcherID = 30;
-
- public EntitySickBlaze(World p_i1731_1_) {
- super(p_i1731_1_);
- this.isImmuneToFire = true;
- this.experienceValue = 10;
- }
-
- @Override
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.5D);
- this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D);
- }
-
- @Override
- protected void entityInit() {
- super.entityInit();
- this.dataWatcher.addObject(mDataWatcherID, new Byte((byte) 0));
- }
-
- /**
- * Returns the sound this mob makes while it's alive.
- */
- @Override
- protected String getLivingSound() {
- return "mob.blaze.breathe";
- }
-
- /**
- * Returns the sound this mob makes when it is hurt.
- */
- @Override
- protected String getHurtSound() {
- return "mob.blaze.hit";
- }
-
- /**
- * Returns the sound this mob makes on death.
- */
- @Override
- protected String getDeathSound() {
- return "mob.blaze.death";
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getBrightnessForRender(float p_70070_1_) {
- return 15728880;
- }
-
- /**
- * Gets how bright this entity is.
- */
- @Override
- public float getBrightness(float p_70013_1_) {
- return p_70013_1_;
- }
-
- /**
- * Called frequently so the entity can update its state every tick as
- * required. For example, zombies and skeletons use this to react to
- * sunlight and start to burn.
- */
- @Override
- public void onLivingUpdate() {
- if (!this.worldObj.isRemote) {
- if (this.isWet()) {
- this.attackEntityFrom(DamageSource.drown, 1.0F);
- }
-
- --this.heightOffsetUpdateTime;
-
- if (this.heightOffsetUpdateTime <= 0) {
- this.heightOffsetUpdateTime = 100;
- this.heightOffset = 0.5F + (float) this.rand.nextGaussian() * 3.0F;
- }
-
- if (this.getEntityToAttack() != null && this.getEntityToAttack().posY
- + this.getEntityToAttack().getEyeHeight() > this.posY + this.getEyeHeight() + this.heightOffset) {
- this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D;
- }
- }
-
- if (this.rand.nextInt(24) == 0) {
- /*this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire",
- 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F);*/
- }
-
- if (!this.onGround && this.motionY < 0.0D) {
- this.motionY *= 0.6D;
- }
-
- for (int i = 0; i < 2; ++i) {
- this.worldObj.spawnParticle("crit", this.posX + (this.rand.nextDouble() - 0.5D) * this.width,
- this.posY + this.rand.nextDouble() * this.height,
- this.posZ + (this.rand.nextDouble() - 0.5D) * this.width, 0.0D, 0.0D, 0.0D);
- }
-
- super.onLivingUpdate();
- }
-
- /**
- * Basic mob attack. Default to touch of death in EntityCreature. Overridden
- * by each mob to define their attack.
- */
- @Override
- protected void attackEntity(Entity entity, float p_70785_2_) {
- if (this.attackTime <= 0 && p_70785_2_ < 2.0F && entity.boundingBox.maxY > this.boundingBox.minY
- && entity.boundingBox.minY < this.boundingBox.maxY) {
- this.attackTime = 20;
- this.attackEntityAsMob(entity);
- }
- else if (p_70785_2_ < 30.0F) {
- double d0 = entity.posX - this.posX;
- double d1 = entity.boundingBox.minY + entity.height / 2.0F - (this.posY + this.height / 2.0F);
- double d2 = entity.posZ - this.posZ;
-
- if (this.attackTime == 0) {
- ++this.field_70846_g;
-
- if (this.field_70846_g == 1) {
- this.attackTime = 60;
- }
- else if (this.field_70846_g <= 4) {
- this.attackTime = 6;
- }
- else {
- this.attackTime = 100;
- this.field_70846_g = 0;
- }
-
- if (this.field_70846_g > 1) {
- float f1 = MathHelper.sqrt_float(p_70785_2_) * 0.5F;
- this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) this.posX, (int) this.posY,
- (int) this.posZ, 0);
-
- for (int i = 0; i < 1; ++i) {
- EntityToxinballSmall entitysmalltoxinball = new EntityToxinballSmall(this.worldObj, this,
- d0 + this.rand.nextGaussian() * f1, d1, d2 + this.rand.nextGaussian() * f1);
- entitysmalltoxinball.posY = this.posY + this.height / 2.0F + 0.5D;
- this.worldObj.spawnEntityInWorld(entitysmalltoxinball);
- }
- }
- }
-
- this.rotationYaw = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
- this.hasAttacked = true;
- }
- }
-
- /**
- * Called when the mob is falling. Calculates and applies fall damage.
- */
- @Override
- protected void fall(float p_70069_1_) {
- }
-
- @Override
- protected Item getDropItem() {
- return Items.slime_ball;
- }
-
- /**
- * Returns true if the entity is on fire. Used by render to add the fire
- * effect on rendering.
- */
- @Override
- public boolean isBurning() {
- return false;
- }
-
- /**
- * Drop 0-2 items of this living's type. @param par1 - Whether this entity
- * has recently been hit by a player. @param par2 - Level of Looting used to
- * kill this mob.
- */
- @Override
- protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
- if (p_70628_1_) {
- int j = this.rand.nextInt(2 + p_70628_2_);
-
- for (int k = 0; k < j; ++k) {
- this.dropItem(getDropItem(), 1);
- }
- }
- }
-
- /**
- * Checks to make sure the light is not too bright where the mob is spawning
- */
- @Override
- protected boolean isValidLightLevel() {
- return true;
- }
-
- @Override
- public int getMaxSpawnedInChunk() {
- return 8;
- }
-} \ No newline at end of file
+ /** Random offset used in floating behaviour */
+ private float heightOffset = 0.5F;
+ /** ticks until heightOffset is randomized */
+ private int heightOffsetUpdateTime;
+
+ private int field_70846_g;
+ private final int mDataWatcherID = 30;
+
+ public EntitySickBlaze(World p_i1731_1_) {
+ super(p_i1731_1_);
+ this.isImmuneToFire = true;
+ this.experienceValue = 10;
+ }
+
+ @Override
+ protected void applyEntityAttributes() {
+ super.applyEntityAttributes();
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.5D);
+ this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D);
+ }
+
+ @Override
+ protected void entityInit() {
+ super.entityInit();
+ this.dataWatcher.addObject(mDataWatcherID, new Byte((byte) 0));
+ }
+
+ /**
+ * Returns the sound this mob makes while it's alive.
+ */
+ @Override
+ protected String getLivingSound() {
+ return "mob.blaze.breathe";
+ }
+
+ /**
+ * Returns the sound this mob makes when it is hurt.
+ */
+ @Override
+ protected String getHurtSound() {
+ return "mob.blaze.hit";
+ }
+
+ /**
+ * Returns the sound this mob makes on death.
+ */
+ @Override
+ protected String getDeathSound() {
+ return "mob.blaze.death";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getBrightnessForRender(float p_70070_1_) {
+ return 15728880;
+ }
+
+ /**
+ * Gets how bright this entity is.
+ */
+ @Override
+ public float getBrightness(float p_70013_1_) {
+ return p_70013_1_;
+ }
+
+ /**
+ * Called frequently so the entity can update its state every tick as
+ * required. For example, zombies and skeletons use this to react to
+ * sunlight and start to burn.
+ */
+ @Override
+ public void onLivingUpdate() {
+ if (!this.worldObj.isRemote) {
+ if (this.isWet()) {
+ this.attackEntityFrom(DamageSource.drown, 1.0F);
+ }
+
+ --this.heightOffsetUpdateTime;
+
+ if (this.heightOffsetUpdateTime <= 0) {
+ this.heightOffsetUpdateTime = 100;
+ this.heightOffset = 0.5F + (float) this.rand.nextGaussian() * 3.0F;
+ }
+
+ if (this.getEntityToAttack() != null
+ && this.getEntityToAttack().posY + this.getEntityToAttack().getEyeHeight()
+ > this.posY + this.getEyeHeight() + this.heightOffset) {
+ this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D;
+ }
+ }
+
+ if (this.rand.nextInt(24) == 0) {
+ /*this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire",
+ 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F);*/
+ }
+
+ if (!this.onGround && this.motionY < 0.0D) {
+ this.motionY *= 0.6D;
+ }
+
+ for (int i = 0; i < 2; ++i) {
+ this.worldObj.spawnParticle(
+ "crit",
+ this.posX + (this.rand.nextDouble() - 0.5D) * this.width,
+ this.posY + this.rand.nextDouble() * this.height,
+ this.posZ + (this.rand.nextDouble() - 0.5D) * this.width,
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+
+ super.onLivingUpdate();
+ }
+
+ /**
+ * Basic mob attack. Default to touch of death in EntityCreature. Overridden
+ * by each mob to define their attack.
+ */
+ @Override
+ protected void attackEntity(Entity entity, float p_70785_2_) {
+ if (this.attackTime <= 0
+ && p_70785_2_ < 2.0F
+ && entity.boundingBox.maxY > this.boundingBox.minY
+ && entity.boundingBox.minY < this.boundingBox.maxY) {
+ this.attackTime = 20;
+ this.attackEntityAsMob(entity);
+ } else if (p_70785_2_ < 30.0F) {
+ double d0 = entity.posX - this.posX;
+ double d1 = entity.boundingBox.minY + entity.height / 2.0F - (this.posY + this.height / 2.0F);
+ double d2 = entity.posZ - this.posZ;
+
+ if (this.attackTime == 0) {
+ ++this.field_70846_g;
+
+ if (this.field_70846_g == 1) {
+ this.attackTime = 60;
+ } else if (this.field_70846_g <= 4) {
+ this.attackTime = 6;
+ } else {
+ this.attackTime = 100;
+ this.field_70846_g = 0;
+ }
+
+ if (this.field_70846_g > 1) {
+ float f1 = MathHelper.sqrt_float(p_70785_2_) * 0.5F;
+ this.worldObj.playAuxSFXAtEntity(
+ (EntityPlayer) null, 1009, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
+
+ for (int i = 0; i < 1; ++i) {
+ EntityToxinballSmall entitysmalltoxinball = new EntityToxinballSmall(
+ this.worldObj,
+ this,
+ d0 + this.rand.nextGaussian() * f1,
+ d1,
+ d2 + this.rand.nextGaussian() * f1);
+ entitysmalltoxinball.posY = this.posY + this.height / 2.0F + 0.5D;
+ this.worldObj.spawnEntityInWorld(entitysmalltoxinball);
+ }
+ }
+ }
+
+ this.rotationYaw = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
+ this.hasAttacked = true;
+ }
+ }
+
+ /**
+ * Called when the mob is falling. Calculates and applies fall damage.
+ */
+ @Override
+ protected void fall(float p_70069_1_) {}
+
+ @Override
+ protected Item getDropItem() {
+ return Items.slime_ball;
+ }
+
+ /**
+ * Returns true if the entity is on fire. Used by render to add the fire
+ * effect on rendering.
+ */
+ @Override
+ public boolean isBurning() {
+ return false;
+ }
+
+ /**
+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity
+ * has recently been hit by a player. @param par2 - Level of Looting used to
+ * kill this mob.
+ */
+ @Override
+ protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
+ if (p_70628_1_) {
+ int j = this.rand.nextInt(2 + p_70628_2_);
+
+ for (int k = 0; k < j; ++k) {
+ this.dropItem(getDropItem(), 1);
+ }
+ }
+ }
+
+ /**
+ * Checks to make sure the light is not too bright where the mob is spawning
+ */
+ @Override
+ protected boolean isValidLightLevel() {
+ return true;
+ }
+
+ @Override
+ public int getMaxSpawnedInChunk() {
+ return 8;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java
index f6f397f59e..b0cbbe2e8d 100644
--- a/src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java
+++ b/src/main/java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java
@@ -1,13 +1,12 @@
package gtPlusPlus.core.entity.monster;
-import java.lang.reflect.Field;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.core.world.explosions.ExplosionHandler;
+import java.lang.reflect.Field;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.*;
@@ -24,530 +23,613 @@ import net.minecraft.world.World;
public class EntityStaballoyConstruct extends EntityIronGolem {
- /*
- * Determines whether or not the entity is in a fluid at all.
- */
- private boolean inFluid = false;
- private boolean mReflectFirstUpdate = true;
- private boolean isReadyToExplode = false;
- private int fuse = 60;
- private int attackTimer;
-
- public EntityStaballoyConstruct(World world) {
- super(world);
- this.experienceValue = 250;
- this.setSize(1.4F, 2.9F);
- this.getNavigator().setAvoidsWater(true);
- this.getNavigator().setBreakDoors(true);
- this.getNavigator().setCanSwim(false);
- this.getNavigator().setAvoidSun(false);
- this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
- this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
- //this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
- this.tasks.addTask(3, new EntityAIMoveTowardsRestriction(this, 1.0D));
- this.tasks.addTask(4, new EntityAIWander(this, 0.6D));
- this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
- this.tasks.addTask(6, new EntityAILookIdle(this));
- this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
- }
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- @Override
- public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
- super.writeEntityToNBT(p_70014_1_);
- p_70014_1_.setBoolean("inFluid", this.inFluid);
- p_70014_1_.setBoolean("isReadyToExplode", this.isReadyToExplode);
- p_70014_1_.setInteger("fuse", this.fuse);
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- @Override
- public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
- super.readEntityFromNBT(p_70037_1_);
- this.inFluid = p_70037_1_.getBoolean("inFluid");
- this.isReadyToExplode = p_70037_1_.getBoolean("isReadyToExplode");
- this.fuse = p_70037_1_.getInteger("fuse");
- }
-
- @Override
- protected void entityInit() {
- super.entityInit();
- this.dataWatcher.addObject(17, Byte.valueOf((byte) 0));
- }
-
- /**
- * Returns true if the newer Entity AI code should be run
- */
- @Override
- public boolean isAIEnabled() {
- return true;
- }
-
- /**
- * main AI tick function, replaces updateEntityActionState
- */
- @Override
- protected void updateAITick() {
- super.updateAITick();
- }
-
- @Override
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(500.0D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D);
- }
-
- /**
- * Decrements the entity's air supply when underwater
- */
- @Override
- protected int decreaseAirSupply(int p_70682_1_) {
- return 0;
- }
-
- @Override
- protected void collideWithEntity(Entity p_82167_1_) {
- if (p_82167_1_ instanceof IMob && this.getRNG().nextInt(20) == 0) {
- this.setAttackTarget((EntityLivingBase) p_82167_1_);
- }
-
- super.collideWithEntity(p_82167_1_);
- }
-
- /**
- * Called frequently so the entity can update its state every tick as
- * required. For example, zombies and skeletons use this to react to
- * sunlight and start to burn.
- */
- @Override
- public void onLivingUpdate() {
- super.onLivingUpdate();
-
- if (this.attackTimer > 0) {
- --this.attackTimer;
- }
-
- if (this.motionX * this.motionX + this.motionZ * this.motionZ > 2.500000277905201E-7D
- && this.rand.nextInt(5) == 0) {
- int i = MathHelper.floor_double(this.posX);
- int j = MathHelper.floor_double(this.posY - 0.20000000298023224D - this.yOffset);
- int k = MathHelper.floor_double(this.posZ);
- Block block = this.worldObj.getBlock(i, j, k);
-
-
-
- if (block.getMaterial() != Material.air) {
- this.worldObj.spawnParticle(
- "blockcrack_" + Block.getIdFromBlock(block) + "_" + this.worldObj.getBlockMetadata(i, j, k),
- this.posX + (this.rand.nextFloat() - 0.5D) * this.width,
- this.boundingBox.minY + 0.1D,
- this.posZ + (this.rand.nextFloat() - 0.5D) * this.width,
- 4.0D * (this.rand.nextFloat() - 0.5D), 0.5D,
- (this.rand.nextFloat() - 0.5D) * 4.0D);
- }
- }
- }
-
- /**
- * Returns true if this entity can attack entities of the specified class.
- */
- @Override
- public boolean canAttackClass(Class clazz) {
- return clazz.equals(this.getClass()) ? false : true;
- }
-
- @Override
- public boolean attackEntityAsMob(Entity p_70652_1_) {
- this.attackTimer = 10;
- this.worldObj.setEntityState(this, (byte) 4);
- boolean flag = p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this),
- 7 + this.rand.nextInt(15));
-
- if (flag) {
- p_70652_1_.motionY += 0.4000000059604645D;
- }
-
- this.playSound("mob.irongolem.throw", 1.0F, 1.0F);
- return flag;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void handleHealthUpdate(byte p_70103_1_) {
- if (p_70103_1_ == 4) {
- this.attackTimer = 10;
- this.playSound("mob.irongolem.throw", 1.0F, 1.0F);
- }
- else {
- super.handleHealthUpdate(p_70103_1_);
- }
- }
-
- @Override
- public Village getVillage() {
- return null;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getAttackTimer() {
- return this.attackTimer;
- }
-
- /**
- * Returns the sound this mob makes when it is hurt.
- */
- @Override
- protected String getHurtSound() {
- return "mob.irongolem.hit";
- }
-
- /**
- * Returns the sound this mob makes on death.
- */
- @Override
- protected String getDeathSound() {
- return "mob.irongolem.death";
- }
-
- @Override
- protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) {
- this.playSound("mob.irongolem.walk", 1.0F, 1.0F);
- }
-
- /**
- * Drop 0-2 items of this living's type. @param par1 - Whether this entity
- * has recently been hit by a player. @param par2 - Level of Looting used to
- * kill this mob.
- */
- @Override
- protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
- int lootingChance = p_70628_2_+1;
- int j = this.rand.nextInt(3);
- int k;
-
- for (k = 0; k < j; ++k) {
- this.entityDropItem(ItemUtils.getItemStackOfAmountFromOreDict("blockStaballoy", 1), 0f);
- }
-
- k = 3 + this.rand.nextInt(3);
-
- for (int l = 0; l < k; ++l) {
- this.entityDropItem(ItemUtils.getItemStackOfAmountFromOreDict("ingotStaballoy", lootingChance), 0f);
- if (MathUtils.randInt(0, 2) == 0){
- this.entityDropItem(ItemUtils.getItemStackOfAmountFromOreDict("plateStaballoy", lootingChance), 0f);
- }
- }
- }
-
- @Override
- public boolean isPlayerCreated() {
- return false;
- }
-
- @Override
- public void setPlayerCreated(boolean p_70849_1_) {
-
- }
-
- /**
- * Called when the mob's health reaches 0.
- */
- @Override
- public void onDeath(DamageSource p_70645_1_) {
- super.onDeath(p_70645_1_);
- }
-
- @Override
- protected String getLivingSound() { //TODO
- return super.getLivingSound();
- }
-
- @Override
- public int getTalkInterval() {
- return 0;
- }
-
- @Override
- protected boolean canDespawn() {
- return true;
- }
-
- @Override
- public void onEntityUpdate() {
- //Set Fire Immunity
- if (!this.isImmuneToFire){
- this.isImmuneToFire = true;
- }
-
- if (!this.worldObj.isRemote) {
- final float hp = getHealth();
- final float modifier = MathUtils.randInt(5,10)/100F;
- final float amountToExplode = (hp*modifier);
-
- if (hp <= amountToExplode && !isReadyToExplode){
- if (this.ticksExisted >= 50) {
- //Logger.INFO("Construct has low hp, trying to enable explosions. HP: "+this.getHealth()+", Max: "+this.getMaxHealth()+", Mod: "+modifier);
- //Logger.INFO("Construct required HP to be <= "+amountToExplode);
- float r = MathUtils.randFloat(0, 10);
- if (r <= 0.1){
- this.isReadyToExplode = true;
- //Logger.INFO("Construct can now explode.");
- }
- }
- }
- //Handle Exploding
- else if (hp <= amountToExplode && isReadyToExplode){
- //Logger.INFO("Trying to explode. ["+this.fuse+"]");
- if (this.fuse-- <= 0){
- //Logger.INFO("Fuse has run out.");
- this.setDead();
- if (!this.worldObj.isRemote)
- {
- this.explode();
- }
- }
- else {
- //Logger.INFO("Ticking fuse and spawning particles.");
-
- int maxFuse = 60;
- int fuseUsed = maxFuse-this.fuse;
- float var2 = (float) (fuseUsed * 0.1);
-
- this.setSize(1.4F+(var2/2), 2.9F+(var2/2));
-
- float r = MathUtils.randFloat(0, 1);
- int r2 = MathUtils.randInt(5, 15);
- for (int o=0;o<r2;o++){
- if (r <= 0.3){
- this.worldObj.spawnParticle("smoke", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
-
- }
- else if (r <= 0.6){
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
-
- }
- if (r <= 0.3){
- this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
-
- }
- else if (r <= 0.7){
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
-
- }
- if (r <= 0.2){
- this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
-
- }
- else if (r <= 0.5){
- this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
-
- }
- else if (r <= 0.7){
- this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
-
- }
- }
-
-
- }
- }
- else {
-
- }
-
- //Get a private field from a super class if it exists.
- if (mFirstUpdateField == null) {
- mFirstUpdateField = ReflectionUtils.getField(this.getClass(), "firstUpdate");
- }
- if (mFirstUpdateField != null && mReflectFirstUpdate == true){
- try {
- this.mReflectFirstUpdate = (boolean) mFirstUpdateField.get(this);
- }
- catch (IllegalArgumentException | IllegalAccessException e) {}
- }
- }
- super.onEntityUpdate();
- }
-
- private static Field mFirstUpdateField;
-
- @Override
- public int getMaxSpawnedInChunk() {
- return 1;
- }
-
- @Override
- public boolean canBreatheUnderwater() {
- return true;
- }
-
- @Override
- public void knockBack(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
- // Do Nothing because he weighs metric shittonnes.
- }
-
- @Override
- protected void setOnFireFromLava() {
- extinguish();
- }
-
- @Override
- public void setFire(int p_70015_1_) {
- extinguish();
- }
-
- @Override
- protected void dealFireDamage(int p_70081_1_) {
-
- }
-
- @Override
- public boolean isInWater() {
- if (super.isInWater()){
- return true;
- }
- else {
- this.moveForward *= 0.98F;
- return false;
- }
- }
-
- @Override
- public boolean handleWaterMovement() {
- this.moveForward *= 0.74F;
- return handleFluidMovement(Material.water);
- }
-
- @Override
- public boolean handleLavaMovement() {
- this.moveForward *= 0.74F;
- return handleFluidMovement(Material.lava);
- }
-
- /**
- * Returns if this entity is in water and will end up adding the waters velocity to the entity
- */
- public boolean handleFluidMovement(Material fluid){
-
-
-
- if (this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.4000000059604645D, 0.0D).contract(0.001D, 0.001D, 0.001D), fluid, this))
- {
- if (!this.inFluid && !this.mReflectFirstUpdate)
- {
- float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F;
-
- if (f > 1.0F)
- {
- f = 1.0F;
- }
-
- this.playSound(this.getSplashSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
- float f1 = MathHelper.floor_double(this.boundingBox.minY);
- int i;
- float f2;
- float f3;
-
- for (i = 0; i < 1.0F + this.width * 20.0F; ++i)
- {
- f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
- f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
- this.worldObj.spawnParticle("bubble", this.posX + f2, f1 + 1.0F, this.posZ + f3, this.motionX, this.motionY - this.rand.nextFloat() * 0.2F, this.motionZ);
- }
-
- for (i = 0; i < 1.0F + this.width * 20.0F; ++i)
- {
- f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
- f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
- this.worldObj.spawnParticle("splash", this.posX + f2, f1 + 1.0F, this.posZ + f3, this.motionX, this.motionY, this.motionZ);
- }
- }
- this.fallDistance = 0.0F;
- this.inFluid = true;
- }
- else
- {
- this.inFluid = false;
- }
- return this.inFluid;
- }
-
- @Override
- public void onChunkLoad() {
- // TODO Auto-generated method stub
- super.onChunkLoad();
- }
-
- @Override
- public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
- this.isReadyToExplode = true;
- this.fuse = 20;
- }
-
- private void explode(){
- /* float f = 12.0F;
+ /*
+ * Determines whether or not the entity is in a fluid at all.
+ */
+ private boolean inFluid = false;
+ private boolean mReflectFirstUpdate = true;
+ private boolean isReadyToExplode = false;
+ private int fuse = 60;
+ private int attackTimer;
+
+ public EntityStaballoyConstruct(World world) {
+ super(world);
+ this.experienceValue = 250;
+ this.setSize(1.4F, 2.9F);
+ this.getNavigator().setAvoidsWater(true);
+ this.getNavigator().setBreakDoors(true);
+ this.getNavigator().setCanSwim(false);
+ this.getNavigator().setAvoidSun(false);
+ this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
+ this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
+ // this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
+ this.tasks.addTask(3, new EntityAIMoveTowardsRestriction(this, 1.0D));
+ this.tasks.addTask(4, new EntityAIWander(this, 0.6D));
+ this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
+ this.tasks.addTask(6, new EntityAILookIdle(this));
+ this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
+ this.targetTasks.addTask(
+ 2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector));
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ @Override
+ public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
+ super.writeEntityToNBT(p_70014_1_);
+ p_70014_1_.setBoolean("inFluid", this.inFluid);
+ p_70014_1_.setBoolean("isReadyToExplode", this.isReadyToExplode);
+ p_70014_1_.setInteger("fuse", this.fuse);
+ }
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ @Override
+ public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
+ super.readEntityFromNBT(p_70037_1_);
+ this.inFluid = p_70037_1_.getBoolean("inFluid");
+ this.isReadyToExplode = p_70037_1_.getBoolean("isReadyToExplode");
+ this.fuse = p_70037_1_.getInteger("fuse");
+ }
+
+ @Override
+ protected void entityInit() {
+ super.entityInit();
+ this.dataWatcher.addObject(17, Byte.valueOf((byte) 0));
+ }
+
+ /**
+ * Returns true if the newer Entity AI code should be run
+ */
+ @Override
+ public boolean isAIEnabled() {
+ return true;
+ }
+
+ /**
+ * main AI tick function, replaces updateEntityActionState
+ */
+ @Override
+ protected void updateAITick() {
+ super.updateAITick();
+ }
+
+ @Override
+ protected void applyEntityAttributes() {
+ super.applyEntityAttributes();
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(500.0D);
+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D);
+ }
+
+ /**
+ * Decrements the entity's air supply when underwater
+ */
+ @Override
+ protected int decreaseAirSupply(int p_70682_1_) {
+ return 0;
+ }
+
+ @Override
+ protected void collideWithEntity(Entity p_82167_1_) {
+ if (p_82167_1_ instanceof IMob && this.getRNG().nextInt(20) == 0) {
+ this.setAttackTarget((EntityLivingBase) p_82167_1_);
+ }
+
+ super.collideWithEntity(p_82167_1_);
+ }
+
+ /**
+ * Called frequently so the entity can update its state every tick as
+ * required. For example, zombies and skeletons use this to react to
+ * sunlight and start to burn.
+ */
+ @Override
+ public void onLivingUpdate() {
+ super.onLivingUpdate();
+
+ if (this.attackTimer > 0) {
+ --this.attackTimer;
+ }
+
+ if (this.motionX * this.motionX + this.motionZ * this.motionZ > 2.500000277905201E-7D
+ && this.rand.nextInt(5) == 0) {
+ int i = MathHelper.floor_double(this.posX);
+ int j = MathHelper.floor_double(this.posY - 0.20000000298023224D - this.yOffset);
+ int k = MathHelper.floor_double(this.posZ);
+ Block block = this.worldObj.getBlock(i, j, k);
+
+ if (block.getMaterial() != Material.air) {
+ this.worldObj.spawnParticle(
+ "blockcrack_" + Block.getIdFromBlock(block) + "_" + this.worldObj.getBlockMetadata(i, j, k),
+ this.posX + (this.rand.nextFloat() - 0.5D) * this.width,
+ this.boundingBox.minY + 0.1D,
+ this.posZ + (this.rand.nextFloat() - 0.5D) * this.width,
+ 4.0D * (this.rand.nextFloat() - 0.5D),
+ 0.5D,
+ (this.rand.nextFloat() - 0.5D) * 4.0D);
+ }
+ }
+ }
+
+ /**
+ * Returns true if this entity can attack entities of the specified class.
+ */
+ @Override
+ public boolean canAttackClass(Class clazz) {
+ return clazz.equals(this.getClass()) ? false : true;
+ }
+
+ @Override
+ public boolean attackEntityAsMob(Entity p_70652_1_) {
+ this.attackTimer = 10;
+ this.worldObj.setEntityState(this, (byte) 4);
+ boolean flag = p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), 7 + this.rand.nextInt(15));
+
+ if (flag) {
+ p_70652_1_.motionY += 0.4000000059604645D;
+ }
+
+ this.playSound("mob.irongolem.throw", 1.0F, 1.0F);
+ return flag;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void handleHealthUpdate(byte p_70103_1_) {
+ if (p_70103_1_ == 4) {
+ this.attackTimer = 10;
+ this.playSound("mob.irongolem.throw", 1.0F, 1.0F);
+ } else {
+ super.handleHealthUpdate(p_70103_1_);
+ }
+ }
+
+ @Override
+ public Village getVillage() {
+ return null;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getAttackTimer() {
+ return this.attackTimer;
+ }
+
+ /**
+ * Returns the sound this mob makes when it is hurt.
+ */
+ @Override
+ protected String getHurtSound() {
+ return "mob.irongolem.hit";
+ }
+
+ /**
+ * Returns the sound this mob makes on death.
+ */
+ @Override
+ protected String getDeathSound() {
+ return "mob.irongolem.death";
+ }
+
+ @Override
+ protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) {
+ this.playSound("mob.irongolem.walk", 1.0F, 1.0F);
+ }
+
+ /**
+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity
+ * has recently been hit by a player. @param par2 - Level of Looting used to
+ * kill this mob.
+ */
+ @Override
+ protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
+ int lootingChance = p_70628_2_ + 1;
+ int j = this.rand.nextInt(3);
+ int k;
+
+ for (k = 0; k < j; ++k) {
+ this.entityDropItem(ItemUtils.getItemStackOfAmountFromOreDict("blockStaballoy", 1), 0f);
+ }
+
+ k = 3 + this.rand.nextInt(3);
+
+ for (int l = 0; l < k; ++l) {
+ this.entityDropItem(ItemUtils.getItemStackOfAmountFromOreDict("ingotStaballoy", lootingChance), 0f);
+ if (MathUtils.randInt(0, 2) == 0) {
+ this.entityDropItem(ItemUtils.getItemStackOfAmountFromOreDict("plateStaballoy", lootingChance), 0f);
+ }
+ }
+ }
+
+ @Override
+ public boolean isPlayerCreated() {
+ return false;
+ }
+
+ @Override
+ public void setPlayerCreated(boolean p_70849_1_) {}
+
+ /**
+ * Called when the mob's health reaches 0.
+ */
+ @Override
+ public void onDeath(DamageSource p_70645_1_) {
+ super.onDeath(p_70645_1_);
+ }
+
+ @Override
+ protected String getLivingSound() { // TODO
+ return super.getLivingSound();
+ }
+
+ @Override
+ public int getTalkInterval() {
+ return 0;
+ }
+
+ @Override
+ protected boolean canDespawn() {
+ return true;
+ }
+
+ @Override
+ public void onEntityUpdate() {
+ // Set Fire Immunity
+ if (!this.isImmuneToFire) {
+ this.isImmuneToFire = true;
+ }
+
+ if (!this.worldObj.isRemote) {
+ final float hp = getHealth();
+ final float modifier = MathUtils.randInt(5, 10) / 100F;
+ final float amountToExplode = (hp * modifier);
+
+ if (hp <= amountToExplode && !isReadyToExplode) {
+ if (this.ticksExisted >= 50) {
+ // Logger.INFO("Construct has low hp, trying to enable explosions. HP: "+this.getHealth()+", Max:
+ // "+this.getMaxHealth()+", Mod: "+modifier);
+ // Logger.INFO("Construct required HP to be <= "+amountToExplode);
+ float r = MathUtils.randFloat(0, 10);
+ if (r <= 0.1) {
+ this.isReadyToExplode = true;
+ // Logger.INFO("Construct can now explode.");
+ }
+ }
+ }
+ // Handle Exploding
+ else if (hp <= amountToExplode && isReadyToExplode) {
+ // Logger.INFO("Trying to explode. ["+this.fuse+"]");
+ if (this.fuse-- <= 0) {
+ // Logger.INFO("Fuse has run out.");
+ this.setDead();
+ if (!this.worldObj.isRemote) {
+ this.explode();
+ }
+ } else {
+ // Logger.INFO("Ticking fuse and spawning particles.");
+
+ int maxFuse = 60;
+ int fuseUsed = maxFuse - this.fuse;
+ float var2 = (float) (fuseUsed * 0.1);
+
+ this.setSize(1.4F + (var2 / 2), 2.9F + (var2 / 2));
+
+ float r = MathUtils.randFloat(0, 1);
+ int r2 = MathUtils.randInt(5, 15);
+ for (int o = 0; o < r2; o++) {
+ if (r <= 0.3) {
+ this.worldObj.spawnParticle(
+ "smoke",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ } else if (r <= 0.6) {
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ if (r <= 0.3) {
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ } else if (r <= 0.7) {
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ if (r <= 0.2) {
+ this.worldObj.spawnParticle(
+ "explode",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ } else if (r <= 0.5) {
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ } else if (r <= 0.7) {
+ this.worldObj.spawnParticle(
+ "hugeexplosion",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
+ }
+ } else {
+
+ }
+
+ // Get a private field from a super class if it exists.
+ if (mFirstUpdateField == null) {
+ mFirstUpdateField = ReflectionUtils.getField(this.getClass(), "firstUpdate");
+ }
+ if (mFirstUpdateField != null && mReflectFirstUpdate == true) {
+ try {
+ this.mReflectFirstUpdate = (boolean) mFirstUpdateField.get(this);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ }
+ super.onEntityUpdate();
+ }
+
+ private static Field mFirstUpdateField;
+
+ @Override
+ public int getMaxSpawnedInChunk() {
+ return 1;
+ }
+
+ @Override
+ public boolean canBreatheUnderwater() {
+ return true;
+ }
+
+ @Override
+ public void knockBack(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
+ // Do Nothing because he weighs metric shittonnes.
+ }
+
+ @Override
+ protected void setOnFireFromLava() {
+ extinguish();
+ }
+
+ @Override
+ public void setFire(int p_70015_1_) {
+ extinguish();
+ }
+
+ @Override
+ protected void dealFireDamage(int p_70081_1_) {}
+
+ @Override
+ public boolean isInWater() {
+ if (super.isInWater()) {
+ return true;
+ } else {
+ this.moveForward *= 0.98F;
+ return false;
+ }
+ }
+
+ @Override
+ public boolean handleWaterMovement() {
+ this.moveForward *= 0.74F;
+ return handleFluidMovement(Material.water);
+ }
+
+ @Override
+ public boolean handleLavaMovement() {
+ this.moveForward *= 0.74F;
+ return handleFluidMovement(Material.lava);
+ }
+
+ /**
+ * Returns if this entity is in water and will end up adding the waters velocity to the entity
+ */
+ public boolean handleFluidMovement(Material fluid) {
+
+ if (this.worldObj.handleMaterialAcceleration(
+ this.boundingBox.expand(0.0D, -0.4000000059604645D, 0.0D).contract(0.001D, 0.001D, 0.001D),
+ fluid,
+ this)) {
+ if (!this.inFluid && !this.mReflectFirstUpdate) {
+ float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D
+ + this.motionY * this.motionY
+ + this.motionZ * this.motionZ * 0.20000000298023224D)
+ * 0.2F;
+
+ if (f > 1.0F) {
+ f = 1.0F;
+ }
+
+ this.playSound(this.getSplashSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
+ float f1 = MathHelper.floor_double(this.boundingBox.minY);
+ int i;
+ float f2;
+ float f3;
+
+ for (i = 0; i < 1.0F + this.width * 20.0F; ++i) {
+ f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
+ f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
+ this.worldObj.spawnParticle(
+ "bubble",
+ this.posX + f2,
+ f1 + 1.0F,
+ this.posZ + f3,
+ this.motionX,
+ this.motionY - this.rand.nextFloat() * 0.2F,
+ this.motionZ);
+ }
+
+ for (i = 0; i < 1.0F + this.width * 20.0F; ++i) {
+ f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
+ f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
+ this.worldObj.spawnParticle(
+ "splash",
+ this.posX + f2,
+ f1 + 1.0F,
+ this.posZ + f3,
+ this.motionX,
+ this.motionY,
+ this.motionZ);
+ }
+ }
+ this.fallDistance = 0.0F;
+ this.inFluid = true;
+ } else {
+ this.inFluid = false;
+ }
+ return this.inFluid;
+ }
+
+ @Override
+ public void onChunkLoad() {
+ // TODO Auto-generated method stub
+ super.onChunkLoad();
+ }
+
+ @Override
+ public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
+ this.isReadyToExplode = true;
+ this.fuse = 20;
+ }
+
+ private void explode() {
+ /* float f = 12.0F;
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true);*/
- if (!this.worldObj.isRemote) {
- final float f = 6.5F;
- ExplosionHandler explode = new ExplosionHandler();
- explode.createExplosion(this.worldObj, this, this.posX, this.posY, this.posZ, f, true, true);
-
- float r = MathUtils.randFloat(0, 1);
- int r2 = MathUtils.randInt(20, 40);
- for (int o=0;o<r2;o++){
- if (r <= 0.3){
- this.worldObj.spawnParticle("smoke", this.posX+MathUtils.randDouble(-4, 4), this.posY+MathUtils.randDouble(0, 3), this.posZ+MathUtils.randDouble(-4, 4), 0.0D, 0.0D, 0.0D);
-
- }
- else if (r <= 0.6){
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(-4, 4), this.posY+MathUtils.randDouble(-4, 4), this.posZ+MathUtils.randDouble(-4, 4), 0.0D, 0.0D, 0.0D);
-
- }
- if (r <= 0.3){
- this.worldObj.spawnParticle("cloud", this.posX+MathUtils.randDouble(-4, 4), this.posY+MathUtils.randDouble(-4, 4), this.posZ+MathUtils.randDouble(-4, 4), 0.0D, 0.0D, 0.0D);
-
- }
- else if (r <= 0.7){
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-4, 4), this.posY+MathUtils.randDouble(-4, 4), this.posZ+MathUtils.randDouble(-4, 4), 0.0D, 0.0D, 0.0D);
-
- }
- if (r <= 0.2){
- this.worldObj.spawnParticle("explode", this.posX+MathUtils.randDouble(-4, 4), this.posY+MathUtils.randDouble(-4, 4), this.posZ+MathUtils.randDouble(-4, 4), 0.0D, 0.0D, 0.0D);
-
- }
- else if (r <= 0.5){
- this.worldObj.spawnParticle("largeexplode", this.posX+MathUtils.randDouble(-4, 4), this.posY+MathUtils.randDouble(-4, 4), this.posZ+MathUtils.randDouble(-4, 4), 0.0D, 0.0D, 0.0D);
-
- }
- else if (r <= 0.7){
- this.worldObj.spawnParticle("hugeexplosion", this.posX+MathUtils.randDouble(-4, 4), this.posY+MathUtils.randDouble(-4, 4), this.posZ+MathUtils.randDouble(-4, 4), 0.0D, 0.0D, 0.0D);
-
- }
- }
- }
-
- }
-
- @Override
- public boolean canAttackWithItem() {
- return true;
- }
-
- @Override
- public boolean canRenderOnFire() {
- return false;
- }
-
- @Override
- public boolean isPushedByWater() {
- return false;
- }
-} \ No newline at end of file
+ if (!this.worldObj.isRemote) {
+ final float f = 6.5F;
+ ExplosionHandler explode = new ExplosionHandler();
+ explode.createExplosion(this.worldObj, this, this.posX, this.posY, this.posZ, f, true, true);
+
+ float r = MathUtils.randFloat(0, 1);
+ int r2 = MathUtils.randInt(20, 40);
+ for (int o = 0; o < r2; o++) {
+ if (r <= 0.3) {
+ this.worldObj.spawnParticle(
+ "smoke",
+ this.posX + MathUtils.randDouble(-4, 4),
+ this.posY + MathUtils.randDouble(0, 3),
+ this.posZ + MathUtils.randDouble(-4, 4),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ } else if (r <= 0.6) {
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(-4, 4),
+ this.posY + MathUtils.randDouble(-4, 4),
+ this.posZ + MathUtils.randDouble(-4, 4),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ if (r <= 0.3) {
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.posX + MathUtils.randDouble(-4, 4),
+ this.posY + MathUtils.randDouble(-4, 4),
+ this.posZ + MathUtils.randDouble(-4, 4),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ } else if (r <= 0.7) {
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-4, 4),
+ this.posY + MathUtils.randDouble(-4, 4),
+ this.posZ + MathUtils.randDouble(-4, 4),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ if (r <= 0.2) {
+ this.worldObj.spawnParticle(
+ "explode",
+ this.posX + MathUtils.randDouble(-4, 4),
+ this.posY + MathUtils.randDouble(-4, 4),
+ this.posZ + MathUtils.randDouble(-4, 4),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ } else if (r <= 0.5) {
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.posX + MathUtils.randDouble(-4, 4),
+ this.posY + MathUtils.randDouble(-4, 4),
+ this.posZ + MathUtils.randDouble(-4, 4),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ } else if (r <= 0.7) {
+ this.worldObj.spawnParticle(
+ "hugeexplosion",
+ this.posX + MathUtils.randDouble(-4, 4),
+ this.posY + MathUtils.randDouble(-4, 4),
+ this.posZ + MathUtils.randDouble(-4, 4),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean canAttackWithItem() {
+ return true;
+ }
+
+ @Override
+ public boolean canRenderOnFire() {
+ return false;
+ }
+
+ @Override
+ public boolean isPushedByWater() {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java
index 9f3e6b8bf1..0e8174339e 100644
--- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java
+++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java
@@ -1,5 +1,9 @@
package gtPlusPlus.core.entity.projectile;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,117 +15,126 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
public class EntityHydrofluoricAcidPotion extends EntityThrowable {
- public EntityHydrofluoricAcidPotion(World world) {
- super(world);
- }
-
- public EntityHydrofluoricAcidPotion(World world, EntityLivingBase entity) {
- super(world, entity);
- }
-
- public EntityHydrofluoricAcidPotion(World world, double posX, double posY, double posZ) {
- super(world, posX, posY, posZ);
- }
-
- /**
- * Called when this EntityThrowable hits a block or entity.
- */
- @Override
- protected void onImpact(MovingObjectPosition object) {
- int xBlock = object.blockX;
- int yBlock = object.blockY;
- int zBlock = object.blockZ;
- if (object.entityHit != null) {
- byte b0 = 6;
- if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)){
- object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
- EntityUtils.setEntityOnFire(object.entityHit, 5);
-
- if (object.entityHit instanceof EntityPlayer){
- EntityPlayer mPlayer = (EntityPlayer) object.entityHit;
- mPlayer.addPotionEffect(new PotionEffect(Potion.blindness.getId(), 200, 1));
- mPlayer.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 300, 2));
- mPlayer.addPotionEffect(new PotionEffect(Potion.confusion.getId(), 250, 2));
- }
-
- object.entityHit.fireResistance = 0;
- ravage(EntityUtils.findBlockPosUnderEntity(object.entityHit));
-
- }
- }
- if (object.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK){
- ravage(new BlockPos(xBlock, yBlock, zBlock));
- }
-
- String mParticleType = "reddust";
- int e=0;
- for (int i = 0; i < 24; ++i) {
- if ((e = MathUtils.randInt(0, 5)) <= 1){
- if (e==0)
- mParticleType = "largesmoke";
- if (e==1)
- mParticleType = "flame";
- }
- this.worldObj.spawnParticle(mParticleType, this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- }
-
- if (!this.worldObj.isRemote) {
- this.setDead();
- }
- }
-
- private boolean ravage(BlockPos blockpos){
-
- int radius = 2;
-
- for (int i=(blockpos.xPos-radius);i<(blockpos.xPos+radius);i++){
- for (int j=(blockpos.yPos-radius);j<(blockpos.yPos+radius);j++){
- for (int h=(blockpos.zPos-radius);h<(blockpos.zPos+radius);h++){
-
- int mChance = MathUtils.randInt(1, 10);
- if (mChance <= 3){
- Block mBlockhit = worldObj.getBlock(i, j, h);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
-
- //GT_Pollution.addPollution(worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos), mPol);
-
- if (mBlockhit == Blocks.grass || mBlockhit == Blocks.mycelium){
- worldObj.setBlock(i, j+1, h, Blocks.fire);
- worldObj.setBlock(i, j, h, Blocks.dirt);
- }
- else if (mBlockhit == Blocks.leaves || mBlockhit == Blocks.leaves2){
- worldObj.setBlock(i, j, h, Blocks.fire);
- }
- else if (mBlockhit == Blocks.tallgrass){
- worldObj.setBlock(i, j, h, Blocks.fire);
- if (worldObj.getBlock(i, j-1, h) == Blocks.grass){
- worldObj.setBlock(i, j-1, h, Blocks.dirt);
- }
- }
- else if (mBlockhit == Blocks.carrots || mBlockhit == Blocks.melon_block || mBlockhit == Blocks.pumpkin || mBlockhit == Blocks.potatoes){
- worldObj.setBlock(i, j+1, h, Blocks.fire);
- worldObj.setBlock(i, j, h, Blocks.dirt);
- }
- else if (mBlockhit == Blocks.air){
- worldObj.setBlock(i, j, h, Blocks.fire);
- }
- }
- }
- }
- }
-
-
- return true;
- }
-
-
-} \ No newline at end of file
+ public EntityHydrofluoricAcidPotion(World world) {
+ super(world);
+ }
+
+ public EntityHydrofluoricAcidPotion(World world, EntityLivingBase entity) {
+ super(world, entity);
+ }
+
+ public EntityHydrofluoricAcidPotion(World world, double posX, double posY, double posZ) {
+ super(world, posX, posY, posZ);
+ }
+
+ /**
+ * Called when this EntityThrowable hits a block or entity.
+ */
+ @Override
+ protected void onImpact(MovingObjectPosition object) {
+ int xBlock = object.blockX;
+ int yBlock = object.blockY;
+ int zBlock = object.blockZ;
+ if (object.entityHit != null) {
+ byte b0 = 6;
+ if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)) {
+ object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
+ EntityUtils.setEntityOnFire(object.entityHit, 5);
+
+ if (object.entityHit instanceof EntityPlayer) {
+ EntityPlayer mPlayer = (EntityPlayer) object.entityHit;
+ mPlayer.addPotionEffect(new PotionEffect(Potion.blindness.getId(), 200, 1));
+ mPlayer.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 300, 2));
+ mPlayer.addPotionEffect(new PotionEffect(Potion.confusion.getId(), 250, 2));
+ }
+
+ object.entityHit.fireResistance = 0;
+ ravage(EntityUtils.findBlockPosUnderEntity(object.entityHit));
+ }
+ }
+ if (object.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
+ ravage(new BlockPos(xBlock, yBlock, zBlock));
+ }
+
+ String mParticleType = "reddust";
+ int e = 0;
+ for (int i = 0; i < 24; ++i) {
+ if ((e = MathUtils.randInt(0, 5)) <= 1) {
+ if (e == 0) mParticleType = "largesmoke";
+ if (e == 1) mParticleType = "flame";
+ }
+ this.worldObj.spawnParticle(
+ mParticleType,
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+
+ if (!this.worldObj.isRemote) {
+ this.setDead();
+ }
+ }
+
+ private boolean ravage(BlockPos blockpos) {
+
+ int radius = 2;
+
+ for (int i = (blockpos.xPos - radius); i < (blockpos.xPos + radius); i++) {
+ for (int j = (blockpos.yPos - radius); j < (blockpos.yPos + radius); j++) {
+ for (int h = (blockpos.zPos - radius); h < (blockpos.zPos + radius); h++) {
+
+ int mChance = MathUtils.randInt(1, 10);
+ if (mChance <= 3) {
+ Block mBlockhit = worldObj.getBlock(i, j, h);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ // GT_Pollution.addPollution(worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos),
+ // mPol);
+
+ if (mBlockhit == Blocks.grass || mBlockhit == Blocks.mycelium) {
+ worldObj.setBlock(i, j + 1, h, Blocks.fire);
+ worldObj.setBlock(i, j, h, Blocks.dirt);
+ } else if (mBlockhit == Blocks.leaves || mBlockhit == Blocks.leaves2) {
+ worldObj.setBlock(i, j, h, Blocks.fire);
+ } else if (mBlockhit == Blocks.tallgrass) {
+ worldObj.setBlock(i, j, h, Blocks.fire);
+ if (worldObj.getBlock(i, j - 1, h) == Blocks.grass) {
+ worldObj.setBlock(i, j - 1, h, Blocks.dirt);
+ }
+ } else if (mBlockhit == Blocks.carrots
+ || mBlockhit == Blocks.melon_block
+ || mBlockhit == Blocks.pumpkin
+ || mBlockhit == Blocks.potatoes) {
+ worldObj.setBlock(i, j + 1, h, Blocks.fire);
+ worldObj.setBlock(i, j, h, Blocks.dirt);
+ } else if (mBlockhit == Blocks.air) {
+ worldObj.setBlock(i, j, h, Blocks.fire);
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java
index 868517d1db..c1778309e3 100644
--- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java
+++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java
@@ -13,64 +13,75 @@ import net.minecraft.world.World;
public class EntityLightningAttack extends EntityWitherSkull {
- public EntityLightningAttack(World p_i1793_1_)
- {
+ public EntityLightningAttack(World p_i1793_1_) {
super(p_i1793_1_);
this.setSize(0.3125F, 0.3125F);
}
- public EntityLightningAttack(World p_i1794_1_, EntityLivingBase p_i1794_2_, double p_i1794_3_, double p_i1794_5_, double p_i1794_7_)
- {
+ public EntityLightningAttack(
+ World p_i1794_1_, EntityLivingBase p_i1794_2_, double p_i1794_3_, double p_i1794_5_, double p_i1794_7_) {
super(p_i1794_1_, p_i1794_2_, p_i1794_3_, p_i1794_5_, p_i1794_7_);
this.setSize(0.3125F, 0.3125F);
}
@SideOnly(Side.CLIENT)
- public EntityLightningAttack(World p_i1795_1_, double p_i1795_2_, double p_i1795_4_, double p_i1795_6_, double p_i1795_8_, double p_i1795_10_, double p_i1795_12_)
- {
+ public EntityLightningAttack(
+ World p_i1795_1_,
+ double p_i1795_2_,
+ double p_i1795_4_,
+ double p_i1795_6_,
+ double p_i1795_8_,
+ double p_i1795_10_,
+ double p_i1795_12_) {
super(p_i1795_1_, p_i1795_2_, p_i1795_4_, p_i1795_6_, p_i1795_8_, p_i1795_10_, p_i1795_12_);
this.setSize(0.3125F, 0.3125F);
- }
-
+ }
/**
* Called when this EntityFireball hits a block or entity.
*/
- protected void onImpact(MovingObjectPosition p_70227_1_) {
-
- if (!this.worldObj.isRemote) {
- if (p_70227_1_.entityHit != null) {
- if (this.shootingEntity != null) {
- if (p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F)
- && !p_70227_1_.entityHit.isEntityAlive()) {
- this.shootingEntity.heal(0.5F);
- }
- } else {
- p_70227_1_.entityHit.attackEntityFrom(DamageSource.lava, 10.0F);
- }
+ protected void onImpact(MovingObjectPosition p_70227_1_) {
- if (p_70227_1_.entityHit instanceof EntityLivingBase) {
- byte b0 = 0;
+ if (!this.worldObj.isRemote) {
+ if (p_70227_1_.entityHit != null) {
+ if (this.shootingEntity != null) {
+ if (p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F)
+ && !p_70227_1_.entityHit.isEntityAlive()) {
+ this.shootingEntity.heal(0.5F);
+ }
+ } else {
+ p_70227_1_.entityHit.attackEntityFrom(DamageSource.lava, 10.0F);
+ }
- if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL) {
- b0 = 10;
- } else if (this.worldObj.difficultySetting == EnumDifficulty.HARD) {
- b0 = 40;
- }
+ if (p_70227_1_.entityHit instanceof EntityLivingBase) {
+ byte b0 = 0;
- if (b0 > 0) {
- ((EntityLivingBase) p_70227_1_.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 20 * b0, 1));
- ((EntityLivingBase) p_70227_1_.entityHit).addPotionEffect(new PotionEffect(Potion.confusion.id, 20 * b0, 1));
- ((EntityLivingBase) p_70227_1_.entityHit).addPotionEffect(new PotionEffect(Potion.weakness.id, 20 * b0, 1));
- }
- }
- }
+ if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL) {
+ b0 = 10;
+ } else if (this.worldObj.difficultySetting == EnumDifficulty.HARD) {
+ b0 = 40;
+ }
- this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false,
- this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
- this.setDead();
- }
- }
+ if (b0 > 0) {
+ ((EntityLivingBase) p_70227_1_.entityHit)
+ .addPotionEffect(new PotionEffect(Potion.poison.id, 20 * b0, 1));
+ ((EntityLivingBase) p_70227_1_.entityHit)
+ .addPotionEffect(new PotionEffect(Potion.confusion.id, 20 * b0, 1));
+ ((EntityLivingBase) p_70227_1_.entityHit)
+ .addPotionEffect(new PotionEffect(Potion.weakness.id, 20 * b0, 1));
+ }
+ }
+ }
-
-} \ No newline at end of file
+ this.worldObj.newExplosion(
+ this,
+ this.posX,
+ this.posY,
+ this.posZ,
+ 1.0F,
+ false,
+ this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
+ this.setDead();
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java
index 7660dd1b75..c153232b60 100644
--- a/src/main/java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java
+++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java
@@ -1,5 +1,9 @@
package gtPlusPlus.core.entity.projectile;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityThrowable;
@@ -8,108 +12,118 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
public class EntitySulfuricAcidPotion extends EntityThrowable {
- public EntitySulfuricAcidPotion(World world) {
- super(world);
- }
-
- public EntitySulfuricAcidPotion(World world, EntityLivingBase entity) {
- super(world, entity);
- }
-
- public EntitySulfuricAcidPotion(World world, double posX, double posY, double posZ) {
- super(world, posX, posY, posZ);
- }
-
- /**
- * Called when this EntityThrowable hits a block or entity.
- */
- @Override
- protected void onImpact(MovingObjectPosition object) {
- int xBlock = object.blockX;
- int yBlock = object.blockY;
- int zBlock = object.blockZ;
- if (object.entityHit != null) {
- byte b0 = 6;
- if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)){
- object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
- EntityUtils.setEntityOnFire(object.entityHit, 10);
- object.entityHit.fireResistance = 0;
- ravage(EntityUtils.findBlockPosUnderEntity(object.entityHit));
- }
- }
- if (object.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK){
- ravage(new BlockPos(xBlock, yBlock, zBlock));
- }
-
- String mParticleType = "reddust";
- int e=0;
- for (int i = 0; i < 24; ++i) {
- if ((e = MathUtils.randInt(0, 5)) <= 1){
- if (e==0)
- mParticleType = "largesmoke";
- if (e==1)
- mParticleType = "flame";
- }
- this.worldObj.spawnParticle(mParticleType, this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- }
-
- if (!this.worldObj.isRemote) {
- this.setDead();
- }
- }
-
- private boolean ravage(BlockPos blockpos){
-
- int radius = 1;
-
- for (int i=(blockpos.xPos-radius);i<(blockpos.xPos+radius);i++){
- for (int j=(blockpos.yPos-radius);j<(blockpos.yPos+radius);j++){
- for (int h=(blockpos.zPos-radius);h<(blockpos.zPos+radius);h++){
-
- int mChance = MathUtils.randInt(1, 10);
- if (mChance <= 3){
- Block mBlockhit = worldObj.getBlock(i, j, h);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
-
- //GT_Pollution.addPollution(worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos), mPol);
-
- if (mBlockhit == Blocks.grass || mBlockhit == Blocks.mycelium){
- worldObj.setBlock(i, j+1, h, Blocks.fire);
- worldObj.setBlock(i, j, h, Blocks.dirt);
- }
- else if (mBlockhit == Blocks.leaves || mBlockhit == Blocks.leaves2){
- worldObj.setBlock(i, j, h, Blocks.fire);
- }
- else if (mBlockhit == Blocks.tallgrass){
- worldObj.setBlock(i, j, h, Blocks.fire);
- if (worldObj.getBlock(i, j-1, h) == Blocks.grass){
- worldObj.setBlock(i, j-1, h, Blocks.dirt);
- }
- }
- else if (mBlockhit == Blocks.carrots || mBlockhit == Blocks.melon_block || mBlockhit == Blocks.pumpkin || mBlockhit == Blocks.potatoes){
- worldObj.setBlock(i, j+1, h, Blocks.fire);
- worldObj.setBlock(i, j, h, Blocks.dirt);
- }
- else if (mBlockhit == Blocks.air){
- worldObj.setBlock(i, j, h, Blocks.fire);
- }
- }
- }
- }
- }
-
-
- return true;
- }
-
-
-} \ No newline at end of file
+ public EntitySulfuricAcidPotion(World world) {
+ super(world);
+ }
+
+ public EntitySulfuricAcidPotion(World world, EntityLivingBase entity) {
+ super(world, entity);
+ }
+
+ public EntitySulfuricAcidPotion(World world, double posX, double posY, double posZ) {
+ super(world, posX, posY, posZ);
+ }
+
+ /**
+ * Called when this EntityThrowable hits a block or entity.
+ */
+ @Override
+ protected void onImpact(MovingObjectPosition object) {
+ int xBlock = object.blockX;
+ int yBlock = object.blockY;
+ int zBlock = object.blockZ;
+ if (object.entityHit != null) {
+ byte b0 = 6;
+ if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)) {
+ object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0);
+ EntityUtils.setEntityOnFire(object.entityHit, 10);
+ object.entityHit.fireResistance = 0;
+ ravage(EntityUtils.findBlockPosUnderEntity(object.entityHit));
+ }
+ }
+ if (object.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
+ ravage(new BlockPos(xBlock, yBlock, zBlock));
+ }
+
+ String mParticleType = "reddust";
+ int e = 0;
+ for (int i = 0; i < 24; ++i) {
+ if ((e = MathUtils.randInt(0, 5)) <= 1) {
+ if (e == 0) mParticleType = "largesmoke";
+ if (e == 1) mParticleType = "flame";
+ }
+ this.worldObj.spawnParticle(
+ mParticleType,
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+
+ if (!this.worldObj.isRemote) {
+ this.setDead();
+ }
+ }
+
+ private boolean ravage(BlockPos blockpos) {
+
+ int radius = 1;
+
+ for (int i = (blockpos.xPos - radius); i < (blockpos.xPos + radius); i++) {
+ for (int j = (blockpos.yPos - radius); j < (blockpos.yPos + radius); j++) {
+ for (int h = (blockpos.zPos - radius); h < (blockpos.zPos + radius); h++) {
+
+ int mChance = MathUtils.randInt(1, 10);
+ if (mChance <= 3) {
+ Block mBlockhit = worldObj.getBlock(i, j, h);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+
+ // GT_Pollution.addPollution(worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos),
+ // mPol);
+
+ if (mBlockhit == Blocks.grass || mBlockhit == Blocks.mycelium) {
+ worldObj.setBlock(i, j + 1, h, Blocks.fire);
+ worldObj.setBlock(i, j, h, Blocks.dirt);
+ } else if (mBlockhit == Blocks.leaves || mBlockhit == Blocks.leaves2) {
+ worldObj.setBlock(i, j, h, Blocks.fire);
+ } else if (mBlockhit == Blocks.tallgrass) {
+ worldObj.setBlock(i, j, h, Blocks.fire);
+ if (worldObj.getBlock(i, j - 1, h) == Blocks.grass) {
+ worldObj.setBlock(i, j - 1, h, Blocks.dirt);
+ }
+ } else if (mBlockhit == Blocks.carrots
+ || mBlockhit == Blocks.melon_block
+ || mBlockhit == Blocks.pumpkin
+ || mBlockhit == Blocks.potatoes) {
+ worldObj.setBlock(i, j + 1, h, Blocks.fire);
+ worldObj.setBlock(i, j, h, Blocks.dirt);
+ } else if (mBlockhit == Blocks.air) {
+ worldObj.setBlock(i, j, h, Blocks.fire);
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java
index 49daa459e0..c7003d1f0c 100644
--- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java
+++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityThrowableBomb.java
@@ -1,5 +1,10 @@
package gtPlusPlus.core.entity.projectile;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityThrowable;
@@ -8,138 +13,301 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-
public class EntityThrowableBomb extends EntityThrowable {
- public EntityThrowableBomb(World world) {
- super(world);
- }
-
- public EntityThrowableBomb(World world, EntityLivingBase entity) {
- super(world, entity);
- }
-
- public EntityThrowableBomb(World world, double posX, double posY, double posZ) {
- super(world, posX, posY, posZ);
- }
-
- /**
- * Called when this EntityThrowable hits a block or entity.
- */
- @Override
- protected void onImpact(MovingObjectPosition object) {
- int xBlock = object.blockX;
- int yBlock = object.blockY;
- int zBlock = object.blockZ;
- if (object.entityHit != null) {
- byte b0 = 6;
- if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)){
- object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 20);
- EntityUtils.setEntityOnFire(object.entityHit, 20);
- object.entityHit.fireResistance = 0;
- ravage(EntityUtils.findBlockPosUnderEntity(object.entityHit));
- }
- }
- if (object.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK){
+ public EntityThrowableBomb(World world) {
+ super(world);
+ }
- ravage(new BlockPos(xBlock, yBlock, zBlock));
- for (BlockPos aSur : new BlockPos(xBlock, yBlock, zBlock).getSurroundingBlocks()) {
- ravage(new BlockPos(aSur.xPos, aSur.yPos, aSur.zPos));
- for (BlockPos aSur2 : new BlockPos(aSur.xPos, aSur.yPos, aSur.zPos).getSurroundingBlocks()) {
- //ravage(new BlockPos(aSur2.xPos, aSur2.yPos, aSur2.zPos));
- }
- }
- }
+ public EntityThrowableBomb(World world, EntityLivingBase entity) {
+ super(world, entity);
+ }
- String mParticleType = "reddust";
- int e=0;
- for (int i = 0; i < 127; ++i) {
- if ((e = MathUtils.randInt(0, 5)) <= 1){
- if (e==0)
- mParticleType = "largesmoke";
- if (e==1)
- mParticleType = "flame";
- }
- this.worldObj.spawnParticle(mParticleType, this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- }
+ public EntityThrowableBomb(World world, double posX, double posY, double posZ) {
+ super(world, posX, posY, posZ);
+ }
- if (!this.worldObj.isRemote) {
- this.setDead();
- }
- }
+ /**
+ * Called when this EntityThrowable hits a block or entity.
+ */
+ @Override
+ protected void onImpact(MovingObjectPosition object) {
+ int xBlock = object.blockX;
+ int yBlock = object.blockY;
+ int zBlock = object.blockZ;
+ if (object.entityHit != null) {
+ byte b0 = 6;
+ if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)) {
+ object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 20);
+ EntityUtils.setEntityOnFire(object.entityHit, 20);
+ object.entityHit.fireResistance = 0;
+ ravage(EntityUtils.findBlockPosUnderEntity(object.entityHit));
+ }
+ }
+ if (object.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
- private boolean ravage(BlockPos blockpos){
+ ravage(new BlockPos(xBlock, yBlock, zBlock));
+ for (BlockPos aSur : new BlockPos(xBlock, yBlock, zBlock).getSurroundingBlocks()) {
+ ravage(new BlockPos(aSur.xPos, aSur.yPos, aSur.zPos));
+ for (BlockPos aSur2 : new BlockPos(aSur.xPos, aSur.yPos, aSur.zPos).getSurroundingBlocks()) {
+ // ravage(new BlockPos(aSur2.xPos, aSur2.yPos, aSur2.zPos));
+ }
+ }
+ }
- int radius = 5;
+ String mParticleType = "reddust";
+ int e = 0;
+ for (int i = 0; i < 127; ++i) {
+ if ((e = MathUtils.randInt(0, 5)) <= 1) {
+ if (e == 0) mParticleType = "largesmoke";
+ if (e == 1) mParticleType = "flame";
+ }
+ this.worldObj.spawnParticle(
+ mParticleType,
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
- for (int i=(blockpos.xPos-radius);i<(blockpos.xPos+radius);i++){
- for (int j=(blockpos.yPos-radius);j<(blockpos.yPos+radius);j++){
- for (int h=(blockpos.zPos-radius);h<(blockpos.zPos+radius);h++){
+ if (!this.worldObj.isRemote) {
+ this.setDead();
+ }
+ }
- int mChance = MathUtils.randInt(0, 100);
- if (mChance <= 3){
- Block mBlockhit = worldObj.getBlock(i, j, h);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.posX+MathUtils.randDouble(-2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.posX+MathUtils.randDouble(2, 2), this.posY+MathUtils.randDouble(-2, 2), this.posZ+MathUtils.randDouble(-2, 2), 0.0D, 0.0D, 0.0D);
+ private boolean ravage(BlockPos blockpos) {
- PollutionUtils.addPollution(worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos), 500);
- this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 0.01f, true);
- if (mBlockhit == Blocks.grass || mBlockhit == Blocks.mycelium){
- worldObj.setBlock(i, j+1, h, Blocks.fire);
- worldObj.setBlock(i, j, h, Blocks.dirt);
- }
- else if (mBlockhit == Blocks.leaves || mBlockhit == Blocks.leaves2){
- worldObj.setBlock(i, j, h, Blocks.fire);
- }
- else if (mBlockhit == Blocks.tallgrass){
- worldObj.setBlock(i, j, h, Blocks.fire);
- if (worldObj.getBlock(i, j-1, h) == Blocks.grass){
- worldObj.setBlock(i, j-1, h, Blocks.dirt);
- }
- }
- else if (mBlockhit == Blocks.carrots || mBlockhit == Blocks.melon_block || mBlockhit == Blocks.pumpkin || mBlockhit == Blocks.potatoes){
- worldObj.setBlock(i, j+1, h, Blocks.fire);
- worldObj.setBlock(i, j, h, Blocks.dirt);
- }
- else if (mBlockhit == Blocks.air){
- worldObj.setBlock(i, j, h, Blocks.fire);
- }
- }
- }
- }
- }
+ int radius = 5;
+ for (int i = (blockpos.xPos - radius); i < (blockpos.xPos + radius); i++) {
+ for (int j = (blockpos.yPos - radius); j < (blockpos.yPos + radius); j++) {
+ for (int h = (blockpos.zPos - radius); h < (blockpos.zPos + radius); h++) {
- return true;
- }
+ int mChance = MathUtils.randInt(0, 100);
+ if (mChance <= 3) {
+ Block mBlockhit = worldObj.getBlock(i, j, h);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.posX + MathUtils.randDouble(-2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.posX + MathUtils.randDouble(2, 2),
+ this.posY + MathUtils.randDouble(-2, 2),
+ this.posZ + MathUtils.randDouble(-2, 2),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ PollutionUtils.addPollution(
+ worldObj.getChunkFromBlockCoords(blockpos.xPos, blockpos.zPos), 500);
+ this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 0.01f, true);
+ if (mBlockhit == Blocks.grass || mBlockhit == Blocks.mycelium) {
+ worldObj.setBlock(i, j + 1, h, Blocks.fire);
+ worldObj.setBlock(i, j, h, Blocks.dirt);
+ } else if (mBlockhit == Blocks.leaves || mBlockhit == Blocks.leaves2) {
+ worldObj.setBlock(i, j, h, Blocks.fire);
+ } else if (mBlockhit == Blocks.tallgrass) {
+ worldObj.setBlock(i, j, h, Blocks.fire);
+ if (worldObj.getBlock(i, j - 1, h) == Blocks.grass) {
+ worldObj.setBlock(i, j - 1, h, Blocks.dirt);
+ }
+ } else if (mBlockhit == Blocks.carrots
+ || mBlockhit == Blocks.melon_block
+ || mBlockhit == Blocks.pumpkin
+ || mBlockhit == Blocks.potatoes) {
+ worldObj.setBlock(i, j + 1, h, Blocks.fire);
+ worldObj.setBlock(i, j, h, Blocks.dirt);
+ } else if (mBlockhit == Blocks.air) {
+ worldObj.setBlock(i, j, h, Blocks.fire);
+ }
+ }
+ }
+ }
+ }
-} \ No newline at end of file
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java
index 4fe72345b2..7d137738be 100644
--- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java
+++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinball.java
@@ -1,10 +1,8 @@
package gtPlusPlus.core.entity.projectile;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -15,313 +13,316 @@ import net.minecraft.util.*;
import net.minecraft.world.World;
public abstract class EntityToxinball extends EntityFireball {
- protected int entityX = -1;
- protected int entityY = -1;
- protected int entityZ = -1;
- private Block block;
- private boolean inGround;
- private int ticksAlive;
- private int ticksInAir;
-
- public EntityToxinball(World world) {
- super(world);
- this.setSize(1.0F, 1.0F);
- }
-
- @Override
- protected void entityInit() {
- }
-
- /**
- * Checks if the entity is in range to render by using the past in distance
- * and comparing it to its average edge length * 64 * renderDistanceWeight
- * Args: distance
- */
- @Override
- @SideOnly(Side.CLIENT)
- public boolean isInRangeToRenderDist(double p_70112_1_) {
- double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
- d1 *= 64.0D;
- return p_70112_1_ < d1 * d1;
- }
-
- public EntityToxinball(World world, double x, double y, double z, double f1, double f2, double f3) {
- super(world);
- this.setSize(1.0F, 1.0F);
- this.setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch);
- this.setPosition(x, y, z);
- double d6 = MathHelper
- .sqrt_double(f1 * f1 + f2 * f2 + f3 * f3);
- this.accelerationX = f1 / d6 * 0.1D;
- this.accelerationY = f2 / d6 * 0.1D;
- this.accelerationZ = f3 / d6 * 0.1D;
- }
-
- public EntityToxinball(World world, EntityLivingBase entity, double x, double y, double z) {
- super(world);
- this.shootingEntity = entity;
- this.setSize(1.0F, 1.0F);
- this.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw,
- entity.rotationPitch);
- this.setPosition(this.entityX, this.entityY, this.entityZ);
- this.yOffset = 0.0F;
- this.motionX = this.motionY = this.motionZ = 0.0D;
- x += this.rand.nextGaussian() * 0.4D;
- y += this.rand.nextGaussian() * 0.4D;
- z += this.rand.nextGaussian() * 0.4D;
- double d3 = MathHelper.sqrt_double(x * x + y * y + z * z);
- this.accelerationX = x / d3 * 0.1D;
- this.accelerationY = y / d3 * 0.1D;
- this.accelerationZ = z / d3 * 0.1D;
- }
-
- /**
- * Called to update the entity's position/logic.
- */
- @Override
- public void onUpdate() {
- if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead
- || !this.worldObj.blockExists(this.entityX, this.entityY, this.entityZ))) {
- this.setDead();
- }
- else {
- super.onUpdate();
- this.setFire(1);
-
- if (this.inGround) {
- if (this.worldObj.getBlock(this.entityX, this.entityY,
- this.entityZ) == this.block) {
- ++this.ticksAlive;
-
- if (this.ticksAlive == 600) {
- this.setDead();
- }
-
- return;
- }
-
- this.inGround = false;
- this.motionX *= this.rand.nextFloat() * 0.2F;
- this.motionY *= this.rand.nextFloat() * 0.2F;
- this.motionZ *= this.rand.nextFloat() * 0.2F;
- this.ticksAlive = 0;
- this.ticksInAir = 0;
- }
- else {
- ++this.ticksInAir;
- }
-
- Vec3 vec3 = Vec3.createVectorHelper(this.entityX, this.entityY, this.entityZ);
- Vec3 vec31 = Vec3.createVectorHelper(this.entityX + this.motionX, this.entityY + this.motionY,
- this.entityZ + this.motionZ);
- MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31);
- vec3 = Vec3.createVectorHelper(this.entityX, this.entityY, this.entityZ);
- vec31 = Vec3.createVectorHelper(this.entityX + this.motionX, this.entityY + this.motionY,
- this.entityZ + this.motionZ);
-
- if (movingobjectposition != null) {
- vec31 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord,
- movingobjectposition.hitVec.zCoord);
- }
-
- Entity entity = null;
- List<?> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,
- this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
- double d0 = 0.0D;
-
- for (int i = 0; i < list.size(); ++i) {
- Entity entity1 = (Entity) list.get(i);
-
- if (entity1.canBeCollidedWith()
- && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
- float f = 0.3F;
- AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
- MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
-
- if (movingobjectposition1 != null) {
- double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
-
- if (d1 < d0 || d0 == 0.0D) {
- entity = entity1;
- d0 = d1;
- }
- }
- }
- }
-
- if (entity != null) {
- movingobjectposition = new MovingObjectPosition(entity);
- }
-
- if (movingobjectposition != null) {
- this.onImpact(movingobjectposition);
- }
-
- this.entityX += this.motionX;
- this.entityY += this.motionY;
- this.entityZ += this.motionZ;
- float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
- this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
-
- for (this.rotationPitch = (float) (Math.atan2(f1, this.motionY) * 180.0D / Math.PI)
- - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
- ;
- }
-
- while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
- this.prevRotationPitch += 360.0F;
- }
-
- while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
- this.prevRotationYaw -= 360.0F;
- }
-
- while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
- this.prevRotationYaw += 360.0F;
- }
-
- this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
- this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
- float f2 = this.getMotionFactor();
-
- if (this.isInWater()) {
- for (int j = 0; j < 4; ++j) {
- float f3 = 0.25F;
- this.worldObj.spawnParticle("bubble", this.entityX - this.motionX * f3, this.entityY - this.motionY * f3,
- this.entityZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
- }
-
- f2 = 0.8F;
- }
-
- this.motionX += this.accelerationX;
- this.motionY += this.accelerationY;
- this.motionZ += this.accelerationZ;
- this.motionX *= f2;
- this.motionY *= f2;
- this.motionZ *= f2;
- this.worldObj.spawnParticle("smoke", this.entityX, this.entityY + 0.5D, this.entityZ, 0.0D, 0.0D, 0.0D);
- this.setPosition(this.entityX, this.entityY, this.entityZ);
- }
- }
-
- /**
- * Return the motion factor for this projectile. The factor is multiplied by
- * the original motion.
- */
- @Override
- protected float getMotionFactor() {
- return 0.95F;
- }
-
- /**
- * Called when this EntityFireball hits a block or entity.
- */
- @Override
- protected abstract void onImpact(MovingObjectPosition p_70227_1_);
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- @Override
- public void writeEntityToNBT(NBTTagCompound aTag) {
- aTag.setShort("xTile", (short) this.entityX);
- aTag.setShort("yTile", (short) this.entityY);
- aTag.setShort("zTile", (short) this.entityZ);
- aTag.setByte("inTile", (byte) Block.getIdFromBlock(this.block));
- aTag.setByte("inGround", (byte) (this.inGround ? 1 : 0));
- aTag.setTag("direction",
- this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ }));
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- @Override
- public void readEntityFromNBT(NBTTagCompound aTag) {
- this.entityX = aTag.getShort("xTile");
- this.entityY = aTag.getShort("yTile");
- this.entityZ = aTag.getShort("zTile");
- this.block = Block.getBlockById(aTag.getByte("inTile") & 255);
- this.inGround = aTag.getByte("inGround") == 1;
-
- if (aTag.hasKey("direction", 9)) {
- NBTTagList nbttaglist = aTag.getTagList("direction", 6);
- this.motionX = nbttaglist.func_150309_d(0);
- this.motionY = nbttaglist.func_150309_d(1);
- this.motionZ = nbttaglist.func_150309_d(2);
- }
- else {
- this.setDead();
- }
- }
-
- /**
- * Returns true if other Entities should be prevented from moving through
- * this Entity.
- */
- @Override
- public boolean canBeCollidedWith() {
- return true;
- }
-
- @Override
- public float getCollisionBorderSize() {
- return 1.0F;
- }
-
- /**
- * Called when the entity is attacked.
- */
- @Override
- public boolean attackEntityFrom(DamageSource damage, float p_70097_2_) {
- if (this.isEntityInvulnerable()) {
- return false;
- }
- else {
- this.setBeenAttacked();
-
- if (damage.getEntity() != null) {
- Vec3 vec3 = damage.getEntity().getLookVec();
-
- if (vec3 != null) {
- this.motionX = vec3.xCoord;
- this.motionY = vec3.yCoord;
- this.motionZ = vec3.zCoord;
- this.accelerationX = this.motionX * 0.1D;
- this.accelerationY = this.motionY * 0.1D;
- this.accelerationZ = this.motionZ * 0.1D;
- }
-
- if (damage.getEntity() instanceof EntityLivingBase) {
- this.shootingEntity = (EntityLivingBase) damage.getEntity();
- }
-
- return true;
- }
- else {
- return false;
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public float getShadowSize() {
- return 0.0F;
- }
-
- /**
- * Gets how bright this entity is.
- */
- @Override
- public float getBrightness(float p_70013_1_) {
- return 1.0F;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getBrightnessForRender(float p_70070_1_) {
- return 15728880;
- }
-} \ No newline at end of file
+ protected int entityX = -1;
+ protected int entityY = -1;
+ protected int entityZ = -1;
+ private Block block;
+ private boolean inGround;
+ private int ticksAlive;
+ private int ticksInAir;
+
+ public EntityToxinball(World world) {
+ super(world);
+ this.setSize(1.0F, 1.0F);
+ }
+
+ @Override
+ protected void entityInit() {}
+
+ /**
+ * Checks if the entity is in range to render by using the past in distance
+ * and comparing it to its average edge length * 64 * renderDistanceWeight
+ * Args: distance
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean isInRangeToRenderDist(double p_70112_1_) {
+ double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
+ d1 *= 64.0D;
+ return p_70112_1_ < d1 * d1;
+ }
+
+ public EntityToxinball(World world, double x, double y, double z, double f1, double f2, double f3) {
+ super(world);
+ this.setSize(1.0F, 1.0F);
+ this.setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch);
+ this.setPosition(x, y, z);
+ double d6 = MathHelper.sqrt_double(f1 * f1 + f2 * f2 + f3 * f3);
+ this.accelerationX = f1 / d6 * 0.1D;
+ this.accelerationY = f2 / d6 * 0.1D;
+ this.accelerationZ = f3 / d6 * 0.1D;
+ }
+
+ public EntityToxinball(World world, EntityLivingBase entity, double x, double y, double z) {
+ super(world);
+ this.shootingEntity = entity;
+ this.setSize(1.0F, 1.0F);
+ this.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
+ this.setPosition(this.entityX, this.entityY, this.entityZ);
+ this.yOffset = 0.0F;
+ this.motionX = this.motionY = this.motionZ = 0.0D;
+ x += this.rand.nextGaussian() * 0.4D;
+ y += this.rand.nextGaussian() * 0.4D;
+ z += this.rand.nextGaussian() * 0.4D;
+ double d3 = MathHelper.sqrt_double(x * x + y * y + z * z);
+ this.accelerationX = x / d3 * 0.1D;
+ this.accelerationY = y / d3 * 0.1D;
+ this.accelerationZ = z / d3 * 0.1D;
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ @Override
+ public void onUpdate() {
+ if (!this.worldObj.isRemote
+ && (this.shootingEntity != null && this.shootingEntity.isDead
+ || !this.worldObj.blockExists(this.entityX, this.entityY, this.entityZ))) {
+ this.setDead();
+ } else {
+ super.onUpdate();
+ this.setFire(1);
+
+ if (this.inGround) {
+ if (this.worldObj.getBlock(this.entityX, this.entityY, this.entityZ) == this.block) {
+ ++this.ticksAlive;
+
+ if (this.ticksAlive == 600) {
+ this.setDead();
+ }
+
+ return;
+ }
+
+ this.inGround = false;
+ this.motionX *= this.rand.nextFloat() * 0.2F;
+ this.motionY *= this.rand.nextFloat() * 0.2F;
+ this.motionZ *= this.rand.nextFloat() * 0.2F;
+ this.ticksAlive = 0;
+ this.ticksInAir = 0;
+ } else {
+ ++this.ticksInAir;
+ }
+
+ Vec3 vec3 = Vec3.createVectorHelper(this.entityX, this.entityY, this.entityZ);
+ Vec3 vec31 = Vec3.createVectorHelper(
+ this.entityX + this.motionX, this.entityY + this.motionY, this.entityZ + this.motionZ);
+ MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31);
+ vec3 = Vec3.createVectorHelper(this.entityX, this.entityY, this.entityZ);
+ vec31 = Vec3.createVectorHelper(
+ this.entityX + this.motionX, this.entityY + this.motionY, this.entityZ + this.motionZ);
+
+ if (movingobjectposition != null) {
+ vec31 = Vec3.createVectorHelper(
+ movingobjectposition.hitVec.xCoord,
+ movingobjectposition.hitVec.yCoord,
+ movingobjectposition.hitVec.zCoord);
+ }
+
+ Entity entity = null;
+ List<?> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
+ this,
+ this.boundingBox
+ .addCoord(this.motionX, this.motionY, this.motionZ)
+ .expand(1.0D, 1.0D, 1.0D));
+ double d0 = 0.0D;
+
+ for (int i = 0; i < list.size(); ++i) {
+ Entity entity1 = (Entity) list.get(i);
+
+ if (entity1.canBeCollidedWith()
+ && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
+ float f = 0.3F;
+ AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
+ MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
+
+ if (movingobjectposition1 != null) {
+ double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
+
+ if (d1 < d0 || d0 == 0.0D) {
+ entity = entity1;
+ d0 = d1;
+ }
+ }
+ }
+ }
+
+ if (entity != null) {
+ movingobjectposition = new MovingObjectPosition(entity);
+ }
+
+ if (movingobjectposition != null) {
+ this.onImpact(movingobjectposition);
+ }
+
+ this.entityX += this.motionX;
+ this.entityY += this.motionY;
+ this.entityZ += this.motionZ;
+ float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
+
+ for (this.rotationPitch = (float) (Math.atan2(f1, this.motionY) * 180.0D / Math.PI) - 90.0F;
+ this.rotationPitch - this.prevRotationPitch < -180.0F;
+ this.prevRotationPitch -= 360.0F) {
+ ;
+ }
+
+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
+ this.prevRotationPitch += 360.0F;
+ }
+
+ while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
+ this.prevRotationYaw -= 360.0F;
+ }
+
+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
+ this.prevRotationYaw += 360.0F;
+ }
+
+ this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
+ this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
+ float f2 = this.getMotionFactor();
+
+ if (this.isInWater()) {
+ for (int j = 0; j < 4; ++j) {
+ float f3 = 0.25F;
+ this.worldObj.spawnParticle(
+ "bubble",
+ this.entityX - this.motionX * f3,
+ this.entityY - this.motionY * f3,
+ this.entityZ - this.motionZ * f3,
+ this.motionX,
+ this.motionY,
+ this.motionZ);
+ }
+
+ f2 = 0.8F;
+ }
+
+ this.motionX += this.accelerationX;
+ this.motionY += this.accelerationY;
+ this.motionZ += this.accelerationZ;
+ this.motionX *= f2;
+ this.motionY *= f2;
+ this.motionZ *= f2;
+ this.worldObj.spawnParticle("smoke", this.entityX, this.entityY + 0.5D, this.entityZ, 0.0D, 0.0D, 0.0D);
+ this.setPosition(this.entityX, this.entityY, this.entityZ);
+ }
+ }
+
+ /**
+ * Return the motion factor for this projectile. The factor is multiplied by
+ * the original motion.
+ */
+ @Override
+ protected float getMotionFactor() {
+ return 0.95F;
+ }
+
+ /**
+ * Called when this EntityFireball hits a block or entity.
+ */
+ @Override
+ protected abstract void onImpact(MovingObjectPosition p_70227_1_);
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ @Override
+ public void writeEntityToNBT(NBTTagCompound aTag) {
+ aTag.setShort("xTile", (short) this.entityX);
+ aTag.setShort("yTile", (short) this.entityY);
+ aTag.setShort("zTile", (short) this.entityZ);
+ aTag.setByte("inTile", (byte) Block.getIdFromBlock(this.block));
+ aTag.setByte("inGround", (byte) (this.inGround ? 1 : 0));
+ aTag.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ}));
+ }
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ @Override
+ public void readEntityFromNBT(NBTTagCompound aTag) {
+ this.entityX = aTag.getShort("xTile");
+ this.entityY = aTag.getShort("yTile");
+ this.entityZ = aTag.getShort("zTile");
+ this.block = Block.getBlockById(aTag.getByte("inTile") & 255);
+ this.inGround = aTag.getByte("inGround") == 1;
+
+ if (aTag.hasKey("direction", 9)) {
+ NBTTagList nbttaglist = aTag.getTagList("direction", 6);
+ this.motionX = nbttaglist.func_150309_d(0);
+ this.motionY = nbttaglist.func_150309_d(1);
+ this.motionZ = nbttaglist.func_150309_d(2);
+ } else {
+ this.setDead();
+ }
+ }
+
+ /**
+ * Returns true if other Entities should be prevented from moving through
+ * this Entity.
+ */
+ @Override
+ public boolean canBeCollidedWith() {
+ return true;
+ }
+
+ @Override
+ public float getCollisionBorderSize() {
+ return 1.0F;
+ }
+
+ /**
+ * Called when the entity is attacked.
+ */
+ @Override
+ public boolean attackEntityFrom(DamageSource damage, float p_70097_2_) {
+ if (this.isEntityInvulnerable()) {
+ return false;
+ } else {
+ this.setBeenAttacked();
+
+ if (damage.getEntity() != null) {
+ Vec3 vec3 = damage.getEntity().getLookVec();
+
+ if (vec3 != null) {
+ this.motionX = vec3.xCoord;
+ this.motionY = vec3.yCoord;
+ this.motionZ = vec3.zCoord;
+ this.accelerationX = this.motionX * 0.1D;
+ this.accelerationY = this.motionY * 0.1D;
+ this.accelerationZ = this.motionZ * 0.1D;
+ }
+
+ if (damage.getEntity() instanceof EntityLivingBase) {
+ this.shootingEntity = (EntityLivingBase) damage.getEntity();
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public float getShadowSize() {
+ return 0.0F;
+ }
+
+ /**
+ * Gets how bright this entity is.
+ */
+ @Override
+ public float getBrightness(float p_70013_1_) {
+ return 1.0F;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getBrightnessForRender(float p_70070_1_) {
+ return 15728880;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java
index 78469c9dad..2321411a2b 100644
--- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java
+++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java
@@ -8,81 +8,88 @@ import net.minecraft.world.World;
public class EntityToxinballSmall extends EntityToxinball {
- public EntityToxinballSmall(World p_i1770_1_) {
- super(p_i1770_1_);
- this.setSize(0.3125F, 0.3125F);
- }
+ public EntityToxinballSmall(World p_i1770_1_) {
+ super(p_i1770_1_);
+ this.setSize(0.3125F, 0.3125F);
+ }
- public EntityToxinballSmall(World world, EntityLivingBase entity, double x, double y, double z) {
- super(world, entity, x, y, z);
- this.setSize(0.3125F, 0.3125F);
- }
+ public EntityToxinballSmall(World world, EntityLivingBase entity, double x, double y, double z) {
+ super(world, entity, x, y, z);
+ this.setSize(0.3125F, 0.3125F);
+ }
- public EntityToxinballSmall(World p_i1772_1_, double p_i1772_2_, double p_i1772_4_, double p_i1772_6_, double p_i1772_8_, double p_i1772_10_, double p_i1772_12_) {
- super(p_i1772_1_, p_i1772_2_, p_i1772_4_, p_i1772_6_, p_i1772_8_, p_i1772_10_, p_i1772_12_);
- this.setSize(0.3125F, 0.3125F);
- }
+ public EntityToxinballSmall(
+ World p_i1772_1_,
+ double p_i1772_2_,
+ double p_i1772_4_,
+ double p_i1772_6_,
+ double p_i1772_8_,
+ double p_i1772_10_,
+ double p_i1772_12_) {
+ super(p_i1772_1_, p_i1772_2_, p_i1772_4_, p_i1772_6_, p_i1772_8_, p_i1772_10_, p_i1772_12_);
+ this.setSize(0.3125F, 0.3125F);
+ }
- /**
- * Called when this EntityFireball hits a block or entity.
- */
- @Override
- protected void onImpact(MovingObjectPosition MoP) {
- if (!this.worldObj.isRemote) {
- if (MoP.entityHit != null) {
- if (!MoP.entityHit.isImmuneToFire() && MoP.entityHit
- .attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F)) {
- MoP.entityHit.setFire(5);
- }
- }
- else {
- int i = MoP.blockX;
- int j = MoP.blockY;
- int k = MoP.blockZ;
+ /**
+ * Called when this EntityFireball hits a block or entity.
+ */
+ @Override
+ protected void onImpact(MovingObjectPosition MoP) {
+ if (!this.worldObj.isRemote) {
+ if (MoP.entityHit != null) {
+ if (!MoP.entityHit.isImmuneToFire()
+ && MoP.entityHit.attackEntityFrom(
+ DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F)) {
+ MoP.entityHit.setFire(5);
+ }
+ } else {
+ int i = MoP.blockX;
+ int j = MoP.blockY;
+ int k = MoP.blockZ;
- switch (MoP.sideHit) {
- case 0:
- --j;
- break;
- case 1:
- ++j;
- break;
- case 2:
- --k;
- break;
- case 3:
- ++k;
- break;
- case 4:
- --i;
- break;
- case 5:
- ++i;
- }
+ switch (MoP.sideHit) {
+ case 0:
+ --j;
+ break;
+ case 1:
+ ++j;
+ break;
+ case 2:
+ --k;
+ break;
+ case 3:
+ ++k;
+ break;
+ case 4:
+ --i;
+ break;
+ case 5:
+ ++i;
+ }
- if (this.worldObj.isAirBlock(i, j, k)) {
- this.worldObj.setBlock(i, j, k, Blocks.fire);
- }
- }
+ if (this.worldObj.isAirBlock(i, j, k)) {
+ this.worldObj.setBlock(i, j, k, Blocks.fire);
+ }
+ }
- this.setDead();
- }
- }
+ this.setDead();
+ }
+ }
- /**
- * Returns true if other Entities should be prevented from moving through
- * this Entity.
- */
- @Override
- public boolean canBeCollidedWith() {
- return false;
- }
+ /**
+ * Returns true if other Entities should be prevented from moving through
+ * this Entity.
+ */
+ @Override
+ public boolean canBeCollidedWith() {
+ return false;
+ }
- /**
- * Called when the entity is attacked.
- */
- @Override
- public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
- return false;
- }
-} \ No newline at end of file
+ /**
+ * Called when the entity is attacked.
+ */
+ @Override
+ public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/fluids/BlockFluidBase.java b/src/main/java/gtPlusPlus/core/fluids/BlockFluidBase.java
index dc7c9c2e78..d8672dec2b 100644
--- a/src/main/java/gtPlusPlus/core/fluids/BlockFluidBase.java
+++ b/src/main/java/gtPlusPlus/core/fluids/BlockFluidBase.java
@@ -17,88 +17,87 @@ import net.minecraftforge.fluids.Fluid;
public class BlockFluidBase extends BlockFluidClassic {
- @SideOnly(Side.CLIENT)
- protected static IIcon stillIcon;
- @SideOnly(Side.CLIENT)
- protected static IIcon flowingIcon;
-
- protected final short[] mRGB;
-
-
- public BlockFluidBase(Fluid fluid, short[] aRGB) {
- this(fluid, Material.water, aRGB);
- }
-
- public BlockFluidBase(Fluid fluid, Material material, short[] aRGB) {
- super(fluid, material);
- mRGB = aRGB;
- this.setHardness(100.0F);
- this.setLightOpacity(3);
- this.disableStats();
- }
-
- @Override
- public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity ent) {
- if (!(ent instanceof EntityLivingBase)) {
- return;
- }
- /*EntityLivingBase player = (EntityLivingBase) ent;
- int pot = world.rand.nextInt(Potion.potionTypes.length);
- Potion.potionTypes[pot].performEffect(player, 40);*/
- }
-
- @Override
- public IIcon getIcon(int side, int meta) {
- return (side == 0 || side == 1) ? stillIcon : flowingIcon;
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(IIconRegister register) {
- if (stillIcon == null) {
- stillIcon = register.registerIcon(CORE.MODID+ ":" + "fluids/fluid.fluid.autogenerated.still");
- }
- if (flowingIcon == null) {
- flowingIcon = register.registerIcon(CORE.MODID+ ":" + "fluids/fluid.fluid.autogenerated.flowing");
- }
- }
-
- @Override
- public int getBlockColor() {
- if (mRGB != null && mRGB.length >= 3) {
- return Utils.rgbtoHexValue(mRGB[0], mRGB[1], mRGB[2]);
- }
- return super.getBlockColor();
- }
-
- @Override
- public int getRenderColor(int aMeta) {
- if (mRGB != null && mRGB.length >= 3) {
- return Utils.rgbtoHexValue(mRGB[0], mRGB[1], mRGB[2]);
- }
- return super.getRenderColor(aMeta);
- }
-
- @Override
- public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) {
- // TODO Auto-generated method stub
- return super.recolourBlock(world, x, y, z, side, colour);
- }
-
- @Override
- public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
- return false;
- }
- return super.canDisplace(world, x, y, z);
- }
-
- @Override
- public boolean displaceIfPossible(World world, int x, int y, int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
- return false;
- }
- return super.displaceIfPossible(world, x, y, z);
- }
-
+ @SideOnly(Side.CLIENT)
+ protected static IIcon stillIcon;
+
+ @SideOnly(Side.CLIENT)
+ protected static IIcon flowingIcon;
+
+ protected final short[] mRGB;
+
+ public BlockFluidBase(Fluid fluid, short[] aRGB) {
+ this(fluid, Material.water, aRGB);
+ }
+
+ public BlockFluidBase(Fluid fluid, Material material, short[] aRGB) {
+ super(fluid, material);
+ mRGB = aRGB;
+ this.setHardness(100.0F);
+ this.setLightOpacity(3);
+ this.disableStats();
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity ent) {
+ if (!(ent instanceof EntityLivingBase)) {
+ return;
+ }
+ /*EntityLivingBase player = (EntityLivingBase) ent;
+ int pot = world.rand.nextInt(Potion.potionTypes.length);
+ Potion.potionTypes[pot].performEffect(player, 40);*/
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ return (side == 0 || side == 1) ? stillIcon : flowingIcon;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister register) {
+ if (stillIcon == null) {
+ stillIcon = register.registerIcon(CORE.MODID + ":" + "fluids/fluid.fluid.autogenerated.still");
+ }
+ if (flowingIcon == null) {
+ flowingIcon = register.registerIcon(CORE.MODID + ":" + "fluids/fluid.fluid.autogenerated.flowing");
+ }
+ }
+
+ @Override
+ public int getBlockColor() {
+ if (mRGB != null && mRGB.length >= 3) {
+ return Utils.rgbtoHexValue(mRGB[0], mRGB[1], mRGB[2]);
+ }
+ return super.getBlockColor();
+ }
+
+ @Override
+ public int getRenderColor(int aMeta) {
+ if (mRGB != null && mRGB.length >= 3) {
+ return Utils.rgbtoHexValue(mRGB[0], mRGB[1], mRGB[2]);
+ }
+ return super.getRenderColor(aMeta);
+ }
+
+ @Override
+ public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) {
+ // TODO Auto-generated method stub
+ return super.recolourBlock(world, x, y, z, side, colour);
+ }
+
+ @Override
+ public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
+ return false;
+ }
+ return super.canDisplace(world, x, y, z);
+ }
+
+ @Override
+ public boolean displaceIfPossible(World world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
+ return false;
+ }
+ return super.displaceIfPossible(world, x, y, z);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/fluids/FactoryFluid.java b/src/main/java/gtPlusPlus/core/fluids/FactoryFluid.java
index e3383aee91..59d0fd8839 100644
--- a/src/main/java/gtPlusPlus/core/fluids/FactoryFluid.java
+++ b/src/main/java/gtPlusPlus/core/fluids/FactoryFluid.java
@@ -1,4 +1,5 @@
package gtPlusPlus.core.fluids;
+
import gregtech.api.GregTech_API;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
@@ -7,43 +8,67 @@ import net.minecraftforge.fluids.Fluid;
public class FactoryFluid extends Fluid implements Runnable {
- private final String mTextureName;
- private final short[] mRGBa;
-
- public FactoryFluid(String fluidName, final short[] aRGBa) {
- this(fluidName, null, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, false, EnumRarity.common, aRGBa);
- }
-
- public FactoryFluid(String fluidName, int luminosity, int density, int temp, int viscosity, final short[] aRGBa) {
- this(fluidName, null, luminosity, density, temp, viscosity, (density == Short.MIN_VALUE || density >= 0 ? false : true), EnumRarity.common, aRGBa);
- }
-
- public FactoryFluid(String fluidName, Block aBlock, int luminosity, int density, int temp, int viscosity, boolean gas, EnumRarity aRarity, final short[] aRGBa) {
- super(fluidName);
- this.mRGBa = aRGBa;
- this.setBlock(aBlock);
- if (luminosity != Short.MIN_VALUE)
- this.setLuminosity(luminosity);
- if (density != Short.MIN_VALUE)
- this.setDensity(density);
- if (temp != Short.MIN_VALUE)
- this.setTemperature(temp);
- if (viscosity != Short.MIN_VALUE)
- this.setViscosity(viscosity);
- this.setGaseous(gas);
- this.setRarity(aRarity);
- this.mTextureName = CORE.MODID+":fluids/fluid.fluid.autogenerated";
- GregTech_API.sGTBlockIconload.add(this);
- }
-
- @Override
- public int getColor() {
- return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16) | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8) | Math.max(0, Math.min(255, this.mRGBa[2]));
- }
-
- @Override
- public void run() {
- this.setIcons(GregTech_API.sBlockIcons.registerIcon(this.mTextureName));
- }
-
-} \ No newline at end of file
+ private final String mTextureName;
+ private final short[] mRGBa;
+
+ public FactoryFluid(String fluidName, final short[] aRGBa) {
+ this(
+ fluidName,
+ null,
+ Short.MIN_VALUE,
+ Short.MIN_VALUE,
+ Short.MIN_VALUE,
+ Short.MIN_VALUE,
+ false,
+ EnumRarity.common,
+ aRGBa);
+ }
+
+ public FactoryFluid(String fluidName, int luminosity, int density, int temp, int viscosity, final short[] aRGBa) {
+ this(
+ fluidName,
+ null,
+ luminosity,
+ density,
+ temp,
+ viscosity,
+ (density == Short.MIN_VALUE || density >= 0 ? false : true),
+ EnumRarity.common,
+ aRGBa);
+ }
+
+ public FactoryFluid(
+ String fluidName,
+ Block aBlock,
+ int luminosity,
+ int density,
+ int temp,
+ int viscosity,
+ boolean gas,
+ EnumRarity aRarity,
+ final short[] aRGBa) {
+ super(fluidName);
+ this.mRGBa = aRGBa;
+ this.setBlock(aBlock);
+ if (luminosity != Short.MIN_VALUE) this.setLuminosity(luminosity);
+ if (density != Short.MIN_VALUE) this.setDensity(density);
+ if (temp != Short.MIN_VALUE) this.setTemperature(temp);
+ if (viscosity != Short.MIN_VALUE) this.setViscosity(viscosity);
+ this.setGaseous(gas);
+ this.setRarity(aRarity);
+ this.mTextureName = CORE.MODID + ":fluids/fluid.fluid.autogenerated";
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public int getColor() {
+ return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16)
+ | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8)
+ | Math.max(0, Math.min(255, this.mRGBa[2]));
+ }
+
+ @Override
+ public void run() {
+ this.setIcons(GregTech_API.sBlockIcons.registerIcon(this.mTextureName));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java b/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java
index d94fa35af7..af7a806d31 100644
--- a/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java
+++ b/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.fluids;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -15,6 +12,8 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.LinkedHashMap;
+import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -29,186 +28,176 @@ import net.minecraftforge.fluids.FluidRegistry;
public class FluidFactory {
- public static final Map<String, Fluid> mNameToFluidMap = new LinkedHashMap<String, Fluid>();
- public static final Map<String, ItemStack> mNameToBucketMap = new LinkedHashMap<String, ItemStack>();
- public static final Map<String, Block> mNameToBlockMap = new LinkedHashMap<String, Block>();
- public static final Map<String, Integer> mNameToMetaMap = new LinkedHashMap<String, Integer>();
-
- public static final Map<Fluid, String> mFluidToNameMap = new LinkedHashMap<Fluid, String>();
- public static final Map<Fluid, ItemStack> mFluidToBucketMap = new LinkedHashMap<Fluid, ItemStack>();
- public static final Map<Fluid, Block> mFluidToBlockMap = new LinkedHashMap<Fluid, Block>();
- public static final Map<Fluid, Integer> mFluidToMetaMap = new LinkedHashMap<Fluid, Integer>();
-
- public static final Map<ItemStack, Fluid> mBucketToFluidMap = new LinkedHashMap<ItemStack, Fluid>();
- public static final Map<ItemStack, String> mBucketToNameMap = new LinkedHashMap<ItemStack, String>();
- public static final Map<ItemStack, Block> mBucketToBlockMap = new LinkedHashMap<ItemStack, Block>();
- public static final Map<ItemStack, Integer> mBucketToMetaMap = new LinkedHashMap<ItemStack, Integer>();
-
- public static final Map<Block, String> mBlockToNameMap = new LinkedHashMap<Block, String>();
- public static final Map<Block, Fluid> mBlockToFluidMap = new LinkedHashMap<Block, Fluid>();
- public static final Map<Block, ItemStack> mBlockToBucketMap = new LinkedHashMap<Block, ItemStack>();
- public static final Map<Block, Integer> mBlockToMetaMap = new LinkedHashMap<Block, Integer>();
-
- public static final Map<Integer, String> mMetaToNameMap = new LinkedHashMap<Integer, String>();
- public static final Map<Integer, Fluid> mMetaToFluidMap = new LinkedHashMap<Integer, Fluid>();
- public static final Map<Integer, ItemStack> mMetaToBucketMap = new LinkedHashMap<Integer, ItemStack>();
- public static final Map<Integer, Block> mMetaToBlockMap = new LinkedHashMap<Integer, Block>();
-
-
- //Special Colour Handling
- public static final Map<Integer, Integer> mMetaToColourMap = new LinkedHashMap<Integer, Integer>();
-
-
- public static Item mGenericBucket;
- private static FluidPackage mErrorFluid;
- private static AutoMap<FluidPackage> mGeneratedFluids = new AutoMap<FluidPackage>();
-
- public static void preInit() {
-
- }
-
- public static void init() {
- mGenericBucket = new ItemGenericFluidBucket(Blocks.air);
- GameRegistry.registerItem(mGenericBucket, "gtpp.bucket.generic");
- for (FluidPackage y : mGeneratedFluids) {
- if (!y.valid()) {
- continue;
- }
- GameRegistry.registerBlock(y.mBlock, FluidItemBlock.class, "gtpp_" + y.mName);
- FluidContainerRegistry.registerFluidContainer(y.get(), y.mBucket, new ItemStack(Items.bucket));
- }
- Utils.registerEvent(BucketHandler.INSTANCE);
- }
-
- public static void postInit() {
-
- }
-
- /**
- * Generates a 'Water' type fluid.
- * @param aID - The Fluid ID (Must be unique)
- * @param aUnlocalName - Unlocalized Fluid Name
- * @param aRGB - a {@link Short[]} containing the RGB of the FluidPackage.
- * @return - A fully constructed & registered {@linkplain FluidPackage}
- */
- public static FluidPackage generate(int aID, String aUnlocalName, short[] aRGB) {
- return generate(aID, aUnlocalName, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, aRGB);
- }
-
- /**
- * Generate a {@link FluidPackage} from the data provided. This FluidPackage is automatically registered and handled internally.
- * Pass in {@link Short}.MIN_VALUE for any of the Fluid Fields (Besides ID, Name or RGB) and it will default to water values.
- * @param aID - The Fluid ID (Must be unique)
- * @param aUnlocalName - Unlocalized Fluid Name
- * @param luminosity - How bright is the fluid.
- * @param density - completely arbitrary; negative density indicates that the fluid is
+ public static final Map<String, Fluid> mNameToFluidMap = new LinkedHashMap<String, Fluid>();
+ public static final Map<String, ItemStack> mNameToBucketMap = new LinkedHashMap<String, ItemStack>();
+ public static final Map<String, Block> mNameToBlockMap = new LinkedHashMap<String, Block>();
+ public static final Map<String, Integer> mNameToMetaMap = new LinkedHashMap<String, Integer>();
+
+ public static final Map<Fluid, String> mFluidToNameMap = new LinkedHashMap<Fluid, String>();
+ public static final Map<Fluid, ItemStack> mFluidToBucketMap = new LinkedHashMap<Fluid, ItemStack>();
+ public static final Map<Fluid, Block> mFluidToBlockMap = new LinkedHashMap<Fluid, Block>();
+ public static final Map<Fluid, Integer> mFluidToMetaMap = new LinkedHashMap<Fluid, Integer>();
+
+ public static final Map<ItemStack, Fluid> mBucketToFluidMap = new LinkedHashMap<ItemStack, Fluid>();
+ public static final Map<ItemStack, String> mBucketToNameMap = new LinkedHashMap<ItemStack, String>();
+ public static final Map<ItemStack, Block> mBucketToBlockMap = new LinkedHashMap<ItemStack, Block>();
+ public static final Map<ItemStack, Integer> mBucketToMetaMap = new LinkedHashMap<ItemStack, Integer>();
+
+ public static final Map<Block, String> mBlockToNameMap = new LinkedHashMap<Block, String>();
+ public static final Map<Block, Fluid> mBlockToFluidMap = new LinkedHashMap<Block, Fluid>();
+ public static final Map<Block, ItemStack> mBlockToBucketMap = new LinkedHashMap<Block, ItemStack>();
+ public static final Map<Block, Integer> mBlockToMetaMap = new LinkedHashMap<Block, Integer>();
+
+ public static final Map<Integer, String> mMetaToNameMap = new LinkedHashMap<Integer, String>();
+ public static final Map<Integer, Fluid> mMetaToFluidMap = new LinkedHashMap<Integer, Fluid>();
+ public static final Map<Integer, ItemStack> mMetaToBucketMap = new LinkedHashMap<Integer, ItemStack>();
+ public static final Map<Integer, Block> mMetaToBlockMap = new LinkedHashMap<Integer, Block>();
+
+ // Special Colour Handling
+ public static final Map<Integer, Integer> mMetaToColourMap = new LinkedHashMap<Integer, Integer>();
+
+ public static Item mGenericBucket;
+ private static FluidPackage mErrorFluid;
+ private static AutoMap<FluidPackage> mGeneratedFluids = new AutoMap<FluidPackage>();
+
+ public static void preInit() {}
+
+ public static void init() {
+ mGenericBucket = new ItemGenericFluidBucket(Blocks.air);
+ GameRegistry.registerItem(mGenericBucket, "gtpp.bucket.generic");
+ for (FluidPackage y : mGeneratedFluids) {
+ if (!y.valid()) {
+ continue;
+ }
+ GameRegistry.registerBlock(y.mBlock, FluidItemBlock.class, "gtpp_" + y.mName);
+ FluidContainerRegistry.registerFluidContainer(y.get(), y.mBucket, new ItemStack(Items.bucket));
+ }
+ Utils.registerEvent(BucketHandler.INSTANCE);
+ }
+
+ public static void postInit() {}
+
+ /**
+ * Generates a 'Water' type fluid.
+ * @param aID - The Fluid ID (Must be unique)
+ * @param aUnlocalName - Unlocalized Fluid Name
+ * @param aRGB - a {@link Short[]} containing the RGB of the FluidPackage.
+ * @return - A fully constructed & registered {@linkplain FluidPackage}
+ */
+ public static FluidPackage generate(int aID, String aUnlocalName, short[] aRGB) {
+ return generate(aID, aUnlocalName, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, aRGB);
+ }
+
+ /**
+ * Generate a {@link FluidPackage} from the data provided. This FluidPackage is automatically registered and handled internally.
+ * Pass in {@link Short}.MIN_VALUE for any of the Fluid Fields (Besides ID, Name or RGB) and it will default to water values.
+ * @param aID - The Fluid ID (Must be unique)
+ * @param aUnlocalName - Unlocalized Fluid Name
+ * @param luminosity - How bright is the fluid.
+ * @param density - completely arbitrary; negative density indicates that the fluid is
* lighter than air. Default value is approximately the real-life density of water in kg/m^3.
- * @param temp - completely arbitrary; higher temperature indicates that the fluid is
+ * @param temp - completely arbitrary; higher temperature indicates that the fluid is
* hotter than air. Default value is approximately the real-life room temperature of water in degrees Kelvin
- * @param viscosity - completely arbitrary; negative values are not
+ * @param viscosity - completely arbitrary; negative values are not
* permissible. Default value is approximately the real-life density of water in m/s^2 (x10^-3). *
* Higher viscosity means that a fluid flows more slowly, like molasses.
* Lower viscosity means that a fluid flows more quickly, like helium.
- * @param aRGB - a {@link Short[]} containing the RGB of the FluidPackage.
- * @return - A fully constructed & registered {@linkplain FluidPackage}
- */
- public static FluidPackage generate(int aID, String aUnlocalName, int luminosity, int density, int temp,
- int viscosity, short[] aRGB) {
-
- FluidPackage aFluidToGenerate = null;
-
- // Check Load Phase for some Safety, only allow this to be called in Pre-Init.
- if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.PRE_INIT) {
- try {
- throw new GregtechException("Cannot generate Fluid Packages outside of Pre-Init!");
- } catch (GregtechException e) {
- e.printStackTrace();
- CORE.crash("Cannot generate Fluid Packages outside of Pre-Init!");
- }
- }
-
- Fluid aGenFluid = fluid(aUnlocalName, luminosity, density, temp, viscosity, aRGB);
- Block aGenBlock = block(aGenFluid, aRGB);
- ItemStack aGenBucket = bucket(aID);
-
- aFluidToGenerate = new FluidPackage(aID, aUnlocalName, aGenFluid, aGenBucket, aGenBlock);
-
- if (aFluidToGenerate != null && aFluidToGenerate.valid()) {
- FluidRegistry.registerFluid(aFluidToGenerate.get());
- mGeneratedFluids.put(aFluidToGenerate);
- }
- else {
- // Handle Bad generation
- if (mErrorFluid == null) {
- mErrorFluid = new FluidPackage(0, "", FluidUtils.getWater(1).getFluid(), ItemUtils.getSimpleStack(Items.water_bucket), Blocks.water);
- }
- return mErrorFluid;
- }
-
-
- return aFluidToGenerate;
- }
-
-
-
- private static Fluid fluid(String aUnlocalName, int luminosity, int density, int temp,
- int viscosity, short[] aRGB) {
- return new FactoryFluid(aUnlocalName, luminosity, density, temp, viscosity, aRGB);
- }
-
- private static ItemStack bucket(int aID) {
- return ItemGenericFluidBucket.registerFluidForBucket(aID);
- }
-
- private static Block block(Fluid aFluidForBlock, short[] aRGB) {
- if (aFluidForBlock != null) {
- FluidRegistry.registerFluid(aFluidForBlock);
- return new BlockFluidBase(aFluidForBlock, aRGB);
- }
- return Blocks.dirt;
- }
-
- /**
- * Copyright © SpaceToad, 2011 http://www.mod-buildcraft.com BuildCraft is
- * distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL.
- * Please check the contents of the license located in
- * http://www.mod-buildcraft.com/MMPL-1.0.txt
- *
- * Modified version of the BC BucketHandler, except using ItemStacks > Items
- * (Why?)
- *
- * @author Alkalus
- */
-
- public static class BucketHandler {
-
- public static BucketHandler INSTANCE = new BucketHandler();
-
- private BucketHandler() {
-
- }
-
- @SubscribeEvent
- public void onBucketFill(FillBucketEvent event) {
- ItemStack result = fillCustomBucket(event.world, event.target);
- if (result == null) {
- return;
- }
- event.result = result;
- event.setResult(Result.ALLOW);
- }
-
- private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
- Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
- ItemStack bucket = mBlockToBucketMap.get(block);
- if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
- world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
- return ItemUtils.getSimpleStack(bucket, 1);
- } else {
- return null;
- }
- }
-
- }
-
+ * @param aRGB - a {@link Short[]} containing the RGB of the FluidPackage.
+ * @return - A fully constructed & registered {@linkplain FluidPackage}
+ */
+ public static FluidPackage generate(
+ int aID, String aUnlocalName, int luminosity, int density, int temp, int viscosity, short[] aRGB) {
+
+ FluidPackage aFluidToGenerate = null;
+
+ // Check Load Phase for some Safety, only allow this to be called in Pre-Init.
+ if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.PRE_INIT) {
+ try {
+ throw new GregtechException("Cannot generate Fluid Packages outside of Pre-Init!");
+ } catch (GregtechException e) {
+ e.printStackTrace();
+ CORE.crash("Cannot generate Fluid Packages outside of Pre-Init!");
+ }
+ }
+
+ Fluid aGenFluid = fluid(aUnlocalName, luminosity, density, temp, viscosity, aRGB);
+ Block aGenBlock = block(aGenFluid, aRGB);
+ ItemStack aGenBucket = bucket(aID);
+
+ aFluidToGenerate = new FluidPackage(aID, aUnlocalName, aGenFluid, aGenBucket, aGenBlock);
+
+ if (aFluidToGenerate != null && aFluidToGenerate.valid()) {
+ FluidRegistry.registerFluid(aFluidToGenerate.get());
+ mGeneratedFluids.put(aFluidToGenerate);
+ } else {
+ // Handle Bad generation
+ if (mErrorFluid == null) {
+ mErrorFluid = new FluidPackage(
+ 0,
+ "",
+ FluidUtils.getWater(1).getFluid(),
+ ItemUtils.getSimpleStack(Items.water_bucket),
+ Blocks.water);
+ }
+ return mErrorFluid;
+ }
+
+ return aFluidToGenerate;
+ }
+
+ private static Fluid fluid(
+ String aUnlocalName, int luminosity, int density, int temp, int viscosity, short[] aRGB) {
+ return new FactoryFluid(aUnlocalName, luminosity, density, temp, viscosity, aRGB);
+ }
+
+ private static ItemStack bucket(int aID) {
+ return ItemGenericFluidBucket.registerFluidForBucket(aID);
+ }
+
+ private static Block block(Fluid aFluidForBlock, short[] aRGB) {
+ if (aFluidForBlock != null) {
+ FluidRegistry.registerFluid(aFluidForBlock);
+ return new BlockFluidBase(aFluidForBlock, aRGB);
+ }
+ return Blocks.dirt;
+ }
+
+ /**
+ * Copyright © SpaceToad, 2011 http://www.mod-buildcraft.com BuildCraft is
+ * distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL.
+ * Please check the contents of the license located in
+ * http://www.mod-buildcraft.com/MMPL-1.0.txt
+ *
+ * Modified version of the BC BucketHandler, except using ItemStacks > Items
+ * (Why?)
+ *
+ * @author Alkalus
+ */
+ public static class BucketHandler {
+
+ public static BucketHandler INSTANCE = new BucketHandler();
+
+ private BucketHandler() {}
+
+ @SubscribeEvent
+ public void onBucketFill(FillBucketEvent event) {
+ ItemStack result = fillCustomBucket(event.world, event.target);
+ if (result == null) {
+ return;
+ }
+ event.result = result;
+ event.setResult(Result.ALLOW);
+ }
+
+ private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
+ Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
+ ItemStack bucket = mBlockToBucketMap.get(block);
+ if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
+ world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
+ return ItemUtils.getSimpleStack(bucket, 1);
+ } else {
+ return null;
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java b/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java
index 29f831776b..10e54d794d 100644
--- a/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java
+++ b/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java
@@ -28,56 +28,53 @@ import net.minecraftforge.fluids.Fluid;
public class FluidPackage {
+ public final int mID;
+ public final String mName;
+ private final Fluid mFluid;
+ public final ItemStack mBucket;
+ public final Block mBlock;
- public final int mID;
- public final String mName;
- private final Fluid mFluid;
- public final ItemStack mBucket;
- public final Block mBlock;
+ public FluidPackage(int aID, String aName, Fluid aFluid, ItemStack aBucket, Block aBlock) {
- public FluidPackage(int aID, String aName, Fluid aFluid, ItemStack aBucket, Block aBlock) {
+ mNameToFluidMap.put(aName, aFluid);
+ mNameToBucketMap.put(aName, aBucket);
+ mNameToBlockMap.put(aName, aBlock);
+ mNameToMetaMap.put(aName, aID);
- mNameToFluidMap.put(aName, aFluid);
- mNameToBucketMap.put(aName, aBucket);
- mNameToBlockMap.put(aName, aBlock);
- mNameToMetaMap.put(aName, aID);
+ mFluidToNameMap.put(aFluid, aName);
+ mFluidToBucketMap.put(aFluid, aBucket);
+ mFluidToBlockMap.put(aFluid, aBlock);
+ mFluidToMetaMap.put(aFluid, aID);
- mFluidToNameMap.put(aFluid, aName);
- mFluidToBucketMap.put(aFluid, aBucket);
- mFluidToBlockMap.put(aFluid, aBlock);
- mFluidToMetaMap.put(aFluid, aID);
+ mBucketToFluidMap.put(aBucket, aFluid);
+ mBucketToNameMap.put(aBucket, aName);
+ mBucketToBlockMap.put(aBucket, aBlock);
+ mBucketToMetaMap.put(aBucket, aID);
- mBucketToFluidMap.put(aBucket, aFluid);
- mBucketToNameMap.put(aBucket, aName);
- mBucketToBlockMap.put(aBucket, aBlock);
- mBucketToMetaMap.put(aBucket, aID);
+ mBlockToNameMap.put(aBlock, aName);
+ mBlockToFluidMap.put(aBlock, aFluid);
+ mBlockToBucketMap.put(aBlock, aBucket);
+ mBlockToMetaMap.put(aBlock, aID);
- mBlockToNameMap.put(aBlock, aName);
- mBlockToFluidMap.put(aBlock, aFluid);
- mBlockToBucketMap.put(aBlock, aBucket);
- mBlockToMetaMap.put(aBlock, aID);
+ mMetaToNameMap.put(aID, aName);
+ mMetaToFluidMap.put(aID, aFluid);
+ mMetaToBucketMap.put(aID, aBucket);
+ mMetaToBlockMap.put(aID, aBlock);
- mMetaToNameMap.put(aID, aName);
- mMetaToFluidMap.put(aID, aFluid);
- mMetaToBucketMap.put(aID, aBucket);
- mMetaToBlockMap.put(aID, aBlock);
-
- mMetaToColourMap.put(aID, aFluid.getColor());
-
- mID = aID;
- mName = aName;
- mFluid = aFluid;
- mBucket = aBucket;
- mBlock = aBlock;
+ mMetaToColourMap.put(aID, aFluid.getColor());
- }
-
- public Fluid get() {
- return mFluid;
- }
-
- public boolean valid() {
- return mName != null && mName.length() > 0 && mFluid != null && mBucket != null && mBlock != null;
- }
+ mID = aID;
+ mName = aName;
+ mFluid = aFluid;
+ mBucket = aBucket;
+ mBlock = aBlock;
+ }
+ public Fluid get() {
+ return mFluid;
+ }
+
+ public boolean valid() {
+ return mName != null && mName.length() > 0 && mFluid != null && mBucket != null && mBlock != null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/fluids/FluidRegistryHandler.java b/src/main/java/gtPlusPlus/core/fluids/FluidRegistryHandler.java
index bc4df596de..3a0f56c2a5 100644
--- a/src/main/java/gtPlusPlus/core/fluids/FluidRegistryHandler.java
+++ b/src/main/java/gtPlusPlus/core/fluids/FluidRegistryHandler.java
@@ -3,51 +3,49 @@ package gtPlusPlus.core.fluids;
import static gtPlusPlus.core.block.ModBlocks.*;
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.block.material.Material;
-
import gtPlusPlus.core.block.general.fluids.BlockFluidSludge;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.FluidRegistry;
public class FluidRegistryHandler {
- //Fluids
- /**
- *
- * Luminosity .setLuminosity(luminosity)
- How much light does the fluid emit. Default: 0, Lava uses 15
- Density .setDensity(density)
- How dense is the fluid, the only effect is whether or not a fluid replaces another fluid when they flow into each other. Default: 1000, the density of water at 4 degrees Celsius in kg/m³
- Temperature .setTemperature(temp)
- How hot, or cold is the fluid. Has currently no effect. Default: 295, the "normal" room temperature in degrees Kelvin, this is approximately 72°F or 22°C.
- Viscosity .setViscosity(viscosity)
- How thick the fluid is. Determines how fast it flows. Default: 1000 for water, lava uses 6000
- Is Gaseous .setGaseous(boolean)
- Indicates if the fluid is gaseous. Used for rendering. Default: false
- *
- */
-
- public static void registerFluids(){
- run();
- }
-
- private static void run(){
- fluidSludge();
- }
-
- private static void fluidSludge(){
- //testFluid
- fluidSludge.setLuminosity(8);
- fluidSludge.setDensity(8196);
- fluidSludge.setTemperature(295);
- fluidSludge.setViscosity(3000);
- fluidSludge.setGaseous(false);
- fluidSludge.setUnlocalizedName("fluid.sludge");
- FluidRegistry.registerFluid(fluidSludge);
- blockFluidSludge = new BlockFluidSludge(fluidSludge, Material.cactus).setBlockName("fluidBlockSludge");
- GameRegistry.registerBlock(blockFluidSludge, CORE.MODID + "_" + blockFluidSludge.getUnlocalizedName().substring(5));
- fluidSludge.setUnlocalizedName(blockFluidSludge.getUnlocalizedName());
- }
-
+ // Fluids
+ /**
+ *
+ * Luminosity .setLuminosity(luminosity)
+ * How much light does the fluid emit. Default: 0, Lava uses 15
+ * Density .setDensity(density)
+ * How dense is the fluid, the only effect is whether or not a fluid replaces another fluid when they flow into each other. Default: 1000, the density of water at 4 degrees Celsius in kg/m³
+ * Temperature .setTemperature(temp)
+ * How hot, or cold is the fluid. Has currently no effect. Default: 295, the "normal" room temperature in degrees Kelvin, this is approximately 72°F or 22°C.
+ * Viscosity .setViscosity(viscosity)
+ * How thick the fluid is. Determines how fast it flows. Default: 1000 for water, lava uses 6000
+ * Is Gaseous .setGaseous(boolean)
+ * Indicates if the fluid is gaseous. Used for rendering. Default: false
+ *
+ */
+ public static void registerFluids() {
+ run();
+ }
+
+ private static void run() {
+ fluidSludge();
+ }
+
+ private static void fluidSludge() {
+ // testFluid
+ fluidSludge.setLuminosity(8);
+ fluidSludge.setDensity(8196);
+ fluidSludge.setTemperature(295);
+ fluidSludge.setViscosity(3000);
+ fluidSludge.setGaseous(false);
+ fluidSludge.setUnlocalizedName("fluid.sludge");
+ FluidRegistry.registerFluid(fluidSludge);
+ blockFluidSludge = new BlockFluidSludge(fluidSludge, Material.cactus).setBlockName("fluidBlockSludge");
+ GameRegistry.registerBlock(
+ blockFluidSludge,
+ CORE.MODID + "_" + blockFluidSludge.getUnlocalizedName().substring(5));
+ fluidSludge.setUnlocalizedName(blockFluidSludge.getUnlocalizedName());
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java b/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java
index 6354be632d..ed1cc112c3 100644
--- a/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java
+++ b/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java
@@ -1,14 +1,13 @@
package gtPlusPlus.core.fluids;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
import cpw.mods.fml.common.eventhandler.Event;
import gtPlusPlus.api.objects.GregtechException;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -27,293 +26,290 @@ import net.minecraftforge.event.entity.player.FillBucketEvent;
public class ItemGenericFluidBucket extends ItemBucket {
- private static IIcon mBaseBucketTexture;
- private static IIcon mOverlayBucketTexture;
- private static AutoMap<Block> mInternalFluidCache = new AutoMap<Block>();
-
- public ItemGenericFluidBucket(Block aFluid) {
- super(aFluid);
- this.setContainerItem(Items.bucket);
- this.maxStackSize = 1;
- mInternalFluidCache.put(aFluid);
- }
-
- public static ItemStack registerFluidForBucket(int aID) {
-
- if (FluidFactory.mMetaToBucketMap.containsKey(aID)) {
- try {
- throw new GregtechException(""+aID+" is already registered! Unable to register fluid: "+FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName());
- } catch (GregtechException e) {
- e.printStackTrace();
- CORE.crash(""+aID+" is already registered! Unable to register fluid: "+FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName());
- }
- }
- mInternalFluidCache.put(FluidFactory.mMetaToBlockMap.get(aID));
- return ItemUtils.simpleMetaStack(FluidFactory.mGenericBucket, aID, 1);
- }
-
- Map<Integer, IIcon> mIconCache = new LinkedHashMap<Integer, IIcon>();
-
- /**
- * Called whenever this item is equipped and the right mouse button is pressed.
- * Args: itemStack, world, entityPlayer
- */
- public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
-
- Block isFull = FluidFactory.mMetaToBlockMap.get(aStack.getItemDamage());
-
- boolean flag = isFull == Blocks.air;
- MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(aWorld, aPlayer, flag);
-
- if (movingobjectposition == null || isFull == null) {
- return aStack;
- } else {
- FillBucketEvent event = new FillBucketEvent(aPlayer, aStack, aWorld, movingobjectposition);
- if (MinecraftForge.EVENT_BUS.post(event)) {
- return aStack;
- }
-
- if (event.getResult() == Event.Result.ALLOW) {
- if (aPlayer.capabilities.isCreativeMode) {
- return aStack;
- }
-
- if (--aStack.stackSize <= 0) {
- return event.result;
- }
-
- if (!aPlayer.inventory.addItemStackToInventory(event.result)) {
- aPlayer.dropPlayerItemWithRandomChoice(event.result, false);
- }
-
- return aStack;
- }
- if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
- int i = movingobjectposition.blockX;
- int j = movingobjectposition.blockY;
- int k = movingobjectposition.blockZ;
-
- if (!aWorld.canMineBlock(aPlayer, i, j, k)) {
- return aStack;
- }
-
- if (flag) {
- if (!aPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, aStack)) {
- return aStack;
- }
-
- Material material = aWorld.getBlock(i, j, k).getMaterial();
- int l = aWorld.getBlockMetadata(i, j, k);
-
- if (material == Material.water && l == 0) {
- aWorld.setBlockToAir(i, j, k);
- return this.func_150910_a(aStack, aPlayer, Items.water_bucket);
- }
-
- if (material == Material.lava && l == 0) {
- aWorld.setBlockToAir(i, j, k);
- return this.func_150910_a(aStack, aPlayer, Items.lava_bucket);
- }
- } else {
- if (isFull == Blocks.air) {
- return new ItemStack(Items.bucket);
- }
-
- if (movingobjectposition.sideHit == 0) {
- --j;
- }
-
- if (movingobjectposition.sideHit == 1) {
- ++j;
- }
-
- if (movingobjectposition.sideHit == 2) {
- --k;
- }
-
- if (movingobjectposition.sideHit == 3) {
- ++k;
- }
-
- if (movingobjectposition.sideHit == 4) {
- --i;
- }
-
- if (movingobjectposition.sideHit == 5) {
- ++i;
- }
-
- if (!aPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, aStack)) {
- return aStack;
- }
-
- if (this.tryPlaceContainedLiquid(isFull, aWorld, i, j, k) && !aPlayer.capabilities.isCreativeMode) {
- return new ItemStack(Items.bucket);
- }
- }
- }
-
- return aStack;
- }
- }
-
- private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_) {
- if (p_150910_2_.capabilities.isCreativeMode) {
- return p_150910_1_;
- } else if (--p_150910_1_.stackSize <= 0) {
- return new ItemStack(p_150910_3_);
- } else {
- if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) {
- p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false);
- }
-
- return p_150910_1_;
- }
- }
-
- /**
- * Attempts to place the liquid contained inside the bucket.
- */
- public boolean tryPlaceContainedLiquid(Block isFull, World aWorld, int aX, int aY, int aZ) {
- if (isFull == Blocks.air) {
- return false;
- } else {
- Material material = aWorld.getBlock(aX, aY, aZ).getMaterial();
- boolean flag = !material.isSolid();
-
- if (!aWorld.isAirBlock(aX, aY, aZ) && !flag) {
- return false;
- } else {
-
- if (!aWorld.isRemote && flag && !material.isLiquid()) {
- aWorld.func_147480_a(aX, aY, aZ, true);
- }
-
- aWorld.setBlock(aX, aY, aZ, isFull, 0, 3);
-
- return true;
- }
- }
- }
-
- @Override
- public IIcon getIconFromDamage(int aMeta) {
- IIcon aTemp = mIconCache.get(aMeta);
- return aTemp != null ? aTemp : super.getIconFromDamage(aMeta);
- }
-
- @Override
- public boolean getHasSubtypes() {
- return mInternalFluidCache.size() > 0;
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- list.add(new ItemStack(item, 1, 0));
- for (Block f : mInternalFluidCache) {
- Integer aMeta;
- if (f != null) {
- aMeta = FluidFactory.mBlockToMetaMap.get(f);
- if (aMeta != null) {
- list.add(new ItemStack(item, 1, aMeta));
- }
- }
- }
- }
-
- @Override
- public int getMaxDamage() {
- return 512;
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
- // TODO Auto-generated method stub
- super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- if (stack != null && renderPass == 1) {
- return mOverlayBucketTexture;
- }
- else {
- return mBaseBucketTexture;
- }
- /*IIcon aTemp = mIconCache.get(stack.getItemDamage());
- return aTemp != null ? aTemp : super.getIcon(stack, renderPass, player, usingItem, useRemaining);*/
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getMaxDamage(ItemStack stack) {
- return 512;
- }
-
- @Override
- public boolean isDamaged(ItemStack stack) {
- return false;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if (pass == 1) {
- return mOverlayBucketTexture;
- }
- else {
- return mBaseBucketTexture;
- }
- }
-
- @Override
- public void registerIcons(final IIconRegister i) {
- mBaseBucketTexture = i.registerIcon("bucket_empty");
- mOverlayBucketTexture = i.registerIcon(CORE.MODID+":bucket.generic.overlay");
- }
-
- @Override
- public boolean tryPlaceContainedLiquid(World p_77875_1_, int p_77875_2_, int p_77875_3_, int p_77875_4_) {
- return tryPlaceContainedLiquid(Blocks.air, p_77875_1_, p_77875_2_, p_77875_3_, p_77875_4_);
- }
-
- @Override
- public int getColorFromItemStack(ItemStack aStack, int aPass) {
- if (aPass == 0) {
- return super.getColorFromItemStack(aStack, aPass);
- }
- else {
- return FluidFactory.mMetaToColourMap.get(aStack.getItemDamage());
- }
- }
-
- @Override
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
-
+ private static IIcon mBaseBucketTexture;
+ private static IIcon mOverlayBucketTexture;
+ private static AutoMap<Block> mInternalFluidCache = new AutoMap<Block>();
+
+ public ItemGenericFluidBucket(Block aFluid) {
+ super(aFluid);
+ this.setContainerItem(Items.bucket);
+ this.maxStackSize = 1;
+ mInternalFluidCache.put(aFluid);
+ }
+
+ public static ItemStack registerFluidForBucket(int aID) {
+
+ if (FluidFactory.mMetaToBucketMap.containsKey(aID)) {
+ try {
+ throw new GregtechException("" + aID + " is already registered! Unable to register fluid: "
+ + FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName());
+ } catch (GregtechException e) {
+ e.printStackTrace();
+ CORE.crash("" + aID + " is already registered! Unable to register fluid: "
+ + FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName());
+ }
+ }
+ mInternalFluidCache.put(FluidFactory.mMetaToBlockMap.get(aID));
+ return ItemUtils.simpleMetaStack(FluidFactory.mGenericBucket, aID, 1);
+ }
+
+ Map<Integer, IIcon> mIconCache = new LinkedHashMap<Integer, IIcon>();
+
+ /**
+ * Called whenever this item is equipped and the right mouse button is pressed.
+ * Args: itemStack, world, entityPlayer
+ */
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+
+ Block isFull = FluidFactory.mMetaToBlockMap.get(aStack.getItemDamage());
+
+ boolean flag = isFull == Blocks.air;
+ MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(aWorld, aPlayer, flag);
+
+ if (movingobjectposition == null || isFull == null) {
+ return aStack;
+ } else {
+ FillBucketEvent event = new FillBucketEvent(aPlayer, aStack, aWorld, movingobjectposition);
+ if (MinecraftForge.EVENT_BUS.post(event)) {
+ return aStack;
+ }
+
+ if (event.getResult() == Event.Result.ALLOW) {
+ if (aPlayer.capabilities.isCreativeMode) {
+ return aStack;
+ }
+
+ if (--aStack.stackSize <= 0) {
+ return event.result;
+ }
+
+ if (!aPlayer.inventory.addItemStackToInventory(event.result)) {
+ aPlayer.dropPlayerItemWithRandomChoice(event.result, false);
+ }
+
+ return aStack;
+ }
+ if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
+ int i = movingobjectposition.blockX;
+ int j = movingobjectposition.blockY;
+ int k = movingobjectposition.blockZ;
+
+ if (!aWorld.canMineBlock(aPlayer, i, j, k)) {
+ return aStack;
+ }
+
+ if (flag) {
+ if (!aPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, aStack)) {
+ return aStack;
+ }
+
+ Material material = aWorld.getBlock(i, j, k).getMaterial();
+ int l = aWorld.getBlockMetadata(i, j, k);
+
+ if (material == Material.water && l == 0) {
+ aWorld.setBlockToAir(i, j, k);
+ return this.func_150910_a(aStack, aPlayer, Items.water_bucket);
+ }
+
+ if (material == Material.lava && l == 0) {
+ aWorld.setBlockToAir(i, j, k);
+ return this.func_150910_a(aStack, aPlayer, Items.lava_bucket);
+ }
+ } else {
+ if (isFull == Blocks.air) {
+ return new ItemStack(Items.bucket);
+ }
+
+ if (movingobjectposition.sideHit == 0) {
+ --j;
+ }
+
+ if (movingobjectposition.sideHit == 1) {
+ ++j;
+ }
+
+ if (movingobjectposition.sideHit == 2) {
+ --k;
+ }
+
+ if (movingobjectposition.sideHit == 3) {
+ ++k;
+ }
+
+ if (movingobjectposition.sideHit == 4) {
+ --i;
+ }
+
+ if (movingobjectposition.sideHit == 5) {
+ ++i;
+ }
+
+ if (!aPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, aStack)) {
+ return aStack;
+ }
+
+ if (this.tryPlaceContainedLiquid(isFull, aWorld, i, j, k) && !aPlayer.capabilities.isCreativeMode) {
+ return new ItemStack(Items.bucket);
+ }
+ }
+ }
+
+ return aStack;
+ }
+ }
+
+ private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_) {
+ if (p_150910_2_.capabilities.isCreativeMode) {
+ return p_150910_1_;
+ } else if (--p_150910_1_.stackSize <= 0) {
+ return new ItemStack(p_150910_3_);
+ } else {
+ if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) {
+ p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false);
+ }
+
+ return p_150910_1_;
+ }
+ }
+
+ /**
+ * Attempts to place the liquid contained inside the bucket.
+ */
+ public boolean tryPlaceContainedLiquid(Block isFull, World aWorld, int aX, int aY, int aZ) {
+ if (isFull == Blocks.air) {
+ return false;
+ } else {
+ Material material = aWorld.getBlock(aX, aY, aZ).getMaterial();
+ boolean flag = !material.isSolid();
+
+ if (!aWorld.isAirBlock(aX, aY, aZ) && !flag) {
+ return false;
+ } else {
+
+ if (!aWorld.isRemote && flag && !material.isLiquid()) {
+ aWorld.func_147480_a(aX, aY, aZ, true);
+ }
+
+ aWorld.setBlock(aX, aY, aZ, isFull, 0, 3);
+
+ return true;
+ }
+ }
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int aMeta) {
+ IIcon aTemp = mIconCache.get(aMeta);
+ return aTemp != null ? aTemp : super.getIconFromDamage(aMeta);
+ }
+
+ @Override
+ public boolean getHasSubtypes() {
+ return mInternalFluidCache.size() > 0;
+ }
+
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ list.add(new ItemStack(item, 1, 0));
+ for (Block f : mInternalFluidCache) {
+ Integer aMeta;
+ if (f != null) {
+ aMeta = FluidFactory.mBlockToMetaMap.get(f);
+ if (aMeta != null) {
+ list.add(new ItemStack(item, 1, aMeta));
+ }
+ }
+ }
+ }
+
+ @Override
+ public int getMaxDamage() {
+ return 512;
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
+ // TODO Auto-generated method stub
+ super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ if (stack != null && renderPass == 1) {
+ return mOverlayBucketTexture;
+ } else {
+ return mBaseBucketTexture;
+ }
+ /*IIcon aTemp = mIconCache.get(stack.getItemDamage());
+ return aTemp != null ? aTemp : super.getIcon(stack, renderPass, player, usingItem, useRemaining);*/
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getMaxDamage(ItemStack stack) {
+ return 512;
+ }
+
+ @Override
+ public boolean isDamaged(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if (pass == 1) {
+ return mOverlayBucketTexture;
+ } else {
+ return mBaseBucketTexture;
+ }
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister i) {
+ mBaseBucketTexture = i.registerIcon("bucket_empty");
+ mOverlayBucketTexture = i.registerIcon(CORE.MODID + ":bucket.generic.overlay");
+ }
+
+ @Override
+ public boolean tryPlaceContainedLiquid(World p_77875_1_, int p_77875_2_, int p_77875_3_, int p_77875_4_) {
+ return tryPlaceContainedLiquid(Blocks.air, p_77875_1_, p_77875_2_, p_77875_3_, p_77875_4_);
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack aStack, int aPass) {
+ if (aPass == 0) {
+ return super.getColorFromItemStack(aStack, aPass);
+ } else {
+ return FluidFactory.mMetaToColourMap.get(aStack.getItemDamage());
+ }
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/gui/GUI_Base_Tile_Entity.java b/src/main/java/gtPlusPlus/core/gui/GUI_Base_Tile_Entity.java
index aa10363e7c..379827a1db 100644
--- a/src/main/java/gtPlusPlus/core/gui/GUI_Base_Tile_Entity.java
+++ b/src/main/java/gtPlusPlus/core/gui/GUI_Base_Tile_Entity.java
@@ -5,11 +5,10 @@ import net.minecraft.inventory.Container;
public abstract class GUI_Base_Tile_Entity extends GuiContainer {
- public final Container mContainer;
-
- public GUI_Base_Tile_Entity(Container aContainer) {
- super(aContainer);
- mContainer = aContainer;
- }
+ public final Container mContainer;
+ public GUI_Base_Tile_Entity(Container aContainer) {
+ super(aContainer);
+ mContainer = aContainer;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java b/src/main/java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java
index 1212054f01..d36de4bf28 100644
--- a/src/main/java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java
+++ b/src/main/java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java
@@ -1,56 +1,54 @@
package gtPlusPlus.core.gui.beta;
+import gtPlusPlus.core.interfaces.IGuiManagerMiscUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import gtPlusPlus.core.interfaces.IGuiManagerMiscUtils;
-
-public class Gui_ID_Registry
-{
- private static final Map<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classMap = new HashMap<Class<? extends IGuiManagerMiscUtils>, MU_GuiId>();
- private static final Map<Integer, MU_GuiId> idMap = new HashMap<Integer, MU_GuiId>();
- private static int nextId = 0;
-
- static
- {
- //registerGuiHandlers(Gui_Types.Tile, Arrays.asList(new Class[] {TileAlveary.class}));
- //registerGuiHandlers(MU_GuiType.Item, Arrays.asList(new Class[] { ItemBackpack.class, ItemBackpackNaturalist.class, ItemBeealyzer.class, ItemCatalogue.class, ItemFlutterlyzer.class, ItemHabitatLocator.class, ItemImprinter.class, ItemInfuser.class, ItemLetter.class, ItemSolderingIron.class, ItemTreealyzer.class }));
- //registerGuiHandlers(MU_GuiType.Entity, Arrays.asList(new Class[] { EntityMinecartApiary.class, EntityMinecartBeehouse.class }));
- }
-
- private static void registerGuiHandlers(final Gui_Types MU_GuiType, final List<Class<? extends IGuiManagerMiscUtils>> guiHandlerClasses)
- {
- for (final Class<? extends IGuiManagerMiscUtils> tileGuiHandlerClass : guiHandlerClasses)
- {
- final MU_GuiId guiId = new MU_GuiId(nextId++, MU_GuiType, tileGuiHandlerClass);
- classMap.put(tileGuiHandlerClass, guiId);
- idMap.put(Integer.valueOf(guiId.getId()), guiId);
- }
- }
-
- public static MU_GuiId getGuiIdForGuiHandler(final IGuiManagerMiscUtils guiHandler)
- {
- final Class<? extends IGuiManagerMiscUtils> guiHandlerClass = guiHandler.getClass();
- MU_GuiId guiId = classMap.get(guiHandlerClass);
- if (guiId == null) {
- for (final Map.Entry<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classGuiIdEntry : classMap.entrySet()) {
- if (((Class<?>)classGuiIdEntry.getKey()).isAssignableFrom(guiHandlerClass))
- {
- guiId = classGuiIdEntry.getValue();
- break;
- }
- }
- }
- if (guiId == null) {
- throw new IllegalStateException("No gui ID for gui handler: " + guiHandler);
- }
- return guiId;
- }
-
- public static MU_GuiId getGuiId(final int id)
- {
- return idMap.get(Integer.valueOf(id));
- }
-
+public class Gui_ID_Registry {
+ private static final Map<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classMap =
+ new HashMap<Class<? extends IGuiManagerMiscUtils>, MU_GuiId>();
+ private static final Map<Integer, MU_GuiId> idMap = new HashMap<Integer, MU_GuiId>();
+ private static int nextId = 0;
+
+ static {
+ // registerGuiHandlers(Gui_Types.Tile, Arrays.asList(new Class[] {TileAlveary.class}));
+ // registerGuiHandlers(MU_GuiType.Item, Arrays.asList(new Class[] { ItemBackpack.class,
+ // ItemBackpackNaturalist.class, ItemBeealyzer.class, ItemCatalogue.class, ItemFlutterlyzer.class,
+ // ItemHabitatLocator.class, ItemImprinter.class, ItemInfuser.class, ItemLetter.class, ItemSolderingIron.class,
+ // ItemTreealyzer.class }));
+ // registerGuiHandlers(MU_GuiType.Entity, Arrays.asList(new Class[] { EntityMinecartApiary.class,
+ // EntityMinecartBeehouse.class }));
+ }
+
+ private static void registerGuiHandlers(
+ final Gui_Types MU_GuiType, final List<Class<? extends IGuiManagerMiscUtils>> guiHandlerClasses) {
+ for (final Class<? extends IGuiManagerMiscUtils> tileGuiHandlerClass : guiHandlerClasses) {
+ final MU_GuiId guiId = new MU_GuiId(nextId++, MU_GuiType, tileGuiHandlerClass);
+ classMap.put(tileGuiHandlerClass, guiId);
+ idMap.put(Integer.valueOf(guiId.getId()), guiId);
+ }
+ }
+
+ public static MU_GuiId getGuiIdForGuiHandler(final IGuiManagerMiscUtils guiHandler) {
+ final Class<? extends IGuiManagerMiscUtils> guiHandlerClass = guiHandler.getClass();
+ MU_GuiId guiId = classMap.get(guiHandlerClass);
+ if (guiId == null) {
+ for (final Map.Entry<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classGuiIdEntry :
+ classMap.entrySet()) {
+ if (((Class<?>) classGuiIdEntry.getKey()).isAssignableFrom(guiHandlerClass)) {
+ guiId = classGuiIdEntry.getValue();
+ break;
+ }
+ }
+ }
+ if (guiId == null) {
+ throw new IllegalStateException("No gui ID for gui handler: " + guiHandler);
+ }
+ return guiId;
+ }
+
+ public static MU_GuiId getGuiId(final int id) {
+ return idMap.get(Integer.valueOf(id));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/gui/beta/Gui_Types.java b/src/main/java/gtPlusPlus/core/gui/beta/Gui_Types.java
index 9348f40c9c..bb095e74c0 100644
--- a/src/main/java/gtPlusPlus/core/gui/beta/Gui_Types.java
+++ b/src/main/java/gtPlusPlus/core/gui/beta/Gui_Types.java
@@ -1,8 +1,9 @@
package gtPlusPlus.core.gui.beta;
-public enum Gui_Types
-{
- Item, Tile, Entity;
+public enum Gui_Types {
+ Item,
+ Tile,
+ Entity;
- private Gui_Types() {}
-} \ No newline at end of file
+ private Gui_Types() {}
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/beta/MU_GuiId.java b/src/main/java/gtPlusPlus/core/gui/beta/MU_GuiId.java
index 116ad48480..faf823fdcf 100644
--- a/src/main/java/gtPlusPlus/core/gui/beta/MU_GuiId.java
+++ b/src/main/java/gtPlusPlus/core/gui/beta/MU_GuiId.java
@@ -1,32 +1,27 @@
package gtPlusPlus.core.gui.beta;
+
import gtPlusPlus.core.interfaces.IGuiManagerMiscUtils;
-public class MU_GuiId
-{
- private final int id;
- private final Gui_Types MU_GuiType;
- private final Class<? extends IGuiManagerMiscUtils> guiHandlerClass;
+public class MU_GuiId {
+ private final int id;
+ private final Gui_Types MU_GuiType;
+ private final Class<? extends IGuiManagerMiscUtils> guiHandlerClass;
- MU_GuiId(final int id, final Gui_Types MU_GuiType, final Class<? extends IGuiManagerMiscUtils> guiHandlerClass)
- {
- this.id = id;
- this.MU_GuiType = MU_GuiType;
- this.guiHandlerClass = guiHandlerClass;
- }
+ MU_GuiId(final int id, final Gui_Types MU_GuiType, final Class<? extends IGuiManagerMiscUtils> guiHandlerClass) {
+ this.id = id;
+ this.MU_GuiType = MU_GuiType;
+ this.guiHandlerClass = guiHandlerClass;
+ }
- public Gui_Types getGuiType()
- {
- return this.MU_GuiType;
- }
+ public Gui_Types getGuiType() {
+ return this.MU_GuiType;
+ }
- public Class<? extends IGuiManagerMiscUtils> getGuiHandlerClass()
- {
- return this.guiHandlerClass;
- }
+ public Class<? extends IGuiManagerMiscUtils> getGuiHandlerClass() {
+ return this.guiHandlerClass;
+ }
- public int getId()
- {
- return this.id;
- }
+ public int getId() {
+ return this.id;
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
index 0ad4b9b51f..ebd26d1f26 100644
--- a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
+++ b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
@@ -1,8 +1,8 @@
package gtPlusPlus.core.gui.item;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
+import gtPlusPlus.core.container.Container_BackpackBase;
+import gtPlusPlus.core.inventories.BaseInventoryBackpack;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.OpenGlHelper;
@@ -10,112 +10,115 @@ import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
-import gtPlusPlus.core.container.Container_BackpackBase;
-import gtPlusPlus.core.inventories.BaseInventoryBackpack;
-import gtPlusPlus.core.lib.CORE;
+public class GuiBaseBackpack extends GuiContainer {
+ /** x and y size of the inventory window in pixels. Defined as float, passed as int
+ * These are used for drawing the player model. */
+ private float xSize_lo;
-public class GuiBaseBackpack extends GuiContainer
-{
- /** x and y size of the inventory window in pixels. Defined as float, passed as int
- * These are used for drawing the player model. */
- private float xSize_lo;
- private float ySize_lo;
+ private float ySize_lo;
- /** The FontRenderer used by GuiScreen */
- protected FontRenderer fontRenderer;
+ /** The FontRenderer used by GuiScreen */
+ protected FontRenderer fontRenderer;
- /** ResourceLocation takes 2 parameters: ModId, path to texture at the location:
- * "src/minecraft/assets/modid/"
- *
- * I have provided a sample texture file that works with this tutorial. Download it
- * from Forge_Tutorials/textures/gui/
- */
- private static final ResourceLocation iconLocation = new ResourceLocation(CORE.MODID, "textures/gui/itemBackpack.png");
+ /** ResourceLocation takes 2 parameters: ModId, path to texture at the location:
+ * "src/minecraft/assets/modid/"
+ *
+ * I have provided a sample texture file that works with this tutorial. Download it
+ * from Forge_Tutorials/textures/gui/
+ */
+ private static final ResourceLocation iconLocation =
+ new ResourceLocation(CORE.MODID, "textures/gui/itemBackpack.png");
- /** The inventory to render on screen */
- private final BaseInventoryBackpack inventory;
+ /** The inventory to render on screen */
+ private final BaseInventoryBackpack inventory;
- public GuiBaseBackpack(final Container_BackpackBase containerItem)
- {
- super(containerItem);
- this.inventory = containerItem.inventory;
- }
+ public GuiBaseBackpack(final Container_BackpackBase containerItem) {
+ super(containerItem);
+ this.inventory = containerItem.inventory;
+ }
- /**
- * Draws the screen and all the components in it.
- */
- @Override
- public void drawScreen(final int par1, final int par2, final float par3)
- {
- super.drawScreen(par1, par2, par3);
- this.xSize_lo = par1;
- this.ySize_lo = par2;
- }
+ /**
+ * Draws the screen and all the components in it.
+ */
+ @Override
+ public void drawScreen(final int par1, final int par2, final float par3) {
+ super.drawScreen(par1, par2, par3);
+ this.xSize_lo = par1;
+ this.ySize_lo = par2;
+ }
- /**
- * Draw the foreground layer for the GuiContainer (everything in front of the items)
- */
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2)
- {
- final String s = this.inventory.hasCustomInventoryName() ? this.inventory.getInventoryName() : this.inventory.getInventoryName();
- //this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 0, 4210752);
- //this.fontRenderer.drawString(I18n.translate("container.inventory"), 26, this.ySize - 96 + 4, 4210752);
- }
+ /**
+ * Draw the foreground layer for the GuiContainer (everything in front of the items)
+ */
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ final String s = this.inventory.hasCustomInventoryName()
+ ? this.inventory.getInventoryName()
+ : this.inventory.getInventoryName();
+ // this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 0, 4210752);
+ // this.fontRenderer.drawString(I18n.translate("container.inventory"), 26, this.ySize - 96 + 4, 4210752);
+ }
- /**
- * Draw the background layer for the GuiContainer (everything behind the items)
- */
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3)
- {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
- final int i1;
- drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (l + 75) - 50 - this.ySize_lo, this.mc.thePlayer);
- }
+ /**
+ * Draw the background layer for the GuiContainer (everything behind the items)
+ */
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(iconLocation);
+ final int k = (this.width - this.xSize) / 2;
+ final int l = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
+ final int i1;
+ drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (l + 75) - 50 - this.ySize_lo, this.mc.thePlayer);
+ }
- /**
- * This renders the player model in standard inventory position (in later versions of Minecraft / Forge, you can
- * simply call GuiInventory.drawEntityOnScreen directly instead of copying this code)
- */
- public static void drawPlayerModel(final int x, final int y, final int scale, final float yaw, final float pitch, final EntityLivingBase entity) {
- GL11.glEnable(GL11.GL_COLOR_MATERIAL);
- GL11.glPushMatrix();
- GL11.glTranslatef(x, y, 50.0F);
- GL11.glScalef(-scale, scale, scale);
- GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- final float f2 = entity.renderYawOffset;
- final float f3 = entity.rotationYaw;
- final float f4 = entity.rotationPitch;
- final float f5 = entity.prevRotationYawHead;
- final float f6 = entity.rotationYawHead;
- GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
- RenderHelper.enableStandardItemLighting();
- GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
- entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F;
- entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F;
- entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F;
- entity.rotationYawHead = entity.rotationYaw;
- entity.prevRotationYawHead = entity.rotationYaw;
- GL11.glTranslatef(0.0F, entity.yOffset, 0.0F);
- RenderManager.instance.playerViewY = 180.0F;
- RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
- entity.renderYawOffset = f2;
- entity.rotationYaw = f3;
- entity.rotationPitch = f4;
- entity.prevRotationYawHead = f5;
- entity.rotationYawHead = f6;
- GL11.glPopMatrix();
- RenderHelper.disableStandardItemLighting();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
- }
+ /**
+ * This renders the player model in standard inventory position (in later versions of Minecraft / Forge, you can
+ * simply call GuiInventory.drawEntityOnScreen directly instead of copying this code)
+ */
+ public static void drawPlayerModel(
+ final int x,
+ final int y,
+ final int scale,
+ final float yaw,
+ final float pitch,
+ final EntityLivingBase entity) {
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(x, y, 50.0F);
+ GL11.glScalef(-scale, scale, scale);
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ final float f2 = entity.renderYawOffset;
+ final float f3 = entity.rotationYaw;
+ final float f4 = entity.rotationPitch;
+ final float f5 = entity.prevRotationYawHead;
+ final float f6 = entity.rotationYawHead;
+ GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
+ entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F;
+ entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F;
+ entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F;
+ entity.rotationYawHead = entity.rotationYaw;
+ entity.prevRotationYawHead = entity.rotationYaw;
+ GL11.glTranslatef(0.0F, entity.yOffset, 0.0F);
+ RenderManager.instance.playerViewY = 180.0F;
+ RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
+ entity.renderYawOffset = f2;
+ entity.rotationYaw = f3;
+ entity.rotationPitch = f4;
+ entity.prevRotationYawHead = f5;
+ entity.rotationYawHead = f6;
+ GL11.glPopMatrix();
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java
index ed347e8d30..fd8a8ed7b1 100644
--- a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java
+++ b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java
@@ -1,23 +1,7 @@
package gtPlusPlus.core.gui.item;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-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.FontRenderer;
-import net.minecraft.client.gui.GuiButton;
-import net.minecraft.client.gui.GuiScreenBook;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ResourceLocation;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -28,537 +12,586 @@ import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.client.gui.GuiScreenBook;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.GL11;
public class GuiBaseGrindle extends GuiContainer {
- /** The FontRenderer used by GuiScreen */
- protected FontRenderer fontRenderer;
-
- private GrindleGuiButton mButtonNextPage;
- private GrindleGuiButton mButtonPreviousPage;
- private String[][] mPageDataArray;
- private short mCurrentPage = 0;
-
- private static final ResourceLocation iconLocation = new ResourceLocation(CORE.MODID, "textures/gui/itemGrindle.png");
-
- /** The inventory to render on screen */
- private final BaseInventoryGrindle inventory;
-
- public GuiBaseGrindle(final Container_Grindle containerItem) {
- super(containerItem);
- this.inventory = containerItem.inventory;
- }
-
- /**
- * Draws the screen and all the components in it.
- */
- @Override
- public void drawScreen(final int par1, final int par2, final float par3) {
- super.drawScreen(par1, par2, par3);
- this.updateButtons();
- }
-
- /**
- * Draw the foreground layer for the GuiContainer (everything in front of the
- * items)
- */
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
-
- try {
-
- // Title
- this.fontRendererObj.drawStringWithShadow(I18n.format("Gregtech Information Transponder", new Object[0]), 0,
- -12, Utils.rgbtoHexValue(255, 255, 255));
- ItemStack aStack = this.inventory.getStackInSlot(0);
-
- if (aStack != null) {
-
- GrindleData aDataCurrent = new GrindleData(aStack);
-
- if (aDataCurrent.mValid) {
-
- // Debug NBT Information
- //NBTUtils.tryIterateNBTData(aStack);
-
- this.fontRendererObj.drawString(I18n.format(aDataCurrent.mTitle), 10, 8, Utils.rgbtoHexValue(125, 255, 125));
-
- int tTier = aDataCurrent.mExtraInformation;
- if (tTier >= 0) {
- //Draw the GUI
- // List prospection
- this.fontRendererObj.drawString(I18n.format(aDataCurrent.mTierDim+" | Page: "+this.mCurrentPage, new Object[0]), 10, 18, Utils.rgbtoHexValue(125, 255, 125));
- // Divider
- this.fontRendererObj.drawString(I18n.format("-------------------", new Object[0]), 10, 23, Utils.rgbtoHexValue(125, 125, 255));
- // Pos data
- this.fontRendererObj.drawString(I18n.format(aDataCurrent.mPosInfo, new Object[0]), 10, 29, Utils.rgbtoHexValue(125, 125, 255));
- // Divider
- this.fontRendererObj.drawString(I18n.format("-------------------", new Object[0]), 10, 35, Utils.rgbtoHexValue(125, 125, 255));
- int aLastYUsed = 41;
-
- int posOuter = 0;
- int posInner = 0;
-
- mPageDataArray = new String[MathUtils.roundToClosestInt(Math.ceil(aDataCurrent.mListData.size() / 9.00))][9];
- for (String e : aDataCurrent.mListData) {
- if (e != null) {
- mPageDataArray[posInner][posOuter] = e;
- if (posOuter < 8) {
- posOuter++;
- }
- else {
- posOuter = 0;
- posInner++;
- }
- }
- else {
- continue;
- }
- }
-
- String[] aCurrentPage = mPageDataArray[this.mCurrentPage];
-
- if (aCurrentPage != null) {
- //Logger.INFO("valid Current page " + this.mCurrentPage);
- if (aCurrentPage.length > 0) {
- for (int i=0;i<aCurrentPage.length;i++) {
- if ((aLastYUsed + 9) <= (68 + 56)) {
- String aCP = aCurrentPage[i];
- //Logger.INFO("Printing "+aCP);
- if (aCP != null && aCP.length() > 0) {
- if (!aCP.toLowerCase().contains("empty") && !aCP.toLowerCase().contains("null")) {
- this.fontRendererObj.drawString(I18n.format(aCP), 10, aLastYUsed, Utils.rgbtoHexValue(125, 255, 125));
- aLastYUsed += 9;
- }
- }
- }
- }
- }
- }
-
-
-
-
- }
-
- //Non-Prospecting Data
- else {
- //Draw the GUI
- // List prospection
- this.fontRendererObj.drawString(I18n.format(aDataCurrent.mTierDim, new Object[0]), 10, 18, Utils.rgbtoHexValue(125, 255, 125));
- // Divider
- this.fontRendererObj.drawString(I18n.format("-------------------", new Object[0]), 10, 23, Utils.rgbtoHexValue(125, 125, 255));
- // Pos data
- this.fontRendererObj.drawString(I18n.format(aDataCurrent.mPosInfo, new Object[0]), 10, 29, Utils.rgbtoHexValue(125, 125, 255));
- // Divider
- this.fontRendererObj.drawString(I18n.format("-------------------", new Object[0]), 10, 35, Utils.rgbtoHexValue(125, 125, 255));
- int aLastYUsed = 41;
- /*for (int i=0;i<aDataCurrent.mListData.size();i++) {
- if ((aLastYUsed + 9) <= (68 + 56)) {
- this.fontRendererObj.drawString(I18n.format(aDataCurrent.mListData.get(i), new Object[0]), 10, aLastYUsed, Utils.rgbtoHexValue(125, 255, 125));
- aLastYUsed = aLastYUsed + 9;
- }
- } */
- }
- }
- else {
- this.fontRendererObj.drawStringWithShadow(I18n.format("Invalid data item stored in slot.", new Object[0]), 10, 8,
- Utils.rgbtoHexValue(255, 125, 125));
- }
- } else {
- // Valid Datastick?
- this.fontRendererObj.drawStringWithShadow(I18n.format("Insert device into port.", new Object[0]), 10, 8, Utils.rgbtoHexValue(255, 125, 125));
- this.mPageDataArray = new String[][] {{}};
- this.mCurrentPage = 0;
- }
-
- // Inventory Label
- this.fontRendererObj.drawStringWithShadow(I18n.format("container.inventory", new Object[0]), 8, 131,
- Utils.rgbtoHexValue(255, 255, 255));
-
- }
- catch (Throwable t) {
- Logger.INFO("GUI CRASH - "+t);
- t.printStackTrace();
- }
-
- }
-
- /**
- * Draw the background layer for the GuiContainer (everything behind the items)
- */
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
- }
-
- /**
- * Adds the buttons (and other controls) to the screen in question.
- */
- @SuppressWarnings("unchecked")
- @Override
- public void initGui(){
- super.initGui();
- this.buttonList.clear();
- Keyboard.enableRepeatEvents(true);
- final int k = (this.width - this.xSize) - (this.width/16);
- this.mButtonNextPage = new GrindleGuiButton(1, k, 155, true);
- this.mButtonPreviousPage = new GrindleGuiButton(2, k-20, 155, false);
- this.buttonList.add(this.mButtonNextPage);
- this.buttonList.add(this.mButtonPreviousPage);
- this.mCurrentPage = 0;
- this.updateButtons();
- }
-
-
- /**
- * Called when the screen is unloaded. Used to disable keyboard repeat events
- */
- @Override
- public void onGuiClosed() {
- Keyboard.enableRepeatEvents(false);
- this.mCurrentPage = 0;
- super.onGuiClosed();
- }
-
- private void updateButtons(){
- if (this.mCurrentPage >= 0) {
- if (this.mPageDataArray != null) {
- if (this.mCurrentPage < (this.mPageDataArray.length - 1)) {
- this.mButtonNextPage.visible = true;
- } else {
- this.mButtonNextPage.visible = false;
- }
- } else {
- this.mButtonNextPage.visible = false;
- }
- }
- if (this.mCurrentPage > 0) {
- this.mButtonPreviousPage.visible = true;
- }
- else {
- this.mButtonPreviousPage.visible = false;
- }
- }
-
-
- /**
- * Scrolling Related
- */
- @Override
- protected void actionPerformed(GuiButton aButton) {
- if (aButton.enabled && aButton.visible) {
- if (aButton.id == 1) {
- if (this.mCurrentPage < this.mPageDataArray.length - 1) {
- ++this.mCurrentPage;
- }
- } else if (aButton.id == 2) {
- if (this.mCurrentPage > 0) {
- --this.mCurrentPage;
- }
- }
- this.updateButtons();
- }
- }
-
- /**
- * Handles mouse input.
- */
- @Override
- public void handleMouseInput() {
- super.handleMouseInput();
- int i = Mouse.getEventDWheel();
- /*
- * if (i != 0) {
- *
- *
- * this.currentScroll = (float) ((double) this.currentScroll - (double) i /
- * (double) j);
- *
- * if (this.currentScroll < 0.0F) { this.currentScroll = 0.0F; }
- *
- * if (this.currentScroll > 1.0F) { this.currentScroll = 1.0F; }
- *
- * this.scrollTo(this.currentScroll); }
- */
- }
-
- /**
- * Called when the mouse is moved or a mouse button is released. Signature:
- * (mouseX, mouseY, which) which==-1 is mouseMove, which==0 or which==1 is
- * mouseUp
- */
- @Override
- protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) {
- /*
- * if (p_146286_3_ == 0) { int l = p_146286_1_ - this.guiLeft; int i1 =
- * p_146286_2_ - this.guiTop; CreativeTabs[] acreativetabs =
- * CreativeTabs.creativeTabArray; int j1 = acreativetabs.length;
- *
- * for (int k1 = 0; k1 < j1; ++k1) { CreativeTabs creativetabs =
- * acreativetabs[k1];
- *
- * if (creativetabs != null && this.func_147049_a(creativetabs, l, i1)) {
- * this.setCurrentCreativeTab(creativetabs); return; } } }
- */
-
- super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_);
- }
-
- /**
- * Allows Mouseover Tooltips
- */
- @Override
- protected void renderToolTip(ItemStack aStack, int p_146285_2_, int p_146285_3_) {
- super.renderToolTip(aStack, p_146285_2_, p_146285_3_);
- }
-
- /**
- * Custom Buttons
- */
-
- @SideOnly(Side.CLIENT)
- static class GrindleGuiButton extends GuiButton {
-
- public static final ResourceLocation mBookTexture;
-
- static {
- ResourceLocation r;
- try {
- r = (ResourceLocation) ReflectionUtils.getField(GuiScreenBook.class, "bookGuiTextures").get(null);
-
- } catch (IllegalArgumentException | IllegalAccessException e) {
- r = new ResourceLocation("textures/gui/book.png");
- }
- mBookTexture = r;
- }
-
- private final boolean aPageForward;
-
- public GrindleGuiButton(int aID, int aX, int aY, boolean aForwards) {
- this(aID, aX, aY, 20, 12, aForwards);
- }
-
- public GrindleGuiButton(int aID, int aX, int aY, int aWidth, int aHeight, boolean aForwards) {
- super(aID, aX, aY, aWidth, aHeight, "");
- this.aPageForward = aForwards;
- }
-
- /**
- * Draws this button to the screen.
- */
- public void drawButton(Minecraft aGame, int aX, int aY) {
- if (this.visible) {
- boolean flag = aX >= this.xPosition && aY >= this.yPosition
- && aX < this.xPosition + this.width && aY < this.yPosition + this.height;
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- aGame.getTextureManager().bindTexture(iconLocation);
- int k = 0;
- int l = 192;
-
- if (flag) {
- k += 23;
- }
-
- if (!this.aPageForward) {
- l += 13;
- }
-
- this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 22, 12);
- }
- }
- }
-
-
- public static class GrindleData {
-
- public static enum GrindleMode {
- PROSPECTING(0),
- ELEMENT(1);
- private final int aModeID;
- private GrindleMode (final int aMode)
- {
- this.aModeID = aMode;
- }
-
- public int getMode() {
- return this.aModeID;
- }
- }
-
- final boolean mValid;
- final ItemStack mStack;
- final String mTitle, mPosInfo, mTierDim;
- final AutoMap<String> mListData;
- final GrindleMode mMode;
- final int mExtraInformation;
-
-
- public GrindleData(ItemStack iStack) {
-
- if (iStack == null) {
- mValid = false;
- mStack = null;
- mTitle = null;
- mListData = null;
- mMode = null;
- mExtraInformation = 0;
- this.mTierDim = "";
- this.mPosInfo = "";
- } else {
-
- this.mStack = iStack;
-
- int aType = -1;
- boolean isProspecting = false;
-
- // If Input stack is a Data stick/Orb, set a valid type.
- if (GT_Utility.areStacksEqual(iStack, CI.getDataStick(), true)) {
- aType = 0;
- } else if (GT_Utility.areStacksEqual(iStack, CI.getDataOrb(), true)) {
- aType = 1;
- }
-
- NBTTagCompound tNBT = iStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
-
- mTitle = tNBT.hasKey("title") ? tNBT.getString("title")
- : (aType == 0 ? "Empty Data Stick" : (aType == 1 ? "Empty Data Orb" : "Unknown Item"));
- if (mTitle.toLowerCase().contains("raw prospection data")) {
- isProspecting = true;
- }
-
- byte tTier = -1;
- if (isProspecting) {
- if (!tNBT.hasKey("prospection_tier") && tNBT.hasKey("prospection")) {
- tTier = 0;
- } else if (tNBT.hasKey("prospection_tier") && !tNBT.hasKey("prospection")) {
- tTier = tNBT.getByte("prospection_tier");
- }
- }
-
- mExtraInformation = isProspecting ? tTier : -1;
-
- if (tTier >= 0) {
- String xPos, yPos, zPos, aDim;
- String aPositionString, aInfoString;
- Set<String> aOreTypes = new LinkedHashSet<String>();
- Set<String> aOilTypes = new LinkedHashSet<String>();
-
- // Set variables that are shared between prospection types.
- if (tTier == 0) {
- String tData = tNBT.getString("prospection");
- String[] tDataArray = tData.split(",");
- xPos = tDataArray[0];
- yPos = tDataArray[1];
- zPos = tDataArray[2];
- aDim = tDataArray[3];
- aOilTypes.add("Oil Type: " + tDataArray[5]);
- aOilTypes.add("--------------------");
- aOreTypes.add("Ore Types: ");
- for (int i = 6; tDataArray.length > i; i++) {
- aOreTypes.add("-" + tDataArray[i]);
- }
- } else {
- String tPos = tNBT.getString("prospection_pos");
- String[] tPosData = tPos.split(" ");
- xPos = tPosData[1];
- yPos = tPosData[3];
- zPos = tPosData[5];
- aDim = tPosData[7];
- // Oil
- String tOil = tNBT.getString("prospection_oils");
- String[] tOilData = tOil.split("\\|");
- if (tOilData.length > 0) {
- aOilTypes.add("Oil Types:");
- for (String s : tOilData) {
- if (s != null) {
- aOilTypes.add(s);
- }
- }
- aOilTypes.add("--------------------");
- }
-
- // Near
- String tOresNear = tNBT.getString("prospection_near");
- String[] tOresNearData = tOresNear.split("\\|");
- // Middle
- String tOresMid = tNBT.getString("prospection_middle");
- String[] tOresMidData = tOresMid.split("\\|");
- // Far
- String tOresFar = tNBT.getString("prospection_far");
- String[] tOresFarData = tOresFar.split("\\|");
-
- if ((tOresNearData.length + tOresMidData.length + tOresFarData.length) > 0) {
- aOreTypes.add("Ore Types:");
- if (tOresNearData.length > 0) {
- for (String s : tOresNearData) {
- if (s != null) {
- aOreTypes.add("-" + s + " - Near");
- }
- }
- }
- if (tOresMidData.length > 0) {
- for (String s : tOresMidData) {
- if (s != null) {
- aOreTypes.add("-" + s + " - Mid");
- }
- }
- }
- if (tOresFarData.length > 0) {
- for (String s : tOresFarData) {
- if (s != null) {
- aOreTypes.add("-" + s + " - Far");
- }
- }
- }
- }
- }
-
- mListData = new AutoMap<String>();
- if (aOilTypes.size() > 0) {
- for (String aOils : aOilTypes) {
- if (aOils != null && aOils.length() > 0) {
- mListData.put(aOils);
- }
- }
- }
-
- if (aOreTypes.size() > 0) {
- for (String aOres : aOreTypes) {
- if (aOres != null && aOres.length() > 0) {
- mListData.put(aOres);
- }
- }
- }
-
- // Set Types
- mMode = GrindleMode.PROSPECTING;
- this.mTierDim = (aInfoString = "Tier: " + tTier + " | Dim: " + aDim);
- this.mPosInfo = (aPositionString = "X:" + xPos + ", Y:" + yPos + ", Z:" + zPos);
- this.mValid = true;
- }
-
- // Non-Prospectic Data
- else {
- mValid = true;
- mListData = null;
- mMode = GrindleMode.ELEMENT;
- this.mTierDim = "PLACEHOLDER";
- this.mPosInfo = "PLACEHOLDER";
- }
-
- }
-
- }
-
- }
-
-
+ /** The FontRenderer used by GuiScreen */
+ protected FontRenderer fontRenderer;
+
+ private GrindleGuiButton mButtonNextPage;
+ private GrindleGuiButton mButtonPreviousPage;
+ private String[][] mPageDataArray;
+ private short mCurrentPage = 0;
+
+ private static final ResourceLocation iconLocation =
+ new ResourceLocation(CORE.MODID, "textures/gui/itemGrindle.png");
+
+ /** The inventory to render on screen */
+ private final BaseInventoryGrindle inventory;
+
+ public GuiBaseGrindle(final Container_Grindle containerItem) {
+ super(containerItem);
+ this.inventory = containerItem.inventory;
+ }
+
+ /**
+ * Draws the screen and all the components in it.
+ */
+ @Override
+ public void drawScreen(final int par1, final int par2, final float par3) {
+ super.drawScreen(par1, par2, par3);
+ this.updateButtons();
+ }
+
+ /**
+ * Draw the foreground layer for the GuiContainer (everything in front of the
+ * items)
+ */
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+
+ try {
+
+ // Title
+ this.fontRendererObj.drawStringWithShadow(
+ I18n.format("Gregtech Information Transponder", new Object[0]),
+ 0,
+ -12,
+ Utils.rgbtoHexValue(255, 255, 255));
+ ItemStack aStack = this.inventory.getStackInSlot(0);
+
+ if (aStack != null) {
+
+ GrindleData aDataCurrent = new GrindleData(aStack);
+
+ if (aDataCurrent.mValid) {
+
+ // Debug NBT Information
+ // NBTUtils.tryIterateNBTData(aStack);
+
+ this.fontRendererObj.drawString(
+ I18n.format(aDataCurrent.mTitle), 10, 8, Utils.rgbtoHexValue(125, 255, 125));
+
+ int tTier = aDataCurrent.mExtraInformation;
+ if (tTier >= 0) {
+ // Draw the GUI
+ // List prospection
+ this.fontRendererObj.drawString(
+ I18n.format(aDataCurrent.mTierDim + " | Page: " + this.mCurrentPage, new Object[0]),
+ 10,
+ 18,
+ Utils.rgbtoHexValue(125, 255, 125));
+ // Divider
+ this.fontRendererObj.drawString(
+ I18n.format("-------------------", new Object[0]),
+ 10,
+ 23,
+ Utils.rgbtoHexValue(125, 125, 255));
+ // Pos data
+ this.fontRendererObj.drawString(
+ I18n.format(aDataCurrent.mPosInfo, new Object[0]),
+ 10,
+ 29,
+ Utils.rgbtoHexValue(125, 125, 255));
+ // Divider
+ this.fontRendererObj.drawString(
+ I18n.format("-------------------", new Object[0]),
+ 10,
+ 35,
+ Utils.rgbtoHexValue(125, 125, 255));
+ int aLastYUsed = 41;
+
+ int posOuter = 0;
+ int posInner = 0;
+
+ mPageDataArray = new String
+ [MathUtils.roundToClosestInt(Math.ceil(aDataCurrent.mListData.size() / 9.00))][9];
+ for (String e : aDataCurrent.mListData) {
+ if (e != null) {
+ mPageDataArray[posInner][posOuter] = e;
+ if (posOuter < 8) {
+ posOuter++;
+ } else {
+ posOuter = 0;
+ posInner++;
+ }
+ } else {
+ continue;
+ }
+ }
+
+ String[] aCurrentPage = mPageDataArray[this.mCurrentPage];
+
+ if (aCurrentPage != null) {
+ // Logger.INFO("valid Current page " + this.mCurrentPage);
+ if (aCurrentPage.length > 0) {
+ for (int i = 0; i < aCurrentPage.length; i++) {
+ if ((aLastYUsed + 9) <= (68 + 56)) {
+ String aCP = aCurrentPage[i];
+ // Logger.INFO("Printing "+aCP);
+ if (aCP != null && aCP.length() > 0) {
+ if (!aCP.toLowerCase().contains("empty")
+ && !aCP.toLowerCase().contains("null")) {
+ this.fontRendererObj.drawString(
+ I18n.format(aCP),
+ 10,
+ aLastYUsed,
+ Utils.rgbtoHexValue(125, 255, 125));
+ aLastYUsed += 9;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ // Non-Prospecting Data
+ else {
+ // Draw the GUI
+ // List prospection
+ this.fontRendererObj.drawString(
+ I18n.format(aDataCurrent.mTierDim, new Object[0]),
+ 10,
+ 18,
+ Utils.rgbtoHexValue(125, 255, 125));
+ // Divider
+ this.fontRendererObj.drawString(
+ I18n.format("-------------------", new Object[0]),
+ 10,
+ 23,
+ Utils.rgbtoHexValue(125, 125, 255));
+ // Pos data
+ this.fontRendererObj.drawString(
+ I18n.format(aDataCurrent.mPosInfo, new Object[0]),
+ 10,
+ 29,
+ Utils.rgbtoHexValue(125, 125, 255));
+ // Divider
+ this.fontRendererObj.drawString(
+ I18n.format("-------------------", new Object[0]),
+ 10,
+ 35,
+ Utils.rgbtoHexValue(125, 125, 255));
+ int aLastYUsed = 41;
+ /*for (int i=0;i<aDataCurrent.mListData.size();i++) {
+ if ((aLastYUsed + 9) <= (68 + 56)) {
+ this.fontRendererObj.drawString(I18n.format(aDataCurrent.mListData.get(i), new Object[0]), 10, aLastYUsed, Utils.rgbtoHexValue(125, 255, 125));
+ aLastYUsed = aLastYUsed + 9;
+ }
+ } */
+ }
+ } else {
+ this.fontRendererObj.drawStringWithShadow(
+ I18n.format("Invalid data item stored in slot.", new Object[0]),
+ 10,
+ 8,
+ Utils.rgbtoHexValue(255, 125, 125));
+ }
+ } else {
+ // Valid Datastick?
+ this.fontRendererObj.drawStringWithShadow(
+ I18n.format("Insert device into port.", new Object[0]),
+ 10,
+ 8,
+ Utils.rgbtoHexValue(255, 125, 125));
+ this.mPageDataArray = new String[][] {{}};
+ this.mCurrentPage = 0;
+ }
+
+ // Inventory Label
+ this.fontRendererObj.drawStringWithShadow(
+ I18n.format("container.inventory", new Object[0]), 8, 131, Utils.rgbtoHexValue(255, 255, 255));
+
+ } catch (Throwable t) {
+ Logger.INFO("GUI CRASH - " + t);
+ t.printStackTrace();
+ }
+ }
+
+ /**
+ * Draw the background layer for the GuiContainer (everything behind the items)
+ */
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(iconLocation);
+ final int k = (this.width - this.xSize) / 2;
+ final int l = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
+ }
+
+ /**
+ * Adds the buttons (and other controls) to the screen in question.
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void initGui() {
+ super.initGui();
+ this.buttonList.clear();
+ Keyboard.enableRepeatEvents(true);
+ final int k = (this.width - this.xSize) - (this.width / 16);
+ this.mButtonNextPage = new GrindleGuiButton(1, k, 155, true);
+ this.mButtonPreviousPage = new GrindleGuiButton(2, k - 20, 155, false);
+ this.buttonList.add(this.mButtonNextPage);
+ this.buttonList.add(this.mButtonPreviousPage);
+ this.mCurrentPage = 0;
+ this.updateButtons();
+ }
+
+ /**
+ * Called when the screen is unloaded. Used to disable keyboard repeat events
+ */
+ @Override
+ public void onGuiClosed() {
+ Keyboard.enableRepeatEvents(false);
+ this.mCurrentPage = 0;
+ super.onGuiClosed();
+ }
+
+ private void updateButtons() {
+ if (this.mCurrentPage >= 0) {
+ if (this.mPageDataArray != null) {
+ if (this.mCurrentPage < (this.mPageDataArray.length - 1)) {
+ this.mButtonNextPage.visible = true;
+ } else {
+ this.mButtonNextPage.visible = false;
+ }
+ } else {
+ this.mButtonNextPage.visible = false;
+ }
+ }
+ if (this.mCurrentPage > 0) {
+ this.mButtonPreviousPage.visible = true;
+ } else {
+ this.mButtonPreviousPage.visible = false;
+ }
+ }
+
+ /**
+ * Scrolling Related
+ */
+ @Override
+ protected void actionPerformed(GuiButton aButton) {
+ if (aButton.enabled && aButton.visible) {
+ if (aButton.id == 1) {
+ if (this.mCurrentPage < this.mPageDataArray.length - 1) {
+ ++this.mCurrentPage;
+ }
+ } else if (aButton.id == 2) {
+ if (this.mCurrentPage > 0) {
+ --this.mCurrentPage;
+ }
+ }
+ this.updateButtons();
+ }
+ }
+
+ /**
+ * Handles mouse input.
+ */
+ @Override
+ public void handleMouseInput() {
+ super.handleMouseInput();
+ int i = Mouse.getEventDWheel();
+ /*
+ * if (i != 0) {
+ *
+ *
+ * this.currentScroll = (float) ((double) this.currentScroll - (double) i /
+ * (double) j);
+ *
+ * if (this.currentScroll < 0.0F) { this.currentScroll = 0.0F; }
+ *
+ * if (this.currentScroll > 1.0F) { this.currentScroll = 1.0F; }
+ *
+ * this.scrollTo(this.currentScroll); }
+ */
+ }
+
+ /**
+ * Called when the mouse is moved or a mouse button is released. Signature:
+ * (mouseX, mouseY, which) which==-1 is mouseMove, which==0 or which==1 is
+ * mouseUp
+ */
+ @Override
+ protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) {
+ /*
+ * if (p_146286_3_ == 0) { int l = p_146286_1_ - this.guiLeft; int i1 =
+ * p_146286_2_ - this.guiTop; CreativeTabs[] acreativetabs =
+ * CreativeTabs.creativeTabArray; int j1 = acreativetabs.length;
+ *
+ * for (int k1 = 0; k1 < j1; ++k1) { CreativeTabs creativetabs =
+ * acreativetabs[k1];
+ *
+ * if (creativetabs != null && this.func_147049_a(creativetabs, l, i1)) {
+ * this.setCurrentCreativeTab(creativetabs); return; } } }
+ */
+
+ super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_);
+ }
+
+ /**
+ * Allows Mouseover Tooltips
+ */
+ @Override
+ protected void renderToolTip(ItemStack aStack, int p_146285_2_, int p_146285_3_) {
+ super.renderToolTip(aStack, p_146285_2_, p_146285_3_);
+ }
+
+ /**
+ * Custom Buttons
+ */
+ @SideOnly(Side.CLIENT)
+ static class GrindleGuiButton extends GuiButton {
+
+ public static final ResourceLocation mBookTexture;
+
+ static {
+ ResourceLocation r;
+ try {
+ r = (ResourceLocation) ReflectionUtils.getField(GuiScreenBook.class, "bookGuiTextures")
+ .get(null);
+
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ r = new ResourceLocation("textures/gui/book.png");
+ }
+ mBookTexture = r;
+ }
+
+ private final boolean aPageForward;
+
+ public GrindleGuiButton(int aID, int aX, int aY, boolean aForwards) {
+ this(aID, aX, aY, 20, 12, aForwards);
+ }
+
+ public GrindleGuiButton(int aID, int aX, int aY, int aWidth, int aHeight, boolean aForwards) {
+ super(aID, aX, aY, aWidth, aHeight, "");
+ this.aPageForward = aForwards;
+ }
+
+ /**
+ * Draws this button to the screen.
+ */
+ public void drawButton(Minecraft aGame, int aX, int aY) {
+ if (this.visible) {
+ boolean flag = aX >= this.xPosition
+ && aY >= this.yPosition
+ && aX < this.xPosition + this.width
+ && aY < this.yPosition + this.height;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ aGame.getTextureManager().bindTexture(iconLocation);
+ int k = 0;
+ int l = 192;
+
+ if (flag) {
+ k += 23;
+ }
+
+ if (!this.aPageForward) {
+ l += 13;
+ }
+
+ this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 22, 12);
+ }
+ }
+ }
+
+ public static class GrindleData {
+
+ public static enum GrindleMode {
+ PROSPECTING(0),
+ ELEMENT(1);
+ private final int aModeID;
+
+ private GrindleMode(final int aMode) {
+ this.aModeID = aMode;
+ }
+
+ public int getMode() {
+ return this.aModeID;
+ }
+ }
+
+ final boolean mValid;
+ final ItemStack mStack;
+ final String mTitle, mPosInfo, mTierDim;
+ final AutoMap<String> mListData;
+ final GrindleMode mMode;
+ final int mExtraInformation;
+
+ public GrindleData(ItemStack iStack) {
+
+ if (iStack == null) {
+ mValid = false;
+ mStack = null;
+ mTitle = null;
+ mListData = null;
+ mMode = null;
+ mExtraInformation = 0;
+ this.mTierDim = "";
+ this.mPosInfo = "";
+ } else {
+
+ this.mStack = iStack;
+
+ int aType = -1;
+ boolean isProspecting = false;
+
+ // If Input stack is a Data stick/Orb, set a valid type.
+ if (GT_Utility.areStacksEqual(iStack, CI.getDataStick(), true)) {
+ aType = 0;
+ } else if (GT_Utility.areStacksEqual(iStack, CI.getDataOrb(), true)) {
+ aType = 1;
+ }
+
+ NBTTagCompound tNBT = iStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ }
+
+ mTitle = tNBT.hasKey("title")
+ ? tNBT.getString("title")
+ : (aType == 0 ? "Empty Data Stick" : (aType == 1 ? "Empty Data Orb" : "Unknown Item"));
+ if (mTitle.toLowerCase().contains("raw prospection data")) {
+ isProspecting = true;
+ }
+
+ byte tTier = -1;
+ if (isProspecting) {
+ if (!tNBT.hasKey("prospection_tier") && tNBT.hasKey("prospection")) {
+ tTier = 0;
+ } else if (tNBT.hasKey("prospection_tier") && !tNBT.hasKey("prospection")) {
+ tTier = tNBT.getByte("prospection_tier");
+ }
+ }
+
+ mExtraInformation = isProspecting ? tTier : -1;
+
+ if (tTier >= 0) {
+ String xPos, yPos, zPos, aDim;
+ String aPositionString, aInfoString;
+ Set<String> aOreTypes = new LinkedHashSet<String>();
+ Set<String> aOilTypes = new LinkedHashSet<String>();
+
+ // Set variables that are shared between prospection types.
+ if (tTier == 0) {
+ String tData = tNBT.getString("prospection");
+ String[] tDataArray = tData.split(",");
+ xPos = tDataArray[0];
+ yPos = tDataArray[1];
+ zPos = tDataArray[2];
+ aDim = tDataArray[3];
+ aOilTypes.add("Oil Type: " + tDataArray[5]);
+ aOilTypes.add("--------------------");
+ aOreTypes.add("Ore Types: ");
+ for (int i = 6; tDataArray.length > i; i++) {
+ aOreTypes.add("-" + tDataArray[i]);
+ }
+ } else {
+ String tPos = tNBT.getString("prospection_pos");
+ String[] tPosData = tPos.split(" ");
+ xPos = tPosData[1];
+ yPos = tPosData[3];
+ zPos = tPosData[5];
+ aDim = tPosData[7];
+ // Oil
+ String tOil = tNBT.getString("prospection_oils");
+ String[] tOilData = tOil.split("\\|");
+ if (tOilData.length > 0) {
+ aOilTypes.add("Oil Types:");
+ for (String s : tOilData) {
+ if (s != null) {
+ aOilTypes.add(s);
+ }
+ }
+ aOilTypes.add("--------------------");
+ }
+
+ // Near
+ String tOresNear = tNBT.getString("prospection_near");
+ String[] tOresNearData = tOresNear.split("\\|");
+ // Middle
+ String tOresMid = tNBT.getString("prospection_middle");
+ String[] tOresMidData = tOresMid.split("\\|");
+ // Far
+ String tOresFar = tNBT.getString("prospection_far");
+ String[] tOresFarData = tOresFar.split("\\|");
+
+ if ((tOresNearData.length + tOresMidData.length + tOresFarData.length) > 0) {
+ aOreTypes.add("Ore Types:");
+ if (tOresNearData.length > 0) {
+ for (String s : tOresNearData) {
+ if (s != null) {
+ aOreTypes.add("-" + s + " - Near");
+ }
+ }
+ }
+ if (tOresMidData.length > 0) {
+ for (String s : tOresMidData) {
+ if (s != null) {
+ aOreTypes.add("-" + s + " - Mid");
+ }
+ }
+ }
+ if (tOresFarData.length > 0) {
+ for (String s : tOresFarData) {
+ if (s != null) {
+ aOreTypes.add("-" + s + " - Far");
+ }
+ }
+ }
+ }
+ }
+
+ mListData = new AutoMap<String>();
+ if (aOilTypes.size() > 0) {
+ for (String aOils : aOilTypes) {
+ if (aOils != null && aOils.length() > 0) {
+ mListData.put(aOils);
+ }
+ }
+ }
+
+ if (aOreTypes.size() > 0) {
+ for (String aOres : aOreTypes) {
+ if (aOres != null && aOres.length() > 0) {
+ mListData.put(aOres);
+ }
+ }
+ }
+
+ // Set Types
+ mMode = GrindleMode.PROSPECTING;
+ this.mTierDim = (aInfoString = "Tier: " + tTier + " | Dim: " + aDim);
+ this.mPosInfo = (aPositionString = "X:" + xPos + ", Y:" + yPos + ", Z:" + zPos);
+ this.mValid = true;
+ }
+
+ // Non-Prospectic Data
+ else {
+ mValid = true;
+ mListData = null;
+ mMode = GrindleMode.ELEMENT;
+ this.mTierDim = "PLACEHOLDER";
+ this.mPosInfo = "PLACEHOLDER";
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java b/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java
index cf94fbbb84..f9b0e8c161 100644
--- a/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java
+++ b/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java
@@ -1,13 +1,15 @@
package gtPlusPlus.core.gui.item;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.container.Container_Grindle;
+import gtPlusPlus.core.inventories.BaseInventoryGrindle;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.NBTUtils;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@@ -23,468 +25,487 @@ import net.minecraft.network.play.client.C17PacketCustomPayload;
import net.minecraft.util.ChatAllowedCharacters;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
-
-import gtPlusPlus.core.container.Container_Grindle;
-import gtPlusPlus.core.inventories.BaseInventoryGrindle;
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.Unpooled;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GuiScreenGrindle extends GuiContainer {
- private static final Logger logger = LogManager.getLogger();
- private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png");
- /** The player editing the book */
- private final EntityPlayer editingPlayer;
- private final ItemStack bookObj;
- /** Whether the book is signed or can still be edited */
- private final boolean bookIsUnsigned;
- private boolean field_146481_r;
- private boolean field_146480_s;
- /** Update ticks since the gui was opened */
- private int updateCount;
- private final int bookImageWidth = 192;
- private final int bookImageHeight = 192;
- private int bookTotalPages = 1;
- private int currPage;
- private NBTTagList bookPages;
- private String bookTitle = "";
- private GuiScreenGrindle.NextPageButton buttonNextPage;
- private GuiScreenGrindle.NextPageButton buttonPreviousPage;
- private GuiButton buttonDone;
- /** The GuiButton to sign this book. */
- private GuiButton buttonSign;
- private GuiButton buttonFinalize;
- private GuiButton buttonCancel;
-
- // Texture
- private static final ResourceLocation iconLocation = new ResourceLocation(CORE.MODID,
- "textures/gui/itemGrindle.png");
-
- /** The inventory to render on screen */
- private final BaseInventoryGrindle inventory;
-
- public GuiScreenGrindle(final Container_Grindle containerItem, final EntityPlayer player) {
- super(containerItem);
- this.inventory = containerItem.inventory;
- this.editingPlayer = player;
- this.bookObj = this.inventory.getStackInSlot(0);
- this.bookIsUnsigned = (this.bookObj == null ? true : false);
-
- if (this.bookObj != null) {
- if (this.bookObj.hasTagCompound()) {
- final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound();
- this.bookPages = nbttagcompound.getTagList("pages", 8);
-
- if (this.bookPages != null) {
- this.bookPages = (NBTTagList) this.bookPages.copy();
- this.bookTotalPages = this.bookPages.tagCount();
-
- if (this.bookTotalPages < 1) {
- this.bookTotalPages = 1;
- }
- }
- }
-
-
- if ((this.bookPages == null) && this.bookIsUnsigned) { this.bookPages =
- new NBTTagList(); this.bookPages.appendTag(new NBTTagString(""));
- this.bookTotalPages = 1; }
-
- }
- }
-
- /**
- * Called from the main game loop to update the screen.
- */
- @Override
- public void updateScreen() {
- super.updateScreen();
- ++this.updateCount;
- }
-
- /**
- * Adds the buttons (and other controls) to the screen in question.
- */
- @Override
- @SuppressWarnings("unchecked")
- public void initGui() {
- this.buttonList.clear();
- Keyboard.enableRepeatEvents(true);
-
- if (this.bookIsUnsigned) {
- this.buttonList.add(this.buttonSign = new GuiButton(3, (this.width / 2) - 100, 4 + this.bookImageHeight, 98,
- 20, I18n.format("book.signButton", new Object[0])));
- this.buttonList.add(this.buttonDone = new GuiButton(0, (this.width / 2) + 2, this.bookImageHeight-4, 98,
- 20, I18n.format("gui.close", new Object[0])));
- this.buttonList.add(this.buttonFinalize = new GuiButton(5, (this.width / 2) - 100, 4 + this.bookImageHeight,
- 98, 20, I18n.format("book.finalizeButton", new Object[0])));
- this.buttonList.add(this.buttonCancel = new GuiButton(4, (this.width / 2) + 2, 4 + this.bookImageHeight, 98,
- 20, I18n.format("gui.cancel", new Object[0])));
- }
- else {
- this.buttonList.add(this.buttonDone = new GuiButton(0, (this.width / 2) - 100, this.bookImageHeight+100,
- 200, 20, I18n.format("gui.done", new Object[0])));
- }
-
- final int i = (this.width - this.bookImageWidth) / 2;
- final byte b0 = 2;
- this.buttonList.add(this.buttonNextPage = new GuiScreenGrindle.NextPageButton(1, i + 120, b0 + 154, true));
- this.buttonList.add(this.buttonPreviousPage = new GuiScreenGrindle.NextPageButton(2, i + 38, b0 + 154, false));
- this.updateButtons();
- }
-
- /**
- * Called when the screen is unloaded. Used to disable keyboard repeat
- * events
- */
- @Override
- public void onGuiClosed() {
- Keyboard.enableRepeatEvents(false);
- }
-
- private void updateButtons() {
- this.buttonNextPage.visible = !this.field_146480_s
- && ((this.currPage < (this.bookTotalPages - 1)) || this.bookIsUnsigned);
- this.buttonPreviousPage.visible = !this.field_146480_s && (this.currPage > 0);
- this.buttonDone.visible = !this.bookIsUnsigned || !this.field_146480_s;
-
- if (this.bookIsUnsigned) {
- this.buttonSign.visible = !this.field_146480_s;
- this.buttonCancel.visible = this.field_146480_s;
- this.buttonFinalize.visible = this.field_146480_s;
- this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0;
- }
- }
-
- private void sendBookToServer(final boolean p_146462_1_) {
- if (this.bookIsUnsigned && this.field_146481_r) {
- if (this.bookPages != null) {
- String s;
-
- while (this.bookPages.tagCount() > 1) {
- s = this.bookPages.getStringTagAt(this.bookPages.tagCount() - 1);
-
- if (s.length() != 0) {
- break;
- }
-
- this.bookPages.removeTag(this.bookPages.tagCount() - 1);
- }
-
- if (this.bookObj.hasTagCompound()) {
- final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound();
- nbttagcompound.setTag("pages", this.bookPages);
- }
- else {
- this.bookObj.setTagInfo("pages", this.bookPages);
- }
-
- s = "MC|BEdit";
-
- if (p_146462_1_) {
- s = "MC|BSign";
- this.bookObj.setTagInfo("author", new NBTTagString(this.editingPlayer.getCommandSenderName()));
- this.bookObj.setTagInfo("title", new NBTTagString(this.bookTitle.trim()));
- this.bookObj.func_150996_a(ModItems.itemGrindleTablet);
- }
-
- final ByteBuf bytebuf = Unpooled.buffer();
-
- try {
- (new PacketBuffer(bytebuf)).writeItemStackToBuffer(this.bookObj);
- this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(s, bytebuf));
- }
- catch (final Exception exception) {
- logger.error("Couldn\'t send book info", exception);
- }
- finally {
- bytebuf.release();
- }
- }
- }
- }
-
- @Override
- protected void actionPerformed(final GuiButton button) {
- if (button.enabled) {
- if (button.id == 0) {
- this.mc.displayGuiScreen((GuiScreen) null);
- this.sendBookToServer(false);
- }
- else if ((button.id == 3) && this.bookIsUnsigned) {
- this.field_146480_s = true;
- }
- else if (button.id == 1) {
- if (this.currPage < (this.bookTotalPages - 1)) {
- ++this.currPage;
- }
- else if (this.bookIsUnsigned) {
- this.addNewPage();
-
- if (this.currPage < (this.bookTotalPages - 1)) {
- ++this.currPage;
- }
- }
- }
- else if (button.id == 2) {
- if (this.currPage > 0) {
- --this.currPage;
- }
- }
- else if ((button.id == 5) && this.field_146480_s) {
- this.sendBookToServer(true);
- this.mc.displayGuiScreen((GuiScreen) null);
- }
- else if ((button.id == 4) && this.field_146480_s) {
- this.field_146480_s = false;
- }
-
- this.updateButtons();
- }
- }
-
- private void addNewPage() {
- if ((this.bookPages != null) && (this.bookPages.tagCount() < 50)) {
- this.bookPages.appendTag(new NBTTagString(""));
- ++this.bookTotalPages;
- this.field_146481_r = true;
- }
- }
-
- /**
- * Fired when a key is typed. This is the equivalent of
- * KeyListener.keyTyped(KeyEvent e).
- */
- @Override
- protected void keyTyped(final char p_73869_1_, final int p_73869_2_) {
- super.keyTyped(p_73869_1_, p_73869_2_);
-
- if (this.bookIsUnsigned) {
- if (this.field_146480_s) {
- this.func_146460_c(p_73869_1_, p_73869_2_);
- }
- else {
- this.keyTypedInBook(p_73869_1_, p_73869_2_);
- }
- }
- }
-
- /**
- * Processes keystrokes when editing the text of a book
- */
- private void keyTypedInBook(final char p_146463_1_, final int p_146463_2_) {
- switch (p_146463_1_) {
- case 22:
- this.func_146459_b(GuiScreen.getClipboardString());
- return;
- default:
- switch (p_146463_2_) {
- case 14:
- final String s = this.func_146456_p();
-
- if (s.length() > 0) {
- this.func_146457_a(s.substring(0, s.length() - 1));
- }
-
- return;
- case 28:
- case 156:
- this.func_146459_b("\n");
- return;
- default:
- if (ChatAllowedCharacters.isAllowedCharacter(p_146463_1_)) {
- this.func_146459_b(Character.toString(p_146463_1_));
- }
- }
- }
- }
-
- private void func_146460_c(final char p_146460_1_, final int p_146460_2_) {
- switch (p_146460_2_) {
- case 14:
- if (!this.bookTitle.isEmpty()) {
- this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1);
- this.updateButtons();
- }
-
- return;
- case 28:
- case 156:
- if (!this.bookTitle.isEmpty()) {
- this.sendBookToServer(true);
- this.mc.displayGuiScreen((GuiScreen) null);
- }
-
- return;
- default:
- if ((this.bookTitle.length() < 16) && ChatAllowedCharacters.isAllowedCharacter(p_146460_1_)) {
- this.bookTitle = this.bookTitle + Character.toString(p_146460_1_);
- this.updateButtons();
- this.field_146481_r = true;
- }
- }
- }
-
- private String func_146456_p() {
- return (this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())
- ? this.bookPages.getStringTagAt(this.currPage) : "";
- }
-
- private void func_146457_a(final String p_146457_1_) {
- if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) {
- this.bookPages.func_150304_a(this.currPage, new NBTTagString(p_146457_1_));
- this.field_146481_r = true;
- }
- }
-
- private void func_146459_b(final String p_146459_1_) {
- final String s1 = this.func_146456_p();
- final String s2 = s1 + p_146459_1_;
- final int i = this.fontRendererObj.splitStringWidth(s2 + "" + EnumChatFormatting.BLACK + "_", 118);
-
- if ((i <= 118) && (s2.length() < 256)) {
- this.func_146457_a(s2);
- }
- }
-
- /**
- * Draws the screen and all the components in it.
- */
- @Override
- public void drawScreen(final int p_73863_1_, final int p_73863_2_, final float p_73863_3_) {
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l2 = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l2, 0, 0, this.xSize, this.ySize);
-
- //GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- //this.mc.getTextureManager().bindTexture(iconLocation);
- //final int k = (this.width - this.bookImageWidth) / 2;
- //this.drawTexturedModalRect(k, b0, 0, 0, this.bookImageWidth,
- // this.bookImageHeight);
-
- String s;
- String s1;
- int l;
- final byte b0 = 2;
-
- if (this.inventory.getStackInSlot(0) != null) {
- this.fontRendererObj.drawString(
- I18n.format("" + NBTUtils.getBookTitle(this.inventory.getStackInSlot(0)), new Object[0]), 10, 8,
- Utils.rgbtoHexValue(125, 255, 125));
- }
-
- if (this.field_146480_s) {
- s = this.bookTitle;
-
- if (this.bookIsUnsigned) {
- if (((this.updateCount / 6) % 2) == 0) {
- s = s + "" + EnumChatFormatting.BLACK + "_";
- }
- else {
- s = s + "" + EnumChatFormatting.GRAY + "_";
- }
- }
-
- s1 = I18n.format("book.editTitle", new Object[0]);
- l = this.fontRendererObj.getStringWidth(s1);
- this.fontRendererObj.drawString(s1, k + 36 + ((116 - l) / 2), b0 + 16 + 16, 0);
- final int i1 = this.fontRendererObj.getStringWidth(s);
- this.fontRendererObj.drawString(s, k + 36 + ((116 - i1) / 2), b0 + 48, 0);
- final String s2 = I18n.format("book.byAuthor", new Object[] { this.editingPlayer.getCommandSenderName() });
- final int j1 = this.fontRendererObj.getStringWidth(s2);
- this.fontRendererObj.drawString(EnumChatFormatting.DARK_GRAY + s2, k + 36 + ((116 - j1) / 2), b0 + 48 + 10,
- 0);
- final String s3 = I18n.format("book.finalizeWarning", new Object[0]);
- this.fontRendererObj.drawSplitString(s3, k + 36, b0 + 80, 116, 0);
- }
- else {
- s = I18n.format("book.pageIndicator",
- new Object[] { Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages) });
- s1 = "";
-
- if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) {
- s1 = this.bookPages.getStringTagAt(this.currPage);
- }
-
- if (this.bookIsUnsigned) {
- if (this.fontRendererObj.getBidiFlag()) {
- s1 = s1 + "_";
- }
- else if (((this.updateCount / 6) % 2) == 0) {
- s1 = s1 + "" + EnumChatFormatting.BLACK + "_";
- }
- else {
- s1 = s1 + "" + EnumChatFormatting.GRAY + "_";
- }
- }
-
- l = this.fontRendererObj.getStringWidth(s);
- this.fontRendererObj.drawString(s, ((k - l) + this.bookImageWidth) - 44, b0 + 16, 0);
- //this.fontRendererObj.drawString(s, k+36, b0 + 16, 0);
- this.fontRendererObj.drawSplitString(s1, k + 36, b0 + 16 + 16, 116, 0);
- //this.fontRendererObj.drawSplitString(s1, k, b0 + 16 + 16, 116, 0);
- }
-
- super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
- }
-
- @SideOnly(Side.CLIENT)
- static class NextPageButton extends GuiButton {
- private final boolean field_146151_o;
-
- public NextPageButton(final int p_i1079_1_, final int p_i1079_2_, final int p_i1079_3_,
- final boolean p_i1079_4_) {
- super(p_i1079_1_, p_i1079_2_, p_i1079_3_, 23, 13, "");
- this.field_146151_o = p_i1079_4_;
- }
-
- /**
- * Draws this button to the screen.
- */
- @Override
- public void drawButton(final Minecraft p_146112_1_, final int p_146112_2_, final int p_146112_3_) {
- if (this.visible) {
- final boolean flag = (p_146112_2_ >= this.xPosition) && (p_146112_3_ >= this.yPosition)
- && (p_146112_2_ < (this.xPosition + this.width))
- && (p_146112_3_ < (this.yPosition + this.height));
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- p_146112_1_.getTextureManager().bindTexture(GuiScreenGrindle.bookGuiTextures);
- int k = 0;
- int l = 192;
-
- if (flag) {
- k += 23;
- }
-
- if (!this.field_146151_o) {
- l += 13;
- }
-
- this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 23, 13);
- }
- }
- }
-
- /**
- * Draw the background layer for the GuiContainer (everything behind the
- * items)
- */
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
- final int i1;
- // drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (l + 75)
- // - 50 - this.ySize_lo, this.mc.thePlayer);
- }
-} \ No newline at end of file
+ private static final Logger logger = LogManager.getLogger();
+ private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png");
+ /** The player editing the book */
+ private final EntityPlayer editingPlayer;
+
+ private final ItemStack bookObj;
+ /** Whether the book is signed or can still be edited */
+ private final boolean bookIsUnsigned;
+
+ private boolean field_146481_r;
+ private boolean field_146480_s;
+ /** Update ticks since the gui was opened */
+ private int updateCount;
+
+ private final int bookImageWidth = 192;
+ private final int bookImageHeight = 192;
+ private int bookTotalPages = 1;
+ private int currPage;
+ private NBTTagList bookPages;
+ private String bookTitle = "";
+ private GuiScreenGrindle.NextPageButton buttonNextPage;
+ private GuiScreenGrindle.NextPageButton buttonPreviousPage;
+ private GuiButton buttonDone;
+ /** The GuiButton to sign this book. */
+ private GuiButton buttonSign;
+
+ private GuiButton buttonFinalize;
+ private GuiButton buttonCancel;
+
+ // Texture
+ private static final ResourceLocation iconLocation =
+ new ResourceLocation(CORE.MODID, "textures/gui/itemGrindle.png");
+
+ /** The inventory to render on screen */
+ private final BaseInventoryGrindle inventory;
+
+ public GuiScreenGrindle(final Container_Grindle containerItem, final EntityPlayer player) {
+ super(containerItem);
+ this.inventory = containerItem.inventory;
+ this.editingPlayer = player;
+ this.bookObj = this.inventory.getStackInSlot(0);
+ this.bookIsUnsigned = (this.bookObj == null ? true : false);
+
+ if (this.bookObj != null) {
+ if (this.bookObj.hasTagCompound()) {
+ final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound();
+ this.bookPages = nbttagcompound.getTagList("pages", 8);
+
+ if (this.bookPages != null) {
+ this.bookPages = (NBTTagList) this.bookPages.copy();
+ this.bookTotalPages = this.bookPages.tagCount();
+
+ if (this.bookTotalPages < 1) {
+ this.bookTotalPages = 1;
+ }
+ }
+ }
+
+ if ((this.bookPages == null) && this.bookIsUnsigned) {
+ this.bookPages = new NBTTagList();
+ this.bookPages.appendTag(new NBTTagString(""));
+ this.bookTotalPages = 1;
+ }
+ }
+ }
+
+ /**
+ * Called from the main game loop to update the screen.
+ */
+ @Override
+ public void updateScreen() {
+ super.updateScreen();
+ ++this.updateCount;
+ }
+
+ /**
+ * Adds the buttons (and other controls) to the screen in question.
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public void initGui() {
+ this.buttonList.clear();
+ Keyboard.enableRepeatEvents(true);
+
+ if (this.bookIsUnsigned) {
+ this.buttonList.add(
+ this.buttonSign = new GuiButton(
+ 3,
+ (this.width / 2) - 100,
+ 4 + this.bookImageHeight,
+ 98,
+ 20,
+ I18n.format("book.signButton", new Object[0])));
+ this.buttonList.add(
+ this.buttonDone = new GuiButton(
+ 0,
+ (this.width / 2) + 2,
+ this.bookImageHeight - 4,
+ 98,
+ 20,
+ I18n.format("gui.close", new Object[0])));
+ this.buttonList.add(
+ this.buttonFinalize = new GuiButton(
+ 5,
+ (this.width / 2) - 100,
+ 4 + this.bookImageHeight,
+ 98,
+ 20,
+ I18n.format("book.finalizeButton", new Object[0])));
+ this.buttonList.add(
+ this.buttonCancel = new GuiButton(
+ 4,
+ (this.width / 2) + 2,
+ 4 + this.bookImageHeight,
+ 98,
+ 20,
+ I18n.format("gui.cancel", new Object[0])));
+ } else {
+ this.buttonList.add(
+ this.buttonDone = new GuiButton(
+ 0,
+ (this.width / 2) - 100,
+ this.bookImageHeight + 100,
+ 200,
+ 20,
+ I18n.format("gui.done", new Object[0])));
+ }
+
+ final int i = (this.width - this.bookImageWidth) / 2;
+ final byte b0 = 2;
+ this.buttonList.add(this.buttonNextPage = new GuiScreenGrindle.NextPageButton(1, i + 120, b0 + 154, true));
+ this.buttonList.add(this.buttonPreviousPage = new GuiScreenGrindle.NextPageButton(2, i + 38, b0 + 154, false));
+ this.updateButtons();
+ }
+
+ /**
+ * Called when the screen is unloaded. Used to disable keyboard repeat
+ * events
+ */
+ @Override
+ public void onGuiClosed() {
+ Keyboard.enableRepeatEvents(false);
+ }
+
+ private void updateButtons() {
+ this.buttonNextPage.visible =
+ !this.field_146480_s && ((this.currPage < (this.bookTotalPages - 1)) || this.bookIsUnsigned);
+ this.buttonPreviousPage.visible = !this.field_146480_s && (this.currPage > 0);
+ this.buttonDone.visible = !this.bookIsUnsigned || !this.field_146480_s;
+
+ if (this.bookIsUnsigned) {
+ this.buttonSign.visible = !this.field_146480_s;
+ this.buttonCancel.visible = this.field_146480_s;
+ this.buttonFinalize.visible = this.field_146480_s;
+ this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0;
+ }
+ }
+
+ private void sendBookToServer(final boolean p_146462_1_) {
+ if (this.bookIsUnsigned && this.field_146481_r) {
+ if (this.bookPages != null) {
+ String s;
+
+ while (this.bookPages.tagCount() > 1) {
+ s = this.bookPages.getStringTagAt(this.bookPages.tagCount() - 1);
+
+ if (s.length() != 0) {
+ break;
+ }
+
+ this.bookPages.removeTag(this.bookPages.tagCount() - 1);
+ }
+
+ if (this.bookObj.hasTagCompound()) {
+ final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound();
+ nbttagcompound.setTag("pages", this.bookPages);
+ } else {
+ this.bookObj.setTagInfo("pages", this.bookPages);
+ }
+
+ s = "MC|BEdit";
+
+ if (p_146462_1_) {
+ s = "MC|BSign";
+ this.bookObj.setTagInfo("author", new NBTTagString(this.editingPlayer.getCommandSenderName()));
+ this.bookObj.setTagInfo("title", new NBTTagString(this.bookTitle.trim()));
+ this.bookObj.func_150996_a(ModItems.itemGrindleTablet);
+ }
+
+ final ByteBuf bytebuf = Unpooled.buffer();
+
+ try {
+ (new PacketBuffer(bytebuf)).writeItemStackToBuffer(this.bookObj);
+ this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(s, bytebuf));
+ } catch (final Exception exception) {
+ logger.error("Couldn\'t send book info", exception);
+ } finally {
+ bytebuf.release();
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void actionPerformed(final GuiButton button) {
+ if (button.enabled) {
+ if (button.id == 0) {
+ this.mc.displayGuiScreen((GuiScreen) null);
+ this.sendBookToServer(false);
+ } else if ((button.id == 3) && this.bookIsUnsigned) {
+ this.field_146480_s = true;
+ } else if (button.id == 1) {
+ if (this.currPage < (this.bookTotalPages - 1)) {
+ ++this.currPage;
+ } else if (this.bookIsUnsigned) {
+ this.addNewPage();
+
+ if (this.currPage < (this.bookTotalPages - 1)) {
+ ++this.currPage;
+ }
+ }
+ } else if (button.id == 2) {
+ if (this.currPage > 0) {
+ --this.currPage;
+ }
+ } else if ((button.id == 5) && this.field_146480_s) {
+ this.sendBookToServer(true);
+ this.mc.displayGuiScreen((GuiScreen) null);
+ } else if ((button.id == 4) && this.field_146480_s) {
+ this.field_146480_s = false;
+ }
+
+ this.updateButtons();
+ }
+ }
+
+ private void addNewPage() {
+ if ((this.bookPages != null) && (this.bookPages.tagCount() < 50)) {
+ this.bookPages.appendTag(new NBTTagString(""));
+ ++this.bookTotalPages;
+ this.field_146481_r = true;
+ }
+ }
+
+ /**
+ * Fired when a key is typed. This is the equivalent of
+ * KeyListener.keyTyped(KeyEvent e).
+ */
+ @Override
+ protected void keyTyped(final char p_73869_1_, final int p_73869_2_) {
+ super.keyTyped(p_73869_1_, p_73869_2_);
+
+ if (this.bookIsUnsigned) {
+ if (this.field_146480_s) {
+ this.func_146460_c(p_73869_1_, p_73869_2_);
+ } else {
+ this.keyTypedInBook(p_73869_1_, p_73869_2_);
+ }
+ }
+ }
+
+ /**
+ * Processes keystrokes when editing the text of a book
+ */
+ private void keyTypedInBook(final char p_146463_1_, final int p_146463_2_) {
+ switch (p_146463_1_) {
+ case 22:
+ this.func_146459_b(GuiScreen.getClipboardString());
+ return;
+ default:
+ switch (p_146463_2_) {
+ case 14:
+ final String s = this.func_146456_p();
+
+ if (s.length() > 0) {
+ this.func_146457_a(s.substring(0, s.length() - 1));
+ }
+
+ return;
+ case 28:
+ case 156:
+ this.func_146459_b("\n");
+ return;
+ default:
+ if (ChatAllowedCharacters.isAllowedCharacter(p_146463_1_)) {
+ this.func_146459_b(Character.toString(p_146463_1_));
+ }
+ }
+ }
+ }
+
+ private void func_146460_c(final char p_146460_1_, final int p_146460_2_) {
+ switch (p_146460_2_) {
+ case 14:
+ if (!this.bookTitle.isEmpty()) {
+ this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1);
+ this.updateButtons();
+ }
+
+ return;
+ case 28:
+ case 156:
+ if (!this.bookTitle.isEmpty()) {
+ this.sendBookToServer(true);
+ this.mc.displayGuiScreen((GuiScreen) null);
+ }
+
+ return;
+ default:
+ if ((this.bookTitle.length() < 16) && ChatAllowedCharacters.isAllowedCharacter(p_146460_1_)) {
+ this.bookTitle = this.bookTitle + Character.toString(p_146460_1_);
+ this.updateButtons();
+ this.field_146481_r = true;
+ }
+ }
+ }
+
+ private String func_146456_p() {
+ return (this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())
+ ? this.bookPages.getStringTagAt(this.currPage)
+ : "";
+ }
+
+ private void func_146457_a(final String p_146457_1_) {
+ if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) {
+ this.bookPages.func_150304_a(this.currPage, new NBTTagString(p_146457_1_));
+ this.field_146481_r = true;
+ }
+ }
+
+ private void func_146459_b(final String p_146459_1_) {
+ final String s1 = this.func_146456_p();
+ final String s2 = s1 + p_146459_1_;
+ final int i = this.fontRendererObj.splitStringWidth(s2 + "" + EnumChatFormatting.BLACK + "_", 118);
+
+ if ((i <= 118) && (s2.length() < 256)) {
+ this.func_146457_a(s2);
+ }
+ }
+
+ /**
+ * Draws the screen and all the components in it.
+ */
+ @Override
+ public void drawScreen(final int p_73863_1_, final int p_73863_2_, final float p_73863_3_) {
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(iconLocation);
+ final int k = (this.width - this.xSize) / 2;
+ final int l2 = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l2, 0, 0, this.xSize, this.ySize);
+
+ // GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ // this.mc.getTextureManager().bindTexture(iconLocation);
+ // final int k = (this.width - this.bookImageWidth) / 2;
+ // this.drawTexturedModalRect(k, b0, 0, 0, this.bookImageWidth,
+ // this.bookImageHeight);
+
+ String s;
+ String s1;
+ int l;
+ final byte b0 = 2;
+
+ if (this.inventory.getStackInSlot(0) != null) {
+ this.fontRendererObj.drawString(
+ I18n.format("" + NBTUtils.getBookTitle(this.inventory.getStackInSlot(0)), new Object[0]),
+ 10,
+ 8,
+ Utils.rgbtoHexValue(125, 255, 125));
+ }
+
+ if (this.field_146480_s) {
+ s = this.bookTitle;
+
+ if (this.bookIsUnsigned) {
+ if (((this.updateCount / 6) % 2) == 0) {
+ s = s + "" + EnumChatFormatting.BLACK + "_";
+ } else {
+ s = s + "" + EnumChatFormatting.GRAY + "_";
+ }
+ }
+
+ s1 = I18n.format("book.editTitle", new Object[0]);
+ l = this.fontRendererObj.getStringWidth(s1);
+ this.fontRendererObj.drawString(s1, k + 36 + ((116 - l) / 2), b0 + 16 + 16, 0);
+ final int i1 = this.fontRendererObj.getStringWidth(s);
+ this.fontRendererObj.drawString(s, k + 36 + ((116 - i1) / 2), b0 + 48, 0);
+ final String s2 = I18n.format("book.byAuthor", new Object[] {this.editingPlayer.getCommandSenderName()});
+ final int j1 = this.fontRendererObj.getStringWidth(s2);
+ this.fontRendererObj.drawString(
+ EnumChatFormatting.DARK_GRAY + s2, k + 36 + ((116 - j1) / 2), b0 + 48 + 10, 0);
+ final String s3 = I18n.format("book.finalizeWarning", new Object[0]);
+ this.fontRendererObj.drawSplitString(s3, k + 36, b0 + 80, 116, 0);
+ } else {
+ s = I18n.format(
+ "book.pageIndicator",
+ new Object[] {Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)});
+ s1 = "";
+
+ if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) {
+ s1 = this.bookPages.getStringTagAt(this.currPage);
+ }
+
+ if (this.bookIsUnsigned) {
+ if (this.fontRendererObj.getBidiFlag()) {
+ s1 = s1 + "_";
+ } else if (((this.updateCount / 6) % 2) == 0) {
+ s1 = s1 + "" + EnumChatFormatting.BLACK + "_";
+ } else {
+ s1 = s1 + "" + EnumChatFormatting.GRAY + "_";
+ }
+ }
+
+ l = this.fontRendererObj.getStringWidth(s);
+ this.fontRendererObj.drawString(s, ((k - l) + this.bookImageWidth) - 44, b0 + 16, 0);
+ // this.fontRendererObj.drawString(s, k+36, b0 + 16, 0);
+ this.fontRendererObj.drawSplitString(s1, k + 36, b0 + 16 + 16, 116, 0);
+ // this.fontRendererObj.drawSplitString(s1, k, b0 + 16 + 16, 116, 0);
+ }
+
+ super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
+ }
+
+ @SideOnly(Side.CLIENT)
+ static class NextPageButton extends GuiButton {
+ private final boolean field_146151_o;
+
+ public NextPageButton(
+ final int p_i1079_1_, final int p_i1079_2_, final int p_i1079_3_, final boolean p_i1079_4_) {
+ super(p_i1079_1_, p_i1079_2_, p_i1079_3_, 23, 13, "");
+ this.field_146151_o = p_i1079_4_;
+ }
+
+ /**
+ * Draws this button to the screen.
+ */
+ @Override
+ public void drawButton(final Minecraft p_146112_1_, final int p_146112_2_, final int p_146112_3_) {
+ if (this.visible) {
+ final boolean flag = (p_146112_2_ >= this.xPosition)
+ && (p_146112_3_ >= this.yPosition)
+ && (p_146112_2_ < (this.xPosition + this.width))
+ && (p_146112_3_ < (this.yPosition + this.height));
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ p_146112_1_.getTextureManager().bindTexture(GuiScreenGrindle.bookGuiTextures);
+ int k = 0;
+ int l = 192;
+
+ if (flag) {
+ k += 23;
+ }
+
+ if (!this.field_146151_o) {
+ l += 13;
+ }
+
+ this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 23, 13);
+ }
+ }
+ }
+
+ /**
+ * Draw the background layer for the GuiContainer (everything behind the
+ * items)
+ */
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(iconLocation);
+ final int k = (this.width - this.xSize) / 2;
+ final int l = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
+ final int i1;
+ // drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (l + 75)
+ // - 50 - this.ySize_lo, this.mc.thePlayer);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/box/GuiBaseBox.java b/src/main/java/gtPlusPlus/core/gui/item/box/GuiBaseBox.java
index 97ec58bfa4..575419857d 100644
--- a/src/main/java/gtPlusPlus/core/gui/item/box/GuiBaseBox.java
+++ b/src/main/java/gtPlusPlus/core/gui/item/box/GuiBaseBox.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.gui.item.box;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
import net.minecraft.client.gui.inventory.GuiContainer;
@@ -12,105 +9,114 @@ import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
public class GuiBaseBox extends GuiContainer {
- /**
- * x and y size of the inventory window in pixels. Defined as float, passed as
- * int These are used for drawing the player model.
- */
- private float xSize_lo;
- private float ySize_lo;
+ /**
+ * x and y size of the inventory window in pixels. Defined as float, passed as
+ * int These are used for drawing the player model.
+ */
+ private float xSize_lo;
+
+ private float ySize_lo;
- /**
- * ResourceLocation takes 2 parameters: ModId, path to texture at the location:
- * "src/minecraft/assets/modid/"
- *
- * I have provided a sample texture file that works with this tutorial. Download
- * it from Forge_Tutorials/textures/gui/
- */
- private final ResourceLocation iconLocation;
+ /**
+ * ResourceLocation takes 2 parameters: ModId, path to texture at the location:
+ * "src/minecraft/assets/modid/"
+ *
+ * I have provided a sample texture file that works with this tutorial. Download
+ * it from Forge_Tutorials/textures/gui/
+ */
+ private final ResourceLocation iconLocation;
- /** The inventory to render on screen */
- private final CustomBoxInventory inventory;
+ /** The inventory to render on screen */
+ private final CustomBoxInventory inventory;
- public GuiBaseBox(ContainerBoxBase containerItem, ResourceLocation aGuiTexture) {
- super(containerItem);
- this.inventory = containerItem.getInventoryObject();
- this.iconLocation = aGuiTexture;
- }
+ public GuiBaseBox(ContainerBoxBase containerItem, ResourceLocation aGuiTexture) {
+ super(containerItem);
+ this.inventory = containerItem.getInventoryObject();
+ this.iconLocation = aGuiTexture;
+ }
- /**
- * Draws the screen and all the components in it.
- */
- public void drawScreen(int par1, int par2, float par3) {
- super.drawScreen(par1, par2, par3);
- this.xSize_lo = (float) par1;
- this.ySize_lo = (float) par2;
- }
+ /**
+ * Draws the screen and all the components in it.
+ */
+ public void drawScreen(int par1, int par2, float par3) {
+ super.drawScreen(par1, par2, par3);
+ this.xSize_lo = (float) par1;
+ this.ySize_lo = (float) par2;
+ }
- /**
- * Draw the foreground layer for the GuiContainer (everything in front of the
- * items)
- */
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- String s = this.inventory.hasCustomInventoryName() ? this.inventory.getInventoryName()
- : I18n.format(this.inventory.getInventoryName());
- this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 0, 4210752);
- this.fontRendererObj.drawString(I18n.format("container.inventory"), 26, this.ySize - 96 + 4, 4210752);
- }
+ /**
+ * Draw the foreground layer for the GuiContainer (everything in front of the
+ * items)
+ */
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ String s = this.inventory.hasCustomInventoryName()
+ ? this.inventory.getInventoryName()
+ : I18n.format(this.inventory.getInventoryName());
+ this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 0, 4210752);
+ this.fontRendererObj.drawString(I18n.format("container.inventory"), 26, this.ySize - 96 + 4, 4210752);
+ }
- /**
- * Draw the background layer for the GuiContainer (everything behind the items)
- */
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- int k = (this.width - this.xSize) / 2;
- int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
- int i1;
- drawPlayerModel(k + 51, l + 75, 30, (float) (k + 51) - this.xSize_lo, (float) (l + 75 - 50) - this.ySize_lo,
- this.mc.thePlayer);
- }
+ /**
+ * Draw the background layer for the GuiContainer (everything behind the items)
+ */
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(iconLocation);
+ int k = (this.width - this.xSize) / 2;
+ int l = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
+ int i1;
+ drawPlayerModel(
+ k + 51,
+ l + 75,
+ 30,
+ (float) (k + 51) - this.xSize_lo,
+ (float) (l + 75 - 50) - this.ySize_lo,
+ this.mc.thePlayer);
+ }
- /**
- * This renders the player model in standard inventory position (in later
- * versions of Minecraft / Forge, you can simply call
- * GuiInventory.drawEntityOnScreen directly instead of copying this code)
- */
- public static void drawPlayerModel(int x, int y, int scale, float yaw, float pitch, EntityLivingBase entity) {
- GL11.glEnable(GL11.GL_COLOR_MATERIAL);
- GL11.glPushMatrix();
- GL11.glTranslatef(x, y, 50.0F);
- GL11.glScalef(-scale, scale, scale);
- GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- float f2 = entity.renderYawOffset;
- float f3 = entity.rotationYaw;
- float f4 = entity.rotationPitch;
- float f5 = entity.prevRotationYawHead;
- float f6 = entity.rotationYawHead;
- GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
- RenderHelper.enableStandardItemLighting();
- GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
- entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F;
- entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F;
- entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F;
- entity.rotationYawHead = entity.rotationYaw;
- entity.prevRotationYawHead = entity.rotationYaw;
- GL11.glTranslatef(0.0F, entity.yOffset, 0.0F);
- RenderManager.instance.playerViewY = 180.0F;
- RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
- entity.renderYawOffset = f2;
- entity.rotationYaw = f3;
- entity.rotationPitch = f4;
- entity.prevRotationYawHead = f5;
- entity.rotationYawHead = f6;
- GL11.glPopMatrix();
- RenderHelper.disableStandardItemLighting();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
- }
-} \ No newline at end of file
+ /**
+ * This renders the player model in standard inventory position (in later
+ * versions of Minecraft / Forge, you can simply call
+ * GuiInventory.drawEntityOnScreen directly instead of copying this code)
+ */
+ public static void drawPlayerModel(int x, int y, int scale, float yaw, float pitch, EntityLivingBase entity) {
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(x, y, 50.0F);
+ GL11.glScalef(-scale, scale, scale);
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ float f2 = entity.renderYawOffset;
+ float f3 = entity.rotationYaw;
+ float f4 = entity.rotationPitch;
+ float f5 = entity.prevRotationYawHead;
+ float f6 = entity.rotationYawHead;
+ GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
+ entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F;
+ entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F;
+ entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F;
+ entity.rotationYawHead = entity.rotationYaw;
+ entity.prevRotationYawHead = entity.rotationYaw;
+ GL11.glTranslatef(0.0F, entity.yOffset, 0.0F);
+ RenderManager.instance.playerViewY = 180.0F;
+ RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
+ entity.renderYawOffset = f2;
+ entity.rotationYaw = f3;
+ entity.rotationPitch = f4;
+ entity.prevRotationYawHead = f5;
+ entity.rotationYawHead = f6;
+ GL11.glPopMatrix();
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/box/LunchBoxGui.java b/src/main/java/gtPlusPlus/core/gui/item/box/LunchBoxGui.java
index 28e3913ac8..0b8d76a6b4 100644
--- a/src/main/java/gtPlusPlus/core/gui/item/box/LunchBoxGui.java
+++ b/src/main/java/gtPlusPlus/core/gui/item/box/LunchBoxGui.java
@@ -5,7 +5,7 @@ import gtPlusPlus.core.lib.CORE;
import net.minecraft.util.ResourceLocation;
public class LunchBoxGui extends GuiBaseBox {
- public LunchBoxGui(ContainerBoxBase containerItem) {
- super(containerItem, new ResourceLocation(CORE.MODID, "textures/gui/schematic_rocket_GS1.png"));
- }
+ public LunchBoxGui(ContainerBoxBase containerItem) {
+ super(containerItem, new ResourceLocation(CORE.MODID, "textures/gui/schematic_rocket_GS1.png"));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/box/MagicBagGui.java b/src/main/java/gtPlusPlus/core/gui/item/box/MagicBagGui.java
index 958cdd3c70..c2665d2bf0 100644
--- a/src/main/java/gtPlusPlus/core/gui/item/box/MagicBagGui.java
+++ b/src/main/java/gtPlusPlus/core/gui/item/box/MagicBagGui.java
@@ -5,7 +5,7 @@ import gtPlusPlus.core.lib.CORE;
import net.minecraft.util.ResourceLocation;
public class MagicBagGui extends GuiBaseBox {
- public MagicBagGui(ContainerBoxBase containerItem) {
- super(containerItem, new ResourceLocation(CORE.MODID, "textures/gui/schematic_rocket_GS1.png"));
- }
+ public MagicBagGui(ContainerBoxBase containerItem) {
+ super(containerItem, new ResourceLocation(CORE.MODID, "textures/gui/schematic_rocket_GS1.png"));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/box/ToolBoxGui.java b/src/main/java/gtPlusPlus/core/gui/item/box/ToolBoxGui.java
index c440c017e9..01e3a38b4d 100644
--- a/src/main/java/gtPlusPlus/core/gui/item/box/ToolBoxGui.java
+++ b/src/main/java/gtPlusPlus/core/gui/item/box/ToolBoxGui.java
@@ -5,7 +5,7 @@ import gtPlusPlus.core.lib.CORE;
import net.minecraft.util.ResourceLocation;
public class ToolBoxGui extends GuiBaseBox {
- public ToolBoxGui(ContainerBoxBase containerItem) {
- super(containerItem, new ResourceLocation(CORE.MODID, "textures/gui/schematic_rocket_GS1.png"));
- }
+ public ToolBoxGui(ContainerBoxBase containerItem) {
+ super(containerItem, new ResourceLocation(CORE.MODID, "textures/gui/schematic_rocket_GS1.png"));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_CircuitProgrammer.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_CircuitProgrammer.java
index 2ab5b58aa7..94e7aab248 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_CircuitProgrammer.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_CircuitProgrammer.java
@@ -1,44 +1,42 @@
package gtPlusPlus.core.gui.machine;
-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.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
import gtPlusPlus.core.container.Container_CircuitProgrammer;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_CircuitProgrammer extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/CircuitProgrammer.png");
-
- public GUI_CircuitProgrammer(final InventoryPlayer player_inventory, final TileEntityCircuitProgrammer te){
- super(new Container_CircuitProgrammer(player_inventory, te));
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j){
- super.drawGuiContainerForegroundLayer(i, j);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
- //This method is called when the Gui is first called!
- @Override
- public void initGui(){
- super.initGui();
- }
-
-} \ No newline at end of file
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/CircuitProgrammer.png");
+
+ public GUI_CircuitProgrammer(final InventoryPlayer player_inventory, final TileEntityCircuitProgrammer te) {
+ super(new Container_CircuitProgrammer(player_inventory, te));
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ super.drawGuiContainerForegroundLayer(i, j);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+
+ // This method is called when the Gui is first called!
+ @Override
+ public void initGui() {
+ super.initGui();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_DecayablesChest.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_DecayablesChest.java
index 094629ae48..76c718511a 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_DecayablesChest.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_DecayablesChest.java
@@ -1,59 +1,53 @@
package gtPlusPlus.core.gui.machine;
-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.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
import gtPlusPlus.core.container.Container_DecayablesChest;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_DecayablesChest extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/FishTrap.png");
-
- public GUI_DecayablesChest(final InventoryPlayer player_inventory, final TileEntityDecayablesChest te){
- super(new Container_DecayablesChest(player_inventory, te));
- }
-
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j){
- //this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
- //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
-
- }
-
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
-
- //This method is called when the Gui is first called!
- @Override
- public void initGui()
- {
- //You have to add this line for the Gui to function properly!
- super.initGui();
-
- //The parameters of GuiButton are(id, x, y, width, height, text);
- //this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
- //this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
- //NOTE: the id always has to be different or else it might get called twice or never!
-
- //Add any other buttons here too!
- }
-
-} \ No newline at end of file
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/FishTrap.png");
+
+ public GUI_DecayablesChest(final InventoryPlayer player_inventory, final TileEntityDecayablesChest te) {
+ super(new Container_DecayablesChest(player_inventory, te));
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ // this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
+ // this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
+ // 4210752);
+
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+
+ // This method is called when the Gui is first called!
+ @Override
+ public void initGui() {
+ // You have to add this line for the Gui to function properly!
+ super.initGui();
+
+ // The parameters of GuiButton are(id, x, y, width, height, text);
+ // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
+ // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
+ // NOTE: the id always has to be different or else it might get called twice or never!
+
+ // Add any other buttons here too!
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java
index 49d9890d3a..a931fc93c5 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java
@@ -1,60 +1,53 @@
package gtPlusPlus.core.gui.machine;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.container.Container_EggBox;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.general.TileEntityEggBox;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
-
-import gtPlusPlus.core.container.Container_EggBox;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.general.TileEntityEggBox;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_EggBox extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/FishTrap.png");
-
- public GUI_EggBox(final InventoryPlayer player_inventory, final TileEntityEggBox te){
- super(new Container_EggBox(player_inventory, te));
- }
-
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j){
- //this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
- this.fontRendererObj.drawString(I18n.format("container.EggBox", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
-
- }
-
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
-
- //This method is called when the Gui is first called!
- @Override
- public void initGui()
- {
- //You have to add this line for the Gui to function properly!
- super.initGui();
-
- //The parameters of GuiButton are(id, x, y, width, height, text);
- //this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
- //this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
- //NOTE: the id always has to be different or else it might get called twice or never!
-
- //Add any other buttons here too!
- }
-
-} \ No newline at end of file
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/FishTrap.png");
+
+ public GUI_EggBox(final InventoryPlayer player_inventory, final TileEntityEggBox te) {
+ super(new Container_EggBox(player_inventory, te));
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ // this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
+ this.fontRendererObj.drawString(
+ I18n.format("container.EggBox", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+
+ // This method is called when the Gui is first called!
+ @Override
+ public void initGui() {
+ // You have to add this line for the Gui to function properly!
+ super.initGui();
+
+ // The parameters of GuiButton are(id, x, y, width, height, text);
+ // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
+ // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
+ // NOTE: the id always has to be different or else it might get called twice or never!
+
+ // Add any other buttons here too!
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_FishTrap.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_FishTrap.java
index 3d3bad7ece..e751f6eeee 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_FishTrap.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_FishTrap.java
@@ -1,59 +1,53 @@
package gtPlusPlus.core.gui.machine;
-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.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
import gtPlusPlus.core.container.Container_FishTrap;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_FishTrap extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/FishTrap.png");
-
- public GUI_FishTrap(final InventoryPlayer player_inventory, final TileEntityFishTrap te){
- super(new Container_FishTrap(player_inventory, te));
- }
-
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j){
- //this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
- //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
-
- }
-
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
-
- //This method is called when the Gui is first called!
- @Override
- public void initGui()
- {
- //You have to add this line for the Gui to function properly!
- super.initGui();
-
- //The parameters of GuiButton are(id, x, y, width, height, text);
- //this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
- //this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
- //NOTE: the id always has to be different or else it might get called twice or never!
-
- //Add any other buttons here too!
- }
-
-} \ No newline at end of file
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/FishTrap.png");
+
+ public GUI_FishTrap(final InventoryPlayer player_inventory, final TileEntityFishTrap te) {
+ super(new Container_FishTrap(player_inventory, te));
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ // this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
+ // this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
+ // 4210752);
+
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+
+ // This method is called when the Gui is first called!
+ @Override
+ public void initGui() {
+ // You have to add this line for the Gui to function properly!
+ super.initGui();
+
+ // The parameters of GuiButton are(id, x, y, width, height, text);
+ // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
+ // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
+ // NOTE: the id always has to be different or else it might get called twice or never!
+
+ // Add any other buttons here too!
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java
index 44d5c2ff9c..6aafc46a08 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java
@@ -1,39 +1,36 @@
package gtPlusPlus.core.gui.machine;
-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.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
import gtPlusPlus.core.container.Container_HeliumGenerator;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_HeliumGenerator extends GuiContainer {
- private static final ResourceLocation guiTexture = new ResourceLocation(CORE.MODID, "textures/gui/helium_collector_gui.png");
-
- public GUI_HeliumGenerator(final InventoryPlayer player_inventory, final TileEntityHeliumGenerator te){
- super(new Container_HeliumGenerator(player_inventory, te));
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j){
- //this.fontRendererObj.drawString(I18n.format("", new Object[0]), 28, 6, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(guiTexture);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
-} \ No newline at end of file
+ private static final ResourceLocation guiTexture =
+ new ResourceLocation(CORE.MODID, "textures/gui/helium_collector_gui.png");
+
+ public GUI_HeliumGenerator(final InventoryPlayer player_inventory, final TileEntityHeliumGenerator te) {
+ super(new Container_HeliumGenerator(player_inventory, te));
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ // this.fontRendererObj.drawString(I18n.format("", new Object[0]), 28, 6, 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(guiTexture);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java
index bbd4dd0ad8..14e37a7f87 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java
@@ -1,83 +1,75 @@
package gtPlusPlus.core.gui.machine;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.container.Container_ModularityTable;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
-
-import gtPlusPlus.core.container.Container_ModularityTable;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_ModularityTable extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/ModularityTable.png");
- private Container_ModularityTable mThisContainer;
- private TileEntityModularityTable mThisTile;
- private int mRecipeTime = -1;
-
- public GUI_ModularityTable(final InventoryPlayer player_inventory, final TileEntityModularityTable tile){
- super(new Container_ModularityTable(player_inventory, tile));
- this.mThisContainer = tile.getContainer();
- this.mThisTile = tile;
- if (this.mThisTile.getRecipeTime() > -1){
- this.mRecipeTime = this.mThisTile.getRecipeTime();
- }
- }
-
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j){
- if (this.mThisTile.getRecipeTime() > -1){
- this.mRecipeTime = this.mThisTile.getRecipeTime();
- }
- //Utils.LOG_INFO("Container: "+this.mRecipeTime);
- this.fontRendererObj.drawString(I18n.format("Modularity Table", new Object[0]), 8, 6, 4210752);
- if (mRecipeTime > -1){
- this.fontRendererObj.drawString(I18n.format("Time", new Object[0]), 84, 42, 4210752);
- this.fontRendererObj.drawString(I18n.format("Remaining", new Object[0]), 84, 50, 4210752);
- this.fontRendererObj.drawString(I18n.format(""+this.mRecipeTime+" Ticks", new Object[0]), 84, 58, 4210752);
- }
- this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
-
- }
-
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
-
- //This method is called when the Gui is first called!
- @Override
- public void initGui(){
- //You have to add this line for the Gui to function properly!
- super.initGui();
-
- //The parameters of GuiButton are(id, x, y, width, height, text);
- //this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
- //this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
- //NOTE: the id always has to be different or else it might get called twice or never!
-
- //Add any other buttons here too!
- }
-
- @Override
- protected void actionPerformed(final GuiButton B){
-
-
- }
-
-} \ No newline at end of file
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/ModularityTable.png");
+ private Container_ModularityTable mThisContainer;
+ private TileEntityModularityTable mThisTile;
+ private int mRecipeTime = -1;
+
+ public GUI_ModularityTable(final InventoryPlayer player_inventory, final TileEntityModularityTable tile) {
+ super(new Container_ModularityTable(player_inventory, tile));
+ this.mThisContainer = tile.getContainer();
+ this.mThisTile = tile;
+ if (this.mThisTile.getRecipeTime() > -1) {
+ this.mRecipeTime = this.mThisTile.getRecipeTime();
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ if (this.mThisTile.getRecipeTime() > -1) {
+ this.mRecipeTime = this.mThisTile.getRecipeTime();
+ }
+ // Utils.LOG_INFO("Container: "+this.mRecipeTime);
+ this.fontRendererObj.drawString(I18n.format("Modularity Table", new Object[0]), 8, 6, 4210752);
+ if (mRecipeTime > -1) {
+ this.fontRendererObj.drawString(I18n.format("Time", new Object[0]), 84, 42, 4210752);
+ this.fontRendererObj.drawString(I18n.format("Remaining", new Object[0]), 84, 50, 4210752);
+ this.fontRendererObj.drawString(
+ I18n.format("" + this.mRecipeTime + " Ticks", new Object[0]), 84, 58, 4210752);
+ }
+ this.fontRendererObj.drawString(
+ I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+
+ // This method is called when the Gui is first called!
+ @Override
+ public void initGui() {
+ // You have to add this line for the Gui to function properly!
+ super.initGui();
+
+ // The parameters of GuiButton are(id, x, y, width, height, text);
+ // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
+ // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
+ // NOTE: the id always has to be different or else it might get called twice or never!
+
+ // Add any other buttons here too!
+ }
+
+ @Override
+ protected void actionPerformed(final GuiButton B) {}
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java
index 881c6c82a1..45a1bb6049 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.gui.machine;
-import java.awt.Color;
-
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.container.Container_PestKiller;
@@ -11,6 +7,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller;
import gtPlusPlus.core.util.math.MathUtils;
+import java.awt.Color;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
@@ -18,142 +15,138 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.IFluidTank;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_PestKiller extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/PestKiller.png");
- private final TileEntityPestKiller mTileKiller;
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/PestKiller.png");
+ private final TileEntityPestKiller mTileKiller;
+
+ public GUI_PestKiller(final InventoryPlayer player_inventory, final TileEntityPestKiller te) {
+ super(new Container_PestKiller(player_inventory, te));
+ mTileKiller = te;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ if (mTileKiller != null) {
+ this.fontRendererObj.drawString(I18n.format(mTileKiller.getInventoryName(), new Object[0]), 4, 6, 4210752);
+ drawFluidTank(mTileKiller.getTank(), 134, 35);
+ }
+ }
- public GUI_PestKiller(final InventoryPlayer player_inventory, final TileEntityPestKiller te) {
- super(new Container_PestKiller(player_inventory, te));
- mTileKiller = te;
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- if (mTileKiller != null) {
- this.fontRendererObj.drawString(I18n.format(mTileKiller.getInventoryName(), new Object[0]), 4, 6, 4210752);
- drawFluidTank(mTileKiller.getTank(), 134, 35);
- }
- }
+ // This method is called when the Gui is first called!
+ @Override
+ public void initGui() {
+ super.initGui();
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ private void drawFluidTank(IFluidTank tank, int x, int y) {
+ Color startGrad = new Color(50, 50, 50);
+ Color endGrad = new Color(20, 20, 20);
+ Container_PestKiller aCont = (Container_PestKiller) this.inventorySlots;
- // This method is called when the Gui is first called!
- @Override
- public void initGui() {
- super.initGui();
- }
+ double aPercentage = 0;
+ double aDivisor = (100 / 16);
+ int aFrameHeight = 16;
- private void drawFluidTank(IFluidTank tank, int x, int y) {
- Color startGrad = new Color(50, 50, 50);
- Color endGrad = new Color(20, 20, 20);
- Container_PestKiller aCont = (Container_PestKiller) this.inventorySlots;
-
- double aPercentage = 0;
- double aDivisor = (100/16);
- int aFrameHeight = 16;
-
- boolean didRender = false;
- if (aCont != null) {
- TileEntityPestKiller aTile = mTileKiller;
- if (aTile != null) {
- FluidTank aTank = aTile.getTank();
- int aTier = aTile.getTier();
- drawGradientRect(x, y, x+16, y+16, startGrad.getRGB(), endGrad.getRGB());
- if (aTier <= 0 || aTier > 2) {
- if (aTank != null && aTank.getFluidAmount() > 0) {
- aPercentage = MathUtils.findPercentage(aTank.getFluidAmount(), aTank.getCapacity());
- //Logger.INFO("Percent = "+aPercentage);
- aFrameHeight = (int) (aPercentage / aDivisor);
- //Logger.INFO("Frame Height = "+aFrameHeight);
- }
- this.fontRendererObj.drawString("Tier: 0", 4, 18, 4210752);
- this.fontRendererObj.drawString("Range: 1x1", 4, 30, 4210752);
- this.fontRendererObj.drawString("Poison: None", 4, 42, 4210752);
- this.fontRendererObj.drawString("Amount: 0", 4, 64, 4210752);
- didRender = true;
- }
- else if (aTier == 1) {
- if (aTank != null && aTank.getFluidAmount() > 0) {
- aPercentage = MathUtils.findPercentage(aTank.getFluidAmount(), aTank.getCapacity());
- //Logger.INFO("Percent = "+aPercentage);
- aFrameHeight = (int) (aPercentage / aDivisor);
- //Logger.INFO("Frame Height = "+aFrameHeight);
- }
- startGrad = new Color(240, 50, 240);
- endGrad = new Color(130, 30, 130);
- drawGradientRect(x, y+(16-aFrameHeight), x+16, y+16, startGrad.getRGB(), endGrad.getRGB());
- this.fontRendererObj.drawString("Tier: 1", 4, 18, 4210752);
- this.fontRendererObj.drawString("Range: 5x5", 4, 30, 4210752);
- this.fontRendererObj.drawString("Poison: ", 4, 42, 4210752);
- this.fontRendererObj.drawString(""+aTile.getTank().getFluid().getLocalizedName(), 4, 54, 4210752);
- this.fontRendererObj.drawString("Amount: "+aTile.getTank().getFluidAmount(), 4, 64, 4210752);
- didRender = true;
- }
- else if (aTier == 2) {
- if (aTank != null && aTank.getFluidAmount() > 0) {
- aPercentage = MathUtils.findPercentage(aTank.getFluidAmount(), aTank.getCapacity());
- //Logger.INFO("Percent = "+aPercentage);
- aFrameHeight = (int) (aPercentage / aDivisor);
- //Logger.INFO("Frame Height = "+aFrameHeight);
- }
- short[] aRGB = MISC_MATERIALS.HYDROGEN_CYANIDE.getRGB();
- startGrad = new Color(aRGB[0], aRGB[1], aRGB[2]);
- endGrad = new Color(Math.max(aRGB[0], 0), Math.max(aRGB[1], 0), Math.max(aRGB[2], 0));
- drawGradientRect(x, y+(16-aFrameHeight), x+16, y+16, startGrad.getRGB(), endGrad.getRGB());
- this.fontRendererObj.drawString("Tier: 2", 4, 18, 4210752);
- this.fontRendererObj.drawString("Range: 9x9", 4, 30, 4210752);
- this.fontRendererObj.drawString("Poison: ", 4, 42, 4210752);
- this.fontRendererObj.drawString(""+aTile.getTank().getFluid().getLocalizedName(), 4, 54, 4210752);
- this.fontRendererObj.drawString("Amount: "+aTile.getTank().getFluidAmount(), 4, 64, 4210752);
- didRender = true;
- }
- }
- }
- if (!didRender) {
- startGrad = new Color(255, 30, 120);
- endGrad = new Color(255, 0, 50);
- drawGradientRect(x, y, x+16, y+16, startGrad.getRGB(), endGrad.getRGB());
- this.fontRendererObj.drawString("Tier: 0", 4, 18, 4210752);
- }
-
-
-
-
-
-
- /*
- * FluidStack fluid = tank.getFluid(); TextureManager manager =
- * mc.getTextureManager(); if (fluid != null) {
- * manager.bindTexture(manager.getResourceLocation(0)); float amount =
- * fluid.amount; float capacity = tank.getCapacity(); float scale = amount /
- * capacity; int fluidTankHeight = 60; int fluidAmount = (int) (scale *
- * fluidTankHeight); drawFluid(x, y + fluidTankHeight - fluidAmount,
- * fluid.getFluid().getIcon(fluid), 16, fluidAmount); }
- */
- }
+ boolean didRender = false;
+ if (aCont != null) {
+ TileEntityPestKiller aTile = mTileKiller;
+ if (aTile != null) {
+ FluidTank aTank = aTile.getTank();
+ int aTier = aTile.getTier();
+ drawGradientRect(x, y, x + 16, y + 16, startGrad.getRGB(), endGrad.getRGB());
+ if (aTier <= 0 || aTier > 2) {
+ if (aTank != null && aTank.getFluidAmount() > 0) {
+ aPercentage = MathUtils.findPercentage(aTank.getFluidAmount(), aTank.getCapacity());
+ // Logger.INFO("Percent = "+aPercentage);
+ aFrameHeight = (int) (aPercentage / aDivisor);
+ // Logger.INFO("Frame Height = "+aFrameHeight);
+ }
+ this.fontRendererObj.drawString("Tier: 0", 4, 18, 4210752);
+ this.fontRendererObj.drawString("Range: 1x1", 4, 30, 4210752);
+ this.fontRendererObj.drawString("Poison: None", 4, 42, 4210752);
+ this.fontRendererObj.drawString("Amount: 0", 4, 64, 4210752);
+ didRender = true;
+ } else if (aTier == 1) {
+ if (aTank != null && aTank.getFluidAmount() > 0) {
+ aPercentage = MathUtils.findPercentage(aTank.getFluidAmount(), aTank.getCapacity());
+ // Logger.INFO("Percent = "+aPercentage);
+ aFrameHeight = (int) (aPercentage / aDivisor);
+ // Logger.INFO("Frame Height = "+aFrameHeight);
+ }
+ startGrad = new Color(240, 50, 240);
+ endGrad = new Color(130, 30, 130);
+ drawGradientRect(x, y + (16 - aFrameHeight), x + 16, y + 16, startGrad.getRGB(), endGrad.getRGB());
+ this.fontRendererObj.drawString("Tier: 1", 4, 18, 4210752);
+ this.fontRendererObj.drawString("Range: 5x5", 4, 30, 4210752);
+ this.fontRendererObj.drawString("Poison: ", 4, 42, 4210752);
+ this.fontRendererObj.drawString(
+ "" + aTile.getTank().getFluid().getLocalizedName(), 4, 54, 4210752);
+ this.fontRendererObj.drawString("Amount: " + aTile.getTank().getFluidAmount(), 4, 64, 4210752);
+ didRender = true;
+ } else if (aTier == 2) {
+ if (aTank != null && aTank.getFluidAmount() > 0) {
+ aPercentage = MathUtils.findPercentage(aTank.getFluidAmount(), aTank.getCapacity());
+ // Logger.INFO("Percent = "+aPercentage);
+ aFrameHeight = (int) (aPercentage / aDivisor);
+ // Logger.INFO("Frame Height = "+aFrameHeight);
+ }
+ short[] aRGB = MISC_MATERIALS.HYDROGEN_CYANIDE.getRGB();
+ startGrad = new Color(aRGB[0], aRGB[1], aRGB[2]);
+ endGrad = new Color(Math.max(aRGB[0], 0), Math.max(aRGB[1], 0), Math.max(aRGB[2], 0));
+ drawGradientRect(x, y + (16 - aFrameHeight), x + 16, y + 16, startGrad.getRGB(), endGrad.getRGB());
+ this.fontRendererObj.drawString("Tier: 2", 4, 18, 4210752);
+ this.fontRendererObj.drawString("Range: 9x9", 4, 30, 4210752);
+ this.fontRendererObj.drawString("Poison: ", 4, 42, 4210752);
+ this.fontRendererObj.drawString(
+ "" + aTile.getTank().getFluid().getLocalizedName(), 4, 54, 4210752);
+ this.fontRendererObj.drawString("Amount: " + aTile.getTank().getFluidAmount(), 4, 64, 4210752);
+ didRender = true;
+ }
+ }
+ }
+ if (!didRender) {
+ startGrad = new Color(255, 30, 120);
+ endGrad = new Color(255, 0, 50);
+ drawGradientRect(x, y, x + 16, y + 16, startGrad.getRGB(), endGrad.getRGB());
+ this.fontRendererObj.drawString("Tier: 0", 4, 18, 4210752);
+ }
- private void drawFluid(int x, int y, IIcon icon, int width, int height) {
- int i = 0;
- int j = 0;
- int drawHeight = 0;
- int drawWidth = 0;
- for (i = 0; i < width; i += 16) {
- for (j = 0; j < height; j += 16) {
- drawWidth = Math.min(width - i, 16);
- drawHeight = Math.min(height - j, 16);
- drawTexturedModelRectFromIcon(x + i, y + j, icon, drawWidth, drawHeight);
- }
- }
- }
+ /*
+ * FluidStack fluid = tank.getFluid(); TextureManager manager =
+ * mc.getTextureManager(); if (fluid != null) {
+ * manager.bindTexture(manager.getResourceLocation(0)); float amount =
+ * fluid.amount; float capacity = tank.getCapacity(); float scale = amount /
+ * capacity; int fluidTankHeight = 60; int fluidAmount = (int) (scale *
+ * fluidTankHeight); drawFluid(x, y + fluidTankHeight - fluidAmount,
+ * fluid.getFluid().getIcon(fluid), 16, fluidAmount); }
+ */
+ }
-} \ No newline at end of file
+ private void drawFluid(int x, int y, IIcon icon, int width, int height) {
+ int i = 0;
+ int j = 0;
+ int drawHeight = 0;
+ int drawWidth = 0;
+ for (i = 0; i < width; i += 16) {
+ for (j = 0; j < height; j += 16) {
+ drawWidth = Math.min(width - i, 16);
+ drawHeight = Math.min(height - j, 16);
+ drawTexturedModelRectFromIcon(x + i, y + j, icon, drawWidth, drawHeight);
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ProjectTable.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_ProjectTable.java
index 4870269080..37258584af 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ProjectTable.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_ProjectTable.java
@@ -1,65 +1,57 @@
package gtPlusPlus.core.gui.machine;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.container.Container_ProjectTable;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
-
-import gtPlusPlus.core.container.Container_ProjectTable;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_ProjectTable extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/ProjectTable.png");
-
- public GUI_ProjectTable(final InventoryPlayer player_inventory, final TileEntityProjectTable tile){
- super(new Container_ProjectTable(player_inventory, tile));
- }
-
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j){
- //this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
- //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
-
- }
-
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
-
- //This method is called when the Gui is first called!
- @Override
- public void initGui(){
- //You have to add this line for the Gui to function properly!
- super.initGui();
-
- //The parameters of GuiButton are(id, x, y, width, height, text);
- //this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
- //this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
- //NOTE: the id always has to be different or else it might get called twice or never!
-
- //Add any other buttons here too!
- }
-
- @Override
- protected void actionPerformed(final GuiButton B){
-
-
- }
-
-} \ No newline at end of file
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/ProjectTable.png");
+
+ public GUI_ProjectTable(final InventoryPlayer player_inventory, final TileEntityProjectTable tile) {
+ super(new Container_ProjectTable(player_inventory, tile));
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ // this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
+ // this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
+ // 4210752);
+
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+
+ // This method is called when the Gui is first called!
+ @Override
+ public void initGui() {
+ // You have to add this line for the Gui to function properly!
+ super.initGui();
+
+ // The parameters of GuiButton are(id, x, y, width, height, text);
+ // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
+ // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
+ // NOTE: the id always has to be different or else it might get called twice or never!
+
+ // Add any other buttons here too!
+ }
+
+ @Override
+ protected void actionPerformed(final GuiButton B) {}
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java
index edb53e8ec0..fc1f0c7bed 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java
@@ -1,10 +1,5 @@
package gtPlusPlus.core.gui.machine;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.container.Container_RoundRobinator;
@@ -13,108 +8,114 @@ import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Method;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_RoundRobinator extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/RoundRobinator.png");
- private TileEntityRoundRobinator mTile;
- private Container_RoundRobinator mContainer;
- private static final Method mDrawItemStack;
-
- static {
- mDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class});
- }
-
- public GUI_RoundRobinator(final InventoryPlayer player_inventory, final TileEntityRoundRobinator te){
- this(new Container_RoundRobinator(player_inventory, te));
- mTile = te;
- }
-
- private GUI_RoundRobinator(final Container_RoundRobinator aContainer){
- super(aContainer);
- mContainer = aContainer;
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j){
- super.drawGuiContainerForegroundLayer(i, j);
-
- int xStart = 134;
- int yStart = 31;
- mTile = this.mContainer.tile_entity;
-
- int tier = mContainer.mTier;
- int aTickRate = mContainer.mTickRate;
-
- fontRendererObj.drawString("Round Robinator", 85, 4, Utils.rgbtoHexValue(50, 150, 50));
- fontRendererObj.drawString("Tier: "+tier, 85, 12, Utils.rgbtoHexValue(50, 150, 50));
- fontRendererObj.drawString("Rate: 1 Item/"+aTickRate+"t", 85, 20, Utils.rgbtoHexValue(50, 150, 50));
-
- boolean[] aStates = new boolean[] {mContainer.mSide_1 == 0 ? false : true, mContainer.mSide_2 == 0 ? false : true, mContainer.mSide_3 == 0 ? false : true,mContainer.mSide_4 == 0 ? false : true};
-
- fontRendererObj.drawString("West: "+(aStates[0] ? "Active" : "Disabled"), 5, 5, Utils.rgbtoHexValue(50, 50, 50));
- fontRendererObj.drawString("North: "+(aStates[1] ? "Active" : "Disabled"), 5, 15, Utils.rgbtoHexValue(50, 50, 50));
- fontRendererObj.drawString("South: "+(aStates[2] ? "Active" : "Disabled"), 5, 25, Utils.rgbtoHexValue(50, 50, 50));
- fontRendererObj.drawString("East: "+(aStates[3] ? "Active" : "Disabled"), 5, 35, Utils.rgbtoHexValue(50, 50, 50));
- fontRendererObj.drawString("Toggling South will visually", 5, 65, Utils.rgbtoHexValue(150, 50, 50));
- fontRendererObj.drawString("toggle East, This is a visual bug.", 5, 74, Utils.rgbtoHexValue(150, 50, 50));
- drawStatus(aStates[0], xStart, yStart);
- drawStatus(aStates[1], xStart+18, yStart);
- drawStatus(aStates[2], xStart, yStart+18);
- drawStatus(aStates[3], xStart+18, yStart+18);
-
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
-
-
-
- }
-
- private static ItemStack aGreenGlass;
- private static ItemStack aRedGlass;
-
- private void drawStatus(boolean aStateActive, int x, int y) {
- if (aGreenGlass == null) {
- Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem();
- aGreenGlass = ItemUtils.simpleMetaStack(pane, 5, 1);
- }
- if (aRedGlass == null) {
- Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem();
- aRedGlass = ItemUtils.simpleMetaStack(pane, 14, 1);
- }
- if (mDrawItemStack != null) {
- try {
- if (aStateActive) {
- mDrawItemStack.invoke(this, new Object[]{aGreenGlass, x, y, ""});
- }
- else {
- mDrawItemStack.invoke(this, new Object[]{aRedGlass, x, y, ""});
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
- }
-
- //This method is called when the Gui is first called!
- @Override
- public void initGui(){
- super.initGui();
- }
-
-} \ No newline at end of file
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/RoundRobinator.png");
+ private TileEntityRoundRobinator mTile;
+ private Container_RoundRobinator mContainer;
+ private static final Method mDrawItemStack;
+
+ static {
+ mDrawItemStack = ReflectionUtils.getMethod(
+ GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class});
+ }
+
+ public GUI_RoundRobinator(final InventoryPlayer player_inventory, final TileEntityRoundRobinator te) {
+ this(new Container_RoundRobinator(player_inventory, te));
+ mTile = te;
+ }
+
+ private GUI_RoundRobinator(final Container_RoundRobinator aContainer) {
+ super(aContainer);
+ mContainer = aContainer;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ super.drawGuiContainerForegroundLayer(i, j);
+
+ int xStart = 134;
+ int yStart = 31;
+ mTile = this.mContainer.tile_entity;
+
+ int tier = mContainer.mTier;
+ int aTickRate = mContainer.mTickRate;
+
+ fontRendererObj.drawString("Round Robinator", 85, 4, Utils.rgbtoHexValue(50, 150, 50));
+ fontRendererObj.drawString("Tier: " + tier, 85, 12, Utils.rgbtoHexValue(50, 150, 50));
+ fontRendererObj.drawString("Rate: 1 Item/" + aTickRate + "t", 85, 20, Utils.rgbtoHexValue(50, 150, 50));
+
+ boolean[] aStates = new boolean[] {
+ mContainer.mSide_1 == 0 ? false : true,
+ mContainer.mSide_2 == 0 ? false : true,
+ mContainer.mSide_3 == 0 ? false : true,
+ mContainer.mSide_4 == 0 ? false : true
+ };
+
+ fontRendererObj.drawString(
+ "West: " + (aStates[0] ? "Active" : "Disabled"), 5, 5, Utils.rgbtoHexValue(50, 50, 50));
+ fontRendererObj.drawString(
+ "North: " + (aStates[1] ? "Active" : "Disabled"), 5, 15, Utils.rgbtoHexValue(50, 50, 50));
+ fontRendererObj.drawString(
+ "South: " + (aStates[2] ? "Active" : "Disabled"), 5, 25, Utils.rgbtoHexValue(50, 50, 50));
+ fontRendererObj.drawString(
+ "East: " + (aStates[3] ? "Active" : "Disabled"), 5, 35, Utils.rgbtoHexValue(50, 50, 50));
+ fontRendererObj.drawString("Toggling South will visually", 5, 65, Utils.rgbtoHexValue(150, 50, 50));
+ fontRendererObj.drawString("toggle East, This is a visual bug.", 5, 74, Utils.rgbtoHexValue(150, 50, 50));
+ drawStatus(aStates[0], xStart, yStart);
+ drawStatus(aStates[1], xStart + 18, yStart);
+ drawStatus(aStates[2], xStart, yStart + 18);
+ drawStatus(aStates[3], xStart + 18, yStart + 18);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+
+ private static ItemStack aGreenGlass;
+ private static ItemStack aRedGlass;
+
+ private void drawStatus(boolean aStateActive, int x, int y) {
+ if (aGreenGlass == null) {
+ Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem();
+ aGreenGlass = ItemUtils.simpleMetaStack(pane, 5, 1);
+ }
+ if (aRedGlass == null) {
+ Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem();
+ aRedGlass = ItemUtils.simpleMetaStack(pane, 14, 1);
+ }
+ if (mDrawItemStack != null) {
+ try {
+ if (aStateActive) {
+ mDrawItemStack.invoke(this, new Object[] {aGreenGlass, x, y, ""});
+ } else {
+ mDrawItemStack.invoke(this, new Object[] {aRedGlass, x, y, ""});
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+
+ // This method is called when the Gui is first called!
+ @Override
+ public void initGui() {
+ super.initGui();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ScrollTest.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_ScrollTest.java
index 8a1f7c3fe9..d54f6b9364 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ScrollTest.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_ScrollTest.java
@@ -1,5 +1,9 @@
package gtPlusPlus.core.gui.machine;
+import com.google.common.collect.Lists;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.io.File;
import java.io.IOException;
import java.net.URI;
@@ -7,16 +11,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.lwjgl.Sys;
-
-import com.google.common.collect.Lists;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiOptionButton;
import net.minecraft.client.gui.GuiResourcePackAvailable;
@@ -28,10 +22,12 @@ import net.minecraft.client.resources.ResourcePackListEntryFound;
import net.minecraft.client.resources.ResourcePackRepository;
import net.minecraft.client.resources.ResourcePackRepository.Entry;
import net.minecraft.util.Util;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.lwjgl.Sys;
@SideOnly(Side.CLIENT)
-public class GUI_ScrollTest extends GuiScreen
-{
+public class GUI_ScrollTest extends GuiScreen {
private static final Logger logger = LogManager.getLogger();
private GuiScreen aThisGUIScreen;
private List<?> field_146966_g;
@@ -40,8 +36,7 @@ public class GUI_ScrollTest extends GuiScreen
private GuiResourcePackSelected MapOfActiveResourcePacks;
private static final String __OBFID = "CL_00000820";
- public GUI_ScrollTest(GuiScreen p_i45050_1_)
- {
+ public GUI_ScrollTest(GuiScreen p_i45050_1_) {
this.aThisGUIScreen = p_i45050_1_;
}
@@ -49,10 +44,11 @@ public class GUI_ScrollTest extends GuiScreen
* Adds the buttons (and other controls) to the screen in question.
*/
@SuppressWarnings("unchecked")
- public void initGui()
- {
- this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
- this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));
+ public void initGui() {
+ this.buttonList.add(new GuiOptionButton(
+ 2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
+ this.buttonList.add(
+ new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));
this.field_146966_g = new ArrayList<Object>();
this.field_146969_h = new ArrayList<Entry>();
ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
@@ -62,21 +58,19 @@ public class GUI_ScrollTest extends GuiScreen
Iterator<?> iterator = arraylist.iterator();
ResourcePackRepository.Entry entry;
- while (iterator.hasNext())
- {
- entry = (ResourcePackRepository.Entry)iterator.next();
- //this.field_146966_g.add(new ResourcePackListEntryFound(this, entry));
+ while (iterator.hasNext()) {
+ entry = (ResourcePackRepository.Entry) iterator.next();
+ // this.field_146966_g.add(new ResourcePackListEntryFound(this, entry));
}
iterator = Lists.reverse(resourcepackrepository.getRepositoryEntries()).iterator();
- while (iterator.hasNext())
- {
- entry = (ResourcePackRepository.Entry)iterator.next();
- //this.field_146969_h.add(new ResourcePackListEntryFound(this, entry));
+ while (iterator.hasNext()) {
+ entry = (ResourcePackRepository.Entry) iterator.next();
+ // this.field_146969_h.add(new ResourcePackListEntryFound(this, entry));
}
- //this.field_146969_h.add(new ResourcePackListEntryDefault(this));
+ // this.field_146969_h.add(new ResourcePackListEntryDefault(this));
this.MapOfFreeResourcePacks = new GuiResourcePackAvailable(this.mc, 200, this.height, this.field_146966_g);
this.MapOfFreeResourcePacks.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200);
this.MapOfFreeResourcePacks.registerScrollButtons(7, 8);
@@ -85,95 +79,73 @@ public class GUI_ScrollTest extends GuiScreen
this.MapOfActiveResourcePacks.registerScrollButtons(7, 8);
}
- public boolean func_146961_a(ResourcePackListEntry p_146961_1_)
- {
+ public boolean func_146961_a(ResourcePackListEntry p_146961_1_) {
return this.field_146969_h.contains(p_146961_1_);
}
- public List<?> func_146962_b(ResourcePackListEntry p_146962_1_)
- {
+ public List<?> func_146962_b(ResourcePackListEntry p_146962_1_) {
return this.func_146961_a(p_146962_1_) ? this.field_146969_h : this.field_146966_g;
}
- public List<?> func_146964_g()
- {
+ public List<?> func_146964_g() {
return this.field_146966_g;
}
- public List<?> func_146963_h()
- {
+ public List<?> func_146963_h() {
return this.field_146969_h;
}
- protected void actionPerformed(GuiButton p_146284_1_)
- {
- if (p_146284_1_.enabled)
- {
- if (p_146284_1_.id == 2)
- {
+ protected void actionPerformed(GuiButton p_146284_1_) {
+ if (p_146284_1_.enabled) {
+ if (p_146284_1_.id == 2) {
File file1 = this.mc.getResourcePackRepository().getDirResourcepacks();
String s = file1.getAbsolutePath();
- if (Util.getOSType() == Util.EnumOS.OSX)
- {
- try
- {
+ if (Util.getOSType() == Util.EnumOS.OSX) {
+ try {
logger.info(s);
Runtime.getRuntime().exec(new String[] {"/usr/bin/open", s});
return;
- }
- catch (IOException ioexception1)
- {
+ } catch (IOException ioexception1) {
logger.error("Couldn\'t open file", ioexception1);
}
- }
- else if (Util.getOSType() == Util.EnumOS.WINDOWS)
- {
+ } else if (Util.getOSType() == Util.EnumOS.WINDOWS) {
String s1 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {s});
- try
- {
+ try {
Runtime.getRuntime().exec(s1);
return;
- }
- catch (IOException ioexception)
- {
+ } catch (IOException ioexception) {
logger.error("Couldn\'t open file", ioexception);
}
}
boolean flag = false;
- try
- {
+ try {
Class<?> oclass = ReflectionUtils.getClass("java.awt.Desktop");
- Object object = ReflectionUtils.getMethod(oclass, "getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
- ReflectionUtils.getMethod(oclass, "browse", new Class[] {URI.class}).invoke(object, new Object[] {file1.toURI()});
- }
- catch (Throwable throwable)
- {
+ Object object = ReflectionUtils.getMethod(oclass, "getDesktop", new Class[0])
+ .invoke((Object) null, new Object[0]);
+ ReflectionUtils.getMethod(oclass, "browse", new Class[] {URI.class})
+ .invoke(object, new Object[] {file1.toURI()});
+ } catch (Throwable throwable) {
logger.error("Couldn\'t open link", throwable);
flag = true;
}
- if (flag)
- {
+ if (flag) {
logger.info("Opening via system class!");
Sys.openURL("file://" + s);
}
- }
- else if (p_146284_1_.id == 1)
- {
+ } else if (p_146284_1_.id == 1) {
ArrayList<Entry> arraylist = Lists.newArrayList();
Iterator<?> iterator = this.field_146969_h.iterator();
- while (iterator.hasNext())
- {
- ResourcePackListEntry resourcepacklistentry = (ResourcePackListEntry)iterator.next();
+ while (iterator.hasNext()) {
+ ResourcePackListEntry resourcepacklistentry = (ResourcePackListEntry) iterator.next();
- if (resourcepacklistentry instanceof ResourcePackListEntryFound)
- {
- arraylist.add(((ResourcePackListEntryFound)resourcepacklistentry).func_148318_i());
+ if (resourcepacklistentry instanceof ResourcePackListEntryFound) {
+ arraylist.add(((ResourcePackListEntryFound) resourcepacklistentry).func_148318_i());
}
}
@@ -182,9 +154,8 @@ public class GUI_ScrollTest extends GuiScreen
this.mc.gameSettings.resourcePacks.clear();
iterator = arraylist.iterator();
- while (iterator.hasNext())
- {
- ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator.next();
+ while (iterator.hasNext()) {
+ ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry) iterator.next();
this.mc.gameSettings.resourcePacks.add(entry.getResourcePackName());
}
@@ -198,8 +169,7 @@ public class GUI_ScrollTest extends GuiScreen
/**
* Called when the mouse is clicked.
*/
- protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
- {
+ protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) {
super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_);
this.MapOfFreeResourcePacks.func_148179_a(p_73864_1_, p_73864_2_, p_73864_3_);
this.MapOfActiveResourcePacks.func_148179_a(p_73864_1_, p_73864_2_, p_73864_3_);
@@ -209,21 +179,25 @@ public class GUI_ScrollTest extends GuiScreen
* Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is
* mouseMove, which==0 or which==1 is mouseUp
*/
- protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_)
- {
+ protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) {
super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_);
}
/**
* Draws the screen and all the components in it.
*/
- public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
- {
+ public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
this.drawBackground(0);
this.MapOfFreeResourcePacks.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
this.MapOfActiveResourcePacks.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
- this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.title", new Object[0]), this.width / 2, 16, 16777215);
- this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.folderInfo", new Object[0]), this.width / 2 - 77, this.height - 26, 8421504);
+ this.drawCenteredString(
+ this.fontRendererObj, I18n.format("resourcePack.title", new Object[0]), this.width / 2, 16, 16777215);
+ this.drawCenteredString(
+ this.fontRendererObj,
+ I18n.format("resourcePack.folderInfo", new Object[0]),
+ this.width / 2 - 77,
+ this.height - 26,
+ 8421504);
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_SuperJukebox.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_SuperJukebox.java
index d3d8f1e814..2349e0024d 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_SuperJukebox.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_SuperJukebox.java
@@ -1,90 +1,83 @@
package gtPlusPlus.core.gui.machine;
-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 gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox;
import gtPlusPlus.core.container.Container_SuperJukebox;
import gtPlusPlus.core.gui.GUI_Base_Tile_Entity;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.slots.SlotNoInput;
-import net.minecraft.client.gui.inventory.GuiContainer;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_SuperJukebox extends GUI_Base_Tile_Entity {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/SuperJukebox.png");
- private final Container_SuperJukebox mThisContainer;
-
- public GUI_SuperJukebox(final InventoryPlayer player_inventory, final TileEntitySuperJukebox te){
- super(new Container_SuperJukebox(player_inventory, te));
- mThisContainer = (Container_SuperJukebox) this.mContainer;
- }
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/SuperJukebox.png");
+ private final Container_SuperJukebox mThisContainer;
+
+ public GUI_SuperJukebox(final InventoryPlayer player_inventory, final TileEntitySuperJukebox te) {
+ super(new Container_SuperJukebox(player_inventory, te));
+ mThisContainer = (Container_SuperJukebox) this.mContainer;
+ }
+
+ // This method is called when the Gui is first called!
+ @Override
+ public void initGui() {
+ super.initGui();
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ super.drawGuiContainerForegroundLayer(par1, par2);
+
+ boolean a = mThisContainer.isPlaying;
+ boolean b = mThisContainer.isLooping;
- //This method is called when the Gui is first called!
- @Override
- public void initGui(){
- super.initGui();
- }
+ if (a && b) {
+ this.fontRendererObj.drawString("[X] [X]", 72, 74, 4210752);
+ } else if (a && !b) {
+ this.fontRendererObj.drawString("[X] [ ]", 72, 74, 4210752);
+ } else if (!a && b) {
+ this.fontRendererObj.drawString("[ ] [X]", 72, 74, 4210752);
+ } else {
+ this.fontRendererObj.drawString("[ ] [ ]", 72, 74, 4210752);
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- super.drawGuiContainerForegroundLayer(par1, par2);
+ this.drawTooltip(par1, par2);
+ }
- boolean a = mThisContainer.isPlaying;
- boolean b = mThisContainer.isLooping;
-
- if (a && b) {
- this.fontRendererObj.drawString("[X] [X]", 72, 74, 4210752);
- }
- else if (a && !b) {
- this.fontRendererObj.drawString("[X] [ ]", 72, 74, 4210752);
- }
- else if (!a && b) {
- this.fontRendererObj.drawString("[ ] [X]", 72, 74, 4210752);
- }
- else {
- this.fontRendererObj.drawString("[ ] [ ]", 72, 74, 4210752);
- }
-
- this.drawTooltip(par1, par2);
- }
+ private void drawTooltip(final int x2, final int y2) {
+ final int xStart = (this.width - this.xSize) / 2;
+ final int yStart = (this.height - this.ySize) / 2;
+ final int x3 = x2 - xStart;
+ final int y3 = y2 - yStart + 5;
+ final List<String> list = new ArrayList<String>();
- private void drawTooltip(final int x2, final int y2) {
- final int xStart = (this.width - this.xSize) / 2;
- final int yStart = (this.height - this.ySize) / 2;
- final int x3 = x2 - xStart;
- final int y3 = y2 - yStart + 5;
- final List<String> list = new ArrayList<String>();
-
- if (y3 >= 17 && y3 <= 33) {
- if (x3 >= 80 && x3 <= 96) {
- list.add("Play");
- }
- }
- if (y3 >= 35 && y3 <= 53) {
- if (x3 >= 80 && x3 <= 96) {
- list.add("Loop");
- }
- }
- if (!list.isEmpty()) {
- this.drawHoveringText(list, x3, y3, this.fontRendererObj);
- }
- }
+ if (y3 >= 17 && y3 <= 33) {
+ if (x3 >= 80 && x3 <= 96) {
+ list.add("Play");
+ }
+ }
+ if (y3 >= 35 && y3 <= 53) {
+ if (x3 >= 80 && x3 <= 96) {
+ list.add("Loop");
+ }
+ }
+ if (!list.isEmpty()) {
+ this.drawHoveringText(list, x3, y3, this.fontRendererObj);
+ }
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
-} \ No newline at end of file
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java
index 7c71f09302..dd59baf697 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java
@@ -1,50 +1,49 @@
package gtPlusPlus.core.gui.machine;
-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.client.resources.I18n;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.container.Container_TradeTable;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_TradeTable extends GuiContainer {
- TileEntityTradeTable mThisTable;
- String mOwnerName;
-
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/ProjectTable.png");
-
- public GUI_TradeTable(final InventoryPlayer player_inventory, final TileEntityTradeTable te, final String mOwnerName){
- super(new Container_TradeTable(player_inventory, te));
- if (te.isServerSide()){
- mThisTable = te;
- this.mOwnerName = mOwnerName;
- Logger.INFO("Set valid TE in GUI");
- }
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j){
- this.fontRendererObj.drawString(I18n.format("Owner - "+this.mOwnerName, new Object[0]), 28, 66, 4210752);
- //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
-} \ No newline at end of file
+ TileEntityTradeTable mThisTable;
+ String mOwnerName;
+
+ private static final ResourceLocation craftingTableGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/ProjectTable.png");
+
+ public GUI_TradeTable(
+ final InventoryPlayer player_inventory, final TileEntityTradeTable te, final String mOwnerName) {
+ super(new Container_TradeTable(player_inventory, te));
+ if (te.isServerSide()) {
+ mThisTable = te;
+ this.mOwnerName = mOwnerName;
+ Logger.INFO("Set valid TE in GUI");
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ this.fontRendererObj.drawString(I18n.format("Owner - " + this.mOwnerName, new Object[0]), 28, 66, 4210752);
+ // this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
+ // 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java
index 512f31dd47..1405d0229d 100644
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.gui.machine;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.api.objects.Logger;
@@ -15,260 +12,226 @@ import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GUI_VolumetricFlaskSetter extends GuiContainer {
- private static final ResourceLocation mGuiTextures = new ResourceLocation(
- CORE.MODID, "textures/gui/VolumetricFlaskSetter.png"
- );
- private Container_VolumetricFlaskSetter mContainer;
- private boolean mIsOpen = false;
- private GuiValueField mText;
- private TileEntityVolumetricFlaskSetter mTile;
-
- public GUI_VolumetricFlaskSetter(Container_VolumetricFlaskSetter aContainer) {
- super(aContainer);
- mContainer = aContainer;
- mTile = mContainer.mTileEntity;
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(mGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- super.drawGuiContainerForegroundLayer(i, j);
- this.mText.drawTextBox();
- this.fontRendererObj.drawString(
- I18n.format("container.VolumetricFlaskSetter", new Object[0]), 4, 3, 4210752
- );
- int aYVal = 49;
- this.fontRendererObj.drawString(
- I18n.format("0 = 16l", new Object[0]), 8, aYVal, 4210752
- );
- this.fontRendererObj.drawString(
- I18n.format("4 = 576l", new Object[0]), 64, aYVal, 4210752
- );
- this.fontRendererObj.drawString(
- I18n.format("1 = 36l", new Object[0]), 8, aYVal += 8, 4210752
- );
- this.fontRendererObj.drawString(
- I18n.format("5 = 720l", new Object[0]), 64, aYVal, 4210752
- );
- this.fontRendererObj.drawString(
- I18n.format("2 = 144l", new Object[0]), 8, aYVal += 8, 4210752
- );
- this.fontRendererObj.drawString(
- I18n.format("6 = 864l", new Object[0]), 64, aYVal, 4210752
- );
- this.fontRendererObj.drawString(
- I18n.format("3 = 432l", new Object[0]), 8, aYVal += 8, 4210752
- );
- this.fontRendererObj.drawString(
- I18n.format("-> = Custom", new Object[0]), 59, aYVal, 4210752
- );
-
- }
-
- public void drawScreen(int par1, int par2, float par3) {
- this.drawDefaultBackground();
- super.drawScreen(par1, par2, par3);
- }
-
- protected String getText() {
- return this.mText.getText();
- }
-
- public void initGui() {
- super.initGui();
- // Keyboard.enableRepeatEvents(true);
- mIsOpen = true;
- this.mText = new GuiValueField(
- this.fontRendererObj, 26, 31, this.width / 2
- - 62, this.height / 2 - 52, 106, 14, this
- );
- mText.setMaxStringLength(5);
- mText.setEnableBackgroundDrawing(true);
- mText.setText("0");
- mText.setFocused(true);
- }
-
- public boolean isNumber(char c) {
- boolean isNum = ((c >= 48 && c <= 57) || c == 45);
- if (isNum) {
- log("Found Digit: "+c+" | char value");
- }
- else {
- switch (c) {
- case '0' :
- case '1' :
- case '2' :
- case '3' :
- case '4' :
- case '5' :
- case '6' :
- case '7' :
- case '8' :
- case '9' :
- log("Found Digit: "+c+" | char switch");
- return true;
- }
- }
- return isNum;
- }
-
- public boolean isNumber(int c) {
- switch (c) {
- case Keyboard.KEY_0 :
- case Keyboard.KEY_1 :
- case Keyboard.KEY_2 :
- case Keyboard.KEY_3 :
- case Keyboard.KEY_4 :
- case Keyboard.KEY_5 :
- case Keyboard.KEY_6 :
- case Keyboard.KEY_7 :
- case Keyboard.KEY_8 :
- case Keyboard.KEY_9 :
- case Keyboard.KEY_NUMPAD0 :
- case Keyboard.KEY_NUMPAD1 :
- case Keyboard.KEY_NUMPAD2 :
- case Keyboard.KEY_NUMPAD3 :
- case Keyboard.KEY_NUMPAD4 :
- case Keyboard.KEY_NUMPAD5 :
- case Keyboard.KEY_NUMPAD6 :
- case Keyboard.KEY_NUMPAD7 :
- case Keyboard.KEY_NUMPAD8 :
- case Keyboard.KEY_NUMPAD9 :
- log("Found Digit: "+Keyboard.getKeyName(c)+" | LWJGL Keybinding");
- return true;
- }
- return false;
- }
-
- protected void keyTyped(char par1, int par2) {
- if (mIsOpen) {
- log("Pressed " + par1 + " | " + par2);
- if (mText.isFocused()) {
- log("Text box has focus.");
- if (par2 == Keyboard.KEY_RETURN) {
- log("Pressed Enter, unfocusing.");
- mText.setFocused(false);
- }
- else if (par2 == Keyboard.KEY_BACK) {
- log("Pressed Backspace.");
- String aCurrentText = getText();
- if (aCurrentText.length() > 0) {
- this.mText.setText(
- aCurrentText.substring(
- 0, aCurrentText.length() - 1
- )
- );
- if (getText().length() <= 0) {
- setText(0);
- }
- sendUpdateToServer();
- }
- }
- else {
- if (isNumber(par2) || isNumber(par1)) {
- log("Pressed number.");
- if (this.mText.getText().equals("0")) {
- this.mText.textboxKeyTyped(par1, par2);
- sendUpdateToServer();
- }
- else {
- this.mText.textboxKeyTyped(par1, par2);
- sendUpdateToServer();
- }
- }
- else {
- log("Pressed unused key.");
- super.keyTyped(par1, par2);
- }
- }
- }
- else {
- log("Text box not focused.");
- super.keyTyped(par1, par2);
- }
- }
- else {
- log("Gui is not open?");
- }
- }
-
- protected void mouseClicked(int x, int y, int btn) {
- if (mIsOpen) {
- log("Clicked.");
- this.mText.mouseClicked(x, y, btn);
- if (!mText.didClickInTextField(x, y)) {
- log("Did not click in text box, passing to super.");
- super.mouseClicked(x, y, btn);
- }
- }
- else {
- log("Gui is not open?");
- }
- }
-
- @Override
- public void onGuiClosed() {
- mIsOpen = false;
- mText.setEnabled(false);
- mText.setVisible(false);
- super.onGuiClosed();
- // Keyboard.enableRepeatEvents(false);
- }
-
- public int parse(String aValue) {
- try {
- return Integer.parseInt(getText());
- }
- catch (NumberFormatException e) {
- return 0;
- }
- }
-
- public void sendUpdateToServer() {
- if (getText().length() > 0) {
- PacketHandler.sendToServer(new Packet_VolumetricFlaskGui(mTile, parse(getText())));
- }
- }
-
- public void setText(int aValue) {
- this.mText.setText("" + aValue);
- }
-
- public void updateScreen() {
- super.updateScreen();
- // Update Textbox to 0 if Empty
- if (getText().length() <= 0) {
- this.mText.setText("0");
- sendUpdateToServer();
- }
- this.mText.updateCursorCounter();
-
- // Check TextBox Value is correct
- if (getText().length() > 0) {
- int aCustomValue = parse(getText());
- int aTileValue = ((Container_VolumetricFlaskSetter) mContainer).mCustomValue;
- if (mContainer != null) {
- if (aTileValue != aCustomValue) {
- setText(aTileValue);
- }
- }
- }
- }
-
- public void log(String aString) {
- Logger.INFO("[Flask-GUI] "+aString);
- }
-
+ private static final ResourceLocation mGuiTextures =
+ new ResourceLocation(CORE.MODID, "textures/gui/VolumetricFlaskSetter.png");
+ private Container_VolumetricFlaskSetter mContainer;
+ private boolean mIsOpen = false;
+ private GuiValueField mText;
+ private TileEntityVolumetricFlaskSetter mTile;
+
+ public GUI_VolumetricFlaskSetter(Container_VolumetricFlaskSetter aContainer) {
+ super(aContainer);
+ mContainer = aContainer;
+ mTile = mContainer.mTileEntity;
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(mGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j) {
+ super.drawGuiContainerForegroundLayer(i, j);
+ this.mText.drawTextBox();
+ this.fontRendererObj.drawString(I18n.format("container.VolumetricFlaskSetter", new Object[0]), 4, 3, 4210752);
+ int aYVal = 49;
+ this.fontRendererObj.drawString(I18n.format("0 = 16l", new Object[0]), 8, aYVal, 4210752);
+ this.fontRendererObj.drawString(I18n.format("4 = 576l", new Object[0]), 64, aYVal, 4210752);
+ this.fontRendererObj.drawString(I18n.format("1 = 36l", new Object[0]), 8, aYVal += 8, 4210752);
+ this.fontRendererObj.drawString(I18n.format("5 = 720l", new Object[0]), 64, aYVal, 4210752);
+ this.fontRendererObj.drawString(I18n.format("2 = 144l", new Object[0]), 8, aYVal += 8, 4210752);
+ this.fontRendererObj.drawString(I18n.format("6 = 864l", new Object[0]), 64, aYVal, 4210752);
+ this.fontRendererObj.drawString(I18n.format("3 = 432l", new Object[0]), 8, aYVal += 8, 4210752);
+ this.fontRendererObj.drawString(I18n.format("-> = Custom", new Object[0]), 59, aYVal, 4210752);
+ }
+
+ public void drawScreen(int par1, int par2, float par3) {
+ this.drawDefaultBackground();
+ super.drawScreen(par1, par2, par3);
+ }
+
+ protected String getText() {
+ return this.mText.getText();
+ }
+
+ public void initGui() {
+ super.initGui();
+ // Keyboard.enableRepeatEvents(true);
+ mIsOpen = true;
+ this.mText = new GuiValueField(
+ this.fontRendererObj, 26, 31, this.width / 2 - 62, this.height / 2 - 52, 106, 14, this);
+ mText.setMaxStringLength(5);
+ mText.setEnableBackgroundDrawing(true);
+ mText.setText("0");
+ mText.setFocused(true);
+ }
+
+ public boolean isNumber(char c) {
+ boolean isNum = ((c >= 48 && c <= 57) || c == 45);
+ if (isNum) {
+ log("Found Digit: " + c + " | char value");
+ } else {
+ switch (c) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ log("Found Digit: " + c + " | char switch");
+ return true;
+ }
+ }
+ return isNum;
+ }
+
+ public boolean isNumber(int c) {
+ switch (c) {
+ case Keyboard.KEY_0:
+ case Keyboard.KEY_1:
+ case Keyboard.KEY_2:
+ case Keyboard.KEY_3:
+ case Keyboard.KEY_4:
+ case Keyboard.KEY_5:
+ case Keyboard.KEY_6:
+ case Keyboard.KEY_7:
+ case Keyboard.KEY_8:
+ case Keyboard.KEY_9:
+ case Keyboard.KEY_NUMPAD0:
+ case Keyboard.KEY_NUMPAD1:
+ case Keyboard.KEY_NUMPAD2:
+ case Keyboard.KEY_NUMPAD3:
+ case Keyboard.KEY_NUMPAD4:
+ case Keyboard.KEY_NUMPAD5:
+ case Keyboard.KEY_NUMPAD6:
+ case Keyboard.KEY_NUMPAD7:
+ case Keyboard.KEY_NUMPAD8:
+ case Keyboard.KEY_NUMPAD9:
+ log("Found Digit: " + Keyboard.getKeyName(c) + " | LWJGL Keybinding");
+ return true;
+ }
+ return false;
+ }
+
+ protected void keyTyped(char par1, int par2) {
+ if (mIsOpen) {
+ log("Pressed " + par1 + " | " + par2);
+ if (mText.isFocused()) {
+ log("Text box has focus.");
+ if (par2 == Keyboard.KEY_RETURN) {
+ log("Pressed Enter, unfocusing.");
+ mText.setFocused(false);
+ } else if (par2 == Keyboard.KEY_BACK) {
+ log("Pressed Backspace.");
+ String aCurrentText = getText();
+ if (aCurrentText.length() > 0) {
+ this.mText.setText(aCurrentText.substring(0, aCurrentText.length() - 1));
+ if (getText().length() <= 0) {
+ setText(0);
+ }
+ sendUpdateToServer();
+ }
+ } else {
+ if (isNumber(par2) || isNumber(par1)) {
+ log("Pressed number.");
+ if (this.mText.getText().equals("0")) {
+ this.mText.textboxKeyTyped(par1, par2);
+ sendUpdateToServer();
+ } else {
+ this.mText.textboxKeyTyped(par1, par2);
+ sendUpdateToServer();
+ }
+ } else {
+ log("Pressed unused key.");
+ super.keyTyped(par1, par2);
+ }
+ }
+ } else {
+ log("Text box not focused.");
+ super.keyTyped(par1, par2);
+ }
+ } else {
+ log("Gui is not open?");
+ }
+ }
+
+ protected void mouseClicked(int x, int y, int btn) {
+ if (mIsOpen) {
+ log("Clicked.");
+ this.mText.mouseClicked(x, y, btn);
+ if (!mText.didClickInTextField(x, y)) {
+ log("Did not click in text box, passing to super.");
+ super.mouseClicked(x, y, btn);
+ }
+ } else {
+ log("Gui is not open?");
+ }
+ }
+
+ @Override
+ public void onGuiClosed() {
+ mIsOpen = false;
+ mText.setEnabled(false);
+ mText.setVisible(false);
+ super.onGuiClosed();
+ // Keyboard.enableRepeatEvents(false);
+ }
+
+ public int parse(String aValue) {
+ try {
+ return Integer.parseInt(getText());
+ } catch (NumberFormatException e) {
+ return 0;
+ }
+ }
+
+ public void sendUpdateToServer() {
+ if (getText().length() > 0) {
+ PacketHandler.sendToServer(new Packet_VolumetricFlaskGui(mTile, parse(getText())));
+ }
+ }
+
+ public void setText(int aValue) {
+ this.mText.setText("" + aValue);
+ }
+
+ public void updateScreen() {
+ super.updateScreen();
+ // Update Textbox to 0 if Empty
+ if (getText().length() <= 0) {
+ this.mText.setText("0");
+ sendUpdateToServer();
+ }
+ this.mText.updateCursorCounter();
+
+ // Check TextBox Value is correct
+ if (getText().length() > 0) {
+ int aCustomValue = parse(getText());
+ int aTileValue = ((Container_VolumetricFlaskSetter) mContainer).mCustomValue;
+ if (mContainer != null) {
+ if (aTileValue != aCustomValue) {
+ setText(aTileValue);
+ }
+ }
+ }
+ }
+
+ public void log(String aString) {
+ Logger.INFO("[Flask-GUI] " + aString);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java b/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java
index c9c294ea1c..97ccf0b248 100644
--- a/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java
+++ b/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java
@@ -1,98 +1,112 @@
package gtPlusPlus.core.gui.widget;
-import java.lang.reflect.Field;
-
import gtPlusPlus.core.gui.machine.GUI_VolumetricFlaskSetter;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.DevHelper;
+import java.lang.reflect.Field;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiTextField;
public class GuiValueField extends GuiTextField {
- private final FontRenderer mFontRenderer;
- private final int mScreenLocationX;
- private final int mScreenLocationY;
- private final GUI_VolumetricFlaskSetter mGUI;
+ private final FontRenderer mFontRenderer;
+ private final int mScreenLocationX;
+ private final int mScreenLocationY;
+ private final GUI_VolumetricFlaskSetter mGUI;
- public GuiValueField(FontRenderer aFontRenderer, int aX, int aY, int aScreenLocationX, int aScreenLocationY, int aWidth, int aHeight, GUI_VolumetricFlaskSetter aGUI) {
- super(aFontRenderer, aX, aY, aWidth, aHeight);
- mFontRenderer = aFontRenderer;
- mScreenLocationX = aScreenLocationX;
- mScreenLocationY = aScreenLocationY;
- mGUI = aGUI;
- }
+ public GuiValueField(
+ FontRenderer aFontRenderer,
+ int aX,
+ int aY,
+ int aScreenLocationX,
+ int aScreenLocationY,
+ int aWidth,
+ int aHeight,
+ GUI_VolumetricFlaskSetter aGUI) {
+ super(aFontRenderer, aX, aY, aWidth, aHeight);
+ mFontRenderer = aFontRenderer;
+ mScreenLocationX = aScreenLocationX;
+ mScreenLocationY = aScreenLocationY;
+ mGUI = aGUI;
+ }
- public boolean canLoseFocus() {
- Field canLoseFocus = ReflectionUtils.getField(GuiTextField.class, DevHelper.isObfuscatedEnvironment() ? "field_146212_n" : "canLoseFocus");
- if (canLoseFocus != null) {
- return (boolean) ReflectionUtils.getFieldValue(canLoseFocus, this);
- }
- return true;
- }
+ public boolean canLoseFocus() {
+ Field canLoseFocus = ReflectionUtils.getField(
+ GuiTextField.class, DevHelper.isObfuscatedEnvironment() ? "field_146212_n" : "canLoseFocus");
+ if (canLoseFocus != null) {
+ return (boolean) ReflectionUtils.getFieldValue(canLoseFocus, this);
+ }
+ return true;
+ }
- @Override
- public boolean isFocused() {
- return super.isFocused();
- }
+ @Override
+ public boolean isFocused() {
+ return super.isFocused();
+ }
- public boolean isBackgroundDrawingEnabled() {
- Field enableBackgroundDrawing = ReflectionUtils.getField(GuiTextField.class, DevHelper.isObfuscatedEnvironment() ? "field_146215_m" : "enableBackgroundDrawing");
- if (enableBackgroundDrawing != null) {
- return (boolean) ReflectionUtils.getFieldValue(enableBackgroundDrawing, this);
- }
- return true;
- }
-
- public int getLineScrollOffset() {
- Field lineScrollOffset = ReflectionUtils.getField(GuiTextField.class, DevHelper.isObfuscatedEnvironment() ? "field_146225_q" : "lineScrollOffset");
- if (lineScrollOffset != null) {
- return (int) ReflectionUtils.getFieldValue(lineScrollOffset, this);
- }
- return 0;
- }
+ public boolean isBackgroundDrawingEnabled() {
+ Field enableBackgroundDrawing = ReflectionUtils.getField(
+ GuiTextField.class, DevHelper.isObfuscatedEnvironment() ? "field_146215_m" : "enableBackgroundDrawing");
+ if (enableBackgroundDrawing != null) {
+ return (boolean) ReflectionUtils.getFieldValue(enableBackgroundDrawing, this);
+ }
+ return true;
+ }
- public boolean didClickInTextField(int aX, int aY) {
- mGUI.log("Clicked at X:"+aX+", Y:"+aY);
- boolean aDidClick = aX >= this.mScreenLocationX && aX < this.mScreenLocationX + this.width && aY >= this.mScreenLocationY && aY < this.mScreenLocationY + this.height;
- mGUI.log("Did click in textbox? "+aDidClick);
- mGUI.log("Expected Region: X:"+mScreenLocationX+"-"+(this.mScreenLocationX + this.width));
- mGUI.log("Expected Region: Y:"+mScreenLocationY+"-"+(this.mScreenLocationY + this.height));
- return aDidClick;
- }
+ public int getLineScrollOffset() {
+ Field lineScrollOffset = ReflectionUtils.getField(
+ GuiTextField.class, DevHelper.isObfuscatedEnvironment() ? "field_146225_q" : "lineScrollOffset");
+ if (lineScrollOffset != null) {
+ return (int) ReflectionUtils.getFieldValue(lineScrollOffset, this);
+ }
+ return 0;
+ }
- /**
- * Args: x, y, buttonClicked
- */
- @Override
- public void mouseClicked(int aX, int aY, int aButton){
- boolean aDidClick = didClickInTextField(aX, aY);
+ public boolean didClickInTextField(int aX, int aY) {
+ mGUI.log("Clicked at X:" + aX + ", Y:" + aY);
+ boolean aDidClick = aX >= this.mScreenLocationX
+ && aX < this.mScreenLocationX + this.width
+ && aY >= this.mScreenLocationY
+ && aY < this.mScreenLocationY + this.height;
+ mGUI.log("Did click in textbox? " + aDidClick);
+ mGUI.log("Expected Region: X:" + mScreenLocationX + "-" + (this.mScreenLocationX + this.width));
+ mGUI.log("Expected Region: Y:" + mScreenLocationY + "-" + (this.mScreenLocationY + this.height));
+ return aDidClick;
+ }
- mGUI.log("Did click inside text box? "+aDidClick);
- mGUI.log("Focus 1: "+this.isFocused());
- this.setFocused(aDidClick);
- mGUI.log("Focus 2: "+this.isFocused());
- if (isFocused()) {
- int l = aX - this.mScreenLocationX;
- if (isBackgroundDrawingEnabled()) {
- l -= 4;
- }
- if (aButton == 0) {
- mGUI.log("Left clicked in text box.");
- String s = this.mFontRenderer.trimStringToWidth(this.getText().substring(getLineScrollOffset()), this.getWidth());
- this.setCursorPosition(this.mFontRenderer.trimStringToWidth(s, l).length() + getLineScrollOffset());
- }
- else if (aButton == 1) {
- mGUI.log("Right clicked in text box.");
- mGUI.setText(0);
- mGUI.sendUpdateToServer();
- String s = this.mFontRenderer.trimStringToWidth(this.getText().substring(getLineScrollOffset()), this.getWidth());
- this.setCursorPosition(this.mFontRenderer.trimStringToWidth(s, l).length() + getLineScrollOffset());
- }
- }
- else {
- mGUI.log("Clicked, but no focus.");
- }
- }
+ /**
+ * Args: x, y, buttonClicked
+ */
+ @Override
+ public void mouseClicked(int aX, int aY, int aButton) {
+ boolean aDidClick = didClickInTextField(aX, aY);
+ mGUI.log("Did click inside text box? " + aDidClick);
+ mGUI.log("Focus 1: " + this.isFocused());
+ this.setFocused(aDidClick);
+ mGUI.log("Focus 2: " + this.isFocused());
+ if (isFocused()) {
+ int l = aX - this.mScreenLocationX;
+ if (isBackgroundDrawingEnabled()) {
+ l -= 4;
+ }
+ if (aButton == 0) {
+ mGUI.log("Left clicked in text box.");
+ String s = this.mFontRenderer.trimStringToWidth(
+ this.getText().substring(getLineScrollOffset()), this.getWidth());
+ this.setCursorPosition(
+ this.mFontRenderer.trimStringToWidth(s, l).length() + getLineScrollOffset());
+ } else if (aButton == 1) {
+ mGUI.log("Right clicked in text box.");
+ mGUI.setText(0);
+ mGUI.sendUpdateToServer();
+ String s = this.mFontRenderer.trimStringToWidth(
+ this.getText().substring(getLineScrollOffset()), this.getWidth());
+ this.setCursorPosition(
+ this.mFontRenderer.trimStringToWidth(s, l).length() + getLineScrollOffset());
+ }
+ } else {
+ mGUI.log("Clicked, but no focus.");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java b/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java
index fa10f4def3..8fe7c355d5 100644
--- a/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java
@@ -1,15 +1,11 @@
package gtPlusPlus.core.handler;
-import java.util.concurrent.ConcurrentHashMap;
-
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemSmeltedEvent;
-import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_Log;
-import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.item.ModItems;
@@ -21,6 +17,7 @@ import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
+import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
@@ -30,392 +27,396 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
public class AchievementHandler {
-
- public ConcurrentHashMap<String, Achievement> achievementList = new ConcurrentHashMap<String, Achievement>();
- public ConcurrentHashMap<String, Boolean> issuedAchievements = new ConcurrentHashMap<String, Boolean>();
-
- public int adjX = 5;
- public int adjY = 9;
-
- private static final String aBaseAchievementName = "gtpp.start";
-
- public AchievementHandler() {
-
- Logger.INFO("Initializing GT++ achievements");
- GT_Log.out.println("Initializing GT++ achievements");
-
- //register first
- this.registerAchievement(aBaseAchievementName, 0, 0, MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(MetaGeneratedGregtechTools.ANGLE_GRINDER, 1, Materials.Osmium, Materials.Osmium, null), "", true);
-
- //Useful Info
- boolean cores = CORE.ConfigSwitches.requireControlCores;
- if (cores || GregtechMeta_MultiBlockBase.DEBUG_DISABLE_CORES_TEMPORARILY) {
- this.registerAchievement("hatch.control", -2, -2, GregtechItemList.Hatch_Control_Core.get(1), aBaseAchievementName, false);
- }
- this.registerAchievement("hatch.dynamo.buffered", 2, -2, GregtechItemList.Hatch_Buffer_Dynamo_IV.get(1), aBaseAchievementName, false);
- //First multi anyone really needs
- this.registerAchievement("multi.abs", -4, -2, GregtechItemList.Industrial_AlloyBlastSmelter.get(1), cores ? "hatch.control" : aBaseAchievementName, true);
-
- //Material Advancement
- this.registerAchievement("dust.potin", 0, 2, ALLOY.POTIN.getDust(1), aBaseAchievementName, false);
- this.registerAchievement("dust.eglin", 0, 4, ALLOY.EGLIN_STEEL.getDust(1), "dust.potin", false);
- this.registerAchievement("dust.staballoy", 0, 6, ALLOY.STABALLOY.getDust(1), "dust.eglin", false);
- this.registerAchievement("dust.quantum", 0, 8, ALLOY.QUANTUM.getDust(1), "dust.staballoy", true);
- this.registerAchievement("dust.hypogen", 0, 10, ELEMENT.STANDALONE.HYPOGEN.getDust(1), "dust.quantum", true);
-
-
- //Blocks
- this.registerAchievement("block.fishtrap", -2, 2, ItemUtils.getSimpleStack(ModBlocks.blockFishTrap), "dust.potin", false);
- this.registerAchievement("block.withercage", -2, 4, ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard), "dust.eglin", false);
-
-
- //Machines (-10/-8/-6)
- this.registerAchievement("rtg", -16, -10, GregtechItemList.RTG.get(1), aBaseAchievementName, false);
- this.registerAchievement("dehydrate", -15, -10, GregtechItemList.GT_Dehydrator_HV.get(1), aBaseAchievementName, false);
- this.registerAchievement("semifluid", -14, -10, GregtechItemList.Generator_SemiFluid_HV.get(1), aBaseAchievementName, false);
- this.registerAchievement("earlywasher", -13, -10, GregtechItemList.SimpleDustWasher_ULV.get(1), aBaseAchievementName, false);
- this.registerAchievement("advancedsteam", -12, -10, GregtechItemList.Boiler_Advanced_MV.get(1), aBaseAchievementName, false);
- if (PollutionUtils.isPollutionEnabled()) {
- this.registerAchievement("pollutionremoval", -11, -10, GregtechItemList.Pollution_Cleaner_IV.get(1), aBaseAchievementName, false);
- }
- this.registerAchievement("hiampxform", -10, -10, GregtechItemList.Transformer_HA_HV_MV.get(1), aBaseAchievementName, false);
-
-
- //Multis (-4/-2/0)
- this.registerAchievement("multi.pss", -16, -7, GregtechItemList.PowerSubStation.get(1), "multi.abs", false);
- this.registerAchievement("multi.cyclo", -15, -7, GregtechItemList.COMET_Cyclotron.get(1), "multi.abs", false);
- this.registerAchievement("multi.sifter", -14, -7, GregtechItemList.Industrial_Sifter.get(1), "dust.eglin", false);
- this.registerAchievement("multi.cokeoven", -13, -7, GregtechItemList.Industrial_CokeOven.get(1), "multi.abs", false);
- this.registerAchievement("multi.boiler.thermal", -12, -7, GregtechItemList.GT4_Thermal_Boiler.get(1), "multi.abs", false);
- this.registerAchievement("multi.zhuhai", -11, -7, GregtechItemList.Industrial_FishingPond.get(1), aBaseAchievementName, false);
- //this.registerAchievement("rtg", -4, -4, GregtechItemList.RTG.get(1), aBaseAchievementName, false);
-
- //Casings
- this.registerAchievement("casing.abs", 2, -10, GregtechItemList.Casing_Coil_BlastSmelter.get(1), aBaseAchievementName, false);
- this.registerAchievement("casing.cyclotron.coil", 3, -10, GregtechItemList.Casing_Cyclotron_Coil.get(1), aBaseAchievementName, false);
- this.registerAchievement("casing.multiuse", 4, -10, GregtechItemList.Casing_Multi_Use.get(1), aBaseAchievementName, false);
- this.registerAchievement("casing.containment", 5, -10, GregtechItemList.Casing_Containment.get(1), aBaseAchievementName, false);
-
-
-
-
-
-
-
-
- //Radioactive
- this.registerAchievement("decay.neptunium238", 11, 8, ItemUtils.getSimpleStack(ModItems.dustNeptunium238), "multi.cyclo", false);
- this.registerAchievement("decay.radium226", 12, 8, ItemUtils.getSimpleStack(ModItems.dustRadium226), "multi.cyclo", false);
- this.registerAchievement("decay.molybdenum99", 13, 8, ItemUtils.getSimpleStack(ModItems.dustMolybdenum99), "multi.cyclo", false);
- this.registerAchievement("decay.technetium99m", 14, 8, ItemUtils.getSimpleStack(ModItems.dustTechnetium99M), "multi.cyclo", false);
- this.registerAchievement("decay.technetium99", 15, 8, ItemUtils.getSimpleStack(ModItems.dustTechnetium99), "multi.cyclo", false);
-
-
-
-
-
-
-
-
-
-
-
-
- AchievementPage.registerAchievementPage(
- new AchievementPage("GT++", (Achievement[]) ((Achievement[]) this.achievementList.values()
- .toArray(new Achievement[this.achievementList.size()]))));
- MinecraftForge.EVENT_BUS.register(this);
- FMLCommonHandler.instance().bus().register(this);
-
-
- }
-
- public Achievement registerAchievement(String textId, int x, int y, ItemStack icon, Achievement requirement,
- boolean special) {
- Achievement achievement = new Achievement(textId, textId, this.adjX + x, this.adjY + y, icon, requirement);
- if (special) {
- achievement.setSpecial();
- }
-
- achievement.registerStat();
- if (CORE.DEVENV) {
- GT_Log.out.println("achievement." + textId + "=");
- GT_Log.out.println("achievement." + textId + ".desc=");
- }
-
- this.achievementList.put(textId, achievement);
- return achievement;
- }
-
- public Achievement registerAchievement(String textId, int x, int y, ItemStack icon, String requirement,
- boolean special) {
- Achievement achievement = new Achievement(textId, textId, this.adjX + x, this.adjY + y, icon,
- this.getAchievement(requirement));
- if (special) {
- achievement.setSpecial();
- }
-
- achievement.registerStat();
- if (CORE.DEVENV) {
- GT_Log.out.println("achievement." + textId + "=");
- GT_Log.out.println("achievement." + textId + ".desc=");
- }
-
- this.achievementList.put(textId, achievement);
- return achievement;
- }
-
- public void issueAchievement(EntityPlayer entityplayer, String textId) {
- if (entityplayer != null) {
- entityplayer.triggerAchievement((StatBase) this.achievementList.get(textId));
- }
- }
-
- public Achievement getAchievement(String textId) {
- return this.achievementList.containsKey(textId) ? (Achievement) this.achievementList.get(textId) : null;
- }
-
-
- /**
- * A generic handler that will give an achievement for an item.
- * Useful to only write this once, then call it from all handlers.
- * @param aStack - The Itemstack to check for achievements.
- * @param aPlayer - The player to unlock for.
- */
- private void handleAchivement(ItemStack aStack, EntityPlayer aPlayer) {
-
- if (aPlayer != null && aStack != null) {
- /*
- * Copy this to all events because I am lazy - Alk 2019
- */
-
- //Safe name
- String aUnlocalName = ItemUtils.getUnlocalizedItemName(aStack);
-
-
- boolean isValid = false;
- //Check if valid name // mod
- String aModID = ItemUtils.getModId(aStack);
-
- if (aModID == null || aModID.length() <= 0 || aModID.isEmpty()) {
- return;
- }
-
- if (aModID != null && (ItemUtils.getModId(aStack).equals(CORE.MODID) || ItemUtils.getModId(aStack).equalsIgnoreCase("gregtech"))) {
- isValid = true;
- }
- if (!isValid) {
- return;
- }
-
- //Should unlock base achievement from *ANY* GT++ item. (Too lazy to special case GT machineBlocks though)
- if (ItemUtils.getModId(aStack).equals(CORE.MODID)) {
- this.issueAchievement(aPlayer, aBaseAchievementName);
- }
-
- if (aUnlocalName.contains("item.")) {
- aUnlocalName = aUnlocalName.substring(5);
- }
- else if (aUnlocalName.contains("tile.")) {
- aUnlocalName = aUnlocalName.substring(5);
- }
-
- //Logger.INFO("Picked up "+aUnlocalName);
-
-
- /**
- * Misc Blocks
- */
-
- if (aUnlocalName.equals("blockFishTrap")) {
- this.issueAchievement(aPlayer, "block.fishtrap");
- }
- if (aUnlocalName.equals("blockBlackGate")) {
- this.issueAchievement(aPlayer, "block.withercage");
- }
-
-
- /**
- * Decayables
- */
- if (aUnlocalName.equals("dustNeptunium238")) {
- this.issueAchievement(aPlayer, "decay.neptunium238");
- }
- else if (aUnlocalName.equals("dustRadium226")) {
- this.issueAchievement(aPlayer, "decay.radium226");
- }
- else if (aUnlocalName.equals("dustMolybdenum99")) {
- this.issueAchievement(aPlayer, "decay.molybdenum99");
- }
- else if (aUnlocalName.equals("dustTechnetium99M")) {
- this.issueAchievement(aPlayer, "decay.technetium99m");
- }
- else if (aUnlocalName.equals("dustTechnetium99")) {
- this.issueAchievement(aPlayer, "decay.technetium99");
- }
-
- /**
- * Random Materials worthy of Achievements
- */
- else if (aUnlocalName.equals("itemDustPotin")) {
- this.issueAchievement(aPlayer, "dust.potin");
- }
- else if (aUnlocalName.equals("itemDustEglinSteel")) {
- this.issueAchievement(aPlayer, "dust.eglin");
- }
- else if (aUnlocalName.equals("itemDustStaballoy")) {
- this.issueAchievement(aPlayer, "dust.staballoy");
- }
- else if (aUnlocalName.equals("itemDustQuantum")) {
- this.issueAchievement(aPlayer, "dust.quantum");
- }
- else if (aUnlocalName.equals("itemDustHypogen")) {
- this.issueAchievement(aPlayer, "dust.hypogen");
- }
-
-
-
- /**
- * Machines
- */
-
- else if (aUnlocalName.startsWith("gt.blockmachines.")) {
-
- //Readability
- String aStartsWith = "gt.blockmachines.";
-
- /**
- * Single Blocks
- */
-
- //RTG
- if (aUnlocalName.startsWith(aStartsWith + "basicgenerator.rtg")) {
- this.issueAchievement(aPlayer, "rtg");
- }
- //Dehydrator
- else if (aUnlocalName.startsWith(aStartsWith + "machine.dehydrator.tier.")) {
- this.issueAchievement(aPlayer, "dehydrate");
- }
- //SemiFluids
- else if (aUnlocalName.startsWith(aStartsWith + "basicgenerator.semifluid.tier.")) {
- this.issueAchievement(aPlayer, "semifluid");
- }
- //Simple Washer
- else if (aUnlocalName.startsWith(aStartsWith + "simplewasher.01.tier.")) {
- this.issueAchievement(aPlayer, "earlywasher");
- }
- //Advanced Boilers
- else if (aUnlocalName.startsWith(aStartsWith + "electricboiler.")) {
- this.issueAchievement(aPlayer, "advancedsteam");
- }
- //Scrubers
- else if (aUnlocalName.startsWith(aStartsWith + "pollutioncleaner.01.tier.")) {
- this.issueAchievement(aPlayer, "pollutionremoval");
- }
- //High-amp xformers
- else if (aUnlocalName.startsWith(aStartsWith + "transformer.ha.tier.")) {
- this.issueAchievement(aPlayer, "hiampxform");
- }
- //Buffered Dynamos
- else if (aUnlocalName.startsWith(aStartsWith + "hatch.dynamo.buffer.tier.")) {
- this.issueAchievement(aPlayer, "hatch.dynamo.buffered");
- }
- //Control Core Hatch
- else if (aUnlocalName.startsWith(aStartsWith + "hatch.control.adv")) {
- this.issueAchievement(aPlayer, "hatch.control");
- }
-
-
-
- /**
- * Multis
- */
-
- //ABS
- else if (aUnlocalName.equals(aStartsWith + "industrialsalloyamelter.controller.tier.single")) {
- this.issueAchievement(aPlayer, "multi.abs");
- }
- //PSS
- else if (aUnlocalName.equals(aStartsWith + "substation.01.input.single")) {
- this.issueAchievement(aPlayer, "multi.pss");
- }
- //Cyclotron
- else if (aUnlocalName.startsWith(aStartsWith + "cyclotron.tier.single")) {
- this.issueAchievement(aPlayer, "multi.cyclo");
- }
- //Sifter
- else if (aUnlocalName.equals(aStartsWith + "industrialsifter.controller.tier.single")) {
- this.issueAchievement(aPlayer, "multi.sifter");
- }
- //Coke Oven
- else if (aUnlocalName.equals(aStartsWith + "industrialcokeoven.controller.tier.single")) {
- this.issueAchievement(aPlayer, "multi.cokeoven");
- }
- //Thermal Boiler
- else if (aUnlocalName.equals(aStartsWith + "gtplusplus.thermal.boiler")) {
- this.issueAchievement(aPlayer, "multi.boiler.thermal");
- }
- //Zhuhai
- else if (aUnlocalName.equals(aStartsWith + "industrial.fishpond.controller.tier.single")) {
- this.issueAchievement(aPlayer, "multi.zhuhai");
- }
-
- }
-
- /**
- * Casings
- */
-
- else if (aUnlocalName.equals("gtplusplus.blockcasings.14")) {
- this.issueAchievement(aPlayer, "casing.abs");
- }
-
- else if (aUnlocalName.equals("gtplusplus.blockcasings.2.9")) {
- this.issueAchievement(aPlayer, "casing.cyclotron.coil");
- }
-
- else if (aUnlocalName.equals("gtplusplus.blockcasings.3.2")) {
- this.issueAchievement(aPlayer, "casing.multiuse");
- }
- else if (aUnlocalName.equals("gtplusplus.blockcasings.3.15")) {
- this.issueAchievement(aPlayer, "casing.containment");
- }
- }
- }
-
-
-
-
- /*
- * Handle achievements for all vanilla types of obtianment.
- */
-
-
-
- @SubscribeEvent
- public void onCrafting(ItemCraftedEvent event) {
- EntityPlayer player = event.player;
- ItemStack stack = event.crafting;
- if (player != null && stack != null) {
- handleAchivement(stack, player);
- }
- }
-
- @SubscribeEvent
- public void onSmelting(ItemSmeltedEvent event) {
- EntityPlayer player = event.player;
- ItemStack stack = event.smelting;
- if (player != null && stack != null) {
- handleAchivement(stack, player);
- }
- }
-
- @SubscribeEvent
- public void onItemPickup(EntityItemPickupEvent event) {
- EntityPlayer player = event.entityPlayer;
- ItemStack stack = event.item.getEntityItem();
- if (player != null && stack != null) {
- handleAchivement(stack, player);
- }
- }
-} \ No newline at end of file
+
+ public ConcurrentHashMap<String, Achievement> achievementList = new ConcurrentHashMap<String, Achievement>();
+ public ConcurrentHashMap<String, Boolean> issuedAchievements = new ConcurrentHashMap<String, Boolean>();
+
+ public int adjX = 5;
+ public int adjY = 9;
+
+ private static final String aBaseAchievementName = "gtpp.start";
+
+ public AchievementHandler() {
+
+ Logger.INFO("Initializing GT++ achievements");
+ GT_Log.out.println("Initializing GT++ achievements");
+
+ // register first
+ this.registerAchievement(
+ aBaseAchievementName,
+ 0,
+ 0,
+ MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
+ MetaGeneratedGregtechTools.ANGLE_GRINDER, 1, Materials.Osmium, Materials.Osmium, null),
+ "",
+ true);
+
+ // Useful Info
+ boolean cores = CORE.ConfigSwitches.requireControlCores;
+ if (cores || GregtechMeta_MultiBlockBase.DEBUG_DISABLE_CORES_TEMPORARILY) {
+ this.registerAchievement(
+ "hatch.control", -2, -2, GregtechItemList.Hatch_Control_Core.get(1), aBaseAchievementName, false);
+ }
+ this.registerAchievement(
+ "hatch.dynamo.buffered",
+ 2,
+ -2,
+ GregtechItemList.Hatch_Buffer_Dynamo_IV.get(1),
+ aBaseAchievementName,
+ false);
+ // First multi anyone really needs
+ this.registerAchievement(
+ "multi.abs",
+ -4,
+ -2,
+ GregtechItemList.Industrial_AlloyBlastSmelter.get(1),
+ cores ? "hatch.control" : aBaseAchievementName,
+ true);
+
+ // Material Advancement
+ this.registerAchievement("dust.potin", 0, 2, ALLOY.POTIN.getDust(1), aBaseAchievementName, false);
+ this.registerAchievement("dust.eglin", 0, 4, ALLOY.EGLIN_STEEL.getDust(1), "dust.potin", false);
+ this.registerAchievement("dust.staballoy", 0, 6, ALLOY.STABALLOY.getDust(1), "dust.eglin", false);
+ this.registerAchievement("dust.quantum", 0, 8, ALLOY.QUANTUM.getDust(1), "dust.staballoy", true);
+ this.registerAchievement("dust.hypogen", 0, 10, ELEMENT.STANDALONE.HYPOGEN.getDust(1), "dust.quantum", true);
+
+ // Blocks
+ this.registerAchievement(
+ "block.fishtrap", -2, 2, ItemUtils.getSimpleStack(ModBlocks.blockFishTrap), "dust.potin", false);
+ this.registerAchievement(
+ "block.withercage", -2, 4, ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard), "dust.eglin", false);
+
+ // Machines (-10/-8/-6)
+ this.registerAchievement("rtg", -16, -10, GregtechItemList.RTG.get(1), aBaseAchievementName, false);
+ this.registerAchievement(
+ "dehydrate", -15, -10, GregtechItemList.GT_Dehydrator_HV.get(1), aBaseAchievementName, false);
+ this.registerAchievement(
+ "semifluid", -14, -10, GregtechItemList.Generator_SemiFluid_HV.get(1), aBaseAchievementName, false);
+ this.registerAchievement(
+ "earlywasher", -13, -10, GregtechItemList.SimpleDustWasher_ULV.get(1), aBaseAchievementName, false);
+ this.registerAchievement(
+ "advancedsteam", -12, -10, GregtechItemList.Boiler_Advanced_MV.get(1), aBaseAchievementName, false);
+ if (PollutionUtils.isPollutionEnabled()) {
+ this.registerAchievement(
+ "pollutionremoval",
+ -11,
+ -10,
+ GregtechItemList.Pollution_Cleaner_IV.get(1),
+ aBaseAchievementName,
+ false);
+ }
+ this.registerAchievement(
+ "hiampxform", -10, -10, GregtechItemList.Transformer_HA_HV_MV.get(1), aBaseAchievementName, false);
+
+ // Multis (-4/-2/0)
+ this.registerAchievement("multi.pss", -16, -7, GregtechItemList.PowerSubStation.get(1), "multi.abs", false);
+ this.registerAchievement("multi.cyclo", -15, -7, GregtechItemList.COMET_Cyclotron.get(1), "multi.abs", false);
+ this.registerAchievement(
+ "multi.sifter", -14, -7, GregtechItemList.Industrial_Sifter.get(1), "dust.eglin", false);
+ this.registerAchievement(
+ "multi.cokeoven", -13, -7, GregtechItemList.Industrial_CokeOven.get(1), "multi.abs", false);
+ this.registerAchievement(
+ "multi.boiler.thermal", -12, -7, GregtechItemList.GT4_Thermal_Boiler.get(1), "multi.abs", false);
+ this.registerAchievement(
+ "multi.zhuhai", -11, -7, GregtechItemList.Industrial_FishingPond.get(1), aBaseAchievementName, false);
+ // this.registerAchievement("rtg", -4, -4, GregtechItemList.RTG.get(1), aBaseAchievementName, false);
+
+ // Casings
+ this.registerAchievement(
+ "casing.abs", 2, -10, GregtechItemList.Casing_Coil_BlastSmelter.get(1), aBaseAchievementName, false);
+ this.registerAchievement(
+ "casing.cyclotron.coil",
+ 3,
+ -10,
+ GregtechItemList.Casing_Cyclotron_Coil.get(1),
+ aBaseAchievementName,
+ false);
+ this.registerAchievement(
+ "casing.multiuse", 4, -10, GregtechItemList.Casing_Multi_Use.get(1), aBaseAchievementName, false);
+ this.registerAchievement(
+ "casing.containment", 5, -10, GregtechItemList.Casing_Containment.get(1), aBaseAchievementName, false);
+
+ // Radioactive
+ this.registerAchievement(
+ "decay.neptunium238", 11, 8, ItemUtils.getSimpleStack(ModItems.dustNeptunium238), "multi.cyclo", false);
+ this.registerAchievement(
+ "decay.radium226", 12, 8, ItemUtils.getSimpleStack(ModItems.dustRadium226), "multi.cyclo", false);
+ this.registerAchievement(
+ "decay.molybdenum99", 13, 8, ItemUtils.getSimpleStack(ModItems.dustMolybdenum99), "multi.cyclo", false);
+ this.registerAchievement(
+ "decay.technetium99m",
+ 14,
+ 8,
+ ItemUtils.getSimpleStack(ModItems.dustTechnetium99M),
+ "multi.cyclo",
+ false);
+ this.registerAchievement(
+ "decay.technetium99", 15, 8, ItemUtils.getSimpleStack(ModItems.dustTechnetium99), "multi.cyclo", false);
+
+ AchievementPage.registerAchievementPage(new AchievementPage("GT++", (Achievement[])
+ ((Achievement[]) this.achievementList.values().toArray(new Achievement[this.achievementList.size()]))));
+ MinecraftForge.EVENT_BUS.register(this);
+ FMLCommonHandler.instance().bus().register(this);
+ }
+
+ public Achievement registerAchievement(
+ String textId, int x, int y, ItemStack icon, Achievement requirement, boolean special) {
+ Achievement achievement = new Achievement(textId, textId, this.adjX + x, this.adjY + y, icon, requirement);
+ if (special) {
+ achievement.setSpecial();
+ }
+
+ achievement.registerStat();
+ if (CORE.DEVENV) {
+ GT_Log.out.println("achievement." + textId + "=");
+ GT_Log.out.println("achievement." + textId + ".desc=");
+ }
+
+ this.achievementList.put(textId, achievement);
+ return achievement;
+ }
+
+ public Achievement registerAchievement(
+ String textId, int x, int y, ItemStack icon, String requirement, boolean special) {
+ Achievement achievement =
+ new Achievement(textId, textId, this.adjX + x, this.adjY + y, icon, this.getAchievement(requirement));
+ if (special) {
+ achievement.setSpecial();
+ }
+
+ achievement.registerStat();
+ if (CORE.DEVENV) {
+ GT_Log.out.println("achievement." + textId + "=");
+ GT_Log.out.println("achievement." + textId + ".desc=");
+ }
+
+ this.achievementList.put(textId, achievement);
+ return achievement;
+ }
+
+ public void issueAchievement(EntityPlayer entityplayer, String textId) {
+ if (entityplayer != null) {
+ entityplayer.triggerAchievement((StatBase) this.achievementList.get(textId));
+ }
+ }
+
+ public Achievement getAchievement(String textId) {
+ return this.achievementList.containsKey(textId) ? (Achievement) this.achievementList.get(textId) : null;
+ }
+
+ /**
+ * A generic handler that will give an achievement for an item.
+ * Useful to only write this once, then call it from all handlers.
+ * @param aStack - The Itemstack to check for achievements.
+ * @param aPlayer - The player to unlock for.
+ */
+ private void handleAchivement(ItemStack aStack, EntityPlayer aPlayer) {
+
+ if (aPlayer != null && aStack != null) {
+ /*
+ * Copy this to all events because I am lazy - Alk 2019
+ */
+
+ // Safe name
+ String aUnlocalName = ItemUtils.getUnlocalizedItemName(aStack);
+
+ boolean isValid = false;
+ // Check if valid name // mod
+ String aModID = ItemUtils.getModId(aStack);
+
+ if (aModID == null || aModID.length() <= 0 || aModID.isEmpty()) {
+ return;
+ }
+
+ if (aModID != null
+ && (ItemUtils.getModId(aStack).equals(CORE.MODID)
+ || ItemUtils.getModId(aStack).equalsIgnoreCase("gregtech"))) {
+ isValid = true;
+ }
+ if (!isValid) {
+ return;
+ }
+
+ // Should unlock base achievement from *ANY* GT++ item. (Too lazy to special case GT machineBlocks though)
+ if (ItemUtils.getModId(aStack).equals(CORE.MODID)) {
+ this.issueAchievement(aPlayer, aBaseAchievementName);
+ }
+
+ if (aUnlocalName.contains("item.")) {
+ aUnlocalName = aUnlocalName.substring(5);
+ } else if (aUnlocalName.contains("tile.")) {
+ aUnlocalName = aUnlocalName.substring(5);
+ }
+
+ // Logger.INFO("Picked up "+aUnlocalName);
+
+ /**
+ * Misc Blocks
+ */
+ if (aUnlocalName.equals("blockFishTrap")) {
+ this.issueAchievement(aPlayer, "block.fishtrap");
+ }
+ if (aUnlocalName.equals("blockBlackGate")) {
+ this.issueAchievement(aPlayer, "block.withercage");
+ }
+
+ /**
+ * Decayables
+ */
+ if (aUnlocalName.equals("dustNeptunium238")) {
+ this.issueAchievement(aPlayer, "decay.neptunium238");
+ } else if (aUnlocalName.equals("dustRadium226")) {
+ this.issueAchievement(aPlayer, "decay.radium226");
+ } else if (aUnlocalName.equals("dustMolybdenum99")) {
+ this.issueAchievement(aPlayer, "decay.molybdenum99");
+ } else if (aUnlocalName.equals("dustTechnetium99M")) {
+ this.issueAchievement(aPlayer, "decay.technetium99m");
+ } else if (aUnlocalName.equals("dustTechnetium99")) {
+ this.issueAchievement(aPlayer, "decay.technetium99");
+ }
+
+ /**
+ * Random Materials worthy of Achievements
+ */
+ else if (aUnlocalName.equals("itemDustPotin")) {
+ this.issueAchievement(aPlayer, "dust.potin");
+ } else if (aUnlocalName.equals("itemDustEglinSteel")) {
+ this.issueAchievement(aPlayer, "dust.eglin");
+ } else if (aUnlocalName.equals("itemDustStaballoy")) {
+ this.issueAchievement(aPlayer, "dust.staballoy");
+ } else if (aUnlocalName.equals("itemDustQuantum")) {
+ this.issueAchievement(aPlayer, "dust.quantum");
+ } else if (aUnlocalName.equals("itemDustHypogen")) {
+ this.issueAchievement(aPlayer, "dust.hypogen");
+ }
+
+ /**
+ * Machines
+ */
+ else if (aUnlocalName.startsWith("gt.blockmachines.")) {
+
+ // Readability
+ String aStartsWith = "gt.blockmachines.";
+
+ /**
+ * Single Blocks
+ */
+
+ // RTG
+ if (aUnlocalName.startsWith(aStartsWith + "basicgenerator.rtg")) {
+ this.issueAchievement(aPlayer, "rtg");
+ }
+ // Dehydrator
+ else if (aUnlocalName.startsWith(aStartsWith + "machine.dehydrator.tier.")) {
+ this.issueAchievement(aPlayer, "dehydrate");
+ }
+ // SemiFluids
+ else if (aUnlocalName.startsWith(aStartsWith + "basicgenerator.semifluid.tier.")) {
+ this.issueAchievement(aPlayer, "semifluid");
+ }
+ // Simple Washer
+ else if (aUnlocalName.startsWith(aStartsWith + "simplewasher.01.tier.")) {
+ this.issueAchievement(aPlayer, "earlywasher");
+ }
+ // Advanced Boilers
+ else if (aUnlocalName.startsWith(aStartsWith + "electricboiler.")) {
+ this.issueAchievement(aPlayer, "advancedsteam");
+ }
+ // Scrubers
+ else if (aUnlocalName.startsWith(aStartsWith + "pollutioncleaner.01.tier.")) {
+ this.issueAchievement(aPlayer, "pollutionremoval");
+ }
+ // High-amp xformers
+ else if (aUnlocalName.startsWith(aStartsWith + "transformer.ha.tier.")) {
+ this.issueAchievement(aPlayer, "hiampxform");
+ }
+ // Buffered Dynamos
+ else if (aUnlocalName.startsWith(aStartsWith + "hatch.dynamo.buffer.tier.")) {
+ this.issueAchievement(aPlayer, "hatch.dynamo.buffered");
+ }
+ // Control Core Hatch
+ else if (aUnlocalName.startsWith(aStartsWith + "hatch.control.adv")) {
+ this.issueAchievement(aPlayer, "hatch.control");
+ }
+
+ /**
+ * Multis
+ */
+
+ // ABS
+ else if (aUnlocalName.equals(aStartsWith + "industrialsalloyamelter.controller.tier.single")) {
+ this.issueAchievement(aPlayer, "multi.abs");
+ }
+ // PSS
+ else if (aUnlocalName.equals(aStartsWith + "substation.01.input.single")) {
+ this.issueAchievement(aPlayer, "multi.pss");
+ }
+ // Cyclotron
+ else if (aUnlocalName.startsWith(aStartsWith + "cyclotron.tier.single")) {
+ this.issueAchievement(aPlayer, "multi.cyclo");
+ }
+ // Sifter
+ else if (aUnlocalName.equals(aStartsWith + "industrialsifter.controller.tier.single")) {
+ this.issueAchievement(aPlayer, "multi.sifter");
+ }
+ // Coke Oven
+ else if (aUnlocalName.equals(aStartsWith + "industrialcokeoven.controller.tier.single")) {
+ this.issueAchievement(aPlayer, "multi.cokeoven");
+ }
+ // Thermal Boiler
+ else if (aUnlocalName.equals(aStartsWith + "gtplusplus.thermal.boiler")) {
+ this.issueAchievement(aPlayer, "multi.boiler.thermal");
+ }
+ // Zhuhai
+ else if (aUnlocalName.equals(aStartsWith + "industrial.fishpond.controller.tier.single")) {
+ this.issueAchievement(aPlayer, "multi.zhuhai");
+ }
+
+ }
+
+ /**
+ * Casings
+ */
+ else if (aUnlocalName.equals("gtplusplus.blockcasings.14")) {
+ this.issueAchievement(aPlayer, "casing.abs");
+ } else if (aUnlocalName.equals("gtplusplus.blockcasings.2.9")) {
+ this.issueAchievement(aPlayer, "casing.cyclotron.coil");
+ } else if (aUnlocalName.equals("gtplusplus.blockcasings.3.2")) {
+ this.issueAchievement(aPlayer, "casing.multiuse");
+ } else if (aUnlocalName.equals("gtplusplus.blockcasings.3.15")) {
+ this.issueAchievement(aPlayer, "casing.containment");
+ }
+ }
+ }
+
+ /*
+ * Handle achievements for all vanilla types of obtianment.
+ */
+
+ @SubscribeEvent
+ public void onCrafting(ItemCraftedEvent event) {
+ EntityPlayer player = event.player;
+ ItemStack stack = event.crafting;
+ if (player != null && stack != null) {
+ handleAchivement(stack, player);
+ }
+ }
+
+ @SubscribeEvent
+ public void onSmelting(ItemSmeltedEvent event) {
+ EntityPlayer player = event.player;
+ ItemStack stack = event.smelting;
+ if (player != null && stack != null) {
+ handleAchivement(stack, player);
+ }
+ }
+
+ @SubscribeEvent
+ public void onItemPickup(EntityItemPickupEvent event) {
+ EntityPlayer player = event.entityPlayer;
+ ItemStack stack = event.item.getEntityItem();
+ if (player != null && stack != null) {
+ handleAchivement(stack, player);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/handler/BookHandler.java b/src/main/java/gtPlusPlus/core/handler/BookHandler.java
index 1363a70fe4..747c1055e1 100644
--- a/src/main/java/gtPlusPlus/core/handler/BookHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/BookHandler.java
@@ -1,7 +1,7 @@
package gtPlusPlus.core.handler;
-import java.util.HashMap;
-import java.util.Map;
+import static gtPlusPlus.core.util.Utils.addBookPagesLocalization;
+import static gtPlusPlus.core.util.Utils.addBookTitleLocalization;
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_OreDictUnificator;
@@ -10,415 +10,387 @@ import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import java.util.HashMap;
+import java.util.Map;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
-import static gtPlusPlus.core.util.Utils.addBookPagesLocalization;
-import static gtPlusPlus.core.util.Utils.addBookTitleLocalization;
-
public class BookHandler {
- public static int mBookKeeperCount = 0;
-
- public static Map<Integer, BookTemplate> mBookMap = new HashMap<Integer, BookTemplate>();
-
- public static BookTemplate book_ThermalBoiler;
- public static BookTemplate book_MultiPowerStation;
- public static BookTemplate book_ModularBauble;
- public static BookTemplate book_MultiMachineManual;
- public static BookTemplate book_NuclearManual;
- public static BookTemplate book_MultiChemicalPlant;
-
- public static void run(){
-
- Logger.INFO("Writing books.");
-
- //Thermal Boiler
- book_ThermalBoiler = writeBookTemplate(
- "Manual_Thermal_Boiler", "Thermal Boiler Manual", "GregoriusT",
- new String[] {
- "This Book explains how to set up and run your Thermal Boiler. We are not responsible for any Damage done by this Book itself nor its content.",
- "First you need to craft the following things for a Thermal Boiler to Function: The Main Boiler Block, 20 Thermal Containment Casings, two Input Hatches, two Output Hatches, a bunch of different Tools and a Maintenance Hatch.",
- "To begin the building, lay out the first 3x3 layer of Machine Casings on the ground (with a Hatch in the Middle), then place the Boiler Block facing outward in the middle of one of the 3m wide Sides.",
- "Now grab 3 other Hatches and place them on the remaining three 3m wide Sides also facing outwards. And now the four corners of the Machine need also a Machine Casing. There should only be a Hole left in the middle of the Cube.",
- "So, now place a 3x3 of Machine Casings on top, at the 3rd Layer with the last Hatch in the middle facing outwards as well.",
- "When accessing the Boiler Block, it should now stop telling you, that the structure is incomplete (bottom Line of that Screen). Now go with a bunch of different Tools (Metal Hammer, Rubber Hammer, Screwdriver, Wrench, Soldering Iron and Crowbar)",
- "to the Maintenance Hatch and access it. After that you grab the 6 Tools and rightclick the Slot with each of them in your Hand in the Maintenance GUI. Note that you need Soldering Tin/Lead in your Inventory to use the Soldering Iron.",
- "The Main Block should now tell you that you need to use the Rubber Hammer on it to (re)activate the Machine. The Rubber Hammer can enable and disable Machines. The Machine disables itself after something important broke.",
- "If you want to use Lava with this Device, then you should add a Lava Filter to extract additional Resources from the Lava. If the Filter breaks, the Machine won't explode like a Turbine would. If you use molten Salt, then you won't need a Filter.",
- "You will get Obsidian when processing Lava, however if a Filter is used, you will get sometimes an Ingot instead of a Block of Obsidian. When using molten Salt, you will get the Salt back.",
- "So, now for the Maintenance. After a few Hours of running nonstop, your Boiler will get small Problems, which don't prevent it from running, these Problems just decrease Efficiency. Every Problem listed on the Screen does -10% Efficiency.",
- "To fix these Problems, just go to the Maintenance Hatch and click with the problem corresponding Tool on the Slot to repair. If all six possible runtime Problems happen, the Machine will auto-shutdown no matter what. No Explosion, it's just stopping.",
- "The Thermal Boiler will produce 800 Liters of Steam per tick for about 5 or 6 Liters of Water per tick at reaching 100% Efficiency. In case of Lava it consumes 1666 Liters every Second.",
- "A Thermal Boiler is worth about 33 small Thermal Generators, and as the Boilers get much less Efficient, when not having enough Fuel, you should consider making a large Nether Pump for Lava, or a good Nuclear Reactor for molten Salt.",
- "Input and Output Slots are fully optional, you can place multiple ones of them or even none on the Machine. A Machine without Input couldn't process any Recipes, while a Machine without Output just voids all outputted Items and Liquids.",
- "It might be useful to use the Screwdriver on the Output Hatches to determine what is outputted where." });
-
-
-
- //Test Novel
- book_MultiPowerStation = writeBookTemplate(
- "Manual_Multi_PowerStation",
- "Power Storage & You [Version 0.64]",
- "Alkalus",
- new String[] {
- //Page 1
- "So, when it comes to power storage you really have three separate options:\n"+
- " \n"+
- "Battery Buffers,\n"+
- "Energy Buffers,\n"+
- "The Power Sub-Station\n",
- //Page 2
- "Battery Buffer\n" +
- " \n" +
- "Is rather portable. Allowing you to throw set one up and insert batteries where ever you may need."+"\n"+
- "They output 1A for each battery stored inside, up to a maximum of 16A.",
- //Page 3
- "Energy Buffer\n" +
- " \n" +
- "Is a more optimal choice for storage in your base. Once placed down, they cannot be moved without losing all stored power."+"\n"+
- "Energy Buffers can output 4A from the output side, however accept 16A as input.",
- //Page 4
- "The Power Sub-Station"+
- " \n"+
- "Is used for storing Insane amounts of power later game."+"\n"+
- "Consumes 2% of the average voltage of all energy type hatches every tick."+"\n",
- //Page 5
- "Allows Insertion/Removal of power from the rear face of the controller, swap with a screwdriver."+"\n"+
- "Variable Height Structure, between 4-16Y. Inserted Redox Cells dictate max energy tier of structure."+"\n",
- //Page 6
- "Redox Cells cannot be placed into the Top or Bottom layer and only take up 3xhx3 internally."+"\n"+
- "Different Tier cells CANNOT be mixed together."+"\n",
- //Page 7
- "All Hatches Must be HV at a Minimum, this minimum tier is in place to stop people abusing ULV/LV hatches to lower the avg/t."+"\n"+
- "Currently the GUI will NOT display anything at all until the structure forms, this is a known bug."+"\n",
- //Page 8
- "Valid Hatches:\n"+
- "Energy Hatch,\n"+
- "Dynamo Hatch,\n"+
- "Charging Bus,\n"+
- "Discharging Bus,\n"+
- "Dynamo Buffer,\n"+
- "Multi-Amp Dynamo Hatch.\n\n\n"+
- "Structure MUST contain at least one energy input and one energy output hatch."
- });
-
- //Test Novel
- book_ModularBauble = writeBookTemplate(
- "Manual_Modular_Bauble", "How to: Modular Baubles", "Alkalus",
- new String[] {
- "Concept: This idea came from wanting flexibility. \n" +
- "First step, Build a Modularity table to begin customisation of your Bauble. \n"
- + " After this has been constructed, you can now combine the upgrades listed within this book to improve the baubles level/100.",
- "Defence:\n"
- + "Can be upgraded by combining metal plates with the bauble. \n"
- + " | +1 | Aluminium \n"
- + " | +2 | Stainless Steel \n"
- + " | +3 | Tungsten \n"
- + " | +4 | Tungsten Steel \n"
- + " | +5 | Naquadah \n",
- "There was once a sad and lonely oak tree. \n",
- "There was once a sad and lonely oak tree. \n",
- "There was once a sad and lonely oak tree. \n"});
-
- //Test Novel
- //20/21/22
- book_MultiMachineManual = writeBookTemplate(
- "Manual_Multi_Machine", "Multi-Machine Manual", "Alkalus",
- new String[] {
- "This Multiblock, depending upon the mode used, can function as a variety of different machines. The idea behind this, was that most of these machines are rather niche compared to any others, as such, not used often.",
- "To build, you need to construct a hollow 3x3x3 structure made from Multi-Use casings, With a minimum of 6. Any Casing position can be substituted out with an Input Hatch/Bus, an Output Hatch/Bus, Muffler, Maint. Hatch or Energy Injector Hatch.",
- "The Mode can be set by using a Screwdriver on the controller block. Each mode allows the use of Numbered Circuits, to allow a different machine 'type' for each input bus.",
- "[Metal Work] Mode A - Allows the multiblock to function as a Compressor, a Lathe or an Electro-Magnet. To allow a hatch to run in Compressor mode, insert a No. 20 circuit. For Lathe, use No. 21 and for Electro-Magnet use No. 22.",
- "[Fluid Work] Mode B - Allows the multiblock to function as a Fermenter, a Fluid Extractor or an Extractor. To allow a hatch to run in Fermenter mode, insert a No. 20 circuit. For Fluid Extractor, use No. 21 and for Extractor use No. 22.",
- "[Misc. Work] Mode C - Allows the multiblock to function as a Laser Engraver, an Autoclave or a Fluid Solidifier. To allow a hatch to run in Laser Engraver mode, insert a No. 20 circuit. For Autoclave, use No. 21 and for Solidifier use No. 22.",
- });
-
- book_NuclearManual = writeBookTemplate(
- "Manual_NuclearStuff_1", "Nuclear Chemistry [FFPP]", "Alkalus",
- new String[] {
- //Page 1
- "Fission Fuel Processing Plant\n"
- + "Size: 3x9x3 [LxHxW]\n"
- + "Controller: Center, Bottom\n"
- + "4x Input Hatch\n"
- + "2x Output Hatch\n"
- + "1x Output Bus\n"
- + "1x ZPM+ Muffler\n"
- + "1x Maintenance Hatch\n"
- + "1x Energy Hatch\n",
- //Page 2
- "[1] 7x Hastelloy-X or I/O\n"
- + "[2] 5x Incoloy-DS Fluid Containment\n"
- + "[3] 4x Zeron-100 Shielding\n"
- + "[4] 17x Hastelloy-N Sealant Case"
- + "\n"
- + "Multiblock Construction\n"
- + "Convention is [LxHxW]\n"
- + "\n",
- //Page 3
- "Layer 1/2:\n"
- + "[1][1][1]\n"
- + "[1][1][1]\n"
- + "[1][1][1]\n"
- + "\n"
- + "Layer 3/5/6\n"
- + "[ ][4][ ]\n"
- + "[4][2][4]\n"
- + "[ ][4][ ]\n"
- + "\n",
- //Page 4
- "Layer 4\n"
- + "[ ][3][ ]\n"
- + "[3][2][3]\n"
- + "[ ][3][ ]\n"
- + "\n"
- + "Layer 7/8/9\n"
- + "[ ][ ][ ]\n"
- + "[ ][3][ ]\n"
- + "[ ][ ][ ]\n"
- ,
- //Page 5
- "Fission Fuel\n"+
- "Processing Plant"+
- "----------------------\n"+
- "This structure is used to produce the Molten Salts required to run a Liquid Fluorine Thorium Reactor [LFTR]."
-
- });
-
-
- book_MultiChemicalPlant = writeBookTemplate(
- "book_Multi_ChemicalPlant", "Chemical Plant Manual", "Alkalus",
- new String[] {
-
- // Intro
- "This book will explain how the Chemical Plant is constructed, which blocks are valid to upgrade it and also how the upgrades work.",
-
- // Info
- "Solid Casings = Plant tier" + "\n" +
- "Machine Casings = Hatch tier" + "\n" +
- "Higher tier coils More Speed" + "\n" +
- "T1 50% , T2 100% , T3 150%, etc" + "\n",
-
- "Higher tier pipe casings boost parallel"+ "\n" +
- "and reduce catalyst consumption." + "\n" +
- "+2 parallel per tier, 20% extra chance of"+ "\n" +
- "not damaging catalyst per tier.",
-
- "Awakened Draconium Coil (or above) with" + "\n" +
- "Tungstensteel Pipe Casing" + "\n" +
- "does not damage catalyst at all.",
-
-
- // Machine Casings
- "Valid Solid Machine Casings:" + "\n" +
- "0 - Strong Bronze" + "\n" +
- "1 - Solid Steel" + "\n" +
- "2 - Sturdy Aluminium" + "\n" +
- "3 - Clean Stainless Steel" + "\n" +
- "4 - Stable Titanium" + "\n" +
- "5 - Robust Tungstensteel" + "\n" +
- "6 - Vigorous Laurenium" + "\n" +
- "7 - Rugged Botmium",
-
- // Machine Casings
- "Valid Tiered Machine Casings:" + "\n" + "\n" +
- "1 - " + GT_Values.VN[0] + "\n" +
- "2 - " + GT_Values.VN[1] + "\n" +
- "3 - " + GT_Values.VN[2] + "\n" +
- "4 - " + GT_Values.VN[3] + "\n" +
- "5 - " + GT_Values.VN[4] + "\n" +
- "6 - " + GT_Values.VN[5] + "\n" +
- "7 - " + GT_Values.VN[6] + "\n" +
- "8 - " + GT_Values.VN[7] + "\n" +
- "9 - " + GT_Values.VN[8] + "\n" +
- "10 - " + GT_Values.VN[9],
-
- // Pipe Casings
- "Valid Pipe Casings:" + "\n" + "\n" +
- "1 - Bronze" + "\n" +
- "2 - Steel" + "\n" +
- "3 - Titanium" + "\n" +
- "4 - Tungstensteel",
-
- //Coils
- "Valid Coils:" + "\n" + "\n" +
- "1 - Cupronickel" + "\n" +
- "2 - Kanthal" + "\n" +
- "3 - Nichrome" + "\n" +
- "4 - Tungstensteel" + "\n" +
- "5 - HSS-G" + "\n" +
- "6 - HSS-S" + "\n" +
- "7 - Naquadah" + "\n" +
- "8 - Naquadah Alloy" + "\n" +
- "9 - Trinium" + "\n" +
- "10 - Fluxed Electrum",
-
- "11 - Awakened Draconium" + "\n" +
- "12 - Infinity" + "\n" +
- "13 - Hypogen" + "\n" +
- "14 - Eternal",
-
- // Requirements
- "Multiblock Requirements:" + "\n" + "\n" +
- "27x Coils" + "\n" +
- "18x Pipe Casings" + "\n" +
- "57x Tiered Machine Casings" + "\n" +
- "70+ Solid Casings" + "\n" +
- "1x Catalyst Housing (Catalysts cannot go inside an Input Bus)",
-
- // Construction Guide
- "Construction Guide Pt1:" + "\n" + "\n" +
- "Controller is placed on a middle casing in the bottom layer" + "\n" +
- "Hatches can only be placed on the bottom layer edges",
-
- "Construction Guide Pt2:" + "\n" + "\n" +
- "7x7x7 Hollow frame of solid casings" + "\n" +
- "5x1x5 layer of solid casings (fills in top layer)" + "\n" +
- "5x1x5 layer of machine casings (fills in bottom layer)",
-
- "Construction Guide Pt3:" + "\n" +
- "In the central 3x5x3:" + "\n" +
- "3x1x3 layer of Coils, surrounded by ring of Machine Casings" + "\n" +
- "3x1x3 layer of Pipe Casings" + "\n" +
- "3x1x3 layer of Coils" + "\n" +
- "3x1x3 layer of Pipe Casings" + "\n" +
- "3x1x3 layer of Coils, surrounded by ring of Machine Casings",
-
- // Construction Guide Info
- "Information:" + "\n" + "\n" +
- "A = Air" + "\n" +
- "X = Solid Casing" + "\n" +
- "M = Machine Casing" + "\n" +
- "P = Pipe Casing" + "\n" +
- "C = Coil Casing",
-
- "Layer 1:" + "\n" + "\n" +
- "XXXXXXX" + "\n" +
- "XMMMMMX" + "\n" +
- "XMMMMMX" + "\n" +
- "XMMMMMX" + "\n" +
- "XMMMMMX" + "\n" +
- "XMMMMMX" + "\n" +
- "XXXXXXX",
-
- "Layer 2:" + "\n" + "\n" +
- "XAAAAAX" + "\n" +
- "AMMMMMA" + "\n" +
- "AMCCCMA" + "\n" +
- "AMCCCMA" + "\n" +
- "AMCCCMA" + "\n" +
- "AMMMMMA" + "\n" +
- "XAAAAAX",
-
- "Layer 3:" + "\n" + "\n" +
- "XAAAAAX" + "\n" +
- "AAAAAAA" + "\n" +
- "AAPPPAA" + "\n" +
- "AAPPPAA" + "\n" +
- "AAPPPAA" + "\n" +
- "AAAAAAA" + "\n" +
- "XAAAAAX",
-
- "Layer 4:" + "\n" + "\n" +
- "XAAAAAX" + "\n" +
- "AAAAAAA" + "\n" +
- "AACCCAA" + "\n" +
- "AACCCAA" + "\n" +
- "AACCCAA" + "\n" +
- "AAAAAAA" + "\n" +
- "XAAAAAX",
-
- "Layer 5:" + "\n" + "\n" +
- "XAAAAAX" + "\n" +
- "AAAAAAA" + "\n" +
- "AAPPPAA" + "\n" +
- "AAPPPAA" + "\n" +
- "AAPPPAA" + "\n" +
- "AAAAAAA" + "\n" +
- "XAAAAAX",
-
- "Layer 6:" + "\n" + "\n" +
- "XAAAAAX" + "\n" +
- "AMMMMMA" + "\n" +
- "AMCCCMA" + "\n" +
- "AMCCCMA" + "\n" +
- "AMCCCMA" + "\n" +
- "AMMMMMA" + "\n" +
- "XAAAAAX",
-
- "Layer 7:" + "\n" + "\n" +
- "XXXXXXX" + "\n" +
- "XXXXXXX" + "\n" +
- "XXXXXXX" + "\n" +
- "XXXXXXX" + "\n" +
- "XXXXXXX" + "\n" +
- "XXXXXXX" + "\n" +
- "XXXXXXX",
- });
-
- }
-
-
-
-
- public static ItemStack ItemBookWritten_ThermalBoiler;
- public static ItemStack ItemBookWritten_NuclearManual;
- public static ItemStack ItemBookWritten_ModularBaubles;
- public static ItemStack ItemBookWritten_MultiPowerStorage;
- public static ItemStack ItemBookWritten_MultiMachineManual;
- public static ItemStack ItemBookWritten_MultiChemicalPlant;
-
- public static void runLater(){
- ItemBookWritten_ThermalBoiler = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 0, 1);
- ItemBookWritten_MultiPowerStorage = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 1, 1);
- ItemBookWritten_ModularBaubles = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 2, 1);
- ItemBookWritten_MultiMachineManual = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 3, 1);
- ItemBookWritten_NuclearManual = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 4, 1);
- ItemBookWritten_MultiChemicalPlant = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 5, 1);
-
- //Multiblock Manuals
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getSimpleStack(Items.lava_bucket)}, ItemBookWritten_ThermalBoiler);
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getItemStackOfAmountFromOreDict(CI.craftingToolWrench, 1)}, ItemBookWritten_MultiMachineManual);
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getItemStackOfAmountFromOreDict("wireGt01Tin", 1)}, ItemBookWritten_MultiPowerStorage);
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1)}, ItemBookWritten_NuclearManual);
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getItemStackOfAmountFromOreDict("wireGt01Copper", 1)}, ItemBookWritten_MultiChemicalPlant);
-
- for (int i=0;i<mBookKeeperCount;i++){
- ItemStack bookstack = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, i, 1);
- GT_OreDictUnificator.registerOre("bookWritten", bookstack);
- GT_OreDictUnificator.registerOre("craftingBook", bookstack);
- }
-
- }
+ public static int mBookKeeperCount = 0;
+
+ public static Map<Integer, BookTemplate> mBookMap = new HashMap<Integer, BookTemplate>();
+
+ public static BookTemplate book_ThermalBoiler;
+ public static BookTemplate book_MultiPowerStation;
+ public static BookTemplate book_ModularBauble;
+ public static BookTemplate book_MultiMachineManual;
+ public static BookTemplate book_NuclearManual;
+ public static BookTemplate book_MultiChemicalPlant;
+
+ public static void run() {
+
+ Logger.INFO("Writing books.");
+
+ // Thermal Boiler
+ book_ThermalBoiler =
+ writeBookTemplate("Manual_Thermal_Boiler", "Thermal Boiler Manual", "GregoriusT", new String[] {
+ "This Book explains how to set up and run your Thermal Boiler. We are not responsible for any Damage done by this Book itself nor its content.",
+ "First you need to craft the following things for a Thermal Boiler to Function: The Main Boiler Block, 20 Thermal Containment Casings, two Input Hatches, two Output Hatches, a bunch of different Tools and a Maintenance Hatch.",
+ "To begin the building, lay out the first 3x3 layer of Machine Casings on the ground (with a Hatch in the Middle), then place the Boiler Block facing outward in the middle of one of the 3m wide Sides.",
+ "Now grab 3 other Hatches and place them on the remaining three 3m wide Sides also facing outwards. And now the four corners of the Machine need also a Machine Casing. There should only be a Hole left in the middle of the Cube.",
+ "So, now place a 3x3 of Machine Casings on top, at the 3rd Layer with the last Hatch in the middle facing outwards as well.",
+ "When accessing the Boiler Block, it should now stop telling you, that the structure is incomplete (bottom Line of that Screen). Now go with a bunch of different Tools (Metal Hammer, Rubber Hammer, Screwdriver, Wrench, Soldering Iron and Crowbar)",
+ "to the Maintenance Hatch and access it. After that you grab the 6 Tools and rightclick the Slot with each of them in your Hand in the Maintenance GUI. Note that you need Soldering Tin/Lead in your Inventory to use the Soldering Iron.",
+ "The Main Block should now tell you that you need to use the Rubber Hammer on it to (re)activate the Machine. The Rubber Hammer can enable and disable Machines. The Machine disables itself after something important broke.",
+ "If you want to use Lava with this Device, then you should add a Lava Filter to extract additional Resources from the Lava. If the Filter breaks, the Machine won't explode like a Turbine would. If you use molten Salt, then you won't need a Filter.",
+ "You will get Obsidian when processing Lava, however if a Filter is used, you will get sometimes an Ingot instead of a Block of Obsidian. When using molten Salt, you will get the Salt back.",
+ "So, now for the Maintenance. After a few Hours of running nonstop, your Boiler will get small Problems, which don't prevent it from running, these Problems just decrease Efficiency. Every Problem listed on the Screen does -10% Efficiency.",
+ "To fix these Problems, just go to the Maintenance Hatch and click with the problem corresponding Tool on the Slot to repair. If all six possible runtime Problems happen, the Machine will auto-shutdown no matter what. No Explosion, it's just stopping.",
+ "The Thermal Boiler will produce 800 Liters of Steam per tick for about 5 or 6 Liters of Water per tick at reaching 100% Efficiency. In case of Lava it consumes 1666 Liters every Second.",
+ "A Thermal Boiler is worth about 33 small Thermal Generators, and as the Boilers get much less Efficient, when not having enough Fuel, you should consider making a large Nether Pump for Lava, or a good Nuclear Reactor for molten Salt.",
+ "Input and Output Slots are fully optional, you can place multiple ones of them or even none on the Machine. A Machine without Input couldn't process any Recipes, while a Machine without Output just voids all outputted Items and Liquids.",
+ "It might be useful to use the Screwdriver on the Output Hatches to determine what is outputted where."
+ });
+
+ // Test Novel
+ book_MultiPowerStation = writeBookTemplate(
+ "Manual_Multi_PowerStation", "Power Storage & You [Version 0.64]", "Alkalus", new String[] {
+ // Page 1
+ "So, when it comes to power storage you really have three separate options:\n" + " \n"
+ + "Battery Buffers,\n"
+ + "Energy Buffers,\n"
+ + "The Power Sub-Station\n",
+ // Page 2
+ "Battery Buffer\n" + " \n"
+ + "Is rather portable. Allowing you to throw set one up and insert batteries where ever you may need."
+ + "\n" + "They output 1A for each battery stored inside, up to a maximum of 16A.",
+ // Page 3
+ "Energy Buffer\n" + " \n"
+ + "Is a more optimal choice for storage in your base. Once placed down, they cannot be moved without losing all stored power."
+ + "\n" + "Energy Buffers can output 4A from the output side, however accept 16A as input.",
+ // Page 4
+ "The Power Sub-Station" + " \n"
+ + "Is used for storing Insane amounts of power later game."
+ + "\n" + "Consumes 2% of the average voltage of all energy type hatches every tick."
+ + "\n",
+ // Page 5
+ "Allows Insertion/Removal of power from the rear face of the controller, swap with a screwdriver."
+ + "\n"
+ + "Variable Height Structure, between 4-16Y. Inserted Redox Cells dictate max energy tier of structure."
+ + "\n",
+ // Page 6
+ "Redox Cells cannot be placed into the Top or Bottom layer and only take up 3xhx3 internally."
+ + "\n" + "Different Tier cells CANNOT be mixed together." + "\n",
+ // Page 7
+ "All Hatches Must be HV at a Minimum, this minimum tier is in place to stop people abusing ULV/LV hatches to lower the avg/t."
+ + "\n"
+ + "Currently the GUI will NOT display anything at all until the structure forms, this is a known bug."
+ + "\n",
+ // Page 8
+ "Valid Hatches:\n" + "Energy Hatch,\n"
+ + "Dynamo Hatch,\n"
+ + "Charging Bus,\n"
+ + "Discharging Bus,\n"
+ + "Dynamo Buffer,\n"
+ + "Multi-Amp Dynamo Hatch.\n\n\n"
+ + "Structure MUST contain at least one energy input and one energy output hatch."
+ });
+
+ // Test Novel
+ book_ModularBauble =
+ writeBookTemplate("Manual_Modular_Bauble", "How to: Modular Baubles", "Alkalus", new String[] {
+ "Concept: This idea came from wanting flexibility. \n"
+ + "First step, Build a Modularity table to begin customisation of your Bauble. \n"
+ + " After this has been constructed, you can now combine the upgrades listed within this book to improve the baubles level/100.",
+ "Defence:\n"
+ + "Can be upgraded by combining metal plates with the bauble. \n"
+ + " | +1 | Aluminium \n"
+ + " | +2 | Stainless Steel \n"
+ + " | +3 | Tungsten \n"
+ + " | +4 | Tungsten Steel \n"
+ + " | +5 | Naquadah \n",
+ "There was once a sad and lonely oak tree. \n",
+ "There was once a sad and lonely oak tree. \n",
+ "There was once a sad and lonely oak tree. \n"
+ });
+
+ // Test Novel
+ // 20/21/22
+ book_MultiMachineManual =
+ writeBookTemplate("Manual_Multi_Machine", "Multi-Machine Manual", "Alkalus", new String[] {
+ "This Multiblock, depending upon the mode used, can function as a variety of different machines. The idea behind this, was that most of these machines are rather niche compared to any others, as such, not used often.",
+ "To build, you need to construct a hollow 3x3x3 structure made from Multi-Use casings, With a minimum of 6. Any Casing position can be substituted out with an Input Hatch/Bus, an Output Hatch/Bus, Muffler, Maint. Hatch or Energy Injector Hatch.",
+ "The Mode can be set by using a Screwdriver on the controller block. Each mode allows the use of Numbered Circuits, to allow a different machine 'type' for each input bus.",
+ "[Metal Work] Mode A - Allows the multiblock to function as a Compressor, a Lathe or an Electro-Magnet. To allow a hatch to run in Compressor mode, insert a No. 20 circuit. For Lathe, use No. 21 and for Electro-Magnet use No. 22.",
+ "[Fluid Work] Mode B - Allows the multiblock to function as a Fermenter, a Fluid Extractor or an Extractor. To allow a hatch to run in Fermenter mode, insert a No. 20 circuit. For Fluid Extractor, use No. 21 and for Extractor use No. 22.",
+ "[Misc. Work] Mode C - Allows the multiblock to function as a Laser Engraver, an Autoclave or a Fluid Solidifier. To allow a hatch to run in Laser Engraver mode, insert a No. 20 circuit. For Autoclave, use No. 21 and for Solidifier use No. 22.",
+ });
+
+ book_NuclearManual =
+ writeBookTemplate("Manual_NuclearStuff_1", "Nuclear Chemistry [FFPP]", "Alkalus", new String[] {
+ // Page 1
+ "Fission Fuel Processing Plant\n"
+ + "Size: 3x9x3 [LxHxW]\n"
+ + "Controller: Center, Bottom\n"
+ + "4x Input Hatch\n"
+ + "2x Output Hatch\n"
+ + "1x Output Bus\n"
+ + "1x ZPM+ Muffler\n"
+ + "1x Maintenance Hatch\n"
+ + "1x Energy Hatch\n",
+ // Page 2
+ "[1] 7x Hastelloy-X or I/O\n"
+ + "[2] 5x Incoloy-DS Fluid Containment\n"
+ + "[3] 4x Zeron-100 Shielding\n"
+ + "[4] 17x Hastelloy-N Sealant Case"
+ + "\n"
+ + "Multiblock Construction\n"
+ + "Convention is [LxHxW]\n"
+ + "\n",
+ // Page 3
+ "Layer 1/2:\n"
+ + "[1][1][1]\n"
+ + "[1][1][1]\n"
+ + "[1][1][1]\n"
+ + "\n"
+ + "Layer 3/5/6\n"
+ + "[ ][4][ ]\n"
+ + "[4][2][4]\n"
+ + "[ ][4][ ]\n"
+ + "\n",
+ // Page 4
+ "Layer 4\n"
+ + "[ ][3][ ]\n"
+ + "[3][2][3]\n"
+ + "[ ][3][ ]\n"
+ + "\n"
+ + "Layer 7/8/9\n"
+ + "[ ][ ][ ]\n"
+ + "[ ][3][ ]\n"
+ + "[ ][ ][ ]\n",
+ // Page 5
+ "Fission Fuel\n" + "Processing Plant"
+ + "----------------------\n"
+ + "This structure is used to produce the Molten Salts required to run a Liquid Fluorine Thorium Reactor [LFTR]."
+ });
+
+ book_MultiChemicalPlant =
+ writeBookTemplate("book_Multi_ChemicalPlant", "Chemical Plant Manual", "Alkalus", new String[] {
+
+ // Intro
+ "This book will explain how the Chemical Plant is constructed, which blocks are valid to upgrade it and also how the upgrades work.",
+
+ // Info
+ "Solid Casings = Plant tier" + "\n" + "Machine Casings = Hatch tier"
+ + "\n" + "Higher tier coils More Speed"
+ + "\n" + "T1 50% , T2 100% , T3 150%, etc"
+ + "\n",
+ "Higher tier pipe casings boost parallel" + "\n" + "and reduce catalyst consumption."
+ + "\n" + "+2 parallel per tier, 20% extra chance of"
+ + "\n" + "not damaging catalyst per tier.",
+ "Awakened Draconium Coil (or above) with" + "\n" + "Tungstensteel Pipe Casing" + "\n"
+ + "does not damage catalyst at all.",
+
+ // Machine Casings
+ "Valid Solid Machine Casings:" + "\n" + "0 - Strong Bronze"
+ + "\n" + "1 - Solid Steel"
+ + "\n" + "2 - Sturdy Aluminium"
+ + "\n" + "3 - Clean Stainless Steel"
+ + "\n" + "4 - Stable Titanium"
+ + "\n" + "5 - Robust Tungstensteel"
+ + "\n" + "6 - Vigorous Laurenium"
+ + "\n" + "7 - Rugged Botmium",
+
+ // Machine Casings
+ "Valid Tiered Machine Casings:" + "\n" + "\n" + "1 - "
+ + GT_Values.VN[0] + "\n" + "2 - "
+ + GT_Values.VN[1] + "\n" + "3 - "
+ + GT_Values.VN[2] + "\n" + "4 - "
+ + GT_Values.VN[3] + "\n" + "5 - "
+ + GT_Values.VN[4] + "\n" + "6 - "
+ + GT_Values.VN[5] + "\n" + "7 - "
+ + GT_Values.VN[6] + "\n" + "8 - "
+ + GT_Values.VN[7] + "\n" + "9 - "
+ + GT_Values.VN[8] + "\n" + "10 - "
+ + GT_Values.VN[9],
+
+ // Pipe Casings
+ "Valid Pipe Casings:" + "\n" + "\n" + "1 - Bronze"
+ + "\n" + "2 - Steel"
+ + "\n" + "3 - Titanium"
+ + "\n" + "4 - Tungstensteel",
+
+ // Coils
+ "Valid Coils:" + "\n" + "\n" + "1 - Cupronickel"
+ + "\n" + "2 - Kanthal"
+ + "\n" + "3 - Nichrome"
+ + "\n" + "4 - Tungstensteel"
+ + "\n" + "5 - HSS-G"
+ + "\n" + "6 - HSS-S"
+ + "\n" + "7 - Naquadah"
+ + "\n" + "8 - Naquadah Alloy"
+ + "\n" + "9 - Trinium"
+ + "\n" + "10 - Fluxed Electrum",
+ "11 - Awakened Draconium" + "\n" + "12 - Infinity" + "\n" + "13 - Hypogen" + "\n" + "14 - Eternal",
+
+ // Requirements
+ "Multiblock Requirements:" + "\n" + "\n" + "27x Coils"
+ + "\n" + "18x Pipe Casings"
+ + "\n" + "57x Tiered Machine Casings"
+ + "\n" + "70+ Solid Casings"
+ + "\n" + "1x Catalyst Housing (Catalysts cannot go inside an Input Bus)",
+
+ // Construction Guide
+ "Construction Guide Pt1:" + "\n" + "\n"
+ + "Controller is placed on a middle casing in the bottom layer"
+ + "\n" + "Hatches can only be placed on the bottom layer edges",
+ "Construction Guide Pt2:" + "\n" + "\n" + "7x7x7 Hollow frame of solid casings"
+ + "\n" + "5x1x5 layer of solid casings (fills in top layer)"
+ + "\n" + "5x1x5 layer of machine casings (fills in bottom layer)",
+ "Construction Guide Pt3:" + "\n" + "In the central 3x5x3:"
+ + "\n" + "3x1x3 layer of Coils, surrounded by ring of Machine Casings"
+ + "\n" + "3x1x3 layer of Pipe Casings"
+ + "\n" + "3x1x3 layer of Coils"
+ + "\n" + "3x1x3 layer of Pipe Casings"
+ + "\n" + "3x1x3 layer of Coils, surrounded by ring of Machine Casings",
+
+ // Construction Guide Info
+ "Information:" + "\n" + "\n" + "A = Air"
+ + "\n" + "X = Solid Casing"
+ + "\n" + "M = Machine Casing"
+ + "\n" + "P = Pipe Casing"
+ + "\n" + "C = Coil Casing",
+ "Layer 1:" + "\n" + "\n" + "XXXXXXX"
+ + "\n" + "XMMMMMX"
+ + "\n" + "XMMMMMX"
+ + "\n" + "XMMMMMX"
+ + "\n" + "XMMMMMX"
+ + "\n" + "XMMMMMX"
+ + "\n" + "XXXXXXX",
+ "Layer 2:" + "\n" + "\n" + "XAAAAAX"
+ + "\n" + "AMMMMMA"
+ + "\n" + "AMCCCMA"
+ + "\n" + "AMCCCMA"
+ + "\n" + "AMCCCMA"
+ + "\n" + "AMMMMMA"
+ + "\n" + "XAAAAAX",
+ "Layer 3:" + "\n" + "\n" + "XAAAAAX"
+ + "\n" + "AAAAAAA"
+ + "\n" + "AAPPPAA"
+ + "\n" + "AAPPPAA"
+ + "\n" + "AAPPPAA"
+ + "\n" + "AAAAAAA"
+ + "\n" + "XAAAAAX",
+ "Layer 4:" + "\n" + "\n" + "XAAAAAX"
+ + "\n" + "AAAAAAA"
+ + "\n" + "AACCCAA"
+ + "\n" + "AACCCAA"
+ + "\n" + "AACCCAA"
+ + "\n" + "AAAAAAA"
+ + "\n" + "XAAAAAX",
+ "Layer 5:" + "\n" + "\n" + "XAAAAAX"
+ + "\n" + "AAAAAAA"
+ + "\n" + "AAPPPAA"
+ + "\n" + "AAPPPAA"
+ + "\n" + "AAPPPAA"
+ + "\n" + "AAAAAAA"
+ + "\n" + "XAAAAAX",
+ "Layer 6:" + "\n" + "\n" + "XAAAAAX"
+ + "\n" + "AMMMMMA"
+ + "\n" + "AMCCCMA"
+ + "\n" + "AMCCCMA"
+ + "\n" + "AMCCCMA"
+ + "\n" + "AMMMMMA"
+ + "\n" + "XAAAAAX",
+ "Layer 7:" + "\n" + "\n" + "XXXXXXX"
+ + "\n" + "XXXXXXX"
+ + "\n" + "XXXXXXX"
+ + "\n" + "XXXXXXX"
+ + "\n" + "XXXXXXX"
+ + "\n" + "XXXXXXX"
+ + "\n" + "XXXXXXX",
+ });
+ }
+
+ public static ItemStack ItemBookWritten_ThermalBoiler;
+ public static ItemStack ItemBookWritten_NuclearManual;
+ public static ItemStack ItemBookWritten_ModularBaubles;
+ public static ItemStack ItemBookWritten_MultiPowerStorage;
+ public static ItemStack ItemBookWritten_MultiMachineManual;
+ public static ItemStack ItemBookWritten_MultiChemicalPlant;
+
+ public static void runLater() {
+ ItemBookWritten_ThermalBoiler = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 0, 1);
+ ItemBookWritten_MultiPowerStorage = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 1, 1);
+ ItemBookWritten_ModularBaubles = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 2, 1);
+ ItemBookWritten_MultiMachineManual = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 3, 1);
+ ItemBookWritten_NuclearManual = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 4, 1);
+ ItemBookWritten_MultiChemicalPlant = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, 5, 1);
+
+ // Multiblock Manuals
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Items.writable_book), ItemUtils.getSimpleStack(Items.lava_bucket)
+ },
+ ItemBookWritten_ThermalBoiler);
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Items.writable_book),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.craftingToolWrench, 1)
+ },
+ ItemBookWritten_MultiMachineManual);
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Items.writable_book),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireGt01Tin", 1)
+ },
+ ItemBookWritten_MultiPowerStorage);
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Items.writable_book),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1)
+ },
+ ItemBookWritten_NuclearManual);
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Items.writable_book),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireGt01Copper", 1)
+ },
+ ItemBookWritten_MultiChemicalPlant);
+
+ for (int i = 0; i < mBookKeeperCount; i++) {
+ ItemStack bookstack = ItemUtils.simpleMetaStack(ModItems.itemCustomBook, i, 1);
+ GT_OreDictUnificator.registerOre("bookWritten", bookstack);
+ GT_OreDictUnificator.registerOre("craftingBook", bookstack);
+ }
+ }
- private static BookTemplate writeBookTemplate(String aMapping, String aTitle, String aAuthor, String[] aPages){
- mBookKeeperCount++;
+ private static BookTemplate writeBookTemplate(String aMapping, String aTitle, String aAuthor, String[] aPages) {
+ mBookKeeperCount++;
for (int i = 0; i < aPages.length; i++) {
aPages[i] = aPages[i].replaceAll("\n", "<BR>");
}
addBookTitleLocalization(aTitle);
addBookPagesLocalization(aTitle, aPages);
BookTemplate mTemp = new BookTemplate(mBookKeeperCount, aMapping, aTitle, aAuthor, aPages);
- mBookMap.put(mBookKeeperCount-1, mTemp);
- return mTemp;
- }
-
- public static class BookTemplate {
- public final int mMeta;
- public final String mMapping;
- public final String mTitle;
- public final String mAuthor;
- public final String[] mPages;
-
- BookTemplate(int aMeta, String aMapping, String aTitle, String aAuthor, String[] aPages){
- this.mMeta = aMeta;
- this.mMapping = aMapping;
- this.mTitle = aTitle;
- this.mAuthor = aAuthor;
- this.mPages = aPages;
- }
- }
+ mBookMap.put(mBookKeeperCount - 1, mTemp);
+ return mTemp;
+ }
+
+ public static class BookTemplate {
+ public final int mMeta;
+ public final String mMapping;
+ public final String mTitle;
+ public final String mAuthor;
+ public final String[] mPages;
+
+ BookTemplate(int aMeta, String aMapping, String aTitle, String aAuthor, String[] aPages) {
+ this.mMeta = aMeta;
+ this.mMapping = aMapping;
+ this.mTitle = aTitle;
+ this.mAuthor = aAuthor;
+ this.mPages = aPages;
+ }
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/core/handler/BurnableFuelHandler.java b/src/main/java/gtPlusPlus/core/handler/BurnableFuelHandler.java
index 82bcdc84e6..b0006b5f9c 100644
--- a/src/main/java/gtPlusPlus/core/handler/BurnableFuelHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/BurnableFuelHandler.java
@@ -1,35 +1,32 @@
package gtPlusPlus.core.handler;
import cpw.mods.fml.common.IFuelHandler;
-
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
-public class BurnableFuelHandler implements IFuelHandler{
+public class BurnableFuelHandler implements IFuelHandler {
- @Override
- public int getBurnTime(ItemStack aStack) {
- //Iterate over my burnables.
- for (Pair<Integer, ItemStack> temp : CORE.burnables) {
- int aStackID = Item.getIdFromItem(aStack.getItem());
- int burnID = Item.getIdFromItem(temp.getValue().getItem());
- if (aStackID == burnID){
- int burn = temp.getKey();
- ItemStack fuel = temp.getValue();
- ItemStack testItem = ItemUtils.getSimpleStack(fuel, aStack.stackSize);
+ @Override
+ public int getBurnTime(ItemStack aStack) {
+ // Iterate over my burnables.
+ for (Pair<Integer, ItemStack> temp : CORE.burnables) {
+ int aStackID = Item.getIdFromItem(aStack.getItem());
+ int burnID = Item.getIdFromItem(temp.getValue().getItem());
+ if (aStackID == burnID) {
+ int burn = temp.getKey();
+ ItemStack fuel = temp.getValue();
+ ItemStack testItem = ItemUtils.getSimpleStack(fuel, aStack.stackSize);
- if (aStack.isItemEqual(testItem)){
- return burn;
- }
- }
- }
-
- //If it's not my fuel, return 0.
- return 0;
- }
+ if (aStack.isItemEqual(testItem)) {
+ return burn;
+ }
+ }
+ }
+ // If it's not my fuel, return 0.
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index 79446db6e6..93f6df7595 100644
--- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -2,10 +2,6 @@ package gtPlusPlus.core.handler;
import static gtPlusPlus.core.lib.LoadedMods.Gregtech;
-import java.util.LinkedList;
-import java.util.Queue;
-import java.util.Set;
-
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_OreDictUnificator;
@@ -47,281 +43,275 @@ import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_GTNH;
import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_GlueLine;
import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_Nuclear;
import gtPlusPlus.xmod.gregtech.registration.gregtech.*;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.Set;
import net.minecraft.item.ItemStack;
public class COMPAT_HANDLER {
- public static Queue<Object> RemoveRecipeQueue = new LinkedList<>();
- public static Queue<ShapedRecipeObject> AddRecipeQueue = new LinkedList<>();
- public static Boolean areInitItemsLoaded = false;
-
-
- public static void registerMyModsOreDictEntries(){
+ public static Queue<Object> RemoveRecipeQueue = new LinkedList<>();
+ public static Queue<ShapedRecipeObject> AddRecipeQueue = new LinkedList<>();
+ public static Boolean areInitItemsLoaded = false;
- Logger.INFO("Registering Materials with OreDict.");
- //In-house
+ public static void registerMyModsOreDictEntries() {
- //tools
- GT_OreDictUnificator.registerOre("craftingToolSandHammer", new ItemStack(ModItems.itemSandstoneHammer));
+ Logger.INFO("Registering Materials with OreDict.");
+ // In-house
- for(int i=1; i<=10; i++){
- GT_OreDictUnificator.registerOre("bufferCore_"+GT_Values.VN[i-1], new ItemStack(ItemUtils.getItemFromFQRN("miscutils:item.itemBufferCore"+i)));
- }
- }
+ // tools
+ GT_OreDictUnificator.registerOre("craftingToolSandHammer", new ItemStack(ModItems.itemSandstoneHammer));
- public static void registerGregtechMachines() {
- if (Gregtech) {
+ for (int i = 1; i <= 10; i++) {
+ GT_OreDictUnificator.registerOre(
+ "bufferCore_" + GT_Values.VN[i - 1],
+ new ItemStack(ItemUtils.getItemFromFQRN("miscutils:item.itemBufferCore" + i)));
+ }
+ }
- //Debug
- GregtechItemList.Garbage_Collector_Debug_Machine.set(
- new GregtechMetaGarbageCollector(
- "garbagecollector.01.tier.single",
- "JVM Garbage Collector",
- "Useful for debugging or smoother performance on local servers").getStackForm(1L));
-
-
- //Free IDs
- /*
- ---
- 859
- to
- 868
- ---
- 911
- to
- 940
- */
+ public static void registerGregtechMachines() {
+ if (Gregtech) {
- new RECIPES_LaserEngraver();
- new RECIPES_Extruder();
- GregtechGeneratorsULV.run();
- GregtechEnergyBuffer.run();
- GregtechLFTR.run();
- GregtechSteamCondenser.run();
- GregtechSafeBlock.run();
- //GregtechSuperConductionPoint.run();
- GregtechIronBlastFurnace.run();
- GregtechIndustrialCentrifuge.run();
- GregtechIndustrialCokeOven.run();
- GregtechIndustrialPlatePress.run();
- GregtechRocketFuelGenerator.run();
- GregtechIndustrialElectrolyzer.run();
- GregtechIndustrialMacerator.run();
- GregtechIndustrialWiremill.run();
- GregtechIndustrialMassFabricator.run();
- GregtechIndustrialBlastSmelter.run();
- GregtechSolarGenerators.run();
- GregtechPowerSubStation.run();
- GregtechDehydrator.run();
- GregtechAdvancedBoilers.run();
- GregtechPollutionDevices.run();
- GregtechTieredFluidTanks.run();
- //GregtechIndustrialMultiTank.run();
- GregtechGeothermalThermalGenerator.run();
- Gregtech4Content.run();
- GregtechIndustrialFuelRefinery.run();
- GregtechTreeFarmerTE.run();
- GregtechIndustrialTreeFarm.run();
- GregtechIndustrialSifter.run();
- GregtechSimpleWasher.run();
- GregtechRTG.run();
- GregtechCyclotron.run();
- GregtechHiAmpTransformer.run();
- GregtechIndustrialThermalCentrifuge.run();
- GregtechIndustrialWashPlant.run();
- GregtechSemiFluidgenerators.run();
- GregtechAdvancedMixer.run();
- GregtechWirelessChargers.run();
- GregtechIndustrialGeneratorArray.run();
- GregtechIndustrialCuttingFactory.run();
- //GregtechMiniRaFusion.run();
- GregtechComponentAssembler.run();
- GregtechTeslaTower.run();
- GregtechSuperChests.run();
- GregtechIndustrialFishPond.run();
- GregtechTieredChunkloaders.run();
- GregtechIndustrialExtruder.run();
- GregtechIndustrialMultiMachine.run();
- //GregtechBedrockPlatforms.run();
- GregtechBufferDynamos.run();
- GregtechAmazonWarehouse.run();
- GregtechFactoryGradeReplacementMultis.run();
- GregtechThaumcraftDevices.run();
- GregtechThreadedBuffers.run();
- GregtechIndustrialMixer.run();
- GregtechCustomHatches.run();
- //GregtechNaqReactor.run();
- GregtechIndustrialArcFurnace.run();
- GregtechSolarTower.run();
- GregtechLargeTurbinesAndHeatExchanger.run();
- GregtechPowerBreakers.run();
- GregtechFluidReactor.run();
- GregtechAlgaeContent.run();
- GregtechIndustrialAlloySmelter.run();
- GregtechIsaMill.run();
- GregtechSteamMultis.run();
- GregtechIndustrialForgeHammer.run();
- GregtechMolecularTransformer.run();
- GregtechIndustrialElementDuplicator.run();
- GregtechIndustrialRockBreaker.run();
- GregtechIndustrialChisel.run();
- GregtechIndustrialFluidHeater.run();
+ // Debug
+ GregtechItemList.Garbage_Collector_Debug_Machine.set(new GregtechMetaGarbageCollector(
+ "garbagecollector.01.tier.single",
+ "JVM Garbage Collector",
+ "Useful for debugging or smoother performance on local servers")
+ .getStackForm(1L));
- //New Horizons Content
- NewHorizonsAccelerator.run();
- }
+ // Free IDs
+ /*
+ ---
+ 859
+ to
+ 868
+ ---
+ 911
+ to
+ 940
+ */
- }
+ new RECIPES_LaserEngraver();
+ new RECIPES_Extruder();
+ GregtechGeneratorsULV.run();
+ GregtechEnergyBuffer.run();
+ GregtechLFTR.run();
+ GregtechSteamCondenser.run();
+ GregtechSafeBlock.run();
+ // GregtechSuperConductionPoint.run();
+ GregtechIronBlastFurnace.run();
+ GregtechIndustrialCentrifuge.run();
+ GregtechIndustrialCokeOven.run();
+ GregtechIndustrialPlatePress.run();
+ GregtechRocketFuelGenerator.run();
+ GregtechIndustrialElectrolyzer.run();
+ GregtechIndustrialMacerator.run();
+ GregtechIndustrialWiremill.run();
+ GregtechIndustrialMassFabricator.run();
+ GregtechIndustrialBlastSmelter.run();
+ GregtechSolarGenerators.run();
+ GregtechPowerSubStation.run();
+ GregtechDehydrator.run();
+ GregtechAdvancedBoilers.run();
+ GregtechPollutionDevices.run();
+ GregtechTieredFluidTanks.run();
+ // GregtechIndustrialMultiTank.run();
+ GregtechGeothermalThermalGenerator.run();
+ Gregtech4Content.run();
+ GregtechIndustrialFuelRefinery.run();
+ GregtechTreeFarmerTE.run();
+ GregtechIndustrialTreeFarm.run();
+ GregtechIndustrialSifter.run();
+ GregtechSimpleWasher.run();
+ GregtechRTG.run();
+ GregtechCyclotron.run();
+ GregtechHiAmpTransformer.run();
+ GregtechIndustrialThermalCentrifuge.run();
+ GregtechIndustrialWashPlant.run();
+ GregtechSemiFluidgenerators.run();
+ GregtechAdvancedMixer.run();
+ GregtechWirelessChargers.run();
+ GregtechIndustrialGeneratorArray.run();
+ GregtechIndustrialCuttingFactory.run();
+ // GregtechMiniRaFusion.run();
+ GregtechComponentAssembler.run();
+ GregtechTeslaTower.run();
+ GregtechSuperChests.run();
+ GregtechIndustrialFishPond.run();
+ GregtechTieredChunkloaders.run();
+ GregtechIndustrialExtruder.run();
+ GregtechIndustrialMultiMachine.run();
+ // GregtechBedrockPlatforms.run();
+ GregtechBufferDynamos.run();
+ GregtechAmazonWarehouse.run();
+ GregtechFactoryGradeReplacementMultis.run();
+ GregtechThaumcraftDevices.run();
+ GregtechThreadedBuffers.run();
+ GregtechIndustrialMixer.run();
+ GregtechCustomHatches.run();
+ // GregtechNaqReactor.run();
+ GregtechIndustrialArcFurnace.run();
+ GregtechSolarTower.run();
+ GregtechLargeTurbinesAndHeatExchanger.run();
+ GregtechPowerBreakers.run();
+ GregtechFluidReactor.run();
+ GregtechAlgaeContent.run();
+ GregtechIndustrialAlloySmelter.run();
+ GregtechIsaMill.run();
+ GregtechSteamMultis.run();
+ GregtechIndustrialForgeHammer.run();
+ GregtechMolecularTransformer.run();
+ GregtechIndustrialElementDuplicator.run();
+ GregtechIndustrialRockBreaker.run();
+ GregtechIndustrialChisel.run();
+ GregtechIndustrialFluidHeater.run();
- //InterMod
- public static void intermodOreDictionarySupport(){
+ // New Horizons Content
+ NewHorizonsAccelerator.run();
+ }
+ }
- if (LoadedMods.Big_Reactors){
- COMPAT_BigReactors.OreDict();
- }
- if (LoadedMods.EnderIO){
- COMPAT_EnderIO.OreDict();
- }
- if (LoadedMods.MorePlanets){
- COMPAT_MorePlanets.OreDict();
- }
- if (LoadedMods.OpenBlocks){
- COMPAT_OpenBlocks.OreDict();
- }
- if (LoadedMods.Railcraft){
- COMPAT_Railcraft.OreDict();
- }
- if (LoadedMods.Simply_Jetpacks){
- COMPAT_SimplyJetpacks.OreDict();
- }
- if (LoadedMods.RFTools){
- COMPAT_RFTools.OreDict();
- }
- if (LoadedMods.Thaumcraft){
- COMPAT_Thaumcraft.OreDict();
- }
- if (LoadedMods.Extra_Utils){
- COMPAT_ExtraUtils.OreDict();
- }
- if (LoadedMods.PneumaticCraft){
- COMPAT_PneumaticCraft.OreDict();
- }
- if (LoadedMods.CompactWindmills){
- COMPAT_CompactWindmills.OreDict();
- }
- if (LoadedMods.IndustrialCraft2){
- COMPAT_IC2.OreDict();
- }
- if (LoadedMods.PamsHarvestcraft){
- COMPAT_HarvestCraft.OreDict();
- }
- if (LoadedMods.Witchery) {
- COMPAT_Witchery.OreDict();
- }
- }
+ // InterMod
+ public static void intermodOreDictionarySupport() {
- public static void RemoveRecipesFromOtherMods(){
- //Removal of Recipes
- for(final Object item : RemoveRecipeQueue){
- RecipeUtils.removeCraftingRecipe(item);
- }
- }
+ if (LoadedMods.Big_Reactors) {
+ COMPAT_BigReactors.OreDict();
+ }
+ if (LoadedMods.EnderIO) {
+ COMPAT_EnderIO.OreDict();
+ }
+ if (LoadedMods.MorePlanets) {
+ COMPAT_MorePlanets.OreDict();
+ }
+ if (LoadedMods.OpenBlocks) {
+ COMPAT_OpenBlocks.OreDict();
+ }
+ if (LoadedMods.Railcraft) {
+ COMPAT_Railcraft.OreDict();
+ }
+ if (LoadedMods.Simply_Jetpacks) {
+ COMPAT_SimplyJetpacks.OreDict();
+ }
+ if (LoadedMods.RFTools) {
+ COMPAT_RFTools.OreDict();
+ }
+ if (LoadedMods.Thaumcraft) {
+ COMPAT_Thaumcraft.OreDict();
+ }
+ if (LoadedMods.Extra_Utils) {
+ COMPAT_ExtraUtils.OreDict();
+ }
+ if (LoadedMods.PneumaticCraft) {
+ COMPAT_PneumaticCraft.OreDict();
+ }
+ if (LoadedMods.CompactWindmills) {
+ COMPAT_CompactWindmills.OreDict();
+ }
+ if (LoadedMods.IndustrialCraft2) {
+ COMPAT_IC2.OreDict();
+ }
+ if (LoadedMods.PamsHarvestcraft) {
+ COMPAT_HarvestCraft.OreDict();
+ }
+ if (LoadedMods.Witchery) {
+ COMPAT_Witchery.OreDict();
+ }
+ }
- public static void InitialiseHandlerThenAddRecipes(){
- RegistrationHandler.run();
- }
- public static void InitialiseLateHandlerThenAddRecipes(){
- LateRegistrationHandler.run();
- }
+ public static void RemoveRecipesFromOtherMods() {
+ // Removal of Recipes
+ for (final Object item : RemoveRecipeQueue) {
+ RecipeUtils.removeCraftingRecipe(item);
+ }
+ }
- public static void startLoadingGregAPIBasedRecipes(){
- //Add hand-made recipes
- RECIPES_GREGTECH.run();
- RecipeLoader_GTNH.generate();
- RecipeLoader_Nuclear.generate();
- RecipeLoader_GlueLine.generate();
- //Add autogenerated Recipes from Item Components
- for (Set<RunnableWithInfo<Material>> m : MaterialGenerator.mRecipeMapsToGenerate) {
- for (RunnableWithInfo<Material> r : m) {
- try {
- r.run();
- Logger.INFO("[FIND] "+r.getInfoData().getLocalizedName()+" recipes generated.");
- }
- catch (Throwable t) {
- t.printStackTrace();
- Logger.INFO("[ERROR] "+r.getInfoData().getLocalizedName()+" recipes failed to generated.");
- }
- }
- }
- RecipeGen_Recycling.executeGenerators();
- runQueuedMisc();
-
- // Do Fluid Canning Last, because they're not executed on demand, but rather queued.
- RecipeGen_FluidCanning.init();
- }
-
+ public static void InitialiseHandlerThenAddRecipes() {
+ RegistrationHandler.run();
+ }
+ public static void InitialiseLateHandlerThenAddRecipes() {
+ LateRegistrationHandler.run();
+ }
- public static void onLoadComplete(FMLLoadCompleteEvent event) {
- runQueuedOnLoadComplete(event);
- }
+ public static void startLoadingGregAPIBasedRecipes() {
+ // Add hand-made recipes
+ RECIPES_GREGTECH.run();
+ RecipeLoader_GTNH.generate();
+ RecipeLoader_Nuclear.generate();
+ RecipeLoader_GlueLine.generate();
+ // Add autogenerated Recipes from Item Components
+ for (Set<RunnableWithInfo<Material>> m : MaterialGenerator.mRecipeMapsToGenerate) {
+ for (RunnableWithInfo<Material> r : m) {
+ try {
+ r.run();
+ Logger.INFO("[FIND] " + r.getInfoData().getLocalizedName() + " recipes generated.");
+ } catch (Throwable t) {
+ t.printStackTrace();
+ Logger.INFO("[ERROR] " + r.getInfoData().getLocalizedName() + " recipes failed to generated.");
+ }
+ }
+ }
+ RecipeGen_Recycling.executeGenerators();
+ runQueuedMisc();
- public static final AutoMap<RunnableWithInfo<String>> mRecipesToGenerate = new AutoMap<RunnableWithInfo<String>>();
- public static final AutoMap<RunnableWithInfo<String>> mGtRecipesToGenerate = new AutoMap<RunnableWithInfo<String>>();
+ // Do Fluid Canning Last, because they're not executed on demand, but rather queued.
+ RecipeGen_FluidCanning.init();
+ }
- public static final AutoMap<RunnableWithInfo<String>> mObjectsToRunInPostInit = new AutoMap<RunnableWithInfo<String>>();
- public static final AutoMap<ItemPackage> mObjectsToRunInOnLoadComplete = new AutoMap<ItemPackage>();
+ public static void onLoadComplete(FMLLoadCompleteEvent event) {
+ runQueuedOnLoadComplete(event);
+ }
- public static void runQueuedRecipes() {
- //Add autogenerated Recipes from Item Components
- for (RunnableWithInfo<String> m : mRecipesToGenerate) {
- try {
- m.run();
- }
- catch (Throwable t) {
- t.printStackTrace();
- Logger.INFO("[ERROR] "+m.getInfoData()+" recipe failed to generated.");
- }
+ public static final AutoMap<RunnableWithInfo<String>> mRecipesToGenerate = new AutoMap<RunnableWithInfo<String>>();
+ public static final AutoMap<RunnableWithInfo<String>> mGtRecipesToGenerate =
+ new AutoMap<RunnableWithInfo<String>>();
- }
- for (RunnableWithInfo<String> m : mGtRecipesToGenerate) {
- try {
- m.run();
- }
- catch (Throwable t) {
- t.printStackTrace();
- Logger.INFO("[ERROR] "+m.getInfoData()+" recipe failed to generated.");
- }
+ public static final AutoMap<RunnableWithInfo<String>> mObjectsToRunInPostInit =
+ new AutoMap<RunnableWithInfo<String>>();
+ public static final AutoMap<ItemPackage> mObjectsToRunInOnLoadComplete = new AutoMap<ItemPackage>();
- }
- }
-
- public static void runQueuedMisc() {
- for (RunnableWithInfo<String> m : mObjectsToRunInPostInit) {
- try {
- m.run();
- }
- catch (Throwable t) {
- t.printStackTrace();
- Logger.INFO("[ERROR] "+m.getInfoData());
- }
+ public static void runQueuedRecipes() {
+ // Add autogenerated Recipes from Item Components
+ for (RunnableWithInfo<String> m : mRecipesToGenerate) {
+ try {
+ m.run();
+ } catch (Throwable t) {
+ t.printStackTrace();
+ Logger.INFO("[ERROR] " + m.getInfoData() + " recipe failed to generated.");
+ }
+ }
+ for (RunnableWithInfo<String> m : mGtRecipesToGenerate) {
+ try {
+ m.run();
+ } catch (Throwable t) {
+ t.printStackTrace();
+ Logger.INFO("[ERROR] " + m.getInfoData() + " recipe failed to generated.");
+ }
+ }
+ }
- }
- }
-
- /**
- * Generally used to register GT recipe map changes after they've been populated.
- */
- public static void runQueuedOnLoadComplete(FMLLoadCompleteEvent event) {
- for (ItemPackage m : mObjectsToRunInOnLoadComplete) {
- try {
- m.onLoadComplete(event);
- }
- catch (Throwable t) {
- t.printStackTrace();
- Logger.INFO("[ERROR] "+m.getInfoData());
- }
+ public static void runQueuedMisc() {
+ for (RunnableWithInfo<String> m : mObjectsToRunInPostInit) {
+ try {
+ m.run();
+ } catch (Throwable t) {
+ t.printStackTrace();
+ Logger.INFO("[ERROR] " + m.getInfoData());
+ }
+ }
+ }
- }
- }
+ /**
+ * Generally used to register GT recipe map changes after they've been populated.
+ */
+ public static void runQueuedOnLoadComplete(FMLLoadCompleteEvent event) {
+ for (ItemPackage m : mObjectsToRunInOnLoadComplete) {
+ try {
+ m.onLoadComplete(event);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ Logger.INFO("[ERROR] " + m.getInfoData());
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
index 166c0f228b..58762cca9d 100644
--- a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
+++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
@@ -24,70 +24,68 @@ import gtPlusPlus.xmod.tinkers.HANDLER_Tinkers;
public class COMPAT_IntermodStaging {
- public static void preInit(FMLPreInitializationEvent preinit){
- HANDLER_GT.preInit();
- HANDLER_GC.preInit();
- HANDLER_TF.preInit();
- HANDLER_FR.preInit();
- HANDLER_IC2.preInit();
- HANDLER_Computronics.preInit();
- HANDLER_BiomesOPlenty.preInit();
- //HANDLER_Mekanism.preInit();
- HANDLER_Thaumcraft.preInit();
- HANDLER_Tinkers.preInit();
- HANDLER_SC2.preInit();
- HANDLER_GalactiCraft.preInit();
- HANDLER_CropsPlusPlus.preInit(preinit);
- HANDLER_Railcraft.preInit();
- HANDLER_Reliquary.preInit();
- HANDLER_OpenBlocks.preInit();
- HANDLER_SpiceOfLife.preInit();
- }
+ public static void preInit(FMLPreInitializationEvent preinit) {
+ HANDLER_GT.preInit();
+ HANDLER_GC.preInit();
+ HANDLER_TF.preInit();
+ HANDLER_FR.preInit();
+ HANDLER_IC2.preInit();
+ HANDLER_Computronics.preInit();
+ HANDLER_BiomesOPlenty.preInit();
+ // HANDLER_Mekanism.preInit();
+ HANDLER_Thaumcraft.preInit();
+ HANDLER_Tinkers.preInit();
+ HANDLER_SC2.preInit();
+ HANDLER_GalactiCraft.preInit();
+ HANDLER_CropsPlusPlus.preInit(preinit);
+ HANDLER_Railcraft.preInit();
+ HANDLER_Reliquary.preInit();
+ HANDLER_OpenBlocks.preInit();
+ HANDLER_SpiceOfLife.preInit();
+ }
- public static void init(FMLInitializationEvent init){
- HANDLER_GT.init();
- HANDLER_GC.init();
- HANDLER_TF.init();
- HANDLER_FR.Init();
- HANDLER_IC2.init();
- HANDLER_Computronics.init();
- HANDLER_BiomesOPlenty.init();
- //HANDLER_Mekanism.init();
- HANDLER_Thaumcraft.init();
- HANDLER_Tinkers.init();
- HANDLER_SC2.init();
- HANDLER_GalactiCraft.init();
- HANDLER_CropsPlusPlus.init(init);
- HANDLER_Railcraft.init();
- HANDLER_Reliquary.init();
- HANDLER_OpenBlocks.init();
- HANDLER_SpiceOfLife.init();
- }
-
- public static void postInit(FMLPostInitializationEvent postinit){
- HANDLER_GT.postInit();
- HANDLER_GC.postInit();
- HANDLER_TF.postInit();
- HANDLER_FR.postInit();
- HANDLER_IC2.postInit();
- HANDLER_Computronics.postInit();
- HANDLER_BiomesOPlenty.postInit();
- //HANDLER_Mekanism.postInit();
- HANDLER_Thaumcraft.postInit();
- HANDLER_Tinkers.postInit();
- HANDLER_SC2.postInit();
- HANDLER_GalactiCraft.postInit();
- HANDLER_CropsPlusPlus.postInit(postinit);
- HANDLER_Railcraft.postInit();
- HANDLER_Reliquary.postInit();
- HANDLER_OpenBlocks.postInit();
- HANDLER_SpiceOfLife.postInit();
- HANDLER_AdvSolar.postInit();
- }
-
- public static void onLoadComplete(FMLLoadCompleteEvent event) {
- HANDLER_GT.onLoadComplete(event);
- }
+ public static void init(FMLInitializationEvent init) {
+ HANDLER_GT.init();
+ HANDLER_GC.init();
+ HANDLER_TF.init();
+ HANDLER_FR.Init();
+ HANDLER_IC2.init();
+ HANDLER_Computronics.init();
+ HANDLER_BiomesOPlenty.init();
+ // HANDLER_Mekanism.init();
+ HANDLER_Thaumcraft.init();
+ HANDLER_Tinkers.init();
+ HANDLER_SC2.init();
+ HANDLER_GalactiCraft.init();
+ HANDLER_CropsPlusPlus.init(init);
+ HANDLER_Railcraft.init();
+ HANDLER_Reliquary.init();
+ HANDLER_OpenBlocks.init();
+ HANDLER_SpiceOfLife.init();
+ }
+ public static void postInit(FMLPostInitializationEvent postinit) {
+ HANDLER_GT.postInit();
+ HANDLER_GC.postInit();
+ HANDLER_TF.postInit();
+ HANDLER_FR.postInit();
+ HANDLER_IC2.postInit();
+ HANDLER_Computronics.postInit();
+ HANDLER_BiomesOPlenty.postInit();
+ // HANDLER_Mekanism.postInit();
+ HANDLER_Thaumcraft.postInit();
+ HANDLER_Tinkers.postInit();
+ HANDLER_SC2.postInit();
+ HANDLER_GalactiCraft.postInit();
+ HANDLER_CropsPlusPlus.postInit(postinit);
+ HANDLER_Railcraft.postInit();
+ HANDLER_Reliquary.postInit();
+ HANDLER_OpenBlocks.postInit();
+ HANDLER_SpiceOfLife.postInit();
+ HANDLER_AdvSolar.postInit();
+ }
+ public static void onLoadComplete(FMLLoadCompleteEvent event) {
+ HANDLER_GT.onLoadComplete(event);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/CraftingManager.java b/src/main/java/gtPlusPlus/core/handler/CraftingManager.java
index 6fb580cc32..7c7069b631 100644
--- a/src/main/java/gtPlusPlus/core/handler/CraftingManager.java
+++ b/src/main/java/gtPlusPlus/core/handler/CraftingManager.java
@@ -2,16 +2,12 @@ package gtPlusPlus.core.handler;
public class CraftingManager {
- public static void mainRegistry() {
- addCraftingRecipies();
- addSmeltingRecipies();
- }
+ public static void mainRegistry() {
+ addCraftingRecipies();
+ addSmeltingRecipies();
+ }
- public static void addCraftingRecipies() {
+ public static void addCraftingRecipies() {}
- }
-
- public static void addSmeltingRecipies() {
-
- }
+ public static void addSmeltingRecipies() {}
}
diff --git a/src/main/java/gtPlusPlus/core/handler/EnumHelperHandler.java b/src/main/java/gtPlusPlus/core/handler/EnumHelperHandler.java
index d164efa3d7..c22cb3bc56 100644
--- a/src/main/java/gtPlusPlus/core/handler/EnumHelperHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/EnumHelperHandler.java
@@ -6,16 +6,14 @@ import gtPlusPlus.xmod.ic2.CustomInternalName;
public class EnumHelperHandler {
- public static void init() {
+ public static void init() {
- if (LoadedMods.IndustrialCraft2) {
- CustomInternalName.init();
- }
-
- if (LoadedMods.Gregtech) {
- HANDLER_GT.addNewOrePrefixes();
- }
-
- }
+ if (LoadedMods.IndustrialCraft2) {
+ CustomInternalName.init();
+ }
+ if (LoadedMods.Gregtech) {
+ HANDLER_GT.addNewOrePrefixes();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java
index 1be3578ed0..9e81f42a2f 100644
--- a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java
@@ -63,192 +63,197 @@ import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler {
- public static final int GUI1 = 0; // Project Table
- public static final int GUI2 = 1; // Helium Generator
- public static final int GUI3 = 2; // BackpackHandler
- public static final int GUI4 = 3; // Workbench
- public static final int GUI5 = 4; // Workbench Adv
- public static final int GUI6 = 5; // Fish trap
- public static final int GUI7 = 6; // Trade table
- public static final int GUI8 = 7; // Circuit Programmer
- public static final int GUI9 = 8; // Grindle
- public static final int GUI10 = 9; // Universal Toolbox
- public static final int GUI11 = 10; // Auto Lunchbox
- public static final int GUI12 = 11; // Bag for Magic Tools
- public static final int GUI13 = 12; // Decayables Chest
- public static final int GUI14 = 13; // Super Jukebox
- public static final int GUI15 = 14; // Pest Killer
- public static final int GUI16 = 15; // Round-Robinator
- public static final int GUI17 = 16; // Egg Box
- public static final int GUI18 = 17; // Volumetric Flask Setter
-
- public static void init() {
-
- Logger.INFO("Registering GUIs.");
- NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler());
- // Register GuiHandler
- // NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new
- // GuiHandler());
- }
-
- @Override // ContainerModTileEntity
- public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
- final int y, final int z) {
- final TileEntity te = world.getTileEntity(x, y, z);
-
- if (te != null) {
- if (ID == GUI1) {
- return new Container_ProjectTable(player.inventory, (TileEntityProjectTable) te);
- } else if (ID == GUI2) {
- return new Container_ModularityTable(player.inventory, (TileEntityModularityTable) te);
- }
- }
-
- if (ID == GUI3) {
- // Use the player's held item to create the inventory
- return new Container_BackpackBase(player, player.inventory,
- new BaseInventoryBackpack(player.getHeldItem()));
- }
-
- if (te != null) {
- if (ID == GUI4) {
- //return new Container_Workbench(player.inventory, (TileEntityWorkbench) te);
- } else if (ID == GUI5) {
- Logger.INFO("sad");
- //return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te);
- } else if (ID == GUI6) {
- return new Container_FishTrap(player.inventory, (TileEntityFishTrap) te);
- } else if (ID == GUI7) {
- return new Container_TradeTable(player.inventory, (TileEntityTradeTable) te);
- } else if (ID == GUI8) {
- return new Container_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te);
- } else if (ID == GUI13) {
- return new Container_DecayablesChest(player.inventory, (TileEntityDecayablesChest) te);
- } else if (ID == GUI14) {
- return new Container_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te);
- } else if (ID == GUI15) {
- return new Container_PestKiller(player.inventory, (TileEntityPestKiller) te);
- } else if (ID == GUI16) {
- return new Container_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
- } else if (ID == GUI17) {
- return new Container_EggBox(player.inventory, (TileEntityEggBox) te);
- } else if (ID == GUI18) {
- return new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te);
- }
- }
-
- if (ID == GUI9) {
- return new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem()));
- }
- // Tool, lunch, magic
- if (ID == GUI10) {
- return new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem()));
- }
- if (ID == GUI11) {
- return new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem()));
- }
- if (ID == GUI12) {
- return new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem()));
- }
-
- return null;
- }
-
- @Override // GuiModTileEntity
- public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
- final int y, final int z) {
- Logger.WARNING("getClientGuiElement Called by: " + player + ", in world: " + player.dimension + " at x:" + x
- + ", y:" + y + ", z:" + z + ".");
- final TileEntity te = world.getTileEntity(x, y, z);
- if (te != null) {
- if (ID == GUI1) {
- return new GUI_ProjectTable(player.inventory, (TileEntityProjectTable) te);
- } else if (ID == GUI2) {
- return new GUI_ModularityTable(player.inventory, (TileEntityModularityTable) te);
- }
- }
-
- if (ID == GUI3) {
- // We have to cast the new container as our custom class
- // and pass in currently held item for the inventory
- return new GuiBaseBackpack(new Container_BackpackBase(player, player.inventory,
- new BaseInventoryBackpack(player.getHeldItem())));
- }
-
- if (te != null) {
- if (ID == GUI4) {
- //return new GUI_Workbench(player.inventory, (TileEntityWorkbench) te);
- } else if (ID == GUI5) {
- Logger.INFO("sad");
- //return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te);
- } else if (ID == GUI6) {
- return new GUI_FishTrap(player.inventory, (TileEntityFishTrap) te);
- } else if (ID == GUI7) {
- return new GUI_TradeTable(player.inventory, (TileEntityTradeTable) te,
- ((TileEntityBase) te).getOwner());
- } else if (ID == GUI8) {
- return new GUI_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te);
- } else if (ID == GUI13) {
- return new GUI_DecayablesChest(player.inventory, (TileEntityDecayablesChest) te);
- } else if (ID == GUI14) {
- return new GUI_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te);
- } else if (ID == GUI15) {
- return new GUI_PestKiller(player.inventory, (TileEntityPestKiller) te);
- } else if (ID == GUI16) {
- return new GUI_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
- } else if (ID == GUI17) {
- return new GUI_EggBox(player.inventory, (TileEntityEggBox) te);
- } else if (ID == GUI18) {
- return new GUI_VolumetricFlaskSetter(new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te));
- }
- }
-
- if (ID == GUI9) {
- return new GuiBaseGrindle(
- new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem())));
- }
-
- // Tool, lunch, magic
- if (ID == GUI10) {
- return new ToolBoxGui(
- new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem())));
- }
- if (ID == GUI11) {
- return new LunchBoxGui(
- new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem())));
- }
- if (ID == GUI12) {
- return new MagicBagGui(
- new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem())));
- }
-
- return null;
- }
-
- // New Methods
- public static void openGui(final EntityPlayer entityplayer, final IGuiManager guiHandler) {
- openGui(entityplayer, guiHandler, (short) 0);
- }
-
- public static void openGui(final EntityPlayer entityplayer, final IGuiManager guiHandler, final short data) {
- final int guiData = encodeGuiData(guiHandler, data);
- final ChunkCoordinates coordinates = guiHandler.getCoordinates();
- entityplayer.openGui(GTplusplus.instance, guiData, entityplayer.worldObj, coordinates.posX, coordinates.posY,
- coordinates.posZ);
- }
-
- private static int encodeGuiData(final IGuiManager guiHandler, final short data) {
- final MU_GuiId guiId = Gui_ID_Registry.getGuiIdForGuiHandler(guiHandler);
- return (data << 16) | guiId.getId();
- }
-
- private static MU_GuiId decodeGuiID(final int guiData) {
- final int guiId = guiData & 0xFF;
- return Gui_ID_Registry.getGuiId(guiId);
- }
-
- private static short decodeGuiData(final int guiId) {
- return (short) (guiId >> 16);
- }
-
-} \ No newline at end of file
+ public static final int GUI1 = 0; // Project Table
+ public static final int GUI2 = 1; // Helium Generator
+ public static final int GUI3 = 2; // BackpackHandler
+ public static final int GUI4 = 3; // Workbench
+ public static final int GUI5 = 4; // Workbench Adv
+ public static final int GUI6 = 5; // Fish trap
+ public static final int GUI7 = 6; // Trade table
+ public static final int GUI8 = 7; // Circuit Programmer
+ public static final int GUI9 = 8; // Grindle
+ public static final int GUI10 = 9; // Universal Toolbox
+ public static final int GUI11 = 10; // Auto Lunchbox
+ public static final int GUI12 = 11; // Bag for Magic Tools
+ public static final int GUI13 = 12; // Decayables Chest
+ public static final int GUI14 = 13; // Super Jukebox
+ public static final int GUI15 = 14; // Pest Killer
+ public static final int GUI16 = 15; // Round-Robinator
+ public static final int GUI17 = 16; // Egg Box
+ public static final int GUI18 = 17; // Volumetric Flask Setter
+
+ public static void init() {
+
+ Logger.INFO("Registering GUIs.");
+ NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler());
+ // Register GuiHandler
+ // NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new
+ // GuiHandler());
+ }
+
+ @Override // ContainerModTileEntity
+ public Object getServerGuiElement(
+ final int ID, final EntityPlayer player, final World world, final int x, final int y, final int z) {
+ final TileEntity te = world.getTileEntity(x, y, z);
+
+ if (te != null) {
+ if (ID == GUI1) {
+ return new Container_ProjectTable(player.inventory, (TileEntityProjectTable) te);
+ } else if (ID == GUI2) {
+ return new Container_ModularityTable(player.inventory, (TileEntityModularityTable) te);
+ }
+ }
+
+ if (ID == GUI3) {
+ // Use the player's held item to create the inventory
+ return new Container_BackpackBase(
+ player, player.inventory, new BaseInventoryBackpack(player.getHeldItem()));
+ }
+
+ if (te != null) {
+ if (ID == GUI4) {
+ // return new Container_Workbench(player.inventory, (TileEntityWorkbench) te);
+ } else if (ID == GUI5) {
+ Logger.INFO("sad");
+ // return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te);
+ } else if (ID == GUI6) {
+ return new Container_FishTrap(player.inventory, (TileEntityFishTrap) te);
+ } else if (ID == GUI7) {
+ return new Container_TradeTable(player.inventory, (TileEntityTradeTable) te);
+ } else if (ID == GUI8) {
+ return new Container_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te);
+ } else if (ID == GUI13) {
+ return new Container_DecayablesChest(player.inventory, (TileEntityDecayablesChest) te);
+ } else if (ID == GUI14) {
+ return new Container_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te);
+ } else if (ID == GUI15) {
+ return new Container_PestKiller(player.inventory, (TileEntityPestKiller) te);
+ } else if (ID == GUI16) {
+ return new Container_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
+ } else if (ID == GUI17) {
+ return new Container_EggBox(player.inventory, (TileEntityEggBox) te);
+ } else if (ID == GUI18) {
+ return new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te);
+ }
+ }
+
+ if (ID == GUI9) {
+ return new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem()));
+ }
+ // Tool, lunch, magic
+ if (ID == GUI10) {
+ return new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem()));
+ }
+ if (ID == GUI11) {
+ return new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem()));
+ }
+ if (ID == GUI12) {
+ return new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem()));
+ }
+
+ return null;
+ }
+
+ @Override // GuiModTileEntity
+ public Object getClientGuiElement(
+ final int ID, final EntityPlayer player, final World world, final int x, final int y, final int z) {
+ Logger.WARNING("getClientGuiElement Called by: " + player + ", in world: " + player.dimension + " at x:" + x
+ + ", y:" + y + ", z:" + z + ".");
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if (te != null) {
+ if (ID == GUI1) {
+ return new GUI_ProjectTable(player.inventory, (TileEntityProjectTable) te);
+ } else if (ID == GUI2) {
+ return new GUI_ModularityTable(player.inventory, (TileEntityModularityTable) te);
+ }
+ }
+
+ if (ID == GUI3) {
+ // We have to cast the new container as our custom class
+ // and pass in currently held item for the inventory
+ return new GuiBaseBackpack(new Container_BackpackBase(
+ player, player.inventory, new BaseInventoryBackpack(player.getHeldItem())));
+ }
+
+ if (te != null) {
+ if (ID == GUI4) {
+ // return new GUI_Workbench(player.inventory, (TileEntityWorkbench) te);
+ } else if (ID == GUI5) {
+ Logger.INFO("sad");
+ // return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te);
+ } else if (ID == GUI6) {
+ return new GUI_FishTrap(player.inventory, (TileEntityFishTrap) te);
+ } else if (ID == GUI7) {
+ return new GUI_TradeTable(
+ player.inventory, (TileEntityTradeTable) te, ((TileEntityBase) te).getOwner());
+ } else if (ID == GUI8) {
+ return new GUI_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te);
+ } else if (ID == GUI13) {
+ return new GUI_DecayablesChest(player.inventory, (TileEntityDecayablesChest) te);
+ } else if (ID == GUI14) {
+ return new GUI_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te);
+ } else if (ID == GUI15) {
+ return new GUI_PestKiller(player.inventory, (TileEntityPestKiller) te);
+ } else if (ID == GUI16) {
+ return new GUI_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
+ } else if (ID == GUI17) {
+ return new GUI_EggBox(player.inventory, (TileEntityEggBox) te);
+ } else if (ID == GUI18) {
+ return new GUI_VolumetricFlaskSetter(
+ new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te));
+ }
+ }
+
+ if (ID == GUI9) {
+ return new GuiBaseGrindle(
+ new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem())));
+ }
+
+ // Tool, lunch, magic
+ if (ID == GUI10) {
+ return new ToolBoxGui(
+ new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem())));
+ }
+ if (ID == GUI11) {
+ return new LunchBoxGui(
+ new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem())));
+ }
+ if (ID == GUI12) {
+ return new MagicBagGui(
+ new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem())));
+ }
+
+ return null;
+ }
+
+ // New Methods
+ public static void openGui(final EntityPlayer entityplayer, final IGuiManager guiHandler) {
+ openGui(entityplayer, guiHandler, (short) 0);
+ }
+
+ public static void openGui(final EntityPlayer entityplayer, final IGuiManager guiHandler, final short data) {
+ final int guiData = encodeGuiData(guiHandler, data);
+ final ChunkCoordinates coordinates = guiHandler.getCoordinates();
+ entityplayer.openGui(
+ GTplusplus.instance,
+ guiData,
+ entityplayer.worldObj,
+ coordinates.posX,
+ coordinates.posY,
+ coordinates.posZ);
+ }
+
+ private static int encodeGuiData(final IGuiManager guiHandler, final short data) {
+ final MU_GuiId guiId = Gui_ID_Registry.getGuiIdForGuiHandler(guiHandler);
+ return (data << 16) | guiId.getId();
+ }
+
+ private static MU_GuiId decodeGuiID(final int guiData) {
+ final int guiId = guiData & 0xFF;
+ return Gui_ID_Registry.getGuiId(guiId);
+ }
+
+ private static short decodeGuiData(final int guiId) {
+ return (short) (guiId >> 16);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/handler/MobMentality.java b/src/main/java/gtPlusPlus/core/handler/MobMentality.java
index acc289fecd..40a4f73d94 100644
--- a/src/main/java/gtPlusPlus/core/handler/MobMentality.java
+++ b/src/main/java/gtPlusPlus/core/handler/MobMentality.java
@@ -1,10 +1,9 @@
package gtPlusPlus.core.handler;
-import java.util.*;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.*;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.IMob;
@@ -13,46 +12,46 @@ import net.minecraftforge.event.entity.living.LivingHurtEvent;
public class MobMentality {
- public static HashSet<Class<EntityLivingBase>> sIgnoredTypes = new HashSet<Class<EntityLivingBase>>();
-
- @SubscribeEvent
- public void onEntityDamaged(LivingHurtEvent event) {
- final EntityLivingBase target = event.entityLiving;
- for (Class<EntityLivingBase> aEntityClass : sIgnoredTypes) {
- if (aEntityClass.isInstance(target)) {
- return;
- }
- }
- if (target instanceof EntityLivingBase) {
- final EntityLivingBase entity = target;
- final Entity attacker = event.source.getSourceOfDamage();
- if (/*this.configuration.shouldIgnoreNeutralMobs() && */!(entity instanceof IMob)) {
- return;
- }
- if (attacker == null) {
- return;
- }
- if (attacker instanceof EntityLivingBase && !PlayerUtils.isRealPlayer((EntityLivingBase) attacker)) {
- return;
- }
- if (attacker instanceof EntityPlayer && PlayerUtils.isCreative((EntityPlayer) attacker)) {
- return;
- }
- if (attacker instanceof EntityLivingBase) {
- List<Entity> aEntityList = target.worldObj.loadedEntityList;
- List<EntityLivingBase> aRangedEntity = new ArrayList<EntityLivingBase>();
- for (Entity aEntity : aEntityList) {
- if (target.getClass().isInstance(aEntity)) {
- if (EntityUtils.getDistance(target, aEntity) <= 32) {
- aRangedEntity.add((EntityLivingBase) aEntity);
- }
- }
- }
- for (EntityLivingBase aEntity : aRangedEntity) {
- aEntity.setRevengeTarget((EntityLivingBase) attacker);
- }
- }
- }
- }
+ public static HashSet<Class<EntityLivingBase>> sIgnoredTypes = new HashSet<Class<EntityLivingBase>>();
+ @SubscribeEvent
+ public void onEntityDamaged(LivingHurtEvent event) {
+ final EntityLivingBase target = event.entityLiving;
+ for (Class<EntityLivingBase> aEntityClass : sIgnoredTypes) {
+ if (aEntityClass.isInstance(target)) {
+ return;
+ }
+ }
+ if (target instanceof EntityLivingBase) {
+ final EntityLivingBase entity = target;
+ final Entity attacker = event.source.getSourceOfDamage();
+ if (
+ /*this.configuration.shouldIgnoreNeutralMobs() && */ !(entity instanceof IMob)) {
+ return;
+ }
+ if (attacker == null) {
+ return;
+ }
+ if (attacker instanceof EntityLivingBase && !PlayerUtils.isRealPlayer((EntityLivingBase) attacker)) {
+ return;
+ }
+ if (attacker instanceof EntityPlayer && PlayerUtils.isCreative((EntityPlayer) attacker)) {
+ return;
+ }
+ if (attacker instanceof EntityLivingBase) {
+ List<Entity> aEntityList = target.worldObj.loadedEntityList;
+ List<EntityLivingBase> aRangedEntity = new ArrayList<EntityLivingBase>();
+ for (Entity aEntity : aEntityList) {
+ if (target.getClass().isInstance(aEntity)) {
+ if (EntityUtils.getDistance(target, aEntity) <= 32) {
+ aRangedEntity.add((EntityLivingBase) aEntity);
+ }
+ }
+ }
+ for (EntityLivingBase aEntity : aRangedEntity) {
+ aEntity.setRevengeTarget((EntityLivingBase) attacker);
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/OldCircuitHandler.java b/src/main/java/gtPlusPlus/core/handler/OldCircuitHandler.java
index e20e13a337..231ae98093 100644
--- a/src/main/java/gtPlusPlus/core/handler/OldCircuitHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/OldCircuitHandler.java
@@ -2,65 +2,94 @@ package gtPlusPlus.core.handler;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableOldGTcircuits;
-import java.lang.reflect.Field;
-import java.util.HashSet;
-
-import org.apache.commons.lang3.reflect.FieldUtils;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.util.EmptyRecipeMap;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.RECIPES_Old_Circuits;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
+import java.lang.reflect.Field;
+import java.util.HashSet;
+import org.apache.commons.lang3.reflect.FieldUtils;
public class OldCircuitHandler {
- public static void preInit(){
- if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH){
- removeCircuitRecipeMap(); //Bye shitty recipes.
- }
- }
-
- public static void init(){
-
- }
+ public static void preInit() {
+ if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) {
+ removeCircuitRecipeMap(); // Bye shitty recipes.
+ }
+ }
- public static void postInit(){
- if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH){
- RECIPES_Old_Circuits.handleCircuits();
- new RECIPES_Old_Circuits();
- }
- }
+ public static void init() {}
- public static boolean addCircuitItems() {
- if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH){
- return MetaGeneratedGregtechItems.INSTANCE.registerOldCircuits();
- }
- return false;
- }
+ public static void postInit() {
+ if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) {
+ RECIPES_Old_Circuits.handleCircuits();
+ new RECIPES_Old_Circuits();
+ }
+ }
- private static boolean removeCircuitRecipeMap(){
- if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH){
- try {
- Logger.INFO("[Old Feature - Circuits] Trying to override the Circuit Assembler Recipe map, so that no recipes for new circuits get added.");
- ReflectionUtils.setFinalStatic(GT_Recipe_Map.class.getDeclaredField("sCircuitAssemblerRecipes"), new EmptyRecipeMap(new HashSet<GT_Recipe>(0), "gt.recipe.removed", "Removed", null, GT_Values.RES_PATH_GUI + "basicmachines/Default", 0, 0, 0, 0, 0, GT_Values.E, 0, GT_Values.E, true, false));
- Field jaffar = GT_Recipe_Map.class.getDeclaredField("sCircuitAssemblerRecipes");
- FieldUtils.removeFinalModifier(jaffar, true);
- jaffar.set(null, new EmptyRecipeMap(new HashSet<GT_Recipe>(0), "gt.recipe.removed", "Removed", null, GT_Values.RES_PATH_GUI + "basicmachines/Default", 0, 0, 0, 0, 0, GT_Values.E, 0, GT_Values.E, true, false));
- Logger.INFO("[Old Feature - Circuits] Successfully replaced circuit assembler recipe map with one that cannot hold recipes.");
- }
- catch (Exception e) {
- Logger.INFO("[Old Feature - Circuits] Failed removing circuit assembler recipe map.");
- return false;
- }
- return true;
- }
- return false;
- }
+ public static boolean addCircuitItems() {
+ if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) {
+ return MetaGeneratedGregtechItems.INSTANCE.registerOldCircuits();
+ }
+ return false;
+ }
+ private static boolean removeCircuitRecipeMap() {
+ if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) {
+ try {
+ Logger.INFO(
+ "[Old Feature - Circuits] Trying to override the Circuit Assembler Recipe map, so that no recipes for new circuits get added.");
+ ReflectionUtils.setFinalStatic(
+ GT_Recipe_Map.class.getDeclaredField("sCircuitAssemblerRecipes"),
+ new EmptyRecipeMap(
+ new HashSet<GT_Recipe>(0),
+ "gt.recipe.removed",
+ "Removed",
+ null,
+ GT_Values.RES_PATH_GUI + "basicmachines/Default",
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ GT_Values.E,
+ 0,
+ GT_Values.E,
+ true,
+ false));
+ Field jaffar = GT_Recipe_Map.class.getDeclaredField("sCircuitAssemblerRecipes");
+ FieldUtils.removeFinalModifier(jaffar, true);
+ jaffar.set(
+ null,
+ new EmptyRecipeMap(
+ new HashSet<GT_Recipe>(0),
+ "gt.recipe.removed",
+ "Removed",
+ null,
+ GT_Values.RES_PATH_GUI + "basicmachines/Default",
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ GT_Values.E,
+ 0,
+ GT_Values.E,
+ true,
+ false));
+ Logger.INFO(
+ "[Old Feature - Circuits] Successfully replaced circuit assembler recipe map with one that cannot hold recipes.");
+ } catch (Exception e) {
+ Logger.INFO("[Old Feature - Circuits] Failed removing circuit assembler recipe map.");
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/PacketHandler.java b/src/main/java/gtPlusPlus/core/handler/PacketHandler.java
index 382b82df29..d77d958373 100644
--- a/src/main/java/gtPlusPlus/core/handler/PacketHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/PacketHandler.java
@@ -15,77 +15,79 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
public class PacketHandler {
-
- private static byte packetId = 0;
- private static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(CORE.MODID);
+ private static byte packetId = 0;
- public static final void init() {
- registerMessage(Packet_VolumetricFlaskGui.class, Packet_VolumetricFlaskGui.class);
- registerMessage(Packet_VolumetricFlaskGui2.class, Packet_VolumetricFlaskGui2.class);
- }
-
- /**
- * Registers a message and message handler
- */
- private static final void registerMessage(Class handlerClass, Class messageClass) {
- Side side = AbstractClientMessageHandler.class.isAssignableFrom(handlerClass) ? Side.CLIENT : Side.SERVER;
- registerMessage(handlerClass, messageClass, side);
- }
-
- private static final void registerMessage(Class handlerClass, Class messageClass, Side side) {
- INSTANCE.registerMessage(handlerClass, messageClass, packetId++, side);
- if (AbstractPacket.class.isInstance(messageClass.getClass())) {
- AbstractPacket aPacket = ReflectionUtils.createNewInstanceFromConstructor(ReflectionUtils.getConstructor(messageClass, new Class[] {}), new Object[] {});
- if (aPacket != null) {
- Logger.INFO("Registered Packet: "+aPacket.getPacketName());
- }
- }
- }
+ private static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(CORE.MODID);
- /**
- * Send this message to the specified player.
- * See {@link SimpleNetworkWrapper#sendTo(IMessage, EntityPlayerMP)}
- */
- public static final void sendTo(IMessage message, EntityPlayerMP player) {
- INSTANCE.sendTo(message, player);
- }
+ public static final void init() {
+ registerMessage(Packet_VolumetricFlaskGui.class, Packet_VolumetricFlaskGui.class);
+ registerMessage(Packet_VolumetricFlaskGui2.class, Packet_VolumetricFlaskGui2.class);
+ }
- /**
- * Send this message to everyone within a certain range of a point.
- * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, NetworkRegistry.TargetPoint)}
- */
- public static final void sendToAllAround(IMessage message, NetworkRegistry.TargetPoint point) {
- INSTANCE.sendToAllAround(message, point);
- }
+ /**
+ * Registers a message and message handler
+ */
+ private static final void registerMessage(Class handlerClass, Class messageClass) {
+ Side side = AbstractClientMessageHandler.class.isAssignableFrom(handlerClass) ? Side.CLIENT : Side.SERVER;
+ registerMessage(handlerClass, messageClass, side);
+ }
- /**
- * Sends a message to everyone within a certain range of the coordinates in the same dimension.
- */
- public static final void sendToAllAround(IMessage message, int dimension, double x, double y, double z, double range) {
- sendToAllAround(message, new NetworkRegistry.TargetPoint(dimension, x, y, z, range));
- }
+ private static final void registerMessage(Class handlerClass, Class messageClass, Side side) {
+ INSTANCE.registerMessage(handlerClass, messageClass, packetId++, side);
+ if (AbstractPacket.class.isInstance(messageClass.getClass())) {
+ AbstractPacket aPacket = ReflectionUtils.createNewInstanceFromConstructor(
+ ReflectionUtils.getConstructor(messageClass, new Class[] {}), new Object[] {});
+ if (aPacket != null) {
+ Logger.INFO("Registered Packet: " + aPacket.getPacketName());
+ }
+ }
+ }
- /**
- * Sends a message to everyone within a certain range of the player provided.
- */
- public static final void sendToAllAround(IMessage message, EntityPlayer player, double range) {
- sendToAllAround(message, player.worldObj.provider.dimensionId, player.posX, player.posY, player.posZ, range);
- }
+ /**
+ * Send this message to the specified player.
+ * See {@link SimpleNetworkWrapper#sendTo(IMessage, EntityPlayerMP)}
+ */
+ public static final void sendTo(IMessage message, EntityPlayerMP player) {
+ INSTANCE.sendTo(message, player);
+ }
- /**
- * Send this message to everyone within the supplied dimension.
- * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, int)}
- */
- public static final void sendToDimension(IMessage message, int dimensionId) {
- INSTANCE.sendToDimension(message, dimensionId);
- }
+ /**
+ * Send this message to everyone within a certain range of a point.
+ * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, NetworkRegistry.TargetPoint)}
+ */
+ public static final void sendToAllAround(IMessage message, NetworkRegistry.TargetPoint point) {
+ INSTANCE.sendToAllAround(message, point);
+ }
- /**
- * Send this message to the server.
- * See {@link SimpleNetworkWrapper#sendToServer(IMessage)}
- */
- public static final void sendToServer(IMessage message) {
- INSTANCE.sendToServer(message);
- }
+ /**
+ * Sends a message to everyone within a certain range of the coordinates in the same dimension.
+ */
+ public static final void sendToAllAround(
+ IMessage message, int dimension, double x, double y, double z, double range) {
+ sendToAllAround(message, new NetworkRegistry.TargetPoint(dimension, x, y, z, range));
+ }
+
+ /**
+ * Sends a message to everyone within a certain range of the player provided.
+ */
+ public static final void sendToAllAround(IMessage message, EntityPlayer player, double range) {
+ sendToAllAround(message, player.worldObj.provider.dimensionId, player.posX, player.posY, player.posZ, range);
+ }
+
+ /**
+ * Send this message to everyone within the supplied dimension.
+ * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, int)}
+ */
+ public static final void sendToDimension(IMessage message, int dimensionId) {
+ INSTANCE.sendToDimension(message, dimensionId);
+ }
+
+ /**
+ * Send this message to the server.
+ * See {@link SimpleNetworkWrapper#sendToServer(IMessage)}
+ */
+ public static final void sendToServer(IMessage message) {
+ INSTANCE.sendToServer(message);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java b/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java
index 360b0440a2..d8e069b5fa 100644
--- a/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java
+++ b/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java
@@ -7,33 +7,33 @@ import net.minecraft.item.ItemStack;
public class DecayableRecipe {
- public static final AutoMap<DecayableRecipe> mRecipes = new AutoMap<DecayableRecipe>();
-
-
- public final int mTime;
- public final ItemStack mInput;
- public final ItemStack mOutput;
+ public static final AutoMap<DecayableRecipe> mRecipes = new AutoMap<DecayableRecipe>();
- public DecayableRecipe(int time, ItemStack input, ItemStack output) {
- mTime = time;
- mInput = input;
- mOutput = output;
- mRecipes.put(this);
- }
+ public final int mTime;
+ public final ItemStack mInput;
+ public final ItemStack mOutput;
- @Override
- public boolean equals(Object o) {
- if (o instanceof DecayableRecipe) {
- DecayableRecipe i = (DecayableRecipe) o;
- if (i.mTime == this.mTime && GT_Utility.areStacksEqual(mInput, i.mInput) && GT_Utility.areStacksEqual(mOutput, i.mOutput)) {
- return true;
- }
- }
- return false;
- }
+ public DecayableRecipe(int time, ItemStack input, ItemStack output) {
+ mTime = time;
+ mInput = input;
+ mOutput = output;
+ mRecipes.put(this);
+ }
- public boolean isValid() {
- return (mTime > 0 && ItemUtils.checkForInvalidItems(mInput) && ItemUtils.checkForInvalidItems(mOutput));
- }
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof DecayableRecipe) {
+ DecayableRecipe i = (DecayableRecipe) o;
+ if (i.mTime == this.mTime
+ && GT_Utility.areStacksEqual(mInput, i.mInput)
+ && GT_Utility.areStacksEqual(mOutput, i.mOutput)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ public boolean isValid() {
+ return (mTime > 0 && ItemUtils.checkForInvalidItems(mInput) && ItemUtils.checkForInvalidItems(mOutput));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java b/src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
index 5bf6374725..3e20194498 100644
--- a/src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
@@ -6,23 +6,22 @@ import gtPlusPlus.core.recipe.ShapedRecipeObject;
public class LateRegistrationHandler {
- public static int recipesSuccess = 0;
- public static int recipesFailed = 0;
+ public static int recipesSuccess = 0;
+ public static int recipesFailed = 0;
- public static void run(){
- init();
- }
-
- private final static void init(){
- for(final ShapedRecipeObject item : COMPAT_HANDLER.AddRecipeQueue){
- item.buildRecipe();
- }
- try {
- Thread.sleep(10);
- } catch (final InterruptedException e) {
- Logger.INFO(e.toString());
- }
- Logger.INFO("Late Recipes Loaded: "+recipesSuccess+" Failed: "+recipesFailed);
- }
+ public static void run() {
+ init();
+ }
+ private static final void init() {
+ for (final ShapedRecipeObject item : COMPAT_HANDLER.AddRecipeQueue) {
+ item.buildRecipe();
+ }
+ try {
+ Thread.sleep(10);
+ } catch (final InterruptedException e) {
+ Logger.INFO(e.toString());
+ }
+ Logger.INFO("Late Recipes Loaded: " + recipesSuccess + " Failed: " + recipesFailed);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
index 4192e71091..f240656dd7 100644
--- a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
@@ -6,22 +6,21 @@ import gtPlusPlus.core.recipe.*;
public class RegistrationHandler {
- public static int recipesSuccess = 0;
- public static int recipesFailed = 0;
+ public static int recipesSuccess = 0;
+ public static int recipesFailed = 0;
- public static void run(){
- init();
- }
-
- private final static void init(){
- RECIPES_Tools.loadRecipes();
- RECIPES_General.loadRecipes();
- RECIPES_Machines.loadRecipes();
- RECIPES_Shapeless.loadRecipes();
- RECIPES_MachineComponents.loadRecipes();
- RECIPE_Batteries.loadRecipes();
- Logger.INFO("Loaded: "+recipesSuccess+" Failed: "+recipesFailed);
- COMPAT_HANDLER.areInitItemsLoaded = true;
- }
+ public static void run() {
+ init();
+ }
+ private static final void init() {
+ RECIPES_Tools.loadRecipes();
+ RECIPES_General.loadRecipes();
+ RECIPES_Machines.loadRecipes();
+ RECIPES_Shapeless.loadRecipes();
+ RECIPES_MachineComponents.loadRecipes();
+ RECIPE_Batteries.loadRecipes();
+ Logger.INFO("Loaded: " + recipesSuccess + " Failed: " + recipesFailed);
+ COMPAT_HANDLER.areInitItemsLoaded = true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java b/src/main/java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java
index 8499f98525..50364f43a3 100644
--- a/src/main/java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java
+++ b/src/main/java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java
@@ -1,49 +1,47 @@
package gtPlusPlus.core.handler;
-import java.lang.reflect.Field;
-
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.event.entity.player.AchievementEvent;
public class StopAnnoyingFuckingAchievements {
- /**
- * Stops me getting fireworks every fucking time I open my inventory upon first loading a dev client.
- * @param event
- */
- @SubscribeEvent(priority=EventPriority.HIGHEST)
- public void FUCK_OFF(AchievementEvent event) {
- if (Utils.isClient()) {
- doClientStuff();
- }
- if (event.achievement.equals(AchievementList.openInventory)) {
- event.setCanceled(true);
- }
- }
-
- @SideOnly(Side.CLIENT)
- private final void doClientStuff() {
- Class aMC = ReflectionUtils.getClass("net.minecraft.client.Minecraft");
- if (aMC != null) {
- Field aInstanceMC = ReflectionUtils.getField(aMC, "theMinecraft");
- Object aMcObj = ReflectionUtils.getFieldValue(null, aInstanceMC);
- Class aClazz2 = aMcObj.getClass();
- if (aClazz2 != null) {
- Field aGameSettings = ReflectionUtils.getField(aClazz2, "gameSettings");
- Object aGameSettingsObj = ReflectionUtils.getFieldValue(aInstanceMC, aGameSettings);
- Class aClazz3 = aGameSettingsObj.getClass();
- if (aClazz3 != null) {
- Field ainvHint = ReflectionUtils.getField(aClazz3, "showInventoryAchievementHint");
- ReflectionUtils.setField(aGameSettingsObj, ainvHint, false);
- }
- }
- }
- }
+ /**
+ * Stops me getting fireworks every fucking time I open my inventory upon first loading a dev client.
+ * @param event
+ */
+ @SubscribeEvent(priority = EventPriority.HIGHEST)
+ public void FUCK_OFF(AchievementEvent event) {
+ if (Utils.isClient()) {
+ doClientStuff();
+ }
+ if (event.achievement.equals(AchievementList.openInventory)) {
+ event.setCanceled(true);
+ }
+ }
+ @SideOnly(Side.CLIENT)
+ private final void doClientStuff() {
+ Class aMC = ReflectionUtils.getClass("net.minecraft.client.Minecraft");
+ if (aMC != null) {
+ Field aInstanceMC = ReflectionUtils.getField(aMC, "theMinecraft");
+ Object aMcObj = ReflectionUtils.getFieldValue(null, aInstanceMC);
+ Class aClazz2 = aMcObj.getClass();
+ if (aClazz2 != null) {
+ Field aGameSettings = ReflectionUtils.getField(aClazz2, "gameSettings");
+ Object aGameSettingsObj = ReflectionUtils.getFieldValue(aInstanceMC, aGameSettings);
+ Class aClazz3 = aGameSettingsObj.getClass();
+ if (aClazz3 != null) {
+ Field ainvHint = ReflectionUtils.getField(aClazz3, "showInventoryAchievementHint");
+ ReflectionUtils.setField(aGameSettingsObj, ainvHint, false);
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java
index 03bb99bb2a..c3eee57118 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java
@@ -3,8 +3,6 @@ package gtPlusPlus.core.handler.events;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropDrainedShard;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropFluoriteOre;
-import java.util.ArrayList;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.ModItems;
@@ -13,6 +11,7 @@ import gtPlusPlus.core.material.nuclear.FLUORIDES;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -23,207 +22,209 @@ import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.oredict.OreDictionary;
public class BlockEventHandler {
- public static ArrayList<ItemStack> oreLimestone;
- public static ArrayList<ItemStack> blockLimestone;
- public static ItemStack fluoriteOre;
-
- public static void init() {
- //Set Variables for Fluorite Block handling
- Logger.INFO("Setting some Variables for the block break event handler.");
- BlockEventHandler.oreLimestone = OreDictionary.getOres("oreLimestone");
- BlockEventHandler.blockLimestone = OreDictionary.getOres("limestone");
- BlockEventHandler.fluoriteOre = FLUORIDES.FLUORITE.getOre(1);
- }
-
- @SubscribeEvent
- public void onBlockLeftClicked(final PlayerInteractEvent event) {
- /*
- * if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
- *
- * ItemStack heldItem = event.entityPlayer.getHeldItem(); Block block =
- * event.world.getBlock(event.x, event.y, event.z);
- *
- * // If the block clicked was Stone, the player was holding an Iron Pickaxe and
- * a random integer from 0 (inclusive) to 2 (exclusive) is 0 (50% chance) if
- * (block == Blocks.stone && heldItem != null && heldItem.getItem() ==
- * Items.iron_pickaxe && random.nextInt(2) == 0) { ForgeDirection direction =
- * ForgeDirection.getOrientation(event.face); // Convert the numeric face to a
- * ForgeDirection int fireX = event.x + direction.offsetX, fireY = event.y +
- * direction.offsetY, fireZ = event.z + direction.offsetZ; // Offset the block's
- * coordinates according to the direction
- *
- * if (event.world.isAirBlock(fireX, fireY, fireZ)) { // If the block at the new
- * coordinates is Air event.world.setBlock(fireX, fireY, fireZ, Blocks.fire); //
- * Replace it with Fire event.useBlock = Event.Result.DENY; // Prevent the Fire
- * from being extinguished (also prevents Block#onBlockClicked from being
- * called) } }
- */
- }
-
- @SubscribeEvent
- public void onEntityDrop(final LivingDropsEvent event) {
- /*
- * if (event.entityLiving instanceof EntityPig && event.source instanceof
- * EntityDamageSource) { // getEntity will return the Entity that caused the
- * damage,even for indirect damage sources like arrows/fireballs // (where it
- * will return the Entity that shot the projectile rather than the projectile
- * itself) Entity sourceEntity = event.source.getEntity(); ItemStack heldItem =
- * sourceEntity instanceof EntityLiving ? ((EntityLiving)
- * sourceEntity).getHeldItem() : sourceEntity instanceof EntityPlayer ?
- * ((EntityPlayer) sourceEntity).getHeldItem() : null;
- *
- * if (heldItem != null && heldItem.getItem() == Items.iron_pickaxe) {
- * System.out.println("EntityPig drops event"); event.drops.clear();
- * event.entityLiving.dropItem(Items.diamond, 64); } }
- */
- }
-
- @SubscribeEvent
- public void onBlockBreak(final BlockEvent.BreakEvent event) {
-
- }
-
-
- // Used to handle Thaumcraft Shards when TC is not installed.
- @SubscribeEvent
- public void harvestDrops(final BlockEvent.HarvestDropsEvent event) {
- try {
-
- if (event != null && event.harvester != null && event.harvester.worldObj != null) {
- if (!event.harvester.worldObj.isRemote) {
-
- EntityPlayer p = event.harvester;
-
- if (PlayerUtils.isRealPlayer(p)) {
- // Spawns Fluorite from Lime Stone
- if (chanceToDropFluoriteOre != 0) {
- if (!oreLimestone.isEmpty() || !blockLimestone.isEmpty()) {
-
- ArrayList<Block> mBlockTypes = new ArrayList<Block>();
- if (!oreLimestone.isEmpty()) {
- for (int i = 0; i < oreLimestone.size(); i++) {
- if (ItemUtils.getModId(oreLimestone.get(i)) != null
- && !ItemUtils.getModId(oreLimestone.get(i)).toLowerCase()
- .contains("biomesoplenty")) {
- if (!mBlockTypes
- .contains(Block.getBlockFromItem(oreLimestone.get(i).getItem()))) {
- mBlockTypes.add(Block.getBlockFromItem(oreLimestone.get(i).getItem()));
- }
- }
- }
- }
- if (!blockLimestone.isEmpty()) {
- for (int i = 0; i < blockLimestone.size(); i++) {
- if (ItemUtils.getModId(blockLimestone.get(i)) != null
- && !ItemUtils.getModId(blockLimestone.get(i)).toLowerCase()
- .contains("biomesoplenty")) {
- if (!mBlockTypes.contains(
- Block.getBlockFromItem(blockLimestone.get(i).getItem()))) {
- mBlockTypes
- .add(Block.getBlockFromItem(blockLimestone.get(i).getItem()));
- }
- }
- }
- }
-
- Logger.WARNING("Found Limestone in OreDict.");
- if (!mBlockTypes.isEmpty()) {
- Logger.WARNING("1a | " + event.block.getUnlocalizedName());
- for (final Block temp : mBlockTypes) {
- Logger.WARNING("2a - " + temp.getUnlocalizedName());
- if (event.block == temp) {
- Logger.WARNING("3a - found " + temp.getUnlocalizedName());
- if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) {
- Logger.WARNING("4a");
- event.drops.clear();
- event.drops.add(fluoriteOre.copy());
- }
- }
- }
- }
- }
-
- if (event.block.getUnlocalizedName().toLowerCase().contains("limestone")) {
- Logger.WARNING("1c");
- if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) {
- Logger.WARNING("2c");
- event.drops.clear();
- event.drops.add(fluoriteOre.copy());
- }
- }
-
- if (event.block == Blocks.sandstone) {
- if (MathUtils.randInt(1, chanceToDropFluoriteOre * 20) == 1) {
- event.drops.clear();
- event.drops.add(fluoriteOre.copy());
- }
- }
- }
- }
-
- // Do things that can occur for fake players and real players
-
- // Spawn Dull Shards (Can spawn from Tree Logs, Grass or Stone. Stone going to
- // be the most common source.)
- if (((event.block == Blocks.stone) || (event.block == Blocks.sandstone)
- || (event.block == Blocks.log) || (event.block == Blocks.log2)
- || (event.block == Blocks.grass)) && !LoadedMods.Thaumcraft
- && (chanceToDropDrainedShard != 0)) {
- // small chance for one to spawn per stone mined. 1 per 3 stacks~
- if (MathUtils.randInt(1, chanceToDropDrainedShard) == 1) {
- // Let's sort out a lucky charm for the player.
- final int FancyChance = MathUtils.randInt(1, 4);
- if (MathUtils.randInt(1, 100) < 90) {
- event.drops.add(new ItemStack(ModItems.shardDull));
- }
- // Make a Fire Shard
- else if (FancyChance == 1) {
- event.drops.add(new ItemStack(ModItems.shardIgnis));
- }
- // Make a Water Shard.
- else if (FancyChance == 2) {
- event.drops.add(new ItemStack(ModItems.shardAqua));
- }
- // Make an Earth Shard.
- else if (FancyChance == 3) {
- event.drops.add(new ItemStack(ModItems.shardTerra));
- }
- // Make an Air Shard.
- else if (FancyChance == 4) {
- event.drops.add(new ItemStack(ModItems.shardAer));
- }
- } else {
- Logger.WARNING("invalid chance");
- }
- }
-
- }
- }
- } catch (Throwable r) {
- Logger.INFO("Block Event Handler Failed. Please Report this to Alkalus.");
- r.printStackTrace();
- }
- }
-
- @SubscribeEvent
- public void logsHarvest(final BlockEvent.HarvestDropsEvent event) {
- /*
- * if (event.block instanceof BlockLog) { //
- * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/
- * modification-development/2444501-harvestdropevent-changing-drops-of-vanilla-
- * blocks
- *
- * // Utils.sendServerMessage("Logs! Harvester: %s Drops: %s", event.harvester
- * != null ? event.harvester.getCommandSenderName() : "<none>",
- * event.drops.stream().map(ItemStack.toString()).collect(Collectors.
- * joining(", "))); if (event.harvester != null) { ItemStack heldItem =
- * event.harvester.getHeldItem(); if (heldItem == null ||
- * heldItem.getItem().getHarvestLevel(heldItem, "axe") < 1) {
- * event.drops.clear();
- * Utils.sendServerMessage("Harvester had wrong tool, clearing drops"); } else {
- * Utils.sendServerMessage("Harvester had correct tool, not clearing drops"); }
- * } else { event.drops.clear();
- * Utils.sendServerMessage("No harvester, clearing drops"); } }
- */
- }
+ public static ArrayList<ItemStack> oreLimestone;
+ public static ArrayList<ItemStack> blockLimestone;
+ public static ItemStack fluoriteOre;
+
+ public static void init() {
+ // Set Variables for Fluorite Block handling
+ Logger.INFO("Setting some Variables for the block break event handler.");
+ BlockEventHandler.oreLimestone = OreDictionary.getOres("oreLimestone");
+ BlockEventHandler.blockLimestone = OreDictionary.getOres("limestone");
+ BlockEventHandler.fluoriteOre = FLUORIDES.FLUORITE.getOre(1);
+ }
+
+ @SubscribeEvent
+ public void onBlockLeftClicked(final PlayerInteractEvent event) {
+ /*
+ * if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
+ *
+ * ItemStack heldItem = event.entityPlayer.getHeldItem(); Block block =
+ * event.world.getBlock(event.x, event.y, event.z);
+ *
+ * // If the block clicked was Stone, the player was holding an Iron Pickaxe and
+ * a random integer from 0 (inclusive) to 2 (exclusive) is 0 (50% chance) if
+ * (block == Blocks.stone && heldItem != null && heldItem.getItem() ==
+ * Items.iron_pickaxe && random.nextInt(2) == 0) { ForgeDirection direction =
+ * ForgeDirection.getOrientation(event.face); // Convert the numeric face to a
+ * ForgeDirection int fireX = event.x + direction.offsetX, fireY = event.y +
+ * direction.offsetY, fireZ = event.z + direction.offsetZ; // Offset the block's
+ * coordinates according to the direction
+ *
+ * if (event.world.isAirBlock(fireX, fireY, fireZ)) { // If the block at the new
+ * coordinates is Air event.world.setBlock(fireX, fireY, fireZ, Blocks.fire); //
+ * Replace it with Fire event.useBlock = Event.Result.DENY; // Prevent the Fire
+ * from being extinguished (also prevents Block#onBlockClicked from being
+ * called) } }
+ */
+ }
+
+ @SubscribeEvent
+ public void onEntityDrop(final LivingDropsEvent event) {
+ /*
+ * if (event.entityLiving instanceof EntityPig && event.source instanceof
+ * EntityDamageSource) { // getEntity will return the Entity that caused the
+ * damage,even for indirect damage sources like arrows/fireballs // (where it
+ * will return the Entity that shot the projectile rather than the projectile
+ * itself) Entity sourceEntity = event.source.getEntity(); ItemStack heldItem =
+ * sourceEntity instanceof EntityLiving ? ((EntityLiving)
+ * sourceEntity).getHeldItem() : sourceEntity instanceof EntityPlayer ?
+ * ((EntityPlayer) sourceEntity).getHeldItem() : null;
+ *
+ * if (heldItem != null && heldItem.getItem() == Items.iron_pickaxe) {
+ * System.out.println("EntityPig drops event"); event.drops.clear();
+ * event.entityLiving.dropItem(Items.diamond, 64); } }
+ */
+ }
+
+ @SubscribeEvent
+ public void onBlockBreak(final BlockEvent.BreakEvent event) {}
+
+ // Used to handle Thaumcraft Shards when TC is not installed.
+ @SubscribeEvent
+ public void harvestDrops(final BlockEvent.HarvestDropsEvent event) {
+ try {
+
+ if (event != null && event.harvester != null && event.harvester.worldObj != null) {
+ if (!event.harvester.worldObj.isRemote) {
+
+ EntityPlayer p = event.harvester;
+
+ if (PlayerUtils.isRealPlayer(p)) {
+ // Spawns Fluorite from Lime Stone
+ if (chanceToDropFluoriteOre != 0) {
+ if (!oreLimestone.isEmpty() || !blockLimestone.isEmpty()) {
+
+ ArrayList<Block> mBlockTypes = new ArrayList<Block>();
+ if (!oreLimestone.isEmpty()) {
+ for (int i = 0; i < oreLimestone.size(); i++) {
+ if (ItemUtils.getModId(oreLimestone.get(i)) != null
+ && !ItemUtils.getModId(oreLimestone.get(i))
+ .toLowerCase()
+ .contains("biomesoplenty")) {
+ if (!mBlockTypes.contains(Block.getBlockFromItem(
+ oreLimestone.get(i).getItem()))) {
+ mBlockTypes.add(Block.getBlockFromItem(
+ oreLimestone.get(i).getItem()));
+ }
+ }
+ }
+ }
+ if (!blockLimestone.isEmpty()) {
+ for (int i = 0; i < blockLimestone.size(); i++) {
+ if (ItemUtils.getModId(blockLimestone.get(i)) != null
+ && !ItemUtils.getModId(blockLimestone.get(i))
+ .toLowerCase()
+ .contains("biomesoplenty")) {
+ if (!mBlockTypes.contains(Block.getBlockFromItem(
+ blockLimestone.get(i).getItem()))) {
+ mBlockTypes.add(Block.getBlockFromItem(
+ blockLimestone.get(i).getItem()));
+ }
+ }
+ }
+ }
+
+ Logger.WARNING("Found Limestone in OreDict.");
+ if (!mBlockTypes.isEmpty()) {
+ Logger.WARNING("1a | " + event.block.getUnlocalizedName());
+ for (final Block temp : mBlockTypes) {
+ Logger.WARNING("2a - " + temp.getUnlocalizedName());
+ if (event.block == temp) {
+ Logger.WARNING("3a - found " + temp.getUnlocalizedName());
+ if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) {
+ Logger.WARNING("4a");
+ event.drops.clear();
+ event.drops.add(fluoriteOre.copy());
+ }
+ }
+ }
+ }
+ }
+
+ if (event.block.getUnlocalizedName().toLowerCase().contains("limestone")) {
+ Logger.WARNING("1c");
+ if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) {
+ Logger.WARNING("2c");
+ event.drops.clear();
+ event.drops.add(fluoriteOre.copy());
+ }
+ }
+
+ if (event.block == Blocks.sandstone) {
+ if (MathUtils.randInt(1, chanceToDropFluoriteOre * 20) == 1) {
+ event.drops.clear();
+ event.drops.add(fluoriteOre.copy());
+ }
+ }
+ }
+ }
+
+ // Do things that can occur for fake players and real players
+
+ // Spawn Dull Shards (Can spawn from Tree Logs, Grass or Stone. Stone going to
+ // be the most common source.)
+ if (((event.block == Blocks.stone)
+ || (event.block == Blocks.sandstone)
+ || (event.block == Blocks.log)
+ || (event.block == Blocks.log2)
+ || (event.block == Blocks.grass))
+ && !LoadedMods.Thaumcraft
+ && (chanceToDropDrainedShard != 0)) {
+ // small chance for one to spawn per stone mined. 1 per 3 stacks~
+ if (MathUtils.randInt(1, chanceToDropDrainedShard) == 1) {
+ // Let's sort out a lucky charm for the player.
+ final int FancyChance = MathUtils.randInt(1, 4);
+ if (MathUtils.randInt(1, 100) < 90) {
+ event.drops.add(new ItemStack(ModItems.shardDull));
+ }
+ // Make a Fire Shard
+ else if (FancyChance == 1) {
+ event.drops.add(new ItemStack(ModItems.shardIgnis));
+ }
+ // Make a Water Shard.
+ else if (FancyChance == 2) {
+ event.drops.add(new ItemStack(ModItems.shardAqua));
+ }
+ // Make an Earth Shard.
+ else if (FancyChance == 3) {
+ event.drops.add(new ItemStack(ModItems.shardTerra));
+ }
+ // Make an Air Shard.
+ else if (FancyChance == 4) {
+ event.drops.add(new ItemStack(ModItems.shardAer));
+ }
+ } else {
+ Logger.WARNING("invalid chance");
+ }
+ }
+ }
+ }
+ } catch (Throwable r) {
+ Logger.INFO("Block Event Handler Failed. Please Report this to Alkalus.");
+ r.printStackTrace();
+ }
+ }
+
+ @SubscribeEvent
+ public void logsHarvest(final BlockEvent.HarvestDropsEvent event) {
+ /*
+ * if (event.block instanceof BlockLog) { //
+ * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/
+ * modification-development/2444501-harvestdropevent-changing-drops-of-vanilla-
+ * blocks
+ *
+ * // Utils.sendServerMessage("Logs! Harvester: %s Drops: %s", event.harvester
+ * != null ? event.harvester.getCommandSenderName() : "<none>",
+ * event.drops.stream().map(ItemStack.toString()).collect(Collectors.
+ * joining(", "))); if (event.harvester != null) { ItemStack heldItem =
+ * event.harvester.getHeldItem(); if (heldItem == null ||
+ * heldItem.getItem().getHarvestLevel(heldItem, "axe") < 1) {
+ * event.drops.clear();
+ * Utils.sendServerMessage("Harvester had wrong tool, clearing drops"); } else {
+ * Utils.sendServerMessage("Harvester had correct tool, not clearing drops"); }
+ * } else { event.drops.clear();
+ * Utils.sendServerMessage("No harvester, clearing drops"); } }
+ */
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java b/src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java
index b70e58d009..523b926882 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java
@@ -11,153 +11,132 @@ import net.minecraft.util.MovementInputFromOptions;
public class CustomMovementHandler {
- public boolean isDisabled;
- public boolean canDoubleTap;
-
- public boolean sprint = false;
- public boolean sprintHeldAndReleased = false;
- public boolean sprintDoubleTapped = false;
-
- private long lastPressed;
- private long lastSprintPressed;
- private boolean handledSneakPress;
- private boolean handledSprintPress;
- private boolean wasRiding;
-
- /*
- * MovementInputFromOptions.updatePlayerMoveState()
- */
- public void update(final Minecraft mc, final MovementInputFromOptions options, final EntityPlayerSP thisPlayer)
- {
- options.moveStrafe = 0.0F;
- options.moveForward = 0.0F;
-
- final GameSettings settings = mc.gameSettings;
-
- if(settings.keyBindForward.getIsKeyPressed())
- {
- ++options.moveForward;
- }
-
- if(settings.keyBindBack.getIsKeyPressed())
- {
- --options.moveForward;
- }
-
- if(settings.keyBindLeft.getIsKeyPressed())
- {
- ++options.moveStrafe;
- }
-
- if(settings.keyBindRight.getIsKeyPressed())
- {
- --options.moveStrafe;
- }
-
- options.jump = settings.keyBindJump.getIsKeyPressed();
-
- //
- // Sneak Toggle - Essentially the same as old ToggleSneak
- //
-
- // Check to see if Enabled - Added 6/17/14 to provide option to disable Sneak Toggle
- final boolean isSneaking = SneakManager.get(thisPlayer).Sneaking();
- //Utils.LOG_INFO("Can sneak: "+isSneaking);
- //Utils.LOG_INFO("Can sprint: "+SneakManager.Sprinting());
- if (isSneaking)
- {
- // Key Pressed
- if (settings.keyBindSneak.getIsKeyPressed() && !this.handledSneakPress)
- {
- // Descend if we are flying, note if we were riding (so we can unsneak once dismounted)
- if(thisPlayer.isRiding() || thisPlayer.capabilities.isFlying)
- {
- options.sneak = true;
- this.wasRiding = thisPlayer.isRiding();
- }
- else
- {
- options.sneak = !options.sneak;
- }
-
- this.lastPressed = System.currentTimeMillis();
- this.handledSneakPress = true;
- }
-
- // Key Released
- if (!settings.keyBindSneak.getIsKeyPressed() && this.handledSneakPress)
- {
- // If we are flying or riding, stop sneaking after descent/dismount.
- if(thisPlayer.capabilities.isFlying || this.wasRiding)
- {
- options.sneak = false;
- this.wasRiding = false;
- }
- // If the key was held down for more than 300ms, stop sneaking upon release.
- else if((System.currentTimeMillis() - this.lastPressed) > 300L)
- {
- options.sneak = false;
- }
-
- this.handledSneakPress = false;
- }
- }
- else
- {
- options.sneak = settings.keyBindSneak.getIsKeyPressed();
- }
-
- if(options.sneak || SneakManager.get(thisPlayer).Sneaking())
- {
- options.moveStrafe = (float)(options.moveStrafe * 0.3D);
- options.moveForward = (float)(options.moveForward * 0.3D);
- }
-
- //
- // Sprint Toggle - Updated 6/18/2014
- //
-
- // Establish conditions where we don't want to start a sprint - sneaking, riding, flying, hungry
- final boolean enoughHunger = (thisPlayer.getFoodStats().getFoodLevel() > 6.0F) || thisPlayer.capabilities.isFlying;
- final boolean canSprint = !options.sneak && !thisPlayer.isRiding() && !thisPlayer.capabilities.isFlying && enoughHunger;
-
- this.isDisabled = !SneakManager.get(thisPlayer).Sprinting();
- this.canDoubleTap = SneakManager.get(thisPlayer).optionDoubleTap;
-
- // Key Pressed
- if((canSprint || this.isDisabled) && settings.keyBindSprint.getIsKeyPressed() && !this.handledSprintPress)
- {
- if(!this.isDisabled)
- {
- this.sprint = !this.sprint;
- this.lastSprintPressed = System.currentTimeMillis();
- this.handledSprintPress = true;
- this.sprintHeldAndReleased = false;
- }
- }
-
- // Key Released
- if((canSprint || this.isDisabled) && !settings.keyBindSprint.getIsKeyPressed() && this.handledSprintPress)
- {
- // Was key held for longer than 300ms? If so, mark it so we can resume vanilla behavior
- if((System.currentTimeMillis() - this.lastSprintPressed) > 300L)
- {
- this.sprintHeldAndReleased = true;
- }
- this.handledSprintPress = false;
- }
-
- }
-
- public void UpdateSprint(final boolean newValue, final boolean doubleTapped, SneakManager aSneak){
- if (!aSneak.Sprinting()){
- this.sprint = false;
- this.sprintDoubleTapped = doubleTapped;
- }
- else{
- this.sprint = newValue;
- this.sprintDoubleTapped = doubleTapped;
- }
- }
-
-} \ No newline at end of file
+ public boolean isDisabled;
+ public boolean canDoubleTap;
+
+ public boolean sprint = false;
+ public boolean sprintHeldAndReleased = false;
+ public boolean sprintDoubleTapped = false;
+
+ private long lastPressed;
+ private long lastSprintPressed;
+ private boolean handledSneakPress;
+ private boolean handledSprintPress;
+ private boolean wasRiding;
+
+ /*
+ * MovementInputFromOptions.updatePlayerMoveState()
+ */
+ public void update(final Minecraft mc, final MovementInputFromOptions options, final EntityPlayerSP thisPlayer) {
+ options.moveStrafe = 0.0F;
+ options.moveForward = 0.0F;
+
+ final GameSettings settings = mc.gameSettings;
+
+ if (settings.keyBindForward.getIsKeyPressed()) {
+ ++options.moveForward;
+ }
+
+ if (settings.keyBindBack.getIsKeyPressed()) {
+ --options.moveForward;
+ }
+
+ if (settings.keyBindLeft.getIsKeyPressed()) {
+ ++options.moveStrafe;
+ }
+
+ if (settings.keyBindRight.getIsKeyPressed()) {
+ --options.moveStrafe;
+ }
+
+ options.jump = settings.keyBindJump.getIsKeyPressed();
+
+ //
+ // Sneak Toggle - Essentially the same as old ToggleSneak
+ //
+
+ // Check to see if Enabled - Added 6/17/14 to provide option to disable Sneak Toggle
+ final boolean isSneaking = SneakManager.get(thisPlayer).Sneaking();
+ // Utils.LOG_INFO("Can sneak: "+isSneaking);
+ // Utils.LOG_INFO("Can sprint: "+SneakManager.Sprinting());
+ if (isSneaking) {
+ // Key Pressed
+ if (settings.keyBindSneak.getIsKeyPressed() && !this.handledSneakPress) {
+ // Descend if we are flying, note if we were riding (so we can unsneak once dismounted)
+ if (thisPlayer.isRiding() || thisPlayer.capabilities.isFlying) {
+ options.sneak = true;
+ this.wasRiding = thisPlayer.isRiding();
+ } else {
+ options.sneak = !options.sneak;
+ }
+
+ this.lastPressed = System.currentTimeMillis();
+ this.handledSneakPress = true;
+ }
+
+ // Key Released
+ if (!settings.keyBindSneak.getIsKeyPressed() && this.handledSneakPress) {
+ // If we are flying or riding, stop sneaking after descent/dismount.
+ if (thisPlayer.capabilities.isFlying || this.wasRiding) {
+ options.sneak = false;
+ this.wasRiding = false;
+ }
+ // If the key was held down for more than 300ms, stop sneaking upon release.
+ else if ((System.currentTimeMillis() - this.lastPressed) > 300L) {
+ options.sneak = false;
+ }
+
+ this.handledSneakPress = false;
+ }
+ } else {
+ options.sneak = settings.keyBindSneak.getIsKeyPressed();
+ }
+
+ if (options.sneak || SneakManager.get(thisPlayer).Sneaking()) {
+ options.moveStrafe = (float) (options.moveStrafe * 0.3D);
+ options.moveForward = (float) (options.moveForward * 0.3D);
+ }
+
+ //
+ // Sprint Toggle - Updated 6/18/2014
+ //
+
+ // Establish conditions where we don't want to start a sprint - sneaking, riding, flying, hungry
+ final boolean enoughHunger =
+ (thisPlayer.getFoodStats().getFoodLevel() > 6.0F) || thisPlayer.capabilities.isFlying;
+ final boolean canSprint =
+ !options.sneak && !thisPlayer.isRiding() && !thisPlayer.capabilities.isFlying && enoughHunger;
+
+ this.isDisabled = !SneakManager.get(thisPlayer).Sprinting();
+ this.canDoubleTap = SneakManager.get(thisPlayer).optionDoubleTap;
+
+ // Key Pressed
+ if ((canSprint || this.isDisabled) && settings.keyBindSprint.getIsKeyPressed() && !this.handledSprintPress) {
+ if (!this.isDisabled) {
+ this.sprint = !this.sprint;
+ this.lastSprintPressed = System.currentTimeMillis();
+ this.handledSprintPress = true;
+ this.sprintHeldAndReleased = false;
+ }
+ }
+
+ // Key Released
+ if ((canSprint || this.isDisabled) && !settings.keyBindSprint.getIsKeyPressed() && this.handledSprintPress) {
+ // Was key held for longer than 300ms? If so, mark it so we can resume vanilla behavior
+ if ((System.currentTimeMillis() - this.lastSprintPressed) > 300L) {
+ this.sprintHeldAndReleased = true;
+ }
+ this.handledSprintPress = false;
+ }
+ }
+
+ public void UpdateSprint(final boolean newValue, final boolean doubleTapped, SneakManager aSneak) {
+ if (!aSneak.Sprinting()) {
+ this.sprint = false;
+ this.sprintDoubleTapped = doubleTapped;
+ } else {
+ this.sprint = newValue;
+ this.sprintDoubleTapped = doubleTapped;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java b/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java
index 967a51fad6..fd88d735e8 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java
@@ -10,51 +10,52 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent;
public class EnderDragonDeathHandler {
- private static final String mDragonClassName = "chylex.hee.entity.boss.EntityBossDragon";
- private static final boolean mHEE;
- private static final Class mHardcoreDragonClass;
-
- private static final String mChaosDragonClassName = "com.brandon3055.draconicevolution.common.entity.EntityCustomDragon";
- private static final boolean mDE;
- private static final Class mChaoseDragonClass;
-
- static {
- mHEE = ReflectionUtils.doesClassExist(mDragonClassName);
- mHardcoreDragonClass = (mHEE ? ReflectionUtils.getClass(mDragonClassName) : null);
- mDE = ReflectionUtils.doesClassExist(mChaosDragonClassName);
- mChaoseDragonClass = (mDE ? ReflectionUtils.getClass(mChaosDragonClassName) : null);
- }
-
- @SubscribeEvent
- public void onEntityDrop(LivingDropsEvent event) {
-
- int aCountTotal = 0;
-
- if (mHEE && mHardcoreDragonClass != null && mHardcoreDragonClass.isInstance(event.entityLiving)) {
- for (int y = 0; y < MathUtils.randInt(100, 250); y++) {
- int aAmount = MathUtils.randInt(5, 25);
- event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1));
- aCountTotal = +aAmount;
- }
- }
- else if (mDE && mChaoseDragonClass != null && mChaoseDragonClass.isInstance(event.entityLiving)) {
- for (int y = 0; y < MathUtils.randInt(100, 200); y++) {
- int aAmount = MathUtils.randInt(1, 5);
- event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getIngot(aAmount), MathUtils.randFloat(0, 1));
- aCountTotal = +aAmount;
- }
- }
- else if (event.entityLiving instanceof EntityDragon) {
- for (int y = 0; y < MathUtils.randInt(25, 50); y++) {
- int aAmount = MathUtils.randInt(1, 10);
- event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1));
- aCountTotal = +aAmount;
- }
- }
- if (aCountTotal > 0) {
- PlayerUtils.messageAllPlayers(aCountTotal + " Shards of Dragons Blood have crystalized into a metallic form.");
- }
-
- }
-
+ private static final String mDragonClassName = "chylex.hee.entity.boss.EntityBossDragon";
+ private static final boolean mHEE;
+ private static final Class mHardcoreDragonClass;
+
+ private static final String mChaosDragonClassName =
+ "com.brandon3055.draconicevolution.common.entity.EntityCustomDragon";
+ private static final boolean mDE;
+ private static final Class mChaoseDragonClass;
+
+ static {
+ mHEE = ReflectionUtils.doesClassExist(mDragonClassName);
+ mHardcoreDragonClass = (mHEE ? ReflectionUtils.getClass(mDragonClassName) : null);
+ mDE = ReflectionUtils.doesClassExist(mChaosDragonClassName);
+ mChaoseDragonClass = (mDE ? ReflectionUtils.getClass(mChaosDragonClassName) : null);
+ }
+
+ @SubscribeEvent
+ public void onEntityDrop(LivingDropsEvent event) {
+
+ int aCountTotal = 0;
+
+ if (mHEE && mHardcoreDragonClass != null && mHardcoreDragonClass.isInstance(event.entityLiving)) {
+ for (int y = 0; y < MathUtils.randInt(100, 250); y++) {
+ int aAmount = MathUtils.randInt(5, 25);
+ event.entityLiving.entityDropItem(
+ ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1));
+ aCountTotal = +aAmount;
+ }
+ } else if (mDE && mChaoseDragonClass != null && mChaoseDragonClass.isInstance(event.entityLiving)) {
+ for (int y = 0; y < MathUtils.randInt(100, 200); y++) {
+ int aAmount = MathUtils.randInt(1, 5);
+ event.entityLiving.entityDropItem(
+ ELEMENT.STANDALONE.DRAGON_METAL.getIngot(aAmount), MathUtils.randFloat(0, 1));
+ aCountTotal = +aAmount;
+ }
+ } else if (event.entityLiving instanceof EntityDragon) {
+ for (int y = 0; y < MathUtils.randInt(25, 50); y++) {
+ int aAmount = MathUtils.randInt(1, 10);
+ event.entityLiving.entityDropItem(
+ ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1));
+ aCountTotal = +aAmount;
+ }
+ }
+ if (aCountTotal > 0) {
+ PlayerUtils.messageAllPlayers(
+ aCountTotal + " Shards of Dragons Blood have crystalized into a metallic form.");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java b/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java
index 391672e028..9548d80f62 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.handler.events;
-import java.util.HashMap;
-import java.util.HashSet;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -11,6 +8,8 @@ import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.HashMap;
+import java.util.HashSet;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -18,107 +17,107 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent;
public class EntityDeathHandler {
-
- private static final HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>> mMobDropMap = new HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>>();
- private static final HashSet<Class> mInternalClassKeyCache = new HashSet<Class>();
-
- /**
- * Provides the ability to provide custom drops upon the death of EntityLivingBase objects.
- * @param aMobClass - The Base Class you want to drop this item.
- * @param aStack - The ItemStack, stack size is not respected.
- * @param aMaxAmount - The maximum size of the ItemStack which drops.
- * @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
- */
- public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aMaxAmount, int aChance) {
- Triplet<ItemStack, Integer, Integer> aData = new Triplet<ItemStack, Integer, Integer>(aStack, aMaxAmount, aChance);
- AutoMap<Triplet<ItemStack, Integer, Integer>> aDataMap = mMobDropMap.get(aMobClass);
- if (aDataMap == null) {
- aDataMap = new AutoMap<Triplet<ItemStack, Integer, Integer>>();
- }
- aDataMap.put(aData);
- mMobDropMap.put(aMobClass, aDataMap);
-
- Logger.INFO("[Loot] Registered "+aStack.getDisplayName()+" (1-"+aMaxAmount+") as a valid drop for "+aMobClass.getCanonicalName());
-
- if (!mInternalClassKeyCache.contains(aMobClass)) {
- mInternalClassKeyCache.add(aMobClass);
- }
-
- }
-
- private static ItemStack processItemDropTriplet(Triplet<ItemStack, Integer, Integer> aData) {
- ItemStack aLoot = aData.getValue_1();
- int aMaxDrop = aData.getValue_2();
- int aChanceOutOf10000 = aData.getValue_3();
- if (MathUtils.randInt(0, 10000) <= aChanceOutOf10000) {
- aLoot = ItemUtils.getSimpleStack(aLoot, MathUtils.randInt(1, aMaxDrop));
- if (ItemUtils.checkForInvalidItems(aLoot)) {
- return aLoot;
- }
- }
- return null;
- }
-
- private static boolean processDropsForMob(EntityLivingBase entityLiving) {
- AutoMap<Triplet<ItemStack, Integer, Integer>> aMobData = mMobDropMap.get(entityLiving.getClass());
- boolean aDidDrop = false;
- if (aMobData != null) {
- if (!aMobData.isEmpty()) {
- ItemStack aPossibleDrop;
- for (Triplet<ItemStack, Integer, Integer> g : aMobData) {
- aPossibleDrop = processItemDropTriplet(g);
- if (aPossibleDrop != null) {
- if (entityLiving.entityDropItem(aPossibleDrop, MathUtils.randFloat(0, 1)) != null) {
- aDidDrop = true;
- }
- }
- }
- }
- }
- return aDidDrop;
- }
-
-
-
- private static void dropMeatFromPlayer(EntityPlayer aPlayer) {
-
- // always drop some meat.
- int aBigMeatStackSize1 = MathUtils.randInt(4, 8);
- aPlayer.entityDropItem(ItemUtils.simpleMetaStack(ModItems.itemMetaFood, 0, aBigMeatStackSize1), MathUtils.randInt(0, 1));
-
- // additional chances for more meat.
- if (MathUtils.randInt(0, 10) < 7) {
- int aBigMeatStackSize2 = MathUtils.randInt(4, 8);
- aPlayer.entityDropItem(ItemUtils.simpleMetaStack(ModItems.itemMetaFood, 0, aBigMeatStackSize2), MathUtils.randInt(0, 1));
- }
- if (MathUtils.randInt(0, 10) < 4) {
- int aBigMeatStackSize3 = MathUtils.randInt(4, 8);
- aPlayer.entityDropItem(ItemUtils.simpleMetaStack(ModItems.itemMetaFood, 0, aBigMeatStackSize3), MathUtils.randInt(0, 1));
- }
- if (MathUtils.randInt(0, 10) < 2) {
- int aBigMeatStackSize4 = MathUtils.randInt(4, 8);
- aPlayer.entityDropItem(ItemUtils.simpleMetaStack(ModItems.itemMetaFood, 0, aBigMeatStackSize4), MathUtils.randInt(0, 1));
- }
-
- }
-
- @SubscribeEvent
- public void onEntityDrop(LivingDropsEvent event) {
- boolean aDidDrop = false;
- if (event == null || event.entityLiving == null) {
- return;
- }
- if (PlayerUtils.isRealPlayer(event.entityLiving)) {
- EntityPlayer aPlayer = (EntityPlayer) event.entityLiving;
- dropMeatFromPlayer(aPlayer);
- }
- else {
- for (Class c : mInternalClassKeyCache) {
- if (c.isInstance(event.entityLiving)) {
- aDidDrop = processDropsForMob(event.entityLiving);
- }
- }
- }
- }
-
+ private static final HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>> mMobDropMap =
+ new HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>>();
+ private static final HashSet<Class> mInternalClassKeyCache = new HashSet<Class>();
+
+ /**
+ * Provides the ability to provide custom drops upon the death of EntityLivingBase objects.
+ * @param aMobClass - The Base Class you want to drop this item.
+ * @param aStack - The ItemStack, stack size is not respected.
+ * @param aMaxAmount - The maximum size of the ItemStack which drops.
+ * @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
+ */
+ public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aMaxAmount, int aChance) {
+ Triplet<ItemStack, Integer, Integer> aData =
+ new Triplet<ItemStack, Integer, Integer>(aStack, aMaxAmount, aChance);
+ AutoMap<Triplet<ItemStack, Integer, Integer>> aDataMap = mMobDropMap.get(aMobClass);
+ if (aDataMap == null) {
+ aDataMap = new AutoMap<Triplet<ItemStack, Integer, Integer>>();
+ }
+ aDataMap.put(aData);
+ mMobDropMap.put(aMobClass, aDataMap);
+
+ Logger.INFO("[Loot] Registered " + aStack.getDisplayName() + " (1-" + aMaxAmount + ") as a valid drop for "
+ + aMobClass.getCanonicalName());
+
+ if (!mInternalClassKeyCache.contains(aMobClass)) {
+ mInternalClassKeyCache.add(aMobClass);
+ }
+ }
+
+ private static ItemStack processItemDropTriplet(Triplet<ItemStack, Integer, Integer> aData) {
+ ItemStack aLoot = aData.getValue_1();
+ int aMaxDrop = aData.getValue_2();
+ int aChanceOutOf10000 = aData.getValue_3();
+ if (MathUtils.randInt(0, 10000) <= aChanceOutOf10000) {
+ aLoot = ItemUtils.getSimpleStack(aLoot, MathUtils.randInt(1, aMaxDrop));
+ if (ItemUtils.checkForInvalidItems(aLoot)) {
+ return aLoot;
+ }
+ }
+ return null;
+ }
+
+ private static boolean processDropsForMob(EntityLivingBase entityLiving) {
+ AutoMap<Triplet<ItemStack, Integer, Integer>> aMobData = mMobDropMap.get(entityLiving.getClass());
+ boolean aDidDrop = false;
+ if (aMobData != null) {
+ if (!aMobData.isEmpty()) {
+ ItemStack aPossibleDrop;
+ for (Triplet<ItemStack, Integer, Integer> g : aMobData) {
+ aPossibleDrop = processItemDropTriplet(g);
+ if (aPossibleDrop != null) {
+ if (entityLiving.entityDropItem(aPossibleDrop, MathUtils.randFloat(0, 1)) != null) {
+ aDidDrop = true;
+ }
+ }
+ }
+ }
+ }
+ return aDidDrop;
+ }
+
+ private static void dropMeatFromPlayer(EntityPlayer aPlayer) {
+
+ // always drop some meat.
+ int aBigMeatStackSize1 = MathUtils.randInt(4, 8);
+ aPlayer.entityDropItem(
+ ItemUtils.simpleMetaStack(ModItems.itemMetaFood, 0, aBigMeatStackSize1), MathUtils.randInt(0, 1));
+
+ // additional chances for more meat.
+ if (MathUtils.randInt(0, 10) < 7) {
+ int aBigMeatStackSize2 = MathUtils.randInt(4, 8);
+ aPlayer.entityDropItem(
+ ItemUtils.simpleMetaStack(ModItems.itemMetaFood, 0, aBigMeatStackSize2), MathUtils.randInt(0, 1));
+ }
+ if (MathUtils.randInt(0, 10) < 4) {
+ int aBigMeatStackSize3 = MathUtils.randInt(4, 8);
+ aPlayer.entityDropItem(
+ ItemUtils.simpleMetaStack(ModItems.itemMetaFood, 0, aBigMeatStackSize3), MathUtils.randInt(0, 1));
+ }
+ if (MathUtils.randInt(0, 10) < 2) {
+ int aBigMeatStackSize4 = MathUtils.randInt(4, 8);
+ aPlayer.entityDropItem(
+ ItemUtils.simpleMetaStack(ModItems.itemMetaFood, 0, aBigMeatStackSize4), MathUtils.randInt(0, 1));
+ }
+ }
+
+ @SubscribeEvent
+ public void onEntityDrop(LivingDropsEvent event) {
+ boolean aDidDrop = false;
+ if (event == null || event.entityLiving == null) {
+ return;
+ }
+ if (PlayerUtils.isRealPlayer(event.entityLiving)) {
+ EntityPlayer aPlayer = (EntityPlayer) event.entityLiving;
+ dropMeatFromPlayer(aPlayer);
+ } else {
+ for (Class c : mInternalClassKeyCache) {
+ if (c.isInstance(event.entityLiving)) {
+ aDidDrop = processDropsForMob(event.entityLiving);
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java
index de3e958b2d..074c03e75f 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.handler.events;
-import static gregtech.api.enums.GT_Values.MOD_ID_APC;
-
import advsolar.common.AdvancedSolarPanel;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@@ -23,112 +21,126 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent;
public class GeneralTooltipEventHandler {
- ItemStack[] mGregtechTurbines = new ItemStack[6];
- String mTurbine;
- String mExtra;
-
- @SubscribeEvent
- public void onItemTooltip(ItemTooltipEvent event){
-
-
- if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED && GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.SERVER_START) {
- return;
- }
- if (event.itemStack == null) {
- return;
- }
- if (CORE.ConfigSwitches.chanceToDropFluoriteOre > 0) {
- if (BlockEventHandler.blockLimestone != null && !BlockEventHandler.blockLimestone.isEmpty()) {
- for (ItemStack h : BlockEventHandler.blockLimestone) {
- if (h != null && Block.getBlockFromItem(h.getItem()) == Block.getBlockFromItem(event.itemStack.getItem())) {
- if (ItemUtils.getModId(h) != null && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) {
- event.toolTip.add("May contain Fluorite Ore");
- }
- }
- }
- }
- if (BlockEventHandler.oreLimestone != null && !BlockEventHandler.oreLimestone.isEmpty()) {
- for (ItemStack h : BlockEventHandler.oreLimestone) {
- if (h != null && Block.getBlockFromItem(h.getItem()) == Block.getBlockFromItem(event.itemStack.getItem())) {
- if (ItemUtils.getModId(h) != null && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) {
- event.toolTip.add("May contain Fluorite Ore");
- }
- }
- }
- }
- }
-
- //Material Collector Tooltips
- if (ModBlocks.blockPooCollector != null && Block.getBlockFromItem(event.itemStack.getItem()) == ModBlocks.blockPooCollector) {
- //Normal
- if (event.itemStack.getItemDamage() == 0) {
- event.toolTip.add("Used to collect animal waste");
- event.toolTip.add("Collects in a 5x4x5 area starting at Y+1");
- event.toolTip.add("Use Hoppers/Pipes to empty");
- event.toolTip.add(EnumChatFormatting.GOLD+"Capacity: "+EnumChatFormatting.AQUA+"8000L");
- }
- //Advanced
- else {
- event.toolTip.add("Used to collect waste (Works on more than animals)");
- event.toolTip.add("Significantly faster than the simple version");
- event.toolTip.add("Collects in a 5x4x5 area starting at Y+1");
- event.toolTip.add("Use Hoppers/Pipes to empty");
- event.toolTip.add(EnumChatFormatting.GOLD+"Capacity: "+EnumChatFormatting.AQUA+"128000L");
- }
- }
-
- // Custom Flasks
-
- if (GregtechItemList.VOLUMETRIC_FLASK_8k.hasBeenSet() && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_8k.getItem()) {
- event.toolTip.add("Max Capacity: "+MathUtils.formatNumbers(8000)+"L");
- }
- if (GregtechItemList.VOLUMETRIC_FLASK_32k.hasBeenSet() && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_32k.getItem()) {
- event.toolTip.add("Max Capacity: "+MathUtils.formatNumbers(32000)+"L");
- }
-
- if (LoadedMods.AdvancedSolarPanel) {
- molecularTransformer(event);
- }
-
-
- if (CORE.ConfigSwitches.enableAnimatedTurbines) {
- boolean shift = false;
- try {
-
- if (KeyboardUtils.isShiftKeyDown()) {
- shift = true;
- mTurbine = "Animated Turbines can be disabled in the GT++ config";
- }
- else {
- mTurbine = EnumChatFormatting.ITALIC+"<Hold Shift>"+EnumChatFormatting.RESET;
- }
- for (int t=0;t<6;t++) {
- if (mGregtechTurbines[t] != null) {
- if (ItemStack.areItemStacksEqual(event.itemStack, mGregtechTurbines[t])){
- event.toolTip.add(mTurbine);
- if (shift) {
- if (mExtra == null) {
- mExtra = CORE.GT_Tooltip;
- }
- event.toolTip.add(mExtra);
- }
- }
- }
- else {
- mGregtechTurbines[t] = (t == 0 ? ItemList.Generator_Steam_Turbine_LV.get(1) : (t == 1 ? ItemList.Generator_Steam_Turbine_MV.get(1) : (t == 2 ? ItemList.Generator_Steam_Turbine_HV.get(1) : (t == 3 ? ItemList.Generator_Gas_Turbine_LV.get(1) : (t == 4 ? ItemList.Generator_Gas_Turbine_MV.get(1) : (ItemList.Generator_Gas_Turbine_HV.get(1)))))));
- }
- }
- }
- catch (Throwable t) {}
- }
-
- }
+ ItemStack[] mGregtechTurbines = new ItemStack[6];
+ String mTurbine;
+ String mExtra;
+
+ @SubscribeEvent
+ public void onItemTooltip(ItemTooltipEvent event) {
+
+ if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED
+ && GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.SERVER_START) {
+ return;
+ }
+ if (event.itemStack == null) {
+ return;
+ }
+ if (CORE.ConfigSwitches.chanceToDropFluoriteOre > 0) {
+ if (BlockEventHandler.blockLimestone != null && !BlockEventHandler.blockLimestone.isEmpty()) {
+ for (ItemStack h : BlockEventHandler.blockLimestone) {
+ if (h != null
+ && Block.getBlockFromItem(h.getItem())
+ == Block.getBlockFromItem(event.itemStack.getItem())) {
+ if (ItemUtils.getModId(h) != null
+ && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) {
+ event.toolTip.add("May contain Fluorite Ore");
+ }
+ }
+ }
+ }
+ if (BlockEventHandler.oreLimestone != null && !BlockEventHandler.oreLimestone.isEmpty()) {
+ for (ItemStack h : BlockEventHandler.oreLimestone) {
+ if (h != null
+ && Block.getBlockFromItem(h.getItem())
+ == Block.getBlockFromItem(event.itemStack.getItem())) {
+ if (ItemUtils.getModId(h) != null
+ && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) {
+ event.toolTip.add("May contain Fluorite Ore");
+ }
+ }
+ }
+ }
+ }
+
+ // Material Collector Tooltips
+ if (ModBlocks.blockPooCollector != null
+ && Block.getBlockFromItem(event.itemStack.getItem()) == ModBlocks.blockPooCollector) {
+ // Normal
+ if (event.itemStack.getItemDamage() == 0) {
+ event.toolTip.add("Used to collect animal waste");
+ event.toolTip.add("Collects in a 5x4x5 area starting at Y+1");
+ event.toolTip.add("Use Hoppers/Pipes to empty");
+ event.toolTip.add(EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.AQUA + "8000L");
+ }
+ // Advanced
+ else {
+ event.toolTip.add("Used to collect waste (Works on more than animals)");
+ event.toolTip.add("Significantly faster than the simple version");
+ event.toolTip.add("Collects in a 5x4x5 area starting at Y+1");
+ event.toolTip.add("Use Hoppers/Pipes to empty");
+ event.toolTip.add(EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.AQUA + "128000L");
+ }
+ }
+
+ // Custom Flasks
+
+ if (GregtechItemList.VOLUMETRIC_FLASK_8k.hasBeenSet()
+ && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_8k.getItem()) {
+ event.toolTip.add("Max Capacity: " + MathUtils.formatNumbers(8000) + "L");
+ }
+ if (GregtechItemList.VOLUMETRIC_FLASK_32k.hasBeenSet()
+ && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_32k.getItem()) {
+ event.toolTip.add("Max Capacity: " + MathUtils.formatNumbers(32000) + "L");
+ }
+
+ if (LoadedMods.AdvancedSolarPanel) {
+ molecularTransformer(event);
+ }
+
+ if (CORE.ConfigSwitches.enableAnimatedTurbines) {
+ boolean shift = false;
+ try {
+
+ if (KeyboardUtils.isShiftKeyDown()) {
+ shift = true;
+ mTurbine = "Animated Turbines can be disabled in the GT++ config";
+ } else {
+ mTurbine = EnumChatFormatting.ITALIC + "<Hold Shift>" + EnumChatFormatting.RESET;
+ }
+ for (int t = 0; t < 6; t++) {
+ if (mGregtechTurbines[t] != null) {
+ if (ItemStack.areItemStacksEqual(event.itemStack, mGregtechTurbines[t])) {
+ event.toolTip.add(mTurbine);
+ if (shift) {
+ if (mExtra == null) {
+ mExtra = CORE.GT_Tooltip;
+ }
+ event.toolTip.add(mExtra);
+ }
+ }
+ } else {
+ mGregtechTurbines[t] = (t == 0
+ ? ItemList.Generator_Steam_Turbine_LV.get(1)
+ : (t == 1
+ ? ItemList.Generator_Steam_Turbine_MV.get(1)
+ : (t == 2
+ ? ItemList.Generator_Steam_Turbine_HV.get(1)
+ : (t == 3
+ ? ItemList.Generator_Gas_Turbine_LV.get(1)
+ : (t == 4
+ ? ItemList.Generator_Gas_Turbine_MV.get(1)
+ : (ItemList.Generator_Gas_Turbine_HV.get(1)))))));
+ }
+ }
+ } catch (Throwable t) {
+ }
+ }
+ }
@Optional.Method(modid = "AdvancedSolarPanel")
- public static void molecularTransformer(ItemTooltipEvent event) {
- if (event.itemStack.getItem() == Item.getItemFromBlock(AdvancedSolarPanel.blockMolecularTransformer)) {
- event.toolTip.add(""+EnumChatFormatting.RED+"Disabled, Use the multiblock");
- }
- }
-
+ public static void molecularTransformer(ItemTooltipEvent event) {
+ if (event.itemStack.getItem() == Item.getItemFromBlock(AdvancedSolarPanel.blockMolecularTransformer)) {
+ event.toolTip.add("" + EnumChatFormatting.RED + "Disabled, Use the multiblock");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/LoginEventHandler.java
index 1a8d87882e..c03fbd7ff6 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/LoginEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/LoginEventHandler.java
@@ -1,128 +1,119 @@
package gtPlusPlus.core.handler.events;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.UUID;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.proxy.ClientProxy;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.player.PlayerCache;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.UUID;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
public class LoginEventHandler {
- public String localPlayersName;
- public UUID localPlayersUUID;
- private EntityPlayer localPlayerRef;
-
- @SubscribeEvent
- public void onPlayerLogin(final PlayerEvent.PlayerLoggedInEvent event) {
-
- this.localPlayerRef = event.player;
- this.localPlayersName = event.player.getDisplayName();
- this.localPlayersUUID = event.player.getUniqueID();
-
- //Set this for easier use elsewhere.
- if (event.player.getEntityWorld().isRemote){
- ClientProxy.playerName = this.localPlayersName;
- }
-
- try {
- //new SegmentAnalytics(event.player);
- }
- catch (Throwable t){
- //SegmentAnalytics.LOG("Failed to create Analytics submission during log in process.");
- }
-
- try {
-
-
- if (this.localPlayerRef instanceof EntityPlayerMP){
-
- //Populates player cache
- if (!this.localPlayerRef.worldObj.isRemote){
- PlayerCache.appendParamChanges(this.localPlayersName, this.localPlayersUUID.toString());
- }
-
-
- /*if (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009") || localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
- Utils.LOG_INFO("Spawning a new Santa Thread.");
- Thread t = new Thread() {
- UUID threadHandlerIDthing = localPlayersUUID;
- @Override
- public void run() {
- while(true && Minecraft.getMinecraft().getIntegratedServer() != null) {
- try {
- if(localPlayerRef == null){
- localPlayerRef = Utils.getPlayerOnServerFromUUID(threadHandlerIDthing);
- }
-
-
- //ImQ009 is a legend.
- if (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009")){
- Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
- localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.itemIngotRaisinBread, MathUtils.randInt(1, 5)));
- }
-
-
- if (localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
- Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
- localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.itemIngotRaisinBread, MathUtils.randInt(1, 5)));
- }
- Thread.sleep(1000*60*MathUtils.randInt(15, 90));
- } catch (InterruptedException ie) {
- Utils.LOG_INFO("Santa Mode Disabled.");
- }
- }
-
- Utils.LOG_INFO("Thread Stopped. Handler Closed.");
-
- }
- };
- //t.start();
-
-
- }*/
-
-
- }
- } catch (final Throwable errr){
- Logger.INFO("Login Handler encountered an error.");
-
- }
- }
-
- //Handles notifying the player about a version update.
- public Timer ShortTimer(EntityPlayer localPlayer, final int seconds) {
- Timer timer;
- timer = new Timer();
- timer.schedule(new NotifyPlayer(localPlayer), seconds * 1000);
- return timer;
- }
-
- //Timer Task for notifying the player.
- class NotifyPlayer extends TimerTask {
- final EntityPlayer toMessage;
- public NotifyPlayer(EntityPlayer localPlayer) {
- toMessage = localPlayer;
- }
-
- @Override
- public void run() {
- if (toMessage != null){
- if (toMessage instanceof EntityPlayerMP){
- PlayerUtils.messagePlayer(toMessage, "You're not using the latest recommended version of GT++, consider updating.");
- }
- }
- }
- }
-
-} \ No newline at end of file
+ public String localPlayersName;
+ public UUID localPlayersUUID;
+ private EntityPlayer localPlayerRef;
+
+ @SubscribeEvent
+ public void onPlayerLogin(final PlayerEvent.PlayerLoggedInEvent event) {
+
+ this.localPlayerRef = event.player;
+ this.localPlayersName = event.player.getDisplayName();
+ this.localPlayersUUID = event.player.getUniqueID();
+
+ // Set this for easier use elsewhere.
+ if (event.player.getEntityWorld().isRemote) {
+ ClientProxy.playerName = this.localPlayersName;
+ }
+
+ try {
+ // new SegmentAnalytics(event.player);
+ } catch (Throwable t) {
+ // SegmentAnalytics.LOG("Failed to create Analytics submission during log in process.");
+ }
+
+ try {
+
+ if (this.localPlayerRef instanceof EntityPlayerMP) {
+
+ // Populates player cache
+ if (!this.localPlayerRef.worldObj.isRemote) {
+ PlayerCache.appendParamChanges(this.localPlayersName, this.localPlayersUUID.toString());
+ }
+
+ /*if (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009") || localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
+ Utils.LOG_INFO("Spawning a new Santa Thread.");
+ Thread t = new Thread() {
+ UUID threadHandlerIDthing = localPlayersUUID;
+ @Override
+ public void run() {
+ while(true && Minecraft.getMinecraft().getIntegratedServer() != null) {
+ try {
+ if(localPlayerRef == null){
+ localPlayerRef = Utils.getPlayerOnServerFromUUID(threadHandlerIDthing);
+ }
+
+
+ //ImQ009 is a legend.
+ if (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009")){
+ Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
+ localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.itemIngotRaisinBread, MathUtils.randInt(1, 5)));
+ }
+
+
+ if (localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
+ Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
+ localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.itemIngotRaisinBread, MathUtils.randInt(1, 5)));
+ }
+ Thread.sleep(1000*60*MathUtils.randInt(15, 90));
+ } catch (InterruptedException ie) {
+ Utils.LOG_INFO("Santa Mode Disabled.");
+ }
+ }
+
+ Utils.LOG_INFO("Thread Stopped. Handler Closed.");
+
+ }
+ };
+ //t.start();
+
+
+ }*/
+
+ }
+ } catch (final Throwable errr) {
+ Logger.INFO("Login Handler encountered an error.");
+ }
+ }
+
+ // Handles notifying the player about a version update.
+ public Timer ShortTimer(EntityPlayer localPlayer, final int seconds) {
+ Timer timer;
+ timer = new Timer();
+ timer.schedule(new NotifyPlayer(localPlayer), seconds * 1000);
+ return timer;
+ }
+
+ // Timer Task for notifying the player.
+ class NotifyPlayer extends TimerTask {
+ final EntityPlayer toMessage;
+
+ public NotifyPlayer(EntityPlayer localPlayer) {
+ toMessage = localPlayer;
+ }
+
+ @Override
+ public void run() {
+ if (toMessage != null) {
+ if (toMessage instanceof EntityPlayerMP) {
+ PlayerUtils.messagePlayer(
+ toMessage, "You're not using the latest recommended version of GT++, consider updating.");
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/MissingMappingsEvent.java b/src/main/java/gtPlusPlus/core/handler/events/MissingMappingsEvent.java
index 31600a36c3..e4535cb6e1 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/MissingMappingsEvent.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/MissingMappingsEvent.java
@@ -2,55 +2,50 @@ package gtPlusPlus.core.handler.events;
import static gtPlusPlus.core.item.base.dusts.BaseItemDustEx.mCachedPileLinkages;
-import org.apache.commons.lang3.StringUtils;
-
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
-
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.item.ItemStack;
+import org.apache.commons.lang3.StringUtils;
public class MissingMappingsEvent {
- @EventHandler
- public void onMissingMapping(FMLMissingMappingsEvent event){
- for(MissingMapping mapping : event.get()) {
- boolean bool1 = mapping.name.contains(CORE.MODID);
- //Missing Blocks
- if(mapping.type == cpw.mods.fml.common.registry.GameRegistry.Type.BLOCK && bool1) {
-
- //Example
- //if(mapping.name.equals("PneumaticCraft:etchingAcid")) {
- // mapping.remap(Fluids.etchingAcid.getBlock());
- //}
-
-
- }
-
- //Missing Items
- if(mapping.type == cpw.mods.fml.common.registry.GameRegistry.Type.ITEM && bool1) {
-
- //Example
- //if(mapping.name.equals("PneumaticCraft:etchingAcidBucket")) {
- // mapping.remap(Fluids.getBucket(Fluids.etchingAcid));
- //}
-
- if(mapping.name.contains("miscutils:itemDustTiny")) {
- ItemStack stack = null;
- String missingItemString = StringUtils.remove(mapping.name, "miscutils:itemDustTiny");
- missingItemString = StringUtils.prependIfMissing(missingItemString, "item.itemDust");
- if (mCachedPileLinkages.containsKey(missingItemString)) {
- //stack = ItemUtils.getSimpleStack(Item.itemRegistry.)
- Logger.REFLECTION("Mapping Event Found Missing Item in the Pile Linkage Cache.");
- }
-
- //mapping.remap(stack.getItem());
- }
-
- }
- }
- }
+ @EventHandler
+ public void onMissingMapping(FMLMissingMappingsEvent event) {
+ for (MissingMapping mapping : event.get()) {
+ boolean bool1 = mapping.name.contains(CORE.MODID);
+ // Missing Blocks
+ if (mapping.type == cpw.mods.fml.common.registry.GameRegistry.Type.BLOCK && bool1) {
+
+ // Example
+ // if(mapping.name.equals("PneumaticCraft:etchingAcid")) {
+ // mapping.remap(Fluids.etchingAcid.getBlock());
+ // }
+
+ }
+
+ // Missing Items
+ if (mapping.type == cpw.mods.fml.common.registry.GameRegistry.Type.ITEM && bool1) {
+
+ // Example
+ // if(mapping.name.equals("PneumaticCraft:etchingAcidBucket")) {
+ // mapping.remap(Fluids.getBucket(Fluids.etchingAcid));
+ // }
+
+ if (mapping.name.contains("miscutils:itemDustTiny")) {
+ ItemStack stack = null;
+ String missingItemString = StringUtils.remove(mapping.name, "miscutils:itemDustTiny");
+ missingItemString = StringUtils.prependIfMissing(missingItemString, "item.itemDust");
+ if (mCachedPileLinkages.containsKey(missingItemString)) {
+ // stack = ItemUtils.getSimpleStack(Item.itemRegistry.)
+ Logger.REFLECTION("Mapping Event Found Missing Item in the Pile Linkage Cache.");
+ }
+
+ // mapping.remap(stack.getItem());
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
index 956d045b3e..0c8470fa3b 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
@@ -1,80 +1,82 @@
package gtPlusPlus.core.handler.events;
-import java.util.List;
-import java.util.UUID;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.ChunkPosition;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaSafeBlockBase;
+import java.util.List;
+import java.util.UUID;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.ChunkPosition;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
import net.minecraftforge.event.world.ExplosionEvent;
public class PickaxeBlockBreakEventHandler {
- @SubscribeEvent
- public void onBreakBlock(final BreakEvent event) {
- try{
- final TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z);
- if (entity != null){
- if (entity instanceof BaseMetaTileEntity) {
- final EntityPlayer playerInternal = event.getPlayer();
- final IMetaTileEntity X = ((BaseMetaTileEntity)entity).getMetaTileEntity();
- if(X instanceof GregtechMetaSafeBlockBase) {
- final UUID ownerUUID = ((GregtechMetaSafeBlockBase)X).ownerUUID;
- final UUID accessorUUID = playerInternal.getUniqueID();
- if (((GregtechMetaSafeBlockBase)X).bUnbreakable){
- if (accessorUUID == ownerUUID){
- PlayerUtils.messagePlayer(playerInternal, "Since you own this block, it has been destroyed.");
- }
- else {
- PlayerUtils.messagePlayer(playerInternal, "Since you do not own this block, it has not been destroyed.");
- event.setCanceled(true);
- }
- }
- }
- }
-
- }
- }
- catch (final NullPointerException e) {
- //System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: "+e.getCause());
- }
- }
-
- @SubscribeEvent
- public void onExplode(ExplosionEvent.Detonate event) {
- try {
- @SuppressWarnings("unchecked")
- List<ChunkPosition> pos = event.explosion.affectedBlockPositions;
- for(int i = 0;i<pos.size();i++) {
- ChunkPosition blockpos = (ChunkPosition) pos.get(i);
- TileEntity entity = event.world.getTileEntity(blockpos.chunkPosX, blockpos.chunkPosY, blockpos.chunkPosZ);
- if (entity != null){
- if (entity instanceof BaseMetaTileEntity) {
- final IMetaTileEntity X = ((BaseMetaTileEntity)entity).getMetaTileEntity();
- if (X instanceof GregtechMetaSafeBlockBase) {
- pos.remove(i);
- }
- }
- }
- }
- }
- catch (final NullPointerException e) {
-
- }
-
- }
+ @SubscribeEvent
+ public void onBreakBlock(final BreakEvent event) {
+ try {
+ final TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z);
+ if (entity != null) {
+ if (entity instanceof BaseMetaTileEntity) {
+ final EntityPlayer playerInternal = event.getPlayer();
+ final IMetaTileEntity X = ((BaseMetaTileEntity) entity).getMetaTileEntity();
+ if (X instanceof GregtechMetaSafeBlockBase) {
+ final UUID ownerUUID = ((GregtechMetaSafeBlockBase) X).ownerUUID;
+ final UUID accessorUUID = playerInternal.getUniqueID();
+ if (((GregtechMetaSafeBlockBase) X).bUnbreakable) {
+ if (accessorUUID == ownerUUID) {
+ PlayerUtils.messagePlayer(
+ playerInternal, "Since you own this block, it has been destroyed.");
+ } else {
+ PlayerUtils.messagePlayer(
+ playerInternal, "Since you do not own this block, it has not been destroyed.");
+ event.setCanceled(true);
+ }
+ }
+ }
+ }
+ }
+ } catch (final NullPointerException e) {
+ // System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: "+e.getCause());
+ }
+ }
+
+ @SubscribeEvent
+ public void onExplode(ExplosionEvent.Detonate event) {
+ try {
+ @SuppressWarnings("unchecked")
+ List<ChunkPosition> pos = event.explosion.affectedBlockPositions;
+ for (int i = 0; i < pos.size(); i++) {
+ ChunkPosition blockpos = (ChunkPosition) pos.get(i);
+ TileEntity entity =
+ event.world.getTileEntity(blockpos.chunkPosX, blockpos.chunkPosY, blockpos.chunkPosZ);
+ if (entity != null) {
+ if (entity instanceof BaseMetaTileEntity) {
+ final IMetaTileEntity X = ((BaseMetaTileEntity) entity).getMetaTileEntity();
+ if (X instanceof GregtechMetaSafeBlockBase) {
+ pos.remove(i);
+ }
+ }
+ }
+ }
+ } catch (final NullPointerException e) {
+ }
+ }
- @SubscribeEvent
- public void onPlayerInteraction(final PlayerInteractEvent aEvent) {
- if ((aEvent.entityPlayer != null) && (aEvent.entityPlayer.worldObj != null) && (aEvent.action != null) && (aEvent.world.provider != null) && !aEvent.entityPlayer.worldObj.isRemote && (aEvent.action != null) && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR)) {
- //Utils.LOG_ERROR("Test");
- }
- }
+ @SubscribeEvent
+ public void onPlayerInteraction(final PlayerInteractEvent aEvent) {
+ if ((aEvent.entityPlayer != null)
+ && (aEvent.entityPlayer.worldObj != null)
+ && (aEvent.action != null)
+ && (aEvent.world.provider != null)
+ && !aEvent.entityPlayer.worldObj.isRemote
+ && (aEvent.action != null)
+ && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR)) {
+ // Utils.LOG_ERROR("Test");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
index b78d80e0b2..6a3e3bb71f 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.handler.events;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Collection;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.potion.GtPotionEffect;
@@ -12,6 +8,9 @@ import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.DevHelper;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collection;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@@ -21,90 +20,87 @@ import net.minecraftforge.event.entity.player.PlayerWakeUpEvent;
public class PlayerSleepEventHandler {
- private static Field sEffectDuration = ReflectionUtils.getField(PotionEffect.class, DevHelper.isObfuscatedEnvironment() ? "field_76460_b" : "duration");
- private static ArrayList<Potion> sPositiveEffects = new ArrayList<Potion>();
- private static ArrayList<Potion> sNegativeEffects = new ArrayList<Potion>();
+ private static Field sEffectDuration = ReflectionUtils.getField(
+ PotionEffect.class, DevHelper.isObfuscatedEnvironment() ? "field_76460_b" : "duration");
+ private static ArrayList<Potion> sPositiveEffects = new ArrayList<Potion>();
+ private static ArrayList<Potion> sNegativeEffects = new ArrayList<Potion>();
- public static void init() {
- Utils.registerEvent(new PlayerSleepEventHandler());
- sPositiveEffects.add(Potion.moveSpeed);
- sPositiveEffects.add(Potion.waterBreathing);
- sPositiveEffects.add(Potion.resistance);
- sPositiveEffects.add(Potion.regeneration);
- sPositiveEffects.add(Potion.damageBoost);
- sPositiveEffects.add(Potion.digSpeed);
- sPositiveEffects.add(Potion.fireResistance);
- sPositiveEffects.add(Potion.field_76434_w); // Health Boost
- sPositiveEffects.add(Potion.field_76444_x); // Absorption
- sNegativeEffects.add(Potion.blindness);
- sNegativeEffects.add(Potion.confusion);
- sNegativeEffects.add(Potion.digSlowdown);
- sNegativeEffects.add(Potion.harm);
- sNegativeEffects.add(Potion.hunger);
- sNegativeEffects.add(Potion.moveSlowdown);
- sNegativeEffects.add(Potion.poison);
- sNegativeEffects.add(Potion.weakness);
- sNegativeEffects.add(Potion.wither);
- }
+ public static void init() {
+ Utils.registerEvent(new PlayerSleepEventHandler());
+ sPositiveEffects.add(Potion.moveSpeed);
+ sPositiveEffects.add(Potion.waterBreathing);
+ sPositiveEffects.add(Potion.resistance);
+ sPositiveEffects.add(Potion.regeneration);
+ sPositiveEffects.add(Potion.damageBoost);
+ sPositiveEffects.add(Potion.digSpeed);
+ sPositiveEffects.add(Potion.fireResistance);
+ sPositiveEffects.add(Potion.field_76434_w); // Health Boost
+ sPositiveEffects.add(Potion.field_76444_x); // Absorption
+ sNegativeEffects.add(Potion.blindness);
+ sNegativeEffects.add(Potion.confusion);
+ sNegativeEffects.add(Potion.digSlowdown);
+ sNegativeEffects.add(Potion.harm);
+ sNegativeEffects.add(Potion.hunger);
+ sNegativeEffects.add(Potion.moveSlowdown);
+ sNegativeEffects.add(Potion.poison);
+ sNegativeEffects.add(Potion.weakness);
+ sNegativeEffects.add(Potion.wither);
+ }
- @SubscribeEvent
- public void sleep(PlayerSleepInBedEvent event) {
-
- }
+ @SubscribeEvent
+ public void sleep(PlayerSleepInBedEvent event) {}
- @SubscribeEvent
- public void wake(PlayerWakeUpEvent event) {
- EntityPlayer aPlayer = event.entityPlayer;
- if (aPlayer != null && !aPlayer.worldObj.isRemote) {
- if (event.entityPlayer.getEntityWorld().getWorldTime() % 24000 != 0) {
- return;
- }
- boolean aRemovedBad = false;
- try {
- Collection<PotionEffect> aActive = aPlayer.getActivePotionEffects();
- for (PotionEffect aEffect : aActive) {
- for (Potion aBadPotion : sNegativeEffects) {
- if (aEffect.getPotionID() == aBadPotion.getId()) {
- ReflectionUtils.setField(aEffect, sEffectDuration, 1);
- aRemovedBad = true;
- Logger.INFO("Set duration of " + aEffect.getEffectName() + " to 1 tick");
- }
- }
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- if (aRemovedBad) {
- messagePlayer(aPlayer, "sleep.event.downsides");
- }
- else {
- // Try Heal
- float aCurrentHP = aPlayer.getHealth();
- float aMaxHP = aPlayer.getMaxHealth();
- if (aCurrentHP < aMaxHP) {
- float aDamage = aMaxHP - aCurrentHP;
- float aToHeal = MathUtils.randFloat(1, aDamage);
- if (aToHeal > 0) {
- aPlayer.heal(aToHeal);
- messagePlayer(aPlayer, (aToHeal >= aDamage / 2 ? "sleep.event.good" : "sleep.event.okay"));
- }
- }
- // Already healed, try give a buff
- else {
- int aRandomBuff = MathUtils.randInt(0, sPositiveEffects.size() - 1);
- Potion aPotionToApply = sPositiveEffects.get(aRandomBuff);
- if (aPotionToApply != null) {
- aPlayer.addPotionEffect(new GtPotionEffect(aPotionToApply.id, MathUtils.randInt(60, 180), MathUtils.randInt(0, 2)));
- messagePlayer(aPlayer, "sleep.event.wellrested");
- }
- }
- }
- }
- }
-
- private static void messagePlayer(EntityPlayer aPlayer, String aChatKey) {
- PlayerUtils.messagePlayer(aPlayer, new ChatComponentTranslation(aChatKey, new Object[0]));
- }
+ @SubscribeEvent
+ public void wake(PlayerWakeUpEvent event) {
+ EntityPlayer aPlayer = event.entityPlayer;
+ if (aPlayer != null && !aPlayer.worldObj.isRemote) {
+ if (event.entityPlayer.getEntityWorld().getWorldTime() % 24000 != 0) {
+ return;
+ }
+ boolean aRemovedBad = false;
+ try {
+ Collection<PotionEffect> aActive = aPlayer.getActivePotionEffects();
+ for (PotionEffect aEffect : aActive) {
+ for (Potion aBadPotion : sNegativeEffects) {
+ if (aEffect.getPotionID() == aBadPotion.getId()) {
+ ReflectionUtils.setField(aEffect, sEffectDuration, 1);
+ aRemovedBad = true;
+ Logger.INFO("Set duration of " + aEffect.getEffectName() + " to 1 tick");
+ }
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ if (aRemovedBad) {
+ messagePlayer(aPlayer, "sleep.event.downsides");
+ } else {
+ // Try Heal
+ float aCurrentHP = aPlayer.getHealth();
+ float aMaxHP = aPlayer.getMaxHealth();
+ if (aCurrentHP < aMaxHP) {
+ float aDamage = aMaxHP - aCurrentHP;
+ float aToHeal = MathUtils.randFloat(1, aDamage);
+ if (aToHeal > 0) {
+ aPlayer.heal(aToHeal);
+ messagePlayer(aPlayer, (aToHeal >= aDamage / 2 ? "sleep.event.good" : "sleep.event.okay"));
+ }
+ }
+ // Already healed, try give a buff
+ else {
+ int aRandomBuff = MathUtils.randInt(0, sPositiveEffects.size() - 1);
+ Potion aPotionToApply = sPositiveEffects.get(aRandomBuff);
+ if (aPotionToApply != null) {
+ aPlayer.addPotionEffect(new GtPotionEffect(
+ aPotionToApply.id, MathUtils.randInt(60, 180), MathUtils.randInt(0, 2)));
+ messagePlayer(aPlayer, "sleep.event.wellrested");
+ }
+ }
+ }
+ }
+ }
+ private static void messagePlayer(EntityPlayer aPlayer, String aChatKey) {
+ PlayerUtils.messagePlayer(aPlayer, new ChatComponentTranslation(aChatKey, new Object[0]));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/PlayerTickHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PlayerTickHandler.java
index dc7ccb3e72..fb64fc93cf 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/PlayerTickHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/PlayerTickHandler.java
@@ -1,18 +1,14 @@
package gtPlusPlus.core.handler.events;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-
import net.minecraft.entity.player.EntityPlayer;
public class PlayerTickHandler {
- @SubscribeEvent
- public void onPlayerTick(net.minecraftforge.event.entity.player.PlayerOpenContainerEvent e){
- if (e.entity instanceof EntityPlayer){
- if (e.entityPlayer.openContainer != null) {
-
- }
+ @SubscribeEvent
+ public void onPlayerTick(net.minecraftforge.event.entity.player.PlayerOpenContainerEvent e) {
+ if (e.entity instanceof EntityPlayer) {
+ if (e.entityPlayer.openContainer != null) {}
}
}
-
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java b/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java
index 3e51c6488a..177f04e977 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java
@@ -1,131 +1,126 @@
package gtPlusPlus.core.handler.events;
-import java.util.concurrent.ConcurrentHashMap;
-
import gtPlusPlus.api.objects.Logger;
+import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.entity.player.EntityPlayer;
public class SneakManager {
- //We make this a singleton for clientside data storage.
-
- public static ConcurrentHashMap<String, SneakManager> mPlayerCache = new ConcurrentHashMap<String, SneakManager>();
-
- private static void addPlayer(EntityPlayer aPlayer) {
- String aKey = getKey(aPlayer);
- if (!mPlayerCache.containsKey(aKey)) {
- mPlayerCache.put(aKey, new SneakManager(aPlayer));
- }
- }
-
- public static SneakManager get(EntityPlayer aPlayer) {
-
- String aKey = getKey(aPlayer);
- if (!mPlayerCache.containsKey(aKey)) {
- addPlayer(aPlayer);
- }
- return mPlayerCache.get(aKey);
- }
-
- private static String getKey(EntityPlayer aPlayer) {
- return ""+aPlayer.getGameProfile().getId().toString();
- }
-
-
- public SneakManager instance;
- public EntityPlayer owner;
- public boolean canSprint = true;
- public boolean isSneaking = true;
- public boolean optionDoubleTap = true;
- public boolean wasSprintDisabled = false;
- public boolean mIsWearingRing = false;
-
- private State Sprinting = State.ON;
- private State Crouching = State.OFF;
-
- public SneakManager(EntityPlayer aPlayer) {
- owner = aPlayer;
- }
-
- public boolean Sneaking(){
- return Crouching.getState();
- }
-
- public boolean Sprinting(){
- return Sprinting.getState();
- }
-
- public State getSneakingState(){
- return Crouching;
- }
-
- public State getSprintingDisabledState(){
- return Sprinting;
- }
-
- public void toggleSneaking(){
- toggleState(Crouching);
- }
-
- public void toggleSprinting(){
- toggleState(Sprinting);
- }
-
- private State toggleState(final State state){
- Logger.INFO("State Toggle");
- if (state == State.ON) {
- return State.OFF;
- }
- return State.ON;
- }
-
- private State setCrouchingStateON(){
- return Crouching = State.ON;
- }
-
- private State setCrouchingStateOFF(){
- return Crouching = State.OFF;
- }
-
- private State setSprintingStateON(){
- return Sprinting = State.ON;
- }
-
- private State setSprintingStateOFF(){
- return Sprinting = State.OFF;
- }
-
- public void putRingOn() {
- mIsWearingRing = true;
- setSprintingStateOFF();
- setCrouchingStateON();
- }
-
- public void takeRingOff() {
- mIsWearingRing = false;
- setSprintingStateON();
- setCrouchingStateOFF();
- }
-
- public boolean isWearingRing() {
- return mIsWearingRing;
- }
-
- public static enum State {
- ON(true),
- OFF(false);
-
- private final boolean STATE;
- private State (final boolean State)
- {
- this.STATE = State;
- }
-
- public boolean getState() {
- return this.STATE;
- }
-
- }
-
+ // We make this a singleton for clientside data storage.
+
+ public static ConcurrentHashMap<String, SneakManager> mPlayerCache = new ConcurrentHashMap<String, SneakManager>();
+
+ private static void addPlayer(EntityPlayer aPlayer) {
+ String aKey = getKey(aPlayer);
+ if (!mPlayerCache.containsKey(aKey)) {
+ mPlayerCache.put(aKey, new SneakManager(aPlayer));
+ }
+ }
+
+ public static SneakManager get(EntityPlayer aPlayer) {
+
+ String aKey = getKey(aPlayer);
+ if (!mPlayerCache.containsKey(aKey)) {
+ addPlayer(aPlayer);
+ }
+ return mPlayerCache.get(aKey);
+ }
+
+ private static String getKey(EntityPlayer aPlayer) {
+ return "" + aPlayer.getGameProfile().getId().toString();
+ }
+
+ public SneakManager instance;
+ public EntityPlayer owner;
+ public boolean canSprint = true;
+ public boolean isSneaking = true;
+ public boolean optionDoubleTap = true;
+ public boolean wasSprintDisabled = false;
+ public boolean mIsWearingRing = false;
+
+ private State Sprinting = State.ON;
+ private State Crouching = State.OFF;
+
+ public SneakManager(EntityPlayer aPlayer) {
+ owner = aPlayer;
+ }
+
+ public boolean Sneaking() {
+ return Crouching.getState();
+ }
+
+ public boolean Sprinting() {
+ return Sprinting.getState();
+ }
+
+ public State getSneakingState() {
+ return Crouching;
+ }
+
+ public State getSprintingDisabledState() {
+ return Sprinting;
+ }
+
+ public void toggleSneaking() {
+ toggleState(Crouching);
+ }
+
+ public void toggleSprinting() {
+ toggleState(Sprinting);
+ }
+
+ private State toggleState(final State state) {
+ Logger.INFO("State Toggle");
+ if (state == State.ON) {
+ return State.OFF;
+ }
+ return State.ON;
+ }
+
+ private State setCrouchingStateON() {
+ return Crouching = State.ON;
+ }
+
+ private State setCrouchingStateOFF() {
+ return Crouching = State.OFF;
+ }
+
+ private State setSprintingStateON() {
+ return Sprinting = State.ON;
+ }
+
+ private State setSprintingStateOFF() {
+ return Sprinting = State.OFF;
+ }
+
+ public void putRingOn() {
+ mIsWearingRing = true;
+ setSprintingStateOFF();
+ setCrouchingStateON();
+ }
+
+ public void takeRingOff() {
+ mIsWearingRing = false;
+ setSprintingStateON();
+ setCrouchingStateOFF();
+ }
+
+ public boolean isWearingRing() {
+ return mIsWearingRing;
+ }
+
+ public static enum State {
+ ON(true),
+ OFF(false);
+
+ private final boolean STATE;
+
+ private State(final boolean State) {
+ this.STATE = State;
+ }
+
+ public boolean getState() {
+ return this.STATE;
+ }
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java b/src/main/java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java
index b653c6ffb6..ddd8f78a23 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java
@@ -1,138 +1,124 @@
package gtPlusPlus.core.handler.events;
-import net.minecraft.block.Block;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.BaseTileEntity;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaSafeBlock;
+import net.minecraft.block.Block;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
-public class UnbreakableBlockManager{
-
- private static boolean hasRun = false;
-
- public final BaseMetaTileEntity getmTileEntity() {
- return mTileEntity;
- }
-
-
- public final void setmTileEntity(final BaseMetaTileEntity mTileEntity/*, EntityPlayer aPlayer*/) {
- UnbreakableBlockManager.mTileEntity = mTileEntity;
- if (!hasRun){
- hasRun = true;
- this.makeIndestructible(/*aPlayer*/);
- }
- else {
- Logger.WARNING("Why do you run twice?");
- }
- }
-
-
- //BaseMetaTileEntity
- //GregtechMetaSafeBlock
- private static BaseMetaTileEntity mTileEntity = null;
-
-
- private void makeIndestructible(/*EntityPlayer aPlayer*/){
-
-
- Logger.WARNING("Initializing the code to set this TE to -1 hardness and make it indestructible.");
- final int X = mTileEntity.xCoord; //(GregtechMetaSafeBlock) this.mTileEntity.getXCoord();
- final int Y = mTileEntity.yCoord;
- final int Z = mTileEntity.zCoord;
- Logger.WARNING("Grabbing TileEntity @ [x,y,z] |"+X+"|"+Y+"|"+Z+"|");
-
- try{
- final GregtechMetaSafeBlock MetaSafeBlock = ((GregtechMetaSafeBlock) UnbreakableBlockManager.mTileEntity.getMetaTileEntity());
- final TileEntity BaseMetaTileEntity = mTileEntity.getTileEntity(X, Y, Z);
- //MetaSafeBlockBase.
- final World TE_WORLD = MetaSafeBlock.getBaseMetaTileEntity().getWorld();
- Logger.WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
- final TileEntity entity = BaseMetaTileEntity;
- innerInvincible(MetaSafeBlock, entity, TE_WORLD, /*aPlayer,*/ X, Y, Z);
- }
- catch (final NullPointerException e) {
- System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: ");
- e.printStackTrace();
- }
- }
-
-
- private static void innerInvincible(final GregtechMetaSafeBlock MetaSafeBlock, final TileEntity entity, final World TE_WORLD, /*EntityPlayer aPlayer,*/ final int X, final int Y, final int Z){
- if (entity != null){
- Logger.WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
- Logger.WARNING("Grabbed TE: "+entity.toString());
-
-
-
-
- if ((entity instanceof BaseTileEntity) && !(entity instanceof BaseMetaPipeEntity)){
- final IMetaTileEntity I = ((BaseMetaTileEntity)entity).getMetaTileEntity();
- Logger.WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
- Logger.WARNING("I Details: "+I.getMetaName()+" | "+I.getTileEntityBaseType()+" | "+I.toString());
-
-
-
-
-
- if (I instanceof GregtechMetaSafeBlock){
- Logger.WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
-
- final Block ThisBlock = I.getBaseMetaTileEntity().getBlock(X, Y, Z);
- Logger.WARNING("Block Details: "+ThisBlock.toString());
-
-
- if (((GregtechMetaSafeBlock)I).bUnbreakable){
- ThisBlock.setHardness(Integer.MAX_VALUE);
- //ThisBlock.setResistance(18000000.0F);
- ThisBlock.setResistance(-1);
- ThisBlock.setBlockUnbreakable();
- Logger.WARNING("Changing State of Flag. Old Value="+MetaSafeBlock.bUnbreakable+" Expected Value=true");
- MetaSafeBlock.bUnbreakable = true;
- //entity.markDirty();
- Logger.WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
- Logger.ERROR("New Indestructible Flag enabled.");
- //GT_Utility.sendChatToPlayer(aPlayer, "Block is now unbreakable.");
- }
-
-
-
-
- else {
- ThisBlock.setHardness(1);
- ThisBlock.setResistance(1.0F);
- Logger.WARNING("Changing State of Flag. Old Value="+MetaSafeBlock.bUnbreakable+" Expected Value=false");
- MetaSafeBlock.bUnbreakable = false;
- //entity.markDirty();
- Logger.WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
- Logger.ERROR("New Indestructible Flag disabled.");
- //GT_Utility.sendChatToPlayer(aPlayer, "Block is now breakable.");
- }
-
- //entity.markDirty();
-
- Logger.WARNING("Block Hardness: "+ThisBlock.getBlockHardness(TE_WORLD, X, Y, Z));
- Logger.WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
- hasRun = false;
-
- }
- else {
- Logger.WARNING("I is not an instanceof MetaSafeBlockBase");
- Logger.WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
- }
- } else {
- Logger.WARNING("TE is not an instanceof BaseTileEntity or may be a pipe.");
- Logger.WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
- }
- }else {
- Logger.WARNING("Did not grab a TE instance to make a block instance from.");
- Logger.WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
- }
- }
-
+public class UnbreakableBlockManager {
+
+ private static boolean hasRun = false;
+
+ public final BaseMetaTileEntity getmTileEntity() {
+ return mTileEntity;
+ }
+
+ public final void setmTileEntity(final BaseMetaTileEntity mTileEntity /*, EntityPlayer aPlayer*/) {
+ UnbreakableBlockManager.mTileEntity = mTileEntity;
+ if (!hasRun) {
+ hasRun = true;
+ this.makeIndestructible(/*aPlayer*/ );
+ } else {
+ Logger.WARNING("Why do you run twice?");
+ }
+ }
+
+ // BaseMetaTileEntity
+ // GregtechMetaSafeBlock
+ private static BaseMetaTileEntity mTileEntity = null;
+
+ private void makeIndestructible(/*EntityPlayer aPlayer*/ ) {
+
+ Logger.WARNING("Initializing the code to set this TE to -1 hardness and make it indestructible.");
+ final int X = mTileEntity.xCoord; // (GregtechMetaSafeBlock) this.mTileEntity.getXCoord();
+ final int Y = mTileEntity.yCoord;
+ final int Z = mTileEntity.zCoord;
+ Logger.WARNING("Grabbing TileEntity @ [x,y,z] |" + X + "|" + Y + "|" + Z + "|");
+
+ try {
+ final GregtechMetaSafeBlock MetaSafeBlock =
+ ((GregtechMetaSafeBlock) UnbreakableBlockManager.mTileEntity.getMetaTileEntity());
+ final TileEntity BaseMetaTileEntity = mTileEntity.getTileEntity(X, Y, Z);
+ // MetaSafeBlockBase.
+ final World TE_WORLD = MetaSafeBlock.getBaseMetaTileEntity().getWorld();
+ Logger.WARNING("Checking new State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ final TileEntity entity = BaseMetaTileEntity;
+ innerInvincible(MetaSafeBlock, entity, TE_WORLD, /*aPlayer,*/ X, Y, Z);
+ } catch (final NullPointerException e) {
+ System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: ");
+ e.printStackTrace();
+ }
+ }
+
+ private static void innerInvincible(
+ final GregtechMetaSafeBlock MetaSafeBlock,
+ final TileEntity entity,
+ final World TE_WORLD, /*EntityPlayer aPlayer,*/
+ final int X,
+ final int Y,
+ final int Z) {
+ if (entity != null) {
+ Logger.WARNING("Checking new State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ Logger.WARNING("Grabbed TE: " + entity.toString());
+
+ if ((entity instanceof BaseTileEntity) && !(entity instanceof BaseMetaPipeEntity)) {
+ final IMetaTileEntity I = ((BaseMetaTileEntity) entity).getMetaTileEntity();
+ Logger.WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ Logger.WARNING(
+ "I Details: " + I.getMetaName() + " | " + I.getTileEntityBaseType() + " | " + I.toString());
+
+ if (I instanceof GregtechMetaSafeBlock) {
+ Logger.WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+
+ final Block ThisBlock = I.getBaseMetaTileEntity().getBlock(X, Y, Z);
+ Logger.WARNING("Block Details: " + ThisBlock.toString());
+
+ if (((GregtechMetaSafeBlock) I).bUnbreakable) {
+ ThisBlock.setHardness(Integer.MAX_VALUE);
+ // ThisBlock.setResistance(18000000.0F);
+ ThisBlock.setResistance(-1);
+ ThisBlock.setBlockUnbreakable();
+ Logger.WARNING("Changing State of Flag. Old Value=" + MetaSafeBlock.bUnbreakable
+ + " Expected Value=true");
+ MetaSafeBlock.bUnbreakable = true;
+ // entity.markDirty();
+ Logger.WARNING("Checking new State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ Logger.ERROR("New Indestructible Flag enabled.");
+ // GT_Utility.sendChatToPlayer(aPlayer, "Block is now unbreakable.");
+ } else {
+ ThisBlock.setHardness(1);
+ ThisBlock.setResistance(1.0F);
+ Logger.WARNING("Changing State of Flag. Old Value=" + MetaSafeBlock.bUnbreakable
+ + " Expected Value=false");
+ MetaSafeBlock.bUnbreakable = false;
+ // entity.markDirty();
+ Logger.WARNING("Checking new State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ Logger.ERROR("New Indestructible Flag disabled.");
+ // GT_Utility.sendChatToPlayer(aPlayer, "Block is now breakable.");
+ }
+
+ // entity.markDirty();
+
+ Logger.WARNING("Block Hardness: " + ThisBlock.getBlockHardness(TE_WORLD, X, Y, Z));
+ Logger.WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ hasRun = false;
+
+ } else {
+ Logger.WARNING("I is not an instanceof MetaSafeBlockBase");
+ Logger.WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ }
+ } else {
+ Logger.WARNING("TE is not an instanceof BaseTileEntity or may be a pipe.");
+ Logger.WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ }
+ } else {
+ Logger.WARNING("Did not grab a TE instance to make a block instance from.");
+ Logger.WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
index 68df68aa2a..9a6a840216 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
@@ -1,55 +1,49 @@
package gtPlusPlus.core.handler.events;
-import java.lang.reflect.Field;
-
-import org.apache.commons.lang3.reflect.FieldUtils;
-
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-
import gtPlusPlus.api.objects.Logger;
+import java.lang.reflect.Field;
import net.minecraftforge.event.entity.living.ZombieEvent;
+import org.apache.commons.lang3.reflect.FieldUtils;
public class ZombieBackupSpawnEventHandler {
- /**
- *
- * Do we really need this pathetic mechanic to exist when it doesn't work properly at all?
- * Or , well, maybe you enjoy Zombies spawning IN YOUR FUCKING FACE?!
- *
- */
-
- @SubscribeEvent(priority = EventPriority.HIGHEST)
- public void onZombieReinforcement(final ZombieEvent.SummonAidEvent event) {
- try {
- try {
- Field mChance = FieldUtils.getDeclaredField(this.getClass(), "summonChance", true);
- FieldUtils.removeFinalModifier(mChance, true);
- mChance.set(this, 0);
- }
- catch(Throwable t){}
- if (event.attacker != null){
- //SegmentHelper.getInstance().trackUser(event.attacker.getUniqueID().toString(), "Zombie Backup");
- }
- Logger.WARNING("[Zombie] ZombieEvent.SummonAidEvent.");
- event.setResult(Result.DENY);
- }
- catch(Throwable t){}
- }
-
- @SubscribeEvent(priority = EventPriority.HIGHEST)
- public void onZombieReinforcement(final ZombieEvent event) {
- try {
- Logger.WARNING("[Zombie] ZombieEvent.");
- if (event.entity != null){
- Logger.WARNING("Event Entity: "+event.entity.getCommandSenderName());
- }
- event.setResult(Result.DENY);
- }
- catch(Throwable t){
-
- }
- }
-
+ /**
+ *
+ * Do we really need this pathetic mechanic to exist when it doesn't work properly at all?
+ * Or , well, maybe you enjoy Zombies spawning IN YOUR FUCKING FACE?!
+ *
+ */
+ @SubscribeEvent(priority = EventPriority.HIGHEST)
+ public void onZombieReinforcement(final ZombieEvent.SummonAidEvent event) {
+ try {
+ try {
+ Field mChance = FieldUtils.getDeclaredField(this.getClass(), "summonChance", true);
+ FieldUtils.removeFinalModifier(mChance, true);
+ mChance.set(this, 0);
+ } catch (Throwable t) {
+ }
+ if (event.attacker != null) {
+ // SegmentHelper.getInstance().trackUser(event.attacker.getUniqueID().toString(), "Zombie Backup");
+ }
+ Logger.WARNING("[Zombie] ZombieEvent.SummonAidEvent.");
+ event.setResult(Result.DENY);
+ } catch (Throwable t) {
+ }
+ }
+
+ @SubscribeEvent(priority = EventPriority.HIGHEST)
+ public void onZombieReinforcement(final ZombieEvent event) {
+ try {
+ Logger.WARNING("[Zombie] ZombieEvent.");
+ if (event.entity != null) {
+ Logger.WARNING("Event Entity: " + event.entity.getCommandSenderName());
+ }
+ event.setResult(Result.DENY);
+ } catch (Throwable t) {
+
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/render/CapeHandler.java b/src/main/java/gtPlusPlus/core/handler/render/CapeHandler.java
index 491d9a2aba..caf352d0de 100644
--- a/src/main/java/gtPlusPlus/core/handler/render/CapeHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/render/CapeHandler.java
@@ -1,9 +1,10 @@
package gtPlusPlus.core.handler.render;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.lib.CORE;
import java.util.Collection;
-
-import org.lwjgl.opengl.GL11;
-
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderManager;
@@ -11,112 +12,100 @@ import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
-
-import gregtech.api.enums.GT_Values;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.core.lib.CORE;
import net.minecraftforge.client.event.RenderPlayerEvent;
+import org.lwjgl.opengl.GL11;
public class CapeHandler extends RenderPlayer {
- private final ResourceLocation[] mCapes = {
- new ResourceLocation(CORE.MODID+":textures/TesterCape.png"),
- new ResourceLocation(CORE.MODID+":textures/Draknyte1.png"),
- new ResourceLocation("gregtech:textures/GregoriusCape.png") };
- private final Collection<String> mCapeList;
-
- public CapeHandler(final Collection<String> aCapeList) {
- this.mCapeList = aCapeList;
- this.setRenderManager(RenderManager.instance);
- }
+ private final ResourceLocation[] mCapes = {
+ new ResourceLocation(CORE.MODID + ":textures/TesterCape.png"),
+ new ResourceLocation(CORE.MODID + ":textures/Draknyte1.png"),
+ new ResourceLocation("gregtech:textures/GregoriusCape.png")
+ };
+ private final Collection<String> mCapeList;
- public void receiveRenderSpecialsEvent(final RenderPlayerEvent.Specials.Pre aEvent) {
- final AbstractClientPlayer aPlayer = (AbstractClientPlayer) aEvent.entityPlayer;
- if (GT_Utility.getFullInvisibility(aPlayer)) {
- aEvent.setCanceled(true);
- return;
- }
- final float aPartialTicks = aEvent.partialRenderTick;
- if (aPlayer.isInvisible()) {
- return;
- }
- if (GT_Utility.getPotion(aPlayer,
- Integer.valueOf(Potion.invisibility.id).intValue())) {
- return;
- }
- try {
- ResourceLocation tResource = null;
- if (aPlayer.getDisplayName().equalsIgnoreCase("XW3B")) {
- tResource = this.mCapes[0];
- }
- if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase())) {
- tResource = this.mCapes[0];
- }
- if (aPlayer.getDisplayName().equalsIgnoreCase("Draknyte1")) {
- tResource = this.mCapes[1];
- }
- if (aPlayer.getDisplayName().equalsIgnoreCase("GregoriusT")) {
- tResource = this.mCapes[2];
- }
- if ((tResource != null) && (!(aPlayer.getHideCape()))) {
- this.bindTexture(tResource);
- GL11.glPushMatrix();
- GL11.glTranslatef(0.0F, 0.0F, 0.125F);
- final double d0 = (aPlayer.field_71091_bM
- + ((aPlayer.field_71094_bP - aPlayer.field_71091_bM)
- * aPartialTicks))
- - (aPlayer.prevPosX + ((aPlayer.posX - aPlayer.prevPosX)
- * aPartialTicks));
- final double d1 = (aPlayer.field_71096_bN
- + ((aPlayer.field_71095_bQ - aPlayer.field_71096_bN)
- * aPartialTicks))
- - (aPlayer.prevPosY + ((aPlayer.posY - aPlayer.prevPosY)
- * aPartialTicks));
- final double d2 = (aPlayer.field_71097_bO
- + ((aPlayer.field_71085_bR - aPlayer.field_71097_bO)
- * aPartialTicks))
- - (aPlayer.prevPosZ + ((aPlayer.posZ - aPlayer.prevPosZ)
- * aPartialTicks));
- final float f6 = aPlayer.prevRenderYawOffset
- + ((aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset)
- * aPartialTicks);
- final double d3 = MathHelper.sin((f6 * CORE.PI) / 180.0F);
- final double d4 = -MathHelper.cos((f6 * CORE.PI) / 180.0F);
- float f7 = (float) d1 * 10.0F;
- float f8 = (float) ((d0 * d3) + (d2 * d4)) * 100.0F;
- final float f9 = (float) ((d0 * d4) - (d2 * d3)) * 100.0F;
- if (f7 < -6.0F) {
- f7 = -6.0F;
- }
- if (f7 > 32.0F) {
- f7 = 32.0F;
- }
- if (f8 < 0.0F) {
- f8 = 0.0F;
- }
- final float f10 = aPlayer.prevCameraYaw
- + ((aPlayer.cameraYaw - aPlayer.prevCameraYaw)
- * aPartialTicks);
- f7 += MathHelper
- .sin((aPlayer.prevDistanceWalkedModified + ((aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified)
- * aPartialTicks)) * 6.0F)
- * 32.0F * f10;
- if (aPlayer.isSneaking()) {
- f7 += 25.0F;
- }
- GL11.glRotatef(6.0F + (f8 / 2.0F) + f7, 1.0F, 0.0F, 0.0F);
- GL11.glRotatef(f9 / 2.0F, 0.0F, 0.0F, 1.0F);
- GL11.glRotatef(-f9 / 2.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
- ((ModelBiped) this.mainModel).renderCloak(0.0625F);
- GL11.glPopMatrix();
- }
- } catch (final Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
+ public CapeHandler(final Collection<String> aCapeList) {
+ this.mCapeList = aCapeList;
+ this.setRenderManager(RenderManager.instance);
+ }
+ public void receiveRenderSpecialsEvent(final RenderPlayerEvent.Specials.Pre aEvent) {
+ final AbstractClientPlayer aPlayer = (AbstractClientPlayer) aEvent.entityPlayer;
+ if (GT_Utility.getFullInvisibility(aPlayer)) {
+ aEvent.setCanceled(true);
+ return;
+ }
+ final float aPartialTicks = aEvent.partialRenderTick;
+ if (aPlayer.isInvisible()) {
+ return;
+ }
+ if (GT_Utility.getPotion(
+ aPlayer, Integer.valueOf(Potion.invisibility.id).intValue())) {
+ return;
+ }
+ try {
+ ResourceLocation tResource = null;
+ if (aPlayer.getDisplayName().equalsIgnoreCase("XW3B")) {
+ tResource = this.mCapes[0];
+ }
+ if (this.mCapeList.contains(aPlayer.getDisplayName().toLowerCase())) {
+ tResource = this.mCapes[0];
+ }
+ if (aPlayer.getDisplayName().equalsIgnoreCase("Draknyte1")) {
+ tResource = this.mCapes[1];
+ }
+ if (aPlayer.getDisplayName().equalsIgnoreCase("GregoriusT")) {
+ tResource = this.mCapes[2];
+ }
+ if ((tResource != null) && (!(aPlayer.getHideCape()))) {
+ this.bindTexture(tResource);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(0.0F, 0.0F, 0.125F);
+ final double d0 =
+ (aPlayer.field_71091_bM + ((aPlayer.field_71094_bP - aPlayer.field_71091_bM) * aPartialTicks))
+ - (aPlayer.prevPosX + ((aPlayer.posX - aPlayer.prevPosX) * aPartialTicks));
+ final double d1 =
+ (aPlayer.field_71096_bN + ((aPlayer.field_71095_bQ - aPlayer.field_71096_bN) * aPartialTicks))
+ - (aPlayer.prevPosY + ((aPlayer.posY - aPlayer.prevPosY) * aPartialTicks));
+ final double d2 =
+ (aPlayer.field_71097_bO + ((aPlayer.field_71085_bR - aPlayer.field_71097_bO) * aPartialTicks))
+ - (aPlayer.prevPosZ + ((aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks));
+ final float f6 = aPlayer.prevRenderYawOffset
+ + ((aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks);
+ final double d3 = MathHelper.sin((f6 * CORE.PI) / 180.0F);
+ final double d4 = -MathHelper.cos((f6 * CORE.PI) / 180.0F);
+ float f7 = (float) d1 * 10.0F;
+ float f8 = (float) ((d0 * d3) + (d2 * d4)) * 100.0F;
+ final float f9 = (float) ((d0 * d4) - (d2 * d3)) * 100.0F;
+ if (f7 < -6.0F) {
+ f7 = -6.0F;
+ }
+ if (f7 > 32.0F) {
+ f7 = 32.0F;
+ }
+ if (f8 < 0.0F) {
+ f8 = 0.0F;
+ }
+ final float f10 = aPlayer.prevCameraYaw + ((aPlayer.cameraYaw - aPlayer.prevCameraYaw) * aPartialTicks);
+ f7 += MathHelper.sin((aPlayer.prevDistanceWalkedModified
+ + ((aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified)
+ * aPartialTicks))
+ * 6.0F)
+ * 32.0F
+ * f10;
+ if (aPlayer.isSneaking()) {
+ f7 += 25.0F;
+ }
+ GL11.glRotatef(6.0F + (f8 / 2.0F) + f7, 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(f9 / 2.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(-f9 / 2.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
+ ((ModelBiped) this.mainModel).renderCloak(0.0625F);
+ GL11.glPopMatrix();
+ }
+ } catch (final Throwable e) {
+ if (GT_Values.D1) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java b/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java
index 029d961bff..82033394f7 100644
--- a/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java
+++ b/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java
@@ -6,116 +6,123 @@
package gtPlusPlus.core.handler.render;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
-import gtPlusPlus.core.lib.CORE;
-
-public class FirepitModel extends ModelBase
-{
- //fields
- ModelRenderer Side_A;
- ModelRenderer Side_B;
- ModelRenderer Side_C;
- ModelRenderer Side_D;
- ModelRenderer Log1;
- ModelRenderer Log2;
- ModelRenderer Log3;
- ModelRenderer Log4;
-
- public FirepitModel()
- {
- this.textureWidth = 16;
- this.textureHeight = 16;
-
- this.Side_A = new ModelRenderer(this, 0, 0);
- this.Side_A.addBox(0F, 0F, 0F, 12, 6, 1);
- this.Side_A.setRotationPoint(-6F, 18F, -6F);
- this.Side_A.setTextureSize(16, 16);
- this.Side_A.mirror = true;
- setRotation(this.Side_A, -0.3148822F, 0F, 0F);
- //Side_A.mirror = false;
-
- this.Side_B = new ModelRenderer(this, 0, 0);
- this.Side_B.addBox(0F, 0F, 0F, 12, 6, 1);
- this.Side_B.setRotationPoint(-6F, 18F, 6F);
- this.Side_B.setTextureSize(16, 16);
- this.Side_B.mirror = true;
- setRotation(this.Side_B, -0.3148822F, (CORE.PI/2), 0F);
-
- this.Side_C = new ModelRenderer(this, 0, 0);
- this.Side_C.addBox(0F, 0F, 0F, 12, 6, 1);
- this.Side_C.setRotationPoint(6F, 18F, 6F);
- this.Side_C.setTextureSize(16, 16);
- this.Side_C.mirror = true;
- setRotation(this.Side_C, -0.3148822F, CORE.PI, 0F);
- //Side_C.mirror = false;
-
- this.Side_D = new ModelRenderer(this, 0, 0);
- this.Side_D.addBox(0F, 0F, 0F, 12, 6, 1);
- this.Side_D.setRotationPoint(6F, 18F, -6F);
- this.Side_D.setTextureSize(16, 16);
- this.Side_D.mirror = true;
- setRotation(this.Side_D, -0.3148822F, 4.712389F, 0F);
-
- this.Log1 = new ModelRenderer(this, 0, 10);
- this.Log1.addBox(0F, 0F, 0F, 14, 2, 2);
- this.Log1.setRotationPoint(4F, 10F, -4F);
- this.Log1.setTextureSize(16, 16);
- this.Log1.mirror = true;
- setRotation(this.Log1, 0F, 0F, (CORE.PI/2));
-
- this.Log2 = new ModelRenderer(this, -2, 10);
- this.Log2.addBox(0F, 0F, 0F, 14, 2, 2);
- this.Log2.setRotationPoint(-4F, 10F, -4F);
- this.Log2.setTextureSize(16, 16);
- this.Log2.mirror = true;
- setRotation(this.Log2, (CORE.PI/2), 0F, (CORE.PI/2));
- //Log2.mirror = false;
-
- this.Log3 = new ModelRenderer(this, 0, 10);
- this.Log3.addBox(0F, 0F, 0F, 14, 2, 2);
- this.Log3.setRotationPoint(-4F, 10F, 4F);
- this.Log3.setTextureSize(16, 16);
- this.Log3.mirror = true;
- setRotation(this.Log3, CORE.PI, 0F, (CORE.PI/2));
-
- this.Log4 = new ModelRenderer(this, -2, 10);
- this.Log4.addBox(0F, 0F, 0F, 14, 2, 2);
- this.Log4.setRotationPoint(4F, 10F, 4F);
- this.Log4.setTextureSize(16, 16);
- this.Log4.mirror = true;
- setRotation(this.Log4, 4.712389F, 0F, (CORE.PI/2));
- //Log4.mirror = false;
- }
-
- @Override
- public void render(final Entity entity, final float f, final float f1, final float f2, final float f3, final float f4, final float f5)
- {
- super.render(entity, f, f1, f2, f3, f4, f5);
- this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
- this.Side_A.render(f5);
- this.Side_B.render(f5);
- this.Side_C.render(f5);
- this.Side_D.render(f5);
- this.Log1.render(f5);
- this.Log2.render(f5);
- this.Log3.render(f5);
- this.Log4.render(f5);
- }
-
- private static void setRotation(final ModelRenderer model, final float x, final float y, final float z)
- {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
-
- @Override
- public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4, final float f5, final Entity entity)
- {
- super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
- }
-
+public class FirepitModel extends ModelBase {
+ // fields
+ ModelRenderer Side_A;
+ ModelRenderer Side_B;
+ ModelRenderer Side_C;
+ ModelRenderer Side_D;
+ ModelRenderer Log1;
+ ModelRenderer Log2;
+ ModelRenderer Log3;
+ ModelRenderer Log4;
+
+ public FirepitModel() {
+ this.textureWidth = 16;
+ this.textureHeight = 16;
+
+ this.Side_A = new ModelRenderer(this, 0, 0);
+ this.Side_A.addBox(0F, 0F, 0F, 12, 6, 1);
+ this.Side_A.setRotationPoint(-6F, 18F, -6F);
+ this.Side_A.setTextureSize(16, 16);
+ this.Side_A.mirror = true;
+ setRotation(this.Side_A, -0.3148822F, 0F, 0F);
+ // Side_A.mirror = false;
+
+ this.Side_B = new ModelRenderer(this, 0, 0);
+ this.Side_B.addBox(0F, 0F, 0F, 12, 6, 1);
+ this.Side_B.setRotationPoint(-6F, 18F, 6F);
+ this.Side_B.setTextureSize(16, 16);
+ this.Side_B.mirror = true;
+ setRotation(this.Side_B, -0.3148822F, (CORE.PI / 2), 0F);
+
+ this.Side_C = new ModelRenderer(this, 0, 0);
+ this.Side_C.addBox(0F, 0F, 0F, 12, 6, 1);
+ this.Side_C.setRotationPoint(6F, 18F, 6F);
+ this.Side_C.setTextureSize(16, 16);
+ this.Side_C.mirror = true;
+ setRotation(this.Side_C, -0.3148822F, CORE.PI, 0F);
+ // Side_C.mirror = false;
+
+ this.Side_D = new ModelRenderer(this, 0, 0);
+ this.Side_D.addBox(0F, 0F, 0F, 12, 6, 1);
+ this.Side_D.setRotationPoint(6F, 18F, -6F);
+ this.Side_D.setTextureSize(16, 16);
+ this.Side_D.mirror = true;
+ setRotation(this.Side_D, -0.3148822F, 4.712389F, 0F);
+
+ this.Log1 = new ModelRenderer(this, 0, 10);
+ this.Log1.addBox(0F, 0F, 0F, 14, 2, 2);
+ this.Log1.setRotationPoint(4F, 10F, -4F);
+ this.Log1.setTextureSize(16, 16);
+ this.Log1.mirror = true;
+ setRotation(this.Log1, 0F, 0F, (CORE.PI / 2));
+
+ this.Log2 = new ModelRenderer(this, -2, 10);
+ this.Log2.addBox(0F, 0F, 0F, 14, 2, 2);
+ this.Log2.setRotationPoint(-4F, 10F, -4F);
+ this.Log2.setTextureSize(16, 16);
+ this.Log2.mirror = true;
+ setRotation(this.Log2, (CORE.PI / 2), 0F, (CORE.PI / 2));
+ // Log2.mirror = false;
+
+ this.Log3 = new ModelRenderer(this, 0, 10);
+ this.Log3.addBox(0F, 0F, 0F, 14, 2, 2);
+ this.Log3.setRotationPoint(-4F, 10F, 4F);
+ this.Log3.setTextureSize(16, 16);
+ this.Log3.mirror = true;
+ setRotation(this.Log3, CORE.PI, 0F, (CORE.PI / 2));
+
+ this.Log4 = new ModelRenderer(this, -2, 10);
+ this.Log4.addBox(0F, 0F, 0F, 14, 2, 2);
+ this.Log4.setRotationPoint(4F, 10F, 4F);
+ this.Log4.setTextureSize(16, 16);
+ this.Log4.mirror = true;
+ setRotation(this.Log4, 4.712389F, 0F, (CORE.PI / 2));
+ // Log4.mirror = false;
+ }
+
+ @Override
+ public void render(
+ final Entity entity,
+ final float f,
+ final float f1,
+ final float f2,
+ final float f3,
+ final float f4,
+ final float f5) {
+ super.render(entity, f, f1, f2, f3, f4, f5);
+ this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
+ this.Side_A.render(f5);
+ this.Side_B.render(f5);
+ this.Side_C.render(f5);
+ this.Side_D.render(f5);
+ this.Log1.render(f5);
+ this.Log2.render(f5);
+ this.Log3.render(f5);
+ this.Log4.render(f5);
+ }
+
+ private static void setRotation(final ModelRenderer model, final float x, final float y, final float z) {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+
+ @Override
+ public void setRotationAngles(
+ final float f,
+ final float f1,
+ final float f2,
+ final float f3,
+ final float f4,
+ final float f5,
+ final Entity entity) {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java b/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java
index 7b8d23e25b..616822ada4 100644
--- a/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java
+++ b/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.handler.render;
-import org.lwjgl.opengl.GL11;
-
import net.minecraft.block.Block;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
@@ -10,46 +8,49 @@ import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-public class FirepitRender extends TileEntitySpecialRenderer{
- ResourceLocation texture = new ResourceLocation("miscutils" + ":"+ "textures/blocks/FirePit/mossyFirepit.png");
-
- private final FirepitModel model;
-
- public FirepitRender(){
- this.model = new FirepitModel();
- }
-
- private void adjustRotatePivotViaMeta(final World world, final int x, final int y, final int z) {
- final int meta = world.getBlockMetadata(x, y, z);
- GL11.glPushMatrix();
- GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F);
- GL11.glPopMatrix();
- }
-
- @Override
- public void renderTileEntityAt(final TileEntity entity, final double x, final double y, final double z, final float i) {
- GL11.glPushMatrix();
- GL11.glTranslatef((float)x + 0.1F, (float)y + 1.0F, (float)z + 0.5F);
- GL11.glRotatef(180, 0F, 0F, 1F);
-
- this.bindTexture(this.texture);
- GL11.glPushMatrix();
- this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glTranslatef(1.0f, 1.0f, 1.0f);
- GL11.glPopMatrix();
- GL11.glPopMatrix();
- }
-
- //Set the lighting stuff, so it changes it's brightness properly.
- private void adjustLightFixture(final World world, final int i, final int j, final int k, final Block block) {
- final Tessellator tess = Tessellator.instance;
- //float brightness = block.getBlockBrightness(world, i, j, k);
- //As of MC 1.7+ block.getBlockBrightness() has become block.getLightValue():
- final float brightness = block.getLightValue(world, i, j, k);
- final int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
- final int modulousModifier = skyLight % 65536;
- final int divModifier = skyLight / 65536;
- tess.setColorOpaque_F(brightness, brightness, brightness);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier);
- }
+import org.lwjgl.opengl.GL11;
+
+public class FirepitRender extends TileEntitySpecialRenderer {
+ ResourceLocation texture = new ResourceLocation("miscutils" + ":" + "textures/blocks/FirePit/mossyFirepit.png");
+
+ private final FirepitModel model;
+
+ public FirepitRender() {
+ this.model = new FirepitModel();
+ }
+
+ private void adjustRotatePivotViaMeta(final World world, final int x, final int y, final int z) {
+ final int meta = world.getBlockMetadata(x, y, z);
+ GL11.glPushMatrix();
+ GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F);
+ GL11.glPopMatrix();
+ }
+
+ @Override
+ public void renderTileEntityAt(
+ final TileEntity entity, final double x, final double y, final double z, final float i) {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float) x + 0.1F, (float) y + 1.0F, (float) z + 0.5F);
+ GL11.glRotatef(180, 0F, 0F, 1F);
+
+ this.bindTexture(this.texture);
+ GL11.glPushMatrix();
+ this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
+ GL11.glTranslatef(1.0f, 1.0f, 1.0f);
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ // Set the lighting stuff, so it changes it's brightness properly.
+ private void adjustLightFixture(final World world, final int i, final int j, final int k, final Block block) {
+ final Tessellator tess = Tessellator.instance;
+ // float brightness = block.getBlockBrightness(world, i, j, k);
+ // As of MC 1.7+ block.getBlockBrightness() has become block.getLightValue():
+ final float brightness = block.getLightValue(world, i, j, k);
+ final int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
+ final int modulousModifier = skyLight % 65536;
+ final int divModifier = skyLight / 65536;
+ tess.setColorOpaque_F(brightness, brightness, brightness);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java b/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java
index d6a73512e2..d68d07c5eb 100644
--- a/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java
@@ -3,7 +3,6 @@ package gtPlusPlus.core.handler.workbench;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -17,192 +16,153 @@ import net.minecraft.world.World;
public class Workbench_CraftingHandler {
- private static final Workbench_CraftingHandler instance = new Workbench_CraftingHandler();
- private final List<IRecipe> recipes = new ArrayList<IRecipe>();
-
- public static final Workbench_CraftingHandler getInstance() {
- return instance;
- }
- public Workbench_CraftingHandler() {
-
- //just a example recipe so you know how to add them
- this.addRecipe(new ItemStack(Blocks.iron_block), new Object[]
- {
- "###",
- "###",
- "###",
- Character.valueOf('#'), Items.iron_ingot
- });
-
- //another example Recipe, but shapeless
- this.addShapelessRecipe(new ItemStack(Items.cake),new Object[]{Items.stick});
-
-
- }
-
- void addRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[])
- {
- String s = "";
- int i = 0;
- int j = 0;
- int k = 0;
-
- if (par2ArrayOfObj[i] instanceof String[])
- {
- final String as[] = (String[])par2ArrayOfObj[i++];
-
- for (int l = 0; l < as.length; l++)
- {
- final String s2 = as[l];
- k++;
- j = s2.length();
- s = (new StringBuilder()).append(s).append(s2).toString();
- }
- }
- else
- {
- while (par2ArrayOfObj[i] instanceof String)
- {
- final String s1 = (String)par2ArrayOfObj[i++];
- k++;
- j = s1.length();
- s = (new StringBuilder()).append(s).append(s1).toString();
- }
- }
-
- final HashMap<Character, ItemStack> hashmap = new HashMap<Character, ItemStack>();
-
- for (; i < par2ArrayOfObj.length; i += 2)
- {
- final Character character = (Character)par2ArrayOfObj[i];
- ItemStack itemstack = null;
-
- if (par2ArrayOfObj[i + 1] instanceof Item)
- {
- itemstack = new ItemStack((Item)par2ArrayOfObj[i + 1]);
- }
- else if (par2ArrayOfObj[i + 1] instanceof Block)
- {
- itemstack = new ItemStack((Block)par2ArrayOfObj[i + 1], 1, -1);
- }
- else if (par2ArrayOfObj[i + 1] instanceof ItemStack)
- {
- itemstack = (ItemStack)par2ArrayOfObj[i + 1];
- }
-
- hashmap.put(character, itemstack);
- }
-
- final ItemStack aitemstack[] = new ItemStack[j * k];
-
- for (int i1 = 0; i1 < (j * k); i1++)
- {
- final char c = s.charAt(i1);
-
- if (hashmap.containsKey(Character.valueOf(c)))
- {
- aitemstack[i1] = hashmap.get(Character.valueOf(c)).copy();
- }
- else
- {
- aitemstack[i1] = null;
- }
- }
-
- this.recipes.add(new ShapedRecipes(j, k, aitemstack, par1ItemStack));
- }
-
- public void addShapelessRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[])
- {
- final ArrayList<ItemStack> arraylist = new ArrayList<ItemStack>();
- final Object aobj[] = par2ArrayOfObj;
- final int i = aobj.length;
-
- for (int j = 0; j < i; j++)
- {
- final Object obj = aobj[j];
-
- if (obj instanceof ItemStack)
- {
- arraylist.add(((ItemStack)obj).copy());
- continue;
- }
-
- if (obj instanceof Item)
- {
- arraylist.add(new ItemStack((Item)obj));
- continue;
- }
-
- if (obj instanceof Block)
- {
- arraylist.add(new ItemStack((Block)obj));
- }
- else
- {
- throw new RuntimeException("Invalid shapeless recipe!");
- }
- }
-
- this.recipes.add(new ShapelessRecipes(par1ItemStack, arraylist));
- }
-
- public ItemStack findMatchingRecipe(final InventoryCrafting par1InventoryCrafting, final World par2World)
- {
- int i = 0;
- for (int j = 0; j < par1InventoryCrafting.getSizeInventory(); j++)
- {
- final ItemStack itemstack2 = par1InventoryCrafting.getStackInSlot(j);
-
- if (itemstack2 == null)
- {
- continue;
- }
-
- if (i == 0)
- {
- }
-
- if (i == 1)
- {
- }
-
- i++;
- }
-
- //TODO - Update from itemIDs
- /*if (i == 2 && itemstack.itemID == itemstack1.itemID && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && Item.itemsList[itemstack.itemID].isDamageable())
- {
- Item item = Item.itemsList[itemstack.itemID];
- int l = item.getMaxDamage() - itemstack.getItemDamageForDisplay();
- int i1 = item.getMaxDamage() - itemstack1.getItemDamageForDisplay();
- int j1 = l + i1 + (item.getMaxDamage() * 10) / 100;
- int k1 = item.getMaxDamage() - j1;
-
- if (k1 < 0)
- {
- k1 = 0;
- }
-
- return new ItemStack(itemstack.itemID, 1, k1);
- }*/
-
- for (int k = 0; k < this.recipes.size(); k++)
- {
- final IRecipe irecipe = this.recipes.get(k);
-
- if (irecipe.matches(par1InventoryCrafting, par2World))
- {
- return irecipe.getCraftingResult(par1InventoryCrafting);
- }
- }
-
- return null;
- }
-
-
- public List<IRecipe> getRecipeList()
- {
- return this.recipes;
- }
-} \ No newline at end of file
+ private static final Workbench_CraftingHandler instance = new Workbench_CraftingHandler();
+ private final List<IRecipe> recipes = new ArrayList<IRecipe>();
+
+ public static final Workbench_CraftingHandler getInstance() {
+ return instance;
+ }
+
+ public Workbench_CraftingHandler() {
+
+ // just a example recipe so you know how to add them
+ this.addRecipe(
+ new ItemStack(Blocks.iron_block),
+ new Object[] {"###", "###", "###", Character.valueOf('#'), Items.iron_ingot});
+
+ // another example Recipe, but shapeless
+ this.addShapelessRecipe(new ItemStack(Items.cake), new Object[] {Items.stick});
+ }
+
+ void addRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[]) {
+ String s = "";
+ int i = 0;
+ int j = 0;
+ int k = 0;
+
+ if (par2ArrayOfObj[i] instanceof String[]) {
+ final String as[] = (String[]) par2ArrayOfObj[i++];
+
+ for (int l = 0; l < as.length; l++) {
+ final String s2 = as[l];
+ k++;
+ j = s2.length();
+ s = (new StringBuilder()).append(s).append(s2).toString();
+ }
+ } else {
+ while (par2ArrayOfObj[i] instanceof String) {
+ final String s1 = (String) par2ArrayOfObj[i++];
+ k++;
+ j = s1.length();
+ s = (new StringBuilder()).append(s).append(s1).toString();
+ }
+ }
+
+ final HashMap<Character, ItemStack> hashmap = new HashMap<Character, ItemStack>();
+
+ for (; i < par2ArrayOfObj.length; i += 2) {
+ final Character character = (Character) par2ArrayOfObj[i];
+ ItemStack itemstack = null;
+
+ if (par2ArrayOfObj[i + 1] instanceof Item) {
+ itemstack = new ItemStack((Item) par2ArrayOfObj[i + 1]);
+ } else if (par2ArrayOfObj[i + 1] instanceof Block) {
+ itemstack = new ItemStack((Block) par2ArrayOfObj[i + 1], 1, -1);
+ } else if (par2ArrayOfObj[i + 1] instanceof ItemStack) {
+ itemstack = (ItemStack) par2ArrayOfObj[i + 1];
+ }
+
+ hashmap.put(character, itemstack);
+ }
+
+ final ItemStack aitemstack[] = new ItemStack[j * k];
+
+ for (int i1 = 0; i1 < (j * k); i1++) {
+ final char c = s.charAt(i1);
+
+ if (hashmap.containsKey(Character.valueOf(c))) {
+ aitemstack[i1] = hashmap.get(Character.valueOf(c)).copy();
+ } else {
+ aitemstack[i1] = null;
+ }
+ }
+
+ this.recipes.add(new ShapedRecipes(j, k, aitemstack, par1ItemStack));
+ }
+
+ public void addShapelessRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[]) {
+ final ArrayList<ItemStack> arraylist = new ArrayList<ItemStack>();
+ final Object aobj[] = par2ArrayOfObj;
+ final int i = aobj.length;
+
+ for (int j = 0; j < i; j++) {
+ final Object obj = aobj[j];
+
+ if (obj instanceof ItemStack) {
+ arraylist.add(((ItemStack) obj).copy());
+ continue;
+ }
+
+ if (obj instanceof Item) {
+ arraylist.add(new ItemStack((Item) obj));
+ continue;
+ }
+
+ if (obj instanceof Block) {
+ arraylist.add(new ItemStack((Block) obj));
+ } else {
+ throw new RuntimeException("Invalid shapeless recipe!");
+ }
+ }
+
+ this.recipes.add(new ShapelessRecipes(par1ItemStack, arraylist));
+ }
+
+ public ItemStack findMatchingRecipe(final InventoryCrafting par1InventoryCrafting, final World par2World) {
+ int i = 0;
+ for (int j = 0; j < par1InventoryCrafting.getSizeInventory(); j++) {
+ final ItemStack itemstack2 = par1InventoryCrafting.getStackInSlot(j);
+
+ if (itemstack2 == null) {
+ continue;
+ }
+
+ if (i == 0) {}
+
+ if (i == 1) {}
+
+ i++;
+ }
+
+ // TODO - Update from itemIDs
+ /*if (i == 2 && itemstack.itemID == itemstack1.itemID && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && Item.itemsList[itemstack.itemID].isDamageable())
+ {
+ Item item = Item.itemsList[itemstack.itemID];
+ int l = item.getMaxDamage() - itemstack.getItemDamageForDisplay();
+ int i1 = item.getMaxDamage() - itemstack1.getItemDamageForDisplay();
+ int j1 = l + i1 + (item.getMaxDamage() * 10) / 100;
+ int k1 = item.getMaxDamage() - j1;
+
+ if (k1 < 0)
+ {
+ k1 = 0;
+ }
+
+ return new ItemStack(itemstack.itemID, 1, k1);
+ }*/
+
+ for (int k = 0; k < this.recipes.size(); k++) {
+ final IRecipe irecipe = this.recipes.get(k);
+
+ if (irecipe.matches(par1InventoryCrafting, par2World)) {
+ return irecipe.getCraftingResult(par1InventoryCrafting);
+ }
+ }
+
+ return null;
+ }
+
+ public List<IRecipe> getRecipeList() {
+ return this.recipes;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java b/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java
index 9d5f7d03ed..d8b25c4746 100644
--- a/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java
+++ b/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java
@@ -1,44 +1,35 @@
package gtPlusPlus.core.handler.workbench;
import java.util.Comparator;
-
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;
-public class Workbench_RecipeSorter implements Comparator<Object>
-{
- final Workbench_CraftingHandler CraftingManagerCrafter;
-
- Workbench_RecipeSorter(final Workbench_CraftingHandler par1CraftingManager)
- {
- this.CraftingManagerCrafter = par1CraftingManager;
- }
-
- public int compareRecipes(final IRecipe par1IRecipe, final IRecipe par2IRecipe)
- {
- if ((par1IRecipe instanceof ShapelessRecipes) && (par2IRecipe instanceof ShapedRecipes))
- {
- return 1;
- }
-
- if ((par2IRecipe instanceof ShapelessRecipes) && (par1IRecipe instanceof ShapedRecipes))
- {
- return -1;
- }
-
- if (par2IRecipe.getRecipeSize() < par1IRecipe.getRecipeSize())
- {
- return -1;
- }
-
- return par2IRecipe.getRecipeSize() <= par1IRecipe.getRecipeSize() ? 0 : 1;
- }
-
- @Override
- public int compare(final Object par1Obj, final Object par2Obj)
- {
- return this.compareRecipes((IRecipe)par1Obj, (IRecipe)par2Obj);
- }
-
-} \ No newline at end of file
+public class Workbench_RecipeSorter implements Comparator<Object> {
+ final Workbench_CraftingHandler CraftingManagerCrafter;
+
+ Workbench_RecipeSorter(final Workbench_CraftingHandler par1CraftingManager) {
+ this.CraftingManagerCrafter = par1CraftingManager;
+ }
+
+ public int compareRecipes(final IRecipe par1IRecipe, final IRecipe par2IRecipe) {
+ if ((par1IRecipe instanceof ShapelessRecipes) && (par2IRecipe instanceof ShapedRecipes)) {
+ return 1;
+ }
+
+ if ((par2IRecipe instanceof ShapelessRecipes) && (par1IRecipe instanceof ShapedRecipes)) {
+ return -1;
+ }
+
+ if (par2IRecipe.getRecipeSize() < par1IRecipe.getRecipeSize()) {
+ return -1;
+ }
+
+ return par2IRecipe.getRecipeSize() <= par1IRecipe.getRecipeSize() ? 0 : 1;
+ }
+
+ @Override
+ public int compare(final Object par1Obj, final Object par2Obj) {
+ return this.compareRecipes((IRecipe) par1Obj, (IRecipe) par2Obj);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java b/src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java
index 1d0ad9ed87..599ed6b59b 100644
--- a/src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java
+++ b/src/main/java/gtPlusPlus/core/interfaces/IGuiManager.java
@@ -4,13 +4,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
-public abstract interface IGuiManager extends IGuiManagerMiscUtils{
+public abstract interface IGuiManager extends IGuiManagerMiscUtils {
- public abstract ChunkCoordinates getCoordinates();
+ public abstract ChunkCoordinates getCoordinates();
- public abstract World getWorld();
+ public abstract World getWorld();
- public abstract Object getGui(EntityPlayer paramEntityPlayer, int paramInt);
+ public abstract Object getGui(EntityPlayer paramEntityPlayer, int paramInt);
- public abstract Object getContainer(EntityPlayer paramEntityPlayer, int paramInt);
+ public abstract Object getContainer(EntityPlayer paramEntityPlayer, int paramInt);
}
diff --git a/src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java b/src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
index cf46c67a54..f5f10162f9 100644
--- a/src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
+++ b/src/main/java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
@@ -1,3 +1,3 @@
package gtPlusPlus.core.interfaces;
-public abstract interface IGuiManagerMiscUtils {} \ No newline at end of file
+public abstract interface IGuiManagerMiscUtils {}
diff --git a/src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java b/src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java
index 473aa827b6..2c320b5830 100644
--- a/src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java
+++ b/src/main/java/gtPlusPlus/core/interfaces/IItemBlueprint.java
@@ -5,44 +5,43 @@ import net.minecraft.item.ItemStack;
public interface IItemBlueprint {
- /**
- * The inventory size for the blueprint~
- */
- public int INV_SIZE = 9;
-
- /**
- * Meta Compatible function to allow meta items to be blueprints
- * @param stack yourMetaItem
- * @return true if it is a Blueprint
- */
- public boolean isBlueprint(ItemStack stack);
-
- /**
- * Sets the blueprint for this itemstack.
- * @param stack yourMetaItem
- * @return true if blueprint is set successfully
- */
- public boolean setBlueprint(ItemStack stack, IInventory craftingTable, ItemStack output);
-
- /**
- * Sets the name of the recipe/blueprint
- * @param String Blueprint Name
- * @return N/A
- */
- public void setBlueprintName(ItemStack stack, String name);
-
- /**
- * Does this itemstack hold a blueprint?
- * @param stack yourMetaItem
- * @return true if is holding a Blueprint
- */
- public boolean hasBlueprint(ItemStack stack);
-
- /**
- * Gets the recipe held by the item
- * @param stack yourMetaItem
- * @return the blueprints contents
- */
- public ItemStack[] getBlueprint(ItemStack stack);
-
+ /**
+ * The inventory size for the blueprint~
+ */
+ public int INV_SIZE = 9;
+
+ /**
+ * Meta Compatible function to allow meta items to be blueprints
+ * @param stack yourMetaItem
+ * @return true if it is a Blueprint
+ */
+ public boolean isBlueprint(ItemStack stack);
+
+ /**
+ * Sets the blueprint for this itemstack.
+ * @param stack yourMetaItem
+ * @return true if blueprint is set successfully
+ */
+ public boolean setBlueprint(ItemStack stack, IInventory craftingTable, ItemStack output);
+
+ /**
+ * Sets the name of the recipe/blueprint
+ * @param String Blueprint Name
+ * @return N/A
+ */
+ public void setBlueprintName(ItemStack stack, String name);
+
+ /**
+ * Does this itemstack hold a blueprint?
+ * @param stack yourMetaItem
+ * @return true if is holding a Blueprint
+ */
+ public boolean hasBlueprint(ItemStack stack);
+
+ /**
+ * Gets the recipe held by the item
+ * @param stack yourMetaItem
+ * @return the blueprints contents
+ */
+ public ItemStack[] getBlueprint(ItemStack stack);
}
diff --git a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java b/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
index 256fedb13c..3dce83535b 100644
--- a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
+++ b/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
@@ -1,241 +1,214 @@
package gtPlusPlus.core.inventories;
+import gtPlusPlus.core.item.base.BaseItemBackpack;
import java.util.UUID;
-
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-
-import gtPlusPlus.core.item.base.BaseItemBackpack;
import net.minecraftforge.common.util.Constants;
-public class BaseInventoryBackpack implements IInventory{
-
- private final String name = "Inventory Item";
-
- /** Provides NBT Tag Compound to reference */
- private final ItemStack invItem;
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 8;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private final ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- // declaration of variable:
- protected String uniqueID;
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public BaseInventoryBackpack(final ItemStack stack)
- {
- this.invItem = stack;
-
- /** initialize variable within the constructor: */
- this.uniqueID = "";
-
- if (!stack.hasTagCompound())
- {
- stack.setTagCompound(new NBTTagCompound());
- // no tag compound means the itemstack does not yet have a UUID, so assign one:
- this.uniqueID = UUID.randomUUID().toString();
- }
-
- // Create a new NBT Tag Compound if one doesn't already exist, or you will crash
- if (!stack.hasTagCompound()) {
- stack.setTagCompound(new NBTTagCompound());
- }
- // note that it's okay to use stack instead of invItem right there
- // both reference the same memory location, so whatever you change using
- // either reference will change in the other
-
- // Read the inventory contents from NBT
- this.readFromNBT(stack.getTagCompound());
- }
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
-
- // This line here does the work:
- this.writeToNBT(this.invItem.getTagCompound());
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return !(itemstack.getItem() instanceof BaseItemBackpack);
- }
-
- /**
- * A custom method to read our inventory from an ItemStack's NBT compound
- */
- public void readFromNBT(final NBTTagCompound compound)
- {
- // Gets the custom taglist we wrote to this compound, if any
- // 1.7.2+ change to compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
- final NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
-
- if ("".equals(this.uniqueID))
- {
- // try to read unique ID from NBT
- this.uniqueID = compound.getString("uniqueID");
- // if it's still "", assign a new one:
- if ("".equals(this.uniqueID))
- {
- this.uniqueID = UUID.randomUUID().toString();
- }
- }
-
- for (int i = 0; i < items.tagCount(); ++i)
- {
- // 1.7.2+ change to items.getCompoundTagAt(i)
- final NBTTagCompound item = items.getCompoundTagAt(i);
- final int slot = item.getInteger("Slot");
-
- // Just double-checking that the saved slot index is within our inventory array bounds
- if ((slot >= 0) && (slot < this.getSizeInventory())) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(item);
- }
- }
- }
-
- /**
- * A custom method to write our inventory to an ItemStack's NBT compound
- */
- public void writeToNBT(final NBTTagCompound tagcompound)
- {
- // Create a new NBT Tag List to store itemstacks as NBT Tags
- final NBTTagList items = new NBTTagList();
-
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- // Only write stacks that contain items
- if (this.getStackInSlot(i) != null)
- {
- // Make a new NBT Tag Compound to write the itemstack and slot index to
- final NBTTagCompound item = new NBTTagCompound();
- item.setInteger("Slot", i);
- // Writes the itemstack in slot(i) to the Tag Compound we just made
- this.getStackInSlot(i).writeToNBT(item);
-
- // add the tag compound to our tag list
- items.appendTag(item);
- }
- }
- tagcompound.setString("uniqueID", this.uniqueID);
- // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory"
- tagcompound.setTag("ItemInventory", items);
- }
-} \ No newline at end of file
+public class BaseInventoryBackpack implements IInventory {
+
+ private final String name = "Inventory Item";
+
+ /** Provides NBT Tag Compound to reference */
+ private final ItemStack invItem;
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 8;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private final ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ // declaration of variable:
+ protected String uniqueID;
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public BaseInventoryBackpack(final ItemStack stack) {
+ this.invItem = stack;
+
+ /** initialize variable within the constructor: */
+ this.uniqueID = "";
+
+ if (!stack.hasTagCompound()) {
+ stack.setTagCompound(new NBTTagCompound());
+ // no tag compound means the itemstack does not yet have a UUID, so assign one:
+ this.uniqueID = UUID.randomUUID().toString();
+ }
+
+ // Create a new NBT Tag Compound if one doesn't already exist, or you will crash
+ if (!stack.hasTagCompound()) {
+ stack.setTagCompound(new NBTTagCompound());
+ }
+ // note that it's okay to use stack instead of invItem right there
+ // both reference the same memory location, so whatever you change using
+ // either reference will change in the other
+
+ // Read the inventory contents from NBT
+ this.readFromNBT(stack.getTagCompound());
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+
+ // This line here does the work:
+ this.writeToNBT(this.invItem.getTagCompound());
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return !(itemstack.getItem() instanceof BaseItemBackpack);
+ }
+
+ /**
+ * A custom method to read our inventory from an ItemStack's NBT compound
+ */
+ public void readFromNBT(final NBTTagCompound compound) {
+ // Gets the custom taglist we wrote to this compound, if any
+ // 1.7.2+ change to compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
+ final NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
+
+ if ("".equals(this.uniqueID)) {
+ // try to read unique ID from NBT
+ this.uniqueID = compound.getString("uniqueID");
+ // if it's still "", assign a new one:
+ if ("".equals(this.uniqueID)) {
+ this.uniqueID = UUID.randomUUID().toString();
+ }
+ }
+
+ for (int i = 0; i < items.tagCount(); ++i) {
+ // 1.7.2+ change to items.getCompoundTagAt(i)
+ final NBTTagCompound item = items.getCompoundTagAt(i);
+ final int slot = item.getInteger("Slot");
+
+ // Just double-checking that the saved slot index is within our inventory array bounds
+ if ((slot >= 0) && (slot < this.getSizeInventory())) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(item);
+ }
+ }
+ }
+
+ /**
+ * A custom method to write our inventory to an ItemStack's NBT compound
+ */
+ public void writeToNBT(final NBTTagCompound tagcompound) {
+ // Create a new NBT Tag List to store itemstacks as NBT Tags
+ final NBTTagList items = new NBTTagList();
+
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ // Only write stacks that contain items
+ if (this.getStackInSlot(i) != null) {
+ // Make a new NBT Tag Compound to write the itemstack and slot index to
+ final NBTTagCompound item = new NBTTagCompound();
+ item.setInteger("Slot", i);
+ // Writes the itemstack in slot(i) to the Tag Compound we just made
+ this.getStackInSlot(i).writeToNBT(item);
+
+ // add the tag compound to our tag list
+ items.appendTag(item);
+ }
+ }
+ tagcompound.setString("uniqueID", this.uniqueID);
+ // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory"
+ tagcompound.setTag("ItemInventory", items);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java b/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java
index 823398bd57..b402dcea20 100644
--- a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java
+++ b/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java
@@ -1,224 +1,220 @@
package gtPlusPlus.core.inventories;
+import gtPlusPlus.core.item.base.BaseItemBackpack;
import java.util.UUID;
-
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-
-import gtPlusPlus.core.item.base.BaseItemBackpack;
import net.minecraftforge.common.util.Constants;
public class BaseInventoryGrindle implements IInventory {
- private final String name = "Inventory Item";
-
- /** Provides NBT Tag Compound to reference */
- private final ItemStack invItem;
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 6;
-
- /**
- * Inventory's size must be same as number of slots you add to the Container
- * class
- */
- private final ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- // declaration of variable:
- protected String uniqueID;
-
- /**
- * @param itemstack
- * - the ItemStack to which this inventory belongs
- */
- public BaseInventoryGrindle(final ItemStack stack) {
- this.invItem = stack;
-
- /** initialize variable within the constructor: */
- this.uniqueID = "";
-
- if (!stack.hasTagCompound()) {
- stack.setTagCompound(new NBTTagCompound());
- // no tag compound means the itemstack does not yet have a UUID, so assign one:
- this.uniqueID = UUID.randomUUID().toString();
- }
-
- // Create a new NBT Tag Compound if one doesn't already exist, or you will crash
- if (!stack.hasTagCompound()) {
- stack.setTagCompound(new NBTTagCompound());
- }
- // note that it's okay to use stack instead of invItem right there
- // both reference the same memory location, so whatever you change using
- // either reference will change in the other
-
- // Read the inventory contents from NBT
- this.readFromNBT(stack.getTagCompound());
- }
-
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- ItemStack stack = this.getStackInSlot(slot);
- if (stack != null) {
- if (stack.stackSize > amount) {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- } else {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName() {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 1;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is
- * called (or should be called!) anytime the inventory changes. Perfect. Much
- * better than using onUpdate in an Item, as this will also let you change
- * things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty() {
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
-
- // This line here does the work:
- this.writeToNBT(this.invItem.getTagCompound());
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {
- }
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {
- }
-
- /**
- * This method doesn't seem to do what it claims to do, as items can still be
- * left-clicked and placed in the inventory even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return !(itemstack.getItem() instanceof BaseItemBackpack);
- }
-
- /**
- * A custom method to read our inventory from an ItemStack's NBT compound
- */
- public void readFromNBT(final NBTTagCompound compound) {
- // Gets the custom taglist we wrote to this compound, if any
- // 1.7.2+ change to compound.getTagList("ItemInventory",
- // Constants.NBT.TAG_COMPOUND);
- final NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
-
- if ("".equals(this.uniqueID)) {
- // try to read unique ID from NBT
- this.uniqueID = compound.getString("uniqueID");
- // if it's still "", assign a new one:
- if ("".equals(this.uniqueID)) {
- this.uniqueID = UUID.randomUUID().toString();
- }
- }
-
- for (int i = 0; i < items.tagCount(); ++i) {
- // 1.7.2+ change to items.getCompoundTagAt(i)
- final NBTTagCompound item = items.getCompoundTagAt(i);
- final int slot = item.getInteger("Slot");
-
- // Just double-checking that the saved slot index is within our inventory array
- // bounds
- if ((slot >= 0) && (slot < this.getSizeInventory())) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(item);
- }
- }
- }
-
- /**
- * A custom method to write our inventory to an ItemStack's NBT compound
- */
- public void writeToNBT(final NBTTagCompound tagcompound) {
- // Create a new NBT Tag List to store itemstacks as NBT Tags
- final NBTTagList items = new NBTTagList();
-
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- // Only write stacks that contain items
- if (this.getStackInSlot(i) != null) {
- // Make a new NBT Tag Compound to write the itemstack and slot index to
- final NBTTagCompound item = new NBTTagCompound();
- item.setInteger("Slot", i);
- // Writes the itemstack in slot(i) to the Tag Compound we just made
- this.getStackInSlot(i).writeToNBT(item);
-
- // add the tag compound to our tag list
- items.appendTag(item);
- }
- }
- tagcompound.setString("uniqueID", this.uniqueID);
- // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory"
- tagcompound.setTag("ItemInventory", items);
- }
-} \ No newline at end of file
+ private final String name = "Inventory Item";
+
+ /** Provides NBT Tag Compound to reference */
+ private final ItemStack invItem;
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 6;
+
+ /**
+ * Inventory's size must be same as number of slots you add to the Container
+ * class
+ */
+ private final ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ // declaration of variable:
+ protected String uniqueID;
+
+ /**
+ * @param itemstack
+ * - the ItemStack to which this inventory belongs
+ */
+ public BaseInventoryGrindle(final ItemStack stack) {
+ this.invItem = stack;
+
+ /** initialize variable within the constructor: */
+ this.uniqueID = "";
+
+ if (!stack.hasTagCompound()) {
+ stack.setTagCompound(new NBTTagCompound());
+ // no tag compound means the itemstack does not yet have a UUID, so assign one:
+ this.uniqueID = UUID.randomUUID().toString();
+ }
+
+ // Create a new NBT Tag Compound if one doesn't already exist, or you will crash
+ if (!stack.hasTagCompound()) {
+ stack.setTagCompound(new NBTTagCompound());
+ }
+ // note that it's okay to use stack instead of invItem right there
+ // both reference the same memory location, so whatever you change using
+ // either reference will change in the other
+
+ // Read the inventory contents from NBT
+ this.readFromNBT(stack.getTagCompound());
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 1;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is
+ * called (or should be called!) anytime the inventory changes. Perfect. Much
+ * better than using onUpdate in an Item, as this will also let you change
+ * things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+
+ // This line here does the work:
+ this.writeToNBT(this.invItem.getTagCompound());
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as items can still be
+ * left-clicked and placed in the inventory even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return !(itemstack.getItem() instanceof BaseItemBackpack);
+ }
+
+ /**
+ * A custom method to read our inventory from an ItemStack's NBT compound
+ */
+ public void readFromNBT(final NBTTagCompound compound) {
+ // Gets the custom taglist we wrote to this compound, if any
+ // 1.7.2+ change to compound.getTagList("ItemInventory",
+ // Constants.NBT.TAG_COMPOUND);
+ final NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
+
+ if ("".equals(this.uniqueID)) {
+ // try to read unique ID from NBT
+ this.uniqueID = compound.getString("uniqueID");
+ // if it's still "", assign a new one:
+ if ("".equals(this.uniqueID)) {
+ this.uniqueID = UUID.randomUUID().toString();
+ }
+ }
+
+ for (int i = 0; i < items.tagCount(); ++i) {
+ // 1.7.2+ change to items.getCompoundTagAt(i)
+ final NBTTagCompound item = items.getCompoundTagAt(i);
+ final int slot = item.getInteger("Slot");
+
+ // Just double-checking that the saved slot index is within our inventory array
+ // bounds
+ if ((slot >= 0) && (slot < this.getSizeInventory())) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(item);
+ }
+ }
+ }
+
+ /**
+ * A custom method to write our inventory to an ItemStack's NBT compound
+ */
+ public void writeToNBT(final NBTTagCompound tagcompound) {
+ // Create a new NBT Tag List to store itemstacks as NBT Tags
+ final NBTTagList items = new NBTTagList();
+
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ // Only write stacks that contain items
+ if (this.getStackInSlot(i) != null) {
+ // Make a new NBT Tag Compound to write the itemstack and slot index to
+ final NBTTagCompound item = new NBTTagCompound();
+ item.setInteger("Slot", i);
+ // Writes the itemstack in slot(i) to the Tag Compound we just made
+ this.getStackInSlot(i).writeToNBT(item);
+
+ // add the tag compound to our tag list
+ items.appendTag(item);
+ }
+ }
+ tagcompound.setString("uniqueID", this.uniqueID);
+ // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory"
+ tagcompound.setTag("ItemInventory", items);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java b/src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java
index da45b5a988..0512dd4b15 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java
@@ -7,167 +7,150 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryCircuitProgrammer implements IInventory{
-
- private final String name = "Circuit Programmer";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 26;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt){
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++){
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE)){
- //Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt){
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++){
- final ItemStack stack = this.inventory[i];
- if(stack != null){
- //Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return SlotIntegratedCircuit.isItemValidForSlot(itemstack);
- }
-
-} \ No newline at end of file
+public class InventoryCircuitProgrammer implements IInventory {
+
+ private final String name = "Circuit Programmer";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 26;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ // Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ // Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return SlotIntegratedCircuit.isItemValidForSlot(itemstack);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java b/src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java
index 429ff517c1..2bf1a390b1 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryFishTrap.java
@@ -6,171 +6,153 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryFishTrap implements IInventory{
-
- private final String name = "Fishtrap";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 15;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt){
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++){
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE)){
- //Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt){
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++){
- final ItemStack stack = this.inventory[i];
- if(stack != null){
- //Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class InventoryFishTrap implements IInventory {
+
+ private final String name = "Fishtrap";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 15;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ // Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ // Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java b/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java
index 0288aa4d29..8ea78647ab 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java
@@ -6,171 +6,153 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryHeliumGenerator implements IInventory{
-
- private final String name = "Helium";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 19;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt){
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++){
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE)){
- //Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt){
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++){
- final ItemStack stack = this.inventory[i];
- if(stack != null){
- //Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class InventoryHeliumGenerator implements IInventory {
+
+ private final String name = "Helium";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 19;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ // Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ // Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java b/src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java
index 1c5d98f7d2..b1852480c4 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryPestKiller.java
@@ -6,171 +6,153 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryPestKiller implements IInventory{
-
- private final String name = "Pest Killer";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 3;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt){
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++){
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE)){
- //Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt){
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++){
- final ItemStack stack = this.inventory[i];
- if(stack != null){
- //Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class InventoryPestKiller implements IInventory {
+
+ private final String name = "Pest Killer";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 3;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ // Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ // Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java
index 3ea5675ba2..dbcf75603a 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java
@@ -6,183 +6,156 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryWorkbenchChest implements IInventory{
-
- private final String name = "Inventory Chest";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 16;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryWorkbenchChest()
- {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.inventory[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class InventoryWorkbenchChest implements IInventory {
+
+ private final String name = "Inventory Chest";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 16;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryWorkbenchChest() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java
index f49540b5e2..82cd532e92 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java
@@ -8,194 +8,171 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryWorkbenchCrafting implements IInventory{
-
- private final String name = "Inventory Crafting";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 9;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
- public final InventoryCrafting craftMatrix;
- public final Container parentContainer;
-
- public InventoryCrafting getCrafting(){
- return this.craftMatrix;
- }
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryWorkbenchCrafting(final Container containerR)
- {
- this.parentContainer = containerR;
- this.craftMatrix = new InventoryCrafting(this.parentContainer, 3, 3);
- }
-
- private ItemStack[] getArrayOfCraftingItems(){
- final ItemStack[] array = new ItemStack[9];
- for (int i=0; i<this.craftMatrix.getSizeInventory();i++){
- if(this.craftMatrix.getStackInSlot(i) != null){
- array[i] = this.craftMatrix.getStackInSlot(i);
- }
- }
- return array;
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- this.getInventory()[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.getInventory()[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.getInventory().length;
- }
-
- public ItemStack[] getInventory(){
- return this.getArrayOfCraftingItems();
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.getInventory()[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.getInventory()[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
- this.getInventory()[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-} \ No newline at end of file
+public class InventoryWorkbenchCrafting implements IInventory {
+
+ private final String name = "Inventory Crafting";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 9;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public final InventoryCrafting craftMatrix;
+ public final Container parentContainer;
+
+ public InventoryCrafting getCrafting() {
+ return this.craftMatrix;
+ }
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryWorkbenchCrafting(final Container containerR) {
+ this.parentContainer = containerR;
+ this.craftMatrix = new InventoryCrafting(this.parentContainer, 3, 3);
+ }
+
+ private ItemStack[] getArrayOfCraftingItems() {
+ final ItemStack[] array = new ItemStack[9];
+ for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) {
+ if (this.craftMatrix.getStackInSlot(i) != null) {
+ array[i] = this.craftMatrix.getStackInSlot(i);
+ }
+ }
+ return array;
+ }
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.getInventory()[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.getInventory()[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.getInventory().length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.getArrayOfCraftingItems();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.getInventory()[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.getInventory()[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
+ this.getInventory()[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java
index 432a425a9b..724c0fab99 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java
@@ -4,161 +4,139 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
-public class InventoryWorkbenchHoloCrafting implements IInventory{
-
- private final String name = "Inventory Crafting";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 9;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private final ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryWorkbenchHoloCrafting()
- {
-
- }
-
- /*public void readFromNBT(NBTTagCompound nbt)
- {
- NBTTagList list = nbt.getTagList("Items", 10);
- inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- NBTTagCompound data = list.getCompoundTagAt(i);
- int slot = data.getInteger("Slot");
- if(slot >= 0 && slot < INV_SIZE)
- {
- inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(NBTTagCompound nbt)
- {
- NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- ItemStack stack = inventory[i];
- if(stack != null)
- {
- NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }*/
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- this.markDirty();
- }
- else
- {
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
- this.markDirty();
- }
-
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- @Override
- public void openInventory() {}
-
- @Override
- public void closeInventory() {}
-
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- return true;
- }
-
-} \ No newline at end of file
+public class InventoryWorkbenchHoloCrafting implements IInventory {
+
+ private final String name = "Inventory Crafting";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 9;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private final ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryWorkbenchHoloCrafting() {}
+
+ /*public void readFromNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = nbt.getTagList("Items", 10);
+ inventory = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++)
+ {
+ NBTTagCompound data = list.getCompoundTagAt(i);
+ int slot = data.getInteger("Slot");
+ if(slot >= 0 && slot < INV_SIZE)
+ {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++)
+ {
+ ItemStack stack = inventory[i];
+ if(stack != null)
+ {
+ NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }*/
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ this.markDirty();
+ } else {
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+ this.markDirty();
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ @Override
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java
index 1966e8fdca..d038a3d9c1 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java
@@ -1,5 +1,6 @@
package gtPlusPlus.core.inventories;
+import gtPlusPlus.api.objects.Logger;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCraftResult;
@@ -7,237 +8,210 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-import gtPlusPlus.api.objects.Logger;
-
-public class InventoryWorkbenchHoloSlots implements IInventory{
-
- private final String name = "Inventory Holo";
-
- //Output Slot
- public IInventory craftResult = new InventoryCraftResult();
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 6;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryWorkbenchHoloSlots()
- {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 1) && (slot < INV_SIZE))
- {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.inventory[i];
- if((stack != null) && (i != 0))
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 1;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- return false;
- }
-
- /** A list of one item containing the result of the crafting formula */
- private final ItemStack[] stackResult = new ItemStack[1];
-
- /**
- * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
- * new stack.
- */
- /*@Override
- public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_)
- {
- ItemStack stack = getStackInSlot(0);
- if (this.stackResult[0] != null)
- {
- ItemStack itemstack = this.stackResult[0];
- this.stackResult[0] = null;
- return itemstack;
- }
- if(stack != null)
- {
- if(stack.stackSize > p_70298_2_)
- {
- stack = stack.splitStack(p_70298_2_);
- // Don't forget this line or your inventory will not be saved!
- markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- setInventorySlotContents(p_70298_1_, null);
- }
- }
- return stack;
- }*/
- @Override
- public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_)
- {
- if (this.getStackInSlot(0) != null){
- Logger.INFO("getStackInSlot(0) contains "+this.getStackInSlot(0).getDisplayName());
- if (this.stackResult[0] == null){
- Logger.INFO("this.stackResult[0] == null");
- this.stackResult[0] = this.getStackInSlot(0);
- }
- else if (this.stackResult[0] != null){
- Logger.INFO("this.stackResult[0] != null");
- if (this.stackResult[0].getDisplayName().toLowerCase().equals(this.getStackInSlot(0).getDisplayName().toLowerCase())){
- Logger.INFO("Items are the same?");
- }
- else {
- Logger.INFO("Items are not the same.");
- }
- }
- }
-
- if (this.stackResult[0] != null)
- {
- Logger.INFO("this.stackResult[0] != null - Really never should be though. - Returning "+this.stackResult[0].getDisplayName());
- final ItemStack itemstack = this.stackResult[0];
- this.stackResult[0] = null;
- return itemstack;
- }
- return null;
- }
-
- /**
- * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
- * like when you close a workbench GUI.
- */
- @Override
- public ItemStack getStackInSlotOnClosing(final int p_70304_1_)
- {
- if (this.stackResult[0] != null)
- {
- final ItemStack itemstack = this.stackResult[0];
- this.stackResult[0] = null;
- return itemstack;
- }
- return null;
- }
-
+public class InventoryWorkbenchHoloSlots implements IInventory {
+
+ private final String name = "Inventory Holo";
+
+ // Output Slot
+ public IInventory craftResult = new InventoryCraftResult();
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 6;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryWorkbenchHoloSlots() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 1) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if ((stack != null) && (i != 0)) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 1;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return false;
+ }
+
+ /** A list of one item containing the result of the crafting formula */
+ private final ItemStack[] stackResult = new ItemStack[1];
+
+ /**
+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
+ * new stack.
+ */
+ /*@Override
+ public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_)
+ {
+ ItemStack stack = getStackInSlot(0);
+ if (this.stackResult[0] != null)
+ {
+ ItemStack itemstack = this.stackResult[0];
+ this.stackResult[0] = null;
+ return itemstack;
+ }
+ if(stack != null)
+ {
+ if(stack.stackSize > p_70298_2_)
+ {
+ stack = stack.splitStack(p_70298_2_);
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
+ }
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ setInventorySlotContents(p_70298_1_, null);
+ }
+ }
+ return stack;
+ }*/
+ @Override
+ public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
+ if (this.getStackInSlot(0) != null) {
+ Logger.INFO("getStackInSlot(0) contains " + this.getStackInSlot(0).getDisplayName());
+ if (this.stackResult[0] == null) {
+ Logger.INFO("this.stackResult[0] == null");
+ this.stackResult[0] = this.getStackInSlot(0);
+ } else if (this.stackResult[0] != null) {
+ Logger.INFO("this.stackResult[0] != null");
+ if (this.stackResult[0]
+ .getDisplayName()
+ .toLowerCase()
+ .equals(this.getStackInSlot(0).getDisplayName().toLowerCase())) {
+ Logger.INFO("Items are the same?");
+ } else {
+ Logger.INFO("Items are not the same.");
+ }
+ }
+ }
+
+ if (this.stackResult[0] != null) {
+ Logger.INFO("this.stackResult[0] != null - Really never should be though. - Returning "
+ + this.stackResult[0].getDisplayName());
+ final ItemStack itemstack = this.stackResult[0];
+ this.stackResult[0] = null;
+ return itemstack;
+ }
+ return null;
+ }
+
+ /**
+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
+ * like when you close a workbench GUI.
+ */
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
+ if (this.stackResult[0] != null) {
+ final ItemStack itemstack = this.stackResult[0];
+ this.stackResult[0] = null;
+ return itemstack;
+ }
+ return null;
+ }
}
-
-
-//Default Behaviour
+// Default Behaviour
/*@Override
public ItemStack decrStackSize(int slot, int amount)
{
@@ -258,7 +232,7 @@ public ItemStack decrStackSize(int slot, int amount)
return stack;
}*/
-//Default Behaviour
+// Default Behaviour
/*@Override
public ItemStack getStackInSlotOnClosing(int slot)
{
@@ -266,4 +240,3 @@ public ItemStack getStackInSlotOnClosing(int slot)
setInventorySlotContents(slot, null);
return stack;
}*/
-
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java
index 6543f6e9ea..406f2fd703 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java
@@ -1,188 +1,160 @@
package gtPlusPlus.core.inventories;
+import gregtech.api.items.GT_MetaGenerated_Tool;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-
-public class InventoryWorkbenchTools implements IInventory{
-
- private final String name = "Inventory Tools";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 5;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryWorkbenchTools()
- {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.inventory[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 1;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- if (itemstack.getItem() instanceof GT_MetaGenerated_Tool){
- return true;
- }
- return false;
- }
-
-} \ No newline at end of file
+public class InventoryWorkbenchTools implements IInventory {
+
+ private final String name = "Inventory Tools";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 5;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryWorkbenchTools() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 1;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java
index 29bf306b08..facf5fee3a 100644
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java
+++ b/src/main/java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java
@@ -1,5 +1,8 @@
package gtPlusPlus.core.inventories;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gtPlusPlus.core.slots.SlotGtToolElectric;
+import ic2.api.item.IElectricItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
@@ -7,187 +10,156 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-
-import gtPlusPlus.core.slots.SlotGtToolElectric;
-import ic2.api.item.IElectricItem;
-
-public class InventoryWorkbenchToolsElectric implements IInventory{
-
- private final String name = "Inventory Tools";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 5;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
- private final Slot[] toolSlots = new SlotGtToolElectric[INV_SIZE]; //TODO
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryWorkbenchToolsElectric()
- {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.inventory[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 1;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- if ((itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof IElectricItem)){
- return true;
- }
- return false;
- }
-
-} \ No newline at end of file
+public class InventoryWorkbenchToolsElectric implements IInventory {
+
+ private final String name = "Inventory Tools";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 5;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ private final Slot[] toolSlots = new SlotGtToolElectric[INV_SIZE]; // TODO
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryWorkbenchToolsElectric() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 1;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ if ((itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof IElectricItem)) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/Inventory_DecayablesChest.java b/src/main/java/gtPlusPlus/core/inventories/Inventory_DecayablesChest.java
index 666f4aac53..03a547898d 100644
--- a/src/main/java/gtPlusPlus/core/inventories/Inventory_DecayablesChest.java
+++ b/src/main/java/gtPlusPlus/core/inventories/Inventory_DecayablesChest.java
@@ -6,171 +6,153 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class Inventory_DecayablesChest implements IInventory{
-
- private final String name = "DecayablesChest";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 15;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt){
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++){
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE)){
- //Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt){
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++){
- final ItemStack stack = this.inventory[i];
- if(stack != null){
- //Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class Inventory_DecayablesChest implements IInventory {
+
+ private final String name = "DecayablesChest";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 15;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ // Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ // Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/Inventory_EggBox.java b/src/main/java/gtPlusPlus/core/inventories/Inventory_EggBox.java
index 334afc3300..46e0ffd9b4 100644
--- a/src/main/java/gtPlusPlus/core/inventories/Inventory_EggBox.java
+++ b/src/main/java/gtPlusPlus/core/inventories/Inventory_EggBox.java
@@ -6,171 +6,153 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class Inventory_EggBox implements IInventory{
-
- private final String name = "EggBox";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 15;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt){
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++){
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE)){
- //Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt){
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++){
- final ItemStack stack = this.inventory[i];
- if(stack != null){
- //Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class Inventory_EggBox implements IInventory {
+
+ private final String name = "EggBox";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 15;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ // Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ // Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java b/src/main/java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java
index a47f250c39..58ca8eff3b 100644
--- a/src/main/java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java
+++ b/src/main/java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java
@@ -6,167 +6,150 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class Inventory_RoundRobinator implements IInventory{
-
- private final String name = "Round Robinator";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 4;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt){
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++){
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE)){
- //Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt){
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++){
- final ItemStack stack = this.inventory[i];
- if(stack != null){
- //Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return true;
- }
-
-} \ No newline at end of file
+public class Inventory_RoundRobinator implements IInventory {
+
+ private final String name = "Round Robinator";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 4;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ // Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ // Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/Inventory_SuperJukebox.java b/src/main/java/gtPlusPlus/core/inventories/Inventory_SuperJukebox.java
index 681c67a988..8bccfaed2d 100644
--- a/src/main/java/gtPlusPlus/core/inventories/Inventory_SuperJukebox.java
+++ b/src/main/java/gtPlusPlus/core/inventories/Inventory_SuperJukebox.java
@@ -6,167 +6,150 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class Inventory_SuperJukebox implements IInventory{
-
- private final String name = "Sir Mixalot";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 21;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt){
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++){
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE)){
- //Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt){
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++){
- final ItemStack stack = this.inventory[i];
- if(stack != null){
- //Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 1;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return true;
- }
-
-} \ No newline at end of file
+public class Inventory_SuperJukebox implements IInventory {
+
+ private final String name = "Sir Mixalot";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 21;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ // Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ // Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 1;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/Inventory_VolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/inventories/Inventory_VolumetricFlaskSetter.java
index e2dc91a413..b703e1bfaa 100644
--- a/src/main/java/gtPlusPlus/core/inventories/Inventory_VolumetricFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/inventories/Inventory_VolumetricFlaskSetter.java
@@ -7,167 +7,150 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class Inventory_VolumetricFlaskSetter implements IInventory{
-
- private final String name = "Volumetric Flask Setter";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 9;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt){
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++){
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE)){
- //Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt){
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++){
- final ItemStack stack = this.inventory[i];
- if(stack != null){
- //Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 16;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return VolumetricFlaskHelper.isVolumetricFlask(itemstack);
- }
-
-} \ No newline at end of file
+public class Inventory_VolumetricFlaskSetter implements IInventory {
+
+ private final String name = "Volumetric Flask Setter";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 9;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ // Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ // Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 16;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return VolumetricFlaskHelper.isVolumetricFlask(itemstack);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java b/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java
index 03350a3c18..e5cbf352a1 100644
--- a/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java
+++ b/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java
@@ -5,11 +5,12 @@ import gtPlusPlus.core.slots.SlotLunchBox;
import net.minecraft.item.ItemStack;
public class LunchBoxInventory extends CustomBoxInventory {
- public LunchBoxInventory(ItemStack stack) {
- super(stack, "Lunch Box", gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
- }
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
- return SlotLunchBox.isItemValid_STATIC(itemstack);
- }
+ public LunchBoxInventory(ItemStack stack) {
+ super(stack, "Lunch Box", gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
+ return SlotLunchBox.isItemValid_STATIC(itemstack);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java b/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java
index 56b1835113..8e0f8c4c54 100644
--- a/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java
+++ b/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java
@@ -5,11 +5,12 @@ import gtPlusPlus.core.slots.SlotMagicToolBag;
import net.minecraft.item.ItemStack;
public class MagicBagInventory extends CustomBoxInventory {
- public MagicBagInventory(ItemStack stack) {
- super(stack, "Mystic Bag", gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
- }
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
- return SlotMagicToolBag.isItemValid_STATIC(itemstack);
- }
+ public MagicBagInventory(ItemStack stack) {
+ super(stack, "Mystic Bag", gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
+ return SlotMagicToolBag.isItemValid_STATIC(itemstack);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java b/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java
index 30893aeb4b..48c5e9af47 100644
--- a/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java
+++ b/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java
@@ -6,11 +6,12 @@ import gtPlusPlus.core.slots.SlotToolBox;
import net.minecraft.item.ItemStack;
public class ToolBoxInventory extends CustomBoxInventory {
- public ToolBoxInventory(ItemStack stack) {
- super(stack, "Tool Box", UniversalToolBox.SLOTS);
- }
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
- return SlotToolBox.isItemValid_STATIC(itemstack);
- }
+ public ToolBoxInventory(ItemStack stack) {
+ super(stack, "Tool Box", UniversalToolBox.SLOTS);
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
+ return SlotToolBox.isItemValid_STATIC(itemstack);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java b/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java
index 825a9a8851..7ae022d967 100644
--- a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java
+++ b/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java
@@ -1,202 +1,175 @@
package gtPlusPlus.core.inventories.modulartable;
+import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
-
-public class InventoryModularMain implements IInventory{
-
- private final String name = "Inventory Grid";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 9;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryModularMain()
- {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.inventory[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- //Utils.LOG_INFO("getStackInSlot["+slot+"]");
- try {
- if (slot>= this.inventory.length){
- //Utils.LOG_INFO("Returning invalid slot item.");
- return null;
- }
- return this.inventory[slot];
- } catch (Throwable t){
- t.printStackTrace();
- return null;
- }
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- if (slot >= this.inventory.length){
- return;
- }
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack){
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return TileEntityModularityTable.isValidUpgrade(itemstack);
- }
-
-} \ No newline at end of file
+public class InventoryModularMain implements IInventory {
+
+ private final String name = "Inventory Grid";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 9;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryModularMain() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ // Utils.LOG_INFO("getStackInSlot["+slot+"]");
+ try {
+ if (slot >= this.inventory.length) {
+ // Utils.LOG_INFO("Returning invalid slot item.");
+ return null;
+ }
+ return this.inventory[slot];
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ if (slot >= this.inventory.length) {
+ return;
+ }
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return TileEntityModularityTable.isValidUpgrade(itemstack);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java b/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java
index d3c59ee2a4..ebbf7f8d80 100644
--- a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java
+++ b/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java
@@ -1,192 +1,187 @@
package gtPlusPlus.core.inventories.modulartable;
+import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
-
public class InventoryModularOutput implements IInventory {
- private final String name = "Inventory Output";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 3;
- private int mRecpeTime = -1;
-
- /**
- * Inventory's size must be same as number of slots you add to the Container
- * class
- */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack
- * - the ItemStack to which this inventory belongs
- */
- public InventoryModularOutput() {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt) {
- if (this.mRecpeTime > -1) {
- nbt.setInteger("mRecipeTime", this.mRecpeTime);
- }
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for (int i = 0; i < list.tagCount(); i++) {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if ((slot >= 0) && (slot < INV_SIZE)) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt) {
- final NBTTagList list = new NBTTagList();
- if (nbt.hasKey("mRecipeTime")) {
- this.mRecpeTime = nbt.getInteger("mRecipeTime");
- }
- for (int i = 0; i < INV_SIZE; i++) {
- final ItemStack stack = this.inventory[i];
- if (stack != null) {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- public int setRecipeTime(int mTime) {
- return (this.mRecpeTime = mTime);
- }
-
- public int getRecipeTime() {
- return this.mRecpeTime;
- }
-
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory() {
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- ItemStack stack = this.getStackInSlot(slot);
- if (stack != null) {
- if (stack.stackSize > amount) {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- } else {
- // this method also calls markDirty, so we don't need to call it
- // again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName() {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it
- * is called (or should be called!) anytime the inventory changes. Perfect.
- * Much better than using onUpdate in an Item, as this will also let you
- * change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty() {
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null) {
- // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+"
- // x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {
- }
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {
- }
-
- /**
- * This method doesn't seem to do what it claims to do, as items can still
- * be left-clicked and placed in the inventory even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- if (slot == 0){
- return TileEntityModularityTable.isValidUpgrade(itemstack);
- }
- return TileEntityModularityTable.isValidModularPiece(itemstack);
- }
-
-} \ No newline at end of file
+ private final String name = "Inventory Output";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 3;
+
+ private int mRecpeTime = -1;
+
+ /**
+ * Inventory's size must be same as number of slots you add to the Container
+ * class
+ */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack
+ * - the ItemStack to which this inventory belongs
+ */
+ public InventoryModularOutput() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ if (this.mRecpeTime > -1) {
+ nbt.setInteger("mRecipeTime", this.mRecpeTime);
+ }
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ if (nbt.hasKey("mRecipeTime")) {
+ this.mRecpeTime = nbt.getInteger("mRecipeTime");
+ }
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ public int setRecipeTime(int mTime) {
+ return (this.mRecpeTime = mTime);
+ }
+
+ public int getRecipeTime() {
+ return this.mRecpeTime;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it
+ // again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it
+ * is called (or should be called!) anytime the inventory changes. Perfect.
+ * Much better than using onUpdate in an Item, as this will also let you
+ * change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+"
+ // x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as items can still
+ * be left-clicked and placed in the inventory even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ if (slot == 0) {
+ return TileEntityModularityTable.isValidUpgrade(itemstack);
+ }
+ return TileEntityModularityTable.isValidModularPiece(itemstack);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java b/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java
index 2d91869027..2855800e12 100644
--- a/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java
+++ b/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectMain.java
@@ -6,196 +6,169 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryProjectMain implements IInventory{
-
- private final String name = "Inventory Grid";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 9;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryProjectMain()
- {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.inventory[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- //Utils.LOG_INFO("getStackInSlot["+slot+"]");
- try {
- if (slot>= this.inventory.length){
- //Utils.LOG_INFO("Returning invalid slot item.");
- return null;
- }
- return this.inventory[slot];
- } catch (Throwable t){
- t.printStackTrace();
- return null;
- }
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- if (slot >= this.inventory.length){
- return;
- }
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class InventoryProjectMain implements IInventory {
+
+ private final String name = "Inventory Grid";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 9;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryProjectMain() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ // Utils.LOG_INFO("getStackInSlot["+slot+"]");
+ try {
+ if (slot >= this.inventory.length) {
+ // Utils.LOG_INFO("Returning invalid slot item.");
+ return null;
+ }
+ return this.inventory[slot];
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ if (slot >= this.inventory.length) {
+ return;
+ }
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java b/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java
index 41ddd06ef1..6547e4524c 100644
--- a/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java
+++ b/src/main/java/gtPlusPlus/core/inventories/projecttable/InventoryProjectOutput.java
@@ -6,183 +6,156 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryProjectOutput implements IInventory{
-
- private final String name = "Inventory Output";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 2;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryProjectOutput()
- {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.inventory[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class InventoryProjectOutput implements IInventory {
+
+ private final String name = "Inventory Output";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 2;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryProjectOutput() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java b/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java
index aa7e8b1866..a5ce516f09 100644
--- a/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java
+++ b/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeMain.java
@@ -6,196 +6,169 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryTradeMain implements IInventory{
-
- private final String name = "Inventory Grid";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 9;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryTradeMain()
- {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.inventory[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- //Utils.LOG_INFO("getStackInSlot["+slot+"]");
- try {
- if (slot>= this.inventory.length){
- //Utils.LOG_INFO("Returning invalid slot item.");
- return null;
- }
- return this.inventory[slot];
- } catch (Throwable t){
- t.printStackTrace();
- return null;
- }
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- if (slot >= this.inventory.length){
- return;
- }
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class InventoryTradeMain implements IInventory {
+
+ private final String name = "Inventory Grid";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 9;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryTradeMain() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ // Utils.LOG_INFO("getStackInSlot["+slot+"]");
+ try {
+ if (slot >= this.inventory.length) {
+ // Utils.LOG_INFO("Returning invalid slot item.");
+ return null;
+ }
+ return this.inventory[slot];
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ if (slot >= this.inventory.length) {
+ return;
+ }
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java b/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java
index fb4329e11a..db22c99503 100644
--- a/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java
+++ b/src/main/java/gtPlusPlus/core/inventories/tradetable/InventoryTradeOutput.java
@@ -6,183 +6,156 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryTradeOutput implements IInventory{
-
- private final String name = "Inventory Output";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 2;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryTradeOutput()
- {
-
- }
-
- public void readFromNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt)
- {
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = this.inventory[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory()
- {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory(){
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot)
- {
- return this.inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount)
- {
- ItemStack stack = this.getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- else
- {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot)
- {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack)
- {
- this.inventory[slot] = stack;
-
- if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
- {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return this.name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < this.getSizeInventory(); ++i)
- {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null){
- //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack)
- {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
-} \ No newline at end of file
+public class InventoryTradeOutput implements IInventory {
+
+ private final String name = "Inventory Output";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 2;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public InventoryTradeOutput() {}
+
+ public void readFromNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt) {
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = this.inventory[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory() {
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount) {
+ ItemStack stack = this.getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ } else {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null) {
+ // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java
index 6854a045a6..d120252bcb 100644
--- a/src/main/java/gtPlusPlus/core/item/ModItems.java
+++ b/src/main/java/gtPlusPlus/core/item/ModItems.java
@@ -1,4 +1,5 @@
package gtPlusPlus.core.item;
+
import static gtPlusPlus.core.creative.AddToCreativeTab.*;
import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT;
@@ -61,1209 +62,1490 @@ import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fluids.*;
-public final class ModItems {
-
-
- public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18);
-
- public static Item ZZZ_Empty;
- public static Item AAA_Broken;
-
-
- public static Item itemAlkalusDisk;
- public static Item itemDebugShapeSpawner;
- public static ItemCustomSpawnEgg itemCustomSpawnEgg;
-
- //EnderIO
- public static Item itemPlateSoularium;
- public static Item itemPlateRedstoneAlloy;
- public static Item itemPlateElectricalSteel;
- public static Item itemPlatePulsatingIron;
- public static Item itemPlateEnergeticAlloy;
- public static Item itemPlateVibrantAlloy;
- public static Item itemPlateConductiveIron;
- public static Item itemPlateDarkSteel;
- public static Item itemDustSoularium;
- public static Item itemDustRedstoneAlloy;
- public static Item itemDustElectricalSteel;
- public static Item itemDustPulsatingIron;
- public static Item itemDustEnergeticAlloy;
- public static Item itemDustVibrantAlloy;
- public static Item itemDustConductiveIron;
- //Big Reactors
- public static Item itemPlateBlutonium;
- public static Item itemPlateCyanite;
- public static Item itemPlateLudicrite;
- //Thaumcraft
- public static Item itemPlateVoidMetal;
- //Pneumaticraft
- public static Item itemPlateCompressedIron;
- //SimplyJetpacks
- public static Item itemPlateEnrichedSoularium;
- //rfTools
- public static Item itemPlateDimensionShard;
- //Staballoy
- public static Item itemStaballoyPickaxe;
- public static Item itemStaballoyAxe;
- //Tools
- public static Item itemSandstoneHammer;
- //Machine Related
- public static Item itemBufferCore0;
- //Material related
- public static Item itemStickyRubber;
- public static Item itemIngotBatteryAlloy;
- public static Item itemPlateBatteryAlloy;
- public static Item itemHeliumBlob;
- public static Item itemHydrogenBlob;
- public static Item itemPLACEHOLDER_Circuit;
-
- public static Item FuelRod_Empty;
- public static Item FuelRod_Thorium;
- public static Item FuelRod_Uranium;
- public static Item FuelRod_Plutonium;
-
- public static Item itemBedLocator_Base;
- public static Item itemBaseItemWithCharge;
-
- public static Item itemIngotRaisinBread;
- public static Item itemHotIngotRaisinBread;
-
- public static ItemFood itemFoodRaisinToast;
- public static BaseItemHotFood itemHotFoodRaisinToast;
- public static BaseItemFood itemFoodCurriedSausages;
- public static BaseItemHotFood itemHotFoodCurriedSausages;
-
- public static Item RfEuBattery;
- public static Item itemPersonalCloakingDevice;
- public static Item itemPersonalCloakingDeviceCharged;
- public static Item itemPersonalHealingDevice;
- public static Item itemPersonalFireProofDevice;
- public static Item itemSlowBuildingRing;
-
- public static MultiPickaxeBase MP_GTMATERIAL;
- public static MultiSpadeBase MS_GTMATERIAL;
-
- public static ItemStack FluidCell;
-
- public static BaseItemBackpack backpack_Red;
- public static BaseItemBackpack backpack_Green;
- public static BaseItemBackpack backpack_Blue;
- public static BaseItemBackpack backpack_Yellow;
- public static BaseItemBackpack backpack_Purple;
- public static BaseItemBackpack backpack_Cyan;
- public static BaseItemBackpack backpack_Maroon;
- public static BaseItemBackpack backpack_Olive;
- public static BaseItemBackpack backpack_DarkGreen;
- public static BaseItemBackpack backpack_DarkPurple;
- public static BaseItemBackpack backpack_Teal;
- public static BaseItemBackpack backpack_Navy;
- public static BaseItemBackpack backpack_Silver;
- public static BaseItemBackpack backpack_Gray;
- public static BaseItemBackpack backpack_Black;
- public static BaseItemBackpack backpack_White;
-
- public static ItemBlueprint itemBlueprintBase;
-
- public static Item dustLithiumCarbonate;
- public static Item dustLithiumHydroxide;
- public static Item dustLithiumPeroxide;
- public static Item dustLithiumFluoride;
-
- public static Item dustUranium232;
- public static Item dustUraniumTetraFluoride;
- public static Item dustUraniumHexaFluoride;
-
- public static Item dustBerylliumFluoride;
-
- public static Item dustQuicklime;
- public static Item dustCalciumHydroxide;
- public static Item dustCalciumCarbonate;
- public static Item dustLi2CO3CaOH2;
- public static Item dustLi2BeF4;
-
- public static Item dustTumbagaMix;
-
- public static Item dustAer;
- public static Item dustIgnis;
- public static Item dustTerra;
- public static Item dustAqua;
-
- public static Item cellHydrogenChlorideMix;
-
- public static BaseEuItem metaItem2;
-
- public static Item shardAer;
- public static Item shardIgnis;
- public static Item shardTerra;
- public static Item shardAqua;
-
- //Tc Compat for energy crystal recipes
- public static Item shardDull;
-
- //Lighter
- public static Item itemBasicFireMaker;
-
- //Zirconium
- public static Item itemZirconiumChlorideCinterPellet;
- public static Item dustZrCl4;
- public static Item dustCookedZrCl4;
- public static Item dustZrF4;
-
- public static Item dustNaBF4NaF;
- public static Item dustLiFBeF2ZrF4UF4;
- public static Item dustLiFBeF2ZrF4U235;
- public static Item dustLiFBeF2ThF4UF4;
-
- public static Item dustCalciumSulfate;
-
- public static Item dustFertUN18;
- public static Item dustFertUN32;
-
- //public static Fluid fluidFLiBeSalt;
- //public static Fluid fluidFLiBeSaltBurnt;
-
- public static Fluid fluidLftrCore1;
- public static Fluid fluidLftrCore2;
- public static Fluid fluidLftrCore3;
- public static Fluid fluidLftrCore4;
- public static Fluid fluidLftrBlanket1;
- public static Fluid fluidLftrBlanket2;
- public static Fluid fluidLftrBlanket3;
- public static Fluid fluidNuclearWaste;
-
-
- //Possibly missing base items that GT may be missing.
-
- public static Item itemSmallWroughtIronGear;
- public static Item itemPlateRawMeat;
- public static Item itemPlateClay;
- public static Item itemPlateLithium;
- public static Item itemPlateEuropium;
- public static Item itemPlateVanadium;
- public static Item itemDoublePlateClay;
- public static Item itemDoublePlateEuropium;
- public static Item itemFoilUranium235;
- public static Item itemDustIndium;
- public static BlockBaseModular blockRawMeat;
-
- public static Item itemBoilerChassis;
- public static Item itemDehydratorCoilWire;
- public static Item itemDehydratorCoil;
-
- public static Item itemLavaFilter;
- public static Item itemAirFilter;
- public static Item itemCoalCoke;
- public static Item itemCactusCharcoal;
- public static Item itemSugarCharcoal;
- public static Item itemCactusCoke;
- public static Item itemSugarCoke;
-
- public static Item itemCircuitLFTR;
- public static Item itemBasicTurbine;
-
- public static Item itemDebugAreaClear;
-
- public static Item itemGemShards;
- public static Item itemHalfCompleteCasings;
-
- public static Item itemSulfuricPotion;
- public static Item itemHydrofluoricPotion;
-
- public static Item itemModularBauble;
- public static Item itemCustomBook;
-
- public static Item itemGrindleTablet;
- public static Item itemRope;
- public static Item itemFiber;
- public static Item itemDragonJar;
-
- //Unstable Elements & Related Content
- public static Item dustNeptunium238;
- public static Item dustDecayedRadium226;
- public static Item dustRadium226;
- public static Item dustProtactinium233;
-
- public static ItemGiantEgg itemBigEgg;
-
- public static GregtechPump toolGregtechPump;
-
- public static ItemGenericToken itemGenericToken;
+public final class ModItems {
- public static Item itemControlCore;
+ public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18);
+
+ public static Item ZZZ_Empty;
+ public static Item AAA_Broken;
+
+ public static Item itemAlkalusDisk;
+ public static Item itemDebugShapeSpawner;
+ public static ItemCustomSpawnEgg itemCustomSpawnEgg;
+
+ // EnderIO
+ public static Item itemPlateSoularium;
+ public static Item itemPlateRedstoneAlloy;
+ public static Item itemPlateElectricalSteel;
+ public static Item itemPlatePulsatingIron;
+ public static Item itemPlateEnergeticAlloy;
+ public static Item itemPlateVibrantAlloy;
+ public static Item itemPlateConductiveIron;
+ public static Item itemPlateDarkSteel;
+ public static Item itemDustSoularium;
+ public static Item itemDustRedstoneAlloy;
+ public static Item itemDustElectricalSteel;
+ public static Item itemDustPulsatingIron;
+ public static Item itemDustEnergeticAlloy;
+ public static Item itemDustVibrantAlloy;
+ public static Item itemDustConductiveIron;
+ // Big Reactors
+ public static Item itemPlateBlutonium;
+ public static Item itemPlateCyanite;
+ public static Item itemPlateLudicrite;
+ // Thaumcraft
+ public static Item itemPlateVoidMetal;
+ // Pneumaticraft
+ public static Item itemPlateCompressedIron;
+ // SimplyJetpacks
+ public static Item itemPlateEnrichedSoularium;
+ // rfTools
+ public static Item itemPlateDimensionShard;
+ // Staballoy
+ public static Item itemStaballoyPickaxe;
+ public static Item itemStaballoyAxe;
+ // Tools
+ public static Item itemSandstoneHammer;
+ // Machine Related
+ public static Item itemBufferCore0;
+ // Material related
+ public static Item itemStickyRubber;
+ public static Item itemIngotBatteryAlloy;
+ public static Item itemPlateBatteryAlloy;
+ public static Item itemHeliumBlob;
+ public static Item itemHydrogenBlob;
+ public static Item itemPLACEHOLDER_Circuit;
+
+ public static Item FuelRod_Empty;
+ public static Item FuelRod_Thorium;
+ public static Item FuelRod_Uranium;
+ public static Item FuelRod_Plutonium;
+
+ public static Item itemBedLocator_Base;
+ public static Item itemBaseItemWithCharge;
+
+ public static Item itemIngotRaisinBread;
+ public static Item itemHotIngotRaisinBread;
+
+ public static ItemFood itemFoodRaisinToast;
+ public static BaseItemHotFood itemHotFoodRaisinToast;
+ public static BaseItemFood itemFoodCurriedSausages;
+ public static BaseItemHotFood itemHotFoodCurriedSausages;
+
+ public static Item RfEuBattery;
+ public static Item itemPersonalCloakingDevice;
+ public static Item itemPersonalCloakingDeviceCharged;
+ public static Item itemPersonalHealingDevice;
+ public static Item itemPersonalFireProofDevice;
+ public static Item itemSlowBuildingRing;
+
+ public static MultiPickaxeBase MP_GTMATERIAL;
+ public static MultiSpadeBase MS_GTMATERIAL;
+
+ public static ItemStack FluidCell;
+
+ public static BaseItemBackpack backpack_Red;
+ public static BaseItemBackpack backpack_Green;
+ public static BaseItemBackpack backpack_Blue;
+ public static BaseItemBackpack backpack_Yellow;
+ public static BaseItemBackpack backpack_Purple;
+ public static BaseItemBackpack backpack_Cyan;
+ public static BaseItemBackpack backpack_Maroon;
+ public static BaseItemBackpack backpack_Olive;
+ public static BaseItemBackpack backpack_DarkGreen;
+ public static BaseItemBackpack backpack_DarkPurple;
+ public static BaseItemBackpack backpack_Teal;
+ public static BaseItemBackpack backpack_Navy;
+ public static BaseItemBackpack backpack_Silver;
+ public static BaseItemBackpack backpack_Gray;
+ public static BaseItemBackpack backpack_Black;
+ public static BaseItemBackpack backpack_White;
+
+ public static ItemBlueprint itemBlueprintBase;
+
+ public static Item dustLithiumCarbonate;
+ public static Item dustLithiumHydroxide;
+ public static Item dustLithiumPeroxide;
+ public static Item dustLithiumFluoride;
+
+ public static Item dustUranium232;
+ public static Item dustUraniumTetraFluoride;
+ public static Item dustUraniumHexaFluoride;
+
+ public static Item dustBerylliumFluoride;
+
+ public static Item dustQuicklime;
+ public static Item dustCalciumHydroxide;
+ public static Item dustCalciumCarbonate;
+ public static Item dustLi2CO3CaOH2;
+ public static Item dustLi2BeF4;
+
+ public static Item dustTumbagaMix;
+
+ public static Item dustAer;
+ public static Item dustIgnis;
+ public static Item dustTerra;
+ public static Item dustAqua;
+
+ public static Item cellHydrogenChlorideMix;
+
+ public static BaseEuItem metaItem2;
+
+ public static Item shardAer;
+ public static Item shardIgnis;
+ public static Item shardTerra;
+ public static Item shardAqua;
+
+ // Tc Compat for energy crystal recipes
+ public static Item shardDull;
+
+ // Lighter
+ public static Item itemBasicFireMaker;
+
+ // Zirconium
+ public static Item itemZirconiumChlorideCinterPellet;
+ public static Item dustZrCl4;
+ public static Item dustCookedZrCl4;
+ public static Item dustZrF4;
+
+ public static Item dustNaBF4NaF;
+ public static Item dustLiFBeF2ZrF4UF4;
+ public static Item dustLiFBeF2ZrF4U235;
+ public static Item dustLiFBeF2ThF4UF4;
+
+ public static Item dustCalciumSulfate;
+
+ public static Item dustFertUN18;
+ public static Item dustFertUN32;
+
+ // public static Fluid fluidFLiBeSalt;
+ // public static Fluid fluidFLiBeSaltBurnt;
+
+ public static Fluid fluidLftrCore1;
+ public static Fluid fluidLftrCore2;
+ public static Fluid fluidLftrCore3;
+ public static Fluid fluidLftrCore4;
+ public static Fluid fluidLftrBlanket1;
+ public static Fluid fluidLftrBlanket2;
+ public static Fluid fluidLftrBlanket3;
+ public static Fluid fluidNuclearWaste;
+
+ // Possibly missing base items that GT may be missing.
+
+ public static Item itemSmallWroughtIronGear;
+ public static Item itemPlateRawMeat;
+ public static Item itemPlateClay;
+ public static Item itemPlateLithium;
+ public static Item itemPlateEuropium;
+ public static Item itemPlateVanadium;
+ public static Item itemDoublePlateClay;
+ public static Item itemDoublePlateEuropium;
+ public static Item itemFoilUranium235;
+ public static Item itemDustIndium;
+ public static BlockBaseModular blockRawMeat;
- public static Item itemSunnariumBit;
+ public static Item itemBoilerChassis;
+ public static Item itemDehydratorCoilWire;
+ public static Item itemDehydratorCoil;
- public static ItemStack itemHotTitaniumIngot;
+ public static Item itemLavaFilter;
+ public static Item itemAirFilter;
- public static Fluid fluidZrF4;
- public static Fluid fluidFertBasic;
- public static Fluid fluidFertUN32;
- public static Fluid fluidFertUN18;
+ public static Item itemCoalCoke;
+ public static Item itemCactusCharcoal;
+ public static Item itemSugarCharcoal;
+ public static Item itemCactusCoke;
+ public static Item itemSugarCoke;
- public static Item boxTools;
- public static Item boxFood;
- public static Item boxMagic;
+ public static Item itemCircuitLFTR;
+ public static Item itemBasicTurbine;
- public static DustDecayable dustMolybdenum99;
- public static DustDecayable dustTechnetium99;
- public static DustDecayable dustTechnetium99M;
+ public static Item itemDebugAreaClear;
- public static IonParticles itemIonParticleBase;
- public static StandardBaseParticles itemStandarParticleBase;
-
- public static BatteryPackBaseBauble itemChargePack_Low_1;
- public static BatteryPackBaseBauble itemChargePack_Low_2;
- public static BatteryPackBaseBauble itemChargePack_Low_3;
- public static BatteryPackBaseBauble itemChargePack_Low_4;
- public static BatteryPackBaseBauble itemChargePack_Low_5;
- public static BatteryPackBaseBauble itemChargePack_High_1;
- public static BatteryPackBaseBauble itemChargePack_High_2;
- public static BatteryPackBaseBauble itemChargePack_High_3;
- public static BatteryPackBaseBauble itemChargePack_High_4;
-
- public static DebugScanner itemDebugScanner;
-
- public static ItemDummyResearch itemDummyResearch;
-
- public static CoreItem itemBombCasing;
- public static CoreItem itemBombUnf;
- public static CoreItem itemDetCable;
- public static ItemThrowableBomb itemBomb;
+ public static Item itemGemShards;
+ public static Item itemHalfCompleteCasings;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Zombie;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Skeleton;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Spider;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Creeper;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Enderman;
+ public static Item itemSulfuricPotion;
+ public static Item itemHydrofluoricPotion;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Nether;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Infernal;
+ public static Item itemModularBauble;
+ public static Item itemCustomBook;
- public static CoreItem itemExquisiteIndustrialDiamond;
+ public static Item itemGrindleTablet;
+ public static Item itemRope;
+ public static Item itemFiber;
+ public static Item itemDragonJar;
+
+ // Unstable Elements & Related Content
+ public static Item dustNeptunium238;
+ public static Item dustDecayedRadium226;
+ public static Item dustRadium226;
+ public static Item dustProtactinium233;
- public static BaseItemMetaFood itemMetaFood;
+ public static ItemGiantEgg itemBigEgg;
- public static ItemMagicFeather itemMagicFeather;
+ public static GregtechPump toolGregtechPump;
- static {
- Logger.INFO("Items!");
- //Default item used when recipes fail, handy for debugging. Let's make sure they exist when this class is called upon.
- AAA_Broken = new BaseItemIngot_OLD("AAA_Broken", "Errors - Tell Alkalus", Utils.rgbtoHexValue(128, 128, 128), 0);
- ZZZ_Empty = new ItemEmpty();
- }
-
- public static final void init(){
-
- itemDebugScanner = new DebugScanner();
- itemMagicFeather = new ItemMagicFeather();
-
- itemAlkalusDisk = new BaseItemDamageable("itemAlkalusDisk", AddToCreativeTab.tabMisc, 1, 0, "Unknown Use", EnumRarity.rare, EnumChatFormatting.AQUA, false, null);
- itemBigEgg = new ItemGiantEgg();
- itemGenericToken = new ItemGenericToken();
- itemDummyResearch = new ItemDummyResearch();
- itemCustomSpawnEgg = new ItemCustomSpawnEgg();
-
- //Debug Loading
- if (CORE_Preloader.DEBUG_MODE){
- DEBUG_INIT.registerItems();
- }
-
- itemDebugAreaClear = new ItemAreaClear();
-
- //Register meta item, because we need them for everything.
- MetaGeneratedGregtechItems.INSTANCE.generateMetaItems();
-
- //Some Simple forms of materials
- itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber").setCreativeTab(tabMachines).setTextureName(CORE.MODID + ":itemStickyRubber");
- GameRegistry.registerItem(itemStickyRubber, "itemStickyRubber");
- GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemStickyRubber", 1));
-
- //Register Hydrogen Blobs first, so we can replace old helium blobs.
- itemHydrogenBlob = new CoreItem("itemHydrogenBlob", "Mysterious Hydrogen Blob", tabMisc).setTextureName(CORE.MODID + ":itemHeliumBlob");
- //Register Old Helium Blob, this will be replaced when held by a player.
- itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc, ItemUtils.getSimpleStack(itemHydrogenBlob)).setTextureName(CORE.MODID + ":itemHydrogenBlob");
-
- //Register this neato device, for making some fires.
- itemBasicFireMaker = new ItemBasicFirestarter();
-
- //Register Rope
- itemFiber = new CoreItem("itemFiber", "Plant Fiber", tabMisc);
- itemRope = new CoreItem("itemRope", "Rope", tabMisc);
-
- //Load Wearable Items
- WearableLoader.run();
-
- //Make some backpacks
- //Primary colours
- backpack_Red = new BaseItemBackpack("backpackRed", Utils.rgbtoHexValue(200, 0, 0));
- backpack_Green = new BaseItemBackpack("backpackGreen", Utils.rgbtoHexValue(0, 200, 0));
- backpack_Blue = new BaseItemBackpack("backpackBlue", Utils.rgbtoHexValue(0, 0, 200));
- //Secondary Colours
- backpack_Yellow = new BaseItemBackpack("backpackYellow", Utils.rgbtoHexValue(200, 200, 0));
- backpack_Purple = new BaseItemBackpack("backpackPurple", Utils.rgbtoHexValue(200, 0, 200));
- backpack_Cyan = new BaseItemBackpack("backpackCyan", Utils.rgbtoHexValue(0, 200, 200));
- //Tertiary Colours
- backpack_Maroon = new BaseItemBackpack("backpackMaroon", Utils.rgbtoHexValue(128, 0, 0));
- backpack_Olive = new BaseItemBackpack("backpackOlive", Utils.rgbtoHexValue(128, 128, 0));
- backpack_DarkGreen = new BaseItemBackpack("backpackDarkGreen", Utils.rgbtoHexValue(0, 128, 0));
- backpack_DarkPurple = new BaseItemBackpack("backpackDarkPurple", Utils.rgbtoHexValue(128, 0, 128));
- backpack_Teal = new BaseItemBackpack("backpackTeal", Utils.rgbtoHexValue(0, 128, 128));
- backpack_Navy = new BaseItemBackpack("backpackNavy", Utils.rgbtoHexValue(0, 0, 128));
- //Shades
- backpack_Silver = new BaseItemBackpack("backpackSilver", Utils.rgbtoHexValue(192, 192, 192));
- backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128));
- backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20));
- backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240));
-
-
- //Load Custom Box/bags
- boxTools = new UniversalToolBox("Tool Box");
- boxFood = new AutoLunchBox("Eatotron-9000");
- boxMagic = new MagicToolBag("Mystic Bag");
-
- itemBlueprintBase = new ItemBlueprint("itemBlueprint");
-
- itemGemShards = new ItemGemShards("itemGemShards", "Gem Shards", AddToCreativeTab.tabMisc, 32, 0, "They glitter in the light", EnumRarity.rare, EnumChatFormatting.GRAY, false, Utils.rgbtoHexValue(182, 114, 18)).setTextureName(CORE.MODID + ":itemHeliumBlob");
- itemHalfCompleteCasings = new ItemHalfCompleteCasings("itemHalfCompleteCasings", AddToCreativeTab.tabMisc, 32, 0, "This isn't quite finished yet.", EnumRarity.common, EnumChatFormatting.GRAY, false, Utils.rgbtoHexValue(255, 255, 255)).setTextureName("gregtech" + ":" + "gt.metaitem.01/" + "761");
- itemSulfuricPotion = new ItemSulfuricAcidPotion("itemSulfuricPotion", "Throwable Vial of Sulfuric Acid", "Burn your foes alive!").setTextureName(CORE.MODID + ":itemSulfuricAcidPotion");
- itemHydrofluoricPotion = new ItemHydrofluoricAcidPotion("itemHydrofluoricPotion", "Throwable Vial of Hydrofluoric Acid", "They won't see this coming, nor anything after!").setTextureName(CORE.MODID + ":itemPotion");
- //Start meta Item Generation
- ItemsFoods.load();
-
-
- try{
-
- registerCustomMaterialComponents();
-
- //Elements generate first so they can be used in compounds.
- //Missing Elements
- MaterialGenerator.generate(ELEMENT.getInstance().SELENIUM); //LFTR byproduct
- MaterialGenerator.generate(ELEMENT.getInstance().BROMINE);
- MaterialGenerator.generate(ELEMENT.getInstance().KRYPTON); //LFTR byproduct
- MaterialGenerator.generate(ELEMENT.getInstance().STRONTIUM);
- MaterialGenerator.generate(ELEMENT.getInstance().ZIRCONIUM);
- MaterialGenerator.generate(ELEMENT.getInstance().RUTHENIUM);
- MaterialGenerator.generate(ELEMENT.getInstance().IODINE); //LFTR byproduct
- MaterialGenerator.generate(ELEMENT.getInstance().HAFNIUM);
- MaterialGenerator.generate(ELEMENT.getInstance().DYSPROSIUM);
- MaterialGenerator.generate(ELEMENT.getInstance().ERBIUM);
- MaterialGenerator.generate(ELEMENT.getInstance().PRASEODYMIUM);
- MaterialGenerator.generate(ELEMENT.getInstance().TELLURIUM); //LFTR byproduct
- MaterialGenerator.generate(ELEMENT.getInstance().RHODIUM);
- MaterialGenerator.generate(ELEMENT.getInstance().RHENIUM);
- MaterialGenerator.generate(ELEMENT.getInstance().THALLIUM);
-
- //RADIOACTIVE ELEMENTS
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().TECHNETIUM, false); //LFTR byproduct
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().POLONIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().ASTATINE, false);
- //MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().RADON, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().FRANCIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().RADIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PROMETHIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().ACTINIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PROTACTINIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().NEPTUNIUM, false); //LFTR byproduct
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().CURIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().BERKELIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().CALIFORNIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().EINSTEINIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().FERMIUM, false);
-
-
- //Nuclear Isotopes
-
- //Lithium-7 is used as a part of the molten lithium fluoride in molten salt reactors: liquid-fluoride nuclear reactors.
- //The large neutron-absorption cross-section of lithium-6 (about 940 barns[5]) as compared with the very small
- //neutron cross-section of lithium-7 (about 45 millibarns) makes high separation of lithium-7 from natural lithium a
- //strong requirement for the possible use in lithium fluoride reactors.
- MaterialGenerator.generate(ELEMENT.getInstance().LITHIUM7, false);
- //Thorium-232 is the most stable isotope of Thorium, purified for nuclear fuel use in this case.
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().THORIUM232);
- //Production of 233U (through the neutron irradiation of 232Th) invariably produces small amounts of 232U as an impurity
- //because of parasitic (n,2n) reactions on uranium-233 itself, or on protactinium-233, or on thorium-232:
- MaterialGenerator.generate(ELEMENT.getInstance().URANIUM232);
- //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle.
- MaterialGenerator.generate(ELEMENT.getInstance().URANIUM233);
- //Plutonium-238 is a very powerful alpha emitter. This makes the plutonium-238 isotope suitable for usage in radioisotope thermoelectric generators (RTGs)
- //and radioisotope heater units - one gram of plutonium-238 generates approximately 0.5 W of thermal power.
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PLUTONIUM238, false);
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustPlutonium239", 1) == null || Utils.getGregtechVersionAsInt() < 50931) {
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PLUTONIUM239, false);
- }
-
- //RTG Fuel Materials
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().STRONTIUM90, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().POLONIUM210, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().AMERICIUM241, false);
-
- if (!CORE.GTNH) {
- MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.getInstance().TRINIUM);
- }
-
- //Custom Materials that will have standalone refinery processes
- MaterialGenerator.generate(ELEMENT.STANDALONE.ADVANCED_NITINOL, false);
- MaterialGenerator.generate(ELEMENT.STANDALONE.ASTRAL_TITANIUM);
- MaterialGenerator.generate(ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
- MaterialGenerator.generate(ELEMENT.STANDALONE.HYPOGEN);
- MaterialGenerator.generate(ELEMENT.STANDALONE.CHRONOMATIC_GLASS);
- MaterialGenerator.generate(ELEMENT.STANDALONE.FORCE);
-
- //Custom Materials that are from Runescape
- MaterialGenerator.generate(ELEMENT.STANDALONE.BLACK_METAL);
- MaterialGenerator.generate(ELEMENT.STANDALONE.WHITE_METAL);
- MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.STANDALONE.GRANITE);
- MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.STANDALONE.RUNITE);
- MaterialGenerator.generate(ELEMENT.STANDALONE.DRAGON_METAL, false);
-
- MISC_MATERIALS.run();
-
-
- //Carbides - Tungsten Carbide exists in .09 so don't generate it. - Should still come before alloys though
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- MaterialGenerator.generate(ALLOY.TUNGSTEN_CARBIDE);
- }
- MaterialGenerator.generate(ALLOY.SILICON_CARBIDE);
- MaterialGenerator.generate(ALLOY.ZIRCONIUM_CARBIDE);
- MaterialGenerator.generate(ALLOY.TANTALUM_CARBIDE);
- MaterialGenerator.generate(ALLOY.NIOBIUM_CARBIDE);
- MaterialGenerator.generate(ALLOY.TUNGSTEN_TITANIUM_CARBIDE);
-
- //LFTR Fuel components
- //MaterialGenerator.generate(MISC_MATERIALS.HYDROXIDE); //LFTR fuel component
- //MaterialGenerator.generate(MISC_MATERIALS.AMMONIA); //LFTR fuel component
- //MaterialGenerator.generate(MISC_MATERIALS.AMMONIUM); //LFTR fuel component
- MaterialGenerator.generateNuclearDusts(FLUORIDES.AMMONIUM_BIFLUORIDE); //LFTR fuel component
- MaterialGenerator.generateNuclearDusts(FLUORIDES.BERYLLIUM_HYDROXIDE); //LFTR fuel component
- MaterialGenerator.generateNuclearDusts(FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE); //LFTR fuel component
-
- //Generate Fluorides
- MaterialGenerator.generateNuclearDusts(FLUORIDES.BERYLLIUM_FLUORIDE);
- MaterialGenerator.generateNuclearDusts(FLUORIDES.LITHIUM_FLUORIDE);
- MaterialGenerator.generateNuclearDusts(FLUORIDES.THORIUM_TETRAFLUORIDE);
- MaterialGenerator.generateNuclearDusts(FLUORIDES.THORIUM_HEXAFLUORIDE);
- MaterialGenerator.generateNuclearDusts(FLUORIDES.URANIUM_TETRAFLUORIDE, false);
- MaterialGenerator.generateNuclearDusts(FLUORIDES.URANIUM_HEXAFLUORIDE, false);
- MaterialGenerator.generateNuclearDusts(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE);
- //LFTR Fluoride outputs
- MaterialGenerator.generateNuclearDusts(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE);
- MaterialGenerator.generateNuclearDusts(FLUORIDES.TECHNETIUM_HEXAFLUORIDE);
- MaterialGenerator.generateNuclearDusts(FLUORIDES.SELENIUM_HEXAFLUORIDE);
-
- //Generate Reactor Fuel Salts
- MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ZrF4U235);
- MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ZrF4UF4);
- MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ThF4UF4);
- //MaterialGenerator.generateNuclearMaterial(NUCLIDE.Li2BeF4, false);
-
- //Generate some Alloys
-
- //Misc Alloys
- MaterialGenerator.generate(ALLOY.ENERGYCRYSTAL);
- MaterialGenerator.generate(ALLOY.BLOODSTEEL);
-
- MaterialGenerator.generate(ALLOY.ZERON_100);
- //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper
- MaterialGenerator.generate(ALLOY.TUMBAGA);
- //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible
- MaterialGenerator.generate(ALLOY.POTIN);
-
- //Staballoy & Tantalloy
- MaterialGenerator.generate(ALLOY.STABALLOY);
- MaterialGenerator.generate(ALLOY.TANTALLOY_60);
- MaterialGenerator.generate(ALLOY.TANTALLOY_61);
-
- //Inconel
- MaterialGenerator.generate(ALLOY.INCONEL_625);
- MaterialGenerator.generate(ALLOY.INCONEL_690);
- MaterialGenerator.generate(ALLOY.INCONEL_792);
-
-
- //Steels
- MaterialGenerator.generateDusts(ALLOY.EGLIN_STEEL_BASE);
- MaterialGenerator.generate(ALLOY.EGLIN_STEEL);
- MaterialGenerator.generate(ALLOY.MARAGING250);
- MaterialGenerator.generate(ALLOY.MARAGING300);
- MaterialGenerator.generate(ALLOY.MARAGING350);
- MaterialGenerator.generate(ALLOY.AQUATIC_STEEL);
-
- MaterialGenerator.generate(ALLOY.NITINOL_60, true, false);
-
- //Composite Alloys
- MaterialGenerator.generate(ALLOY.STELLITE);
- MaterialGenerator.generate(ALLOY.TALONITE);
-
- //Hastelloy
- MaterialGenerator.generate(ALLOY.HASTELLOY_W);
- MaterialGenerator.generate(ALLOY.HASTELLOY_X);
- MaterialGenerator.generate(ALLOY.HASTELLOY_C276);
- MaterialGenerator.generate(ALLOY.HASTELLOY_N);
-
- //Incoloy
- MaterialGenerator.generate(ALLOY.INCOLOY_020);
- MaterialGenerator.generate(ALLOY.INCOLOY_DS);
- MaterialGenerator.generate(ALLOY.INCOLOY_MA956);
-
- //Leagrisium
- MaterialGenerator.generate(ALLOY.LEAGRISIUM);
-
- //Super Conductor
- MaterialGenerator.generate(ALLOY.HG1223, false, false);
-
- //Generate Fictional Materials
- if (!CORE.GTNH) {
- MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM, false);
- MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM_REFINED, false);
- }
- MaterialGenerator.generate(ALLOY.TRINIUM_TITANIUM);
- MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH, false);
- MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH_CARBON);
- MaterialGenerator.generate(ALLOY.TRINIUM_REINFORCED_STEEL);
-
- //Top Tier Alloys
- MaterialGenerator.generate(ALLOY.HELICOPTER);
- MaterialGenerator.generate(ALLOY.LAFIUM);
- MaterialGenerator.generate(ALLOY.CINOBITE);
- MaterialGenerator.generate(ALLOY.PIKYONIUM);
- MaterialGenerator.generate(ALLOY.ABYSSAL);
- MaterialGenerator.generate(ALLOY.LAURENIUM);
- MaterialGenerator.generate(ALLOY.BOTMIUM);
- MaterialGenerator.generate(ALLOY.HS188A);
-
-
- MaterialGenerator.generate(ALLOY.TITANSTEEL);
- MaterialGenerator.generate(ALLOY.ARCANITE);
- MaterialGenerator.generate(ALLOY.OCTIRON);
-
- MaterialGenerator.generate(ALLOY.BABBIT_ALLOY, false);
- MaterialGenerator.generate(ALLOY.BLACK_TITANIUM, false);
- MaterialGenerator.generate(ALLOY.INDALLOY_140, false, false);
-
- // High Level Bioplastic
- MaterialGenerator.generate(ELEMENT.STANDALONE.RHUGNOR, false, false);
-
-
-
-
-
-
-
-
- //Must be the final Alloy to Generate
- MaterialGenerator.generate(ALLOY.QUANTUM);
-
- //Ores
- MaterialGenerator.generateOreMaterial(FLUORIDES.FLUORITE);
- MaterialGenerator.generateOreMaterial(ALLOY.KOBOLDITE);
- GTplusplus_Everglades.GenerateOreMaterials();
-
- // formula override
- ALLOY.TUNGSTEN_TITANIUM_CARBIDE.vChemicalFormula = StringUtils.subscript("(CW)7Ti3");
- ALLOY.TITANSTEEL.vChemicalFormula = StringUtils.subscript("((CW)7Ti3)3???");
-
- // Werkstoff bridge
- ELEMENT.getInstance().ZIRCONIUM.setWerkstoffID((short) 3);
- ELEMENT.getInstance().THORIUM232.setWerkstoffID((short) 30);
- ELEMENT.getInstance().RUTHENIUM.setWerkstoffID((short) 64);
- ELEMENT.getInstance().HAFNIUM.setWerkstoffID((short) 11000);
- ELEMENT.getInstance().IODINE.setWerkstoffID((short) 11012);
-
-
- } catch (final Throwable r){
- Logger.INFO("Failed to Generated a Material. "+r.getMessage());
- //Utils.LOG_INFO("Failed to Generated a Material. "+r.getCause().getMessage());
- //Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[0].getMethodName());
- //Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[1].getMethodName());
- r.printStackTrace();
- //System.exit(1);
- }
-
- //TC Style Shards, for use in making energy crystal mix.
- //A dull shard, able to be infused with an element.
- shardDull = new BaseItemTCShard("Drained", Utils.rgbtoHexValue(75, 75, 75), "Can be infused to create a magical shard.", "Obtained from Mining Stone/SandStone, Chopping Logs or Shovelling Dirt.");
-
- //Generates four elemental shards when TC is not installed.
- if (!LoadedMods.Thaumcraft){
- shardAer = new BaseItemTCShard("Aer", Utils.rgbtoHexValue(225, 225, 5));
- shardIgnis = new BaseItemTCShard("Ignis", Utils.rgbtoHexValue(255, 5, 5));
- shardTerra = new BaseItemTCShard("Terra", Utils.rgbtoHexValue(5, 255, 5));
- shardAqua = new BaseItemTCShard("Aqua", Utils.rgbtoHexValue(5, 5, 255));
- }
- else {
- shardAer = ItemUtils.getItemStackWithMeta(LoadedMods.Thaumcraft, "Thaumcraft:ItemShard", "Air Shard", 0, 1).getItem();
- shardIgnis = ItemUtils.getItemStackWithMeta(LoadedMods.Thaumcraft, "Thaumcraft:ItemShard", "Fire Shard", 1, 1).getItem();
- shardAqua = ItemUtils.getItemStackWithMeta(LoadedMods.Thaumcraft, "Thaumcraft:ItemShard", "Warer Shard", 2, 1).getItem();
- shardTerra = ItemUtils.getItemStackWithMeta(LoadedMods.Thaumcraft, "Thaumcraft:ItemShard", "Earth Shard", 3, 1).getItem();
- }
- //Generates a set of four special dusts to be used in my recipes.
- dustAer = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AER, true)[0];
- dustIgnis = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().IGNIS, true)[0];
- dustTerra = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().TERRA, true)[0];
- dustAqua = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AQUA, true)[0];
-
- ItemUtils.generateSpecialUseDusts(MISC_MATERIALS.WOODS_GLASS, false);
- cellHydrogenChlorideMix = new BaseItemCell("hydrogenchloridemix", "Hydrogen Chloride Mix", MISC_MATERIALS.HYDROGEN_CHLORIDE.getRGB());
-
- //Nuclear Fuel Dusts
- dustLithiumCarbonate = ItemUtils.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", "Li2CO3", Utils.rgbtoHexValue(240, 240, 240))[0]; //https://en.wikipedia.org/wiki/Lithium_carbonate
- dustLithiumPeroxide = ItemUtils.generateSpecialUseDusts("LithiumPeroxide", "Lithium Peroxide", "Li2O2", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_peroxide
- dustLithiumHydroxide = ItemUtils.generateSpecialUseDusts("LithiumHydroxide", "Lithium Hydroxide", "LiOH", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_hydroxide
-
- if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1)) && !LoadedMods.IHL){
- dustQuicklime = ItemUtils.generateSpecialUseDusts("Quicklime", "Quicklime", "CaO", Utils.rgbtoHexValue(255, 255, 175))[0]; //https://en.wikipedia.org/wiki/Calcium_oxide
- }
- dustCalciumHydroxide = ItemUtils.generateSpecialUseDusts("CalciumHydroxide", "Hydrated Lime", "Ca(OH)2", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_hydroxide
- dustCalciumCarbonate = ItemUtils.generateSpecialUseDusts("CalciumCarbonate", "Calcium Carbonate", "CaCO3", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate
- if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGypsum", 1) == null) || (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustCalciumSulfate", 1) == null)){
- dustCalciumSulfate = ItemUtils.generateSpecialUseDusts("Gypsum", "Calcium Sulfate (Gypsum)", "CaSO4", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_sulfate
- GT_OreDictUnificator.registerOre("dustCalciumSulfate", ItemUtils.getSimpleStack(dustCalciumSulfate));
- }
- else {
- GT_OreDictUnificator.registerOre("dustCalciumSulfate", ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGypsum", 1));
- }
- dustLi2CO3CaOH2 = ItemUtils.generateSpecialUseDusts("Li2CO3CaOH2", "Li2CO3 + Ca(OH)2 Compound", "Li2CO3CaOH2", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(FLUORIDES.SODIUM_FLUORIDE, false);
- //FLiBe Fuel Compounds
- dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Lithium Tetrafluoroberyllate Fuel Compound", "Li2BeF4", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe
- Material.registerComponentForMaterial(NUCLIDE.Li2BeF4, OrePrefixes.dust, ItemUtils.getSimpleStack(dustLi2BeF4));
- //fluidFLiBeSalt = ("Li2BeF4", "Li2BeF4", 7430, new short[]{255, 255, 255, 100}, 0);
- //fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Lithium Tetrafluoroberyllate", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true);
- //fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true);
-
- // LFTR Core Fluid Processing
- //fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100}, 0, 800, null, CI.emptyCells(1), 1000, true);
- //fluidLftrCore2 = FluidUtils.addGTFluidNoPrefix("UF6F2FP", "UF6F2FP", new short[]{150, 255, 150, 100}, 0, 800, null, CI.emptyCells(1), 1000, true);
- //fluidLftrCore3 = FluidUtils.addGTFluidNoPrefix("LiFBeF2", "LiFBeF2", new short[]{100, 255, 50, 100}, 0, 800, null, CI.emptyCells(1), 1000, true);
- //fluidLftrCore4 = FluidUtils.addGTFluidNoPrefix("LiFBeF2UF4", "LiFBeF2UF4", new short[]{50, 255, 100, 100}, 0, 800, null, CI.emptyCells(1), 1000, true);
- // LFTR Blanket Fluid Processing
- //fluidLftrBlanket1 = FluidUtils.addGTFluidNoPrefix("LiFThF4", "LiFThF4", new short[]{50, 150, 255, 50}, 0, 500, null, CI.emptyCells(1), 1000, true);
- //fluidLftrBlanket2 = FluidUtils.addGTFluidNoPrefix("LiFBeF2ThF4", "LiFBeF2ThF4", new short[]{100, 150, 100, 100}, 0, 500, null, CI.emptyCells(1), 1000, true);
- //fluidLftrBlanket3 = FluidUtils.addGTFluidNoPrefix("UF6F2", "UF6F2", new short[]{10, 150, 10, 100}, 0, 500, null, CI.emptyCells(1), 1000, true);
- fluidNuclearWaste = FluidUtils.addGTFluidNoPrefix("nuclear.waste", "Nuclear Waste", new short[]{10, 250, 10, 100}, 0, 1000, null, CI.emptyCells(1), 1000, true);
-
-
- //LFTR Control Circuit
- itemCircuitLFTR = new CoreItem("itemCircuitLFTR", ""+EnumChatFormatting.GREEN+"Control Circuit", AddToCreativeTab.tabMisc, 1, 0, new String[] {"Keeps Multiblocks Stable"}, EnumRarity.epic, EnumChatFormatting.DARK_GREEN, false, null);
-
- if (CORE.ConfigSwitches.enableMachine_Pollution) {
- itemBasicTurbine = new ItemBasicScrubberTurbine();
- }
-
- //Zirconium
- //Cinter Pellet.
- itemZirconiumChlorideCinterPellet = new CoreItem("itemZirconiumPellet", "Zirconium Pellet ["+StringUtils.subscript("ZrCl4")+"]", tabMisc).setTextureName(CORE.MODID + ":itemShard");
- GT_OreDictUnificator.registerOre("pelletZirconium", new ItemStack(itemZirconiumChlorideCinterPellet));
- //Zirconium Chloride
- dustZrCl4 = ItemUtils.generateSpecialUseDusts("ZrCl4", "ZrCl4", "ZrCl4", Utils.rgbtoHexValue(180, 180, 180))[0]; //http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/39/036/39036750.pdf
- dustCookedZrCl4 = ItemUtils.generateSpecialUseDusts("CookedZrCl4", "Cooked ZrCl4", "ZrCl4", Utils.rgbtoHexValue(180, 180, 180))[0]; //http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/39/036/39036750.pdf
-
- //Zirconium Tetrafluoride
- /*GT_OreDictUnificator.registerOre("cellZrF4", ItemUtils.getItemStackOfAmountFromOreDict("cellZirconiumTetrafluoride", 1));
- GT_OreDictUnificator.registerOre("dustZrF4", ItemUtils.getItemStackOfAmountFromOreDict("dustZirconiumTetrafluoride", 1));*/
- //GT_OreDictUnificator.registerOre("cellZrF4", ItemUtils.getItemStackOfAmountFromOreDict("cellZirconiumTetrafluoride", 1));
- //GT_OreDictUnificator.registerOre("dustZrF4", ItemUtils.getItemStackOfAmountFromOreDict("dustZirconiumTetrafluoride", 1));
- fluidZrF4 = FluidUtils.generateFluidNoPrefix("ZirconiumTetrafluoride", "Zirconium Tetrafluoride", 500, new short[]{170, 170, 140, 100}); //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride
- FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.setFluid(fluidZrF4);
-
- //Coolant Salt
- //NaBF4 - NaF - 621C
- //dustNaBF4NaF = ItemUtils.generateSpecialUseDusts("NaBF4NaF", "NaBF4NaF", Utils.rgbtoHexValue(45, 45, 90))[0]; //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride
-
-
- //Load Tree Farmer
- if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer){ //https://en.wikipedia.org/wiki/UAN
- dustFertUN18 = ItemUtils.generateSpecialUseDusts("UN18Fertiliser", "UN-18 Fertiliser", Utils.rgbtoHexValue(60, 155, 60))[0];
- dustFertUN32 = ItemUtils.generateSpecialUseDusts("UN32Fertiliser", "UN-32 Fertiliser", Utils.rgbtoHexValue(55, 190, 55))[0];
-
- ItemStack temp1 = null;
- ItemStack temp2 = null;
-
- if (LoadedMods.IndustrialCraft2){
- temp1 = ItemUtils.getCorrectStacktype("IC2:itemFertilizer", 1);
- }
- if (LoadedMods.Forestry){
- temp2 = ItemUtils.getCorrectStacktype("Forestry:fertilizerCompound", 1);
- }
- if (temp1 != null){
- fluidFertBasic = FluidUtils.generateFluidNonMolten("Fertiliser", "Fertiliser", 32, new short[]{45, 170, 45, 100}, temp1, null, true);
- GT_Values.RA.addFluidExtractionRecipe(temp2, null, new FluidStack(fluidFertBasic, 36), 10000, 5, 16);
- }
- fluidFertUN32 = FluidUtils.generateFluidNonMolten("UN32Fertiliser", "UN-32 Fertiliser", 24, new short[]{55, 190, 55, 100}, null, null, true);
- fluidFertUN18 = FluidUtils.generateFluidNonMolten("UN18Fertiliser", "UN-18 Fertiliser", 22, new short[]{60, 155, 60, 100}, null, null, true);
-
- /*GT_Values.RA.addMixerRecipe(
- arg0, //Item In
- arg1,
- arg2,
- arg3,
- arg4, //Fluid in
- arg5, //Fluid Out
- arg6, //Item out
- arg7, //Eu
- arg8); //Time
- */
-
- }
-
- //Juice
- FluidUtils.generateFluidNonMolten("RaisinJuice", "Raisin Juice", 2, new short[]{51, 0, 51, 100}, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foodRaisins", 1), ItemUtils.getItemStackOfAmountFromOreDictNoBroken("fruitRaisins", 1), 50, true);
-
-
- //Test items
- metaItem2 = new BaseEuItem();
- metaItem2.registerItem(0, EnumChatFormatting.BLACK+"Test Item 0", 0, 0, "I am 0.");
- metaItem2.registerItem(1, EnumChatFormatting.GREEN+"Test Item 1", 1006346000, 1, "I Hold EU 1.", 500);
- metaItem2.registerItem(2, EnumChatFormatting.GOLD+"Test Item 2", 1004630000, 2, "I Hold EU 2.", 8000);
- metaItem2.registerItem(3, "Test Item 3", 1000765000, 4, "I Hold EU 3.", 32000);
- metaItem2.registerItem(4, "Whirlygig", 1043644000, (short) 5, "Spin me right round.", EnumRarity.rare, EnumChatFormatting.DARK_GREEN, true);
- metaItem2.registerItem(5, "Whirlygig 2", 2124867000, (short) 7, "Spin me right round.", EnumRarity.uncommon, EnumChatFormatting.RED, true);
-
- toolGregtechPump = new GregtechPump();
- toolGregtechPump.registerPumpType(0, "Simple Hand Pump", 0, 0);
- toolGregtechPump.registerPumpType(1, "Advanced Hand Pump", 32000, 1);
- toolGregtechPump.registerPumpType(2, "Super Hand Pump", 128000, 2);
- toolGregtechPump.registerPumpType(3, "Ultimate Hand Pump", 512000, 3);
-
- //Create Multi-tools
- //ItemsMultiTools.load();
-
- //Xp Fluids - Dev
- if (!FluidRegistry.isFluidRegistered("mobessence")){
- FluidUtils.generateFluidNoPrefix("mobessence", "mobessence", 0, new short[]{125, 175, 125, 100});
- }
- if (!FluidRegistry.isFluidRegistered("xpjuice")){
- FluidUtils.generateFluidNoPrefix("xpjuice", "xpjuice", 0, new short[]{50, 150, 50, 100});
- }
-
- //Industrial Diamonds
- itemExquisiteIndustrialDiamond = new CoreItem("IndustrialDiamondExquisite", "High Quality Industrial Diamond", tabMisc);
- ItemStack tempStack = itemExquisiteIndustrialDiamond.getStack();
- ItemUtils.addItemToOreDictionary(tempStack, "gemDiamond");
- ItemUtils.addItemToOreDictionary(tempStack, "craftingIndustrialDiamond");
- ItemUtils.addItemToOreDictionary(tempStack, "gemExquisiteDiamond");
- ItemUtils.addItemToOreDictionary(tempStack, "craftingExquisiteIndustrialDiamond");
-
-
- /*
- * Decayable Materials
- */
-
- dustNeptunium238 = new DustDecayable("dustNeptunium238", Utils.rgbtoHexValue(175, 240, 75), 50640, new String[] {""+StringUtils.superscript("238Np"), "Result: Plutonium 238 ("+StringUtils.superscript("238Pu")+")"}, ELEMENT.getInstance().PLUTONIUM238.getDust(1).getItem(), 5);
- dustDecayedRadium226 = ItemUtils.generateSpecialUseDusts("DecayedRadium226", "Decayed Radium-226", "Contains Radon ("+StringUtils.superscript("222Rn")+")", ELEMENT.getInstance().RADIUM.getRgbAsHex())[0];
- dustRadium226 = new DustDecayable("dustRadium226", ELEMENT.getInstance().RADIUM.getRgbAsHex(), 90000, new String[] {""+StringUtils.superscript("226Ra"), "Result: Radon ("+StringUtils.superscript("222Rn")+")"}, ItemUtils.getSimpleStack(dustDecayedRadium226).getItem(), 5);
- dustProtactinium233 = new DustDecayable("dustProtactinium233", ELEMENT.getInstance().PROTACTINIUM.getRgbAsHex(), 32000, new String[] {""+StringUtils.superscript("233Pa"), "Result: Uranium 233("+StringUtils.superscript("233U")+")"}, ELEMENT.getInstance().URANIUM233.getDust(1).getItem(), 6);
- dustTechnetium99 = new DustDecayable("dustTechnetium99", ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), 164500, new String[] {""+StringUtils.superscript("99Mo"), "Result: Ruthenium 99("+StringUtils.superscript("99Ru")+")"}, ELEMENT.getInstance().RUTHENIUM.getDust(1).getItem(), 4);
- dustTechnetium99M = new DustDecayable("dustTechnetium99M", ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), 8570, new String[] {""+StringUtils.superscript("99ᵐTc"), "Result: Technicium 99 ("+StringUtils.superscript("99Tc")+")"}, dustTechnetium99, 4);
- dustMolybdenum99 = new DustDecayable("dustMolybdenum99", ELEMENT.getInstance().MOLYBDENUM.getRgbAsHex(), 16450, new String[] {""+StringUtils.superscript("99Mo"), "Result: Technicium 99ᵐ ("+StringUtils.superscript("99ᵐTc")+")"}, dustTechnetium99M, 4);
-
- itemIonParticleBase = new IonParticles();
- itemStandarParticleBase = new StandardBaseParticles();
-
- if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
- Item a8kFlask = VolumetricFlaskHelper.generateNewFlask("Volumetric_Flask_8k", "Large Volumetric Flask", 8000);
- Item a64kFlask = VolumetricFlaskHelper.generateNewFlask("Volumetric_Flask_32k", "Gigantic Volumetric Flask", 32000);
- GregtechItemList.VOLUMETRIC_FLASK_8k.set(a8kFlask);
- GregtechItemList.VOLUMETRIC_FLASK_32k.set(a64kFlask);
- }
-
- itemBoilerChassis = new ItemBoilerChassis();
- itemDehydratorCoilWire = new ItemDehydratorCoilWire();
- itemDehydratorCoil = new ItemDehydratorCoil();
-
- itemAirFilter = new ItemAirFilter();
- itemLavaFilter = new ItemLavaFilter();
-
- itemGrindleTablet = new BaseItemGrindle();
- itemDragonJar = new ItemEntityCatcher();
-
- itemControlCore = new ItemControlCore();
-
- itemSunnariumBit = new ItemSunnariumBit();
-
- //Chemistry
- new CoalTar();
- new RocketFuels();
-
- //Nuclear Processing
- new NuclearChem();
-
- //Farm Animal Fun
- new AgriculturalChem();
-
- //General Chemistry
- new GenericChem();
-
- // Milled Ore Processing
- new MilledOreProcessing();
-
- //Bombs
- itemBombCasing = new CoreItem("itemBombCasing", "Bomb Casing", tabMisc);
- itemBombCasing.setTextureName(CORE.MODID + ":bomb_casing");
- itemBombUnf = new CoreItem("itemBombUnf", "Bomb (unf)", tabMisc);
- itemBombUnf.setTextureName(CORE.MODID + ":bomb_casing");
- itemDetCable = new CoreItem("itemDetCable", "Det. Cable", tabMisc);
- itemDetCable.setTextureName("string");
- itemBomb = new ItemThrowableBomb();
-
- //Only used for debugging.
- /*if (CORE.DEVENV) {
- new ConnectedBlockFinder();
- }*/
-
- //Misc Items
- @SuppressWarnings("unused")
- Item tI;
- tI = new BaseItemMisc("Chilly", new short[]{0,64,196}, 32, MiscTypes.POTION, new String[]{"It's Blue"});
- tI = new BaseItemMisc("4000DC's", new short[]{180,100,30}, 1, MiscTypes.BIGKEY, new String[]{"It opens things."});
- tI = new BaseItemMisc("Dull", new short[]{64,64,64}, 64, MiscTypes.GEM, null);
- tI = new BaseItemMisc("Forest", new short[]{130,164,96}, 64, MiscTypes.MUSHROOM, new String[]{"You Found this on the ground.", "Definitely not sure if it's worth eating."});
-
- //Baubles
- if (LoadedMods.Baubles){
- tI = new HealthBoostBauble();
- itemModularBauble = new ModularBauble();
- }
-
- //EnderIO Resources
- if ((LoadedMods.EnderIO || LOAD_ALL_CONTENT)){
- Logger.INFO("EnderIO Found - Loading Resources.");
- //Enderio Dusts
- itemDustSoularium = ItemUtils.generateSpecialUseDusts("Soularium", "Soularium", MaterialEIO.SOULARIUM.vChemicalFormula, MaterialEIO.SOULARIUM.getRgbAsHex())[0];
- itemDustRedstoneAlloy = ItemUtils.generateSpecialUseDusts("RedstoneAlloy", "Redstone Alloy", MaterialEIO.REDSTONE_ALLOY.vChemicalFormula, MaterialEIO.REDSTONE_ALLOY.getRgbAsHex())[0];
- itemDustElectricalSteel = ItemUtils.generateSpecialUseDusts("ElectricalSteel", "Electrical Steel", MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula, MaterialEIO.ELECTRICAL_STEEL.getRgbAsHex())[0];
- itemDustPulsatingIron = ItemUtils.generateSpecialUseDusts("PulsatingIron", "Pulsating Iron", MaterialEIO.PULSATING_IRON.vChemicalFormula, MaterialEIO.PULSATING_IRON.getRgbAsHex())[0];
- itemDustEnergeticAlloy = ItemUtils.generateSpecialUseDusts("EnergeticAlloy", "Energetic Alloy", MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula, MaterialEIO.ENERGETIC_ALLOY.getRgbAsHex())[0];
- itemDustVibrantAlloy = ItemUtils.generateSpecialUseDusts("VibrantAlloy", "Vibrant Alloy", MaterialEIO.VIBRANT_ALLOY.vChemicalFormula, MaterialEIO.VIBRANT_ALLOY.getRgbAsHex())[0];
- itemDustConductiveIron = ItemUtils.generateSpecialUseDusts("ConductiveIron", "Conductive Iron", MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula, MaterialEIO.CONDUCTIVE_IRON.getRgbAsHex())[0];
-
- //EnderIO Plates
- itemPlateSoularium = ItemUtils.generateSpecialUsePlate("Soularium", "Soularium", MaterialEIO.SOULARIUM.vChemicalFormula, MaterialEIO.SOULARIUM.getRgbAsHex(), 0);
- itemPlateRedstoneAlloy = ItemUtils.generateSpecialUsePlate("RedstoneAlloy", "Redstone Alloy", MaterialEIO.REDSTONE_ALLOY.vChemicalFormula, MaterialEIO.REDSTONE_ALLOY.getRgbAsHex(), 0);
- itemPlateElectricalSteel = ItemUtils.generateSpecialUsePlate("ElectricalSteel", "Electrical Steel", MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula, MaterialEIO.ELECTRICAL_STEEL.getRgbAsHex(), 0);
- itemPlatePulsatingIron = ItemUtils.generateSpecialUsePlate("PhasedIron", "Phased Iron", MaterialEIO.PULSATING_IRON.vChemicalFormula, MaterialEIO.PULSATING_IRON.getRgbAsHex(), 0);
- itemPlateEnergeticAlloy = ItemUtils.generateSpecialUsePlate("EnergeticAlloy", "Energetic Alloy", MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula, MaterialEIO.ENERGETIC_ALLOY.getRgbAsHex(), 0);
- itemPlateVibrantAlloy = ItemUtils.generateSpecialUsePlate("VibrantAlloy", "Vibrant Alloy", MaterialEIO.VIBRANT_ALLOY.vChemicalFormula, MaterialEIO.VIBRANT_ALLOY.getRgbAsHex(), 0);
- itemPlateConductiveIron = ItemUtils.generateSpecialUsePlate("ConductiveIron", "Conductive Iron", MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula, MaterialEIO.CONDUCTIVE_IRON.getRgbAsHex(), 0);
-
- //Register dumb naming conventions - Who chose fucking phased Iron/Gold?
- GT_OreDictUnificator.registerOre("dustPhasedGold", ItemUtils.getSimpleStack(itemDustVibrantAlloy));
- GT_OreDictUnificator.registerOre("platePhasedGold", ItemUtils.getSimpleStack(itemPlateVibrantAlloy));
- GT_OreDictUnificator.registerOre("dustPhasedIron", ItemUtils.getSimpleStack(itemDustPulsatingIron));
- GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron));
- GT_OreDictUnificator.registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1));
-
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4*9);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4*9);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(16), 16, 4);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(1294), 16, 4*9*9);
-
- }
- else {
- /*Logger.WARNING("EnderIO not Found - Generating our own Resources.");
- MaterialGenerator.generate(MaterialEIO.CONDUCTIVE_IRON);
- MaterialGenerator.generate(MaterialEIO.PULSATING_IRON);
- MaterialGenerator.generate(MaterialEIO.REDSTONE_ALLOY);
- MaterialGenerator.generate(MaterialEIO.SOULARIUM);
- MaterialGenerator.generate(MaterialEIO.ELECTRICAL_STEEL);
- MaterialGenerator.generate(MaterialEIO.ENERGETIC_ALLOY);
- MaterialGenerator.generate(MaterialEIO.VIBRANT_ALLOY); */
- }
-
- //Big Reactors
- if (LoadedMods.Big_Reactors|| LOAD_ALL_CONTENT){
- Logger.INFO("BigReactors Found - Loading Resources.");
- //Item Init
- itemPlateBlutonium = ItemUtils.generateSpecialUsePlate("Blutonium", "Blutonium", new short[]{0, 0, 255}, 0);
- itemPlateCyanite = ItemUtils.generateSpecialUsePlate("Cyanite", "Cyanite", new short[]{0, 191, 255}, 0);
- itemPlateLudicrite = ItemUtils.generateSpecialUsePlate("Ludicrite", "Ludicrite", new short[]{167, 5, 179}, 0);
- }
- else {
- Logger.WARNING("BigReactors not Found - Skipping Resources.");
- }
-
- //Thaumcraft
- if ((LoadedMods.Thaumcraft|| LOAD_ALL_CONTENT) && !CORE.GTNH){
- Logger.INFO("Thaumcraft Found - Loading Resources.");
- //Item Init
- try {
- ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16);
- itemPlateVoidMetal = ItemUtils.generateSpecialUsePlate("Void", "Void", new short[]{82, 17, 82}, 0);
- GT_OreDictUnificator.registerOre("plateVoidMetal", new ItemStack(ModItems.itemPlateVoidMetal));
- } catch (final NullPointerException e){}
-
- }
- else {
- Logger.WARNING("Thaumcraft not Found - Skipping Resources.");
- }
-
- //Pneumaticraft
- if (LoadedMods.PneumaticCraft|| LOAD_ALL_CONTENT){
- Logger.INFO("PneumaticCraft Found - Loading Resources.");
- //Item Init
- itemPlateCompressedIron = ItemUtils.generateSpecialUsePlate("CompressedIron", "Compressed Iron", new short[]{128, 128, 128}, 0);
- }
- else {
- Logger.WARNING("PneumaticCraft not Found - Skipping Resources.");
- }
-
- //Simply Jetpacks
- if (LoadedMods.Simply_Jetpacks|| LOAD_ALL_CONTENT){
- Logger.INFO("SimplyJetpacks Found - Loading Resources.");
- //Item Init
- itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium");
- //Registry
- GameRegistry.registerItem(itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium");
- }
- else {
- Logger.WARNING("SimplyJetpacks not Found - Skipping Resources.");
- }
-
- //rfTools
- if (LoadedMods.RFTools|| LOAD_ALL_CONTENT){
- Logger.INFO("rfTools Found - Loading Resources.");
- //Item Init
- itemPlateDimensionShard = ItemUtils.generateSpecialUsePlate("DimensionShard", "Dimensional Shard", new short[]{170, 230, 230}, 0);
- }
- else {
- Logger.WARNING("rfTools not Found - Skipping Resources.");
- }
-
- //IC2 Exp
- if (LoadedMods.IndustrialCraft2|| LOAD_ALL_CONTENT){
- Logger.INFO("IndustrialCraft2 Found - Loading Resources.");
-
- //Baubles Mod Test
- try {
- final Class<?> baublesTest = ReflectionUtils.getClass("baubles.api.IBauble");
- if (baublesTest != null){
- COMPAT_Baubles.run();
- }
- else {
- Logger.INFO("Baubles Not Found - Skipping Resources.");
- }
- } catch(final Throwable T){
- Logger.INFO("Baubles Not Found - Skipping Resources.");
- }
- }
- else {
- Logger.WARNING("IndustrialCraft2 not Found - Skipping Resources.");
- }
-
-
- //Special Item Handling Case
- if (ConfigSwitches.enableAlternativeBatteryAlloy) {
- //ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 0); TODO
- ModItems.itemPlateBatteryAlloy = ItemUtils.generateSpecialUsePlate("BatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 0);
-
- }
-
-
- //UtilsItems.generateSpawnEgg("ic2", "boatcarbon", Utils.generateSingularRandomHexValue(), Utils.generateSingularRandomHexValue());
-
- HANDLER_COFH.initItems();
-
- /*
- * Misc Items
- */
-
- //Staballoy Equipment
- itemStaballoyPickaxe = new StaballoyPickaxe("itemStaballoyPickaxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools);
- GameRegistry.registerItem(itemStaballoyPickaxe, itemStaballoyPickaxe.getUnlocalizedName());
- itemStaballoyAxe = new StaballoyAxe("itemStaballoyAxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools);
- GameRegistry.registerItem(itemStaballoyAxe, itemStaballoyAxe.getUnlocalizedName());
-
- //Sandstone Hammer
- itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer").setCreativeTab(AddToCreativeTab.tabTools);
- GameRegistry.registerItem(itemSandstoneHammer, itemSandstoneHammer.getUnlocalizedName());
-
- //Buffer Cores!
- Item itemBufferCore;
- for(int i=1; i<=10; i++){
- //Utils.LOG_INFO(""+i);
- itemBufferCore = new BufferCore("itemBufferCore", i).setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerItem(itemBufferCore, itemBufferCore.getUnlocalizedName());
- //System.out.println("Buffer Core registration count is: "+i);
- }
-
- itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit").setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit");
- GameRegistry.registerItem(itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit");
-
- //ItemBlockGtFrameBox = new ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1);
- //GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1");
-
- itemCustomBook = new ItemBaseBook();
- registerCustomTokens();
- }
-
- public static void registerCustomTokens() {
- itemGenericToken.register(0, "BitCoin", 16, "Can be used on the dark web");
- itemGenericToken.register(1, "Hand Pump Trade Token I", 1, "Craft into a Tier I Hand pump");
- itemGenericToken.register(2, "Hand Pump Trade Token II", 1, "Craft into a Tier II Hand pump");
- itemGenericToken.register(3, "Hand Pump Trade Token III", 1, "Craft into a Tier III Hand pump");
- itemGenericToken.register(4, "Hand Pump Trade Token IV", 1, "Craft into a Tier IV Hand pump");
- }
-
- public static void registerCustomMaterialComponents() {
- //Custom GT++ Crafting Components
-
- /**
- * Try generate dusts for missing rare earth materials if they don't exist
- */
-
- if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGadolinium", 1))){
- ItemUtils.generateSpecialUseDusts("Gadolinium", "Gadolinium", Materials.Gadolinium.mElement.name(), Utils.rgbtoHexValue(226, 172, 9));
- }
- if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustYtterbium", 1))){
- ItemUtils.generateSpecialUseDusts("Ytterbium", "Ytterbium", Materials.Ytterbium.mElement.name(), Utils.rgbtoHexValue(Materials.Yttrium.mRGBa[0]-60, Materials.Yttrium.mRGBa[1]-60, Materials.Yttrium.mRGBa[2]-60));
- }
- if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSamarium", 1))){
- ItemUtils.generateSpecialUseDusts("Samarium", "Samarium", Materials.Samarium.mElement.name(), Utils.rgbtoHexValue(161, 168, 114));
- }
- if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustLanthanum", 1))){
- ItemUtils.generateSpecialUseDusts("Lanthanum", "Lanthanum", Materials.Lanthanum.mElement.name(), Utils.rgbtoHexValue(106, 127, 163));
- }
- if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGermanium", 1))){
- ItemUtils.generateSpecialUseDusts("Germanium", "Germanium", "Ge", ELEMENT.getInstance().GERMANIUM.getRgbAsHex());
- }
-
- //Just an unusual plate needed for some black magic.
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateClay", 1) == null){
- itemPlateClay = new BaseItemPlate(NONMATERIAL.CLAY);
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleClay", 1) == null){
- itemDoublePlateClay = new BaseItemPlateDouble(NONMATERIAL.CLAY);
- }
-
- //Need this for Mutagenic Frames
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilUranium235", 1) == null){
- itemFoilUranium235 = new BaseItemFoil(ELEMENT.getInstance().URANIUM235);
- }
-
- //A small gear needed for wizardry.
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gearGtSmallWroughtIron", 1) == null){
- itemSmallWroughtIronGear = new BaseItemSmallGear(NONMATERIAL.WROUGHT_IRON);
- }
- //Krypton Processing
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1) == null){
- itemHotTitaniumIngot = ItemUtils.getSimpleStack(new BaseItemIngot(ELEMENT.getInstance().TITANIUM, ComponentTypes.HOTINGOT));
- }
- else {
- itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1);
- }
-
- //Need this for Laurenium
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIndium", 1) == null){
- itemDustIndium = new BaseItemDust(ELEMENT.getInstance().INDIUM);
- }
-
- //Springs
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ELEMENT.STANDALONE.WHITE_METAL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.NITINOL_60);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.AQUATIC_STEEL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.EGLIN_STEEL);
-
- //Small Springs
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.MARAGING250);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.NICHROME);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STABALLOY);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STEEL_BLACK);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.BLACK_TITANIUM);
-
- //Fine Wire
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.STANDALONE.WHITE_METAL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().PALLADIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().ZIRCONIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.LEAGRISIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.BABBIT_ALLOY);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.KOBOLDITE);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.HG1223);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.QUANTUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.STANDALONE.HYPOGEN);
-
- //Foil
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.BLACK_TITANIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.BOTMIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.TITANSTEEL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.NITINOL_60);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.QUANTUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.LAURENIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.HYPOGEN);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.ASTRAL_TITANIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.RHUGNOR);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.WHITE_METAL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.ADVANCED_NITINOL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.PIKYONIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.CINOBITE);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.LAFIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.TRINIUM_REINFORCED_STEEL);
-
- //Dense Plates
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.POTIN);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.AQUATIC_STEEL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.BRONZE);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.OSMIRIDIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.QUANTUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STEEL_BLACK);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STAINLESS_STEEL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.EGLIN_STEEL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.MARAGING300);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.TALONITE);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.HYPOGEN);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.RHUGNOR);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ADVANCED_NITINOL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ASTRAL_TITANIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.WHITE_METAL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.BLACK_METAL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.GRANITE);
-
-
-
-
- //Special Sillyness
- if (true) {
-
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateSodium", 1) == null){
- new BaseItemPlate(ELEMENT.getInstance().SODIUM);
- }
-
- Material meatRaw = NONMATERIAL.MEAT;
- // A plate of Meat.
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateMeatRaw", 1) == null){
- itemPlateRawMeat = new BaseItemPlate(meatRaw);
- ItemUtils.registerFuel(ItemUtils.getSimpleStack(itemPlateRawMeat), 100);
- }
- // A Block of Meat.
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("blockMeatRaw", 1) == null){
- blockRawMeat = new BlockBaseModular(meatRaw, BlockTypes.STANDARD);
- ItemUtils.registerFuel(ItemUtils.getSimpleStack(blockRawMeat), 900);
- }
- }
-
-
- // A plate of Vanadium.
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateVanadium", 1) == null){
- itemPlateVanadium = new BaseItemPlate(ELEMENT.getInstance().VANADIUM);
- }
-
- //A plate of Lithium.
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateLithium", 1) == null){
- itemPlateLithium = new BaseItemPlate(ELEMENT.getInstance().LITHIUM);
- }
-
- //A plate of Europium.
- if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){
- itemPlateEuropium = new BaseItemPlate(ELEMENT.getInstance().EUROPIUM);
- }
- if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){
- itemDoublePlateEuropium = new BaseItemPlateDouble(ELEMENT.getInstance().EUROPIUM);
- }
-
- //Tumbaga Mix (For Simple Crafting)
- dustTumbagaMix = ItemUtils.generateSpecialUseDusts("MixTumbaga", "Tumbaga Mix", "Au2Cu", Utils.rgbtoHexValue(255, 150, 80))[0];
-
- }
+ public static ItemGenericToken itemGenericToken;
+
+ public static Item itemControlCore;
+
+ public static Item itemSunnariumBit;
+
+ public static ItemStack itemHotTitaniumIngot;
+
+ public static Fluid fluidZrF4;
+ public static Fluid fluidFertBasic;
+ public static Fluid fluidFertUN32;
+ public static Fluid fluidFertUN18;
+
+ public static Item boxTools;
+ public static Item boxFood;
+ public static Item boxMagic;
+
+ public static DustDecayable dustMolybdenum99;
+ public static DustDecayable dustTechnetium99;
+ public static DustDecayable dustTechnetium99M;
+
+ public static IonParticles itemIonParticleBase;
+ public static StandardBaseParticles itemStandarParticleBase;
+
+ public static BatteryPackBaseBauble itemChargePack_Low_1;
+ public static BatteryPackBaseBauble itemChargePack_Low_2;
+ public static BatteryPackBaseBauble itemChargePack_Low_3;
+ public static BatteryPackBaseBauble itemChargePack_Low_4;
+ public static BatteryPackBaseBauble itemChargePack_Low_5;
+ public static BatteryPackBaseBauble itemChargePack_High_1;
+ public static BatteryPackBaseBauble itemChargePack_High_2;
+ public static BatteryPackBaseBauble itemChargePack_High_3;
+ public static BatteryPackBaseBauble itemChargePack_High_4;
+
+ public static DebugScanner itemDebugScanner;
+
+ public static ItemDummyResearch itemDummyResearch;
+
+ public static CoreItem itemBombCasing;
+ public static CoreItem itemBombUnf;
+ public static CoreItem itemDetCable;
+ public static ItemThrowableBomb itemBomb;
+
+ public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Zombie;
+ public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Skeleton;
+ public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Spider;
+ public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Creeper;
+ public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Enderman;
+
+ public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Nether;
+ public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Infernal;
+
+ public static CoreItem itemExquisiteIndustrialDiamond;
+
+ public static BaseItemMetaFood itemMetaFood;
+
+ public static ItemMagicFeather itemMagicFeather;
+
+ static {
+ Logger.INFO("Items!");
+ // Default item used when recipes fail, handy for debugging. Let's make sure they exist when this class is
+ // called upon.
+ AAA_Broken =
+ new BaseItemIngot_OLD("AAA_Broken", "Errors - Tell Alkalus", Utils.rgbtoHexValue(128, 128, 128), 0);
+ ZZZ_Empty = new ItemEmpty();
+ }
+
+ public static final void init() {
+
+ itemDebugScanner = new DebugScanner();
+ itemMagicFeather = new ItemMagicFeather();
+
+ itemAlkalusDisk = new BaseItemDamageable(
+ "itemAlkalusDisk",
+ AddToCreativeTab.tabMisc,
+ 1,
+ 0,
+ "Unknown Use",
+ EnumRarity.rare,
+ EnumChatFormatting.AQUA,
+ false,
+ null);
+ itemBigEgg = new ItemGiantEgg();
+ itemGenericToken = new ItemGenericToken();
+ itemDummyResearch = new ItemDummyResearch();
+ itemCustomSpawnEgg = new ItemCustomSpawnEgg();
+
+ // Debug Loading
+ if (CORE_Preloader.DEBUG_MODE) {
+ DEBUG_INIT.registerItems();
+ }
+
+ itemDebugAreaClear = new ItemAreaClear();
+
+ // Register meta item, because we need them for everything.
+ MetaGeneratedGregtechItems.INSTANCE.generateMetaItems();
+
+ // Some Simple forms of materials
+ itemStickyRubber = new Item()
+ .setUnlocalizedName("itemStickyRubber")
+ .setCreativeTab(tabMachines)
+ .setTextureName(CORE.MODID + ":itemStickyRubber");
+ GameRegistry.registerItem(itemStickyRubber, "itemStickyRubber");
+ GT_OreDictUnificator.registerOre(
+ "ingotRubber", ItemUtils.getItemStackFromFQRN(CORE.MODID + ":itemStickyRubber", 1));
+
+ // Register Hydrogen Blobs first, so we can replace old helium blobs.
+ itemHydrogenBlob = new CoreItem("itemHydrogenBlob", "Mysterious Hydrogen Blob", tabMisc)
+ .setTextureName(CORE.MODID + ":itemHeliumBlob");
+ // Register Old Helium Blob, this will be replaced when held by a player.
+ itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc, ItemUtils.getSimpleStack(itemHydrogenBlob))
+ .setTextureName(CORE.MODID + ":itemHydrogenBlob");
+
+ // Register this neato device, for making some fires.
+ itemBasicFireMaker = new ItemBasicFirestarter();
+
+ // Register Rope
+ itemFiber = new CoreItem("itemFiber", "Plant Fiber", tabMisc);
+ itemRope = new CoreItem("itemRope", "Rope", tabMisc);
+
+ // Load Wearable Items
+ WearableLoader.run();
+
+ // Make some backpacks
+ // Primary colours
+ backpack_Red = new BaseItemBackpack("backpackRed", Utils.rgbtoHexValue(200, 0, 0));
+ backpack_Green = new BaseItemBackpack("backpackGreen", Utils.rgbtoHexValue(0, 200, 0));
+ backpack_Blue = new BaseItemBackpack("backpackBlue", Utils.rgbtoHexValue(0, 0, 200));
+ // Secondary Colours
+ backpack_Yellow = new BaseItemBackpack("backpackYellow", Utils.rgbtoHexValue(200, 200, 0));
+ backpack_Purple = new BaseItemBackpack("backpackPurple", Utils.rgbtoHexValue(200, 0, 200));
+ backpack_Cyan = new BaseItemBackpack("backpackCyan", Utils.rgbtoHexValue(0, 200, 200));
+ // Tertiary Colours
+ backpack_Maroon = new BaseItemBackpack("backpackMaroon", Utils.rgbtoHexValue(128, 0, 0));
+ backpack_Olive = new BaseItemBackpack("backpackOlive", Utils.rgbtoHexValue(128, 128, 0));
+ backpack_DarkGreen = new BaseItemBackpack("backpackDarkGreen", Utils.rgbtoHexValue(0, 128, 0));
+ backpack_DarkPurple = new BaseItemBackpack("backpackDarkPurple", Utils.rgbtoHexValue(128, 0, 128));
+ backpack_Teal = new BaseItemBackpack("backpackTeal", Utils.rgbtoHexValue(0, 128, 128));
+ backpack_Navy = new BaseItemBackpack("backpackNavy", Utils.rgbtoHexValue(0, 0, 128));
+ // Shades
+ backpack_Silver = new BaseItemBackpack("backpackSilver", Utils.rgbtoHexValue(192, 192, 192));
+ backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128));
+ backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20));
+ backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240));
+
+ // Load Custom Box/bags
+ boxTools = new UniversalToolBox("Tool Box");
+ boxFood = new AutoLunchBox("Eatotron-9000");
+ boxMagic = new MagicToolBag("Mystic Bag");
+
+ itemBlueprintBase = new ItemBlueprint("itemBlueprint");
+
+ itemGemShards = new ItemGemShards(
+ "itemGemShards",
+ "Gem Shards",
+ AddToCreativeTab.tabMisc,
+ 32,
+ 0,
+ "They glitter in the light",
+ EnumRarity.rare,
+ EnumChatFormatting.GRAY,
+ false,
+ Utils.rgbtoHexValue(182, 114, 18))
+ .setTextureName(CORE.MODID + ":itemHeliumBlob");
+ itemHalfCompleteCasings = new ItemHalfCompleteCasings(
+ "itemHalfCompleteCasings",
+ AddToCreativeTab.tabMisc,
+ 32,
+ 0,
+ "This isn't quite finished yet.",
+ EnumRarity.common,
+ EnumChatFormatting.GRAY,
+ false,
+ Utils.rgbtoHexValue(255, 255, 255))
+ .setTextureName("gregtech" + ":" + "gt.metaitem.01/" + "761");
+ itemSulfuricPotion = new ItemSulfuricAcidPotion(
+ "itemSulfuricPotion", "Throwable Vial of Sulfuric Acid", "Burn your foes alive!")
+ .setTextureName(CORE.MODID + ":itemSulfuricAcidPotion");
+ itemHydrofluoricPotion = new ItemHydrofluoricAcidPotion(
+ "itemHydrofluoricPotion",
+ "Throwable Vial of Hydrofluoric Acid",
+ "They won't see this coming, nor anything after!")
+ .setTextureName(CORE.MODID + ":itemPotion");
+ // Start meta Item Generation
+ ItemsFoods.load();
+
+ try {
+
+ registerCustomMaterialComponents();
+
+ // Elements generate first so they can be used in compounds.
+ // Missing Elements
+ MaterialGenerator.generate(ELEMENT.getInstance().SELENIUM); // LFTR byproduct
+ MaterialGenerator.generate(ELEMENT.getInstance().BROMINE);
+ MaterialGenerator.generate(ELEMENT.getInstance().KRYPTON); // LFTR byproduct
+ MaterialGenerator.generate(ELEMENT.getInstance().STRONTIUM);
+ MaterialGenerator.generate(ELEMENT.getInstance().ZIRCONIUM);
+ MaterialGenerator.generate(ELEMENT.getInstance().RUTHENIUM);
+ MaterialGenerator.generate(ELEMENT.getInstance().IODINE); // LFTR byproduct
+ MaterialGenerator.generate(ELEMENT.getInstance().HAFNIUM);
+ MaterialGenerator.generate(ELEMENT.getInstance().DYSPROSIUM);
+ MaterialGenerator.generate(ELEMENT.getInstance().ERBIUM);
+ MaterialGenerator.generate(ELEMENT.getInstance().PRASEODYMIUM);
+ MaterialGenerator.generate(ELEMENT.getInstance().TELLURIUM); // LFTR byproduct
+ MaterialGenerator.generate(ELEMENT.getInstance().RHODIUM);
+ MaterialGenerator.generate(ELEMENT.getInstance().RHENIUM);
+ MaterialGenerator.generate(ELEMENT.getInstance().THALLIUM);
+
+ // RADIOACTIVE ELEMENTS
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().TECHNETIUM, false); // LFTR byproduct
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().POLONIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().ASTATINE, false);
+ // MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().RADON, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().FRANCIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().RADIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PROMETHIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().ACTINIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PROTACTINIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().NEPTUNIUM, false); // LFTR byproduct
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().CURIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().BERKELIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().CALIFORNIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().EINSTEINIUM, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().FERMIUM, false);
+
+ // Nuclear Isotopes
+
+ // Lithium-7 is used as a part of the molten lithium fluoride in molten salt reactors: liquid-fluoride
+ // nuclear reactors.
+ // The large neutron-absorption cross-section of lithium-6 (about 940 barns[5]) as compared with the very
+ // small
+ // neutron cross-section of lithium-7 (about 45 millibarns) makes high separation of lithium-7 from natural
+ // lithium a
+ // strong requirement for the possible use in lithium fluoride reactors.
+ MaterialGenerator.generate(ELEMENT.getInstance().LITHIUM7, false);
+ // Thorium-232 is the most stable isotope of Thorium, purified for nuclear fuel use in this case.
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().THORIUM232);
+ // Production of 233U (through the neutron irradiation of 232Th) invariably produces small amounts of 232U
+ // as an impurity
+ // because of parasitic (n,2n) reactions on uranium-233 itself, or on protactinium-233, or on thorium-232:
+ MaterialGenerator.generate(ELEMENT.getInstance().URANIUM232);
+ // Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel
+ // cycle.
+ MaterialGenerator.generate(ELEMENT.getInstance().URANIUM233);
+ // Plutonium-238 is a very powerful alpha emitter. This makes the plutonium-238 isotope suitable for usage
+ // in radioisotope thermoelectric generators (RTGs)
+ // and radioisotope heater units - one gram of plutonium-238 generates approximately 0.5 W of thermal power.
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PLUTONIUM238, false);
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustPlutonium239", 1) == null
+ || Utils.getGregtechVersionAsInt() < 50931) {
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PLUTONIUM239, false);
+ }
+
+ // RTG Fuel Materials
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().STRONTIUM90, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().POLONIUM210, false);
+ MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().AMERICIUM241, false);
+
+ if (!CORE.GTNH) {
+ MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.getInstance().TRINIUM);
+ }
+
+ // Custom Materials that will have standalone refinery processes
+ MaterialGenerator.generate(ELEMENT.STANDALONE.ADVANCED_NITINOL, false);
+ MaterialGenerator.generate(ELEMENT.STANDALONE.ASTRAL_TITANIUM);
+ MaterialGenerator.generate(ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
+ MaterialGenerator.generate(ELEMENT.STANDALONE.HYPOGEN);
+ MaterialGenerator.generate(ELEMENT.STANDALONE.CHRONOMATIC_GLASS);
+ MaterialGenerator.generate(ELEMENT.STANDALONE.FORCE);
+
+ // Custom Materials that are from Runescape
+ MaterialGenerator.generate(ELEMENT.STANDALONE.BLACK_METAL);
+ MaterialGenerator.generate(ELEMENT.STANDALONE.WHITE_METAL);
+ MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.STANDALONE.GRANITE);
+ MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.STANDALONE.RUNITE);
+ MaterialGenerator.generate(ELEMENT.STANDALONE.DRAGON_METAL, false);
+
+ MISC_MATERIALS.run();
+
+ // Carbides - Tungsten Carbide exists in .09 so don't generate it. - Should still come before alloys though
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ MaterialGenerator.generate(ALLOY.TUNGSTEN_CARBIDE);
+ }
+ MaterialGenerator.generate(ALLOY.SILICON_CARBIDE);
+ MaterialGenerator.generate(ALLOY.ZIRCONIUM_CARBIDE);
+ MaterialGenerator.generate(ALLOY.TANTALUM_CARBIDE);
+ MaterialGenerator.generate(ALLOY.NIOBIUM_CARBIDE);
+ MaterialGenerator.generate(ALLOY.TUNGSTEN_TITANIUM_CARBIDE);
+
+ // LFTR Fuel components
+ // MaterialGenerator.generate(MISC_MATERIALS.HYDROXIDE); //LFTR fuel component
+ // MaterialGenerator.generate(MISC_MATERIALS.AMMONIA); //LFTR fuel component
+ // MaterialGenerator.generate(MISC_MATERIALS.AMMONIUM); //LFTR fuel component
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.AMMONIUM_BIFLUORIDE); // LFTR fuel component
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.BERYLLIUM_HYDROXIDE); // LFTR fuel component
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE); // LFTR fuel component
+
+ // Generate Fluorides
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.BERYLLIUM_FLUORIDE);
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.LITHIUM_FLUORIDE);
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.THORIUM_TETRAFLUORIDE);
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.THORIUM_HEXAFLUORIDE);
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.URANIUM_TETRAFLUORIDE, false);
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.URANIUM_HEXAFLUORIDE, false);
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE);
+ // LFTR Fluoride outputs
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE);
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.TECHNETIUM_HEXAFLUORIDE);
+ MaterialGenerator.generateNuclearDusts(FLUORIDES.SELENIUM_HEXAFLUORIDE);
+
+ // Generate Reactor Fuel Salts
+ MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ZrF4U235);
+ MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ZrF4UF4);
+ MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ThF4UF4);
+ // MaterialGenerator.generateNuclearMaterial(NUCLIDE.Li2BeF4, false);
+
+ // Generate some Alloys
+
+ // Misc Alloys
+ MaterialGenerator.generate(ALLOY.ENERGYCRYSTAL);
+ MaterialGenerator.generate(ALLOY.BLOODSTEEL);
+
+ MaterialGenerator.generate(ALLOY.ZERON_100);
+ // Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper
+ MaterialGenerator.generate(ALLOY.TUMBAGA);
+ // Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible
+ MaterialGenerator.generate(ALLOY.POTIN);
+
+ // Staballoy & Tantalloy
+ MaterialGenerator.generate(ALLOY.STABALLOY);
+ MaterialGenerator.generate(ALLOY.TANTALLOY_60);
+ MaterialGenerator.generate(ALLOY.TANTALLOY_61);
+
+ // Inconel
+ MaterialGenerator.generate(ALLOY.INCONEL_625);
+ MaterialGenerator.generate(ALLOY.INCONEL_690);
+ MaterialGenerator.generate(ALLOY.INCONEL_792);
+
+ // Steels
+ MaterialGenerator.generateDusts(ALLOY.EGLIN_STEEL_BASE);
+ MaterialGenerator.generate(ALLOY.EGLIN_STEEL);
+ MaterialGenerator.generate(ALLOY.MARAGING250);
+ MaterialGenerator.generate(ALLOY.MARAGING300);
+ MaterialGenerator.generate(ALLOY.MARAGING350);
+ MaterialGenerator.generate(ALLOY.AQUATIC_STEEL);
+
+ MaterialGenerator.generate(ALLOY.NITINOL_60, true, false);
+
+ // Composite Alloys
+ MaterialGenerator.generate(ALLOY.STELLITE);
+ MaterialGenerator.generate(ALLOY.TALONITE);
+
+ // Hastelloy
+ MaterialGenerator.generate(ALLOY.HASTELLOY_W);
+ MaterialGenerator.generate(ALLOY.HASTELLOY_X);
+ MaterialGenerator.generate(ALLOY.HASTELLOY_C276);
+ MaterialGenerator.generate(ALLOY.HASTELLOY_N);
+
+ // Incoloy
+ MaterialGenerator.generate(ALLOY.INCOLOY_020);
+ MaterialGenerator.generate(ALLOY.INCOLOY_DS);
+ MaterialGenerator.generate(ALLOY.INCOLOY_MA956);
+
+ // Leagrisium
+ MaterialGenerator.generate(ALLOY.LEAGRISIUM);
+
+ // Super Conductor
+ MaterialGenerator.generate(ALLOY.HG1223, false, false);
+
+ // Generate Fictional Materials
+ if (!CORE.GTNH) {
+ MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM, false);
+ MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM_REFINED, false);
+ }
+ MaterialGenerator.generate(ALLOY.TRINIUM_TITANIUM);
+ MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH, false);
+ MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH_CARBON);
+ MaterialGenerator.generate(ALLOY.TRINIUM_REINFORCED_STEEL);
+
+ // Top Tier Alloys
+ MaterialGenerator.generate(ALLOY.HELICOPTER);
+ MaterialGenerator.generate(ALLOY.LAFIUM);
+ MaterialGenerator.generate(ALLOY.CINOBITE);
+ MaterialGenerator.generate(ALLOY.PIKYONIUM);
+ MaterialGenerator.generate(ALLOY.ABYSSAL);
+ MaterialGenerator.generate(ALLOY.LAURENIUM);
+ MaterialGenerator.generate(ALLOY.BOTMIUM);
+ MaterialGenerator.generate(ALLOY.HS188A);
+
+ MaterialGenerator.generate(ALLOY.TITANSTEEL);
+ MaterialGenerator.generate(ALLOY.ARCANITE);
+ MaterialGenerator.generate(ALLOY.OCTIRON);
+
+ MaterialGenerator.generate(ALLOY.BABBIT_ALLOY, false);
+ MaterialGenerator.generate(ALLOY.BLACK_TITANIUM, false);
+ MaterialGenerator.generate(ALLOY.INDALLOY_140, false, false);
+
+ // High Level Bioplastic
+ MaterialGenerator.generate(ELEMENT.STANDALONE.RHUGNOR, false, false);
+
+ // Must be the final Alloy to Generate
+ MaterialGenerator.generate(ALLOY.QUANTUM);
+
+ // Ores
+ MaterialGenerator.generateOreMaterial(FLUORIDES.FLUORITE);
+ MaterialGenerator.generateOreMaterial(ALLOY.KOBOLDITE);
+ GTplusplus_Everglades.GenerateOreMaterials();
+
+ // formula override
+ ALLOY.TUNGSTEN_TITANIUM_CARBIDE.vChemicalFormula = StringUtils.subscript("(CW)7Ti3");
+ ALLOY.TITANSTEEL.vChemicalFormula = StringUtils.subscript("((CW)7Ti3)3???");
+
+ // Werkstoff bridge
+ ELEMENT.getInstance().ZIRCONIUM.setWerkstoffID((short) 3);
+ ELEMENT.getInstance().THORIUM232.setWerkstoffID((short) 30);
+ ELEMENT.getInstance().RUTHENIUM.setWerkstoffID((short) 64);
+ ELEMENT.getInstance().HAFNIUM.setWerkstoffID((short) 11000);
+ ELEMENT.getInstance().IODINE.setWerkstoffID((short) 11012);
+
+ } catch (final Throwable r) {
+ Logger.INFO("Failed to Generated a Material. " + r.getMessage());
+ // Utils.LOG_INFO("Failed to Generated a Material. "+r.getCause().getMessage());
+ // Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[0].getMethodName());
+ // Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[1].getMethodName());
+ r.printStackTrace();
+ // System.exit(1);
+ }
+
+ // TC Style Shards, for use in making energy crystal mix.
+ // A dull shard, able to be infused with an element.
+ shardDull = new BaseItemTCShard(
+ "Drained",
+ Utils.rgbtoHexValue(75, 75, 75),
+ "Can be infused to create a magical shard.",
+ "Obtained from Mining Stone/SandStone, Chopping Logs or Shovelling Dirt.");
+
+ // Generates four elemental shards when TC is not installed.
+ if (!LoadedMods.Thaumcraft) {
+ shardAer = new BaseItemTCShard("Aer", Utils.rgbtoHexValue(225, 225, 5));
+ shardIgnis = new BaseItemTCShard("Ignis", Utils.rgbtoHexValue(255, 5, 5));
+ shardTerra = new BaseItemTCShard("Terra", Utils.rgbtoHexValue(5, 255, 5));
+ shardAqua = new BaseItemTCShard("Aqua", Utils.rgbtoHexValue(5, 5, 255));
+ } else {
+ shardAer = ItemUtils.getItemStackWithMeta(LoadedMods.Thaumcraft, "Thaumcraft:ItemShard", "Air Shard", 0, 1)
+ .getItem();
+ shardIgnis = ItemUtils.getItemStackWithMeta(
+ LoadedMods.Thaumcraft, "Thaumcraft:ItemShard", "Fire Shard", 1, 1)
+ .getItem();
+ shardAqua = ItemUtils.getItemStackWithMeta(
+ LoadedMods.Thaumcraft, "Thaumcraft:ItemShard", "Warer Shard", 2, 1)
+ .getItem();
+ shardTerra = ItemUtils.getItemStackWithMeta(
+ LoadedMods.Thaumcraft, "Thaumcraft:ItemShard", "Earth Shard", 3, 1)
+ .getItem();
+ }
+ // Generates a set of four special dusts to be used in my recipes.
+ dustAer = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AER, true)[0];
+ dustIgnis = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().IGNIS, true)[0];
+ dustTerra = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().TERRA, true)[0];
+ dustAqua = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AQUA, true)[0];
+
+ ItemUtils.generateSpecialUseDusts(MISC_MATERIALS.WOODS_GLASS, false);
+ cellHydrogenChlorideMix = new BaseItemCell(
+ "hydrogenchloridemix", "Hydrogen Chloride Mix", MISC_MATERIALS.HYDROGEN_CHLORIDE.getRGB());
+
+ // Nuclear Fuel Dusts
+ dustLithiumCarbonate = ItemUtils.generateSpecialUseDusts(
+ "LithiumCarbonate", "Lithium Carbonate", "Li2CO3", Utils.rgbtoHexValue(240, 240, 240))[
+ 0]; // https://en.wikipedia.org/wiki/Lithium_carbonate
+ dustLithiumPeroxide = ItemUtils.generateSpecialUseDusts(
+ "LithiumPeroxide", "Lithium Peroxide", "Li2O2", Utils.rgbtoHexValue(250, 250, 250))[
+ 0]; // https://en.wikipedia.org/wiki/Lithium_peroxide
+ dustLithiumHydroxide = ItemUtils.generateSpecialUseDusts(
+ "LithiumHydroxide", "Lithium Hydroxide", "LiOH", Utils.rgbtoHexValue(250, 250, 250))[
+ 0]; // https://en.wikipedia.org/wiki/Lithium_hydroxide
+
+ if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1))
+ && !LoadedMods.IHL) {
+ dustQuicklime = ItemUtils.generateSpecialUseDusts(
+ "Quicklime", "Quicklime", "CaO", Utils.rgbtoHexValue(255, 255, 175))[
+ 0]; // https://en.wikipedia.org/wiki/Calcium_oxide
+ }
+ dustCalciumHydroxide = ItemUtils.generateSpecialUseDusts(
+ "CalciumHydroxide", "Hydrated Lime", "Ca(OH)2", Utils.rgbtoHexValue(255, 255, 255))[
+ 0]; // https://en.wikipedia.org/wiki/Calcium_hydroxide
+ dustCalciumCarbonate = ItemUtils.generateSpecialUseDusts(
+ "CalciumCarbonate", "Calcium Carbonate", "CaCO3", Utils.rgbtoHexValue(255, 255, 255))[
+ 0]; // https://en.wikipedia.org/wiki/Calcium_carbonate
+ if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGypsum", 1) == null)
+ || (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustCalciumSulfate", 1) == null)) {
+ dustCalciumSulfate = ItemUtils.generateSpecialUseDusts(
+ "Gypsum", "Calcium Sulfate (Gypsum)", "CaSO4", Utils.rgbtoHexValue(255, 255, 255))[
+ 0]; // https://en.wikipedia.org/wiki/Calcium_sulfate
+ GT_OreDictUnificator.registerOre("dustCalciumSulfate", ItemUtils.getSimpleStack(dustCalciumSulfate));
+ } else {
+ GT_OreDictUnificator.registerOre(
+ "dustCalciumSulfate", ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGypsum", 1));
+ }
+ dustLi2CO3CaOH2 = ItemUtils.generateSpecialUseDusts(
+ "Li2CO3CaOH2", "Li2CO3 + Ca(OH)2 Compound", "Li2CO3CaOH2", Utils.rgbtoHexValue(255, 255, 255))[
+ 0]; // https://en.wikipedia.org/wiki/Calcium_carbonate
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(FLUORIDES.SODIUM_FLUORIDE, false);
+ // FLiBe Fuel Compounds
+ dustLi2BeF4 = ItemUtils.generateSpecialUseDusts(
+ "Li2BeF4", "Lithium Tetrafluoroberyllate Fuel Compound", "Li2BeF4", Utils.rgbtoHexValue(255, 255, 255))[
+ 0]; // https://en.wikipedia.org/wiki/FLiBe
+ Material.registerComponentForMaterial(NUCLIDE.Li2BeF4, OrePrefixes.dust, ItemUtils.getSimpleStack(dustLi2BeF4));
+ // fluidFLiBeSalt = ("Li2BeF4", "Li2BeF4", 7430, new short[]{255, 255, 255, 100}, 0);
+ // fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Lithium Tetrafluoroberyllate", new short[]{255,
+ // 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true);
+ // fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50,
+ // 100}, 0, 743, null, CI.emptyCells(1), 1000, true);
+
+ // LFTR Core Fluid Processing
+ // fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100},
+ // 0, 800, null, CI.emptyCells(1), 1000, true);
+ // fluidLftrCore2 = FluidUtils.addGTFluidNoPrefix("UF6F2FP", "UF6F2FP", new short[]{150, 255, 150, 100}, 0, 800,
+ // null, CI.emptyCells(1), 1000, true);
+ // fluidLftrCore3 = FluidUtils.addGTFluidNoPrefix("LiFBeF2", "LiFBeF2", new short[]{100, 255, 50, 100}, 0, 800,
+ // null, CI.emptyCells(1), 1000, true);
+ // fluidLftrCore4 = FluidUtils.addGTFluidNoPrefix("LiFBeF2UF4", "LiFBeF2UF4", new short[]{50, 255, 100, 100}, 0,
+ // 800, null, CI.emptyCells(1), 1000, true);
+ // LFTR Blanket Fluid Processing
+ // fluidLftrBlanket1 = FluidUtils.addGTFluidNoPrefix("LiFThF4", "LiFThF4", new short[]{50, 150, 255, 50}, 0,
+ // 500, null, CI.emptyCells(1), 1000, true);
+ // fluidLftrBlanket2 = FluidUtils.addGTFluidNoPrefix("LiFBeF2ThF4", "LiFBeF2ThF4", new short[]{100, 150, 100,
+ // 100}, 0, 500, null, CI.emptyCells(1), 1000, true);
+ // fluidLftrBlanket3 = FluidUtils.addGTFluidNoPrefix("UF6F2", "UF6F2", new short[]{10, 150, 10, 100}, 0, 500,
+ // null, CI.emptyCells(1), 1000, true);
+ fluidNuclearWaste = FluidUtils.addGTFluidNoPrefix(
+ "nuclear.waste",
+ "Nuclear Waste",
+ new short[] {10, 250, 10, 100},
+ 0,
+ 1000,
+ null,
+ CI.emptyCells(1),
+ 1000,
+ true);
+
+ // LFTR Control Circuit
+ itemCircuitLFTR = new CoreItem(
+ "itemCircuitLFTR",
+ "" + EnumChatFormatting.GREEN + "Control Circuit",
+ AddToCreativeTab.tabMisc,
+ 1,
+ 0,
+ new String[] {"Keeps Multiblocks Stable"},
+ EnumRarity.epic,
+ EnumChatFormatting.DARK_GREEN,
+ false,
+ null);
+
+ if (CORE.ConfigSwitches.enableMachine_Pollution) {
+ itemBasicTurbine = new ItemBasicScrubberTurbine();
+ }
+
+ // Zirconium
+ // Cinter Pellet.
+ itemZirconiumChlorideCinterPellet = new CoreItem(
+ "itemZirconiumPellet", "Zirconium Pellet [" + StringUtils.subscript("ZrCl4") + "]", tabMisc)
+ .setTextureName(CORE.MODID + ":itemShard");
+ GT_OreDictUnificator.registerOre("pelletZirconium", new ItemStack(itemZirconiumChlorideCinterPellet));
+ // Zirconium Chloride
+ dustZrCl4 = ItemUtils.generateSpecialUseDusts("ZrCl4", "ZrCl4", "ZrCl4", Utils.rgbtoHexValue(180, 180, 180))[
+ 0]; // http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/39/036/39036750.pdf
+ dustCookedZrCl4 = ItemUtils.generateSpecialUseDusts(
+ "CookedZrCl4", "Cooked ZrCl4", "ZrCl4", Utils.rgbtoHexValue(180, 180, 180))[
+ 0]; // http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/39/036/39036750.pdf
+
+ // Zirconium Tetrafluoride
+ /*GT_OreDictUnificator.registerOre("cellZrF4", ItemUtils.getItemStackOfAmountFromOreDict("cellZirconiumTetrafluoride", 1));
+ GT_OreDictUnificator.registerOre("dustZrF4", ItemUtils.getItemStackOfAmountFromOreDict("dustZirconiumTetrafluoride", 1));*/
+ // GT_OreDictUnificator.registerOre("cellZrF4",
+ // ItemUtils.getItemStackOfAmountFromOreDict("cellZirconiumTetrafluoride", 1));
+ // GT_OreDictUnificator.registerOre("dustZrF4",
+ // ItemUtils.getItemStackOfAmountFromOreDict("dustZirconiumTetrafluoride", 1));
+ fluidZrF4 = FluidUtils.generateFluidNoPrefix(
+ "ZirconiumTetrafluoride", "Zirconium Tetrafluoride", 500, new short[] {170, 170, 140, 100
+ }); // https://en.wikipedia.org/wiki/Zirconium_tetrafluoride
+ FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.setFluid(fluidZrF4);
+
+ // Coolant Salt
+ // NaBF4 - NaF - 621C
+ // dustNaBF4NaF = ItemUtils.generateSpecialUseDusts("NaBF4NaF", "NaBF4NaF", Utils.rgbtoHexValue(45, 45, 90))[0];
+ // //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride
+
+ // Load Tree Farmer
+ if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer) { // https://en.wikipedia.org/wiki/UAN
+ dustFertUN18 = ItemUtils.generateSpecialUseDusts(
+ "UN18Fertiliser", "UN-18 Fertiliser", Utils.rgbtoHexValue(60, 155, 60))[0];
+ dustFertUN32 = ItemUtils.generateSpecialUseDusts(
+ "UN32Fertiliser", "UN-32 Fertiliser", Utils.rgbtoHexValue(55, 190, 55))[0];
+
+ ItemStack temp1 = null;
+ ItemStack temp2 = null;
+
+ if (LoadedMods.IndustrialCraft2) {
+ temp1 = ItemUtils.getCorrectStacktype("IC2:itemFertilizer", 1);
+ }
+ if (LoadedMods.Forestry) {
+ temp2 = ItemUtils.getCorrectStacktype("Forestry:fertilizerCompound", 1);
+ }
+ if (temp1 != null) {
+ fluidFertBasic = FluidUtils.generateFluidNonMolten(
+ "Fertiliser", "Fertiliser", 32, new short[] {45, 170, 45, 100}, temp1, null, true);
+ GT_Values.RA.addFluidExtractionRecipe(temp2, null, new FluidStack(fluidFertBasic, 36), 10000, 5, 16);
+ }
+ fluidFertUN32 = FluidUtils.generateFluidNonMolten(
+ "UN32Fertiliser", "UN-32 Fertiliser", 24, new short[] {55, 190, 55, 100}, null, null, true);
+ fluidFertUN18 = FluidUtils.generateFluidNonMolten(
+ "UN18Fertiliser", "UN-18 Fertiliser", 22, new short[] {60, 155, 60, 100}, null, null, true);
+
+ /*GT_Values.RA.addMixerRecipe(
+ arg0, //Item In
+ arg1,
+ arg2,
+ arg3,
+ arg4, //Fluid in
+ arg5, //Fluid Out
+ arg6, //Item out
+ arg7, //Eu
+ arg8); //Time
+ */
+
+ }
+
+ // Juice
+ FluidUtils.generateFluidNonMolten(
+ "RaisinJuice",
+ "Raisin Juice",
+ 2,
+ new short[] {51, 0, 51, 100},
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foodRaisins", 1),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("fruitRaisins", 1),
+ 50,
+ true);
+
+ // Test items
+ metaItem2 = new BaseEuItem();
+ metaItem2.registerItem(0, EnumChatFormatting.BLACK + "Test Item 0", 0, 0, "I am 0.");
+ metaItem2.registerItem(1, EnumChatFormatting.GREEN + "Test Item 1", 1006346000, 1, "I Hold EU 1.", 500);
+ metaItem2.registerItem(2, EnumChatFormatting.GOLD + "Test Item 2", 1004630000, 2, "I Hold EU 2.", 8000);
+ metaItem2.registerItem(3, "Test Item 3", 1000765000, 4, "I Hold EU 3.", 32000);
+ metaItem2.registerItem(
+ 4,
+ "Whirlygig",
+ 1043644000,
+ (short) 5,
+ "Spin me right round.",
+ EnumRarity.rare,
+ EnumChatFormatting.DARK_GREEN,
+ true);
+ metaItem2.registerItem(
+ 5,
+ "Whirlygig 2",
+ 2124867000,
+ (short) 7,
+ "Spin me right round.",
+ EnumRarity.uncommon,
+ EnumChatFormatting.RED,
+ true);
+
+ toolGregtechPump = new GregtechPump();
+ toolGregtechPump.registerPumpType(0, "Simple Hand Pump", 0, 0);
+ toolGregtechPump.registerPumpType(1, "Advanced Hand Pump", 32000, 1);
+ toolGregtechPump.registerPumpType(2, "Super Hand Pump", 128000, 2);
+ toolGregtechPump.registerPumpType(3, "Ultimate Hand Pump", 512000, 3);
+
+ // Create Multi-tools
+ // ItemsMultiTools.load();
+
+ // Xp Fluids - Dev
+ if (!FluidRegistry.isFluidRegistered("mobessence")) {
+ FluidUtils.generateFluidNoPrefix("mobessence", "mobessence", 0, new short[] {125, 175, 125, 100});
+ }
+ if (!FluidRegistry.isFluidRegistered("xpjuice")) {
+ FluidUtils.generateFluidNoPrefix("xpjuice", "xpjuice", 0, new short[] {50, 150, 50, 100});
+ }
+
+ // Industrial Diamonds
+ itemExquisiteIndustrialDiamond =
+ new CoreItem("IndustrialDiamondExquisite", "High Quality Industrial Diamond", tabMisc);
+ ItemStack tempStack = itemExquisiteIndustrialDiamond.getStack();
+ ItemUtils.addItemToOreDictionary(tempStack, "gemDiamond");
+ ItemUtils.addItemToOreDictionary(tempStack, "craftingIndustrialDiamond");
+ ItemUtils.addItemToOreDictionary(tempStack, "gemExquisiteDiamond");
+ ItemUtils.addItemToOreDictionary(tempStack, "craftingExquisiteIndustrialDiamond");
+
+ /*
+ * Decayable Materials
+ */
+
+ dustNeptunium238 = new DustDecayable(
+ "dustNeptunium238",
+ Utils.rgbtoHexValue(175, 240, 75),
+ 50640,
+ new String[] {
+ "" + StringUtils.superscript("238Np"),
+ "Result: Plutonium 238 (" + StringUtils.superscript("238Pu") + ")"
+ },
+ ELEMENT.getInstance().PLUTONIUM238.getDust(1).getItem(),
+ 5);
+ dustDecayedRadium226 = ItemUtils.generateSpecialUseDusts(
+ "DecayedRadium226",
+ "Decayed Radium-226",
+ "Contains Radon (" + StringUtils.superscript("222Rn") + ")",
+ ELEMENT.getInstance().RADIUM.getRgbAsHex())[0];
+ dustRadium226 = new DustDecayable(
+ "dustRadium226",
+ ELEMENT.getInstance().RADIUM.getRgbAsHex(),
+ 90000,
+ new String[] {
+ "" + StringUtils.superscript("226Ra"), "Result: Radon (" + StringUtils.superscript("222Rn") + ")"
+ },
+ ItemUtils.getSimpleStack(dustDecayedRadium226).getItem(),
+ 5);
+ dustProtactinium233 = new DustDecayable(
+ "dustProtactinium233",
+ ELEMENT.getInstance().PROTACTINIUM.getRgbAsHex(),
+ 32000,
+ new String[] {
+ "" + StringUtils.superscript("233Pa"),
+ "Result: Uranium 233(" + StringUtils.superscript("233U") + ")"
+ },
+ ELEMENT.getInstance().URANIUM233.getDust(1).getItem(),
+ 6);
+ dustTechnetium99 = new DustDecayable(
+ "dustTechnetium99",
+ ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(),
+ 164500,
+ new String[] {
+ "" + StringUtils.superscript("99Mo"),
+ "Result: Ruthenium 99(" + StringUtils.superscript("99Ru") + ")"
+ },
+ ELEMENT.getInstance().RUTHENIUM.getDust(1).getItem(),
+ 4);
+ dustTechnetium99M = new DustDecayable(
+ "dustTechnetium99M",
+ ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(),
+ 8570,
+ new String[] {
+ "" + StringUtils.superscript("99ᵐTc"),
+ "Result: Technicium 99 (" + StringUtils.superscript("99Tc") + ")"
+ },
+ dustTechnetium99,
+ 4);
+ dustMolybdenum99 = new DustDecayable(
+ "dustMolybdenum99",
+ ELEMENT.getInstance().MOLYBDENUM.getRgbAsHex(),
+ 16450,
+ new String[] {
+ "" + StringUtils.superscript("99Mo"),
+ "Result: Technicium 99ᵐ (" + StringUtils.superscript("99ᵐTc") + ")"
+ },
+ dustTechnetium99M,
+ 4);
+
+ itemIonParticleBase = new IonParticles();
+ itemStandarParticleBase = new StandardBaseParticles();
+
+ if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
+ Item a8kFlask =
+ VolumetricFlaskHelper.generateNewFlask("Volumetric_Flask_8k", "Large Volumetric Flask", 8000);
+ Item a64kFlask =
+ VolumetricFlaskHelper.generateNewFlask("Volumetric_Flask_32k", "Gigantic Volumetric Flask", 32000);
+ GregtechItemList.VOLUMETRIC_FLASK_8k.set(a8kFlask);
+ GregtechItemList.VOLUMETRIC_FLASK_32k.set(a64kFlask);
+ }
+
+ itemBoilerChassis = new ItemBoilerChassis();
+ itemDehydratorCoilWire = new ItemDehydratorCoilWire();
+ itemDehydratorCoil = new ItemDehydratorCoil();
+
+ itemAirFilter = new ItemAirFilter();
+ itemLavaFilter = new ItemLavaFilter();
+
+ itemGrindleTablet = new BaseItemGrindle();
+ itemDragonJar = new ItemEntityCatcher();
+
+ itemControlCore = new ItemControlCore();
+
+ itemSunnariumBit = new ItemSunnariumBit();
+
+ // Chemistry
+ new CoalTar();
+ new RocketFuels();
+
+ // Nuclear Processing
+ new NuclearChem();
+
+ // Farm Animal Fun
+ new AgriculturalChem();
+
+ // General Chemistry
+ new GenericChem();
+
+ // Milled Ore Processing
+ new MilledOreProcessing();
+
+ // Bombs
+ itemBombCasing = new CoreItem("itemBombCasing", "Bomb Casing", tabMisc);
+ itemBombCasing.setTextureName(CORE.MODID + ":bomb_casing");
+ itemBombUnf = new CoreItem("itemBombUnf", "Bomb (unf)", tabMisc);
+ itemBombUnf.setTextureName(CORE.MODID + ":bomb_casing");
+ itemDetCable = new CoreItem("itemDetCable", "Det. Cable", tabMisc);
+ itemDetCable.setTextureName("string");
+ itemBomb = new ItemThrowableBomb();
+
+ // Only used for debugging.
+ /*if (CORE.DEVENV) {
+ new ConnectedBlockFinder();
+ }*/
+
+ // Misc Items
+ @SuppressWarnings("unused")
+ Item tI;
+ tI = new BaseItemMisc("Chilly", new short[] {0, 64, 196}, 32, MiscTypes.POTION, new String[] {"It's Blue"});
+ tI = new BaseItemMisc(
+ "4000DC's", new short[] {180, 100, 30}, 1, MiscTypes.BIGKEY, new String[] {"It opens things."});
+ tI = new BaseItemMisc("Dull", new short[] {64, 64, 64}, 64, MiscTypes.GEM, null);
+ tI = new BaseItemMisc("Forest", new short[] {130, 164, 96}, 64, MiscTypes.MUSHROOM, new String[] {
+ "You Found this on the ground.", "Definitely not sure if it's worth eating."
+ });
+
+ // Baubles
+ if (LoadedMods.Baubles) {
+ tI = new HealthBoostBauble();
+ itemModularBauble = new ModularBauble();
+ }
+
+ // EnderIO Resources
+ if ((LoadedMods.EnderIO || LOAD_ALL_CONTENT)) {
+ Logger.INFO("EnderIO Found - Loading Resources.");
+ // Enderio Dusts
+ itemDustSoularium = ItemUtils.generateSpecialUseDusts(
+ "Soularium",
+ "Soularium",
+ MaterialEIO.SOULARIUM.vChemicalFormula,
+ MaterialEIO.SOULARIUM.getRgbAsHex())[0];
+ itemDustRedstoneAlloy = ItemUtils.generateSpecialUseDusts(
+ "RedstoneAlloy",
+ "Redstone Alloy",
+ MaterialEIO.REDSTONE_ALLOY.vChemicalFormula,
+ MaterialEIO.REDSTONE_ALLOY.getRgbAsHex())[0];
+ itemDustElectricalSteel = ItemUtils.generateSpecialUseDusts(
+ "ElectricalSteel",
+ "Electrical Steel",
+ MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula,
+ MaterialEIO.ELECTRICAL_STEEL.getRgbAsHex())[0];
+ itemDustPulsatingIron = ItemUtils.generateSpecialUseDusts(
+ "PulsatingIron",
+ "Pulsating Iron",
+ MaterialEIO.PULSATING_IRON.vChemicalFormula,
+ MaterialEIO.PULSATING_IRON.getRgbAsHex())[0];
+ itemDustEnergeticAlloy = ItemUtils.generateSpecialUseDusts(
+ "EnergeticAlloy",
+ "Energetic Alloy",
+ MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula,
+ MaterialEIO.ENERGETIC_ALLOY.getRgbAsHex())[0];
+ itemDustVibrantAlloy = ItemUtils.generateSpecialUseDusts(
+ "VibrantAlloy",
+ "Vibrant Alloy",
+ MaterialEIO.VIBRANT_ALLOY.vChemicalFormula,
+ MaterialEIO.VIBRANT_ALLOY.getRgbAsHex())[0];
+ itemDustConductiveIron = ItemUtils.generateSpecialUseDusts(
+ "ConductiveIron",
+ "Conductive Iron",
+ MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula,
+ MaterialEIO.CONDUCTIVE_IRON.getRgbAsHex())[0];
+
+ // EnderIO Plates
+ itemPlateSoularium = ItemUtils.generateSpecialUsePlate(
+ "Soularium",
+ "Soularium",
+ MaterialEIO.SOULARIUM.vChemicalFormula,
+ MaterialEIO.SOULARIUM.getRgbAsHex(),
+ 0);
+ itemPlateRedstoneAlloy = ItemUtils.generateSpecialUsePlate(
+ "RedstoneAlloy",
+ "Redstone Alloy",
+ MaterialEIO.REDSTONE_ALLOY.vChemicalFormula,
+ MaterialEIO.REDSTONE_ALLOY.getRgbAsHex(),
+ 0);
+ itemPlateElectricalSteel = ItemUtils.generateSpecialUsePlate(
+ "ElectricalSteel",
+ "Electrical Steel",
+ MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula,
+ MaterialEIO.ELECTRICAL_STEEL.getRgbAsHex(),
+ 0);
+ itemPlatePulsatingIron = ItemUtils.generateSpecialUsePlate(
+ "PhasedIron",
+ "Phased Iron",
+ MaterialEIO.PULSATING_IRON.vChemicalFormula,
+ MaterialEIO.PULSATING_IRON.getRgbAsHex(),
+ 0);
+ itemPlateEnergeticAlloy = ItemUtils.generateSpecialUsePlate(
+ "EnergeticAlloy",
+ "Energetic Alloy",
+ MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula,
+ MaterialEIO.ENERGETIC_ALLOY.getRgbAsHex(),
+ 0);
+ itemPlateVibrantAlloy = ItemUtils.generateSpecialUsePlate(
+ "VibrantAlloy",
+ "Vibrant Alloy",
+ MaterialEIO.VIBRANT_ALLOY.vChemicalFormula,
+ MaterialEIO.VIBRANT_ALLOY.getRgbAsHex(),
+ 0);
+ itemPlateConductiveIron = ItemUtils.generateSpecialUsePlate(
+ "ConductiveIron",
+ "Conductive Iron",
+ MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula,
+ MaterialEIO.CONDUCTIVE_IRON.getRgbAsHex(),
+ 0);
+
+ // Register dumb naming conventions - Who chose fucking phased Iron/Gold?
+ GT_OreDictUnificator.registerOre("dustPhasedGold", ItemUtils.getSimpleStack(itemDustVibrantAlloy));
+ GT_OreDictUnificator.registerOre("platePhasedGold", ItemUtils.getSimpleStack(itemPlateVibrantAlloy));
+ GT_OreDictUnificator.registerOre("dustPhasedIron", ItemUtils.getSimpleStack(itemDustPulsatingIron));
+ GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron));
+ GT_OreDictUnificator.registerOre(
+ "blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1));
+
+ CORE.RA.addFluidExtractionRecipe(
+ MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4 * 9);
+ CORE.RA.addFluidExtractionRecipe(
+ MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4 * 9);
+ CORE.RA.addFluidExtractionRecipe(
+ MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(16), 16, 4);
+ CORE.RA.addFluidExtractionRecipe(
+ MaterialEIO.REDSTONE_ALLOY.getBlock(1),
+ MaterialEIO.REDSTONE_ALLOY.getFluidStack(1294),
+ 16,
+ 4 * 9 * 9);
+
+ } else {
+ /*Logger.WARNING("EnderIO not Found - Generating our own Resources.");
+ MaterialGenerator.generate(MaterialEIO.CONDUCTIVE_IRON);
+ MaterialGenerator.generate(MaterialEIO.PULSATING_IRON);
+ MaterialGenerator.generate(MaterialEIO.REDSTONE_ALLOY);
+ MaterialGenerator.generate(MaterialEIO.SOULARIUM);
+ MaterialGenerator.generate(MaterialEIO.ELECTRICAL_STEEL);
+ MaterialGenerator.generate(MaterialEIO.ENERGETIC_ALLOY);
+ MaterialGenerator.generate(MaterialEIO.VIBRANT_ALLOY); */
+ }
+
+ // Big Reactors
+ if (LoadedMods.Big_Reactors || LOAD_ALL_CONTENT) {
+ Logger.INFO("BigReactors Found - Loading Resources.");
+ // Item Init
+ itemPlateBlutonium =
+ ItemUtils.generateSpecialUsePlate("Blutonium", "Blutonium", new short[] {0, 0, 255}, 0);
+ itemPlateCyanite = ItemUtils.generateSpecialUsePlate("Cyanite", "Cyanite", new short[] {0, 191, 255}, 0);
+ itemPlateLudicrite =
+ ItemUtils.generateSpecialUsePlate("Ludicrite", "Ludicrite", new short[] {167, 5, 179}, 0);
+ } else {
+ Logger.WARNING("BigReactors not Found - Skipping Resources.");
+ }
+
+ // Thaumcraft
+ if ((LoadedMods.Thaumcraft || LOAD_ALL_CONTENT) && !CORE.GTNH) {
+ Logger.INFO("Thaumcraft Found - Loading Resources.");
+ // Item Init
+ try {
+ ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16);
+ itemPlateVoidMetal = ItemUtils.generateSpecialUsePlate("Void", "Void", new short[] {82, 17, 82}, 0);
+ GT_OreDictUnificator.registerOre("plateVoidMetal", new ItemStack(ModItems.itemPlateVoidMetal));
+ } catch (final NullPointerException e) {
+ }
+
+ } else {
+ Logger.WARNING("Thaumcraft not Found - Skipping Resources.");
+ }
+
+ // Pneumaticraft
+ if (LoadedMods.PneumaticCraft || LOAD_ALL_CONTENT) {
+ Logger.INFO("PneumaticCraft Found - Loading Resources.");
+ // Item Init
+ itemPlateCompressedIron = ItemUtils.generateSpecialUsePlate(
+ "CompressedIron", "Compressed Iron", new short[] {128, 128, 128}, 0);
+ } else {
+ Logger.WARNING("PneumaticCraft not Found - Skipping Resources.");
+ }
+
+ // Simply Jetpacks
+ if (LoadedMods.Simply_Jetpacks || LOAD_ALL_CONTENT) {
+ Logger.INFO("SimplyJetpacks Found - Loading Resources.");
+ // Item Init
+ itemPlateEnrichedSoularium = new RarityUncommon()
+ .setUnlocalizedName("itemPlateEnrichedSoularium")
+ .setCreativeTab(AddToCreativeTab.tabMisc)
+ .setTextureName(CORE.MODID + ":itemPlateSoularium");
+ // Registry
+ GameRegistry.registerItem(itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium");
+ } else {
+ Logger.WARNING("SimplyJetpacks not Found - Skipping Resources.");
+ }
+
+ // rfTools
+ if (LoadedMods.RFTools || LOAD_ALL_CONTENT) {
+ Logger.INFO("rfTools Found - Loading Resources.");
+ // Item Init
+ itemPlateDimensionShard = ItemUtils.generateSpecialUsePlate(
+ "DimensionShard", "Dimensional Shard", new short[] {170, 230, 230}, 0);
+ } else {
+ Logger.WARNING("rfTools not Found - Skipping Resources.");
+ }
+
+ // IC2 Exp
+ if (LoadedMods.IndustrialCraft2 || LOAD_ALL_CONTENT) {
+ Logger.INFO("IndustrialCraft2 Found - Loading Resources.");
+
+ // Baubles Mod Test
+ try {
+ final Class<?> baublesTest = ReflectionUtils.getClass("baubles.api.IBauble");
+ if (baublesTest != null) {
+ COMPAT_Baubles.run();
+ } else {
+ Logger.INFO("Baubles Not Found - Skipping Resources.");
+ }
+ } catch (final Throwable T) {
+ Logger.INFO("Baubles Not Found - Skipping Resources.");
+ }
+ } else {
+ Logger.WARNING("IndustrialCraft2 not Found - Skipping Resources.");
+ }
+
+ // Special Item Handling Case
+ if (ConfigSwitches.enableAlternativeBatteryAlloy) {
+ // ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new
+ // short[]{35, 228, 141}, 0); TODO
+ ModItems.itemPlateBatteryAlloy =
+ ItemUtils.generateSpecialUsePlate("BatteryAlloy", "Battery Alloy", new short[] {35, 228, 141}, 0);
+ }
+
+ // UtilsItems.generateSpawnEgg("ic2", "boatcarbon", Utils.generateSingularRandomHexValue(),
+ // Utils.generateSingularRandomHexValue());
+
+ HANDLER_COFH.initItems();
+
+ /*
+ * Misc Items
+ */
+
+ // Staballoy Equipment
+ itemStaballoyPickaxe =
+ new StaballoyPickaxe("itemStaballoyPickaxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(itemStaballoyPickaxe, itemStaballoyPickaxe.getUnlocalizedName());
+ itemStaballoyAxe = new StaballoyAxe("itemStaballoyAxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(itemStaballoyAxe, itemStaballoyAxe.getUnlocalizedName());
+
+ // Sandstone Hammer
+ itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer").setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(itemSandstoneHammer, itemSandstoneHammer.getUnlocalizedName());
+
+ // Buffer Cores!
+ Item itemBufferCore;
+ for (int i = 1; i <= 10; i++) {
+ // Utils.LOG_INFO(""+i);
+ itemBufferCore = new BufferCore("itemBufferCore", i).setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerItem(itemBufferCore, itemBufferCore.getUnlocalizedName());
+ // System.out.println("Buffer Core registration count is: "+i);
+ }
+
+ itemPLACEHOLDER_Circuit = new Item()
+ .setUnlocalizedName("itemPLACEHOLDER_Circuit")
+ .setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit");
+ GameRegistry.registerItem(itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit");
+
+ // ItemBlockGtFrameBox = new ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1);
+ // GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1");
+
+ itemCustomBook = new ItemBaseBook();
+ registerCustomTokens();
+ }
+
+ public static void registerCustomTokens() {
+ itemGenericToken.register(0, "BitCoin", 16, "Can be used on the dark web");
+ itemGenericToken.register(1, "Hand Pump Trade Token I", 1, "Craft into a Tier I Hand pump");
+ itemGenericToken.register(2, "Hand Pump Trade Token II", 1, "Craft into a Tier II Hand pump");
+ itemGenericToken.register(3, "Hand Pump Trade Token III", 1, "Craft into a Tier III Hand pump");
+ itemGenericToken.register(4, "Hand Pump Trade Token IV", 1, "Craft into a Tier IV Hand pump");
+ }
+
+ public static void registerCustomMaterialComponents() {
+ // Custom GT++ Crafting Components
+
+ /**
+ * Try generate dusts for missing rare earth materials if they don't exist
+ */
+ if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGadolinium", 1))) {
+ ItemUtils.generateSpecialUseDusts(
+ "Gadolinium", "Gadolinium", Materials.Gadolinium.mElement.name(), Utils.rgbtoHexValue(226, 172, 9));
+ }
+ if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustYtterbium", 1))) {
+ ItemUtils.generateSpecialUseDusts(
+ "Ytterbium",
+ "Ytterbium",
+ Materials.Ytterbium.mElement.name(),
+ Utils.rgbtoHexValue(
+ Materials.Yttrium.mRGBa[0] - 60,
+ Materials.Yttrium.mRGBa[1] - 60,
+ Materials.Yttrium.mRGBa[2] - 60));
+ }
+ if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSamarium", 1))) {
+ ItemUtils.generateSpecialUseDusts(
+ "Samarium", "Samarium", Materials.Samarium.mElement.name(), Utils.rgbtoHexValue(161, 168, 114));
+ }
+ if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustLanthanum", 1))) {
+ ItemUtils.generateSpecialUseDusts(
+ "Lanthanum", "Lanthanum", Materials.Lanthanum.mElement.name(), Utils.rgbtoHexValue(106, 127, 163));
+ }
+ if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGermanium", 1))) {
+ ItemUtils.generateSpecialUseDusts(
+ "Germanium",
+ "Germanium",
+ "Ge",
+ ELEMENT.getInstance().GERMANIUM.getRgbAsHex());
+ }
+
+ // Just an unusual plate needed for some black magic.
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateClay", 1) == null) {
+ itemPlateClay = new BaseItemPlate(NONMATERIAL.CLAY);
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleClay", 1) == null) {
+ itemDoublePlateClay = new BaseItemPlateDouble(NONMATERIAL.CLAY);
+ }
+
+ // Need this for Mutagenic Frames
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilUranium235", 1) == null) {
+ itemFoilUranium235 = new BaseItemFoil(ELEMENT.getInstance().URANIUM235);
+ }
+
+ // A small gear needed for wizardry.
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gearGtSmallWroughtIron", 1) == null) {
+ itemSmallWroughtIronGear = new BaseItemSmallGear(NONMATERIAL.WROUGHT_IRON);
+ }
+ // Krypton Processing
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1) == null) {
+ itemHotTitaniumIngot = ItemUtils.getSimpleStack(
+ new BaseItemIngot(ELEMENT.getInstance().TITANIUM, ComponentTypes.HOTINGOT));
+ } else {
+ itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1);
+ }
+
+ // Need this for Laurenium
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIndium", 1) == null) {
+ itemDustIndium = new BaseItemDust(ELEMENT.getInstance().INDIUM);
+ }
+
+ // Springs
+ MaterialUtils.generateComponentAndAssignToAMaterial(
+ ComponentTypes.SPRING, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ELEMENT.STANDALONE.WHITE_METAL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.NITINOL_60);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.AQUATIC_STEEL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.EGLIN_STEEL);
+
+ // Small Springs
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.MARAGING250);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.NICHROME);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STABALLOY);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STEEL_BLACK);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.BLACK_TITANIUM);
+
+ // Fine Wire
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.STANDALONE.WHITE_METAL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().PALLADIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().ZIRCONIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.LEAGRISIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.BABBIT_ALLOY);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.KOBOLDITE);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.HG1223);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.QUANTUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.STANDALONE.HYPOGEN);
+
+ // Foil
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.BLACK_TITANIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.BOTMIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.TITANSTEEL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.NITINOL_60);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.QUANTUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.LAURENIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.HYPOGEN);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.ASTRAL_TITANIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.RHUGNOR);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.WHITE_METAL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.ADVANCED_NITINOL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.PIKYONIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.CINOBITE);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.LAFIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.TRINIUM_REINFORCED_STEEL);
+
+ // Dense Plates
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.POTIN);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.AQUATIC_STEEL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.BRONZE);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.OSMIRIDIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.QUANTUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STEEL_BLACK);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STAINLESS_STEEL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.EGLIN_STEEL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.MARAGING300);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.TALONITE);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.HYPOGEN);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.RHUGNOR);
+ MaterialUtils.generateComponentAndAssignToAMaterial(
+ ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ADVANCED_NITINOL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(
+ ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ASTRAL_TITANIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(
+ ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.WHITE_METAL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.BLACK_METAL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.GRANITE);
+
+ // Special Sillyness
+ if (true) {
+
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateSodium", 1) == null) {
+ new BaseItemPlate(ELEMENT.getInstance().SODIUM);
+ }
+
+ Material meatRaw = NONMATERIAL.MEAT;
+ // A plate of Meat.
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateMeatRaw", 1) == null) {
+ itemPlateRawMeat = new BaseItemPlate(meatRaw);
+ ItemUtils.registerFuel(ItemUtils.getSimpleStack(itemPlateRawMeat), 100);
+ }
+ // A Block of Meat.
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("blockMeatRaw", 1) == null) {
+ blockRawMeat = new BlockBaseModular(meatRaw, BlockTypes.STANDARD);
+ ItemUtils.registerFuel(ItemUtils.getSimpleStack(blockRawMeat), 900);
+ }
+ }
+
+ // A plate of Vanadium.
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateVanadium", 1) == null) {
+ itemPlateVanadium = new BaseItemPlate(ELEMENT.getInstance().VANADIUM);
+ }
+
+ // A plate of Lithium.
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateLithium", 1) == null) {
+ itemPlateLithium = new BaseItemPlate(ELEMENT.getInstance().LITHIUM);
+ }
+
+ // A plate of Europium.
+ if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateEuropium", 1) == null)
+ && CORE.ConfigSwitches.enableCustom_Pipes) {
+ itemPlateEuropium = new BaseItemPlate(ELEMENT.getInstance().EUROPIUM);
+ }
+ if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleEuropium", 1) == null)
+ && CORE.ConfigSwitches.enableCustom_Pipes) {
+ itemDoublePlateEuropium = new BaseItemPlateDouble(ELEMENT.getInstance().EUROPIUM);
+ }
+
+ // Tumbaga Mix (For Simple Crafting)
+ dustTumbagaMix = ItemUtils.generateSpecialUseDusts(
+ "MixTumbaga", "Tumbaga Mix", "Au2Cu", Utils.rgbtoHexValue(255, 150, 80))[0];
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseEuItem.java b/src/main/java/gtPlusPlus/core/item/base/BaseEuItem.java
index b4988136c0..a1bd29aa65 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseEuItem.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseEuItem.java
@@ -2,24 +2,9 @@ package gtPlusPlus.core.item.base;
import static gregtech.api.enums.GT_Values.*;
-import java.util.*;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.item.EnumRarity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.IIcon;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.SubTag;
@@ -28,555 +13,649 @@ import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.interfaces.IItemContainer;
import gregtech.api.objects.ItemData;
import gregtech.api.util.*;
-
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import ic2.api.item.*;
+import java.util.*;
+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.inventory.Container;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
public class BaseEuItem extends Item implements ISpecialElectricItem, IElectricItemManager {
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- private final HashMap<Short, ArrayList<IItemBehaviour<BaseEuItem>>> mItemBehaviors = new HashMap<>();
- public final short mOffset, mItemAmount;
- public final BitSet mEnabledItems;
- public final BitSet mVisibleItems;
- public final IIcon[][] mIconList;
- /** The unlocalized name of this item. */
- private String unlocalizedName;
-
- private final ArrayList<Pair<Integer, EnumRarity>> rarity = new ArrayList<>();
- private final ArrayList<Pair<Integer, EnumChatFormatting>> descColour = new ArrayList<>();
- private final ArrayList<Pair<Integer, String>> itemName = new ArrayList<>();
- private final ArrayList<Pair<Integer, String>> itemDescription = new ArrayList<>();
- private final ArrayList<Pair<Integer, Boolean>> hasEffect = new ArrayList<>();
-
- public final HashMap<Short, Long[]> mElectricStats = new HashMap<>();
- public final HashMap<Short, Short> mBurnValues = new HashMap<>();
-
- public BaseEuItem() {
- this("MU-metaitem.02", AddToCreativeTab.tabOther, (short) 1000, (short) 31766);
- }
-
- public BaseEuItem(final String unlocalizedName, final CreativeTabs creativeTab, final short aOffset, final short aItemAmount) {
- this.mEnabledItems = new BitSet(aItemAmount);
- this.mVisibleItems = new BitSet(aItemAmount);
- this.mOffset = (short) Math.min(32766, aOffset);
- this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset);
- this.mIconList = new IIcon[aItemAmount][1];
- this.setHasSubtypes(true);
- this.setMaxDamage(0);
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(creativeTab);
- this.setMaxStackSize(1);
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
-
- public void registerItem(final int id, final String localizedName, final long euStorage, final int tier, final String description) {
- this.registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common, EnumChatFormatting.GRAY, false);
- }
-
- public void registerItem(final int id, final String localizedName, final long euStorage, final int tier, final String description, final int burnTime) {
- this.registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common, EnumChatFormatting.GRAY, false);
- this.setBurnValue(id, burnTime);
- }
-
-
- public void registerItem(final int id, final String localizedName, final long euStorage, final short tier, final String description, final EnumRarity regRarity, final EnumChatFormatting colour, final boolean Effect) {
- this.addItem(id, localizedName, EnumChatFormatting.YELLOW+"Electric", new Object[]{});
- this.setElectricStats(this.mOffset + id, euStorage, GT_Values.V[tier], tier, -3L, true);
- this.rarity.add(new Pair<>(id, regRarity));
- this.itemName.add(new Pair<>(id, localizedName));
- this.itemDescription.add(new Pair<>(id, description));
- this.descColour.add(new Pair<>(id, colour));
- this.hasEffect.add(new Pair<>(id, Effect));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- if (this.rarity.get(par1ItemStack.getItemDamage()-this.mOffset) != null) {
- return this.rarity.get(par1ItemStack.getItemDamage()-this.mOffset).getValue();
- }
- return EnumRarity.common;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- if (this.hasEffect.get(par1ItemStack.getItemDamage()-this.mOffset) != null) {
- return this.hasEffect.get(par1ItemStack.getItemDamage()-this.mOffset).getValue();
- }
- return false;
- }
-
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList, final boolean aF3_H) {
- //aList.add("Meta: "+(aStack.getItemDamage()-mOffset));
- if ((this.descColour.get(aStack.getItemDamage()-this.mOffset) != null) && (this.itemDescription.get(aStack.getItemDamage()-this.mOffset) != null)) {
- aList.add(this.descColour.get(aStack.getItemDamage()-this.mOffset).getValue()+this.itemDescription.get(aStack.getItemDamage()-this.mOffset).getValue());
- }
- final String tKey = this.getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey);
- if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) {
- aList.add(tString);
- }
- final Long[] tStats = this.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 {
- final long tCharge = this.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] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY);
- }
- }
- }
- final ArrayList<IItemBehaviour<BaseEuItem>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final IItemBehaviour<BaseEuItem> tBehavior : tList) {
- aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
- }
- }
- }
-
-
- @Override
- public final Item getChargedItem(final ItemStack itemStack) {
- return this;
- }
-
- @Override
- public final Item getEmptyItem(final ItemStack itemStack) {
- return this;
- }
-
- @Override
- public final double getMaxCharge(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.abs(tStats[0]);
- }
-
- @Override
- public final double getTransferLimit(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.max(tStats[1], tStats[3]);
- }
-
- @Override
- public final int getTier(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
- }
-
- @Override
- public final double charge(final ItemStack aStack, final double aCharge, final int aTier, final boolean aIgnoreTransferLimit, final boolean aSimulate) {
- final Long[] tStats = this.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;
- }
- final long tChargeBefore = this.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) {
- this.setCharge(aStack, tNewCharge);
- }
- return tNewCharge - tChargeBefore;
- }
-
- @Override
- public final double discharge(final ItemStack aStack, final double aCharge, final int aTier, final boolean aIgnoreTransferLimit, final boolean aBatteryAlike, final boolean aSimulate) {
- final Long[] tStats = this.getElectricStats(aStack);
- if ((tStats == null) || (tStats[2] > aTier)) {
- return 0;
- }
- if (aBatteryAlike && !this.canProvideEnergy(aStack)) {
- return 0;
- }
- if (tStats[3] > 0) {
- if ((aCharge < tStats[3]) || (aStack.stackSize < 1)) {
- return 0;
- }
- if (!aSimulate) {
- aStack.stackSize--;
- }
- return tStats[3];
- }
- final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
- if (!aSimulate) {
- this.setCharge(aStack, tNewCharge);
- }
- return tChargeBefore - tNewCharge;
- }
-
- @Override
- public final double getCharge(final ItemStack aStack) {
- return this.getRealCharge(aStack);
- }
-
- @Override
- public final boolean canUse(final ItemStack aStack, final double aAmount) {
- return this.getRealCharge(aStack) >= aAmount;
- }
-
- @Override
- public final boolean use(final ItemStack aStack, final double aAmount, final EntityLivingBase aPlayer) {
- this.chargeFromArmor(aStack, aPlayer);
- if ((aPlayer instanceof EntityPlayer) && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) {
- return true;
- }
- final double tTransfer = this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
- if (tTransfer == aAmount) {
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return true;
- }
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return false;
- }
-
- @Override
- public final boolean canProvideEnergy(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return false;
- }
- return (tStats[3] > 0) || ((aStack.stackSize == 1) && ((tStats[3] == -2) || (tStats[3] == -3)));
- }
-
- @Override
- public final void chargeFromArmor(final ItemStack aStack, final EntityLivingBase aPlayer) {
- if ((aPlayer == null) || aPlayer.worldObj.isRemote) {
- return;
- }
- for (int i = 1; i < 5; i++) {
- final ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
- if (GT_ModHandler.isElectricItem(tArmor)) {
- final IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
- if (tArmorItem.canProvideEnergy(tArmor) && (tArmorItem.getTier(tArmor) >= this.getTier(aStack))) {
- final double tCharge = ElectricItem.manager.discharge(tArmor, this.charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, true, false);
- if (tCharge > 0) {
- this.charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
- if (aPlayer instanceof EntityPlayer) {
- final Container tContainer = ((EntityPlayer) aPlayer).openContainer;
- if (tContainer != null) {
- tContainer.detectAndSendChanges();
- }
- }
- }
- }
- }
- }
- }
-
- public final long getRealCharge(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- if (tStats[3] > 0) {
- return (int) (long) tStats[3];
- }
- final NBTTagCompound tNBT = aStack.getTagCompound();
- return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
- }
-
- public final boolean setCharge(final ItemStack aStack, long aCharge) {
- final Long[] tStats = this.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(this.getChargedMetaData(aStack));
- tNBT.setLong("GT.ItemCharge", aCharge);
- } else {
- aStack.setItemDamage(this.getEmptyMetaData(aStack));
- }
- if (tNBT.hasNoTags()) {
- aStack.setTagCompound(null);
- } else {
- aStack.setTagCompound(tNBT);
- }
- this.isItemStackUsable(aStack);
- return true;
- }
-
- public short getChargedMetaData(final ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
- public short getEmptyMetaData(final ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
-
- public boolean isItemStackUsable(final ItemStack aStack) {
- final ArrayList<IItemBehaviour<BaseEuItem>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final IItemBehaviour<BaseEuItem> tBehavior : tList) {
- if (!tBehavior.isItemStackUsable(this, aStack)) {
- return false;
- }
- }
- }
- return true;
- }
-
- @Override
- public final String getToolTip(final 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(final ItemStack aStack) {
- return this;
- } // We are our own Manager
-
- /**
- * 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 BaseEuItem setBurnValue(final int aMetaValue, final int aValue) {
- if ((aMetaValue < 0) || (aValue < 0)) {
- return this;
- }
- if (aValue == 0) {
- this.mBurnValues.remove((short) aMetaValue);
- } else {
- this.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 BaseEuItem setElectricStats(final int aMetaValue, final long aMaxCharge, final long aTransferLimit, final long aTier, final long aSpecialData, final boolean aUseAnimations) {
- if (aMetaValue < 0) {
- return this;
- }
- if (aMaxCharge == 0) {
- this.mElectricStats.remove((short) aMetaValue);
- } else {
- this.mElectricStats.put((short) aMetaValue, new Long[]{aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData});
- }
- return this;
- }
-
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
- for (int i = 0, j = this.mEnabledItems.length(); i < j; i++) {
- if (this.mVisibleItems.get(i) || (D1 && this.mEnabledItems.get(i))) {
- final Long[] tStats = this.mElectricStats.get((short) (this.mOffset + i));
- if ((tStats != null) && (tStats[3] < 0)) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.setCharge(tStack, Math.abs(tStats[0]));
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- if ((tStats == null) || (tStats[3] != -2)) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerIcons(final IIconRegister aIconRegister) {
- for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) {
- if (this.mEnabledItems.get(i)) {
- for (byte k = 1; k < this.mIconList[i].length; k++) {
- this.mIconList[i][k] = aIconRegister.registerIcon(CORE.MODID+":" + (this.getUnlocalizedName() + "/" + i + "/" + k));
- }
- this.mIconList[i][0] = aIconRegister.registerIcon(CORE.MODID+":" + (this.getUnlocalizedName() + "/" + i));
- }
- }
- }
-
-
- @Override
- public final IIcon getIconFromDamage(final int aMetaData) {
- if (aMetaData < 0) {
- return null;
- }
- return (aMetaData - this.mOffset) < this.mIconList.length ? this.mIconList[aMetaData - this.mOffset][0] : null;
- }
-
- /**
- * Sets the unlocalized name of this item to the string passed as the parameter"
- */
- @Override
- public Item setUnlocalizedName(final String p_77655_1_){
- this.unlocalizedName = p_77655_1_;
- super.setUnlocalizedName(p_77655_1_);
- return this;
- }
-
- /**
- * Returns the unlocalized name of this item.
- */
- @Override
- public String getUnlocalizedName()
- {
- return this.unlocalizedName;
- }
-
- public final Long[] getElectricStats(final ItemStack aStack) {
- return this.mElectricStats.get((short) aStack.getItemDamage());
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
- }
-
-
- /**
- * Adds a special Item Behaviour to the Item.
- * <p/>
- * 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 BaseEuItem addItemBehavior(final int aMetaValue, final IItemBehaviour<BaseEuItem> aBehavior) {
- if ((aMetaValue < 0) || (aMetaValue >= 32766) || (aBehavior == null)) {
- return this;
- }
- ArrayList<IItemBehaviour<BaseEuItem>> tList = this.mItemBehaviors.get((short) aMetaValue);
- if (tList == null) {
- tList = new ArrayList<>(1);
- this.mItemBehaviors.put((short) aMetaValue, tList);
- }
- tList.add(aBehavior);
- return 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.
- */
- @SuppressWarnings("unchecked")
- public final ItemStack addItem(final int aID, final String aEnglish, String aToolTip, final Object... aRandomData) {
- if (aToolTip == null) {
- aToolTip = "";
- }
- if ((aID >= 0) && (aID < this.mItemAmount)) {
- final ItemStack rStack = new ItemStack(this, 1, this.mOffset + aID);
- this.mEnabledItems.set(aID);
- this.mVisibleItems.set(aID);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip);
- final List<TC_AspectStack> tAspects = new ArrayList<>();
- // Important Stuff to do first
- for (final Object tRandomData : aRandomData) {
- if (tRandomData instanceof SubTag) {
- if (tRandomData == SubTag.INVISIBLE) {
- this.mVisibleItems.set(aID, false);
- continue;
- }
- if (tRandomData == SubTag.NO_UNIFICATION) {
- GT_OreDictUnificator.addToBlacklist(rStack);
- continue;
- }
- }
- }
- // now check for the rest
- for (final Object tRandomData : aRandomData) {
- if (tRandomData != null) {
- boolean tUseOreDict = true;
- if (tRandomData instanceof IItemBehaviour) {
- this.addItemBehavior(this.mOffset + aID, (IItemBehaviour<BaseEuItem>) 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;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack par1ItemStack) {
- int keyValue = (par1ItemStack.getItemDamage() - this.mOffset);
- if (keyValue < 0 || keyValue > 3) {
- keyValue = 0;
- }
- return this.itemName.get(keyValue).getValue();
- }
-
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+ private final HashMap<Short, ArrayList<IItemBehaviour<BaseEuItem>>> mItemBehaviors = new HashMap<>();
+ public final short mOffset, mItemAmount;
+ public final BitSet mEnabledItems;
+ public final BitSet mVisibleItems;
+ public final IIcon[][] mIconList;
+ /** The unlocalized name of this item. */
+ private String unlocalizedName;
+
+ private final ArrayList<Pair<Integer, EnumRarity>> rarity = new ArrayList<>();
+ private final ArrayList<Pair<Integer, EnumChatFormatting>> descColour = new ArrayList<>();
+ private final ArrayList<Pair<Integer, String>> itemName = new ArrayList<>();
+ private final ArrayList<Pair<Integer, String>> itemDescription = new ArrayList<>();
+ private final ArrayList<Pair<Integer, Boolean>> hasEffect = new ArrayList<>();
+
+ public final HashMap<Short, Long[]> mElectricStats = new HashMap<>();
+ public final HashMap<Short, Short> mBurnValues = new HashMap<>();
+
+ public BaseEuItem() {
+ this("MU-metaitem.02", AddToCreativeTab.tabOther, (short) 1000, (short) 31766);
+ }
+
+ public BaseEuItem(
+ final String unlocalizedName,
+ final CreativeTabs creativeTab,
+ final short aOffset,
+ final short aItemAmount) {
+ this.mEnabledItems = new BitSet(aItemAmount);
+ this.mVisibleItems = new BitSet(aItemAmount);
+ this.mOffset = (short) Math.min(32766, aOffset);
+ this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset);
+ this.mIconList = new IIcon[aItemAmount][1];
+ this.setHasSubtypes(true);
+ this.setMaxDamage(0);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(creativeTab);
+ this.setMaxStackSize(1);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ public void registerItem(
+ final int id, final String localizedName, final long euStorage, final int tier, final String description) {
+ this.registerItem(
+ id,
+ localizedName,
+ euStorage,
+ (short) tier,
+ description,
+ EnumRarity.common,
+ EnumChatFormatting.GRAY,
+ false);
+ }
+
+ public void registerItem(
+ final int id,
+ final String localizedName,
+ final long euStorage,
+ final int tier,
+ final String description,
+ final int burnTime) {
+ this.registerItem(
+ id,
+ localizedName,
+ euStorage,
+ (short) tier,
+ description,
+ EnumRarity.common,
+ EnumChatFormatting.GRAY,
+ false);
+ this.setBurnValue(id, burnTime);
+ }
+
+ public void registerItem(
+ final int id,
+ final String localizedName,
+ final long euStorage,
+ final short tier,
+ final String description,
+ final EnumRarity regRarity,
+ final EnumChatFormatting colour,
+ final boolean Effect) {
+ this.addItem(id, localizedName, EnumChatFormatting.YELLOW + "Electric", new Object[] {});
+ this.setElectricStats(this.mOffset + id, euStorage, GT_Values.V[tier], tier, -3L, true);
+ this.rarity.add(new Pair<>(id, regRarity));
+ this.itemName.add(new Pair<>(id, localizedName));
+ this.itemDescription.add(new Pair<>(id, description));
+ this.descColour.add(new Pair<>(id, colour));
+ this.hasEffect.add(new Pair<>(id, Effect));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ if (this.rarity.get(par1ItemStack.getItemDamage() - this.mOffset) != null) {
+ return this.rarity.get(par1ItemStack.getItemDamage() - this.mOffset).getValue();
+ }
+ return EnumRarity.common;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ if (this.hasEffect.get(par1ItemStack.getItemDamage() - this.mOffset) != null) {
+ return this.hasEffect
+ .get(par1ItemStack.getItemDamage() - this.mOffset)
+ .getValue();
+ }
+ return false;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList, final boolean aF3_H) {
+ // aList.add("Meta: "+(aStack.getItemDamage()-mOffset));
+ if ((this.descColour.get(aStack.getItemDamage() - this.mOffset) != null)
+ && (this.itemDescription.get(aStack.getItemDamage() - this.mOffset) != null)) {
+ aList.add(this.descColour.get(aStack.getItemDamage() - this.mOffset).getValue()
+ + this.itemDescription
+ .get(aStack.getItemDamage() - this.mOffset)
+ .getValue());
+ }
+ final String tKey = this.getUnlocalizedName(aStack) + ".tooltip",
+ tString = GT_LanguageManager.getTranslation(tKey);
+ if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) {
+ aList.add(tString);
+ }
+ final Long[] tStats = this.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 {
+ final long tCharge = this.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] < V.length ? tStats[2] : V.length - 1 : 1)]
+ + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+ final ArrayList<IItemBehaviour<BaseEuItem>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final IItemBehaviour<BaseEuItem> tBehavior : tList) {
+ aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
+ }
+ }
+ }
+
+ @Override
+ public final Item getChargedItem(final ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final Item getEmptyItem(final ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final double getMaxCharge(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ return Math.abs(tStats[0]);
+ }
+
+ @Override
+ public final double getTransferLimit(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ return Math.max(tStats[1], tStats[3]);
+ }
+
+ @Override
+ public final int getTier(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
+ }
+
+ @Override
+ public final double charge(
+ final ItemStack aStack,
+ final double aCharge,
+ final int aTier,
+ final boolean aIgnoreTransferLimit,
+ final boolean aSimulate) {
+ final Long[] tStats = this.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;
+ }
+ final long tChargeBefore = this.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) {
+ this.setCharge(aStack, tNewCharge);
+ }
+ return tNewCharge - tChargeBefore;
+ }
+
+ @Override
+ public final double discharge(
+ final ItemStack aStack,
+ final double aCharge,
+ final int aTier,
+ final boolean aIgnoreTransferLimit,
+ final boolean aBatteryAlike,
+ final boolean aSimulate) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if ((tStats == null) || (tStats[2] > aTier)) {
+ return 0;
+ }
+ if (aBatteryAlike && !this.canProvideEnergy(aStack)) {
+ return 0;
+ }
+ if (tStats[3] > 0) {
+ if ((aCharge < tStats[3]) || (aStack.stackSize < 1)) {
+ return 0;
+ }
+ if (!aSimulate) {
+ aStack.stackSize--;
+ }
+ return tStats[3];
+ }
+ final long tChargeBefore = this.getRealCharge(aStack),
+ tNewCharge =
+ Math.max(
+ 0,
+ tChargeBefore
+ - (aIgnoreTransferLimit
+ ? (long) aCharge
+ : Math.min(tStats[1], (long) aCharge)));
+ if (!aSimulate) {
+ this.setCharge(aStack, tNewCharge);
+ }
+ return tChargeBefore - tNewCharge;
+ }
+
+ @Override
+ public final double getCharge(final ItemStack aStack) {
+ return this.getRealCharge(aStack);
+ }
+
+ @Override
+ public final boolean canUse(final ItemStack aStack, final double aAmount) {
+ return this.getRealCharge(aStack) >= aAmount;
+ }
+
+ @Override
+ public final boolean use(final ItemStack aStack, final double aAmount, final EntityLivingBase aPlayer) {
+ this.chargeFromArmor(aStack, aPlayer);
+ if ((aPlayer instanceof EntityPlayer) && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) {
+ return true;
+ }
+ final double tTransfer = this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
+ if (tTransfer == aAmount) {
+ this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ this.chargeFromArmor(aStack, aPlayer);
+ return true;
+ }
+ this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ this.chargeFromArmor(aStack, aPlayer);
+ return false;
+ }
+
+ @Override
+ public final boolean canProvideEnergy(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return false;
+ }
+ return (tStats[3] > 0) || ((aStack.stackSize == 1) && ((tStats[3] == -2) || (tStats[3] == -3)));
+ }
+
+ @Override
+ public final void chargeFromArmor(final ItemStack aStack, final EntityLivingBase aPlayer) {
+ if ((aPlayer == null) || aPlayer.worldObj.isRemote) {
+ return;
+ }
+ for (int i = 1; i < 5; i++) {
+ final ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
+ if (GT_ModHandler.isElectricItem(tArmor)) {
+ final IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
+ if (tArmorItem.canProvideEnergy(tArmor) && (tArmorItem.getTier(tArmor) >= this.getTier(aStack))) {
+ final double tCharge = ElectricItem.manager.discharge(
+ tArmor,
+ this.charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true),
+ Integer.MAX_VALUE,
+ true,
+ true,
+ false);
+ if (tCharge > 0) {
+ this.charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
+ if (aPlayer instanceof EntityPlayer) {
+ final Container tContainer = ((EntityPlayer) aPlayer).openContainer;
+ if (tContainer != null) {
+ tContainer.detectAndSendChanges();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public final long getRealCharge(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ if (tStats[3] > 0) {
+ return (int) (long) tStats[3];
+ }
+ final NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
+ }
+
+ public final boolean setCharge(final ItemStack aStack, long aCharge) {
+ final Long[] tStats = this.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(this.getChargedMetaData(aStack));
+ tNBT.setLong("GT.ItemCharge", aCharge);
+ } else {
+ aStack.setItemDamage(this.getEmptyMetaData(aStack));
+ }
+ if (tNBT.hasNoTags()) {
+ aStack.setTagCompound(null);
+ } else {
+ aStack.setTagCompound(tNBT);
+ }
+ this.isItemStackUsable(aStack);
+ return true;
+ }
+
+ public short getChargedMetaData(final ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ public short getEmptyMetaData(final ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ public boolean isItemStackUsable(final ItemStack aStack) {
+ final ArrayList<IItemBehaviour<BaseEuItem>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final IItemBehaviour<BaseEuItem> tBehavior : tList) {
+ if (!tBehavior.isItemStackUsable(this, aStack)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public final String getToolTip(final 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(final ItemStack aStack) {
+ return this;
+ } // We are our own Manager
+
+ /**
+ * 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 BaseEuItem setBurnValue(final int aMetaValue, final int aValue) {
+ if ((aMetaValue < 0) || (aValue < 0)) {
+ return this;
+ }
+ if (aValue == 0) {
+ this.mBurnValues.remove((short) aMetaValue);
+ } else {
+ this.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 BaseEuItem setElectricStats(
+ final int aMetaValue,
+ final long aMaxCharge,
+ final long aTransferLimit,
+ final long aTier,
+ final long aSpecialData,
+ final boolean aUseAnimations) {
+ if (aMetaValue < 0) {
+ return this;
+ }
+ if (aMaxCharge == 0) {
+ this.mElectricStats.remove((short) aMetaValue);
+ } else {
+ this.mElectricStats.put(
+ (short) aMetaValue,
+ new Long[] {aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData});
+ }
+ return this;
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
+ for (int i = 0, j = this.mEnabledItems.length(); i < j; i++) {
+ if (this.mVisibleItems.get(i) || (D1 && this.mEnabledItems.get(i))) {
+ final Long[] tStats = this.mElectricStats.get((short) (this.mOffset + i));
+ if ((tStats != null) && (tStats[3] < 0)) {
+ final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
+ this.setCharge(tStack, Math.abs(tStats[0]));
+ this.isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ if ((tStats == null) || (tStats[3] != -2)) {
+ final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
+ this.isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerIcons(final IIconRegister aIconRegister) {
+ for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) {
+ if (this.mEnabledItems.get(i)) {
+ for (byte k = 1; k < this.mIconList[i].length; k++) {
+ this.mIconList[i][k] = aIconRegister.registerIcon(
+ CORE.MODID + ":" + (this.getUnlocalizedName() + "/" + i + "/" + k));
+ }
+ this.mIconList[i][0] =
+ aIconRegister.registerIcon(CORE.MODID + ":" + (this.getUnlocalizedName() + "/" + i));
+ }
+ }
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(final int aMetaData) {
+ if (aMetaData < 0) {
+ return null;
+ }
+ return (aMetaData - this.mOffset) < this.mIconList.length ? this.mIconList[aMetaData - this.mOffset][0] : null;
+ }
+
+ /**
+ * Sets the unlocalized name of this item to the string passed as the parameter"
+ */
+ @Override
+ public Item setUnlocalizedName(final String p_77655_1_) {
+ this.unlocalizedName = p_77655_1_;
+ super.setUnlocalizedName(p_77655_1_);
+ return this;
+ }
+
+ /**
+ * Returns the unlocalized name of this item.
+ */
+ @Override
+ public String getUnlocalizedName() {
+ return this.unlocalizedName;
+ }
+
+ public final Long[] getElectricStats(final ItemStack aStack) {
+ return this.mElectricStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
+ return false;
+ }
+
+ /**
+ * Adds a special Item Behaviour to the Item.
+ * <p/>
+ * 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 BaseEuItem addItemBehavior(final int aMetaValue, final IItemBehaviour<BaseEuItem> aBehavior) {
+ if ((aMetaValue < 0) || (aMetaValue >= 32766) || (aBehavior == null)) {
+ return this;
+ }
+ ArrayList<IItemBehaviour<BaseEuItem>> tList = this.mItemBehaviors.get((short) aMetaValue);
+ if (tList == null) {
+ tList = new ArrayList<>(1);
+ this.mItemBehaviors.put((short) aMetaValue, tList);
+ }
+ tList.add(aBehavior);
+ return 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.
+ */
+ @SuppressWarnings("unchecked")
+ public final ItemStack addItem(final int aID, final String aEnglish, String aToolTip, final Object... aRandomData) {
+ if (aToolTip == null) {
+ aToolTip = "";
+ }
+ if ((aID >= 0) && (aID < this.mItemAmount)) {
+ final ItemStack rStack = new ItemStack(this, 1, this.mOffset + aID);
+ this.mEnabledItems.set(aID);
+ this.mVisibleItems.set(aID);
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip);
+ final List<TC_AspectStack> tAspects = new ArrayList<>();
+ // Important Stuff to do first
+ for (final Object tRandomData : aRandomData) {
+ if (tRandomData instanceof SubTag) {
+ if (tRandomData == SubTag.INVISIBLE) {
+ this.mVisibleItems.set(aID, false);
+ continue;
+ }
+ if (tRandomData == SubTag.NO_UNIFICATION) {
+ GT_OreDictUnificator.addToBlacklist(rStack);
+ continue;
+ }
+ }
+ }
+ // now check for the rest
+ for (final Object tRandomData : aRandomData) {
+ if (tRandomData != null) {
+ boolean tUseOreDict = true;
+ if (tRandomData instanceof IItemBehaviour) {
+ this.addItemBehavior(this.mOffset + aID, (IItemBehaviour<BaseEuItem>) 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;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack par1ItemStack) {
+ int keyValue = (par1ItemStack.getItemDamage() - this.mOffset);
+ if (keyValue < 0 || keyValue > 3) {
+ keyValue = 0;
+ }
+ return this.itemName.get(keyValue).getValue();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java
index 246620344a..6e1d2e97e9 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java
@@ -3,90 +3,83 @@ package gtPlusPlus.core.item.base;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-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.world.World;
-
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.handler.GuiHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+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.world.World;
-public class BaseItemBackpack extends Item{
-
- protected final int colourValue;
- protected final String unlocalName;
-
-
- public BaseItemBackpack(final String unlocalizedName, final int colour){
- this.unlocalName = unlocalizedName;
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + "itemBackpack");
- this.colourValue = colour;
- GameRegistry.registerItem(this, unlocalizedName);
- GT_OreDictUnificator.registerOre("storageBackpack", ItemUtils.getSimpleStack(this));
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabOther);
- }
-
- // Without this method, your inventory will NOT work!!!
- @Override
- public int getMaxItemUseDuration(final ItemStack stack) {
- return 1; // return any value greater than zero
- }
-
- @Override
- public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player)
- {
- if (!world.isRemote)
- {
- // If player not sneaking, open the inventory gui
- if (!player.isSneaking()) {
- player.openGui(GTplusplus.instance, GuiHandler.GUI3, world, 0, 0, 0);
- }
-
- // Otherwise, stealthily place some diamonds in there for a nice surprise next time you open it up :)
- else {
- // Utils.LOG_INFO("Player is Sneaking, giving them sneaky diamonds.");
- // new BaseInventoryBackpack(player.getHeldItem()).setInventorySlotContents(0, new ItemStack(Items.diamond,4));
- }
- }
-
- return itemstack;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colourValue == 0){
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colourValue;
-
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- //Name Formatting.
- String temp = this.unlocalName.replace("backpack", "");
- //Lets find the colour.
- if (temp.toLowerCase().contains("dark")){
- temp = this.unlocalName.substring(12, this.unlocalName.length());
- temp = "Dark "+ temp;
- }
- return (temp+" Backpack");
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister iconRegister)
- {
- this.itemIcon = iconRegister.registerIcon(CORE.MODID + ":" + "itemBackpack");
- }
+public class BaseItemBackpack extends Item {
+
+ protected final int colourValue;
+ protected final String unlocalName;
+
+ public BaseItemBackpack(final String unlocalizedName, final int colour) {
+ this.unlocalName = unlocalizedName;
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + "itemBackpack");
+ this.colourValue = colour;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre("storageBackpack", ItemUtils.getSimpleStack(this));
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabOther);
+ }
+
+ // Without this method, your inventory will NOT work!!!
+ @Override
+ public int getMaxItemUseDuration(final ItemStack stack) {
+ return 1; // return any value greater than zero
+ }
+
+ @Override
+ public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
+ if (!world.isRemote) {
+ // If player not sneaking, open the inventory gui
+ if (!player.isSneaking()) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI3, world, 0, 0, 0);
+ }
+
+ // Otherwise, stealthily place some diamonds in there for a nice surprise next time you open it up :)
+ else {
+ // Utils.LOG_INFO("Player is Sneaking, giving them sneaky diamonds.");
+ // new BaseInventoryBackpack(player.getHeldItem()).setInventorySlotContents(0, new
+ // ItemStack(Items.diamond,4));
+ }
+ }
+
+ return itemstack;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ if (this.colourValue == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.colourValue;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ // Name Formatting.
+ String temp = this.unlocalName.replace("backpack", "");
+ // Lets find the colour.
+ if (temp.toLowerCase().contains("dark")) {
+ temp = this.unlocalName.substring(12, this.unlocalName.length());
+ temp = "Dark " + temp;
+ }
+ return (temp + " Backpack");
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(final IIconRegister iconRegister) {
+ this.itemIcon = iconRegister.registerIcon(CORE.MODID + ":" + "itemBackpack");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemBrain.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemBrain.java
index 73ed4afb42..fcb11ec31a 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemBrain.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemBrain.java
@@ -1,10 +1,8 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -13,97 +11,86 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
/*
- *
- *
- Key Point: You can access the NBT compound data from the Item class (in those methods that pass an ItemStack), but the NBT compound can only be set on an ItemStack.
-
- The steps to add NBT data to an ItemStack:
- Create or otherwise get an ItemStack of the desired item
- Create an NBTTagCompound and fill it with the appropriate data
- Call ItemStack#setTagCompound() method to set it.
+*
+*
+ Key Point: You can access the NBT compound data from the Item class (in those methods that pass an ItemStack), but the NBT compound can only be set on an ItemStack.
- *
- */
+The steps to add NBT data to an ItemStack:
+ Create or otherwise get an ItemStack of the desired item
+ Create an NBTTagCompound and fill it with the appropriate data
+ Call ItemStack#setTagCompound() method to set it.
-public class BaseItemBrain extends Item{
- // This is an array of all the types I am going to be adding.
- String[] brainTypes = { "dead", "preserved", "fresh", "tasty" };
+*
+*/
- // This method allows us to have different language translation keys for
- // each item we add.
- @Override
- public String getUnlocalizedName(final ItemStack stack)
- {
- // This makes sure that the stack has a tag compound. This is how data
- // is stored on items.
- if (stack.hasTagCompound())
- {
- // This is the object holding all of the item data.
- final NBTTagCompound itemData = stack.getTagCompound();
- // This checks to see if the item has data stored under the
- // brainType key.
- if (itemData.hasKey("brainType"))
- {
- // This retrieves data from the brainType key and uses it in
- // the return value
- return "item." + itemData.getString("brainType");
- }
- }
- // This will be used if the item is obtained without nbt data on it.
- return "item.nullBrain";
- }
+public class BaseItemBrain extends Item {
+ // This is an array of all the types I am going to be adding.
+ String[] brainTypes = {"dead", "preserved", "fresh", "tasty"};
+ // This method allows us to have different language translation keys for
+ // each item we add.
+ @Override
+ public String getUnlocalizedName(final ItemStack stack) {
+ // This makes sure that the stack has a tag compound. This is how data
+ // is stored on items.
+ if (stack.hasTagCompound()) {
+ // This is the object holding all of the item data.
+ final NBTTagCompound itemData = stack.getTagCompound();
+ // This checks to see if the item has data stored under the
+ // brainType key.
+ if (itemData.hasKey("brainType")) {
+ // This retrieves data from the brainType key and uses it in
+ // the return value
+ return "item." + itemData.getString("brainType");
+ }
+ }
+ // This will be used if the item is obtained without nbt data on it.
+ return "item.nullBrain";
+ }
- // This is a fun method which allows us to run some code when our item is
- // shown in a creative tab. I am going to use it to add all the brain
- // types.
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item item, final CreativeTabs tab, final List itemList)
- {
- // This creates a loop with a counter. It will go through once for
- // every listing in brainTypes, and gives us a number associated
- // with each listing.
- for (int pos = 0; pos < this.brainTypes.length; pos++)
- {
- // This creates a new ItemStack instance. The item parameter
- // supplied is this item.
- final ItemStack brainStack = new ItemStack(item);
- // By default, a new ItemStack does not have any nbt compound data.
- // We need to give it some.
- brainStack.setTagCompound(new NBTTagCompound());
- // Now we set the type of the item, brainType is the key, and
- // brainTypes[pos] is grabbing a
- // entry from the brainTypes array.
- brainStack.getTagCompound().setString("brainType",
- this.brainTypes[pos]);
- // And this adds it to the itemList, which is a list of all items
- // in the creative tab.
- itemList.add(brainStack);
- }
- }
+ // This is a fun method which allows us to run some code when our item is
+ // shown in a creative tab. I am going to use it to add all the brain
+ // types.
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(final Item item, final CreativeTabs tab, final List itemList) {
+ // This creates a loop with a counter. It will go through once for
+ // every listing in brainTypes, and gives us a number associated
+ // with each listing.
+ for (int pos = 0; pos < this.brainTypes.length; pos++) {
+ // This creates a new ItemStack instance. The item parameter
+ // supplied is this item.
+ final ItemStack brainStack = new ItemStack(item);
+ // By default, a new ItemStack does not have any nbt compound data.
+ // We need to give it some.
+ brainStack.setTagCompound(new NBTTagCompound());
+ // Now we set the type of the item, brainType is the key, and
+ // brainTypes[pos] is grabbing a
+ // entry from the brainTypes array.
+ brainStack.getTagCompound().setString("brainType", this.brainTypes[pos]);
+ // And this adds it to the itemList, which is a list of all items
+ // in the creative tab.
+ itemList.add(brainStack);
+ }
+ }
- // This code will allow us to tell the items apart in game. You can change
- @SuppressWarnings({ "rawtypes", "unchecked" })
- // texture based on nbt data, but I won't be covering that.
- @Override
- @SideOnly(Side.CLIENT)
- public void addInformation(final ItemStack stack, final EntityPlayer player, final List tooltip, final boolean isAdvanced){
- if ( stack.hasTagCompound()
- && stack.getTagCompound().hasKey("brainType"))
- {
- // StatCollector is a class which allows us to handle string
- // language translation. This requires that you fill out the
- // translation in you language class.
- tooltip.add(StatCollector.translateToLocal("tooltip.yourmod."
- + stack.getTagCompound().getString("brainType") + ".desc"));
- }
- else // If the brain does not have valid tag data, a default message
- {
- tooltip.add(StatCollector.translateToLocal(
- "tooltip.yourmod.nullbrain.desc"));
- }
- }
+ // This code will allow us to tell the items apart in game. You can change
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ // texture based on nbt data, but I won't be covering that.
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void addInformation(
+ final ItemStack stack, final EntityPlayer player, final List tooltip, final boolean isAdvanced) {
+ if (stack.hasTagCompound() && stack.getTagCompound().hasKey("brainType")) {
+ // StatCollector is a class which allows us to handle string
+ // language translation. This requires that you fill out the
+ // translation in you language class.
+ tooltip.add(StatCollector.translateToLocal(
+ "tooltip.yourmod." + stack.getTagCompound().getString("brainType") + ".desc"));
+ } else // If the brain does not have valid tag data, a default message
+ {
+ tooltip.add(StatCollector.translateToLocal("tooltip.yourmod.nullbrain.desc"));
+ }
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java
index a5db714822..9b24aa32d9 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemBurnable.java
@@ -1,44 +1,49 @@
package gtPlusPlus.core.item.base;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.ItemStack;
public class BaseItemBurnable extends CoreItem {
-
- protected final int meta;
-
- public BaseItemBurnable(String unlocalizedName, String displayName, CreativeTabs creativeTab,
- int stackSize, int maxDmg, String description, String oredictName, int burnTime, int meta) {
- super(unlocalizedName, creativeTab, stackSize, maxDmg, description);
- this.itemName = displayName;
- this.meta = meta;
- if (oredictName != null && !oredictName.equals("")){
- registerOrdictionary(oredictName);
- }
- registerFuel(burnTime);
-
- }
-
- public void registerFuel(int burn){
- CORE.burnables.add(new Pair<Integer, ItemStack>(burn, ItemUtils.getSimpleStack(this, 1)));
- }
-
- public final void registerOrdictionary(String name){
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), name);
- }
-
- @Override
- public int getDamage(ItemStack stack) {
- return this.meta;
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
+ protected final int meta;
+
+ public BaseItemBurnable(
+ String unlocalizedName,
+ String displayName,
+ CreativeTabs creativeTab,
+ int stackSize,
+ int maxDmg,
+ String description,
+ String oredictName,
+ int burnTime,
+ int meta) {
+ super(unlocalizedName, creativeTab, stackSize, maxDmg, description);
+ this.itemName = displayName;
+ this.meta = meta;
+ if (oredictName != null && !oredictName.equals("")) {
+ registerOrdictionary(oredictName);
+ }
+ registerFuel(burnTime);
+ }
+
+ public void registerFuel(int burn) {
+ CORE.burnables.add(new Pair<Integer, ItemStack>(burn, ItemUtils.getSimpleStack(this, 1)));
+ }
+
+ public final void registerOrdictionary(String name) {
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), name);
+ }
+
+ @Override
+ public int getDamage(ItemStack stack) {
+ return this.meta;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemColourable.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemColourable.java
index ca7041617d..94c231be9b 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemColourable.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemColourable.java
@@ -1,11 +1,10 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -13,86 +12,100 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import gtPlusPlus.core.lib.CORE;
+public class BaseItemColourable extends Item {
-public class BaseItemColourable extends Item
-{
+ private final EnumRarity rarity;
+ private final EnumChatFormatting descColour;
+ private final String itemDescription;
+ protected String itemName;
+ private final boolean hasEffect;
+ public final int componentColour;
- private final EnumRarity rarity;
- private final EnumChatFormatting descColour;
- private final String itemDescription;
- protected String itemName;
- private final boolean hasEffect;
- public final int componentColour;
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ return this.componentColour;
+ }
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return this.componentColour;
- }
-
- //5
- /*
- * Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
- */
- public BaseItemColourable(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg, final String description, final EnumRarity regRarity, final EnumChatFormatting colour, final boolean Effect, int rgb)
- {
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(creativeTab);
- this.setMaxStackSize(stackSize);
- this.setMaxDamage(maxDmg);
- this.setHasSubtypes(true);
- this.rarity = regRarity;
- this.itemDescription = description;
- this.descColour = colour;
- this.hasEffect = Effect;
- this.componentColour = rgb;
- GameRegistry.registerItem(this, unlocalizedName);
- }
+ // 5
+ /*
+ * Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
+ */
+ public BaseItemColourable(
+ final String unlocalizedName,
+ final CreativeTabs creativeTab,
+ final int stackSize,
+ final int maxDmg,
+ final String description,
+ final EnumRarity regRarity,
+ final EnumChatFormatting colour,
+ final boolean Effect,
+ int rgb) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(creativeTab);
+ this.setMaxStackSize(stackSize);
+ this.setMaxDamage(maxDmg);
+ this.setHasSubtypes(true);
+ this.rarity = regRarity;
+ this.itemDescription = description;
+ this.descColour = colour;
+ this.hasEffect = Effect;
+ this.componentColour = rgb;
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
- //6
- /*
- * Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
- */
- public BaseItemColourable(final String unlocalizedName, final String displayName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg, final String description, final EnumRarity regRarity, final EnumChatFormatting colour, final boolean Effect, int rgb)
- {
- this.setUnlocalizedName(unlocalizedName);
- this.itemName = displayName;
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(creativeTab);
- this.setMaxStackSize(stackSize);
- this.setMaxDamage(maxDmg);
- this.rarity = regRarity;
- this.itemDescription = description;
- this.descColour = colour;
- this.hasEffect = Effect;
- this.componentColour = rgb;
- GameRegistry.registerItem(this, unlocalizedName);
- }
+ // 6
+ /*
+ * Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
+ */
+ public BaseItemColourable(
+ final String unlocalizedName,
+ final String displayName,
+ final CreativeTabs creativeTab,
+ final int stackSize,
+ final int maxDmg,
+ final String description,
+ final EnumRarity regRarity,
+ final EnumChatFormatting colour,
+ final boolean Effect,
+ int rgb) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.itemName = displayName;
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(creativeTab);
+ this.setMaxStackSize(stackSize);
+ this.setMaxDamage(maxDmg);
+ this.rarity = regRarity;
+ this.itemDescription = description;
+ this.descColour = colour;
+ this.hasEffect = Effect;
+ this.componentColour = rgb;
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(this.descColour+this.itemDescription);
- //super.addInformation(stack, aPlayer, list, bool);
- }
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(this.descColour + this.itemDescription);
+ // super.addInformation(stack, aPlayer, list, bool);
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return this.rarity;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return this.rarity;
+ }
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return this.hasEffect;
- }
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return this.hasEffect;
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- if ((this.itemName == null) || this.itemName.equals("")) {
- return super.getItemStackDisplayName(tItem);
- }
- return this.itemName;
- }
-} \ No newline at end of file
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ if ((this.itemName == null) || this.itemName.equals("")) {
+ return super.getItemStackDisplayName(tItem);
+ }
+ return this.itemName;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
index 9590ec2848..8f513e9001 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -1,29 +1,26 @@
package gtPlusPlus.core.item.base;
-import java.util.*;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TextureSet;
-import gregtech.api.util.GT_LanguageManager;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.data.StringUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
+import java.util.*;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -33,1024 +30,1025 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-public class BaseItemComponent extends Item{
-
- private final static Class<TextureSet> mTextureSetPreload;
-
- static {
- mTextureSetPreload = TextureSet.class;
- }
-
- public final Material componentMaterial;
- public final String materialName;
- public final String unlocalName;
- public final ComponentTypes componentType;
- public final int componentColour;
- public Object extraData;
-
- protected IIcon base;
- protected IIcon overlay;
-
- public BaseItemComponent(final Material material, final ComponentTypes componentType) {
- this.componentMaterial = material;
- this.unlocalName = "item"+componentType.COMPONENT_NAME+material.getUnlocalizedName();
- this.materialName = material.getLocalizedName();
- this.componentType = componentType;
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(this.unlocalName);
- this.setMaxStackSize(64);
- //this.setTextureName(this.getCorrectTextures());
- this.componentColour = material.getRgbAsHex();
- GameRegistry.registerItem(this, this.unlocalName);
-
- //if (componentType != ComponentTypes.DUST)
-
- GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
- if (componentType == ComponentTypes.GEAR) {
- GT_OreDictUnificator.registerOre("gear"+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
- }
- if (LoadedMods.Thaumcraft) {
- //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1);
- if (componentMaterial.isRadioactive) {
- //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel);
- }
- }
- registerComponent();
- }
-
- //For Cell Generation
- public BaseItemComponent(final String unlocalName, final String localName, final short[] RGBA) {
-
- // Handles .'s from fluid internal names.
- String aFormattedNameForFluids;
- if (unlocalName.contains(".")) {
- aFormattedNameForFluids = StringUtils.splitAndUppercase(unlocalName, ".");
- }
- else {
- aFormattedNameForFluids = unlocalName;
- }
- Material aTempMaterial = Material.mMaterialCache.get(localName.toLowerCase());
- Logger.INFO("Attempted to get "+localName+" cell material from cache. Valid? "+(aTempMaterial != null));
- this.componentMaterial = aTempMaterial;
- this.unlocalName = "itemCell"+aFormattedNameForFluids;
- this.materialName = localName;
- this.componentType = ComponentTypes.CELL;
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(aFormattedNameForFluids);
- this.setMaxStackSize(64);
- this.componentColour = MathUtils.getRgbAsHex(RGBA);
- this.extraData = RGBA;
-
- this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME);
- GameRegistry.registerItem(this, aFormattedNameForFluids);
- GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+Utils.sanitizeStringKeepBrackets(localName), ItemUtils.getSimpleStack(this));
- registerComponent();
- }
-
- public boolean registerComponent() {
- if (this.componentMaterial == null) {
- return false;
- }
- //Register Component
- Map<String, ItemStack> aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName());
- if (aMap == null) {
- aMap = new HashMap<String, ItemStack>();
- }
- String aKey = componentType.getGtOrePrefix().name();
- ItemStack x = aMap.get(aKey);
- if (x == null) {
- aMap.put(aKey, ItemUtils.getSimpleStack(this));
- Logger.MATERIALS("Registering a material component. Item: ["+componentMaterial.getUnlocalizedName()+"] Map: ["+aKey+"]");
- Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap);
- if (componentType == ComponentTypes.PLATE) {
- GregTech_API.registerCover(componentMaterial.getPlate(1), new GT_RenderedTexture(componentMaterial.getTextureSet().mTextures[71], componentMaterial.getRGBA(), false), null);
- }
- else if (componentType == ComponentTypes.PLATEDOUBLE) {
- GregTech_API.registerCover(componentMaterial.getPlateDouble(1), new GT_RenderedTexture(componentMaterial.getTextureSet().mTextures[72], componentMaterial.getRGBA(), false), null);
- }
- return true;
- }
- else {
- //Bad
- Logger.MATERIALS("Tried to double register a material component. ");
- return false;
- }
- }
-
- public String getCorrectTextures(){
- if (!CORE.ConfigSwitches.useGregtechTextures){
- return CORE.MODID + ":" + "item"+this.componentType.COMPONENT_NAME;
- }
- String metType = "9j4852jyo3rjmh3owlhw9oe";
- if (this.componentMaterial != null) {
- TextureSet u = this.componentMaterial.getTextureSet();
- if (u != null) {
- metType = u.mSetName;
- }
- }
- metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
- return "gregtech" + ":" + "materialicons/"+metType+"/" + this.componentType.getOreDictName();
-
-
-
- //return "gregtech" + ":" + "materialicons/"+metType+"/" + this.componentType.COMPONENT_NAME.toLowerCase();
- }
-
- /*@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- if (this.componentType == ComponentTypes.SMALLGEAR){
- return "Small " + this.materialName+" Gear";
- }
-
- if (this.componentMaterial != null) {
- return (this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME);
- }
- return this.materialName+" Cell";
- }*/
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack stack) {
- if (componentMaterial == null) {
- String aFormattedLangName = componentType.getName();
- if (!aFormattedLangName.startsWith(" ")) {
- if (aFormattedLangName.contains("@")) {
- String[] aSplit = aFormattedLangName.split("@");
- aFormattedLangName = aSplit[0] + " " + getMaterialName() + " " + aSplit[1];
- }
- }
- if (aFormattedLangName.equals(componentType.getName())) {
- aFormattedLangName = getMaterialName() + aFormattedLangName;
- }
- return GT_LanguageManager.addStringLocalization(unlocalName, aFormattedLangName);
- }
- String aFormattedLangName = componentType.getName();
- if (!aFormattedLangName.startsWith(" ")) {
- if (aFormattedLangName.contains("@")) {
- String[] aSplit = aFormattedLangName.split("@");
- aFormattedLangName = aSplit[0] + " " + componentMaterial.getLocalizedName() + " " + aSplit[1];
- }
- }
- if (aFormattedLangName.equals(componentType.getName())) {
- aFormattedLangName = componentMaterial.getLocalizedName() + aFormattedLangName;
- }
- return GT_LanguageManager.addStringLocalization(unlocalName, aFormattedLangName);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
-
- try {
-
-
- if (this.componentMaterial == null){
- if (this.materialName != null){
- //list.add(Utils.sanitizeStringKeepBrackets(materialName));
- }
- }
-
- if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("") && (this.componentMaterial != null)){
-
-
- if (this.componentMaterial != null){
- if (!this.componentMaterial.vChemicalFormula.contains("?")) {
- list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula));
- }
- else if (this.componentMaterial.vChemicalFormula.contains("?")) {
- String temp = componentMaterial.vChemicalFormula;
- temp = temp.replace(" ", "");
- temp = temp.replace("-", "");
- temp = temp.replace("_", "");
- temp = temp.replace("!", "");
- temp = temp.replace("@", "");
- temp = temp.replace("#", "");
- temp = temp.replace(" ", "");
- list.add(temp);
- }
-
- if (this.componentMaterial.isRadioactive){
- list.add(CORE.GT_Tooltip_Radioactive);
- }
-
- if (this.componentType == ComponentTypes.INGOT || this.componentType == ComponentTypes.HOTINGOT){
- if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("") && this.unlocalName.toLowerCase().contains("hot")){
- list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot! "+EnumChatFormatting.GRAY+" Avoid direct handling..");
- }
- }
- }
- else {
- String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase());
- if (aChemicalFormula != null && aChemicalFormula.length() > 0) {
- list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula));
- }
- }
-
- //Hidden Tooltip
- if (KeyboardUtils.isCtrlKeyDown()) {
- if (this.componentMaterial != null) {
- String type = this.componentMaterial.getTextureSet().mSetName;
- String output = type.substring(0, 1).toUpperCase() + type.substring(1);
- list.add(EnumChatFormatting.GRAY+"Material Type: "+output+".");
- list.add(EnumChatFormatting.GRAY+"Material State: "+this.componentMaterial.getState().name()+".");
- list.add(EnumChatFormatting.GRAY+"Radioactivity Level: "+this.componentMaterial.vRadiationLevel+".");
- }
- }
- else {
- list.add(EnumChatFormatting.DARK_GRAY+"Hold Ctrl to show additional info.");
- }
-
- }
- }
- catch (Throwable t) {}
-
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (this.componentMaterial != null){
- if (entityHolding instanceof EntityPlayer){
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.componentMaterial.vRadiationLevel, world, entityHolding);
- }
- }
- }
-
- if (extraData != null) {
- if (componentMaterial != null && componentMaterial.getRGBA()[3] > 1) {
- if (((Map<Integer, Short[]>) extraData).get(9999) == null) {
- ((Map<Integer, Short[]>) extraData).put(9999, new Short[] {0});
- }
- Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get(9999)[0];
- short fC = (short) (aCurrentFrame >= Short.MAX_VALUE ? 0 : aCurrentFrame+1);
- ((Map<Integer, Short[]>) extraData).put((int) 9999, new Short[] {(short) (fC), 0});
- ((Map<Integer, Short[]>) extraData).put((int) 9998, new Short[] {aCurrentFrame, 0});
-
- }
- }
- }
-
-
- /**
- *
- * Handle Custom Rendering
- *
- */
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses(){
- return (CORE.ConfigSwitches.useGregtechTextures ? true : false);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
-
-
- if (this.componentType == ComponentTypes.CELL || this.componentType == ComponentTypes.PLASMACELL) {
- if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures){
- return Utils.rgbtoHexValue(255, 255, 255);
- }
- if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures){
- return Utils.rgbtoHexValue(255, 255, 255);
- }
- }
- if (this.componentType == ComponentTypes.PLATEHEAVY) {
-
- }
-
-
-
- try {
- if (this.componentMaterial == null) {
- if (extraData != null) {
- if (short.class.isInstance(extraData)){
- short[] abc = (short[]) extraData;
- return Utils.rgbtoHexValue(abc[0], abc[1], abc[2]);
- }
- }
- return this.componentColour;
- }
-
- if (this.componentMaterial.getRGBA()[3] <= 1) {
- return this.componentColour;
- }
- else {
-
- //Mild Glow Effect
- if (this.componentMaterial.getRGBA()[3] == 2) {
- if (extraData == null) {
- extraData = new HashMap<Integer, Short[]>();
- ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {0});
- ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE-1, new Short[] {0});
- short[] er = this.componentMaterial.getRGBA();
- short value = 0;
- Short[] ht = new Short[] {er[0], er[1], er[2]};
- int aMaxCycles = 200;
- for (int y = 0; y < aMaxCycles; y++) {
- if (y < (50)) {
- value = 1;
- }
- else if (y < (100)) {
- value = 0;
- }
- else if (y < (150)) {
- value = -1;
- }
- else {
- value = 0;
- }
- short r = (short) Math.max(Math.min(255, (ht[0] + value)), 0);
- short g = (short) Math.max(Math.min(255, (ht[1] + value)), 0);
- short b = (short) Math.max(Math.min(255, (ht[2] + value)), 0);
- Short[] qq = new Short[] {(short) Math.min(255, r), (short) Math.min(255, g), (short) Math.min(255, b)};
- ht = qq;
- ((Map<Integer, Short[]>) extraData).put(y, qq);
- }
- ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE-2, new Short[] {(short) (((Map<Integer, Short[]>) extraData).size()-1)});
- }
- if (extraData != null) {
-
- Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get((int) Short.MAX_VALUE)[0];
- Short aSize = (short) (((Map<Integer, Short[]>) extraData).size() - 3);
- short nextFrame = (short) ((aCurrentFrame < aSize) ? (aCurrentFrame+1) : 0);
- Short[] aCurrentFrameRGB = ((Map<Integer, Short[]>) extraData).get(aCurrentFrame < aSize ? (int) aCurrentFrame : 0);
- ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame});
- return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]);
- }
- }
-
- //Rainbow Hue Cycle
- else if (this.componentMaterial.getRGBA()[3] == 3) {
- if (extraData == null) {
- extraData = new HashMap<Integer, Short[]>();
- ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {0});
- ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE-1, new Short[] {0});
- int aSlot = 0;
-
- //Let's say you're starting with green:
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
- //Slowly start adding in some red to get to yellow:
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
- //Then, take out the green to get to red:
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
- //Now, add blue to get to purple:
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
- //Then, remove red to get to blue:
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
- //Add the green back in to get to cyan:
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
- //And finally remove the blue to get back to green:
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
- ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE-2, new Short[] {(short) (((Map<Integer, Short[]>) extraData).size()-1)});
-
-
- }
- if (extraData != null) {
- Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get((int) Short.MAX_VALUE)[0];
- Short aSize = (short) (((Map<Integer, Short[]>) extraData).size() - 3);
- short nextFrame = (short) ((aCurrentFrame < aSize) ? (aCurrentFrame+1) : 0);
- Short[] aCurrentFrameRGB = ((Map<Integer, Short[]>) extraData).get(aCurrentFrame < aSize ? (int) aCurrentFrame : 0);
- ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame});
- return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]);
- }
- }
- }
-
-
- }
- catch (Throwable t) {
-
- }
- return this.componentColour;
-
-
-
-
-
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if (CORE.ConfigSwitches.useGregtechTextures) {
- if(pass == 0) {
- return this.base;
- }
- return this.overlay;
- }
- return this.base;
- }
-
- @Override
- public void registerIcons(final IIconRegister i) {
-
- if (CORE.ConfigSwitches.useGregtechTextures){
- this.base = i.registerIcon(getCorrectTextures());
- this.overlay = i.registerIcon(getCorrectTextures() + "_OVERLAY");
- }
- else {
- this.base = i.registerIcon(getCorrectTextures());
- //this.overlay = i.registerIcon(getCorrectTextures() + "_OVERLAY");
- }
- }
-
-
-
-
- public static enum ComponentTypes {
- DUST("Dust", " Dust", "dust", OrePrefixes.dust),
- DUSTSMALL("DustSmall", "Small Pile of@Dust", "dustSmall", OrePrefixes.dustSmall),
- DUSTTINY("DustTiny", "Tiny Pile of@Dust", "dustTiny", OrePrefixes.dustTiny),
- INGOT("Ingot", " Ingot", "ingot", OrePrefixes.ingot),
- HOTINGOT("HotIngot", "Hot@Ingot", "ingotHot", OrePrefixes.ingotHot),
- PLATE("Plate", " Plate", "plate", OrePrefixes.plate),
- PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble", OrePrefixes.plateDouble),
- ROD("Rod", " Rod", "stick", OrePrefixes.stick),
- RODLONG("RodLong", " Long Rod", "stickLong", OrePrefixes.stickLong),
- GEAR("Gear", " Gear", "gearGt", OrePrefixes.gearGt),
- SMALLGEAR("SmallGear", " Gear", "gearGtSmall", OrePrefixes.gearGtSmall), //TODO
- SCREW("Screw", " Screw", "screw", OrePrefixes.screw),
- BOLT("Bolt", " Bolt", "bolt", OrePrefixes.bolt),
- ROTOR("Rotor", " Rotor", "rotor", OrePrefixes.rotor),
- RING("Ring", " Ring", "ring", OrePrefixes.ring),
- FOIL("Foil", " Foil", "foil", OrePrefixes.foil),
- PLASMACELL("CellPlasma", " Plasma Cell", "cellPlasma", OrePrefixes.cellPlasma),
- CELL("Cell", " Cell", "cell", OrePrefixes.cell),
- NUGGET("Nugget", " Nugget", "nugget", OrePrefixes.nugget),
- PLATEHEAVY("HeavyPlate", "Heavy@Plate", "plateHeavy", OrePrefixes.plateDense),
- SPRING("Spring", " Spring", "spring", OrePrefixes.spring),
- SMALLSPRING("SmallSpring", "Small@Spring", "springSmall", OrePrefixes.springSmall),
- FINEWIRE("FineWire", "Fine@Wire", "wireFine", OrePrefixes.wireFine),;
-
- private String COMPONENT_NAME;
- private String DISPLAY_NAME;
- private String OREDICT_NAME;
- private OrePrefixes a_GT_EQUAL;
- private ComponentTypes (final String LocalName, final String DisplayName, final String OreDictName, final OrePrefixes aPrefix){
- this.COMPONENT_NAME = LocalName;
- this.DISPLAY_NAME = DisplayName;
- this.OREDICT_NAME = OreDictName;
- this.a_GT_EQUAL = aPrefix;
- }
-
- public String getComponent(){
- return this.COMPONENT_NAME;
- }
-
- public String getName(){
- return this.DISPLAY_NAME;
- }
-
- public String getOreDictName(){
- return this.OREDICT_NAME;
- }
-
- public OrePrefixes getGtOrePrefix() {
- return this.a_GT_EQUAL;
- }
-
- }
-
+public class BaseItemComponent extends Item {
+
+ private static final Class<TextureSet> mTextureSetPreload;
+
+ static {
+ mTextureSetPreload = TextureSet.class;
+ }
+
+ public final Material componentMaterial;
+ public final String materialName;
+ public final String unlocalName;
+ public final ComponentTypes componentType;
+ public final int componentColour;
+ public Object extraData;
+
+ protected IIcon base;
+ protected IIcon overlay;
+
+ public BaseItemComponent(final Material material, final ComponentTypes componentType) {
+ this.componentMaterial = material;
+ this.unlocalName = "item" + componentType.COMPONENT_NAME + material.getUnlocalizedName();
+ this.materialName = material.getLocalizedName();
+ this.componentType = componentType;
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(this.unlocalName);
+ this.setMaxStackSize(64);
+ // this.setTextureName(this.getCorrectTextures());
+ this.componentColour = material.getRgbAsHex();
+ GameRegistry.registerItem(this, this.unlocalName);
+
+ // if (componentType != ComponentTypes.DUST)
+
+ GT_OreDictUnificator.registerOre(
+ componentType.getOreDictName() + material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
+ if (componentType == ComponentTypes.GEAR) {
+ GT_OreDictUnificator.registerOre("gear" + material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
+ }
+ if (LoadedMods.Thaumcraft) {
+ // ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this),
+ // TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1);
+ if (componentMaterial.isRadioactive) {
+ // ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this),
+ // TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel);
+ }
+ }
+ registerComponent();
+ }
+
+ // For Cell Generation
+ public BaseItemComponent(final String unlocalName, final String localName, final short[] RGBA) {
+
+ // Handles .'s from fluid internal names.
+ String aFormattedNameForFluids;
+ if (unlocalName.contains(".")) {
+ aFormattedNameForFluids = StringUtils.splitAndUppercase(unlocalName, ".");
+ } else {
+ aFormattedNameForFluids = unlocalName;
+ }
+ Material aTempMaterial = Material.mMaterialCache.get(localName.toLowerCase());
+ Logger.INFO("Attempted to get " + localName + " cell material from cache. Valid? " + (aTempMaterial != null));
+ this.componentMaterial = aTempMaterial;
+ this.unlocalName = "itemCell" + aFormattedNameForFluids;
+ this.materialName = localName;
+ this.componentType = ComponentTypes.CELL;
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(aFormattedNameForFluids);
+ this.setMaxStackSize(64);
+ this.componentColour = MathUtils.getRgbAsHex(RGBA);
+ this.extraData = RGBA;
+
+ this.setTextureName(CORE.MODID + ":" + "item" + ComponentTypes.CELL.COMPONENT_NAME);
+ GameRegistry.registerItem(this, aFormattedNameForFluids);
+ GT_OreDictUnificator.registerOre(
+ ComponentTypes.CELL.getOreDictName() + Utils.sanitizeStringKeepBrackets(localName),
+ ItemUtils.getSimpleStack(this));
+ registerComponent();
+ }
+
+ public boolean registerComponent() {
+ if (this.componentMaterial == null) {
+ return false;
+ }
+ // Register Component
+ Map<String, ItemStack> aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName());
+ if (aMap == null) {
+ aMap = new HashMap<String, ItemStack>();
+ }
+ String aKey = componentType.getGtOrePrefix().name();
+ ItemStack x = aMap.get(aKey);
+ if (x == null) {
+ aMap.put(aKey, ItemUtils.getSimpleStack(this));
+ Logger.MATERIALS("Registering a material component. Item: [" + componentMaterial.getUnlocalizedName()
+ + "] Map: [" + aKey + "]");
+ Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap);
+ if (componentType == ComponentTypes.PLATE) {
+ GregTech_API.registerCover(
+ componentMaterial.getPlate(1),
+ new GT_RenderedTexture(
+ componentMaterial.getTextureSet().mTextures[71], componentMaterial.getRGBA(), false),
+ null);
+ } else if (componentType == ComponentTypes.PLATEDOUBLE) {
+ GregTech_API.registerCover(
+ componentMaterial.getPlateDouble(1),
+ new GT_RenderedTexture(
+ componentMaterial.getTextureSet().mTextures[72], componentMaterial.getRGBA(), false),
+ null);
+ }
+ return true;
+ } else {
+ // Bad
+ Logger.MATERIALS("Tried to double register a material component. ");
+ return false;
+ }
+ }
+
+ public String getCorrectTextures() {
+ if (!CORE.ConfigSwitches.useGregtechTextures) {
+ return CORE.MODID + ":" + "item" + this.componentType.COMPONENT_NAME;
+ }
+ String metType = "9j4852jyo3rjmh3owlhw9oe";
+ if (this.componentMaterial != null) {
+ TextureSet u = this.componentMaterial.getTextureSet();
+ if (u != null) {
+ metType = u.mSetName;
+ }
+ }
+ metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
+ return "gregtech" + ":" + "materialicons/" + metType + "/" + this.componentType.getOreDictName();
+
+ // return "gregtech" + ":" + "materialicons/"+metType+"/" + this.componentType.COMPONENT_NAME.toLowerCase();
+ }
+
+ /*@Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+
+ if (this.componentType == ComponentTypes.SMALLGEAR){
+ return "Small " + this.materialName+" Gear";
+ }
+
+ if (this.componentMaterial != null) {
+ return (this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME);
+ }
+ return this.materialName+" Cell";
+ }*/
+
+ public final String getMaterialName() {
+ return this.materialName;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack stack) {
+ if (componentMaterial == null) {
+ String aFormattedLangName = componentType.getName();
+ if (!aFormattedLangName.startsWith(" ")) {
+ if (aFormattedLangName.contains("@")) {
+ String[] aSplit = aFormattedLangName.split("@");
+ aFormattedLangName = aSplit[0] + " " + getMaterialName() + " " + aSplit[1];
+ }
+ }
+ if (aFormattedLangName.equals(componentType.getName())) {
+ aFormattedLangName = getMaterialName() + aFormattedLangName;
+ }
+ return GT_LanguageManager.addStringLocalization(unlocalName, aFormattedLangName);
+ }
+ String aFormattedLangName = componentType.getName();
+ if (!aFormattedLangName.startsWith(" ")) {
+ if (aFormattedLangName.contains("@")) {
+ String[] aSplit = aFormattedLangName.split("@");
+ aFormattedLangName = aSplit[0] + " " + componentMaterial.getLocalizedName() + " " + aSplit[1];
+ }
+ }
+ if (aFormattedLangName.equals(componentType.getName())) {
+ aFormattedLangName = componentMaterial.getLocalizedName() + aFormattedLangName;
+ }
+ return GT_LanguageManager.addStringLocalization(unlocalName, aFormattedLangName);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public final void addInformation(
+ final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+
+ try {
+
+ if (this.componentMaterial == null) {
+ if (this.materialName != null) {
+ // list.add(Utils.sanitizeStringKeepBrackets(materialName));
+ }
+ }
+
+ if ((this.materialName != null)
+ && (this.materialName != "")
+ && !this.materialName.equals("")
+ && (this.componentMaterial != null)) {
+
+ if (this.componentMaterial != null) {
+ if (!this.componentMaterial.vChemicalFormula.contains("?")) {
+ list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula));
+ } else if (this.componentMaterial.vChemicalFormula.contains("?")) {
+ String temp = componentMaterial.vChemicalFormula;
+ temp = temp.replace(" ", "");
+ temp = temp.replace("-", "");
+ temp = temp.replace("_", "");
+ temp = temp.replace("!", "");
+ temp = temp.replace("@", "");
+ temp = temp.replace("#", "");
+ temp = temp.replace(" ", "");
+ list.add(temp);
+ }
+
+ if (this.componentMaterial.isRadioactive) {
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+
+ if (this.componentType == ComponentTypes.INGOT || this.componentType == ComponentTypes.HOTINGOT) {
+ if ((this.materialName != null)
+ && (this.materialName != "")
+ && !this.materialName.equals("")
+ && this.unlocalName.toLowerCase().contains("hot")) {
+ list.add(EnumChatFormatting.GRAY + "Warning: " + EnumChatFormatting.RED + "Very hot! "
+ + EnumChatFormatting.GRAY + " Avoid direct handling..");
+ }
+ }
+ } else {
+ String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase());
+ if (aChemicalFormula != null && aChemicalFormula.length() > 0) {
+ list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula));
+ }
+ }
+
+ // Hidden Tooltip
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ if (this.componentMaterial != null) {
+ String type = this.componentMaterial.getTextureSet().mSetName;
+ String output = type.substring(0, 1).toUpperCase() + type.substring(1);
+ list.add(EnumChatFormatting.GRAY + "Material Type: " + output + ".");
+ list.add(EnumChatFormatting.GRAY + "Material State: "
+ + this.componentMaterial.getState().name() + ".");
+ list.add(EnumChatFormatting.GRAY + "Radioactivity Level: "
+ + this.componentMaterial.vRadiationLevel + ".");
+ }
+ } else {
+ list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info.");
+ }
+ }
+ } catch (Throwable t) {
+ }
+
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (this.componentMaterial != null) {
+ if (entityHolding instanceof EntityPlayer) {
+ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode) {
+ EntityUtils.applyRadiationDamageToEntity(
+ iStack.stackSize, this.componentMaterial.vRadiationLevel, world, entityHolding);
+ }
+ }
+ }
+
+ if (extraData != null) {
+ if (componentMaterial != null && componentMaterial.getRGBA()[3] > 1) {
+ if (((Map<Integer, Short[]>) extraData).get(9999) == null) {
+ ((Map<Integer, Short[]>) extraData).put(9999, new Short[] {0});
+ }
+ Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get(9999)[0];
+ short fC = (short) (aCurrentFrame >= Short.MAX_VALUE ? 0 : aCurrentFrame + 1);
+ ((Map<Integer, Short[]>) extraData).put((int) 9999, new Short[] {(short) (fC), 0});
+ ((Map<Integer, Short[]>) extraData).put((int) 9998, new Short[] {aCurrentFrame, 0});
+ }
+ }
+ }
+
+ /**
+ *
+ * Handle Custom Rendering
+ *
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return (CORE.ConfigSwitches.useGregtechTextures ? true : false);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
+
+ if (this.componentType == ComponentTypes.CELL || this.componentType == ComponentTypes.PLASMACELL) {
+ if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures) {
+ return Utils.rgbtoHexValue(255, 255, 255);
+ }
+ if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures) {
+ return Utils.rgbtoHexValue(255, 255, 255);
+ }
+ }
+ if (this.componentType == ComponentTypes.PLATEHEAVY) {}
+
+ try {
+ if (this.componentMaterial == null) {
+ if (extraData != null) {
+ if (short.class.isInstance(extraData)) {
+ short[] abc = (short[]) extraData;
+ return Utils.rgbtoHexValue(abc[0], abc[1], abc[2]);
+ }
+ }
+ return this.componentColour;
+ }
+
+ if (this.componentMaterial.getRGBA()[3] <= 1) {
+ return this.componentColour;
+ } else {
+
+ // Mild Glow Effect
+ if (this.componentMaterial.getRGBA()[3] == 2) {
+ if (extraData == null) {
+ extraData = new HashMap<Integer, Short[]>();
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {0});
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE - 1, new Short[] {0});
+ short[] er = this.componentMaterial.getRGBA();
+ short value = 0;
+ Short[] ht = new Short[] {er[0], er[1], er[2]};
+ int aMaxCycles = 200;
+ for (int y = 0; y < aMaxCycles; y++) {
+ if (y < (50)) {
+ value = 1;
+ } else if (y < (100)) {
+ value = 0;
+ } else if (y < (150)) {
+ value = -1;
+ } else {
+ value = 0;
+ }
+ short r = (short) Math.max(Math.min(255, (ht[0] + value)), 0);
+ short g = (short) Math.max(Math.min(255, (ht[1] + value)), 0);
+ short b = (short) Math.max(Math.min(255, (ht[2] + value)), 0);
+ Short[] qq = new Short[] {
+ (short) Math.min(255, r), (short) Math.min(255, g), (short) Math.min(255, b)
+ };
+ ht = qq;
+ ((Map<Integer, Short[]>) extraData).put(y, qq);
+ }
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE - 2, new Short[] {
+ (short) (((Map<Integer, Short[]>) extraData).size() - 1)
+ });
+ }
+ if (extraData != null) {
+
+ Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get((int) Short.MAX_VALUE)[0];
+ Short aSize = (short) (((Map<Integer, Short[]>) extraData).size() - 3);
+ short nextFrame = (short) ((aCurrentFrame < aSize) ? (aCurrentFrame + 1) : 0);
+ Short[] aCurrentFrameRGB = ((Map<Integer, Short[]>) extraData)
+ .get(aCurrentFrame < aSize ? (int) aCurrentFrame : 0);
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame});
+ return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]);
+ }
+ }
+
+ // Rainbow Hue Cycle
+ else if (this.componentMaterial.getRGBA()[3] == 3) {
+ if (extraData == null) {
+ extraData = new HashMap<Integer, Short[]>();
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {0});
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE - 1, new Short[] {0});
+ int aSlot = 0;
+
+ // Let's say you're starting with green:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 0});
+ // Slowly start adding in some red to get to yellow:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ // Then, take out the green to get to red:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ // Now, add blue to get to purple:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ // Then, remove red to get to blue:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 0, 255});
+ // Add the green back in to get to cyan:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 255});
+ // And finally remove the blue to get back to green:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE - 2, new Short[] {
+ (short) (((Map<Integer, Short[]>) extraData).size() - 1)
+ });
+ }
+ if (extraData != null) {
+ Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get((int) Short.MAX_VALUE)[0];
+ Short aSize = (short) (((Map<Integer, Short[]>) extraData).size() - 3);
+ short nextFrame = (short) ((aCurrentFrame < aSize) ? (aCurrentFrame + 1) : 0);
+ Short[] aCurrentFrameRGB = ((Map<Integer, Short[]>) extraData)
+ .get(aCurrentFrame < aSize ? (int) aCurrentFrame : 0);
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame});
+ return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]);
+ }
+ }
+ }
+
+ } catch (Throwable t) {
+
+ }
+ return this.componentColour;
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if (CORE.ConfigSwitches.useGregtechTextures) {
+ if (pass == 0) {
+ return this.base;
+ }
+ return this.overlay;
+ }
+ return this.base;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister i) {
+
+ if (CORE.ConfigSwitches.useGregtechTextures) {
+ this.base = i.registerIcon(getCorrectTextures());
+ this.overlay = i.registerIcon(getCorrectTextures() + "_OVERLAY");
+ } else {
+ this.base = i.registerIcon(getCorrectTextures());
+ // this.overlay = i.registerIcon(getCorrectTextures() + "_OVERLAY");
+ }
+ }
+
+ public static enum ComponentTypes {
+ DUST("Dust", " Dust", "dust", OrePrefixes.dust),
+ DUSTSMALL("DustSmall", "Small Pile of@Dust", "dustSmall", OrePrefixes.dustSmall),
+ DUSTTINY("DustTiny", "Tiny Pile of@Dust", "dustTiny", OrePrefixes.dustTiny),
+ INGOT("Ingot", " Ingot", "ingot", OrePrefixes.ingot),
+ HOTINGOT("HotIngot", "Hot@Ingot", "ingotHot", OrePrefixes.ingotHot),
+ PLATE("Plate", " Plate", "plate", OrePrefixes.plate),
+ PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble", OrePrefixes.plateDouble),
+ ROD("Rod", " Rod", "stick", OrePrefixes.stick),
+ RODLONG("RodLong", " Long Rod", "stickLong", OrePrefixes.stickLong),
+ GEAR("Gear", " Gear", "gearGt", OrePrefixes.gearGt),
+ SMALLGEAR("SmallGear", " Gear", "gearGtSmall", OrePrefixes.gearGtSmall), // TODO
+ SCREW("Screw", " Screw", "screw", OrePrefixes.screw),
+ BOLT("Bolt", " Bolt", "bolt", OrePrefixes.bolt),
+ ROTOR("Rotor", " Rotor", "rotor", OrePrefixes.rotor),
+ RING("Ring", " Ring", "ring", OrePrefixes.ring),
+ FOIL("Foil", " Foil", "foil", OrePrefixes.foil),
+ PLASMACELL("CellPlasma", " Plasma Cell", "cellPlasma", OrePrefixes.cellPlasma),
+ CELL("Cell", " Cell", "cell", OrePrefixes.cell),
+ NUGGET("Nugget", " Nugget", "nugget", OrePrefixes.nugget),
+ PLATEHEAVY("HeavyPlate", "Heavy@Plate", "plateHeavy", OrePrefixes.plateDense),
+ SPRING("Spring", " Spring", "spring", OrePrefixes.spring),
+ SMALLSPRING("SmallSpring", "Small@Spring", "springSmall", OrePrefixes.springSmall),
+ FINEWIRE("FineWire", "Fine@Wire", "wireFine", OrePrefixes.wireFine),
+ ;
+
+ private String COMPONENT_NAME;
+ private String DISPLAY_NAME;
+ private String OREDICT_NAME;
+ private OrePrefixes a_GT_EQUAL;
+
+ private ComponentTypes(
+ final String LocalName, final String DisplayName, final String OreDictName, final OrePrefixes aPrefix) {
+ this.COMPONENT_NAME = LocalName;
+ this.DISPLAY_NAME = DisplayName;
+ this.OREDICT_NAME = OreDictName;
+ this.a_GT_EQUAL = aPrefix;
+ }
+
+ public String getComponent() {
+ return this.COMPONENT_NAME;
+ }
+
+ public String getName() {
+ return this.DISPLAY_NAME;
+ }
+
+ public String getOreDictName() {
+ return this.OREDICT_NAME;
+ }
+
+ public OrePrefixes getGtOrePrefix() {
+ return this.a_GT_EQUAL;
+ }
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java
index 4209ec0a59..d244d28967 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemDamageable.java
@@ -1,11 +1,11 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -14,188 +14,186 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
-
public class BaseItemDamageable extends Item {
- private final EnumRarity rarity;
- private final String itemDescription;
- protected String itemName;
- private final boolean hasEffect;
-
- public BaseItemDamageable(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg, final String description, final EnumRarity regRarity, final EnumChatFormatting colour, final boolean Effect, final ItemStack OverrideItem)
- {
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(creativeTab);
- this.setMaxStackSize(1);
- this.setMaxDamage(251);
- this.setNoRepair();
- this.rarity = regRarity;
- this.itemDescription = description;
- this.hasEffect = Effect;
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- public String getItemDescription(){
- return this.itemDescription;
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- int dmg = (int) getItemDamage(stack);
- if (dmg <= 3){
- list.add(EnumChatFormatting.GRAY+this.itemDescription);
- }
- if (dmg > 3 && dmg <= 25){
- list.add(EnumChatFormatting.GRAY+"You have discovered that smashing this against valuable stones has some function..");
- }
- else if (dmg > 0){
- int maxDamage = 250;
- list.add(EnumChatFormatting.GRAY+""+(maxDamage-getItemDamage(stack))+"/"+maxDamage+" gems remaining.");
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- int dmg = (int) getItemDamage(par1ItemStack);
- if (dmg > 200){
- return EnumRarity.epic;
- }
- return this.rarity;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- int dmg = (int) getItemDamage(par1ItemStack);
- if (dmg > 200){
- return true;
- }
- return this.hasEffect;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- if ((this.itemName == null) || this.itemName.equals("")) {
- return super.getItemStackDisplayName(tItem);
- }
- return this.itemName;
- }
-
- private static boolean createNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Value", 0);
- tagMain.setTag("Damage", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static final long getItemDamage(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("Damage");
- if (aNBT != null) {
- return aNBT.getLong("Value");
- }
- }
- else {
- createNBT(aStack);
- }
- return 0L;
- }
-
- public static final boolean setItemDamage(final ItemStack aStack, final long aDamage) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("Damage");
- if (aNBT != null) {
- aNBT.setLong("Value", aDamage);
- return true;
- }
- }
- else {
- createNBT(aStack);
- }
- return false;
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- if (stack.getTagCompound() == null){
- createNBT(stack);
- }
- double currentDamage = getItemDamage(stack);
- double durabilitypercent = currentDamage / 100;
- double inverse = (100-durabilitypercent);
- return durabilitypercent;
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- int dmg = (int) getItemDamage(stack);
- if (dmg <= 20){
- return false;
- }
- else {
- return true;
- }
- }
-
- public static ItemStack damageItem(ItemStack item){
- if (item != null){
- long currentUse = BaseItemDamageable.getItemDamage(item);
- if (currentUse >= 0 && currentUse <= 250){
- BaseItemDamageable.setItemDamage(item, currentUse+1);
- return item;
- }
- else {
- return item;
- }
- }
- return null;
- }
-
- @Override
- public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack) {
- Logger.INFO("Does Leave Table? "+stack.getDisplayName());
- return true;
- }
-
- @Override
- public boolean getShareTag() {
- return true;
- }
-
- @Override
- public boolean hasContainerItem() {
- return true;
- }
-
- @Override
- public boolean hasContainerItem(ItemStack stack) {
- Logger.INFO("hasContainerItem? "+stack.getDisplayName());
- return true;
- }
-
- @Override
- public ItemStack getContainerItem(ItemStack itemStack) {
- ItemStack stack = itemStack.copy();
- //stack.setItemDamage(stack.getItemDamage() + 1);
- damageItem(stack);
- stack.stackSize = 1;
- return stack;
- }
-
- @Override
- public int getDamage(ItemStack stack) {
- return (int) getItemDamage(stack);
- }
-
+ private final EnumRarity rarity;
+ private final String itemDescription;
+ protected String itemName;
+ private final boolean hasEffect;
+
+ public BaseItemDamageable(
+ final String unlocalizedName,
+ final CreativeTabs creativeTab,
+ final int stackSize,
+ final int maxDmg,
+ final String description,
+ final EnumRarity regRarity,
+ final EnumChatFormatting colour,
+ final boolean Effect,
+ final ItemStack OverrideItem) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(creativeTab);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(251);
+ this.setNoRepair();
+ this.rarity = regRarity;
+ this.itemDescription = description;
+ this.hasEffect = Effect;
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ public String getItemDescription() {
+ return this.itemDescription;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ int dmg = (int) getItemDamage(stack);
+ if (dmg <= 3) {
+ list.add(EnumChatFormatting.GRAY + this.itemDescription);
+ }
+ if (dmg > 3 && dmg <= 25) {
+ list.add(EnumChatFormatting.GRAY
+ + "You have discovered that smashing this against valuable stones has some function..");
+ } else if (dmg > 0) {
+ int maxDamage = 250;
+ list.add(EnumChatFormatting.GRAY + "" + (maxDamage - getItemDamage(stack)) + "/" + maxDamage
+ + " gems remaining.");
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ int dmg = (int) getItemDamage(par1ItemStack);
+ if (dmg > 200) {
+ return EnumRarity.epic;
+ }
+ return this.rarity;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ int dmg = (int) getItemDamage(par1ItemStack);
+ if (dmg > 200) {
+ return true;
+ }
+ return this.hasEffect;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ if ((this.itemName == null) || this.itemName.equals("")) {
+ return super.getItemStackDisplayName(tItem);
+ }
+ return this.itemName;
+ }
+
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Value", 0);
+ tagMain.setTag("Damage", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static final long getItemDamage(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("Damage");
+ if (aNBT != null) {
+ return aNBT.getLong("Value");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return 0L;
+ }
+
+ public static final boolean setItemDamage(final ItemStack aStack, final long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("Damage");
+ if (aNBT != null) {
+ aNBT.setLong("Value", aDamage);
+ return true;
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return false;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (stack.getTagCompound() == null) {
+ createNBT(stack);
+ }
+ double currentDamage = getItemDamage(stack);
+ double durabilitypercent = currentDamage / 100;
+ double inverse = (100 - durabilitypercent);
+ return durabilitypercent;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ int dmg = (int) getItemDamage(stack);
+ if (dmg <= 20) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ public static ItemStack damageItem(ItemStack item) {
+ if (item != null) {
+ long currentUse = BaseItemDamageable.getItemDamage(item);
+ if (currentUse >= 0 && currentUse <= 250) {
+ BaseItemDamageable.setItemDamage(item, currentUse + 1);
+ return item;
+ } else {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack) {
+ Logger.INFO("Does Leave Table? " + stack.getDisplayName());
+ return true;
+ }
+
+ @Override
+ public boolean getShareTag() {
+ return true;
+ }
+
+ @Override
+ public boolean hasContainerItem() {
+ return true;
+ }
+
+ @Override
+ public boolean hasContainerItem(ItemStack stack) {
+ Logger.INFO("hasContainerItem? " + stack.getDisplayName());
+ return true;
+ }
+
+ @Override
+ public ItemStack getContainerItem(ItemStack itemStack) {
+ ItemStack stack = itemStack.copy();
+ // stack.setItemDamage(stack.getItemDamage() + 1);
+ damageItem(stack);
+ stack.stackSize = 1;
+ return stack;
+ }
+
+ @Override
+ public int getDamage(ItemStack stack) {
+ return (int) getItemDamage(stack);
+ }
}
-
-
-
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemGeneric.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemGeneric.java
index 970d5ec0c8..65ed54f520 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemGeneric.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemGeneric.java
@@ -1,28 +1,24 @@
package gtPlusPlus.core.item.base;
+import gtPlusPlus.core.lib.CORE;
import java.util.List;
-
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.lib.CORE;
-
-public class BaseItemGeneric extends Item
-{
- public BaseItemGeneric(final String unlocalizedName, final CreativeTabs c, final int stackSize, final int maxDmg)
- {
- this.setUnlocalizedName(CORE.MODID + "_" + unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(c);
- this.setMaxStackSize(stackSize);
- this.setMaxDamage(maxDmg);
- }
+public class BaseItemGeneric extends Item {
+ public BaseItemGeneric(final String unlocalizedName, final CreativeTabs c, final int stackSize, final int maxDmg) {
+ this.setUnlocalizedName(CORE.MODID + "_" + unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(c);
+ this.setMaxStackSize(stackSize);
+ this.setMaxDamage(maxDmg);
+ }
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- super.addInformation(stack, aPlayer, list, bool);
- }
-} \ No newline at end of file
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemLoot.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemLoot.java
index 3d9ff9fa48..23783d69f7 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemLoot.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemLoot.java
@@ -1,109 +1,104 @@
package gtPlusPlus.core.item.base;
+import gregtech.api.enums.Materials;
+import gtPlusPlus.api.enums.Quality;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import java.util.List;
-
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import gregtech.api.enums.Materials;
-
-import gtPlusPlus.api.enums.Quality;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class BaseItemLoot extends Item{
-
- private final String materialName;
- private final String unlocalName;
- private final LootTypes lootTypes;
- private Quality lootQuality;
- private final Materials lootMaterial;
-
- public BaseItemLoot(final LootTypes lootType, final Materials material) {
- this.lootTypes = lootType;
- this.lootMaterial = material;
- this.materialName = material.mDefaultLocalName;
- this.unlocalName = "item"+lootType.LOOT_TYPE+this.materialName;
- this.setUnlocalizedName(this.unlocalName);
- this.setMaxStackSize(1);
- this.setTextureName(CORE.MODID + ":" + "item"+lootType.LOOT_TYPE);
- }
-
- public ItemStack generateLootStack(){
- this.lootQuality = Quality.getRandomQuality();
- return ItemUtils.getSimpleStack(this, 1);
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return (this.materialName+this.lootTypes.DISPLAY_SUFFIX);
- }
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(this.lootQuality.getQuality());
-
- /*if (componentMaterial.isRadioactive){
- list.add(CORE.GT_Tooltip_Radioactive);
- }*/
-
- super.addInformation(stack, aPlayer, list, bool);
- }
-
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- final short[] temp = this.lootMaterial.mRGBa;
- return Utils.rgbtoHexValue(temp[0], temp[1], temp[2]);
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- //EntityUtils.applyRadiationDamageToEntity(lootQuality.vRadioationLevel, world, entityHolding);
- }
-
-
-
-
-
-
-
-
- public static enum LootTypes {
- Sword("Sword", " Longsword", "sword"),
- Shortsword("Sword", " Short Blade", "blade"),
- Helmet("Helmet", " Medium Helm", "helmet"),
- Chestplate("Platebody", " Chestplate", "platebody"),
- Leggings("Platelegs", " Platelegs", "platelegs"),
- Boots("Boots", " Boots", "boots");
- private String LOOT_TYPE;
- private String DISPLAY_SUFFIX;
- private String OREDICT_NAME;
- private LootTypes (final String LocalName, final String DisplayName, final String OreDictName){
- this.LOOT_TYPE = LocalName;
- this.DISPLAY_SUFFIX = DisplayName;
- this.OREDICT_NAME = OreDictName;
- }
- public String getLootType(){
- return this.LOOT_TYPE;
- }
- public String getName(){
- return this.DISPLAY_SUFFIX;
- }
- public String getOreDictName(){
- return this.OREDICT_NAME;
- }
- }
-
+public class BaseItemLoot extends Item {
+
+ private final String materialName;
+ private final String unlocalName;
+ private final LootTypes lootTypes;
+ private Quality lootQuality;
+ private final Materials lootMaterial;
+
+ public BaseItemLoot(final LootTypes lootType, final Materials material) {
+ this.lootTypes = lootType;
+ this.lootMaterial = material;
+ this.materialName = material.mDefaultLocalName;
+ this.unlocalName = "item" + lootType.LOOT_TYPE + this.materialName;
+ this.setUnlocalizedName(this.unlocalName);
+ this.setMaxStackSize(1);
+ this.setTextureName(CORE.MODID + ":" + "item" + lootType.LOOT_TYPE);
+ }
+
+ public ItemStack generateLootStack() {
+ this.lootQuality = Quality.getRandomQuality();
+ return ItemUtils.getSimpleStack(this, 1);
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return (this.materialName + this.lootTypes.DISPLAY_SUFFIX);
+ }
+
+ public final String getMaterialName() {
+ return this.materialName;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(this.lootQuality.getQuality());
+
+ /*if (componentMaterial.isRadioactive){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }*/
+
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ final short[] temp = this.lootMaterial.mRGBa;
+ return Utils.rgbtoHexValue(temp[0], temp[1], temp[2]);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ // EntityUtils.applyRadiationDamageToEntity(lootQuality.vRadioationLevel, world, entityHolding);
+ }
+
+ public static enum LootTypes {
+ Sword("Sword", " Longsword", "sword"),
+ Shortsword("Sword", " Short Blade", "blade"),
+ Helmet("Helmet", " Medium Helm", "helmet"),
+ Chestplate("Platebody", " Chestplate", "platebody"),
+ Leggings("Platelegs", " Platelegs", "platelegs"),
+ Boots("Boots", " Boots", "boots");
+ private String LOOT_TYPE;
+ private String DISPLAY_SUFFIX;
+ private String OREDICT_NAME;
+
+ private LootTypes(final String LocalName, final String DisplayName, final String OreDictName) {
+ this.LOOT_TYPE = LocalName;
+ this.DISPLAY_SUFFIX = DisplayName;
+ this.OREDICT_NAME = OreDictName;
+ }
+
+ public String getLootType() {
+ return this.LOOT_TYPE;
+ }
+
+ public String getName() {
+ return this.DISPLAY_SUFFIX;
+ }
+
+ public String getOreDictName() {
+ return this.OREDICT_NAME;
+ }
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemTCShard.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemTCShard.java
index 4f0db3e2ec..1022061db5 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemTCShard.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemTCShard.java
@@ -1,9 +1,12 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -11,72 +14,64 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gregtech.api.util.GT_OreDictUnificator;
-
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class BaseItemTCShard extends Item{
-
- public final String unlocalName;
- public final String displayName;
- public final String descriptionString;
- public final String descriptionString2;
- public final int itemColour;
-
- public BaseItemTCShard(final String DisplayName, final int colour) {
- this(DisplayName, colour, "");
- }
-
- public BaseItemTCShard(final String DisplayName, final int colour, final String Description) {
- this(DisplayName, colour, "", Description);
- }
-
- public BaseItemTCShard(final String DisplayName, final int colour, final String Description, final String Description2) {
- this.unlocalName = "item"+Utils.sanitizeString(DisplayName);
- this.displayName = DisplayName;
- this.itemColour = colour;
- this.descriptionString = Description;
- this.descriptionString2 = Description2;
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(this.unlocalName);
- this.setMaxStackSize(64);
- this.setTextureName(CORE.MODID + ":" + "itemShard");
- GameRegistry.registerItem(this, this.unlocalName);
- GT_OreDictUnificator.registerOre("shard"+DisplayName, ItemUtils.getSimpleStack(this));
- GT_OreDictUnificator.registerOre("gemInfused"+DisplayName, ItemUtils.getSimpleStack(this));
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return (this.displayName+" Shard");
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if ((this.descriptionString != "") || !this.descriptionString.equals("")){
- list.add(EnumChatFormatting.GRAY+this.descriptionString);
- }
- if ((this.descriptionString2 != "") || !this.descriptionString2.equals("")){
- list.add(EnumChatFormatting.GRAY+this.descriptionString2);
- }
- }
-
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return this.itemColour;
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
-
- }
-
-
+public class BaseItemTCShard extends Item {
+
+ public final String unlocalName;
+ public final String displayName;
+ public final String descriptionString;
+ public final String descriptionString2;
+ public final int itemColour;
+
+ public BaseItemTCShard(final String DisplayName, final int colour) {
+ this(DisplayName, colour, "");
+ }
+
+ public BaseItemTCShard(final String DisplayName, final int colour, final String Description) {
+ this(DisplayName, colour, "", Description);
+ }
+
+ public BaseItemTCShard(
+ final String DisplayName, final int colour, final String Description, final String Description2) {
+ this.unlocalName = "item" + Utils.sanitizeString(DisplayName);
+ this.displayName = DisplayName;
+ this.itemColour = colour;
+ this.descriptionString = Description;
+ this.descriptionString2 = Description2;
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(this.unlocalName);
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemShard");
+ GameRegistry.registerItem(this, this.unlocalName);
+ GT_OreDictUnificator.registerOre("shard" + DisplayName, ItemUtils.getSimpleStack(this));
+ GT_OreDictUnificator.registerOre("gemInfused" + DisplayName, ItemUtils.getSimpleStack(this));
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return (this.displayName + " Shard");
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if ((this.descriptionString != "") || !this.descriptionString.equals("")) {
+ list.add(EnumChatFormatting.GRAY + this.descriptionString);
+ }
+ if ((this.descriptionString2 != "") || !this.descriptionString2.equals("")) {
+ list.add(EnumChatFormatting.GRAY + this.descriptionString2);
+ }
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ return this.itemColour;
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {}
}
-
-
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java
index eb066024e0..03c580a9c3 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemTickable.java
@@ -1,10 +1,12 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -14,328 +16,323 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
public class BaseItemTickable extends CoreItem {
- public final String[] descriptionString;
- public final int itemColour;
- public final int maxTicks;
- public final boolean twoRenderPasses;
- public final boolean ticksInContainers;
-
- public IIcon[] mIcon = new IIcon[2];
-
- public BaseItemTickable(boolean twoPass, final String unlocalName, final int colour, final int maxTicks) {
- this(false, twoPass, unlocalName, colour, maxTicks, new String[] {});
- }
-
- public BaseItemTickable(boolean containerTick, boolean twoPass, final String unlocalName, final int colour, final int maxTicks) {
- this(containerTick, twoPass, unlocalName, colour, maxTicks, new String[] {});
- }
-
- public BaseItemTickable(boolean containerTick, boolean twoPass, final String unlocalName, final int colour, final int maxTicks, final String[] Description) {
- super(unlocalName, AddToCreativeTab.tabMisc, 1, 999999999, Description, EnumRarity.epic, EnumChatFormatting.DARK_RED, true, null);
- this.itemColour = colour;
- this.descriptionString = Description;
- this.maxTicks = maxTicks;
- this.twoRenderPasses = twoPass;
- this.ticksInContainers = containerTick;
- this.maxStackSize = 1;
- //setGregtechItemList();
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (world == null || iStack == null) {
- return;
- }
- if (world.isRemote) {
- return;
- }
-
-
- boolean active = isTicking(world, iStack);
- if (active) {
- tickItemTag(world, iStack);
- }
-
- }
-
- /*private final boolean setGregtechItemList() {
- ItemList.Component_LavaFilter.set(this);
- return ItemList.Component_LavaFilter.get(1) != null ? true : false;
- }*/
-
- /**
- *
- * Handle Custom Rendering
- *
- */
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses(){
- return this.twoRenderPasses;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
- if (renderPass == 1 && this.twoRenderPasses){
- return Utils.rgbtoHexValue(255, 255, 255);
- }
- return this.itemColour;
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if (this.twoRenderPasses) {
- if(pass == 0) {
- return this.mIcon[0];
- }
- return this.mIcon[1];
- }
- return this.mIcon[0];
- }
-
- @Override
- public void registerIcons(final IIconRegister i) {
-
- if (this.twoRenderPasses){
- this.mIcon[0] = i.registerIcon(CORE.MODID + ":" + this.getUnlocalizedName());
- this.mIcon[1] = i.registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "_OVERLAY");
- }
- else {
- this.mIcon[0] = i.registerIcon(CORE.MODID + ":" + this.getUnlocalizedName());
- //this.overlay = i.registerIcon(getCorrectTextures() + "_OVERLAY");
- }
- }
-
- protected int getMaxTicks(ItemStack aStack) {
- return maxTicks;
- }
-
- protected boolean createNBT(World world, ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Tick", 0);
- tagNBT.setLong("maxTick", getMaxTicks(rStack));
- tagNBT.setBoolean("isActive", true);
-
- //Try set world time
- if (world != null) {
- //tagNBT.setLong("CreationDate", world.getTotalWorldTime());
- }
-
- tagMain.setTag("TickableItem", tagNBT);
- rStack.setTagCompound(tagMain);
- Logger.INFO("Created Tickable NBT data.");
- return true;
- }
-
- public final long getTicks(World world, final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- return aNBT.getLong("Tick");
- }
- }
- else {
- createNBT(world, aStack);
- }
- return 0L;
- }
-
- public final boolean setTicks(World world, final ItemStack aStack, final long aDamage) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- aNBT.setLong("Tick", aDamage);
- return true;
- }
- }
- else {
- createNBT(world, aStack);
- }
- return false;
- }
-
- public final boolean isTicking(World world, final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- return aNBT.getBoolean("isActive");
- }
- }
- else {
- return createNBT(world, aStack);
- }
- return true;
- }
-
- public final boolean setTicking(World world, final ItemStack aStack, final boolean active) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- aNBT.setBoolean("isActive", active);
- return true;
- }
- }
- else {
- createNBT(world, aStack);
- }
- return false;
- }
-
- public final boolean getTicksInContainer(World world, final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- return aNBT.getBoolean("ticksInContainer");
- }
- }
- else {
- createNBT(world, aStack);
- }
- return false;
- }
-
- public final boolean setTicksInContainer(World world, final ItemStack aStack, final boolean active) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- aNBT.setBoolean("ticksInContainer", active);
- return true;
- }
- }
- else {
- createNBT(world, aStack);
- }
- return false;
- }
-
- public final long getDifferenceInWorldTimeToCreationTime(World world, final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- return (world.getTotalWorldTime() - aNBT.getLong("CreationDate"));
- }
- }
- else {
- createNBT(world, aStack);
- }
- return 0L;
- }
-
- public final boolean setItemStackCreationTime(final ItemStack aStack, World world) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- aNBT.setLong("CreationDate", world.getTotalWorldTime());
- return true;
- }
- }
- else {
- createNBT(world, aStack);
- }
- return false;
- }
-
- public final boolean tickItemTag(World world, ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- if (aNBT.hasKey("TickableItem")) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- //Done Ticking
- if (getMaxTicks(aStack)-getTicks(world, aStack) <= 0) {
- setTicking(world, aStack, false);
- return false;
- }
- if (isTicking(world, aStack)) {
- if (aNBT != null) {
- aNBT.setLong("Tick", getTicks(world, aStack)+1);
- return true;
- }
- else {
- return false;
- }
- }
- else {
- return false;
- }
- }
- }
- return createNBT(world, aStack);
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- if (stack.getTagCompound() == null){
- //createNBT(null, stack);
- return 0;
- }
- double currentDamage = getTicks(null, stack);
- double durabilitypercent = currentDamage / getMaxTicks(stack);
- return durabilitypercent;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings("rawtypes") List list, boolean bool) {
- World world = player.getEntityWorld();
- if (this.descriptionString.length > 0) {
- list.add(EnumChatFormatting.GRAY+this.descriptionString[0]);
- }
- long maxTicks = getMaxTicks(stack);
- long ticks = 0;
- if (stack.hasTagCompound()) {
- ticks = getTicks(world, stack);
- }
- EnumChatFormatting durability = EnumChatFormatting.GRAY;
- if (maxTicks-ticks > (maxTicks*0.8)){
- durability = EnumChatFormatting.GRAY;
- }
- else if (maxTicks-ticks > (maxTicks*0.6)){
- durability = EnumChatFormatting.GREEN;
- }
- else if (maxTicks-ticks > (maxTicks*0.4)){
- durability = EnumChatFormatting.YELLOW;
- }
- else if (maxTicks-ticks > (maxTicks*0.2)){
- durability = EnumChatFormatting.GOLD;
- }
- else if (maxTicks-ticks > 0){
- durability = EnumChatFormatting.RED;
- }
- list.add(durability+""+((maxTicks-ticks)/20)+EnumChatFormatting.GRAY+" seconds until decay");
-
- if (this.descriptionString.length > 1) {
- for (int h=1;h<this.descriptionString.length;h++) {
- list.add(EnumChatFormatting.GRAY+this.descriptionString[h]);
- }
- }
-
- //super.addInformation(stack, player, list, bool);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
-
+ public final String[] descriptionString;
+ public final int itemColour;
+ public final int maxTicks;
+ public final boolean twoRenderPasses;
+ public final boolean ticksInContainers;
+
+ public IIcon[] mIcon = new IIcon[2];
+
+ public BaseItemTickable(boolean twoPass, final String unlocalName, final int colour, final int maxTicks) {
+ this(false, twoPass, unlocalName, colour, maxTicks, new String[] {});
+ }
+
+ public BaseItemTickable(
+ boolean containerTick, boolean twoPass, final String unlocalName, final int colour, final int maxTicks) {
+ this(containerTick, twoPass, unlocalName, colour, maxTicks, new String[] {});
+ }
+
+ public BaseItemTickable(
+ boolean containerTick,
+ boolean twoPass,
+ final String unlocalName,
+ final int colour,
+ final int maxTicks,
+ final String[] Description) {
+ super(
+ unlocalName,
+ AddToCreativeTab.tabMisc,
+ 1,
+ 999999999,
+ Description,
+ EnumRarity.epic,
+ EnumChatFormatting.DARK_RED,
+ true,
+ null);
+ this.itemColour = colour;
+ this.descriptionString = Description;
+ this.maxTicks = maxTicks;
+ this.twoRenderPasses = twoPass;
+ this.ticksInContainers = containerTick;
+ this.maxStackSize = 1;
+ // setGregtechItemList();
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (world == null || iStack == null) {
+ return;
+ }
+ if (world.isRemote) {
+ return;
+ }
+
+ boolean active = isTicking(world, iStack);
+ if (active) {
+ tickItemTag(world, iStack);
+ }
+ }
+
+ /*private final boolean setGregtechItemList() {
+ ItemList.Component_LavaFilter.set(this);
+ return ItemList.Component_LavaFilter.get(1) != null ? true : false;
+ }*/
+
+ /**
+ *
+ * Handle Custom Rendering
+ *
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return this.twoRenderPasses;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
+ if (renderPass == 1 && this.twoRenderPasses) {
+ return Utils.rgbtoHexValue(255, 255, 255);
+ }
+ return this.itemColour;
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if (this.twoRenderPasses) {
+ if (pass == 0) {
+ return this.mIcon[0];
+ }
+ return this.mIcon[1];
+ }
+ return this.mIcon[0];
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister i) {
+
+ if (this.twoRenderPasses) {
+ this.mIcon[0] = i.registerIcon(CORE.MODID + ":" + this.getUnlocalizedName());
+ this.mIcon[1] = i.registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "_OVERLAY");
+ } else {
+ this.mIcon[0] = i.registerIcon(CORE.MODID + ":" + this.getUnlocalizedName());
+ // this.overlay = i.registerIcon(getCorrectTextures() + "_OVERLAY");
+ }
+ }
+
+ protected int getMaxTicks(ItemStack aStack) {
+ return maxTicks;
+ }
+
+ protected boolean createNBT(World world, ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Tick", 0);
+ tagNBT.setLong("maxTick", getMaxTicks(rStack));
+ tagNBT.setBoolean("isActive", true);
+
+ // Try set world time
+ if (world != null) {
+ // tagNBT.setLong("CreationDate", world.getTotalWorldTime());
+ }
+
+ tagMain.setTag("TickableItem", tagNBT);
+ rStack.setTagCompound(tagMain);
+ Logger.INFO("Created Tickable NBT data.");
+ return true;
+ }
+
+ public final long getTicks(World world, final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ if (aNBT != null) {
+ return aNBT.getLong("Tick");
+ }
+ } else {
+ createNBT(world, aStack);
+ }
+ return 0L;
+ }
+
+ public final boolean setTicks(World world, final ItemStack aStack, final long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ if (aNBT != null) {
+ aNBT.setLong("Tick", aDamage);
+ return true;
+ }
+ } else {
+ createNBT(world, aStack);
+ }
+ return false;
+ }
+
+ public final boolean isTicking(World world, final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ if (aNBT != null) {
+ return aNBT.getBoolean("isActive");
+ }
+ } else {
+ return createNBT(world, aStack);
+ }
+ return true;
+ }
+
+ public final boolean setTicking(World world, final ItemStack aStack, final boolean active) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ if (aNBT != null) {
+ aNBT.setBoolean("isActive", active);
+ return true;
+ }
+ } else {
+ createNBT(world, aStack);
+ }
+ return false;
+ }
+
+ public final boolean getTicksInContainer(World world, final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ if (aNBT != null) {
+ return aNBT.getBoolean("ticksInContainer");
+ }
+ } else {
+ createNBT(world, aStack);
+ }
+ return false;
+ }
+
+ public final boolean setTicksInContainer(World world, final ItemStack aStack, final boolean active) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ if (aNBT != null) {
+ aNBT.setBoolean("ticksInContainer", active);
+ return true;
+ }
+ } else {
+ createNBT(world, aStack);
+ }
+ return false;
+ }
+
+ public final long getDifferenceInWorldTimeToCreationTime(World world, final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ if (aNBT != null) {
+ return (world.getTotalWorldTime() - aNBT.getLong("CreationDate"));
+ }
+ } else {
+ createNBT(world, aStack);
+ }
+ return 0L;
+ }
+
+ public final boolean setItemStackCreationTime(final ItemStack aStack, World world) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ if (aNBT != null) {
+ aNBT.setLong("CreationDate", world.getTotalWorldTime());
+ return true;
+ }
+ } else {
+ createNBT(world, aStack);
+ }
+ return false;
+ }
+
+ public final boolean tickItemTag(World world, ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ if (aNBT.hasKey("TickableItem")) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ // Done Ticking
+ if (getMaxTicks(aStack) - getTicks(world, aStack) <= 0) {
+ setTicking(world, aStack, false);
+ return false;
+ }
+ if (isTicking(world, aStack)) {
+ if (aNBT != null) {
+ aNBT.setLong("Tick", getTicks(world, aStack) + 1);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+ }
+ return createNBT(world, aStack);
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (stack.getTagCompound() == null) {
+ // createNBT(null, stack);
+ return 0;
+ }
+ double currentDamage = getTicks(null, stack);
+ double durabilitypercent = currentDamage / getMaxTicks(stack);
+ return durabilitypercent;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(
+ ItemStack stack, EntityPlayer player, @SuppressWarnings("rawtypes") List list, boolean bool) {
+ World world = player.getEntityWorld();
+ if (this.descriptionString.length > 0) {
+ list.add(EnumChatFormatting.GRAY + this.descriptionString[0]);
+ }
+ long maxTicks = getMaxTicks(stack);
+ long ticks = 0;
+ if (stack.hasTagCompound()) {
+ ticks = getTicks(world, stack);
+ }
+ EnumChatFormatting durability = EnumChatFormatting.GRAY;
+ if (maxTicks - ticks > (maxTicks * 0.8)) {
+ durability = EnumChatFormatting.GRAY;
+ } else if (maxTicks - ticks > (maxTicks * 0.6)) {
+ durability = EnumChatFormatting.GREEN;
+ } else if (maxTicks - ticks > (maxTicks * 0.4)) {
+ durability = EnumChatFormatting.YELLOW;
+ } else if (maxTicks - ticks > (maxTicks * 0.2)) {
+ durability = EnumChatFormatting.GOLD;
+ } else if (maxTicks - ticks > 0) {
+ durability = EnumChatFormatting.RED;
+ }
+ list.add(durability + "" + ((maxTicks - ticks) / 20) + EnumChatFormatting.GRAY + " seconds until decay");
+
+ if (this.descriptionString.length > 1) {
+ for (int h = 1; h < this.descriptionString.length; h++) {
+ list.add(EnumChatFormatting.GRAY + this.descriptionString[h]);
+ }
+ }
+
+ // super.addInformation(stack, player, list, bool);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemWithCharge.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemWithCharge.java
index d81112e0c6..5c9bf62455 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemWithCharge.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemWithCharge.java
@@ -1,7 +1,8 @@
package gtPlusPlus.core.item.base;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
import java.util.List;
-
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -10,67 +11,63 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-
-public class BaseItemWithCharge extends Item{
-
- public int int_Charge = 0;
- public int int_Max_Charge = 0;
-
- public BaseItemWithCharge(final String unlocalizedName, final int constructor_Charge, final int constructor_Max_Charge) {
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.int_Charge = constructor_Charge;
- this.int_Max_Charge = constructor_Max_Charge;
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- int NBT_Charge = this.int_Charge;
- int NBT_Max_Charge = this.int_Max_Charge;
- if (stack.stackTagCompound != null) {
- NBT_Charge = stack.stackTagCompound.getInteger("charge_Current");
- NBT_Max_Charge = stack.stackTagCompound.getInteger("charge_Max");
- final String tempX = String.valueOf(NBT_Charge);
- final String tempY = String.valueOf(NBT_Max_Charge);
- final String formattedX = EnumChatFormatting.RED+tempX+EnumChatFormatting.GRAY;
- final String formattedY = EnumChatFormatting.DARK_RED+tempY+EnumChatFormatting.GRAY;
- list.add(EnumChatFormatting.GRAY+"Charge:"+formattedX+"/"+formattedY+".");
- super.addInformation(stack, aPlayer, list, bool);
- }
- }
-
- //Ticking and NBT Handling
- /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
- * update it's contents.
- *
- * public int fuelRemaining = 0;
- public int maximumFuel = 0;
- public String fuelType = "";
- public float heat = 0;
- public float maxHeat = 5000;
- *
- */
- @Override
- public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
-
- }
+public class BaseItemWithCharge extends Item {
- @Override
- public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4, final boolean par5) {
+ public int int_Charge = 0;
+ public int int_Max_Charge = 0;
- }
+ public BaseItemWithCharge(
+ final String unlocalizedName, final int constructor_Charge, final int constructor_Max_Charge) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.int_Charge = constructor_Charge;
+ this.int_Max_Charge = constructor_Max_Charge;
+ }
- @Override
- public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) {
- itemStack.stackTagCompound = new NBTTagCompound();
- return super.onItemRightClick(itemStack, world, par3Entity);
- }
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ int NBT_Charge = this.int_Charge;
+ int NBT_Max_Charge = this.int_Max_Charge;
+ if (stack.stackTagCompound != null) {
+ NBT_Charge = stack.stackTagCompound.getInteger("charge_Current");
+ NBT_Max_Charge = stack.stackTagCompound.getInteger("charge_Max");
+ final String tempX = String.valueOf(NBT_Charge);
+ final String tempY = String.valueOf(NBT_Max_Charge);
+ final String formattedX = EnumChatFormatting.RED + tempX + EnumChatFormatting.GRAY;
+ final String formattedY = EnumChatFormatting.DARK_RED + tempY + EnumChatFormatting.GRAY;
+ list.add(EnumChatFormatting.GRAY + "Charge:" + formattedX + "/" + formattedY + ".");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+ }
+ // Ticking and NBT Handling
+ /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
+ * update it's contents.
+ *
+ * public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = 5000;
+ *
+ */
+ @Override
+ public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {}
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World par2World,
+ final Entity par3Entity,
+ final int par4,
+ final boolean par5) {}
+ @Override
+ public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ return super.onItemRightClick(itemStack, world, par3Entity);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java
index 14597ae876..383fdefaee 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java
@@ -1,27 +1,27 @@
package gtPlusPlus.core.item.base;
+import gtPlusPlus.core.lib.CORE;
import java.util.List;
-
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.lib.CORE;
+public class BaseItemWithDamageValue extends Item {
+ public BaseItemWithDamageValue(final String unlocalizedName) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(100);
+ }
+
+ @Override
+ public void setDamage(final ItemStack stack, final int damage) {
+ super.setDamage(stack, damage);
+ }
-public class BaseItemWithDamageValue extends Item{
- public BaseItemWithDamageValue(final String unlocalizedName) {
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setMaxDamage(100);
- }
- @Override
- public void setDamage(final ItemStack stack, final int damage) {
- super.setDamage(stack, damage);
- }
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- super.addInformation(stack, aPlayer, list, bool);
- }
-} \ No newline at end of file
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java b/src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
index 57d42d721e..5e8b7964b8 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
@@ -1,11 +1,10 @@
package gtPlusPlus.core.item.base;
-
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -18,237 +17,222 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-
-
-
-public class BasicSpawnEgg extends ItemMonsterPlacer
-{
- @SideOnly(Side.CLIENT)
- private IIcon theIcon;
- protected int colorBase = 0x000000;
- protected int colorSpots = 0xFFFFFF;
- protected String entityMODID = "";
- protected String entityToSpawnName = "";
- protected String entityToSpawnNameFull = "";
- protected EntityLiving entityToSpawn = null;
-
- public BasicSpawnEgg(){
- super();
- }
-
- public BasicSpawnEgg(final String MODID, final String parEntityToSpawnName, final int parPrimaryColor, final int parSecondaryColor){
- this.setHasSubtypes(false);
- this.maxStackSize = 64;
- this.setCreativeTab(AddToCreativeTab.tabOther);
- this.setEntityToSpawnName(parEntityToSpawnName);
- this.colorBase = parPrimaryColor;
- this.colorSpots = parSecondaryColor;
- this.entityMODID = MODID;
-
- // DEBUG
- Logger.WARNING("Spawn egg constructor for "+this.entityToSpawnName);
- }
-
- /**
- * Callback for item usage. If the item does something special on right clicking,
-
- * he will have one of those. Return
- * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
- */
- @Override
- public boolean onItemUse(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final World par3World, int par4, int par5, int par6, final int par7, final float par8, final float par9, final float par10){
- if (par3World.isRemote)
- {
- return true;
- }
- final Block block = par3World.getBlock(par4, par5, par6);
- par4 += Facing.offsetsXForSide[par7];
- par5 += Facing.offsetsYForSide[par7];
- par6 += Facing.offsetsZForSide[par7];
- double d0 = 0.0D;
-
- if ((par7 == 1) && (block.getRenderType() == 11))
- {
- d0 = 0.5D;
- }
-
- final Entity entity = this.spawnEntity(par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);
-
- if (entity != null)
- {
- if ((entity instanceof EntityLivingBase) && par1ItemStack.hasDisplayName())
- {
- ((EntityLiving)entity).setCustomNameTag(par1ItemStack.getDisplayName());
- }
-
- if (!par2EntityPlayer.capabilities.isCreativeMode)
- {
- --par1ItemStack.stackSize;
- }
- }
-
- return true;
- }
-
- /**
- * Called whenever this item is equipped and the right mouse button is pressed.
-
- *Args: itemStack, world, entityPlayer
- */
- @Override
- public ItemStack onItemRightClick(final ItemStack par1ItemStack, final World par2World, final EntityPlayer par3EntityPlayer){
- if (par2World.isRemote)
- {
- return par1ItemStack;
- }
- final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
-
- if (movingobjectposition == null)
- {
- return par1ItemStack;
- }
- if (movingobjectposition.typeOfHit == MovingObjectPosition
-
- .MovingObjectType.BLOCK)
-
- {
- final int i = movingobjectposition.blockX;
- final int j = movingobjectposition.blockY;
- final int k = movingobjectposition.blockZ;
-
- if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
- {
- return par1ItemStack;
- }
-
- if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
- {
- return par1ItemStack;
- }
-
- if (par2World.getBlock(i, j, k) instanceof BlockLiquid)
- {
- final Entity entity = this.spawnEntity(par2World, i, j, k);
-
- if (entity != null)
- {
- if ((entity instanceof EntityLivingBase) && par1ItemStack.hasDisplayName())
- {
- ((EntityLiving)entity).setCustomNameTag(par1ItemStack.getDisplayName());
- }
-
- if (!par3EntityPlayer.capabilities.isCreativeMode)
- {
- --par1ItemStack.stackSize;
- }
- }
- }
- }
-
- return par1ItemStack;
- }
-
- /**
- * Spawns the creature specified by the egg's type in the location specified by
-
- * the last three parameters.
- * Parameters: world, entityID, x, y, z.
- */
- public Entity spawnEntity(final World parWorld, final double parX, final double parY, final double parZ){
-
- if (!parWorld.isRemote) // never spawn entity on client side
- {
- this.entityToSpawnNameFull = this.entityMODID+"."+this.entityToSpawnName;
- if (EntityList.stringToClassMapping.containsKey(this.entityToSpawnNameFull))
- {
- this.entityToSpawn = (EntityLiving) EntityList
-
- .createEntityByName(this.entityToSpawnNameFull, parWorld);
- this.entityToSpawn.setLocationAndAngles(parX, parY, parZ,
-
- MathHelper.wrapAngleTo180_float(parWorld.rand.nextFloat()
-
- * 360.0F), 0.0F);
- parWorld.spawnEntityInWorld(this.entityToSpawn);
- this.entityToSpawn.onSpawnWithEgg((IEntityLivingData)null);
- this.entityToSpawn.playLivingSound();
- }
- else
- {
- //DEBUG
- Logger.WARNING("Entity not found "+this.entityToSpawnName);
- }
- }
-
- return this.entityToSpawn;
- }
-
-
- /**
- * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
- */
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item parItem, final CreativeTabs parTab, final List parList){
- parList.add(new ItemStack(parItem, 1, 0));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(final ItemStack par1ItemStack, final int parColorType){
- return (parColorType == 0) ? this.colorBase : this.colorSpots;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses(){
- return true;
- }
-
- @Override
- // Doing this override means that there is no localization for language
- // unless you specifically check for localization here and convert
- public String getItemStackDisplayName(final ItemStack par1ItemStack){
- return "Spawn "+this.entityToSpawnName;
- }
-
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister par1IconRegister){
- super.registerIcons(par1IconRegister);
- this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay");
- }
-
- /**
- * Gets an icon index based on an item's damage value and the given render pass
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamageForRenderPass(final int parDamageVal, final int parRenderPass){
- return parRenderPass > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(parDamageVal, parRenderPass);
- }
-
- public void setColors(final int parColorBase, final int parColorSpots){
- this.colorBase = parColorBase;
- this.colorSpots = parColorSpots;
- }
-
- public int getColorBase(){
- return this.colorBase;
- }
-
- public int getColorSpots(){
- return this.colorSpots;
- }
-
- public final void setEntityToSpawnName(final String parEntityToSpawnName){
- this.entityToSpawnName = parEntityToSpawnName;
- this.entityToSpawnNameFull = this.entityMODID+"."+this.entityToSpawnName;
- }
-
+public class BasicSpawnEgg extends ItemMonsterPlacer {
+ @SideOnly(Side.CLIENT)
+ private IIcon theIcon;
+
+ protected int colorBase = 0x000000;
+ protected int colorSpots = 0xFFFFFF;
+ protected String entityMODID = "";
+ protected String entityToSpawnName = "";
+ protected String entityToSpawnNameFull = "";
+ protected EntityLiving entityToSpawn = null;
+
+ public BasicSpawnEgg() {
+ super();
+ }
+
+ public BasicSpawnEgg(
+ final String MODID,
+ final String parEntityToSpawnName,
+ final int parPrimaryColor,
+ final int parSecondaryColor) {
+ this.setHasSubtypes(false);
+ this.maxStackSize = 64;
+ this.setCreativeTab(AddToCreativeTab.tabOther);
+ this.setEntityToSpawnName(parEntityToSpawnName);
+ this.colorBase = parPrimaryColor;
+ this.colorSpots = parSecondaryColor;
+ this.entityMODID = MODID;
+
+ // DEBUG
+ Logger.WARNING("Spawn egg constructor for " + this.entityToSpawnName);
+ }
+
+ /**
+ * Callback for item usage. If the item does something special on right clicking,
+ *
+ * he will have one of those. Return
+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
+ */
+ @Override
+ public boolean onItemUse(
+ final ItemStack par1ItemStack,
+ final EntityPlayer par2EntityPlayer,
+ final World par3World,
+ int par4,
+ int par5,
+ int par6,
+ final int par7,
+ final float par8,
+ final float par9,
+ final float par10) {
+ if (par3World.isRemote) {
+ return true;
+ }
+ final Block block = par3World.getBlock(par4, par5, par6);
+ par4 += Facing.offsetsXForSide[par7];
+ par5 += Facing.offsetsYForSide[par7];
+ par6 += Facing.offsetsZForSide[par7];
+ double d0 = 0.0D;
+
+ if ((par7 == 1) && (block.getRenderType() == 11)) {
+ d0 = 0.5D;
+ }
+
+ final Entity entity = this.spawnEntity(par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);
+
+ if (entity != null) {
+ if ((entity instanceof EntityLivingBase) && par1ItemStack.hasDisplayName()) {
+ ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
+ }
+
+ if (!par2EntityPlayer.capabilities.isCreativeMode) {
+ --par1ItemStack.stackSize;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Called whenever this item is equipped and the right mouse button is pressed.
+ *
+ *Args: itemStack, world, entityPlayer
+ */
+ @Override
+ public ItemStack onItemRightClick(
+ final ItemStack par1ItemStack, final World par2World, final EntityPlayer par3EntityPlayer) {
+ if (par2World.isRemote) {
+ return par1ItemStack;
+ }
+ final MovingObjectPosition movingobjectposition =
+ this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
+
+ if (movingobjectposition == null) {
+ return par1ItemStack;
+ }
+ if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
+
+ final int i = movingobjectposition.blockX;
+ final int j = movingobjectposition.blockY;
+ final int k = movingobjectposition.blockZ;
+
+ if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) {
+ return par1ItemStack;
+ }
+
+ if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) {
+ return par1ItemStack;
+ }
+
+ if (par2World.getBlock(i, j, k) instanceof BlockLiquid) {
+ final Entity entity = this.spawnEntity(par2World, i, j, k);
+
+ if (entity != null) {
+ if ((entity instanceof EntityLivingBase) && par1ItemStack.hasDisplayName()) {
+ ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
+ }
+
+ if (!par3EntityPlayer.capabilities.isCreativeMode) {
+ --par1ItemStack.stackSize;
+ }
+ }
+ }
+ }
+
+ return par1ItemStack;
+ }
+
+ /**
+ * Spawns the creature specified by the egg's type in the location specified by
+ *
+ * the last three parameters.
+ * Parameters: world, entityID, x, y, z.
+ */
+ public Entity spawnEntity(final World parWorld, final double parX, final double parY, final double parZ) {
+
+ if (!parWorld.isRemote) // never spawn entity on client side
+ {
+ this.entityToSpawnNameFull = this.entityMODID + "." + this.entityToSpawnName;
+ if (EntityList.stringToClassMapping.containsKey(this.entityToSpawnNameFull)) {
+ this.entityToSpawn = (EntityLiving) EntityList.createEntityByName(this.entityToSpawnNameFull, parWorld);
+
+ this.entityToSpawn.setLocationAndAngles(
+ parX, parY, parZ, MathHelper.wrapAngleTo180_float(parWorld.rand.nextFloat() * 360.0F), 0.0F);
+
+ parWorld.spawnEntityInWorld(this.entityToSpawn);
+ this.entityToSpawn.onSpawnWithEgg((IEntityLivingData) null);
+ this.entityToSpawn.playLivingSound();
+ } else {
+ // DEBUG
+ Logger.WARNING("Entity not found " + this.entityToSpawnName);
+ }
+ }
+
+ return this.entityToSpawn;
+ }
+
+ /**
+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
+ */
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(final Item parItem, final CreativeTabs parTab, final List parList) {
+ parList.add(new ItemStack(parItem, 1, 0));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(final ItemStack par1ItemStack, final int parColorType) {
+ return (parColorType == 0) ? this.colorBase : this.colorSpots;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+
+ @Override
+ // Doing this override means that there is no localization for language
+ // unless you specifically check for localization here and convert
+ public String getItemStackDisplayName(final ItemStack par1ItemStack) {
+ return "Spawn " + this.entityToSpawnName;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(final IIconRegister par1IconRegister) {
+ super.registerIcons(par1IconRegister);
+ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay");
+ }
+
+ /**
+ * Gets an icon index based on an item's damage value and the given render pass
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamageForRenderPass(final int parDamageVal, final int parRenderPass) {
+ return parRenderPass > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(parDamageVal, parRenderPass);
+ }
+
+ public void setColors(final int parColorBase, final int parColorSpots) {
+ this.colorBase = parColorBase;
+ this.colorSpots = parColorSpots;
+ }
+
+ public int getColorBase() {
+ return this.colorBase;
+ }
+
+ public int getColorSpots() {
+ return this.colorSpots;
+ }
+
+ public final void setEntityToSpawnName(final String parEntityToSpawnName) {
+ this.entityToSpawnName = parEntityToSpawnName;
+ this.entityToSpawnNameFull = this.entityMODID + "." + this.entityToSpawnName;
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/core/item/base/CoreItem.java b/src/main/java/gtPlusPlus/core/item/base/CoreItem.java
index fbd04eb30b..790b086ab3 100644
--- a/src/main/java/gtPlusPlus/core/item/base/CoreItem.java
+++ b/src/main/java/gtPlusPlus/core/item/base/CoreItem.java
@@ -1,11 +1,12 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -15,223 +16,313 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
+public class CoreItem extends Item {
+
+ private final EnumRarity rarity;
+ private final EnumChatFormatting descColour;
+ private final String[] itemDescription;
+ protected String itemName;
+ private final boolean hasEffect;
+
+ // Replace Item - What does this item turn into when held.
+ private final ItemStack turnsInto;
+
+ // 0
+ /*
+ * Name, Tab - 64 Stack, 0 Dmg
+ */
+ public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab) {
+ this(unlocalizedName, creativeTab, 64, 0); // Calls 3
+ }
+
+ // 0
+ /*
+ * Name, Tab - 64 Stack, 0 Dmg
+ */
+ public CoreItem(final String unlocalizedName, final String displayName, final CreativeTabs creativeTab) {
+ this(unlocalizedName, creativeTab, 64, 0); // Calls 3
+ this.itemName = displayName;
+ }
+
+ // 0.1
+ /*
+ * Name, Tab - 64 Stack, 0 Dmg
+ */
+ public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final ItemStack OverrideItem) {
+ this(
+ unlocalizedName,
+ creativeTab,
+ 64,
+ 0,
+ new String[] {
+ "This item will be replaced by another when held by a player, it is old and should not be used in recipes."
+ },
+ EnumRarity.uncommon,
+ EnumChatFormatting.UNDERLINE,
+ false,
+ OverrideItem); // Calls 5
+ }
+ // 0.1
+ /*
+ * Name, Tab - 64 Stack, 0 Dmg
+ */
+ public CoreItem(
+ final String unlocalizedName,
+ final String displayName,
+ final CreativeTabs creativeTab,
+ final ItemStack OverrideItem) {
+ this(
+ unlocalizedName,
+ creativeTab,
+ 64,
+ 0,
+ new String[] {
+ "This item will be replaced by another when held by a player, it is old and should not be used in recipes."
+ },
+ EnumRarity.uncommon,
+ EnumChatFormatting.UNDERLINE,
+ false,
+ OverrideItem); // Calls 5
+ this.itemName = displayName;
+ }
+
+ // 1
+ /*
+ * Name, Tab, Stack - 0 Dmg
+ */
+ public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize) {
+ this(unlocalizedName, creativeTab, stackSize, 0); // Calls 3
+ }
+ // 2
+ /*
+ * Name, Tab, Stack, Description - 0 Dmg
+ */
+ public CoreItem(
+ final String unlocalizedName,
+ final CreativeTabs creativeTab,
+ final int stackSize,
+ final String[] description) {
+ this(unlocalizedName, creativeTab, stackSize, 0, description); // Calls 4
+ }
+ // 3
+ /*
+ * Name, Tab, Stack, Dmg - Description
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, String string) {
+ this(unlocalizedName, creativeTab, stackSize, new String[] {string});
+ }
+
+ public CoreItem(
+ final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg) {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, new String[] {}); // Calls 4
+ }
+ // 4 //Not Rare + basic tooltip
+ /*
+ * Name, Tab, Stack, Dmg, Description
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String string) {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, new String[] {string});
+ }
+
+ public CoreItem(
+ final String unlocalizedName,
+ final CreativeTabs creativeTab,
+ final int stackSize,
+ final int maxDmg,
+ final String[] description) {
+ this(
+ unlocalizedName,
+ creativeTab,
+ stackSize,
+ maxDmg,
+ description,
+ EnumRarity.common,
+ EnumChatFormatting.GRAY,
+ false,
+ null); // Calls 4.5
+ }
+ // 4.5
+ /*
+ * Name, Tab, Stack, Dmg, Description, Text Colour - Common
+ */
+ public CoreItem(
+ final String unlocalizedName,
+ final CreativeTabs creativeTab,
+ final int stackSize,
+ final int maxDmg,
+ final String[] description,
+ final EnumChatFormatting colour) {
+ this(
+ unlocalizedName,
+ creativeTab,
+ stackSize,
+ maxDmg,
+ description,
+ EnumRarity.common,
+ colour,
+ false,
+ null); // Calls 5
+ }
+
+ // 4.75
+ /*
+ * Name, Tab, Stack, Dmg, Description, Rarity - Gray text
+ */
+ public CoreItem(
+ String unlocalizedName,
+ CreativeTabs creativeTab,
+ int stackSize,
+ int maxDmg,
+ String string,
+ EnumRarity uncommon) {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, new String[] {string}, uncommon);
+ }
+
+ public CoreItem(
+ final String unlocalizedName,
+ final CreativeTabs creativeTab,
+ final int stackSize,
+ final int maxDmg,
+ final String[] description,
+ final EnumRarity rarity) {
+ this(
+ unlocalizedName,
+ creativeTab,
+ stackSize,
+ maxDmg,
+ description,
+ rarity,
+ EnumChatFormatting.GRAY,
+ false,
+ null); // Calls 5
+ }
+
+ // 5
+ /*
+ * Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
+ */
+ public CoreItem(
+ final String unlocalizedName,
+ final CreativeTabs creativeTab,
+ final int stackSize,
+ final int maxDmg,
+ final String[] description,
+ final EnumRarity regRarity,
+ final EnumChatFormatting colour,
+ final boolean Effect,
+ final ItemStack OverrideItem) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(creativeTab);
+ this.setMaxStackSize(stackSize);
+ this.setMaxDamage(maxDmg);
+ this.rarity = regRarity;
+ this.itemDescription = description;
+ this.descColour = colour != null ? colour : EnumChatFormatting.RESET;
+ this.hasEffect = Effect;
+ this.turnsInto = OverrideItem;
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ // 6
+ /*
+ * Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
+ */
+ public CoreItem(
+ final String unlocalizedName,
+ final String displayName,
+ final CreativeTabs creativeTab,
+ final int stackSize,
+ final int maxDmg,
+ final String[] description,
+ final EnumRarity regRarity,
+ final EnumChatFormatting colour,
+ final boolean Effect,
+ final ItemStack OverrideItem) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.itemName = displayName;
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(creativeTab);
+ this.setMaxStackSize(stackSize);
+ this.setMaxDamage(maxDmg);
+ this.rarity = regRarity;
+ this.itemDescription = description;
+ this.descColour = colour != null ? colour : EnumChatFormatting.RESET;
+ this.hasEffect = Effect;
+ this.turnsInto = OverrideItem;
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.itemDescription.length > 0) {
+ for (int u = 0; u < this.itemDescription.length; u++) {
+ list.add(this.descColour + this.itemDescription[u]);
+ }
+ }
+ // list.add(this.descColour+this.itemDescription);
+ // super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return this.rarity;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return this.hasEffect;
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (this.turnsInto != null) {
+ if (entityHolding instanceof EntityPlayer) {
+
+ Logger.INFO("Replacing " + iStack.getDisplayName() + " with " + this.turnsInto.getDisplayName() + ".");
+ final ItemStack tempTransform = this.turnsInto;
+ if (iStack.stackSize == 64) {
+ tempTransform.stackSize = 64;
+ ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
+ for (int l = 0; l < 64; l++) {
+ ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
+ }
+
+ } else {
+ tempTransform.stackSize = 1;
+ ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
+ ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ public ItemStack getStack() {
+ return ItemUtils.getSimpleStack(this);
+ }
-public class CoreItem extends Item
-{
-
- private final EnumRarity rarity;
- private final EnumChatFormatting descColour;
- private final String[] itemDescription;
- protected String itemName;
- private final boolean hasEffect;
-
- //Replace Item - What does this item turn into when held.
- private final ItemStack turnsInto;
-
- //0
- /*
- * Name, Tab - 64 Stack, 0 Dmg
- */
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab)
- {
- this(unlocalizedName, creativeTab, 64, 0); //Calls 3
- }
-
- //0
- /*
- * Name, Tab - 64 Stack, 0 Dmg
- */
- public CoreItem(final String unlocalizedName, final String displayName, final CreativeTabs creativeTab)
- {
- this(unlocalizedName, creativeTab, 64, 0); //Calls 3
- this.itemName = displayName;
- }
-
- //0.1
- /*
- * Name, Tab - 64 Stack, 0 Dmg
- */
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final ItemStack OverrideItem)
- {
- this(unlocalizedName, creativeTab, 64, 0, new String[] {"This item will be replaced by another when held by a player, it is old and should not be used in recipes."}, EnumRarity.uncommon, EnumChatFormatting.UNDERLINE, false, OverrideItem); //Calls 5
- }
- //0.1
- /*
- * Name, Tab - 64 Stack, 0 Dmg
- */
- public CoreItem(final String unlocalizedName, final String displayName, final CreativeTabs creativeTab, final ItemStack OverrideItem)
- {
- this(unlocalizedName, creativeTab, 64, 0, new String[] {"This item will be replaced by another when held by a player, it is old and should not be used in recipes."}, EnumRarity.uncommon, EnumChatFormatting.UNDERLINE, false, OverrideItem); //Calls 5
- this.itemName = displayName;
- }
-
- //1
- /*
- * Name, Tab, Stack - 0 Dmg
- */
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize)
- {
- this(unlocalizedName, creativeTab, stackSize, 0); //Calls 3
- }
- //2
- /*
- * Name, Tab, Stack, Description - 0 Dmg
- */
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final String[] description)
- {
- this(unlocalizedName, creativeTab, stackSize, 0, description); //Calls 4
- }
- //3
- /*
- * Name, Tab, Stack, Dmg - Description
- */
- public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, String string) {
- this(unlocalizedName, creativeTab, stackSize, new String[] {string});
- }
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg)
- {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, new String[] {}); //Calls 4
- }
- //4 //Not Rare + basic tooltip
- /*
- * Name, Tab, Stack, Dmg, Description
- */
- public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String string) {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, new String[] {string});
- }
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg, final String[] description)
- {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, description, EnumRarity.common, EnumChatFormatting.GRAY, false, null); //Calls 4.5
- }
- //4.5
- /*
- * Name, Tab, Stack, Dmg, Description, Text Colour - Common
- */
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg, final String[] description, final EnumChatFormatting colour)
- {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, description, EnumRarity.common, colour, false, null); //Calls 5
- }
-
- //4.75
- /*
- * Name, Tab, Stack, Dmg, Description, Rarity - Gray text
- */
- public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String string, EnumRarity uncommon) {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, new String[] {string}, uncommon);
- }
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg, final String[] description, final EnumRarity rarity)
- {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, description, rarity, EnumChatFormatting.GRAY, false, null); //Calls 5
- }
-
- //5
- /*
- * Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
- */
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg, final String[] description, final EnumRarity regRarity, final EnumChatFormatting colour, final boolean Effect, final ItemStack OverrideItem)
- {
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(creativeTab);
- this.setMaxStackSize(stackSize);
- this.setMaxDamage(maxDmg);
- this.rarity = regRarity;
- this.itemDescription = description;
- this.descColour = colour != null ? colour : EnumChatFormatting.RESET;
- this.hasEffect = Effect;
- this.turnsInto = OverrideItem;
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- //6
- /*
- * Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
- */
- public CoreItem(final String unlocalizedName, final String displayName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg, final String[] description, final EnumRarity regRarity, final EnumChatFormatting colour, final boolean Effect, final ItemStack OverrideItem)
- {
- this.setUnlocalizedName(unlocalizedName);
- this.itemName = displayName;
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(creativeTab);
- this.setMaxStackSize(stackSize);
- this.setMaxDamage(maxDmg);
- this.rarity = regRarity;
- this.itemDescription = description;
- this.descColour = colour != null ? colour : EnumChatFormatting.RESET;
- this.hasEffect = Effect;
- this.turnsInto = OverrideItem;
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.itemDescription.length > 0) {
- for (int u=0;u<this.itemDescription.length;u++) {
- list.add(this.descColour+this.itemDescription[u]);
- }
- }
- //list.add(this.descColour+this.itemDescription);
- //super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return this.rarity;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return this.hasEffect;
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (this.turnsInto != null){
- if (entityHolding instanceof EntityPlayer){
-
- Logger.INFO("Replacing "+iStack.getDisplayName()+" with "+this.turnsInto.getDisplayName()+".");
- final ItemStack tempTransform = this.turnsInto;
- if (iStack.stackSize == 64){
- tempTransform.stackSize=64;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
- for (int l=0;l<64;l++){
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
-
- }
- else {
- tempTransform.stackSize=1;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
- }
- }
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- public ItemStack getStack() {
- return ItemUtils.getSimpleStack(this);
- }
-
-/* @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- if ((this.itemName == null) || this.itemName.equals("")) {
- return super.getItemStackDisplayName(tItem);
- }
- return this.itemName;
- }*/
-} \ No newline at end of file
+ /* @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ if ((this.itemName == null) || this.itemName.equals("")) {
+ return super.getItemStackDisplayName(tItem);
+ }
+ return this.itemName;
+ }*/
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java b/src/main/java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java
index 0420809253..74ff99a7fe 100644
--- a/src/main/java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java
+++ b/src/main/java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.bolts;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemBolt extends BaseItemComponent{
+public class BaseItemBolt extends BaseItemComponent {
- public BaseItemBolt(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.BOLT);
- }
+ public BaseItemBolt(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.BOLT);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
index ad47adcf64..ae601a1fc7 100644
--- a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
+++ b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.item.base.cell;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
@@ -10,61 +7,63 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import ic2.core.Ic2Items;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
-public class BaseItemCell extends BaseItemComponent{
+public class BaseItemCell extends BaseItemComponent {
+
+ ComponentTypes Cell = ComponentTypes.CELL;
- ComponentTypes Cell = ComponentTypes.CELL;
+ public BaseItemCell(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.CELL);
+ this.fluidColour = (short[]) material.getRGBA();
+ // FluidContainerRegistry.registerFluidContainer(material.getFluid(1000), ItemUtils.getSimpleStack(this),
+ // Ic2Items.cell.copy());
+ }
- public BaseItemCell(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.CELL);
- this.fluidColour = (short[]) material.getRGBA();
- //FluidContainerRegistry.registerFluidContainer(material.getFluid(1000), ItemUtils.getSimpleStack(this), Ic2Items.cell.copy());
- }
-
- public BaseItemCell(final String unlocalName, final String localName, final short[] RGBa) {
- super(unlocalName, localName, RGBa);
- this.fluidColour = RGBa;
- FluidStack aFluid = FluidUtils.getFluidStack(unlocalName.toLowerCase(), 1000);
- if (aFluid != null) {
- FluidContainerRegistry.registerFluidContainer(aFluid, ItemUtils.getSimpleStack(this), Ic2Items.cell.copy());
- }
- }
-
- public BaseItemCell(final String unlocalName, final String localName, final short[] RGBa, final Fluid cellFluid) {
- super(unlocalName, localName, RGBa);
- this.fluidColour = RGBa;
- FluidContainerRegistry.registerFluidContainer(FluidUtils.getFluidStack(cellFluid, 1000), ItemUtils.getSimpleStack(this), Ic2Items.cell.copy());
- }
+ public BaseItemCell(final String unlocalName, final String localName, final short[] RGBa) {
+ super(unlocalName, localName, RGBa);
+ this.fluidColour = RGBa;
+ FluidStack aFluid = FluidUtils.getFluidStack(unlocalName.toLowerCase(), 1000);
+ if (aFluid != null) {
+ FluidContainerRegistry.registerFluidContainer(aFluid, ItemUtils.getSimpleStack(this), Ic2Items.cell.copy());
+ }
+ }
- @Override
- public void registerIcons(final IIconRegister i) {
+ public BaseItemCell(final String unlocalName, final String localName, final short[] RGBa, final Fluid cellFluid) {
+ super(unlocalName, localName, RGBa);
+ this.fluidColour = RGBa;
+ FluidContainerRegistry.registerFluidContainer(
+ FluidUtils.getFluidStack(cellFluid, 1000), ItemUtils.getSimpleStack(this), Ic2Items.cell.copy());
+ }
- if (CORE.ConfigSwitches.useGregtechTextures){
- this.base = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell");
- this.overlay = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell_OVERLAY");
- }
- else {
- this.base = i.registerIcon(CORE.MODID + ":" + "item"+this.Cell.getComponent());
- this.overlay = i.registerIcon(CORE.MODID + ":" + "item"+this.Cell.getComponent()+"_Overlay");
- }
- //this.overlay = cellMaterial.getFluid(1000).getFluid().get
- }
+ @Override
+ public void registerIcons(final IIconRegister i) {
- private final short[] fluidColour;
- boolean upwards = true;
+ if (CORE.ConfigSwitches.useGregtechTextures) {
+ this.base = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell");
+ this.overlay = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell_OVERLAY");
+ } else {
+ this.base = i.registerIcon(CORE.MODID + ":" + "item" + this.Cell.getComponent());
+ this.overlay = i.registerIcon(CORE.MODID + ":" + "item" + this.Cell.getComponent() + "_Overlay");
+ }
+ // this.overlay = cellMaterial.getFluid(1000).getFluid().get
+ }
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
- if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures){
- return Utils.rgbtoHexValue(230, 230, 230);
- }
- if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures){
- return Utils.rgbtoHexValue(230, 230, 230);
- }
- return this.componentColour;
- }
+ private final short[] fluidColour;
+ boolean upwards = true;
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
+ if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures) {
+ return Utils.rgbtoHexValue(230, 230, 230);
+ }
+ if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures) {
+ return Utils.rgbtoHexValue(230, 230, 230);
+ }
+ return this.componentColour;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java
index 23d1d022fa..877c243c45 100644
--- a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java
+++ b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java
@@ -2,7 +2,10 @@ package gtPlusPlus.core.item.base.cell;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.item.base.BaseItemComponent;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.util.Utils;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
@@ -10,74 +13,71 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import gtPlusPlus.core.item.base.BaseItemComponent;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.util.Utils;
-
-public class BaseItemPlasmaCell extends BaseItemComponent{
-
- private IIcon base;
- private IIcon overlay;
- ComponentTypes PlasmaCell = ComponentTypes.PLASMACELL;
- private int tickCounter = 0;
- private final int tickCounterMax = 200;
- private final short[] fluidColour;
-
- public BaseItemPlasmaCell(final Material material) {
- super(material, ComponentTypes.PLASMACELL);
- this.fluidColour = (short[]) material.getRGBA();
- }
+public class BaseItemPlasmaCell extends BaseItemComponent {
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses(){
- return true;
- }
+ private IIcon base;
+ private IIcon overlay;
+ ComponentTypes PlasmaCell = ComponentTypes.PLASMACELL;
+ private int tickCounter = 0;
+ private final int tickCounterMax = 200;
+ private final short[] fluidColour;
- @Override
- public void registerIcons(final IIconRegister i) {
- this.base = i.registerIcon(CORE.MODID + ":" + "item"+this.PlasmaCell.getComponent());
- this.overlay = i.registerIcon(CORE.MODID + ":" + "item"+this.PlasmaCell.getComponent()+"_Overlay");
- //this.overlay = cellMaterial.getFluid(1000).getFluid().get
- }
+ public BaseItemPlasmaCell(final Material material) {
+ super(material, ComponentTypes.PLASMACELL);
+ this.fluidColour = (short[]) material.getRGBA();
+ }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
- if (renderPass == 0){
- return Utils.rgbtoHexValue(230, 230, 230);
- }
- return this.componentColour;
- }
+ @Override
+ public void registerIcons(final IIconRegister i) {
+ this.base = i.registerIcon(CORE.MODID + ":" + "item" + this.PlasmaCell.getComponent());
+ this.overlay = i.registerIcon(CORE.MODID + ":" + "item" + this.PlasmaCell.getComponent() + "_Overlay");
+ // this.overlay = cellMaterial.getFluid(1000).getFluid().get
+ }
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if(pass == 0) {
- return this.base;
- }
- return this.overlay;
- }
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
+ if (renderPass == 0) {
+ return Utils.rgbtoHexValue(230, 230, 230);
+ }
+ return this.componentColour;
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack cell) {
- return this.materialName+" Plasma Cell";
- }
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if (pass == 0) {
+ return this.base;
+ }
+ return this.overlay;
+ }
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (this.componentMaterial != null){
- if (!world.isRemote){
- if(this.tickCounter < this.tickCounterMax ){
- this.tickCounter++;
- }
- else if(this.tickCounter >= this.tickCounterMax){
- entityHolding.attackEntityFrom(DamageSource.onFire, 2);
- this.tickCounter = 0;
- }
- }
- }
- super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack cell) {
+ return this.materialName + " Plasma Cell";
+ }
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (this.componentMaterial != null) {
+ if (!world.isRemote) {
+ if (this.tickCounter < this.tickCounterMax) {
+ this.tickCounter++;
+ } else if (this.tickCounter >= this.tickCounterMax) {
+ entityHolding.attackEntityFrom(DamageSource.onFire, 2);
+ this.tickCounter = 0;
+ }
+ }
+ }
+ super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
index 9022f864cb..f392d0e6af 100644
--- a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
+++ b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -5,141 +5,136 @@ import gtPlusPlus.core.material.Material;
public class BaseItemDust extends BaseItemComponent {
- private BaseItemComponent[] mSizedDusts = new BaseItemComponent[2];
-
- public BaseItemDust(Material aMat) {
- this(aMat, true);
- }
-
- public BaseItemDust(Material aMat, boolean generateSmallDusts) {
- super(aMat, ComponentTypes.DUST);
- if (generateSmallDusts) {
- mSizedDusts[0] = new BaseItemComponent(aMat, ComponentTypes.DUSTSMALL);
- mSizedDusts[1] = new BaseItemComponent(aMat, ComponentTypes.DUSTTINY);
- }
- }
-
- public BaseItemDust(DustState aState, Material aMat) {
- super(aMat, ComponentTypes.DUST);
- if (aState.generatesSmallDust()) {
- mSizedDusts[0] = new BaseItemComponent(aMat, ComponentTypes.DUSTSMALL);
- }
- if (aState.generatesTinyDust()) {
- mSizedDusts[1] = new BaseItemComponent(aMat, ComponentTypes.DUSTTINY);
- }
- }
-
- private BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, boolean addRecipes) {
- super(matInfo, ComponentTypes.DUST);
- }
-
- public static class DustState {
- static final int NORMAL = (1);
- static final int SMALL = (10);
- static final int TINY = (100);
- final int MIXTURE;
- final boolean[] doesThings = new boolean[3];
-
- public DustState (boolean genDust, boolean genSmallDust, boolean genDustTiny){
- int aTotal = 0;
- if (genDust) {
- aTotal += NORMAL;
- doesThings[0] = true;
- }
- else {
- doesThings[0] = false;
- }
- if (genSmallDust) {
- aTotal += SMALL;
- doesThings[1] = true;
- }
- else {
- doesThings[1] = false;
- }
- if (genDustTiny) {
- aTotal += TINY;
- doesThings[2] = true;
- }
- else {
- doesThings[2] = false;
- }
- MIXTURE = aTotal;
- }
-
- public boolean generatesDust() {
- return doesThings[0];
- }
- public boolean generatesSmallDust() {
- return doesThings[1];
- }
- public boolean generatesTinyDust() {
- return doesThings[2];
- }
-
- private DustState(int amount) {
-
- if (amount == 1) {
- doesThings[0] = true;
- doesThings[1] = false;
- doesThings[2] = false;
-
- }
- else if (amount == 10) {
- doesThings[0] = false;
- doesThings[1] = true;
- doesThings[2] = false;
- }
- else if (amount == 100) {
- doesThings[0] = false;
- doesThings[1] = false;
- doesThings[2] = true;
-
- }
- else if (amount == 11) {
- doesThings[0] = true;
- doesThings[1] = true;
- doesThings[2] = false;
-
- }
- else if (amount == 101) {
- doesThings[0] = true;
- doesThings[1] = false;
- doesThings[2] = true;
-
- }
- else if (amount == 110) {
- doesThings[0] = false;
- doesThings[1] = true;
- doesThings[2] = true;
-
- }
- else if (amount == 111) {
- doesThings[0] = true;
- doesThings[1] = true;
- doesThings[2] = true;
- }
- else {
- doesThings[0] = false;
- doesThings[1] = false;
- doesThings[2] = false;
- }
- MIXTURE = amount;
- }
-
- public DustState get(int a) {
- if (a == 1) {
- return new DustState(NORMAL);
- }
- else if (a == 10) {
- return new DustState(SMALL);
- }
- else if (a == 100) {
- return new DustState(TINY);
- }
- else {
- return new DustState(MIXTURE);
- }
- }
- }
+ private BaseItemComponent[] mSizedDusts = new BaseItemComponent[2];
+ public BaseItemDust(Material aMat) {
+ this(aMat, true);
+ }
+
+ public BaseItemDust(Material aMat, boolean generateSmallDusts) {
+ super(aMat, ComponentTypes.DUST);
+ if (generateSmallDusts) {
+ mSizedDusts[0] = new BaseItemComponent(aMat, ComponentTypes.DUSTSMALL);
+ mSizedDusts[1] = new BaseItemComponent(aMat, ComponentTypes.DUSTTINY);
+ }
+ }
+
+ public BaseItemDust(DustState aState, Material aMat) {
+ super(aMat, ComponentTypes.DUST);
+ if (aState.generatesSmallDust()) {
+ mSizedDusts[0] = new BaseItemComponent(aMat, ComponentTypes.DUSTSMALL);
+ }
+ if (aState.generatesTinyDust()) {
+ mSizedDusts[1] = new BaseItemComponent(aMat, ComponentTypes.DUSTTINY);
+ }
+ }
+
+ private BaseItemDust(
+ String unlocalizedName,
+ String materialName,
+ Material matInfo,
+ int colour,
+ String pileSize,
+ int tier,
+ boolean addRecipes) {
+ super(matInfo, ComponentTypes.DUST);
+ }
+
+ public static class DustState {
+ static final int NORMAL = (1);
+ static final int SMALL = (10);
+ static final int TINY = (100);
+ final int MIXTURE;
+ final boolean[] doesThings = new boolean[3];
+
+ public DustState(boolean genDust, boolean genSmallDust, boolean genDustTiny) {
+ int aTotal = 0;
+ if (genDust) {
+ aTotal += NORMAL;
+ doesThings[0] = true;
+ } else {
+ doesThings[0] = false;
+ }
+ if (genSmallDust) {
+ aTotal += SMALL;
+ doesThings[1] = true;
+ } else {
+ doesThings[1] = false;
+ }
+ if (genDustTiny) {
+ aTotal += TINY;
+ doesThings[2] = true;
+ } else {
+ doesThings[2] = false;
+ }
+ MIXTURE = aTotal;
+ }
+
+ public boolean generatesDust() {
+ return doesThings[0];
+ }
+
+ public boolean generatesSmallDust() {
+ return doesThings[1];
+ }
+
+ public boolean generatesTinyDust() {
+ return doesThings[2];
+ }
+
+ private DustState(int amount) {
+
+ if (amount == 1) {
+ doesThings[0] = true;
+ doesThings[1] = false;
+ doesThings[2] = false;
+
+ } else if (amount == 10) {
+ doesThings[0] = false;
+ doesThings[1] = true;
+ doesThings[2] = false;
+ } else if (amount == 100) {
+ doesThings[0] = false;
+ doesThings[1] = false;
+ doesThings[2] = true;
+
+ } else if (amount == 11) {
+ doesThings[0] = true;
+ doesThings[1] = true;
+ doesThings[2] = false;
+
+ } else if (amount == 101) {
+ doesThings[0] = true;
+ doesThings[1] = false;
+ doesThings[2] = true;
+
+ } else if (amount == 110) {
+ doesThings[0] = false;
+ doesThings[1] = true;
+ doesThings[2] = true;
+
+ } else if (amount == 111) {
+ doesThings[0] = true;
+ doesThings[1] = true;
+ doesThings[2] = true;
+ } else {
+ doesThings[0] = false;
+ doesThings[1] = false;
+ doesThings[2] = false;
+ }
+ MIXTURE = amount;
+ }
+
+ public DustState get(int a) {
+ if (a == 1) {
+ return new DustState(NORMAL);
+ } else if (a == 10) {
+ return new DustState(SMALL);
+ } else if (a == 100) {
+ return new DustState(TINY);
+ } else {
+ return new DustState(MIXTURE);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
index 8ee871e9c4..beca8dc873 100644
--- a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
+++ b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
@@ -1,44 +1,40 @@
package gtPlusPlus.core.item.base.dusts;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.lib.CORE;
-
-public abstract class BaseItemDustAbstract extends Item{
-
- protected int colour = 0;
- protected String materialName;
- protected String pileType;
-
- public BaseItemDustAbstract(final String unlocalizedName, final String materialName, final int colour, final String pileSize) {
- this.setUnlocalizedName(unlocalizedName);
- this.setMaxStackSize(64);
- if (pileSize.equalsIgnoreCase("dust")){
- this.setTextureName(CORE.MODID + ":" + "dust");
- }
- else{
- this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);
- }
- this.setMaxStackSize(64);
- this.colour = colour;
- this.materialName = materialName;
- this.setUnlocalizedName(unlocalizedName);
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- public abstract void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool);
-
- public abstract String getMaterialName();
-
- @Override
- public abstract int getColorFromItemStack(ItemStack stack, int hex);
-
+public abstract class BaseItemDustAbstract extends Item {
+
+ protected int colour = 0;
+ protected String materialName;
+ protected String pileType;
+
+ public BaseItemDustAbstract(
+ final String unlocalizedName, final String materialName, final int colour, final String pileSize) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setMaxStackSize(64);
+ if (pileSize.equalsIgnoreCase("dust")) {
+ this.setTextureName(CORE.MODID + ":" + "dust");
+ } else {
+ this.setTextureName(CORE.MODID + ":" + "dust" + pileSize);
+ }
+ this.setMaxStackSize(64);
+ this.colour = colour;
+ this.materialName = materialName;
+ this.setUnlocalizedName(unlocalizedName);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public abstract void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool);
+
+ public abstract String getMaterialName();
+
+ @Override
+ public abstract int getColorFromItemStack(ItemStack stack, int hex);
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustEx.java b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustEx.java
index 0757177e58..c6d9cfdc71 100644
--- a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustEx.java
+++ b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustEx.java
@@ -1,126 +1,119 @@
package gtPlusPlus.core.item.base.dusts;
-import java.util.*;
-
-import org.apache.commons.lang3.StringUtils;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
import gregtech.api.enums.TextureSet;
import gregtech.api.util.GT_OreDictUnificator;
-
-import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.*;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import org.apache.commons.lang3.StringUtils;
-public class BaseItemDustEx extends BaseItemComponent{
+public class BaseItemDustEx extends BaseItemComponent {
- public static Map<String, String> mCachedPileLinkages = new HashMap<String, String>();
-
- protected IIcon[] baseAr = new IIcon[3];
- protected IIcon[] overlayAr = new IIcon[3];
- public final static ComponentTypes[] componentTypeAr = new ComponentTypes[] {ComponentTypes.DUST, ComponentTypes.DUSTSMALL, ComponentTypes.DUSTTINY};
+ public static Map<String, String> mCachedPileLinkages = new HashMap<String, String>();
- public BaseItemDustEx(final Material material) {
- super(material, componentTypeAr[0]);
- //OreDict this beauty
- GT_OreDictUnificator.registerOre(componentTypeAr[0].getOreDictName()+material.getUnlocalizedName(), ItemUtils.simpleMetaStack(this, 0, 1));
- GT_OreDictUnificator.registerOre(componentTypeAr[1].getOreDictName()+material.getUnlocalizedName(), ItemUtils.simpleMetaStack(this, 0, 1));
- GT_OreDictUnificator.registerOre(componentTypeAr[2].getOreDictName()+material.getUnlocalizedName(), ItemUtils.simpleMetaStack(this, 0, 1));
- bakeRegistry();
- }
-
- private void bakeRegistry() {
- String unlocalName = getUnlocalizedName();
- if (unlocalName.contains("item.")) {
- unlocalName = StringUtils.remove(unlocalName, "item.");
- }
- if (unlocalName.contains("itemDust")) {
- unlocalName = StringUtils.remove(unlocalName, "itemDust");
- }
- mCachedPileLinkages.put(this.getUnlocalizedName(), "itemDust"+unlocalName);
- mCachedPileLinkages.put(this.getUnlocalizedName(), "itemDustSmall"+unlocalName);
- mCachedPileLinkages.put(this.getUnlocalizedName(), "itemDustTiny"+unlocalName);
- }
+ protected IIcon[] baseAr = new IIcon[3];
+ protected IIcon[] overlayAr = new IIcon[3];
+ public static final ComponentTypes[] componentTypeAr =
+ new ComponentTypes[] {ComponentTypes.DUST, ComponentTypes.DUSTSMALL, ComponentTypes.DUSTTINY};
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 3; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
+ public BaseItemDustEx(final Material material) {
+ super(material, componentTypeAr[0]);
+ // OreDict this beauty
+ GT_OreDictUnificator.registerOre(
+ componentTypeAr[0].getOreDictName() + material.getUnlocalizedName(),
+ ItemUtils.simpleMetaStack(this, 0, 1));
+ GT_OreDictUnificator.registerOre(
+ componentTypeAr[1].getOreDictName() + material.getUnlocalizedName(),
+ ItemUtils.simpleMetaStack(this, 0, 1));
+ GT_OreDictUnificator.registerOre(
+ componentTypeAr[2].getOreDictName() + material.getUnlocalizedName(),
+ ItemUtils.simpleMetaStack(this, 0, 1));
+ bakeRegistry();
+ }
- @Override
- public IIcon getIconFromDamageForRenderPass(int meta, int pass) {
- if (CORE.ConfigSwitches.useGregtechTextures) {
- if (meta == 0) {
- if (pass == 0) {
- return this.baseAr[0];
- }
- else {
- return this.overlayAr[0];
- }
- }
- else if (meta == 1) {
- if (pass == 0) {
- return this.baseAr[1];
- }
- else {
- return this.overlayAr[1];
- }
- }
- else {
- if (pass == 0) {
- return this.baseAr[2];
- }
- else {
- return this.overlayAr[2];
- }
- }
- }
- else {
- return this.baseAr[meta];
- }
- }
+ private void bakeRegistry() {
+ String unlocalName = getUnlocalizedName();
+ if (unlocalName.contains("item.")) {
+ unlocalName = StringUtils.remove(unlocalName, "item.");
+ }
+ if (unlocalName.contains("itemDust")) {
+ unlocalName = StringUtils.remove(unlocalName, "itemDust");
+ }
+ mCachedPileLinkages.put(this.getUnlocalizedName(), "itemDust" + unlocalName);
+ mCachedPileLinkages.put(this.getUnlocalizedName(), "itemDustSmall" + unlocalName);
+ mCachedPileLinkages.put(this.getUnlocalizedName(), "itemDustTiny" + unlocalName);
+ }
- @Override
- public void registerIcons(final IIconRegister i) {
- if (CORE.ConfigSwitches.useGregtechTextures){
- this.baseAr[0] = i.registerIcon(getCorrectTextures());
- this.overlayAr[0] = i.registerIcon(getCorrectTextures() + "_OVERLAY");
- this.baseAr[1] = i.registerIcon(getCorrectTextures()+"Small");
- this.overlayAr[1] = i.registerIcon(getCorrectTextures() + "Small_OVERLAY");
- this.baseAr[2] = i.registerIcon(getCorrectTextures()+"Tiny");
- this.overlayAr[2] = i.registerIcon(getCorrectTextures() + "Tiny_OVERLAY");
- }
- else {
- this.baseAr[0] = i.registerIcon(getCorrectTextures());
- this.baseAr[1] = i.registerIcon(getCorrectTextures()+"Small");
- this.baseAr[2] = i.registerIcon(getCorrectTextures()+"Tiny");
- }
- }
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 3; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- public String getCorrectTextures(){
- if (!CORE.ConfigSwitches.useGregtechTextures){
- return CORE.MODID + ":" + "item"+this.componentType.getComponent();
- }
- String metType = "9j4852jyo3rjmh3owlhw9oe";
- if (this.componentMaterial != null) {
- TextureSet u = this.componentMaterial.getTextureSet();
- if (u != null) {
- metType = u.mSetName;
- }
- }
- metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
- return "gregtech" + ":" + "materialicons/"+metType+"/" + this.componentType.getOreDictName();
- }
+ @Override
+ public IIcon getIconFromDamageForRenderPass(int meta, int pass) {
+ if (CORE.ConfigSwitches.useGregtechTextures) {
+ if (meta == 0) {
+ if (pass == 0) {
+ return this.baseAr[0];
+ } else {
+ return this.overlayAr[0];
+ }
+ } else if (meta == 1) {
+ if (pass == 0) {
+ return this.baseAr[1];
+ } else {
+ return this.overlayAr[1];
+ }
+ } else {
+ if (pass == 0) {
+ return this.baseAr[2];
+ } else {
+ return this.overlayAr[2];
+ }
+ }
+ } else {
+ return this.baseAr[meta];
+ }
+ }
+ @Override
+ public void registerIcons(final IIconRegister i) {
+ if (CORE.ConfigSwitches.useGregtechTextures) {
+ this.baseAr[0] = i.registerIcon(getCorrectTextures());
+ this.overlayAr[0] = i.registerIcon(getCorrectTextures() + "_OVERLAY");
+ this.baseAr[1] = i.registerIcon(getCorrectTextures() + "Small");
+ this.overlayAr[1] = i.registerIcon(getCorrectTextures() + "Small_OVERLAY");
+ this.baseAr[2] = i.registerIcon(getCorrectTextures() + "Tiny");
+ this.overlayAr[2] = i.registerIcon(getCorrectTextures() + "Tiny_OVERLAY");
+ } else {
+ this.baseAr[0] = i.registerIcon(getCorrectTextures());
+ this.baseAr[1] = i.registerIcon(getCorrectTextures() + "Small");
+ this.baseAr[2] = i.registerIcon(getCorrectTextures() + "Tiny");
+ }
+ }
+ @Override
+ public String getCorrectTextures() {
+ if (!CORE.ConfigSwitches.useGregtechTextures) {
+ return CORE.MODID + ":" + "item" + this.componentType.getComponent();
+ }
+ String metType = "9j4852jyo3rjmh3owlhw9oe";
+ if (this.componentMaterial != null) {
+ TextureSet u = this.componentMaterial.getTextureSet();
+ if (u != null) {
+ metType = u.mSetName;
+ }
+ }
+ metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
+ return "gregtech" + ":" + "materialicons/" + metType + "/" + this.componentType.getOreDictName();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
index e4fa06c58e..8554844e50 100644
--- a/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
+++ b/src/main/java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
@@ -2,161 +2,155 @@ package gtPlusPlus.core.item.base.dusts;
import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.data.StringUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
-public class BaseItemDustUnique extends Item{
-
- protected final int colour;
- protected final int sRadiation;
- protected final String materialName;
- protected final String name;
- protected final String chemicalNotation;
-
- public BaseItemDustUnique(final String unlocalizedName, final String materialName, final int colour, final String pileSize) {
- this(unlocalizedName, materialName, "NullFormula", colour, pileSize);
- }
-
- public BaseItemDustUnique(final String unlocalizedName, final String materialName, final String mChemicalFormula, final int colour, final String pileSize) {
- this.setUnlocalizedName(unlocalizedName);
- this.setMaxStackSize(64);
- this.setTextureName(this.getCorrectTexture(pileSize));
- this.setCreativeTab(tabMisc);
- this.colour = colour;
- this.materialName = materialName;
- if (mChemicalFormula == null || mChemicalFormula.equals("") || mChemicalFormula.equals("NullFormula")){
- this.chemicalNotation = StringUtils.subscript(materialName);
- }
- else {
- this.chemicalNotation = StringUtils.subscript(mChemicalFormula);
- }
- this.sRadiation = ItemUtils.getRadioactivityLevel(materialName);
- GameRegistry.registerItem(this, unlocalizedName);
-
- if (this.getUnlocalizedName().contains("DustTiny")){
- this.name = "Tiny Pile of "+this.materialName+ " Dust";
- }
- else if (this.getUnlocalizedName().contains("DustSmall")){
- this.name = "Small Pile of "+this.materialName+ " Dust";
- }
- else {
- this.name = this.materialName+ " Dust";
- }
-
- String temp = "";
- Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName());
- if (this.getUnlocalizedName().contains("item.")){
- temp = this.getUnlocalizedName().replace("item.", "");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- else {
- temp = this.getUnlocalizedName();
- }
- if (temp.contains("DustTiny")){
- temp = temp.replace("itemD", "d");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- else if (temp.contains("DustSmall")){
- temp = temp.replace("itemD", "d");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- else {
- temp = temp.replace("itemD", "d");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- if ((temp != null) && !temp.equals("")){
- GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
- }
- registerComponent();
- }
-
- public boolean registerComponent() {
- if (this.materialName == null) {
- return false;
- }
- String aName = materialName;
- //Register Component
- Map<String, ItemStack> aMap = Material.mComponentMap.get(aName);
- if (aMap == null) {
- aMap = new HashMap<String, ItemStack>();
- }
- String aKey = OrePrefixes.dust.name();
- ItemStack x = aMap.get(aKey);
- if (x == null) {
- aMap.put(aKey, ItemUtils.getSimpleStack(this));
- Logger.MATERIALS("Registering a material component. Item: ["+aName+"] Map: ["+aKey+"]");
- Material.mComponentMap.put(aName, aMap);
- return true;
- }
- else {
- //Bad
- Logger.MATERIALS("Tried to double register a material component. ");
- return false;
- }
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack iStack) {
- return this.name;
- }
-
- private String getCorrectTexture(final String pileSize){
- if (!CORE.ConfigSwitches.useGregtechTextures){
- if ((pileSize.equals("dust")) || (pileSize.equals("Dust"))){
- this.setTextureName(CORE.MODID + ":" + "dust");}
- else{
- this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);
- }
- }
- if (pileSize.toLowerCase().contains("small")){
- return "gregtech" + ":" + "materialicons/SHINY/dustSmall";
- }
- else if (pileSize.toLowerCase().contains("tiny")){
- return "gregtech" + ":" + "materialicons/SHINY/dustTiny";
- }
- return "gregtech" + ":" + "materialicons/SHINY/dust";
- }
-
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.sRadiation > 0){
- list.add(CORE.GT_Tooltip_Radioactive);
- }
- if (this.chemicalNotation.length() > 0 && !chemicalNotation.equals("") && !chemicalNotation.equals("NullFormula")){
- list.add(this.chemicalNotation);
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- public final String getMaterialName() {
- return StringUtils.subscript(this.materialName);
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0){
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
-
- }
-
+public class BaseItemDustUnique extends Item {
+
+ protected final int colour;
+ protected final int sRadiation;
+ protected final String materialName;
+ protected final String name;
+ protected final String chemicalNotation;
+
+ public BaseItemDustUnique(
+ final String unlocalizedName, final String materialName, final int colour, final String pileSize) {
+ this(unlocalizedName, materialName, "NullFormula", colour, pileSize);
+ }
+
+ public BaseItemDustUnique(
+ final String unlocalizedName,
+ final String materialName,
+ final String mChemicalFormula,
+ final int colour,
+ final String pileSize) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setMaxStackSize(64);
+ this.setTextureName(this.getCorrectTexture(pileSize));
+ this.setCreativeTab(tabMisc);
+ this.colour = colour;
+ this.materialName = materialName;
+ if (mChemicalFormula == null || mChemicalFormula.equals("") || mChemicalFormula.equals("NullFormula")) {
+ this.chemicalNotation = StringUtils.subscript(materialName);
+ } else {
+ this.chemicalNotation = StringUtils.subscript(mChemicalFormula);
+ }
+ this.sRadiation = ItemUtils.getRadioactivityLevel(materialName);
+ GameRegistry.registerItem(this, unlocalizedName);
+
+ if (this.getUnlocalizedName().contains("DustTiny")) {
+ this.name = "Tiny Pile of " + this.materialName + " Dust";
+ } else if (this.getUnlocalizedName().contains("DustSmall")) {
+ this.name = "Small Pile of " + this.materialName + " Dust";
+ } else {
+ this.name = this.materialName + " Dust";
+ }
+
+ String temp = "";
+ Logger.WARNING("Unlocalized name for OreDict nameGen: " + this.getUnlocalizedName());
+ if (this.getUnlocalizedName().contains("item.")) {
+ temp = this.getUnlocalizedName().replace("item.", "");
+ Logger.WARNING("Generating OreDict Name: " + temp);
+ } else {
+ temp = this.getUnlocalizedName();
+ }
+ if (temp.contains("DustTiny")) {
+ temp = temp.replace("itemD", "d");
+ Logger.WARNING("Generating OreDict Name: " + temp);
+ } else if (temp.contains("DustSmall")) {
+ temp = temp.replace("itemD", "d");
+ Logger.WARNING("Generating OreDict Name: " + temp);
+ } else {
+ temp = temp.replace("itemD", "d");
+ Logger.WARNING("Generating OreDict Name: " + temp);
+ }
+ if ((temp != null) && !temp.equals("")) {
+ GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
+ }
+ registerComponent();
+ }
+
+ public boolean registerComponent() {
+ if (this.materialName == null) {
+ return false;
+ }
+ String aName = materialName;
+ // Register Component
+ Map<String, ItemStack> aMap = Material.mComponentMap.get(aName);
+ if (aMap == null) {
+ aMap = new HashMap<String, ItemStack>();
+ }
+ String aKey = OrePrefixes.dust.name();
+ ItemStack x = aMap.get(aKey);
+ if (x == null) {
+ aMap.put(aKey, ItemUtils.getSimpleStack(this));
+ Logger.MATERIALS("Registering a material component. Item: [" + aName + "] Map: [" + aKey + "]");
+ Material.mComponentMap.put(aName, aMap);
+ return true;
+ } else {
+ // Bad
+ Logger.MATERIALS("Tried to double register a material component. ");
+ return false;
+ }
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack iStack) {
+ return this.name;
+ }
+
+ private String getCorrectTexture(final String pileSize) {
+ if (!CORE.ConfigSwitches.useGregtechTextures) {
+ if ((pileSize.equals("dust")) || (pileSize.equals("Dust"))) {
+ this.setTextureName(CORE.MODID + ":" + "dust");
+ } else {
+ this.setTextureName(CORE.MODID + ":" + "dust" + pileSize);
+ }
+ }
+ if (pileSize.toLowerCase().contains("small")) {
+ return "gregtech" + ":" + "materialicons/SHINY/dustSmall";
+ } else if (pileSize.toLowerCase().contains("tiny")) {
+ return "gregtech" + ":" + "materialicons/SHINY/dustTiny";
+ }
+ return "gregtech" + ":" + "materialicons/SHINY/dust";
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.sRadiation > 0) {
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ if (this.chemicalNotation.length() > 0
+ && !chemicalNotation.equals("")
+ && !chemicalNotation.equals("NullFormula")) {
+ list.add(this.chemicalNotation);
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return StringUtils.subscript(this.materialName);
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ if (this.colour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.colour;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java b/src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java
index c6aff85da1..d84519d792 100644
--- a/src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java
+++ b/src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java
@@ -1,58 +1,54 @@
package gtPlusPlus.core.item.base.dusts.decimal;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
-
-public class BaseItemCentidust extends Item{
-
- final Material dustMaterial;
- final String materialName;
- final String unlocalName;
-
- public BaseItemCentidust(final Material material) {
- this.dustMaterial = material;
- this.unlocalName = "itemCentidust"+material.getUnlocalizedName();
- this.materialName = material.getLocalizedName();
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(this.unlocalName);
- this.setMaxStackSize(10);
- this.setTextureName(CORE.MODID + ":" + "itemCentidust"); //TODO
- GameRegistry.registerItem(this, this.unlocalName);
- //GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); //TODO
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return (this.materialName+ " Centidust");
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("")){
- list.add(EnumChatFormatting.GRAY+"1% of a " + this.materialName + " dust pile.");
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return this.dustMaterial.getRgbAsHex();
- }
-
+public class BaseItemCentidust extends Item {
+
+ final Material dustMaterial;
+ final String materialName;
+ final String unlocalName;
+
+ public BaseItemCentidust(final Material material) {
+ this.dustMaterial = material;
+ this.unlocalName = "itemCentidust" + material.getUnlocalizedName();
+ this.materialName = material.getLocalizedName();
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(this.unlocalName);
+ this.setMaxStackSize(10);
+ this.setTextureName(CORE.MODID + ":" + "itemCentidust"); // TODO
+ GameRegistry.registerItem(this, this.unlocalName);
+ // GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); //TODO
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+
+ return (this.materialName + " Centidust");
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("")) {
+ list.add(EnumChatFormatting.GRAY + "1% of a " + this.materialName + " dust pile.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return this.materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ return this.dustMaterial.getRgbAsHex();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java b/src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java
index 2d1b4a8d27..b49e9d3288 100644
--- a/src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java
+++ b/src/main/java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java
@@ -1,58 +1,54 @@
package gtPlusPlus.core.item.base.dusts.decimal;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
-
-public class BaseItemDecidust extends Item{
-
- final Material dustMaterial;
- final String materialName;
- final String unlocalName;
-
- public BaseItemDecidust(final Material material) {
- this.dustMaterial = material;
- this.unlocalName = "itemDecidust"+material.getUnlocalizedName();
- this.materialName = material.getLocalizedName();
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(this.unlocalName);
- this.setMaxStackSize(10);
- this.setTextureName(CORE.MODID + ":" + "itemDecidust"); //TODO
- GameRegistry.registerItem(this, this.unlocalName);
- //GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); //TODO
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return (this.materialName+ " Decidust");
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("")){
- list.add(EnumChatFormatting.GRAY+"10% of a " + this.materialName + " dust pile.");
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return this.dustMaterial.getRgbAsHex();
- }
-
+public class BaseItemDecidust extends Item {
+
+ final Material dustMaterial;
+ final String materialName;
+ final String unlocalName;
+
+ public BaseItemDecidust(final Material material) {
+ this.dustMaterial = material;
+ this.unlocalName = "itemDecidust" + material.getUnlocalizedName();
+ this.materialName = material.getLocalizedName();
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(this.unlocalName);
+ this.setMaxStackSize(10);
+ this.setTextureName(CORE.MODID + ":" + "itemDecidust"); // TODO
+ GameRegistry.registerItem(this, this.unlocalName);
+ // GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); //TODO
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+
+ return (this.materialName + " Decidust");
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("")) {
+ list.add(EnumChatFormatting.GRAY + "10% of a " + this.materialName + " dust pile.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return this.materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ return this.dustMaterial.getRgbAsHex();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/foil/BaseItemFoil.java b/src/main/java/gtPlusPlus/core/item/base/foil/BaseItemFoil.java
index 3e2816bf52..9b55461cfd 100644
--- a/src/main/java/gtPlusPlus/core/item/base/foil/BaseItemFoil.java
+++ b/src/main/java/gtPlusPlus/core/item/base/foil/BaseItemFoil.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.foil;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemFoil extends BaseItemComponent{
+public class BaseItemFoil extends BaseItemComponent {
- public BaseItemFoil(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.FOIL);
- }
+ public BaseItemFoil(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.FOIL);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/foods/BaseItemFood.java b/src/main/java/gtPlusPlus/core/item/base/foods/BaseItemFood.java
index 54aa90c03f..d96e3c8565 100644
--- a/src/main/java/gtPlusPlus/core/item/base/foods/BaseItemFood.java
+++ b/src/main/java/gtPlusPlus/core/item/base/foods/BaseItemFood.java
@@ -1,50 +1,53 @@
package gtPlusPlus.core.item.base.foods;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-
public class BaseItemFood extends ItemFood {
- private final PotionEffect[] effects;
- protected String localName;
-
- public BaseItemFood(final String unlocalizedName, final String localizedName, final int healAmount, final float saturationModifier, final boolean wolvesFavorite, final PotionEffect... effects) {
- super(healAmount, saturationModifier, wolvesFavorite);
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName.replace("Hot", ""));
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.effects = effects;
- this.localName = localizedName;
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- @Override
- protected void onFoodEaten(final ItemStack stack, final World world, final EntityPlayer player) {
- super.onFoodEaten(stack, world, player);
-
- for (int i = 0; i < this.effects.length; i ++) {
- if (!world.isRemote && (this.effects[i] != null) && (this.effects[i].getPotionID() > 0)) {
- player.addPotionEffect(new PotionEffect(this.effects[i].getPotionID(),
- this.effects[i].getDuration(), this.effects[i].getAmplifier(),
- this.effects[i].getIsAmbient()
- )
- );
- }
- }
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return ("A Serving of "+this.localName);
- }
-
-} \ No newline at end of file
+ private final PotionEffect[] effects;
+ protected String localName;
+
+ public BaseItemFood(
+ final String unlocalizedName,
+ final String localizedName,
+ final int healAmount,
+ final float saturationModifier,
+ final boolean wolvesFavorite,
+ final PotionEffect... effects) {
+ super(healAmount, saturationModifier, wolvesFavorite);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName.replace("Hot", ""));
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.effects = effects;
+ this.localName = localizedName;
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @Override
+ protected void onFoodEaten(final ItemStack stack, final World world, final EntityPlayer player) {
+ super.onFoodEaten(stack, world, player);
+
+ for (int i = 0; i < this.effects.length; i++) {
+ if (!world.isRemote && (this.effects[i] != null) && (this.effects[i].getPotionID() > 0)) {
+ player.addPotionEffect(new PotionEffect(
+ this.effects[i].getPotionID(),
+ this.effects[i].getDuration(),
+ this.effects[i].getAmplifier(),
+ this.effects[i].getIsAmbient()));
+ }
+ }
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+
+ return ("A Serving of " + this.localName);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java b/src/main/java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java
index 528b9593e6..4fef548705 100644
--- a/src/main/java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java
+++ b/src/main/java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java
@@ -1,7 +1,10 @@
package gtPlusPlus.core.item.base.foods;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import java.util.List;
-
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -10,71 +13,77 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class BaseItemHotFood extends BaseItemFood{
-
- protected String materialName;
- protected String unlocalName;
- protected int cooldownTime;
- protected Item output;
-
- public BaseItemHotFood(final String unlocalizedName, final int healAmount, final float healSaturation, final String foodName, final int timeToCoolInSeconds, final Item cooledFood) {
- super(unlocalizedName, "Hot "+foodName, healAmount, healSaturation, false);
- this.unlocalName = unlocalizedName;
- this.cooldownTime = timeToCoolInSeconds * 20;
- this.materialName = foodName;
- this.output = cooledFood;
- this.setMaxStackSize(1);
- }
-
- @Override
- public ItemStack onEaten(final ItemStack iStack, final World world, final EntityPlayer player) {
- return super.onEaten(iStack, world, player);
- }
+public class BaseItemHotFood extends BaseItemFood {
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- //Utils.LOG_INFO("Item Damage: "+iStack.getItemDamage()+" Max Damage: "+iStack.getMaxDamage());
- if (!world.isRemote){
- if(iStack.getItemDamage() == this.cooldownTime) {
- if (entityHolding instanceof EntityPlayer){
- Logger.INFO("Foods Done.");
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory(ItemUtils.getSimpleStack(this.output));
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
- }else if(iStack.getItemDamage() < this.cooldownTime){
- iStack.setItemDamage(iStack.getItemDamage() + 1);
- }
- if(MathUtils.divideXintoY(iStack.getItemDamage(), 150)){
- entityHolding.attackEntityFrom(DamageSource.onFire, 1);
- }
+ protected String materialName;
+ protected String unlocalName;
+ protected int cooldownTime;
+ protected Item output;
+ public BaseItemHotFood(
+ final String unlocalizedName,
+ final int healAmount,
+ final float healSaturation,
+ final String foodName,
+ final int timeToCoolInSeconds,
+ final Item cooledFood) {
+ super(unlocalizedName, "Hot " + foodName, healAmount, healSaturation, false);
+ this.unlocalName = unlocalizedName;
+ this.cooldownTime = timeToCoolInSeconds * 20;
+ this.materialName = foodName;
+ this.output = cooledFood;
+ this.setMaxStackSize(1);
+ }
- }
- super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
- }
+ @Override
+ public ItemStack onEaten(final ItemStack iStack, final World world, final EntityPlayer player) {
+ return super.onEaten(iStack, world, player);
+ }
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("")){
- list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot!"+EnumChatFormatting.GRAY+" Avoid direct handling..");
- list.add(EnumChatFormatting.GRAY+"This food has "+((this.cooldownTime-stack.getItemDamage())/20)+" seconds left, until it is cool.");
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ // Utils.LOG_INFO("Item Damage: "+iStack.getItemDamage()+" Max Damage: "+iStack.getMaxDamage());
+ if (!world.isRemote) {
+ if (iStack.getItemDamage() == this.cooldownTime) {
+ if (entityHolding instanceof EntityPlayer) {
+ Logger.INFO("Foods Done.");
+ ((EntityPlayer) entityHolding)
+ .inventory.addItemStackToInventory(ItemUtils.getSimpleStack(this.output));
+ ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
+ }
+ } else if (iStack.getItemDamage() < this.cooldownTime) {
+ iStack.setItemDamage(iStack.getItemDamage() + 1);
+ }
+ if (MathUtils.divideXintoY(iStack.getItemDamage(), 150)) {
+ entityHolding.attackEntityFrom(DamageSource.onFire, 1);
+ }
+ }
+ super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
+ }
- public final String getMaterialName() {
- return this.materialName;
- }
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("")) {
+ list.add(EnumChatFormatting.GRAY + "Warning: " + EnumChatFormatting.RED + "Very hot!"
+ + EnumChatFormatting.GRAY + " Avoid direct handling..");
+ list.add(EnumChatFormatting.GRAY + "This food has " + ((this.cooldownTime - stack.getItemDamage()) / 20)
+ + " seconds left, until it is cool.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return Utils.rgbtoHexValue(230, 96, 96);
+ public final String getMaterialName() {
+ return this.materialName;
+ }
- }
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ return Utils.rgbtoHexValue(230, 96, 96);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/gears/BaseItemGear.java b/src/main/java/gtPlusPlus/core/item/base/gears/BaseItemGear.java
index b72ea5db15..d759c7f116 100644
--- a/src/main/java/gtPlusPlus/core/item/base/gears/BaseItemGear.java
+++ b/src/main/java/gtPlusPlus/core/item/base/gears/BaseItemGear.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.gears;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemGear extends BaseItemComponent{
+public class BaseItemGear extends BaseItemComponent {
- public BaseItemGear(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.GEAR);
- }
+ public BaseItemGear(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.GEAR);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/gears/BaseItemSmallGear.java b/src/main/java/gtPlusPlus/core/item/base/gears/BaseItemSmallGear.java
index 5435c692c6..ddfdbd7534 100644
--- a/src/main/java/gtPlusPlus/core/item/base/gears/BaseItemSmallGear.java
+++ b/src/main/java/gtPlusPlus/core/item/base/gears/BaseItemSmallGear.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.gears;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemSmallGear extends BaseItemComponent{
+public class BaseItemSmallGear extends BaseItemComponent {
- public BaseItemSmallGear(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.SMALLGEAR);
- }
+ public BaseItemSmallGear(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.SMALLGEAR);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
index ea96e2914c..fc2748ec23 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
@@ -3,19 +3,18 @@ package gtPlusPlus.core.item.base.ingots;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemIngot extends BaseItemComponent{
+public class BaseItemIngot extends BaseItemComponent {
- protected final String materialName;
- protected final String unlocalName;
+ protected final String materialName;
+ protected final String unlocalName;
- public BaseItemIngot(final Material material) {
- this(material, ComponentTypes.INGOT);
- }
-
- public BaseItemIngot(final Material material, final ComponentTypes type) {
- super(material, type);
- this.materialName = material.getLocalizedName();
- this.unlocalName = material.getUnlocalizedName();
- }
+ public BaseItemIngot(final Material material) {
+ this(material, ComponentTypes.INGOT);
+ }
+ public BaseItemIngot(final Material material, final ComponentTypes type) {
+ super(material, type);
+ this.materialName = material.getLocalizedName();
+ this.unlocalName = material.getUnlocalizedName();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
index c19fecd924..ad1e682e3e 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
@@ -2,18 +2,6 @@ package gtPlusPlus.core.item.base.ingots;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-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.util.DamageSource;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.lib.CORE;
@@ -21,90 +9,101 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
-public class BaseItemIngotHot extends BaseItemIngot{
-
- private final ItemStack outputIngot;
- private int tickCounter = 0;
- private final int tickCounterMax = 200;
- private final int mTier;
-
- private IIcon base;
- private IIcon overlay;
-
- public BaseItemIngotHot(final Material material) {
- super(material, ComponentTypes.HOTINGOT);
- this.setTextureName(CORE.MODID + ":" + "itemIngotHot");
- this.outputIngot = material.getIngot(1);
- this.mTier = material.vTier;
- this.generateRecipe();
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return super.getItemStackDisplayName(p_77653_1_);
- //return ("Hot "+this.materialName+ " Ingot");
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return Utils.rgbtoHexValue(225, 225, 225);
- }
-
- private void generateRecipe(){
- Logger.WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+this.materialName+".");
- CORE.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), this.outputIngot.copy(), (int) Math.max(this.componentMaterial.getMass() * 3L, 1L), this.componentMaterial.vVoltageMultiplier);
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (this.componentMaterial != null){
- if (entityHolding != null && entityHolding instanceof EntityPlayer){
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- EntityUtils.applyHeatDamageToEntity(1, world, entityHolding);
- }
- }
- }
- super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses(){
- if (CORE.ConfigSwitches.useGregtechTextures){
- return true;
- }
- else {
- return false;
- }
- }
-
- @Override
- public void registerIcons(final IIconRegister i) {
-
- if (CORE.ConfigSwitches.useGregtechTextures){
- this.base = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "ingotHot");
- this.overlay = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "ingotHot_OVERLAY");
- }
- else {
- this.base = i.registerIcon(CORE.MODID + ":" + "item"+BaseItemComponent.ComponentTypes.HOTINGOT.getComponent());
- //this.overlay = i.registerIcon(CORE.MODID + ":" + "item"+BaseItemComponent.ComponentTypes.HOTINGOT.getComponent()+"_Overlay");
- }
- //this.overlay = cellMaterial.getFluid(1000).getFluid().get
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if(pass == 0 && CORE.ConfigSwitches.useGregtechTextures) {
- return this.base;
- }
- else if(pass == 1 && CORE.ConfigSwitches.useGregtechTextures) {
- return this.overlay;
- }
- else {
- return this.overlay;
- }
- }
-
-
+public class BaseItemIngotHot extends BaseItemIngot {
+
+ private final ItemStack outputIngot;
+ private int tickCounter = 0;
+ private final int tickCounterMax = 200;
+ private final int mTier;
+
+ private IIcon base;
+ private IIcon overlay;
+
+ public BaseItemIngotHot(final Material material) {
+ super(material, ComponentTypes.HOTINGOT);
+ this.setTextureName(CORE.MODID + ":" + "itemIngotHot");
+ this.outputIngot = material.getIngot(1);
+ this.mTier = material.vTier;
+ this.generateRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return super.getItemStackDisplayName(p_77653_1_);
+ // return ("Hot "+this.materialName+ " Ingot");
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ return Utils.rgbtoHexValue(225, 225, 225);
+ }
+
+ private void generateRecipe() {
+ Logger.WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of " + this.materialName + ".");
+ CORE.RA.addVacuumFreezerRecipe(
+ ItemUtils.getSimpleStack(this),
+ this.outputIngot.copy(),
+ (int) Math.max(this.componentMaterial.getMass() * 3L, 1L),
+ this.componentMaterial.vVoltageMultiplier);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (this.componentMaterial != null) {
+ if (entityHolding != null && entityHolding instanceof EntityPlayer) {
+ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode) {
+ EntityUtils.applyHeatDamageToEntity(1, world, entityHolding);
+ }
+ }
+ }
+ super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ if (CORE.ConfigSwitches.useGregtechTextures) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister i) {
+
+ if (CORE.ConfigSwitches.useGregtechTextures) {
+ this.base = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "ingotHot");
+ this.overlay = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "ingotHot_OVERLAY");
+ } else {
+ this.base = i.registerIcon(
+ CORE.MODID + ":" + "item" + BaseItemComponent.ComponentTypes.HOTINGOT.getComponent());
+ // this.overlay = i.registerIcon(CORE.MODID + ":" +
+ // "item"+BaseItemComponent.ComponentTypes.HOTINGOT.getComponent()+"_Overlay");
+ }
+ // this.overlay = cellMaterial.getFluid(1000).getFluid().get
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if (pass == 0 && CORE.ConfigSwitches.useGregtechTextures) {
+ return this.base;
+ } else if (pass == 1 && CORE.ConfigSwitches.useGregtechTextures) {
+ return this.overlay;
+ } else {
+ return this.overlay;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java
index 6ad323333f..eb6b4f03b2 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java
@@ -1,101 +1,98 @@
package gtPlusPlus.core.item.base.ingots;
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.entity.Entity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
-public class BaseItemIngot_OLD extends Item{
-
- protected int colour;
- protected String materialName;
- protected String unlocalName;
-
- public BaseItemIngot_OLD(final String unlocalizedName, final String materialName, final int colour, final int sRadioactivity) {
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.unlocalName = unlocalizedName;
- this.setMaxStackSize(64);
- this.setTextureName(CORE.MODID + ":" + "itemIngot");
- this.colour = colour;
- this.materialName = materialName;
- this.sRadiation = sRadioactivity;
- GameRegistry.registerItem(this, unlocalizedName);
- String temp = "";
- if (this.unlocalName.contains("itemIngot")){
- temp = this.unlocalName.replace("itemI", "i");
- }
- else if (this.unlocalName.contains("itemHotIngot")){
- temp = this.unlocalName.replace("itemHotIngot", "ingotHot");
- }
- if ((temp != null) && !temp.equals("")){
- GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
- }
- //this.generateCompressorRecipe();
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return (this.materialName+ " Ingot");
- }
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0){
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
-
- }
-
- private void generateCompressorRecipe(){
- if (this.unlocalName.contains("itemIngot")){
- final ItemStack tempStack = ItemUtils.getSimpleStack(this, 9);
- ItemStack tempOutput = null;
- String temp = this.getUnlocalizedName().replace("item.itemIngot", "block");
- Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName());
- if (this.getUnlocalizedName().contains("item.")){
- temp = this.getUnlocalizedName().replace("item.", "");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- temp = temp.replace("itemIngot", "block");
- Logger.WARNING("Generating OreDict Name: "+temp);
- if ((temp != null) && !temp.equals("")){
- tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1);
- if (tempOutput != null){
- GT_ModHandler.addCompressionRecipe(tempStack, tempOutput);
- }
-
- }
- }
- else if (this.unlocalName.contains("itemHotIngot")){
- return;
- }
-
-
- }
-
-
- protected final int sRadiation;
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding);
- }
+public class BaseItemIngot_OLD extends Item {
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+
+ public BaseItemIngot_OLD(
+ final String unlocalizedName, final String materialName, final int colour, final int sRadioactivity) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.unlocalName = unlocalizedName;
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemIngot");
+ this.colour = colour;
+ this.materialName = materialName;
+ this.sRadiation = sRadioactivity;
+ GameRegistry.registerItem(this, unlocalizedName);
+ String temp = "";
+ if (this.unlocalName.contains("itemIngot")) {
+ temp = this.unlocalName.replace("itemI", "i");
+ } else if (this.unlocalName.contains("itemHotIngot")) {
+ temp = this.unlocalName.replace("itemHotIngot", "ingotHot");
+ }
+ if ((temp != null) && !temp.equals("")) {
+ GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
+ }
+ // this.generateCompressorRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+
+ return (this.materialName + " Ingot");
+ }
+
+ public final String getMaterialName() {
+ return this.materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ if (this.colour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.colour;
+ }
+
+ private void generateCompressorRecipe() {
+ if (this.unlocalName.contains("itemIngot")) {
+ final ItemStack tempStack = ItemUtils.getSimpleStack(this, 9);
+ ItemStack tempOutput = null;
+ String temp = this.getUnlocalizedName().replace("item.itemIngot", "block");
+ Logger.WARNING("Unlocalized name for OreDict nameGen: " + this.getUnlocalizedName());
+ if (this.getUnlocalizedName().contains("item.")) {
+ temp = this.getUnlocalizedName().replace("item.", "");
+ Logger.WARNING("Generating OreDict Name: " + temp);
+ }
+ temp = temp.replace("itemIngot", "block");
+ Logger.WARNING("Generating OreDict Name: " + temp);
+ if ((temp != null) && !temp.equals("")) {
+ tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1);
+ if (tempOutput != null) {
+ GT_ModHandler.addCompressionRecipe(tempStack, tempOutput);
+ }
+ }
+ } else if (this.unlocalName.contains("itemHotIngot")) {
+ return;
+ }
+ }
+
+ protected final int sRadiation;
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java
index 96b5425437..d053fde9a8 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java
@@ -1,61 +1,70 @@
package gtPlusPlus.core.item.base.itemblock;
+import gtPlusPlus.core.fluids.BlockFluidBase;
+import gtPlusPlus.core.util.math.MathUtils;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.fluids.BlockFluidBase;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class FluidItemBlock extends ItemBlock{
-
- protected final int blockColour;
- final BlockFluidBase baseBlock;
- String name;
-
- public FluidItemBlock(final Block block) {
- super(block);
- this.baseBlock = (BlockFluidBase) block;
- this.blockColour = this.baseBlock.getRenderColor(1);
- this.name = this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", "");
- //GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this));
- }
-
- public int getRenderColor(final int aMeta) {
- return this.blockColour;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack iStack) {
- /*if (this.thisFluid != null){
- this.name = "Molten "+this.thisFluid.getLocalizedName();
- return this.name;
- }*/
- this.name = "Molten "+this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", "");
- return this.name;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.blockColour == 0){
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.blockColour;
- }
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- /*list.add("Temperature: "+MathUtils.celsiusToKelvin(this.thisFluid.getMeltingPointC())+"K");
- if (this.sRadiation > 0){
- list.add(CORE.GT_Tooltip_Radioactive);
- }*/
- super.addInformation(stack, aPlayer, list, bool);
- }
+public class FluidItemBlock extends ItemBlock {
+
+ protected final int blockColour;
+ final BlockFluidBase baseBlock;
+ String name;
+
+ public FluidItemBlock(final Block block) {
+ super(block);
+ this.baseBlock = (BlockFluidBase) block;
+ this.blockColour = this.baseBlock.getRenderColor(1);
+ this.name = this.baseBlock
+ .getLocalizedName()
+ .replace("tile", "")
+ .replace("fluid", "")
+ .replace("name", "")
+ .replace("block", "")
+ .replace(".", "");
+ // GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.",
+ // "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox",
+ // ""), UtilsItems.getSimpleStack(this));
+ }
+
+ public int getRenderColor(final int aMeta) {
+ return this.blockColour;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack iStack) {
+ /*if (this.thisFluid != null){
+ this.name = "Molten "+this.thisFluid.getLocalizedName();
+ return this.name;
+ }*/
+ this.name = "Molten "
+ + this.baseBlock
+ .getLocalizedName()
+ .replace("tile", "")
+ .replace("fluid", "")
+ .replace("name", "")
+ .replace("block", "")
+ .replace(".", "");
+ return this.name;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ if (this.blockColour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.blockColour;
+ }
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ /*list.add("Temperature: "+MathUtils.celsiusToKelvin(this.thisFluid.getMeltingPointC())+"K");
+ if (this.sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }*/
+ super.addInformation(stack, aPlayer, list, bool);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java
index 14344c1817..ab54fce01c 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java
@@ -1,71 +1,57 @@
package gtPlusPlus.core.item.base.itemblock;
+import gtPlusPlus.api.interfaces.ITileTooltip;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-
public class ItemBlockBasicTile extends ItemBlock {
- private final int mID;
-
- public ItemBlockBasicTile(final Block block) {
- super(block);
- this.mID = ((ITileTooltip) block).getTooltipID();
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.mID == 0) { // Fish trap
- list.add("This trap catches fish faster if surrounded by more water blocks");
- list.add("Can also be placed beside upto 4 other fish traps");
- list.add("Requires at least two faces touching water");
- list.add("1/1000 chance to produce triple loot.");
- }
- else if (this.mID == 1) { // Modularity
- list.add("Used to construct modular armour & bauble upgrades..");
- }
- else if (this.mID == 2) { // Trade
- list.add("Allows for SMP trade-o-mat type trading.");
- }
- else if (this.mID == 3) { // Project
- list.add("Scan any crafting recipe in this to mass fabricate them in the Autocrafter..");
- }
- else if (this.mID == 4) { // Circuit Table
- list.add("Easy Circuit Configuration");
- list.add("Change default setting with a Screwdriver");
- list.add("Default is used to select slot for auto-insertion");
- }
- else if (this.mID == 5) { // Decayables Chest
- list.add("Chest which holds radioactive materials");
- list.add("Items which decay will tick while inside");
- list.add("Place with right click");
- }
- else if (this.mID == 6) { // Butterfly Killer
- list.add("Kills Forestry Butterflies, Bats and other pests");
- list.add("Use either Formaldehyde or Hydrogen cyanide");
- list.add("Be weary of your neighbours");
- }
- else if (this.mID == 7) { // Egg Box
- list.add("A box for holding big eggs");
- }
- else if (this.mID == 8){ // Volumetric Flask Setter
- list.add("Easy Flask Configuration");
- list.add("Configure default input slot with a screwdriver");
- }
- else if (this.mID == 9){
-
- }
-
- else {
- list.add("Bad Tooltip ID - " + mID);
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
-
+ private final int mID;
+
+ public ItemBlockBasicTile(final Block block) {
+ super(block);
+ this.mID = ((ITileTooltip) block).getTooltipID();
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.mID == 0) { // Fish trap
+ list.add("This trap catches fish faster if surrounded by more water blocks");
+ list.add("Can also be placed beside upto 4 other fish traps");
+ list.add("Requires at least two faces touching water");
+ list.add("1/1000 chance to produce triple loot.");
+ } else if (this.mID == 1) { // Modularity
+ list.add("Used to construct modular armour & bauble upgrades..");
+ } else if (this.mID == 2) { // Trade
+ list.add("Allows for SMP trade-o-mat type trading.");
+ } else if (this.mID == 3) { // Project
+ list.add("Scan any crafting recipe in this to mass fabricate them in the Autocrafter..");
+ } else if (this.mID == 4) { // Circuit Table
+ list.add("Easy Circuit Configuration");
+ list.add("Change default setting with a Screwdriver");
+ list.add("Default is used to select slot for auto-insertion");
+ } else if (this.mID == 5) { // Decayables Chest
+ list.add("Chest which holds radioactive materials");
+ list.add("Items which decay will tick while inside");
+ list.add("Place with right click");
+ } else if (this.mID == 6) { // Butterfly Killer
+ list.add("Kills Forestry Butterflies, Bats and other pests");
+ list.add("Use either Formaldehyde or Hydrogen cyanide");
+ list.add("Be weary of your neighbours");
+ } else if (this.mID == 7) { // Egg Box
+ list.add("A box for holding big eggs");
+ } else if (this.mID == 8) { // Volumetric Flask Setter
+ list.add("Easy Flask Configuration");
+ list.add("Configure default input slot with a screwdriver");
+ } else if (this.mID == 9) {
+
+ } else {
+ list.add("Bad Tooltip ID - " + mID);
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockDoor.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockDoor.java
index 2aba494d6e..5afe1585ea 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockDoor.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockDoor.java
@@ -1,9 +1,8 @@
package gtPlusPlus.core.item.base.itemblock;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
@@ -13,88 +12,106 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class ItemBlockDoor extends ItemBlock {
- @SideOnly(Side.CLIENT)
- private IIcon field_150938_b;
-
- public ItemBlockDoor(Block p_i45328_1_) {
- super(p_i45328_1_);
- }
-
- /**
- * Callback for item usage. If the item does something special on right
- * clicking, he will have one of those. Return True if something happen and
- * false if it don't. This is for ITEMS, not BLOCKS
- */
- @Override
- public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,
- int par5, int par6, int par7, float par8, float par9, float par10) {
- if (par7 != 1) {
- return false;
- } else {
- ++par5;
- Block block;
-
- block = field_150939_a;
-
- if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)
- && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) {
- if (!block.canPlaceBlockAt(par3World, par4, par5, par6)) {
- return false;
- } else {
- int i1 = MathHelper.floor_double(
- (double) ((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
- byte b0 = 0;
- byte b1 = 0;
-
- if (i1 == 0) {
- b1 = 1;
- }
-
- if (i1 == 1) {
- b0 = -1;
- }
-
- if (i1 == 2) {
- b1 = -1;
- }
-
- if (i1 == 3) {
- b0 = 1;
- }
-
- int i2 = (par3World.getBlock(par4 - b0, par5, par6 - b1).isNormalCube() ? 1 : 0)
- + (par3World.getBlock(par4 - b0, par5 + 1, par6 - b1).isNormalCube() ? 1 : 0);
- int j1 = (par3World.getBlock(par4 + b0, par5, par6 + b1).isNormalCube() ? 1 : 0)
- + (par3World.getBlock(par4 + b0, par5 + 1, par6 + b1).isNormalCube() ? 1 : 0);
- boolean flag = par3World.getBlock(par4 - b0, par5, par6 - b1) == block
- || par3World.getBlock(par4 - b0, par5 + 1, par6 - b1) == block;
- boolean flag1 = par3World.getBlock(par4 + b0, par5, par6 + b1) == block
- || par3World.getBlock(par4 + b0, par5 + 1, par6 + b1) == block;
- boolean flag2 = false;
-
- if (flag && !flag1) {
- flag2 = true;
- } else if (j1 > i2) {
- flag2 = true;
- }
-
- par3World.setBlock(par4, par5, par6, block, i1, 2);
- par3World.setBlock(par4, par5 + 1, par6, block, 8 | (flag2 ? 1 : 0), 2);
- par3World.notifyBlocksOfNeighborChange(par4, par5, par6, block);
- par3World.notifyBlocksOfNeighborChange(par4, par5 + 1, par6, block);
-
- --par1ItemStack.stackSize;
- return true;
- }
- } else {
- return false;
- }
- }
- }
-
- @Override
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
- p_77624_3_.add("This is a block, you can place it by right clicking");
- super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
- }
-} \ No newline at end of file
+ @SideOnly(Side.CLIENT)
+ private IIcon field_150938_b;
+
+ public ItemBlockDoor(Block p_i45328_1_) {
+ super(p_i45328_1_);
+ }
+
+ /**
+ * Callback for item usage. If the item does something special on right
+ * clicking, he will have one of those. Return True if something happen and
+ * false if it don't. This is for ITEMS, not BLOCKS
+ */
+ @Override
+ public boolean onItemUse(
+ ItemStack par1ItemStack,
+ EntityPlayer par2EntityPlayer,
+ World par3World,
+ int par4,
+ int par5,
+ int par6,
+ int par7,
+ float par8,
+ float par9,
+ float par10) {
+ if (par7 != 1) {
+ return false;
+ } else {
+ ++par5;
+ Block block;
+
+ block = field_150939_a;
+
+ if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)
+ && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) {
+ if (!block.canPlaceBlockAt(par3World, par4, par5, par6)) {
+ return false;
+ } else {
+ int i1 = MathHelper.floor_double(
+ (double) ((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D)
+ & 3;
+ byte b0 = 0;
+ byte b1 = 0;
+
+ if (i1 == 0) {
+ b1 = 1;
+ }
+
+ if (i1 == 1) {
+ b0 = -1;
+ }
+
+ if (i1 == 2) {
+ b1 = -1;
+ }
+
+ if (i1 == 3) {
+ b0 = 1;
+ }
+
+ int i2 = (par3World.getBlock(par4 - b0, par5, par6 - b1).isNormalCube() ? 1 : 0)
+ + (par3World
+ .getBlock(par4 - b0, par5 + 1, par6 - b1)
+ .isNormalCube()
+ ? 1
+ : 0);
+ int j1 = (par3World.getBlock(par4 + b0, par5, par6 + b1).isNormalCube() ? 1 : 0)
+ + (par3World
+ .getBlock(par4 + b0, par5 + 1, par6 + b1)
+ .isNormalCube()
+ ? 1
+ : 0);
+ boolean flag = par3World.getBlock(par4 - b0, par5, par6 - b1) == block
+ || par3World.getBlock(par4 - b0, par5 + 1, par6 - b1) == block;
+ boolean flag1 = par3World.getBlock(par4 + b0, par5, par6 + b1) == block
+ || par3World.getBlock(par4 + b0, par5 + 1, par6 + b1) == block;
+ boolean flag2 = false;
+
+ if (flag && !flag1) {
+ flag2 = true;
+ } else if (j1 > i2) {
+ flag2 = true;
+ }
+
+ par3World.setBlock(par4, par5, par6, block, i1, 2);
+ par3World.setBlock(par4, par5 + 1, par6, block, 8 | (flag2 ? 1 : 0), 2);
+ par3World.notifyBlocksOfNeighborChange(par4, par5, par6, block);
+ par3World.notifyBlocksOfNeighborChange(par4, par5 + 1, par6, block);
+
+ --par1ItemStack.stackSize;
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+ }
+
+ @Override
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
+ p_77624_3_.add("This is a block, you can place it by right clicking");
+ super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java
index ac6740f268..5c307a6900 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java
@@ -1,41 +1,38 @@
package gtPlusPlus.core.item.base.itemblock;
+import gtPlusPlus.core.block.general.BlockTankXpConverter;
+import gtPlusPlus.core.creative.AddToCreativeTab;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import gtPlusPlus.core.block.general.BlockTankXpConverter;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-
public class ItemBlockEntityBase extends ItemBlock {
- public ItemBlockEntityBase(final Block block) {
- super(block);
- this.setMaxDamage(0);
- //this.setHasSubtypes(true);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack p_82790_1_, final int p_82790_2_) {
- return super.getColorFromItemStack(p_82790_1_, p_82790_2_);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (Block.getBlockFromItem(stack.getItem()) instanceof BlockTankXpConverter){
- /*list.add(EnumChatFormatting.GRAY+"Can convert Liquid Xp to Mob Essence and back.");
- list.add(EnumChatFormatting.GRAY+"Right click with a Screwdriver to change mode.");
- list.add(EnumChatFormatting.GRAY+"Shift+Right click to view tank information.");*/
- list.add(EnumChatFormatting.GRAY+"Currently disabled, Use a GT Brewery instead. (New Recipes Added!)");
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
-
-
-} \ No newline at end of file
+ public ItemBlockEntityBase(final Block block) {
+ super(block);
+ this.setMaxDamage(0);
+ // this.setHasSubtypes(true);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack p_82790_1_, final int p_82790_2_) {
+ return super.getColorFromItemStack(p_82790_1_, p_82790_2_);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public final void addInformation(
+ final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (Block.getBlockFromItem(stack.getItem()) instanceof BlockTankXpConverter) {
+ /*list.add(EnumChatFormatting.GRAY+"Can convert Liquid Xp to Mob Essence and back.");
+ list.add(EnumChatFormatting.GRAY+"Right click with a Screwdriver to change mode.");
+ list.add(EnumChatFormatting.GRAY+"Shift+Right click to view tank information.");*/
+ list.add(EnumChatFormatting.GRAY + "Currently disabled, Use a GT Brewery instead. (New Recipes Added!)");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
index af6f036942..aa4f26b473 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
@@ -1,11 +1,6 @@
package gtPlusPlus.core.item.base.itemblock;
-import java.util.HashMap;
-import java.util.List;
-
-import gregtech.api.util.GT_LanguageManager;
import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.base.BlockBaseModular;
import gtPlusPlus.core.block.base.BlockBaseOre;
import gtPlusPlus.core.lib.CORE;
@@ -13,6 +8,8 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
+import java.util.HashMap;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -23,170 +20,168 @@ import net.minecraft.world.World;
public class ItemBlockGtBlock extends ItemBlock {
- public static HashMap<String, String> sNameCache = new HashMap<String, String>();
-
- protected final int blockColour;
- private int sRadiation;
-
- private Material mMaterial;
- protected BlockTypes thisBlockType;
-
- private final Block thisBlock;
- private boolean isOre = false;
- private boolean isModular = false;
-
- public ItemBlockGtBlock(final Block block) {
- super(block);
- this.thisBlock = block;
- if (block instanceof BlockBaseOre) {
- this.isOre = true;
- } else if (block instanceof BlockBaseModular) {
- this.isModular = true;
- }
- final BlockBaseModular baseBlock = (BlockBaseModular) block;
- if (isModular) {
- this.blockColour = baseBlock.getRenderColor(0);
- } else if (isOre) {
- this.blockColour = block.getBlockColor();
- } else {
- this.blockColour = block.getBlockColor();
- }
-
- if (block instanceof BlockBaseModular){
- BlockBaseModular g = (BlockBaseModular) block;
- this.mMaterial = g.getMaterialEx();
- this.thisBlockType = g.thisBlock;
- }
- else {
- this.mMaterial = null;
- this.thisBlockType = BlockTypes.STANDARD;
- }
-
- }
-
- public int getBlockTypeMeta() {
- if (this.thisBlockType.equals(BlockTypes.STANDARD)) {
- return 0;
- }
- else if (this.thisBlockType.equals(BlockTypes.FRAME)) {
- return 1;
- }
- else if (this.thisBlockType.equals(BlockTypes.ORE)) {
- return 2;
- }
- return 0;
- }
-
- public String getUnlocalizedBlockName() {
- return "block."+mMaterial.getUnlocalizedName()+"."+this.thisBlockType.name().toLowerCase();
- }
-
- public String GetProperName() {
- String tempIngot = sNameCache.get(getUnlocalizedBlockName());
- if (tempIngot == null) {
- tempIngot = "BAD.UNLOCAL.NAME";
- }
- return tempIngot;
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack stack) {
- return this.thisBlock.getLocalizedName();
- //Logger.INFO("Unlocal Name: "+this.getUnlocalizedName());
- //String aFormattedLangName = GetProperName();
- //return GT_LanguageManager.addStringLocalization("block."+mMaterial.getUnlocalizedName()+"."+this.thisBlockType.name().toLowerCase()+".name", aFormattedLangName);
- }
-
- public int getRenderColor(final int aMeta) {
- return this.blockColour;
- }
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
-
- if (this.mMaterial != null) {
- list.add(this.mMaterial.vChemicalFormula);
- } else {
-
- try {
- BlockBaseModular g = (BlockBaseModular) thisBlock;
- this.mMaterial = g.getMaterialEx();
- }
- catch (Throwable t) {
-
- }
-
-
- //list.add("Material is Null.");
- }
-
- if (this.isOre) {
- if (KeyboardUtils.isCtrlKeyDown()) {
- Block b = Block.getBlockFromItem(stack.getItem());
- if (b != null) {
-
- String aTool = b.getHarvestTool(stack.getItemDamage());
- int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
-
- if (this.mMaterial != null) {
- list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
- list.add("Contains: ");
- if (mMaterial.getComposites().isEmpty()) {
- list.add("- " + mMaterial.getLocalizedName());
- } else {
- for (MaterialStack m : mMaterial.getComposites()) {
- list.add("- " + m.getStackMaterial().getLocalizedName() + " x" + m.getPartsPerOneHundred());
- }
- }
- }
- }
- } else {
- list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info.");
- }
- }
- else {
- Block b = Block.getBlockFromItem(stack.getItem());
- if (b != null) {
- String aTool = b.getHarvestTool(stack.getItemDamage());
- int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
- list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
- }
- }
-
- if (this.mMaterial != null) {
- if (this.mMaterial.vRadiationLevel > 0) {
- list.add(CORE.GT_Tooltip_Radioactive);
- }
- }
-
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
-
- if (!isModular && !isOre) {
- mMaterial = null;
- } else {
- if (this.mMaterial == null) {
- Block b = Block.getBlockFromItem(iStack.getItem());
- if (isOre) {
- mMaterial = ((BlockBaseOre) b).getMaterialEx();
- } else {
- mMaterial = ((BlockBaseModular) b).getMaterialEx();
- }
- if (mMaterial != null) {
- this.sRadiation = mMaterial.vRadiationLevel;
- } else {
- this.sRadiation = 0;
- }
- }
- if (this.sRadiation > 0) {
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding);
- }
- }
-
- }
-
+ public static HashMap<String, String> sNameCache = new HashMap<String, String>();
+
+ protected final int blockColour;
+ private int sRadiation;
+
+ private Material mMaterial;
+ protected BlockTypes thisBlockType;
+
+ private final Block thisBlock;
+ private boolean isOre = false;
+ private boolean isModular = false;
+
+ public ItemBlockGtBlock(final Block block) {
+ super(block);
+ this.thisBlock = block;
+ if (block instanceof BlockBaseOre) {
+ this.isOre = true;
+ } else if (block instanceof BlockBaseModular) {
+ this.isModular = true;
+ }
+ final BlockBaseModular baseBlock = (BlockBaseModular) block;
+ if (isModular) {
+ this.blockColour = baseBlock.getRenderColor(0);
+ } else if (isOre) {
+ this.blockColour = block.getBlockColor();
+ } else {
+ this.blockColour = block.getBlockColor();
+ }
+
+ if (block instanceof BlockBaseModular) {
+ BlockBaseModular g = (BlockBaseModular) block;
+ this.mMaterial = g.getMaterialEx();
+ this.thisBlockType = g.thisBlock;
+ } else {
+ this.mMaterial = null;
+ this.thisBlockType = BlockTypes.STANDARD;
+ }
+ }
+
+ public int getBlockTypeMeta() {
+ if (this.thisBlockType.equals(BlockTypes.STANDARD)) {
+ return 0;
+ } else if (this.thisBlockType.equals(BlockTypes.FRAME)) {
+ return 1;
+ } else if (this.thisBlockType.equals(BlockTypes.ORE)) {
+ return 2;
+ }
+ return 0;
+ }
+
+ public String getUnlocalizedBlockName() {
+ return "block." + mMaterial.getUnlocalizedName() + "."
+ + this.thisBlockType.name().toLowerCase();
+ }
+
+ public String GetProperName() {
+ String tempIngot = sNameCache.get(getUnlocalizedBlockName());
+ if (tempIngot == null) {
+ tempIngot = "BAD.UNLOCAL.NAME";
+ }
+ return tempIngot;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack stack) {
+ return this.thisBlock.getLocalizedName();
+ // Logger.INFO("Unlocal Name: "+this.getUnlocalizedName());
+ // String aFormattedLangName = GetProperName();
+ // return
+ // GT_LanguageManager.addStringLocalization("block."+mMaterial.getUnlocalizedName()+"."+this.thisBlockType.name().toLowerCase()+".name", aFormattedLangName);
+ }
+
+ public int getRenderColor(final int aMeta) {
+ return this.blockColour;
+ }
+
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+
+ if (this.mMaterial != null) {
+ list.add(this.mMaterial.vChemicalFormula);
+ } else {
+
+ try {
+ BlockBaseModular g = (BlockBaseModular) thisBlock;
+ this.mMaterial = g.getMaterialEx();
+ } catch (Throwable t) {
+
+ }
+
+ // list.add("Material is Null.");
+ }
+
+ if (this.isOre) {
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ Block b = Block.getBlockFromItem(stack.getItem());
+ if (b != null) {
+
+ String aTool = b.getHarvestTool(stack.getItemDamage());
+ int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
+
+ if (this.mMaterial != null) {
+ list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
+ list.add("Contains: ");
+ if (mMaterial.getComposites().isEmpty()) {
+ list.add("- " + mMaterial.getLocalizedName());
+ } else {
+ for (MaterialStack m : mMaterial.getComposites()) {
+ list.add("- " + m.getStackMaterial().getLocalizedName() + " x"
+ + m.getPartsPerOneHundred());
+ }
+ }
+ }
+ }
+ } else {
+ list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info.");
+ }
+ } else {
+ Block b = Block.getBlockFromItem(stack.getItem());
+ if (b != null) {
+ String aTool = b.getHarvestTool(stack.getItemDamage());
+ int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
+ list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
+ }
+ }
+
+ if (this.mMaterial != null) {
+ if (this.mMaterial.vRadiationLevel > 0) {
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ }
+
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+
+ if (!isModular && !isOre) {
+ mMaterial = null;
+ } else {
+ if (this.mMaterial == null) {
+ Block b = Block.getBlockFromItem(iStack.getItem());
+ if (isOre) {
+ mMaterial = ((BlockBaseOre) b).getMaterialEx();
+ } else {
+ mMaterial = ((BlockBaseModular) b).getMaterialEx();
+ }
+ if (mMaterial != null) {
+ this.sRadiation = mMaterial.vRadiationLevel;
+ } else {
+ this.sRadiation = 0;
+ }
+ }
+ if (this.sRadiation > 0) {
+ EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
index 0dd125bf7b..81bc47daa3 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
@@ -1,5 +1,12 @@
package gtPlusPlus.core.item.base.itemblock;
+import gtPlusPlus.core.block.base.BlockBaseModular;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.material.MaterialStack;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
+import gtPlusPlus.core.util.sys.KeyboardUtils;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -8,87 +15,79 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import java.util.List;
-
-import gtPlusPlus.core.block.base.BlockBaseModular;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.material.MaterialStack;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-import gtPlusPlus.core.util.sys.KeyboardUtils;
-
-public class ItemBlockGtFrameBox extends ItemBlock{
-
- protected int blockColour;
- private Material mMaterial;
- private int sRadiation;
+public class ItemBlockGtFrameBox extends ItemBlock {
- public ItemBlockGtFrameBox(final Block block) {
- super(block);
- final BlockBaseModular baseBlock = (BlockBaseModular) block;
- this.blockColour = baseBlock.getRenderColor(1);
-
+ protected int blockColour;
+ private Material mMaterial;
+ private int sRadiation;
+ public ItemBlockGtFrameBox(final Block block) {
+ super(block);
+ final BlockBaseModular baseBlock = (BlockBaseModular) block;
+ this.blockColour = baseBlock.getRenderColor(1);
- if (block instanceof BlockBaseModular){
- BlockBaseModular g = (BlockBaseModular) block;
- this.mMaterial = g.getMaterialEx();
- sRadiation = mMaterial.vRadiationLevel;
- }
- else {
- this.mMaterial = null;
- sRadiation = 0;
- }
-
- //GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), ItemUtils.getSimpleStack(this));
- }
+ if (block instanceof BlockBaseModular) {
+ BlockBaseModular g = (BlockBaseModular) block;
+ this.mMaterial = g.getMaterialEx();
+ sRadiation = mMaterial.vRadiationLevel;
+ } else {
+ this.mMaterial = null;
+ sRadiation = 0;
+ }
- public int getRenderColor(final int aMeta) {
- return this.blockColour;
- }
+ // GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.",
+ // "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox",
+ // ""), ItemUtils.getSimpleStack(this));
+ }
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.mMaterial != null) {
- list.add(this.mMaterial.vChemicalFormula);
- if (this.mMaterial.vRadiationLevel > 0) {
- list.add(CORE.GT_Tooltip_Radioactive);
- }
- } else {
- list.add("Material is Null.");
- }
- if (KeyboardUtils.isCtrlKeyDown()) {
- Block b = Block.getBlockFromItem(stack.getItem());
- if (b != null) {
- String aTool = b.getHarvestTool(stack.getItemDamage());
- int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
- list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
- if (this.mMaterial != null) {
- list.add("Contains: ");
- if (mMaterial.getComposites().isEmpty()) {
- list.add("- " + mMaterial.getLocalizedName());
- } else {
- for (MaterialStack m : mMaterial.getComposites()) {
- list.add("- " + m.getStackMaterial().getLocalizedName() + " x" + m.getPartsPerOneHundred());
- }
- }
- }
- }
- } else {
- list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info.");
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
+ public int getRenderColor(final int aMeta) {
+ return this.blockColour;
+ }
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.mMaterial != null) {
+ list.add(this.mMaterial.vChemicalFormula);
+ if (this.mMaterial.vRadiationLevel > 0) {
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ } else {
+ list.add("Material is Null.");
+ }
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ Block b = Block.getBlockFromItem(stack.getItem());
+ if (b != null) {
+ String aTool = b.getHarvestTool(stack.getItemDamage());
+ int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
+ list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
+ if (this.mMaterial != null) {
+ list.add("Contains: ");
+ if (mMaterial.getComposites().isEmpty()) {
+ list.add("- " + mMaterial.getLocalizedName());
+ } else {
+ for (MaterialStack m : mMaterial.getComposites()) {
+ list.add("- " + m.getStackMaterial().getLocalizedName() + " x" + m.getPartsPerOneHundred());
+ }
+ }
+ }
+ }
+ } else {
+ list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
- if (this.sRadiation > 0) {
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding);
- }
- }
-
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (this.sRadiation > 0) {
+ EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java
index b26ac67225..dd2307d834 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java
@@ -1,114 +1,109 @@
package gtPlusPlus.core.item.base.itemblock;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.api.interfaces.ITileTooltip;
import gtPlusPlus.api.objects.data.AutoMap;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlockWithMetadata;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-public class ItemBlockMeta extends ItemBlockWithMetadata
-{
- private final Block mBlock;
- private HashMap<Integer, AutoMap<String>> aTooltips = new LinkedHashMap<Integer, AutoMap<String>>();
+public class ItemBlockMeta extends ItemBlockWithMetadata {
+ private final Block mBlock;
+ private HashMap<Integer, AutoMap<String>> aTooltips = new LinkedHashMap<Integer, AutoMap<String>>();
- public ItemBlockMeta(final Block aBlock)
- {
- super(aBlock, aBlock);
- this.mBlock = aBlock;
- this.setMaxDamage(0);
- this.setHasSubtypes(true);
- if (aBlock instanceof ITileTooltip) {
- ITileTooltip aTooltip = (ITileTooltip) aBlock;
- //aTooltips.put(aTooltip.getTooltipID(), aTooltip.getTooltipMap());
- }
- }
-
+ public ItemBlockMeta(final Block aBlock) {
+ super(aBlock, aBlock);
+ this.mBlock = aBlock;
+ this.setMaxDamage(0);
+ this.setHasSubtypes(true);
+ if (aBlock instanceof ITileTooltip) {
+ ITileTooltip aTooltip = (ITileTooltip) aBlock;
+ // aTooltips.put(aTooltip.getTooltipID(), aTooltip.getTooltipMap());
+ }
+ }
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- Block aThis = Block.getBlockFromItem(stack.getItem());
- if (aThis != null) {
- if (!aTooltips.isEmpty()) {
- AutoMap<String> h = aTooltips.get(stack.getItemDamage());
- if (h != null && !h.isEmpty()) {
- for (String s : h) {
- list.add(s);
- }
- }
- }
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ Block aThis = Block.getBlockFromItem(stack.getItem());
+ if (aThis != null) {
+ if (!aTooltips.isEmpty()) {
+ AutoMap<String> h = aTooltips.get(stack.getItemDamage());
+ if (h != null && !h.isEmpty()) {
+ for (String s : h) {
+ list.add(s);
+ }
+ }
+ }
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
- /**
- * Gets an icon index based on an item's damage value
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamage(final int p_77617_1_)
- {
- return this.mBlock.getIcon(2, p_77617_1_);
- }
+ /**
+ * Gets an icon index based on an item's damage value
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(final int p_77617_1_) {
+ return this.mBlock.getIcon(2, p_77617_1_);
+ }
- /**
- * Returns the metadata of the block which this Item (ItemBlock) can place
- */
- @Override
- public int getMetadata(final int p_77647_1_)
- {
- return p_77647_1_;
- }
+ /**
+ * Returns the metadata of the block which this Item (ItemBlock) can place
+ */
+ @Override
+ public int getMetadata(final int p_77647_1_) {
+ return p_77647_1_;
+ }
- @Override
- public String getUnlocalizedName(final ItemStack stack) {
- return this.getUnlocalizedName() + "." + stack.getItemDamage();
- }
+ @Override
+ public String getUnlocalizedName(final ItemStack stack) {
+ return this.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
- @Override
- public boolean isDamageable() {
- return false;
- }
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
- @Override
- public int getItemEnchantability() {
- return 0;
- }
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return 0;
- }
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return 0;
+ }
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- return 0;
- }
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ return 0;
+ }
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-} \ No newline at end of file
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java
index 99367c5ef5..fbaa9be8a3 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java
@@ -1,7 +1,11 @@
package gtPlusPlus.core.item.base.itemblock;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.tileentities.base.TileEntityBase;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,94 +15,90 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.tileentities.base.TileEntityBase;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-
public class ItemBlockNBT extends ItemBlock {
-
- protected final int mID;
-
- public ItemBlockNBT(final Block block) {
- super(block);
- this.mID = ((ITileTooltip) block).getTooltipID();
- }
-
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
-
- //if ()
-
-
-
- if (this.mID == 0){ //blockDarkWorldPortalFrame
- list.add("Assembled in the same shape as the Nether Portal.");
- }
- }
-
-
-
- @Override
- public void onCreated(ItemStack item, World world, EntityPlayer player) {
- addNBT(player, item);
- super.onCreated(item, world, player);
- }
-
- @Override
- public void onUpdate(ItemStack item, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) {
- if (entity instanceof EntityPlayerMP) {
- EntityPlayerMP mPlayer = (EntityPlayerMP) entity;
-
- NBTTagCompound rNBT = item.getTagCompound();
- rNBT = ((rNBT == null) ? new NBTTagCompound() : rNBT);
- if (!rNBT.hasKey("mOwner")){
- addNBT(mPlayer, item);
- }
- }
- super.onUpdate(item, world, entity, p_77663_4_, p_77663_5_);
- }
-
- private void addNBT(EntityPlayer player, ItemStack item) {
- NBTTagCompound rNBT = item.getTagCompound();
- rNBT = ((rNBT == null) ? new NBTTagCompound() : rNBT);
- if (player != null) {
- boolean mOP = PlayerUtils.isPlayerOP(player);
- rNBT.setString("mOwner", player.getDisplayName());
- rNBT.setString("mUUID", ""+player.getUniqueID());
- rNBT.setBoolean("mOP", mOP);
- }
- else if (player == null) {
- rNBT.setString("mOwner", "fakeplayer");
- rNBT.setString("mUUID", "00000000");
- rNBT.setBoolean("mOP", false);
- }
- GT_Utility.ItemNBT.setNBT(item, rNBT);
- }
-
- @Override
- public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side,
- float hitX, float hitY, float hitZ, int aMeta) {
- if (!(aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3))) {
- return false;
- }
- if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) {
- this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack);
- this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, aMeta);
- }
- TileEntityBase tTileEntity = (TileEntityBase) aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity != null && aPlayer != null) {
- if (tTileEntity.isServerSide()){
- Logger.INFO("Setting Tile Entity information");
- NBTTagCompound aNBT = GT_Utility.ItemNBT.getNBT(aStack);
- tTileEntity.setOwnerInformation(aNBT.getString("mOwner"), aNBT.getString("mUUID"), aNBT.getBoolean("mOP"));
- }
- }
- return true;
- }
-
-} \ No newline at end of file
+ protected final int mID;
+
+ public ItemBlockNBT(final Block block) {
+ super(block);
+ this.mID = ((ITileTooltip) block).getTooltipID();
+ }
+
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+
+ // if ()
+
+ if (this.mID == 0) { // blockDarkWorldPortalFrame
+ list.add("Assembled in the same shape as the Nether Portal.");
+ }
+ }
+
+ @Override
+ public void onCreated(ItemStack item, World world, EntityPlayer player) {
+ addNBT(player, item);
+ super.onCreated(item, world, player);
+ }
+
+ @Override
+ public void onUpdate(ItemStack item, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) {
+ if (entity instanceof EntityPlayerMP) {
+ EntityPlayerMP mPlayer = (EntityPlayerMP) entity;
+
+ NBTTagCompound rNBT = item.getTagCompound();
+ rNBT = ((rNBT == null) ? new NBTTagCompound() : rNBT);
+ if (!rNBT.hasKey("mOwner")) {
+ addNBT(mPlayer, item);
+ }
+ }
+ super.onUpdate(item, world, entity, p_77663_4_, p_77663_5_);
+ }
+
+ private void addNBT(EntityPlayer player, ItemStack item) {
+ NBTTagCompound rNBT = item.getTagCompound();
+ rNBT = ((rNBT == null) ? new NBTTagCompound() : rNBT);
+ if (player != null) {
+ boolean mOP = PlayerUtils.isPlayerOP(player);
+ rNBT.setString("mOwner", player.getDisplayName());
+ rNBT.setString("mUUID", "" + player.getUniqueID());
+ rNBT.setBoolean("mOP", mOP);
+ } else if (player == null) {
+ rNBT.setString("mOwner", "fakeplayer");
+ rNBT.setString("mUUID", "00000000");
+ rNBT.setBoolean("mOP", false);
+ }
+ GT_Utility.ItemNBT.setNBT(item, rNBT);
+ }
+
+ @Override
+ public boolean placeBlockAt(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ int side,
+ float hitX,
+ float hitY,
+ float hitZ,
+ int aMeta) {
+ if (!(aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3))) {
+ return false;
+ }
+ if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) {
+ this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack);
+ this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, aMeta);
+ }
+ TileEntityBase tTileEntity = (TileEntityBase) aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity != null && aPlayer != null) {
+ if (tTileEntity.isServerSide()) {
+ Logger.INFO("Setting Tile Entity information");
+ NBTTagCompound aNBT = GT_Utility.ItemNBT.getNBT(aStack);
+ tTileEntity.setOwnerInformation(
+ aNBT.getString("mOwner"), aNBT.getString("mUUID"), aNBT.getBoolean("mOP"));
+ }
+ }
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java
index e4079521d4..cc5bcf1222 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java
@@ -1,16 +1,5 @@
package gtPlusPlus.core.item.base.itemblock;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.block.base.BlockBaseOre;
import gtPlusPlus.core.lib.CORE;
@@ -21,141 +10,149 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.everglades.gen.gt.WorldGen_GT_Ore_Layer;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import net.minecraft.block.Block;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
-public class ItemBlockOre extends ItemBlock{
-
- private final BlockBaseOre mThisOre;
- private final Material mThisMaterial;
- private final int mThisRadiation;
- private final int mThisColour;
-
- public ItemBlockOre(final Block block) {
- super(block);
- if (block instanceof BlockBaseOre){
- this.mThisOre = (BlockBaseOre) block;
- this.mThisMaterial = this.mThisOre.getMaterialEx();
- this.mThisRadiation = this.mThisMaterial.vRadiationLevel;
- this.mThisColour = this.mThisMaterial.getRgbAsHex();
- }
- else {
- this.mThisOre = null;
- this.mThisMaterial = null;
- this.mThisRadiation = 0;
- this.mThisColour = Utils.rgbtoHexValue(255, 255, 255);
- }
- }
-
- public int getRenderColor(final int aMeta) {
- return this.mThisColour;
- }
-
- private static Map<String, AutoMap<String>> mMapOreBlockItemToDimName = new LinkedHashMap<String, AutoMap<String>>();
- private static boolean mInitOres_Everglades = false;
- private AutoMap<String> mDimsForThisOre = new AutoMap<String>();
-
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
-
- if (!mInitOres_Everglades) {
- for (WorldGen_GT_Ore_Layer f : gtPlusPlus.everglades.gen.gt.WorldGen_Ores.validOreveins.values()) {
- Material[] m2 = new Material[] {f.mPrimary, f.mSecondary, f.mBetween, f.mSporadic};
- for (Material m1 : m2) {
- AutoMap<String> aMap = mMapOreBlockItemToDimName.get(m1.getUnlocalizedName().toLowerCase());
- if (aMap == null) {
- aMap = new AutoMap<String>();
- }
- String aDimName = "Everglades";
- if (!aMap.containsValue(aDimName)) {
- aMap.put(aDimName);
- }
- mMapOreBlockItemToDimName.put(m1.getUnlocalizedName().toLowerCase(), aMap);
- }
- }
- mInitOres_Everglades = true;
- }
-
-
- if (this.mThisMaterial != null){
- list.add(this.mThisMaterial.vChemicalFormula);
- }
-
- //Radioactive?
- if (this.mThisRadiation > 0){
- list.add(CORE.GT_Tooltip_Radioactive);
- }
-
- /**
- * Tooltip Handler for Ores
- */
- if (this.mThisMaterial == FLUORIDES.FLUORITE){
- list.add("Mined from Sandstone with a 1/"+(CORE.ConfigSwitches.chanceToDropFluoriteOre*20)+" chance, or Limestone with a 1/"+(CORE.ConfigSwitches.chanceToDropFluoriteOre)+" chance.");
- }
-
- if (this.mThisMaterial != null) {
- list.add("Ore contains: ");
- if (mThisMaterial.getComposites().isEmpty()) {
- list.add("- "+mThisMaterial.getLocalizedName());
- }
- else {
- for (MaterialStack m : mThisMaterial.getComposites()) {
- list.add("- "+m.getStackMaterial().getLocalizedName()+" x"+m.getPartsPerOneHundred());
- }
- }
- }
-
- if (KeyboardUtils.isCtrlKeyDown()) {
-
- Block b = Block.getBlockFromItem(stack.getItem());
- if (b != null) {
- String aTool = b.getHarvestTool(stack.getItemDamage());
- int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
- if (aMiningLevel1 != 0) {
- list.add("Mining Level: "+Math.min(Math.max(aMiningLevel1, 0), 5));
- }
- }
-
- if (mDimsForThisOre.isEmpty()) {
- AutoMap<String> A = mMapOreBlockItemToDimName.get(this.mThisMaterial.getUnlocalizedName().toLowerCase());
- if (A != null) {
- mDimsForThisOre = A;
- }
- }
-
- list.add("Found: ");
- if (!mDimsForThisOre.isEmpty()) {
- for (String m : mDimsForThisOre) {
- list.add("- "+m);
- }
- }
- else {
- list.add("- Unknown");
- }
-
- }
- else {
- list.add(EnumChatFormatting.DARK_GRAY+"Hold Ctrl to show additional info.");
- }
-
-
-
-
-
-
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (this.mThisMaterial != null){
- if (this.mThisRadiation > 0){
- if (entityHolding instanceof EntityPlayer){
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.mThisMaterial.vRadiationLevel, world, entityHolding);
- }
- }
- }
- }
- }
-
+public class ItemBlockOre extends ItemBlock {
+
+ private final BlockBaseOre mThisOre;
+ private final Material mThisMaterial;
+ private final int mThisRadiation;
+ private final int mThisColour;
+
+ public ItemBlockOre(final Block block) {
+ super(block);
+ if (block instanceof BlockBaseOre) {
+ this.mThisOre = (BlockBaseOre) block;
+ this.mThisMaterial = this.mThisOre.getMaterialEx();
+ this.mThisRadiation = this.mThisMaterial.vRadiationLevel;
+ this.mThisColour = this.mThisMaterial.getRgbAsHex();
+ } else {
+ this.mThisOre = null;
+ this.mThisMaterial = null;
+ this.mThisRadiation = 0;
+ this.mThisColour = Utils.rgbtoHexValue(255, 255, 255);
+ }
+ }
+
+ public int getRenderColor(final int aMeta) {
+ return this.mThisColour;
+ }
+
+ private static Map<String, AutoMap<String>> mMapOreBlockItemToDimName =
+ new LinkedHashMap<String, AutoMap<String>>();
+ private static boolean mInitOres_Everglades = false;
+ private AutoMap<String> mDimsForThisOre = new AutoMap<String>();
+
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+
+ if (!mInitOres_Everglades) {
+ for (WorldGen_GT_Ore_Layer f : gtPlusPlus.everglades.gen.gt.WorldGen_Ores.validOreveins.values()) {
+ Material[] m2 = new Material[] {f.mPrimary, f.mSecondary, f.mBetween, f.mSporadic};
+ for (Material m1 : m2) {
+ AutoMap<String> aMap = mMapOreBlockItemToDimName.get(
+ m1.getUnlocalizedName().toLowerCase());
+ if (aMap == null) {
+ aMap = new AutoMap<String>();
+ }
+ String aDimName = "Everglades";
+ if (!aMap.containsValue(aDimName)) {
+ aMap.put(aDimName);
+ }
+ mMapOreBlockItemToDimName.put(m1.getUnlocalizedName().toLowerCase(), aMap);
+ }
+ }
+ mInitOres_Everglades = true;
+ }
+
+ if (this.mThisMaterial != null) {
+ list.add(this.mThisMaterial.vChemicalFormula);
+ }
+
+ // Radioactive?
+ if (this.mThisRadiation > 0) {
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+
+ /**
+ * Tooltip Handler for Ores
+ */
+ if (this.mThisMaterial == FLUORIDES.FLUORITE) {
+ list.add("Mined from Sandstone with a 1/" + (CORE.ConfigSwitches.chanceToDropFluoriteOre * 20)
+ + " chance, or Limestone with a 1/" + (CORE.ConfigSwitches.chanceToDropFluoriteOre) + " chance.");
+ }
+
+ if (this.mThisMaterial != null) {
+ list.add("Ore contains: ");
+ if (mThisMaterial.getComposites().isEmpty()) {
+ list.add("- " + mThisMaterial.getLocalizedName());
+ } else {
+ for (MaterialStack m : mThisMaterial.getComposites()) {
+ list.add("- " + m.getStackMaterial().getLocalizedName() + " x" + m.getPartsPerOneHundred());
+ }
+ }
+ }
+
+ if (KeyboardUtils.isCtrlKeyDown()) {
+
+ Block b = Block.getBlockFromItem(stack.getItem());
+ if (b != null) {
+ String aTool = b.getHarvestTool(stack.getItemDamage());
+ int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
+ if (aMiningLevel1 != 0) {
+ list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
+ }
+ }
+
+ if (mDimsForThisOre.isEmpty()) {
+ AutoMap<String> A = mMapOreBlockItemToDimName.get(
+ this.mThisMaterial.getUnlocalizedName().toLowerCase());
+ if (A != null) {
+ mDimsForThisOre = A;
+ }
+ }
+
+ list.add("Found: ");
+ if (!mDimsForThisOre.isEmpty()) {
+ for (String m : mDimsForThisOre) {
+ list.add("- " + m);
+ }
+ } else {
+ list.add("- Unknown");
+ }
+
+ } else {
+ list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info.");
+ }
+
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (this.mThisMaterial != null) {
+ if (this.mThisRadiation > 0) {
+ if (entityHolding instanceof EntityPlayer) {
+ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode) {
+ EntityUtils.applyRadiationDamageToEntity(
+ iStack.stackSize, this.mThisMaterial.vRadiationLevel, world, entityHolding);
+ }
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java
index 7a4222ed0f..4818a3cff6 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java
@@ -1,115 +1,107 @@
package gtPlusPlus.core.item.base.itemblock;
-import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlockWithMetadata;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-public class ItemBlockRoundRobinator extends ItemBlockWithMetadata
-{
- private final Block mBlock;
-
- public ItemBlockRoundRobinator(final Block aBlock){
- super(aBlock, aBlock);
- this.mBlock = aBlock;
- }
-
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("Attempts to output items evenly on all four horizontal planes");
- if (stack.getItemDamage() == 0) {
- list.add("1 Item per enabled side every 400 ticks");
- }
- else if (stack.getItemDamage() == 1) {
- list.add("1 Item per enabled side every 100 ticks");
- }
- else if (stack.getItemDamage() == 2) {
- list.add("1 Item per enabled side every 20 ticks");
- }
- else if (stack.getItemDamage() == 3) {
- list.add("1 Item per enabled side every 10 ticks");
- }
- else if (stack.getItemDamage() == 4) {
- list.add("1 Item per enabled side every tick");
- }
- list.add("Top and bottom do not pull, so you must push items in");
- list.add("Sides can also be disabled with a screwdriver");
- list.add("Shift+RMB with empty hand to view inventory contents");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- /**
- * Gets an icon index based on an item's damage value
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamage(final int p_77617_1_)
- {
- return this.mBlock.getIcon(0, p_77617_1_);
- }
-
- /**
- * Returns the metadata of the block which this Item (ItemBlock) can place
- */
- @Override
- public int getMetadata(final int p_77647_1_)
- {
- return p_77647_1_;
- }
-
- @Override
- public String getUnlocalizedName(final ItemStack stack) {
- return this.getUnlocalizedName() + "." + stack.getItemDamage();
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return 0;
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- return 0;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public boolean getHasSubtypes() {
- return true;
- }
-} \ No newline at end of file
+public class ItemBlockRoundRobinator extends ItemBlockWithMetadata {
+ private final Block mBlock;
+
+ public ItemBlockRoundRobinator(final Block aBlock) {
+ super(aBlock, aBlock);
+ this.mBlock = aBlock;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add("Attempts to output items evenly on all four horizontal planes");
+ if (stack.getItemDamage() == 0) {
+ list.add("1 Item per enabled side every 400 ticks");
+ } else if (stack.getItemDamage() == 1) {
+ list.add("1 Item per enabled side every 100 ticks");
+ } else if (stack.getItemDamage() == 2) {
+ list.add("1 Item per enabled side every 20 ticks");
+ } else if (stack.getItemDamage() == 3) {
+ list.add("1 Item per enabled side every 10 ticks");
+ } else if (stack.getItemDamage() == 4) {
+ list.add("1 Item per enabled side every tick");
+ }
+ list.add("Top and bottom do not pull, so you must push items in");
+ list.add("Sides can also be disabled with a screwdriver");
+ list.add("Shift+RMB with empty hand to view inventory contents");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ /**
+ * Gets an icon index based on an item's damage value
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(final int p_77617_1_) {
+ return this.mBlock.getIcon(0, p_77617_1_);
+ }
+
+ /**
+ * Returns the metadata of the block which this Item (ItemBlock) can place
+ */
+ @Override
+ public int getMetadata(final int p_77647_1_) {
+ return p_77647_1_;
+ }
+
+ @Override
+ public String getUnlocalizedName(final ItemStack stack) {
+ return this.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public boolean getHasSubtypes() {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java
index 53c9cdb193..6313bf8373 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java
@@ -1,39 +1,38 @@
package gtPlusPlus.core.item.base.itemblock;
-import java.util.List;
-
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration;
import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-public class ItemBlockSpawner extends ItemBlockMeta{
-
- private final Block mBlock;
-
- public ItemBlockSpawner(Block aBlock) {
- super(aBlock);
- mBlock = aBlock;
- }
+public class ItemBlockSpawner extends ItemBlockMeta {
+
+ private final Block mBlock;
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aBool) {
- if (mBlock != null) {
- int x = this.getMetadata(aStack.getItemDamage());
- if (x >= 0) {
- try {
- EntityRegistration x1 = EntityRegistry.instance().lookupModSpawn(TileEntityGenericSpawner.mSpawners.get(x), false);
- if (x1 != null) {
- aList.add(EnumChatFormatting.RED+x1.getEntityName());
- }
- }
- catch (Throwable t) {}
- }
- }
- super.addInformation(aStack, aPlayer, aList, aBool);
- }
+ public ItemBlockSpawner(Block aBlock) {
+ super(aBlock);
+ mBlock = aBlock;
+ }
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aBool) {
+ if (mBlock != null) {
+ int x = this.getMetadata(aStack.getItemDamage());
+ if (x >= 0) {
+ try {
+ EntityRegistration x1 =
+ EntityRegistry.instance().lookupModSpawn(TileEntityGenericSpawner.mSpawners.get(x), false);
+ if (x1 != null) {
+ aList.add(EnumChatFormatting.RED + x1.getEntityName());
+ }
+ } catch (Throwable t) {
+ }
+ }
+ }
+ super.addInformation(aStack, aPlayer, aList, aBool);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java b/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java
index 25070ad817..a96df2212c 100644
--- a/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java
+++ b/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java
@@ -1,11 +1,15 @@
package gtPlusPlus.core.item.base.misc;
-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.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -15,160 +19,142 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import gregtech.api.util.GT_OreDictUnificator;
-
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class BaseItemMisc extends Item{
-
- public final String displayName;
- public final String unlocalName;
- public final MiscTypes miscType;
- public final Object componentColour;
- public final String[] description;
-
- public BaseItemMisc(
- final String displayName,
- final short[] RGB,
- final int maxStackSize,
- final MiscTypes miscType,
- String[] description) {
-
- //Set-up the Misc Generic Item
- this.displayName = displayName;
- String unlocalName = Utils.sanitizeString(displayName);
- this.unlocalName = "item"+miscType.TYPE+unlocalName;
- this.miscType = miscType;
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(this.unlocalName);
- this.setMaxStackSize(maxStackSize);
- //this.setTextureName(this.getCorrectTextures());
- if (RGB != null){
- this.componentColour = Utils.rgbtoHexValue(RGB[0], RGB[1], RGB[2]);
- }
- else {
- this.componentColour = null;
- }
- this.description = description;
- GameRegistry.registerItem(this, this.unlocalName);
- GT_OreDictUnificator.registerOre(miscType.getOreDictPrefix()+unlocalName, ItemUtils.getSimpleStack(this));
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return this.displayName+miscType.DISPLAY_NAME_SUFFIX;
- }
-
- private String getCorrectTextures(){
- return CORE.MODID + ":" + "item"+this.miscType.TYPE;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return this.miscType == MiscTypes.DROP;
- }
-
- @Override
- public int getRenderPasses(int meta) {
- return (this.miscType == MiscTypes.DROP) ? 2 : 1;
- }
-
- @SideOnly(Side.CLIENT)
- private IIcon secondIcon;
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister par1IconRegister) {
- if (this.miscType == MiscTypes.DROP && LoadedMods.Forestry){
- this.itemIcon = par1IconRegister.registerIcon("forestry:honeyDrop.0");
- this.secondIcon = par1IconRegister.registerIcon("forestry:honeyDrop.1");
- }
- else {
- this.itemIcon = par1IconRegister.registerIcon(getCorrectTextures());
- }
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return (pass == 0) ? itemIcon : secondIcon;
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.description != null){ //Incase I don't add one
- if (this.description.length > 0){ //Incase I somehow add a blank one
- for (int x=0;x<this.description.length;x++){
- list.add(EnumChatFormatting.GRAY+description[x]);
- }
- }
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
-
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- //Returns default colour if a custom one is not set.
- if (this.componentColour == null){
- return 16777215;
- }
- else {
- return (int) this.componentColour;
- }
-
-
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- //Nothing Fancy here yet.
- }
-
-
-
-
-
-
-
-
- public static enum MiscTypes {
- POTION("Potion", " Potion", "potion"),
- KEY("Key", " Key", "key"),
- BIGKEY("KeyBig", " Big Key", "bosskey"),
- BOTTLE("Bottle", " Bottle", "bottle"),
- GEM("Gem", " Gemstone", "gem"),
- DROP("Droplet", " Droplet", "droplet"),
- MUSHROOM("Mushroom", " Mushroom", "mushroom");
-
- private String TYPE;
- private String DISPLAY_NAME_SUFFIX;
- private String OREDICT_PREFIX;
-
- private MiscTypes (final String LocalName, final String DisplayNameSuffix, final String OreDictPrefix){
- this.TYPE = LocalName;
- this.DISPLAY_NAME_SUFFIX = DisplayNameSuffix;
- this.OREDICT_PREFIX = OreDictPrefix;
- }
-
- public String getType(){
- return this.TYPE;
- }
-
- public String getName(){
- return this.DISPLAY_NAME_SUFFIX;
- }
-
- public String getOreDictPrefix(){
- return this.OREDICT_PREFIX;
- }
-
- }
-
+public class BaseItemMisc extends Item {
+
+ public final String displayName;
+ public final String unlocalName;
+ public final MiscTypes miscType;
+ public final Object componentColour;
+ public final String[] description;
+
+ public BaseItemMisc(
+ final String displayName,
+ final short[] RGB,
+ final int maxStackSize,
+ final MiscTypes miscType,
+ String[] description) {
+
+ // Set-up the Misc Generic Item
+ this.displayName = displayName;
+ String unlocalName = Utils.sanitizeString(displayName);
+ this.unlocalName = "item" + miscType.TYPE + unlocalName;
+ this.miscType = miscType;
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(this.unlocalName);
+ this.setMaxStackSize(maxStackSize);
+ // this.setTextureName(this.getCorrectTextures());
+ if (RGB != null) {
+ this.componentColour = Utils.rgbtoHexValue(RGB[0], RGB[1], RGB[2]);
+ } else {
+ this.componentColour = null;
+ }
+ this.description = description;
+ GameRegistry.registerItem(this, this.unlocalName);
+ GT_OreDictUnificator.registerOre(miscType.getOreDictPrefix() + unlocalName, ItemUtils.getSimpleStack(this));
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return this.displayName + miscType.DISPLAY_NAME_SUFFIX;
+ }
+
+ private String getCorrectTextures() {
+ return CORE.MODID + ":" + "item" + this.miscType.TYPE;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return this.miscType == MiscTypes.DROP;
+ }
+
+ @Override
+ public int getRenderPasses(int meta) {
+ return (this.miscType == MiscTypes.DROP) ? 2 : 1;
+ }
+
+ @SideOnly(Side.CLIENT)
+ private IIcon secondIcon;
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister) {
+ if (this.miscType == MiscTypes.DROP && LoadedMods.Forestry) {
+ this.itemIcon = par1IconRegister.registerIcon("forestry:honeyDrop.0");
+ this.secondIcon = par1IconRegister.registerIcon("forestry:honeyDrop.1");
+ } else {
+ this.itemIcon = par1IconRegister.registerIcon(getCorrectTextures());
+ }
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return (pass == 0) ? itemIcon : secondIcon;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public final void addInformation(
+ final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.description != null) { // Incase I don't add one
+ if (this.description.length > 0) { // Incase I somehow add a blank one
+ for (int x = 0; x < this.description.length; x++) {
+ list.add(EnumChatFormatting.GRAY + description[x]);
+ }
+ }
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ // Returns default colour if a custom one is not set.
+ if (this.componentColour == null) {
+ return 16777215;
+ } else {
+ return (int) this.componentColour;
+ }
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ // Nothing Fancy here yet.
+ }
+
+ public static enum MiscTypes {
+ POTION("Potion", " Potion", "potion"),
+ KEY("Key", " Key", "key"),
+ BIGKEY("KeyBig", " Big Key", "bosskey"),
+ BOTTLE("Bottle", " Bottle", "bottle"),
+ GEM("Gem", " Gemstone", "gem"),
+ DROP("Droplet", " Droplet", "droplet"),
+ MUSHROOM("Mushroom", " Mushroom", "mushroom");
+
+ private String TYPE;
+ private String DISPLAY_NAME_SUFFIX;
+ private String OREDICT_PREFIX;
+
+ private MiscTypes(final String LocalName, final String DisplayNameSuffix, final String OreDictPrefix) {
+ this.TYPE = LocalName;
+ this.DISPLAY_NAME_SUFFIX = DisplayNameSuffix;
+ this.OREDICT_PREFIX = OreDictPrefix;
+ }
+
+ public String getType() {
+ return this.TYPE;
+ }
+
+ public String getName() {
+ return this.DISPLAY_NAME_SUFFIX;
+ }
+
+ public String getOreDictPrefix() {
+ return this.OREDICT_PREFIX;
+ }
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java b/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java
index b7bbc84757..2b26bf0db8 100644
--- a/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java
+++ b/src/main/java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java
@@ -1,12 +1,11 @@
package gtPlusPlus.core.item.base.misc;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.lib.CORE;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
@@ -14,44 +13,51 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public abstract class BaseItemParticle extends CoreItem {
-
- protected static final Map<Integer, Integer> aColourMap = new LinkedHashMap<Integer, Integer> ();
- private final int aMaxCount;
-
- public BaseItemParticle(String aType, int aCount, EnumRarity aRarity) {
- super("particle"+aType, aType, AddToCreativeTab.tabOther, 64, 0, new String[] {}, aRarity, EnumChatFormatting.DARK_AQUA, false, null);
- this.setTextureName(CORE.MODID + ":" + "science/Atom");
- aMaxCount = aCount;
- this.setHasSubtypes(true);
-
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return aColourMap.get(stack.getItemDamage());
- }
-
- public int getColorFromParentClass(ItemStack stack, int aaa) {
- return super.getColorFromItemStack(stack, aaa);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < aMaxCount; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
-
- @Override
- public final String getItemStackDisplayName(final ItemStack tItem) {
- String aReturnValue = super.getItemStackDisplayName(tItem);
- String[] a2 = getAffixes();
- aReturnValue = (a2[0] + aReturnValue + a2[1]);
- return aReturnValue;
- }
-
- public abstract String[] getAffixes();
-
+
+ protected static final Map<Integer, Integer> aColourMap = new LinkedHashMap<Integer, Integer>();
+ private final int aMaxCount;
+
+ public BaseItemParticle(String aType, int aCount, EnumRarity aRarity) {
+ super(
+ "particle" + aType,
+ aType,
+ AddToCreativeTab.tabOther,
+ 64,
+ 0,
+ new String[] {},
+ aRarity,
+ EnumChatFormatting.DARK_AQUA,
+ false,
+ null);
+ this.setTextureName(CORE.MODID + ":" + "science/Atom");
+ aMaxCount = aCount;
+ this.setHasSubtypes(true);
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ return aColourMap.get(stack.getItemDamage());
+ }
+
+ public int getColorFromParentClass(ItemStack stack, int aaa) {
+ return super.getColorFromItemStack(stack, aaa);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < aMaxCount; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public final String getItemStackDisplayName(final ItemStack tItem) {
+ String aReturnValue = super.getItemStackDisplayName(tItem);
+ String[] a2 = getAffixes();
+ aReturnValue = (a2[0] + aReturnValue + a2[1]);
+ return aReturnValue;
+ }
+
+ public abstract String[] getAffixes();
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java b/src/main/java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java
index 1644856bf8..b0537f022f 100644
--- a/src/main/java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java
+++ b/src/main/java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java
@@ -3,10 +3,9 @@ package gtPlusPlus.core.item.base.nugget;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemNugget extends BaseItemComponent{
+public class BaseItemNugget extends BaseItemComponent {
- public BaseItemNugget(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.NUGGET);
- }
-
+ public BaseItemNugget(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.NUGGET);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java
index 73a13f568d..9a72f62040 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java
@@ -2,9 +2,9 @@ package gtPlusPlus.core.item.base.ore;
import gtPlusPlus.core.material.Material;
-public class BaseItemCentrifugedCrushedOre extends BaseOreComponent{
+public class BaseItemCentrifugedCrushedOre extends BaseOreComponent {
- public BaseItemCentrifugedCrushedOre(final Material material) {
- super(material, BaseOreComponent.ComponentTypes.CRUSHEDCENTRIFUGED);
- }
+ public BaseItemCentrifugedCrushedOre(final Material material) {
+ super(material, BaseOreComponent.ComponentTypes.CRUSHEDCENTRIFUGED);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCrushedOre.java b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCrushedOre.java
index f2ca40334f..e9588f9f96 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCrushedOre.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemCrushedOre.java
@@ -2,9 +2,9 @@ package gtPlusPlus.core.item.base.ore;
import gtPlusPlus.core.material.Material;
-public class BaseItemCrushedOre extends BaseOreComponent{
+public class BaseItemCrushedOre extends BaseOreComponent {
- public BaseItemCrushedOre(final Material material) {
- super(material, BaseOreComponent.ComponentTypes.CRUSHED);
- }
+ public BaseItemCrushedOre(final Material material) {
+ super(material, BaseOreComponent.ComponentTypes.CRUSHED);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java
index 45dc4f4402..f80e392703 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java
@@ -2,9 +2,9 @@ package gtPlusPlus.core.item.base.ore;
import gtPlusPlus.core.material.Material;
-public class BaseItemImpureDust extends BaseOreComponent{
+public class BaseItemImpureDust extends BaseOreComponent {
- public BaseItemImpureDust(final Material material) {
- super(material, BaseOreComponent.ComponentTypes.DUSTIMPURE);
- }
+ public BaseItemImpureDust(final Material material) {
+ super(material, BaseOreComponent.ComponentTypes.DUSTIMPURE);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemMilledOre.java b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemMilledOre.java
index 4edf4ae75d..5d395aacb1 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemMilledOre.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemMilledOre.java
@@ -6,20 +6,18 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import net.minecraft.item.Item;
-public class BaseItemMilledOre extends BaseOreComponent{
+public class BaseItemMilledOre extends BaseOreComponent {
- public BaseItemMilledOre(final Material material, int aMaterialEU) {
- super(material, BaseOreComponent.ComponentTypes.MILLED);
- CORE.RA.addMillingRecipe(material, aMaterialEU);
- }
+ public BaseItemMilledOre(final Material material, int aMaterialEU) {
+ super(material, BaseOreComponent.ComponentTypes.MILLED);
+ CORE.RA.addMillingRecipe(material, aMaterialEU);
+ }
- public static Item generate(Materials aMat, int aMaterialEU) {
- return generate(MaterialUtils.generateMaterialFromGtENUM(aMat), aMaterialEU);
- }
-
- public static Item generate(Material aMat, int aMaterialEU) {
- return new BaseItemMilledOre(aMat, aMaterialEU);
- }
-
-
+ public static Item generate(Materials aMat, int aMaterialEU) {
+ return generate(MaterialUtils.generateMaterialFromGtENUM(aMat), aMaterialEU);
+ }
+
+ public static Item generate(Material aMat, int aMaterialEU) {
+ return new BaseItemMilledOre(aMat, aMaterialEU);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java
index 3f2a1c23e6..744b204d43 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java
@@ -2,9 +2,9 @@ package gtPlusPlus.core.item.base.ore;
import gtPlusPlus.core.material.Material;
-public class BaseItemPurifiedCrushedOre extends BaseOreComponent{
+public class BaseItemPurifiedCrushedOre extends BaseOreComponent {
- public BaseItemPurifiedCrushedOre(final Material material) {
- super(material, BaseOreComponent.ComponentTypes.CRUSHEDPURIFIED);
- }
+ public BaseItemPurifiedCrushedOre(final Material material) {
+ super(material, BaseOreComponent.ComponentTypes.CRUSHEDPURIFIED);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java
index 0c9816fb56..4b94b98e64 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java
@@ -2,9 +2,9 @@ package gtPlusPlus.core.item.base.ore;
import gtPlusPlus.core.material.Material;
-public class BaseItemPurifiedDust extends BaseOreComponent{
+public class BaseItemPurifiedDust extends BaseOreComponent {
- public BaseItemPurifiedDust(final Material material) {
- super(material, BaseOreComponent.ComponentTypes.DUSTPURE);
- }
+ public BaseItemPurifiedDust(final Material material) {
+ super(material, BaseOreComponent.ComponentTypes.DUSTPURE);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
index 2cb23b3f97..48d8498380 100644
--- a/src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
+++ b/src/main/java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.item.base.ore;
-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;
@@ -18,6 +14,9 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.enums.CustomOrePrefix;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -26,254 +25,248 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-public class BaseOreComponent extends Item{
-
- @SideOnly(Side.CLIENT)
- private IIcon base;
- @SideOnly(Side.CLIENT)
- private IIcon overlay;
-
- public final Material componentMaterial;
- public final String materialName;
- public final String unlocalName;
- public final ComponentTypes componentType;
- public final int componentColour;
- public Object extraData;
-
- public BaseOreComponent(final Material material, final ComponentTypes componentType) {
- this.componentMaterial = material;
- this.unlocalName = componentType.COMPONENT_NAME+material.getUnlocalizedName();
- this.materialName = material.getLocalizedName();
- this.componentType = componentType;
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(this.unlocalName);
- this.setMaxStackSize(64);
- this.componentColour = material.getRgbAsHex();
- GameRegistry.registerItem(this, this.unlocalName);
- registerComponent();
- GT_OreDictUnificator.registerOre(componentType.getComponent()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
- if (LoadedMods.Thaumcraft) {
- //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1);
- if (componentMaterial.isRadioactive) {
- //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel);
- }
- }
-
- }
-
- public boolean registerComponent() {
- Logger.MATERIALS("Attempting to register "+this.getUnlocalizedName()+".");
- if (this.componentMaterial == null) {
- Logger.MATERIALS("Tried to register "+this.getUnlocalizedName()+" but the material was null.");
- return false;
- }
- //Register Component
- Map<String, ItemStack> aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName());
- if (aMap == null) {
- aMap = new HashMap<String, ItemStack>();
- }
- String aKey = "Invalid";
- if (componentType == ComponentTypes.CRUSHED) {
- aKey = OrePrefixes.crushed.name();
- }
- else if (componentType == ComponentTypes.CRUSHEDCENTRIFUGED) {
- aKey = OrePrefixes.crushedCentrifuged.name();
- }
- else if (componentType == ComponentTypes.CRUSHEDPURIFIED) {
- aKey = OrePrefixes.crushedPurified.name();
- }
- else if (componentType == ComponentTypes.DUST) {
- aKey = OrePrefixes.dust.name();
- }
- else if (componentType == ComponentTypes.DUSTIMPURE) {
- aKey = OrePrefixes.dustImpure.name();
- }
- else if (componentType == ComponentTypes.DUSTPURE) {
- aKey = OrePrefixes.dustPure.name();
- }
- else if (componentType == ComponentTypes.MILLED) {
- aKey = CustomOrePrefix.milled.get().name();
- }
-
- ItemStack x = aMap.get(aKey);
- if (x == null) {
- aMap.put(aKey, ItemUtils.getSimpleStack(this));
- Logger.MATERIALS("Registering a material component. Item: ["+componentMaterial.getUnlocalizedName()+"] Map: ["+aKey+"]");
- Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap);
- return true;
- }
- else {
- //Bad
- Logger.MATERIALS("Tried to double register a material component. ");
- return false;
- }
- }
-
- /*@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return (this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME);
- }*/
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.materialName != null && !this.materialName.equals("")){
- if (this.componentMaterial != null){
- if (!this.componentMaterial.vChemicalFormula.contains("?")) {
- list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula));
- }
- else if (this.componentMaterial.vChemicalFormula.contains("?")) {
- String temp = componentMaterial.vChemicalFormula;
- temp = temp.replace(" ", "");
- temp = temp.replace("-", "");
- temp = temp.replace("_", "");
- temp = temp.replace("!", "");
- temp = temp.replace("@", "");
- temp = temp.replace("#", "");
- temp = temp.replace(" ", "");
- list.add(temp);
- }
- if (this.componentMaterial.isRadioactive){
- list.add(CORE.GT_Tooltip_Radioactive+" | Level: "+this.componentMaterial.vRadiationLevel);
- }
- }
- else {
- String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase());
- if (aChemicalFormula != null && aChemicalFormula.length() > 0) {
- list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula));
- }
- }
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (this.componentMaterial != null){
- if (entityHolding instanceof EntityPlayer){
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.componentMaterial.vRadiationLevel, world, entityHolding);
- }
- }
- }
- }
-
-
-
- /**
- * Rendering Related
- * @author Alkalus
- *
- */
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses(){
- if (this.componentType.hasOverlay()){
- return true;
- }
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister par1IconRegister){
- if (this.componentType == ComponentTypes.MILLED) {
- this.base = par1IconRegister.registerIcon(CORE.MODID + ":" + "processing/MilledOre/milled");
- if (this.componentType.hasOverlay()){
- this.overlay = par1IconRegister.registerIcon(CORE.MODID + ":" + "processing/MilledOre/milled_OVERLAY");
- }
- }
- else if (CORE.ConfigSwitches.useGregtechTextures){
- //Logger.MATERIALS(this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME+" is using `"+"gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME+"' as the layer 0 texture path.");
- this.base = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME);
- if (this.componentType.hasOverlay()){
- //Logger.MATERIALS(this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME+" is using `"+"gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME+"_OVERLAY"+"' as the layer 1 texture path.");
- this.overlay = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME+"_OVERLAY");
- }
- }
- else {
- this.base = par1IconRegister.registerIcon(CORE.MODID + ":" + "item"+this.componentType.getComponent());
- if (this.componentType.hasOverlay()){
- this.overlay = par1IconRegister.registerIcon(CORE.MODID + ":" + "item"+this.componentType.getComponent()+"_Overlay");
- }
- }
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
- if (this.componentType == ComponentTypes.MILLED) {
- if (renderPass == 1){
- return Utils.rgbtoHexValue(230, 230, 230);
- }
- return this.componentColour;
- }
- else {
- if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures){
- return this.componentColour;
- }
- if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures){
- return Utils.rgbtoHexValue(230, 230, 230);
- }
- return this.componentColour;
- }
- }
-
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if(pass == 0) {
- return this.base;
- }
- return this.overlay;
- }
-
-
-
-
- public static enum ComponentTypes {
- DUST("dust", "", " Dust", true),
- DUSTIMPURE("dustImpure", "Impure ", " Dust", true),
- DUSTPURE("dustPure", "Purified ", " Dust", true),
- CRUSHED("crushed", "Crushed ", " Ore", true),
- CRUSHEDCENTRIFUGED("crushedCentrifuged", "Centrifuged Crushed "," Ore", true),
- CRUSHEDPURIFIED("crushedPurified", "Purified Crushed ", " Ore", true),
- MILLED("milled", "Milled ", " Ore", true);
-
- private String COMPONENT_NAME;
- private String PREFIX;
- private String DISPLAY_NAME;
- private boolean HAS_OVERLAY;
- private ComponentTypes (final String LocalName, final String prefix, final String DisplayName, final boolean overlay){
- this.COMPONENT_NAME = LocalName;
- this.PREFIX = prefix;
- this.DISPLAY_NAME = DisplayName;
- this.HAS_OVERLAY = overlay;
- // dust + Dirty, Impure, Pure, Refined
- // crushed + centrifuged, purified
- }
-
- public String getComponent(){
- return this.COMPONENT_NAME;
- }
-
- public String getName(){
- return this.DISPLAY_NAME;
- }
-
- public boolean hasOverlay(){
- return this.HAS_OVERLAY;
- }
-
- public String getPrefix(){
- return this.PREFIX;
- }
- }
-
+public class BaseOreComponent extends Item {
+
+ @SideOnly(Side.CLIENT)
+ private IIcon base;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon overlay;
+
+ public final Material componentMaterial;
+ public final String materialName;
+ public final String unlocalName;
+ public final ComponentTypes componentType;
+ public final int componentColour;
+ public Object extraData;
+
+ public BaseOreComponent(final Material material, final ComponentTypes componentType) {
+ this.componentMaterial = material;
+ this.unlocalName = componentType.COMPONENT_NAME + material.getUnlocalizedName();
+ this.materialName = material.getLocalizedName();
+ this.componentType = componentType;
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(this.unlocalName);
+ this.setMaxStackSize(64);
+ this.componentColour = material.getRgbAsHex();
+ GameRegistry.registerItem(this, this.unlocalName);
+ registerComponent();
+ GT_OreDictUnificator.registerOre(
+ componentType.getComponent() + material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
+ if (LoadedMods.Thaumcraft) {
+ // ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this),
+ // TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1);
+ if (componentMaterial.isRadioactive) {
+ // ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this),
+ // TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel);
+ }
+ }
+ }
+
+ public boolean registerComponent() {
+ Logger.MATERIALS("Attempting to register " + this.getUnlocalizedName() + ".");
+ if (this.componentMaterial == null) {
+ Logger.MATERIALS("Tried to register " + this.getUnlocalizedName() + " but the material was null.");
+ return false;
+ }
+ // Register Component
+ Map<String, ItemStack> aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName());
+ if (aMap == null) {
+ aMap = new HashMap<String, ItemStack>();
+ }
+ String aKey = "Invalid";
+ if (componentType == ComponentTypes.CRUSHED) {
+ aKey = OrePrefixes.crushed.name();
+ } else if (componentType == ComponentTypes.CRUSHEDCENTRIFUGED) {
+ aKey = OrePrefixes.crushedCentrifuged.name();
+ } else if (componentType == ComponentTypes.CRUSHEDPURIFIED) {
+ aKey = OrePrefixes.crushedPurified.name();
+ } else if (componentType == ComponentTypes.DUST) {
+ aKey = OrePrefixes.dust.name();
+ } else if (componentType == ComponentTypes.DUSTIMPURE) {
+ aKey = OrePrefixes.dustImpure.name();
+ } else if (componentType == ComponentTypes.DUSTPURE) {
+ aKey = OrePrefixes.dustPure.name();
+ } else if (componentType == ComponentTypes.MILLED) {
+ aKey = CustomOrePrefix.milled.get().name();
+ }
+
+ ItemStack x = aMap.get(aKey);
+ if (x == null) {
+ aMap.put(aKey, ItemUtils.getSimpleStack(this));
+ Logger.MATERIALS("Registering a material component. Item: [" + componentMaterial.getUnlocalizedName()
+ + "] Map: [" + aKey + "]");
+ Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap);
+ return true;
+ } else {
+ // Bad
+ Logger.MATERIALS("Tried to double register a material component. ");
+ return false;
+ }
+ }
+
+ /*@Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return (this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME);
+ }*/
+
+ public final String getMaterialName() {
+ return this.materialName;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public final void addInformation(
+ final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.materialName != null && !this.materialName.equals("")) {
+ if (this.componentMaterial != null) {
+ if (!this.componentMaterial.vChemicalFormula.contains("?")) {
+ list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula));
+ } else if (this.componentMaterial.vChemicalFormula.contains("?")) {
+ String temp = componentMaterial.vChemicalFormula;
+ temp = temp.replace(" ", "");
+ temp = temp.replace("-", "");
+ temp = temp.replace("_", "");
+ temp = temp.replace("!", "");
+ temp = temp.replace("@", "");
+ temp = temp.replace("#", "");
+ temp = temp.replace(" ", "");
+ list.add(temp);
+ }
+ if (this.componentMaterial.isRadioactive) {
+ list.add(CORE.GT_Tooltip_Radioactive + " | Level: " + this.componentMaterial.vRadiationLevel);
+ }
+ } else {
+ String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase());
+ if (aChemicalFormula != null && aChemicalFormula.length() > 0) {
+ list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula));
+ }
+ }
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (this.componentMaterial != null) {
+ if (entityHolding instanceof EntityPlayer) {
+ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode) {
+ EntityUtils.applyRadiationDamageToEntity(
+ iStack.stackSize, this.componentMaterial.vRadiationLevel, world, entityHolding);
+ }
+ }
+ }
+ }
+
+ /**
+ * Rendering Related
+ * @author Alkalus
+ *
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ if (this.componentType.hasOverlay()) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(final IIconRegister par1IconRegister) {
+ if (this.componentType == ComponentTypes.MILLED) {
+ this.base = par1IconRegister.registerIcon(CORE.MODID + ":" + "processing/MilledOre/milled");
+ if (this.componentType.hasOverlay()) {
+ this.overlay = par1IconRegister.registerIcon(CORE.MODID + ":" + "processing/MilledOre/milled_OVERLAY");
+ }
+ } else if (CORE.ConfigSwitches.useGregtechTextures) {
+ // Logger.MATERIALS(this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME+" is using `"+"gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME+"' as the layer 0 texture path.");
+ this.base = par1IconRegister.registerIcon(
+ "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME);
+ if (this.componentType.hasOverlay()) {
+ // Logger.MATERIALS(this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME+" is using `"+"gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME+"_OVERLAY"+"' as the layer 1 texture path.");
+ this.overlay = par1IconRegister.registerIcon(
+ "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME + "_OVERLAY");
+ }
+ } else {
+ this.base = par1IconRegister.registerIcon(CORE.MODID + ":" + "item" + this.componentType.getComponent());
+ if (this.componentType.hasOverlay()) {
+ this.overlay = par1IconRegister.registerIcon(
+ CORE.MODID + ":" + "item" + this.componentType.getComponent() + "_Overlay");
+ }
+ }
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
+ if (this.componentType == ComponentTypes.MILLED) {
+ if (renderPass == 1) {
+ return Utils.rgbtoHexValue(230, 230, 230);
+ }
+ return this.componentColour;
+ } else {
+ if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures) {
+ return this.componentColour;
+ }
+ if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures) {
+ return Utils.rgbtoHexValue(230, 230, 230);
+ }
+ return this.componentColour;
+ }
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if (pass == 0) {
+ return this.base;
+ }
+ return this.overlay;
+ }
+
+ public static enum ComponentTypes {
+ DUST("dust", "", " Dust", true),
+ DUSTIMPURE("dustImpure", "Impure ", " Dust", true),
+ DUSTPURE("dustPure", "Purified ", " Dust", true),
+ CRUSHED("crushed", "Crushed ", " Ore", true),
+ CRUSHEDCENTRIFUGED("crushedCentrifuged", "Centrifuged Crushed ", " Ore", true),
+ CRUSHEDPURIFIED("crushedPurified", "Purified Crushed ", " Ore", true),
+ MILLED("milled", "Milled ", " Ore", true);
+
+ private String COMPONENT_NAME;
+ private String PREFIX;
+ private String DISPLAY_NAME;
+ private boolean HAS_OVERLAY;
+
+ private ComponentTypes(
+ final String LocalName, final String prefix, final String DisplayName, final boolean overlay) {
+ this.COMPONENT_NAME = LocalName;
+ this.PREFIX = prefix;
+ this.DISPLAY_NAME = DisplayName;
+ this.HAS_OVERLAY = overlay;
+ // dust + Dirty, Impure, Pure, Refined
+ // crushed + centrifuged, purified
+ }
+
+ public String getComponent() {
+ return this.COMPONENT_NAME;
+ }
+
+ public String getName() {
+ return this.DISPLAY_NAME;
+ }
+
+ public boolean hasOverlay() {
+ return this.HAS_OVERLAY;
+ }
+
+ public String getPrefix() {
+ return this.PREFIX;
+ }
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java
index a810b22c70..7737409209 100644
--- a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java
+++ b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java
@@ -5,14 +5,20 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
-public class BaseItemPlate extends BaseItemComponent{
+public class BaseItemPlate extends BaseItemComponent {
- public BaseItemPlate(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.PLATE);
- }
-
- public BaseItemPlate(final String unlocalizedName, final String materialName, final MaterialState state, final short[] colour, final int tier, final int sRadioactivity) {
- this(MaterialUtils.generateQuickMaterial(materialName, state, new short[]{colour[0], colour[1], colour[2], 0}, sRadioactivity));
- }
+ public BaseItemPlate(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.PLATE);
+ }
+ public BaseItemPlate(
+ final String unlocalizedName,
+ final String materialName,
+ final MaterialState state,
+ final short[] colour,
+ final int tier,
+ final int sRadioactivity) {
+ this(MaterialUtils.generateQuickMaterial(
+ materialName, state, new short[] {colour[0], colour[1], colour[2], 0}, sRadioactivity));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java
index 31f86e8ffa..3d3ebaa76d 100644
--- a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java
+++ b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java
@@ -1,20 +1,18 @@
package gtPlusPlus.core.item.base.plates;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
+import net.minecraft.item.ItemStack;
-public class BaseItemPlateDouble extends BaseItemComponent{
+public class BaseItemPlateDouble extends BaseItemComponent {
- public BaseItemPlateDouble(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.PLATEDOUBLE);
- this.setMaxStackSize(32);
- }
+ public BaseItemPlateDouble(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.PLATEDOUBLE);
+ this.setMaxStackSize(32);
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return ("Double "+this.materialName+ " Plate");
- }
-
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return ("Double " + this.materialName + " Plate");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java
index c9072b0d82..79e898cc6a 100644
--- a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java
+++ b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java
@@ -8,40 +8,38 @@ import gtPlusPlus.core.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
-public class BaseItemPlateHeavy extends BaseItemComponent{
-
- final static ComponentTypes HEAVY = ComponentTypes.PLATEHEAVY;
-
- public BaseItemPlateHeavy(final Material material) {
- super(material, HEAVY);
- }
-
- @Override
- public String getCorrectTextures(){
- return CORE.MODID + ":" + "itemHeavyPlate";
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses(){
- return true;
- }
-
- @Override
- public void registerIcons(final IIconRegister i) {
- this.base = i.registerIcon(CORE.MODID + ":" + "itemHeavyPlate");
- this.overlay = i.registerIcon(CORE.MODID + ":" + "itemHeavyPlate_Overlay");
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
-
- if (pass == 0) {
- return this.base;
- }
- else {
- return this.overlay;
- }
-
- }
+public class BaseItemPlateHeavy extends BaseItemComponent {
+
+ static final ComponentTypes HEAVY = ComponentTypes.PLATEHEAVY;
+
+ public BaseItemPlateHeavy(final Material material) {
+ super(material, HEAVY);
+ }
+
+ @Override
+ public String getCorrectTextures() {
+ return CORE.MODID + ":" + "itemHeavyPlate";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister i) {
+ this.base = i.registerIcon(CORE.MODID + ":" + "itemHeavyPlate");
+ this.overlay = i.registerIcon(CORE.MODID + ":" + "itemHeavyPlate_Overlay");
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+
+ if (pass == 0) {
+ return this.base;
+ } else {
+ return this.overlay;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java
index ec3f449b0a..87fb769525 100644
--- a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java
+++ b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java
@@ -1,95 +1,100 @@
package gtPlusPlus.core.item.base.plates;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.data.StringUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public class BaseItemPlate_OLD extends Item {
+
+ protected final int colour;
+ protected final int sRadiation;
+ protected final String materialName;
+ protected final String unlocalName;
+ protected final String chemicalNotation;
-public class BaseItemPlate_OLD extends Item{
+ public BaseItemPlate_OLD(
+ final String unlocalizedName, final String materialName, final int colour, final int sRadioactivity) {
+ this(unlocalizedName, materialName, "NullFormula", colour, sRadioactivity);
+ }
- protected final int colour;
- protected final int sRadiation;
- protected final String materialName;
- protected final String unlocalName;
- protected final String chemicalNotation;
+ public BaseItemPlate_OLD(
+ final String unlocalizedName,
+ final String materialName,
+ final String mChemicalFormula,
+ final int colour,
+ final int sRadioactivity) {
+ this.setUnlocalizedName("itemPlate" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.unlocalName = "itemPlate" + unlocalizedName;
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemPlate");
+ this.setMaxStackSize(64);
+ this.colour = colour;
+ this.materialName = materialName;
+ if (mChemicalFormula.equals("") || mChemicalFormula.equals("NullFormula")) {
+ this.chemicalNotation = StringUtils.subscript(materialName);
+ } else {
+ this.chemicalNotation = StringUtils.subscript(mChemicalFormula);
+ }
+ this.sRadiation = sRadioactivity;
+ GameRegistry.registerItem(this, "itemPlate" + unlocalizedName);
+ String temp;
+ if (this.unlocalName.toLowerCase().contains("itemplate")) {
+ temp = this.unlocalName.replace("itemP", "p");
+ if ((temp != null) && !temp.equals("")) {
+ GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
+ }
+ }
+ }
- public BaseItemPlate_OLD(final String unlocalizedName, final String materialName, final int colour, final int sRadioactivity) {
- this(unlocalizedName, materialName, "NullFormula", colour, sRadioactivity);
- }
-
- public BaseItemPlate_OLD(final String unlocalizedName, final String materialName, final String mChemicalFormula, final int colour, final int sRadioactivity) {
- this.setUnlocalizedName("itemPlate"+unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.unlocalName = "itemPlate"+unlocalizedName;
- this.setMaxStackSize(64);
- this.setTextureName(CORE.MODID + ":" + "itemPlate");
- this.setMaxStackSize(64);
- this.colour = colour;
- this.materialName = materialName;
- if (mChemicalFormula.equals("") || mChemicalFormula.equals("NullFormula")){
- this.chemicalNotation = StringUtils.subscript(materialName);
- }
- else {
- this.chemicalNotation = StringUtils.subscript(mChemicalFormula);
- }
- this.sRadiation = sRadioactivity;
- GameRegistry.registerItem(this, "itemPlate"+unlocalizedName);
- String temp;
- if (this.unlocalName.toLowerCase().contains("itemplate")){
- temp = this.unlocalName.replace("itemP", "p");
- if ((temp != null) && !temp.equals("")){
- GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
- }
- }
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return (this.materialName + " plate");
+ }
- return (this.materialName+ " plate");
- }
+ public final String getMaterialName() {
+ return this.materialName;
+ }
- public final String getMaterialName() {
- return this.materialName;
- }
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ if (this.colour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.colour;
+ }
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0){
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding);
+ }
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding);
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.sRadiation > 0){
- list.add(CORE.GT_Tooltip_Radioactive);
- }
- if (StringUtils.containsSuperOrSubScript(this.chemicalNotation)){
- list.add(this.chemicalNotation);
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.sRadiation > 0) {
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ if (StringUtils.containsSuperOrSubScript(this.chemicalNotation)) {
+ list.add(this.chemicalNotation);
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/rings/BaseItemRing.java b/src/main/java/gtPlusPlus/core/item/base/rings/BaseItemRing.java
index c83ae94af1..d25ea02d52 100644
--- a/src/main/java/gtPlusPlus/core/item/base/rings/BaseItemRing.java
+++ b/src/main/java/gtPlusPlus/core/item/base/rings/BaseItemRing.java
@@ -3,10 +3,9 @@ package gtPlusPlus.core.item.base.rings;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemRing extends BaseItemComponent{
+public class BaseItemRing extends BaseItemComponent {
- public BaseItemRing(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.RING);
- }
-
+ public BaseItemRing(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.RING);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
index f77f846d34..9a9998d63a 100644
--- a/src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
+++ b/src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
@@ -3,10 +3,9 @@ package gtPlusPlus.core.item.base.rods;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemRod extends BaseItemComponent{
-
- public BaseItemRod(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.ROD);
- }
+public class BaseItemRod extends BaseItemComponent {
+ public BaseItemRod(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.ROD);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java
index 215012817d..097d6ddd39 100644
--- a/src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java
+++ b/src/main/java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java
@@ -4,15 +4,14 @@ import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
import net.minecraft.item.ItemStack;
-public class BaseItemRodLong extends BaseItemComponent{
+public class BaseItemRodLong extends BaseItemComponent {
- public BaseItemRodLong(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.RODLONG);
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return ("Long "+this.materialName+ " Rod");
- }
+ public BaseItemRodLong(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.RODLONG);
+ }
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return ("Long " + this.materialName + " Rod");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java b/src/main/java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java
index 6960e89e89..c2fae0fc8b 100644
--- a/src/main/java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java
+++ b/src/main/java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.rotors;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemRotor extends BaseItemComponent{
+public class BaseItemRotor extends BaseItemComponent {
- public BaseItemRotor(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.ROTOR);
- }
+ public BaseItemRotor(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.ROTOR);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/main/java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
index dbd817215a..7f0ba8c504 100644
--- a/src/main/java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
+++ b/src/main/java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
@@ -3,10 +3,9 @@ package gtPlusPlus.core.item.base.screws;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemScrew extends BaseItemComponent{
-
- public BaseItemScrew(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.SCREW);
- }
+public class BaseItemScrew extends BaseItemComponent {
+ public BaseItemScrew(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.SCREW);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/wire/BaseItemFineWire.java b/src/main/java/gtPlusPlus/core/item/base/wire/BaseItemFineWire.java
index 846c282af3..3e2cee49a9 100644
--- a/src/main/java/gtPlusPlus/core/item/base/wire/BaseItemFineWire.java
+++ b/src/main/java/gtPlusPlus/core/item/base/wire/BaseItemFineWire.java
@@ -3,10 +3,9 @@ package gtPlusPlus.core.item.base.wire;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemFineWire extends BaseItemComponent{
-
- public BaseItemFineWire(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.FINEWIRE);
- }
+public class BaseItemFineWire extends BaseItemComponent {
+ public BaseItemFineWire(final Material material) {
+ super(material, BaseItemComponent.ComponentTypes.FINEWIRE);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java
index fdd148b97b..842b012e07 100644
--- a/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java
+++ b/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java
@@ -1,16 +1,21 @@
package gtPlusPlus.core.item.bauble;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
+import baubles.api.BaubleType;
+import baubles.api.IBauble;
+import baubles.common.container.InventoryBaubles;
+import baubles.common.lib.PlayerHandler;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
-
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
+import gtPlusPlus.core.util.minecraft.NBTUtils;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
@@ -18,173 +23,164 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
-
-import baubles.api.BaubleType;
-import baubles.api.IBauble;
-import baubles.common.container.InventoryBaubles;
-import baubles.common.lib.PlayerHandler;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
-@Optional.InterfaceList(value = { @Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"),
- @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles") })
+@Optional.InterfaceList(
+ value = {
+ @Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"),
+ @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")
+ })
public class BaseBauble extends Item implements IBauble {
- /**
- * Implementation suggestions taken from Botania.
- */
-
- private BaubleType mThisBauble;
- private final String mDisplayName;
- private List<String> damageNegations = new ArrayList<String>();
- Multimap<String, AttributeModifier> attributes = HashMultimap.create();
-
- public BaseBauble(BaubleType type, String displayName) {
- this.mThisBauble = type;
- this.mDisplayName = displayName;
- Utils.registerEvent(this);
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(Utils.sanitizeString(displayName.toLowerCase()));
- GameRegistry.registerItem(this, getUnlocalizedName());
- }
-
- public BaseBauble(BaubleType type, String unlocalName, int register) {
- this.mThisBauble = type;
- this.mDisplayName = "";
- Utils.registerEvent(this);
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- if (this.mDisplayName == null || this.mDisplayName.length() < 1) {
- return super.getItemStackDisplayName(tItem).replaceAll(".name", "");
- }
- return this.mDisplayName;
- }
-
- @SubscribeEvent
- public void onPlayerAttacked(LivingAttackEvent event) {
- if (event.entityLiving instanceof EntityPlayer) {
- EntityPlayer player = (EntityPlayer) event.entityLiving;
- if (getCorrectBauble(player) != null && damageNegations.contains(event.source.damageType))
- event.setCanceled(true);
- }
- }
-
- public boolean addDamageNegation(DamageSource damageSource) {
- return addDamageNegation(damageSource, null);
- }
-
- public boolean addDamageNegation(DamageSource damageSource, ItemStack aStack) {
- return damageNegations.add(damageSource.damageType);
- }
-
- public void clearDamageNegation() {
- damageNegations.clear();
- }
-
- @Override
- public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
- return EntityPlayer.class.isInstance(arg1) ? true : false;
- }
-
- @Override
- public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) {
- return EntityPlayer.class.isInstance(arg1) ? true : false;
- }
-
- @Override
- public BaubleType getBaubleType(ItemStack arg0) {
- return mThisBauble;
- }
-
- public boolean SetBaubleType(BT arg0) {
- return SetBaubleType(arg0.getType());
- }
-
- public boolean SetBaubleType(BaubleType arg0) {
- BaubleType temp = this.mThisBauble;
- this.mThisBauble = arg0;
- if (this.mThisBauble != temp) {
- return true;
- }
- return false;
- }
-
- @Override
- public void onEquipped(ItemStack stack, EntityLivingBase entity) {
- if (entity != null && EntityPlayer.class.isInstance(entity)) {
- onEquippedOrLoadedIntoWorld(stack, entity);
- setPlayerHashcode(stack, entity.hashCode());
- }
- }
-
- @Override
- public void onWornTick(ItemStack stack, EntityLivingBase player) {
- if (getPlayerHashcode(stack) != player.hashCode()) {
- onEquippedOrLoadedIntoWorld(stack, player);
- setPlayerHashcode(stack, player.hashCode());
- }
- }
-
- public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
- attributes.clear();
- fillModifiers(attributes, stack);
- player.getAttributeMap().applyAttributeModifiers(attributes);
- }
-
- @Override
- public void onUnequipped(ItemStack stack, EntityLivingBase player) {
- attributes.clear();
- fillModifiers(attributes, stack);
- player.getAttributeMap().removeAttributeModifiers(attributes);
- }
-
- void fillModifiers(Multimap<String, AttributeModifier> attributes, ItemStack stack) {
-
- }
-
- public ItemStack getCorrectBauble(EntityPlayer player) {
- InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player);
- ItemStack stack1 = baubles.getStackInSlot(1);
- ItemStack stack2 = baubles.getStackInSlot(2);
- return isCorrectBauble(stack1) ? stack1 : isCorrectBauble(stack2) ? stack2 : null;
- }
-
- private boolean isCorrectBauble(ItemStack stack) {
- return stack != null && (stack.getItem() == this);
- }
-
- @Override
- public int getEntityLifespan(ItemStack itemStack, World world) {
- return Integer.MAX_VALUE;
- }
-
- public static UUID getBaubleUUID(ItemStack stack) {
- long most = NBTUtils.getLong(stack, "baubleUUIDMost");
- if (most == 0) {
- UUID uuid = UUID.randomUUID();
- NBTUtils.setLong(stack, "baubleUUIDMost", uuid.getMostSignificantBits());
- NBTUtils.setLong(stack, "baubleUUIDLeast", uuid.getLeastSignificantBits());
- return getBaubleUUID(stack);
- }
-
- long least = NBTUtils.getLong(stack, "baubleUUIDLeast");
- return new UUID(most, least);
- }
-
- public static int getPlayerHashcode(ItemStack stack) {
- return NBTUtils.getInteger(stack, "mPlayerHashcode");
- }
-
- public static void setPlayerHashcode(ItemStack stack, int hash) {
- NBTUtils.setInteger(stack, "mPlayerHashcode", hash);
- }
-
+ /**
+ * Implementation suggestions taken from Botania.
+ */
+ private BaubleType mThisBauble;
+
+ private final String mDisplayName;
+ private List<String> damageNegations = new ArrayList<String>();
+ Multimap<String, AttributeModifier> attributes = HashMultimap.create();
+
+ public BaseBauble(BaubleType type, String displayName) {
+ this.mThisBauble = type;
+ this.mDisplayName = displayName;
+ Utils.registerEvent(this);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(Utils.sanitizeString(displayName.toLowerCase()));
+ GameRegistry.registerItem(this, getUnlocalizedName());
+ }
+
+ public BaseBauble(BaubleType type, String unlocalName, int register) {
+ this.mThisBauble = type;
+ this.mDisplayName = "";
+ Utils.registerEvent(this);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ if (this.mDisplayName == null || this.mDisplayName.length() < 1) {
+ return super.getItemStackDisplayName(tItem).replaceAll(".name", "");
+ }
+ return this.mDisplayName;
+ }
+
+ @SubscribeEvent
+ public void onPlayerAttacked(LivingAttackEvent event) {
+ if (event.entityLiving instanceof EntityPlayer) {
+ EntityPlayer player = (EntityPlayer) event.entityLiving;
+ if (getCorrectBauble(player) != null && damageNegations.contains(event.source.damageType))
+ event.setCanceled(true);
+ }
+ }
+
+ public boolean addDamageNegation(DamageSource damageSource) {
+ return addDamageNegation(damageSource, null);
+ }
+
+ public boolean addDamageNegation(DamageSource damageSource, ItemStack aStack) {
+ return damageNegations.add(damageSource.damageType);
+ }
+
+ public void clearDamageNegation() {
+ damageNegations.clear();
+ }
+
+ @Override
+ public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
+ return EntityPlayer.class.isInstance(arg1) ? true : false;
+ }
+
+ @Override
+ public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) {
+ return EntityPlayer.class.isInstance(arg1) ? true : false;
+ }
+
+ @Override
+ public BaubleType getBaubleType(ItemStack arg0) {
+ return mThisBauble;
+ }
+
+ public boolean SetBaubleType(BT arg0) {
+ return SetBaubleType(arg0.getType());
+ }
+
+ public boolean SetBaubleType(BaubleType arg0) {
+ BaubleType temp = this.mThisBauble;
+ this.mThisBauble = arg0;
+ if (this.mThisBauble != temp) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void onEquipped(ItemStack stack, EntityLivingBase entity) {
+ if (entity != null && EntityPlayer.class.isInstance(entity)) {
+ onEquippedOrLoadedIntoWorld(stack, entity);
+ setPlayerHashcode(stack, entity.hashCode());
+ }
+ }
+
+ @Override
+ public void onWornTick(ItemStack stack, EntityLivingBase player) {
+ if (getPlayerHashcode(stack) != player.hashCode()) {
+ onEquippedOrLoadedIntoWorld(stack, player);
+ setPlayerHashcode(stack, player.hashCode());
+ }
+ }
+
+ public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
+ attributes.clear();
+ fillModifiers(attributes, stack);
+ player.getAttributeMap().applyAttributeModifiers(attributes);
+ }
+
+ @Override
+ public void onUnequipped(ItemStack stack, EntityLivingBase player) {
+ attributes.clear();
+ fillModifiers(attributes, stack);
+ player.getAttributeMap().removeAttributeModifiers(attributes);
+ }
+
+ void fillModifiers(Multimap<String, AttributeModifier> attributes, ItemStack stack) {}
+
+ public ItemStack getCorrectBauble(EntityPlayer player) {
+ InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player);
+ ItemStack stack1 = baubles.getStackInSlot(1);
+ ItemStack stack2 = baubles.getStackInSlot(2);
+ return isCorrectBauble(stack1) ? stack1 : isCorrectBauble(stack2) ? stack2 : null;
+ }
+
+ private boolean isCorrectBauble(ItemStack stack) {
+ return stack != null && (stack.getItem() == this);
+ }
+
+ @Override
+ public int getEntityLifespan(ItemStack itemStack, World world) {
+ return Integer.MAX_VALUE;
+ }
+
+ public static UUID getBaubleUUID(ItemStack stack) {
+ long most = NBTUtils.getLong(stack, "baubleUUIDMost");
+ if (most == 0) {
+ UUID uuid = UUID.randomUUID();
+ NBTUtils.setLong(stack, "baubleUUIDMost", uuid.getMostSignificantBits());
+ NBTUtils.setLong(stack, "baubleUUIDLeast", uuid.getLeastSignificantBits());
+ return getBaubleUUID(stack);
+ }
+
+ long least = NBTUtils.getLong(stack, "baubleUUIDLeast");
+ return new UUID(most, least);
+ }
+
+ public static int getPlayerHashcode(ItemStack stack) {
+ return NBTUtils.getInteger(stack, "mPlayerHashcode");
+ }
+
+ public static void setPlayerHashcode(ItemStack stack, int hash) {
+ NBTUtils.setInteger(stack, "mPlayerHashcode", hash);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java
index 70de4603e7..c682c4a237 100644
--- a/src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java
+++ b/src/main/java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.item.bauble;
-import java.util.List;
-
import baubles.api.BaubleType;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -13,6 +11,7 @@ import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -26,234 +25,228 @@ import net.minecraft.world.World;
public class BatteryPackBaseBauble extends ElectricBaseBauble {
-
- public BatteryPackBaseBauble(int tier) {
- super(BaubleType.BELT, tier, GT_Values.V[tier] * 20 * 300, "GTPP.BattPack.0" + tier + ".name");
- String aUnlocalName = "GTPP.BattPack.0" + tier + ".name";
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- if (GameRegistry.findItem(CORE.MODID, aUnlocalName) == null) {
- GameRegistry.registerItem(this, aUnlocalName);
- }
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
- ItemStack itemStack = new ItemStack(this, 1);
- ItemStack charged;
- if (this.getEmptyItem(itemStack) == this) {
- charged = new ItemStack(this, 1);
- ElectricItem.manager.charge(charged, 0.0D, Integer.MAX_VALUE, true, false);
- itemList.add(charged);
- }
- if (this.getChargedItem(itemStack) == this) {
- charged = new ItemStack(this, 1);
- ElectricItem.manager.charge(charged, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, false);
- itemList.add(charged);
- }
-
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
- final boolean p_77663_5_) {
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
- double aItemCharge = ElectricItem.manager.getCharge(itemStack);
- return aItemCharge > 0;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return (EnumChatFormatting.BLUE + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY);
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return true;
- }
-
- public int secondsLeft(final ItemStack stack) {
- double r = 0;
- r = this.getCharge(stack) / (10000 * 20);
- return (int) MathUtils.decimalRounding(r);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("");
- String aString1 = StatCollector.translateToLocal("GTPP.battpack.tooltip.1");
- String aString2 = StatCollector.translateToLocal("GTPP.battpack.tooltip.2");
- String aString3 = StatCollector.translateToLocal("GTPP.battpack.tooltip.3");
- String aString4 = StatCollector.translateToLocal("GTPP.battpack.tooltip.4");
-
- String aEU = StatCollector.translateToLocal("GTPP.info.eu");
- String aEUT = aEU+"/t";
-
- list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN + aString2+" " + (int) getTransferLimit(stack) + aEUT +" "+ aString3 + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN + aString4 + EnumChatFormatting.GRAY);
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public String getToolTip(final ItemStack stack) {
- return ElectricItem.manager.getToolTip(stack);
- }
-
- @Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override // TODO
- public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
- }
-
- @Override // TODO
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
- }
-
- @Override // TODO
- public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayer) {
- if (!aPlayer.worldObj.isRemote) {
-
- try {
-
- if (this.getCharge(aBaubleStack) >= getTransferLimit(aBaubleStack)) {
- // Try Iterate Armour Slots of Player
- if (aPlayer instanceof EntityPlayer) {
-
- // amour
- for (final ItemStack aInvStack : ((EntityPlayer) aPlayer).inventory.armorInventory) {
- if (aInvStack != null) {
- if (aInvStack == aBaubleStack) {
- continue;
- }
- if (ChargingHelper.isItemValid(aInvStack)) {
- double aTransferRate = 0;
- final IElectricItem electricItem = (IElectricItem) aInvStack.getItem();
- if (electricItem != null) {
- aTransferRate = electricItem.getTransferLimit(aInvStack);
- double aItemCharge = ElectricItem.manager.getCharge(aInvStack);
- if (aItemCharge >= 0 && aItemCharge != electricItem.getMaxCharge(aInvStack)) {
- if (aItemCharge <= (electricItem.getMaxCharge(aInvStack) - aTransferRate)) {
- if (ElectricItem.manager.getCharge(aBaubleStack) >= aTransferRate) {
- if (ElectricItem.manager.getCharge(aInvStack) <= (electricItem.getMaxCharge(aInvStack) - aTransferRate)) {
- double d = ElectricItem.manager.charge(aInvStack, aTransferRate * 16, mTier, false, true);
- if (d > 0) {
- d = ElectricItem.manager.charge(aInvStack, aTransferRate * 16, mTier, false, false);
- ElectricItem.manager.discharge(aBaubleStack, d, mTier, false, true, false);
- //Logger.INFO("Charging " + aInvStack.getDisplayName() + " | " + d + " | "+electricItem.getMaxCharge(aInvStack));
- }
- }
- else {
- //Logger.INFO("5");
- }
- }
- else {
- //Logger.INFO("4");
- }
- }
- else {
- //Logger.INFO("3");
- }
-
- }
- else {
- //Logger.INFO("1");
- }
- }
-
- }
- }
- if (this.getCharge(aBaubleStack) > 0) {
- continue;
- } else {
- break;
- }
- }
-
- // Hotbar Slots
- int aSlotCounter = 0;
- for (final ItemStack aInvStack : ((EntityPlayer) aPlayer).inventory.mainInventory) {
- if (aSlotCounter > (InventoryPlayer.getHotbarSize() - 1)) {
- break;
- }
- aSlotCounter++;
- if (aInvStack != null) {
- if (aInvStack == aBaubleStack) {
- continue;
- }
- if (ChargingHelper.isItemValid(aInvStack)) {
- double aTransferRate = 0;
- final IElectricItem electricItem = (IElectricItem) aInvStack.getItem();
- if (electricItem != null) {
- aTransferRate = electricItem.getTransferLimit(aInvStack);
- double aItemCharge = ElectricItem.manager.getCharge(aInvStack);
- if (aItemCharge >= 0 && aItemCharge != electricItem.getMaxCharge(aInvStack)) {
- if (aItemCharge <= (electricItem.getMaxCharge(aInvStack) - aTransferRate)) {
- if (ElectricItem.manager.getCharge(aBaubleStack) >= aTransferRate) {
- if (ElectricItem.manager.getCharge(aInvStack) <= (electricItem.getMaxCharge(aInvStack) - aTransferRate)) {
- double d = ElectricItem.manager.charge(aInvStack, aTransferRate, mTier, false, true);
- if (d > 0) {
- d = ElectricItem.manager.charge(aInvStack, aTransferRate, mTier, false, false);
- ElectricItem.manager.discharge(aBaubleStack, d, mTier, false, true, false);
- //Logger.INFO("Charging " + aInvStack.getDisplayName() + " | " + d + " | "+electricItem.getMaxCharge(aInvStack));
- }
- }
- else {
- //Logger.INFO("5");
- }
- }
- else {
- //Logger.INFO("4");
- }
- }
- else {
- //Logger.INFO("3");
- }
-
- }
- else {
- //Logger.INFO("1");
- }
- }
- }
- }
- if (this.getCharge(aBaubleStack) > 0) {
- continue;
- } else {
- break;
- }
- }
- }
- }
- }
- catch (Throwable t) {
-
- }
- }
-
-
-
-
- }
-
- @Override
- public String getTextureNameForBauble() {
- return "chargepack/"+mTier;
- }
-
+ public BatteryPackBaseBauble(int tier) {
+ super(BaubleType.BELT, tier, GT_Values.V[tier] * 20 * 300, "GTPP.BattPack.0" + tier + ".name");
+ String aUnlocalName = "GTPP.BattPack.0" + tier + ".name";
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ if (GameRegistry.findItem(CORE.MODID, aUnlocalName) == null) {
+ GameRegistry.registerItem(this, aUnlocalName);
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
+ ItemStack itemStack = new ItemStack(this, 1);
+ ItemStack charged;
+ if (this.getEmptyItem(itemStack) == this) {
+ charged = new ItemStack(this, 1);
+ ElectricItem.manager.charge(charged, 0.0D, Integer.MAX_VALUE, true, false);
+ itemList.add(charged);
+ }
+ if (this.getChargedItem(itemStack) == this) {
+ charged = new ItemStack(this, 1);
+ ElectricItem.manager.charge(charged, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, false);
+ itemList.add(charged);
+ }
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World worldObj,
+ final Entity player,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean canProvideEnergy(final ItemStack itemStack) {
+ double aItemCharge = ElectricItem.manager.getCharge(itemStack);
+ return aItemCharge > 0;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return (EnumChatFormatting.BLUE + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY);
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return true;
+ }
+
+ public int secondsLeft(final ItemStack stack) {
+ double r = 0;
+ r = this.getCharge(stack) / (10000 * 20);
+ return (int) MathUtils.decimalRounding(r);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add("");
+ String aString1 = StatCollector.translateToLocal("GTPP.battpack.tooltip.1");
+ String aString2 = StatCollector.translateToLocal("GTPP.battpack.tooltip.2");
+ String aString3 = StatCollector.translateToLocal("GTPP.battpack.tooltip.3");
+ String aString4 = StatCollector.translateToLocal("GTPP.battpack.tooltip.4");
+
+ String aEU = StatCollector.translateToLocal("GTPP.info.eu");
+ String aEUT = aEU + "/t";
+
+ list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN + aString2 + " " + (int) getTransferLimit(stack) + aEUT + " " + aString3
+ + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN + aString4 + EnumChatFormatting.GRAY);
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public String getToolTip(final ItemStack stack) {
+ return ElectricItem.manager.getToolTip(stack);
+ }
+
+ @Override
+ public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override // TODO
+ public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {}
+
+ @Override // TODO
+ public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {}
+
+ @Override // TODO
+ public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayer) {
+ if (!aPlayer.worldObj.isRemote) {
+
+ try {
+
+ if (this.getCharge(aBaubleStack) >= getTransferLimit(aBaubleStack)) {
+ // Try Iterate Armour Slots of Player
+ if (aPlayer instanceof EntityPlayer) {
+
+ // amour
+ for (final ItemStack aInvStack : ((EntityPlayer) aPlayer).inventory.armorInventory) {
+ if (aInvStack != null) {
+ if (aInvStack == aBaubleStack) {
+ continue;
+ }
+ if (ChargingHelper.isItemValid(aInvStack)) {
+ double aTransferRate = 0;
+ final IElectricItem electricItem = (IElectricItem) aInvStack.getItem();
+ if (electricItem != null) {
+ aTransferRate = electricItem.getTransferLimit(aInvStack);
+ double aItemCharge = ElectricItem.manager.getCharge(aInvStack);
+ if (aItemCharge >= 0 && aItemCharge != electricItem.getMaxCharge(aInvStack)) {
+ if (aItemCharge <= (electricItem.getMaxCharge(aInvStack) - aTransferRate)) {
+ if (ElectricItem.manager.getCharge(aBaubleStack) >= aTransferRate) {
+ if (ElectricItem.manager.getCharge(aInvStack)
+ <= (electricItem.getMaxCharge(aInvStack) - aTransferRate)) {
+ double d = ElectricItem.manager.charge(
+ aInvStack, aTransferRate * 16, mTier, false, true);
+ if (d > 0) {
+ d = ElectricItem.manager.charge(
+ aInvStack, aTransferRate * 16, mTier, false, false);
+ ElectricItem.manager.discharge(
+ aBaubleStack, d, mTier, false, true, false);
+ // Logger.INFO("Charging " + aInvStack.getDisplayName() + "
+ // | " + d + " | "+electricItem.getMaxCharge(aInvStack));
+ }
+ } else {
+ // Logger.INFO("5");
+ }
+ } else {
+ // Logger.INFO("4");
+ }
+ } else {
+ // Logger.INFO("3");
+ }
+
+ } else {
+ // Logger.INFO("1");
+ }
+ }
+ }
+ }
+ if (this.getCharge(aBaubleStack) > 0) {
+ continue;
+ } else {
+ break;
+ }
+ }
+
+ // Hotbar Slots
+ int aSlotCounter = 0;
+ for (final ItemStack aInvStack : ((EntityPlayer) aPlayer).inventory.mainInventory) {
+ if (aSlotCounter > (InventoryPlayer.getHotbarSize() - 1)) {
+ break;
+ }
+ aSlotCounter++;
+ if (aInvStack != null) {
+ if (aInvStack == aBaubleStack) {
+ continue;
+ }
+ if (ChargingHelper.isItemValid(aInvStack)) {
+ double aTransferRate = 0;
+ final IElectricItem electricItem = (IElectricItem) aInvStack.getItem();
+ if (electricItem != null) {
+ aTransferRate = electricItem.getTransferLimit(aInvStack);
+ double aItemCharge = ElectricItem.manager.getCharge(aInvStack);
+ if (aItemCharge >= 0 && aItemCharge != electricItem.getMaxCharge(aInvStack)) {
+ if (aItemCharge <= (electricItem.getMaxCharge(aInvStack) - aTransferRate)) {
+ if (ElectricItem.manager.getCharge(aBaubleStack) >= aTransferRate) {
+ if (ElectricItem.manager.getCharge(aInvStack)
+ <= (electricItem.getMaxCharge(aInvStack) - aTransferRate)) {
+ double d = ElectricItem.manager.charge(
+ aInvStack, aTransferRate, mTier, false, true);
+ if (d > 0) {
+ d = ElectricItem.manager.charge(
+ aInvStack, aTransferRate, mTier, false, false);
+ ElectricItem.manager.discharge(
+ aBaubleStack, d, mTier, false, true, false);
+ // Logger.INFO("Charging " + aInvStack.getDisplayName() + "
+ // | " + d + " | "+electricItem.getMaxCharge(aInvStack));
+ }
+ } else {
+ // Logger.INFO("5");
+ }
+ } else {
+ // Logger.INFO("4");
+ }
+ } else {
+ // Logger.INFO("3");
+ }
+
+ } else {
+ // Logger.INFO("1");
+ }
+ }
+ }
+ }
+ if (this.getCharge(aBaubleStack) > 0) {
+ continue;
+ } else {
+ break;
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+
+ }
+ }
+ }
+
+ @Override
+ public String getTextureNameForBauble() {
+ return "chargepack/" + mTier;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java
index 4316f13401..321b3515aa 100644
--- a/src/main/java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java
+++ b/src/main/java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.item.bauble;
-import java.util.List;
-
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.common.Optional;
@@ -15,6 +13,7 @@ import gtPlusPlus.core.util.math.MathUtils;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IElectricItemManager;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -25,173 +24,188 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
-@Optional.InterfaceList(value = { @Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"),
-@Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles") })
+@Optional.InterfaceList(
+ value = {
+ @Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"),
+ @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")
+ })
public abstract class ElectricBaseBauble extends BaseBauble implements IElectricItem, IElectricItemManager, IBauble {
- public final int mTier;
- private final double maxValueEU;
- private final BaubleType mType;
-
- public ElectricBaseBauble(BaubleType aType, int aTier, double aMaxEU, String aUnlocalName) {
- super(aType, aUnlocalName, 0);
- mType = aType;
- mTier = aTier;
- maxValueEU = aMaxEU;
- this.setUnlocalizedName(aUnlocalName);
- this.setTextureName(CORE.MODID + ":" + getTextureNameForBauble());
- this.setMaxDamage(27);
- this.setMaxStackSize(1);
- this.setNoRepair();
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- if (GameRegistry.findItem(CORE.MODID, aUnlocalName) == null) {
- GameRegistry.registerItem(this, aUnlocalName);
- }
- }
-
- public abstract String getTextureNameForBauble();
-
- @SuppressWarnings("unchecked")
- @SideOnly(Side.CLIENT)
- @Override
- public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
- ItemStack itemStack = new ItemStack(this, 1);
- ItemStack charged;
- if (this.getEmptyItem(itemStack) == this) {
- charged = new ItemStack(this, 1);
- ElectricItem.manager.charge(charged, 0.0D, Integer.MAX_VALUE, true, false);
- itemList.add(charged);
- }
- if (this.getChargedItem(itemStack) == this) {
- charged = new ItemStack(this, 1);
- ElectricItem.manager.charge(charged, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, false);
- itemList.add(charged);
- }
-
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
- final boolean p_77663_5_) {
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
- double aItemCharge = ElectricItem.manager.getCharge(itemStack);
- return aItemCharge > 0;
- }
-
- @Override
- public final Item getChargedItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(27);
- return x.getItem();
- }
-
- @Override
- public final Item getEmptyItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(0);
- return x.getItem();
- }
-
- @Override
- public final double getMaxCharge(final ItemStack itemStack) {
- return maxValueEU;
- }
-
- @Override
- public final int getTier(final ItemStack itemStack) {
- return mTier;
- }
-
- @Override
- public final double getTransferLimit(final ItemStack itemStack) {
- return GT_Values.V[mTier];
- }
-
- @Override
- public final double getDurabilityForDisplay(final ItemStack stack) {
- return 1.0D - (this.getCharge(stack) / this.getMaxCharge(stack));
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("");
- String aEuInfo = StatCollector.translateToLocal("GTPP.info.euInfo");
- String aTier = StatCollector.translateToLocal("GTPP.machines.tier");
- String aInputLimit = StatCollector.translateToLocal("GTPP.info.inputLimit");
- String aCurrentPower = StatCollector.translateToLocal("GTPP.info.currentPower");
- String aEU = StatCollector.translateToLocal("GTPP.info.eu");
- String aEUT = aEU+"/t";
-
- list.add(EnumChatFormatting.GOLD + aEuInfo + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GRAY + aTier+": [" + EnumChatFormatting.YELLOW + this.getTier(stack)
- + EnumChatFormatting.GRAY + "] "+aInputLimit+": [" + EnumChatFormatting.YELLOW
- + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT+"]");
- list.add(EnumChatFormatting.GRAY + aCurrentPower +": [" + EnumChatFormatting.YELLOW + (long) this.getCharge(stack)
- + EnumChatFormatting.GRAY + aEU +"] [" + EnumChatFormatting.YELLOW
- + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY
- + "%]");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public final double charge(final ItemStack stack, final double amount, final int tier, final boolean ignoreTransferLimit,
- final boolean simulate) {
- /*if (!simulate) {
- ElectricItem.manager.charge(stack, amount, tier, true, simulate);
- }*/
-
- return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
- }
-
- @Override
- public final double discharge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) {
- /*if (!simulate) {
- ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }*/
-
- return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }
-
- @Override
- public final double getCharge(final ItemStack stack) {
- return ElectricItem.manager.getCharge(stack);
- }
-
- @Override
- public final boolean canUse(final ItemStack stack, final double amount) {
- return ElectricItem.manager.canUse(stack, amount);
- }
-
- @Override
- public final boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
- return ElectricItem.manager.use(stack, amount, entity);
- }
-
- @Override
- public final void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
- ElectricItem.manager.chargeFromArmor(stack, entity);
- }
-
- @Override
- public String getToolTip(final ItemStack stack) {
- //return ElectricItem.manager.getToolTip(stack);
- return null;
- }
-
- @Override
- public final BaubleType getBaubleType(final ItemStack arg0) {
- return mType;
- }
-
+ public final int mTier;
+ private final double maxValueEU;
+ private final BaubleType mType;
+
+ public ElectricBaseBauble(BaubleType aType, int aTier, double aMaxEU, String aUnlocalName) {
+ super(aType, aUnlocalName, 0);
+ mType = aType;
+ mTier = aTier;
+ maxValueEU = aMaxEU;
+ this.setUnlocalizedName(aUnlocalName);
+ this.setTextureName(CORE.MODID + ":" + getTextureNameForBauble());
+ this.setMaxDamage(27);
+ this.setMaxStackSize(1);
+ this.setNoRepair();
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ if (GameRegistry.findItem(CORE.MODID, aUnlocalName) == null) {
+ GameRegistry.registerItem(this, aUnlocalName);
+ }
+ }
+
+ public abstract String getTextureNameForBauble();
+
+ @SuppressWarnings("unchecked")
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
+ ItemStack itemStack = new ItemStack(this, 1);
+ ItemStack charged;
+ if (this.getEmptyItem(itemStack) == this) {
+ charged = new ItemStack(this, 1);
+ ElectricItem.manager.charge(charged, 0.0D, Integer.MAX_VALUE, true, false);
+ itemList.add(charged);
+ }
+ if (this.getChargedItem(itemStack) == this) {
+ charged = new ItemStack(this, 1);
+ ElectricItem.manager.charge(charged, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, false);
+ itemList.add(charged);
+ }
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World worldObj,
+ final Entity player,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean canProvideEnergy(final ItemStack itemStack) {
+ double aItemCharge = ElectricItem.manager.getCharge(itemStack);
+ return aItemCharge > 0;
+ }
+
+ @Override
+ public final Item getChargedItem(final ItemStack itemStack) {
+ final ItemStack x = itemStack.copy();
+ x.setItemDamage(27);
+ return x.getItem();
+ }
+
+ @Override
+ public final Item getEmptyItem(final ItemStack itemStack) {
+ final ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
+ }
+
+ @Override
+ public final double getMaxCharge(final ItemStack itemStack) {
+ return maxValueEU;
+ }
+
+ @Override
+ public final int getTier(final ItemStack itemStack) {
+ return mTier;
+ }
+
+ @Override
+ public final double getTransferLimit(final ItemStack itemStack) {
+ return GT_Values.V[mTier];
+ }
+
+ @Override
+ public final double getDurabilityForDisplay(final ItemStack stack) {
+ return 1.0D - (this.getCharge(stack) / this.getMaxCharge(stack));
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add("");
+ String aEuInfo = StatCollector.translateToLocal("GTPP.info.euInfo");
+ String aTier = StatCollector.translateToLocal("GTPP.machines.tier");
+ String aInputLimit = StatCollector.translateToLocal("GTPP.info.inputLimit");
+ String aCurrentPower = StatCollector.translateToLocal("GTPP.info.currentPower");
+ String aEU = StatCollector.translateToLocal("GTPP.info.eu");
+ String aEUT = aEU + "/t";
+
+ list.add(EnumChatFormatting.GOLD + aEuInfo + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY + aTier + ": [" + EnumChatFormatting.YELLOW + this.getTier(stack)
+ + EnumChatFormatting.GRAY + "] " + aInputLimit + ": [" + EnumChatFormatting.YELLOW
+ + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT + "]");
+ list.add(EnumChatFormatting.GRAY + aCurrentPower + ": [" + EnumChatFormatting.YELLOW
+ + (long) this.getCharge(stack)
+ + EnumChatFormatting.GRAY + aEU + "] [" + EnumChatFormatting.YELLOW
+ + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY
+ + "%]");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public final double charge(
+ final ItemStack stack,
+ final double amount,
+ final int tier,
+ final boolean ignoreTransferLimit,
+ final boolean simulate) {
+ /*if (!simulate) {
+ ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ }*/
+
+ return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ }
+
+ @Override
+ public final double discharge(
+ final ItemStack stack,
+ final double amount,
+ final int tier,
+ final boolean ignoreTransferLimit,
+ final boolean externally,
+ final boolean simulate) {
+ /*if (!simulate) {
+ ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }*/
+
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ @Override
+ public final double getCharge(final ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
+ }
+
+ @Override
+ public final boolean canUse(final ItemStack stack, final double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
+ }
+
+ @Override
+ public final boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
+ }
+
+ @Override
+ public final void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
+ }
+
+ @Override
+ public String getToolTip(final ItemStack stack) {
+ // return ElectricItem.manager.getToolTip(stack);
+ return null;
+ }
+
+ @Override
+ public final BaubleType getBaubleType(final ItemStack arg0) {
+ return mType;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
index 6a8751b682..e0f8cc6e27 100644
--- a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
+++ b/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
@@ -1,17 +1,16 @@
package gtPlusPlus.core.item.bauble;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.UUID;
-
import baubles.api.BaubleType;
import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.DevHelper;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.UUID;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -23,115 +22,118 @@ import net.minecraft.world.World;
public class FireProtectionBauble extends BaseBauble {
- public static HashMap<UUID, Boolean> mDataMap = new HashMap<UUID, Boolean>();
- public static HashSet<UUID> mPlayerMap = new HashSet<UUID>();
-
- private static Field isImmuneToFire;
-
- static {
- isImmuneToFire = ReflectionUtils.getField(Entity.class, DevHelper.isObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire");
- }
-
- public static boolean fireImmune(Entity aEntity) {
- return aEntity.isImmuneToFire();
- }
-
- public static boolean setEntityImmuneToFire(Entity aEntity, boolean aImmune) {
- try {
- return ReflectionUtils.setField(aEntity, isImmuneToFire, aImmune);
- }
- catch (Throwable t) {}
- return false;
- }
-
- public FireProtectionBauble() {
- super(BaubleType.RING, "GTPP.bauble.fireprotection.0" + ".name", 0);
- String aUnlocalName = "GTPP.bauble.fireprotection.0" + ".name";
- this.setUnlocalizedName(aUnlocalName);
- this.setTextureName(CORE.MODID + ":" + getTextureNameForBauble());
- this.setMaxDamage(100);
- this.setMaxStackSize(1);
- this.setNoRepair();
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- if (GameRegistry.findItem(CORE.MODID, aUnlocalName) == null) {
- GameRegistry.registerItem(this, aUnlocalName);
- }
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
- final boolean p_77663_5_) {
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
-
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return (EnumChatFormatting.DARK_RED + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY);
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return false;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public void onEquipped(final ItemStack arg0, final EntityLivingBase aPlayer) {
- if (!aPlayer.worldObj.isRemote) {
- if (aPlayer instanceof EntityPlayer) {
- EntityPlayer bPlayer = (EntityPlayer) aPlayer;
- mPlayerMap.add(bPlayer.getUniqueID());
- }
- }
- }
-
- @Override
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase aPlayer) {
- if (!aPlayer.worldObj.isRemote) {
- if (aPlayer instanceof EntityPlayer) {
- EntityPlayer bPlayer = (EntityPlayer) aPlayer;
- if (bPlayer.isPotionActive(Potion.fireResistance)) {
- bPlayer.removePotionEffect(Potion.fireResistance.id);
- }
- mPlayerMap.remove(bPlayer.getUniqueID());
- setEntityImmuneToFire(bPlayer, false);
- }
- }
- }
-
- @Override
- public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayer) {
- if (!aPlayer.worldObj.isRemote) {
- if (aPlayer instanceof EntityPlayer) {
- EntityPlayer bPlayer = (EntityPlayer) aPlayer;
- if (!fireImmune(bPlayer)) {
- setEntityImmuneToFire(bPlayer, true);
- }
- if (!bPlayer.isPotionActive(Potion.fireResistance)) {
- bPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 100, 4));
- }
- }
- }
- }
-
- public String getTextureNameForBauble() {
- return "baubles/itemFireProtectGlovesBetter";
- }
+ public static HashMap<UUID, Boolean> mDataMap = new HashMap<UUID, Boolean>();
+ public static HashSet<UUID> mPlayerMap = new HashSet<UUID>();
+
+ private static Field isImmuneToFire;
+
+ static {
+ isImmuneToFire = ReflectionUtils.getField(
+ Entity.class, DevHelper.isObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire");
+ }
+
+ public static boolean fireImmune(Entity aEntity) {
+ return aEntity.isImmuneToFire();
+ }
+
+ public static boolean setEntityImmuneToFire(Entity aEntity, boolean aImmune) {
+ try {
+ return ReflectionUtils.setField(aEntity, isImmuneToFire, aImmune);
+ } catch (Throwable t) {
+ }
+ return false;
+ }
+
+ public FireProtectionBauble() {
+ super(BaubleType.RING, "GTPP.bauble.fireprotection.0" + ".name", 0);
+ String aUnlocalName = "GTPP.bauble.fireprotection.0" + ".name";
+ this.setUnlocalizedName(aUnlocalName);
+ this.setTextureName(CORE.MODID + ":" + getTextureNameForBauble());
+ this.setMaxDamage(100);
+ this.setMaxStackSize(1);
+ this.setNoRepair();
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ if (GameRegistry.findItem(CORE.MODID, aUnlocalName) == null) {
+ GameRegistry.registerItem(this, aUnlocalName);
+ }
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World worldObj,
+ final Entity player,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return (EnumChatFormatting.DARK_RED + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY);
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public void onEquipped(final ItemStack arg0, final EntityLivingBase aPlayer) {
+ if (!aPlayer.worldObj.isRemote) {
+ if (aPlayer instanceof EntityPlayer) {
+ EntityPlayer bPlayer = (EntityPlayer) aPlayer;
+ mPlayerMap.add(bPlayer.getUniqueID());
+ }
+ }
+ }
+
+ @Override
+ public void onUnequipped(final ItemStack arg0, final EntityLivingBase aPlayer) {
+ if (!aPlayer.worldObj.isRemote) {
+ if (aPlayer instanceof EntityPlayer) {
+ EntityPlayer bPlayer = (EntityPlayer) aPlayer;
+ if (bPlayer.isPotionActive(Potion.fireResistance)) {
+ bPlayer.removePotionEffect(Potion.fireResistance.id);
+ }
+ mPlayerMap.remove(bPlayer.getUniqueID());
+ setEntityImmuneToFire(bPlayer, false);
+ }
+ }
+ }
+
+ @Override
+ public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayer) {
+ if (!aPlayer.worldObj.isRemote) {
+ if (aPlayer instanceof EntityPlayer) {
+ EntityPlayer bPlayer = (EntityPlayer) aPlayer;
+ if (!fireImmune(bPlayer)) {
+ setEntityImmuneToFire(bPlayer, true);
+ }
+ if (!bPlayer.isPotionActive(Potion.fireResistance)) {
+ bPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 100, 4));
+ }
+ }
+ }
+ }
+ public String getTextureNameForBauble() {
+ return "baubles/itemFireProtectGlovesBetter";
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java
index 49ce7ad715..8e4769860c 100644
--- a/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java
+++ b/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java
@@ -1,9 +1,9 @@
package gtPlusPlus.core.item.bauble;
-import java.util.List;
-
+import baubles.api.BaubleType;
import com.google.common.collect.Multimap;
-
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,29 +11,25 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumChatFormatting;
-import baubles.api.BaubleType;
-import gtPlusPlus.core.lib.CORE;
+public class HealthBoostBauble extends BaseBauble {
-public class HealthBoostBauble extends BaseBauble{
+ public HealthBoostBauble() {
+ super(BaubleType.AMULET, "The Key to the City");
+ addDamageNegation(DamageSource.wither);
+ this.setTextureName(CORE.MODID + ":" + "itemKeyGold");
+ }
-
- public HealthBoostBauble() {
- super(BaubleType.AMULET, "The Key to the City");
- addDamageNegation(DamageSource.wither);
- this.setTextureName(CORE.MODID + ":" + "itemKeyGold");
- }
+ @Override
+ void fillModifiers(Multimap<String, AttributeModifier> attributes, ItemStack stack) {
+ attributes.put(
+ SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 40, 0));
+ }
- @Override
- void fillModifiers(Multimap<String, AttributeModifier> attributes, ItemStack stack) {
- attributes.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 40, 0));
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- list.add(EnumChatFormatting.GRAY+"You feel like you're on top of the world.");
- list.add(EnumChatFormatting.GRAY+"Wear it around your neck like an amulet.");
- super.addInformation(stack, player, list, bool);
- }
-
-
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ list.add(EnumChatFormatting.GRAY + "You feel like you're on top of the world.");
+ list.add(EnumChatFormatting.GRAY + "Wear it around your neck like an amulet.");
+ super.addInformation(stack, player, list, bool);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java
index a8d216e1bc..bbedb9feb4 100644
--- a/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java
+++ b/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java
@@ -1,14 +1,16 @@
package gtPlusPlus.core.item.bauble;
-import java.util.List;
-
-import org.lwjgl.input.Keyboard;
-
+import baubles.api.BaubleType;
import com.google.common.collect.Multimap;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.minecraft.ModularArmourUtils;
+import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
+import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers;
+import gtPlusPlus.core.util.minecraft.NBTUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
@@ -20,389 +22,397 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
-
-import baubles.api.BaubleType;
-import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import org.lwjgl.input.Keyboard;
public class ModularBauble extends BaseBauble {
- @SideOnly(Side.CLIENT)
- private IIcon mTextureAmulet;
- @SideOnly(Side.CLIENT)
- private IIcon mTextureRing;
- @SideOnly(Side.CLIENT)
- private IIcon mTextureBelt;
- private IIcon iconArray[] = new IIcon[3];
- @SideOnly(Side.CLIENT)
- private IIcon mfallback;
-
- public ModularBauble() {
- super(BaubleType.AMULET, "Modular Bauble");
- }
-
- @Override
- void fillModifiers(Multimap<String, AttributeModifier> attributes, ItemStack stack) {
-
- // Get Stats
- int mStatlevel = 0;
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DAMAGE)) > 0) {
- if (mStatlevel > 0 && mStatlevel < 20) {
- attributes.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 1, 0));
- } else if (mStatlevel > 20 && mStatlevel < 45) {
- attributes.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 2, 0));
- } else if (mStatlevel >= 45 && mStatlevel < 75) {
- attributes.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 4, 0));
- } else if (mStatlevel >= 75 && mStatlevel < 99) {
- attributes.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 8, 0));
- } else if (mStatlevel >= 100) {
- attributes.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 16, 0));
- }
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DEF)) > 0) {
- if (mStatlevel > 0 && mStatlevel < 20) {
- attributes.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 1, 0));
- } else if (mStatlevel > 20 && mStatlevel < 45) {
- attributes.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 2, 0));
- } else if (mStatlevel > 45 && mStatlevel < 75) {
- attributes.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 3, 0));
- } else if (mStatlevel > 75 && mStatlevel < 99) {
- attributes.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 6, 0));
- } else if (mStatlevel >= 100) {
- attributes.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 10, 0));
- }
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) {
- if (mStatlevel > 0 && mStatlevel <= 100) {
- int bonus = mStatlevel / 5;
- attributes.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "HP" + mStatlevel, bonus * 2, 0));
- }
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_SPEED)) > 0) {
- if (mStatlevel > 0 && mStatlevel < 20) {
- attributes.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 1, 0));
- } else if (mStatlevel > 20 && mStatlevel < 45) {
- attributes.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 2, 0));
- } else if (mStatlevel > 45 && mStatlevel < 75) {
- attributes.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 3, 0));
- } else if (mStatlevel > 75 && mStatlevel < 99) {
- attributes.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 4, 0));
- } else if (mStatlevel >= 100) {
- attributes.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 5, 0));
- }
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_MINING)) > 0) {
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HOLY)) > 0) {
- }
-
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- // Bauble Type
- if (ModularArmourUtils.getBaubleType(stack) == BaubleType.AMULET) {
- list.add(EnumChatFormatting.GRAY + "Current Form: " + EnumChatFormatting.RED + "Amulet"
- + EnumChatFormatting.GRAY + ".");
- list.add(EnumChatFormatting.GRAY + "You can change this into a Ring or a Belt.");
- } else if (ModularArmourUtils.getBaubleType(stack) == BaubleType.RING) {
- list.add(EnumChatFormatting.GRAY + "Current Form: " + EnumChatFormatting.RED + "Ring"
- + EnumChatFormatting.GRAY + ".");
- list.add(EnumChatFormatting.GRAY + "You can change this into an Amulet or a Belt.");
- } else if (ModularArmourUtils.getBaubleType(stack) == BaubleType.BELT) {
- list.add(EnumChatFormatting.GRAY + "Current Form: " + EnumChatFormatting.RED + "Belt"
- + EnumChatFormatting.GRAY + ".");
- list.add(EnumChatFormatting.GRAY + "You can change this into a Ring or an Amulet.");
- }
-
- // Get Stats
- int mStatlevel = 0;
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DAMAGE)) > 0) {
- list.add(EnumChatFormatting.GRAY + "Damage Boost: " + EnumChatFormatting.DARK_RED + mStatlevel
- + EnumChatFormatting.GRAY + "/100.");
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) {
- list.add(EnumChatFormatting.GRAY + "Health Boost: " + EnumChatFormatting.RED + mStatlevel
- + EnumChatFormatting.GRAY + "/100. Bonus " + (mStatlevel / 5) + " hearts.");
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_SPEED)) > 0) {
- list.add(EnumChatFormatting.GRAY + "Speed Boost: " + EnumChatFormatting.WHITE + mStatlevel
- + EnumChatFormatting.GRAY + "/100.");
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_MINING)) > 0) {
- list.add(EnumChatFormatting.GRAY + "Mining Boost: " + EnumChatFormatting.DARK_GRAY + mStatlevel
- + EnumChatFormatting.GRAY + "/100.");
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HOLY)) > 0) {
- list.add(EnumChatFormatting.GRAY + "Holy Boost: " + EnumChatFormatting.GOLD + mStatlevel
- + EnumChatFormatting.GRAY + "/100.");
- }
-
- // Defence Boost
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DEF)) > 0) {
- list.add(EnumChatFormatting.GRAY + "Defence Boost: " + EnumChatFormatting.BLUE + mStatlevel
- + EnumChatFormatting.GRAY + "/100.");
-
- if ((Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54))) {
-
- if (mStatlevel >= 1) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Cactus"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 10) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Falling Blocks"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 20) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Wall Suffocation"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 35) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Drowning"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 50) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Starvation"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 60) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Falling"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 75) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Lava"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 80) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Magic"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 95) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Wither"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 100) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Fire"
- + EnumChatFormatting.GRAY + ".");
- }
- if (mStatlevel >= 100) {
- list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Void"
- + EnumChatFormatting.GRAY + ".");
- }
-
- }
- else {
- list.add(EnumChatFormatting.GRAY + "<Press Shift to view protections>");
- }
- }
-
- if (NBTUtils.getBotanicaSoulboundOwner(stack) != null) {
- if (!NBTUtils.getBotanicaSoulboundOwner(stack).equals("")) {
- list.add(EnumChatFormatting.GRAY + "Owner: " + EnumChatFormatting.GREEN
- + NBTUtils.getBotanicaSoulboundOwner(stack) + EnumChatFormatting.GRAY + ".");
- }
- }
- super.addInformation(stack, player, list, bool);
- }
-
- @Override
- public boolean addDamageNegation(DamageSource damageSource, ItemStack aStack) {
-
- this.clearDamageNegation();
- int mStatlevel = 0;
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(aStack, Modifiers.BOOST_HOLY)) > 0) {
- if (mStatlevel >= 1) {
- addDamageNegation(DamageSource.cactus);
- }
- if (mStatlevel >= 10) {
- addDamageNegation(DamageSource.fallingBlock);
- }
- if (mStatlevel >= 20) {
- addDamageNegation(DamageSource.inWall);
- }
- if (mStatlevel >= 35) {
- addDamageNegation(DamageSource.drown);
- }
- if (mStatlevel >= 50) {
- addDamageNegation(DamageSource.starve);
- }
- if (mStatlevel >= 60) {
- addDamageNegation(DamageSource.fall);
- }
- if (mStatlevel >= 75) {
- addDamageNegation(DamageSource.lava);
- }
- if (mStatlevel >= 80) {
- addDamageNegation(DamageSource.magic);
- }
- if (mStatlevel >= 95) {
- addDamageNegation(DamageSource.wither);
- }
- if (mStatlevel >= 100) {
- addDamageNegation(DamageSource.inFire);
- }
- if (mStatlevel >= 100) {
- addDamageNegation(DamageSource.onFire);
- }
- if (mStatlevel >= 100) {
- addDamageNegation(DamageSource.outOfWorld);
- }
- }
- return super.addDamageNegation(damageSource, null);
- }
-
- @Override
- public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
- if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_AMULET.getID()) {
- this.SetBaubleType(BT.TYPE_AMULET);
- } else if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_RING.getID()) {
- this.SetBaubleType(BT.TYPE_RING);
- } else if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_BELT.getID()) {
- this.SetBaubleType(BT.TYPE_BELT);
- } else {
- this.SetBaubleType(BT.TYPE_RING);
- }
- if (PlayerUtils.isPlayerOP((EntityPlayer) arg1)) {
- return true; // Let OPs wear other peoples shit.
- }
-
- String mOwner;
- if (NBTUtils.getBotanicaSoulboundOwner(arg0) == null || NBTUtils.getBotanicaSoulboundOwner(arg0).equals("")) {
- return true;
- } else if ((mOwner = NBTUtils.getBotanicaSoulboundOwner(arg0)) != null) {
- String mPlayerName = arg1.getCommandSenderName();
- if (mOwner.toLowerCase().equals(mPlayerName.toLowerCase())) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public BaubleType getBaubleType(ItemStack arg0) {
- return ModularArmourUtils.getBaubleType(arg0);
- }
-
- @Override
- public void onEquipped(ItemStack stack, EntityLivingBase entity) {
- if (entity instanceof EntityPlayer) {
- if (NBTUtils.getBotanicaSoulboundOwner(stack) == null
- || NBTUtils.getBotanicaSoulboundOwner(stack).equals("")) {
- NBTUtils.setBotanicaSoulboundOwner(stack, entity.getCommandSenderName());
- }
- }
- super.onEquipped(stack, entity);
- }
-
- /*@Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- if (usingItem == null) {
- return mfallback;
- }
- try {
- if (stack.getItemDamage() == 0) {
- return mfallback = mTextureAmulet;
- }
- else if (stack.getItemDamage() == 1) {
- return mfallback = mTextureRing;
- }
- else if (stack.getItemDamage() == 2) {
- return mfallback = mTextureBelt;
- } else {
- return mfallback = mTextureRing;
- }
- } catch (Throwable t) {
- return mfallback = mTextureRing;
- }
- }*/
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamage(int meta) {
- if (meta < this.iconArray.length && this.iconArray[meta] != null){
- return this.iconArray[meta];
- }
- return this.mfallback;
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 3; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister register) {
- this.mfallback = register.registerIcon("miscutils" + ":" + "itemAmulet");
- // you cannot initialize iconArray when declared nor in the constructor,
- // as it is client-side only, so do it here:
- if (LoadedMods.Thaumcraft) {
- iconArray[0] = register.registerIcon("thaumcraft" + ":" + "bauble_amulet");
- iconArray[1] = register.registerIcon("thaumcraft" + ":" + "bauble_ring");
- iconArray[2] = register.registerIcon("thaumcraft" + ":" + "bauble_belt");
- } else {
- iconArray[0] = register.registerIcon("miscutils" + ":" + "itemAmulet");
- iconArray[1] = register.registerIcon("miscutils" + ":" + "itemRingWearable");
- iconArray[2] = register.registerIcon("miscutils" + ":" + "itemBelt");
- }
-
- mTextureAmulet = iconArray[0];
- mTextureRing = iconArray[1];
- mTextureBelt = iconArray[2];
-
- }
-
- @Override
- public void onWornTick(ItemStack stack, EntityLivingBase player) {
- super.onWornTick(stack, player);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public Item setFull3D() {
- // TODO Auto-generated method stub
- return super.setFull3D();
- }
-
- @Override
- public boolean isFull3D() {
- return true;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
+ @SideOnly(Side.CLIENT)
+ private IIcon mTextureAmulet;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon mTextureRing;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon mTextureBelt;
+
+ private IIcon iconArray[] = new IIcon[3];
+
+ @SideOnly(Side.CLIENT)
+ private IIcon mfallback;
+
+ public ModularBauble() {
+ super(BaubleType.AMULET, "Modular Bauble");
+ }
+
+ @Override
+ void fillModifiers(Multimap<String, AttributeModifier> attributes, ItemStack stack) {
+
+ // Get Stats
+ int mStatlevel = 0;
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DAMAGE)) > 0) {
+ if (mStatlevel > 0 && mStatlevel < 20) {
+ attributes.put(
+ SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 1, 0));
+ } else if (mStatlevel > 20 && mStatlevel < 45) {
+ attributes.put(
+ SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 2, 0));
+ } else if (mStatlevel >= 45 && mStatlevel < 75) {
+ attributes.put(
+ SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 4, 0));
+ } else if (mStatlevel >= 75 && mStatlevel < 99) {
+ attributes.put(
+ SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 8, 0));
+ } else if (mStatlevel >= 100) {
+ attributes.put(
+ SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 16, 0));
+ }
+ }
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DEF)) > 0) {
+ if (mStatlevel > 0 && mStatlevel < 20) {
+ attributes.put(
+ SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 1, 0));
+ } else if (mStatlevel > 20 && mStatlevel < 45) {
+ attributes.put(
+ SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 2, 0));
+ } else if (mStatlevel > 45 && mStatlevel < 75) {
+ attributes.put(
+ SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 3, 0));
+ } else if (mStatlevel > 75 && mStatlevel < 99) {
+ attributes.put(
+ SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 6, 0));
+ } else if (mStatlevel >= 100) {
+ attributes.put(
+ SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 10, 0));
+ }
+ }
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) {
+ if (mStatlevel > 0 && mStatlevel <= 100) {
+ int bonus = mStatlevel / 5;
+ attributes.put(
+ SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "HP" + mStatlevel, bonus * 2, 0));
+ }
+ }
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_SPEED)) > 0) {
+ if (mStatlevel > 0 && mStatlevel < 20) {
+ attributes.put(
+ SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 1, 0));
+ } else if (mStatlevel > 20 && mStatlevel < 45) {
+ attributes.put(
+ SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 2, 0));
+ } else if (mStatlevel > 45 && mStatlevel < 75) {
+ attributes.put(
+ SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 3, 0));
+ } else if (mStatlevel > 75 && mStatlevel < 99) {
+ attributes.put(
+ SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 4, 0));
+ } else if (mStatlevel >= 100) {
+ attributes.put(
+ SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
+ new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 5, 0));
+ }
+ }
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_MINING)) > 0) {}
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HOLY)) > 0) {}
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ // Bauble Type
+ if (ModularArmourUtils.getBaubleType(stack) == BaubleType.AMULET) {
+ list.add(EnumChatFormatting.GRAY + "Current Form: " + EnumChatFormatting.RED + "Amulet"
+ + EnumChatFormatting.GRAY + ".");
+ list.add(EnumChatFormatting.GRAY + "You can change this into a Ring or a Belt.");
+ } else if (ModularArmourUtils.getBaubleType(stack) == BaubleType.RING) {
+ list.add(EnumChatFormatting.GRAY + "Current Form: " + EnumChatFormatting.RED + "Ring"
+ + EnumChatFormatting.GRAY + ".");
+ list.add(EnumChatFormatting.GRAY + "You can change this into an Amulet or a Belt.");
+ } else if (ModularArmourUtils.getBaubleType(stack) == BaubleType.BELT) {
+ list.add(EnumChatFormatting.GRAY + "Current Form: " + EnumChatFormatting.RED + "Belt"
+ + EnumChatFormatting.GRAY + ".");
+ list.add(EnumChatFormatting.GRAY + "You can change this into a Ring or an Amulet.");
+ }
+
+ // Get Stats
+ int mStatlevel = 0;
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DAMAGE)) > 0) {
+ list.add(EnumChatFormatting.GRAY + "Damage Boost: " + EnumChatFormatting.DARK_RED + mStatlevel
+ + EnumChatFormatting.GRAY + "/100.");
+ }
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) {
+ list.add(EnumChatFormatting.GRAY + "Health Boost: " + EnumChatFormatting.RED + mStatlevel
+ + EnumChatFormatting.GRAY + "/100. Bonus " + (mStatlevel / 5) + " hearts.");
+ }
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_SPEED)) > 0) {
+ list.add(EnumChatFormatting.GRAY + "Speed Boost: " + EnumChatFormatting.WHITE + mStatlevel
+ + EnumChatFormatting.GRAY + "/100.");
+ }
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_MINING)) > 0) {
+ list.add(EnumChatFormatting.GRAY + "Mining Boost: " + EnumChatFormatting.DARK_GRAY + mStatlevel
+ + EnumChatFormatting.GRAY + "/100.");
+ }
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HOLY)) > 0) {
+ list.add(EnumChatFormatting.GRAY + "Holy Boost: " + EnumChatFormatting.GOLD + mStatlevel
+ + EnumChatFormatting.GRAY + "/100.");
+ }
+
+ // Defence Boost
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DEF)) > 0) {
+ list.add(EnumChatFormatting.GRAY + "Defence Boost: " + EnumChatFormatting.BLUE + mStatlevel
+ + EnumChatFormatting.GRAY + "/100.");
+
+ if ((Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54))) {
+
+ if (mStatlevel >= 1) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Cactus"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 10) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Falling Blocks"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 20) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Wall Suffocation"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 35) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Drowning"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 50) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Starvation"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 60) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Falling"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 75) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Lava"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 80) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Magic"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 95) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Wither"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 100) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Fire"
+ + EnumChatFormatting.GRAY + ".");
+ }
+ if (mStatlevel >= 100) {
+ list.add(EnumChatFormatting.GRAY + "Protected From: " + EnumChatFormatting.BLUE + "Void"
+ + EnumChatFormatting.GRAY + ".");
+ }
+
+ } else {
+ list.add(EnumChatFormatting.GRAY + "<Press Shift to view protections>");
+ }
+ }
+
+ if (NBTUtils.getBotanicaSoulboundOwner(stack) != null) {
+ if (!NBTUtils.getBotanicaSoulboundOwner(stack).equals("")) {
+ list.add(EnumChatFormatting.GRAY + "Owner: " + EnumChatFormatting.GREEN
+ + NBTUtils.getBotanicaSoulboundOwner(stack) + EnumChatFormatting.GRAY + ".");
+ }
+ }
+ super.addInformation(stack, player, list, bool);
+ }
+
+ @Override
+ public boolean addDamageNegation(DamageSource damageSource, ItemStack aStack) {
+
+ this.clearDamageNegation();
+ int mStatlevel = 0;
+ if ((mStatlevel = ModularArmourUtils.getModifierLevel(aStack, Modifiers.BOOST_HOLY)) > 0) {
+ if (mStatlevel >= 1) {
+ addDamageNegation(DamageSource.cactus);
+ }
+ if (mStatlevel >= 10) {
+ addDamageNegation(DamageSource.fallingBlock);
+ }
+ if (mStatlevel >= 20) {
+ addDamageNegation(DamageSource.inWall);
+ }
+ if (mStatlevel >= 35) {
+ addDamageNegation(DamageSource.drown);
+ }
+ if (mStatlevel >= 50) {
+ addDamageNegation(DamageSource.starve);
+ }
+ if (mStatlevel >= 60) {
+ addDamageNegation(DamageSource.fall);
+ }
+ if (mStatlevel >= 75) {
+ addDamageNegation(DamageSource.lava);
+ }
+ if (mStatlevel >= 80) {
+ addDamageNegation(DamageSource.magic);
+ }
+ if (mStatlevel >= 95) {
+ addDamageNegation(DamageSource.wither);
+ }
+ if (mStatlevel >= 100) {
+ addDamageNegation(DamageSource.inFire);
+ }
+ if (mStatlevel >= 100) {
+ addDamageNegation(DamageSource.onFire);
+ }
+ if (mStatlevel >= 100) {
+ addDamageNegation(DamageSource.outOfWorld);
+ }
+ }
+ return super.addDamageNegation(damageSource, null);
+ }
+
+ @Override
+ public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
+ if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_AMULET.getID()) {
+ this.SetBaubleType(BT.TYPE_AMULET);
+ } else if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_RING.getID()) {
+ this.SetBaubleType(BT.TYPE_RING);
+ } else if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_BELT.getID()) {
+ this.SetBaubleType(BT.TYPE_BELT);
+ } else {
+ this.SetBaubleType(BT.TYPE_RING);
+ }
+ if (PlayerUtils.isPlayerOP((EntityPlayer) arg1)) {
+ return true; // Let OPs wear other peoples shit.
+ }
+
+ String mOwner;
+ if (NBTUtils.getBotanicaSoulboundOwner(arg0) == null
+ || NBTUtils.getBotanicaSoulboundOwner(arg0).equals("")) {
+ return true;
+ } else if ((mOwner = NBTUtils.getBotanicaSoulboundOwner(arg0)) != null) {
+ String mPlayerName = arg1.getCommandSenderName();
+ if (mOwner.toLowerCase().equals(mPlayerName.toLowerCase())) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public BaubleType getBaubleType(ItemStack arg0) {
+ return ModularArmourUtils.getBaubleType(arg0);
+ }
+
+ @Override
+ public void onEquipped(ItemStack stack, EntityLivingBase entity) {
+ if (entity instanceof EntityPlayer) {
+ if (NBTUtils.getBotanicaSoulboundOwner(stack) == null
+ || NBTUtils.getBotanicaSoulboundOwner(stack).equals("")) {
+ NBTUtils.setBotanicaSoulboundOwner(stack, entity.getCommandSenderName());
+ }
+ }
+ super.onEquipped(stack, entity);
+ }
+
+ /*@Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ if (usingItem == null) {
+ return mfallback;
+ }
+ try {
+ if (stack.getItemDamage() == 0) {
+ return mfallback = mTextureAmulet;
+ }
+ else if (stack.getItemDamage() == 1) {
+ return mfallback = mTextureRing;
+ }
+ else if (stack.getItemDamage() == 2) {
+ return mfallback = mTextureBelt;
+ } else {
+ return mfallback = mTextureRing;
+ }
+ } catch (Throwable t) {
+ return mfallback = mTextureRing;
+ }
+ }*/
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int meta) {
+ if (meta < this.iconArray.length && this.iconArray[meta] != null) {
+ return this.iconArray[meta];
+ }
+ return this.mfallback;
+ }
+
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 3; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister register) {
+ this.mfallback = register.registerIcon("miscutils" + ":" + "itemAmulet");
+ // you cannot initialize iconArray when declared nor in the constructor,
+ // as it is client-side only, so do it here:
+ if (LoadedMods.Thaumcraft) {
+ iconArray[0] = register.registerIcon("thaumcraft" + ":" + "bauble_amulet");
+ iconArray[1] = register.registerIcon("thaumcraft" + ":" + "bauble_ring");
+ iconArray[2] = register.registerIcon("thaumcraft" + ":" + "bauble_belt");
+ } else {
+ iconArray[0] = register.registerIcon("miscutils" + ":" + "itemAmulet");
+ iconArray[1] = register.registerIcon("miscutils" + ":" + "itemRingWearable");
+ iconArray[2] = register.registerIcon("miscutils" + ":" + "itemBelt");
+ }
+
+ mTextureAmulet = iconArray[0];
+ mTextureRing = iconArray[1];
+ mTextureBelt = iconArray[2];
+ }
+
+ @Override
+ public void onWornTick(ItemStack stack, EntityLivingBase player) {
+ super.onWornTick(stack, player);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public Item setFull3D() {
+ // TODO Auto-generated method stub
+ return super.setFull3D();
+ }
+
+ @Override
+ public boolean isFull3D() {
+ return true;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java
index aab302688b..5164ab5c19 100644
--- a/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java
+++ b/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java
@@ -1,18 +1,16 @@
package gtPlusPlus.core.item.bauble;
-import java.util.List;
-
import baubles.api.BaubleType;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.GT_Values;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.AABB;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import ic2.api.item.ElectricItem;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
@@ -26,150 +24,152 @@ import net.minecraft.world.World;
public class MonsterKillerBaseBauble extends ElectricBaseBauble {
- private final Class[] mTargets;
-
- public MonsterKillerBaseBauble(Class[] aMonsterBaseClassArray, String aMonsterTypeName, int aPowerTier) {
- super(BaubleType.AMULET, aPowerTier, GT_Values.V[aPowerTier] * 20 * 300,
- "GTPP.MonsterKiller." + aMonsterTypeName + ".name");
- mTargets = aMonsterBaseClassArray;
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
- ItemStack itemStack = new ItemStack(this, 1);
- ItemStack charged;
- if (this.getEmptyItem(itemStack) == this) {
- charged = new ItemStack(this, 1);
- ElectricItem.manager.charge(charged, 0.0D, Integer.MAX_VALUE, true, false);
- itemList.add(charged);
- }
- if (this.getChargedItem(itemStack) == this) {
- charged = new ItemStack(this, 1);
- ElectricItem.manager.charge(charged, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, false);
- itemList.add(charged);
- }
-
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
- final boolean p_77663_5_) {
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
- double aItemCharge = ElectricItem.manager.getCharge(itemStack);
- return aItemCharge > 0;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return (EnumChatFormatting.WHITE + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY);
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("");
- String aString1 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.1");
- String aString2 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.2");
- String aString3 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.3");
- String aString4 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.4");
- String aEU = StatCollector.translateToLocal("GTPP.info.eu");
- String aEUT = aEU + "/t";
-
- list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN + aString2 + " " + (int) getTransferLimit(stack) + aEUT + " " + aString3
- + EnumChatFormatting.GRAY);
- list.add("");
- list.add("" + EnumChatFormatting.GREEN + aString4 + " " + EnumChatFormatting.GRAY);
- for (Class cz : mTargets) {
- list.add("- " + EnumChatFormatting.DARK_GREEN + cz.getSimpleName().replace("Entity", "") + EnumChatFormatting.GRAY);
- }
-
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
- }
-
- @Override
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
- }
-
- @Override // TODO
- public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayerEntity) {
- if (aPlayerEntity == null) {
- return;
- }
- EntityPlayer aPlayer = (EntityPlayer) aPlayerEntity;
- if (!aPlayer.worldObj.isRemote) {
- if (this.getCharge(aBaubleStack) >= getTransferLimit(aBaubleStack)) {
- AABB aPlayerBox = new AABB(aPlayerEntity, 5, 5, 5);
- if (this.mTargets != null && this.mTargets.length > 0) {
- for (Class clazz : mTargets) {
- AutoMap<?> aEnts = EntityUtils.getEntitiesWithinBoundingBox(clazz, aPlayerBox);
- if (aEnts.isEmpty()) {
- continue;
- } else {
- EntityLiving aClosest = null;
- double aEntityDistance = Short.MIN_VALUE;
- for (Object ent : aEnts) {
- if (!EntityLiving.class.isInstance(ent)) {
- continue;
- } else {
- double aCurEntDis = EntityUtils.getDistance(aPlayerEntity, (Entity) ent);
- if (aEntityDistance == Short.MIN_VALUE || aCurEntDis < aEntityDistance) {
- aEntityDistance = aCurEntDis;
- aClosest = (EntityLiving) ent;
- }
- }
- }
- if (aClosest != null) {
- float aEntHealth = aClosest.getHealth();
- float aEntMaxHealth = aClosest.getMaxHealth();
- double aEntHealthPerc = MathUtils.findPercentage(aEntHealth, aEntMaxHealth);
- long aEuUsage = (long) (aEntHealthPerc * 50 * aEntMaxHealth);
- if (this.discharge(aBaubleStack, aEuUsage, mTier, true, false, false) > 0) {
- aClosest.setDead();
- PlayerUtils.messagePlayer(aPlayer, "Removed 1x "+aClosest.getCommandSenderName());
- break;
- }
- } else {
- continue;
- }
- }
- }
- }
- } else {
- return;
- }
- }
- }
-
- @Override
- public String getTextureNameForBauble() {
- return "baubles/itemAmulet";
- }
-
+ private final Class[] mTargets;
+
+ public MonsterKillerBaseBauble(Class[] aMonsterBaseClassArray, String aMonsterTypeName, int aPowerTier) {
+ super(
+ BaubleType.AMULET,
+ aPowerTier,
+ GT_Values.V[aPowerTier] * 20 * 300,
+ "GTPP.MonsterKiller." + aMonsterTypeName + ".name");
+ mTargets = aMonsterBaseClassArray;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
+ ItemStack itemStack = new ItemStack(this, 1);
+ ItemStack charged;
+ if (this.getEmptyItem(itemStack) == this) {
+ charged = new ItemStack(this, 1);
+ ElectricItem.manager.charge(charged, 0.0D, Integer.MAX_VALUE, true, false);
+ itemList.add(charged);
+ }
+ if (this.getChargedItem(itemStack) == this) {
+ charged = new ItemStack(this, 1);
+ ElectricItem.manager.charge(charged, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, false);
+ itemList.add(charged);
+ }
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World worldObj,
+ final Entity player,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean canProvideEnergy(final ItemStack itemStack) {
+ double aItemCharge = ElectricItem.manager.getCharge(itemStack);
+ return aItemCharge > 0;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return (EnumChatFormatting.WHITE + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY);
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add("");
+ String aString1 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.1");
+ String aString2 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.2");
+ String aString3 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.3");
+ String aString4 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.4");
+ String aEU = StatCollector.translateToLocal("GTPP.info.eu");
+ String aEUT = aEU + "/t";
+
+ list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN + aString2 + " " + (int) getTransferLimit(stack) + aEUT + " " + aString3
+ + EnumChatFormatting.GRAY);
+ list.add("");
+ list.add("" + EnumChatFormatting.GREEN + aString4 + " " + EnumChatFormatting.GRAY);
+ for (Class cz : mTargets) {
+ list.add("- " + EnumChatFormatting.DARK_GREEN + cz.getSimpleName().replace("Entity", "")
+ + EnumChatFormatting.GRAY);
+ }
+
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {}
+
+ @Override
+ public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {}
+
+ @Override // TODO
+ public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayerEntity) {
+ if (aPlayerEntity == null) {
+ return;
+ }
+ EntityPlayer aPlayer = (EntityPlayer) aPlayerEntity;
+ if (!aPlayer.worldObj.isRemote) {
+ if (this.getCharge(aBaubleStack) >= getTransferLimit(aBaubleStack)) {
+ AABB aPlayerBox = new AABB(aPlayerEntity, 5, 5, 5);
+ if (this.mTargets != null && this.mTargets.length > 0) {
+ for (Class clazz : mTargets) {
+ AutoMap<?> aEnts = EntityUtils.getEntitiesWithinBoundingBox(clazz, aPlayerBox);
+ if (aEnts.isEmpty()) {
+ continue;
+ } else {
+ EntityLiving aClosest = null;
+ double aEntityDistance = Short.MIN_VALUE;
+ for (Object ent : aEnts) {
+ if (!EntityLiving.class.isInstance(ent)) {
+ continue;
+ } else {
+ double aCurEntDis = EntityUtils.getDistance(aPlayerEntity, (Entity) ent);
+ if (aEntityDistance == Short.MIN_VALUE || aCurEntDis < aEntityDistance) {
+ aEntityDistance = aCurEntDis;
+ aClosest = (EntityLiving) ent;
+ }
+ }
+ }
+ if (aClosest != null) {
+ float aEntHealth = aClosest.getHealth();
+ float aEntMaxHealth = aClosest.getMaxHealth();
+ double aEntHealthPerc = MathUtils.findPercentage(aEntHealth, aEntMaxHealth);
+ long aEuUsage = (long) (aEntHealthPerc * 50 * aEntMaxHealth);
+ if (this.discharge(aBaubleStack, aEuUsage, mTier, true, false, false) > 0) {
+ aClosest.setDead();
+ PlayerUtils.messagePlayer(aPlayer, "Removed 1x " + aClosest.getCommandSenderName());
+ break;
+ }
+ } else {
+ continue;
+ }
+ }
+ }
+ }
+ } else {
+ return;
+ }
+ }
+ }
+
+ @Override
+ public String getTextureNameForBauble() {
+ return "baubles/itemAmulet";
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
index 8e7a760195..84e02d452f 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.item.chemistry;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gtPlusPlus.api.helpers.MaterialHelper;
@@ -23,6 +19,9 @@ import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase;
import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase;
import gtPlusPlus.plugin.agrichem.item.algae.ItemBioChip;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -32,583 +31,614 @@ import net.minecraftforge.oredict.OreDictionary;
public class AgriculturalChem extends ItemPackage {
- private static boolean aBOP;
- private static boolean aTiCon;
-
- private static AutoMap<FluidStack> mBloodFluids = new AutoMap<FluidStack>();
-
- /**
- * Fluids
- */
-
- // Poop Juice
- public static Fluid PoopJuice;
- // Manure Slurry
- public static Fluid ManureSlurry;
- // Fertile Manure Slurry
- public static Fluid FertileManureSlurry;
- // Blood
- public static Fluid CustomBlood;
- // Red Mud
- public static Fluid RedMud;
- /**
- * Items
- */
-
- // Manure Byproducts
- public static Item dustManureByproducts;
- // Organic Fertilizer
- public static Item dustOrganicFertilizer;
- // Dirt
- public static Item dustDirt;
-
- // Poop Juice
- // vv - Centrifuge
- // Manure Slurry && Manure Byproducts -> (Elements) Centrifuge to several tiny
- // piles
- // vv - Chem Reactor - Add Peat, Meat
- // Organic Fertilizer
- // vv - Dehydrate
- // Fertilizer
-
- // Poop Juice
- // vv - Mixer - Add Blood, Bone, Meat (1000L Poo, 200L Blood, x2 Bone, x3 Meat)
- // Fertile Manure Slurry
- // vv - Chem Reactor - Add Peat x1.5
- // Organic Fertilizer x3
- // vv - Dehydrate
- // Fertilizer
-
-
-
- public static Item mAlgae;
- public static Item mBioCircuit;
- public static Item mAgrichemItem1;
-
- /*
- * 0 - Algae Biomass
- * 1 - Green Algae Biomass
- * 2 - Brown Algae Biomass
- * 3 - Golden-Brown Algae Biomass
- * 4 - Red Algae Biomass
- * 5 - Cellulose Fiber
- * 6 - Golden-Brown Cellulose Fiber
- * 7 - Red Cellulose Fiber
- * 8 - Compost
- * 9 - Wood Pellet
- * 10 - Wood Brick
- * 11 - Cellulose Pulp
- * 12 - Raw Bio Resin
- * 13 - Catalyst Carrier
- * 14 - Green Metal Catalyst
- * 15 - Alginic Acid
- * 16 - Alumina
- * 17 - Aluminium Pellet
- * 18 - Sodium Aluminate
- * 19 - Sodium Hydroxide // Exists in Newer GT
- * 20 - Sodium Carbonate
- * 21 - Lithium Chloride
- * 22 - Pellet Mold
- * 23 - Clean Aluminium Mix
- * 24 - Pinecone
- */
-
- public static ItemStack mAlgaeBiosmass;
- public static ItemStack mGreenAlgaeBiosmass;
- public static ItemStack mBrownAlgaeBiosmass;
- public static ItemStack mGoldenBrownAlgaeBiosmass;
- public static ItemStack mRedAlgaeBiosmass;
- public static ItemStack mCelluloseFiber;
- public static ItemStack mGoldenBrownCelluloseFiber;
- public static ItemStack mRedCelluloseFiber;
- public static ItemStack mCompost;
- public static ItemStack mWoodPellet;
- public static ItemStack mWoodBrick;
- public static ItemStack mCellulosePulp;
- public static ItemStack mRawBioResin;
- public static ItemStack mCatalystCarrier;
- public static ItemStack mGreenCatalyst;
- public static ItemStack mAlginicAcid;
- public static ItemStack mAlumina;
- public static ItemStack mAluminiumPellet;
- public static ItemStack mSodiumAluminate;
- public static ItemStack mSodiumHydroxide;
- public static ItemStack mSodiumCarbonate;
- public static ItemStack mLithiumChloride;
- public static ItemStack mPelletMold;
- public static ItemStack mCleanAluminiumMix;
- public static ItemStack mPinecone;
- public static ItemStack mCrushedPine;
-
-
- @Override
- public void items() {
- // Nitrogen, Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon
- dustManureByproducts = ItemUtils.generateSpecialUseDusts("ManureByproducts", "Manure Byproduct",
- "(N2H4O3)N2P2Ca3CuC8", Utils.rgbtoHexValue(110, 75, 25))[0];
-
- // Basically Guano
- dustOrganicFertilizer = ItemUtils.generateSpecialUseDusts("OrganicFertilizer", "Organic Fertilizer",
- "Ca5(PO4)3(OH)", Utils.rgbtoHexValue(240, 240, 240))[0];
-
- // Dirt Dust :)
- dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0];
-
- mAlgae = new ItemAlgaeBase();
- mAgrichemItem1 = new ItemAgrichemBase();
- mBioCircuit = new ItemBioChip();
- GregtechItemList.Circuit_BioRecipeSelector.set(mBioCircuit);
-
-
-
- mAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 0, 1);
- mGreenAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 1, 1);
- mBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 2, 1);
- mGoldenBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 3, 1);
- mRedAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 4, 1);
- mCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 5, 1);
- mGoldenBrownCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 6, 1);
- mRedCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 7, 1);
- mCompost = ItemUtils.simpleMetaStack(mAgrichemItem1, 8, 1);
- mWoodPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 9, 1);
- mWoodBrick = ItemUtils.simpleMetaStack(mAgrichemItem1, 10, 1);
- mCellulosePulp = ItemUtils.simpleMetaStack(mAgrichemItem1, 11, 1);
- mRawBioResin = ItemUtils.simpleMetaStack(mAgrichemItem1, 12, 1);
- mCatalystCarrier = ItemUtils.simpleMetaStack(mAgrichemItem1, 13, 1);
- mGreenCatalyst = ItemUtils.simpleMetaStack(mAgrichemItem1, 14, 1);
- mAlginicAcid = ItemUtils.simpleMetaStack(mAgrichemItem1, 15, 1);
- mAlumina = ItemUtils.simpleMetaStack(mAgrichemItem1, 16, 1);
- mAluminiumPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 17, 1);
- mSodiumAluminate = ItemUtils.simpleMetaStack(mAgrichemItem1, 18, 1);
-
- /**
- * If It exists, don't add a new one.
- */
- if (OreDictionary.doesOreNameExist("dustSodiumHydroxide_GT5U") || OreDictionary.doesOreNameExist("dustSodiumHydroxide")) {
- List<ItemStack> aTest = OreDictionary.getOres("dustSodiumHydroxide", false);
- ItemStack aTestStack;
- if (aTest.isEmpty()) {
- aTest = OreDictionary.getOres("dustSodiumHydroxide_GT5U", false);
- if (aTest.isEmpty()) {
- aTestStack = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
- }
- else {
- aTestStack = aTest.get(0);
- }
- }
- else {
- aTestStack = aTest.get(0);
- }
- mSodiumHydroxide = aTestStack;
- }
- else {
- mSodiumHydroxide = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
- }
- mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1);
- mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1);
- mPelletMold = ItemUtils.simpleMetaStack(mAgrichemItem1, 22, 1);
- mCleanAluminiumMix = ItemUtils.simpleMetaStack(mAgrichemItem1, 23, 1);
- mPinecone = ItemUtils.simpleMetaStack(mAgrichemItem1, 24, 1);
- mCrushedPine = ItemUtils.simpleMetaStack(mAgrichemItem1, 25, 1);
-
- ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae");
- ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae");
- ItemUtils.addItemToOreDictionary(mGoldenBrownAlgaeBiosmass, "biomassGoldenBrownAlgae");
- ItemUtils.addItemToOreDictionary(mRedAlgaeBiosmass, "biomassRedAlgae");
-
- ItemUtils.addItemToOreDictionary(mCelluloseFiber, "fiberCellulose");
- ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberCellulose");
- ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberGoldenBrownCellulose");
- ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberCellulose");
- ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberRedCellulose");
-
- ItemUtils.addItemToOreDictionary(mWoodPellet, "pelletWood");
- ItemUtils.addItemToOreDictionary(mWoodBrick, "brickWood");
- ItemUtils.addItemToOreDictionary(mCellulosePulp, "pulpCellulose");
-
- ItemUtils.addItemToOreDictionary(mCatalystCarrier, "catalystEmpty");
- ItemUtils.addItemToOreDictionary(mGreenCatalyst, "catalystAluminiumSilver");
- ItemUtils.addItemToOreDictionary(mAlginicAcid, "dustAlginicAcid");
- ItemUtils.addItemToOreDictionary(mAlumina, "dustAlumina");
- ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium");
-
- ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate");
- ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide");
- ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate");
- ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride");
- ItemUtils.addItemToOreDictionary(mPinecone, "pinecone");
- ItemUtils.addItemToOreDictionary(mCrushedPine, "crushedPineMaterial");
-
- //Handle GT NaOH dusts
- List<ItemStack> NaOHSmall = OreDictionary.getOres("dustSmallSodiumHydroxide_GT5U", false);
- if (!NaOHSmall.isEmpty()) {
- ItemUtils.addItemToOreDictionary(NaOHSmall.get(0), "dustSmallSodiumHydroxide");
- }
- List<ItemStack> NaOHTiny = OreDictionary.getOres("dustTinySodiumHydroxide_GT5U", false);
- if (!NaOHTiny.isEmpty()) {
- ItemUtils.addItemToOreDictionary(NaOHTiny.get(0), "dustTinySodiumHydroxide");
- }
-
-
- }
-
- @Override
- public void blocks() {
- // None yet
- }
-
- @Override
- public void fluids() {
- // Sewage
- PoopJuice = FluidUtils.generateFluidNonMolten("raw.waste", "Raw Animal Waste", 32 + 175,
- new short[] { 100, 70, 30, 100 }, null, null, 0, true);
-
- // Sewage
- ManureSlurry = FluidUtils.generateFluidNonMolten("manure.slurry", "Manure Slurry", 39 + 175,
- new short[] { 75, 45, 15, 100 }, null, null, 0, true);
-
- // Sewage
- FertileManureSlurry = FluidUtils.generateFluidNonMolten("fertile.manure.slurry", "Fertile Manure Slurry",
- 45 + 175, new short[] { 65, 50, 15, 100 }, null, null, 0, true);
-
- RedMud = FluidUtils.generateFluidNoPrefix("mud.red.slurry", "Red Mud Slurry", 32 + 175, new short[] { 180, 35, 25, 100 }, true);
-
- }
-
-
-
- public AgriculturalChem() {
- super();
-
- aBOP = LoadedMods.BiomesOPlenty;
- aTiCon = LoadedMods.TiCon;
-
- Logger.INFO("Adding Agrochemical content");
-
- FluidStack aBlood;
- if (aBOP) {
- aBlood = FluidUtils.getFluidStack("hell_blood", 100);
- if (aBlood != null) {
- Logger.INFO("Found Biome's o Plenty, enabled Blood support.");
- CustomBlood = aBlood.getFluid();
- mBloodFluids.put(aBlood);
- }
- }
-
- if (aTiCon) {
- aBlood = FluidUtils.getFluidStack("blood", 100);
- if (aBlood != null) {
- Logger.INFO("Found Tinker's Construct, enabled Blood support.");
- CustomBlood = aBlood.getFluid();
- mBloodFluids.put(FluidUtils.getFluidStack("blood", 100));
- }
- }
-
- // Handle Blood Internally, Create if required.
- if (mBloodFluids.isEmpty() || CustomBlood == null) {
- Logger.INFO(
- "Did not find any existing Blood fluids. Trying to wildcard search the fluid registry, then generate our own if that fails.");
- FluidStack aTempBlood = FluidUtils.getWildcardFluidStack("blood", 100);
- if (aTempBlood != null) {
- CustomBlood = aTempBlood.getFluid();
- } else {
- aTempBlood = FluidUtils.getWildcardFluidStack("hell_blood", 100);
- if (aTempBlood == null) {
- CustomBlood = FluidUtils.generateFluidNoPrefix("blood", "Blood", 32 + 175,
- new short[] { 175, 25, 25, 100 }, true);
- } else {
- CustomBlood = aTempBlood.getFluid();
- }
- }
- Logger.INFO("Using " + CustomBlood.getName());
- mBloodFluids.put(FluidUtils.getFluidStack(CustomBlood, 100));
- }
-
- }
-
- private final static AutoMap<ItemStack> mMeats = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mFish = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mFruits = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mVege = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mNuts = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mSeeds = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mPeat = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mBones = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mBoneMeal = new AutoMap<ItemStack>();
-
- private final static AutoMap<ItemStack> mList_Master_Meats = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mList_Master_Bones = new AutoMap<ItemStack>();
-
- private static void processAllOreDict() {
- processOreDict("listAllmeatraw", mMeats);
- processOreDict("listAllfishraw", mFish);
- processOreDict("listAllfruit", mFruits);
- processOreDict("listAllVeggie", mVege);
- processOreDict("listAllnut", mNuts);
- processOreDict("listAllSeed", mSeeds);
- processOreDict("brickPeat", mPeat);
- processOreDict("bone", mBones);
- processOreDict("dustBone", mBoneMeal);
- // Just make a mega list, makes life easier.
- if (!mMeats.isEmpty()) {
- for (ItemStack g : mMeats) {
- mList_Master_Meats.put(g);
- }
- }
- if (!mFish.isEmpty()) {
- for (ItemStack g : mFish) {
- mList_Master_Meats.put(g);
- }
- }
- if (!mFruits.isEmpty()) {
- for (ItemStack g : mFruits) {
- mList_Master_FruitVege.put(g);
- }
- }
- if (!mVege.isEmpty()) {
- for (ItemStack g : mVege) {
- mList_Master_FruitVege.put(g);
- }
- }
- if (!mNuts.isEmpty()) {
- for (ItemStack g : mNuts) {
- mList_Master_FruitVege.put(g);
- }
- }
- if (!mSeeds.isEmpty()) {
- for (ItemStack g : mSeeds) {
- mList_Master_Seeds.put(g);
- }
- }
- if (!mBoneMeal.isEmpty()) {
- for (ItemStack g : mBoneMeal) {
- mList_Master_Bones.put(g);
- }
- }
- if (!mBones.isEmpty()) {
- for (ItemStack g : mBones) {
- mList_Master_Bones.put(g);
- }
- }
- }
-
- private static void processOreDict(String aOreName, AutoMap<ItemStack> aMap) {
- ArrayList<ItemStack> aTemp = OreDictionary.getOres(aOreName);
- if (!aTemp.isEmpty()) {
- for (ItemStack stack : aTemp) {
- aMap.put(stack);
- }
- }
- }
-
- private static void addBasicSlurryRecipes() {
-
- ItemStack aManureByprod1 = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyManureByproducts", 1);
- ItemStack aManureByprod2 = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
- ItemStack aDirtDust = ItemUtils.getSimpleStack(dustDirt, 1);
-
- // Poop Juice to Basic Slurry
- GT_Values.RA.addCentrifugeRecipe(CI.getNumberedCircuit(10), null, FluidUtils.getFluidStack(PoopJuice, 1000), // In
- // Fluid
- FluidUtils.getFluidStack(ManureSlurry, 250), // Out Fluid
- aDirtDust, aDirtDust, aManureByprod1, aManureByprod1, aManureByprod1, aManureByprod1,
- new int[] { 2000, 2000, 500, 500, 250, 250 }, // Chances
- 10 * 20, // Time
- 30); // EU
-
- // More Efficient way to get byproducts, less Slurry
- GT_Values.RA.addCentrifugeRecipe(CI.getNumberedCircuit(20), null, FluidUtils.getFluidStack(PoopJuice, 1000), // In
- // Fluid
- FluidUtils.getFluidStack(ManureSlurry, 50), // Out Fluid
- aDirtDust, aDirtDust, aManureByprod1, aManureByprod1, aManureByprod2, aManureByprod2,
- new int[] { 4000, 3000, 1250, 1250, 675, 675 }, // Chances
- 20 * 20, // Time
- 60); // EU
-
- }
-
- private static void addAdvancedSlurryRecipes() {
-
- ItemStack aCircuit = CI.getNumberedCircuit(10);
- ItemStack aBone;
- ItemStack aMeat;
- ItemStack aEmptyCells = CI.emptyCells(2);
- ItemStack aInputCells = ItemUtils.getItemStackOfAmountFromOreDict("cellRawAnimalWaste", 2);
- FluidStack aOutput = FluidUtils.getFluidStack(FertileManureSlurry, 1000);
-
- for (FluidStack aBloodStack : mBloodFluids) {
- for (ItemStack aBoneStack : mList_Master_Bones) {
- aBone = ItemUtils.getSimpleStack(aBoneStack, 2);
- for (ItemStack aMeatStack : mList_Master_Meats) {
- aMeat = ItemUtils.getSimpleStack(aMeatStack, 5);
- // Poop Juice to Fertile Slurry
- GT_Values.RA.addMixerRecipe(aCircuit, aBone, aMeat, aInputCells, aBloodStack, // Input Fluid
- aOutput, // Output Fluid
- aEmptyCells, // Output Item
- 20 * 8, // Time?
- 60 // Eu?
- );
- }
- }
- }
- }
-
- private static void addBasicOrganiseFertRecipes() {
- FluidStack aInputFluid = FluidUtils.getFluidStack(ManureSlurry, 1000);
- ItemStack aOutputDust = ItemUtils.getSimpleStack(dustOrganicFertilizer, 3);
- ItemStack aPeat;
- ItemStack aMeat;
- for (ItemStack aPeatStack : mPeat) {
- aPeat = ItemUtils.getSimpleStack(aPeatStack, 3);
- for (ItemStack aMeatStack : mList_Master_Meats) {
- aMeat = ItemUtils.getSimpleStack(aMeatStack, 5);
- CORE.RA.addChemicalRecipe(aPeat, aMeat, aInputFluid, null, aOutputDust, 20 * 20, 120);
- }
-
- aPeat = ItemUtils.getSimpleStack(aPeatStack, 2);
- for (ItemStack aMeatStack : mList_Master_FruitVege) {
- aMeat = ItemUtils.getSimpleStack(aMeatStack, 9);
- CORE.RA.addChemicalRecipe(aPeat, aMeat, aInputFluid, null, aOutputDust, 10 * 20, 120);
- }
- }
- }
-
- private static void addAdvancedOrganiseFertRecipes() {
- FluidStack aInputFluid = FluidUtils.getFluidStack(FertileManureSlurry, 1000);
- ItemStack aOutputDust = ItemUtils.getSimpleStack(dustOrganicFertilizer, 7);
- ItemStack aPeat;
- ItemStack aMeat;
- for (ItemStack aPeatStack : mPeat) {
- aPeat = ItemUtils.getSimpleStack(aPeatStack, 5);
- for (ItemStack aMeatStack : mList_Master_Meats) {
- aMeat = ItemUtils.getSimpleStack(aMeatStack, 7);
- CORE.RA.addChemicalRecipe(aPeat, aMeat, aInputFluid, null, aOutputDust, 10 * 20, 140);
- }
- aPeat = ItemUtils.getSimpleStack(aPeatStack, 3);
- for (ItemStack aMeatStack : mList_Master_FruitVege) {
- aMeat = ItemUtils.getSimpleStack(aMeatStack, 12);
- CORE.RA.addChemicalRecipe(aPeat, aMeat, aInputFluid, null, aOutputDust, 5 * 20, 140);
- }
- }
- }
-
- public static ItemStack aFertForestry;
- public static ItemStack aFertIC2;
-
-
- private static void addMiscRecipes() {
-
- ItemStack aDustOrganicFert = ItemUtils.getSimpleStack(dustOrganicFertilizer, 1);
- ItemStack aManureByprod = ItemUtils.getSimpleStack(dustManureByproducts, 1);
-
- // Dehydrate Organise Fert to Normal Fert.
-
- /**
- * Forestry Support
- */
- if (LoadedMods.Forestry) {
- Field aItemField = ReflectionUtils.getField(ReflectionUtils.getClass("forestry.plugins.PluginCore"), "items");
- try {
- Object aItemRegInstance = aItemField != null ? aItemField.get(aItemField) : null;
- if (aItemRegInstance != null) {
- Field aFertField = ReflectionUtils.getField(aItemRegInstance.getClass(), "fertilizerCompound");
- Object aItemInstance = aFertField.get(aItemRegInstance);
- if (aItemInstance instanceof Item) {
- aFertForestry = ItemUtils.getSimpleStack((Item) aItemInstance);
- Item aForestryFert = (Item) aItemInstance;
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] { CI.getNumberedCircuit(11), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null,
- null, new ItemStack[] { ItemUtils.getSimpleStack(aForestryFert, 3), aManureByprod, aManureByprod },
- new int[] { 10000, 2000, 2000 }, 20 * 20, 240);
- }
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
-
- }
- }
-
- /**
- * IC2 Support
- */
- if (LoadedMods.IndustrialCraft2) {
- aFertIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 1);
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] { CI.getNumberedCircuit(12), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null,
- null, new ItemStack[] { ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 3), aManureByprod,
- aManureByprod },
- new int[] { 10000, 2000, 2000 }, 20 * 20, 240);
- }
-
- // Dirt Production
- CORE.RA.addCompressorRecipe(ItemUtils.getSimpleStack(dustDirt, 9), ItemUtils.getSimpleStack(Blocks.dirt),
- 20 * 2, 8);
-
- // Centrifuge Byproducts
-
- // Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon
- GT_Values.RA.addCentrifugeRecipe(CI.getNumberedCircuit(20), ItemUtils.getSimpleStack(aManureByprod, 4),
- FluidUtils.getFluidStack("sulfuricacid", 250), // In Fluid
- FluidUtils.getFluidStack("sulfuricapatite", 50), // Out Fluid
- MaterialHelper.getDustSmall(Materials.Phosphorus, 2), MaterialHelper.getDustSmall(Materials.Calcium, 2),
- MaterialHelper.getDustTiny(Materials.Copper, 1), MaterialHelper.getDust(Materials.Carbon, 1), ItemUtils.getSimpleStack(dustDirt, 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAmmoniumNitrate", 1),
- new int[] { 2500, 2500, 750, 1000, 5000, 250 }, // Chances
- 20 * 20, // Time
- 60); // EU
-
- // Add Fuel Usages
- CORE.RA.addSemifluidFuel(FluidUtils.getFluidStack(PoopJuice, 1000), 12);
- CORE.RA.addSemifluidFuel(FluidUtils.getFluidStack(ManureSlurry, 1000), 24);
- CORE.RA.addSemifluidFuel(FluidUtils.getFluidStack(FertileManureSlurry, 1000), 32);
-
- // Red Slurry / Tailings Processing
- GT_Values.RA.addCentrifugeRecipe(
- CI.getNumberedBioCircuit(10),
- GT_Values.NI,
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 1000),
- FluidUtils.getWater(500),
- ELEMENT.getInstance().IRON.getSmallDust(1),
- ELEMENT.getInstance().COPPER.getSmallDust(1),
- ELEMENT.getInstance().TIN.getSmallDust(1),
- ELEMENT.getInstance().SULFUR.getSmallDust(1),
- ELEMENT.getInstance().NICKEL.getTinyDust(1),
- ELEMENT.getInstance().LEAD.getTinyDust(1),
- new int[] { 3000, 3000, 2000, 2000, 1000, 1000 },
- 30 * 20,
- 30);
-
- }
-
- @Override
- public String errorMessage() {
- return "Failed to generate recipes for AgroChem.";
- }
-
- @Override
- public boolean generateRecipes() {
- if (mBloodFluids.isEmpty()) {
- Logger.INFO("Could not find, nor create Blood fluid. Unable to add recipes.");
- return false;
- }
-
- // Organise OreDict
- processAllOreDict();
-
- // Slurry Production
- addBasicSlurryRecipes();
- addAdvancedSlurryRecipes();
-
- // Organic Fert. Production
- addBasicOrganiseFertRecipes();
- addAdvancedOrganiseFertRecipes();
-
- addMiscRecipes();
-
- BioRecipes.init();
-
- return true;
- }
+ private static boolean aBOP;
+ private static boolean aTiCon;
+
+ private static AutoMap<FluidStack> mBloodFluids = new AutoMap<FluidStack>();
+
+ /**
+ * Fluids
+ */
+
+ // Poop Juice
+ public static Fluid PoopJuice;
+ // Manure Slurry
+ public static Fluid ManureSlurry;
+ // Fertile Manure Slurry
+ public static Fluid FertileManureSlurry;
+ // Blood
+ public static Fluid CustomBlood;
+ // Red Mud
+ public static Fluid RedMud;
+ /**
+ * Items
+ */
+
+ // Manure Byproducts
+ public static Item dustManureByproducts;
+ // Organic Fertilizer
+ public static Item dustOrganicFertilizer;
+ // Dirt
+ public static Item dustDirt;
+
+ // Poop Juice
+ // vv - Centrifuge
+ // Manure Slurry && Manure Byproducts -> (Elements) Centrifuge to several tiny
+ // piles
+ // vv - Chem Reactor - Add Peat, Meat
+ // Organic Fertilizer
+ // vv - Dehydrate
+ // Fertilizer
+
+ // Poop Juice
+ // vv - Mixer - Add Blood, Bone, Meat (1000L Poo, 200L Blood, x2 Bone, x3 Meat)
+ // Fertile Manure Slurry
+ // vv - Chem Reactor - Add Peat x1.5
+ // Organic Fertilizer x3
+ // vv - Dehydrate
+ // Fertilizer
+
+ public static Item mAlgae;
+ public static Item mBioCircuit;
+ public static Item mAgrichemItem1;
+
+ /*
+ * 0 - Algae Biomass
+ * 1 - Green Algae Biomass
+ * 2 - Brown Algae Biomass
+ * 3 - Golden-Brown Algae Biomass
+ * 4 - Red Algae Biomass
+ * 5 - Cellulose Fiber
+ * 6 - Golden-Brown Cellulose Fiber
+ * 7 - Red Cellulose Fiber
+ * 8 - Compost
+ * 9 - Wood Pellet
+ * 10 - Wood Brick
+ * 11 - Cellulose Pulp
+ * 12 - Raw Bio Resin
+ * 13 - Catalyst Carrier
+ * 14 - Green Metal Catalyst
+ * 15 - Alginic Acid
+ * 16 - Alumina
+ * 17 - Aluminium Pellet
+ * 18 - Sodium Aluminate
+ * 19 - Sodium Hydroxide // Exists in Newer GT
+ * 20 - Sodium Carbonate
+ * 21 - Lithium Chloride
+ * 22 - Pellet Mold
+ * 23 - Clean Aluminium Mix
+ * 24 - Pinecone
+ */
+
+ public static ItemStack mAlgaeBiosmass;
+ public static ItemStack mGreenAlgaeBiosmass;
+ public static ItemStack mBrownAlgaeBiosmass;
+ public static ItemStack mGoldenBrownAlgaeBiosmass;
+ public static ItemStack mRedAlgaeBiosmass;
+ public static ItemStack mCelluloseFiber;
+ public static ItemStack mGoldenBrownCelluloseFiber;
+ public static ItemStack mRedCelluloseFiber;
+ public static ItemStack mCompost;
+ public static ItemStack mWoodPellet;
+ public static ItemStack mWoodBrick;
+ public static ItemStack mCellulosePulp;
+ public static ItemStack mRawBioResin;
+ public static ItemStack mCatalystCarrier;
+ public static ItemStack mGreenCatalyst;
+ public static ItemStack mAlginicAcid;
+ public static ItemStack mAlumina;
+ public static ItemStack mAluminiumPellet;
+ public static ItemStack mSodiumAluminate;
+ public static ItemStack mSodiumHydroxide;
+ public static ItemStack mSodiumCarbonate;
+ public static ItemStack mLithiumChloride;
+ public static ItemStack mPelletMold;
+ public static ItemStack mCleanAluminiumMix;
+ public static ItemStack mPinecone;
+ public static ItemStack mCrushedPine;
+
+ @Override
+ public void items() {
+ // Nitrogen, Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon
+ dustManureByproducts = ItemUtils.generateSpecialUseDusts(
+ "ManureByproducts", "Manure Byproduct", "(N2H4O3)N2P2Ca3CuC8", Utils.rgbtoHexValue(110, 75, 25))[0];
+
+ // Basically Guano
+ dustOrganicFertilizer = ItemUtils.generateSpecialUseDusts(
+ "OrganicFertilizer", "Organic Fertilizer", "Ca5(PO4)3(OH)", Utils.rgbtoHexValue(240, 240, 240))[0];
+
+ // Dirt Dust :)
+ dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0];
+
+ mAlgae = new ItemAlgaeBase();
+ mAgrichemItem1 = new ItemAgrichemBase();
+ mBioCircuit = new ItemBioChip();
+ GregtechItemList.Circuit_BioRecipeSelector.set(mBioCircuit);
+
+ mAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 0, 1);
+ mGreenAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 1, 1);
+ mBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 2, 1);
+ mGoldenBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 3, 1);
+ mRedAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 4, 1);
+ mCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 5, 1);
+ mGoldenBrownCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 6, 1);
+ mRedCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 7, 1);
+ mCompost = ItemUtils.simpleMetaStack(mAgrichemItem1, 8, 1);
+ mWoodPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 9, 1);
+ mWoodBrick = ItemUtils.simpleMetaStack(mAgrichemItem1, 10, 1);
+ mCellulosePulp = ItemUtils.simpleMetaStack(mAgrichemItem1, 11, 1);
+ mRawBioResin = ItemUtils.simpleMetaStack(mAgrichemItem1, 12, 1);
+ mCatalystCarrier = ItemUtils.simpleMetaStack(mAgrichemItem1, 13, 1);
+ mGreenCatalyst = ItemUtils.simpleMetaStack(mAgrichemItem1, 14, 1);
+ mAlginicAcid = ItemUtils.simpleMetaStack(mAgrichemItem1, 15, 1);
+ mAlumina = ItemUtils.simpleMetaStack(mAgrichemItem1, 16, 1);
+ mAluminiumPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 17, 1);
+ mSodiumAluminate = ItemUtils.simpleMetaStack(mAgrichemItem1, 18, 1);
+
+ /**
+ * If It exists, don't add a new one.
+ */
+ if (OreDictionary.doesOreNameExist("dustSodiumHydroxide_GT5U")
+ || OreDictionary.doesOreNameExist("dustSodiumHydroxide")) {
+ List<ItemStack> aTest = OreDictionary.getOres("dustSodiumHydroxide", false);
+ ItemStack aTestStack;
+ if (aTest.isEmpty()) {
+ aTest = OreDictionary.getOres("dustSodiumHydroxide_GT5U", false);
+ if (aTest.isEmpty()) {
+ aTestStack = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
+ } else {
+ aTestStack = aTest.get(0);
+ }
+ } else {
+ aTestStack = aTest.get(0);
+ }
+ mSodiumHydroxide = aTestStack;
+ } else {
+ mSodiumHydroxide = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
+ }
+ mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1);
+ mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1);
+ mPelletMold = ItemUtils.simpleMetaStack(mAgrichemItem1, 22, 1);
+ mCleanAluminiumMix = ItemUtils.simpleMetaStack(mAgrichemItem1, 23, 1);
+ mPinecone = ItemUtils.simpleMetaStack(mAgrichemItem1, 24, 1);
+ mCrushedPine = ItemUtils.simpleMetaStack(mAgrichemItem1, 25, 1);
+
+ ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae");
+ ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae");
+ ItemUtils.addItemToOreDictionary(mGoldenBrownAlgaeBiosmass, "biomassGoldenBrownAlgae");
+ ItemUtils.addItemToOreDictionary(mRedAlgaeBiosmass, "biomassRedAlgae");
+
+ ItemUtils.addItemToOreDictionary(mCelluloseFiber, "fiberCellulose");
+ ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberCellulose");
+ ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberGoldenBrownCellulose");
+ ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberCellulose");
+ ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberRedCellulose");
+
+ ItemUtils.addItemToOreDictionary(mWoodPellet, "pelletWood");
+ ItemUtils.addItemToOreDictionary(mWoodBrick, "brickWood");
+ ItemUtils.addItemToOreDictionary(mCellulosePulp, "pulpCellulose");
+
+ ItemUtils.addItemToOreDictionary(mCatalystCarrier, "catalystEmpty");
+ ItemUtils.addItemToOreDictionary(mGreenCatalyst, "catalystAluminiumSilver");
+ ItemUtils.addItemToOreDictionary(mAlginicAcid, "dustAlginicAcid");
+ ItemUtils.addItemToOreDictionary(mAlumina, "dustAlumina");
+ ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium");
+
+ ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate");
+ ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide");
+ ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate");
+ ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride");
+ ItemUtils.addItemToOreDictionary(mPinecone, "pinecone");
+ ItemUtils.addItemToOreDictionary(mCrushedPine, "crushedPineMaterial");
+
+ // Handle GT NaOH dusts
+ List<ItemStack> NaOHSmall = OreDictionary.getOres("dustSmallSodiumHydroxide_GT5U", false);
+ if (!NaOHSmall.isEmpty()) {
+ ItemUtils.addItemToOreDictionary(NaOHSmall.get(0), "dustSmallSodiumHydroxide");
+ }
+ List<ItemStack> NaOHTiny = OreDictionary.getOres("dustTinySodiumHydroxide_GT5U", false);
+ if (!NaOHTiny.isEmpty()) {
+ ItemUtils.addItemToOreDictionary(NaOHTiny.get(0), "dustTinySodiumHydroxide");
+ }
+ }
+
+ @Override
+ public void blocks() {
+ // None yet
+ }
+
+ @Override
+ public void fluids() {
+ // Sewage
+ PoopJuice = FluidUtils.generateFluidNonMolten(
+ "raw.waste", "Raw Animal Waste", 32 + 175, new short[] {100, 70, 30, 100}, null, null, 0, true);
+
+ // Sewage
+ ManureSlurry = FluidUtils.generateFluidNonMolten(
+ "manure.slurry", "Manure Slurry", 39 + 175, new short[] {75, 45, 15, 100}, null, null, 0, true);
+
+ // Sewage
+ FertileManureSlurry = FluidUtils.generateFluidNonMolten(
+ "fertile.manure.slurry",
+ "Fertile Manure Slurry",
+ 45 + 175,
+ new short[] {65, 50, 15, 100},
+ null,
+ null,
+ 0,
+ true);
+
+ RedMud = FluidUtils.generateFluidNoPrefix(
+ "mud.red.slurry", "Red Mud Slurry", 32 + 175, new short[] {180, 35, 25, 100}, true);
+ }
+
+ public AgriculturalChem() {
+ super();
+
+ aBOP = LoadedMods.BiomesOPlenty;
+ aTiCon = LoadedMods.TiCon;
+
+ Logger.INFO("Adding Agrochemical content");
+
+ FluidStack aBlood;
+ if (aBOP) {
+ aBlood = FluidUtils.getFluidStack("hell_blood", 100);
+ if (aBlood != null) {
+ Logger.INFO("Found Biome's o Plenty, enabled Blood support.");
+ CustomBlood = aBlood.getFluid();
+ mBloodFluids.put(aBlood);
+ }
+ }
+
+ if (aTiCon) {
+ aBlood = FluidUtils.getFluidStack("blood", 100);
+ if (aBlood != null) {
+ Logger.INFO("Found Tinker's Construct, enabled Blood support.");
+ CustomBlood = aBlood.getFluid();
+ mBloodFluids.put(FluidUtils.getFluidStack("blood", 100));
+ }
+ }
+
+ // Handle Blood Internally, Create if required.
+ if (mBloodFluids.isEmpty() || CustomBlood == null) {
+ Logger.INFO(
+ "Did not find any existing Blood fluids. Trying to wildcard search the fluid registry, then generate our own if that fails.");
+ FluidStack aTempBlood = FluidUtils.getWildcardFluidStack("blood", 100);
+ if (aTempBlood != null) {
+ CustomBlood = aTempBlood.getFluid();
+ } else {
+ aTempBlood = FluidUtils.getWildcardFluidStack("hell_blood", 100);
+ if (aTempBlood == null) {
+ CustomBlood = FluidUtils.generateFluidNoPrefix(
+ "blood", "Blood", 32 + 175, new short[] {175, 25, 25, 100}, true);
+ } else {
+ CustomBlood = aTempBlood.getFluid();
+ }
+ }
+ Logger.INFO("Using " + CustomBlood.getName());
+ mBloodFluids.put(FluidUtils.getFluidStack(CustomBlood, 100));
+ }
+ }
+
+ private static final AutoMap<ItemStack> mMeats = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mFish = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mFruits = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mVege = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mNuts = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mSeeds = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mPeat = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mBones = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mBoneMeal = new AutoMap<ItemStack>();
+
+ private static final AutoMap<ItemStack> mList_Master_Meats = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mList_Master_Bones = new AutoMap<ItemStack>();
+
+ private static void processAllOreDict() {
+ processOreDict("listAllmeatraw", mMeats);
+ processOreDict("listAllfishraw", mFish);
+ processOreDict("listAllfruit", mFruits);
+ processOreDict("listAllVeggie", mVege);
+ processOreDict("listAllnut", mNuts);
+ processOreDict("listAllSeed", mSeeds);
+ processOreDict("brickPeat", mPeat);
+ processOreDict("bone", mBones);
+ processOreDict("dustBone", mBoneMeal);
+ // Just make a mega list, makes life easier.
+ if (!mMeats.isEmpty()) {
+ for (ItemStack g : mMeats) {
+ mList_Master_Meats.put(g);
+ }
+ }
+ if (!mFish.isEmpty()) {
+ for (ItemStack g : mFish) {
+ mList_Master_Meats.put(g);
+ }
+ }
+ if (!mFruits.isEmpty()) {
+ for (ItemStack g : mFruits) {
+ mList_Master_FruitVege.put(g);
+ }
+ }
+ if (!mVege.isEmpty()) {
+ for (ItemStack g : mVege) {
+ mList_Master_FruitVege.put(g);
+ }
+ }
+ if (!mNuts.isEmpty()) {
+ for (ItemStack g : mNuts) {
+ mList_Master_FruitVege.put(g);
+ }
+ }
+ if (!mSeeds.isEmpty()) {
+ for (ItemStack g : mSeeds) {
+ mList_Master_Seeds.put(g);
+ }
+ }
+ if (!mBoneMeal.isEmpty()) {
+ for (ItemStack g : mBoneMeal) {
+ mList_Master_Bones.put(g);
+ }
+ }
+ if (!mBones.isEmpty()) {
+ for (ItemStack g : mBones) {
+ mList_Master_Bones.put(g);
+ }
+ }
+ }
+
+ private static void processOreDict(String aOreName, AutoMap<ItemStack> aMap) {
+ ArrayList<ItemStack> aTemp = OreDictionary.getOres(aOreName);
+ if (!aTemp.isEmpty()) {
+ for (ItemStack stack : aTemp) {
+ aMap.put(stack);
+ }
+ }
+ }
+
+ private static void addBasicSlurryRecipes() {
+
+ ItemStack aManureByprod1 = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyManureByproducts", 1);
+ ItemStack aManureByprod2 = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
+ ItemStack aDirtDust = ItemUtils.getSimpleStack(dustDirt, 1);
+
+ // Poop Juice to Basic Slurry
+ GT_Values.RA.addCentrifugeRecipe(
+ CI.getNumberedCircuit(10),
+ null,
+ FluidUtils.getFluidStack(PoopJuice, 1000), // In
+ // Fluid
+ FluidUtils.getFluidStack(ManureSlurry, 250), // Out Fluid
+ aDirtDust,
+ aDirtDust,
+ aManureByprod1,
+ aManureByprod1,
+ aManureByprod1,
+ aManureByprod1,
+ new int[] {2000, 2000, 500, 500, 250, 250}, // Chances
+ 10 * 20, // Time
+ 30); // EU
+
+ // More Efficient way to get byproducts, less Slurry
+ GT_Values.RA.addCentrifugeRecipe(
+ CI.getNumberedCircuit(20),
+ null,
+ FluidUtils.getFluidStack(PoopJuice, 1000), // In
+ // Fluid
+ FluidUtils.getFluidStack(ManureSlurry, 50), // Out Fluid
+ aDirtDust,
+ aDirtDust,
+ aManureByprod1,
+ aManureByprod1,
+ aManureByprod2,
+ aManureByprod2,
+ new int[] {4000, 3000, 1250, 1250, 675, 675}, // Chances
+ 20 * 20, // Time
+ 60); // EU
+ }
+
+ private static void addAdvancedSlurryRecipes() {
+
+ ItemStack aCircuit = CI.getNumberedCircuit(10);
+ ItemStack aBone;
+ ItemStack aMeat;
+ ItemStack aEmptyCells = CI.emptyCells(2);
+ ItemStack aInputCells = ItemUtils.getItemStackOfAmountFromOreDict("cellRawAnimalWaste", 2);
+ FluidStack aOutput = FluidUtils.getFluidStack(FertileManureSlurry, 1000);
+
+ for (FluidStack aBloodStack : mBloodFluids) {
+ for (ItemStack aBoneStack : mList_Master_Bones) {
+ aBone = ItemUtils.getSimpleStack(aBoneStack, 2);
+ for (ItemStack aMeatStack : mList_Master_Meats) {
+ aMeat = ItemUtils.getSimpleStack(aMeatStack, 5);
+ // Poop Juice to Fertile Slurry
+ GT_Values.RA.addMixerRecipe(
+ aCircuit,
+ aBone,
+ aMeat,
+ aInputCells,
+ aBloodStack, // Input Fluid
+ aOutput, // Output Fluid
+ aEmptyCells, // Output Item
+ 20 * 8, // Time?
+ 60 // Eu?
+ );
+ }
+ }
+ }
+ }
+
+ private static void addBasicOrganiseFertRecipes() {
+ FluidStack aInputFluid = FluidUtils.getFluidStack(ManureSlurry, 1000);
+ ItemStack aOutputDust = ItemUtils.getSimpleStack(dustOrganicFertilizer, 3);
+ ItemStack aPeat;
+ ItemStack aMeat;
+ for (ItemStack aPeatStack : mPeat) {
+ aPeat = ItemUtils.getSimpleStack(aPeatStack, 3);
+ for (ItemStack aMeatStack : mList_Master_Meats) {
+ aMeat = ItemUtils.getSimpleStack(aMeatStack, 5);
+ CORE.RA.addChemicalRecipe(aPeat, aMeat, aInputFluid, null, aOutputDust, 20 * 20, 120);
+ }
+
+ aPeat = ItemUtils.getSimpleStack(aPeatStack, 2);
+ for (ItemStack aMeatStack : mList_Master_FruitVege) {
+ aMeat = ItemUtils.getSimpleStack(aMeatStack, 9);
+ CORE.RA.addChemicalRecipe(aPeat, aMeat, aInputFluid, null, aOutputDust, 10 * 20, 120);
+ }
+ }
+ }
+
+ private static void addAdvancedOrganiseFertRecipes() {
+ FluidStack aInputFluid = FluidUtils.getFluidStack(FertileManureSlurry, 1000);
+ ItemStack aOutputDust = ItemUtils.getSimpleStack(dustOrganicFertilizer, 7);
+ ItemStack aPeat;
+ ItemStack aMeat;
+ for (ItemStack aPeatStack : mPeat) {
+ aPeat = ItemUtils.getSimpleStack(aPeatStack, 5);
+ for (ItemStack aMeatStack : mList_Master_Meats) {
+ aMeat = ItemUtils.getSimpleStack(aMeatStack, 7);
+ CORE.RA.addChemicalRecipe(aPeat, aMeat, aInputFluid, null, aOutputDust, 10 * 20, 140);
+ }
+ aPeat = ItemUtils.getSimpleStack(aPeatStack, 3);
+ for (ItemStack aMeatStack : mList_Master_FruitVege) {
+ aMeat = ItemUtils.getSimpleStack(aMeatStack, 12);
+ CORE.RA.addChemicalRecipe(aPeat, aMeat, aInputFluid, null, aOutputDust, 5 * 20, 140);
+ }
+ }
+ }
+
+ public static ItemStack aFertForestry;
+ public static ItemStack aFertIC2;
+
+ private static void addMiscRecipes() {
+
+ ItemStack aDustOrganicFert = ItemUtils.getSimpleStack(dustOrganicFertilizer, 1);
+ ItemStack aManureByprod = ItemUtils.getSimpleStack(dustManureByproducts, 1);
+
+ // Dehydrate Organise Fert to Normal Fert.
+
+ /**
+ * Forestry Support
+ */
+ if (LoadedMods.Forestry) {
+ Field aItemField =
+ ReflectionUtils.getField(ReflectionUtils.getClass("forestry.plugins.PluginCore"), "items");
+ try {
+ Object aItemRegInstance = aItemField != null ? aItemField.get(aItemField) : null;
+ if (aItemRegInstance != null) {
+ Field aFertField = ReflectionUtils.getField(aItemRegInstance.getClass(), "fertilizerCompound");
+ Object aItemInstance = aFertField.get(aItemRegInstance);
+ if (aItemInstance instanceof Item) {
+ aFertForestry = ItemUtils.getSimpleStack((Item) aItemInstance);
+ Item aForestryFert = (Item) aItemInstance;
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(11), ItemUtils.getSimpleStack(aDustOrganicFert, 4)
+ },
+ null,
+ null,
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(aForestryFert, 3), aManureByprod, aManureByprod
+ },
+ new int[] {10000, 2000, 2000},
+ 20 * 20,
+ 240);
+ }
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+
+ }
+ }
+
+ /**
+ * IC2 Support
+ */
+ if (LoadedMods.IndustrialCraft2) {
+ aFertIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 1);
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(12), ItemUtils.getSimpleStack(aDustOrganicFert, 4)},
+ null,
+ null,
+ new ItemStack[] {
+ ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 3), aManureByprod, aManureByprod
+ },
+ new int[] {10000, 2000, 2000},
+ 20 * 20,
+ 240);
+ }
+
+ // Dirt Production
+ CORE.RA.addCompressorRecipe(
+ ItemUtils.getSimpleStack(dustDirt, 9), ItemUtils.getSimpleStack(Blocks.dirt), 20 * 2, 8);
+
+ // Centrifuge Byproducts
+
+ // Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon
+ GT_Values.RA.addCentrifugeRecipe(
+ CI.getNumberedCircuit(20),
+ ItemUtils.getSimpleStack(aManureByprod, 4),
+ FluidUtils.getFluidStack("sulfuricacid", 250), // In Fluid
+ FluidUtils.getFluidStack("sulfuricapatite", 50), // Out Fluid
+ MaterialHelper.getDustSmall(Materials.Phosphorus, 2),
+ MaterialHelper.getDustSmall(Materials.Calcium, 2),
+ MaterialHelper.getDustTiny(Materials.Copper, 1),
+ MaterialHelper.getDust(Materials.Carbon, 1),
+ ItemUtils.getSimpleStack(dustDirt, 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAmmoniumNitrate", 1),
+ new int[] {2500, 2500, 750, 1000, 5000, 250}, // Chances
+ 20 * 20, // Time
+ 60); // EU
+
+ // Add Fuel Usages
+ CORE.RA.addSemifluidFuel(FluidUtils.getFluidStack(PoopJuice, 1000), 12);
+ CORE.RA.addSemifluidFuel(FluidUtils.getFluidStack(ManureSlurry, 1000), 24);
+ CORE.RA.addSemifluidFuel(FluidUtils.getFluidStack(FertileManureSlurry, 1000), 32);
+
+ // Red Slurry / Tailings Processing
+ GT_Values.RA.addCentrifugeRecipe(
+ CI.getNumberedBioCircuit(10),
+ GT_Values.NI,
+ FluidUtils.getFluidStack(AgriculturalChem.RedMud, 1000),
+ FluidUtils.getWater(500),
+ ELEMENT.getInstance().IRON.getSmallDust(1),
+ ELEMENT.getInstance().COPPER.getSmallDust(1),
+ ELEMENT.getInstance().TIN.getSmallDust(1),
+ ELEMENT.getInstance().SULFUR.getSmallDust(1),
+ ELEMENT.getInstance().NICKEL.getTinyDust(1),
+ ELEMENT.getInstance().LEAD.getTinyDust(1),
+ new int[] {3000, 3000, 2000, 2000, 1000, 1000},
+ 30 * 20,
+ 30);
+ }
+
+ @Override
+ public String errorMessage() {
+ return "Failed to generate recipes for AgroChem.";
+ }
+
+ @Override
+ public boolean generateRecipes() {
+ if (mBloodFluids.isEmpty()) {
+ Logger.INFO("Could not find, nor create Blood fluid. Unable to add recipes.");
+ return false;
+ }
+
+ // Organise OreDict
+ processAllOreDict();
+
+ // Slurry Production
+ addBasicSlurryRecipes();
+ addAdvancedSlurryRecipes();
+
+ // Organic Fert. Production
+ addBasicOrganiseFertRecipes();
+ addAdvancedOrganiseFertRecipes();
+
+ addMiscRecipes();
+
+ BioRecipes.init();
+
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/CoalTar.java b/src/main/java/gtPlusPlus/core/item/chemistry/CoalTar.java
index c7864efac8..a99386340d 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/CoalTar.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/CoalTar.java
@@ -17,361 +17,357 @@ import net.minecraftforge.fluids.FluidStack;
public class CoalTar extends ItemPackage {
- public static Fluid Coal_Gas;
- public static Fluid Coal_Oil;
- public static Fluid Ethylene;
- public static Fluid Ethylbenzene;
- public static Fluid Anthracene;
- public static Fluid Toluene;
- public static Fluid Coal_Tar;
- public static Fluid Coal_Tar_Oil;
- public static Fluid Sulfuric_Coal_Tar_Oil;
- public static Fluid Naphthalene;
- public static Fluid Phthalic_Acid;
-
- private static void recipeEthylBenzineFuelsIntoHeavyFuel() {
- CORE.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("cellFuel", 9),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2),
- null,
- FluidUtils.getFluidStack("nitrofuel", 7500),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 11),
- 100,
- CORE.GTNH ? 1000 : 500);
- CORE.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("cellBioDiesel", 9),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2),
- null,
- FluidUtils.getFluidStack("nitrofuel", 3000),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 11),
- 300,
- CORE.GTNH ? 1000 : 500);
- }
-
- public static void recipeCreateEthylene(){
-
- FluidStack bioEth1 = FluidUtils.getFluidStack("fluid.bioethanol", 1000);
- FluidStack bioEth2 = FluidUtils.getFluidStack("bioethanol", 1000);
-
- //C2H6O = C2H4 + H2O
- if (bioEth1 != null){
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(17),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1)
- },
- bioEth1,
- FluidUtils.getWater(1000),
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 1)
- },
- new int[] {10000},
- 120 * 20,
- 80);
- }
-
- if (bioEth2 != null){
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(18),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1)
- },
- bioEth2,
- FluidUtils.getWater(1000),
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 1)
- },
- new int[] {10000},
- 120 * 20,
- 80);
- }
- }
-
- public static void recipeCreateBenzene(){
- //C7H8 + 2H = CH4 + C6H6
- CORE.RA.addDehydratorRecipe(
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("cellToluene", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2)
- },
- null,
- null,
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("cellMethane", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellBenzene", 1),
- Materials.Empty.getCells(1)
- },
- new int[]{10000, 10000, 10000},
- 20*10,
- 90);
- }
-
- public static void recipeCreateEthylbenzene(){
- //C2H4 + C6H6 = C8H10
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("cellBenzene", 2),
- null,
- FluidUtils.getFluidStack("fluid.ethylbenzene", 2000),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 4),
- 300);
- }
-
-
- public static void recipeCoalToCoalTar(){
- //Charcoal
- AddGregtechRecipe.addCokeAndPyrolyseRecipes(
- GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 32L),
- 8,
- GT_Values.NF,
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallDirt", 2),
- FluidUtils.getFluidStack("fluid.coaltar", 800),
- 15,
- 120);
- //Lignite
- AddGregtechRecipe.addCokeAndPyrolyseRecipes(
- GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 16L),
- 8,
- GT_Values.NF,
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallDarkAsh", 2),
- FluidUtils.getFluidStack("fluid.coaltar", 800),
- 45,
- 60);
-
- //Coal
- AddGregtechRecipe.addCokeAndPyrolyseRecipes(
- GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 12L),
- 8,
- GT_Values.NF,
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallDarkAsh", 2),
- FluidUtils.getFluidStack("fluid.coaltar", 2200),
- 30,
- 120);
-
- //Coke
- AddGregtechRecipe.addCokeAndPyrolyseRecipes(
- ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 8),
- 8,
- GT_Values.NF,
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallAsh", 3),
- FluidUtils.getFluidStack("fluid.coaltar", 3400),
- 15,
- 240);
-
- }
-
- private static void recipeCoalTarToCoalTarOil() {
- // v - Distill (60% Tar oil/15% Naphtha/20% Ethylbenzene/5% Anthracene)
- //Create Coal Tar Oil
- //FluidUtils.generateFluidNonMolten("CoalTarOil", "Coal Tar Oil", 240, new short[]{240, 240, 150, 100}, null, null);
- GT_Values.RA.addDistilleryRecipe(
- CI.getNumberedCircuit(1), //Circuit
- FluidUtils.getFluidStack("fluid.coaltar", 1000), //aInput
- FluidUtils.getFluidStack("fluid.coaltaroil", 600), //aOutput
- 600, //aDuration
- 64,//aEUt
- false //Hidden?
- );
- GT_Values.RA.addDistilleryRecipe(
- CI.getNumberedCircuit(2), //Circuit
- FluidUtils.getFluidStack("fluid.coaltar", 1000), //aInput
- FluidUtils.getFluidStack("liquid_naphtha", 150), //aOutput
- 300, //aDuration
- 30,//aEUt
- false //Hidden?
- );
- GT_Values.RA.addDistilleryRecipe(
- CI.getNumberedCircuit(3), //Circuit
- FluidUtils.getFluidStack("fluid.coaltar", 1000), //aInput
- FluidUtils.getFluidStack("fluid.ethylbenzene", 200), //aOutput
- 450, //aDuration
- 86,//aEUt
- false //Hidden?
- );
- GT_Values.RA.addDistilleryRecipe(
- CI.getNumberedCircuit(4), //Circuit
- FluidUtils.getFluidStack("fluid.coaltar", 1000), //aInput
- FluidUtils.getFluidStack("fluid.anthracene", 50), //aOutput
- 900, //aDuration
- 30,//aEUt
- false //Hidden?
- );
- GT_Values.RA.addDistilleryRecipe(
- CI.getNumberedCircuit(5), //Circuit
- FluidUtils.getFluidStack("fluid.coaltar", 1500), //aInput
- FluidUtils.getFluidStack("fluid.kerosene", 600), //aOutput
- 300, //aDuration
- 64,//aEUt
- false //Hidden?
- );
-
- GT_Values.RA.addDistillationTowerRecipe(
- FluidUtils.getFluidStack("fluid.coaltar", 1200),
- new FluidStack[]{
- FluidUtils.getFluidStack("fluid.coaltaroil", 500), //aOutput
- FluidUtils.getFluidStack("liquid_naphtha", 100), //aOutput
- FluidUtils.getFluidStack("fluid.ethylbenzene", 150), //aOutput
- FluidUtils.getFluidStack("fluid.anthracene", 50), //aOutput
- FluidUtils.getFluidStack("fluid.kerosene", 400), //aOutput
- },
- null,
- 900,
- 60);
-
- }
-
- private static void recipeCoalTarOilToSulfuricOilToNaphthalene() {
- //SulfuricCoalTarOil
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("cellCoalTarOil", 8),
- ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 8),
- null,
- null,
- ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricCoalTarOil", 16),
- 20*16);
- GT_Values.RA.addDistilleryRecipe(
- CI.getNumberedCircuit(6), //Circuit
- FluidUtils.getFluidStack("fluid.sulfuriccoaltaroil", 1000), //aInput
- FluidUtils.getFluidStack("fluid.naphthalene", 1000), //aOutput
- 1200, //aDuration
- 30,//aEUt
- false //Hidden?
- );
-
- }
-
- private static void recipeNaphthaleneToPhthalicAcid() {
- //SulfuricCoalTarOil
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("cellNaphthalene", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 5),
- null,
- FluidUtils.getFluidStack("fluid.phthalicacid", 2500),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2),
- 20*16);
-
- }
-
- private static void recipePhthalicAcidToPhthalicAnhydride() {
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(15)
- },
- FluidUtils.getFluidStack("fluid.phthalicacid", 1000),
- null,
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 15)
- },
- new int[] {10000},
- 60 * 20,
- 120);
- }
-
- @Override
- public String errorMessage() {
- return "Bad Coal Science!";
- }
-
- @Override
- public boolean generateRecipes() {
- recipeCreateEthylene();
- recipeCreateBenzene();
- recipeCreateEthylbenzene();
-
- recipeCoalToCoalTar();
- recipeCoalTarToCoalTarOil();
- recipeCoalTarOilToSulfuricOilToNaphthalene();
- recipeNaphthaleneToPhthalicAcid();
- recipePhthalicAcidToPhthalicAnhydride();
-
- recipeEthylBenzineFuelsIntoHeavyFuel();
-
- recipePhthalicAcidConversion();
-
- //Burn the coal gas!
- GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1);
- CORE.RA.addSemifluidFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricCoalTarOil", 1), 64);
- CORE.RA.addSemifluidFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalTarOil", 1), 32);
- CORE.RA.addSemifluidFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalTar", 1), 16);
-
- return true;
- }
-
- private void recipePhthalicAcidConversion() {
- FluidStack aMyAcid = FluidUtils.getFluidStack(Phthalic_Acid, 500);
- FluidStack aGtAcid = FluidUtils.getFluidStack("phtalicacid", 500);
- if (aMyAcid != null && aGtAcid != null) {
- CORE.RA.addDistilleryRecipe(CI.getNumberedBioCircuit(8), aMyAcid, aGtAcid, null, 50, 16, false);
- CORE.RA.addDistilleryRecipe(CI.getNumberedBioCircuit(9), aGtAcid, aMyAcid, null, 50, 16, false);
- }
- }
-
- @Override
- public void items() {
- //Phthalic_Acid = FluidUtils.generateFluidNonMolten("PhthalicAcid", "Phthalic Acid", 207, new short[]{210, 220, 210, 100}, null, null);
- // v - Dehydrate at 180C+
- //Create Phthalic Anhydride
- ItemUtils.generateSpecialUseDusts("PhthalicAnhydride", "Phthalic Anhydride", "C6H4(CO)2O", Utils.rgbtoHexValue(175, 175, 175));
-
- //Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O
- ItemUtils.generateSpecialUseDusts("LithiumHydroperoxide", "Lithium Hydroperoxide", "HLiO2", Utils.rgbtoHexValue(125, 125, 125));
- // v - Dehydrate
- //Lithium Peroxide - 2 LiOOH → Li2O2 + H2O2 + 2 H2O
- //Lithium_Peroxide = FluidUtils.generateFluidNonMolten("LithiumPeroxide", "Lithium Peroxide", 446, new short[]{135, 135, 135, 100}, null, null);
- }
-
- @Override
- public void blocks() {
-
- }
-
- @Override
- public void fluids() {
-
- //Create Coal Gas
- Coal_Gas = FluidUtils.generateFluidNonMolten("CoalGas", "Coal Gas", 500, new short[]{48, 48, 48, 100}, null, null);
- //Ethanol
- // v - Dehydrate cells to remove water
-
-
- //Create Ethylene
- if (!FluidUtils.doesFluidExist("ethylene")){
- Ethylene = FluidUtils.generateFluidNonMolten("ethylene", "Ethylene", -103, new short[]{255, 255, 255, 100}, null, null);
- }
- else {
- Ethylene = FluidUtils.getWildcardFluidStack("ethylene", 1).getFluid();
- }
-
- //Create Ethylbenzene - Ethylbenzene is produced in on a large scale by combining benzene and ethylene in an acid-catalyzed chemical reaction
- //Use Chemical Reactor
- Ethylbenzene = FluidUtils.generateFluidNonMolten("Ethylbenzene", "Ethylbenzene", 136, new short[]{255, 255, 255, 100}, null, null);
- //Create Anthracene
- Anthracene = FluidUtils.generateFluidNonMolten("Anthracene", "Anthracene", 340, new short[]{255, 255, 255, 100}, null, null);
- //Toluene
- if (!FluidUtils.doesFluidExist("liquid_toluene")){
- Toluene = FluidUtils.generateFluidNonMolten("liquid_toluene", "Toluene", -95, new short[]{140, 70, 20, 100}, null, null);
- }
- else {
- Toluene = FluidUtils.getWildcardFluidStack("liquid_toluene", 1).getFluid();
- }
-
- //Create Coal Tar
- Coal_Tar = FluidUtils.generateFluidNonMolten("CoalTar", "Coal Tar", 450, new short[]{32, 32, 32, 100}, null, null);
- // v - Distill (60% Tar oil/15% Naphtha/20% Ethylbenzene/5% Anthracene)
- //Create Coal Tar Oil
- Coal_Tar_Oil = FluidUtils.generateFluidNonMolten("CoalTarOil", "Coal Tar Oil", 240, new short[]{240, 240, 150, 100}, null, null);
- // v - Wash With Sulfuric Acid
- //Create Sulfuric Coal Tar Oil
- Sulfuric_Coal_Tar_Oil = FluidUtils.generateFluidNonMolten("SulfuricCoalTarOil", "Sulfuric Coal Tar Oil", 240, new short[]{250, 170, 12, 100}, null, null);
- // v - Distill (No loss, just time consuming)
- //Create Naphthalene
- Naphthalene = FluidUtils.generateFluidNonMolten("Naphthalene", "Naphthalene", 115, new short[]{210, 185, 135, 100}, null, null);
- // v - Oxidize with mercury and nitric acid
- //Create Phthalic Acid
- Phthalic_Acid = FluidUtils.generateFluidNonMolten("PhthalicAcid", "Phthalic Acid", 207, new short[]{210, 220, 210, 100}, null, null);
- // v - Dehydrate at 180C+
- //Create Phthalic Anhydride
- //ItemUtils.generateSpecialUseDusts("PhthalicAnhydride", "Phthalic Anhydride", "C6H4(CO)2O", Utils.rgbtoHexValue(175, 175, 175));
- }
-
+ public static Fluid Coal_Gas;
+ public static Fluid Coal_Oil;
+ public static Fluid Ethylene;
+ public static Fluid Ethylbenzene;
+ public static Fluid Anthracene;
+ public static Fluid Toluene;
+ public static Fluid Coal_Tar;
+ public static Fluid Coal_Tar_Oil;
+ public static Fluid Sulfuric_Coal_Tar_Oil;
+ public static Fluid Naphthalene;
+ public static Fluid Phthalic_Acid;
+
+ private static void recipeEthylBenzineFuelsIntoHeavyFuel() {
+ CORE.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellFuel", 9),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2),
+ null,
+ FluidUtils.getFluidStack("nitrofuel", 7500),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 11),
+ 100,
+ CORE.GTNH ? 1000 : 500);
+ CORE.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellBioDiesel", 9),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2),
+ null,
+ FluidUtils.getFluidStack("nitrofuel", 3000),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 11),
+ 300,
+ CORE.GTNH ? 1000 : 500);
+ }
+
+ public static void recipeCreateEthylene() {
+
+ FluidStack bioEth1 = FluidUtils.getFluidStack("fluid.bioethanol", 1000);
+ FluidStack bioEth2 = FluidUtils.getFluidStack("bioethanol", 1000);
+
+ // C2H6O = C2H4 + H2O
+ if (bioEth1 != null) {
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(17), ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1)
+ },
+ bioEth1,
+ FluidUtils.getWater(1000),
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 1)},
+ new int[] {10000},
+ 120 * 20,
+ 80);
+ }
+
+ if (bioEth2 != null) {
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(18), ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1)
+ },
+ bioEth2,
+ FluidUtils.getWater(1000),
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 1)},
+ new int[] {10000},
+ 120 * 20,
+ 80);
+ }
+ }
+
+ public static void recipeCreateBenzene() {
+ // C7H8 + 2H = CH4 + C6H6
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellToluene", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2)
+ },
+ null,
+ null,
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellMethane", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellBenzene", 1),
+ Materials.Empty.getCells(1)
+ },
+ new int[] {10000, 10000, 10000},
+ 20 * 10,
+ 90);
+ }
+
+ public static void recipeCreateEthylbenzene() {
+ // C2H4 + C6H6 = C8H10
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellBenzene", 2),
+ null,
+ FluidUtils.getFluidStack("fluid.ethylbenzene", 2000),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 4),
+ 300);
+ }
+
+ public static void recipeCoalToCoalTar() {
+ // Charcoal
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 32L),
+ 8,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallDirt", 2),
+ FluidUtils.getFluidStack("fluid.coaltar", 800),
+ 15,
+ 120);
+ // Lignite
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 16L),
+ 8,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallDarkAsh", 2),
+ FluidUtils.getFluidStack("fluid.coaltar", 800),
+ 45,
+ 60);
+
+ // Coal
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 12L),
+ 8,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallDarkAsh", 2),
+ FluidUtils.getFluidStack("fluid.coaltar", 2200),
+ 30,
+ 120);
+
+ // Coke
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(
+ ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 8),
+ 8,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallAsh", 3),
+ FluidUtils.getFluidStack("fluid.coaltar", 3400),
+ 15,
+ 240);
+ }
+
+ private static void recipeCoalTarToCoalTarOil() {
+ // v - Distill (60% Tar oil/15% Naphtha/20% Ethylbenzene/5% Anthracene)
+ // Create Coal Tar Oil
+ // FluidUtils.generateFluidNonMolten("CoalTarOil", "Coal Tar Oil", 240, new short[]{240, 240, 150, 100}, null,
+ // null);
+ GT_Values.RA.addDistilleryRecipe(
+ CI.getNumberedCircuit(1), // Circuit
+ FluidUtils.getFluidStack("fluid.coaltar", 1000), // aInput
+ FluidUtils.getFluidStack("fluid.coaltaroil", 600), // aOutput
+ 600, // aDuration
+ 64, // aEUt
+ false // Hidden?
+ );
+ GT_Values.RA.addDistilleryRecipe(
+ CI.getNumberedCircuit(2), // Circuit
+ FluidUtils.getFluidStack("fluid.coaltar", 1000), // aInput
+ FluidUtils.getFluidStack("liquid_naphtha", 150), // aOutput
+ 300, // aDuration
+ 30, // aEUt
+ false // Hidden?
+ );
+ GT_Values.RA.addDistilleryRecipe(
+ CI.getNumberedCircuit(3), // Circuit
+ FluidUtils.getFluidStack("fluid.coaltar", 1000), // aInput
+ FluidUtils.getFluidStack("fluid.ethylbenzene", 200), // aOutput
+ 450, // aDuration
+ 86, // aEUt
+ false // Hidden?
+ );
+ GT_Values.RA.addDistilleryRecipe(
+ CI.getNumberedCircuit(4), // Circuit
+ FluidUtils.getFluidStack("fluid.coaltar", 1000), // aInput
+ FluidUtils.getFluidStack("fluid.anthracene", 50), // aOutput
+ 900, // aDuration
+ 30, // aEUt
+ false // Hidden?
+ );
+ GT_Values.RA.addDistilleryRecipe(
+ CI.getNumberedCircuit(5), // Circuit
+ FluidUtils.getFluidStack("fluid.coaltar", 1500), // aInput
+ FluidUtils.getFluidStack("fluid.kerosene", 600), // aOutput
+ 300, // aDuration
+ 64, // aEUt
+ false // Hidden?
+ );
+
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("fluid.coaltar", 1200),
+ new FluidStack[] {
+ FluidUtils.getFluidStack("fluid.coaltaroil", 500), // aOutput
+ FluidUtils.getFluidStack("liquid_naphtha", 100), // aOutput
+ FluidUtils.getFluidStack("fluid.ethylbenzene", 150), // aOutput
+ FluidUtils.getFluidStack("fluid.anthracene", 50), // aOutput
+ FluidUtils.getFluidStack("fluid.kerosene", 400), // aOutput
+ },
+ null,
+ 900,
+ 60);
+ }
+
+ private static void recipeCoalTarOilToSulfuricOilToNaphthalene() {
+ // SulfuricCoalTarOil
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellCoalTarOil", 8),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 8),
+ null,
+ null,
+ ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricCoalTarOil", 16),
+ 20 * 16);
+ GT_Values.RA.addDistilleryRecipe(
+ CI.getNumberedCircuit(6), // Circuit
+ FluidUtils.getFluidStack("fluid.sulfuriccoaltaroil", 1000), // aInput
+ FluidUtils.getFluidStack("fluid.naphthalene", 1000), // aOutput
+ 1200, // aDuration
+ 30, // aEUt
+ false // Hidden?
+ );
+ }
+
+ private static void recipeNaphthaleneToPhthalicAcid() {
+ // SulfuricCoalTarOil
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellNaphthalene", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 5),
+ null,
+ FluidUtils.getFluidStack("fluid.phthalicacid", 2500),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2),
+ 20 * 16);
+ }
+
+ private static void recipePhthalicAcidToPhthalicAnhydride() {
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedBioCircuit(15)},
+ FluidUtils.getFluidStack("fluid.phthalicacid", 1000),
+ null,
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 15)},
+ new int[] {10000},
+ 60 * 20,
+ 120);
+ }
+
+ @Override
+ public String errorMessage() {
+ return "Bad Coal Science!";
+ }
+
+ @Override
+ public boolean generateRecipes() {
+ recipeCreateEthylene();
+ recipeCreateBenzene();
+ recipeCreateEthylbenzene();
+
+ recipeCoalToCoalTar();
+ recipeCoalTarToCoalTarOil();
+ recipeCoalTarOilToSulfuricOilToNaphthalene();
+ recipeNaphthaleneToPhthalicAcid();
+ recipePhthalicAcidToPhthalicAnhydride();
+
+ recipeEthylBenzineFuelsIntoHeavyFuel();
+
+ recipePhthalicAcidConversion();
+
+ // Burn the coal gas!
+ GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1);
+ CORE.RA.addSemifluidFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricCoalTarOil", 1), 64);
+ CORE.RA.addSemifluidFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalTarOil", 1), 32);
+ CORE.RA.addSemifluidFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalTar", 1), 16);
+
+ return true;
+ }
+
+ private void recipePhthalicAcidConversion() {
+ FluidStack aMyAcid = FluidUtils.getFluidStack(Phthalic_Acid, 500);
+ FluidStack aGtAcid = FluidUtils.getFluidStack("phtalicacid", 500);
+ if (aMyAcid != null && aGtAcid != null) {
+ CORE.RA.addDistilleryRecipe(CI.getNumberedBioCircuit(8), aMyAcid, aGtAcid, null, 50, 16, false);
+ CORE.RA.addDistilleryRecipe(CI.getNumberedBioCircuit(9), aGtAcid, aMyAcid, null, 50, 16, false);
+ }
+ }
+
+ @Override
+ public void items() {
+ // Phthalic_Acid = FluidUtils.generateFluidNonMolten("PhthalicAcid", "Phthalic Acid", 207, new short[]{210, 220,
+ // 210, 100}, null, null);
+ // v - Dehydrate at 180C+
+ // Create Phthalic Anhydride
+ ItemUtils.generateSpecialUseDusts(
+ "PhthalicAnhydride", "Phthalic Anhydride", "C6H4(CO)2O", Utils.rgbtoHexValue(175, 175, 175));
+
+ // Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O
+ ItemUtils.generateSpecialUseDusts(
+ "LithiumHydroperoxide", "Lithium Hydroperoxide", "HLiO2", Utils.rgbtoHexValue(125, 125, 125));
+ // v - Dehydrate
+ // Lithium Peroxide - 2 LiOOH → Li2O2 + H2O2 + 2 H2O
+ // Lithium_Peroxide = FluidUtils.generateFluidNonMolten("LithiumPeroxide", "Lithium Peroxide", 446, new
+ // short[]{135, 135, 135, 100}, null, null);
+ }
+
+ @Override
+ public void blocks() {}
+
+ @Override
+ public void fluids() {
+
+ // Create Coal Gas
+ Coal_Gas = FluidUtils.generateFluidNonMolten(
+ "CoalGas", "Coal Gas", 500, new short[] {48, 48, 48, 100}, null, null);
+ // Ethanol
+ // v - Dehydrate cells to remove water
+
+ // Create Ethylene
+ if (!FluidUtils.doesFluidExist("ethylene")) {
+ Ethylene = FluidUtils.generateFluidNonMolten(
+ "ethylene", "Ethylene", -103, new short[] {255, 255, 255, 100}, null, null);
+ } else {
+ Ethylene = FluidUtils.getWildcardFluidStack("ethylene", 1).getFluid();
+ }
+
+ // Create Ethylbenzene - Ethylbenzene is produced in on a large scale by combining benzene and ethylene in an
+ // acid-catalyzed chemical reaction
+ // Use Chemical Reactor
+ Ethylbenzene = FluidUtils.generateFluidNonMolten(
+ "Ethylbenzene", "Ethylbenzene", 136, new short[] {255, 255, 255, 100}, null, null);
+ // Create Anthracene
+ Anthracene = FluidUtils.generateFluidNonMolten(
+ "Anthracene", "Anthracene", 340, new short[] {255, 255, 255, 100}, null, null);
+ // Toluene
+ if (!FluidUtils.doesFluidExist("liquid_toluene")) {
+ Toluene = FluidUtils.generateFluidNonMolten(
+ "liquid_toluene", "Toluene", -95, new short[] {140, 70, 20, 100}, null, null);
+ } else {
+ Toluene = FluidUtils.getWildcardFluidStack("liquid_toluene", 1).getFluid();
+ }
+
+ // Create Coal Tar
+ Coal_Tar = FluidUtils.generateFluidNonMolten(
+ "CoalTar", "Coal Tar", 450, new short[] {32, 32, 32, 100}, null, null);
+ // v - Distill (60% Tar oil/15% Naphtha/20% Ethylbenzene/5% Anthracene)
+ // Create Coal Tar Oil
+ Coal_Tar_Oil = FluidUtils.generateFluidNonMolten(
+ "CoalTarOil", "Coal Tar Oil", 240, new short[] {240, 240, 150, 100}, null, null);
+ // v - Wash With Sulfuric Acid
+ // Create Sulfuric Coal Tar Oil
+ Sulfuric_Coal_Tar_Oil = FluidUtils.generateFluidNonMolten(
+ "SulfuricCoalTarOil", "Sulfuric Coal Tar Oil", 240, new short[] {250, 170, 12, 100}, null, null);
+ // v - Distill (No loss, just time consuming)
+ // Create Naphthalene
+ Naphthalene = FluidUtils.generateFluidNonMolten(
+ "Naphthalene", "Naphthalene", 115, new short[] {210, 185, 135, 100}, null, null);
+ // v - Oxidize with mercury and nitric acid
+ // Create Phthalic Acid
+ Phthalic_Acid = FluidUtils.generateFluidNonMolten(
+ "PhthalicAcid", "Phthalic Acid", 207, new short[] {210, 220, 210, 100}, null, null);
+ // v - Dehydrate at 180C+
+ // Create Phthalic Anhydride
+ // ItemUtils.generateSpecialUseDusts("PhthalicAnhydride", "Phthalic Anhydride", "C6H4(CO)2O",
+ // Utils.rgbtoHexValue(175, 175, 175));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java
index 66e3949aed..e8069b8903 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java
@@ -24,1149 +24,1225 @@ import net.minecraftforge.fluids.*;
public class GenericChem extends ItemPackage {
- /**
- * Switches
- */
-
- private static boolean usingGregtechNitricOxide = false;
- private static boolean usingGregtechNitrogenDioxide = false;
- private static boolean usingGregtechHydricSulfur = false;
-
- /**
- * Materials
- */
-
- //public static final Material BAKELITE = new Material("Bakelite", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{90, 140, 140}, 120, 240, 23, 24, true, null, 0);//Not a GT Inherited Material
- //public static final Material NYLON = new Material("Nylon", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{45, 45, 45}, 300, 600, 44, 48, true, null, 0);//Not a GT Inherited Material
- //public static final Material CARBYNE = new Material("Carbyne", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{25, 25, 25}, 2500, 5000, 63, 52, true, null, 0);//Not a GT Inherited Material
-
-
- //Refined PTFE
- public static final Material TEFLON = new Material(
- "Teflon",
- MaterialState.SOLID,
- TextureSet.SET_SHINY,
- new short[] { 75, 45, 75 },
- 330, 640,
- -1, -1,
- false,
- null,
- 0,
- new MaterialStack(NONMATERIAL.PTFE, 75),
- new MaterialStack(NONMATERIAL.PLASTIC, 15),
- new MaterialStack(ELEMENT.getInstance().CARBON, 5),
- new MaterialStack(ELEMENT.getInstance().SODIUM, 5));
-
- /**
- * Fluids
- */
-
- public static Fluid Benzene;
- public static Fluid NitroBenzene;
- public static Fluid Aniline;
- public static Fluid Polyurethane;
- public static Fluid Phenol; //https://en.wikipedia.org/wiki/Phenol#Uses
- public static Fluid Cyclohexane; //https://en.wikipedia.org/wiki/Cyclohexane
- public static Fluid Cyclohexanone; //https://en.wikipedia.org/wiki/Cyclohexanone
- public static Fluid Cadaverine; //https://en.wikipedia.org/wiki/Cadaverine
- public static Fluid Putrescine; //https://en.wikipedia.org/wiki/Putrescine
- public static Fluid BoricAcid;
- public static Fluid HydrochloricAcid;
-
-
- public static Fluid Ethylanthraquinone2;
- public static Fluid Ethylanthrahydroquinone2;
- public static Fluid Hydrogen_Peroxide;
- public static Fluid Lithium_Peroxide;
- public static Fluid Nitric_Oxide;
- public static Fluid Nitrogen_Dioxide;
- public static Fluid Carbon_Disulfide;
- public static Fluid Hydrogen_Sulfide;
-
- /**
- * Items
- */
-
- // Phenol Byproducts
- public Item PhenolicResins; //https://en.wikipedia.org/wiki/Phenol_formaldehyde_resin
- public static ItemGenericChemBase mGenericChemItem1;
- public static Item mAdvancedCircuit;
-
- private ItemStack mCatalystCarrier;
-
- public static ItemStack mRedCatalyst;
- public static ItemStack mYellowCatalyst;
- public static ItemStack mBlueCatalyst;
- public static ItemStack mOrangeCatalyst;
- public static ItemStack mPurpleCatalyst;
- public static ItemStack mBrownCatalyst;
- public static ItemStack mPinkCatalyst;
- public static ItemStack mFormaldehydeCatalyst;
- public static ItemStack mSolidAcidCatalyst;
- public static ItemStack mInfiniteMutationCatalyst;
-
- public static ItemStack mMillingBallAlumina;
- public static ItemStack mMillingBallSoapstone;
-
- public static ItemStack mSodiumEthoxide;
- public static ItemStack mSodiumEthylXanthate;
- public static ItemStack mPotassiumEthylXanthate;
- public static ItemStack mPotassiumHydroxide;
-
-
-
- @Override
- public void items() {
- PhenolicResins = ItemUtils.generateSpecialUseDusts("phenolicresins", "Phenolic Resin", "HOC6H4CH2OH", Utils.rgbtoHexValue(80, 40, 40))[0];
- //MaterialGenerator.generate(BAKELITE, false);
- //MaterialGenerator.generate(NYLON, false);
- MaterialGenerator.generate(TEFLON, false);
-
- mGenericChemItem1 = new ItemGenericChemBase();
- mAdvancedCircuit = new ItemAdvancedChip();
- GregtechItemList.Circuit_T3RecipeSelector.set(mAdvancedCircuit);
-
- registerItemStacks();
- registerOreDict();
-
- GregtechItemList.Milling_Ball_Alumina.set(mMillingBallAlumina);
- GregtechItemList.Milling_Ball_Soapstone.set(mMillingBallSoapstone);
-
- }
-
-
- public void registerItemStacks() {
-
- mCatalystCarrier = ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 13, 1);
-
- mRedCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 0, 1);
- mYellowCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 1, 1);
- mBlueCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 2, 1);
- mOrangeCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 3, 1);
- mPurpleCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 4, 1);
- mBrownCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 5, 1);
- mPinkCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 6, 1);
- mMillingBallAlumina = ItemUtils.simpleMetaStack(mGenericChemItem1, 7, 1);
- mMillingBallSoapstone = ItemUtils.simpleMetaStack(mGenericChemItem1, 8, 1);
- mSodiumEthoxide = ItemUtils.simpleMetaStack(mGenericChemItem1, 9, 1);
- mSodiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 10, 1);
- mPotassiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 11, 1);
- mPotassiumHydroxide = ItemUtils.simpleMetaStack(mGenericChemItem1, 12, 1);
- mFormaldehydeCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 13, 1);
- mSolidAcidCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 14, 1);
- mInfiniteMutationCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 15, 1);
-
-
- }
-
- public void registerOreDict() {
-
- ItemUtils.addItemToOreDictionary(mRedCatalyst, "catalystIronCopper");
- ItemUtils.addItemToOreDictionary(mYellowCatalyst, "catalystTungstenNickel");
- ItemUtils.addItemToOreDictionary(mBlueCatalyst, "catalystCobaltTitanium");
- ItemUtils.addItemToOreDictionary(mOrangeCatalyst, "catalystVanadiumPalladium");
- ItemUtils.addItemToOreDictionary(mPurpleCatalyst, "catalystIridiumRuthenium");
- ItemUtils.addItemToOreDictionary(mBrownCatalyst, "catalystNickelAluminium");
- ItemUtils.addItemToOreDictionary(mPinkCatalyst, "catalystPlatinumRhodium");
- ItemUtils.addItemToOreDictionary(mMillingBallAlumina, "millingballAlumina");
- ItemUtils.addItemToOreDictionary(mMillingBallSoapstone, "millingballSoapstone");
- ItemUtils.addItemToOreDictionary(mSodiumEthoxide, "dustSodiumEthoxide");
- ItemUtils.addItemToOreDictionary(mSodiumEthylXanthate, "dustSodiumEthylXanthate");
- ItemUtils.addItemToOreDictionary(mPotassiumEthylXanthate, "dustPotassiumEthylXanthate");
- ItemUtils.addItemToOreDictionary(mPotassiumHydroxide, "dustPotassiumHydroxide");
- ItemUtils.addItemToOreDictionary(mFormaldehydeCatalyst, "catalystFormaldehyde");
- ItemUtils.addItemToOreDictionary(mSolidAcidCatalyst, "catalystSolidAcid");
- ItemUtils.addItemToOreDictionary(mInfiniteMutationCatalyst, "catalystInfiniteMutation");
-
- }
-
- @Override
- public void blocks() {}
-
- @Override
- public void fluids() {
-
- if (!FluidRegistry.isFluidRegistered("benzene")) {
- Benzene = FluidUtils.generateFluidNoPrefix("benzene", "Benzene", 278, new short[] { 100, 70, 30, 100 }, true);
- }
- else {
- Benzene = FluidRegistry.getFluid("benzene");
- }
-
- NitroBenzene = FluidUtils.generateFluidNoPrefix("nitrobenzene", "Nitrobenzene", 278, new short[] { 70, 50, 40, 100 }, true);
-
- Aniline = FluidUtils.generateFluidNoPrefix("aniline", "Aniline", 266, new short[] { 100, 100, 30, 100 }, true);
-
- BoricAcid = FluidUtils.generateFluidNoPrefix("boricacid", "Boric Acid", 278, new short[] { 90, 30, 120, 100 }, true);
-
- Polyurethane = FluidUtils.generateFluidNoPrefix("polyurethane", "Polyurethane", 350, new short[] { 100, 70, 100, 100 }, true);
-
- if (!FluidRegistry.isFluidRegistered("phenol")) {
- Phenol = FluidUtils.generateFluidNoPrefix("phenol", "Phenol", 313, new short[] { 100, 70, 30, 100 }, true);
- }
- else {
- Phenol = FluidRegistry.getFluid("phenol");
- }
-
- // Use GT's if it exists, else make our own.
- if (FluidRegistry.isFluidRegistered("hydrochloricacid_gt5u")) {
- HydrochloricAcid = FluidRegistry.getFluid("hydrochloricacid_gt5u");
- }
- else {
- HydrochloricAcid = FluidUtils.generateFluidNoPrefix("hydrochloricacid", "Hydrochloric Acid", 285, new short[] { 183, 200, 196, 100 }, true);
- }
-
- Cyclohexane = FluidUtils.generateFluidNoPrefix("cyclohexane", "Cyclohexane", 32 + 175, new short[] { 100, 70, 30, 100 }, true);
- Cyclohexanone = FluidUtils.generateFluidNoPrefix("cyclohexanone", "Cyclohexanone", 32 + 175, new short[] { 100, 70, 30, 100 }, true);
-
- Cadaverine = FluidUtils.generateFluidNoPrefix("cadaverine", "Cadaverine", 32 + 175, new short[] { 100, 70, 30, 100 }, true);
- Putrescine = FluidUtils.generateFluidNoPrefix("putrescine", "Putrescine", 32 + 175, new short[] { 100, 70, 30, 100 }, true);
-
- //Create 2-Ethylanthraquinone
- //2-Ethylanthraquinone is prepared from the reaction of phthalic anhydride and ethylbenzene
- Ethylanthraquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthraquinone", "2-Ethylanthraquinone", 415, new short[]{227, 255, 159, 100}, null, null);
- //Create 2-Ethylanthrahydroquinone
- //Palladium plate + Hydrogen(250) + 2-Ethylanthraquinone(500) = 600 Ethylanthrahydroquinone
- Ethylanthrahydroquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthrahydroquinone", "2-Ethylanthrahydroquinone", 415, new short[]{207, 225, 129, 100}, null, null);
- //Create Hydrogen Peroxide
- //Compressed Air(1500) + Ethylanthrahydroquinone(500) + Anthracene(5) = 450 Ethylanthraquinone && 200 Peroxide
- Hydrogen_Peroxide = FluidUtils.generateFluidNonMolten("HydrogenPeroxide", "Hydrogen Peroxide", 150, new short[]{210, 255, 255, 100}, null, null);
-
- if (FluidRegistry.isFluidRegistered("nitricoxide")) {
- Nitric_Oxide = FluidRegistry.getFluid("nitricoxide");
- usingGregtechNitricOxide = true;
- }
- else {
- Nitric_Oxide = FluidUtils.generateFluidNoPrefix("nitricoxide", "Nitric Oxide", 200, new short[] {125, 200, 240, 100});
- }
- if (FluidRegistry.isFluidRegistered("nitrogendioxide")) {
- Nitrogen_Dioxide = FluidRegistry.getFluid("nitrogendioxide");
- usingGregtechNitrogenDioxide = true;
- }
- else {
- Nitrogen_Dioxide = FluidUtils.generateFluidNoPrefix("nitrogendioxide", "Nitrogen Dioxide", 200, new short[] {100, 175, 255, 100});
- }
-
-
-
- //Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O
- //ItemUtils.generateSpecialUseDusts("LithiumHydroperoxide", "Lithium Hydroperoxide", "HLiO2", Utils.rgbtoHexValue(125, 125, 125));
- // v - Dehydrate
- //Lithium Peroxide - 2 LiOOH → Li2O2 + H2O2 + 2 H2O
- Lithium_Peroxide = FluidUtils.generateFluidNonMolten("LithiumPeroxide", "Lithium Peroxide", 446, new short[]{135, 135, 135, 100}, null, null);
-
- Carbon_Disulfide = FluidUtils.generateFluidNoPrefix("CarbonDisulfide", "Carbon Disulfide", 350, new short[]{175, 175, 175, 100});
-
- if (FluidRegistry.isFluidRegistered("fluid.liquid_hydricsulfur") || MaterialUtils.doesMaterialExist("HydricSulfide")) {
- usingGregtechHydricSulfur = true;
- Fluid aFluid = null;
- if (ItemUtils.doesItemListEntryExist("sHydricSulfur")) {
- ItemStack aListItem = ItemUtils.getValueOfItemList("sHydricSulfur", 1, (ItemList) null);
- if (aListItem != null) {
- FluidStack aFluidStack = FluidContainerRegistry.getFluidForFilledItem(aListItem);
- if (aFluidStack != null) {
- aFluid = aFluidStack.getFluid();
- }
-
- }
- }
- if (aFluid == null) {
- aFluid = FluidUtils.getWildcardFluidStack("liquid_hydricsulfur", 1000).getFluid();
- }
- Hydrogen_Sulfide = aFluid;
- }
- else {
- Hydrogen_Sulfide = FluidUtils.generateFluidNoPrefix("HydrogenSulfide", "Hydrogen Sulfide", 446, new short[]{240, 130, 30, 100});
- }
-
- }
-
- @Override
- public String errorMessage() {
- return "Failed to generate recipes for GenericChem.";
- }
-
- @Override
- public boolean generateRecipes() {
-
- recipeAdvancedChip();
- recipeCatalystRed();
- recipeCatalystYellow();
- recipeCatalystBlue();
- recipeCatalystOrange();
- recipeCatalystPurple();
- recipeCatalystBrown();
- recipeCatalystPink();
- recipeCatalystFormaldehyde();
- recipeCatalystSolidAcid();
- recipeCatalystInfiniteMutation();
-
- recipeGrindingBallAlumina();
- recipeGrindingBallSoapstone();
-
- recipeNitroBenzene();
- recipeAniline();
- recipeCadaverineAndPutrescine();
- recipeCyclohexane();
- recipeCyclohexanone();
-
- recipe2Ethylanthraquinone();
- recipe2Ethylanthrahydroquinone();
- recipeHydrogenPeroxide();
- recipeLithiumHydroperoxide();
- recipeLithiumPeroxide();
- //The follow is using alk science, ignore them
- if (!usingGregtechNitricOxide) {
- recipeNitricOxide();
- }
- if (!usingGregtechNitrogenDioxide) {
- recipeNitrogenDioxide();
- }
- if (!usingGregtechHydricSulfur) {
- recipeHydricSulfur();
- }
-
- // Add recipes if we are not using GT's fluid.
- if (!FluidRegistry.isFluidRegistered("hydrochloricacid_gt5u")) {
- recipeHydrochloricAcid();
- }
-
- recipeSodiumEthoxide();
- recipeCarbonDisulfide();
- recipeEthylXanthates();
- recipePotassiumHydroxide();
-
- recipeMutatedLivingSolder();
-
- registerFuels();
-
- return true;
- }
-
-
- private void recipeSodiumEthoxide() {
- //C2H5OH + Na → C2H5ONa + H
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(16),
- ELEMENT.getInstance().SODIUM.getDust(1)
- },
- new FluidStack[] {
- Materials.Ethanol.getFluid(1000)
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(mSodiumEthoxide, 9)
- },
- new FluidStack[] {
- ELEMENT.getInstance().HYDROGEN.getFluidStack(1000)
- },
- 20 *20,
- 120,
- 2);
- }
-
- private void recipePotassiumHydroxide() {
- //Ca(OH)2 + K2O + CO2 → CaCO3 + 2 KOH
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(18),
- Materials.Potash.getDust(3),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5),
- },
- new FluidStack[] {
- Materials.CarbonDioxide.getGas(1000)
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 5),
- ItemUtils.getSimpleStack(mPotassiumHydroxide, 6)
-
- },
- new FluidStack[] {
-
- },
- 20 *30,
- 120,
- 2);
-
- }
-
-
- private void recipeEthylXanthates() {
-
- //Potassium ethyl xanthate - CH3CH2OH + CS2 + KOH → C3H5KOS2 + H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(17),
- ItemUtils.getSimpleStack(mPotassiumHydroxide, 3),
- },
- new FluidStack[] {
- Materials.Ethanol.getFluid(1000),
- FluidUtils.getFluidStack(Carbon_Disulfide, 1000),
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(mPotassiumEthylXanthate, 12)
- },
- new FluidStack[] {
- FluidUtils.getWater(1000)
- },
- 20 *60,
- 120,
- 4);
-
- //Sodium ethyl xanthate - CH3CH2ONa + CS2 → CH3CH2OCS2Na
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(17),
- ItemUtils.getSimpleStack(mSodiumEthoxide, 9)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Carbon_Disulfide, 1000),
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(mSodiumEthylXanthate, 12)
- },
- new FluidStack[] {
-
- },
- 20 *60,
- 120,
- 4);
-
- }
-
- //The follow is using alk science, ignore them
- private void recipeHydricSulfur() {
-
- ItemStack aCellHydricSulfide = ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenSulfide", 1);
- GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().SULFUR.getDust(1), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().HYDROGEN.getFluidStack(2000), FluidUtils.getFluidStack(Hydrogen_Sulfide, 3000), GT_Values.NI, 60, 8);
- GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().SULFUR.getDust(1), CI.emptyCells(3), ELEMENT.getInstance().HYDROGEN.getFluidStack(2000), GT_Values.NF, ItemUtils.getSimpleStack(aCellHydricSulfide, 3), GT_Values.NI, 60, 8);
-
- }
-
-
- private void recipeCarbonDisulfide() {
-
- CORE.RA.addBlastRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 8),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 16)
- },
- new FluidStack[] {
-
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustDarkAsh", 1)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Carbon_Disulfide, 4000)
- },
- 20 *60 * 10,
- 30,
- 1500);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(20),
- ItemUtils.getSimpleStack(mBrownCatalyst, 0),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 4)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(CoalTar.Coal_Gas, 1000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Carbon_Disulfide, 2000)
- },
- 20 *60 * 5,
- 30,
- 2);
- }
-
- private void recipeMutatedLivingSolder() {
-
- //Endgame soldering alloy meant for the bioware circuit line and beyond.
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- ItemUtils.getSimpleStack(GenericChem.mInfiniteMutationCatalyst, 0),
- ItemList.Circuit_Chip_Biocell.get(64),
- ItemList.Gravistar.get(8),
- Materials.InfinityCatalyst.getDust(2)
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("plasma.tin", 18000),
- FluidUtils.getFluidStack("plasma.bismuth", 18000),
- FluidUtils.getFluidStack("cryotheum", 4000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 280)
- },
- 20*800,
- 3842160,
- 7);
-
- }
-
-
- private static void registerFuels() {
-
- // Burnables
-
- // Gas Fuels
- GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellNitrobenzene", 1), null, 1600, 1);
-
- }
-
- private void recipeGrindingBallAlumina() {
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- CI.getNumberedCircuit(10),
- ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 64)
- },
- FluidUtils.getFluidStack(GenericChem.Aniline, 4000),
- ItemUtils.getSimpleStack(mMillingBallAlumina, 8),
- 180 * 20,
- 480);
- }
- private void recipeGrindingBallSoapstone() {
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- CI.getNumberedCircuit(10),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSoapstone", 32)
- },
- FluidUtils.getFluidStack(AgrichemFluids.mLiquidResin, 2500),
- ItemUtils.getSimpleStack(mMillingBallSoapstone, 8),
- 120 * 20,
- 480);
- }
-
- //The follow is using alk science, ignore them
- private void recipeNitrogenDioxide() {
- ItemStack aNitricOxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitricOxide", 1);
- ItemStack aNitrogenDioxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitrogenDioxide", 1);
- GT_Values.RA.addChemicalRecipe( ItemUtils.getSimpleStack(aNitricOxideCell, 2), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().OXYGEN.getFluidStack(1000), FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000), CI.emptyCells(2), 160);
- GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(1), GT_Utility.getIntegratedCircuit(1), FluidUtils.getFluidStack(Nitric_Oxide, 2000), FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000), CI.emptyCells(1), 160);
- GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ItemUtils.getSimpleStack(aNitricOxideCell, 2), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluidStack(1000), GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30);
- GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().OXYGEN.getCell(1), CI.emptyCells(2), FluidUtils.getFluidStack(Nitric_Oxide, 2000), GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30);
- GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ItemUtils.getSimpleStack(aNitricOxideCell, 2), ELEMENT.getInstance().OXYGEN.getCell(1), GT_Values.NF, GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30);
- }
-
- //The follow is using alk science, ignore them
- private void recipeNitricOxide() {
- ItemStack aWaterCell = ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1);
- ItemStack aNitricOxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitricOxide", 1);
- GT_Values.RA.addChemicalRecipeForBasicMachineOnly(MISC_MATERIALS.AMMONIA.getCell(8), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30);
- GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().OXYGEN.getCell(5), CI.emptyCells(4), MISC_MATERIALS.AMMONIA.getFluidStack(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30);
- GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(11), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160);
- GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(11), MISC_MATERIALS.AMMONIA.getFluidStack(8000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160);
- GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(2), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(8), 320);
- GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(2), MISC_MATERIALS.AMMONIA.getFluidStack(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(5), 320);
- GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(12), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160);
- GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(12), MISC_MATERIALS.AMMONIA.getFluidStack(8000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160);
- GT_Values.RA.addChemicalRecipeForBasicMachineOnly(MISC_MATERIALS.AMMONIA.getCell(8), ELEMENT.getInstance().OXYGEN.getCell(5), GT_Values.NF, GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), ItemUtils.getSimpleStack(aWaterCell, 9), 160, 30);
- GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{MISC_MATERIALS.AMMONIA.getFluidStack(8000), ELEMENT.getInstance().OXYGEN.getFluidStack(5000)}, new FluidStack[]{FluidUtils.getFluidStack(Nitric_Oxide, 4000), FluidUtils.getWater(9000)}, null, 160, 30);
- }
-
- //The follow is using alk science, ignore them
- private void recipeHydrochloricAcid() {
-
- ItemStack aAcidCell = ItemUtils.getItemStackOfAmountFromOreDict("cellHydrochloricAcid", 1);
-
- CORE.RA.addChemicalRecipe(
- ELEMENT.getInstance().CHLORINE.getCell(1),
- GT_Utility.getIntegratedCircuit(1),
- ELEMENT.getInstance().HYDROGEN.getFluidStack(1000),
- FluidUtils.getFluidStack(HydrochloricAcid, 2000),
- CI.emptyCells(1),
- 60,
- 8);
-
- CORE.RA.addChemicalRecipe(
- ELEMENT.getInstance().HYDROGEN.getCell(1),
- GT_Utility.getIntegratedCircuit(1),
- ELEMENT.getInstance().CHLORINE.getFluidStack(1000),
- FluidUtils.getFluidStack(HydrochloricAcid, 2000),
- CI.emptyCells(1),
- 60,
- 8);
-
- GT_Values.RA.addElectrolyzerRecipe(
- CI.emptyCells(1),
- GT_Utility.getIntegratedCircuit(1),
- FluidUtils.getFluidStack(HydrochloricAcid, 2000),
- ELEMENT.getInstance().CHLORINE.getFluidStack(1000),
- ELEMENT.getInstance().HYDROGEN.getCell(1),
- GT_Values.NI,
- GT_Values.NI,
- GT_Values.NI,
- GT_Values.NI,
- GT_Values.NI,
- null,
- 720,
- 30);
-
- GT_Values.RA.addElectrolyzerRecipe(
- CI.emptyCells(1),
- GT_Utility.getIntegratedCircuit(11),
- FluidUtils.getFluidStack(HydrochloricAcid, 2000),
- ELEMENT.getInstance().HYDROGEN.getFluidStack(1000),
- ELEMENT.getInstance().CHLORINE.getCell(1),
- GT_Values.NI,
- GT_Values.NI,
- GT_Values.NI,
- GT_Values.NI,
- GT_Values.NI,
- null,
- 720,
- 30);
-
- GT_Values.RA.addElectrolyzerRecipe(
- ItemUtils.getSimpleStack(aAcidCell, 2),
- GT_Values.NI,
- GT_Values.NF,
- GT_Values.NF,
- ELEMENT.getInstance().HYDROGEN.getCell(1),
- ELEMENT.getInstance().CHLORINE.getCell(1),
- GT_Values.NI,
- GT_Values.NI,
- GT_Values.NI,
- GT_Values.NI,
- null,
- 720,
- 30);
- }
-
- private void recipeCyclohexane() {
-
- //C6H6 + 6H = C6H12
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getTierTwoChip(),
- ItemUtils.getSimpleStack(mBrownCatalyst, 0)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Benzene, 1000),
- FluidUtils.getFluidStack("hydrogen", 6000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Cyclohexane, 1000),
- },
- 20 * 120,
- 120,
- 2);
-
- }
-
- private void recipeCyclohexanone() {
-
- //C6H12 + 2O(Air) = C6H10O + H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getTierTwoChip(),
- ItemUtils.getSimpleStack(mBlueCatalyst, 0)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Cyclohexane, 1000),
- FluidUtils.getFluidStack("air", 4000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Cyclohexanone, 1000),
- },
- 20 * 120,
- 120,
- 2);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getTierTwoChip(),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Cyclohexane, 1000),
- FluidUtils.getFluidStack("oxygen", 2000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Cyclohexanone, 1000),
- },
- 20 * 120,
- 120,
- 2);
-
- }
-
- private void recipeCatalystRed() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierOneChip(),
- CI.getEmptyCatalyst(10),
- ELEMENT.getInstance().IRON.getDust(2),
- ELEMENT.getInstance().COPPER.getDust(2),
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(mRedCatalyst, 10),
- 20 * 20,
- 30);
-
- }
-
- private void recipeCatalystYellow() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierThreeChip(),
- CI.getEmptyCatalyst(10),
- ELEMENT.getInstance().TUNGSTEN.getDust(4),
- ELEMENT.getInstance().NICKEL.getDust(4),
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(mYellowCatalyst, 10),
- 60 * 20,
- 2000);
-
- }
-
- private void recipeCatalystBlue() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierTwoChip(),
- CI.getEmptyCatalyst(10),
- ELEMENT.getInstance().COBALT.getDust(3),
- ELEMENT.getInstance().TITANIUM.getDust(3),
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(mBlueCatalyst, 10),
- 40 * 20,
- 500);
-
- }
-
- private void recipeCatalystOrange() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierTwoChip(),
- CI.getEmptyCatalyst(10),
- ELEMENT.getInstance().VANADIUM.getDust(5),
- ELEMENT.getInstance().PALLADIUM.getDust(5),
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(mOrangeCatalyst, 10),
- 40 * 20,
- 500);
-
- }
-
- private void recipeCatalystPurple() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierFourChip(),
- CI.getEmptyCatalyst(10),
- ELEMENT.getInstance().IRIDIUM.getDust(6),
- ELEMENT.getInstance().RUTHENIUM.getDust(6),
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(mPurpleCatalyst, 10),
- 120 * 20,
- 8000);
-
- }
-
- private void recipeCatalystBrown() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierOneChip(),
- CI.getEmptyCatalyst(10),
- ELEMENT.getInstance().NICKEL.getDust(4),
- ELEMENT.getInstance().ALUMINIUM.getDust(4),
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(mBrownCatalyst, 10),
- 15 * 20,
- 30);
-
- }
-
- private void recipeCatalystPink() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierThreeChip(),
- CI.getEmptyCatalyst(10),
- ELEMENT.getInstance().PLATINUM.getDust(4),
- ELEMENT.getInstance().RHODIUM.getDust(4),
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(mPinkCatalyst, 10),
- 30 * 20,
- 2000);
-
- }
-
- private void recipeCatalystFormaldehyde() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierThreeChip(),
- CI.getEmptyCatalyst(4),
- ItemUtils.getSimpleStack(RocketFuels.Formaldehyde_Catalyst_Dust, 8)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(mFormaldehydeCatalyst, 4),
- 30 * 20,
- 240);
-
- }
-
- private void recipeCatalystSolidAcid() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierThreeChip(),
- CI.getEmptyCatalyst(5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLapis", 2)
- },
- MISC_MATERIALS.SOLID_ACID_MIXTURE.getFluidStack(1000),
- ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 5),
- 30 * 20,
- 2000);
-
- }
-
- private void recipeCatalystInfiniteMutation() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getTierThreeChip(),
- CI.getEmptyCatalyst(5),
- Materials.Infinity.getDust(1),
- Materials.Naquadria.getDust(10)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(GenericChem.mInfiniteMutationCatalyst, 1),
- 5 * 20,
- 1966080);
-
- }
-
- private void recipeCadaverineAndPutrescine() {
-
- // Basic Recipe
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getTierOneChip(),
- ItemUtils.getSimpleStack(Items.rotten_flesh, 64)
- },
- new FluidStack[] {
- FluidUtils.getHotWater(2000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Cadaverine, 250),
- FluidUtils.getFluidStack(Putrescine, 250),
- },
- 20 * 120,
- 120,
- 1);
-
- // Advanced Recipe
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getTierTwoChip(),
- ItemUtils.getSimpleStack(Items.rotten_flesh, 128),
- ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 8, 32)
- },
- new FluidStack[] {
- FluidUtils.getHotWater(3000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Cadaverine, 750),
- FluidUtils.getFluidStack(Putrescine, 750),
- },
- 20 * 120,
- 240,
- 2);
-
- }
-
- private void recipeAniline() {
-
- //C6H5NO2 + 6H = C6H7N + 2H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getTierThreeChip(),
- ItemUtils.getSimpleStack(mBlueCatalyst, 0)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(NitroBenzene, 1000),
- FluidUtils.getFluidStack("hydrogen", 6000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Aniline, 1000),
- },
- 20 * 30,
- 500,
- 3);
-
- }
-
- private void recipeNitroBenzene() {
-
- //C6H6 + HNO3 =H2SO4= C6H5NO2 +H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getTierThreeChip(),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Benzene, 5000),
- FluidUtils.getFluidStack("sulfuricacid", 3000),
- FluidUtils.getFluidStack("nitricacid", 5000),
- FluidUtils.getDistilledWater(10000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("dilutedsulfuricacid", 3000),
- FluidUtils.getFluidStack(NitroBenzene, 5000),
- },
- 20 * 30,
- 500,
- 4);
-
- }
-
- private void recipe2Ethylanthraquinone() {
-
- //C6H4(CO)2O + C6H5CH2CH3 = C6H4(CO)2C6H3CH2CH3 + H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(4),
- ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 15),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(CoalTar.Ethylbenzene, 1000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Ethylanthraquinone2, 1000),
- },
- 20 * 15,
- 120,
- 2);
- }
-
- private void recipe2Ethylanthrahydroquinone() {
-
- //C6H4(CO)2C6H3CH2CH3 + 2H = C6H4(COH)2C6H3CH2CH3
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(4),
- ItemUtils.getSimpleStack(mOrangeCatalyst, 0),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Ethylanthraquinone2, 1000),
- FluidUtils.getFluidStack("hydrogen", 2000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 1000),
- },
- 20 * 40,
- 120,
- 2);
- }
-
- private void recipeLithiumPeroxide() {
- //2HLiO2 = Li2O2 + H2O2
- CORE.RA.addDehydratorRecipe(
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 8),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1)
- },
- null,
- null,
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumPeroxide", 4),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1),
- },
- new int[]{10000, 10000},
- 20*100,
- 120);
- }
-
- private void recipeLithiumHydroperoxide() {
-
- //LiOH + H2O2 = HLiO2 + H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(4),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 3),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("fluid.hydrogenperoxide", 1000),
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 4),
- },
- new FluidStack[] {
-
- },
- 20 * 30,
- 240,
- 1);
-
-
-
- /*CORE.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1),
- 20,
- FluidUtils.getFluidStack("fluid.cellhydrogenperoxide", 50),
- null,
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 14),
- CI.emptyCells(1),
- 20*30,
- 240); */
- }
-
- private void recipeHydrogenPeroxide() {
-
- //C6H4(COH)2C6H3CH2CH3 + 2O =(C6H4CH)2= H2O2 + C6H4(CO)2C6H3CH2CH3
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(4),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("air", 20000),
- FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 5000),
- FluidUtils.getFluidStack("fluid.anthracene", 50),
- },
- new ItemStack[] {
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Ethylanthraquinone2, 5000),
- FluidUtils.getFluidStack("fluid.hydrogenperoxide", 5000),
- },
- 20 * 30,
- 240,
- 1);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(4),
- },
- new FluidStack[] {
- Materials.Oxygen.getGas(10000),
- FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 5000),
- FluidUtils.getFluidStack("fluid.anthracene", 50),
- },
- new ItemStack[] {
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Ethylanthraquinone2, 5000),
- FluidUtils.getFluidStack("fluid.hydrogenperoxide", 5000),
- },
- 20 * 5,
- 240,
- 1);
-
- /* CORE.RA.addChemicalRecipe(
- GT_ModHandler.getAirCell(15),
- ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthrahydroquinone", 5),
- 20,
- FluidUtils.getFluidStack("fluid.anthracene", 50),
- FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 4450),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 2),
- CI.emptyCells(18),
- 20*30,
- 240);*/
-
- }
-
- private static final ItemStack getTierOneChip() {
- return CI.getNumberedAdvancedCircuit(4);
- }
- private static final ItemStack getTierTwoChip() {
- return CI.getNumberedAdvancedCircuit(8);
- }
- private static final ItemStack getTierThreeChip() {
- return CI.getNumberedAdvancedCircuit(12);
- }
- private static final ItemStack getTierFourChip() {
- return CI.getNumberedAdvancedCircuit(16);
- }
-
- private static void recipeAdvancedChip() {
- GT_ModHandler.addShapelessCraftingRecipe(
- GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 0L), 0, new Object[]{OrePrefixes.circuit.get(Materials.Advanced)});
-
- long bits = 0;
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits,
- new Object[]{"d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits,
- new Object[]{" d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits,
- new Object[]{" d", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits,
- new Object[]{" ", " Pd", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits,
- new Object[]{" ", " P ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits,
- new Object[]{" ", " P ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits,
- new Object[]{" ", " P ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits,
- new Object[]{" ", "dP ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits,
- new Object[]{"P d", " ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits,
- new Object[]{"P ", " d", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits,
- new Object[]{"P ", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits,
- new Object[]{"P ", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits,
- new Object[]{" P", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits,
- new Object[]{" P", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits,
- new Object[]{" P", " ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits,
- new Object[]{" P", "d ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits,
- new Object[]{" ", " ", "d P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits,
- new Object[]{" ", "d ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits,
- new Object[]{"d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits,
- new Object[]{" d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits,
- new Object[]{"d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits,
- new Object[]{" d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits,
- new Object[]{" d", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits,
- new Object[]{" ", " d", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])});
- }
-
-
+ /**
+ * Switches
+ */
+ private static boolean usingGregtechNitricOxide = false;
+
+ private static boolean usingGregtechNitrogenDioxide = false;
+ private static boolean usingGregtechHydricSulfur = false;
+
+ /**
+ * Materials
+ */
+
+ // public static final Material BAKELITE = new Material("Bakelite", MaterialState.SOLID, TextureSet.SET_DULL, new
+ // short[]{90, 140, 140}, 120, 240, 23, 24, true, null, 0);//Not a GT Inherited Material
+ // public static final Material NYLON = new Material("Nylon", MaterialState.SOLID, TextureSet.SET_SHINY, new
+ // short[]{45, 45, 45}, 300, 600, 44, 48, true, null, 0);//Not a GT Inherited Material
+ // public static final Material CARBYNE = new Material("Carbyne", MaterialState.SOLID, TextureSet.SET_DULL, new
+ // short[]{25, 25, 25}, 2500, 5000, 63, 52, true, null, 0);//Not a GT Inherited Material
+
+ // Refined PTFE
+ public static final Material TEFLON = new Material(
+ "Teflon",
+ MaterialState.SOLID,
+ TextureSet.SET_SHINY,
+ new short[] {75, 45, 75},
+ 330,
+ 640,
+ -1,
+ -1,
+ false,
+ null,
+ 0,
+ new MaterialStack(NONMATERIAL.PTFE, 75),
+ new MaterialStack(NONMATERIAL.PLASTIC, 15),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 5),
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 5));
+
+ /**
+ * Fluids
+ */
+ public static Fluid Benzene;
+
+ public static Fluid NitroBenzene;
+ public static Fluid Aniline;
+ public static Fluid Polyurethane;
+ public static Fluid Phenol; // https://en.wikipedia.org/wiki/Phenol#Uses
+ public static Fluid Cyclohexane; // https://en.wikipedia.org/wiki/Cyclohexane
+ public static Fluid Cyclohexanone; // https://en.wikipedia.org/wiki/Cyclohexanone
+ public static Fluid Cadaverine; // https://en.wikipedia.org/wiki/Cadaverine
+ public static Fluid Putrescine; // https://en.wikipedia.org/wiki/Putrescine
+ public static Fluid BoricAcid;
+ public static Fluid HydrochloricAcid;
+
+ public static Fluid Ethylanthraquinone2;
+ public static Fluid Ethylanthrahydroquinone2;
+ public static Fluid Hydrogen_Peroxide;
+ public static Fluid Lithium_Peroxide;
+ public static Fluid Nitric_Oxide;
+ public static Fluid Nitrogen_Dioxide;
+ public static Fluid Carbon_Disulfide;
+ public static Fluid Hydrogen_Sulfide;
+
+ /**
+ * Items
+ */
+
+ // Phenol Byproducts
+ public Item PhenolicResins; // https://en.wikipedia.org/wiki/Phenol_formaldehyde_resin
+
+ public static ItemGenericChemBase mGenericChemItem1;
+ public static Item mAdvancedCircuit;
+
+ private ItemStack mCatalystCarrier;
+
+ public static ItemStack mRedCatalyst;
+ public static ItemStack mYellowCatalyst;
+ public static ItemStack mBlueCatalyst;
+ public static ItemStack mOrangeCatalyst;
+ public static ItemStack mPurpleCatalyst;
+ public static ItemStack mBrownCatalyst;
+ public static ItemStack mPinkCatalyst;
+ public static ItemStack mFormaldehydeCatalyst;
+ public static ItemStack mSolidAcidCatalyst;
+ public static ItemStack mInfiniteMutationCatalyst;
+
+ public static ItemStack mMillingBallAlumina;
+ public static ItemStack mMillingBallSoapstone;
+
+ public static ItemStack mSodiumEthoxide;
+ public static ItemStack mSodiumEthylXanthate;
+ public static ItemStack mPotassiumEthylXanthate;
+ public static ItemStack mPotassiumHydroxide;
+
+ @Override
+ public void items() {
+ PhenolicResins = ItemUtils.generateSpecialUseDusts(
+ "phenolicresins", "Phenolic Resin", "HOC6H4CH2OH", Utils.rgbtoHexValue(80, 40, 40))[0];
+ // MaterialGenerator.generate(BAKELITE, false);
+ // MaterialGenerator.generate(NYLON, false);
+ MaterialGenerator.generate(TEFLON, false);
+
+ mGenericChemItem1 = new ItemGenericChemBase();
+ mAdvancedCircuit = new ItemAdvancedChip();
+ GregtechItemList.Circuit_T3RecipeSelector.set(mAdvancedCircuit);
+
+ registerItemStacks();
+ registerOreDict();
+
+ GregtechItemList.Milling_Ball_Alumina.set(mMillingBallAlumina);
+ GregtechItemList.Milling_Ball_Soapstone.set(mMillingBallSoapstone);
+ }
+
+ public void registerItemStacks() {
+
+ mCatalystCarrier = ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 13, 1);
+
+ mRedCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 0, 1);
+ mYellowCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 1, 1);
+ mBlueCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 2, 1);
+ mOrangeCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 3, 1);
+ mPurpleCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 4, 1);
+ mBrownCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 5, 1);
+ mPinkCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 6, 1);
+ mMillingBallAlumina = ItemUtils.simpleMetaStack(mGenericChemItem1, 7, 1);
+ mMillingBallSoapstone = ItemUtils.simpleMetaStack(mGenericChemItem1, 8, 1);
+ mSodiumEthoxide = ItemUtils.simpleMetaStack(mGenericChemItem1, 9, 1);
+ mSodiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 10, 1);
+ mPotassiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 11, 1);
+ mPotassiumHydroxide = ItemUtils.simpleMetaStack(mGenericChemItem1, 12, 1);
+ mFormaldehydeCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 13, 1);
+ mSolidAcidCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 14, 1);
+ mInfiniteMutationCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 15, 1);
+ }
+
+ public void registerOreDict() {
+
+ ItemUtils.addItemToOreDictionary(mRedCatalyst, "catalystIronCopper");
+ ItemUtils.addItemToOreDictionary(mYellowCatalyst, "catalystTungstenNickel");
+ ItemUtils.addItemToOreDictionary(mBlueCatalyst, "catalystCobaltTitanium");
+ ItemUtils.addItemToOreDictionary(mOrangeCatalyst, "catalystVanadiumPalladium");
+ ItemUtils.addItemToOreDictionary(mPurpleCatalyst, "catalystIridiumRuthenium");
+ ItemUtils.addItemToOreDictionary(mBrownCatalyst, "catalystNickelAluminium");
+ ItemUtils.addItemToOreDictionary(mPinkCatalyst, "catalystPlatinumRhodium");
+ ItemUtils.addItemToOreDictionary(mMillingBallAlumina, "millingballAlumina");
+ ItemUtils.addItemToOreDictionary(mMillingBallSoapstone, "millingballSoapstone");
+ ItemUtils.addItemToOreDictionary(mSodiumEthoxide, "dustSodiumEthoxide");
+ ItemUtils.addItemToOreDictionary(mSodiumEthylXanthate, "dustSodiumEthylXanthate");
+ ItemUtils.addItemToOreDictionary(mPotassiumEthylXanthate, "dustPotassiumEthylXanthate");
+ ItemUtils.addItemToOreDictionary(mPotassiumHydroxide, "dustPotassiumHydroxide");
+ ItemUtils.addItemToOreDictionary(mFormaldehydeCatalyst, "catalystFormaldehyde");
+ ItemUtils.addItemToOreDictionary(mSolidAcidCatalyst, "catalystSolidAcid");
+ ItemUtils.addItemToOreDictionary(mInfiniteMutationCatalyst, "catalystInfiniteMutation");
+ }
+
+ @Override
+ public void blocks() {}
+
+ @Override
+ public void fluids() {
+
+ if (!FluidRegistry.isFluidRegistered("benzene")) {
+ Benzene = FluidUtils.generateFluidNoPrefix("benzene", "Benzene", 278, new short[] {100, 70, 30, 100}, true);
+ } else {
+ Benzene = FluidRegistry.getFluid("benzene");
+ }
+
+ NitroBenzene = FluidUtils.generateFluidNoPrefix(
+ "nitrobenzene", "Nitrobenzene", 278, new short[] {70, 50, 40, 100}, true);
+
+ Aniline = FluidUtils.generateFluidNoPrefix("aniline", "Aniline", 266, new short[] {100, 100, 30, 100}, true);
+
+ BoricAcid =
+ FluidUtils.generateFluidNoPrefix("boricacid", "Boric Acid", 278, new short[] {90, 30, 120, 100}, true);
+
+ Polyurethane = FluidUtils.generateFluidNoPrefix(
+ "polyurethane", "Polyurethane", 350, new short[] {100, 70, 100, 100}, true);
+
+ if (!FluidRegistry.isFluidRegistered("phenol")) {
+ Phenol = FluidUtils.generateFluidNoPrefix("phenol", "Phenol", 313, new short[] {100, 70, 30, 100}, true);
+ } else {
+ Phenol = FluidRegistry.getFluid("phenol");
+ }
+
+ // Use GT's if it exists, else make our own.
+ if (FluidRegistry.isFluidRegistered("hydrochloricacid_gt5u")) {
+ HydrochloricAcid = FluidRegistry.getFluid("hydrochloricacid_gt5u");
+ } else {
+ HydrochloricAcid = FluidUtils.generateFluidNoPrefix(
+ "hydrochloricacid", "Hydrochloric Acid", 285, new short[] {183, 200, 196, 100}, true);
+ }
+
+ Cyclohexane = FluidUtils.generateFluidNoPrefix(
+ "cyclohexane", "Cyclohexane", 32 + 175, new short[] {100, 70, 30, 100}, true);
+ Cyclohexanone = FluidUtils.generateFluidNoPrefix(
+ "cyclohexanone", "Cyclohexanone", 32 + 175, new short[] {100, 70, 30, 100}, true);
+
+ Cadaverine = FluidUtils.generateFluidNoPrefix(
+ "cadaverine", "Cadaverine", 32 + 175, new short[] {100, 70, 30, 100}, true);
+ Putrescine = FluidUtils.generateFluidNoPrefix(
+ "putrescine", "Putrescine", 32 + 175, new short[] {100, 70, 30, 100}, true);
+
+ // Create 2-Ethylanthraquinone
+ // 2-Ethylanthraquinone is prepared from the reaction of phthalic anhydride and ethylbenzene
+ Ethylanthraquinone2 = FluidUtils.generateFluidNonMolten(
+ "2Ethylanthraquinone", "2-Ethylanthraquinone", 415, new short[] {227, 255, 159, 100}, null, null);
+ // Create 2-Ethylanthrahydroquinone
+ // Palladium plate + Hydrogen(250) + 2-Ethylanthraquinone(500) = 600 Ethylanthrahydroquinone
+ Ethylanthrahydroquinone2 = FluidUtils.generateFluidNonMolten(
+ "2Ethylanthrahydroquinone",
+ "2-Ethylanthrahydroquinone",
+ 415,
+ new short[] {207, 225, 129, 100},
+ null,
+ null);
+ // Create Hydrogen Peroxide
+ // Compressed Air(1500) + Ethylanthrahydroquinone(500) + Anthracene(5) = 450 Ethylanthraquinone && 200 Peroxide
+ Hydrogen_Peroxide = FluidUtils.generateFluidNonMolten(
+ "HydrogenPeroxide", "Hydrogen Peroxide", 150, new short[] {210, 255, 255, 100}, null, null);
+
+ if (FluidRegistry.isFluidRegistered("nitricoxide")) {
+ Nitric_Oxide = FluidRegistry.getFluid("nitricoxide");
+ usingGregtechNitricOxide = true;
+ } else {
+ Nitric_Oxide = FluidUtils.generateFluidNoPrefix(
+ "nitricoxide", "Nitric Oxide", 200, new short[] {125, 200, 240, 100});
+ }
+ if (FluidRegistry.isFluidRegistered("nitrogendioxide")) {
+ Nitrogen_Dioxide = FluidRegistry.getFluid("nitrogendioxide");
+ usingGregtechNitrogenDioxide = true;
+ } else {
+ Nitrogen_Dioxide = FluidUtils.generateFluidNoPrefix(
+ "nitrogendioxide", "Nitrogen Dioxide", 200, new short[] {100, 175, 255, 100});
+ }
+
+ // Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O
+ // ItemUtils.generateSpecialUseDusts("LithiumHydroperoxide", "Lithium Hydroperoxide", "HLiO2",
+ // Utils.rgbtoHexValue(125, 125, 125));
+ // v - Dehydrate
+ // Lithium Peroxide - 2 LiOOH → Li2O2 + H2O2 + 2 H2O
+ Lithium_Peroxide = FluidUtils.generateFluidNonMolten(
+ "LithiumPeroxide", "Lithium Peroxide", 446, new short[] {135, 135, 135, 100}, null, null);
+
+ Carbon_Disulfide = FluidUtils.generateFluidNoPrefix(
+ "CarbonDisulfide", "Carbon Disulfide", 350, new short[] {175, 175, 175, 100});
+
+ if (FluidRegistry.isFluidRegistered("fluid.liquid_hydricsulfur")
+ || MaterialUtils.doesMaterialExist("HydricSulfide")) {
+ usingGregtechHydricSulfur = true;
+ Fluid aFluid = null;
+ if (ItemUtils.doesItemListEntryExist("sHydricSulfur")) {
+ ItemStack aListItem = ItemUtils.getValueOfItemList("sHydricSulfur", 1, (ItemList) null);
+ if (aListItem != null) {
+ FluidStack aFluidStack = FluidContainerRegistry.getFluidForFilledItem(aListItem);
+ if (aFluidStack != null) {
+ aFluid = aFluidStack.getFluid();
+ }
+ }
+ }
+ if (aFluid == null) {
+ aFluid = FluidUtils.getWildcardFluidStack("liquid_hydricsulfur", 1000)
+ .getFluid();
+ }
+ Hydrogen_Sulfide = aFluid;
+ } else {
+ Hydrogen_Sulfide = FluidUtils.generateFluidNoPrefix(
+ "HydrogenSulfide", "Hydrogen Sulfide", 446, new short[] {240, 130, 30, 100});
+ }
+ }
+
+ @Override
+ public String errorMessage() {
+ return "Failed to generate recipes for GenericChem.";
+ }
+
+ @Override
+ public boolean generateRecipes() {
+
+ recipeAdvancedChip();
+ recipeCatalystRed();
+ recipeCatalystYellow();
+ recipeCatalystBlue();
+ recipeCatalystOrange();
+ recipeCatalystPurple();
+ recipeCatalystBrown();
+ recipeCatalystPink();
+ recipeCatalystFormaldehyde();
+ recipeCatalystSolidAcid();
+ recipeCatalystInfiniteMutation();
+
+ recipeGrindingBallAlumina();
+ recipeGrindingBallSoapstone();
+
+ recipeNitroBenzene();
+ recipeAniline();
+ recipeCadaverineAndPutrescine();
+ recipeCyclohexane();
+ recipeCyclohexanone();
+
+ recipe2Ethylanthraquinone();
+ recipe2Ethylanthrahydroquinone();
+ recipeHydrogenPeroxide();
+ recipeLithiumHydroperoxide();
+ recipeLithiumPeroxide();
+ // The follow is using alk science, ignore them
+ if (!usingGregtechNitricOxide) {
+ recipeNitricOxide();
+ }
+ if (!usingGregtechNitrogenDioxide) {
+ recipeNitrogenDioxide();
+ }
+ if (!usingGregtechHydricSulfur) {
+ recipeHydricSulfur();
+ }
+
+ // Add recipes if we are not using GT's fluid.
+ if (!FluidRegistry.isFluidRegistered("hydrochloricacid_gt5u")) {
+ recipeHydrochloricAcid();
+ }
+
+ recipeSodiumEthoxide();
+ recipeCarbonDisulfide();
+ recipeEthylXanthates();
+ recipePotassiumHydroxide();
+
+ recipeMutatedLivingSolder();
+
+ registerFuels();
+
+ return true;
+ }
+
+ private void recipeSodiumEthoxide() {
+ // C2H5OH + Na → C2H5ONa + H
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(16), ELEMENT.getInstance().SODIUM.getDust(1)
+ },
+ new FluidStack[] {Materials.Ethanol.getFluid(1000)},
+ new ItemStack[] {ItemUtils.getSimpleStack(mSodiumEthoxide, 9)},
+ new FluidStack[] {ELEMENT.getInstance().HYDROGEN.getFluidStack(1000)},
+ 20 * 20,
+ 120,
+ 2);
+ }
+
+ private void recipePotassiumHydroxide() {
+ // Ca(OH)2 + K2O + CO2 → CaCO3 + 2 KOH
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(18),
+ Materials.Potash.getDust(3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5),
+ },
+ new FluidStack[] {Materials.CarbonDioxide.getGas(1000)},
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 5),
+ ItemUtils.getSimpleStack(mPotassiumHydroxide, 6)
+ },
+ new FluidStack[] {},
+ 20 * 30,
+ 120,
+ 2);
+ }
+
+ private void recipeEthylXanthates() {
+
+ // Potassium ethyl xanthate - CH3CH2OH + CS2 + KOH → C3H5KOS2 + H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(17), ItemUtils.getSimpleStack(mPotassiumHydroxide, 3),
+ },
+ new FluidStack[] {
+ Materials.Ethanol.getFluid(1000), FluidUtils.getFluidStack(Carbon_Disulfide, 1000),
+ },
+ new ItemStack[] {ItemUtils.getSimpleStack(mPotassiumEthylXanthate, 12)},
+ new FluidStack[] {FluidUtils.getWater(1000)},
+ 20 * 60,
+ 120,
+ 4);
+
+ // Sodium ethyl xanthate - CH3CH2ONa + CS2 → CH3CH2OCS2Na
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(17), ItemUtils.getSimpleStack(mSodiumEthoxide, 9)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Carbon_Disulfide, 1000),
+ },
+ new ItemStack[] {ItemUtils.getSimpleStack(mSodiumEthylXanthate, 12)},
+ new FluidStack[] {},
+ 20 * 60,
+ 120,
+ 4);
+ }
+
+ // The follow is using alk science, ignore them
+ private void recipeHydricSulfur() {
+
+ ItemStack aCellHydricSulfide = ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenSulfide", 1);
+ GT_Values.RA.addChemicalRecipe(
+ ELEMENT.getInstance().SULFUR.getDust(1),
+ GT_Utility.getIntegratedCircuit(1),
+ ELEMENT.getInstance().HYDROGEN.getFluidStack(2000),
+ FluidUtils.getFluidStack(Hydrogen_Sulfide, 3000),
+ GT_Values.NI,
+ 60,
+ 8);
+ GT_Values.RA.addChemicalRecipeForBasicMachineOnly(
+ ELEMENT.getInstance().SULFUR.getDust(1),
+ CI.emptyCells(3),
+ ELEMENT.getInstance().HYDROGEN.getFluidStack(2000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(aCellHydricSulfide, 3),
+ GT_Values.NI,
+ 60,
+ 8);
+ }
+
+ private void recipeCarbonDisulfide() {
+
+ CORE.RA.addBlastRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 8),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 16)
+ },
+ new FluidStack[] {},
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustDarkAsh", 1)},
+ new FluidStack[] {FluidUtils.getFluidStack(Carbon_Disulfide, 4000)},
+ 20 * 60 * 10,
+ 30,
+ 1500);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(20),
+ ItemUtils.getSimpleStack(mBrownCatalyst, 0),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 4)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(CoalTar.Coal_Gas, 1000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {FluidUtils.getFluidStack(Carbon_Disulfide, 2000)},
+ 20 * 60 * 5,
+ 30,
+ 2);
+ }
+
+ private void recipeMutatedLivingSolder() {
+
+ // Endgame soldering alloy meant for the bioware circuit line and beyond.
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(GenericChem.mInfiniteMutationCatalyst, 0),
+ ItemList.Circuit_Chip_Biocell.get(64),
+ ItemList.Gravistar.get(8),
+ Materials.InfinityCatalyst.getDust(2)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("plasma.tin", 18000),
+ FluidUtils.getFluidStack("plasma.bismuth", 18000),
+ FluidUtils.getFluidStack("cryotheum", 4000)
+ },
+ new ItemStack[] {},
+ new FluidStack[] {MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 280)},
+ 20 * 800,
+ 3842160,
+ 7);
+ }
+
+ private static void registerFuels() {
+
+ // Burnables
+
+ // Gas Fuels
+ GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellNitrobenzene", 1), null, 1600, 1);
+ }
+
+ private void recipeGrindingBallAlumina() {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(10), ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 64)},
+ FluidUtils.getFluidStack(GenericChem.Aniline, 4000),
+ ItemUtils.getSimpleStack(mMillingBallAlumina, 8),
+ 180 * 20,
+ 480);
+ }
+
+ private void recipeGrindingBallSoapstone() {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(10), ItemUtils.getItemStackOfAmountFromOreDict("dustSoapstone", 32)
+ },
+ FluidUtils.getFluidStack(AgrichemFluids.mLiquidResin, 2500),
+ ItemUtils.getSimpleStack(mMillingBallSoapstone, 8),
+ 120 * 20,
+ 480);
+ }
+
+ // The follow is using alk science, ignore them
+ private void recipeNitrogenDioxide() {
+ ItemStack aNitricOxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitricOxide", 1);
+ ItemStack aNitrogenDioxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitrogenDioxide", 1);
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getSimpleStack(aNitricOxideCell, 2),
+ GT_Utility.getIntegratedCircuit(1),
+ ELEMENT.getInstance().OXYGEN.getFluidStack(1000),
+ FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000),
+ CI.emptyCells(2),
+ 160);
+ GT_Values.RA.addChemicalRecipe(
+ ELEMENT.getInstance().OXYGEN.getCell(1),
+ GT_Utility.getIntegratedCircuit(1),
+ FluidUtils.getFluidStack(Nitric_Oxide, 2000),
+ FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000),
+ CI.emptyCells(1),
+ 160);
+ GT_Values.RA.addChemicalRecipeForBasicMachineOnly(
+ ItemUtils.getSimpleStack(aNitricOxideCell, 2),
+ CI.emptyCells(1),
+ ELEMENT.getInstance().OXYGEN.getFluidStack(1000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3),
+ GT_Values.NI,
+ 160,
+ 30);
+ GT_Values.RA.addChemicalRecipeForBasicMachineOnly(
+ ELEMENT.getInstance().OXYGEN.getCell(1),
+ CI.emptyCells(2),
+ FluidUtils.getFluidStack(Nitric_Oxide, 2000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3),
+ GT_Values.NI,
+ 160,
+ 30);
+ GT_Values.RA.addChemicalRecipeForBasicMachineOnly(
+ ItemUtils.getSimpleStack(aNitricOxideCell, 2),
+ ELEMENT.getInstance().OXYGEN.getCell(1),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3),
+ GT_Values.NI,
+ 160,
+ 30);
+ }
+
+ // The follow is using alk science, ignore them
+ private void recipeNitricOxide() {
+ ItemStack aWaterCell = ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1);
+ ItemStack aNitricOxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitricOxide", 1);
+ GT_Values.RA.addChemicalRecipeForBasicMachineOnly(
+ MISC_MATERIALS.AMMONIA.getCell(8),
+ CI.emptyCells(1),
+ ELEMENT.getInstance().OXYGEN.getFluidStack(5000),
+ FluidUtils.getFluidStack(Nitric_Oxide, 4000),
+ ItemUtils.getSimpleStack(aWaterCell, 9),
+ GT_Values.NI,
+ 160,
+ 30);
+ GT_Values.RA.addChemicalRecipeForBasicMachineOnly(
+ ELEMENT.getInstance().OXYGEN.getCell(5),
+ CI.emptyCells(4),
+ MISC_MATERIALS.AMMONIA.getFluidStack(8000),
+ FluidUtils.getFluidStack(Nitric_Oxide, 4000),
+ ItemUtils.getSimpleStack(aWaterCell, 9),
+ GT_Values.NI,
+ 160,
+ 30);
+ GT_Values.RA.addChemicalRecipe(
+ MISC_MATERIALS.AMMONIA.getCell(8),
+ GT_Utility.getIntegratedCircuit(11),
+ ELEMENT.getInstance().OXYGEN.getFluidStack(5000),
+ FluidUtils.getWater(9000),
+ ItemUtils.getSimpleStack(aNitricOxideCell, 4),
+ CI.emptyCells(4),
+ 160);
+ GT_Values.RA.addChemicalRecipe(
+ ELEMENT.getInstance().OXYGEN.getCell(5),
+ GT_Utility.getIntegratedCircuit(11),
+ MISC_MATERIALS.AMMONIA.getFluidStack(8000),
+ FluidUtils.getWater(9000),
+ ItemUtils.getSimpleStack(aNitricOxideCell, 4),
+ CI.emptyCells(1),
+ 160);
+ GT_Values.RA.addChemicalRecipe(
+ MISC_MATERIALS.AMMONIA.getCell(8),
+ GT_Utility.getIntegratedCircuit(2),
+ ELEMENT.getInstance().OXYGEN.getFluidStack(5000),
+ FluidUtils.getFluidStack(Nitric_Oxide, 4000),
+ CI.emptyCells(8),
+ 320);
+ GT_Values.RA.addChemicalRecipe(
+ ELEMENT.getInstance().OXYGEN.getCell(5),
+ GT_Utility.getIntegratedCircuit(2),
+ MISC_MATERIALS.AMMONIA.getFluidStack(8000),
+ FluidUtils.getFluidStack(Nitric_Oxide, 4000),
+ CI.emptyCells(5),
+ 320);
+ GT_Values.RA.addChemicalRecipe(
+ MISC_MATERIALS.AMMONIA.getCell(8),
+ GT_Utility.getIntegratedCircuit(12),
+ ELEMENT.getInstance().OXYGEN.getFluidStack(5000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(aNitricOxideCell, 4),
+ CI.emptyCells(4),
+ 160);
+ GT_Values.RA.addChemicalRecipe(
+ ELEMENT.getInstance().OXYGEN.getCell(5),
+ GT_Utility.getIntegratedCircuit(12),
+ MISC_MATERIALS.AMMONIA.getFluidStack(8000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(aNitricOxideCell, 4),
+ CI.emptyCells(1),
+ 160);
+ GT_Values.RA.addChemicalRecipeForBasicMachineOnly(
+ MISC_MATERIALS.AMMONIA.getCell(8),
+ ELEMENT.getInstance().OXYGEN.getCell(5),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(aNitricOxideCell, 4),
+ ItemUtils.getSimpleStack(aWaterCell, 9),
+ 160,
+ 30);
+ GT_Values.RA.addMultiblockChemicalRecipe(
+ new ItemStack[] {GT_Utility.getIntegratedCircuit(1)},
+ new FluidStack[] {
+ MISC_MATERIALS.AMMONIA.getFluidStack(8000),
+ ELEMENT.getInstance().OXYGEN.getFluidStack(5000)
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(Nitric_Oxide, 4000), FluidUtils.getWater(9000)},
+ null,
+ 160,
+ 30);
+ }
+
+ // The follow is using alk science, ignore them
+ private void recipeHydrochloricAcid() {
+
+ ItemStack aAcidCell = ItemUtils.getItemStackOfAmountFromOreDict("cellHydrochloricAcid", 1);
+
+ CORE.RA.addChemicalRecipe(
+ ELEMENT.getInstance().CHLORINE.getCell(1),
+ GT_Utility.getIntegratedCircuit(1),
+ ELEMENT.getInstance().HYDROGEN.getFluidStack(1000),
+ FluidUtils.getFluidStack(HydrochloricAcid, 2000),
+ CI.emptyCells(1),
+ 60,
+ 8);
+
+ CORE.RA.addChemicalRecipe(
+ ELEMENT.getInstance().HYDROGEN.getCell(1),
+ GT_Utility.getIntegratedCircuit(1),
+ ELEMENT.getInstance().CHLORINE.getFluidStack(1000),
+ FluidUtils.getFluidStack(HydrochloricAcid, 2000),
+ CI.emptyCells(1),
+ 60,
+ 8);
+
+ GT_Values.RA.addElectrolyzerRecipe(
+ CI.emptyCells(1),
+ GT_Utility.getIntegratedCircuit(1),
+ FluidUtils.getFluidStack(HydrochloricAcid, 2000),
+ ELEMENT.getInstance().CHLORINE.getFluidStack(1000),
+ ELEMENT.getInstance().HYDROGEN.getCell(1),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ null,
+ 720,
+ 30);
+
+ GT_Values.RA.addElectrolyzerRecipe(
+ CI.emptyCells(1),
+ GT_Utility.getIntegratedCircuit(11),
+ FluidUtils.getFluidStack(HydrochloricAcid, 2000),
+ ELEMENT.getInstance().HYDROGEN.getFluidStack(1000),
+ ELEMENT.getInstance().CHLORINE.getCell(1),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ null,
+ 720,
+ 30);
+
+ GT_Values.RA.addElectrolyzerRecipe(
+ ItemUtils.getSimpleStack(aAcidCell, 2),
+ GT_Values.NI,
+ GT_Values.NF,
+ GT_Values.NF,
+ ELEMENT.getInstance().HYDROGEN.getCell(1),
+ ELEMENT.getInstance().CHLORINE.getCell(1),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ null,
+ 720,
+ 30);
+ }
+
+ private void recipeCyclohexane() {
+
+ // C6H6 + 6H = C6H12
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getTierTwoChip(), ItemUtils.getSimpleStack(mBrownCatalyst, 0)},
+ new FluidStack[] {FluidUtils.getFluidStack(Benzene, 1000), FluidUtils.getFluidStack("hydrogen", 6000)},
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cyclohexane, 1000),
+ },
+ 20 * 120,
+ 120,
+ 2);
+ }
+
+ private void recipeCyclohexanone() {
+
+ // C6H12 + 2O(Air) = C6H10O + H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getTierTwoChip(), ItemUtils.getSimpleStack(mBlueCatalyst, 0)},
+ new FluidStack[] {FluidUtils.getFluidStack(Cyclohexane, 1000), FluidUtils.getFluidStack("air", 4000)},
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cyclohexanone, 1000),
+ },
+ 20 * 120,
+ 120,
+ 2);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getTierTwoChip(),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(Cyclohexane, 1000), FluidUtils.getFluidStack("oxygen", 2000)
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cyclohexanone, 1000),
+ },
+ 20 * 120,
+ 120,
+ 2);
+ }
+
+ private void recipeCatalystRed() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierOneChip(),
+ CI.getEmptyCatalyst(10),
+ ELEMENT.getInstance().IRON.getDust(2),
+ ELEMENT.getInstance().COPPER.getDust(2),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mRedCatalyst, 10),
+ 20 * 20,
+ 30);
+ }
+
+ private void recipeCatalystYellow() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierThreeChip(),
+ CI.getEmptyCatalyst(10),
+ ELEMENT.getInstance().TUNGSTEN.getDust(4),
+ ELEMENT.getInstance().NICKEL.getDust(4),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mYellowCatalyst, 10),
+ 60 * 20,
+ 2000);
+ }
+
+ private void recipeCatalystBlue() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierTwoChip(),
+ CI.getEmptyCatalyst(10),
+ ELEMENT.getInstance().COBALT.getDust(3),
+ ELEMENT.getInstance().TITANIUM.getDust(3),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mBlueCatalyst, 10),
+ 40 * 20,
+ 500);
+ }
+
+ private void recipeCatalystOrange() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierTwoChip(),
+ CI.getEmptyCatalyst(10),
+ ELEMENT.getInstance().VANADIUM.getDust(5),
+ ELEMENT.getInstance().PALLADIUM.getDust(5),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mOrangeCatalyst, 10),
+ 40 * 20,
+ 500);
+ }
+
+ private void recipeCatalystPurple() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierFourChip(),
+ CI.getEmptyCatalyst(10),
+ ELEMENT.getInstance().IRIDIUM.getDust(6),
+ ELEMENT.getInstance().RUTHENIUM.getDust(6),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mPurpleCatalyst, 10),
+ 120 * 20,
+ 8000);
+ }
+
+ private void recipeCatalystBrown() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierOneChip(),
+ CI.getEmptyCatalyst(10),
+ ELEMENT.getInstance().NICKEL.getDust(4),
+ ELEMENT.getInstance().ALUMINIUM.getDust(4),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mBrownCatalyst, 10),
+ 15 * 20,
+ 30);
+ }
+
+ private void recipeCatalystPink() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierThreeChip(),
+ CI.getEmptyCatalyst(10),
+ ELEMENT.getInstance().PLATINUM.getDust(4),
+ ELEMENT.getInstance().RHODIUM.getDust(4),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mPinkCatalyst, 10),
+ 30 * 20,
+ 2000);
+ }
+
+ private void recipeCatalystFormaldehyde() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierThreeChip(),
+ CI.getEmptyCatalyst(4),
+ ItemUtils.getSimpleStack(RocketFuels.Formaldehyde_Catalyst_Dust, 8)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mFormaldehydeCatalyst, 4),
+ 30 * 20,
+ 240);
+ }
+
+ private void recipeCatalystSolidAcid() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierThreeChip(),
+ CI.getEmptyCatalyst(5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLapis", 2)
+ },
+ MISC_MATERIALS.SOLID_ACID_MIXTURE.getFluidStack(1000),
+ ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 5),
+ 30 * 20,
+ 2000);
+ }
+
+ private void recipeCatalystInfiniteMutation() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getTierThreeChip(),
+ CI.getEmptyCatalyst(5),
+ Materials.Infinity.getDust(1),
+ Materials.Naquadria.getDust(10)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(GenericChem.mInfiniteMutationCatalyst, 1),
+ 5 * 20,
+ 1966080);
+ }
+
+ private void recipeCadaverineAndPutrescine() {
+
+ // Basic Recipe
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getTierOneChip(), ItemUtils.getSimpleStack(Items.rotten_flesh, 64)},
+ new FluidStack[] {FluidUtils.getHotWater(2000)},
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cadaverine, 250), FluidUtils.getFluidStack(Putrescine, 250),
+ },
+ 20 * 120,
+ 120,
+ 1);
+
+ // Advanced Recipe
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getTierTwoChip(),
+ ItemUtils.getSimpleStack(Items.rotten_flesh, 128),
+ ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 8, 32)
+ },
+ new FluidStack[] {FluidUtils.getHotWater(3000)},
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cadaverine, 750), FluidUtils.getFluidStack(Putrescine, 750),
+ },
+ 20 * 120,
+ 240,
+ 2);
+ }
+
+ private void recipeAniline() {
+
+ // C6H5NO2 + 6H = C6H7N + 2H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getTierThreeChip(), ItemUtils.getSimpleStack(mBlueCatalyst, 0)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(NitroBenzene, 1000), FluidUtils.getFluidStack("hydrogen", 6000)
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Aniline, 1000),
+ },
+ 20 * 30,
+ 500,
+ 3);
+ }
+
+ private void recipeNitroBenzene() {
+
+ // C6H6 + HNO3 =H2SO4= C6H5NO2 +H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getTierThreeChip(),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Benzene, 5000),
+ FluidUtils.getFluidStack("sulfuricacid", 3000),
+ FluidUtils.getFluidStack("nitricacid", 5000),
+ FluidUtils.getDistilledWater(10000)
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dilutedsulfuricacid", 3000), FluidUtils.getFluidStack(NitroBenzene, 5000),
+ },
+ 20 * 30,
+ 500,
+ 4);
+ }
+
+ private void recipe2Ethylanthraquinone() {
+
+ // C6H4(CO)2O + C6H5CH2CH3 = C6H4(CO)2C6H3CH2CH3 + H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4), ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 15),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(CoalTar.Ethylbenzene, 1000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Ethylanthraquinone2, 1000),
+ },
+ 20 * 15,
+ 120,
+ 2);
+ }
+
+ private void recipe2Ethylanthrahydroquinone() {
+
+ // C6H4(CO)2C6H3CH2CH3 + 2H = C6H4(COH)2C6H3CH2CH3
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4), ItemUtils.getSimpleStack(mOrangeCatalyst, 0),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Ethylanthraquinone2, 1000), FluidUtils.getFluidStack("hydrogen", 2000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 1000),
+ },
+ 20 * 40,
+ 120,
+ 2);
+ }
+
+ private void recipeLithiumPeroxide() {
+ // 2HLiO2 = Li2O2 + H2O2
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 8),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1)
+ },
+ null,
+ null,
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumPeroxide", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1),
+ },
+ new int[] {10000, 10000},
+ 20 * 100,
+ 120);
+ }
+
+ private void recipeLithiumHydroperoxide() {
+
+ // LiOH + H2O2 = HLiO2 + H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4), ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 3),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("fluid.hydrogenperoxide", 1000),
+ },
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 4),
+ },
+ new FluidStack[] {},
+ 20 * 30,
+ 240,
+ 1);
+
+ /*CORE.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1),
+ 20,
+ FluidUtils.getFluidStack("fluid.cellhydrogenperoxide", 50),
+ null,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 14),
+ CI.emptyCells(1),
+ 20*30,
+ 240); */
+ }
+
+ private void recipeHydrogenPeroxide() {
+
+ // C6H4(COH)2C6H3CH2CH3 + 2O =(C6H4CH)2= H2O2 + C6H4(CO)2C6H3CH2CH3
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("air", 20000),
+ FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 5000),
+ FluidUtils.getFluidStack("fluid.anthracene", 50),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Ethylanthraquinone2, 5000),
+ FluidUtils.getFluidStack("fluid.hydrogenperoxide", 5000),
+ },
+ 20 * 30,
+ 240,
+ 1);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4),
+ },
+ new FluidStack[] {
+ Materials.Oxygen.getGas(10000),
+ FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 5000),
+ FluidUtils.getFluidStack("fluid.anthracene", 50),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Ethylanthraquinone2, 5000),
+ FluidUtils.getFluidStack("fluid.hydrogenperoxide", 5000),
+ },
+ 20 * 5,
+ 240,
+ 1);
+
+ /* CORE.RA.addChemicalRecipe(
+ GT_ModHandler.getAirCell(15),
+ ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthrahydroquinone", 5),
+ 20,
+ FluidUtils.getFluidStack("fluid.anthracene", 50),
+ FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 4450),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 2),
+ CI.emptyCells(18),
+ 20*30,
+ 240);*/
+
+ }
+
+ private static final ItemStack getTierOneChip() {
+ return CI.getNumberedAdvancedCircuit(4);
+ }
+
+ private static final ItemStack getTierTwoChip() {
+ return CI.getNumberedAdvancedCircuit(8);
+ }
+
+ private static final ItemStack getTierThreeChip() {
+ return CI.getNumberedAdvancedCircuit(12);
+ }
+
+ private static final ItemStack getTierFourChip() {
+ return CI.getNumberedAdvancedCircuit(16);
+ }
+
+ private static void recipeAdvancedChip() {
+ GT_ModHandler.addShapelessCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 0L),
+ 0,
+ new Object[] {OrePrefixes.circuit.get(Materials.Advanced)});
+
+ long bits = 0;
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits, new Object[] {
+ "d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits, new Object[] {
+ " d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits, new Object[] {
+ " d", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits, new Object[] {
+ " ", " Pd", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits, new Object[] {
+ " ", " P ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits, new Object[] {
+ " ", " P ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits, new Object[] {
+ " ", " P ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits, new Object[] {
+ " ", "dP ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits, new Object[] {
+ "P d", " ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits, new Object[] {
+ "P ", " d", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits, new Object[] {
+ "P ", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits, new Object[] {
+ "P ", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits, new Object[] {
+ " P", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits, new Object[] {
+ " P", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits, new Object[] {
+ " P", " ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits, new Object[] {
+ " P", "d ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits, new Object[] {
+ " ", " ", "d P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits, new Object[] {
+ " ", "d ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits, new Object[] {
+ "d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits, new Object[] {
+ " d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits, new Object[] {
+ "d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits, new Object[] {
+ " d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits, new Object[] {
+ " d", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ BioRecipes.addCraftingRecipe(
+ GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits, new Object[] {
+ " ", " d", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])
+ });
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/IonParticles.java b/src/main/java/gtPlusPlus/core/item/chemistry/IonParticles.java
index e08a509436..c2671fd401 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/IonParticles.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/IonParticles.java
@@ -1,13 +1,12 @@
package gtPlusPlus.core.item.chemistry;
-import java.util.HashMap;
-import java.util.List;
-
import gregtech.api.enums.Materials;
import gtPlusPlus.core.item.base.misc.BaseItemParticle;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.util.Utils;
+import java.util.HashMap;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -18,148 +17,142 @@ import net.minecraft.util.IIcon;
public class IonParticles extends BaseItemParticle {
- public static HashMap<String, Integer> NameToMetaMap = new HashMap<String, Integer>();
- public static HashMap<Integer, String> MetaToNameMap = new HashMap<Integer, String>();
-
-
- public IonParticles() {
- super("Ion", ELEMENT.NAMES.length, EnumRarity.rare);
- }
-
- public static IIcon[] overlays = new IIcon[ELEMENT.NAMES.length];
- public static IIcon baseTexture;
-
- static {
- //Generate Ions
- int key = 0;
- for (String s : ELEMENT.NAMES) {
- //Map names to Meta
- NameToMetaMap.put(Utils.sanitizeString(s.toLowerCase()), key);
- MetaToNameMap.put(key, Utils.sanitizeString(s.toLowerCase()));
- Materials m = Materials.get(s);
- int aColour = 0;
- if (m == null) {
- aColour = Utils.rgbtoHexValue(128, 128, 128);
- }
- else {
- aColour = Utils.rgbtoHexValue(m.mRGBa[0], m.mRGBa[1], m.mRGBa[2]);
- }
- aColourMap.put(key++, aColour);
- }
-
- }
-
- @Override
- public String[] getAffixes() {
- return new String[] {"", ""};
- }
-
- @Override
- public String getUnlocalizedName() {
- return "";
- }
-
- @Override
+ public static HashMap<String, Integer> NameToMetaMap = new HashMap<String, Integer>();
+ public static HashMap<Integer, String> MetaToNameMap = new HashMap<Integer, String>();
+
+ public IonParticles() {
+ super("Ion", ELEMENT.NAMES.length, EnumRarity.rare);
+ }
+
+ public static IIcon[] overlays = new IIcon[ELEMENT.NAMES.length];
+ public static IIcon baseTexture;
+
+ static {
+ // Generate Ions
+ int key = 0;
+ for (String s : ELEMENT.NAMES) {
+ // Map names to Meta
+ NameToMetaMap.put(Utils.sanitizeString(s.toLowerCase()), key);
+ MetaToNameMap.put(key, Utils.sanitizeString(s.toLowerCase()));
+ Materials m = Materials.get(s);
+ int aColour = 0;
+ if (m == null) {
+ aColour = Utils.rgbtoHexValue(128, 128, 128);
+ } else {
+ aColour = Utils.rgbtoHexValue(m.mRGBa[0], m.mRGBa[1], m.mRGBa[2]);
+ }
+ aColourMap.put(key++, aColour);
+ }
+ }
+
+ @Override
+ public String[] getAffixes() {
+ return new String[] {"", ""};
+ }
+
+ @Override
+ public String getUnlocalizedName() {
+ return "";
+ }
+
+ @Override
public String getUnlocalizedName(final ItemStack itemStack) {
return "item.particle.ion" + "." + ELEMENT.NAMES[itemStack.getItemDamage()];
}
-
- private static boolean createNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Charge", 0);
- tagMain.setTag("Ion", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static final long getChargeState(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("Ion");
- if (aNBT != null) {
- return aNBT.getLong("Charge");
- }
- }
- else {
- createNBT(aStack);
- }
- return 0L;
- }
-
- public static final boolean setChargeState(final ItemStack aStack, final long aCharge) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("Ion");
- if (aNBT != null) {
- aNBT.setLong("Charge", aCharge);
- return true;
- }
- }
- return false;
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- if (stack.getTagCompound() == null){
- createNBT(stack);
+
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Charge", 0);
+ tagMain.setTag("Ion", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static final long getChargeState(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("Ion");
+ if (aNBT != null) {
+ return aNBT.getLong("Charge");
+ }
+ } else {
+ createNBT(aStack);
}
- double chargeState = getChargeState(stack);
- return chargeState;
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- long aCharge = getChargeState(stack);
- String aState = EnumChatFormatting.YELLOW+"Unknown"+EnumChatFormatting.GRAY;
- //State not set
- if (aCharge == 0) {
- list.add(EnumChatFormatting.GRAY+"A "+MetaToNameMap.get(stack.getItemDamage())+" Ion with an "+aState+" charge state");
- }
- else {
- if (aCharge > 0) {
- aState = EnumChatFormatting.GREEN+"Positive"+EnumChatFormatting.GRAY;
- }
- else {
- aState = EnumChatFormatting.RED+"Negative"+EnumChatFormatting.GRAY;
- }
-
- list.add(EnumChatFormatting.GRAY+"A "+MetaToNameMap.get(stack.getItemDamage())+" Ion with a "+aState+" charge state of "+aCharge+"");
- }
- super.addInformation(stack, player, list, bool);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- for (int i = 0; i < IonParticles.overlays.length; i++) {
- IonParticles.overlays[i] = reg.registerIcon(CORE.MODID + ":" + "ion/"+i);
- }
- IonParticles.baseTexture = reg.registerIcon(CORE.MODID + ":" + "ion/IonBase");
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- return IonParticles.overlays[meta];
- }
-
- @Override
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(int aMeta, int aPass) {
- if (aPass == 0) {
- return IonParticles.baseTexture;
- }
- else {
- return IonParticles.overlays[aMeta];
- }
- }
-
- @Override
- public int getRenderPasses(int metadata) {
- return 2;
- }
+ return 0L;
+ }
+ public static final boolean setChargeState(final ItemStack aStack, final long aCharge) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("Ion");
+ if (aNBT != null) {
+ aNBT.setLong("Charge", aCharge);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (stack.getTagCompound() == null) {
+ createNBT(stack);
+ }
+ double chargeState = getChargeState(stack);
+ return chargeState;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ long aCharge = getChargeState(stack);
+ String aState = EnumChatFormatting.YELLOW + "Unknown" + EnumChatFormatting.GRAY;
+ // State not set
+ if (aCharge == 0) {
+ list.add(EnumChatFormatting.GRAY + "A " + MetaToNameMap.get(stack.getItemDamage()) + " Ion with an "
+ + aState + " charge state");
+ } else {
+ if (aCharge > 0) {
+ aState = EnumChatFormatting.GREEN + "Positive" + EnumChatFormatting.GRAY;
+ } else {
+ aState = EnumChatFormatting.RED + "Negative" + EnumChatFormatting.GRAY;
+ }
+
+ list.add(EnumChatFormatting.GRAY + "A " + MetaToNameMap.get(stack.getItemDamage()) + " Ion with a " + aState
+ + " charge state of " + aCharge + "");
+ }
+ super.addInformation(stack, player, list, bool);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ for (int i = 0; i < IonParticles.overlays.length; i++) {
+ IonParticles.overlays[i] = reg.registerIcon(CORE.MODID + ":" + "ion/" + i);
+ }
+ IonParticles.baseTexture = reg.registerIcon(CORE.MODID + ":" + "ion/IonBase");
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return IonParticles.overlays[meta];
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(int aMeta, int aPass) {
+ if (aPass == 0) {
+ return IonParticles.baseTexture;
+ } else {
+ return IonParticles.overlays[aMeta];
+ }
+ }
+
+ @Override
+ public int getRenderPasses(int metadata) {
+ return 2;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java b/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java
index 461a542e15..497334881d 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.item.chemistry;
-import java.util.HashMap;
-
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
@@ -20,6 +18,7 @@ import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.*;
import gtPlusPlus.xmod.bop.HANDLER_BiomesOPlenty;
import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
+import java.util.HashMap;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
@@ -27,794 +26,776 @@ import net.minecraftforge.fluids.FluidStack;
public class MilledOreProcessing extends ItemPackage {
- /**
- * Fluids
- */
-
- public static Fluid SphaleriteFlotationFroth;
- public static Fluid ChalcopyriteFlotationFroth;
- public static Fluid NickelFlotationFroth;
- public static Fluid PlatinumFlotationFroth;
- public static Fluid PentlanditeFlotationFroth;
-
- public static Fluid RedstoneFlotationFroth;
- public static Fluid SpessartineFlotationFroth;
- public static Fluid GrossularFlotationFroth;
- public static Fluid AlmandineFlotationFroth;
- public static Fluid PyropeFlotationFroth;
- public static Fluid MonaziteFlotationFroth;
-
- public static Fluid PineOil;
-
-
- /**
- * Items
- */
-
- // Zinc, Iron, Indium, Germanium
- public static Item milledSphalerite;
-
- // Copper, Iron, Cadmium, Indium
- public static Item milledChalcopyrite;
-
- // Nickel, Cobalt, Rhodium, Ruthenium
- public static Item milledNickel;
-
- // Platinum, Rhodium, Selenium, Tellurium
- public static Item milledPlatinum;
-
- // Iron, Nickel, Promethium, Hafnium
- public static Item milledPentlandite;
-
-
-
-
- // Redstone, Chrome, Firestone, Dysprosium
- public static Item milledRedstone;
-
- // Manganese, Aluminium, Osmium, Strontium
- public static Item milledSpessartine;
-
- // Calcium, Aluminium, Tungsten, Thallium
- public static Item milledGrossular;
-
- // Aluminium, Magnesium, Yttrium, Ytterbium
- public static Item milledAlmandine;
-
- // Magnesium, Manganese, Borax, Rhenium
- public static Item milledPyrope;
-
- // Erbium, Lanthanum, Praseodymium, Europium
- public static Item milledMonazite;
-
-
- @Override
- public void items() {
-
- milledSphalerite = BaseItemMilledOre.generate(Materials.Sphalerite, MaterialUtils.getVoltageForTier(6));
- milledChalcopyrite = BaseItemMilledOre.generate(Materials.Chalcopyrite, MaterialUtils.getVoltageForTier(5));
- milledNickel = BaseItemMilledOre.generate(Materials.Nickel, MaterialUtils.getVoltageForTier(5));
- milledPlatinum = BaseItemMilledOre.generate(Materials.Platinum, MaterialUtils.getVoltageForTier(6));
- milledPentlandite = BaseItemMilledOre.generate(Materials.Pentlandite, MaterialUtils.getVoltageForTier(6));
-
- milledRedstone = BaseItemMilledOre.generate(Materials.Redstone, MaterialUtils.getVoltageForTier(5));
- milledSpessartine = BaseItemMilledOre.generate(Materials.Spessartine, MaterialUtils.getVoltageForTier(6));
- milledGrossular = BaseItemMilledOre.generate(Materials.Grossular, MaterialUtils.getVoltageForTier(6));
- milledAlmandine = BaseItemMilledOre.generate(Materials.Almandine, MaterialUtils.getVoltageForTier(6));
- milledPyrope = BaseItemMilledOre.generate(Materials.Pyrope, MaterialUtils.getVoltageForTier(4));
- milledMonazite = BaseItemMilledOre.generate(Materials.Monazite, MaterialUtils.getVoltageForTier(7));
-
- }
-
- @Override
- public void blocks() {
- // None yet
- }
-
- @Override
- public void fluids() {
-
- short[] aZincFrothRGB = Materials.Sphalerite.mRGBa;
- SphaleriteFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.zincflotation", "Sphalerite Froth", 32 + 175, new short[] { aZincFrothRGB[0], aZincFrothRGB[1], aZincFrothRGB[2], 100 }, true);
- short[] aCopperFrothRGB = Materials.Chalcopyrite.mRGBa;
- ChalcopyriteFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.copperflotation", "Chalcopyrite Froth", 32 + 175, new short[] { aCopperFrothRGB[0], aCopperFrothRGB[1], aCopperFrothRGB[2], 100 }, true);
- short[] aNickelFrothRGB = Materials.Nickel.mRGBa;
- NickelFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.nickelflotation", "Nickel Froth", 32 + 175, new short[] { aNickelFrothRGB[0], aNickelFrothRGB[1], aNickelFrothRGB[2], 100 }, true);
- short[] aPlatinumFrothRGB = Materials.Platinum.mRGBa;
- PlatinumFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.platinumflotation", "Platinum Froth", 32 + 175, new short[] { aPlatinumFrothRGB[0], aPlatinumFrothRGB[1], aPlatinumFrothRGB[2], 100 }, true);
- short[] aPentlanditeFrothRGB = Materials.Pentlandite.mRGBa;
- PentlanditeFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.pentlanditeflotation", "Pentlandite Froth", 32 + 175, new short[] { aPentlanditeFrothRGB[0], aPentlanditeFrothRGB[1], aPentlanditeFrothRGB[2], 100 }, true);
-
- short[] aRedstoneFrothRGB = Materials.Redstone.mRGBa;
- RedstoneFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.redstoneflotation", "Redstone Froth", 32 + 175, new short[] { aRedstoneFrothRGB[0], aRedstoneFrothRGB[1], aRedstoneFrothRGB[2], 100 }, true);
- short[] aSpessartineFrothRGB = Materials.Spessartine.mRGBa;
- SpessartineFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.spessartineflotation", "Spessartine Froth", 32 + 175, new short[] { aSpessartineFrothRGB[0], aSpessartineFrothRGB[1], aSpessartineFrothRGB[2], 100 }, true);
- short[] aGrossularFrothRGB = Materials.Grossular.mRGBa;
- GrossularFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.grossularflotation", "Grossular Froth", 32 + 175, new short[] { aGrossularFrothRGB[0], aGrossularFrothRGB[1], aGrossularFrothRGB[2], 100 }, true);
- short[] aAlmandineFrothRGB = Materials.Almandine.mRGBa;
- AlmandineFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.almandineflotation", "Almandine Froth", 32 + 175, new short[] { aAlmandineFrothRGB[0], aAlmandineFrothRGB[1], aAlmandineFrothRGB[2], 100 }, true);
- short[] aPyropeFrothRGB = Materials.Pyrope.mRGBa;
- PyropeFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.pyropeflotation", "Pyrope Froth", 32 + 175, new short[] { aPyropeFrothRGB[0], aPyropeFrothRGB[1], aPyropeFrothRGB[2], 100 }, true);
- short[] aMonaziteFrothRGB = Materials.Monazite.mRGBa;
- MonaziteFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.Monaziteflotation", "Monazite Froth", 32 + 175, new short[] { aMonaziteFrothRGB[0], aMonaziteFrothRGB[1], aMonaziteFrothRGB[2], 100 }, true);
-
-
- PineOil = FluidUtils.generateFluidNoPrefix("pineoil", "Pine Oil", 32 + 175, new short[] { 250, 200, 60, 100 }, true);
-
- }
-
-
-
- public MilledOreProcessing() {
- super();
- Logger.INFO("Adding Ore Milling content");
- }
-
- private static void addMiscRecipes() {
-
- /*
- * First 5
- */
-
- //milledSphalerite
- registerOreDataForMilledType(
- SphaleriteFlotationFroth,
- ELEMENT.getInstance().ZINC, 180,
- ELEMENT.getInstance().IRON, 120,
- ELEMENT.getInstance().INDIUM, 64,
- ELEMENT.getInstance().GERMANIUM, 15
- );
- //milledChalcopyrite
- registerOreDataForMilledType(
- ChalcopyriteFlotationFroth,
- ELEMENT.getInstance().COPPER, 180,
- ELEMENT.getInstance().IRON, 120,
- ELEMENT.getInstance().CADMIUM, 50,
- ELEMENT.getInstance().INDIUM, 10
- );
- //milledNickel
- registerOreDataForMilledType(
- NickelFlotationFroth,
- ELEMENT.getInstance().NICKEL, 150,
- ELEMENT.getInstance().COBALT, 120,
- ELEMENT.getInstance().RHODIUM, 32,
- ELEMENT.getInstance().RUTHENIUM, 16
- );
- //milledPlatinum
- registerOreDataForMilledType(
- PlatinumFlotationFroth,
- ELEMENT.getInstance().PLATINUM, 120,
- ELEMENT.getInstance().RHODIUM, 60,
- ELEMENT.getInstance().SELENIUM, 40,
- ELEMENT.getInstance().TELLURIUM, 10
- );
- //milledPentlandite
- registerOreDataForMilledType(
- PentlanditeFlotationFroth,
- ELEMENT.getInstance().IRON, 150,
- ELEMENT.getInstance().NICKEL, 100,
- ELEMENT.getInstance().PROMETHIUM, 20,
- ELEMENT.getInstance().HAFNIUM, 10
- );
-
- /*
- * Second 5
- */
- //milledRedstone
- registerOreDataForMilledType(
- RedstoneFlotationFroth,
- NONMATERIAL.REDSTONE, 300,
- ELEMENT.getInstance().CHROMIUM, 60,
- MaterialUtils.generateMaterialFromGtENUM(Materials.Firestone), 45,
- ELEMENT.getInstance().DYSPROSIUM, 16
- );
- //milledSpessartine
- registerOreDataForMilledType(
- SpessartineFlotationFroth,
- ELEMENT.getInstance().MANGANESE, 150,
- ELEMENT.getInstance().ALUMINIUM, 90,
- ELEMENT.getInstance().OSMIUM, 30,
- ELEMENT.getInstance().STRONTIUM, 20
- );
- //milledGrossular
- registerOreDataForMilledType(
- GrossularFlotationFroth,
- ELEMENT.getInstance().CALCIUM, 180,
- ELEMENT.getInstance().ALUMINIUM, 110,
- ELEMENT.getInstance().TUNGSTEN, 60,
- ELEMENT.getInstance().THALLIUM, 15
- );
- //milledAlmandine
- registerOreDataForMilledType(
- AlmandineFlotationFroth,
- ELEMENT.getInstance().ALUMINIUM, 150,
- ELEMENT.getInstance().MAGNESIUM, 75,
- ELEMENT.getInstance().YTTRIUM, 25,
- ELEMENT.getInstance().YTTERBIUM, 15
- );
- //milledPyrope
- registerOreDataForMilledType(
- PyropeFlotationFroth,
- ELEMENT.getInstance().MAGNESIUM, 110,
- ELEMENT.getInstance().MANGANESE, 70,
- MaterialUtils.generateMaterialFromGtENUM(Materials.Borax), 60,
- ELEMENT.getInstance().RHENIUM, 20
- );
- //milledMonazite TODO
- registerOreDataForMilledType(
- MonaziteFlotationFroth,
- ELEMENT.getInstance().ERBIUM, 64,
- ELEMENT.getInstance().LANTHANUM, 32,
- ELEMENT.getInstance().LUTETIUM, 16,
- ELEMENT.getInstance().EUROPIUM, 8
- );
-
-
- }
-
- @Override
- public String errorMessage() {
- return "Failed to generate recipes for OreMillingProc.";
- }
-
- @Override
- public boolean generateRecipes() {
- addMiscRecipes();
- addPineOilExtraction();
- addFlotationRecipes1();
- addFlotationRecipes2();
- addVacuumFurnaceRecipes();
- return true;
- }
-
- private void addVacuumFurnaceRecipes() {
- int aCircuitID = 1;
-
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(SphaleriteFlotationFroth, 4000)
- },
- getOutputsFromMap(SphaleriteFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(6),
- 5500);
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(ChalcopyriteFlotationFroth, 4000)
- },
- getOutputsFromMap(ChalcopyriteFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(5),
- 4500);
-
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(NickelFlotationFroth, 4000)
- },
- getOutputsFromMap(NickelFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(5),
- 4500);
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(PlatinumFlotationFroth, 4000)
- },
- getOutputsFromMap(PlatinumFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(6),
- 5500);
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(PentlanditeFlotationFroth, 4000)
- },
- getOutputsFromMap(PentlanditeFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(6),
- 5500);
-
-
-
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(RedstoneFlotationFroth, 4000)
- },
- getOutputsFromMap(RedstoneFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(5),
- 4500);
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(SpessartineFlotationFroth, 4000)
- },
- getOutputsFromMap(SpessartineFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(6),
- 5500);
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(GrossularFlotationFroth, 4000)
- },
- getOutputsFromMap(GrossularFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(6),
- 5500);
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(AlmandineFlotationFroth, 4000)
- },
- getOutputsFromMap(AlmandineFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(6),
- 5500);
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(PyropeFlotationFroth, 4000)
- },
- getOutputsFromMap(PyropeFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(4),
- 3500);
- CORE.RA.addVacuumFurnaceRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(aCircuitID++)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(MonaziteFlotationFroth, 4000)
- },
- getOutputsFromMap(MonaziteFlotationFroth),
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000),
- FluidUtils.getWater(2000)
- },
- 20 * 120,
- MaterialUtils.getVoltageForTier(7),
- 7500);
-
- }
-
- private void addFlotationRecipes1() {
-
- // Sphalerite
- CORE.RA.addFlotationRecipe(
- Materials.Sphalerite,
- ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 14000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(SphaleriteFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(6)
- );
-
- // Chalcopyrite
- CORE.RA.addFlotationRecipe(
- Materials.Chalcopyrite,
- ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 12000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(ChalcopyriteFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(5)
- );
-
- // Nickel
- CORE.RA.addFlotationRecipe(
- Materials.Nickel,
- ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 25000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(NickelFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(5)
- );
-
- // Platinum
- CORE.RA.addFlotationRecipe(
- Materials.Platinum,
- ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 35000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(PlatinumFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(6)
- );
-
-
- // Pentlandite
- CORE.RA.addFlotationRecipe(
- Materials.Pentlandite,
- ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 14000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(PentlanditeFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(6)
- );
-
- }
-
- private void addFlotationRecipes2() {
-
- // Redstone
- CORE.RA.addFlotationRecipe(
- Materials.Redstone,
- ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 13000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(RedstoneFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(5)
- );
-
- // Spessartine
- CORE.RA.addFlotationRecipe(
- Materials.Spessartine,
- ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 35000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(SpessartineFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(6)
- );
-
- // Grossular
- CORE.RA.addFlotationRecipe(
- Materials.Grossular,
- ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 28000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(GrossularFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(6)
- );
-
- // Almandine
- CORE.RA.addFlotationRecipe(
- Materials.Almandine,
- ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 18000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(AlmandineFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(5)
- );
-
- // Pyrope
- CORE.RA.addFlotationRecipe(
- Materials.Pyrope,
- ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 8000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(PyropeFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(4)
- );
-
- // Monazite
- CORE.RA.addFlotationRecipe(
- Materials.Monazite,
- ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 30000),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(MonaziteFlotationFroth, 1000)
- },
- 20 * 480,
- MaterialUtils.getVoltageForTier(6)
- );
-
- }
-
- private void addPineOilExtraction() {
- AutoMap<ItemStack> aLogs = new AutoMap<ItemStack>();
- AutoMap<ItemStack> aLeaves = new AutoMap<ItemStack>();
- AutoMap<ItemStack> aSaplings = new AutoMap<ItemStack>();
- AutoMap<ItemStack> aPinecones = new AutoMap<ItemStack>();
-
- ItemStack aCrushedPine = ItemUtils.getSimpleStack(AgriculturalChem.mCrushedPine, 1);
-
- aLogs.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.log_Pine));
- aLeaves.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.leaves_Pine));
- aSaplings.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Pine));
- aPinecones.add(ItemUtils.getSimpleStack(AgriculturalChem.mPinecone, 1));
-
- if (LoadedMods.BiomesOPlenty) {
- aLogs.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.logs4, 0, 1));
- aLeaves.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.colorizedLeaves2, 1, 1));
- aSaplings.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.colorizedSaplings, 5, 1));
- aPinecones.add(ItemUtils.simpleMetaStack(HANDLER_BiomesOPlenty.mPineCone, 13, 1));
- }
- if (LoadedMods.Forestry) {
- ItemStack aForestryLog = ItemUtils.getItemStackFromFQRN("Forestry:logs", 1);
- if (aForestryLog != null) {
- aForestryLog.setItemDamage(20); // Set to Pine
- aLogs.add(aForestryLog);
- }
- ItemStack aForestryLeaves = ItemUtils.getItemStackFromFQRN("Forestry:leaves", 1);
- if (aForestryLeaves != null) {
- NBTUtils.setString(aForestryLeaves, "species", "forestry.treePine"); // Set to Pine
- aLeaves.add(aForestryLeaves);
- }
- }
-
- for (ItemStack aLog : aLogs) {
- addRecipe(aLog, ItemUtils.getSimpleStack(aCrushedPine, 16), new int[] {10000, 7500, 5000, 2500}, 10, 120);
- }
- for (ItemStack aLeaf : aLeaves) {
- addRecipe(aLeaf, ItemUtils.getSimpleStack(aCrushedPine, 2), new int[] {5000, 5000, 2500, 2500}, 10, 30);
- }
- for (ItemStack aSapling : aSaplings) {
- addRecipe(aSapling, ItemUtils.getSimpleStack(aCrushedPine, 4), new int[] {7500, 7500, 2500, 2500}, 10, 60);
- }
- for (ItemStack aCone : aPinecones) {
- addRecipe(aCone, ItemUtils.getSimpleStack(aCrushedPine, 1), new int[] {7500, 7500, 5000, 2500}, 10, 60);
- }
-
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(16),
- ItemUtils.getSimpleStack(aCrushedPine, 64)
- },
- new FluidStack[] {
- FluidUtils.getSteam(5000),
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 500)
- },
- new int[] {
- 2000, 2000, 2000, 2000
- },
- 20 * 60,
- 120,
- 3);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemUtils.getSimpleStack(aCrushedPine, 64)
- },
- new FluidStack[] {
- FluidUtils.getSuperHeatedSteam(5000),
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(PineOil, 1500)
- },
- new int[] {
- 3000, 3000, 3000, 3000
- },
- 20 * 45,
- 120,
- 4);
-
- }
-
- public boolean addRecipe(ItemStack aInput, ItemStack aOutput1, int[] aChances, int aTime, int aEU) {
- aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
- ItemStack aOutputs[] = new ItemStack[4];
- for (int i=0;i<aChances.length;i++) {
- aOutputs[i] = aOutput1;
- }
- aOutputs = cleanArray(aOutputs);
- if ((GT_Utility.isStackInvalid(aInput)) || (GT_Utility.isStackInvalid(aOutput1) || (GT_Utility.getContainerItem(aInput, false) != null))) {
- return false;
- }
-
- return CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(14),
- aInput
- },
- new FluidStack[] {
-
- },
- aOutputs,
- new FluidStack[] {
-
- },
- aChances,
- aTime * 20,
- aEU,
- 3);
- }
-
- public static ItemStack[] cleanArray(ItemStack[] input) {
- int aArraySize = input.length;
- AutoMap<ItemStack> aCleanedItems = new AutoMap<ItemStack>();
- for (ItemStack checkStack : input) {
- if (ItemUtils.checkForInvalidItems(checkStack)) {
- aCleanedItems.put(checkStack);
- }
- }
- ItemStack[] aOutput = new ItemStack[aCleanedItems.size()];
- for (int i=0;i<aArraySize;i++) {
- ItemStack aMappedStack = aCleanedItems.get(i);
- if (aMappedStack != null){
- aOutput[i] = aMappedStack;
- }
- }
- return aOutput;
- }
-
- private static final HashMap<String, Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>>> aMilledFluidMap = new HashMap<String, Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>>>();
-
- public static void registerOreDataForMilledType(Fluid aMilledFluid, Materials aOutput1, int aPerc1, Materials aOutput2, int aPerc2, Materials aOutput3, int aPerc3, Materials aOutput4, int aPerc4) {
- registerOreDataForMilledType(aMilledFluid, MaterialUtils.generateMaterialFromGtENUM(aOutput1), aPerc1, MaterialUtils.generateMaterialFromGtENUM(aOutput2), aPerc2, MaterialUtils.generateMaterialFromGtENUM(aOutput3), aPerc3, MaterialUtils.generateMaterialFromGtENUM(aOutput4), aPerc4);
- }
-
- public static void registerOreDataForMilledType(Fluid aMilledFluid, Material aOutput1, int aPerc1, Material aOutput2, int aPerc2, Material aOutput3, int aPerc3, Material aOutput4, int aPerc4) {
-
- Pair<Material, Integer> aFluidOutput1 = new Pair<Material, Integer>(aOutput1, aPerc1);
- Pair<Material, Integer> aFluidOutput2 = new Pair<Material, Integer>(aOutput2, aPerc2);
- Pair<Material, Integer> aFluidOutput3 = new Pair<Material, Integer>(aOutput3, aPerc3);
- Pair<Material, Integer> aFluidOutput4 = new Pair<Material, Integer>(aOutput4, aPerc4);
- Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>> aDataQuad = new Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>>(aFluidOutput1, aFluidOutput2, aFluidOutput3, aFluidOutput4);
- aMilledFluidMap.put(aMilledFluid.getUnlocalizedName(), aDataQuad);
-
- }
-
- private static ItemStack[] getOutputsFromMap(Fluid aFluid) {
- String aKey = aFluid.getUnlocalizedName();
- return getArrayFromQuad(aMilledFluidMap.get(aKey));
- }
-
- private static ItemStack[] getArrayFromQuad(Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>> aData) {
- AutoMap<ItemStack> aOutputs = new AutoMap<ItemStack>();
- for (Object aPair : aData.values()) {
- if (aPair != null && Pair.class.isInstance(aPair)) {
- Pair aObj = (Pair) aPair;
- Material aMat = (Material) aObj.getKey();
- int aCount = (int) aObj.getValue();
- aOutputs.addAll(getItemStackFromPair(aMat, aCount));
- }
- }
- ItemStack[] aRealOutputArray = new ItemStack[aOutputs.size()];
- int aIndex = 0;
- for (ItemStack aStack : aOutputs) {
- aRealOutputArray[aIndex++] = aStack;
- }
- return aRealOutputArray;
- }
-
- private static AutoMap<ItemStack> getItemStackFromPair(Material aMat, Integer aCount) {
- AutoMap<ItemStack> aOutputs = new AutoMap<ItemStack>();
- if (aCount > 64) {
- AutoMap<Integer> sizes = getStackSizes(aCount);
- for (int aSplitSize : sizes) {
- ItemStack aDustStack = aMat.getDust(aSplitSize);
- aOutputs.put(aDustStack);
- }
- }
- else {
- ItemStack aDustStack = aMat.getDust(aCount);
- aOutputs.put(aDustStack);
- }
- return aOutputs;
- }
-
- private static AutoMap<Integer> getStackSizes(int aBigSize){
- AutoMap<Integer> aSizes = new AutoMap<Integer>();
- if (aBigSize <= 64) {
- aSizes.add(aBigSize);
- }
- else {
- for (int i = aBigSize; i > 0; i -= 64) {
- aSizes.add(i);
- }
- }
- return aSizes;
- }
-
+ /**
+ * Fluids
+ */
+ public static Fluid SphaleriteFlotationFroth;
+
+ public static Fluid ChalcopyriteFlotationFroth;
+ public static Fluid NickelFlotationFroth;
+ public static Fluid PlatinumFlotationFroth;
+ public static Fluid PentlanditeFlotationFroth;
+
+ public static Fluid RedstoneFlotationFroth;
+ public static Fluid SpessartineFlotationFroth;
+ public static Fluid GrossularFlotationFroth;
+ public static Fluid AlmandineFlotationFroth;
+ public static Fluid PyropeFlotationFroth;
+ public static Fluid MonaziteFlotationFroth;
+
+ public static Fluid PineOil;
+
+ /**
+ * Items
+ */
+
+ // Zinc, Iron, Indium, Germanium
+ public static Item milledSphalerite;
+
+ // Copper, Iron, Cadmium, Indium
+ public static Item milledChalcopyrite;
+
+ // Nickel, Cobalt, Rhodium, Ruthenium
+ public static Item milledNickel;
+
+ // Platinum, Rhodium, Selenium, Tellurium
+ public static Item milledPlatinum;
+
+ // Iron, Nickel, Promethium, Hafnium
+ public static Item milledPentlandite;
+
+ // Redstone, Chrome, Firestone, Dysprosium
+ public static Item milledRedstone;
+
+ // Manganese, Aluminium, Osmium, Strontium
+ public static Item milledSpessartine;
+
+ // Calcium, Aluminium, Tungsten, Thallium
+ public static Item milledGrossular;
+
+ // Aluminium, Magnesium, Yttrium, Ytterbium
+ public static Item milledAlmandine;
+
+ // Magnesium, Manganese, Borax, Rhenium
+ public static Item milledPyrope;
+
+ // Erbium, Lanthanum, Praseodymium, Europium
+ public static Item milledMonazite;
+
+ @Override
+ public void items() {
+
+ milledSphalerite = BaseItemMilledOre.generate(Materials.Sphalerite, MaterialUtils.getVoltageForTier(6));
+ milledChalcopyrite = BaseItemMilledOre.generate(Materials.Chalcopyrite, MaterialUtils.getVoltageForTier(5));
+ milledNickel = BaseItemMilledOre.generate(Materials.Nickel, MaterialUtils.getVoltageForTier(5));
+ milledPlatinum = BaseItemMilledOre.generate(Materials.Platinum, MaterialUtils.getVoltageForTier(6));
+ milledPentlandite = BaseItemMilledOre.generate(Materials.Pentlandite, MaterialUtils.getVoltageForTier(6));
+
+ milledRedstone = BaseItemMilledOre.generate(Materials.Redstone, MaterialUtils.getVoltageForTier(5));
+ milledSpessartine = BaseItemMilledOre.generate(Materials.Spessartine, MaterialUtils.getVoltageForTier(6));
+ milledGrossular = BaseItemMilledOre.generate(Materials.Grossular, MaterialUtils.getVoltageForTier(6));
+ milledAlmandine = BaseItemMilledOre.generate(Materials.Almandine, MaterialUtils.getVoltageForTier(6));
+ milledPyrope = BaseItemMilledOre.generate(Materials.Pyrope, MaterialUtils.getVoltageForTier(4));
+ milledMonazite = BaseItemMilledOre.generate(Materials.Monazite, MaterialUtils.getVoltageForTier(7));
+ }
+
+ @Override
+ public void blocks() {
+ // None yet
+ }
+
+ @Override
+ public void fluids() {
+
+ short[] aZincFrothRGB = Materials.Sphalerite.mRGBa;
+ SphaleriteFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.zincflotation",
+ "Sphalerite Froth",
+ 32 + 175,
+ new short[] {aZincFrothRGB[0], aZincFrothRGB[1], aZincFrothRGB[2], 100},
+ true);
+ short[] aCopperFrothRGB = Materials.Chalcopyrite.mRGBa;
+ ChalcopyriteFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.copperflotation",
+ "Chalcopyrite Froth",
+ 32 + 175,
+ new short[] {aCopperFrothRGB[0], aCopperFrothRGB[1], aCopperFrothRGB[2], 100},
+ true);
+ short[] aNickelFrothRGB = Materials.Nickel.mRGBa;
+ NickelFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.nickelflotation",
+ "Nickel Froth",
+ 32 + 175,
+ new short[] {aNickelFrothRGB[0], aNickelFrothRGB[1], aNickelFrothRGB[2], 100},
+ true);
+ short[] aPlatinumFrothRGB = Materials.Platinum.mRGBa;
+ PlatinumFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.platinumflotation",
+ "Platinum Froth",
+ 32 + 175,
+ new short[] {aPlatinumFrothRGB[0], aPlatinumFrothRGB[1], aPlatinumFrothRGB[2], 100},
+ true);
+ short[] aPentlanditeFrothRGB = Materials.Pentlandite.mRGBa;
+ PentlanditeFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.pentlanditeflotation",
+ "Pentlandite Froth",
+ 32 + 175,
+ new short[] {aPentlanditeFrothRGB[0], aPentlanditeFrothRGB[1], aPentlanditeFrothRGB[2], 100},
+ true);
+
+ short[] aRedstoneFrothRGB = Materials.Redstone.mRGBa;
+ RedstoneFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.redstoneflotation",
+ "Redstone Froth",
+ 32 + 175,
+ new short[] {aRedstoneFrothRGB[0], aRedstoneFrothRGB[1], aRedstoneFrothRGB[2], 100},
+ true);
+ short[] aSpessartineFrothRGB = Materials.Spessartine.mRGBa;
+ SpessartineFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.spessartineflotation",
+ "Spessartine Froth",
+ 32 + 175,
+ new short[] {aSpessartineFrothRGB[0], aSpessartineFrothRGB[1], aSpessartineFrothRGB[2], 100},
+ true);
+ short[] aGrossularFrothRGB = Materials.Grossular.mRGBa;
+ GrossularFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.grossularflotation",
+ "Grossular Froth",
+ 32 + 175,
+ new short[] {aGrossularFrothRGB[0], aGrossularFrothRGB[1], aGrossularFrothRGB[2], 100},
+ true);
+ short[] aAlmandineFrothRGB = Materials.Almandine.mRGBa;
+ AlmandineFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.almandineflotation",
+ "Almandine Froth",
+ 32 + 175,
+ new short[] {aAlmandineFrothRGB[0], aAlmandineFrothRGB[1], aAlmandineFrothRGB[2], 100},
+ true);
+ short[] aPyropeFrothRGB = Materials.Pyrope.mRGBa;
+ PyropeFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.pyropeflotation",
+ "Pyrope Froth",
+ 32 + 175,
+ new short[] {aPyropeFrothRGB[0], aPyropeFrothRGB[1], aPyropeFrothRGB[2], 100},
+ true);
+ short[] aMonaziteFrothRGB = Materials.Monazite.mRGBa;
+ MonaziteFlotationFroth = FluidUtils.generateFluidNoPrefix(
+ "froth.Monaziteflotation",
+ "Monazite Froth",
+ 32 + 175,
+ new short[] {aMonaziteFrothRGB[0], aMonaziteFrothRGB[1], aMonaziteFrothRGB[2], 100},
+ true);
+
+ PineOil = FluidUtils.generateFluidNoPrefix(
+ "pineoil", "Pine Oil", 32 + 175, new short[] {250, 200, 60, 100}, true);
+ }
+
+ public MilledOreProcessing() {
+ super();
+ Logger.INFO("Adding Ore Milling content");
+ }
+
+ private static void addMiscRecipes() {
+
+ /*
+ * First 5
+ */
+
+ // milledSphalerite
+ registerOreDataForMilledType(
+ SphaleriteFlotationFroth,
+ ELEMENT.getInstance().ZINC,
+ 180,
+ ELEMENT.getInstance().IRON,
+ 120,
+ ELEMENT.getInstance().INDIUM,
+ 64,
+ ELEMENT.getInstance().GERMANIUM,
+ 15);
+ // milledChalcopyrite
+ registerOreDataForMilledType(
+ ChalcopyriteFlotationFroth,
+ ELEMENT.getInstance().COPPER,
+ 180,
+ ELEMENT.getInstance().IRON,
+ 120,
+ ELEMENT.getInstance().CADMIUM,
+ 50,
+ ELEMENT.getInstance().INDIUM,
+ 10);
+ // milledNickel
+ registerOreDataForMilledType(
+ NickelFlotationFroth,
+ ELEMENT.getInstance().NICKEL,
+ 150,
+ ELEMENT.getInstance().COBALT,
+ 120,
+ ELEMENT.getInstance().RHODIUM,
+ 32,
+ ELEMENT.getInstance().RUTHENIUM,
+ 16);
+ // milledPlatinum
+ registerOreDataForMilledType(
+ PlatinumFlotationFroth,
+ ELEMENT.getInstance().PLATINUM,
+ 120,
+ ELEMENT.getInstance().RHODIUM,
+ 60,
+ ELEMENT.getInstance().SELENIUM,
+ 40,
+ ELEMENT.getInstance().TELLURIUM,
+ 10);
+ // milledPentlandite
+ registerOreDataForMilledType(
+ PentlanditeFlotationFroth,
+ ELEMENT.getInstance().IRON,
+ 150,
+ ELEMENT.getInstance().NICKEL,
+ 100,
+ ELEMENT.getInstance().PROMETHIUM,
+ 20,
+ ELEMENT.getInstance().HAFNIUM,
+ 10);
+
+ /*
+ * Second 5
+ */
+ // milledRedstone
+ registerOreDataForMilledType(
+ RedstoneFlotationFroth,
+ NONMATERIAL.REDSTONE,
+ 300,
+ ELEMENT.getInstance().CHROMIUM,
+ 60,
+ MaterialUtils.generateMaterialFromGtENUM(Materials.Firestone),
+ 45,
+ ELEMENT.getInstance().DYSPROSIUM,
+ 16);
+ // milledSpessartine
+ registerOreDataForMilledType(
+ SpessartineFlotationFroth,
+ ELEMENT.getInstance().MANGANESE,
+ 150,
+ ELEMENT.getInstance().ALUMINIUM,
+ 90,
+ ELEMENT.getInstance().OSMIUM,
+ 30,
+ ELEMENT.getInstance().STRONTIUM,
+ 20);
+ // milledGrossular
+ registerOreDataForMilledType(
+ GrossularFlotationFroth,
+ ELEMENT.getInstance().CALCIUM,
+ 180,
+ ELEMENT.getInstance().ALUMINIUM,
+ 110,
+ ELEMENT.getInstance().TUNGSTEN,
+ 60,
+ ELEMENT.getInstance().THALLIUM,
+ 15);
+ // milledAlmandine
+ registerOreDataForMilledType(
+ AlmandineFlotationFroth,
+ ELEMENT.getInstance().ALUMINIUM,
+ 150,
+ ELEMENT.getInstance().MAGNESIUM,
+ 75,
+ ELEMENT.getInstance().YTTRIUM,
+ 25,
+ ELEMENT.getInstance().YTTERBIUM,
+ 15);
+ // milledPyrope
+ registerOreDataForMilledType(
+ PyropeFlotationFroth,
+ ELEMENT.getInstance().MAGNESIUM,
+ 110,
+ ELEMENT.getInstance().MANGANESE,
+ 70,
+ MaterialUtils.generateMaterialFromGtENUM(Materials.Borax),
+ 60,
+ ELEMENT.getInstance().RHENIUM,
+ 20);
+ // milledMonazite TODO
+ registerOreDataForMilledType(
+ MonaziteFlotationFroth,
+ ELEMENT.getInstance().ERBIUM,
+ 64,
+ ELEMENT.getInstance().LANTHANUM,
+ 32,
+ ELEMENT.getInstance().LUTETIUM,
+ 16,
+ ELEMENT.getInstance().EUROPIUM,
+ 8);
+ }
+
+ @Override
+ public String errorMessage() {
+ return "Failed to generate recipes for OreMillingProc.";
+ }
+
+ @Override
+ public boolean generateRecipes() {
+ addMiscRecipes();
+ addPineOilExtraction();
+ addFlotationRecipes1();
+ addFlotationRecipes2();
+ addVacuumFurnaceRecipes();
+ return true;
+ }
+
+ private void addVacuumFurnaceRecipes() {
+ int aCircuitID = 1;
+
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(SphaleriteFlotationFroth, 4000)},
+ getOutputsFromMap(SphaleriteFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(6),
+ 5500);
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(ChalcopyriteFlotationFroth, 4000)},
+ getOutputsFromMap(ChalcopyriteFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(5),
+ 4500);
+
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(NickelFlotationFroth, 4000)},
+ getOutputsFromMap(NickelFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(5),
+ 4500);
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(PlatinumFlotationFroth, 4000)},
+ getOutputsFromMap(PlatinumFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(6),
+ 5500);
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(PentlanditeFlotationFroth, 4000)},
+ getOutputsFromMap(PentlanditeFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(6),
+ 5500);
+
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(RedstoneFlotationFroth, 4000)},
+ getOutputsFromMap(RedstoneFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(5),
+ 4500);
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(SpessartineFlotationFroth, 4000)},
+ getOutputsFromMap(SpessartineFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(6),
+ 5500);
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(GrossularFlotationFroth, 4000)},
+ getOutputsFromMap(GrossularFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(6),
+ 5500);
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(AlmandineFlotationFroth, 4000)},
+ getOutputsFromMap(AlmandineFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(6),
+ 5500);
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(PyropeFlotationFroth, 4000)},
+ getOutputsFromMap(PyropeFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(4),
+ 3500);
+ CORE.RA.addVacuumFurnaceRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(aCircuitID++)},
+ new FluidStack[] {FluidUtils.getFluidStack(MonaziteFlotationFroth, 4000)},
+ getOutputsFromMap(MonaziteFlotationFroth),
+ new FluidStack[] {FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), FluidUtils.getWater(2000)},
+ 20 * 120,
+ MaterialUtils.getVoltageForTier(7),
+ 7500);
+ }
+
+ private void addFlotationRecipes1() {
+
+ // Sphalerite
+ CORE.RA.addFlotationRecipe(
+ Materials.Sphalerite,
+ ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 14000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(SphaleriteFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Chalcopyrite
+ CORE.RA.addFlotationRecipe(
+ Materials.Chalcopyrite,
+ ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 12000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(ChalcopyriteFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(5));
+
+ // Nickel
+ CORE.RA.addFlotationRecipe(
+ Materials.Nickel,
+ ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 25000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(NickelFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(5));
+
+ // Platinum
+ CORE.RA.addFlotationRecipe(
+ Materials.Platinum,
+ ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 35000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(PlatinumFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Pentlandite
+ CORE.RA.addFlotationRecipe(
+ Materials.Pentlandite,
+ ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 14000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(PentlanditeFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(6));
+ }
+
+ private void addFlotationRecipes2() {
+
+ // Redstone
+ CORE.RA.addFlotationRecipe(
+ Materials.Redstone,
+ ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 13000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(RedstoneFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(5));
+
+ // Spessartine
+ CORE.RA.addFlotationRecipe(
+ Materials.Spessartine,
+ ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 35000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(SpessartineFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Grossular
+ CORE.RA.addFlotationRecipe(
+ Materials.Grossular,
+ ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 28000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(GrossularFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Almandine
+ CORE.RA.addFlotationRecipe(
+ Materials.Almandine,
+ ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 18000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(AlmandineFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(5));
+
+ // Pyrope
+ CORE.RA.addFlotationRecipe(
+ Materials.Pyrope,
+ ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 8000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(PyropeFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(4));
+
+ // Monazite
+ CORE.RA.addFlotationRecipe(
+ Materials.Monazite,
+ ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1),
+ new FluidStack[] {
+ FluidUtils.getFluidStack(PineOil, 30000),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(MonaziteFlotationFroth, 1000)},
+ 20 * 480,
+ MaterialUtils.getVoltageForTier(6));
+ }
+
+ private void addPineOilExtraction() {
+ AutoMap<ItemStack> aLogs = new AutoMap<ItemStack>();
+ AutoMap<ItemStack> aLeaves = new AutoMap<ItemStack>();
+ AutoMap<ItemStack> aSaplings = new AutoMap<ItemStack>();
+ AutoMap<ItemStack> aPinecones = new AutoMap<ItemStack>();
+
+ ItemStack aCrushedPine = ItemUtils.getSimpleStack(AgriculturalChem.mCrushedPine, 1);
+
+ aLogs.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.log_Pine));
+ aLeaves.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.leaves_Pine));
+ aSaplings.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Pine));
+ aPinecones.add(ItemUtils.getSimpleStack(AgriculturalChem.mPinecone, 1));
+
+ if (LoadedMods.BiomesOPlenty) {
+ aLogs.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.logs4, 0, 1));
+ aLeaves.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.colorizedLeaves2, 1, 1));
+ aSaplings.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.colorizedSaplings, 5, 1));
+ aPinecones.add(ItemUtils.simpleMetaStack(HANDLER_BiomesOPlenty.mPineCone, 13, 1));
+ }
+ if (LoadedMods.Forestry) {
+ ItemStack aForestryLog = ItemUtils.getItemStackFromFQRN("Forestry:logs", 1);
+ if (aForestryLog != null) {
+ aForestryLog.setItemDamage(20); // Set to Pine
+ aLogs.add(aForestryLog);
+ }
+ ItemStack aForestryLeaves = ItemUtils.getItemStackFromFQRN("Forestry:leaves", 1);
+ if (aForestryLeaves != null) {
+ NBTUtils.setString(aForestryLeaves, "species", "forestry.treePine"); // Set to Pine
+ aLeaves.add(aForestryLeaves);
+ }
+ }
+
+ for (ItemStack aLog : aLogs) {
+ addRecipe(aLog, ItemUtils.getSimpleStack(aCrushedPine, 16), new int[] {10000, 7500, 5000, 2500}, 10, 120);
+ }
+ for (ItemStack aLeaf : aLeaves) {
+ addRecipe(aLeaf, ItemUtils.getSimpleStack(aCrushedPine, 2), new int[] {5000, 5000, 2500, 2500}, 10, 30);
+ }
+ for (ItemStack aSapling : aSaplings) {
+ addRecipe(aSapling, ItemUtils.getSimpleStack(aCrushedPine, 4), new int[] {7500, 7500, 2500, 2500}, 10, 60);
+ }
+ for (ItemStack aCone : aPinecones) {
+ addRecipe(aCone, ItemUtils.getSimpleStack(aCrushedPine, 1), new int[] {7500, 7500, 5000, 2500}, 10, 60);
+ }
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(16), ItemUtils.getSimpleStack(aCrushedPine, 64)},
+ new FluidStack[] {
+ FluidUtils.getSteam(5000),
+ },
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5)
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(PineOil, 500)},
+ new int[] {2000, 2000, 2000, 2000},
+ 20 * 60,
+ 120,
+ 3);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(18), ItemUtils.getSimpleStack(aCrushedPine, 64)},
+ new FluidStack[] {
+ FluidUtils.getSuperHeatedSteam(5000),
+ },
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5)
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(PineOil, 1500)},
+ new int[] {3000, 3000, 3000, 3000},
+ 20 * 45,
+ 120,
+ 4);
+ }
+
+ public boolean addRecipe(ItemStack aInput, ItemStack aOutput1, int[] aChances, int aTime, int aEU) {
+ aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
+ ItemStack aOutputs[] = new ItemStack[4];
+ for (int i = 0; i < aChances.length; i++) {
+ aOutputs[i] = aOutput1;
+ }
+ aOutputs = cleanArray(aOutputs);
+ if ((GT_Utility.isStackInvalid(aInput))
+ || (GT_Utility.isStackInvalid(aOutput1) || (GT_Utility.getContainerItem(aInput, false) != null))) {
+ return false;
+ }
+
+ return CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(14), aInput},
+ new FluidStack[] {},
+ aOutputs,
+ new FluidStack[] {},
+ aChances,
+ aTime * 20,
+ aEU,
+ 3);
+ }
+
+ public static ItemStack[] cleanArray(ItemStack[] input) {
+ int aArraySize = input.length;
+ AutoMap<ItemStack> aCleanedItems = new AutoMap<ItemStack>();
+ for (ItemStack checkStack : input) {
+ if (ItemUtils.checkForInvalidItems(checkStack)) {
+ aCleanedItems.put(checkStack);
+ }
+ }
+ ItemStack[] aOutput = new ItemStack[aCleanedItems.size()];
+ for (int i = 0; i < aArraySize; i++) {
+ ItemStack aMappedStack = aCleanedItems.get(i);
+ if (aMappedStack != null) {
+ aOutput[i] = aMappedStack;
+ }
+ }
+ return aOutput;
+ }
+
+ private static final HashMap<
+ String,
+ Quad<
+ Pair<Material, Integer>,
+ Pair<Material, Integer>,
+ Pair<Material, Integer>,
+ Pair<Material, Integer>>>
+ aMilledFluidMap = new HashMap<
+ String,
+ Quad<
+ Pair<Material, Integer>,
+ Pair<Material, Integer>,
+ Pair<Material, Integer>,
+ Pair<Material, Integer>>>();
+
+ public static void registerOreDataForMilledType(
+ Fluid aMilledFluid,
+ Materials aOutput1,
+ int aPerc1,
+ Materials aOutput2,
+ int aPerc2,
+ Materials aOutput3,
+ int aPerc3,
+ Materials aOutput4,
+ int aPerc4) {
+ registerOreDataForMilledType(
+ aMilledFluid,
+ MaterialUtils.generateMaterialFromGtENUM(aOutput1),
+ aPerc1,
+ MaterialUtils.generateMaterialFromGtENUM(aOutput2),
+ aPerc2,
+ MaterialUtils.generateMaterialFromGtENUM(aOutput3),
+ aPerc3,
+ MaterialUtils.generateMaterialFromGtENUM(aOutput4),
+ aPerc4);
+ }
+
+ public static void registerOreDataForMilledType(
+ Fluid aMilledFluid,
+ Material aOutput1,
+ int aPerc1,
+ Material aOutput2,
+ int aPerc2,
+ Material aOutput3,
+ int aPerc3,
+ Material aOutput4,
+ int aPerc4) {
+
+ Pair<Material, Integer> aFluidOutput1 = new Pair<Material, Integer>(aOutput1, aPerc1);
+ Pair<Material, Integer> aFluidOutput2 = new Pair<Material, Integer>(aOutput2, aPerc2);
+ Pair<Material, Integer> aFluidOutput3 = new Pair<Material, Integer>(aOutput3, aPerc3);
+ Pair<Material, Integer> aFluidOutput4 = new Pair<Material, Integer>(aOutput4, aPerc4);
+ Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>>
+ aDataQuad = new Quad<
+ Pair<Material, Integer>,
+ Pair<Material, Integer>,
+ Pair<Material, Integer>,
+ Pair<Material, Integer>>(aFluidOutput1, aFluidOutput2, aFluidOutput3, aFluidOutput4);
+ aMilledFluidMap.put(aMilledFluid.getUnlocalizedName(), aDataQuad);
+ }
+
+ private static ItemStack[] getOutputsFromMap(Fluid aFluid) {
+ String aKey = aFluid.getUnlocalizedName();
+ return getArrayFromQuad(aMilledFluidMap.get(aKey));
+ }
+
+ private static ItemStack[] getArrayFromQuad(
+ Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>>
+ aData) {
+ AutoMap<ItemStack> aOutputs = new AutoMap<ItemStack>();
+ for (Object aPair : aData.values()) {
+ if (aPair != null && Pair.class.isInstance(aPair)) {
+ Pair aObj = (Pair) aPair;
+ Material aMat = (Material) aObj.getKey();
+ int aCount = (int) aObj.getValue();
+ aOutputs.addAll(getItemStackFromPair(aMat, aCount));
+ }
+ }
+ ItemStack[] aRealOutputArray = new ItemStack[aOutputs.size()];
+ int aIndex = 0;
+ for (ItemStack aStack : aOutputs) {
+ aRealOutputArray[aIndex++] = aStack;
+ }
+ return aRealOutputArray;
+ }
+
+ private static AutoMap<ItemStack> getItemStackFromPair(Material aMat, Integer aCount) {
+ AutoMap<ItemStack> aOutputs = new AutoMap<ItemStack>();
+ if (aCount > 64) {
+ AutoMap<Integer> sizes = getStackSizes(aCount);
+ for (int aSplitSize : sizes) {
+ ItemStack aDustStack = aMat.getDust(aSplitSize);
+ aOutputs.put(aDustStack);
+ }
+ } else {
+ ItemStack aDustStack = aMat.getDust(aCount);
+ aOutputs.put(aDustStack);
+ }
+ return aOutputs;
+ }
+
+ private static AutoMap<Integer> getStackSizes(int aBigSize) {
+ AutoMap<Integer> aSizes = new AutoMap<Integer>();
+ if (aBigSize <= 64) {
+ aSizes.add(aBigSize);
+ } else {
+ for (int i = aBigSize; i > 0; i -= 64) {
+ aSizes.add(i);
+ }
+ }
+ return aSizes;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java
index 61f8b0a236..069ab4a724 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java
@@ -2,7 +2,6 @@ package gtPlusPlus.core.item.chemistry;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase;
import gtPlusPlus.core.item.chemistry.general.ItemNuclearChemBase;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
@@ -14,103 +13,102 @@ import net.minecraftforge.fluids.Fluid;
public class NuclearChem extends ItemPackage {
- public static Fluid Burnt_LiFBeF2ThF4UF4;
- public static Fluid Burnt_LiFBeF2ZrF4UF4;
- public static Fluid Burnt_LiFBeF2ZrF4U235;
-
-
- public static Fluid Impure_LiFBeF2;
-
- public static Fluid GeneticMutagen;
- private static boolean generateMutagenRecipe = false;
-
- public static ItemNuclearChemBase mNuclearChemItem1;
-
- public static ItemStack mResidueUranium;
- public static ItemStack mResiduePlutonium;
- public static ItemStack mResidueFluorides;
- public static ItemStack mResidueNobles;
-
- @Override
- public void items() {
-
- mNuclearChemItem1 = new ItemNuclearChemBase();
- registerItemStacks();
- registerOreDict();
- }
-
-
- public void registerItemStacks() {
-
- mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 0, 1);
- mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 1, 1);
- mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 2, 1);
- mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 3, 1);
-
- }
-
- public void registerOreDict() {
-
- ItemUtils.addItemToOreDictionary(mResidueUranium, "dustResidueUranium");
- ItemUtils.addItemToOreDictionary(mResiduePlutonium, "dustResiduePlutonium");
- ItemUtils.addItemToOreDictionary(mResidueFluorides, "dustResidueFluoride");
- ItemUtils.addItemToOreDictionary(mResidueNobles, "dustResidueNoble");
-
- }
-
- @Override
- public void blocks() {
- }
-
- @Override
- public void fluids() {
- //Create Used Nuclear Fuels
- Burnt_LiFBeF2ThF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ThF4UF4", "Burnt LiFBeF2ThF4UF4 Salt", 545, new short[]{48, 175, 48, 100}, null, null);
- Burnt_LiFBeF2ZrF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4UF4", "Burnt LiFBeF2ZrF4UF4 Salt", 520, new short[]{48, 168, 68, 100}, null, null);
- Burnt_LiFBeF2ZrF4U235 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4U235", "Burnt LiFBeF2ZrF4U235 Salt", 533, new short[]{68, 185, 48, 100}, null, null);
- Impure_LiFBeF2 = FluidUtils.generateFluidNonMolten("ImpureLiFBeF2", "Impure Molten Salt Base", 533, new short[]{110, 75, 186, 100}, null, null);
- if (FluidUtils.getFluidStack("fluid.Mutagen", 1) == null) {
- GeneticMutagen = FluidUtils.generateFluidNonMolten("GeneticMutagen", "Genetic Mutagen", 12, new short[]{22, 148, 185, 100}, null, null);
- generateMutagenRecipe = true;
- }
- else {
- GeneticMutagen = FluidUtils.getFluidStack("fluid.Mutagen", 1).getFluid();
- }
- }
-
- @Override
- public String errorMessage() {
- return "Bad Nuclear Chemistry Recipes.";
- }
-
- @Override
- public boolean generateRecipes() {
- if (generateMutagenRecipe) {
- chemReator_CreateMutagen();
- }
- chemReactor_MutagenWithEggs();
- return true;
- }
-
- private static void chemReator_CreateMutagen() {
- CORE.RA.addChemicalRecipe(
- CI.getNumberedCircuit(20),
- ItemUtils.getSimpleStack(Items.nether_star, 2),
- FluidUtils.getMobEssence(5000),
- FluidUtils.getFluidStack(GeneticMutagen, 8000),
- null,
- 30*20,
- 500);
- }
-
- private static void chemReactor_MutagenWithEggs() {
- CORE.RA.addChemicalRecipe(
- CI.getNumberedCircuit(20),
- ItemUtils.getSimpleStack(Items.egg, 2),
- FluidUtils.getFluidStack(GeneticMutagen, 500),
- null,
- ItemUtils.getSimpleStack(ModItems.itemBigEgg, 2),
- 300*20,
- 500);
- }
+ public static Fluid Burnt_LiFBeF2ThF4UF4;
+ public static Fluid Burnt_LiFBeF2ZrF4UF4;
+ public static Fluid Burnt_LiFBeF2ZrF4U235;
+
+ public static Fluid Impure_LiFBeF2;
+
+ public static Fluid GeneticMutagen;
+ private static boolean generateMutagenRecipe = false;
+
+ public static ItemNuclearChemBase mNuclearChemItem1;
+
+ public static ItemStack mResidueUranium;
+ public static ItemStack mResiduePlutonium;
+ public static ItemStack mResidueFluorides;
+ public static ItemStack mResidueNobles;
+
+ @Override
+ public void items() {
+
+ mNuclearChemItem1 = new ItemNuclearChemBase();
+ registerItemStacks();
+ registerOreDict();
+ }
+
+ public void registerItemStacks() {
+
+ mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 0, 1);
+ mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 1, 1);
+ mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 2, 1);
+ mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 3, 1);
+ }
+
+ public void registerOreDict() {
+
+ ItemUtils.addItemToOreDictionary(mResidueUranium, "dustResidueUranium");
+ ItemUtils.addItemToOreDictionary(mResiduePlutonium, "dustResiduePlutonium");
+ ItemUtils.addItemToOreDictionary(mResidueFluorides, "dustResidueFluoride");
+ ItemUtils.addItemToOreDictionary(mResidueNobles, "dustResidueNoble");
+ }
+
+ @Override
+ public void blocks() {}
+
+ @Override
+ public void fluids() {
+ // Create Used Nuclear Fuels
+ Burnt_LiFBeF2ThF4UF4 = FluidUtils.generateFluidNonMolten(
+ "BurntLiFBeF2ThF4UF4", "Burnt LiFBeF2ThF4UF4 Salt", 545, new short[] {48, 175, 48, 100}, null, null);
+ Burnt_LiFBeF2ZrF4UF4 = FluidUtils.generateFluidNonMolten(
+ "BurntLiFBeF2ZrF4UF4", "Burnt LiFBeF2ZrF4UF4 Salt", 520, new short[] {48, 168, 68, 100}, null, null);
+ Burnt_LiFBeF2ZrF4U235 = FluidUtils.generateFluidNonMolten(
+ "BurntLiFBeF2ZrF4U235", "Burnt LiFBeF2ZrF4U235 Salt", 533, new short[] {68, 185, 48, 100}, null, null);
+ Impure_LiFBeF2 = FluidUtils.generateFluidNonMolten(
+ "ImpureLiFBeF2", "Impure Molten Salt Base", 533, new short[] {110, 75, 186, 100}, null, null);
+ if (FluidUtils.getFluidStack("fluid.Mutagen", 1) == null) {
+ GeneticMutagen = FluidUtils.generateFluidNonMolten(
+ "GeneticMutagen", "Genetic Mutagen", 12, new short[] {22, 148, 185, 100}, null, null);
+ generateMutagenRecipe = true;
+ } else {
+ GeneticMutagen = FluidUtils.getFluidStack("fluid.Mutagen", 1).getFluid();
+ }
+ }
+
+ @Override
+ public String errorMessage() {
+ return "Bad Nuclear Chemistry Recipes.";
+ }
+
+ @Override
+ public boolean generateRecipes() {
+ if (generateMutagenRecipe) {
+ chemReator_CreateMutagen();
+ }
+ chemReactor_MutagenWithEggs();
+ return true;
+ }
+
+ private static void chemReator_CreateMutagen() {
+ CORE.RA.addChemicalRecipe(
+ CI.getNumberedCircuit(20),
+ ItemUtils.getSimpleStack(Items.nether_star, 2),
+ FluidUtils.getMobEssence(5000),
+ FluidUtils.getFluidStack(GeneticMutagen, 8000),
+ null,
+ 30 * 20,
+ 500);
+ }
+
+ private static void chemReactor_MutagenWithEggs() {
+ CORE.RA.addChemicalRecipe(
+ CI.getNumberedCircuit(20),
+ ItemUtils.getSimpleStack(Items.egg, 2),
+ FluidUtils.getFluidStack(GeneticMutagen, 500),
+ null,
+ ItemUtils.getSimpleStack(ModItems.itemBigEgg, 2),
+ 300 * 20,
+ 500);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/OilChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/OilChem.java
index 4406995d27..b3c0842327 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/OilChem.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/OilChem.java
@@ -4,42 +4,32 @@ import gtPlusPlus.api.objects.minecraft.ItemPackage;
public class OilChem extends ItemPackage {
- /**
- * Fluids
- */
-
-
- /**
- * Items
- */
-
-
-
- @Override
- public void items() {
-
- }
-
- @Override
- public void blocks() {
- // None yet
- }
-
- @Override
- public void fluids() {
-
- }
-
-
-
- @Override
- public String errorMessage() {
- return "Failed to generate recipes for OilChem.";
- }
-
- @Override
- public boolean generateRecipes() {
-
- return true;
- }
+ /**
+ * Fluids
+ */
+
+ /**
+ * Items
+ */
+ @Override
+ public void items() {}
+
+ @Override
+ public void blocks() {
+ // None yet
+ }
+
+ @Override
+ public void fluids() {}
+
+ @Override
+ public String errorMessage() {
+ return "Failed to generate recipes for OilChem.";
+ }
+
+ @Override
+ public boolean generateRecipes() {
+
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java
index 46a037c839..0c84e778d6 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java
@@ -1,16 +1,12 @@
package gtPlusPlus.core.item.chemistry;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
+import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GTPP_Recipe;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
@@ -22,6 +18,9 @@ import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
@@ -30,1117 +29,1105 @@ import net.minecraftforge.fluids.FluidStack;
public class RocketFuels extends ItemPackage {
- public static HashSet<String> mValidRocketFuelNames = new HashSet<String>();
- public static HashMap<Integer, Fluid> mValidRocketFuels = new HashMap<Integer, Fluid>();
-
- public static Fluid Oil_Heavy;
- public static Fluid Diesel;
- public static Fluid Kerosene;
- public static Fluid RP1;
- public static Fluid Nitrogen_Tetroxide;
- public static Fluid Hydrazine;
- public static Fluid Monomethylhydrazine;
- public static Fluid Unsymmetrical_Dimethylhydrazine;
- public static Fluid Nitrous_Oxide;
- public static Fluid Hydrated_Ammonium_Nitrate_Slurry;
- public static Fluid Liquid_Oxygen;
- public static Fluid Liquid_Hydrogen;
- public static Fluid Formaldehyde;
-
-
- //Rocket Fuel Mixes
- public static Fluid Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide;
- public static Fluid RP1_Plus_Liquid_Oxygen;
- public static Fluid Dense_Hydrazine_Mix;
- public static Fluid Monomethylhydrazine_Plus_Nitric_Acid;
-
- public static Item Ammonium_Nitrate_Dust;
- public static Item Formaldehyde_Catalyst_Dust;
- public static ItemStack Formaldehyde_Catalyst_Stack;
-
- public RocketFuels() {
- super(true);
- }
-
- public static void createKerosene(){
-
- FluidStack fuelA = FluidUtils.getFluidStack("diesel", 3000);
- FluidStack fuelB = FluidUtils.getFluidStack("fuel", 3000);
-
- if (fuelA != null){
- //GT_Values.RA.addDistilleryRecipe(23, fuelA, FluidUtils.getFluidStack(Kerosene, 50), 200, 64, false);
- GT_Values.RA.addDistilleryRecipe(CI.getNumberedCircuit(23), fuelA, FluidUtils.getFluidStack(Kerosene, 1800), 200, 64, false);
- }
- if (fuelA == null && fuelB != null){
- //GT_Values.RA.addDistilleryRecipe(23, fuelB, FluidUtils.getFluidStack(Kerosene, 50), 200, 64, false);
- GT_Values.RA.addDistilleryRecipe(CI.getNumberedCircuit(23), fuelB, FluidUtils.getFluidStack(Kerosene, 1800), 200, 64, false);
- }
- }
-
- public static void createRP1(){
- FluidStack fuelA = FluidUtils.getFluidStack(Kerosene, 1000);
- if (fuelA != null){
- GT_Values.RA.addDistilleryRecipe(CI.getNumberedCircuit(23), fuelA, FluidUtils.getFluidStack(RP1, 750), 20 * 40, 120, false);
- }
- }
-
- public static void createNitrogenTetroxide(){
- //2HNO3 + Cu = N2O4 + H2O + CuO
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1),
- ItemUtils.getSimpleStack(GenericChem.mOrangeCatalyst, 0),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("nitricacid", 2000)
- },
- new ItemStack[]{
- Materials.CupricOxide.getDust(2),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Nitrogen_Tetroxide, 1000),
- },
- new int[]{100, 100, 50, 50},
- 20 * 30,
- MaterialUtils.getVoltageForTier(3),
- 3);
-
- }
-
- public static void createHydrazine(){
-
- //H2O2 + 2NH3 = N2H4 + 2H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(21)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("fluid.hydrogenperoxide", 1000),
- FluidUtils.getFluidStack("ammonia", 2000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Hydrazine, 1000),
- },
- 20 * 30,
- MaterialUtils.getVoltageForTier(2),
- 1);
-
- FluidStack aBartWorksHydrazine = FluidUtils.getWildcardFluidStack("hydrazine", 1000);
- if (aBartWorksHydrazine != null) {
- Logger.INFO("Found BW Hydrazine, adding compat recipe.");
- CORE.RA.addDistilleryRecipe(
- GT_Utility.getIntegratedCircuit(24),
- FluidUtils.getFluidStack(Hydrazine, 1000),
- aBartWorksHydrazine,
- null,
- 20,
- 8,
- false
- );
-
- CORE.RA.addDistilleryRecipe(
- GT_Utility.getIntegratedCircuit(24),
- aBartWorksHydrazine,
- FluidUtils.getFluidStack(Hydrazine, 1000),
- null,
- 20,
- 8,
- false
- );
- }
-
- FluidStack aBartWorksHydrogenPeroxide = FluidUtils.getWildcardFluidStack("Hydrogen Peroxide", 1000);
- if (aBartWorksHydrogenPeroxide != null) {
- Logger.INFO("Found BW Hydrogen Peroxide, adding compat recipe.");
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(22)
- },
- new FluidStack[] {
- aBartWorksHydrogenPeroxide,
- FluidUtils.getFluidStack("ammonia", 2000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Hydrazine, 1000),
- },
- 20 * 30,
- MaterialUtils.getVoltageForTier(2),
- 1);
-
- CORE.RA.addDistilleryRecipe(
- GT_Utility.getIntegratedCircuit(24),
- FluidUtils.getFluidStack("fluid.hydrogenperoxide", 1000),
- aBartWorksHydrogenPeroxide,
- null,
- 20,
- 8,
- false
- );
-
- CORE.RA.addDistilleryRecipe(
- GT_Utility.getIntegratedCircuit(24),
- aBartWorksHydrogenPeroxide,
- FluidUtils.getFluidStack("fluid.hydrogenperoxide", 1000),
- null,
- 20,
- 8,
- false
- );
- }
-
- }
-
-
- public static void createMonomethylhydrazine(){
-
- //C + 2H + N2H4 = CH6N2
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(21),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 1)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("hydrogen", 2000),
- FluidUtils.getFluidStack(Hydrazine, 1000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Monomethylhydrazine, 1000),
-
- },
- 20 * 48,
- 240,
- 2);
-
- FluidStack aBartWorksMonomethylhydrazine = FluidUtils.getWildcardFluidStack("Monomethylhydrazine", 1000);
- if (aBartWorksMonomethylhydrazine != null) {
- Logger.INFO("Found BW Hydrazine, adding compat recipe.");
- CORE.RA.addDistilleryRecipe(
- GT_Utility.getIntegratedCircuit(24),
- FluidUtils.getFluidStack(Monomethylhydrazine, 1000),
- aBartWorksMonomethylhydrazine,
- null,
- 20,
- 8,
- false
- );
-
- CORE.RA.addDistilleryRecipe(
- GT_Utility.getIntegratedCircuit(24),
- aBartWorksMonomethylhydrazine,
- FluidUtils.getFluidStack(Monomethylhydrazine, 1000),
- null,
- 20,
- 8,
- false
- );
- }
-
- }
-
- private static void createLOX() {
- GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidOxygen", 1), 20*16);
- CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("oxygen", 3000)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Oxygen, 3000)}, new ItemStack[] {}, new int[] {}, 20*16, 240, 0);
- }
-
- private static void createLOH() {
- GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidHydrogen", 1), 20*16);
- CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("hydrogen", 300)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Hydrogen, 300)}, new ItemStack[] {}, new int[] {}, 20*4, 540, 0);
- }
-
- private static void createHydratedAmmoniumNitrateSlurry() {
-
- //NH3 + HNO3 = NH4NO3
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(21),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("ammonia", 4000),
- FluidUtils.getFluidStack("nitricacid", 4000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Hydrated_Ammonium_Nitrate_Slurry, 5184),
-
- },
- 20 * 60,
- 120,
- 1);
- }
-
- private static void createAmmoniumNitrateDust() {
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {CI.getNumberedCircuit(8)},
- FluidUtils.getFluidStack(Hydrated_Ammonium_Nitrate_Slurry, 8 * 144),
- FluidUtils.getWater(2000),
- new ItemStack[] {
- ItemUtils.getSimpleStack(Ammonium_Nitrate_Dust, 8)
- },
- new int[] {10000},
- 90 * 20,
- 480);
- }
-
- private static void createFormaldehyde() {
-
- //O + CH4O = CH2O + H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(21),
- ItemUtils.getSimpleStack(GenericChem.mFormaldehydeCatalyst, 0),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("oxygen", 32000),
- FluidUtils.getFluidStack("methanol", 32000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Formaldehyde, 32000),
- },
- 20 * 90,
- 120,
- 1);
-
- FluidStack aBartWorksFormaldehyde = FluidUtils.getWildcardFluidStack("Formaldehyde", 1000);
- if (aBartWorksFormaldehyde != null) {
- Logger.INFO("Found BW Formaldehyde, adding compat recipe.");
- CORE.RA.addDistilleryRecipe(
- GT_Utility.getIntegratedCircuit(24),
- FluidUtils.getFluidStack(Formaldehyde, 1000),
- aBartWorksFormaldehyde,
- null,
- 20,
- 8,
- false
- );
-
- CORE.RA.addDistilleryRecipe(
- GT_Utility.getIntegratedCircuit(24),
- aBartWorksFormaldehyde,
- FluidUtils.getFluidStack(Formaldehyde, 1000),
- null,
- 20,
- 8,
- false
- );
- }
-
- }
-
- private static void createFormaldehydeCatalyst() {
- GT_Values.RA.addMixerRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 16),
- ItemUtils.getItemStackOfAmountFromOreDict("dustVanadium", 1),
- CI.getNumberedCircuit(18),
- null,
- null,
- null,
- ItemUtils.getSimpleStack(Formaldehyde_Catalyst_Dust, 4),
- 160,
- 30);
-
- }
-
- private static void createUnsymmetricalDimethylhydrazine() {
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(21),
- ItemUtils.getSimpleStack(GenericChem.mFormaldehydeCatalyst, 0),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("fluid.hydrazine", 2000),
- FluidUtils.getFluidStack(Formaldehyde, 2000),
- FluidUtils.getFluidStack("hydrogen", 4000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine, 2000),
- FluidUtils.getWater(2000)
-
- },
- 20 * 60,
- 120,
- 3);
-
- }
-
- private static void addRocketFuelsToMap() {
- HashMap<Integer, GTPP_Recipe> mRocketFuels = new LinkedHashMap<Integer, GTPP_Recipe>();
- mRocketFuels.put(0, new GTPP_Recipe(
- true,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {FluidUtils.getFluidStack(RP1_Plus_Liquid_Oxygen, 1000)},
- new FluidStack[] {},
- 0,
- 0,
- 512)); //Fuel Value
-
- mRocketFuels.put(1, new GTPP_Recipe(
- true,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {FluidUtils.getFluidStack(Dense_Hydrazine_Mix, 1000)},
- new FluidStack[] {},
- 0,
- 0,
- 1024)); //Fuel Value
-
- mRocketFuels.put(2, new GTPP_Recipe(
- true,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {FluidUtils.getFluidStack(Monomethylhydrazine_Plus_Nitric_Acid, 1000)},
- new FluidStack[] {},
- 0,
- 0,
- 2048)); //Fuel Value
-
- mRocketFuels.put(3, new GTPP_Recipe(
- true,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide, 1000)},
- new FluidStack[] {},
- 0,
- 0,
- 4196)); //Fuel Value
-
-
- //Add in default Diesel for the Buggy
- mValidRocketFuels.put(-1, Diesel);
-
- mValidRocketFuelNames.add(FluidRegistry.getFluidName(Diesel));
- for (int mID : mRocketFuels.keySet()) {
- GTPP_Recipe aFuelRecipe = mRocketFuels.get(mID);
- if (aFuelRecipe != null) {
- mValidRocketFuelNames.add(FluidRegistry.getFluidName(aFuelRecipe.mFluidInputs[0].getFluid()));
- mValidRocketFuels.put(mID, aFuelRecipe.mFluidInputs[0].getFluid());
- GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels.add(aFuelRecipe);
- }
- }
-
- }
-
-
- private static void createRocketFuels() {
-
- // RP1_Plus_Liquid_Oxygen
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(1),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Liquid_Oxygen, 2000),
- FluidUtils.getFluidStack(RP1, 500),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(RP1_Plus_Liquid_Oxygen, 1500),
-
- },
- 20 * 15,
- 240,
- 3);
-
-
- // Dense_Hydrazine_Mix
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(2),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Hydrazine, 4000),
- FluidUtils.getFluidStack("methanol", 6000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Dense_Hydrazine_Mix, 10000),
-
- },
- 20 * 30,
- 240,
- 4);
-
-
- // Monomethylhydrazine_Plus_Nitric_Acid
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(3),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Monomethylhydrazine, 2000),
- FluidUtils.getFluidStack("nitricacid", 1000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Monomethylhydrazine_Plus_Nitric_Acid, 2000),
-
- },
- 20 * 45,
- 480,
- 5);
-
-
- // Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(4),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine, 2000),
- FluidUtils.getFluidStack(Nitrogen_Tetroxide, 2000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide, 5000),
-
- },
- 20 * 60,
- 480,
- 6);
-
- }
-
- @Override
- public String errorMessage() {
- return "Bad Rocket Fuel Science!";
- }
-
- @Override
- public boolean generateRecipes() {
- createKerosene();
- createRP1();
- createNitrogenTetroxide();
- createHydrazine();
- createMonomethylhydrazine();
-
- if (!CORE.GTNH) {
- createLOX();
- }
- createLOH();
-
-
- createHydratedAmmoniumNitrateSlurry();
- createAmmoniumNitrateDust();
- createFormaldehyde();
- createFormaldehydeCatalyst();
- createUnsymmetricalDimethylhydrazine();
-
- createRocketFuels();
- addRocketFuelsToMap();
-
- return true;
- }
-
- @Override
- public void items() {
- Formaldehyde_Catalyst_Dust = ItemUtils.generateSpecialUseDusts("FormaldehydeCatalyst", "Formaldehyde Catalyst", "Fe16V1", Utils.rgbtoHexValue(25, 5, 25))[0];
- Formaldehyde_Catalyst_Stack = ItemUtils.getSimpleStack(Formaldehyde_Catalyst_Dust);
- }
-
- @Override
- public void blocks() {
- }
-
- @Override
- public void fluids() {
-
- //Register default fluids
- Diesel = MaterialUtils.getMaterial("Fuel", "Diesel").getFluid(1).getFluid();
-
- // 5.08 Compat
- if (!FluidUtils.doesFluidExist("liquid_heavy_oil")){
- Oil_Heavy = FluidUtils.generateFluidNoPrefix("liquid_heavy_oil", "Heavy Oil", 200, new short[]{10, 10, 10, 100});
- }
- else {
- Oil_Heavy = MaterialUtils.getMaterial("OilHeavy", "Oil").getFluid(1).getFluid();
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellOilHeavy", 1) == null){
- new BaseItemComponent("OilHeavy", "Heavy Oil", new short[] {10, 10, 10});
- }
- }
-
-
- //Create Kerosene
- Kerosene = FluidUtils.generateFluidNonMolten("Kerosene", "Kerosene", 233, new short[]{150, 40, 150, 100}, null, null);
- CoalTar.Coal_Oil = Kerosene;
-
- //RP! Focket Fuel
- RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1", 500, new short[]{210, 50, 50, 100}, null, null);
-
- //Create Nitrogen Tetroxide
- Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("NitrogenTetroxide", "Nitrogen Tetroxide", 261, new short[]{170, 170, 0, 100}, null, null);
-
- //Create Hydrazine
- Hydrazine = FluidUtils.generateFluidNonMolten("Hydrazine", "Hydrazine", 275, new short[]{250, 250, 250, 100}, null, null);
-
- //Create Monomethylhydrazine
- Monomethylhydrazine = FluidUtils.generateFluidNonMolten("Monomethylhydrazine", "Monomethylhydrazine", 221, new short[]{125, 125, 125, 100}, null, null);
-
- //Create Anthracene
- Nitrous_Oxide = FluidUtils.generateFluidNonMolten("NitrousOxide", "Nitrous Oxide", 182, new short[]{255, 255, 255, 100}, null, null);
-
- //Nos
- if (!FluidUtils.doesFluidExist("NitrousOxide")){
- Nitrous_Oxide = FluidUtils.generateFluidNoPrefix("NitrousOxide", "Nitrous Oxide", 182, new short[]{255, 255, 255, 100});
- }
- else {
- Nitrous_Oxide = FluidUtils.getWildcardFluidStack("NitrousOxide", 1).getFluid();
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellNitrousOxide", 1) == null){
- new BaseItemComponent("NitrousOxide", "Nitrous Oxide", new short[] {10, 10, 175});
- }
- }
-
- //Unsymmetrical_Dimethylhydrazine
- if (FluidUtils.getFluidStack("1,1dimethylhydrazine", 1) == null){
- Unsymmetrical_Dimethylhydrazine = FluidUtils.generateFluidNonMolten("UnsymmetricalDimethylhydrazine", "Unsymmetrical Dimethylhydrazine", 216, new short[]{70, 210, 20, 100}, null, null);
- }
- else {
- Unsymmetrical_Dimethylhydrazine = FluidUtils.getFluidStack("1,1dimethylhydrazine", 1000).getFluid();
- }
-
- //Create Hydrated_Ammonium_Nitrate_Slurry
- Hydrated_Ammonium_Nitrate_Slurry = FluidUtils.generateFluidNonMolten("AmmoniumNitrateSlurry", "Hydrated Ammonium Nitrate Slurry", 450, new short[]{150, 75, 150, 100}, null, null);
-
- //Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O
- Ammonium_Nitrate_Dust = ItemUtils.generateSpecialUseDusts("AmmoniumNitrate", "Ammonium Nitrate", "N2H4O3", Utils.rgbtoHexValue(150, 75, 150))[0];
-
- //Create Liquid_Oxygen
- if (FluidUtils.getFluidStack("LiquidOxygen", 1) == null && FluidUtils.getFluidStack("liquidoxygen", 1) == null){
- Liquid_Oxygen = FluidUtils.generateFluidNonMolten("LiquidOxygen", "Liquid Oxygen", 54, new short[]{75, 75, 220, 100}, null, null);
- }
- else {
- if (FluidUtils.getFluidStack("LiquidOxygen", 1) != null ) {
- Liquid_Oxygen = FluidUtils.getFluidStack("LiquidOxygen", 1).getFluid();
- }
- else {
- Liquid_Oxygen = FluidUtils.getFluidStack("liquidoxygen", 1).getFluid();
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidOxygen", 1) == null){
- new BaseItemComponent("LiquidOxygen", "Liquid Oxygen", new short[] {10, 10, 175});
- }
- }
-
- //Create Liquid_Hydrogen
- if (FluidUtils.getFluidStack("LiquidHydrogen", 1) == null && FluidUtils.getFluidStack("liquidhydrogen", 1) == null){
- Liquid_Hydrogen = FluidUtils.generateFluidNonMolten("LiquidHydrogen", "Liquid Hydrogen", 14, new short[]{75, 75, 220, 100}, null, null);
- }
- else {
- if (FluidUtils.getFluidStack("LiquidHydrogen", 1) != null ) {
- Liquid_Hydrogen = FluidUtils.getFluidStack("LiquidHydrogen", 1).getFluid();
- }
- else {
- Liquid_Hydrogen = FluidUtils.getFluidStack("liquidhydrogen", 1).getFluid();
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidHydrogen", 1) == null){
- new BaseItemComponent("LiquidHydrogen", "Liquid Hydrogen", new short[] {10, 10, 175});
- }
- }
-
- Formaldehyde = FluidUtils.generateFluidNonMolten("Formaldehyde", "Formaldehyde", 185, new short[]{150, 75, 150, 100}, null, null);
-
- Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("RocketFuelMixA", "H8N4C2O4 Rocket Fuel", 216, new short[]{50, 220, 50, 100}, null, null);
- RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Rocket Fuel", 250, new short[]{250, 50, 50, 100}, null, null);
- Monomethylhydrazine_Plus_Nitric_Acid = FluidUtils.generateFluidNonMolten("RocketFuelMixC", "CN3H7O3 Rocket Fuel", 221, new short[]{125, 75, 180, 100}, null, null);
- Dense_Hydrazine_Mix = FluidUtils.generateFluidNonMolten("RocketFuelMixD", "Dense Hydrazine Fuel Mixture", 275, new short[]{175, 80, 120, 100}, null, null);
-
- }
-
- @Override
- public boolean onLoadComplete(FMLLoadCompleteEvent event) {
-
- Logger.INFO("Trying to remove GT recipes for '1,1dimethylhydrazine' && 'rocket_fuel' if they exist.");
- /*if (FluidRegistry.isFluidRegistered("1,1dimethylhydrazine")) {
-
- // Try Remove recipes for GT/EIO Rocket Fuel Cells
- if (FluidRegistry.isFluidRegistered("rocket_fuel")) {
-
- // Old Recipe
- if (MaterialUtils.doesMaterialExist("NitrogenDioxide")) {
- GT_Recipe aOldRecipe = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellNitrogenDioxide", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 3),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("air", 500)
- },
- 388);
- boolean aDidRemove = removeRecipe(aOldRecipe, GT_Recipe_Map.sChemicalRecipes);
- Logger.INFO("Removed Old Recipe for Rocket Fuel: "+aDidRemove);
- }
-
- // Simple Recipes
- if (MaterialUtils.doesMaterialExist("Ammonia") && MaterialUtils.doesMaterialExist("Methanol")) {
-
- GT_Recipe aSimpleRecipe1 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("cellMethanol", 4),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("chlorine", 1000)
- },
- 480);
- GT_Recipe aSimpleRecipe2 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellMethanol", 4),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("ammonia", 3000)
- },
- 480);
- GT_Recipe aSimpleRecipe3 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 1),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("methanol", 4000)
- },
- 480);
-
- boolean aDidRemove1 = removeRecipe(aSimpleRecipe1, GT_Recipe_Map.sChemicalRecipes);
- boolean aDidRemove2 = removeRecipe(aSimpleRecipe2, GT_Recipe_Map.sChemicalRecipes);
- boolean aDidRemove3 = removeRecipe(aSimpleRecipe3, GT_Recipe_Map.sChemicalRecipes);
- Logger.INFO("Removed Simple Recipe 1 for Rocket Fuel: "+aDidRemove1);
- Logger.INFO("Removed Simple Recipe 2 for Rocket Fuel: "+aDidRemove2);
- Logger.INFO("Removed Simple Recipe 3 for Rocket Fuel: "+aDidRemove3);
- }
-
-
- // Complex Recipes I
- if (MaterialUtils.doesMaterialExist("Dimethylhydrazine") && MaterialUtils.doesMaterialExist("DinitrogenTetroxide")) {
-
- GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylhydrazine", 1),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("dinitrogentetroxide", 1000)
- },
- 16);
- GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellDinitrogenTetroxide", 1),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("dimethylhydrazine", 1000)
- },
- 16);
-
- GT_Recipe aAdvRecipe3 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylhydrazine", 2),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("oxygen", 1000)
- },
- 16);
- GT_Recipe aAdvRecipe4 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("dimethylhydrazine", 2000)
- },
- 16);
-
- boolean aDidRemove1 = removeRecipe(aAdvRecipe1, GT_Recipe_Map.sMixerRecipes);
- boolean aDidRemove2 = removeRecipe(aAdvRecipe2, GT_Recipe_Map.sMixerRecipes);
- boolean aDidRemove3 = removeRecipe(aAdvRecipe3, GT_Recipe_Map.sMixerRecipes);
- boolean aDidRemove4 = removeRecipe(aAdvRecipe4, GT_Recipe_Map.sMixerRecipes);
- Logger.INFO("Removed Complex Recipe 1 for Rocket Fuel: "+aDidRemove1);
- Logger.INFO("Removed Complex Recipe 2 for Rocket Fuel: "+aDidRemove2);
- Logger.INFO("Removed Complex Recipe 3 for Rocket Fuel: "+aDidRemove3);
- Logger.INFO("Removed Complex Recipe 4 for Rocket Fuel: "+aDidRemove4);
- }
- }
-
-
- // Complex Recipes II
- if (MaterialUtils.doesMaterialExist("Dimethylhydrazine")) {
-
- GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylhydrazine", 2),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("oxygen", 1000)
- },
- 16);
- GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("dimethylhydrazine", 2000)
- },
- 16);
-
- boolean aDidRemove1 = removeRecipe(aAdvRecipe1, GT_Recipe_Map.sMixerRecipes);
- boolean aDidRemove2 = removeRecipe(aAdvRecipe2, GT_Recipe_Map.sMixerRecipes);
- Logger.INFO("Removed Complex Recipe 5 for Rocket Fuel: "+aDidRemove1);
- Logger.INFO("Removed Complex Recipe 6 for Rocket Fuel: "+aDidRemove2);
- }
-
- if (MaterialUtils.doesMaterialExist("Chloramine") && MaterialUtils.doesMaterialExist("Dimethylamine")) {
- GT_Recipe aSimpleRecipe1 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 2),
- GT_Utility.getIntegratedCircuit(1)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("dimethylamine", 5000)
- },
- 480);
- GT_Recipe aSimpleRecipe2 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 5),
- GT_Utility.getIntegratedCircuit(1)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("chloramine", 2000)
- },
- 16);
-
-
-
- GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 2),
- CI.emptyCells(4)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("dimethylamine", 5000)
- },
- 480);
- GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 5),
- CI.emptyCells(1)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("chloramine", 2000)
- },
- 16);
- GT_Recipe aAdvRecipe3 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 5),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("chloramine", 2000)
- },
- 480);
-
- boolean aDidRemove1 = removeRecipe(aSimpleRecipe1, GT_Recipe_Map.sChemicalRecipes);
- boolean aDidRemove2 = removeRecipe(aSimpleRecipe2, GT_Recipe_Map.sChemicalRecipes);
- boolean aDidRemove3 = removeRecipe(aAdvRecipe1, GT_Recipe_Map.sChemicalRecipes);
- boolean aDidRemove4 = removeRecipe(aAdvRecipe2, GT_Recipe_Map.sChemicalRecipes);
- boolean aDidRemove5 = removeRecipe(aAdvRecipe3, GT_Recipe_Map.sChemicalRecipes);
- Logger.INFO("Removed Complex Recipe 1 for 1,1dimethylhydrazine: "+aDidRemove1);
- Logger.INFO("Removed Complex Recipe 2 for 1,1dimethylhydrazine: "+aDidRemove2);
- Logger.INFO("Removed Complex Recipe 3 for 1,1dimethylhydrazine: "+aDidRemove3);
- Logger.INFO("Removed Complex Recipe 4 for 1,1dimethylhydrazine: "+aDidRemove4);
- Logger.INFO("Removed Complex Recipe 5 for 1,1dimethylhydrazine: "+aDidRemove5);
-
- }
-
- if (MaterialUtils.doesMaterialExist("Chloramine") && MaterialUtils.doesMaterialExist("Dimethylamine")) {
- GT_Recipe aSimpleRecipe1 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 1),
- GT_Utility.getIntegratedCircuit(1)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("dimethylamine", 1000)
- },
- 480);
- GT_Recipe aSimpleRecipe2 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 1),
- GT_Utility.getIntegratedCircuit(1)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("chloramine", 1000)
- },
- 16);
-
-
-
- GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 1),
- GT_Utility.getIntegratedCircuit(11)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("dimethylamine", 1000)
- },
- 480);
- GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 1),
- GT_Utility.getIntegratedCircuit(11)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("chloramine", 1000)
- },
- 16);
-
- boolean aDidRemove1 = removeRecipe(aSimpleRecipe1, GT_Recipe_Map.sChemicalRecipes);
- boolean aDidRemove2 = removeRecipe(aSimpleRecipe2, GT_Recipe_Map.sChemicalRecipes);
- boolean aDidRemove3 = removeRecipe(aAdvRecipe1, GT_Recipe_Map.sChemicalRecipes);
- boolean aDidRemove4 = removeRecipe(aAdvRecipe2, GT_Recipe_Map.sChemicalRecipes);
- Logger.INFO("Removed Complex Recipe 5 for 1,1dimethylhydrazine: "+aDidRemove1);
- Logger.INFO("Removed Complex Recipe 6 for 1,1dimethylhydrazine: "+aDidRemove2);
- Logger.INFO("Removed Complex Recipe 7 for 1,1dimethylhydrazine: "+aDidRemove3);
- Logger.INFO("Removed Complex Recipe 8 for 1,1dimethylhydrazine: "+aDidRemove4);
-
- }
-
- if (MaterialUtils.doesMaterialExist("HypochlorousAcid") && MaterialUtils.doesMaterialExist("Ammonia") && MaterialUtils.doesMaterialExist("Methanol")) {
-
- GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
- new ItemStack[] {
- GT_Utility.getIntegratedCircuit(24),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("hypochlorousacid", 3000),
- FluidUtils.getFluidStack("ammonia", 8000),
- FluidUtils.getFluidStack("methanol", 12000)
- },
- 480);
-
- GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
- new ItemStack[] {
- GT_Utility.getIntegratedCircuit(24),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("hypochlorousacid", 1000),
- FluidUtils.getFluidStack("ammonia", 1000),
- FluidUtils.getFluidStack("methanol", 2000)
- },
- 480);
-
- boolean aDidRemove1 = removeRecipe(aAdvRecipe1, StaticFields59.getLargeChemicalReactorRecipeMap());
- boolean aDidRemove2 = removeRecipe(aAdvRecipe2, StaticFields59.getLargeChemicalReactorRecipeMap());
- Logger.INFO("Removed Complex Recipe 9 for 1,1dimethylhydrazine: "+aDidRemove1);
- Logger.INFO("Removed Complex Recipe 10 for 1,1dimethylhydrazine: "+aDidRemove2);
-
-
- }
- }*/
-
- // Try Butcher recipes manually
-
- //1,1Dimethylhydrazine
- if (FluidRegistry.isFluidRegistered("1,1dimethylhydrazine")) {
- Logger.INFO("Making sure all Chemical Reactor recipes for 1,1dimethylhydrazine have been removed.");
- AutoMap<GT_Recipe> aToRemoveSingle = new AutoMap<GT_Recipe>();
- ItemStack aUnsymCell = ItemUtils.getItemStackOfAmountFromOreDict("cell1,1Dimethylhydrazine", 1);
- FluidStack aUnsymFluid = FluidUtils.getFluidStack("1,1dimethylhydrazine", 1);
- recipe : for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sChemicalRecipes.mRecipeList) {
- if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
- if (aRecipeSingleBlock.mOutputs != null && aRecipeSingleBlock.mOutputs.length > 0) {
- for (ItemStack aOutputItem : aRecipeSingleBlock.mOutputs) {
- ItemStack aTemp = aOutputItem.copy();
- aTemp.stackSize = 1;
- if (GT_Utility.areStacksEqual(aTemp, aUnsymCell)) {
- aToRemoveSingle.add(aRecipeSingleBlock);
- continue recipe;
- }
- }
- }
- if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
- for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
- if (GT_Utility.areFluidsEqual(aOutput, aUnsymFluid)) {
- aToRemoveSingle.add(aRecipeSingleBlock);
- continue recipe;
- }
- }
- }
- }
- }
- // Handle Multi Also
- AutoMap<GT_Recipe> aToRemoveMulti = new AutoMap<GT_Recipe>();
- recipe : for (GT_Recipe aRecipeSingleBlock : StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList) {
- if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
- if (aRecipeSingleBlock.mOutputs != null && aRecipeSingleBlock.mOutputs.length > 0) {
- for (ItemStack aOutputItem : aRecipeSingleBlock.mOutputs) {
- ItemStack aTemp = aOutputItem.copy();
- aTemp.stackSize = 1;
- if (GT_Utility.areStacksEqual(aTemp, aUnsymCell)) {
- aToRemoveMulti.add(aRecipeSingleBlock);
- continue recipe;
- }
- }
- }
- if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
- for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
- if (GT_Utility.areFluidsEqual(aOutput, aUnsymFluid)) {
- aToRemoveMulti.add(aRecipeSingleBlock);
- continue recipe;
- }
- }
- }
- }
- }
- if (!aToRemoveSingle.isEmpty()) {
- Logger.INFO("Found "+aToRemoveSingle.size()+" single block recipes, removing by force.");
- for (GT_Recipe remove : aToRemoveSingle) {
- GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(remove);
- }
- }
- if (!aToRemoveMulti.isEmpty()) {
- Logger.INFO("Found "+aToRemoveSingle.size()+" multiblock recipes, removing by force.");
- for (GT_Recipe remove : aToRemoveMulti) {
- StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList.remove(remove);
- }
- }
- }
-
-
- if (FluidRegistry.isFluidRegistered("rocket_fuel")) {
- Logger.INFO("Making sure all Mixer recipes for rocket_fuel have been removed.");
- AutoMap<GT_Recipe> aToRemoveSingle = new AutoMap<GT_Recipe>();
- FluidStack aRocketFluid = FluidUtils.getFluidStack("rocket_fuel", 1);
- recipe : for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sMixerRecipes.mRecipeList) {
- if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
- if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
- for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
- if (GT_Utility.areFluidsEqual(aOutput, aRocketFluid)) {
- aToRemoveSingle.add(aRecipeSingleBlock);
- continue recipe;
- }
- }
- }
- }
- }
- if (!aToRemoveSingle.isEmpty()) {
- Logger.INFO("Found "+aToRemoveSingle.size()+" recipes, removing by force.");
- for (GT_Recipe remove : aToRemoveSingle) {
- GT_Recipe_Map.sMixerRecipes.mRecipeList.remove(remove);
- }
- aToRemoveSingle.clear();
- }
-
- Logger.INFO("Making sure all Chemical Reactor recipes for rocket_fuel have been removed.");
- recipe : for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sChemicalRecipes.mRecipeList) {
- if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
- if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
- for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
- if (GT_Utility.areFluidsEqual(aOutput, aRocketFluid)) {
- aToRemoveSingle.add(aRecipeSingleBlock);
- continue recipe;
- }
- }
- }
- }
- }
- // Handle Multi Also
- AutoMap<GT_Recipe> aToRemoveMulti = new AutoMap<GT_Recipe>();
- recipe : for (GT_Recipe aRecipeSingleBlock : StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList) {
- if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
- if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
- for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
- if (GT_Utility.areFluidsEqual(aOutput, aRocketFluid)) {
- aToRemoveMulti.add(aRecipeSingleBlock);
- continue recipe;
- }
- }
- }
- }
- }
- if (!aToRemoveSingle.isEmpty()) {
- Logger.INFO("Found "+aToRemoveSingle.size()+" single block recipes, removing by force.");
- for (GT_Recipe remove : aToRemoveSingle) {
- GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(remove);
- }
- }
- if (!aToRemoveMulti.isEmpty()) {
- Logger.INFO("Found "+aToRemoveSingle.size()+" multiblock recipes, removing by force.");
- for (GT_Recipe remove : aToRemoveMulti) {
- StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList.remove(remove);
- }
- }
-
- }
-
-
-
- Logger.INFO("Finished clean-up of GT Rocket Fuel Recipes.");
- return true;
- }
-
- private static GTPP_Recipe getHalfBakedRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, int aEU) {
- return new GTPP_Recipe(false, aInputs, null, null, null, aFluidInputs, null, 0, aEU, 0);
-
- }
-
- public static boolean removeRecipe(GT_Recipe aRecipe, GT_Recipe_Map aMap) {
- if (aMap != GT_Recipe_Map.sChemicalRecipes) {
- GT_Recipe aFoundRecipe = aMap.findRecipe(null, false, true, aRecipe.mEUt, aRecipe.mFluidInputs, aRecipe.mInputs);
- boolean aSingle = false;
- if (aFoundRecipe != null) {
- Logger.INFO("Found Single Block Recipe, removing.");
- aSingle = aMap.mRecipeList.remove(aFoundRecipe);
- Logger.INFO("Success? "+aSingle);
- }
- return aSingle;
- }
- else {
- GT_Recipe aFoundRecipe = aMap.findRecipe(null, false, true, aRecipe.mEUt, aRecipe.mFluidInputs, aRecipe.mInputs);
- GT_Recipe aFoundRecipe2 = StaticFields59.getLargeChemicalReactorRecipeMap().findRecipe(null, false, true, aRecipe.mEUt, aRecipe.mFluidInputs, aRecipe.mInputs);
- boolean aSingle = false;
- boolean aMulti = false;
- if (aFoundRecipe != null) {
- Logger.INFO("Found Single Block Recipe, removing.");
- aSingle = GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(aFoundRecipe);
- Logger.INFO("Success? "+aSingle);
- }
- if (aFoundRecipe2 != null) {
- Logger.INFO("Found Multiblock Recipe, removing.");
- aMulti = StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList.remove(aFoundRecipe2);
- Logger.INFO("Success? "+aSingle);
- }
- return aSingle && aMulti;
- }
- }
-
-
-
+ public static HashSet<String> mValidRocketFuelNames = new HashSet<String>();
+ public static HashMap<Integer, Fluid> mValidRocketFuels = new HashMap<Integer, Fluid>();
+
+ public static Fluid Oil_Heavy;
+ public static Fluid Diesel;
+ public static Fluid Kerosene;
+ public static Fluid RP1;
+ public static Fluid Nitrogen_Tetroxide;
+ public static Fluid Hydrazine;
+ public static Fluid Monomethylhydrazine;
+ public static Fluid Unsymmetrical_Dimethylhydrazine;
+ public static Fluid Nitrous_Oxide;
+ public static Fluid Hydrated_Ammonium_Nitrate_Slurry;
+ public static Fluid Liquid_Oxygen;
+ public static Fluid Liquid_Hydrogen;
+ public static Fluid Formaldehyde;
+
+ // Rocket Fuel Mixes
+ public static Fluid Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide;
+ public static Fluid RP1_Plus_Liquid_Oxygen;
+ public static Fluid Dense_Hydrazine_Mix;
+ public static Fluid Monomethylhydrazine_Plus_Nitric_Acid;
+
+ public static Item Ammonium_Nitrate_Dust;
+ public static Item Formaldehyde_Catalyst_Dust;
+ public static ItemStack Formaldehyde_Catalyst_Stack;
+
+ public RocketFuels() {
+ super(true);
+ }
+
+ public static void createKerosene() {
+
+ FluidStack fuelA = FluidUtils.getFluidStack("diesel", 3000);
+ FluidStack fuelB = FluidUtils.getFluidStack("fuel", 3000);
+
+ if (fuelA != null) {
+ // GT_Values.RA.addDistilleryRecipe(23, fuelA, FluidUtils.getFluidStack(Kerosene, 50), 200, 64, false);
+ GT_Values.RA.addDistilleryRecipe(
+ CI.getNumberedCircuit(23), fuelA, FluidUtils.getFluidStack(Kerosene, 1800), 200, 64, false);
+ }
+ if (fuelA == null && fuelB != null) {
+ // GT_Values.RA.addDistilleryRecipe(23, fuelB, FluidUtils.getFluidStack(Kerosene, 50), 200, 64, false);
+ GT_Values.RA.addDistilleryRecipe(
+ CI.getNumberedCircuit(23), fuelB, FluidUtils.getFluidStack(Kerosene, 1800), 200, 64, false);
+ }
+ }
+
+ public static void createRP1() {
+ FluidStack fuelA = FluidUtils.getFluidStack(Kerosene, 1000);
+ if (fuelA != null) {
+ GT_Values.RA.addDistilleryRecipe(
+ CI.getNumberedCircuit(23), fuelA, FluidUtils.getFluidStack(RP1, 750), 20 * 40, 120, false);
+ }
+ }
+
+ public static void createNitrogenTetroxide() {
+ // 2HNO3 + Cu = N2O4 + H2O + CuO
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1),
+ ItemUtils.getSimpleStack(GenericChem.mOrangeCatalyst, 0),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack("nitricacid", 2000)},
+ new ItemStack[] {
+ Materials.CupricOxide.getDust(2),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Nitrogen_Tetroxide, 1000),
+ },
+ new int[] {100, 100, 50, 50},
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(3),
+ 3);
+ }
+
+ public static void createHydrazine() {
+
+ // H2O2 + 2NH3 = N2H4 + 2H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(21)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack("fluid.hydrogenperoxide", 1000), FluidUtils.getFluidStack("ammonia", 2000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Hydrazine, 1000),
+ },
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(2),
+ 1);
+
+ FluidStack aBartWorksHydrazine = FluidUtils.getWildcardFluidStack("hydrazine", 1000);
+ if (aBartWorksHydrazine != null) {
+ Logger.INFO("Found BW Hydrazine, adding compat recipe.");
+ CORE.RA.addDistilleryRecipe(
+ GT_Utility.getIntegratedCircuit(24),
+ FluidUtils.getFluidStack(Hydrazine, 1000),
+ aBartWorksHydrazine,
+ null,
+ 20,
+ 8,
+ false);
+
+ CORE.RA.addDistilleryRecipe(
+ GT_Utility.getIntegratedCircuit(24),
+ aBartWorksHydrazine,
+ FluidUtils.getFluidStack(Hydrazine, 1000),
+ null,
+ 20,
+ 8,
+ false);
+ }
+
+ FluidStack aBartWorksHydrogenPeroxide = FluidUtils.getWildcardFluidStack("Hydrogen Peroxide", 1000);
+ if (aBartWorksHydrogenPeroxide != null) {
+ Logger.INFO("Found BW Hydrogen Peroxide, adding compat recipe.");
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(22)},
+ new FluidStack[] {
+ aBartWorksHydrogenPeroxide, FluidUtils.getFluidStack("ammonia", 2000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Hydrazine, 1000),
+ },
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(2),
+ 1);
+
+ CORE.RA.addDistilleryRecipe(
+ GT_Utility.getIntegratedCircuit(24),
+ FluidUtils.getFluidStack("fluid.hydrogenperoxide", 1000),
+ aBartWorksHydrogenPeroxide,
+ null,
+ 20,
+ 8,
+ false);
+
+ CORE.RA.addDistilleryRecipe(
+ GT_Utility.getIntegratedCircuit(24),
+ aBartWorksHydrogenPeroxide,
+ FluidUtils.getFluidStack("fluid.hydrogenperoxide", 1000),
+ null,
+ 20,
+ 8,
+ false);
+ }
+ }
+
+ public static void createMonomethylhydrazine() {
+
+ // C + 2H + N2H4 = CH6N2
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(21), ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 1)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack("hydrogen", 2000), FluidUtils.getFluidStack(Hydrazine, 1000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Monomethylhydrazine, 1000),
+ },
+ 20 * 48,
+ 240,
+ 2);
+
+ FluidStack aBartWorksMonomethylhydrazine = FluidUtils.getWildcardFluidStack("Monomethylhydrazine", 1000);
+ if (aBartWorksMonomethylhydrazine != null) {
+ Logger.INFO("Found BW Hydrazine, adding compat recipe.");
+ CORE.RA.addDistilleryRecipe(
+ GT_Utility.getIntegratedCircuit(24),
+ FluidUtils.getFluidStack(Monomethylhydrazine, 1000),
+ aBartWorksMonomethylhydrazine,
+ null,
+ 20,
+ 8,
+ false);
+
+ CORE.RA.addDistilleryRecipe(
+ GT_Utility.getIntegratedCircuit(24),
+ aBartWorksMonomethylhydrazine,
+ FluidUtils.getFluidStack(Monomethylhydrazine, 1000),
+ null,
+ 20,
+ 8,
+ false);
+ }
+ }
+
+ private static void createLOX() {
+ GT_Values.RA.addVacuumFreezerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidOxygen", 1),
+ 20 * 16);
+ CORE.RA.addAdvancedFreezerRecipe(
+ new ItemStack[] {},
+ new FluidStack[] {FluidUtils.getFluidStack("oxygen", 3000)},
+ new FluidStack[] {FluidUtils.getFluidStack(Liquid_Oxygen, 3000)},
+ new ItemStack[] {},
+ new int[] {},
+ 20 * 16,
+ 240,
+ 0);
+ }
+
+ private static void createLOH() {
+ GT_Values.RA.addVacuumFreezerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidHydrogen", 1),
+ 20 * 16);
+ CORE.RA.addAdvancedFreezerRecipe(
+ new ItemStack[] {},
+ new FluidStack[] {FluidUtils.getFluidStack("hydrogen", 300)},
+ new FluidStack[] {FluidUtils.getFluidStack(Liquid_Hydrogen, 300)},
+ new ItemStack[] {},
+ new int[] {},
+ 20 * 4,
+ 540,
+ 0);
+ }
+
+ private static void createHydratedAmmoniumNitrateSlurry() {
+
+ // NH3 + HNO3 = NH4NO3
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(21),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("ammonia", 4000), FluidUtils.getFluidStack("nitricacid", 4000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Hydrated_Ammonium_Nitrate_Slurry, 5184),
+ },
+ 20 * 60,
+ 120,
+ 1);
+ }
+
+ private static void createAmmoniumNitrateDust() {
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(8)},
+ FluidUtils.getFluidStack(Hydrated_Ammonium_Nitrate_Slurry, 8 * 144),
+ FluidUtils.getWater(2000),
+ new ItemStack[] {ItemUtils.getSimpleStack(Ammonium_Nitrate_Dust, 8)},
+ new int[] {10000},
+ 90 * 20,
+ 480);
+ }
+
+ private static void createFormaldehyde() {
+
+ // O + CH4O = CH2O + H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(21), ItemUtils.getSimpleStack(GenericChem.mFormaldehydeCatalyst, 0),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("oxygen", 32000), FluidUtils.getFluidStack("methanol", 32000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Formaldehyde, 32000),
+ },
+ 20 * 90,
+ 120,
+ 1);
+
+ FluidStack aBartWorksFormaldehyde = FluidUtils.getWildcardFluidStack("Formaldehyde", 1000);
+ if (aBartWorksFormaldehyde != null) {
+ Logger.INFO("Found BW Formaldehyde, adding compat recipe.");
+ CORE.RA.addDistilleryRecipe(
+ GT_Utility.getIntegratedCircuit(24),
+ FluidUtils.getFluidStack(Formaldehyde, 1000),
+ aBartWorksFormaldehyde,
+ null,
+ 20,
+ 8,
+ false);
+
+ CORE.RA.addDistilleryRecipe(
+ GT_Utility.getIntegratedCircuit(24),
+ aBartWorksFormaldehyde,
+ FluidUtils.getFluidStack(Formaldehyde, 1000),
+ null,
+ 20,
+ 8,
+ false);
+ }
+ }
+
+ private static void createFormaldehydeCatalyst() {
+ GT_Values.RA.addMixerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 16),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustVanadium", 1),
+ CI.getNumberedCircuit(18),
+ null,
+ null,
+ null,
+ ItemUtils.getSimpleStack(Formaldehyde_Catalyst_Dust, 4),
+ 160,
+ 30);
+ }
+
+ private static void createUnsymmetricalDimethylhydrazine() {
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(21), ItemUtils.getSimpleStack(GenericChem.mFormaldehydeCatalyst, 0),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("fluid.hydrazine", 2000),
+ FluidUtils.getFluidStack(Formaldehyde, 2000),
+ FluidUtils.getFluidStack("hydrogen", 4000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine, 2000), FluidUtils.getWater(2000)
+ },
+ 20 * 60,
+ 120,
+ 3);
+ }
+
+ private static void addRocketFuelsToMap() {
+ HashMap<Integer, GTPP_Recipe> mRocketFuels = new LinkedHashMap<Integer, GTPP_Recipe>();
+ mRocketFuels.put(
+ 0,
+ new GTPP_Recipe(
+ true,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {FluidUtils.getFluidStack(RP1_Plus_Liquid_Oxygen, 1000)},
+ new FluidStack[] {},
+ 0,
+ 0,
+ 512)); // Fuel Value
+
+ mRocketFuels.put(
+ 1,
+ new GTPP_Recipe(
+ true,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {FluidUtils.getFluidStack(Dense_Hydrazine_Mix, 1000)},
+ new FluidStack[] {},
+ 0,
+ 0,
+ 1024)); // Fuel Value
+
+ mRocketFuels.put(
+ 2,
+ new GTPP_Recipe(
+ true,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {FluidUtils.getFluidStack(Monomethylhydrazine_Plus_Nitric_Acid, 1000)},
+ new FluidStack[] {},
+ 0,
+ 0,
+ 2048)); // Fuel Value
+
+ mRocketFuels.put(
+ 3,
+ new GTPP_Recipe(
+ true,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide, 1000)
+ },
+ new FluidStack[] {},
+ 0,
+ 0,
+ 4196)); // Fuel Value
+
+ // Add in default Diesel for the Buggy
+ mValidRocketFuels.put(-1, Diesel);
+
+ mValidRocketFuelNames.add(FluidRegistry.getFluidName(Diesel));
+ for (int mID : mRocketFuels.keySet()) {
+ GTPP_Recipe aFuelRecipe = mRocketFuels.get(mID);
+ if (aFuelRecipe != null) {
+ mValidRocketFuelNames.add(FluidRegistry.getFluidName(aFuelRecipe.mFluidInputs[0].getFluid()));
+ mValidRocketFuels.put(mID, aFuelRecipe.mFluidInputs[0].getFluid());
+ GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels.add(aFuelRecipe);
+ }
+ }
+ }
+
+ private static void createRocketFuels() {
+
+ // RP1_Plus_Liquid_Oxygen
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Liquid_Oxygen, 2000), FluidUtils.getFluidStack(RP1, 500),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(RP1_Plus_Liquid_Oxygen, 1500),
+ },
+ 20 * 15,
+ 240,
+ 3);
+
+ // Dense_Hydrazine_Mix
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(2),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Hydrazine, 4000), FluidUtils.getFluidStack("methanol", 6000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Dense_Hydrazine_Mix, 10000),
+ },
+ 20 * 30,
+ 240,
+ 4);
+
+ // Monomethylhydrazine_Plus_Nitric_Acid
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(3),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Monomethylhydrazine, 2000), FluidUtils.getFluidStack("nitricacid", 1000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Monomethylhydrazine_Plus_Nitric_Acid, 2000),
+ },
+ 20 * 45,
+ 480,
+ 5);
+
+ // Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine, 2000),
+ FluidUtils.getFluidStack(Nitrogen_Tetroxide, 2000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide, 5000),
+ },
+ 20 * 60,
+ 480,
+ 6);
+ }
+
+ @Override
+ public String errorMessage() {
+ return "Bad Rocket Fuel Science!";
+ }
+
+ @Override
+ public boolean generateRecipes() {
+ createKerosene();
+ createRP1();
+ createNitrogenTetroxide();
+ createHydrazine();
+ createMonomethylhydrazine();
+
+ if (!CORE.GTNH) {
+ createLOX();
+ }
+ createLOH();
+
+ createHydratedAmmoniumNitrateSlurry();
+ createAmmoniumNitrateDust();
+ createFormaldehyde();
+ createFormaldehydeCatalyst();
+ createUnsymmetricalDimethylhydrazine();
+
+ createRocketFuels();
+ addRocketFuelsToMap();
+
+ return true;
+ }
+
+ @Override
+ public void items() {
+ Formaldehyde_Catalyst_Dust = ItemUtils.generateSpecialUseDusts(
+ "FormaldehydeCatalyst", "Formaldehyde Catalyst", "Fe16V1", Utils.rgbtoHexValue(25, 5, 25))[0];
+ Formaldehyde_Catalyst_Stack = ItemUtils.getSimpleStack(Formaldehyde_Catalyst_Dust);
+ }
+
+ @Override
+ public void blocks() {}
+
+ @Override
+ public void fluids() {
+
+ // Register default fluids
+ Diesel = MaterialUtils.getMaterial("Fuel", "Diesel").getFluid(1).getFluid();
+
+ // 5.08 Compat
+ if (!FluidUtils.doesFluidExist("liquid_heavy_oil")) {
+ Oil_Heavy = FluidUtils.generateFluidNoPrefix(
+ "liquid_heavy_oil", "Heavy Oil", 200, new short[] {10, 10, 10, 100});
+ } else {
+ Oil_Heavy = MaterialUtils.getMaterial("OilHeavy", "Oil").getFluid(1).getFluid();
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellOilHeavy", 1) == null) {
+ new BaseItemComponent("OilHeavy", "Heavy Oil", new short[] {10, 10, 10});
+ }
+ }
+
+ // Create Kerosene
+ Kerosene = FluidUtils.generateFluidNonMolten(
+ "Kerosene", "Kerosene", 233, new short[] {150, 40, 150, 100}, null, null);
+ CoalTar.Coal_Oil = Kerosene;
+
+ // RP! Focket Fuel
+ RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1", 500, new short[] {210, 50, 50, 100}, null, null);
+
+ // Create Nitrogen Tetroxide
+ Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten(
+ "NitrogenTetroxide", "Nitrogen Tetroxide", 261, new short[] {170, 170, 0, 100}, null, null);
+
+ // Create Hydrazine
+ Hydrazine = FluidUtils.generateFluidNonMolten(
+ "Hydrazine", "Hydrazine", 275, new short[] {250, 250, 250, 100}, null, null);
+
+ // Create Monomethylhydrazine
+ Monomethylhydrazine = FluidUtils.generateFluidNonMolten(
+ "Monomethylhydrazine", "Monomethylhydrazine", 221, new short[] {125, 125, 125, 100}, null, null);
+
+ // Create Anthracene
+ Nitrous_Oxide = FluidUtils.generateFluidNonMolten(
+ "NitrousOxide", "Nitrous Oxide", 182, new short[] {255, 255, 255, 100}, null, null);
+
+ // Nos
+ if (!FluidUtils.doesFluidExist("NitrousOxide")) {
+ Nitrous_Oxide = FluidUtils.generateFluidNoPrefix(
+ "NitrousOxide", "Nitrous Oxide", 182, new short[] {255, 255, 255, 100});
+ } else {
+ Nitrous_Oxide = FluidUtils.getWildcardFluidStack("NitrousOxide", 1).getFluid();
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellNitrousOxide", 1) == null) {
+ new BaseItemComponent("NitrousOxide", "Nitrous Oxide", new short[] {10, 10, 175});
+ }
+ }
+
+ // Unsymmetrical_Dimethylhydrazine
+ if (FluidUtils.getFluidStack("1,1dimethylhydrazine", 1) == null) {
+ Unsymmetrical_Dimethylhydrazine = FluidUtils.generateFluidNonMolten(
+ "UnsymmetricalDimethylhydrazine",
+ "Unsymmetrical Dimethylhydrazine",
+ 216,
+ new short[] {70, 210, 20, 100},
+ null,
+ null);
+ } else {
+ Unsymmetrical_Dimethylhydrazine =
+ FluidUtils.getFluidStack("1,1dimethylhydrazine", 1000).getFluid();
+ }
+
+ // Create Hydrated_Ammonium_Nitrate_Slurry
+ Hydrated_Ammonium_Nitrate_Slurry = FluidUtils.generateFluidNonMolten(
+ "AmmoniumNitrateSlurry",
+ "Hydrated Ammonium Nitrate Slurry",
+ 450,
+ new short[] {150, 75, 150, 100},
+ null,
+ null);
+
+ // Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O
+ Ammonium_Nitrate_Dust = ItemUtils.generateSpecialUseDusts(
+ "AmmoniumNitrate", "Ammonium Nitrate", "N2H4O3", Utils.rgbtoHexValue(150, 75, 150))[0];
+
+ // Create Liquid_Oxygen
+ if (FluidUtils.getFluidStack("LiquidOxygen", 1) == null
+ && FluidUtils.getFluidStack("liquidoxygen", 1) == null) {
+ Liquid_Oxygen = FluidUtils.generateFluidNonMolten(
+ "LiquidOxygen", "Liquid Oxygen", 54, new short[] {75, 75, 220, 100}, null, null);
+ } else {
+ if (FluidUtils.getFluidStack("LiquidOxygen", 1) != null) {
+ Liquid_Oxygen = FluidUtils.getFluidStack("LiquidOxygen", 1).getFluid();
+ } else {
+ Liquid_Oxygen = FluidUtils.getFluidStack("liquidoxygen", 1).getFluid();
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidOxygen", 1) == null) {
+ new BaseItemComponent("LiquidOxygen", "Liquid Oxygen", new short[] {10, 10, 175});
+ }
+ }
+
+ // Create Liquid_Hydrogen
+ if (FluidUtils.getFluidStack("LiquidHydrogen", 1) == null
+ && FluidUtils.getFluidStack("liquidhydrogen", 1) == null) {
+ Liquid_Hydrogen = FluidUtils.generateFluidNonMolten(
+ "LiquidHydrogen", "Liquid Hydrogen", 14, new short[] {75, 75, 220, 100}, null, null);
+ } else {
+ if (FluidUtils.getFluidStack("LiquidHydrogen", 1) != null) {
+ Liquid_Hydrogen = FluidUtils.getFluidStack("LiquidHydrogen", 1).getFluid();
+ } else {
+ Liquid_Hydrogen = FluidUtils.getFluidStack("liquidhydrogen", 1).getFluid();
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidHydrogen", 1) == null) {
+ new BaseItemComponent("LiquidHydrogen", "Liquid Hydrogen", new short[] {10, 10, 175});
+ }
+ }
+
+ Formaldehyde = FluidUtils.generateFluidNonMolten(
+ "Formaldehyde", "Formaldehyde", 185, new short[] {150, 75, 150, 100}, null, null);
+
+ Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten(
+ "RocketFuelMixA", "H8N4C2O4 Rocket Fuel", 216, new short[] {50, 220, 50, 100}, null, null);
+ RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten(
+ "RocketFuelMixB", "Rp-1 Rocket Fuel", 250, new short[] {250, 50, 50, 100}, null, null);
+ Monomethylhydrazine_Plus_Nitric_Acid = FluidUtils.generateFluidNonMolten(
+ "RocketFuelMixC", "CN3H7O3 Rocket Fuel", 221, new short[] {125, 75, 180, 100}, null, null);
+ Dense_Hydrazine_Mix = FluidUtils.generateFluidNonMolten(
+ "RocketFuelMixD", "Dense Hydrazine Fuel Mixture", 275, new short[] {175, 80, 120, 100}, null, null);
+ }
+
+ @Override
+ public boolean onLoadComplete(FMLLoadCompleteEvent event) {
+
+ Logger.INFO("Trying to remove GT recipes for '1,1dimethylhydrazine' && 'rocket_fuel' if they exist.");
+ /*if (FluidRegistry.isFluidRegistered("1,1dimethylhydrazine")) {
+
+ // Try Remove recipes for GT/EIO Rocket Fuel Cells
+ if (FluidRegistry.isFluidRegistered("rocket_fuel")) {
+
+ // Old Recipe
+ if (MaterialUtils.doesMaterialExist("NitrogenDioxide")) {
+ GT_Recipe aOldRecipe = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellNitrogenDioxide", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 3),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("air", 500)
+ },
+ 388);
+ boolean aDidRemove = removeRecipe(aOldRecipe, GT_Recipe_Map.sChemicalRecipes);
+ Logger.INFO("Removed Old Recipe for Rocket Fuel: "+aDidRemove);
+ }
+
+ // Simple Recipes
+ if (MaterialUtils.doesMaterialExist("Ammonia") && MaterialUtils.doesMaterialExist("Methanol")) {
+
+ GT_Recipe aSimpleRecipe1 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellMethanol", 4),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("chlorine", 1000)
+ },
+ 480);
+ GT_Recipe aSimpleRecipe2 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellMethanol", 4),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("ammonia", 3000)
+ },
+ 480);
+ GT_Recipe aSimpleRecipe3 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("methanol", 4000)
+ },
+ 480);
+
+ boolean aDidRemove1 = removeRecipe(aSimpleRecipe1, GT_Recipe_Map.sChemicalRecipes);
+ boolean aDidRemove2 = removeRecipe(aSimpleRecipe2, GT_Recipe_Map.sChemicalRecipes);
+ boolean aDidRemove3 = removeRecipe(aSimpleRecipe3, GT_Recipe_Map.sChemicalRecipes);
+ Logger.INFO("Removed Simple Recipe 1 for Rocket Fuel: "+aDidRemove1);
+ Logger.INFO("Removed Simple Recipe 2 for Rocket Fuel: "+aDidRemove2);
+ Logger.INFO("Removed Simple Recipe 3 for Rocket Fuel: "+aDidRemove3);
+ }
+
+
+ // Complex Recipes I
+ if (MaterialUtils.doesMaterialExist("Dimethylhydrazine") && MaterialUtils.doesMaterialExist("DinitrogenTetroxide")) {
+
+ GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylhydrazine", 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dinitrogentetroxide", 1000)
+ },
+ 16);
+ GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellDinitrogenTetroxide", 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dimethylhydrazine", 1000)
+ },
+ 16);
+
+ GT_Recipe aAdvRecipe3 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylhydrazine", 2),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("oxygen", 1000)
+ },
+ 16);
+ GT_Recipe aAdvRecipe4 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dimethylhydrazine", 2000)
+ },
+ 16);
+
+ boolean aDidRemove1 = removeRecipe(aAdvRecipe1, GT_Recipe_Map.sMixerRecipes);
+ boolean aDidRemove2 = removeRecipe(aAdvRecipe2, GT_Recipe_Map.sMixerRecipes);
+ boolean aDidRemove3 = removeRecipe(aAdvRecipe3, GT_Recipe_Map.sMixerRecipes);
+ boolean aDidRemove4 = removeRecipe(aAdvRecipe4, GT_Recipe_Map.sMixerRecipes);
+ Logger.INFO("Removed Complex Recipe 1 for Rocket Fuel: "+aDidRemove1);
+ Logger.INFO("Removed Complex Recipe 2 for Rocket Fuel: "+aDidRemove2);
+ Logger.INFO("Removed Complex Recipe 3 for Rocket Fuel: "+aDidRemove3);
+ Logger.INFO("Removed Complex Recipe 4 for Rocket Fuel: "+aDidRemove4);
+ }
+ }
+
+
+ // Complex Recipes II
+ if (MaterialUtils.doesMaterialExist("Dimethylhydrazine")) {
+
+ GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylhydrazine", 2),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("oxygen", 1000)
+ },
+ 16);
+ GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dimethylhydrazine", 2000)
+ },
+ 16);
+
+ boolean aDidRemove1 = removeRecipe(aAdvRecipe1, GT_Recipe_Map.sMixerRecipes);
+ boolean aDidRemove2 = removeRecipe(aAdvRecipe2, GT_Recipe_Map.sMixerRecipes);
+ Logger.INFO("Removed Complex Recipe 5 for Rocket Fuel: "+aDidRemove1);
+ Logger.INFO("Removed Complex Recipe 6 for Rocket Fuel: "+aDidRemove2);
+ }
+
+ if (MaterialUtils.doesMaterialExist("Chloramine") && MaterialUtils.doesMaterialExist("Dimethylamine")) {
+ GT_Recipe aSimpleRecipe1 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 2),
+ GT_Utility.getIntegratedCircuit(1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dimethylamine", 5000)
+ },
+ 480);
+ GT_Recipe aSimpleRecipe2 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 5),
+ GT_Utility.getIntegratedCircuit(1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("chloramine", 2000)
+ },
+ 16);
+
+
+
+ GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 2),
+ CI.emptyCells(4)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dimethylamine", 5000)
+ },
+ 480);
+ GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 5),
+ CI.emptyCells(1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("chloramine", 2000)
+ },
+ 16);
+ GT_Recipe aAdvRecipe3 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 5),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("chloramine", 2000)
+ },
+ 480);
+
+ boolean aDidRemove1 = removeRecipe(aSimpleRecipe1, GT_Recipe_Map.sChemicalRecipes);
+ boolean aDidRemove2 = removeRecipe(aSimpleRecipe2, GT_Recipe_Map.sChemicalRecipes);
+ boolean aDidRemove3 = removeRecipe(aAdvRecipe1, GT_Recipe_Map.sChemicalRecipes);
+ boolean aDidRemove4 = removeRecipe(aAdvRecipe2, GT_Recipe_Map.sChemicalRecipes);
+ boolean aDidRemove5 = removeRecipe(aAdvRecipe3, GT_Recipe_Map.sChemicalRecipes);
+ Logger.INFO("Removed Complex Recipe 1 for 1,1dimethylhydrazine: "+aDidRemove1);
+ Logger.INFO("Removed Complex Recipe 2 for 1,1dimethylhydrazine: "+aDidRemove2);
+ Logger.INFO("Removed Complex Recipe 3 for 1,1dimethylhydrazine: "+aDidRemove3);
+ Logger.INFO("Removed Complex Recipe 4 for 1,1dimethylhydrazine: "+aDidRemove4);
+ Logger.INFO("Removed Complex Recipe 5 for 1,1dimethylhydrazine: "+aDidRemove5);
+
+ }
+
+ if (MaterialUtils.doesMaterialExist("Chloramine") && MaterialUtils.doesMaterialExist("Dimethylamine")) {
+ GT_Recipe aSimpleRecipe1 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 1),
+ GT_Utility.getIntegratedCircuit(1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dimethylamine", 1000)
+ },
+ 480);
+ GT_Recipe aSimpleRecipe2 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 1),
+ GT_Utility.getIntegratedCircuit(1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("chloramine", 1000)
+ },
+ 16);
+
+
+
+ GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellChloramine", 1),
+ GT_Utility.getIntegratedCircuit(11)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dimethylamine", 1000)
+ },
+ 480);
+ GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellDimethylamine", 1),
+ GT_Utility.getIntegratedCircuit(11)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("chloramine", 1000)
+ },
+ 16);
+
+ boolean aDidRemove1 = removeRecipe(aSimpleRecipe1, GT_Recipe_Map.sChemicalRecipes);
+ boolean aDidRemove2 = removeRecipe(aSimpleRecipe2, GT_Recipe_Map.sChemicalRecipes);
+ boolean aDidRemove3 = removeRecipe(aAdvRecipe1, GT_Recipe_Map.sChemicalRecipes);
+ boolean aDidRemove4 = removeRecipe(aAdvRecipe2, GT_Recipe_Map.sChemicalRecipes);
+ Logger.INFO("Removed Complex Recipe 5 for 1,1dimethylhydrazine: "+aDidRemove1);
+ Logger.INFO("Removed Complex Recipe 6 for 1,1dimethylhydrazine: "+aDidRemove2);
+ Logger.INFO("Removed Complex Recipe 7 for 1,1dimethylhydrazine: "+aDidRemove3);
+ Logger.INFO("Removed Complex Recipe 8 for 1,1dimethylhydrazine: "+aDidRemove4);
+
+ }
+
+ if (MaterialUtils.doesMaterialExist("HypochlorousAcid") && MaterialUtils.doesMaterialExist("Ammonia") && MaterialUtils.doesMaterialExist("Methanol")) {
+
+ GT_Recipe aAdvRecipe1 = getHalfBakedRecipe(
+ new ItemStack[] {
+ GT_Utility.getIntegratedCircuit(24),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("hypochlorousacid", 3000),
+ FluidUtils.getFluidStack("ammonia", 8000),
+ FluidUtils.getFluidStack("methanol", 12000)
+ },
+ 480);
+
+ GT_Recipe aAdvRecipe2 = getHalfBakedRecipe(
+ new ItemStack[] {
+ GT_Utility.getIntegratedCircuit(24),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("hypochlorousacid", 1000),
+ FluidUtils.getFluidStack("ammonia", 1000),
+ FluidUtils.getFluidStack("methanol", 2000)
+ },
+ 480);
+
+ boolean aDidRemove1 = removeRecipe(aAdvRecipe1, StaticFields59.getLargeChemicalReactorRecipeMap());
+ boolean aDidRemove2 = removeRecipe(aAdvRecipe2, StaticFields59.getLargeChemicalReactorRecipeMap());
+ Logger.INFO("Removed Complex Recipe 9 for 1,1dimethylhydrazine: "+aDidRemove1);
+ Logger.INFO("Removed Complex Recipe 10 for 1,1dimethylhydrazine: "+aDidRemove2);
+
+
+ }
+ }*/
+
+ // Try Butcher recipes manually
+
+ // 1,1Dimethylhydrazine
+ if (FluidRegistry.isFluidRegistered("1,1dimethylhydrazine")) {
+ Logger.INFO("Making sure all Chemical Reactor recipes for 1,1dimethylhydrazine have been removed.");
+ AutoMap<GT_Recipe> aToRemoveSingle = new AutoMap<GT_Recipe>();
+ ItemStack aUnsymCell = ItemUtils.getItemStackOfAmountFromOreDict("cell1,1Dimethylhydrazine", 1);
+ FluidStack aUnsymFluid = FluidUtils.getFluidStack("1,1dimethylhydrazine", 1);
+ recipe:
+ for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sChemicalRecipes.mRecipeList) {
+ if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
+ if (aRecipeSingleBlock.mOutputs != null && aRecipeSingleBlock.mOutputs.length > 0) {
+ for (ItemStack aOutputItem : aRecipeSingleBlock.mOutputs) {
+ ItemStack aTemp = aOutputItem.copy();
+ aTemp.stackSize = 1;
+ if (GT_Utility.areStacksEqual(aTemp, aUnsymCell)) {
+ aToRemoveSingle.add(aRecipeSingleBlock);
+ continue recipe;
+ }
+ }
+ }
+ if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
+ for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
+ if (GT_Utility.areFluidsEqual(aOutput, aUnsymFluid)) {
+ aToRemoveSingle.add(aRecipeSingleBlock);
+ continue recipe;
+ }
+ }
+ }
+ }
+ }
+ // Handle Multi Also
+ AutoMap<GT_Recipe> aToRemoveMulti = new AutoMap<GT_Recipe>();
+ recipe:
+ for (GT_Recipe aRecipeSingleBlock : StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList) {
+ if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
+ if (aRecipeSingleBlock.mOutputs != null && aRecipeSingleBlock.mOutputs.length > 0) {
+ for (ItemStack aOutputItem : aRecipeSingleBlock.mOutputs) {
+ ItemStack aTemp = aOutputItem.copy();
+ aTemp.stackSize = 1;
+ if (GT_Utility.areStacksEqual(aTemp, aUnsymCell)) {
+ aToRemoveMulti.add(aRecipeSingleBlock);
+ continue recipe;
+ }
+ }
+ }
+ if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
+ for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
+ if (GT_Utility.areFluidsEqual(aOutput, aUnsymFluid)) {
+ aToRemoveMulti.add(aRecipeSingleBlock);
+ continue recipe;
+ }
+ }
+ }
+ }
+ }
+ if (!aToRemoveSingle.isEmpty()) {
+ Logger.INFO("Found " + aToRemoveSingle.size() + " single block recipes, removing by force.");
+ for (GT_Recipe remove : aToRemoveSingle) {
+ GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(remove);
+ }
+ }
+ if (!aToRemoveMulti.isEmpty()) {
+ Logger.INFO("Found " + aToRemoveSingle.size() + " multiblock recipes, removing by force.");
+ for (GT_Recipe remove : aToRemoveMulti) {
+ StaticFields59.getLargeChemicalReactorRecipeMap()
+ .mRecipeList
+ .remove(remove);
+ }
+ }
+ }
+
+ if (FluidRegistry.isFluidRegistered("rocket_fuel")) {
+ Logger.INFO("Making sure all Mixer recipes for rocket_fuel have been removed.");
+ AutoMap<GT_Recipe> aToRemoveSingle = new AutoMap<GT_Recipe>();
+ FluidStack aRocketFluid = FluidUtils.getFluidStack("rocket_fuel", 1);
+ recipe:
+ for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sMixerRecipes.mRecipeList) {
+ if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
+ if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
+ for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
+ if (GT_Utility.areFluidsEqual(aOutput, aRocketFluid)) {
+ aToRemoveSingle.add(aRecipeSingleBlock);
+ continue recipe;
+ }
+ }
+ }
+ }
+ }
+ if (!aToRemoveSingle.isEmpty()) {
+ Logger.INFO("Found " + aToRemoveSingle.size() + " recipes, removing by force.");
+ for (GT_Recipe remove : aToRemoveSingle) {
+ GT_Recipe_Map.sMixerRecipes.mRecipeList.remove(remove);
+ }
+ aToRemoveSingle.clear();
+ }
+
+ Logger.INFO("Making sure all Chemical Reactor recipes for rocket_fuel have been removed.");
+ recipe:
+ for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sChemicalRecipes.mRecipeList) {
+ if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
+ if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
+ for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
+ if (GT_Utility.areFluidsEqual(aOutput, aRocketFluid)) {
+ aToRemoveSingle.add(aRecipeSingleBlock);
+ continue recipe;
+ }
+ }
+ }
+ }
+ }
+ // Handle Multi Also
+ AutoMap<GT_Recipe> aToRemoveMulti = new AutoMap<GT_Recipe>();
+ recipe:
+ for (GT_Recipe aRecipeSingleBlock : StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList) {
+ if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) {
+ if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) {
+ for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) {
+ if (GT_Utility.areFluidsEqual(aOutput, aRocketFluid)) {
+ aToRemoveMulti.add(aRecipeSingleBlock);
+ continue recipe;
+ }
+ }
+ }
+ }
+ }
+ if (!aToRemoveSingle.isEmpty()) {
+ Logger.INFO("Found " + aToRemoveSingle.size() + " single block recipes, removing by force.");
+ for (GT_Recipe remove : aToRemoveSingle) {
+ GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(remove);
+ }
+ }
+ if (!aToRemoveMulti.isEmpty()) {
+ Logger.INFO("Found " + aToRemoveSingle.size() + " multiblock recipes, removing by force.");
+ for (GT_Recipe remove : aToRemoveMulti) {
+ StaticFields59.getLargeChemicalReactorRecipeMap()
+ .mRecipeList
+ .remove(remove);
+ }
+ }
+ }
+
+ Logger.INFO("Finished clean-up of GT Rocket Fuel Recipes.");
+ return true;
+ }
+
+ private static GTPP_Recipe getHalfBakedRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, int aEU) {
+ return new GTPP_Recipe(false, aInputs, null, null, null, aFluidInputs, null, 0, aEU, 0);
+ }
+
+ public static boolean removeRecipe(GT_Recipe aRecipe, GT_Recipe_Map aMap) {
+ if (aMap != GT_Recipe_Map.sChemicalRecipes) {
+ GT_Recipe aFoundRecipe =
+ aMap.findRecipe(null, false, true, aRecipe.mEUt, aRecipe.mFluidInputs, aRecipe.mInputs);
+ boolean aSingle = false;
+ if (aFoundRecipe != null) {
+ Logger.INFO("Found Single Block Recipe, removing.");
+ aSingle = aMap.mRecipeList.remove(aFoundRecipe);
+ Logger.INFO("Success? " + aSingle);
+ }
+ return aSingle;
+ } else {
+ GT_Recipe aFoundRecipe =
+ aMap.findRecipe(null, false, true, aRecipe.mEUt, aRecipe.mFluidInputs, aRecipe.mInputs);
+ GT_Recipe aFoundRecipe2 = StaticFields59.getLargeChemicalReactorRecipeMap()
+ .findRecipe(null, false, true, aRecipe.mEUt, aRecipe.mFluidInputs, aRecipe.mInputs);
+ boolean aSingle = false;
+ boolean aMulti = false;
+ if (aFoundRecipe != null) {
+ Logger.INFO("Found Single Block Recipe, removing.");
+ aSingle = GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(aFoundRecipe);
+ Logger.INFO("Success? " + aSingle);
+ }
+ if (aFoundRecipe2 != null) {
+ Logger.INFO("Found Multiblock Recipe, removing.");
+ aMulti = StaticFields59.getLargeChemicalReactorRecipeMap()
+ .mRecipeList
+ .remove(aFoundRecipe2);
+ Logger.INFO("Success? " + aSingle);
+ }
+ return aSingle && aMulti;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java b/src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java
index 10eaaf0da9..1b8a5f21cc 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java
@@ -1,14 +1,13 @@
package gtPlusPlus.core.item.chemistry;
-import java.util.HashMap;
-import java.util.List;
-
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.item.base.misc.BaseItemParticle;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Particle;
import gtPlusPlus.core.material.Particle.ElementaryGroup;
import gtPlusPlus.core.util.Utils;
+import java.util.HashMap;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -18,144 +17,153 @@ import net.minecraft.util.IIcon;
public class StandardBaseParticles extends BaseItemParticle {
- public static HashMap<String, Integer> NameToMetaMap = new HashMap<String, Integer>();
- public static HashMap<Integer, String> MetaToNameMap = new HashMap<Integer, String>();
-
- public StandardBaseParticles() {
- super("Base", aTypes.length, EnumRarity.rare);
- }
-
- private static final String[] aTypes = new String[] { "Graviton", "Up", "Down", "Charm", "Strange", "Top",
- "Bottom", "Electron", "Electron Neutrino", "Muon", "Muon Neutrino", "Tau", "Tau Neutrino", "Gluon",
- "Photon", "Z Boson", "W Boson", "Higgs Boson", "Proton", "Neutron", "Lambda", "Omega", "Pion",
- "ETA Meson", "Unknown" };
-
- public IIcon[] icons = new IIcon[aTypes.length];
-
- static {
- //Generate Ions
- int key = 0;
-
-
- for (String s : aTypes) {
- //Map names to Meta
- NameToMetaMap.put(Utils.sanitizeString(s.toLowerCase()), key);
- MetaToNameMap.put(key, Utils.sanitizeString(s.toLowerCase()));
- for (Particle o : Particle.aMap) {
- int aColour = 0;
- if (o.mParticleName.toLowerCase().equals(s.toLowerCase())) {
- if (o.mParticleType == ElementaryGroup.BARYON) {
- aColour = Utils.rgbtoHexValue(174, 226, 156);
- aColourMap.put(key++, aColour);
- }
- else if (o.mParticleType == ElementaryGroup.BOSON) {
- if (o == Particle.HIGGS_BOSON) {
- aColour = Utils.rgbtoHexValue(226, 196, 104);
- aColourMap.put(key++, aColour);
- }
- else {
- aColour = Utils.rgbtoHexValue(226, 52, 66);
- aColourMap.put(key++, aColour);
- }
- }
- else if (o.mParticleType == ElementaryGroup.LEPTON) {
- aColour = Utils.rgbtoHexValue(126, 226, 95);
- aColourMap.put(key++, aColour);
- }
- else if (o.mParticleType == ElementaryGroup.MESON) {
- aColour = Utils.rgbtoHexValue(90, 154, 226);
- aColourMap.put(key++, aColour);
- }
- else {
- aColour = Utils.rgbtoHexValue(188, 61, 226);
- aColourMap.put(key++, aColour);
- }
- }
- }
- }
-
- }
-
- @Override
- public String[] getAffixes() {
- return new String[] {"", ""};
- }
-
- @Override
- public String getUnlocalizedName() {
- return "";
- }
-
- @Override
+ public static HashMap<String, Integer> NameToMetaMap = new HashMap<String, Integer>();
+ public static HashMap<Integer, String> MetaToNameMap = new HashMap<Integer, String>();
+
+ public StandardBaseParticles() {
+ super("Base", aTypes.length, EnumRarity.rare);
+ }
+
+ private static final String[] aTypes = new String[] {
+ "Graviton",
+ "Up",
+ "Down",
+ "Charm",
+ "Strange",
+ "Top",
+ "Bottom",
+ "Electron",
+ "Electron Neutrino",
+ "Muon",
+ "Muon Neutrino",
+ "Tau",
+ "Tau Neutrino",
+ "Gluon",
+ "Photon",
+ "Z Boson",
+ "W Boson",
+ "Higgs Boson",
+ "Proton",
+ "Neutron",
+ "Lambda",
+ "Omega",
+ "Pion",
+ "ETA Meson",
+ "Unknown"
+ };
+
+ public IIcon[] icons = new IIcon[aTypes.length];
+
+ static {
+ // Generate Ions
+ int key = 0;
+
+ for (String s : aTypes) {
+ // Map names to Meta
+ NameToMetaMap.put(Utils.sanitizeString(s.toLowerCase()), key);
+ MetaToNameMap.put(key, Utils.sanitizeString(s.toLowerCase()));
+ for (Particle o : Particle.aMap) {
+ int aColour = 0;
+ if (o.mParticleName.toLowerCase().equals(s.toLowerCase())) {
+ if (o.mParticleType == ElementaryGroup.BARYON) {
+ aColour = Utils.rgbtoHexValue(174, 226, 156);
+ aColourMap.put(key++, aColour);
+ } else if (o.mParticleType == ElementaryGroup.BOSON) {
+ if (o == Particle.HIGGS_BOSON) {
+ aColour = Utils.rgbtoHexValue(226, 196, 104);
+ aColourMap.put(key++, aColour);
+ } else {
+ aColour = Utils.rgbtoHexValue(226, 52, 66);
+ aColourMap.put(key++, aColour);
+ }
+ } else if (o.mParticleType == ElementaryGroup.LEPTON) {
+ aColour = Utils.rgbtoHexValue(126, 226, 95);
+ aColourMap.put(key++, aColour);
+ } else if (o.mParticleType == ElementaryGroup.MESON) {
+ aColour = Utils.rgbtoHexValue(90, 154, 226);
+ aColourMap.put(key++, aColour);
+ } else {
+ aColour = Utils.rgbtoHexValue(188, 61, 226);
+ aColourMap.put(key++, aColour);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public String[] getAffixes() {
+ return new String[] {"", ""};
+ }
+
+ @Override
+ public String getUnlocalizedName() {
+ return "";
+ }
+
+ @Override
public String getUnlocalizedName(final ItemStack itemStack) {
return "item.particle.base" + "." + aTypes[itemStack.getItemDamage()];
}
-
- public static Particle getParticle(ItemStack aStack) {
- AutoMap<Particle> g = Particle.aMap;
- for (Particle p : g) {
- String aPartName = Utils.sanitizeString(p.mParticleName.toLowerCase());
- String expectedPart = Utils.sanitizeString(aTypes[aStack.getItemDamage()].toLowerCase());
- if (aPartName.equals(expectedPart)) {
- return p;
- }
- }
- return Particle.UNKNOWN;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- //return Utils.rgbtoHexValue(200, 200, 200);
- return super.getColorFromParentClass(stack, HEX_OxFFFFFF);
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- Particle aCharge = getParticle(stack);
- EnumChatFormatting aColour = EnumChatFormatting.GRAY;
- String aState = aColour+"Unknown"+EnumChatFormatting.RESET;
- if (aCharge != null) {
- String aGroup = aCharge.mParticleType.name().toLowerCase();
- if (aGroup.toLowerCase().contains("quark")) {
- aColour = EnumChatFormatting.LIGHT_PURPLE;
- }
- else if (aGroup.toLowerCase().contains("lepton")) {
- aColour = EnumChatFormatting.GREEN;
- }
- else if (aCharge == Particle.HIGGS_BOSON) {
- aColour = EnumChatFormatting.YELLOW;
- }
- else if (aGroup.toLowerCase().contains("boson")) {
- aColour = EnumChatFormatting.RED;
- }
- else if (aGroup.toLowerCase().contains("baryon")) {
- aColour = EnumChatFormatting.BLUE;
- }
- else if (aGroup.toLowerCase().contains("meson")) {
- aColour = EnumChatFormatting.WHITE;
- }
- else {
- aColour = EnumChatFormatting.GRAY;
- }
- String aFirstLet = aGroup.substring(0, 1).toUpperCase();
- aGroup = aGroup.replaceFirst(aGroup.substring(0, 1), aFirstLet);
- aState = aColour+aGroup+EnumChatFormatting.RESET;
- list.add(EnumChatFormatting.GRAY + "Type: "+aState);
- }
- super.addInformation(stack, player, list, bool);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- for (int i = 0; i < this.icons.length; i++) {
- this.icons[i] = reg.registerIcon(CORE.MODID + ":" + "particle/new/"+i);
- }
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[meta];
- }
+ public static Particle getParticle(ItemStack aStack) {
+ AutoMap<Particle> g = Particle.aMap;
+ for (Particle p : g) {
+ String aPartName = Utils.sanitizeString(p.mParticleName.toLowerCase());
+ String expectedPart = Utils.sanitizeString(aTypes[aStack.getItemDamage()].toLowerCase());
+ if (aPartName.equals(expectedPart)) {
+ return p;
+ }
+ }
+ return Particle.UNKNOWN;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ // return Utils.rgbtoHexValue(200, 200, 200);
+ return super.getColorFromParentClass(stack, HEX_OxFFFFFF);
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ Particle aCharge = getParticle(stack);
+ EnumChatFormatting aColour = EnumChatFormatting.GRAY;
+ String aState = aColour + "Unknown" + EnumChatFormatting.RESET;
+ if (aCharge != null) {
+ String aGroup = aCharge.mParticleType.name().toLowerCase();
+ if (aGroup.toLowerCase().contains("quark")) {
+ aColour = EnumChatFormatting.LIGHT_PURPLE;
+ } else if (aGroup.toLowerCase().contains("lepton")) {
+ aColour = EnumChatFormatting.GREEN;
+ } else if (aCharge == Particle.HIGGS_BOSON) {
+ aColour = EnumChatFormatting.YELLOW;
+ } else if (aGroup.toLowerCase().contains("boson")) {
+ aColour = EnumChatFormatting.RED;
+ } else if (aGroup.toLowerCase().contains("baryon")) {
+ aColour = EnumChatFormatting.BLUE;
+ } else if (aGroup.toLowerCase().contains("meson")) {
+ aColour = EnumChatFormatting.WHITE;
+ } else {
+ aColour = EnumChatFormatting.GRAY;
+ }
+ String aFirstLet = aGroup.substring(0, 1).toUpperCase();
+ aGroup = aGroup.replaceFirst(aGroup.substring(0, 1), aFirstLet);
+ aState = aColour + aGroup + EnumChatFormatting.RESET;
+ list.add(EnumChatFormatting.GRAY + "Type: " + aState);
+ }
+ super.addInformation(stack, player, list, bool);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ for (int i = 0; i < this.icons.length; i++) {
+ this.icons[i] = reg.registerIcon(CORE.MODID + ":" + "particle/new/" + i);
+ }
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[meta];
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
index 41b7d4daf1..35204999d1 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
@@ -1,12 +1,11 @@
package gtPlusPlus.core.item.chemistry.general;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.item.chemistry.GenericChem;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -21,300 +20,294 @@ import net.minecraft.world.World;
public class ItemGenericChemBase extends Item {
- final protected IIcon base[];
-
- final private int aMetaSize = 16;
-
- /*
- * 0 - Red Metal Catalyst //FeCu
- * 1 - Yellow Metal Catalyst //WNi
- * 2 - Blue Metal Catalyst //CoTi
- * 3 - Orange Metal Catalyst //Vanadium Pd
- * 4 - Purple Metal Catalyst //IrIdium Ruthenium
- * 5 - Brown Metal Catalyst //NiAl
- * 6 - Pink Metal Catalyst //PtRh
- * 7 - Alumina Grinding Ball
- * 8 - Soapstone Grinding Ball
- * 9 - Sodium Ethoxide // 2 Sodium + 1 Ethanol | 2 C2H5OH + 2 Na → 2 C2H5ONa + H2
- * 10 - Sodium Ethyl Xanthate //CH3CH2ONa + CS2 → CH3CH2OCS2Na
- * 11 - Potassium Ethyl Xanthate //CH3CH2OH + CS2 + KOH → CH3CH2OCS2K + H2O
- * 12 - Potassium Hydroxide // KOH
- * 13 - Formaldehyde Catalyst //Fe16V1
- * 14 - Solid Acid Catalyst //H2SO4
- */
-
- public ItemGenericChemBase() {
- this.setHasSubtypes(true);
- this.setNoRepair();
- this.setMaxStackSize(64);
- this.setMaxDamage(0);
- base = new IIcon[aMetaSize];
- this.setUnlocalizedName("BasicGenericChemItem");
- GameRegistry.registerItem(this, this.getUnlocalizedName());
- }
-
- @Override
- public int getItemStackLimit(ItemStack stack) {
- if (ItemUtils.isMillingBall(stack)) {
- return 16;
- }
- return super.getItemStackLimit(stack);
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean shouldRotateAroundWhenRendering() {
- return super.shouldRotateAroundWhenRendering();
- }
-
- @Override
- public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
- super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- return super.getItemStackDisplayName(aStack);
- }
-
- @Override
- public EnumRarity getRarity(ItemStack p_77613_1_) {
- return EnumRarity.common;
- }
-
- @Override
- public boolean requiresMultipleRenderPasses() {
- return false;
- }
-
- @Override
- public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
- for (int i=0;i<aMetaSize;i++) {
- aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
- }
- }
-
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return stack.getItemDamage();
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public void registerIcons(final IIconRegister u) {
- for (int i=0;i<this.aMetaSize;i++) {
- String aPath = CORE.MODID + ":" + "science/general/MetaItem1/"+i;
- this.base[i] = u.registerIcon(aPath);
- }
- }
-
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- return this.base[damage];
- }
-
- @Override
- public IIcon getIconFromDamage(int damage) {
- return this.base[damage];
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- return this.base[stack.getItemDamage()];
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return this.base[stack.getItemDamage()];
- }
-
- @Override
+ protected final IIcon base[];
+
+ private final int aMetaSize = 16;
+
+ /*
+ * 0 - Red Metal Catalyst //FeCu
+ * 1 - Yellow Metal Catalyst //WNi
+ * 2 - Blue Metal Catalyst //CoTi
+ * 3 - Orange Metal Catalyst //Vanadium Pd
+ * 4 - Purple Metal Catalyst //IrIdium Ruthenium
+ * 5 - Brown Metal Catalyst //NiAl
+ * 6 - Pink Metal Catalyst //PtRh
+ * 7 - Alumina Grinding Ball
+ * 8 - Soapstone Grinding Ball
+ * 9 - Sodium Ethoxide // 2 Sodium + 1 Ethanol | 2 C2H5OH + 2 Na → 2 C2H5ONa + H2
+ * 10 - Sodium Ethyl Xanthate //CH3CH2ONa + CS2 → CH3CH2OCS2Na
+ * 11 - Potassium Ethyl Xanthate //CH3CH2OH + CS2 + KOH → CH3CH2OCS2K + H2O
+ * 12 - Potassium Hydroxide // KOH
+ * 13 - Formaldehyde Catalyst //Fe16V1
+ * 14 - Solid Acid Catalyst //H2SO4
+ */
+
+ public ItemGenericChemBase() {
+ this.setHasSubtypes(true);
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ base = new IIcon[aMetaSize];
+ this.setUnlocalizedName("BasicGenericChemItem");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack stack) {
+ if (ItemUtils.isMillingBall(stack)) {
+ return 16;
+ }
+ return super.getItemStackLimit(stack);
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(
+ ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.common;
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return false;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ for (int i = 0; i < aMetaSize; i++) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ for (int i = 0; i < this.aMetaSize; i++) {
+ String aPath = CORE.MODID + ":" + "science/general/MetaItem1/" + i;
+ this.base[i] = u.registerIcon(aPath);
+ }
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
public String getUnlocalizedName(ItemStack stack) {
- return super.getUnlocalizedName() + "." + stack.getItemDamage();
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack aStack) {
- if (ItemUtils.isMillingBall(aStack)) {
- if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()){
- createMillingBallNBT(aStack);
- }
- double currentDamage = getMillingBallDamage(aStack);
- return currentDamage / getMaxBallDurability(aStack);
- }
- else if (ItemUtils.isCatalyst(aStack)) {
- if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()){
- createCatalystNBT(aStack);
- }
- double currentDamage = getCatalystDamage(aStack);
- return currentDamage / getCatalystMaxDamage(aStack);
- }
- else {
- return 1D;
- }
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) {
- boolean aHasSpecialTooltips = false;
- int aMaxDamage = 0;
- int aDamageSegment = 0;
- int aDam = 0;
- EnumChatFormatting durability = EnumChatFormatting.GRAY;
- if (ItemUtils.isMillingBall(aStack)) {
- list.add(EnumChatFormatting.GRAY+"Tumble Tumble Tumble");
- aMaxDamage = getMillingBallMaxDamage(aStack);
- aDamageSegment = aMaxDamage / 5;
- aDam = aMaxDamage-getMillingBallDamage(aStack);
- aHasSpecialTooltips = true;
- }
- if (ItemUtils.isCatalyst(aStack)) {
- list.add(EnumChatFormatting.GRAY+"Active Reaction Agent");
- aMaxDamage = getCatalystMaxDamage(aStack);
- aDamageSegment = aMaxDamage / 5;
- aDam = aMaxDamage-getCatalystDamage(aStack);
- aHasSpecialTooltips = true;
- }
- if (aHasSpecialTooltips) {
- if (aDam > aDamageSegment * 3){
- durability = EnumChatFormatting.GREEN;
- }
- else if (aDam > aDamageSegment * 2){
- durability = EnumChatFormatting.YELLOW;
- }
- else if (aDam > aDamageSegment){
- durability = EnumChatFormatting.GOLD;
- }
- else if (aDam >= 0){
- durability = EnumChatFormatting.RED;
- }
- list.add(durability+""+(aDam)+EnumChatFormatting.GRAY+" / "+aMaxDamage);
- }
- super.addInformation(aStack, player, list, bool);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack aStack) {
- if (ItemUtils.isMillingBall(aStack)) {
- int aDam = getMillingBallDamage(aStack);
- if (aDam > 0) {
- return true;
- }
- }
- else if (ItemUtils.isCatalyst(aStack)) {
- int aDam = getCatalystDamage(aStack);
- if (aDam > 0) {
- return true;
- }
- }
- return false;
- }
-
- public static boolean createMillingBallNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Damage", 0);
- tagNBT.setLong("MaxDamage", getMaxBallDurability(rStack));
- tagMain.setTag("MillingBall", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static int getMillingBallDamage(ItemStack aStack) {
- if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
- createMillingBallNBT(aStack);
- }
- NBTTagCompound aNBT = aStack.getTagCompound();
- return aNBT.getCompoundTag("MillingBall").getInteger("Damage");
- }
-
- public static int getMillingBallMaxDamage(ItemStack aStack) {
- if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
- createMillingBallNBT(aStack);
- }
- NBTTagCompound aNBT = aStack.getTagCompound();
- return aNBT.getCompoundTag("MillingBall").getInteger("MaxDamage");
- }
-
- public static void setMillingBallDamage(ItemStack aStack,int aAmount) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- aNBT = aNBT.getCompoundTag("MillingBall");
- aNBT.setInteger("Damage", aAmount);
- }
-
- public static int getMaxBallDurability(ItemStack aStack) {
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallAlumina, true)) {
- return 100;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallSoapstone, true)) {
- return 50;
- }
- return 0;
- }
-
- public static boolean createCatalystNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Damage", 0);
- tagNBT.setLong("MaxDamage", getMaxCatalystDurability(rStack));
- tagMain.setTag("catalyst", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static int getCatalystDamage(ItemStack aStack) {
- if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
- createCatalystNBT(aStack);
- }
- NBTTagCompound aNBT = aStack.getTagCompound();
- return aNBT.getCompoundTag("catalyst").getInteger("Damage");
- }
-
- public static int getCatalystMaxDamage(ItemStack aStack) {
- if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
- createCatalystNBT(aStack);
- }
- NBTTagCompound aNBT = aStack.getTagCompound();
- return aNBT.getCompoundTag("catalyst").getInteger("MaxDamage");
- }
-
- public static void setCatalystDamage(ItemStack aStack,int aAmount) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- aNBT = aNBT.getCompoundTag("catalyst");
- aNBT.setInteger("Damage", aAmount);
- }
-
- public static int getMaxCatalystDurability(ItemStack aStack) {
- return 50;
- }
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack aStack) {
+ if (ItemUtils.isMillingBall(aStack)) {
+ if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
+ createMillingBallNBT(aStack);
+ }
+ double currentDamage = getMillingBallDamage(aStack);
+ return currentDamage / getMaxBallDurability(aStack);
+ } else if (ItemUtils.isCatalyst(aStack)) {
+ if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
+ createCatalystNBT(aStack);
+ }
+ double currentDamage = getCatalystDamage(aStack);
+ return currentDamage / getCatalystMaxDamage(aStack);
+ } else {
+ return 1D;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) {
+ boolean aHasSpecialTooltips = false;
+ int aMaxDamage = 0;
+ int aDamageSegment = 0;
+ int aDam = 0;
+ EnumChatFormatting durability = EnumChatFormatting.GRAY;
+ if (ItemUtils.isMillingBall(aStack)) {
+ list.add(EnumChatFormatting.GRAY + "Tumble Tumble Tumble");
+ aMaxDamage = getMillingBallMaxDamage(aStack);
+ aDamageSegment = aMaxDamage / 5;
+ aDam = aMaxDamage - getMillingBallDamage(aStack);
+ aHasSpecialTooltips = true;
+ }
+ if (ItemUtils.isCatalyst(aStack)) {
+ list.add(EnumChatFormatting.GRAY + "Active Reaction Agent");
+ aMaxDamage = getCatalystMaxDamage(aStack);
+ aDamageSegment = aMaxDamage / 5;
+ aDam = aMaxDamage - getCatalystDamage(aStack);
+ aHasSpecialTooltips = true;
+ }
+ if (aHasSpecialTooltips) {
+ if (aDam > aDamageSegment * 3) {
+ durability = EnumChatFormatting.GREEN;
+ } else if (aDam > aDamageSegment * 2) {
+ durability = EnumChatFormatting.YELLOW;
+ } else if (aDam > aDamageSegment) {
+ durability = EnumChatFormatting.GOLD;
+ } else if (aDam >= 0) {
+ durability = EnumChatFormatting.RED;
+ }
+ list.add(durability + "" + (aDam) + EnumChatFormatting.GRAY + " / " + aMaxDamage);
+ }
+ super.addInformation(aStack, player, list, bool);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack aStack) {
+ if (ItemUtils.isMillingBall(aStack)) {
+ int aDam = getMillingBallDamage(aStack);
+ if (aDam > 0) {
+ return true;
+ }
+ } else if (ItemUtils.isCatalyst(aStack)) {
+ int aDam = getCatalystDamage(aStack);
+ if (aDam > 0) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean createMillingBallNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Damage", 0);
+ tagNBT.setLong("MaxDamage", getMaxBallDurability(rStack));
+ tagMain.setTag("MillingBall", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static int getMillingBallDamage(ItemStack aStack) {
+ if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
+ createMillingBallNBT(aStack);
+ }
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ return aNBT.getCompoundTag("MillingBall").getInteger("Damage");
+ }
+
+ public static int getMillingBallMaxDamage(ItemStack aStack) {
+ if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
+ createMillingBallNBT(aStack);
+ }
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ return aNBT.getCompoundTag("MillingBall").getInteger("MaxDamage");
+ }
+
+ public static void setMillingBallDamage(ItemStack aStack, int aAmount) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ aNBT = aNBT.getCompoundTag("MillingBall");
+ aNBT.setInteger("Damage", aAmount);
+ }
+
+ public static int getMaxBallDurability(ItemStack aStack) {
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallAlumina, true)) {
+ return 100;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallSoapstone, true)) {
+ return 50;
+ }
+ return 0;
+ }
+
+ public static boolean createCatalystNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Damage", 0);
+ tagNBT.setLong("MaxDamage", getMaxCatalystDurability(rStack));
+ tagMain.setTag("catalyst", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static int getCatalystDamage(ItemStack aStack) {
+ if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
+ createCatalystNBT(aStack);
+ }
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ return aNBT.getCompoundTag("catalyst").getInteger("Damage");
+ }
+
+ public static int getCatalystMaxDamage(ItemStack aStack) {
+ if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
+ createCatalystNBT(aStack);
+ }
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ return aNBT.getCompoundTag("catalyst").getInteger("MaxDamage");
+ }
+
+ public static void setCatalystDamage(ItemStack aStack, int aAmount) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ aNBT = aNBT.getCompoundTag("catalyst");
+ aNBT.setInteger("Damage", aAmount);
+ }
+
+ public static int getMaxCatalystDurability(ItemStack aStack) {
+ return 50;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java
index cfd3fd6259..4e3ca1477e 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java
@@ -1,10 +1,9 @@
package gtPlusPlus.core.item.chemistry.general;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -17,136 +16,135 @@ import net.minecraft.world.World;
public class ItemNuclearChemBase extends Item {
- final protected IIcon base[];
-
- final private int aMetaSize = 4;
-
- /*
- * 0 - Uranium Residue
- * 1 - Plutonium Residue
- * 2 - Fluoride Reside
- * 3 - Noble Gas Residue
- */
-
- public ItemNuclearChemBase() {
- this.setHasSubtypes(true);
- this.setNoRepair();
- this.setMaxStackSize(64);
- this.setMaxDamage(0);
- base = new IIcon[aMetaSize];
- this.setUnlocalizedName("BasicNuclearChemItem");
- GameRegistry.registerItem(this, this.getUnlocalizedName());
- }
-
- @Override
- public int getItemStackLimit(ItemStack stack) {
- return super.getItemStackLimit(stack);
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean shouldRotateAroundWhenRendering() {
- return super.shouldRotateAroundWhenRendering();
- }
-
- @Override
- public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
- super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- return super.getItemStackDisplayName(aStack);
- }
-
- @Override
- public EnumRarity getRarity(ItemStack p_77613_1_) {
- return EnumRarity.common;
- }
-
- @Override
- public boolean requiresMultipleRenderPasses() {
- return false;
- }
-
- @Override
- public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
- for (int i=0;i<aMetaSize;i++) {
- aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
- }
- }
-
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return stack.getItemDamage();
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public void registerIcons(final IIconRegister u) {
- for (int i=0;i<this.aMetaSize;i++) {
- String aPath = CORE.MODID + ":" + "science/nuclear/MetaItem1/"+i;
- this.base[i] = u.registerIcon(aPath);
- }
- }
-
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- return this.base[damage];
- }
-
- @Override
- public IIcon getIconFromDamage(int damage) {
- return this.base[damage];
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- return this.base[stack.getItemDamage()];
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return this.base[stack.getItemDamage()];
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ protected final IIcon base[];
+
+ private final int aMetaSize = 4;
+
+ /*
+ * 0 - Uranium Residue
+ * 1 - Plutonium Residue
+ * 2 - Fluoride Reside
+ * 3 - Noble Gas Residue
+ */
+
+ public ItemNuclearChemBase() {
+ this.setHasSubtypes(true);
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ base = new IIcon[aMetaSize];
+ this.setUnlocalizedName("BasicNuclearChemItem");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack stack) {
+ return super.getItemStackLimit(stack);
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(
+ ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
}
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) {
- super.addInformation(aStack, player, list, bool);
- }
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.common;
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return false;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ for (int i = 0; i < aMetaSize; i++) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ for (int i = 0; i < this.aMetaSize; i++) {
+ String aPath = CORE.MODID + ":" + "science/nuclear/MetaItem1/" + i;
+ this.base[i] = u.registerIcon(aPath);
+ }
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) {
+ super.addInformation(aStack, player, list, bool);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java b/src/main/java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java
index 17321a0c45..d76a71d24e 100644
--- a/src/main/java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java
+++ b/src/main/java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.item.circuit;
-import java.util.*;
-import java.util.function.BiFunction;
-import java.util.function.Predicate;
-
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
@@ -16,6 +12,9 @@ import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.*;
+import java.util.function.BiFunction;
+import java.util.function.Predicate;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -32,206 +31,229 @@ import net.minecraftforge.common.util.FakePlayer;
import org.apache.commons.lang3.tuple.Pair;
public class ItemAdvancedChip extends Item implements INetworkUpdatableItem {
- private static final List<ItemStack> ALL_VARIANTS = new ArrayList<>();
- protected IIcon base;
-
- public ItemAdvancedChip() {
- this.setHasSubtypes(true);
- this.setNoRepair();
- this.setMaxStackSize(64);
- this.setMaxDamage(0);
- this.setUnlocalizedName("T3RecipeSelector");
- GameRegistry.registerItem(this, this.getUnlocalizedName());
- ALL_VARIANTS.add(new ItemStack(this, 0, 0));
- for (int i = 1; i <= 24; i++) {
- ItemStack aStack = new ItemStack(this, 0, i);
- ALL_VARIANTS.add(aStack);
- }
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean shouldRotateAroundWhenRendering() {
- return super.shouldRotateAroundWhenRendering();
- }
-
- @Override
- public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
- super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- return super.getItemStackDisplayName(aStack);
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
- try {
- aList.add("Configuration == "+aStack.getItemDamage());
- aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".tooltip.0").toString(), "Right click to reconfigure"));
- aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".tooltip.1").toString(), "Needs a screwdriver or circuit programming tool"));
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
- }
-
- @Override
- public EnumRarity getRarity(ItemStack p_77613_1_) {
- return EnumRarity.common;
- }
-
- @Override
- public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
- aList.add(ItemUtils.simpleMetaStack(aItem, 0, 1));
- }
-
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return stack.getItemDamage();
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public void registerIcons(final IIconRegister u) {
- this.base = u.registerIcon(CORE.MODID + ":" + "science/general/AdvancedCircuit");
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- return this.base;
- }
-
- @Override
- public IIcon getIconFromDamage(int damage) {
- return this.base;
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- return this.base;
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return this.base;
- }
-
- @Override
+ private static final List<ItemStack> ALL_VARIANTS = new ArrayList<>();
+ protected IIcon base;
+
+ public ItemAdvancedChip() {
+ this.setHasSubtypes(true);
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ this.setUnlocalizedName("T3RecipeSelector");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ ALL_VARIANTS.add(new ItemStack(this, 0, 0));
+ for (int i = 1; i <= 24; i++) {
+ ItemStack aStack = new ItemStack(this, 0, i);
+ ALL_VARIANTS.add(aStack);
+ }
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(
+ ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ try {
+ aList.add("Configuration == " + aStack.getItemDamage());
+ aList.add(GT_LanguageManager.addStringLocalization(
+ new StringBuilder()
+ .append(getUnlocalizedName())
+ .append(".tooltip.0")
+ .toString(),
+ "Right click to reconfigure"));
+ aList.add(GT_LanguageManager.addStringLocalization(
+ new StringBuilder()
+ .append(getUnlocalizedName())
+ .append(".tooltip.1")
+ .toString(),
+ "Needs a screwdriver or circuit programming tool"));
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.common;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, 0, 1));
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ this.base = u.registerIcon(CORE.MODID + ":" + "science/general/AdvancedCircuit");
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ return this.base;
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return this.base;
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return this.base;
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return this.base;
+ }
+
+ @Override
public String getUnlocalizedName(ItemStack stack) {
- return super.getUnlocalizedName();
- }
-
- @Override
- public boolean receive(ItemStack stack, EntityPlayerMP player, NBTTagCompound tag) {
- int meta = tag.hasKey("meta", Constants.NBT.TAG_BYTE) ? tag.getByte("meta") : -1;
- if (meta < 0 || meta > 24)
- return true;
-
- if (!player.capabilities.isCreativeMode) {
- Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> toolIndex = findConfiguratorInInv(player);
- if (toolIndex == null) return true;
-
- ItemStack[] mainInventory = player.inventory.mainInventory;
- mainInventory[toolIndex.getKey()] = toolIndex.getValue().apply(mainInventory[toolIndex.getKey()], player);
- }
- stack.setItemDamage(meta);
-
- return true;
- }
-
- @Override
- public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
- // nothing on server side or fake player
- if (player instanceof FakePlayer || !world.isRemote) return false;
- // check if any screwdriver
- ItemStack configuratorStack;
- if (player.capabilities.isCreativeMode) {
- configuratorStack = null;
- } else {
- Pair<Integer, ?> configurator = findConfiguratorInInv(player);
- if (configurator == null) {
- int count;
- try {
- count = Integer.parseInt(StatCollector.translateToLocal("GT5U.item.programmed_circuit.no_screwdriver.count"));
- } catch (NumberFormatException e) {
- player.addChatComponentMessage(new ChatComponentText("Error in translation GT5U.item.programmed_circuit.no_screwdriver.count: " + e.getMessage()));
- count = 1;
- }
- player.addChatComponentMessage(new ChatComponentTranslation("GT5U.item.programmed_circuit.no_screwdriver." + XSTR.XSTR_INSTANCE.nextInt(count)));
- return false;
- }
- configuratorStack = player.inventory.mainInventory[configurator.getKey()];
- }
- openSelectorGui(configuratorStack, stack.getItemDamage());
- return true;
- }
-
- private void openSelectorGui(ItemStack configurator, int meta) {
- FMLCommonHandler.instance().showGuiScreen(new GT_GUIDialogSelectItem(
- StatCollector.translateToLocal("GT5U.item.programmed_circuit.select.header"),
- configurator,
- null,
- ItemAdvancedChip::onConfigured,
- ALL_VARIANTS,
- meta,
- true
- ));
- }
-
- private static void onConfigured(ItemStack stack) {
- NBTTagCompound tag = new NBTTagCompound();
- tag.setByte("meta", (byte) stack.getItemDamage());
- GT_Values.NW.sendToServer(new GT_Packet_UpdateItem(tag));
- }
-
- private static Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> findConfiguratorInInv(EntityPlayer player) {
- ItemStack[] mainInventory = player.inventory.mainInventory;
- for (int j = 0, mainInventoryLength = mainInventory.length; j < mainInventoryLength; j++) {
- ItemStack toolStack = mainInventory[j];
-
- if (!GT_Utility.isStackValid(toolStack))
- continue;
-
- for (Map.Entry<Predicate<ItemStack>, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> p : GregTech_API.sCircuitProgrammerList.entrySet())
- if (p.getKey().test(toolStack))
- return Pair.of(j, p.getValue());
- }
- return null;
- }
+ return super.getUnlocalizedName();
+ }
+
+ @Override
+ public boolean receive(ItemStack stack, EntityPlayerMP player, NBTTagCompound tag) {
+ int meta = tag.hasKey("meta", Constants.NBT.TAG_BYTE) ? tag.getByte("meta") : -1;
+ if (meta < 0 || meta > 24) return true;
+
+ if (!player.capabilities.isCreativeMode) {
+ Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> toolIndex = findConfiguratorInInv(player);
+ if (toolIndex == null) return true;
+
+ ItemStack[] mainInventory = player.inventory.mainInventory;
+ mainInventory[toolIndex.getKey()] = toolIndex.getValue().apply(mainInventory[toolIndex.getKey()], player);
+ }
+ stack.setItemDamage(meta);
+
+ return true;
+ }
+
+ @Override
+ public boolean onItemUse(
+ ItemStack stack,
+ EntityPlayer player,
+ World world,
+ int x,
+ int y,
+ int z,
+ int side,
+ float xOffset,
+ float yOffset,
+ float zOffset) {
+ // nothing on server side or fake player
+ if (player instanceof FakePlayer || !world.isRemote) return false;
+ // check if any screwdriver
+ ItemStack configuratorStack;
+ if (player.capabilities.isCreativeMode) {
+ configuratorStack = null;
+ } else {
+ Pair<Integer, ?> configurator = findConfiguratorInInv(player);
+ if (configurator == null) {
+ int count;
+ try {
+ count = Integer.parseInt(
+ StatCollector.translateToLocal("GT5U.item.programmed_circuit.no_screwdriver.count"));
+ } catch (NumberFormatException e) {
+ player.addChatComponentMessage(new ChatComponentText(
+ "Error in translation GT5U.item.programmed_circuit.no_screwdriver.count: "
+ + e.getMessage()));
+ count = 1;
+ }
+ player.addChatComponentMessage(new ChatComponentTranslation(
+ "GT5U.item.programmed_circuit.no_screwdriver." + XSTR.XSTR_INSTANCE.nextInt(count)));
+ return false;
+ }
+ configuratorStack = player.inventory.mainInventory[configurator.getKey()];
+ }
+ openSelectorGui(configuratorStack, stack.getItemDamage());
+ return true;
+ }
+
+ private void openSelectorGui(ItemStack configurator, int meta) {
+ FMLCommonHandler.instance()
+ .showGuiScreen(new GT_GUIDialogSelectItem(
+ StatCollector.translateToLocal("GT5U.item.programmed_circuit.select.header"),
+ configurator,
+ null,
+ ItemAdvancedChip::onConfigured,
+ ALL_VARIANTS,
+ meta,
+ true));
+ }
+
+ private static void onConfigured(ItemStack stack) {
+ NBTTagCompound tag = new NBTTagCompound();
+ tag.setByte("meta", (byte) stack.getItemDamage());
+ GT_Values.NW.sendToServer(new GT_Packet_UpdateItem(tag));
+ }
+
+ private static Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> findConfiguratorInInv(
+ EntityPlayer player) {
+ ItemStack[] mainInventory = player.inventory.mainInventory;
+ for (int j = 0, mainInventoryLength = mainInventory.length; j < mainInventoryLength; j++) {
+ ItemStack toolStack = mainInventory[j];
+
+ if (!GT_Utility.isStackValid(toolStack)) continue;
+
+ for (Map.Entry<Predicate<ItemStack>, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> p :
+ GregTech_API.sCircuitProgrammerList.entrySet())
+ if (p.getKey().test(toolStack)) return Pair.of(j, p.getValue());
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java b/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java
index b7bf8a7c8e..ddd3ab1542 100644
--- a/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java
+++ b/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.item.crafting;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.ModItems;
@@ -10,106 +7,82 @@ import gtPlusPlus.core.item.general.ItemGenericToken;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.LinkedHashMap;
+import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class ItemDummyResearch extends ItemGenericToken {
-
- public static enum ASSEMBLY_LINE_RESEARCH {
-
-
- RESEARCH_1_CONTAINMENT("Containment Fields", "Advanced scientific study"),
- RESEARCH_2_BASIC_CHEM("Basic Chemistry", "Time to start at the beginning"),
- RESEARCH_3_ADV_CHEM("Advanced Chemistry", "Best learn more than chemical equations"),
- RESEARCH_4_BASIC_PHYSICS("Basic Physics", "Fundamental laws of motion"),
- RESEARCH_5_ADV_PHYSICS("Advanced Physics", "Advanced knowledge!"),
- RESEARCH_6_BASIC_METALLURGY("Basic Metallurgy", "Information about material smelting"),
- RESEARCH_7_ADV_METALLURGY("Advanced Metallurgy", "Advanced Material Sciences!"),
- RESEARCH_8_TURBINE_AUTOMATION("Turbine Automation", "You really don't want to share this with anyone!"),
- RESEARCH_9_CLOAKING("Cloaking Technologies", "Sneaking around like a mouse"),
- RESEARCH_10_SPARGING("Gas Sparging", "Blowing gas for results"),
- RESEARCH_11_MOLECULAR_TRANSFORMER("Molecular Transformation", "Turning things into something better");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- private String mName;
- private String mDesc;
-
- private ASSEMBLY_LINE_RESEARCH(String aName, String aDesc) {
- mName = aName;
- mDesc = aDesc;
- ModItems.itemDummyResearch.register(mName, mDesc);
- }
-
- }
-
-
-
-
-
-
-
-
-
-
- private static Map<String, Integer> mInternalNameToIdMap = new LinkedHashMap<String, Integer>();
-
- public static ItemStack getResearchStack(ASSEMBLY_LINE_RESEARCH aResearchName, int aStacksize) {
- Integer aMeta = mInternalNameToIdMap.get(Utils.sanitizeString(aResearchName.mName));
- if (aMeta == null) {
- aMeta = 0;
- }
- return ItemUtils.simpleMetaStack(ModItems.itemDummyResearch, aMeta, aStacksize);
- }
-
- private int aID = 0;
- public ItemDummyResearch() {
- super("dummyResearch", "Research", new String[] {"This object requires some further study"}, "research");
-
-
- }
-
- /**
- *
- * @param aResearchType - What is the research for?
- * @param aDescriptThe - tooltip for this research
- * @return - Did we register a custom research item?
- */
- public boolean register(String aResearchType, String aDescript) {
- int aNewID = aID++;
- mInternalNameToIdMap.put(Utils.sanitizeString(aResearchType), aNewID);
- return register(aNewID, "Research on "+aResearchType, 1, aDescript);
- }
-
- @Override
- public boolean register(int id, String aLocalName, int aMaxStack, String aDescript) {
- return register(id, aLocalName, 1, new String[] {aDescript, EnumChatFormatting.DARK_GRAY+"Used to further your knowledge"}, EnumRarity.common, EnumChatFormatting.LIGHT_PURPLE);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerIcons(final IIconRegister aIconRegister) {
- for (int i = 0, j = mLocalNames.size(); i < j; i++) {
- mIcons.put(i, aIconRegister.registerIcon(CORE.MODID + ":" + "research" + "/" + "note"));
- }
- }
-
+ public static enum ASSEMBLY_LINE_RESEARCH {
+ RESEARCH_1_CONTAINMENT("Containment Fields", "Advanced scientific study"),
+ RESEARCH_2_BASIC_CHEM("Basic Chemistry", "Time to start at the beginning"),
+ RESEARCH_3_ADV_CHEM("Advanced Chemistry", "Best learn more than chemical equations"),
+ RESEARCH_4_BASIC_PHYSICS("Basic Physics", "Fundamental laws of motion"),
+ RESEARCH_5_ADV_PHYSICS("Advanced Physics", "Advanced knowledge!"),
+ RESEARCH_6_BASIC_METALLURGY("Basic Metallurgy", "Information about material smelting"),
+ RESEARCH_7_ADV_METALLURGY("Advanced Metallurgy", "Advanced Material Sciences!"),
+ RESEARCH_8_TURBINE_AUTOMATION("Turbine Automation", "You really don't want to share this with anyone!"),
+ RESEARCH_9_CLOAKING("Cloaking Technologies", "Sneaking around like a mouse"),
+ RESEARCH_10_SPARGING("Gas Sparging", "Blowing gas for results"),
+ RESEARCH_11_MOLECULAR_TRANSFORMER("Molecular Transformation", "Turning things into something better");
+
+ private String mName;
+ private String mDesc;
+
+ private ASSEMBLY_LINE_RESEARCH(String aName, String aDesc) {
+ mName = aName;
+ mDesc = aDesc;
+ ModItems.itemDummyResearch.register(mName, mDesc);
+ }
+ }
+
+ private static Map<String, Integer> mInternalNameToIdMap = new LinkedHashMap<String, Integer>();
+
+ public static ItemStack getResearchStack(ASSEMBLY_LINE_RESEARCH aResearchName, int aStacksize) {
+ Integer aMeta = mInternalNameToIdMap.get(Utils.sanitizeString(aResearchName.mName));
+ if (aMeta == null) {
+ aMeta = 0;
+ }
+ return ItemUtils.simpleMetaStack(ModItems.itemDummyResearch, aMeta, aStacksize);
+ }
+
+ private int aID = 0;
+
+ public ItemDummyResearch() {
+ super("dummyResearch", "Research", new String[] {"This object requires some further study"}, "research");
+ }
+
+ /**
+ *
+ * @param aResearchType - What is the research for?
+ * @param aDescriptThe - tooltip for this research
+ * @return - Did we register a custom research item?
+ */
+ public boolean register(String aResearchType, String aDescript) {
+ int aNewID = aID++;
+ mInternalNameToIdMap.put(Utils.sanitizeString(aResearchType), aNewID);
+ return register(aNewID, "Research on " + aResearchType, 1, aDescript);
+ }
+
+ @Override
+ public boolean register(int id, String aLocalName, int aMaxStack, String aDescript) {
+ return register(
+ id,
+ aLocalName,
+ 1,
+ new String[] {aDescript, EnumChatFormatting.DARK_GRAY + "Used to further your knowledge"},
+ EnumRarity.common,
+ EnumChatFormatting.LIGHT_PURPLE);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerIcons(final IIconRegister aIconRegister) {
+ for (int i = 0, j = mLocalNames.size(); i < j; i++) {
+ mIcons.put(i, aIconRegister.registerIcon(CORE.MODID + ":" + "research" + "/" + "note"));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/effects/RarityEffect.java b/src/main/java/gtPlusPlus/core/item/effects/RarityEffect.java
index 7cfd64a2e7..310a940090 100644
--- a/src/main/java/gtPlusPlus/core/item/effects/RarityEffect.java
+++ b/src/main/java/gtPlusPlus/core/item/effects/RarityEffect.java
@@ -2,7 +2,6 @@ package gtPlusPlus.core.item.effects;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
@@ -23,20 +22,19 @@ Side.SERVER marks the method as existing only on the server side.
public class RarityEffect extends Item {
- public RarityEffect(final int par1){
- super();
- this.setCreativeTab(CreativeTabs.tabMaterials);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.common;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return true;
- }
-
+ public RarityEffect(final int par1) {
+ super();
+ this.setCreativeTab(CreativeTabs.tabMaterials);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.common;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/effects/RarityEpic.java b/src/main/java/gtPlusPlus/core/item/effects/RarityEpic.java
index 74ee5ab12c..a1234d6885 100644
--- a/src/main/java/gtPlusPlus/core/item/effects/RarityEpic.java
+++ b/src/main/java/gtPlusPlus/core/item/effects/RarityEpic.java
@@ -2,7 +2,6 @@ package gtPlusPlus.core.item.effects;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
@@ -10,20 +9,19 @@ import net.minecraft.item.ItemStack;
public class RarityEpic extends Item {
- public RarityEpic(final int par1){
- super();
- this.setCreativeTab(CreativeTabs.tabMaterials);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.epic;
- }
+ public RarityEpic(final int par1) {
+ super();
+ this.setCreativeTab(CreativeTabs.tabMaterials);
+ }
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return true;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.epic;
+ }
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/effects/RarityRare.java b/src/main/java/gtPlusPlus/core/item/effects/RarityRare.java
index 60d5a681b9..fc1fabea14 100644
--- a/src/main/java/gtPlusPlus/core/item/effects/RarityRare.java
+++ b/src/main/java/gtPlusPlus/core/item/effects/RarityRare.java
@@ -2,7 +2,6 @@ package gtPlusPlus.core.item.effects;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
@@ -10,20 +9,19 @@ import net.minecraft.item.ItemStack;
public class RarityRare extends Item {
- public RarityRare(){
- super();
- this.setCreativeTab(CreativeTabs.tabMaterials);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.rare;
- }
+ public RarityRare() {
+ super();
+ this.setCreativeTab(CreativeTabs.tabMaterials);
+ }
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return true;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.rare;
+ }
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/effects/RarityUncommon.java b/src/main/java/gtPlusPlus/core/item/effects/RarityUncommon.java
index 1ce8eec5d8..f16a6693c6 100644
--- a/src/main/java/gtPlusPlus/core/item/effects/RarityUncommon.java
+++ b/src/main/java/gtPlusPlus/core/item/effects/RarityUncommon.java
@@ -2,22 +2,20 @@ package gtPlusPlus.core.item.effects;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class RarityUncommon extends Item {
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.uncommon;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return true;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.uncommon;
+ }
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java b/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java
index 94d5a8e80f..1a4be0d8e9 100644
--- a/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java
+++ b/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.item.food;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.creative.AddToCreativeTab;
@@ -12,6 +8,9 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -27,405 +26,522 @@ import net.minecraft.world.World;
public class BaseItemMetaFood extends ItemFood {
- private static final HashMap<Integer, IIcon> mIconMap = new HashMap<Integer, IIcon>();
- private static int mTotalMetaItems = 0;
-
- /*
- * 0 - Raw Human Meat
- * 1 - Cooked Human Meat
- * 2 - Raw Horse Meat
- * 3 - Cooked Horse Meat
- * 4 - Raw Wolf Meat
- * 5 - Cooked Wolf Meat
- * 6 - Raw Ocelot Meat
- * 7 - Cooked Ocelot Meat
- * 8 - Blaze Flesh
- */
-
- //listAllmeatraw
- //listAllmeatcooked
-
- public static void registerMetaFoods() {
- registerNewMetaFood(0, "I wouldn't eat this unless I was starving", 2, 0, 64, getPotionEffectPackage(new EffectWeaknessModerate(80), new EffectSlownessModerate(80)), getOreDictNamesAsArrayList("listAllmeatraw"));
- registerNewMetaFood(1, "Doesn't look any better cooked", 4, 1, 64, getPotionEffectPackage(new EffectWeaknessBasic(50), new EffectSlownessBasic(50)), getOreDictNamesAsArrayList("listAllmeatcooked"));
- registerNewMetaFood(2, "", 2, 0, 64, getPotionEffectPackage(new EffectWeaknessBasic(30), new EffectSlownessBasic(30)), getOreDictNamesAsArrayList("listAllmeatraw"));
- registerNewMetaFood(3, "", 4, 1, 64, getOreDictNamesAsArrayList("listAllmeatcooked"));
- registerNewMetaFood(4, "", 2, 0, 64, getPotionEffectPackage(new EffectWeaknessBasic(25), new EffectSlownessBasic(30)), getOreDictNamesAsArrayList("listAllmeatraw"));
- registerNewMetaFood(5, "", 4, 1, 64, getOreDictNamesAsArrayList("listAllmeatcooked"));
- registerNewMetaFood(6, "", 2, 0, 64, getPotionEffectPackage(new EffectWeaknessBasic(30), new EffectSlownessBasic(25)), getOreDictNamesAsArrayList("listAllmeatraw"));
- registerNewMetaFood(7, "", 4, 1, 64, getOreDictNamesAsArrayList("listAllmeatcooked"));
- registerNewMetaFood(8, "Warm to the touch", EnumRarity.uncommon, 4, 1, 64, new AutoMap<PotionEffectPackage>(), new setOnFire(), getOreDictNamesAsArrayList("listAllmeatcooked"));
- }
-
- private static final HashMap<Integer, Integer> mMaxStackSizeMap = new HashMap<Integer, Integer>();
- private static final HashMap<Integer, String> mTooltipMap = new HashMap<Integer, String>();
- private static final HashMap<Integer, EnumRarity> mRarityMap = new HashMap<Integer, EnumRarity>();
- private static final HashMap<Integer, Integer> mHealAmountMap = new HashMap<Integer, Integer>();
- private static final HashMap<Integer, Float> mSaturationAmountMap = new HashMap<Integer, Float>();
- private static final HashMap<Integer, AutoMap<PotionEffectPackage>> mPotionEffectsMap = new HashMap<Integer, AutoMap<PotionEffectPackage>>();
- private static final HashMap<Integer, Boolean> mHasSpecialBehaviourMap = new HashMap<Integer, Boolean>();
- private static final HashMap<Integer, SpecialFoodBehaviour> mSpecialBehaviourMap = new HashMap<Integer, SpecialFoodBehaviour>();
- private static final HashMap<Integer, ArrayList<String>> mOreDictNames = new HashMap<Integer, ArrayList<String>>();
-
-
- public static void registerNewMetaFood(final int aMetaID, String aTooltip, final int aHealAmount, final float aSaturationModifier, final int aMaxStacksize) {
- registerNewMetaFood(aMetaID, aTooltip, EnumRarity.common, aHealAmount, aSaturationModifier, aMaxStacksize, new AutoMap<PotionEffectPackage>(), null, new ArrayList<String>());
- }
-
- public static void registerNewMetaFood(final int aMetaID, String aTooltip, final int aHealAmount, final float aSaturationModifier, final int aMaxStacksize, final ArrayList<String> aOreDictNames) {
- registerNewMetaFood(aMetaID, aTooltip, EnumRarity.common, aHealAmount, aSaturationModifier, aMaxStacksize, new AutoMap<PotionEffectPackage>(), null, aOreDictNames);
- }
-
-
- public static void registerNewMetaFood(final int aMetaID, String aTooltip, final int aHealAmount, final float aSaturationModifier, final int aMaxStacksize, final AutoMap<PotionEffectPackage> aPotionEffects) {
- registerNewMetaFood(aMetaID, aTooltip, EnumRarity.common, aHealAmount, aSaturationModifier, aMaxStacksize, new AutoMap<PotionEffectPackage>(), null, new ArrayList<String>());
- }
-
- public static void registerNewMetaFood(final int aMetaID, String aTooltip, final int aHealAmount, final float aSaturationModifier, final int aMaxStacksize, final AutoMap<PotionEffectPackage> aPotionEffects, final ArrayList<String> aOreDictNames) {
- registerNewMetaFood(aMetaID, aTooltip, EnumRarity.common, aHealAmount, aSaturationModifier, aMaxStacksize, aPotionEffects, null, aOreDictNames);
- }
-
- public static void registerNewMetaFood(final int aMetaID, String aTooltip, EnumRarity aRarity, final int aHealAmount, final float aSaturationModifier, final int aMaxStacksize, final AutoMap<PotionEffectPackage> aPotionEffects, final SpecialFoodBehaviour aSpecialBehaviour) {
- registerNewMetaFood(aMetaID, aTooltip, EnumRarity.common, aHealAmount, aSaturationModifier, aMaxStacksize, aPotionEffects, null, new ArrayList<String>());
- }
-
- public static void registerNewMetaFood(final int aMetaID, String aTooltip, EnumRarity aRarity, final int aHealAmount, final float aSaturationModifier, final int aMaxStacksize, final AutoMap<PotionEffectPackage> aPotionEffects, final SpecialFoodBehaviour aSpecialBehaviour, final ArrayList<String> aOreDictNames) {
- mTotalMetaItems++;
- mMaxStackSizeMap.put(aMetaID, aMaxStacksize);
- mTooltipMap.put(aMetaID, aTooltip);
- mRarityMap.put(aMetaID, aRarity);
- mHealAmountMap.put(aMetaID, aHealAmount);
- mSaturationAmountMap.put(aMetaID, aSaturationModifier);
- mPotionEffectsMap.put(aMetaID, aPotionEffects);
- mHasSpecialBehaviourMap.put(aMetaID, (aSpecialBehaviour != null));
- if (aSpecialBehaviour != null) {
- mSpecialBehaviourMap.put(aMetaID, aSpecialBehaviour);
- }
- mOreDictNames.put(aMetaID, aOreDictNames);
- }
-
- public static void registerFoodsToOreDict() {
- for (int aMetaID=0; aMetaID < mTotalMetaItems; aMetaID++) {
- ArrayList<String> aOreDictNames = mOreDictNames.get(aMetaID);
- if (aOreDictNames != null && !aOreDictNames.isEmpty()) {
- ItemStack aFoodStack = ItemUtils.simpleMetaStack(ModItems.itemMetaFood, aMetaID, 1);
- for (String aOreName : aOreDictNames) {
- ItemUtils.addItemToOreDictionary(aFoodStack, aOreName);
- }
- }
- }
- }
-
-
- public BaseItemMetaFood() {
- super(0, 0, false);
- this.setHasSubtypes(true);
- this.setNoRepair();
- this.setMaxStackSize(64);
- this.setMaxDamage(0);
- this.setUnlocalizedName("BasicMetaFood");
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- GameRegistry.registerItem(this, this.getUnlocalizedName());
- BaseItemMetaFood.registerMetaFoods();
- }
-
- private static final int getMetaKey(ItemStack aStack) {
- return aStack.getItemDamage();
- }
-
- // Heal Amount
- public int func_150905_g(ItemStack aStack) {
- return mHealAmountMap.get(getMetaKey(aStack));
- }
-
- // Saturation Amount
- public float func_150906_h(ItemStack aStack) {
- return mSaturationAmountMap.get(getMetaKey(aStack));
- }
-
- // Whether wolves like this food, sadly doesn't support meta items
- public boolean isWolfsFavoriteMeat() {
- return false;
- }
-
- @Override
- protected void onFoodEaten(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- //super.onFoodEaten(stack, world, player);
- AutoMap<PotionEffectPackage> aPotionEffects = mPotionEffectsMap.get(getMetaKey(aStack));
- if (!aWorld.isRemote && aPotionEffects != null && aPotionEffects.size() > 0) {
- for (PotionEffectPackage aFoodEffect : aPotionEffects) {
- if (MathUtils.randInt(0, 100) <= aFoodEffect.getChance() || aFoodEffect.getChance() == 100) {
- PotionEffect aEffect = aFoodEffect.getEffect();
- if (aEffect != null && aEffect.getPotionID() > 0) {
- aPlayer.addPotionEffect(new PotionEffect(aEffect.getPotionID(), aEffect.getDuration() * 20, aEffect.getAmplifier(), aEffect.getIsAmbient()));
- }
- }
- }
- }
-
- boolean aHasEpcialBehaviour = mHasSpecialBehaviourMap.get(getMetaKey(aStack));
- if (!aWorld.isRemote && aHasEpcialBehaviour) {
- SpecialFoodBehaviour aBehaviour = mSpecialBehaviourMap.get(getMetaKey(aStack));
- if (aBehaviour != null) {
- aBehaviour.doBehaviour(aPlayer);
- }
- }
- }
-
- @Override
- public ItemStack onEaten(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- return super.onEaten(aStack, aWorld, aPlayer);
- }
-
-
- @Override
- public int getItemStackLimit(ItemStack aStack) {
- return mMaxStackSizeMap.get(getMetaKey(aStack));
- }
-
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean shouldRotateAroundWhenRendering() {
- return super.shouldRotateAroundWhenRendering();
- }
-
- @Override
- public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
- super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- return super.getItemStackDisplayName(aStack);
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
- try {
- String aTooltip = mTooltipMap.get(getMetaKey(aStack));
- if (aTooltip != null && aTooltip.length() > 0) {
- aList.add(aTooltip);
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
- }
-
- @Override
- public EnumRarity getRarity(ItemStack aStack) {
- return mRarityMap.get(getMetaKey(aStack));
- }
-
- @Override
- public boolean requiresMultipleRenderPasses() {
- return false;
- }
-
- @Override
- public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
- for (int i=0;i<mIconMap.size();i++) {
- aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
- }
- }
-
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return stack.getItemDamage();
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public void registerIcons(final IIconRegister u) {
- for (int i=0;i<mTotalMetaItems;i++) {
- String aPath = CORE.MODID + ":" + "food/MetaItem1/"+i;
- mIconMap.put(i, u.registerIcon(aPath));
- }
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- return mIconMap.get(damage);
- }
-
- @Override
- public IIcon getIconFromDamage(int damage) {
- return mIconMap.get(damage);
- }
-
- @Override
- public IIcon getIcon(ItemStack aStack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- return mIconMap.get(getMetaKey(aStack));
- }
-
- @Override
- public IIcon getIcon(ItemStack aStack, int pass) {
- return mIconMap.get(getMetaKey(aStack));
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return super.getUnlocalizedName() + "." + stack.getItemDamage();
- }
-
- private static class PotionEffectPackage {
-
- private final PotionEffect mEffect;
- private final int mChance;
-
- private PotionEffectPackage(PotionEffect aEffect, int aChance) {
- mEffect = aEffect;
- mChance = aChance;
- }
-
- public PotionEffect getEffect() {
- return this.mEffect;
- }
-
- public int getChance() {
- return this.mChance;
- }
-
- }
-
- private static AutoMap<PotionEffectPackage> getPotionEffectPackage(PotionEffectPackage... aEffects){
- AutoMap<PotionEffectPackage> aPackage = new AutoMap<PotionEffectPackage>();
- if (aEffects != null && aEffects.length > 0) {
- for (PotionEffectPackage aEffect : aEffects) {
- aPackage.put(aEffect);
- }
- }
- return aPackage;
- }
-
- private static ArrayList<String> getOreDictNamesAsArrayList(String... aOreDictNames){
- ArrayList<String> aPackage = new ArrayList<String>();
- if (aOreDictNames != null && aOreDictNames.length > 0) {
- for (String aEffect : aOreDictNames) {
- aPackage.add(aEffect);
- }
- }
- return aPackage;
- }
-
- private static class EffectWeaknessBasic extends PotionEffectPackage {
-
- protected EffectWeaknessBasic(int aChance) {
- super(new PotionEffect(Potion.weakness.getId(), 1, 20), aChance);
- }
-
- }
-
- private static class EffectWeaknessModerate extends PotionEffectPackage {
-
- protected EffectWeaknessModerate(int aChance) {
- super(new PotionEffect(Potion.weakness.getId(), 2, 40), aChance);
- }
-
- }
-
- private static class EffectWeaknessSevere extends PotionEffectPackage {
-
- protected EffectWeaknessSevere(int aChance) {
- super(new PotionEffect(Potion.weakness.getId(), 3, 60), aChance);
- }
-
- }
-
- private static class EffectSlownessBasic extends PotionEffectPackage {
-
- protected EffectSlownessBasic(int aChance) {
- super(new PotionEffect(Potion.moveSlowdown.getId(), 1, 20), aChance);
- }
-
- }
-
- private static class EffectSlownessModerate extends PotionEffectPackage {
-
- protected EffectSlownessModerate(int aChance) {
- super(new PotionEffect(Potion.moveSlowdown.getId(), 2, 40), aChance);
- }
-
- }
-
- private static class EffectSlownessSevere extends PotionEffectPackage {
-
- protected EffectSlownessSevere(int aChance) {
- super(new PotionEffect(Potion.moveSlowdown.getId(), 3, 60), aChance);
- }
-
- }
-
-
-
-
- private static abstract class SpecialFoodBehaviour {
-
- protected final int mChance;
-
- public SpecialFoodBehaviour(int aChance) {
- mChance = aChance;
- }
-
- public final void doBehaviour(EntityPlayer aPlayer) {
- if (aPlayer != null && !aPlayer.worldObj.isRemote) {
- if (MathUtils.randInt(0, 100) < mChance || mChance == 100) {
- behaviour(aPlayer);
- }
- }
- }
-
- protected abstract void behaviour(EntityPlayer aPlayer);
-
- }
-
-
- private static class setOnFire extends SpecialFoodBehaviour {
-
- public setOnFire() {
- super(100);
- }
-
- @Override
- public void behaviour(EntityPlayer aPlayer) {
- EntityUtils.setEntityOnFire(aPlayer, 5);
- }
-
- }
-
-} \ No newline at end of file
+ private static final HashMap<Integer, IIcon> mIconMap = new HashMap<Integer, IIcon>();
+ private static int mTotalMetaItems = 0;
+
+ /*
+ * 0 - Raw Human Meat
+ * 1 - Cooked Human Meat
+ * 2 - Raw Horse Meat
+ * 3 - Cooked Horse Meat
+ * 4 - Raw Wolf Meat
+ * 5 - Cooked Wolf Meat
+ * 6 - Raw Ocelot Meat
+ * 7 - Cooked Ocelot Meat
+ * 8 - Blaze Flesh
+ */
+
+ // listAllmeatraw
+ // listAllmeatcooked
+
+ public static void registerMetaFoods() {
+ registerNewMetaFood(
+ 0,
+ "I wouldn't eat this unless I was starving",
+ 2,
+ 0,
+ 64,
+ getPotionEffectPackage(new EffectWeaknessModerate(80), new EffectSlownessModerate(80)),
+ getOreDictNamesAsArrayList("listAllmeatraw"));
+ registerNewMetaFood(
+ 1,
+ "Doesn't look any better cooked",
+ 4,
+ 1,
+ 64,
+ getPotionEffectPackage(new EffectWeaknessBasic(50), new EffectSlownessBasic(50)),
+ getOreDictNamesAsArrayList("listAllmeatcooked"));
+ registerNewMetaFood(
+ 2,
+ "",
+ 2,
+ 0,
+ 64,
+ getPotionEffectPackage(new EffectWeaknessBasic(30), new EffectSlownessBasic(30)),
+ getOreDictNamesAsArrayList("listAllmeatraw"));
+ registerNewMetaFood(3, "", 4, 1, 64, getOreDictNamesAsArrayList("listAllmeatcooked"));
+ registerNewMetaFood(
+ 4,
+ "",
+ 2,
+ 0,
+ 64,
+ getPotionEffectPackage(new EffectWeaknessBasic(25), new EffectSlownessBasic(30)),
+ getOreDictNamesAsArrayList("listAllmeatraw"));
+ registerNewMetaFood(5, "", 4, 1, 64, getOreDictNamesAsArrayList("listAllmeatcooked"));
+ registerNewMetaFood(
+ 6,
+ "",
+ 2,
+ 0,
+ 64,
+ getPotionEffectPackage(new EffectWeaknessBasic(30), new EffectSlownessBasic(25)),
+ getOreDictNamesAsArrayList("listAllmeatraw"));
+ registerNewMetaFood(7, "", 4, 1, 64, getOreDictNamesAsArrayList("listAllmeatcooked"));
+ registerNewMetaFood(
+ 8,
+ "Warm to the touch",
+ EnumRarity.uncommon,
+ 4,
+ 1,
+ 64,
+ new AutoMap<PotionEffectPackage>(),
+ new setOnFire(),
+ getOreDictNamesAsArrayList("listAllmeatcooked"));
+ }
+
+ private static final HashMap<Integer, Integer> mMaxStackSizeMap = new HashMap<Integer, Integer>();
+ private static final HashMap<Integer, String> mTooltipMap = new HashMap<Integer, String>();
+ private static final HashMap<Integer, EnumRarity> mRarityMap = new HashMap<Integer, EnumRarity>();
+ private static final HashMap<Integer, Integer> mHealAmountMap = new HashMap<Integer, Integer>();
+ private static final HashMap<Integer, Float> mSaturationAmountMap = new HashMap<Integer, Float>();
+ private static final HashMap<Integer, AutoMap<PotionEffectPackage>> mPotionEffectsMap =
+ new HashMap<Integer, AutoMap<PotionEffectPackage>>();
+ private static final HashMap<Integer, Boolean> mHasSpecialBehaviourMap = new HashMap<Integer, Boolean>();
+ private static final HashMap<Integer, SpecialFoodBehaviour> mSpecialBehaviourMap =
+ new HashMap<Integer, SpecialFoodBehaviour>();
+ private static final HashMap<Integer, ArrayList<String>> mOreDictNames = new HashMap<Integer, ArrayList<String>>();
+
+ public static void registerNewMetaFood(
+ final int aMetaID,
+ String aTooltip,
+ final int aHealAmount,
+ final float aSaturationModifier,
+ final int aMaxStacksize) {
+ registerNewMetaFood(
+ aMetaID,
+ aTooltip,
+ EnumRarity.common,
+ aHealAmount,
+ aSaturationModifier,
+ aMaxStacksize,
+ new AutoMap<PotionEffectPackage>(),
+ null,
+ new ArrayList<String>());
+ }
+
+ public static void registerNewMetaFood(
+ final int aMetaID,
+ String aTooltip,
+ final int aHealAmount,
+ final float aSaturationModifier,
+ final int aMaxStacksize,
+ final ArrayList<String> aOreDictNames) {
+ registerNewMetaFood(
+ aMetaID,
+ aTooltip,
+ EnumRarity.common,
+ aHealAmount,
+ aSaturationModifier,
+ aMaxStacksize,
+ new AutoMap<PotionEffectPackage>(),
+ null,
+ aOreDictNames);
+ }
+
+ public static void registerNewMetaFood(
+ final int aMetaID,
+ String aTooltip,
+ final int aHealAmount,
+ final float aSaturationModifier,
+ final int aMaxStacksize,
+ final AutoMap<PotionEffectPackage> aPotionEffects) {
+ registerNewMetaFood(
+ aMetaID,
+ aTooltip,
+ EnumRarity.common,
+ aHealAmount,
+ aSaturationModifier,
+ aMaxStacksize,
+ new AutoMap<PotionEffectPackage>(),
+ null,
+ new ArrayList<String>());
+ }
+
+ public static void registerNewMetaFood(
+ final int aMetaID,
+ String aTooltip,
+ final int aHealAmount,
+ final float aSaturationModifier,
+ final int aMaxStacksize,
+ final AutoMap<PotionEffectPackage> aPotionEffects,
+ final ArrayList<String> aOreDictNames) {
+ registerNewMetaFood(
+ aMetaID,
+ aTooltip,
+ EnumRarity.common,
+ aHealAmount,
+ aSaturationModifier,
+ aMaxStacksize,
+ aPotionEffects,
+ null,
+ aOreDictNames);
+ }
+
+ public static void registerNewMetaFood(
+ final int aMetaID,
+ String aTooltip,
+ EnumRarity aRarity,
+ final int aHealAmount,
+ final float aSaturationModifier,
+ final int aMaxStacksize,
+ final AutoMap<PotionEffectPackage> aPotionEffects,
+ final SpecialFoodBehaviour aSpecialBehaviour) {
+ registerNewMetaFood(
+ aMetaID,
+ aTooltip,
+ EnumRarity.common,
+ aHealAmount,
+ aSaturationModifier,
+ aMaxStacksize,
+ aPotionEffects,
+ null,
+ new ArrayList<String>());
+ }
+
+ public static void registerNewMetaFood(
+ final int aMetaID,
+ String aTooltip,
+ EnumRarity aRarity,
+ final int aHealAmount,
+ final float aSaturationModifier,
+ final int aMaxStacksize,
+ final AutoMap<PotionEffectPackage> aPotionEffects,
+ final SpecialFoodBehaviour aSpecialBehaviour,
+ final ArrayList<String> aOreDictNames) {
+ mTotalMetaItems++;
+ mMaxStackSizeMap.put(aMetaID, aMaxStacksize);
+ mTooltipMap.put(aMetaID, aTooltip);
+ mRarityMap.put(aMetaID, aRarity);
+ mHealAmountMap.put(aMetaID, aHealAmount);
+ mSaturationAmountMap.put(aMetaID, aSaturationModifier);
+ mPotionEffectsMap.put(aMetaID, aPotionEffects);
+ mHasSpecialBehaviourMap.put(aMetaID, (aSpecialBehaviour != null));
+ if (aSpecialBehaviour != null) {
+ mSpecialBehaviourMap.put(aMetaID, aSpecialBehaviour);
+ }
+ mOreDictNames.put(aMetaID, aOreDictNames);
+ }
+
+ public static void registerFoodsToOreDict() {
+ for (int aMetaID = 0; aMetaID < mTotalMetaItems; aMetaID++) {
+ ArrayList<String> aOreDictNames = mOreDictNames.get(aMetaID);
+ if (aOreDictNames != null && !aOreDictNames.isEmpty()) {
+ ItemStack aFoodStack = ItemUtils.simpleMetaStack(ModItems.itemMetaFood, aMetaID, 1);
+ for (String aOreName : aOreDictNames) {
+ ItemUtils.addItemToOreDictionary(aFoodStack, aOreName);
+ }
+ }
+ }
+ }
+
+ public BaseItemMetaFood() {
+ super(0, 0, false);
+ this.setHasSubtypes(true);
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ this.setUnlocalizedName("BasicMetaFood");
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ BaseItemMetaFood.registerMetaFoods();
+ }
+
+ private static final int getMetaKey(ItemStack aStack) {
+ return aStack.getItemDamage();
+ }
+
+ // Heal Amount
+ public int func_150905_g(ItemStack aStack) {
+ return mHealAmountMap.get(getMetaKey(aStack));
+ }
+
+ // Saturation Amount
+ public float func_150906_h(ItemStack aStack) {
+ return mSaturationAmountMap.get(getMetaKey(aStack));
+ }
+
+ // Whether wolves like this food, sadly doesn't support meta items
+ public boolean isWolfsFavoriteMeat() {
+ return false;
+ }
+
+ @Override
+ protected void onFoodEaten(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
+ // super.onFoodEaten(stack, world, player);
+ AutoMap<PotionEffectPackage> aPotionEffects = mPotionEffectsMap.get(getMetaKey(aStack));
+ if (!aWorld.isRemote && aPotionEffects != null && aPotionEffects.size() > 0) {
+ for (PotionEffectPackage aFoodEffect : aPotionEffects) {
+ if (MathUtils.randInt(0, 100) <= aFoodEffect.getChance() || aFoodEffect.getChance() == 100) {
+ PotionEffect aEffect = aFoodEffect.getEffect();
+ if (aEffect != null && aEffect.getPotionID() > 0) {
+ aPlayer.addPotionEffect(new PotionEffect(
+ aEffect.getPotionID(),
+ aEffect.getDuration() * 20,
+ aEffect.getAmplifier(),
+ aEffect.getIsAmbient()));
+ }
+ }
+ }
+ }
+
+ boolean aHasEpcialBehaviour = mHasSpecialBehaviourMap.get(getMetaKey(aStack));
+ if (!aWorld.isRemote && aHasEpcialBehaviour) {
+ SpecialFoodBehaviour aBehaviour = mSpecialBehaviourMap.get(getMetaKey(aStack));
+ if (aBehaviour != null) {
+ aBehaviour.doBehaviour(aPlayer);
+ }
+ }
+ }
+
+ @Override
+ public ItemStack onEaten(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ return super.onEaten(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack aStack) {
+ return mMaxStackSizeMap.get(getMetaKey(aStack));
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(
+ ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ try {
+ String aTooltip = mTooltipMap.get(getMetaKey(aStack));
+ if (aTooltip != null && aTooltip.length() > 0) {
+ aList.add(aTooltip);
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack aStack) {
+ return mRarityMap.get(getMetaKey(aStack));
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return false;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ for (int i = 0; i < mIconMap.size(); i++) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ for (int i = 0; i < mTotalMetaItems; i++) {
+ String aPath = CORE.MODID + ":" + "food/MetaItem1/" + i;
+ mIconMap.put(i, u.registerIcon(aPath));
+ }
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ return mIconMap.get(damage);
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return mIconMap.get(damage);
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack aStack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return mIconMap.get(getMetaKey(aStack));
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack aStack, int pass) {
+ return mIconMap.get(getMetaKey(aStack));
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ private static class PotionEffectPackage {
+
+ private final PotionEffect mEffect;
+ private final int mChance;
+
+ private PotionEffectPackage(PotionEffect aEffect, int aChance) {
+ mEffect = aEffect;
+ mChance = aChance;
+ }
+
+ public PotionEffect getEffect() {
+ return this.mEffect;
+ }
+
+ public int getChance() {
+ return this.mChance;
+ }
+ }
+
+ private static AutoMap<PotionEffectPackage> getPotionEffectPackage(PotionEffectPackage... aEffects) {
+ AutoMap<PotionEffectPackage> aPackage = new AutoMap<PotionEffectPackage>();
+ if (aEffects != null && aEffects.length > 0) {
+ for (PotionEffectPackage aEffect : aEffects) {
+ aPackage.put(aEffect);
+ }
+ }
+ return aPackage;
+ }
+
+ private static ArrayList<String> getOreDictNamesAsArrayList(String... aOreDictNames) {
+ ArrayList<String> aPackage = new ArrayList<String>();
+ if (aOreDictNames != null && aOreDictNames.length > 0) {
+ for (String aEffect : aOreDictNames) {
+ aPackage.add(aEffect);
+ }
+ }
+ return aPackage;
+ }
+
+ private static class EffectWeaknessBasic extends PotionEffectPackage {
+
+ protected EffectWeaknessBasic(int aChance) {
+ super(new PotionEffect(Potion.weakness.getId(), 1, 20), aChance);
+ }
+ }
+
+ private static class EffectWeaknessModerate extends PotionEffectPackage {
+
+ protected EffectWeaknessModerate(int aChance) {
+ super(new PotionEffect(Potion.weakness.getId(), 2, 40), aChance);
+ }
+ }
+
+ private static class EffectWeaknessSevere extends PotionEffectPackage {
+
+ protected EffectWeaknessSevere(int aChance) {
+ super(new PotionEffect(Potion.weakness.getId(), 3, 60), aChance);
+ }
+ }
+
+ private static class EffectSlownessBasic extends PotionEffectPackage {
+
+ protected EffectSlownessBasic(int aChance) {
+ super(new PotionEffect(Potion.moveSlowdown.getId(), 1, 20), aChance);
+ }
+ }
+
+ private static class EffectSlownessModerate extends PotionEffectPackage {
+
+ protected EffectSlownessModerate(int aChance) {
+ super(new PotionEffect(Potion.moveSlowdown.getId(), 2, 40), aChance);
+ }
+ }
+
+ private static class EffectSlownessSevere extends PotionEffectPackage {
+
+ protected EffectSlownessSevere(int aChance) {
+ super(new PotionEffect(Potion.moveSlowdown.getId(), 3, 60), aChance);
+ }
+ }
+
+ private abstract static class SpecialFoodBehaviour {
+
+ protected final int mChance;
+
+ public SpecialFoodBehaviour(int aChance) {
+ mChance = aChance;
+ }
+
+ public final void doBehaviour(EntityPlayer aPlayer) {
+ if (aPlayer != null && !aPlayer.worldObj.isRemote) {
+ if (MathUtils.randInt(0, 100) < mChance || mChance == 100) {
+ behaviour(aPlayer);
+ }
+ }
+ }
+
+ protected abstract void behaviour(EntityPlayer aPlayer);
+ }
+
+ private static class setOnFire extends SpecialFoodBehaviour {
+
+ public setOnFire() {
+ super(100);
+ }
+
+ @Override
+ public void behaviour(EntityPlayer aPlayer) {
+ EntityUtils.setEntityOnFire(aPlayer, 5);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java b/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java
index 0ff922d853..6eaa4b1588 100644
--- a/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java
+++ b/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java
@@ -1,11 +1,13 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -13,72 +15,67 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.handler.GuiHandler;
-import gtPlusPlus.core.lib.CORE;
-
public class BaseItemGrindle extends Item {
- protected final String unlocalName;
+ protected final String unlocalName;
- public BaseItemGrindle() {
- this.unlocalName = "itemGrindleTablet";
- this.setUnlocalizedName("itemGrindleTablet");
- this.setTextureName(CORE.MODID + ":" + "itemTablet");
- GameRegistry.registerItem(this, "itemGrindleTablet");
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabOther);
- }
+ public BaseItemGrindle() {
+ this.unlocalName = "itemGrindleTablet";
+ this.setUnlocalizedName("itemGrindleTablet");
+ this.setTextureName(CORE.MODID + ":" + "itemTablet");
+ GameRegistry.registerItem(this, "itemGrindleTablet");
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabOther);
+ }
- @Override
- public int getMaxItemUseDuration(final ItemStack stack) {
- return 1;
- }
+ @Override
+ public int getMaxItemUseDuration(final ItemStack stack) {
+ return 1;
+ }
- @Override
- public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
- if (!world.isRemote) {
- if (!player.isSneaking()) {
- player.openGui(GTplusplus.instance, GuiHandler.GUI9, world, 0, 0, 0);
- }
- }
- return itemstack;
- }
+ @Override
+ public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
+ if (!world.isRemote) {
+ if (!player.isSneaking()) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI9, world, 0, 0, 0);
+ }
+ }
+ return itemstack;
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack aStack) {
- String aName = super.getItemStackDisplayName(aStack);
- if (aName.toLowerCase().contains(".name") || aName.toLowerCase().contains("git")) {
- aName = "Grindle";
- }
- return aName;
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack aStack) {
+ String aName = super.getItemStackDisplayName(aStack);
+ if (aName.toLowerCase().contains(".name") || aName.toLowerCase().contains("git")) {
+ aName = "Grindle";
+ }
+ return aName;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister iconRegister) {
- this.itemIcon = iconRegister.registerIcon(CORE.MODID + ":" + "itemTablet");
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(final IIconRegister iconRegister) {
+ this.itemIcon = iconRegister.registerIcon(CORE.MODID + ":" + "itemTablet");
+ }
- @Override
- public String getPotionEffect(ItemStack p_150896_1_) {
- return super.getPotionEffect(p_150896_1_);
- }
+ @Override
+ public String getPotionEffect(ItemStack p_150896_1_) {
+ return super.getPotionEffect(p_150896_1_);
+ }
- @Override
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
- super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_);
- aList.add("Used to read data from DataSticks & DataOrbs.");
- }
+ @Override
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_);
+ aList.add("Used to read data from DataSticks & DataOrbs.");
+ }
- @Override
- public EnumRarity getRarity(ItemStack i) {
- return EnumRarity.uncommon;
- }
+ @Override
+ public EnumRarity getRarity(ItemStack i) {
+ return EnumRarity.uncommon;
+ }
- @Override
- public boolean isRepairable() {
- return false;
- }
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/BedLocator_Base.java b/src/main/java/gtPlusPlus/core/item/general/BedLocator_Base.java
index 5aa2e4ae9e..a57f1ff63f 100644
--- a/src/main/java/gtPlusPlus/core/item/general/BedLocator_Base.java
+++ b/src/main/java/gtPlusPlus/core/item/general/BedLocator_Base.java
@@ -1,7 +1,8 @@
package gtPlusPlus.core.item.general;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
import java.util.List;
-
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -10,98 +11,91 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-
-public class BedLocator_Base extends Item{
-
- public int bed_X = 0;
- public int bed_Y = 0;
- public int bed_Z = 0;
-
- public BedLocator_Base(final String unlocalizedName) {
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
-
-
- int NBT_X = this.bed_X;
- int NBT_Y = this.bed_Y;
- int NBT_Z = this.bed_Z;
-
-
- if (stack.stackTagCompound != null) {
- NBT_X = stack.stackTagCompound.getInteger("pos_x");
- NBT_Y = stack.stackTagCompound.getInteger("pos_y");
- NBT_Z = stack.stackTagCompound.getInteger("pos_z");
-
- final String tempX = String.valueOf(NBT_X);
- final String tempY = String.valueOf(NBT_Y);
- final String tempZ = String.valueOf(NBT_Z);
- final String formattedX = EnumChatFormatting.DARK_RED+tempX+EnumChatFormatting.GRAY;
- final String formattedY = EnumChatFormatting.RED+tempY+EnumChatFormatting.GRAY;
- final String formattedZ = EnumChatFormatting.RED+tempZ+EnumChatFormatting.GRAY;
-
- list.add(EnumChatFormatting.GRAY+"X: "+formattedX+".");
- list.add(EnumChatFormatting.GRAY+"Y: "+formattedY+".");
- list.add(EnumChatFormatting.GRAY+"Z: "+formattedZ+".");
- super.addInformation(stack, aPlayer, list, bool);
- }
- }
-
- //Ticking and NBT Handling
- /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
- * update it's contents.
- *
- * public int fuelRemaining = 0;
- public int maximumFuel = 0;
- public String fuelType = "";
- public float heat = 0;
- public float maxHeat = 5000;
- *
- */
- @Override
- public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
- itemStack.stackTagCompound = new NBTTagCompound();
- this.bed_X = 0;
- this.bed_Y = 0;
- this.bed_Z = 0;
- itemStack.stackTagCompound.setInteger("pos_x", this.bed_X);
- itemStack.stackTagCompound.setInteger("pos_y", this.bed_Y);
- itemStack.stackTagCompound.setInteger("pos_z", this.bed_Z);
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4, final boolean par5) {
-
-
- }
-
- @Override
- public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) {
- itemStack.stackTagCompound = new NBTTagCompound();
- if (par3Entity.getBedLocation() != null){
- this.bed_X = par3Entity.getBedLocation().posX;
- this.bed_Y = par3Entity.getBedLocation().posY;
- this.bed_Z = par3Entity.getBedLocation().posZ;
- }
- else {
- this.bed_X = 0;
- this.bed_Y = 0;
- this.bed_Z = 0;
- }
- itemStack.stackTagCompound.setInteger("pos_x", this.bed_X);
- itemStack.stackTagCompound.setInteger("pos_y", this.bed_Y);
- itemStack.stackTagCompound.setInteger("pos_z", this.bed_Z);
- return super.onItemRightClick(itemStack, world, par3Entity);
- }
-
-
-
+public class BedLocator_Base extends Item {
+
+ public int bed_X = 0;
+ public int bed_Y = 0;
+ public int bed_Z = 0;
+
+ public BedLocator_Base(final String unlocalizedName) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+
+ int NBT_X = this.bed_X;
+ int NBT_Y = this.bed_Y;
+ int NBT_Z = this.bed_Z;
+
+ if (stack.stackTagCompound != null) {
+ NBT_X = stack.stackTagCompound.getInteger("pos_x");
+ NBT_Y = stack.stackTagCompound.getInteger("pos_y");
+ NBT_Z = stack.stackTagCompound.getInteger("pos_z");
+
+ final String tempX = String.valueOf(NBT_X);
+ final String tempY = String.valueOf(NBT_Y);
+ final String tempZ = String.valueOf(NBT_Z);
+ final String formattedX = EnumChatFormatting.DARK_RED + tempX + EnumChatFormatting.GRAY;
+ final String formattedY = EnumChatFormatting.RED + tempY + EnumChatFormatting.GRAY;
+ final String formattedZ = EnumChatFormatting.RED + tempZ + EnumChatFormatting.GRAY;
+
+ list.add(EnumChatFormatting.GRAY + "X: " + formattedX + ".");
+ list.add(EnumChatFormatting.GRAY + "Y: " + formattedY + ".");
+ list.add(EnumChatFormatting.GRAY + "Z: " + formattedZ + ".");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+ }
+
+ // Ticking and NBT Handling
+ /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
+ * update it's contents.
+ *
+ * public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = 5000;
+ *
+ */
+ @Override
+ public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ this.bed_X = 0;
+ this.bed_Y = 0;
+ this.bed_Z = 0;
+ itemStack.stackTagCompound.setInteger("pos_x", this.bed_X);
+ itemStack.stackTagCompound.setInteger("pos_y", this.bed_Y);
+ itemStack.stackTagCompound.setInteger("pos_z", this.bed_Z);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World par2World,
+ final Entity par3Entity,
+ final int par4,
+ final boolean par5) {}
+
+ @Override
+ public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ if (par3Entity.getBedLocation() != null) {
+ this.bed_X = par3Entity.getBedLocation().posX;
+ this.bed_Y = par3Entity.getBedLocation().posY;
+ this.bed_Z = par3Entity.getBedLocation().posZ;
+ } else {
+ this.bed_X = 0;
+ this.bed_Y = 0;
+ this.bed_Z = 0;
+ }
+ itemStack.stackTagCompound.setInteger("pos_x", this.bed_X);
+ itemStack.stackTagCompound.setInteger("pos_y", this.bed_Y);
+ itemStack.stackTagCompound.setInteger("pos_z", this.bed_Z);
+ return super.onItemRightClick(itemStack, world, par3Entity);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/BufferCore.java b/src/main/java/gtPlusPlus/core/item/general/BufferCore.java
index 9b00d3d034..a85c23be81 100644
--- a/src/main/java/gtPlusPlus/core/item/general/BufferCore.java
+++ b/src/main/java/gtPlusPlus/core/item/general/BufferCore.java
@@ -1,72 +1,70 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.GT_Values;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-
import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
+import java.util.List;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
-public class BufferCore extends BaseItemWithDamageValue{
+public class BufferCore extends BaseItemWithDamageValue {
- public int coreTier = 0;
+ public int coreTier = 0;
- public BufferCore(final String unlocalizedName, final int i) {
- super(unlocalizedName+i);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(32);
- this.coreTier = i;
- }
+ public BufferCore(final String unlocalizedName, final int i) {
+ super(unlocalizedName + i);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(32);
+ this.coreTier = i;
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack stack) {
- return super.getItemStackDisplayName(stack)/*+" ["+GT_Values.VN[this.coreTier-1]+"]."*/;
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack stack) {
+ return super.getItemStackDisplayName(stack) /*+" ["+GT_Values.VN[this.coreTier-1]+"]."*/;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses()
- {
- return true;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GRAY+"A key crafting component for "+GT_Values.VN[this.coreTier-1]+" Applicances");
- }
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GRAY + "A key crafting component for " + GT_Values.VN[this.coreTier - 1]
+ + " Applicances");
+ }
- public final int getCoreTier() {
- return this.coreTier;
- }
+ public final int getCoreTier() {
+ return this.coreTier;
+ }
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- int[] mTierTypes = new int[] {
- Utils.rgbtoHexValue(200, 180, 180),
- Utils.rgbtoHexValue(142, 153, 161),
- Utils.rgbtoHexValue(230, 121, 75),
- Utils.rgbtoHexValue(215, 156, 70),
- Utils.rgbtoHexValue(97, 97, 96), //EV
- Utils.rgbtoHexValue(202, 202, 201),
- Utils.rgbtoHexValue(247, 159, 157),
- Utils.rgbtoHexValue(181, 223, 223),
- Utils.rgbtoHexValue(187, 219, 185),
- };
-
- if (this.coreTier == 10){
- return Utils.rgbtoHexValue(MathUtils.randInt(220, 250), MathUtils.randInt(221, 251), MathUtils.randInt(220, 250));
- }
+ int[] mTierTypes = new int[] {
+ Utils.rgbtoHexValue(200, 180, 180),
+ Utils.rgbtoHexValue(142, 153, 161),
+ Utils.rgbtoHexValue(230, 121, 75),
+ Utils.rgbtoHexValue(215, 156, 70),
+ Utils.rgbtoHexValue(97, 97, 96), // EV
+ Utils.rgbtoHexValue(202, 202, 201),
+ Utils.rgbtoHexValue(247, 159, 157),
+ Utils.rgbtoHexValue(181, 223, 223),
+ Utils.rgbtoHexValue(187, 219, 185),
+ };
- return mTierTypes[this.coreTier-1];
- }
+ if (this.coreTier == 10) {
+ return Utils.rgbtoHexValue(
+ MathUtils.randInt(220, 250), MathUtils.randInt(221, 251), MathUtils.randInt(220, 250));
+ }
+ return mTierTypes[this.coreTier - 1];
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemAirFilter.java b/src/main/java/gtPlusPlus/core/item/general/ItemAirFilter.java
index a354e63fe3..98cb1bba74 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemAirFilter.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemAirFilter.java
@@ -1,8 +1,10 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,130 +14,123 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
public class ItemAirFilter extends Item {
- public IIcon[] icons = new IIcon[1];
-
- public ItemAirFilter() {
- super();
- this.setHasSubtypes(true);
- String unlocalizedName = "itemAirFilter";
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setMaxStackSize(1);
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "itemAirFilter");
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[0];
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 2; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return this.getUnlocalizedName() + "_" + stack.getItemDamage();
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
-
- if (tItem == null) {
- return "Air Filter";
- }
-
- String itemName = tItem == null ? "Air Filter" : super.getItemStackDisplayName(tItem);
- String suffixName = "";
- if (tItem.getItemDamage() == 0){
- suffixName = " [Tier 1]";
- }
- else if (tItem.getItemDamage() == 1){
- suffixName = " [Tier 2]";
- }
- return (itemName+suffixName);
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- int meta = stack.getItemDamage();
- if (meta == 1){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(150,180,35);
- }
- return HEX_OxFFFFFF;
- }
-
- private static boolean createNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Damage", 0);
- tagMain.setTag("AirFilter", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static final long getFilterDamage(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("AirFilter");
- if (aNBT != null) {
- return aNBT.getLong("Damage");
- }
- }
- else {
- createNBT(aStack);
- }
- return 0L;
- }
-
- public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("AirFilter");
- if (aNBT != null) {
- aNBT.setLong("Damage", aDamage);
- return true;
- }
- }
- return false;
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- if (stack.getTagCompound() == null){
- createNBT(stack);
+ public IIcon[] icons = new IIcon[1];
+
+ public ItemAirFilter() {
+ super();
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemAirFilter";
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setMaxStackSize(1);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "itemAirFilter");
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[0];
+ }
+
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 2; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+
+ if (tItem == null) {
+ return "Air Filter";
+ }
+
+ String itemName = tItem == null ? "Air Filter" : super.getItemStackDisplayName(tItem);
+ String suffixName = "";
+ if (tItem.getItemDamage() == 0) {
+ suffixName = " [Tier 1]";
+ } else if (tItem.getItemDamage() == 1) {
+ suffixName = " [Tier 2]";
+ }
+ return (itemName + suffixName);
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ int meta = stack.getItemDamage();
+ if (meta == 1) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(150, 180, 35);
+ }
+ return HEX_OxFFFFFF;
+ }
+
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Damage", 0);
+ tagMain.setTag("AirFilter", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static final long getFilterDamage(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("AirFilter");
+ if (aNBT != null) {
+ return aNBT.getLong("Damage");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return 0L;
+ }
+
+ public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("AirFilter");
+ if (aNBT != null) {
+ aNBT.setLong("Damage", aDamage);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (stack.getTagCompound() == null) {
+ createNBT(stack);
}
- double currentDamage = getFilterDamage(stack);
- double meta = stack.getItemDamage() == 0 ? 50 : 2500;
- double durabilitypercent = currentDamage / meta;
- return durabilitypercent;
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- list.add(EnumChatFormatting.GRAY+"An Air filter for Atmospheric Reconditioning.");
- int maxDamage = (stack.getItemDamage() == 0 ? 50 : 2500);
- list.add(EnumChatFormatting.GRAY+""+(maxDamage-getFilterDamage(stack))+"/"+maxDamage+" uses left.");
- super.addInformation(stack, player, list, bool);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return true;
- }
-
-} \ No newline at end of file
+ double currentDamage = getFilterDamage(stack);
+ double meta = stack.getItemDamage() == 0 ? 50 : 2500;
+ double durabilitypercent = currentDamage / meta;
+ return durabilitypercent;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ list.add(EnumChatFormatting.GRAY + "An Air filter for Atmospheric Reconditioning.");
+ int maxDamage = (stack.getItemDamage() == 0 ? 50 : 2500);
+ list.add(EnumChatFormatting.GRAY + "" + (maxDamage - getFilterDamage(stack)) + "/" + maxDamage + " uses left.");
+ super.addInformation(stack, player, list, bool);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java b/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java
index 16d0c0253b..b4b35c06e8 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java
@@ -1,9 +1,16 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.common.blocks.GT_Block_Ores;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.block.base.BlockBaseOre;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.CoreItem;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -16,188 +23,184 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.block.base.BlockBaseOre;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.CoreItem;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
public class ItemAreaClear extends CoreItem {
- public IIcon[] mIcon = new IIcon[1];
-
- public ItemAreaClear() {
- super("itemDebugClearing", AddToCreativeTab.tabMachines, 1, 100, new String[] {EnumChatFormatting.OBFUSCATED+"F A N C Y N A M E"}, EnumRarity.rare,
- EnumChatFormatting.BOLD, false, null);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- this.mIcon[0] = reg.registerIcon(CORE.MODID + ":" + "itemLavaFilter");
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.mIcon[0];
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 2; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- String itemName = "Debug Square";
- String suffixName = "";
- if (tItem.getItemDamage() == 0){
- suffixName = " [1]";
- }
- else if (tItem.getItemDamage() == 1){
- suffixName = " [2]";
- }
- return (itemName+suffixName);
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- String mMode = (stack.getItemDamage() == 0 ? "Clear" : "Fill");
- list.add(EnumChatFormatting.GRAY+""+("Mode: "+mMode));
- super.addInformation(stack, player, list, bool);
- }
-
- private static boolean createNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Mode", 0);
- tagMain.setTag("GTPP_DEBUG", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static final long getFilterDamage(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GTPP_DEBUG");
- if (aNBT != null) {
- return aNBT.getLong("Mode");
- }
- }
- else {
- createNBT(aStack);
- }
- return 0L;
- }
-
- public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GTPP_DEBUG");
- if (aNBT != null) {
- aNBT.setLong("Mode", aDamage);
- return true;
- }
- }
- return false;
- }
-
- public boolean removeBlocks(World world, BlockPos pos){
- int x1 = pos.xPos;
- int y1 = pos.yPos;
- int z1 = pos.zPos;
-
- int x2 = (x1-24);
- int y2 = (y1-10);
- int z2 = (z1-24);
-
- removeBlockColumn(world, new BlockPos(x2, y2, z2, world));
- return true;
- }
-
- public boolean removeBlockColumn(World world, BlockPos pos){
- for (int i=0; i<50; i++){
- removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos-10, pos.zPos+i, world));
- removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos+i, world));
- removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos+10, pos.zPos+i, world));
- }
- return true;
- }
-
- public boolean removeBlockRow(World world, BlockPos pos){
- for (int j=0; j<20; j++){
- for (int i=0; i<50; i++){
-
- if (!(world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) instanceof BlockBaseOre) &&
- !(world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) instanceof IGregTechTileEntity) &&
- !(world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) instanceof GT_Block_Ores)){
- if (!world.isAirBlock(pos.xPos+i, pos.yPos+j, pos.zPos) &&
- world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) != Blocks.bedrock){
- int chance = MathUtils.randInt(0, 500);
- if (chance <= 0){
- if (pos.yPos+j <= 50){
- world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.glowstone);
- }
- }
- else {
- if ((world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) == Blocks.glowstone && ((pos.yPos+j) > 50)) || world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) != Blocks.glowstone){
- world.setBlockToAir(pos.xPos+i, pos.yPos+j, pos.zPos);
- }
- }
- }
- }
- }
- }
- return true;
- }
-
- public boolean fillBlocks(World world, BlockPos pos){
- int x1 = pos.xPos;
- int y1 = pos.yPos;
- int z1 = pos.zPos;
-
- int x2 = (x1-15);
- int y2 = (y1-1);
- int z2 = (z1-15);
-
- fillBlockColumn(world, new BlockPos(x2, y2, z2, world));
- return true;
- }
-
- public boolean fillBlockColumn(World world, BlockPos pos){
- for (int i=0; i<30; i++){
- fillBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos+i, world));
- }
- return true;
- }
-
- public boolean fillBlockRow(World world, BlockPos pos){
- for (int j=0; j<2; j++){
- for (int i=0; i<30; i++){
- if (world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) != Blocks.bedrock){
- world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.dirt);
- world.setBlockMetadataWithNotify(pos.xPos+i, pos.yPos+j, pos.zPos, 2, 2);
- }
- }
- }
- return true;
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack thisItem, World world, EntityPlayer parEntity) {
- BlockPos groundBlock = EntityUtils.findBlockPosUnderEntity(parEntity);
- if (thisItem.getItemDamage() == 0){
- removeBlocks(world, groundBlock);
- }
- else {
- Logger.INFO("Filling.");
- fillBlocks(world, groundBlock);
- }
- return super.onItemRightClick(thisItem, world, parEntity);
- }
-
+ public IIcon[] mIcon = new IIcon[1];
+
+ public ItemAreaClear() {
+ super(
+ "itemDebugClearing",
+ AddToCreativeTab.tabMachines,
+ 1,
+ 100,
+ new String[] {EnumChatFormatting.OBFUSCATED + "F A N C Y N A M E"},
+ EnumRarity.rare,
+ EnumChatFormatting.BOLD,
+ false,
+ null);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ this.mIcon[0] = reg.registerIcon(CORE.MODID + ":" + "itemLavaFilter");
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.mIcon[0];
+ }
+
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 2; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ String itemName = "Debug Square";
+ String suffixName = "";
+ if (tItem.getItemDamage() == 0) {
+ suffixName = " [1]";
+ } else if (tItem.getItemDamage() == 1) {
+ suffixName = " [2]";
+ }
+ return (itemName + suffixName);
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ String mMode = (stack.getItemDamage() == 0 ? "Clear" : "Fill");
+ list.add(EnumChatFormatting.GRAY + "" + ("Mode: " + mMode));
+ super.addInformation(stack, player, list, bool);
+ }
+
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Mode", 0);
+ tagMain.setTag("GTPP_DEBUG", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static final long getFilterDamage(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GTPP_DEBUG");
+ if (aNBT != null) {
+ return aNBT.getLong("Mode");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return 0L;
+ }
+
+ public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GTPP_DEBUG");
+ if (aNBT != null) {
+ aNBT.setLong("Mode", aDamage);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean removeBlocks(World world, BlockPos pos) {
+ int x1 = pos.xPos;
+ int y1 = pos.yPos;
+ int z1 = pos.zPos;
+
+ int x2 = (x1 - 24);
+ int y2 = (y1 - 10);
+ int z2 = (z1 - 24);
+
+ removeBlockColumn(world, new BlockPos(x2, y2, z2, world));
+ return true;
+ }
+
+ public boolean removeBlockColumn(World world, BlockPos pos) {
+ for (int i = 0; i < 50; i++) {
+ removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos - 10, pos.zPos + i, world));
+ removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos + i, world));
+ removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos + 10, pos.zPos + i, world));
+ }
+ return true;
+ }
+
+ public boolean removeBlockRow(World world, BlockPos pos) {
+ for (int j = 0; j < 20; j++) {
+ for (int i = 0; i < 50; i++) {
+
+ if (!(world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) instanceof BlockBaseOre)
+ && !(world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) instanceof IGregTechTileEntity)
+ && !(world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) instanceof GT_Block_Ores)) {
+ if (!world.isAirBlock(pos.xPos + i, pos.yPos + j, pos.zPos)
+ && world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) != Blocks.bedrock) {
+ int chance = MathUtils.randInt(0, 500);
+ if (chance <= 0) {
+ if (pos.yPos + j <= 50) {
+ world.setBlock(pos.xPos + i, pos.yPos + j, pos.zPos, Blocks.glowstone);
+ }
+ } else {
+ if ((world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) == Blocks.glowstone
+ && ((pos.yPos + j) > 50))
+ || world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) != Blocks.glowstone) {
+ world.setBlockToAir(pos.xPos + i, pos.yPos + j, pos.zPos);
+ }
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ public boolean fillBlocks(World world, BlockPos pos) {
+ int x1 = pos.xPos;
+ int y1 = pos.yPos;
+ int z1 = pos.zPos;
+
+ int x2 = (x1 - 15);
+ int y2 = (y1 - 1);
+ int z2 = (z1 - 15);
+
+ fillBlockColumn(world, new BlockPos(x2, y2, z2, world));
+ return true;
+ }
+
+ public boolean fillBlockColumn(World world, BlockPos pos) {
+ for (int i = 0; i < 30; i++) {
+ fillBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos + i, world));
+ }
+ return true;
+ }
+
+ public boolean fillBlockRow(World world, BlockPos pos) {
+ for (int j = 0; j < 2; j++) {
+ for (int i = 0; i < 30; i++) {
+ if (world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) != Blocks.bedrock) {
+ world.setBlock(pos.xPos + i, pos.yPos + j, pos.zPos, Blocks.dirt);
+ world.setBlockMetadataWithNotify(pos.xPos + i, pos.yPos + j, pos.zPos, 2, 2);
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack thisItem, World world, EntityPlayer parEntity) {
+ BlockPos groundBlock = EntityUtils.findBlockPosUnderEntity(parEntity);
+ if (thisItem.getItemDamage() == 0) {
+ removeBlocks(world, groundBlock);
+ } else {
+ Logger.INFO("Filling.");
+ fillBlocks(world, groundBlock);
+ }
+ return super.onItemRightClick(thisItem, world, parEntity);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java b/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java
index ca6c5e8c8c..e64b85c515 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java
@@ -1,85 +1,102 @@
package gtPlusPlus.core.item.general;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
import gtPlusPlus.core.block.general.FirePit;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
public class ItemBasicFirestarter extends CoreItem {
- public ItemBasicFirestarter() {
- super("itemSimpleFiremaker", AddToCreativeTab.tabTools, 1, 5, "Can probably make you a fire");
- this.setTextureName(CORE.MODID+":"+"itemFireStarter");
- }
+ public ItemBasicFirestarter() {
+ super("itemSimpleFiremaker", AddToCreativeTab.tabTools, 1, 5, "Can probably make you a fire");
+ this.setTextureName(CORE.MODID + ":" + "itemFireStarter");
+ }
- @Override
- public boolean onItemUse(
- final ItemStack thisItem, final EntityPlayer thisPlayer, final World thisWorld,
- int blockX, int blockY, int blockZ,
- final int p_77648_7_, final float p_77648_8_, final float p_77648_9_, final float p_77648_10_) {
- if (p_77648_7_ == 0) {
- --blockY;
- }
- if (p_77648_7_ == 1) {
- ++blockY;
- }
- if (p_77648_7_ == 2) {
- --blockZ;
- }
- if (p_77648_7_ == 3) {
- ++blockZ;
- }
- if (p_77648_7_ == 4) {
- --blockX;
- }
- if (p_77648_7_ == 5) {
- ++blockX;
- }
- if (!thisPlayer.canPlayerEdit(blockX, blockY, blockZ, p_77648_7_, thisItem)) {
- return false;
- }
- if (thisWorld.getBlock(blockX, blockY, blockZ) instanceof FirePit){
- thisWorld.setBlockMetadataWithNotify(blockX, blockY, blockZ, 2, 4);
- PlayerUtils.messagePlayer(thisPlayer, "You light the fire pit. ");
- }
- if (thisWorld.isAirBlock(blockX, blockY, blockZ))
- {
- final int random = MathUtils.randInt(0, 3);
- //Explode, lol.
- if (random == 0){
- PlayerUtils.messagePlayer(thisPlayer, "You somehow managed to set yourself on fire... ");
- thisWorld.playSoundEffect(thisPlayer.posX + 0.5D, thisPlayer.posY + 0.5D, thisPlayer.posZ + 0.5D, "fire.ignite", 1.0F, (itemRand.nextFloat() * 0.4F) + 0.8F);
- thisPlayer.setFire(4);
- thisItem.damageItem(thisItem.getMaxDamage(), thisPlayer);
- }
+ @Override
+ public boolean onItemUse(
+ final ItemStack thisItem,
+ final EntityPlayer thisPlayer,
+ final World thisWorld,
+ int blockX,
+ int blockY,
+ int blockZ,
+ final int p_77648_7_,
+ final float p_77648_8_,
+ final float p_77648_9_,
+ final float p_77648_10_) {
+ if (p_77648_7_ == 0) {
+ --blockY;
+ }
+ if (p_77648_7_ == 1) {
+ ++blockY;
+ }
+ if (p_77648_7_ == 2) {
+ --blockZ;
+ }
+ if (p_77648_7_ == 3) {
+ ++blockZ;
+ }
+ if (p_77648_7_ == 4) {
+ --blockX;
+ }
+ if (p_77648_7_ == 5) {
+ ++blockX;
+ }
+ if (!thisPlayer.canPlayerEdit(blockX, blockY, blockZ, p_77648_7_, thisItem)) {
+ return false;
+ }
+ if (thisWorld.getBlock(blockX, blockY, blockZ) instanceof FirePit) {
+ thisWorld.setBlockMetadataWithNotify(blockX, blockY, blockZ, 2, 4);
+ PlayerUtils.messagePlayer(thisPlayer, "You light the fire pit. ");
+ }
+ if (thisWorld.isAirBlock(blockX, blockY, blockZ)) {
+ final int random = MathUtils.randInt(0, 3);
+ // Explode, lol.
+ if (random == 0) {
+ PlayerUtils.messagePlayer(thisPlayer, "You somehow managed to set yourself on fire... ");
+ thisWorld.playSoundEffect(
+ thisPlayer.posX + 0.5D,
+ thisPlayer.posY + 0.5D,
+ thisPlayer.posZ + 0.5D,
+ "fire.ignite",
+ 1.0F,
+ (itemRand.nextFloat() * 0.4F) + 0.8F);
+ thisPlayer.setFire(4);
+ thisItem.damageItem(thisItem.getMaxDamage(), thisPlayer);
+ }
- //Create a fire
- else if (random == 2){
- PlayerUtils.messagePlayer(thisPlayer, "You created a fire!");
- thisWorld.playSoundEffect(blockX + 0.5D, blockY + 0.5D, blockZ + 0.5D, "fire.ignite", 1.0F, (itemRand.nextFloat() * 0.4F) + 0.8F);
- thisWorld.setBlock(blockX, blockY, blockZ, Blocks.fire);
- }
+ // Create a fire
+ else if (random == 2) {
+ PlayerUtils.messagePlayer(thisPlayer, "You created a fire!");
+ thisWorld.playSoundEffect(
+ blockX + 0.5D,
+ blockY + 0.5D,
+ blockZ + 0.5D,
+ "fire.ignite",
+ 1.0F,
+ (itemRand.nextFloat() * 0.4F) + 0.8F);
+ thisWorld.setBlock(blockX, blockY, blockZ, Blocks.fire);
+ }
- //Do nothing
- else {
- PlayerUtils.messagePlayer(thisPlayer, "Your attemp does nothing.");
- thisItem.damageItem(1, thisPlayer);
- return false;
- }
- }
- thisItem.damageItem(1, thisPlayer);
- return true;
- }
+ // Do nothing
+ else {
+ PlayerUtils.messagePlayer(thisPlayer, "Your attemp does nothing.");
+ thisItem.damageItem(1, thisPlayer);
+ return false;
+ }
+ }
+ thisItem.damageItem(1, thisPlayer);
+ return true;
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack thisItem) {
- return "Basic Firemaker";
- }
-} \ No newline at end of file
+ @Override
+ public String getItemStackDisplayName(final ItemStack thisItem) {
+ return "Basic Firemaker";
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java b/src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java
index 2b7b98640e..b1a06daab6 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemBasicScrubberTurbine.java
@@ -1,8 +1,10 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,142 +14,136 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
public class ItemBasicScrubberTurbine extends Item {
- public IIcon[] icons = new IIcon[1];
-
- public ItemBasicScrubberTurbine() {
- super();
- this.setHasSubtypes(true);
- String unlocalizedName = "itemBasicTurbine";
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setMaxStackSize(1);
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "itemBasicTurbine");
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[0];
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 3; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return this.getUnlocalizedName() + "_" + stack.getItemDamage();
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- if (tItem == null) {
- return "Basic Turbine";
- }
- return super.getItemStackDisplayName(tItem);
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- int meta = stack.getItemDamage();
- if (meta == 0){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(200,200,200);
- }
- if (meta == 1){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(255,128,0);
- }
- if (meta == 2){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(128,128,128);
- }
- return HEX_OxFFFFFF;
- }
-
- private static boolean createNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Damage", 0);
- tagMain.setTag("BasicTurbine", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static final long getFilterDamage(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("BasicTurbine");
- if (aNBT != null) {
- return aNBT.getLong("Damage");
- }
- }
- else {
- createNBT(aStack);
- }
- return 0L;
- }
-
- public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("BasicTurbine");
- if (aNBT != null) {
- aNBT.setLong("Damage", aDamage);
- return true;
- }
- }
- return false;
- }
-
- public int getMaxDurability(ItemStack aStack) {
- if (aStack != null) {
- int aMeta = aStack.getItemDamage();
- if (aMeta == 0) {
- return 2000;
- }
- if (aMeta == 1) {
- return 4000;
- }
- if (aMeta == 2) {
- return 6000;
- }
- }
- return 0;
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- if (stack.getTagCompound() == null){
- createNBT(stack);
+ public IIcon[] icons = new IIcon[1];
+
+ public ItemBasicScrubberTurbine() {
+ super();
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemBasicTurbine";
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setMaxStackSize(1);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "itemBasicTurbine");
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[0];
+ }
+
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 3; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ if (tItem == null) {
+ return "Basic Turbine";
+ }
+ return super.getItemStackDisplayName(tItem);
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ int meta = stack.getItemDamage();
+ if (meta == 0) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 200, 200);
+ }
+ if (meta == 1) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(255, 128, 0);
+ }
+ if (meta == 2) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(128, 128, 128);
+ }
+ return HEX_OxFFFFFF;
+ }
+
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Damage", 0);
+ tagMain.setTag("BasicTurbine", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static final long getFilterDamage(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("BasicTurbine");
+ if (aNBT != null) {
+ return aNBT.getLong("Damage");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return 0L;
+ }
+
+ public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("BasicTurbine");
+ if (aNBT != null) {
+ aNBT.setLong("Damage", aDamage);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int getMaxDurability(ItemStack aStack) {
+ if (aStack != null) {
+ int aMeta = aStack.getItemDamage();
+ if (aMeta == 0) {
+ return 2000;
+ }
+ if (aMeta == 1) {
+ return 4000;
+ }
+ if (aMeta == 2) {
+ return 6000;
+ }
+ }
+ return 0;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (stack.getTagCompound() == null) {
+ createNBT(stack);
}
- double currentDamage = getFilterDamage(stack);
- double meta = getMaxDurability(stack);
- double durabilitypercent = currentDamage / meta;
- return durabilitypercent;
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- list.add(EnumChatFormatting.GRAY+"An early tier Turbine for Atmospheric Reconditioning.");
- int maxDamage = getMaxDurability(stack);
- list.add(EnumChatFormatting.GRAY+""+(maxDamage-getFilterDamage(stack))+"/"+maxDamage+" uses left.");
- super.addInformation(stack, player, list, bool);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return true;
- }
-
-} \ No newline at end of file
+ double currentDamage = getFilterDamage(stack);
+ double meta = getMaxDurability(stack);
+ double durabilitypercent = currentDamage / meta;
+ return durabilitypercent;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ list.add(EnumChatFormatting.GRAY + "An early tier Turbine for Atmospheric Reconditioning.");
+ int maxDamage = getMaxDurability(stack);
+ list.add(EnumChatFormatting.GRAY + "" + (maxDamage - getFilterDamage(stack)) + "/" + maxDamage + " uses left.");
+ super.addInformation(stack, player, list, bool);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java
index 5df17979a9..d3f1c2bed6 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java
@@ -1,9 +1,14 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.interfaces.IItemBlueprint;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -14,282 +19,269 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.interfaces.IItemBlueprint;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-
-public class ItemBlueprint extends Item implements IItemBlueprint{
-
- public ItemBlueprint(final String unlocalizedName) {
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- //this.bpID = MathUtils.randInt(0, 1000);
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack itemStack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- //Create some NBT if it's not there, otherwise this does nothing.
- if (!itemStack.hasTagCompound()){
- this.createNBT(itemStack);
- }
- //Set up some default variables.
- int id = -1;
- String name = "";
- boolean blueprint = false;
- //Get proper display vars from NBT if it's there
- if (itemStack.hasTagCompound()){
- //Utils.LOG_WARNING("Found TagCompound");
- id = (int) this.getNBT(itemStack, "mID");
- name = (String) this.getNBT(itemStack, "mName");
- blueprint = (boolean) this.getNBT(itemStack, "mBlueprint");
- }
- //Write to tooltip list for each viable setting.
- if (itemStack.hasTagCompound()) {
- if (id != -1){
- list.add(EnumChatFormatting.GRAY+"Technical Document No. "+id);
- }
- if(blueprint){
- list.add(EnumChatFormatting.BLUE+"Currently holding a blueprint for "+name);
- }
- else {
- list.add(EnumChatFormatting.RED+"Currently not holding a blueprint for anything.");
- }
- }
- else {
- list.add(EnumChatFormatting.RED+"Currently not holding a blueprint for anything.");
- }
- super.addInformation(itemStack, aPlayer, list, bool);
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return "Blueprint";
- }
+public class ItemBlueprint extends Item implements IItemBlueprint {
- @Override
- public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
- this.createNBT(itemStack);
- }
+ public ItemBlueprint(final String unlocalizedName) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ // this.bpID = MathUtils.randInt(0, 1000);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
- @Override
- public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4, final boolean par5) {
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(
+ final ItemStack itemStack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ // Create some NBT if it's not there, otherwise this does nothing.
+ if (!itemStack.hasTagCompound()) {
+ this.createNBT(itemStack);
+ }
+ // Set up some default variables.
+ int id = -1;
+ String name = "";
+ boolean blueprint = false;
+ // Get proper display vars from NBT if it's there
+ if (itemStack.hasTagCompound()) {
+ // Utils.LOG_WARNING("Found TagCompound");
+ id = (int) this.getNBT(itemStack, "mID");
+ name = (String) this.getNBT(itemStack, "mName");
+ blueprint = (boolean) this.getNBT(itemStack, "mBlueprint");
+ }
+ // Write to tooltip list for each viable setting.
+ if (itemStack.hasTagCompound()) {
+ if (id != -1) {
+ list.add(EnumChatFormatting.GRAY + "Technical Document No. " + id);
+ }
+ if (blueprint) {
+ list.add(EnumChatFormatting.BLUE + "Currently holding a blueprint for " + name);
+ } else {
+ list.add(EnumChatFormatting.RED + "Currently not holding a blueprint for anything.");
+ }
+ } else {
+ list.add(EnumChatFormatting.RED + "Currently not holding a blueprint for anything.");
+ }
+ super.addInformation(itemStack, aPlayer, list, bool);
+ }
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return "Blueprint";
+ }
- @Override
- public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) {
- //Let the player know what blueprint is held
- if (itemStack.hasTagCompound()) {
- PlayerUtils.messagePlayer(par3Entity, "This Blueprint holds NBT data. "+"|"+this.getNBT(itemStack, "mID")+"|"+this.getNBT(itemStack, "mBlueprint")+"|"+this.getNBT(itemStack, "mName")+"|"+ItemUtils.getArrayStackNames(this.readItemsFromNBT(itemStack)));
- }
- else {
- this.createNBT(itemStack);
- PlayerUtils.messagePlayer(par3Entity, "This is a placeholder. "+this.getNBT(itemStack, "mID"));
- }
+ @Override
+ public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
+ this.createNBT(itemStack);
+ }
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World par2World,
+ final Entity par3Entity,
+ final int par4,
+ final boolean par5) {}
- return super.onItemRightClick(itemStack, world, par3Entity);
- }
+ @Override
+ public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) {
+ // Let the player know what blueprint is held
+ if (itemStack.hasTagCompound()) {
+ PlayerUtils.messagePlayer(
+ par3Entity,
+ "This Blueprint holds NBT data. " + "|" + this.getNBT(itemStack, "mID") + "|"
+ + this.getNBT(itemStack, "mBlueprint") + "|" + this.getNBT(itemStack, "mName") + "|"
+ + ItemUtils.getArrayStackNames(this.readItemsFromNBT(itemStack)));
+ } else {
+ this.createNBT(itemStack);
+ PlayerUtils.messagePlayer(par3Entity, "This is a placeholder. " + this.getNBT(itemStack, "mID"));
+ }
- public ItemStack[] readItemsFromNBT(final ItemStack itemStack){
- ItemStack[] blueprint = new ItemStack[9];
- if (itemStack.hasTagCompound()){
- final NBTTagCompound nbt = itemStack.getTagCompound();
- final NBTTagList list = nbt.getTagList("Inventory", 10);
- blueprint = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if((slot >= 0) && (slot < INV_SIZE))
- {
- blueprint[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- return blueprint;
- }
- return null;
- }
+ return super.onItemRightClick(itemStack, world, par3Entity);
+ }
- public ItemStack writeItemsToNBT(final ItemStack itemStack, final ItemStack[] craftingGrid){
- final ItemStack[] blueprint = craftingGrid;
- if (itemStack.hasTagCompound()){
- final NBTTagCompound nbt = itemStack.getTagCompound();
- final NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- final ItemStack stack = blueprint[i];
- if(stack != null)
- {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Inventory", list);
- itemStack.setTagCompound(nbt);
- return itemStack;
- }
- return null;
- }
+ public ItemStack[] readItemsFromNBT(final ItemStack itemStack) {
+ ItemStack[] blueprint = new ItemStack[9];
+ if (itemStack.hasTagCompound()) {
+ final NBTTagCompound nbt = itemStack.getTagCompound();
+ final NBTTagList list = nbt.getTagList("Inventory", 10);
+ blueprint = new ItemStack[INV_SIZE];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < INV_SIZE)) {
+ blueprint[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ return blueprint;
+ }
+ return null;
+ }
- @Override
- public boolean isBlueprint(final ItemStack stack) {
- return true;
- }
+ public ItemStack writeItemsToNBT(final ItemStack itemStack, final ItemStack[] craftingGrid) {
+ final ItemStack[] blueprint = craftingGrid;
+ if (itemStack.hasTagCompound()) {
+ final NBTTagCompound nbt = itemStack.getTagCompound();
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < INV_SIZE; i++) {
+ final ItemStack stack = blueprint[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Inventory", list);
+ itemStack.setTagCompound(nbt);
+ return itemStack;
+ }
+ return null;
+ }
- @Override
- public boolean setBlueprint(final ItemStack stack, final IInventory craftingTable, final ItemStack output) {
- boolean hasBP = false;
- ItemStack[] blueprint = new ItemStack[9];
+ @Override
+ public boolean isBlueprint(final ItemStack stack) {
+ return true;
+ }
- if (stack.hasTagCompound()){
- hasBP = (boolean) this.getNBT(stack, "mBlueprint");
- blueprint = this.readItemsFromNBT(stack);
- }
+ @Override
+ public boolean setBlueprint(final ItemStack stack, final IInventory craftingTable, final ItemStack output) {
+ boolean hasBP = false;
+ ItemStack[] blueprint = new ItemStack[9];
- if (!hasBP){
- try {
- for (int o=0; o<craftingTable.getSizeInventory(); o++){
- blueprint[o] = craftingTable.getStackInSlot(o);
- if (blueprint[0] != null){
- blueprint[0].stackSize = 0;
- }
- }
- this.writeItemsToNBT(stack, blueprint);
- if (stack.hasTagCompound()){
- if(stack.getTagCompound().getCompoundTag("Items") != null){
- stack.stackTagCompound.setBoolean("mBlueprint", true);
- }
- else {
- //Invalid BP saved?
- }
- hasBP = (boolean) this.getNBT(stack, "mBlueprint");
- }
+ if (stack.hasTagCompound()) {
+ hasBP = (boolean) this.getNBT(stack, "mBlueprint");
+ blueprint = this.readItemsFromNBT(stack);
+ }
- if (output != null){
- this.setBlueprintName(stack, output.getDisplayName());
- hasBP = true;
- return true;
- }
- return false;
- } catch (final Throwable t){
- return false;
- }
- }
- return false;
- }
+ if (!hasBP) {
+ try {
+ for (int o = 0; o < craftingTable.getSizeInventory(); o++) {
+ blueprint[o] = craftingTable.getStackInSlot(o);
+ if (blueprint[0] != null) {
+ blueprint[0].stackSize = 0;
+ }
+ }
+ this.writeItemsToNBT(stack, blueprint);
+ if (stack.hasTagCompound()) {
+ if (stack.getTagCompound().getCompoundTag("Items") != null) {
+ stack.stackTagCompound.setBoolean("mBlueprint", true);
+ } else {
+ // Invalid BP saved?
+ }
+ hasBP = (boolean) this.getNBT(stack, "mBlueprint");
+ }
- @Override
- public void setBlueprintName(final ItemStack stack, final String name) {
- stack.stackTagCompound.setString("mName", name);
- }
+ if (output != null) {
+ this.setBlueprintName(stack, output.getDisplayName());
+ hasBP = true;
+ return true;
+ }
+ return false;
+ } catch (final Throwable t) {
+ return false;
+ }
+ }
+ return false;
+ }
- @Override
- public boolean hasBlueprint(final ItemStack stack) {
- if (stack.hasTagCompound()){
- return (boolean) this.getNBT(stack, "mBlueprint");
- }
- return false;
- }
+ @Override
+ public void setBlueprintName(final ItemStack stack, final String name) {
+ stack.stackTagCompound.setString("mName", name);
+ }
- @Override
- public ItemStack[] getBlueprint(final ItemStack stack) {
- ItemStack[] blueprint = new ItemStack[9];
- if (stack.hasTagCompound()){
- blueprint = this.readItemsFromNBT(stack);
- }
- try {
- final ItemStack[] returnStack = new ItemStack[9];
- for (int o=0; o<blueprint.length; o++){
- returnStack[o] = blueprint[o];
- if (returnStack[0] != null){
- returnStack[0].stackSize = 1;
- }
- }
- return returnStack;
- } catch (final Throwable t){
- return null;
- }
- }
+ @Override
+ public boolean hasBlueprint(final ItemStack stack) {
+ if (stack.hasTagCompound()) {
+ return (boolean) this.getNBT(stack, "mBlueprint");
+ }
+ return false;
+ }
- public boolean createNBT(final ItemStack itemStack){
- if (itemStack.hasTagCompound()){
- if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){
- //No Blueprint and no name Set
- Logger.WARNING("No Blueprint and no name Set");
- return false;
- }
- else if (itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){
- //Has Blueprint but invalid name set
- Logger.WARNING("Has Blueprint but invalid name set");
- //itemStack.stackTagCompound = null;
- //createNBT(itemStack);
- return false;
- }
- else if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && itemStack.stackTagCompound.getString("mName").equals("")){
- //Has no Blueprint, but strangely has a name
- Logger.WARNING("Has no Blueprint, but strangely has a name");
- //itemStack.stackTagCompound = null;
- //createNBT(itemStack);
- return false;
- }
- return false;
- }
- else if(!itemStack.hasTagCompound()){
- final int bpID = MathUtils.randInt(0, 1000);
- final boolean hasRecipe = false;
- final String recipeName = "";
- Logger.WARNING("Creating Blueprint, setting up it's NBT data. "+bpID);
- itemStack.stackTagCompound = new NBTTagCompound();
- itemStack.stackTagCompound.setInteger("mID", bpID);
- itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
- itemStack.stackTagCompound.setString("mName", recipeName);
- return true;
- }
- else {
- final int bpID = MathUtils.randInt(0, 1000);
- final boolean hasRecipe = false;
- final String recipeName = "";
- Logger.WARNING("Creating a Blueprint, setting up it's NBT data. "+bpID);
- itemStack.stackTagCompound = new NBTTagCompound();
- itemStack.stackTagCompound.setInteger("mID", bpID);
- itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
- itemStack.stackTagCompound.setString("mName", recipeName);
- return true;
- }
- }
+ @Override
+ public ItemStack[] getBlueprint(final ItemStack stack) {
+ ItemStack[] blueprint = new ItemStack[9];
+ if (stack.hasTagCompound()) {
+ blueprint = this.readItemsFromNBT(stack);
+ }
+ try {
+ final ItemStack[] returnStack = new ItemStack[9];
+ for (int o = 0; o < blueprint.length; o++) {
+ returnStack[o] = blueprint[o];
+ if (returnStack[0] != null) {
+ returnStack[0].stackSize = 1;
+ }
+ }
+ return returnStack;
+ } catch (final Throwable t) {
+ return null;
+ }
+ }
- public Object getNBT(final ItemStack itemStack, final String tagNBT){
- if (!itemStack.hasTagCompound()){
- return null;
- }
- Object o = null;
- if (tagNBT.equals("mID")){
- o = itemStack.stackTagCompound.getInteger(tagNBT);
- }
- else if (tagNBT.equals("mBlueprint")){
- o = itemStack.stackTagCompound.getBoolean(tagNBT);
- }
- else if (tagNBT.equals("mName")){
- o = itemStack.stackTagCompound.getString(tagNBT);
- }
- else if (tagNBT.equals("")){
- //For More Tag Support
- //o = itemStack.stackTagCompound.getInteger(tagNBT);
- }
- if (o != null) {
- return o;
- }
- return null; }
+ public boolean createNBT(final ItemStack itemStack) {
+ if (itemStack.hasTagCompound()) {
+ if (!itemStack.stackTagCompound.getBoolean("mBlueprint")
+ && !itemStack.stackTagCompound.getString("mName").equals("")) {
+ // No Blueprint and no name Set
+ Logger.WARNING("No Blueprint and no name Set");
+ return false;
+ } else if (itemStack.stackTagCompound.getBoolean("mBlueprint")
+ && !itemStack.stackTagCompound.getString("mName").equals("")) {
+ // Has Blueprint but invalid name set
+ Logger.WARNING("Has Blueprint but invalid name set");
+ // itemStack.stackTagCompound = null;
+ // createNBT(itemStack);
+ return false;
+ } else if (!itemStack.stackTagCompound.getBoolean("mBlueprint")
+ && itemStack.stackTagCompound.getString("mName").equals("")) {
+ // Has no Blueprint, but strangely has a name
+ Logger.WARNING("Has no Blueprint, but strangely has a name");
+ // itemStack.stackTagCompound = null;
+ // createNBT(itemStack);
+ return false;
+ }
+ return false;
+ } else if (!itemStack.hasTagCompound()) {
+ final int bpID = MathUtils.randInt(0, 1000);
+ final boolean hasRecipe = false;
+ final String recipeName = "";
+ Logger.WARNING("Creating Blueprint, setting up it's NBT data. " + bpID);
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("mID", bpID);
+ itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
+ itemStack.stackTagCompound.setString("mName", recipeName);
+ return true;
+ } else {
+ final int bpID = MathUtils.randInt(0, 1000);
+ final boolean hasRecipe = false;
+ final String recipeName = "";
+ Logger.WARNING("Creating a Blueprint, setting up it's NBT data. " + bpID);
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("mID", bpID);
+ itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
+ itemStack.stackTagCompound.setString("mName", recipeName);
+ return true;
+ }
+ }
+ public Object getNBT(final ItemStack itemStack, final String tagNBT) {
+ if (!itemStack.hasTagCompound()) {
+ return null;
+ }
+ Object o = null;
+ if (tagNBT.equals("mID")) {
+ o = itemStack.stackTagCompound.getInteger(tagNBT);
+ } else if (tagNBT.equals("mBlueprint")) {
+ o = itemStack.stackTagCompound.getBoolean(tagNBT);
+ } else if (tagNBT.equals("mName")) {
+ o = itemStack.stackTagCompound.getString(tagNBT);
+ } else if (tagNBT.equals("")) {
+ // For More Tag Support
+ // o = itemStack.stackTagCompound.getInteger(tagNBT);
+ }
+ if (o != null) {
+ return o;
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemCloakingDevice.java b/src/main/java/gtPlusPlus/core/item/general/ItemCloakingDevice.java
index b54fc56563..d0df323916 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemCloakingDevice.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemCloakingDevice.java
@@ -1,10 +1,17 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
+import baubles.api.BaubleType;
+import baubles.api.IBauble;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -15,245 +22,246 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import baubles.api.BaubleType;
-import baubles.api.IBauble;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import ic2.api.item.ElectricItem;
-import ic2.api.item.IElectricItem;
-import ic2.api.item.IElectricItemManager;
-
-@Optional.InterfaceList(value = {@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"), @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")})
-public class ItemCloakingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble{
-
- private final String unlocalizedName = "personalCloakingDevice";
- private final ItemStack thisStack;
- private final static int maxValueEU = 10000*20*500;
- protected double chargeEU = 0;
-
- public ItemCloakingDevice(final double charge){
- this.chargeEU = charge;
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setUnlocalizedName(this.unlocalizedName);
- this.setMaxStackSize(1);
- this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice");
- this.thisStack = ItemUtils.getSimpleStack(this);
- this.charge(this.thisStack, charge, 3, true, false);
- if (charge == (10000*20*500)){
- this.setDamage(this.thisStack, 13);
- }
- GameRegistry.registerItem(this, this.unlocalizedName+"-"+charge);
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_, final boolean p_77663_5_) {
- if (worldObj.isRemote) {
- return;
- }
-
- if (player instanceof EntityPlayer){
- for (final ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
- if (is == itemStack) {
- continue;
- }
- if (is != null) {
- if (is.getItem() instanceof IElectricItem) {
- final IElectricItem electricItem = (IElectricItem) is.getItem();
- this.chargeEU = ElectricItem.manager.getCharge(is);
- }
-
- }
- }
- }
-
-
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
- return true;
- }
-
- @Override
- public Item getChargedItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(maxValueEU);
- return x.getItem();
- }
-
- @Override
- public Item getEmptyItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(0);
- return x.getItem();
- }
-
- @Override
- public double getMaxCharge(final ItemStack itemStack) {
- return maxValueEU;
- }
-
- @Override
- public int getTier(final ItemStack itemStack) {
- return 5;
- }
-
- @Override
- public double getTransferLimit(final ItemStack itemStack) {
- return 8196;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return (EnumChatFormatting.BLUE+"Personal Cloaking Device"+EnumChatFormatting.GRAY);
- }
-
- @Override
- public double getDurabilityForDisplay(final ItemStack stack)
- {
- //return 1.0D - getEnergyStored(stack) / this.capacity;
- return 1.0D - (this.getCharge(stack) / this.getMaxCharge(stack));
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack)
- {
- return true;
- }
-
- public int secondsLeft(final ItemStack stack){
- double r = 0;
- r = this.getCharge(stack)/(10000*20);
- return (int) MathUtils.decimalRounding(r);
- }
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("");
- list.add(EnumChatFormatting.GREEN+"Worn as a Belt within Baubles."+EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN+"Drains 10,000EU/t to provide invisibility."+EnumChatFormatting.GRAY);
- list.add("");
- list.add(EnumChatFormatting.GOLD+"IC2/EU Information"+EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+this.getTier(this.thisStack)+EnumChatFormatting.GRAY+"] Input Limit: ["+EnumChatFormatting.YELLOW+this.getTransferLimit(this.thisStack)+EnumChatFormatting.GRAY +"EU/t]");
- list.add(EnumChatFormatting.GRAY+"Current Power: ["+EnumChatFormatting.YELLOW+(long) this.getCharge(stack)+EnumChatFormatting.GRAY+"EU] ["+EnumChatFormatting.YELLOW+MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack))+EnumChatFormatting.GRAY +"%]");
- list.add(EnumChatFormatting.GRAY+"Time Remaining: ["+EnumChatFormatting.YELLOW+this.secondsLeft(stack)+ EnumChatFormatting.GRAY +" seconds]");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- /*@Override
- public ItemStack getContainerItem(ItemStack itemStack)
- {
- ItemStack newItem = itemStack.copy();
- newItem.stackSize = 1;
- extractEnergy(newItem, 150000, false);
- return newItem;
- }*/
-
- /*@Override
- public boolean hasContainerItem(ItemStack stack)
- {
- return true;
- }*/
-
- /*@Override
- public int getBurnTime(ItemStack fuel) {
- if ((fuel == null) || (fuel.getItem() != this)) {
- return 0;
- }
- return extractEnergy(fuel, 150000, true) / 50 / 100;
- }*/
-
- @Override
- public double charge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean simulate) {
-
- if (!simulate)
- {
- ElectricItem.manager.charge(stack, amount, tier, true, simulate);
-
- }
- return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
- }
-
- @Override
- public double discharge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) {
- if (!simulate)
- {
- ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }
-
- return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }
-
- @Override
- public double getCharge(final ItemStack stack) {
- return ElectricItem.manager.getCharge(stack);
- }
-
- @Override
- public boolean canUse(final ItemStack stack, final double amount) {
- return ElectricItem.manager.canUse(stack, amount);
- }
-
- @Override
- public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
- return ElectricItem.manager.use(stack, amount, entity);
- }
-
- @Override
- public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
- ElectricItem.manager.chargeFromArmor(stack, entity);
- }
-
- @Override
- public String getToolTip(final ItemStack stack) {
- return ElectricItem.manager.getToolTip(stack);
- }
-
- @Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public BaubleType getBaubleType(final ItemStack arg0) {
- return BaubleType.BELT;
- }
-
- @Override //TODO
- public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
- }
-
- @Override //TODO
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
- }
-
- @Override //TODO
- public void onWornTick(final ItemStack arg0, final EntityLivingBase arg1) {
- //Utils.LOG_INFO("Trying to Tick Belt. 1");
- if (!arg1.worldObj.isRemote){
- if (this.getCharge(arg0) >= 10000){
- arg1.addPotionEffect(new PotionEffect(Potion.invisibility.id, 10, 2));
- this.discharge(arg0, 10000, 5, true, true, false);
- }
- else {
- if (arg1.isPotionActive((Potion.invisibility))){
- arg1.removePotionEffect(Potion.invisibility.id);
- }
- }
- }
- }
-
+@Optional.InterfaceList(
+ value = {
+ @Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"),
+ @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")
+ })
+public class ItemCloakingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble {
+
+ private final String unlocalizedName = "personalCloakingDevice";
+ private final ItemStack thisStack;
+ private static final int maxValueEU = 10000 * 20 * 500;
+ protected double chargeEU = 0;
+
+ public ItemCloakingDevice(final double charge) {
+ this.chargeEU = charge;
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setUnlocalizedName(this.unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice");
+ this.thisStack = ItemUtils.getSimpleStack(this);
+ this.charge(this.thisStack, charge, 3, true, false);
+ if (charge == (10000 * 20 * 500)) {
+ this.setDamage(this.thisStack, 13);
+ }
+ GameRegistry.registerItem(this, this.unlocalizedName + "-" + charge);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World worldObj,
+ final Entity player,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (worldObj.isRemote) {
+ return;
+ }
+
+ if (player instanceof EntityPlayer) {
+ for (final ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
+ if (is == itemStack) {
+ continue;
+ }
+ if (is != null) {
+ if (is.getItem() instanceof IElectricItem) {
+ final IElectricItem electricItem = (IElectricItem) is.getItem();
+ this.chargeEU = ElectricItem.manager.getCharge(is);
+ }
+ }
+ }
+ }
+
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean canProvideEnergy(final ItemStack itemStack) {
+ return true;
+ }
+
+ @Override
+ public Item getChargedItem(final ItemStack itemStack) {
+ final ItemStack x = itemStack.copy();
+ x.setItemDamage(maxValueEU);
+ return x.getItem();
+ }
+
+ @Override
+ public Item getEmptyItem(final ItemStack itemStack) {
+ final ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
+ }
+
+ @Override
+ public double getMaxCharge(final ItemStack itemStack) {
+ return maxValueEU;
+ }
+
+ @Override
+ public int getTier(final ItemStack itemStack) {
+ return 5;
+ }
+
+ @Override
+ public double getTransferLimit(final ItemStack itemStack) {
+ return 8196;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+
+ return (EnumChatFormatting.BLUE + "Personal Cloaking Device" + EnumChatFormatting.GRAY);
+ }
+
+ @Override
+ public double getDurabilityForDisplay(final ItemStack stack) {
+ // return 1.0D - getEnergyStored(stack) / this.capacity;
+ return 1.0D - (this.getCharge(stack) / this.getMaxCharge(stack));
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return true;
+ }
+
+ public int secondsLeft(final ItemStack stack) {
+ double r = 0;
+ r = this.getCharge(stack) / (10000 * 20);
+ return (int) MathUtils.decimalRounding(r);
+ }
+
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add("");
+ list.add(EnumChatFormatting.GREEN + "Worn as a Belt within Baubles." + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN + "Drains 10,000EU/t to provide invisibility." + EnumChatFormatting.GRAY);
+ list.add("");
+ list.add(EnumChatFormatting.GOLD + "IC2/EU Information" + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY + "Tier: [" + EnumChatFormatting.YELLOW + this.getTier(this.thisStack)
+ + EnumChatFormatting.GRAY + "] Input Limit: [" + EnumChatFormatting.YELLOW
+ + this.getTransferLimit(this.thisStack) + EnumChatFormatting.GRAY + "EU/t]");
+ list.add(EnumChatFormatting.GRAY + "Current Power: [" + EnumChatFormatting.YELLOW + (long) this.getCharge(stack)
+ + EnumChatFormatting.GRAY + "EU] [" + EnumChatFormatting.YELLOW
+ + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY
+ + "%]");
+ list.add(EnumChatFormatting.GRAY + "Time Remaining: [" + EnumChatFormatting.YELLOW + this.secondsLeft(stack)
+ + EnumChatFormatting.GRAY + " seconds]");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ /*@Override
+ public ItemStack getContainerItem(ItemStack itemStack)
+ {
+ ItemStack newItem = itemStack.copy();
+ newItem.stackSize = 1;
+ extractEnergy(newItem, 150000, false);
+ return newItem;
+ }*/
+
+ /*@Override
+ public boolean hasContainerItem(ItemStack stack)
+ {
+ return true;
+ }*/
+
+ /*@Override
+ public int getBurnTime(ItemStack fuel) {
+ if ((fuel == null) || (fuel.getItem() != this)) {
+ return 0;
+ }
+ return extractEnergy(fuel, 150000, true) / 50 / 100;
+ }*/
+
+ @Override
+ public double charge(
+ final ItemStack stack,
+ final double amount,
+ final int tier,
+ final boolean ignoreTransferLimit,
+ final boolean simulate) {
+
+ if (!simulate) {
+ ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ }
+ return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ }
+
+ @Override
+ public double discharge(
+ final ItemStack stack,
+ final double amount,
+ final int tier,
+ final boolean ignoreTransferLimit,
+ final boolean externally,
+ final boolean simulate) {
+ if (!simulate) {
+ ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ @Override
+ public double getCharge(final ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
+ }
+
+ @Override
+ public boolean canUse(final ItemStack stack, final double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
+ }
+
+ @Override
+ public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
+ }
+
+ @Override
+ public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
+ }
+
+ @Override
+ public String getToolTip(final ItemStack stack) {
+ return ElectricItem.manager.getToolTip(stack);
+ }
+
+ @Override
+ public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public BaubleType getBaubleType(final ItemStack arg0) {
+ return BaubleType.BELT;
+ }
+
+ @Override // TODO
+ public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {}
+
+ @Override // TODO
+ public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {}
+
+ @Override // TODO
+ public void onWornTick(final ItemStack arg0, final EntityLivingBase arg1) {
+ // Utils.LOG_INFO("Trying to Tick Belt. 1");
+ if (!arg1.worldObj.isRemote) {
+ if (this.getCharge(arg0) >= 10000) {
+ arg1.addPotionEffect(new PotionEffect(Potion.invisibility.id, 10, 2));
+ this.discharge(arg0, 10000, 5, true, true, false);
+ } else {
+ if (arg1.isPotionActive((Potion.invisibility))) {
+ arg1.removePotionEffect(Potion.invisibility.id);
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java b/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java
index b74b7972be..e210ba87b6 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java
@@ -1,10 +1,10 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -13,116 +13,106 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
-import gtPlusPlus.core.lib.CORE;
-
public class ItemControlCore extends Item {
- public static IIcon[] icons = new IIcon[10];
+ public static IIcon[] icons = new IIcon[10];
- public ItemControlCore() {
- super();
- this.setHasSubtypes(true);
- String unlocalizedName = "itemControlCore";
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(GregTech_API.TAB_GREGTECH);
- //this.setCreativeTab(AddToCreativeTab.tabMisc);
- GameRegistry.registerItem(this, unlocalizedName);
- }
+ public ItemControlCore() {
+ super();
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemControlCore";
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(GregTech_API.TAB_GREGTECH);
+ // this.setCreativeTab(AddToCreativeTab.tabMisc);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
- @Override
- public void registerIcons(IIconRegister reg) {
- icons[0] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_0");
- icons[1] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_1");
- icons[2] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_2");
- icons[3] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_3");
- icons[4] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_4");
- icons[5] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_5");
- icons[6] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_6");
- icons[7] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_7");
- icons[8] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_8");
- icons[9] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_9");
- }
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ icons[0] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_0");
+ icons[1] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_1");
+ icons[2] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_2");
+ icons[3] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_3");
+ icons[4] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_4");
+ icons[5] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_5");
+ icons[6] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_6");
+ icons[7] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_7");
+ icons[8] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_8");
+ icons[9] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_9");
+ }
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[meta];
- }
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[meta];
+ }
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 10; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 10; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return this.getUnlocalizedName() + "_" + stack.getItemDamage();
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GRAY+"Allows a Multiblock to function upto "+GT_Values.VN[stack.getItemDamage()]+"");
- list.add(EnumChatFormatting.GRAY+"Required Tier is determined by the sum of the eu/t of all Energy Inputs");
- list.add(EnumChatFormatting.GRAY+"Lower tiers may be used to underclock, which is useful in some situations");
- }
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- if (tItem == null) {
- return "Control Core";
- }
- String aReturnValue = super.getItemStackDisplayName(tItem);
- if (tItem != null) {
- try {
- if (aReturnValue != null) {
- if (aReturnValue.toLowerCase().contains(".name")) {
- aReturnValue = "Control Core";
- }
- else {
- return aReturnValue;
- }
- }
- }
- catch (Throwable t) {}
- }
- if (aReturnValue == null || !aReturnValue.toLowerCase().contains("control core") || aReturnValue.length() <= 0) {
- aReturnValue = "Error";
- }
- String suffixName = "";
- if (tItem.getItemDamage() == 0){
- suffixName = " [ULV]";
- }
- else if (tItem.getItemDamage() == 1){
- suffixName = " [LV]";
- }
- else if (tItem.getItemDamage() == 2){
- suffixName = " [MV]";
- }
- else if (tItem.getItemDamage() == 3){
- suffixName = " [HV]";
- }
- else if (tItem.getItemDamage() == 4){
- suffixName = " [EV]";
- }
- else if (tItem.getItemDamage() == 5){
- suffixName = " [IV]";
- }
- else if (tItem.getItemDamage() == 6){
- suffixName = " [LuV]";
- }
- else if (tItem.getItemDamage() == 7){
- suffixName = " [ZPM]";
- }
- else if (tItem.getItemDamage() == 8){
- suffixName = " [UV]";
- }
- else if (tItem.getItemDamage() == 9){
- suffixName = " [MAX]";
- }
- return (aReturnValue+suffixName);
- }
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GRAY + "Allows a Multiblock to function upto " + GT_Values.VN[stack.getItemDamage()]
+ + "");
+ list.add(EnumChatFormatting.GRAY + "Required Tier is determined by the sum of the eu/t of all Energy Inputs");
+ list.add(EnumChatFormatting.GRAY + "Lower tiers may be used to underclock, which is useful in some situations");
+ }
-} \ No newline at end of file
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ if (tItem == null) {
+ return "Control Core";
+ }
+ String aReturnValue = super.getItemStackDisplayName(tItem);
+ if (tItem != null) {
+ try {
+ if (aReturnValue != null) {
+ if (aReturnValue.toLowerCase().contains(".name")) {
+ aReturnValue = "Control Core";
+ } else {
+ return aReturnValue;
+ }
+ }
+ } catch (Throwable t) {
+ }
+ }
+ if (aReturnValue == null
+ || !aReturnValue.toLowerCase().contains("control core")
+ || aReturnValue.length() <= 0) {
+ aReturnValue = "Error";
+ }
+ String suffixName = "";
+ if (tItem.getItemDamage() == 0) {
+ suffixName = " [ULV]";
+ } else if (tItem.getItemDamage() == 1) {
+ suffixName = " [LV]";
+ } else if (tItem.getItemDamage() == 2) {
+ suffixName = " [MV]";
+ } else if (tItem.getItemDamage() == 3) {
+ suffixName = " [HV]";
+ } else if (tItem.getItemDamage() == 4) {
+ suffixName = " [EV]";
+ } else if (tItem.getItemDamage() == 5) {
+ suffixName = " [IV]";
+ } else if (tItem.getItemDamage() == 6) {
+ suffixName = " [LuV]";
+ } else if (tItem.getItemDamage() == 7) {
+ suffixName = " [ZPM]";
+ } else if (tItem.getItemDamage() == 8) {
+ suffixName = " [UV]";
+ } else if (tItem.getItemDamage() == 9) {
+ suffixName = " [MAX]";
+ }
+ return (aReturnValue + suffixName);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemCreativeTab.java b/src/main/java/gtPlusPlus/core/item/general/ItemCreativeTab.java
index c1a2655a03..9c6e6b257c 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemCreativeTab.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemCreativeTab.java
@@ -1,10 +1,9 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@@ -12,48 +11,47 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class ItemCreativeTab extends Item {
-
- public IIcon[] icons = new IIcon[10];
-
- public ItemCreativeTab() {
- super();
- this.setHasSubtypes(true);
- String unlocalizedName = "itemCreativeTabs";
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(GregTech_API.TAB_GREGTECH);
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_0");
- this.icons[1] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_1");
- this.icons[2] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_2");
- this.icons[3] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_3");
- this.icons[4] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_4");
- this.icons[5] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_5");
- this.icons[6] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_6");
- this.icons[7] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_7");
- this.icons[8] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_8");
- this.icons[9] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_9");
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[meta];
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 10; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return this.getUnlocalizedName() + "_" + stack.getItemDamage();
- }
+ public IIcon[] icons = new IIcon[10];
+
+ public ItemCreativeTab() {
+ super();
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemCreativeTabs";
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(GregTech_API.TAB_GREGTECH);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_0");
+ this.icons[1] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_1");
+ this.icons[2] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_2");
+ this.icons[3] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_3");
+ this.icons[4] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_4");
+ this.icons[5] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_5");
+ this.icons[6] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_6");
+ this.icons[7] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_7");
+ this.icons[8] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_8");
+ this.icons[9] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_9");
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[meta];
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 10; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemEmpty.java b/src/main/java/gtPlusPlus/core/item/general/ItemEmpty.java
index c832d28bbd..dc306f8fa2 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemEmpty.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemEmpty.java
@@ -1,21 +1,17 @@
package gtPlusPlus.core.item.general;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.CoreItem;
+import net.minecraft.item.ItemStack;
-public class ItemEmpty extends CoreItem{
-
- public ItemEmpty() {
- super("item.empty", AddToCreativeTab.tabMisc);
- }
+public class ItemEmpty extends CoreItem {
- @Override
- public String getItemStackDisplayName(ItemStack tItem) {
- return "Empty";
- }
+ public ItemEmpty() {
+ super("item.empty", AddToCreativeTab.tabMisc);
+ }
-
-
+ @Override
+ public String getItemStackDisplayName(ItemStack tItem) {
+ return "Empty";
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java b/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java
index 5181a32bc7..25c67aeb21 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java
@@ -1,78 +1,91 @@
package gtPlusPlus.core.item.general;
+import gtPlusPlus.core.item.base.BaseItemColourable;
+import gtPlusPlus.core.util.Utils;
import java.util.List;
-
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import gtPlusPlus.core.item.base.BaseItemColourable;
-import gtPlusPlus.core.util.Utils;
+public class ItemGemShards extends BaseItemColourable {
+
+ public ItemGemShards(
+ String unlocalizedName,
+ CreativeTabs creativeTab,
+ int stackSize,
+ int maxDmg,
+ String description,
+ EnumRarity regRarity,
+ EnumChatFormatting colour,
+ boolean Effect,
+ int rgb) {
+ super(unlocalizedName, creativeTab, stackSize, maxDmg, description, regRarity, colour, Effect, rgb);
+ }
-public class ItemGemShards extends BaseItemColourable{
+ public ItemGemShards(
+ String unlocalizedName,
+ String displayName,
+ CreativeTabs creativeTab,
+ int stackSize,
+ int maxDmg,
+ String description,
+ EnumRarity regRarity,
+ EnumChatFormatting colour,
+ boolean Effect,
+ int rgb) {
+ super(
+ unlocalizedName,
+ displayName,
+ creativeTab,
+ stackSize,
+ maxDmg,
+ description,
+ regRarity,
+ colour,
+ Effect,
+ rgb);
+ }
- public ItemGemShards(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg,
- String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect, int rgb) {
- super(unlocalizedName, creativeTab, stackSize, maxDmg, description, regRarity, colour, Effect, rgb);
- }
-
- public ItemGemShards(String unlocalizedName, String displayName, CreativeTabs creativeTab, int stackSize,
- int maxDmg, String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect, int rgb) {
- super(unlocalizedName, displayName, creativeTab, stackSize, maxDmg, description, regRarity, colour, Effect, rgb);
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 4; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- //0 - Diamond
- //1 - Emerald
- //2 - Ruby
- //3 - Sapphire
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- String suffix = " Shards";
- String gemType = "";
- if (tItem.getItemDamage() == 0){
- gemType = "Diamond";
- }
- else if (tItem.getItemDamage() == 1){
- gemType = "Emerald";
- }
- else if (tItem.getItemDamage() == 2){
- gemType = "Ruby";
- }
- else if (tItem.getItemDamage() == 3){
- gemType = "Sapphire";
- }
- return (gemType+suffix);
-
- }
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 4; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
- if (this.getDamage(stack)==0){
- return Utils.rgbtoHexValue(150, 150, 220);
- }
- else if (this.getDamage(stack)==1){
- return Utils.rgbtoHexValue(75, 182, 75);
- }
- else if (this.getDamage(stack)==2){
- return Utils.rgbtoHexValue(182, 77, 77);
- }
- else {
- return Utils.rgbtoHexValue(77, 75, 182);
- }
- }
-
-
+ // 0 - Diamond
+ // 1 - Emerald
+ // 2 - Ruby
+ // 3 - Sapphire
-
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ String suffix = " Shards";
+ String gemType = "";
+ if (tItem.getItemDamage() == 0) {
+ gemType = "Diamond";
+ } else if (tItem.getItemDamage() == 1) {
+ gemType = "Emerald";
+ } else if (tItem.getItemDamage() == 2) {
+ gemType = "Ruby";
+ } else if (tItem.getItemDamage() == 3) {
+ gemType = "Sapphire";
+ }
+ return (gemType + suffix);
+ }
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (this.getDamage(stack) == 0) {
+ return Utils.rgbtoHexValue(150, 150, 220);
+ } else if (this.getDamage(stack) == 1) {
+ return Utils.rgbtoHexValue(75, 182, 75);
+ } else if (this.getDamage(stack) == 2) {
+ return Utils.rgbtoHexValue(182, 77, 77);
+ } else {
+ return Utils.rgbtoHexValue(77, 75, 182);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java b/src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java
index 21d2c6e120..8ab8efcd12 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemGenericToken.java
@@ -1,13 +1,12 @@
package gtPlusPlus.core.item.general;
-import java.util.HashMap;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.lib.CORE;
+import java.util.HashMap;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -19,164 +18,180 @@ import net.minecraft.util.IIcon;
public class ItemGenericToken extends CoreItem {
- public final HashMap<Integer, String> mLocalNames;
- public final HashMap<Integer, Integer> mMaxStackSizes;
- public final HashMap<Integer, String[]> mDescriptionArrays;
- public final HashMap<Integer, EnumRarity> mRarities;
- public final HashMap<Integer, EnumChatFormatting> mCustomNameColours;
- public final HashMap<Integer, IIcon> mIcons;
- private final String mTextureDir;
-
- public ItemGenericToken() {
- this("itemGenericToken", "Token", new String[] { "Can be reclaimed in some way, shape or form" }, "token");
- }
-
- public ItemGenericToken(String aUnlocalName, String aInternalName, String[] aBaseTooltip, String aTextureDir) {
- super(aUnlocalName, aInternalName, AddToCreativeTab.tabMisc, 64, 1000, aBaseTooltip, EnumRarity.common, EnumChatFormatting.RESET, false, null);
- mLocalNames = new HashMap<Integer, String>();
- mMaxStackSizes = new HashMap<Integer, Integer>();
- mDescriptionArrays = new HashMap<Integer, String[]>();
- mRarities = new HashMap<Integer, EnumRarity>();
- mCustomNameColours = new HashMap<Integer, EnumChatFormatting>();
- mIcons = new HashMap<Integer, IIcon>();
- mTextureDir = aTextureDir;
- }
-
- public boolean register(int id, String aLocalName, int aMaxStack, String aDescript) {
- return register(id, aLocalName, aMaxStack, new String[] { aDescript });
- }
-
- public boolean register(int id, String aLocalName, int aMaxStack, String[] aDescript) {
- return register(id, aLocalName, aMaxStack, aDescript, EnumRarity.common, EnumChatFormatting.RESET);
- }
-
- public boolean register(int id, String aLocalName, int aMaxStack, String[] aDescript, EnumRarity aRarity,
- EnumChatFormatting aCustomNameColour) {
- int[][] sizes = new int[2][6];
- sizes[0][0] = mLocalNames.size();
- sizes[0][1] = mMaxStackSizes.size();
- sizes[0][2] = mDescriptionArrays.size();
- sizes[0][3] = mRarities.size();
- sizes[0][4] = mCustomNameColours.size();
- //sizes[0][5] = mIcons.size();
- mLocalNames.put(id, aLocalName);
- mMaxStackSizes.put(id, aMaxStack);
- mDescriptionArrays.put(id, aDescript);
- mRarities.put(id, aRarity);
- mCustomNameColours.put(id, aCustomNameColour);
- sizes[1][0] = mLocalNames.size();
- sizes[1][1] = mMaxStackSizes.size();
- sizes[1][2] = mDescriptionArrays.size();
- sizes[1][3] = mRarities.size();
- sizes[1][4] = mCustomNameColours.size();
- //sizes[1][5] = mIcons.size();
- boolean b = sizes[0][0] > sizes[1][0] && sizes[0][1] > sizes[1][1] && sizes[0][2] > sizes[1][2]
- && sizes[0][3] > sizes[1][3] && sizes[0][4] > sizes[1][4];
- return b;
- }
-
- // Handle Sub items
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
- for (int i = 0, j = mIcons.size(); i < j; i++) {
- final ItemStack tStack = new ItemStack(this, 1, i);
- aList.add(tStack);
- }
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
- super.addInformation(stack, aPlayer, list, bool);
- for (String s : mDescriptionArrays.get(stack.getItemDamage())) {
- list.add(s);
- }
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
-
- String s = "" + mCustomNameColours.get(tItem.getItemDamage());
- String parent = super.getItemStackDisplayName(tItem);
- if (mLocalNames.get(tItem.getItemDamage()).length() > 0 && parent.toLowerCase().contains(".name")) {
- s = s + mLocalNames.get(tItem.getItemDamage());
- } else {
- s = s + parent;
- }
- return s;
- }
-
- @Override
- public EnumRarity getRarity(ItemStack par1ItemStack) {
- return mRarities.get(par1ItemStack.getItemDamage());
- }
-
- @Override
- public boolean hasEffect(ItemStack par1ItemStack) {
- return false;
- }
-
- @Override
- public int getMetadata(int p_77647_1_) {
- return 0;
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return 0;
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- return 0D;
- }
-
- @Override
- public boolean isDamaged(ItemStack stack) {
- return false;
- }
-
- @Override
- public int getItemStackLimit() {
- return 64;
- }
-
- @Override
- public int getItemStackLimit(ItemStack aStack) {
- if (aStack == null) {
- return getItemStackLimit();
- }
- else {
- Integer aSize = mMaxStackSizes.get(aStack.getItemDamage());
- if (aSize != null) {
- return aSize;
- }
- else {
- return getItemStackLimit();
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister aIconRegister) {
- for (int i = 0, j = mLocalNames.size(); i < j; i++) {
- mIcons.put(i, aIconRegister.registerIcon(CORE.MODID + ":" + mTextureDir + "/" + i));
- }
- }
-
- @Override
- public final IIcon getIconFromDamage(final int aMetaData) {
- if (aMetaData < 0) {
- return null;
- }
- return mIcons.get(aMetaData);
- }
-
+ public final HashMap<Integer, String> mLocalNames;
+ public final HashMap<Integer, Integer> mMaxStackSizes;
+ public final HashMap<Integer, String[]> mDescriptionArrays;
+ public final HashMap<Integer, EnumRarity> mRarities;
+ public final HashMap<Integer, EnumChatFormatting> mCustomNameColours;
+ public final HashMap<Integer, IIcon> mIcons;
+ private final String mTextureDir;
+
+ public ItemGenericToken() {
+ this("itemGenericToken", "Token", new String[] {"Can be reclaimed in some way, shape or form"}, "token");
+ }
+
+ public ItemGenericToken(String aUnlocalName, String aInternalName, String[] aBaseTooltip, String aTextureDir) {
+ super(
+ aUnlocalName,
+ aInternalName,
+ AddToCreativeTab.tabMisc,
+ 64,
+ 1000,
+ aBaseTooltip,
+ EnumRarity.common,
+ EnumChatFormatting.RESET,
+ false,
+ null);
+ mLocalNames = new HashMap<Integer, String>();
+ mMaxStackSizes = new HashMap<Integer, Integer>();
+ mDescriptionArrays = new HashMap<Integer, String[]>();
+ mRarities = new HashMap<Integer, EnumRarity>();
+ mCustomNameColours = new HashMap<Integer, EnumChatFormatting>();
+ mIcons = new HashMap<Integer, IIcon>();
+ mTextureDir = aTextureDir;
+ }
+
+ public boolean register(int id, String aLocalName, int aMaxStack, String aDescript) {
+ return register(id, aLocalName, aMaxStack, new String[] {aDescript});
+ }
+
+ public boolean register(int id, String aLocalName, int aMaxStack, String[] aDescript) {
+ return register(id, aLocalName, aMaxStack, aDescript, EnumRarity.common, EnumChatFormatting.RESET);
+ }
+
+ public boolean register(
+ int id,
+ String aLocalName,
+ int aMaxStack,
+ String[] aDescript,
+ EnumRarity aRarity,
+ EnumChatFormatting aCustomNameColour) {
+ int[][] sizes = new int[2][6];
+ sizes[0][0] = mLocalNames.size();
+ sizes[0][1] = mMaxStackSizes.size();
+ sizes[0][2] = mDescriptionArrays.size();
+ sizes[0][3] = mRarities.size();
+ sizes[0][4] = mCustomNameColours.size();
+ // sizes[0][5] = mIcons.size();
+ mLocalNames.put(id, aLocalName);
+ mMaxStackSizes.put(id, aMaxStack);
+ mDescriptionArrays.put(id, aDescript);
+ mRarities.put(id, aRarity);
+ mCustomNameColours.put(id, aCustomNameColour);
+ sizes[1][0] = mLocalNames.size();
+ sizes[1][1] = mMaxStackSizes.size();
+ sizes[1][2] = mDescriptionArrays.size();
+ sizes[1][3] = mRarities.size();
+ sizes[1][4] = mCustomNameColours.size();
+ // sizes[1][5] = mIcons.size();
+ boolean b = sizes[0][0] > sizes[1][0]
+ && sizes[0][1] > sizes[1][1]
+ && sizes[0][2] > sizes[1][2]
+ && sizes[0][3] > sizes[1][3]
+ && sizes[0][4] > sizes[1][4];
+ return b;
+ }
+
+ // Handle Sub items
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
+ for (int i = 0, j = mIcons.size(); i < j; i++) {
+ final ItemStack tStack = new ItemStack(this, 1, i);
+ aList.add(tStack);
+ }
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ super.addInformation(stack, aPlayer, list, bool);
+ for (String s : mDescriptionArrays.get(stack.getItemDamage())) {
+ list.add(s);
+ }
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+
+ String s = "" + mCustomNameColours.get(tItem.getItemDamage());
+ String parent = super.getItemStackDisplayName(tItem);
+ if (mLocalNames.get(tItem.getItemDamage()).length() > 0
+ && parent.toLowerCase().contains(".name")) {
+ s = s + mLocalNames.get(tItem.getItemDamage());
+ } else {
+ s = s + parent;
+ }
+ return s;
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack par1ItemStack) {
+ return mRarities.get(par1ItemStack.getItemDamage());
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack) {
+ return false;
+ }
+
+ @Override
+ public int getMetadata(int p_77647_1_) {
+ return 0;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ return 0D;
+ }
+
+ @Override
+ public boolean isDamaged(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack aStack) {
+ if (aStack == null) {
+ return getItemStackLimit();
+ } else {
+ Integer aSize = mMaxStackSizes.get(aStack.getItemDamage());
+ if (aSize != null) {
+ return aSize;
+ } else {
+ return getItemStackLimit();
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(final IIconRegister aIconRegister) {
+ for (int i = 0, j = mLocalNames.size(); i < j; i++) {
+ mIcons.put(i, aIconRegister.registerIcon(CORE.MODID + ":" + mTextureDir + "/" + i));
+ }
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(final int aMetaData) {
+ if (aMetaData < 0) {
+ return null;
+ }
+ return mIcons.get(aMetaData);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java b/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java
index b3338bb681..8f1d1629a6 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java
@@ -2,8 +2,6 @@ package gtPlusPlus.core.item.general;
import static gtPlusPlus.core.lib.CORE.RANDOM;
-import java.util.List;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.entity.item.ItemEntityGiantEgg;
@@ -15,6 +13,7 @@ import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.NBTUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -27,274 +26,284 @@ import net.minecraft.world.World;
public class ItemGiantEgg extends BaseItemTickable {
- private static ItemStack turnsIntoItem;
- private static ItemStack mCorrectEgg;
- private static ItemStack mCorrectStemCells;
-
- public void registerFuel(int burn){
- CORE.burnables.add(new Pair<Integer, ItemStack>(burn, ItemUtils.getSimpleStack(this, 1)));
- }
+ private static ItemStack turnsIntoItem;
+ private static ItemStack mCorrectEgg;
+ private static ItemStack mCorrectStemCells;
- public final void registerOrdictionary(String name){
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), name);
- }
+ public void registerFuel(int burn) {
+ CORE.burnables.add(new Pair<Integer, ItemStack>(burn, ItemUtils.getSimpleStack(this, 1)));
+ }
- public ItemGiantEgg() {
- this(Utils.rgbtoHexValue(255, 255, 255), Short.MAX_VALUE * Byte.MAX_VALUE, new String[] {"I had best try disassemble this.. for science!"});
- }
+ public final void registerOrdictionary(String name) {
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), name);
+ }
- private ItemGiantEgg(int colour, int maxTicks, String[] desc1) {
- super(true, false, "itemBigEgg", colour, maxTicks, desc1);
- setTextureName(CORE.MODID + ":itemBigEgg");
- this.setMaxStackSize(1);
- registerFuel(5000);
- registerOrdictionary("fuelLargeChickenEgg");
- }
-
- public static void postInit(ItemGiantEgg aGiantEggItem) {
- ItemGiantEgg.turnsIntoItem = getSpawnEggStack();
- //new DecayableRecipe(aGiantEggItem.maxTicks, getSimpleStack(aGiantEggItem), ItemUtils.getSimpleStack(ItemGiantEgg.turnsIntoItem, 1));
- }
+ public ItemGiantEgg() {
+ this(Utils.rgbtoHexValue(255, 255, 255), Short.MAX_VALUE * Byte.MAX_VALUE, new String[] {
+ "I had best try disassemble this.. for science!"
+ });
+ }
- private static ItemStack getSpawnEggStack() {
- //Set the correct egg for future hatches
- if (mCorrectEgg == null) {
- /*for (int g=0;g<Byte.MAX_VALUE;g++) {
- ItemStack mSpawn = ItemUtils.simpleMetaStack(Items.spawn_egg, g, 1);
- if (mSpawn != null) {
- //String s = ("" + StatCollector.translateToLocal(mSpawn.getUnlocalizedName() + ".name")).trim();
- String s1 = EntityList.getStringFromID(mSpawn.getItemDamage());
- if (s1 != null){
- //s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name");
- if (s1.equalsIgnoreCase("bigChickenFriendly")) {
- mCorrectEgg = mSpawn;
- return mCorrectEgg;
- }
- }
- }
- }*/
- ItemStack aTempEgg = ItemCustomSpawnEgg.getSpawnEggForEntityname("bigChickenFriendly", 1);
- if (aTempEgg != null) {
- mCorrectEgg = aTempEgg;
- }
- }
- return mCorrectEgg;
- }
+ private ItemGiantEgg(int colour, int maxTicks, String[] desc1) {
+ super(true, false, "itemBigEgg", colour, maxTicks, desc1);
+ setTextureName(CORE.MODID + ":itemBigEgg");
+ this.setMaxStackSize(1);
+ registerFuel(5000);
+ registerOrdictionary("fuelLargeChickenEgg");
+ }
- private static ItemStack getStemCellStack() {
- if (mCorrectStemCells == null) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 28) {
- ItemStack xl = ItemUtils.getValueOfItemList("Circuit_Chip_Stemcell", 1, ItemUtils.getSimpleStack(Items.egg, 2));
- if (xl != null) {
- mCorrectStemCells = xl.copy();
- }
- }
- else {
- mCorrectStemCells = ItemUtils.getSimpleStack(Items.egg, 2);
- }
- }
- return mCorrectStemCells;
- }
+ public static void postInit(ItemGiantEgg aGiantEggItem) {
+ ItemGiantEgg.turnsIntoItem = getSpawnEggStack();
+ // new DecayableRecipe(aGiantEggItem.maxTicks, getSimpleStack(aGiantEggItem),
+ // ItemUtils.getSimpleStack(ItemGiantEgg.turnsIntoItem, 1));
+ }
- protected int getMaxTicks(ItemStack aStack) {
- if (aStack != null && aStack.hasTagCompound() && aStack.getTagCompound().hasKey("mEggAge")) {
- return NBTUtils.getInteger(aStack, "mEggAge");
- }
- return maxTicks;
- }
+ private static ItemStack getSpawnEggStack() {
+ // Set the correct egg for future hatches
+ if (mCorrectEgg == null) {
+ /*for (int g=0;g<Byte.MAX_VALUE;g++) {
+ ItemStack mSpawn = ItemUtils.simpleMetaStack(Items.spawn_egg, g, 1);
+ if (mSpawn != null) {
+ //String s = ("" + StatCollector.translateToLocal(mSpawn.getUnlocalizedName() + ".name")).trim();
+ String s1 = EntityList.getStringFromID(mSpawn.getItemDamage());
+ if (s1 != null){
+ //s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name");
+ if (s1.equalsIgnoreCase("bigChickenFriendly")) {
+ mCorrectEgg = mSpawn;
+ return mCorrectEgg;
+ }
+ }
+ }
+ }*/
+ ItemStack aTempEgg = ItemCustomSpawnEgg.getSpawnEggForEntityname("bigChickenFriendly", 1);
+ if (aTempEgg != null) {
+ mCorrectEgg = aTempEgg;
+ }
+ }
+ return mCorrectEgg;
+ }
- @Override
- public void registerIcons(final IIconRegister i) {
- this.mIcon[0] = i.registerIcon(CORE.MODID + ":" + "itemBigEgg");
- }
+ private static ItemStack getStemCellStack() {
+ if (mCorrectStemCells == null) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 28) {
+ ItemStack xl = ItemUtils.getValueOfItemList(
+ "Circuit_Chip_Stemcell", 1, ItemUtils.getSimpleStack(Items.egg, 2));
+ if (xl != null) {
+ mCorrectStemCells = xl.copy();
+ }
+ } else {
+ mCorrectStemCells = ItemUtils.getSimpleStack(Items.egg, 2);
+ }
+ }
+ return mCorrectStemCells;
+ }
+ protected int getMaxTicks(ItemStack aStack) {
+ if (aStack != null && aStack.hasTagCompound() && aStack.getTagCompound().hasKey("mEggAge")) {
+ return NBTUtils.getInteger(aStack, "mEggAge");
+ }
+ return maxTicks;
+ }
- @Override
- protected boolean createNBT(World world, ItemStack aStack){
-
- if (aStack.getTagCompound() != null && aStack.getTagCompound().hasKey("size")) {
- return false;
- }
- Logger.INFO("Egg: "+ReflectionUtils.getMethodName(1));
- Logger.INFO("Egg: "+ReflectionUtils.getMethodName(2));
- Logger.INFO("Egg: "+ReflectionUtils.getMethodName(3));
- Logger.INFO("Egg: "+ReflectionUtils.getMethodName(4));
- Logger.INFO("Egg: "+ReflectionUtils.getMethodName(5));
- Logger.INFO("Egg: "+ReflectionUtils.getMethodName(6));
- //Logger.INFO("Creating Egg NBT.");
- boolean aSuper = super.createNBT(world, aStack);
- int size = MathUtils.randInt(1, 8);
- NBTUtils.setInteger(aStack, "size", size);
- NBTUtils.setInteger(aStack, "mEggAge", ((MathUtils.randInt(8000, 16000)*size)));
- ItemStack aStemCells = getStemCellStack();
- if (aStemCells != null) {
- int mSize = NBTUtils.getInteger(aStack, "size");
- float mSizeMod = (MathUtils.randInt(-5, 5)/5);
- mSize += mSizeMod;
- mSize = Math.max(mSize, 1);
- ItemStack eggYolks[] = new ItemStack[mSize];
- for (int u=0;u<mSize;u++) {
- eggYolks[u] = ItemUtils.getSimpleStack(aStemCells, MathUtils.randInt(1, 4));
- }
- int mexpected = 0;
- for (ItemStack e : eggYolks) {
- if (e != null) {
- mexpected += e.stackSize;
- }
- }
- if (mexpected > 0) {
- NBTUtils.setInteger(aStack, "mExpected", mexpected);
- NBTUtils.writeItemsToGtCraftingComponents(aStack, new ItemStack[]{ ItemUtils.getSimpleStack(aStemCells, mexpected)}, true);
- }
- }
- return aSuper;
-
- }
+ @Override
+ public void registerIcons(final IIconRegister i) {
+ this.mIcon[0] = i.registerIcon(CORE.MODID + ":" + "itemBigEgg");
+ }
+ @Override
+ protected boolean createNBT(World world, ItemStack aStack) {
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (world == null || iStack == null) {
- return;
- }
- if (world.isRemote) {
- return;
- }
- if (iStack.getTagCompound() == null || !iStack.getTagCompound().hasKey("size")) {
- this.createNBT(world, iStack);
- Logger.INFO("Egg has no NBT, creating (onUpdate)");
- }
- boolean a1, a2;
- a1 = this.isTicking(world, iStack);
- a2 = a1 ? tickItemTag(world, iStack) : false;
+ if (aStack.getTagCompound() != null && aStack.getTagCompound().hasKey("size")) {
+ return false;
+ }
+ Logger.INFO("Egg: " + ReflectionUtils.getMethodName(1));
+ Logger.INFO("Egg: " + ReflectionUtils.getMethodName(2));
+ Logger.INFO("Egg: " + ReflectionUtils.getMethodName(3));
+ Logger.INFO("Egg: " + ReflectionUtils.getMethodName(4));
+ Logger.INFO("Egg: " + ReflectionUtils.getMethodName(5));
+ Logger.INFO("Egg: " + ReflectionUtils.getMethodName(6));
+ // Logger.INFO("Creating Egg NBT.");
+ boolean aSuper = super.createNBT(world, aStack);
+ int size = MathUtils.randInt(1, 8);
+ NBTUtils.setInteger(aStack, "size", size);
+ NBTUtils.setInteger(aStack, "mEggAge", ((MathUtils.randInt(8000, 16000) * size)));
+ ItemStack aStemCells = getStemCellStack();
+ if (aStemCells != null) {
+ int mSize = NBTUtils.getInteger(aStack, "size");
+ float mSizeMod = (MathUtils.randInt(-5, 5) / 5);
+ mSize += mSizeMod;
+ mSize = Math.max(mSize, 1);
+ ItemStack eggYolks[] = new ItemStack[mSize];
+ for (int u = 0; u < mSize; u++) {
+ eggYolks[u] = ItemUtils.getSimpleStack(aStemCells, MathUtils.randInt(1, 4));
+ }
+ int mexpected = 0;
+ for (ItemStack e : eggYolks) {
+ if (e != null) {
+ mexpected += e.stackSize;
+ }
+ }
+ if (mexpected > 0) {
+ NBTUtils.setInteger(aStack, "mExpected", mexpected);
+ NBTUtils.writeItemsToGtCraftingComponents(
+ aStack, new ItemStack[] {ItemUtils.getSimpleStack(aStemCells, mexpected)}, true);
+ }
+ }
+ return aSuper;
+ }
- //Logger.INFO("Is Ticking? "+a1);
- //Logger.INFO("Did Tick? "+a2);
- if (!a1 && !a2) {
- if (entityHolding instanceof EntityPlayer){
- if (MathUtils.randInt(0, 1000) >= 990) {
- if (NBTUtils.hasKey(iStack, "size")) {
- if ((NBTUtils.getInteger(iStack, "size")+1) >= MathUtils.randInt(0, 9)) {
- ItemStack replacement = ItemUtils.getSimpleStack(getHatchResult(), 1);
- if (replacement == null) {
-
- }
- //Logger.INFO("Replacing "+iStack.getDisplayName()+" with "+replacement.getDisplayName()+".");
- final ItemStack tempTransform = replacement.copy();
- if (iStack.stackSize > 1){
- int u = iStack.stackSize;
- tempTransform.stackSize = u;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
- for (int l=0;l<u;l++){
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
- }
- else {
- tempTransform.stackSize=1;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
- }
- }
- }
- }
- }
- }
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (world == null || iStack == null) {
+ return;
+ }
+ if (world.isRemote) {
+ return;
+ }
+ if (iStack.getTagCompound() == null || !iStack.getTagCompound().hasKey("size")) {
+ this.createNBT(world, iStack);
+ Logger.INFO("Egg has no NBT, creating (onUpdate)");
+ }
+ boolean a1, a2;
+ a1 = this.isTicking(world, iStack);
+ a2 = a1 ? tickItemTag(world, iStack) : false;
- public ItemStack getHatchResult() {
- return turnsIntoItem;
- }
+ // Logger.INFO("Is Ticking? "+a1);
+ // Logger.INFO("Did Tick? "+a2);
+ if (!a1 && !a2) {
+ if (entityHolding instanceof EntityPlayer) {
+ if (MathUtils.randInt(0, 1000) >= 990) {
+ if (NBTUtils.hasKey(iStack, "size")) {
+ if ((NBTUtils.getInteger(iStack, "size") + 1) >= MathUtils.randInt(0, 9)) {
+ ItemStack replacement = ItemUtils.getSimpleStack(getHatchResult(), 1);
+ if (replacement == null) {}
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- String localName = super.getItemStackDisplayName(aStack);
- /*if (aStack.getTagCompound() == null){
- createNBT(null, aStack);
- Logger.INFO("Egg has no NBT, creating (getDisplayName)");
- }*/
- int size = 1;
- if (NBTUtils.hasKey(aStack, "size")){
- size = NBTUtils.getInteger(aStack, "size");
- return ""+size+" "+localName;
- }
- return "?? "+localName;
- }
+ // Logger.INFO("Replacing "+iStack.getDisplayName()+" with
+ // "+replacement.getDisplayName()+".");
+ final ItemStack tempTransform = replacement.copy();
+ if (iStack.stackSize > 1) {
+ int u = iStack.stackSize;
+ tempTransform.stackSize = u;
+ ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
+ for (int l = 0; l < u; l++) {
+ ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
+ }
+ } else {
+ tempTransform.stackSize = 1;
+ ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
+ ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ public ItemStack getHatchResult() {
+ return turnsIntoItem;
+ }
- @Override
- public boolean hasCustomEntity(ItemStack stack) {
- return true;
- }
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ String localName = super.getItemStackDisplayName(aStack);
+ /*if (aStack.getTagCompound() == null){
+ createNBT(null, aStack);
+ Logger.INFO("Egg has no NBT, creating (getDisplayName)");
+ }*/
+ int size = 1;
+ if (NBTUtils.hasKey(aStack, "size")) {
+ size = NBTUtils.getInteger(aStack, "size");
+ return "" + size + " " + localName;
+ }
+ return "?? " + localName;
+ }
- @Override
- public Entity createEntity(World world, Entity location, ItemStack itemstack) {
- if (location instanceof EntityPlayer) {
- EntityPlayer player = (EntityPlayer) location;
- if (itemstack == null) {
- return null;
- }
- else if (itemstack.stackSize == 0) {
- return null;
- }
- else {
- ItemEntityGiantEgg entityitem = new ItemEntityGiantEgg(world, player.posX, player.posY - 0.30000001192092896D + (double)player.getEyeHeight(), player.posZ, itemstack);
- entityitem.delayBeforeCanPickup = 40;
- entityitem.func_145799_b(player.getCommandSenderName());
- float f = 0.1F;
- float f1;
- f = 0.3F;
- entityitem.motionX = (double)(-MathHelper.sin(player.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float)Math.PI) * f);
- entityitem.motionZ = (double)(MathHelper.cos(player.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float)Math.PI) * f);
- entityitem.motionY = (double)(-MathHelper.sin(player.rotationPitch / 180.0F * (float)Math.PI) * f + 0.1F);
- f = 0.02F;
- f1 = RANDOM.nextFloat() * (float)Math.PI * 2.0F;
- f *= RANDOM.nextFloat();
- entityitem.motionX += Math.cos((double)f1) * (double)f;
- entityitem.motionY += (double)((RANDOM.nextFloat() - RANDOM.nextFloat()) * 0.1F);
- entityitem.motionZ += Math.sin((double)f1) * (double)f;
- return entityitem;
- }
- }
- return null;
- }
+ @Override
+ public boolean hasCustomEntity(ItemStack stack) {
+ return true;
+ }
- @Override
- public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
- int size = 0;
- long age = 0;
- long life = 0;
- int expected = 0;
- if (this.descriptionString.length > 0) {
- list.add(EnumChatFormatting.GRAY+this.descriptionString[0]);
- }
- if (NBTUtils.hasKey(stack, "size")){
- size = NBTUtils.getInteger(stack, "size");
- if (size > 0 && NBTUtils.hasKey(stack, "TickableItem")){
- NBTTagCompound aNBT = stack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- age = aNBT.getLong("Tick");
- }
- }
- }
- if (NBTUtils.hasKey(stack, "mEggAge")){
- life = NBTUtils.getInteger(stack, "mEggAge");
- }
- if (NBTUtils.hasKey(stack, "mExpected")){
- expected = NBTUtils.getInteger(stack, "mExpected");
- }
- }
- String aSize = size > 0 ? ""+size : "??";
- String aExpected = expected > 0 ? ""+expected : "??";
- String aAge = age > 0 ? ""+(age/20) : "??";
- String aLife = life > 0 ? ""+(life/20) : "??";
- list.add("Egg Size: "+aSize+" ounces");
- list.add("Expected Stem Cells: "+aExpected);
- list.add("Age: "+aAge+"s"+" / "+aLife+"s");
- list.add("Larger eggs take longer to hatch,");
- list.add("but have a better chance of hatching.");
-
- }
+ @Override
+ public Entity createEntity(World world, Entity location, ItemStack itemstack) {
+ if (location instanceof EntityPlayer) {
+ EntityPlayer player = (EntityPlayer) location;
+ if (itemstack == null) {
+ return null;
+ } else if (itemstack.stackSize == 0) {
+ return null;
+ } else {
+ ItemEntityGiantEgg entityitem = new ItemEntityGiantEgg(
+ world,
+ player.posX,
+ player.posY - 0.30000001192092896D + (double) player.getEyeHeight(),
+ player.posZ,
+ itemstack);
+ entityitem.delayBeforeCanPickup = 40;
+ entityitem.func_145799_b(player.getCommandSenderName());
+ float f = 0.1F;
+ float f1;
+ f = 0.3F;
+ entityitem.motionX = (double) (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI)
+ * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)
+ * f);
+ entityitem.motionZ = (double) (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI)
+ * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)
+ * f);
+ entityitem.motionY =
+ (double) (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI) * f + 0.1F);
+ f = 0.02F;
+ f1 = RANDOM.nextFloat() * (float) Math.PI * 2.0F;
+ f *= RANDOM.nextFloat();
+ entityitem.motionX += Math.cos((double) f1) * (double) f;
+ entityitem.motionY += (double) ((RANDOM.nextFloat() - RANDOM.nextFloat()) * 0.1F);
+ entityitem.motionZ += Math.sin((double) f1) * (double) f;
+ return entityitem;
+ }
+ }
+ return null;
+ }
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ int size = 0;
+ long age = 0;
+ long life = 0;
+ int expected = 0;
+ if (this.descriptionString.length > 0) {
+ list.add(EnumChatFormatting.GRAY + this.descriptionString[0]);
+ }
+ if (NBTUtils.hasKey(stack, "size")) {
+ size = NBTUtils.getInteger(stack, "size");
+ if (size > 0 && NBTUtils.hasKey(stack, "TickableItem")) {
+ NBTTagCompound aNBT = stack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("TickableItem");
+ if (aNBT != null) {
+ age = aNBT.getLong("Tick");
+ }
+ }
+ }
+ if (NBTUtils.hasKey(stack, "mEggAge")) {
+ life = NBTUtils.getInteger(stack, "mEggAge");
+ }
+ if (NBTUtils.hasKey(stack, "mExpected")) {
+ expected = NBTUtils.getInteger(stack, "mExpected");
+ }
+ }
+ String aSize = size > 0 ? "" + size : "??";
+ String aExpected = expected > 0 ? "" + expected : "??";
+ String aAge = age > 0 ? "" + (age / 20) : "??";
+ String aLife = life > 0 ? "" + (life / 20) : "??";
+ list.add("Egg Size: " + aSize + " ounces");
+ list.add("Expected Stem Cells: " + aExpected);
+ list.add("Age: " + aAge + "s" + " / " + aLife + "s");
+ list.add("Larger eggs take longer to hatch,");
+ list.add("but have a better chance of hatching.");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemHalfCompleteCasings.java b/src/main/java/gtPlusPlus/core/item/general/ItemHalfCompleteCasings.java
index ad9abc8ab2..aa3d5b62e1 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemHalfCompleteCasings.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemHalfCompleteCasings.java
@@ -1,63 +1,62 @@
package gtPlusPlus.core.item.general;
+import gtPlusPlus.core.item.base.BaseItemColourable;
+import gtPlusPlus.core.util.Utils;
import java.util.List;
-
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import gtPlusPlus.core.item.base.BaseItemColourable;
-import gtPlusPlus.core.util.Utils;
+public class ItemHalfCompleteCasings extends BaseItemColourable {
-public class ItemHalfCompleteCasings extends BaseItemColourable{
+ public ItemHalfCompleteCasings(
+ String unlocalizedName,
+ CreativeTabs creativeTab,
+ int stackSize,
+ int maxDmg,
+ String description,
+ EnumRarity regRarity,
+ EnumChatFormatting colour,
+ boolean Effect,
+ int rgb) {
+ super(unlocalizedName, creativeTab, stackSize, maxDmg, description, regRarity, colour, Effect, rgb);
+ }
- public ItemHalfCompleteCasings(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg,
- String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect, int rgb) {
- super(unlocalizedName, creativeTab, stackSize, maxDmg, description, regRarity, colour, Effect, rgb);
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 4; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- String prefix = super.getItemStackDisplayName(tItem);
- String casingType = "";
- if (tItem.getItemDamage() == 0){
- casingType = " I";
- }
- else if (tItem.getItemDamage() == 1){
- casingType = " II";
- }
- else if (tItem.getItemDamage() == 2){
- casingType = " III";
- }
- else if (tItem.getItemDamage() == 3){
- casingType = " IV";
- }
- return (prefix+casingType);
- }
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 4; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
- if (this.getDamage(stack)==0){
- return Utils.rgbtoHexValue(52, 52, 52);
- }
- else if (this.getDamage(stack)==1){
- return Utils.rgbtoHexValue(80, 90, 222);
- }
- else if (this.getDamage(stack)==2){
- return Utils.rgbtoHexValue(182, 77, 177);
- }
- else {
- return Utils.rgbtoHexValue(77, 175, 182);
- }
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ String prefix = super.getItemStackDisplayName(tItem);
+ String casingType = "";
+ if (tItem.getItemDamage() == 0) {
+ casingType = " I";
+ } else if (tItem.getItemDamage() == 1) {
+ casingType = " II";
+ } else if (tItem.getItemDamage() == 2) {
+ casingType = " III";
+ } else if (tItem.getItemDamage() == 3) {
+ casingType = " IV";
+ }
+ return (prefix + casingType);
+ }
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (this.getDamage(stack) == 0) {
+ return Utils.rgbtoHexValue(52, 52, 52);
+ } else if (this.getDamage(stack) == 1) {
+ return Utils.rgbtoHexValue(80, 90, 222);
+ } else if (this.getDamage(stack) == 2) {
+ return Utils.rgbtoHexValue(182, 77, 177);
+ } else {
+ return Utils.rgbtoHexValue(77, 175, 182);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java
index ac7a149f3c..c1f316c38f 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemHealingDevice.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.common.Optional;
@@ -16,6 +14,7 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper;
import ic2.api.item.*;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -25,363 +24,390 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.*;
import net.minecraft.world.World;
-@Optional.InterfaceList(value = {@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"), @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")})
-public class ItemHealingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble{
-
- private final String unlocalizedName = "personalHealingDevice";
- private final static int maxValueEU = 1000000000;
- protected double chargeEU = 0;
-
- public ItemHealingDevice(){
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setUnlocalizedName(this.unlocalizedName);
- this.setMaxStackSize(1);
- this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice");
- GameRegistry.registerItem(this, this.unlocalizedName);
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_, final boolean p_77663_5_) {
- if (worldObj.isRemote) {
- return;
- }
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
- return false;
- }
-
- @Override
- public Item getChargedItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(maxValueEU);
- return x.getItem();
- }
-
- @Override
- public Item getEmptyItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(0);
- return x.getItem();
- }
-
- @Override
- public double getMaxCharge(final ItemStack itemStack) {
- return maxValueEU;
- }
-
- @Override
- public int getTier(final ItemStack itemStack) {
- return 5;
- }
-
- @Override
- public double getTransferLimit(final ItemStack itemStack) {
- return GT_Values.V[7];
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return (EnumChatFormatting.BLUE + "Personal Healing NanoBooster" + EnumChatFormatting.RESET);
- }
-
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- // return 1.0D - getEnergyStored(stack) / this.capacity;
- return 1.0D - (this.getCharge(stack) / this.getMaxCharge(stack));
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return true;
- }
-
- public double secondsLeft(final ItemStack stack) {
-
- double r = 0;
- r = this.getCharge(stack) / (1638400 / 4);
- return (int) r;
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
-
- String aString1 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.1");
- String aString2 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.2");
- String aString3 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.3");
- String aString4 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.4");
- String aString5 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.5");
- String aStringTooltip = StatCollector.translateToLocal("GTPP.nanohealer.hidden");
- String aEuInfo = StatCollector.translateToLocal("GTPP.info.euInfo");
- String aTier = StatCollector.translateToLocal("GTPP.machines.tier");
- String aInputLimit = StatCollector.translateToLocal("GTPP.info.inputLimit");
- String aCurrentPower = StatCollector.translateToLocal("GTPP.info.currentPower");
- String aEU = StatCollector.translateToLocal("GTPP.info.eu");
- String aEUT = aEU+"/t";
- boolean isShowing = getShowMessages(stack);
-
- list.add("");
-
- list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN + aString2 + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN + aString3 + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.RED + aString4 + EnumChatFormatting.GRAY);
-
- list.add("");
-
- list.add(EnumChatFormatting.GOLD + aEuInfo + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GRAY + aTier+": [" + EnumChatFormatting.YELLOW + this.getTier(stack)
- + EnumChatFormatting.GRAY + "] "+aInputLimit+": [" + EnumChatFormatting.YELLOW
- + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT+"]");
- list.add(EnumChatFormatting.GRAY + aCurrentPower +": [" + EnumChatFormatting.YELLOW + (long) this.getCharge(stack)
- + EnumChatFormatting.GRAY + aEU +"] [" + EnumChatFormatting.YELLOW
- + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY
- + "%]");
- list.add(EnumChatFormatting.GOLD + aString5 + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GOLD + aStringTooltip + " " + (!isShowing ? EnumChatFormatting.DARK_GREEN : EnumChatFormatting.DARK_RED) + !isShowing + EnumChatFormatting.GRAY);
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public double charge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean simulate) {
-
- if (!simulate)
- {
- ElectricItem.manager.charge(stack, amount, tier, true, simulate);
-
- }
- return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
- }
-
- @Override
- public double discharge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) {
- if (!simulate)
- {
- ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }
-
- return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }
-
- @Override
- public double getCharge(final ItemStack stack) {
- return ElectricItem.manager.getCharge(stack);
- }
-
- @Override
- public boolean canUse(final ItemStack stack, final double amount) {
- return ElectricItem.manager.canUse(stack, amount);
- }
-
- @Override
- public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
- return ElectricItem.manager.use(stack, amount, entity);
- }
-
- @Override
- public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
- ElectricItem.manager.chargeFromArmor(stack, entity);
- }
-
- @Override
- public String getToolTip(final ItemStack stack) {
- return ElectricItem.manager.getToolTip(stack);
- }
-
- @Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public BaubleType getBaubleType(final ItemStack arg0) {
- return BaubleType.AMULET;
- }
-
- @Override //TODO
- public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
- }
-
- @Override //TODO
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
- }
-
- @Override //TODO
- public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase arg1) {
- if (arg1 != null && arg1.worldObj != null && !arg1.worldObj.isRemote){
-
- //Try Charge First
-
- //Inv Slots
- for (final ItemStack aInvStack : ((EntityPlayer) arg1).inventory.mainInventory) {
- if (aInvStack == aBaubleStack) {
- continue;
- }
-
- if (this.getCharge(aBaubleStack) == this.getMaxCharge(aBaubleStack)) {
- break;
- }
-
- if (aInvStack != null) {
- if (ChargingHelper.isItemValid(aInvStack)) {
-
-
- double aTransferRate;
- double aCurrentChargeForThisBauble;
- int mTier;
- final IElectricItem electricItem = (IElectricItem) aInvStack.getItem();
-
- if (electricItem != null) {
-
- aTransferRate = electricItem.getTransferLimit(aInvStack);
- mTier = electricItem.getTier(aInvStack);
- aCurrentChargeForThisBauble = ElectricItem.manager.getCharge(aBaubleStack);
-
- if (aCurrentChargeForThisBauble < maxValueEU) {
- if ((ElectricItem.manager.getCharge(aInvStack) >= aTransferRate)) {
- if (electricItem.canProvideEnergy(aInvStack)) {
- double d = ElectricItem.manager.discharge(aInvStack, aTransferRate, mTier, false, true, false);
- //Logger.INFO("Charging from "+aInvStack.getDisplayName() +" | "+d);
- ElectricItem.manager.charge(aBaubleStack, d, mTier, true, false);
- }
- }
- }
- }
- }
- }
- if (this.getCharge(aBaubleStack) <= (this.getMaxCharge(aBaubleStack) - getTransferLimit(aBaubleStack))) {
- continue;
- }
- else {
- break;
- }
- }
-
-
- //Try Heal
- if (this.getCharge(aBaubleStack) > 0){
-
- if (!(arg1 instanceof EntityPlayer)) {
- return;
- }
- EntityPlayer g = (EntityPlayer) arg1;
- //health Check
- float hp = 0;
- if (arg1.getHealth() < arg1.getMaxHealth()){
- final float rx = arg1.getMaxHealth()-arg1.getHealth();
- Logger.INFO("rx:"+rx);
- arg1.heal(rx*2);
- hp = rx;
- this.discharge(aBaubleStack, (1638400)*rx, 6, true, true, false);
- }
-
- int hunger = 0;
- float saturation = 0;
- FoodStats aFood = g.getFoodStats();
- if (aFood != null) {
- //Hunger Check
- hunger = 20 - aFood.getFoodLevel();
- this.discharge(aBaubleStack, (1638400) * hunger, 6, true, true, false);
- // Saturation Check
- saturation = 20f - aFood.getSaturationLevel();
- this.discharge(aBaubleStack, (1638400) * saturation, 6, true, true, false);
- aFood.addStats(hunger, saturation);
- }
-
- //Only show Messages if they're enabled.
- if (getShowMessages(aBaubleStack)) {
- if (hp > 0 || hunger > 0 || saturation > 0)
- PlayerUtils.messagePlayer((EntityPlayer) arg1,
- "Your NanoBooster Whirs! Leaving you feeling stronger.");
-
- if (hp > 0)
- PlayerUtils.messagePlayer((EntityPlayer) arg1, "Healed " + hp + " hp.");
-
- if (hunger > 0)
- PlayerUtils.messagePlayer((EntityPlayer) arg1, "Healed " + hunger + " hunger.");
-
- if (saturation > 0)
- PlayerUtils.messagePlayer((EntityPlayer) arg1, "Satured Hunger by " + saturation + ".");
-
- if (hp > 0 || hunger > 0 || saturation > 0)
- PlayerUtils.messagePlayer((EntityPlayer) arg1,
- "You check it's remaining uses, it has " + (int) this.secondsLeft(aBaubleStack) + ".");
- }
- }
- }
- }
-
- private static boolean createNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- tagMain.setBoolean("ShowMSG", false);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static final boolean getShowMessages(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT == null) {
- if (!createNBT(aStack)) {
- return false;
- }
- else {
- aNBT = aStack.getTagCompound();
- }
- }
- return aNBT.getBoolean("ShowMSG");
-
- }
-
- public static final boolean setShowMessages(final ItemStack aStack, final boolean aShow) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT == null) {
- if (!createNBT(aStack)) {
- return false;
- } else {
- aNBT = aStack.getTagCompound();
- }
- }
- aNBT.setBoolean("ShowMSG", aShow);
- return true;
- }
-
- @Override
- public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_,
- int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
- // TODO Auto-generated method stub
- return super.onItemUse(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_,
- p_77648_9_, p_77648_10_);
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- ItemStack superStack = super.onItemRightClick(aStack, aWorld, aPlayer);
- boolean isShiftHeld = KeyboardUtils.isShiftKeyDown();
- if (isShiftHeld) {
- boolean oldState = getShowMessages(superStack);
- boolean newState = Utils.invertBoolean(oldState);
- ItemHealingDevice.setShowMessages(superStack, newState);
- PlayerUtils.messagePlayer(aPlayer, (!oldState ? "Showing info messages" : "Hiding info messages"));
- }
- return superStack;
- }
-
- @Override
- public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) {
- return true;
- }
-
+@Optional.InterfaceList(
+ value = {
+ @Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"),
+ @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")
+ })
+public class ItemHealingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble {
+
+ private final String unlocalizedName = "personalHealingDevice";
+ private static final int maxValueEU = 1000000000;
+ protected double chargeEU = 0;
+
+ public ItemHealingDevice() {
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setUnlocalizedName(this.unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice");
+ GameRegistry.registerItem(this, this.unlocalizedName);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World worldObj,
+ final Entity player,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (worldObj.isRemote) {
+ return;
+ }
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean canProvideEnergy(final ItemStack itemStack) {
+ return false;
+ }
+
+ @Override
+ public Item getChargedItem(final ItemStack itemStack) {
+ final ItemStack x = itemStack.copy();
+ x.setItemDamage(maxValueEU);
+ return x.getItem();
+ }
+
+ @Override
+ public Item getEmptyItem(final ItemStack itemStack) {
+ final ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
+ }
+
+ @Override
+ public double getMaxCharge(final ItemStack itemStack) {
+ return maxValueEU;
+ }
+
+ @Override
+ public int getTier(final ItemStack itemStack) {
+ return 5;
+ }
+
+ @Override
+ public double getTransferLimit(final ItemStack itemStack) {
+ return GT_Values.V[7];
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+
+ return (EnumChatFormatting.BLUE + "Personal Healing NanoBooster" + EnumChatFormatting.RESET);
+ }
+
+ @Override
+ public double getDurabilityForDisplay(final ItemStack stack) {
+ // return 1.0D - getEnergyStored(stack) / this.capacity;
+ return 1.0D - (this.getCharge(stack) / this.getMaxCharge(stack));
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return true;
+ }
+
+ public double secondsLeft(final ItemStack stack) {
+
+ double r = 0;
+ r = this.getCharge(stack) / (1638400 / 4);
+ return (int) r;
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+
+ String aString1 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.1");
+ String aString2 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.2");
+ String aString3 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.3");
+ String aString4 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.4");
+ String aString5 = StatCollector.translateToLocal("GTPP.nanohealer.tooltip.5");
+ String aStringTooltip = StatCollector.translateToLocal("GTPP.nanohealer.hidden");
+ String aEuInfo = StatCollector.translateToLocal("GTPP.info.euInfo");
+ String aTier = StatCollector.translateToLocal("GTPP.machines.tier");
+ String aInputLimit = StatCollector.translateToLocal("GTPP.info.inputLimit");
+ String aCurrentPower = StatCollector.translateToLocal("GTPP.info.currentPower");
+ String aEU = StatCollector.translateToLocal("GTPP.info.eu");
+ String aEUT = aEU + "/t";
+ boolean isShowing = getShowMessages(stack);
+
+ list.add("");
+
+ list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN + aString2 + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN + aString3 + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.RED + aString4 + EnumChatFormatting.GRAY);
+
+ list.add("");
+
+ list.add(EnumChatFormatting.GOLD + aEuInfo + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY + aTier + ": [" + EnumChatFormatting.YELLOW + this.getTier(stack)
+ + EnumChatFormatting.GRAY + "] " + aInputLimit + ": [" + EnumChatFormatting.YELLOW
+ + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT + "]");
+ list.add(EnumChatFormatting.GRAY + aCurrentPower + ": [" + EnumChatFormatting.YELLOW
+ + (long) this.getCharge(stack)
+ + EnumChatFormatting.GRAY + aEU + "] [" + EnumChatFormatting.YELLOW
+ + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY
+ + "%]");
+ list.add(EnumChatFormatting.GOLD + aString5 + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GOLD + aStringTooltip + " "
+ + (!isShowing ? EnumChatFormatting.DARK_GREEN : EnumChatFormatting.DARK_RED) + !isShowing
+ + EnumChatFormatting.GRAY);
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public double charge(
+ final ItemStack stack,
+ final double amount,
+ final int tier,
+ final boolean ignoreTransferLimit,
+ final boolean simulate) {
+
+ if (!simulate) {
+ ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ }
+ return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ }
+
+ @Override
+ public double discharge(
+ final ItemStack stack,
+ final double amount,
+ final int tier,
+ final boolean ignoreTransferLimit,
+ final boolean externally,
+ final boolean simulate) {
+ if (!simulate) {
+ ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ @Override
+ public double getCharge(final ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
+ }
+
+ @Override
+ public boolean canUse(final ItemStack stack, final double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
+ }
+
+ @Override
+ public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
+ }
+
+ @Override
+ public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
+ }
+
+ @Override
+ public String getToolTip(final ItemStack stack) {
+ return ElectricItem.manager.getToolTip(stack);
+ }
+
+ @Override
+ public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public BaubleType getBaubleType(final ItemStack arg0) {
+ return BaubleType.AMULET;
+ }
+
+ @Override // TODO
+ public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {}
+
+ @Override // TODO
+ public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {}
+
+ @Override // TODO
+ public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase arg1) {
+ if (arg1 != null && arg1.worldObj != null && !arg1.worldObj.isRemote) {
+
+ // Try Charge First
+
+ // Inv Slots
+ for (final ItemStack aInvStack : ((EntityPlayer) arg1).inventory.mainInventory) {
+ if (aInvStack == aBaubleStack) {
+ continue;
+ }
+
+ if (this.getCharge(aBaubleStack) == this.getMaxCharge(aBaubleStack)) {
+ break;
+ }
+
+ if (aInvStack != null) {
+ if (ChargingHelper.isItemValid(aInvStack)) {
+
+ double aTransferRate;
+ double aCurrentChargeForThisBauble;
+ int mTier;
+ final IElectricItem electricItem = (IElectricItem) aInvStack.getItem();
+
+ if (electricItem != null) {
+
+ aTransferRate = electricItem.getTransferLimit(aInvStack);
+ mTier = electricItem.getTier(aInvStack);
+ aCurrentChargeForThisBauble = ElectricItem.manager.getCharge(aBaubleStack);
+
+ if (aCurrentChargeForThisBauble < maxValueEU) {
+ if ((ElectricItem.manager.getCharge(aInvStack) >= aTransferRate)) {
+ if (electricItem.canProvideEnergy(aInvStack)) {
+ double d = ElectricItem.manager.discharge(
+ aInvStack, aTransferRate, mTier, false, true, false);
+ // Logger.INFO("Charging from "+aInvStack.getDisplayName() +" | "+d);
+ ElectricItem.manager.charge(aBaubleStack, d, mTier, true, false);
+ }
+ }
+ }
+ }
+ }
+ }
+ if (this.getCharge(aBaubleStack)
+ <= (this.getMaxCharge(aBaubleStack) - getTransferLimit(aBaubleStack))) {
+ continue;
+ } else {
+ break;
+ }
+ }
+
+ // Try Heal
+ if (this.getCharge(aBaubleStack) > 0) {
+
+ if (!(arg1 instanceof EntityPlayer)) {
+ return;
+ }
+ EntityPlayer g = (EntityPlayer) arg1;
+ // health Check
+ float hp = 0;
+ if (arg1.getHealth() < arg1.getMaxHealth()) {
+ final float rx = arg1.getMaxHealth() - arg1.getHealth();
+ Logger.INFO("rx:" + rx);
+ arg1.heal(rx * 2);
+ hp = rx;
+ this.discharge(aBaubleStack, (1638400) * rx, 6, true, true, false);
+ }
+
+ int hunger = 0;
+ float saturation = 0;
+ FoodStats aFood = g.getFoodStats();
+ if (aFood != null) {
+ // Hunger Check
+ hunger = 20 - aFood.getFoodLevel();
+ this.discharge(aBaubleStack, (1638400) * hunger, 6, true, true, false);
+ // Saturation Check
+ saturation = 20f - aFood.getSaturationLevel();
+ this.discharge(aBaubleStack, (1638400) * saturation, 6, true, true, false);
+ aFood.addStats(hunger, saturation);
+ }
+
+ // Only show Messages if they're enabled.
+ if (getShowMessages(aBaubleStack)) {
+ if (hp > 0 || hunger > 0 || saturation > 0)
+ PlayerUtils.messagePlayer(
+ (EntityPlayer) arg1, "Your NanoBooster Whirs! Leaving you feeling stronger.");
+
+ if (hp > 0) PlayerUtils.messagePlayer((EntityPlayer) arg1, "Healed " + hp + " hp.");
+
+ if (hunger > 0) PlayerUtils.messagePlayer((EntityPlayer) arg1, "Healed " + hunger + " hunger.");
+
+ if (saturation > 0)
+ PlayerUtils.messagePlayer((EntityPlayer) arg1, "Satured Hunger by " + saturation + ".");
+
+ if (hp > 0 || hunger > 0 || saturation > 0)
+ PlayerUtils.messagePlayer(
+ (EntityPlayer) arg1,
+ "You check it's remaining uses, it has " + (int) this.secondsLeft(aBaubleStack) + ".");
+ }
+ }
+ }
+ }
+
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ tagMain.setBoolean("ShowMSG", false);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static final boolean getShowMessages(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT == null) {
+ if (!createNBT(aStack)) {
+ return false;
+ } else {
+ aNBT = aStack.getTagCompound();
+ }
+ }
+ return aNBT.getBoolean("ShowMSG");
+ }
+
+ public static final boolean setShowMessages(final ItemStack aStack, final boolean aShow) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT == null) {
+ if (!createNBT(aStack)) {
+ return false;
+ } else {
+ aNBT = aStack.getTagCompound();
+ }
+ }
+ aNBT.setBoolean("ShowMSG", aShow);
+ return true;
+ }
+
+ @Override
+ public boolean onItemUse(
+ ItemStack p_77648_1_,
+ EntityPlayer p_77648_2_,
+ World p_77648_3_,
+ int p_77648_4_,
+ int p_77648_5_,
+ int p_77648_6_,
+ int p_77648_7_,
+ float p_77648_8_,
+ float p_77648_9_,
+ float p_77648_10_) {
+ // TODO Auto-generated method stub
+ return super.onItemUse(
+ p_77648_1_,
+ p_77648_2_,
+ p_77648_3_,
+ p_77648_4_,
+ p_77648_5_,
+ p_77648_6_,
+ p_77648_7_,
+ p_77648_8_,
+ p_77648_9_,
+ p_77648_10_);
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ ItemStack superStack = super.onItemRightClick(aStack, aWorld, aPlayer);
+ boolean isShiftHeld = KeyboardUtils.isShiftKeyDown();
+ if (isShiftHeld) {
+ boolean oldState = getShowMessages(superStack);
+ boolean newState = Utils.invertBoolean(oldState);
+ ItemHealingDevice.setShowMessages(superStack, newState);
+ PlayerUtils.messagePlayer(aPlayer, (!oldState ? "Showing info messages" : "Hiding info messages"));
+ }
+ return superStack;
+ }
+
+ @Override
+ public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java b/src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java
index c34ad9e8d3..79076ec571 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemLavaFilter.java
@@ -1,7 +1,10 @@
package gtPlusPlus.core.item.general;
+import gregtech.api.enums.ItemList;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.CoreItem;
+import gtPlusPlus.core.lib.CORE;
import java.util.List;
-
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -10,118 +13,112 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
-import gregtech.api.enums.ItemList;
+public class ItemLavaFilter extends CoreItem {
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.CoreItem;
-import gtPlusPlus.core.lib.CORE;
+ public IIcon[] mIcon = new IIcon[1];
-public class ItemLavaFilter extends CoreItem {
+ public ItemLavaFilter() {
+ super(
+ "itemLavaFilter",
+ AddToCreativeTab.tabMachines,
+ 1,
+ 100,
+ new String[] {"Lava Filter"},
+ EnumRarity.common,
+ EnumChatFormatting.BLACK,
+ false,
+ null);
+ setGregtechItemList();
+ }
- public IIcon[] mIcon = new IIcon[1];
-
- public ItemLavaFilter() {
- super("itemLavaFilter", AddToCreativeTab.tabMachines, 1, 100, new String[] {"Lava Filter"}, EnumRarity.common,
- EnumChatFormatting.BLACK, false, null);
- setGregtechItemList();
- }
+ private final boolean setGregtechItemList() {
+ ItemList.Component_LavaFilter.set(this);
+ return ItemList.Component_LavaFilter.get(1) != null ? true : false;
+ }
- private final boolean setGregtechItemList() {
- ItemList.Component_LavaFilter.set(this);
- return ItemList.Component_LavaFilter.get(1) != null ? true : false;
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- this.mIcon[0] = reg.registerIcon(CORE.MODID + ":" + "itemLavaFilter");
- }
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ this.mIcon[0] = reg.registerIcon(CORE.MODID + ":" + "itemLavaFilter");
+ }
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.mIcon[0];
- }
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.mIcon[0];
+ }
- @Override
- public String getItemStackDisplayName(ItemStack tItem) {
- return "Lava Filter";
- }
-
- private static boolean createNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Damage", 0);
- tagMain.setTag("LavaFilter", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static final long getFilterDamage(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("LavaFilter");
- if (aNBT != null) {
- return aNBT.getLong("Damage");
- }
- }
- else {
- createNBT(aStack);
- }
- return 0L;
- }
+ @Override
+ public String getItemStackDisplayName(ItemStack tItem) {
+ return "Lava Filter";
+ }
- public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("LavaFilter");
- if (aNBT != null) {
- aNBT.setLong("Damage", aDamage);
- return true;
- }
- }
- else {
- createNBT(aStack);
- }
- return false;
- }
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Damage", 0);
+ tagMain.setTag("LavaFilter", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- if (stack.getTagCompound() == null){
- createNBT(stack);
+ public static final long getFilterDamage(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("LavaFilter");
+ if (aNBT != null) {
+ return aNBT.getLong("Damage");
+ }
+ } else {
+ createNBT(aStack);
}
- double currentDamage = getFilterDamage(stack);
- double durabilitypercent = currentDamage / 100;
- return durabilitypercent;
- }
+ return 0L;
+ }
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- list.add(EnumChatFormatting.GRAY+"Filters Lava within a Thermal Boiler.");
- EnumChatFormatting durability = EnumChatFormatting.GRAY;
- if (100-getFilterDamage(stack) > 80){
- durability = EnumChatFormatting.GRAY;
- }
- else if (100-getFilterDamage(stack) > 60){
- durability = EnumChatFormatting.GREEN;
- }
- else if (100-getFilterDamage(stack) > 40){
- durability = EnumChatFormatting.YELLOW;
- }
- else if (100-getFilterDamage(stack) > 20){
- durability = EnumChatFormatting.GOLD;
- }
- else if (100-getFilterDamage(stack) > 0){
- durability = EnumChatFormatting.RED;
- }
- list.add(durability+""+(100-getFilterDamage(stack))+EnumChatFormatting.GRAY+" / "+100);
- //super.addInformation(stack, player, list, bool);
- }
+ public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("LavaFilter");
+ if (aNBT != null) {
+ aNBT.setLong("Damage", aDamage);
+ return true;
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return false;
+ }
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return true;
- }
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (stack.getTagCompound() == null) {
+ createNBT(stack);
+ }
+ double currentDamage = getFilterDamage(stack);
+ double durabilitypercent = currentDamage / 100;
+ return durabilitypercent;
+ }
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ list.add(EnumChatFormatting.GRAY + "Filters Lava within a Thermal Boiler.");
+ EnumChatFormatting durability = EnumChatFormatting.GRAY;
+ if (100 - getFilterDamage(stack) > 80) {
+ durability = EnumChatFormatting.GRAY;
+ } else if (100 - getFilterDamage(stack) > 60) {
+ durability = EnumChatFormatting.GREEN;
+ } else if (100 - getFilterDamage(stack) > 40) {
+ durability = EnumChatFormatting.YELLOW;
+ } else if (100 - getFilterDamage(stack) > 20) {
+ durability = EnumChatFormatting.GOLD;
+ } else if (100 - getFilterDamage(stack) > 0) {
+ durability = EnumChatFormatting.RED;
+ }
+ list.add(durability + "" + (100 - getFilterDamage(stack)) + EnumChatFormatting.GRAY + " / " + 100);
+ // super.addInformation(stack, player, list, bool);
+ }
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java b/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java
index 91b2ab2c41..feab0f0cf6 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.item.general;
-import java.lang.ref.WeakReference;
-import java.util.*;
-
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
@@ -14,6 +11,8 @@ import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.lib.CORE;
+import java.lang.ref.WeakReference;
+import java.util.*;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.*;
@@ -25,219 +24,233 @@ import net.minecraftforge.event.entity.living.LivingDeathEvent;
public class ItemMagicFeather extends CoreItem {
- public static final String NAME = "magicfeather";
- private static final WeakHashMap<EntityPlayer, MagicFeatherData> sPlayerData = new WeakHashMap<>();
- private static final WeakHashMap<EntityPlayer, HashSet<TileEntityBeacon>> sBeaconData = new WeakHashMap<>();
-
- public ItemMagicFeather() {
- super("magicfeather", AddToCreativeTab.tabMisc, 1, 100, new String[]{"Lets you fly around Beacons"}, EnumRarity.uncommon, null, false, null);
- setMaxStackSize(1);
- setUnlocalizedName(CORE.MODID + ":" + NAME);
- MinecraftForge.EVENT_BUS.register(this);
- }
-
- @Override
- public int getEntityLifespan(ItemStack itemStack, World world) {
- return Integer.MAX_VALUE;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- @SideOnly(Side.CLIENT)
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("Does not need to be the item held in your hand to work");
- super.addInformation(stack, aPlayer, list, bool);
- list.add("Needs to be within beacon range");
- list.add("Range is beacon level * 10 + 10");
- }
-
- public boolean hasCustomEntity(ItemStack stack) {
- return true;
- }
-
- private static boolean isInBeaconRange(EntityPlayer player) {
- World world = player.getEntityWorld();
- if (world.isRemote) {
- return false;
- }
- HashSet<TileEntityBeacon> aBeaconData = sBeaconData.computeIfAbsent(player, k -> new HashSet<>());
- int chunkXlo = (int) (player.posX - 50) >> 4,
- chunkXhi = (int) (player.posX + 50) >> 4,
- chunkZlo = (int) (player.posZ - 50) >> 4,
- chunkZhi = (int) (player.posZ + 50) >> 4;
- for (int chunkX = chunkXlo; chunkX < chunkXhi; chunkX++) {
- for (int chunkZ = chunkZlo; chunkZ < chunkZhi; chunkZ++) {
- if (!world.getChunkProvider().chunkExists(chunkX, chunkZ)) continue;
- findSuitableBeacon(player, world.getChunkFromChunkCoords(chunkX, chunkZ).chunkTileEntityMap.values(), aBeaconData);
- }
- }
- return aBeaconData.size() > 0;
- }
-
- private static void findSuitableBeacon(EntityPlayer player, Collection<TileEntity> tileEntities, HashSet<TileEntityBeacon> aBeaconData) {
- for (TileEntity t : tileEntities) {
- if (!(t instanceof TileEntityBeacon)) {
- continue;
- }
- TileEntityBeacon beacon = (TileEntityBeacon) t;
- int level = beacon.getLevels();
- if (level == 0) {
- continue;
- }
- int radius = (level * 10 + 10);
- int x = beacon.xCoord;
- int z = beacon.zCoord;
- if (player.posX < (x - radius) || player.posX > (x + radius)) {
- continue;
- }
- if (player.posZ < (z - radius) || player.posZ > (z + radius)) {
- continue;
- }
- aBeaconData.add(beacon);
- }
- }
-
- private static void setMayFly(EntityPlayer player, boolean mayFly) {
- if (player.capabilities.allowFlying == mayFly) {
- return;
- }
- if (!mayFly) {
- // force the player on the ground then remove ability to fly
- // this prevent crashing the the ground and dying
- // when you accidentally get out of the beacon range
- player.capabilities.isFlying = false;
- if (player.onGround && player.fallDistance < 1F) {
- player.capabilities.allowFlying = false;
- }
- }
- else {
- player.capabilities.allowFlying = true;
- }
- player.sendPlayerAbilities();
- }
-
- @SubscribeEvent(priority=EventPriority.HIGHEST)
- public void onPlayerTick(TickEvent.PlayerTickEvent event) {
- if (event.side != Side.SERVER || event.phase != Phase.END) {
- return;
- }
- EntityPlayer player = event.player;
- HashSet<TileEntityBeacon> aBeaconData = sBeaconData.get(player);
- if (aBeaconData != null && !aBeaconData.isEmpty()) {
- for (Iterator<TileEntityBeacon> iterator = aBeaconData.iterator(); iterator.hasNext(); ) {
- TileEntityBeacon aBeacon = iterator.next();
- int level = aBeacon.getLevels();
- if (level == 0) {
- iterator.remove();
- continue;
- }
- int radius = (level * 10 + 10);
- int x = aBeacon.xCoord;
- int z = aBeacon.zCoord;
- if (player.posX < (x - radius) || player.posX > (x + radius) ||
- player.posZ < (z - radius) || player.posZ > (z + radius)) {
- iterator.remove();
- }
- }
- }
- boolean hasItem = hasItem(player, ModItems.itemMagicFeather);
- if (!hasItem) {
- ItemMagicFeather.sPlayerData.remove(player);
- }
- MagicFeatherData data = ItemMagicFeather.sPlayerData.get(player);
- if (data == null) {
- data = new MagicFeatherData(player);
- ItemMagicFeather.sPlayerData.put(player, data);
- }
- data.onTick();
- }
-
- @SubscribeEvent(priority=EventPriority.LOWEST)
- public void onPlayerDeath(LivingDeathEvent event) {
- if (event.entityLiving == null) return;
- EntityLivingBase aEntity = event.entityLiving;
- if (!(aEntity instanceof EntityPlayer) || aEntity.worldObj == null || aEntity.worldObj.isRemote) return;
- EntityPlayer aPlayer = (EntityPlayer) aEntity;
- ItemMagicFeather.sPlayerData.remove(aPlayer);
- ItemMagicFeather.sBeaconData.remove(aPlayer);
- }
-
- private static boolean hasItem(EntityPlayer player, Item item) {
- for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
- ItemStack stack = player.inventory.getStackInSlot(i);
- if (stack != null && stack.getItem() != null && stack.getItem() instanceof ItemMagicFeather) {
- return true;
- }
- }
- return false;
- }
-
- private static class MagicFeatherData {
-
- private final WeakReference<EntityPlayer> player;
- private boolean hasItem = false;
- private int checkTick = 0;
- private boolean beaconInRangeCache;
-
- public MagicFeatherData(EntityPlayer player) {
- this.player = new WeakReference<>(player);
- this.beaconInRangeCache = player.capabilities.allowFlying;
- }
-
- public void onTick() {
- EntityPlayer player = this.player.get();
- if (player == null) return;
- try {
- boolean hasItem = hasItem(player, ModItems.itemMagicFeather);
- if (hasItem != this.hasItem) {
- if (hasItem) {
- this.onAdd();
- }
- if (!hasItem) {
- this.onRemove();
- }
- this.hasItem = hasItem;
- Logger.INFO("Ticking feather "+hasItem);
- return;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
-
- if (hasItem) {
- // only modify if hasItem. Override other flight methods since you are literally holding this item in
- // your own inventory. You have sent your consent.
- boolean mayFly = player.capabilities.isCreativeMode || checkBeaconInRange(player);
- setMayFly(player, mayFly);
- }
- }
-
- private void onAdd() {
- if (!ItemMagicFeather.isInBeaconRange(getPlayer())) {
- return;
- }
- setMayFly(getPlayer(), true);
- }
-
- private void onRemove() {
- if (getPlayer().capabilities.isCreativeMode) {
- return;
- }
- setMayFly(getPlayer(), false);
- }
-
- private boolean checkBeaconInRange(EntityPlayer player) {
- if (checkTick++ % 40 != 0) {
- return beaconInRangeCache;
- }
- beaconInRangeCache = ItemMagicFeather.isInBeaconRange(player);
- return beaconInRangeCache;
- }
-
- private EntityPlayer getPlayer() {
- return player.get();
- }
- }
+ public static final String NAME = "magicfeather";
+ private static final WeakHashMap<EntityPlayer, MagicFeatherData> sPlayerData = new WeakHashMap<>();
+ private static final WeakHashMap<EntityPlayer, HashSet<TileEntityBeacon>> sBeaconData = new WeakHashMap<>();
+
+ public ItemMagicFeather() {
+ super(
+ "magicfeather",
+ AddToCreativeTab.tabMisc,
+ 1,
+ 100,
+ new String[] {"Lets you fly around Beacons"},
+ EnumRarity.uncommon,
+ null,
+ false,
+ null);
+ setMaxStackSize(1);
+ setUnlocalizedName(CORE.MODID + ":" + NAME);
+ MinecraftForge.EVENT_BUS.register(this);
+ }
+
+ @Override
+ public int getEntityLifespan(ItemStack itemStack, World world) {
+ return Integer.MAX_VALUE;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add("Does not need to be the item held in your hand to work");
+ super.addInformation(stack, aPlayer, list, bool);
+ list.add("Needs to be within beacon range");
+ list.add("Range is beacon level * 10 + 10");
+ }
+
+ public boolean hasCustomEntity(ItemStack stack) {
+ return true;
+ }
+
+ private static boolean isInBeaconRange(EntityPlayer player) {
+ World world = player.getEntityWorld();
+ if (world.isRemote) {
+ return false;
+ }
+ HashSet<TileEntityBeacon> aBeaconData = sBeaconData.computeIfAbsent(player, k -> new HashSet<>());
+ int chunkXlo = (int) (player.posX - 50) >> 4,
+ chunkXhi = (int) (player.posX + 50) >> 4,
+ chunkZlo = (int) (player.posZ - 50) >> 4,
+ chunkZhi = (int) (player.posZ + 50) >> 4;
+ for (int chunkX = chunkXlo; chunkX < chunkXhi; chunkX++) {
+ for (int chunkZ = chunkZlo; chunkZ < chunkZhi; chunkZ++) {
+ if (!world.getChunkProvider().chunkExists(chunkX, chunkZ)) continue;
+ findSuitableBeacon(
+ player,
+ world.getChunkFromChunkCoords(chunkX, chunkZ)
+ .chunkTileEntityMap
+ .values(),
+ aBeaconData);
+ }
+ }
+ return aBeaconData.size() > 0;
+ }
+
+ private static void findSuitableBeacon(
+ EntityPlayer player, Collection<TileEntity> tileEntities, HashSet<TileEntityBeacon> aBeaconData) {
+ for (TileEntity t : tileEntities) {
+ if (!(t instanceof TileEntityBeacon)) {
+ continue;
+ }
+ TileEntityBeacon beacon = (TileEntityBeacon) t;
+ int level = beacon.getLevels();
+ if (level == 0) {
+ continue;
+ }
+ int radius = (level * 10 + 10);
+ int x = beacon.xCoord;
+ int z = beacon.zCoord;
+ if (player.posX < (x - radius) || player.posX > (x + radius)) {
+ continue;
+ }
+ if (player.posZ < (z - radius) || player.posZ > (z + radius)) {
+ continue;
+ }
+ aBeaconData.add(beacon);
+ }
+ }
+
+ private static void setMayFly(EntityPlayer player, boolean mayFly) {
+ if (player.capabilities.allowFlying == mayFly) {
+ return;
+ }
+ if (!mayFly) {
+ // force the player on the ground then remove ability to fly
+ // this prevent crashing the the ground and dying
+ // when you accidentally get out of the beacon range
+ player.capabilities.isFlying = false;
+ if (player.onGround && player.fallDistance < 1F) {
+ player.capabilities.allowFlying = false;
+ }
+ } else {
+ player.capabilities.allowFlying = true;
+ }
+ player.sendPlayerAbilities();
+ }
+
+ @SubscribeEvent(priority = EventPriority.HIGHEST)
+ public void onPlayerTick(TickEvent.PlayerTickEvent event) {
+ if (event.side != Side.SERVER || event.phase != Phase.END) {
+ return;
+ }
+ EntityPlayer player = event.player;
+ HashSet<TileEntityBeacon> aBeaconData = sBeaconData.get(player);
+ if (aBeaconData != null && !aBeaconData.isEmpty()) {
+ for (Iterator<TileEntityBeacon> iterator = aBeaconData.iterator(); iterator.hasNext(); ) {
+ TileEntityBeacon aBeacon = iterator.next();
+ int level = aBeacon.getLevels();
+ if (level == 0) {
+ iterator.remove();
+ continue;
+ }
+ int radius = (level * 10 + 10);
+ int x = aBeacon.xCoord;
+ int z = aBeacon.zCoord;
+ if (player.posX < (x - radius)
+ || player.posX > (x + radius)
+ || player.posZ < (z - radius)
+ || player.posZ > (z + radius)) {
+ iterator.remove();
+ }
+ }
+ }
+ boolean hasItem = hasItem(player, ModItems.itemMagicFeather);
+ if (!hasItem) {
+ ItemMagicFeather.sPlayerData.remove(player);
+ }
+ MagicFeatherData data = ItemMagicFeather.sPlayerData.get(player);
+ if (data == null) {
+ data = new MagicFeatherData(player);
+ ItemMagicFeather.sPlayerData.put(player, data);
+ }
+ data.onTick();
+ }
+
+ @SubscribeEvent(priority = EventPriority.LOWEST)
+ public void onPlayerDeath(LivingDeathEvent event) {
+ if (event.entityLiving == null) return;
+ EntityLivingBase aEntity = event.entityLiving;
+ if (!(aEntity instanceof EntityPlayer) || aEntity.worldObj == null || aEntity.worldObj.isRemote) return;
+ EntityPlayer aPlayer = (EntityPlayer) aEntity;
+ ItemMagicFeather.sPlayerData.remove(aPlayer);
+ ItemMagicFeather.sBeaconData.remove(aPlayer);
+ }
+
+ private static boolean hasItem(EntityPlayer player, Item item) {
+ for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
+ ItemStack stack = player.inventory.getStackInSlot(i);
+ if (stack != null && stack.getItem() != null && stack.getItem() instanceof ItemMagicFeather) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static class MagicFeatherData {
+
+ private final WeakReference<EntityPlayer> player;
+ private boolean hasItem = false;
+ private int checkTick = 0;
+ private boolean beaconInRangeCache;
+
+ public MagicFeatherData(EntityPlayer player) {
+ this.player = new WeakReference<>(player);
+ this.beaconInRangeCache = player.capabilities.allowFlying;
+ }
+
+ public void onTick() {
+ EntityPlayer player = this.player.get();
+ if (player == null) return;
+ try {
+ boolean hasItem = hasItem(player, ModItems.itemMagicFeather);
+ if (hasItem != this.hasItem) {
+ if (hasItem) {
+ this.onAdd();
+ }
+ if (!hasItem) {
+ this.onRemove();
+ }
+ this.hasItem = hasItem;
+ Logger.INFO("Ticking feather " + hasItem);
+ return;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+
+ if (hasItem) {
+ // only modify if hasItem. Override other flight methods since you are literally holding this item in
+ // your own inventory. You have sent your consent.
+ boolean mayFly = player.capabilities.isCreativeMode || checkBeaconInRange(player);
+ setMayFly(player, mayFly);
+ }
+ }
+
+ private void onAdd() {
+ if (!ItemMagicFeather.isInBeaconRange(getPlayer())) {
+ return;
+ }
+ setMayFly(getPlayer(), true);
+ }
+
+ private void onRemove() {
+ if (getPlayer().capabilities.isCreativeMode) {
+ return;
+ }
+ setMayFly(getPlayer(), false);
+ }
+
+ private boolean checkBeaconInRange(EntityPlayer player) {
+ if (checkTick++ % 40 != 0) {
+ return beaconInRangeCache;
+ }
+ beaconInRangeCache = ItemMagicFeather.isInBeaconRange(player);
+ return beaconInRangeCache;
+ }
+ private EntityPlayer getPlayer() {
+ return player.get();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java b/src/main/java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java
index fa008bf1a3..3ec417e2d6 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.common.Optional;
@@ -11,6 +9,7 @@ import gtPlusPlus.core.handler.events.CustomMovementHandler;
import gtPlusPlus.core.handler.events.SneakManager;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -19,122 +18,128 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-@Optional.InterfaceList(value = {@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"), @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")})
-public class ItemSlowBuildingRing extends Item implements IBauble{
-
- private final String unlocalizedName = "SlowBuildingRing";
- CustomMovementHandler x;
-
- public ItemSlowBuildingRing(){
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setUnlocalizedName(this.unlocalizedName);
- this.setMaxStackSize(1);
- this.setTextureName(CORE.MODID + ":" + "itemSlowBuildersRing");
- ItemUtils.getSimpleStack(this);
- GameRegistry.registerItem(this, this.unlocalizedName);
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_, final boolean p_77663_5_) {
- if (worldObj.isRemote) {
- return;
- }
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return (EnumChatFormatting.YELLOW+"Slow Building Ring"+EnumChatFormatting.GRAY);
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack)
- {
- return false;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("");
- list.add(EnumChatFormatting.GREEN+"Worn as a Ring within Baubles. Prevents you from sprinting."+EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN+"Movement speed reduced to crouch speed."+EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN+"Press shift while worn to toggle crouch on/off."+EnumChatFormatting.GRAY);
- list.add("");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public BaubleType getBaubleType(final ItemStack arg0) {
- return BaubleType.RING;
- }
-
- @Override //TODO
- public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {
- try {
- EntityPlayer aPlayer;
- if (arg1 instanceof EntityPlayer) {
- aPlayer = (EntityPlayer) arg1;
- SneakManager s = SneakManager.get(aPlayer);
- s.putRingOn();
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- @Override //TODO
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {
- try {
- EntityPlayer aPlayer;
- if (arg1 instanceof EntityPlayer) {
- aPlayer = (EntityPlayer) arg1;
- SneakManager s = SneakManager.get(aPlayer);
- s.takeRingOff();
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- @Override //TODO
- public void onWornTick(final ItemStack arg0, final EntityLivingBase arg1) {
- doEffect(arg1);
- }
-
- private static void doEffect(final EntityLivingBase arg1){
- try {
- // Get World
- World aWorld = arg1.worldObj;
- if (aWorld != null && !aWorld.isRemote) {
- EntityPlayer aPlayer;
- if (arg1 instanceof EntityPlayer) {
- aPlayer = (EntityPlayer) arg1;
- SneakManager s = SneakManager.get(aPlayer);
- if (!aPlayer.isSneaking()){
- aPlayer.setSneaking(true);
- }
- if (aPlayer.isSprinting()) {
- aPlayer.setSprinting(false);
- }
- }
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
+@Optional.InterfaceList(
+ value = {
+ @Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"),
+ @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")
+ })
+public class ItemSlowBuildingRing extends Item implements IBauble {
+
+ private final String unlocalizedName = "SlowBuildingRing";
+ CustomMovementHandler x;
+
+ public ItemSlowBuildingRing() {
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setUnlocalizedName(this.unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setTextureName(CORE.MODID + ":" + "itemSlowBuildersRing");
+ ItemUtils.getSimpleStack(this);
+ GameRegistry.registerItem(this, this.unlocalizedName);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World worldObj,
+ final Entity player,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (worldObj.isRemote) {
+ return;
+ }
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return (EnumChatFormatting.YELLOW + "Slow Building Ring" + EnumChatFormatting.GRAY);
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add("");
+ list.add(EnumChatFormatting.GREEN + "Worn as a Ring within Baubles. Prevents you from sprinting."
+ + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN + "Movement speed reduced to crouch speed." + EnumChatFormatting.GRAY);
+ list.add(
+ EnumChatFormatting.GREEN + "Press shift while worn to toggle crouch on/off." + EnumChatFormatting.GRAY);
+ list.add("");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public BaubleType getBaubleType(final ItemStack arg0) {
+ return BaubleType.RING;
+ }
+
+ @Override // TODO
+ public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {
+ try {
+ EntityPlayer aPlayer;
+ if (arg1 instanceof EntityPlayer) {
+ aPlayer = (EntityPlayer) arg1;
+ SneakManager s = SneakManager.get(aPlayer);
+ s.putRingOn();
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ @Override // TODO
+ public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {
+ try {
+ EntityPlayer aPlayer;
+ if (arg1 instanceof EntityPlayer) {
+ aPlayer = (EntityPlayer) arg1;
+ SneakManager s = SneakManager.get(aPlayer);
+ s.takeRingOff();
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ @Override // TODO
+ public void onWornTick(final ItemStack arg0, final EntityLivingBase arg1) {
+ doEffect(arg1);
+ }
+
+ private static void doEffect(final EntityLivingBase arg1) {
+ try {
+ // Get World
+ World aWorld = arg1.worldObj;
+ if (aWorld != null && !aWorld.isRemote) {
+ EntityPlayer aPlayer;
+ if (arg1 instanceof EntityPlayer) {
+ aPlayer = (EntityPlayer) arg1;
+ SneakManager s = SneakManager.get(aPlayer);
+ if (!aPlayer.isSneaking()) {
+ aPlayer.setSneaking(true);
+ }
+ if (aPlayer.isSprinting()) {
+ aPlayer.setSprinting(false);
+ }
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java b/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java
index 0b61a06934..e3b1314e4b 100644
--- a/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java
+++ b/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java
@@ -8,9 +8,18 @@ import net.minecraft.util.EnumChatFormatting;
public class ItemSunnariumBit extends CoreItem {
- public ItemSunnariumBit() {
- super("SunnariumBit", "Sunnarium Bit", AddToCreativeTab.tabMisc, 64, 0, new String[] {}, EnumRarity.uncommon, EnumChatFormatting.GOLD, false, null);
- this.setTextureName(CORE.MODID+":"+"itemSunnariumBit");
- }
-
+ public ItemSunnariumBit() {
+ super(
+ "SunnariumBit",
+ "Sunnarium Bit",
+ AddToCreativeTab.tabMisc,
+ 64,
+ 0,
+ new String[] {},
+ EnumRarity.uncommon,
+ EnumChatFormatting.GOLD,
+ false,
+ null);
+ this.setTextureName(CORE.MODID + ":" + "itemSunnariumBit");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java b/src/main/java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java
index 9feea3c91a..8d5be9f8ec 100644
--- a/src/main/java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java
+++ b/src/main/java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java
@@ -1,7 +1,6 @@
package gtPlusPlus.core.item.general;
import cpw.mods.fml.common.eventhandler.Event;
-
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -12,200 +11,177 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
-
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.FillBucketEvent;
-public class NuclearFuelRodBase extends Item
-{
- /** field for checking if the bucket has been filled. */
- private final Block isFull;
- public NuclearFuelRodBase(final Block p_i45331_1_)
- {
- this.maxStackSize = 1;
- this.isFull = p_i45331_1_;
- this.setCreativeTab(CreativeTabs.tabMisc);
- }
-
- /**
- * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
- */
- @Override
- public ItemStack onItemRightClick(final ItemStack p_77659_1_, final World p_77659_2_, final EntityPlayer p_77659_3_)
- {
- final boolean flag = this.isFull == Blocks.air;
- final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, flag);
-
- if (movingobjectposition == null)
- {
- return p_77659_1_;
- }
- final FillBucketEvent event = new FillBucketEvent(p_77659_3_, p_77659_1_, p_77659_2_, movingobjectposition);
- if (MinecraftForge.EVENT_BUS.post(event))
- {
- return p_77659_1_;
- }
-
- if (event.getResult() == Event.Result.ALLOW)
- {
- if (p_77659_3_.capabilities.isCreativeMode)
- {
- return p_77659_1_;
- }
-
- if (--p_77659_1_.stackSize <= 0)
- {
- return event.result;
- }
-
- if (!p_77659_3_.inventory.addItemStackToInventory(event.result))
- {
- p_77659_3_.dropPlayerItemWithRandomChoice(event.result, false);
- }
-
- return p_77659_1_;
- }
- if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
- {
- int i = movingobjectposition.blockX;
- int j = movingobjectposition.blockY;
- int k = movingobjectposition.blockZ;
-
- if (!p_77659_2_.canMineBlock(p_77659_3_, i, j, k))
- {
- return p_77659_1_;
- }
-
- if (flag)
- {
- if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_))
- {
- return p_77659_1_;
- }
-
- final Material material = p_77659_2_.getBlock(i, j, k).getMaterial();
- final int l = p_77659_2_.getBlockMetadata(i, j, k);
-
- if ((material == Material.water) && (l == 0))
- {
- p_77659_2_.setBlockToAir(i, j, k);
- return this.func_150910_a(p_77659_1_, p_77659_3_, Items.water_bucket);
- }
-
- if ((material == Material.lava) && (l == 0))
- {
- p_77659_2_.setBlockToAir(i, j, k);
- return this.func_150910_a(p_77659_1_, p_77659_3_, Items.lava_bucket);
- }
- }
- else
- {
- if (this.isFull == Blocks.air)
- {
- return new ItemStack(Items.bucket);
- }
-
- if (movingobjectposition.sideHit == 0)
- {
- --j;
- }
-
- if (movingobjectposition.sideHit == 1)
- {
- ++j;
- }
-
- if (movingobjectposition.sideHit == 2)
- {
- --k;
- }
-
- if (movingobjectposition.sideHit == 3)
- {
- ++k;
- }
-
- if (movingobjectposition.sideHit == 4)
- {
- --i;
- }
-
- if (movingobjectposition.sideHit == 5)
- {
- ++i;
- }
-
- if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_))
- {
- return p_77659_1_;
- }
-
- if (this.tryPlaceContainedLiquid(p_77659_2_, i, j, k) && !p_77659_3_.capabilities.isCreativeMode)
- {
- return new ItemStack(Items.bucket);
- }
- }
- }
-
- return p_77659_1_;
- }
-
- private ItemStack func_150910_a(final ItemStack p_150910_1_, final EntityPlayer p_150910_2_, final Item p_150910_3_)
- {
- if (p_150910_2_.capabilities.isCreativeMode)
- {
- return p_150910_1_;
- }
- else if (--p_150910_1_.stackSize <= 0)
- {
- return new ItemStack(p_150910_3_);
- }
- else
- {
- if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_)))
- {
- p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false);
- }
-
- return p_150910_1_;
- }
- }
-
- /**
- * Attempts to place the liquid contained inside the bucket.
- */
- public boolean tryPlaceContainedLiquid(final World p_77875_1_, final int p_77875_2_, final int p_77875_3_, final int p_77875_4_)
- {
- if (this.isFull == Blocks.air)
- {
- return false;
- }
- final Material material = p_77875_1_.getBlock(p_77875_2_, p_77875_3_, p_77875_4_).getMaterial();
- final boolean flag = !material.isSolid();
-
- if (!p_77875_1_.isAirBlock(p_77875_2_, p_77875_3_, p_77875_4_) && !flag)
- {
- return false;
- }
- if (p_77875_1_.provider.isHellWorld && (this.isFull == Blocks.flowing_water))
- {
- p_77875_1_.playSoundEffect(p_77875_2_ + 0.5F, p_77875_3_ + 0.5F, p_77875_4_ + 0.5F, "random.fizz", 0.5F, 2.6F + ((p_77875_1_.rand.nextFloat() - p_77875_1_.rand.nextFloat()) * 0.8F));
-
- for (int l = 0; l < 8; ++l)
- {
- p_77875_1_.spawnParticle("largesmoke", p_77875_2_ + Math.random(), p_77875_3_ + Math.random(), p_77875_4_ + Math.random(), 0.0D, 0.0D, 0.0D);
- }
- }
- else
- {
- if (!p_77875_1_.isRemote && flag && !material.isLiquid())
- {
- p_77875_1_.func_147480_a(p_77875_2_, p_77875_3_, p_77875_4_, true);
- }
-
- p_77875_1_.setBlock(p_77875_2_, p_77875_3_, p_77875_4_, this.isFull, 0, 3);
- }
-
- return true;
- }
-} \ No newline at end of file
+public class NuclearFuelRodBase extends Item {
+ /** field for checking if the bucket has been filled. */
+ private final Block isFull;
+
+ public NuclearFuelRodBase(final Block p_i45331_1_) {
+ this.maxStackSize = 1;
+ this.isFull = p_i45331_1_;
+ this.setCreativeTab(CreativeTabs.tabMisc);
+ }
+
+ /**
+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
+ */
+ @Override
+ public ItemStack onItemRightClick(
+ final ItemStack p_77659_1_, final World p_77659_2_, final EntityPlayer p_77659_3_) {
+ final boolean flag = this.isFull == Blocks.air;
+ final MovingObjectPosition movingobjectposition =
+ this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, flag);
+
+ if (movingobjectposition == null) {
+ return p_77659_1_;
+ }
+ final FillBucketEvent event = new FillBucketEvent(p_77659_3_, p_77659_1_, p_77659_2_, movingobjectposition);
+ if (MinecraftForge.EVENT_BUS.post(event)) {
+ return p_77659_1_;
+ }
+
+ if (event.getResult() == Event.Result.ALLOW) {
+ if (p_77659_3_.capabilities.isCreativeMode) {
+ return p_77659_1_;
+ }
+
+ if (--p_77659_1_.stackSize <= 0) {
+ return event.result;
+ }
+
+ if (!p_77659_3_.inventory.addItemStackToInventory(event.result)) {
+ p_77659_3_.dropPlayerItemWithRandomChoice(event.result, false);
+ }
+
+ return p_77659_1_;
+ }
+ if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
+ int i = movingobjectposition.blockX;
+ int j = movingobjectposition.blockY;
+ int k = movingobjectposition.blockZ;
+
+ if (!p_77659_2_.canMineBlock(p_77659_3_, i, j, k)) {
+ return p_77659_1_;
+ }
+
+ if (flag) {
+ if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_)) {
+ return p_77659_1_;
+ }
+
+ final Material material = p_77659_2_.getBlock(i, j, k).getMaterial();
+ final int l = p_77659_2_.getBlockMetadata(i, j, k);
+
+ if ((material == Material.water) && (l == 0)) {
+ p_77659_2_.setBlockToAir(i, j, k);
+ return this.func_150910_a(p_77659_1_, p_77659_3_, Items.water_bucket);
+ }
+
+ if ((material == Material.lava) && (l == 0)) {
+ p_77659_2_.setBlockToAir(i, j, k);
+ return this.func_150910_a(p_77659_1_, p_77659_3_, Items.lava_bucket);
+ }
+ } else {
+ if (this.isFull == Blocks.air) {
+ return new ItemStack(Items.bucket);
+ }
+
+ if (movingobjectposition.sideHit == 0) {
+ --j;
+ }
+
+ if (movingobjectposition.sideHit == 1) {
+ ++j;
+ }
+
+ if (movingobjectposition.sideHit == 2) {
+ --k;
+ }
+
+ if (movingobjectposition.sideHit == 3) {
+ ++k;
+ }
+
+ if (movingobjectposition.sideHit == 4) {
+ --i;
+ }
+
+ if (movingobjectposition.sideHit == 5) {
+ ++i;
+ }
+
+ if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_)) {
+ return p_77659_1_;
+ }
+
+ if (this.tryPlaceContainedLiquid(p_77659_2_, i, j, k) && !p_77659_3_.capabilities.isCreativeMode) {
+ return new ItemStack(Items.bucket);
+ }
+ }
+ }
+
+ return p_77659_1_;
+ }
+
+ private ItemStack func_150910_a(
+ final ItemStack p_150910_1_, final EntityPlayer p_150910_2_, final Item p_150910_3_) {
+ if (p_150910_2_.capabilities.isCreativeMode) {
+ return p_150910_1_;
+ } else if (--p_150910_1_.stackSize <= 0) {
+ return new ItemStack(p_150910_3_);
+ } else {
+ if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) {
+ p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false);
+ }
+
+ return p_150910_1_;
+ }
+ }
+
+ /**
+ * Attempts to place the liquid contained inside the bucket.
+ */
+ public boolean tryPlaceContainedLiquid(
+ final World p_77875_1_, final int p_77875_2_, final int p_77875_3_, final int p_77875_4_) {
+ if (this.isFull == Blocks.air) {
+ return false;
+ }
+ final Material material =
+ p_77875_1_.getBlock(p_77875_2_, p_77875_3_, p_77875_4_).getMaterial();
+ final boolean flag = !material.isSolid();
+
+ if (!p_77875_1_.isAirBlock(p_77875_2_, p_77875_3_, p_77875_4_) && !flag) {
+ return false;
+ }
+ if (p_77875_1_.provider.isHellWorld && (this.isFull == Blocks.flowing_water)) {
+ p_77875_1_.playSoundEffect(
+ p_77875_2_ + 0.5F,
+ p_77875_3_ + 0.5F,
+ p_77875_4_ + 0.5F,
+ "random.fizz",
+ 0.5F,
+ 2.6F + ((p_77875_1_.rand.nextFloat() - p_77875_1_.rand.nextFloat()) * 0.8F));
+
+ for (int l = 0; l < 8; ++l) {
+ p_77875_1_.spawnParticle(
+ "largesmoke",
+ p_77875_2_ + Math.random(),
+ p_77875_3_ + Math.random(),
+ p_77875_4_ + Math.random(),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ } else {
+ if (!p_77875_1_.isRemote && flag && !material.isLiquid()) {
+ p_77875_1_.func_147480_a(p_77875_2_, p_77875_3_, p_77875_4_, true);
+ }
+
+ p_77875_1_.setBlock(p_77875_2_, p_77875_3_, p_77875_4_, this.isFull, 0, 3);
+ }
+
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java b/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java
index 5ff5b5a62b..d5c606b964 100644
--- a/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java
+++ b/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java
@@ -1,13 +1,18 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import cofh.api.energy.ItemEnergyContainer;
import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -19,297 +24,295 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import ic2.api.item.ElectricItem;
-import ic2.api.item.IElectricItem;
-import ic2.api.item.IElectricItemManager;
-
-public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, IElectricItemManager, IFuelHandler{
-
- public static double rfPerEU = 3.4;
- private final String unlocalizedName = "rfEUBattery";
- private final ItemStack thisStack;
- private final static int maxValueEU = 100000000;
- private final static int maxValueRF = (int) (maxValueEU * rfPerEU);
- protected double chargeEU = 0;
-
- public RF2EU_Battery(){
- super(maxValueRF);
- GameRegistry.registerFuelHandler(this);
- //this.setMaxDamage(Integer.MAX_VALUE);
- //this.setDamage(UtilsItems.getSimpleStack(this), 0);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setUnlocalizedName(this.unlocalizedName);
- this.setMaxStackSize(1);
- this.setTextureName(CORE.MODID + ":" + "itemIngot");
- this.thisStack = ItemUtils.getSimpleStack(this);
- GameRegistry.registerItem(this, this.unlocalizedName);
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_, final boolean p_77663_5_) {
- this.getEnergyStored(itemStack);
- if (worldObj.isRemote) {
- return;
- }
-
- if (player instanceof EntityPlayer){
- for (final ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
- if (is == itemStack) {
- continue;
- }
- if (is != null) {
- if (is.getItem() instanceof IElectricItem) {
- final IElectricItem electricItem = (IElectricItem) is.getItem();
- this.chargeEU = ElectricItem.manager.getCharge(is);
- }
-
- }
- }
- }
-
-
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
- return true;
- }
-
- @Override
- public Item getChargedItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(maxValueEU);
- return x.getItem();
- }
-
- @Override
- public Item getEmptyItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(0);
- return x.getItem();
- }
-
- @Override
- public double getMaxCharge(final ItemStack itemStack) {
- return maxValueEU;
- }
-
- @Override
- public int getTier(final ItemStack itemStack) {
- return 3;
- }
-
- @Override
- public double getTransferLimit(final ItemStack itemStack) {
- return 8196;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return ("Universally Chargeable Battery");
- }
-
- @Override
- public double getDurabilityForDisplay(final ItemStack stack)
- {
- //return 1.0D - getEnergyStored(stack) / this.capacity;
- return MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(final ItemStack par1ItemStack, final int par2)
- {
- final int i = 30;
-
- final float f13 = (((Minecraft.getSystemTime() % 6000L) / 3000.0F) * CORE.PI * 2.0F);
-
- final float t = 0.9F + (0.1F * MathHelper.cos(f13));
-
- final double v = 1.0D - this.getDurabilityForDisplay(par1ItemStack);
-
- int r = i + (int)(v * (255 - i) * t);
- if (r > 255) {
- r = 255;
- }
- final int g = i + (int)(v * (64 - i) * t);
-
- return (r << 16) | (g << 8) | i;
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack)
- {
- return false;
- }
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.YELLOW+"IC2/EU Information"+EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+this.getTier(this.thisStack)+EnumChatFormatting.GRAY+"] Current Power: ["+EnumChatFormatting.YELLOW+(long) this.getCharge(stack)+EnumChatFormatting.GRAY+"/EU]");
- list.add(EnumChatFormatting.GRAY+"Transfer Limit: ["+EnumChatFormatting.YELLOW+this.getTransferLimit(this.thisStack)+ EnumChatFormatting.GRAY +"Eu/t]" +"Burn Time: ["+EnumChatFormatting.YELLOW+(this.getBurnTime(stack)/20)+EnumChatFormatting.GRAY+"s]");
- list.add("");
- list.add(EnumChatFormatting.RED+"RF Information");
- list.add(EnumChatFormatting.GRAY+"Extraction Rate: [" +EnumChatFormatting.RED+ this.maxExtract + EnumChatFormatting.GRAY + "Rf/t]" + " Insert Rate: [" +EnumChatFormatting.RED+ this.maxReceive+EnumChatFormatting.GRAY+"Rf/t]");
- list.add(EnumChatFormatting.GRAY+"Current Charge: ["+EnumChatFormatting.RED+this.getEnergyStored(stack) + EnumChatFormatting.GRAY + "Rf / " + this.getMaxEnergyStored(stack)+"Rf] "+EnumChatFormatting.RED+MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack))+EnumChatFormatting.GRAY+"%");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public ItemStack getContainerItem(final ItemStack itemStack)
- {
- final ItemStack newItem = itemStack.copy();
- newItem.stackSize = 1;
- this.extractEnergy(newItem, 150000, false);
- return newItem;
- }
-
- @Override
- public boolean hasContainerItem(final ItemStack stack)
- {
- return true;
- }
-
- @Override
- public int getBurnTime(final ItemStack fuel) {
- if ((fuel == null) || (fuel.getItem() != this)) {
- return 0;
- }
- return this.extractEnergy(fuel, 150000, true) / 50 / 100;
- }
-
- @Override
- public double charge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean simulate) {
- if (stack.stackTagCompound == null) {
- stack.stackTagCompound = new NBTTagCompound();
- }
- int energy = stack.stackTagCompound.getInteger("Energy");
- final int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, this.maxReceive));
- if (!simulate)
- {
- energy += energyReceived;
- stack.stackTagCompound.setInteger("Energy", energy);
- ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
- ElectricItem.manager.charge(stack, energy/rfPerEU, 3, true, false);
-
- }
- return ElectricItem.manager.charge(stack, amount, tier, ignoreTransferLimit, simulate);
- }
-
- @Override
- public double discharge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) {
- if ((stack.stackTagCompound == null) || (!stack.stackTagCompound.hasKey("Energy"))) {
- final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
- if ((euCharge != 0) && (euCharge >= 1)){
- return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
- }
- return 0;
- }
- int energy = stack.stackTagCompound.getInteger("Energy");
- final int energyExtracted = Math.min(energy, Math.min(this.maxExtract, this.maxExtract));
- if (!simulate)
- {
- energy -= energyExtracted;
- stack.stackTagCompound.setInteger("Energy", energy);
- ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
- ElectricItem.manager.charge(stack, energy/rfPerEU, 3, true, false);
- }
-
- return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }
-
- @Override
- public double getCharge(final ItemStack stack) {
- return ElectricItem.manager.getCharge(stack);
- }
-
- @Override
- public boolean canUse(final ItemStack stack, final double amount) {
- return ElectricItem.manager.canUse(stack, amount);
- }
-
- @Override
- public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
- return ElectricItem.manager.use(stack, amount, entity);
- }
-
- @Override
- public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
- ElectricItem.manager.chargeFromArmor(stack, entity);
- }
-
- @Override
- public String getToolTip(final ItemStack stack) {
- return ElectricItem.manager.getToolTip(stack);
- }
-
- @Override
- public int receiveEnergy(final ItemStack container, final int maxReceive, final boolean simulate)
- {
- if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
- final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
- if ((euCharge != 0) && (euCharge >= 1)){
- return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
- }
- return 0;
- }
- int energy = container.stackTagCompound.getInteger("Energy");
- final int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, maxReceive));
- if (!simulate)
- {
- energy += energyReceived;
- container.stackTagCompound.setInteger("Energy", energy);
- ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
- ElectricItem.manager.charge(container, energy/rfPerEU, 3, true, false);
-
- }
- return energyReceived;
- }
-
- @Override
- public int extractEnergy(final ItemStack container, final int maxExtract, final boolean simulate)
- {
- if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
- final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
- if ((euCharge != 0) && (euCharge >= 1)){
- return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
- }
- return 0;
- }
- int energy = container.stackTagCompound.getInteger("Energy");
- final int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
- if (!simulate)
- {
- energy -= energyExtracted;
- container.stackTagCompound.setInteger("Energy", energy);
- ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
- ElectricItem.manager.charge(container, energy/rfPerEU, 3, true, false);
- }
- return energyExtracted;
- }
-
- @Override
- public int getEnergyStored(final ItemStack container)
- {
- if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
- final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
- if ((euCharge != 0) && (euCharge >= 1)){
- return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
- }
- return 0;
- }
- final int energy = container.stackTagCompound.getInteger("Energy");
- ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
- ElectricItem.manager.charge(container, energy/rfPerEU, 3, true, false);
- return energy;
- }
-
+public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, IElectricItemManager, IFuelHandler {
+
+ public static double rfPerEU = 3.4;
+ private final String unlocalizedName = "rfEUBattery";
+ private final ItemStack thisStack;
+ private static final int maxValueEU = 100000000;
+ private static final int maxValueRF = (int) (maxValueEU * rfPerEU);
+ protected double chargeEU = 0;
+
+ public RF2EU_Battery() {
+ super(maxValueRF);
+ GameRegistry.registerFuelHandler(this);
+ // this.setMaxDamage(Integer.MAX_VALUE);
+ // this.setDamage(UtilsItems.getSimpleStack(this), 0);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setUnlocalizedName(this.unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setTextureName(CORE.MODID + ":" + "itemIngot");
+ this.thisStack = ItemUtils.getSimpleStack(this);
+ GameRegistry.registerItem(this, this.unlocalizedName);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World worldObj,
+ final Entity player,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ this.getEnergyStored(itemStack);
+ if (worldObj.isRemote) {
+ return;
+ }
+
+ if (player instanceof EntityPlayer) {
+ for (final ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
+ if (is == itemStack) {
+ continue;
+ }
+ if (is != null) {
+ if (is.getItem() instanceof IElectricItem) {
+ final IElectricItem electricItem = (IElectricItem) is.getItem();
+ this.chargeEU = ElectricItem.manager.getCharge(is);
+ }
+ }
+ }
+ }
+
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean canProvideEnergy(final ItemStack itemStack) {
+ return true;
+ }
+
+ @Override
+ public Item getChargedItem(final ItemStack itemStack) {
+ final ItemStack x = itemStack.copy();
+ x.setItemDamage(maxValueEU);
+ return x.getItem();
+ }
+
+ @Override
+ public Item getEmptyItem(final ItemStack itemStack) {
+ final ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
+ }
+
+ @Override
+ public double getMaxCharge(final ItemStack itemStack) {
+ return maxValueEU;
+ }
+
+ @Override
+ public int getTier(final ItemStack itemStack) {
+ return 3;
+ }
+
+ @Override
+ public double getTransferLimit(final ItemStack itemStack) {
+ return 8196;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+
+ return ("Universally Chargeable Battery");
+ }
+
+ @Override
+ public double getDurabilityForDisplay(final ItemStack stack) {
+ // return 1.0D - getEnergyStored(stack) / this.capacity;
+ return MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(final ItemStack par1ItemStack, final int par2) {
+ final int i = 30;
+
+ final float f13 = (((Minecraft.getSystemTime() % 6000L) / 3000.0F) * CORE.PI * 2.0F);
+
+ final float t = 0.9F + (0.1F * MathHelper.cos(f13));
+
+ final double v = 1.0D - this.getDurabilityForDisplay(par1ItemStack);
+
+ int r = i + (int) (v * (255 - i) * t);
+ if (r > 255) {
+ r = 255;
+ }
+ final int g = i + (int) (v * (64 - i) * t);
+
+ return (r << 16) | (g << 8) | i;
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.YELLOW + "IC2/EU Information" + EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY + "Tier: [" + EnumChatFormatting.YELLOW + this.getTier(this.thisStack)
+ + EnumChatFormatting.GRAY + "] Current Power: [" + EnumChatFormatting.YELLOW
+ + (long) this.getCharge(stack) + EnumChatFormatting.GRAY + "/EU]");
+ list.add(EnumChatFormatting.GRAY + "Transfer Limit: [" + EnumChatFormatting.YELLOW
+ + this.getTransferLimit(this.thisStack) + EnumChatFormatting.GRAY + "Eu/t]" + "Burn Time: ["
+ + EnumChatFormatting.YELLOW + (this.getBurnTime(stack) / 20) + EnumChatFormatting.GRAY + "s]");
+ list.add("");
+ list.add(EnumChatFormatting.RED + "RF Information");
+ list.add(EnumChatFormatting.GRAY + "Extraction Rate: [" + EnumChatFormatting.RED + this.maxExtract
+ + EnumChatFormatting.GRAY + "Rf/t]" + " Insert Rate: [" + EnumChatFormatting.RED + this.maxReceive
+ + EnumChatFormatting.GRAY + "Rf/t]");
+ list.add(EnumChatFormatting.GRAY + "Current Charge: [" + EnumChatFormatting.RED + this.getEnergyStored(stack)
+ + EnumChatFormatting.GRAY + "Rf / " + this.getMaxEnergyStored(stack) + "Rf] " + EnumChatFormatting.RED
+ + MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack))
+ + EnumChatFormatting.GRAY + "%");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public ItemStack getContainerItem(final ItemStack itemStack) {
+ final ItemStack newItem = itemStack.copy();
+ newItem.stackSize = 1;
+ this.extractEnergy(newItem, 150000, false);
+ return newItem;
+ }
+
+ @Override
+ public boolean hasContainerItem(final ItemStack stack) {
+ return true;
+ }
+
+ @Override
+ public int getBurnTime(final ItemStack fuel) {
+ if ((fuel == null) || (fuel.getItem() != this)) {
+ return 0;
+ }
+ return this.extractEnergy(fuel, 150000, true) / 50 / 100;
+ }
+
+ @Override
+ public double charge(
+ final ItemStack stack,
+ final double amount,
+ final int tier,
+ final boolean ignoreTransferLimit,
+ final boolean simulate) {
+ if (stack.stackTagCompound == null) {
+ stack.stackTagCompound = new NBTTagCompound();
+ }
+ int energy = stack.stackTagCompound.getInteger("Energy");
+ final int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, this.maxReceive));
+ if (!simulate) {
+ energy += energyReceived;
+ stack.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
+ ElectricItem.manager.charge(stack, energy / rfPerEU, 3, true, false);
+ }
+ return ElectricItem.manager.charge(stack, amount, tier, ignoreTransferLimit, simulate);
+ }
+
+ @Override
+ public double discharge(
+ final ItemStack stack,
+ final double amount,
+ final int tier,
+ final boolean ignoreTransferLimit,
+ final boolean externally,
+ final boolean simulate) {
+ if ((stack.stackTagCompound == null) || (!stack.stackTagCompound.hasKey("Energy"))) {
+ final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
+ if ((euCharge != 0) && (euCharge >= 1)) {
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge * rfPerEU));
+ }
+ return 0;
+ }
+ int energy = stack.stackTagCompound.getInteger("Energy");
+ final int energyExtracted = Math.min(energy, Math.min(this.maxExtract, this.maxExtract));
+ if (!simulate) {
+ energy -= energyExtracted;
+ stack.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
+ ElectricItem.manager.charge(stack, energy / rfPerEU, 3, true, false);
+ }
+
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ @Override
+ public double getCharge(final ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
+ }
+
+ @Override
+ public boolean canUse(final ItemStack stack, final double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
+ }
+
+ @Override
+ public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
+ }
+
+ @Override
+ public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
+ }
+
+ @Override
+ public String getToolTip(final ItemStack stack) {
+ return ElectricItem.manager.getToolTip(stack);
+ }
+
+ @Override
+ public int receiveEnergy(final ItemStack container, final int maxReceive, final boolean simulate) {
+ if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
+ final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
+ if ((euCharge != 0) && (euCharge >= 1)) {
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge * rfPerEU));
+ }
+ return 0;
+ }
+ int energy = container.stackTagCompound.getInteger("Energy");
+ final int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, maxReceive));
+ if (!simulate) {
+ energy += energyReceived;
+ container.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
+ ElectricItem.manager.charge(container, energy / rfPerEU, 3, true, false);
+ }
+ return energyReceived;
+ }
+
+ @Override
+ public int extractEnergy(final ItemStack container, final int maxExtract, final boolean simulate) {
+ if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
+ final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
+ if ((euCharge != 0) && (euCharge >= 1)) {
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge * rfPerEU));
+ }
+ return 0;
+ }
+ int energy = container.stackTagCompound.getInteger("Energy");
+ final int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
+ if (!simulate) {
+ energy -= energyExtracted;
+ container.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
+ ElectricItem.manager.charge(container, energy / rfPerEU, 3, true, false);
+ }
+ return energyExtracted;
+ }
+
+ @Override
+ public int getEnergyStored(final ItemStack container) {
+ if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
+ final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
+ if ((euCharge != 0) && (euCharge >= 1)) {
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge * rfPerEU));
+ }
+ return 0;
+ }
+ final int energy = container.stackTagCompound.getInteger("Energy");
+ ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
+ ElectricItem.manager.charge(container, energy / rfPerEU, 3, true, false);
+ return energy;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/books/ItemBaseBook.java b/src/main/java/gtPlusPlus/core/item/general/books/ItemBaseBook.java
index 9be6a0fda5..c71dc5b9e3 100644
--- a/src/main/java/gtPlusPlus/core/item/general/books/ItemBaseBook.java
+++ b/src/main/java/gtPlusPlus/core/item/general/books/ItemBaseBook.java
@@ -3,14 +3,18 @@ package gtPlusPlus.core.item.general.books;
import static gtPlusPlus.core.handler.BookHandler.mBookMap;
import static gtPlusPlus.core.util.Utils.addBookTitleLocalization;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.handler.BookHandler;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.NBTUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.creativetab.CreativeTabs;
@@ -21,111 +25,102 @@ import net.minecraft.item.ItemWritableBook;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
+public class ItemBaseBook extends ItemWritableBook {
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.handler.BookHandler;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
+ public ItemBaseBook() {
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setMaxStackSize(1);
+ this.setTextureName(CORE.MODID + ":" + "itemBook");
+ this.setUnlocalizedName("itembookgt");
+ GameRegistry.registerItem(this, "bookGT");
+ }
+
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < BookHandler.mBookMap.size(); i++) {
+ ItemStack bookstack = new ItemStack(item, 1, i);
-public class ItemBaseBook extends ItemWritableBook{
+ /*bookstack = Utils.getWrittenBook(
+ bookstack,
+ i,
+ mBookMap.get(i).mMapping,
+ mBookMap.get(i).mTitle,
+ mBookMap.get(i).mAuthor,
+ mBookMap.get(i).mPages);*/
- public ItemBaseBook(){
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setMaxStackSize(1);
- this.setTextureName(CORE.MODID+":"+"itemBook");
- this.setUnlocalizedName("itembookgt");
- GameRegistry.registerItem(this, "bookGT");
-
- }
+ NBTUtils.createIntegerTagCompound(bookstack, "stats", "mMeta", i);
+ list.add(bookstack);
+ }
+ }
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < BookHandler.mBookMap.size(); i ++) {
- ItemStack bookstack = new ItemStack(item, 1, i);
-
- /*bookstack = Utils.getWrittenBook(
- bookstack,
- i,
- mBookMap.get(i).mMapping,
- mBookMap.get(i).mTitle,
- mBookMap.get(i).mAuthor,
- mBookMap.get(i).mPages);*/
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ if (NBTUtils.hasKey(tItem, "title")) {
+ return NBTUtils.getString(tItem, "title");
+ } else if (tItem.getItemDamage() > -1 && tItem.getItemDamage() <= mBookMap.size()) {
+ return EnumChatFormatting.ITALIC + ""
+ + addBookTitleLocalization(mBookMap.get(tItem.getItemDamage()).mTitle);
+ }
+ // NBTUtils.tryIterateNBTData(tItem);
+ return "GT++ Storybook";
+ }
- NBTUtils.createIntegerTagCompound(bookstack, "stats", "mMeta", i);
- list.add(bookstack);
- }
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- if (NBTUtils.hasKey(tItem, "title")){
- return NBTUtils.getString(tItem, "title");
- }
- else if (tItem.getItemDamage() > -1 && tItem.getItemDamage() <= mBookMap.size()){
- return EnumChatFormatting.ITALIC + "" + addBookTitleLocalization(mBookMap.get(tItem.getItemDamage()).mTitle);
- }
- //NBTUtils.tryIterateNBTData(tItem);
- return "GT++ Storybook";
- }
+ @Override
+ public void addInformation(ItemStack tItem, EntityPlayer player, List list, boolean bool) {
+ // TODO Auto-generated method stub
+ if (NBTUtils.hasKey(tItem, "author")) {
+ list.add(EnumChatFormatting.GRAY + "Author: " + NBTUtils.getString(tItem, "author"));
+ } else if (mBookMap.get(tItem.getItemDamage()).mAuthor != null) {
+ list.add(EnumChatFormatting.WHITE + "Author: " + mBookMap.get(tItem.getItemDamage()).mAuthor);
+ }
+ if (NBTUtils.hasKey(tItem, "title")) {
+ list.add(EnumChatFormatting.GRAY + "Pages: " + NBTUtils.getString(tItem, "pages"));
+ } else if (mBookMap.get(tItem.getItemDamage()).mPages != null) {
+ list.add(EnumChatFormatting.WHITE + "Pages: " + mBookMap.get(tItem.getItemDamage()).mPages.length);
+ }
+ // super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
+ }
- @Override
- public void addInformation(ItemStack tItem, EntityPlayer player, List list, boolean bool) {
- // TODO Auto-generated method stub
- if (NBTUtils.hasKey(tItem, "author")){
- list.add(EnumChatFormatting.GRAY+"Author: "+NBTUtils.getString(tItem, "author"));
- }
- else if (mBookMap.get(tItem.getItemDamage()).mAuthor != null){
- list.add(EnumChatFormatting.WHITE+"Author: "+mBookMap.get(tItem.getItemDamage()).mAuthor);
- }
- if (NBTUtils.hasKey(tItem, "title")){
- list.add(EnumChatFormatting.GRAY+"Pages: "+NBTUtils.getString(tItem, "pages"));
- }
- else if (mBookMap.get(tItem.getItemDamage()).mPages != null){
- list.add(EnumChatFormatting.WHITE+"Pages: "+mBookMap.get(tItem.getItemDamage()).mPages.length);
- }
- //super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
- }
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
- @Override
- public boolean isRepairable() {
- return false;
- }
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
+ // player.displayGUIBook(item);
+ int i = item.getItemDamage();
+ ItemStack bookstack = Utils.getWrittenBook(
+ null,
+ mBookMap.get(i).mMeta,
+ mBookMap.get(i).mMapping,
+ mBookMap.get(i).mTitle,
+ mBookMap.get(i).mAuthor,
+ mBookMap.get(i).mPages);
- @Override
- @SideOnly(Side.CLIENT)
- public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
- //player.displayGUIBook(item);
- int i = item.getItemDamage();
- ItemStack bookstack = Utils.getWrittenBook(
- null,
- mBookMap.get(i).mMeta,
- mBookMap.get(i).mMapping,
- mBookMap.get(i).mTitle,
- mBookMap.get(i).mAuthor,
- mBookMap.get(i).mPages);
-
- if (player.worldObj.isRemote){
- try {
- Class<?> clazz = ReflectionUtils.getClass("net.minecraft.client.gui.GuiScreenBook");
- Constructor<?> ctor = clazz.getConstructor(EntityPlayer.class, ItemStack.class, boolean.class);
- Object object = ctor.newInstance(new Object[] { player, bookstack, false });
- Minecraft.getMinecraft().displayGuiScreen((GuiScreen) object);
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- //Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(player, bookstack, false));
- }
+ if (player.worldObj.isRemote) {
+ try {
+ Class<?> clazz = ReflectionUtils.getClass("net.minecraft.client.gui.GuiScreenBook");
+ Constructor<?> ctor = clazz.getConstructor(EntityPlayer.class, ItemStack.class, boolean.class);
+ Object object = ctor.newInstance(new Object[] {player, bookstack, false});
+ Minecraft.getMinecraft().displayGuiScreen((GuiScreen) object);
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException
+ | NoSuchMethodException
+ | SecurityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(player, bookstack, false));
+ }
return item;
- }
-
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java b/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java
index a95fab4b6c..382765b015 100644
--- a/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java
+++ b/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java
@@ -1,18 +1,6 @@
package gtPlusPlus.core.item.general.capture;
-import java.util.List;
-import java.util.UUID;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.entity.*;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-
import gtPlusPlus.api.interfaces.IEntityCatcher;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.BlockPos;
@@ -22,225 +10,240 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.NBTUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.List;
+import java.util.UUID;
+import net.minecraft.entity.*;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
public class ItemEntityCatcher extends Item implements IEntityCatcher {
- // PlayerInteractEvent.EntityInteract;
-
-
- public ItemEntityCatcher() {
- //Probably won't ever need this event handler.
- //Utils.registerEvent(this);
- this.setUnlocalizedName("itemDragonJar");
- this.setTextureName(CORE.MODID + ":" + getUnlocalizedName());
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setMaxStackSize(16);
- this.setMaxDamage(0);
- GameRegistry.registerItem(this, getUnlocalizedName());
- }
-
- @Override
- public boolean hasEntity(ItemStack aStack) {
- if (NBTUtils.hasKey(aStack, "mHasEntity")) {
- return NBTUtils.getBoolean(aStack, "mHasEntity");
- }
- return false;
- }
-
- @Override
- public Entity getStoredEntity(World aWorld, ItemStack aStack) {
- if (aStack == null || !hasEntity(aStack)) {
- Logger.INFO("Cannot get stored entity.");
- return null;
- }
-
- Entity mEntityToSpawn;
- int mEntityID;
- Logger.WARNING("getStoredEntity(1)");
-
- mEntityID = NBTUtils.getInteger(aStack, "mEntityID");
- mEntityToSpawn = EntityList.createEntityByID(mEntityID, aWorld);
- if (mEntityToSpawn != null) {
- Logger.WARNING("getStoredEntity(2)");
- return mEntityToSpawn;
- }
-
- Logger.INFO("Failed to get stored entity. - getStoredEntity()");
- return null;
- }
-
- @Override
- public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity) {
- if (aEntity == null) {
- NBTUtils.setBoolean(aStack, "mHasEntity", false);
- Logger.INFO("Bad Entity being stored.");
- return false;
- }
-
- Logger.WARNING("setStoredEntity(1)");
-
- NBTTagCompound mEntityData;
- Class<? extends Entity> mEntityClass;
- String mClassName;
- String mEntityName;
- int mEntityID, mEntityHashcode;
- UUID mUuidPersistent, mUuidUnique;
- Logger.WARNING("setStoredEntity(2)");
-
- mEntityData = aEntity.getEntityData();
- mEntityClass = aEntity.getClass();
- mClassName = mEntityClass.getName();
- mEntityName = aEntity.getCommandSenderName();
- // mEntityID = aEntity.getEntityId();
- mEntityID = EntityList.getEntityID(aEntity);
- mEntityHashcode = aEntity.hashCode();
- mUuidPersistent = aEntity.getPersistentID();
- mUuidUnique = aEntity.getUniqueID();
- Logger.WARNING("setStoredEntity(3)");
-
- NBTUtils.createTagCompound(aStack, "mEntityData", mEntityData);
- NBTUtils.setString(aStack,"mEntityName", mEntityName);
- NBTUtils.setInteger(aStack,"mEntityID", mEntityID);
- NBTUtils.setString(aStack,"mClassName", mClassName);
- NBTUtils.setString(aStack,"mUuidPersistent", mUuidPersistent.toString());
- NBTUtils.setString(aStack,"mUuidUnique", mUuidUnique.toString());
- NBTUtils.setInteger(aStack,"mEntityHashcode", mEntityHashcode);
- NBTUtils.setBoolean(aStack,"mHasEntity", true);
- Logger.WARNING("setStoredEntity(4)");
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Entity> getStoredEntityClass(ItemStack aStack) {
- if (aStack == null || !hasEntity(aStack)) {
- return null;
- }
- Class<? extends Entity> mEntityClass;
- String mClassName;
- mClassName = NBTUtils.getString(aStack, "mClassName");
- mEntityClass = (Class<? extends Entity>) ReflectionUtils.getClass(mClassName);
- if (mEntityClass != null) {
- return mEntityClass;
- }
- return null;
- }
-
- @Override
- public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos) {
- if (aStack == null || !hasEntity(aStack)) {
- Logger.INFO("Cannot release, either invalid Itemstack or no entity stored.");
- return false;
- }
-
- NBTTagCompound mEntityData = NBTUtils.getTagCompound(aStack, "mEntityData");
-
- int mEntityID = NBTUtils.getInteger(aStack,"mEntityID");
- String mClassName = NBTUtils.getString(aStack,"mClassName");
- UUID mUuidPersistent = UUID.fromString(NBTUtils.getString(aStack,"mUuidPersistent"));
- UUID mUuidUnique = UUID.fromString(NBTUtils.getString(aStack,"mUuidUnique"));
- int mEntityHashcode = NBTUtils.getInteger(aStack,"mEntityHashcode");
-
- EntityLiving mEntityToSpawn = (EntityLiving) getStoredEntity(aWorld, aStack);
- Class<? extends Entity> mEntityClass = getStoredEntityClass(aStack);
-
- Logger.WARNING("spawnStoredEntity(1)");
-
- if (mEntityToSpawn != null && mEntityClass != null) {
- Logger.WARNING("spawnStoredEntity(2)");
- if (mEntityToSpawn.getEntityData() != mEntityData) {
- Logger.WARNING("spawnStoredEntity(x)");
- NBTUtils.setEntityCustomData(mEntityToSpawn, mEntityData);
- }
-
- mEntityToSpawn.setLocationAndAngles(aPos.xPos, aPos.yPos, aPos.zPos, aWorld.rand.nextFloat() * 360.0F,
- 0.0F);
- if (mEntityToSpawn != null) {
- mEntityToSpawn.onSpawnWithEgg(null);
- aWorld.spawnEntityInWorld(mEntityToSpawn);
- Logger.WARNING("spawnStoredEntity(3)");
- }
- if (mEntityToSpawn != null) {
- mEntityToSpawn.playLivingSound();
- Logger.WARNING("spawnStoredEntity(4)");
- }
- Logger.WARNING("spawnStoredEntity(5)");
- NBTUtils.setBoolean(aStack,"mHasEntity", false);
- return true;
- }
- Logger.INFO("Failed to spawn stored entity. - spawnStoredEntity()");
- return false;
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- return super.onItemRightClick(aStack, aWorld, aPlayer);
- }
-
- @Override
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
- if (hasEntity(p_77624_1_)){
- String mName = NBTUtils.getString(p_77624_1_,"mEntityName");
- if (mName != null && !mName.equals("")){
- p_77624_3_.add(EnumChatFormatting.GRAY+"Contains a "+mName+".");
- }
- }
- else {
- p_77624_3_.add(EnumChatFormatting.GRAY+"Does not contain anything.");
- }
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side,
- float xOffset, float yOffset, float zOffset) {
- if (Utils.isServer()) {
- Logger.WARNING("Trying to release (1)");
- if (NBTUtils.hasKey(itemstack,"mHasEntity")
- && NBTUtils.getBoolean(itemstack,"mHasEntity")) {
- Logger.WARNING("Trying to release (2)");
- boolean mDidSpawn = spawnStoredEntity(world, itemstack, new BlockPos(x, y+1, z, world));
-
- if (!mDidSpawn){
- PlayerUtils.messagePlayer(player, "You failed to release a "+NBTUtils.getString(itemstack,"mEntityName")+".");
- }
-
- return mDidSpawn;
-
- }
- }
- return super.onItemUse(itemstack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
-
- }
-
- @Override
- public boolean itemInteractionForEntity(ItemStack aStack, EntityPlayer aPlayer, EntityLivingBase aEntity) {
- if (Utils.isServer()) {
- Logger.WARNING("Trying to catch (1)");
- if (!hasEntity(aStack)) {
- Logger.WARNING("Trying to catch (2)");
- boolean mStored = setStoredEntity(aPlayer.worldObj, aStack, aEntity);
- if (mStored) {
- Logger.WARNING("Trying to catch (3)");
- aEntity.setDead();
- PlayerUtils.messagePlayer(aPlayer, "You have captured a "+NBTUtils.getString(aStack,"mEntityName")+" in the Jar.");
- //NBTUtils.tryIterateNBTData(aStack);
- }
- }
- }
- return super.itemInteractionForEntity(aStack, aPlayer, aEntity);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- if (hasEntity(aStack)){
- return "Captured Dragon Jar";
- }
- return "Dragon Capture Jar";
- }
-
+ // PlayerInteractEvent.EntityInteract;
+
+ public ItemEntityCatcher() {
+ // Probably won't ever need this event handler.
+ // Utils.registerEvent(this);
+ this.setUnlocalizedName("itemDragonJar");
+ this.setTextureName(CORE.MODID + ":" + getUnlocalizedName());
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setMaxStackSize(16);
+ this.setMaxDamage(0);
+ GameRegistry.registerItem(this, getUnlocalizedName());
+ }
+
+ @Override
+ public boolean hasEntity(ItemStack aStack) {
+ if (NBTUtils.hasKey(aStack, "mHasEntity")) {
+ return NBTUtils.getBoolean(aStack, "mHasEntity");
+ }
+ return false;
+ }
+
+ @Override
+ public Entity getStoredEntity(World aWorld, ItemStack aStack) {
+ if (aStack == null || !hasEntity(aStack)) {
+ Logger.INFO("Cannot get stored entity.");
+ return null;
+ }
+
+ Entity mEntityToSpawn;
+ int mEntityID;
+ Logger.WARNING("getStoredEntity(1)");
+
+ mEntityID = NBTUtils.getInteger(aStack, "mEntityID");
+ mEntityToSpawn = EntityList.createEntityByID(mEntityID, aWorld);
+ if (mEntityToSpawn != null) {
+ Logger.WARNING("getStoredEntity(2)");
+ return mEntityToSpawn;
+ }
+
+ Logger.INFO("Failed to get stored entity. - getStoredEntity()");
+ return null;
+ }
+
+ @Override
+ public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity) {
+ if (aEntity == null) {
+ NBTUtils.setBoolean(aStack, "mHasEntity", false);
+ Logger.INFO("Bad Entity being stored.");
+ return false;
+ }
+
+ Logger.WARNING("setStoredEntity(1)");
+
+ NBTTagCompound mEntityData;
+ Class<? extends Entity> mEntityClass;
+ String mClassName;
+ String mEntityName;
+ int mEntityID, mEntityHashcode;
+ UUID mUuidPersistent, mUuidUnique;
+ Logger.WARNING("setStoredEntity(2)");
+
+ mEntityData = aEntity.getEntityData();
+ mEntityClass = aEntity.getClass();
+ mClassName = mEntityClass.getName();
+ mEntityName = aEntity.getCommandSenderName();
+ // mEntityID = aEntity.getEntityId();
+ mEntityID = EntityList.getEntityID(aEntity);
+ mEntityHashcode = aEntity.hashCode();
+ mUuidPersistent = aEntity.getPersistentID();
+ mUuidUnique = aEntity.getUniqueID();
+ Logger.WARNING("setStoredEntity(3)");
+
+ NBTUtils.createTagCompound(aStack, "mEntityData", mEntityData);
+ NBTUtils.setString(aStack, "mEntityName", mEntityName);
+ NBTUtils.setInteger(aStack, "mEntityID", mEntityID);
+ NBTUtils.setString(aStack, "mClassName", mClassName);
+ NBTUtils.setString(aStack, "mUuidPersistent", mUuidPersistent.toString());
+ NBTUtils.setString(aStack, "mUuidUnique", mUuidUnique.toString());
+ NBTUtils.setInteger(aStack, "mEntityHashcode", mEntityHashcode);
+ NBTUtils.setBoolean(aStack, "mHasEntity", true);
+ Logger.WARNING("setStoredEntity(4)");
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Class<? extends Entity> getStoredEntityClass(ItemStack aStack) {
+ if (aStack == null || !hasEntity(aStack)) {
+ return null;
+ }
+ Class<? extends Entity> mEntityClass;
+ String mClassName;
+ mClassName = NBTUtils.getString(aStack, "mClassName");
+ mEntityClass = (Class<? extends Entity>) ReflectionUtils.getClass(mClassName);
+ if (mEntityClass != null) {
+ return mEntityClass;
+ }
+ return null;
+ }
+
+ @Override
+ public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos) {
+ if (aStack == null || !hasEntity(aStack)) {
+ Logger.INFO("Cannot release, either invalid Itemstack or no entity stored.");
+ return false;
+ }
+
+ NBTTagCompound mEntityData = NBTUtils.getTagCompound(aStack, "mEntityData");
+
+ int mEntityID = NBTUtils.getInteger(aStack, "mEntityID");
+ String mClassName = NBTUtils.getString(aStack, "mClassName");
+ UUID mUuidPersistent = UUID.fromString(NBTUtils.getString(aStack, "mUuidPersistent"));
+ UUID mUuidUnique = UUID.fromString(NBTUtils.getString(aStack, "mUuidUnique"));
+ int mEntityHashcode = NBTUtils.getInteger(aStack, "mEntityHashcode");
+
+ EntityLiving mEntityToSpawn = (EntityLiving) getStoredEntity(aWorld, aStack);
+ Class<? extends Entity> mEntityClass = getStoredEntityClass(aStack);
+
+ Logger.WARNING("spawnStoredEntity(1)");
+
+ if (mEntityToSpawn != null && mEntityClass != null) {
+ Logger.WARNING("spawnStoredEntity(2)");
+ if (mEntityToSpawn.getEntityData() != mEntityData) {
+ Logger.WARNING("spawnStoredEntity(x)");
+ NBTUtils.setEntityCustomData(mEntityToSpawn, mEntityData);
+ }
+
+ mEntityToSpawn.setLocationAndAngles(
+ aPos.xPos, aPos.yPos, aPos.zPos, aWorld.rand.nextFloat() * 360.0F, 0.0F);
+ if (mEntityToSpawn != null) {
+ mEntityToSpawn.onSpawnWithEgg(null);
+ aWorld.spawnEntityInWorld(mEntityToSpawn);
+ Logger.WARNING("spawnStoredEntity(3)");
+ }
+ if (mEntityToSpawn != null) {
+ mEntityToSpawn.playLivingSound();
+ Logger.WARNING("spawnStoredEntity(4)");
+ }
+ Logger.WARNING("spawnStoredEntity(5)");
+ NBTUtils.setBoolean(aStack, "mHasEntity", false);
+ return true;
+ }
+ Logger.INFO("Failed to spawn stored entity. - spawnStoredEntity()");
+ return false;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
+ if (hasEntity(p_77624_1_)) {
+ String mName = NBTUtils.getString(p_77624_1_, "mEntityName");
+ if (mName != null && !mName.equals("")) {
+ p_77624_3_.add(EnumChatFormatting.GRAY + "Contains a " + mName + ".");
+ }
+ } else {
+ p_77624_3_.add(EnumChatFormatting.GRAY + "Does not contain anything.");
+ }
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public boolean onItemUse(
+ ItemStack itemstack,
+ EntityPlayer player,
+ World world,
+ int x,
+ int y,
+ int z,
+ int side,
+ float xOffset,
+ float yOffset,
+ float zOffset) {
+ if (Utils.isServer()) {
+ Logger.WARNING("Trying to release (1)");
+ if (NBTUtils.hasKey(itemstack, "mHasEntity") && NBTUtils.getBoolean(itemstack, "mHasEntity")) {
+ Logger.WARNING("Trying to release (2)");
+ boolean mDidSpawn = spawnStoredEntity(world, itemstack, new BlockPos(x, y + 1, z, world));
+
+ if (!mDidSpawn) {
+ PlayerUtils.messagePlayer(
+ player, "You failed to release a " + NBTUtils.getString(itemstack, "mEntityName") + ".");
+ }
+
+ return mDidSpawn;
+ }
+ }
+ return super.onItemUse(itemstack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
+ }
+
+ @Override
+ public boolean itemInteractionForEntity(ItemStack aStack, EntityPlayer aPlayer, EntityLivingBase aEntity) {
+ if (Utils.isServer()) {
+ Logger.WARNING("Trying to catch (1)");
+ if (!hasEntity(aStack)) {
+ Logger.WARNING("Trying to catch (2)");
+ boolean mStored = setStoredEntity(aPlayer.worldObj, aStack, aEntity);
+ if (mStored) {
+ Logger.WARNING("Trying to catch (3)");
+ aEntity.setDead();
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "You have captured a " + NBTUtils.getString(aStack, "mEntityName") + " in the Jar.");
+ // NBTUtils.tryIterateNBTData(aStack);
+ }
+ }
+ }
+ return super.itemInteractionForEntity(aStack, aPlayer, aEntity);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ if (hasEntity(aStack)) {
+ return "Captured Dragon Jar";
+ }
+ return "Dragon Capture Jar";
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/chassis/ItemBoilerChassis.java b/src/main/java/gtPlusPlus/core/item/general/chassis/ItemBoilerChassis.java
index 86c52cc048..ba726bd3ec 100644
--- a/src/main/java/gtPlusPlus/core/item/general/chassis/ItemBoilerChassis.java
+++ b/src/main/java/gtPlusPlus/core/item/general/chassis/ItemBoilerChassis.java
@@ -1,86 +1,77 @@
package gtPlusPlus.core.item.general.chassis;
-import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
public class ItemBoilerChassis extends Item {
- public IIcon[] icons = new IIcon[1];
-
- public ItemBoilerChassis() {
- super();
- this.setHasSubtypes(true);
- String unlocalizedName = "itemBoilerChassis";
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- GameRegistry.registerItem(this, unlocalizedName);
- }
+ public IIcon[] icons = new IIcon[1];
- @Override
- public void registerIcons(IIconRegister reg) {
- this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "itemBoilerChassis");
- }
+ public ItemBoilerChassis() {
+ super();
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemBoilerChassis";
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[0];
- }
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "itemBoilerChassis");
+ }
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 3; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[0];
+ }
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return this.getUnlocalizedName() + "_" + stack.getItemDamage();
- }
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 3; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- String itemName = "Advanced Boiler Chassis";
- String suffixName = "";
- if (tItem.getItemDamage() == 0){
- suffixName = " [Tier 1]";
- }
- else if (tItem.getItemDamage() == 1){
- suffixName = " [Tier 2]";
- }
- else if (tItem.getItemDamage() == 2){
- suffixName = " [Tier 3]";
- }
- return (itemName+suffixName);
-
- }
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
- @Override //TODO
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- int meta = stack.getItemDamage();
- if (meta == 0){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(10,110,30);
- }
- else if (meta == 1){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(150,180,35);
- }
- else if (meta == 2){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(200,85,40);
- }
- else if (meta == 3){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(255,100,50);
- }
- return HEX_OxFFFFFF;
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ String itemName = "Advanced Boiler Chassis";
+ String suffixName = "";
+ if (tItem.getItemDamage() == 0) {
+ suffixName = " [Tier 1]";
+ } else if (tItem.getItemDamage() == 1) {
+ suffixName = " [Tier 2]";
+ } else if (tItem.getItemDamage() == 2) {
+ suffixName = " [Tier 3]";
+ }
+ return (itemName + suffixName);
+ }
-} \ No newline at end of file
+ @Override // TODO
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ int meta = stack.getItemDamage();
+ if (meta == 0) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(10, 110, 30);
+ } else if (meta == 1) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(150, 180, 35);
+ } else if (meta == 2) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 85, 40);
+ } else if (meta == 3) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(255, 100, 50);
+ }
+ return HEX_OxFFFFFF;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoil.java b/src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoil.java
index be1fdfc491..11828ce4ea 100644
--- a/src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoil.java
+++ b/src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoil.java
@@ -1,93 +1,85 @@
package gtPlusPlus.core.item.general.chassis;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
public class ItemDehydratorCoil extends Item {
- public IIcon[] icons = new IIcon[4];
+ public IIcon[] icons = new IIcon[4];
- public ItemDehydratorCoil() {
- super();
- this.setHasSubtypes(true);
- String unlocalizedName = "itemDehydratorCoil";
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- GameRegistry.registerItem(this, unlocalizedName);
- }
+ public ItemDehydratorCoil() {
+ super();
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemDehydratorCoil";
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
- @Override
- public void registerIcons(IIconRegister reg) {
- this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoil_0");
- this.icons[1] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoil_1");
- this.icons[2] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoil_2");
- this.icons[3] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoil_3");
- }
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoil_0");
+ this.icons[1] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoil_1");
+ this.icons[2] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoil_2");
+ this.icons[3] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoil_3");
+ }
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[meta];
- }
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[meta];
+ }
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 4; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 4; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return this.getUnlocalizedName() + "_" + stack.getItemDamage();
- }
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- String itemName = "Dehydrator Coil";
- String suffixName = "";
- if (tItem.getItemDamage() == 0){
- suffixName = " [EV]";
- }
- else if (tItem.getItemDamage() == 1){
- suffixName = " [IV]";
- }
- else if (tItem.getItemDamage() == 2){
- suffixName = " [LuV]";
- }
- else if (tItem.getItemDamage() == 3){
- suffixName = " [ZPM]";
- }
- return (itemName+suffixName);
-
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ String itemName = "Dehydrator Coil";
+ String suffixName = "";
+ if (tItem.getItemDamage() == 0) {
+ suffixName = " [EV]";
+ } else if (tItem.getItemDamage() == 1) {
+ suffixName = " [IV]";
+ } else if (tItem.getItemDamage() == 2) {
+ suffixName = " [LuV]";
+ } else if (tItem.getItemDamage() == 3) {
+ suffixName = " [ZPM]";
+ }
+ return (itemName + suffixName);
+ }
- /*@Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- int meta = stack.getItemDamage();
- if (meta == 0){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(10,110,30);
- }
- else if (meta == 1){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(150,180,35);
- }
- else if (meta == 2){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(200,85,40);
- }
- else if (meta == 3){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(255,150,50);
- }
- return HEX_OxFFFFFF;
- }*/
+ /*@Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ int meta = stack.getItemDamage();
+ if (meta == 0){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(10,110,30);
+ }
+ else if (meta == 1){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(150,180,35);
+ }
+ else if (meta == 2){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(200,85,40);
+ }
+ else if (meta == 3){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(255,150,50);
+ }
+ return HEX_OxFFFFFF;
+ }*/
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoilWire.java b/src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoilWire.java
index 99d4a139dd..57cd2fe663 100644
--- a/src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoilWire.java
+++ b/src/main/java/gtPlusPlus/core/item/general/chassis/ItemDehydratorCoilWire.java
@@ -1,93 +1,85 @@
package gtPlusPlus.core.item.general.chassis;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
public class ItemDehydratorCoilWire extends Item {
- public IIcon[] icons = new IIcon[4];
+ public IIcon[] icons = new IIcon[4];
- public ItemDehydratorCoilWire() {
- super();
- this.setHasSubtypes(true);
- String unlocalizedName = "itemDehydratorCoilWire";
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- GameRegistry.registerItem(this, unlocalizedName);
- }
+ public ItemDehydratorCoilWire() {
+ super();
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemDehydratorCoilWire";
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
- @Override
- public void registerIcons(IIconRegister reg) {
- this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoilWire_0");
- this.icons[1] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoilWire_1");
- this.icons[2] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoilWire_2");
- this.icons[3] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoilWire_3");
- }
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoilWire_0");
+ this.icons[1] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoilWire_1");
+ this.icons[2] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoilWire_2");
+ this.icons[3] = reg.registerIcon(CORE.MODID + ":" + "dehydrator/itemDehydratorCoilWire_3");
+ }
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[meta];
- }
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[meta];
+ }
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 4; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 4; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return this.getUnlocalizedName() + "_" + stack.getItemDamage();
- }
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- String itemName = "Coil Wire";
- String suffixName = "";
- if (tItem.getItemDamage() == 0){
- suffixName = " [EV]";
- }
- else if (tItem.getItemDamage() == 1){
- suffixName = " [IV]";
- }
- else if (tItem.getItemDamage() == 2){
- suffixName = " [LuV]";
- }
- else if (tItem.getItemDamage() == 3){
- suffixName = " [ZPM]";
- }
- return (itemName+suffixName);
-
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ String itemName = "Coil Wire";
+ String suffixName = "";
+ if (tItem.getItemDamage() == 0) {
+ suffixName = " [EV]";
+ } else if (tItem.getItemDamage() == 1) {
+ suffixName = " [IV]";
+ } else if (tItem.getItemDamage() == 2) {
+ suffixName = " [LuV]";
+ } else if (tItem.getItemDamage() == 3) {
+ suffixName = " [ZPM]";
+ }
+ return (itemName + suffixName);
+ }
-/* @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- int meta = stack.getItemDamage();
- if (meta == 0){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(10,110,30);
- }
- else if (meta == 1){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(150,180,35);
- }
- else if (meta == 2){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(200,85,40);
- }
- else if (meta == 3){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(255,150,50);
- }
- return HEX_OxFFFFFF;
- }*/
+ /* @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ int meta = stack.getItemDamage();
+ if (meta == 0){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(10,110,30);
+ }
+ else if (meta == 1){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(150,180,35);
+ }
+ else if (meta == 2){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(200,85,40);
+ }
+ else if (meta == 3){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(255,150,50);
+ }
+ return HEX_OxFFFFFF;
+ }*/
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java b/src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
index 628fba9291..97e5367936 100644
--- a/src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
+++ b/src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
@@ -1,7 +1,8 @@
package gtPlusPlus.core.item.general.fuelrods;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
import java.util.List;
-
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -10,214 +11,203 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-
-public class FuelRod_Base extends Item{
-
- public int fuelRemaining = 0;
- public int maximumFuel = 0;
- public String fuelType = "";
- public float heat = 0;
- public float maxHeat = this.getMaxHeat();
- public FuelRod_Base(final String unlocalizedName, final String type, final int fuelLeft, final int maxFuel) {
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setMaxDamage(maxFuel);
- this.maximumFuel = maxFuel;
- this.fuelRemaining = fuelLeft;
- this.fuelType = type;
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- private float getMaxHeat(){
- float tempvar;
- if (this.fuelType == "Thorium"){
- tempvar = 2500;
- }
-
- else if (this.fuelType == "Uranium"){
- tempvar = 5000;
- }
-
- else if (this.fuelType == "Plutonium"){
- tempvar = 10000;
- }
-
- else {
- tempvar = 5000;
- }
- return tempvar;
-
- }
-
- private void updateVars(final ItemStack stack){
- if (stack.stackTagCompound != null) {
- this.heat = stack.stackTagCompound.getFloat("heat");
- this.fuelRemaining = stack.stackTagCompound.getInteger("fuelRemaining");
- }
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
-
- Float NBT_Heat = this.heat;
- Float NBT_MaxHeat = this.maxHeat;
- int NBT_Fuel = this.fuelRemaining;
- String NBT_Type= this.fuelType;
-
- if (stack.stackTagCompound != null) {
- NBT_Heat = stack.stackTagCompound.getFloat("heat");
- NBT_MaxHeat = stack.stackTagCompound.getFloat("maxHeat");
- NBT_Fuel = stack.stackTagCompound.getInteger("fuelRemaining");
- NBT_Type = stack.stackTagCompound.getString("fuelType");
- }
-
- final String tempHeat = String.valueOf(NBT_Heat);
- final String tempMaxHeat = String.valueOf(NBT_MaxHeat);
- final String tempFuel = String.valueOf(NBT_Fuel);
- final String formattedType = EnumChatFormatting.DARK_RED+NBT_Type+EnumChatFormatting.GRAY;
- String formattedHeat = EnumChatFormatting.RED+tempHeat+EnumChatFormatting.GRAY;
- final String formattedMaxHeat = EnumChatFormatting.RED+tempMaxHeat+EnumChatFormatting.GRAY;
- String formattedFuelLeft = tempFuel+EnumChatFormatting.GRAY;
-
- final int tempMax = this.maximumFuel;
- final float tempCurrentHeat = this.heat;
- final int tempFuelLeft = this.fuelRemaining;
-
- //Fuel Usage Formatting
- if (tempFuelLeft <= (this.maximumFuel/3)){
- formattedFuelLeft = EnumChatFormatting.RED+tempFuel+EnumChatFormatting.GRAY;
- }
- else if ((tempFuelLeft >= (this.maximumFuel/3)) && (tempFuelLeft <= ((this.maximumFuel/3)*2))){
- formattedFuelLeft = EnumChatFormatting.YELLOW+tempFuel+EnumChatFormatting.GRAY;
- }
- else if ((tempFuelLeft >= ((this.maximumFuel/3)*2)) && (tempFuelLeft <= this.maximumFuel)){
- formattedFuelLeft = EnumChatFormatting.GREEN+tempFuel+EnumChatFormatting.GRAY;
- }
- else {
- formattedFuelLeft = EnumChatFormatting.GRAY+tempFuel+EnumChatFormatting.GRAY;
- }
-
- //Heat Formatting
- if ((tempCurrentHeat <= 200) && (tempCurrentHeat >= 0)){
- formattedHeat = EnumChatFormatting.GRAY+tempHeat+EnumChatFormatting.GRAY;
- }
- else if ((tempCurrentHeat <= (this.maxHeat/3)) && (tempCurrentHeat > 200)){
- formattedHeat = EnumChatFormatting.YELLOW+tempHeat+EnumChatFormatting.GRAY;
- }
- else if ((tempCurrentHeat >= (this.maxHeat/3)) && (tempMax < ((this.maxHeat/3)*2)) && (tempCurrentHeat != 0)){
- formattedHeat = EnumChatFormatting.GOLD+tempHeat+EnumChatFormatting.GRAY;
- }
- else if ((tempCurrentHeat >= ((this.maxHeat/3)*2)) && (tempMax <= this.maxHeat) && (tempCurrentHeat != 0)){
- formattedHeat = EnumChatFormatting.RED+tempHeat+EnumChatFormatting.GRAY;
- }
- else {
- formattedHeat = EnumChatFormatting.BLUE+tempHeat+EnumChatFormatting.GRAY;
- }
- list.add(EnumChatFormatting.GRAY+"A "+formattedType+" Fuel Rod.");
- list.add(EnumChatFormatting.GRAY+"Running at "+formattedHeat+"/"+formattedMaxHeat+" Kelvin.");
- list.add(EnumChatFormatting.GRAY+"Fuel Remaining: "+formattedFuelLeft+"L.");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- public String getType(final ItemStack stack){
- if (stack.stackTagCompound != null){
- return stack.stackTagCompound.getString("fuelType");
- }
- return this.fuelType;
- }
-
- public int getFuelRemaining(final ItemStack stack){
- if (stack.stackTagCompound != null){
- return stack.stackTagCompound.getInteger("fuelRemaining");
- }
- return 0;
- }
-
- public int getMaxFuel(){
- return this.maximumFuel;
- }
-
- public int getFuel(final ItemStack stack){
- if (stack != null){
- final int i = stack.getItemDamage();
- final int r = this.maximumFuel - i;
- return r;
- }
- return 0;
- }
-
- public boolean setFuelRemainingExplicitly(final int i){
- final int tempFuel = this.fuelRemaining;
- this.fuelRemaining = i;
- if (i != tempFuel){
- return true;
- }
- return false;
- }
-
- public boolean addFuel(final int i){
- final int tempFuel = this.fuelRemaining;
- this.fuelRemaining = tempFuel+i;
- if (this.fuelRemaining != tempFuel){
- return true;
- }
- return false;
- }
-
- public float getHeat(final ItemStack value){
- if (value.stackTagCompound != null){
- return value.stackTagCompound.getFloat("heat");
- }
- return 0f;
- }
-
- public boolean addHeat(final float i){
- final float tempFuel = this.heat;
- this.heat = tempFuel+i;
- if (this.heat != tempFuel){
- return true;
- }
- return false;
- }
-
-
- //Ticking and NBT Handling
- /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
- * update it's contents.
- *
- * public int fuelRemaining = 0;
- public int maximumFuel = 0;
- public String fuelType = "";
- public float heat = 0;
- public float maxHeat = 5000;
- *
- */
- @Override
- public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
- itemStack.stackTagCompound = new NBTTagCompound();
- itemStack.stackTagCompound.setInteger("fuelRemaining", this.getFuelRemaining(itemStack));
- itemStack.stackTagCompound.setInteger("maximumFuel", this.maximumFuel);
- itemStack.stackTagCompound.setFloat("heat", this.getHeat(itemStack));
- itemStack.stackTagCompound.setFloat("maxHeat", this.getMaxHeat());
- itemStack.stackTagCompound.setString("fuelType", this.getType(itemStack));
- this.updateVars(itemStack);
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4, final boolean par5) {
- itemStack.stackTagCompound = new NBTTagCompound();
- itemStack.stackTagCompound.setInteger("fuelRemaining", this.getFuelRemaining(itemStack));
- itemStack.stackTagCompound.setInteger("maximumFuel", this.maximumFuel);
- itemStack.stackTagCompound.setFloat("heat", this.getHeat(itemStack));
- itemStack.stackTagCompound.setFloat("maxHeat", this.getMaxHeat());
- itemStack.stackTagCompound.setString("fuelType", this.getType(itemStack));
- this.updateVars(itemStack);
- }
-
-
-
+public class FuelRod_Base extends Item {
+
+ public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = this.getMaxHeat();
+
+ public FuelRod_Base(final String unlocalizedName, final String type, final int fuelLeft, final int maxFuel) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(maxFuel);
+ this.maximumFuel = maxFuel;
+ this.fuelRemaining = fuelLeft;
+ this.fuelType = type;
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ private float getMaxHeat() {
+ float tempvar;
+ if (this.fuelType == "Thorium") {
+ tempvar = 2500;
+ } else if (this.fuelType == "Uranium") {
+ tempvar = 5000;
+ } else if (this.fuelType == "Plutonium") {
+ tempvar = 10000;
+ } else {
+ tempvar = 5000;
+ }
+ return tempvar;
+ }
+
+ private void updateVars(final ItemStack stack) {
+ if (stack.stackTagCompound != null) {
+ this.heat = stack.stackTagCompound.getFloat("heat");
+ this.fuelRemaining = stack.stackTagCompound.getInteger("fuelRemaining");
+ }
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+
+ Float NBT_Heat = this.heat;
+ Float NBT_MaxHeat = this.maxHeat;
+ int NBT_Fuel = this.fuelRemaining;
+ String NBT_Type = this.fuelType;
+
+ if (stack.stackTagCompound != null) {
+ NBT_Heat = stack.stackTagCompound.getFloat("heat");
+ NBT_MaxHeat = stack.stackTagCompound.getFloat("maxHeat");
+ NBT_Fuel = stack.stackTagCompound.getInteger("fuelRemaining");
+ NBT_Type = stack.stackTagCompound.getString("fuelType");
+ }
+
+ final String tempHeat = String.valueOf(NBT_Heat);
+ final String tempMaxHeat = String.valueOf(NBT_MaxHeat);
+ final String tempFuel = String.valueOf(NBT_Fuel);
+ final String formattedType = EnumChatFormatting.DARK_RED + NBT_Type + EnumChatFormatting.GRAY;
+ String formattedHeat = EnumChatFormatting.RED + tempHeat + EnumChatFormatting.GRAY;
+ final String formattedMaxHeat = EnumChatFormatting.RED + tempMaxHeat + EnumChatFormatting.GRAY;
+ String formattedFuelLeft = tempFuel + EnumChatFormatting.GRAY;
+
+ final int tempMax = this.maximumFuel;
+ final float tempCurrentHeat = this.heat;
+ final int tempFuelLeft = this.fuelRemaining;
+
+ // Fuel Usage Formatting
+ if (tempFuelLeft <= (this.maximumFuel / 3)) {
+ formattedFuelLeft = EnumChatFormatting.RED + tempFuel + EnumChatFormatting.GRAY;
+ } else if ((tempFuelLeft >= (this.maximumFuel / 3)) && (tempFuelLeft <= ((this.maximumFuel / 3) * 2))) {
+ formattedFuelLeft = EnumChatFormatting.YELLOW + tempFuel + EnumChatFormatting.GRAY;
+ } else if ((tempFuelLeft >= ((this.maximumFuel / 3) * 2)) && (tempFuelLeft <= this.maximumFuel)) {
+ formattedFuelLeft = EnumChatFormatting.GREEN + tempFuel + EnumChatFormatting.GRAY;
+ } else {
+ formattedFuelLeft = EnumChatFormatting.GRAY + tempFuel + EnumChatFormatting.GRAY;
+ }
+
+ // Heat Formatting
+ if ((tempCurrentHeat <= 200) && (tempCurrentHeat >= 0)) {
+ formattedHeat = EnumChatFormatting.GRAY + tempHeat + EnumChatFormatting.GRAY;
+ } else if ((tempCurrentHeat <= (this.maxHeat / 3)) && (tempCurrentHeat > 200)) {
+ formattedHeat = EnumChatFormatting.YELLOW + tempHeat + EnumChatFormatting.GRAY;
+ } else if ((tempCurrentHeat >= (this.maxHeat / 3))
+ && (tempMax < ((this.maxHeat / 3) * 2))
+ && (tempCurrentHeat != 0)) {
+ formattedHeat = EnumChatFormatting.GOLD + tempHeat + EnumChatFormatting.GRAY;
+ } else if ((tempCurrentHeat >= ((this.maxHeat / 3) * 2))
+ && (tempMax <= this.maxHeat)
+ && (tempCurrentHeat != 0)) {
+ formattedHeat = EnumChatFormatting.RED + tempHeat + EnumChatFormatting.GRAY;
+ } else {
+ formattedHeat = EnumChatFormatting.BLUE + tempHeat + EnumChatFormatting.GRAY;
+ }
+ list.add(EnumChatFormatting.GRAY + "A " + formattedType + " Fuel Rod.");
+ list.add(EnumChatFormatting.GRAY + "Running at " + formattedHeat + "/" + formattedMaxHeat + " Kelvin.");
+ list.add(EnumChatFormatting.GRAY + "Fuel Remaining: " + formattedFuelLeft + "L.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public String getType(final ItemStack stack) {
+ if (stack.stackTagCompound != null) {
+ return stack.stackTagCompound.getString("fuelType");
+ }
+ return this.fuelType;
+ }
+
+ public int getFuelRemaining(final ItemStack stack) {
+ if (stack.stackTagCompound != null) {
+ return stack.stackTagCompound.getInteger("fuelRemaining");
+ }
+ return 0;
+ }
+
+ public int getMaxFuel() {
+ return this.maximumFuel;
+ }
+
+ public int getFuel(final ItemStack stack) {
+ if (stack != null) {
+ final int i = stack.getItemDamage();
+ final int r = this.maximumFuel - i;
+ return r;
+ }
+ return 0;
+ }
+
+ public boolean setFuelRemainingExplicitly(final int i) {
+ final int tempFuel = this.fuelRemaining;
+ this.fuelRemaining = i;
+ if (i != tempFuel) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean addFuel(final int i) {
+ final int tempFuel = this.fuelRemaining;
+ this.fuelRemaining = tempFuel + i;
+ if (this.fuelRemaining != tempFuel) {
+ return true;
+ }
+ return false;
+ }
+
+ public float getHeat(final ItemStack value) {
+ if (value.stackTagCompound != null) {
+ return value.stackTagCompound.getFloat("heat");
+ }
+ return 0f;
+ }
+
+ public boolean addHeat(final float i) {
+ final float tempFuel = this.heat;
+ this.heat = tempFuel + i;
+ if (this.heat != tempFuel) {
+ return true;
+ }
+ return false;
+ }
+
+ // Ticking and NBT Handling
+ /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
+ * update it's contents.
+ *
+ * public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = 5000;
+ *
+ */
+ @Override
+ public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("fuelRemaining", this.getFuelRemaining(itemStack));
+ itemStack.stackTagCompound.setInteger("maximumFuel", this.maximumFuel);
+ itemStack.stackTagCompound.setFloat("heat", this.getHeat(itemStack));
+ itemStack.stackTagCompound.setFloat("maxHeat", this.getMaxHeat());
+ itemStack.stackTagCompound.setString("fuelType", this.getType(itemStack));
+ this.updateVars(itemStack);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack itemStack,
+ final World par2World,
+ final Entity par3Entity,
+ final int par4,
+ final boolean par5) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("fuelRemaining", this.getFuelRemaining(itemStack));
+ itemStack.stackTagCompound.setInteger("maximumFuel", this.maximumFuel);
+ itemStack.stackTagCompound.setFloat("heat", this.getHeat(itemStack));
+ itemStack.stackTagCompound.setFloat("maxHeat", this.getMaxHeat());
+ itemStack.stackTagCompound.setString("fuelType", this.getType(itemStack));
+ this.updateVars(itemStack);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java b/src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java
index dbf1209b50..4b25d0ae8b 100644
--- a/src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java
+++ b/src/main/java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java
@@ -1,13 +1,12 @@
package gtPlusPlus.core.item.general.fuelrods;
-public class FuelRod_Thorium extends FuelRod_Base{
-
- public FuelRod_Thorium(final String unlocalizedName, final String type, final int fuelLeft, final int maxFuel) {
- super(unlocalizedName, type, fuelLeft, maxFuel);
- this.setMaxDamage(maxFuel);
- this.maximumFuel = maxFuel;
- this.fuelRemaining = fuelLeft;
- this.fuelType = type;
- }
+public class FuelRod_Thorium extends FuelRod_Base {
+ public FuelRod_Thorium(final String unlocalizedName, final String type, final int fuelLeft, final int maxFuel) {
+ super(unlocalizedName, type, fuelLeft, maxFuel);
+ this.setMaxDamage(maxFuel);
+ this.maximumFuel = maxFuel;
+ this.fuelRemaining = fuelLeft;
+ this.fuelType = type;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/rfchargingpack/ChargingPackBase.java b/src/main/java/gtPlusPlus/core/item/general/rfchargingpack/ChargingPackBase.java
index 238e765384..d6919a4b80 100644
--- a/src/main/java/gtPlusPlus/core/item/general/rfchargingpack/ChargingPackBase.java
+++ b/src/main/java/gtPlusPlus/core/item/general/rfchargingpack/ChargingPackBase.java
@@ -1,84 +1,87 @@
package gtPlusPlus.core.item.general.rfchargingpack;
-import java.util.List;
-
import cofh.api.energy.ItemEnergyContainer;
+import gtPlusPlus.core.util.math.MathUtils;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.core.util.math.MathUtils;
-
public class ChargingPackBase extends ItemEnergyContainer {
- protected final int mCapacityMax;
- protected final byte mTier;
-
- public ChargingPackBase(byte tier) {
- this(tier, (tier == 1 ? 4000000 : tier == 2 ? 8000000 : tier == 3 ? 16000000 : tier == 4 ? 32000000 : 64000000));
- }
+ protected final int mCapacityMax;
+ protected final byte mTier;
- private ChargingPackBase(byte tier, int maxStorage) {
- super(maxStorage);
- mTier = tier;
- mCapacityMax = maxStorage;
- }
+ public ChargingPackBase(byte tier) {
+ this(
+ tier,
+ (tier == 1 ? 4000000 : tier == 2 ? 8000000 : tier == 3 ? 16000000 : tier == 4 ? 32000000 : 64000000));
+ }
- public int getMaxEnergyInput(ItemStack container)
- {
- return this.maxReceive;
- }
+ private ChargingPackBase(byte tier, int maxStorage) {
+ super(maxStorage);
+ mTier = tier;
+ mCapacityMax = maxStorage;
+ }
- public int getMaxEnergyExtracted(ItemStack container)
- {
- return this.maxExtract;
- }
+ public int getMaxEnergyInput(ItemStack container) {
+ return this.maxReceive;
+ }
- @Override
- public void onUpdate(ItemStack aStack, World aWorld, Entity aEnt, int p_77663_4_, boolean p_77663_5_) {
- super.onUpdate(aStack, aWorld, aEnt, p_77663_4_, p_77663_5_);
+ public int getMaxEnergyExtracted(ItemStack container) {
+ return this.maxExtract;
+ }
- ItemEnergyContainer current = this;
- int currentStored = 0;
- if (current != null) {
- currentStored = current.getEnergyStored(aStack);
- }
- if (currentStored > 0) {
- if (aEnt instanceof EntityPlayer) {
- if (((EntityPlayer) aEnt).inventory != null) {
- for (ItemStack invStack : ((EntityPlayer) aEnt).inventory.mainInventory) {
- if (invStack != null) {
- if (invStack.getItem() instanceof ItemEnergyContainer) {
- if (current != null) {
- currentStored = current.getEnergyStored(aStack);
- if (currentStored > 0) {
- int mTransLimit;
- int mMaxStorage;
- int mCurrent;
- mTransLimit = getMaxEnergyInput(invStack);
- mMaxStorage = current.getMaxEnergyStored(invStack);
- mCurrent = current.getEnergyStored(invStack);
- if (mCurrent+mTransLimit <= mMaxStorage) {
- current.extractEnergy(aStack, current.receiveEnergy(invStack, mTransLimit, false), false);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
+ @Override
+ public void onUpdate(ItemStack aStack, World aWorld, Entity aEnt, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(aStack, aWorld, aEnt, p_77663_4_, p_77663_5_);
- @Override
- public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List list, boolean p_77624_4_) {
- list.add(EnumChatFormatting.RED+"RF Information");
- list.add(EnumChatFormatting.GRAY+"Extraction Rate: [" +EnumChatFormatting.RED+ this.maxExtract + EnumChatFormatting.GRAY + "Rf/t]" + " Insert Rate: [" +EnumChatFormatting.RED+ this.maxReceive+EnumChatFormatting.GRAY+"Rf/t]");
- list.add(EnumChatFormatting.GRAY+"Current Charge: ["+EnumChatFormatting.RED+this.getEnergyStored(stack) + EnumChatFormatting.GRAY + "Rf / " + this.getMaxEnergyStored(stack)+"Rf] "+EnumChatFormatting.RED+MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack))+EnumChatFormatting.GRAY+"%");
- super.addInformation(stack, p_77624_2_, list, p_77624_4_);
- }
+ ItemEnergyContainer current = this;
+ int currentStored = 0;
+ if (current != null) {
+ currentStored = current.getEnergyStored(aStack);
+ }
+ if (currentStored > 0) {
+ if (aEnt instanceof EntityPlayer) {
+ if (((EntityPlayer) aEnt).inventory != null) {
+ for (ItemStack invStack : ((EntityPlayer) aEnt).inventory.mainInventory) {
+ if (invStack != null) {
+ if (invStack.getItem() instanceof ItemEnergyContainer) {
+ if (current != null) {
+ currentStored = current.getEnergyStored(aStack);
+ if (currentStored > 0) {
+ int mTransLimit;
+ int mMaxStorage;
+ int mCurrent;
+ mTransLimit = getMaxEnergyInput(invStack);
+ mMaxStorage = current.getMaxEnergyStored(invStack);
+ mCurrent = current.getEnergyStored(invStack);
+ if (mCurrent + mTransLimit <= mMaxStorage) {
+ current.extractEnergy(
+ aStack, current.receiveEnergy(invStack, mTransLimit, false), false);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List list, boolean p_77624_4_) {
+ list.add(EnumChatFormatting.RED + "RF Information");
+ list.add(EnumChatFormatting.GRAY + "Extraction Rate: [" + EnumChatFormatting.RED + this.maxExtract
+ + EnumChatFormatting.GRAY + "Rf/t]" + " Insert Rate: [" + EnumChatFormatting.RED + this.maxReceive
+ + EnumChatFormatting.GRAY + "Rf/t]");
+ list.add(EnumChatFormatting.GRAY + "Current Charge: [" + EnumChatFormatting.RED + this.getEnergyStored(stack)
+ + EnumChatFormatting.GRAY + "Rf / " + this.getMaxEnergyStored(stack) + "Rf] " + EnumChatFormatting.RED
+ + MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack))
+ + EnumChatFormatting.GRAY + "%");
+ super.addInformation(stack, p_77624_2_, list, p_77624_4_);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java b/src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java
index 727b933fa7..a8d57c9892 100644
--- a/src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java
+++ b/src/main/java/gtPlusPlus/core/item/general/spawn/ItemCustomSpawnEgg.java
@@ -1,15 +1,14 @@
package gtPlusPlus.core.item.general.spawn;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -22,264 +21,271 @@ import net.minecraft.world.World;
public class ItemCustomSpawnEgg extends ItemMonsterPlacer {
- private static final HashMap<Integer, IIcon> mIconMap = new HashMap<Integer, IIcon>();
- private static int mTotalMetaItems = 0;
-
- private static final HashMap<Integer, Integer> mMaxStackSizeMap = new HashMap<Integer, Integer>();
- private static final HashMap<Integer, EnumRarity> mRarityMap = new HashMap<Integer, EnumRarity>();
- private static final HashMap<Integer, ArrayList<String>> mOreDictNames = new HashMap<Integer, ArrayList<String>>();
-
- private static final HashMap<Integer, Integer> mColourBaseMap = new HashMap<Integer, Integer>();
- private static final HashMap<Integer, Integer> mColourSpotsMap = new HashMap<Integer, Integer>();
- private static final HashMap<Integer, String> mEntityNameMap = new HashMap<Integer, String>();
- private static final HashMap<Integer, String> mEntityFullNameMap = new HashMap<Integer, String>();
-
- private static final HashMap<String, Integer> mReverseEntityMap = new HashMap<String, Integer>();
-
- protected EntityLiving entityToSpawn = null;
-
- public static ItemStack getSpawnEggForEntityname(String aEntityName, int aSize) {
- return ItemUtils.simpleMetaStack(ModItems.itemCustomSpawnEgg, mReverseEntityMap.get(aEntityName), aSize);
- }
-
- public static void registerEntityForSpawnEgg(final int aMetaID, String parEntityToSpawnName, int aPrimaryColor, int aSecondaryColor) {
- registerEntityForSpawnEgg(aMetaID, parEntityToSpawnName, aPrimaryColor, aSecondaryColor, EnumRarity.common, new ArrayList<String>());
- }
-
- public static void registerEntityForSpawnEgg(final int aMetaID, String parEntityToSpawnName, int aPrimaryColor, int aSecondaryColor, EnumRarity aRarity, final ArrayList<String> aOreDictNames) {
- mTotalMetaItems++;
- mMaxStackSizeMap.put(aMetaID, 64);
- mRarityMap.put(aMetaID, aRarity);
- mOreDictNames.put(aMetaID, aOreDictNames);
- mColourBaseMap.put(aMetaID, aPrimaryColor);
- mColourSpotsMap.put(aMetaID, aSecondaryColor);
- mReverseEntityMap.put(parEntityToSpawnName, aMetaID);
- setEntityToSpawnName(aMetaID, parEntityToSpawnName);
- }
-
- public static void registerEggsToOreDict() {
- for (int aMetaID = 0; aMetaID < mTotalMetaItems; aMetaID++) {
- ArrayList<String> aOreDictNames = mOreDictNames.get(aMetaID);
- if (aOreDictNames != null && !aOreDictNames.isEmpty()) {
- ItemStack aFoodStack = ItemUtils.simpleMetaStack(ModItems.itemCustomSpawnEgg, aMetaID, 1
- );
- for (String aOreName : aOreDictNames) {
- ItemUtils.addItemToOreDictionary(aFoodStack, aOreName);
- }
- }
- }
- }
-
- public ItemCustomSpawnEgg() {
- super();
- this.setNoRepair();
- this.setMaxStackSize(64);
- this.setMaxDamage(0);
- this.setUnlocalizedName("BasicMetaSpawnEgg");
- GameRegistry.registerItem(this, this.getUnlocalizedName());
- }
-
- /**
- * Callback for item usage. If the item does something special on right
- * clicking,
- *
- * he will have one of those. Return True if something happen and false if
- * it don't. This is for ITEMS, not BLOCKS
- */
- @Override
- public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10){
- if (par3World.isRemote) {
- return true;
- }
- else {
- Block block = par3World.getBlock(par4, par5, par6);
- par4 += Facing.offsetsXForSide[par7];
- par5 += Facing.offsetsYForSide[par7];
- par6 += Facing.offsetsZForSide[par7];
- double d0 = 0.0D;
-
- if (par7 == 1 && block.getRenderType() == 11) {
- d0 = 0.5D;
- }
-
- Entity entity = spawnEntity(par1ItemStack, par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);
-
- if (entity != null) {
- if (entity instanceof EntityLivingBase
- && par1ItemStack.hasDisplayName()) {
- ((EntityLiving) entity).setCustomNameTag(
- par1ItemStack.getDisplayName()
- );
- }
-
- if (!par2EntityPlayer.capabilities.isCreativeMode) {
- --par1ItemStack.stackSize;
- }
- }
-
- return true;
- }
- }
-
- /**
- * Called whenever this item is equipped and the right mouse button is
- * pressed.
- *
- * Args: itemStack, world, entityPlayer
- */
- @Override
- public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
- if (par2World.isRemote) {
- return par1ItemStack;
- }
- else {
- MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
-
- if (movingobjectposition == null) {
- return par1ItemStack;
- }
- else {
- if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
- int i = movingobjectposition.blockX;
- int j = movingobjectposition.blockY;
- int k = movingobjectposition.blockZ;
-
- if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) {
- return par1ItemStack;
- }
-
- if (!par3EntityPlayer.canPlayerEdit(
- i, j, k, movingobjectposition
-
- .sideHit, par1ItemStack
- )) {
- return par1ItemStack;
- }
-
- if (par2World.getBlock(i, j, k) instanceof BlockLiquid) {
- Entity entity = spawnEntity(par1ItemStack, par2World, i, j, k);
-
- if (entity != null) {
- if (entity instanceof EntityLivingBase
- && par1ItemStack
-
- .hasDisplayName()) {
- ((EntityLiving) entity).setCustomNameTag(
- par1ItemStack
-
- .getDisplayName()
- );
- }
-
- if (!par3EntityPlayer.capabilities.isCreativeMode) {
- --par1ItemStack.stackSize;
- }
- }
- }
- }
-
- return par1ItemStack;
- }
- }
- }
-
- /**
- * Spawns the creature specified by the egg's type in the location specified
- * by
- *
- * the last three parameters. Parameters: world, entityID, x, y, z.
- * @param par1ItemStack
- */
- public Entity spawnEntity(ItemStack par1ItemStack, World parWorld, double parX, double parY, double parZ) {
-
- if (!parWorld.isRemote) // never spawn entity on client side
- {
- int aDamage = par1ItemStack.getItemDamage();
- String entityToSpawnNameFull = mEntityFullNameMap.get(aDamage);
- String entityToSpawnName = mEntityNameMap.get(aDamage);
- //entityToSpawnNameFull = WildAnimals.MODID + "." + entityToSpawnName;
- if (EntityList.stringToClassMapping.containsKey(entityToSpawnNameFull)) {
- entityToSpawn = (EntityLiving) EntityList.createEntityByName(entityToSpawnNameFull, parWorld);
- entityToSpawn.setLocationAndAngles(parX, parY, parZ, MathHelper.wrapAngleTo180_float(parWorld.rand.nextFloat() * 360.0F), 0.0F);
- parWorld.spawnEntityInWorld(entityToSpawn);
- entityToSpawn.onSpawnWithEgg((IEntityLivingData) null);
- entityToSpawn.playLivingSound();
- }
- else {
- // DEBUG
- System.out.println("Entity not found " + entityToSpawnName);
- }
- }
-
- return entityToSpawn;
- }
-
- /**
- * returns a list of items with the same ID, but different meta (eg: dye
- * returns 16 items)
- */
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
- for (int aMeta : mReverseEntityMap.values()) {
- aList.add(ItemUtils.simpleMetaStack(aItem, aMeta, 1));
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack par1ItemStack, int parColorType) {
- int aID = par1ItemStack.getItemDamage();
- return (parColorType == 0) ? mColourBaseMap.get(aID) : mColourSpotsMap.get(aID);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
- @Override
- // Doing this override means that there is no localization for language
- // unless you specifically check for localization here and convert
- public String getItemStackDisplayName(ItemStack par1ItemStack) {
- return "Spawn " + mEntityNameMap.get(par1ItemStack.getItemDamage());
- }
-
-
- @Override
- public void registerIcons(final IIconRegister u) {
- mIconMap.put(0, u.registerIcon(CORE.MODID + ":" + "spawn_egg"));
- mIconMap.put(1, u.registerIcon(CORE.MODID + ":" + "spawn_egg_overlay"));
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int renderPass) {
- return mIconMap.get(renderPass);
- }
-
- @Override
- public IIcon getIconFromDamage(int damage) {
- return getIconFromDamageForRenderPass(0, 0);
- }
-
- @Override
- public IIcon getIcon(ItemStack aStack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- return getIconFromDamageForRenderPass(0, renderPass);
- }
-
- @Override
- public IIcon getIcon(ItemStack aStack, int renderPass) {
- return getIconFromDamageForRenderPass(0, renderPass);
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return super.getUnlocalizedName() + "." + stack.getItemDamage();
- }
-
- public static void setEntityToSpawnName(int aMetaID, String parEntityToSpawnName) {
- mEntityNameMap.put(aMetaID, parEntityToSpawnName);
- mEntityFullNameMap.put(aMetaID, CORE.MODID + "." + parEntityToSpawnName);
- }
+ private static final HashMap<Integer, IIcon> mIconMap = new HashMap<Integer, IIcon>();
+ private static int mTotalMetaItems = 0;
+
+ private static final HashMap<Integer, Integer> mMaxStackSizeMap = new HashMap<Integer, Integer>();
+ private static final HashMap<Integer, EnumRarity> mRarityMap = new HashMap<Integer, EnumRarity>();
+ private static final HashMap<Integer, ArrayList<String>> mOreDictNames = new HashMap<Integer, ArrayList<String>>();
+
+ private static final HashMap<Integer, Integer> mColourBaseMap = new HashMap<Integer, Integer>();
+ private static final HashMap<Integer, Integer> mColourSpotsMap = new HashMap<Integer, Integer>();
+ private static final HashMap<Integer, String> mEntityNameMap = new HashMap<Integer, String>();
+ private static final HashMap<Integer, String> mEntityFullNameMap = new HashMap<Integer, String>();
+
+ private static final HashMap<String, Integer> mReverseEntityMap = new HashMap<String, Integer>();
+
+ protected EntityLiving entityToSpawn = null;
+
+ public static ItemStack getSpawnEggForEntityname(String aEntityName, int aSize) {
+ return ItemUtils.simpleMetaStack(ModItems.itemCustomSpawnEgg, mReverseEntityMap.get(aEntityName), aSize);
+ }
+
+ public static void registerEntityForSpawnEgg(
+ final int aMetaID, String parEntityToSpawnName, int aPrimaryColor, int aSecondaryColor) {
+ registerEntityForSpawnEgg(
+ aMetaID,
+ parEntityToSpawnName,
+ aPrimaryColor,
+ aSecondaryColor,
+ EnumRarity.common,
+ new ArrayList<String>());
+ }
+
+ public static void registerEntityForSpawnEgg(
+ final int aMetaID,
+ String parEntityToSpawnName,
+ int aPrimaryColor,
+ int aSecondaryColor,
+ EnumRarity aRarity,
+ final ArrayList<String> aOreDictNames) {
+ mTotalMetaItems++;
+ mMaxStackSizeMap.put(aMetaID, 64);
+ mRarityMap.put(aMetaID, aRarity);
+ mOreDictNames.put(aMetaID, aOreDictNames);
+ mColourBaseMap.put(aMetaID, aPrimaryColor);
+ mColourSpotsMap.put(aMetaID, aSecondaryColor);
+ mReverseEntityMap.put(parEntityToSpawnName, aMetaID);
+ setEntityToSpawnName(aMetaID, parEntityToSpawnName);
+ }
+
+ public static void registerEggsToOreDict() {
+ for (int aMetaID = 0; aMetaID < mTotalMetaItems; aMetaID++) {
+ ArrayList<String> aOreDictNames = mOreDictNames.get(aMetaID);
+ if (aOreDictNames != null && !aOreDictNames.isEmpty()) {
+ ItemStack aFoodStack = ItemUtils.simpleMetaStack(ModItems.itemCustomSpawnEgg, aMetaID, 1);
+ for (String aOreName : aOreDictNames) {
+ ItemUtils.addItemToOreDictionary(aFoodStack, aOreName);
+ }
+ }
+ }
+ }
+
+ public ItemCustomSpawnEgg() {
+ super();
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ this.setUnlocalizedName("BasicMetaSpawnEgg");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ }
+
+ /**
+ * Callback for item usage. If the item does something special on right
+ * clicking,
+ *
+ * he will have one of those. Return True if something happen and false if
+ * it don't. This is for ITEMS, not BLOCKS
+ */
+ @Override
+ public boolean onItemUse(
+ ItemStack par1ItemStack,
+ EntityPlayer par2EntityPlayer,
+ World par3World,
+ int par4,
+ int par5,
+ int par6,
+ int par7,
+ float par8,
+ float par9,
+ float par10) {
+ if (par3World.isRemote) {
+ return true;
+ } else {
+ Block block = par3World.getBlock(par4, par5, par6);
+ par4 += Facing.offsetsXForSide[par7];
+ par5 += Facing.offsetsYForSide[par7];
+ par6 += Facing.offsetsZForSide[par7];
+ double d0 = 0.0D;
+
+ if (par7 == 1 && block.getRenderType() == 11) {
+ d0 = 0.5D;
+ }
+
+ Entity entity = spawnEntity(par1ItemStack, par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);
+
+ if (entity != null) {
+ if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) {
+ ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
+ }
+
+ if (!par2EntityPlayer.capabilities.isCreativeMode) {
+ --par1ItemStack.stackSize;
+ }
+ }
+
+ return true;
+ }
+ }
+
+ /**
+ * Called whenever this item is equipped and the right mouse button is
+ * pressed.
+ *
+ * Args: itemStack, world, entityPlayer
+ */
+ @Override
+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
+ if (par2World.isRemote) {
+ return par1ItemStack;
+ } else {
+ MovingObjectPosition movingobjectposition =
+ getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
+
+ if (movingobjectposition == null) {
+ return par1ItemStack;
+ } else {
+ if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
+ int i = movingobjectposition.blockX;
+ int j = movingobjectposition.blockY;
+ int k = movingobjectposition.blockZ;
+
+ if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) {
+ return par1ItemStack;
+ }
+
+ if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) {
+
+ return par1ItemStack;
+ }
+
+ if (par2World.getBlock(i, j, k) instanceof BlockLiquid) {
+ Entity entity = spawnEntity(par1ItemStack, par2World, i, j, k);
+
+ if (entity != null) {
+ if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) {
+
+ ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
+ }
+
+ if (!par3EntityPlayer.capabilities.isCreativeMode) {
+ --par1ItemStack.stackSize;
+ }
+ }
+ }
+ }
+
+ return par1ItemStack;
+ }
+ }
+ }
+
+ /**
+ * Spawns the creature specified by the egg's type in the location specified
+ * by
+ *
+ * the last three parameters. Parameters: world, entityID, x, y, z.
+ * @param par1ItemStack
+ */
+ public Entity spawnEntity(ItemStack par1ItemStack, World parWorld, double parX, double parY, double parZ) {
+
+ if (!parWorld.isRemote) // never spawn entity on client side
+ {
+ int aDamage = par1ItemStack.getItemDamage();
+ String entityToSpawnNameFull = mEntityFullNameMap.get(aDamage);
+ String entityToSpawnName = mEntityNameMap.get(aDamage);
+ // entityToSpawnNameFull = WildAnimals.MODID + "." + entityToSpawnName;
+ if (EntityList.stringToClassMapping.containsKey(entityToSpawnNameFull)) {
+ entityToSpawn = (EntityLiving) EntityList.createEntityByName(entityToSpawnNameFull, parWorld);
+ entityToSpawn.setLocationAndAngles(
+ parX, parY, parZ, MathHelper.wrapAngleTo180_float(parWorld.rand.nextFloat() * 360.0F), 0.0F);
+ parWorld.spawnEntityInWorld(entityToSpawn);
+ entityToSpawn.onSpawnWithEgg((IEntityLivingData) null);
+ entityToSpawn.playLivingSound();
+ } else {
+ // DEBUG
+ System.out.println("Entity not found " + entityToSpawnName);
+ }
+ }
+
+ return entityToSpawn;
+ }
+
+ /**
+ * returns a list of items with the same ID, but different meta (eg: dye
+ * returns 16 items)
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ for (int aMeta : mReverseEntityMap.values()) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, aMeta, 1));
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack par1ItemStack, int parColorType) {
+ int aID = par1ItemStack.getItemDamage();
+ return (parColorType == 0) ? mColourBaseMap.get(aID) : mColourSpotsMap.get(aID);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+
+ @Override
+ // Doing this override means that there is no localization for language
+ // unless you specifically check for localization here and convert
+ public String getItemStackDisplayName(ItemStack par1ItemStack) {
+ return "Spawn " + mEntityNameMap.get(par1ItemStack.getItemDamage());
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ mIconMap.put(0, u.registerIcon(CORE.MODID + ":" + "spawn_egg"));
+ mIconMap.put(1, u.registerIcon(CORE.MODID + ":" + "spawn_egg_overlay"));
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int renderPass) {
+ return mIconMap.get(renderPass);
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return getIconFromDamageForRenderPass(0, 0);
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack aStack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return getIconFromDamageForRenderPass(0, renderPass);
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack aStack, int renderPass) {
+ return getIconFromDamageForRenderPass(0, renderPass);
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ public static void setEntityToSpawnName(int aMetaID, String parEntityToSpawnName) {
+ mEntityNameMap.put(aMetaID, parEntityToSpawnName);
+ mEntityFullNameMap.put(aMetaID, CORE.MODID + "." + parEntityToSpawnName);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java
index 57cf8986fa..4aa6f11e7a 100644
--- a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java
+++ b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java
@@ -1,30 +1,39 @@
package gtPlusPlus.core.item.general.throwables;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion;
+import gtPlusPlus.core.item.base.CoreItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion;
-import gtPlusPlus.core.item.base.CoreItem;
-
public class ItemHydrofluoricAcidPotion extends CoreItem {
- public ItemHydrofluoricAcidPotion(String unlocalizedName, String displayName, String description) {
- super(unlocalizedName, displayName, AddToCreativeTab.tabMisc, 16, 0, new String[] {description}, EnumRarity.uncommon, EnumChatFormatting.GRAY, false, null);
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
- if (!player.capabilities.isCreativeMode) {
- --item.stackSize;
- }
- world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
- if (!world.isRemote) {
- world.spawnEntityInWorld(new EntityHydrofluoricAcidPotion(world, player));
- }
- return item;
- }
-} \ No newline at end of file
+ public ItemHydrofluoricAcidPotion(String unlocalizedName, String displayName, String description) {
+ super(
+ unlocalizedName,
+ displayName,
+ AddToCreativeTab.tabMisc,
+ 16,
+ 0,
+ new String[] {description},
+ EnumRarity.uncommon,
+ EnumChatFormatting.GRAY,
+ false,
+ null);
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
+ if (!player.capabilities.isCreativeMode) {
+ --item.stackSize;
+ }
+ world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
+ if (!world.isRemote) {
+ world.spawnEntityInWorld(new EntityHydrofluoricAcidPotion(world, player));
+ }
+ return item;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java
index 27b35e48d1..a553e46cf3 100644
--- a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java
+++ b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java
@@ -1,30 +1,39 @@
package gtPlusPlus.core.item.general.throwables;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion;
+import gtPlusPlus.core.item.base.CoreItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion;
-import gtPlusPlus.core.item.base.CoreItem;
-
public class ItemSulfuricAcidPotion extends CoreItem {
- public ItemSulfuricAcidPotion(String unlocalizedName, String displayName, String description) {
- super(unlocalizedName, displayName, AddToCreativeTab.tabMisc, 16, 0, new String[] {description}, EnumRarity.common, EnumChatFormatting.GRAY, false, null);
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
- if (!player.capabilities.isCreativeMode) {
- --item.stackSize;
- }
- world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
- if (!world.isRemote) {
- world.spawnEntityInWorld(new EntitySulfuricAcidPotion(world, player));
- }
- return item;
- }
-} \ No newline at end of file
+ public ItemSulfuricAcidPotion(String unlocalizedName, String displayName, String description) {
+ super(
+ unlocalizedName,
+ displayName,
+ AddToCreativeTab.tabMisc,
+ 16,
+ 0,
+ new String[] {description},
+ EnumRarity.common,
+ EnumChatFormatting.GRAY,
+ false,
+ null);
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
+ if (!player.capabilities.isCreativeMode) {
+ --item.stackSize;
+ }
+ world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
+ if (!world.isRemote) {
+ world.spawnEntityInWorld(new EntitySulfuricAcidPotion(world, player));
+ }
+ return item;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java
index e8f76ce64c..fedff944d1 100644
--- a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java
+++ b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.item.general.throwables;
-import java.util.List;
-
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -11,8 +9,8 @@ import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -26,99 +24,105 @@ import net.minecraft.world.World;
public class ItemThrowableBomb extends CoreItem {
- private static AutoMap<ItemStack> mLighters = new AutoMap<ItemStack>();
- public static IIcon[] icons = new IIcon[10];
-
- public ItemThrowableBomb() {
- super("gtpp.throwable.bomb", "Bomb", AddToCreativeTab.tabMisc, 16, 0, new String[] {"Just like Bomberman", "Have a fire source in inventory to prime"}, EnumRarity.uncommon, EnumChatFormatting.GRAY, false, null);
- this.setHasSubtypes(true);
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
-
- if (mLighters.isEmpty()) {
- mLighters.put(ItemUtils.getSimpleStack(Items.flint_and_steel));
- mLighters.put(ItemList.Tool_Lighter_Invar_Full.get(1));
- mLighters.put(ItemList.Tool_Lighter_Invar_Used.get(1));
- mLighters.put(ItemList.Tool_Lighter_Platinum_Full.get(1));
- mLighters.put(ItemList.Tool_Lighter_Platinum_Used.get(1));
- mLighters.put(ItemUtils.getSimpleStack(ModItems.itemBasicFireMaker));
- }
-
- //Unlit
- if (item.getItemDamage() == 0) {
- boolean hasLighter = false;
- for (ItemStack aPlaySlot : player.inventory.mainInventory) {
- if (aPlaySlot != null) {
- for (ItemStack aLighter : mLighters) {
- if (GT_Utility.areStacksEqual(aPlaySlot, aLighter) || (aPlaySlot.getItem() instanceof MetaGeneratedGregtechTools && aPlaySlot.getItemDamage() == MetaGeneratedGregtechTools.ELECTRIC_LIGHTER)) {
- hasLighter = true;
- break;
- }
- }
- }
- }
- if (hasLighter) {
- item.setItemDamage(1);
- }
- }
- //Lit
- else if (item.getItemDamage() == 1) {
- if (!player.capabilities.isCreativeMode) {
- --item.stackSize;
- }
- world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
- if (!world.isRemote) {
- world.spawnEntityInWorld(new EntityThrowableBomb(world, player));
- }
- /*if (item.stackSize <= 0) {
- item = null;
- }*/
- }
- return item;
- }
-
+ private static AutoMap<ItemStack> mLighters = new AutoMap<ItemStack>();
+ public static IIcon[] icons = new IIcon[10];
+
+ public ItemThrowableBomb() {
+ super(
+ "gtpp.throwable.bomb",
+ "Bomb",
+ AddToCreativeTab.tabMisc,
+ 16,
+ 0,
+ new String[] {"Just like Bomberman", "Have a fire source in inventory to prime"},
+ EnumRarity.uncommon,
+ EnumChatFormatting.GRAY,
+ false,
+ null);
+ this.setHasSubtypes(true);
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
+
+ if (mLighters.isEmpty()) {
+ mLighters.put(ItemUtils.getSimpleStack(Items.flint_and_steel));
+ mLighters.put(ItemList.Tool_Lighter_Invar_Full.get(1));
+ mLighters.put(ItemList.Tool_Lighter_Invar_Used.get(1));
+ mLighters.put(ItemList.Tool_Lighter_Platinum_Full.get(1));
+ mLighters.put(ItemList.Tool_Lighter_Platinum_Used.get(1));
+ mLighters.put(ItemUtils.getSimpleStack(ModItems.itemBasicFireMaker));
+ }
+ // Unlit
+ if (item.getItemDamage() == 0) {
+ boolean hasLighter = false;
+ for (ItemStack aPlaySlot : player.inventory.mainInventory) {
+ if (aPlaySlot != null) {
+ for (ItemStack aLighter : mLighters) {
+ if (GT_Utility.areStacksEqual(aPlaySlot, aLighter)
+ || (aPlaySlot.getItem() instanceof MetaGeneratedGregtechTools
+ && aPlaySlot.getItemDamage() == MetaGeneratedGregtechTools.ELECTRIC_LIGHTER)) {
+ hasLighter = true;
+ break;
+ }
+ }
+ }
+ }
+ if (hasLighter) {
+ item.setItemDamage(1);
+ }
+ }
+ // Lit
+ else if (item.getItemDamage() == 1) {
+ if (!player.capabilities.isCreativeMode) {
+ --item.stackSize;
+ }
+ world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
+ if (!world.isRemote) {
+ world.spawnEntityInWorld(new EntityThrowableBomb(world, player));
+ }
+ /*if (item.stackSize <= 0) {
+ item = null;
+ }*/
+ }
+ return item;
+ }
- @Override
- public void registerIcons(IIconRegister reg) {
- icons[0] = reg.registerIcon(CORE.MODID + ":" + "bomb");
- icons[1] = reg.registerIcon(CORE.MODID + ":" + "bomb_lit");
- }
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ icons[0] = reg.registerIcon(CORE.MODID + ":" + "bomb");
+ icons[1] = reg.registerIcon(CORE.MODID + ":" + "bomb_lit");
+ }
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[meta];
- }
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[meta];
+ }
- @SuppressWarnings({ "unchecked" })
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 2; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
+ @SuppressWarnings({"unchecked"})
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 2; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
- String aLitStatus = "unlit";
- if (stack.getItemDamage() == 0) {
- aLitStatus = EnumChatFormatting.BLUE+"Unlit";
- }
- else if (stack.getItemDamage() == 1) {
- aLitStatus = EnumChatFormatting.RED+"Lit";
- }
- list.add(EnumChatFormatting.GOLD+"Fuse Status: "+aLitStatus);
- super.addInformation(stack, aPlayer, list, bool);
- }
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ String aLitStatus = "unlit";
+ if (stack.getItemDamage() == 0) {
+ aLitStatus = EnumChatFormatting.BLUE + "Unlit";
+ } else if (stack.getItemDamage() == 1) {
+ aLitStatus = EnumChatFormatting.RED + "Lit";
+ }
+ list.add(EnumChatFormatting.GOLD + "Fuse Status: " + aLitStatus);
+ super.addInformation(stack, aPlayer, list, bool);
+ }
- @Override
- public String getItemStackDisplayName(ItemStack p_77653_1_) {
- // TODO Auto-generated method stub
- return super.getItemStackDisplayName(p_77653_1_);
- }
-
-
-
-} \ No newline at end of file
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+ // TODO Auto-generated method stub
+ return super.getItemStackDisplayName(p_77653_1_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java b/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java
index e5c403c503..c3ca06684e 100644
--- a/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java
+++ b/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java
@@ -20,61 +20,76 @@ import net.minecraft.potion.PotionEffect;
public class ItemsFoods {
- public static void load(){
- run();
- }
+ public static void load() {
+ run();
+ }
- private static void run(){
+ private static void run() {
- //Raisin Bread
- ModItems.itemIngotRaisinBread = new BaseItemFood("itemIngotRaisinBread", "Raisin Bread", 3, 1.5f, false, new PotionEffect(Potion.weakness.id, 40, 1)).setAlwaysEdible();
- GT_OreDictUnificator.registerOre("foodRaisinBread", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemIngotRaisinBread", 1));
- //Hot Raisin Bread
- ModItems.itemHotIngotRaisinBread = new BaseItemHotFood("itemHotIngotRaisinBread", 1, 0.5f, "Raisin Bread", 120, ModItems.itemIngotRaisinBread);
- GT_OreDictUnificator.registerOre("foodHotRaisinBread", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemHotIngotRaisinBread", 1));
+ // Raisin Bread
+ ModItems.itemIngotRaisinBread = new BaseItemFood(
+ "itemIngotRaisinBread",
+ "Raisin Bread",
+ 3,
+ 1.5f,
+ false,
+ new PotionEffect(Potion.weakness.id, 40, 1))
+ .setAlwaysEdible();
+ GT_OreDictUnificator.registerOre(
+ "foodRaisinBread", ItemUtils.getItemStackFromFQRN(CORE.MODID + ":itemIngotRaisinBread", 1));
+ // Hot Raisin Bread
+ ModItems.itemHotIngotRaisinBread = new BaseItemHotFood(
+ "itemHotIngotRaisinBread", 1, 0.5f, "Raisin Bread", 120, ModItems.itemIngotRaisinBread);
+ GT_OreDictUnificator.registerOre(
+ "foodHotRaisinBread", ItemUtils.getItemStackFromFQRN(CORE.MODID + ":itemHotIngotRaisinBread", 1));
- //Raisin Bread
- ModItems.itemFoodRaisinToast = new BaseItemFood("itemFoodRaisinToast", "Raisin Toast", 1, 0.5f, false).setAlwaysEdible();
- GT_OreDictUnificator.registerOre("foodRaisinToast", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemFoodRaisinToast", 1));
- //Hot Raisin Bread
- ModItems.itemHotFoodRaisinToast = new BaseItemHotFood("itemHotFoodRaisinToast", 1, 0.5f, "Raisin Toast", 20, ModItems.itemFoodRaisinToast);
- GT_OreDictUnificator.registerOre("foodHotRaisinToast", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemHotFoodRaisinToast", 1));
+ // Raisin Bread
+ ModItems.itemFoodRaisinToast =
+ new BaseItemFood("itemFoodRaisinToast", "Raisin Toast", 1, 0.5f, false).setAlwaysEdible();
+ GT_OreDictUnificator.registerOre(
+ "foodRaisinToast", ItemUtils.getItemStackFromFQRN(CORE.MODID + ":itemFoodRaisinToast", 1));
+ // Hot Raisin Bread
+ ModItems.itemHotFoodRaisinToast = new BaseItemHotFood(
+ "itemHotFoodRaisinToast", 1, 0.5f, "Raisin Toast", 20, ModItems.itemFoodRaisinToast);
+ GT_OreDictUnificator.registerOre(
+ "foodHotRaisinToast", ItemUtils.getItemStackFromFQRN(CORE.MODID + ":itemHotFoodRaisinToast", 1));
- //Raisin Bread
- ModItems.itemFoodCurriedSausages = new BaseItemFood("itemFoodCurriedSausages", "Curried Sausages", 5, 2f, false);
- GT_OreDictUnificator.registerOre("foodCurriedSausages", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemFoodCurriedSausages", 1));
- //Hot Raisin Bread
- ModItems.itemHotFoodCurriedSausages = new BaseItemHotFood("itemHotFoodCurriedSausages", 1, 0.5f, "Curried Sausages", 240, ModItems.itemFoodCurriedSausages);
- GT_OreDictUnificator.registerOre("foodHotCurriedSausages", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemHotFoodCurriedSausages", 1));
+ // Raisin Bread
+ ModItems.itemFoodCurriedSausages =
+ new BaseItemFood("itemFoodCurriedSausages", "Curried Sausages", 5, 2f, false);
+ GT_OreDictUnificator.registerOre(
+ "foodCurriedSausages", ItemUtils.getItemStackFromFQRN(CORE.MODID + ":itemFoodCurriedSausages", 1));
+ // Hot Raisin Bread
+ ModItems.itemHotFoodCurriedSausages = new BaseItemHotFood(
+ "itemHotFoodCurriedSausages", 1, 0.5f, "Curried Sausages", 240, ModItems.itemFoodCurriedSausages);
+ GT_OreDictUnificator.registerOre(
+ "foodHotCurriedSausages",
+ ItemUtils.getItemStackFromFQRN(CORE.MODID + ":itemHotFoodCurriedSausages", 1));
- ModItems.itemMetaFood = new BaseItemMetaFood();
- BaseItemMetaFood.registerFoodsToOreDict();
- addCookingRecipes();
- addFoodDropsToMobs();
-
- }
-
- private static ItemStack getMetaFoodStack(int aID) {
- return ItemUtils.simpleMetaStack(ModItems.itemMetaFood, aID, 1);
- }
-
- private static void addCookingRecipes() {
+ ModItems.itemMetaFood = new BaseItemMetaFood();
+ BaseItemMetaFood.registerFoodsToOreDict();
+ addCookingRecipes();
+ addFoodDropsToMobs();
+ }
- RecipeUtils.addSmeltingRecipe(getMetaFoodStack(0), getMetaFoodStack(1), 0.4F);
- RecipeUtils.addSmeltingRecipe(getMetaFoodStack(2), getMetaFoodStack(3), 0.35F);
- RecipeUtils.addSmeltingRecipe(getMetaFoodStack(4), getMetaFoodStack(5), 0.35F);
- RecipeUtils.addSmeltingRecipe(getMetaFoodStack(6), getMetaFoodStack(7), 0.35F);
-
- }
-
- private static void addFoodDropsToMobs() {
+ private static ItemStack getMetaFoodStack(int aID) {
+ return ItemUtils.simpleMetaStack(ModItems.itemMetaFood, aID, 1);
+ }
- EntityUtils.registerDropsForMob(EntityVillager.class, getMetaFoodStack(0), 2, 1500);
- EntityUtils.registerDropsForMob(EntityHorse.class, getMetaFoodStack(2), 4, 4000);
- EntityUtils.registerDropsForMob(EntityWolf.class, getMetaFoodStack(4), 2, 4000);
- EntityUtils.registerDropsForMob(EntityOcelot.class, getMetaFoodStack(6), 2, 4000);
- EntityUtils.registerDropsForMob(EntityBlaze.class, getMetaFoodStack(8), 1, 500);
-
- }
+ private static void addCookingRecipes() {
+ RecipeUtils.addSmeltingRecipe(getMetaFoodStack(0), getMetaFoodStack(1), 0.4F);
+ RecipeUtils.addSmeltingRecipe(getMetaFoodStack(2), getMetaFoodStack(3), 0.35F);
+ RecipeUtils.addSmeltingRecipe(getMetaFoodStack(4), getMetaFoodStack(5), 0.35F);
+ RecipeUtils.addSmeltingRecipe(getMetaFoodStack(6), getMetaFoodStack(7), 0.35F);
+ }
+
+ private static void addFoodDropsToMobs() {
+
+ EntityUtils.registerDropsForMob(EntityVillager.class, getMetaFoodStack(0), 2, 1500);
+ EntityUtils.registerDropsForMob(EntityHorse.class, getMetaFoodStack(2), 4, 4000);
+ EntityUtils.registerDropsForMob(EntityWolf.class, getMetaFoodStack(4), 2, 4000);
+ EntityUtils.registerDropsForMob(EntityOcelot.class, getMetaFoodStack(6), 2, 4000);
+ EntityUtils.registerDropsForMob(EntityBlaze.class, getMetaFoodStack(8), 1, 500);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/init/ItemsMultiTools.java b/src/main/java/gtPlusPlus/core/item/init/ItemsMultiTools.java
index 9f87408b56..2a5fa9107d 100644
--- a/src/main/java/gtPlusPlus/core/item/init/ItemsMultiTools.java
+++ b/src/main/java/gtPlusPlus/core/item/init/ItemsMultiTools.java
@@ -1,7 +1,6 @@
package gtPlusPlus.core.item.init;
import gregtech.api.enums.Materials;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
@@ -12,63 +11,58 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
public class ItemsMultiTools {
- public static void load(){
- run();
- }
-
- private static void run(){
-
- //Load Multitools
- final boolean gtStyleTools = LoadedMods.Gregtech;
- if (CORE.ConfigSwitches.enableMultiSizeTools){
-
- //GT Materials
- final Materials[] rm = Materials.values();
- for (final Materials m : rm){
- toolFactoryGT(m, gtStyleTools);
- }
-
- //GT++ Materials
- toolFactory(ALLOY.HASTELLOY_C276);
- toolFactory(ALLOY.HASTELLOY_N);
- toolFactory(ALLOY.HASTELLOY_W);
- toolFactory(ALLOY.HASTELLOY_X);
- toolFactory(ALLOY.INCOLOY_020);
- toolFactory(ALLOY.INCOLOY_DS);
- toolFactory(ALLOY.INCOLOY_MA956);
- toolFactory(ALLOY.INCONEL_625);
- toolFactory(ALLOY.INCONEL_690);
- toolFactory(ALLOY.INCONEL_792);
- toolFactory(ALLOY.LEAGRISIUM);
- toolFactory(ALLOY.TANTALLOY_60);
- toolFactory(ALLOY.TANTALLOY_61);
- toolFactory(ALLOY.STABALLOY);
- toolFactory(ALLOY.QUANTUM);
- //toolFactory(ALLOY.BEDROCKIUM);
- toolFactory(ALLOY.POTIN);
- toolFactory(ALLOY.TUMBAGA);
- toolFactory(ALLOY.TALONITE);
- toolFactory(ALLOY.STELLITE);
- toolFactory(ALLOY.TUNGSTEN_CARBIDE);
- toolFactory(ALLOY.TANTALUM_CARBIDE);
-
+ public static void load() {
+ run();
+ }
- }
+ private static void run() {
- }
+ // Load Multitools
+ final boolean gtStyleTools = LoadedMods.Gregtech;
+ if (CORE.ConfigSwitches.enableMultiSizeTools) {
+ // GT Materials
+ final Materials[] rm = Materials.values();
+ for (final Materials m : rm) {
+ toolFactoryGT(m, gtStyleTools);
+ }
- private static boolean toolFactoryGT(final Materials m, final boolean b){
- ModItems.MP_GTMATERIAL = ItemUtils.generateMultiPick(b, m);
- ModItems.MS_GTMATERIAL = ItemUtils.generateMultiShovel(b, m);
- return true;
- }
+ // GT++ Materials
+ toolFactory(ALLOY.HASTELLOY_C276);
+ toolFactory(ALLOY.HASTELLOY_N);
+ toolFactory(ALLOY.HASTELLOY_W);
+ toolFactory(ALLOY.HASTELLOY_X);
+ toolFactory(ALLOY.INCOLOY_020);
+ toolFactory(ALLOY.INCOLOY_DS);
+ toolFactory(ALLOY.INCOLOY_MA956);
+ toolFactory(ALLOY.INCONEL_625);
+ toolFactory(ALLOY.INCONEL_690);
+ toolFactory(ALLOY.INCONEL_792);
+ toolFactory(ALLOY.LEAGRISIUM);
+ toolFactory(ALLOY.TANTALLOY_60);
+ toolFactory(ALLOY.TANTALLOY_61);
+ toolFactory(ALLOY.STABALLOY);
+ toolFactory(ALLOY.QUANTUM);
+ // toolFactory(ALLOY.BEDROCKIUM);
+ toolFactory(ALLOY.POTIN);
+ toolFactory(ALLOY.TUMBAGA);
+ toolFactory(ALLOY.TALONITE);
+ toolFactory(ALLOY.STELLITE);
+ toolFactory(ALLOY.TUNGSTEN_CARBIDE);
+ toolFactory(ALLOY.TANTALUM_CARBIDE);
+ }
+ }
- private static boolean toolFactory(final Material m){
- Logger.WARNING("Generating Multi-Tools for "+m.getLocalizedName());
- ModItems.MP_GTMATERIAL = ItemUtils.generateMultiPick(m);
- ModItems.MS_GTMATERIAL = ItemUtils.generateMultiShovel(m);
- return true;
- }
+ private static boolean toolFactoryGT(final Materials m, final boolean b) {
+ ModItems.MP_GTMATERIAL = ItemUtils.generateMultiPick(b, m);
+ ModItems.MS_GTMATERIAL = ItemUtils.generateMultiShovel(b, m);
+ return true;
+ }
+ private static boolean toolFactory(final Material m) {
+ Logger.WARNING("Generating Multi-Tools for " + m.getLocalizedName());
+ ModItems.MP_GTMATERIAL = ItemUtils.generateMultiPick(m);
+ ModItems.MS_GTMATERIAL = ItemUtils.generateMultiShovel(m);
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java b/src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java
index d42ac85012..a9c4adac97 100644
--- a/src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java
+++ b/src/main/java/gtPlusPlus/core/item/materials/DustDecayable.java
@@ -2,8 +2,13 @@ package gtPlusPlus.core.item.materials;
import static gtPlusPlus.core.util.minecraft.ItemUtils.getSimpleStack;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.handler.Recipes.DecayableRecipe;
+import gtPlusPlus.core.item.base.BaseItemTickable;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import java.util.List;
-
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,87 +16,83 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import gregtech.api.util.GT_OreDictUnificator;
-import gtPlusPlus.core.handler.Recipes.DecayableRecipe;
-import gtPlusPlus.core.item.base.BaseItemTickable;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
public class DustDecayable extends BaseItemTickable {
- private final Item turnsIntoItem;
- private final int radLevel;
-
- public DustDecayable(String unlocal, int colour, int maxTicks, String[] desc1, Item turnsInto, int radLevel) {
- super(true, true, unlocal, colour, (maxTicks/1), desc1);
- this.turnsIntoItem = turnsInto;
- this.radLevel = radLevel;
- GT_OreDictUnificator.registerOre(unlocal, ItemUtils.getSimpleStack(this));
- new DecayableRecipe(maxTicks, getSimpleStack(this), getSimpleStack(turnsInto));
- }
+ private final Item turnsIntoItem;
+ private final int radLevel;
+
+ public DustDecayable(String unlocal, int colour, int maxTicks, String[] desc1, Item turnsInto, int radLevel) {
+ super(true, true, unlocal, colour, (maxTicks / 1), desc1);
+ this.turnsIntoItem = turnsInto;
+ this.radLevel = radLevel;
+ GT_OreDictUnificator.registerOre(unlocal, ItemUtils.getSimpleStack(this));
+ new DecayableRecipe(maxTicks, getSimpleStack(this), getSimpleStack(turnsInto));
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ String gt = "gregtech" + ":" + "materialicons/" + "NUCLEAR" + "/" + "dust";
+ this.mIcon[0] = reg.registerIcon(gt);
+ String gt2 = "gregtech" + ":" + "materialicons/" + "NUCLEAR" + "/" + "dust" + "_OVERLAY";
+ this.mIcon[1] = reg.registerIcon(gt2);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ super.addInformation(stack, player, list, bool);
+ if (this.radLevel > 0) {
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack iStack,
+ final World world,
+ final Entity entityHolding,
+ final int p_77663_4_,
+ final boolean p_77663_5_) {
+ if (world == null || iStack == null) {
+ return;
+ }
+ if (world.isRemote) {
+ return;
+ }
+
+ if (entityHolding instanceof EntityPlayer) {
+ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode) {
+ EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.radLevel, world, entityHolding);
+ }
+ }
+ boolean a1, a2;
+
+ a1 = this.isTicking(world, iStack);
+ a2 = tickItemTag(world, iStack);
- @Override
- public void registerIcons(IIconRegister reg) {
- String gt = "gregtech" + ":" + "materialicons/"+"NUCLEAR"+"/" + "dust";
- this.mIcon[0] = reg.registerIcon(gt);
- String gt2 = "gregtech" + ":" + "materialicons/"+"NUCLEAR"+"/" + "dust" + "_OVERLAY";
- this.mIcon[1] = reg.registerIcon(gt2);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- super.addInformation(stack, player, list, bool);
- if (this.radLevel > 0) {
- list.add(CORE.GT_Tooltip_Radioactive);
- }
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (world == null || iStack == null) {
- return;
- }
- if (world.isRemote) {
- return;
- }
-
- if (entityHolding instanceof EntityPlayer){
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.radLevel, world, entityHolding);
- }
- }
- boolean a1, a2;
-
- a1 = this.isTicking(world, iStack);
- a2 = tickItemTag(world, iStack);
-
- if (!a1 && !a2) {
- if (entityHolding instanceof EntityPlayer){
- ItemStack replacement = ItemUtils.getSimpleStack(getDecayResult());
- //Logger.INFO("Replacing "+iStack.getDisplayName()+" with "+replacement.getDisplayName()+".");
- final ItemStack tempTransform = replacement;
- if (iStack.stackSize > 1){
- int u = iStack.stackSize;
- tempTransform.stackSize = u;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
- for (int l=0;l<u;l++){
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
+ if (!a1 && !a2) {
+ if (entityHolding instanceof EntityPlayer) {
+ ItemStack replacement = ItemUtils.getSimpleStack(getDecayResult());
+ // Logger.INFO("Replacing "+iStack.getDisplayName()+" with "+replacement.getDisplayName()+".");
+ final ItemStack tempTransform = replacement;
+ if (iStack.stackSize > 1) {
+ int u = iStack.stackSize;
+ tempTransform.stackSize = u;
+ ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
+ for (int l = 0; l < u; l++) {
+ ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
+ }
- }
- else {
- tempTransform.stackSize=1;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
- }
- }
- }
+ } else {
+ tempTransform.stackSize = 1;
+ ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
+ ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
+ }
+ }
+ }
+ }
- public Item getDecayResult() {
- return turnsIntoItem;
- }
-
+ public Item getDecayResult() {
+ return turnsIntoItem;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/materials/MaterialHandler.java b/src/main/java/gtPlusPlus/core/item/materials/MaterialHandler.java
index 40fc6539e6..74c9115c3b 100644
--- a/src/main/java/gtPlusPlus/core/item/materials/MaterialHandler.java
+++ b/src/main/java/gtPlusPlus/core/item/materials/MaterialHandler.java
@@ -2,9 +2,6 @@ package gtPlusPlus.core.item.materials;
public class MaterialHandler {
- @SuppressWarnings("unused")
- private String Staballoy;
-
-
-
+ @SuppressWarnings("unused")
+ private String Staballoy;
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/ConnectedBlockFinder.java b/src/main/java/gtPlusPlus/core/item/tool/misc/ConnectedBlockFinder.java
index 555635741e..8c58c1b927 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/ConnectedBlockFinder.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/ConnectedBlockFinder.java
@@ -1,13 +1,14 @@
package gtPlusPlus.core.item.tool.misc;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -16,127 +17,118 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
-
-public class ConnectedBlockFinder extends BaseItemWithDamageValue{
-
- public ConnectedBlockFinder() {
- super("item.test.connector");
- this.setTextureName("stick");
- this.setMaxStackSize(1);
- this.setMaxDamage(10000);
- setCreativeTab(AddToCreativeTab.tabTools);
- GameRegistry.registerItem(this, getUnlocalizedName());
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GRAY+"Finds connected blocks, turns them to Glass once found.");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public boolean doesContainerItemLeaveCraftingGrid(final ItemStack itemStack){
- return false;
- }
-
- @Override
- public boolean getShareTag(){
- return true;
- }
-
- @Override
- public boolean hasContainerItem(final ItemStack itemStack){
- return true;
- }
- @Override
- public ItemStack getContainerItem(final ItemStack itemStack){
- return itemStack;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.uncommon;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return false;
- }
-
-
- @Override
- public boolean onItemUse(
- ItemStack stack, EntityPlayer player, World world,
- int x, int y, int z, int side,
- float hitX, float hitY, float hitZ) {
-
- BlockPos mStartPoint = new BlockPos(x,y,z, world);
- Block mBlockType = world.getBlock(x, y, z);
- int mBlockMeta = mBlockType.getDamageValue(world, x, y, z);
-
- //Return if Air.
- if (world.isAirBlock(x, y, z)) {
- return false;
- }
-
- int breaker = 0;
- Set<BlockPos> mTotalIndex = new HashSet<BlockPos>();
-
- Set<BlockPos> mFirstSearch = new HashSet<BlockPos>();
- Set<BlockPos> mSearch_A = new HashSet<BlockPos>();
-
- Set<BlockPos> mSearch_B = new HashSet<BlockPos>();
- Set<BlockPos> mSearch_C = new HashSet<BlockPos>();
- Set<BlockPos> mSearch_D = new HashSet<BlockPos>();
-
- mFirstSearch.add(mStartPoint);
- mTotalIndex.add(mStartPoint);
-
-
-
-
- for (BlockPos G : mSearch_D) {
- if (!world.isAirBlock(G.xPos, G.yPos, G.zPos)) {
- world.setBlock(G.xPos, G.yPos, G.zPos, Blocks.diamond_ore);
- }
- }
-
-
-
- return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
- }
-
- public Set<BlockPos> getValidNeighboursForSet(Set<BlockPos> set){
- Set<BlockPos> results = set;
- for (BlockPos F : set) {
- results.addAll(F.getValidNeighboursAndSelf());
- }
- return results;
- }
-
- public Set<BlockPos> getExtraNeighboursForSet(Set<BlockPos> set){
- Set<BlockPos> results = set;
- for (BlockPos F : set) {
- results.addAll(F.getValidNeighboursAndSelf());
- }
- return results;
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
- // TODO Auto-generated method stub
- return super.onItemRightClick(p_77659_1_, p_77659_2_, p_77659_3_);
- }
-
-
-
-
-
-
-
+public class ConnectedBlockFinder extends BaseItemWithDamageValue {
+
+ public ConnectedBlockFinder() {
+ super("item.test.connector");
+ this.setTextureName("stick");
+ this.setMaxStackSize(1);
+ this.setMaxDamage(10000);
+ setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(this, getUnlocalizedName());
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GRAY + "Finds connected blocks, turns them to Glass once found.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public boolean doesContainerItemLeaveCraftingGrid(final ItemStack itemStack) {
+ return false;
+ }
+
+ @Override
+ public boolean getShareTag() {
+ return true;
+ }
+
+ @Override
+ public boolean hasContainerItem(final ItemStack itemStack) {
+ return true;
+ }
+
+ @Override
+ public ItemStack getContainerItem(final ItemStack itemStack) {
+ return itemStack;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return false;
+ }
+
+ @Override
+ public boolean onItemUse(
+ ItemStack stack,
+ EntityPlayer player,
+ World world,
+ int x,
+ int y,
+ int z,
+ int side,
+ float hitX,
+ float hitY,
+ float hitZ) {
+
+ BlockPos mStartPoint = new BlockPos(x, y, z, world);
+ Block mBlockType = world.getBlock(x, y, z);
+ int mBlockMeta = mBlockType.getDamageValue(world, x, y, z);
+
+ // Return if Air.
+ if (world.isAirBlock(x, y, z)) {
+ return false;
+ }
+
+ int breaker = 0;
+ Set<BlockPos> mTotalIndex = new HashSet<BlockPos>();
+
+ Set<BlockPos> mFirstSearch = new HashSet<BlockPos>();
+ Set<BlockPos> mSearch_A = new HashSet<BlockPos>();
+
+ Set<BlockPos> mSearch_B = new HashSet<BlockPos>();
+ Set<BlockPos> mSearch_C = new HashSet<BlockPos>();
+ Set<BlockPos> mSearch_D = new HashSet<BlockPos>();
+
+ mFirstSearch.add(mStartPoint);
+ mTotalIndex.add(mStartPoint);
+
+ for (BlockPos G : mSearch_D) {
+ if (!world.isAirBlock(G.xPos, G.yPos, G.zPos)) {
+ world.setBlock(G.xPos, G.yPos, G.zPos, Blocks.diamond_ore);
+ }
+ }
+
+ return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
+ }
+
+ public Set<BlockPos> getValidNeighboursForSet(Set<BlockPos> set) {
+ Set<BlockPos> results = set;
+ for (BlockPos F : set) {
+ results.addAll(F.getValidNeighboursAndSelf());
+ }
+ return results;
+ }
+
+ public Set<BlockPos> getExtraNeighboursForSet(Set<BlockPos> set) {
+ Set<BlockPos> results = set;
+ for (BlockPos F : set) {
+ results.addAll(F.getValidNeighboursAndSelf());
+ }
+ return results;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
+ // TODO Auto-generated method stub
+ return super.onItemRightClick(p_77659_1_, p_77659_2_, p_77659_3_);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/DebugScanner.java b/src/main/java/gtPlusPlus/core/item/tool/misc/DebugScanner.java
index 0170df0dc7..a9272d8baa 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/DebugScanner.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/DebugScanner.java
@@ -15,90 +15,106 @@ import net.minecraft.world.World;
public class DebugScanner extends CoreItem {
- public DebugScanner() {
- super("gtpp.debug.scanner", AddToCreativeTab.tabTools, 1, 0,
- new String[] {
- "Used to obtain information from GT/GT++ content",
- "Right Click to use",
- },
- EnumRarity.epic);
- setTextureName(CORE.MODID + ":itemStickyRubber");
- }
+ public DebugScanner() {
+ super(
+ "gtpp.debug.scanner",
+ AddToCreativeTab.tabTools,
+ 1,
+ 0,
+ new String[] {
+ "Used to obtain information from GT/GT++ content", "Right Click to use",
+ },
+ EnumRarity.epic);
+ setTextureName(CORE.MODID + ":itemStickyRubber");
+ }
- @Override
- public boolean isDamageable() {
- return false;
- }
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
- @Override
- public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int p_77648_4_,
- int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
- // TODO Auto-generated method stub
- return super.onItemUse(aStack, aPlayer, aWorld, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_,
- p_77648_9_, p_77648_10_);
- }
+ @Override
+ public boolean onItemUse(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int p_77648_4_,
+ int p_77648_5_,
+ int p_77648_6_,
+ int p_77648_7_,
+ float p_77648_8_,
+ float p_77648_9_,
+ float p_77648_10_) {
+ // TODO Auto-generated method stub
+ return super.onItemUse(
+ aStack,
+ aPlayer,
+ aWorld,
+ p_77648_4_,
+ p_77648_5_,
+ p_77648_6_,
+ p_77648_7_,
+ p_77648_8_,
+ p_77648_9_,
+ p_77648_10_);
+ }
- @Override
- public boolean isRepairable() {
- return false;
- }
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
- @Override
- public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
- // TODO Auto-generated method stub
- return super.onItemRightClick(p_77659_1_, p_77659_2_, p_77659_3_);
- }
+ @Override
+ public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
+ // TODO Auto-generated method stub
+ return super.onItemRightClick(p_77659_1_, p_77659_2_, p_77659_3_);
+ }
- @Override
- public float getDigSpeed(ItemStack itemstack, Block block, int metadata) {
- return 0f;
- }
+ @Override
+ public float getDigSpeed(ItemStack itemstack, Block block, int metadata) {
+ return 0f;
+ }
- @Override
- public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
- if (entity != null && player != null) {
- PlayerUtils.messagePlayer(player, "Entity ID: "+entity.getEntityId());
- PlayerUtils.messagePlayer(player, "UUID: "+entity.getUniqueID());
- PlayerUtils.messagePlayer(player, "Invulnerable? "+entity.isEntityInvulnerable());
- PlayerUtils.messagePlayer(player, "Invisible? "+entity.isInvisible());
- PlayerUtils.messagePlayer(player, "Age: "+entity.ticksExisted);
-
- if (entity instanceof EntityLivingBase) {
- EntityLivingBase g = (EntityLivingBase) entity;
- PlayerUtils.messagePlayer(player, "Health: "+g.getHealth()+"/"+g.getMaxHealth());
- PlayerUtils.messagePlayer(player, "On ground? "+g.onGround);
- PlayerUtils.messagePlayer(player, "Child? "+g.isChild());
- }
- if (entity instanceof EntityLiving) {
- EntityLiving g = (EntityLiving) entity;
- PlayerUtils.messagePlayer(player, "Can Loot? "+g.canPickUpLoot());
-
- }
- if (entity instanceof EntityPlayer) {
- EntityPlayer y = (EntityPlayer) entity;
- PlayerUtils.messagePlayer(player, "Experience: "+y.experience);
- PlayerUtils.messagePlayer(player, "Name: "+y.getCommandSenderName());
- }
-
- }
- return true;
- }
+ @Override
+ public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
+ if (entity != null && player != null) {
+ PlayerUtils.messagePlayer(player, "Entity ID: " + entity.getEntityId());
+ PlayerUtils.messagePlayer(player, "UUID: " + entity.getUniqueID());
+ PlayerUtils.messagePlayer(player, "Invulnerable? " + entity.isEntityInvulnerable());
+ PlayerUtils.messagePlayer(player, "Invisible? " + entity.isInvisible());
+ PlayerUtils.messagePlayer(player, "Age: " + entity.ticksExisted);
- @Override
- public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) {
- return false;
- }
+ if (entity instanceof EntityLivingBase) {
+ EntityLivingBase g = (EntityLivingBase) entity;
+ PlayerUtils.messagePlayer(player, "Health: " + g.getHealth() + "/" + g.getMaxHealth());
+ PlayerUtils.messagePlayer(player, "On ground? " + g.onGround);
+ PlayerUtils.messagePlayer(player, "Child? " + g.isChild());
+ }
+ if (entity instanceof EntityLiving) {
+ EntityLiving g = (EntityLiving) entity;
+ PlayerUtils.messagePlayer(player, "Can Loot? " + g.canPickUpLoot());
+ }
+ if (entity instanceof EntityPlayer) {
+ EntityPlayer y = (EntityPlayer) entity;
+ PlayerUtils.messagePlayer(player, "Experience: " + y.experience);
+ PlayerUtils.messagePlayer(player, "Name: " + y.getCommandSenderName());
+ }
+ }
+ return true;
+ }
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return true;
- }
+ @Override
+ public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) {
+ return false;
+ }
- @Override
- public int getHarvestLevel(ItemStack stack, String toolClass) {
- return 0;
- }
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return true;
+ }
-
-
+ @Override
+ public int getHarvestLevel(ItemStack stack, String toolClass) {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/FakeGregtechTool.java b/src/main/java/gtPlusPlus/core/item/tool/misc/FakeGregtechTool.java
index 47856b44c0..ac63ef24f7 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/FakeGregtechTool.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/FakeGregtechTool.java
@@ -1,74 +1,69 @@
package gtPlusPlus.core.item.tool.misc;
+import gregtech.api.enums.Materials;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.CoreItem;
+import gtPlusPlus.core.util.Utils;
import java.util.List;
-
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import gregtech.api.enums.Materials;
-
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.CoreItem;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
-public class FakeGregtechTool extends CoreItem{
-
- public final int componentColour;
- public Object extraData;
+public class FakeGregtechTool extends CoreItem {
- protected IIcon base[] = new IIcon[6];
- protected IIcon overlay[] = new IIcon[6];
+ public final int componentColour;
+ public Object extraData;
- public FakeGregtechTool() {
- super("GregeriousT's Display Tool", AddToCreativeTab.tabTools, 1);
- short[] tempCol = Materials.TungstenSteel.getRGBA();
- this.componentColour = Utils.rgbtoHexValue(tempCol[0], tempCol[1], tempCol[2]);
- }
+ protected IIcon base[] = new IIcon[6];
+ protected IIcon overlay[] = new IIcon[6];
- @Override
- public void registerIcons(final IIconRegister i) {
- //ScrewDriver
- this.base[0] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "toolHeadScrewdriver");
- this.overlay[0] = i.registerIcon("gregtech" + ":" + "iconsets/" + "HANDLE_SCREWDRIVER");
- //Soldering iron
- this.base[1] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "toolHeadSoldering");
- this.overlay[1] = i.registerIcon("gregtech" + ":" + "iconsets/" + "HANDLE_SOLDERING");
- //Mallet
- this.base[2] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "handleMallet");
- this.overlay[2] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "toolHeadMallet");
- //Hammer
- this.base[3] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "stick");
- this.overlay[3] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "toolHeadHammer");
- //Wrench
- this.base[4] = i.registerIcon("gregtech" + ":" + "iconsets/" + "WRENCH");
- this.overlay[4] = i.registerIcon("gregtech" + ":" + "iconsets/" + "WRENCH_OVERLAY");
- //Crowbar
- this.base[5] = i.registerIcon("gregtech" + ":" + "iconsets/" + "CROWBAR");
- this.overlay[5] = i.registerIcon("gregtech" + ":" + "iconsets/" + "CROWBAR_OVERLAY");
- }
+ public FakeGregtechTool() {
+ super("GregeriousT's Display Tool", AddToCreativeTab.tabTools, 1);
+ short[] tempCol = Materials.TungstenSteel.getRGBA();
+ this.componentColour = Utils.rgbtoHexValue(tempCol[0], tempCol[1], tempCol[2]);
+ }
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
- if (renderPass == 1){
- return Utils.rgbtoHexValue(230, 230, 230);
- }
- return this.componentColour;
- }
+ @Override
+ public void registerIcons(final IIconRegister i) {
+ // ScrewDriver
+ this.base[0] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "toolHeadScrewdriver");
+ this.overlay[0] = i.registerIcon("gregtech" + ":" + "iconsets/" + "HANDLE_SCREWDRIVER");
+ // Soldering iron
+ this.base[1] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "toolHeadSoldering");
+ this.overlay[1] = i.registerIcon("gregtech" + ":" + "iconsets/" + "HANDLE_SOLDERING");
+ // Mallet
+ this.base[2] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "handleMallet");
+ this.overlay[2] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "toolHeadMallet");
+ // Hammer
+ this.base[3] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "stick");
+ this.overlay[3] = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "toolHeadHammer");
+ // Wrench
+ this.base[4] = i.registerIcon("gregtech" + ":" + "iconsets/" + "WRENCH");
+ this.overlay[4] = i.registerIcon("gregtech" + ":" + "iconsets/" + "WRENCH_OVERLAY");
+ // Crowbar
+ this.base[5] = i.registerIcon("gregtech" + ":" + "iconsets/" + "CROWBAR");
+ this.overlay[5] = i.registerIcon("gregtech" + ":" + "iconsets/" + "CROWBAR_OVERLAY");
+ }
- @Override
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
+ if (renderPass == 1) {
+ return Utils.rgbtoHexValue(230, 230, 230);
+ }
+ return this.componentColour;
+ }
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 6; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 6; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java b/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
index bbb09b154c..91dfb88ea3 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
@@ -2,12 +2,6 @@ package gtPlusPlus.core.item.tool.misc;
import static gregtech.api.enums.GT_Values.V;
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -37,6 +31,11 @@ import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IElectricItemManager;
import ic2.api.item.ISpecialElectricItem;
+import java.util.ArrayList;
+import java.util.BitSet;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -60,1244 +59,1315 @@ import net.minecraftforge.fluids.IFluidTank;
public class GregtechPump extends Item implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
- /**
- * Right Click Functions
- */
-
- @Override
- public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int a4,
- float p_77648_8_, float p_77648_9_, float p_77648_10_) {
- if (aStack == null || aPlayer == null || aWorld == null || aWorld.isRemote) {
- return false;
- }
- if (!aWorld.isRemote && tryDrainTile(aStack, aWorld, aPlayer, aX, aY, aZ)) {
- return true;
- } else {
- //return super.onItemUse(aStack, aPlayer, aWorld, aX, aY, aZ, a4, p_77648_8_, p_77648_9_, p_77648_10_);
- return false;
- }
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
- return p_77659_1_;
- }
-
- /**
- * GT Code
- */
-
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- private final HashMap<Short, ArrayList<IItemBehaviour<GregtechPump>>> mItemBehaviors = new HashMap<>();
- public final short mOffset, mItemAmount;
- public final BitSet mEnabledItems;
- public final BitSet mVisibleItems;
- /** The unlocalized name of this item. */
- private String unlocalizedName;
-
- private final HashMap<Integer, IIcon> mIconMap = new LinkedHashMap<Integer, IIcon>();
- private final HashMap<Integer, EnumRarity> rarity = new LinkedHashMap<Integer, EnumRarity>();
- private final HashMap<Integer, EnumChatFormatting> descColour = new LinkedHashMap<Integer, EnumChatFormatting>();
- private final HashMap<Integer, String> itemName = new LinkedHashMap<Integer, String>();
- private final HashMap<Integer, String> itemDescription = new LinkedHashMap<Integer, String>();
- private final HashMap<Integer, Boolean> hasEffect = new LinkedHashMap<Integer, Boolean>();
-
- public final HashMap<Short, Long[]> mElectricStats = new LinkedHashMap<Short, Long[]>();
- public final HashMap<Short, Short> mBurnValues = new LinkedHashMap<Short, Short>();
-
- public void registerPumpType(final int aID, final String aPumpName, final int aEuMax, final int aTier) {
- ModItems.toolGregtechPump.registerItem(aID, // ID
- aPumpName, // Name
- aEuMax, // Eu Storage
- (short) aTier, // Tier
- "Can be used to remove fluids from GT machine input & output slots.", // Tooltip
- aTier <= 0 ? EnumRarity.common : aTier == 1 ? EnumRarity.uncommon : aTier == 2 ? EnumRarity.rare : aTier == 3 ? EnumRarity.epic : EnumRarity.common, // Rarity
- EnumChatFormatting.GRAY, // Desc colour
- false // Effect?
- );
- }
-
- public GregtechPump() {
- this("MU-metatool.01", AddToCreativeTab.tabTools, (short) 1000, (short) 31766);
- }
-
- public GregtechPump(final String unlocalizedName, final CreativeTabs creativeTab, final short aOffset,
- final short aItemAmount) {
- this.mEnabledItems = new BitSet(aItemAmount);
- this.mVisibleItems = new BitSet(aItemAmount);
- this.mOffset = (short) Math.min(32766, aOffset);
- this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset);
- this.setHasSubtypes(true);
- this.setMaxDamage(0);
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(creativeTab);
- this.setMaxStackSize(1);
- if (GameRegistry.findItem(CORE.MODID, unlocalizedName) == null) {
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- }
-
- public void registerItem(final int id, final String localizedName, final long euStorage, final int tier,
- final String description) {
- this.registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common,
- EnumChatFormatting.GRAY, false);
- }
-
- public void registerItem(final int id, final String localizedName, final long euStorage, final int tier,
- final String description, final int burnTime) {
- this.registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common,
- EnumChatFormatting.GRAY, false);
- this.setBurnValue(id, burnTime);
- }
-
- public void registerItem(final int id, final String localizedName, final long euStorage, final short tier,
- final String description, final EnumRarity regRarity, final EnumChatFormatting colour,
- final boolean Effect) {
- this.addItem(id, localizedName, EnumChatFormatting.YELLOW + "Electric", new Object[] {});
- if (euStorage > 0 && tier > 0)
- this.setElectricStats(this.mOffset + id, euStorage, GT_Values.V[tier], tier, -3L, true);
- this.rarity.put(id, regRarity);
- this.itemName.put(id, localizedName);
- this.itemDescription.put(id, description);
- this.descColour.put(id, colour);
- this.hasEffect.put(id, Effect);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- int h = getCorrectMetaForItemstack(par1ItemStack);
- if (this.rarity.get(h) != null) {
- return this.rarity.get(h);
- }
- return EnumRarity.common;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
- int h = getCorrectMetaForItemstack(par1ItemStack);
- if (this.hasEffect.get(h) != null) {
- return this.hasEffect.get(h);
- }
- return false;
- }
-
- @SuppressWarnings({ "unchecked" })
- @Override
- public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList, final boolean aF3_H) {
- // aList.add("Meta: "+(aStack.getItemDamage()-mOffset));
-
- int aOffsetMeta = getCorrectMetaForItemstack(aStack);
-
- if ((this.descColour.get(aOffsetMeta) != null)
- && (this.itemDescription.get(aOffsetMeta) != null)) {
- aList.add(this.descColour.get(aOffsetMeta)
- + this.itemDescription.get(aOffsetMeta));
- }
-
-
- if (aOffsetMeta <= 3) {
- FluidStack f = getFluid(aStack);
- aList.add("Cannot drain any other standard fluid container block");
- aList.add("Cannot be emptied via RMB, use inside a tank with GUI");
- aList.add(EnumChatFormatting.DARK_GRAY+"This is technically just a fancy fluid cell");
- aList.add(EnumChatFormatting.BLUE + (f != null ? f.getLocalizedName() : "No Fluids Contained"));
- aList.add(EnumChatFormatting.BLUE + (f != null ? ""+f.amount : ""+0) + "L" + " / " + getCapacity(aStack) + "L");
- }
-
- final Long[] tStats = this.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 {
- final long tCharge = this.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] < V.length ? tStats[2] : V.length - 1 : 1)]
- + EnumChatFormatting.GRAY);
- }
- }
- }
-
- final ArrayList<IItemBehaviour<GregtechPump>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final IItemBehaviour<GregtechPump> tBehavior : tList) {
- aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
- }
- }
- }
-
- @Override
- public final Item getChargedItem(final ItemStack itemStack) {
- return this;
- }
-
- @Override
- public final Item getEmptyItem(final ItemStack itemStack) {
- return this;
- }
-
- @Override
- public final double getMaxCharge(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.abs(tStats[0]);
- }
-
- @Override
- public final double getTransferLimit(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.max(tStats[1], tStats[3]);
- }
-
- @Override
- public final int getTier(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
- }
-
- @Override
- public final double charge(final ItemStack aStack, final double aCharge, final int aTier,
- final boolean aIgnoreTransferLimit, final boolean aSimulate) {
- final Long[] tStats = this.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;
- }
- final long tChargeBefore = this.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) {
- this.setCharge(aStack, tNewCharge);
- }
- return tNewCharge - tChargeBefore;
- }
-
- @Override
- public final double discharge(final ItemStack aStack, final double aCharge, final int aTier,
- final boolean aIgnoreTransferLimit, final boolean aBatteryAlike, final boolean aSimulate) {
- final Long[] tStats = this.getElectricStats(aStack);
- if ((tStats == null) || (tStats[2] > aTier)) {
- return 0;
- }
- if (aBatteryAlike && !this.canProvideEnergy(aStack)) {
- return 0;
- }
- if (tStats[3] > 0) {
- if ((aCharge < tStats[3]) || (aStack.stackSize < 1)) {
- return 0;
- }
- if (!aSimulate) {
- aStack.stackSize--;
- }
- return tStats[3];
- }
- final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = Math.max(0,
- tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
- if (!aSimulate) {
- this.setCharge(aStack, tNewCharge);
- }
- return tChargeBefore - tNewCharge;
- }
-
- @Override
- public final double getCharge(final ItemStack aStack) {
- return this.getRealCharge(aStack);
- }
-
- @Override
- public final boolean canUse(final ItemStack aStack, final double aAmount) {
- return this.getRealCharge(aStack) >= aAmount;
- }
-
- @Override
- public final boolean use(final ItemStack aStack, final double aAmount, final EntityLivingBase aPlayer) {
- this.chargeFromArmor(aStack, aPlayer);
- if ((aPlayer instanceof EntityPlayer) && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) {
- return true;
- }
- final double tTransfer = this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
- if (tTransfer == aAmount) {
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return true;
- }
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return false;
- }
-
- @Override
- public final boolean canProvideEnergy(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return false;
- }
- return (tStats[3] > 0) || ((aStack.stackSize == 1) && ((tStats[3] == -2) || (tStats[3] == -3)));
- }
-
- @Override
- public final void chargeFromArmor(final ItemStack aStack, final EntityLivingBase aPlayer) {
- if ((aPlayer == null) || aPlayer.worldObj.isRemote) {
- return;
- }
- for (int i = 1; i < 5; i++) {
- final ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
- if (GT_ModHandler.isElectricItem(tArmor)) {
- final IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
- if (tArmorItem.canProvideEnergy(tArmor) && (tArmorItem.getTier(tArmor) >= this.getTier(aStack))) {
- final double tCharge = ElectricItem.manager.discharge(tArmor,
- this.charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true),
- Integer.MAX_VALUE, true, true, false);
- if (tCharge > 0) {
- this.charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
- if (aPlayer instanceof EntityPlayer) {
- final Container tContainer = ((EntityPlayer) aPlayer).openContainer;
- if (tContainer != null) {
- tContainer.detectAndSendChanges();
- }
- }
- }
- }
- }
- }
- }
-
- public final long getRealCharge(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- if (tStats[3] > 0) {
- return (int) (long) tStats[3];
- }
- final NBTTagCompound tNBT = aStack.getTagCompound();
- return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
- }
-
- public final boolean setCharge(final ItemStack aStack, long aCharge) {
- final Long[] tStats = this.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(this.getChargedMetaData(aStack));
- tNBT.setLong("GT.ItemCharge", aCharge);
- } else {
- aStack.setItemDamage(this.getEmptyMetaData(aStack));
- }
- if (tNBT.hasNoTags()) {
- aStack.setTagCompound(null);
- } else {
- aStack.setTagCompound(tNBT);
- }
- this.isItemStackUsable(aStack);
- return true;
- }
-
- public short getChargedMetaData(final ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
- public short getEmptyMetaData(final ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
- public boolean isItemStackUsable(final ItemStack aStack) {
- final ArrayList<IItemBehaviour<GregtechPump>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final IItemBehaviour<GregtechPump> tBehavior : tList) {
- if (!tBehavior.isItemStackUsable(this, aStack)) {
- return false;
- }
- }
- }
- return true;
- }
-
- @Override
- public final String getToolTip(final 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(final ItemStack aStack) {
- return this;
- } // We are our own Manager
-
- /**
- * 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 GregtechPump setBurnValue(final int aMetaValue, final int aValue) {
- if ((aMetaValue < 0) || (aValue < 0)) {
- return this;
- }
- if (aValue == 0) {
- this.mBurnValues.remove((short) aMetaValue);
- } else {
- this.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 GregtechPump setElectricStats(final int aMetaValue, final long aMaxCharge, final long aTransferLimit,
- final long aTier, final long aSpecialData, final boolean aUseAnimations) {
- if (aMetaValue < 0) {
- return this;
- }
- if (aMaxCharge == 0) {
- this.mElectricStats.remove((short) aMetaValue);
- } else {
- this.mElectricStats.put((short) aMetaValue,
- new Long[] { aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData });
- }
- return this;
- }
-
- @SuppressWarnings({ "unchecked" })
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
- for (int i = 0, j = this.mEnabledItems.length(); i < j; i++) {
- if (this.mVisibleItems.get(i) || (GT_Values.D1 && this.mEnabledItems.get(i))) {
- final Long[] tStats = this.mElectricStats.get((short) (this.mOffset + i));
- if ((tStats != null) && (tStats[3] < 0)) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.setCharge(tStack, Math.abs(tStats[0]));
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- if ((tStats == null) || (tStats[3] != -2)) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerIcons(final IIconRegister aIconRegister) {
- for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) {
- if (this.mEnabledItems.get(i)) {
- mIconMap.put((int) i, aIconRegister.registerIcon(CORE.MODID + ":" + (this.getUnlocalizedName() + "/" + i)));
- }
- }
- }
-
- @Override
- public final IIcon getIconFromDamage(final int aMetaData) {
- if (aMetaData < 0) {
- return null;
- }
- if (aMetaData < this.mOffset) {
- return mIconMap.get(0);
- }
- else {
- int newMeta = aMetaData - this.mOffset;
- newMeta = (Math.max(0, Math.min(3, newMeta)));
- return mIconMap.get(newMeta);
- }
- }
-
- /**
- * Sets the unlocalized name of this item to the string passed as the parameter"
- */
- @Override
- public Item setUnlocalizedName(final String p_77655_1_) {
- this.unlocalizedName = p_77655_1_;
- super.setUnlocalizedName(p_77655_1_);
- return this;
- }
-
- /**
- * Returns the unlocalized name of this item.
- */
- @Override
- public String getUnlocalizedName() {
- return this.unlocalizedName;
- }
-
- public final Long[] getElectricStats(final ItemStack aStack) {
- return this.mElectricStats.get((short) aStack.getItemDamage());
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
- }
-
- /**
- * Adds a special Item Behaviour to the Item.
- * <p/>
- * 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 GregtechPump addItemBehavior(final int aMetaValue, final IItemBehaviour<GregtechPump> aBehavior) {
- if ((aMetaValue < 0) || (aMetaValue >= 32766) || (aBehavior == null)) {
- return this;
- }
- ArrayList<IItemBehaviour<GregtechPump>> tList = this.mItemBehaviors.get((short) aMetaValue);
- if (tList == null) {
- tList = new ArrayList<>(1);
- this.mItemBehaviors.put((short) aMetaValue, tList);
- }
- tList.add(aBehavior);
- return 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.
- */
- @SuppressWarnings("unchecked")
- public final ItemStack addItem(final int aID, final String aEnglish, String aToolTip, final Object... aRandomData) {
- if (aToolTip == null) {
- aToolTip = "";
- }
- if ((aID >= 0) && (aID < this.mItemAmount)) {
- final ItemStack rStack = new ItemStack(this, 1, this.mOffset + aID);
- GT_ModHandler.registerBoxableItemToToolBox(rStack);
- this.mEnabledItems.set(aID);
- this.mVisibleItems.set(aID);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip);
- final List<TC_AspectStack> tAspects = new ArrayList<>();
- // Important Stuff to do first
- for (final Object tRandomData : aRandomData) {
- if (tRandomData instanceof SubTag) {
- if (tRandomData == SubTag.INVISIBLE) {
- this.mVisibleItems.set(aID, false);
- continue;
- }
- if (tRandomData == SubTag.NO_UNIFICATION) {
- GT_OreDictUnificator.addToBlacklist(rStack);
- continue;
- }
- }
- }
- // now check for the rest
- for (final Object tRandomData : aRandomData) {
- if (tRandomData != null) {
- boolean tUseOreDict = true;
- if (tRandomData instanceof IItemBehaviour) {
- this.addItemBehavior(this.mOffset + aID, (IItemBehaviour<GregtechPump>) 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;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack aStack) {
- int keyValue = (getCorrectMetaForItemstack(aStack));
- if (keyValue < 0 || keyValue > 3) {
- keyValue = 0;
- }
- return this.itemName.get(keyValue);
- }
-
- /**
- * Fluid Handling
- */
-
- /*
- * IFluidContainer Functions
- */
-
- public void emptyStoredFluid(ItemStack aStack) {
- if (aStack.hasTagCompound()) {
- NBTTagCompound t = aStack.getTagCompound();
- if (t.hasKey("mInit")) {
- t.removeTag("mInit");
- }
- if (t.hasKey("mFluid")) {
- t.removeTag("mFluid");
- }
- if (t.hasKey("mFluidAmount")) {
- t.removeTag("mFluidAmount");
- }
- }
- }
-
- public void storeFluid(ItemStack aStack, FluidStack aFluid) {
- if (aFluid == null) {
- return;
- } else {
- String fluidname = aFluid.getFluid().getName();
- int amount = aFluid.amount;
- if (fluidname != null && fluidname.length() > 0 && amount > 0) {
- NBTUtils.setString(aStack, "mFluid", fluidname);
- NBTUtils.setInteger(aStack, "mFluidAmount", amount);
- }
- }
- }
-
- @Override
- public FluidStack getFluid(ItemStack container) {
- if (!container.hasTagCompound() || !container.getTagCompound().hasKey("mInit")) {
- initNBT(container);
- }
- if (container.getTagCompound().hasKey("mInit") && container.getTagCompound().getBoolean("mInit")) {
- String fluidname;
- Integer amount = 0;
- fluidname = NBTUtils.getString(container, "mFluid");
- amount = NBTUtils.getInteger(container, "mFluidAmount");
- if (fluidname != null && amount != null && amount > 0) {
- return FluidUtils.getFluidStack(fluidname, amount);
- } else {
- return null;
- }
- }
- return null;
- }
-
- @Override
- public int getCapacity(ItemStack container) {
- if (!container.hasTagCompound() || !container.getTagCompound().hasKey("mInit")) {
- initNBT(container);
- }
- if (container.getTagCompound().hasKey("mInit") && container.getTagCompound().getBoolean("mInit")) {
- return container.getTagCompound().getInteger("mCapacity");
- }
- int aMeta = this.getCorrectMetaForItemstack(container);
- int aCapacity = (aMeta == 0 ? 2000 : (aMeta == 1 ? 8000 : (aMeta == 2 ? 32000 : 128000)));
- return aCapacity;
- }
-
- public int fill(ItemStack container, FluidStack resource) {
- return fill(container, resource, true);
- }
-
- @Override
- public int fill(ItemStack container, FluidStack resource, boolean doFill) {
- if (!doFill || resource == null) {
- return 0;
- }
-
- if (!container.hasTagCompound() || !container.getTagCompound().hasKey("mInit")) {
- initNBT(container);
- }
- if (container.getTagCompound().hasKey("mInit") && container.getTagCompound().getBoolean("mInit")) {
- String aStored;
- int aStoredAmount = 0;
- int aCapacity = getCapacity(container);
- FluidStack aStoredFluid = getFluid(container);
- if (aStoredFluid != null) {
- aStored = aStoredFluid.getFluid().getName();
- aStoredAmount = aStoredFluid.amount;
- if (aStoredAmount == aCapacity) {
- return 0;
- }
- }
- // Handle no stored fluid first
- if (aStoredFluid == null) {
- Logger.INFO("Pump is empty, filling with tank fluids.");
- FluidStack toConsume;
- int amountToConsume = 0;
- if (resource.amount >= aCapacity) {
- amountToConsume = aCapacity;
- } else {
- amountToConsume = resource.amount;
- }
- toConsume = FluidUtils.getFluidStack(resource, amountToConsume);
- if (toConsume != null && amountToConsume > 0) {
- storeFluid(container, toConsume);
- return amountToConsume;
- }
- } else {
- Logger.INFO("Pump is Partially full, filling with tank fluids.");
- if (aStoredFluid.isFluidEqual(resource)) {
- Logger.INFO("Found matching fluids.");
- int aSpaceLeft = (aCapacity - aStoredAmount);
- Logger.INFO(
- "Capacity: " + aCapacity + " | Stored: " + aStoredAmount + " | Space left: " + aSpaceLeft);
- FluidStack toConsume;
- int amountToConsume = 0;
- if (resource.amount >= aSpaceLeft) {
- amountToConsume = aSpaceLeft;
- Logger.INFO("More or equal fluid amount to pump container space.");
- } else {
- amountToConsume = resource.amount;
- Logger.INFO("Less fluid than container space");
- }
- Logger.INFO("Amount to consume: " + amountToConsume);
- toConsume = FluidUtils.getFluidStack(resource, (aStoredAmount + amountToConsume));
- if (toConsume != null && amountToConsume > 0) {
- Logger.INFO("Storing Fluid");
- storeFluid(container, toConsume);
- return amountToConsume;
- } else {
- Logger.INFO("Not storing fluid");
- }
- } else {
- Logger.INFO("Fluids did not match.");
- }
- }
- }
- return 0;
- }
-
- public FluidStack drain(ItemStack container, int drainAmt) {
- return drain(container, drainAmt, true);
- }
-
- @Override
- public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) {
- if (!doDrain || maxDrain == 0) {
- return null;
- }
- if (!container.hasTagCompound() || !container.getTagCompound().hasKey("mInit")) {
- initNBT(container);
- }
- if (container.getTagCompound().hasKey("mInit") && container.getTagCompound().getBoolean("mInit")) {
-
- String aStored;
- int aStoredAmount = 0;
- FluidStack aStoredFluid = getFluid(container);
-
- if (aStoredFluid != null) {
- aStored = aStoredFluid.getFluid().getName();
- aStoredAmount = aStoredFluid.amount;
- }
- // We cannot drain this if it's empty.
- else if (aStoredFluid == null) {
- return null;
- }
-
- if (maxDrain >= aStoredAmount) {
- emptyStoredFluid(container);
- return aStoredFluid;
- } else {
- // Handle Partial removal
- int amountRemaining = (aStoredAmount - maxDrain);
- if (amountRemaining == 0) {
- emptyStoredFluid(container);
- } else {
- FluidStack newAmount = FluidUtils.getFluidStack(aStoredFluid, amountRemaining);
- FluidStack drained = FluidUtils.getFluidStack(aStoredFluid, maxDrain);
- if (newAmount != null && drained != null) {
- storeFluid(container, newAmount);
- return drained;
- }
- }
- }
- }
- return null;
- }
-
- /*
- * Handle ItemStack NBT
- */
-
- public void initNBT(ItemStack aStack) {
- NBTTagCompound aNewNBT;
- if (!aStack.hasTagCompound()) {
- aNewNBT = new NBTTagCompound();
- } else {
- aNewNBT = aStack.getTagCompound();
- }
-
- if (!aNewNBT.hasKey("mInit")) {
- int aMeta = this.getCorrectMetaForItemstack(aStack);
- aNewNBT.setInteger("mMeta", aMeta);
- aNewNBT.setBoolean("mInit", true);
- aNewNBT.setString("mFluid", "@@@@@");
- aNewNBT.setInteger("mFluidAmount", 0);
- int aCapacity = (aMeta == 0 ? 2000 : (aMeta == 1 ? 8000 : (aMeta == 2 ? 32000 : 128000)));
- aNewNBT.setInteger("mCapacity", aCapacity);
- aStack.setTagCompound(aNewNBT);
- }
- }
-
- /**
- * Tile Handling
- */
-
- /*
- * Custom Fluid Handling for Tiles and GT Tiles.
- */
-
- public boolean tryDrainTile(ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ) {
- try {
- if (aWorld.isRemote || aStack == null) {
- return false;
- } else {
- int aTier = (aStack.getItemDamage() - 1000);
- int removal;
- if (aTier == 0) {
- removal = 0;
- } else if (aTier == 1) {
- removal = 32;
- } else if (aTier == 2) {
- removal = 128;
- } else if (aTier == 3) {
- removal = 512;
- } else {
- removal = 8;
- }
- if (!canUse(aStack, removal) && aTier > 0) {
- PlayerUtils.messagePlayer(aPlayer, "Not enough power.");
- Logger.INFO("No Power");
- return false;
- }
-
- final Block aBlock = aWorld.getBlock(aX, aY, aZ);
- if (aBlock == null) {
- return false;
- }
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity == null) {
- return false;
- } else {
- double aCharge = this.getCharge(aStack);
- boolean didDrain = false;
- if (aTier > 0 && aCharge > 0) {
- if (discharge(aStack, removal, aTier, true, true, false) > 0) {
- didDrain = true;
- }
- } else if (aTier == 0) {
- didDrain = true;
- } else {
- didDrain = false;
- }
-
- if (didDrain) {
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- return this.drainTankGT(tTileEntity, aStack, aWorld, aPlayer, aX, aY, aZ);
- }
- //Try support Standard Fluid Tanks too (May disable if dupes appear again)
- else if ((tTileEntity instanceof IFluidTank || tTileEntity instanceof IFluidHandler)) {
- //return this.drainIFluidTank(tTileEntity, aStack, aWorld, aPlayer, aX, aY, aZ);
- return false;
- }
- }
- }
- }
- } catch (Throwable t) {
- }
- return false;
- }
-
- /*
- * Vanilla IFluidTank
- */
-
- public boolean drainIFluidTank(TileEntity tTileEntity, ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX,
- int aY, int aZ) {
- if (tTileEntity == null) {
- Logger.INFO("Invalid Tile, somehow.");
- return false;
- }
- if ((tTileEntity instanceof IFluidTank || tTileEntity instanceof IFluidHandler)) {
- if (this.getFluid(aStack) == null || (this.getFluid(aStack) != null && this.getFluid(aStack).amount < this.getCapacity(aStack))) {
- Logger.INFO("Trying to find Stored Fluid - Behaviour Class.");
- FluidStack aStored = getStoredFluidOfVanillaTank(tTileEntity);
- if (aStored != null) {
- int mAmountInserted = fill(aStack, aStored);
- FluidStack newStackRemainingInTank;
- if (mAmountInserted > 0) {
- if (mAmountInserted == aStored.amount) {
- newStackRemainingInTank = null;
- } else {
- newStackRemainingInTank = FluidUtils.getFluidStack(aStored, (aStored.amount - mAmountInserted));
- }
- boolean b = setStoredFluidOfVanillaTank(tTileEntity, newStackRemainingInTank);
- Logger.INFO("Cleared Tank? " + b + " | mAmountInserted: " + mAmountInserted);
- Logger.INFO("Returning " + b + " - drainTankVanilla.");
- if (b) {
- PlayerUtils.messagePlayer(aPlayer, "Drained "+mAmountInserted+"L of "+aStored.getLocalizedName()+".");
- }
- return b;
- }
- } else {
- Logger.INFO("Found no valid Fluidstack - drainTankVanilla.");
- }
- }
- else {
- Logger.INFO("Pump is full.");
- }
- }
- Logger.INFO("Could not drain vanilla tank.");
- return false;
- }
-
- /*
- * GT Tanks
- */
-
- public boolean drainTankGT(TileEntity tTileEntity, ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX,
- int aY, int aZ) {
- if (tTileEntity == null) {
- return false;
- }
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- Logger.INFO("Right Clicking on GT Tile - drainTankGT.");
- if (((IGregTechTileEntity) tTileEntity).getTimer() < 50L) {
- Logger.INFO("Returning False - Behaviour Class. Timer < 50");
- return false;
- } else if ((!aWorld.isRemote) && (!((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer))) {
- Logger.INFO("Returning True - drainTankGT. NotUsable()");
- return true;
- } else {
- if (this.getFluid(aStack) == null || (this.getFluid(aStack) != null && this.getFluid(aStack).amount < this.getCapacity(aStack))) {
- Logger.INFO("Trying to find Stored Fluid - drainTankGT.");
- FluidStack aStored = getStoredFluidOfGTMachine((IGregTechTileEntity) tTileEntity);
- if (aStored != null) {
- int mAmountInserted = fill(aStack, aStored);
- FluidStack newStackRemainingInTank;
- if (mAmountInserted > 0) {
- if (mAmountInserted == aStored.amount) {
- newStackRemainingInTank = null;
- } else {
- newStackRemainingInTank = FluidUtils.getFluidStack(aStored, (aStored.amount - mAmountInserted));
- }
- boolean b = setStoredFluidOfGTMachine((IGregTechTileEntity) tTileEntity, newStackRemainingInTank);
- Logger.INFO("Cleared Tank? " + b + " | mAmountInserted: " + mAmountInserted);
- Logger.INFO("Returning " + b + " - drainTankGT.");
- if (b) {
- PlayerUtils.messagePlayer(aPlayer, "Drained "+mAmountInserted+"L of "+aStored.getLocalizedName()+".");
- }
- return b;
- }
- } else {
- Logger.INFO("Found no valid Fluidstack - drainTankGT.");
- }
- }
- else {
- Logger.INFO("Pump is full.");
- }
- }
- }
- Logger.INFO("Could not drain GT tank.");
- return false;
- }
-
- /*
- * Vanilla Tanks
- */
-
- public FluidStack getStoredFluidOfVanillaTank(TileEntity aTileEntity) {
- if (aTileEntity == null) {
- return null;
- } else if ((aTileEntity instanceof IFluidTank || aTileEntity instanceof IFluidHandler)) {
- if (aTileEntity instanceof IFluidTank) {
- return getStoredFluidOfVanillaTank((IFluidTank) aTileEntity);
- } else {
- return getStoredFluidOfVanillaTank((IFluidHandler) aTileEntity);
- }
- } else {
- return null;
- }
- }
-
- public FluidStack getStoredFluidOfVanillaTank(IFluidTank aTileEntity) {
- FluidStack f = aTileEntity.getFluid();
- Logger.INFO("Returning Fluid stack from tile. Found: "
- + (f != null ? f.getLocalizedName() + " - " + f.amount + "L" : "Nothing"));
- return f;
- }
-
- public FluidStack getStoredFluidOfVanillaTank(IFluidHandler aTileEntity) {
- if (aTileEntity instanceof IFluidTank) {
- return getStoredFluidOfVanillaTank((IFluidTank) aTileEntity);
- }
- FluidStack f;
- AutoMap<FluidTankInfo[]> m = new AutoMap<FluidTankInfo[]>();
- for (int i = 0; i < 6; i++) {
- m.put(aTileEntity.getTankInfo(ForgeDirection.getOrientation(i)));
- }
- if (m.get(0) != null && m.get(0)[0] != null && m.get(0)[0].fluid != null) {
- return m.get(0)[0].fluid;
- } else {
- return null;
- }
- }
-
- public boolean setStoredFluidOfVanillaTank(TileEntity aTileEntity, FluidStack aSetFluid) {
- Logger.INFO("Trying to clear Tile's tank. - Behaviour Class. [1]");
-
- if (aTileEntity == null) {
- return false;
- }
- else if ((aTileEntity instanceof IFluidTank || aTileEntity instanceof IFluidHandler)) {
- if (aTileEntity instanceof IFluidTank) {
- Logger.INFO("Tile Was instanceof IFluidTank.");
- FluidStack f = ((IFluidTank) aTileEntity).getFluid();
- if (aSetFluid == null) {
- aSetFluid = f;
- aSetFluid.amount = f.amount;
- }
- int toDrain = (f.amount - aSetFluid.amount);
- FluidStack newStack;
- if (toDrain <= 0) {
- newStack = f;
- } else {
- newStack = ((IFluidTank) aTileEntity).drain(toDrain, true);
- }
-
- if (newStack.isFluidEqual(aSetFluid) && newStack.amount == aSetFluid.amount) {
- Logger.INFO("Removed fluid from vanilla IFluidTank successfully.");
- return true;
- } else {
- Logger.INFO("Failed trying to remove fluid from vanilla IFluidTank.");
- return false;
- }
- }
- else {
-
- //Rewrite Fluid handling for Vanilla type tanks
- if (!IFluidHandler.class.isInstance(aTileEntity)) {
- Logger.INFO("Tile Was not an instance of IFluidHandler.");
- return false;
- }
-
-
- IFluidHandler aTank = (IFluidHandler) aTileEntity;
- FluidStack aTankContents = null;
- FluidTankInfo[] a1 = aTank.getTankInfo(ForgeDirection.UNKNOWN);
- if (a1 != null) {
- if (a1[0] != null) {
- aTankContents = a1[0].fluid;
- Logger.INFO("Found Fluid in Tank. "+aTankContents.getLocalizedName()+" - "+aTankContents.amount);
- }
- }
- if (aSetFluid == null) {
- Logger.INFO("Setting fluid to tank contents, as we're going to empty it totally.");
- aSetFluid = aTankContents.copy();
- }
- else {
- Logger.INFO("Setting fluid to tank contents, as we're going to empty it totally.");
- }
- Logger.INFO("Tile Was instance of IFluidHandler. Trying to Drain "+aSetFluid.getLocalizedName()+" - "+aSetFluid.amount);
-
- if (a1 == null || aTankContents == null) {
- Logger.INFO("Tank is empty.");
- return false;
- }
- //Found some Fluid in the tank
- else {
- FluidStack aDrainedStack = aTank.drain(ForgeDirection.UNKNOWN, aSetFluid, true);
- if (aDrainedStack.isFluidStackIdentical(aSetFluid)) {
- Logger.INFO("Drained!");
- return true;
- }
- else {
- Logger.INFO("Partially Drained! This is probably an error.");
- return true;
- }
- }
- }
- } else {
- Logger.INFO("Bad Tank Tile to drain.");
- return false;
- }
-
- }
-
- /*
- * GT Tanks
- */
-
- public FluidStack getStoredFluidOfGTMachine(IGregTechTileEntity aTileEntity) {
- if (aTileEntity == null) {
- return null;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- ;
- if (aMetaTileEntity == null) {
- return null;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicTank) {
- Logger.INFO("Tile Was Instanceof BasicTank.");
- return getStoredFluidOfGTMachine((GT_MetaTileEntity_BasicTank) aMetaTileEntity);
- } else {
- return null;
- }
- }
-
- public FluidStack getStoredFluidOfGTMachine(GT_MetaTileEntity_BasicTank aTileEntity) {
- FluidStack f = aTileEntity.mFluid;
-
- //Let's see if this machine has output fluid too
- /*
- * if (f == null) {
- * Logger.INFO("Could not find any input fluid, checking output if possible.");
- * if (aTileEntity instanceof GT_MetaTileEntity_BasicMachine) {
- * GT_MetaTileEntity_BasicMachine g = (GT_MetaTileEntity_BasicMachine)
- * aTileEntity;
- * Logger.INFO("Tile is a Basic Machine of some sort - "+g.mNEIName); if (g !=
- * null) { f = g.mOutputFluid; if (f != null) {
- * Logger.INFO("Found output fluid! "+f.getLocalizedName()); } else {
- * Logger.INFO("Did not find anything!"); f = g.getFluid(); if (f != null) {
- * Logger.INFO("Found fluid! "+f.getLocalizedName()); } else {
- * Logger.INFO("Did not find anything!"); f = g.getFluid(); } } } } }
- */
-
- Logger.INFO("Returning Fluid stack from tile. Found: "
- + (f != null ? f.getLocalizedName() + " - " + f.amount + "L" : "Nothing"));
- return f;
- }
-
- public boolean setStoredFluidOfGTMachine(IGregTechTileEntity aTileEntity, FluidStack aSetFluid) {
- Logger.INFO("Trying to clear Tile's tank. - Behaviour Class. [1]");
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicTank) {
- Logger.INFO("Trying to clear Tile's tank. - Behaviour Class. [2]");
- return setStoredFluidOfGTMachine((GT_MetaTileEntity_BasicTank) aMetaTileEntity, aSetFluid);
- } else {
- return false;
- }
- }
-
- public boolean setStoredFluidOfGTMachine(GT_MetaTileEntity_BasicTank aTileEntity, FluidStack aSetFluid) {
- try {
-
- //Try Handle Outputs First
- /*
- * if (aTileEntity.setDrainableStack(aSetFluid) != null) { return true; }
- */
-
- aTileEntity.mFluid = aSetFluid;
- boolean b = aTileEntity.mFluid == aSetFluid;
- Logger.INFO("Trying to set Tile's tank. - Behaviour Class. [3] " + b);
- return b;
- } catch (Throwable t) {
- Logger.INFO("Trying to clear Tile's tank. FAILED - Behaviour Class. [x]");
- return false;
- }
- }
-
-
- public int getCorrectMetaForItemstack(ItemStack aStack) {
- if (aStack == null) {
- return 0;
- }
- else {
- if (aStack.getItemDamage() < this.mOffset) {
- return 0;
- }
- else {
- int newMeta = aStack.getItemDamage() - this.mOffset;
- newMeta = (Math.max(0, Math.min(3, newMeta)));
- return newMeta;
- }
- }
-
-
-
-
- }
-
+ /**
+ * Right Click Functions
+ */
+ @Override
+ public boolean onItemUse(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ int a4,
+ float p_77648_8_,
+ float p_77648_9_,
+ float p_77648_10_) {
+ if (aStack == null || aPlayer == null || aWorld == null || aWorld.isRemote) {
+ return false;
+ }
+ if (!aWorld.isRemote && tryDrainTile(aStack, aWorld, aPlayer, aX, aY, aZ)) {
+ return true;
+ } else {
+ // return super.onItemUse(aStack, aPlayer, aWorld, aX, aY, aZ, a4, p_77648_8_, p_77648_9_, p_77648_10_);
+ return false;
+ }
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
+ return p_77659_1_;
+ }
+
+ /**
+ * GT Code
+ */
+
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+ private final HashMap<Short, ArrayList<IItemBehaviour<GregtechPump>>> mItemBehaviors = new HashMap<>();
+
+ public final short mOffset, mItemAmount;
+ public final BitSet mEnabledItems;
+ public final BitSet mVisibleItems;
+ /** The unlocalized name of this item. */
+ private String unlocalizedName;
+
+ private final HashMap<Integer, IIcon> mIconMap = new LinkedHashMap<Integer, IIcon>();
+ private final HashMap<Integer, EnumRarity> rarity = new LinkedHashMap<Integer, EnumRarity>();
+ private final HashMap<Integer, EnumChatFormatting> descColour = new LinkedHashMap<Integer, EnumChatFormatting>();
+ private final HashMap<Integer, String> itemName = new LinkedHashMap<Integer, String>();
+ private final HashMap<Integer, String> itemDescription = new LinkedHashMap<Integer, String>();
+ private final HashMap<Integer, Boolean> hasEffect = new LinkedHashMap<Integer, Boolean>();
+
+ public final HashMap<Short, Long[]> mElectricStats = new LinkedHashMap<Short, Long[]>();
+ public final HashMap<Short, Short> mBurnValues = new LinkedHashMap<Short, Short>();
+
+ public void registerPumpType(final int aID, final String aPumpName, final int aEuMax, final int aTier) {
+ ModItems.toolGregtechPump.registerItem(
+ aID, // ID
+ aPumpName, // Name
+ aEuMax, // Eu Storage
+ (short) aTier, // Tier
+ "Can be used to remove fluids from GT machine input & output slots.", // Tooltip
+ aTier <= 0
+ ? EnumRarity.common
+ : aTier == 1
+ ? EnumRarity.uncommon
+ : aTier == 2
+ ? EnumRarity.rare
+ : aTier == 3 ? EnumRarity.epic : EnumRarity.common, // Rarity
+ EnumChatFormatting.GRAY, // Desc colour
+ false // Effect?
+ );
+ }
+
+ public GregtechPump() {
+ this("MU-metatool.01", AddToCreativeTab.tabTools, (short) 1000, (short) 31766);
+ }
+
+ public GregtechPump(
+ final String unlocalizedName,
+ final CreativeTabs creativeTab,
+ final short aOffset,
+ final short aItemAmount) {
+ this.mEnabledItems = new BitSet(aItemAmount);
+ this.mVisibleItems = new BitSet(aItemAmount);
+ this.mOffset = (short) Math.min(32766, aOffset);
+ this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset);
+ this.setHasSubtypes(true);
+ this.setMaxDamage(0);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(creativeTab);
+ this.setMaxStackSize(1);
+ if (GameRegistry.findItem(CORE.MODID, unlocalizedName) == null) {
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+ }
+
+ public void registerItem(
+ final int id, final String localizedName, final long euStorage, final int tier, final String description) {
+ this.registerItem(
+ id,
+ localizedName,
+ euStorage,
+ (short) tier,
+ description,
+ EnumRarity.common,
+ EnumChatFormatting.GRAY,
+ false);
+ }
+
+ public void registerItem(
+ final int id,
+ final String localizedName,
+ final long euStorage,
+ final int tier,
+ final String description,
+ final int burnTime) {
+ this.registerItem(
+ id,
+ localizedName,
+ euStorage,
+ (short) tier,
+ description,
+ EnumRarity.common,
+ EnumChatFormatting.GRAY,
+ false);
+ this.setBurnValue(id, burnTime);
+ }
+
+ public void registerItem(
+ final int id,
+ final String localizedName,
+ final long euStorage,
+ final short tier,
+ final String description,
+ final EnumRarity regRarity,
+ final EnumChatFormatting colour,
+ final boolean Effect) {
+ this.addItem(id, localizedName, EnumChatFormatting.YELLOW + "Electric", new Object[] {});
+ if (euStorage > 0 && tier > 0)
+ this.setElectricStats(this.mOffset + id, euStorage, GT_Values.V[tier], tier, -3L, true);
+ this.rarity.put(id, regRarity);
+ this.itemName.put(id, localizedName);
+ this.itemDescription.put(id, description);
+ this.descColour.put(id, colour);
+ this.hasEffect.put(id, Effect);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ int h = getCorrectMetaForItemstack(par1ItemStack);
+ if (this.rarity.get(h) != null) {
+ return this.rarity.get(h);
+ }
+ return EnumRarity.common;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ int h = getCorrectMetaForItemstack(par1ItemStack);
+ if (this.hasEffect.get(h) != null) {
+ return this.hasEffect.get(h);
+ }
+ return false;
+ }
+
+ @SuppressWarnings({"unchecked"})
+ @Override
+ public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList, final boolean aF3_H) {
+ // aList.add("Meta: "+(aStack.getItemDamage()-mOffset));
+
+ int aOffsetMeta = getCorrectMetaForItemstack(aStack);
+
+ if ((this.descColour.get(aOffsetMeta) != null) && (this.itemDescription.get(aOffsetMeta) != null)) {
+ aList.add(this.descColour.get(aOffsetMeta) + this.itemDescription.get(aOffsetMeta));
+ }
+
+ if (aOffsetMeta <= 3) {
+ FluidStack f = getFluid(aStack);
+ aList.add("Cannot drain any other standard fluid container block");
+ aList.add("Cannot be emptied via RMB, use inside a tank with GUI");
+ aList.add(EnumChatFormatting.DARK_GRAY + "This is technically just a fancy fluid cell");
+ aList.add(EnumChatFormatting.BLUE + (f != null ? f.getLocalizedName() : "No Fluids Contained"));
+ aList.add(EnumChatFormatting.BLUE + (f != null ? "" + f.amount : "" + 0) + "L" + " / " + getCapacity(aStack)
+ + "L");
+ }
+
+ final Long[] tStats = this.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 {
+ final long tCharge = this.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] < V.length ? tStats[2] : V.length - 1 : 1)]
+ + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+
+ final ArrayList<IItemBehaviour<GregtechPump>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final IItemBehaviour<GregtechPump> tBehavior : tList) {
+ aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
+ }
+ }
+ }
+
+ @Override
+ public final Item getChargedItem(final ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final Item getEmptyItem(final ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final double getMaxCharge(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ return Math.abs(tStats[0]);
+ }
+
+ @Override
+ public final double getTransferLimit(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ return Math.max(tStats[1], tStats[3]);
+ }
+
+ @Override
+ public final int getTier(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
+ }
+
+ @Override
+ public final double charge(
+ final ItemStack aStack,
+ final double aCharge,
+ final int aTier,
+ final boolean aIgnoreTransferLimit,
+ final boolean aSimulate) {
+ final Long[] tStats = this.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;
+ }
+ final long tChargeBefore = this.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) {
+ this.setCharge(aStack, tNewCharge);
+ }
+ return tNewCharge - tChargeBefore;
+ }
+
+ @Override
+ public final double discharge(
+ final ItemStack aStack,
+ final double aCharge,
+ final int aTier,
+ final boolean aIgnoreTransferLimit,
+ final boolean aBatteryAlike,
+ final boolean aSimulate) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if ((tStats == null) || (tStats[2] > aTier)) {
+ return 0;
+ }
+ if (aBatteryAlike && !this.canProvideEnergy(aStack)) {
+ return 0;
+ }
+ if (tStats[3] > 0) {
+ if ((aCharge < tStats[3]) || (aStack.stackSize < 1)) {
+ return 0;
+ }
+ if (!aSimulate) {
+ aStack.stackSize--;
+ }
+ return tStats[3];
+ }
+ final long tChargeBefore = this.getRealCharge(aStack),
+ tNewCharge =
+ Math.max(
+ 0,
+ tChargeBefore
+ - (aIgnoreTransferLimit
+ ? (long) aCharge
+ : Math.min(tStats[1], (long) aCharge)));
+ if (!aSimulate) {
+ this.setCharge(aStack, tNewCharge);
+ }
+ return tChargeBefore - tNewCharge;
+ }
+
+ @Override
+ public final double getCharge(final ItemStack aStack) {
+ return this.getRealCharge(aStack);
+ }
+
+ @Override
+ public final boolean canUse(final ItemStack aStack, final double aAmount) {
+ return this.getRealCharge(aStack) >= aAmount;
+ }
+
+ @Override
+ public final boolean use(final ItemStack aStack, final double aAmount, final EntityLivingBase aPlayer) {
+ this.chargeFromArmor(aStack, aPlayer);
+ if ((aPlayer instanceof EntityPlayer) && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) {
+ return true;
+ }
+ final double tTransfer = this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
+ if (tTransfer == aAmount) {
+ this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ this.chargeFromArmor(aStack, aPlayer);
+ return true;
+ }
+ this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ this.chargeFromArmor(aStack, aPlayer);
+ return false;
+ }
+
+ @Override
+ public final boolean canProvideEnergy(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return false;
+ }
+ return (tStats[3] > 0) || ((aStack.stackSize == 1) && ((tStats[3] == -2) || (tStats[3] == -3)));
+ }
+
+ @Override
+ public final void chargeFromArmor(final ItemStack aStack, final EntityLivingBase aPlayer) {
+ if ((aPlayer == null) || aPlayer.worldObj.isRemote) {
+ return;
+ }
+ for (int i = 1; i < 5; i++) {
+ final ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
+ if (GT_ModHandler.isElectricItem(tArmor)) {
+ final IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
+ if (tArmorItem.canProvideEnergy(tArmor) && (tArmorItem.getTier(tArmor) >= this.getTier(aStack))) {
+ final double tCharge = ElectricItem.manager.discharge(
+ tArmor,
+ this.charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true),
+ Integer.MAX_VALUE,
+ true,
+ true,
+ false);
+ if (tCharge > 0) {
+ this.charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
+ if (aPlayer instanceof EntityPlayer) {
+ final Container tContainer = ((EntityPlayer) aPlayer).openContainer;
+ if (tContainer != null) {
+ tContainer.detectAndSendChanges();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public final long getRealCharge(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ if (tStats[3] > 0) {
+ return (int) (long) tStats[3];
+ }
+ final NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
+ }
+
+ public final boolean setCharge(final ItemStack aStack, long aCharge) {
+ final Long[] tStats = this.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(this.getChargedMetaData(aStack));
+ tNBT.setLong("GT.ItemCharge", aCharge);
+ } else {
+ aStack.setItemDamage(this.getEmptyMetaData(aStack));
+ }
+ if (tNBT.hasNoTags()) {
+ aStack.setTagCompound(null);
+ } else {
+ aStack.setTagCompound(tNBT);
+ }
+ this.isItemStackUsable(aStack);
+ return true;
+ }
+
+ public short getChargedMetaData(final ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ public short getEmptyMetaData(final ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ public boolean isItemStackUsable(final ItemStack aStack) {
+ final ArrayList<IItemBehaviour<GregtechPump>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final IItemBehaviour<GregtechPump> tBehavior : tList) {
+ if (!tBehavior.isItemStackUsable(this, aStack)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public final String getToolTip(final 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(final ItemStack aStack) {
+ return this;
+ } // We are our own Manager
+
+ /**
+ * 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 GregtechPump setBurnValue(final int aMetaValue, final int aValue) {
+ if ((aMetaValue < 0) || (aValue < 0)) {
+ return this;
+ }
+ if (aValue == 0) {
+ this.mBurnValues.remove((short) aMetaValue);
+ } else {
+ this.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 GregtechPump setElectricStats(
+ final int aMetaValue,
+ final long aMaxCharge,
+ final long aTransferLimit,
+ final long aTier,
+ final long aSpecialData,
+ final boolean aUseAnimations) {
+ if (aMetaValue < 0) {
+ return this;
+ }
+ if (aMaxCharge == 0) {
+ this.mElectricStats.remove((short) aMetaValue);
+ } else {
+ this.mElectricStats.put(
+ (short) aMetaValue,
+ new Long[] {aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData});
+ }
+ return this;
+ }
+
+ @SuppressWarnings({"unchecked"})
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
+ for (int i = 0, j = this.mEnabledItems.length(); i < j; i++) {
+ if (this.mVisibleItems.get(i) || (GT_Values.D1 && this.mEnabledItems.get(i))) {
+ final Long[] tStats = this.mElectricStats.get((short) (this.mOffset + i));
+ if ((tStats != null) && (tStats[3] < 0)) {
+ final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
+ this.setCharge(tStack, Math.abs(tStats[0]));
+ this.isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ if ((tStats == null) || (tStats[3] != -2)) {
+ final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
+ this.isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerIcons(final IIconRegister aIconRegister) {
+ for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) {
+ if (this.mEnabledItems.get(i)) {
+ mIconMap.put(
+ (int) i, aIconRegister.registerIcon(CORE.MODID + ":" + (this.getUnlocalizedName() + "/" + i)));
+ }
+ }
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(final int aMetaData) {
+ if (aMetaData < 0) {
+ return null;
+ }
+ if (aMetaData < this.mOffset) {
+ return mIconMap.get(0);
+ } else {
+ int newMeta = aMetaData - this.mOffset;
+ newMeta = (Math.max(0, Math.min(3, newMeta)));
+ return mIconMap.get(newMeta);
+ }
+ }
+
+ /**
+ * Sets the unlocalized name of this item to the string passed as the parameter"
+ */
+ @Override
+ public Item setUnlocalizedName(final String p_77655_1_) {
+ this.unlocalizedName = p_77655_1_;
+ super.setUnlocalizedName(p_77655_1_);
+ return this;
+ }
+
+ /**
+ * Returns the unlocalized name of this item.
+ */
+ @Override
+ public String getUnlocalizedName() {
+ return this.unlocalizedName;
+ }
+
+ public final Long[] getElectricStats(final ItemStack aStack) {
+ return this.mElectricStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
+ return false;
+ }
+
+ /**
+ * Adds a special Item Behaviour to the Item.
+ * <p/>
+ * 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 GregtechPump addItemBehavior(final int aMetaValue, final IItemBehaviour<GregtechPump> aBehavior) {
+ if ((aMetaValue < 0) || (aMetaValue >= 32766) || (aBehavior == null)) {
+ return this;
+ }
+ ArrayList<IItemBehaviour<GregtechPump>> tList = this.mItemBehaviors.get((short) aMetaValue);
+ if (tList == null) {
+ tList = new ArrayList<>(1);
+ this.mItemBehaviors.put((short) aMetaValue, tList);
+ }
+ tList.add(aBehavior);
+ return 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.
+ */
+ @SuppressWarnings("unchecked")
+ public final ItemStack addItem(final int aID, final String aEnglish, String aToolTip, final Object... aRandomData) {
+ if (aToolTip == null) {
+ aToolTip = "";
+ }
+ if ((aID >= 0) && (aID < this.mItemAmount)) {
+ final ItemStack rStack = new ItemStack(this, 1, this.mOffset + aID);
+ GT_ModHandler.registerBoxableItemToToolBox(rStack);
+ this.mEnabledItems.set(aID);
+ this.mVisibleItems.set(aID);
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip);
+ final List<TC_AspectStack> tAspects = new ArrayList<>();
+ // Important Stuff to do first
+ for (final Object tRandomData : aRandomData) {
+ if (tRandomData instanceof SubTag) {
+ if (tRandomData == SubTag.INVISIBLE) {
+ this.mVisibleItems.set(aID, false);
+ continue;
+ }
+ if (tRandomData == SubTag.NO_UNIFICATION) {
+ GT_OreDictUnificator.addToBlacklist(rStack);
+ continue;
+ }
+ }
+ }
+ // now check for the rest
+ for (final Object tRandomData : aRandomData) {
+ if (tRandomData != null) {
+ boolean tUseOreDict = true;
+ if (tRandomData instanceof IItemBehaviour) {
+ this.addItemBehavior(this.mOffset + aID, (IItemBehaviour<GregtechPump>) 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;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack aStack) {
+ int keyValue = (getCorrectMetaForItemstack(aStack));
+ if (keyValue < 0 || keyValue > 3) {
+ keyValue = 0;
+ }
+ return this.itemName.get(keyValue);
+ }
+
+ /**
+ * Fluid Handling
+ */
+
+ /*
+ * IFluidContainer Functions
+ */
+
+ public void emptyStoredFluid(ItemStack aStack) {
+ if (aStack.hasTagCompound()) {
+ NBTTagCompound t = aStack.getTagCompound();
+ if (t.hasKey("mInit")) {
+ t.removeTag("mInit");
+ }
+ if (t.hasKey("mFluid")) {
+ t.removeTag("mFluid");
+ }
+ if (t.hasKey("mFluidAmount")) {
+ t.removeTag("mFluidAmount");
+ }
+ }
+ }
+
+ public void storeFluid(ItemStack aStack, FluidStack aFluid) {
+ if (aFluid == null) {
+ return;
+ } else {
+ String fluidname = aFluid.getFluid().getName();
+ int amount = aFluid.amount;
+ if (fluidname != null && fluidname.length() > 0 && amount > 0) {
+ NBTUtils.setString(aStack, "mFluid", fluidname);
+ NBTUtils.setInteger(aStack, "mFluidAmount", amount);
+ }
+ }
+ }
+
+ @Override
+ public FluidStack getFluid(ItemStack container) {
+ if (!container.hasTagCompound() || !container.getTagCompound().hasKey("mInit")) {
+ initNBT(container);
+ }
+ if (container.getTagCompound().hasKey("mInit")
+ && container.getTagCompound().getBoolean("mInit")) {
+ String fluidname;
+ Integer amount = 0;
+ fluidname = NBTUtils.getString(container, "mFluid");
+ amount = NBTUtils.getInteger(container, "mFluidAmount");
+ if (fluidname != null && amount != null && amount > 0) {
+ return FluidUtils.getFluidStack(fluidname, amount);
+ } else {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public int getCapacity(ItemStack container) {
+ if (!container.hasTagCompound() || !container.getTagCompound().hasKey("mInit")) {
+ initNBT(container);
+ }
+ if (container.getTagCompound().hasKey("mInit")
+ && container.getTagCompound().getBoolean("mInit")) {
+ return container.getTagCompound().getInteger("mCapacity");
+ }
+ int aMeta = this.getCorrectMetaForItemstack(container);
+ int aCapacity = (aMeta == 0 ? 2000 : (aMeta == 1 ? 8000 : (aMeta == 2 ? 32000 : 128000)));
+ return aCapacity;
+ }
+
+ public int fill(ItemStack container, FluidStack resource) {
+ return fill(container, resource, true);
+ }
+
+ @Override
+ public int fill(ItemStack container, FluidStack resource, boolean doFill) {
+ if (!doFill || resource == null) {
+ return 0;
+ }
+
+ if (!container.hasTagCompound() || !container.getTagCompound().hasKey("mInit")) {
+ initNBT(container);
+ }
+ if (container.getTagCompound().hasKey("mInit")
+ && container.getTagCompound().getBoolean("mInit")) {
+ String aStored;
+ int aStoredAmount = 0;
+ int aCapacity = getCapacity(container);
+ FluidStack aStoredFluid = getFluid(container);
+ if (aStoredFluid != null) {
+ aStored = aStoredFluid.getFluid().getName();
+ aStoredAmount = aStoredFluid.amount;
+ if (aStoredAmount == aCapacity) {
+ return 0;
+ }
+ }
+ // Handle no stored fluid first
+ if (aStoredFluid == null) {
+ Logger.INFO("Pump is empty, filling with tank fluids.");
+ FluidStack toConsume;
+ int amountToConsume = 0;
+ if (resource.amount >= aCapacity) {
+ amountToConsume = aCapacity;
+ } else {
+ amountToConsume = resource.amount;
+ }
+ toConsume = FluidUtils.getFluidStack(resource, amountToConsume);
+ if (toConsume != null && amountToConsume > 0) {
+ storeFluid(container, toConsume);
+ return amountToConsume;
+ }
+ } else {
+ Logger.INFO("Pump is Partially full, filling with tank fluids.");
+ if (aStoredFluid.isFluidEqual(resource)) {
+ Logger.INFO("Found matching fluids.");
+ int aSpaceLeft = (aCapacity - aStoredAmount);
+ Logger.INFO(
+ "Capacity: " + aCapacity + " | Stored: " + aStoredAmount + " | Space left: " + aSpaceLeft);
+ FluidStack toConsume;
+ int amountToConsume = 0;
+ if (resource.amount >= aSpaceLeft) {
+ amountToConsume = aSpaceLeft;
+ Logger.INFO("More or equal fluid amount to pump container space.");
+ } else {
+ amountToConsume = resource.amount;
+ Logger.INFO("Less fluid than container space");
+ }
+ Logger.INFO("Amount to consume: " + amountToConsume);
+ toConsume = FluidUtils.getFluidStack(resource, (aStoredAmount + amountToConsume));
+ if (toConsume != null && amountToConsume > 0) {
+ Logger.INFO("Storing Fluid");
+ storeFluid(container, toConsume);
+ return amountToConsume;
+ } else {
+ Logger.INFO("Not storing fluid");
+ }
+ } else {
+ Logger.INFO("Fluids did not match.");
+ }
+ }
+ }
+ return 0;
+ }
+
+ public FluidStack drain(ItemStack container, int drainAmt) {
+ return drain(container, drainAmt, true);
+ }
+
+ @Override
+ public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) {
+ if (!doDrain || maxDrain == 0) {
+ return null;
+ }
+ if (!container.hasTagCompound() || !container.getTagCompound().hasKey("mInit")) {
+ initNBT(container);
+ }
+ if (container.getTagCompound().hasKey("mInit")
+ && container.getTagCompound().getBoolean("mInit")) {
+
+ String aStored;
+ int aStoredAmount = 0;
+ FluidStack aStoredFluid = getFluid(container);
+
+ if (aStoredFluid != null) {
+ aStored = aStoredFluid.getFluid().getName();
+ aStoredAmount = aStoredFluid.amount;
+ }
+ // We cannot drain this if it's empty.
+ else if (aStoredFluid == null) {
+ return null;
+ }
+
+ if (maxDrain >= aStoredAmount) {
+ emptyStoredFluid(container);
+ return aStoredFluid;
+ } else {
+ // Handle Partial removal
+ int amountRemaining = (aStoredAmount - maxDrain);
+ if (amountRemaining == 0) {
+ emptyStoredFluid(container);
+ } else {
+ FluidStack newAmount = FluidUtils.getFluidStack(aStoredFluid, amountRemaining);
+ FluidStack drained = FluidUtils.getFluidStack(aStoredFluid, maxDrain);
+ if (newAmount != null && drained != null) {
+ storeFluid(container, newAmount);
+ return drained;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /*
+ * Handle ItemStack NBT
+ */
+
+ public void initNBT(ItemStack aStack) {
+ NBTTagCompound aNewNBT;
+ if (!aStack.hasTagCompound()) {
+ aNewNBT = new NBTTagCompound();
+ } else {
+ aNewNBT = aStack.getTagCompound();
+ }
+
+ if (!aNewNBT.hasKey("mInit")) {
+ int aMeta = this.getCorrectMetaForItemstack(aStack);
+ aNewNBT.setInteger("mMeta", aMeta);
+ aNewNBT.setBoolean("mInit", true);
+ aNewNBT.setString("mFluid", "@@@@@");
+ aNewNBT.setInteger("mFluidAmount", 0);
+ int aCapacity = (aMeta == 0 ? 2000 : (aMeta == 1 ? 8000 : (aMeta == 2 ? 32000 : 128000)));
+ aNewNBT.setInteger("mCapacity", aCapacity);
+ aStack.setTagCompound(aNewNBT);
+ }
+ }
+
+ /**
+ * Tile Handling
+ */
+
+ /*
+ * Custom Fluid Handling for Tiles and GT Tiles.
+ */
+
+ public boolean tryDrainTile(ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ) {
+ try {
+ if (aWorld.isRemote || aStack == null) {
+ return false;
+ } else {
+ int aTier = (aStack.getItemDamage() - 1000);
+ int removal;
+ if (aTier == 0) {
+ removal = 0;
+ } else if (aTier == 1) {
+ removal = 32;
+ } else if (aTier == 2) {
+ removal = 128;
+ } else if (aTier == 3) {
+ removal = 512;
+ } else {
+ removal = 8;
+ }
+ if (!canUse(aStack, removal) && aTier > 0) {
+ PlayerUtils.messagePlayer(aPlayer, "Not enough power.");
+ Logger.INFO("No Power");
+ return false;
+ }
+
+ final Block aBlock = aWorld.getBlock(aX, aY, aZ);
+ if (aBlock == null) {
+ return false;
+ }
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity == null) {
+ return false;
+ } else {
+ double aCharge = this.getCharge(aStack);
+ boolean didDrain = false;
+ if (aTier > 0 && aCharge > 0) {
+ if (discharge(aStack, removal, aTier, true, true, false) > 0) {
+ didDrain = true;
+ }
+ } else if (aTier == 0) {
+ didDrain = true;
+ } else {
+ didDrain = false;
+ }
+
+ if (didDrain) {
+ if ((tTileEntity instanceof IGregTechTileEntity)) {
+ return this.drainTankGT(tTileEntity, aStack, aWorld, aPlayer, aX, aY, aZ);
+ }
+ // Try support Standard Fluid Tanks too (May disable if dupes appear again)
+ else if ((tTileEntity instanceof IFluidTank || tTileEntity instanceof IFluidHandler)) {
+ // return this.drainIFluidTank(tTileEntity, aStack, aWorld, aPlayer, aX, aY, aZ);
+ return false;
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ }
+ return false;
+ }
+
+ /*
+ * Vanilla IFluidTank
+ */
+
+ public boolean drainIFluidTank(
+ TileEntity tTileEntity, ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ) {
+ if (tTileEntity == null) {
+ Logger.INFO("Invalid Tile, somehow.");
+ return false;
+ }
+ if ((tTileEntity instanceof IFluidTank || tTileEntity instanceof IFluidHandler)) {
+ if (this.getFluid(aStack) == null
+ || (this.getFluid(aStack) != null && this.getFluid(aStack).amount < this.getCapacity(aStack))) {
+ Logger.INFO("Trying to find Stored Fluid - Behaviour Class.");
+ FluidStack aStored = getStoredFluidOfVanillaTank(tTileEntity);
+ if (aStored != null) {
+ int mAmountInserted = fill(aStack, aStored);
+ FluidStack newStackRemainingInTank;
+ if (mAmountInserted > 0) {
+ if (mAmountInserted == aStored.amount) {
+ newStackRemainingInTank = null;
+ } else {
+ newStackRemainingInTank =
+ FluidUtils.getFluidStack(aStored, (aStored.amount - mAmountInserted));
+ }
+ boolean b = setStoredFluidOfVanillaTank(tTileEntity, newStackRemainingInTank);
+ Logger.INFO("Cleared Tank? " + b + " | mAmountInserted: " + mAmountInserted);
+ Logger.INFO("Returning " + b + " - drainTankVanilla.");
+ if (b) {
+ PlayerUtils.messagePlayer(
+ aPlayer, "Drained " + mAmountInserted + "L of " + aStored.getLocalizedName() + ".");
+ }
+ return b;
+ }
+ } else {
+ Logger.INFO("Found no valid Fluidstack - drainTankVanilla.");
+ }
+ } else {
+ Logger.INFO("Pump is full.");
+ }
+ }
+ Logger.INFO("Could not drain vanilla tank.");
+ return false;
+ }
+
+ /*
+ * GT Tanks
+ */
+
+ public boolean drainTankGT(
+ TileEntity tTileEntity, ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ) {
+ if (tTileEntity == null) {
+ return false;
+ }
+ if ((tTileEntity instanceof IGregTechTileEntity)) {
+ Logger.INFO("Right Clicking on GT Tile - drainTankGT.");
+ if (((IGregTechTileEntity) tTileEntity).getTimer() < 50L) {
+ Logger.INFO("Returning False - Behaviour Class. Timer < 50");
+ return false;
+ } else if ((!aWorld.isRemote) && (!((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer))) {
+ Logger.INFO("Returning True - drainTankGT. NotUsable()");
+ return true;
+ } else {
+ if (this.getFluid(aStack) == null
+ || (this.getFluid(aStack) != null && this.getFluid(aStack).amount < this.getCapacity(aStack))) {
+ Logger.INFO("Trying to find Stored Fluid - drainTankGT.");
+ FluidStack aStored = getStoredFluidOfGTMachine((IGregTechTileEntity) tTileEntity);
+ if (aStored != null) {
+ int mAmountInserted = fill(aStack, aStored);
+ FluidStack newStackRemainingInTank;
+ if (mAmountInserted > 0) {
+ if (mAmountInserted == aStored.amount) {
+ newStackRemainingInTank = null;
+ } else {
+ newStackRemainingInTank =
+ FluidUtils.getFluidStack(aStored, (aStored.amount - mAmountInserted));
+ }
+ boolean b = setStoredFluidOfGTMachine(
+ (IGregTechTileEntity) tTileEntity, newStackRemainingInTank);
+ Logger.INFO("Cleared Tank? " + b + " | mAmountInserted: " + mAmountInserted);
+ Logger.INFO("Returning " + b + " - drainTankGT.");
+ if (b) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "Drained " + mAmountInserted + "L of " + aStored.getLocalizedName() + ".");
+ }
+ return b;
+ }
+ } else {
+ Logger.INFO("Found no valid Fluidstack - drainTankGT.");
+ }
+ } else {
+ Logger.INFO("Pump is full.");
+ }
+ }
+ }
+ Logger.INFO("Could not drain GT tank.");
+ return false;
+ }
+
+ /*
+ * Vanilla Tanks
+ */
+
+ public FluidStack getStoredFluidOfVanillaTank(TileEntity aTileEntity) {
+ if (aTileEntity == null) {
+ return null;
+ } else if ((aTileEntity instanceof IFluidTank || aTileEntity instanceof IFluidHandler)) {
+ if (aTileEntity instanceof IFluidTank) {
+ return getStoredFluidOfVanillaTank((IFluidTank) aTileEntity);
+ } else {
+ return getStoredFluidOfVanillaTank((IFluidHandler) aTileEntity);
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public FluidStack getStoredFluidOfVanillaTank(IFluidTank aTileEntity) {
+ FluidStack f = aTileEntity.getFluid();
+ Logger.INFO("Returning Fluid stack from tile. Found: "
+ + (f != null ? f.getLocalizedName() + " - " + f.amount + "L" : "Nothing"));
+ return f;
+ }
+
+ public FluidStack getStoredFluidOfVanillaTank(IFluidHandler aTileEntity) {
+ if (aTileEntity instanceof IFluidTank) {
+ return getStoredFluidOfVanillaTank((IFluidTank) aTileEntity);
+ }
+ FluidStack f;
+ AutoMap<FluidTankInfo[]> m = new AutoMap<FluidTankInfo[]>();
+ for (int i = 0; i < 6; i++) {
+ m.put(aTileEntity.getTankInfo(ForgeDirection.getOrientation(i)));
+ }
+ if (m.get(0) != null && m.get(0)[0] != null && m.get(0)[0].fluid != null) {
+ return m.get(0)[0].fluid;
+ } else {
+ return null;
+ }
+ }
+
+ public boolean setStoredFluidOfVanillaTank(TileEntity aTileEntity, FluidStack aSetFluid) {
+ Logger.INFO("Trying to clear Tile's tank. - Behaviour Class. [1]");
+
+ if (aTileEntity == null) {
+ return false;
+ } else if ((aTileEntity instanceof IFluidTank || aTileEntity instanceof IFluidHandler)) {
+ if (aTileEntity instanceof IFluidTank) {
+ Logger.INFO("Tile Was instanceof IFluidTank.");
+ FluidStack f = ((IFluidTank) aTileEntity).getFluid();
+ if (aSetFluid == null) {
+ aSetFluid = f;
+ aSetFluid.amount = f.amount;
+ }
+ int toDrain = (f.amount - aSetFluid.amount);
+ FluidStack newStack;
+ if (toDrain <= 0) {
+ newStack = f;
+ } else {
+ newStack = ((IFluidTank) aTileEntity).drain(toDrain, true);
+ }
+
+ if (newStack.isFluidEqual(aSetFluid) && newStack.amount == aSetFluid.amount) {
+ Logger.INFO("Removed fluid from vanilla IFluidTank successfully.");
+ return true;
+ } else {
+ Logger.INFO("Failed trying to remove fluid from vanilla IFluidTank.");
+ return false;
+ }
+ } else {
+
+ // Rewrite Fluid handling for Vanilla type tanks
+ if (!IFluidHandler.class.isInstance(aTileEntity)) {
+ Logger.INFO("Tile Was not an instance of IFluidHandler.");
+ return false;
+ }
+
+ IFluidHandler aTank = (IFluidHandler) aTileEntity;
+ FluidStack aTankContents = null;
+ FluidTankInfo[] a1 = aTank.getTankInfo(ForgeDirection.UNKNOWN);
+ if (a1 != null) {
+ if (a1[0] != null) {
+ aTankContents = a1[0].fluid;
+ Logger.INFO("Found Fluid in Tank. " + aTankContents.getLocalizedName() + " - "
+ + aTankContents.amount);
+ }
+ }
+ if (aSetFluid == null) {
+ Logger.INFO("Setting fluid to tank contents, as we're going to empty it totally.");
+ aSetFluid = aTankContents.copy();
+ } else {
+ Logger.INFO("Setting fluid to tank contents, as we're going to empty it totally.");
+ }
+ Logger.INFO("Tile Was instance of IFluidHandler. Trying to Drain " + aSetFluid.getLocalizedName()
+ + " - " + aSetFluid.amount);
+
+ if (a1 == null || aTankContents == null) {
+ Logger.INFO("Tank is empty.");
+ return false;
+ }
+ // Found some Fluid in the tank
+ else {
+ FluidStack aDrainedStack = aTank.drain(ForgeDirection.UNKNOWN, aSetFluid, true);
+ if (aDrainedStack.isFluidStackIdentical(aSetFluid)) {
+ Logger.INFO("Drained!");
+ return true;
+ } else {
+ Logger.INFO("Partially Drained! This is probably an error.");
+ return true;
+ }
+ }
+ }
+ } else {
+ Logger.INFO("Bad Tank Tile to drain.");
+ return false;
+ }
+ }
+
+ /*
+ * GT Tanks
+ */
+
+ public FluidStack getStoredFluidOfGTMachine(IGregTechTileEntity aTileEntity) {
+ if (aTileEntity == null) {
+ return null;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ ;
+ if (aMetaTileEntity == null) {
+ return null;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicTank) {
+ Logger.INFO("Tile Was Instanceof BasicTank.");
+ return getStoredFluidOfGTMachine((GT_MetaTileEntity_BasicTank) aMetaTileEntity);
+ } else {
+ return null;
+ }
+ }
+
+ public FluidStack getStoredFluidOfGTMachine(GT_MetaTileEntity_BasicTank aTileEntity) {
+ FluidStack f = aTileEntity.mFluid;
+
+ // Let's see if this machine has output fluid too
+ /*
+ * if (f == null) {
+ * Logger.INFO("Could not find any input fluid, checking output if possible.");
+ * if (aTileEntity instanceof GT_MetaTileEntity_BasicMachine) {
+ * GT_MetaTileEntity_BasicMachine g = (GT_MetaTileEntity_BasicMachine)
+ * aTileEntity;
+ * Logger.INFO("Tile is a Basic Machine of some sort - "+g.mNEIName); if (g !=
+ * null) { f = g.mOutputFluid; if (f != null) {
+ * Logger.INFO("Found output fluid! "+f.getLocalizedName()); } else {
+ * Logger.INFO("Did not find anything!"); f = g.getFluid(); if (f != null) {
+ * Logger.INFO("Found fluid! "+f.getLocalizedName()); } else {
+ * Logger.INFO("Did not find anything!"); f = g.getFluid(); } } } } }
+ */
+
+ Logger.INFO("Returning Fluid stack from tile. Found: "
+ + (f != null ? f.getLocalizedName() + " - " + f.amount + "L" : "Nothing"));
+ return f;
+ }
+
+ public boolean setStoredFluidOfGTMachine(IGregTechTileEntity aTileEntity, FluidStack aSetFluid) {
+ Logger.INFO("Trying to clear Tile's tank. - Behaviour Class. [1]");
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicTank) {
+ Logger.INFO("Trying to clear Tile's tank. - Behaviour Class. [2]");
+ return setStoredFluidOfGTMachine((GT_MetaTileEntity_BasicTank) aMetaTileEntity, aSetFluid);
+ } else {
+ return false;
+ }
+ }
+
+ public boolean setStoredFluidOfGTMachine(GT_MetaTileEntity_BasicTank aTileEntity, FluidStack aSetFluid) {
+ try {
+
+ // Try Handle Outputs First
+ /*
+ * if (aTileEntity.setDrainableStack(aSetFluid) != null) { return true; }
+ */
+
+ aTileEntity.mFluid = aSetFluid;
+ boolean b = aTileEntity.mFluid == aSetFluid;
+ Logger.INFO("Trying to set Tile's tank. - Behaviour Class. [3] " + b);
+ return b;
+ } catch (Throwable t) {
+ Logger.INFO("Trying to clear Tile's tank. FAILED - Behaviour Class. [x]");
+ return false;
+ }
+ }
+
+ public int getCorrectMetaForItemstack(ItemStack aStack) {
+ if (aStack == null) {
+ return 0;
+ } else {
+ if (aStack.getItemDamage() < this.mOffset) {
+ return 0;
+ } else {
+ int newMeta = aStack.getItemDamage() - this.mOffset;
+ newMeta = (Math.max(0, Math.min(3, newMeta)));
+ return newMeta;
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java b/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
index 555fc0f23f..3f4a754ab8 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
@@ -1,80 +1,71 @@
package gtPlusPlus.core.item.tool.misc;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
-import gtPlusPlus.core.lib.CORE;
-
-public class SandstoneHammer extends BaseItemWithDamageValue{
-
- /* (non-Javadoc)
- * @see net.minecraft.item.Item#getColorFromItemStack(net.minecraft.item.ItemStack, int)
- */
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- //Figure Out Damage
-
-
- return super.getColorFromItemStack(stack, HEX_OxFFFFFF);
- }
-
- public SandstoneHammer(final String unlocalizedName) {
- super(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setMaxDamage(2500);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GRAY+"Allows you to craft sand from cobble, or sandstone from sand.");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public boolean doesContainerItemLeaveCraftingGrid(final ItemStack itemStack)
- {
- return false;
- }
-
- @Override
- public boolean getShareTag()
- {
- return true;
- }
-
- @Override
- public boolean hasContainerItem(final ItemStack itemStack)
- {
- return true;
- }
- @Override
- public ItemStack getContainerItem(final ItemStack itemStack)
- {
- itemStack.setItemDamage(itemStack.getItemDamage() + 8);
-
- return itemStack;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.uncommon;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return false;
- }
-
-
+public class SandstoneHammer extends BaseItemWithDamageValue {
+
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getColorFromItemStack(net.minecraft.item.ItemStack, int)
+ */
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ // Figure Out Damage
+
+ return super.getColorFromItemStack(stack, HEX_OxFFFFFF);
+ }
+
+ public SandstoneHammer(final String unlocalizedName) {
+ super(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(2500);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GRAY + "Allows you to craft sand from cobble, or sandstone from sand.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public boolean doesContainerItemLeaveCraftingGrid(final ItemStack itemStack) {
+ return false;
+ }
+
+ @Override
+ public boolean getShareTag() {
+ return true;
+ }
+
+ @Override
+ public boolean hasContainerItem(final ItemStack itemStack) {
+ return true;
+ }
+
+ @Override
+ public ItemStack getContainerItem(final ItemStack itemStack) {
+ itemStack.setItemDamage(itemStack.getItemDamage() + 8);
+
+ return itemStack;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java
index baed16db03..7f4e971e5a 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java
@@ -2,10 +2,16 @@ package gtPlusPlus.core.item.tool.misc.box;
public class AutoLunchBox extends BaseBoxItem {
- public final static int SLOTS = 9;
-
- public AutoLunchBox(String displayName) {
- super(displayName, new String[] {"Stores 9 pieces of food", "Food will automatically be eaten from slot 1, through to "+gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS}, gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
- }
+ public static final int SLOTS = 9;
+ public AutoLunchBox(String displayName) {
+ super(
+ displayName,
+ new String[] {
+ "Stores 9 pieces of food",
+ "Food will automatically be eaten from slot 1, through to "
+ + gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS
+ },
+ gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/BaseBoxItem.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/BaseBoxItem.java
index 10a3ae5804..40fd5dfc7d 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/BaseBoxItem.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/box/BaseBoxItem.java
@@ -16,44 +16,54 @@ import net.minecraft.world.World;
public class BaseBoxItem extends CoreItem {
- private final int GUI;
-
- public BaseBoxItem(String displayName, String[] description, int GUI_ID) {
- super("item." + Utils.sanitizeString(displayName), displayName, AddToCreativeTab.tabTools, 1, 0,
- modifyDescriptionStringArray(description), EnumRarity.uncommon, EnumChatFormatting.GRAY, false, null);
- GUI = GUI_ID;
- }
-
- private static String[] modifyDescriptionStringArray(String[] array) {
- String[] a = new String[array.length + 1];
- for (int b = 0; b < array.length; b++) {
- a[b] = array[b];
- }
- a[a.length - 1] = "Right Click to open";
- return a;
- }
-
- // Without this method, your inventory will NOT work!!!
- @Override
- public int getMaxItemUseDuration(ItemStack stack) {
- return 1; // return any value greater than zero
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
- if (!world.isRemote) {
- // If player not sneaking, open the inventory gui
- if (!player.isSneaking()) {
- player.openGui(GTplusplus.instance, GUI, world, (int) player.posX, (int) player.posY,
- (int) player.posZ);
- }
- }
- return itemstack;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister iconRegister) {
- this.itemIcon = iconRegister.registerIcon(CORE.MODID + ":" + this.getUnlocalizedName().substring(5));
- }
+ private final int GUI;
+
+ public BaseBoxItem(String displayName, String[] description, int GUI_ID) {
+ super(
+ "item." + Utils.sanitizeString(displayName),
+ displayName,
+ AddToCreativeTab.tabTools,
+ 1,
+ 0,
+ modifyDescriptionStringArray(description),
+ EnumRarity.uncommon,
+ EnumChatFormatting.GRAY,
+ false,
+ null);
+ GUI = GUI_ID;
+ }
+
+ private static String[] modifyDescriptionStringArray(String[] array) {
+ String[] a = new String[array.length + 1];
+ for (int b = 0; b < array.length; b++) {
+ a[b] = array[b];
+ }
+ a[a.length - 1] = "Right Click to open";
+ return a;
+ }
+
+ // Without this method, your inventory will NOT work!!!
+ @Override
+ public int getMaxItemUseDuration(ItemStack stack) {
+ return 1; // return any value greater than zero
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
+ if (!world.isRemote) {
+ // If player not sneaking, open the inventory gui
+ if (!player.isSneaking()) {
+ player.openGui(
+ GTplusplus.instance, GUI, world, (int) player.posX, (int) player.posY, (int) player.posZ);
+ }
+ }
+ return itemstack;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister iconRegister) {
+ this.itemIcon = iconRegister.registerIcon(
+ CORE.MODID + ":" + this.getUnlocalizedName().substring(5));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/ContainerBoxBase.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/ContainerBoxBase.java
index 035859c388..242b659462 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/ContainerBoxBase.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/box/ContainerBoxBase.java
@@ -2,9 +2,6 @@ package gtPlusPlus.core.item.tool.misc.box;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
-
-import gregtech.api.enums.Materials;
-import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -14,315 +11,322 @@ import net.minecraft.item.ItemStack;
public class ContainerBoxBase extends Container {
- /*
- * Finally, in your Container class, you will need to check if the currently
- * opened inventory's uniqueID is equal to the itemstack's uniqueID in the
- * method 'transferStackInSlot' as well as check if the itemstack is the
- * currently equipped item in the method 'slotClick'. In both cases, you'll need
- * to prevent the itemstack from being moved or it will cause bad things to
- * happen.
- */
-
- /**
- * Step 3: Create a custom Container for your Inventory
- */
-
- /*
- * There's a LOT of code in this one, but read through all of the comments
- * carefully and it should become clear what everything does. As a bonus, one of
- * my previous tutorials is included within!
- * "How to Properly Override Shift-Clicking" is here and better than ever! At
- * least in my opinion. If you're like me, and you find no end of frustration
- * trying to figure out which f-ing index you should use for which slots in your
- * container when overriding transferStackInSlot, or if your following the
- * original tutorial, then read on.
- */
-
- /**
- * The Item Inventory for this Container, only needed if you want to reference
- * isUseableByPlayer
- */
- private final CustomBoxInventory inventory;
- /**
- * Using these will make transferStackInSlot easier to understand and implement
- * INV_START is the index of the first slot in the Player's Inventory, so our
- * CustomBoxInventory's number of slots (e.g. 5 slots is array indices 0-4, so
- * start at 5) Notice how we don't have to remember how many slots we made? We
- * can just use CustomBoxInventory.INV_SIZE and if we ever change it, the
- * Container updates automatically.
- */
- private final int INV_START, INV_END, HOTBAR_START, HOTBAR_END;
-
- // If you're planning to add armor slots, put those first like this:
- // ARMOR_START = CustomBoxInventory.INV_SIZE, ARMOR_END = ARMOR_START+3,
- // INV_START = ARMOR_END+1, and then carry on like above.
-
- private Slot generateSlot(final Constructor<?> aClazz, final IInventory base, final int id, final int x,
- final int y) {
- Slot aSlot;
- try {
- aSlot = (Slot) aClazz.newInstance(base, id, x, y);
- if (aSlot != null) {
- return aSlot;
- }
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public ContainerBoxBase(EntityPlayer par1Player, InventoryPlayer inventoryPlayer,
- CustomBoxInventory CustomBoxInventory, Class<?> aClazz, int aSlotCount) {
-
- INV_START = aSlotCount;
- INV_END = INV_START + 26;
- HOTBAR_START = INV_END + 1;
- HOTBAR_END = HOTBAR_START + 8;
-
- this.inventory = CustomBoxInventory;
- try {
-
- Constructor<?> constructor;
- constructor = aClazz.getConstructor(IInventory.class, int.class, int.class, int.class);
-
- int i;
-
- // ITEM INVENTORY - you'll need to adjust the slot locations to match your
- // texture file
- // I have them set vertically in columns of 4 to the right of the player model
- for (i = 0; i < CustomBoxInventory.INV_SIZE; ++i) {
- // You can make a custom Slot if you need different behavior,
- // such as only certain item types can be put into this slot
- // We made a custom slot to prevent our inventory-storing item
- // from being stored within itself, but if you want to allow that and
- // you followed my advice at the end of the above step, then you
- // could get away with using the vanilla Slot class
- this.addSlotToContainer(generateSlot(constructor, this.getInventoryObject(), i,
- 80 + (18 * (int) (i / 4)), 8 + (18 * (i % 4))));
- }
-
- // If you want, you can add ARMOR SLOTS here as well, but you need to
- // make a public version of SlotArmor. I won't be doing that in this tutorial.
- /*
- * for (i = 0; i < 4; ++i) { // These are the standard positions for survival
- * inventory layout this.addSlotToContainer(new SlotArmor(this.player,
- * inventoryPlayer, inventoryPlayer.getSizeInventory() - 1 - i, 8, 8 + i * 18,
- * i)); }
- */
-
- // PLAYER INVENTORY - uses default locations for standard inventory texture file
- for (i = 0; i < 3; ++i) {
- for (int j = 0; j < 9; ++j) {
- this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
- }
- }
-
- // PLAYER ACTION BAR - uses default locations for standard action bar texture
- // file
- for (i = 0; i < 9; ++i) {
- this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
- }
-
- } catch (NoSuchMethodException | SecurityException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer entityplayer) {
- // be sure to return the inventory's isUseableByPlayer method
- // if you defined special behavior there:
- return getInventoryObject().isUseableByPlayer(entityplayer);
- }
-
- /**
- * Called when a player shift-clicks on a slot. You must override this or you
- * will crash when someone does that.
- */
- public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int index) {
- ItemStack itemstack = null;
- Slot slot = (Slot) this.inventorySlots.get(index);
-
- if (slot != null && slot.getHasStack()) {
- ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
-
- // If item is in our custom Inventory or armor slot
- if (index < INV_START) {
- // try to place in player inventory / action bar
- if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END + 1, true)) {
- return null;
- }
-
- slot.onSlotChange(itemstack1, itemstack);
- }
- // Item is in inventory / hotbar, try to place in custom inventory or armor
- // slots
- else {
- /*
- * If your inventory only stores certain instances of Items, you can implement
- * shift-clicking to your inventory like this:
- *
- * // Check that the item is the right type if (itemstack1.getItem() instanceof
- * ItemCustom) { // Try to merge into your custom inventory slots // We use
- * 'CustomBoxInventory.INV_SIZE' instead of INV_START just in case // you also
- * add armor or other custom slots if (!this.mergeItemStack(itemstack1, 0,
- * CustomBoxInventory.INV_SIZE, false)) { return null; } } // If you added armor
- * slots, check them here as well: // Item being shift-clicked is armor - try to
- * put in armor slot if (itemstack1.getItem() instanceof ItemArmor) { int type =
- * ((ItemArmor) itemstack1.getItem()).armorType; if
- * (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START + type + 1,
- * false)) { return null; } } Otherwise, you have basically 2 choices: 1.
- * shift-clicking between player inventory and custom inventory 2.
- * shift-clicking between action bar and inventory
- *
- * Be sure to choose only ONE of the following implementations!!!
- */
- /**
- * Implementation number 1: Shift-click into your custom inventory
- */
- if (index >= INV_START) {
- // place in custom inventory
- if (!this.mergeItemStack(itemstack1, 0, INV_START, false)) {
- return null;
- }
- }
-
- /**
- * Implementation number 2: Shift-click items between action bar and inventory
- */
- // item is in player's inventory, but not in action bar
- if (index >= INV_START && index < HOTBAR_START) {
- // place in action bar
- if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END + 1, false)) {
- return null;
- }
- }
- // item in action bar - place in player inventory
- else if (index >= HOTBAR_START && index < HOTBAR_END + 1) {
- if (!this.mergeItemStack(itemstack1, INV_START, INV_END + 1, false)) {
- return null;
- }
- }
- }
-
- if (itemstack1.stackSize == 0) {
- slot.putStack((ItemStack) null);
- } else {
- slot.onSlotChanged();
- }
-
- if (itemstack1.stackSize == itemstack.stackSize) {
- return null;
- }
-
- slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
- }
-
- return itemstack;
- }
-
- /**
- * You should override this method to prevent the player from moving the stack
- * that opened the inventory, otherwise if the player moves it, the inventory
- * will not be able to save properly
- */
- @Override
- public ItemStack slotClick(int slot, int button, int flag, EntityPlayer player) {
- // this will prevent the player from interacting with the item that opened the
- // inventory:
- if (slot >= 0 && getSlot(slot) != null && getSlot(slot).getStack() == player.getHeldItem()) {
- return null;
- }
- return super.slotClick(slot, button, flag, player);
- }
-
- /*
- * Special note: If your custom inventory's stack limit is 1 and you allow
- * shift-clicking itemstacks into it, you will need to override mergeStackInSlot
- * to avoid losing all the items but one in a stack when you shift-click.
- */
- /**
- * Vanilla mergeItemStack method doesn't correctly handle inventories whose max
- * stack size is 1 when you shift-click into the inventory. This is a modified
- * method I wrote to handle such cases. Note you only need it if your slot /
- * inventory's max stack size is 1
- */
- @Override
- protected boolean mergeItemStack(ItemStack stack, int start, int end, boolean backwards) {
- boolean flag1 = false;
- int k = (backwards ? end - 1 : start);
- Slot slot;
- ItemStack itemstack1;
-
- if (stack.isStackable()) {
- while (stack.stackSize > 0 && (!backwards && k < end || backwards && k >= start)) {
- slot = (Slot) inventorySlots.get(k);
- itemstack1 = slot.getStack();
-
- if (!slot.isItemValid(stack)) {
- k += (backwards ? -1 : 1);
- continue;
- }
-
- if (itemstack1 != null && itemstack1.getItem() == stack.getItem()
- && (!stack.getHasSubtypes() || stack.getItemDamage() == itemstack1.getItemDamage())
- && ItemStack.areItemStackTagsEqual(stack, itemstack1)) {
- int l = itemstack1.stackSize + stack.stackSize;
-
- if (l <= stack.getMaxStackSize() && l <= slot.getSlotStackLimit()) {
- stack.stackSize = 0;
- itemstack1.stackSize = l;
- getInventoryObject().markDirty();
- flag1 = true;
- } else if (itemstack1.stackSize < stack.getMaxStackSize() && l < slot.getSlotStackLimit()) {
- stack.stackSize -= stack.getMaxStackSize() - itemstack1.stackSize;
- itemstack1.stackSize = stack.getMaxStackSize();
- getInventoryObject().markDirty();
- flag1 = true;
- }
- }
-
- k += (backwards ? -1 : 1);
- }
- }
- if (stack.stackSize > 0) {
- k = (backwards ? end - 1 : start);
- while (!backwards && k < end || backwards && k >= start) {
- slot = (Slot) inventorySlots.get(k);
- itemstack1 = slot.getStack();
-
- if (!slot.isItemValid(stack)) {
- k += (backwards ? -1 : 1);
- continue;
- }
-
- if (itemstack1 == null) {
- int l = stack.stackSize;
- if (l <= slot.getSlotStackLimit()) {
- slot.putStack(stack.copy());
- stack.stackSize = 0;
- getInventoryObject().markDirty();
- flag1 = true;
- break;
- } else {
- putStackInSlot(k,
- new ItemStack(stack.getItem(), slot.getSlotStackLimit(), stack.getItemDamage()));
- stack.stackSize -= slot.getSlotStackLimit();
- getInventoryObject().markDirty();
- flag1 = true;
- }
- }
-
- k += (backwards ? -1 : 1);
- }
- }
-
- return flag1;
- }
-
- public CustomBoxInventory getInventoryObject() {
- return inventory;
- }
-} \ No newline at end of file
+ /*
+ * Finally, in your Container class, you will need to check if the currently
+ * opened inventory's uniqueID is equal to the itemstack's uniqueID in the
+ * method 'transferStackInSlot' as well as check if the itemstack is the
+ * currently equipped item in the method 'slotClick'. In both cases, you'll need
+ * to prevent the itemstack from being moved or it will cause bad things to
+ * happen.
+ */
+
+ /**
+ * Step 3: Create a custom Container for your Inventory
+ */
+
+ /*
+ * There's a LOT of code in this one, but read through all of the comments
+ * carefully and it should become clear what everything does. As a bonus, one of
+ * my previous tutorials is included within!
+ * "How to Properly Override Shift-Clicking" is here and better than ever! At
+ * least in my opinion. If you're like me, and you find no end of frustration
+ * trying to figure out which f-ing index you should use for which slots in your
+ * container when overriding transferStackInSlot, or if your following the
+ * original tutorial, then read on.
+ */
+
+ /**
+ * The Item Inventory for this Container, only needed if you want to reference
+ * isUseableByPlayer
+ */
+ private final CustomBoxInventory inventory;
+ /**
+ * Using these will make transferStackInSlot easier to understand and implement
+ * INV_START is the index of the first slot in the Player's Inventory, so our
+ * CustomBoxInventory's number of slots (e.g. 5 slots is array indices 0-4, so
+ * start at 5) Notice how we don't have to remember how many slots we made? We
+ * can just use CustomBoxInventory.INV_SIZE and if we ever change it, the
+ * Container updates automatically.
+ */
+ private final int INV_START, INV_END, HOTBAR_START, HOTBAR_END;
+
+ // If you're planning to add armor slots, put those first like this:
+ // ARMOR_START = CustomBoxInventory.INV_SIZE, ARMOR_END = ARMOR_START+3,
+ // INV_START = ARMOR_END+1, and then carry on like above.
+
+ private Slot generateSlot(
+ final Constructor<?> aClazz, final IInventory base, final int id, final int x, final int y) {
+ Slot aSlot;
+ try {
+ aSlot = (Slot) aClazz.newInstance(base, id, x, y);
+ if (aSlot != null) {
+ return aSlot;
+ }
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public ContainerBoxBase(
+ EntityPlayer par1Player,
+ InventoryPlayer inventoryPlayer,
+ CustomBoxInventory CustomBoxInventory,
+ Class<?> aClazz,
+ int aSlotCount) {
+
+ INV_START = aSlotCount;
+ INV_END = INV_START + 26;
+ HOTBAR_START = INV_END + 1;
+ HOTBAR_END = HOTBAR_START + 8;
+
+ this.inventory = CustomBoxInventory;
+ try {
+
+ Constructor<?> constructor;
+ constructor = aClazz.getConstructor(IInventory.class, int.class, int.class, int.class);
+
+ int i;
+
+ // ITEM INVENTORY - you'll need to adjust the slot locations to match your
+ // texture file
+ // I have them set vertically in columns of 4 to the right of the player model
+ for (i = 0; i < CustomBoxInventory.INV_SIZE; ++i) {
+ // You can make a custom Slot if you need different behavior,
+ // such as only certain item types can be put into this slot
+ // We made a custom slot to prevent our inventory-storing item
+ // from being stored within itself, but if you want to allow that and
+ // you followed my advice at the end of the above step, then you
+ // could get away with using the vanilla Slot class
+ this.addSlotToContainer(generateSlot(
+ constructor, this.getInventoryObject(), i, 80 + (18 * (int) (i / 4)), 8 + (18 * (i % 4))));
+ }
+
+ // If you want, you can add ARMOR SLOTS here as well, but you need to
+ // make a public version of SlotArmor. I won't be doing that in this tutorial.
+ /*
+ * for (i = 0; i < 4; ++i) { // These are the standard positions for survival
+ * inventory layout this.addSlotToContainer(new SlotArmor(this.player,
+ * inventoryPlayer, inventoryPlayer.getSizeInventory() - 1 - i, 8, 8 + i * 18,
+ * i)); }
+ */
+
+ // PLAYER INVENTORY - uses default locations for standard inventory texture file
+ for (i = 0; i < 3; ++i) {
+ for (int j = 0; j < 9; ++j) {
+ this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
+ }
+ }
+
+ // PLAYER ACTION BAR - uses default locations for standard action bar texture
+ // file
+ for (i = 0; i < 9; ++i) {
+ this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
+ }
+
+ } catch (NoSuchMethodException | SecurityException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer entityplayer) {
+ // be sure to return the inventory's isUseableByPlayer method
+ // if you defined special behavior there:
+ return getInventoryObject().isUseableByPlayer(entityplayer);
+ }
+
+ /**
+ * Called when a player shift-clicks on a slot. You must override this or you
+ * will crash when someone does that.
+ */
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int index) {
+ ItemStack itemstack = null;
+ Slot slot = (Slot) this.inventorySlots.get(index);
+
+ if (slot != null && slot.getHasStack()) {
+ ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+
+ // If item is in our custom Inventory or armor slot
+ if (index < INV_START) {
+ // try to place in player inventory / action bar
+ if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END + 1, true)) {
+ return null;
+ }
+
+ slot.onSlotChange(itemstack1, itemstack);
+ }
+ // Item is in inventory / hotbar, try to place in custom inventory or armor
+ // slots
+ else {
+ /*
+ * If your inventory only stores certain instances of Items, you can implement
+ * shift-clicking to your inventory like this:
+ *
+ * // Check that the item is the right type if (itemstack1.getItem() instanceof
+ * ItemCustom) { // Try to merge into your custom inventory slots // We use
+ * 'CustomBoxInventory.INV_SIZE' instead of INV_START just in case // you also
+ * add armor or other custom slots if (!this.mergeItemStack(itemstack1, 0,
+ * CustomBoxInventory.INV_SIZE, false)) { return null; } } // If you added armor
+ * slots, check them here as well: // Item being shift-clicked is armor - try to
+ * put in armor slot if (itemstack1.getItem() instanceof ItemArmor) { int type =
+ * ((ItemArmor) itemstack1.getItem()).armorType; if
+ * (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START + type + 1,
+ * false)) { return null; } } Otherwise, you have basically 2 choices: 1.
+ * shift-clicking between player inventory and custom inventory 2.
+ * shift-clicking between action bar and inventory
+ *
+ * Be sure to choose only ONE of the following implementations!!!
+ */
+ /**
+ * Implementation number 1: Shift-click into your custom inventory
+ */
+ if (index >= INV_START) {
+ // place in custom inventory
+ if (!this.mergeItemStack(itemstack1, 0, INV_START, false)) {
+ return null;
+ }
+ }
+
+ /**
+ * Implementation number 2: Shift-click items between action bar and inventory
+ */
+ // item is in player's inventory, but not in action bar
+ if (index >= INV_START && index < HOTBAR_START) {
+ // place in action bar
+ if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END + 1, false)) {
+ return null;
+ }
+ }
+ // item in action bar - place in player inventory
+ else if (index >= HOTBAR_START && index < HOTBAR_END + 1) {
+ if (!this.mergeItemStack(itemstack1, INV_START, INV_END + 1, false)) {
+ return null;
+ }
+ }
+ }
+
+ if (itemstack1.stackSize == 0) {
+ slot.putStack((ItemStack) null);
+ } else {
+ slot.onSlotChanged();
+ }
+
+ if (itemstack1.stackSize == itemstack.stackSize) {
+ return null;
+ }
+
+ slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
+ }
+
+ return itemstack;
+ }
+
+ /**
+ * You should override this method to prevent the player from moving the stack
+ * that opened the inventory, otherwise if the player moves it, the inventory
+ * will not be able to save properly
+ */
+ @Override
+ public ItemStack slotClick(int slot, int button, int flag, EntityPlayer player) {
+ // this will prevent the player from interacting with the item that opened the
+ // inventory:
+ if (slot >= 0 && getSlot(slot) != null && getSlot(slot).getStack() == player.getHeldItem()) {
+ return null;
+ }
+ return super.slotClick(slot, button, flag, player);
+ }
+
+ /*
+ * Special note: If your custom inventory's stack limit is 1 and you allow
+ * shift-clicking itemstacks into it, you will need to override mergeStackInSlot
+ * to avoid losing all the items but one in a stack when you shift-click.
+ */
+ /**
+ * Vanilla mergeItemStack method doesn't correctly handle inventories whose max
+ * stack size is 1 when you shift-click into the inventory. This is a modified
+ * method I wrote to handle such cases. Note you only need it if your slot /
+ * inventory's max stack size is 1
+ */
+ @Override
+ protected boolean mergeItemStack(ItemStack stack, int start, int end, boolean backwards) {
+ boolean flag1 = false;
+ int k = (backwards ? end - 1 : start);
+ Slot slot;
+ ItemStack itemstack1;
+
+ if (stack.isStackable()) {
+ while (stack.stackSize > 0 && (!backwards && k < end || backwards && k >= start)) {
+ slot = (Slot) inventorySlots.get(k);
+ itemstack1 = slot.getStack();
+
+ if (!slot.isItemValid(stack)) {
+ k += (backwards ? -1 : 1);
+ continue;
+ }
+
+ if (itemstack1 != null
+ && itemstack1.getItem() == stack.getItem()
+ && (!stack.getHasSubtypes() || stack.getItemDamage() == itemstack1.getItemDamage())
+ && ItemStack.areItemStackTagsEqual(stack, itemstack1)) {
+ int l = itemstack1.stackSize + stack.stackSize;
+
+ if (l <= stack.getMaxStackSize() && l <= slot.getSlotStackLimit()) {
+ stack.stackSize = 0;
+ itemstack1.stackSize = l;
+ getInventoryObject().markDirty();
+ flag1 = true;
+ } else if (itemstack1.stackSize < stack.getMaxStackSize() && l < slot.getSlotStackLimit()) {
+ stack.stackSize -= stack.getMaxStackSize() - itemstack1.stackSize;
+ itemstack1.stackSize = stack.getMaxStackSize();
+ getInventoryObject().markDirty();
+ flag1 = true;
+ }
+ }
+
+ k += (backwards ? -1 : 1);
+ }
+ }
+ if (stack.stackSize > 0) {
+ k = (backwards ? end - 1 : start);
+ while (!backwards && k < end || backwards && k >= start) {
+ slot = (Slot) inventorySlots.get(k);
+ itemstack1 = slot.getStack();
+
+ if (!slot.isItemValid(stack)) {
+ k += (backwards ? -1 : 1);
+ continue;
+ }
+
+ if (itemstack1 == null) {
+ int l = stack.stackSize;
+ if (l <= slot.getSlotStackLimit()) {
+ slot.putStack(stack.copy());
+ stack.stackSize = 0;
+ getInventoryObject().markDirty();
+ flag1 = true;
+ break;
+ } else {
+ putStackInSlot(
+ k, new ItemStack(stack.getItem(), slot.getSlotStackLimit(), stack.getItemDamage()));
+ stack.stackSize -= slot.getSlotStackLimit();
+ getInventoryObject().markDirty();
+ flag1 = true;
+ }
+ }
+
+ k += (backwards ? -1 : 1);
+ }
+ }
+
+ return flag1;
+ }
+
+ public CustomBoxInventory getInventoryObject() {
+ return inventory;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/CustomBoxInventory.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/CustomBoxInventory.java
index 0737e463d8..ed5ebb41e3 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/CustomBoxInventory.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/box/CustomBoxInventory.java
@@ -1,7 +1,6 @@
package gtPlusPlus.core.item.tool.misc.box;
import java.util.UUID;
-
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -11,233 +10,207 @@ import net.minecraftforge.common.util.Constants;
public abstract class CustomBoxInventory implements IInventory {
- private final String name;
- protected String uniqueID;
-
- /** Provides NBT Tag Compound to reference */
- private final ItemStack invItem;
-
- /** Defining your inventory size this way is handy */
- public final int INV_SIZE;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory;
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public CustomBoxInventory(ItemStack stack, String name2){
- this(stack, name2, 8);
- }
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public CustomBoxInventory(ItemStack stack, String name2, int slots)
- {
- invItem = stack;
- name = name2;
- INV_SIZE = slots;
- inventory = new ItemStack[INV_SIZE];
-
- /** initialize variable within the constructor: */
- uniqueID = "";
-
- if (!stack.hasTagCompound())
- {
- stack.setTagCompound(new NBTTagCompound());
- // no tag compound means the itemstack does not yet have a UUID, so assign one:
- uniqueID = UUID.randomUUID().toString();
- }
-
- /** When reading from NBT: */
- if ("".equals(uniqueID))
- {
- // try to read unique ID from NBT
- uniqueID = stack.getTagCompound().getString("uniqueID");
- // if it's still "", assign a new one:
- if ("".equals(uniqueID))
- {
- uniqueID = UUID.randomUUID().toString();
- }
- }
-
- /** Writing to NBT: */
- // just add this line:
- stack.getTagCompound().setString("uniqueID", this.uniqueID);
-
- // note that it's okay to use stack instead of invItem right there
- // both reference the same memory location, so whatever you change using
- // either reference will change in the other
-
- // Read the inventory contents from NBT
- readFromNBT(stack.getTagCompound());
- }
-
- @Override
- public int getSizeInventory()
- {
- return inventory.length;
- }
-
- @Override
- public ItemStack getStackInSlot(int slot)
- {
- return inventory[slot];
- }
-
- @Override
- public ItemStack decrStackSize(int slot, int amount)
- {
- ItemStack stack = getStackInSlot(slot);
- if(stack != null)
- {
- if(stack.stackSize > amount)
- {
- stack = stack.splitStack(amount);
- // Don't forget this line or your inventory will not be saved!
- markDirty();
- }
- else
- {
- // this method also calls onInventoryChanged, so we don't need to call it again
- setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int slot)
- {
- ItemStack stack = getStackInSlot(slot);
- setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(int slot, ItemStack stack)
- {
- inventory[slot] = stack;
-
- if (stack != null && stack.stackSize > getInventoryStackLimit())
- {
- stack.stackSize = getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- markDirty();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName()
- {
- return name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName()
- {
- return name.length() > 0;
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- /**
- * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
- * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
- * let you change things in your inventory without ever opening a Gui, if you want.
- */
- // 1.7.2+ renamed to markDirty
- @Override
- public void markDirty()
- {
- for (int i = 0; i < getSizeInventory(); ++i)
- {
- if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
- inventory[i] = null;
- }
- }
-
- // This line here does the work:
- writeToNBT(invItem.getTagCompound());
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer entityplayer)
- {
- return true;
- }
-
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
- @Override
- public void openInventory() {}
-
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {}
-
- /**
- * This method doesn't seem to do what it claims to do, as
- * items can still be left-clicked and placed in the inventory
- * even when this returns false
- */
- @Override
- public abstract boolean isItemValidForSlot(int slot, ItemStack itemstack);
-
- /**
- * A custom method to read our inventory from an ItemStack's NBT compound
- */
- public void readFromNBT(NBTTagCompound compound)
- {
- // Gets the custom taglist we wrote to this compound, if any
- // 1.7.2+ change to compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
- NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
-
- for (int i = 0; i < items.tagCount(); ++i)
- {
- // 1.7.2+ change to items.getCompoundTagAt(i)
- NBTTagCompound item = (NBTTagCompound) items.getCompoundTagAt(i);
- int slot = item.getInteger("Slot");
-
- // Just double-checking that the saved slot index is within our inventory array bounds
- if (slot >= 0 && slot < getSizeInventory()) {
- inventory[slot] = ItemStack.loadItemStackFromNBT(item);
- }
- }
- }
-
- /**
- * A custom method to write our inventory to an ItemStack's NBT compound
- */
- public void writeToNBT(NBTTagCompound tagcompound)
- {
- // Create a new NBT Tag List to store itemstacks as NBT Tags
- NBTTagList items = new NBTTagList();
-
- for (int i = 0; i < getSizeInventory(); ++i)
- {
- // Only write stacks that contain items
- if (getStackInSlot(i) != null)
- {
- // Make a new NBT Tag Compound to write the itemstack and slot index to
- NBTTagCompound item = new NBTTagCompound();
- item.setInteger("Slot", i);
- // Writes the itemstack in slot(i) to the Tag Compound we just made
- getStackInSlot(i).writeToNBT(item);
-
- // add the tag compound to our tag list
- items.appendTag(item);
- }
- }
- // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory"
- tagcompound.setTag("ItemInventory", items);
- }
-
+ private final String name;
+ protected String uniqueID;
+
+ /** Provides NBT Tag Compound to reference */
+ private final ItemStack invItem;
+
+ /** Defining your inventory size this way is handy */
+ public final int INV_SIZE;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory;
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public CustomBoxInventory(ItemStack stack, String name2) {
+ this(stack, name2, 8);
+ }
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public CustomBoxInventory(ItemStack stack, String name2, int slots) {
+ invItem = stack;
+ name = name2;
+ INV_SIZE = slots;
+ inventory = new ItemStack[INV_SIZE];
+
+ /** initialize variable within the constructor: */
+ uniqueID = "";
+
+ if (!stack.hasTagCompound()) {
+ stack.setTagCompound(new NBTTagCompound());
+ // no tag compound means the itemstack does not yet have a UUID, so assign one:
+ uniqueID = UUID.randomUUID().toString();
+ }
+
+ /** When reading from NBT: */
+ if ("".equals(uniqueID)) {
+ // try to read unique ID from NBT
+ uniqueID = stack.getTagCompound().getString("uniqueID");
+ // if it's still "", assign a new one:
+ if ("".equals(uniqueID)) {
+ uniqueID = UUID.randomUUID().toString();
+ }
+ }
+
+ /** Writing to NBT: */
+ // just add this line:
+ stack.getTagCompound().setString("uniqueID", this.uniqueID);
+
+ // note that it's okay to use stack instead of invItem right there
+ // both reference the same memory location, so whatever you change using
+ // either reference will change in the other
+
+ // Read the inventory contents from NBT
+ readFromNBT(stack.getTagCompound());
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return inventory.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int slot) {
+ return inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(int slot, int amount) {
+ ItemStack stack = getStackInSlot(slot);
+ if (stack != null) {
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
+ } else {
+ // this method also calls onInventoryChanged, so we don't need to call it again
+ setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot) {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(int slot, ItemStack stack) {
+ inventory[slot] = stack;
+
+ if (stack != null && stack.stackSize > getInventoryStackLimit()) {
+ stack.stackSize = getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName() {
+ return name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName() {
+ return name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty() {
+ for (int i = 0; i < getSizeInventory(); ++i) {
+ if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
+ inventory[i] = null;
+ }
+ }
+
+ // This line here does the work:
+ writeToNBT(invItem.getTagCompound());
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer entityplayer) {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public abstract boolean isItemValidForSlot(int slot, ItemStack itemstack);
+
+ /**
+ * A custom method to read our inventory from an ItemStack's NBT compound
+ */
+ public void readFromNBT(NBTTagCompound compound) {
+ // Gets the custom taglist we wrote to this compound, if any
+ // 1.7.2+ change to compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
+ NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
+
+ for (int i = 0; i < items.tagCount(); ++i) {
+ // 1.7.2+ change to items.getCompoundTagAt(i)
+ NBTTagCompound item = (NBTTagCompound) items.getCompoundTagAt(i);
+ int slot = item.getInteger("Slot");
+
+ // Just double-checking that the saved slot index is within our inventory array bounds
+ if (slot >= 0 && slot < getSizeInventory()) {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(item);
+ }
+ }
+ }
+
+ /**
+ * A custom method to write our inventory to an ItemStack's NBT compound
+ */
+ public void writeToNBT(NBTTagCompound tagcompound) {
+ // Create a new NBT Tag List to store itemstacks as NBT Tags
+ NBTTagList items = new NBTTagList();
+
+ for (int i = 0; i < getSizeInventory(); ++i) {
+ // Only write stacks that contain items
+ if (getStackInSlot(i) != null) {
+ // Make a new NBT Tag Compound to write the itemstack and slot index to
+ NBTTagCompound item = new NBTTagCompound();
+ item.setInteger("Slot", i);
+ // Writes the itemstack in slot(i) to the Tag Compound we just made
+ getStackInSlot(i).writeToNBT(item);
+
+ // add the tag compound to our tag list
+ items.appendTag(item);
+ }
+ }
+ // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory"
+ tagcompound.setTag("ItemInventory", items);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java
index 65b884bd51..9c5258f515 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java
@@ -2,10 +2,14 @@ package gtPlusPlus.core.item.tool.misc.box;
public class MagicToolBag extends BaseBoxItem {
- public final static int SLOTS = 24;
+ public static final int SLOTS = 24;
- public MagicToolBag(String displayName) {
- super(displayName, new String[] {"Can store magic tools from TC, BM, etc", "Please ask for additional mod support on Github"}, gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
- }
-
+ public MagicToolBag(String displayName) {
+ super(
+ displayName,
+ new String[] {
+ "Can store magic tools from TC, BM, etc", "Please ask for additional mod support on Github"
+ },
+ gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java
index 92b1382e01..6ddc51ec49 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java
@@ -4,10 +4,15 @@ import gtPlusPlus.core.handler.GuiHandler;
public class UniversalToolBox extends BaseBoxItem {
- public final static int SLOTS = 16;
-
- public UniversalToolBox(String displayName) {
- super(displayName, new String[] {"Can store tools from Gregtech, IC2, BC, Forestry", "Please ask for additional mod support on Github"}, GuiHandler.GUI10);
- }
-
+ public static final int SLOTS = 16;
+
+ public UniversalToolBox(String displayName) {
+ super(
+ displayName,
+ new String[] {
+ "Can store tools from Gregtech, IC2, BC, Forestry",
+ "Please ask for additional mod support on Github"
+ },
+ GuiHandler.GUI10);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
index 2c2441064b..ad5fa11160 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
@@ -1,11 +1,17 @@
package gtPlusPlus.core.item.tool.staballoy;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.Pair;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
@@ -15,297 +21,296 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.RecipeUtils;
+public class MultiPickaxeBase extends StaballoyPickaxe {
+
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(final ItemStack stack) {
+ if (super.getDurabilityForDisplay(stack) > 0) {
+ return super.getDurabilityForDisplay(stack);
+ }
+ return 0;
+ }
+
+ protected boolean canBreak = true;
+ protected final int colour;
+ protected final String materialName;
+ protected final String displayName;
+ public boolean isValid = true;
+ private final Pair<?, ?> enchantment;
+
+ public MultiPickaxeBase(
+ final String unlocalizedName,
+ final ToolMaterial material,
+ final long materialDurability,
+ final int colour,
+ final Object enchant) {
+ super(Utils.sanitizeString(unlocalizedName), material);
+ this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName));
+ // this.setTextureName(CORE.MODID + ":" + "itemPickaxe");
+ this.setTextureName("minecraft" + ":" + "iron_pickaxe");
+ this.setMaxStackSize(1);
+ if ((materialDurability * 3) <= Integer.MAX_VALUE) {
+ this.setMaxDamage((int) (materialDurability * 3));
+ } else {
+ this.setMaxDamage(Integer.MAX_VALUE);
+ this.canBreak = false;
+ }
+ this.colour = colour;
+ this.materialName = material.name();
+ this.displayName = unlocalizedName;
+ this.setCreativeTab(AddToCreativeTab.tabTools);
+ this.miningLevel = material.getHarvestLevel();
+
+ if (enchant != null) {
+ if (enchant instanceof Pair) {
+ this.enchantment = (Pair<?, ?>) enchant;
+ } else {
+ this.enchantment = null;
+ }
+ } else {
+ this.enchantment = null;
+ }
+
+ try {
+ this.isValid = this.addRecipe();
+ } catch (final Throwable e) {
+ }
+ if ((colour != 0) && this.isValid && (materialDurability > 10000)) {
+ if (GameRegistry.findItem(CORE.MODID, Utils.sanitizeString(unlocalizedName)) == null) {
+ GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
+ }
+ }
+ }
+
+ /*
+ *
+ *
+ *
+ * Methods
+ *
+ *
+ *
+ */
+
+ private boolean addRecipe() {
+
+ final String cleanName = Utils.sanitizeString(this.materialName);
+
+ final String plateDense = "plateDense" + cleanName;
+ final String plateDouble = "plateDouble" + cleanName;
+ final String rodLong = "stickLong" + cleanName;
+ final String toolHammer = "craftingToolHardHammer";
+ final String toolWrench = "craftingToolWrench";
+ final String toolFile = "craftingToolFile";
+ final String toolScrewDriver = "craftingToolScrewdriver";
+
+ if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)) {
+ Logger.WARNING("stickLong of " + cleanName + " does not exist.");
+ return false;
+ }
+ if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)) {
+ Logger.WARNING("plateDense of " + cleanName + " does not exist.");
+ if (null != ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDouble, 1)) {
+ Logger.WARNING("plateDouble of " + cleanName + " does exist. Using it instead.");
+ RecipeUtils.recipeBuilder(
+ plateDouble,
+ plateDouble,
+ plateDouble,
+ toolFile,
+ rodLong,
+ toolHammer,
+ toolWrench,
+ rodLong,
+ toolScrewDriver,
+ ItemUtils.getSimpleStack(this));
+
+ return true;
+ }
+ Logger.WARNING("plateDouble of " + cleanName + " does not exist.");
+ return false;
+ }
+
+ RecipeUtils.recipeBuilder(
+ plateDense,
+ plateDense,
+ plateDense,
+ toolFile,
+ rodLong,
+ toolHammer,
+ toolWrench,
+ rodLong,
+ toolScrewDriver,
+ ItemUtils.getSimpleStack(this));
+
+ return true;
+ }
+
+ public final String getMaterialName() {
+ return this.materialName;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack iStack) {
+ return this.displayName;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ if (this.colour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.colour;
+ }
+
+ private float calculateDurabilityLoss(final World world, final int X, final int Y, final int Z) {
+ float bDurabilityLoss = 0;
+ Boolean correctTool = false;
+ float bHardness = 0;
+ if (!world.isRemote) {
+ try {
+ final Block removalist = world.getBlock(X, Y, Z);
+ // Utils.LOG_WARNING(removalist.toString());
+
+ bHardness = removalist.getBlockHardness(world, X, Y, Z) * 100;
+ Logger.INFO("Hardness: " + bHardness);
+
+ bDurabilityLoss = 100;
+ // Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
+
+ correctTool = this.canPickaxeBlock(removalist, world, new int[] {X, Y, Z});
+ Logger.WARNING("" + correctTool);
+
+ if (!correctTool) {
+ return 0;
+ }
+
+ } catch (final NullPointerException e) {
+
+ }
+ }
+ return bDurabilityLoss;
+ }
+
+ // Should clear up blocks quicker if I chain it.
+ /*@Override
+ public void removeBlockAndDropAsItem(World world, int X, int Y, int Z, ItemStack heldItem){
+ localWorld = world;
+ try {
+ Block block = world.getBlock(X, Y, Z);
+ float dur = calculateDurabilityLoss(world, X, Y, Z);
+ Utils.LOG_WARNING(block.toString());
+ String removalTool = "";
+ removalTool = block.getHarvestTool(1);
+
+ if (removalTool.equals("pickaxe") || UtilsMining.getBlockType(block, world, new int[]{X,Y,Z}, miningLevel)){
+ if (canPickaxeBlock(block, world, new int[]{X,Y,Z})){
+ if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
+
+ if (heldItem.getItemDamage() <= (heldItem.getMaxDamage()-dur)){
+
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+
+ }
+ else {
+ return;
+ }
+
+ }
+ }
+ else {
+ Utils.LOG_WARNING("Incorrect Tool for mining this block.");
+ }
+ }
+ } catch (NullPointerException e){
+
+ }
+ }*/
+
+ @Override
+ public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) {
+ if (this.canBreak) {
+ item.damageItem(damage, localPlayer);
+ }
+ }
+
+ @Override
+ public void setItemDamage(final ItemStack item, final int damage) {
+ if (this.canBreak) {
+ item.setItemDamage(damage - 1);
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return false;
+ }
-public class MultiPickaxeBase extends StaballoyPickaxe{
-
- /* (non-Javadoc)
- * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
- */
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- if (super.getDurabilityForDisplay(stack) > 0){
- return super.getDurabilityForDisplay(stack);}
- return 0;
- }
-
- protected boolean canBreak = true;
- protected final int colour;
- protected final String materialName;
- protected final String displayName;
- public boolean isValid = true;
- private final Pair<?, ?> enchantment;
-
- public MultiPickaxeBase(final String unlocalizedName, final ToolMaterial material, final long materialDurability, final int colour, final Object enchant) {
- super(Utils.sanitizeString(unlocalizedName), material);
- this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName));
- //this.setTextureName(CORE.MODID + ":" + "itemPickaxe");
- this.setTextureName("minecraft"+":"+"iron_pickaxe");
- this.setMaxStackSize(1);
- if ((materialDurability*3) <= Integer.MAX_VALUE){
- this.setMaxDamage((int) (materialDurability*3));
- }
- else {
- this.setMaxDamage(Integer.MAX_VALUE);
- this.canBreak = false;
- }
- this.colour = colour;
- this.materialName = material.name();
- this.displayName = unlocalizedName;
- this.setCreativeTab(AddToCreativeTab.tabTools);
- this.miningLevel = material.getHarvestLevel();
-
-
-
- if (enchant != null){
- if (enchant instanceof Pair){
- this.enchantment = (Pair<?, ?>) enchant;
- }
- else {
- this.enchantment = null;
- }
- }
- else {
- this.enchantment = null;
- }
-
- try {this.isValid = this.addRecipe();} catch (final Throwable e){}
- if ((colour != 0) && this.isValid && (materialDurability > 10000)){
- if (GameRegistry.findItem(CORE.MODID, Utils.sanitizeString(unlocalizedName)) == null){
- GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
- }
- }
-
- }
-
- /*
- *
- *
- *
- * Methods
- *
- *
- *
- */
-
- private boolean addRecipe(){
-
- final String cleanName = Utils.sanitizeString(this.materialName);
-
- final String plateDense = "plateDense"+cleanName;
- final String plateDouble = "plateDouble"+cleanName;
- final String rodLong = "stickLong"+cleanName;
- final String toolHammer = "craftingToolHardHammer";
- final String toolWrench = "craftingToolWrench";
- final String toolFile = "craftingToolFile";
- final String toolScrewDriver = "craftingToolScrewdriver";
-
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)){
- Logger.WARNING("stickLong of "+cleanName+" does not exist.");
- return false;
- }
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)){
- Logger.WARNING("plateDense of "+cleanName+" does not exist.");
- if (null != ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDouble, 1)){
- Logger.WARNING("plateDouble of "+cleanName+" does exist. Using it instead.");
- RecipeUtils.recipeBuilder(
- plateDouble, plateDouble, plateDouble,
- toolFile, rodLong, toolHammer,
- toolWrench, rodLong, toolScrewDriver,
- ItemUtils.getSimpleStack(this));
-
- return true;
- }
- Logger.WARNING("plateDouble of "+cleanName+" does not exist.");
- return false;
- }
-
- RecipeUtils.recipeBuilder(
- plateDense, plateDense, plateDense,
- toolFile, rodLong, toolHammer,
- toolWrench, rodLong, toolScrewDriver,
- ItemUtils.getSimpleStack(this));
-
- return true;
- }
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack iStack) {
- return this.displayName;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0){
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
-
- }
-
- private float calculateDurabilityLoss(final World world, final int X, final int Y, final int Z){
- float bDurabilityLoss = 0;
- Boolean correctTool = false;
- float bHardness = 0;
- if (!world.isRemote){
- try {
- final Block removalist = world.getBlock(X, Y, Z);
- //Utils.LOG_WARNING(removalist.toString());
-
- bHardness = removalist.getBlockHardness(world, X, Y, Z)*100;
- Logger.INFO("Hardness: "+bHardness);
-
- bDurabilityLoss = 100;
- //Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
-
- correctTool = this.canPickaxeBlock(removalist, world, new int[]{X,Y,Z});
- Logger.WARNING(""+correctTool);
-
- if (!correctTool){
- return 0;
- }
-
- } catch (final NullPointerException e){
-
- }
- }
- return bDurabilityLoss;
- }
-
- //Should clear up blocks quicker if I chain it.
- /*@Override
- public void removeBlockAndDropAsItem(World world, int X, int Y, int Z, ItemStack heldItem){
- localWorld = world;
- try {
- Block block = world.getBlock(X, Y, Z);
- float dur = calculateDurabilityLoss(world, X, Y, Z);
- Utils.LOG_WARNING(block.toString());
- String removalTool = "";
- removalTool = block.getHarvestTool(1);
-
- if (removalTool.equals("pickaxe") || UtilsMining.getBlockType(block, world, new int[]{X,Y,Z}, miningLevel)){
- if (canPickaxeBlock(block, world, new int[]{X,Y,Z})){
- if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
-
- if (heldItem.getItemDamage() <= (heldItem.getMaxDamage()-dur)){
-
- block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
- world.setBlockToAir(X, Y, Z);
-
- }
- else {
- return;
- }
-
- }
- }
- else {
- Utils.LOG_WARNING("Incorrect Tool for mining this block.");
- }
- }
- } catch (NullPointerException e){
-
- }
- }*/
-
- @Override
- public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer){
- if (this.canBreak){
- item.damageItem(damage, localPlayer);
- }
- }
-
- @Override
- public void setItemDamage(final ItemStack item, final int damage){
- if (this.canBreak){
- item.setItemDamage(damage-1);
- }
- }
-
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.uncommon;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return false;
- }
-
- @Override
- public void onCreated(final ItemStack mThisItem, final World mWorld, final EntityPlayer mPlayer) {
- Enchantment enchant = null;
- int enchantmentLevel = 0;
- final Pair<?, ?> Y = this.enchantment;
- if (Y != null){
- if (Y.getKey() != null){
- enchant = (Enchantment) this.enchantment.getKey();
- }
- if (Y.getValue() != null){
- enchantmentLevel = ((Integer) this.enchantment.getValue()).intValue();
- }
- }
- final ItemStack itemToEnchant = mThisItem;
- if ((enchant != null) && (enchantmentLevel != 0) && (enchantmentLevel >= 1)){
- itemToEnchant.addEnchantment(enchant, enchantmentLevel);
- }
- super.onCreated(itemToEnchant, mWorld, mPlayer);
- }
-
- @Override
- public void getSubItems(final Item mItem, final CreativeTabs mCreativeTab, final List mList) {
- Enchantment enchant = null;
- int enchantmentLevel = 0;
- final Pair<?, ?> Y = this.enchantment;
- if (Y != null){
- if (Y.getKey() != null){
- enchant = (Enchantment) this.enchantment.getKey();
- }
- if (Y.getValue() != null){
- enchantmentLevel = ((Integer) this.enchantment.getValue()).intValue();
- }
- }
-
- final Item thisItem = mItem;
- final ItemStack itemToEnchant = ItemUtils.getSimpleStack(thisItem);
- if ((enchant != null) && (enchantmentLevel != 0) && (enchantmentLevel >= 1)){
- itemToEnchant.addEnchantment(enchant, enchantmentLevel);
- mList.add(itemToEnchant);
- }
- else {
- mList.add(new ItemStack(thisItem, 1, 0));
- }
-
- }
-
-
- /**
- *
- * Time to Override Minecraft stupid mechanics, allowing unbreakable stuff.
- *
- */
+ @Override
+ public void onCreated(final ItemStack mThisItem, final World mWorld, final EntityPlayer mPlayer) {
+ Enchantment enchant = null;
+ int enchantmentLevel = 0;
+ final Pair<?, ?> Y = this.enchantment;
+ if (Y != null) {
+ if (Y.getKey() != null) {
+ enchant = (Enchantment) this.enchantment.getKey();
+ }
+ if (Y.getValue() != null) {
+ enchantmentLevel = ((Integer) this.enchantment.getValue()).intValue();
+ }
+ }
+ final ItemStack itemToEnchant = mThisItem;
+ if ((enchant != null) && (enchantmentLevel != 0) && (enchantmentLevel >= 1)) {
+ itemToEnchant.addEnchantment(enchant, enchantmentLevel);
+ }
+ super.onCreated(itemToEnchant, mWorld, mPlayer);
+ }
+
+ @Override
+ public void getSubItems(final Item mItem, final CreativeTabs mCreativeTab, final List mList) {
+ Enchantment enchant = null;
+ int enchantmentLevel = 0;
+ final Pair<?, ?> Y = this.enchantment;
+ if (Y != null) {
+ if (Y.getKey() != null) {
+ enchant = (Enchantment) this.enchantment.getKey();
+ }
+ if (Y.getValue() != null) {
+ enchantmentLevel = ((Integer) this.enchantment.getValue()).intValue();
+ }
+ }
+
+ final Item thisItem = mItem;
+ final ItemStack itemToEnchant = ItemUtils.getSimpleStack(thisItem);
+ if ((enchant != null) && (enchantmentLevel != 0) && (enchantmentLevel >= 1)) {
+ itemToEnchant.addEnchantment(enchant, enchantmentLevel);
+ mList.add(itemToEnchant);
+ } else {
+ mList.add(new ItemStack(thisItem, 1, 0));
+ }
+ }
+ /**
+ *
+ * Time to Override Minecraft stupid mechanics, allowing unbreakable stuff.
+ *
+ */
@Override
- public boolean isDamageable(){
- if (this.getMaxDamage() > 0 && !this.hasSubtypes){
- if (this.canBreak){
- return true;
- }
+ public boolean isDamageable() {
+ if (this.getMaxDamage() > 0 && !this.hasSubtypes) {
+ if (this.canBreak) {
+ return true;
+ }
}
return false;
}
-
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
index d01b400fab..53d3152d84 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
@@ -3,124 +3,135 @@ package gtPlusPlus.core.item.tool.staballoy;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.item.EnumRarity;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemStack;
-public class MultiSpadeBase extends StaballoySpade{
-
- /* (non-Javadoc)
- * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
- */
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- if (super.getDurabilityForDisplay(stack) > 0){
- return super.getDurabilityForDisplay(stack);}
- return 0;
- }
-
- protected final int colour;
- protected final String materialName;
- protected final String displayName;
- public boolean isValid = true;
-
- public MultiSpadeBase(final String unlocalizedName, final ToolMaterial material, final int materialDurability, final int colour) {
- super(Utils.sanitizeString(unlocalizedName), material);
- this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName));
- //this.setTextureName(CORE.MODID + ":" + "itemShovel");
- this.setTextureName("minecraft"+":"+"iron_shovel");
- this.setMaxStackSize(1);
- this.setMaxDamage(materialDurability*3);
- this.colour = colour;
- this.materialName = material.name();
- this.displayName = unlocalizedName;
- this.setCreativeTab(AddToCreativeTab.tabTools);
- try {
- this.isValid = this.addRecipe();
- }
- catch (final Throwable e){}
- if ((colour != 0) && this.isValid){
- if (GameRegistry.findItem(CORE.MODID, Utils.sanitizeString(unlocalizedName)) == null) {
- GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
- }
- }
- }
-
- private boolean addRecipe(){
- final String cleanName = Utils.sanitizeString(this.materialName);
- final String plateDense = "plateDense"+cleanName;
- final String plateDouble = "plateDouble"+cleanName;
- final String rodLong = "stickLong"+cleanName;
- final String toolHammer = "craftingToolHardHammer";
- final String toolWrench = "craftingToolWrench";
- final String toolFile = "craftingToolFile";
- final String toolScrewDriver = "craftingToolScrewdriver";
-
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)){
- return false;
- }
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)){
- if (null != ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDouble, 1)){
- RecipeUtils.recipeBuilder(
- toolFile, plateDouble, toolHammer,
- null, rodLong, null,
- toolWrench, rodLong, toolScrewDriver,
- ItemUtils.getSimpleStack(this));
-
- return true;
- }
- return false;
- }
-
- RecipeUtils.recipeBuilder(
- toolFile, plateDense, toolHammer,
- null, rodLong, null,
- toolWrench, rodLong, toolScrewDriver,
- ItemUtils.getSimpleStack(this));
-
- return true;
- }
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack iStack) {
- return this.displayName;
- /*String name;
- if (getUnlocalizedName().toLowerCase().contains("wood")){
- name = "Wooden";
- }
- else {
- }
- return "Big "+name+" Spade";*/
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0){
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.uncommon;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return false;
- }
-
+public class MultiSpadeBase extends StaballoySpade {
+
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(final ItemStack stack) {
+ if (super.getDurabilityForDisplay(stack) > 0) {
+ return super.getDurabilityForDisplay(stack);
+ }
+ return 0;
+ }
+
+ protected final int colour;
+ protected final String materialName;
+ protected final String displayName;
+ public boolean isValid = true;
+
+ public MultiSpadeBase(
+ final String unlocalizedName, final ToolMaterial material, final int materialDurability, final int colour) {
+ super(Utils.sanitizeString(unlocalizedName), material);
+ this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName));
+ // this.setTextureName(CORE.MODID + ":" + "itemShovel");
+ this.setTextureName("minecraft" + ":" + "iron_shovel");
+ this.setMaxStackSize(1);
+ this.setMaxDamage(materialDurability * 3);
+ this.colour = colour;
+ this.materialName = material.name();
+ this.displayName = unlocalizedName;
+ this.setCreativeTab(AddToCreativeTab.tabTools);
+ try {
+ this.isValid = this.addRecipe();
+ } catch (final Throwable e) {
+ }
+ if ((colour != 0) && this.isValid) {
+ if (GameRegistry.findItem(CORE.MODID, Utils.sanitizeString(unlocalizedName)) == null) {
+ GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
+ }
+ }
+ }
+
+ private boolean addRecipe() {
+ final String cleanName = Utils.sanitizeString(this.materialName);
+ final String plateDense = "plateDense" + cleanName;
+ final String plateDouble = "plateDouble" + cleanName;
+ final String rodLong = "stickLong" + cleanName;
+ final String toolHammer = "craftingToolHardHammer";
+ final String toolWrench = "craftingToolWrench";
+ final String toolFile = "craftingToolFile";
+ final String toolScrewDriver = "craftingToolScrewdriver";
+
+ if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)) {
+ return false;
+ }
+ if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)) {
+ if (null != ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDouble, 1)) {
+ RecipeUtils.recipeBuilder(
+ toolFile,
+ plateDouble,
+ toolHammer,
+ null,
+ rodLong,
+ null,
+ toolWrench,
+ rodLong,
+ toolScrewDriver,
+ ItemUtils.getSimpleStack(this));
+
+ return true;
+ }
+ return false;
+ }
+
+ RecipeUtils.recipeBuilder(
+ toolFile,
+ plateDense,
+ toolHammer,
+ null,
+ rodLong,
+ null,
+ toolWrench,
+ rodLong,
+ toolScrewDriver,
+ ItemUtils.getSimpleStack(this));
+
+ return true;
+ }
+
+ public final String getMaterialName() {
+ return this.materialName;
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack iStack) {
+ return this.displayName;
+ /*String name;
+ if (getUnlocalizedName().toLowerCase().contains("wood")){
+ name = "Wooden";
+ }
+ else {
+ }
+ return "Big "+name+" Spade";*/
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ if (this.colour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.colour;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
index 153a417d7b..ec1c08dad8 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
@@ -1,10 +1,9 @@
package gtPlusPlus.core.item.tool.staballoy;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.block.*;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLivingBase;
@@ -16,330 +15,359 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.core.lib.CORE;
-
-public class StaballoyAxe extends ItemAxe{
- public String mat;
-
- public StaballoyAxe(final String unlocalizedName, final ToolMaterial material) {
- super(material);
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- }
+public class StaballoyAxe extends ItemAxe {
+ public String mat;
- // EXPLODE TREE
- byte[] tre= new byte[32000];
- byte unchecked=0;
- byte needcheck=1;
- byte ignore =2;
- byte harvest =3;
+ public StaballoyAxe(final String unlocalizedName, final ToolMaterial material) {
+ super(material);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ }
- private boolean setcheck(final int x, final int y, final int z) {
- if((x<0) || (x>19) || (z<0) || (z>19) || (y<0) || (y>79)) {
- return false;
- }
- final int o=x+(z*20)+(y*400);
- if (this.tre[o]==this.unchecked) {
- this.tre[o]=this.needcheck;
- }
- return true;
- }
+ // EXPLODE TREE
+ byte[] tre = new byte[32000];
+ byte unchecked = 0;
+ byte needcheck = 1;
+ byte ignore = 2;
+ byte harvest = 3;
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GOLD+"Fells entire trees in a single swipe!..");
- list.add(EnumChatFormatting.GRAY+"Ask Alkalus for new trees to be supported.");
- super.addInformation(stack, aPlayer, list, bool);
- }
+ private boolean setcheck(final int x, final int y, final int z) {
+ if ((x < 0) || (x > 19) || (z < 0) || (z > 19) || (y < 0) || (y > 79)) {
+ return false;
+ }
+ final int o = x + (z * 20) + (y * 400);
+ if (this.tre[o] == this.unchecked) {
+ this.tre[o] = this.needcheck;
+ }
+ return true;
+ }
- public static boolean canIgnore(final Block bit){
- if (bit instanceof BlockAir) {
- return true;
- }
- if (bit instanceof BlockGrass) {
- return true;
- }
- if (bit instanceof BlockSand) {
- return true;
- }
- if (bit instanceof BlockDirt) {
- return true;
- }
- if (bit instanceof BlockCocoa) {
- return true;
- }
- if (bit instanceof BlockVine) {
- return true;
- }
- if (bit instanceof BlockMushroom) {
- return true;
- }
- if (bit instanceof BlockSnow) {
- return true;
- }
- if (bit instanceof BlockSnowBlock) {
- return true;
- }
- if (bit instanceof BlockFlower) {
- return true;
- }
- if (bit instanceof BlockTallGrass) {
- return true;
- }
- if (bit instanceof BlockDoublePlant) {
- return true;
- }
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GOLD + "Fells entire trees in a single swipe!..");
+ list.add(EnumChatFormatting.GRAY + "Ask Alkalus for new trees to be supported.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
- //LoonTools.log("Found uncuttable "+bit.getClass().getSimpleName());
- return false;
- }
+ public static boolean canIgnore(final Block bit) {
+ if (bit instanceof BlockAir) {
+ return true;
+ }
+ if (bit instanceof BlockGrass) {
+ return true;
+ }
+ if (bit instanceof BlockSand) {
+ return true;
+ }
+ if (bit instanceof BlockDirt) {
+ return true;
+ }
+ if (bit instanceof BlockCocoa) {
+ return true;
+ }
+ if (bit instanceof BlockVine) {
+ return true;
+ }
+ if (bit instanceof BlockMushroom) {
+ return true;
+ }
+ if (bit instanceof BlockSnow) {
+ return true;
+ }
+ if (bit instanceof BlockSnowBlock) {
+ return true;
+ }
+ if (bit instanceof BlockFlower) {
+ return true;
+ }
+ if (bit instanceof BlockTallGrass) {
+ return true;
+ }
+ if (bit instanceof BlockDoublePlant) {
+ return true;
+ }
- private int check(final World par1World, final int x, final int y, final int z, final int xo, final int yo,final int zo) {
- int f=0;
- final int o=x+(z*20)+(y*400);
- if (this.tre[o]==this.needcheck){
- this.tre[o]=this.ignore;
- final Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
- if ((bit instanceof BlockLog)||(bit instanceof BlockLeavesBase)||(bit instanceof BlockHugeMushroom) || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
- f=1;
- this.tre[o]=this.harvest;
- //if (bit instanceof BlockLog){
- // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
- //}
- for(int xb=-1;xb<2;xb++) {
- for(int yb=-1;yb<2;yb++) {
- for(int zb=-1;zb<2;zb++) {
- if (!this.setcheck(x+xb,y+yb,z+zb)) {
- return 3;
- }
- }
- }
- }
- }else{
- if (!canIgnore(bit)) {
- return 2;
- }
- }
- }
- return f;
- }
+ // LoonTools.log("Found uncuttable "+bit.getClass().getSimpleName());
+ return false;
+ }
- public int checkTree(final World par1World,final int xo,final int yo,final int zo){
- boolean f;
- for (f=true;f==true;){
- f=false;
- for (int y=0;y<80;y++) {
- for(int z=0;z<20;z++) {
- for(int x=0;x<20;x++){
- final int r=this.check(par1World,x,y,z,xo,yo,zo);
- if (r==3) {
- return 3;
- }
- if (r==2) {
- return 2;
- }
- if (r==1) {
- f=true;
- }
- }
- }
- }
+ private int check(
+ final World par1World, final int x, final int y, final int z, final int xo, final int yo, final int zo) {
+ int f = 0;
+ final int o = x + (z * 20) + (y * 400);
+ if (this.tre[o] == this.needcheck) {
+ this.tre[o] = this.ignore;
+ final Block bit = par1World.getBlock(x + xo, y + yo, z + zo);
+ if ((bit instanceof BlockLog)
+ || (bit instanceof BlockLeavesBase)
+ || (bit instanceof BlockHugeMushroom)
+ || (bit.getUnlocalizedName().toLowerCase().contains("log"))
+ || (bit.getUnlocalizedName().toLowerCase().contains("wood"))) {
+ f = 1;
+ this.tre[o] = this.harvest;
+ // if (bit instanceof BlockLog){
+ // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
+ // }
+ for (int xb = -1; xb < 2; xb++) {
+ for (int yb = -1; yb < 2; yb++) {
+ for (int zb = -1; zb < 2; zb++) {
+ if (!this.setcheck(x + xb, y + yb, z + zb)) {
+ return 3;
+ }
+ }
+ }
+ }
+ } else {
+ if (!canIgnore(bit)) {
+ return 2;
+ }
+ }
+ }
+ return f;
+ }
- for (int y=79;y>=0;y--) {
- for(int z=19;z>=0;z--) {
- for(int x=19;x>=0;x--){
- final int r=this.check(par1World,x,y,z,xo,yo,zo);
- if (r==2) {
- return 3;
- }
- //if (r==2) return 2;
- if (r==1) {
- f=true;
- }
- }
- }
- }
- }
- return 1;
- }
+ public int checkTree(final World par1World, final int xo, final int yo, final int zo) {
+ boolean f;
+ for (f = true; f == true; ) {
+ f = false;
+ for (int y = 0; y < 80; y++) {
+ for (int z = 0; z < 20; z++) {
+ for (int x = 0; x < 20; x++) {
+ final int r = this.check(par1World, x, y, z, xo, yo, zo);
+ if (r == 3) {
+ return 3;
+ }
+ if (r == 2) {
+ return 2;
+ }
+ if (r == 1) {
+ f = true;
+ }
+ }
+ }
+ }
- private int check2(final World par1World, final int x, final int y, final int z, final int xo, final int yo,final int zo) {
- int f=0;
- final int o=x+(z*20)+(y*400);
- if (this.tre[o]==this.needcheck){
- this.tre[o]=this.ignore;
- final Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
- if (bit instanceof BlockLog){
- f=1;
- this.tre[o]=this.harvest;
- //if (bit instanceof BlockLog){
- // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
- //}
- for(int xb=-1;xb<2;xb++) {
- for(int yb=-1;yb<2;yb++) {
- for(int zb=-1;zb<2;zb++) {
- if (!this.setcheck(x+xb,y+yb,z+zb)) {
- return 3;
- }
- }
- }
- }
- }else if (bit instanceof BlockLeavesBase){
- }else{
- if (!canIgnore(bit)) {
- return 2;
- }
- }
- }
- return f;
- }
+ for (int y = 79; y >= 0; y--) {
+ for (int z = 19; z >= 0; z--) {
+ for (int x = 19; x >= 0; x--) {
+ final int r = this.check(par1World, x, y, z, xo, yo, zo);
+ if (r == 2) {
+ return 3;
+ }
+ // if (r==2) return 2;
+ if (r == 1) {
+ f = true;
+ }
+ }
+ }
+ }
+ }
+ return 1;
+ }
- public int checkTree2(final World par1World,final int xo,final int yo,final int zo){
- boolean f;
- for (f=true;f==true;){
- f=false;
- for (int y=0;y<80;y++) {
- for(int z=0;z<20;z++) {
- for(int x=0;x<20;x++){
- final int r=this.check2(par1World,x,y,z,xo,yo,zo);
- if (r==3) {
- return 3;
- }
- if (r==2) {
- return 2;
- }
- if (r==1) {
- f=true;
- }
- }
- }
- }
+ private int check2(
+ final World par1World, final int x, final int y, final int z, final int xo, final int yo, final int zo) {
+ int f = 0;
+ final int o = x + (z * 20) + (y * 400);
+ if (this.tre[o] == this.needcheck) {
+ this.tre[o] = this.ignore;
+ final Block bit = par1World.getBlock(x + xo, y + yo, z + zo);
+ if (bit instanceof BlockLog) {
+ f = 1;
+ this.tre[o] = this.harvest;
+ // if (bit instanceof BlockLog){
+ // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
+ // }
+ for (int xb = -1; xb < 2; xb++) {
+ for (int yb = -1; yb < 2; yb++) {
+ for (int zb = -1; zb < 2; zb++) {
+ if (!this.setcheck(x + xb, y + yb, z + zb)) {
+ return 3;
+ }
+ }
+ }
+ }
+ } else if (bit instanceof BlockLeavesBase) {
+ } else {
+ if (!canIgnore(bit)) {
+ return 2;
+ }
+ }
+ }
+ return f;
+ }
- for (int y=79;y>=0;y--) {
- for(int z=19;z>=0;z--) {
- for(int x=19;x>=0;x--){
- final int r=this.check2(par1World,x,y,z,xo,yo,zo);
- if (r==2) {
- return 3;
- }
- //if (r==2) return 2;
- if (r==1) {
- f=true;
- }
- }
- }
- }
- }
- return 1;
- }
+ public int checkTree2(final World par1World, final int xo, final int yo, final int zo) {
+ boolean f;
+ for (f = true; f == true; ) {
+ f = false;
+ for (int y = 0; y < 80; y++) {
+ for (int z = 0; z < 20; z++) {
+ for (int x = 0; x < 20; x++) {
+ final int r = this.check2(par1World, x, y, z, xo, yo, zo);
+ if (r == 3) {
+ return 3;
+ }
+ if (r == 2) {
+ return 2;
+ }
+ if (r == 1) {
+ f = true;
+ }
+ }
+ }
+ }
- public void exploadTree(final World par1World,final int xo,final int yo,final int zo, final EntityPlayer plr){
- for (int y=0;y<80;y++) {
- for(int z=0;z<20;z++) {
- for(int x=0;x<20;x++){
- final int o=x+(z*20)+(y*400);
- if (this.tre[o]==this.harvest){
- final Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
- final int met = par1World.getBlockMetadata(x+xo, y+yo, z+zo);
+ for (int y = 79; y >= 0; y--) {
+ for (int z = 19; z >= 0; z--) {
+ for (int x = 19; x >= 0; x--) {
+ final int r = this.check2(par1World, x, y, z, xo, yo, zo);
+ if (r == 2) {
+ return 3;
+ }
+ // if (r==2) return 2;
+ if (r == 1) {
+ f = true;
+ }
+ }
+ }
+ }
+ }
+ return 1;
+ }
- if ((bit instanceof BlockLog)||(bit instanceof BlockLeavesBase) || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
- bit.harvestBlock(par1World, plr, x+xo, y+yo, z+zo,met);
- par1World.setBlockToAir(x+xo, y+yo, z+zo);
- }
- }
- }
- }
- }
- }
+ public void exploadTree(final World par1World, final int xo, final int yo, final int zo, final EntityPlayer plr) {
+ for (int y = 0; y < 80; y++) {
+ for (int z = 0; z < 20; z++) {
+ for (int x = 0; x < 20; x++) {
+ final int o = x + (z * 20) + (y * 400);
+ if (this.tre[o] == this.harvest) {
+ final Block bit = par1World.getBlock(x + xo, y + yo, z + zo);
+ final int met = par1World.getBlockMetadata(x + xo, y + yo, z + zo);
- private static void breakMushroom(final World wld, final Block bit, final EntityPlayer plr, final boolean silk, final int x, final int y, final int z, final int met) {
- if (silk){
- final ItemStack stk = null; //TODO
- /*if (bit==Blocks.brown_mushroom_block) stk = new ItemStack(LoonToolItems.brown_mushroom_block,1,met);
- else if (bit==Blocks.red_mushroom_block) stk = new ItemStack(LoonToolItems.red_mushroom_block,1,met);
- else stk = new ItemStack(bit,1,met);*/
- final EntityItem entityitem = new EntityItem(wld, x+0.5, y+0.5, z+0.5, stk);
- entityitem.delayBeforeCanPickup = 10;
- wld.spawnEntityInWorld(entityitem);
- }else{
- bit.harvestBlock(wld, plr, x, y, z, met);
- }
- wld.setBlockToAir(x, y, z);
- }
+ if ((bit instanceof BlockLog)
+ || (bit instanceof BlockLeavesBase)
+ || (bit.getUnlocalizedName().toLowerCase().contains("log"))
+ || (bit.getUnlocalizedName().toLowerCase().contains("wood"))) {
+ bit.harvestBlock(par1World, plr, x + xo, y + yo, z + zo, met);
+ par1World.setBlockToAir(x + xo, y + yo, z + zo);
+ }
+ }
+ }
+ }
+ }
+ }
- public void exploadMushroom(final World par1World,final int xo,final int yo,final int zo, final EntityPlayer plr, final boolean silk){
- for (int y=0;y<80;y++) {
- for(int z=0;z<20;z++) {
- for(int x=0;x<20;x++){
- final int o=x+(z*20)+(y*400);
- if (this.tre[o]==this.harvest){
- final Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
- final int met = par1World.getBlockMetadata(x+xo, y+yo, z+zo);
- if (bit instanceof BlockHugeMushroom){
- breakMushroom(par1World, bit, plr, silk, x+xo, y+yo, z+zo,met);
- }else{
- bit.harvestBlock(par1World, plr, x+xo, y+yo, z+zo,met);
- par1World.setBlockToAir(x+xo, y+yo, z+zo);
- }
- }
- }
- }
- }
- }
+ private static void breakMushroom(
+ final World wld,
+ final Block bit,
+ final EntityPlayer plr,
+ final boolean silk,
+ final int x,
+ final int y,
+ final int z,
+ final int met) {
+ if (silk) {
+ final ItemStack stk = null; // TODO
+ /*if (bit==Blocks.brown_mushroom_block) stk = new ItemStack(LoonToolItems.brown_mushroom_block,1,met);
+ else if (bit==Blocks.red_mushroom_block) stk = new ItemStack(LoonToolItems.red_mushroom_block,1,met);
+ else stk = new ItemStack(bit,1,met);*/
+ final EntityItem entityitem = new EntityItem(wld, x + 0.5, y + 0.5, z + 0.5, stk);
+ entityitem.delayBeforeCanPickup = 10;
+ wld.spawnEntityInWorld(entityitem);
+ } else {
+ bit.harvestBlock(wld, plr, x, y, z, met);
+ }
+ wld.setBlockToAir(x, y, z);
+ }
+ public void exploadMushroom(
+ final World par1World,
+ final int xo,
+ final int yo,
+ final int zo,
+ final EntityPlayer plr,
+ final boolean silk) {
+ for (int y = 0; y < 80; y++) {
+ for (int z = 0; z < 20; z++) {
+ for (int x = 0; x < 20; x++) {
+ final int o = x + (z * 20) + (y * 400);
+ if (this.tre[o] == this.harvest) {
+ final Block bit = par1World.getBlock(x + xo, y + yo, z + zo);
+ final int met = par1World.getBlockMetadata(x + xo, y + yo, z + zo);
+ if (bit instanceof BlockHugeMushroom) {
+ breakMushroom(par1World, bit, plr, silk, x + xo, y + yo, z + zo, met);
+ } else {
+ bit.harvestBlock(par1World, plr, x + xo, y + yo, z + zo, met);
+ par1World.setBlockToAir(x + xo, y + yo, z + zo);
+ }
+ }
+ }
+ }
+ }
+ }
- @Override
- public boolean onBlockDestroyed(final ItemStack itm, final World wld,final Block blk, final int x, final int y,final int z, final EntityLivingBase plr) {
- if (!wld.isRemote){
- final Block bit = wld.getBlock(x, y, z);
- final boolean silk=EnchantmentHelper.getSilkTouchModifier(plr);
- if ((bit instanceof BlockHugeMushroom)){
- for (int n=0;n<32000;n++) {
- this.tre[n]=this.unchecked;
- }
- final int met = wld.getBlockMetadata(x, y, z);
- breakMushroom(wld, bit, (EntityPlayer) plr, silk, x, y, z,met);
- wld.setBlockToAir(x,y,z);
- this.tre[2210]=this.needcheck;
- if (this.checkTree(wld,x-10,y-4,z-10)==1){
- this.exploadMushroom(wld,x-10,y-4,z-10,(EntityPlayer) plr,silk);
- }
- }
+ @Override
+ public boolean onBlockDestroyed(
+ final ItemStack itm,
+ final World wld,
+ final Block blk,
+ final int x,
+ final int y,
+ final int z,
+ final EntityLivingBase plr) {
+ if (!wld.isRemote) {
+ final Block bit = wld.getBlock(x, y, z);
+ final boolean silk = EnchantmentHelper.getSilkTouchModifier(plr);
+ if ((bit instanceof BlockHugeMushroom)) {
+ for (int n = 0; n < 32000; n++) {
+ this.tre[n] = this.unchecked;
+ }
+ final int met = wld.getBlockMetadata(x, y, z);
+ breakMushroom(wld, bit, (EntityPlayer) plr, silk, x, y, z, met);
+ wld.setBlockToAir(x, y, z);
+ this.tre[2210] = this.needcheck;
+ if (this.checkTree(wld, x - 10, y - 4, z - 10) == 1) {
+ this.exploadMushroom(wld, x - 10, y - 4, z - 10, (EntityPlayer) plr, silk);
+ }
+ }
- if ((bit instanceof BlockLog) || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
- //LoonTools.log("cutting tree @ "+x+" "+y+" "+z+" ");
- for (int n=0;n<32000;n++) {
- this.tre[n]=this.unchecked;
- }
- final int met = wld.getBlockMetadata(x, y, z);
- bit.harvestBlock(wld, (EntityPlayer) plr, x, y, z,met);
- wld.setBlockToAir(x,y,z);
- this.tre[2210]=this.needcheck;
- if (this.checkTree(wld,x-10,y-4,z-10)==1){
- this.exploadTree(wld,x-10,y-4,z-10,(EntityPlayer) plr);
- }else{
- for (int n=0;n<32000;n++) {
- this.tre[n]=this.unchecked;
- }
- this.tre[2210]=this.needcheck;
- if (this.checkTree2(wld,x-10,y-4,z-10)==1){
- this.exploadTree(wld,x-10,y-4,z-10,(EntityPlayer) plr);
- }
- }
- }
- }
- return super.onBlockDestroyed(itm, wld, blk, x, y, z, plr);
- }
+ if ((bit instanceof BlockLog)
+ || (bit.getUnlocalizedName().toLowerCase().contains("log"))
+ || (bit.getUnlocalizedName().toLowerCase().contains("wood"))) {
+ // LoonTools.log("cutting tree @ "+x+" "+y+" "+z+" ");
+ for (int n = 0; n < 32000; n++) {
+ this.tre[n] = this.unchecked;
+ }
+ final int met = wld.getBlockMetadata(x, y, z);
+ bit.harvestBlock(wld, (EntityPlayer) plr, x, y, z, met);
+ wld.setBlockToAir(x, y, z);
+ this.tre[2210] = this.needcheck;
+ if (this.checkTree(wld, x - 10, y - 4, z - 10) == 1) {
+ this.exploadTree(wld, x - 10, y - 4, z - 10, (EntityPlayer) plr);
+ } else {
+ for (int n = 0; n < 32000; n++) {
+ this.tre[n] = this.unchecked;
+ }
+ this.tre[2210] = this.needcheck;
+ if (this.checkTree2(wld, x - 10, y - 4, z - 10) == 1) {
+ this.exploadTree(wld, x - 10, y - 4, z - 10, (EntityPlayer) plr);
+ }
+ }
+ }
+ }
+ return super.onBlockDestroyed(itm, wld, blk, x, y, z, plr);
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.rare;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.rare;
+ }
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return true;
- }
-} \ No newline at end of file
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
index 830c4994ba..873d9a843c 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
@@ -1,10 +1,11 @@
package gtPlusPlus.core.item.tool.staballoy;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.MiningUtils;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -18,445 +19,440 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.MiningUtils;
-
-public class StaballoyPickaxe extends ItemPickaxe{
-
- /* (non-Javadoc)
- * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
- */
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- return (double)stack.getItemDamageForDisplay() / (double)stack.getMaxDamage();
- }
-
- /**
- * Creates an NBT tag for this item if it doesn't have one.
- * This also set some default values.
- * @param rStack
- * @return
- */
-
- private static boolean createNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
-
- tagNBT.setBoolean("FACING_HORIZONTAL", true);
- tagNBT.setString("FACING", "north");
- tagNBT.setString("lookingDirection", "");
-
- tagMain.setTag("PickStats", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- /*
- * Is the player facing horizontally?
- */
-
- public static final boolean isFacingHorizontal(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- return aNBT.getBoolean("FACING_HORIZONTAL");
- }
- }
- else {
- createNBT(aStack);
- }
- return true;
- }
-
- public static final boolean setFacingHorizontal(final ItemStack aStack, final boolean aFacingHorizontal) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- aNBT.setBoolean("FACING_HORIZONTAL", aFacingHorizontal);
- return true;
- }
- }
- return false;
- }
-
- /*
- * Handles the Direction the player is facing
- */
-
- public static final String getFacingDirection(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- return aNBT.getString("FACING");
- }
- }
- else {
- createNBT(aStack);
- }
- return "north";
- }
-
- public static final boolean setFacingDirection(final ItemStack aStack, final String aFacingHorizontal) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- aNBT.setString("FACING", aFacingHorizontal);
- return true;
- }
- }
- return false;
- }
-
- /*
- * The Looking Direction handlers
- */
-
- public static final String getLookingDirection(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- return aNBT.getString("lookingDirection");
- }
- }
- else {
- createNBT(aStack);
- }
- return "";
- }
-
- public static final boolean setLookingDirection(final ItemStack aStack, final String aFacingHorizontal) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- aNBT.setString("lookingDirection", aFacingHorizontal);
- return true;
- }
- }
- return false;
- }
-
- protected int miningLevel;
-
- /*
- *
- *
- *
- * Methods
- *
- *
- *
- */
-
- @Override
- public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) {
- return super.onItemRightClick(stack, world, aPlayer);
- }
-
-
-
- @Override
- public boolean onBlockDestroyed(final ItemStack stack, final World world, final Block block, final int X, final int Y, final int Z, final EntityLivingBase entity) {
- if (!world.isRemote){
- if (entity instanceof EntityPlayer) {
- this.GetDestroyOrientation((EntityPlayer) entity, block, getLookingDirection(stack), world, X, Y, Z, stack);
- }
- }
- return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
- }
-
- private float calculateDurabilityLoss(final World world, final int X, final int Y, final int Z){
- float bDurabilityLoss = 0;
- Boolean correctTool = false;
- float bHardness = 0;
- if (!world.isRemote){
- try {
- final Block removalist = world.getBlock(X, Y, Z);
- //Utils.LOG_WARNING(removalist.toString());
-
- bHardness = removalist.getBlockHardness(world, X, Y, Z);
- Logger.WARNING("Hardness: "+bHardness);
-
- bDurabilityLoss = (bDurabilityLoss + bHardness);
- //Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
-
- correctTool = this.canPickaxeBlock(removalist, world, new int[]{X,Y,Z});
- Logger.WARNING(""+correctTool);
-
- if (!correctTool){
- return 0;
- }
-
- } catch (final NullPointerException e){
-
- }
- }
- return 100;
- }
-
- public Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld, final int[] xyz){
- String correctTool = "";
- if (!currentWorld.isRemote){
- try {
- correctTool = currentBlock.getHarvestTool(0);
- if (MiningUtils.getBlockType(currentBlock, currentWorld, xyz, this.miningLevel) || correctTool.equals("pickaxe") || correctTool.equals("null")){
- //Utils.LOG_WARNING(correctTool);
- return true;}
- } catch (final NullPointerException e){
- return false;}
- }
- return false;
- }
-
- private void GetDestroyOrientation(EntityPlayer entity, final Block block, final String FACING, final World world, final int X, final int Y, final int Z, final ItemStack heldItem){
- float DURABILITY_LOSS = 0;
- if (!world.isRemote){
-
- Logger.WARNING("hardness:"+block.getBlockHardness(world, X, Y, Z));
- if (FACING.equals("below") || FACING.equals("above")){
- DURABILITY_LOSS = 0;
- for(int i = -1; i < 2; i++) {
- for(int j = -1; j < 2; j++) {
- final float dur = this.calculateDurabilityLoss(world, X + i, Y, Z + j);
- DURABILITY_LOSS = (DURABILITY_LOSS + dur);
- Logger.WARNING("Added Loss: "+dur);
- this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem);
- }
- }
- }
-
- else if (FACING.equals("facingEast") || FACING.equals("facingWest")){
- DURABILITY_LOSS = 0;
- for(int i = -1; i < 2; i++) {
- for(int j = -1; j < 2; j++) {
- final float dur = this.calculateDurabilityLoss(world, X, Y + i, Z + j);
- DURABILITY_LOSS = (DURABILITY_LOSS + dur);
- Logger.WARNING("Added Loss: "+dur);
- this.removeBlockAndDropAsItem(world, X , Y + i, Z + j, heldItem);
- }
- }
- }
-
- else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")){
- DURABILITY_LOSS = 0;
- for(int i = -1; i < 2; i++) {
- for(int j = -1; j < 2; j++) {
- final float dur = this.calculateDurabilityLoss(world, X + j, Y + i, Z);
- DURABILITY_LOSS = (DURABILITY_LOSS + dur);
- Logger.WARNING("Added Loss: "+dur);
- this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem);
- }
- }
- }
-
- //int heldItemDurability = heldItem.getDamage(1);
- Logger.WARNING("Total Loss: "+(int)DURABILITY_LOSS);
- //heldItem.setDamage(heldStack, DURABILITY_LOSS);
- //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
- //Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
- Logger.WARNING("1x: "+(heldItem.getItemDamage()));
- final int itemdmg = heldItem.getItemDamage();
- final int maxdmg = heldItem.getMaxDamage();
- final int dodmg = (int)DURABILITY_LOSS;
- final int durNow = maxdmg-itemdmg;
- final int durLeft = (int) ((maxdmg-itemdmg)-DURABILITY_LOSS);
-
- Logger.WARNING(
- "Current Damage: " + itemdmg
- + " Max Damage: " + maxdmg
- + " Durability to be lost: " + dodmg
- + " Current Durability: " + durNow
- + " Remaining Durability: " + durLeft
- );
-
-
- //Break Tool
- if (((durNow-dodmg) <= (99)) && (itemdmg != 0)){
- //TODO break tool
- Logger.WARNING("Breaking Tool");
- heldItem.stackSize = 0;
- }
- //Do Damage
- else {
- //setItemDamage(heldItem, durLeft);
- Logger.WARNING(""+(durNow-durLeft));
- this.damageItem(heldItem, (durNow-durLeft)-1, entity);
- }
-
-
- /*if (heldItem.getItemDamage() <= ((heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS)){
- Utils.LOG_WARNING("2: "+DURABILITY_LOSS+" 3: "+((heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS));
- setItemDamage(heldItem, (int) (heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS));
- }
- else {
- Utils.LOG_WARNING("3: "+( heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage())));
- setItemDamage(heldItem, heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage()));
- }*/
- //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
- DURABILITY_LOSS = 0;
-
- }
- }
-
- public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer){
- item.damageItem(damage, localPlayer);
- }
-
- public void setItemDamage(final ItemStack item, final int damage){
- item.setItemDamage(damage-1);
- }
-
- //Should clear up blocks quicker if I chain it.
- public final void removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z, final ItemStack heldItem){
- try {
- final Block block = world.getBlock(X, Y, Z);
- final float dur = this.calculateDurabilityLoss(world, X, Y, Z);
- Logger.WARNING(block.toString());
- String removalTool = "";
- removalTool = block.getHarvestTool(1);
-
- Logger.WARNING("Removing.1 "+removalTool);
- /*if ((removalTool.equalsIgnoreCase("pickaxe") || removalTool.equalsIgnoreCase("null") || removalTool == null)){
- Utils.LOG_WARNING("Removing.2");
- if (UtilsMining.getBlockType(block, world, new int[]{X,Y,Z}, miningLevel)) {
- Utils.LOG_WARNING("Removing.3"); */
- if (this.canPickaxeBlock(block, world, new int[]{X,Y,Z})){
- Logger.WARNING("Removing.4");
-
- if (block == Blocks.air){
- return;
- }
-
- if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) >= 0) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
-
- Logger.WARNING("Removing.5");
- if (heldItem.getItemDamage() <= (heldItem.getMaxDamage()-dur)){
-
- if (X == 0 && Y == 0 && Z == 0){
-
- }
- else {
- block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
- world.setBlockToAir(X, Y, Z);
- }
-
- }
-
- }
- /*}
-
- }*/
- }
- else {
- Logger.WARNING("Incorrect Tool for mining this block.");
- }
- } catch (final NullPointerException e){
-
- }
- }
-
- public boolean checkFacing(final ItemStack aStack, final EntityPlayer aPlayer, final World world){
- if (aPlayer != null){
- final int direction = MathHelper.floor_double((aPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3;
- //Utils.LOG_WARNING("Player - F: "+direction);
- //Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord);
-
- /*if (localPlayer.getLookVec().yCoord > 0){
- localPlayer.getLookVec().yCoord;
- }*/
-
- final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, aPlayer, false);
- if (movingobjectposition != null){
- final int sideHit = movingobjectposition.sideHit;
- String playerStandingPosition = "";
- if (movingobjectposition != null) {
- //System.out.println("Side Hit: "+movingobjectposition.sideHit);
- }
-
- if (sideHit == 0){
- playerStandingPosition = "above";
- setFacingHorizontal(aStack, false);
- }
- else if (sideHit == 1){
- playerStandingPosition = "below";
- setFacingHorizontal(aStack, false);
- }
- else if (sideHit == 2){
- playerStandingPosition = "facingSouth";
- setFacingHorizontal(aStack, true);
- }
- else if (sideHit == 3){
- playerStandingPosition = "facingNorth";
- setFacingHorizontal(aStack, true);
- }
- else if (sideHit == 4){
- playerStandingPosition = "facingEast";
- setFacingHorizontal(aStack, true);
- }
- else if (sideHit == 5){
- playerStandingPosition = "facingWest";
- setFacingHorizontal(aStack, true);
- }
- setLookingDirection(aStack, playerStandingPosition);
-
- if (direction == 0){
- setFacingDirection(aStack, "south");
- }
- else if (direction == 1){
- setFacingDirection(aStack, "west");
- }
- else if (direction == 2){
- setFacingDirection(aStack, "north");
- }
- else if (direction == 3){
- setFacingDirection(aStack, "east");
- }
- }
-
-
- return true;
- }
- return false;
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GRAY+"Mines a 3x3 at 100 durability per block mined.");
- list.add(EnumChatFormatting.GRAY+"Durability: "+(stack.getMaxDamage()-stack.getItemDamage())+"/"+stack.getMaxDamage());
- //super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.rare;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return true;
- }
-
-
- @Override
- public boolean onBlockStartBreak(final ItemStack itemstack, final int X, final int Y, final int Z, final EntityPlayer aPlayer) {
- this.checkFacing(itemstack, aPlayer, aPlayer.getEntityWorld());
- return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
- }
-
- public StaballoyPickaxe(final String unlocalizedName, final ToolMaterial material) {
- super(material);
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setMaxDamage(3200);
- this.miningLevel = 5;
- }
+public class StaballoyPickaxe extends ItemPickaxe {
+
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(final ItemStack stack) {
+ return (double) stack.getItemDamageForDisplay() / (double) stack.getMaxDamage();
+ }
+
+ /**
+ * Creates an NBT tag for this item if it doesn't have one.
+ * This also set some default values.
+ * @param rStack
+ * @return
+ */
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+
+ tagNBT.setBoolean("FACING_HORIZONTAL", true);
+ tagNBT.setString("FACING", "north");
+ tagNBT.setString("lookingDirection", "");
+
+ tagMain.setTag("PickStats", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ /*
+ * Is the player facing horizontally?
+ */
+
+ public static final boolean isFacingHorizontal(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ return aNBT.getBoolean("FACING_HORIZONTAL");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return true;
+ }
+
+ public static final boolean setFacingHorizontal(final ItemStack aStack, final boolean aFacingHorizontal) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ aNBT.setBoolean("FACING_HORIZONTAL", aFacingHorizontal);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /*
+ * Handles the Direction the player is facing
+ */
+
+ public static final String getFacingDirection(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ return aNBT.getString("FACING");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return "north";
+ }
+
+ public static final boolean setFacingDirection(final ItemStack aStack, final String aFacingHorizontal) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ aNBT.setString("FACING", aFacingHorizontal);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /*
+ * The Looking Direction handlers
+ */
+
+ public static final String getLookingDirection(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ return aNBT.getString("lookingDirection");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return "";
+ }
+
+ public static final boolean setLookingDirection(final ItemStack aStack, final String aFacingHorizontal) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ aNBT.setString("lookingDirection", aFacingHorizontal);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected int miningLevel;
+
+ /*
+ *
+ *
+ *
+ * Methods
+ *
+ *
+ *
+ */
+
+ @Override
+ public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) {
+ return super.onItemRightClick(stack, world, aPlayer);
+ }
+
+ @Override
+ public boolean onBlockDestroyed(
+ final ItemStack stack,
+ final World world,
+ final Block block,
+ final int X,
+ final int Y,
+ final int Z,
+ final EntityLivingBase entity) {
+ if (!world.isRemote) {
+ if (entity instanceof EntityPlayer) {
+ this.GetDestroyOrientation(
+ (EntityPlayer) entity, block, getLookingDirection(stack), world, X, Y, Z, stack);
+ }
+ }
+ return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
+ }
+
+ private float calculateDurabilityLoss(final World world, final int X, final int Y, final int Z) {
+ float bDurabilityLoss = 0;
+ Boolean correctTool = false;
+ float bHardness = 0;
+ if (!world.isRemote) {
+ try {
+ final Block removalist = world.getBlock(X, Y, Z);
+ // Utils.LOG_WARNING(removalist.toString());
+
+ bHardness = removalist.getBlockHardness(world, X, Y, Z);
+ Logger.WARNING("Hardness: " + bHardness);
+
+ bDurabilityLoss = (bDurabilityLoss + bHardness);
+ // Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
+
+ correctTool = this.canPickaxeBlock(removalist, world, new int[] {X, Y, Z});
+ Logger.WARNING("" + correctTool);
+
+ if (!correctTool) {
+ return 0;
+ }
+
+ } catch (final NullPointerException e) {
+
+ }
+ }
+ return 100;
+ }
+
+ public Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld, final int[] xyz) {
+ String correctTool = "";
+ if (!currentWorld.isRemote) {
+ try {
+ correctTool = currentBlock.getHarvestTool(0);
+ if (MiningUtils.getBlockType(currentBlock, currentWorld, xyz, this.miningLevel)
+ || correctTool.equals("pickaxe")
+ || correctTool.equals("null")) {
+ // Utils.LOG_WARNING(correctTool);
+ return true;
+ }
+ } catch (final NullPointerException e) {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ private void GetDestroyOrientation(
+ EntityPlayer entity,
+ final Block block,
+ final String FACING,
+ final World world,
+ final int X,
+ final int Y,
+ final int Z,
+ final ItemStack heldItem) {
+ float DURABILITY_LOSS = 0;
+ if (!world.isRemote) {
+
+ Logger.WARNING("hardness:" + block.getBlockHardness(world, X, Y, Z));
+ if (FACING.equals("below") || FACING.equals("above")) {
+ DURABILITY_LOSS = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ final float dur = this.calculateDurabilityLoss(world, X + i, Y, Z + j);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Logger.WARNING("Added Loss: " + dur);
+ this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem);
+ }
+ }
+ } else if (FACING.equals("facingEast") || FACING.equals("facingWest")) {
+ DURABILITY_LOSS = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ final float dur = this.calculateDurabilityLoss(world, X, Y + i, Z + j);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Logger.WARNING("Added Loss: " + dur);
+ this.removeBlockAndDropAsItem(world, X, Y + i, Z + j, heldItem);
+ }
+ }
+ } else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")) {
+ DURABILITY_LOSS = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ final float dur = this.calculateDurabilityLoss(world, X + j, Y + i, Z);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Logger.WARNING("Added Loss: " + dur);
+ this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem);
+ }
+ }
+ }
+
+ // int heldItemDurability = heldItem.getDamage(1);
+ Logger.WARNING("Total Loss: " + (int) DURABILITY_LOSS);
+ // heldItem.setDamage(heldStack, DURABILITY_LOSS);
+ // Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
+ // Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
+ Logger.WARNING("1x: " + (heldItem.getItemDamage()));
+ final int itemdmg = heldItem.getItemDamage();
+ final int maxdmg = heldItem.getMaxDamage();
+ final int dodmg = (int) DURABILITY_LOSS;
+ final int durNow = maxdmg - itemdmg;
+ final int durLeft = (int) ((maxdmg - itemdmg) - DURABILITY_LOSS);
+
+ Logger.WARNING("Current Damage: " + itemdmg
+ + " Max Damage: " + maxdmg
+ + " Durability to be lost: " + dodmg
+ + " Current Durability: " + durNow
+ + " Remaining Durability: " + durLeft);
+
+ // Break Tool
+ if (((durNow - dodmg) <= (99)) && (itemdmg != 0)) {
+ // TODO break tool
+ Logger.WARNING("Breaking Tool");
+ heldItem.stackSize = 0;
+ }
+ // Do Damage
+ else {
+ // setItemDamage(heldItem, durLeft);
+ Logger.WARNING("" + (durNow - durLeft));
+ this.damageItem(heldItem, (durNow - durLeft) - 1, entity);
+ }
+
+ /*if (heldItem.getItemDamage() <= ((heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS)){
+ Utils.LOG_WARNING("2: "+DURABILITY_LOSS+" 3: "+((heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS));
+ setItemDamage(heldItem, (int) (heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS));
+ }
+ else {
+ Utils.LOG_WARNING("3: "+( heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage())));
+ setItemDamage(heldItem, heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage()));
+ }*/
+ // Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
+ DURABILITY_LOSS = 0;
+ }
+ }
+
+ public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) {
+ item.damageItem(damage, localPlayer);
+ }
+
+ public void setItemDamage(final ItemStack item, final int damage) {
+ item.setItemDamage(damage - 1);
+ }
+
+ // Should clear up blocks quicker if I chain it.
+ public final void removeBlockAndDropAsItem(
+ final World world, final int X, final int Y, final int Z, final ItemStack heldItem) {
+ try {
+ final Block block = world.getBlock(X, Y, Z);
+ final float dur = this.calculateDurabilityLoss(world, X, Y, Z);
+ Logger.WARNING(block.toString());
+ String removalTool = "";
+ removalTool = block.getHarvestTool(1);
+
+ Logger.WARNING("Removing.1 " + removalTool);
+ /*if ((removalTool.equalsIgnoreCase("pickaxe") || removalTool.equalsIgnoreCase("null") || removalTool == null)){
+ Utils.LOG_WARNING("Removing.2");
+ if (UtilsMining.getBlockType(block, world, new int[]{X,Y,Z}, miningLevel)) {
+ Utils.LOG_WARNING("Removing.3"); */
+ if (this.canPickaxeBlock(block, world, new int[] {X, Y, Z})) {
+ Logger.WARNING("Removing.4");
+
+ if (block == Blocks.air) {
+ return;
+ }
+
+ if ((block != Blocks.bedrock)
+ && (block.getBlockHardness(world, X, Y, Z) >= 0)
+ && (block.getBlockHardness(world, X, Y, Z) <= 100)
+ && (block != Blocks.water)
+ && (block != Blocks.lava)) {
+
+ Logger.WARNING("Removing.5");
+ if (heldItem.getItemDamage() <= (heldItem.getMaxDamage() - dur)) {
+
+ if (X == 0 && Y == 0 && Z == 0) {
+
+ } else {
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+ }
+ }
+ }
+ /*}
+
+ }*/
+ } else {
+ Logger.WARNING("Incorrect Tool for mining this block.");
+ }
+ } catch (final NullPointerException e) {
+
+ }
+ }
+
+ public boolean checkFacing(final ItemStack aStack, final EntityPlayer aPlayer, final World world) {
+ if (aPlayer != null) {
+ final int direction = MathHelper.floor_double((aPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3;
+ // Utils.LOG_WARNING("Player - F: "+direction);
+ // Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord);
+
+ /*if (localPlayer.getLookVec().yCoord > 0){
+ localPlayer.getLookVec().yCoord;
+ }*/
+
+ final MovingObjectPosition movingobjectposition =
+ this.getMovingObjectPositionFromPlayer(world, aPlayer, false);
+ if (movingobjectposition != null) {
+ final int sideHit = movingobjectposition.sideHit;
+ String playerStandingPosition = "";
+ if (movingobjectposition != null) {
+ // System.out.println("Side Hit: "+movingobjectposition.sideHit);
+ }
+
+ if (sideHit == 0) {
+ playerStandingPosition = "above";
+ setFacingHorizontal(aStack, false);
+ } else if (sideHit == 1) {
+ playerStandingPosition = "below";
+ setFacingHorizontal(aStack, false);
+ } else if (sideHit == 2) {
+ playerStandingPosition = "facingSouth";
+ setFacingHorizontal(aStack, true);
+ } else if (sideHit == 3) {
+ playerStandingPosition = "facingNorth";
+ setFacingHorizontal(aStack, true);
+ } else if (sideHit == 4) {
+ playerStandingPosition = "facingEast";
+ setFacingHorizontal(aStack, true);
+ } else if (sideHit == 5) {
+ playerStandingPosition = "facingWest";
+ setFacingHorizontal(aStack, true);
+ }
+ setLookingDirection(aStack, playerStandingPosition);
+
+ if (direction == 0) {
+ setFacingDirection(aStack, "south");
+ } else if (direction == 1) {
+ setFacingDirection(aStack, "west");
+ } else if (direction == 2) {
+ setFacingDirection(aStack, "north");
+ } else if (direction == 3) {
+ setFacingDirection(aStack, "east");
+ }
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GRAY + "Mines a 3x3 at 100 durability per block mined.");
+ list.add(EnumChatFormatting.GRAY + "Durability: " + (stack.getMaxDamage() - stack.getItemDamage()) + "/"
+ + stack.getMaxDamage());
+ // super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.rare;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return true;
+ }
+
+ @Override
+ public boolean onBlockStartBreak(
+ final ItemStack itemstack, final int X, final int Y, final int Z, final EntityPlayer aPlayer) {
+ this.checkFacing(itemstack, aPlayer, aPlayer.getEntityWorld());
+ return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
+ }
+
+ public StaballoyPickaxe(final String unlocalizedName, final ToolMaterial material) {
+ super(material);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(3200);
+ this.miningLevel = 5;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java
index 6265c9f0a3..6cad8cf5fc 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java
@@ -1,10 +1,11 @@
package gtPlusPlus.core.item.tool.staballoy;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.MiningUtils;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -18,394 +19,396 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.MiningUtils;
-
-public class StaballoySpade extends ItemSpade{
-
- /* (non-Javadoc)
- * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
- */
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- if (super.getDurabilityForDisplay(stack) > 0){
- return super.getDurabilityForDisplay(stack);}
- return 0;
- }
-
-
- /**
- * Creates an NBT tag for this item if it doesn't have one.
- * This also set some default values.
- * @param rStack
- * @return
- */
-
- private static boolean createNBT(ItemStack rStack){
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
-
- tagNBT.setBoolean("FACING_HORIZONTAL", true);
- tagNBT.setString("FACING", "north");
- tagNBT.setString("lookingDirection", "");
-
- tagMain.setTag("PickStats", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- /*
- * Is the player facing horizontally?
- */
-
- public static final boolean isFacingHorizontal(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- return aNBT.getBoolean("FACING_HORIZONTAL");
- }
- }
- else {
- createNBT(aStack);
- }
- return true;
- }
-
- public static final boolean setFacingHorizontal(final ItemStack aStack, final boolean aFacingHorizontal) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- aNBT.setBoolean("FACING_HORIZONTAL", aFacingHorizontal);
- return true;
- }
- }
- return false;
- }
-
- /*
- * Handles the Direction the player is facing
- */
-
- public static final String getFacingDirection(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- return aNBT.getString("FACING");
- }
- }
- else {
- createNBT(aStack);
- }
- return "north";
- }
-
- public static final boolean setFacingDirection(final ItemStack aStack, final String aFacingHorizontal) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- aNBT.setString("FACING", aFacingHorizontal);
- return true;
- }
- }
- return false;
- }
-
- /*
- * The Looking Direction handlers
- */
-
- public static final String getLookingDirection(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- return aNBT.getString("lookingDirection");
- }
- }
- else {
- createNBT(aStack);
- }
- return "";
- }
-
- public static final boolean setLookingDirection(final ItemStack aStack, final String aFacingHorizontal) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- aNBT.setString("lookingDirection", aFacingHorizontal);
- return true;
- }
- }
- return false;
- }
-
- private int miningLevel;
-
- /*
- *
- *
- *
- * Methods
- *
- *
- *
- */
-
- @Override
- public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) {
- return super.onItemRightClick(stack, world, aPlayer);
- }
-
-
-
- @Override
- public boolean onBlockDestroyed(final ItemStack stack, final World world, final Block block, final int X, final int Y, final int Z, final EntityLivingBase entity) {
- if (!world.isRemote){
- if (entity instanceof EntityPlayer) {
- this.GetDestroyOrientation((EntityPlayer) entity, getLookingDirection(stack), world, X, Y, Z, stack);
- }
- }
- return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
- }
-
- public Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld, final int[] xyz){
- String correctTool = "";
- if (!currentWorld.isRemote){
- try {
- correctTool = currentBlock.getHarvestTool(0);
- //Utils.LOG_WARNING(correctTool);
-
- Logger.WARNING("Tool for Block: "+correctTool+" | Current block: "+currentBlock.getLocalizedName());
- if (MiningUtils.getBlockType(currentBlock, currentWorld, xyz, this.miningLevel) || correctTool.equals("shovel")){
- return true;}
- } catch (final NullPointerException e){
- return false;}
- }
- return false;
- }
-
- private void GetDestroyOrientation(EntityPlayer player, final String FACING, final World world, final int X, final int Y, final int Z, final ItemStack heldItem){
- float DURABILITY_LOSS = 0;
- if (!world.isRemote){
-
- if (FACING.equals("below") || FACING.equals("above")){
- DURABILITY_LOSS = 0;
- for(int i = -1; i < 2; i++) {
- for(int j = -1; j < 2; j++) {
- DURABILITY_LOSS = (DURABILITY_LOSS + this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem));
- }
- }
- }
-
- else if (FACING.equals("facingEast") || FACING.equals("facingWest")){
- DURABILITY_LOSS = 0;
- for(int i = -1; i < 2; i++) {
- for(int j = -1; j < 2; j++) {
- DURABILITY_LOSS = (DURABILITY_LOSS + this.removeBlockAndDropAsItem(world, X , Y + i, Z + j, heldItem));
- }
- }
- }
-
- else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")){
- DURABILITY_LOSS = 0;
- for(int i = -1; i < 2; i++) {
- for(int j = -1; j < 2; j++) {
- DURABILITY_LOSS = (DURABILITY_LOSS + this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem));
- }
- }
- }
-
- //int heldItemDurability = heldItem.getDamage(1);
- Logger.WARNING("Total Loss: "+(int)DURABILITY_LOSS);
- //heldItem.setDamage(heldStack, DURABILITY_LOSS);
- //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
- //Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
- Logger.WARNING("1x: "+(heldItem.getItemDamage()));
- final int itemdmg = heldItem.getItemDamage();
- final int maxdmg = heldItem.getMaxDamage();
- final int dodmg = (int)DURABILITY_LOSS;
- final int durNow = maxdmg-itemdmg;
- final int durLeft = (int) ((maxdmg-itemdmg)-DURABILITY_LOSS);
-
- Logger.WARNING(
- "Current Damage: " + itemdmg
- + " Max Damage: " + maxdmg
- + " Durability to be lost: " + dodmg
- + " Current Durability: " + durNow
- + " Remaining Durability: " + durLeft
- );
-
-
- //Break Tool
- if (((durNow-dodmg) <= (900)) && (itemdmg != 0)){
- //TODO break tool
- Logger.WARNING("Breaking Tool");
- heldItem.stackSize = 0;
- }
- //Do Damage
- else {
- //setItemDamage(heldItem, durLeft);
- Logger.WARNING(""+(durNow-durLeft));
- this.damageItem(heldItem, (durNow-durLeft)-1, player);
- }
- DURABILITY_LOSS = 0;
-
- }
- }
-
- public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer){
- item.damageItem(damage, localPlayer);
- }
-
- public void setItemDamage(final ItemStack item, final int damage){
- item.setItemDamage(damage-1);
- }
-
- //Should clear up blocks quicker if I chain it.
- public int removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z, final ItemStack heldItem){
- Logger.WARNING("Trying to drop/remove a block.");
- try {
- final Block block = world.getBlock(X, Y, Z);
- Logger.WARNING(block.toString());
- String removalTool = "";
- removalTool = block.getHarvestTool(0);
- if (removalTool != null){
- if (removalTool.equals("shovel")){
- if (this.canPickaxeBlock(block, world, new int[]{X,Y,Z})){
- if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
-
- final int itemdmg = heldItem.getItemDamage();
- final int maxdmg = heldItem.getMaxDamage();
- final int dodmg = 100;
- final int durNow = maxdmg-itemdmg;
- final int durLeft = (maxdmg-itemdmg)-100;
-
- if (((durNow-dodmg) <= (900)) && (itemdmg != 0)){
- //Do Nothing, Tool is useless.
- return 0;
- }
- block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
- world.setBlockToAir(X, Y, Z);
- Logger.WARNING("Adding 100 damage to item.");
- return 100;
- }
- Logger.WARNING("Incorrect Tool for mining this block. Wrong Block Water/lava/bedrock/blacklist");
- return 0;
- }
- Logger.WARNING("Incorrect Tool for mining this block. Cannot Shovel this block type.");
- return 0;
- }
- Logger.WARNING("Incorrect Tool for mining this block. Blocks mining tool is now Shovel.");
- return 0;
- }
- Logger.WARNING("Either the block was air or it declares an invalid mining tool.");
- return 0;
- } catch (final NullPointerException e){
- Logger.WARNING("Something Broke");
- e.printStackTrace();
- return 0;
- }
- }
-
- public boolean checkFacing(final ItemStack aStack, final EntityPlayer aPlayer, final World world){
- if (aPlayer != null){
- final int direction = MathHelper.floor_double((aPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3;
- //Utils.LOG_WARNING("Player - F: "+direction);
- //Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord);
-
- /*if (localPlayer.getLookVec().yCoord > 0){
- localPlayer.getLookVec().yCoord;
- }*/
-
- final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, aPlayer, false);
- if (movingobjectposition != null){
- final int sideHit = movingobjectposition.sideHit;
- String playerStandingPosition = "";
- if (movingobjectposition != null) {
- //System.out.println("Side Hit: "+movingobjectposition.sideHit);
- }
-
- if (sideHit == 0){
- playerStandingPosition = "above";
- setFacingHorizontal(aStack, false);
- }
- else if (sideHit == 1){
- playerStandingPosition = "below";
- setFacingHorizontal(aStack, false);
- }
- else if (sideHit == 2){
- playerStandingPosition = "facingSouth";
- setFacingHorizontal(aStack, true);
- }
- else if (sideHit == 3){
- playerStandingPosition = "facingNorth";
- setFacingHorizontal(aStack, true);
- }
- else if (sideHit == 4){
- playerStandingPosition = "facingEast";
- setFacingHorizontal(aStack, true);
- }
- else if (sideHit == 5){
- playerStandingPosition = "facingWest";
- setFacingHorizontal(aStack, true);
- }
- setLookingDirection(aStack, playerStandingPosition);
-
- if (direction == 0){
- setFacingDirection(aStack, "south");
- }
- else if (direction == 1){
- setFacingDirection(aStack, "west");
- }
- else if (direction == 2){
- setFacingDirection(aStack, "north");
- }
- else if (direction == 3){
- setFacingDirection(aStack, "east");
- }
- }
-
-
- return true;
- }
- return false;
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GOLD+"Spades a 3x3 area in the direction you are facing.");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return EnumRarity.rare;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- return true;
- }
-
-
- @Override
- public boolean onBlockStartBreak(final ItemStack itemstack, final int X, final int Y, final int Z, final EntityPlayer aPlayer) {
- this.checkFacing(itemstack, aPlayer, aPlayer.worldObj);
- return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
- }
- public StaballoySpade(final String unlocalizedName, final ToolMaterial material) {
- super(material);
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setMaxDamage(3200);
- }
+public class StaballoySpade extends ItemSpade {
+
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(final ItemStack stack) {
+ if (super.getDurabilityForDisplay(stack) > 0) {
+ return super.getDurabilityForDisplay(stack);
+ }
+ return 0;
+ }
+
+ /**
+ * Creates an NBT tag for this item if it doesn't have one.
+ * This also set some default values.
+ * @param rStack
+ * @return
+ */
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+
+ tagNBT.setBoolean("FACING_HORIZONTAL", true);
+ tagNBT.setString("FACING", "north");
+ tagNBT.setString("lookingDirection", "");
+
+ tagMain.setTag("PickStats", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ /*
+ * Is the player facing horizontally?
+ */
+
+ public static final boolean isFacingHorizontal(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ return aNBT.getBoolean("FACING_HORIZONTAL");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return true;
+ }
+
+ public static final boolean setFacingHorizontal(final ItemStack aStack, final boolean aFacingHorizontal) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ aNBT.setBoolean("FACING_HORIZONTAL", aFacingHorizontal);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /*
+ * Handles the Direction the player is facing
+ */
+
+ public static final String getFacingDirection(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ return aNBT.getString("FACING");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return "north";
+ }
+
+ public static final boolean setFacingDirection(final ItemStack aStack, final String aFacingHorizontal) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ aNBT.setString("FACING", aFacingHorizontal);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /*
+ * The Looking Direction handlers
+ */
+
+ public static final String getLookingDirection(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ return aNBT.getString("lookingDirection");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return "";
+ }
+
+ public static final boolean setLookingDirection(final ItemStack aStack, final String aFacingHorizontal) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("PickStats");
+ if (aNBT != null) {
+ aNBT.setString("lookingDirection", aFacingHorizontal);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private int miningLevel;
+
+ /*
+ *
+ *
+ *
+ * Methods
+ *
+ *
+ *
+ */
+
+ @Override
+ public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) {
+ return super.onItemRightClick(stack, world, aPlayer);
+ }
+
+ @Override
+ public boolean onBlockDestroyed(
+ final ItemStack stack,
+ final World world,
+ final Block block,
+ final int X,
+ final int Y,
+ final int Z,
+ final EntityLivingBase entity) {
+ if (!world.isRemote) {
+ if (entity instanceof EntityPlayer) {
+ this.GetDestroyOrientation((EntityPlayer) entity, getLookingDirection(stack), world, X, Y, Z, stack);
+ }
+ }
+ return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
+ }
+
+ public Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld, final int[] xyz) {
+ String correctTool = "";
+ if (!currentWorld.isRemote) {
+ try {
+ correctTool = currentBlock.getHarvestTool(0);
+ // Utils.LOG_WARNING(correctTool);
+
+ Logger.WARNING(
+ "Tool for Block: " + correctTool + " | Current block: " + currentBlock.getLocalizedName());
+ if (MiningUtils.getBlockType(currentBlock, currentWorld, xyz, this.miningLevel)
+ || correctTool.equals("shovel")) {
+ return true;
+ }
+ } catch (final NullPointerException e) {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ private void GetDestroyOrientation(
+ EntityPlayer player,
+ final String FACING,
+ final World world,
+ final int X,
+ final int Y,
+ final int Z,
+ final ItemStack heldItem) {
+ float DURABILITY_LOSS = 0;
+ if (!world.isRemote) {
+
+ if (FACING.equals("below") || FACING.equals("above")) {
+ DURABILITY_LOSS = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ DURABILITY_LOSS =
+ (DURABILITY_LOSS + this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem));
+ }
+ }
+ } else if (FACING.equals("facingEast") || FACING.equals("facingWest")) {
+ DURABILITY_LOSS = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ DURABILITY_LOSS =
+ (DURABILITY_LOSS + this.removeBlockAndDropAsItem(world, X, Y + i, Z + j, heldItem));
+ }
+ }
+ } else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")) {
+ DURABILITY_LOSS = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ DURABILITY_LOSS =
+ (DURABILITY_LOSS + this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem));
+ }
+ }
+ }
+
+ // int heldItemDurability = heldItem.getDamage(1);
+ Logger.WARNING("Total Loss: " + (int) DURABILITY_LOSS);
+ // heldItem.setDamage(heldStack, DURABILITY_LOSS);
+ // Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
+ // Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
+ Logger.WARNING("1x: " + (heldItem.getItemDamage()));
+ final int itemdmg = heldItem.getItemDamage();
+ final int maxdmg = heldItem.getMaxDamage();
+ final int dodmg = (int) DURABILITY_LOSS;
+ final int durNow = maxdmg - itemdmg;
+ final int durLeft = (int) ((maxdmg - itemdmg) - DURABILITY_LOSS);
+
+ Logger.WARNING("Current Damage: " + itemdmg
+ + " Max Damage: " + maxdmg
+ + " Durability to be lost: " + dodmg
+ + " Current Durability: " + durNow
+ + " Remaining Durability: " + durLeft);
+
+ // Break Tool
+ if (((durNow - dodmg) <= (900)) && (itemdmg != 0)) {
+ // TODO break tool
+ Logger.WARNING("Breaking Tool");
+ heldItem.stackSize = 0;
+ }
+ // Do Damage
+ else {
+ // setItemDamage(heldItem, durLeft);
+ Logger.WARNING("" + (durNow - durLeft));
+ this.damageItem(heldItem, (durNow - durLeft) - 1, player);
+ }
+ DURABILITY_LOSS = 0;
+ }
+ }
+
+ public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) {
+ item.damageItem(damage, localPlayer);
+ }
+
+ public void setItemDamage(final ItemStack item, final int damage) {
+ item.setItemDamage(damage - 1);
+ }
+
+ // Should clear up blocks quicker if I chain it.
+ public int removeBlockAndDropAsItem(
+ final World world, final int X, final int Y, final int Z, final ItemStack heldItem) {
+ Logger.WARNING("Trying to drop/remove a block.");
+ try {
+ final Block block = world.getBlock(X, Y, Z);
+ Logger.WARNING(block.toString());
+ String removalTool = "";
+ removalTool = block.getHarvestTool(0);
+ if (removalTool != null) {
+ if (removalTool.equals("shovel")) {
+ if (this.canPickaxeBlock(block, world, new int[] {X, Y, Z})) {
+ if ((block != Blocks.bedrock)
+ && (block.getBlockHardness(world, X, Y, Z) != -1)
+ && (block.getBlockHardness(world, X, Y, Z) <= 100)
+ && (block != Blocks.water)
+ && (block != Blocks.lava)) {
+
+ final int itemdmg = heldItem.getItemDamage();
+ final int maxdmg = heldItem.getMaxDamage();
+ final int dodmg = 100;
+ final int durNow = maxdmg - itemdmg;
+ final int durLeft = (maxdmg - itemdmg) - 100;
+
+ if (((durNow - dodmg) <= (900)) && (itemdmg != 0)) {
+ // Do Nothing, Tool is useless.
+ return 0;
+ }
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+ Logger.WARNING("Adding 100 damage to item.");
+ return 100;
+ }
+ Logger.WARNING(
+ "Incorrect Tool for mining this block. Wrong Block Water/lava/bedrock/blacklist");
+ return 0;
+ }
+ Logger.WARNING("Incorrect Tool for mining this block. Cannot Shovel this block type.");
+ return 0;
+ }
+ Logger.WARNING("Incorrect Tool for mining this block. Blocks mining tool is now Shovel.");
+ return 0;
+ }
+ Logger.WARNING("Either the block was air or it declares an invalid mining tool.");
+ return 0;
+ } catch (final NullPointerException e) {
+ Logger.WARNING("Something Broke");
+ e.printStackTrace();
+ return 0;
+ }
+ }
+
+ public boolean checkFacing(final ItemStack aStack, final EntityPlayer aPlayer, final World world) {
+ if (aPlayer != null) {
+ final int direction = MathHelper.floor_double((aPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3;
+ // Utils.LOG_WARNING("Player - F: "+direction);
+ // Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord);
+
+ /*if (localPlayer.getLookVec().yCoord > 0){
+ localPlayer.getLookVec().yCoord;
+ }*/
+
+ final MovingObjectPosition movingobjectposition =
+ this.getMovingObjectPositionFromPlayer(world, aPlayer, false);
+ if (movingobjectposition != null) {
+ final int sideHit = movingobjectposition.sideHit;
+ String playerStandingPosition = "";
+ if (movingobjectposition != null) {
+ // System.out.println("Side Hit: "+movingobjectposition.sideHit);
+ }
+
+ if (sideHit == 0) {
+ playerStandingPosition = "above";
+ setFacingHorizontal(aStack, false);
+ } else if (sideHit == 1) {
+ playerStandingPosition = "below";
+ setFacingHorizontal(aStack, false);
+ } else if (sideHit == 2) {
+ playerStandingPosition = "facingSouth";
+ setFacingHorizontal(aStack, true);
+ } else if (sideHit == 3) {
+ playerStandingPosition = "facingNorth";
+ setFacingHorizontal(aStack, true);
+ } else if (sideHit == 4) {
+ playerStandingPosition = "facingEast";
+ setFacingHorizontal(aStack, true);
+ } else if (sideHit == 5) {
+ playerStandingPosition = "facingWest";
+ setFacingHorizontal(aStack, true);
+ }
+ setLookingDirection(aStack, playerStandingPosition);
+
+ if (direction == 0) {
+ setFacingDirection(aStack, "south");
+ } else if (direction == 1) {
+ setFacingDirection(aStack, "west");
+ } else if (direction == 2) {
+ setFacingDirection(aStack, "north");
+ } else if (direction == 3) {
+ setFacingDirection(aStack, "east");
+ }
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GOLD + "Spades a 3x3 area in the direction you are facing.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return EnumRarity.rare;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ return true;
+ }
+
+ @Override
+ public boolean onBlockStartBreak(
+ final ItemStack itemstack, final int X, final int Y, final int Z, final EntityPlayer aPlayer) {
+ this.checkFacing(itemstack, aPlayer, aPlayer.worldObj);
+ return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
+ }
+
+ public StaballoySpade(final String unlocalizedName, final ToolMaterial material) {
+ super(material);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(3200);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/WearableLoader.java b/src/main/java/gtPlusPlus/core/item/wearable/WearableLoader.java
index 6912b4e771..8044b4364f 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/WearableLoader.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/WearableLoader.java
@@ -4,12 +4,11 @@ import gtPlusPlus.core.item.wearable.armour.ArmourLoader;
public class WearableLoader {
- public static void run() {
- execute();
- }
-
- private static void execute() {
- ArmourLoader.run();
- }
-
+ public static void run() {
+ execute();
+ }
+
+ private static void execute() {
+ ArmourLoader.run();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/armour/ArmourLoader.java b/src/main/java/gtPlusPlus/core/item/wearable/armour/ArmourLoader.java
index 6918f2b048..2034d209e7 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/armour/ArmourLoader.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/armour/ArmourLoader.java
@@ -5,37 +5,35 @@ import gtPlusPlus.core.item.wearable.armour.tinfoil.ArmourTinFoilHat;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor.ArmorMaterial;
-
import net.minecraftforge.common.util.EnumHelper;
public class ArmourLoader {
- //Glass
- public static Item ClearGlassChestplate;
- public static Item ClearGlassBoots;
- public static Item ClearGlassLeggings;
- public static Item ClearGlassHelmet;
-
- //Tin Foil
- public static Item TinFoilHat;
-
- public static ArmorMaterial ClearGlassArmour = EnumHelper.addArmorMaterial("ClearGlassArmor", 1, new int[] {1, 1, 1, 1}, 100);
- public static ArmorMaterial TinFoilArmour = EnumHelper.addArmorMaterial("TINFOIL", 5, new int[]{1, 1, 1, 1}, 50);
-
-
- public static void run() {
- glassArmour();
- tinfoilArmour();
- }
-
- private static void glassArmour() {
- //RenderingRegistry.addNewArmourRendererPrefix("ClearGlassArmor"); This needs to be client side only TODO
- //ClearGlassHelmet = new ClearGlassArmor(2055, ClearGlassArmor, 5, 0).setUnlocalizedName("amethyst_helmet");
- }
-
- private static void tinfoilArmour() {
- TinFoilHat = new ArmourTinFoilHat().setUnlocalizedName("itemHatTinFoil");
- GameRegistry.registerItem(TinFoilHat, "itemHatTinFoil", CORE.MODID);
- }
-
+ // Glass
+ public static Item ClearGlassChestplate;
+ public static Item ClearGlassBoots;
+ public static Item ClearGlassLeggings;
+ public static Item ClearGlassHelmet;
+
+ // Tin Foil
+ public static Item TinFoilHat;
+
+ public static ArmorMaterial ClearGlassArmour =
+ EnumHelper.addArmorMaterial("ClearGlassArmor", 1, new int[] {1, 1, 1, 1}, 100);
+ public static ArmorMaterial TinFoilArmour = EnumHelper.addArmorMaterial("TINFOIL", 5, new int[] {1, 1, 1, 1}, 50);
+
+ public static void run() {
+ glassArmour();
+ tinfoilArmour();
+ }
+
+ private static void glassArmour() {
+ // RenderingRegistry.addNewArmourRendererPrefix("ClearGlassArmor"); This needs to be client side only TODO
+ // ClearGlassHelmet = new ClearGlassArmor(2055, ClearGlassArmor, 5, 0).setUnlocalizedName("amethyst_helmet");
+ }
+
+ private static void tinfoilArmour() {
+ TinFoilHat = new ArmourTinFoilHat().setUnlocalizedName("itemHatTinFoil");
+ GameRegistry.registerItem(TinFoilHat, "itemHatTinFoil", CORE.MODID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmour.java b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmour.java
index 0c6a547d34..e7ce975eca 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmour.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmour.java
@@ -4,8 +4,7 @@ import gtPlusPlus.core.item.wearable.base.BaseItemWearable;
public abstract class BaseArmour extends BaseItemWearable {
- public BaseArmour(ArmorMaterial material, int renderIndex, int armourType) {
- super(material, renderIndex, armourType);
- }
-
+ public BaseArmour(ArmorMaterial material, int renderIndex, int armourType) {
+ super(material, renderIndex, armourType);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourBoots.java b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourBoots.java
index 2ace8919d0..5191f9393c 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourBoots.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourBoots.java
@@ -2,9 +2,8 @@ package gtPlusPlus.core.item.wearable.armour.base;
public abstract class BaseArmourBoots extends BaseArmour {
- public BaseArmourBoots(ArmorMaterial material, int renderIndex) {
- super(material, renderIndex, 3);
- // TODO Auto-generated constructor stub
- }
-
+ public BaseArmourBoots(ArmorMaterial material, int renderIndex) {
+ super(material, renderIndex, 3);
+ // TODO Auto-generated constructor stub
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourChest.java b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourChest.java
index 16899c4229..eb55637ee4 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourChest.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourChest.java
@@ -2,9 +2,8 @@ package gtPlusPlus.core.item.wearable.armour.base;
public abstract class BaseArmourChest extends BaseArmour {
- public BaseArmourChest(ArmorMaterial material, int renderIndex) {
- super(material, renderIndex, 1);
- // TODO Auto-generated constructor stub
- }
-
+ public BaseArmourChest(ArmorMaterial material, int renderIndex) {
+ super(material, renderIndex, 1);
+ // TODO Auto-generated constructor stub
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourHelm.java b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourHelm.java
index c3676277eb..d121a90ade 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourHelm.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourHelm.java
@@ -2,9 +2,8 @@ package gtPlusPlus.core.item.wearable.armour.base;
public abstract class BaseArmourHelm extends BaseArmour {
- public BaseArmourHelm(ArmorMaterial material, int renderIndex) {
- super(material, renderIndex, 0);
- // TODO Auto-generated constructor stub
- }
-
+ public BaseArmourHelm(ArmorMaterial material, int renderIndex) {
+ super(material, renderIndex, 0);
+ // TODO Auto-generated constructor stub
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourLegs.java b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourLegs.java
index 9794a713ac..b376610427 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourLegs.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/armour/base/BaseArmourLegs.java
@@ -2,9 +2,8 @@ package gtPlusPlus.core.item.wearable.armour.base;
public abstract class BaseArmourLegs extends BaseArmour {
- public BaseArmourLegs(ArmorMaterial material, int renderIndex) {
- super(material, renderIndex, 2);
- // TODO Auto-generated constructor stub
- }
-
+ public BaseArmourLegs(ArmorMaterial material, int renderIndex) {
+ super(material, renderIndex, 2);
+ // TODO Auto-generated constructor stub
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/armour/hazmat/ArmourHazmat.java b/src/main/java/gtPlusPlus/core/item/wearable/armour/hazmat/ArmourHazmat.java
index 9fd7bf7020..a1762a070c 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/armour/hazmat/ArmourHazmat.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/armour/hazmat/ArmourHazmat.java
@@ -1,12 +1,11 @@
package gtPlusPlus.core.item.wearable.armour.hazmat;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.wearable.armour.ArmourLoader;
import gtPlusPlus.core.item.wearable.armour.base.BaseArmourHelm;
import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -20,98 +19,93 @@ import net.minecraft.world.World;
public class ArmourHazmat extends BaseArmourHelm {
- public IIcon iconHelm;
-
- public ArmourHazmat() {
- super(ArmourLoader.TinFoilArmour, 0);
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister ir) {
- this.iconHelm = ir.registerIcon(CORE.MODID + ":itemHatTinFoil");
- }
-
- @Override
- public int getRenderIndex() {
- return 0;
- }
-
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamage(int par1) {
- return this.iconHelm;
- }
-
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
- return CORE.MODID + ":textures/models/TinFoil.png";
- }
-
- public EnumRarity getRarity(ItemStack itemstack) {
- return EnumRarity.rare;
- }
-
- public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
- return false;
- }
-
- @Override
- public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
- return super.getArmorDisplay(player, armor, slot);
- }
-
- @Override
- public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
-
- }
-
- @SuppressWarnings({ "unchecked" })
- @Override
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
- aList.add("DoomSquirter's protection against cosmic radiation!");
- aList.add("General paranoia makes the wearer unable to collect xp");
- aList.add("Movement speed is also reduced, to keep you safe");
- aList.add("This hat may also have other strange powers");
- }
-
- @Override
- public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
- int slot) {
- return new ArmorProperties(0, 0, 0);
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_,
- EntityLivingBase p_111207_3_) {
- return super.itemInteractionForEntity(p_111207_1_, p_111207_2_, p_111207_3_);
- }
-
- @Override
- public void onUpdate(ItemStack aStack, World aWorld, Entity aEntity, int p_77663_4_, boolean p_77663_5_) {
- super.onUpdate(aStack, aWorld, aEntity, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public boolean onEntityItemUpdate(EntityItem entityItem) {
- return super.onEntityItemUpdate(entityItem);
- }
-
- @Override
- public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
- if (itemStack != null && player != null && world != null && !world.isRemote) {
- if (player instanceof EntityPlayer) {
-
- }
- }
- super.onArmorTick(world, player, itemStack);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
+ public IIcon iconHelm;
+
+ public ArmourHazmat() {
+ super(ArmourLoader.TinFoilArmour, 0);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister ir) {
+ this.iconHelm = ir.registerIcon(CORE.MODID + ":itemHatTinFoil");
+ }
+
+ @Override
+ public int getRenderIndex() {
+ return 0;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int par1) {
+ return this.iconHelm;
+ }
+
+ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
+ return CORE.MODID + ":textures/models/TinFoil.png";
+ }
+
+ public EnumRarity getRarity(ItemStack itemstack) {
+ return EnumRarity.rare;
+ }
+
+ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
+ return false;
+ }
+
+ @Override
+ public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
+ return super.getArmorDisplay(player, armor, slot);
+ }
+
+ @Override
+ public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {}
+
+ @SuppressWarnings({"unchecked"})
+ @Override
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ aList.add("DoomSquirter's protection against cosmic radiation!");
+ aList.add("General paranoia makes the wearer unable to collect xp");
+ aList.add("Movement speed is also reduced, to keep you safe");
+ aList.add("This hat may also have other strange powers");
+ }
+
+ @Override
+ public ArmorProperties getProperties(
+ EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
+ return new ArmorProperties(0, 0, 0);
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean itemInteractionForEntity(
+ ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) {
+ return super.itemInteractionForEntity(p_111207_1_, p_111207_2_, p_111207_3_);
+ }
+
+ @Override
+ public void onUpdate(ItemStack aStack, World aWorld, Entity aEntity, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(aStack, aWorld, aEntity, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean onEntityItemUpdate(EntityItem entityItem) {
+ return super.onEntityItemUpdate(entityItem);
+ }
+
+ @Override
+ public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
+ if (itemStack != null && player != null && world != null && !world.isRemote) {
+ if (player instanceof EntityPlayer) {}
+ }
+ super.onArmorTick(world, player, itemStack);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/armour/tinfoil/ArmourTinFoilHat.java b/src/main/java/gtPlusPlus/core/item/wearable/armour/tinfoil/ArmourTinFoilHat.java
index c1fe96efb5..532f9de530 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/armour/tinfoil/ArmourTinFoilHat.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/armour/tinfoil/ArmourTinFoilHat.java
@@ -1,14 +1,12 @@
package gtPlusPlus.core.item.wearable.armour.tinfoil;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.wearable.armour.ArmourLoader;
import gtPlusPlus.core.item.wearable.armour.base.BaseArmourHelm;
import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -33,151 +31,143 @@ import net.minecraft.world.World;
public class ArmourTinFoilHat extends BaseArmourHelm {
- public IIcon iconHelm;
-
- public ArmourTinFoilHat() {
- super(ArmourLoader.TinFoilArmour, 0);
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister ir) {
- this.iconHelm = ir.registerIcon(CORE.MODID + ":itemHatTinFoil");
- }
-
- @Override
- public int getRenderIndex() {
- return 0;
- }
-
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamage(int par1) {
- return this.iconHelm;
- }
-
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
- return CORE.MODID + ":textures/models/TinFoil.png";
- }
-
- public EnumRarity getRarity(ItemStack itemstack) {
- return EnumRarity.uncommon;
- }
-
- public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
- return false;
- }
-
- @Override
- public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
- return super.getArmorDisplay(player, armor, slot);
- }
-
- @Override
- public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
-
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
- aList.add("DoomSquirter's protection against cosmic radiation!");
- aList.add("General paranoia makes the wearer unable to collect xp");
- aList.add("Movement speed is also reduced, to keep you safe");
- aList.add("This hat may also have other strange powers");
- }
-
- @Override
- public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
- int slot) {
- return new ArmorProperties(0, 0, 0);
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_,
- EntityLivingBase p_111207_3_) {
- return super.itemInteractionForEntity(p_111207_1_, p_111207_2_, p_111207_3_);
- }
-
- @Override
- public void onUpdate(ItemStack aStack, World aWorld, Entity aEntity, int p_77663_4_, boolean p_77663_5_) {
- super.onUpdate(aStack, aWorld, aEntity, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public boolean onEntityItemUpdate(EntityItem entityItem) {
- return super.onEntityItemUpdate(entityItem);
- }
-
- @Override
- public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
- if (itemStack != null && player != null && world != null && !world.isRemote) {
- if (player instanceof EntityPlayer) {
-
- // Apply Slow
- if (!GT_Utility.getPotion(player, Potion.moveSlowdown.id)) {
- player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2, 1, true));
- }
-
- // Move Xp orbs away
- try {
- AxisAlignedBB box = player.boundingBox;
- box.maxX = player.posX + 5;
- box.maxY = player.posY + 5;
- box.maxZ = player.posZ + 5;
- box.minX = player.posX - 5;
- box.minY = player.posY - 5;
- box.minZ = player.posZ - 5;
- @SuppressWarnings("unchecked")
- List<Entity> g = world.getEntitiesWithinAABBExcludingEntity(player, box);
- if (g.size() > 0) {
- for (Entity e : g) {
- if (e != null) {
- if (
- !EntityXPOrb.class.isInstance(e) &&
- !EntityBoat.class.isInstance(e) &&
- !EntitySnowball.class.isInstance(e) &&
- !EntityFireball.class.isInstance(e) &&
- !EntityEgg.class.isInstance(e) &&
- !EntityExpBottle.class.isInstance(e) &&
- !EntityEnderEye.class.isInstance(e) &&
- !EntityEnderPearl.class.isInstance(e)
- ) {
- continue;
- }
- else {
- //Logger.INFO("Found "+e.getClass().getName());
- double distX = player.posX - e.posX;
- double distZ = player.posZ - e.posZ;
- double distY = e.posY + 1.5D - player.posY;
- double dir = Math.atan2(distZ, distX);
- double speed = 1F / e.getDistanceToEntity(player) * 0.5;
- speed = -speed;
- if (distY < 0) {
- e.motionY += speed;
- }
- e.motionX = Math.cos(dir) * speed;
- e.motionZ = Math.sin(dir) * speed;
- }
-
-
- }
- }
- }
- } catch (Throwable t) {
- }
- }
- }
-
- super.onArmorTick(world, player, itemStack);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
+ public IIcon iconHelm;
+
+ public ArmourTinFoilHat() {
+ super(ArmourLoader.TinFoilArmour, 0);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister ir) {
+ this.iconHelm = ir.registerIcon(CORE.MODID + ":itemHatTinFoil");
+ }
+
+ @Override
+ public int getRenderIndex() {
+ return 0;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int par1) {
+ return this.iconHelm;
+ }
+
+ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
+ return CORE.MODID + ":textures/models/TinFoil.png";
+ }
+
+ public EnumRarity getRarity(ItemStack itemstack) {
+ return EnumRarity.uncommon;
+ }
+
+ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
+ return false;
+ }
+
+ @Override
+ public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
+ return super.getArmorDisplay(player, armor, slot);
+ }
+
+ @Override
+ public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {}
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ aList.add("DoomSquirter's protection against cosmic radiation!");
+ aList.add("General paranoia makes the wearer unable to collect xp");
+ aList.add("Movement speed is also reduced, to keep you safe");
+ aList.add("This hat may also have other strange powers");
+ }
+
+ @Override
+ public ArmorProperties getProperties(
+ EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
+ return new ArmorProperties(0, 0, 0);
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean itemInteractionForEntity(
+ ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) {
+ return super.itemInteractionForEntity(p_111207_1_, p_111207_2_, p_111207_3_);
+ }
+
+ @Override
+ public void onUpdate(ItemStack aStack, World aWorld, Entity aEntity, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(aStack, aWorld, aEntity, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean onEntityItemUpdate(EntityItem entityItem) {
+ return super.onEntityItemUpdate(entityItem);
+ }
+
+ @Override
+ public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
+ if (itemStack != null && player != null && world != null && !world.isRemote) {
+ if (player instanceof EntityPlayer) {
+
+ // Apply Slow
+ if (!GT_Utility.getPotion(player, Potion.moveSlowdown.id)) {
+ player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2, 1, true));
+ }
+
+ // Move Xp orbs away
+ try {
+ AxisAlignedBB box = player.boundingBox;
+ box.maxX = player.posX + 5;
+ box.maxY = player.posY + 5;
+ box.maxZ = player.posZ + 5;
+ box.minX = player.posX - 5;
+ box.minY = player.posY - 5;
+ box.minZ = player.posZ - 5;
+ @SuppressWarnings("unchecked")
+ List<Entity> g = world.getEntitiesWithinAABBExcludingEntity(player, box);
+ if (g.size() > 0) {
+ for (Entity e : g) {
+ if (e != null) {
+ if (!EntityXPOrb.class.isInstance(e)
+ && !EntityBoat.class.isInstance(e)
+ && !EntitySnowball.class.isInstance(e)
+ && !EntityFireball.class.isInstance(e)
+ && !EntityEgg.class.isInstance(e)
+ && !EntityExpBottle.class.isInstance(e)
+ && !EntityEnderEye.class.isInstance(e)
+ && !EntityEnderPearl.class.isInstance(e)) {
+ continue;
+ } else {
+ // Logger.INFO("Found "+e.getClass().getName());
+ double distX = player.posX - e.posX;
+ double distZ = player.posZ - e.posZ;
+ double distY = e.posY + 1.5D - player.posY;
+ double dir = Math.atan2(distZ, distX);
+ double speed = 1F / e.getDistanceToEntity(player) * 0.5;
+ speed = -speed;
+ if (distY < 0) {
+ e.motionY += speed;
+ }
+ e.motionX = Math.cos(dir) * speed;
+ e.motionZ = Math.sin(dir) * speed;
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ }
+ }
+ }
+
+ super.onArmorTick(world, player, itemStack);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/base/BaseItemWearable.java b/src/main/java/gtPlusPlus/core/item/wearable/base/BaseItemWearable.java
index f23079bc8b..8dca1e0ded 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/base/BaseItemWearable.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/base/BaseItemWearable.java
@@ -6,60 +6,56 @@ import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
-
import net.minecraftforge.common.ISpecialArmor;
public abstract class BaseItemWearable extends ItemArmor implements ISpecialArmor {
- public BaseItemWearable(ArmorMaterial material, int renderIndex, int armourType) {
- super(material, renderIndex, armourType);
- }
-
- public abstract int getRenderIndex();
-
-
-
- @Override
- public abstract ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
- int slot);
-
- @Override
- public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public abstract void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot);
-
- public void dyeArmour(ItemStack aArmour, int aColour) {
- func_82813_b(aArmour, aColour);
- }
-
- @Override
- public void func_82813_b(ItemStack p_82813_1_, int p_82813_2_) {
- NBTTagCompound nbttagcompound = p_82813_1_.getTagCompound();
- if (nbttagcompound == null) {
- nbttagcompound = new NBTTagCompound();
- p_82813_1_.setTagCompound(nbttagcompound);
- }
- NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");
- if (!nbttagcompound.hasKey("display", 10)) {
- nbttagcompound.setTag("display", nbttagcompound1);
- }
- nbttagcompound1.setInteger("color", p_82813_2_);
- }
-
- @Override
- public void removeColor(ItemStack p_82815_1_) {
- NBTTagCompound nbttagcompound = p_82815_1_.getTagCompound();
- if (nbttagcompound != null) {
- NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");
- if (nbttagcompound1.hasKey("color")) {
- nbttagcompound1.removeTag("color");
- }
- }
- }
-
-
+ public BaseItemWearable(ArmorMaterial material, int renderIndex, int armourType) {
+ super(material, renderIndex, armourType);
+ }
+
+ public abstract int getRenderIndex();
+
+ @Override
+ public abstract ArmorProperties getProperties(
+ EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot);
+
+ @Override
+ public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public abstract void damageArmor(
+ EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot);
+
+ public void dyeArmour(ItemStack aArmour, int aColour) {
+ func_82813_b(aArmour, aColour);
+ }
+
+ @Override
+ public void func_82813_b(ItemStack p_82813_1_, int p_82813_2_) {
+ NBTTagCompound nbttagcompound = p_82813_1_.getTagCompound();
+ if (nbttagcompound == null) {
+ nbttagcompound = new NBTTagCompound();
+ p_82813_1_.setTagCompound(nbttagcompound);
+ }
+ NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");
+ if (!nbttagcompound.hasKey("display", 10)) {
+ nbttagcompound.setTag("display", nbttagcompound1);
+ }
+ nbttagcompound1.setInteger("color", p_82813_2_);
+ }
+
+ @Override
+ public void removeColor(ItemStack p_82815_1_) {
+ NBTTagCompound nbttagcompound = p_82815_1_.getTagCompound();
+ if (nbttagcompound != null) {
+ NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");
+ if (nbttagcompound1.hasKey("color")) {
+ nbttagcompound1.removeTag("color");
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java b/src/main/java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java
index 1f8009e54a..c4923ccd67 100644
--- a/src/main/java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java
+++ b/src/main/java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java
@@ -10,22 +10,25 @@ import net.minecraft.item.ItemStack;
public class ItemArmorHazmatEx extends ItemArmorHazmat {
- public static void init() {
- GregtechItemList.Armour_Hazmat_Advanced_Helmet.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatHelmetEx, 0)));
- GregtechItemList.Armour_Hazmat_Advanced_Chest.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatChestEx, 1)));
- GregtechItemList.Armour_Hazmat_Advanced_Legs.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatLegsEx, 2)));
- GregtechItemList.Armour_Hazmat_Advanced_Boots.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatBootsEx, 3)));
- }
-
- private ItemArmorHazmatEx(InternalName internalName, int type) {
- super(internalName, type);
- this.setMaxDamage(256);
- }
+ public static void init() {
+ GregtechItemList.Armour_Hazmat_Advanced_Helmet.set(
+ new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatHelmetEx, 0)));
+ GregtechItemList.Armour_Hazmat_Advanced_Chest.set(
+ new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatChestEx, 1)));
+ GregtechItemList.Armour_Hazmat_Advanced_Legs.set(
+ new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatLegsEx, 2)));
+ GregtechItemList.Armour_Hazmat_Advanced_Boots.set(
+ new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatBootsEx, 3)));
+ }
- @Override
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
- int suffix = this.armorType == 2 ? 2 : 1;
- return IC2.textureDomain + ":textures/armor/" + "hazmatEx_" + suffix + ".png";
- }
-
+ private ItemArmorHazmatEx(InternalName internalName, int type) {
+ super(internalName, type);
+ this.setMaxDamage(256);
+ }
+
+ @Override
+ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
+ int suffix = this.armorType == 2 ? 2 : 1;
+ return IC2.textureDomain + ":textures/armor/" + "hazmatEx_" + suffix + ".png";
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/lib/CORE.java b/src/main/java/gtPlusPlus/core/lib/CORE.java
index 8cb6a938b5..5113755c33 100644
--- a/src/main/java/gtPlusPlus/core/lib/CORE.java
+++ b/src/main/java/gtPlusPlus/core/lib/CORE.java
@@ -1,10 +1,6 @@
package gtPlusPlus.core.lib;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-
import com.mojang.authlib.GameProfile;
-
import cpw.mods.fml.common.FMLCommonHandler;
import gregtech.api.GregTech_API;
import gtPlusPlus.api.objects.Logger;
@@ -17,6 +13,8 @@ import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractTerminal;
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -28,346 +26,323 @@ import net.minecraftforge.common.util.FakePlayerFactory;
public class CORE {
- //import cpw.mods.fml.common.Optional;
-
- //Analytics handler
- //public static SegmentAnalytics mHelper;
-
- public static Map PlayerCache;
-
- //Math Related
- public static final float PI = (float) Math.PI;
- public static volatile Random RANDOM = new XSTR();
-
- //Env. Variables
- public static Configuration Config;
-
- public static boolean DEVENV = false;
- public static boolean NBT_PERSISTENCY_PATCH_APPLIED = false;
- //Only can be set in Dev, no config or setting elsewhere.
- public static final boolean LOAD_ALL_CONTENT = false;;
-
- //Mod Variables
-
- public static final String name = "GT++";
- public static final String MODID = "miscutils";
- public static final String VERSION = "GRADLETOKEN_VERSION";
-
- //Tweakables
- public static int EVERGLADES_ID = 227;
- public static int EVERGLADESBIOME_ID = 238;
- public static int AUSTRALIA_ID = 228;
- public static int AUSTRALIA_BIOME_DESERT_1_ID = 239;
- public static int AUSTRALIA_BIOME_DESERT_2_ID = 240;
- public static int AUSTRALIA_BIOME_DESERT_3_ID = 241;
- public static int AUSTRALIA_BIOME_PLAINS_ID = 242;
- public static int AUSTRALIA_BIOME_OUTBACK_ID = 243;
- public static int AUSTRALIA_BIOME_OCEAN_ID = 244;
- public static int AUSTRALIA_BIOME_FOREST_ID = 245;
-
- //GT Vars;
- public static final int GREG_FIRST_ID = 760;
- public static final boolean MAIN_GREGTECH_5U_EXPERIMENTAL_FORK = Meta_GT_Proxy.areWeUsingGregtech5uExperimental();
- public static final int GREGTECH_API_VERSION = GregTech_API.VERSION;
- public static int turbineCutoffBase = 75000;
-
- //GT++ Fake Player Profile
- public static final GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]");
- public static final WeakHashMap<World, EntityPlayerMP> fakePlayerCache = new WeakHashMap<World, EntityPlayerMP>();
- //Tooltips;
- public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]";
- public static final String GT_Tooltip_Builder = "" + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]";
- public static final String GT_Tooltip_Radioactive = EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.GREEN+"Radioactive! "+EnumChatFormatting.GOLD+" Avoid direct handling without hazmat protection.";
- public static final String noItem = "";
-
- //Because I want to be lazy Gregtech New Horizons Var.
- public static boolean GTNH = false;
- //Because I want to be lazy. Beyond Reality Classic Var.
- public static boolean BRC = false;
-
- public static final String SEPERATOR = "/";
-
-
- /**
- * Lists/Maps
- */
-
- //Burnables List
- public static List<Pair<Integer, ItemStack>> burnables = new ArrayList<Pair<Integer, ItemStack>>();
-
-
- //TesseractMaps
- public static final Map<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>> sTesseractGeneratorOwnershipMap = new HashMap<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>();
- public static final Map<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>> sTesseractTerminalOwnershipMap = new HashMap<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>();
-
- //BookMap
- public static final Map<String, ItemStack> sBookList = new ConcurrentHashMap<String, ItemStack>();
-
-
-
-
- /**
- * Some Gregtech Material and Recipe Variables
- */
-
- @Deprecated
- public static IGregtech_RecipeAdder sRecipeAdder;
- public static IGregtech_RecipeAdder RA;
-
- public static final GT_Materials[] sMU_GeneratedMaterials = new GT_Materials[1000];
-
- /**
- * 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/",
- TEX_DIR_FLUIDS = TEX_DIR_BLOCK + "fluids/",
- RES_PATH = MODID + ":" + TEX_DIR,
- RES_PATH_GUI = MODID + ":" + TEX_DIR_GUI,
- RES_PATH_ITEM = MODID + ":" + TEX_DIR_ITEM,
- RES_PATH_BLOCK = MODID + ":" + TEX_DIR_BLOCK,
- RES_PATH_ENTITY = MODID + ":" + TEX_DIR_ENTITY,
- RES_PATH_ASPECTS = MODID + ":" + TEX_DIR_ASPECTS,
- RES_PATH_FLUIDS = MODID + ":" + TEX_DIR_FLUIDS;
-
-
-
-
- /** Used to create a {@link EntityPlayer} instance from {@link FakePlayerFactory}.
- * If this instance already exists in the cache, we will return that instead.
- * These instances are held via weak reference, if the world object is unloaded, they too will be removed.
- * This is the suggested way to handle them, as suggested by Forge.
- *
- * @param world - The {@link World} object for which you want to check for in the cache.
- * This object is used as a weak reference in a {@link WeakHashMap}.
- * @return - An {@link EntityPlayerMP} instance, returned either from cache or created and cached prior to return.
- */
- public static EntityPlayerMP getFakePlayer(World world) {
- if (fakePlayerCache.get(world) == null) {
- fakePlayerCache.put(world, FakePlayerFactory.get((WorldServer) world, CORE.gameProfile));
- }
- return fakePlayerCache.get(world);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /*
- * Config Switch Class
- */
-
- public static class ConfigSwitches {
- //Debug
- public static boolean disableEnderIOIntegration = false;
- public static boolean disableEnderIOIngotTooltips = false;
- public static boolean MACHINE_INFO = true;
- public static boolean showHiddenNEIItems = false;
- public static boolean dumpItemAndBlockData = false;
-
- //Tools
- public static boolean enableSkookumChoochers = true;
- public static boolean enableMultiSizeTools = true;
-
- //Block Drops
- public static int chanceToDropDrainedShard = 196;
- public static int chanceToDropFluoriteOre = 32;
-
- //Machine Related
- public static boolean enableAlternativeBatteryAlloy = false;
- public static boolean enableThaumcraftShardUnification = false;
- public static boolean disableIC2Recipes = false;
- public static boolean enableAlternativeDivisionSigilRecipe = false;
- public static int boilerSteamPerSecond = 750;
- public static final boolean requireControlCores = false;
-
- //Feature Related
- public static boolean enableCustomCapes = false;
- public static boolean enableCustomCircuits = true;
- public static boolean enableOldGTcircuits = false;
- public static boolean disableZombieReinforcement = false;
- public static int enableWatchdogBGM = CORE_Preloader.enableWatchdogBGM;
- public static boolean hideUniversalCells = true;
-
- //GT Fixes
- public static boolean enableNitroFix = false;
- public static boolean enableSulfuricAcidFix = false;
- public static boolean enableAnimatedTurbines = true;
- public static boolean enableHarderRecipesForHighTierCasings = true;
-
- //Single Block Machines
- public static boolean enableMachine_SolarGenerators = false;
- public static boolean enableMachine_Safes = true;
- public static boolean enableMachine_Dehydrators = true;
- public static boolean enableMachine_SteamConverter = true;
- public static boolean enableMachine_FluidTanks = true;
- public static boolean enableMachine_RocketEngines = true;
- public static boolean enableMachine_GeothermalEngines = true;
- public static boolean enableMachine_WorldAccelerators = true;
- public static boolean enableMachine_Tesseracts = true;
- public static boolean enableMachine_SimpleWasher = true;
- public static boolean enableMachine_Pollution = true;
- public static boolean enableMachine_ComponentAssemblers = false;
- public static boolean enableCustom_Pipes = true;
- public static boolean enableCustom_Cables = true;
- public static boolean enableMachine_RF_Convetor = false;
-
- //Multiblocks
- public static boolean enableMultiblock_AlloyBlastSmelter = true;
- public static boolean enableMultiblock_IndustrialCentrifuge = true;
- public static boolean enableMultiblock_IndustrialCokeOven = true;
- public static boolean enableMultiblock_IndustrialElectrolyzer = true;
- public static boolean enableMultiblock_IndustrialMacerationStack = true;
- public static boolean enableMultiblock_IndustrialPlatePress = true;
- public static boolean enableMultiblock_IndustrialWireMill = true;
- public static boolean enableMultiblock_IronBlastFurnace = true;
- public static boolean enableMultiblock_MatterFabricator = true;
- public static boolean enableMultiblock_MultiTank = true;
- public static boolean enableMultiblock_PowerSubstation = true;
- public static boolean enableMultiblock_LiquidFluorideThoriumReactor = true;
- public static boolean enableMultiblock_NuclearFuelRefinery = true;
- public static boolean enableMultiblock_TreeFarmer = true;
- public static boolean enableMultiblock_IndustrialSifter = true;
- public static boolean enableMultiblock_IndustrialThermalCentrifuge = true;
- public static boolean enableMultiblock_IndustrialWashPlant = true;
- public static boolean enableMultiblock_LargeAutoCrafter = true;
- public static boolean enableMultiblock_ThermalBoiler = true;
- public static boolean enableMultiblock_IndustrialCuttingMachine = true;
- public static boolean enableMultiblock_IndustrialFishingPort = true;
- public static boolean enableMultiblock_IndustrialExtrudingMachine = true;
- public static boolean enableMultiblock_IndustrialMultiMachine = true;
- public static boolean enableMultiblock_Cyclotron = true;
-
- //Visuals
- public static boolean enableTreeFarmerParticles = true;
- public static boolean useGregtechTextures = true;
-
- //Pollution
- public static int pollutionPerSecondMultiPackager = 40;
- public static int pollutionPerSecondMultiIndustrialAlloySmelter = 300;
- public static int pollutionPerSecondMultiIndustrialArcFurnace = 2400;
- public static int pollutionPerSecondMultiIndustrialCentrifuge = 300;
- public static int pollutionPerSecondMultiIndustrialCokeOven = 80;
- public static int pollutionPerSecondMultiIndustrialCuttingMachine = 160;
- public static int pollutionPerSecondMultiIndustrialDehydrator = 500;
- public static int pollutionPerSecondMultiIndustrialElectrolyzer = 300;
- public static int pollutionPerSecondMultiIndustrialExtruder = 1000;
- public static int pollutionPerSecondMultiIndustrialMacerator = 400;
- public static int pollutionPerSecondMultiIndustrialMixer = 800;
- public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal = 400;
- public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid = 400;
- public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = 600;
- public static int pollutionPerSecondMultiIndustrialPlatePress_ModeForming = 240;
- public static int pollutionPerSecondMultiIndustrialPlatePress_ModeBending = 480;
- public static int pollutionPerSecondMultiIndustrialForgeHammer = 250;
- public static int pollutionPerSecondMultiIndustrialSifter = 40;
- public static int pollutionPerSecondMultiIndustrialThermalCentrifuge = 1000;
- public static int pollutionPerSecondMultiIndustrialVacuumFreezer = 500;
- public static int pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath = 400;
- public static int pollutionPerSecondMultiIndustrialWashPlant_ModeWasher = 100;
- public static int pollutionPerSecondMultiIndustrialWireMill = 100;
- public static int pollutionPerSecondMultiIsaMill = 1280;
- public static int pollutionPerSecondMultiAdvDistillationTower_ModeDistillery = 240;
- public static int pollutionPerSecondMultiAdvDistillationTower_ModeDT = 480;
- public static int pollutionPerSecondMultiAdvEBF = 500;
- public static int pollutionPerSecondMultiAdvImplosion = 5000;
- public static int pollutionPerSecondMultiABS = 200;
- public static int pollutionPerSecondMultiCyclotron = 200;
- public static int pollutionPerSecondMultiIndustrialFishingPond = 20;
- public static int pollutionPerSecondMultiLargeRocketEngine;
- public static int pollutionPerSecondMultiLargeSemiFluidGenerator = 1280;
- public static int pollutionPerSecondMultiMassFabricator = 40;
- public static int pollutionPerSecondMultiRefinery = 4000;
- public static int pollutionPerSecondMultiGeneratorArray;
- public static int pollutionPerSecondMultiTreeFarm = 100;
- public static int pollutionPerSecondMultiFrothFlotationCell = 0;
- public static int pollutionPerSecondMultiAutoCrafter = 500;
- public static int pollutionPerSecondMultiThermalBoiler = 700;
- public static int pollutionPerSecondMultiMolecularTransformer = 1000;
- public static int pollutionPerSecondMultiAlgaePond = 0;
- public static int pollutionPerSecondMultiIndustrialRockBreaker = 100;
- public static int pollutionPerSecondMultiIndustrialChisel = 50;
- //pollution single blocks
- public static int basePollutionPerSecondSemiFluidGenerator = 40;
- public static double[] pollutionReleasedByTierSemiFluidGenerator = new double[]{0,2.0,4.0,8.0};
- public static int basePollutionPerSecondBoiler = 35;
- public static double[] pollutionReleasedByTierBoiler = new double[]{0,1.0,1.43, 1.86};
- public static int baseMinPollutionPerSecondRocketFuelGenerator = 250;
- public static int baseMaxPollutionPerSecondRocketFuelGenerator = 2000;
- public static double[] pollutionReleasedByTierRocketFuelGenerator = new double[]{0,0,0,0,1,2,3};
- public static int basePollutionPerSecondGeothermalGenerator = 100;
- public static double[] pollutionReleasedByTierGeothermalGenerator = new double[]{0,0,0,0,1,1,1};
-
- }
-
- public static class Everglades{
- public static final String MODID = "ToxicEverglades";
- public static final String NAME = "GT++ Toxic Everglades";
- public static final String VERSION = "GRADLETOKEN_VERSION";
- }
-
- public static class Australia{
- public static final String MODID = "Australia";
- public static final String NAME = "GT++ Australia";
- public static final String VERSION = "GRADLETOKEN_VERSION";
- }
-
-
- public static final void crash() {
- crash("Generic Crash");
- }
-
- public static final void crash(String aReason) {
- try {
- Logger.INFO("==========================================================");
- Logger.INFO("[GT++ CRASH]");
- Logger.INFO("==========================================================");
- Logger.INFO("Oooops...");
- Logger.INFO("This should only happy in a development environment or when something really bad happens.");
- Logger.INFO("Reason: "+aReason);
- Logger.INFO("==========================================================");
- Logger.INFO("Called from: "+ReflectionUtils.getMethodName(1));
- Logger.INFO(ReflectionUtils.getMethodName(2));
- Logger.INFO(ReflectionUtils.getMethodName(3));
- Logger.INFO(ReflectionUtils.getMethodName(4));
- Logger.INFO(ReflectionUtils.getMethodName(5));
- Logger.INFO(ReflectionUtils.getMethodName(6));
- Logger.INFO(ReflectionUtils.getMethodName(7));
- Logger.INFO(ReflectionUtils.getMethodName(8));
- Logger.INFO(ReflectionUtils.getMethodName(9));
- Logger.INFO(ReflectionUtils.getMethodName(10));
- Logger.INFO(ReflectionUtils.getMethodName(11));
- Logger.INFO(ReflectionUtils.getMethodName(12));
- Logger.INFO(ReflectionUtils.getMethodName(13));
- Logger.INFO(ReflectionUtils.getMethodName(14));
- Logger.INFO(ReflectionUtils.getMethodName(15));
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- FMLCommonHandler.instance().exitJava(0, true);
- }
-
- public static final void gc() {
- System.gc();
- }
-
-} \ No newline at end of file
+ // import cpw.mods.fml.common.Optional;
+
+ // Analytics handler
+ // public static SegmentAnalytics mHelper;
+
+ public static Map PlayerCache;
+
+ // Math Related
+ public static final float PI = (float) Math.PI;
+ public static volatile Random RANDOM = new XSTR();
+
+ // Env. Variables
+ public static Configuration Config;
+
+ public static boolean DEVENV = false;
+ public static boolean NBT_PERSISTENCY_PATCH_APPLIED = false;
+ // Only can be set in Dev, no config or setting elsewhere.
+ public static final boolean LOAD_ALL_CONTENT = false;
+ ;
+
+ // Mod Variables
+
+ public static final String name = "GT++";
+ public static final String MODID = "miscutils";
+ public static final String VERSION = "GRADLETOKEN_VERSION";
+
+ // Tweakables
+ public static int EVERGLADES_ID = 227;
+ public static int EVERGLADESBIOME_ID = 238;
+ public static int AUSTRALIA_ID = 228;
+ public static int AUSTRALIA_BIOME_DESERT_1_ID = 239;
+ public static int AUSTRALIA_BIOME_DESERT_2_ID = 240;
+ public static int AUSTRALIA_BIOME_DESERT_3_ID = 241;
+ public static int AUSTRALIA_BIOME_PLAINS_ID = 242;
+ public static int AUSTRALIA_BIOME_OUTBACK_ID = 243;
+ public static int AUSTRALIA_BIOME_OCEAN_ID = 244;
+ public static int AUSTRALIA_BIOME_FOREST_ID = 245;
+
+ // GT Vars;
+ public static final int GREG_FIRST_ID = 760;
+ public static final boolean MAIN_GREGTECH_5U_EXPERIMENTAL_FORK = Meta_GT_Proxy.areWeUsingGregtech5uExperimental();
+ public static final int GREGTECH_API_VERSION = GregTech_API.VERSION;
+ public static int turbineCutoffBase = 75000;
+
+ // GT++ Fake Player Profile
+ public static final GameProfile gameProfile =
+ new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]");
+ public static final WeakHashMap<World, EntityPlayerMP> fakePlayerCache = new WeakHashMap<World, EntityPlayerMP>();
+ // Tooltips;
+ public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN + "Alkalus "
+ + EnumChatFormatting.GRAY + "- " + EnumChatFormatting.RED + "[GT++]";
+ public static final String GT_Tooltip_Builder = "" + EnumChatFormatting.DARK_GREEN + "Alkalus "
+ + EnumChatFormatting.GRAY + "- " + EnumChatFormatting.RED + "[GT++]";
+ public static final String GT_Tooltip_Radioactive = EnumChatFormatting.GRAY + "Warning: " + EnumChatFormatting.GREEN
+ + "Radioactive! " + EnumChatFormatting.GOLD + " Avoid direct handling without hazmat protection.";
+ public static final String noItem = "";
+
+ // Because I want to be lazy Gregtech New Horizons Var.
+ public static boolean GTNH = false;
+ // Because I want to be lazy. Beyond Reality Classic Var.
+ public static boolean BRC = false;
+
+ public static final String SEPERATOR = "/";
+
+ /**
+ * Lists/Maps
+ */
+
+ // Burnables List
+ public static List<Pair<Integer, ItemStack>> burnables = new ArrayList<Pair<Integer, ItemStack>>();
+
+ // TesseractMaps
+ public static final Map<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>> sTesseractGeneratorOwnershipMap =
+ new HashMap<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>();
+ public static final Map<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>> sTesseractTerminalOwnershipMap =
+ new HashMap<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>();
+
+ // BookMap
+ public static final Map<String, ItemStack> sBookList = new ConcurrentHashMap<String, ItemStack>();
+
+ /**
+ * Some Gregtech Material and Recipe Variables
+ */
+ @Deprecated
+ public static IGregtech_RecipeAdder sRecipeAdder;
+
+ public static IGregtech_RecipeAdder RA;
+
+ public static final GT_Materials[] sMU_GeneratedMaterials = new GT_Materials[1000];
+
+ /**
+ * 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/",
+ TEX_DIR_FLUIDS = TEX_DIR_BLOCK + "fluids/",
+ RES_PATH = MODID + ":" + TEX_DIR,
+ RES_PATH_GUI = MODID + ":" + TEX_DIR_GUI,
+ RES_PATH_ITEM = MODID + ":" + TEX_DIR_ITEM,
+ RES_PATH_BLOCK = MODID + ":" + TEX_DIR_BLOCK,
+ RES_PATH_ENTITY = MODID + ":" + TEX_DIR_ENTITY,
+ RES_PATH_ASPECTS = MODID + ":" + TEX_DIR_ASPECTS,
+ RES_PATH_FLUIDS = MODID + ":" + TEX_DIR_FLUIDS;
+
+ /** Used to create a {@link EntityPlayer} instance from {@link FakePlayerFactory}.
+ * If this instance already exists in the cache, we will return that instead.
+ * These instances are held via weak reference, if the world object is unloaded, they too will be removed.
+ * This is the suggested way to handle them, as suggested by Forge.
+ *
+ * @param world - The {@link World} object for which you want to check for in the cache.
+ * This object is used as a weak reference in a {@link WeakHashMap}.
+ * @return - An {@link EntityPlayerMP} instance, returned either from cache or created and cached prior to return.
+ */
+ public static EntityPlayerMP getFakePlayer(World world) {
+ if (fakePlayerCache.get(world) == null) {
+ fakePlayerCache.put(world, FakePlayerFactory.get((WorldServer) world, CORE.gameProfile));
+ }
+ return fakePlayerCache.get(world);
+ }
+
+ /*
+ * Config Switch Class
+ */
+
+ public static class ConfigSwitches {
+ // Debug
+ public static boolean disableEnderIOIntegration = false;
+ public static boolean disableEnderIOIngotTooltips = false;
+ public static boolean MACHINE_INFO = true;
+ public static boolean showHiddenNEIItems = false;
+ public static boolean dumpItemAndBlockData = false;
+
+ // Tools
+ public static boolean enableSkookumChoochers = true;
+ public static boolean enableMultiSizeTools = true;
+
+ // Block Drops
+ public static int chanceToDropDrainedShard = 196;
+ public static int chanceToDropFluoriteOre = 32;
+
+ // Machine Related
+ public static boolean enableAlternativeBatteryAlloy = false;
+ public static boolean enableThaumcraftShardUnification = false;
+ public static boolean disableIC2Recipes = false;
+ public static boolean enableAlternativeDivisionSigilRecipe = false;
+ public static int boilerSteamPerSecond = 750;
+ public static final boolean requireControlCores = false;
+
+ // Feature Related
+ public static boolean enableCustomCapes = false;
+ public static boolean enableCustomCircuits = true;
+ public static boolean enableOldGTcircuits = false;
+ public static boolean disableZombieReinforcement = false;
+ public static int enableWatchdogBGM = CORE_Preloader.enableWatchdogBGM;
+ public static boolean hideUniversalCells = true;
+
+ // GT Fixes
+ public static boolean enableNitroFix = false;
+ public static boolean enableSulfuricAcidFix = false;
+ public static boolean enableAnimatedTurbines = true;
+ public static boolean enableHarderRecipesForHighTierCasings = true;
+
+ // Single Block Machines
+ public static boolean enableMachine_SolarGenerators = false;
+ public static boolean enableMachine_Safes = true;
+ public static boolean enableMachine_Dehydrators = true;
+ public static boolean enableMachine_SteamConverter = true;
+ public static boolean enableMachine_FluidTanks = true;
+ public static boolean enableMachine_RocketEngines = true;
+ public static boolean enableMachine_GeothermalEngines = true;
+ public static boolean enableMachine_WorldAccelerators = true;
+ public static boolean enableMachine_Tesseracts = true;
+ public static boolean enableMachine_SimpleWasher = true;
+ public static boolean enableMachine_Pollution = true;
+ public static boolean enableMachine_ComponentAssemblers = false;
+ public static boolean enableCustom_Pipes = true;
+ public static boolean enableCustom_Cables = true;
+ public static boolean enableMachine_RF_Convetor = false;
+
+ // Multiblocks
+ public static boolean enableMultiblock_AlloyBlastSmelter = true;
+ public static boolean enableMultiblock_IndustrialCentrifuge = true;
+ public static boolean enableMultiblock_IndustrialCokeOven = true;
+ public static boolean enableMultiblock_IndustrialElectrolyzer = true;
+ public static boolean enableMultiblock_IndustrialMacerationStack = true;
+ public static boolean enableMultiblock_IndustrialPlatePress = true;
+ public static boolean enableMultiblock_IndustrialWireMill = true;
+ public static boolean enableMultiblock_IronBlastFurnace = true;
+ public static boolean enableMultiblock_MatterFabricator = true;
+ public static boolean enableMultiblock_MultiTank = true;
+ public static boolean enableMultiblock_PowerSubstation = true;
+ public static boolean enableMultiblock_LiquidFluorideThoriumReactor = true;
+ public static boolean enableMultiblock_NuclearFuelRefinery = true;
+ public static boolean enableMultiblock_TreeFarmer = true;
+ public static boolean enableMultiblock_IndustrialSifter = true;
+ public static boolean enableMultiblock_IndustrialThermalCentrifuge = true;
+ public static boolean enableMultiblock_IndustrialWashPlant = true;
+ public static boolean enableMultiblock_LargeAutoCrafter = true;
+ public static boolean enableMultiblock_ThermalBoiler = true;
+ public static boolean enableMultiblock_IndustrialCuttingMachine = true;
+ public static boolean enableMultiblock_IndustrialFishingPort = true;
+ public static boolean enableMultiblock_IndustrialExtrudingMachine = true;
+ public static boolean enableMultiblock_IndustrialMultiMachine = true;
+ public static boolean enableMultiblock_Cyclotron = true;
+
+ // Visuals
+ public static boolean enableTreeFarmerParticles = true;
+ public static boolean useGregtechTextures = true;
+
+ // Pollution
+ public static int pollutionPerSecondMultiPackager = 40;
+ public static int pollutionPerSecondMultiIndustrialAlloySmelter = 300;
+ public static int pollutionPerSecondMultiIndustrialArcFurnace = 2400;
+ public static int pollutionPerSecondMultiIndustrialCentrifuge = 300;
+ public static int pollutionPerSecondMultiIndustrialCokeOven = 80;
+ public static int pollutionPerSecondMultiIndustrialCuttingMachine = 160;
+ public static int pollutionPerSecondMultiIndustrialDehydrator = 500;
+ public static int pollutionPerSecondMultiIndustrialElectrolyzer = 300;
+ public static int pollutionPerSecondMultiIndustrialExtruder = 1000;
+ public static int pollutionPerSecondMultiIndustrialMacerator = 400;
+ public static int pollutionPerSecondMultiIndustrialMixer = 800;
+ public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal = 400;
+ public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid = 400;
+ public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = 600;
+ public static int pollutionPerSecondMultiIndustrialPlatePress_ModeForming = 240;
+ public static int pollutionPerSecondMultiIndustrialPlatePress_ModeBending = 480;
+ public static int pollutionPerSecondMultiIndustrialForgeHammer = 250;
+ public static int pollutionPerSecondMultiIndustrialSifter = 40;
+ public static int pollutionPerSecondMultiIndustrialThermalCentrifuge = 1000;
+ public static int pollutionPerSecondMultiIndustrialVacuumFreezer = 500;
+ public static int pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath = 400;
+ public static int pollutionPerSecondMultiIndustrialWashPlant_ModeWasher = 100;
+ public static int pollutionPerSecondMultiIndustrialWireMill = 100;
+ public static int pollutionPerSecondMultiIsaMill = 1280;
+ public static int pollutionPerSecondMultiAdvDistillationTower_ModeDistillery = 240;
+ public static int pollutionPerSecondMultiAdvDistillationTower_ModeDT = 480;
+ public static int pollutionPerSecondMultiAdvEBF = 500;
+ public static int pollutionPerSecondMultiAdvImplosion = 5000;
+ public static int pollutionPerSecondMultiABS = 200;
+ public static int pollutionPerSecondMultiCyclotron = 200;
+ public static int pollutionPerSecondMultiIndustrialFishingPond = 20;
+ public static int pollutionPerSecondMultiLargeRocketEngine;
+ public static int pollutionPerSecondMultiLargeSemiFluidGenerator = 1280;
+ public static int pollutionPerSecondMultiMassFabricator = 40;
+ public static int pollutionPerSecondMultiRefinery = 4000;
+ public static int pollutionPerSecondMultiGeneratorArray;
+ public static int pollutionPerSecondMultiTreeFarm = 100;
+ public static int pollutionPerSecondMultiFrothFlotationCell = 0;
+ public static int pollutionPerSecondMultiAutoCrafter = 500;
+ public static int pollutionPerSecondMultiThermalBoiler = 700;
+ public static int pollutionPerSecondMultiMolecularTransformer = 1000;
+ public static int pollutionPerSecondMultiAlgaePond = 0;
+ public static int pollutionPerSecondMultiIndustrialRockBreaker = 100;
+ public static int pollutionPerSecondMultiIndustrialChisel = 50;
+ // pollution single blocks
+ public static int basePollutionPerSecondSemiFluidGenerator = 40;
+ public static double[] pollutionReleasedByTierSemiFluidGenerator = new double[] {0, 2.0, 4.0, 8.0};
+ public static int basePollutionPerSecondBoiler = 35;
+ public static double[] pollutionReleasedByTierBoiler = new double[] {0, 1.0, 1.43, 1.86};
+ public static int baseMinPollutionPerSecondRocketFuelGenerator = 250;
+ public static int baseMaxPollutionPerSecondRocketFuelGenerator = 2000;
+ public static double[] pollutionReleasedByTierRocketFuelGenerator = new double[] {0, 0, 0, 0, 1, 2, 3};
+ public static int basePollutionPerSecondGeothermalGenerator = 100;
+ public static double[] pollutionReleasedByTierGeothermalGenerator = new double[] {0, 0, 0, 0, 1, 1, 1};
+ }
+
+ public static class Everglades {
+ public static final String MODID = "ToxicEverglades";
+ public static final String NAME = "GT++ Toxic Everglades";
+ public static final String VERSION = "GRADLETOKEN_VERSION";
+ }
+
+ public static class Australia {
+ public static final String MODID = "Australia";
+ public static final String NAME = "GT++ Australia";
+ public static final String VERSION = "GRADLETOKEN_VERSION";
+ }
+
+ public static final void crash() {
+ crash("Generic Crash");
+ }
+
+ public static final void crash(String aReason) {
+ try {
+ Logger.INFO("==========================================================");
+ Logger.INFO("[GT++ CRASH]");
+ Logger.INFO("==========================================================");
+ Logger.INFO("Oooops...");
+ Logger.INFO("This should only happy in a development environment or when something really bad happens.");
+ Logger.INFO("Reason: " + aReason);
+ Logger.INFO("==========================================================");
+ Logger.INFO("Called from: " + ReflectionUtils.getMethodName(1));
+ Logger.INFO(ReflectionUtils.getMethodName(2));
+ Logger.INFO(ReflectionUtils.getMethodName(3));
+ Logger.INFO(ReflectionUtils.getMethodName(4));
+ Logger.INFO(ReflectionUtils.getMethodName(5));
+ Logger.INFO(ReflectionUtils.getMethodName(6));
+ Logger.INFO(ReflectionUtils.getMethodName(7));
+ Logger.INFO(ReflectionUtils.getMethodName(8));
+ Logger.INFO(ReflectionUtils.getMethodName(9));
+ Logger.INFO(ReflectionUtils.getMethodName(10));
+ Logger.INFO(ReflectionUtils.getMethodName(11));
+ Logger.INFO(ReflectionUtils.getMethodName(12));
+ Logger.INFO(ReflectionUtils.getMethodName(13));
+ Logger.INFO(ReflectionUtils.getMethodName(14));
+ Logger.INFO(ReflectionUtils.getMethodName(15));
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ FMLCommonHandler.instance().exitJava(0, true);
+ }
+
+ public static final void gc() {
+ System.gc();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java
index 94be6f4127..43822f868e 100644
--- a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java
+++ b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java
@@ -2,381 +2,382 @@ package gtPlusPlus.core.lib;
import static gtPlusPlus.core.lib.CORE.*;
-import java.util.HashMap;
-
import cpw.mods.fml.common.Loader;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechTextures;
import gtPlusPlus.xmod.gregtech.recipes.GregtechRecipeAdder;
+import java.util.HashMap;
public class LoadedMods {
- //Initialize Variables
- public static boolean Gregtech = false;
- public static boolean PlayerAPI = false;
- public static boolean BuildCraft = false;
- public static boolean EnderIO = false;
- public static boolean Big_Reactors = false;
- public static boolean IndustrialCraft2 = false;
- public static boolean IndustrialCraft2Classic = false;
- public static boolean Simply_Jetpacks = false;
- public static boolean RFTools = false;
- public static boolean Thaumcraft = false;
- public static boolean ThaumicBases = false;
- public static boolean Baubles = false;
- public static boolean Extra_Utils = false;
- public static boolean PneumaticCraft = false;
- public static boolean MorePlanets = false;
- public static boolean ForbiddenMagic = false;
- public static boolean CompactWindmills = false;
- public static boolean Railcraft = false;
- public static boolean ImmersiveEngineering = false;
- public static boolean Growthcraft = false;
- public static boolean CoFHCore = false;
- public static boolean Forestry = false;
- public static boolean MagicBees = false;
- public static boolean ExtraBees = false;
- public static boolean Psychedelicraft = false;
- public static boolean MiscUtils = true; //Dummy For MetaData Lookups in MT Wrapper
- public static boolean ThermalFoundation = false;
- public static boolean IHL = false;
- public static boolean AdvancedSolarPanel = false;
- public static boolean OpenComputers = false; //OpenComputers
- public static boolean OpenBlocks = false;
- public static boolean Computronics = false; //computronics
- public static boolean DreamCraft = false; //GT: New Horizons
- public static boolean BeyondRealityCore = false; //Beyond Reality - Probably Classic
- public static boolean BiomesOPlenty = false;
- public static boolean PamsHarvestcraft = false;
- public static boolean GalacticraftCore = false;
- public static boolean Mekanism = false;
- public static boolean RedTech = false; //RedMage's Mod
- public static boolean TecTech = false; //Technus' Mod
- public static boolean KekzTech = false; //KekzDealers' Mod
- public static boolean TiCon = false;
- public static boolean StevesCarts = false;
- public static boolean Witchery = false;
- public static boolean Waila = false;
- public static boolean CropsPlusPlus = false; //Barts Crop Mod
- public static boolean Reliquary = false;
- public static boolean SpiceOfLife = false;
- public static boolean RemoteIO = false;
- public static boolean BartWorks = false;
- public static boolean GoodGenerator = false;
- public static boolean ExtraTrees = false;
+ // Initialize Variables
+ public static boolean Gregtech = false;
+ public static boolean PlayerAPI = false;
+ public static boolean BuildCraft = false;
+ public static boolean EnderIO = false;
+ public static boolean Big_Reactors = false;
+ public static boolean IndustrialCraft2 = false;
+ public static boolean IndustrialCraft2Classic = false;
+ public static boolean Simply_Jetpacks = false;
+ public static boolean RFTools = false;
+ public static boolean Thaumcraft = false;
+ public static boolean ThaumicBases = false;
+ public static boolean Baubles = false;
+ public static boolean Extra_Utils = false;
+ public static boolean PneumaticCraft = false;
+ public static boolean MorePlanets = false;
+ public static boolean ForbiddenMagic = false;
+ public static boolean CompactWindmills = false;
+ public static boolean Railcraft = false;
+ public static boolean ImmersiveEngineering = false;
+ public static boolean Growthcraft = false;
+ public static boolean CoFHCore = false;
+ public static boolean Forestry = false;
+ public static boolean MagicBees = false;
+ public static boolean ExtraBees = false;
+ public static boolean Psychedelicraft = false;
+ public static boolean MiscUtils = true; // Dummy For MetaData Lookups in MT Wrapper
+ public static boolean ThermalFoundation = false;
+ public static boolean IHL = false;
+ public static boolean AdvancedSolarPanel = false;
+ public static boolean OpenComputers = false; // OpenComputers
+ public static boolean OpenBlocks = false;
+ public static boolean Computronics = false; // computronics
+ public static boolean DreamCraft = false; // GT: New Horizons
+ public static boolean BeyondRealityCore = false; // Beyond Reality - Probably Classic
+ public static boolean BiomesOPlenty = false;
+ public static boolean PamsHarvestcraft = false;
+ public static boolean GalacticraftCore = false;
+ public static boolean Mekanism = false;
+ public static boolean RedTech = false; // RedMage's Mod
+ public static boolean TecTech = false; // Technus' Mod
+ public static boolean KekzTech = false; // KekzDealers' Mod
+ public static boolean TiCon = false;
+ public static boolean StevesCarts = false;
+ public static boolean Witchery = false;
+ public static boolean Waila = false;
+ public static boolean CropsPlusPlus = false; // Barts Crop Mod
+ public static boolean Reliquary = false;
+ public static boolean SpiceOfLife = false;
+ public static boolean RemoteIO = false;
+ public static boolean BartWorks = false;
+ public static boolean GoodGenerator = false;
+ public static boolean ExtraTrees = false;
- private static int totalMods;
- @SuppressWarnings("deprecation")
- public static void checkLoaded(){
- Logger.INFO("Looking for optional mod prereqs.");
- if (isModLoaded("gregtech") ){
- Gregtech = true;
- Logger.INFO("Components enabled for: Gregtech");
- if (Gregtech){
- try {
- CORE.sRecipeAdder = CORE.RA = new GregtechRecipeAdder();
- Logger.INFO("Created Gregtech recipe handler.");
- GregtechTextures.BlockIcons.VOID.name();
- GregtechTextures.ItemIcons.VOID.name();
- Logger.INFO("Created Gregtech texture handler.");
- } catch (final NullPointerException e){
- Logger.INFO("Could NOT create a Gregtech recipe handler.");
- }
- }
+ private static int totalMods;
- totalMods++;
- }
- if (isModLoaded("dreamcraft") || ReflectionUtils.doesClassExist("gregtech.api.util.GT_Multiblock_Tooltip_Builder")){
- DreamCraft = true;
- GTNH = true;
- Logger.INFO("Components enabled for: DreamCraft");
- Logger.INFO("Components enabled for: GT: New Horizons");
- totalMods++;
- }
- if (isModLoaded("beyondrealitycore")){
- BeyondRealityCore = true;
- BRC = true;
- Logger.INFO("Components enabled for: Beyond Reality");
- totalMods++;
- }
- if (isModLoaded("PlayerAPI")){
- PlayerAPI = true;
- Logger.INFO("Components enabled for: PlayerAPI");
- totalMods++;
- }
- if (isModLoaded("berriespp")) {
- CropsPlusPlus = true;
- Logger.INFO("Components enabled for: Crops++");
- totalMods++;
- }
- if (isModLoaded("xreliquary")) {
- Reliquary = true;
- Logger.INFO("Components enabled for: Reliquary");
- totalMods++;
- }
- if (isModLoaded("TConstruct")){
- TiCon = true;
- Logger.INFO("Components enabled for: Tinkers Construct");
- totalMods++;
- }
- if (isModLoaded("AdvancedSolarPanel")){
- AdvancedSolarPanel = true;
- Logger.INFO("Components enabled for: Advanced Solar Panels");
- totalMods++;
- }
- if (isModLoaded("GoodGenerator")) {
- GoodGenerator = true;
- Logger.INFO("Components enabled for: GoodGenerator");
- totalMods++;
- }
- if (isModLoaded("bartworks")) {
- BartWorks = true;
- Logger.INFO("Components enabled for: BartWorks");
- totalMods++;
- }
- if (isModLoaded("BuildCraft")){
- BuildCraft = true;
- Logger.INFO("Components enabled for: BuildCraft");
- totalMods++;
- }
- if ((isModLoaded("EnderIO")) && !ConfigSwitches.disableEnderIOIntegration){
- EnderIO = true;
- Logger.INFO("Components enabled for: EnderIO");
- totalMods++;
- }
- if (isModLoaded("BigReactors")){
- Big_Reactors = true;
- Logger.INFO("Components enabled for: Big Reactors");
- totalMods++;
- }
- if (isModLoaded("IC2")){
- IndustrialCraft2 = true;
- Logger.INFO("Components enabled for: IndustrialCraft2");
- totalMods++;
- }
- if (isModLoaded("IC2-Classic-Spmod")){
- IndustrialCraft2Classic = true;
- Logger.INFO("Components enabled for: IndustrialCraft2-Classic");
- totalMods++;
- }
- if (isModLoaded("simplyjetpacks")){
- Simply_Jetpacks = true;
- Logger.INFO("Components enabled for: Simply Jetpacks");
- totalMods++;
- }
- if (isModLoaded("rftools")){
- RFTools = true;
- Logger.INFO("Components enabled for: RFTools");
- totalMods++;
- }
- if (isModLoaded("StevesCarts")){
- StevesCarts = true;
- Logger.INFO("Components enabled for: StevesCarts");
- totalMods++;
- }
- if (isModLoaded("OpenBlocks")){
- OpenBlocks = true;
- Logger.INFO("Components enabled for: OpenBlocks");
- totalMods++;
- }
- if (isModLoaded("Thaumcraft")){
- Thaumcraft = true;
- Logger.INFO("Components enabled for: Thaumcraft");
- totalMods++;
- }
- if (isModLoaded("thaumicbases")){
- ThaumicBases = true;
- Logger.INFO("Components enabled for: Thaumic Bases");
- totalMods++;
- }
- if (isModLoaded("BiomesOPlenty")){
- BiomesOPlenty = true;
- Logger.INFO("Components enabled for: BiomesOPlenty");
- totalMods++;
- }
- if (isModLoaded("ExtraUtilities")){
- Extra_Utils = true;
- Logger.INFO("Components enabled for: Extra_Utils");
- totalMods++;
- }
- if (isModLoaded("harvestcraft")){
- PamsHarvestcraft = true;
- Logger.INFO("Components enabled for: PamsHarvestcraft");
- totalMods++;
- }
- if (isModLoaded("PneumaticCraft")){
- PneumaticCraft = true;
- Logger.INFO("Components enabled for: PneumaticCraft");
- totalMods++;
- }
- if (isModLoaded("MorePlanet")){
- MorePlanets = true;
- Logger.INFO("Components enabled for: MorePlanets");
- totalMods++;
- }
- if (isModLoaded("ForbiddenMagic")){
- ForbiddenMagic = true;
- Logger.INFO("Components enabled for: ForbiddenMagic");
- totalMods++;
- }
- if (isModLoaded("CompactWindmills")){
- CompactWindmills = true;
- Logger.INFO("Components enabled for: CompactWindmills");
- totalMods++;
- }
- if (isModLoaded("Railcraft")){
- Railcraft = true;
- Logger.INFO("Components enabled for: Railcraft");
- totalMods++;
- }
- if (isModLoaded("Waila")){
- Waila = true;
- Logger.INFO("Components enabled for: WAILA");
- totalMods++;
- }
- if (isModLoaded("SpiceOfLife")){
- SpiceOfLife = true;
- Logger.INFO("Components enabled for: Spice Of Life");
- totalMods++;
- }
- if (isModLoaded("Mekanism")){
- Mekanism = true;
- Logger.INFO("Components enabled for: Mekanism - This feature is not configurable and balances Mekanism to suit GT.");
- totalMods++;
- }
- if (isModLoaded("Growthcraft")){
- Logger.INFO("Growthcraft Version: "+getModVersion("Growthcraft"));
- if (getModVersion("Growthcraft").equals("1.7.10-2.3.1")){
- //Load Growthcraft Compat
- Growthcraft = true;
- Logger.INFO("Components enabled for: Growthcraft");
- totalMods++;
- }
- else {
- Growthcraft = false;
- Logger.INFO("Growthcraft found, but the version was too new. I will update GC support eventually.");
- }
- }
- if (isModLoaded("CoFHCore")){
- CoFHCore = true;
- Logger.INFO("Components enabled for: CoFHCore");
- totalMods++;
- }
- if (isModLoaded("Forestry")){
- Forestry = true;
- Logger.INFO("Components enabled for: Forestry");
- totalMods++;
- }
- if (isModLoaded("MagicBees")){
- MagicBees = true;
- Logger.INFO("Components enabled for: MagicBees");
- totalMods++;
- }
- if (isModLoaded("psychedelicraft")){
- Psychedelicraft = true;
- Logger.INFO("Components enabled for: Psychedelicraft");
- totalMods++;
- }
- if (isModLoaded("ImmersiveEngineering")){
- ImmersiveEngineering = true;
- Logger.INFO("Components enabled for: ImmersiveEngineering");
- totalMods++;
- }
- if (isModLoaded("ExtraBees")){
- ExtraBees = true;
- Logger.INFO("Components enabled for: ExtraBees");
- totalMods++;
- }
- if (isModLoaded("ThermalFoundation") == false){
- ThermalFoundation = false;
- Logger.INFO("Components enabled for: ThermalFoundation - This feature will disable itself if you add TF.");
- totalMods++;
- }
- else if (isModLoaded("ThermalFoundation")){
- ThermalFoundation = true;
- Logger.INFO("Components disabled for: ThermalFoundation - This feature will enable itself if you remove TF.");
- //totalMods++;
- }
- if (isModLoaded("ihl")){
- IHL = true;
- Logger.INFO("Components enabled for: IHL");
- totalMods++;
- }
- if (isModLoaded("Baubles")){
- Baubles = true;
- Logger.INFO("Components enabled for: Baubles");
- totalMods++;
- }
- if (isModLoaded("GalacticraftCore")){
- GalacticraftCore = true;
- Logger.INFO("Components enabled for: Galacticraft Core");
- totalMods++;
- }
- if (isModLoaded("OpenComputers")){
- OpenComputers = true;
- Logger.INFO("Components enabled for: OpenComputers");
- totalMods++;
- }
- if (isModLoaded("computronics")){
- Computronics = true;
- Logger.INFO("Components disabled for: Computronics - This feature will enable itself if you remove Computronics.");
- totalMods++;
- }
- else {
- Logger.INFO("Components enabled for: Computronics - This feature will disable itself if you add Computronics.");
- }
- if (isModLoaded("GTRedtech")){
- RedTech = true;
- Logger.INFO("Components enabled for: GTRedtech");
- totalMods++;
- }
- if (isModLoaded("tectech")){
- TecTech = true;
- Logger.INFO("Components enabled for: TecTech");
- totalMods++;
- }
- if (isModLoaded("kekztech")){
- KekzTech = true;
- Logger.INFO("Components enabled for: KekzTech");
- totalMods++;
- }
- if (isModLoaded("witchery")){
- Witchery = true;
- Logger.INFO("Components enabled for: Witchery");
- totalMods++;
- }
- if (isModLoaded("RIO")){
- RemoteIO = true;
- Logger.INFO("Components enabled for: RemoteIO");
- totalMods++;
- }
- if (isModLoaded("ExtraTrees")){
- ExtraTrees = true;
- Logger.INFO("Components enabled for: ExtraTrees");
- totalMods++;
- }
- Logger.INFO("Content found for "+totalMods+" mods");
+ @SuppressWarnings("deprecation")
+ public static void checkLoaded() {
+ Logger.INFO("Looking for optional mod prereqs.");
+ if (isModLoaded("gregtech")) {
+ Gregtech = true;
+ Logger.INFO("Components enabled for: Gregtech");
+ if (Gregtech) {
+ try {
+ CORE.sRecipeAdder = CORE.RA = new GregtechRecipeAdder();
+ Logger.INFO("Created Gregtech recipe handler.");
+ GregtechTextures.BlockIcons.VOID.name();
+ GregtechTextures.ItemIcons.VOID.name();
+ Logger.INFO("Created Gregtech texture handler.");
+ } catch (final NullPointerException e) {
+ Logger.INFO("Could NOT create a Gregtech recipe handler.");
+ }
+ }
- }
+ totalMods++;
+ }
+ if (isModLoaded("dreamcraft")
+ || ReflectionUtils.doesClassExist("gregtech.api.util.GT_Multiblock_Tooltip_Builder")) {
+ DreamCraft = true;
+ GTNH = true;
+ Logger.INFO("Components enabled for: DreamCraft");
+ Logger.INFO("Components enabled for: GT: New Horizons");
+ totalMods++;
+ }
+ if (isModLoaded("beyondrealitycore")) {
+ BeyondRealityCore = true;
+ BRC = true;
+ Logger.INFO("Components enabled for: Beyond Reality");
+ totalMods++;
+ }
+ if (isModLoaded("PlayerAPI")) {
+ PlayerAPI = true;
+ Logger.INFO("Components enabled for: PlayerAPI");
+ totalMods++;
+ }
+ if (isModLoaded("berriespp")) {
+ CropsPlusPlus = true;
+ Logger.INFO("Components enabled for: Crops++");
+ totalMods++;
+ }
+ if (isModLoaded("xreliquary")) {
+ Reliquary = true;
+ Logger.INFO("Components enabled for: Reliquary");
+ totalMods++;
+ }
+ if (isModLoaded("TConstruct")) {
+ TiCon = true;
+ Logger.INFO("Components enabled for: Tinkers Construct");
+ totalMods++;
+ }
+ if (isModLoaded("AdvancedSolarPanel")) {
+ AdvancedSolarPanel = true;
+ Logger.INFO("Components enabled for: Advanced Solar Panels");
+ totalMods++;
+ }
+ if (isModLoaded("GoodGenerator")) {
+ GoodGenerator = true;
+ Logger.INFO("Components enabled for: GoodGenerator");
+ totalMods++;
+ }
+ if (isModLoaded("bartworks")) {
+ BartWorks = true;
+ Logger.INFO("Components enabled for: BartWorks");
+ totalMods++;
+ }
+ if (isModLoaded("BuildCraft")) {
+ BuildCraft = true;
+ Logger.INFO("Components enabled for: BuildCraft");
+ totalMods++;
+ }
+ if ((isModLoaded("EnderIO")) && !ConfigSwitches.disableEnderIOIntegration) {
+ EnderIO = true;
+ Logger.INFO("Components enabled for: EnderIO");
+ totalMods++;
+ }
+ if (isModLoaded("BigReactors")) {
+ Big_Reactors = true;
+ Logger.INFO("Components enabled for: Big Reactors");
+ totalMods++;
+ }
+ if (isModLoaded("IC2")) {
+ IndustrialCraft2 = true;
+ Logger.INFO("Components enabled for: IndustrialCraft2");
+ totalMods++;
+ }
+ if (isModLoaded("IC2-Classic-Spmod")) {
+ IndustrialCraft2Classic = true;
+ Logger.INFO("Components enabled for: IndustrialCraft2-Classic");
+ totalMods++;
+ }
+ if (isModLoaded("simplyjetpacks")) {
+ Simply_Jetpacks = true;
+ Logger.INFO("Components enabled for: Simply Jetpacks");
+ totalMods++;
+ }
+ if (isModLoaded("rftools")) {
+ RFTools = true;
+ Logger.INFO("Components enabled for: RFTools");
+ totalMods++;
+ }
+ if (isModLoaded("StevesCarts")) {
+ StevesCarts = true;
+ Logger.INFO("Components enabled for: StevesCarts");
+ totalMods++;
+ }
+ if (isModLoaded("OpenBlocks")) {
+ OpenBlocks = true;
+ Logger.INFO("Components enabled for: OpenBlocks");
+ totalMods++;
+ }
+ if (isModLoaded("Thaumcraft")) {
+ Thaumcraft = true;
+ Logger.INFO("Components enabled for: Thaumcraft");
+ totalMods++;
+ }
+ if (isModLoaded("thaumicbases")) {
+ ThaumicBases = true;
+ Logger.INFO("Components enabled for: Thaumic Bases");
+ totalMods++;
+ }
+ if (isModLoaded("BiomesOPlenty")) {
+ BiomesOPlenty = true;
+ Logger.INFO("Components enabled for: BiomesOPlenty");
+ totalMods++;
+ }
+ if (isModLoaded("ExtraUtilities")) {
+ Extra_Utils = true;
+ Logger.INFO("Components enabled for: Extra_Utils");
+ totalMods++;
+ }
+ if (isModLoaded("harvestcraft")) {
+ PamsHarvestcraft = true;
+ Logger.INFO("Components enabled for: PamsHarvestcraft");
+ totalMods++;
+ }
+ if (isModLoaded("PneumaticCraft")) {
+ PneumaticCraft = true;
+ Logger.INFO("Components enabled for: PneumaticCraft");
+ totalMods++;
+ }
+ if (isModLoaded("MorePlanet")) {
+ MorePlanets = true;
+ Logger.INFO("Components enabled for: MorePlanets");
+ totalMods++;
+ }
+ if (isModLoaded("ForbiddenMagic")) {
+ ForbiddenMagic = true;
+ Logger.INFO("Components enabled for: ForbiddenMagic");
+ totalMods++;
+ }
+ if (isModLoaded("CompactWindmills")) {
+ CompactWindmills = true;
+ Logger.INFO("Components enabled for: CompactWindmills");
+ totalMods++;
+ }
+ if (isModLoaded("Railcraft")) {
+ Railcraft = true;
+ Logger.INFO("Components enabled for: Railcraft");
+ totalMods++;
+ }
+ if (isModLoaded("Waila")) {
+ Waila = true;
+ Logger.INFO("Components enabled for: WAILA");
+ totalMods++;
+ }
+ if (isModLoaded("SpiceOfLife")) {
+ SpiceOfLife = true;
+ Logger.INFO("Components enabled for: Spice Of Life");
+ totalMods++;
+ }
+ if (isModLoaded("Mekanism")) {
+ Mekanism = true;
+ Logger.INFO(
+ "Components enabled for: Mekanism - This feature is not configurable and balances Mekanism to suit GT.");
+ totalMods++;
+ }
+ if (isModLoaded("Growthcraft")) {
+ Logger.INFO("Growthcraft Version: " + getModVersion("Growthcraft"));
+ if (getModVersion("Growthcraft").equals("1.7.10-2.3.1")) {
+ // Load Growthcraft Compat
+ Growthcraft = true;
+ Logger.INFO("Components enabled for: Growthcraft");
+ totalMods++;
+ } else {
+ Growthcraft = false;
+ Logger.INFO("Growthcraft found, but the version was too new. I will update GC support eventually.");
+ }
+ }
+ if (isModLoaded("CoFHCore")) {
+ CoFHCore = true;
+ Logger.INFO("Components enabled for: CoFHCore");
+ totalMods++;
+ }
+ if (isModLoaded("Forestry")) {
+ Forestry = true;
+ Logger.INFO("Components enabled for: Forestry");
+ totalMods++;
+ }
+ if (isModLoaded("MagicBees")) {
+ MagicBees = true;
+ Logger.INFO("Components enabled for: MagicBees");
+ totalMods++;
+ }
+ if (isModLoaded("psychedelicraft")) {
+ Psychedelicraft = true;
+ Logger.INFO("Components enabled for: Psychedelicraft");
+ totalMods++;
+ }
+ if (isModLoaded("ImmersiveEngineering")) {
+ ImmersiveEngineering = true;
+ Logger.INFO("Components enabled for: ImmersiveEngineering");
+ totalMods++;
+ }
+ if (isModLoaded("ExtraBees")) {
+ ExtraBees = true;
+ Logger.INFO("Components enabled for: ExtraBees");
+ totalMods++;
+ }
+ if (isModLoaded("ThermalFoundation") == false) {
+ ThermalFoundation = false;
+ Logger.INFO("Components enabled for: ThermalFoundation - This feature will disable itself if you add TF.");
+ totalMods++;
+ } else if (isModLoaded("ThermalFoundation")) {
+ ThermalFoundation = true;
+ Logger.INFO(
+ "Components disabled for: ThermalFoundation - This feature will enable itself if you remove TF.");
+ // totalMods++;
+ }
+ if (isModLoaded("ihl")) {
+ IHL = true;
+ Logger.INFO("Components enabled for: IHL");
+ totalMods++;
+ }
+ if (isModLoaded("Baubles")) {
+ Baubles = true;
+ Logger.INFO("Components enabled for: Baubles");
+ totalMods++;
+ }
+ if (isModLoaded("GalacticraftCore")) {
+ GalacticraftCore = true;
+ Logger.INFO("Components enabled for: Galacticraft Core");
+ totalMods++;
+ }
+ if (isModLoaded("OpenComputers")) {
+ OpenComputers = true;
+ Logger.INFO("Components enabled for: OpenComputers");
+ totalMods++;
+ }
+ if (isModLoaded("computronics")) {
+ Computronics = true;
+ Logger.INFO(
+ "Components disabled for: Computronics - This feature will enable itself if you remove Computronics.");
+ totalMods++;
+ } else {
+ Logger.INFO(
+ "Components enabled for: Computronics - This feature will disable itself if you add Computronics.");
+ }
+ if (isModLoaded("GTRedtech")) {
+ RedTech = true;
+ Logger.INFO("Components enabled for: GTRedtech");
+ totalMods++;
+ }
+ if (isModLoaded("tectech")) {
+ TecTech = true;
+ Logger.INFO("Components enabled for: TecTech");
+ totalMods++;
+ }
+ if (isModLoaded("kekztech")) {
+ KekzTech = true;
+ Logger.INFO("Components enabled for: KekzTech");
+ totalMods++;
+ }
+ if (isModLoaded("witchery")) {
+ Witchery = true;
+ Logger.INFO("Components enabled for: Witchery");
+ totalMods++;
+ }
+ if (isModLoaded("RIO")) {
+ RemoteIO = true;
+ Logger.INFO("Components enabled for: RemoteIO");
+ totalMods++;
+ }
+ if (isModLoaded("ExtraTrees")) {
+ ExtraTrees = true;
+ Logger.INFO("Components enabled for: ExtraTrees");
+ totalMods++;
+ }
+ Logger.INFO("Content found for " + totalMods + " mods");
+ }
- public static String getModVersion(final String modName){
- final String ver = cpw.mods.fml.common.FMLCommonHandler.instance().findContainerFor(modName).getVersion();
- return ver;
- }
-
- private static final HashMap<String, Boolean> mLoadedModCache = new HashMap<String, Boolean>();
+ public static String getModVersion(final String modName) {
+ final String ver = cpw.mods.fml.common.FMLCommonHandler.instance()
+ .findContainerFor(modName)
+ .getVersion();
+ return ver;
+ }
- public static boolean isModLoaded(String aModName) {
- Boolean aResult = mLoadedModCache.get(aModName);
- if (aResult == null) {
- boolean aTemp = Loader.isModLoaded(aModName);
- mLoadedModCache.put(aModName, aTemp);
- aResult = aTemp;
- }
- return aResult;
- }
+ private static final HashMap<String, Boolean> mLoadedModCache = new HashMap<String, Boolean>();
+ public static boolean isModLoaded(String aModName) {
+ Boolean aResult = mLoadedModCache.get(aModName);
+ if (aResult == null) {
+ boolean aTemp = Loader.isModLoaded(aModName);
+ mLoadedModCache.put(aModName, aTemp);
+ aResult = aTemp;
+ }
+ return aResult;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/lib/VanillaColours.java b/src/main/java/gtPlusPlus/core/lib/VanillaColours.java
index 9a7a82cb1f..19e9d1c735 100644
--- a/src/main/java/gtPlusPlus/core/lib/VanillaColours.java
+++ b/src/main/java/gtPlusPlus/core/lib/VanillaColours.java
@@ -3,26 +3,39 @@ package gtPlusPlus.core.lib;
import gtPlusPlus.core.util.Utils;
public enum VanillaColours {
+ BONE_MEAL(249, 255, 254),
+ INK_BLACK(29, 29, 33),
+ COCOA_BEANS(131, 84, 50),
+ LAPIS_LAZULI(60, 68, 170),
+ DYE_WHITE(249, 255, 254),
+ DYE_BLACK(29, 29, 33),
+ DYE_RED(176, 46, 38),
+ DYE_GREEN(94, 124, 22),
+ DYE_CYAN(22, 156, 156),
+ DYE_PINK(243, 139, 170),
+ DYE_LIME(128, 199, 31),
+ DYE_YELLOW(254, 216, 61),
+ DYE_ORANGE(249, 128, 29),
+ DYE_BROWN(131, 84, 50),
+ DYE_LIGHT_BLUE(58, 179, 218),
+ DYE_LIGHT_PURPLE(199, 78, 189),
+ DYE_LIGHT_GRAY(157, 157, 151),
+ DYE_DARK_BLUE(60, 68, 170),
+ DYE_DARK_PURPLE(137, 50, 184),
+ DYE_DARK_GRAY(71, 79, 82);
+ private final int r, g, b;
- BONE_MEAL(249, 255, 254), INK_BLACK(29, 29, 33), COCOA_BEANS(131, 84, 50), LAPIS_LAZULI(60, 68, 170),
- DYE_WHITE(249, 255, 254), DYE_BLACK(29, 29, 33), DYE_RED(176, 46, 38), DYE_GREEN(94, 124, 22),
- DYE_CYAN(22, 156, 156), DYE_PINK(243, 139, 170), DYE_LIME(128, 199, 31), DYE_YELLOW(254, 216, 61),
- DYE_ORANGE(249, 128, 29), DYE_BROWN(131, 84, 50), DYE_LIGHT_BLUE(58, 179, 218), DYE_LIGHT_PURPLE(199, 78, 189),
- DYE_LIGHT_GRAY(157, 157, 151), DYE_DARK_BLUE(60, 68, 170), DYE_DARK_PURPLE(137, 50, 184), DYE_DARK_GRAY(71, 79, 82);
+ private VanillaColours(int aR, int aG, int aB) {
+ r = aR;
+ g = aG;
+ b = aB;
+ }
- private final int r, g, b;
+ public short[] getAsShort() {
+ return new short[] {(short) r, (short) g, (short) b};
+ }
- private VanillaColours(int aR, int aG, int aB) {
- r = aR;
- g = aG;
- b = aB;
- }
-
- public short[] getAsShort() {
- return new short[] { (short) r, (short) g, (short) b };
- }
-
- public int getAsInt() {
- return Utils.rgbtoHexValue(r, g, b);
- }
+ public int getAsInt() {
+ return Utils.rgbtoHexValue(r, g, b);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/material/ALLOY.java b/src/main/java/gtPlusPlus/core/material/ALLOY.java
index 5283df8205..d4baa1dab1 100644
--- a/src/main/java/gtPlusPlus/core/material/ALLOY.java
+++ b/src/main/java/gtPlusPlus/core/material/ALLOY.java
@@ -1,1028 +1,993 @@
package gtPlusPlus.core.material;
import gregtech.api.enums.Materials;
-
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
public final class ALLOY {
- //Just some GT Alloys that I need within mine.
- public static final Material BRONZE = MaterialUtils.generateMaterialFromGtENUM(Materials.Bronze);
- public static final Material STEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.Steel);
- public static final Material STEEL_BLACK = MaterialUtils.generateMaterialFromGtENUM(Materials.BlackSteel);
- public static final Material INVAR = MaterialUtils.generateMaterialFromGtENUM(Materials.Invar);
- public static final Material KANTHAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Kanthal);
- public static final Material NICHROME = MaterialUtils.generateMaterialFromGtENUM(Materials.Nichrome);
- public static final Material TUNGSTENSTEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.TungstenSteel);
- public static final Material STAINLESS_STEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.StainlessSteel);
- public static final Material OSMIRIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Osmiridium);
-
- public static final Material ENERGYCRYSTAL = new Material(
- "Energy Crystal", //Material Name
- MaterialState.SOLID, //State
- new short[]{228, 255, 0, 0}, //Material Colour
- 4660, //Melting Point in C
- 5735, //Boiling Point in C
- 90, //Protons
- 40, //Neutrons
- true, //Uses Blast furnace?
- "⬟ ⯂ ⬢ ⬣ ⯃ ⯄",
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().AER, 5),
- new MaterialStack(ELEMENT.getInstance().IGNIS, 5),
- new MaterialStack(ELEMENT.getInstance().TERRA, 5),
- new MaterialStack(ELEMENT.getInstance().AQUA, 5)
- });
-
- public static final Material BLOODSTEEL = new Material(
- "Blood Steel", //Material Name
- MaterialState.SOLID, //State
- new short[]{142, 28, 0, 0}, //Material Colour
- 2500, //Melting Point in C
- 0, //Boiling Point in C
- 100, //Protons
- 100, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.STEEL, 5),
- new MaterialStack(ELEMENT.getInstance().IGNIS, 5)
- });
-
- public static final Material STABALLOY = new Material(
- "Staballoy", //Material Name
- MaterialState.SOLID, //State
- new short[]{68, 75, 66, 0}, //Material Colour
- 3450, //Melting Point in C
- -1,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().URANIUM238, 9),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 1)
- });
-
- public static final Material TANTALLOY_60 = new Material(
- "Tantalloy-60", //Material Name
- MaterialState.SOLID, //State
- new short[]{213, 231, 237, 0}, //Material Colour
- 3025, //Melting Point in C
- -1,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4),
- new MaterialStack(ELEMENT.getInstance().TANTALUM, 46)
- });
-
- public static final Material TANTALLOY_61 = new Material(
- "Tantalloy-61", //Material Name
- MaterialState.SOLID, //State
- new short[]{193, 211, 217, 0}, //Material Colour
- 3030, //Melting Point in C
- -1,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.TANTALLOY_60, 2),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 12),
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 8)
- });
-
- public static final Material TUMBAGA = new Material(
- "Tumbaga", //Material Name
- MaterialState.SOLID, //State
- new short[]{255,178,15, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().GOLD, 70),
- new MaterialStack(ELEMENT.getInstance().COPPER, 30)
- });
-
- public static final Material POTIN = new Material(
- "Potin", //Material Name
- MaterialState.SOLID, //State
- new short[]{201,151,129, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().LEAD, 40),
- new MaterialStack(ALLOY.BRONZE, 40),
- new MaterialStack(ELEMENT.getInstance().TIN, 20)
- });
-
- /*public static final Material BEDROCKIUM = new Material(
- "Bedrockium", //Material Name
- new short[]{32, 32, 32, 0}, //Material Colour
- 7735, //Melting Point in C
- 0, //Boiling Point in C
- 100, //Protons
- 100, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- null);*/
-
- public static final Material INCONEL_625 = new Material(
- "Inconel-625", //Material Name
- MaterialState.SOLID, //State
- new short[]{128, 200, 128, 0}, //Material Colour
- 2425, //Melting Point in C
- 3758,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NICKEL, 3),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 7),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 10),
- new MaterialStack(INVAR, 10),
- new MaterialStack(NICHROME, 13)
- });
-
- public static final Material INCONEL_690 = new Material(
- "Inconel-690", //Material Name
- MaterialState.SOLID, //State
- new short[]{118, 220, 138, 0}, //Material Colour
- 3425, //Melting Point in C
- 4895,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 5),
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 10),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 10),
- new MaterialStack(NICHROME, 15)
- });
-
- public static final Material INCONEL_792 = new Material(
- "Inconel-792", //Material Name
- MaterialState.SOLID, //State
- new short[]{108, 240, 118, 0}, //Material Colour
- 3425, //Melting Point in C
- 6200,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NICKEL, 20),
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 10),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 20),
- new MaterialStack(NICHROME, 10)
- });
-
- public static final Material NITINOL_60 = new Material(
- "Nitinol 60", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 5651, //Melting Point in C
- 8975,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NICKEL, 40),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 60)
- });
-
-
- public static final Material ZERON_100 = new Material(
- "Zeron-100", //Material Name
- MaterialState.SOLID, //State
- new short[]{180, 180, 20, 0}, //Material Colour
- 6100,
- 9785,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 26),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 6),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
- new MaterialStack(ELEMENT.getInstance().COPPER, 20),
- new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4),
- new MaterialStack(ALLOY.STEEL, 40)
- });
-
- public static final Material MARAGING250 = new Material(
- "Maraging Steel 250", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 2413, //Melting Point in C
- 4555,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.STEEL, 64),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
- new MaterialStack(ELEMENT.getInstance().COBALT, 8),
- });
-
- public static final Material MARAGING300 = new Material(
- "Maraging Steel 300", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 2413, //Melting Point in C
- 4555,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.STEEL, 64),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 4),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
- new MaterialStack(ELEMENT.getInstance().COBALT, 8),
- });
-
- public static final Material MARAGING350 = new Material(
- "Maraging Steel 350", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 2413, //Melting Point in C
- 4555,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.STEEL, 64),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 4),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
- new MaterialStack(ELEMENT.getInstance().COBALT, 8),
- });
-
- public static final Material AQUATIC_STEEL = new Material(
- "Watertight Steel", //Material Name
- MaterialState.SOLID, //State
- new short[] {120, 120, 180}, //Material Colour
- 2673, //Melting Point in C
- 4835,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.STEEL, 60),
- new MaterialStack(ELEMENT.getInstance().CARBON, 10),
- new MaterialStack(ELEMENT.getInstance().MANGANESE, 5),
- new MaterialStack(ELEMENT.getInstance().SILICON, 10),
- new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 5),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 5),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 5)
- });
-
- public static final Material STELLITE = new Material(
- "Stellite", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 4310, //Melting Point in C
- 6250,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().COBALT, 35),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 35),
- new MaterialStack(ELEMENT.getInstance().MANGANESE, 20),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 10)
- });
-
- public static final Material TALONITE = new Material(
- "Talonite", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 3454, //Melting Point in C
- 5500,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().COBALT, 40),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 30),
- new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 20),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 10)
- });
-
- public static final Material HASTELLOY_W = new Material(
- "Hastelloy-W", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 3350, //Melting Point in C
- 5755,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().IRON, 06),
- new MaterialStack(ELEMENT.getInstance().COBALT, 2),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 24),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 6),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 62)
- });
-
- public static final Material HASTELLOY_X = new Material(
- "Hastelloy-X", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 3350, //Melting Point in C
- 5755,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().IRON, 18),
- new MaterialStack(ELEMENT.getInstance().MANGANESE, 2),
- new MaterialStack(ELEMENT.getInstance().SILICON, 2),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 8),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 22),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 48)
- });
-
- public static final Material HASTELLOY_N = new Material(
- "Hastelloy-N", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 4350, //Melting Point in C
- 6875,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 8),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 16),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 8),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 8),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 60)
- });
-
- public static final Material HASTELLOY_C276 = new Material(
- "Hastelloy-C276", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 4350, //Melting Point in C
- 6520,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().COBALT, 2),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 16),
- new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 2),
- new MaterialStack(ELEMENT.getInstance().COPPER, 2),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 14),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 64)
- });
-
- public static final Material INCOLOY_020 = new Material(
- "Incoloy-020", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 3425, //Melting Point in C
- 5420,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().IRON, 40),
- new MaterialStack(ELEMENT.getInstance().COPPER, 4),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 36)
- });
-
- public static final Material INCOLOY_DS = new Material(
- "Incoloy-DS", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 3425, //Melting Point in C
- 5420,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().IRON, 46),
- new MaterialStack(ELEMENT.getInstance().COBALT, 18),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 18),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 18)
- });
-
- public static final Material INCOLOY_MA956 = new Material(
- "Incoloy-MA956", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 4425, //Melting Point in C
- 6875,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().IRON, 64),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 12),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 4)
- });
-
- public static final Material TUNGSTEN_CARBIDE = new Material(
- "Tungsten Carbide", //Material Name
- MaterialState.SOLID, //State
- new short[]{44, 44, 44, 0}, //Material Colour
- 3422, //Melting Point in C
- -1,
- -1,
- -1,
- true, //Uses Blast furnace?
- false, //Generate cells
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CARBON, 50),
- new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 50)
- });
-
- public static final Material TUNGSTEN_TITANIUM_CARBIDE = new Material(
- "Tungsten Titanium Carbide", //Material Name
- MaterialState.SOLID, //State
- null,
- 4422, //Melting Point in C
- -1,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(TUNGSTEN_CARBIDE, 70),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 30)
- });
-
- public static final Material SILICON_CARBIDE = new Material(
- "Silicon Carbide", //Material Name
- MaterialState.SOLID, //State
- new short[]{40, 48, 36, 0}, //Material Colour
- 1414, //Melting Point in C
- -1,
- -1,
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().SILICON, 50),
- new MaterialStack(ELEMENT.getInstance().CARBON, 50)
- });
-
- public static final Material TANTALUM_CARBIDE = new Material(
- "Tantalum Carbide", //Material Name
- MaterialState.SOLID, //State
- new short[]{139, 136, 120, 0}, //Material Colour
- 2980, //Melting Point in C
- -1,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().TANTALUM, 50),
- new MaterialStack(ELEMENT.getInstance().CARBON, 50)
- });
-
- public static final Material ZIRCONIUM_CARBIDE = new Material(
- "Zirconium Carbide", //Material Name
- MaterialState.SOLID, //State
- new short[]{222, 202, 180, 0}, //Material Colour
- 1555, //Melting Point in C
- -1,
- -1,
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 50),
- new MaterialStack(ELEMENT.getInstance().CARBON, 50)
- });
-
- public static final Material NIOBIUM_CARBIDE = new Material(
- "Niobium Carbide", //Material Name
- MaterialState.SOLID, //State
- new short[]{205, 197, 191, 0}, //Material Colour
- 2477, //Melting Point in C
- -1,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 50),
- new MaterialStack(ELEMENT.getInstance().CARBON, 50)
- });
-
- public static final Material ARCANITE = new Material(
- "Arcanite", //Material Name
- MaterialState.SOLID, //State
- null,
- 5666, //Melting Point in C
- 9875,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().THORIUM232, 40),
- new MaterialStack(ENERGYCRYSTAL, 40),
- new MaterialStack(ELEMENT.getInstance().ORDO, 10),
- new MaterialStack(ELEMENT.getInstance().PERDITIO, 10)
- });
-
- public static final Material LEAGRISIUM = new Material(
- "Grisium", //Material Name
- MaterialState.SOLID, //State
- new short[]{53, 93, 106, 0}, //Material Colour
- 3850, //Melting Point in C
- 5550, //Boiling Point in C
- 96, //Protons
- 128, //Neutrons
- true, //Uses Blast furnace?
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 18),
- new MaterialStack(ELEMENT.getInstance().CARBON, 18),
- new MaterialStack(ELEMENT.getInstance().POTASSIUM, 18),
- new MaterialStack(ELEMENT.getInstance().LITHIUM, 18),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 18),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 10)
- }); //Material Stacks with Percentage of required elements.
-
- public static final Material EGLIN_STEEL_BASE = new Material(
- "Eglin Steel Base Compound", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1,
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
-
- new MaterialStack(ELEMENT.getInstance().IRON, 12),
- new MaterialStack(KANTHAL, 3),
- new MaterialStack(INVAR, 15)
- });
-
- public static final Material EGLIN_STEEL = new Material(
- "Eglin Steel", //Material Name
- MaterialState.SOLID, //State
- new short[]{139,69,19, 0}, //Material Colour
- 1048, //Melting Point in C
- 1973, //Boiling Point in C
- -1,
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.EGLIN_STEEL_BASE, 10),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
- new MaterialStack(ELEMENT.getInstance().SILICON, 4),
- new MaterialStack(ELEMENT.getInstance().CARBON, 1)
- });
-
- public static final Material HG1223 = new Material(
- "HG-1223", //Material Name
- MaterialState.LIQUID, //State
- new short[]{39,85,159, 0}, //Material Colour
- 6357, //Melting Point in C
- 8563, //Boiling Point in C
- -1,
- -1,
- false, //Uses Blast furnace?
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().MERCURY, 1),
- new MaterialStack(ELEMENT.getInstance().BARIUM, 2),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
- new MaterialStack(ELEMENT.getInstance().COPPER, 3),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 8)
- });
-
-
- public static final Material HS188A = new Material(
- "HS188-A", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 4870, //Melting Point in C
- 7550, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- true, //Uses Blast furnace?
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().COBALT, 20),
- new MaterialStack(ELEMENT.getInstance().HAFNIUM, 20),
- new MaterialStack(TALONITE, 16),
- new MaterialStack(ELEMENT.getInstance().RHENIUM, 10),
- new MaterialStack(NIOBIUM_CARBIDE, 10),
- new MaterialStack(HASTELLOY_X, 8),
- new MaterialStack(TUNGSTENSTEEL, 8),
- new MaterialStack(ZIRCONIUM_CARBIDE, 8),
- }); //Material Stacks with Percentage of required elements.
-
- /**
- * Stargate Materials - #D2FFA9 210, 255, 170
- */
-
- public static final Material TRINIUM_TITANIUM = new Material(
- "Trinium Titanium Alloy", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 3750, //Melting Point in C
- 7210, //Boiling Point in C
- -1,
- -1,
- true, //Uses Blast furnace?
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 3),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 7)
- });
- public static final Material TRINIUM_NAQUADAH = new Material(
- "Trinium Naquadah Alloy", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 4200, //Melting Point in C
- 7400, //Boiling Point in C
- -1,
- -1,
- false, //Uses Blast furnace?
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 5),
- new MaterialStack(ELEMENT.getInstance().NAQUADAH, 9)
- });
- public static final Material TRINIUM_NAQUADAH_CARBON = new Material(
- "Trinium Naquadah Carbonite", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 6500, //Melting Point in C
- 9000, //Boiling Point in C
- -1,
- -1,
- true, //Uses Blast furnace?
- new MaterialStack[]{
- new MaterialStack(TRINIUM_NAQUADAH, 9),
- new MaterialStack(ELEMENT.getInstance().CARBON, 1)
- });
-
- public static final Material TRINIUM_REINFORCED_STEEL = new Material(
- "Arceus Alloy 2B", //Material Name
- MaterialState.SOLID, //State
- new short[]{205, 197, 23, 0}, //Material Colour
- 7555, //Melting Point in C
- 12350,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 30),
- new MaterialStack(ALLOY.MARAGING350, 40),
- new MaterialStack(ALLOY.TUNGSTENSTEEL, 20),
- new MaterialStack(ALLOY.OSMIRIDIUM, 10),
- new MaterialStack(ELEMENT.getInstance().STRONTIUM, 10)
- });
-
-
-
- /*
- * Witchery Material
- */
-
- public static final Material KOBOLDITE = new Material(
- "Koboldite", //Material Name
- MaterialState.SOLID, //State
- new short[]{80, 210, 255, 0}, //Material Colour
- -1, //Melting Point in C
- -1,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NICKEL, 35),
- new MaterialStack(ELEMENT.getInstance().THAUMIUM, 30),
- new MaterialStack(ELEMENT.getInstance().IRON, 35)
- });
-
-
- /*
- * Top Tier Alloys
- */
-
- public static final Material HELICOPTER = new Material(
- "HeLiCoPtEr", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 5763,
- 8192,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().HELIUM, 20),
- new MaterialStack(ELEMENT.getInstance().LITHIUM, 20),
- new MaterialStack(ELEMENT.getInstance().COBALT, 20),
- new MaterialStack(ELEMENT.getInstance().PLATINUM, 20),
- new MaterialStack(ELEMENT.getInstance().ERBIUM, 20)
- });
-
- //0lafe Compound
- public static final Material LAFIUM = new Material(
- "Lafium Compound", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 6350, //Melting Point in C
- 9865, //Boiling Point in C
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.HASTELLOY_N, 8),
- new MaterialStack(ELEMENT.getInstance().NAQUADAH, 4),
- new MaterialStack(ELEMENT.getInstance().SAMARIUM, 2),
- new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4),
- new MaterialStack(ELEMENT.getInstance().ARGON, 2),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 6),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 8),
- new MaterialStack(ELEMENT.getInstance().CARBON, 2)
- });
-
- //Cinobi Alloy
- public static final Material CINOBITE = new Material(
- "Cinobite A243", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 7350, //Melting Point in C
- 12565, //Boiling Point in C
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.ZERON_100, 16),
- new MaterialStack(ELEMENT.getInstance().NAQUADRIA, 7),
- new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 5),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 3),
- new MaterialStack(ELEMENT.getInstance().MERCURY, 2),
- new MaterialStack(ELEMENT.getInstance().TIN, 2),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 12),
- new MaterialStack(ALLOY.OSMIRIDIUM, 6)
- });
-
- //Piky Alloy
- public static final Material PIKYONIUM = new Material(
- "Pikyonium 64B", //Material Name
- MaterialState.SOLID, //State
- new short[]{52, 103, 186, 0}, //Material Colour
- 6850, //Melting Point in C
- 11765, //Boiling Point in C
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.INCONEL_792, 16),
- new MaterialStack(ALLOY.EGLIN_STEEL, 10),
- new MaterialStack(ELEMENT.getInstance().NAQUADAH_ENRICHED, 8),
- new MaterialStack(ELEMENT.getInstance().CERIUM, 6),
- new MaterialStack(ELEMENT.getInstance().ANTIMONY, 4),
- new MaterialStack(ELEMENT.getInstance().PLATINUM, 4),
- new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2),
- new MaterialStack(ALLOY.TUNGSTENSTEEL, 8)
- });
-
- //Piky Alloy
- public static final Material ABYSSAL = new Material(
- "Abyssal Alloy", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 9650, //Melting Point in C
- 13765, //Boiling Point in C
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.STAINLESS_STEEL, 10),
- new MaterialStack(ALLOY.TUNGSTEN_CARBIDE, 10),
- new MaterialStack(ALLOY.NICHROME, 10),
- new MaterialStack(ALLOY.BRONZE, 10),
- new MaterialStack(ALLOY.INCOLOY_MA956, 10),
- new MaterialStack(ELEMENT.getInstance().IODINE, 2),
- new MaterialStack(ELEMENT.getInstance().RADON, 2),
- new MaterialStack(ELEMENT.getInstance().GERMANIUM, 2),
- });
-
- //Alkalus Alloy
- public static final Material LAURENIUM = new Material(
- "Laurenium", //Material Name
- MaterialState.SOLID, //State
- new short[] {244, 168, 255, 0}, //Material Colour
- 6825, //Melting Point in C
- 11355, //Boiling Point in C
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.EGLIN_STEEL, 40),
- new MaterialStack(ELEMENT.getInstance().INDIUM, 10),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
- new MaterialStack(ELEMENT.getInstance().DYSPROSIUM, 5),
- new MaterialStack(ELEMENT.getInstance().RHENIUM, 5),
- });
-
-
- //Bot Alloy
- public static final Material BOTMIUM = new Material(
- "Botmium", //Material Name
- MaterialState.SOLID, //State
- new short[] {80, 160, 80, 0}, //Material Colour
- 8220, //Melting Point in C
- 10540, //Boiling Point in C
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.NITINOL_60, 2),
- new MaterialStack(ELEMENT.getInstance().OSMIUM, 12),
- new MaterialStack(ELEMENT.getInstance().RUTHENIUM, 12),
- new MaterialStack(ELEMENT.getInstance().THALLIUM, 6),
- });
-
- //Titansteel
- public static final Material TITANSTEEL = new Material(
- "Titansteel", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 8250, //Melting Point in C
- 11765, //Boiling Point in C
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.TUNGSTEN_TITANIUM_CARBIDE, 3),
- new MaterialStack(ELEMENT.getInstance().IGNIS, 1),
- new MaterialStack(ELEMENT.getInstance().TERRA, 1),
- new MaterialStack(ELEMENT.getInstance().PERDITIO, 1),
- });
-
-
- public static final Material OCTIRON = new Material(
- "Octiron", //Material Name
- MaterialState.SOLID, //State
- null,
- 9120, //Melting Point in C
- 14200,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ARCANITE, 30),
- new MaterialStack(TITANSTEEL, 30),
- new MaterialStack(ENERGYCRYSTAL, 5),
- new MaterialStack(STEEL_BLACK, 10),
- new MaterialStack(ELEMENT.getInstance().THAUMIUM, 25)
- });
-
-
-
- public static final Material BLACK_TITANIUM = new Material(
- "Black Titanium", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- Materials.Titanium.mMeltingPoint*4, //Melting Point in C
- Materials.Titanium.mMeltingPoint*16,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 55),
- new MaterialStack(ELEMENT.getInstance().LANTHANUM, 12),
- new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 8),
- new MaterialStack(ELEMENT.getInstance().COBALT, 6),
- new MaterialStack(ELEMENT.getInstance().MANGANESE, 4),
- new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 4),
- new MaterialStack(ELEMENT.getInstance().PALLADIUM, 4),
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
- new MaterialStack(ELEMENT.getInstance().ARGON, 5)
- });
-
- public static final Material BABBIT_ALLOY = new Material(
- "Babbit Alloy", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 268, //Melting Point in C
- 589,
- -1,
- -1,
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().TIN, 10),
- new MaterialStack(ELEMENT.getInstance().LEAD, 72),
- new MaterialStack(ELEMENT.getInstance().ANTIMONY, 16),
- new MaterialStack(ELEMENT.getInstance().ARSENIC, 2)
- });
-
- public static final Material INDALLOY_140 = new Material(
- "Indalloy 140", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 5200, //Melting Point in C
- 6500,
- -1,
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().BISMUTH, 47),
- new MaterialStack(ELEMENT.getInstance().LEAD, 25),
- new MaterialStack(ELEMENT.getInstance().TIN, 13),
- new MaterialStack(ELEMENT.getInstance().CADMIUM, 10),
- new MaterialStack(ELEMENT.getInstance().INDIUM, 5)
- });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- //Quantum
- public static final Material QUANTUM = new Material(
- "Quantum", //Material Name
- MaterialState.SOLID, //State
- null, //Material Colour
- 10500, //Melting Point in C
- 25000, //Boiling Point in C
- 150, //Protons
- 200, //Neutrons
- true, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.STELLITE, 15),
- new MaterialStack(ALLOY.ENERGYCRYSTAL, 5),
- new MaterialStack(ALLOY.SILICON_CARBIDE, 5),
- new MaterialStack(ELEMENT.getInstance().GALLIUM, 5),
- new MaterialStack(ELEMENT.getInstance().AMERICIUM, 5),
- new MaterialStack(ELEMENT.getInstance().PALLADIUM, 5),
- new MaterialStack(ELEMENT.getInstance().BISMUTH, 5),
- new MaterialStack(ELEMENT.getInstance().GERMANIUM, 5)
- });
-
-
-
+ // Just some GT Alloys that I need within mine.
+ public static final Material BRONZE = MaterialUtils.generateMaterialFromGtENUM(Materials.Bronze);
+ public static final Material STEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.Steel);
+ public static final Material STEEL_BLACK = MaterialUtils.generateMaterialFromGtENUM(Materials.BlackSteel);
+ public static final Material INVAR = MaterialUtils.generateMaterialFromGtENUM(Materials.Invar);
+ public static final Material KANTHAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Kanthal);
+ public static final Material NICHROME = MaterialUtils.generateMaterialFromGtENUM(Materials.Nichrome);
+ public static final Material TUNGSTENSTEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.TungstenSteel);
+ public static final Material STAINLESS_STEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.StainlessSteel);
+ public static final Material OSMIRIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Osmiridium);
+
+ public static final Material ENERGYCRYSTAL = new Material(
+ "Energy Crystal", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {228, 255, 0, 0}, // Material Colour
+ 4660, // Melting Point in C
+ 5735, // Boiling Point in C
+ 90, // Protons
+ 40, // Neutrons
+ true, // Uses Blast furnace?
+ "⬟ ⯂ ⬢ ⬣ ⯃ ⯄",
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().AER, 5),
+ new MaterialStack(ELEMENT.getInstance().IGNIS, 5),
+ new MaterialStack(ELEMENT.getInstance().TERRA, 5),
+ new MaterialStack(ELEMENT.getInstance().AQUA, 5)
+ });
+
+ public static final Material BLOODSTEEL = new Material(
+ "Blood Steel", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {142, 28, 0, 0}, // Material Colour
+ 2500, // Melting Point in C
+ 0, // Boiling Point in C
+ 100, // Protons
+ 100, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {new MaterialStack(ALLOY.STEEL, 5), new MaterialStack(ELEMENT.getInstance().IGNIS, 5)});
+
+ public static final Material STABALLOY = new Material(
+ "Staballoy", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {68, 75, 66, 0}, // Material Colour
+ 3450, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().URANIUM238, 9),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 1)
+ });
+
+ public static final Material TANTALLOY_60 = new Material(
+ "Tantalloy-60", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {213, 231, 237, 0}, // Material Colour
+ 3025, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4),
+ new MaterialStack(ELEMENT.getInstance().TANTALUM, 46)
+ });
+
+ public static final Material TANTALLOY_61 = new Material(
+ "Tantalloy-61", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {193, 211, 217, 0}, // Material Colour
+ 3030, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.TANTALLOY_60, 2),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 12),
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 8)
+ });
+
+ public static final Material TUMBAGA = new Material(
+ "Tumbaga", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {255, 178, 15, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().GOLD, 70), new MaterialStack(ELEMENT.getInstance().COPPER, 30)
+ });
+
+ public static final Material POTIN = new Material(
+ "Potin", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {201, 151, 129, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().LEAD, 40),
+ new MaterialStack(ALLOY.BRONZE, 40),
+ new MaterialStack(ELEMENT.getInstance().TIN, 20)
+ });
+
+ /*public static final Material BEDROCKIUM = new Material(
+ "Bedrockium", //Material Name
+ new short[]{32, 32, 32, 0}, //Material Colour
+ 7735, //Melting Point in C
+ 0, //Boiling Point in C
+ 100, //Protons
+ 100, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ null);*/
+
+ public static final Material INCONEL_625 = new Material(
+ "Inconel-625", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {128, 200, 128, 0}, // Material Colour
+ 2425, // Melting Point in C
+ 3758,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 3),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 7),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 10),
+ new MaterialStack(INVAR, 10),
+ new MaterialStack(NICHROME, 13)
+ });
+
+ public static final Material INCONEL_690 = new Material(
+ "Inconel-690", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {118, 220, 138, 0}, // Material Colour
+ 3425, // Melting Point in C
+ 4895,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 5),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 10),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 10),
+ new MaterialStack(NICHROME, 15)
+ });
+
+ public static final Material INCONEL_792 = new Material(
+ "Inconel-792", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {108, 240, 118, 0}, // Material Colour
+ 3425, // Melting Point in C
+ 6200,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 20),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 10),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 20),
+ new MaterialStack(NICHROME, 10)
+ });
+
+ public static final Material NITINOL_60 = new Material(
+ "Nitinol 60", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 5651, // Melting Point in C
+ 8975,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 40),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 60)
+ });
+
+ public static final Material ZERON_100 = new Material(
+ "Zeron-100", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {180, 180, 20, 0}, // Material Colour
+ 6100,
+ 9785,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 26),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 6),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
+ new MaterialStack(ELEMENT.getInstance().COPPER, 20),
+ new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4),
+ new MaterialStack(ALLOY.STEEL, 40)
+ });
+
+ public static final Material MARAGING250 = new Material(
+ "Maraging Steel 250", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 2413, // Melting Point in C
+ 4555,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.STEEL, 64),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 8),
+ });
+
+ public static final Material MARAGING300 = new Material(
+ "Maraging Steel 300", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 2413, // Melting Point in C
+ 4555,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.STEEL, 64),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 8),
+ });
+
+ public static final Material MARAGING350 = new Material(
+ "Maraging Steel 350", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 2413, // Melting Point in C
+ 4555,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.STEEL, 64),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 8),
+ });
+
+ public static final Material AQUATIC_STEEL = new Material(
+ "Watertight Steel", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {120, 120, 180}, // Material Colour
+ 2673, // Melting Point in C
+ 4835,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.STEEL, 60),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 10),
+ new MaterialStack(ELEMENT.getInstance().MANGANESE, 5),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 10),
+ new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 5),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 5),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 5)
+ });
+
+ public static final Material STELLITE = new Material(
+ "Stellite", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 4310, // Melting Point in C
+ 6250,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().COBALT, 35),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 35),
+ new MaterialStack(ELEMENT.getInstance().MANGANESE, 20),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 10)
+ });
+
+ public static final Material TALONITE = new Material(
+ "Talonite", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 3454, // Melting Point in C
+ 5500,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().COBALT, 40),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 30),
+ new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 20),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 10)
+ });
+
+ public static final Material HASTELLOY_W = new Material(
+ "Hastelloy-W", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 3350, // Melting Point in C
+ 5755,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().IRON, 06),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 2),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 24),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 6),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 62)
+ });
+
+ public static final Material HASTELLOY_X = new Material(
+ "Hastelloy-X", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 3350, // Melting Point in C
+ 5755,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().IRON, 18),
+ new MaterialStack(ELEMENT.getInstance().MANGANESE, 2),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 2),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 8),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 22),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 48)
+ });
+
+ public static final Material HASTELLOY_N = new Material(
+ "Hastelloy-N", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 4350, // Melting Point in C
+ 6875,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 8),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 16),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 8),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 8),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 60)
+ });
+
+ public static final Material HASTELLOY_C276 = new Material(
+ "Hastelloy-C276", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 4350, // Melting Point in C
+ 6520,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().COBALT, 2),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 16),
+ new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 2),
+ new MaterialStack(ELEMENT.getInstance().COPPER, 2),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 14),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 64)
+ });
+
+ public static final Material INCOLOY_020 = new Material(
+ "Incoloy-020", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 3425, // Melting Point in C
+ 5420,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().IRON, 40),
+ new MaterialStack(ELEMENT.getInstance().COPPER, 4),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 36)
+ });
+
+ public static final Material INCOLOY_DS = new Material(
+ "Incoloy-DS", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 3425, // Melting Point in C
+ 5420,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().IRON, 46),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 18),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 18),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 18)
+ });
+
+ public static final Material INCOLOY_MA956 = new Material(
+ "Incoloy-MA956", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 4425, // Melting Point in C
+ 6875,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().IRON, 64),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 12),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 4)
+ });
+
+ public static final Material TUNGSTEN_CARBIDE = new Material(
+ "Tungsten Carbide", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {44, 44, 44, 0}, // Material Colour
+ 3422, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ false, // Generate cells
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CARBON, 50),
+ new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 50)
+ });
+
+ public static final Material TUNGSTEN_TITANIUM_CARBIDE = new Material(
+ "Tungsten Titanium Carbide", // Material Name
+ MaterialState.SOLID, // State
+ null,
+ 4422, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(TUNGSTEN_CARBIDE, 70), new MaterialStack(ELEMENT.getInstance().TITANIUM, 30)
+ });
+
+ public static final Material SILICON_CARBIDE = new Material(
+ "Silicon Carbide", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {40, 48, 36, 0}, // Material Colour
+ 1414, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().SILICON, 50),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 50)
+ });
+
+ public static final Material TANTALUM_CARBIDE = new Material(
+ "Tantalum Carbide", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {139, 136, 120, 0}, // Material Colour
+ 2980, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().TANTALUM, 50),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 50)
+ });
+
+ public static final Material ZIRCONIUM_CARBIDE = new Material(
+ "Zirconium Carbide", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {222, 202, 180, 0}, // Material Colour
+ 1555, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 50),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 50)
+ });
+
+ public static final Material NIOBIUM_CARBIDE = new Material(
+ "Niobium Carbide", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {205, 197, 191, 0}, // Material Colour
+ 2477, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 50),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 50)
+ });
+
+ public static final Material ARCANITE = new Material(
+ "Arcanite", // Material Name
+ MaterialState.SOLID, // State
+ null,
+ 5666, // Melting Point in C
+ 9875,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().THORIUM232, 40),
+ new MaterialStack(ENERGYCRYSTAL, 40),
+ new MaterialStack(ELEMENT.getInstance().ORDO, 10),
+ new MaterialStack(ELEMENT.getInstance().PERDITIO, 10)
+ });
+
+ public static final Material LEAGRISIUM = new Material(
+ "Grisium", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {53, 93, 106, 0}, // Material Colour
+ 3850, // Melting Point in C
+ 5550, // Boiling Point in C
+ 96, // Protons
+ 128, // Neutrons
+ true, // Uses Blast furnace?
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 18),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 18),
+ new MaterialStack(ELEMENT.getInstance().POTASSIUM, 18),
+ new MaterialStack(ELEMENT.getInstance().LITHIUM, 18),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 18),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 10)
+ }); // Material Stacks with Percentage of required elements.
+
+ public static final Material EGLIN_STEEL_BASE = new Material(
+ "Eglin Steel Base Compound", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().IRON, 12),
+ new MaterialStack(KANTHAL, 3),
+ new MaterialStack(INVAR, 15)
+ });
+
+ public static final Material EGLIN_STEEL = new Material(
+ "Eglin Steel", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {139, 69, 19, 0}, // Material Colour
+ 1048, // Melting Point in C
+ 1973, // Boiling Point in C
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.EGLIN_STEEL_BASE, 10),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 4),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 1)
+ });
+
+ public static final Material HG1223 = new Material(
+ "HG-1223", // Material Name
+ MaterialState.LIQUID, // State
+ new short[] {39, 85, 159, 0}, // Material Colour
+ 6357, // Melting Point in C
+ 8563, // Boiling Point in C
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().MERCURY, 1),
+ new MaterialStack(ELEMENT.getInstance().BARIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().COPPER, 3),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 8)
+ });
+
+ public static final Material HS188A = new Material(
+ "HS188-A", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 4870, // Melting Point in C
+ 7550, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ true, // Uses Blast furnace?
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().COBALT, 20),
+ new MaterialStack(ELEMENT.getInstance().HAFNIUM, 20),
+ new MaterialStack(TALONITE, 16),
+ new MaterialStack(ELEMENT.getInstance().RHENIUM, 10),
+ new MaterialStack(NIOBIUM_CARBIDE, 10),
+ new MaterialStack(HASTELLOY_X, 8),
+ new MaterialStack(TUNGSTENSTEEL, 8),
+ new MaterialStack(ZIRCONIUM_CARBIDE, 8),
+ }); // Material Stacks with Percentage of required elements.
+
+ /**
+ * Stargate Materials - #D2FFA9 210, 255, 170
+ */
+ public static final Material TRINIUM_TITANIUM = new Material(
+ "Trinium Titanium Alloy", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 3750, // Melting Point in C
+ 7210, // Boiling Point in C
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 3),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 7)
+ });
+
+ public static final Material TRINIUM_NAQUADAH = new Material(
+ "Trinium Naquadah Alloy", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 4200, // Melting Point in C
+ 7400, // Boiling Point in C
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 5),
+ new MaterialStack(ELEMENT.getInstance().NAQUADAH, 9)
+ });
+ public static final Material TRINIUM_NAQUADAH_CARBON = new Material(
+ "Trinium Naquadah Carbonite", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 6500, // Melting Point in C
+ 9000, // Boiling Point in C
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ new MaterialStack[] {
+ new MaterialStack(TRINIUM_NAQUADAH, 9), new MaterialStack(ELEMENT.getInstance().CARBON, 1)
+ });
+
+ public static final Material TRINIUM_REINFORCED_STEEL = new Material(
+ "Arceus Alloy 2B", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {205, 197, 23, 0}, // Material Colour
+ 7555, // Melting Point in C
+ 12350,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 30),
+ new MaterialStack(ALLOY.MARAGING350, 40),
+ new MaterialStack(ALLOY.TUNGSTENSTEEL, 20),
+ new MaterialStack(ALLOY.OSMIRIDIUM, 10),
+ new MaterialStack(ELEMENT.getInstance().STRONTIUM, 10)
+ });
+
+ /*
+ * Witchery Material
+ */
+
+ public static final Material KOBOLDITE = new Material(
+ "Koboldite", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {80, 210, 255, 0}, // Material Colour
+ -1, // Melting Point in C
+ -1,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 35),
+ new MaterialStack(ELEMENT.getInstance().THAUMIUM, 30),
+ new MaterialStack(ELEMENT.getInstance().IRON, 35)
+ });
+
+ /*
+ * Top Tier Alloys
+ */
+
+ public static final Material HELICOPTER = new Material(
+ "HeLiCoPtEr", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 5763,
+ 8192,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().HELIUM, 20),
+ new MaterialStack(ELEMENT.getInstance().LITHIUM, 20),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 20),
+ new MaterialStack(ELEMENT.getInstance().PLATINUM, 20),
+ new MaterialStack(ELEMENT.getInstance().ERBIUM, 20)
+ });
+
+ // 0lafe Compound
+ public static final Material LAFIUM = new Material(
+ "Lafium Compound", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 6350, // Melting Point in C
+ 9865, // Boiling Point in C
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.HASTELLOY_N, 8),
+ new MaterialStack(ELEMENT.getInstance().NAQUADAH, 4),
+ new MaterialStack(ELEMENT.getInstance().SAMARIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4),
+ new MaterialStack(ELEMENT.getInstance().ARGON, 2),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 6),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 8),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 2)
+ });
+
+ // Cinobi Alloy
+ public static final Material CINOBITE = new Material(
+ "Cinobite A243", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 7350, // Melting Point in C
+ 12565, // Boiling Point in C
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.ZERON_100, 16),
+ new MaterialStack(ELEMENT.getInstance().NAQUADRIA, 7),
+ new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 5),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().MERCURY, 2),
+ new MaterialStack(ELEMENT.getInstance().TIN, 2),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 12),
+ new MaterialStack(ALLOY.OSMIRIDIUM, 6)
+ });
+
+ // Piky Alloy
+ public static final Material PIKYONIUM = new Material(
+ "Pikyonium 64B", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {52, 103, 186, 0}, // Material Colour
+ 6850, // Melting Point in C
+ 11765, // Boiling Point in C
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.INCONEL_792, 16),
+ new MaterialStack(ALLOY.EGLIN_STEEL, 10),
+ new MaterialStack(ELEMENT.getInstance().NAQUADAH_ENRICHED, 8),
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 6),
+ new MaterialStack(ELEMENT.getInstance().ANTIMONY, 4),
+ new MaterialStack(ELEMENT.getInstance().PLATINUM, 4),
+ new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2),
+ new MaterialStack(ALLOY.TUNGSTENSTEEL, 8)
+ });
+
+ // Piky Alloy
+ public static final Material ABYSSAL = new Material(
+ "Abyssal Alloy", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 9650, // Melting Point in C
+ 13765, // Boiling Point in C
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.STAINLESS_STEEL, 10),
+ new MaterialStack(ALLOY.TUNGSTEN_CARBIDE, 10),
+ new MaterialStack(ALLOY.NICHROME, 10),
+ new MaterialStack(ALLOY.BRONZE, 10),
+ new MaterialStack(ALLOY.INCOLOY_MA956, 10),
+ new MaterialStack(ELEMENT.getInstance().IODINE, 2),
+ new MaterialStack(ELEMENT.getInstance().RADON, 2),
+ new MaterialStack(ELEMENT.getInstance().GERMANIUM, 2),
+ });
+
+ // Alkalus Alloy
+ public static final Material LAURENIUM = new Material(
+ "Laurenium", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {244, 168, 255, 0}, // Material Colour
+ 6825, // Melting Point in C
+ 11355, // Boiling Point in C
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.EGLIN_STEEL, 40),
+ new MaterialStack(ELEMENT.getInstance().INDIUM, 10),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
+ new MaterialStack(ELEMENT.getInstance().DYSPROSIUM, 5),
+ new MaterialStack(ELEMENT.getInstance().RHENIUM, 5),
+ });
+
+ // Bot Alloy
+ public static final Material BOTMIUM = new Material(
+ "Botmium", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {80, 160, 80, 0}, // Material Colour
+ 8220, // Melting Point in C
+ 10540, // Boiling Point in C
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.NITINOL_60, 2),
+ new MaterialStack(ELEMENT.getInstance().OSMIUM, 12),
+ new MaterialStack(ELEMENT.getInstance().RUTHENIUM, 12),
+ new MaterialStack(ELEMENT.getInstance().THALLIUM, 6),
+ });
+
+ // Titansteel
+ public static final Material TITANSTEEL = new Material(
+ "Titansteel", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 8250, // Melting Point in C
+ 11765, // Boiling Point in C
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.TUNGSTEN_TITANIUM_CARBIDE, 3),
+ new MaterialStack(ELEMENT.getInstance().IGNIS, 1),
+ new MaterialStack(ELEMENT.getInstance().TERRA, 1),
+ new MaterialStack(ELEMENT.getInstance().PERDITIO, 1),
+ });
+
+ public static final Material OCTIRON = new Material(
+ "Octiron", // Material Name
+ MaterialState.SOLID, // State
+ null,
+ 9120, // Melting Point in C
+ 14200,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ARCANITE, 30),
+ new MaterialStack(TITANSTEEL, 30),
+ new MaterialStack(ENERGYCRYSTAL, 5),
+ new MaterialStack(STEEL_BLACK, 10),
+ new MaterialStack(ELEMENT.getInstance().THAUMIUM, 25)
+ });
+
+ public static final Material BLACK_TITANIUM = new Material(
+ "Black Titanium", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ Materials.Titanium.mMeltingPoint * 4, // Melting Point in C
+ Materials.Titanium.mMeltingPoint * 16,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 55),
+ new MaterialStack(ELEMENT.getInstance().LANTHANUM, 12),
+ new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 8),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 6),
+ new MaterialStack(ELEMENT.getInstance().MANGANESE, 4),
+ new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 4),
+ new MaterialStack(ELEMENT.getInstance().PALLADIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().ARGON, 5)
+ });
+
+ public static final Material BABBIT_ALLOY = new Material(
+ "Babbit Alloy", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 268, // Melting Point in C
+ 589,
+ -1,
+ -1,
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().TIN, 10),
+ new MaterialStack(ELEMENT.getInstance().LEAD, 72),
+ new MaterialStack(ELEMENT.getInstance().ANTIMONY, 16),
+ new MaterialStack(ELEMENT.getInstance().ARSENIC, 2)
+ });
+
+ public static final Material INDALLOY_140 = new Material(
+ "Indalloy 140", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 5200, // Melting Point in C
+ 6500,
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().BISMUTH, 47),
+ new MaterialStack(ELEMENT.getInstance().LEAD, 25),
+ new MaterialStack(ELEMENT.getInstance().TIN, 13),
+ new MaterialStack(ELEMENT.getInstance().CADMIUM, 10),
+ new MaterialStack(ELEMENT.getInstance().INDIUM, 5)
+ });
+
+ // Quantum
+ public static final Material QUANTUM = new Material(
+ "Quantum", // Material Name
+ MaterialState.SOLID, // State
+ null, // Material Colour
+ 10500, // Melting Point in C
+ 25000, // Boiling Point in C
+ 150, // Protons
+ 200, // Neutrons
+ true, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ALLOY.STELLITE, 15),
+ new MaterialStack(ALLOY.ENERGYCRYSTAL, 5),
+ new MaterialStack(ALLOY.SILICON_CARBIDE, 5),
+ new MaterialStack(ELEMENT.getInstance().GALLIUM, 5),
+ new MaterialStack(ELEMENT.getInstance().AMERICIUM, 5),
+ new MaterialStack(ELEMENT.getInstance().PALLADIUM, 5),
+ new MaterialStack(ELEMENT.getInstance().BISMUTH, 5),
+ new MaterialStack(ELEMENT.getInstance().GERMANIUM, 5)
+ });
}
diff --git a/src/main/java/gtPlusPlus/core/material/ELEMENT.java b/src/main/java/gtPlusPlus/core/material/ELEMENT.java
index 579fba73f5..23dd3d3a08 100644
--- a/src/main/java/gtPlusPlus/core/material/ELEMENT.java
+++ b/src/main/java/gtPlusPlus/core/material/ELEMENT.java
@@ -11,246 +11,933 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils;
public final class ELEMENT {
- public static final String[] NAMES = new String[]{"Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon", "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttrium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum", "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium", "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium", "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Nihonium", "Flerovium", "Moscovium", "Livermorium", "Tennessine", "Oganesson"};
-
- //First 50 Elements
- public final Material HYDROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Hydrogen);
- public final Material HELIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Helium);
- public final Material LITHIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lithium);
- public final Material BERYLLIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Beryllium);
- public final Material BORON = MaterialUtils.generateMaterialFromGtENUM(Materials.Boron);
- public final Material CARBON = MaterialUtils.generateMaterialFromGtENUM(Materials.Carbon);
- public final Material NITROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Nitrogen);
- public final Material OXYGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Oxygen);
- public final Material FLUORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Fluorine);
- public final Material NEON = new Material("Neon", MaterialState.PURE_GAS, new short[]{240, 180, 30}, -248, -246, 10, 10, false, "Ne", 0);//Not a GT Inherited Material
- public final Material SODIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Sodium);
- public final Material MAGNESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Magnesium);
- public final Material ALUMINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Aluminium);
- public final Material ALUMINIUMOXIDE = MaterialUtils.generateMaterialFromGtENUM(Materials.Aluminiumoxide);
- public final Material SILICON = MaterialUtils.generateMaterialFromGtENUM(Materials.Silicon);
- public final Material SILICONDIOXIDE = MaterialUtils.generateMaterialFromGtENUM(Materials.SiliconDioxide);
- public final Material PHOSPHORUS = MaterialUtils.generateMaterialFromGtENUM(Materials.Phosphor);
- public final Material SULFUR = MaterialUtils.generateMaterialFromGtENUM(Materials.Sulfur);
- public final Material CHLORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Chlorine);
- public final Material ARGON = MaterialUtils.generateMaterialFromGtENUM(Materials.Argon);
- public final Material POTASSIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Potassium);
- public final Material CALCIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Calcium);
- public final Material SCANDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Scandium);
- public final Material TITANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Titanium);
- public final Material VANADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Vanadium);
- public final Material CHROMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Chrome);
- public final Material MANGANESE = MaterialUtils.generateMaterialFromGtENUM(Materials.Manganese);
- public final Material IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.Iron);
- public final Material COBALT = MaterialUtils.generateMaterialFromGtENUM(Materials.Cobalt);
- public final Material NICKEL = MaterialUtils.generateMaterialFromGtENUM(Materials.Nickel);
- public final Material COPPER = MaterialUtils.generateMaterialFromGtENUM(Materials.Copper);
- public final Material ZINC = MaterialUtils.generateMaterialFromGtENUM(Materials.Zinc);
- public final Material GALLIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Gallium);
- public final Material GERMANIUM = new Material("Germanium", MaterialState.SOLID, new short[]{200, 200, 200}, 937, 2830, 32, 41, false, "Ge", 0);//Not a GT Inherited Material
- public final Material ARSENIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Arsenic);
- public final Material SELENIUM = new Material("Selenium", MaterialState.SOLID, new short[]{190, 190, 190}, 217, 685, 34, 45, false, "Se", 0);//Not a GT Inherited Material
- public final Material BROMINE = new Material("Bromine", MaterialState.PURE_LIQUID, new short[]{200, 25, 25}, -7, 58, 35, 45, false, "Br", 0);//Not a GT Inherited Material
- public final Material KRYPTON = new Material("Krypton", MaterialState.PURE_GAS, new short[]{5, 200, 220}, -157, -153, 36, 48, false, "Kr", 0);//Not a GT Inherited Material
- public final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium);
- public final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium, new short[] {230, 210, 110}, TextureSet.SET_FLINT);
- public final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium);
- public final Material ZIRCONIUM = new Material("Zirconium", MaterialState.SOLID, new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, "Zr", 0);//Not a GT Inherited Material
- public final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium);
- public final Material MOLYBDENUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Molybdenum);
- public final Material TECHNETIUM = new Material("Technetium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{220, 220, 220}, 2200, 4877, 43, 55, false, "Tc", 2);//Not a GT Inherited Material
- public final Material RUTHENIUM = new Material("Ruthenium", MaterialState.SOLID, new short[]{220, 220, 220}, 2250, 3900, 44, 57, false, "Ru", 0);//Not a GT Inherited Material
- public final Material RHODIUM = new Material("Rhodium", MaterialState.SOLID, new short[]{220, 220, 220}, 1966, 3727, 45, 58, false, "Rh", 0);//Not a GT Inherited Material
- public final Material PALLADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Palladium);
- public final Material SILVER = MaterialUtils.generateMaterialFromGtENUM(Materials.Silver);
- public final Material CADMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Cadmium);
- public final Material INDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Indium);
- public final Material TIN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tin);
- public final Material ANTIMONY = MaterialUtils.generateMaterialFromGtENUM(Materials.Antimony);
- public final Material TELLURIUM = new Material("Tellurium", MaterialState.SOLID, new short[]{210, 210, 210}, 449, 989, 52, 76, false, "Te", 0);//Not a GT Inherited Material
- public final Material IODINE = new Material("Iodine", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{96, 96, 96}, 114, 184, 53, 74, false, "I", 0);//Not a GT Inherited Material
- public final Material XENON = new Material("Xenon", MaterialState.PURE_GAS, new short[]{5, 105, 210}, -111, -108, 54, 77, false, "Xe", 0);//Not a GT Inherited Material
- public final Material CAESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Caesium);
- public final Material BARIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Barium);
- public final Material LANTHANUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lanthanum);
- public final Material CERIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Cerium);
- public final Material PRASEODYMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Praseodymium);
- public final Material NEODYMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Neodymium);
- public final Material PROMETHIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Promethium);
- public final Material SAMARIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Samarium);
- public final Material EUROPIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Europium);
- public final Material GADOLINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Gadolinium);
- public final Material TERBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Terbium);
- public final Material DYSPROSIUM = new Material("Dysprosium", MaterialState.SOLID, new short[]{180, 180, 180}, 1412, 2562, 66, 97, false, "Dy", 0);//Not a GT Inherited Material
- public final Material HOLMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Holmium);
- public final Material ERBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Erbium);
- public final Material THULIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thulium);
- public final Material YTTERBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Ytterbium);
- public final Material LUTETIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lutetium);
- public final Material HAFNIUM = new Material("Hafnium", MaterialState.SOLID, new short[]{128, 128, 128}, 2150, 5400, 72, 106, false, "Hf", 0);//Not a GT Inherited Material
+ public static final String[] NAMES = new String[] {
+ "Hydrogen",
+ "Helium",
+ "Lithium",
+ "Beryllium",
+ "Boron",
+ "Carbon",
+ "Nitrogen",
+ "Oxygen",
+ "Fluorine",
+ "Neon",
+ "Sodium",
+ "Magnesium",
+ "Aluminium",
+ "Silicon",
+ "Phosphorus",
+ "Sulfur",
+ "Chlorine",
+ "Argon",
+ "Potassium",
+ "Calcium",
+ "Scandium",
+ "Titanium",
+ "Vanadium",
+ "Chromium",
+ "Manganese",
+ "Iron",
+ "Cobalt",
+ "Nickel",
+ "Copper",
+ "Zinc",
+ "Gallium",
+ "Germanium",
+ "Arsenic",
+ "Selenium",
+ "Bromine",
+ "Krypton",
+ "Rubidium",
+ "Strontium",
+ "Yttrium",
+ "Zirconium",
+ "Niobium",
+ "Molybdenum",
+ "Technetium",
+ "Ruthenium",
+ "Rhodium",
+ "Palladium",
+ "Silver",
+ "Cadmium",
+ "Indium",
+ "Tin",
+ "Antimony",
+ "Tellurium",
+ "Iodine",
+ "Xenon",
+ "Caesium",
+ "Barium",
+ "Lanthanum",
+ "Cerium",
+ "Praseodymium",
+ "Neodymium",
+ "Promethium",
+ "Samarium",
+ "Europium",
+ "Gadolinium",
+ "Terbium",
+ "Dysprosium",
+ "Holmium",
+ "Erbium",
+ "Thulium",
+ "Ytterbium",
+ "Lutetium",
+ "Hafnium",
+ "Tantalum",
+ "Tungsten",
+ "Rhenium",
+ "Osmium",
+ "Iridium",
+ "Platinum",
+ "Gold",
+ "Mercury",
+ "Thallium",
+ "Lead",
+ "Bismuth",
+ "Polonium",
+ "Astatine",
+ "Radon",
+ "Francium",
+ "Radium",
+ "Actinium",
+ "Thorium",
+ "Protactinium",
+ "Uranium",
+ "Neptunium",
+ "Plutonium",
+ "Americium",
+ "Curium",
+ "Berkelium",
+ "Californium",
+ "Einsteinium",
+ "Fermium",
+ "Mendelevium",
+ "Nobelium",
+ "Lawrencium",
+ "Rutherfordium",
+ "Dubnium",
+ "Seaborgium",
+ "Bohrium",
+ "Hassium",
+ "Meitnerium",
+ "Darmstadtium",
+ "Roentgenium",
+ "Copernicium",
+ "Nihonium",
+ "Flerovium",
+ "Moscovium",
+ "Livermorium",
+ "Tennessine",
+ "Oganesson"
+ };
- //Second 50 elements
- public final Material TANTALUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Tantalum);
- public final Material TUNGSTEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tungsten);
- public final Material RHENIUM = new Material("Rhenium", MaterialState.SOLID, new short[]{150, 150, 150}, 3180, 3627, 75, 111, false, "Re", 0);//Not a GT Inherited Material
- public final Material OSMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Osmium);
- public final Material IRIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Iridium);
- public final Material PLATINUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Platinum);
- public final Material GOLD = MaterialUtils.generateMaterialFromGtENUM(Materials.Gold);
- public final Material MERCURY = MaterialUtils.generateMaterialFromGtENUM(Materials.Mercury); //Mercury
- public final Material THALLIUM = new Material("Thallium", MaterialState.SOLID, new short[]{175, 175, 175}, 304, 1457, 81, 123, false, "Tl", 0);//Not a GT Inherited Material
- public final Material LEAD = MaterialUtils.generateMaterialFromGtENUM(Materials.Lead);
- public final Material BISMUTH = MaterialUtils.generateMaterialFromGtENUM(Materials.Bismuth);
- public final Material POLONIUM = new Material("Polonium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{180, 170, 180}, 254, 962, 84, 125, false, "Po", 1);//Not a GT Inherited Material
- public final Material ASTATINE = new Material("Astatine", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{170, 180, 170}, 302, 337, 85, 125, false, "At", 1);//Not a GT Inherited Material
- public final Material RADON = MaterialUtils.generateMaterialFromGtENUM(Materials.Radon);
- public final Material FRANCIUM = new Material("Francium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{170, 160, 170}, 27, 677, 87, 136, false, "Fr", 1);//Not a GT Inherited Material
- public final Material RADIUM = new Material("Radium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{165, 165, 165}, 700, 1737, 88, 138, false, "Ra", 1);//Not a GT Inherited Material
- public final Material ACTINIUM = new Material("Actinium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{150, 165, 165}, 1050, 3200, 89, 138, false, "Ac", 1);//Not a GT Inherited Material
- public final Material THORIUM = new Material("Thorium", MaterialState.SOLID, Materials.Thorium.mRGBa, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("Th"), 1);
- public final Material PROTACTINIUM = new Material("Protactinium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{190, 150, 170}, 1568, 4027, 91, 140, false, "Pa", 1);//Not a GT Inherited Material
- public final Material URANIUM238 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium);
- public final Material URANIUM235 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium235);
- public final Material NEPTUNIUM = new Material("Neptunium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{200, 220, 205}, 640, 3902, 93, 144, false, "Np", 2);//Not a GT Inherited Material
- public final Material PLUTONIUM244 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium);
- public final Material PLUTONIUM241 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium241);
- public final Material AMERICIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Americium); //Americium
- public final Material CURIUM = new Material("Curium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{175, 85, 110}, 1340, 3110, 96, 151, false, "Cm", 3);//Not a GT Inherited Material
- public final Material BERKELIUM = new Material("Berkelium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{110, 250, 85}, 985, 710, 97, 150, false, "Bk", 4);//Not a GT Inherited Material
- public final Material CALIFORNIUM = new Material("Californium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{85, 110, 205}, 899, 1472, 98, 153, false, "Cf", 4);//Not a GT Inherited Material
- public final Material EINSTEINIUM = new Material("Einsteinium", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{255, 85, 110}, 860, 3500, 99, 153, false, "Es", 5);//Not a GT Inherited Material //Boiling Point is made up
- public final Material FERMIUM = new Material("Fermium", MaterialState.LIQUID, TextureSets.NUCLEAR.get(), new short[]{75, 90, 25}, 1527, 3850, 100, 157, false, "Fm", 5);//Not a GT Inherited Material //Boiling Point is made up
+ // First 50 Elements
+ public final Material HYDROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Hydrogen);
+ public final Material HELIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Helium);
+ public final Material LITHIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lithium);
+ public final Material BERYLLIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Beryllium);
+ public final Material BORON = MaterialUtils.generateMaterialFromGtENUM(Materials.Boron);
+ public final Material CARBON = MaterialUtils.generateMaterialFromGtENUM(Materials.Carbon);
+ public final Material NITROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Nitrogen);
+ public final Material OXYGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Oxygen);
+ public final Material FLUORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Fluorine);
+ public final Material NEON = new Material(
+ "Neon",
+ MaterialState.PURE_GAS,
+ new short[] {240, 180, 30},
+ -248,
+ -246,
+ 10,
+ 10,
+ false,
+ "Ne",
+ 0); // Not a GT Inherited Material
+ public final Material SODIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Sodium);
+ public final Material MAGNESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Magnesium);
+ public final Material ALUMINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Aluminium);
+ public final Material ALUMINIUMOXIDE = MaterialUtils.generateMaterialFromGtENUM(Materials.Aluminiumoxide);
+ public final Material SILICON = MaterialUtils.generateMaterialFromGtENUM(Materials.Silicon);
+ public final Material SILICONDIOXIDE = MaterialUtils.generateMaterialFromGtENUM(Materials.SiliconDioxide);
+ public final Material PHOSPHORUS = MaterialUtils.generateMaterialFromGtENUM(Materials.Phosphor);
+ public final Material SULFUR = MaterialUtils.generateMaterialFromGtENUM(Materials.Sulfur);
+ public final Material CHLORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Chlorine);
+ public final Material ARGON = MaterialUtils.generateMaterialFromGtENUM(Materials.Argon);
+ public final Material POTASSIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Potassium);
+ public final Material CALCIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Calcium);
+ public final Material SCANDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Scandium);
+ public final Material TITANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Titanium);
+ public final Material VANADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Vanadium);
+ public final Material CHROMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Chrome);
+ public final Material MANGANESE = MaterialUtils.generateMaterialFromGtENUM(Materials.Manganese);
+ public final Material IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.Iron);
+ public final Material COBALT = MaterialUtils.generateMaterialFromGtENUM(Materials.Cobalt);
+ public final Material NICKEL = MaterialUtils.generateMaterialFromGtENUM(Materials.Nickel);
+ public final Material COPPER = MaterialUtils.generateMaterialFromGtENUM(Materials.Copper);
+ public final Material ZINC = MaterialUtils.generateMaterialFromGtENUM(Materials.Zinc);
+ public final Material GALLIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Gallium);
+ public final Material GERMANIUM = new Material(
+ "Germanium",
+ MaterialState.SOLID,
+ new short[] {200, 200, 200},
+ 937,
+ 2830,
+ 32,
+ 41,
+ false,
+ "Ge",
+ 0); // Not a GT Inherited Material
+ public final Material ARSENIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Arsenic);
+ public final Material SELENIUM = new Material(
+ "Selenium",
+ MaterialState.SOLID,
+ new short[] {190, 190, 190},
+ 217,
+ 685,
+ 34,
+ 45,
+ false,
+ "Se",
+ 0); // Not a GT Inherited Material
+ public final Material BROMINE = new Material(
+ "Bromine",
+ MaterialState.PURE_LIQUID,
+ new short[] {200, 25, 25},
+ -7,
+ 58,
+ 35,
+ 45,
+ false,
+ "Br",
+ 0); // Not a GT Inherited Material
+ public final Material KRYPTON = new Material(
+ "Krypton",
+ MaterialState.PURE_GAS,
+ new short[] {5, 200, 220},
+ -157,
+ -153,
+ 36,
+ 48,
+ false,
+ "Kr",
+ 0); // Not a GT Inherited Material
+ public final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium);
+ public final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(
+ Materials.Strontium, new short[] {230, 210, 110}, TextureSet.SET_FLINT);
+ public final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium);
+ public final Material ZIRCONIUM = new Material(
+ "Zirconium",
+ MaterialState.SOLID,
+ new short[] {255, 250, 205},
+ 1855,
+ 4377,
+ 40,
+ 51,
+ false,
+ "Zr",
+ 0); // Not a GT Inherited Material
+ public final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium);
+ public final Material MOLYBDENUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Molybdenum);
+ public final Material TECHNETIUM = new Material(
+ "Technetium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {220, 220, 220},
+ 2200,
+ 4877,
+ 43,
+ 55,
+ false,
+ "Tc",
+ 2); // Not a GT Inherited Material
+ public final Material RUTHENIUM = new Material(
+ "Ruthenium",
+ MaterialState.SOLID,
+ new short[] {220, 220, 220},
+ 2250,
+ 3900,
+ 44,
+ 57,
+ false,
+ "Ru",
+ 0); // Not a GT Inherited Material
+ public final Material RHODIUM = new Material(
+ "Rhodium",
+ MaterialState.SOLID,
+ new short[] {220, 220, 220},
+ 1966,
+ 3727,
+ 45,
+ 58,
+ false,
+ "Rh",
+ 0); // Not a GT Inherited Material
+ public final Material PALLADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Palladium);
+ public final Material SILVER = MaterialUtils.generateMaterialFromGtENUM(Materials.Silver);
+ public final Material CADMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Cadmium);
+ public final Material INDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Indium);
+ public final Material TIN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tin);
+ public final Material ANTIMONY = MaterialUtils.generateMaterialFromGtENUM(Materials.Antimony);
+ public final Material TELLURIUM = new Material(
+ "Tellurium",
+ MaterialState.SOLID,
+ new short[] {210, 210, 210},
+ 449,
+ 989,
+ 52,
+ 76,
+ false,
+ "Te",
+ 0); // Not a GT Inherited Material
+ public final Material IODINE = new Material(
+ "Iodine",
+ MaterialState.SOLID,
+ TextureSet.SET_SHINY,
+ new short[] {96, 96, 96},
+ 114,
+ 184,
+ 53,
+ 74,
+ false,
+ "I",
+ 0); // Not a GT Inherited Material
+ public final Material XENON = new Material(
+ "Xenon",
+ MaterialState.PURE_GAS,
+ new short[] {5, 105, 210},
+ -111,
+ -108,
+ 54,
+ 77,
+ false,
+ "Xe",
+ 0); // Not a GT Inherited Material
+ public final Material CAESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Caesium);
+ public final Material BARIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Barium);
+ public final Material LANTHANUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lanthanum);
+ public final Material CERIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Cerium);
+ public final Material PRASEODYMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Praseodymium);
+ public final Material NEODYMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Neodymium);
+ public final Material PROMETHIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Promethium);
+ public final Material SAMARIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Samarium);
+ public final Material EUROPIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Europium);
+ public final Material GADOLINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Gadolinium);
+ public final Material TERBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Terbium);
+ public final Material DYSPROSIUM = new Material(
+ "Dysprosium",
+ MaterialState.SOLID,
+ new short[] {180, 180, 180},
+ 1412,
+ 2562,
+ 66,
+ 97,
+ false,
+ "Dy",
+ 0); // Not a GT Inherited Material
+ public final Material HOLMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Holmium);
+ public final Material ERBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Erbium);
+ public final Material THULIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thulium);
+ public final Material YTTERBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Ytterbium);
+ public final Material LUTETIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lutetium);
+ public final Material HAFNIUM = new Material(
+ "Hafnium",
+ MaterialState.SOLID,
+ new short[] {128, 128, 128},
+ 2150,
+ 5400,
+ 72,
+ 106,
+ false,
+ "Hf",
+ 0); // Not a GT Inherited Material
- //Misc
- public final Material AER = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedAir, TextureSets.GEM_A.get());
- public final Material IGNIS = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedFire, TextureSets.GEM_A.get());
- public final Material TERRA = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedEarth, TextureSets.GEM_A.get());
- public final Material AQUA = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedWater, TextureSets.GEM_A.get());
- public final Material PERDITIO = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedEntropy, TextureSets.GEM_A.get());
- public final Material ORDO = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedOrder, TextureSets.GEM_A.get());
-
- //Fictional
- public final Material YELLORIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yellorium, new short[] {255, 242, 10}, TextureSets.NUCLEAR.get());
- public final Material NAQUADAH = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadah);
- public final Material NAQUADAH_ENRICHED = MaterialUtils.generateMaterialFromGtENUM(Materials.NaquadahEnriched);
- public final Material NAQUADRIA = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadria);
- public final Material TRINIUM;
- public final Material TRINIUM_REFINED;
- //https://github.com/Blood-Asp/GT5-Unofficial/issues/609
-
-
- //Custom Isotopes
- public final Material LITHIUM7 = new Material("Lithium 7", MaterialState.SOLID, TextureSet.SET_SHINY, Materials.Lithium.mRGBa, Materials.Lithium.mMeltingPoint, Materials.Lithium.mBlastFurnaceTemp, Materials.Lithium.getProtons(), Materials.Lithium.getNeutrons(), Materials.Lithium.mBlastFurnaceRequired, StringUtils.superscript("7Li"), 0, false);//Not a GT Inherited Material
- public final Material URANIUM232 = new Material("Uranium 232", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{88, 220, 103, 0}, 1132, 4131, 92, 140, false, StringUtils.superscript("232U"), 4);//Not a GT Inherited Material
- public final Material URANIUM233 = new Material("Uranium 233", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, StringUtils.superscript("233U"), 2);//Not a GT Inherited Material
- public final Material THORIUM232 = new Material("Thorium 232", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{15, 60, 15, 0}, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("232Th"), 1, true);//Not a GT Inherited Material
- public final Material PLUTONIUM239 = new Material("Plutonium-239", MaterialState.SOLID, TextureSets.NUCLEAR.get(), Materials.Plutonium.mDurability, Materials.Plutonium.mRGBa, Materials.Plutonium.mMeltingPoint, Materials.Plutonium.mBlastFurnaceTemp, 94, 145, false, StringUtils.superscript("239Pu"), 4, true);//Not a GT Inherited Material
- //RTG Fuels
- public final Material PLUTONIUM238 = new Material("Plutonium-238", MaterialState.SOLID, TextureSets.NUCLEAR.get(), Materials.Plutonium241.mDurability, Materials.Plutonium241.mRGBa, Materials.Plutonium241.mMeltingPoint, Materials.Plutonium241.mBlastFurnaceTemp, 94, 144, false, StringUtils.superscript("238Pu"), 2, false);//Not a GT Inherited Material
- public final Material STRONTIUM90 = new Material("Strontium-90", MaterialState.SOLID, TextureSets.NUCLEAR.get(), Materials.Strontium.mDurability, Materials.Strontium.mRGBa, Materials.Strontium.mMeltingPoint, Materials.Strontium.mBlastFurnaceTemp, 38, 52, false, StringUtils.superscript("90Sr"), 2, false);//Not a GT Inherited Material
- public final Material POLONIUM210 = new Material("Polonium-210", MaterialState.SOLID, TextureSets.NUCLEAR.get(), POLONIUM.vDurability, POLONIUM.getRGBA(), POLONIUM.getMeltingPointK(), POLONIUM.getBoilingPointK(), 84, 126, false, StringUtils.superscript("210Po"), 2, false);//Not a GT Inherited Material
- public final Material AMERICIUM241 = new Material("Americium-241", MaterialState.SOLID, TextureSets.NUCLEAR.get(), Materials.Americium.mDurability, Materials.Americium.mRGBa, Materials.Americium.mMeltingPoint, Materials.Americium.mBlastFurnaceTemp, 95, 146, false, StringUtils.superscript("241Am"), 2, false);//Not a GT Inherited Material
+ // Second 50 elements
+ public final Material TANTALUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Tantalum);
+ public final Material TUNGSTEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tungsten);
+ public final Material RHENIUM = new Material(
+ "Rhenium",
+ MaterialState.SOLID,
+ new short[] {150, 150, 150},
+ 3180,
+ 3627,
+ 75,
+ 111,
+ false,
+ "Re",
+ 0); // Not a GT Inherited Material
+ public final Material OSMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Osmium);
+ public final Material IRIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Iridium);
+ public final Material PLATINUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Platinum);
+ public final Material GOLD = MaterialUtils.generateMaterialFromGtENUM(Materials.Gold);
+ public final Material MERCURY = MaterialUtils.generateMaterialFromGtENUM(Materials.Mercury); // Mercury
+ public final Material THALLIUM = new Material(
+ "Thallium",
+ MaterialState.SOLID,
+ new short[] {175, 175, 175},
+ 304,
+ 1457,
+ 81,
+ 123,
+ false,
+ "Tl",
+ 0); // Not a GT Inherited Material
+ public final Material LEAD = MaterialUtils.generateMaterialFromGtENUM(Materials.Lead);
+ public final Material BISMUTH = MaterialUtils.generateMaterialFromGtENUM(Materials.Bismuth);
+ public final Material POLONIUM = new Material(
+ "Polonium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {180, 170, 180},
+ 254,
+ 962,
+ 84,
+ 125,
+ false,
+ "Po",
+ 1); // Not a GT Inherited Material
+ public final Material ASTATINE = new Material(
+ "Astatine",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {170, 180, 170},
+ 302,
+ 337,
+ 85,
+ 125,
+ false,
+ "At",
+ 1); // Not a GT Inherited Material
+ public final Material RADON = MaterialUtils.generateMaterialFromGtENUM(Materials.Radon);
+ public final Material FRANCIUM = new Material(
+ "Francium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {170, 160, 170},
+ 27,
+ 677,
+ 87,
+ 136,
+ false,
+ "Fr",
+ 1); // Not a GT Inherited Material
+ public final Material RADIUM = new Material(
+ "Radium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {165, 165, 165},
+ 700,
+ 1737,
+ 88,
+ 138,
+ false,
+ "Ra",
+ 1); // Not a GT Inherited Material
+ public final Material ACTINIUM = new Material(
+ "Actinium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {150, 165, 165},
+ 1050,
+ 3200,
+ 89,
+ 138,
+ false,
+ "Ac",
+ 1); // Not a GT Inherited Material
+ public final Material THORIUM = new Material(
+ "Thorium",
+ MaterialState.SOLID,
+ Materials.Thorium.mRGBa,
+ Materials.Thorium.mMeltingPoint,
+ Materials.Thorium.mBlastFurnaceTemp,
+ 90,
+ 142,
+ false,
+ StringUtils.superscript("Th"),
+ 1);
+ public final Material PROTACTINIUM = new Material(
+ "Protactinium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {190, 150, 170},
+ 1568,
+ 4027,
+ 91,
+ 140,
+ false,
+ "Pa",
+ 1); // Not a GT Inherited Material
+ public final Material URANIUM238 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium);
+ public final Material URANIUM235 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium235);
+ public final Material NEPTUNIUM = new Material(
+ "Neptunium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {200, 220, 205},
+ 640,
+ 3902,
+ 93,
+ 144,
+ false,
+ "Np",
+ 2); // Not a GT Inherited Material
+ public final Material PLUTONIUM244 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium);
+ public final Material PLUTONIUM241 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium241);
+ public final Material AMERICIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Americium); // Americium
+ public final Material CURIUM = new Material(
+ "Curium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {175, 85, 110},
+ 1340,
+ 3110,
+ 96,
+ 151,
+ false,
+ "Cm",
+ 3); // Not a GT Inherited Material
+ public final Material BERKELIUM = new Material(
+ "Berkelium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {110, 250, 85},
+ 985,
+ 710,
+ 97,
+ 150,
+ false,
+ "Bk",
+ 4); // Not a GT Inherited Material
+ public final Material CALIFORNIUM = new Material(
+ "Californium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {85, 110, 205},
+ 899,
+ 1472,
+ 98,
+ 153,
+ false,
+ "Cf",
+ 4); // Not a GT Inherited Material
+ public final Material EINSTEINIUM = new Material(
+ "Einsteinium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {255, 85, 110},
+ 860,
+ 3500,
+ 99,
+ 153,
+ false,
+ "Es",
+ 5); // Not a GT Inherited Material //Boiling Point is made up
+ public final Material FERMIUM = new Material(
+ "Fermium",
+ MaterialState.LIQUID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {75, 90, 25},
+ 1527,
+ 3850,
+ 100,
+ 157,
+ false,
+ "Fm",
+ 5); // Not a GT Inherited Material //Boiling Point is made up
- public final Material MAGIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Magic, new short[] {10, 185, 140});
- public final Material THAUMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thaumium);
-
- static {
- Logger.MATERIALS("Initialising Base Elements.");
- }
-
- private static final ELEMENT INSTANCE = new ELEMENT();
+ // Misc
+ public final Material AER = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedAir, TextureSets.GEM_A.get());
+ public final Material IGNIS =
+ MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedFire, TextureSets.GEM_A.get());
+ public final Material TERRA =
+ MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedEarth, TextureSets.GEM_A.get());
+ public final Material AQUA =
+ MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedWater, TextureSets.GEM_A.get());
+ public final Material PERDITIO =
+ MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedEntropy, TextureSets.GEM_A.get());
+ public final Material ORDO =
+ MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedOrder, TextureSets.GEM_A.get());
- public ELEMENT(){
- //GTNH Trinium Handling
- if (CORE.GTNH){
- //yay
- Materials a1 = MaterialUtils.getMaterial("Trinium");
- Materials a2 = Materials.valueOf("Trinium");
- Materials a3 = Materials.get("Trinium");
- Materials a4;
- if (a1 == null) {
- Logger.INFO("[Material] First attempt to find Trinium failed, using backup method.");
- if (a2 == null) {
- Logger.INFO("[Material] Fallback attempt to find Trinium failed, using second fallback.");
- if (a3 == null) {
- Logger.INFO("[Material] Fallback attempt to find Trinium failed, dumping materials.");
- for (Materials m : Materials.values()) {
- Logger.INFO("[Material] Found "+MaterialUtils.getMaterialName(m));
- }
- a4 = null;
- }
- else {
- Logger.INFO("[Material] a3 Found "+MaterialUtils.getMaterialName(a3));
- a4 = a3;
- }
- }
- else {
- Logger.INFO("[Material] a2 Found "+MaterialUtils.getMaterialName(a2));
- a4 = a2;
- }
- TRINIUM = MaterialUtils.generateMaterialFromGtENUM(a4);
- }
- else {
- Logger.INFO("[Material] a1 Found "+MaterialUtils.getMaterialName(a1));
- TRINIUM = MaterialUtils.generateMaterialFromGtENUM(a1);
- }
-
- TRINIUM_REFINED = TRINIUM;
-
- }
- else {
- TRINIUM = new Material("Trinium", MaterialState.SOLID, TextureSet.SET_FINE, new short[]{70, 110, 30}, 604, 4057, 181, 133, false, "Ke", 0, false);//Not a GT Inherited Material
- TRINIUM_REFINED = new Material("Refined Trinium", MaterialState.SOLID, TextureSets.REFINED.get(), new short[]{210, 255, 170}, 4304, 14057, 181, 133, false, "Ke", 0, new MaterialStack[]{new MaterialStack(TRINIUM, 1)});//Not a GT Inherited Material
- }
- }
+ // Fictional
+ public final Material YELLORIUM = MaterialUtils.generateMaterialFromGtENUM(
+ Materials.Yellorium, new short[] {255, 242, 10}, TextureSets.NUCLEAR.get());
+ public final Material NAQUADAH = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadah);
+ public final Material NAQUADAH_ENRICHED = MaterialUtils.generateMaterialFromGtENUM(Materials.NaquadahEnriched);
+ public final Material NAQUADRIA = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadria);
+ public final Material TRINIUM;
+ public final Material TRINIUM_REFINED;
+ // https://github.com/Blood-Asp/GT5-Unofficial/issues/609
- public static ELEMENT getInstance(){
- return INSTANCE;
- }
-
- public static class STANDALONE {
-
- public static final Material CELESTIAL_TUNGSTEN = new Material("Celestial Tungsten", MaterialState.SOLID, TextureSets.REFINED.get(), new short[] {50, 50, 50, 2}, INSTANCE.TUNGSTEN.getMeltingPointC()+6500, INSTANCE.TUNGSTEN.getBoilingPointC()+7500, 160, 101, true, "✦◆✦", 0);//Not a GT Inherited Material
- public static final Material ASTRAL_TITANIUM = new Material("Astral Titanium", MaterialState.SOLID, TextureSets.REFINED.get(), new short[] {220, 160, 240, 2}, INSTANCE.TITANIUM.getMeltingPointC()+7500, INSTANCE.TITANIUM.getBoilingPointC()+7500, 145, 133, true, "✧◇✧", 0);//Not a GT Inherited Material
- public static final Material CHRONOMATIC_GLASS = new Material("Chromatic Glass", MaterialState.SOLID, new short[]{255, 255, 255, 3}, 9200, 17550, 40, 51, false, "⌘☯𓍰 𓍱 𓍲 𓍳 𓍴 𓍵 𓍶 𓍷 𓍸 ☯⌘ ", 0);//Not a GT Inherited Material
- public static final Material ADVANCED_NITINOL = new Material("Advanced Nitinol", MaterialState.SOLID, TextureSets.ENRICHED.get(), ALLOY.NITINOL_60.getRGB(), 8400, 14377, 40, 51, true, "⚷⚙⚷ Ni4Ti6", 0);//Not a GT Inherited Material
- public static final Material HYPOGEN = new Material("Hypogen", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{220, 120, 75, 2}, 12255, 19377, 240, 251, true, "Hy⚶", 0);//Not a GT Inherited Material
- public static final Material RHUGNOR = new Material("Rhugnor", MaterialState.SOLID, TextureSets.ENRICHED.get(), new short[]{190, 0, 255, 0}, 8750, 14757, 184, 142, true, "Fs⚶", 0);//Not a GT Inherited Material //funeris
- public static final Material FORCE = new Material("Force", MaterialState.SOLID, TextureSets.ENRICHED.get(), new short[]{250, 250, 20, 0}, 4550, 6830, 63, 81, true, "Fc⚙", 0);//Not a GT Inherited Material
-
-
- //Runescape materials
- public static final Material BLACK_METAL = new Material("Black Metal", MaterialState.SOLID, TextureSet.SET_METALLIC, new short[] {5, 5, 5}, 2350, 4650, 24, 17, false, "҈", 0, new MaterialStack[]{new MaterialStack(getInstance().LEAD, 15), new MaterialStack(getInstance().MANGANESE, 25), new MaterialStack(getInstance().CARBON, 60)});//Not a GT Inherited Material
- public static final Material WHITE_METAL = new Material("White Metal", MaterialState.SOLID, TextureSet.SET_METALLIC, new short[] {255, 255, 255}, 4560, 7580, 35, 41, false, "҉", 0, new MaterialStack[]{new MaterialStack(getInstance().COPPER, 5), new MaterialStack(getInstance().ANTIMONY, 10), new MaterialStack(getInstance().PLATINUM, 10), new MaterialStack(getInstance().TIN, 75)});//Not a GT Inherited Material
-
- public static final Material GRANITE = new Material(
- "Ancient Granite",
- MaterialState.SOLID,
- TextureSet.SET_SAND,
- new short[] {107, 107, 107},
- 500,
- 2000,
- 16,
- 12,
- false,
- "«»",
- 0,
- false,
- new MaterialStack[]{
- new MaterialStack(getInstance().OXYGEN, 16),
- new MaterialStack(getInstance().IRON, 10),
- new MaterialStack(getInstance().SILICONDIOXIDE, 10),
- new MaterialStack(getInstance().ALUMINIUMOXIDE, 6),
- new MaterialStack(getInstance().POTASSIUM, 6),
- new MaterialStack(getInstance().CALCIUM, 4),
- new MaterialStack(getInstance().SODIUM, 4),
- new MaterialStack(getInstance().YTTERBIUM, 2)
- });//Not a GT Inherited Material
-
- public static final Material RUNITE = new Material("Runite", MaterialState.SOLID, TextureSet.SET_FINE, new short[] {60, 200, 190}, 6750, 11550, 73, 87, true, "§", 0);//Not a GT Inherited Material
- public static final Material DRAGON_METAL = new Material("Dragonblood", MaterialState.SOLID, TextureSet.SET_SHINY, new short[] {220, 40, 20, 2}, 10160, 17850, 96, 105, true, "۞", 0);//Not a GT Inherited Material
-
- }
+ // Custom Isotopes
+ public final Material LITHIUM7 = new Material(
+ "Lithium 7",
+ MaterialState.SOLID,
+ TextureSet.SET_SHINY,
+ Materials.Lithium.mRGBa,
+ Materials.Lithium.mMeltingPoint,
+ Materials.Lithium.mBlastFurnaceTemp,
+ Materials.Lithium.getProtons(),
+ Materials.Lithium.getNeutrons(),
+ Materials.Lithium.mBlastFurnaceRequired,
+ StringUtils.superscript("7Li"),
+ 0,
+ false); // Not a GT Inherited Material
+ public final Material URANIUM232 = new Material(
+ "Uranium 232",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {88, 220, 103, 0},
+ 1132,
+ 4131,
+ 92,
+ 140,
+ false,
+ StringUtils.superscript("232U"),
+ 4); // Not a GT Inherited Material
+ public final Material URANIUM233 = new Material(
+ "Uranium 233",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {73, 220, 83, 0},
+ 1132,
+ 4131,
+ 92,
+ 141,
+ false,
+ StringUtils.superscript("233U"),
+ 2); // Not a GT Inherited Material
+ public final Material THORIUM232 = new Material(
+ "Thorium 232",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {15, 60, 15, 0},
+ Materials.Thorium.mMeltingPoint,
+ Materials.Thorium.mBlastFurnaceTemp,
+ 90,
+ 142,
+ false,
+ StringUtils.superscript("232Th"),
+ 1,
+ true); // Not a GT Inherited Material
+ public final Material PLUTONIUM239 = new Material(
+ "Plutonium-239",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ Materials.Plutonium.mDurability,
+ Materials.Plutonium.mRGBa,
+ Materials.Plutonium.mMeltingPoint,
+ Materials.Plutonium.mBlastFurnaceTemp,
+ 94,
+ 145,
+ false,
+ StringUtils.superscript("239Pu"),
+ 4,
+ true); // Not a GT Inherited Material
+ // RTG Fuels
+ public final Material PLUTONIUM238 = new Material(
+ "Plutonium-238",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ Materials.Plutonium241.mDurability,
+ Materials.Plutonium241.mRGBa,
+ Materials.Plutonium241.mMeltingPoint,
+ Materials.Plutonium241.mBlastFurnaceTemp,
+ 94,
+ 144,
+ false,
+ StringUtils.superscript("238Pu"),
+ 2,
+ false); // Not a GT Inherited Material
+ public final Material STRONTIUM90 = new Material(
+ "Strontium-90",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ Materials.Strontium.mDurability,
+ Materials.Strontium.mRGBa,
+ Materials.Strontium.mMeltingPoint,
+ Materials.Strontium.mBlastFurnaceTemp,
+ 38,
+ 52,
+ false,
+ StringUtils.superscript("90Sr"),
+ 2,
+ false); // Not a GT Inherited Material
+ public final Material POLONIUM210 = new Material(
+ "Polonium-210",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ POLONIUM.vDurability,
+ POLONIUM.getRGBA(),
+ POLONIUM.getMeltingPointK(),
+ POLONIUM.getBoilingPointK(),
+ 84,
+ 126,
+ false,
+ StringUtils.superscript("210Po"),
+ 2,
+ false); // Not a GT Inherited Material
+ public final Material AMERICIUM241 = new Material(
+ "Americium-241",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ Materials.Americium.mDurability,
+ Materials.Americium.mRGBa,
+ Materials.Americium.mMeltingPoint,
+ Materials.Americium.mBlastFurnaceTemp,
+ 95,
+ 146,
+ false,
+ StringUtils.superscript("241Am"),
+ 2,
+ false); // Not a GT Inherited Material
+ public final Material MAGIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Magic, new short[] {10, 185, 140});
+ public final Material THAUMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thaumium);
+ static {
+ Logger.MATERIALS("Initialising Base Elements.");
+ }
+
+ private static final ELEMENT INSTANCE = new ELEMENT();
+
+ public ELEMENT() {
+ // GTNH Trinium Handling
+ if (CORE.GTNH) {
+ // yay
+ Materials a1 = MaterialUtils.getMaterial("Trinium");
+ Materials a2 = Materials.valueOf("Trinium");
+ Materials a3 = Materials.get("Trinium");
+ Materials a4;
+ if (a1 == null) {
+ Logger.INFO("[Material] First attempt to find Trinium failed, using backup method.");
+ if (a2 == null) {
+ Logger.INFO("[Material] Fallback attempt to find Trinium failed, using second fallback.");
+ if (a3 == null) {
+ Logger.INFO("[Material] Fallback attempt to find Trinium failed, dumping materials.");
+ for (Materials m : Materials.values()) {
+ Logger.INFO("[Material] Found " + MaterialUtils.getMaterialName(m));
+ }
+ a4 = null;
+ } else {
+ Logger.INFO("[Material] a3 Found " + MaterialUtils.getMaterialName(a3));
+ a4 = a3;
+ }
+ } else {
+ Logger.INFO("[Material] a2 Found " + MaterialUtils.getMaterialName(a2));
+ a4 = a2;
+ }
+ TRINIUM = MaterialUtils.generateMaterialFromGtENUM(a4);
+ } else {
+ Logger.INFO("[Material] a1 Found " + MaterialUtils.getMaterialName(a1));
+ TRINIUM = MaterialUtils.generateMaterialFromGtENUM(a1);
+ }
+
+ TRINIUM_REFINED = TRINIUM;
+
+ } else {
+ TRINIUM = new Material(
+ "Trinium",
+ MaterialState.SOLID,
+ TextureSet.SET_FINE,
+ new short[] {70, 110, 30},
+ 604,
+ 4057,
+ 181,
+ 133,
+ false,
+ "Ke",
+ 0,
+ false); // Not a GT Inherited Material
+ TRINIUM_REFINED = new Material(
+ "Refined Trinium",
+ MaterialState.SOLID,
+ TextureSets.REFINED.get(),
+ new short[] {210, 255, 170},
+ 4304,
+ 14057,
+ 181,
+ 133,
+ false,
+ "Ke",
+ 0,
+ new MaterialStack[] {new MaterialStack(TRINIUM, 1)}); // Not a GT Inherited Material
+ }
+ }
+
+ public static ELEMENT getInstance() {
+ return INSTANCE;
+ }
+
+ public static class STANDALONE {
+
+ public static final Material CELESTIAL_TUNGSTEN = new Material(
+ "Celestial Tungsten",
+ MaterialState.SOLID,
+ TextureSets.REFINED.get(),
+ new short[] {50, 50, 50, 2},
+ INSTANCE.TUNGSTEN.getMeltingPointC() + 6500,
+ INSTANCE.TUNGSTEN.getBoilingPointC() + 7500,
+ 160,
+ 101,
+ true,
+ "✦◆✦",
+ 0); // Not a GT Inherited Material
+ public static final Material ASTRAL_TITANIUM = new Material(
+ "Astral Titanium",
+ MaterialState.SOLID,
+ TextureSets.REFINED.get(),
+ new short[] {220, 160, 240, 2},
+ INSTANCE.TITANIUM.getMeltingPointC() + 7500,
+ INSTANCE.TITANIUM.getBoilingPointC() + 7500,
+ 145,
+ 133,
+ true,
+ "✧◇✧",
+ 0); // Not a GT Inherited Material
+ public static final Material CHRONOMATIC_GLASS = new Material(
+ "Chromatic Glass",
+ MaterialState.SOLID,
+ new short[] {255, 255, 255, 3},
+ 9200,
+ 17550,
+ 40,
+ 51,
+ false,
+ "⌘☯𓍰 𓍱 𓍲 𓍳 𓍴 𓍵 𓍶 𓍷 𓍸 ☯⌘ ",
+ 0); // Not a GT Inherited Material
+ public static final Material ADVANCED_NITINOL = new Material(
+ "Advanced Nitinol",
+ MaterialState.SOLID,
+ TextureSets.ENRICHED.get(),
+ ALLOY.NITINOL_60.getRGB(),
+ 8400,
+ 14377,
+ 40,
+ 51,
+ true,
+ "⚷⚙⚷ Ni4Ti6",
+ 0); // Not a GT Inherited Material
+ public static final Material HYPOGEN = new Material(
+ "Hypogen",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] {220, 120, 75, 2},
+ 12255,
+ 19377,
+ 240,
+ 251,
+ true,
+ "Hy⚶",
+ 0); // Not a GT Inherited Material
+ public static final Material RHUGNOR = new Material(
+ "Rhugnor",
+ MaterialState.SOLID,
+ TextureSets.ENRICHED.get(),
+ new short[] {190, 0, 255, 0},
+ 8750,
+ 14757,
+ 184,
+ 142,
+ true,
+ "Fs⚶",
+ 0); // Not a GT Inherited Material //funeris
+ public static final Material FORCE = new Material(
+ "Force",
+ MaterialState.SOLID,
+ TextureSets.ENRICHED.get(),
+ new short[] {250, 250, 20, 0},
+ 4550,
+ 6830,
+ 63,
+ 81,
+ true,
+ "Fc⚙",
+ 0); // Not a GT Inherited Material
+
+ // Runescape materials
+ public static final Material BLACK_METAL = new Material(
+ "Black Metal",
+ MaterialState.SOLID,
+ TextureSet.SET_METALLIC,
+ new short[] {5, 5, 5},
+ 2350,
+ 4650,
+ 24,
+ 17,
+ false,
+ "҈",
+ 0,
+ new MaterialStack[] {
+ new MaterialStack(getInstance().LEAD, 15),
+ new MaterialStack(getInstance().MANGANESE, 25),
+ new MaterialStack(getInstance().CARBON, 60)
+ }); // Not a GT Inherited Material
+ public static final Material WHITE_METAL = new Material(
+ "White Metal",
+ MaterialState.SOLID,
+ TextureSet.SET_METALLIC,
+ new short[] {255, 255, 255},
+ 4560,
+ 7580,
+ 35,
+ 41,
+ false,
+ "҉",
+ 0,
+ new MaterialStack[] {
+ new MaterialStack(getInstance().COPPER, 5),
+ new MaterialStack(getInstance().ANTIMONY, 10),
+ new MaterialStack(getInstance().PLATINUM, 10),
+ new MaterialStack(getInstance().TIN, 75)
+ }); // Not a GT Inherited Material
+
+ public static final Material GRANITE = new Material(
+ "Ancient Granite",
+ MaterialState.SOLID,
+ TextureSet.SET_SAND,
+ new short[] {107, 107, 107},
+ 500,
+ 2000,
+ 16,
+ 12,
+ false,
+ "«»",
+ 0,
+ false,
+ new MaterialStack[] {
+ new MaterialStack(getInstance().OXYGEN, 16),
+ new MaterialStack(getInstance().IRON, 10),
+ new MaterialStack(getInstance().SILICONDIOXIDE, 10),
+ new MaterialStack(getInstance().ALUMINIUMOXIDE, 6),
+ new MaterialStack(getInstance().POTASSIUM, 6),
+ new MaterialStack(getInstance().CALCIUM, 4),
+ new MaterialStack(getInstance().SODIUM, 4),
+ new MaterialStack(getInstance().YTTERBIUM, 2)
+ }); // Not a GT Inherited Material
+
+ public static final Material RUNITE = new Material(
+ "Runite",
+ MaterialState.SOLID,
+ TextureSet.SET_FINE,
+ new short[] {60, 200, 190},
+ 6750,
+ 11550,
+ 73,
+ 87,
+ true,
+ "§",
+ 0); // Not a GT Inherited Material
+ public static final Material DRAGON_METAL = new Material(
+ "Dragonblood",
+ MaterialState.SOLID,
+ TextureSet.SET_SHINY,
+ new short[] {220, 40, 20, 2},
+ 10160,
+ 17850,
+ 96,
+ 105,
+ true,
+ "۞",
+ 0); // Not a GT Inherited Material
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/material/Ion.java b/src/main/java/gtPlusPlus/core/material/Ion.java
index 2b5b113b92..37dc59f642 100644
--- a/src/main/java/gtPlusPlus/core/material/Ion.java
+++ b/src/main/java/gtPlusPlus/core/material/Ion.java
@@ -2,29 +2,29 @@ package gtPlusPlus.core.material;
public class Ion {
- private final Material mElement;
- private final boolean mContainsPositiveCharge;
- private final int mTotalIonization;
+ private final Material mElement;
+ private final boolean mContainsPositiveCharge;
+ private final int mTotalIonization;
- public Ion(Material aMat, int chargeAmount) {
- mElement = aMat;
- mContainsPositiveCharge = (chargeAmount >= 0);
- mTotalIonization = chargeAmount;
- }
-
- public synchronized final Material getElement() {
- return mElement;
- }
+ public Ion(Material aMat, int chargeAmount) {
+ mElement = aMat;
+ mContainsPositiveCharge = (chargeAmount >= 0);
+ mTotalIonization = chargeAmount;
+ }
- public synchronized final boolean containsPositiveCharge() {
- return mContainsPositiveCharge;
- }
+ public final synchronized Material getElement() {
+ return mElement;
+ }
- public synchronized final int getTotalIonization() {
- return mTotalIonization;
- }
-
- public final boolean isNeutral() {
- return mTotalIonization == 0;
- }
+ public final synchronized boolean containsPositiveCharge() {
+ return mContainsPositiveCharge;
+ }
+
+ public final synchronized int getTotalIonization() {
+ return mTotalIonization;
+ }
+
+ public final boolean isNeutral() {
+ return mTotalIonization == 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java
index 1b681cd9fa..c70013bac3 100644
--- a/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java
+++ b/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java
@@ -7,600 +7,596 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
-public final class MISC_MATERIALS {
-
- /*
- * Some of these materials purely exist as data objects, items will most likely be assigned seperately.
- * Most are just compositions which will have dusts assigned to them.
- */
-
- public static void run() {
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(POTASSIUM_NITRATE, false);
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_NITRATE, false);
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_OXIDE, false);
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_HYDROXIDE, false);
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(CYANOACETIC_ACID, false);
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_CYANIDE, false);
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(CALCIUM_CHLORIDE, false);
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(COPPER_SULFATE, false);
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(COPPER_SULFATE_HYDRATED, false);
- WATER.registerComponentForMaterial(FluidUtils.getWater(1000));
- }
-
- public static final Material POTASSIUM_NITRATE = new Material(
- "Potassium Nitrate",
- MaterialState.SOLID, //State
- null,
- null,
- -1,
- -1,
- -1,
- -1,
- false,
- "KNO3",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().POTASSIUM, 1),
- new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 3));
- public static final Material SODIUM_NITRATE = new Material(
- "Sodium Nitrate",
- MaterialState.SOLID, //State
- null,
- null,
- -1,
- -1,
- -1,
- -1,
- false,
- "NaNO3",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().SODIUM, 1),
- new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 3));
-
- public static final Material SOLAR_SALT_COLD = new Material(
- "Solar Salt (Cold)",
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(POTASSIUM_NITRATE, 4),
- new MaterialStack(SODIUM_NITRATE, 6));
-
- public static final Material SOLAR_SALT_HOT = new Material(
- "Solar Salt (Hot)",
- MaterialState.PURE_LIQUID, //State
- new short[] {200, 25, 25}, //Material Colour
- 1200, //Melting Point in C
- 3300, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(POTASSIUM_NITRATE, 4),
- new MaterialStack(SODIUM_NITRATE, 6));
-
- public static final Material STRONTIUM_OXIDE = new Material(
- "Strontium Oxide",
- MaterialState.SOLID,
- TextureSet.SET_METALLIC,
- null,
- -1,
- -1,
- -1,
- -1,
- false,
- "SrO",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 1));
-
- public static final Material SELENIUM_DIOXIDE = new Material(
- "Selenium Dioxide",
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(ELEMENT.getInstance().SELENIUM, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 2));
-
- public static final Material SELENIOUS_ACID = new Material(
- "Selenious Acid",
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(SELENIUM_DIOXIDE, 1),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 8),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 4));
-
- public static final Material HYDROGEN_CYANIDE = new Material(
- "Hydrogen Cyanide",
- MaterialState.PURE_GAS, //State
- null, //Material Colour
- 4, //Melting Point in C
- 26, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().CARBON, 1),
- new MaterialStack(ELEMENT.getInstance().NITROGEN, 1));
-
- public static final Material CARBON_MONOXIDE = new Material(
- "Carbon Monoxide",
- MaterialState.PURE_GAS, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(ELEMENT.getInstance().CARBON, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 1));
-
- public static final Material CARBON_DIOXIDE = new Material(
- "Carbon Dioxide",
- MaterialState.PURE_GAS, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(ELEMENT.getInstance().CARBON, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 2));
-
- public static final Material WOODS_GLASS = new Material(
- "Wood's Glass", //Material Name
- MaterialState.SOLID, //State
- TextureSets.GEM_A.get(), //Texture Set
- new short[] {220, 60, 255}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- false,
- "Si4Ba3Na2Ni",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().SILICON, 40),
- new MaterialStack(ELEMENT.getInstance().BARIUM, 30),
- new MaterialStack(ELEMENT.getInstance().SODIUM, 20),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 10));
-
-
- /*
- * Rare Earth Materials
- */
-
- public static final Material RARE_EARTH_LOW = new Material(
- "Rare Earth (I)", //Material Name
- MaterialState.ORE, //State
- TextureSets.GEM_A.get(), //Texture Set
- null, //Material Colour
- 1200,
- 2500,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ORES.GREENOCKITE, 1),
- new MaterialStack(ORES.LANTHANITE_CE, 1),
- new MaterialStack(ORES.AGARDITE_CD, 1),
- new MaterialStack(ORES.YTTRIALITE, 1),
- new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.NetherQuartz), 1),
- new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Galena), 1),
- new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Chalcopyrite), 1),
- new MaterialStack(ORES.CRYOLITE, 1),
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1)
- });
-
- public static final Material RARE_EARTH_MID = new Material(
- "Rare Earth (II)", //Material Name
- MaterialState.ORE, //State
- TextureSets.ENRICHED.get(), //Texture Set
- null, //Material Colour
- 3500,
- 5000,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ORES.LANTHANITE_ND, 1),
- new MaterialStack(ORES.AGARDITE_ND, 1),
- new MaterialStack(ORES.YTTRIAITE, 1),
- new MaterialStack(ORES.CROCROITE, 1),
- new MaterialStack(ORES.NICHROMITE, 1),
- new MaterialStack(ORES.ZIRCON, 1),
- new MaterialStack(ELEMENT.STANDALONE.GRANITE, 1),
- new MaterialStack(ELEMENT.STANDALONE.BLACK_METAL, 1),
- new MaterialStack(ELEMENT.STANDALONE.RUNITE, 1)
- });
-
- public static final Material RARE_EARTH_HIGH = new Material(
- "Rare Earth (III)", //Material Name
- MaterialState.ORE, //State
- TextureSets.REFINED.get(), //Texture Set
- null, //Material Colour
- 5200,
- 7500,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ORES.GADOLINITE_Y, 1),
- new MaterialStack(ORES.LEPERSONNITE, 1),
- new MaterialStack(ORES.FLORENCITE, 1),
- new MaterialStack(ORES.FLUORCAPHITE, 1),
- new MaterialStack(ORES.LAUTARITE, 1),
- new MaterialStack(ORES.DEMICHELEITE_BR, 1),
- new MaterialStack(ORES.ALBURNITE, 1),
- new MaterialStack(ORES.SAMARSKITE_Y, 1),
- new MaterialStack(ORES.AGARDITE_LA, 1),
- });
-
- public static final Material WATER = new Material(
- "Water",
- MaterialState.PURE_LIQUID,
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 1));
-
- //OH
- public static final Material HYDROXIDE = new Material(
- "Hydroxide", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 1),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1));
-
- //NH3
- public static final Material AMMONIA = new Material(
- "Ammonia", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -77, //Melting Point in C
- -33, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3));
-
- //NH4
- public static final Material AMMONIUM = new Material(
- "Ammonium", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4));
-
-
- public static final Material HYDROGEN_CHLORIDE = new Material(
- "Hydrogen Chloride",
- MaterialState.PURE_GAS,
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 1));
-
-
- public static final Material SODIUM_CHLORIDE = new Material(
- "Sodium Chloride",
- MaterialState.PURE_GAS,
- new MaterialStack(ELEMENT.getInstance().SODIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 1));
-
-
- public static final Material SODIUM_HYDROXIDE = new Material(
- "Sodium Hydroxide",
- MaterialState.PURE_GAS,
- new MaterialStack(ELEMENT.getInstance().SODIUM, 1),
- new MaterialStack(HYDROXIDE, 1));
-
- public static final Material SALT_WATER = new Material(
- "Salt Water",
- MaterialState.PURE_LIQUID,
- new MaterialStack(WATER, 3),
- new MaterialStack(SODIUM_CHLORIDE, 1));
-
- public static final Material BRINE = new Material(
- "Brine",
- MaterialState.PURE_LIQUID,
- new MaterialStack(SALT_WATER, 1),
- new MaterialStack(SODIUM_CHLORIDE, 2));
-
- public static final Material STRONTIUM_HYDROXIDE = new Material(
- "Strontium Hydroxide",
- MaterialState.SOLID,
- TextureSet.SET_METALLIC,
- null,
- -1,
- -1,
- -1,
- -1,
- false,
- "Sr(OH)2",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
- new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2));
-
- // Glue Chemicals
-
- public static final Material ACETIC_ANHYDRIDE = new Material(
- "Acetic Anhydride",
- MaterialState.PURE_LIQUID, //State
- new short[] {250, 240, 110}, //Material Colour
- -73, //Melting Point in C
- 139, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "(CH3CO)2O",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().CARBON, 4),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 6),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 3));
-
- public static final Material CHLOROACETIC_ACID = new Material(
- "Chloroacetic Acid",
- MaterialState.PURE_LIQUID, //State
- new short[] {230, 200, 90}, //Material Colour
- 63, //Melting Point in C
- 189, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "ClCH2-COOH",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().CARBON, 2),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 1));
-
- public static final Material DICHLOROACETIC_ACID = new Material(
- "Dichloroacetic Acid",
- MaterialState.PURE_LIQUID, //State
- new short[] {190, 160, 60}, //Material Colour
- 13, //Melting Point in C
- 194, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "Cl2CH-COOH",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().CARBON, 2),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 2));
-
- public static final Material TRICHLOROACETIC_ACID = new Material(
- "Trichloroacetic Acid",
- MaterialState.PURE_LIQUID, //State
- new short[] {120, 100, 30}, //Material Colour
- 57, //Melting Point in C
- 196, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "Cl3C-COOH",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().CARBON, 2),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 3));
-
- public static final Material CHLOROACETIC_MIXTURE = new Material(
- "Chloroacetic Mixture",
- MaterialState.LIQUID, //State
- null,
- new short[] {210, 160, 10},
- 40,
- 192,
- -1,
- -1,
- false,
- "Cl?H?C-COOH",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().CARBON, 6),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 6),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 6),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 6));
-
- public static final Material SODIUM_CYANIDE = new Material(
- "Sodium Cyanide",
- MaterialState.SOLID, //State
- new short[] {180, 190, 255}, //Material Colour
- 563, //Melting Point in C
- 1496, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "NaCN",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().SODIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CARBON, 1),
- new MaterialStack(ELEMENT.getInstance().NITROGEN, 1));
-
- public static final Material CALCIUM_CHLORIDE = new Material(
- "Calcium Chloride",
- MaterialState.SOLID, //State
- new short[] {180, 190, 255}, //Material Colour
- 563, //Melting Point in C
- 1496, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "CaCl2",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 2));
-
- public static final Material CYANOACETIC_ACID = new Material(
- "Cyanoacetic Acid",
- MaterialState.SOLID, //State
- new short[] {130, 130, 40}, //Material Colour
- 66, //Melting Point in C
- 108, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "C3H3NO2",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().CARBON, 3),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3),
- new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 2));
-
- public static final Material SOLID_ACID_MIXTURE = new Material(
- "Solid Acid Catalyst Mixture",
- MaterialState.LIQUID, //State
- new short[] {80, 40, 0}, //Material Colour
- -10, //Melting Point in C
- 337, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "?H2SO4?",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 4));
-
- public static final Material COPPER_SULFATE = new Material(
- "Copper(II) Sulfate",
- MaterialState.SOLID, //State
- new short[] {200, 200, 200}, //Material Colour
- 590, //Melting Point in C
- 650, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "CuSO4",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().COPPER, 1),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 4));
-
- public static final Material COPPER_SULFATE_HYDRATED = new Material(
- "Copper(II) Sulfate Pentahydrate",
- MaterialState.SOLID, //State
- new short[] {90, 170, 255}, //Material Colour
- 590, //Melting Point in C
- 650, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "CuSO4∙(H2O)5",
- 0,
- false,
- new MaterialStack(ELEMENT.getInstance().COPPER, 1),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 4));
-
- public static final Material ETHYL_CYANOACETATE = new Material(
- "Ethyl Cyanoacetate",
- MaterialState.PURE_LIQUID, //State
- new short[] {0, 75, 160}, //Material Colour
- -22, //Melting Point in C
- 210, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "C5H7NO2",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().CARBON, 2),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 3));
-
- public static final Material CYANOACRYLATE_POLYMER = new Material(
- "Cyanoacrylate Polymer",
- MaterialState.LIQUID, //State
- new short[] {140, 150, 160}, //Material Colour
- -25, //Melting Point in C
- 55, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "(-C6H7NO2-)n",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().CARBON, 2),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 3));
-
- public static final Material ETHYL_CYANOACRYLATE = new Material(
- "Ethyl Cyanoacrylate (Super Glue)",
- MaterialState.PURE_LIQUID, //State
- new short[] {170, 190, 200}, //Material Colour
- -25, //Melting Point in C
- 55, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "C6H7NO2",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().CARBON, 2),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 3));
-
- public static final Material MUTATED_LIVING_SOLDER = new Material(
- "Mutated Living Solder",
- MaterialState.PURE_LIQUID, //State
- new short[] {147, 109, 155}, //Material Colour
- -200, //Melting Point in C
- 500, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- "?Sn?Bi?",
- 0,
- true,
- new MaterialStack(ELEMENT.getInstance().TIN, 1),
- new MaterialStack(ELEMENT.getInstance().BISMUTH, 1));
+public final class MISC_MATERIALS {
+
+ /*
+ * Some of these materials purely exist as data objects, items will most likely be assigned seperately.
+ * Most are just compositions which will have dusts assigned to them.
+ */
+
+ public static void run() {
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(POTASSIUM_NITRATE, false);
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_NITRATE, false);
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_OXIDE, false);
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_HYDROXIDE, false);
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(CYANOACETIC_ACID, false);
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_CYANIDE, false);
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(CALCIUM_CHLORIDE, false);
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(COPPER_SULFATE, false);
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(COPPER_SULFATE_HYDRATED, false);
+ WATER.registerComponentForMaterial(FluidUtils.getWater(1000));
+ }
+
+ public static final Material POTASSIUM_NITRATE = new Material(
+ "Potassium Nitrate",
+ MaterialState.SOLID, // State
+ null,
+ null,
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "KNO3",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().POTASSIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3));
+ public static final Material SODIUM_NITRATE = new Material(
+ "Sodium Nitrate",
+ MaterialState.SOLID, // State
+ null,
+ null,
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "NaNO3",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3));
+
+ public static final Material SOLAR_SALT_COLD = new Material(
+ "Solar Salt (Cold)",
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(POTASSIUM_NITRATE, 4),
+ new MaterialStack(SODIUM_NITRATE, 6));
+
+ public static final Material SOLAR_SALT_HOT = new Material(
+ "Solar Salt (Hot)",
+ MaterialState.PURE_LIQUID, // State
+ new short[] {200, 25, 25}, // Material Colour
+ 1200, // Melting Point in C
+ 3300, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(POTASSIUM_NITRATE, 4),
+ new MaterialStack(SODIUM_NITRATE, 6));
+
+ public static final Material STRONTIUM_OXIDE = new Material(
+ "Strontium Oxide",
+ MaterialState.SOLID,
+ TextureSet.SET_METALLIC,
+ null,
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "SrO",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1));
+
+ public static final Material SELENIUM_DIOXIDE = new Material(
+ "Selenium Dioxide",
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(ELEMENT.getInstance().SELENIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2));
+
+ public static final Material SELENIOUS_ACID = new Material(
+ "Selenious Acid",
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(SELENIUM_DIOXIDE, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 8),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 4));
+
+ public static final Material HYDROGEN_CYANIDE = new Material(
+ "Hydrogen Cyanide",
+ MaterialState.PURE_GAS, // State
+ null, // Material Colour
+ 4, // Melting Point in C
+ 26, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 1),
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 1));
+
+ public static final Material CARBON_MONOXIDE = new Material(
+ "Carbon Monoxide",
+ MaterialState.PURE_GAS, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(ELEMENT.getInstance().CARBON, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1));
+
+ public static final Material CARBON_DIOXIDE = new Material(
+ "Carbon Dioxide",
+ MaterialState.PURE_GAS, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(ELEMENT.getInstance().CARBON, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2));
+
+ public static final Material WOODS_GLASS = new Material(
+ "Wood's Glass", // Material Name
+ MaterialState.SOLID, // State
+ TextureSets.GEM_A.get(), // Texture Set
+ new short[] {220, 60, 255}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "Si4Ba3Na2Ni",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().SILICON, 40),
+ new MaterialStack(ELEMENT.getInstance().BARIUM, 30),
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 20),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 10));
+
+ /*
+ * Rare Earth Materials
+ */
+
+ public static final Material RARE_EARTH_LOW = new Material(
+ "Rare Earth (I)", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.GEM_A.get(), // Texture Set
+ null, // Material Colour
+ 1200,
+ 2500,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ORES.GREENOCKITE, 1),
+ new MaterialStack(ORES.LANTHANITE_CE, 1),
+ new MaterialStack(ORES.AGARDITE_CD, 1),
+ new MaterialStack(ORES.YTTRIALITE, 1),
+ new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.NetherQuartz), 1),
+ new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Galena), 1),
+ new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Chalcopyrite), 1),
+ new MaterialStack(ORES.CRYOLITE, 1),
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1)
+ });
+
+ public static final Material RARE_EARTH_MID = new Material(
+ "Rare Earth (II)", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.ENRICHED.get(), // Texture Set
+ null, // Material Colour
+ 3500,
+ 5000,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ORES.LANTHANITE_ND, 1),
+ new MaterialStack(ORES.AGARDITE_ND, 1),
+ new MaterialStack(ORES.YTTRIAITE, 1),
+ new MaterialStack(ORES.CROCROITE, 1),
+ new MaterialStack(ORES.NICHROMITE, 1),
+ new MaterialStack(ORES.ZIRCON, 1),
+ new MaterialStack(ELEMENT.STANDALONE.GRANITE, 1),
+ new MaterialStack(ELEMENT.STANDALONE.BLACK_METAL, 1),
+ new MaterialStack(ELEMENT.STANDALONE.RUNITE, 1)
+ });
+
+ public static final Material RARE_EARTH_HIGH = new Material(
+ "Rare Earth (III)", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.REFINED.get(), // Texture Set
+ null, // Material Colour
+ 5200,
+ 7500,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ORES.GADOLINITE_Y, 1),
+ new MaterialStack(ORES.LEPERSONNITE, 1),
+ new MaterialStack(ORES.FLORENCITE, 1),
+ new MaterialStack(ORES.FLUORCAPHITE, 1),
+ new MaterialStack(ORES.LAUTARITE, 1),
+ new MaterialStack(ORES.DEMICHELEITE_BR, 1),
+ new MaterialStack(ORES.ALBURNITE, 1),
+ new MaterialStack(ORES.SAMARSKITE_Y, 1),
+ new MaterialStack(ORES.AGARDITE_LA, 1),
+ });
+
+ public static final Material WATER = new Material(
+ "Water",
+ MaterialState.PURE_LIQUID,
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1));
+
+ // OH
+ public static final Material HYDROXIDE = new Material(
+ "Hydroxide", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1));
+
+ // NH3
+ public static final Material AMMONIA = new Material(
+ "Ammonia", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -77, // Melting Point in C
+ -33, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3));
+
+ // NH4
+ public static final Material AMMONIUM = new Material(
+ "Ammonium", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4));
+
+ public static final Material HYDROGEN_CHLORIDE = new Material(
+ "Hydrogen Chloride",
+ MaterialState.PURE_GAS,
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 1));
+
+ public static final Material SODIUM_CHLORIDE = new Material(
+ "Sodium Chloride",
+ MaterialState.PURE_GAS,
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 1));
+
+ public static final Material SODIUM_HYDROXIDE = new Material(
+ "Sodium Hydroxide",
+ MaterialState.PURE_GAS,
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 1),
+ new MaterialStack(HYDROXIDE, 1));
+
+ public static final Material SALT_WATER = new Material(
+ "Salt Water",
+ MaterialState.PURE_LIQUID,
+ new MaterialStack(WATER, 3),
+ new MaterialStack(SODIUM_CHLORIDE, 1));
+
+ public static final Material BRINE = new Material(
+ "Brine",
+ MaterialState.PURE_LIQUID,
+ new MaterialStack(SALT_WATER, 1),
+ new MaterialStack(SODIUM_CHLORIDE, 2));
+
+ public static final Material STRONTIUM_HYDROXIDE = new Material(
+ "Strontium Hydroxide",
+ MaterialState.SOLID,
+ TextureSet.SET_METALLIC,
+ null,
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "Sr(OH)2",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
+ new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2));
+
+ // Glue Chemicals
+
+ public static final Material ACETIC_ANHYDRIDE = new Material(
+ "Acetic Anhydride",
+ MaterialState.PURE_LIQUID, // State
+ new short[] {250, 240, 110}, // Material Colour
+ -73, // Melting Point in C
+ 139, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "(CH3CO)2O",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().CARBON, 4),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 6),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3));
+
+ public static final Material CHLOROACETIC_ACID = new Material(
+ "Chloroacetic Acid",
+ MaterialState.PURE_LIQUID, // State
+ new short[] {230, 200, 90}, // Material Colour
+ 63, // Melting Point in C
+ 189, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "ClCH2-COOH",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().CARBON, 2),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 1));
+
+ public static final Material DICHLOROACETIC_ACID = new Material(
+ "Dichloroacetic Acid",
+ MaterialState.PURE_LIQUID, // State
+ new short[] {190, 160, 60}, // Material Colour
+ 13, // Melting Point in C
+ 194, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "Cl2CH-COOH",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().CARBON, 2),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 2));
+
+ public static final Material TRICHLOROACETIC_ACID = new Material(
+ "Trichloroacetic Acid",
+ MaterialState.PURE_LIQUID, // State
+ new short[] {120, 100, 30}, // Material Colour
+ 57, // Melting Point in C
+ 196, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "Cl3C-COOH",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().CARBON, 2),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 3));
+
+ public static final Material CHLOROACETIC_MIXTURE = new Material(
+ "Chloroacetic Mixture",
+ MaterialState.LIQUID, // State
+ null,
+ new short[] {210, 160, 10},
+ 40,
+ 192,
+ -1,
+ -1,
+ false,
+ "Cl?H?C-COOH",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().CARBON, 6),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 6),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 6),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 6));
+
+ public static final Material SODIUM_CYANIDE = new Material(
+ "Sodium Cyanide",
+ MaterialState.SOLID, // State
+ new short[] {180, 190, 255}, // Material Colour
+ 563, // Melting Point in C
+ 1496, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "NaCN",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 1),
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 1));
+
+ public static final Material CALCIUM_CHLORIDE = new Material(
+ "Calcium Chloride",
+ MaterialState.SOLID, // State
+ new short[] {180, 190, 255}, // Material Colour
+ 563, // Melting Point in C
+ 1496, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "CaCl2",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 2));
+
+ public static final Material CYANOACETIC_ACID = new Material(
+ "Cyanoacetic Acid",
+ MaterialState.SOLID, // State
+ new short[] {130, 130, 40}, // Material Colour
+ 66, // Melting Point in C
+ 108, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "C3H3NO2",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().CARBON, 3),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3),
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2));
+
+ public static final Material SOLID_ACID_MIXTURE = new Material(
+ "Solid Acid Catalyst Mixture",
+ MaterialState.LIQUID, // State
+ new short[] {80, 40, 0}, // Material Colour
+ -10, // Melting Point in C
+ 337, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "?H2SO4?",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 4));
+
+ public static final Material COPPER_SULFATE = new Material(
+ "Copper(II) Sulfate",
+ MaterialState.SOLID, // State
+ new short[] {200, 200, 200}, // Material Colour
+ 590, // Melting Point in C
+ 650, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "CuSO4",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().COPPER, 1),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 4));
+
+ public static final Material COPPER_SULFATE_HYDRATED = new Material(
+ "Copper(II) Sulfate Pentahydrate",
+ MaterialState.SOLID, // State
+ new short[] {90, 170, 255}, // Material Colour
+ 590, // Melting Point in C
+ 650, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "CuSO4∙(H2O)5",
+ 0,
+ false,
+ new MaterialStack(ELEMENT.getInstance().COPPER, 1),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 4));
+
+ public static final Material ETHYL_CYANOACETATE = new Material(
+ "Ethyl Cyanoacetate",
+ MaterialState.PURE_LIQUID, // State
+ new short[] {0, 75, 160}, // Material Colour
+ -22, // Melting Point in C
+ 210, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "C5H7NO2",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().CARBON, 2),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 3));
+
+ public static final Material CYANOACRYLATE_POLYMER = new Material(
+ "Cyanoacrylate Polymer",
+ MaterialState.LIQUID, // State
+ new short[] {140, 150, 160}, // Material Colour
+ -25, // Melting Point in C
+ 55, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "(-C6H7NO2-)n",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().CARBON, 2),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 3));
+
+ public static final Material ETHYL_CYANOACRYLATE = new Material(
+ "Ethyl Cyanoacrylate (Super Glue)",
+ MaterialState.PURE_LIQUID, // State
+ new short[] {170, 190, 200}, // Material Colour
+ -25, // Melting Point in C
+ 55, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "C6H7NO2",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().CARBON, 2),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 3));
+
+ public static final Material MUTATED_LIVING_SOLDER = new Material(
+ "Mutated Living Solder",
+ MaterialState.PURE_LIQUID, // State
+ new short[] {147, 109, 155}, // Material Colour
+ -200, // Melting Point in C
+ 500, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ "?Sn?Bi?",
+ 0,
+ true,
+ new MaterialStack(ELEMENT.getInstance().TIN, 1),
+ new MaterialStack(ELEMENT.getInstance().BISMUTH, 1));
}
diff --git a/src/main/java/gtPlusPlus/core/material/Material.java b/src/main/java/gtPlusPlus/core/material/Material.java
index 748db12590..7074bf5419 100644
--- a/src/main/java/gtPlusPlus/core/material/Material.java
+++ b/src/main/java/gtPlusPlus/core/material/Material.java
@@ -3,12 +3,6 @@ package gtPlusPlus.core.material;
import static gregtech.api.enums.GT_Values.M;
import static gtPlusPlus.core.util.math.MathUtils.safeCast_LongToInt;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TextureSet;
@@ -28,6 +22,11 @@ import gtPlusPlus.xmod.gregtech.api.enums.CustomOrePrefix;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits;
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper;
import gtPlusPlus.xmod.tinkers.material.BaseTinkersMaterial;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
@@ -37,1500 +36,1791 @@ import net.minecraftforge.fluids.FluidStack;
public class Material {
- public static final Set<Material> mMaterialMap = new HashSet<Material>();
- public static HashMap<String, Material> mMaterialCache = new HashMap<String, Material>();
-
- public static final Map<String, Map<String, ItemStack>> mComponentMap = new HashMap<String, Map<String, ItemStack>>();
-
- public static HashMap<String, String> sChemicalFormula = new HashMap<String, String>();
-
- private String unlocalizedName;
- private String localizedName;
-
- private MaterialState materialState;
- private TextureSet textureSet;
-
- private Fluid mFluid;
- private Fluid mPlasma;
-
- private boolean vGenerateCells;
-
- protected Object dataVar = MathUtils.generateSingularRandomHexValue();
-
- private ArrayList<MaterialStack> vMaterialInput = new ArrayList<>();
- public long[] vSmallestRatio;
- public short vComponentCount;
-
- private short[] RGBA;
-
- private boolean usesBlastFurnace;
- public boolean isRadioactive;
- public byte vRadiationLevel;
-
- private int meltingPointK;
- private int boilingPointK;
- private int meltingPointC;
- private int boilingPointC;
- private long vProtons;
- private long vNeutrons;
- private long vMass;
- public int smallestStackSizeWhenProcessing; //Add a check for <=0 || > 64
- public int vTier;
- public int vVoltageMultiplier;
- public String vChemicalFormula;
- public String vChemicalSymbol;
-
- public long vDurability;
- public int vToolQuality;
- public int vHarvestLevel;
-
- private TC_Aspect_Wrapper[] vAspects;
-
- public BaseTinkersMaterial vTiConHandler;
-
- public short werkstoffID;
-
-
- public static AutoMap<Materials> invalidMaterials = new AutoMap<Materials>();
-
-
- public Material(final String materialName, final MaterialState defaultState, final MaterialStack... inputs){
- this(materialName, defaultState, null, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState, final short[] rgba, final MaterialStack... inputs){
- this(materialName, defaultState, null, 0, rgba, -1, -1, -1, -1, false, "", 0, false, false, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState, final short[] rgba, int radiationLevel, MaterialStack... materialStacks) {
- this(materialName, defaultState, null, 0, rgba, -1, -1, -1, -1, false, "", radiationLevel, false, materialStacks);
- }
-
- public Material(String materialName, MaterialState defaultState, short[] rgba, int j, int k, int l, int m, int radiationLevel, MaterialStack[] materialStacks){
- this(materialName, defaultState, null, 0, rgba, j, k, l, m, false, "", radiationLevel, false, materialStacks);
- }
-
- public Material(String materialName, MaterialState defaultState, final TextureSet set, short[] rgba, int meltingPoint, int boilingPoint, int protons, int neutrons, int radiationLevel, MaterialStack[] materialStacks){
- this(materialName, defaultState, set, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, false, "", radiationLevel, false, materialStacks);
- }
-
- public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final MaterialStack... inputs){
- this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemSymbol, final MaterialStack... inputs){
- this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemSymbol, 0, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, boolean generateCells, final MaterialStack... inputs){
- this(materialName, defaultState, null, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, generateCells, true, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final int radiationLevel, final MaterialStack... inputs){
- this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", radiationLevel, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState,final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final int radiationLevel, final MaterialStack... inputs){
- this(materialName, defaultState, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", radiationLevel, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){
- this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean addCells,final MaterialStack... inputs) {
- this (materialName, defaultState, null, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, addCells, true, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState, TextureSet textureSet,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){
- this (materialName, defaultState, textureSet, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState, TextureSet textureSet,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean addCells,final MaterialStack... inputs) {
- this (materialName, defaultState, textureSet, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, addCells, true, inputs);
- }
-
- private Material(final String materialName, final MaterialState defaultState, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){
- this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState, final TextureSet set, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean generateCells, final MaterialStack... inputs){
- this (materialName, defaultState, set, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs);
- }
-
- public Material(final String materialName, final MaterialState defaultState, final TextureSet set, final long durability, short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, String chemicalSymbol, final int radiationLevel, boolean generateCells, boolean generateFluid, final MaterialStack... inputs){
-
- if (mMaterialMap.add(this)) {
-
- }
-
- if (defaultState == MaterialState.ORE) {
- rgba = null;
- }
-
- mComponentMap.put(unlocalizedName, new HashMap<String, ItemStack>());
-
- try {
- this.unlocalizedName = Utils.sanitizeString(materialName);
- this.localizedName = materialName;
- mMaterialCache.put(getLocalizedName().toLowerCase(), this);
- Logger.INFO("Stored "+getLocalizedName()+" to cache with key: "+getLocalizedName().toLowerCase());
-
- this.materialState = defaultState;
-
- Logger.MATERIALS(this.getLocalizedName()+" is "+defaultState.name()+".");
-
- this.vGenerateCells = generateCells;
-
- //Add Components to an array.
- if (inputs == null){
- this.vMaterialInput = null;
- }
- else {
- if (inputs.length != 0){
- for (int i=0; i < inputs.length; i++){
- if (inputs[i] != null){
- this.vMaterialInput.add(i, inputs[i]);
- }
- }
- }
- }
-
- //set RGB
-
- if (rgba == null) {
- if (vMaterialInput.size() > 0) {
-
- try {
- Short[] mMixedRGB = new Short[3];
- AutoMap<Material> mMaterialSet = MaterialUtils.getCompoundMaterialsRecursively(this);
- for (int mnh = 0; mnh < 3; mnh++) {
- AutoMap<Short> aDataSet = new AutoMap<Short>();
- Set<Material> set4 = new HashSet<Material>();
- for (Material u : mMaterialSet) {
- //if (u.getState() == MaterialState.ORE || u.getState() == MaterialState.SOLID)
- set4.add(u);
- }
- for(Material e : set4){
- aDataSet.put(e.getRGB()[mnh]);
- }
-
- Short aAverage = MathUtils.getShortAverage(aDataSet);
- if (aAverage > Short.MAX_VALUE || aAverage < Short.MIN_VALUE || aAverage < 0 || aAverage > 255) {
- if (aAverage > 255) {
- while (aAverage > 255) {
- aAverage = (short) (aAverage/2);
- }
- }
- aAverage = (short) Math.max(Math.min(aAverage, 255), 0);
- }
- mMixedRGB[mnh] = aAverage;
- }
-
- if (mMixedRGB != null && mMixedRGB[0] != null && mMixedRGB[1] != null && mMixedRGB[2] != null) {
- this.RGBA = new short[] {mMixedRGB[0], mMixedRGB[1], mMixedRGB[2], 0};
- }
- else {
- this.RGBA = Materials.Steel.mRGBa;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- this.RGBA = Materials.Steel.mRGBa;
- }
- }
- else {
- //Boring Grey Material
-
- int aValueForGen = this.getUnlocalizedName().hashCode();
- int hashSize = MathUtils.howManyPlaces(aValueForGen);
-
- String a = String.valueOf(aValueForGen);
- String b = "";
-
- if (hashSize < 9) {
- int aSecondHash = this.materialState.hashCode();
- int hashSize2 = MathUtils.howManyPlaces(aSecondHash);
- if (hashSize2 + hashSize >= 9) {
- b = String.valueOf(aValueForGen);
- }
- else {
- String c = b;
- while (MathUtils.howManyPlaces(hashSize + c.length()) < 9) {
- c = c + c.hashCode();
- }
- b = c;
- }
- }
-
- String valueR;
- if (b != null) {
- valueR = a+b;
- }
- else {
- valueR = a;
- }
- short fc[] = new short[3];
- int aIndex = 0;
- for (char gg : valueR.toCharArray()) {
- short ui = Short.parseShort(""+gg);
- if (ui > 255 || ui < 0) {
- if (ui > 255) {
- while (ui > 255) {
- ui = (short) (ui / 2);
- }
- }
- else {
- ui = 0;
- }
- }
- fc[aIndex++] = ui;
-
- }
- this.RGBA = fc;
- }
- }
- else {
- this.RGBA = rgba;
- }
-
- //Set Melting/Boiling point, if value is -1 calculate it from compound inputs.
- if (meltingPoint != -1){
- this.meltingPointC = meltingPoint;
- }
- else {
- this.meltingPointC = this.calculateMeltingPoint();
- }
- if (boilingPoint != -1){
- if (boilingPoint != 0){
- this.boilingPointC = boilingPoint;
- }
- else {
- this.boilingPointC = meltingPoint*4;
- }
- }
- else {
- this.boilingPointC = this.calculateBoilingPoint();
- }
-
- this.meltingPointK = (int) MathUtils.celsiusToKelvin(this.meltingPointC);
- this.boilingPointK = (int) MathUtils.celsiusToKelvin(this.boilingPointC);
-
- //Set Proton/Neutron count, if value is -1 calculate it from compound inputs.
- if (protons != -1){
- this.vProtons = protons;
- }
- else {
- this.vProtons = this.calculateProtons();
- }
- if (boilingPoint != -1){
- this.vNeutrons = neutrons;
- }
- else {
- this.vNeutrons = this.calculateNeutrons();
- }
-
-
- this.vAspects = null;
-
-
- this.vMass = this.getMass();
-
- //Sets tool Durability
- if (durability != 0){
- this.vDurability = durability;
- }
- else {
- long aTempDura = 0;
- for (MaterialStack g : this.getComposites()) {
- if (g != null) {
- aTempDura += safeCast_LongToInt(g.getStackMaterial().getMass() * 2000);
- }
- }
- this.vDurability = aTempDura > 0 ? aTempDura : (this.getComposites().isEmpty() ? 51200 : 32000 * this.getComposites().size());
- }
-
- if ((this.vDurability >= 0) && (this.vDurability < 64000)){
- this.vToolQuality = 1;
- this.vHarvestLevel = 2;
- }
- else if ((this.vDurability >= 64000) && (this.vDurability < 128000)){
- this.vToolQuality = 2;
- this.vHarvestLevel = 2;
- }
- else if ((this.vDurability >= 128000) && (this.vDurability < 256000)){
- this.vToolQuality = 3;
- this.vHarvestLevel = 2;
- }
- else if ((this.vDurability >= 256000) && (this.vDurability < 512000)){
- this.vToolQuality = 3;
- this.vHarvestLevel = 3;
- }
- else if ((this.vDurability >= 512000) && (this.vDurability <= Integer.MAX_VALUE)){
- this.vToolQuality = 4;
- this.vHarvestLevel = 4;
- }
- else {
- this.vToolQuality = 1;
- this.vHarvestLevel = 1;
- }
-
- //Sets the Rad level
- if (radiationLevel > 0){
- Logger.MATERIALS(this.getLocalizedName()+" is radioactive. Level: "+radiationLevel+".");
- this.isRadioactive = true;
- this.vRadiationLevel = (byte) radiationLevel;
- }
- else {
- if (vMaterialInput.size() > 0) {
- AutoMap<Byte> aDataSet = new AutoMap<Byte>();
- for (MaterialStack m : this.vMaterialInput) {
- aDataSet.put(m.getStackMaterial().vRadiationLevel);
- }
- byte aAverage = MathUtils.getByteAverage(aDataSet);
- if (aAverage > 0) {
- Logger.MATERIALS(this.getLocalizedName()+" is radioactive due to trace elements. Level: "+aAverage+".");
- this.isRadioactive = true;
- this.vRadiationLevel = (byte) aAverage;
- }
- else {
- Logger.MATERIALS(this.getLocalizedName()+" is not radioactive.");
- this.isRadioactive = false;
- this.vRadiationLevel = 0;
- }
- }
- else {
- Logger.MATERIALS(this.getLocalizedName()+" is not radioactive.");
- this.isRadioactive = false;
- this.vRadiationLevel = 0;
- }
- }
-
- /*if (vMaterialInput.size() > 0) {
- AutoMap<Integer> aDataSet = new AutoMap<Integer>();
-
- int bonus = 0;
- bonus += this.vMaterialInput.size();
- bonus += MathUtils.roundToClosestInt(meltingPointC/1000);
-
-
-
- aDataSet.put(bonus);
-
- for (MaterialStack m : this.vMaterialInput) {
- aDataSet.put(m.getStackMaterial().vTier);
- }
- int aAverage = MathUtils.getIntAverage(aDataSet);
- if (aAverage > Integer.MAX_VALUE || aAverage < Integer.MIN_VALUE) {
- aAverage = 0;
- }
- if (aAverage > 0) {
- this.vTier = Math.min(aAverage, 10);
- }
- else {
- this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint));
- }
- }
- else {
- this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint));
- }*/
- this.vTier = MaterialUtils.getTierOfMaterial(meltingPoint);
-
-
- //Sets the materials 'tier'. Will probably replace this logic.
-
- this.usesBlastFurnace = blastFurnace;
- this.vVoltageMultiplier = MaterialUtils.getVoltageForTier(vTier);
-
- this.vComponentCount = this.getComponentCount(inputs);
- this.vSmallestRatio = this.getSmallestRatio(this.vMaterialInput);
- int tempSmallestSize = 0;
-
- if (this.vSmallestRatio != null){
- for (int v=0;v<this.vSmallestRatio.length;v++){
- tempSmallestSize=(int) (tempSmallestSize+this.vSmallestRatio[v]);
- }
- this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes
- }
- else {
- this.smallestStackSizeWhenProcessing = 1; //Valid stacksizes
- }
-
-
- //Makes a Fancy Chemical Tooltip
-
- if (chemicalSymbol == null) {
- chemicalSymbol = "";
- }
-
- this.vChemicalSymbol = chemicalSymbol;
- if (this.vMaterialInput != null){
- this.vChemicalFormula = this.getToolTip(chemicalSymbol, OrePrefixes.dust.mMaterialAmount / M, true);
- }
- else if (!this.vChemicalSymbol.equals("")){
- Logger.MATERIALS("materialInput is null, using a valid chemical symbol.");
- this.vChemicalFormula = this.vChemicalSymbol;
- }
- else{
- Logger.MATERIALS("MaterialInput == null && chemicalSymbol probably equals nothing");
- this.vChemicalSymbol = "??";
- this.vChemicalFormula = "??";
- }
-
- if (generateFluid){
- final Materials aGregtechMaterial = tryFindGregtechMaterialEquivalent();
- FluidStack aTest = FluidUtils.getWildcardFluidStack(localizedName, 1);
- if (aTest != null){
- this.mFluid = aTest.getFluid();
- checkForCellAndGenerate(this);
- }
- else {
- if (aGregtechMaterial != null && !MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)){
- aTest = FluidUtils.getWildcardFluidStack(aGregtechMaterial, 1);
- }
- if (aTest != null){
- this.mFluid = aTest.getFluid();
- checkForCellAndGenerate(this);
- }
- else {
- mFluid = generateFluid();
- }
- }
- // Don't generate plasma for composites
- if (this.getComposites().isEmpty()) {
- this.mPlasma = this.generatePlasma();
- }
- }
- else {
- this.mFluid = null;
- this.mPlasma = null;
- }
- String ratio = "";
- if (this.vSmallestRatio != null) {
- for (int hu=0;hu<this.vSmallestRatio.length;hu++){
- if (ratio.equals("")){
- ratio = String.valueOf(this.vSmallestRatio[hu]);
- }
- else {
- ratio = ratio + ":" +this.vSmallestRatio[hu];
- }
- }
- }
-
- this.textureSet = setTextureSet(set, vTier);
-
- if (LoadedMods.TiCon && this.materialState == MaterialState.SOLID) {
- if (this.getProtons() >= 98 || this.getComposites().size() > 1 || this.getMeltingPointC() >= 3600) {
- this.vTiConHandler = new BaseTinkersMaterial(this);
- }
- }
-
- sChemicalFormula.put(materialName.toLowerCase(), this.vChemicalFormula);
- Logger.MATERIALS("Creating a Material instance for "+materialName);
- Logger.MATERIALS("Formula: "+this.vChemicalFormula + " Smallest Stack: "+this.smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio);
- Logger.MATERIALS("Protons: "+this.vProtons);
- Logger.MATERIALS("Neutrons: "+this.vNeutrons);
- Logger.MATERIALS("Mass: "+this.vMass+"/units");
- Logger.MATERIALS("Melting Point: "+this.meltingPointC+"C.");
- Logger.MATERIALS("Boiling Point: "+this.boilingPointC+"C.");
- }
- catch (Throwable t){
- Logger.MATERIALS("Stack Trace for "+materialName);
- t.printStackTrace();
- }
- }
-
- private static void checkForCellAndGenerate(Material material) {
- if (!material.vGenerateCells) {
- return;
- }
- String aName = Utils.sanitizeString(material.unlocalizedName);
- String aName2 = Utils.sanitizeString(material.unlocalizedName.toLowerCase());
- String aName3 = (material.localizedName == null) ? aName : material.localizedName;
- ItemStack aTestCell1 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aName, 1);
- ItemStack aTestCell2 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aName2, 1);
- ItemStack aTestCell3 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aName3, 1);
- if (aTestCell1 == null && aTestCell2 == null && aTestCell3 == null) {
- Logger.INFO("Generating cell for "+ material.localizedName);
- new BaseItemCell(material);
- }
- else {
- if (aTestCell1 != null) {
- Logger.INFO("Registering existing cell for "+ material.localizedName+", "+aName);
- material.registerComponentForMaterial(OrePrefixes.cell, aTestCell1);
- }
- else if (aTestCell2 != null) {
- Logger.INFO("Registering existing cell for "+ material.localizedName+", "+aName2);
- material.registerComponentForMaterial(OrePrefixes.cell, aTestCell2);
- }
- else if (aTestCell3 != null) {
- Logger.INFO("Registering existing cell for "+ material.localizedName+", "+aName3);
- material.registerComponentForMaterial(OrePrefixes.cell, aTestCell3);
- }
- }
- }
-
- public final TextureSet getTextureSet() {
- synchronized(this) {
- return textureSet;
- }
- }
-
-
- public TextureSet setTextureSet(TextureSet set) {
- return setTextureSet(set, vTier);
- }
-
- public TextureSet setTextureSet(TextureSet set, int aTier) {
- if (set != null) {
- Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+set.mSetName+". This textureSet was supplied.");
- return set;
- }
-
- int aGem = 0;
- int aShiny = 0;
- TextureSet aSet = null;
-
- //Check Mixture Contents
- for (MaterialStack m : this.getComposites()) {
-
- //Gems
- if (m.getStackMaterial() == ELEMENT.getInstance().AER) {
- aGem++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().AQUA) {
- aGem++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().IGNIS) {
- aGem++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().TERRA) {
- aGem++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().MAGIC) {
- aGem++;
- }
- //Shiny Materials
- if (m.getStackMaterial() == ELEMENT.getInstance().GOLD) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().SILVER) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().PLATINUM) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().AMERICIUM) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().TITANIUM) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().GERMANIUM) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().GALLIUM) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().MERCURY) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().MAGIC) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().SAMARIUM) {
- aShiny++;
- }
- else if (m.getStackMaterial() == ELEMENT.getInstance().TANTALUM) {
- aShiny++;
- }
- }
-
- if (aSet == null) {
- if (aGem >= this.getComposites().size()/2) {
- if (MathUtils.isNumberEven(aGem)) {
- Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+TextureSet.SET_GEM_HORIZONTAL.mSetName+".");
- return TextureSet.SET_GEM_HORIZONTAL;
- }
- else {
- Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+TextureSet.SET_GEM_VERTICAL.mSetName+".");
- return TextureSet.SET_GEM_VERTICAL;
- }
- }
- }
-
- if (aSet == null) {
- if (aShiny >= this.getComposites().size()/3) {
- Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+TextureSet.SET_SHINY.mSetName+".");
- return TextureSet.SET_SHINY;
- }
- }
-
- // build hash table with count
- AutoMap<Material> sets = new AutoMap<Material>();
- if (this.vMaterialInput != null) {
- for (MaterialStack r : this.vMaterialInput) {
- if (r.getStackMaterial().getTextureSet().mSetName.toLowerCase().contains("fluid")) {
- sets.put(ELEMENT.getInstance().GOLD);
- }
- else {
- sets.put(r.getStackMaterial());
- }
- }
- TextureSet mostUsedTypeTextureSet = MaterialUtils.getMostCommonTextureSet(new ArrayList<Material>(sets.values()));
- if (mostUsedTypeTextureSet != null && mostUsedTypeTextureSet instanceof TextureSet) {
- Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+mostUsedTypeTextureSet.mSetName+".");
- return mostUsedTypeTextureSet;
- }
- }
- Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+Materials.Iron.mIconSet.mSetName+". [Fallback]");
- return Materials.Gold.mIconSet;
- }
-
- public final String getLocalizedName(){
- if (this.localizedName != null) {
- return this.localizedName;
- }
- return "ERROR BAD LOCALIZED NAME";
- }
-
- public final String getUnlocalizedName(){
- if (this.unlocalizedName != null) {
- return this.unlocalizedName;
- }
- return "ERROR.BAD.UNLOCALIZED.NAME";
- }
-
- final public MaterialState getState(){
- return this.materialState;
- }
-
- final public short[] getRGB(){
- if (this.RGBA != null) {
- return this.RGBA;
- }
- return new short[] {255,0,0};
- }
-
- final public short[] getRGBA(){
- if (this.RGBA != null) {
- if (this.RGBA.length == 4){
- return this.RGBA;
- }
- else {
- return new short[]{this.RGBA[0], this.RGBA[1], this.RGBA[2], 0};
- }
- }
- return new short[] {255,0,0, 0};
- }
-
- final public int getRgbAsHex(){
-
- final int returnValue = Utils.rgbtoHexValue(this.RGBA[0], this.RGBA[1], this.RGBA[2]);
- if (returnValue == 0){
- return (int) this.dataVar;
- }
- return Utils.rgbtoHexValue(this.RGBA[0], this.RGBA[1], this.RGBA[2]);
- }
-
- final public long getProtons() {
- return this.vProtons;
- }
-
- public final long getNeutrons() {
- return this.vNeutrons;
- }
-
- final public long getMass() {
- return this.vProtons + this.vNeutrons;
- }
-
- public final int getMeltingPointC() {
- return this.meltingPointC;
- }
-
- public final int getBoilingPointC() {
- return this.boilingPointC;
- }
-
- public final int getMeltingPointK() {
- return this.meltingPointK;
- }
-
- public final int getBoilingPointK() {
- return this.boilingPointK;
- }
-
- public final boolean requiresBlastFurnace(){
- return this.usesBlastFurnace;
- }
-
- public final ItemStack getComponentByPrefix(OrePrefixes aPrefix, int stacksize) {
- String aKey = aPrefix.name();
- Map<String, ItemStack> g = mComponentMap.get(this.unlocalizedName);
- if (g == null) {
- Map<String, ItemStack> aMap = new HashMap<String, ItemStack>();
- mComponentMap.put(unlocalizedName, aMap);
- g = aMap;
- }
- ItemStack i = g.get(aKey);
- if (i != null) {
- return ItemUtils.getSimpleStack(i, stacksize);
- }
- else {
- // Try get a GT Material
- Materials Erf = MaterialUtils.getMaterial(this.unlocalizedName);
- if (Erf != null && !MaterialUtils.isNullGregtechMaterial(Erf)) {
- ItemStack Erg = ItemUtils.getOrePrefixStack(aPrefix, Erf, stacksize);
- if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) {
- Logger.MATERIALS("Found \"" + aKey + this.unlocalizedName + "\" using backup GT Materials option.");
- g.put(aKey, Erg);
- mComponentMap.put(unlocalizedName, g);
- return Erg;
- }
- else {
- // Try get a molten cell
- if (aPrefix == OrePrefixes.cell) {
- Erg = ItemUtils.getOrePrefixStack(OrePrefixes.cellMolten, Erf, stacksize);
- if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) {
- Logger.MATERIALS("Found \"" + OrePrefixes.cellMolten.name() + this.unlocalizedName + "\" using backup GT Materials option.");
- g.put(aKey, Erg);
- mComponentMap.put(unlocalizedName, g);
- return Erg;
- }
- }
- }
- } else {
- ItemStack u = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(aKey + this.unlocalizedName, stacksize);
- if (u != null) {
- g.put(aKey, u);
- mComponentMap.put(unlocalizedName, g);
- return u;
- }
- }
- //Logger.MATERIALS("Unabled to find \"" + aKey + this.unlocalizedName + "\"");
- return ItemUtils.getErrorStack(stacksize, (aKey + this.unlocalizedName+" x"+stacksize));
- }
-
- }
-
- final public Block getBlock(){
- Block b = Block.getBlockFromItem(getBlock(1).getItem());
- if (b == null) {
- Logger.INFO("[ERROR] Tried to get invalid block for "+this.getLocalizedName()+", returning debug block instead.");
- }
- return b != null ? b : Blocks.lit_furnace;
- }
-
- public final ItemStack getBlock(final int stacksize){
- ItemStack i = getComponentByPrefix(OrePrefixes.block, stacksize);
- return i != null ? i : ItemUtils.getItemStackOfAmountFromOreDictNoBroken("block"+this.unlocalizedName, stacksize);
- }
-
- public final ItemStack getDust(final int stacksize){
- ItemStack i = getComponentByPrefix(OrePrefixes.dust, stacksize);
- return i != null ? i : ItemUtils.getGregtechDust("dust"+this.unlocalizedName, stacksize);
- }
-
- public final ItemStack getSmallDust(final int stacksize){
- return getComponentByPrefix(OrePrefixes.dustSmall, stacksize);
- }
-
- public final ItemStack getTinyDust(final int stacksize){
- return getComponentByPrefix(OrePrefixes.dustTiny, stacksize);
- }
-
- public final ItemStack getIngot(final int stacksize){
- return getComponentByPrefix(OrePrefixes.ingot, stacksize);
- }
-
- public final ItemStack getHotIngot(final int stacksize){
- return getComponentByPrefix(OrePrefixes.ingotHot, stacksize);
- }
-
- public final ItemStack getPlate(final int stacksize){
- return getComponentByPrefix(OrePrefixes.plate, stacksize);
- }
-
- public final ItemStack getPlateDouble(final int stacksize){
- return getComponentByPrefix(OrePrefixes.plateDouble, stacksize);
- }
-
- public final ItemStack getGear(final int stacksize){
- return getComponentByPrefix(OrePrefixes.gearGt, stacksize);
- }
-
- public final ItemStack getRod(final int stacksize){
- return getComponentByPrefix(OrePrefixes.stick, stacksize);
- }
-
- public final ItemStack getLongRod(final int stacksize){
- return getComponentByPrefix(OrePrefixes.stickLong, stacksize);
- }
-
- public final ItemStack getBolt(final int stacksize){
- return getComponentByPrefix(OrePrefixes.bolt, stacksize);
- }
-
- public final ItemStack getScrew(final int stacksize){
- return getComponentByPrefix(OrePrefixes.screw, stacksize);
- }
-
- public final ItemStack getFineWire(final int stacksize){
- return getComponentByPrefix(OrePrefixes.wireFine, stacksize);
- }
-
- public final ItemStack getFoil(final int stacksize){
- return getComponentByPrefix(OrePrefixes.foil, stacksize);
- }
-
- public final ItemStack getRing(final int stacksize){
- return getComponentByPrefix(OrePrefixes.ring, stacksize);
- }
-
- public final ItemStack getRotor(final int stacksize){
- return getComponentByPrefix(OrePrefixes.rotor, stacksize);
- }
-
- public final ItemStack getFrameBox(final int stacksize){
- return getComponentByPrefix(OrePrefixes.frameGt, stacksize);
- }
-
- public final ItemStack getCell(final int stacksize){
- return getComponentByPrefix(OrePrefixes.cell, stacksize);
- }
-
- public final ItemStack getPlasmaCell(final int stacksize){
- return getComponentByPrefix(OrePrefixes.cellPlasma, stacksize);
- }
-
- public final ItemStack getNugget(final int stacksize){
- return getComponentByPrefix(OrePrefixes.nugget, stacksize);
- }
-
- public final ItemStack getWire01(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.wireGt01, stacksize);
- }
-
- public final ItemStack getWire02(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.wireGt02, stacksize);
- }
-
- public final ItemStack getWire04(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.wireGt04, stacksize);
- }
-
- public final ItemStack getWire08(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.wireGt08, stacksize);
- }
-
- public final ItemStack getWire12(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.wireGt12, stacksize);
- }
-
- public final ItemStack getWire16(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.wireGt16, stacksize);
- }
-
- public final ItemStack getCable01(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.cableGt01, stacksize);
- }
-
- public final ItemStack getCable02(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.cableGt02, stacksize);
- }
-
- public final ItemStack getCable04(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.cableGt04, stacksize);
- }
-
- public final ItemStack getCable08(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.cableGt08, stacksize);
- }
-
- public final ItemStack getCable12(final int stacksize) {
- return getComponentByPrefix(OrePrefixes.cableGt12, stacksize);
- }
-
- public final ItemStack getCable16(final int stacksize) {
- if (GregtechConduits.cableGt16 != null) {
- return getComponentByPrefix(GregtechConduits.cableGt16, stacksize);
- }
- else {
- return ItemUtils.getErrorStack(stacksize);
- }
- }
-
- /**
- * Ore Components
- * @return
- */
-
- public final ItemStack getOre(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ore"+Utils.sanitizeString(this.getUnlocalizedName()), stacksize);
- }
- public final Block getOreBlock(final int stacksize){
- //Logger.DEBUG_MATERIALS("Trying to get ore block for "+this.getLocalizedName()+". Looking for '"+"ore"+Utils.sanitizeString(this.getUnlocalizedName())+"'.");
- try{
- ItemStack a1 = getOre(1);
- Item a2 = a1.getItem();
- Block a3 = Block.getBlockFromItem(a2);
- if (a3 != null) {
- return a3;
- }
-
- Block x = Block.getBlockFromItem(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ore"+Utils.sanitizeString(this.unlocalizedName), stacksize).getItem());
- if (x != null){
- return x;
- }
- }
- catch (Throwable t){
- //t.printStackTrace();
- }
- //Logger.MATERIALS("Failed getting the Ore Block for "+this.getLocalizedName()+".");
- return Blocks.stone;
- }
- public final ItemStack getCrushed(final int stacksize){
- return getComponentByPrefix(OrePrefixes.crushed, stacksize);
- }
- public final ItemStack getCrushedPurified(final int stacksize){
- return getComponentByPrefix(OrePrefixes.crushedPurified, stacksize);
- }
- public final ItemStack getCrushedCentrifuged(final int stacksize){
- return getComponentByPrefix(OrePrefixes.crushedCentrifuged, stacksize);
- }
- public final ItemStack getDustPurified(final int stacksize){
- return getComponentByPrefix(OrePrefixes.dustPure, stacksize);
- }
- public final ItemStack getDustImpure(final int stacksize){
- return getComponentByPrefix(OrePrefixes.dustImpure, stacksize);
- }
- public final ItemStack getMilled(final int stacksize){
- return getComponentByPrefix(CustomOrePrefix.milled.get(), stacksize);
- }
-
- public final boolean hasSolidForm() {
- if (ItemUtils.checkForInvalidItems(new ItemStack[] {getDust(1), getBlock(1), getTinyDust(1), getSmallDust(1)})) {
- return true;
- }
- return false;
- }
-
- final public ItemStack[] getMaterialComposites(){
- if (this.vMaterialInput != null && !this.vMaterialInput.isEmpty()){
- final ItemStack[] temp = new ItemStack[this.vMaterialInput.size()];
- for (int i=0;i<this.vMaterialInput.size();i++){
- //Utils.LOG_MATERIALS("i:"+i);
- ItemStack testNull = null;
- try {
- testNull = this.vMaterialInput.get(i).getValidStack();
- } catch (final Throwable r){
- Logger.MATERIALS("Failed gathering material stack for "+this.localizedName+".");
- Logger.MATERIALS("What Failed: Length:"+this.vMaterialInput.size()+" current:"+i);
- }
- try {
- if (testNull != null){
- //Utils.LOG_MATERIALS("not null");
- temp[i] = this.vMaterialInput.get(i).getValidStack();
- }
- } catch (final Throwable r){
- Logger.MATERIALS("Failed setting slot "+i+", using "+this.localizedName);
- }
- }
- return temp;
- }
- return new ItemStack[]{};
- }
-
- public final ArrayList<MaterialStack> getComposites(){
- return this.vMaterialInput;
- }
-
- final public int[] getMaterialCompositeStackSizes(){
- if (!this.vMaterialInput.isEmpty()){
- final int[] temp = new int[this.vMaterialInput.size()];
- for (int i=0;i<this.vMaterialInput.size();i++){
- if (this.vMaterialInput.get(i) != null) {
- temp[i] = this.vMaterialInput.get(i).getDustStack().stackSize;
- } else {
- temp[i]=0;
- }
- }
- return temp;
- }
- return new int[]{};
- }
-
- private final short getComponentCount(final MaterialStack[] inputs){
-
- if (inputs == null || inputs.length < 1) {
- return 1;
- }
- int counterTemp = 0;
- for (final MaterialStack m : inputs){
- if (m.getStackMaterial() != null){
- counterTemp++;
- }
- }
- if (counterTemp != 0){
- return (short) counterTemp;
- }
- else {
- return 1;
- }
- }
-
-
- public final long[] getSmallestRatio(final ArrayList<MaterialStack> tempInput){
- if (tempInput != null){
- if (!tempInput.isEmpty()){
- Logger.MATERIALS("length: "+tempInput.size());
- Logger.MATERIALS("(inputs != null): "+(tempInput != null));
- //Utils.LOG_MATERIALS("length: "+inputs.length);
- final long[] tempRatio = new long[tempInput.size()];
- for (int x=0;x<tempInput.size();x++){
- //tempPercentage = tempPercentage+inputs[x].percentageToUse;
- //this.mMaterialList.add(inputs[x]);
- if (tempInput.get(x) != null){
- tempRatio[x] = tempInput.get(x).getPartsPerOneHundred();
- }
- }
-
- final long[] smallestRatio = MathUtils.simplifyNumbersToSmallestForm(tempRatio);
-
- if (smallestRatio.length > 0){
- String tempRatioStringThing1 = "";
- for (int r=0;r<tempRatio.length;r++){
- tempRatioStringThing1 = tempRatioStringThing1 + tempRatio[r] +" : ";
- }
- Logger.MATERIALS("Default Ratio: "+tempRatioStringThing1);
-
- String tempRatioStringThing = "";
- int tempSmallestCraftingUseSize = 0;
- for (int r=0;r<smallestRatio.length;r++){
- tempRatioStringThing = tempRatioStringThing + smallestRatio[r] +" : ";
- tempSmallestCraftingUseSize = (int) (tempSmallestCraftingUseSize + smallestRatio[r]);
- }
- //this.smallestStackSizeWhenProcessing = tempSmallestCraftingUseSize;
- Logger.MATERIALS("Smallest Ratio: "+tempRatioStringThing);
- return smallestRatio;
- }
- }
- }
- return new long[] {};
- }
-
- public final String getToolTip(final String chemSymbol, final long aMultiplier, final boolean aShowQuestionMarks) {
- if (!aShowQuestionMarks && (this.vChemicalFormula.equals("?")||this.vChemicalFormula.equals("??"))) {
- return "";
- }
- Logger.MATERIALS("===============| Calculating Atomic Formula for "+this.localizedName+" |===============");
- if (!chemSymbol.equals("")) {
- return chemSymbol;
- }
- final ArrayList<MaterialStack> tempInput = this.vMaterialInput;
- if (tempInput != null){
- if (!tempInput.isEmpty()){
- String dummyFormula = "";
- final long[] dummyFormulaArray = this.getSmallestRatio(tempInput);
- if (dummyFormulaArray != null){
- if (dummyFormulaArray.length >= 1){
- for (int e=0;e<tempInput.size();e++){
- MaterialStack g = tempInput.get(e);
- if (g != null){
- if (g.getStackMaterial() != null){
-
- String aChemSymbol = g.getStackMaterial().vChemicalSymbol;
- String aChemFormula = g.getStackMaterial().vChemicalFormula;
-
- if (aChemSymbol == null) {
- aChemSymbol = "??";
- }
- if (aChemFormula == null) {
- aChemFormula = "??";
- }
-
- if (!aChemSymbol.equals("??")){
- if (dummyFormulaArray[e] > 1){
-
- if (aChemFormula.length() > 3){
- dummyFormula = dummyFormula + "(" + aChemFormula + ")" + dummyFormulaArray[e];
- }
- else {
- dummyFormula = dummyFormula + aChemFormula + dummyFormulaArray[e];
- }
- }
- else if (dummyFormulaArray[e] == 1){
- if (aChemFormula.length() > 3){
- dummyFormula = dummyFormula + "(" +aChemFormula + ")";
- }
- else {
- dummyFormula = dummyFormula +aChemFormula;
- }
- }
- else {
- dummyFormula = dummyFormula + "??";
- }
- } else {
- dummyFormula = dummyFormula + "??";
- }
- } else {
- dummyFormula = dummyFormula + "??";
- }
- }
- }
- return StringUtils.subscript(dummyFormula);
- //return dummyFormula;
- }
- Logger.MATERIALS("dummyFormulaArray <= 0");
- }
- Logger.MATERIALS("dummyFormulaArray == null");
- }
- Logger.MATERIALS("tempInput.length <= 0");
- }
- Logger.MATERIALS("tempInput == null");
- return "??";
-
- }
-
- public final boolean queueFluidGeneration() {
- return isFluidQueued = true;
- }
-
- public final static void generateQueuedFluids() {
- for (Material m : mMaterialMap) {
- if (m.isFluidQueued) {
- }
- }
- }
-
- //If we need a fluid, let's just queue it for later.
- public boolean isFluidQueued = false;
-
- public final Fluid generateFluid(){
- if (this.materialState == MaterialState.ORE){
- return null;
- }
-
- Fluid aGTBaseFluid = null;
-
- // Clean up Internal Fluid Generation
- final Materials n1 = MaterialUtils.getMaterial(this.getLocalizedName(), Utils.sanitizeString(this.getLocalizedName()));
- final Materials n2 = MaterialUtils.getMaterial(this.getUnlocalizedName(), Utils.sanitizeString(this.getUnlocalizedName()));
-
- FluidStack f1 = FluidUtils.getWildcardFluidStack(n1, 1);
- FluidStack f2 = FluidUtils.getWildcardFluidStack(n2, 1);
- FluidStack f3 = FluidUtils.getWildcardFluidStack(Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1);
- FluidStack f4 = FluidUtils.getWildcardFluidStack(Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1);
-
- if (f1 != null) {
- aGTBaseFluid = f1.getFluid();
- }
- else if (f2 != null) {
- aGTBaseFluid = f2.getFluid();
- }
- else if (f3 != null) {
- aGTBaseFluid = f3.getFluid();
- }
- else if (f4 != null) {
- aGTBaseFluid = f4.getFluid();
- }
-
-
- ItemStack aFullCell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1);
- ItemStack aFullCell2 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getLocalizedName(), 1);
- ItemStack aFullCell3 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1);
- ItemStack aFullCell4 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1);
-
- Logger.MATERIALS("Generating our own fluid.");
- //Generate a Cell if we need to, but first validate all four searches are invalid
-
- if (!ItemUtils.checkForInvalidItems(new ItemStack[] {aFullCell, aFullCell2, aFullCell3, aFullCell4})){
- if (this.vGenerateCells){
- Item g = new BaseItemCell(this);
- aFullCell = ItemUtils.getSimpleStack(g);
- Logger.MATERIALS("Generated a cell for "+this.getUnlocalizedName());
- }
- else {
- Logger.MATERIALS("Did not generate a cell for "+this.getUnlocalizedName());
- }
- }
- else {
- // One cell we searched for was valid, let's register it.
- if (aFullCell != null) {
- this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell);
- }
- else if (aFullCell2 != null) {
- this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell2);
- }
- else if (aFullCell3 != null) {
- this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell3);
- }
- else if (aFullCell4 != null) {
- this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell4);
- }
- }
-
- // We found a GT fluid, let's use it.
- // Good chance we registered the cell from this material too.
- if (aGTBaseFluid != null) {
- return aGTBaseFluid;
- }
-
- // This fluid does not exist at all, time to generate it.
- if (this.materialState == MaterialState.SOLID){
- return FluidUtils.addGTFluid(
- this.getUnlocalizedName(),
- "Molten "+this.getLocalizedName(),
- this.RGBA,
- 4,
- this.getMeltingPointK(),
- aFullCell,
- ItemUtils.getEmptyCell(),
- 1000,
- this.vGenerateCells);
- }
- else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){
- return FluidUtils.addGTFluid(
- this.getUnlocalizedName(),
- this.getLocalizedName(),
- this.RGBA,
- 0,
- this.getMeltingPointK(),
- aFullCell,
- ItemUtils.getEmptyCell(),
- 1000,
- this.vGenerateCells);
- }
- else if (this.materialState == MaterialState.GAS || this.materialState == MaterialState.PURE_GAS){
- return FluidUtils.generateGas(unlocalizedName, this.getLocalizedName(), getMeltingPointK(), getRGBA(), vGenerateCells);
- /*return FluidUtils.addGTFluid(
- this.getUnlocalizedName(),
- this.getLocalizedName()+" Gas",
- this.RGBA,
- 2,
- this.getMeltingPointK(),
- aFullCell,
- ItemUtils.getEmptyCell(),
- 1000,
- this.vGenerateCells);*/
- }
- else { //Plasma
- return this.generatePlasma();
- }
- }
-
- public final Fluid generatePlasma(){
- if (this.materialState == MaterialState.ORE){
- return null;
- }
- final Materials isValid = tryFindGregtechMaterialEquivalent();
-
- if (!this.vGenerateCells){
- return null;
- }
- if (isValid != null) {
- for (Materials m : invalidMaterials.values()){
- if (isValid == m){
- return null;
- }
- }
- if (isValid.mPlasma != null){
- Logger.MATERIALS("Using a pre-defined Plasma from GT.");
- return isValid.mPlasma;
- }
- }
- Logger.MATERIALS("Generating our own Plasma.");
- return FluidUtils.addGTPlasma(this);
- }
-
-
- public Fluid getFluid() {
- return mFluid;
- }
-
- public Fluid getPlasma() {
- return mPlasma;
- }
-
- final public FluidStack getFluidStack(final int fluidAmount) {
- if (this.mFluid == null){
- return null;
- }
- final FluidStack moltenFluid = new FluidStack(this.mFluid, fluidAmount);
- return moltenFluid;
- }
-
- final public boolean setFluid(Fluid aFluid) {
- if (this.mFluid == null){
- this.mFluid = aFluid;
- return true;
- }
- return false;
- }
-
-
- final public int calculateMeltingPoint(){
- try {
- AutoMap<Integer> aDataSet = new AutoMap<Integer>();
- for (MaterialStack m : this.vMaterialInput) {
- aDataSet.put(m.getStackMaterial().getMeltingPointC());
- }
- long aAverage = MathUtils.getIntAverage(aDataSet);
- return MathUtils.safeInt(aAverage);
- }
- catch (Throwable r){
- r.printStackTrace();
- return 500;
- }
- }
-
- final public int calculateBoilingPoint(){
- try {
-
- AutoMap<Integer> aDataSet = new AutoMap<Integer>();
- for (MaterialStack m : this.vMaterialInput) {
- aDataSet.put(m.getStackMaterial().getBoilingPointC());
- }
- long aAverage = MathUtils.getIntAverage(aDataSet);
- return MathUtils.safeInt(aAverage);
- }
- catch (Throwable r){
- r.printStackTrace();
- return 2500;
- }
- }
-
- final public long calculateProtons(){
- try {
-
- AutoMap<Long> aDataSet = new AutoMap<Long>();
- for (MaterialStack m : this.vMaterialInput) {
- aDataSet.put(m.getStackMaterial().getProtons());
- }
- long aAverage = MathUtils.getLongAverage(aDataSet);
- return MathUtils.safeInt(aAverage);
- }
- catch (Throwable r){
- r.printStackTrace();
- return 50;
- }
- }
-
- final public long calculateNeutrons(){
- try {
-
- AutoMap<Long> aDataSet = new AutoMap<Long>();
- for (MaterialStack m : this.vMaterialInput) {
- aDataSet.put(m.getStackMaterial().getNeutrons());
- }
- long aAverage = MathUtils.getLongAverage(aDataSet);
- return MathUtils.safeInt(aAverage);
- }
- catch (Throwable r){
- r.printStackTrace();
- return 75;
- }
- }
-
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (!Material.class.isInstance(obj)) {
- return false;
- }
- Material aObj = (Material) obj;
- if (aObj.unlocalizedName.equals(this.unlocalizedName)) {
- if (aObj.localizedName.equals(this.localizedName)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean registerComponentForMaterial(FluidStack aStack) {
- return registerComponentForMaterial(this, aStack);
- }
-
- private static boolean registerComponentForMaterial(Material componentMaterial, FluidStack aStack) {
- if (componentMaterial != null && aStack != null && componentMaterial.mFluid == null) {
- componentMaterial.mFluid = aStack.getFluid();
- return true;
- }
- return false;
- }
-
- public boolean registerComponentForMaterial(ComponentTypes aPrefix, ItemStack aStack) {
- return registerComponentForMaterial(this, aPrefix.getGtOrePrefix(), aStack);
- }
-
- public boolean registerComponentForMaterial(OrePrefixes aPrefix, ItemStack aStack) {
- return registerComponentForMaterial(this, aPrefix, aStack);
- }
-
- public static boolean registerComponentForMaterial(Material componentMaterial, ComponentTypes aPrefix, ItemStack aStack) {
- return registerComponentForMaterial(componentMaterial, aPrefix.getGtOrePrefix(), aStack);
- }
-
- public static boolean registerComponentForMaterial(Material componentMaterial, OrePrefixes aPrefix, ItemStack aStack) {
- if (componentMaterial == null) {
- return false;
- }
- //Register Component
- Map<String, ItemStack> aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName());
- if (aMap == null) {
- aMap = new HashMap<String, ItemStack>();
- }
- String aKey = aPrefix.name();
- ItemStack x = aMap.get(aKey);
- if (x == null) {
- aMap.put(aKey, aStack);
- Logger.MATERIALS("Registering a material component. Item: ["+componentMaterial.getUnlocalizedName()+"] Map: ["+aKey+"]");
- Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap);
- return true;
- }
- else {
- //Bad
- Logger.MATERIALS("Tried to double register a material component. ");
- return false;
- }
- }
-
- public Materials tryFindGregtechMaterialEquivalent() {
- return tryFindGregtechMaterialEquivalent(this);
- }
-
-
- public static Materials tryFindGregtechMaterialEquivalent(Material aMaterial) {
- String aMaterialName = aMaterial.getLocalizedName();
- Materials aGregtechMaterial = Materials.get(aMaterialName);
- if (aGregtechMaterial == null || MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) {
- aMaterialName = aMaterialName.replace(" ", "_");
- aGregtechMaterial = Materials.get(aMaterialName);
- if (aGregtechMaterial == null || MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) {
- aMaterialName = aMaterialName.replace(" ", "");
- aGregtechMaterial = Materials.get(aMaterialName);
- if (aGregtechMaterial == null || MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) {
- return null;
- }
- else {
- return aGregtechMaterial;
- }
- }
- else {
- return aGregtechMaterial;
- }
- }
- else {
- return aGregtechMaterial;
- }
- }
-
- public void setWerkstoffID(short werkstoffID) {
- this.werkstoffID = werkstoffID;
- }
-
-} \ No newline at end of file
+ public static final Set<Material> mMaterialMap = new HashSet<Material>();
+ public static HashMap<String, Material> mMaterialCache = new HashMap<String, Material>();
+
+ public static final Map<String, Map<String, ItemStack>> mComponentMap =
+ new HashMap<String, Map<String, ItemStack>>();
+
+ public static HashMap<String, String> sChemicalFormula = new HashMap<String, String>();
+
+ private String unlocalizedName;
+ private String localizedName;
+
+ private MaterialState materialState;
+ private TextureSet textureSet;
+
+ private Fluid mFluid;
+ private Fluid mPlasma;
+
+ private boolean vGenerateCells;
+
+ protected Object dataVar = MathUtils.generateSingularRandomHexValue();
+
+ private ArrayList<MaterialStack> vMaterialInput = new ArrayList<>();
+ public long[] vSmallestRatio;
+ public short vComponentCount;
+
+ private short[] RGBA;
+
+ private boolean usesBlastFurnace;
+ public boolean isRadioactive;
+ public byte vRadiationLevel;
+
+ private int meltingPointK;
+ private int boilingPointK;
+ private int meltingPointC;
+ private int boilingPointC;
+ private long vProtons;
+ private long vNeutrons;
+ private long vMass;
+ public int smallestStackSizeWhenProcessing; // Add a check for <=0 || > 64
+ public int vTier;
+ public int vVoltageMultiplier;
+ public String vChemicalFormula;
+ public String vChemicalSymbol;
+
+ public long vDurability;
+ public int vToolQuality;
+ public int vHarvestLevel;
+
+ private TC_Aspect_Wrapper[] vAspects;
+
+ public BaseTinkersMaterial vTiConHandler;
+
+ public short werkstoffID;
+
+ public static AutoMap<Materials> invalidMaterials = new AutoMap<Materials>();
+
+ public Material(final String materialName, final MaterialState defaultState, final MaterialStack... inputs) {
+ this(materialName, defaultState, null, inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final short[] rgba,
+ final MaterialStack... inputs) {
+ this(materialName, defaultState, null, 0, rgba, -1, -1, -1, -1, false, "", 0, false, false, inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final short[] rgba,
+ int radiationLevel,
+ MaterialStack... materialStacks) {
+ this(
+ materialName,
+ defaultState,
+ null,
+ 0,
+ rgba,
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "",
+ radiationLevel,
+ false,
+ materialStacks);
+ }
+
+ public Material(
+ String materialName,
+ MaterialState defaultState,
+ short[] rgba,
+ int j,
+ int k,
+ int l,
+ int m,
+ int radiationLevel,
+ MaterialStack[] materialStacks) {
+ this(materialName, defaultState, null, 0, rgba, j, k, l, m, false, "", radiationLevel, false, materialStacks);
+ }
+
+ public Material(
+ String materialName,
+ MaterialState defaultState,
+ final TextureSet set,
+ short[] rgba,
+ int meltingPoint,
+ int boilingPoint,
+ int protons,
+ int neutrons,
+ int radiationLevel,
+ MaterialStack[] materialStacks) {
+ this(
+ materialName,
+ defaultState,
+ set,
+ 0,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ false,
+ "",
+ radiationLevel,
+ false,
+ materialStacks);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ 0,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ "",
+ 0,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final String chemSymbol,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ 0,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ chemSymbol,
+ 0,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ boolean generateCells,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ null,
+ 0,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ "",
+ 0,
+ generateCells,
+ true,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final int radiationLevel,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ 0,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ "",
+ radiationLevel,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final long durability,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final int radiationLevel,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ durability,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ "",
+ radiationLevel,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final String chemicalSymbol,
+ final int radiationLevel,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ 0,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ chemicalSymbol,
+ radiationLevel,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final String chemicalSymbol,
+ final int radiationLevel,
+ boolean addCells,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ null,
+ 0,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ chemicalSymbol,
+ radiationLevel,
+ addCells,
+ true,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ TextureSet textureSet,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final String chemicalSymbol,
+ final int radiationLevel,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ textureSet,
+ 0,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ chemicalSymbol,
+ radiationLevel,
+ true,
+ true,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ TextureSet textureSet,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final String chemicalSymbol,
+ final int radiationLevel,
+ boolean addCells,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ textureSet,
+ 0,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ chemicalSymbol,
+ radiationLevel,
+ addCells,
+ true,
+ inputs);
+ }
+
+ private Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final long durability,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final String chemicalSymbol,
+ final int radiationLevel,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ null,
+ durability,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ chemicalSymbol,
+ radiationLevel,
+ true,
+ true,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final TextureSet set,
+ final long durability,
+ final short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ final String chemicalSymbol,
+ final int radiationLevel,
+ boolean generateCells,
+ final MaterialStack... inputs) {
+ this(
+ materialName,
+ defaultState,
+ set,
+ durability,
+ rgba,
+ meltingPoint,
+ boilingPoint,
+ protons,
+ neutrons,
+ blastFurnace,
+ chemicalSymbol,
+ radiationLevel,
+ true,
+ true,
+ inputs);
+ }
+
+ public Material(
+ final String materialName,
+ final MaterialState defaultState,
+ final TextureSet set,
+ final long durability,
+ short[] rgba,
+ final int meltingPoint,
+ final int boilingPoint,
+ final long protons,
+ final long neutrons,
+ final boolean blastFurnace,
+ String chemicalSymbol,
+ final int radiationLevel,
+ boolean generateCells,
+ boolean generateFluid,
+ final MaterialStack... inputs) {
+
+ if (mMaterialMap.add(this)) {}
+
+ if (defaultState == MaterialState.ORE) {
+ rgba = null;
+ }
+
+ mComponentMap.put(unlocalizedName, new HashMap<String, ItemStack>());
+
+ try {
+ this.unlocalizedName = Utils.sanitizeString(materialName);
+ this.localizedName = materialName;
+ mMaterialCache.put(getLocalizedName().toLowerCase(), this);
+ Logger.INFO("Stored " + getLocalizedName() + " to cache with key: "
+ + getLocalizedName().toLowerCase());
+
+ this.materialState = defaultState;
+
+ Logger.MATERIALS(this.getLocalizedName() + " is " + defaultState.name() + ".");
+
+ this.vGenerateCells = generateCells;
+
+ // Add Components to an array.
+ if (inputs == null) {
+ this.vMaterialInput = null;
+ } else {
+ if (inputs.length != 0) {
+ for (int i = 0; i < inputs.length; i++) {
+ if (inputs[i] != null) {
+ this.vMaterialInput.add(i, inputs[i]);
+ }
+ }
+ }
+ }
+
+ // set RGB
+
+ if (rgba == null) {
+ if (vMaterialInput.size() > 0) {
+
+ try {
+ Short[] mMixedRGB = new Short[3];
+ AutoMap<Material> mMaterialSet = MaterialUtils.getCompoundMaterialsRecursively(this);
+ for (int mnh = 0; mnh < 3; mnh++) {
+ AutoMap<Short> aDataSet = new AutoMap<Short>();
+ Set<Material> set4 = new HashSet<Material>();
+ for (Material u : mMaterialSet) {
+ // if (u.getState() == MaterialState.ORE || u.getState() == MaterialState.SOLID)
+ set4.add(u);
+ }
+ for (Material e : set4) {
+ aDataSet.put(e.getRGB()[mnh]);
+ }
+
+ Short aAverage = MathUtils.getShortAverage(aDataSet);
+ if (aAverage > Short.MAX_VALUE
+ || aAverage < Short.MIN_VALUE
+ || aAverage < 0
+ || aAverage > 255) {
+ if (aAverage > 255) {
+ while (aAverage > 255) {
+ aAverage = (short) (aAverage / 2);
+ }
+ }
+ aAverage = (short) Math.max(Math.min(aAverage, 255), 0);
+ }
+ mMixedRGB[mnh] = aAverage;
+ }
+
+ if (mMixedRGB != null && mMixedRGB[0] != null && mMixedRGB[1] != null && mMixedRGB[2] != null) {
+ this.RGBA = new short[] {mMixedRGB[0], mMixedRGB[1], mMixedRGB[2], 0};
+ } else {
+ this.RGBA = Materials.Steel.mRGBa;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ this.RGBA = Materials.Steel.mRGBa;
+ }
+ } else {
+ // Boring Grey Material
+
+ int aValueForGen = this.getUnlocalizedName().hashCode();
+ int hashSize = MathUtils.howManyPlaces(aValueForGen);
+
+ String a = String.valueOf(aValueForGen);
+ String b = "";
+
+ if (hashSize < 9) {
+ int aSecondHash = this.materialState.hashCode();
+ int hashSize2 = MathUtils.howManyPlaces(aSecondHash);
+ if (hashSize2 + hashSize >= 9) {
+ b = String.valueOf(aValueForGen);
+ } else {
+ String c = b;
+ while (MathUtils.howManyPlaces(hashSize + c.length()) < 9) {
+ c = c + c.hashCode();
+ }
+ b = c;
+ }
+ }
+
+ String valueR;
+ if (b != null) {
+ valueR = a + b;
+ } else {
+ valueR = a;
+ }
+ short fc[] = new short[3];
+ int aIndex = 0;
+ for (char gg : valueR.toCharArray()) {
+ short ui = Short.parseShort("" + gg);
+ if (ui > 255 || ui < 0) {
+ if (ui > 255) {
+ while (ui > 255) {
+ ui = (short) (ui / 2);
+ }
+ } else {
+ ui = 0;
+ }
+ }
+ fc[aIndex++] = ui;
+ }
+ this.RGBA = fc;
+ }
+ } else {
+ this.RGBA = rgba;
+ }
+
+ // Set Melting/Boiling point, if value is -1 calculate it from compound inputs.
+ if (meltingPoint != -1) {
+ this.meltingPointC = meltingPoint;
+ } else {
+ this.meltingPointC = this.calculateMeltingPoint();
+ }
+ if (boilingPoint != -1) {
+ if (boilingPoint != 0) {
+ this.boilingPointC = boilingPoint;
+ } else {
+ this.boilingPointC = meltingPoint * 4;
+ }
+ } else {
+ this.boilingPointC = this.calculateBoilingPoint();
+ }
+
+ this.meltingPointK = (int) MathUtils.celsiusToKelvin(this.meltingPointC);
+ this.boilingPointK = (int) MathUtils.celsiusToKelvin(this.boilingPointC);
+
+ // Set Proton/Neutron count, if value is -1 calculate it from compound inputs.
+ if (protons != -1) {
+ this.vProtons = protons;
+ } else {
+ this.vProtons = this.calculateProtons();
+ }
+ if (boilingPoint != -1) {
+ this.vNeutrons = neutrons;
+ } else {
+ this.vNeutrons = this.calculateNeutrons();
+ }
+
+ this.vAspects = null;
+
+ this.vMass = this.getMass();
+
+ // Sets tool Durability
+ if (durability != 0) {
+ this.vDurability = durability;
+ } else {
+ long aTempDura = 0;
+ for (MaterialStack g : this.getComposites()) {
+ if (g != null) {
+ aTempDura += safeCast_LongToInt(g.getStackMaterial().getMass() * 2000);
+ }
+ }
+ this.vDurability = aTempDura > 0
+ ? aTempDura
+ : (this.getComposites().isEmpty()
+ ? 51200
+ : 32000 * this.getComposites().size());
+ }
+
+ if ((this.vDurability >= 0) && (this.vDurability < 64000)) {
+ this.vToolQuality = 1;
+ this.vHarvestLevel = 2;
+ } else if ((this.vDurability >= 64000) && (this.vDurability < 128000)) {
+ this.vToolQuality = 2;
+ this.vHarvestLevel = 2;
+ } else if ((this.vDurability >= 128000) && (this.vDurability < 256000)) {
+ this.vToolQuality = 3;
+ this.vHarvestLevel = 2;
+ } else if ((this.vDurability >= 256000) && (this.vDurability < 512000)) {
+ this.vToolQuality = 3;
+ this.vHarvestLevel = 3;
+ } else if ((this.vDurability >= 512000) && (this.vDurability <= Integer.MAX_VALUE)) {
+ this.vToolQuality = 4;
+ this.vHarvestLevel = 4;
+ } else {
+ this.vToolQuality = 1;
+ this.vHarvestLevel = 1;
+ }
+
+ // Sets the Rad level
+ if (radiationLevel > 0) {
+ Logger.MATERIALS(this.getLocalizedName() + " is radioactive. Level: " + radiationLevel + ".");
+ this.isRadioactive = true;
+ this.vRadiationLevel = (byte) radiationLevel;
+ } else {
+ if (vMaterialInput.size() > 0) {
+ AutoMap<Byte> aDataSet = new AutoMap<Byte>();
+ for (MaterialStack m : this.vMaterialInput) {
+ aDataSet.put(m.getStackMaterial().vRadiationLevel);
+ }
+ byte aAverage = MathUtils.getByteAverage(aDataSet);
+ if (aAverage > 0) {
+ Logger.MATERIALS(this.getLocalizedName() + " is radioactive due to trace elements. Level: "
+ + aAverage + ".");
+ this.isRadioactive = true;
+ this.vRadiationLevel = (byte) aAverage;
+ } else {
+ Logger.MATERIALS(this.getLocalizedName() + " is not radioactive.");
+ this.isRadioactive = false;
+ this.vRadiationLevel = 0;
+ }
+ } else {
+ Logger.MATERIALS(this.getLocalizedName() + " is not radioactive.");
+ this.isRadioactive = false;
+ this.vRadiationLevel = 0;
+ }
+ }
+
+ /*if (vMaterialInput.size() > 0) {
+ AutoMap<Integer> aDataSet = new AutoMap<Integer>();
+
+ int bonus = 0;
+ bonus += this.vMaterialInput.size();
+ bonus += MathUtils.roundToClosestInt(meltingPointC/1000);
+
+
+
+ aDataSet.put(bonus);
+
+ for (MaterialStack m : this.vMaterialInput) {
+ aDataSet.put(m.getStackMaterial().vTier);
+ }
+ int aAverage = MathUtils.getIntAverage(aDataSet);
+ if (aAverage > Integer.MAX_VALUE || aAverage < Integer.MIN_VALUE) {
+ aAverage = 0;
+ }
+ if (aAverage > 0) {
+ this.vTier = Math.min(aAverage, 10);
+ }
+ else {
+ this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint));
+ }
+ }
+ else {
+ this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint));
+ }*/
+ this.vTier = MaterialUtils.getTierOfMaterial(meltingPoint);
+
+ // Sets the materials 'tier'. Will probably replace this logic.
+
+ this.usesBlastFurnace = blastFurnace;
+ this.vVoltageMultiplier = MaterialUtils.getVoltageForTier(vTier);
+
+ this.vComponentCount = this.getComponentCount(inputs);
+ this.vSmallestRatio = this.getSmallestRatio(this.vMaterialInput);
+ int tempSmallestSize = 0;
+
+ if (this.vSmallestRatio != null) {
+ for (int v = 0; v < this.vSmallestRatio.length; v++) {
+ tempSmallestSize = (int) (tempSmallestSize + this.vSmallestRatio[v]);
+ }
+ this.smallestStackSizeWhenProcessing = tempSmallestSize; // Valid stacksizes
+ } else {
+ this.smallestStackSizeWhenProcessing = 1; // Valid stacksizes
+ }
+
+ // Makes a Fancy Chemical Tooltip
+
+ if (chemicalSymbol == null) {
+ chemicalSymbol = "";
+ }
+
+ this.vChemicalSymbol = chemicalSymbol;
+ if (this.vMaterialInput != null) {
+ this.vChemicalFormula = this.getToolTip(chemicalSymbol, OrePrefixes.dust.mMaterialAmount / M, true);
+ } else if (!this.vChemicalSymbol.equals("")) {
+ Logger.MATERIALS("materialInput is null, using a valid chemical symbol.");
+ this.vChemicalFormula = this.vChemicalSymbol;
+ } else {
+ Logger.MATERIALS("MaterialInput == null && chemicalSymbol probably equals nothing");
+ this.vChemicalSymbol = "??";
+ this.vChemicalFormula = "??";
+ }
+
+ if (generateFluid) {
+ final Materials aGregtechMaterial = tryFindGregtechMaterialEquivalent();
+ FluidStack aTest = FluidUtils.getWildcardFluidStack(localizedName, 1);
+ if (aTest != null) {
+ this.mFluid = aTest.getFluid();
+ checkForCellAndGenerate(this);
+ } else {
+ if (aGregtechMaterial != null && !MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) {
+ aTest = FluidUtils.getWildcardFluidStack(aGregtechMaterial, 1);
+ }
+ if (aTest != null) {
+ this.mFluid = aTest.getFluid();
+ checkForCellAndGenerate(this);
+ } else {
+ mFluid = generateFluid();
+ }
+ }
+ // Don't generate plasma for composites
+ if (this.getComposites().isEmpty()) {
+ this.mPlasma = this.generatePlasma();
+ }
+ } else {
+ this.mFluid = null;
+ this.mPlasma = null;
+ }
+ String ratio = "";
+ if (this.vSmallestRatio != null) {
+ for (int hu = 0; hu < this.vSmallestRatio.length; hu++) {
+ if (ratio.equals("")) {
+ ratio = String.valueOf(this.vSmallestRatio[hu]);
+ } else {
+ ratio = ratio + ":" + this.vSmallestRatio[hu];
+ }
+ }
+ }
+
+ this.textureSet = setTextureSet(set, vTier);
+
+ if (LoadedMods.TiCon && this.materialState == MaterialState.SOLID) {
+ if (this.getProtons() >= 98 || this.getComposites().size() > 1 || this.getMeltingPointC() >= 3600) {
+ this.vTiConHandler = new BaseTinkersMaterial(this);
+ }
+ }
+
+ sChemicalFormula.put(materialName.toLowerCase(), this.vChemicalFormula);
+ Logger.MATERIALS("Creating a Material instance for " + materialName);
+ Logger.MATERIALS("Formula: " + this.vChemicalFormula + " Smallest Stack: "
+ + this.smallestStackSizeWhenProcessing + " Smallest Ratio:" + ratio);
+ Logger.MATERIALS("Protons: " + this.vProtons);
+ Logger.MATERIALS("Neutrons: " + this.vNeutrons);
+ Logger.MATERIALS("Mass: " + this.vMass + "/units");
+ Logger.MATERIALS("Melting Point: " + this.meltingPointC + "C.");
+ Logger.MATERIALS("Boiling Point: " + this.boilingPointC + "C.");
+ } catch (Throwable t) {
+ Logger.MATERIALS("Stack Trace for " + materialName);
+ t.printStackTrace();
+ }
+ }
+
+ private static void checkForCellAndGenerate(Material material) {
+ if (!material.vGenerateCells) {
+ return;
+ }
+ String aName = Utils.sanitizeString(material.unlocalizedName);
+ String aName2 = Utils.sanitizeString(material.unlocalizedName.toLowerCase());
+ String aName3 = (material.localizedName == null) ? aName : material.localizedName;
+ ItemStack aTestCell1 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + aName, 1);
+ ItemStack aTestCell2 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + aName2, 1);
+ ItemStack aTestCell3 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + aName3, 1);
+ if (aTestCell1 == null && aTestCell2 == null && aTestCell3 == null) {
+ Logger.INFO("Generating cell for " + material.localizedName);
+ new BaseItemCell(material);
+ } else {
+ if (aTestCell1 != null) {
+ Logger.INFO("Registering existing cell for " + material.localizedName + ", " + aName);
+ material.registerComponentForMaterial(OrePrefixes.cell, aTestCell1);
+ } else if (aTestCell2 != null) {
+ Logger.INFO("Registering existing cell for " + material.localizedName + ", " + aName2);
+ material.registerComponentForMaterial(OrePrefixes.cell, aTestCell2);
+ } else if (aTestCell3 != null) {
+ Logger.INFO("Registering existing cell for " + material.localizedName + ", " + aName3);
+ material.registerComponentForMaterial(OrePrefixes.cell, aTestCell3);
+ }
+ }
+ }
+
+ public final TextureSet getTextureSet() {
+ synchronized (this) {
+ return textureSet;
+ }
+ }
+
+ public TextureSet setTextureSet(TextureSet set) {
+ return setTextureSet(set, vTier);
+ }
+
+ public TextureSet setTextureSet(TextureSet set, int aTier) {
+ if (set != null) {
+ Logger.MATERIALS("Set textureset for " + this.localizedName + " to be " + set.mSetName
+ + ". This textureSet was supplied.");
+ return set;
+ }
+
+ int aGem = 0;
+ int aShiny = 0;
+ TextureSet aSet = null;
+
+ // Check Mixture Contents
+ for (MaterialStack m : this.getComposites()) {
+
+ // Gems
+ if (m.getStackMaterial() == ELEMENT.getInstance().AER) {
+ aGem++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().AQUA) {
+ aGem++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().IGNIS) {
+ aGem++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().TERRA) {
+ aGem++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().MAGIC) {
+ aGem++;
+ }
+ // Shiny Materials
+ if (m.getStackMaterial() == ELEMENT.getInstance().GOLD) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().SILVER) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().PLATINUM) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().AMERICIUM) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().TITANIUM) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().GERMANIUM) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().GALLIUM) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().MERCURY) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().MAGIC) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().SAMARIUM) {
+ aShiny++;
+ } else if (m.getStackMaterial() == ELEMENT.getInstance().TANTALUM) {
+ aShiny++;
+ }
+ }
+
+ if (aSet == null) {
+ if (aGem >= this.getComposites().size() / 2) {
+ if (MathUtils.isNumberEven(aGem)) {
+ Logger.MATERIALS("Set textureset for " + this.localizedName + " to be "
+ + TextureSet.SET_GEM_HORIZONTAL.mSetName + ".");
+ return TextureSet.SET_GEM_HORIZONTAL;
+ } else {
+ Logger.MATERIALS("Set textureset for " + this.localizedName + " to be "
+ + TextureSet.SET_GEM_VERTICAL.mSetName + ".");
+ return TextureSet.SET_GEM_VERTICAL;
+ }
+ }
+ }
+
+ if (aSet == null) {
+ if (aShiny >= this.getComposites().size() / 3) {
+ Logger.MATERIALS(
+ "Set textureset for " + this.localizedName + " to be " + TextureSet.SET_SHINY.mSetName + ".");
+ return TextureSet.SET_SHINY;
+ }
+ }
+
+ // build hash table with count
+ AutoMap<Material> sets = new AutoMap<Material>();
+ if (this.vMaterialInput != null) {
+ for (MaterialStack r : this.vMaterialInput) {
+ if (r.getStackMaterial().getTextureSet().mSetName.toLowerCase().contains("fluid")) {
+ sets.put(ELEMENT.getInstance().GOLD);
+ } else {
+ sets.put(r.getStackMaterial());
+ }
+ }
+ TextureSet mostUsedTypeTextureSet =
+ MaterialUtils.getMostCommonTextureSet(new ArrayList<Material>(sets.values()));
+ if (mostUsedTypeTextureSet != null && mostUsedTypeTextureSet instanceof TextureSet) {
+ Logger.MATERIALS(
+ "Set textureset for " + this.localizedName + " to be " + mostUsedTypeTextureSet.mSetName + ".");
+ return mostUsedTypeTextureSet;
+ }
+ }
+ Logger.MATERIALS("Set textureset for " + this.localizedName + " to be " + Materials.Iron.mIconSet.mSetName
+ + ". [Fallback]");
+ return Materials.Gold.mIconSet;
+ }
+
+ public final String getLocalizedName() {
+ if (this.localizedName != null) {
+ return this.localizedName;
+ }
+ return "ERROR BAD LOCALIZED NAME";
+ }
+
+ public final String getUnlocalizedName() {
+ if (this.unlocalizedName != null) {
+ return this.unlocalizedName;
+ }
+ return "ERROR.BAD.UNLOCALIZED.NAME";
+ }
+
+ public final MaterialState getState() {
+ return this.materialState;
+ }
+
+ public final short[] getRGB() {
+ if (this.RGBA != null) {
+ return this.RGBA;
+ }
+ return new short[] {255, 0, 0};
+ }
+
+ public final short[] getRGBA() {
+ if (this.RGBA != null) {
+ if (this.RGBA.length == 4) {
+ return this.RGBA;
+ } else {
+ return new short[] {this.RGBA[0], this.RGBA[1], this.RGBA[2], 0};
+ }
+ }
+ return new short[] {255, 0, 0, 0};
+ }
+
+ public final int getRgbAsHex() {
+
+ final int returnValue = Utils.rgbtoHexValue(this.RGBA[0], this.RGBA[1], this.RGBA[2]);
+ if (returnValue == 0) {
+ return (int) this.dataVar;
+ }
+ return Utils.rgbtoHexValue(this.RGBA[0], this.RGBA[1], this.RGBA[2]);
+ }
+
+ public final long getProtons() {
+ return this.vProtons;
+ }
+
+ public final long getNeutrons() {
+ return this.vNeutrons;
+ }
+
+ public final long getMass() {
+ return this.vProtons + this.vNeutrons;
+ }
+
+ public final int getMeltingPointC() {
+ return this.meltingPointC;
+ }
+
+ public final int getBoilingPointC() {
+ return this.boilingPointC;
+ }
+
+ public final int getMeltingPointK() {
+ return this.meltingPointK;
+ }
+
+ public final int getBoilingPointK() {
+ return this.boilingPointK;
+ }
+
+ public final boolean requiresBlastFurnace() {
+ return this.usesBlastFurnace;
+ }
+
+ public final ItemStack getComponentByPrefix(OrePrefixes aPrefix, int stacksize) {
+ String aKey = aPrefix.name();
+ Map<String, ItemStack> g = mComponentMap.get(this.unlocalizedName);
+ if (g == null) {
+ Map<String, ItemStack> aMap = new HashMap<String, ItemStack>();
+ mComponentMap.put(unlocalizedName, aMap);
+ g = aMap;
+ }
+ ItemStack i = g.get(aKey);
+ if (i != null) {
+ return ItemUtils.getSimpleStack(i, stacksize);
+ } else {
+ // Try get a GT Material
+ Materials Erf = MaterialUtils.getMaterial(this.unlocalizedName);
+ if (Erf != null && !MaterialUtils.isNullGregtechMaterial(Erf)) {
+ ItemStack Erg = ItemUtils.getOrePrefixStack(aPrefix, Erf, stacksize);
+ if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) {
+ Logger.MATERIALS("Found \"" + aKey + this.unlocalizedName + "\" using backup GT Materials option.");
+ g.put(aKey, Erg);
+ mComponentMap.put(unlocalizedName, g);
+ return Erg;
+ } else {
+ // Try get a molten cell
+ if (aPrefix == OrePrefixes.cell) {
+ Erg = ItemUtils.getOrePrefixStack(OrePrefixes.cellMolten, Erf, stacksize);
+ if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) {
+ Logger.MATERIALS("Found \"" + OrePrefixes.cellMolten.name() + this.unlocalizedName
+ + "\" using backup GT Materials option.");
+ g.put(aKey, Erg);
+ mComponentMap.put(unlocalizedName, g);
+ return Erg;
+ }
+ }
+ }
+ } else {
+ ItemStack u = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(aKey + this.unlocalizedName, stacksize);
+ if (u != null) {
+ g.put(aKey, u);
+ mComponentMap.put(unlocalizedName, g);
+ return u;
+ }
+ }
+ // Logger.MATERIALS("Unabled to find \"" + aKey + this.unlocalizedName + "\"");
+ return ItemUtils.getErrorStack(stacksize, (aKey + this.unlocalizedName + " x" + stacksize));
+ }
+ }
+
+ public final Block getBlock() {
+ Block b = Block.getBlockFromItem(getBlock(1).getItem());
+ if (b == null) {
+ Logger.INFO("[ERROR] Tried to get invalid block for " + this.getLocalizedName()
+ + ", returning debug block instead.");
+ }
+ return b != null ? b : Blocks.lit_furnace;
+ }
+
+ public final ItemStack getBlock(final int stacksize) {
+ ItemStack i = getComponentByPrefix(OrePrefixes.block, stacksize);
+ return i != null
+ ? i
+ : ItemUtils.getItemStackOfAmountFromOreDictNoBroken("block" + this.unlocalizedName, stacksize);
+ }
+
+ public final ItemStack getDust(final int stacksize) {
+ ItemStack i = getComponentByPrefix(OrePrefixes.dust, stacksize);
+ return i != null ? i : ItemUtils.getGregtechDust("dust" + this.unlocalizedName, stacksize);
+ }
+
+ public final ItemStack getSmallDust(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.dustSmall, stacksize);
+ }
+
+ public final ItemStack getTinyDust(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.dustTiny, stacksize);
+ }
+
+ public final ItemStack getIngot(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.ingot, stacksize);
+ }
+
+ public final ItemStack getHotIngot(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.ingotHot, stacksize);
+ }
+
+ public final ItemStack getPlate(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.plate, stacksize);
+ }
+
+ public final ItemStack getPlateDouble(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.plateDouble, stacksize);
+ }
+
+ public final ItemStack getGear(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.gearGt, stacksize);
+ }
+
+ public final ItemStack getRod(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.stick, stacksize);
+ }
+
+ public final ItemStack getLongRod(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.stickLong, stacksize);
+ }
+
+ public final ItemStack getBolt(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.bolt, stacksize);
+ }
+
+ public final ItemStack getScrew(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.screw, stacksize);
+ }
+
+ public final ItemStack getFineWire(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.wireFine, stacksize);
+ }
+
+ public final ItemStack getFoil(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.foil, stacksize);
+ }
+
+ public final ItemStack getRing(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.ring, stacksize);
+ }
+
+ public final ItemStack getRotor(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.rotor, stacksize);
+ }
+
+ public final ItemStack getFrameBox(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.frameGt, stacksize);
+ }
+
+ public final ItemStack getCell(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.cell, stacksize);
+ }
+
+ public final ItemStack getPlasmaCell(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.cellPlasma, stacksize);
+ }
+
+ public final ItemStack getNugget(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.nugget, stacksize);
+ }
+
+ public final ItemStack getWire01(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.wireGt01, stacksize);
+ }
+
+ public final ItemStack getWire02(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.wireGt02, stacksize);
+ }
+
+ public final ItemStack getWire04(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.wireGt04, stacksize);
+ }
+
+ public final ItemStack getWire08(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.wireGt08, stacksize);
+ }
+
+ public final ItemStack getWire12(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.wireGt12, stacksize);
+ }
+
+ public final ItemStack getWire16(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.wireGt16, stacksize);
+ }
+
+ public final ItemStack getCable01(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.cableGt01, stacksize);
+ }
+
+ public final ItemStack getCable02(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.cableGt02, stacksize);
+ }
+
+ public final ItemStack getCable04(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.cableGt04, stacksize);
+ }
+
+ public final ItemStack getCable08(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.cableGt08, stacksize);
+ }
+
+ public final ItemStack getCable12(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.cableGt12, stacksize);
+ }
+
+ public final ItemStack getCable16(final int stacksize) {
+ if (GregtechConduits.cableGt16 != null) {
+ return getComponentByPrefix(GregtechConduits.cableGt16, stacksize);
+ } else {
+ return ItemUtils.getErrorStack(stacksize);
+ }
+ }
+
+ /**
+ * Ore Components
+ * @return
+ */
+ public final ItemStack getOre(final int stacksize) {
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
+ "ore" + Utils.sanitizeString(this.getUnlocalizedName()), stacksize);
+ }
+
+ public final Block getOreBlock(final int stacksize) {
+ // Logger.DEBUG_MATERIALS("Trying to get ore block for "+this.getLocalizedName()+". Looking for
+ // '"+"ore"+Utils.sanitizeString(this.getUnlocalizedName())+"'.");
+ try {
+ ItemStack a1 = getOre(1);
+ Item a2 = a1.getItem();
+ Block a3 = Block.getBlockFromItem(a2);
+ if (a3 != null) {
+ return a3;
+ }
+
+ Block x = Block.getBlockFromItem(ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
+ "ore" + Utils.sanitizeString(this.unlocalizedName), stacksize)
+ .getItem());
+ if (x != null) {
+ return x;
+ }
+ } catch (Throwable t) {
+ // t.printStackTrace();
+ }
+ // Logger.MATERIALS("Failed getting the Ore Block for "+this.getLocalizedName()+".");
+ return Blocks.stone;
+ }
+
+ public final ItemStack getCrushed(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.crushed, stacksize);
+ }
+
+ public final ItemStack getCrushedPurified(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.crushedPurified, stacksize);
+ }
+
+ public final ItemStack getCrushedCentrifuged(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.crushedCentrifuged, stacksize);
+ }
+
+ public final ItemStack getDustPurified(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.dustPure, stacksize);
+ }
+
+ public final ItemStack getDustImpure(final int stacksize) {
+ return getComponentByPrefix(OrePrefixes.dustImpure, stacksize);
+ }
+
+ public final ItemStack getMilled(final int stacksize) {
+ return getComponentByPrefix(CustomOrePrefix.milled.get(), stacksize);
+ }
+
+ public final boolean hasSolidForm() {
+ if (ItemUtils.checkForInvalidItems(
+ new ItemStack[] {getDust(1), getBlock(1), getTinyDust(1), getSmallDust(1)})) {
+ return true;
+ }
+ return false;
+ }
+
+ public final ItemStack[] getMaterialComposites() {
+ if (this.vMaterialInput != null && !this.vMaterialInput.isEmpty()) {
+ final ItemStack[] temp = new ItemStack[this.vMaterialInput.size()];
+ for (int i = 0; i < this.vMaterialInput.size(); i++) {
+ // Utils.LOG_MATERIALS("i:"+i);
+ ItemStack testNull = null;
+ try {
+ testNull = this.vMaterialInput.get(i).getValidStack();
+ } catch (final Throwable r) {
+ Logger.MATERIALS("Failed gathering material stack for " + this.localizedName + ".");
+ Logger.MATERIALS("What Failed: Length:" + this.vMaterialInput.size() + " current:" + i);
+ }
+ try {
+ if (testNull != null) {
+ // Utils.LOG_MATERIALS("not null");
+ temp[i] = this.vMaterialInput.get(i).getValidStack();
+ }
+ } catch (final Throwable r) {
+ Logger.MATERIALS("Failed setting slot " + i + ", using " + this.localizedName);
+ }
+ }
+ return temp;
+ }
+ return new ItemStack[] {};
+ }
+
+ public final ArrayList<MaterialStack> getComposites() {
+ return this.vMaterialInput;
+ }
+
+ public final int[] getMaterialCompositeStackSizes() {
+ if (!this.vMaterialInput.isEmpty()) {
+ final int[] temp = new int[this.vMaterialInput.size()];
+ for (int i = 0; i < this.vMaterialInput.size(); i++) {
+ if (this.vMaterialInput.get(i) != null) {
+ temp[i] = this.vMaterialInput.get(i).getDustStack().stackSize;
+ } else {
+ temp[i] = 0;
+ }
+ }
+ return temp;
+ }
+ return new int[] {};
+ }
+
+ private final short getComponentCount(final MaterialStack[] inputs) {
+
+ if (inputs == null || inputs.length < 1) {
+ return 1;
+ }
+ int counterTemp = 0;
+ for (final MaterialStack m : inputs) {
+ if (m.getStackMaterial() != null) {
+ counterTemp++;
+ }
+ }
+ if (counterTemp != 0) {
+ return (short) counterTemp;
+ } else {
+ return 1;
+ }
+ }
+
+ public final long[] getSmallestRatio(final ArrayList<MaterialStack> tempInput) {
+ if (tempInput != null) {
+ if (!tempInput.isEmpty()) {
+ Logger.MATERIALS("length: " + tempInput.size());
+ Logger.MATERIALS("(inputs != null): " + (tempInput != null));
+ // Utils.LOG_MATERIALS("length: "+inputs.length);
+ final long[] tempRatio = new long[tempInput.size()];
+ for (int x = 0; x < tempInput.size(); x++) {
+ // tempPercentage = tempPercentage+inputs[x].percentageToUse;
+ // this.mMaterialList.add(inputs[x]);
+ if (tempInput.get(x) != null) {
+ tempRatio[x] = tempInput.get(x).getPartsPerOneHundred();
+ }
+ }
+
+ final long[] smallestRatio = MathUtils.simplifyNumbersToSmallestForm(tempRatio);
+
+ if (smallestRatio.length > 0) {
+ String tempRatioStringThing1 = "";
+ for (int r = 0; r < tempRatio.length; r++) {
+ tempRatioStringThing1 = tempRatioStringThing1 + tempRatio[r] + " : ";
+ }
+ Logger.MATERIALS("Default Ratio: " + tempRatioStringThing1);
+
+ String tempRatioStringThing = "";
+ int tempSmallestCraftingUseSize = 0;
+ for (int r = 0; r < smallestRatio.length; r++) {
+ tempRatioStringThing = tempRatioStringThing + smallestRatio[r] + " : ";
+ tempSmallestCraftingUseSize = (int) (tempSmallestCraftingUseSize + smallestRatio[r]);
+ }
+ // this.smallestStackSizeWhenProcessing = tempSmallestCraftingUseSize;
+ Logger.MATERIALS("Smallest Ratio: " + tempRatioStringThing);
+ return smallestRatio;
+ }
+ }
+ }
+ return new long[] {};
+ }
+
+ public final String getToolTip(final String chemSymbol, final long aMultiplier, final boolean aShowQuestionMarks) {
+ if (!aShowQuestionMarks && (this.vChemicalFormula.equals("?") || this.vChemicalFormula.equals("??"))) {
+ return "";
+ }
+ Logger.MATERIALS("===============| Calculating Atomic Formula for " + this.localizedName + " |===============");
+ if (!chemSymbol.equals("")) {
+ return chemSymbol;
+ }
+ final ArrayList<MaterialStack> tempInput = this.vMaterialInput;
+ if (tempInput != null) {
+ if (!tempInput.isEmpty()) {
+ String dummyFormula = "";
+ final long[] dummyFormulaArray = this.getSmallestRatio(tempInput);
+ if (dummyFormulaArray != null) {
+ if (dummyFormulaArray.length >= 1) {
+ for (int e = 0; e < tempInput.size(); e++) {
+ MaterialStack g = tempInput.get(e);
+ if (g != null) {
+ if (g.getStackMaterial() != null) {
+
+ String aChemSymbol = g.getStackMaterial().vChemicalSymbol;
+ String aChemFormula = g.getStackMaterial().vChemicalFormula;
+
+ if (aChemSymbol == null) {
+ aChemSymbol = "??";
+ }
+ if (aChemFormula == null) {
+ aChemFormula = "??";
+ }
+
+ if (!aChemSymbol.equals("??")) {
+ if (dummyFormulaArray[e] > 1) {
+
+ if (aChemFormula.length() > 3) {
+ dummyFormula =
+ dummyFormula + "(" + aChemFormula + ")" + dummyFormulaArray[e];
+ } else {
+ dummyFormula = dummyFormula + aChemFormula + dummyFormulaArray[e];
+ }
+ } else if (dummyFormulaArray[e] == 1) {
+ if (aChemFormula.length() > 3) {
+ dummyFormula = dummyFormula + "(" + aChemFormula + ")";
+ } else {
+ dummyFormula = dummyFormula + aChemFormula;
+ }
+ } else {
+ dummyFormula = dummyFormula + "??";
+ }
+ } else {
+ dummyFormula = dummyFormula + "??";
+ }
+ } else {
+ dummyFormula = dummyFormula + "??";
+ }
+ }
+ }
+ return StringUtils.subscript(dummyFormula);
+ // return dummyFormula;
+ }
+ Logger.MATERIALS("dummyFormulaArray <= 0");
+ }
+ Logger.MATERIALS("dummyFormulaArray == null");
+ }
+ Logger.MATERIALS("tempInput.length <= 0");
+ }
+ Logger.MATERIALS("tempInput == null");
+ return "??";
+ }
+
+ public final boolean queueFluidGeneration() {
+ return isFluidQueued = true;
+ }
+
+ public static final void generateQueuedFluids() {
+ for (Material m : mMaterialMap) {
+ if (m.isFluidQueued) {}
+ }
+ }
+
+ // If we need a fluid, let's just queue it for later.
+ public boolean isFluidQueued = false;
+
+ public final Fluid generateFluid() {
+ if (this.materialState == MaterialState.ORE) {
+ return null;
+ }
+
+ Fluid aGTBaseFluid = null;
+
+ // Clean up Internal Fluid Generation
+ final Materials n1 =
+ MaterialUtils.getMaterial(this.getLocalizedName(), Utils.sanitizeString(this.getLocalizedName()));
+ final Materials n2 =
+ MaterialUtils.getMaterial(this.getUnlocalizedName(), Utils.sanitizeString(this.getUnlocalizedName()));
+
+ FluidStack f1 = FluidUtils.getWildcardFluidStack(n1, 1);
+ FluidStack f2 = FluidUtils.getWildcardFluidStack(n2, 1);
+ FluidStack f3 = FluidUtils.getWildcardFluidStack(
+ Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1);
+ FluidStack f4 = FluidUtils.getWildcardFluidStack(
+ Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1);
+
+ if (f1 != null) {
+ aGTBaseFluid = f1.getFluid();
+ } else if (f2 != null) {
+ aGTBaseFluid = f2.getFluid();
+ } else if (f3 != null) {
+ aGTBaseFluid = f3.getFluid();
+ } else if (f4 != null) {
+ aGTBaseFluid = f4.getFluid();
+ }
+
+ ItemStack aFullCell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + this.getUnlocalizedName(), 1);
+ ItemStack aFullCell2 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + this.getLocalizedName(), 1);
+ ItemStack aFullCell3 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
+ "cell" + Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1);
+ ItemStack aFullCell4 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
+ "cell" + Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1);
+
+ Logger.MATERIALS("Generating our own fluid.");
+ // Generate a Cell if we need to, but first validate all four searches are invalid
+
+ if (!ItemUtils.checkForInvalidItems(new ItemStack[] {aFullCell, aFullCell2, aFullCell3, aFullCell4})) {
+ if (this.vGenerateCells) {
+ Item g = new BaseItemCell(this);
+ aFullCell = ItemUtils.getSimpleStack(g);
+ Logger.MATERIALS("Generated a cell for " + this.getUnlocalizedName());
+ } else {
+ Logger.MATERIALS("Did not generate a cell for " + this.getUnlocalizedName());
+ }
+ } else {
+ // One cell we searched for was valid, let's register it.
+ if (aFullCell != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell);
+ } else if (aFullCell2 != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell2);
+ } else if (aFullCell3 != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell3);
+ } else if (aFullCell4 != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell4);
+ }
+ }
+
+ // We found a GT fluid, let's use it.
+ // Good chance we registered the cell from this material too.
+ if (aGTBaseFluid != null) {
+ return aGTBaseFluid;
+ }
+
+ // This fluid does not exist at all, time to generate it.
+ if (this.materialState == MaterialState.SOLID) {
+ return FluidUtils.addGTFluid(
+ this.getUnlocalizedName(),
+ "Molten " + this.getLocalizedName(),
+ this.RGBA,
+ 4,
+ this.getMeltingPointK(),
+ aFullCell,
+ ItemUtils.getEmptyCell(),
+ 1000,
+ this.vGenerateCells);
+ } else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID) {
+ return FluidUtils.addGTFluid(
+ this.getUnlocalizedName(),
+ this.getLocalizedName(),
+ this.RGBA,
+ 0,
+ this.getMeltingPointK(),
+ aFullCell,
+ ItemUtils.getEmptyCell(),
+ 1000,
+ this.vGenerateCells);
+ } else if (this.materialState == MaterialState.GAS || this.materialState == MaterialState.PURE_GAS) {
+ return FluidUtils.generateGas(
+ unlocalizedName, this.getLocalizedName(), getMeltingPointK(), getRGBA(), vGenerateCells);
+ /*return FluidUtils.addGTFluid(
+ this.getUnlocalizedName(),
+ this.getLocalizedName()+" Gas",
+ this.RGBA,
+ 2,
+ this.getMeltingPointK(),
+ aFullCell,
+ ItemUtils.getEmptyCell(),
+ 1000,
+ this.vGenerateCells);*/
+ } else { // Plasma
+ return this.generatePlasma();
+ }
+ }
+
+ public final Fluid generatePlasma() {
+ if (this.materialState == MaterialState.ORE) {
+ return null;
+ }
+ final Materials isValid = tryFindGregtechMaterialEquivalent();
+
+ if (!this.vGenerateCells) {
+ return null;
+ }
+ if (isValid != null) {
+ for (Materials m : invalidMaterials.values()) {
+ if (isValid == m) {
+ return null;
+ }
+ }
+ if (isValid.mPlasma != null) {
+ Logger.MATERIALS("Using a pre-defined Plasma from GT.");
+ return isValid.mPlasma;
+ }
+ }
+ Logger.MATERIALS("Generating our own Plasma.");
+ return FluidUtils.addGTPlasma(this);
+ }
+
+ public Fluid getFluid() {
+ return mFluid;
+ }
+
+ public Fluid getPlasma() {
+ return mPlasma;
+ }
+
+ public final FluidStack getFluidStack(final int fluidAmount) {
+ if (this.mFluid == null) {
+ return null;
+ }
+ final FluidStack moltenFluid = new FluidStack(this.mFluid, fluidAmount);
+ return moltenFluid;
+ }
+
+ public final boolean setFluid(Fluid aFluid) {
+ if (this.mFluid == null) {
+ this.mFluid = aFluid;
+ return true;
+ }
+ return false;
+ }
+
+ public final int calculateMeltingPoint() {
+ try {
+ AutoMap<Integer> aDataSet = new AutoMap<Integer>();
+ for (MaterialStack m : this.vMaterialInput) {
+ aDataSet.put(m.getStackMaterial().getMeltingPointC());
+ }
+ long aAverage = MathUtils.getIntAverage(aDataSet);
+ return MathUtils.safeInt(aAverage);
+ } catch (Throwable r) {
+ r.printStackTrace();
+ return 500;
+ }
+ }
+
+ public final int calculateBoilingPoint() {
+ try {
+
+ AutoMap<Integer> aDataSet = new AutoMap<Integer>();
+ for (MaterialStack m : this.vMaterialInput) {
+ aDataSet.put(m.getStackMaterial().getBoilingPointC());
+ }
+ long aAverage = MathUtils.getIntAverage(aDataSet);
+ return MathUtils.safeInt(aAverage);
+ } catch (Throwable r) {
+ r.printStackTrace();
+ return 2500;
+ }
+ }
+
+ public final long calculateProtons() {
+ try {
+
+ AutoMap<Long> aDataSet = new AutoMap<Long>();
+ for (MaterialStack m : this.vMaterialInput) {
+ aDataSet.put(m.getStackMaterial().getProtons());
+ }
+ long aAverage = MathUtils.getLongAverage(aDataSet);
+ return MathUtils.safeInt(aAverage);
+ } catch (Throwable r) {
+ r.printStackTrace();
+ return 50;
+ }
+ }
+
+ public final long calculateNeutrons() {
+ try {
+
+ AutoMap<Long> aDataSet = new AutoMap<Long>();
+ for (MaterialStack m : this.vMaterialInput) {
+ aDataSet.put(m.getStackMaterial().getNeutrons());
+ }
+ long aAverage = MathUtils.getLongAverage(aDataSet);
+ return MathUtils.safeInt(aAverage);
+ } catch (Throwable r) {
+ r.printStackTrace();
+ return 75;
+ }
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (!Material.class.isInstance(obj)) {
+ return false;
+ }
+ Material aObj = (Material) obj;
+ if (aObj.unlocalizedName.equals(this.unlocalizedName)) {
+ if (aObj.localizedName.equals(this.localizedName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean registerComponentForMaterial(FluidStack aStack) {
+ return registerComponentForMaterial(this, aStack);
+ }
+
+ private static boolean registerComponentForMaterial(Material componentMaterial, FluidStack aStack) {
+ if (componentMaterial != null && aStack != null && componentMaterial.mFluid == null) {
+ componentMaterial.mFluid = aStack.getFluid();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean registerComponentForMaterial(ComponentTypes aPrefix, ItemStack aStack) {
+ return registerComponentForMaterial(this, aPrefix.getGtOrePrefix(), aStack);
+ }
+
+ public boolean registerComponentForMaterial(OrePrefixes aPrefix, ItemStack aStack) {
+ return registerComponentForMaterial(this, aPrefix, aStack);
+ }
+
+ public static boolean registerComponentForMaterial(
+ Material componentMaterial, ComponentTypes aPrefix, ItemStack aStack) {
+ return registerComponentForMaterial(componentMaterial, aPrefix.getGtOrePrefix(), aStack);
+ }
+
+ public static boolean registerComponentForMaterial(
+ Material componentMaterial, OrePrefixes aPrefix, ItemStack aStack) {
+ if (componentMaterial == null) {
+ return false;
+ }
+ // Register Component
+ Map<String, ItemStack> aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName());
+ if (aMap == null) {
+ aMap = new HashMap<String, ItemStack>();
+ }
+ String aKey = aPrefix.name();
+ ItemStack x = aMap.get(aKey);
+ if (x == null) {
+ aMap.put(aKey, aStack);
+ Logger.MATERIALS("Registering a material component. Item: [" + componentMaterial.getUnlocalizedName()
+ + "] Map: [" + aKey + "]");
+ Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap);
+ return true;
+ } else {
+ // Bad
+ Logger.MATERIALS("Tried to double register a material component. ");
+ return false;
+ }
+ }
+
+ public Materials tryFindGregtechMaterialEquivalent() {
+ return tryFindGregtechMaterialEquivalent(this);
+ }
+
+ public static Materials tryFindGregtechMaterialEquivalent(Material aMaterial) {
+ String aMaterialName = aMaterial.getLocalizedName();
+ Materials aGregtechMaterial = Materials.get(aMaterialName);
+ if (aGregtechMaterial == null || MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) {
+ aMaterialName = aMaterialName.replace(" ", "_");
+ aGregtechMaterial = Materials.get(aMaterialName);
+ if (aGregtechMaterial == null || MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) {
+ aMaterialName = aMaterialName.replace(" ", "");
+ aGregtechMaterial = Materials.get(aMaterialName);
+ if (aGregtechMaterial == null || MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) {
+ return null;
+ } else {
+ return aGregtechMaterial;
+ }
+ } else {
+ return aGregtechMaterial;
+ }
+ } else {
+ return aGregtechMaterial;
+ }
+ }
+
+ public void setWerkstoffID(short werkstoffID) {
+ this.werkstoffID = werkstoffID;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java b/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java
index aac3bc3e92..11a401f55a 100644
--- a/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -1,10 +1,5 @@
package gtPlusPlus.core.material;
-import java.util.Set;
-
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -54,6 +49,7 @@ import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plasma;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting;
+import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -61,384 +57,385 @@ import net.minecraftforge.fluids.FluidStack;
public class MaterialGenerator {
- public static final AutoMap<Set<RunnableWithInfo<Material>>> mRecipeMapsToGenerate = new AutoMap<Set<RunnableWithInfo<Material>>>();
-
- @SuppressWarnings("unused")
- private static volatile Item temp;
- @SuppressWarnings("unused")
- private static volatile Block tempBlock;
-
-
- public static boolean addFluidCannerRecipe(ItemStack aEmpty, ItemStack aFullContainer, FluidStack aFluidIn, FluidStack rFluidOut) {
- return addFluidCannerRecipe(aEmpty, aFullContainer, aFluidIn, rFluidOut, null, null);
- }
- /**
- * Called Reflectively from CORE.RA.addFluidCannerRecipe
- * @return
- */
- public static boolean addFluidCannerRecipe(ItemStack aEmpty, ItemStack aFullContainer, FluidStack aFluidIn, FluidStack rFluidOut, Integer aTime, Integer aEu) {
- /*GT_Recipe r = new Recipe_GT(
- true,
- new ItemStack[] {aEmpty},
- new ItemStack[] {aFullContainer},
- null,
- new int[] {},
- new FluidStack[] {rFluidIn},
- new FluidStack[] {rFluidOut},
- 0, 0, 0);*/
- //new RecipeGen_FluidCanning(r, false);
- RecipeGen_FluidCanning g = new RecipeGen_FluidCanning(false, aEmpty, aFullContainer, aFluidIn, null, null, 0);
- if (g != null && g.valid()) {
- return true;
- }
- return false;
- }
-
- public static void generate(final Material matInfo){
- generate(matInfo, true);
- }
-
-
- public static void generate(final Material matInfo, final boolean generateEverything){
- generate(matInfo, generateEverything, true);
- }
-
- public static boolean generate(final Material matInfo, final boolean generateEverything, final boolean generateBlastSmelterRecipes){
- try {
- final String unlocalizedName = matInfo.getUnlocalizedName();
- final String materialName = matInfo.getLocalizedName();
- final short[] C = matInfo.getRGBA();
- final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
- final boolean hotIngot = matInfo.requiresBlastFurnace();
- int materialTier = matInfo.vTier; //TODO
-
- if ((materialTier > 10) || (materialTier <= 0)){
- materialTier = 2;
- }
-
- int sRadiation = 0;
- if (ItemUtils.isRadioactive(materialName) || (matInfo.vRadiationLevel != 0)){
- sRadiation = matInfo.vRadiationLevel;
- }
-
- if (matInfo.getState() == MaterialState.SOLID){
- if (generateEverything == true){
- if (sRadiation >= 1){
- tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
- temp = new BaseItemIngot(matInfo);
-
- temp = new BaseItemDust(matInfo);
- temp = new BaseItemNugget(matInfo);
- temp = new BaseItemPlate(matInfo);
- temp = new BaseItemRod(matInfo);
- temp = new BaseItemRodLong(matInfo);
- }
-
- else {
- tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
- tempBlock = new BlockBaseModular(matInfo,BlockTypes.FRAME);
- temp = new BaseItemIngot(matInfo);
- if (hotIngot){
- temp = new BaseItemIngotHot(matInfo);
- }
- temp = new BaseItemDust(matInfo);
- temp = new BaseItemNugget(matInfo);
- temp = new BaseItemPlate(matInfo);
- temp = new BaseItemPlateDouble(matInfo);
- temp = new BaseItemBolt(matInfo);
- temp = new BaseItemRod(matInfo);
- temp = new BaseItemRodLong(matInfo);
- temp = new BaseItemRing(matInfo);
- temp = new BaseItemScrew(matInfo);
- temp = new BaseItemRotor(matInfo);
- temp = new BaseItemGear(matInfo);
- }
- } else {
- tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
-
- temp = new BaseItemIngot(matInfo);
- temp = new BaseItemDust(matInfo);
- temp = new BaseItemNugget(matInfo);
- temp = new BaseItemPlate(matInfo);
- temp = new BaseItemPlateDouble(matInfo);
- }
- }
- else if (matInfo.getState() == MaterialState.LIQUID){
- if (generateEverything == true){
- tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
- }
- temp = new BaseItemIngot(matInfo);
- temp = new BaseItemDust(matInfo);
- temp = new BaseItemNugget(matInfo);
- temp = new BaseItemPlate(matInfo);
- temp = new BaseItemPlateDouble(matInfo);
- }
- else if (matInfo.getState() == MaterialState.GAS){
- temp = new BaseItemDust(matInfo);
- FluidUtils.generateGas(unlocalizedName, materialName, matInfo.getMeltingPointK(), C, true);
- }
- else if (matInfo.getState() == MaterialState.PURE_GAS){
- FluidUtils.generateGas(unlocalizedName, materialName, matInfo.getMeltingPointK(), C, true);
- return true;
- }
- else if (matInfo.getState() == MaterialState.PURE_LIQUID){
- FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C);
- return true;
- }
- else if (matInfo.getState() == MaterialState.ORE){
-
- }
-
- //Add A jillion Recipes - old code
- new RecipeGen_AlloySmelter(matInfo);
- new RecipeGen_Assembler(matInfo);
- if (generateBlastSmelterRecipes){
- new RecipeGen_BlastSmelter(matInfo);
- }
- new RecipeGen_MetalRecipe(matInfo);
- new RecipeGen_Extruder(matInfo);
- new RecipeGen_Fluids(matInfo);
- new RecipeGen_Plates(matInfo);
- new RecipeGen_ShapedCrafting(matInfo);
- new RecipeGen_MaterialProcessing(matInfo);
-
- new RecipeGen_DustGeneration(matInfo);
- new RecipeGen_Recycling(matInfo);
- new RecipeGen_Plasma(matInfo);
-
- return true;
-
- } catch (final Throwable t)
-
- {
- Logger.MATERIALS(""+matInfo.getLocalizedName()+" failed to generate.");
- return false;
- }
- }
-
- public static void generateDusts(final Material matInfo){
- final String unlocalizedName = matInfo.getUnlocalizedName();
- final String materialName = matInfo.getLocalizedName();
- final short[] C = matInfo.getRGBA();
- final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
- int materialTier = matInfo.vTier; //TODO
-
- if ((materialTier > 10) || (materialTier <= 0)){
- materialTier = 2;
- }
-
- int sRadiation = 0;
- if (ItemUtils.isRadioactive(materialName) || (matInfo.vRadiationLevel != 0)){
- sRadiation = matInfo.vRadiationLevel;
- }
-
- if (matInfo.getState() == MaterialState.SOLID){
- temp = new BaseItemDust(matInfo);
- }
-
- //Add A jillion Recipes - old code
- try {
- RecipeGen_DustGeneration.addMixerRecipe_Standalone(matInfo);
- new RecipeGen_Fluids(matInfo);
- new RecipeGen_MaterialProcessing(matInfo);
- }
- catch (Throwable t) {
- Logger.MATERIALS("Failed to generate some recipes for "+materialName);
- Logger.ERROR("Failed to generate some recipes for "+materialName);
- t.printStackTrace();
- }
- //RecipeGen_Recycling.generateRecipes(matInfo);
- }
-
- public static void generateNuclearMaterial(final Material matInfo){
- generateNuclearMaterial(matInfo, true);
- }
-
-
- public static void generateNuclearDusts(final Material matInfo){
- generateNuclearDusts(matInfo, true);
- }
-
- public static void generateNuclearDusts(final Material matInfo, boolean generateDehydratorRecipe){
- generateNuclearMaterial(matInfo, false, true, false, false, true);
- if (generateDehydratorRecipe && matInfo.getFluid() != null && matInfo.getDust(0) != null) {
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(20)
- },
- matInfo.getFluidStack(144),
- null,
- new ItemStack[] {
- matInfo.getDust(1),
- },
- new int[] { 10000 },
- 10*(matInfo.vVoltageMultiplier/5), // Time in ticks
- matInfo.vVoltageMultiplier); // EU
- }
- else {
- Logger.INFO("Nuclear Dehydrator: Did not generate recipe for "+matInfo.getLocalizedName()+" | Null Fluid? "+(matInfo.getFluid() == null)+" | Null Dust? "+(matInfo.getDust(0) == null));
- }
- }
-
- public static void generateNuclearMaterial(final Material matInfo, final boolean generatePlates){
- generateNuclearMaterial(matInfo, true, true, true, generatePlates, true);
- }
-
- public static void generateNuclearMaterial(final Material matInfo, final boolean generateBlock,
- final boolean generateDusts, final boolean generateIngot, final boolean generatePlates, final boolean disableOptionalRecipes){
- try {
-
- if (generateBlock) {
- tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
- }
- if (generateDusts) {
- temp = new BaseItemDust(matInfo);
- }
- if (generateIngot) {
- temp = new BaseItemIngot(matInfo);
- temp = new BaseItemNugget(matInfo);
- }
-
- if (generatePlates) {
- temp = new BaseItemPlate(matInfo);
- temp = new BaseItemPlateDouble(matInfo);
- new RecipeGen_Plates(matInfo);
- new RecipeGen_Extruder(matInfo);
- new RecipeGen_Assembler(matInfo);
- }
-
- if (!disableOptionalRecipes) {
- new RecipeGen_ShapedCrafting(matInfo);
- new RecipeGen_Fluids(matInfo);
- new RecipeGen_MaterialProcessing(matInfo);
- new RecipeGen_Recycling(matInfo);
- }
-
- new RecipeGen_MetalRecipe(matInfo);
- new RecipeGen_DustGeneration(matInfo, disableOptionalRecipes);
- new RecipeGen_Plasma(matInfo);
-
- } catch (final Throwable t){
- Logger.MATERIALS(""+matInfo.getLocalizedName()+" failed to generate.");
- }
- }
-
-
- public static void generateOreMaterial(final Material matInfo){
- generateOreMaterial(matInfo, true, true, true, matInfo.getRGBA());
- }
-
- @SuppressWarnings("unused")
- public static void generateOreMaterial(final Material matInfo, boolean generateOre, boolean generateDust, boolean generateSmallTinyDusts, short[] customRGB){
- try {
-
- if (matInfo == null){
- Logger.DEBUG_MATERIALS("Invalid Material while constructing null material.");
- return;
- }
-
- final String unlocalizedName = matInfo.getUnlocalizedName();
- final String materialName = matInfo.getLocalizedName();
- final short[] C = customRGB;
- final Integer Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
-
-
- if (Colour == null){
- Logger.DEBUG_MATERIALS("Invalid Material while constructing "+materialName+".");
- return;
- }
-
- int sRadiation = 0;
- if (matInfo.vRadiationLevel > 0){
- sRadiation = matInfo.vRadiationLevel;
- }
-
- if (generateOre) {
- tempBlock = new BlockBaseOre(matInfo, BlockTypes.ORE, Colour.intValue());
- }
-
- DustState aState = new DustState(generateDust, generateSmallTinyDusts, generateSmallTinyDusts);
-
- if (!aState.generatesDust()) {
- if (aState.generatesSmallDust()) {
- temp = new BaseItemComponent(matInfo, ComponentTypes.DUSTSMALL);
- }
- if (aState.generatesTinyDust()) {
- temp = new BaseItemComponent(matInfo, ComponentTypes.DUSTTINY);
- }
- }
- else {
- temp = new BaseItemDust(aState, matInfo);
- }
-
- temp = new BaseItemCrushedOre(matInfo);
- temp = new BaseItemCentrifugedCrushedOre(matInfo);
- temp = new BaseItemPurifiedCrushedOre(matInfo);
- temp = new BaseItemImpureDust(matInfo);
- temp = new BaseItemPurifiedDust(matInfo);
-
- Logger.MATERIALS("Generated all ore components for "+matInfo.getLocalizedName()+", now generating processing recipes.");
-
- if (matInfo == FLUORIDES.FLUORITE){
- new RecipeGen_Fluorite(matInfo);
- }
- else {
- new RecipeGen_Ore(matInfo);
- }
-
- } catch (final Throwable t){
- Logger.MATERIALS("[Error] "+(matInfo != null ? matInfo.getLocalizedName() : "Null Material")+" failed to generate.");
- t.printStackTrace();
- }
- }
-
- public static boolean generateOreMaterialWithAllExcessComponents(final Material matInfo){
- try {
- if (matInfo == null){
- Logger.DEBUG_MATERIALS("Invalid Material while constructing null material.");
- return false;
- }
- final short[] C = matInfo.getRGBA();
- final Integer Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
-
- tempBlock = new BlockBaseOre(matInfo, BlockTypes.ORE, Colour.intValue());
- tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
- temp = new BaseItemIngot(matInfo);
- temp = new BaseItemDust(matInfo);
- temp = new BaseItemNugget(matInfo);
- temp = new BaseItemPlate(matInfo);
- temp = new BaseItemPlateDouble(matInfo);
-
-
- temp = new BaseItemCrushedOre(matInfo);
- temp = new BaseItemCentrifugedCrushedOre(matInfo);
- temp = new BaseItemPurifiedCrushedOre(matInfo);
- temp = new BaseItemImpureDust(matInfo);
- temp = new BaseItemPurifiedDust(matInfo);
-
- Logger.MATERIALS("Generated all ore & base components for "+matInfo.getLocalizedName()+", now generating processing recipes.");
-
- new RecipeGen_Ore(matInfo, true);
- new RecipeGen_AlloySmelter(matInfo);
- new RecipeGen_Assembler(matInfo);
- new RecipeGen_BlastSmelter(matInfo);
- new RecipeGen_MetalRecipe(matInfo);
- new RecipeGen_Extruder(matInfo);
- new RecipeGen_Fluids(matInfo);
- new RecipeGen_Plates(matInfo);
- new RecipeGen_ShapedCrafting(matInfo);
- new RecipeGen_MaterialProcessing(matInfo);
- new RecipeGen_DustGeneration(matInfo);
- new RecipeGen_Recycling(matInfo);
- return true;
- }
- catch (final Throwable t){
- Logger.MATERIALS(""+matInfo.getLocalizedName()+" failed to generate.");
- t.printStackTrace();
- return false;
- }
-
- }
-
-
+ public static final AutoMap<Set<RunnableWithInfo<Material>>> mRecipeMapsToGenerate =
+ new AutoMap<Set<RunnableWithInfo<Material>>>();
+
+ @SuppressWarnings("unused")
+ private static volatile Item temp;
+
+ @SuppressWarnings("unused")
+ private static volatile Block tempBlock;
+
+ public static boolean addFluidCannerRecipe(
+ ItemStack aEmpty, ItemStack aFullContainer, FluidStack aFluidIn, FluidStack rFluidOut) {
+ return addFluidCannerRecipe(aEmpty, aFullContainer, aFluidIn, rFluidOut, null, null);
+ }
+ /**
+ * Called Reflectively from CORE.RA.addFluidCannerRecipe
+ * @return
+ */
+ public static boolean addFluidCannerRecipe(
+ ItemStack aEmpty,
+ ItemStack aFullContainer,
+ FluidStack aFluidIn,
+ FluidStack rFluidOut,
+ Integer aTime,
+ Integer aEu) {
+ /*GT_Recipe r = new Recipe_GT(
+ true,
+ new ItemStack[] {aEmpty},
+ new ItemStack[] {aFullContainer},
+ null,
+ new int[] {},
+ new FluidStack[] {rFluidIn},
+ new FluidStack[] {rFluidOut},
+ 0, 0, 0);*/
+ // new RecipeGen_FluidCanning(r, false);
+ RecipeGen_FluidCanning g = new RecipeGen_FluidCanning(false, aEmpty, aFullContainer, aFluidIn, null, null, 0);
+ if (g != null && g.valid()) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void generate(final Material matInfo) {
+ generate(matInfo, true);
+ }
+
+ public static void generate(final Material matInfo, final boolean generateEverything) {
+ generate(matInfo, generateEverything, true);
+ }
+
+ public static boolean generate(
+ final Material matInfo, final boolean generateEverything, final boolean generateBlastSmelterRecipes) {
+ try {
+ final String unlocalizedName = matInfo.getUnlocalizedName();
+ final String materialName = matInfo.getLocalizedName();
+ final short[] C = matInfo.getRGBA();
+ final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
+ final boolean hotIngot = matInfo.requiresBlastFurnace();
+ int materialTier = matInfo.vTier; // TODO
+
+ if ((materialTier > 10) || (materialTier <= 0)) {
+ materialTier = 2;
+ }
+
+ int sRadiation = 0;
+ if (ItemUtils.isRadioactive(materialName) || (matInfo.vRadiationLevel != 0)) {
+ sRadiation = matInfo.vRadiationLevel;
+ }
+
+ if (matInfo.getState() == MaterialState.SOLID) {
+ if (generateEverything == true) {
+ if (sRadiation >= 1) {
+ tempBlock = new BlockBaseModular(matInfo, BlockTypes.STANDARD);
+ temp = new BaseItemIngot(matInfo);
+
+ temp = new BaseItemDust(matInfo);
+ temp = new BaseItemNugget(matInfo);
+ temp = new BaseItemPlate(matInfo);
+ temp = new BaseItemRod(matInfo);
+ temp = new BaseItemRodLong(matInfo);
+ } else {
+ tempBlock = new BlockBaseModular(matInfo, BlockTypes.STANDARD);
+ tempBlock = new BlockBaseModular(matInfo, BlockTypes.FRAME);
+ temp = new BaseItemIngot(matInfo);
+ if (hotIngot) {
+ temp = new BaseItemIngotHot(matInfo);
+ }
+ temp = new BaseItemDust(matInfo);
+ temp = new BaseItemNugget(matInfo);
+ temp = new BaseItemPlate(matInfo);
+ temp = new BaseItemPlateDouble(matInfo);
+ temp = new BaseItemBolt(matInfo);
+ temp = new BaseItemRod(matInfo);
+ temp = new BaseItemRodLong(matInfo);
+ temp = new BaseItemRing(matInfo);
+ temp = new BaseItemScrew(matInfo);
+ temp = new BaseItemRotor(matInfo);
+ temp = new BaseItemGear(matInfo);
+ }
+ } else {
+ tempBlock = new BlockBaseModular(matInfo, BlockTypes.STANDARD);
+
+ temp = new BaseItemIngot(matInfo);
+ temp = new BaseItemDust(matInfo);
+ temp = new BaseItemNugget(matInfo);
+ temp = new BaseItemPlate(matInfo);
+ temp = new BaseItemPlateDouble(matInfo);
+ }
+ } else if (matInfo.getState() == MaterialState.LIQUID) {
+ if (generateEverything == true) {
+ tempBlock = new BlockBaseModular(matInfo, BlockTypes.STANDARD);
+ }
+ temp = new BaseItemIngot(matInfo);
+ temp = new BaseItemDust(matInfo);
+ temp = new BaseItemNugget(matInfo);
+ temp = new BaseItemPlate(matInfo);
+ temp = new BaseItemPlateDouble(matInfo);
+ } else if (matInfo.getState() == MaterialState.GAS) {
+ temp = new BaseItemDust(matInfo);
+ FluidUtils.generateGas(unlocalizedName, materialName, matInfo.getMeltingPointK(), C, true);
+ } else if (matInfo.getState() == MaterialState.PURE_GAS) {
+ FluidUtils.generateGas(unlocalizedName, materialName, matInfo.getMeltingPointK(), C, true);
+ return true;
+ } else if (matInfo.getState() == MaterialState.PURE_LIQUID) {
+ FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C);
+ return true;
+ } else if (matInfo.getState() == MaterialState.ORE) {
+
+ }
+
+ // Add A jillion Recipes - old code
+ new RecipeGen_AlloySmelter(matInfo);
+ new RecipeGen_Assembler(matInfo);
+ if (generateBlastSmelterRecipes) {
+ new RecipeGen_BlastSmelter(matInfo);
+ }
+ new RecipeGen_MetalRecipe(matInfo);
+ new RecipeGen_Extruder(matInfo);
+ new RecipeGen_Fluids(matInfo);
+ new RecipeGen_Plates(matInfo);
+ new RecipeGen_ShapedCrafting(matInfo);
+ new RecipeGen_MaterialProcessing(matInfo);
+
+ new RecipeGen_DustGeneration(matInfo);
+ new RecipeGen_Recycling(matInfo);
+ new RecipeGen_Plasma(matInfo);
+
+ return true;
+
+ } catch (final Throwable t) {
+
+ Logger.MATERIALS("" + matInfo.getLocalizedName() + " failed to generate.");
+ return false;
+ }
+ }
+
+ public static void generateDusts(final Material matInfo) {
+ final String unlocalizedName = matInfo.getUnlocalizedName();
+ final String materialName = matInfo.getLocalizedName();
+ final short[] C = matInfo.getRGBA();
+ final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
+ int materialTier = matInfo.vTier; // TODO
+
+ if ((materialTier > 10) || (materialTier <= 0)) {
+ materialTier = 2;
+ }
+
+ int sRadiation = 0;
+ if (ItemUtils.isRadioactive(materialName) || (matInfo.vRadiationLevel != 0)) {
+ sRadiation = matInfo.vRadiationLevel;
+ }
+
+ if (matInfo.getState() == MaterialState.SOLID) {
+ temp = new BaseItemDust(matInfo);
+ }
+
+ // Add A jillion Recipes - old code
+ try {
+ RecipeGen_DustGeneration.addMixerRecipe_Standalone(matInfo);
+ new RecipeGen_Fluids(matInfo);
+ new RecipeGen_MaterialProcessing(matInfo);
+ } catch (Throwable t) {
+ Logger.MATERIALS("Failed to generate some recipes for " + materialName);
+ Logger.ERROR("Failed to generate some recipes for " + materialName);
+ t.printStackTrace();
+ }
+ // RecipeGen_Recycling.generateRecipes(matInfo);
+ }
+
+ public static void generateNuclearMaterial(final Material matInfo) {
+ generateNuclearMaterial(matInfo, true);
+ }
+
+ public static void generateNuclearDusts(final Material matInfo) {
+ generateNuclearDusts(matInfo, true);
+ }
+
+ public static void generateNuclearDusts(final Material matInfo, boolean generateDehydratorRecipe) {
+ generateNuclearMaterial(matInfo, false, true, false, false, true);
+ if (generateDehydratorRecipe && matInfo.getFluid() != null && matInfo.getDust(0) != null) {
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(20)},
+ matInfo.getFluidStack(144),
+ null,
+ new ItemStack[] {
+ matInfo.getDust(1),
+ },
+ new int[] {10000},
+ 10 * (matInfo.vVoltageMultiplier / 5), // Time in ticks
+ matInfo.vVoltageMultiplier); // EU
+ } else {
+ Logger.INFO(
+ "Nuclear Dehydrator: Did not generate recipe for " + matInfo.getLocalizedName() + " | Null Fluid? "
+ + (matInfo.getFluid() == null) + " | Null Dust? " + (matInfo.getDust(0) == null));
+ }
+ }
+
+ public static void generateNuclearMaterial(final Material matInfo, final boolean generatePlates) {
+ generateNuclearMaterial(matInfo, true, true, true, generatePlates, true);
+ }
+
+ public static void generateNuclearMaterial(
+ final Material matInfo,
+ final boolean generateBlock,
+ final boolean generateDusts,
+ final boolean generateIngot,
+ final boolean generatePlates,
+ final boolean disableOptionalRecipes) {
+ try {
+
+ if (generateBlock) {
+ tempBlock = new BlockBaseModular(matInfo, BlockTypes.STANDARD);
+ }
+ if (generateDusts) {
+ temp = new BaseItemDust(matInfo);
+ }
+ if (generateIngot) {
+ temp = new BaseItemIngot(matInfo);
+ temp = new BaseItemNugget(matInfo);
+ }
+
+ if (generatePlates) {
+ temp = new BaseItemPlate(matInfo);
+ temp = new BaseItemPlateDouble(matInfo);
+ new RecipeGen_Plates(matInfo);
+ new RecipeGen_Extruder(matInfo);
+ new RecipeGen_Assembler(matInfo);
+ }
+
+ if (!disableOptionalRecipes) {
+ new RecipeGen_ShapedCrafting(matInfo);
+ new RecipeGen_Fluids(matInfo);
+ new RecipeGen_MaterialProcessing(matInfo);
+ new RecipeGen_Recycling(matInfo);
+ }
+
+ new RecipeGen_MetalRecipe(matInfo);
+ new RecipeGen_DustGeneration(matInfo, disableOptionalRecipes);
+ new RecipeGen_Plasma(matInfo);
+
+ } catch (final Throwable t) {
+ Logger.MATERIALS("" + matInfo.getLocalizedName() + " failed to generate.");
+ }
+ }
+
+ public static void generateOreMaterial(final Material matInfo) {
+ generateOreMaterial(matInfo, true, true, true, matInfo.getRGBA());
+ }
+
+ @SuppressWarnings("unused")
+ public static void generateOreMaterial(
+ final Material matInfo,
+ boolean generateOre,
+ boolean generateDust,
+ boolean generateSmallTinyDusts,
+ short[] customRGB) {
+ try {
+
+ if (matInfo == null) {
+ Logger.DEBUG_MATERIALS("Invalid Material while constructing null material.");
+ return;
+ }
+
+ final String unlocalizedName = matInfo.getUnlocalizedName();
+ final String materialName = matInfo.getLocalizedName();
+ final short[] C = customRGB;
+ final Integer Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
+
+ if (Colour == null) {
+ Logger.DEBUG_MATERIALS("Invalid Material while constructing " + materialName + ".");
+ return;
+ }
+
+ int sRadiation = 0;
+ if (matInfo.vRadiationLevel > 0) {
+ sRadiation = matInfo.vRadiationLevel;
+ }
+
+ if (generateOre) {
+ tempBlock = new BlockBaseOre(matInfo, BlockTypes.ORE, Colour.intValue());
+ }
+
+ DustState aState = new DustState(generateDust, generateSmallTinyDusts, generateSmallTinyDusts);
+
+ if (!aState.generatesDust()) {
+ if (aState.generatesSmallDust()) {
+ temp = new BaseItemComponent(matInfo, ComponentTypes.DUSTSMALL);
+ }
+ if (aState.generatesTinyDust()) {
+ temp = new BaseItemComponent(matInfo, ComponentTypes.DUSTTINY);
+ }
+ } else {
+ temp = new BaseItemDust(aState, matInfo);
+ }
+
+ temp = new BaseItemCrushedOre(matInfo);
+ temp = new BaseItemCentrifugedCrushedOre(matInfo);
+ temp = new BaseItemPurifiedCrushedOre(matInfo);
+ temp = new BaseItemImpureDust(matInfo);
+ temp = new BaseItemPurifiedDust(matInfo);
+
+ Logger.MATERIALS("Generated all ore components for " + matInfo.getLocalizedName()
+ + ", now generating processing recipes.");
+
+ if (matInfo == FLUORIDES.FLUORITE) {
+ new RecipeGen_Fluorite(matInfo);
+ } else {
+ new RecipeGen_Ore(matInfo);
+ }
+
+ } catch (final Throwable t) {
+ Logger.MATERIALS("[Error] " + (matInfo != null ? matInfo.getLocalizedName() : "Null Material")
+ + " failed to generate.");
+ t.printStackTrace();
+ }
+ }
+
+ public static boolean generateOreMaterialWithAllExcessComponents(final Material matInfo) {
+ try {
+ if (matInfo == null) {
+ Logger.DEBUG_MATERIALS("Invalid Material while constructing null material.");
+ return false;
+ }
+ final short[] C = matInfo.getRGBA();
+ final Integer Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
+
+ tempBlock = new BlockBaseOre(matInfo, BlockTypes.ORE, Colour.intValue());
+ tempBlock = new BlockBaseModular(matInfo, BlockTypes.STANDARD);
+ temp = new BaseItemIngot(matInfo);
+ temp = new BaseItemDust(matInfo);
+ temp = new BaseItemNugget(matInfo);
+ temp = new BaseItemPlate(matInfo);
+ temp = new BaseItemPlateDouble(matInfo);
+
+ temp = new BaseItemCrushedOre(matInfo);
+ temp = new BaseItemCentrifugedCrushedOre(matInfo);
+ temp = new BaseItemPurifiedCrushedOre(matInfo);
+ temp = new BaseItemImpureDust(matInfo);
+ temp = new BaseItemPurifiedDust(matInfo);
+
+ Logger.MATERIALS("Generated all ore & base components for " + matInfo.getLocalizedName()
+ + ", now generating processing recipes.");
+
+ new RecipeGen_Ore(matInfo, true);
+ new RecipeGen_AlloySmelter(matInfo);
+ new RecipeGen_Assembler(matInfo);
+ new RecipeGen_BlastSmelter(matInfo);
+ new RecipeGen_MetalRecipe(matInfo);
+ new RecipeGen_Extruder(matInfo);
+ new RecipeGen_Fluids(matInfo);
+ new RecipeGen_Plates(matInfo);
+ new RecipeGen_ShapedCrafting(matInfo);
+ new RecipeGen_MaterialProcessing(matInfo);
+ new RecipeGen_DustGeneration(matInfo);
+ new RecipeGen_Recycling(matInfo);
+ return true;
+ } catch (final Throwable t) {
+ Logger.MATERIALS("" + matInfo.getLocalizedName() + " failed to generate.");
+ t.printStackTrace();
+ return false;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/material/MaterialStack.java b/src/main/java/gtPlusPlus/core/material/MaterialStack.java
index 145b217d6e..0e05b9b3b3 100644
--- a/src/main/java/gtPlusPlus/core/material/MaterialStack.java
+++ b/src/main/java/gtPlusPlus/core/material/MaterialStack.java
@@ -1,121 +1,113 @@
package gtPlusPlus.core.material;
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-
import gregtech.api.enums.OrePrefixes;
-import gtPlusPlus.xmod.bartworks.BW_Utils;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.xmod.bartworks.BW_Utils;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import net.minecraft.item.ItemStack;
public class MaterialStack {
- private final transient int[] vAmount;
- private final Material stackMaterial;
- private final double vPercentageToUse;
-
- public MaterialStack(final Material inputs, final double partOutOf100){
- this.stackMaterial = inputs;
- //Logger.INFO("Tried getting MaterialStack for "+inputs.getLocalizedName());
- this.vPercentageToUse = partOutOf100;
- this.vAmount = this.math(partOutOf100);
- }
-
- private int[] math(final double val){
- double i;
- //Cast to a BigDecimal to round it.
- final BigDecimal bd = new BigDecimal(val).setScale(2, RoundingMode.HALF_EVEN);
- i = bd.doubleValue();
- //Split the string into xx.xx
- final String[] arr=String.valueOf(i).split("\\.");
- final int[] intArr=new int[2];
- intArr[0]=Integer.parseInt(arr[0]);
- intArr[1]=Integer.parseInt(arr[1]);
- return intArr;
- }
-
- public ItemStack getValidStack(){
- if (this.stackMaterial.getDust(1) == null){
- //if (this.stackMaterial.getCell(1) == null){
- return null;
- //}
- //return this.stackMaterial.getCell(this.vAmount[0]);
- }
- return this.stackMaterial.getDust(this.vAmount[0]);
- }
-
- public ItemStack getDustStack(){
- return this.stackMaterial.getDust(this.vAmount[0]);
- }
-
- public ItemStack getDustStack(final int amount){
- return this.stackMaterial.getDust(amount);
- }
-
- public ItemStack getUnificatedDustStack(final int amount) {
- if (this.stackMaterial.werkstoffID != 0) {
- ItemStack stack = BW_Utils.getCorrespondingItemStack(OrePrefixes.dust, this.stackMaterial.werkstoffID, amount);
- if (stack != null) {
- return stack;
- }
- }
- return getDustStack(amount);
- }
-
- public Material getStackMaterial(){
- if (this.stackMaterial == null){
- Logger.MATERIALS("Tried getStackMaterial, got an invalid material.");
- Logger.MATERIALS(ReflectionUtils.getMethodName(0));
- Logger.MATERIALS(ReflectionUtils.getMethodName(1));
- Logger.MATERIALS(ReflectionUtils.getMethodName(2));
- Logger.MATERIALS(ReflectionUtils.getMethodName(3));
- return null;
- }
- return this.stackMaterial;
- }
-
- public double getvPercentageToUse(){
- return this.vPercentageToUse;
- }
-
- public long[] getSmallestStackSizes(){
- return this.stackMaterial.getSmallestRatio(this.stackMaterial.getComposites());
- }
-
- public int getPartsPerOneHundred(){
- if (this.vAmount != null){
- if ((this.vAmount[0] >= 1) && (this.vAmount[0] <= 100)){
- return this.vAmount[0];
- }
- }
- return 100;
- }
- public ItemStack getLeftOverStacksFromDecimalValue(){
- final int temp = this.vAmount[1];
- int getCount;
- if ((temp >= 25) && (temp <=99)){
- getCount = temp/25;
- return this.stackMaterial.getSmallDust(getCount);
- }
- else if ((temp >= 11) && (temp <= 24)){
- getCount = temp/11;
- return this.stackMaterial.getTinyDust(getCount);
- }
- else {
- return null;
- }
- }
-
- public ItemStack[] getValidItemStacks(){
- return ItemUtils.validItemsForOreDict(this.stackMaterial.getUnlocalizedName());
- }
-
-
-
-
-
-
+ private final transient int[] vAmount;
+ private final Material stackMaterial;
+ private final double vPercentageToUse;
+
+ public MaterialStack(final Material inputs, final double partOutOf100) {
+ this.stackMaterial = inputs;
+ // Logger.INFO("Tried getting MaterialStack for "+inputs.getLocalizedName());
+ this.vPercentageToUse = partOutOf100;
+ this.vAmount = this.math(partOutOf100);
+ }
+
+ private int[] math(final double val) {
+ double i;
+ // Cast to a BigDecimal to round it.
+ final BigDecimal bd = new BigDecimal(val).setScale(2, RoundingMode.HALF_EVEN);
+ i = bd.doubleValue();
+ // Split the string into xx.xx
+ final String[] arr = String.valueOf(i).split("\\.");
+ final int[] intArr = new int[2];
+ intArr[0] = Integer.parseInt(arr[0]);
+ intArr[1] = Integer.parseInt(arr[1]);
+ return intArr;
+ }
+
+ public ItemStack getValidStack() {
+ if (this.stackMaterial.getDust(1) == null) {
+ // if (this.stackMaterial.getCell(1) == null){
+ return null;
+ // }
+ // return this.stackMaterial.getCell(this.vAmount[0]);
+ }
+ return this.stackMaterial.getDust(this.vAmount[0]);
+ }
+
+ public ItemStack getDustStack() {
+ return this.stackMaterial.getDust(this.vAmount[0]);
+ }
+
+ public ItemStack getDustStack(final int amount) {
+ return this.stackMaterial.getDust(amount);
+ }
+
+ public ItemStack getUnificatedDustStack(final int amount) {
+ if (this.stackMaterial.werkstoffID != 0) {
+ ItemStack stack =
+ BW_Utils.getCorrespondingItemStack(OrePrefixes.dust, this.stackMaterial.werkstoffID, amount);
+ if (stack != null) {
+ return stack;
+ }
+ }
+ return getDustStack(amount);
+ }
+
+ public Material getStackMaterial() {
+ if (this.stackMaterial == null) {
+ Logger.MATERIALS("Tried getStackMaterial, got an invalid material.");
+ Logger.MATERIALS(ReflectionUtils.getMethodName(0));
+ Logger.MATERIALS(ReflectionUtils.getMethodName(1));
+ Logger.MATERIALS(ReflectionUtils.getMethodName(2));
+ Logger.MATERIALS(ReflectionUtils.getMethodName(3));
+ return null;
+ }
+ return this.stackMaterial;
+ }
+
+ public double getvPercentageToUse() {
+ return this.vPercentageToUse;
+ }
+
+ public long[] getSmallestStackSizes() {
+ return this.stackMaterial.getSmallestRatio(this.stackMaterial.getComposites());
+ }
+
+ public int getPartsPerOneHundred() {
+ if (this.vAmount != null) {
+ if ((this.vAmount[0] >= 1) && (this.vAmount[0] <= 100)) {
+ return this.vAmount[0];
+ }
+ }
+ return 100;
+ }
+
+ public ItemStack getLeftOverStacksFromDecimalValue() {
+ final int temp = this.vAmount[1];
+ int getCount;
+ if ((temp >= 25) && (temp <= 99)) {
+ getCount = temp / 25;
+ return this.stackMaterial.getSmallDust(getCount);
+ } else if ((temp >= 11) && (temp <= 24)) {
+ getCount = temp / 11;
+ return this.stackMaterial.getTinyDust(getCount);
+ } else {
+ return null;
+ }
+ }
+
+ public ItemStack[] getValidItemStacks() {
+ return ItemUtils.validItemsForOreDict(this.stackMaterial.getUnlocalizedName());
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/material/NONMATERIAL.java b/src/main/java/gtPlusPlus/core/material/NONMATERIAL.java
index 7ab72d50bc..180bb15888 100644
--- a/src/main/java/gtPlusPlus/core/material/NONMATERIAL.java
+++ b/src/main/java/gtPlusPlus/core/material/NONMATERIAL.java
@@ -5,40 +5,38 @@ import gregtech.api.enums.TextureSet;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
public class NONMATERIAL {
-
- //Soul Sand
- public static final Material SOULSAND = MaterialUtils.generateMaterialFromGtENUM(Materials.SoulSand);
-
- //Redstone
- public static final Material REDSTONE = MaterialUtils.generateMaterialFromGtENUM(Materials.Redstone);
-
- //Glowstone Dust
- public static final Material GLOWSTONE = MaterialUtils.generateMaterialFromGtENUM(Materials.Glowstone);
-
- //Enderpearl
- public static final Material ENDERPEARL = MaterialUtils.generateMaterialFromGtENUM(Materials.EnderPearl);
-
- //Raw Flesh
- public static final Material MEAT = MaterialUtils.generateMaterialFromGtENUM(Materials.MeatRaw);
-
- //Clay
- public static final Material CLAY = MaterialUtils.generateMaterialFromGtENUM(Materials.Clay);
-
- //Wrought Iron
- public static final Material WROUGHT_IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.WroughtIron);
-
- //PTFE
- public static final Material PTFE = MaterialUtils.generateMaterialFromGtENUM(MaterialUtils.getMaterial("Polytetrafluoroethylene", "Plastic"));
-
- //Plastic
- public static final Material PLASTIC = MaterialUtils.generateMaterialFromGtENUM(MaterialUtils.getMaterial("Plastic", "Rubber"));
-
-
- static {
- MEAT.setTextureSet(TextureSet.SET_ROUGH);
- CLAY.setTextureSet(TextureSet.SET_ROUGH);
- }
-
-
-
+
+ // Soul Sand
+ public static final Material SOULSAND = MaterialUtils.generateMaterialFromGtENUM(Materials.SoulSand);
+
+ // Redstone
+ public static final Material REDSTONE = MaterialUtils.generateMaterialFromGtENUM(Materials.Redstone);
+
+ // Glowstone Dust
+ public static final Material GLOWSTONE = MaterialUtils.generateMaterialFromGtENUM(Materials.Glowstone);
+
+ // Enderpearl
+ public static final Material ENDERPEARL = MaterialUtils.generateMaterialFromGtENUM(Materials.EnderPearl);
+
+ // Raw Flesh
+ public static final Material MEAT = MaterialUtils.generateMaterialFromGtENUM(Materials.MeatRaw);
+
+ // Clay
+ public static final Material CLAY = MaterialUtils.generateMaterialFromGtENUM(Materials.Clay);
+
+ // Wrought Iron
+ public static final Material WROUGHT_IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.WroughtIron);
+
+ // PTFE
+ public static final Material PTFE =
+ MaterialUtils.generateMaterialFromGtENUM(MaterialUtils.getMaterial("Polytetrafluoroethylene", "Plastic"));
+
+ // Plastic
+ public static final Material PLASTIC =
+ MaterialUtils.generateMaterialFromGtENUM(MaterialUtils.getMaterial("Plastic", "Rubber"));
+
+ static {
+ MEAT.setTextureSet(TextureSet.SET_ROUGH);
+ CLAY.setTextureSet(TextureSet.SET_ROUGH);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/material/ORES.java b/src/main/java/gtPlusPlus/core/material/ORES.java
index 82757b2ee6..a5776a6d5a 100644
--- a/src/main/java/gtPlusPlus/core/material/ORES.java
+++ b/src/main/java/gtPlusPlus/core/material/ORES.java
@@ -6,845 +6,838 @@ import gtPlusPlus.core.material.state.MaterialState;
public final class ORES {
- public static final Material AGARDITE_CD = new Material(
- "Agardite (Cd)", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{170, 188, 33, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (CdCa)Cu7(AsO2)4(O2H)5·3H2O
- new MaterialStack(ELEMENT.getInstance().CADMIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().COPPER, 7),
- new MaterialStack(ELEMENT.getInstance().ARSENIC, 4),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 21),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 11)
- });
-
- public static final Material AGARDITE_LA = new Material(
- "Agardite (La)", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
- new short[]{206, 232, 9, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (LaCa)Cu5(AsO6)2(OH)4·3H2O
- new MaterialStack(ELEMENT.getInstance().LANTHANUM, 1),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().COPPER, 5),
- new MaterialStack(ELEMENT.getInstance().ARSENIC, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 19),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 10)
- });
-
- public static final Material AGARDITE_ND = new Material(
- "Agardite (Nd)", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{225, 244, 78, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (NdCa)Cu6(As3O3)2(O2H)6·3H2O
- new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().COPPER, 6),
- new MaterialStack(ELEMENT.getInstance().ARSENIC, 6),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 21),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12)
- });
-
- public static final Material AGARDITE_Y = new Material(
- "Agardite (Y)", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{210, 232, 44, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (YCa)Cu5(As2O4)3(OH)6·3H2O
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().COPPER, 5),
- new MaterialStack(ELEMENT.getInstance().ARSENIC, 6),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 21),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12)
- });
-
- //Alburnite
- //Ag8GeTe2S4
- public static final Material ALBURNITE = new Material(
- "Alburnite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{16, 5, 105, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- 0, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().GOLD, 8),
- new MaterialStack(ELEMENT.getInstance().GERMANIUM, 1),
- new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 4)
- });
-
- public static final Material CERITE = new Material(
- "Cerite", //Material Name
- MaterialState.ORE, //State
- TextureSets.REFINED.get(), //Texture Set
- new short[]{68, 13, 0, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (Ce,La,Ca)9(Mg,Fe+3)(SiO4)6(SiO3OH)(OH)3
- new MaterialStack(ELEMENT.getInstance().CERIUM, 9),
- new MaterialStack(ELEMENT.getInstance().LANTHANUM, 9),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 9),
- new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 3),
- new MaterialStack(ELEMENT.getInstance().IRON, 3),
- new MaterialStack(ELEMENT.getInstance().SILICON, 7),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 20),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4)
- });
-
- //Comancheite
- //Hg55N24(NH2,OH)4(Cl,Br)34
- public static final Material COMANCHEITE = new Material(
- "Comancheite", //Material Name
- MaterialState.ORE, //State
- TextureSets.REFINED.get(), //Texture Set
- new short[]{65, 205, 105, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- 0, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().MERCURY, 54/4),
- new MaterialStack(ELEMENT.getInstance().NITROGEN, 28/4),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12/4),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 8/4),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 34/4),
- new MaterialStack(ELEMENT.getInstance().BROMINE, 34/4)
- });
-
- public static final Material CROCROITE = new Material(
- "Crocoite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_GEM_VERTICAL, //Texture Set
- new short[]{255, 143, 84, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().LEAD, 2),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
- new MaterialStack(ELEMENT.getInstance().CAESIUM, 1),
- });
-
- public static final Material CRYOLITE = new Material(
- "Cryolite (F)", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_SHINY, //Texture Set
- new short[]{205, 205, 255, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().SODIUM, 3),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 6)
- });
-
- //Demicheleite-(Br)
- // BiSBr
- public static final Material DEMICHELEITE_BR = new Material(
- "Demicheleite (Br)", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_SHINY, //Texture Set
- new short[]{165, 75, 75, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().BISMUTH, 13),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 11),
- new MaterialStack(ELEMENT.getInstance().BROMINE, 1)
- });
-
- public static final Material FLORENCITE = new Material(
- "Florencite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{249, 249, 124, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// SmAl3(PO4)2(OH)6
- new MaterialStack(ELEMENT.getInstance().SAMARIUM, 1),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 3),
- new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 10),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 6)
- });
-
- public static final Material FLUORCAPHITE = new Material(
- "Fluorcaphite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
- new short[]{255, 255, 30, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (Ca,Sr,Ce,Na)5(PO4)3F
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 5),
- new MaterialStack(MISC_MATERIALS.STRONTIUM_OXIDE, 5),
- new MaterialStack(ELEMENT.getInstance().CERIUM, 5),
- new MaterialStack(ELEMENT.getInstance().SODIUM, 5),
- new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 3),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 12),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 6),
- });
-
- //Gadolinite_Ce
- public static final Material GADOLINITE_CE = new Material(
- "Gadolinite (Ce)", //Material Name
- MaterialState.ORE, //State
- TextureSets.REFINED.get(), //Texture Set
- new short[]{15, 159, 59, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CERIUM, 4),
- new MaterialStack(ELEMENT.getInstance().ERBIUM, 2),
- new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2),
- new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2),
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2),
- new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 1),
- new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 2),
- new MaterialStack(ELEMENT.getInstance().SILICON, 7),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 14),
- });
-
- //Gadolinite_Y
- public static final Material GADOLINITE_Y = new Material(
- "Gadolinite (Y)", //Material Name
- MaterialState.ORE, //State
- TextureSets.REFINED.get(), //Texture Set
- new short[]{35, 189, 99, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CERIUM, 2),
- new MaterialStack(ELEMENT.getInstance().ERBIUM, 2),
- new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2),
- new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2),
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 4),
- new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 2),
- new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 3),
- new MaterialStack(ELEMENT.getInstance().SILICON, 4),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 9),
- });
-
- public static final Material GEIKIELITE = new Material(
- "Geikielite", //Material Name
- MaterialState.ORE, //State
- TextureSets.GEM_A.get(), //Texture Set
- new short[]{187, 193, 204, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 1),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 3)
- });
-
- public static final Material GREENOCKITE = new Material(
- "Greenockite", //Material Name
- MaterialState.ORE, //State
- TextureSets.GEM_A.get(), //Texture Set
- new short[]{110, 193, 25, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CADMIUM, 2),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 2),
- });
-
- public static final Material HIBONITE = new Material(
- "Hibonite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{58, 31, 0, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// ((Ca,Ce)(Al,Ti,Mg)12O19)
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 12),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 12),
- new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 12),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 19),
- });
-
- //Honeaite
- //Au3TlTe2
- public static final Material HONEAITE = new Material(
- "Honeaite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
- new short[]{165, 165, 5, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- 0, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().GOLD, 3),
- new MaterialStack(ELEMENT.getInstance().THALLIUM, 1),
- new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2)
- });
-
- //Irarsite
- //(Ir,Ru,Rh,Pt)AsS
- public static final Material IRARSITE = new Material(
- "Irarsite", //Material Name
- MaterialState.ORE, //State
- TextureSets.ENRICHED.get(), //Texture Set
- new short[]{125, 105, 105, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- 0, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().IRIDIUM, 1),
- new MaterialStack(ELEMENT.getInstance().RUTHENIUM, 1),
- new MaterialStack(ELEMENT.getInstance().RHODIUM, 1),
- new MaterialStack(ELEMENT.getInstance().PLATINUM, 1),
- new MaterialStack(ELEMENT.getInstance().ARSENIC, 1),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 1)
- });
-
- //Kashinite
- //(Ir,Rh)2S3
- public static final Material KASHINITE = new Material(
- "Kashinite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_SHINY, //Texture Set
- new short[]{75, 105, 75, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- 0, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().IRIDIUM, 2),
- new MaterialStack(ELEMENT.getInstance().RHODIUM, 2),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 3)
- });
-
- // Tl(Cl,Br)
- public static final Material LAFOSSAITE = new Material(
- "Lafossaite", //Material Name
- MaterialState.ORE, //State
- TextureSets.REFINED.get(), //Texture Set
- new short[]{165, 105, 205, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 1),
- new MaterialStack(ELEMENT.getInstance().BROMINE, 1),
- new MaterialStack(ELEMENT.getInstance().THALLIUM, 1)
- });
-
- public static final Material LANTHANITE_CE = new Material(
- "Lanthanite (Ce)", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{186, 113, 179, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (Ce)2(CO3)3·8(H2O)
- new MaterialStack(ELEMENT.getInstance().CERIUM, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 3),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 1),
- });
-
- public static final Material LANTHANITE_LA = new Material(
- "Lanthanite (La)", //Material Name
- MaterialState.ORE, //State
- TextureSets.REFINED.get(), //Texture Set
- new short[]{219, 160, 214, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (La)2(CO3)3·8(H2O)
- new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 3),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 1),
- });
-
- public static final Material LANTHANITE_ND = new Material(
- "Lanthanite (Nd)", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{153, 76, 145, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (Nd)2(CO3)3·8(H2O)
- new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 3),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 1),
- });
-
- //Iodine Source
- public static final Material LAUTARITE = new Material(
- "Lautarite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
- new short[]{165, 105, 205, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().IODINE, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 6)
- });
-
- public static final Material LEPERSONNITE = new Material(
- "Lepersonnite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_EMERALD, //Texture Set
- new short[]{175, 175, 20, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 3),
- new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 2),
- new MaterialStack(ELEMENT.getInstance().DYSPROSIUM, 2),
- new MaterialStack(ELEMENT.getInstance().URANIUM235, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN,29),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 24)
- });
-
- //Miessiite
- //Pd11Te2Se2
- public static final Material MIESSIITE = new Material(
- "Miessiite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
- new short[]{75, 75, 75, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- 0, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().PALLADIUM, 11),
- new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2),
- new MaterialStack(ELEMENT.getInstance().SELENIUM, 2)
- });
-
- public static final Material NICHROMITE = new Material(
- "Nichromite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{22, 19, 19, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NICKEL, 1),
- new MaterialStack(ELEMENT.getInstance().COBALT, 1),
- new MaterialStack(ELEMENT.getInstance().IRON, 3),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 2),
- new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 8)
- });
-
- //Perroudite
- //Hg5Ag4S5(I,Br)2Cl2
- public static final Material PERROUDITE = new Material(
- "Perroudite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{77, 165, 174, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- 0, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().SULFUR, 5),
- new MaterialStack(ELEMENT.getInstance().SILVER, 4),
- new MaterialStack(ELEMENT.getInstance().IODINE, 2),
- new MaterialStack(ELEMENT.getInstance().MERCURY, 5),
- new MaterialStack(ELEMENT.getInstance().BROMINE, 2),
- new MaterialStack(ELEMENT.getInstance().CHLORINE, 2)
- });
-
- public static final Material POLYCRASE = new Material(
- "Polycrase", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_ROUGH, //Texture Set
- new short[]{51, 0, 11, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
- new MaterialStack(ELEMENT.getInstance().URANIUM235, 1),
- new MaterialStack(ELEMENT.getInstance().THORIUM, 1),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 2),
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
- new MaterialStack(ELEMENT.getInstance().TANTALUM, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 6)
- });
-
- //Radiobarite
- //Radium, Barium, Barite?
- public static final Material RADIOBARITE = new Material(
- "Barite (Rd)", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_FLINT, //Texture Set
- new short[]{205, 205, 205, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- 0, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().BARIUM, 32),
- new MaterialStack(ELEMENT.getInstance().RADIUM, 1),
- new MaterialStack(ELEMENT.getInstance().SULFUR, 16),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 15)
- });
-
- //Samarskite_Y
- public static final Material SAMARSKITE_Y = new Material(
- "Samarskite (Y)", //Material Name
- MaterialState.ORE, //State
- TextureSets.ENRICHED.get(), //Texture Set
- new short[]{65, 163, 164, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), //Y not YT/YB
- new MaterialStack(ELEMENT.getInstance().IRON, 10),
- new MaterialStack(ELEMENT.getInstance().URANIUM235, 2),
- new MaterialStack(ELEMENT.getInstance().THORIUM, 3),
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
- new MaterialStack(ELEMENT.getInstance().TANTALUM, 3)
- });
-
- //Samarskite_YB
- public static final Material SAMARSKITE_YB = new Material(
- "Samarskite (Yb)", //Material Name
- MaterialState.ORE, //State
- TextureSets.ENRICHED.get(), //Texture Set
- new short[]{95, 193, 194, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2), //Y not YT/YB
- new MaterialStack(ELEMENT.getInstance().IRON, 9),
- new MaterialStack(ELEMENT.getInstance().URANIUM235, 3),
- new MaterialStack(ELEMENT.getInstance().THORIUM, 2),
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 3),
- new MaterialStack(ELEMENT.getInstance().TANTALUM, 2)
- });
-
- public static final Material TITANITE = new Material(
- "Titanite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{184, 198, 105, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 2),
- new MaterialStack(ELEMENT.getInstance().SILICON, 2),
- new MaterialStack(ELEMENT.getInstance().THORIUM, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 10)
- });
-
- public static final Material XENOTIME = new Material(
- "Xenotime", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_OPAL, //Texture Set
- new short[]{235, 89, 199, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2),
- new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2),
- new MaterialStack(ELEMENT.getInstance().ERBIUM, 2),
- new MaterialStack(ELEMENT.getInstance().EUROPIUM, 1),
- new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 8)
- });
-
- public static final Material YTTRIAITE = new Material( //TODO
- "Yttriaite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
- new short[]{255, 143, 84, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), //Y not YT/YB
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
- new MaterialStack(ELEMENT.getInstance().IRON, 4),
- new MaterialStack(ELEMENT.getInstance().TIN, 1),
- new MaterialStack(ELEMENT.getInstance().NITROGEN, 2)
- });
-
- public static final Material YTTRIALITE = new Material(
- "Yttrialite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_RUBY, //Texture Set
- new short[]{35, 189, 99, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2),
- new MaterialStack(ELEMENT.getInstance().THORIUM, 2),
- new MaterialStack(ELEMENT.getInstance().SILICON, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 7),
- });
-
- public static final Material YTTROCERITE = new Material(
- "Yttrocerite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_DIAMOND, //Texture Set
- new short[]{35, 19, 199, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 5),
- new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1),
- });
-
- public static final Material ZIMBABWEITE = new Material(
- "Zimbabweite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
- new short[]{193, 187, 131, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
- new MaterialStack(ELEMENT.getInstance().POTASSIUM, 2),
- new MaterialStack(ELEMENT.getInstance().LEAD, 1),
- new MaterialStack(ELEMENT.getInstance().ARSENIC, 4),
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 4),
- new MaterialStack(ELEMENT.getInstance().TANTALUM, 4),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 18)
- });
-
- public static final Material ZIRCON = new Material(
- "Zircon", //Material Name
- MaterialState.ORE, //State
- TextureSets.GEM_A.get(), //Texture Set
- new short[]{195, 19, 19, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1),
- new MaterialStack(ELEMENT.getInstance().SILICON, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 4),
- });
-
- public static final Material ZIRCONILITE = new Material(
- "Zirconolite", //Material Name
- MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
- new short[]{45, 26, 0, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
- new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 2),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
- new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 14)
- });
-
- public static final Material ZIRCOPHYLLITE = new Material(
- "Zircophyllite", //Material Name
- MaterialState.ORE, //State
- TextureSets.REFINED.get(), //Texture Set
- new short[]{30, 0, 6, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().POTASSIUM, 3),
- new MaterialStack(ELEMENT.getInstance().SODIUM, 3),
- new MaterialStack(ELEMENT.getInstance().MANGANESE, 7),
- new MaterialStack(ELEMENT.getInstance().IRON, 7),
- new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 2),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 2),
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
- new MaterialStack(ELEMENT.getInstance().SILICON, 8),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 13),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 7),
- });
-
-
- public static final Material ZIRKELITE = new Material(
- "Zirkelite", //Material Name
- MaterialState.ORE, //State
- TextureSets.GEM_A.get(), //Texture Set
- new short[]{229, 208, 48, 0}, //Material Colour
- -1,
- -1,
- -1,
- -1,
- -1, //Radiation
- new MaterialStack[]{// (Ca,Th,Ce)Zr(Ti,Nb)2O7
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
- new MaterialStack(ELEMENT.getInstance().THORIUM, 1),
- new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
- new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 2),
- new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
- new MaterialStack(ELEMENT.getInstance().OXYGEN, 7)
- });
-
- public static final Material DEEP_EARTH_REACTOR_FUEL_DEPOSIT = new Material(
- "Radioactive Mineral Mix", //Material Name
- MaterialState.ORE, //State
- TextureSets.NUCLEAR.get(), //Texture Set
- null, //Material Colour
- -1,
- -1,
- -1,
- -1,
- 4, //Radiation
- new MaterialStack[]{// Na3AlF6
- new MaterialStack(ELEMENT.getInstance().RADON, 2),
- new MaterialStack(ELEMENT.getInstance().RADIUM, 1),
- new MaterialStack(ELEMENT.getInstance().URANIUM235, 1),
- new MaterialStack(ELEMENT.getInstance().URANIUM238, 10),
- new MaterialStack(ELEMENT.getInstance().THORIUM, 25),
- new MaterialStack(ELEMENT.getInstance().THORIUM232, 4),
- new MaterialStack(FLUORCAPHITE, 6),
- new MaterialStack(SAMARSKITE_Y, 8),
- new MaterialStack(TITANITE, 4)
- });
-
-
+ public static final Material AGARDITE_CD = new Material(
+ "Agardite (Cd)", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {170, 188, 33, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (CdCa)Cu7(AsO2)4(O2H)5·3H2O
+ new MaterialStack(ELEMENT.getInstance().CADMIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().COPPER, 7),
+ new MaterialStack(ELEMENT.getInstance().ARSENIC, 4),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 21),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 11)
+ });
+ public static final Material AGARDITE_LA = new Material(
+ "Agardite (La)", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_FINE, // Texture Set
+ new short[] {206, 232, 9, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (LaCa)Cu5(AsO6)2(OH)4·3H2O
+ new MaterialStack(ELEMENT.getInstance().LANTHANUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().COPPER, 5),
+ new MaterialStack(ELEMENT.getInstance().ARSENIC, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 19),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 10)
+ });
+ public static final Material AGARDITE_ND = new Material(
+ "Agardite (Nd)", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {225, 244, 78, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (NdCa)Cu6(As3O3)2(O2H)6·3H2O
+ new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().COPPER, 6),
+ new MaterialStack(ELEMENT.getInstance().ARSENIC, 6),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 21),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12)
+ });
+ public static final Material AGARDITE_Y = new Material(
+ "Agardite (Y)", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {210, 232, 44, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (YCa)Cu5(As2O4)3(OH)6·3H2O
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().COPPER, 5),
+ new MaterialStack(ELEMENT.getInstance().ARSENIC, 6),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 21),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12)
+ });
+
+ // Alburnite
+ // Ag8GeTe2S4
+ public static final Material ALBURNITE = new Material(
+ "Alburnite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {16, 5, 105, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ 0, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().GOLD, 8),
+ new MaterialStack(ELEMENT.getInstance().GERMANIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 4)
+ });
+
+ public static final Material CERITE = new Material(
+ "Cerite", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.REFINED.get(), // Texture Set
+ new short[] {68, 13, 0, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (Ce,La,Ca)9(Mg,Fe+3)(SiO4)6(SiO3OH)(OH)3
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 9),
+ new MaterialStack(ELEMENT.getInstance().LANTHANUM, 9),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 9),
+ new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().IRON, 3),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 7),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 20),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4)
+ });
+
+ // Comancheite
+ // Hg55N24(NH2,OH)4(Cl,Br)34
+ public static final Material COMANCHEITE = new Material(
+ "Comancheite", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.REFINED.get(), // Texture Set
+ new short[] {65, 205, 105, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ 0, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().MERCURY, 54 / 4),
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 28 / 4),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12 / 4),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 8 / 4),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 34 / 4),
+ new MaterialStack(ELEMENT.getInstance().BROMINE, 34 / 4)
+ });
+
+ public static final Material CROCROITE = new Material(
+ "Crocoite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_GEM_VERTICAL, // Texture Set
+ new short[] {255, 143, 84, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().LEAD, 2),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
+ new MaterialStack(ELEMENT.getInstance().CAESIUM, 1),
+ });
+
+ public static final Material CRYOLITE = new Material(
+ "Cryolite (F)", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_SHINY, // Texture Set
+ new short[] {205, 205, 255, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 6)
+ });
+
+ // Demicheleite-(Br)
+ // BiSBr
+ public static final Material DEMICHELEITE_BR = new Material(
+ "Demicheleite (Br)", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_SHINY, // Texture Set
+ new short[] {165, 75, 75, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().BISMUTH, 13),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 11),
+ new MaterialStack(ELEMENT.getInstance().BROMINE, 1)
+ });
+
+ public static final Material FLORENCITE = new Material(
+ "Florencite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {249, 249, 124, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // SmAl3(PO4)2(OH)6
+ new MaterialStack(ELEMENT.getInstance().SAMARIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 10),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 6)
+ });
+
+ public static final Material FLUORCAPHITE = new Material(
+ "Fluorcaphite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_FINE, // Texture Set
+ new short[] {255, 255, 30, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (Ca,Sr,Ce,Na)5(PO4)3F
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 5),
+ new MaterialStack(MISC_MATERIALS.STRONTIUM_OXIDE, 5),
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 5),
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 5),
+ new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 3),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 12),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 6),
+ });
+
+ // Gadolinite_Ce
+ public static final Material GADOLINITE_CE = new Material(
+ "Gadolinite (Ce)", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.REFINED.get(), // Texture Set
+ new short[] {15, 159, 59, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().ERBIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2),
+ new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 7),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 14),
+ });
+
+ // Gadolinite_Y
+ public static final Material GADOLINITE_Y = new Material(
+ "Gadolinite (Y)", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.REFINED.get(), // Texture Set
+ new short[] {35, 189, 99, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().ERBIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2),
+ new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 4),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 9),
+ });
+
+ public static final Material GEIKIELITE = new Material(
+ "Geikielite", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.GEM_A.get(), // Texture Set
+ new short[] {187, 193, 204, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3)
+ });
+
+ public static final Material GREENOCKITE = new Material(
+ "Greenockite", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.GEM_A.get(), // Texture Set
+ new short[] {110, 193, 25, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CADMIUM, 2), new MaterialStack(ELEMENT.getInstance().SULFUR, 2),
+ });
+
+ public static final Material HIBONITE = new Material(
+ "Hibonite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {58, 31, 0, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // ((Ca,Ce)(Al,Ti,Mg)12O19)
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 12),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 12),
+ new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 12),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 19),
+ });
+
+ // Honeaite
+ // Au3TlTe2
+ public static final Material HONEAITE = new Material(
+ "Honeaite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_FINE, // Texture Set
+ new short[] {165, 165, 5, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ 0, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().GOLD, 3),
+ new MaterialStack(ELEMENT.getInstance().THALLIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2)
+ });
+
+ // Irarsite
+ // (Ir,Ru,Rh,Pt)AsS
+ public static final Material IRARSITE = new Material(
+ "Irarsite", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.ENRICHED.get(), // Texture Set
+ new short[] {125, 105, 105, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ 0, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().IRIDIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().RUTHENIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().RHODIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().PLATINUM, 1),
+ new MaterialStack(ELEMENT.getInstance().ARSENIC, 1),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1)
+ });
+
+ // Kashinite
+ // (Ir,Rh)2S3
+ public static final Material KASHINITE = new Material(
+ "Kashinite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_SHINY, // Texture Set
+ new short[] {75, 105, 75, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ 0, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().IRIDIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().RHODIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 3)
+ });
+
+ // Tl(Cl,Br)
+ public static final Material LAFOSSAITE = new Material(
+ "Lafossaite", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.REFINED.get(), // Texture Set
+ new short[] {165, 105, 205, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 1),
+ new MaterialStack(ELEMENT.getInstance().BROMINE, 1),
+ new MaterialStack(ELEMENT.getInstance().THALLIUM, 1)
+ });
+
+ public static final Material LANTHANITE_CE = new Material(
+ "Lanthanite (Ce)", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {186, 113, 179, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (Ce)2(CO3)3·8(H2O)
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1),
+ });
+
+ public static final Material LANTHANITE_LA = new Material(
+ "Lanthanite (La)", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.REFINED.get(), // Texture Set
+ new short[] {219, 160, 214, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (La)2(CO3)3·8(H2O)
+ new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1),
+ });
+
+ public static final Material LANTHANITE_ND = new Material(
+ "Lanthanite (Nd)", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {153, 76, 145, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (Nd)2(CO3)3·8(H2O)
+ new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1),
+ });
+
+ // Iodine Source
+ public static final Material LAUTARITE = new Material(
+ "Lautarite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_FINE, // Texture Set
+ new short[] {165, 105, 205, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().IODINE, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 6)
+ });
+
+ public static final Material LEPERSONNITE = new Material(
+ "Lepersonnite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_EMERALD, // Texture Set
+ new short[] {175, 175, 20, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().DYSPROSIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().URANIUM235, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 29),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 24)
+ });
+
+ // Miessiite
+ // Pd11Te2Se2
+ public static final Material MIESSIITE = new Material(
+ "Miessiite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_FINE, // Texture Set
+ new short[] {75, 75, 75, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ 0, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().PALLADIUM, 11),
+ new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().SELENIUM, 2)
+ });
+
+ public static final Material NICHROMITE = new Material(
+ "Nichromite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {22, 19, 19, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 1),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 1),
+ new MaterialStack(ELEMENT.getInstance().IRON, 3),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 8)
+ });
+
+ // Perroudite
+ // Hg5Ag4S5(I,Br)2Cl2
+ public static final Material PERROUDITE = new Material(
+ "Perroudite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {77, 165, 174, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ 0, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 5),
+ new MaterialStack(ELEMENT.getInstance().SILVER, 4),
+ new MaterialStack(ELEMENT.getInstance().IODINE, 2),
+ new MaterialStack(ELEMENT.getInstance().MERCURY, 5),
+ new MaterialStack(ELEMENT.getInstance().BROMINE, 2),
+ new MaterialStack(ELEMENT.getInstance().CHLORINE, 2)
+ });
+
+ public static final Material POLYCRASE = new Material(
+ "Polycrase", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_ROUGH, // Texture Set
+ new short[] {51, 0, 11, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().URANIUM235, 1),
+ new MaterialStack(ELEMENT.getInstance().THORIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().TANTALUM, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 6)
+ });
+
+ // Radiobarite
+ // Radium, Barium, Barite?
+ public static final Material RADIOBARITE = new Material(
+ "Barite (Rd)", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_FLINT, // Texture Set
+ new short[] {205, 205, 205, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ 0, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().BARIUM, 32),
+ new MaterialStack(ELEMENT.getInstance().RADIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().SULFUR, 16),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 15)
+ });
+
+ // Samarskite_Y
+ public static final Material SAMARSKITE_Y = new Material(
+ "Samarskite (Y)", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.ENRICHED.get(), // Texture Set
+ new short[] {65, 163, 164, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), // Y not YT/YB
+ new MaterialStack(ELEMENT.getInstance().IRON, 10),
+ new MaterialStack(ELEMENT.getInstance().URANIUM235, 2),
+ new MaterialStack(ELEMENT.getInstance().THORIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().TANTALUM, 3)
+ });
+
+ // Samarskite_YB
+ public static final Material SAMARSKITE_YB = new Material(
+ "Samarskite (Yb)", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.ENRICHED.get(), // Texture Set
+ new short[] {95, 193, 194, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2), // Y not YT/YB
+ new MaterialStack(ELEMENT.getInstance().IRON, 9),
+ new MaterialStack(ELEMENT.getInstance().URANIUM235, 3),
+ new MaterialStack(ELEMENT.getInstance().THORIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().TANTALUM, 2)
+ });
+
+ public static final Material TITANITE = new Material(
+ "Titanite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {184, 198, 105, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 2),
+ new MaterialStack(ELEMENT.getInstance().THORIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 10)
+ });
+
+ public static final Material XENOTIME = new Material(
+ "Xenotime", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_OPAL, // Texture Set
+ new short[] {235, 89, 199, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().ERBIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().EUROPIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 8)
+ });
+
+ public static final Material YTTRIAITE = new Material( // TODO
+ "Yttriaite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_METALLIC, // Texture Set
+ new short[] {255, 143, 84, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), // Y not YT/YB
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 3),
+ new MaterialStack(ELEMENT.getInstance().IRON, 4),
+ new MaterialStack(ELEMENT.getInstance().TIN, 1),
+ new MaterialStack(ELEMENT.getInstance().NITROGEN, 2)
+ });
+
+ public static final Material YTTRIALITE = new Material(
+ "Yttrialite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_RUBY, // Texture Set
+ new short[] {35, 189, 99, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().THORIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 7),
+ });
+
+ public static final Material YTTROCERITE = new Material(
+ "Yttrocerite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_DIAMOND, // Texture Set
+ new short[] {35, 19, 199, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 5),
+ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1),
+ });
+
+ public static final Material ZIMBABWEITE = new Material(
+ "Zimbabweite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_FINE, // Texture Set
+ new short[] {193, 187, 131, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().POTASSIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().LEAD, 1),
+ new MaterialStack(ELEMENT.getInstance().ARSENIC, 4),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().TANTALUM, 4),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 18)
+ });
+
+ public static final Material ZIRCON = new Material(
+ "Zircon", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.GEM_A.get(), // Texture Set
+ new short[] {195, 19, 19, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 4),
+ });
+
+ public static final Material ZIRCONILITE = new Material(
+ "Zirconolite", // Material Name
+ MaterialState.ORE, // State
+ TextureSet.SET_FINE, // Texture Set
+ new short[] {45, 26, 0, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 14)
+ });
+
+ public static final Material ZIRCOPHYLLITE = new Material(
+ "Zircophyllite", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.REFINED.get(), // Texture Set
+ new short[] {30, 0, 6, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().POTASSIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 3),
+ new MaterialStack(ELEMENT.getInstance().MANGANESE, 7),
+ new MaterialStack(ELEMENT.getInstance().IRON, 7),
+ new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().SILICON, 8),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 13),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 7),
+ });
+
+ public static final Material ZIRKELITE = new Material(
+ "Zirkelite", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.GEM_A.get(), // Texture Set
+ new short[] {229, 208, 48, 0}, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ -1, // Radiation
+ new MaterialStack[] { // (Ca,Th,Ce)Zr(Ti,Nb)2O7
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().THORIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().CERIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 7)
+ });
+
+ public static final Material DEEP_EARTH_REACTOR_FUEL_DEPOSIT = new Material(
+ "Radioactive Mineral Mix", // Material Name
+ MaterialState.ORE, // State
+ TextureSets.NUCLEAR.get(), // Texture Set
+ null, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ 4, // Radiation
+ new MaterialStack[] { // Na3AlF6
+ new MaterialStack(ELEMENT.getInstance().RADON, 2),
+ new MaterialStack(ELEMENT.getInstance().RADIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().URANIUM235, 1),
+ new MaterialStack(ELEMENT.getInstance().URANIUM238, 10),
+ new MaterialStack(ELEMENT.getInstance().THORIUM, 25),
+ new MaterialStack(ELEMENT.getInstance().THORIUM232, 4),
+ new MaterialStack(FLUORCAPHITE, 6),
+ new MaterialStack(SAMARSKITE_Y, 8),
+ new MaterialStack(TITANITE, 4)
+ });
}
diff --git a/src/main/java/gtPlusPlus/core/material/Particle.java b/src/main/java/gtPlusPlus/core/material/Particle.java
index e93129ec58..7067052cb5 100644
--- a/src/main/java/gtPlusPlus/core/material/Particle.java
+++ b/src/main/java/gtPlusPlus/core/material/Particle.java
@@ -9,145 +9,143 @@ import net.minecraft.item.ItemStack;
public class Particle {
- public static final Particle GRAVITON;
-
- public static final Particle UP;
- public static final Particle DOWN;
- public static final Particle CHARM;
- public static final Particle STRANGE;
- public static final Particle TOP;
- public static final Particle BOTTOM;
-
- public static final Particle ELECTRON;
- public static final Particle ELECTRON_NEUTRINO;
- public static final Particle MUON;
- public static final Particle MUON_NEUTRINO;
- public static final Particle TAU;
- public static final Particle TAU_NEUTRINO;
-
- public static final Particle GLUON;
- public static final Particle PHOTON;
- public static final Particle Z_BOSON;
- public static final Particle W_BOSON;
- public static final Particle HIGGS_BOSON;
-
- public static final Particle PROTON;
- public static final Particle NEUTRON;
- public static final Particle LAMBDA;
- public static final Particle OMEGA;
-
- public static final Particle PION;
- public static final Particle ETA_MESON;
-
- public static final Particle UNKNOWN;
-
- public static final AutoMap<Particle> aMap = new AutoMap<Particle>();
-
- static {
-
- /*
- * Standard Model of Physics
- */
-
- //I exist, because I must.
- GRAVITON = new Particle(ElementaryGroup.BOSON, "Graviton");
-
- //Quarks
- UP = new Particle(ElementaryGroup.QUARK, "Up");
- DOWN = new Particle(ElementaryGroup.QUARK, "Down");
- CHARM = new Particle(ElementaryGroup.QUARK, "Charm");
- STRANGE = new Particle(ElementaryGroup.QUARK, "Strange");
- TOP = new Particle(ElementaryGroup.QUARK, "Top");
- BOTTOM = new Particle(ElementaryGroup.QUARK, "Bottom");
-
- //Leptons
- ELECTRON = new Particle(ElementaryGroup.LEPTON, "Electron");
- MUON = new Particle(ElementaryGroup.LEPTON, "Muon");
- TAU = new Particle(ElementaryGroup.LEPTON, "Tau");
- ELECTRON_NEUTRINO = new Particle(ElementaryGroup.LEPTON, "Electron Neutrino");
- MUON_NEUTRINO = new Particle(ElementaryGroup.LEPTON, "Muon Neutrino");
- TAU_NEUTRINO = new Particle(ElementaryGroup.LEPTON, "Tau Neutrino");
-
- //Bosons
- GLUON = new Particle(ElementaryGroup.BOSON, "Gluon");
- PHOTON = new Particle(ElementaryGroup.BOSON, "Photon");
- Z_BOSON = new Particle(ElementaryGroup.BOSON, "Z Boson");
- W_BOSON = new Particle(ElementaryGroup.BOSON, "W Boson");
- HIGGS_BOSON = new Particle(ElementaryGroup.BOSON, "Higgs Boson");
-
- /*
- * Composite Particles
- */
-
- //Baryons
- PROTON = new Particle(ElementaryGroup.BARYON, "Proton", new Particle[] {UP, UP, DOWN});
- NEUTRON = new Particle(ElementaryGroup.BARYON, "Neutron", new Particle[] {UP, DOWN, DOWN});
- LAMBDA = new Particle(ElementaryGroup.BARYON, "Lambda", new Particle[] {UP, DOWN, STRANGE});
- OMEGA = new Particle(ElementaryGroup.BARYON, "Omega", new Particle[] {STRANGE, STRANGE, STRANGE});
-
- //Mesons
- PION = new Particle(ElementaryGroup.MESON, "Pion", new Particle[] {MUON, MUON_NEUTRINO});
- ETA_MESON = new Particle(ElementaryGroup.MESON, "ETA Meson", new Particle[] {PION, PION, PION});
-
-
- //Wildcard
- UNKNOWN = new Particle(ElementaryGroup.UNKNOWN, "Unknown");
-
- }
-
- public static enum ElementaryGroup {
- QUARK,
- LEPTON,
- BOSON,
- BARYON,
- MESON,
- UNKNOWN;
- }
-
- public final ElementaryGroup mParticleType;
- public final String mParticleName;
- public final Particle[] mComposition;
-
- public Particle(ElementaryGroup aParticleType, String aParticleName) {
- this(aParticleType, aParticleName, null);
- }
-
- public Particle(ElementaryGroup aParticleType, String aParticleName, Particle[] aComposition) {
- mParticleType = aParticleType;
- mParticleName = aParticleName;
- mComposition = aComposition == null ? new Particle[] {this} : aComposition;
- aMap.put(this);
- }
-
-
- public static ItemStack getIon(String aElementName, int aCharge) {
- for (String g : gtPlusPlus.core.item.chemistry.IonParticles.NameToMetaMap.keySet()) {
- if (g.toLowerCase().equals(Utils.sanitizeString(aElementName.toLowerCase()))){
- Integer meta = gtPlusPlus.core.item.chemistry.IonParticles.NameToMetaMap.get(Utils.sanitizeString(aElementName.toLowerCase()));
- if (meta == null) {
- meta = 0;
- }
- ItemStack aIon = ItemUtils.simpleMetaStack(ModItems.itemIonParticleBase, meta, 1);
- if (aCharge != 0) {
- IonParticles.setChargeState(aIon, aCharge);
- }
- return aIon;
- }
- }
- return null;
- }
-
- public static ItemStack getBaseParticle(Particle aParticle) {
- String aPartName = Utils.sanitizeString(aParticle.mParticleName.toLowerCase());
- for (String g : gtPlusPlus.core.item.chemistry.StandardBaseParticles.NameToMetaMap.keySet()) {
- if (g.toLowerCase().equals(aPartName)){
- Integer meta = gtPlusPlus.core.item.chemistry.StandardBaseParticles.NameToMetaMap.get(aPartName);
- if (meta == null) {
- meta = 0;
- }
- return ItemUtils.simpleMetaStack(ModItems.itemStandarParticleBase, meta, 1);
- }
- }
- return null;
- }
+ public static final Particle GRAVITON;
+
+ public static final Particle UP;
+ public static final Particle DOWN;
+ public static final Particle CHARM;
+ public static final Particle STRANGE;
+ public static final Particle TOP;
+ public static final Particle BOTTOM;
+
+ public static final Particle ELECTRON;
+ public static final Particle ELECTRON_NEUTRINO;
+ public static final Particle MUON;
+ public static final Particle MUON_NEUTRINO;
+ public static final Particle TAU;
+ public static final Particle TAU_NEUTRINO;
+
+ public static final Particle GLUON;
+ public static final Particle PHOTON;
+ public static final Particle Z_BOSON;
+ public static final Particle W_BOSON;
+ public static final Particle HIGGS_BOSON;
+
+ public static final Particle PROTON;
+ public static final Particle NEUTRON;
+ public static final Particle LAMBDA;
+ public static final Particle OMEGA;
+
+ public static final Particle PION;
+ public static final Particle ETA_MESON;
+
+ public static final Particle UNKNOWN;
+
+ public static final AutoMap<Particle> aMap = new AutoMap<Particle>();
+
+ static {
+
+ /*
+ * Standard Model of Physics
+ */
+
+ // I exist, because I must.
+ GRAVITON = new Particle(ElementaryGroup.BOSON, "Graviton");
+
+ // Quarks
+ UP = new Particle(ElementaryGroup.QUARK, "Up");
+ DOWN = new Particle(ElementaryGroup.QUARK, "Down");
+ CHARM = new Particle(ElementaryGroup.QUARK, "Charm");
+ STRANGE = new Particle(ElementaryGroup.QUARK, "Strange");
+ TOP = new Particle(ElementaryGroup.QUARK, "Top");
+ BOTTOM = new Particle(ElementaryGroup.QUARK, "Bottom");
+
+ // Leptons
+ ELECTRON = new Particle(ElementaryGroup.LEPTON, "Electron");
+ MUON = new Particle(ElementaryGroup.LEPTON, "Muon");
+ TAU = new Particle(ElementaryGroup.LEPTON, "Tau");
+ ELECTRON_NEUTRINO = new Particle(ElementaryGroup.LEPTON, "Electron Neutrino");
+ MUON_NEUTRINO = new Particle(ElementaryGroup.LEPTON, "Muon Neutrino");
+ TAU_NEUTRINO = new Particle(ElementaryGroup.LEPTON, "Tau Neutrino");
+
+ // Bosons
+ GLUON = new Particle(ElementaryGroup.BOSON, "Gluon");
+ PHOTON = new Particle(ElementaryGroup.BOSON, "Photon");
+ Z_BOSON = new Particle(ElementaryGroup.BOSON, "Z Boson");
+ W_BOSON = new Particle(ElementaryGroup.BOSON, "W Boson");
+ HIGGS_BOSON = new Particle(ElementaryGroup.BOSON, "Higgs Boson");
+
+ /*
+ * Composite Particles
+ */
+
+ // Baryons
+ PROTON = new Particle(ElementaryGroup.BARYON, "Proton", new Particle[] {UP, UP, DOWN});
+ NEUTRON = new Particle(ElementaryGroup.BARYON, "Neutron", new Particle[] {UP, DOWN, DOWN});
+ LAMBDA = new Particle(ElementaryGroup.BARYON, "Lambda", new Particle[] {UP, DOWN, STRANGE});
+ OMEGA = new Particle(ElementaryGroup.BARYON, "Omega", new Particle[] {STRANGE, STRANGE, STRANGE});
+
+ // Mesons
+ PION = new Particle(ElementaryGroup.MESON, "Pion", new Particle[] {MUON, MUON_NEUTRINO});
+ ETA_MESON = new Particle(ElementaryGroup.MESON, "ETA Meson", new Particle[] {PION, PION, PION});
+
+ // Wildcard
+ UNKNOWN = new Particle(ElementaryGroup.UNKNOWN, "Unknown");
+ }
+
+ public static enum ElementaryGroup {
+ QUARK,
+ LEPTON,
+ BOSON,
+ BARYON,
+ MESON,
+ UNKNOWN;
+ }
+
+ public final ElementaryGroup mParticleType;
+ public final String mParticleName;
+ public final Particle[] mComposition;
+
+ public Particle(ElementaryGroup aParticleType, String aParticleName) {
+ this(aParticleType, aParticleName, null);
+ }
+
+ public Particle(ElementaryGroup aParticleType, String aParticleName, Particle[] aComposition) {
+ mParticleType = aParticleType;
+ mParticleName = aParticleName;
+ mComposition = aComposition == null ? new Particle[] {this} : aComposition;
+ aMap.put(this);
+ }
+
+ public static ItemStack getIon(String aElementName, int aCharge) {
+ for (String g : gtPlusPlus.core.item.chemistry.IonParticles.NameToMetaMap.keySet()) {
+ if (g.toLowerCase().equals(Utils.sanitizeString(aElementName.toLowerCase()))) {
+ Integer meta = gtPlusPlus.core.item.chemistry.IonParticles.NameToMetaMap.get(
+ Utils.sanitizeString(aElementName.toLowerCase()));
+ if (meta == null) {
+ meta = 0;
+ }
+ ItemStack aIon = ItemUtils.simpleMetaStack(ModItems.itemIonParticleBase, meta, 1);
+ if (aCharge != 0) {
+ IonParticles.setChargeState(aIon, aCharge);
+ }
+ return aIon;
+ }
+ }
+ return null;
+ }
+
+ public static ItemStack getBaseParticle(Particle aParticle) {
+ String aPartName = Utils.sanitizeString(aParticle.mParticleName.toLowerCase());
+ for (String g : gtPlusPlus.core.item.chemistry.StandardBaseParticles.NameToMetaMap.keySet()) {
+ if (g.toLowerCase().equals(aPartName)) {
+ Integer meta = gtPlusPlus.core.item.chemistry.StandardBaseParticles.NameToMetaMap.get(aPartName);
+ if (meta == null) {
+ meta = 0;
+ }
+ return ItemUtils.simpleMetaStack(ModItems.itemStandarParticleBase, meta, 1);
+ }
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/material/gregtech/CustomGTMaterials.java b/src/main/java/gtPlusPlus/core/material/gregtech/CustomGTMaterials.java
index 20aebb80ed..dc70ccfe7a 100644
--- a/src/main/java/gtPlusPlus/core/material/gregtech/CustomGTMaterials.java
+++ b/src/main/java/gtPlusPlus/core/material/gregtech/CustomGTMaterials.java
@@ -2,78 +2,80 @@ package gtPlusPlus.core.material.gregtech;
public class CustomGTMaterials {
- //public static Materials Fireclay = new MaterialBuilder(626, TextureSet.SET_ROUGH, "Fireclay").addDustItems().setRGB(173, 160, 155).setColor(Dyes.dyeBrown).setMaterialList(new MaterialStack(Brick, 1)).constructMaterial();
-
- /**int aMetaItemSubID,
- * TextureSet aIconSet,
- * float aToolSpeed,
- * int aDurability,
- * int aToolQuality,
- * boolean aUnificatable,
- * String aName, String aDefaultLocalName,
- * String aConfigSection,
- * boolean aCustomOre,
- * String aCustomID) {
-
- **/
-
- /*public static List<Materials> Custom_GT_Materials = new ArrayList<Materials>();
-
- public static Materials Zirconium = materialBuilder_Element(1232, TextureSet.SET_METALLIC, 6.0F, 256, 2, 1|2|8|32|64|128, 200, 200, 200, 0, "Zirconium", "Zirconium", 0, 0, 1811, 0, false, false, 3, 1, 1, Dyes.dyeLightGray, Element.Zr, Arrays.asList(new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 3)));
- public static Materials Geikielite = materialBuilder(1234, TextureSet.SET_SHINY, new int[]{1,2,3}, "Geikielite", Dyes.dyeBlack, Arrays.asList(new MaterialStack(Titanium, 1), new MaterialStack(Magnesium, 1), new MaterialStack(Oxygen, 3)));
- public static Materials Zirconolite = materialBuilder(1235, TextureSet.SET_METALLIC, new int[]{1,2,3}, "Zirconolite", Dyes.dyeBlack, Arrays.asList(new MaterialStack(Calcium, 1), new MaterialStack(Zirconium, 1), new MaterialStack(Titanium, 2), new MaterialStack(Oxygen, 7)));
-
- public static final void run(){
- Utils.LOG_INFO("[Custom] Trying to initialise custom materials.");
- }
-
- private final static boolean registerMaterial(Materials r){
- Custom_GT_Materials.add(r);
- Utils.LOG_INFO("[Custom] Registered new Gregtech material - "+r.mName);
- return true;
- }
-
- public final static Materials materialBuilder(int ID, TextureSet texture, int[] rgb, String materialName, Dyes dyeColour, List<MaterialStack> composition){
- Materials newMat = new Materials(
- ID,
- texture,
- 1.0F,
- 0,
- 2,
- 1 |8 ,
- rgb[0], rgb[1], rgb[2], 0,
- materialName, materialName,
- 0, 0, -1, 0, false, false, 3, 1, 1,
- dyeColour,
- 1,
- composition
- );
- registerMaterial(newMat);
- return newMat;
- }
-
- public final static Materials materialBuilder_Element(
- int ID, TextureSet texture,
- float a, int b, int c,
- int d, int r2, int g2, int b2, int a2,
- String materialName, String e,
- int f, int g, int h, int i,
- boolean j, boolean k,
- int l, int m, int n,
- Dyes dyeColour, Element o,
- List<TC_AspectStack> aspects){
- Materials newMat = new Materials(
- ID, texture,
- a, b, c,
- d, r2, g2, b2, a2,
- materialName, e,
- f, g, h, i, j, k, l, m, n,
- dyeColour, o,
- aspects
- );
- registerMaterial(newMat);
- return newMat;
- }
-*/
+ // public static Materials Fireclay = new MaterialBuilder(626, TextureSet.SET_ROUGH,
+ // "Fireclay").addDustItems().setRGB(173, 160, 155).setColor(Dyes.dyeBrown).setMaterialList(new MaterialStack(Brick,
+ // 1)).constructMaterial();
+
+ /**int aMetaItemSubID,
+ * TextureSet aIconSet,
+ * float aToolSpeed,
+ * int aDurability,
+ * int aToolQuality,
+ * boolean aUnificatable,
+ * String aName, String aDefaultLocalName,
+ * String aConfigSection,
+ * boolean aCustomOre,
+ * String aCustomID) {
+ *
+ **/
+
+ /*public static List<Materials> Custom_GT_Materials = new ArrayList<Materials>();
+
+ public static Materials Zirconium = materialBuilder_Element(1232, TextureSet.SET_METALLIC, 6.0F, 256, 2, 1|2|8|32|64|128, 200, 200, 200, 0, "Zirconium", "Zirconium", 0, 0, 1811, 0, false, false, 3, 1, 1, Dyes.dyeLightGray, Element.Zr, Arrays.asList(new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 3)));
+ public static Materials Geikielite = materialBuilder(1234, TextureSet.SET_SHINY, new int[]{1,2,3}, "Geikielite", Dyes.dyeBlack, Arrays.asList(new MaterialStack(Titanium, 1), new MaterialStack(Magnesium, 1), new MaterialStack(Oxygen, 3)));
+ public static Materials Zirconolite = materialBuilder(1235, TextureSet.SET_METALLIC, new int[]{1,2,3}, "Zirconolite", Dyes.dyeBlack, Arrays.asList(new MaterialStack(Calcium, 1), new MaterialStack(Zirconium, 1), new MaterialStack(Titanium, 2), new MaterialStack(Oxygen, 7)));
+
+ public static final void run(){
+ Utils.LOG_INFO("[Custom] Trying to initialise custom materials.");
+ }
+
+ private final static boolean registerMaterial(Materials r){
+ Custom_GT_Materials.add(r);
+ Utils.LOG_INFO("[Custom] Registered new Gregtech material - "+r.mName);
+ return true;
+ }
+
+ public final static Materials materialBuilder(int ID, TextureSet texture, int[] rgb, String materialName, Dyes dyeColour, List<MaterialStack> composition){
+ Materials newMat = new Materials(
+ ID,
+ texture,
+ 1.0F,
+ 0,
+ 2,
+ 1 |8 ,
+ rgb[0], rgb[1], rgb[2], 0,
+ materialName, materialName,
+ 0, 0, -1, 0, false, false, 3, 1, 1,
+ dyeColour,
+ 1,
+ composition
+ );
+ registerMaterial(newMat);
+ return newMat;
+ }
+
+ public final static Materials materialBuilder_Element(
+ int ID, TextureSet texture,
+ float a, int b, int c,
+ int d, int r2, int g2, int b2, int a2,
+ String materialName, String e,
+ int f, int g, int h, int i,
+ boolean j, boolean k,
+ int l, int m, int n,
+ Dyes dyeColour, Element o,
+ List<TC_AspectStack> aspects){
+ Materials newMat = new Materials(
+ ID, texture,
+ a, b, c,
+ d, r2, g2, b2, a2,
+ materialName, e,
+ f, g, h, i, j, k, l, m, n,
+ dyeColour, o,
+ aspects
+ );
+ registerMaterial(newMat);
+ return newMat;
+ }
+ */
}
diff --git a/src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java b/src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
index d5c6e4a6bf..55e2b95535 100644
--- a/src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
+++ b/src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
@@ -9,276 +9,270 @@ import gtPlusPlus.core.material.state.MaterialState;
public class FLUORIDES {
- public static final Material FLUORITE = new Material(
- "Fluorite (F)", //Material Name
- MaterialState.ORE, //State
- null, //Material Colour
- Materials.Fluorine.mMeltingPoint, //Melting Point in C
- Materials.Fluorine.mBlastFurnaceTemp, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- false, //Generate cells
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().CALCIUM, 16),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 32),
- new MaterialStack(ELEMENT.getInstance().IRON, 4),
- new MaterialStack(ELEMENT.getInstance().CARBON, 2)
- });
+ public static final Material FLUORITE = new Material(
+ "Fluorite (F)", // Material Name
+ MaterialState.ORE, // State
+ null, // Material Colour
+ Materials.Fluorine.mMeltingPoint, // Melting Point in C
+ Materials.Fluorine.mBlastFurnaceTemp, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ false, // Generate cells
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().CALCIUM, 16),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 32),
+ new MaterialStack(ELEMENT.getInstance().IRON, 4),
+ new MaterialStack(ELEMENT.getInstance().CARBON, 2)
+ });
- //ThF4
- public static final Material THORIUM_TETRAFLUORIDE = new Material(
- "Thorium Tetrafluoride", //Material Name
- MaterialState.LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().THORIUM232, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 4)
- });
+ // ThF4
+ public static final Material THORIUM_TETRAFLUORIDE = new Material(
+ "Thorium Tetrafluoride", // Material Name
+ MaterialState.LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().THORIUM232, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 4)
+ });
- //ThF6
- public static final Material THORIUM_HEXAFLUORIDE = new Material(
- "Thorium Hexafluoride", //Material Name
- MaterialState.LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().THORIUM232, 1),
- new MaterialStack(ELEMENT.getInstance().THORIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 12)
- });
+ // ThF6
+ public static final Material THORIUM_HEXAFLUORIDE = new Material(
+ "Thorium Hexafluoride", // Material Name
+ MaterialState.LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().THORIUM232, 1),
+ new MaterialStack(ELEMENT.getInstance().THORIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 12)
+ });
- //UF4
- public static final Material URANIUM_TETRAFLUORIDE = new Material(
- "Uranium Tetrafluoride", //Material Name
- MaterialState.LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().URANIUM233, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 4)
- });
+ // UF4
+ public static final Material URANIUM_TETRAFLUORIDE = new Material(
+ "Uranium Tetrafluoride", // Material Name
+ MaterialState.LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().URANIUM233, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 4)
+ });
- //UF6
- public static final Material URANIUM_HEXAFLUORIDE = new Material(
- "Uranium Hexafluoride", //Material Name
- MaterialState.LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 2)
- });
+ // UF6
+ public static final Material URANIUM_HEXAFLUORIDE = new Material(
+ "Uranium Hexafluoride", // Material Name
+ MaterialState.LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 2)
+ });
- //ZrF4
-
- public static final Material ZIRCONIUM_TETRAFLUORIDE = new Material(
- "Zirconium Tetrafluoride", //Material Name
- MaterialState.LIQUID, //State
- null, //Texture Set (Autogenerated)
- 0,
- null, //Material Colour
- -1,
- -1,
- -1,
- -1,
- false,
- "ZrF4",
- -1,
- true,
- false,
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 4)
- });
-
+ // ZrF4
-
-/* public static final Material ZIRCONIUM_TETRAFLUORIDE = new Material(
- "Zirconium Tetrafluoride", //Material Name
- MaterialState.LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 4)
- });*/
+ public static final Material ZIRCONIUM_TETRAFLUORIDE = new Material(
+ "Zirconium Tetrafluoride", // Material Name
+ MaterialState.LIQUID, // State
+ null, // Texture Set (Autogenerated)
+ 0,
+ null, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "ZrF4",
+ -1,
+ true,
+ false,
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 4)
+ });
- //BeF2
- public static final Material BERYLLIUM_FLUORIDE = new Material(
- "Beryllium Fluoride", //Material Name
- MaterialState.LIQUID, //State
- null, //Material Colour
- -1,
- -1,
- -1,
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 2)
- });
+ /* public static final Material ZIRCONIUM_TETRAFLUORIDE = new Material(
+ "Zirconium Tetrafluoride", //Material Name
+ MaterialState.LIQUID, //State
+ null, //Material Colour
+ -1, //Melting Point in C
+ -1, //Boiling Point in C
+ -1, //Protons
+ -1, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 4)
+ });*/
- //LiF
- public static final Material LITHIUM_FLUORIDE = new Material(
- "Lithium Fluoride", //Material Name
- MaterialState.LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().LITHIUM7, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 1)
- });
+ // BeF2
+ public static final Material BERYLLIUM_FLUORIDE = new Material(
+ "Beryllium Fluoride", // Material Name
+ MaterialState.LIQUID, // State
+ null, // Material Colour
+ -1,
+ -1,
+ -1,
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 2)
+ });
+ // LiF
+ public static final Material LITHIUM_FLUORIDE = new Material(
+ "Lithium Fluoride", // Material Name
+ MaterialState.LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().LITHIUM7, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 1)
+ });
- //LFTR sub components
-
- //(NH4)HF2
- public static final Material AMMONIUM_BIFLUORIDE = new Material(
- "Ammonium Bifluoride", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- 126, //Melting Point in C
- 240, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(MISC_MATERIALS.AMMONIUM, 1),
- new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 2)
- });
-
- //Be(OH)2
- public static final Material BERYLLIUM_HYDROXIDE = new Material(
- "Beryllium Hydroxide", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 1),
- new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2)
- });
-
- // (NH4)2Be(OH)2 / (NH4)2BeF4
- public static final Material AMMONIUM_TETRAFLUOROBERYLLATE = new Material(
- "Ammonium Tetrafluoroberyllate", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- 280, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(MISC_MATERIALS.AMMONIUM, 2),
- new MaterialStack(FLUORIDES.BERYLLIUM_HYDROXIDE, 1)
- });
-
-
-
- //LFTR Output
- public static final Material NEPTUNIUM_HEXAFLUORIDE = new Material(
- "Neptunium Hexafluoride", //Material Name
- MaterialState.GAS, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NEPTUNIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 6)
- });
+ // LFTR sub components
- public static final Material TECHNETIUM_HEXAFLUORIDE = new Material(
- "Technetium Hexafluoride", //Material Name
- MaterialState.GAS, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().TECHNETIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 6)
- });
+ // (NH4)HF2
+ public static final Material AMMONIUM_BIFLUORIDE = new Material(
+ "Ammonium Bifluoride", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ 126, // Melting Point in C
+ 240, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(MISC_MATERIALS.AMMONIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 2)
+ });
- public static final Material SELENIUM_HEXAFLUORIDE = new Material(
- "Selenium Hexafluoride", //Material Name
- MaterialState.GAS, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().SELENIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 6)
- });
-
- public static final Material SODIUM_FLUORIDE = new Material(
- "Sodium Fluoride", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().SODIUM, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 1)
- });
+ // Be(OH)2
+ public static final Material BERYLLIUM_HYDROXIDE = new Material(
+ "Beryllium Hydroxide", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 1), new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2)
+ });
- private static final FLUORIDES INSTANCE = new FLUORIDES();
- public static FLUORIDES getInstance(){return INSTANCE;}
+ // (NH4)2Be(OH)2 / (NH4)2BeF4
+ public static final Material AMMONIUM_TETRAFLUOROBERYLLATE = new Material(
+ "Ammonium Tetrafluoroberyllate", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ 280, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(MISC_MATERIALS.AMMONIUM, 2), new MaterialStack(FLUORIDES.BERYLLIUM_HYDROXIDE, 1)
+ });
+ // LFTR Output
+ public static final Material NEPTUNIUM_HEXAFLUORIDE = new Material(
+ "Neptunium Hexafluoride", // Material Name
+ MaterialState.GAS, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NEPTUNIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 6)
+ });
+
+ public static final Material TECHNETIUM_HEXAFLUORIDE = new Material(
+ "Technetium Hexafluoride", // Material Name
+ MaterialState.GAS, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().TECHNETIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 6)
+ });
+
+ public static final Material SELENIUM_HEXAFLUORIDE = new Material(
+ "Selenium Hexafluoride", // Material Name
+ MaterialState.GAS, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().SELENIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 6)
+ });
+
+ public static final Material SODIUM_FLUORIDE = new Material(
+ "Sodium Fluoride", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().SODIUM, 1), new MaterialStack(ELEMENT.getInstance().FLUORINE, 1)
+ });
+
+ private static final FLUORIDES INSTANCE = new FLUORIDES();
+
+ public static FLUORIDES getInstance() {
+ return INSTANCE;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/material/nuclear/NUCLIDE.java b/src/main/java/gtPlusPlus/core/material/nuclear/NUCLIDE.java
index eaa5a87d09..549d3b4a88 100644
--- a/src/main/java/gtPlusPlus/core/material/nuclear/NUCLIDE.java
+++ b/src/main/java/gtPlusPlus/core/material/nuclear/NUCLIDE.java
@@ -7,370 +7,342 @@ import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.data.StringUtils;
-
public final class NUCLIDE {
- public static final Material Li2BeF4 = new Material(
- "Lithium Tetrafluoroberyllate (LFTB)", //Material Name
- MaterialState.LIQUID, //State
- TextureSets.NUCLEAR.get(),
- null, //Material Colour
- 566, //Melting Point in C
- 870, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"Li2BeF4"), //Chemical Formula
- 4, //Radioactivity Level
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 2),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1)
- });
-
- public static final Material LiFBeF2ThF4UF4 = new Material(
- "LFTR Fuel 3", //Material Name
- MaterialState.LIQUID, //State
- TextureSets.NUCLEAR.get(),
- null, //Material Colour
- 566, //Melting Point in C
- 870, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2ThF4UF4"), //Chemical Formula
- 5, //Radioactivity Level
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 65),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 28),
- new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1),
- new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1)
- });
-
- public static final Material LiFBeF2ZrF4UF4 = new Material(
- "LFTR Fuel 2", //Material Name
- MaterialState.LIQUID, //State
- TextureSets.NUCLEAR.get(),
- null, //Material Colour
- 650, //Melting Point in C
- 940, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2ZrF4UF4"), //Chemical Formula
- 5, //Radioactivity Level
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 65),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 28),
- new MaterialStack(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE, 5),
- new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 2)
- });
+ public static final Material Li2BeF4 = new Material(
+ "Lithium Tetrafluoroberyllate (LFTB)", // Material Name
+ MaterialState.LIQUID, // State
+ TextureSets.NUCLEAR.get(),
+ null, // Material Colour
+ 566, // Melting Point in C
+ 870, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "Li2BeF4"), // Chemical Formula
+ 4, // Radioactivity Level
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 2), new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1)
+ });
+
+ public static final Material LiFBeF2ThF4UF4 = new Material(
+ "LFTR Fuel 3", // Material Name
+ MaterialState.LIQUID, // State
+ TextureSets.NUCLEAR.get(),
+ null, // Material Colour
+ 566, // Melting Point in C
+ 870, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2ThF4UF4"), // Chemical Formula
+ 5, // Radioactivity Level
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 65),
+ new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 28),
+ new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1)
+ });
+
+ public static final Material LiFBeF2ZrF4UF4 = new Material(
+ "LFTR Fuel 2", // Material Name
+ MaterialState.LIQUID, // State
+ TextureSets.NUCLEAR.get(),
+ null, // Material Colour
+ 650, // Melting Point in C
+ 940, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2ZrF4UF4"), // Chemical Formula
+ 5, // Radioactivity Level
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 65),
+ new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 28),
+ new MaterialStack(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE, 5),
+ new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 2)
+ });
+
+ public static final Material LiFBeF2ZrF4U235 = new Material(
+ "LFTR Fuel 1", // Material Name
+ MaterialState.LIQUID, // State
+ TextureSets.NUCLEAR.get(),
+ null, // Material Colour
+ 590, // Melting Point in C
+ 890, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2ZrF4")
+ + StringUtils.superscript("235U"), // Chemical Formula
+ 5, // Radioactivity Level
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 55),
+ new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 25),
+ new MaterialStack(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE, 6),
+ new MaterialStack(ELEMENT.getInstance().URANIUM235, 14)
+ });
+
+ // Misc
+ public static final Material BurntLftrFuel_MK1 = new Material(
+ "Burnt Reactor Fuel I", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiBeF2UF4FP"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().LITHIUM, 1),
+ new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1)
+ });
+
+ public static final Material BurntLftrFuel_MK2 = new Material(
+ "Burnt Reactor Fuel II", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiBeF2UF4FP"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().LITHIUM, 1),
+ new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1)
+ });
+
+ // LFTR Core Fluids
+ public static final Material LiFBeF2UF4FP = new Material(
+ "Uranium Depleted Molten Salt (U Salt)", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2UF4FP"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1)
+ });
+
+ public static final Material Sparged_LiFBeF2UF4FP = new Material(
+ "Helium Sparged U Salt", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2UF4FP"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
+ new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1)
+ });
+
+ public static final Material UF6F2FP = new Material(
+ "Phosphorous Uranium Hexafluoride (P-UF6)", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript("UF6F2FP"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 3),
+ new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1)
+ });
+
+ public static final Material LiFBeF2 = new Material(
+ "Stable Molten Salt Base", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1)
+ });
+
+ public static final Material LiFBeF2UF4 = new Material(
+ "LFTR Fuel Base", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2UF4"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {new MaterialStack(LiFBeF2, 1), new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1)});
+
+ // LFTR Blanket Fluids
+
+ // Tier 1 Fuel blanket output
+ public static final Material LiFThF4 = new Material(
+ "Thorium Depleted Molten Salt (T Salt)", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFThF4"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1)
+ });
+
+ // Tier 2 Fuel blanket output
+ public static final Material LiFBeF2ThF4 = new Material(
+ "Thorium-Beryllium Depleted Molten Salt (TB Salt)", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2ThF4"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1)
+ });
+
+ // Tier 1 Fuel blanket output
+ public static final Material Sparged_LiFThF4 = new Material(
+ "Fluorine Sparged T Salt", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFThF4"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1)
+ });
- public static final Material LiFBeF2ZrF4U235 = new Material(
- "LFTR Fuel 1", //Material Name
- MaterialState.LIQUID, //State
- TextureSets.NUCLEAR.get(),
- null, //Material Colour
- 590, //Melting Point in C
- 890, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2ZrF4")+StringUtils.superscript("235U"), //Chemical Formula
- 5, //Radioactivity Level
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 55),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 25),
- new MaterialStack(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE, 6),
- new MaterialStack(ELEMENT.getInstance().URANIUM235, 14)
- });
-
- // Misc
- public static final Material BurntLftrFuel_MK1 = new Material(
- "Burnt Reactor Fuel I", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiBeF2UF4FP"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().LITHIUM, 1),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1)
- });
-
- public static final Material BurntLftrFuel_MK2 = new Material(
- "Burnt Reactor Fuel II", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiBeF2UF4FP"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().LITHIUM, 1),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1)
- });
-
-
-
- // LFTR Core Fluids
- public static final Material LiFBeF2UF4FP = new Material(
- "Uranium Depleted Molten Salt (U Salt)", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2UF4FP"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1)
- });
-
- public static final Material Sparged_LiFBeF2UF4FP = new Material(
- "Helium Sparged U Salt", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2UF4FP"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1),
- new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1)
- });
-
- public static final Material UF6F2FP = new Material(
- "Phosphorous Uranium Hexafluoride (P-UF6)", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript("UF6F2FP"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 3),
- new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1)
- });
-
- public static final Material LiFBeF2 = new Material(
- "Stable Molten Salt Base", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1)
- });
-
- public static final Material LiFBeF2UF4 = new Material(
- "LFTR Fuel Base", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2UF4"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(LiFBeF2, 1),
- new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1)
- });
-
-
-
-
-
-
- // LFTR Blanket Fluids
+ // Tier 2 Fuel blanket output
+ public static final Material Sparged_LiFBeF2ThF4 = new Material(
+ "Fluorine Sparged TB Salt", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript(StringUtils.superscript("7") + "LiFBeF2ThF4"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
+ new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1)
+ });
- // Tier 1 Fuel blanket output
- public static final Material LiFThF4 = new Material(
- "Thorium Depleted Molten Salt (T Salt)", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFThF4"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1)
- });
-
- // Tier 2 Fuel blanket output
- public static final Material LiFBeF2ThF4 = new Material(
- "Thorium-Beryllium Depleted Molten Salt (TB Salt)", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2ThF4"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1)
- });
-
- // Tier 1 Fuel blanket output
- public static final Material Sparged_LiFThF4 = new Material(
- "Fluorine Sparged T Salt", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFThF4"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1)
- });
-
- // Tier 2 Fuel blanket output
- public static final Material Sparged_LiFBeF2ThF4 = new Material(
- "Fluorine Sparged TB Salt", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2ThF4"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1),
- new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1)
- });
-
- public static final Material UF6F2 = new Material(
- "Fluorinated Uranium Hexafluoride (F-UF6)", //Material Name
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1, //Neutrons
- false, //Uses Blast furnace?
- StringUtils.subscript("UF6F2"), //Chemical Formula
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1),
- new MaterialStack(ELEMENT.getInstance().FLUORINE, 2)
- });
-
-
-
-
-
-
-
-
-
-
-
+ public static final Material UF6F2 = new Material(
+ "Fluorinated Uranium Hexafluoride (F-UF6)", // Material Name
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1, // Neutrons
+ false, // Uses Blast furnace?
+ StringUtils.subscript("UF6F2"), // Chemical Formula
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 2)
+ });
- // Secondary material is molten metal
- public static final Material NAQ_FUEL_T1 = new Material(
- "Naquadah Fuel",
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NAQUADAH, 2),
- new MaterialStack(ELEMENT.getInstance().TANTALUM, 3)
- });
+ // Secondary material is molten metal
+ public static final Material NAQ_FUEL_T1 = new Material(
+ "Naquadah Fuel",
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NAQUADAH, 2),
+ new MaterialStack(ELEMENT.getInstance().TANTALUM, 3)
+ });
- // Secondary material is a plasma
- public static final Material NAQ_FUEL_T2 = new Material(
- "Enriched Naquadah Fuel",
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NAQUADAH_ENRICHED, 2),
- new MaterialStack(ELEMENT.getInstance().TITANIUM, 3)
- });
-
- // Secondary material is a plasma
- public static final Material NAQ_FUEL_T3 = new Material(
- "Naquadria Fuel",
- MaterialState.PURE_LIQUID, //State
- null, //Material Colour
- -1, //Melting Point in C
- -1, //Boiling Point in C
- -1, //Protons
- -1,
- false, //Uses Blast furnace?
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().NAQUADRIA, 2),
- new MaterialStack(ELEMENT.getInstance().AMERICIUM, 3)
- });
-
+ // Secondary material is a plasma
+ public static final Material NAQ_FUEL_T2 = new Material(
+ "Enriched Naquadah Fuel",
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NAQUADAH_ENRICHED, 2),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 3)
+ });
+ // Secondary material is a plasma
+ public static final Material NAQ_FUEL_T3 = new Material(
+ "Naquadria Fuel",
+ MaterialState.PURE_LIQUID, // State
+ null, // Material Colour
+ -1, // Melting Point in C
+ -1, // Boiling Point in C
+ -1, // Protons
+ -1,
+ false, // Uses Blast furnace?
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().NAQUADRIA, 2),
+ new MaterialStack(ELEMENT.getInstance().AMERICIUM, 3)
+ });
- private static final NUCLIDE INSTANCE = new NUCLIDE();
-
- public static NUCLIDE getInstance(){
- return INSTANCE;
- }
+ private static final NUCLIDE INSTANCE = new NUCLIDE();
+ public static NUCLIDE getInstance() {
+ return INSTANCE;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/material/state/MaterialState.java b/src/main/java/gtPlusPlus/core/material/state/MaterialState.java
index 460fe019dc..5b48907656 100644
--- a/src/main/java/gtPlusPlus/core/material/state/MaterialState.java
+++ b/src/main/java/gtPlusPlus/core/material/state/MaterialState.java
@@ -1,18 +1,20 @@
package gtPlusPlus.core.material.state;
public enum MaterialState {
- SOLID(0),
- LIQUID(1),
- GAS(2),
- PLASMA(3),
- PURE_LIQUID(4),
- ORE(5),
- PURE_GAS(6);
- private int STATE;
- private MaterialState (final int State){
- this.STATE = State;
- }
- public int ID() {
- return this.STATE;
- }
+ SOLID(0),
+ LIQUID(1),
+ GAS(2),
+ PLASMA(3),
+ PURE_LIQUID(4),
+ ORE(5),
+ PURE_GAS(6);
+ private int STATE;
+
+ private MaterialState(final int State) {
+ this.STATE = State;
+ }
+
+ public int ID() {
+ return this.STATE;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/network/handler/AbstractClientMessageHandler.java b/src/main/java/gtPlusPlus/core/network/handler/AbstractClientMessageHandler.java
index b7ced2f7e9..548809261f 100644
--- a/src/main/java/gtPlusPlus/core/network/handler/AbstractClientMessageHandler.java
+++ b/src/main/java/gtPlusPlus/core/network/handler/AbstractClientMessageHandler.java
@@ -5,9 +5,8 @@ import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import net.minecraft.entity.player.EntityPlayer;
public abstract class AbstractClientMessageHandler<T extends IMessage> extends AbstractMessageHandler<T> {
-
- public final IMessage handleServerMessage(EntityPlayer player, T message, MessageContext ctx) {
- return null;
- }
-
+
+ public final IMessage handleServerMessage(EntityPlayer player, T message, MessageContext ctx) {
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/network/handler/AbstractMessageHandler.java b/src/main/java/gtPlusPlus/core/network/handler/AbstractMessageHandler.java
index ca350f220f..3c60855c97 100644
--- a/src/main/java/gtPlusPlus/core/network/handler/AbstractMessageHandler.java
+++ b/src/main/java/gtPlusPlus/core/network/handler/AbstractMessageHandler.java
@@ -8,30 +8,27 @@ import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.GTplusplus;
import net.minecraft.entity.player.EntityPlayer;
-public abstract class AbstractMessageHandler <T extends IMessage> implements IMessageHandler <T, IMessage>
-{
- /**
- * Handle a message received on the client side
- * @return a message to send back to the Server, or null if no reply is necessary
- */
- @SideOnly(Side.CLIENT)
- public abstract IMessage handleClientMessage(EntityPlayer player, T message, MessageContext ctx);
-
- /**
- * Handle a message received on the server side
- * @return a message to send back to the Client, or null if no reply is necessary
- */
- public abstract IMessage handleServerMessage(EntityPlayer player, T message, MessageContext ctx);
-
- @Override
- public IMessage onMessage(T message, MessageContext ctx) {
- if (ctx.side.isClient()) {
- return handleClientMessage(GTplusplus.proxy.getPlayerEntity(ctx), message, ctx);
- } else {
- // server side proxy will return the server side EntityPlayer
- return handleServerMessage(GTplusplus.proxy.getPlayerEntity(ctx), message, ctx);
- }
- }
+public abstract class AbstractMessageHandler<T extends IMessage> implements IMessageHandler<T, IMessage> {
+ /**
+ * Handle a message received on the client side
+ * @return a message to send back to the Server, or null if no reply is necessary
+ */
+ @SideOnly(Side.CLIENT)
+ public abstract IMessage handleClientMessage(EntityPlayer player, T message, MessageContext ctx);
+ /**
+ * Handle a message received on the server side
+ * @return a message to send back to the Client, or null if no reply is necessary
+ */
+ public abstract IMessage handleServerMessage(EntityPlayer player, T message, MessageContext ctx);
+ @Override
+ public IMessage onMessage(T message, MessageContext ctx) {
+ if (ctx.side.isClient()) {
+ return handleClientMessage(GTplusplus.proxy.getPlayerEntity(ctx), message, ctx);
+ } else {
+ // server side proxy will return the server side EntityPlayer
+ return handleServerMessage(GTplusplus.proxy.getPlayerEntity(ctx), message, ctx);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/network/handler/AbstractServerMessageHandler.java b/src/main/java/gtPlusPlus/core/network/handler/AbstractServerMessageHandler.java
index d49e6cf350..1529c636ec 100644
--- a/src/main/java/gtPlusPlus/core/network/handler/AbstractServerMessageHandler.java
+++ b/src/main/java/gtPlusPlus/core/network/handler/AbstractServerMessageHandler.java
@@ -6,8 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
public abstract class AbstractServerMessageHandler<T extends IMessage> extends AbstractMessageHandler<T> {
- public final IMessage handleClientMessage(EntityPlayer player, T message, MessageContext ctx) {
- return null;
- }
-
+ public final IMessage handleClientMessage(EntityPlayer player, T message, MessageContext ctx) {
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java b/src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java
index d6368e3d9e..ef43795206 100644
--- a/src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java
+++ b/src/main/java/gtPlusPlus/core/network/packet/AbstractPacket.java
@@ -4,6 +4,5 @@ import cpw.mods.fml.common.network.simpleimpl.IMessage;
public interface AbstractPacket extends IMessage {
- public abstract String getPacketName();
-
+ public abstract String getPacketName();
}
diff --git a/src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui.java b/src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui.java
index 609ea729b7..87c9018a94 100644
--- a/src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui.java
+++ b/src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui.java
@@ -12,117 +12,115 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-public class Packet_VolumetricFlaskGui extends AbstractServerMessageHandler<Packet_VolumetricFlaskGui> implements AbstractPacket {
-
- private int x;
- private int y;
- private int z;
- private int flaskValue;
-
- public Packet_VolumetricFlaskGui() {
-
- }
-
- public Packet_VolumetricFlaskGui(TileEntityVolumetricFlaskSetter tile, int aCustomValue) {
- x = tile.xCoord;
- y = tile.yCoord;
- z = tile.zCoord;
- flaskValue = aCustomValue;
- Logger.INFO("Created Packet with values ("+x+", "+y+", "+z+" | "+flaskValue+")");
- }
-
- @Override
- public void toBytes(ByteBuf buf) {
- buf.writeInt(x);
- buf.writeInt(y);
- buf.writeInt(z);
- buf.writeInt(flaskValue);
- Logger.INFO("Writing to byte buffer.");
- }
-
- @Override
- public void fromBytes(ByteBuf buf) {
- x = buf.readInt();
- y = buf.readInt();
- z = buf.readInt();
- flaskValue = buf.readInt();
- Logger.INFO("Reading from byte buffer.");
- }
-
- public int getX() {
- return x;
- }
-
- public void setX(int x) {
- this.x = x;
- }
-
- public int getY() {
- return y;
- }
-
- public void setY(int y) {
- this.y = y;
- }
-
- public int getZ() {
- return z;
- }
-
- public void setZ(int z) {
- this.z = z;
- }
-
- public int getCustomValue() {
- return flaskValue;
- }
-
- public void setCustomValue(int aVal) {
- this.flaskValue = aVal;
- }
-
- protected TileEntityVolumetricFlaskSetter getTileEntity(Packet_VolumetricFlaskGui message, MessageContext ctx) {
- Logger.INFO("Trying to get tile.");
- World worldObj = getWorld(ctx);
- if(worldObj == null) {
- Logger.INFO("Bad world object.");
- return null;
- }
- TileEntity te = worldObj.getTileEntity(message.getX(), message.getY(), message.getZ());
- if(te == null) {
- Logger.INFO("Bad Tile.");
- return null;
- }
- if(te instanceof TileEntityVolumetricFlaskSetter) {
- Logger.INFO("Found Tile.");
- return (TileEntityVolumetricFlaskSetter) te;
- }
- Logger.INFO("Error.");
- return null;
- }
-
- protected World getWorld(MessageContext ctx) {
- if(ctx.side == Side.SERVER) {
- return ctx.getServerHandler().playerEntity.worldObj;
- } else {
- return GTplusplus.proxy.getClientWorld();
- }
- }
-
- @Override
- public IMessage handleServerMessage(EntityPlayer player, Packet_VolumetricFlaskGui message, MessageContext ctx) {
- TileEntityVolumetricFlaskSetter te = getTileEntity(message, ctx);
- if(te != null) {
- Logger.INFO("Setting value on tile. "+message.getCustomValue());
- te.setCustomValue(message.getCustomValue());
- //return new Packet_VolumetricFlaskGui2(te, message.getCustomValue());
- }
- return null;
- }
-
- @Override
- public String getPacketName() {
- return "Packet_VoluemtricFlaskSetter_ToServer";
- }
-
+public class Packet_VolumetricFlaskGui extends AbstractServerMessageHandler<Packet_VolumetricFlaskGui>
+ implements AbstractPacket {
+
+ private int x;
+ private int y;
+ private int z;
+ private int flaskValue;
+
+ public Packet_VolumetricFlaskGui() {}
+
+ public Packet_VolumetricFlaskGui(TileEntityVolumetricFlaskSetter tile, int aCustomValue) {
+ x = tile.xCoord;
+ y = tile.yCoord;
+ z = tile.zCoord;
+ flaskValue = aCustomValue;
+ Logger.INFO("Created Packet with values (" + x + ", " + y + ", " + z + " | " + flaskValue + ")");
+ }
+
+ @Override
+ public void toBytes(ByteBuf buf) {
+ buf.writeInt(x);
+ buf.writeInt(y);
+ buf.writeInt(z);
+ buf.writeInt(flaskValue);
+ Logger.INFO("Writing to byte buffer.");
+ }
+
+ @Override
+ public void fromBytes(ByteBuf buf) {
+ x = buf.readInt();
+ y = buf.readInt();
+ z = buf.readInt();
+ flaskValue = buf.readInt();
+ Logger.INFO("Reading from byte buffer.");
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public void setY(int y) {
+ this.y = y;
+ }
+
+ public int getZ() {
+ return z;
+ }
+
+ public void setZ(int z) {
+ this.z = z;
+ }
+
+ public int getCustomValue() {
+ return flaskValue;
+ }
+
+ public void setCustomValue(int aVal) {
+ this.flaskValue = aVal;
+ }
+
+ protected TileEntityVolumetricFlaskSetter getTileEntity(Packet_VolumetricFlaskGui message, MessageContext ctx) {
+ Logger.INFO("Trying to get tile.");
+ World worldObj = getWorld(ctx);
+ if (worldObj == null) {
+ Logger.INFO("Bad world object.");
+ return null;
+ }
+ TileEntity te = worldObj.getTileEntity(message.getX(), message.getY(), message.getZ());
+ if (te == null) {
+ Logger.INFO("Bad Tile.");
+ return null;
+ }
+ if (te instanceof TileEntityVolumetricFlaskSetter) {
+ Logger.INFO("Found Tile.");
+ return (TileEntityVolumetricFlaskSetter) te;
+ }
+ Logger.INFO("Error.");
+ return null;
+ }
+
+ protected World getWorld(MessageContext ctx) {
+ if (ctx.side == Side.SERVER) {
+ return ctx.getServerHandler().playerEntity.worldObj;
+ } else {
+ return GTplusplus.proxy.getClientWorld();
+ }
+ }
+
+ @Override
+ public IMessage handleServerMessage(EntityPlayer player, Packet_VolumetricFlaskGui message, MessageContext ctx) {
+ TileEntityVolumetricFlaskSetter te = getTileEntity(message, ctx);
+ if (te != null) {
+ Logger.INFO("Setting value on tile. " + message.getCustomValue());
+ te.setCustomValue(message.getCustomValue());
+ // return new Packet_VolumetricFlaskGui2(te, message.getCustomValue());
+ }
+ return null;
+ }
+
+ @Override
+ public String getPacketName() {
+ return "Packet_VoluemtricFlaskSetter_ToServer";
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui2.java b/src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui2.java
index bc6e6149d8..350b72bbca 100644
--- a/src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui2.java
+++ b/src/main/java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui2.java
@@ -12,116 +12,114 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-public class Packet_VolumetricFlaskGui2 extends AbstractClientMessageHandler<Packet_VolumetricFlaskGui2> implements AbstractPacket {
-
- private int x;
- private int y;
- private int z;
- private int flaskValue;
-
- public Packet_VolumetricFlaskGui2() {
-
- }
-
- public Packet_VolumetricFlaskGui2(TileEntityVolumetricFlaskSetter tile, int aCustomValue) {
- x = tile.xCoord;
- y = tile.yCoord;
- z = tile.zCoord;
- flaskValue = aCustomValue;
- Logger.INFO("Created Packet with values ("+x+", "+y+", "+z+" | "+flaskValue+")");
- }
-
- @Override
- public void toBytes(ByteBuf buf) {
- buf.writeInt(x);
- buf.writeInt(y);
- buf.writeInt(z);
- buf.writeInt(flaskValue);
- Logger.INFO("Writing to byte buffer.");
- }
-
- @Override
- public void fromBytes(ByteBuf buf) {
- x = buf.readInt();
- y = buf.readInt();
- z = buf.readInt();
- flaskValue = buf.readInt();
- Logger.INFO("Reading from byte buffer.");
- }
-
- public int getX() {
- return x;
- }
-
- public void setX(int x) {
- this.x = x;
- }
-
- public int getY() {
- return y;
- }
-
- public void setY(int y) {
- this.y = y;
- }
-
- public int getZ() {
- return z;
- }
-
- public void setZ(int z) {
- this.z = z;
- }
-
- public int getCustomValue() {
- return flaskValue;
- }
-
- public void setCustomValue(int aVal) {
- this.flaskValue = aVal;
- }
-
- protected TileEntityVolumetricFlaskSetter getTileEntity(Packet_VolumetricFlaskGui2 message, MessageContext ctx) {
- Logger.INFO("Trying to get tile.");
- World worldObj = getWorld(ctx);
- if(worldObj == null) {
- Logger.INFO("Bad world object.");
- return null;
- }
- TileEntity te = worldObj.getTileEntity(message.getX(), message.getY(), message.getZ());
- if(te == null) {
- Logger.INFO("Bad Tile.");
- return null;
- }
- if(te instanceof TileEntityVolumetricFlaskSetter) {
- Logger.INFO("Found Tile.");
- return (TileEntityVolumetricFlaskSetter) te;
- }
- Logger.INFO("Error.");
- return null;
- }
-
- protected World getWorld(MessageContext ctx) {
- if(ctx.side == Side.SERVER) {
- return ctx.getServerHandler().playerEntity.worldObj;
- } else {
- return GTplusplus.proxy.getClientWorld();
- }
- }
-
- @Override
- public String getPacketName() {
- return "Packet_VoluemtricFlaskSetter_ToClient";
- }
-
- @Override
- public IMessage handleClientMessage(EntityPlayer player, Packet_VolumetricFlaskGui2 message, MessageContext ctx) {
- TileEntityVolumetricFlaskSetter te = getTileEntity(message, ctx);
- if(te != null) {
- Logger.INFO("Setting value on tile. "+message.getCustomValue());
- te.setCustomValue(message.getCustomValue());
- }
- return null;
- }
-
+public class Packet_VolumetricFlaskGui2 extends AbstractClientMessageHandler<Packet_VolumetricFlaskGui2>
+ implements AbstractPacket {
+
+ private int x;
+ private int y;
+ private int z;
+ private int flaskValue;
+
+ public Packet_VolumetricFlaskGui2() {}
+
+ public Packet_VolumetricFlaskGui2(TileEntityVolumetricFlaskSetter tile, int aCustomValue) {
+ x = tile.xCoord;
+ y = tile.yCoord;
+ z = tile.zCoord;
+ flaskValue = aCustomValue;
+ Logger.INFO("Created Packet with values (" + x + ", " + y + ", " + z + " | " + flaskValue + ")");
+ }
+
+ @Override
+ public void toBytes(ByteBuf buf) {
+ buf.writeInt(x);
+ buf.writeInt(y);
+ buf.writeInt(z);
+ buf.writeInt(flaskValue);
+ Logger.INFO("Writing to byte buffer.");
+ }
+
+ @Override
+ public void fromBytes(ByteBuf buf) {
+ x = buf.readInt();
+ y = buf.readInt();
+ z = buf.readInt();
+ flaskValue = buf.readInt();
+ Logger.INFO("Reading from byte buffer.");
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public void setY(int y) {
+ this.y = y;
+ }
+
+ public int getZ() {
+ return z;
+ }
+
+ public void setZ(int z) {
+ this.z = z;
+ }
+
+ public int getCustomValue() {
+ return flaskValue;
+ }
+
+ public void setCustomValue(int aVal) {
+ this.flaskValue = aVal;
+ }
+
+ protected TileEntityVolumetricFlaskSetter getTileEntity(Packet_VolumetricFlaskGui2 message, MessageContext ctx) {
+ Logger.INFO("Trying to get tile.");
+ World worldObj = getWorld(ctx);
+ if (worldObj == null) {
+ Logger.INFO("Bad world object.");
+ return null;
+ }
+ TileEntity te = worldObj.getTileEntity(message.getX(), message.getY(), message.getZ());
+ if (te == null) {
+ Logger.INFO("Bad Tile.");
+ return null;
+ }
+ if (te instanceof TileEntityVolumetricFlaskSetter) {
+ Logger.INFO("Found Tile.");
+ return (TileEntityVolumetricFlaskSetter) te;
+ }
+ Logger.INFO("Error.");
+ return null;
+ }
+
+ protected World getWorld(MessageContext ctx) {
+ if (ctx.side == Side.SERVER) {
+ return ctx.getServerHandler().playerEntity.worldObj;
+ } else {
+ return GTplusplus.proxy.getClientWorld();
+ }
+ }
+
+ @Override
+ public String getPacketName() {
+ return "Packet_VoluemtricFlaskSetter_ToClient";
+ }
+
+ @Override
+ public IMessage handleClientMessage(EntityPlayer player, Packet_VolumetricFlaskGui2 message, MessageContext ctx) {
+ TileEntityVolumetricFlaskSetter te = getTileEntity(message, ctx);
+ if (te != null) {
+ Logger.INFO("Setting value on tile. " + message.getCustomValue());
+ te.setCustomValue(message.getCustomValue());
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/players/FakeFarmer.java b/src/main/java/gtPlusPlus/core/players/FakeFarmer.java
index ef9ee3c3e7..ad47cce495 100644
--- a/src/main/java/gtPlusPlus/core/players/FakeFarmer.java
+++ b/src/main/java/gtPlusPlus/core/players/FakeFarmer.java
@@ -1,11 +1,8 @@
package gtPlusPlus.core.players;
-import java.util.UUID;
-
import com.mojang.authlib.GameProfile;
-
import cpw.mods.fml.common.FMLCommonHandler;
-
+import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -19,68 +16,66 @@ import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
public class FakeFarmer extends EntityPlayerMP {
- private static final UUID uuid = UUID.fromString("c1ddfd7f-120a-4437-8b64-38660d3ec62d");
-
- private static GameProfile FAKE_PROFILE = new GameProfile(uuid, "[GT_Farm_Manager]");
-
- public FakeFarmer(final WorldServer world) {
- super(FMLCommonHandler.instance().getMinecraftServerInstance(), world, FAKE_PROFILE, new ItemInWorldManager(world));
- }
-
- @Override
- public boolean canCommandSenderUseCommand(final int i, final String s) {
- return false;
- }
-
- @Override
- public ChunkCoordinates getPlayerCoordinates() {
- return new ChunkCoordinates(0, 0, 0);
- }
-
- @Override
- public void addChatComponentMessage(final IChatComponent chatmessagecomponent) {
- }
-
- @Override
- public void addChatMessage(final IChatComponent p_145747_1_) {
- }
-
- @Override
- public void addStat(final StatBase par1StatBase, final int par2) {
- }
-
- @Override
- public void openGui(final Object mod, final int modGuiId, final World world, final int x, final int y, final int z) {
- }
-
- @Override
- public boolean isEntityInvulnerable() {
- return true;
- }
-
- @Override
- public boolean canAttackPlayer(final EntityPlayer player) {
- return false;
- }
-
- @Override
- public void onDeath(final DamageSource source) {
- }
-
- @Override
- public void onUpdate() {
- }
-
- @Override
- public void travelToDimension(final int dim) {
- }
-
- @Override
- public void func_147100_a(final C15PacketClientSettings pkt) {
- }
-
- @Override
- public boolean canPlayerEdit(final int par1, final int par2, final int par3, final int par4, final ItemStack par5ItemStack) {
- return true;
- }
-} \ No newline at end of file
+ private static final UUID uuid = UUID.fromString("c1ddfd7f-120a-4437-8b64-38660d3ec62d");
+
+ private static GameProfile FAKE_PROFILE = new GameProfile(uuid, "[GT_Farm_Manager]");
+
+ public FakeFarmer(final WorldServer world) {
+ super(
+ FMLCommonHandler.instance().getMinecraftServerInstance(),
+ world,
+ FAKE_PROFILE,
+ new ItemInWorldManager(world));
+ }
+
+ @Override
+ public boolean canCommandSenderUseCommand(final int i, final String s) {
+ return false;
+ }
+
+ @Override
+ public ChunkCoordinates getPlayerCoordinates() {
+ return new ChunkCoordinates(0, 0, 0);
+ }
+
+ @Override
+ public void addChatComponentMessage(final IChatComponent chatmessagecomponent) {}
+
+ @Override
+ public void addChatMessage(final IChatComponent p_145747_1_) {}
+
+ @Override
+ public void addStat(final StatBase par1StatBase, final int par2) {}
+
+ @Override
+ public void openGui(
+ final Object mod, final int modGuiId, final World world, final int x, final int y, final int z) {}
+
+ @Override
+ public boolean isEntityInvulnerable() {
+ return true;
+ }
+
+ @Override
+ public boolean canAttackPlayer(final EntityPlayer player) {
+ return false;
+ }
+
+ @Override
+ public void onDeath(final DamageSource source) {}
+
+ @Override
+ public void onUpdate() {}
+
+ @Override
+ public void travelToDimension(final int dim) {}
+
+ @Override
+ public void func_147100_a(final C15PacketClientSettings pkt) {}
+
+ @Override
+ public boolean canPlayerEdit(
+ final int par1, final int par2, final int par3, final int par4, final ItemStack par5ItemStack) {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/potion/GtPotionEffect.java b/src/main/java/gtPlusPlus/core/potion/GtPotionEffect.java
index fa31f68389..65e7d20af0 100644
--- a/src/main/java/gtPlusPlus/core/potion/GtPotionEffect.java
+++ b/src/main/java/gtPlusPlus/core/potion/GtPotionEffect.java
@@ -3,9 +3,8 @@ package gtPlusPlus.core.potion;
import net.minecraft.potion.PotionEffect;
public class GtPotionEffect extends PotionEffect {
-
- public GtPotionEffect(int aPotionID, int aDurationInSecs, int aLevel) {
- super(aPotionID, aDurationInSecs * 20, aLevel, false);
- }
+ public GtPotionEffect(int aPotionID, int aDurationInSecs, int aLevel) {
+ super(aPotionID, aDurationInSecs * 20, aLevel, false);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java
index 6c940adc1d..fbc057f472 100644
--- a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java
+++ b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.proxy;
-import java.util.ArrayList;
-
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -36,6 +34,7 @@ import gtPlusPlus.core.util.minecraft.particles.EntityParticleFXMysterious;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.render.*;
import ic2.core.item.ItemFluidCell;
+import java.util.ArrayList;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.entity.RenderFireball;
@@ -49,241 +48,224 @@ import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.fluids.*;
-public class ClientProxy extends CommonProxy implements Runnable{
-
- private final GTPP_CapeRenderer mCapeRenderer;
- @SideOnly(Side.CLIENT)
- public static boolean mFancyGraphics = false;
-
- public ClientProxy(){
- mCapeRenderer = new GTPP_CapeRenderer();
- //Get Graphics Mode.
- mFancyGraphics = Minecraft.isFancyGraphicsEnabled();
- }
-
- @SubscribeEvent
- public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) {
- if (ConfigSwitches.enableCustomCapes){
- mCapeRenderer.receiveRenderSpecialsEvent(aEvent);
- }
- }
-
- @SideOnly(Side.CLIENT)
- public static String playerName = "";
-
- @Override
- public void preInit(final FMLPreInitializationEvent e) {
- super.preInit(e);
- if (ConfigSwitches.enableCustomCapes){
- onPreLoad();
- }
- //Do this weird things for textures.
- GTplusplus.loadTextures();
- //We boot up the sneak manager.
- if (LoadedMods.PlayerAPI){
- this.init_PlayerAPI_PRE();
- }
- }
-
- @Override
- public void init(final FMLInitializationEvent e) {
- if (LoadedMods.PlayerAPI){
- this.init_PlayerAPI_INIT();
- }
-
- /**
- * Custom Block Renderers
- */
- new CustomOreBlockRenderer();
- new CustomItemBlockRenderer();
- new GTPP_Render_MachineBlock();
-
- if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
- new GTPP_FlaskRenderer();
- }
-
- super.init(e);
- }
-
- @Override
- public void postInit(final FMLPostInitializationEvent e) {
- super.postInit(e);
- }
-
- @Override
- public void registerRenderThings(){
-
- // Standard GT++
-
- /**
- * Entities
- */
-
- RenderingRegistry.registerEntityRenderingHandler(EntityPrimedMiningExplosive.class, new RenderMiningExplosivesPrimed());
- RenderingRegistry.registerEntityRenderingHandler(EntitySickBlaze.class, new RenderSickBlaze());
- RenderingRegistry.registerEntityRenderingHandler(EntityStaballoyConstruct.class, new RenderStaballoyConstruct());
- RenderingRegistry.registerEntityRenderingHandler(EntityToxinballSmall.class, new RenderToxinball(1F));
- RenderingRegistry.registerEntityRenderingHandler(EntitySulfuricAcidPotion.class, new RenderSnowball(ModItems.itemSulfuricPotion));
- RenderingRegistry.registerEntityRenderingHandler(EntityHydrofluoricAcidPotion.class, new RenderSnowball(ModItems.itemHydrofluoricPotion));
- RenderingRegistry.registerEntityRenderingHandler(EntityTeslaTowerLightning.class, new RenderPlasmaBolt());
- RenderingRegistry.registerEntityRenderingHandler(EntityGiantChickenBase.class, new RenderGiantChicken(new ModelGiantChicken(), 1f));
- RenderingRegistry.registerEntityRenderingHandler(EntityBatKing.class, new RenderBatKing());
- RenderingRegistry.registerEntityRenderingHandler(EntityThrowableBomb.class, new RenderSnowball(ModItems.itemBomb, 1));
- RenderingRegistry.registerEntityRenderingHandler(EntityLightningAttack.class, new RenderFireball(1F));
-
- /**
- * Tiles
- */
-
- Logger.INFO("Registering Custom Renderer for the Fire Pit.");
- ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFirepit.class, new FirepitRender());
- Logger.INFO("Registering Custom Renderer for the Lead Lined Chest.");
- ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecayablesChest.class, new RenderDecayChest());
- Logger.INFO("Registering Custom Renderer for the Egg Box.");
- //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEggBox.class, ModelEggBox.getRenderer());
-
-
- //GT++ Australia
-
- /**
- * Entities
- */
-
- RenderingRegistry.registerEntityRenderingHandler(EntityAustralianSpiderBase.class, new RenderAustralianSpider());
- RenderingRegistry.registerEntityRenderingHandler(EntityBoar.class, new RenderBoar(new ModelBoar(), new ModelBoar(0.5F), 0.7F));
- RenderingRegistry.registerEntityRenderingHandler(EntityDingo.class, new RenderDingo(new ModelDingo(), new ModelDingo(), 0.5F));
- RenderingRegistry.registerEntityRenderingHandler(EntityOctopus.class, new RenderOctopus(new ModelOctopus(), 0.7F));
-
-
-
-
-
-
-
- /**
- * Items
- */
- for (Pair<Item, IItemRenderer> sItemRenderMappings : mItemRenderMappings) {
- MinecraftForgeClient.registerItemRenderer(sItemRenderMappings.getKey(), sItemRenderMappings.getValue());
- }
-
- }
-
- @Override
- public int addArmor(final String armor){
- return RenderingRegistry.addNewArmourRendererPrefix(armor);
- }
-
- @Override
- public void generateMysteriousParticles(final Entity theEntity)
- {
- final double motionX = theEntity.worldObj.rand.nextGaussian() * 0.02D;
- final double motionY = theEntity.worldObj.rand.nextGaussian() * 0.02D;
- final double motionZ = theEntity.worldObj.rand.nextGaussian() * 0.02D;
- final EntityFX particleMysterious = new EntityParticleFXMysterious(
-
- theEntity.worldObj,
- (theEntity.posX + (theEntity.worldObj.rand.nextFloat() * theEntity.width
-
- * 2.0F)) - theEntity.width,
- theEntity.posY + 0.5D + (theEntity.worldObj.rand.nextFloat()
-
- * theEntity.height),
- (theEntity.posZ + (theEntity.worldObj.rand.nextFloat() * theEntity.width
-
- * 2.0F)) - theEntity.width,
-
- motionX,
-
- motionY,
-
- motionZ);
- Minecraft.getMinecraft().effectRenderer.addEffect(particleMysterious);
- }
-
- @Override
- public void serverStarting(final FMLServerStartingEvent e)
- {
-
- }
-
- @Optional.Method(modid = "PlayerAPI")
- private void init_PlayerAPI_PRE(){
- //Register player instance
- COMPAT_PlayerAPI.clientProxy.initPre();
- }
-
- @Optional.Method(modid = "PlayerAPI")
- private void init_PlayerAPI_INIT(){
- //Register player instance
- COMPAT_PlayerAPI.clientProxy.Init();
- }
-
-
-
- public void onPreLoad() {
- /*if (ConfigSwitches.enableCustomCapes){
- String arr$[] = {
- "draknyte1", "fobius"
- };
- int len$ = arr$.length;
- for (int i$ = 0; i$ < len$; i$++) {
- String tName = arr$[i$];
- mCapeList.add(tName.toLowerCase());
- }
- (new Thread(this)).start();
- }*/
- }
-
- @Override
- public void run() {
- /*try {
- if (ConfigSwitches.enableCustomCapes){
- Logger.INFO("GT++ Mod: Downloading Cape List.");
- @SuppressWarnings("resource")
- Scanner tScanner = new Scanner(new URL("https://github.com/draknyte1/GTplusplus/blob/master/SupporterList.txt").openStream());
- while (tScanner.hasNextLine()) {
- String tName = tScanner.nextLine();
- if (!this.mCapeList.contains(tName.toLowerCase())) {
- this.mCapeList.add(tName.toLowerCase());
- }
- }
- }
- } catch (Throwable e) {
- Logger.INFO("Failed to download GT++ cape list.");
- }*/
- }
-
- @Override
- public void onLoadComplete(FMLLoadCompleteEvent event) {
- GTplusplus.tryPatchTurbineTextures();
- if (CORE.ConfigSwitches.hideUniversalCells) {
- hideUniversalCells();
- }
- super.onLoadComplete(event);
- }
-
- public void hideUniversalCells() {
- ArrayList<ItemStack> itemList = new ArrayList<ItemStack>();
- for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) {
- if (fluid == null) {
- continue;
- }
- itemList.add(ItemFluidCell.getUniversalFluidCell(new FluidStack(fluid, 2147483647)));
- }
- for (ItemStack aCell : itemList) {
- codechicken.nei.api.API.hideItem(aCell);
- }
- }
-
- @Override
- public World getClientWorld() {
- return FMLClientHandler.instance().getClient().theWorld;
- }
-
- @Override
- public EntityPlayer getPlayerEntity(MessageContext ctx) {
- return (ctx.side.isClient() ? Minecraft.getMinecraft().thePlayer : super.getPlayerEntity(ctx));
- }
-
+public class ClientProxy extends CommonProxy implements Runnable {
+
+ private final GTPP_CapeRenderer mCapeRenderer;
+
+ @SideOnly(Side.CLIENT)
+ public static boolean mFancyGraphics = false;
+
+ public ClientProxy() {
+ mCapeRenderer = new GTPP_CapeRenderer();
+ // Get Graphics Mode.
+ mFancyGraphics = Minecraft.isFancyGraphicsEnabled();
+ }
+
+ @SubscribeEvent
+ public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) {
+ if (ConfigSwitches.enableCustomCapes) {
+ mCapeRenderer.receiveRenderSpecialsEvent(aEvent);
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public static String playerName = "";
+
+ @Override
+ public void preInit(final FMLPreInitializationEvent e) {
+ super.preInit(e);
+ if (ConfigSwitches.enableCustomCapes) {
+ onPreLoad();
+ }
+ // Do this weird things for textures.
+ GTplusplus.loadTextures();
+ // We boot up the sneak manager.
+ if (LoadedMods.PlayerAPI) {
+ this.init_PlayerAPI_PRE();
+ }
+ }
+
+ @Override
+ public void init(final FMLInitializationEvent e) {
+ if (LoadedMods.PlayerAPI) {
+ this.init_PlayerAPI_INIT();
+ }
+
+ /**
+ * Custom Block Renderers
+ */
+ new CustomOreBlockRenderer();
+ new CustomItemBlockRenderer();
+ new GTPP_Render_MachineBlock();
+
+ if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
+ new GTPP_FlaskRenderer();
+ }
+
+ super.init(e);
+ }
+
+ @Override
+ public void postInit(final FMLPostInitializationEvent e) {
+ super.postInit(e);
+ }
+
+ @Override
+ public void registerRenderThings() {
+
+ // Standard GT++
+
+ /**
+ * Entities
+ */
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityPrimedMiningExplosive.class, new RenderMiningExplosivesPrimed());
+ RenderingRegistry.registerEntityRenderingHandler(EntitySickBlaze.class, new RenderSickBlaze());
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityStaballoyConstruct.class, new RenderStaballoyConstruct());
+ RenderingRegistry.registerEntityRenderingHandler(EntityToxinballSmall.class, new RenderToxinball(1F));
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntitySulfuricAcidPotion.class, new RenderSnowball(ModItems.itemSulfuricPotion));
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityHydrofluoricAcidPotion.class, new RenderSnowball(ModItems.itemHydrofluoricPotion));
+ RenderingRegistry.registerEntityRenderingHandler(EntityTeslaTowerLightning.class, new RenderPlasmaBolt());
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityGiantChickenBase.class, new RenderGiantChicken(new ModelGiantChicken(), 1f));
+ RenderingRegistry.registerEntityRenderingHandler(EntityBatKing.class, new RenderBatKing());
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityThrowableBomb.class, new RenderSnowball(ModItems.itemBomb, 1));
+ RenderingRegistry.registerEntityRenderingHandler(EntityLightningAttack.class, new RenderFireball(1F));
+
+ /**
+ * Tiles
+ */
+ Logger.INFO("Registering Custom Renderer for the Fire Pit.");
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFirepit.class, new FirepitRender());
+ Logger.INFO("Registering Custom Renderer for the Lead Lined Chest.");
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecayablesChest.class, new RenderDecayChest());
+ Logger.INFO("Registering Custom Renderer for the Egg Box.");
+ // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEggBox.class, ModelEggBox.getRenderer());
+
+ // GT++ Australia
+
+ /**
+ * Entities
+ */
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityAustralianSpiderBase.class, new RenderAustralianSpider());
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityBoar.class, new RenderBoar(new ModelBoar(), new ModelBoar(0.5F), 0.7F));
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityDingo.class, new RenderDingo(new ModelDingo(), new ModelDingo(), 0.5F));
+ RenderingRegistry.registerEntityRenderingHandler(
+ EntityOctopus.class, new RenderOctopus(new ModelOctopus(), 0.7F));
+
+ /**
+ * Items
+ */
+ for (Pair<Item, IItemRenderer> sItemRenderMappings : mItemRenderMappings) {
+ MinecraftForgeClient.registerItemRenderer(sItemRenderMappings.getKey(), sItemRenderMappings.getValue());
+ }
+ }
+
+ @Override
+ public int addArmor(final String armor) {
+ return RenderingRegistry.addNewArmourRendererPrefix(armor);
+ }
+
+ @Override
+ public void generateMysteriousParticles(final Entity theEntity) {
+ final double motionX = theEntity.worldObj.rand.nextGaussian() * 0.02D;
+ final double motionY = theEntity.worldObj.rand.nextGaussian() * 0.02D;
+ final double motionZ = theEntity.worldObj.rand.nextGaussian() * 0.02D;
+ final EntityFX particleMysterious = new EntityParticleFXMysterious(
+ theEntity.worldObj,
+ (theEntity.posX + (theEntity.worldObj.rand.nextFloat() * theEntity.width * 2.0F)) - theEntity.width,
+ theEntity.posY + 0.5D + (theEntity.worldObj.rand.nextFloat() * theEntity.height),
+ (theEntity.posZ + (theEntity.worldObj.rand.nextFloat() * theEntity.width * 2.0F)) - theEntity.width,
+ motionX,
+ motionY,
+ motionZ);
+ Minecraft.getMinecraft().effectRenderer.addEffect(particleMysterious);
+ }
+
+ @Override
+ public void serverStarting(final FMLServerStartingEvent e) {}
+
+ @Optional.Method(modid = "PlayerAPI")
+ private void init_PlayerAPI_PRE() {
+ // Register player instance
+ COMPAT_PlayerAPI.clientProxy.initPre();
+ }
+
+ @Optional.Method(modid = "PlayerAPI")
+ private void init_PlayerAPI_INIT() {
+ // Register player instance
+ COMPAT_PlayerAPI.clientProxy.Init();
+ }
+
+ public void onPreLoad() {
+ /*if (ConfigSwitches.enableCustomCapes){
+ String arr$[] = {
+ "draknyte1", "fobius"
+ };
+ int len$ = arr$.length;
+ for (int i$ = 0; i$ < len$; i$++) {
+ String tName = arr$[i$];
+ mCapeList.add(tName.toLowerCase());
+ }
+ (new Thread(this)).start();
+ }*/
+ }
+
+ @Override
+ public void run() {
+ /*try {
+ if (ConfigSwitches.enableCustomCapes){
+ Logger.INFO("GT++ Mod: Downloading Cape List.");
+ @SuppressWarnings("resource")
+ Scanner tScanner = new Scanner(new URL("https://github.com/draknyte1/GTplusplus/blob/master/SupporterList.txt").openStream());
+ while (tScanner.hasNextLine()) {
+ String tName = tScanner.nextLine();
+ if (!this.mCapeList.contains(tName.toLowerCase())) {
+ this.mCapeList.add(tName.toLowerCase());
+ }
+ }
+ }
+ } catch (Throwable e) {
+ Logger.INFO("Failed to download GT++ cape list.");
+ }*/
+ }
+
+ @Override
+ public void onLoadComplete(FMLLoadCompleteEvent event) {
+ GTplusplus.tryPatchTurbineTextures();
+ if (CORE.ConfigSwitches.hideUniversalCells) {
+ hideUniversalCells();
+ }
+ super.onLoadComplete(event);
+ }
+
+ public void hideUniversalCells() {
+ ArrayList<ItemStack> itemList = new ArrayList<ItemStack>();
+ for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) {
+ if (fluid == null) {
+ continue;
+ }
+ itemList.add(ItemFluidCell.getUniversalFluidCell(new FluidStack(fluid, 2147483647)));
+ }
+ for (ItemStack aCell : itemList) {
+ codechicken.nei.api.API.hideItem(aCell);
+ }
+ }
+
+ @Override
+ public World getClientWorld() {
+ return FMLClientHandler.instance().getClient().theWorld;
+ }
+
+ @Override
+ public EntityPlayer getPlayerEntity(MessageContext ctx) {
+ return (ctx.side.isClient() ? Minecraft.getMinecraft().thePlayer : super.getPlayerEntity(ctx));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/proxy/ServerProxy.java b/src/main/java/gtPlusPlus/core/proxy/ServerProxy.java
index 8aeeb70191..ed1674cb3a 100644
--- a/src/main/java/gtPlusPlus/core/proxy/ServerProxy.java
+++ b/src/main/java/gtPlusPlus/core/proxy/ServerProxy.java
@@ -3,27 +3,25 @@ package gtPlusPlus.core.proxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-
import gtPlusPlus.core.common.CommonProxy;
-public class ServerProxy extends CommonProxy{
-
- @Override
- public void preInit(final FMLPreInitializationEvent e) {
- // TODO Auto-generated method stub
- super.preInit(e);
- }
+public class ServerProxy extends CommonProxy {
- @Override
- public void init(final FMLInitializationEvent e) {
- // TODO Auto-generated method stub
- super.init(e);
- }
+ @Override
+ public void preInit(final FMLPreInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.preInit(e);
+ }
- @Override
- public void postInit(final FMLPostInitializationEvent e) {
- // TODO Auto-generated method stub
- super.postInit(e);
- }
+ @Override
+ public void init(final FMLInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.init(e);
+ }
+ @Override
+ public void postInit(final FMLPostInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.postInit(e);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java b/src/main/java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java
index b5fc9c3995..9348584e34 100644
--- a/src/main/java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java
+++ b/src/main/java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java
@@ -1,100 +1,109 @@
package gtPlusPlus.core.recipe;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
public class Gregtech_Recipe_Adder {
- private static int euT;
- private static int ticks;
- private static ItemStack inputStack1;
- private static ItemStack inputStack2;
- private static ItemStack outputStack1;
- private static ItemStack outputStack2;
-
- public static void addRecipe(
- final Item maceratorInput, final int maceratorInputAmount1,
- final Item maceratorOutput, final int maceratorOutputAmount1,
- final Item compressorInput, final int compressorInputAmount1,
- final Item compressorOutput, final int compressorOutputAmount1,
- final Item blastFurnaceInput, final int blastFurnaceInputAmount1,
- final Item blastFurnaceOutput, final int blastFurnaceOutputAmount1,
- final Item blastFurnaceInput2, final int blastFurnaceInputAmount2,
- final Item blastFurnaceOutput2, final int blastFurnaceOutputAmount2,
- final Item smeltingInput, final int smeltingInputAmount1,
- final Item smeltingOutput, final int smeltingOutputAmount1,
-
- final int euPerTick, final int timeInTicks,
- final boolean addMaceratorRecipe, final boolean addCompressorRecipe, final boolean addBlastFurnaceRecipe, final int blastFurnaceTemp, final boolean addSmeltingRecipe, final boolean addMixerRecipe){
- euT = euPerTick;
- ticks = timeInTicks;
-
- resetVars();
- if (addMaceratorRecipe){
- inputStack1 = ItemUtils.getSimpleStack(maceratorInput, maceratorInputAmount1);
- outputStack1 = ItemUtils.getSimpleStack(maceratorOutput, maceratorOutputAmount1);
- addMaceratorRecipe(inputStack1, outputStack1);
- }
- resetVars();
- if (addCompressorRecipe){
- inputStack1 = ItemUtils.getSimpleStack(compressorInput, compressorInputAmount1);
- outputStack1 = ItemUtils.getSimpleStack(compressorOutput, compressorOutputAmount1);
- addCompressorRecipe(inputStack1, outputStack1);
- }
- resetVars();
- if (addBlastFurnaceRecipe){
- inputStack1 = ItemUtils.getSimpleStack(blastFurnaceInput, blastFurnaceInputAmount1);
- inputStack2 = ItemUtils.getSimpleStack(blastFurnaceInput2, blastFurnaceInputAmount2);
- outputStack1 = ItemUtils.getSimpleStack(blastFurnaceOutput, blastFurnaceOutputAmount1);
- outputStack2 = ItemUtils.getSimpleStack(blastFurnaceOutput2, blastFurnaceOutputAmount2);
- addBlastFurnaceRecipe(inputStack1, inputStack2, outputStack1, outputStack2, blastFurnaceTemp);
- }
- resetVars();
- if (addSmeltingRecipe){
- inputStack1 = ItemUtils.getSimpleStack(smeltingInput, smeltingInputAmount1);
- outputStack1 = ItemUtils.getSimpleStack(smeltingOutput, smeltingOutputAmount1);
- addSmeltingRecipe(inputStack1, outputStack1);
- }
- resetVars();
+ private static int euT;
+ private static int ticks;
+ private static ItemStack inputStack1;
+ private static ItemStack inputStack2;
+ private static ItemStack outputStack1;
+ private static ItemStack outputStack2;
- }
+ public static void addRecipe(
+ final Item maceratorInput,
+ final int maceratorInputAmount1,
+ final Item maceratorOutput,
+ final int maceratorOutputAmount1,
+ final Item compressorInput,
+ final int compressorInputAmount1,
+ final Item compressorOutput,
+ final int compressorOutputAmount1,
+ final Item blastFurnaceInput,
+ final int blastFurnaceInputAmount1,
+ final Item blastFurnaceOutput,
+ final int blastFurnaceOutputAmount1,
+ final Item blastFurnaceInput2,
+ final int blastFurnaceInputAmount2,
+ final Item blastFurnaceOutput2,
+ final int blastFurnaceOutputAmount2,
+ final Item smeltingInput,
+ final int smeltingInputAmount1,
+ final Item smeltingOutput,
+ final int smeltingOutputAmount1,
+ final int euPerTick,
+ final int timeInTicks,
+ final boolean addMaceratorRecipe,
+ final boolean addCompressorRecipe,
+ final boolean addBlastFurnaceRecipe,
+ final int blastFurnaceTemp,
+ final boolean addSmeltingRecipe,
+ final boolean addMixerRecipe) {
+ euT = euPerTick;
+ ticks = timeInTicks;
- private static void resetVars(){
- inputStack1 = null;
- inputStack2 = null;
- outputStack1 = null;
- outputStack2 = null;
- }
+ resetVars();
+ if (addMaceratorRecipe) {
+ inputStack1 = ItemUtils.getSimpleStack(maceratorInput, maceratorInputAmount1);
+ outputStack1 = ItemUtils.getSimpleStack(maceratorOutput, maceratorOutputAmount1);
+ addMaceratorRecipe(inputStack1, outputStack1);
+ }
+ resetVars();
+ if (addCompressorRecipe) {
+ inputStack1 = ItemUtils.getSimpleStack(compressorInput, compressorInputAmount1);
+ outputStack1 = ItemUtils.getSimpleStack(compressorOutput, compressorOutputAmount1);
+ addCompressorRecipe(inputStack1, outputStack1);
+ }
+ resetVars();
+ if (addBlastFurnaceRecipe) {
+ inputStack1 = ItemUtils.getSimpleStack(blastFurnaceInput, blastFurnaceInputAmount1);
+ inputStack2 = ItemUtils.getSimpleStack(blastFurnaceInput2, blastFurnaceInputAmount2);
+ outputStack1 = ItemUtils.getSimpleStack(blastFurnaceOutput, blastFurnaceOutputAmount1);
+ outputStack2 = ItemUtils.getSimpleStack(blastFurnaceOutput2, blastFurnaceOutputAmount2);
+ addBlastFurnaceRecipe(inputStack1, inputStack2, outputStack1, outputStack2, blastFurnaceTemp);
+ }
+ resetVars();
+ if (addSmeltingRecipe) {
+ inputStack1 = ItemUtils.getSimpleStack(smeltingInput, smeltingInputAmount1);
+ outputStack1 = ItemUtils.getSimpleStack(smeltingOutput, smeltingOutputAmount1);
+ addSmeltingRecipe(inputStack1, outputStack1);
+ }
+ resetVars();
+ }
- private static void addMaceratorRecipe(final ItemStack input1, final ItemStack output1){
- GT_ModHandler.addPulverisationRecipe(input1, output1);
- }
+ private static void resetVars() {
+ inputStack1 = null;
+ inputStack2 = null;
+ outputStack1 = null;
+ outputStack2 = null;
+ }
- private static void addCompressorRecipe(final ItemStack input1, final ItemStack output1){
- GT_ModHandler.addCompressionRecipe(input1, output1);
- }
+ private static void addMaceratorRecipe(final ItemStack input1, final ItemStack output1) {
+ GT_ModHandler.addPulverisationRecipe(input1, output1);
+ }
- private static void addBlastFurnaceRecipe(final ItemStack input1, final ItemStack input2, final ItemStack output1, final ItemStack output2, final int tempRequired){
- Logger.INFO("Registering Blast Furnace Recipes.");
- GT_Values.RA.addBlastRecipe(
- input1,
- input2,
- GT_Values.NF, GT_Values.NF,
- output1,
- output2,
- ticks,
- euT,
- tempRequired);
- }
+ private static void addCompressorRecipe(final ItemStack input1, final ItemStack output1) {
+ GT_ModHandler.addCompressionRecipe(input1, output1);
+ }
- private static void addSmeltingRecipe(final ItemStack input1, final ItemStack output1){
- GT_ModHandler.addSmeltingRecipe(input1, output1);
- }
+ private static void addBlastFurnaceRecipe(
+ final ItemStack input1,
+ final ItemStack input2,
+ final ItemStack output1,
+ final ItemStack output2,
+ final int tempRequired) {
+ Logger.INFO("Registering Blast Furnace Recipes.");
+ GT_Values.RA.addBlastRecipe(
+ input1, input2, GT_Values.NF, GT_Values.NF, output1, output2, ticks, euT, tempRequired);
+ }
+ private static void addSmeltingRecipe(final ItemStack input1, final ItemStack output1) {
+ GT_ModHandler.addSmeltingRecipe(input1, output1);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java b/src/main/java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java
index c77db21800..07622ee65b 100644
--- a/src/main/java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java
+++ b/src/main/java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java
@@ -1,7 +1,6 @@
package gtPlusPlus.core.recipe;
import gregtech.api.enums.ItemList;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
@@ -9,233 +8,241 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
public class LOADER_Machine_Components {
- public static void initialise(){
-
- registerDefaultComponents();
-
- if (!CORE.GTNH){
- if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- registerGTExperimentalComponents();
- }
- else {
- registerGTStandardComponents();
- }
- }
- else {
- registerGTNHComponents();
- }
- }
-
- private static void registerDefaultComponents(){
- //Machine Components
- CI.electricMotor_LV = ItemList.Electric_Motor_LV.get(1);
- CI.electricMotor_MV = ItemList.Electric_Motor_MV.get(1);
- CI.electricMotor_HV = ItemList.Electric_Motor_HV.get(1);
- CI.electricMotor_EV = ItemList.Electric_Motor_EV.get(1);
- CI.electricMotor_IV = ItemList.Electric_Motor_IV.get(1);
- CI.electricPump_LV = ItemList.Electric_Pump_LV.get(1);
- CI.electricPump_MV = ItemList.Electric_Pump_MV.get(1);
- CI.electricPump_HV = ItemList.Electric_Pump_HV.get(1);
- CI.electricPump_EV = ItemList.Electric_Pump_EV.get(1);
- CI.electricPump_IV = ItemList.Electric_Pump_IV.get(1);
- CI.electricPiston_LV = ItemList.Electric_Piston_LV.get(1);
- CI.electricPiston_MV = ItemList.Electric_Piston_MV.get(1);
- CI.electricPiston_HV = ItemList.Electric_Piston_HV.get(1);
- CI.electricPiston_EV = ItemList.Electric_Piston_EV.get(1);
- CI.electricPiston_IV = ItemList.Electric_Piston_IV.get(1);
- CI.robotArm_LV = ItemList.Robot_Arm_LV.get(1);
- CI.robotArm_MV = ItemList.Robot_Arm_MV.get(1);
- CI.robotArm_HV = ItemList.Robot_Arm_HV.get(1);
- CI.robotArm_EV = ItemList.Robot_Arm_EV.get(1);
- CI.robotArm_IV = ItemList.Robot_Arm_IV.get(1);
- CI.conveyorModule_LV = ItemList.Conveyor_Module_LV.get(1);
- CI.conveyorModule_MV = ItemList.Conveyor_Module_MV.get(1);
- CI.conveyorModule_HV = ItemList.Conveyor_Module_HV.get(1);
- CI.conveyorModule_EV = ItemList.Conveyor_Module_EV.get(1);
- CI.conveyorModule_IV = ItemList.Conveyor_Module_IV.get(1);
- CI.emitter_LV = ItemList.Emitter_LV.get(1);
- CI.emitter_MV = ItemList.Emitter_MV.get(1);
- CI.emitter_HV = ItemList.Emitter_HV.get(1);
- CI.emitter_EV = ItemList.Emitter_EV.get(1);
- CI.emitter_IV = ItemList.Emitter_IV.get(1);
- CI.fieldGenerator_LV = ItemList.Field_Generator_LV.get(1);
- CI.fieldGenerator_MV = ItemList.Field_Generator_MV.get(1);
- CI.fieldGenerator_HV = ItemList.Field_Generator_HV.get(1);
- CI.fieldGenerator_EV = ItemList.Field_Generator_EV.get(1);
- CI.fieldGenerator_IV = ItemList.Field_Generator_IV.get(1);
- CI.sensor_LV = ItemList.Sensor_LV.get(1);
- CI.sensor_MV = ItemList.Sensor_MV.get(1);
- CI.sensor_HV = ItemList.Sensor_HV.get(1);
- CI.sensor_EV = ItemList.Sensor_EV.get(1);
- CI.sensor_IV = ItemList.Sensor_IV.get(1);
- if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- CI.fluidRegulator_LV = ItemUtils.getValueOfItemList("FluidRegulator_LV", ItemList.Pump_LV).get(1);
- CI.fluidRegulator_MV = ItemUtils.getValueOfItemList("FluidRegulator_MV", ItemList.Pump_MV).get(1);
- CI.fluidRegulator_HV = ItemUtils.getValueOfItemList("FluidRegulator_HV", ItemList.Pump_HV).get(1);
- CI.fluidRegulator_EV = ItemUtils.getValueOfItemList("FluidRegulator_EV", ItemList.Pump_EV).get(1);
- CI.fluidRegulator_IV = ItemUtils.getValueOfItemList("FluidRegulator_IV", ItemList.Pump_IV).get(1);
- }
- }
-
- private static void registerGTExperimentalComponents(){
- //GT++ Machine Components
- CI.electricMotor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32606, 1);
- CI.electricMotor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32607, 1);
- CI.electricMotor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32608, 1);
- CI.electricPump_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32620, 1);
- CI.electricPump_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32621, 1);
- CI.electricPump_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32622, 1);
- CI.electricPiston_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32645, 1);
- CI.electricPiston_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32646, 1);
- CI.electricPiston_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32647, 1);
- CI.robotArm_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32655, 1);
- CI.robotArm_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32656, 1);
- CI.robotArm_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32657, 1);
- CI.conveyorModule_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32636, 1);
- CI.conveyorModule_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32637, 1);
- CI.conveyorModule_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1);
- CI.emitter_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32685, 1);
- CI.emitter_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32686, 1);
- CI.emitter_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32687, 1);
- CI.fieldGenerator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32675, 1);
- CI.fieldGenerator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32676, 1);
- CI.fieldGenerator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32677, 1);
- CI.sensor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1);
- CI.sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1);
- CI.sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1);
-
- if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- CI.fluidRegulator_LuV = ItemUtils.getValueOfItemList("FluidRegulator_LuV", ItemList.Pump_LuV).get(1);
- CI.fluidRegulator_ZPM = ItemUtils.getValueOfItemList("FluidRegulator_ZPM", ItemList.Pump_ZPM).get(1);
- CI.fluidRegulator_UV = ItemUtils.getValueOfItemList("FluidRegulator_UV", ItemList.Pump_UV).get(1);
- }
-
- registerComponentsULV();
- registerComponentsMAX();
- }
-
- private static void registerGTStandardComponents(){
- CI.electricMotor_LuV = GregtechItemList.Electric_Motor_LuV.get(1);
- CI.electricMotor_ZPM = GregtechItemList.Electric_Motor_ZPM.get(1);
- CI.electricMotor_UV = GregtechItemList.Electric_Motor_UV.get(1);
- CI.electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
- CI.electricPump_LuV = GregtechItemList.Electric_Pump_LuV.get(1);
- CI.electricPump_ZPM = GregtechItemList.Electric_Pump_ZPM.get(1);
- CI.electricPump_UV = GregtechItemList.Electric_Pump_UV.get(1);
- CI.electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
- CI.electricPiston_LuV = GregtechItemList.Electric_Piston_LuV.get(1);
- CI.electricPiston_ZPM = GregtechItemList.Electric_Piston_ZPM.get(1);
- CI.electricPiston_UV = GregtechItemList.Electric_Piston_UV.get(1);
- CI.electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
- CI.robotArm_LuV = GregtechItemList.Robot_Arm_LuV.get(1);
- CI.robotArm_ZPM = GregtechItemList.Robot_Arm_ZPM.get(1);
- CI.robotArm_UV = GregtechItemList.Robot_Arm_UV.get(1);
- CI.robotArm_MAX = GregtechItemList.Robot_Arm_MAX.get(1);
- CI.conveyorModule_LuV = GregtechItemList.Conveyor_Module_LuV.get(1);
- CI.conveyorModule_ZPM = GregtechItemList.Conveyor_Module_ZPM.get(1);
- CI.conveyorModule_UV = GregtechItemList.Conveyor_Module_UV.get(1);
- CI.conveyorModule_MAX = GregtechItemList.Conveyor_Module_MAX.get(1);
- CI.emitter_LuV = GregtechItemList.Emitter_LuV.get(1);
- CI.emitter_ZPM = GregtechItemList.Emitter_ZPM.get(1);
- CI.emitter_UV = GregtechItemList.Emitter_UV.get(1);
- CI.emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
- CI.fieldGenerator_LuV = GregtechItemList.Field_Generator_LuV.get(1);
- CI.fieldGenerator_ZPM = GregtechItemList.Field_Generator_ZPM.get(1);
- CI.fieldGenerator_UV = GregtechItemList.Field_Generator_UV.get(1);
- CI.fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
- CI.sensor_LuV = GregtechItemList.Sensor_LuV.get(1);
- CI.sensor_ZPM = GregtechItemList.Sensor_ZPM.get(1);
- CI.sensor_UV = GregtechItemList.Sensor_UV.get(1);
- CI.sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
-
- if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- CI.fluidRegulator_LuV = ItemUtils.getValueOfItemList("FluidRegulator_LuV", ItemList.Pump_LuV).get(1);
- CI.fluidRegulator_ZPM = ItemUtils.getValueOfItemList("FluidRegulator_ZPM", ItemList.Pump_ZPM).get(1);
- CI.fluidRegulator_UV = ItemUtils.getValueOfItemList("FluidRegulator_UV", ItemList.Pump_UV).get(1);
- }
-
- registerComponentsULV();
- }
-
- private static void registerGTNHComponents(){
- //Machine Components
- CI.electricMotor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32606, 1);
- CI.electricMotor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32607, 1);
- CI.electricMotor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32608, 1);
-
- CI.electricPump_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32615, 1);
- CI.electricPump_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32616, 1);
- CI.electricPump_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32617, 1);
-
- CI.electricPiston_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32645, 1);
- CI.electricPiston_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32646, 1);
- CI.electricPiston_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32647, 1);
-
- CI.robotArm_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32655, 1);
- CI.robotArm_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32656, 1);
- CI.robotArm_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32657, 1);
-
- CI.conveyorModule_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32635, 1);
- CI.conveyorModule_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32636, 1);
- CI.conveyorModule_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32637, 1);
-
- CI.emitter_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32685, 1);
- CI.emitter_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32686, 1);
- CI.emitter_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32687, 1);
-
- CI.fieldGenerator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32675, 1);
- CI.fieldGenerator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32676, 1);
- CI.fieldGenerator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32677, 1);
-
- CI.sensor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1);
- CI.sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1);
- CI.sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1);
-
- if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- CI.fluidRegulator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32665, 1);
- CI.fluidRegulator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32666, 1);
- CI.fluidRegulator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32667, 1);
- }
-
- // Thanks 0lafe
- CI.electricMotor_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32596, 1);
- CI.electricPump_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32618, 1);
- CI.electricPiston_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32648, 1);
- CI.robotArm_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32658, 1);
- CI.conveyorModule_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1);
- CI.emitter_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32688, 1);
- CI.fieldGenerator_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32678, 1);
- CI.sensor_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32698, 1);
-
- registerComponentsULV();
- }
-
- private static boolean registerComponentsULV(){
-
- CI.electricMotor_ULV = GregtechItemList.Electric_Motor_ULV.get(1);
- CI.electricPump_ULV = GregtechItemList.Electric_Pump_ULV.get(1);
- CI.electricPiston_ULV = GregtechItemList.Electric_Piston_ULV.get(1);
- CI.robotArm_ULV = GregtechItemList.Robot_Arm_ULV.get(1);
- CI.conveyorModule_ULV = GregtechItemList.Conveyor_Module_ULV.get(1);
- CI.emitter_ULV = GregtechItemList.Emitter_ULV.get(1);
- CI.fieldGenerator_ULV = GregtechItemList.Field_Generator_ULV.get(1);
- CI.sensor_ULV = GregtechItemList.Sensor_ULV.get(1);
- return true;
- }
-
- private static boolean registerComponentsMAX() {
-
- // Max Tier Components Blood Never added... Useless, lol.
- CI.electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
- CI.electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
- CI.electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
- CI.robotArm_MAX = GregtechItemList.Robot_Arm_MAX.get(1);
- CI.conveyorModule_MAX = GregtechItemList.Conveyor_Module_MAX.get(1);
- CI.emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
- CI.fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
- CI.sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
-
- return true;
- }
-
+ public static void initialise() {
+
+ registerDefaultComponents();
+
+ if (!CORE.GTNH) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ registerGTExperimentalComponents();
+ } else {
+ registerGTStandardComponents();
+ }
+ } else {
+ registerGTNHComponents();
+ }
+ }
+
+ private static void registerDefaultComponents() {
+ // Machine Components
+ CI.electricMotor_LV = ItemList.Electric_Motor_LV.get(1);
+ CI.electricMotor_MV = ItemList.Electric_Motor_MV.get(1);
+ CI.electricMotor_HV = ItemList.Electric_Motor_HV.get(1);
+ CI.electricMotor_EV = ItemList.Electric_Motor_EV.get(1);
+ CI.electricMotor_IV = ItemList.Electric_Motor_IV.get(1);
+ CI.electricPump_LV = ItemList.Electric_Pump_LV.get(1);
+ CI.electricPump_MV = ItemList.Electric_Pump_MV.get(1);
+ CI.electricPump_HV = ItemList.Electric_Pump_HV.get(1);
+ CI.electricPump_EV = ItemList.Electric_Pump_EV.get(1);
+ CI.electricPump_IV = ItemList.Electric_Pump_IV.get(1);
+ CI.electricPiston_LV = ItemList.Electric_Piston_LV.get(1);
+ CI.electricPiston_MV = ItemList.Electric_Piston_MV.get(1);
+ CI.electricPiston_HV = ItemList.Electric_Piston_HV.get(1);
+ CI.electricPiston_EV = ItemList.Electric_Piston_EV.get(1);
+ CI.electricPiston_IV = ItemList.Electric_Piston_IV.get(1);
+ CI.robotArm_LV = ItemList.Robot_Arm_LV.get(1);
+ CI.robotArm_MV = ItemList.Robot_Arm_MV.get(1);
+ CI.robotArm_HV = ItemList.Robot_Arm_HV.get(1);
+ CI.robotArm_EV = ItemList.Robot_Arm_EV.get(1);
+ CI.robotArm_IV = ItemList.Robot_Arm_IV.get(1);
+ CI.conveyorModule_LV = ItemList.Conveyor_Module_LV.get(1);
+ CI.conveyorModule_MV = ItemList.Conveyor_Module_MV.get(1);
+ CI.conveyorModule_HV = ItemList.Conveyor_Module_HV.get(1);
+ CI.conveyorModule_EV = ItemList.Conveyor_Module_EV.get(1);
+ CI.conveyorModule_IV = ItemList.Conveyor_Module_IV.get(1);
+ CI.emitter_LV = ItemList.Emitter_LV.get(1);
+ CI.emitter_MV = ItemList.Emitter_MV.get(1);
+ CI.emitter_HV = ItemList.Emitter_HV.get(1);
+ CI.emitter_EV = ItemList.Emitter_EV.get(1);
+ CI.emitter_IV = ItemList.Emitter_IV.get(1);
+ CI.fieldGenerator_LV = ItemList.Field_Generator_LV.get(1);
+ CI.fieldGenerator_MV = ItemList.Field_Generator_MV.get(1);
+ CI.fieldGenerator_HV = ItemList.Field_Generator_HV.get(1);
+ CI.fieldGenerator_EV = ItemList.Field_Generator_EV.get(1);
+ CI.fieldGenerator_IV = ItemList.Field_Generator_IV.get(1);
+ CI.sensor_LV = ItemList.Sensor_LV.get(1);
+ CI.sensor_MV = ItemList.Sensor_MV.get(1);
+ CI.sensor_HV = ItemList.Sensor_HV.get(1);
+ CI.sensor_EV = ItemList.Sensor_EV.get(1);
+ CI.sensor_IV = ItemList.Sensor_IV.get(1);
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ CI.fluidRegulator_LV = ItemUtils.getValueOfItemList("FluidRegulator_LV", ItemList.Pump_LV)
+ .get(1);
+ CI.fluidRegulator_MV = ItemUtils.getValueOfItemList("FluidRegulator_MV", ItemList.Pump_MV)
+ .get(1);
+ CI.fluidRegulator_HV = ItemUtils.getValueOfItemList("FluidRegulator_HV", ItemList.Pump_HV)
+ .get(1);
+ CI.fluidRegulator_EV = ItemUtils.getValueOfItemList("FluidRegulator_EV", ItemList.Pump_EV)
+ .get(1);
+ CI.fluidRegulator_IV = ItemUtils.getValueOfItemList("FluidRegulator_IV", ItemList.Pump_IV)
+ .get(1);
+ }
+ }
+
+ private static void registerGTExperimentalComponents() {
+ // GT++ Machine Components
+ CI.electricMotor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32606, 1);
+ CI.electricMotor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32607, 1);
+ CI.electricMotor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32608, 1);
+ CI.electricPump_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32620, 1);
+ CI.electricPump_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32621, 1);
+ CI.electricPump_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32622, 1);
+ CI.electricPiston_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32645, 1);
+ CI.electricPiston_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32646, 1);
+ CI.electricPiston_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32647, 1);
+ CI.robotArm_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32655, 1);
+ CI.robotArm_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32656, 1);
+ CI.robotArm_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32657, 1);
+ CI.conveyorModule_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32636, 1);
+ CI.conveyorModule_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32637, 1);
+ CI.conveyorModule_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1);
+ CI.emitter_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32685, 1);
+ CI.emitter_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32686, 1);
+ CI.emitter_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32687, 1);
+ CI.fieldGenerator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32675, 1);
+ CI.fieldGenerator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32676, 1);
+ CI.fieldGenerator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32677, 1);
+ CI.sensor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1);
+ CI.sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1);
+ CI.sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1);
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ CI.fluidRegulator_LuV = ItemUtils.getValueOfItemList("FluidRegulator_LuV", ItemList.Pump_LuV)
+ .get(1);
+ CI.fluidRegulator_ZPM = ItemUtils.getValueOfItemList("FluidRegulator_ZPM", ItemList.Pump_ZPM)
+ .get(1);
+ CI.fluidRegulator_UV = ItemUtils.getValueOfItemList("FluidRegulator_UV", ItemList.Pump_UV)
+ .get(1);
+ }
+
+ registerComponentsULV();
+ registerComponentsMAX();
+ }
+
+ private static void registerGTStandardComponents() {
+ CI.electricMotor_LuV = GregtechItemList.Electric_Motor_LuV.get(1);
+ CI.electricMotor_ZPM = GregtechItemList.Electric_Motor_ZPM.get(1);
+ CI.electricMotor_UV = GregtechItemList.Electric_Motor_UV.get(1);
+ CI.electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
+ CI.electricPump_LuV = GregtechItemList.Electric_Pump_LuV.get(1);
+ CI.electricPump_ZPM = GregtechItemList.Electric_Pump_ZPM.get(1);
+ CI.electricPump_UV = GregtechItemList.Electric_Pump_UV.get(1);
+ CI.electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
+ CI.electricPiston_LuV = GregtechItemList.Electric_Piston_LuV.get(1);
+ CI.electricPiston_ZPM = GregtechItemList.Electric_Piston_ZPM.get(1);
+ CI.electricPiston_UV = GregtechItemList.Electric_Piston_UV.get(1);
+ CI.electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
+ CI.robotArm_LuV = GregtechItemList.Robot_Arm_LuV.get(1);
+ CI.robotArm_ZPM = GregtechItemList.Robot_Arm_ZPM.get(1);
+ CI.robotArm_UV = GregtechItemList.Robot_Arm_UV.get(1);
+ CI.robotArm_MAX = GregtechItemList.Robot_Arm_MAX.get(1);
+ CI.conveyorModule_LuV = GregtechItemList.Conveyor_Module_LuV.get(1);
+ CI.conveyorModule_ZPM = GregtechItemList.Conveyor_Module_ZPM.get(1);
+ CI.conveyorModule_UV = GregtechItemList.Conveyor_Module_UV.get(1);
+ CI.conveyorModule_MAX = GregtechItemList.Conveyor_Module_MAX.get(1);
+ CI.emitter_LuV = GregtechItemList.Emitter_LuV.get(1);
+ CI.emitter_ZPM = GregtechItemList.Emitter_ZPM.get(1);
+ CI.emitter_UV = GregtechItemList.Emitter_UV.get(1);
+ CI.emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
+ CI.fieldGenerator_LuV = GregtechItemList.Field_Generator_LuV.get(1);
+ CI.fieldGenerator_ZPM = GregtechItemList.Field_Generator_ZPM.get(1);
+ CI.fieldGenerator_UV = GregtechItemList.Field_Generator_UV.get(1);
+ CI.fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
+ CI.sensor_LuV = GregtechItemList.Sensor_LuV.get(1);
+ CI.sensor_ZPM = GregtechItemList.Sensor_ZPM.get(1);
+ CI.sensor_UV = GregtechItemList.Sensor_UV.get(1);
+ CI.sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ CI.fluidRegulator_LuV = ItemUtils.getValueOfItemList("FluidRegulator_LuV", ItemList.Pump_LuV)
+ .get(1);
+ CI.fluidRegulator_ZPM = ItemUtils.getValueOfItemList("FluidRegulator_ZPM", ItemList.Pump_ZPM)
+ .get(1);
+ CI.fluidRegulator_UV = ItemUtils.getValueOfItemList("FluidRegulator_UV", ItemList.Pump_UV)
+ .get(1);
+ }
+
+ registerComponentsULV();
+ }
+
+ private static void registerGTNHComponents() {
+ // Machine Components
+ CI.electricMotor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32606, 1);
+ CI.electricMotor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32607, 1);
+ CI.electricMotor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32608, 1);
+
+ CI.electricPump_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32615, 1);
+ CI.electricPump_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32616, 1);
+ CI.electricPump_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32617, 1);
+
+ CI.electricPiston_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32645, 1);
+ CI.electricPiston_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32646, 1);
+ CI.electricPiston_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32647, 1);
+
+ CI.robotArm_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32655, 1);
+ CI.robotArm_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32656, 1);
+ CI.robotArm_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32657, 1);
+
+ CI.conveyorModule_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32635, 1);
+ CI.conveyorModule_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32636, 1);
+ CI.conveyorModule_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32637, 1);
+
+ CI.emitter_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32685, 1);
+ CI.emitter_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32686, 1);
+ CI.emitter_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32687, 1);
+
+ CI.fieldGenerator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32675, 1);
+ CI.fieldGenerator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32676, 1);
+ CI.fieldGenerator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32677, 1);
+
+ CI.sensor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1);
+ CI.sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1);
+ CI.sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1);
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ CI.fluidRegulator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32665, 1);
+ CI.fluidRegulator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32666, 1);
+ CI.fluidRegulator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32667, 1);
+ }
+
+ // Thanks 0lafe
+ CI.electricMotor_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32596, 1);
+ CI.electricPump_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32618, 1);
+ CI.electricPiston_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32648, 1);
+ CI.robotArm_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32658, 1);
+ CI.conveyorModule_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1);
+ CI.emitter_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32688, 1);
+ CI.fieldGenerator_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32678, 1);
+ CI.sensor_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32698, 1);
+
+ registerComponentsULV();
+ }
+
+ private static boolean registerComponentsULV() {
+
+ CI.electricMotor_ULV = GregtechItemList.Electric_Motor_ULV.get(1);
+ CI.electricPump_ULV = GregtechItemList.Electric_Pump_ULV.get(1);
+ CI.electricPiston_ULV = GregtechItemList.Electric_Piston_ULV.get(1);
+ CI.robotArm_ULV = GregtechItemList.Robot_Arm_ULV.get(1);
+ CI.conveyorModule_ULV = GregtechItemList.Conveyor_Module_ULV.get(1);
+ CI.emitter_ULV = GregtechItemList.Emitter_ULV.get(1);
+ CI.fieldGenerator_ULV = GregtechItemList.Field_Generator_ULV.get(1);
+ CI.sensor_ULV = GregtechItemList.Sensor_ULV.get(1);
+ return true;
+ }
+
+ private static boolean registerComponentsMAX() {
+
+ // Max Tier Components Blood Never added... Useless, lol.
+ CI.electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
+ CI.electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
+ CI.electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
+ CI.robotArm_MAX = GregtechItemList.Robot_Arm_MAX.get(1);
+ CI.conveyorModule_MAX = GregtechItemList.Conveyor_Module_MAX.get(1);
+ CI.emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
+ CI.fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
+ CI.sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
+
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Extruder.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Extruder.java
index 455beb2fd0..122a35f3a6 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Extruder.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Extruder.java
@@ -1,47 +1,56 @@
package gtPlusPlus.core.recipe;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.*;
import gregtech.api.interfaces.IOreRecipeRegistrator;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.item.ItemStack;
public class RECIPES_Extruder implements IOreRecipeRegistrator {
-
- public RECIPES_Extruder() {
- OrePrefixes.ingot.add((IOreRecipeRegistrator) this);
- OrePrefixes.dust.add((IOreRecipeRegistrator) this);
- }
- public void registerOre(final OrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- if (!CORE.GTNH && ((aMaterial == Materials.Glass || aMaterial == Materials.WroughtIron
- || GT_OreDictUnificator.get(OrePrefixes.ingot, (Object) aMaterial, 1L) != null)
- && !aMaterial.contains(SubTag.NO_SMELTING))) {
- final long aMaterialMass = aMaterial.getMass();
- final int tAmount = (int) (aPrefix.mMaterialAmount / 3628800L);
- if (tAmount > 0 && tAmount <= 64 && aPrefix.mMaterialAmount % 3628800L == 0L) {
- int tVoltageMultiplier = (aMaterial.mBlastFurnaceTemp >= 2800) ? 64 : 16;
- if (aMaterial.contains(SubTag.NO_SMASHING)) {
- tVoltageMultiplier /= 4;
- } else if (aPrefix.name().startsWith(OrePrefixes.dust.name())) {
- return;
- }
-
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}),
- GregtechItemList.Shape_Extruder_SmallGear.get(0L, new Object[0]),
- GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, (Object) aMaterial.mSmeltInto, (long) tAmount),
- ((int) Math.max(aMaterialMass * 5L * tAmount, tAmount)/4), 8 * tVoltageMultiplier);
- GT_Values.RA.addAlloySmelterRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}),
- ItemList.Shape_Mold_Gear_Small.get(0L, new Object[0]),
- GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, (Object) aMaterial.mSmeltInto, (long) tAmount),
- ((int) Math.max(aMaterialMass * 10L * tAmount, tAmount)/4), 2 * tVoltageMultiplier);
-
- }
- }
- }
-} \ No newline at end of file
+ public RECIPES_Extruder() {
+ OrePrefixes.ingot.add((IOreRecipeRegistrator) this);
+ OrePrefixes.dust.add((IOreRecipeRegistrator) this);
+ }
+
+ public void registerOre(
+ final OrePrefixes aPrefix,
+ final Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ if (!CORE.GTNH
+ && ((aMaterial == Materials.Glass
+ || aMaterial == Materials.WroughtIron
+ || GT_OreDictUnificator.get(OrePrefixes.ingot, (Object) aMaterial, 1L) != null)
+ && !aMaterial.contains(SubTag.NO_SMELTING))) {
+ final long aMaterialMass = aMaterial.getMass();
+ final int tAmount = (int) (aPrefix.mMaterialAmount / 3628800L);
+ if (tAmount > 0 && tAmount <= 64 && aPrefix.mMaterialAmount % 3628800L == 0L) {
+ int tVoltageMultiplier = (aMaterial.mBlastFurnaceTemp >= 2800) ? 64 : 16;
+ if (aMaterial.contains(SubTag.NO_SMASHING)) {
+ tVoltageMultiplier /= 4;
+ } else if (aPrefix.name().startsWith(OrePrefixes.dust.name())) {
+ return;
+ }
+
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(1L, new Object[] {aStack}),
+ GregtechItemList.Shape_Extruder_SmallGear.get(0L, new Object[0]),
+ GT_OreDictUnificator.get(
+ OrePrefixes.gearGtSmall, (Object) aMaterial.mSmeltInto, (long) tAmount),
+ ((int) Math.max(aMaterialMass * 5L * tAmount, tAmount) / 4),
+ 8 * tVoltageMultiplier);
+ GT_Values.RA.addAlloySmelterRecipe(
+ GT_Utility.copyAmount(2L, new Object[] {aStack}),
+ ItemList.Shape_Mold_Gear_Small.get(0L, new Object[0]),
+ GT_OreDictUnificator.get(
+ OrePrefixes.gearGtSmall, (Object) aMaterial.mSmeltInto, (long) tAmount),
+ ((int) Math.max(aMaterialMass * 10L * tAmount, tAmount) / 4),
+ 2 * tVoltageMultiplier);
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index 771b82ccdb..f1c4aab409 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -1,5 +1,7 @@
package gtPlusPlus.core.recipe;
+import static gtPlusPlus.core.lib.CORE.GTNH;
+
import cpw.mods.fml.common.Loader;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
@@ -26,2404 +28,2456 @@ import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.reflect.AddGregtechRecipe;
-import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import java.util.ArrayList;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
-import java.util.ArrayList;
-
-import static gtPlusPlus.core.lib.CORE.GTNH;
-
public class RECIPES_GREGTECH {
- public static void run() {
- Logger.INFO("Loading Recipes through GregAPI for Industrial Multiblocks.");
- execute();
- }
-
- private static void execute() {
- cokeOvenRecipes();
- electrolyzerRecipes();
- assemblerRecipes();
- fluidcannerRecipes();
- distilleryRecipes();
- extractorRecipes();
- fluidExtractorRecipes();
- chemicalBathRecipes();
- chemicalReactorRecipes();
- dehydratorRecipes();
- blastFurnaceRecipes();
-
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- largeChemReactorRecipes();
- fusionRecipes();
- }
-
- fissionFuelRecipes();
- autoclaveRecipes();
- compressorRecipes();
- mixerRecipes();
- macerationRecipes();
- centrifugeRecipes();
- benderRecipes();
- cyclotronRecipes();
- blastSmelterRecipes();
- //advancedMixerRecipes();
- sifterRecipes();
- electroMagneticSeperatorRecipes();
- extruderRecipes();
- cuttingSawRecipes();
- breweryRecipes();
- laserEngraverRecipes();
- assemblyLineRecipes();
- latheRecipes();
- vacuumFreezerRecipes();
- fluidheaterRecipes();
- chemplantRecipes();
- packagerRecipes();
- alloySmelterRecipes();
- implosionRecipes();
-
-
- /**
- * Special Recipe handlers
- */
- RECIPES_SeleniumProcessing.init();
- RECIPES_RareEarthProcessing.init();
-
- addFuels();
- }
-
- private static void alloySmelterRecipes() {
-
- //Wood's Glass Laser Lens
- GT_Values.RA.addAlloySmelterRecipe(
- MISC_MATERIALS.WOODS_GLASS.getDust(5),
- ItemList.Shape_Mold_Ball.get(0),
- GregtechItemList.Laser_Lens_WoodsGlass.get(1),
- 20 * 300,
- MaterialUtils.getVoltageForTier(3));
-
- }
-
-
- private static void packagerRecipes() {
-
-
- }
-
- private static void implosionRecipes() {
-
- //GT_Values.RA.addImplosionRecipe(
- //ItemUtils.getSimpleStack(ModItems.itemSunnariumBit, 9),
- //16,
- //ItemUtils.getSimpleStack(AdvancedSolarPanel.itemSunnariumPart, 1),
- //GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Glowstone, 8));
-
- }
-
- private static void chemplantRecipes() {
-
- //This is subsequently absorbed in water to form nitric acid and nitric oxide.
- //3 NO2 (g) + H2O (l) → 2 HNO3 (aq) + NO (g) (ΔH = −117 kJ/mol)
- //The nitric oxide is cycled back for reoxidation. Alternatively, if the last step is carried out in air:
- //4 NO2 (g) + O2 (g) + 2 H2O (l) → 4 HNO3 (aq)
-
- // Advanced method for Nitric Acid Production
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(17),
- CI.getPinkCatalyst(0),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(GenericChem.Nitrogen_Dioxide, 4000),
- FluidUtils.getAir(4000),
- FluidUtils.getWater(2000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("nitricacid", 4000),
- },
- 10 * 20,
- 480,
- 3);
-
- // Advanced recipe for Fluorine Production
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(17),
- CI.getPurpleCatalyst(0),
- ItemUtils.getSimpleStack(Blocks.sandstone, 64),
- ItemUtils.getSimpleStack(Blocks.sandstone, 64)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("nitricacid", 4000),
- FluidUtils.getAir(8000)
- },
- new ItemStack[] {
- FLUORIDES.FLUORITE.getOre(8),
- FLUORIDES.FLUORITE.getOre(4),
- FLUORIDES.FLUORITE.getOre(4),
- FLUORIDES.FLUORITE.getOre(4),
- },
- new FluidStack[] {
-
- },
- new int[] {
- 0, 2500, 2000, 1500
- },
- 10 * 20,
- 1024,
- 5);
-
- // Advanced recipe for Fluorine Production
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(17),
- CI.getPurpleCatalyst(0),
- ItemUtils.getSimpleStack(Blocks.sand, 64),
- ItemUtils.getSimpleStack(Blocks.sand, 64)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("nitricacid", 5000),
- FluidUtils.getAir(12000)
- },
- new ItemStack[] {
- FLUORIDES.FLUORITE.getOre(4),
- FLUORIDES.FLUORITE.getOre(2),
- FLUORIDES.FLUORITE.getOre(2),
- FLUORIDES.FLUORITE.getOre(2),
- },
- new FluidStack[] {
-
- },
- new int[] {
- 7500, 1500, 1000, 500
- },
- 10 * 20,
- 1024,
- 5);
-
- //3NO2 + H2O = 2HNO3 + NO
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(16),
- CI.getPinkCatalyst(0),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(GenericChem.Nitrogen_Dioxide, 3000),
- FluidUtils.getDistilledWater(1000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("nitricacid", 2000),
- FluidUtils.getFluidStack(GenericChem.Nitric_Oxide, 1000),
- },
- 10 * 20,
- 480,
- 2);
-
- // Produce Boric Acid
- //Na2B4O7·10H2O + 2HCl = 4B(OH)3 + 2NaCl + 5H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(21),
- ItemUtils.getItemStackOfAmountFromOreDict("dustBorax", 23),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(GenericChem.HydrochloricAcid, 2000)
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustSalt", 4),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("boricacid", 4000),
- FluidUtils.getWater(5000)
- },
- 20 * 30,
- MaterialUtils.getVoltageForTier(3),
- 3);
-
- // Produce Th232
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(22),
- ELEMENT.getInstance().THORIUM.getDust(16)
- },
- new FluidStack[] {
- FluidUtils.getDistilledWater(2000),
- FluidUtils.getFluidStack("boricacid", 1500)
- },
- new ItemStack[] {
- ELEMENT.getInstance().THORIUM.getSmallDust(32),
- ELEMENT.getInstance().THORIUM232.getDust(2),
- ELEMENT.getInstance().THORIUM232.getSmallDust(2),
- ELEMENT.getInstance().URANIUM232.getDust(1),
- },
- new FluidStack[] {
-
- },
- new int[] {
- 0, 0, 1000, 250
- },
- 20 * 300,
- MaterialUtils.getVoltageForTier(4),
- 4);
-
- // Modify Sapling into Pine Sapling
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(6),
- ItemUtils.getSimpleStack(Blocks.sapling, 32)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("fluid.geneticmutagen", 2000),
- FluidUtils.getDistilledWater(8000)
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Pine, 16)
- },
- new FluidStack[] {
-
- },
- 120 * 20,
- 64,
- 2);
-
-
- // Convert GT++ Plutonium239 into normal Plutonium
- if (Materials.Plutonium.mDefaultLocalName.equals("Plutonium 239")) {
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(16),
- ELEMENT.getInstance().PLUTONIUM239.getDust(1)
- },
- new FluidStack[] {
-
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustPlutonium", 1)
- },
- new FluidStack[] {
-
- },
- 5 * 20,
- 1,
- 2);
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(16),
- ELEMENT.getInstance().PLUTONIUM239.getSmallDust(1)
- },
- new FluidStack[] {
-
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallPlutonium", 1)
- },
- new FluidStack[] {
-
- },
- 5 * 20,
- 1,
- 2);
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(16),
- ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1)
- },
- new FluidStack[] {
-
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyPlutonium", 1)
- },
- new FluidStack[] {
-
- },
- 5 * 20,
- 1,
- 2);
- }
-
- int aLaureniumTier = ALLOY.LAURENIUM.vTier;
- // Adding Recipes for Casings
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(12),
- CI.getTieredMachineCasing(aLaureniumTier-1),
- ALLOY.LAURENIUM.getPlate(8),
- CI.getGear(aLaureniumTier, 2)
- },
- new FluidStack[] {
- CI.getTieredFluid(aLaureniumTier, 2 * 144),
- CI.getAlternativeTieredFluid(aLaureniumTier-1, 4 * 144),
- CI.getTertiaryTieredFluid(aLaureniumTier-2, 6 * 144)
- },
- new ItemStack[] {
- GregtechItemList.Casing_Machine_Custom_3.get(1)
- },
- new FluidStack[] {
-
- },
- 20 * 20,
- MaterialUtils.getVoltageForTier(aLaureniumTier-2),
- 5);
-
- int aBotmiumTier = ALLOY.BOTMIUM.vTier;
- // Adding Recipes for Casings
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(12),
- CI.getTieredMachineCasing(aBotmiumTier-1),
- ALLOY.BOTMIUM.getPlate(8),
- CI.getGear(aBotmiumTier, 2)
- },
- new FluidStack[] {
- CI.getTieredFluid(aBotmiumTier, 2 * 144),
- CI.getAlternativeTieredFluid(aBotmiumTier-1, 4 * 144),
- CI.getTertiaryTieredFluid(aBotmiumTier-2, 6 * 144)
- },
- new ItemStack[] {
- GregtechItemList.Casing_Machine_Custom_4.get(1)
- },
- new FluidStack[] {
-
- },
- 20 * 20,
- MaterialUtils.getVoltageForTier(aBotmiumTier-2),
- 6);
-
-
- //Refine GT HF into GT++ HF
- if (FluidUtils.doesHydrofluoricAcidGtExist()) {
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(22),
- },
- new FluidStack[] {
- FluidUtils.getHydrofluoricAcid(2000),
- FluidUtils.getHydrofluoricAcidGT(5000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getHydrofluoricAcid(4500)
- },
- 30 * 20,
- 480,
- 3);
- }
-
- }
-
- private static void fluidheaterRecipes() {
- GT_Values.RA.addFluidHeaterRecipe(CI.getNumberedCircuit(20), FluidUtils.getWater(1000), FluidUtils.getHotWater(1000), 30, 30);
- }
-
- private static void vacuumFreezerRecipes() {
- GT_Values.RA.addVacuumFreezerRecipe(GregtechItemList.Bomb_Cast_Molten.get(1), GregtechItemList.Bomb_Cast_Set.get(1), 20 * 30);
- }
-
- private static void latheRecipes() {
-
- GT_Values.RA.addLatheRecipe(
- ALLOY.EGLIN_STEEL.getBlock(1),
- GregtechItemList.Bomb_Cast_Mold.get(1),
- null,
- 20 * 60 * 15,
- 120);
-
- GT_Values.RA.addLatheRecipe(
- GregtechItemList.Bomb_Cast_Set.get(1),
- GregtechItemList.Bomb_Cast_Broken.get(2),
- ItemUtils.getSimpleStack(ModItems.itemBombCasing, 2),
- 20 * 60 * 5,
- 30);
-
- }
-
- private static void fusionRecipes() {
-
- /**
- * Adds a Fusion reactor Recipe
- *
- * @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)
- */
-
- //Hydrogen Plasma
- /*CORE.RA.addFusionReactorRecipe(
- Particle.getIon("Hydrogen", 0),
- Particle.getIon("Hydrogen", 0),
- Materials.Hydrogen.getPlasma(1),
- 5000,
- 16,
- 4096,
- 40000000);*/
-
-
- //Hypogen Creation
- GT_Values.RA.addFusionReactorRecipe(
- ELEMENT.STANDALONE.DRAGON_METAL.getFluidStack(144),
- ELEMENT.STANDALONE.RHUGNOR.getFluidStack(288),
- ELEMENT.STANDALONE.HYPOGEN.getFluidStack(36),
- 2048 * 4,
- MaterialUtils.getVoltageForTier(9),
- 600000000 * 2);
-
- //Rhugnor
- GT_Values.RA.addFusionReactorRecipe(
- MaterialUtils.getMaterial("Infinity", "Neutronium").getMolten(144),
- ALLOY.QUANTUM.getFluidStack(288),
- ELEMENT.STANDALONE.RHUGNOR.getFluidStack(144),
- 512,
- MaterialUtils.getVoltageForTier(8),
- 2000000000);
-
- }
-
- private static void assemblyLineRecipes() {
-
-
-
- ItemStack[] aCoilWire = new ItemStack[] {
- ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 0, GTNH ? 64 : 32),
- ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 1, GTNH ? 64 : 32),
- ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 2, GTNH ? 64 : 32),
- ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 3, GTNH ? 64 : 32),
- };
-
-
-
-
- //Containment Casings
- CORE.RA.addAssemblylineRecipe(
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_1_CONTAINMENT, 1),
- 20 * 60 * 30,
- new Object[] {
- ItemList.Field_Generator_IV.get(GTNH ? 32 : 16),
- ItemList.Electric_Motor_EV.get(GTNH ? 64 : 32),
- ItemList.Energy_LapotronicOrb.get(GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.cableGt12, 7, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.wireGt16, 6, GTNH ? 64 : 32),
- ItemUtils.getOrePrefixStack(OrePrefixes.plate, Materials.Naquadria, GTNH ? 64 : 16),
- ELEMENT.getInstance().GADOLINIUM.getDust(GTNH ? 32 : 8),
- ELEMENT.getInstance().SAMARIUM.getDust(GTNH ? 16 : 4),
- ALLOY.ARCANITE.getGear(GTNH ? 8 : 2),
- new Object[] {CI.getTieredCircuitOreDictName(5), 64},
- new Object[] {CI.getTieredCircuitOreDictName(6), 32},
- new Object[] {CI.getTieredCircuitOreDictName(7), 16},
- GregtechItemList.Laser_Lens_Special.get(1),
- aCoilWire[3]
- },
- new FluidStack[] {
- ALLOY.NITINOL_60.getFluidStack(144 * 9 * (GTNH ? 4 : 2)),
- ALLOY.ENERGYCRYSTAL.getFluidStack(144 * 9 * (GTNH ? 8 : 4)),
- ALLOY.TUMBAGA.getFluidStack(144 * 9 * (GTNH ? 32 : 8)),
- ALLOY.NICHROME.getFluidStack(144 * 1 * (GTNH ? 16 : 4)),
- },
- ItemUtils.getSimpleStack(ModBlocks.blockCasings3Misc, 15, 32),
- 20 * 60 * 10 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(6));
-
- //Slow Fusion Controller
- /*CORE.RA.addAssemblylineRecipe(
- GregtechItemList.COMET_Cyclotron.get(1),
- 20 * 60 * 30,
- new ItemStack[] {
- CI.getFieldGenerator(6, GTNH ? 32 : 8),
- ItemList.Electric_Motor_EV.get(GTNH ? 32 : 8),
- ItemList.Tool_Scanner.get(GTNH ? 4 : 2),
- CI.getTieredComponent(OrePrefixes.cableGt12, 6, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.wireGt16, 5, GTNH ? 64 : 32),
- CI.getTieredComponent(OrePrefixes.plate, 6, GTNH ? 64 : 32),
- ELEMENT.getInstance().GADOLINIUM.getDust(GTNH ? 32 : 8),
- ELEMENT.getInstance().SAMARIUM.getDust(GTNH ? 16 : 4),
- ALLOY.INCOLOY_MA956.getGear(GTNH ? 8 : 2),
- CI.getTieredComponent(OrePrefixes.circuit, 5, GTNH ? 64 : 32),
- CI.getTieredComponent(OrePrefixes.circuit, 6, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 16 : 8)
- },
- new FluidStack[] {
- CI.getTieredFluid(6, 144 * 9 * (GTNH ? 8 : 4)),
- CI.getTertiaryTieredFluid(6, 144 * 9 * (GTNH ? 8 : 4)),
- CI.getAlternativeTieredFluid(6, 144 * 9 * (GTNH ? 8 : 4)),
- CI.getTieredFluid(5, 144 * 9 * (GTNH ? 16 : 8)),
- },
- GregtechItemList.Miniature_Fusion.get(1),
- 20 * 60 * 5 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(7));*/
-
-
- //Plasma Tank
- /*CORE.RA.addAssemblylineRecipe(
- ItemUtils.getOrePrefixStack(OrePrefixes.pipeMedium, Materials.Superconductor, 1),
- 20 * 60 * 5,
- new ItemStack[] {
- CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.circuit, 5, GTNH ? 16 : 4),
- CI.getTieredComponent(OrePrefixes.pipeHuge, 5, GTNH ? 16 : 4),
- CI.getTieredComponent(OrePrefixes.cableGt08, 7, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.gearGt, 6, GTNH ? 8 : 4),
- aCoilWire[2]
- },
- new FluidStack[] {
- CI.getTieredFluid(4, 144 * 9 * (GTNH ? 16 : 8)),
- CI.getTertiaryTieredFluid(4, 144 * 9 * (GTNH ? 16 : 8)),
- CI.getAlternativeTieredFluid(4, 144 * 9 * (GTNH ? 16 : 8)),
-
- },
- GregtechItemList.Plasma_Tank.get(1),
- 20 * 60 * 1 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(5));*/
-
- // Turbine Automation Port
- CORE.RA.addAssemblylineRecipe(
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_8_TURBINE_AUTOMATION, 1),
- 20 * 60 * 60 * 24,
- new Object[] {
- CI.getTieredMachineHull(8, 4),
- CI.getConveyor(8, GTNH ? 24 : 12),
- CI.getElectricMotor(7, GTNH ? 32 : 16),
- CI.getElectricPiston(7, GTNH ? 16 : 4),
- CI.getEnergyCore(6, GTNH ? 8 : 2),
- CI.getPlate(8, GTNH ? 24 : 12),
- CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 48 : 24),
- CI.getTieredComponent(OrePrefixes.bolt, 7, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 12 : 6),
- new Object[] {CI.getTieredCircuitOreDictName(7), 20},
- CI.getTieredComponent(OrePrefixes.rotor, 6, GTNH ? 16 : 8),
- },
- new FluidStack[] {
- CI.getTieredFluid(8, 144 * 32),
- CI.getAlternativeTieredFluid(7, 144 * 16),
- CI.getTertiaryTieredFluid(7, 144 * 16),
- ALLOY.BABBIT_ALLOY.getFluidStack(128 * 144),
- ALLOY.ZERON_100.getFluidStack(144 * 64)
-
- },
- GregtechItemList.Hatch_Input_TurbineHousing.get(4),
- 20 * 60 * 60 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(8));
-
-
- /*
- * Contianment casings
- */
-
- ItemStack[] aGemCasings = new ItemStack[] {
- GregtechItemList.Battery_Casing_Gem_1.get(1),
- GregtechItemList.Battery_Casing_Gem_2.get(1),
- GregtechItemList.Battery_Casing_Gem_3.get(1),
- GregtechItemList.Battery_Casing_Gem_4.get(1),
- };
- ItemStack[] aResearch = new ItemStack[] {
- Particle.getBaseParticle(Particle.UNKNOWN),
- GregtechItemList.Battery_Casing_Gem_1.get(1),
- GregtechItemList.Battery_Casing_Gem_2.get(1),
- GregtechItemList.Battery_Casing_Gem_3.get(1),
- };
-
- int aCasingSlot = 0;
- for (int j = 6; j < 10; j++) {
- CORE.RA.addAssemblylineRecipe(
- aResearch[aCasingSlot],
- 20 * 60 * 60,
- new ItemStack[] {
- CI.getTieredComponent(OrePrefixes.plate, j-1,16),
- CI.getTieredComponent(OrePrefixes.cableGt08, j+1,(GTNH ? 32 : 16)),
- CI.getTieredComponent(OrePrefixes.gearGt, j-1, 4),
- aCoilWire[aCasingSlot]
- },
- new FluidStack[] {
- CI.getTieredFluid(j, 144 *(GTNH ? 8 : 4)),
- CI.getTertiaryTieredFluid(j-2, 144 * (GTNH ? 16 : 8)),
- CI.getAlternativeTieredFluid(j, 144 * (GTNH ? 16 : 12)),
-
- },
- aGemCasings[aCasingSlot++],
- 20 * 60 * 1 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(j));
- }
-
- /*
- * Gem Battery Recipes
- */
-
- ItemStack[] aGemBatteries = new ItemStack[] {
- GregtechItemList.Battery_Gem_1.get(1),
- GregtechItemList.Battery_Gem_2.get(1),
- GregtechItemList.Battery_Gem_3.get(1),
- GregtechItemList.Battery_Gem_4.get(1),
- };
-
- ItemStack[] aExoticInputs = new ItemStack[] {
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.ELECTRON),
- Particle.getBaseParticle(Particle.CHARM),
- Particle.getBaseParticle(Particle.GRAVITON)
- };
- aCasingSlot = 0;
- for (int j = 6; j < 10; j++) {
- CORE.RA.addAssemblylineRecipe(
- aExoticInputs[aCasingSlot],
- 20 * 60 * 60 * 5,
- new Object[] {
- aGemCasings[aCasingSlot],
- ItemUtils.getSimpleStack(aExoticInputs[aCasingSlot], 16),
- CI.getTieredComponent(OrePrefixes.plate, j, 16),
- new Object[] {CI.getTieredCircuitOreDictName(j), 8},
- CI.getTieredComponent(OrePrefixes.wireGt16, j+1, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.bolt, j, GTNH ? 8 : 4),
- CI.getTieredComponent(OrePrefixes.screw, j-1, GTNH ? 8 : 4),
- },
- new FluidStack[] {
- CI.getTieredFluid(j, 144 * 1 * (GTNH ? 16 : 8)),
- CI.getTertiaryTieredFluid(j-2, 144 * 2 * (GTNH ? 16 : 8)),
- CI.getAlternativeTieredFluid(j, 144 * (GTNH ? 16 : 8)),
- CI.getTertiaryTieredFluid(j-1, 144 * (GTNH ? 16 : 8)),
- },
- aGemBatteries[aCasingSlot++],
- 20 * 60 * 1 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(j));
- }
-
-
- if (LoadedMods.Baubles) {
- //Nano Healer
- CORE.RA.addAssemblylineRecipe(
- ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1),
- 20 * 60 * 10,
- new Object[] {
- ItemUtils.getSimpleStack(aGemCasings[2], GTNH ? 4 : 2),
- CI.getTieredComponent(OrePrefixes.plate, 8, GTNH ? 32 : 16),
- new Object[] {CI.getTieredCircuitOreDictName(7), 16},
- CI.getTieredComponent(OrePrefixes.cableGt02, 7, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.gearGt, 6, GTNH ? 6 : 3),
- CI.getTieredComponent(OrePrefixes.screw, 7, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.bolt, 5, GTNH ? 24 : 12),
- CI.getTieredComponent(OrePrefixes.frameGt, 4, GTNH ? 12 : 6),
- aCoilWire[3]
- },
- new FluidStack[] {
- CI.getTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
- CI.getTertiaryTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
- CI.getAlternativeTieredFluid(6, 144 * 18 * (GTNH ? 16 : 8)),
- CI.getAlternativeTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
-
- },
- ItemUtils.getItemStackFromFQRN("miscutils:personalHealingDevice", 1),
- 20 * 60 * 30 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(7));
-
-
-
- //Charge Pack LuV-UV
-
- ItemStack[] aChargeResearch = new ItemStack[] {
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore7", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore8", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore9", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore10", 1),
- };
-
- ItemStack[] aChargeOutputs = new ItemStack[] {
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_1, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_2, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_3, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_4, 1),
- };
-
- int aCurrSlot = 0;
- for (int h = 6; h < 10; h++) {
- CORE.RA.addAssemblylineRecipe(
- aChargeResearch[aCurrSlot],
- 20 * 60 * 10 * (aCurrSlot + 1),
- new Object[] {
- ItemUtils.getSimpleStack(aGemBatteries[aCurrSlot],2),
- aCoilWire[aCurrSlot],
- CI.getTieredComponent(OrePrefixes.plate, h, 8),
- new Object[] {CI.getTieredCircuitOreDictName(h), 4},
- new Object[] {CI.getTieredCircuitOreDictName(h-1), 8},
- CI.getTieredComponent(OrePrefixes.cableGt12, h-1, 16),
- CI.getTieredComponent(OrePrefixes.screw, h, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.bolt, h-2, GTNH ? 32 : 16),
- CI.getFieldGenerator(h, 1),
- },
- new FluidStack[] {
- CI.getTieredFluid(h, 144 * 4 * (GTNH ? 8 : 4)),
- CI.getTertiaryTieredFluid(h-1, 144 * 4 * (GTNH ? 8 : 4)),
- CI.getAlternativeTieredFluid(h-1, 144 * 4 * (GTNH ? 8 : 4)),
- CI.getAlternativeTieredFluid(h-2, 144 * 4 * (GTNH ? 8 : 4)),
- },
- aChargeOutputs[aCurrSlot],
- 20 * 60 * 30 * (GTNH ? 2 : 1) * (aCurrSlot+1),
- (int) MaterialUtils.getVoltageForTier(h));
- aCurrSlot++;
- }
-
- //Cloaking device
- CORE.RA.addAssemblylineRecipe(
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_9_CLOAKING, 1),
- 20 * 60 * 10,
- new Object[] {
- ItemUtils.getSimpleStack(aGemCasings[3], GTNH ? 4 : 2),
- CI.getTieredComponent(OrePrefixes.plate, 8, GTNH ? 32 : 16),
- new Object[] {CI.getTieredCircuitOreDictName(7), 16},
- CI.getTieredComponent(OrePrefixes.cableGt04, 8, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.gearGt, 7, GTNH ? 6 : 3),
- CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.bolt, 7, GTNH ? 24 : 12),
- CI.getTieredComponent(OrePrefixes.frameGt, 5, GTNH ? 12 : 6),
- aCoilWire[3]
- },
- new FluidStack[] {
- CI.getTieredFluid(8, 144 * 18 * (GTNH ? 16 : 8)),
- CI.getTertiaryTieredFluid(8, 144 * 18 * (GTNH ? 16 : 8)),
- CI.getAlternativeTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
- CI.getAlternativeTieredFluid(8, 144 * 18 * (GTNH ? 16 : 8)),
-
- },
- ItemUtils.getItemStackFromFQRN("miscutils:personalCloakingDevice", 1),
- 20 * 60 * 30 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(8));
- }
-
-
-
-
-
-
-
-
-
- }
-
- private static void laserEngraverRecipes() {
-
- // Laser Sensors and Emitters together
- GregtechItemList[] aTransParts = new GregtechItemList[] {
- GregtechItemList.TransmissionComponent_ULV,
- GregtechItemList.TransmissionComponent_LV,
- GregtechItemList.TransmissionComponent_MV,
- GregtechItemList.TransmissionComponent_HV,
- GregtechItemList.TransmissionComponent_EV,
- GregtechItemList.TransmissionComponent_IV,
- GregtechItemList.TransmissionComponent_LuV,
- GregtechItemList.TransmissionComponent_ZPM,
- GregtechItemList.TransmissionComponent_UV,
- GregtechItemList.TransmissionComponent_MAX,
- };
- for (int i=0;i<10;i++) {
- GT_Values.RA.addLaserEngraverRecipe(
- CI.getEmitter(i, 2),
- CI.getSensor(i, 2),
- aTransParts[i].get(1),
- 20 * 5,
- MaterialUtils.getVoltageForTier(i));
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- false,
- new ItemStack[]{aTransParts[i].get(1)},
- new ItemStack[]{CI.getEmitter(i, 2), CI.getSensor(i, 2)},
- null,
- null,
- new FluidStack[]{GT_Values.NF},
- new FluidStack[]{GT_Values.NF},
- Math.max(300 >> Math.max(i-1, 0), 1),
- MaterialUtils.getVoltageForTier(i),
- 0
- );
- }
-
-
-
- GT_Values.RA.addLaserEngraverRecipe(
- GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Tungsten, 6L),
- GregtechItemList.Laser_Lens_Special.get(0),
- ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN.getDust(1),
- 20 * 60 * 3,
- MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN.vTier));
-
- GT_Values.RA.addLaserEngraverRecipe(
- GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Titanium, 8L),
- GregtechItemList.Laser_Lens_Special.get(0),
- ELEMENT.STANDALONE.ASTRAL_TITANIUM.getDust(1),
- 20 * 60 * 2,
- MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.ASTRAL_TITANIUM.vTier));
-
- GT_Values.RA.addLaserEngraverRecipe(
- ALLOY.NITINOL_60.getBlock(2),
- GregtechItemList.Laser_Lens_Special.get(0),
- ELEMENT.STANDALONE.ADVANCED_NITINOL.getBlock(1),
- 20 * 60 * 1,
- MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.ADVANCED_NITINOL.vTier));
-
- GT_Values.RA.addLaserEngraverRecipe(
- GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 64L),
- GregtechItemList.Laser_Lens_Special.get(0),
- ELEMENT.STANDALONE.CHRONOMATIC_GLASS.getDust(1),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.CHRONOMATIC_GLASS.vTier));
-
-
- GT_Values.RA.addLaserEngraverRecipe(
- CI.getFieldGenerator(6, 1),
- CI.getEmitter(7, 2),
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_1_CONTAINMENT, 1),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(5));
-
- // Distillus Upgrade Chip
- GT_Values.RA.addLaserEngraverRecipe(
- GregtechItemList.Laser_Lens_WoodsGlass.get(0),
- ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, 20, 1),
- GregtechItemList.Distillus_Upgrade_Chip.get(1),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(5));
-
- //GT_Values.RA.addLaserEngraverRecipe(
- //GregtechItemList.Laser_Lens_WoodsGlass.get(0),
- //ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 8, 1),
- //ItemUtils.getSimpleStack(ModItems.itemSunnariumBit, 3),
- //20 * 60 * 5,
- //MaterialUtils.getVoltageForTier(3));
-
-
- }
-
- private static void breweryRecipes() {
- CORE.RA.addBrewingRecipe(14, EnchantingUtils.getMobEssence(100), EnchantingUtils.getLiquidXP(1332), 100, 120, false);
- CORE.RA.addBrewingRecipe(14, EnchantingUtils.getLiquidXP(1332), EnchantingUtils.getMobEssence(100), 100, 120, false);
- CORE.RA.addBrewingRecipe(ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest), FluidUtils.getFluidStack("water", 100), FluidUtils.getFluidStack("biomass", 100), 1200, 3, false);
- CORE.RA.addBrewingRecipe(ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest), FluidUtils.getFluidStack("honey", 100), FluidUtils.getFluidStack("biomass", 150), 1200, 3, false);
- CORE.RA.addBrewingRecipe(ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest), FluidUtils.getFluidStack("juice", 100), FluidUtils.getFluidStack("biomass", 150), 1200, 3, false);
- }
-
- private static void cuttingSawRecipes() {
- GT_Values.RA.addCutterRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("blockMeatRaw", 1), //Input
- ItemUtils.getItemStackOfAmountFromOreDict("plateMeatRaw", 9), //Output
- null,
- 16, //Time
- 8); //EU
- }
-
- private static void electrolyzerRecipes() {
- GT_Values.RA.addElectrolyzerRecipe(
- ItemUtils.getSimpleStack(ModItems.dustDecayedRadium226, 1),
- null,
- null,
- FluidUtils.getFluidStack("radon", !GTNH ? 500 : 144),
- null,
- null,
- null,
- null,
- null,
- null,
- new int[]{},
- 20*90,
- 240);
- }
-
- private static void extruderRecipes() {
- // Osmium Credits
- if (GT_Values.RA.addExtruderRecipe(ItemUtils.getItemStackOfAmountFromOreDict("blockOsmium", 1),
- ItemList.Shape_Mold_Credit.get(0), ItemList.Credit_Greg_Osmium.get(1),
- (int) Math.max(Materials.Osmium.getMass() * 2L * 20, 1), 1024)) {
- Logger.WARNING("Extruder Recipe: Osmium Credit - Success");
- }
- else {
- Logger.WARNING("Extruder Recipe: Osmium Credit - Failed");
- }
- }
-
- private static void blastSmelterRecipes() {
-
- if (!GTNH) {
- // Trinium
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(8),
- ELEMENT.getInstance().BISMUTH.getDust(8),
- ELEMENT.getInstance().IRON.getDust(64),
- ELEMENT.getInstance().CARBON.getDust(16),
- ELEMENT.getInstance().GOLD.getDust(16),
- ELEMENT.getInstance().SILVER.getDust(16),
- ELEMENT.getInstance().OSMIUM.getDust(4),
- ELEMENT.getInstance().IRIDIUM.getDust(4),
- ELEMENT.getInstance().CERIUM.getDust(8)
- },
- FluidUtils.getFluidStack("molten.trinium", 136 * 144), 0, 20 * 3000,
- 2040*4);
- }
-
- //Eglin Steel
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(6),
- ELEMENT.getInstance().IRON.getDust(4),
- ALLOY.KANTHAL.getDust(1),
- ALLOY.INVAR.getDust(5),
- ELEMENT.getInstance().SULFUR.getDust(1),
- ELEMENT.getInstance().CARBON.getDust(1),
- ELEMENT.getInstance().SILICON.getDust(4)
- },
- ALLOY.EGLIN_STEEL.getFluidStack(16 * 144),
- 0,
- 20 * 45,
- 120);
-
- //HG1223
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(5),
- ELEMENT.getInstance().MERCURY.getCell(1),
- ELEMENT.getInstance().BARIUM.getDust(2),
- ELEMENT.getInstance().CALCIUM.getDust(2),
- ELEMENT.getInstance().COPPER.getDust(3),
- },
- ELEMENT.getInstance().OXYGEN.getFluidStack(8000),
- ALLOY.HG1223.getFluidStack(16 * 144),
- new ItemStack[] {
- CI.emptyCells(1)
- },
- new int[] {10000}, //Output Chance
- 20 * 120,
- 30720);
-
- //NITINOL_60
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(2),
- ELEMENT.getInstance().TITANIUM.getDust(3),
- ELEMENT.getInstance().NICKEL.getDust(2)
- },
- ALLOY.NITINOL_60.getFluidStack(5 * 144),
- 0,
- 20 * 75,
- 7680);
-
- //INDALLOY_140
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(5),
- ELEMENT.getInstance().BISMUTH.getDust(47),
- ELEMENT.getInstance().LEAD.getDust(25),
- ELEMENT.getInstance().TIN.getDust(13),
- ELEMENT.getInstance().CADMIUM.getDust(10),
- ELEMENT.getInstance().INDIUM.getDust(5)
-
- },
- ALLOY.INDALLOY_140.getFluidStack(100 * 144),
- 0,
- 20 * 40,
- 7680);
-
- // Germanium Roasting
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(15),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedSphalerite", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(2000),
- ELEMENT.getInstance().GERMANIUM.getFluidStack(288),
- 0,
- 20 * 300,
- 4000);
-
- // Ruthenium Roasting
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(19),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIridium", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(2000),
- ELEMENT.getInstance().RUTHENIUM.getFluidStack(288),
- 0,
- 20 * 300,
- 8000);
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(19),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedOsmium", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(2000),
- ELEMENT.getInstance().RUTHENIUM.getFluidStack(288),
- 0,
- 20 * 300,
- 8000);
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(19),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPlatinum", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(2000),
- ELEMENT.getInstance().RUTHENIUM.getFluidStack(288),
- 0,
- 20 * 300,
- 8000);
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(19),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCooperite", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(8000),
- ELEMENT.getInstance().RUTHENIUM.getFluidStack(144),
- 0,
- 20 * 300,
- 8000);
-
- // Rhenium Roasting
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(20),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedScheelite", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(10000),
- ELEMENT.getInstance().RHENIUM.getFluidStack(144),
- 0,
- 20 * 300,
- 4000);
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(20),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedMolybdenite", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(7500),
- ELEMENT.getInstance().RHENIUM.getFluidStack(144),
- 0,
- 20 * 300,
- 4000);
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(20),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedMolybdenum", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(5000),
- ELEMENT.getInstance().RHENIUM.getFluidStack(288),
- 0,
- 20 * 300,
- 4000);
-
- //Thallium Roasting
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(21),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIron", 12),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPyrite", 16),
- ELEMENT.getInstance().CARBON.getDust(64),
- },
- Materials.SulfuricAcid.getFluid(5000),
- ELEMENT.getInstance().THALLIUM.getFluidStack(288+144),
- 0,
- 20 * 300,
- 8000);
-
-
-
- //Strontium processing
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(21),
- MISC_MATERIALS.STRONTIUM_OXIDE.getDust(8),
- ELEMENT.getInstance().ALUMINIUM.getDust(8),
- },
- null,
- ELEMENT.getInstance().OXYGEN.getFluidStack(8000),
- new ItemStack[] {
- ELEMENT.getInstance().ALUMINIUM.getIngot(8),
- ELEMENT.getInstance().STRONTIUM.getIngot(8)
- },
- new int[] {10000, 10000}, //Output Chance
- 20 * 120,
- 480*4);
-
- }
-
- private static void fluidcannerRecipes() {
- // Sulfuric Acid
- CORE.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(Items.glass_bottle),
- ItemUtils.getSimpleStack(ModItems.itemSulfuricPotion), FluidUtils.getFluidStack("sulfuricacid", 250),
- null);
- CORE.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemSulfuricPotion),
- ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("sulfuricacid", 250));
-
-
-
- // Hydrofluoric Acid
- boolean addedGtExtraction = false;
- // Try use Internal GT Fluid first
- if (Utils.getGregtechVersionAsInt() >= 50929) {
- // Hydrofluoric Acid
- CORE.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(Items.glass_bottle),
- ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion),
- FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 250), null);
- addedGtExtraction = CORE.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion),
- ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 250));
- }
- //Add a Fill recipe for GT++ Acid
- CORE.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(Items.glass_bottle),
- ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion),
- FluidUtils.getFluidStack("hydrofluoricacid", 125), null);
- //Add an empty recipe, but only if we didn't for the standard GT HF. Prevents Fluid transformation exploits.
- if (!addedGtExtraction) {
- CORE.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion), ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("hydrofluoricacid", 125));
- }
-
- //Gelid Cryotheum
- CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustCryotheum", 1), FluidUtils.getFluidStack("cryotheum", 250), 200, 240);
-
- //Ender Fluid
- CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), FluidUtils.getFluidStack("ender", 250), 100, 30);
-
- //Blazing Pyrotheum
- CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), FluidUtils.getFluidStack("pyrotheum", 250), 200, 240);
-
-
- }
-
- private static void cokeOvenRecipes() {
- Logger.INFO("Loading Recipes for Industrial Coking Oven.");
- // Wood to Charcoal
- //Try use all woods found
- ArrayList<ItemStack> aLogData = OreDictionary.getOres("logWood");
- if (aLogData.isEmpty()) {
- AddGregtechRecipe.addCokeAndPyrolyseRecipes(GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 20L), 20,
- GT_ModHandler.getSteam(1000), GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 24L),
- FluidUtils.getFluidStack("fluid.coalgas", 1440), 60, 30); }
- else {
- for (ItemStack stack : aLogData) {
- AddGregtechRecipe.addCokeAndPyrolyseRecipes(ItemUtils.getSimpleStack(stack, 20), 20,
- GT_ModHandler.getSteam(1000), GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 24L),
- FluidUtils.getFluidStack("fluid.coalgas", 1440), 60, 30);
- }
- }
-
- // Coal to Coke
- AddGregtechRecipe.addCokeAndPyrolyseRecipes(GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 16L), 22,
- GT_ModHandler.getSteam(1000), ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 10),
- FluidUtils.getFluidStack("fluid.coalgas", 2880), 30, 120);
-
- // Coke & Coal
- CORE.RA.addCokeOvenRecipe(GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 12L),
- ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 6), GT_ModHandler.getSteam(2000),
- FluidUtils.getFluidStack("fluid.coalgas", 5040),
- ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 14), 60 * 20, 240);
-
- }
-
- private static void matterFabRecipes() {
- Logger.INFO("Loading Recipes for Matter Fabricator.");
-
- try {
-
- CORE.RA.addMatterFabricatorRecipe(Materials.UUAmplifier.getFluid(1L), // Fluid
- // Input
- Materials.UUMatter.getFluid(1L), // Fluid Output
- 800, // Time in ticks
- 32); // EU
- }
- catch (final NullPointerException e) {
- Logger.INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
- try {
-
- CORE.RA.addMatterFabricatorRecipe(null, // Fluid Input
- Materials.UUMatter.getFluid(1L), // Fluid Output
- 3200, // Time in ticks
- 32); // EU
- }
- catch (final NullPointerException e) {
- Logger.INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
-
- }
-
- private static void dehydratorRecipes() {
- Logger.INFO("Loading Recipes for Chemical Dehydrator.");
-
-
- ItemStack cropGrape = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cropGrape", 1);
- ItemStack foodRaisins = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foodRaisins", 1);
-
- if (cropGrape != null && foodRaisins != null)
- CORE.RA.addDehydratorRecipe(new ItemStack[] {
- CI.getNumberedBioCircuit(20),
- cropGrape
- }, // Item
- null, // Fluid input (slot 1)
- null, // Fluid output (slot 2)
- new ItemStack[] {
- foodRaisins
- }, // Output
- new int[] { 10000 },
- 10, // Time in ticks
- 2); // EU
-
-
-
- // Process Waste Water
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(21)
- },
- FluidUtils.getFluidStack("fluid.sludge", 1000),
- FluidUtils.getFluidStack("nitricacid", 10),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyIron", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCopper", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyTin", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyNickel", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCobalt", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAluminium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinySilver", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyGold", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyIridium", 1) },
- new int[] { 10, 5, 5, 4, 4, 3, 2, 2, 1 },
- 2 * 20,
- 500); // EU
-
- //C8H10 = C8H8 + 2H
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- CI.emptyCells(3)
- },
- FluidUtils.getFluidStack("fluid.ethylbenzene", 1000),
- null,
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellStyrene", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2)
- },
- new int[] {10000, 10000},
- 3 * 20,
- 30);
-
- /*
- * Try Add custom Recipe for drying leather
- */
- if (LoadedMods.PamsHarvestcraft && Loader.isModLoaded("Backpack")) {
- ItemStack aLeather1, aLeather2;
- aLeather1 = ItemUtils.getCorrectStacktype("harvestcraft:hardenedleatherItem", 1);
- aLeather2 = ItemUtils.getCorrectStacktype("Backpack:tannedLeather", 1);
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- aLeather1
- },
- FluidUtils.getFluidStack("fluid.ethylbenzene", 1000),
- null,
- new ItemStack[] {
- aLeather2
- },
- new int[] {10000},
- 5 * 20,
- 180);
- }
- //Alternative ACETIC ANHYDRIDE recipe for Kevlar Line
- //2C2H4O2 = C4H6O3 + H2O
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- CI.emptyCells(1)
- },
- FluidUtils.getFluidStack("aceticacid", 2000),
- MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1),
- },
- new int[] {10000},
- 30 * 20,
- 480);
- }
- private static void largeChemReactorRecipes() {
- //Styrene
- //C8H10 = C8H8 + 2H
- CORE.RA.addMultiblockChemicalRecipe(
- new ItemStack[]{CI.getNumberedCircuit(24)},
- new FluidStack[]{
- FluidUtils.getFluidStack("fluid.ethylbenzene", 1000)
- },
- new FluidStack[]{
- MaterialUtils.getMaterial("Styrene").getFluid(1000),
- Materials.Hydrogen.getGas(2000)
- },
- null,
- 30,
- 30);
- //Short-cut Styrene
- //C6H6 + C2H4 = C8H8 + 2H
- CORE.RA.addMultiblockChemicalRecipe(
- new ItemStack[]{CI.getNumberedCircuit(24)},
- new FluidStack[]{
- MaterialUtils.getMaterial("Ethylene").getGas(500),
- MaterialUtils.getMaterial("Benzene").getFluid(500)
- },
- new FluidStack[]{
- MaterialUtils.getMaterial("Styrene").getFluid(500),
- Materials.Hydrogen.getGas(1000)
- },
- null,
- 240,
- 120);
- }
-
- private static void fissionFuelRecipes() {
- try {
-
- }
- catch (final NullPointerException e) {
- Logger.INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
- }
-
- private static void assemblerRecipes() {
- // ItemUtils.getSimpleStack(GregtechItemList.Casing_Vanadium_Redox.get(1)
- addAR(ItemUtils.getItemStackOfAmountFromOreDict("plateVanadium", 32),
- ItemUtils.getItemStackOfAmountFromOreDict("frameGtVanadiumSteel", 8),
- FluidUtils.getFluidStack("oxygen", 8000),
- ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 0, 4), 16, 60);
- addAR(ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 0, 2),
- ItemUtils.getItemStackOfAmountFromOreDict("plateVanadiumGallium", 8),
- FluidUtils.getFluidStack("molten.tantalum", 144 * 4),
- ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 1, 8), 32, 120);
-
- /*
- addAR(ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 1, 1),
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseLead", 4), FluidUtils.getFluidStack("oxygen", 16000),
- ItemUtils.getSimpleStack(GregtechItemList.Casing_Vanadium_Redox.get(1), 1), 64, 240);
- */
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 1, 1),
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseLead", 4),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(3), 4),
- ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorHV", 2)
- },
- FluidUtils.getFluidStack("oxygen", 16000),
- ItemUtils.getSimpleStack(GregtechItemList.Casing_Vanadium_Redox.get(1), 1),
- 64,
- 240
- );
-
- //Tier 2-6
- ItemStack T1 = GregtechItemList.Casing_Vanadium_Redox.get(1);
- ItemStack T2 = GregtechItemList.Casing_Vanadium_Redox_IV.get(1);
- ItemStack T3 = GregtechItemList.Casing_Vanadium_Redox_LuV.get(1);
- ItemStack T4 = GregtechItemList.Casing_Vanadium_Redox_ZPM.get(1);
- ItemStack T5 = GregtechItemList.Casing_Vanadium_Redox_UV.get(1);
- ItemStack T6 = GregtechItemList.Casing_Vanadium_Redox_MAX.get(1);
-
-
- /*
- addAR(T1,
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseTitanium", 4),
- FluidUtils.getFluidStack("nitrogen", 16000),
- T2, 120, 2000);
- */
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- T1,
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseTitanium", 4),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 4),
- ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorEV", 2)
- },
- FluidUtils.getFluidStack("nitrogen", 16000),
- T2,
- 120,
- 2000
- );
-
-
- /*
- addAR(T2,
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseTungstenSteel", 4),
- FluidUtils.getFluidStack("helium", 8000),
- T3, 250, 8000);
- */
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- T2,
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseTungstenSteel", 4),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(5), 4),
- ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorIV", 2)
- },
- FluidUtils.getFluidStack("helium", 8000),
- T3,
- 250,
- 8000
- );
- /*
- addAR(T3,
- ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 16),
- FluidUtils.getFluidStack("argon", 4000),
- T4, 500, 32000);
- */
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- T3,
- ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 16),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 4),
- ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorLuV", 2)
- },
- FluidUtils.getFluidStack("argon", 4000),
- T4,
- 500,
- 32000
- );
- /*
- addAR(T4,
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseNaquadah", 4),
- FluidUtils.getFluidStack("radon", 4000),
- T5, 1000, 128000);
- */
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- T4,
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseNaquadah", 4),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 4),
- ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorZPM", 2)
- },
- FluidUtils.getFluidStack("radon", 4000),
- T5,
- 1000,
- 128000
- );
- /*
- addAR(T5,
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseAmericium", 4),
- FluidUtils.getFluidStack("krypton", 500),
- T6, 2000, 512000);
- */
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- T5,
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseAmericium", 4),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(8), 4),
- ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorUV", 2)
- },
- FluidUtils.getFluidStack("krypton", 500),
- T6,
- 2000,
- 512000
- );
-
- addAR(ItemUtils.getItemStackOfAmountFromOreDict(
- "dustClay", 32),
- GregtechItemList.Bomb_Cast_Mold.get(0),
- FluidUtils.getWater(4000),
- GregtechItemList.Bomb_Cast.get(4),
- 30, 120);
- addAR(ItemUtils.getSimpleStack(Items.redstone, 32),
- ItemUtils.getSimpleStack(ModItems.itemRope, 16),
- Materials.Glue.getFluid(500),
- ItemUtils.getSimpleStack(ModItems.itemDetCable, 24),
- 30,
- 120);
-
-
- /*addAR(ItemUtils.getItemStackOfAmountFromOreDict("plateIncoloy020", 16),
- ItemUtils.getItemStackOfAmountFromOreDict("frameGtIncoloyMA956", 4), null,
- GregtechItemList.Casing_Power_SubStation.get(4), 80, 120);*/
-
-
- /*CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- GregtechItemList.Casing_Multi_Use.get(1),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 1),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 8),
- CI.sensor_HV,
- CI.emitter_HV,
- CI.fieldGenerator_HV,
- },
- null,
- ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame),
- 20*20,
- 2048);
-
- */
-
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.getSimpleStack(ModItems.itemRope, 6)}, null, ItemUtils.getSimpleStack(ModBlocks.blockNet, 2), 1*20, 8);
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.getSimpleStack(CI.explosiveITNT, 2), ItemUtils.getSimpleStack(CI.explosiveTNT, 4), ELEMENT.getInstance().SULFUR.getDust(2), ELEMENT.getInstance().IRON.getFrameBox(1)}, null, ItemUtils.getSimpleStack(ModBlocks.blockMiningExplosive, 3), 5*20, 60);
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.getSimpleStack(Items.nether_star), ItemUtils.getItemStackOfAmountFromOreDict("plateTungstenSteel", 8), ItemUtils.getItemStackOfAmountFromOreDict("stickBlackSteel", 8)}, null, ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard, 64), 30*20, 500);
-
- ItemStack aFluidReg1 = ItemUtils.getValueOfItemList("FluidRegulator_LV", ItemList.Pump_LV).get(1);
- ItemStack aFluidReg2 = ItemUtils.getValueOfItemList("FluidRegulator_MV", ItemList.Pump_MV).get(1);
- ItemStack aFluidReg3 = ItemUtils.getValueOfItemList("FluidRegulator_HV", ItemList.Pump_HV).get(1);
- ItemStack aFluidReg4 = ItemUtils.getValueOfItemList("FluidRegulator_EV", ItemList.Pump_EV).get(1);
-
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- aFluidReg1,
- CI.electricMotor_LV,
- CI.getTieredComponent(OrePrefixes.bolt, 1, GTNH ? 8 : 4),
- ItemUtils.getItemStackOfAmountFromOreDict("ringBrass", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("stickBrass", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("plateSteel", 2)
- }, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 1, 1), 10*20, 30);
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- aFluidReg2,
- CI.electricMotor_MV,
- CI.getTieredComponent(OrePrefixes.bolt, 2, GTNH ? 8 : 4),
- ItemUtils.getItemStackOfAmountFromOreDict("ringInvar", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("stickInvar", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("plateAluminium", 2)
- }, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 2, 1), 10*20*2, 120);
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- aFluidReg3,
- CI.electricMotor_HV,
- CI.getTieredComponent(OrePrefixes.bolt, 3, GTNH ? 8 : 4),
- ItemUtils.getItemStackOfAmountFromOreDict("ringChrome", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("stickChrome", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("plateStainlessSteel", 2)
- }, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 3, 1), 10*20*3, 480);
-
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- aFluidReg4,
- CI.electricMotor_EV,
- CI.getTieredComponent(OrePrefixes.bolt, 4, GTNH ? 8 : 4),
- ItemUtils.getItemStackOfAmountFromOreDict("ringTitanium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("stickTitanium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("plateTungstenSteel", 2)
- }, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 4, 1), 10*20*4, 1960);
-
- GT_Values.RA.addAssemblerRecipe(ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 1, 1), CI.getNumberedCircuit(20), ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1000, 1), 30, 30);
- GT_Values.RA.addAssemblerRecipe(ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 2, 1), CI.getNumberedCircuit(20), ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1001, 1), 120, 120);
- GT_Values.RA.addAssemblerRecipe(ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 3, 1), CI.getNumberedCircuit(20), ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1002, 1), 480, 480);
- GT_Values.RA.addAssemblerRecipe(ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 4, 1), CI.getNumberedCircuit(20), ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1003, 1), 1820, 1820);
-
- //Low tier Charge Packs
-
- final ItemStack[] aPackBatteries = new ItemStack[] {
- ItemList.Battery_RE_LV_Lithium.get(4),
- ItemList.Battery_RE_MV_Lithium.get(4),
- ItemList.Battery_RE_HV_Lithium.get(4),
- GregtechItemList.Battery_RE_EV_Lithium.get(4),
- ItemList.Energy_LapotronicOrb.get(4),
- };
- final ItemStack[] aPackPlates = new ItemStack[] {
- CI.getPlate(1,8),
- CI.getPlate(2,8),
- CI.getPlate(3,8),
- CI.getPlate(4,8),
- CI.getPlate(5,8),
- };
- final ItemStack[] aPackWire = new ItemStack[] {
- CI.getTieredComponent(OrePrefixes.wireGt02, 1,6),
- CI.getTieredComponent(OrePrefixes.wireGt04, 2,6),
- CI.getTieredComponent(OrePrefixes.wireGt08, 3,6),
- CI.getTieredComponent(OrePrefixes.wireGt12, 4,6),
- CI.getTieredComponent(OrePrefixes.wireGt16, 5,6),
- };
- final ItemStack[] aPackCircuit = new ItemStack[] {
- CI.getTieredComponent(OrePrefixes.circuit, 1,4),
- CI.getTieredComponent(OrePrefixes.circuit, 2,4),
- CI.getTieredComponent(OrePrefixes.circuit, 3,4),
- CI.getTieredComponent(OrePrefixes.circuit, 4,4),
- CI.getTieredComponent(OrePrefixes.circuit, 5,4),
- };
- final ItemStack[] aPackRing = new ItemStack[] {
- CI.getTieredComponent(OrePrefixes.ring, 1,12),
- CI.getTieredComponent(OrePrefixes.ring, 2,12),
- CI.getTieredComponent(OrePrefixes.ring, 3,12),
- CI.getTieredComponent(OrePrefixes.ring, 4,12),
- CI.getTieredComponent(OrePrefixes.ring, 5,12),
- };
- final ItemStack[] aPackOutput = new ItemStack[] {
- ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_2),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_3),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_4),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_5)
- };
-
- for (int i = 1; i < 6; i++) {
-
- int aAS = i-1;
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- aPackPlates[aAS],
- aPackRing[aAS],
- aPackWire[aAS],
- aPackCircuit[aAS],
- aPackBatteries[aAS],
- CI.getSensor(i, GTNH ? 4 : 2),
- },
- CI.getTieredFluid(i, (144 * (GTNH ? 4 : 2))),
- aPackOutput[aAS],
- 30 * 20 * i,
- (int) GT_Values.V[i]);
- }
-
-
- if (!GTNH) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 2L), GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Bronze, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 2L), GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Brass, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 2L), GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Invar, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 2L), GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32);
-
- } else {
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 4L), GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bronze, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 4L), GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Brass, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 4L), GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 4L), GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32);
- }
- }
-
-
- if (LoadedMods.Baubles) {
-
- // Turbine Housing Research Page
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- ItemUtils.getGregtechCircuit(17),
- ItemUtils.getItemStackOfAmountFromOreDict("plateTrinium", GTNH ? 64 : 32),
- CI.getSensor(6, GTNH ? 6 : 3),
- CI.getBolt(7, GTNH ? 64 : 32),
- ItemUtils.getItemStackOfAmountFromOreDict("wireFinePlatinum", GTNH ? 64 : 32),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), GTNH ? 12 : 6)
- },
- CI.getAlternativeTieredFluid(7, 144 * 32),
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_8_TURBINE_AUTOMATION, 1),
- 20 * 60 * 5,
- (int) GT_Values.V[6]);
-
- // Cloaking Device Research Page
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- ItemUtils.getGregtechCircuit(17),
- ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR, 4),
- CI.getFieldGenerator(6, GTNH ? 16 : 8),
- ItemUtils.getItemStackOfAmountFromOreDict("wireFinePalladium", GTNH ? 32 : 16),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), GTNH ? 12 : 6)
- },
- CI.getAlternativeTieredFluid(7, 144 * 32),
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_9_CLOAKING, 1),
- 20 * 60 * 10,
- (int) GT_Values.V[7]);
-
- // Supreme Pizza Gloves
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- ItemUtils.getGregtechCircuit(19),
- ItemUtils.getSimpleStack(ModItems.itemRope, GTNH ? 32 : 16),
- ItemUtils.getItemStackOfAmountFromOreDict("gearGtSmallWroughtIron", GTNH ? 8 : 4),
- ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 32 : 16),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), GTNH ? 2 : 1)
- },
- FluidUtils.getFluidStack("molten.rubber", 2000),
- ItemUtils.getSimpleStack(ModItems.itemPersonalFireProofDevice),
- 20 * 60 * 5,
- 30);
- }
-
- }
-
- private static boolean addAR(final ItemStack inputA, final ItemStack inputB, final FluidStack inputFluidA,
- final ItemStack outputA, final int seconds, final int voltage) {
- // return GT_Values.RA.addAssemblerRecipe(inputA, inputB, outputA,
- // seconds*20, voltage);
- return GT_Values.RA.addAssemblerRecipe(inputA, inputB, inputFluidA, outputA, seconds * 20, voltage);
- }
-
- private static void distilleryRecipes() {
- Logger.INFO("Registering Distillery/Distillation Tower Recipes.");
- GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]),
- FluidUtils.getFluidStack("air", 1000), FluidUtils.getFluidStack("helium", 1), 400, 30, false);
- GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("air", 20000),
- FluidUtils.getFluidStackArray("helium", 25), ItemUtils.getSimpleStack(ModItems.itemHydrogenBlob, 1),
- 200, 60);
-
- // Apatite Distillation
- /*
- * so if you dissolve aparite in sulphuric acid you'll get a mixture of
- * SO2, H2O, HF and HCl
- */
- final FluidStack[] apatiteOutput = {
- FluidUtils.getFluidStack("sulfurousacid", 3800),
- FluidUtils.getFluidStack("hydrogenchloride", 1000),
- FluidUtils.getFluidStack("hydrofluoricacid", 400) };
- GT_Values.RA.addDistillationTowerRecipe(
- FluidUtils.getFluidStack("sulfuricapatite", 5200),
- apatiteOutput, null,
- 45 * 20,
- 120);
-
- final FluidStack[] sulfurousacidOutput = {
- FluidUtils.getFluidStack("sulfurdioxide", 500),
- FluidUtils.getFluidStack("water", 500) };
- GT_Values.RA.addDistillationTowerRecipe(
- FluidUtils.getFluidStack("sulfurousacid", 1000),
- sulfurousacidOutput,
- null,
- 10 * 20,
- 60);
-
- if (!GTNH) {
- final FluidStack[] sulfurdioxideOutput = {
- FluidUtils.getFluidStack("oxygen", 2000)
- };
- GT_Values.RA.addDistillationTowerRecipe(
- FluidUtils.getFluidStack("sulfurdioxide", 144 * 3),
- sulfurdioxideOutput,
- ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1),
- 5 * 20,
- 30);
- }
- }
-
- private static void addFuels() {
- Logger.INFO("Registering New Fuels.");
-
- if (!GTNH) {
- GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketFire_water", 0, 1), null, 120, 0);
- GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0);
- GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0);
- }
-
- HotFuel.addNewHotFuel(FluidUtils.getLava(83), FluidUtils.getPahoehoeLava(83),
- new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("nuggetCopper", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("nuggetTin", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("nuggetGold", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("nuggetSilver", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("nuggetTantalum", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTungstate", 1),
- ItemUtils.getSimpleStack(Blocks.obsidian) },
- new int[] { 2000, 1000, 250, 250, 250, 250, 500 }, 0);
-
- HotFuel.addNewHotFuel(FluidUtils.getPahoehoeLava(83), GT_Values.NF,
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("nuggetBronze", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("nuggetElectrum", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("nuggetTantalum", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTungstate", 1),
- ItemUtils.getSimpleStack(Blocks.obsidian) },
- new int[] { 750, 250, 250, 250, 1850 }, 0);
-
- HotFuel.addNewHotFuel(
- MISC_MATERIALS.SOLAR_SALT_HOT.getFluidStack(1000),
- MISC_MATERIALS.SOLAR_SALT_COLD.getFluidStack(1000),
- FluidUtils.getSuperHeatedSteam(10000),
- 0);
-
- /*
- * HotFuel.addNewHotFuel( FluidUtils.getFluidStack("ic2hotcoolant",
- * 100), GT_Values.NF, new ItemStack[]{}, new int[]{}, 0);
- */
-
- ThermalFuel.addSteamTurbineFuel(FluidUtils.getFluidStack("steam", 1024));
-
- // CORE.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel",
- // 0, 1), null, 112, 0);
- GT_Values.RA.addFuel(ItemUtils.getSimpleStack(Items.lava_bucket), null, 32, 2);
- GT_Values.RA.addFuel(ItemUtils.getIC2Cell(2), null, 32, 2);
- GT_Values.RA.addFuel(ItemUtils.getIC2Cell(11), null, 24, 2);
- // System.exit(1);
- }
-
- private static void extractorRecipes() {
- Logger.INFO("Registering Extractor Recipes.");
- GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Sodium.get(1L, new Object[0]),
- ItemList.Battery_Hull_HV.get(4L, new Object[0]));
- GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Cadmium.get(1L, new Object[0]),
- ItemList.Battery_Hull_HV.get(4L, new Object[0]));
- GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Lithium.get(1L, new Object[0]),
- ItemList.Battery_Hull_HV.get(4L, new Object[0]));
- }
-
- private static void fluidExtractorRecipes() {
-
- }
-
- private static void chemicalBathRecipes() {
-
- }
-
- private static void centrifugeRecipes() {
-
- GT_Values.RA.addCentrifugeRecipe(
- CI.getNumberedAdvancedCircuit(2),
- MISC_MATERIALS.SOLAR_SALT_COLD.getCell(5),
- null,
- null,
- MISC_MATERIALS.SODIUM_NITRATE.getDust(15),
- MISC_MATERIALS.POTASSIUM_NITRATE.getDust(10),
- CI.emptyCells(5),
- null,
- null,
- null,
- null,
- 20 * 30,
- 120);
-
- }
-
- private static void mixerRecipes() {
-
- //S + 2O = SO2
- GT_Values.RA.addMixerRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1),
- null,
- null,
- null,
- FluidUtils.getFluidStack("oxygen", 2000),
- FluidUtils.getFluidStack("sulfurdioxide", 1000),
- null,
- 600,
- 60);
-
- GT_Values.RA.addMixerRecipe(
- CI.getNumberedAdvancedCircuit(2),
- CI.emptyCells(5),
- MISC_MATERIALS.SODIUM_NITRATE.getDust(15),
- MISC_MATERIALS.POTASSIUM_NITRATE.getDust(10),
- null,
- null,
- MISC_MATERIALS.SOLAR_SALT_COLD.getCell(5),
- 20 * 10,
- 120);
-
- }
-
- private static void chemicalReactorRecipes() {
-
- //Bombs
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getSimpleStack(ModItems.itemBombCasing, 4),
- ItemUtils.getSimpleStack(RocketFuels.Ammonium_Nitrate_Dust, 8),
- Materials.Fuel.getFluid(1000),
- null,
- ItemUtils.getSimpleStack(ModItems.itemBombUnf, 4),
- 300 * 20);
-
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getSimpleStack(ModItems.itemBombUnf, 4),
- ItemUtils.getSimpleStack(ModItems.itemDetCable, 4),
- FluidUtils.getFluidStack(RocketFuels.Kerosene, 100),
- null,
- ItemUtils.getSimpleStack(ModItems.itemBomb, 4),
- 10 * 20);
-
- GT_Values.RA.addChemicalRecipe(
- CI.getNumberedAdvancedCircuit(21),
- ItemUtils.getItemStackOfAmountFromOreDict("dustApatite", 32),
- FluidUtils.getFluidStack("sulfuricacid", 4000),
- FluidUtils.getFluidStack("sulfuricapatite", 8000),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSulfur", 8),
- 20 * 20);
-
- //KOH + HNO3 = KNO3 + H2O
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getSimpleStack(GenericChem.mPotassiumHydroxide, 3),
- CI.getNumberedAdvancedCircuit(1),
- Materials.NitricAcid.getFluid(1000),
- Materials.Water.getFluid(1000),
- MISC_MATERIALS.POTASSIUM_NITRATE.getDust(5),
- 100,
- 30);
-
- //Na2CO3 + 2HNO3 = 2NaNO3 + CO2 + H2O
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6),
- CI.getNumberedAdvancedCircuit(1),
- Materials.NitricAcid.getFluid(2000),
- Materials.CarbonDioxide.getGas(1000),
- MISC_MATERIALS.SODIUM_NITRATE.getDust(10),
- 100,
- 30);
-
- }
-
- private static void blastFurnaceRecipes() {
-
- //public boolean addBlastRecipe(
- //ItemStack aInput1, ItemStack aInput2,
- //FluidStack aFluidInput, FluidStack aFluidOutput,
- //ItemStack aOutput1, ItemStack aOutput2,
- //int aDuration, int aEUt, int aLevel)
-
- //Synthetic Graphite
- GT_Values.RA.addBlastRecipe(
- CI.getNumberedCircuit(22),
- ALLOY.SILICON_CARBIDE.getDust(16),
- ELEMENT.getInstance().NITROGEN.getFluidStack(4000),
- GT_Values.NF,
- ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 8),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSilicon", 8),
- 60 * 20,
- MaterialUtils.getVoltageForTier(GTNH ? 5 : 4),
- 4500);
-
- //Bomb Casings
- GT_Values.RA.addBlastRecipe(
- GregtechItemList.Bomb_Cast.get(4),
- ALLOY.STEEL.getDust(16),
- ELEMENT.getInstance().OXYGEN.getFluidStack(2000),
- GT_Values.NF,
- GregtechItemList.Bomb_Cast_Molten.get(4),
- null,
- 4 * 60 * 20,
- MaterialUtils.getVoltageForTier(GTNH ? 3 : 2),
- 2800);
-
- //Krypton Processing
- if (ModItems.itemHotTitaniumIngot != null) {
- GT_Values.RA.addBlastRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("ingotTitanium", 1),
- CI.getNumberedCircuit(16),
- GT_Values.NF,
- GT_Values.NF,
- ItemUtils.getItemStackOfAmountFromOreDict("ingotHotTitanium", 1),
- null,
- 10 * 20,
- 500,
- Materials.Titanium.mBlastFurnaceTemp);
- }
-
- }
-
- private static void autoclaveRecipes() {
-
- }
-
- private static void benderRecipes() {
- if (CORE.ConfigSwitches.enableMultiblock_PowerSubstation) {
- GT_Values.RA.addBenderRecipe(ItemUtils.getItemStackOfAmountFromOreDict("ingotVanadium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("plateVanadium", 1), 8, 16);
- }
- }
-
- private static void compressorRecipes() {
- GT_ModHandler.addCompressionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustClay", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("plateClay", 1));
- GT_ModHandler.addCompressionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("plateMeatRaw", 1));
- GT_ModHandler.addCompressionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 9),
- ItemUtils.getItemStackOfAmountFromOreDict("blockMeatRaw", 1));
- CORE.RA.addCompressorRecipe(ItemList.FusionComputer_UV.get(9), GregtechItemList.Compressed_Fusion_Reactor.get(1), (int) GT_Values.V[7], (int) GT_Values.V[8]);
- }
-
- private static void macerationRecipes() {
-
- GT_ModHandler.addPulverisationRecipe(ItemUtils.getItemStackOfAmountFromOreDict("blockMeatRaw", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 9));
-
- GT_ModHandler.addPulverisationRecipe(GregtechItemList.Bomb_Cast_Broken.get(1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustClay", 3));
-
- if (ItemUtils.simpleMetaStack("chisel:limestone", 0, 1) != null) {
- GT_ModHandler.addPulverisationRecipe(ItemUtils.getItemStackOfAmountFromOreDict("limestone", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalcite", 4));
- }
-
- }
-
- private static void cyclotronRecipes() {
-
- // Polonium
- CORE.RA.addCyclotronRecipe(CI.getNumberedCircuit(1), FluidUtils.getFluidStack("molten.bismuth", 1),
- new ItemStack[] { GregtechItemList.Pellet_RTG_PO210.get(1) }, null, new int[] { 100 }, 20 * 300 * 100, 2040 * 4,
- 500 * 20);
-
- // Americium
- CORE.RA.addCyclotronRecipe(CI.getNumberedCircuit(1), FluidUtils.getFluidStack("molten.americium", 1),
- new ItemStack[] { GregtechItemList.Pellet_RTG_AM241.get(4) }, null, new int[] { 2500 }, 20 * 300 * 100, 1020 * 4,
- 500 * 20); //PO Special Value
-
- // Strontium u235
- CORE.RA.addCyclotronRecipe(CI.getNumberedCircuit(1), FluidUtils.getFluidStack("molten.uranium235", 10),
- new ItemStack[] { GregtechItemList.Pellet_RTG_SR90.get(1) }, null, new int[] { 570 }, 20 * 300 * 100, 1020 * 4,
- 500 * 20); //PO Special Value
-
- // Strontium u233
- CORE.RA.addCyclotronRecipe(CI.getNumberedCircuit(1), FluidUtils.getFluidStack("molten.uranium233", 10),
- new ItemStack[] { GregtechItemList.Pellet_RTG_SR90.get(1) }, null, new int[] { 660 }, 20 * 300 * 100, 1020 * 4,
- 500 * 20); //PO Special Value
-
- // Strontium pu239
- CORE.RA.addCyclotronRecipe(CI.getNumberedCircuit(1), FluidUtils.getFluidStack("molten.plutonium239", 10),
- new ItemStack[] { GregtechItemList.Pellet_RTG_SR90.get(1) }, null, new int[] { 220 }, 20 * 300 * 100, 1020 * 4,
- 500 * 20); //PO Special Value
-
- // Plutonium
- CORE.RA.addCyclotronRecipe(CI.getNumberedCircuit(1), FluidUtils.getFluidStack("molten.plutonium238", 1),
- new ItemStack[] { GregtechItemList.Pellet_RTG_PU238.get(2) }, null, new int[] { 780 }, 20 * 300 * 100, 1020 * 4,
- 500 * 20); //PO Special Value
-
- // Neptunium
- CORE.RA.addCyclotronRecipe(new ItemStack[] {ELEMENT.getInstance().URANIUM238.getDust(1) }, FluidUtils.getFluidStack("deuterium", 400),
- new ItemStack[] {ItemUtils.getSimpleStack(ModItems.dustNeptunium238)}, null, new int[] { 500 }, 20 * 5, 500 * 4,
- 500 * 20); //PO Special Value
-
-
- /**
- * Particle Science
- */
-
-
- // Quark Smash
- CORE.RA.addCyclotronRecipe(
- CI.getNumberedCircuit(3),
- FluidUtils.getFluidStack("plasma.hydrogen", 100),
- new ItemStack[] {
- Particle.getBaseParticle(Particle.UP),
- Particle.getBaseParticle(Particle.DOWN),
- Particle.getBaseParticle(Particle.CHARM),
- Particle.getBaseParticle(Particle.STRANGE),
- Particle.getBaseParticle(Particle.TOP),
- Particle.getBaseParticle(Particle.BOTTOM),
- },
- null,
- new int[] { 50, 50, 50, 50, 50, 50 },
- 20 * 300 * 9,
- (int) MaterialUtils.getVoltageForTier(7),
- 750 * 20);
-
- // Lepton Smash
- CORE.RA.addCyclotronRecipe(
- CI.getNumberedCircuit(6),
- FluidUtils.getFluidStack("plasma.helium", 1500),
- new ItemStack[] {
- Particle.getBaseParticle(Particle.ELECTRON),
- Particle.getBaseParticle(Particle.MUON),
- Particle.getBaseParticle(Particle.TAU),
- Particle.getBaseParticle(Particle.ELECTRON_NEUTRINO),
- Particle.getBaseParticle(Particle.MUON_NEUTRINO),
- Particle.getBaseParticle(Particle.TAU_NEUTRINO),
- },
- null,
- new int[] { 600, 40, 20, 15, 10, 5 },
- 20 * 300 * 8,
- (int) MaterialUtils.getVoltageForTier(7),
- 750 * 20);
-
- // Boson Smash
- CORE.RA.addCyclotronRecipe(
- CI.getNumberedCircuit(9),
- FluidUtils.getFluidStack("plasma.helium", 1500),
- new ItemStack[] {
- Particle.getBaseParticle(Particle.GLUON),
- Particle.getBaseParticle(Particle.PHOTON),
- Particle.getBaseParticle(Particle.Z_BOSON),
- Particle.getBaseParticle(Particle.W_BOSON),
- Particle.getBaseParticle(Particle.HIGGS_BOSON),
- },
- null,
- new int[] { 160, 260, 150, 150, 1 },
- 20 * 300 * 6,
- (int) MaterialUtils.getVoltageForTier(7),
- 750 * 20);
-
-
- // Mixed Smash 1
- CORE.RA.addCyclotronRecipe(
- CI.getNumberedCircuit(12),
- FluidUtils.getFluidStack("plasma.beryllium", 2500),
- new ItemStack[] {
- Particle.getBaseParticle(Particle.GRAVITON),
- Particle.getBaseParticle(Particle.ETA_MESON),
- Particle.getBaseParticle(Particle.PION),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.NEUTRON),
- Particle.getBaseParticle(Particle.LAMBDA),
- Particle.getBaseParticle(Particle.OMEGA),
- Particle.getBaseParticle(Particle.HIGGS_BOSON),
- },
- null,
- new int[] { 10, 20, 20, 10, 10, 5, 5, 2 },
- 17 * 247 * 32,
- (int) MaterialUtils.getVoltageForTier(8),
- 750 * 20);
-
- // Graviton Smash
- CORE.RA.addCyclotronRecipe(
- CI.getNumberedCircuit(15),
- FluidUtils.getFluidStack("plasma.hydrogen", GTNH ? 50 : 10),
- new ItemStack[] {
- Particle.getBaseParticle(Particle.GRAVITON),
- Particle.getBaseParticle(Particle.UNKNOWN)
- },
- null,
- new int[] {15, 100},
- 20 * (GTNH ? 90 : 30),
- (int) MaterialUtils.getVoltageForTier(6),
- 1000 * 20);
-
- FluidStack aPlasma = Materials.Duranium.getMolten(GTNH ? 40 : 10);
- FluidStack aPlasma_NULL = Materials._NULL.getPlasma(1);
-
- if (aPlasma == null || aPlasma.isFluidEqual(aPlasma_NULL)) {
- aPlasma = Materials.Americium.getMolten(GTNH ? 20 : 5);
- }
-
- // Quantum Anomaly
- CORE.RA.addCyclotronRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(24),
- Particle.getBaseParticle(Particle.UNKNOWN),
- },
- aPlasma,
- new ItemStack[] {
- GregtechItemList.Laser_Lens_Special.get(1)
- },
- null,
- new int[] {100},
- 20 * (GTNH ? 25 : 60),
- (int) MaterialUtils.getVoltageForTier(8),
- 500 * 20);
-
- /*
- * Ions
- */
-
- int IonCount = 2;
- int tenCountA = (GTNH ? 2 : 1);
- int tenCountB = 0;
- for (String y : IonParticles.MetaToNameMap.values()) {
- if (y.toLowerCase().contains("hydrogen")) {
- continue;
- }
- FluidStack aPlasma2 = FluidUtils.getFluidStack("plasma."+y.toLowerCase(), 2);
- Materials aTestMat = MaterialUtils.getMaterial(y);
- FluidStack aPlasma3 = aTestMat != null ? aTestMat.getPlasma(2) : aPlasma2;
-
- // Ionize Plasma
- if ((aPlasma2 != null && !aPlasma2.isFluidEqual(aPlasma_NULL)) || (aPlasma3 != null && !aPlasma3.isFluidEqual(aPlasma_NULL))) {
- CORE.RA.addCyclotronRecipe(
- CI.getNumberedCircuit(1+(tenCountA-1)),
- aPlasma2 != null ? aPlasma2 : aPlasma3,
- new ItemStack[] {
- Particle.getIon(y, 1),
- Particle.getIon(y, 2),
- Particle.getIon(y, 3),
- Particle.getIon(y, -1),
- Particle.getIon(y, -2),
- Particle.getIon(y, -3),
- Particle.getIon(y, 1),
- Particle.getIon(y, 2),
- Particle.getIon(y, -1),
- },
- null,
- new int[] { 275, 250, 225, 275, 250, 225, 275, 250, 275},
- 20 * 20 * (IonCount++) * tenCountA,
- (int) MaterialUtils.getVoltageForTier(7),
- 1500 * 20 * tenCountA);
- }
- else {
- Logger.INFO("Plasma for "+y+" does not exist, please report this to Alkalus.");
- }
-
- if (tenCountB == 12) {
- tenCountB = 0;
- tenCountA++;
- }
- else {
- tenCountB++;
- }
- }
-
- // Generate Hydrogen Ion Recipe
- CORE.RA.addCyclotronRecipe(
- CI.getNumberedCircuit(24),
- FluidUtils.getWildcardFluidStack("hydrogen", 1000),
- new ItemStack[] {
- Particle.getIon("Hydrogen", 1),
- Particle.getIon("Hydrogen", 2),
- Particle.getIon("Hydrogen", 3),
- Particle.getIon("Hydrogen", 1),
- Particle.getIon("Hydrogen", 2),
- Particle.getIon("Hydrogen", 3),
- Particle.getIon("Hydrogen", -1),
- Particle.getIon("Hydrogen", -2),
- Particle.getIon("Hydrogen", -3)
- },
- null,
- new int[] { 500, 500, 500, 500, 500, 500, 500, 500, 500 },
- 20 * 20,
- (int) MaterialUtils.getVoltageForTier(6),
- 2500);
-
- // Generate Hydrogen Plasma Recipe
- CORE.RA.addCyclotronRecipe(
- new ItemStack[] {
- Particle.getIon("Hydrogen", 0),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1)
- },
- null,
- new ItemStack[] {
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.NEUTRON),
- Particle.getBaseParticle(Particle.ELECTRON),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- CI.emptyCells(1)
- },
- FluidUtils.getFluidStack("plasma.hydrogen", 100),
- new int[] { 1250, 1250, 1250, 750, 750, 750, 10000 },
- 20 * 60 * 2,
- (int) MaterialUtils.getVoltageForTier(6),
- 750 * 20);
-
- CORE.RA.addCyclotronRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(21),
- Particle.getIon("Hydrogen", 0),
- },
- FluidUtils.getFluidStack("hydrogen", 1000),
- new ItemStack[] {
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.NEUTRON),
- Particle.getBaseParticle(Particle.ELECTRON),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- },
- FluidUtils.getFluidStack("plasma.hydrogen", 100),
- new int[] { 1250, 1250, 1250, 750, 750, 750 },
- 20 * 60 * 2,
- (int) MaterialUtils.getVoltageForTier(6),
- 750 * 20);
-
-
- // Generate Protons Easily
- CORE.RA.addCyclotronRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(20),
- Particle.getIon("Hydrogen", 0)
- },
- FluidUtils.getWildcardFluidStack("hydrogen", 100),
- new ItemStack[] {
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- },
- null,
- new int[] { 750, 750, 750, 750, 750, 750, 750, 750, 750 },
- 20 * 20,
- (int) MaterialUtils.getVoltageForTier(6),
- 1500);
-
- CORE.RA.addCyclotronRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(22),
- Particle.getBaseParticle(Particle.UNKNOWN),
- },
- FluidUtils.getWildcardFluidStack("hydrogen", 100),
- new ItemStack[] {
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- Particle.getBaseParticle(Particle.PROTON),
- },
- null,
- new int[] { 375, 375, 375, 375, 375, 375, 375, 375, 375 },
- 20 * 20,
- (int) MaterialUtils.getVoltageForTier(6),
- 1500);
-
-
- //Create Strange Dust
- CORE.RA.addCyclotronRecipe(
- new ItemStack[] {
- ELEMENT.getInstance().PLUTONIUM238.getDust(1),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- Particle.getBaseParticle(Particle.UNKNOWN),
- },
- FluidUtils.getFluidStack(FluidUtils.getWildcardFluidStack("ender", 1000), 1000),
- new ItemStack[] {
- ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT.getDust(1)
- },
- null,
- new int[] { 2500 },
- 20 * 60 * 15,
- (int) MaterialUtils.getVoltageForTier(7),
- 250);
-
- }
-
- private static void sifterRecipes() {
-
- }
-
- private static void electroMagneticSeperatorRecipes() {
-
- if (!GTNH) {
- // Trinium
- GT_Values.RA.addElectromagneticSeparatorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedNaquadah", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustNaquadah", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallNaquadahEnriched", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1), new int[] { 10000, 2500, 5000 },
- 20 * 20, 24);
-
- // Trinium
- GT_Values.RA.addElectromagneticSeparatorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIridium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustIridium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallOsmium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1), new int[] { 10000, 2500, 5000 },
- 20 * 20, 24);
-
- // Trinium
- GT_Values.RA.addElectromagneticSeparatorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedWulfenite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustWulfenite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1), new int[] { 10000, 3000, 3000 },
- 20 * 20, 24);
- }
-
- }
-
- private static void advancedMixerRecipes() {
- // HgBa2Ca2Cu3O8
- /*CORE.RA.addMixerRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("cellMercury", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustBarium", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalcium", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 3),
- FluidUtils.getFluidStack("oxygen", 8000),
- null, CI.emptyCells(1), ALLOY.HG1223.getDust(16), null, null,
- 30 * 20, 500); */
-
- }
-
+ public static void run() {
+ Logger.INFO("Loading Recipes through GregAPI for Industrial Multiblocks.");
+ execute();
+ }
+
+ private static void execute() {
+ cokeOvenRecipes();
+ electrolyzerRecipes();
+ assemblerRecipes();
+ fluidcannerRecipes();
+ distilleryRecipes();
+ extractorRecipes();
+ fluidExtractorRecipes();
+ chemicalBathRecipes();
+ chemicalReactorRecipes();
+ dehydratorRecipes();
+ blastFurnaceRecipes();
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ largeChemReactorRecipes();
+ fusionRecipes();
+ }
+
+ fissionFuelRecipes();
+ autoclaveRecipes();
+ compressorRecipes();
+ mixerRecipes();
+ macerationRecipes();
+ centrifugeRecipes();
+ benderRecipes();
+ cyclotronRecipes();
+ blastSmelterRecipes();
+ // advancedMixerRecipes();
+ sifterRecipes();
+ electroMagneticSeperatorRecipes();
+ extruderRecipes();
+ cuttingSawRecipes();
+ breweryRecipes();
+ laserEngraverRecipes();
+ assemblyLineRecipes();
+ latheRecipes();
+ vacuumFreezerRecipes();
+ fluidheaterRecipes();
+ chemplantRecipes();
+ packagerRecipes();
+ alloySmelterRecipes();
+ implosionRecipes();
+
+ /**
+ * Special Recipe handlers
+ */
+ RECIPES_SeleniumProcessing.init();
+ RECIPES_RareEarthProcessing.init();
+
+ addFuels();
+ }
+
+ private static void alloySmelterRecipes() {
+
+ // Wood's Glass Laser Lens
+ GT_Values.RA.addAlloySmelterRecipe(
+ MISC_MATERIALS.WOODS_GLASS.getDust(5),
+ ItemList.Shape_Mold_Ball.get(0),
+ GregtechItemList.Laser_Lens_WoodsGlass.get(1),
+ 20 * 300,
+ MaterialUtils.getVoltageForTier(3));
+ }
+
+ private static void packagerRecipes() {}
+
+ private static void implosionRecipes() {
+
+ // GT_Values.RA.addImplosionRecipe(
+ // ItemUtils.getSimpleStack(ModItems.itemSunnariumBit, 9),
+ // 16,
+ // ItemUtils.getSimpleStack(AdvancedSolarPanel.itemSunnariumPart, 1),
+ // GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Glowstone, 8));
+
+ }
+
+ private static void chemplantRecipes() {
+
+ // This is subsequently absorbed in water to form nitric acid and nitric oxide.
+ // 3 NO2 (g) + H2O (l) → 2 HNO3 (aq) + NO (g) (ΔH = −117 kJ/mol)
+ // The nitric oxide is cycled back for reoxidation. Alternatively, if the last step is carried out in air:
+ // 4 NO2 (g) + O2 (g) + 2 H2O (l) → 4 HNO3 (aq)
+
+ // Advanced method for Nitric Acid Production
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(17), CI.getPinkCatalyst(0),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(GenericChem.Nitrogen_Dioxide, 4000),
+ FluidUtils.getAir(4000),
+ FluidUtils.getWater(2000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack("nitricacid", 4000),
+ },
+ 10 * 20,
+ 480,
+ 3);
+
+ // Advanced recipe for Fluorine Production
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(17),
+ CI.getPurpleCatalyst(0),
+ ItemUtils.getSimpleStack(Blocks.sandstone, 64),
+ ItemUtils.getSimpleStack(Blocks.sandstone, 64)
+ },
+ new FluidStack[] {FluidUtils.getFluidStack("nitricacid", 4000), FluidUtils.getAir(8000)},
+ new ItemStack[] {
+ FLUORIDES.FLUORITE.getOre(8),
+ FLUORIDES.FLUORITE.getOre(4),
+ FLUORIDES.FLUORITE.getOre(4),
+ FLUORIDES.FLUORITE.getOre(4),
+ },
+ new FluidStack[] {},
+ new int[] {0, 2500, 2000, 1500},
+ 10 * 20,
+ 1024,
+ 5);
+
+ // Advanced recipe for Fluorine Production
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(17),
+ CI.getPurpleCatalyst(0),
+ ItemUtils.getSimpleStack(Blocks.sand, 64),
+ ItemUtils.getSimpleStack(Blocks.sand, 64)
+ },
+ new FluidStack[] {FluidUtils.getFluidStack("nitricacid", 5000), FluidUtils.getAir(12000)},
+ new ItemStack[] {
+ FLUORIDES.FLUORITE.getOre(4),
+ FLUORIDES.FLUORITE.getOre(2),
+ FLUORIDES.FLUORITE.getOre(2),
+ FLUORIDES.FLUORITE.getOre(2),
+ },
+ new FluidStack[] {},
+ new int[] {7500, 1500, 1000, 500},
+ 10 * 20,
+ 1024,
+ 5);
+
+ // 3NO2 + H2O = 2HNO3 + NO
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(16), CI.getPinkCatalyst(0),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(GenericChem.Nitrogen_Dioxide, 3000), FluidUtils.getDistilledWater(1000)
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack("nitricacid", 2000),
+ FluidUtils.getFluidStack(GenericChem.Nitric_Oxide, 1000),
+ },
+ 10 * 20,
+ 480,
+ 2);
+
+ // Produce Boric Acid
+ // Na2B4O7·10H2O + 2HCl = 4B(OH)3 + 2NaCl + 5H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(21), ItemUtils.getItemStackOfAmountFromOreDict("dustBorax", 23),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack(GenericChem.HydrochloricAcid, 2000)},
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSalt", 4),
+ },
+ new FluidStack[] {FluidUtils.getFluidStack("boricacid", 4000), FluidUtils.getWater(5000)},
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(3),
+ 3);
+
+ // Produce Th232
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(22),
+ ELEMENT.getInstance().THORIUM.getDust(16)
+ },
+ new FluidStack[] {FluidUtils.getDistilledWater(2000), FluidUtils.getFluidStack("boricacid", 1500)},
+ new ItemStack[] {
+ ELEMENT.getInstance().THORIUM.getSmallDust(32),
+ ELEMENT.getInstance().THORIUM232.getDust(2),
+ ELEMENT.getInstance().THORIUM232.getSmallDust(2),
+ ELEMENT.getInstance().URANIUM232.getDust(1),
+ },
+ new FluidStack[] {},
+ new int[] {0, 0, 1000, 250},
+ 20 * 300,
+ MaterialUtils.getVoltageForTier(4),
+ 4);
+
+ // Modify Sapling into Pine Sapling
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getNumberedBioCircuit(6), ItemUtils.getSimpleStack(Blocks.sapling, 32)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack("fluid.geneticmutagen", 2000), FluidUtils.getDistilledWater(8000)
+ },
+ new ItemStack[] {ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Pine, 16)},
+ new FluidStack[] {},
+ 120 * 20,
+ 64,
+ 2);
+
+ // Convert GT++ Plutonium239 into normal Plutonium
+ if (Materials.Plutonium.mDefaultLocalName.equals("Plutonium 239")) {
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(16),
+ ELEMENT.getInstance().PLUTONIUM239.getDust(1)
+ },
+ new FluidStack[] {},
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustPlutonium", 1)},
+ new FluidStack[] {},
+ 5 * 20,
+ 1,
+ 2);
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(16),
+ ELEMENT.getInstance().PLUTONIUM239.getSmallDust(1)
+ },
+ new FluidStack[] {},
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustSmallPlutonium", 1)},
+ new FluidStack[] {},
+ 5 * 20,
+ 1,
+ 2);
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(16),
+ ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1)
+ },
+ new FluidStack[] {},
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustTinyPlutonium", 1)},
+ new FluidStack[] {},
+ 5 * 20,
+ 1,
+ 2);
+ }
+
+ int aLaureniumTier = ALLOY.LAURENIUM.vTier;
+ // Adding Recipes for Casings
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(12),
+ CI.getTieredMachineCasing(aLaureniumTier - 1),
+ ALLOY.LAURENIUM.getPlate(8),
+ CI.getGear(aLaureniumTier, 2)
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(aLaureniumTier, 2 * 144),
+ CI.getAlternativeTieredFluid(aLaureniumTier - 1, 4 * 144),
+ CI.getTertiaryTieredFluid(aLaureniumTier - 2, 6 * 144)
+ },
+ new ItemStack[] {GregtechItemList.Casing_Machine_Custom_3.get(1)},
+ new FluidStack[] {},
+ 20 * 20,
+ MaterialUtils.getVoltageForTier(aLaureniumTier - 2),
+ 5);
+
+ int aBotmiumTier = ALLOY.BOTMIUM.vTier;
+ // Adding Recipes for Casings
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(12),
+ CI.getTieredMachineCasing(aBotmiumTier - 1),
+ ALLOY.BOTMIUM.getPlate(8),
+ CI.getGear(aBotmiumTier, 2)
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(aBotmiumTier, 2 * 144),
+ CI.getAlternativeTieredFluid(aBotmiumTier - 1, 4 * 144),
+ CI.getTertiaryTieredFluid(aBotmiumTier - 2, 6 * 144)
+ },
+ new ItemStack[] {GregtechItemList.Casing_Machine_Custom_4.get(1)},
+ new FluidStack[] {},
+ 20 * 20,
+ MaterialUtils.getVoltageForTier(aBotmiumTier - 2),
+ 6);
+
+ // Refine GT HF into GT++ HF
+ if (FluidUtils.doesHydrofluoricAcidGtExist()) {
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(22),
+ },
+ new FluidStack[] {FluidUtils.getHydrofluoricAcid(2000), FluidUtils.getHydrofluoricAcidGT(5000)},
+ new ItemStack[] {},
+ new FluidStack[] {FluidUtils.getHydrofluoricAcid(4500)},
+ 30 * 20,
+ 480,
+ 3);
+ }
+ }
+
+ private static void fluidheaterRecipes() {
+ GT_Values.RA.addFluidHeaterRecipe(
+ CI.getNumberedCircuit(20), FluidUtils.getWater(1000), FluidUtils.getHotWater(1000), 30, 30);
+ }
+
+ private static void vacuumFreezerRecipes() {
+ GT_Values.RA.addVacuumFreezerRecipe(
+ GregtechItemList.Bomb_Cast_Molten.get(1), GregtechItemList.Bomb_Cast_Set.get(1), 20 * 30);
+ }
+
+ private static void latheRecipes() {
+
+ GT_Values.RA.addLatheRecipe(
+ ALLOY.EGLIN_STEEL.getBlock(1), GregtechItemList.Bomb_Cast_Mold.get(1), null, 20 * 60 * 15, 120);
+
+ GT_Values.RA.addLatheRecipe(
+ GregtechItemList.Bomb_Cast_Set.get(1),
+ GregtechItemList.Bomb_Cast_Broken.get(2),
+ ItemUtils.getSimpleStack(ModItems.itemBombCasing, 2),
+ 20 * 60 * 5,
+ 30);
+ }
+
+ private static void fusionRecipes() {
+
+ /**
+ * Adds a Fusion reactor Recipe
+ *
+ * @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)
+ */
+
+ // Hydrogen Plasma
+ /*CORE.RA.addFusionReactorRecipe(
+ Particle.getIon("Hydrogen", 0),
+ Particle.getIon("Hydrogen", 0),
+ Materials.Hydrogen.getPlasma(1),
+ 5000,
+ 16,
+ 4096,
+ 40000000);*/
+
+ // Hypogen Creation
+ GT_Values.RA.addFusionReactorRecipe(
+ ELEMENT.STANDALONE.DRAGON_METAL.getFluidStack(144),
+ ELEMENT.STANDALONE.RHUGNOR.getFluidStack(288),
+ ELEMENT.STANDALONE.HYPOGEN.getFluidStack(36),
+ 2048 * 4,
+ MaterialUtils.getVoltageForTier(9),
+ 600000000 * 2);
+
+ // Rhugnor
+ GT_Values.RA.addFusionReactorRecipe(
+ MaterialUtils.getMaterial("Infinity", "Neutronium").getMolten(144),
+ ALLOY.QUANTUM.getFluidStack(288),
+ ELEMENT.STANDALONE.RHUGNOR.getFluidStack(144),
+ 512,
+ MaterialUtils.getVoltageForTier(8),
+ 2000000000);
+ }
+
+ private static void assemblyLineRecipes() {
+
+ ItemStack[] aCoilWire = new ItemStack[] {
+ ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 0, GTNH ? 64 : 32),
+ ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 1, GTNH ? 64 : 32),
+ ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 2, GTNH ? 64 : 32),
+ ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 3, GTNH ? 64 : 32),
+ };
+
+ // Containment Casings
+ CORE.RA.addAssemblylineRecipe(
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_1_CONTAINMENT, 1),
+ 20 * 60 * 30,
+ new Object[] {
+ ItemList.Field_Generator_IV.get(GTNH ? 32 : 16),
+ ItemList.Electric_Motor_EV.get(GTNH ? 64 : 32),
+ ItemList.Energy_LapotronicOrb.get(GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.cableGt12, 7, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.wireGt16, 6, GTNH ? 64 : 32),
+ ItemUtils.getOrePrefixStack(OrePrefixes.plate, Materials.Naquadria, GTNH ? 64 : 16),
+ ELEMENT.getInstance().GADOLINIUM.getDust(GTNH ? 32 : 8),
+ ELEMENT.getInstance().SAMARIUM.getDust(GTNH ? 16 : 4),
+ ALLOY.ARCANITE.getGear(GTNH ? 8 : 2),
+ new Object[] {CI.getTieredCircuitOreDictName(5), 64},
+ new Object[] {CI.getTieredCircuitOreDictName(6), 32},
+ new Object[] {CI.getTieredCircuitOreDictName(7), 16},
+ GregtechItemList.Laser_Lens_Special.get(1),
+ aCoilWire[3]
+ },
+ new FluidStack[] {
+ ALLOY.NITINOL_60.getFluidStack(144 * 9 * (GTNH ? 4 : 2)),
+ ALLOY.ENERGYCRYSTAL.getFluidStack(144 * 9 * (GTNH ? 8 : 4)),
+ ALLOY.TUMBAGA.getFluidStack(144 * 9 * (GTNH ? 32 : 8)),
+ ALLOY.NICHROME.getFluidStack(144 * 1 * (GTNH ? 16 : 4)),
+ },
+ ItemUtils.getSimpleStack(ModBlocks.blockCasings3Misc, 15, 32),
+ 20 * 60 * 10 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(6));
+
+ // Slow Fusion Controller
+ /*CORE.RA.addAssemblylineRecipe(
+ GregtechItemList.COMET_Cyclotron.get(1),
+ 20 * 60 * 30,
+ new ItemStack[] {
+ CI.getFieldGenerator(6, GTNH ? 32 : 8),
+ ItemList.Electric_Motor_EV.get(GTNH ? 32 : 8),
+ ItemList.Tool_Scanner.get(GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.cableGt12, 6, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.wireGt16, 5, GTNH ? 64 : 32),
+ CI.getTieredComponent(OrePrefixes.plate, 6, GTNH ? 64 : 32),
+ ELEMENT.getInstance().GADOLINIUM.getDust(GTNH ? 32 : 8),
+ ELEMENT.getInstance().SAMARIUM.getDust(GTNH ? 16 : 4),
+ ALLOY.INCOLOY_MA956.getGear(GTNH ? 8 : 2),
+ CI.getTieredComponent(OrePrefixes.circuit, 5, GTNH ? 64 : 32),
+ CI.getTieredComponent(OrePrefixes.circuit, 6, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 16 : 8)
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(6, 144 * 9 * (GTNH ? 8 : 4)),
+ CI.getTertiaryTieredFluid(6, 144 * 9 * (GTNH ? 8 : 4)),
+ CI.getAlternativeTieredFluid(6, 144 * 9 * (GTNH ? 8 : 4)),
+ CI.getTieredFluid(5, 144 * 9 * (GTNH ? 16 : 8)),
+ },
+ GregtechItemList.Miniature_Fusion.get(1),
+ 20 * 60 * 5 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(7));*/
+
+ // Plasma Tank
+ /*CORE.RA.addAssemblylineRecipe(
+ ItemUtils.getOrePrefixStack(OrePrefixes.pipeMedium, Materials.Superconductor, 1),
+ 20 * 60 * 5,
+ new ItemStack[] {
+ CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.circuit, 5, GTNH ? 16 : 4),
+ CI.getTieredComponent(OrePrefixes.pipeHuge, 5, GTNH ? 16 : 4),
+ CI.getTieredComponent(OrePrefixes.cableGt08, 7, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.gearGt, 6, GTNH ? 8 : 4),
+ aCoilWire[2]
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(4, 144 * 9 * (GTNH ? 16 : 8)),
+ CI.getTertiaryTieredFluid(4, 144 * 9 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(4, 144 * 9 * (GTNH ? 16 : 8)),
+
+ },
+ GregtechItemList.Plasma_Tank.get(1),
+ 20 * 60 * 1 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(5));*/
+
+ // Turbine Automation Port
+ CORE.RA.addAssemblylineRecipe(
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_8_TURBINE_AUTOMATION, 1),
+ 20 * 60 * 60 * 24,
+ new Object[] {
+ CI.getTieredMachineHull(8, 4),
+ CI.getConveyor(8, GTNH ? 24 : 12),
+ CI.getElectricMotor(7, GTNH ? 32 : 16),
+ CI.getElectricPiston(7, GTNH ? 16 : 4),
+ CI.getEnergyCore(6, GTNH ? 8 : 2),
+ CI.getPlate(8, GTNH ? 24 : 12),
+ CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 48 : 24),
+ CI.getTieredComponent(OrePrefixes.bolt, 7, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 12 : 6),
+ new Object[] {CI.getTieredCircuitOreDictName(7), 20},
+ CI.getTieredComponent(OrePrefixes.rotor, 6, GTNH ? 16 : 8),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(8, 144 * 32),
+ CI.getAlternativeTieredFluid(7, 144 * 16),
+ CI.getTertiaryTieredFluid(7, 144 * 16),
+ ALLOY.BABBIT_ALLOY.getFluidStack(128 * 144),
+ ALLOY.ZERON_100.getFluidStack(144 * 64)
+ },
+ GregtechItemList.Hatch_Input_TurbineHousing.get(4),
+ 20 * 60 * 60 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(8));
+
+ /*
+ * Contianment casings
+ */
+
+ ItemStack[] aGemCasings = new ItemStack[] {
+ GregtechItemList.Battery_Casing_Gem_1.get(1),
+ GregtechItemList.Battery_Casing_Gem_2.get(1),
+ GregtechItemList.Battery_Casing_Gem_3.get(1),
+ GregtechItemList.Battery_Casing_Gem_4.get(1),
+ };
+ ItemStack[] aResearch = new ItemStack[] {
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ GregtechItemList.Battery_Casing_Gem_1.get(1),
+ GregtechItemList.Battery_Casing_Gem_2.get(1),
+ GregtechItemList.Battery_Casing_Gem_3.get(1),
+ };
+
+ int aCasingSlot = 0;
+ for (int j = 6; j < 10; j++) {
+ CORE.RA.addAssemblylineRecipe(
+ aResearch[aCasingSlot],
+ 20 * 60 * 60,
+ new ItemStack[] {
+ CI.getTieredComponent(OrePrefixes.plate, j - 1, 16),
+ CI.getTieredComponent(OrePrefixes.cableGt08, j + 1, (GTNH ? 32 : 16)),
+ CI.getTieredComponent(OrePrefixes.gearGt, j - 1, 4),
+ aCoilWire[aCasingSlot]
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(j, 144 * (GTNH ? 8 : 4)),
+ CI.getTertiaryTieredFluid(j - 2, 144 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(j, 144 * (GTNH ? 16 : 12)),
+ },
+ aGemCasings[aCasingSlot++],
+ 20 * 60 * 1 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(j));
+ }
+
+ /*
+ * Gem Battery Recipes
+ */
+
+ ItemStack[] aGemBatteries = new ItemStack[] {
+ GregtechItemList.Battery_Gem_1.get(1),
+ GregtechItemList.Battery_Gem_2.get(1),
+ GregtechItemList.Battery_Gem_3.get(1),
+ GregtechItemList.Battery_Gem_4.get(1),
+ };
+
+ ItemStack[] aExoticInputs = new ItemStack[] {
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.ELECTRON),
+ Particle.getBaseParticle(Particle.CHARM),
+ Particle.getBaseParticle(Particle.GRAVITON)
+ };
+ aCasingSlot = 0;
+ for (int j = 6; j < 10; j++) {
+ CORE.RA.addAssemblylineRecipe(
+ aExoticInputs[aCasingSlot],
+ 20 * 60 * 60 * 5,
+ new Object[] {
+ aGemCasings[aCasingSlot],
+ ItemUtils.getSimpleStack(aExoticInputs[aCasingSlot], 16),
+ CI.getTieredComponent(OrePrefixes.plate, j, 16),
+ new Object[] {CI.getTieredCircuitOreDictName(j), 8},
+ CI.getTieredComponent(OrePrefixes.wireGt16, j + 1, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.bolt, j, GTNH ? 8 : 4),
+ CI.getTieredComponent(OrePrefixes.screw, j - 1, GTNH ? 8 : 4),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(j, 144 * 1 * (GTNH ? 16 : 8)),
+ CI.getTertiaryTieredFluid(j - 2, 144 * 2 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(j, 144 * (GTNH ? 16 : 8)),
+ CI.getTertiaryTieredFluid(j - 1, 144 * (GTNH ? 16 : 8)),
+ },
+ aGemBatteries[aCasingSlot++],
+ 20 * 60 * 1 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(j));
+ }
+
+ if (LoadedMods.Baubles) {
+ // Nano Healer
+ CORE.RA.addAssemblylineRecipe(
+ ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1),
+ 20 * 60 * 10,
+ new Object[] {
+ ItemUtils.getSimpleStack(aGemCasings[2], GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.plate, 8, GTNH ? 32 : 16),
+ new Object[] {CI.getTieredCircuitOreDictName(7), 16},
+ CI.getTieredComponent(OrePrefixes.cableGt02, 7, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.gearGt, 6, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.screw, 7, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.bolt, 5, GTNH ? 24 : 12),
+ CI.getTieredComponent(OrePrefixes.frameGt, 4, GTNH ? 12 : 6),
+ aCoilWire[3]
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getTertiaryTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(6, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
+ },
+ ItemUtils.getItemStackFromFQRN("miscutils:personalHealingDevice", 1),
+ 20 * 60 * 30 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(7));
+
+ // Charge Pack LuV-UV
+
+ ItemStack[] aChargeResearch = new ItemStack[] {
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore7", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore8", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore9", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore10", 1),
+ };
+
+ ItemStack[] aChargeOutputs = new ItemStack[] {
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_1, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_2, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_3, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_4, 1),
+ };
+
+ int aCurrSlot = 0;
+ for (int h = 6; h < 10; h++) {
+ CORE.RA.addAssemblylineRecipe(
+ aChargeResearch[aCurrSlot],
+ 20 * 60 * 10 * (aCurrSlot + 1),
+ new Object[] {
+ ItemUtils.getSimpleStack(aGemBatteries[aCurrSlot], 2),
+ aCoilWire[aCurrSlot],
+ CI.getTieredComponent(OrePrefixes.plate, h, 8),
+ new Object[] {CI.getTieredCircuitOreDictName(h), 4},
+ new Object[] {CI.getTieredCircuitOreDictName(h - 1), 8},
+ CI.getTieredComponent(OrePrefixes.cableGt12, h - 1, 16),
+ CI.getTieredComponent(OrePrefixes.screw, h, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.bolt, h - 2, GTNH ? 32 : 16),
+ CI.getFieldGenerator(h, 1),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(h, 144 * 4 * (GTNH ? 8 : 4)),
+ CI.getTertiaryTieredFluid(h - 1, 144 * 4 * (GTNH ? 8 : 4)),
+ CI.getAlternativeTieredFluid(h - 1, 144 * 4 * (GTNH ? 8 : 4)),
+ CI.getAlternativeTieredFluid(h - 2, 144 * 4 * (GTNH ? 8 : 4)),
+ },
+ aChargeOutputs[aCurrSlot],
+ 20 * 60 * 30 * (GTNH ? 2 : 1) * (aCurrSlot + 1),
+ (int) MaterialUtils.getVoltageForTier(h));
+ aCurrSlot++;
+ }
+
+ // Cloaking device
+ CORE.RA.addAssemblylineRecipe(
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_9_CLOAKING, 1),
+ 20 * 60 * 10,
+ new Object[] {
+ ItemUtils.getSimpleStack(aGemCasings[3], GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.plate, 8, GTNH ? 32 : 16),
+ new Object[] {CI.getTieredCircuitOreDictName(7), 16},
+ CI.getTieredComponent(OrePrefixes.cableGt04, 8, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.gearGt, 7, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.bolt, 7, GTNH ? 24 : 12),
+ CI.getTieredComponent(OrePrefixes.frameGt, 5, GTNH ? 12 : 6),
+ aCoilWire[3]
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(8, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getTertiaryTieredFluid(8, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(8, 144 * 18 * (GTNH ? 16 : 8)),
+ },
+ ItemUtils.getItemStackFromFQRN("miscutils:personalCloakingDevice", 1),
+ 20 * 60 * 30 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(8));
+ }
+ }
+
+ private static void laserEngraverRecipes() {
+
+ // Laser Sensors and Emitters together
+ GregtechItemList[] aTransParts = new GregtechItemList[] {
+ GregtechItemList.TransmissionComponent_ULV,
+ GregtechItemList.TransmissionComponent_LV,
+ GregtechItemList.TransmissionComponent_MV,
+ GregtechItemList.TransmissionComponent_HV,
+ GregtechItemList.TransmissionComponent_EV,
+ GregtechItemList.TransmissionComponent_IV,
+ GregtechItemList.TransmissionComponent_LuV,
+ GregtechItemList.TransmissionComponent_ZPM,
+ GregtechItemList.TransmissionComponent_UV,
+ GregtechItemList.TransmissionComponent_MAX,
+ };
+ for (int i = 0; i < 10; i++) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ CI.getEmitter(i, 2),
+ CI.getSensor(i, 2),
+ aTransParts[i].get(1),
+ 20 * 5,
+ MaterialUtils.getVoltageForTier(i));
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ false,
+ new ItemStack[] {aTransParts[i].get(1)},
+ new ItemStack[] {CI.getEmitter(i, 2), CI.getSensor(i, 2)},
+ null,
+ null,
+ new FluidStack[] {GT_Values.NF},
+ new FluidStack[] {GT_Values.NF},
+ Math.max(300 >> Math.max(i - 1, 0), 1),
+ MaterialUtils.getVoltageForTier(i),
+ 0);
+ }
+
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Tungsten, 6L),
+ GregtechItemList.Laser_Lens_Special.get(0),
+ ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN.getDust(1),
+ 20 * 60 * 3,
+ MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN.vTier));
+
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Titanium, 8L),
+ GregtechItemList.Laser_Lens_Special.get(0),
+ ELEMENT.STANDALONE.ASTRAL_TITANIUM.getDust(1),
+ 20 * 60 * 2,
+ MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.ASTRAL_TITANIUM.vTier));
+
+ GT_Values.RA.addLaserEngraverRecipe(
+ ALLOY.NITINOL_60.getBlock(2),
+ GregtechItemList.Laser_Lens_Special.get(0),
+ ELEMENT.STANDALONE.ADVANCED_NITINOL.getBlock(1),
+ 20 * 60 * 1,
+ MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.ADVANCED_NITINOL.vTier));
+
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 64L),
+ GregtechItemList.Laser_Lens_Special.get(0),
+ ELEMENT.STANDALONE.CHRONOMATIC_GLASS.getDust(1),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.CHRONOMATIC_GLASS.vTier));
+
+ GT_Values.RA.addLaserEngraverRecipe(
+ CI.getFieldGenerator(6, 1),
+ CI.getEmitter(7, 2),
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_1_CONTAINMENT, 1),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(5));
+
+ // Distillus Upgrade Chip
+ GT_Values.RA.addLaserEngraverRecipe(
+ GregtechItemList.Laser_Lens_WoodsGlass.get(0),
+ ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, 20, 1),
+ GregtechItemList.Distillus_Upgrade_Chip.get(1),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(5));
+
+ // GT_Values.RA.addLaserEngraverRecipe(
+ // GregtechItemList.Laser_Lens_WoodsGlass.get(0),
+ // ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 8, 1),
+ // ItemUtils.getSimpleStack(ModItems.itemSunnariumBit, 3),
+ // 20 * 60 * 5,
+ // MaterialUtils.getVoltageForTier(3));
+
+ }
+
+ private static void breweryRecipes() {
+ CORE.RA.addBrewingRecipe(
+ 14, EnchantingUtils.getMobEssence(100), EnchantingUtils.getLiquidXP(1332), 100, 120, false);
+ CORE.RA.addBrewingRecipe(
+ 14, EnchantingUtils.getLiquidXP(1332), EnchantingUtils.getMobEssence(100), 100, 120, false);
+ CORE.RA.addBrewingRecipe(
+ ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest),
+ FluidUtils.getFluidStack("water", 100),
+ FluidUtils.getFluidStack("biomass", 100),
+ 1200,
+ 3,
+ false);
+ CORE.RA.addBrewingRecipe(
+ ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest),
+ FluidUtils.getFluidStack("honey", 100),
+ FluidUtils.getFluidStack("biomass", 150),
+ 1200,
+ 3,
+ false);
+ CORE.RA.addBrewingRecipe(
+ ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest),
+ FluidUtils.getFluidStack("juice", 100),
+ FluidUtils.getFluidStack("biomass", 150),
+ 1200,
+ 3,
+ false);
+ }
+
+ private static void cuttingSawRecipes() {
+ GT_Values.RA.addCutterRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("blockMeatRaw", 1), // Input
+ ItemUtils.getItemStackOfAmountFromOreDict("plateMeatRaw", 9), // Output
+ null,
+ 16, // Time
+ 8); // EU
+ }
+
+ private static void electrolyzerRecipes() {
+ GT_Values.RA.addElectrolyzerRecipe(
+ ItemUtils.getSimpleStack(ModItems.dustDecayedRadium226, 1),
+ null,
+ null,
+ FluidUtils.getFluidStack("radon", !GTNH ? 500 : 144),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ new int[] {},
+ 20 * 90,
+ 240);
+ }
+
+ private static void extruderRecipes() {
+ // Osmium Credits
+ if (GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("blockOsmium", 1),
+ ItemList.Shape_Mold_Credit.get(0),
+ ItemList.Credit_Greg_Osmium.get(1),
+ (int) Math.max(Materials.Osmium.getMass() * 2L * 20, 1),
+ 1024)) {
+ Logger.WARNING("Extruder Recipe: Osmium Credit - Success");
+ } else {
+ Logger.WARNING("Extruder Recipe: Osmium Credit - Failed");
+ }
+ }
+
+ private static void blastSmelterRecipes() {
+
+ if (!GTNH) {
+ // Trinium
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(8),
+ ELEMENT.getInstance().BISMUTH.getDust(8),
+ ELEMENT.getInstance().IRON.getDust(64),
+ ELEMENT.getInstance().CARBON.getDust(16),
+ ELEMENT.getInstance().GOLD.getDust(16),
+ ELEMENT.getInstance().SILVER.getDust(16),
+ ELEMENT.getInstance().OSMIUM.getDust(4),
+ ELEMENT.getInstance().IRIDIUM.getDust(4),
+ ELEMENT.getInstance().CERIUM.getDust(8)
+ },
+ FluidUtils.getFluidStack("molten.trinium", 136 * 144),
+ 0,
+ 20 * 3000,
+ 2040 * 4);
+ }
+
+ // Eglin Steel
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(6),
+ ELEMENT.getInstance().IRON.getDust(4),
+ ALLOY.KANTHAL.getDust(1),
+ ALLOY.INVAR.getDust(5),
+ ELEMENT.getInstance().SULFUR.getDust(1),
+ ELEMENT.getInstance().CARBON.getDust(1),
+ ELEMENT.getInstance().SILICON.getDust(4)
+ },
+ ALLOY.EGLIN_STEEL.getFluidStack(16 * 144),
+ 0,
+ 20 * 45,
+ 120);
+
+ // HG1223
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(5),
+ ELEMENT.getInstance().MERCURY.getCell(1),
+ ELEMENT.getInstance().BARIUM.getDust(2),
+ ELEMENT.getInstance().CALCIUM.getDust(2),
+ ELEMENT.getInstance().COPPER.getDust(3),
+ },
+ ELEMENT.getInstance().OXYGEN.getFluidStack(8000),
+ ALLOY.HG1223.getFluidStack(16 * 144),
+ new ItemStack[] {CI.emptyCells(1)},
+ new int[] {10000}, // Output Chance
+ 20 * 120,
+ 30720);
+
+ // NITINOL_60
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(2),
+ ELEMENT.getInstance().TITANIUM.getDust(3),
+ ELEMENT.getInstance().NICKEL.getDust(2)
+ },
+ ALLOY.NITINOL_60.getFluidStack(5 * 144),
+ 0,
+ 20 * 75,
+ 7680);
+
+ // INDALLOY_140
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(5),
+ ELEMENT.getInstance().BISMUTH.getDust(47),
+ ELEMENT.getInstance().LEAD.getDust(25),
+ ELEMENT.getInstance().TIN.getDust(13),
+ ELEMENT.getInstance().CADMIUM.getDust(10),
+ ELEMENT.getInstance().INDIUM.getDust(5)
+ },
+ ALLOY.INDALLOY_140.getFluidStack(100 * 144),
+ 0,
+ 20 * 40,
+ 7680);
+
+ // Germanium Roasting
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(15),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedSphalerite", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(2000),
+ ELEMENT.getInstance().GERMANIUM.getFluidStack(288),
+ 0,
+ 20 * 300,
+ 4000);
+
+ // Ruthenium Roasting
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(19),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIridium", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(2000),
+ ELEMENT.getInstance().RUTHENIUM.getFluidStack(288),
+ 0,
+ 20 * 300,
+ 8000);
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(19),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedOsmium", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(2000),
+ ELEMENT.getInstance().RUTHENIUM.getFluidStack(288),
+ 0,
+ 20 * 300,
+ 8000);
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(19),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPlatinum", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(2000),
+ ELEMENT.getInstance().RUTHENIUM.getFluidStack(288),
+ 0,
+ 20 * 300,
+ 8000);
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(19),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCooperite", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(8000),
+ ELEMENT.getInstance().RUTHENIUM.getFluidStack(144),
+ 0,
+ 20 * 300,
+ 8000);
+
+ // Rhenium Roasting
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(20),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedScheelite", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(10000),
+ ELEMENT.getInstance().RHENIUM.getFluidStack(144),
+ 0,
+ 20 * 300,
+ 4000);
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(20),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedMolybdenite", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(7500),
+ ELEMENT.getInstance().RHENIUM.getFluidStack(144),
+ 0,
+ 20 * 300,
+ 4000);
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(20),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedMolybdenum", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(5000),
+ ELEMENT.getInstance().RHENIUM.getFluidStack(288),
+ 0,
+ 20 * 300,
+ 4000);
+
+ // Thallium Roasting
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(21),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIron", 12),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPyrite", 16),
+ ELEMENT.getInstance().CARBON.getDust(64),
+ },
+ Materials.SulfuricAcid.getFluid(5000),
+ ELEMENT.getInstance().THALLIUM.getFluidStack(288 + 144),
+ 0,
+ 20 * 300,
+ 8000);
+
+ // Strontium processing
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(21),
+ MISC_MATERIALS.STRONTIUM_OXIDE.getDust(8),
+ ELEMENT.getInstance().ALUMINIUM.getDust(8),
+ },
+ null,
+ ELEMENT.getInstance().OXYGEN.getFluidStack(8000),
+ new ItemStack[] {
+ ELEMENT.getInstance().ALUMINIUM.getIngot(8),
+ ELEMENT.getInstance().STRONTIUM.getIngot(8)
+ },
+ new int[] {10000, 10000}, // Output Chance
+ 20 * 120,
+ 480 * 4);
+ }
+
+ private static void fluidcannerRecipes() {
+ // Sulfuric Acid
+ CORE.RA.addFluidCannerRecipe(
+ ItemUtils.getSimpleStack(Items.glass_bottle),
+ ItemUtils.getSimpleStack(ModItems.itemSulfuricPotion),
+ FluidUtils.getFluidStack("sulfuricacid", 250),
+ null);
+ CORE.RA.addFluidCannerRecipe(
+ ItemUtils.getSimpleStack(ModItems.itemSulfuricPotion),
+ ItemUtils.getSimpleStack(Items.glass_bottle),
+ null,
+ FluidUtils.getFluidStack("sulfuricacid", 250));
+
+ // Hydrofluoric Acid
+ boolean addedGtExtraction = false;
+ // Try use Internal GT Fluid first
+ if (Utils.getGregtechVersionAsInt() >= 50929) {
+ // Hydrofluoric Acid
+ CORE.RA.addFluidCannerRecipe(
+ ItemUtils.getSimpleStack(Items.glass_bottle),
+ ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion),
+ FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 250),
+ null);
+ addedGtExtraction = CORE.RA.addFluidCannerRecipe(
+ ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion),
+ ItemUtils.getSimpleStack(Items.glass_bottle),
+ null,
+ FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 250));
+ }
+ // Add a Fill recipe for GT++ Acid
+ CORE.RA.addFluidCannerRecipe(
+ ItemUtils.getSimpleStack(Items.glass_bottle),
+ ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion),
+ FluidUtils.getFluidStack("hydrofluoricacid", 125),
+ null);
+ // Add an empty recipe, but only if we didn't for the standard GT HF. Prevents Fluid transformation exploits.
+ if (!addedGtExtraction) {
+ CORE.RA.addFluidCannerRecipe(
+ ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion),
+ ItemUtils.getSimpleStack(Items.glass_bottle),
+ null,
+ FluidUtils.getFluidStack("hydrofluoricacid", 125));
+ }
+
+ // Gelid Cryotheum
+ CORE.RA.addFluidExtractionRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCryotheum", 1),
+ FluidUtils.getFluidStack("cryotheum", 250),
+ 200,
+ 240);
+
+ // Ender Fluid
+ CORE.RA.addFluidExtractionRecipe(
+ ItemUtils.getSimpleStack(Items.ender_pearl), FluidUtils.getFluidStack("ender", 250), 100, 30);
+
+ // Blazing Pyrotheum
+ CORE.RA.addFluidExtractionRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1),
+ FluidUtils.getFluidStack("pyrotheum", 250),
+ 200,
+ 240);
+ }
+
+ private static void cokeOvenRecipes() {
+ Logger.INFO("Loading Recipes for Industrial Coking Oven.");
+ // Wood to Charcoal
+ // Try use all woods found
+ ArrayList<ItemStack> aLogData = OreDictionary.getOres("logWood");
+ if (aLogData.isEmpty()) {
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(
+ GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 20L),
+ 20,
+ GT_ModHandler.getSteam(1000),
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 24L),
+ FluidUtils.getFluidStack("fluid.coalgas", 1440),
+ 60,
+ 30);
+ } else {
+ for (ItemStack stack : aLogData) {
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(
+ ItemUtils.getSimpleStack(stack, 20),
+ 20,
+ GT_ModHandler.getSteam(1000),
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 24L),
+ FluidUtils.getFluidStack("fluid.coalgas", 1440),
+ 60,
+ 30);
+ }
+ }
+
+ // Coal to Coke
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 16L),
+ 22,
+ GT_ModHandler.getSteam(1000),
+ ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 10),
+ FluidUtils.getFluidStack("fluid.coalgas", 2880),
+ 30,
+ 120);
+
+ // Coke & Coal
+ CORE.RA.addCokeOvenRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 12L),
+ ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 6),
+ GT_ModHandler.getSteam(2000),
+ FluidUtils.getFluidStack("fluid.coalgas", 5040),
+ ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 14),
+ 60 * 20,
+ 240);
+ }
+
+ private static void matterFabRecipes() {
+ Logger.INFO("Loading Recipes for Matter Fabricator.");
+
+ try {
+
+ CORE.RA.addMatterFabricatorRecipe(
+ Materials.UUAmplifier.getFluid(1L), // Fluid
+ // Input
+ Materials.UUMatter.getFluid(1L), // Fluid Output
+ 800, // Time in ticks
+ 32); // EU
+ } catch (final NullPointerException e) {
+ Logger.INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
+ }
+ try {
+
+ CORE.RA.addMatterFabricatorRecipe(
+ null, // Fluid Input
+ Materials.UUMatter.getFluid(1L), // Fluid Output
+ 3200, // Time in ticks
+ 32); // EU
+ } catch (final NullPointerException e) {
+ Logger.INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
+ }
+ }
+
+ private static void dehydratorRecipes() {
+ Logger.INFO("Loading Recipes for Chemical Dehydrator.");
+
+ ItemStack cropGrape = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cropGrape", 1);
+ ItemStack foodRaisins = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foodRaisins", 1);
+
+ if (cropGrape != null && foodRaisins != null)
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedBioCircuit(20), cropGrape}, // Item
+ null, // Fluid input (slot 1)
+ null, // Fluid output (slot 2)
+ new ItemStack[] {foodRaisins}, // Output
+ new int[] {10000},
+ 10, // Time in ticks
+ 2); // EU
+
+ // Process Waste Water
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedBioCircuit(21)},
+ FluidUtils.getFluidStack("fluid.sludge", 1000),
+ FluidUtils.getFluidStack("nitricacid", 10),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyIron", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCopper", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyTin", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyNickel", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCobalt", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAluminium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinySilver", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyGold", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyIridium", 1)
+ },
+ new int[] {10, 5, 5, 4, 4, 3, 2, 2, 1},
+ 2 * 20,
+ 500); // EU
+
+ // C8H10 = C8H8 + 2H
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(18), CI.emptyCells(3)},
+ FluidUtils.getFluidStack("fluid.ethylbenzene", 1000),
+ null,
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellStyrene", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2)
+ },
+ new int[] {10000, 10000},
+ 3 * 20,
+ 30);
+
+ /*
+ * Try Add custom Recipe for drying leather
+ */
+ if (LoadedMods.PamsHarvestcraft && Loader.isModLoaded("Backpack")) {
+ ItemStack aLeather1, aLeather2;
+ aLeather1 = ItemUtils.getCorrectStacktype("harvestcraft:hardenedleatherItem", 1);
+ aLeather2 = ItemUtils.getCorrectStacktype("Backpack:tannedLeather", 1);
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(18), aLeather1},
+ FluidUtils.getFluidStack("fluid.ethylbenzene", 1000),
+ null,
+ new ItemStack[] {aLeather2},
+ new int[] {10000},
+ 5 * 20,
+ 180);
+ }
+ // Alternative ACETIC ANHYDRIDE recipe for Kevlar Line
+ // 2C2H4O2 = C4H6O3 + H2O
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(18), CI.emptyCells(1)},
+ FluidUtils.getFluidStack("aceticacid", 2000),
+ MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1),
+ },
+ new int[] {10000},
+ 30 * 20,
+ 480);
+ }
+
+ private static void largeChemReactorRecipes() {
+ // Styrene
+ // C8H10 = C8H8 + 2H
+ CORE.RA.addMultiblockChemicalRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(24)},
+ new FluidStack[] {FluidUtils.getFluidStack("fluid.ethylbenzene", 1000)},
+ new FluidStack[] {MaterialUtils.getMaterial("Styrene").getFluid(1000), Materials.Hydrogen.getGas(2000)},
+ null,
+ 30,
+ 30);
+ // Short-cut Styrene
+ // C6H6 + C2H4 = C8H8 + 2H
+ CORE.RA.addMultiblockChemicalRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(24)},
+ new FluidStack[] {
+ MaterialUtils.getMaterial("Ethylene").getGas(500),
+ MaterialUtils.getMaterial("Benzene").getFluid(500)
+ },
+ new FluidStack[] {MaterialUtils.getMaterial("Styrene").getFluid(500), Materials.Hydrogen.getGas(1000)},
+ null,
+ 240,
+ 120);
+ }
+
+ private static void fissionFuelRecipes() {
+ try {
+
+ } catch (final NullPointerException e) {
+ Logger.INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
+ }
+ }
+
+ private static void assemblerRecipes() {
+ // ItemUtils.getSimpleStack(GregtechItemList.Casing_Vanadium_Redox.get(1)
+ addAR(
+ ItemUtils.getItemStackOfAmountFromOreDict("plateVanadium", 32),
+ ItemUtils.getItemStackOfAmountFromOreDict("frameGtVanadiumSteel", 8),
+ FluidUtils.getFluidStack("oxygen", 8000),
+ ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 0, 4),
+ 16,
+ 60);
+ addAR(
+ ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 0, 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateVanadiumGallium", 8),
+ FluidUtils.getFluidStack("molten.tantalum", 144 * 4),
+ ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 1, 8),
+ 32,
+ 120);
+
+ /*
+ addAR(ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 1, 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseLead", 4), FluidUtils.getFluidStack("oxygen", 16000),
+ ItemUtils.getSimpleStack(GregtechItemList.Casing_Vanadium_Redox.get(1), 1), 64, 240);
+ */
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.simpleMetaStack(ModItems.itemHalfCompleteCasings, 1, 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseLead", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(3), 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorHV", 2)
+ },
+ FluidUtils.getFluidStack("oxygen", 16000),
+ ItemUtils.getSimpleStack(GregtechItemList.Casing_Vanadium_Redox.get(1), 1),
+ 64,
+ 240);
+
+ // Tier 2-6
+ ItemStack T1 = GregtechItemList.Casing_Vanadium_Redox.get(1);
+ ItemStack T2 = GregtechItemList.Casing_Vanadium_Redox_IV.get(1);
+ ItemStack T3 = GregtechItemList.Casing_Vanadium_Redox_LuV.get(1);
+ ItemStack T4 = GregtechItemList.Casing_Vanadium_Redox_ZPM.get(1);
+ ItemStack T5 = GregtechItemList.Casing_Vanadium_Redox_UV.get(1);
+ ItemStack T6 = GregtechItemList.Casing_Vanadium_Redox_MAX.get(1);
+
+ /*
+ addAR(T1,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseTitanium", 4),
+ FluidUtils.getFluidStack("nitrogen", 16000),
+ T2, 120, 2000);
+ */
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ T1,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseTitanium", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorEV", 2)
+ },
+ FluidUtils.getFluidStack("nitrogen", 16000),
+ T2,
+ 120,
+ 2000);
+
+ /*
+ addAR(T2,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseTungstenSteel", 4),
+ FluidUtils.getFluidStack("helium", 8000),
+ T3, 250, 8000);
+ */
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ T2,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseTungstenSteel", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(5), 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorIV", 2)
+ },
+ FluidUtils.getFluidStack("helium", 8000),
+ T3,
+ 250,
+ 8000);
+ /*
+ addAR(T3,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 16),
+ FluidUtils.getFluidStack("argon", 4000),
+ T4, 500, 32000);
+ */
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ T3,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 16),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorLuV", 2)
+ },
+ FluidUtils.getFluidStack("argon", 4000),
+ T4,
+ 500,
+ 32000);
+ /*
+ addAR(T4,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseNaquadah", 4),
+ FluidUtils.getFluidStack("radon", 4000),
+ T5, 1000, 128000);
+ */
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ T4,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseNaquadah", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorZPM", 2)
+ },
+ FluidUtils.getFluidStack("radon", 4000),
+ T5,
+ 1000,
+ 128000);
+ /*
+ addAR(T5,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseAmericium", 4),
+ FluidUtils.getFluidStack("krypton", 500),
+ T6, 2000, 512000);
+ */
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ T5,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseAmericium", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(8), 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireGt01SuperconductorUV", 2)
+ },
+ FluidUtils.getFluidStack("krypton", 500),
+ T6,
+ 2000,
+ 512000);
+
+ addAR(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustClay", 32),
+ GregtechItemList.Bomb_Cast_Mold.get(0),
+ FluidUtils.getWater(4000),
+ GregtechItemList.Bomb_Cast.get(4),
+ 30,
+ 120);
+ addAR(
+ ItemUtils.getSimpleStack(Items.redstone, 32),
+ ItemUtils.getSimpleStack(ModItems.itemRope, 16),
+ Materials.Glue.getFluid(500),
+ ItemUtils.getSimpleStack(ModItems.itemDetCable, 24),
+ 30,
+ 120);
+
+ /*addAR(ItemUtils.getItemStackOfAmountFromOreDict("plateIncoloy020", 16),
+ ItemUtils.getItemStackOfAmountFromOreDict("frameGtIncoloyMA956", 4), null,
+ GregtechItemList.Casing_Power_SubStation.get(4), 80, 120);*/
+
+ /*CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ GregtechItemList.Casing_Multi_Use.get(1),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 1),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 8),
+ CI.sensor_HV,
+ CI.emitter_HV,
+ CI.fieldGenerator_HV,
+ },
+ null,
+ ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame),
+ 20*20,
+ 2048);
+
+ */
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {ItemUtils.getSimpleStack(ModItems.itemRope, 6)},
+ null,
+ ItemUtils.getSimpleStack(ModBlocks.blockNet, 2),
+ 1 * 20,
+ 8);
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(CI.explosiveITNT, 2),
+ ItemUtils.getSimpleStack(CI.explosiveTNT, 4),
+ ELEMENT.getInstance().SULFUR.getDust(2),
+ ELEMENT.getInstance().IRON.getFrameBox(1)
+ },
+ null,
+ ItemUtils.getSimpleStack(ModBlocks.blockMiningExplosive, 3),
+ 5 * 20,
+ 60);
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Items.nether_star),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateTungstenSteel", 8),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickBlackSteel", 8)
+ },
+ null,
+ ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard, 64),
+ 30 * 20,
+ 500);
+
+ ItemStack aFluidReg1 = ItemUtils.getValueOfItemList("FluidRegulator_LV", ItemList.Pump_LV)
+ .get(1);
+ ItemStack aFluidReg2 = ItemUtils.getValueOfItemList("FluidRegulator_MV", ItemList.Pump_MV)
+ .get(1);
+ ItemStack aFluidReg3 = ItemUtils.getValueOfItemList("FluidRegulator_HV", ItemList.Pump_HV)
+ .get(1);
+ ItemStack aFluidReg4 = ItemUtils.getValueOfItemList("FluidRegulator_EV", ItemList.Pump_EV)
+ .get(1);
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ aFluidReg1,
+ CI.electricMotor_LV,
+ CI.getTieredComponent(OrePrefixes.bolt, 1, GTNH ? 8 : 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("ringBrass", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickBrass", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateSteel", 2)
+ },
+ null,
+ ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 1, 1),
+ 10 * 20,
+ 30);
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ aFluidReg2,
+ CI.electricMotor_MV,
+ CI.getTieredComponent(OrePrefixes.bolt, 2, GTNH ? 8 : 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("ringInvar", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickInvar", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateAluminium", 2)
+ },
+ null,
+ ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 2, 1),
+ 10 * 20 * 2,
+ 120);
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ aFluidReg3,
+ CI.electricMotor_HV,
+ CI.getTieredComponent(OrePrefixes.bolt, 3, GTNH ? 8 : 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("ringChrome", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickChrome", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateStainlessSteel", 2)
+ },
+ null,
+ ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 3, 1),
+ 10 * 20 * 3,
+ 480);
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ aFluidReg4,
+ CI.electricMotor_EV,
+ CI.getTieredComponent(OrePrefixes.bolt, 4, GTNH ? 8 : 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("ringTitanium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickTitanium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateTungstenSteel", 2)
+ },
+ null,
+ ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 4, 1),
+ 10 * 20 * 4,
+ 1960);
+
+ GT_Values.RA.addAssemblerRecipe(
+ ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 1, 1),
+ CI.getNumberedCircuit(20),
+ ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1000, 1),
+ 30,
+ 30);
+ GT_Values.RA.addAssemblerRecipe(
+ ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 2, 1),
+ CI.getNumberedCircuit(20),
+ ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1001, 1),
+ 120,
+ 120);
+ GT_Values.RA.addAssemblerRecipe(
+ ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 3, 1),
+ CI.getNumberedCircuit(20),
+ ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1002, 1),
+ 480,
+ 480);
+ GT_Values.RA.addAssemblerRecipe(
+ ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 4, 1),
+ CI.getNumberedCircuit(20),
+ ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1003, 1),
+ 1820,
+ 1820);
+
+ // Low tier Charge Packs
+
+ final ItemStack[] aPackBatteries = new ItemStack[] {
+ ItemList.Battery_RE_LV_Lithium.get(4),
+ ItemList.Battery_RE_MV_Lithium.get(4),
+ ItemList.Battery_RE_HV_Lithium.get(4),
+ GregtechItemList.Battery_RE_EV_Lithium.get(4),
+ ItemList.Energy_LapotronicOrb.get(4),
+ };
+ final ItemStack[] aPackPlates = new ItemStack[] {
+ CI.getPlate(1, 8), CI.getPlate(2, 8), CI.getPlate(3, 8), CI.getPlate(4, 8), CI.getPlate(5, 8),
+ };
+ final ItemStack[] aPackWire = new ItemStack[] {
+ CI.getTieredComponent(OrePrefixes.wireGt02, 1, 6),
+ CI.getTieredComponent(OrePrefixes.wireGt04, 2, 6),
+ CI.getTieredComponent(OrePrefixes.wireGt08, 3, 6),
+ CI.getTieredComponent(OrePrefixes.wireGt12, 4, 6),
+ CI.getTieredComponent(OrePrefixes.wireGt16, 5, 6),
+ };
+ final ItemStack[] aPackCircuit = new ItemStack[] {
+ CI.getTieredComponent(OrePrefixes.circuit, 1, 4),
+ CI.getTieredComponent(OrePrefixes.circuit, 2, 4),
+ CI.getTieredComponent(OrePrefixes.circuit, 3, 4),
+ CI.getTieredComponent(OrePrefixes.circuit, 4, 4),
+ CI.getTieredComponent(OrePrefixes.circuit, 5, 4),
+ };
+ final ItemStack[] aPackRing = new ItemStack[] {
+ CI.getTieredComponent(OrePrefixes.ring, 1, 12),
+ CI.getTieredComponent(OrePrefixes.ring, 2, 12),
+ CI.getTieredComponent(OrePrefixes.ring, 3, 12),
+ CI.getTieredComponent(OrePrefixes.ring, 4, 12),
+ CI.getTieredComponent(OrePrefixes.ring, 5, 12),
+ };
+ final ItemStack[] aPackOutput = new ItemStack[] {
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_2),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_3),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_4),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_5)
+ };
+
+ for (int i = 1; i < 6; i++) {
+
+ int aAS = i - 1;
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ aPackPlates[aAS],
+ aPackRing[aAS],
+ aPackWire[aAS],
+ aPackCircuit[aAS],
+ aPackBatteries[aAS],
+ CI.getSensor(i, GTNH ? 4 : 2),
+ },
+ CI.getTieredFluid(i, (144 * (GTNH ? 4 : 2))),
+ aPackOutput[aAS],
+ 30 * 20 * i,
+ (int) GT_Values.V[i]);
+ }
+
+ if (!GTNH) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.WroughtIron, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 2L),
+ GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]),
+ 50,
+ 32);
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Bronze, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 2L),
+ GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]),
+ 50,
+ 32);
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Brass, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 2L),
+ GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]),
+ 75,
+ 32);
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Invar, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 2L),
+ GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]),
+ 75,
+ 32);
+
+ } else {
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 8L),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 4L),
+ GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]),
+ 50,
+ 32);
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bronze, 8L),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 4L),
+ GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]),
+ 50,
+ 32);
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Brass, 8L),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 4L),
+ GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]),
+ 75,
+ 32);
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 8L),
+ GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 4L),
+ GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]),
+ 75,
+ 32);
+ }
+ }
+
+ if (LoadedMods.Baubles) {
+
+ // Turbine Housing Research Page
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(17),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateTrinium", GTNH ? 64 : 32),
+ CI.getSensor(6, GTNH ? 6 : 3),
+ CI.getBolt(7, GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFinePlatinum", GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), GTNH ? 12 : 6)
+ },
+ CI.getAlternativeTieredFluid(7, 144 * 32),
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_8_TURBINE_AUTOMATION, 1),
+ 20 * 60 * 5,
+ (int) GT_Values.V[6]);
+
+ // Cloaking Device Research Page
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(17),
+ ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR, 4),
+ CI.getFieldGenerator(6, GTNH ? 16 : 8),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFinePalladium", GTNH ? 32 : 16),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), GTNH ? 12 : 6)
+ },
+ CI.getAlternativeTieredFluid(7, 144 * 32),
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_9_CLOAKING, 1),
+ 20 * 60 * 10,
+ (int) GT_Values.V[7]);
+
+ // Supreme Pizza Gloves
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(19),
+ ItemUtils.getSimpleStack(ModItems.itemRope, GTNH ? 32 : 16),
+ ItemUtils.getItemStackOfAmountFromOreDict("gearGtSmallWroughtIron", GTNH ? 8 : 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 32 : 16),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), GTNH ? 2 : 1)
+ },
+ FluidUtils.getFluidStack("molten.rubber", 2000),
+ ItemUtils.getSimpleStack(ModItems.itemPersonalFireProofDevice),
+ 20 * 60 * 5,
+ 30);
+ }
+ }
+
+ private static boolean addAR(
+ final ItemStack inputA,
+ final ItemStack inputB,
+ final FluidStack inputFluidA,
+ final ItemStack outputA,
+ final int seconds,
+ final int voltage) {
+ // return GT_Values.RA.addAssemblerRecipe(inputA, inputB, outputA,
+ // seconds*20, voltage);
+ return GT_Values.RA.addAssemblerRecipe(inputA, inputB, inputFluidA, outputA, seconds * 20, voltage);
+ }
+
+ private static void distilleryRecipes() {
+ Logger.INFO("Registering Distillery/Distillation Tower Recipes.");
+ GT_Values.RA.addDistilleryRecipe(
+ ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]),
+ FluidUtils.getFluidStack("air", 1000),
+ FluidUtils.getFluidStack("helium", 1),
+ 400,
+ 30,
+ false);
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("air", 20000),
+ FluidUtils.getFluidStackArray("helium", 25),
+ ItemUtils.getSimpleStack(ModItems.itemHydrogenBlob, 1),
+ 200,
+ 60);
+
+ // Apatite Distillation
+ /*
+ * so if you dissolve aparite in sulphuric acid you'll get a mixture of
+ * SO2, H2O, HF and HCl
+ */
+ final FluidStack[] apatiteOutput = {
+ FluidUtils.getFluidStack("sulfurousacid", 3800),
+ FluidUtils.getFluidStack("hydrogenchloride", 1000),
+ FluidUtils.getFluidStack("hydrofluoricacid", 400)
+ };
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("sulfuricapatite", 5200), apatiteOutput, null, 45 * 20, 120);
+
+ final FluidStack[] sulfurousacidOutput = {
+ FluidUtils.getFluidStack("sulfurdioxide", 500), FluidUtils.getFluidStack("water", 500)
+ };
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("sulfurousacid", 1000), sulfurousacidOutput, null, 10 * 20, 60);
+
+ if (!GTNH) {
+ final FluidStack[] sulfurdioxideOutput = {FluidUtils.getFluidStack("oxygen", 2000)};
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("sulfurdioxide", 144 * 3),
+ sulfurdioxideOutput,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1),
+ 5 * 20,
+ 30);
+ }
+ }
+
+ private static void addFuels() {
+ Logger.INFO("Registering New Fuels.");
+
+ if (!GTNH) {
+ GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketFire_water", 0, 1), null, 120, 0);
+ GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0);
+ GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0);
+ }
+
+ HotFuel.addNewHotFuel(
+ FluidUtils.getLava(83),
+ FluidUtils.getPahoehoeLava(83),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("nuggetCopper", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("nuggetTin", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("nuggetGold", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("nuggetSilver", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("nuggetTantalum", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTungstate", 1),
+ ItemUtils.getSimpleStack(Blocks.obsidian)
+ },
+ new int[] {2000, 1000, 250, 250, 250, 250, 500},
+ 0);
+
+ HotFuel.addNewHotFuel(
+ FluidUtils.getPahoehoeLava(83),
+ GT_Values.NF,
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("nuggetBronze", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("nuggetElectrum", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("nuggetTantalum", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTungstate", 1),
+ ItemUtils.getSimpleStack(Blocks.obsidian)
+ },
+ new int[] {750, 250, 250, 250, 1850},
+ 0);
+
+ HotFuel.addNewHotFuel(
+ MISC_MATERIALS.SOLAR_SALT_HOT.getFluidStack(1000),
+ MISC_MATERIALS.SOLAR_SALT_COLD.getFluidStack(1000),
+ FluidUtils.getSuperHeatedSteam(10000),
+ 0);
+
+ /*
+ * HotFuel.addNewHotFuel( FluidUtils.getFluidStack("ic2hotcoolant",
+ * 100), GT_Values.NF, new ItemStack[]{}, new int[]{}, 0);
+ */
+
+ ThermalFuel.addSteamTurbineFuel(FluidUtils.getFluidStack("steam", 1024));
+
+ // CORE.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel",
+ // 0, 1), null, 112, 0);
+ GT_Values.RA.addFuel(ItemUtils.getSimpleStack(Items.lava_bucket), null, 32, 2);
+ GT_Values.RA.addFuel(ItemUtils.getIC2Cell(2), null, 32, 2);
+ GT_Values.RA.addFuel(ItemUtils.getIC2Cell(11), null, 24, 2);
+ // System.exit(1);
+ }
+
+ private static void extractorRecipes() {
+ Logger.INFO("Registering Extractor Recipes.");
+ GT_ModHandler.addExtractionRecipe(
+ GregtechItemList.Battery_RE_EV_Sodium.get(1L, new Object[0]),
+ ItemList.Battery_Hull_HV.get(4L, new Object[0]));
+ GT_ModHandler.addExtractionRecipe(
+ GregtechItemList.Battery_RE_EV_Cadmium.get(1L, new Object[0]),
+ ItemList.Battery_Hull_HV.get(4L, new Object[0]));
+ GT_ModHandler.addExtractionRecipe(
+ GregtechItemList.Battery_RE_EV_Lithium.get(1L, new Object[0]),
+ ItemList.Battery_Hull_HV.get(4L, new Object[0]));
+ }
+
+ private static void fluidExtractorRecipes() {}
+
+ private static void chemicalBathRecipes() {}
+
+ private static void centrifugeRecipes() {
+
+ GT_Values.RA.addCentrifugeRecipe(
+ CI.getNumberedAdvancedCircuit(2),
+ MISC_MATERIALS.SOLAR_SALT_COLD.getCell(5),
+ null,
+ null,
+ MISC_MATERIALS.SODIUM_NITRATE.getDust(15),
+ MISC_MATERIALS.POTASSIUM_NITRATE.getDust(10),
+ CI.emptyCells(5),
+ null,
+ null,
+ null,
+ null,
+ 20 * 30,
+ 120);
+ }
+
+ private static void mixerRecipes() {
+
+ // S + 2O = SO2
+ GT_Values.RA.addMixerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1),
+ null,
+ null,
+ null,
+ FluidUtils.getFluidStack("oxygen", 2000),
+ FluidUtils.getFluidStack("sulfurdioxide", 1000),
+ null,
+ 600,
+ 60);
+
+ GT_Values.RA.addMixerRecipe(
+ CI.getNumberedAdvancedCircuit(2),
+ CI.emptyCells(5),
+ MISC_MATERIALS.SODIUM_NITRATE.getDust(15),
+ MISC_MATERIALS.POTASSIUM_NITRATE.getDust(10),
+ null,
+ null,
+ MISC_MATERIALS.SOLAR_SALT_COLD.getCell(5),
+ 20 * 10,
+ 120);
+ }
+
+ private static void chemicalReactorRecipes() {
+
+ // Bombs
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getSimpleStack(ModItems.itemBombCasing, 4),
+ ItemUtils.getSimpleStack(RocketFuels.Ammonium_Nitrate_Dust, 8),
+ Materials.Fuel.getFluid(1000),
+ null,
+ ItemUtils.getSimpleStack(ModItems.itemBombUnf, 4),
+ 300 * 20);
+
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getSimpleStack(ModItems.itemBombUnf, 4),
+ ItemUtils.getSimpleStack(ModItems.itemDetCable, 4),
+ FluidUtils.getFluidStack(RocketFuels.Kerosene, 100),
+ null,
+ ItemUtils.getSimpleStack(ModItems.itemBomb, 4),
+ 10 * 20);
+
+ GT_Values.RA.addChemicalRecipe(
+ CI.getNumberedAdvancedCircuit(21),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustApatite", 32),
+ FluidUtils.getFluidStack("sulfuricacid", 4000),
+ FluidUtils.getFluidStack("sulfuricapatite", 8000),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSulfur", 8),
+ 20 * 20);
+
+ // KOH + HNO3 = KNO3 + H2O
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getSimpleStack(GenericChem.mPotassiumHydroxide, 3),
+ CI.getNumberedAdvancedCircuit(1),
+ Materials.NitricAcid.getFluid(1000),
+ Materials.Water.getFluid(1000),
+ MISC_MATERIALS.POTASSIUM_NITRATE.getDust(5),
+ 100,
+ 30);
+
+ // Na2CO3 + 2HNO3 = 2NaNO3 + CO2 + H2O
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6),
+ CI.getNumberedAdvancedCircuit(1),
+ Materials.NitricAcid.getFluid(2000),
+ Materials.CarbonDioxide.getGas(1000),
+ MISC_MATERIALS.SODIUM_NITRATE.getDust(10),
+ 100,
+ 30);
+ }
+
+ private static void blastFurnaceRecipes() {
+
+ // public boolean addBlastRecipe(
+ // ItemStack aInput1, ItemStack aInput2,
+ // FluidStack aFluidInput, FluidStack aFluidOutput,
+ // ItemStack aOutput1, ItemStack aOutput2,
+ // int aDuration, int aEUt, int aLevel)
+
+ // Synthetic Graphite
+ GT_Values.RA.addBlastRecipe(
+ CI.getNumberedCircuit(22),
+ ALLOY.SILICON_CARBIDE.getDust(16),
+ ELEMENT.getInstance().NITROGEN.getFluidStack(4000),
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 8),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSilicon", 8),
+ 60 * 20,
+ MaterialUtils.getVoltageForTier(GTNH ? 5 : 4),
+ 4500);
+
+ // Bomb Casings
+ GT_Values.RA.addBlastRecipe(
+ GregtechItemList.Bomb_Cast.get(4),
+ ALLOY.STEEL.getDust(16),
+ ELEMENT.getInstance().OXYGEN.getFluidStack(2000),
+ GT_Values.NF,
+ GregtechItemList.Bomb_Cast_Molten.get(4),
+ null,
+ 4 * 60 * 20,
+ MaterialUtils.getVoltageForTier(GTNH ? 3 : 2),
+ 2800);
+
+ // Krypton Processing
+ if (ModItems.itemHotTitaniumIngot != null) {
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("ingotTitanium", 1),
+ CI.getNumberedCircuit(16),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("ingotHotTitanium", 1),
+ null,
+ 10 * 20,
+ 500,
+ Materials.Titanium.mBlastFurnaceTemp);
+ }
+ }
+
+ private static void autoclaveRecipes() {}
+
+ private static void benderRecipes() {
+ if (CORE.ConfigSwitches.enableMultiblock_PowerSubstation) {
+ GT_Values.RA.addBenderRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("ingotVanadium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateVanadium", 1),
+ 8,
+ 16);
+ }
+ }
+
+ private static void compressorRecipes() {
+ GT_ModHandler.addCompressionRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustClay", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateClay", 1));
+ GT_ModHandler.addCompressionRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateMeatRaw", 1));
+ GT_ModHandler.addCompressionRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 9),
+ ItemUtils.getItemStackOfAmountFromOreDict("blockMeatRaw", 1));
+ CORE.RA.addCompressorRecipe(
+ ItemList.FusionComputer_UV.get(9),
+ GregtechItemList.Compressed_Fusion_Reactor.get(1),
+ (int) GT_Values.V[7],
+ (int) GT_Values.V[8]);
+ }
+
+ private static void macerationRecipes() {
+
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("blockMeatRaw", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 9));
+
+ GT_ModHandler.addPulverisationRecipe(
+ GregtechItemList.Bomb_Cast_Broken.get(1), ItemUtils.getItemStackOfAmountFromOreDict("dustClay", 3));
+
+ if (ItemUtils.simpleMetaStack("chisel:limestone", 0, 1) != null) {
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("limestone", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalcite", 4));
+ }
+ }
+
+ private static void cyclotronRecipes() {
+
+ // Polonium
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(1),
+ FluidUtils.getFluidStack("molten.bismuth", 1),
+ new ItemStack[] {GregtechItemList.Pellet_RTG_PO210.get(1)},
+ null,
+ new int[] {100},
+ 20 * 300 * 100,
+ 2040 * 4,
+ 500 * 20);
+
+ // Americium
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(1),
+ FluidUtils.getFluidStack("molten.americium", 1),
+ new ItemStack[] {GregtechItemList.Pellet_RTG_AM241.get(4)},
+ null,
+ new int[] {2500},
+ 20 * 300 * 100,
+ 1020 * 4,
+ 500 * 20); // PO Special Value
+
+ // Strontium u235
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(1),
+ FluidUtils.getFluidStack("molten.uranium235", 10),
+ new ItemStack[] {GregtechItemList.Pellet_RTG_SR90.get(1)},
+ null,
+ new int[] {570},
+ 20 * 300 * 100,
+ 1020 * 4,
+ 500 * 20); // PO Special Value
+
+ // Strontium u233
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(1),
+ FluidUtils.getFluidStack("molten.uranium233", 10),
+ new ItemStack[] {GregtechItemList.Pellet_RTG_SR90.get(1)},
+ null,
+ new int[] {660},
+ 20 * 300 * 100,
+ 1020 * 4,
+ 500 * 20); // PO Special Value
+
+ // Strontium pu239
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(1),
+ FluidUtils.getFluidStack("molten.plutonium239", 10),
+ new ItemStack[] {GregtechItemList.Pellet_RTG_SR90.get(1)},
+ null,
+ new int[] {220},
+ 20 * 300 * 100,
+ 1020 * 4,
+ 500 * 20); // PO Special Value
+
+ // Plutonium
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(1),
+ FluidUtils.getFluidStack("molten.plutonium238", 1),
+ new ItemStack[] {GregtechItemList.Pellet_RTG_PU238.get(2)},
+ null,
+ new int[] {780},
+ 20 * 300 * 100,
+ 1020 * 4,
+ 500 * 20); // PO Special Value
+
+ // Neptunium
+ CORE.RA.addCyclotronRecipe(
+ new ItemStack[] {ELEMENT.getInstance().URANIUM238.getDust(1)},
+ FluidUtils.getFluidStack("deuterium", 400),
+ new ItemStack[] {ItemUtils.getSimpleStack(ModItems.dustNeptunium238)},
+ null,
+ new int[] {500},
+ 20 * 5,
+ 500 * 4,
+ 500 * 20); // PO Special Value
+
+ /**
+ * Particle Science
+ */
+
+ // Quark Smash
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(3),
+ FluidUtils.getFluidStack("plasma.hydrogen", 100),
+ new ItemStack[] {
+ Particle.getBaseParticle(Particle.UP),
+ Particle.getBaseParticle(Particle.DOWN),
+ Particle.getBaseParticle(Particle.CHARM),
+ Particle.getBaseParticle(Particle.STRANGE),
+ Particle.getBaseParticle(Particle.TOP),
+ Particle.getBaseParticle(Particle.BOTTOM),
+ },
+ null,
+ new int[] {50, 50, 50, 50, 50, 50},
+ 20 * 300 * 9,
+ (int) MaterialUtils.getVoltageForTier(7),
+ 750 * 20);
+
+ // Lepton Smash
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(6),
+ FluidUtils.getFluidStack("plasma.helium", 1500),
+ new ItemStack[] {
+ Particle.getBaseParticle(Particle.ELECTRON),
+ Particle.getBaseParticle(Particle.MUON),
+ Particle.getBaseParticle(Particle.TAU),
+ Particle.getBaseParticle(Particle.ELECTRON_NEUTRINO),
+ Particle.getBaseParticle(Particle.MUON_NEUTRINO),
+ Particle.getBaseParticle(Particle.TAU_NEUTRINO),
+ },
+ null,
+ new int[] {600, 40, 20, 15, 10, 5},
+ 20 * 300 * 8,
+ (int) MaterialUtils.getVoltageForTier(7),
+ 750 * 20);
+
+ // Boson Smash
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(9),
+ FluidUtils.getFluidStack("plasma.helium", 1500),
+ new ItemStack[] {
+ Particle.getBaseParticle(Particle.GLUON),
+ Particle.getBaseParticle(Particle.PHOTON),
+ Particle.getBaseParticle(Particle.Z_BOSON),
+ Particle.getBaseParticle(Particle.W_BOSON),
+ Particle.getBaseParticle(Particle.HIGGS_BOSON),
+ },
+ null,
+ new int[] {160, 260, 150, 150, 1},
+ 20 * 300 * 6,
+ (int) MaterialUtils.getVoltageForTier(7),
+ 750 * 20);
+
+ // Mixed Smash 1
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(12),
+ FluidUtils.getFluidStack("plasma.beryllium", 2500),
+ new ItemStack[] {
+ Particle.getBaseParticle(Particle.GRAVITON),
+ Particle.getBaseParticle(Particle.ETA_MESON),
+ Particle.getBaseParticle(Particle.PION),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.NEUTRON),
+ Particle.getBaseParticle(Particle.LAMBDA),
+ Particle.getBaseParticle(Particle.OMEGA),
+ Particle.getBaseParticle(Particle.HIGGS_BOSON),
+ },
+ null,
+ new int[] {10, 20, 20, 10, 10, 5, 5, 2},
+ 17 * 247 * 32,
+ (int) MaterialUtils.getVoltageForTier(8),
+ 750 * 20);
+
+ // Graviton Smash
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(15),
+ FluidUtils.getFluidStack("plasma.hydrogen", GTNH ? 50 : 10),
+ new ItemStack[] {Particle.getBaseParticle(Particle.GRAVITON), Particle.getBaseParticle(Particle.UNKNOWN)
+ },
+ null,
+ new int[] {15, 100},
+ 20 * (GTNH ? 90 : 30),
+ (int) MaterialUtils.getVoltageForTier(6),
+ 1000 * 20);
+
+ FluidStack aPlasma = Materials.Duranium.getMolten(GTNH ? 40 : 10);
+ FluidStack aPlasma_NULL = Materials._NULL.getPlasma(1);
+
+ if (aPlasma == null || aPlasma.isFluidEqual(aPlasma_NULL)) {
+ aPlasma = Materials.Americium.getMolten(GTNH ? 20 : 5);
+ }
+
+ // Quantum Anomaly
+ CORE.RA.addCyclotronRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(24), Particle.getBaseParticle(Particle.UNKNOWN),
+ },
+ aPlasma,
+ new ItemStack[] {GregtechItemList.Laser_Lens_Special.get(1)},
+ null,
+ new int[] {100},
+ 20 * (GTNH ? 25 : 60),
+ (int) MaterialUtils.getVoltageForTier(8),
+ 500 * 20);
+
+ /*
+ * Ions
+ */
+
+ int IonCount = 2;
+ int tenCountA = (GTNH ? 2 : 1);
+ int tenCountB = 0;
+ for (String y : IonParticles.MetaToNameMap.values()) {
+ if (y.toLowerCase().contains("hydrogen")) {
+ continue;
+ }
+ FluidStack aPlasma2 = FluidUtils.getFluidStack("plasma." + y.toLowerCase(), 2);
+ Materials aTestMat = MaterialUtils.getMaterial(y);
+ FluidStack aPlasma3 = aTestMat != null ? aTestMat.getPlasma(2) : aPlasma2;
+
+ // Ionize Plasma
+ if ((aPlasma2 != null && !aPlasma2.isFluidEqual(aPlasma_NULL))
+ || (aPlasma3 != null && !aPlasma3.isFluidEqual(aPlasma_NULL))) {
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(1 + (tenCountA - 1)),
+ aPlasma2 != null ? aPlasma2 : aPlasma3,
+ new ItemStack[] {
+ Particle.getIon(y, 1),
+ Particle.getIon(y, 2),
+ Particle.getIon(y, 3),
+ Particle.getIon(y, -1),
+ Particle.getIon(y, -2),
+ Particle.getIon(y, -3),
+ Particle.getIon(y, 1),
+ Particle.getIon(y, 2),
+ Particle.getIon(y, -1),
+ },
+ null,
+ new int[] {275, 250, 225, 275, 250, 225, 275, 250, 275},
+ 20 * 20 * (IonCount++) * tenCountA,
+ (int) MaterialUtils.getVoltageForTier(7),
+ 1500 * 20 * tenCountA);
+ } else {
+ Logger.INFO("Plasma for " + y + " does not exist, please report this to Alkalus.");
+ }
+
+ if (tenCountB == 12) {
+ tenCountB = 0;
+ tenCountA++;
+ } else {
+ tenCountB++;
+ }
+ }
+
+ // Generate Hydrogen Ion Recipe
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(24),
+ FluidUtils.getWildcardFluidStack("hydrogen", 1000),
+ new ItemStack[] {
+ Particle.getIon("Hydrogen", 1),
+ Particle.getIon("Hydrogen", 2),
+ Particle.getIon("Hydrogen", 3),
+ Particle.getIon("Hydrogen", 1),
+ Particle.getIon("Hydrogen", 2),
+ Particle.getIon("Hydrogen", 3),
+ Particle.getIon("Hydrogen", -1),
+ Particle.getIon("Hydrogen", -2),
+ Particle.getIon("Hydrogen", -3)
+ },
+ null,
+ new int[] {500, 500, 500, 500, 500, 500, 500, 500, 500},
+ 20 * 20,
+ (int) MaterialUtils.getVoltageForTier(6),
+ 2500);
+
+ // Generate Hydrogen Plasma Recipe
+ CORE.RA.addCyclotronRecipe(
+ new ItemStack[] {
+ Particle.getIon("Hydrogen", 0), ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1)
+ },
+ null,
+ new ItemStack[] {
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.NEUTRON),
+ Particle.getBaseParticle(Particle.ELECTRON),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ CI.emptyCells(1)
+ },
+ FluidUtils.getFluidStack("plasma.hydrogen", 100),
+ new int[] {1250, 1250, 1250, 750, 750, 750, 10000},
+ 20 * 60 * 2,
+ (int) MaterialUtils.getVoltageForTier(6),
+ 750 * 20);
+
+ CORE.RA.addCyclotronRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(21), Particle.getIon("Hydrogen", 0),
+ },
+ FluidUtils.getFluidStack("hydrogen", 1000),
+ new ItemStack[] {
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.NEUTRON),
+ Particle.getBaseParticle(Particle.ELECTRON),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ },
+ FluidUtils.getFluidStack("plasma.hydrogen", 100),
+ new int[] {1250, 1250, 1250, 750, 750, 750},
+ 20 * 60 * 2,
+ (int) MaterialUtils.getVoltageForTier(6),
+ 750 * 20);
+
+ // Generate Protons Easily
+ CORE.RA.addCyclotronRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(20), Particle.getIon("Hydrogen", 0)},
+ FluidUtils.getWildcardFluidStack("hydrogen", 100),
+ new ItemStack[] {
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ },
+ null,
+ new int[] {750, 750, 750, 750, 750, 750, 750, 750, 750},
+ 20 * 20,
+ (int) MaterialUtils.getVoltageForTier(6),
+ 1500);
+
+ CORE.RA.addCyclotronRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(22), Particle.getBaseParticle(Particle.UNKNOWN),
+ },
+ FluidUtils.getWildcardFluidStack("hydrogen", 100),
+ new ItemStack[] {
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ Particle.getBaseParticle(Particle.PROTON),
+ },
+ null,
+ new int[] {375, 375, 375, 375, 375, 375, 375, 375, 375},
+ 20 * 20,
+ (int) MaterialUtils.getVoltageForTier(6),
+ 1500);
+
+ // Create Strange Dust
+ CORE.RA.addCyclotronRecipe(
+ new ItemStack[] {
+ ELEMENT.getInstance().PLUTONIUM238.getDust(1),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ Particle.getBaseParticle(Particle.UNKNOWN),
+ },
+ FluidUtils.getFluidStack(FluidUtils.getWildcardFluidStack("ender", 1000), 1000),
+ new ItemStack[] {ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT.getDust(1)},
+ null,
+ new int[] {2500},
+ 20 * 60 * 15,
+ (int) MaterialUtils.getVoltageForTier(7),
+ 250);
+ }
+
+ private static void sifterRecipes() {}
+
+ private static void electroMagneticSeperatorRecipes() {
+
+ if (!GTNH) {
+ // Trinium
+ GT_Values.RA.addElectromagneticSeparatorRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedNaquadah", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustNaquadah", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallNaquadahEnriched", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1),
+ new int[] {10000, 2500, 5000},
+ 20 * 20,
+ 24);
+
+ // Trinium
+ GT_Values.RA.addElectromagneticSeparatorRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIridium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustIridium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallOsmium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1),
+ new int[] {10000, 2500, 5000},
+ 20 * 20,
+ 24);
+
+ // Trinium
+ GT_Values.RA.addElectromagneticSeparatorRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedWulfenite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustWulfenite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1),
+ new int[] {10000, 3000, 3000},
+ 20 * 20,
+ 24);
+ }
+ }
+
+ private static void advancedMixerRecipes() {
+ // HgBa2Ca2Cu3O8
+ /*CORE.RA.addMixerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellMercury", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustBarium", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalcium", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 3),
+ FluidUtils.getFluidStack("oxygen", 8000),
+ null, CI.emptyCells(1), ALLOY.HG1223.getDust(16), null, null,
+ 30 * 20, 500); */
+
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java
index 5aa6afdbd1..42c2b0eeef 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java
@@ -17,7 +17,6 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.material.ELEMENT;
-import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.*;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
@@ -29,535 +28,705 @@ import gtPlusPlus.xmod.gregtech.common.helpers.VolumetricFlaskHelper;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.oredict.OreDictionary;
public class RECIPES_General {
- static final ItemStack NULL = null;
- static ItemStack RECIPE_Paper;
- static ItemStack RECIPE_Dirt;
- static ItemStack RECIPE_Snow;
- static ItemStack RECIPE_Obsidian;
- static String RECIPE_LapisDust = "dustLazurite";
- static ItemStack OUTPUT_Blueprint;
- static ItemStack RECIPE_CraftingTable;
- static String RECIPE_BronzePlate = "plateBronze";
- static String RECIPE_StainlessPlate = "plateStainlessSteel";
- static ItemStack RECIPE_BasicCasingIC2;
- static ItemStack OUTPUT_Workbench_Bronze;
- static ItemStack OUTPUT_Workbench_Advanced;
- static ItemStack RECIPE_HydrogenDust;
-
- public static void loadRecipes(){
- if (LoadedMods.Gregtech){
- RECIPE_Paper = ItemUtils.getSimpleStack(Items.paper);
- RECIPE_Dirt = ItemUtils.getSimpleStack(Blocks.dirt);
- RECIPE_Snow = ItemUtils.getSimpleStack(Blocks.snow);
- RECIPE_Obsidian = ItemUtils.getSimpleStack(Blocks.obsidian);
- RECIPE_CraftingTable = ItemUtils.getSimpleStack(Blocks.crafting_table);
- RECIPE_HydrogenDust = ItemUtils.getSimpleStack(ModItems.itemHydrogenBlob);
- RECIPE_BasicCasingIC2 = ItemUtils.getItemStackFromFQRN("IC2:blockMachine", 1);
- OUTPUT_Workbench_Bronze = GregtechItemList.GT4_Workbench_Bronze.get(1);
- OUTPUT_Workbench_Advanced = GregtechItemList.GT4_Workbench_Advanced.get(1);
- OUTPUT_Blueprint = ItemUtils.getSimpleStack(ModItems.itemBlueprintBase, 2);
- run();
- addCompressedObsidian();
- migratedRecipes();
- }
- }
-
- private static void run() {
- //Workbench Blueprint
- RecipeUtils.addShapedRecipe(
- RECIPE_Paper, RECIPE_LapisDust, NULL,
- RECIPE_Paper, RECIPE_LapisDust, NULL,
- RECIPE_LapisDust, RECIPE_LapisDust, NULL,
- OUTPUT_Blueprint);
-
- //Bronze Workbench
- RecipeUtils.addShapedRecipe(
- RECIPE_BronzePlate, RECIPE_CraftingTable, RECIPE_BronzePlate,
- RECIPE_BronzePlate, RECIPE_BasicCasingIC2, RECIPE_BronzePlate,
- RECIPE_BronzePlate, CI.getTieredCircuitOreDictName(0), RECIPE_BronzePlate,
- OUTPUT_Workbench_Bronze);
-
- RecipeUtils.addShapedRecipe(
- RECIPE_StainlessPlate, CI.getTieredCircuitOreDictName(3), RECIPE_StainlessPlate,
- RECIPE_StainlessPlate, OUTPUT_Workbench_Bronze, RECIPE_StainlessPlate,
- RECIPE_StainlessPlate, CI.getTieredCircuitOreDictName(3), RECIPE_StainlessPlate,
- OUTPUT_Workbench_Advanced);
-
- //Generates recipes for the Dull shard when TC is not installed.
- if (!LoadedMods.Thaumcraft) {
- //Dull Shard to Aer
- RecipeUtils.addShapedRecipe(
- RECIPE_HydrogenDust, RECIPE_HydrogenDust, RECIPE_HydrogenDust,
- RECIPE_HydrogenDust, ItemUtils.getSimpleStack(ModItems.shardDull), RECIPE_HydrogenDust,
- RECIPE_HydrogenDust, RECIPE_HydrogenDust, RECIPE_HydrogenDust,
- ItemUtils.getSimpleStack(ModItems.shardAer));
- //Dull Shard to Ignis
- RecipeUtils.addShapedRecipe(
- RECIPE_Obsidian, RECIPE_Obsidian, RECIPE_Obsidian,
- RECIPE_Obsidian, ItemUtils.getSimpleStack(ModItems.shardDull), RECIPE_Obsidian,
- RECIPE_Obsidian, RECIPE_Obsidian, RECIPE_Obsidian,
- ItemUtils.getSimpleStack(ModItems.shardIgnis));
- //Dull Shard to Terra
- RecipeUtils.addShapedRecipe(
- RECIPE_Dirt, RECIPE_Dirt, RECIPE_Dirt,
- RECIPE_Dirt, ItemUtils.getSimpleStack(ModItems.shardDull), RECIPE_Dirt,
- RECIPE_Dirt, RECIPE_Dirt, RECIPE_Dirt,
- ItemUtils.getSimpleStack(ModItems.shardTerra));
- //Dull Shard to Aqua
- RecipeUtils.addShapedRecipe(
- RECIPE_LapisDust, RECIPE_LapisDust, RECIPE_LapisDust,
- RECIPE_LapisDust, ItemUtils.getSimpleStack(ModItems.shardDull), RECIPE_LapisDust,
- RECIPE_LapisDust, RECIPE_LapisDust, RECIPE_LapisDust,
- ItemUtils.getSimpleStack(ModItems.shardAqua));
-
- GT_ModHandler.addPulverisationRecipe(ItemUtils.getSimpleStack(ModItems.shardAer), ItemUtils.getSimpleStack(ModItems.dustAer, 2));
- GT_ModHandler.addPulverisationRecipe(ItemUtils.getSimpleStack(ModItems.shardIgnis), ItemUtils.getSimpleStack(ModItems.dustIgnis, 2));
- GT_ModHandler.addPulverisationRecipe(ItemUtils.getSimpleStack(ModItems.shardTerra), ItemUtils.getSimpleStack(ModItems.dustTerra, 2));
- GT_ModHandler.addPulverisationRecipe(ItemUtils.getSimpleStack(ModItems.shardAqua), ItemUtils.getSimpleStack(ModItems.dustAqua, 2));
-
- }
-
- //Rainforest oak Sapling
- if (RecipeUtils.addShapedRecipe(
- "stickWood", "stickWood", "stickWood",
- "stickWood", "treeSapling", "stickWood",
- "stickWood", "dustBone", "stickWood",
- ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest))){
- Logger.INFO("Added a recipe for Rainforest oak Saplings.");
- }
-
- //Iron bars
- final ItemStack ironBars;
- if (CORE.GTNH) {
- ironBars = ItemUtils.getItemStackFromFQRN("dreamcraft:item.SteelBars", 1);
- } else {
- ironBars = ItemUtils.getItemStackFromFQRN("minecraft:iron_bars", 1);
- }
-
- //Fish Trap
- if (RecipeUtils.addShapedRecipe(
- ironBars, ironBars, ironBars,
- ironBars, "frameGtWroughtIron", ironBars,
- ironBars, ironBars, ironBars,
- ItemUtils.getSimpleStack(ModBlocks.blockFishTrap))){
- Logger.INFO("Added a recipe for the Fish Trap.");
- }
-
- //Small Gear Extruder Shape
- if (!CORE.GTNH) {
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_SmallGear.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Gear, Character.valueOf('X'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Steel)});
-
-
- String[] ironTypes = {"", "Wrought", "Pig", "Any"};
- for (int y=0;y<ironTypes.length;y++) {
- //Iron bars
- String ironRecipe = "stick"+ironTypes[y]+"Iron";
- if (RecipeUtils.addShapedRecipe(
- null, CI.craftingToolWrench, null,
- ironRecipe, ironRecipe, ironRecipe,
- ironRecipe, ironRecipe, ironRecipe,
- ItemUtils.getItemStackFromFQRN("minecraft:iron_bars", 8))) {
- Logger.INFO("Re-added old GT recipe for Iron Bars.");
- }
- }
- }
-
-
- //Shaped Crafting for ULV Material Dusts
-
- //Potin
- if (RecipeUtils.addShapelessGregtechRecipe(new Object[] {"dustLead", "dustBronze", "dustTin",
- "dustLead", "dustBronze"}, ALLOY.POTIN.getDust(5))){
- Logger.INFO("Added shapeless recipe for Potin Dust.");
- }
-
- //Tumbaga
- if (RecipeUtils.addShapelessGregtechRecipe(new Object[] {
- "dustGold", "dustGold", "dustCopper"}, ItemUtils.getSimpleStack(ModItems.dustTumbagaMix))){
- Logger.INFO("Added shapeless recipe for Tumbaga Mix.");
- }
- if (RecipeUtils.addShapelessGregtechRecipe(new Object[] {
- ItemUtils.getSimpleStack(ModItems.dustTumbagaMix),
- ItemUtils.getSimpleStack(ModItems.dustTumbagaMix),
- ItemUtils.getSimpleStack(ModItems.dustTumbagaMix),
- "dustGold"
- },
- ALLOY.TUMBAGA.getDust(10))){
- Logger.INFO("Added shapeless recipe for Tumbaga Dust.");
- }
-
-
-
- if (CORE.ConfigSwitches.enableMachine_Pollution) {
- RecipeUtils.addShapedRecipe(
- CI.craftingToolFile, "plateIron", "stickIron",
- "plateIron", "ringIron", "plateIron",
- "stickIron", "plateIron", CI.craftingToolHammer_Hard,
- ItemUtils.simpleMetaStack(ModItems.itemBasicTurbine, 0, 1)
- );
- RecipeUtils.addShapedRecipe(
- CI.craftingToolFile, "plateBronze", "stickBronze",
- "plateBronze", "ringBronze", "plateBronze",
- "stickBronze", "plateBronze", CI.craftingToolHammer_Hard,
- ItemUtils.simpleMetaStack(ModItems.itemBasicTurbine, 1, 1)
- );
- RecipeUtils.addShapedRecipe(
- CI.craftingToolFile, "plateSteel", "stickSteel",
- "plateSteel", "ringSteel", "plateSteel",
- "stickSteel", "plateSteel", CI.craftingToolHammer_Hard,
- ItemUtils.simpleMetaStack(ModItems.itemBasicTurbine, 2, 1)
- );
- }
-
- if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(4),
- ItemUtils.getSimpleStack(Blocks.glass, 16),
- ItemUtils.getSimpleStack(Blocks.glowstone, 16),
- ItemList.Large_Fluid_Cell_Steel.get(1)
- },
- FluidUtils.getFluidStack("molten.borosilicateglass", 2000),
- VolumetricFlaskHelper.getLargeVolumetricFlask(2),
- 20 * 15,
- MaterialUtils.getVoltageForTier(3));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(5),
- ItemUtils.getSimpleStack(Blocks.glass, 64),
- ItemUtils.getSimpleStack(Blocks.glowstone, 64),
- ItemList.Large_Fluid_Cell_TungstenSteel.get(1)
- },
- FluidUtils.getFluidStack("molten.borosilicateglass", 8000),
- VolumetricFlaskHelper.getGiganticVolumetricFlask(2),
- 20 * 15,
- MaterialUtils.getVoltageForTier(5));
-
- }
-
-
-
- //Mining Explosive
- Logger.RECIPE("[Inspection] Explosives");
- if (RecipeUtils.addShapedRecipe(
- CI.explosiveITNT, CI.explosiveTNT, CI.explosiveITNT,
- CI.explosiveTNT, "frameGtIron", CI.explosiveTNT,
- "dustSulfur", CI.explosiveTNT, "dustSulfur",
- ItemUtils.getSimpleStack(ModBlocks.blockMiningExplosive, 3))){
- Logger.INFO("Added a recipe for Mining Explosives.");
- }
-
- //Alkalus Coin
- if (RecipeUtils.addShapedRecipe(
- "gemExquisiteRuby", "gemFlawlessDiamond", "gemExquisiteDiamond",
- "gemFlawlessRuby", ItemList.Credit_Greg_Osmium.get(1), "gemFlawlessSapphire",
- "gemExquisiteEmerald", "gemFlawlessEmerald", "gemExquisiteSapphire",
- ItemUtils.getSimpleStack(ModItems.itemAlkalusDisk))){
- Logger.INFO("Added a recipe for The Alkalus Disk.");
- }
-
- /*final String fancyGems[] = new String[]{"gemExquisiteDiamond", "gemExquisiteEmerald", "gemExquisiteRuby", "gemExquisiteSapphire"};
- final ItemStack gemShards[] = new ItemStack[]{ItemUtils.simpleMetaStack(ModItems.itemGemShards, 0, 1),
- ItemUtils.simpleMetaStack(ModItems.itemGemShards, 1, 1),
- ItemUtils.simpleMetaStack(ModItems.itemGemShards, 2, 1),
- ItemUtils.simpleMetaStack(ModItems.itemGemShards, 3, 1)};
-
- int l=0;
- for (final String gem : fancyGems){
- GameRegistry.addShapelessRecipe(
- gemShards[l],
- ItemUtils.getItemStackOfAmountFromOreDict(gem, 1),
- new ItemStack(ModItems.itemAlkalusDisk, 1, OreDictionary.WILDCARD_VALUE));
- l++;
- }*/
-
- Logger.RECIPE("[Inspection] Wither Cage");
- if (RecipeUtils.addShapedRecipe(
- "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel",
- "plateTungstenSteel", getSimpleStack(Items.nether_star), "plateTungstenSteel",
- "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel",
- ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard, 32))){
- Logger.INFO("Added a recipe for Wither Cages.");
- }
-
- /*Logger.RECIPE("[Inspection] Xp Converter");
- if (RecipeUtils.addShapedRecipe(
- getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1), getSimpleStack(Items.experience_bottle),
- ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1), getSimpleStack(Items.nether_star), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1),
- getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1), getSimpleStack(Items.experience_bottle),
- ItemUtils.getSimpleStack(ModBlocks.blockXpConverter, 1))){
- Logger.INFO("Added a recipe for XP Converter.");
- }*/
-
-
-
-
- // Rope/Fiber/Net
- if (RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1), ItemUtils.getSimpleStack(Items.reeds)},
- ItemUtils.getSimpleStack(ModItems.itemFiber, 16)
- )){
- Logger.INFO("Added a recipe for Fiber.");
- }
-
- if (RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1), ItemUtils.getSimpleStack(Blocks.sapling)},
- ItemUtils.getSimpleStack(ModItems.itemFiber, 32)
- )){
- Logger.INFO("Added a recipe for Fiber.");
- }
-
- if (RecipeUtils.addShapedRecipe(
- null, ItemUtils.getSimpleStack(ModItems.itemFiber, 1), null,
- ItemUtils.getSimpleStack(ModItems.itemFiber, 1), CI.craftingToolKnife, ItemUtils.getSimpleStack(ModItems.itemFiber, 1),
- null, ItemUtils.getSimpleStack(ModItems.itemFiber, 1), null,
- ItemUtils.getSimpleStack(ModItems.itemRope, 3))){
- Logger.INFO("Added a recipe for Rope.");
- }
-
- Logger.RECIPE("[Inspection] Net");
- if (RecipeUtils.addShapedRecipe(
- ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1),
- ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1),
- null, null, null,
- ItemUtils.getSimpleStack(ModBlocks.blockNet, 2))){
- Logger.INFO("Added a recipe for Nets.");
- }
-
- // Slow Builders Ring
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] { ItemUtils.getSimpleStack(Blocks.ice, 8),
- ItemUtils.getSimpleStack(ModBlocks.blockNet, 8), ItemUtils.getSimpleStack(Blocks.vine, 8),
- ALLOY.TUMBAGA.getRing(1), },
- FluidUtils.getWater(1000), // Fluid
- ItemUtils.getItemStackFromFQRN("miscutils:SlowBuildingRing", 1), // Output
- 20 * 30, // Dur
- 16); // Eu
-
- // Magic Feather
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getSimpleStack(Items.feather, 64),
- ItemUtils.getSimpleStack(Blocks.emerald_block, 32),
- ItemUtils.getSimpleStack(Blocks.diamond_block, 32),
- Materials.Ruby.getBlocks(32),
- Materials.Sapphire.getBlocks(32),
- ItemUtils.getSimpleStack(Blocks.gold_block, 32),
- },
- Materials.Silver.getMolten(32 * 144), // Fluid
- ItemUtils.getSimpleStack(ModItems.itemMagicFeather, 1), // Output
- 20 * 120, // Dur
- MaterialUtils.getVoltageForTier(4)); // Eu
-
- // Pest Killer
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(16),
- CI.getTieredMachineCasing(1),
- CI.getElectricPump(2, 1),
- CI.getPlate(2, GTNH ? 4 : 2),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(0), GTNH ? 2 : 1),
- },
- FluidUtils.getHotWater(500), // Fluid
- ItemUtils.getSimpleStack(ModBlocks.blockPestKiller), // Output
- 20 * 60, // Dur
- 16); // Eu
-
-
-
-
- }
-
- private static boolean addCompressedObsidian(){
- //Invert Obsidian
- ItemStack aInvertedObsidian = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1);
- if (RecipeUtils.addShapedRecipe(
- getSimpleStack(Items.redstone), getSimpleStack(Items.glowstone_dust), getSimpleStack(Items.redstone),
- getSimpleStack(Items.glowstone_dust), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 1, 1), getSimpleStack(Items.glowstone_dust),
- getSimpleStack(Items.redstone), getSimpleStack(Items.glowstone_dust), getSimpleStack(Items.redstone),
- aInvertedObsidian)){
- Logger.INFO("Added a recipe for Inverted Obsidian.");
- }
-
- final ItemStack[] mItems = new ItemStack[6];
- mItems[0] = ItemUtils.getSimpleStack(Blocks.obsidian);
- for (int r=0;r<5;r++){
- mItems[r+1] = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, r, 1);
- }
-
- final ItemStack[] mItems2 = new ItemStack[6];
- mItems2[0] = ItemUtils.getSimpleStack(Blocks.glowstone);
- for (int r=0;r<5;r++){
- mItems2[r+1] = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 6+r, 1);
- }
-
- //Compressed Obsidian 1-5
- for (int r=0;r<5;r++){
-
- final ItemStack input = mItems[r];
- final ItemStack output = mItems[r+1];
-
- if (RecipeUtils.addShapedRecipe(
- input, input, input,
- input, input, input,
- input, input, input,
- output)){
- Logger.INFO("Added a recipe for Compressed Obsidian ["+r+"]");
- }
-
- if (RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{output}, ItemUtils.getSimpleStack(input, 9))){
- Logger.INFO("Added a shapeless recipe for Compressed Obsidian ["+r+"]");
- }
-
- }
-
- //Compressed Glowstone 1-5
- for (int r=0;r<5;r++){
-
- final ItemStack input = mItems2[r];
- final ItemStack output = mItems2[r+1];
-
- if (RecipeUtils.addShapedRecipe(
- input, input, input,
- input, r == 2 ? aInvertedObsidian : input, input,
- input, input, input,
- output)){
- Logger.INFO("Added a recipe for Compressed Glowstone ["+r+"]");
- }
-
- if (RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{output}, ItemUtils.getSimpleStack(input, 9))){
- Logger.INFO("Added a shapeless recipe for Compressed Glowstone ["+r+"]");
- }
-
- }
- return true;
- }
-
- private static void migratedRecipes() {
-
- RecipeUtils.generateMortarRecipe(ItemUtils.getSimpleStack(ModItems.itemPlateRawMeat), ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1));
-
- generateWireRecipes(ELEMENT.getInstance().ZIRCONIUM);
- generateWireRecipes(ALLOY.HG1223);
- generateWireRecipes(ALLOY.LEAGRISIUM);
- generateWireRecipes(ALLOY.TRINIUM_TITANIUM);
- generateWireRecipes(ELEMENT.STANDALONE.HYPOGEN);
-
- GT_Materials[] g = new GT_Materials[] {
- GT_Materials.Staballoy,
- GT_Materials.Tantalloy60,
- GT_Materials.Tantalloy61,
- GT_Materials.Void,
- GT_Materials.Potin,
- GT_Materials.MaragingSteel300,
- GT_Materials.MaragingSteel350,
- GT_Materials.Inconel690,
- GT_Materials.Inconel792,
- GT_Materials.HastelloyX,
- GT_Materials.TriniumNaquadahCarbonite,
-
- };
- for (GT_Materials e : g) {
- if (e == GT_Materials.Void) {
- if (!LoadedMods.Thaumcraft) {
- continue;
- }
- }
- int tVoltageMultiplier = (e.mBlastFurnaceTemp >= 2800) ? 64 : 16;
- generatePipeRecipes(e.mDefaultLocalName, e.getMass(), tVoltageMultiplier);
- }
-
- Materials[] h = new Materials[] {
- Materials.Europium,
- Materials.Tungsten,
- Materials.DarkSteel,
- Materials.Clay,
- Materials.Lead,
-
- };
-
- for (Materials e : h) {
- if (e == Materials.DarkSteel) {
- if (!LoadedMods.EnderIO) {
- continue;
- }
- }
- int tVoltageMultiplier = (e.mBlastFurnaceTemp >= 2800) ? 64 : 16;
- generatePipeRecipes(e.mDefaultLocalName, e.getMass(), tVoltageMultiplier);
- }
-
- RecipeUtils.addShapedGregtechRecipe(CI.component_Plate[6], ALLOY.MARAGING250.getGear(1), CI.component_Plate[6],
- CI.getTieredCircuitOreDictName(4), GregtechItemList.Casing_AdvancedVacuum.get(1),
- CI.getTieredCircuitOreDictName(4), CI.component_Plate[5], ItemList.Hatch_Input_IV.get(1),
- CI.component_Plate[5], GregtechItemList.Hatch_Input_Cryotheum.get(1L, new Object[0]));
-
- RecipeUtils.addShapedGregtechRecipe(CI.component_Plate[5], ALLOY.MARAGING300.getGear(1), CI.component_Plate[5],
- CI.getTieredCircuitOreDictName(4), GregtechItemList.Casing_Adv_BlastFurnace.get(1),
- CI.getTieredCircuitOreDictName(4), CI.component_Plate[6], ItemList.Hatch_Input_IV.get(1),
- CI.component_Plate[6], GregtechItemList.Hatch_Input_Pyrotheum.get(1L, new Object[0]));
-
- RecipeUtils.addShapedGregtechRecipe(CI.component_Plate[8], ALLOY.PIKYONIUM.getGear(1), CI.component_Plate[9],
- CI.getTieredCircuitOreDictName(7), GregtechItemList.Casing_Naq_Reactor_A.get(1),
- CI.getTieredCircuitOreDictName(7), CI.component_Plate[9], ItemList.Hatch_Input_ZPM.get(1),
- CI.component_Plate[8], GregtechItemList.Hatch_Input_Naquadah.get(1L, new Object[0]));
-
-
- if (PollutionUtils.isPollutionEnabled()) {
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_LV.get(1L, new Object[0]), bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_LV.get(1), Character.valueOf('P'),
- GregtechItemList.Pollution_Cleaner_LV.get(1) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_MV.get(1L, new Object[0]), bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_MV.get(1), Character.valueOf('P'),
- GregtechItemList.Pollution_Cleaner_MV.get(1) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_HV.get(1L, new Object[0]), bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_HV.get(1), Character.valueOf('P'),
- GregtechItemList.Pollution_Cleaner_HV.get(1) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_EV.get(1L, new Object[0]), bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_EV.get(1), Character.valueOf('P'),
- GregtechItemList.Pollution_Cleaner_EV.get(1) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_IV.get(1L, new Object[0]), bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_IV.get(1), Character.valueOf('P'),
- GregtechItemList.Pollution_Cleaner_IV.get(1) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_LuV.get(1L, new Object[0]), bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_LuV.get(1), Character.valueOf('P'),
- GregtechItemList.Pollution_Cleaner_LuV.get(1) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_ZPM.get(1L, new Object[0]), bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_ZPM.get(1), Character.valueOf('P'),
- GregtechItemList.Pollution_Cleaner_ZPM.get(1) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_UV.get(1L, new Object[0]), bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_UV.get(1), Character.valueOf('P'),
- GregtechItemList.Pollution_Cleaner_UV.get(1) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_MAX.get(1L, new Object[0]), bitsd,
- new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_MAX.get(1), Character.valueOf('P'),
- GregtechItemList.Pollution_Cleaner_MAX.get(1) });
- }
-
-
-
-
-
-
-
-
-
-
- }
-
-
-
-
-
-
-
-
-
+ static final ItemStack NULL = null;
+ static ItemStack RECIPE_Paper;
+ static ItemStack RECIPE_Dirt;
+ static ItemStack RECIPE_Snow;
+ static ItemStack RECIPE_Obsidian;
+ static String RECIPE_LapisDust = "dustLazurite";
+ static ItemStack OUTPUT_Blueprint;
+ static ItemStack RECIPE_CraftingTable;
+ static String RECIPE_BronzePlate = "plateBronze";
+ static String RECIPE_StainlessPlate = "plateStainlessSteel";
+ static ItemStack RECIPE_BasicCasingIC2;
+ static ItemStack OUTPUT_Workbench_Bronze;
+ static ItemStack OUTPUT_Workbench_Advanced;
+ static ItemStack RECIPE_HydrogenDust;
+
+ public static void loadRecipes() {
+ if (LoadedMods.Gregtech) {
+ RECIPE_Paper = ItemUtils.getSimpleStack(Items.paper);
+ RECIPE_Dirt = ItemUtils.getSimpleStack(Blocks.dirt);
+ RECIPE_Snow = ItemUtils.getSimpleStack(Blocks.snow);
+ RECIPE_Obsidian = ItemUtils.getSimpleStack(Blocks.obsidian);
+ RECIPE_CraftingTable = ItemUtils.getSimpleStack(Blocks.crafting_table);
+ RECIPE_HydrogenDust = ItemUtils.getSimpleStack(ModItems.itemHydrogenBlob);
+ RECIPE_BasicCasingIC2 = ItemUtils.getItemStackFromFQRN("IC2:blockMachine", 1);
+ OUTPUT_Workbench_Bronze = GregtechItemList.GT4_Workbench_Bronze.get(1);
+ OUTPUT_Workbench_Advanced = GregtechItemList.GT4_Workbench_Advanced.get(1);
+ OUTPUT_Blueprint = ItemUtils.getSimpleStack(ModItems.itemBlueprintBase, 2);
+ run();
+ addCompressedObsidian();
+ migratedRecipes();
+ }
+ }
+
+ private static void run() {
+ // Workbench Blueprint
+ RecipeUtils.addShapedRecipe(
+ RECIPE_Paper,
+ RECIPE_LapisDust,
+ NULL,
+ RECIPE_Paper,
+ RECIPE_LapisDust,
+ NULL,
+ RECIPE_LapisDust,
+ RECIPE_LapisDust,
+ NULL,
+ OUTPUT_Blueprint);
+
+ // Bronze Workbench
+ RecipeUtils.addShapedRecipe(
+ RECIPE_BronzePlate,
+ RECIPE_CraftingTable,
+ RECIPE_BronzePlate,
+ RECIPE_BronzePlate,
+ RECIPE_BasicCasingIC2,
+ RECIPE_BronzePlate,
+ RECIPE_BronzePlate,
+ CI.getTieredCircuitOreDictName(0),
+ RECIPE_BronzePlate,
+ OUTPUT_Workbench_Bronze);
+
+ RecipeUtils.addShapedRecipe(
+ RECIPE_StainlessPlate,
+ CI.getTieredCircuitOreDictName(3),
+ RECIPE_StainlessPlate,
+ RECIPE_StainlessPlate,
+ OUTPUT_Workbench_Bronze,
+ RECIPE_StainlessPlate,
+ RECIPE_StainlessPlate,
+ CI.getTieredCircuitOreDictName(3),
+ RECIPE_StainlessPlate,
+ OUTPUT_Workbench_Advanced);
+
+ // Generates recipes for the Dull shard when TC is not installed.
+ if (!LoadedMods.Thaumcraft) {
+ // Dull Shard to Aer
+ RecipeUtils.addShapedRecipe(
+ RECIPE_HydrogenDust,
+ RECIPE_HydrogenDust,
+ RECIPE_HydrogenDust,
+ RECIPE_HydrogenDust,
+ ItemUtils.getSimpleStack(ModItems.shardDull),
+ RECIPE_HydrogenDust,
+ RECIPE_HydrogenDust,
+ RECIPE_HydrogenDust,
+ RECIPE_HydrogenDust,
+ ItemUtils.getSimpleStack(ModItems.shardAer));
+ // Dull Shard to Ignis
+ RecipeUtils.addShapedRecipe(
+ RECIPE_Obsidian,
+ RECIPE_Obsidian,
+ RECIPE_Obsidian,
+ RECIPE_Obsidian,
+ ItemUtils.getSimpleStack(ModItems.shardDull),
+ RECIPE_Obsidian,
+ RECIPE_Obsidian,
+ RECIPE_Obsidian,
+ RECIPE_Obsidian,
+ ItemUtils.getSimpleStack(ModItems.shardIgnis));
+ // Dull Shard to Terra
+ RecipeUtils.addShapedRecipe(
+ RECIPE_Dirt,
+ RECIPE_Dirt,
+ RECIPE_Dirt,
+ RECIPE_Dirt,
+ ItemUtils.getSimpleStack(ModItems.shardDull),
+ RECIPE_Dirt,
+ RECIPE_Dirt,
+ RECIPE_Dirt,
+ RECIPE_Dirt,
+ ItemUtils.getSimpleStack(ModItems.shardTerra));
+ // Dull Shard to Aqua
+ RecipeUtils.addShapedRecipe(
+ RECIPE_LapisDust,
+ RECIPE_LapisDust,
+ RECIPE_LapisDust,
+ RECIPE_LapisDust,
+ ItemUtils.getSimpleStack(ModItems.shardDull),
+ RECIPE_LapisDust,
+ RECIPE_LapisDust,
+ RECIPE_LapisDust,
+ RECIPE_LapisDust,
+ ItemUtils.getSimpleStack(ModItems.shardAqua));
+
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(ModItems.shardAer), ItemUtils.getSimpleStack(ModItems.dustAer, 2));
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(ModItems.shardIgnis), ItemUtils.getSimpleStack(ModItems.dustIgnis, 2));
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(ModItems.shardTerra), ItemUtils.getSimpleStack(ModItems.dustTerra, 2));
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(ModItems.shardAqua), ItemUtils.getSimpleStack(ModItems.dustAqua, 2));
+ }
+
+ // Rainforest oak Sapling
+ if (RecipeUtils.addShapedRecipe(
+ "stickWood",
+ "stickWood",
+ "stickWood",
+ "stickWood",
+ "treeSapling",
+ "stickWood",
+ "stickWood",
+ "dustBone",
+ "stickWood",
+ ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest))) {
+ Logger.INFO("Added a recipe for Rainforest oak Saplings.");
+ }
+
+ // Iron bars
+ final ItemStack ironBars;
+ if (CORE.GTNH) {
+ ironBars = ItemUtils.getItemStackFromFQRN("dreamcraft:item.SteelBars", 1);
+ } else {
+ ironBars = ItemUtils.getItemStackFromFQRN("minecraft:iron_bars", 1);
+ }
+
+ // Fish Trap
+ if (RecipeUtils.addShapedRecipe(
+ ironBars,
+ ironBars,
+ ironBars,
+ ironBars,
+ "frameGtWroughtIron",
+ ironBars,
+ ironBars,
+ ironBars,
+ ironBars,
+ ItemUtils.getSimpleStack(ModBlocks.blockFishTrap))) {
+ Logger.INFO("Added a recipe for the Fish Trap.");
+ }
+
+ // Small Gear Extruder Shape
+ if (!CORE.GTNH) {
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Shape_Extruder_SmallGear.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.BUFFERED
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE,
+ new Object[] {
+ "hXS",
+ "XPX",
+ "fXd",
+ Character.valueOf('P'),
+ ItemList.Shape_Extruder_Gear,
+ Character.valueOf('X'),
+ OrePrefixes.plate.get(Materials.Steel),
+ Character.valueOf('S'),
+ OrePrefixes.screw.get(Materials.Steel)
+ });
+
+ String[] ironTypes = {"", "Wrought", "Pig", "Any"};
+ for (int y = 0; y < ironTypes.length; y++) {
+ // Iron bars
+ String ironRecipe = "stick" + ironTypes[y] + "Iron";
+ if (RecipeUtils.addShapedRecipe(
+ null,
+ CI.craftingToolWrench,
+ null,
+ ironRecipe,
+ ironRecipe,
+ ironRecipe,
+ ironRecipe,
+ ironRecipe,
+ ironRecipe,
+ ItemUtils.getItemStackFromFQRN("minecraft:iron_bars", 8))) {
+ Logger.INFO("Re-added old GT recipe for Iron Bars.");
+ }
+ }
+ }
+
+ // Shaped Crafting for ULV Material Dusts
+
+ // Potin
+ if (RecipeUtils.addShapelessGregtechRecipe(
+ new Object[] {"dustLead", "dustBronze", "dustTin", "dustLead", "dustBronze"}, ALLOY.POTIN.getDust(5))) {
+ Logger.INFO("Added shapeless recipe for Potin Dust.");
+ }
+
+ // Tumbaga
+ if (RecipeUtils.addShapelessGregtechRecipe(
+ new Object[] {"dustGold", "dustGold", "dustCopper"},
+ ItemUtils.getSimpleStack(ModItems.dustTumbagaMix))) {
+ Logger.INFO("Added shapeless recipe for Tumbaga Mix.");
+ }
+ if (RecipeUtils.addShapelessGregtechRecipe(
+ new Object[] {
+ ItemUtils.getSimpleStack(ModItems.dustTumbagaMix),
+ ItemUtils.getSimpleStack(ModItems.dustTumbagaMix),
+ ItemUtils.getSimpleStack(ModItems.dustTumbagaMix),
+ "dustGold"
+ },
+ ALLOY.TUMBAGA.getDust(10))) {
+ Logger.INFO("Added shapeless recipe for Tumbaga Dust.");
+ }
+
+ if (CORE.ConfigSwitches.enableMachine_Pollution) {
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolFile,
+ "plateIron",
+ "stickIron",
+ "plateIron",
+ "ringIron",
+ "plateIron",
+ "stickIron",
+ "plateIron",
+ CI.craftingToolHammer_Hard,
+ ItemUtils.simpleMetaStack(ModItems.itemBasicTurbine, 0, 1));
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolFile,
+ "plateBronze",
+ "stickBronze",
+ "plateBronze",
+ "ringBronze",
+ "plateBronze",
+ "stickBronze",
+ "plateBronze",
+ CI.craftingToolHammer_Hard,
+ ItemUtils.simpleMetaStack(ModItems.itemBasicTurbine, 1, 1));
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolFile,
+ "plateSteel",
+ "stickSteel",
+ "plateSteel",
+ "ringSteel",
+ "plateSteel",
+ "stickSteel",
+ "plateSteel",
+ CI.craftingToolHammer_Hard,
+ ItemUtils.simpleMetaStack(ModItems.itemBasicTurbine, 2, 1));
+ }
+
+ if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(4),
+ ItemUtils.getSimpleStack(Blocks.glass, 16),
+ ItemUtils.getSimpleStack(Blocks.glowstone, 16),
+ ItemList.Large_Fluid_Cell_Steel.get(1)
+ },
+ FluidUtils.getFluidStack("molten.borosilicateglass", 2000),
+ VolumetricFlaskHelper.getLargeVolumetricFlask(2),
+ 20 * 15,
+ MaterialUtils.getVoltageForTier(3));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(5),
+ ItemUtils.getSimpleStack(Blocks.glass, 64),
+ ItemUtils.getSimpleStack(Blocks.glowstone, 64),
+ ItemList.Large_Fluid_Cell_TungstenSteel.get(1)
+ },
+ FluidUtils.getFluidStack("molten.borosilicateglass", 8000),
+ VolumetricFlaskHelper.getGiganticVolumetricFlask(2),
+ 20 * 15,
+ MaterialUtils.getVoltageForTier(5));
+ }
+
+ // Mining Explosive
+ Logger.RECIPE("[Inspection] Explosives");
+ if (RecipeUtils.addShapedRecipe(
+ CI.explosiveITNT,
+ CI.explosiveTNT,
+ CI.explosiveITNT,
+ CI.explosiveTNT,
+ "frameGtIron",
+ CI.explosiveTNT,
+ "dustSulfur",
+ CI.explosiveTNT,
+ "dustSulfur",
+ ItemUtils.getSimpleStack(ModBlocks.blockMiningExplosive, 3))) {
+ Logger.INFO("Added a recipe for Mining Explosives.");
+ }
+
+ // Alkalus Coin
+ if (RecipeUtils.addShapedRecipe(
+ "gemExquisiteRuby",
+ "gemFlawlessDiamond",
+ "gemExquisiteDiamond",
+ "gemFlawlessRuby",
+ ItemList.Credit_Greg_Osmium.get(1),
+ "gemFlawlessSapphire",
+ "gemExquisiteEmerald",
+ "gemFlawlessEmerald",
+ "gemExquisiteSapphire",
+ ItemUtils.getSimpleStack(ModItems.itemAlkalusDisk))) {
+ Logger.INFO("Added a recipe for The Alkalus Disk.");
+ }
+
+ /*final String fancyGems[] = new String[]{"gemExquisiteDiamond", "gemExquisiteEmerald", "gemExquisiteRuby", "gemExquisiteSapphire"};
+ final ItemStack gemShards[] = new ItemStack[]{ItemUtils.simpleMetaStack(ModItems.itemGemShards, 0, 1),
+ ItemUtils.simpleMetaStack(ModItems.itemGemShards, 1, 1),
+ ItemUtils.simpleMetaStack(ModItems.itemGemShards, 2, 1),
+ ItemUtils.simpleMetaStack(ModItems.itemGemShards, 3, 1)};
+
+ int l=0;
+ for (final String gem : fancyGems){
+ GameRegistry.addShapelessRecipe(
+ gemShards[l],
+ ItemUtils.getItemStackOfAmountFromOreDict(gem, 1),
+ new ItemStack(ModItems.itemAlkalusDisk, 1, OreDictionary.WILDCARD_VALUE));
+ l++;
+ }*/
+
+ Logger.RECIPE("[Inspection] Wither Cage");
+ if (RecipeUtils.addShapedRecipe(
+ "stickBlackSteel",
+ "plateTungstenSteel",
+ "stickBlackSteel",
+ "plateTungstenSteel",
+ getSimpleStack(Items.nether_star),
+ "plateTungstenSteel",
+ "stickBlackSteel",
+ "plateTungstenSteel",
+ "stickBlackSteel",
+ ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard, 32))) {
+ Logger.INFO("Added a recipe for Wither Cages.");
+ }
+
+ /*Logger.RECIPE("[Inspection] Xp Converter");
+ if (RecipeUtils.addShapedRecipe(
+ getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1), getSimpleStack(Items.experience_bottle),
+ ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1), getSimpleStack(Items.nether_star), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1),
+ getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1), getSimpleStack(Items.experience_bottle),
+ ItemUtils.getSimpleStack(ModBlocks.blockXpConverter, 1))){
+ Logger.INFO("Added a recipe for XP Converter.");
+ }*/
+
+ // Rope/Fiber/Net
+ if (RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1),
+ ItemUtils.getSimpleStack(Items.reeds)
+ },
+ ItemUtils.getSimpleStack(ModItems.itemFiber, 16))) {
+ Logger.INFO("Added a recipe for Fiber.");
+ }
+
+ if (RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1),
+ ItemUtils.getSimpleStack(Blocks.sapling)
+ },
+ ItemUtils.getSimpleStack(ModItems.itemFiber, 32))) {
+ Logger.INFO("Added a recipe for Fiber.");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ null,
+ ItemUtils.getSimpleStack(ModItems.itemFiber, 1),
+ null,
+ ItemUtils.getSimpleStack(ModItems.itemFiber, 1),
+ CI.craftingToolKnife,
+ ItemUtils.getSimpleStack(ModItems.itemFiber, 1),
+ null,
+ ItemUtils.getSimpleStack(ModItems.itemFiber, 1),
+ null,
+ ItemUtils.getSimpleStack(ModItems.itemRope, 3))) {
+ Logger.INFO("Added a recipe for Rope.");
+ }
+
+ Logger.RECIPE("[Inspection] Net");
+ if (RecipeUtils.addShapedRecipe(
+ ItemUtils.getSimpleStack(ModItems.itemRope, 1),
+ ItemUtils.getSimpleStack(ModItems.itemRope, 1),
+ ItemUtils.getSimpleStack(ModItems.itemRope, 1),
+ ItemUtils.getSimpleStack(ModItems.itemRope, 1),
+ ItemUtils.getSimpleStack(ModItems.itemRope, 1),
+ ItemUtils.getSimpleStack(ModItems.itemRope, 1),
+ null,
+ null,
+ null,
+ ItemUtils.getSimpleStack(ModBlocks.blockNet, 2))) {
+ Logger.INFO("Added a recipe for Nets.");
+ }
+
+ // Slow Builders Ring
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Blocks.ice, 8),
+ ItemUtils.getSimpleStack(ModBlocks.blockNet, 8),
+ ItemUtils.getSimpleStack(Blocks.vine, 8),
+ ALLOY.TUMBAGA.getRing(1),
+ },
+ FluidUtils.getWater(1000), // Fluid
+ ItemUtils.getItemStackFromFQRN("miscutils:SlowBuildingRing", 1), // Output
+ 20 * 30, // Dur
+ 16); // Eu
+
+ // Magic Feather
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Items.feather, 64),
+ ItemUtils.getSimpleStack(Blocks.emerald_block, 32),
+ ItemUtils.getSimpleStack(Blocks.diamond_block, 32),
+ Materials.Ruby.getBlocks(32),
+ Materials.Sapphire.getBlocks(32),
+ ItemUtils.getSimpleStack(Blocks.gold_block, 32),
+ },
+ Materials.Silver.getMolten(32 * 144), // Fluid
+ ItemUtils.getSimpleStack(ModItems.itemMagicFeather, 1), // Output
+ 20 * 120, // Dur
+ MaterialUtils.getVoltageForTier(4)); // Eu
+
+ // Pest Killer
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(16),
+ CI.getTieredMachineCasing(1),
+ CI.getElectricPump(2, 1),
+ CI.getPlate(2, GTNH ? 4 : 2),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(0), GTNH ? 2 : 1),
+ },
+ FluidUtils.getHotWater(500), // Fluid
+ ItemUtils.getSimpleStack(ModBlocks.blockPestKiller), // Output
+ 20 * 60, // Dur
+ 16); // Eu
+ }
+
+ private static boolean addCompressedObsidian() {
+ // Invert Obsidian
+ ItemStack aInvertedObsidian = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1);
+ if (RecipeUtils.addShapedRecipe(
+ getSimpleStack(Items.redstone),
+ getSimpleStack(Items.glowstone_dust),
+ getSimpleStack(Items.redstone),
+ getSimpleStack(Items.glowstone_dust),
+ ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 1, 1),
+ getSimpleStack(Items.glowstone_dust),
+ getSimpleStack(Items.redstone),
+ getSimpleStack(Items.glowstone_dust),
+ getSimpleStack(Items.redstone),
+ aInvertedObsidian)) {
+ Logger.INFO("Added a recipe for Inverted Obsidian.");
+ }
+
+ final ItemStack[] mItems = new ItemStack[6];
+ mItems[0] = ItemUtils.getSimpleStack(Blocks.obsidian);
+ for (int r = 0; r < 5; r++) {
+ mItems[r + 1] = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, r, 1);
+ }
+
+ final ItemStack[] mItems2 = new ItemStack[6];
+ mItems2[0] = ItemUtils.getSimpleStack(Blocks.glowstone);
+ for (int r = 0; r < 5; r++) {
+ mItems2[r + 1] = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 6 + r, 1);
+ }
+
+ // Compressed Obsidian 1-5
+ for (int r = 0; r < 5; r++) {
+
+ final ItemStack input = mItems[r];
+ final ItemStack output = mItems[r + 1];
+
+ if (RecipeUtils.addShapedRecipe(input, input, input, input, input, input, input, input, input, output)) {
+ Logger.INFO("Added a recipe for Compressed Obsidian [" + r + "]");
+ }
+
+ if (RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {output}, ItemUtils.getSimpleStack(input, 9))) {
+ Logger.INFO("Added a shapeless recipe for Compressed Obsidian [" + r + "]");
+ }
+ }
+
+ // Compressed Glowstone 1-5
+ for (int r = 0; r < 5; r++) {
+
+ final ItemStack input = mItems2[r];
+ final ItemStack output = mItems2[r + 1];
+
+ if (RecipeUtils.addShapedRecipe(
+ input,
+ input,
+ input,
+ input,
+ r == 2 ? aInvertedObsidian : input,
+ input,
+ input,
+ input,
+ input,
+ output)) {
+ Logger.INFO("Added a recipe for Compressed Glowstone [" + r + "]");
+ }
+
+ if (RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {output}, ItemUtils.getSimpleStack(input, 9))) {
+ Logger.INFO("Added a shapeless recipe for Compressed Glowstone [" + r + "]");
+ }
+ }
+ return true;
+ }
+
+ private static void migratedRecipes() {
+
+ RecipeUtils.generateMortarRecipe(
+ ItemUtils.getSimpleStack(ModItems.itemPlateRawMeat),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1));
+
+ generateWireRecipes(ELEMENT.getInstance().ZIRCONIUM);
+ generateWireRecipes(ALLOY.HG1223);
+ generateWireRecipes(ALLOY.LEAGRISIUM);
+ generateWireRecipes(ALLOY.TRINIUM_TITANIUM);
+ generateWireRecipes(ELEMENT.STANDALONE.HYPOGEN);
+
+ GT_Materials[] g = new GT_Materials[] {
+ GT_Materials.Staballoy,
+ GT_Materials.Tantalloy60,
+ GT_Materials.Tantalloy61,
+ GT_Materials.Void,
+ GT_Materials.Potin,
+ GT_Materials.MaragingSteel300,
+ GT_Materials.MaragingSteel350,
+ GT_Materials.Inconel690,
+ GT_Materials.Inconel792,
+ GT_Materials.HastelloyX,
+ GT_Materials.TriniumNaquadahCarbonite,
+ };
+ for (GT_Materials e : g) {
+ if (e == GT_Materials.Void) {
+ if (!LoadedMods.Thaumcraft) {
+ continue;
+ }
+ }
+ int tVoltageMultiplier = (e.mBlastFurnaceTemp >= 2800) ? 64 : 16;
+ generatePipeRecipes(e.mDefaultLocalName, e.getMass(), tVoltageMultiplier);
+ }
+
+ Materials[] h = new Materials[] {
+ Materials.Europium, Materials.Tungsten, Materials.DarkSteel, Materials.Clay, Materials.Lead,
+ };
+
+ for (Materials e : h) {
+ if (e == Materials.DarkSteel) {
+ if (!LoadedMods.EnderIO) {
+ continue;
+ }
+ }
+ int tVoltageMultiplier = (e.mBlastFurnaceTemp >= 2800) ? 64 : 16;
+ generatePipeRecipes(e.mDefaultLocalName, e.getMass(), tVoltageMultiplier);
+ }
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[6],
+ ALLOY.MARAGING250.getGear(1),
+ CI.component_Plate[6],
+ CI.getTieredCircuitOreDictName(4),
+ GregtechItemList.Casing_AdvancedVacuum.get(1),
+ CI.getTieredCircuitOreDictName(4),
+ CI.component_Plate[5],
+ ItemList.Hatch_Input_IV.get(1),
+ CI.component_Plate[5],
+ GregtechItemList.Hatch_Input_Cryotheum.get(1L, new Object[0]));
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[5],
+ ALLOY.MARAGING300.getGear(1),
+ CI.component_Plate[5],
+ CI.getTieredCircuitOreDictName(4),
+ GregtechItemList.Casing_Adv_BlastFurnace.get(1),
+ CI.getTieredCircuitOreDictName(4),
+ CI.component_Plate[6],
+ ItemList.Hatch_Input_IV.get(1),
+ CI.component_Plate[6],
+ GregtechItemList.Hatch_Input_Pyrotheum.get(1L, new Object[0]));
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[8],
+ ALLOY.PIKYONIUM.getGear(1),
+ CI.component_Plate[9],
+ CI.getTieredCircuitOreDictName(7),
+ GregtechItemList.Casing_Naq_Reactor_A.get(1),
+ CI.getTieredCircuitOreDictName(7),
+ CI.component_Plate[9],
+ ItemList.Hatch_Input_ZPM.get(1),
+ CI.component_Plate[8],
+ GregtechItemList.Hatch_Input_Naquadah.get(1L, new Object[0]));
+
+ if (PollutionUtils.isPollutionEnabled()) {
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Muffler_Adv_LV.get(1L, new Object[0]), bitsd, new Object[] {
+ "M",
+ "P",
+ Character.valueOf('M'),
+ ItemList.Hatch_Muffler_LV.get(1),
+ Character.valueOf('P'),
+ GregtechItemList.Pollution_Cleaner_LV.get(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Muffler_Adv_MV.get(1L, new Object[0]), bitsd, new Object[] {
+ "M",
+ "P",
+ Character.valueOf('M'),
+ ItemList.Hatch_Muffler_MV.get(1),
+ Character.valueOf('P'),
+ GregtechItemList.Pollution_Cleaner_MV.get(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Muffler_Adv_HV.get(1L, new Object[0]), bitsd, new Object[] {
+ "M",
+ "P",
+ Character.valueOf('M'),
+ ItemList.Hatch_Muffler_HV.get(1),
+ Character.valueOf('P'),
+ GregtechItemList.Pollution_Cleaner_HV.get(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Muffler_Adv_EV.get(1L, new Object[0]), bitsd, new Object[] {
+ "M",
+ "P",
+ Character.valueOf('M'),
+ ItemList.Hatch_Muffler_EV.get(1),
+ Character.valueOf('P'),
+ GregtechItemList.Pollution_Cleaner_EV.get(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Muffler_Adv_IV.get(1L, new Object[0]), bitsd, new Object[] {
+ "M",
+ "P",
+ Character.valueOf('M'),
+ ItemList.Hatch_Muffler_IV.get(1),
+ Character.valueOf('P'),
+ GregtechItemList.Pollution_Cleaner_IV.get(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Muffler_Adv_LuV.get(1L, new Object[0]), bitsd, new Object[] {
+ "M",
+ "P",
+ Character.valueOf('M'),
+ ItemList.Hatch_Muffler_LuV.get(1),
+ Character.valueOf('P'),
+ GregtechItemList.Pollution_Cleaner_LuV.get(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Muffler_Adv_ZPM.get(1L, new Object[0]), bitsd, new Object[] {
+ "M",
+ "P",
+ Character.valueOf('M'),
+ ItemList.Hatch_Muffler_ZPM.get(1),
+ Character.valueOf('P'),
+ GregtechItemList.Pollution_Cleaner_ZPM.get(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Muffler_Adv_UV.get(1L, new Object[0]), bitsd, new Object[] {
+ "M",
+ "P",
+ Character.valueOf('M'),
+ ItemList.Hatch_Muffler_UV.get(1),
+ Character.valueOf('P'),
+ GregtechItemList.Pollution_Cleaner_UV.get(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Muffler_Adv_MAX.get(1L, new Object[0]), bitsd, new Object[] {
+ "M",
+ "P",
+ Character.valueOf('M'),
+ ItemList.Hatch_Muffler_MAX.get(1),
+ Character.valueOf('P'),
+ GregtechItemList.Pollution_Cleaner_MAX.get(1)
+ });
+ }
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java
index 76182e61d9..aab90619cb 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java
@@ -1,135 +1,188 @@
package gtPlusPlus.core.recipe;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.*;
import gregtech.api.interfaces.IOreRecipeRegistrator;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.item.ItemStack;
public class RECIPES_LaserEngraver implements IOreRecipeRegistrator {
- public RECIPES_LaserEngraver() {
- OrePrefixes.crafting.add(this);
- }
-
- @Override
- public void registerOre(final OrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) {
- if (aOreDictName.equals(OreDictNames.craftingLensBlue.toString())) {
-
- if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH){
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilYttriumBariumCuprate", 1) != null){
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.YttriumBariumCuprate, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]), 64, 480);
- }
- else {
- Logger.INFO("foilYttriumBariumCuprate does not exist within Gregtech, please report this issue to Blood-asp on github.");
- Logger.INFO("This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilVanadiumGallium", 1) != null){
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.VanadiumGallium, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]), 64, 480);
- }
- else {
- Logger.INFO("foilVanadiumGallium does not exist within Gregtech, please report this issue to Blood-asp on github.");
- Logger.INFO("This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilNiobiumTitanium", 1) != null){
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]), 64, 480);
- }
- else {
- Logger.INFO("foilNiobiumTitanium does not exist within Gregtech, please report this issue to Blood-asp on github.");
- Logger.INFO("This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
- }
- }
-
-
- } else if (aOreDictName.equals(OreDictNames.craftingLensYellow.toString())) {
- if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH){
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilOsmium", 1) != null){
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_LuV.get(1L, new Object[0]), 64, 1024);
- }
- else {
- Logger.INFO("foilOsmium does not exist within Gregtech, please report this issue to Blood-asp on github.");
- Logger.INFO("This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
- }
- }
-
- } else if (aOreDictName.equals(OreDictNames.craftingLensCyan.toString())) {
- } else if (aOreDictName.equals(OreDictNames.craftingLensRed.toString())) {
- } else if (aOreDictName.equals(OreDictNames.craftingLensGreen.toString())) {
- if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH){
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilNaquadah", 1) != null){
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Naquadah, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_ZPM.get(1L, new Object[0]), 64, 2000);
- }
- else {
- Logger.INFO("foilNaquadah does not exist within Gregtech, please report this issue to Blood-asp on github.");
- Logger.INFO("This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
- }
- }
- } else if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) {
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateLithium", 1) != null){
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lithium, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), ItemUtils.getItemStackOfAmountFromOreDict("plateDoubleLithium7", 1), 4*60*20, 2000);
- }
- else {
- Logger.INFO("plateLithium does not exist within Gregtech, please report this issue to Blood-asp on github.");
- Logger.INFO("This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustLithium", 1) != null){
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 3L), GT_Utility.copyAmount(0L, new Object[]{aStack}), ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 1), 2*60*20, 2000);
- }
- else {
- Logger.INFO("dustLithium does not exist within Gregtech, please report this issue to Blood-asp on github.");
- Logger.INFO("This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
- }
-
- }
-
- else if (aOreDictName.equals(OreDictNames.craftingLensLime.toString())) {
- //Coil Wires
- ItemStack coilWire1 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire", "coilWire1", 0, 1);
- ItemStack coilWire2 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:1", "coilWire2", 1, 1);
- ItemStack coilWire3 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:2", "coilWire3", 2, 1);
- ItemStack coilWire4 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:3", "coilWire4", 3, 1);
-
- //Simple Life
- String wire = "wireGt02";
-
- //Wires to Laser
- ItemStack wireT1a = ItemUtils.getItemStackOfAmountFromOreDict(wire+"Aluminium", 1);
- ItemStack wireT1b = ItemUtils.getItemStackOfAmountFromOreDict(wire+"Nichrome", 1);
- ItemStack wireT2a = ItemUtils.getItemStackOfAmountFromOreDict(wire+"Osmium", 1);
- ItemStack wireT2b = ItemUtils.getItemStackOfAmountFromOreDict(wire+"Platinum", 1);
- ItemStack wireT3a = ItemUtils.getItemStackOfAmountFromOreDict(wire+"VanadiumGallium", 1);
- ItemStack wireT3b = ItemUtils.getItemStackOfAmountFromOreDict(wire+"YttriumBariumCuprate", 1);
- ItemStack wireT3c = ItemUtils.getItemStackOfAmountFromOreDict(wire+"NiobiumTitanium", 1);
- ItemStack wireT4a = ItemUtils.getItemStackOfAmountFromOreDict(wire+"Naquadah", 1);
-
- //T1
- GT_Values.RA.addLaserEngraverRecipe(wireT1a, GT_Utility.copyAmount(0L, new Object[]{aStack}), coilWire1, 10*20, 500);
- GT_Values.RA.addLaserEngraverRecipe(wireT1b, GT_Utility.copyAmount(0L, new Object[]{aStack}), coilWire1, 10*20, 500);
- //T2
- GT_Values.RA.addLaserEngraverRecipe(wireT2a, GT_Utility.copyAmount(0L, new Object[]{aStack}), coilWire2, 20*20, 2000);
- GT_Values.RA.addLaserEngraverRecipe(wireT2b, GT_Utility.copyAmount(0L, new Object[]{aStack}), coilWire2, 20*20, 2000);
- //T3
- GT_Values.RA.addLaserEngraverRecipe(wireT3a, GT_Utility.copyAmount(0L, new Object[]{aStack}), coilWire3, 30*20, 8000);
- GT_Values.RA.addLaserEngraverRecipe(wireT3b, GT_Utility.copyAmount(0L, new Object[]{aStack}), coilWire3, 30*20, 8000);
- GT_Values.RA.addLaserEngraverRecipe(wireT3c, GT_Utility.copyAmount(0L, new Object[]{aStack}), coilWire3, 30*20, 8000);
- //T4
- GT_Values.RA.addLaserEngraverRecipe(wireT4a, GT_Utility.copyAmount(0L, new Object[]{aStack}), coilWire4, 40*20, 32000);
-
-
- }
-
- else if (aOreDictName.equals(OreDictNames.craftingLensOrange.toString())) {
- GT_Values.RA.addLaserEngraverRecipe(ItemUtils.getSimpleStack(ModItems.itemAlkalusDisk), GT_Utility.copyAmount(0L, new Object[]{aStack}), ItemUtils.getSimpleStack(Dimension_Everglades.portalItem), 360*60*20, 4096);
- }
-
-
-
- }
+ public RECIPES_LaserEngraver() {
+ OrePrefixes.crafting.add(this);
+ }
+
+ @Override
+ public void registerOre(
+ final OrePrefixes aPrefix,
+ final Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ if (aOreDictName.equals(OreDictNames.craftingLensBlue.toString())) {
+
+ if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH) {
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilYttriumBariumCuprate", 1) != null) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.YttriumBariumCuprate, 2L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]),
+ 64,
+ 480);
+ } else {
+ Logger.INFO(
+ "foilYttriumBariumCuprate does not exist within Gregtech, please report this issue to Blood-asp on github.");
+ Logger.INFO(
+ "This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilVanadiumGallium", 1) != null) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.VanadiumGallium, 2L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]),
+ 64,
+ 480);
+ } else {
+ Logger.INFO(
+ "foilVanadiumGallium does not exist within Gregtech, please report this issue to Blood-asp on github.");
+ Logger.INFO(
+ "This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilNiobiumTitanium", 1) != null) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 2L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]),
+ 64,
+ 480);
+ } else {
+ Logger.INFO(
+ "foilNiobiumTitanium does not exist within Gregtech, please report this issue to Blood-asp on github.");
+ Logger.INFO(
+ "This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
+ }
+ }
+
+ } else if (aOreDictName.equals(OreDictNames.craftingLensYellow.toString())) {
+ if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH) {
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilOsmium", 1) != null) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 2L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Circuit_Parts_Wiring_LuV.get(1L, new Object[0]),
+ 64,
+ 1024);
+ } else {
+ Logger.INFO(
+ "foilOsmium does not exist within Gregtech, please report this issue to Blood-asp on github.");
+ Logger.INFO(
+ "This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
+ }
+ }
+
+ } else if (aOreDictName.equals(OreDictNames.craftingLensCyan.toString())) {
+ } else if (aOreDictName.equals(OreDictNames.craftingLensRed.toString())) {
+ } else if (aOreDictName.equals(OreDictNames.craftingLensGreen.toString())) {
+ if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH) {
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilNaquadah", 1) != null) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Naquadah, 2L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Circuit_Parts_Wiring_ZPM.get(1L, new Object[0]),
+ 64,
+ 2000);
+ } else {
+ Logger.INFO(
+ "foilNaquadah does not exist within Gregtech, please report this issue to Blood-asp on github.");
+ Logger.INFO(
+ "This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
+ }
+ }
+ } else if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) {
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateLithium", 1) != null) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lithium, 2L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDoubleLithium7", 1),
+ 4 * 60 * 20,
+ 2000);
+ } else {
+ Logger.INFO(
+ "plateLithium does not exist within Gregtech, please report this issue to Blood-asp on github.");
+ Logger.INFO(
+ "This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustLithium", 1) != null) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 3L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 1),
+ 2 * 60 * 20,
+ 2000);
+ } else {
+ Logger.INFO(
+ "dustLithium does not exist within Gregtech, please report this issue to Blood-asp on github.");
+ Logger.INFO(
+ "This material item can be re-enabled within the gregtech configuration files, If you wish to fix this yourself.");
+ }
+
+ } else if (aOreDictName.equals(OreDictNames.craftingLensLime.toString())) {
+ // Coil Wires
+ ItemStack coilWire1 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire", "coilWire1", 0, 1);
+ ItemStack coilWire2 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:1", "coilWire2", 1, 1);
+ ItemStack coilWire3 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:2", "coilWire3", 2, 1);
+ ItemStack coilWire4 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:3", "coilWire4", 3, 1);
+
+ // Simple Life
+ String wire = "wireGt02";
+
+ // Wires to Laser
+ ItemStack wireT1a = ItemUtils.getItemStackOfAmountFromOreDict(wire + "Aluminium", 1);
+ ItemStack wireT1b = ItemUtils.getItemStackOfAmountFromOreDict(wire + "Nichrome", 1);
+ ItemStack wireT2a = ItemUtils.getItemStackOfAmountFromOreDict(wire + "Osmium", 1);
+ ItemStack wireT2b = ItemUtils.getItemStackOfAmountFromOreDict(wire + "Platinum", 1);
+ ItemStack wireT3a = ItemUtils.getItemStackOfAmountFromOreDict(wire + "VanadiumGallium", 1);
+ ItemStack wireT3b = ItemUtils.getItemStackOfAmountFromOreDict(wire + "YttriumBariumCuprate", 1);
+ ItemStack wireT3c = ItemUtils.getItemStackOfAmountFromOreDict(wire + "NiobiumTitanium", 1);
+ ItemStack wireT4a = ItemUtils.getItemStackOfAmountFromOreDict(wire + "Naquadah", 1);
+
+ // T1
+ GT_Values.RA.addLaserEngraverRecipe(
+ wireT1a, GT_Utility.copyAmount(0L, new Object[] {aStack}), coilWire1, 10 * 20, 500);
+ GT_Values.RA.addLaserEngraverRecipe(
+ wireT1b, GT_Utility.copyAmount(0L, new Object[] {aStack}), coilWire1, 10 * 20, 500);
+ // T2
+ GT_Values.RA.addLaserEngraverRecipe(
+ wireT2a, GT_Utility.copyAmount(0L, new Object[] {aStack}), coilWire2, 20 * 20, 2000);
+ GT_Values.RA.addLaserEngraverRecipe(
+ wireT2b, GT_Utility.copyAmount(0L, new Object[] {aStack}), coilWire2, 20 * 20, 2000);
+ // T3
+ GT_Values.RA.addLaserEngraverRecipe(
+ wireT3a, GT_Utility.copyAmount(0L, new Object[] {aStack}), coilWire3, 30 * 20, 8000);
+ GT_Values.RA.addLaserEngraverRecipe(
+ wireT3b, GT_Utility.copyAmount(0L, new Object[] {aStack}), coilWire3, 30 * 20, 8000);
+ GT_Values.RA.addLaserEngraverRecipe(
+ wireT3c, GT_Utility.copyAmount(0L, new Object[] {aStack}), coilWire3, 30 * 20, 8000);
+ // T4
+ GT_Values.RA.addLaserEngraverRecipe(
+ wireT4a, GT_Utility.copyAmount(0L, new Object[] {aStack}), coilWire4, 40 * 20, 32000);
+
+ } else if (aOreDictName.equals(OreDictNames.craftingLensOrange.toString())) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ ItemUtils.getSimpleStack(ModItems.itemAlkalusDisk),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ ItemUtils.getSimpleStack(Dimension_Everglades.portalItem),
+ 360 * 60 * 20,
+ 4096);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java
index 0d377f74de..cac350b98e 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java
@@ -2,26 +2,22 @@ package gtPlusPlus.core.recipe;
public class RECIPES_MTWRAPPER {
- public static int MT_RECIPES_LOADED = 0;
- public static int MT_RECIPES_FAILED = 0;
-
- public static void run(){
-
- }
-
- public static void addShaped(final Object item_Output,
- final Object item_1, final Object item_2, final Object item_3,
- final Object item_4, final Object item_5, final Object item_6,
- final Object item_7, final Object item_8, final Object item_9){
-
-
- }
-
- public static void addShapeless(){
-
- }
-
-
-
+ public static int MT_RECIPES_LOADED = 0;
+ public static int MT_RECIPES_FAILED = 0;
+
+ public static void run() {}
+
+ public static void addShaped(
+ final Object item_Output,
+ final Object item_1,
+ final Object item_2,
+ final Object item_3,
+ final Object item_4,
+ final Object item_5,
+ final Object item_6,
+ final Object item_7,
+ final Object item_8,
+ final Object item_9) {}
+
+ public static void addShapeless() {}
}
-
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java
index 71b4c4ef48..13abb8cfa5 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java
@@ -2,7 +2,6 @@ package gtPlusPlus.core.recipe;
import gregtech.api.enums.*;
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
@@ -11,400 +10,747 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
public class RECIPES_MachineComponents {
- //Wire
- public static String wireTier0 = "wireGt01Lead";
- public static String wireTier1 = "wireGt01RedAlloy";
- public static String wireTier6 = "wireGt08NiobiumTitanium";
- public static String wireTier7 = "wireGt08Osmium";
- public static String wireTier8 = "wireGt08Naquadah";
- public static String wireTier9 = "wireGt08Superconductor";
- public static String wireTier10 = "wireGt16Superconductor";
-
- //Cable
- public static String cableTier0 = "cableGt01Lead";
- public static String cableTier1 = "cableGt01RedAlloy";
- public static String cableTier6 = "cableGt04Tungsten";
- public static String cableTier7 = "cableGt04NiobiumTitanium";
- public static String cableTier8 = "cableGt04Osmium";
- public static String cableTier9 = "cableGt04Naquadah";
- public static String cableTier10 = "wireGt08Superconductor";
-
- //Plates
- public static String plateTier0 = "plateWroughtIron";
- public static String plateTier7 = "plateChrome";
- public static String plateTier8 = "plateIridium";
- public static String plateTier9 = "plateOsmium";
- public static String plateTier10 = "plateNeutronium";
-
- //rods
- public static String rodTier0 = "stickWroughtIron";
- public static String rodTier1 = "stickPotin";
- public static String rodTier2 = "stickIronMagnetic";
- public static String rodTier7a = "stickChrome";
- public static String rodTier8a = "stickIridium";
- public static String rodTier9a = "stickOsmium";
- public static String rodTier10a = "stickNeutronium";
- public static String rodTier7b = "stickPlatinum";
- public static String rodTier8b = "stickChrome";
- public static String rodTier9b = "stickIridium";
- public static String rodTier10b = "stickOsmium";
- public static String rodTier7c = "stickTitanium";
- public static String rodTier8c = "stickTungstenSteel";
- public static String rodTier9c = "stickNaquadah";
- public static String rodTier10c = "stickOsmium";
-
- //Screws
- public static String screwTier0 = "screwPotin";
- public static String screwTier7 = "screwChrome";
- public static String screwTier8 = "screwIridium";
- public static String screwTier9 = "screwOsmium";
- public static String screwTier10 = "screwNeutronium";
-
- //Rotors
- public static String rotorTier0 = "rotorPotin";
- public static String rotorTier7 = "rotorChrome";
- public static String rotorTier8 = "rotorIridium";
- public static String rotorTier9 = "rotorOsmium";
- public static String rotorTier10 = "rotorNeutronium";
-
- //Fluid Pipe
- public static String pipeTier0 = "pipeSmallLead";
- public static String pipeTier7 = "pipeHugeSteel";
- public static String pipeTier8 = "pipeHugeStainlessSteel";
- public static String pipeTier9 = "pipeHugeTitanium";
- public static String pipeTier10 = "pipeHugeTungstenSteel";
-
- //Rubber Ring/Plate
- public static String itemRubberRing = "ringRubber";
- public static String plateRubber = "plateRubber";
-
- //Circuits
- public static String circuitTier0 = "circuitPrimitive";
- public static String circuitTier1 = "circuitBasic";
- public static String circuitTier6 = "circuitMaster";
- public static String circuitTier7 = "circuitUltimate";
- public static String circuitTier8 = "circuitSuperconductor";
- public static String circuitTier9 = "circuitInfinite";
- public static String circuitTier10 = "circuitQuantum";
-
- //small gears
- public static String smallGearTier0 = "gearGtSmallWroughtIron";
- public static String smallGearTier7 = "gearGtSmallChrome";
- public static String smallGearTier8 = "gearGtSmallIridium";
- public static String smallGearTier9 = "gearGtSmallOsmium";
- public static String smallGearTier10 = "gearGtSmallNeutronium";
-
- public static final void loadRecipes(){
- Logger.INFO("Loading Recipes for the Various Circuits and Machine components.");
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- run();
- }
- else {
- onlyULVComponents();
- if (!CORE.GTNH) {
- onlyMaxComponents();
- }
- }
- gregtechMachinePhase();
- }
-
- private static void run(){
- //Electric Motors
- RecipeUtils.addShapedGregtechRecipe(
- cableTier7, wireTier7, rodTier7a,
- wireTier7, rodTier7b, wireTier7,
- rodTier7a, wireTier7, cableTier7,
- CI.electricMotor_LuV);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier8, wireTier8, rodTier8a,
- wireTier8, rodTier8b, wireTier8,
- rodTier8a, wireTier8, cableTier8,
- CI.electricMotor_ZPM);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier9, wireTier9, rodTier9a,
- wireTier9, rodTier9b, wireTier9,
- rodTier9a, wireTier9, cableTier9,
- CI.electricMotor_UV);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier10, wireTier10, rodTier10a,
- wireTier10, rodTier10b, wireTier10,
- rodTier10a, wireTier10, cableTier10,
- CI.electricMotor_MAX);
-
- //Electric Pump
- RecipeUtils.addShapedGregtechRecipe(
- cableTier7, rotorTier7, itemRubberRing,
- CI.craftingToolScrewdriver, pipeTier7, CI.craftingToolWrench,
- itemRubberRing, CI.electricMotor_LuV, cableTier7,
- CI.electricPump_LuV);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier8, rotorTier8, itemRubberRing,
- CI.craftingToolScrewdriver, pipeTier8, CI.craftingToolWrench,
- itemRubberRing, CI.electricMotor_ZPM, cableTier8,
- CI.electricPump_ZPM);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier9, rotorTier9, itemRubberRing,
- CI.craftingToolScrewdriver, pipeTier9, CI.craftingToolWrench,
- itemRubberRing, CI.electricMotor_UV, cableTier9,
- CI.electricPump_UV);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier10, rotorTier10, itemRubberRing,
- CI.craftingToolScrewdriver, pipeTier10, CI.craftingToolWrench,
- itemRubberRing, CI.electricMotor_MAX, cableTier10,
- CI.electricPump_MAX);
-
- //Electric Pump
- RecipeUtils.addShapedGregtechRecipe(
- plateTier7, plateTier7, plateTier7,
- cableTier7, rodTier7a, rodTier7a,
- cableTier7, CI.electricMotor_LuV, smallGearTier7,
- CI.electricPiston_LuV);
- RecipeUtils.addShapedGregtechRecipe(
- plateTier8, plateTier8, plateTier8,
- cableTier8, rodTier8a, rodTier8a,
- cableTier8, CI.electricMotor_ZPM, smallGearTier8,
- CI.electricPiston_ZPM);
- RecipeUtils.addShapedGregtechRecipe(
- plateTier9, plateTier9, plateTier9,
- cableTier9, rodTier9a, rodTier9a,
- cableTier9, CI.electricMotor_UV, smallGearTier9,
- CI.electricPiston_UV);
- RecipeUtils.addShapedGregtechRecipe(
- plateTier10, plateTier10, plateTier10,
- cableTier10, rodTier10a, rodTier10a,
- cableTier10, CI.electricMotor_MAX, smallGearTier10,
- CI.electricPiston_MAX);
-
- //Robot Arms
- RecipeUtils.addShapedGregtechRecipe(
- cableTier7, cableTier7, cableTier7,
- CI.electricMotor_LuV, rodTier7a, CI.electricMotor_LuV,
- CI.electricPiston_LuV, circuitTier7, rodTier7a,
- CI.robotArm_LuV);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier8, cableTier8, cableTier8,
- CI.electricMotor_ZPM, rodTier8a, CI.electricMotor_ZPM,
- CI.electricPiston_ZPM, circuitTier8, rodTier8a,
- CI.robotArm_ZPM);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier9, cableTier9, cableTier9,
- CI.electricMotor_UV, rodTier9a, CI.electricMotor_UV,
- CI.electricPiston_UV, circuitTier9, rodTier9a,
- CI.robotArm_UV);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier10, cableTier10, cableTier10,
- CI.electricMotor_MAX, rodTier10a, CI.electricMotor_MAX,
- CI.electricPiston_MAX, circuitTier10, rodTier10a,
- CI.robotArm_MAX);
-
- //Conveyor Modules
- RecipeUtils.addShapedGregtechRecipe(
- plateRubber, plateRubber, plateRubber,
- CI.electricMotor_LuV, cableTier7, CI.electricMotor_LuV,
- plateRubber, plateRubber, plateRubber,
- CI.conveyorModule_LuV);
- RecipeUtils.addShapedGregtechRecipe(
- plateRubber, plateRubber, plateRubber,
- CI.electricMotor_ZPM, cableTier8, CI.electricMotor_ZPM,
- plateRubber, plateRubber, plateRubber,
- CI.conveyorModule_ZPM);
- RecipeUtils.addShapedGregtechRecipe(
- plateRubber, plateRubber, plateRubber,
- CI.electricMotor_UV, cableTier9, CI.electricMotor_UV,
- plateRubber, plateRubber, plateRubber,
- CI.conveyorModule_UV);
- RecipeUtils.addShapedGregtechRecipe(
- plateRubber, plateRubber, plateRubber,
- CI.electricMotor_MAX, cableTier10, CI.electricMotor_MAX,
- plateRubber, plateRubber, plateRubber,
- CI.conveyorModule_MAX);
-
- //Emitter Modules
- RecipeUtils.addShapedGregtechRecipe(
- rodTier7c, rodTier7c, circuitTier7,
- cableTier7, circuitTier6, rodTier7c,
- circuitTier7, cableTier7, rodTier7c,
- CI.emitter_LuV);
- RecipeUtils.addShapedGregtechRecipe(
- rodTier8c, rodTier8c, circuitTier8,
- cableTier8, circuitTier7, rodTier8c,
- circuitTier8, cableTier8, rodTier8c,
- CI.emitter_ZPM);
- RecipeUtils.addShapedGregtechRecipe(
- rodTier9c, rodTier9c, circuitTier9,
- cableTier9, circuitTier8, rodTier9c,
- circuitTier9, cableTier9, rodTier9c,
- CI.emitter_UV);
- RecipeUtils.addShapedGregtechRecipe(
- rodTier10c, rodTier10c, circuitTier10,
- cableTier10, circuitTier9, rodTier10c,
- circuitTier10, cableTier10, rodTier10c,
- CI.emitter_MAX);
-
- //Field Generator Modules
- RecipeUtils.addShapedGregtechRecipe(
- wireTier7, circuitTier7, wireTier7,
- circuitTier7, circuitTier6, circuitTier7,
- wireTier7, circuitTier7, wireTier7,
- CI.fieldGenerator_LuV);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier8, circuitTier8, wireTier8,
- circuitTier8, circuitTier7, circuitTier8,
- wireTier8, circuitTier8, wireTier8,
- CI.fieldGenerator_ZPM);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier9, circuitTier9, wireTier9,
- circuitTier9, circuitTier8, circuitTier9,
- wireTier9, circuitTier9, wireTier9,
- CI.fieldGenerator_UV);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier10, circuitTier10, wireTier10,
- circuitTier10, circuitTier9, circuitTier10,
- wireTier10, circuitTier10, wireTier10,
- CI.fieldGenerator_MAX);
-
- //Sensor Modules
- RecipeUtils.addShapedRecipe(
- plateTier7, null, circuitTier6,
- plateTier7, rodTier7c, null,
- circuitTier7, plateTier7, plateTier7,
- CI.sensor_LuV);
- RecipeUtils.addShapedRecipe(
- plateTier8, null, circuitTier7,
- plateTier8, rodTier8c, null,
- circuitTier8, plateTier8, plateTier8,
- CI.sensor_ZPM);
- RecipeUtils.addShapedRecipe(
- plateTier9, null, circuitTier8,
- plateTier9, rodTier9c, null,
- circuitTier9, plateTier9, plateTier9,
- CI.sensor_UV);
- RecipeUtils.addShapedRecipe(
- plateTier10, null, circuitTier9,
- plateTier10, rodTier10c, null,
- circuitTier10, plateTier10, plateTier10,
- CI.sensor_MAX);
-
- onlyULVComponents();
-
- Logger.INFO("Done loading recipes for the Various machine components.");
-
- }
-
- private static void onlyULVComponents(){
- RecipeUtils.addShapedGregtechRecipe(
- cableTier1, wireTier0, rodTier0,
- wireTier0, rodTier2, wireTier0,
- rodTier0, wireTier0, cableTier1,
- CI.electricMotor_ULV);
-
- RecipeUtils.addShapedGregtechRecipe(
- cableTier0, rotorTier0, itemRubberRing,
- CI.craftingToolScrewdriver, pipeTier0, CI.craftingToolWrench,
- itemRubberRing, CI.electricMotor_ULV, cableTier0,
- CI.electricPump_ULV);
-
- RecipeUtils.addShapedGregtechRecipe(
- plateTier0, plateTier0, plateTier0,
- cableTier0, rodTier1, rodTier1,
- cableTier0, CI.electricMotor_ULV, smallGearTier0,
- CI.electricPiston_ULV);
-
- RecipeUtils.addShapedGregtechRecipe(
- cableTier0, cableTier0, cableTier0,
- CI.electricMotor_ULV, rodTier1, CI.electricMotor_ULV,
- CI.electricPiston_ULV, circuitTier0, rodTier1,
- CI.robotArm_ULV);
-
- RecipeUtils.addShapedGregtechRecipe(
- plateRubber, plateRubber, plateRubber,
- CI.electricMotor_ULV, cableTier0, CI.electricMotor_ULV,
- plateRubber, plateRubber, plateRubber,
- CI.conveyorModule_ULV);
-
- RecipeUtils.addShapedGregtechRecipe(
- rodTier2, rodTier2, circuitTier0,
- cableTier0, circuitTier1, rodTier2,
- circuitTier0, cableTier0, rodTier2,
- CI.emitter_ULV);
-
- RecipeUtils.addShapedGregtechRecipe(
- wireTier0, circuitTier0, wireTier0,
- circuitTier0, circuitTier1, circuitTier0,
- wireTier0, circuitTier0, wireTier0,
- CI.fieldGenerator_ULV);
-
- RecipeUtils.addShapedRecipe(
- plateTier0, null, circuitTier1,
- plateTier0, rodTier2, null,
- circuitTier0, plateTier0, plateTier0,
- CI.sensor_ULV);
- }
-
- private static void onlyMaxComponents(){
- RecipeUtils.addShapedGregtechRecipe(
- cableTier10, wireTier10, rodTier10a,
- wireTier10, rodTier10b, wireTier10,
- rodTier10a, wireTier10, cableTier10,
- CI.electricMotor_MAX);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier10, rotorTier10, itemRubberRing,
- CI.craftingToolScrewdriver, pipeTier10, CI.craftingToolWrench,
- itemRubberRing, CI.electricMotor_MAX, cableTier10,
- CI.electricPump_MAX);
- RecipeUtils.addShapedGregtechRecipe(
- plateTier10, plateTier10, plateTier10,
- cableTier10, rodTier10a, rodTier10a,
- cableTier10, CI.electricMotor_MAX, smallGearTier10,
- CI.electricPiston_MAX);
- RecipeUtils.addShapedGregtechRecipe(
- cableTier10, cableTier10, cableTier10,
- CI.electricMotor_MAX, rodTier10a, CI.electricMotor_MAX,
- CI.electricPiston_MAX, circuitTier10, rodTier10a,
- CI.robotArm_MAX);
- RecipeUtils.addShapedGregtechRecipe(
- plateRubber, plateRubber, plateRubber,
- CI.electricMotor_MAX, cableTier10, CI.electricMotor_MAX,
- plateRubber, plateRubber, plateRubber,
- CI.conveyorModule_MAX);
- RecipeUtils.addShapedGregtechRecipe(
- rodTier10c, rodTier10c, circuitTier10,
- cableTier10, circuitTier9, rodTier10c,
- circuitTier10, cableTier10, rodTier10c,
- CI.emitter_MAX);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier10, circuitTier10, wireTier10,
- circuitTier10, circuitTier9, circuitTier10,
- wireTier10, circuitTier10, wireTier10,
- CI.fieldGenerator_MAX);
- RecipeUtils.addShapedRecipe(
- plateTier10, null, circuitTier9,
- plateTier10, rodTier10c, null,
- circuitTier10, plateTier10, plateTier10,
- CI.sensor_MAX);
- }
-
- private static void gregtechMachinePhase(){
- if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH){
- Logger.INFO("Adding Gregtech machine recipes for the circuits.");
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GregtechItemList.Circuit_Parts_Wiring_IV.get(4L, new Object[0]), GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]), 30, 240);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GregtechItemList.Circuit_Parts_Wiring_LuV.get(4L, new Object[0]), GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]), 60, 480);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 2L), GregtechItemList.Circuit_Parts_Wiring_ZPM.get(4L, new Object[0]), GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]), 90, 1000);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(3L, new Object[0]), GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]), 30, 480);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(3L, new Object[0]), GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]), 60, 1000);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(3L, new Object[0]), GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]), 90, 2000);
- GT_Values.RA.addForgeHammerRecipe(ItemList.Circuit_Master.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(5L, new Object[0]), 30, 256);
- GT_Values.RA.addForgeHammerRecipe(GregtechItemList.Circuit_IV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(5L, new Object[0]), 60, 512);
- GT_Values.RA.addForgeHammerRecipe(GregtechItemList.Circuit_LuV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(5L, new Object[0]), 120, 1024);
- for (final Materials tMat : Materials.values()) {
- if ((tMat.mStandardMoltenFluid != null) && (tMat.contains(SubTag.SOLDERING_MATERIAL))) {
- final int tMultiplier = tMat.contains(SubTag.SOLDERING_MATERIAL_GOOD) ? 1 : tMat.contains(SubTag.SOLDERING_MATERIAL_BAD) ? 4 : 2;
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]), tMat.getMolten((144L * tMultiplier) / 4L), GregtechItemList.Circuit_IV.get(1L, new Object[0]), 30, 480);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]), tMat.getMolten((144L * tMultiplier) / 4L), GregtechItemList.Circuit_LuV.get(1L, new Object[0]), 60, 1000);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]), tMat.getMolten((144L * tMultiplier) / 4L), GregtechItemList.Circuit_ZPM.get(1L, new Object[0]), 90, 2000);
-
- }
- }
- }
- }
+ // Wire
+ public static String wireTier0 = "wireGt01Lead";
+ public static String wireTier1 = "wireGt01RedAlloy";
+ public static String wireTier6 = "wireGt08NiobiumTitanium";
+ public static String wireTier7 = "wireGt08Osmium";
+ public static String wireTier8 = "wireGt08Naquadah";
+ public static String wireTier9 = "wireGt08Superconductor";
+ public static String wireTier10 = "wireGt16Superconductor";
+
+ // Cable
+ public static String cableTier0 = "cableGt01Lead";
+ public static String cableTier1 = "cableGt01RedAlloy";
+ public static String cableTier6 = "cableGt04Tungsten";
+ public static String cableTier7 = "cableGt04NiobiumTitanium";
+ public static String cableTier8 = "cableGt04Osmium";
+ public static String cableTier9 = "cableGt04Naquadah";
+ public static String cableTier10 = "wireGt08Superconductor";
+
+ // Plates
+ public static String plateTier0 = "plateWroughtIron";
+ public static String plateTier7 = "plateChrome";
+ public static String plateTier8 = "plateIridium";
+ public static String plateTier9 = "plateOsmium";
+ public static String plateTier10 = "plateNeutronium";
+
+ // rods
+ public static String rodTier0 = "stickWroughtIron";
+ public static String rodTier1 = "stickPotin";
+ public static String rodTier2 = "stickIronMagnetic";
+ public static String rodTier7a = "stickChrome";
+ public static String rodTier8a = "stickIridium";
+ public static String rodTier9a = "stickOsmium";
+ public static String rodTier10a = "stickNeutronium";
+ public static String rodTier7b = "stickPlatinum";
+ public static String rodTier8b = "stickChrome";
+ public static String rodTier9b = "stickIridium";
+ public static String rodTier10b = "stickOsmium";
+ public static String rodTier7c = "stickTitanium";
+ public static String rodTier8c = "stickTungstenSteel";
+ public static String rodTier9c = "stickNaquadah";
+ public static String rodTier10c = "stickOsmium";
+
+ // Screws
+ public static String screwTier0 = "screwPotin";
+ public static String screwTier7 = "screwChrome";
+ public static String screwTier8 = "screwIridium";
+ public static String screwTier9 = "screwOsmium";
+ public static String screwTier10 = "screwNeutronium";
+
+ // Rotors
+ public static String rotorTier0 = "rotorPotin";
+ public static String rotorTier7 = "rotorChrome";
+ public static String rotorTier8 = "rotorIridium";
+ public static String rotorTier9 = "rotorOsmium";
+ public static String rotorTier10 = "rotorNeutronium";
+
+ // Fluid Pipe
+ public static String pipeTier0 = "pipeSmallLead";
+ public static String pipeTier7 = "pipeHugeSteel";
+ public static String pipeTier8 = "pipeHugeStainlessSteel";
+ public static String pipeTier9 = "pipeHugeTitanium";
+ public static String pipeTier10 = "pipeHugeTungstenSteel";
+
+ // Rubber Ring/Plate
+ public static String itemRubberRing = "ringRubber";
+ public static String plateRubber = "plateRubber";
+
+ // Circuits
+ public static String circuitTier0 = "circuitPrimitive";
+ public static String circuitTier1 = "circuitBasic";
+ public static String circuitTier6 = "circuitMaster";
+ public static String circuitTier7 = "circuitUltimate";
+ public static String circuitTier8 = "circuitSuperconductor";
+ public static String circuitTier9 = "circuitInfinite";
+ public static String circuitTier10 = "circuitQuantum";
+
+ // small gears
+ public static String smallGearTier0 = "gearGtSmallWroughtIron";
+ public static String smallGearTier7 = "gearGtSmallChrome";
+ public static String smallGearTier8 = "gearGtSmallIridium";
+ public static String smallGearTier9 = "gearGtSmallOsmium";
+ public static String smallGearTier10 = "gearGtSmallNeutronium";
+
+ public static final void loadRecipes() {
+ Logger.INFO("Loading Recipes for the Various Circuits and Machine components.");
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ run();
+ } else {
+ onlyULVComponents();
+ if (!CORE.GTNH) {
+ onlyMaxComponents();
+ }
+ }
+ gregtechMachinePhase();
+ }
+
+ private static void run() {
+ // Electric Motors
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier7,
+ wireTier7,
+ rodTier7a,
+ wireTier7,
+ rodTier7b,
+ wireTier7,
+ rodTier7a,
+ wireTier7,
+ cableTier7,
+ CI.electricMotor_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier8,
+ wireTier8,
+ rodTier8a,
+ wireTier8,
+ rodTier8b,
+ wireTier8,
+ rodTier8a,
+ wireTier8,
+ cableTier8,
+ CI.electricMotor_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier9,
+ wireTier9,
+ rodTier9a,
+ wireTier9,
+ rodTier9b,
+ wireTier9,
+ rodTier9a,
+ wireTier9,
+ cableTier9,
+ CI.electricMotor_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10,
+ wireTier10,
+ rodTier10a,
+ wireTier10,
+ rodTier10b,
+ wireTier10,
+ rodTier10a,
+ wireTier10,
+ cableTier10,
+ CI.electricMotor_MAX);
+
+ // Electric Pump
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier7,
+ rotorTier7,
+ itemRubberRing,
+ CI.craftingToolScrewdriver,
+ pipeTier7,
+ CI.craftingToolWrench,
+ itemRubberRing,
+ CI.electricMotor_LuV,
+ cableTier7,
+ CI.electricPump_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier8,
+ rotorTier8,
+ itemRubberRing,
+ CI.craftingToolScrewdriver,
+ pipeTier8,
+ CI.craftingToolWrench,
+ itemRubberRing,
+ CI.electricMotor_ZPM,
+ cableTier8,
+ CI.electricPump_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier9,
+ rotorTier9,
+ itemRubberRing,
+ CI.craftingToolScrewdriver,
+ pipeTier9,
+ CI.craftingToolWrench,
+ itemRubberRing,
+ CI.electricMotor_UV,
+ cableTier9,
+ CI.electricPump_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10,
+ rotorTier10,
+ itemRubberRing,
+ CI.craftingToolScrewdriver,
+ pipeTier10,
+ CI.craftingToolWrench,
+ itemRubberRing,
+ CI.electricMotor_MAX,
+ cableTier10,
+ CI.electricPump_MAX);
+
+ // Electric Pump
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier7,
+ plateTier7,
+ plateTier7,
+ cableTier7,
+ rodTier7a,
+ rodTier7a,
+ cableTier7,
+ CI.electricMotor_LuV,
+ smallGearTier7,
+ CI.electricPiston_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier8,
+ plateTier8,
+ plateTier8,
+ cableTier8,
+ rodTier8a,
+ rodTier8a,
+ cableTier8,
+ CI.electricMotor_ZPM,
+ smallGearTier8,
+ CI.electricPiston_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier9,
+ plateTier9,
+ plateTier9,
+ cableTier9,
+ rodTier9a,
+ rodTier9a,
+ cableTier9,
+ CI.electricMotor_UV,
+ smallGearTier9,
+ CI.electricPiston_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier10,
+ plateTier10,
+ plateTier10,
+ cableTier10,
+ rodTier10a,
+ rodTier10a,
+ cableTier10,
+ CI.electricMotor_MAX,
+ smallGearTier10,
+ CI.electricPiston_MAX);
+
+ // Robot Arms
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier7,
+ cableTier7,
+ cableTier7,
+ CI.electricMotor_LuV,
+ rodTier7a,
+ CI.electricMotor_LuV,
+ CI.electricPiston_LuV,
+ circuitTier7,
+ rodTier7a,
+ CI.robotArm_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier8,
+ cableTier8,
+ cableTier8,
+ CI.electricMotor_ZPM,
+ rodTier8a,
+ CI.electricMotor_ZPM,
+ CI.electricPiston_ZPM,
+ circuitTier8,
+ rodTier8a,
+ CI.robotArm_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier9,
+ cableTier9,
+ cableTier9,
+ CI.electricMotor_UV,
+ rodTier9a,
+ CI.electricMotor_UV,
+ CI.electricPiston_UV,
+ circuitTier9,
+ rodTier9a,
+ CI.robotArm_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10,
+ cableTier10,
+ cableTier10,
+ CI.electricMotor_MAX,
+ rodTier10a,
+ CI.electricMotor_MAX,
+ CI.electricPiston_MAX,
+ circuitTier10,
+ rodTier10a,
+ CI.robotArm_MAX);
+
+ // Conveyor Modules
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.electricMotor_LuV,
+ cableTier7,
+ CI.electricMotor_LuV,
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.conveyorModule_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.electricMotor_ZPM,
+ cableTier8,
+ CI.electricMotor_ZPM,
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.conveyorModule_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.electricMotor_UV,
+ cableTier9,
+ CI.electricMotor_UV,
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.conveyorModule_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.electricMotor_MAX,
+ cableTier10,
+ CI.electricMotor_MAX,
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.conveyorModule_MAX);
+
+ // Emitter Modules
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier7c,
+ rodTier7c,
+ circuitTier7,
+ cableTier7,
+ circuitTier6,
+ rodTier7c,
+ circuitTier7,
+ cableTier7,
+ rodTier7c,
+ CI.emitter_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier8c,
+ rodTier8c,
+ circuitTier8,
+ cableTier8,
+ circuitTier7,
+ rodTier8c,
+ circuitTier8,
+ cableTier8,
+ rodTier8c,
+ CI.emitter_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier9c,
+ rodTier9c,
+ circuitTier9,
+ cableTier9,
+ circuitTier8,
+ rodTier9c,
+ circuitTier9,
+ cableTier9,
+ rodTier9c,
+ CI.emitter_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier10c,
+ rodTier10c,
+ circuitTier10,
+ cableTier10,
+ circuitTier9,
+ rodTier10c,
+ circuitTier10,
+ cableTier10,
+ rodTier10c,
+ CI.emitter_MAX);
+
+ // Field Generator Modules
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier7,
+ circuitTier7,
+ wireTier7,
+ circuitTier7,
+ circuitTier6,
+ circuitTier7,
+ wireTier7,
+ circuitTier7,
+ wireTier7,
+ CI.fieldGenerator_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier8,
+ circuitTier8,
+ wireTier8,
+ circuitTier8,
+ circuitTier7,
+ circuitTier8,
+ wireTier8,
+ circuitTier8,
+ wireTier8,
+ CI.fieldGenerator_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier9,
+ circuitTier9,
+ wireTier9,
+ circuitTier9,
+ circuitTier8,
+ circuitTier9,
+ wireTier9,
+ circuitTier9,
+ wireTier9,
+ CI.fieldGenerator_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier10,
+ circuitTier10,
+ wireTier10,
+ circuitTier10,
+ circuitTier9,
+ circuitTier10,
+ wireTier10,
+ circuitTier10,
+ wireTier10,
+ CI.fieldGenerator_MAX);
+
+ // Sensor Modules
+ RecipeUtils.addShapedRecipe(
+ plateTier7,
+ null,
+ circuitTier6,
+ plateTier7,
+ rodTier7c,
+ null,
+ circuitTier7,
+ plateTier7,
+ plateTier7,
+ CI.sensor_LuV);
+ RecipeUtils.addShapedRecipe(
+ plateTier8,
+ null,
+ circuitTier7,
+ plateTier8,
+ rodTier8c,
+ null,
+ circuitTier8,
+ plateTier8,
+ plateTier8,
+ CI.sensor_ZPM);
+ RecipeUtils.addShapedRecipe(
+ plateTier9,
+ null,
+ circuitTier8,
+ plateTier9,
+ rodTier9c,
+ null,
+ circuitTier9,
+ plateTier9,
+ plateTier9,
+ CI.sensor_UV);
+ RecipeUtils.addShapedRecipe(
+ plateTier10,
+ null,
+ circuitTier9,
+ plateTier10,
+ rodTier10c,
+ null,
+ circuitTier10,
+ plateTier10,
+ plateTier10,
+ CI.sensor_MAX);
+
+ onlyULVComponents();
+
+ Logger.INFO("Done loading recipes for the Various machine components.");
+ }
+
+ private static void onlyULVComponents() {
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier1,
+ wireTier0,
+ rodTier0,
+ wireTier0,
+ rodTier2,
+ wireTier0,
+ rodTier0,
+ wireTier0,
+ cableTier1,
+ CI.electricMotor_ULV);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier0,
+ rotorTier0,
+ itemRubberRing,
+ CI.craftingToolScrewdriver,
+ pipeTier0,
+ CI.craftingToolWrench,
+ itemRubberRing,
+ CI.electricMotor_ULV,
+ cableTier0,
+ CI.electricPump_ULV);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier0,
+ plateTier0,
+ plateTier0,
+ cableTier0,
+ rodTier1,
+ rodTier1,
+ cableTier0,
+ CI.electricMotor_ULV,
+ smallGearTier0,
+ CI.electricPiston_ULV);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier0,
+ cableTier0,
+ cableTier0,
+ CI.electricMotor_ULV,
+ rodTier1,
+ CI.electricMotor_ULV,
+ CI.electricPiston_ULV,
+ circuitTier0,
+ rodTier1,
+ CI.robotArm_ULV);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.electricMotor_ULV,
+ cableTier0,
+ CI.electricMotor_ULV,
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.conveyorModule_ULV);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier2,
+ rodTier2,
+ circuitTier0,
+ cableTier0,
+ circuitTier1,
+ rodTier2,
+ circuitTier0,
+ cableTier0,
+ rodTier2,
+ CI.emitter_ULV);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier0,
+ circuitTier0,
+ wireTier0,
+ circuitTier0,
+ circuitTier1,
+ circuitTier0,
+ wireTier0,
+ circuitTier0,
+ wireTier0,
+ CI.fieldGenerator_ULV);
+
+ RecipeUtils.addShapedRecipe(
+ plateTier0,
+ null,
+ circuitTier1,
+ plateTier0,
+ rodTier2,
+ null,
+ circuitTier0,
+ plateTier0,
+ plateTier0,
+ CI.sensor_ULV);
+ }
+
+ private static void onlyMaxComponents() {
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10,
+ wireTier10,
+ rodTier10a,
+ wireTier10,
+ rodTier10b,
+ wireTier10,
+ rodTier10a,
+ wireTier10,
+ cableTier10,
+ CI.electricMotor_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10,
+ rotorTier10,
+ itemRubberRing,
+ CI.craftingToolScrewdriver,
+ pipeTier10,
+ CI.craftingToolWrench,
+ itemRubberRing,
+ CI.electricMotor_MAX,
+ cableTier10,
+ CI.electricPump_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier10,
+ plateTier10,
+ plateTier10,
+ cableTier10,
+ rodTier10a,
+ rodTier10a,
+ cableTier10,
+ CI.electricMotor_MAX,
+ smallGearTier10,
+ CI.electricPiston_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10,
+ cableTier10,
+ cableTier10,
+ CI.electricMotor_MAX,
+ rodTier10a,
+ CI.electricMotor_MAX,
+ CI.electricPiston_MAX,
+ circuitTier10,
+ rodTier10a,
+ CI.robotArm_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.electricMotor_MAX,
+ cableTier10,
+ CI.electricMotor_MAX,
+ plateRubber,
+ plateRubber,
+ plateRubber,
+ CI.conveyorModule_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier10c,
+ rodTier10c,
+ circuitTier10,
+ cableTier10,
+ circuitTier9,
+ rodTier10c,
+ circuitTier10,
+ cableTier10,
+ rodTier10c,
+ CI.emitter_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier10,
+ circuitTier10,
+ wireTier10,
+ circuitTier10,
+ circuitTier9,
+ circuitTier10,
+ wireTier10,
+ circuitTier10,
+ wireTier10,
+ CI.fieldGenerator_MAX);
+ RecipeUtils.addShapedRecipe(
+ plateTier10,
+ null,
+ circuitTier9,
+ plateTier10,
+ rodTier10c,
+ null,
+ circuitTier10,
+ plateTier10,
+ plateTier10,
+ CI.sensor_MAX);
+ }
+
+ private static void gregtechMachinePhase() {
+ if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH) {
+ Logger.INFO("Adding Gregtech machine recipes for the circuits.");
+ GT_Values.RA.addFormingPressRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L),
+ GregtechItemList.Circuit_Parts_Wiring_IV.get(4L, new Object[0]),
+ GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]),
+ 30,
+ 240);
+ GT_Values.RA.addFormingPressRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L),
+ GregtechItemList.Circuit_Parts_Wiring_LuV.get(4L, new Object[0]),
+ GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]),
+ 60,
+ 480);
+ GT_Values.RA.addFormingPressRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 2L),
+ GregtechItemList.Circuit_Parts_Wiring_ZPM.get(4L, new Object[0]),
+ GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]),
+ 90,
+ 1000);
+ GT_Values.RA.addFormingPressRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L),
+ GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(3L, new Object[0]),
+ GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]),
+ 30,
+ 480);
+ GT_Values.RA.addFormingPressRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L),
+ GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(3L, new Object[0]),
+ GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]),
+ 60,
+ 1000);
+ GT_Values.RA.addFormingPressRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L),
+ GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(3L, new Object[0]),
+ GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]),
+ 90,
+ 2000);
+ GT_Values.RA.addForgeHammerRecipe(
+ ItemList.Circuit_Master.get(1L, new Object[0]),
+ GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(5L, new Object[0]),
+ 30,
+ 256);
+ GT_Values.RA.addForgeHammerRecipe(
+ GregtechItemList.Circuit_IV.get(1L, new Object[0]),
+ GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(5L, new Object[0]),
+ 60,
+ 512);
+ GT_Values.RA.addForgeHammerRecipe(
+ GregtechItemList.Circuit_LuV.get(1L, new Object[0]),
+ GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(5L, new Object[0]),
+ 120,
+ 1024);
+ for (final Materials tMat : Materials.values()) {
+ if ((tMat.mStandardMoltenFluid != null) && (tMat.contains(SubTag.SOLDERING_MATERIAL))) {
+ final int tMultiplier = tMat.contains(SubTag.SOLDERING_MATERIAL_GOOD)
+ ? 1
+ : tMat.contains(SubTag.SOLDERING_MATERIAL_BAD) ? 4 : 2;
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]),
+ GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]),
+ tMat.getMolten((144L * tMultiplier) / 4L),
+ GregtechItemList.Circuit_IV.get(1L, new Object[0]),
+ 30,
+ 480);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]),
+ GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]),
+ tMat.getMolten((144L * tMultiplier) / 4L),
+ GregtechItemList.Circuit_LuV.get(1L, new Object[0]),
+ 60,
+ 1000);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]),
+ GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]),
+ tMat.getMolten((144L * tMultiplier) / 4L),
+ GregtechItemList.Circuit_ZPM.get(1L, new Object[0]),
+ 90,
+ 2000);
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
index 64dda6c684..9a1c1ed029 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
@@ -39,3593 +39,4296 @@ import net.minecraftforge.fluids.FluidStack;
public class RECIPES_Machines {
- //Outputs
- //static ItemStack RECIPE_BufferCore_ULV = new ItemStack(GregtechEnergyBuffer.itemBufferCore);
- public static ItemStack RECIPE_SteamCondenser;
- public static ItemStack RECIPE_IronBlastFurnace;
- public static ItemStack RECIPE_IronPlatedBricks;
- public static ItemStack RECIPE_Buffer_ULV = GregtechItemList.Energy_Buffer_1by1_ULV.get(1);
- public static ItemStack RECIPE_Buffer_LV = GregtechItemList.Energy_Buffer_1by1_LV.get(1);
- public static ItemStack RECIPE_Buffer_MV = GregtechItemList.Energy_Buffer_1by1_MV.get(1);
- public static ItemStack RECIPE_Buffer_HV = GregtechItemList.Energy_Buffer_1by1_HV.get(1);
- public static ItemStack RECIPE_Buffer_EV = GregtechItemList.Energy_Buffer_1by1_EV.get(1);
- public static ItemStack RECIPE_Buffer_IV = GregtechItemList.Energy_Buffer_1by1_IV.get(1);
- public static ItemStack RECIPE_Buffer_LuV = GregtechItemList.Energy_Buffer_1by1_LuV.get(1);
- public static ItemStack RECIPE_Buffer_ZPM = GregtechItemList.Energy_Buffer_1by1_ZPM.get(1);
- public static ItemStack RECIPE_Buffer_UV = GregtechItemList.Energy_Buffer_1by1_UV.get(1);
- public static ItemStack RECIPE_Buffer_MAX = GregtechItemList.Energy_Buffer_1by1_MAX.get(1);
- //Industrial Centrifuge
- public static ItemStack RECIPE_IndustrialCentrifugeController;
- public static ItemStack RECIPE_IndustrialCentrifugeCasing;
- //Industrial Coke Oven
- public static ItemStack RECIPE_IndustrialCokeOvenController;
- public static ItemStack RECIPE_IndustrialCokeOvenFrame;
- public static ItemStack RECIPE_IndustrialCokeOvenCasingA;
- public static ItemStack RECIPE_IndustrialCokeOvenCasingB;
- //Industrial Electrolyzer
- public static ItemStack RECIPE_IndustrialElectrolyzerController;
- public static ItemStack RECIPE_IndustrialElectrolyzerFrame;
- //Industrial Material Press
- public static ItemStack RECIPE_IndustrialMaterialPressController;
- public static ItemStack RECIPE_IndustrialMaterialPressFrame;
- //Industrial Maceration Stack
- public static ItemStack RECIPE_IndustrialMacerationStackController;
- public static ItemStack RECIPE_IndustrialMacerationStackFrame;
- //Industrial Wire Factory
- public static ItemStack RECIPE_IndustrialWireFactoryController;
- public static ItemStack RECIPE_IndustrialWireFactoryFrame;
- //Industrial Multi Tank
- public static ItemStack RECIPE_IndustrialMultiTankController;
- public static ItemStack RECIPE_IndustrialMultiTankFrame;
- //Industrial Matter Fabricator
- public static ItemStack RECIPE_IndustrialMatterFabController;
- public static ItemStack RECIPE_IndustrialMatterFabFrame;
- public static ItemStack RECIPE_IndustrialMatterFabCoil;
- //Industrial Blast Smelter
- public static ItemStack RECIPE_IndustrialBlastSmelterController;
- public static ItemStack RECIPE_IndustrialBlastSmelterFrame;
- public static ItemStack RECIPE_IndustrialBlastSmelterCoil;
- //Industrial Sieve
- public static ItemStack RECIPE_IndustrialSieveController;
- public static ItemStack RECIPE_IndustrialSieveFrame;
- public static ItemStack RECIPE_IndustrialSieveGrate;
- //Industrial Tree Farmer
- public static ItemStack RECIPE_TreeFarmController;
- public static ItemStack RECIPE_TreeFarmFrame;
- //Tesseracts
- public static ItemStack RECIPE_TesseractGenerator;
- public static ItemStack RECIPE_TesseractTerminal;
- //Thermal Boiler
- public static ItemStack RECIPE_ThermalBoilerController;
- public static ItemStack RECIPE_ThermalBoilerCasing;
-
- //Thorium Reactor
- public static ItemStack RECIPE_LFTRController;
- public static ItemStack RECIPE_LFTROuterCasing;
- public static ItemStack RECIPE_LFTRInnerCasing;
-
- //Milling
- public static ItemStack RECIPE_ISAMill_Controller;
- public static ItemStack RECIPE_ISAMill_Gearbox;
- public static ItemStack RECIPE_ISAMill_Casing;
- public static ItemStack RECIPE_ISAMill_Hatch;
- public static ItemStack RECIPE_Flotation_Controller;
- public static ItemStack RECIPE_Flotation_Casing;
-
- //Cyclotron
- public static ItemStack RECIPE_CyclotronController;
- public static ItemStack RECIPE_CyclotronOuterCasing;
- public static ItemStack RECIPE_CyclotronInnerCoil;
-
-
- //Buffer Cores
- public static ItemStack RECIPE_BufferCore_ULV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore1", 1);
- public static ItemStack RECIPE_BufferCore_LV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore2", 1);
- public static ItemStack RECIPE_BufferCore_MV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore3", 1);
- public static ItemStack RECIPE_BufferCore_HV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore4", 1);
- public static ItemStack RECIPE_BufferCore_EV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore5", 1);
- public static ItemStack RECIPE_BufferCore_IV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore6", 1);
- public static ItemStack RECIPE_BufferCore_LuV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore7", 1);
- public static ItemStack RECIPE_BufferCore_ZPM = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore8", 1);
- public static ItemStack RECIPE_BufferCore_UV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore9", 1);
- public static ItemStack RECIPE_BufferCore_MAX = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore10", 1);
-
-
- //Wire
- public static String wireTier1 = "wireGt08Lead";
- public static String wireTier2 = "wireGt08Tin";
- public static String wireTier3 = "wireGt08Copper";
- public static String wireTier4 = "wireGt08Gold";
- public static String wireTier5 = "wireGt08Aluminium";
- public static String wireTier6 = "wireGt08Tungsten";
- public static String wireTier7 = "wireGt08Naquadah";
- public static String wireTier8 = "wireGt08Osmium";
- public static String wireTier9 = "wireGt08Superconductor";
- public static String wireTier10 = "wireGt16Superconductor";
-
- //Wire
- public static String cableTier1 = "cableGt04Lead";
- public static String cableTier2 = "cableGt04Tin";
- public static String cableTier3 = "cableGt04Copper";
- public static String cableTier4 = "cableGt04Gold";
- public static String cableTier5 = "cableGt04Aluminium";
- public static String cableTier6 = "cableGt04Tungsten";
- public static String cableTier7 = "cableGt04Naquadah";
- public static String cableTier8 = "cableGt04Osmium";
- public static String cableTier9 = "cableGt04NiobiumTitanium";
- public static String cableTier10 = "cableGt08NiobiumTitanium";
-
- public static String pipeTier1 = "pipeHuge"+"Clay";
- public static String pipeTier2 = "pipeHuge"+"Potin";
- public static String pipeTier3 = "pipeHuge"+"Steel";
- public static String pipeTier4 = "pipeHuge"+"StainlessSteel";
- public static String pipeTier5 = "pipeHuge"+"TungstenSteel";
- public static String pipeTier6 = "pipeHuge"+"MaragingSteel300";
- public static String pipeTier7 = "pipeHuge"+"Tantalloy60";
- public static String pipeTier8 = "pipeHuge"+"Tantalloy61";
- public static String pipeTier9 = "pipeHuge"+"Inconel792";
- public static String pipeTier10 = "pipeHuge"+"HastelloyX";
- public static String pipeTier11 = "pipeHuge"+"Europium";
-
- // EV/IV MACHINES
- public static ItemStack EV_MACHINE_Electrolyzer;
- public static ItemStack EV_MACHINE_Centrifuge;
- public static ItemStack EV_MACHINE_BendingMachine;
- public static ItemStack EV_MACHINE_Wiremill;
- public static ItemStack HV_MACHINE_Macerator;
- public static ItemStack EV_MACHINE_Macerator;
- public static ItemStack EV_MACHINE_Cutter;
- public static ItemStack EV_MACHINE_MassFabricator;
- public static ItemStack EV_MACHINE_Extruder;
- public static ItemStack EV_MACHINE_Sifter;
- public static ItemStack EV_MACHINE_ThermalCentrifuge;
- public static ItemStack EV_MACHINE_OreWasher;
- public static ItemStack EV_MACHINE_AlloySmelter;
- public static ItemStack EV_MACHINE_Mixer;
-
-
- //Cables
- public static String cableGt02Electrum = "cableGt02Electrum";
-
-
- //Plates
- public static String plateElectricalSteel= "plateElectricalSteel";
- public static String plateEnergeticAlloy= "plateEnergeticAlloy";
- public static String plateCobalt = "plateCobalt";
- public static String plateBronze = "plateBronze";
- public static String plateSteel = "plateSteel";
-
- //Pipes
- public static String pipeLargeCopper="pipeLargeCopper";
- public static String pipeHugeSteel="pipeHugeSteel";
- public static String pipeHugeStainlessSteel="pipeHugeStainlessSteel";
- public static String pipeHugeTitanium="pipeHugeTitanium";
-
- //Lava Boiler
- public static ItemStack boiler_Coal;
- public static ItemStack blockBricks = ItemUtils.getItemStackFromFQRN("minecraft:brick_block", 1);
-
- //Batteries
- public static String batteryBasic = "batteryBasic";
- public static String batteryAdvanced = "batteryAdvanced";
- public static String batteryElite = "batteryElite";
- public static String batteryMaster = "batteryMaster";
- public static String batteryUltimate = "batteryUltimate";
- public static ItemStack IC2MFE;
- public static ItemStack IC2MFSU;
-
- //Misc
- public static ItemStack INPUT_RCCokeOvenBlock;
- public static ItemStack INPUT_IECokeOvenBlock;
-
- //Output Determiner
- public static int Casing_Amount;
-
-
-
- public static final void loadRecipes(){
- run();
- Logger.INFO("Loading Recipes for the Various machine blocks.");
- }
-
- private static void run(){
-
- //Determines Casing Recipe Output
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !GTNH){
- Casing_Amount=2;
- }
- else {
- Casing_Amount=1;
- }
-
- initModItems();
- tieredMachineHulls();
- controlCores();
- energyCores();
- wirelessChargers();
- largeArcFurnace();
- industrialVacuumFurnace();
- fakeMachineCasingCovers();
- ztonesCoverRecipes();
- overflowValveCovers();
- superBuses();
- roundRobinators();
- chunkloaders();
- distillus();
- algaeFarm();
- chemPlant();
- zyngen();
- milling();
- sparging();
- chisels();
- rockBreaker();
- thermicFluidHeater();
- advHeatExchanger();
-
- gt4FarmManager();
- gt4Redstone();
- gt4Inventory();
-
- //multiGeneratorArray();
- multiForgeHammer();
- multiMolecularTransformer();
- multiXlTurbines();
- multiSolarTower();
- multiElementalDuplicator();
-
- computerCube();
-
- resonanceChambers();
- modulators();
-
-
- }
-
-
- private static void thermicFluidHeater() {
-
- RecipeUtils.addShapedGregtechRecipe(
- CI.getPlate(5, 1), CI.circuitTier5, CI.getPlate(5, 1),
- pipeTier7, ItemList.Machine_IV_FluidHeater.get(1), pipeTier7,
- CI.getPlate(5, 1), CI.circuitTier4, CI.getPlate(5, 1),
- GregtechItemList.Controller_IndustrialFluidHeater.get(1));
- }
-
- private static void advHeatExchanger() {
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.Machine_Multi_HeatExchanger.get(1),
- CI.getDoublePlate(6, 8),
- CI.getScrew(6, 16),
- CI.getCircuit(5, 8)
- },
- CI.tieredMaterials[5].getMolten(144 * 8),
- GregtechItemList.XL_HeatExchanger.get(1),
- 20 * 60,
- MaterialUtils.getVoltageForTier(6));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.Casing_StableTitanium.get(1),
- CI.getPlate(5, 4),
- CI.getScrew(5, 8),
- },
- CI.tieredMaterials[5].getMolten(144 * 2),
- GregtechItemList.Casing_XL_HeatExchanger.get(1),
- 20 * 5,
- MaterialUtils.getVoltageForTier(6));
- }
-
- private static void computerCube() {
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(20),
- CI.getTieredGTPPMachineCasing(4, 1),
- CI.getCircuit(4, 8),
- CI.getFieldGenerator(2, 4),
- CI.getDoublePlate(4, 8),
- CI.getRobotArm(4, 8)
- },
- Materials.Redstone.getMolten(144 * 32),
- GregtechItemList.Gregtech_Computer_Cube_Machine.get(1),
- 20 * 60 * 10,
- MaterialUtils.getVoltageForTier(4));
-
- }
-
-
- private static void gt4FarmManager() {
-
-
-
- ItemList[] aInputHatches = new ItemList[] {
- ItemList.Hatch_Input_LV, ItemList.Hatch_Input_MV, ItemList.Hatch_Input_HV,
- ItemList.Hatch_Input_EV, ItemList.Hatch_Input_IV, ItemList.Hatch_Input_LuV,
- ItemList.Hatch_Input_ZPM, ItemList.Hatch_Input_UV
- };
- GregtechItemList[] aOutputMachines = new GregtechItemList[] {
- GregtechItemList.GT4_Crop_Harvester_LV, GregtechItemList.GT4_Crop_Harvester_MV, GregtechItemList.GT4_Crop_Harvester_HV,
- GregtechItemList.GT4_Crop_Harvester_EV, GregtechItemList.GT4_Crop_Harvester_IV, GregtechItemList.GT4_Crop_Harvester_LuV,
- GregtechItemList.GT4_Crop_Harvester_ZPM, GregtechItemList.GT4_Crop_Harvester_UV
- };
-
- int aTier = 1;
- for (int i=0;i<8;i++) {
- RecipeUtils.addShapedRecipe(
- CI.getRobotArm(aTier, 1), CI.getSensor(aTier, 1), CI.getRobotArm(aTier, 1),
- ItemUtils.getOrePrefixStack(OrePrefixes.toolHeadSense, CI.tieredMaterials[aTier], 1), CI.getTieredMachineHull(aTier, 1), ItemUtils.getOrePrefixStack(OrePrefixes.toolHeadSense, CI.tieredMaterials[aTier], 1),
- CI.getTieredCircuitOreDictName(aTier), aInputHatches[i].get(1), CI.getTieredCircuitOreDictName(aTier),
- aOutputMachines[i].get(1));
- aTier++;
- }
-
- }
-
- private static void gt4Redstone() {
-
- RecipeUtils.addShapedRecipe(
- "plateIron", "plateGlass", "plateIron",
- "plateGlass", ItemUtils.getSimpleStack(Blocks.redstone_lamp), "plateGlass",
- "plateIron", "plateGlass", "plateIron",
- GregtechItemList.GT4_Redstone_Lamp.get(2));
- RecipeUtils.addShapedRecipe(
- "plateAluminium", "plateGlass", "plateAluminium",
- "plateGlass", ItemUtils.getSimpleStack(Blocks.redstone_lamp), "plateGlass",
- "plateAluminium", "plateGlass", "plateAluminium",
- GregtechItemList.GT4_Redstone_Lamp.get(8));
-
- RecipeUtils.addShapedRecipe(
- "plateIron", "plateIron", "plateIron",
- ItemUtils.getSimpleStack(Items.comparator), ItemList.Cover_Screen.get(1), ItemUtils.getSimpleStack(Items.comparator),
- "plateIron", "plateIron", "plateIron",
- GregtechItemList.GT4_Redstone_Display.get(2));
- RecipeUtils.addShapedRecipe(
- "plateAluminium", "plateAluminium", "plateAluminium",
- ItemUtils.getSimpleStack(Items.comparator), ItemList.Cover_Screen.get(1), ItemUtils.getSimpleStack(Items.comparator),
- "plateAluminium", "plateAluminium", "plateAluminium",
- GregtechItemList.GT4_Redstone_Display.get(8));
-
- RecipeUtils.addShapedRecipe(
- "plateIron", "plateIron", "plateIron",
- ItemUtils.getSimpleStack(Items.comparator), ItemList.Cover_EnergyDetector.get(1), ItemUtils.getSimpleStack(Items.comparator),
- "plateIron", "plateIron", "plateIron",
- GregtechItemList.GT4_Redstone_Scale.get(2));
- RecipeUtils.addShapedRecipe(
- "plateAluminium", "plateAluminium", "plateAluminium",
- ItemUtils.getSimpleStack(Items.comparator), ItemList.Cover_EnergyDetector.get(1), ItemUtils.getSimpleStack(Items.comparator),
- "plateAluminium", "plateAluminium", "plateAluminium",
- GregtechItemList.GT4_Redstone_Scale.get(8));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getTieredMachineHull(1),
- ItemUtils.getSimpleStack(Blocks.stone_button, 16)
- },
- null,
- GregtechItemList.GT4_Redstone_Button_Panel.get(1),
- 800,
- 4);
-
- RecipeUtils.addShapedRecipe(
- "plateIron", ItemUtils.getSimpleStack(Items.repeater), "plateIron",
- ItemUtils.getSimpleStack(Items.comparator), CI.getTieredCircuitOreDictName(1), ItemUtils.getSimpleStack(Items.comparator),
- "plateIron", ItemUtils.getSimpleStack(Items.repeater), "plateIron",
- GregtechItemList.GT4_Redstone_Circuit.get(1));
- RecipeUtils.addShapedRecipe(
- "plateAluminium", ItemUtils.getSimpleStack(Items.repeater), "plateAluminium",
- ItemUtils.getSimpleStack(Items.comparator), CI.getTieredCircuitOreDictName(1), ItemUtils.getSimpleStack(Items.comparator),
- "plateAluminium", ItemUtils.getSimpleStack(Items.repeater), "plateAluminium",
- GregtechItemList.GT4_Redstone_Circuit.get(2));
-
- }
-
- private static void gt4Inventory() {
-
- ItemList[] aEnergyHatches = new ItemList[] {
- ItemList.Hatch_Energy_LV, ItemList.Hatch_Energy_MV, ItemList.Hatch_Energy_HV,
- ItemList.Hatch_Energy_EV, ItemList.Hatch_Energy_IV, ItemList.Hatch_Energy_LuV,
- ItemList.Hatch_Energy_ZPM, ItemList.Hatch_Energy_UV
- };
-
- ItemList[] aRegulators = new ItemList[] {
- ItemList.Automation_Regulator_LV, ItemList.Automation_Regulator_MV, ItemList.Automation_Regulator_HV,
- ItemList.Automation_Regulator_EV, ItemList.Automation_Regulator_IV, ItemList.Automation_Regulator_LuV,
- ItemList.Automation_Regulator_ZPM, ItemList.Automation_Regulator_UV
- };
-
- GregtechItemList[] aOutputInventoryManager = new GregtechItemList[] {
- GregtechItemList.GT4_Electric_Inventory_Manager_LV, GregtechItemList.GT4_Electric_Inventory_Manager_MV, GregtechItemList.GT4_Electric_Inventory_Manager_HV,
- GregtechItemList.GT4_Electric_Inventory_Manager_EV, GregtechItemList.GT4_Electric_Inventory_Manager_IV, GregtechItemList.GT4_Electric_Inventory_Manager_LuV,
- GregtechItemList.GT4_Electric_Inventory_Manager_ZPM, GregtechItemList.GT4_Electric_Inventory_Manager_UV
- };
-
- int aTier = 1;
- for (int i=0;i<8;i++) {
- RecipeUtils.addShapedRecipe(
- CI.getTieredCircuitOreDictName(aTier), aRegulators[i].get(1), CI.getTieredCircuitOreDictName(aTier),
- CI.getRobotArm(aTier, 1), CI.getTieredMachineHull(aTier), CI.getRobotArm(aTier, 1),
- CI.getTieredCircuitOreDictName(aTier), aEnergyHatches[i].get(1), CI.getTieredCircuitOreDictName(aTier),
- aOutputInventoryManager[i].get(1));
- aTier++;
- }
-
- GregtechItemList[] aOutputElectricCraftingTable = new GregtechItemList[] {
- GregtechItemList.GT4_Electric_Auto_Workbench_LV, GregtechItemList.GT4_Electric_Auto_Workbench_MV, GregtechItemList.GT4_Electric_Auto_Workbench_HV,
- GregtechItemList.GT4_Electric_Auto_Workbench_EV, GregtechItemList.GT4_Electric_Auto_Workbench_IV, GregtechItemList.GT4_Electric_Auto_Workbench_LuV,
- GregtechItemList.GT4_Electric_Auto_Workbench_ZPM, GregtechItemList.GT4_Electric_Auto_Workbench_UV
- };
-
- aTier = 1;
- for (int i=0;i<8;i++) {
- RecipeUtils.addShapedRecipe(
- ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1), ItemUtils.getSimpleStack(Blocks.crafting_table), ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1),
- CI.getTieredCircuitOreDictName(aTier), CI.getTieredMachineHull(aTier), CI.getTieredCircuitOreDictName(aTier),
- ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1), CI.getRobotArm(aTier, 1), ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1),
- aOutputElectricCraftingTable[i].get(1));
- aTier++;
- }
-
- }
-
- private static void multiGeneratorArray() {
-
- GT_ModHandler.addCraftingRecipe(
- GregtechItemList.Generator_Array_Controller.get(1L),
- CI.bitsd,
- new Object[]{"CTC", "FMF", "CBC",
- 'M', CI.getTieredGTPPMachineCasing(4, 1),
- 'B', OrePrefixes.pipeHuge.get(Materials.StainlessSteel),
- 'C', OrePrefixes.circuit.get(Materials.Data),
- 'F', ItemList.Electric_Pump_EV,
- 'T', CI.getSensor(4, 1)});
- }
-
- private static void multiForgeHammer() {
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getSimpleStack(CI.machineHull_IV, 2),
- ItemList.Machine_IV_Hammer.get(1),
- CI.getPlate(4, 8),
- CI.getBolt(5, 32),
- ELEMENT.getInstance().ZIRCONIUM.getFineWire(32),
- ItemUtils.getItemStackOfAmountFromOreDict("circuitElite", 4)
- },
- CI.getTieredFluid(4, 144 * 12),
- GregtechItemList.Controller_IndustrialForgeHammer.get(1),
- 20 * 30,
- MaterialUtils.getVoltageForTier(5));
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Casing_IndustrialForgeHammer.get(1),
- CI.bitsd,
- new Object[]{"IBI", "HCH", "IHI",
- 'I', CI.getPlate(4, 1),
- 'B', ALLOY.BABBIT_ALLOY.getPlate(1),
- 'C', ItemList.Casing_HeatProof.get(1),
- 'H', ALLOY.HASTELLOY_X.getRod(1)});
-
- }
-
- private static void multiMolecularTransformer() {
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getTieredGTPPMachineCasing(6, 1),
- CI.getPlate(5, 16),
- CI.getBolt(5, 32),
- ALLOY.HG1223.getFineWire(64),
- CI.getEmitter(4, 8),
- ItemUtils.getItemStackOfAmountFromOreDict("circuitMaster", 10)
- },
- CI.getTieredFluid(5, 144 * 16),
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_11_MOLECULAR_TRANSFORMER, 1),
- 20 * 60,
- MaterialUtils.getVoltageForTier(5));
-
- CORE.RA.addAssemblylineRecipe(
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_11_MOLECULAR_TRANSFORMER, 1),
- 20 * 60 * 30,
- new Object[] {
- ALLOY.HG1223.getFineWire(64),
- ALLOY.HG1223.getFineWire(64),
- ItemList.Electric_Motor_IV.get(GTNH ? 32 : 16),
- ItemList.Energy_LapotronicOrb.get(GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.cableGt12, 6, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.wireGt16, 5, GTNH ? 64 : 32),
- ALLOY.ZERON_100.getFrameBox(4),
- ALLOY.ZIRCONIUM_CARBIDE.getPlateDouble(32),
- ALLOY.BABBIT_ALLOY.getPlate(64),
- ALLOY.LEAGRISIUM.getGear(GTNH ? 16 : 8),
- new Object[] {CI.getTieredCircuitOreDictName(4), 64},
- new Object[] {CI.getTieredCircuitOreDictName(5), 32},
- new Object[] {CI.getTieredCircuitOreDictName(6), 16},
- GregtechItemList.Laser_Lens_WoodsGlass.get(1),
- },
- new FluidStack[] {
- ALLOY.NITINOL_60.getFluidStack(144 * 9 * (GTNH ? 4 : 2)),
- ALLOY.INCOLOY_MA956.getFluidStack(144 * 9 * (GTNH ? 32 : 8)),
- ALLOY.KANTHAL.getFluidStack(144 * 1 * (GTNH ? 16 : 4)),
- },
- GregtechItemList.Controller_MolecularTransformer.get(1),
- 20 * 60 * 10 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(6));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(16),
- CI.getPlate(6, 4),
- CI.getScrew(6, 8),
- ELEMENT.getInstance().PALLADIUM.getFineWire(16),
- CI.getSensor(5, 2),
- ItemUtils.getItemStackOfAmountFromOreDict("circuitElite", 4)
- },
- CI.getTieredFluid(5, 144 * 4),
- GregtechItemList.Casing_Molecular_Transformer_1.get(1),
- 20 * 20,
- MaterialUtils.getVoltageForTier(5));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(16),
- CI.getPlate(5, 4),
- CI.getScrew(5, 8),
- ItemList.Casing_Coil_Nichrome.get(2),
- CI.getFieldGenerator(3, 2),
- ItemUtils.getItemStackOfAmountFromOreDict("circuitData", 8)
- },
- CI.getTieredFluid(5, 144 * 4),
- GregtechItemList.Casing_Molecular_Transformer_2.get(1),
- 20 * 20,
- MaterialUtils.getVoltageForTier(5));
-
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(16),
- ItemUtils.getSimpleStack(Blocks.glowstone, 16),
- CI.getGear(5, 8),
- ELEMENT.getInstance().TITANIUM.getWire04(4),
- CI.getFieldGenerator(4, 2),
- ItemUtils.getItemStackOfAmountFromOreDict("circuitData", 8)
- },
- CI.getTieredFluid(5, 144 * 4),
- GregtechItemList.Casing_Molecular_Transformer_3.get(1),
- 20 * 60,
- MaterialUtils.getVoltageForTier(5));
-
- }
-
- private static void multiXlTurbines() {
-
- RecipeUtils.addShapedRecipe(
- CI.getDoublePlate(4, 1), CI.getElectricMotor(3, 1), CI.getDoublePlate(4, 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellLubricant", 1), ItemList.Casing_Gearbox_Titanium.get(1), ItemUtils.getItemStackOfAmountFromOreDict("cellLubricant", 1),
- CI.getDoublePlate(4, 1), CI.getElectricMotor(3, 1), CI.getDoublePlate(4, 1),
- GregtechItemList.Casing_Turbine_Shaft.get(1));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.Casing_Turbine.get(1),
- CI.getPlate(4, 4),
- CI.getScrew(4, 8),
- CI.getCircuit(4, 4),
- CI.getGear(3, 8)
- },
- CI.tieredMaterials[3].getMolten(144 * 8),
- GregtechItemList.Hatch_Turbine_Rotor.get(1),
- 20 * 60,
- MaterialUtils.getVoltageForTier(4));
-
- // Steam
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.Casing_Turbine.get(1),
- CI.getPlate(3, 4),
- CI.getScrew(3, 8),
- },
- CI.tieredMaterials[2].getMolten(144 * 2),
- GregtechItemList.Casing_Turbine_LP.get(1),
- 20 * 5,
- MaterialUtils.getVoltageForTier(3));
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.LargeSteamTurbine.get(1),
- CI.getPlate(4, 8),
- CI.getScrew(4, 16),
- CI.getGear(4, 4),
- CI.getCircuit(4, 8)
- },
- CI.tieredMaterials[4].getMolten(144 * 8),
- GregtechItemList.Large_Steam_Turbine.get(1),
- 20 * 60,
- MaterialUtils.getVoltageForTier(4));
-
- // Gas
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.Casing_Turbine1.get(1),
- CI.getPlate(4, 4),
- CI.getScrew(4, 8),
- },
- CI.tieredMaterials[3].getMolten(144 * 2),
- GregtechItemList.Casing_Turbine_Gas.get(1),
- 20 * 5,
- MaterialUtils.getVoltageForTier(4));
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.LargeGasTurbine.get(1),
- CI.getPlate(5, 8),
- CI.getScrew(5, 16),
- CI.getGear(5, 4),
- CI.getCircuit(5, 8)
- },
- CI.tieredMaterials[5].getMolten(144 * 8),
- GregtechItemList.Large_Gas_Turbine.get(1),
- 20 * 60,
- MaterialUtils.getVoltageForTier(5));
-
- // HP Steam
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.Casing_Turbine2.get(1),
- CI.getPlate(5, 4),
- CI.getScrew(5, 8),
- },
- CI.tieredMaterials[4].getMolten(144 * 2),
- GregtechItemList.Casing_Turbine_HP.get(1),
- 20 * 5,
- MaterialUtils.getVoltageForTier(5));
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.LargeHPSteamTurbine.get(1),
- CI.getPlate(6, 8),
- CI.getScrew(6, 16),
- CI.getGear(6, 4),
- CI.getCircuit(6, 8)
- },
- CI.tieredMaterials[6].getMolten(144 * 8),
- GregtechItemList.Large_HPSteam_Turbine.get(1),
- 20 * 60,
- MaterialUtils.getVoltageForTier(6));
-
- // Plasma
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.Casing_Turbine3.get(1),
- CI.getPlate(6, 4),
- CI.getScrew(6, 8),
- },
- CI.tieredMaterials[5].getMolten(144 * 2),
- GregtechItemList.Casing_Turbine_Plasma.get(1),
- 20 * 5,
- MaterialUtils.getVoltageForTier(6));
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(18),
- ItemList.LargePlasmaTurbine.get(1),
- CI.getPlate(7, 8),
- CI.getScrew(7, 16),
- CI.getGear(7, 4),
- CI.getCircuit(7, 8)
- },
- CI.tieredMaterials[7].getMolten(144 * 8),
- GregtechItemList.Large_Plasma_Turbine.get(1),
- 20 * 60,
- MaterialUtils.getVoltageForTier(7));
-
-
- }
-
- private static void multiSolarTower() {
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(17),
- CI.getTieredGTPPMachineCasing(3, 4),
- ALLOY.MARAGING250.getPlate(8),
- ALLOY.MARAGING250.getBolt(8),
- ALLOY.MARAGING250.getScrew(8),
- CI.getCircuit(5, 8)
- },
- CI.getTieredFluid(3, 144 * 16),
- GregtechItemList.Industrial_Solar_Tower.get(1),
- 20 * 30,
- MaterialUtils.getVoltageForTier(4));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(17),
- ALLOY.MARAGING350.getFrameBox(1),
- ALLOY.STAINLESS_STEEL.getPlate(4),
- ALLOY.MARAGING350.getScrew(8)
- },
- CI.getTieredFluid(3, 144 * 4),
- GregtechItemList.Casing_SolarTower_Structural.get(1),
- 20 * 30,
- MaterialUtils.getVoltageForTier(3));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(17),
- ALLOY.MARAGING250.getFrameBox(1),
- ALLOY.STAINLESS_STEEL.getPlate(4),
- ALLOY.MARAGING250.getBolt(16),
- ELEMENT.getInstance().ALUMINIUM.getScrew(8)
- },
- CI.getTieredFluid(3, 144 * 4),
- GregtechItemList.Casing_SolarTower_SaltContainment.get(1),
- 20 * 30,
- MaterialUtils.getVoltageForTier(3));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(17),
- ALLOY.MARAGING250.getFrameBox(1),
- ALLOY.STEEL_BLACK.getPlate(4),
- ALLOY.MARAGING250.getScrew(8)
- },
- CI.getAlternativeTieredFluid(3, 144 * 4),
- GregtechItemList.Casing_SolarTower_HeatContainment.get(1),
- 20 * 30,
- MaterialUtils.getVoltageForTier(3));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(17),
- CI.getTieredGTPPMachineCasing(2, 1),
- CI.getPlate(3, 2),
- CI.getGear(3, 4),
- CI.getElectricMotor(3, 2),
- CI.getCircuit(3, 4)
-
- },
- CI.getTertiaryTieredFluid(3, 144 * 4),
- GregtechItemList.Solar_Tower_Reflector.get(1),
- 20 * 60,
- MaterialUtils.getVoltageForTier(3));
-
- }
-
- private static void multiElementalDuplicator() {
-
- CORE.RA.addAssemblylineRecipe(
- ItemList.Machine_IV_Replicator.get(1),
- 20 * 60 * 60 * 12,
- new Object[] {
- CI.getTieredMachineHull(7, 4),
- CI.getFieldGenerator(5, GTNH ? 32 : 16),
- CI.getElectricMotor(7, GTNH ? 32 : 16),
- CI.getElectricPiston(7, GTNH ? 16 : 4),
- CI.getEnergyCore(6, GTNH ? 8 : 2),
- CI.getPlate(7, GTNH ? 32 : 16),
- CI.getScrew(7, GTNH ? 64 : 32),
- CI.getBolt(6, GTNH ? 64 : 32),
- CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 20 : 10),
- new Object[] {CI.getTieredCircuitOreDictName(7), 20},
- ItemList.Tool_DataOrb.get(32),
- GregtechItemList.Laser_Lens_Special.get(1)
- },
- new FluidStack[] {
- CI.getTieredFluid(7, 144 * 32),
- CI.getAlternativeTieredFluid(6, 144 * 16),
- CI.getTertiaryTieredFluid(6, 144 * 16),
- ALLOY.BABBIT_ALLOY.getFluidStack(128 * 144),
-
- },
- GregtechItemList.Controller_ElementalDuplicator.get(1),
- 20 * 60 * 60 * (GTNH ? 2 : 1),
- (int) MaterialUtils.getVoltageForTier(7));
-
- CORE.RA.addAssemblylineRecipe(
- GregtechItemList.Modulator_III.get(1),
- 20 * 60 * 60 * 4,
- new Object[] {
- CI.getTieredGTPPMachineCasing(7, 2),
- CI.getFieldGenerator(4, GTNH ? 8 : 4),
- CI.getEnergyCore(4, GTNH ? 8 : 2),
- CI.getPlate(7, GTNH ? 16 : 8),
- CI.getScrew(6, GTNH ? 32 : 16),
- CI.getBolt(6, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.rod, 5, GTNH ? 32 : 16),
- new Object[] {CI.getTieredCircuitOreDictName(6), 32},
- ItemList.Tool_DataOrb.get(32),
- },
- new FluidStack[] {
- CI.getTieredFluid(6, 144 * 16),
- CI.getAlternativeTieredFluid(5, 144 * 8),
- CI.getTertiaryTieredFluid(5, 144 * 8),
- ALLOY.BABBIT_ALLOY.getFluidStack(64 * 144),
-
- },
- GregtechItemList.Hatch_Input_Elemental_Duplicator.get(1),
- 20 * 60 * 60 * (GTNH ? 4 : 2),
- (int) MaterialUtils.getVoltageForTier(6));
-
- CORE.RA.addAssemblylineRecipe(
- GregtechItemList.ResonanceChamber_III.get(1),
- 20 * 60 * 60 * 2,
- new Object[] {
- CI.getTieredMachineHull(6, 5),
- CI.getFieldGenerator(3, GTNH ? 32 : 16),
- CI.getEnergyCore(2, GTNH ? 8 : 2),
- CI.getPlate(7, GTNH ? 8 : 4),
- CI.getScrew(7, GTNH ? 8 : 4),
- CI.getBolt(6, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.rod, 5, GTNH ? 8 : 4),
- new Object[] {CI.getTieredCircuitOreDictName(5), 4},
- ItemList.Tool_DataStick.get(4),
- },
- new FluidStack[] {
- CI.getTieredFluid(5, 144 * 16),
- CI.getAlternativeTieredFluid(4, 144 * 8),
- CI.getTertiaryTieredFluid(4, 144 * 8),
- ALLOY.BABBIT_ALLOY.getFluidStack(16 * 144),
-
- },
- GregtechItemList.Casing_ElementalDuplicator.get(1),
- 20 * 60 * (GTNH ? 20 : 10),
- (int) MaterialUtils.getVoltageForTier(6));
-
- }
-
- private static void resonanceChambers() {
- int aFieldTier = 1;
- int aCasingTier = 4;
- for (int i = 0; i < 4; i++) {
- RecipeUtils.addShapedRecipe(
- CI.getDoublePlate(aCasingTier, 1), CI.getFieldGenerator(aFieldTier, 1), CI.getDoublePlate(aCasingTier, 1),
- CI.getFieldGenerator(aFieldTier, 1), CI.getTieredMachineCasing(aCasingTier), CI.getFieldGenerator(aFieldTier, 1),
- CI.getDoublePlate(aCasingTier, 1), CI.getFieldGenerator(aFieldTier, 1), CI.getDoublePlate(aCasingTier, 1),
- ItemUtils.simpleMetaStack(ModBlocks.blockSpecialMultiCasings2, i, 1));
- aCasingTier++;
- aFieldTier++;
- }
- }
-
- private static void modulators() {
- int aCasingTier = 4;
- for (int i = 4; i < 8; i++) {
- RecipeUtils.addShapedRecipe(
- CI.getTieredCircuitOreDictName(aCasingTier), CI.getPlate(aCasingTier, 1), CI.getTieredCircuitOreDictName(aCasingTier),
- CI.getPlate(aCasingTier, 1), CI.getTieredMachineCasing(aCasingTier), CI.getPlate(aCasingTier, 1),
- CI.getTieredCircuitOreDictName(aCasingTier), CI.getPlate(aCasingTier, 1), CI.getTieredCircuitOreDictName(aCasingTier),
- ItemUtils.simpleMetaStack(ModBlocks.blockSpecialMultiCasings2, i, 1));
- aCasingTier++;
- }
- }
-
- private static void zyngen() {
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(6),
- CI.getTieredMachineHull(4),
- ItemList.Machine_IV_AlloySmelter.get(1),
- CI.getGear(3, 16),
- CI.getBolt(3, 64),
- CI.getPlate(4, 16)
- },
- CI.getAlternativeTieredFluid(4, 144 * 8),
- GregtechItemList.Industrial_AlloySmelter.get(1),
- 20 * 30,
- MaterialUtils.getVoltageForTier(4));
-
- }
-
- private static void chemPlant() {
-
+ // Outputs
+ // static ItemStack RECIPE_BufferCore_ULV = new ItemStack(GregtechEnergyBuffer.itemBufferCore);
+ public static ItemStack RECIPE_SteamCondenser;
+ public static ItemStack RECIPE_IronBlastFurnace;
+ public static ItemStack RECIPE_IronPlatedBricks;
+ public static ItemStack RECIPE_Buffer_ULV = GregtechItemList.Energy_Buffer_1by1_ULV.get(1);
+ public static ItemStack RECIPE_Buffer_LV = GregtechItemList.Energy_Buffer_1by1_LV.get(1);
+ public static ItemStack RECIPE_Buffer_MV = GregtechItemList.Energy_Buffer_1by1_MV.get(1);
+ public static ItemStack RECIPE_Buffer_HV = GregtechItemList.Energy_Buffer_1by1_HV.get(1);
+ public static ItemStack RECIPE_Buffer_EV = GregtechItemList.Energy_Buffer_1by1_EV.get(1);
+ public static ItemStack RECIPE_Buffer_IV = GregtechItemList.Energy_Buffer_1by1_IV.get(1);
+ public static ItemStack RECIPE_Buffer_LuV = GregtechItemList.Energy_Buffer_1by1_LuV.get(1);
+ public static ItemStack RECIPE_Buffer_ZPM = GregtechItemList.Energy_Buffer_1by1_ZPM.get(1);
+ public static ItemStack RECIPE_Buffer_UV = GregtechItemList.Energy_Buffer_1by1_UV.get(1);
+ public static ItemStack RECIPE_Buffer_MAX = GregtechItemList.Energy_Buffer_1by1_MAX.get(1);
+ // Industrial Centrifuge
+ public static ItemStack RECIPE_IndustrialCentrifugeController;
+ public static ItemStack RECIPE_IndustrialCentrifugeCasing;
+ // Industrial Coke Oven
+ public static ItemStack RECIPE_IndustrialCokeOvenController;
+ public static ItemStack RECIPE_IndustrialCokeOvenFrame;
+ public static ItemStack RECIPE_IndustrialCokeOvenCasingA;
+ public static ItemStack RECIPE_IndustrialCokeOvenCasingB;
+ // Industrial Electrolyzer
+ public static ItemStack RECIPE_IndustrialElectrolyzerController;
+ public static ItemStack RECIPE_IndustrialElectrolyzerFrame;
+ // Industrial Material Press
+ public static ItemStack RECIPE_IndustrialMaterialPressController;
+ public static ItemStack RECIPE_IndustrialMaterialPressFrame;
+ // Industrial Maceration Stack
+ public static ItemStack RECIPE_IndustrialMacerationStackController;
+ public static ItemStack RECIPE_IndustrialMacerationStackFrame;
+ // Industrial Wire Factory
+ public static ItemStack RECIPE_IndustrialWireFactoryController;
+ public static ItemStack RECIPE_IndustrialWireFactoryFrame;
+ // Industrial Multi Tank
+ public static ItemStack RECIPE_IndustrialMultiTankController;
+ public static ItemStack RECIPE_IndustrialMultiTankFrame;
+ // Industrial Matter Fabricator
+ public static ItemStack RECIPE_IndustrialMatterFabController;
+ public static ItemStack RECIPE_IndustrialMatterFabFrame;
+ public static ItemStack RECIPE_IndustrialMatterFabCoil;
+ // Industrial Blast Smelter
+ public static ItemStack RECIPE_IndustrialBlastSmelterController;
+ public static ItemStack RECIPE_IndustrialBlastSmelterFrame;
+ public static ItemStack RECIPE_IndustrialBlastSmelterCoil;
+ // Industrial Sieve
+ public static ItemStack RECIPE_IndustrialSieveController;
+ public static ItemStack RECIPE_IndustrialSieveFrame;
+ public static ItemStack RECIPE_IndustrialSieveGrate;
+ // Industrial Tree Farmer
+ public static ItemStack RECIPE_TreeFarmController;
+ public static ItemStack RECIPE_TreeFarmFrame;
+ // Tesseracts
+ public static ItemStack RECIPE_TesseractGenerator;
+ public static ItemStack RECIPE_TesseractTerminal;
+ // Thermal Boiler
+ public static ItemStack RECIPE_ThermalBoilerController;
+ public static ItemStack RECIPE_ThermalBoilerCasing;
+
+ // Thorium Reactor
+ public static ItemStack RECIPE_LFTRController;
+ public static ItemStack RECIPE_LFTROuterCasing;
+ public static ItemStack RECIPE_LFTRInnerCasing;
+
+ // Milling
+ public static ItemStack RECIPE_ISAMill_Controller;
+ public static ItemStack RECIPE_ISAMill_Gearbox;
+ public static ItemStack RECIPE_ISAMill_Casing;
+ public static ItemStack RECIPE_ISAMill_Hatch;
+ public static ItemStack RECIPE_Flotation_Controller;
+ public static ItemStack RECIPE_Flotation_Casing;
+
+ // Cyclotron
+ public static ItemStack RECIPE_CyclotronController;
+ public static ItemStack RECIPE_CyclotronOuterCasing;
+ public static ItemStack RECIPE_CyclotronInnerCoil;
+
+ // Buffer Cores
+ public static ItemStack RECIPE_BufferCore_ULV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore1", 1);
+ public static ItemStack RECIPE_BufferCore_LV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore2", 1);
+ public static ItemStack RECIPE_BufferCore_MV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore3", 1);
+ public static ItemStack RECIPE_BufferCore_HV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore4", 1);
+ public static ItemStack RECIPE_BufferCore_EV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore5", 1);
+ public static ItemStack RECIPE_BufferCore_IV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore6", 1);
+ public static ItemStack RECIPE_BufferCore_LuV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore7", 1);
+ public static ItemStack RECIPE_BufferCore_ZPM = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore8", 1);
+ public static ItemStack RECIPE_BufferCore_UV = ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore9", 1);
+ public static ItemStack RECIPE_BufferCore_MAX =
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore10", 1);
+
+ // Wire
+ public static String wireTier1 = "wireGt08Lead";
+ public static String wireTier2 = "wireGt08Tin";
+ public static String wireTier3 = "wireGt08Copper";
+ public static String wireTier4 = "wireGt08Gold";
+ public static String wireTier5 = "wireGt08Aluminium";
+ public static String wireTier6 = "wireGt08Tungsten";
+ public static String wireTier7 = "wireGt08Naquadah";
+ public static String wireTier8 = "wireGt08Osmium";
+ public static String wireTier9 = "wireGt08Superconductor";
+ public static String wireTier10 = "wireGt16Superconductor";
+
+ // Wire
+ public static String cableTier1 = "cableGt04Lead";
+ public static String cableTier2 = "cableGt04Tin";
+ public static String cableTier3 = "cableGt04Copper";
+ public static String cableTier4 = "cableGt04Gold";
+ public static String cableTier5 = "cableGt04Aluminium";
+ public static String cableTier6 = "cableGt04Tungsten";
+ public static String cableTier7 = "cableGt04Naquadah";
+ public static String cableTier8 = "cableGt04Osmium";
+ public static String cableTier9 = "cableGt04NiobiumTitanium";
+ public static String cableTier10 = "cableGt08NiobiumTitanium";
+
+ public static String pipeTier1 = "pipeHuge" + "Clay";
+ public static String pipeTier2 = "pipeHuge" + "Potin";
+ public static String pipeTier3 = "pipeHuge" + "Steel";
+ public static String pipeTier4 = "pipeHuge" + "StainlessSteel";
+ public static String pipeTier5 = "pipeHuge" + "TungstenSteel";
+ public static String pipeTier6 = "pipeHuge" + "MaragingSteel300";
+ public static String pipeTier7 = "pipeHuge" + "Tantalloy60";
+ public static String pipeTier8 = "pipeHuge" + "Tantalloy61";
+ public static String pipeTier9 = "pipeHuge" + "Inconel792";
+ public static String pipeTier10 = "pipeHuge" + "HastelloyX";
+ public static String pipeTier11 = "pipeHuge" + "Europium";
+
+ // EV/IV MACHINES
+ public static ItemStack EV_MACHINE_Electrolyzer;
+ public static ItemStack EV_MACHINE_Centrifuge;
+ public static ItemStack EV_MACHINE_BendingMachine;
+ public static ItemStack EV_MACHINE_Wiremill;
+ public static ItemStack HV_MACHINE_Macerator;
+ public static ItemStack EV_MACHINE_Macerator;
+ public static ItemStack EV_MACHINE_Cutter;
+ public static ItemStack EV_MACHINE_MassFabricator;
+ public static ItemStack EV_MACHINE_Extruder;
+ public static ItemStack EV_MACHINE_Sifter;
+ public static ItemStack EV_MACHINE_ThermalCentrifuge;
+ public static ItemStack EV_MACHINE_OreWasher;
+ public static ItemStack EV_MACHINE_AlloySmelter;
+ public static ItemStack EV_MACHINE_Mixer;
+
+ // Cables
+ public static String cableGt02Electrum = "cableGt02Electrum";
+
+ // Plates
+ public static String plateElectricalSteel = "plateElectricalSteel";
+ public static String plateEnergeticAlloy = "plateEnergeticAlloy";
+ public static String plateCobalt = "plateCobalt";
+ public static String plateBronze = "plateBronze";
+ public static String plateSteel = "plateSteel";
+
+ // Pipes
+ public static String pipeLargeCopper = "pipeLargeCopper";
+ public static String pipeHugeSteel = "pipeHugeSteel";
+ public static String pipeHugeStainlessSteel = "pipeHugeStainlessSteel";
+ public static String pipeHugeTitanium = "pipeHugeTitanium";
+
+ // Lava Boiler
+ public static ItemStack boiler_Coal;
+ public static ItemStack blockBricks = ItemUtils.getItemStackFromFQRN("minecraft:brick_block", 1);
+
+ // Batteries
+ public static String batteryBasic = "batteryBasic";
+ public static String batteryAdvanced = "batteryAdvanced";
+ public static String batteryElite = "batteryElite";
+ public static String batteryMaster = "batteryMaster";
+ public static String batteryUltimate = "batteryUltimate";
+ public static ItemStack IC2MFE;
+ public static ItemStack IC2MFSU;
+
+ // Misc
+ public static ItemStack INPUT_RCCokeOvenBlock;
+ public static ItemStack INPUT_IECokeOvenBlock;
+
+ // Output Determiner
+ public static int Casing_Amount;
+
+ public static final void loadRecipes() {
+ run();
+ Logger.INFO("Loading Recipes for the Various machine blocks.");
+ }
+
+ private static void run() {
+
+ // Determines Casing Recipe Output
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !GTNH) {
+ Casing_Amount = 2;
+ } else {
+ Casing_Amount = 1;
+ }
+
+ initModItems();
+ tieredMachineHulls();
+ controlCores();
+ energyCores();
+ wirelessChargers();
+ largeArcFurnace();
+ industrialVacuumFurnace();
+ fakeMachineCasingCovers();
+ ztonesCoverRecipes();
+ overflowValveCovers();
+ superBuses();
+ roundRobinators();
+ chunkloaders();
+ distillus();
+ algaeFarm();
+ chemPlant();
+ zyngen();
+ milling();
+ sparging();
+ chisels();
+ rockBreaker();
+ thermicFluidHeater();
+ advHeatExchanger();
+
+ gt4FarmManager();
+ gt4Redstone();
+ gt4Inventory();
+
+ // multiGeneratorArray();
+ multiForgeHammer();
+ multiMolecularTransformer();
+ multiXlTurbines();
+ multiSolarTower();
+ multiElementalDuplicator();
+
+ computerCube();
+
+ resonanceChambers();
+ modulators();
+ }
+
+ private static void thermicFluidHeater() {
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getPlate(5, 1),
+ CI.circuitTier5,
+ CI.getPlate(5, 1),
+ pipeTier7,
+ ItemList.Machine_IV_FluidHeater.get(1),
+ pipeTier7,
+ CI.getPlate(5, 1),
+ CI.circuitTier4,
+ CI.getPlate(5, 1),
+ GregtechItemList.Controller_IndustrialFluidHeater.get(1));
+ }
+
+ private static void advHeatExchanger() {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.Machine_Multi_HeatExchanger.get(1),
+ CI.getDoublePlate(6, 8),
+ CI.getScrew(6, 16),
+ CI.getCircuit(5, 8)
+ },
+ CI.tieredMaterials[5].getMolten(144 * 8),
+ GregtechItemList.XL_HeatExchanger.get(1),
+ 20 * 60,
+ MaterialUtils.getVoltageForTier(6));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.Casing_StableTitanium.get(1),
+ CI.getPlate(5, 4),
+ CI.getScrew(5, 8),
+ },
+ CI.tieredMaterials[5].getMolten(144 * 2),
+ GregtechItemList.Casing_XL_HeatExchanger.get(1),
+ 20 * 5,
+ MaterialUtils.getVoltageForTier(6));
+ }
+
+ private static void computerCube() {
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(20),
+ CI.getTieredGTPPMachineCasing(4, 1),
+ CI.getCircuit(4, 8),
+ CI.getFieldGenerator(2, 4),
+ CI.getDoublePlate(4, 8),
+ CI.getRobotArm(4, 8)
+ },
+ Materials.Redstone.getMolten(144 * 32),
+ GregtechItemList.Gregtech_Computer_Cube_Machine.get(1),
+ 20 * 60 * 10,
+ MaterialUtils.getVoltageForTier(4));
+ }
+
+ private static void gt4FarmManager() {
+
+ ItemList[] aInputHatches = new ItemList[] {
+ ItemList.Hatch_Input_LV, ItemList.Hatch_Input_MV, ItemList.Hatch_Input_HV,
+ ItemList.Hatch_Input_EV, ItemList.Hatch_Input_IV, ItemList.Hatch_Input_LuV,
+ ItemList.Hatch_Input_ZPM, ItemList.Hatch_Input_UV
+ };
+ GregtechItemList[] aOutputMachines = new GregtechItemList[] {
+ GregtechItemList.GT4_Crop_Harvester_LV, GregtechItemList.GT4_Crop_Harvester_MV,
+ GregtechItemList.GT4_Crop_Harvester_HV,
+ GregtechItemList.GT4_Crop_Harvester_EV, GregtechItemList.GT4_Crop_Harvester_IV,
+ GregtechItemList.GT4_Crop_Harvester_LuV,
+ GregtechItemList.GT4_Crop_Harvester_ZPM, GregtechItemList.GT4_Crop_Harvester_UV
+ };
+
+ int aTier = 1;
+ for (int i = 0; i < 8; i++) {
+ RecipeUtils.addShapedRecipe(
+ CI.getRobotArm(aTier, 1),
+ CI.getSensor(aTier, 1),
+ CI.getRobotArm(aTier, 1),
+ ItemUtils.getOrePrefixStack(OrePrefixes.toolHeadSense, CI.tieredMaterials[aTier], 1),
+ CI.getTieredMachineHull(aTier, 1),
+ ItemUtils.getOrePrefixStack(OrePrefixes.toolHeadSense, CI.tieredMaterials[aTier], 1),
+ CI.getTieredCircuitOreDictName(aTier),
+ aInputHatches[i].get(1),
+ CI.getTieredCircuitOreDictName(aTier),
+ aOutputMachines[i].get(1));
+ aTier++;
+ }
+ }
+
+ private static void gt4Redstone() {
+
+ RecipeUtils.addShapedRecipe(
+ "plateIron",
+ "plateGlass",
+ "plateIron",
+ "plateGlass",
+ ItemUtils.getSimpleStack(Blocks.redstone_lamp),
+ "plateGlass",
+ "plateIron",
+ "plateGlass",
+ "plateIron",
+ GregtechItemList.GT4_Redstone_Lamp.get(2));
+ RecipeUtils.addShapedRecipe(
+ "plateAluminium",
+ "plateGlass",
+ "plateAluminium",
+ "plateGlass",
+ ItemUtils.getSimpleStack(Blocks.redstone_lamp),
+ "plateGlass",
+ "plateAluminium",
+ "plateGlass",
+ "plateAluminium",
+ GregtechItemList.GT4_Redstone_Lamp.get(8));
+
+ RecipeUtils.addShapedRecipe(
+ "plateIron",
+ "plateIron",
+ "plateIron",
+ ItemUtils.getSimpleStack(Items.comparator),
+ ItemList.Cover_Screen.get(1),
+ ItemUtils.getSimpleStack(Items.comparator),
+ "plateIron",
+ "plateIron",
+ "plateIron",
+ GregtechItemList.GT4_Redstone_Display.get(2));
+ RecipeUtils.addShapedRecipe(
+ "plateAluminium",
+ "plateAluminium",
+ "plateAluminium",
+ ItemUtils.getSimpleStack(Items.comparator),
+ ItemList.Cover_Screen.get(1),
+ ItemUtils.getSimpleStack(Items.comparator),
+ "plateAluminium",
+ "plateAluminium",
+ "plateAluminium",
+ GregtechItemList.GT4_Redstone_Display.get(8));
+
+ RecipeUtils.addShapedRecipe(
+ "plateIron",
+ "plateIron",
+ "plateIron",
+ ItemUtils.getSimpleStack(Items.comparator),
+ ItemList.Cover_EnergyDetector.get(1),
+ ItemUtils.getSimpleStack(Items.comparator),
+ "plateIron",
+ "plateIron",
+ "plateIron",
+ GregtechItemList.GT4_Redstone_Scale.get(2));
+ RecipeUtils.addShapedRecipe(
+ "plateAluminium",
+ "plateAluminium",
+ "plateAluminium",
+ ItemUtils.getSimpleStack(Items.comparator),
+ ItemList.Cover_EnergyDetector.get(1),
+ ItemUtils.getSimpleStack(Items.comparator),
+ "plateAluminium",
+ "plateAluminium",
+ "plateAluminium",
+ GregtechItemList.GT4_Redstone_Scale.get(8));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {CI.getTieredMachineHull(1), ItemUtils.getSimpleStack(Blocks.stone_button, 16)},
+ null,
+ GregtechItemList.GT4_Redstone_Button_Panel.get(1),
+ 800,
+ 4);
+
+ RecipeUtils.addShapedRecipe(
+ "plateIron",
+ ItemUtils.getSimpleStack(Items.repeater),
+ "plateIron",
+ ItemUtils.getSimpleStack(Items.comparator),
+ CI.getTieredCircuitOreDictName(1),
+ ItemUtils.getSimpleStack(Items.comparator),
+ "plateIron",
+ ItemUtils.getSimpleStack(Items.repeater),
+ "plateIron",
+ GregtechItemList.GT4_Redstone_Circuit.get(1));
+ RecipeUtils.addShapedRecipe(
+ "plateAluminium",
+ ItemUtils.getSimpleStack(Items.repeater),
+ "plateAluminium",
+ ItemUtils.getSimpleStack(Items.comparator),
+ CI.getTieredCircuitOreDictName(1),
+ ItemUtils.getSimpleStack(Items.comparator),
+ "plateAluminium",
+ ItemUtils.getSimpleStack(Items.repeater),
+ "plateAluminium",
+ GregtechItemList.GT4_Redstone_Circuit.get(2));
+ }
+
+ private static void gt4Inventory() {
+
+ ItemList[] aEnergyHatches = new ItemList[] {
+ ItemList.Hatch_Energy_LV, ItemList.Hatch_Energy_MV, ItemList.Hatch_Energy_HV,
+ ItemList.Hatch_Energy_EV, ItemList.Hatch_Energy_IV, ItemList.Hatch_Energy_LuV,
+ ItemList.Hatch_Energy_ZPM, ItemList.Hatch_Energy_UV
+ };
+
+ ItemList[] aRegulators = new ItemList[] {
+ ItemList.Automation_Regulator_LV, ItemList.Automation_Regulator_MV, ItemList.Automation_Regulator_HV,
+ ItemList.Automation_Regulator_EV, ItemList.Automation_Regulator_IV, ItemList.Automation_Regulator_LuV,
+ ItemList.Automation_Regulator_ZPM, ItemList.Automation_Regulator_UV
+ };
+
+ GregtechItemList[] aOutputInventoryManager = new GregtechItemList[] {
+ GregtechItemList.GT4_Electric_Inventory_Manager_LV, GregtechItemList.GT4_Electric_Inventory_Manager_MV,
+ GregtechItemList.GT4_Electric_Inventory_Manager_HV,
+ GregtechItemList.GT4_Electric_Inventory_Manager_EV, GregtechItemList.GT4_Electric_Inventory_Manager_IV,
+ GregtechItemList.GT4_Electric_Inventory_Manager_LuV,
+ GregtechItemList.GT4_Electric_Inventory_Manager_ZPM, GregtechItemList.GT4_Electric_Inventory_Manager_UV
+ };
+
+ int aTier = 1;
+ for (int i = 0; i < 8; i++) {
+ RecipeUtils.addShapedRecipe(
+ CI.getTieredCircuitOreDictName(aTier),
+ aRegulators[i].get(1),
+ CI.getTieredCircuitOreDictName(aTier),
+ CI.getRobotArm(aTier, 1),
+ CI.getTieredMachineHull(aTier),
+ CI.getRobotArm(aTier, 1),
+ CI.getTieredCircuitOreDictName(aTier),
+ aEnergyHatches[i].get(1),
+ CI.getTieredCircuitOreDictName(aTier),
+ aOutputInventoryManager[i].get(1));
+ aTier++;
+ }
+
+ GregtechItemList[] aOutputElectricCraftingTable = new GregtechItemList[] {
+ GregtechItemList.GT4_Electric_Auto_Workbench_LV, GregtechItemList.GT4_Electric_Auto_Workbench_MV,
+ GregtechItemList.GT4_Electric_Auto_Workbench_HV,
+ GregtechItemList.GT4_Electric_Auto_Workbench_EV, GregtechItemList.GT4_Electric_Auto_Workbench_IV,
+ GregtechItemList.GT4_Electric_Auto_Workbench_LuV,
+ GregtechItemList.GT4_Electric_Auto_Workbench_ZPM, GregtechItemList.GT4_Electric_Auto_Workbench_UV
+ };
+
+ aTier = 1;
+ for (int i = 0; i < 8; i++) {
+ RecipeUtils.addShapedRecipe(
+ ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1),
+ ItemUtils.getSimpleStack(Blocks.crafting_table),
+ ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1),
+ CI.getTieredCircuitOreDictName(aTier),
+ CI.getTieredMachineHull(aTier),
+ CI.getTieredCircuitOreDictName(aTier),
+ ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1),
+ CI.getRobotArm(aTier, 1),
+ ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1),
+ aOutputElectricCraftingTable[i].get(1));
+ aTier++;
+ }
+ }
+
+ private static void multiGeneratorArray() {
+
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Array_Controller.get(1L), CI.bitsd, new Object[] {
+ "CTC",
+ "FMF",
+ "CBC",
+ 'M',
+ CI.getTieredGTPPMachineCasing(4, 1),
+ 'B',
+ OrePrefixes.pipeHuge.get(Materials.StainlessSteel),
+ 'C',
+ OrePrefixes.circuit.get(Materials.Data),
+ 'F',
+ ItemList.Electric_Pump_EV,
+ 'T',
+ CI.getSensor(4, 1)
+ });
+ }
+
+ private static void multiForgeHammer() {
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(CI.machineHull_IV, 2),
+ ItemList.Machine_IV_Hammer.get(1),
+ CI.getPlate(4, 8),
+ CI.getBolt(5, 32),
+ ELEMENT.getInstance().ZIRCONIUM.getFineWire(32),
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitElite", 4)
+ },
+ CI.getTieredFluid(4, 144 * 12),
+ GregtechItemList.Controller_IndustrialForgeHammer.get(1),
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(5));
+
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Casing_IndustrialForgeHammer.get(1), CI.bitsd, new Object[] {
+ "IBI",
+ "HCH",
+ "IHI",
+ 'I',
+ CI.getPlate(4, 1),
+ 'B',
+ ALLOY.BABBIT_ALLOY.getPlate(1),
+ 'C',
+ ItemList.Casing_HeatProof.get(1),
+ 'H',
+ ALLOY.HASTELLOY_X.getRod(1)
+ });
+ }
+
+ private static void multiMolecularTransformer() {
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getTieredGTPPMachineCasing(6, 1),
+ CI.getPlate(5, 16),
+ CI.getBolt(5, 32),
+ ALLOY.HG1223.getFineWire(64),
+ CI.getEmitter(4, 8),
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitMaster", 10)
+ },
+ CI.getTieredFluid(5, 144 * 16),
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_11_MOLECULAR_TRANSFORMER, 1),
+ 20 * 60,
+ MaterialUtils.getVoltageForTier(5));
+
+ CORE.RA.addAssemblylineRecipe(
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_11_MOLECULAR_TRANSFORMER, 1),
+ 20 * 60 * 30,
+ new Object[] {
+ ALLOY.HG1223.getFineWire(64),
+ ALLOY.HG1223.getFineWire(64),
+ ItemList.Electric_Motor_IV.get(GTNH ? 32 : 16),
+ ItemList.Energy_LapotronicOrb.get(GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.cableGt12, 6, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.wireGt16, 5, GTNH ? 64 : 32),
+ ALLOY.ZERON_100.getFrameBox(4),
+ ALLOY.ZIRCONIUM_CARBIDE.getPlateDouble(32),
+ ALLOY.BABBIT_ALLOY.getPlate(64),
+ ALLOY.LEAGRISIUM.getGear(GTNH ? 16 : 8),
+ new Object[] {CI.getTieredCircuitOreDictName(4), 64},
+ new Object[] {CI.getTieredCircuitOreDictName(5), 32},
+ new Object[] {CI.getTieredCircuitOreDictName(6), 16},
+ GregtechItemList.Laser_Lens_WoodsGlass.get(1),
+ },
+ new FluidStack[] {
+ ALLOY.NITINOL_60.getFluidStack(144 * 9 * (GTNH ? 4 : 2)),
+ ALLOY.INCOLOY_MA956.getFluidStack(144 * 9 * (GTNH ? 32 : 8)),
+ ALLOY.KANTHAL.getFluidStack(144 * 1 * (GTNH ? 16 : 4)),
+ },
+ GregtechItemList.Controller_MolecularTransformer.get(1),
+ 20 * 60 * 10 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(6));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(16),
+ CI.getPlate(6, 4),
+ CI.getScrew(6, 8),
+ ELEMENT.getInstance().PALLADIUM.getFineWire(16),
+ CI.getSensor(5, 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitElite", 4)
+ },
+ CI.getTieredFluid(5, 144 * 4),
+ GregtechItemList.Casing_Molecular_Transformer_1.get(1),
+ 20 * 20,
+ MaterialUtils.getVoltageForTier(5));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(16),
+ CI.getPlate(5, 4),
+ CI.getScrew(5, 8),
+ ItemList.Casing_Coil_Nichrome.get(2),
+ CI.getFieldGenerator(3, 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitData", 8)
+ },
+ CI.getTieredFluid(5, 144 * 4),
+ GregtechItemList.Casing_Molecular_Transformer_2.get(1),
+ 20 * 20,
+ MaterialUtils.getVoltageForTier(5));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(16),
+ ItemUtils.getSimpleStack(Blocks.glowstone, 16),
+ CI.getGear(5, 8),
+ ELEMENT.getInstance().TITANIUM.getWire04(4),
+ CI.getFieldGenerator(4, 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitData", 8)
+ },
+ CI.getTieredFluid(5, 144 * 4),
+ GregtechItemList.Casing_Molecular_Transformer_3.get(1),
+ 20 * 60,
+ MaterialUtils.getVoltageForTier(5));
+ }
+
+ private static void multiXlTurbines() {
+
+ RecipeUtils.addShapedRecipe(
+ CI.getDoublePlate(4, 1),
+ CI.getElectricMotor(3, 1),
+ CI.getDoublePlate(4, 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellLubricant", 1),
+ ItemList.Casing_Gearbox_Titanium.get(1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellLubricant", 1),
+ CI.getDoublePlate(4, 1),
+ CI.getElectricMotor(3, 1),
+ CI.getDoublePlate(4, 1),
+ GregtechItemList.Casing_Turbine_Shaft.get(1));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.Casing_Turbine.get(1),
+ CI.getPlate(4, 4),
+ CI.getScrew(4, 8),
+ CI.getCircuit(4, 4),
+ CI.getGear(3, 8)
+ },
+ CI.tieredMaterials[3].getMolten(144 * 8),
+ GregtechItemList.Hatch_Turbine_Rotor.get(1),
+ 20 * 60,
+ MaterialUtils.getVoltageForTier(4));
+
+ // Steam
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.Casing_Turbine.get(1),
+ CI.getPlate(3, 4),
+ CI.getScrew(3, 8),
+ },
+ CI.tieredMaterials[2].getMolten(144 * 2),
+ GregtechItemList.Casing_Turbine_LP.get(1),
+ 20 * 5,
+ MaterialUtils.getVoltageForTier(3));
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.LargeSteamTurbine.get(1),
+ CI.getPlate(4, 8),
+ CI.getScrew(4, 16),
+ CI.getGear(4, 4),
+ CI.getCircuit(4, 8)
+ },
+ CI.tieredMaterials[4].getMolten(144 * 8),
+ GregtechItemList.Large_Steam_Turbine.get(1),
+ 20 * 60,
+ MaterialUtils.getVoltageForTier(4));
+
+ // Gas
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.Casing_Turbine1.get(1),
+ CI.getPlate(4, 4),
+ CI.getScrew(4, 8),
+ },
+ CI.tieredMaterials[3].getMolten(144 * 2),
+ GregtechItemList.Casing_Turbine_Gas.get(1),
+ 20 * 5,
+ MaterialUtils.getVoltageForTier(4));
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.LargeGasTurbine.get(1),
+ CI.getPlate(5, 8),
+ CI.getScrew(5, 16),
+ CI.getGear(5, 4),
+ CI.getCircuit(5, 8)
+ },
+ CI.tieredMaterials[5].getMolten(144 * 8),
+ GregtechItemList.Large_Gas_Turbine.get(1),
+ 20 * 60,
+ MaterialUtils.getVoltageForTier(5));
+
+ // HP Steam
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.Casing_Turbine2.get(1),
+ CI.getPlate(5, 4),
+ CI.getScrew(5, 8),
+ },
+ CI.tieredMaterials[4].getMolten(144 * 2),
+ GregtechItemList.Casing_Turbine_HP.get(1),
+ 20 * 5,
+ MaterialUtils.getVoltageForTier(5));
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.LargeHPSteamTurbine.get(1),
+ CI.getPlate(6, 8),
+ CI.getScrew(6, 16),
+ CI.getGear(6, 4),
+ CI.getCircuit(6, 8)
+ },
+ CI.tieredMaterials[6].getMolten(144 * 8),
+ GregtechItemList.Large_HPSteam_Turbine.get(1),
+ 20 * 60,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Plasma
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.Casing_Turbine3.get(1),
+ CI.getPlate(6, 4),
+ CI.getScrew(6, 8),
+ },
+ CI.tieredMaterials[5].getMolten(144 * 2),
+ GregtechItemList.Casing_Turbine_Plasma.get(1),
+ 20 * 5,
+ MaterialUtils.getVoltageForTier(6));
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(18),
+ ItemList.LargePlasmaTurbine.get(1),
+ CI.getPlate(7, 8),
+ CI.getScrew(7, 16),
+ CI.getGear(7, 4),
+ CI.getCircuit(7, 8)
+ },
+ CI.tieredMaterials[7].getMolten(144 * 8),
+ GregtechItemList.Large_Plasma_Turbine.get(1),
+ 20 * 60,
+ MaterialUtils.getVoltageForTier(7));
+ }
+
+ private static void multiSolarTower() {
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(17),
+ CI.getTieredGTPPMachineCasing(3, 4),
+ ALLOY.MARAGING250.getPlate(8),
+ ALLOY.MARAGING250.getBolt(8),
+ ALLOY.MARAGING250.getScrew(8),
+ CI.getCircuit(5, 8)
+ },
+ CI.getTieredFluid(3, 144 * 16),
+ GregtechItemList.Industrial_Solar_Tower.get(1),
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(4));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(17),
+ ALLOY.MARAGING350.getFrameBox(1),
+ ALLOY.STAINLESS_STEEL.getPlate(4),
+ ALLOY.MARAGING350.getScrew(8)
+ },
+ CI.getTieredFluid(3, 144 * 4),
+ GregtechItemList.Casing_SolarTower_Structural.get(1),
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(3));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(17),
+ ALLOY.MARAGING250.getFrameBox(1),
+ ALLOY.STAINLESS_STEEL.getPlate(4),
+ ALLOY.MARAGING250.getBolt(16),
+ ELEMENT.getInstance().ALUMINIUM.getScrew(8)
+ },
+ CI.getTieredFluid(3, 144 * 4),
+ GregtechItemList.Casing_SolarTower_SaltContainment.get(1),
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(3));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(17),
+ ALLOY.MARAGING250.getFrameBox(1),
+ ALLOY.STEEL_BLACK.getPlate(4),
+ ALLOY.MARAGING250.getScrew(8)
+ },
+ CI.getAlternativeTieredFluid(3, 144 * 4),
+ GregtechItemList.Casing_SolarTower_HeatContainment.get(1),
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(3));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(17),
+ CI.getTieredGTPPMachineCasing(2, 1),
+ CI.getPlate(3, 2),
+ CI.getGear(3, 4),
+ CI.getElectricMotor(3, 2),
+ CI.getCircuit(3, 4)
+ },
+ CI.getTertiaryTieredFluid(3, 144 * 4),
+ GregtechItemList.Solar_Tower_Reflector.get(1),
+ 20 * 60,
+ MaterialUtils.getVoltageForTier(3));
+ }
+
+ private static void multiElementalDuplicator() {
+
+ CORE.RA.addAssemblylineRecipe(
+ ItemList.Machine_IV_Replicator.get(1),
+ 20 * 60 * 60 * 12,
+ new Object[] {
+ CI.getTieredMachineHull(7, 4),
+ CI.getFieldGenerator(5, GTNH ? 32 : 16),
+ CI.getElectricMotor(7, GTNH ? 32 : 16),
+ CI.getElectricPiston(7, GTNH ? 16 : 4),
+ CI.getEnergyCore(6, GTNH ? 8 : 2),
+ CI.getPlate(7, GTNH ? 32 : 16),
+ CI.getScrew(7, GTNH ? 64 : 32),
+ CI.getBolt(6, GTNH ? 64 : 32),
+ CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 20 : 10),
+ new Object[] {CI.getTieredCircuitOreDictName(7), 20},
+ ItemList.Tool_DataOrb.get(32),
+ GregtechItemList.Laser_Lens_Special.get(1)
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(7, 144 * 32),
+ CI.getAlternativeTieredFluid(6, 144 * 16),
+ CI.getTertiaryTieredFluid(6, 144 * 16),
+ ALLOY.BABBIT_ALLOY.getFluidStack(128 * 144),
+ },
+ GregtechItemList.Controller_ElementalDuplicator.get(1),
+ 20 * 60 * 60 * (GTNH ? 2 : 1),
+ (int) MaterialUtils.getVoltageForTier(7));
+
+ CORE.RA.addAssemblylineRecipe(
+ GregtechItemList.Modulator_III.get(1),
+ 20 * 60 * 60 * 4,
+ new Object[] {
+ CI.getTieredGTPPMachineCasing(7, 2),
+ CI.getFieldGenerator(4, GTNH ? 8 : 4),
+ CI.getEnergyCore(4, GTNH ? 8 : 2),
+ CI.getPlate(7, GTNH ? 16 : 8),
+ CI.getScrew(6, GTNH ? 32 : 16),
+ CI.getBolt(6, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.rod, 5, GTNH ? 32 : 16),
+ new Object[] {CI.getTieredCircuitOreDictName(6), 32},
+ ItemList.Tool_DataOrb.get(32),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(6, 144 * 16),
+ CI.getAlternativeTieredFluid(5, 144 * 8),
+ CI.getTertiaryTieredFluid(5, 144 * 8),
+ ALLOY.BABBIT_ALLOY.getFluidStack(64 * 144),
+ },
+ GregtechItemList.Hatch_Input_Elemental_Duplicator.get(1),
+ 20 * 60 * 60 * (GTNH ? 4 : 2),
+ (int) MaterialUtils.getVoltageForTier(6));
+
+ CORE.RA.addAssemblylineRecipe(
+ GregtechItemList.ResonanceChamber_III.get(1),
+ 20 * 60 * 60 * 2,
+ new Object[] {
+ CI.getTieredMachineHull(6, 5),
+ CI.getFieldGenerator(3, GTNH ? 32 : 16),
+ CI.getEnergyCore(2, GTNH ? 8 : 2),
+ CI.getPlate(7, GTNH ? 8 : 4),
+ CI.getScrew(7, GTNH ? 8 : 4),
+ CI.getBolt(6, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.rod, 5, GTNH ? 8 : 4),
+ new Object[] {CI.getTieredCircuitOreDictName(5), 4},
+ ItemList.Tool_DataStick.get(4),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(5, 144 * 16),
+ CI.getAlternativeTieredFluid(4, 144 * 8),
+ CI.getTertiaryTieredFluid(4, 144 * 8),
+ ALLOY.BABBIT_ALLOY.getFluidStack(16 * 144),
+ },
+ GregtechItemList.Casing_ElementalDuplicator.get(1),
+ 20 * 60 * (GTNH ? 20 : 10),
+ (int) MaterialUtils.getVoltageForTier(6));
+ }
+
+ private static void resonanceChambers() {
+ int aFieldTier = 1;
+ int aCasingTier = 4;
+ for (int i = 0; i < 4; i++) {
+ RecipeUtils.addShapedRecipe(
+ CI.getDoublePlate(aCasingTier, 1),
+ CI.getFieldGenerator(aFieldTier, 1),
+ CI.getDoublePlate(aCasingTier, 1),
+ CI.getFieldGenerator(aFieldTier, 1),
+ CI.getTieredMachineCasing(aCasingTier),
+ CI.getFieldGenerator(aFieldTier, 1),
+ CI.getDoublePlate(aCasingTier, 1),
+ CI.getFieldGenerator(aFieldTier, 1),
+ CI.getDoublePlate(aCasingTier, 1),
+ ItemUtils.simpleMetaStack(ModBlocks.blockSpecialMultiCasings2, i, 1));
+ aCasingTier++;
+ aFieldTier++;
+ }
+ }
+
+ private static void modulators() {
+ int aCasingTier = 4;
+ for (int i = 4; i < 8; i++) {
+ RecipeUtils.addShapedRecipe(
+ CI.getTieredCircuitOreDictName(aCasingTier),
+ CI.getPlate(aCasingTier, 1),
+ CI.getTieredCircuitOreDictName(aCasingTier),
+ CI.getPlate(aCasingTier, 1),
+ CI.getTieredMachineCasing(aCasingTier),
+ CI.getPlate(aCasingTier, 1),
+ CI.getTieredCircuitOreDictName(aCasingTier),
+ CI.getPlate(aCasingTier, 1),
+ CI.getTieredCircuitOreDictName(aCasingTier),
+ ItemUtils.simpleMetaStack(ModBlocks.blockSpecialMultiCasings2, i, 1));
+ aCasingTier++;
+ }
+ }
+
+ private static void zyngen() {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(6),
+ CI.getTieredMachineHull(4),
+ ItemList.Machine_IV_AlloySmelter.get(1),
+ CI.getGear(3, 16),
+ CI.getBolt(3, 64),
+ CI.getPlate(4, 16)
+ },
+ CI.getAlternativeTieredFluid(4, 144 * 8),
+ GregtechItemList.Industrial_AlloySmelter.get(1),
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(4));
+ }
+
+ private static void chemPlant() {
GT_ModHandler.addCraftingRecipe(
- GregtechItemList.Casing_Machine_Custom_1.get(2L, new Object[0]),
- CI.bits,
- new Object[]{
- "PhP",
- "PFP",
- "PwP",
- 'P',
- OrePrefixes.plate.get(Materials.Bronze),
- 'F',
- OrePrefixes.frameGt.get(Materials.Bronze)
- }
- );
-
- GT_ModHandler.addCraftingRecipe(
- GregtechItemList.Casing_Machine_Custom_2.get(2L, new Object[0]),
- CI.bits,
- new Object[]{
- "PPP",
- "hFw",
- "PPP",
- 'P',
- OrePrefixes.plate.get(Materials.Aluminium),
- 'F',
- OrePrefixes.frameGt.get(Materials.Aluminium)
- }
- );
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(19),
- CI.getTieredGTPPMachineCasing(1, 6),
- CI.getTieredComponentOfMaterial(Materials.Steel, OrePrefixes.gearGt, 6),
- CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.plate, 32),
- CI.getTieredComponentOfMaterial(Materials.CobaltBrass, OrePrefixes.dust, 16),
- CI.getTieredComponent(OrePrefixes.frameGt, 2, 4),
- },
- ALLOY.STEEL.getFluidStack(2 * (144 * 4)),
- GregtechItemList.ChemicalPlant_Controller.get(1),
- 120 * 20,
- MaterialUtils.getVoltageForTier(2));
-
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(15),
- CI.getTieredGTPPMachineCasing(1, 2),
- ItemList.Hatch_Input_Bus_MV.get(1),
- CI.getTieredComponentOfMaterial(Materials.Bronze, OrePrefixes.gearGt, 8),
- CI.getTieredComponentOfMaterial(Materials.Lead, OrePrefixes.plate, 48),
- CI.getTieredComponentOfMaterial(Materials.SolderingAlloy, OrePrefixes.wireFine, 16),
- },
- ALLOY.BRONZE.getFluidStack(2 * (144 * 4)),
- GregtechItemList.Bus_Catalysts.get(1),
- 60 * 20,
- MaterialUtils.getVoltageForTier(2));
-
- }
-
- private static void algaeFarm() {
-
- // Give the shitty algae a use :)
- CORE.RA.addDistilleryRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 32),
- null,
- null,
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4),
- 20 * 15,
- 16,
- false);
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(21),
- CI.getTieredGTPPMachineCasing(0, 4),
- CI.getTieredComponentOfMaterial(Materials.Iron, OrePrefixes.rod, 12),
- CI.getTieredComponentOfMaterial(Materials.Wood, OrePrefixes.plate, 32),
- CI.getTieredComponentOfMaterial(Materials.Bronze, OrePrefixes.bolt, 16),
- CI.getTieredComponentOfMaterial(Materials.Redstone, OrePrefixes.dust, 32),
- },
- ALLOY.POTIN.getFluidStack(2 * (144 * 4)),
- GregtechItemList.AlgaeFarm_Controller.get(1),
- 60 * 20,
- MaterialUtils.getVoltageForTier(1));
-
-
- }
-
- private static void distillus() {
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(19),
- ItemList.Distillation_Tower.get(2),
- GregtechItemList.GTPP_Casing_IV.get(16),
- CI.getTieredComponent(OrePrefixes.circuit, 6, 8)
- },
- new FluidStack[] {
- ALLOY.AQUATIC_STEEL.getFluidStack(144 * 32),
- ALLOY.BABBIT_ALLOY.getFluidStack(144 * 16),
- ALLOY.BRONZE.getFluidStack(144 * 64),
- ALLOY.KANTHAL.getFluidStack(144 * 16),
- },
- new ItemStack[] {
- GregtechItemList.Machine_Adv_DistillationTower.get(1)
- },
- new FluidStack[] {
-
- },
- 20 * 600,
- MaterialUtils.getVoltageForTier(6),
- 5);
-
- }
-
- private static void chunkloaders() {
-
- ItemStack aOutputs[] = new ItemStack[] {
- GregtechItemList.GT_Chunkloader_HV.get(1L),
- GregtechItemList.GT_Chunkloader_IV.get(1L),
- GregtechItemList.GT_Chunkloader_ZPM.get(1L),
- };
-
- int aIndex = 0;
-
- for (int i=3;i<8;i++) {
- if (i == 4 || i == 6) {
- continue;
- }
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(21),
- CI.getElectricPiston(i, 10),
- CI.getFieldGenerator(i + 1, 6),
- CI.getPlate(i, 16),
- CI.getTransmissionComponent(i - 1, 8),
- CI.getTieredComponent(OrePrefixes.cableGt08, i, 16)
- },
- ALLOY.EGLIN_STEEL.getFluidStack(i * (144 * 4)),
- aOutputs[aIndex++].copy(),
- 300 * 20,
- MaterialUtils.getVoltageForTier(i));
- }
-
-
- }
-
- private static void overflowValveCovers() {
- ItemStack aOutputs[] = new ItemStack[] {
- GregtechItemList.Cover_Overflow_ULV.get(1L),
- GregtechItemList.Cover_Overflow_LV.get(1L),
- GregtechItemList.Cover_Overflow_MV.get(1L),
- GregtechItemList.Cover_Overflow_HV.get(1L),
- GregtechItemList.Cover_Overflow_EV.get(1L),
- GregtechItemList.Cover_Overflow_IV.get(1L),
- };
-
- for (int i=0;i<6;i++) {
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(19),
- CI.getElectricPump(i, 2),
- CI.getElectricMotor(i, 2),
- CI.getPlate(i, 4)
- },
- FluidUtils.getWater((i+1) * 750),
- aOutputs[i].copy(),
- 20 * 20,
- MaterialUtils.getVoltageForTier(i));
- }
-
- }
-
- private static void tieredMachineHulls() {
-
- GregtechItemList[] aHulls = new GregtechItemList[] {
- GregtechItemList.GTPP_Casing_ULV,
- GregtechItemList.GTPP_Casing_LV,
- GregtechItemList.GTPP_Casing_MV,
- GregtechItemList.GTPP_Casing_HV,
- GregtechItemList.GTPP_Casing_EV,
- GregtechItemList.GTPP_Casing_IV,
- GregtechItemList.GTPP_Casing_LuV,
- GregtechItemList.GTPP_Casing_ZPM,
- GregtechItemList.GTPP_Casing_UV,
- GregtechItemList.GTPP_Casing_MAX
- };
-
- for (int i=0;i<10;i++) {
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(20),
- CI.getTieredMachineCasing(i),
- CI.getPlate(i, 8),
- CI.getGear(i, 2),
- CI.getTieredComponent(OrePrefixes.cableGt02, i, 4),
- CI.getTieredComponent(OrePrefixes.circuit, i, 2)
- },
- CI.getAlternativeTieredFluid(i, 144 * (i+1) * 2),
- aHulls[i].get(1),
- 20 * 20,
- MaterialUtils.getVoltageForTier(i));
- }
-
- }
-
- private static void initModItems(){
- if (LoadedMods.IndustrialCraft2){
- IC2MFE = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFE", 1, 1);
- IC2MFSU = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFSU", 2, 1);
- }
- if (LoadedMods.Gregtech){
-
- //Lava Boiler
- boiler_Coal = ItemList.Machine_Bronze_Boiler.get(1);
-
- //IV MACHINES
- if (!GTNH){
- EV_MACHINE_Electrolyzer = ItemList.Machine_EV_Electrolyzer.get(1);
- EV_MACHINE_BendingMachine= ItemList.Machine_EV_Bender.get(1);
- EV_MACHINE_Wiremill= ItemList.Machine_EV_Wiremill.get(1);
- HV_MACHINE_Macerator= ItemList.Machine_HV_Macerator.get(1);
- EV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1);
- EV_MACHINE_MassFabricator= ItemList.Machine_EV_Massfab.get(1);
- EV_MACHINE_Centrifuge= ItemList.Machine_EV_Centrifuge.get(1);
- EV_MACHINE_Cutter = ItemList.Machine_EV_Cutter.get(1);
- EV_MACHINE_Extruder = ItemList.Machine_EV_Extruder.get(1);
- EV_MACHINE_Sifter = ItemList.Machine_HV_Sifter.get(1);
- EV_MACHINE_ThermalCentrifuge = ItemList.Machine_EV_ThermalCentrifuge.get(1);
- EV_MACHINE_OreWasher = ItemList.Machine_EV_OreWasher.get(1);
- EV_MACHINE_AlloySmelter = ItemList.Machine_EV_AlloySmelter.get(1);
- EV_MACHINE_Mixer = ItemList.Machine_EV_Mixer.get(1);
- }
- //Balanced opposites
- else {
- EV_MACHINE_Electrolyzer = ItemList.Machine_IV_Electrolyzer.get(1);
- EV_MACHINE_BendingMachine= ItemList.Machine_IV_Bender.get(1);
- EV_MACHINE_Wiremill= ItemList.Machine_IV_Wiremill.get(1);
- HV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1);
- EV_MACHINE_Macerator= ItemList.Machine_IV_Macerator.get(1);
- EV_MACHINE_MassFabricator= CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? ItemUtils.getValueOfItemList("Machine_LuV_Massfab", ItemList.Machine_IV_Massfab).get(1) : ItemList.Machine_IV_Massfab.get(1);
- EV_MACHINE_Centrifuge= ItemList.Machine_IV_Centrifuge.get(1);
- EV_MACHINE_Cutter = ItemList.Machine_IV_Cutter.get(1);
- EV_MACHINE_Extruder = ItemList.Machine_IV_Extruder.get(1);
- EV_MACHINE_Sifter = ItemList.Machine_HV_Sifter.get(1);
- EV_MACHINE_ThermalCentrifuge = ItemList.Machine_IV_ThermalCentrifuge.get(1);
- EV_MACHINE_OreWasher = ItemList.Machine_IV_OreWasher.get(1);
- EV_MACHINE_AlloySmelter = ItemList.Machine_IV_AlloySmelter.get(1);
- EV_MACHINE_Mixer = ItemList.Machine_IV_Mixer.get(1);
- }
-
-
-
- }
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialCokeOven){
- if(LoadedMods.Railcraft){
- //Misc
- INPUT_RCCokeOvenBlock = ItemUtils.getItemStackWithMeta(LoadedMods.Railcraft, "Railcraft:machine.alpha", "Coke_Oven_RC", 7, 1);
- }
- if(LoadedMods.ImmersiveEngineering){
- //Misc
- INPUT_IECokeOvenBlock = ItemUtils.getItemStackWithMeta(LoadedMods.ImmersiveEngineering, "ImmersiveEngineering:stoneDecoration", "Coke_Oven_IE", 1, 1);
- }
- }
- runModRecipes();
- }
-
- private static void runModRecipes(){
- if (LoadedMods.Gregtech){
-
- //Computer Cube
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getSimpleStack(CI.getDataOrb(), 4 * (GTNH ? 2 : 1)),
- ItemList.Cover_Screen.get(4),
- CI.machineHull_IV,
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 2)
- },
- ELEMENT.getInstance().TANTALUM.getFluidStack(144 * 16),
- GregtechItemList.Gregtech_Computer_Cube.get(1),
- 60 * 20 * 3,
- 8000);
-
- //Circuit programmer
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getSimpleStack(CI.robotArm_LV, 4 * (GTNH ? 2 : 1)),
- ItemList.Cover_Controller.get(1, CI.electricMotor_MV),
- CI.machineHull_MV,
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), 2),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(2), 2)
- },
- ELEMENT.getInstance().IRON.getFluidStack(144 * 4),
- ItemUtils.getSimpleStack(ModBlocks.blockCircuitProgrammer),
- 60 * 10 * 1,
- 30);
-
- //Lead Lined Chest
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.machineHull_LV,
- ItemUtils.getItemStackOfAmountFromOreDict("plateRubber", 32),
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseLead", 9),
- ItemUtils.getSimpleStack(Blocks.chest)
- },
- ELEMENT.getInstance().LEAD.getFluidStack(144 * 16),
- ItemUtils.getSimpleStack(ModBlocks.blockDecayablesChest),
- 60 * 10 * 3,
- 60);
-
- //RTG
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackWithMeta(true, "IC2:blockGenerator:6", "IC2-RTG", 6, 1),
- ALLOY.NITINOL_60.getPlate(GTNH ? 32 : 8),
- ALLOY.MARAGING350.getGear(GTNH ? 16 : 4),
- ItemUtils.getSimpleStack(GTNH ? CI.fieldGenerator_IV : CI.fieldGenerator_EV, 8 ),
- ItemUtils.getItemStackOfAmountFromOreDict("wireFinePlatinum", GTNH ? 64 : 32),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 7 : 6), GTNH ? 5 : 4)
- },
- ALLOY.NIOBIUM_CARBIDE.getFluidStack(144 * 16),
- GregtechItemList.RTG.get(1),
- 60 * 20 * 10,
- 8000);
-
- // Super Jukebox
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.machineHull_LV,
- ItemUtils.getItemStackOfAmountFromOreDict("circuitBasic", 4),
- ItemUtils.getItemStackOfAmountFromOreDict("plateTumbaga", 8),
- ItemUtils.getSimpleStack(Blocks.jukebox)
- },
- ELEMENT.getInstance().COPPER.getFluidStack(144 * 2),
- ItemUtils.getSimpleStack(ModBlocks.blockCustomJukebox),
- 20 * 30,
- 30);
-
- ItemStack aFluidRegulator1 = ItemUtils.getValueOfItemList("FluidRegulator_MV",GTNH ? 4 : 2, ItemList.Electric_Pump_HV);
- ItemStack aFluidRegulator2 = ItemUtils.getValueOfItemList("FluidRegulator_IV", GTNH ? 4 : 2, ItemUtils.getValueOfItemList("Electric_Pump_LuV", GTNH ? 8 : 4, ItemList.Electric_Pump_IV));
-
- //Poo Collector
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.machineHull_MV,
- aFluidRegulator1,
- CI.getTieredComponent(OrePrefixes.pipeMedium, 2, GTNH ? 4 : 2),
- ALLOY.EGLIN_STEEL.getPlate(GTNH ? 8 : 4),
- ALLOY.POTIN.getScrew(GTNH ? 12 : 6)
- },
- ALLOY.TUMBAGA.getFluidStack(144 * 4),
- ItemUtils.getSimpleStack(ModBlocks.blockPooCollector),
- 20 * 60,
- 30);
-
- //Adv. Poo Collector
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getTieredMachineHull(-1),
- ItemUtils.getSimpleStack(ModBlocks.blockPooCollector),
- aFluidRegulator2,
- CI.getTieredComponent(OrePrefixes.pipeHuge, 6, GTNH ? 8 : 4),
- CI.getTieredComponent(OrePrefixes.screw, 6, GTNH ? 32 : 16)
- },
- CI.getAlternativeTieredFluid(5, 144 * 9),
- ItemUtils.getSimpleStack(ModBlocks.blockPooCollector, 8, 1),
- 20 * 60 * 5,
- 500);
-
-
- //Basic Steam Turbine
- RecipeUtils.addShapedGregtechRecipe(
- CI.getTieredComponent(OrePrefixes.pipeSmall, 0, 1), "circuitPrimitive", CI.getTieredComponent(OrePrefixes.pipeSmall, 0, 1),
- ALLOY.TUMBAGA.getRotor(1), CI.machineCasing_ULV, ALLOY.TUMBAGA.getRotor(1),
- CI.getElectricMotor(0, 1), "cableGt01RedAlloy", CI.getElectricMotor(0, 1),
- GregtechItemList.Generator_Steam_Turbine_ULV.get(1));
-
- //Basic Gas Turbine
- RecipeUtils.addShapedGregtechRecipe(
- "circuitPrimitive", ALLOY.TUMBAGA.getRotor(1), "circuitPrimitive",
- ALLOY.TUMBAGA.getRotor(1), CI.machineCasing_ULV, ALLOY.TUMBAGA.getRotor(1),
- CI.getElectricMotor(0, 1), "cableGt01RedAlloy", CI.getElectricMotor(0, 1),
- GregtechItemList.Generator_Gas_Turbine_ULV.get(1));
-
- //Basic Combustion Turbine
- RecipeUtils.addShapedGregtechRecipe(
- CI.getElectricPiston(0, 1), "circuitPrimitive", CI.getElectricPiston(0, 1),
- CI.getElectricMotor(0, 1), CI.machineCasing_ULV, CI.getElectricMotor(0, 1),
- ALLOY.TUMBAGA.getGear(1), "cableGt01RedAlloy", ALLOY.TUMBAGA.getGear(1),
- GregtechItemList.Generator_Diesel_ULV.get(1));
-
-
-
- //Steam Condenser
- if (CORE.ConfigSwitches.enableMachine_SteamConverter ){
- RECIPE_SteamCondenser = GregtechItemList.Condensor_MAX.get(1);
- RecipeUtils.addShapedGregtechRecipe(
- pipeLargeCopper, pipeHugeSteel, pipeLargeCopper,
- plateEnergeticAlloy, CI.electricPump_HV, plateEnergeticAlloy,
- plateEnergeticAlloy, pipeLargeCopper, plateEnergeticAlloy,
- RECIPE_SteamCondenser);
- }
-
- ItemStack aBronzeBricks = ItemUtils.simpleMetaStack(GregTech_API.sBlockCasings1, 10, 1);
- // Steam Macerator Multi
- RecipeUtils.addShapedGregtechRecipe(
- aBronzeBricks, "gemDiamond", aBronzeBricks,
- "craftingPiston", ALLOY.TUMBAGA.getFrameBox(1), "craftingPiston",
- aBronzeBricks, "gemDiamond", aBronzeBricks,
- GregtechItemList.Controller_SteamMaceratorMulti.get(1));
- // Steam Compressor Multi
- RecipeUtils.addShapedGregtechRecipe(
- aBronzeBricks, "craftingPiston", aBronzeBricks,
- ALLOY.TUMBAGA.getGear(1), ALLOY.TUMBAGA.getFrameBox(1), ALLOY.TUMBAGA.getGear(1),
- aBronzeBricks, "craftingPiston", aBronzeBricks,
- GregtechItemList.Controller_SteamCompressorMulti.get(1));
-
- // Steam Hatch
- RecipeUtils.addShapedGregtechRecipe(
- "plateBronze", "pipeMediumBronze", "plateBronze",
- "plateBronze", GregtechItemList.GT_FluidTank_ULV.get(1), "plateBronze",
- "plateBronze", "pipeMediumBronze", "plateBronze",
- GregtechItemList.Hatch_Input_Steam.get(1));
-
- // Steam Input Bus
- RecipeUtils.addShapedGregtechRecipe(
- "plateBronze", ALLOY.TUMBAGA.getPlate(1), "plateBronze",
- "plateTin", ItemUtils.getSimpleStack(Blocks.hopper), "plateTin",
- "plateBronze", ALLOY.TUMBAGA.getPlate(1), "plateBronze",
- GregtechItemList.Hatch_Input_Bus_Steam.get(1));
-
- // Steam Output Bus
- RecipeUtils.addShapedGregtechRecipe(
- "plateBronze", "plateTin", "plateBronze",
- ALLOY.TUMBAGA.getPlate(1), ItemUtils.getSimpleStack(Blocks.hopper), ALLOY.TUMBAGA.getPlate(1),
- "plateBronze", "plateTin", "plateBronze",
- GregtechItemList.Hatch_Output_Bus_Steam.get(1));
-
-
- //RF Convertor
- if (LoadedMods.CoFHCore && CORE.ConfigSwitches.enableMachine_RF_Convetor){
- RecipeUtils.addShapedGregtechRecipe(
- CI.getPlate(4, 1), CI.getTieredCircuitOreDictName(5), CI.getPlate(4, 1),
- CI.getTransmissionComponent(3, 1), CI.getTieredGTPPMachineCasing(4, 1), CI.getTransmissionComponent(3, 1),
- CI.getPlate(4, 1), plateEnergeticAlloy, CI.getPlate(4, 1),
- GregtechItemList.Energy_Buffer_RF_Convertor.get(1));
- }
-
- // Egg Box
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(8),
- CI.getTieredMachineHull(3),
- ItemUtils.getSimpleStack(Items.egg, 64),
- ItemUtils.getSimpleStack(ModItems.itemRope, 32),
- CI.getPlate(4, GTNH ? 16 : 8)
- },
- FluidUtils.getFluidStack("mobessence", 4096),
- ItemUtils.getSimpleStack(ModBlocks.blockEggBox, 1),
- 20 * 60,
- 480);
-
- //Flask Configurator
- if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(8),
- CI.getTieredMachineHull(2),
- ItemUtils.getSimpleStack(ModBlocks.blockCircuitProgrammer),
- VolumetricFlaskHelper.getVolumetricFlask(8),
- CI.getTieredComponent(OrePrefixes.pipeSmall, 2, GTNH ? 4 : 2),
- CI.getPlate(2, GTNH ? 8 : 4)
- },
- CI.getAlternativeTieredFluid(1, 144 * 8),
- ItemUtils.getSimpleStack(ModBlocks.blockVolumetricFlaskSetter, 1),
- 20 * 60,
- 120);
- }
-
-
- if (CORE.ConfigSwitches.enableMultiblock_IronBlastFurnace){
-
- RECIPE_IronBlastFurnace = GregtechItemList.Machine_Iron_BlastFurnace.get(1);
- RECIPE_IronPlatedBricks = GregtechItemList.Casing_IronPlatedBricks.get(Casing_Amount);
-
- //Iron BF
- RecipeUtils.addShapedGregtechRecipe(
- "plateDoubleAnyIron", "craftingFurnace", "plateDoubleAnyIron",
- boiler_Coal, CI.machineCasing_ULV, boiler_Coal,
- "plateDoubleAnyIron", "bucketLava", "plateDoubleAnyIron",
- RECIPE_IronBlastFurnace);
- //Iron plated Bricks
- RecipeUtils.addShapedGregtechRecipe(
- "plateAnyIron", RECIPES_Tools.craftingToolHardHammer, "plateAnyIron",
- "plateAnyIron", blockBricks, "plateAnyIron",
- "plateAnyIron", RECIPES_Tools.craftingToolWrench, "plateAnyIron",
- RECIPE_IronPlatedBricks);
-
- //Add recycle recipes for the Iron Plated Bricks
- //GT_ModHandler.addPulverisationRecipe(RECIPE_IronPlatedBricks, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIron", 6), ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustClay", 2), true);
- CORE.RA.addPulverisationRecipe(
- RECIPE_IronPlatedBricks,
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIron", 6),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustClay", 2),
- null);
- GT_Values.RA.addArcFurnaceRecipe(RECIPE_IronPlatedBricks, new ItemStack[]{ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotWroughtIron", 6), ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustAsh", 2)}, new int[]{0}, 32*20, 32);
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialCentrifuge){
- //Industrial Centrifuge
- RECIPE_IndustrialCentrifugeController = GregtechItemList.Industrial_Centrifuge.get(1);
- RECIPE_IndustrialCentrifugeCasing = GregtechItemList.Casing_Centrifuge1.get(Casing_Amount);
-
- //Industrial Centrifuge
- RecipeUtils.addShapedGregtechRecipe(
- CI.circuitTier5, pipeHugeStainlessSteel, CI.circuitTier5,
- CI.component_Plate[6], EV_MACHINE_Centrifuge, CI.component_Plate[6],
- CI.component_Plate[8], CI.machineCasing_IV, CI.component_Plate[8],
- RECIPE_IndustrialCentrifugeController);
- //Centrifuge Casing
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[6], "stickTumbaga", CI.component_Plate[6],
- CI.component_Plate[8], "stickTumbaga", CI.component_Plate[8],
- CI.component_Plate[6], "stickTumbaga", CI.component_Plate[6],
- RECIPE_IndustrialCentrifugeCasing);
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialCokeOven){
- //Industrial Coke Oven
- RECIPE_IndustrialCokeOvenController = GregtechItemList.Industrial_CokeOven.get(1);
- RECIPE_IndustrialCokeOvenFrame = GregtechItemList.Casing_CokeOven.get(Casing_Amount);
- RECIPE_IndustrialCokeOvenCasingA = GregtechItemList.Casing_CokeOven_Coil1.get(Casing_Amount);
- RECIPE_IndustrialCokeOvenCasingB = GregtechItemList.Casing_CokeOven_Coil2.get(Casing_Amount);
-
- if (LoadedMods.Railcraft){
- //Industrial Coke Oven
- RecipeUtils.addShapedGregtechRecipe(
- plateCobalt, CI.circuitTier4, plateCobalt,
- CI.machineCasing_HV, INPUT_RCCokeOvenBlock, CI.machineCasing_HV,
- plateCobalt, CI.circuitTier5, plateCobalt,
- RECIPE_IndustrialCokeOvenController);
- }
- if (LoadedMods.ImmersiveEngineering){
- //Industrial Coke Oven
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[8], CI.circuitTier4, CI.component_Plate[8],
- CI.machineCasing_HV, INPUT_IECokeOvenBlock, CI.machineCasing_HV,
- CI.component_Plate[8], CI.circuitTier3, CI.component_Plate[8],
- RECIPE_IndustrialCokeOvenController);
- }
- //Coke Oven Frame Casing
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[7], CI.component_Rod[7], CI.component_Plate[7],
- CI.component_Rod[7], "frameGtTantalloy61", CI.component_Rod[7],
- CI.component_Plate[7], CI.component_Rod[7], CI.component_Plate[7],
- RECIPE_IndustrialCokeOvenFrame);
- //Coke Oven Coil 1
- RecipeUtils.addShapedGregtechRecipe(
- plateBronze, plateBronze, plateBronze,
- "frameGtBronze", CI.gearboxCasing_Tier_1, "frameGtBronze",
- plateBronze, plateBronze, plateBronze,
- RECIPE_IndustrialCokeOvenCasingA);
- //Coke Oven Coil 2
- RecipeUtils.addShapedGregtechRecipe(
- plateSteel, plateSteel, plateSteel,
- "frameGtSteel", CI.gearboxCasing_Tier_2, "frameGtSteel",
- plateSteel, plateSteel, plateSteel,
- RECIPE_IndustrialCokeOvenCasingB);
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialElectrolyzer){
- //Industrial Electrolyzer
- RECIPE_IndustrialElectrolyzerController = GregtechItemList.Industrial_Electrolyzer.get(1);
- RECIPE_IndustrialElectrolyzerFrame = GregtechItemList.Casing_Electrolyzer.get(Casing_Amount);
-
- //Electrolyzer Frame Casing
- RecipeUtils.addShapedGregtechRecipe(
- "platePotin", "stickLongChrome", "platePotin",
- "stickLongPotin", "frameGtPotin", "stickLongPotin",
- "platePotin", "stickLongPotin", "platePotin",
- RECIPE_IndustrialElectrolyzerFrame);
- //Industrial Electrolyzer
- RecipeUtils.addShapedGregtechRecipe(
- "plateStellite", CI.circuitTier5, "plateStellite",
- CI.machineCasing_EV, EV_MACHINE_Electrolyzer, CI.machineCasing_EV,
- "plateStellite", "rotorStellite", "plateStellite",
- RECIPE_IndustrialElectrolyzerController);
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialPlatePress){
- //Industrial Material Press
- RECIPE_IndustrialMaterialPressController = GregtechItemList.Industrial_PlatePress.get(1);
- RECIPE_IndustrialMaterialPressFrame = GregtechItemList.Casing_MaterialPress.get(Casing_Amount);
-
- //Material Press Frame Casing
- RecipeUtils.addShapedGregtechRecipe(
- "plateTitanium", "stickLongTumbaga", "plateTitanium",
- "stickTantalloy60", "frameGtTumbaga", "stickTantalloy60",
- "plateTitanium", "stickLongTumbaga", "plateTitanium",
- RECIPE_IndustrialMaterialPressFrame);
- //Industrial Material Press
- RecipeUtils.addShapedGregtechRecipe(
- "plateTitanium", CI.circuitTier5, "plateTitanium",
- CI.machineCasing_EV, EV_MACHINE_BendingMachine, CI.machineCasing_EV,
- "plateTitanium", CI.circuitTier5, "plateTitanium",
- RECIPE_IndustrialMaterialPressController);
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialMacerationStack){
- //Industrial Maceration Stack
- RECIPE_IndustrialMacerationStackController = GregtechItemList.Industrial_MacerationStack.get(1);
- RECIPE_IndustrialMacerationStackFrame = GregtechItemList.Casing_MacerationStack.get(Casing_Amount);
-
- //Maceration Frame Casing
- RecipeUtils.addShapedGregtechRecipe(
- "platePalladium", "platePalladium", "platePalladium",
- "stickPlatinum", "frameGtInconel625", "stickPlatinum",
- "platePalladium", "stickLongPalladium", "platePalladium",
- RECIPE_IndustrialMacerationStackFrame);
- //Industrial Maceration stack
- RecipeUtils.addShapedGregtechRecipe(
- "plateTungstenCarbide", EV_MACHINE_Macerator, "plateTungstenCarbide",
- HV_MACHINE_Macerator, CI.circuitTier7, HV_MACHINE_Macerator,
- "plateTungstenCarbide", CI.machineCasing_IV, "plateTungstenCarbide",
- RECIPE_IndustrialMacerationStackController);
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialWireMill){
- //Industrial Wire Factory
- RECIPE_IndustrialWireFactoryController = GregtechItemList.Industrial_WireFactory.get(1);
- RECIPE_IndustrialWireFactoryFrame = GregtechItemList.Casing_WireFactory.get(Casing_Amount);
-
- //Wire Factory Frame Casing
- RecipeUtils.addShapedGregtechRecipe(
- "plateBlueSteel", "stickBlueSteel", "plateBlueSteel",
- "stickBlueSteel", "frameGtBlueSteel", "stickBlueSteel",
- "plateBlueSteel", "stickBlueSteel", "plateBlueSteel",
- RECIPE_IndustrialWireFactoryFrame);
- //Industrial Wire Factory
- RecipeUtils.addShapedGregtechRecipe(
- "plateZeron100", CI.machineCasing_IV, "plateZeron100",
- CI.circuitTier5, EV_MACHINE_Wiremill, CI.circuitTier5,
- "plateZeron100", CI.machineCasing_IV, "plateZeron100",
- RECIPE_IndustrialWireFactoryController);
- }
-
-
-
- //Tiered Tanks
- if (CORE.ConfigSwitches.enableMachine_FluidTanks){
- Logger.WARNING("Is New Horizons Loaded? "+GTNH);
- if (!GTNH){
-
- // Allows clearing stored fluids.
- GregtechItemList[] aTanks = new GregtechItemList[] {
- GregtechItemList.GT_FluidTank_ULV, GregtechItemList.GT_FluidTank_LV, GregtechItemList.GT_FluidTank_MV,
- GregtechItemList.GT_FluidTank_HV, GregtechItemList.GT_FluidTank_EV, GregtechItemList.GT_FluidTank_IV,
- GregtechItemList.GT_FluidTank_LuV, GregtechItemList.GT_FluidTank_ZPM, GregtechItemList.GT_FluidTank_UV,
- GregtechItemList.GT_FluidTank_MAX};
- for (GregtechItemList aTank : aTanks) {
- RecipeUtils.addShapedGregtechRecipe(
- aTank.get(1), null, null,
- null, null, null,
- null, null, null,
- aTank.get(1));
- }
-
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[1], CI.component_Plate[1], CI.component_Plate[1],
- CI.component_Plate[1], pipeTier1, CI.component_Plate[1],
- CI.component_Plate[1], GregtechItemList.Fluid_Cell_144L.get(1), CI.component_Plate[1],
- GregtechItemList.GT_FluidTank_ULV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[2], CI.component_Plate[2], CI.component_Plate[2],
- CI.component_Plate[2], pipeTier2, CI.component_Plate[2],
- CI.component_Plate[2], CI.electricPump_LV, CI.component_Plate[2],
- GregtechItemList.GT_FluidTank_LV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[3], CI.component_Plate[3], CI.component_Plate[3],
- CI.component_Plate[3], pipeTier3, CI.component_Plate[3],
- CI.component_Plate[3], CI.electricPump_MV, CI.component_Plate[3],
- GregtechItemList.GT_FluidTank_MV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[4], CI.component_Plate[4], CI.component_Plate[4],
- CI.component_Plate[4], pipeTier4, CI.component_Plate[4],
- CI.component_Plate[4], CI.electricPump_HV, CI.component_Plate[4],
- GregtechItemList.GT_FluidTank_HV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[5], CI.component_Plate[5], CI.component_Plate[5],
- CI.component_Plate[5], pipeTier5, CI.component_Plate[5],
- CI.component_Plate[5], CI.electricPump_EV, CI.component_Plate[5],
- GregtechItemList.GT_FluidTank_EV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[6], CI.component_Plate[6], CI.component_Plate[6],
- CI.component_Plate[6], pipeTier6, CI.component_Plate[6],
- CI.component_Plate[6], CI.electricPump_IV, CI.component_Plate[6],
- GregtechItemList.GT_FluidTank_IV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[7], CI.component_Plate[7], CI.component_Plate[7],
- CI.component_Plate[7], pipeTier7, CI.component_Plate[7],
- CI.component_Plate[7], CI.electricPump_LuV, CI.component_Plate[7],
- GregtechItemList.GT_FluidTank_LuV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[8], CI.component_Plate[8], CI.component_Plate[8],
- CI.component_Plate[8], pipeTier8, CI.component_Plate[8],
- CI.component_Plate[8], CI.electricPump_ZPM, CI.component_Plate[8],
- GregtechItemList.GT_FluidTank_ZPM.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[9], CI.component_Plate[9], CI.component_Plate[9],
- CI.component_Plate[9], pipeTier9, CI.component_Plate[9],
- CI.component_Plate[9], CI.electricPump_UV, CI.component_Plate[9],
- GregtechItemList.GT_FluidTank_UV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[10], CI.component_Plate[10], CI.component_Plate[10],
- CI.component_Plate[10], pipeTier10, CI.component_Plate[10],
- CI.component_Plate[10], CI.electricPump_MAX, CI.component_Plate[10],
- GregtechItemList.GT_FluidTank_MAX.get(1));
- }
- else {
-
- CI.component_Plate[1] = "plateTin";
- pipeTier1 = "pipeLargeClay";
- CI.circuitTier1 = ItemList.Circuit_Primitive.get(1);
- CI.component_Plate[2] = "plateCopper";
- pipeTier2 = "pipeHugeClay";
- CI.component_Plate[3] = "plateBronze";
- pipeTier3 = "pipeMediumBronze";
- CI.component_Plate[4] = "plateIron";
- pipeTier4 = "pipeMediumSteel";
- CI.component_Plate[5] = "plateSteel";
- CI.component_Plate[6] = "plateRedstone";
- CI.component_Plate[7] = "plateAluminium";
- CI.component_Plate[8] = "plateDarkSteel";
- ItemStack waterBucket = ItemUtils.getSimpleStack(Items.water_bucket);
-
- // Allows clearing stored fluids.
- GregtechItemList[] aTanks = new GregtechItemList[] {GregtechItemList.GT_FluidTank_ULV, GregtechItemList.GT_FluidTank_LV, GregtechItemList.GT_FluidTank_MV, GregtechItemList.GT_FluidTank_HV};
- for (GregtechItemList aTank : aTanks) {
- RecipeUtils.addShapedGregtechRecipe(
- aTank.get(1), null, null,
- null, null, null,
- null, null, null,
- aTank.get(1));
- }
-
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[1], CI.component_Plate[5], CI.component_Plate[1],
- CI.component_Plate[4], pipeTier1, CI.component_Plate[4],
- CI.component_Plate[4], waterBucket, CI.component_Plate[4],
- GregtechItemList.GT_FluidTank_ULV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[5], CI.component_Plate[4], CI.component_Plate[5],
- CI.component_Plate[3], pipeTier2, CI.component_Plate[3],
- CI.component_Plate[3], CI.electricPump_LV, CI.component_Plate[3],
- GregtechItemList.GT_FluidTank_LV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[8], CI.component_Plate[3], CI.component_Plate[8],
- CI.component_Plate[5], pipeTier3, CI.component_Plate[5],
- CI.component_Plate[5], CI.electricPump_LV, CI.component_Plate[5],
- GregtechItemList.GT_FluidTank_MV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.circuitTier1, CI.component_Plate[7], CI.circuitTier1,
- CI.component_Plate[8], pipeTier4, CI.component_Plate[8],
- CI.circuitTier1, CI.electricPump_MV, CI.circuitTier1,
- GregtechItemList.GT_FluidTank_HV.get(1));
- }
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_MultiTank){
- //Industrial Multi Tank
- //RECIPE_IndustrialMultiTankController = GregtechItemList.Industrial_MultiTank.get(1);
- RECIPE_IndustrialMultiTankFrame = GregtechItemList.Casing_MultitankExterior.get(Casing_Amount);
-
- //Industrial Multi Tank Casing
- RecipeUtils.addShapedGregtechRecipe(
- "stickGrisium", "plateGrisium", "stickGrisium",
- "plateGrisium", "frameGtGrisium", "plateGrisium",
- "plateGrisium", "plateGrisium", "plateGrisium",
- RECIPE_IndustrialMultiTankFrame);
- //Industrial Multi Tank
- RecipeUtils.addShapedGregtechRecipe(
- "pipeHugeTantalloy60", "gearGrisium", "pipeHugeTantalloy60",
- CI.circuitTier4, RECIPE_IndustrialMultiTankFrame, CI.circuitTier4,
- "plateDoubleGrisium", "rotorGrisium", "plateDoubleGrisium",
- RECIPE_IndustrialMultiTankController);
- }
- //TODO
-
- //Semi-Fluid Generators
- ItemStack[][] aSemiFluidInputs = new ItemStack[3][6];
- aSemiFluidInputs[0] = new ItemStack[]{
- CI.getNumberedBioCircuit(14),
- CI.getTieredMachineHull(1, 1),
- CI.getElectricPiston(1, GTNH ? 4 : 2),
- CI.getTieredComponent(OrePrefixes.circuit, 1, GTNH ? 4 : 2),
- CI.getPlate(1, GTNH ? 8 : 4),
- CI.getGear(1, GTNH ? 4 : 2)
- };
- aSemiFluidInputs[1] = new ItemStack[]{
- CI.getNumberedCircuit(14),
- CI.getTieredMachineHull(2, 1),
- CI.getElectricPiston(2, GTNH ? 4 : 2),
- CI.getTieredComponent(OrePrefixes.circuit, 2, GTNH ? 4 : 2),
- CI.getPlate(2, GTNH ? 8 : 4),
- CI.getGear(2, GTNH ? 4 : 2)
- };
- aSemiFluidInputs[2] = new ItemStack[]{
- CI.getNumberedAdvancedCircuit(14),
- CI.getTieredMachineHull(3, 1),
- CI.getElectricPiston(3, GTNH ? 4 : 2),
- CI.getTieredComponent(OrePrefixes.circuit, 3, GTNH ? 4 : 2),
- CI.getPlate(3, GTNH ? 8 : 4),
- CI.getGear(3, GTNH ? 4 : 2)
- };
- FluidStack[] aSemiFluidFluidInputs = new FluidStack[] {
- ALLOY.BRONZE.getFluidStack(144 * 8),
- ALLOY.STEEL.getFluidStack(144 * 8),
- ELEMENT.getInstance().ALUMINIUM.getFluidStack(144 * 8),
- };
-
- //ItemUtils.simpleMetaStack("IC2:blockGenerator:7", 7, 1);
- ItemStack[] aSemifluids = new ItemStack[] {GregtechItemList.Generator_SemiFluid_LV.get(1), GregtechItemList.Generator_SemiFluid_MV.get(1), GregtechItemList.Generator_SemiFluid_HV.get(1)};
- for (int o=0;o<3;o++) {
- CORE.RA.addSixSlotAssemblingRecipe(
- aSemiFluidInputs[o],
- aSemiFluidFluidInputs[o],
- aSemifluids[o],
- 20 * 30,
- MaterialUtils.getVoltageForTier(o+1));
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_AlloyBlastSmelter){
- //Industrial Blast Smelter
- RECIPE_IndustrialBlastSmelterController = GregtechItemList.Industrial_AlloyBlastSmelter.get(1);
- RECIPE_IndustrialBlastSmelterFrame = GregtechItemList.Casing_BlastSmelter.get(Casing_Amount);
- RECIPE_IndustrialBlastSmelterCoil = GregtechItemList.Casing_Coil_BlastSmelter.get(Casing_Amount);
-
- //Blast Smelter
- RecipeUtils.addShapedGregtechRecipe(
- "plateZirconiumCarbide", CI.circuitTier4, "plateZirconiumCarbide",
- cableTier4, EV_MACHINE_AlloySmelter, cableTier4,
- "plateZirconiumCarbide", CI.circuitTier3, "plateZirconiumCarbide",
- RECIPE_IndustrialBlastSmelterController);
- //Blast Smelter Frame Casing
- RecipeUtils.addShapedGregtechRecipe(
- "plateZirconiumCarbide", CI.component_Rod[5], "plateZirconiumCarbide",
- CI.component_Rod[5], "frameGtTumbaga", CI.component_Rod[5],
- "plateZirconiumCarbide", CI.component_Rod[5], "plateZirconiumCarbide",
- RECIPE_IndustrialBlastSmelterFrame);
- //Blast Smelter Coil
- RecipeUtils.addShapedGregtechRecipe(
- "plateStaballoy", "plateStaballoy", "plateStaballoy",
- "frameGtStaballoy", CI.gearboxCasing_Tier_3, "frameGtStaballoy",
- "plateStaballoy", "plateStaballoy", "plateStaballoy",
- RECIPE_IndustrialBlastSmelterCoil);
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_MatterFabricator){
- //Industrial Matter Fabricator
- RECIPE_IndustrialMatterFabController = GregtechItemList.Industrial_MassFab.get(1);
- RECIPE_IndustrialMatterFabFrame = GregtechItemList.Casing_MatterFab.get(Casing_Amount);
- RECIPE_IndustrialMatterFabCoil = GregtechItemList.Casing_MatterGen.get(Casing_Amount);
-
- //Matter Fabricator CPU
- RecipeUtils.addShapedGregtechRecipe(
- CI.getDoublePlate(8, 1), CI.circuitTier5, CI.getPlate(8, 1),
- cableTier8, CI.machineCasing_LuV, cableTier8,
- CI.getPlate(8, 1), CI.circuitTier5, CI.getPlate(8, 1),
- RECIPE_IndustrialMatterFabController);
- //Matter Fabricator Frame Casing
- RecipeUtils.addShapedGregtechRecipe(
- "plateNiobiumCarbide", CI.component_Rod[8], "plateNiobiumCarbide",
- CI.component_Rod[8], "frameGtInconel690", CI.component_Rod[8],
- "plateNiobiumCarbide", CI.component_Rod[8], "plateNiobiumCarbide",
- RECIPE_IndustrialMatterFabFrame);
- //Matter Fabricator Coil
- RecipeUtils.addShapedGregtechRecipe(
- CI.getPlate(6, 1), CI.getPlate(7, 1), CI.getPlate(6, 1),
- "frameGtStellite", CI.machineCasing_UV, "frameGtStellite",
- CI.getPlate(6, 1), CI.getPlate(7, 1), CI.getPlate(6, 1),
- RECIPE_IndustrialMatterFabCoil);
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialSifter){
- //Industrial Sieve
- RECIPE_IndustrialSieveController = GregtechItemList.Industrial_Sifter.get(1);
- RECIPE_IndustrialSieveFrame = GregtechItemList.Casing_Sifter.get(Casing_Amount);
- RECIPE_IndustrialSieveGrate = GregtechItemList.Casing_SifterGrate.get(Casing_Amount);
-
- //Industrial Sieve
- RecipeUtils.addShapedGregtechRecipe(
- "plateEglinSteel", CI.circuitTier3, "plateEglinSteel",
- cableTier4, EV_MACHINE_Sifter, cableTier4,
- "plateEglinSteel", CI.circuitTier3, "plateEglinSteel",
- RECIPE_IndustrialSieveController);
- //Industrial Sieve Casing
- RecipeUtils.addShapedGregtechRecipe(
- "plateEglinSteel", "plateEglinSteel", "plateEglinSteel",
- "plateEglinSteel", "frameGtTumbaga", "plateEglinSteel",
- "plateEglinSteel", "plateEglinSteel", "plateEglinSteel",
- RECIPE_IndustrialSieveFrame);
- //Industrial Sieve Grate
- RecipeUtils.addShapedGregtechRecipe(
- "frameGtEglinSteel", "wireFineSteel", "frameGtEglinSteel",
- "wireFineSteel", "wireFineSteel", "wireFineSteel",
- "frameGtEglinSteel", "wireFineSteel", "frameGtEglinSteel",
- RECIPE_IndustrialSieveGrate);
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer){
- //Industrial Tree Farmer
- RECIPE_TreeFarmController = GregtechItemList.Industrial_TreeFarm.get(1);
- RECIPE_TreeFarmFrame = GregtechItemList.Casing_PLACEHOLDER_TreeFarmer.get(Casing_Amount);
- //Industrial Tree Farm Controller
- if (!GTNH) {
- RecipeUtils.addShapedGregtechRecipe(
- "plateEglinSteel", "rotorEglinSteel", "plateEglinSteel",
- "cableGt02Steel", "pipeMediumSteel", "cableGt02Steel",
- "plateEglinSteel", CI.machineCasing_MV, "plateEglinSteel",
- RECIPE_TreeFarmController);
- }
- else {
- RecipeUtils.addShapedGregtechRecipe(
- ItemList.Field_Generator_IV.get(1), ALLOY.INCOLOY_MA956.getRotor(1), ItemList.Field_Generator_IV.get(1),
- ALLOY.NITINOL_60.getPlate(1), GregtechItemList.GTPP_Casing_IV.get(1), ALLOY.NITINOL_60.getPlate(1),
- ItemList.Field_Generator_IV.get(1), ALLOY.INCONEL_792.getComponentByPrefix(OrePrefixes.pipeMedium, 1), ItemList.Field_Generator_IV.get(1),
- RECIPE_TreeFarmController);
- }
- //Industrial Tree Farm Frame
- GT_Values.RA.addAssemblerRecipe(
- new ItemStack[] {
- GT_Utility.getIntegratedCircuit(2),
- ALLOY.INCONEL_625.getFrameBox(1),
- ALLOY.HASTELLOY_X.getComponentByPrefix(OrePrefixes.pipeTiny, 1),
- ItemList.Electric_Pump_EV.get(2),
- ItemList.HV_Coil.get(4),
- ItemList.IC2_Plantball.get(8),
- GT_OreDictUnificator.get(OrePrefixes.plank, Materials.Wood, 6),
- },
- GT_ModHandler.getDistilledWater(8000),
- RECIPE_TreeFarmFrame,
- 60,
- 1960
- );
- }
-
- if (CORE.ConfigSwitches.enableMachine_Tesseracts){
- //Tesseracts
- RECIPE_TesseractGenerator = GregtechItemList.GT4_Tesseract_Generator.get(1);
- RECIPE_TesseractTerminal = GregtechItemList.GT4_Tesseract_Terminal.get(1);
- //Tesseract Generator
- RecipeUtils.addShapedGregtechRecipe(
- "plateTitanium","circuitMaster","plateTitanium",
- "circuitMaster",ItemUtils.getSimpleStack(Blocks.ender_chest),"circuitMaster",
- "plateTitanium",GregtechItemList.Gregtech_Computer_Cube.get(1),"plateTitanium",
- RECIPE_TesseractGenerator);
- //Tesseract Terminal
- RecipeUtils.addShapedGregtechRecipe(
- "plateTitanium","circuitElite","plateTitanium",
- "circuitElite",ItemUtils.getSimpleStack(Blocks.ender_chest),"circuitElite",
- "plateTitanium",CI.machineHull_EV,"plateTitanium",
- RECIPE_TesseractTerminal);
- }
-
- if (CORE.ConfigSwitches.enableMachine_SimpleWasher){
- ItemStack plateWrought = ItemUtils.getItemStackOfAmountFromOreDict("plateWroughtIron", 1);
- ItemStack washerPipe;
-
-
- if (CORE.ConfigSwitches.enableCustom_Pipes){
- washerPipe = ItemUtils.getItemStackOfAmountFromOreDict("pipeLargeClay", 1);
- RecipeUtils.addShapedGregtechRecipe(
- plateWrought, CI.electricPump_LV, plateWrought,
- plateWrought, washerPipe, plateWrought,
- plateWrought, CI.machineCasing_ULV, plateWrought,
- GregtechItemList.SimpleDustWasher_ULV.get(1));
- }
- //Add Recipe
- washerPipe = ItemUtils.getItemStackOfAmountFromOreDict("pipeLargeCopper", 1);
- RecipeUtils.addShapedGregtechRecipe(
- plateWrought, CI.electricPump_LV, plateWrought,
- plateWrought, washerPipe, plateWrought,
- plateWrought, CI.machineCasing_ULV, plateWrought,
- GregtechItemList.SimpleDustWasher_ULV.get(1));
-
- int aSimpleWasherTier = 2;
- int aSlot = 0;
- ItemStack[][] aInputsForSimpleWashers = new ItemStack[4][6];
-
- aInputsForSimpleWashers[0] = new ItemStack[] {
- CI.getTieredMachineHull(2),
- CI.getTieredComponent(OrePrefixes.screw, 2, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.plate, 1, GTNH ? 8 : 4),
- CI.getTieredComponent(OrePrefixes.rod, 2, GTNH ? 4 : 2),
- CI.getTieredComponent(OrePrefixes.circuit, 2, GTNH ? 3 : 1),
-
- };
- aInputsForSimpleWashers[1] = new ItemStack[] {
- CI.getTieredMachineHull(4),
- CI.getTieredComponent(OrePrefixes.screw, 4, GTNH ? 24 : 12),
- CI.getTieredComponent(OrePrefixes.plate, 3, GTNH ? 12 : 6),
- CI.getTieredComponent(OrePrefixes.rod, 4, GTNH ? 6 : 3),
- CI.getTieredComponent(OrePrefixes.circuit, 4, GTNH ? 4 : 2),
-
- };
- aInputsForSimpleWashers[2] = new ItemStack[] {
- CI.getTieredMachineHull(6),
- CI.getTieredComponent(OrePrefixes.screw, 6, GTNH ? 48 : 24),
- CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 8 : 4),
- CI.getTieredComponent(OrePrefixes.circuit, 6, GTNH ? 6 : 3),
-
- };
- aInputsForSimpleWashers[3] = new ItemStack[] {
- CI.getTieredMachineHull(8),
- CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 64 : 32),
- CI.getTieredComponent(OrePrefixes.plate, 7, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.rod, 8, GTNH ? 10 : 5),
- CI.getTieredComponent(OrePrefixes.circuit, 8, GTNH ? 8 : 4),
-
- };
-
-
-
-
-
-
- ItemStack[] aSimpleWashers = new ItemStack[] {GregtechItemList.SimpleDustWasher_MV.get(1), GregtechItemList.SimpleDustWasher_EV.get(1), GregtechItemList.SimpleDustWasher_LuV.get(1), GregtechItemList.SimpleDustWasher_UV.get(1)};
- for (int i=0;i<4;i++) {
-
- CORE.RA.addSixSlotAssemblingRecipe(
- aInputsForSimpleWashers[aSlot],
- CI.getTieredFluid(aSimpleWasherTier, 144 * aSimpleWasherTier),
- aSimpleWashers[aSlot],
- 20 * 15 * aSimpleWasherTier,
- (int) GT_Values.V[aSimpleWasherTier]);
-
- aSimpleWasherTier += 2;
- aSlot++;
- }
- }
-
- if (CORE.ConfigSwitches.enableMachine_Pollution && PollutionUtils.isPollutionEnabled()){
-
- RecipeUtils.addShapedGregtechRecipe(
- "plateCarbon", "plateCarbon", "plateCarbon",
- "dustCarbon", "dustCarbon", "dustCarbon",
- "plateCarbon", "plateCarbon", "plateCarbon",
- ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1));
-
- RecipeUtils.addShapedGregtechRecipe(
- "plateCarbon", "plateCarbon", "plateCarbon",
- "cellLithiumPeroxide", "dustCarbon", "cellLithiumPeroxide",
- "plateCarbon", "plateCarbon", "plateCarbon",
- ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1));
-
- //Pollution Detector
- RecipeUtils.addShapedGregtechRecipe(
- "plateSteel", CI.sensor_LV, "plateSteel",
- "plateSteel", CI.electricMotor_LV, "plateSteel",
- CI.getTieredCircuit(1), CI.machineHull_LV, CI.getTieredCircuit(1),
- GregtechItemList.Pollution_Detector.get(1));
-
- //ULV
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[0], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1), CI.component_Plate[0],
- CI.component_Plate[0], CI.electricMotor_ULV, CI.component_Plate[0],
- CI.getTieredCircuit(0), CI.machineHull_ULV, CI.getTieredCircuit(0),
- GregtechItemList.Pollution_Cleaner_ULV.get(1));
- //LV
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[1], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1), CI.component_Plate[1],
- CI.component_Plate[1], CI.electricMotor_LV, CI.component_Plate[1],
- CI.getTieredCircuit(1), CI.machineHull_LV, CI.getTieredCircuit(1),
- GregtechItemList.Pollution_Cleaner_LV.get(1));
- //MV
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[2], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1), CI.component_Plate[2],
- CI.component_Plate[2], CI.electricMotor_MV, CI.component_Plate[2],
- CI.getTieredCircuit(2), CI.machineHull_MV, CI.getTieredCircuit(2),
- GregtechItemList.Pollution_Cleaner_MV.get(1));
- //HV
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[3], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1), CI.component_Plate[3],
- CI.component_Plate[3], CI.electricMotor_HV, CI.component_Plate[3],
- CI.getTieredCircuit(3), CI.machineHull_HV, CI.getTieredCircuit(3),
- GregtechItemList.Pollution_Cleaner_HV.get(1));
- //EV
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[4], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1), CI.component_Plate[4],
- CI.component_Plate[4], CI.electricMotor_EV, CI.component_Plate[4],
- CI.getTieredCircuit(4), CI.machineHull_EV, CI.getTieredCircuit(4),
- GregtechItemList.Pollution_Cleaner_EV.get(1));
- //IV
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[5], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1), CI.component_Plate[5],
- CI.component_Plate[5], CI.electricMotor_IV, CI.component_Plate[5],
- CI.getTieredCircuit(5), CI.machineHull_IV, CI.getTieredCircuit(5),
- GregtechItemList.Pollution_Cleaner_IV.get(1));
- //LuV
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[6], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1), CI.component_Plate[6],
- CI.component_Plate[6], CI.electricMotor_LuV, CI.component_Plate[6],
- CI.getTieredCircuit(6), CI.machineHull_LuV, CI.getTieredCircuit(6),
- GregtechItemList.Pollution_Cleaner_LuV.get(1));
- //ZPM
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[7], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1), CI.component_Plate[7],
- CI.component_Plate[7], CI.electricMotor_ZPM, CI.component_Plate[7],
- CI.getTieredCircuit(7), CI.machineHull_ZPM, CI.getTieredCircuit(7),
- GregtechItemList.Pollution_Cleaner_ZPM.get(1));
- //UV
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[8], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1), CI.component_Plate[8],
- CI.component_Plate[8], CI.electricMotor_UV, CI.component_Plate[8],
- CI.getTieredCircuit(8), CI.machineHull_UV, CI.getTieredCircuit(8),
- GregtechItemList.Pollution_Cleaner_UV.get(1));
- //MAX
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[9], ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1), CI.component_Plate[9],
- CI.component_Plate[9], CI.electricMotor_MAX, CI.component_Plate[9],
- CI.getTieredCircuit(9), CI.machineHull_MAX, CI.getTieredCircuit(9),
- GregtechItemList.Pollution_Cleaner_MAX.get(1));
-
-
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_ThermalBoiler){
- RECIPE_ThermalBoilerController = GregtechItemList.GT4_Thermal_Boiler.get(1);
- RECIPE_ThermalBoilerCasing = GregtechItemList.Casing_ThermalContainment.get(GTNH ? 1 : 2);
- ItemStack centrifugeHV = GTNH ? ItemList.Machine_IV_Centrifuge.get(1) : ItemList.Machine_EV_Centrifuge.get(1);
-
- RecipeUtils.addShapedGregtechRecipe(
- "craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator",
- "gearGtTitanium", CI.getTieredCircuitOreDictName(6), "gearGtTitanium",
- "craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator",
- RECIPE_ThermalBoilerController);
-
- RecipeUtils.addShapedGregtechRecipe(
- "craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator",
- "gearGtTungstenSteel", CI.getTieredCircuitOreDictName(5), "gearGtTungstenSteel",
- "craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator",
- RECIPE_ThermalBoilerController);
-
- RecipeUtils.addShapedGregtechRecipe(
- ALLOY.MARAGING350.getPlate(1), "plateStainlessSteel", ALLOY.MARAGING350.getPlate(1),
- "circuitAdvanced", CI.machineCasing_HV, "circuitAdvanced",
- ALLOY.MARAGING350.getPlate(1), ALLOY.MARAGING350.getPlate(1), ALLOY.MARAGING350.getPlate(1),
- RECIPE_ThermalBoilerCasing);
-
- //Lava Filter Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- CI.getNumberedCircuit(18),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", GTNH ? 64 : 32),
- ItemUtils.getItemStackOfAmountFromOreDict("wireFineSteel", GTNH ? 64 : 32),
- ItemUtils.getItemStackOfAmountFromOreDict("ringTumbaga", GTNH ? 32 : 16),
- ItemUtils.getItemStackOfAmountFromOreDict("foilCopper", GTNH ? 8 : 4),
- ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemPartCarbonMesh", "RawCarbonMesh", 0, 64),
-
- },
- CI.getTieredFluid(3, 144),
- ItemUtils.getSimpleStack(ModItems.itemLavaFilter, GTNH ? 8 : 16),
- 1600,
- 240
- );
- }
-
- //Air Intake Hatch
- ItemList FluidRegulator_IV = ItemUtils.getValueOfItemList("FluidRegulator_IV", ItemList.Pump_IV);
- ItemStack aTieredFluidRegulator = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? FluidRegulator_IV.get(1) : ItemList.Pump_IV.get(1);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[6], ItemList.Casing_Grate.get(1), CI.component_Plate[6],
- CI.component_Plate[6], CI.getFluidRegulator(5, 1), CI.component_Plate[6],
- CI.getTieredCircuit(5), ItemList.Hatch_Input_IV.get(1), CI.getTieredCircuit(5),
- GregtechItemList.Hatch_Air_Intake.get(1));
-
-
- RecipeUtils.addShapedGregtechRecipe(
- CI.getPlate(6, 1), ItemList.Casing_Gearbox_Titanium.get(1), CI.getPlate(6, 1),
- CI.getPlate(6, 1), CI.getFluidRegulator(5, 1), CI.getPlate(6, 1),
- CI.getTieredCircuit(6), ItemList.Hatch_Input_IV.get(1), CI.getTieredCircuit(6),
- GregtechItemList.Hatch_Reservoir.get(1));
-
- RecipeUtils.addShapedGregtechRecipe(
- CI.getPlate(7, 1), GregtechItemList.Hatch_Air_Intake.get(1), CI.getPlate(7, 1),
- CI.getPlate(7, 1), CI.getFluidRegulator(7, 1), CI.getPlate(7, 1),
- CI.getTieredCircuit(7), ItemList.Hatch_Input_ZPM.get(1), CI.getTieredCircuit(7),
- GregtechItemList.Hatch_Air_Intake_Extreme.get(1));
-
- if (CORE.ConfigSwitches.enableMultiblock_LiquidFluorideThoriumReactor){
-
- //Thorium Reactor
- RECIPE_LFTRController = GregtechItemList.ThoriumReactor.get(1);
- RECIPE_LFTRInnerCasing = GregtechItemList.Casing_Reactor_II.get(1); //Zeron
- RECIPE_LFTROuterCasing = GregtechItemList.Casing_Reactor_I.get(1); //Hastelloy
-
- ItemStack controlCircuit = ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR);
- if(!GTNH) {
- RecipeUtils.addShapedGregtechRecipe(
- controlCircuit, "cableGt12NaquadahAlloy", controlCircuit,
- "plateDoubleHastelloyN", GregtechItemList.Gregtech_Computer_Cube.get(1), "plateDoubleHastelloyN",
- "plateThorium232", CI.machineHull_EV, "plateThorium232",
- RECIPE_LFTRController);
- } else {
- RecipeUtils.addShapedGregtechRecipe(
- controlCircuit, "cableGt12Naquadah", controlCircuit,
- "plateDoubleHastelloyN", GregtechItemList.Gregtech_Computer_Cube.get(1), "plateDoubleHastelloyN",
- "plateThorium232", CI.machineHull_IV, "plateThorium232",
- RECIPE_LFTRController);
- }
- RecipeUtils.addShapedGregtechRecipe(
- "plateDoubleHastelloyC276", CI.craftingToolScrewdriver, "plateDoubleHastelloyC276",
- "gearGtTalonite", CI.fieldGenerator_MV, "gearGtTalonite",
- "plateDoubleHastelloyC276", CI.craftingToolHammer_Hard, "plateDoubleHastelloyC276",
- RECIPE_LFTRInnerCasing);
-
- ItemStack IC2HeatPlate = ItemUtils.getItemStackFromFQRN("IC2:reactorPlatingHeat", 1);
- RecipeUtils.addShapedGregtechRecipe(
- "plateDoubleHastelloyN", IC2HeatPlate, "plateDoubleHastelloyN",
- IC2HeatPlate, "frameGtHastelloyC276", IC2HeatPlate,
- "plateDoubleHastelloyN", IC2HeatPlate, "plateDoubleHastelloyN",
- RECIPE_LFTROuterCasing);
-
- //LFTR Control Circuit
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 1),
- CI.fieldGenerator_HV
- },
- null, controlCircuit, 240*20, 500);
-
-
- //Fission Fuel Plant
- RecipeUtils.addShapedGregtechRecipe(
- CI.getTieredCircuitOreDictName(5), CI.craftingToolSolderingIron, CI.getTieredCircuitOreDictName(5),
- "plateDenseTungstenSteel", GregtechItemList.Gregtech_Computer_Cube.get(1), "plateDenseTungstenSteel",
- "gearGtStellite", CI.machineHull_IV, "gearGtStellite",
- GregtechItemList.Industrial_FuelRefinery.get(1));
-
- ItemStack mInnerTank;
-
- if (GTNH || !CORE.ConfigSwitches.enableMachine_FluidTanks){
- mInnerTank = ItemList.Quantum_Tank_LV.get(1);
- }
- else {
- mInnerTank = GregtechItemList.GT_FluidTank_EV.get(1);
- }
-
- //Incoloy Casing
- RecipeUtils.addShapedGregtechRecipe(
- "plateIncoloyDS", "pipeHugeStaballoy", "plateIncoloyDS",
- "gearGtIncoloyDS", mInnerTank, "gearGtIncoloyDS",
- "plateIncoloyDS", "pipeHugeStaballoy", "plateIncoloyDS",
- GregtechItemList.Casing_Refinery_Internal.get(Casing_Amount));
-
- //Hastelloy-N Sealant Casing
- RecipeUtils.addShapedGregtechRecipe(
- "plateIncoloyMA956", "plateHastelloyN", "plateIncoloyMA956",
- "plateHastelloyN", "frameGtHastelloyC276", "plateHastelloyN",
- "plateIncoloyMA956", "plateHastelloyN", "plateIncoloyMA956",
- GregtechItemList.Casing_Refinery_External.get(Casing_Amount));
-
- //Hastelloy-X Structural Casing
- RecipeUtils.addShapedGregtechRecipe(
- "ringInconel792", "gearGtHastelloyX", CI.component_Plate[5],
- CI.craftingToolHammer_Hard, "frameGtHastelloyC276", CI.craftingToolWrench,
- CI.component_Plate[5], CI.getTieredMachineCasing(4), "ringInconel792",
- GregtechItemList.Casing_Refinery_Structural.get(Casing_Amount));
-
- RecipeUtils.addShapedGregtechRecipe(
- CI.getPlate(5, 1), ALLOY.HASTELLOY_X.getPlateDouble(1), CI.getPlate(5, 1),
- CI.getPlate(5, 1), CI.getTieredMachineCasing(5), CI.getPlate(5, 1),
- CI.getRobotArm(5, 1), ItemList.Casing_FrostProof.get(1), CI.getRobotArm(5, 1),
- GregtechItemList.ColdTrap_IV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.getPlate(7, 1), ALLOY.HS188A.getPlateDouble(1), CI.getPlate(7, 1),
- CI.getPlate(7, 1), GregtechItemList.ColdTrap_IV.get(1), CI.getPlate(7, 1),
- CI.getRobotArm(7, 1), ItemList.Casing_FrostProof.get(1), CI.getRobotArm(7, 1),
- GregtechItemList.ColdTrap_ZPM.get(1));
-
- RecipeUtils.addShapedGregtechRecipe(
- CI.getFieldGenerator(3, 1), CI.getRobotArm(5, 1), CI.getPlate(5, 1),
- ALLOY.HASTELLOY_N.getPlateDouble(1), ItemList.Machine_IV_ChemicalReactor.get(1), ALLOY.HASTELLOY_N.getPlateDouble(1),
- CI.getPlate(5, 1), ALLOY.HASTELLOY_N.getPlateDouble(1), CI.getFieldGenerator(3, 1),
- GregtechItemList.ReactorProcessingUnit_IV.get(1));
- RecipeUtils.addShapedGregtechRecipe(
- CI.getFieldGenerator(5, 1), CI.getRobotArm(7, 1), CI.getPlate(7, 1),
- ALLOY.HS188A.getPlateDouble(1), GregtechItemList.ReactorProcessingUnit_IV.get(1), ALLOY.HS188A.getPlateDouble(1),
- CI.getPlate(7, 1), ALLOY.HS188A.getPlateDouble(1), CI.getFieldGenerator(5, 1),
- GregtechItemList.ReactorProcessingUnit_ZPM.get(1));
-
- }
-
- //Shelves
- RecipeUtils.addShapedGregtechRecipe(
- "screwWood", "plateWood", "screwWood",
- CI.craftingToolHammer_Hard, "frameGtWood", CI.craftingToolHammer_Soft,
- "plateWood", "plateWood", "plateWood",
- GregtechItemList.GT4_Shelf.get(2));
-
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {GregtechItemList.GT4_Shelf.get(1)}, GregtechItemList.GT4_Shelf_Compartment.get(1));
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {GregtechItemList.GT4_Shelf_Compartment.get(1)}, GregtechItemList.GT4_Shelf_Desk.get(1));
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {GregtechItemList.GT4_Shelf_Desk.get(1)}, GregtechItemList.GT4_Shelf_Iron.get(1));
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {GregtechItemList.GT4_Shelf_Iron.get(1)}, GregtechItemList.GT4_Shelf_FileCabinet.get(1));
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {GregtechItemList.GT4_Shelf_FileCabinet.get(1)}, GregtechItemList.GT4_Shelf.get(1));
-
-
- //Cyclotron
- if (CORE.ConfigSwitches.enableMultiblock_Cyclotron){
- RECIPE_CyclotronController = GregtechItemList.COMET_Cyclotron.get(1);
- RECIPE_CyclotronOuterCasing = GregtechItemList.Casing_Cyclotron_External.get(Casing_Amount);
- RECIPE_CyclotronInnerCoil = GregtechItemList.Casing_Cyclotron_Coil.get(1);
-
- //Outer Casing
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemList.Casing_FrostProof.get(1),
- ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 0, GTNH ? 8 : 4),
- ALLOY.INCOLOY_DS.getPlate(GTNH ? 16 : 8),
- ALLOY.INCONEL_690.getScrew(GTNH ? 32 : 16),
- ALLOY.EGLIN_STEEL.getLongRod(GTNH ? 16 : 4),
- CI.getElectricPiston(3, GTNH ? 4 : 2)
- },
- ALLOY.ZIRCONIUM_CARBIDE.getFluidStack(144 * 8), //Input Fluid
- RECIPE_CyclotronOuterCasing,
- 30 * 20 * 2,
- MaterialUtils.getVoltageForTier(4));
-
-
- //Inner Coil
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemList.Casing_Coil_Nichrome.get(1),
- ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 1, GTNH ? 32 : 8),
- ALLOY.INCOLOY_MA956.getPlate(GTNH ? 16 : 8),
- ALLOY.TANTALLOY_61.getBolt(GTNH ? 32 : 16),
- ALLOY.INCOLOY_020.getScrew(GTNH ? 64 : 32),
- CI.getFieldGenerator(4, GTNH ? 2 : 1)
- },
- ALLOY.HG1223.getFluidStack(144 * 5), //Input Fluid
- RECIPE_CyclotronInnerCoil,
- 60 * 20 * 2,
- MaterialUtils.getVoltageForTier(5));
-
-
- //Controller
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.machineHull_IV,
- ItemUtils.getSimpleStack(RECIPE_CyclotronInnerCoil, GTNH ? 4 : 2),
- ALLOY.INCOLOY_020.getPlate(GTNH ? 16 : 8),
- ALLOY.TANTALLOY_61.getGear(GTNH ? 4 : 2),
- ALLOY.INCOLOY_MA956.getScrew(GTNH ? 64 : 16),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 6 : 5), GTNH ? 8 : 16)
- },
- ALLOY.INCOLOY_020.getFluidStack(144 * 9), //Input Fluid
- RECIPE_CyclotronController,
- 60 * 20 * 5,
- MaterialUtils.getVoltageForTier(5));
- }
-
- // Mazut
- GT_ModHandler.addCraftingRecipe(
- GregtechItemList.Controller_LargeSemifluidGenerator.get(1L),
- CI.bitsd,
- new Object[]{
- "PCP",
- "EME",
- "GWG",
- 'M', ItemList.Hull_EV,
- 'P', ItemList.Electric_Piston_EV,
- 'E', ItemList.Electric_Pump_EV,
- 'C', OrePrefixes.circuit.get(Materials.Data),
- 'W', OrePrefixes.cableGt08.get(Materials.Electrum),
- 'G', ALLOY.INCONEL_792.getGear(1)
- });
-
-
- if (CORE.ConfigSwitches.enableMultiblock_PowerSubstation){
- RecipeUtils.addShapedRecipe(
- "screwTitanium", "plateIncoloy020", "screwTitanium",
- "plateIncoloy020", "frameGtIncoloyMA956", "plateIncoloy020",
- "screwTitanium", "plateIncoloy020", "screwTitanium",
- GregtechItemList.Casing_Power_SubStation.get(Casing_Amount));
-
- ItemStack mBattery = ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR);
-
- RecipeUtils.addShapedRecipe(
- "plateIncoloyMA956", mBattery, "plateIncoloyMA956",
- GregtechItemList.Casing_Power_SubStation.get(1), GregtechItemList.Casing_Vanadium_Redox.get(1), GregtechItemList.Casing_Power_SubStation.get(1),
- "plateIncoloy020", "plateIncoloyMA956", "plateIncoloy020",
- GregtechItemList.PowerSubStation.get(1));
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialThermalCentrifuge){
- RecipeUtils.addShapedRecipe(
- "plateRedSteel", CI.craftingToolHammer_Hard, "plateRedSteel",
- "plateRedSteel", "frameGtBlackSteel", "plateRedSteel",
- "plateRedSteel", CI.craftingToolWrench, "plateRedSteel",
- GregtechItemList.Casing_ThermalCentrifuge.get(Casing_Amount));
-
- RecipeUtils.addShapedRecipe(
- "plateRedSteel","circuitData","plateRedSteel",
- "stickTalonite",EV_MACHINE_ThermalCentrifuge,"stickTalonite",
- "plateRedSteel","gearGtTalonite","plateRedSteel",
- GregtechItemList.Industrial_ThermalCentrifuge.get(1));
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialWashPlant){
- RecipeUtils.addShapedRecipe(
- "plateGrisium", CI.craftingToolHammer_Hard, "plateGrisium",
- "plateTalonite", "frameGtGrisium", "plateTalonite",
- "plateGrisium", CI.craftingToolWrench, "plateGrisium",
- GregtechItemList.Casing_WashPlant.get(Casing_Amount));
-
- RecipeUtils.addShapedRecipe(
- "plateGrisium",CI.electricPump_MV,"plateGrisium",
- "plateTalonite",EV_MACHINE_OreWasher,"plateTalonite",
- "plateGrisium","circuitData","plateGrisium",
- GregtechItemList.Industrial_WashPlant.get(1));
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_LargeAutoCrafter) {
-
- ItemStack aCoreBlock = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK
- ? ItemUtils.getValueOfItemList("Block_IridiumTungstensteel", 1, ItemUtils.getItemStackOfAmountFromOreDict("blockOsmiridium", 1))
- : ItemUtils.getItemStackOfAmountFromOreDict("blockOsmiridium", 1);
-
- aCoreBlock.stackSize = GTNH ? 2 : 1;
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getSimpleStack(GregtechItemList.Casing_Multi_Use.get(1), GTNH ? 2 : 1),
- aCoreBlock,
- CI.getTieredComponent(OrePrefixes.circuit, GTNH ? 3 : 2, 16),
- CI.getTieredComponent(OrePrefixes.screw, GTNH ? 6 : 5, 32),
- CI.getTieredComponent(OrePrefixes.bolt, GTNH ? 6 : 5, 12),
- CI.getTieredComponent(OrePrefixes.plate, GTNH ? 7 : 6, 8), },
- CI.getTertiaryTieredFluid(6, 144 * (GTNH ? 12 : 4)),
- GregtechItemList.Casing_Autocrafter.get(Casing_Amount), 20 * 60 * 2,
- MaterialUtils.getVoltageForTier(GTNH ? 6 : 5));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- GregtechItemList.Casing_Refinery_Structural.get(4),
- ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR, GTNH ? 2 : 1),
- CI.getTieredComponent(OrePrefixes.cableGt08, GTNH ? 7 : 6, GTNH ? 32 : 16),
- CI.getTransmissionComponent(GTNH ? 6 : 5, 2),
- GregtechItemList.Gregtech_Computer_Cube.get(1),
- },
- CI.getTieredFluid(7, 144 * (GTNH ? 32 : 8)), GregtechItemList.GT4_Multi_Crafter.get(1),
- 20 * 60 * 5, MaterialUtils.getVoltageForTier(GTNH ? 6 : 5));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getSimpleStack(GregtechItemList.Casing_Multi_Use.get(1), Casing_Amount),
- CI.getEmitter(GTNH ? 5 : 4, GTNH ? 4 : 2), CI.getRobotArm(GTNH ? 5 : 4, GTNH ? 4 : 2),
- CI.getTieredComponent(OrePrefixes.circuit, GTNH ? 3 : 2, 8),
- CI.getTieredComponent(OrePrefixes.screw, GTNH ? 4 : 3, 8),
- CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 4), },
- CI.getAlternativeTieredFluid(5, 144 * 4), ItemUtils.getSimpleStack(ModBlocks.blockProjectTable),
- 20 * 30 * 3, MaterialUtils.getVoltageForTier(GTNH ? 5 : 4));
-
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialCuttingMachine){
- ItemStack plate = ALLOY.MARAGING300.getPlate(1);
- RecipeUtils.addShapedRecipe(
- plate, CI.craftingToolHammer_Hard, plate,
- "plateStellite", "frameGtTalonite", "plateStellite",
- plate, CI.craftingToolWrench, plate,
- GregtechItemList.Casing_CuttingFactoryFrame.get(Casing_Amount));
-
- RecipeUtils.addShapedRecipe(
- plate,CI.getTieredCircuit(3),plate,
- "wireFinePlatinum", EV_MACHINE_Cutter, "wireFinePlatinum",
- plate,CI.getTieredCircuit(4),plate,
- GregtechItemList.Industrial_CuttingFactoryController.get(1));
- }
-
- //EV_MACHINE_Extruder
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialExtrudingMachine){
- ItemStack plate = ALLOY.INCONEL_690.getPlate(1);
- RecipeUtils.addShapedRecipe(
- plate, CI.craftingToolHammer_Hard, plate,
- "plateTalonite", "frameGtStaballoy", "plateTalonite",
- plate, CI.craftingToolWrench, plate,
- GregtechItemList.Casing_Extruder.get(Casing_Amount));
-
- RecipeUtils.addShapedRecipe(
- plate,CI.getTieredCircuit(4),plate,
- CI.electricPiston_EV, EV_MACHINE_Extruder, CI.electricPiston_EV,
- plate,CI.getTieredCircuit(4),plate,
- GregtechItemList.Industrial_Extruder.get(1));
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialFishingPort){
- ItemStack plate = ALLOY.AQUATIC_STEEL.getPlate(1);
- RecipeUtils.addShapedRecipe(
- plate, CI.craftingToolHammer_Hard, plate,
- "plateEglinSteel", "frameGtEglinSteel", "plateEglinSteel",
- plate, CI.craftingToolWrench, plate,
- GregtechItemList.Casing_FishPond.get(Casing_Amount));
-
- RecipeUtils.addShapedRecipe(
- plate,CI.getTieredCircuit(3),plate,
- "wireFineElectrum", ItemUtils.getSimpleStack(ModBlocks.blockFishTrap), "wireFineElectrum",
- plate,CI.getTieredCircuit(2),plate,
- GregtechItemList.Industrial_FishingPond.get(1));
- }
-
- if (true) {
- //Advanced Vacuum Freezer
- ItemStack plate = ALLOY.HG1223.getPlateDouble(1);
- ItemStack gear = ALLOY.INCOLOY_MA956.getGear(1);
- ItemStack frame = ALLOY.LAFIUM.getFrameBox(1);
- ItemStack cell1 = ItemList.Reactor_Coolant_He_6.get(1);
- ItemStack cell2 = ItemList.Reactor_Coolant_NaK_6.get(1);
-
- RecipeUtils.addShapedRecipe(
- plate, gear, plate,
- cell1, frame, cell2,
- plate, gear, plate,
- GregtechItemList.Casing_AdvancedVacuum.get(Casing_Amount));
- RecipeUtils.addShapedRecipe(
- gear,CI.getTieredCircuit(6),gear,
- CI.electricPiston_IV, GregtechItemList.Casing_AdvancedVacuum.get(1), CI.electricPiston_IV,
- plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate,
- GregtechItemList.Industrial_Cryogenic_Freezer.get(1));
-
- //Advanced Blast Furnace
- plate = ALLOY.HASTELLOY_N.getPlateDouble(1);
- gear = ALLOY.HASTELLOY_W.getGear(1);
- frame = ALLOY.HASTELLOY_X.getFrameBox(1);
- cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1);
- cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1);
- ItemStack cell3 = ItemUtils.simpleMetaStack("IC2:reactorVentDiamond:1:1", 1, 1);
-
- RecipeUtils.addShapedRecipe(
- plate, cell1, plate,
- cell3, frame, cell2,
- plate, gear, plate,
- GregtechItemList.Casing_Adv_BlastFurnace.get(Casing_Amount));
- RecipeUtils.addShapedRecipe(
- gear,CI.getTieredCircuit(6),gear,
- CI.robotArm_IV, GregtechItemList.Casing_Adv_BlastFurnace.get(1), CI.robotArm_IV,
- plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate,
- GregtechItemList.Machine_Adv_BlastFurnace.get(1));
-
- //Advanced Implosion Compressor
- plate = ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 1);
- gear = ALLOY.LEAGRISIUM.getGear(1);
- frame = ALLOY.CINOBITE.getFrameBox(1);
- cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1);
- cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1);
-
- RecipeUtils.addShapedRecipe(
- gear,CI.getTieredCircuit(6),gear,
- CI.fieldGenerator_IV, CI.machineHull_ZPM, CI.robotArm_IV,
- plate, GregtechItemList.Gregtech_Computer_Cube.get(1), plate,
- GregtechItemList.Machine_Adv_ImplosionCompressor.get(1));
-
-
-
- //Supply Depot
- plate = ALLOY.TUNGSTEN_CARBIDE.getPlateDouble(1);
- gear = ALLOY.TRINIUM_TITANIUM.getRing(1);
- frame = ALLOY.TUNGSTEN_CARBIDE.getFrameBox(1);
- cell1 = CI.conveyorModule_EV;
- cell2 = CI.electricMotor_IV;
- ItemStack casingAmazon = GregtechItemList.Casing_AmazonWarehouse.get(1);
- ItemStack aTieredUnboxinator = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? ItemUtils.getValueOfItemList("Machine_LuV_Unboxinator", 1, ItemList.Machine_IV_Unboxinator.get(1)) : ItemList.Machine_IV_Unboxinator.get(1);
-
-
- RecipeUtils.addShapedRecipe(
- plate, ItemUtils.getItemStackOfAmountFromOreDict("cableGt12VanadiumGallium", 1), plate,
- cell1, frame, cell2,
- plate, gear, plate,
- GregtechItemList.Casing_AmazonWarehouse.get(Casing_Amount));
- RecipeUtils.addShapedRecipe(
- casingAmazon, CI.getTieredCircuit(7), casingAmazon,
- CI.robotArm_LuV, aTieredUnboxinator, CI.robotArm_LuV,
- CI.conveyorModule_LuV, GregtechItemList.Gregtech_Computer_Cube.get(1), CI.conveyorModule_LuV,
- GregtechItemList.Amazon_Warehouse_Controller.get(1));
-
-
- //Industrial Mixing Machine
- RecipeUtils.addShapedRecipe(
- "plateStaballoy",CI.getTieredCircuit(5),"plateStaballoy",
- "plateZirconiumCarbide", EV_MACHINE_Mixer, "plateZirconiumCarbide",
- "plateStaballoy",CI.getTieredCircuit(5),"plateStaballoy",
- GregtechItemList.Industrial_Mixer.get(1));
-
- }
-
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialMultiMachine){
- ItemStack plate = ALLOY.STABALLOY.getPlate(1);
-
-
- ItemStack o_Compressor;
- ItemStack o_Lathe;
- ItemStack o_Electromagnet;
- ItemStack o_Fermenter;
- ItemStack o_Distillery;
- ItemStack o_Extractor;
- if (GTNH) {
- o_Compressor = ItemList.Machine_IV_Compressor.get(1);
- o_Lathe = ItemList.Machine_IV_Lathe.get(1);
- o_Electromagnet = ItemList.Machine_IV_Polarizer.get(1);
- o_Fermenter = ItemList.Machine_IV_Fermenter.get(1);
- o_Distillery = ItemList.Machine_IV_FluidExtractor.get(1);
- o_Extractor = ItemList.Machine_IV_Extractor.get(1);
- }
- else {
- o_Compressor = ItemList.Machine_EV_Compressor.get(1);
- o_Lathe = ItemList.Machine_EV_Lathe.get(1);
- o_Electromagnet = ItemList.Machine_EV_Polarizer.get(1);
- o_Fermenter = ItemList.Machine_EV_Fermenter.get(1);
- o_Distillery = ItemList.Machine_EV_FluidExtractor.get(1);
- o_Extractor = ItemList.Machine_EV_Extractor.get(1);
- }
- RecipeUtils.addShapedRecipe(
- plate, CI.craftingToolHammer_Hard, plate,
- "plateStainlessSteel", "frameGtZirconiumCarbide", "plateStainlessSteel",
- plate, CI.craftingToolWrench, plate,
- GregtechItemList.Casing_Multi_Use.get(Casing_Amount));
-
- RecipeUtils.addShapedRecipe(
- o_Compressor, o_Lathe, o_Electromagnet,
- plate, ItemUtils.getSimpleStack(ModBlocks.blockProjectTable), plate,
- o_Fermenter, o_Distillery, o_Extractor,
- GregtechItemList.Industrial_MultiMachine.get(1));
- }
-
-
-
-
- /*
- * 6/1/19 - Content additions
- */
-
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
-
- ItemStack aDrillController = ItemUtils.getValueOfItemList("OreDrill4", ItemList.Hull_UV).get(1);
-
- //Drilling Platform
- /*CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- aDrillController,
- ItemUtils.getItemStackOfAmountFromOreDict("frameGtTriniumNaquadahCarbonite", 3),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(9), 2 * (GTNH ? 4 : 1)),
- ItemUtils.getSimpleStack((GTNH ? CI.conveyorModule_UV : CI.conveyorModule_ZPM), 2 * (GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((GTNH ? CI.electricPump_UV : CI.electricPump_ZPM), 4 * (GTNH ? 2 : 1)),
- },
- ALLOY.LAFIUM.getFluid(144 * 8 * (GTNH ? 2 : 1)),
- GregtechItemList.BedrockMiner_MKI.get(1),
- (int) GT_Values.V[5],
- (int) GT_Values.V[7]);*/
-
- //Drilling Platform Casings
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("frameGtTriniumNaquadahCarbonite", 4),
- ItemUtils.getItemStackOfAmountFromOreDict("plateDoubleTriniumTitaniumAlloy", 1 * (GTNH ? 2 : 1)),
- ItemUtils.getItemStackOfAmountFromOreDict("gearGtPikyonium64B", 2 * (GTNH ? 2 : 1)),
- ALLOY.TRINIUM_REINFORCED_STEEL.getPlateDouble(4 * (GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((GTNH ? CI.machineHull_UV : CI.machineHull_LuV), 1 * (GTNH ? 2 : 1)),
- },
- ALLOY.MARAGING350.getFluidStack(144 * 16 * (GTNH ? 2 : 1)),
- GregtechItemList.Casing_BedrockMiner.get(1),
- (int) GT_Values.V[4],
- (int) GT_Values.V[6]);
-
-
-
-
-
-
-
-
-
- }
-
-
-
-
-
-
-
-
-
-
- }
-
- int aCostMultiplier = GTNH ? 2 : 1;
-
- //Mystic Frame
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- GregtechItemList.Casing_Multi_Use.get(1),
- ItemList.Field_Generator_MV.get(1, CI.circuitTier7),
- ItemList.Field_Generator_HV.get(1, CI.circuitTier7),
- ItemList.Emitter_HV.get(1, CI.circuitTier7),
- ItemList.Sensor_HV.get(1, CI.circuitTier7),
- CI.getTieredComponent(OrePrefixes.plate, 7, 8 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.wireGt08, 8, 4 * aCostMultiplier),
- },
- CI.getTieredFluid(6, (144 * 8)), //Input Fluid
- ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame, 2),
- 45 * 20 * 1 * (6),
- MaterialUtils.getVoltageForTier(6));
- GT_MetaTileEntity_Disassembler.addBlacklist(ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame, 1));
-
-
- //Player Doors
- ItemStack[] aDoorInputs = new ItemStack[] {
- ItemUtils.getSimpleStack(Blocks.log2),
- ItemUtils.getSimpleStack(Blocks.iron_block),
- ItemUtils.getSimpleStack(Blocks.glass),
- ItemUtils.getSimpleStack(Blocks.packed_ice),
- ItemUtils.getSimpleStack(Blocks.cactus),
- };
- ItemStack[] aDoorOutputs = new ItemStack[] {
- ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorWooden),
- ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorIron),
- ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorCustom_Glass),
- ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorCustom_Ice),
- ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorCustom_Cactus),
- };
-
- for (int y = 0; y < aDoorInputs.length; y++) {
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getSimpleStack(Items.iron_door),
- aDoorInputs[y],
- ItemList.Sensor_LV.get(1, CI.circuitTier7),
- CI.getTieredComponent(OrePrefixes.plate, 1, 2 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.wireGt02, 1, 2 * aCostMultiplier),
- ItemUtils.getSimpleStack(Items.redstone, 16)
- },
- CI.getTieredFluid(1, (144 * 2)), //Input Fluid
- aDoorOutputs[y],
- 100,
- MaterialUtils.getVoltageForTier(1));
- }
-
-
-
-
-
-
- Logger.INFO("Done loading recipes for the Various machine blocks.");
- }
-
-
- private static void controlCores() {
-
- Material[] aMat_A = new Material[] {
- ALLOY.POTIN,
- ALLOY.ZIRCONIUM_CARBIDE,
- ALLOY.TANTALLOY_61,
- ALLOY.INCONEL_792,
- ALLOY.STABALLOY,
- ALLOY.TALONITE,
- ALLOY.HASTELLOY_N,
- ALLOY.HG1223,
- ALLOY.LAFIUM,
- ALLOY.PIKYONIUM
- };
- Material[] aMat_B = new Material[] {
- ALLOY.TUMBAGA,
- ALLOY.SILICON_CARBIDE,
- ALLOY.EGLIN_STEEL,
- ALLOY.NICHROME,
- ALLOY.TUNGSTEN_CARBIDE,
- ALLOY.STELLITE,
- ALLOY.HASTELLOY_C276,
- ALLOY.NITINOL_60,
- ALLOY.ZERON_100,
- ALLOY.CINOBITE
- };
-
- Item aBaseCore = ModItems.itemControlCore;
- ItemStack[] aInputPrevTier = new ItemStack[] {
- GTNH ? ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore3", 1) : ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore2", 1),
- ItemUtils.simpleMetaStack(aBaseCore, 0, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 1, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 2, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 3, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 4, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 5, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 6, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 7, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 8, 1),
- };
- ItemStack[] aOutput = new ItemStack[] {
- ItemUtils.simpleMetaStack(aBaseCore, 0, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 1, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 2, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 3, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 4, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 5, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 6, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 7, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 8, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 9, 1),
-
- };
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.machineHull_HV,
- aOutput[1],
- aMat_A[1].getGear(GTNH ? 4 : 2),
- aMat_B[2].getPlateDouble(GTNH ? 16 : 8),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+(GTNH ? "2" : "1"), GTNH ? 4 : 2),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 3 : 2), GTNH ? 10 : 5)
- },
- aMat_B[3].getFluidStack(144 * 8), //Input Fluid
- GregtechItemList.Hatch_Control_Core.get(1),
- 60 * 20 * 5,
- MaterialUtils.getVoltageForTier(3));
-
-
- for (int i = 0; i < 10; i++) {
- boolean aDub = false;
- ItemStack aPlateStack = aMat_A[i].getPlateDouble((GTNH ? 16 : 8) * (aDub ? 2 : 1));
- ItemStack aGearStack = aMat_B[i].getGear(GTNH ? 4 : 2 * (aDub ? 2 : 1));
- ItemStack aRodStack = aMat_A[i].getLongRod(GTNH ? 16 : 8 * (aDub ? 2 : 1));
- ItemStack aScrewStack = aMat_B[i].getScrew(32 * (aDub ? 2 : 1));
-
- if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
- aPlateStack = aMat_A[i].getPlate((GTNH ? 16 : 8) * (aDub ? 2 : 1) * 2);
- if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
- aPlateStack = aMat_B[i].getPlateDouble((GTNH ? 16 : 8) * (aDub ? 2 : 1));
- if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
- aPlateStack = aMat_B[i].getPlate((GTNH ? 16 : 8) * (aDub ? 2 : 1) * 2);
- }
- }
- }
- if (!ItemUtils.checkForInvalidItems(aGearStack)) {
- aGearStack = aMat_A[i].getGear(GTNH ? 8 : 4 * (aDub ? 2 : 1));
- }
- if (!ItemUtils.checkForInvalidItems(aRodStack)) {
- aRodStack = aMat_B[i].getLongRod(GTNH ? 32 : 16 * (aDub ? 2 : 1));
- }
- if (!ItemUtils.checkForInvalidItems(aScrewStack)) {
- aScrewStack = aMat_A[i].getScrew(32 * (aDub ? 2 : 1));
- }
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getEnergyCore(i, 4),
- aPlateStack,
- aGearStack,
- aRodStack,
- aScrewStack,
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName((int) (4+Math.ceil((double) i / (double) 2))), GTNH ? (i * 2 * 2) : (i * 2))
- },
- CI.getTieredFluid(i, 144 * 4 * (i+1)), //Input Fluid
- aOutput[i],
- 60 * 20 * 1 * (i+1),
- MaterialUtils.getVoltageForTier(i));
- }
- }
-
- private static void energyCores() {
-
- //Simpler Recipes for normal Players, Force assembly crafting in GTNH
- if (!GTNH) {
- //Buffer Core
- /*RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[1], cableTier1, CI.component_Plate[1],
- "circuitPrimitive", "plateStaballoy", "circuitPrimitive",
- CI.component_Plate[1], cableTier1, CI.component_Plate[1],
- RECIPE_BufferCore_ULV);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[2], cableTier2, CI.component_Plate[2],
- RECIPE_BufferCore_ULV, CI.machineHull_HV, RECIPE_BufferCore_ULV,
- CI.component_Plate[2], cableTier2, CI.component_Plate[2],
- RECIPE_BufferCore_LV);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[3], cableTier3, CI.component_Plate[3],
- RECIPE_BufferCore_LV, CI.circuitTier2, RECIPE_BufferCore_LV,
- CI.component_Plate[3], cableTier3, CI.component_Plate[3],
- RECIPE_BufferCore_MV);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[4], cableTier4, CI.component_Plate[4],
- RECIPE_BufferCore_MV, CI.circuitTier3, RECIPE_BufferCore_MV,
- CI.component_Plate[4], cableTier4, CI.component_Plate[4],
- RECIPE_BufferCore_HV);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[5], cableTier5, CI.component_Plate[5],
- RECIPE_BufferCore_HV, CI.circuitTier4, RECIPE_BufferCore_HV,
- CI.component_Plate[5], cableTier5, CI.component_Plate[5],
- RECIPE_BufferCore_EV);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[6], cableTier6, CI.component_Plate[6],
- RECIPE_BufferCore_EV, CI.circuitTier5, RECIPE_BufferCore_EV,
- CI.component_Plate[6], cableTier6, CI.component_Plate[6],
- RECIPE_BufferCore_IV);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[7], cableTier7, CI.component_Plate[7],
- RECIPE_BufferCore_IV, CI.circuitTier6, RECIPE_BufferCore_IV,
- CI.component_Plate[7], cableTier7, CI.component_Plate[7],
- RECIPE_BufferCore_LuV);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[8], cableTier8, CI.component_Plate[8],
- RECIPE_BufferCore_LuV, CI.circuitTier7, RECIPE_BufferCore_LuV,
- CI.component_Plate[8], cableTier8, CI.component_Plate[8],
- RECIPE_BufferCore_ZPM);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[9], cableTier9, CI.component_Plate[9],
- RECIPE_BufferCore_ZPM, CI.circuitTier8, RECIPE_BufferCore_ZPM,
- CI.component_Plate[9], cableTier9, CI.component_Plate[9],
- RECIPE_BufferCore_UV);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[10], cableTier10, CI.component_Plate[10],
- RECIPE_BufferCore_UV, CI.circuitTier9, RECIPE_BufferCore_UV,
- CI.component_Plate[10], cableTier10, CI.component_Plate[10],
- RECIPE_BufferCore_MAX);*/
-
-
- /*RecipeUtils.addShapedGregtechRecipe(
- wireTier1, RECIPE_BufferCore_ULV, wireTier1,
- wireTier1, CI.machineCasing_ULV, wireTier1,
- CI.circuitPrimitive, CI.circuitTier1, CI.circuitPrimitive,
- RECIPE_Buffer_ULV);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier2, RECIPE_BufferCore_LV, wireTier2,
- wireTier2, CI.machineCasing_LV, wireTier2,
- CI.circuitTier1, RECIPE_BufferCore_LV, CI.circuitTier1,
- RECIPE_Buffer_LV);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier3, RECIPE_BufferCore_MV, wireTier3,
- wireTier3, CI.machineCasing_MV, wireTier3,
- CI.circuitTier2, RECIPE_BufferCore_MV, CI.circuitTier2,
- RECIPE_Buffer_MV);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier4, RECIPE_BufferCore_HV, wireTier4,
- wireTier4, CI.machineCasing_HV, wireTier4,
- CI.circuitTier3, RECIPE_BufferCore_HV, CI.circuitTier3,
- RECIPE_Buffer_HV);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier5, RECIPE_BufferCore_EV, wireTier5,
- wireTier5, CI.machineCasing_EV, wireTier5,
- CI.circuitTier4, RECIPE_BufferCore_EV, CI.circuitTier4,
- RECIPE_Buffer_EV);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier6, RECIPE_BufferCore_IV, wireTier6,
- wireTier6, CI.machineCasing_IV, wireTier6,
- CI.circuitTier5, RECIPE_BufferCore_IV, CI.circuitTier5,
- RECIPE_Buffer_IV);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier7, RECIPE_BufferCore_LuV, wireTier7,
- wireTier7, CI.machineCasing_LuV, wireTier7,
- CI.circuitTier6, RECIPE_BufferCore_LuV, CI.circuitTier6,
- RECIPE_Buffer_LuV);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier8, RECIPE_BufferCore_ZPM, wireTier8,
- wireTier8, CI.machineCasing_ZPM, wireTier8,
- CI.circuitTier7, RECIPE_BufferCore_ZPM, CI.circuitTier7,
- RECIPE_Buffer_ZPM);
- RecipeUtils.addShapedGregtechRecipe(
- wireTier9, RECIPE_BufferCore_UV, wireTier9,
- wireTier9, CI.machineCasing_UV, wireTier9,
- CI.circuitTier8, RECIPE_BufferCore_UV, CI.circuitTier8,
- RECIPE_Buffer_UV);
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[11], RECIPE_BufferCore_MAX, CI.component_Plate[11],
- wireTier10, CI.machineCasing_MAX, wireTier10,
- CI.circuitTier9, RECIPE_BufferCore_MAX, CI.circuitTier9,
- RECIPE_Buffer_MAX);*/
- }
-
-
- ItemStack[] aBufferOutput = new ItemStack[] {
- RECIPE_Buffer_ULV, RECIPE_Buffer_LV, RECIPE_Buffer_MV,
- RECIPE_Buffer_HV, RECIPE_Buffer_EV, RECIPE_Buffer_IV,
- RECIPE_Buffer_LuV, RECIPE_Buffer_ZPM, RECIPE_Buffer_UV, RECIPE_Buffer_MAX };
-
-
-
- ItemStack[] aOutput = new ItemStack[] {
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"1", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"2", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"3", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"4", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"5", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"6", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"7", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"8", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"9", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"10", 1)
- };
-
- int aCostMultiplier = GTNH ? 4 : 1;
-
- for (int i = 0; i < 10; i++) {
-
- ItemStack aPrevTier = (i == 0 ? CI.getTieredMachineHull(GTNH ? 2 : 1) : aOutput[i-1]);
- aPrevTier.stackSize = GTNH ? 2 : 1;
- int aTier = (i + 1);
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- aPrevTier,
- CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.cableGt04, i, 2 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.circuit, aTier, 2 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.screw, aTier, 6 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.bolt, i, 12 * (GTNH ? 2 : 1)),
- },
- CI.getTieredFluid(i, (144 * 4 * aTier)), //Input Fluid
- aOutput[i],
- 45 * 10 * 1 * (aTier),
- MaterialUtils.getVoltageForTier(i));
-
- //Energy Buffer
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- ItemUtils.getSimpleStack(aOutput[i], 4),
- CI.getTieredComponent(OrePrefixes.plate, aTier, 8 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.wireGt08, i, 4 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.circuit, i, 4 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.stickLong, aTier, 4 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.gearGt, i, 5 * (GTNH ? 2 : 1)),
- },
- CI.getTieredFluid(aTier, (144 * 16 * aTier)), //Input Fluid
- aBufferOutput[i],
- 45 * 20 * 1 * (aTier),
- MaterialUtils.getVoltageForTier(i));
-
- }
-
-
-
-
- }
-
- private static void wirelessChargers() {
-
- ItemStack[] aChargers = new ItemStack[] {
- null,
- GregtechItemList.Charger_LV.get(1),
- GregtechItemList.Charger_MV.get(1),
- GregtechItemList.Charger_HV.get(1),
- GregtechItemList.Charger_EV.get(1),
- GregtechItemList.Charger_IV.get(1),
- GregtechItemList.Charger_LuV.get(1),
- GregtechItemList.Charger_ZPM.get(1),
- GregtechItemList.Charger_UV.get(1),
- GregtechItemList.Charger_MAX.get(1)
- };
-
- int aCostMultiplier = GTNH ? 2 : 1;
-
- for (int i = 0; i < 10; i++) {
- if (i == 0) {
- continue;
- }
- int aTier = (i + 1);
- ItemStack[] aInputs = new ItemStack[] {
- CI.getTieredMachineHull(i, 1 * aCostMultiplier),
- CI.getTransmissionComponent(i, 2 * aCostMultiplier),
- CI.getFieldGenerator(i, 1 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.circuit, aTier, 2 * aCostMultiplier),
- };
- CORE.RA.addSixSlotAssemblingRecipe(
- aInputs,
- CI.getAlternativeTieredFluid(i, (144 * 2 * aTier)), //Input Fluid
- aChargers[i],
- 45 * 10 * 1 * (aTier),
- MaterialUtils.getVoltageForTier(i));
-
- }
- }
-
- private static void largeArcFurnace() {
- int aCostMultiplier = GTNH ? 2 : 1;
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getTieredMachineHull(-1, 1 * aCostMultiplier),
- CI.getTransmissionComponent(2, 2 * aCostMultiplier),
- CI.getElectricPiston(4, 2 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.plate, 5, 4 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.pipeSmall, 4, 1 * aCostMultiplier),
- },
- CI.getAlternativeTieredFluid(5, (144 * 2 * 4)), //Input Fluid
- GregtechItemList.Casing_Industrial_Arc_Furnace.get(Casing_Amount),
- 20 * 10 * 1 * (6),
- MaterialUtils.getVoltageForTier(5));
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- GregtechItemList.Casing_Industrial_Arc_Furnace.get(Casing_Amount),
- CI.getFieldGenerator(4, 2 * aCostMultiplier),
- CI.getRobotArm(5, 4 * aCostMultiplier),
- CI.getEnergyCore(4, 2 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.plate, 6, 8 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.circuit, 5, 8 * aCostMultiplier),
- },
- CI.getAlternativeTieredFluid(6, (144 * 4 * 5)), //Input Fluid
- GregtechItemList.Industrial_Arc_Furnace.get(1),
- 60 * 20 * 8,
- MaterialUtils.getVoltageForTier(6));
- }
-
- private static void industrialVacuumFurnace() {
- int aCostMultiplier = GTNH ? 2 : 1;
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getTieredMachineHull(-1, 1 * aCostMultiplier),
- CI.getHeatCoil(2),
- CI.getElectricPiston(3, 2 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.plate, 6, 4 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.gearGt, 6, 2 * aCostMultiplier),
- },
- CI.getTertiaryTieredFluid(5, (144 * 2 * 4 * aCostMultiplier)), //Input Fluid
- GregtechItemList.Casing_Vacuum_Furnace.get(Casing_Amount),
- 20 * 10 * 6,
- MaterialUtils.getVoltageForTier(6));
-
- ;
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- GregtechItemList.Casing_Vacuum_Furnace.get(aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.wireGt16, 7, 4 * aCostMultiplier),
- CI.getEnergyCore(6, 1 * aCostMultiplier),
- CI.getRobotArm(4, 4 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.plate, 7, 8 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.circuit, 6, 8 * aCostMultiplier),
- },
- CI.getTieredFluid(7, (144 * 4 * 5 * aCostMultiplier)), //Input Fluid
- GregtechItemList.Controller_Vacuum_Furnace.get(1),
- 60 * 20 * 12,
- MaterialUtils.getVoltageForTier(7));
- }
-
- private static void milling() {
-
-
- /*public static ItemStack RECIPE_ISAMill_Controller;
- public static ItemStack RECIPE_ISAMill_Gearbox;
- public static ItemStack RECIPE_ISAMill_Casing;
- public static ItemStack RECIPE_ISAMill_Hatch;
- public static ItemStack RECIPE_Flotation_Controller;
- public static ItemStack RECIPE_Flotation_Casing;*/
-
- // Isa Mill Controller
- CORE.RA.addAssemblylineRecipe(
- ItemList.Machine_IV_Macerator.get(1),
- 20 * 60 * 20,
- new Object[] {
- GregtechItemList.Casing_IsaMill_Gearbox.get(4),
- CI.getTieredGTPPMachineCasing(6, 4),
- ItemList.Component_Grinder_Tungsten.get(16),
- new Object[] {CI.getTieredCircuitOreDictName(6), 8},
- ALLOY.INCONEL_625.getGear(8),
- ALLOY.INCONEL_625.getPlate(32),
- ALLOY.ZERON_100.getPlateDouble(8),
- ALLOY.ZERON_100.getPlateDouble(8),
- ALLOY.ZERON_100.getScrew(64),
- CI.getTieredComponentOfMaterial(Materials.NiobiumTitanium, OrePrefixes.wireFine, 32),
- CI.getTieredComponentOfMaterial(Materials.NiobiumTitanium, OrePrefixes.wireFine, 32),
- CI.getTieredComponentOfMaterial(Materials.Titanium, OrePrefixes.foil, 16),
- CI.getTieredComponentOfMaterial(Materials.Titanium, OrePrefixes.foil, 16),
-
- },
- new FluidStack[] {
- CI.getTieredFluid(6, 16 * 144),
- CI.getAlternativeTieredFluid(6, 32 * 144),
- CI.getTertiaryTieredFluid(6, 32 * 144)
- },
- GregtechItemList.Controller_IsaMill.get(1),
- 20 * 60 * 10,
- MaterialUtils.getVoltageForTier(6));
-
- // Isa Mill Gearbox
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(7),
- ItemList.Casing_Gearbox_Titanium.get(2),
- ALLOY.INCONEL_625.getGear(4),
- CI.getTieredComponentOfMaterial(Materials.HSSE, OrePrefixes.gearGtSmall, 8),
- ALLOY.INCONEL_625.getPlate(16),
- ALLOY.ZERON_100.getBolt(16),
- },
- ALLOY.TUNGSTENSTEEL.getFluidStack(8 * 144),
- GregtechItemList.Casing_IsaMill_Gearbox.get(1),
- 60 * 20 * 2,
- MaterialUtils.getVoltageForTier(6));
-
- // Isa Mill Casing
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(7),
- CI.getTieredGTPPMachineCasing(5, 1),
- ALLOY.INCONEL_625.getPlate(8),
- ALLOY.ZERON_100.getRod(4),
- CI.getTieredComponentOfMaterial(Materials.HSSG, OrePrefixes.gearGtSmall, 4),
- ALLOY.ZERON_100.getScrew(8),
- },
- ELEMENT.getInstance().TITANIUM.getFluidStack(4 * 144),
- GregtechItemList.Casing_IsaMill_Casing.get(1),
- 60 * 20 * 2,
- MaterialUtils.getVoltageForTier(6));
-
- // Isa Mill Pipe
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(7),
- CI.getTieredGTPPMachineCasing(4, 2),
- ALLOY.INCONEL_625.getPlateDouble(4),
- ALLOY.INCOLOY_MA956.getRing(8),
- CI.getTieredComponentOfMaterial(Materials.HSSE, OrePrefixes.plate, 8),
- ALLOY.INCOLOY_MA956.getBolt(16),
- },
- ELEMENT.getInstance().ALUMINIUM.getFluidStack(8 * 144),
- GregtechItemList.Casing_IsaMill_Pipe.get(1),
- 60 * 20 * 8,
- MaterialUtils.getVoltageForTier(4));
-
- // Flotation Cell Controller
- CORE.RA.addAssemblylineRecipe(
- ItemList.Distillation_Tower.get(1),
- 20 * 60 * 20,
- new Object[] {
- GregtechItemList.Casing_Flotation_Cell.get(4),
- CI.getTieredGTPPMachineCasing(5, 4),
- ItemList.Machine_IV_Distillery.get(1),
- new Object[] {CI.getTieredCircuitOreDictName(6), 8},
- ALLOY.STELLITE.getGear(8),
- ALLOY.STELLITE.getPlate(32),
- ALLOY.HASTELLOY_N.getPlateDouble(8),
- ALLOY.HASTELLOY_N.getPlateDouble(8),
- ALLOY.HASTELLOY_N.getScrew(64),
- CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64),
- CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64),
- CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32),
- CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32),
-
- },
- new FluidStack[] {
- CI.getTieredFluid(5, 16 * 144),
- CI.getAlternativeTieredFluid(4, 32 * 144),
- CI.getTertiaryTieredFluid(4, 32 * 144)
- },
- GregtechItemList.Controller_Flotation_Cell.get(1),
- 20 * 60 * 10,
- MaterialUtils.getVoltageForTier(6));
-
- // Flotation Cell Casing
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(7),
- CI.getTieredGTPPMachineCasing(4, 1),
- ALLOY.AQUATIC_STEEL.getPlate(8),
- ALLOY.STELLITE.getRing(8),
- CI.getTieredComponentOfMaterial(Materials.HSSG, OrePrefixes.plateDouble, 4),
- ALLOY.HASTELLOY_N.getScrew(8),
- },
- ALLOY.STAINLESS_STEEL.getFluidStack(8 * 144),
- GregtechItemList.Casing_Flotation_Cell.get(1),
- 60 * 20 * 2,
- MaterialUtils.getVoltageForTier(6));
-
- // Milling Bus
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(7),
- CI.getTieredGTPPMachineCasing(5, 1),
- ItemList.Hatch_Input_Bus_EV.get(1),
- CI.getTieredComponentOfMaterial(Materials.Titanium, OrePrefixes.gearGt, 8),
- CI.getTieredComponentOfMaterial(Materials.TungstenSteel, OrePrefixes.plate, 32),
- CI.getTieredComponentOfMaterial(Materials.SolderingAlloy, OrePrefixes.wireFine, 16),
- },
- ELEMENT.getInstance().TUNGSTEN.getFluidStack(8 * 144),
- GregtechItemList.Bus_Milling_Balls.get(1),
- 60 * 20 * 4,
- MaterialUtils.getVoltageForTier(5));
-
- }
-
- private static void sparging() {
-
- // Sparge Tower Research
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(8),
- ELEMENT.getInstance().HELIUM.getCell(8),
- ELEMENT.getInstance().FLUORINE.getCell(8),
- ALLOY.HS188A.getIngot(8),
- ItemList.Distillation_Tower.get(1)
- },
- null,
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_10_SPARGING, 1),
- 60 * 20 * 5,
- MaterialUtils.getVoltageForTier(5));
-
- // Sparge Tower Controller
- CORE.RA.addAssemblylineRecipe(
- ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_10_SPARGING, 1),
- 20 * 60 * 20,
- new Object[] {
- GregtechItemList.Casing_Sparge_Tower_Exterior.get(4),
- CI.getTieredGTPPMachineCasing(4, 4),
- ItemList.Machine_IV_Distillery.get(1),
- new Object[] {CI.getTieredCircuitOreDictName(5), 8},
- ALLOY.HS188A.getGear(8),
- ALLOY.HS188A.getPlate(32),
- ALLOY.HASTELLOY_N.getPlateDouble(8),
- ALLOY.HASTELLOY_N.getPlateDouble(8),
- ALLOY.HASTELLOY_N.getScrew(64),
- CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64),
- CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64),
- CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32),
- CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32),
-
- },
- new FluidStack[] {
- CI.getTieredFluid(4, 16 * 144),
- CI.getAlternativeTieredFluid(3, 32 * 144),
- CI.getTertiaryTieredFluid(3, 32 * 144)
- },
- GregtechItemList.Controller_Sparge_Tower.get(1),
- 20 * 60 * 10,
- MaterialUtils.getVoltageForTier(6));
-
- // Sparge Tower Casing
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(8),
- CI.getTieredGTPPMachineCasing(3, 1),
- ALLOY.HS188A.getPlate(8),
- ALLOY.HASTELLOY_N.getRing(4),
- CI.getTieredComponentOfMaterial(Materials.TungstenSteel, OrePrefixes.plateDouble, 4),
- ALLOY.HASTELLOY_N.getScrew(4),
- },
- ALLOY.STAINLESS_STEEL.getFluidStack(8 * 144),
- GregtechItemList.Casing_Sparge_Tower_Exterior.get(1),
- 60 * 20 * 2,
- MaterialUtils.getVoltageForTier(5));
- }
-
- private static void chisels() {
- ItemStack[] aChisels = new ItemStack[] {
- GregtechItemList.GT_Chisel_LV.get(1),
- GregtechItemList.GT_Chisel_MV.get(1),
- GregtechItemList.GT_Chisel_HV.get(1),
- };
- for (int i=1;i<4;i++) {
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(10+i),
- CI.getTieredMachineCasing(i),
- CI.getPlate(i, 4),
- CI.getElectricMotor(i, 2),
- CI.getConveyor(i, 2),
- CI.getRobotArm(i, 1)
- },
- CI.getTieredFluid(i, 144 * 4),
- aChisels[i-1],
- 20 * 20,
- MaterialUtils.getVoltageForTier(i));
- }
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(14),
- aChisels[2],
- CI.getPlate(4, 8),
- CI.getElectricMotor(4, 8),
- CI.getConveyor(4, 8),
- CI.getRobotArm(4, 4)
- },
- CI.getTieredFluid(4, 144 * 8),
- GregtechItemList.Controller_IndustrialAutoChisel.get(1),
- 20 * 20,
- MaterialUtils.getVoltageForTier(4));
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(14),
- ItemList.Casing_SolidSteel.get(2),
- CI.getPlate(4, 2),
- CI.getTieredComponent(OrePrefixes.plate, 3, 4),
- CI.getTieredComponent(OrePrefixes.ring, 3, 8),
- CI.getTieredComponent(OrePrefixes.rod, 2, 4),
- },
- CI.getTieredFluid(2, 144 * 2),
- GregtechItemList.Casing_IndustrialAutoChisel.get(1),
- 20 * 20,
- MaterialUtils.getVoltageForTier(3));
-
-
-
- }
-
- private static void rockBreaker() {
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(12),
- ItemList.Machine_EV_RockBreaker.get(1),
- ALLOY.STAINLESS_STEEL.getPlate(8),
- ALLOY.STAINLESS_STEEL.getRing(4),
- CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.plateDouble, 8),
- ALLOY.EGLIN_STEEL.getScrew(8),
- },
- ELEMENT.getInstance().ALUMINIUM.getFluidStack(144 * 8),
- GregtechItemList.Controller_IndustrialRockBreaker.get(1),
- 60 * 20 * 2,
- MaterialUtils.getVoltageForTier(4));
-
- }
-
- private static void fakeMachineCasingCovers() {
- GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] {
- GregtechItemList.FakeMachineCasingPlate_ULV,
- GregtechItemList.FakeMachineCasingPlate_LV,
- GregtechItemList.FakeMachineCasingPlate_MV,
- GregtechItemList.FakeMachineCasingPlate_HV,
- GregtechItemList.FakeMachineCasingPlate_EV,
- GregtechItemList.FakeMachineCasingPlate_IV,
- GregtechItemList.FakeMachineCasingPlate_LuV,
- GregtechItemList.FakeMachineCasingPlate_ZPM,
- GregtechItemList.FakeMachineCasingPlate_UV,
- GregtechItemList.FakeMachineCasingPlate_MAX,
- };
- int aMaxTier = GT_Values.VOLTAGE_NAMES.length;
- if (!GTNH) {
- aMaxTier = 10;
- }
- ItemStack aTier[] = new ItemStack[aMaxTier];
- for (int i=0;i<aMaxTier;i++) {
- aTier[i] = ItemUtils.simpleMetaStack(CoverManager.Cover_Gt_Machine_Casing, i, 7);
- }
- // Deprecate old recipes
- for (int i=0;i<10;i++) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {mMachineCasingCovers[i].get(1)}, ItemUtils.getSimpleStack(aTier[i], 1));
- }
- // Add recipes for new ones
- for (int i = 0;i<aMaxTier;i++) {
- GT_Values.RA.addCutterRecipe(
- CI.getTieredMachineCasing(i),
- aTier[i],
- null,
- 20 * 5 * i,
- (int) GT_Values.V[i]);
- }
- }
-
- private static void ztonesCoverRecipes() {
-
- if (!Loader.isModLoaded("Ztones")) {
- return;
- }
- Class ModBlocksClass = ReflectionUtils.getClass("com.riciJak.Ztones.init.ModBlocks");
- Block agon = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "agonBlock"));
- Block korp = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "korpBlock"));
- Block jelt = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "jeltBlock"));
- Block bitt = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "bittBlock"));
- Block iszm = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "iszmBlock"));
-
- // "agon", "iszm", "korp", "jelt", "bitt"
-
- ItemStack[] aBlocks = new ItemStack[] {
- ItemUtils.getSimpleStack(agon),
- ItemUtils.getSimpleStack(iszm),
- ItemUtils.getSimpleStack(korp),
- ItemUtils.getSimpleStack(jelt),
- ItemUtils.getSimpleStack(bitt)
- };
- MetaCustomCoverItem[] aCovers = new MetaCustomCoverItem[] {
- CoverManager.Cover_Agon,
- CoverManager.Cover_Iszm,
- CoverManager.Cover_Korp,
- CoverManager.Cover_Jelt,
- CoverManager.Cover_Bitt
- };
-
- ItemStack aInputs[][] = new ItemStack[5][16];
- ItemStack aOutputs[][] = new ItemStack[5][16];
- for (int a=0;a<5;a++) {
- for (int i=0;i<16;i++) {
- aInputs[a][i] = ItemUtils.simpleMetaStack(aBlocks[a].getItem(), i, 1);
- aOutputs[a][i] = ItemUtils.simpleMetaStack(aCovers[a], i, 9);
- }
- }
- for (int a=0;a<5;a++) {
- for (int i = 0;i<16;i++) {
- if (GTNH) continue;
- ItemStack aInput = aInputs[a][i];
- ItemStack aOutput = aOutputs[a][i];
- if (GT_Values.RA.addCutterRecipe(
- aInput,
- aOutput,
- null,
- 20 * 5,
- 16)) {
- Logger.INFO("Added Cutting recipe for "+aInput.getDisplayName());
- }
-
- if (CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit((i/4)+4),
- aOutput
- },
- FluidUtils.getWildcardFluidStack("glue", 250),
- aInput,
- 20 * 10,
- 16)) {
- Logger.INFO("Added Assembly recipe for "+aInput.getDisplayName());
- }
- }
- }
- }
-
- private static void superBuses() {
- GregtechItemList[] mSuperBusesInput = new GregtechItemList[] {
- GregtechItemList.Hatch_SuperBus_Input_ULV,
- GregtechItemList.Hatch_SuperBus_Input_LV,
- GregtechItemList.Hatch_SuperBus_Input_MV,
- GregtechItemList.Hatch_SuperBus_Input_HV,
- GregtechItemList.Hatch_SuperBus_Input_EV,
- GregtechItemList.Hatch_SuperBus_Input_IV,
- GregtechItemList.Hatch_SuperBus_Input_LuV,
- GregtechItemList.Hatch_SuperBus_Input_ZPM,
- GregtechItemList.Hatch_SuperBus_Input_UV,
- GregtechItemList.Hatch_SuperBus_Input_MAX,
- };
-
- GregtechItemList[] mSuperBusesOutput = new GregtechItemList[] {
- GregtechItemList.Hatch_SuperBus_Output_ULV,
- GregtechItemList.Hatch_SuperBus_Output_LV,
- GregtechItemList.Hatch_SuperBus_Output_MV,
- GregtechItemList.Hatch_SuperBus_Output_HV,
- GregtechItemList.Hatch_SuperBus_Output_EV,
- GregtechItemList.Hatch_SuperBus_Output_IV,
- GregtechItemList.Hatch_SuperBus_Output_LuV,
- GregtechItemList.Hatch_SuperBus_Output_ZPM,
- GregtechItemList.Hatch_SuperBus_Output_UV,
- GregtechItemList.Hatch_SuperBus_Output_MAX,
- };
-
- ItemStack[] mInputHatch = new ItemStack[] {
- ItemList.Hatch_Input_Bus_EV.get(1),
- ItemList.Hatch_Input_Bus_IV.get(1),
- ItemList.Hatch_Input_Bus_LuV.get(1),
- ItemList.Hatch_Input_Bus_ZPM.get(1),
- ItemList.Hatch_Input_Bus_UV.get(1),
- ItemList.Hatch_Input_Bus_MAX.get(1),
- GregtechItemList.Hatch_SuperBus_Input_LV.get(1),
- GregtechItemList.Hatch_SuperBus_Input_MV.get(1),
- GregtechItemList.Hatch_SuperBus_Input_HV.get(1),
- GregtechItemList.Hatch_SuperBus_Input_EV.get(1),
- };
-
- ItemStack[] mOutputHatch = new ItemStack[] {
- ItemList.Hatch_Output_Bus_EV.get(1),
- ItemList.Hatch_Output_Bus_IV.get(1),
- ItemList.Hatch_Output_Bus_LuV.get(1),
- ItemList.Hatch_Output_Bus_ZPM.get(1),
- ItemList.Hatch_Output_Bus_UV.get(1),
- ItemList.Hatch_Output_Bus_MAX.get(1),
- GregtechItemList.Hatch_SuperBus_Output_LV.get(1),
- GregtechItemList.Hatch_SuperBus_Output_MV.get(1),
- GregtechItemList.Hatch_SuperBus_Output_HV.get(1),
- GregtechItemList.Hatch_SuperBus_Output_EV.get(1),
- };
-
- // Special Case recipes for ULV buses
- {
-
- int i = 0;
- ItemStack[] aInputs1 = new ItemStack[] {
- CI.getNumberedCircuit(17),
- mInputHatch[i],
- CI.getElectricMotor(i, GTNH ? 8 : 2),
- CI.getConveyor(i, GTNH ? 10 : 5),
- CI.getBolt(i, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
- };
- Logger.INFO("[FIND] "+ItemUtils.getArrayStackNames(aInputs1));
- ItemStack[] aOutputs1 = new ItemStack[] {
- CI.getNumberedCircuit(18),
- mOutputHatch[i],
- CI.getElectricPiston(i, GTNH ? 8 : 2),
- CI.getConveyor(i, GTNH ? 10 : 5),
- CI.getGear(i, GTNH ? 6 : 3),
- CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
- };
- Logger.INFO("[FIND] "+ItemUtils.getArrayStackNames(aOutputs1));
-
- FluidStack a1 = CI.getAlternativeTieredFluid(i, 144 * 8);
- FluidStack a2 = CI.getTertiaryTieredFluid(i, 144 * 8);
-
-
- Logger.INFO("[FIND] Input Bus Fluid: "+ItemUtils.getFluidName(a1));
- Logger.INFO("[FIND] Output Bus Fluid: "+ItemUtils.getFluidName(a2));
-
-
- CORE.RA.addSixSlotAssemblingRecipe(aInputs1,
- a1,
- mSuperBusesInput[i].get(1),
- 20 * 30 * 2 * i,
- (int) GT_Values.V[i]);
-
- CORE.RA.addSixSlotAssemblingRecipe(aOutputs1,
- a2,
- mSuperBusesOutput[i].get(1),
- 20 * 30 * 2 * i,
- (int) GT_Values.V[i]);
-
-
- }
-
- //Input Buses
- for (int i = 1; i < 10; i++) {
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- CI.getNumberedCircuit(17),
- mInputHatch[i],
- CI.getElectricMotor(i, GTNH ? 8 : 2),
- CI.getConveyor(i, GTNH ? 10 : 5),
- CI.getBolt(i, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
- },
- CI.getAlternativeTieredFluid(i, 144 * 8),
- mSuperBusesInput[i].get(1), 20 * 30 * 2 * i,
- (int) GT_Values.V[i]);
- }
- //Output Buses
- for (int i = 1; i < 10; i++) {
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- CI.getNumberedCircuit(18),
- mOutputHatch[i],
- CI.getElectricPiston(i, GTNH ? 8 : 2),
- CI.getConveyor(i, GTNH ? 10 : 5),
- CI.getGear(i, GTNH ? 6 : 3),
- CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
- },
- CI.getTertiaryTieredFluid(i, 144 * 8),
- mSuperBusesOutput[i].get(1), 20 * 30 * 2 * i,
- (int) GT_Values.V[i]);
- }
-
-
- }
-
- private static void roundRobinators() {
-
- RecipeUtils.addShapedGregtechRecipe(
- ItemUtils.getSimpleStack(Blocks.hopper), "circuitPrimitive", ItemUtils.getSimpleStack(Blocks.hopper),
- CI.craftingToolWrench, CI.machineCasing_ULV, CI.craftingToolScrewdriver,
- ItemUtils.getSimpleStack(Blocks.hopper), "circuitPrimitive", ItemUtils.getSimpleStack(Blocks.hopper),
- ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1));
-
- ItemStack[] aRobinators = new ItemStack[] {
- ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1),
- ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 1, 1),
- ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 2, 1),
- ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 3, 1),
- ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 4, 1),
- };
-
- int aCostMultiplier = GTNH ? 2 : 1;
-
- for (int i = 0; i < 5; i++) {
- if (i == 0) {
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(17),
- CI.getTieredMachineCasing(0),
- ItemUtils.getSimpleStack(Blocks.hopper, 4),
- CI.getTieredComponent(OrePrefixes.circuit, 0, 2)
- },
- GT_Values.NF, //Input Fluid
- aRobinators[i],
- 45 * 10 * 1,
- 8);
- continue;
- }
- int aTier = i+1;
- ItemStack[] aInputs = new ItemStack[] {
- aRobinators[i-1],
- CI.getTieredMachineHull(aTier, 1 * aCostMultiplier),
- CI.getConveyor(aTier, 2 * aCostMultiplier),
- CI.getElectricMotor(aTier, 2 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier),
- CI.getTieredComponent(OrePrefixes.circuit, i, 2 * aCostMultiplier),
- };
-
- CORE.RA.addSixSlotAssemblingRecipe(
- aInputs,
- GT_Values.NF, //Input Fluid
- aRobinators[i],
- 45 * 10 * 1 * (i+1),
- MaterialUtils.getVoltageForTier(i));
-
- }
- }
+ GregtechItemList.Casing_Machine_Custom_1.get(2L, new Object[0]), CI.bits, new Object[] {
+ "PhP",
+ "PFP",
+ "PwP",
+ 'P',
+ OrePrefixes.plate.get(Materials.Bronze),
+ 'F',
+ OrePrefixes.frameGt.get(Materials.Bronze)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Casing_Machine_Custom_2.get(2L, new Object[0]), CI.bits, new Object[] {
+ "PPP",
+ "hFw",
+ "PPP",
+ 'P',
+ OrePrefixes.plate.get(Materials.Aluminium),
+ 'F',
+ OrePrefixes.frameGt.get(Materials.Aluminium)
+ });
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(19),
+ CI.getTieredGTPPMachineCasing(1, 6),
+ CI.getTieredComponentOfMaterial(Materials.Steel, OrePrefixes.gearGt, 6),
+ CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.plate, 32),
+ CI.getTieredComponentOfMaterial(Materials.CobaltBrass, OrePrefixes.dust, 16),
+ CI.getTieredComponent(OrePrefixes.frameGt, 2, 4),
+ },
+ ALLOY.STEEL.getFluidStack(2 * (144 * 4)),
+ GregtechItemList.ChemicalPlant_Controller.get(1),
+ 120 * 20,
+ MaterialUtils.getVoltageForTier(2));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(15),
+ CI.getTieredGTPPMachineCasing(1, 2),
+ ItemList.Hatch_Input_Bus_MV.get(1),
+ CI.getTieredComponentOfMaterial(Materials.Bronze, OrePrefixes.gearGt, 8),
+ CI.getTieredComponentOfMaterial(Materials.Lead, OrePrefixes.plate, 48),
+ CI.getTieredComponentOfMaterial(Materials.SolderingAlloy, OrePrefixes.wireFine, 16),
+ },
+ ALLOY.BRONZE.getFluidStack(2 * (144 * 4)),
+ GregtechItemList.Bus_Catalysts.get(1),
+ 60 * 20,
+ MaterialUtils.getVoltageForTier(2));
+ }
+
+ private static void algaeFarm() {
+
+ // Give the shitty algae a use :)
+ CORE.RA.addDistilleryRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 32),
+ null,
+ null,
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4),
+ 20 * 15,
+ 16,
+ false);
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(21),
+ CI.getTieredGTPPMachineCasing(0, 4),
+ CI.getTieredComponentOfMaterial(Materials.Iron, OrePrefixes.rod, 12),
+ CI.getTieredComponentOfMaterial(Materials.Wood, OrePrefixes.plate, 32),
+ CI.getTieredComponentOfMaterial(Materials.Bronze, OrePrefixes.bolt, 16),
+ CI.getTieredComponentOfMaterial(Materials.Redstone, OrePrefixes.dust, 32),
+ },
+ ALLOY.POTIN.getFluidStack(2 * (144 * 4)),
+ GregtechItemList.AlgaeFarm_Controller.get(1),
+ 60 * 20,
+ MaterialUtils.getVoltageForTier(1));
+ }
+
+ private static void distillus() {
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(19),
+ ItemList.Distillation_Tower.get(2),
+ GregtechItemList.GTPP_Casing_IV.get(16),
+ CI.getTieredComponent(OrePrefixes.circuit, 6, 8)
+ },
+ new FluidStack[] {
+ ALLOY.AQUATIC_STEEL.getFluidStack(144 * 32),
+ ALLOY.BABBIT_ALLOY.getFluidStack(144 * 16),
+ ALLOY.BRONZE.getFluidStack(144 * 64),
+ ALLOY.KANTHAL.getFluidStack(144 * 16),
+ },
+ new ItemStack[] {GregtechItemList.Machine_Adv_DistillationTower.get(1)},
+ new FluidStack[] {},
+ 20 * 600,
+ MaterialUtils.getVoltageForTier(6),
+ 5);
+ }
+
+ private static void chunkloaders() {
+
+ ItemStack aOutputs[] = new ItemStack[] {
+ GregtechItemList.GT_Chunkloader_HV.get(1L),
+ GregtechItemList.GT_Chunkloader_IV.get(1L),
+ GregtechItemList.GT_Chunkloader_ZPM.get(1L),
+ };
+
+ int aIndex = 0;
+
+ for (int i = 3; i < 8; i++) {
+ if (i == 4 || i == 6) {
+ continue;
+ }
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(21),
+ CI.getElectricPiston(i, 10),
+ CI.getFieldGenerator(i + 1, 6),
+ CI.getPlate(i, 16),
+ CI.getTransmissionComponent(i - 1, 8),
+ CI.getTieredComponent(OrePrefixes.cableGt08, i, 16)
+ },
+ ALLOY.EGLIN_STEEL.getFluidStack(i * (144 * 4)),
+ aOutputs[aIndex++].copy(),
+ 300 * 20,
+ MaterialUtils.getVoltageForTier(i));
+ }
+ }
+
+ private static void overflowValveCovers() {
+ ItemStack aOutputs[] = new ItemStack[] {
+ GregtechItemList.Cover_Overflow_ULV.get(1L),
+ GregtechItemList.Cover_Overflow_LV.get(1L),
+ GregtechItemList.Cover_Overflow_MV.get(1L),
+ GregtechItemList.Cover_Overflow_HV.get(1L),
+ GregtechItemList.Cover_Overflow_EV.get(1L),
+ GregtechItemList.Cover_Overflow_IV.get(1L),
+ };
+
+ for (int i = 0; i < 6; i++) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(19),
+ CI.getElectricPump(i, 2),
+ CI.getElectricMotor(i, 2),
+ CI.getPlate(i, 4)
+ },
+ FluidUtils.getWater((i + 1) * 750),
+ aOutputs[i].copy(),
+ 20 * 20,
+ MaterialUtils.getVoltageForTier(i));
+ }
+ }
+
+ private static void tieredMachineHulls() {
+
+ GregtechItemList[] aHulls = new GregtechItemList[] {
+ GregtechItemList.GTPP_Casing_ULV,
+ GregtechItemList.GTPP_Casing_LV,
+ GregtechItemList.GTPP_Casing_MV,
+ GregtechItemList.GTPP_Casing_HV,
+ GregtechItemList.GTPP_Casing_EV,
+ GregtechItemList.GTPP_Casing_IV,
+ GregtechItemList.GTPP_Casing_LuV,
+ GregtechItemList.GTPP_Casing_ZPM,
+ GregtechItemList.GTPP_Casing_UV,
+ GregtechItemList.GTPP_Casing_MAX
+ };
+
+ for (int i = 0; i < 10; i++) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(20),
+ CI.getTieredMachineCasing(i),
+ CI.getPlate(i, 8),
+ CI.getGear(i, 2),
+ CI.getTieredComponent(OrePrefixes.cableGt02, i, 4),
+ CI.getTieredComponent(OrePrefixes.circuit, i, 2)
+ },
+ CI.getAlternativeTieredFluid(i, 144 * (i + 1) * 2),
+ aHulls[i].get(1),
+ 20 * 20,
+ MaterialUtils.getVoltageForTier(i));
+ }
+ }
+
+ private static void initModItems() {
+ if (LoadedMods.IndustrialCraft2) {
+ IC2MFE = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFE", 1, 1);
+ IC2MFSU =
+ ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFSU", 2, 1);
+ }
+ if (LoadedMods.Gregtech) {
+
+ // Lava Boiler
+ boiler_Coal = ItemList.Machine_Bronze_Boiler.get(1);
+
+ // IV MACHINES
+ if (!GTNH) {
+ EV_MACHINE_Electrolyzer = ItemList.Machine_EV_Electrolyzer.get(1);
+ EV_MACHINE_BendingMachine = ItemList.Machine_EV_Bender.get(1);
+ EV_MACHINE_Wiremill = ItemList.Machine_EV_Wiremill.get(1);
+ HV_MACHINE_Macerator = ItemList.Machine_HV_Macerator.get(1);
+ EV_MACHINE_Macerator = ItemList.Machine_EV_Macerator.get(1);
+ EV_MACHINE_MassFabricator = ItemList.Machine_EV_Massfab.get(1);
+ EV_MACHINE_Centrifuge = ItemList.Machine_EV_Centrifuge.get(1);
+ EV_MACHINE_Cutter = ItemList.Machine_EV_Cutter.get(1);
+ EV_MACHINE_Extruder = ItemList.Machine_EV_Extruder.get(1);
+ EV_MACHINE_Sifter = ItemList.Machine_HV_Sifter.get(1);
+ EV_MACHINE_ThermalCentrifuge = ItemList.Machine_EV_ThermalCentrifuge.get(1);
+ EV_MACHINE_OreWasher = ItemList.Machine_EV_OreWasher.get(1);
+ EV_MACHINE_AlloySmelter = ItemList.Machine_EV_AlloySmelter.get(1);
+ EV_MACHINE_Mixer = ItemList.Machine_EV_Mixer.get(1);
+ }
+ // Balanced opposites
+ else {
+ EV_MACHINE_Electrolyzer = ItemList.Machine_IV_Electrolyzer.get(1);
+ EV_MACHINE_BendingMachine = ItemList.Machine_IV_Bender.get(1);
+ EV_MACHINE_Wiremill = ItemList.Machine_IV_Wiremill.get(1);
+ HV_MACHINE_Macerator = ItemList.Machine_EV_Macerator.get(1);
+ EV_MACHINE_Macerator = ItemList.Machine_IV_Macerator.get(1);
+ EV_MACHINE_MassFabricator = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK
+ ? ItemUtils.getValueOfItemList("Machine_LuV_Massfab", ItemList.Machine_IV_Massfab)
+ .get(1)
+ : ItemList.Machine_IV_Massfab.get(1);
+ EV_MACHINE_Centrifuge = ItemList.Machine_IV_Centrifuge.get(1);
+ EV_MACHINE_Cutter = ItemList.Machine_IV_Cutter.get(1);
+ EV_MACHINE_Extruder = ItemList.Machine_IV_Extruder.get(1);
+ EV_MACHINE_Sifter = ItemList.Machine_HV_Sifter.get(1);
+ EV_MACHINE_ThermalCentrifuge = ItemList.Machine_IV_ThermalCentrifuge.get(1);
+ EV_MACHINE_OreWasher = ItemList.Machine_IV_OreWasher.get(1);
+ EV_MACHINE_AlloySmelter = ItemList.Machine_IV_AlloySmelter.get(1);
+ EV_MACHINE_Mixer = ItemList.Machine_IV_Mixer.get(1);
+ }
+ }
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialCokeOven) {
+ if (LoadedMods.Railcraft) {
+ // Misc
+ INPUT_RCCokeOvenBlock = ItemUtils.getItemStackWithMeta(
+ LoadedMods.Railcraft, "Railcraft:machine.alpha", "Coke_Oven_RC", 7, 1);
+ }
+ if (LoadedMods.ImmersiveEngineering) {
+ // Misc
+ INPUT_IECokeOvenBlock = ItemUtils.getItemStackWithMeta(
+ LoadedMods.ImmersiveEngineering, "ImmersiveEngineering:stoneDecoration", "Coke_Oven_IE", 1, 1);
+ }
+ }
+ runModRecipes();
+ }
+
+ private static void runModRecipes() {
+ if (LoadedMods.Gregtech) {
+
+ // Computer Cube
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(CI.getDataOrb(), 4 * (GTNH ? 2 : 1)),
+ ItemList.Cover_Screen.get(4),
+ CI.machineHull_IV,
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 2)
+ },
+ ELEMENT.getInstance().TANTALUM.getFluidStack(144 * 16),
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ 60 * 20 * 3,
+ 8000);
+
+ // Circuit programmer
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(CI.robotArm_LV, 4 * (GTNH ? 2 : 1)),
+ ItemList.Cover_Controller.get(1, CI.electricMotor_MV),
+ CI.machineHull_MV,
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), 2),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(2), 2)
+ },
+ ELEMENT.getInstance().IRON.getFluidStack(144 * 4),
+ ItemUtils.getSimpleStack(ModBlocks.blockCircuitProgrammer),
+ 60 * 10 * 1,
+ 30);
+
+ // Lead Lined Chest
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.machineHull_LV,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateRubber", 32),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseLead", 9),
+ ItemUtils.getSimpleStack(Blocks.chest)
+ },
+ ELEMENT.getInstance().LEAD.getFluidStack(144 * 16),
+ ItemUtils.getSimpleStack(ModBlocks.blockDecayablesChest),
+ 60 * 10 * 3,
+ 60);
+
+ // RTG
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackWithMeta(true, "IC2:blockGenerator:6", "IC2-RTG", 6, 1),
+ ALLOY.NITINOL_60.getPlate(GTNH ? 32 : 8),
+ ALLOY.MARAGING350.getGear(GTNH ? 16 : 4),
+ ItemUtils.getSimpleStack(GTNH ? CI.fieldGenerator_IV : CI.fieldGenerator_EV, 8),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFinePlatinum", GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict(
+ CI.getTieredCircuitOreDictName(GTNH ? 7 : 6), GTNH ? 5 : 4)
+ },
+ ALLOY.NIOBIUM_CARBIDE.getFluidStack(144 * 16),
+ GregtechItemList.RTG.get(1),
+ 60 * 20 * 10,
+ 8000);
+
+ // Super Jukebox
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.machineHull_LV,
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitBasic", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateTumbaga", 8),
+ ItemUtils.getSimpleStack(Blocks.jukebox)
+ },
+ ELEMENT.getInstance().COPPER.getFluidStack(144 * 2),
+ ItemUtils.getSimpleStack(ModBlocks.blockCustomJukebox),
+ 20 * 30,
+ 30);
+
+ ItemStack aFluidRegulator1 =
+ ItemUtils.getValueOfItemList("FluidRegulator_MV", GTNH ? 4 : 2, ItemList.Electric_Pump_HV);
+ ItemStack aFluidRegulator2 = ItemUtils.getValueOfItemList(
+ "FluidRegulator_IV",
+ GTNH ? 4 : 2,
+ ItemUtils.getValueOfItemList("Electric_Pump_LuV", GTNH ? 8 : 4, ItemList.Electric_Pump_IV));
+
+ // Poo Collector
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.machineHull_MV,
+ aFluidRegulator1,
+ CI.getTieredComponent(OrePrefixes.pipeMedium, 2, GTNH ? 4 : 2),
+ ALLOY.EGLIN_STEEL.getPlate(GTNH ? 8 : 4),
+ ALLOY.POTIN.getScrew(GTNH ? 12 : 6)
+ },
+ ALLOY.TUMBAGA.getFluidStack(144 * 4),
+ ItemUtils.getSimpleStack(ModBlocks.blockPooCollector),
+ 20 * 60,
+ 30);
+
+ // Adv. Poo Collector
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getTieredMachineHull(-1),
+ ItemUtils.getSimpleStack(ModBlocks.blockPooCollector),
+ aFluidRegulator2,
+ CI.getTieredComponent(OrePrefixes.pipeHuge, 6, GTNH ? 8 : 4),
+ CI.getTieredComponent(OrePrefixes.screw, 6, GTNH ? 32 : 16)
+ },
+ CI.getAlternativeTieredFluid(5, 144 * 9),
+ ItemUtils.getSimpleStack(ModBlocks.blockPooCollector, 8, 1),
+ 20 * 60 * 5,
+ 500);
+
+ // Basic Steam Turbine
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getTieredComponent(OrePrefixes.pipeSmall, 0, 1),
+ "circuitPrimitive",
+ CI.getTieredComponent(OrePrefixes.pipeSmall, 0, 1),
+ ALLOY.TUMBAGA.getRotor(1),
+ CI.machineCasing_ULV,
+ ALLOY.TUMBAGA.getRotor(1),
+ CI.getElectricMotor(0, 1),
+ "cableGt01RedAlloy",
+ CI.getElectricMotor(0, 1),
+ GregtechItemList.Generator_Steam_Turbine_ULV.get(1));
+
+ // Basic Gas Turbine
+ RecipeUtils.addShapedGregtechRecipe(
+ "circuitPrimitive",
+ ALLOY.TUMBAGA.getRotor(1),
+ "circuitPrimitive",
+ ALLOY.TUMBAGA.getRotor(1),
+ CI.machineCasing_ULV,
+ ALLOY.TUMBAGA.getRotor(1),
+ CI.getElectricMotor(0, 1),
+ "cableGt01RedAlloy",
+ CI.getElectricMotor(0, 1),
+ GregtechItemList.Generator_Gas_Turbine_ULV.get(1));
+
+ // Basic Combustion Turbine
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getElectricPiston(0, 1),
+ "circuitPrimitive",
+ CI.getElectricPiston(0, 1),
+ CI.getElectricMotor(0, 1),
+ CI.machineCasing_ULV,
+ CI.getElectricMotor(0, 1),
+ ALLOY.TUMBAGA.getGear(1),
+ "cableGt01RedAlloy",
+ ALLOY.TUMBAGA.getGear(1),
+ GregtechItemList.Generator_Diesel_ULV.get(1));
+
+ // Steam Condenser
+ if (CORE.ConfigSwitches.enableMachine_SteamConverter) {
+ RECIPE_SteamCondenser = GregtechItemList.Condensor_MAX.get(1);
+ RecipeUtils.addShapedGregtechRecipe(
+ pipeLargeCopper,
+ pipeHugeSteel,
+ pipeLargeCopper,
+ plateEnergeticAlloy,
+ CI.electricPump_HV,
+ plateEnergeticAlloy,
+ plateEnergeticAlloy,
+ pipeLargeCopper,
+ plateEnergeticAlloy,
+ RECIPE_SteamCondenser);
+ }
+
+ ItemStack aBronzeBricks = ItemUtils.simpleMetaStack(GregTech_API.sBlockCasings1, 10, 1);
+ // Steam Macerator Multi
+ RecipeUtils.addShapedGregtechRecipe(
+ aBronzeBricks,
+ "gemDiamond",
+ aBronzeBricks,
+ "craftingPiston",
+ ALLOY.TUMBAGA.getFrameBox(1),
+ "craftingPiston",
+ aBronzeBricks,
+ "gemDiamond",
+ aBronzeBricks,
+ GregtechItemList.Controller_SteamMaceratorMulti.get(1));
+ // Steam Compressor Multi
+ RecipeUtils.addShapedGregtechRecipe(
+ aBronzeBricks,
+ "craftingPiston",
+ aBronzeBricks,
+ ALLOY.TUMBAGA.getGear(1),
+ ALLOY.TUMBAGA.getFrameBox(1),
+ ALLOY.TUMBAGA.getGear(1),
+ aBronzeBricks,
+ "craftingPiston",
+ aBronzeBricks,
+ GregtechItemList.Controller_SteamCompressorMulti.get(1));
+
+ // Steam Hatch
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateBronze",
+ "pipeMediumBronze",
+ "plateBronze",
+ "plateBronze",
+ GregtechItemList.GT_FluidTank_ULV.get(1),
+ "plateBronze",
+ "plateBronze",
+ "pipeMediumBronze",
+ "plateBronze",
+ GregtechItemList.Hatch_Input_Steam.get(1));
+
+ // Steam Input Bus
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateBronze",
+ ALLOY.TUMBAGA.getPlate(1),
+ "plateBronze",
+ "plateTin",
+ ItemUtils.getSimpleStack(Blocks.hopper),
+ "plateTin",
+ "plateBronze",
+ ALLOY.TUMBAGA.getPlate(1),
+ "plateBronze",
+ GregtechItemList.Hatch_Input_Bus_Steam.get(1));
+
+ // Steam Output Bus
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateBronze",
+ "plateTin",
+ "plateBronze",
+ ALLOY.TUMBAGA.getPlate(1),
+ ItemUtils.getSimpleStack(Blocks.hopper),
+ ALLOY.TUMBAGA.getPlate(1),
+ "plateBronze",
+ "plateTin",
+ "plateBronze",
+ GregtechItemList.Hatch_Output_Bus_Steam.get(1));
+
+ // RF Convertor
+ if (LoadedMods.CoFHCore && CORE.ConfigSwitches.enableMachine_RF_Convetor) {
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getPlate(4, 1),
+ CI.getTieredCircuitOreDictName(5),
+ CI.getPlate(4, 1),
+ CI.getTransmissionComponent(3, 1),
+ CI.getTieredGTPPMachineCasing(4, 1),
+ CI.getTransmissionComponent(3, 1),
+ CI.getPlate(4, 1),
+ plateEnergeticAlloy,
+ CI.getPlate(4, 1),
+ GregtechItemList.Energy_Buffer_RF_Convertor.get(1));
+ }
+
+ // Egg Box
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(8),
+ CI.getTieredMachineHull(3),
+ ItemUtils.getSimpleStack(Items.egg, 64),
+ ItemUtils.getSimpleStack(ModItems.itemRope, 32),
+ CI.getPlate(4, GTNH ? 16 : 8)
+ },
+ FluidUtils.getFluidStack("mobessence", 4096),
+ ItemUtils.getSimpleStack(ModBlocks.blockEggBox, 1),
+ 20 * 60,
+ 480);
+
+ // Flask Configurator
+ if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(8),
+ CI.getTieredMachineHull(2),
+ ItemUtils.getSimpleStack(ModBlocks.blockCircuitProgrammer),
+ VolumetricFlaskHelper.getVolumetricFlask(8),
+ CI.getTieredComponent(OrePrefixes.pipeSmall, 2, GTNH ? 4 : 2),
+ CI.getPlate(2, GTNH ? 8 : 4)
+ },
+ CI.getAlternativeTieredFluid(1, 144 * 8),
+ ItemUtils.getSimpleStack(ModBlocks.blockVolumetricFlaskSetter, 1),
+ 20 * 60,
+ 120);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IronBlastFurnace) {
+
+ RECIPE_IronBlastFurnace = GregtechItemList.Machine_Iron_BlastFurnace.get(1);
+ RECIPE_IronPlatedBricks = GregtechItemList.Casing_IronPlatedBricks.get(Casing_Amount);
+
+ // Iron BF
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateDoubleAnyIron",
+ "craftingFurnace",
+ "plateDoubleAnyIron",
+ boiler_Coal,
+ CI.machineCasing_ULV,
+ boiler_Coal,
+ "plateDoubleAnyIron",
+ "bucketLava",
+ "plateDoubleAnyIron",
+ RECIPE_IronBlastFurnace);
+ // Iron plated Bricks
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateAnyIron",
+ RECIPES_Tools.craftingToolHardHammer,
+ "plateAnyIron",
+ "plateAnyIron",
+ blockBricks,
+ "plateAnyIron",
+ "plateAnyIron",
+ RECIPES_Tools.craftingToolWrench,
+ "plateAnyIron",
+ RECIPE_IronPlatedBricks);
+
+ // Add recycle recipes for the Iron Plated Bricks
+ // GT_ModHandler.addPulverisationRecipe(RECIPE_IronPlatedBricks,
+ // ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIron", 6),
+ // ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustClay", 2), true);
+ CORE.RA.addPulverisationRecipe(
+ RECIPE_IronPlatedBricks,
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIron", 6),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustClay", 2),
+ null);
+ GT_Values.RA.addArcFurnaceRecipe(
+ RECIPE_IronPlatedBricks,
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotWroughtIron", 6),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustAsh", 2)
+ },
+ new int[] {0},
+ 32 * 20,
+ 32);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialCentrifuge) {
+ // Industrial Centrifuge
+ RECIPE_IndustrialCentrifugeController = GregtechItemList.Industrial_Centrifuge.get(1);
+ RECIPE_IndustrialCentrifugeCasing = GregtechItemList.Casing_Centrifuge1.get(Casing_Amount);
+
+ // Industrial Centrifuge
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.circuitTier5,
+ pipeHugeStainlessSteel,
+ CI.circuitTier5,
+ CI.component_Plate[6],
+ EV_MACHINE_Centrifuge,
+ CI.component_Plate[6],
+ CI.component_Plate[8],
+ CI.machineCasing_IV,
+ CI.component_Plate[8],
+ RECIPE_IndustrialCentrifugeController);
+ // Centrifuge Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[6],
+ "stickTumbaga",
+ CI.component_Plate[6],
+ CI.component_Plate[8],
+ "stickTumbaga",
+ CI.component_Plate[8],
+ CI.component_Plate[6],
+ "stickTumbaga",
+ CI.component_Plate[6],
+ RECIPE_IndustrialCentrifugeCasing);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialCokeOven) {
+ // Industrial Coke Oven
+ RECIPE_IndustrialCokeOvenController = GregtechItemList.Industrial_CokeOven.get(1);
+ RECIPE_IndustrialCokeOvenFrame = GregtechItemList.Casing_CokeOven.get(Casing_Amount);
+ RECIPE_IndustrialCokeOvenCasingA = GregtechItemList.Casing_CokeOven_Coil1.get(Casing_Amount);
+ RECIPE_IndustrialCokeOvenCasingB = GregtechItemList.Casing_CokeOven_Coil2.get(Casing_Amount);
+
+ if (LoadedMods.Railcraft) {
+ // Industrial Coke Oven
+ RecipeUtils.addShapedGregtechRecipe(
+ plateCobalt,
+ CI.circuitTier4,
+ plateCobalt,
+ CI.machineCasing_HV,
+ INPUT_RCCokeOvenBlock,
+ CI.machineCasing_HV,
+ plateCobalt,
+ CI.circuitTier5,
+ plateCobalt,
+ RECIPE_IndustrialCokeOvenController);
+ }
+ if (LoadedMods.ImmersiveEngineering) {
+ // Industrial Coke Oven
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[8],
+ CI.circuitTier4,
+ CI.component_Plate[8],
+ CI.machineCasing_HV,
+ INPUT_IECokeOvenBlock,
+ CI.machineCasing_HV,
+ CI.component_Plate[8],
+ CI.circuitTier3,
+ CI.component_Plate[8],
+ RECIPE_IndustrialCokeOvenController);
+ }
+ // Coke Oven Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[7],
+ CI.component_Rod[7],
+ CI.component_Plate[7],
+ CI.component_Rod[7],
+ "frameGtTantalloy61",
+ CI.component_Rod[7],
+ CI.component_Plate[7],
+ CI.component_Rod[7],
+ CI.component_Plate[7],
+ RECIPE_IndustrialCokeOvenFrame);
+ // Coke Oven Coil 1
+ RecipeUtils.addShapedGregtechRecipe(
+ plateBronze,
+ plateBronze,
+ plateBronze,
+ "frameGtBronze",
+ CI.gearboxCasing_Tier_1,
+ "frameGtBronze",
+ plateBronze,
+ plateBronze,
+ plateBronze,
+ RECIPE_IndustrialCokeOvenCasingA);
+ // Coke Oven Coil 2
+ RecipeUtils.addShapedGregtechRecipe(
+ plateSteel,
+ plateSteel,
+ plateSteel,
+ "frameGtSteel",
+ CI.gearboxCasing_Tier_2,
+ "frameGtSteel",
+ plateSteel,
+ plateSteel,
+ plateSteel,
+ RECIPE_IndustrialCokeOvenCasingB);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialElectrolyzer) {
+ // Industrial Electrolyzer
+ RECIPE_IndustrialElectrolyzerController = GregtechItemList.Industrial_Electrolyzer.get(1);
+ RECIPE_IndustrialElectrolyzerFrame = GregtechItemList.Casing_Electrolyzer.get(Casing_Amount);
+
+ // Electrolyzer Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "platePotin",
+ "stickLongChrome",
+ "platePotin",
+ "stickLongPotin",
+ "frameGtPotin",
+ "stickLongPotin",
+ "platePotin",
+ "stickLongPotin",
+ "platePotin",
+ RECIPE_IndustrialElectrolyzerFrame);
+ // Industrial Electrolyzer
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateStellite",
+ CI.circuitTier5,
+ "plateStellite",
+ CI.machineCasing_EV,
+ EV_MACHINE_Electrolyzer,
+ CI.machineCasing_EV,
+ "plateStellite",
+ "rotorStellite",
+ "plateStellite",
+ RECIPE_IndustrialElectrolyzerController);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialPlatePress) {
+ // Industrial Material Press
+ RECIPE_IndustrialMaterialPressController = GregtechItemList.Industrial_PlatePress.get(1);
+ RECIPE_IndustrialMaterialPressFrame = GregtechItemList.Casing_MaterialPress.get(Casing_Amount);
+
+ // Material Press Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateTitanium",
+ "stickLongTumbaga",
+ "plateTitanium",
+ "stickTantalloy60",
+ "frameGtTumbaga",
+ "stickTantalloy60",
+ "plateTitanium",
+ "stickLongTumbaga",
+ "plateTitanium",
+ RECIPE_IndustrialMaterialPressFrame);
+ // Industrial Material Press
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateTitanium",
+ CI.circuitTier5,
+ "plateTitanium",
+ CI.machineCasing_EV,
+ EV_MACHINE_BendingMachine,
+ CI.machineCasing_EV,
+ "plateTitanium",
+ CI.circuitTier5,
+ "plateTitanium",
+ RECIPE_IndustrialMaterialPressController);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialMacerationStack) {
+ // Industrial Maceration Stack
+ RECIPE_IndustrialMacerationStackController = GregtechItemList.Industrial_MacerationStack.get(1);
+ RECIPE_IndustrialMacerationStackFrame = GregtechItemList.Casing_MacerationStack.get(Casing_Amount);
+
+ // Maceration Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "platePalladium",
+ "platePalladium",
+ "platePalladium",
+ "stickPlatinum",
+ "frameGtInconel625",
+ "stickPlatinum",
+ "platePalladium",
+ "stickLongPalladium",
+ "platePalladium",
+ RECIPE_IndustrialMacerationStackFrame);
+ // Industrial Maceration stack
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateTungstenCarbide",
+ EV_MACHINE_Macerator,
+ "plateTungstenCarbide",
+ HV_MACHINE_Macerator,
+ CI.circuitTier7,
+ HV_MACHINE_Macerator,
+ "plateTungstenCarbide",
+ CI.machineCasing_IV,
+ "plateTungstenCarbide",
+ RECIPE_IndustrialMacerationStackController);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialWireMill) {
+ // Industrial Wire Factory
+ RECIPE_IndustrialWireFactoryController = GregtechItemList.Industrial_WireFactory.get(1);
+ RECIPE_IndustrialWireFactoryFrame = GregtechItemList.Casing_WireFactory.get(Casing_Amount);
+
+ // Wire Factory Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateBlueSteel",
+ "stickBlueSteel",
+ "plateBlueSteel",
+ "stickBlueSteel",
+ "frameGtBlueSteel",
+ "stickBlueSteel",
+ "plateBlueSteel",
+ "stickBlueSteel",
+ "plateBlueSteel",
+ RECIPE_IndustrialWireFactoryFrame);
+ // Industrial Wire Factory
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateZeron100",
+ CI.machineCasing_IV,
+ "plateZeron100",
+ CI.circuitTier5,
+ EV_MACHINE_Wiremill,
+ CI.circuitTier5,
+ "plateZeron100",
+ CI.machineCasing_IV,
+ "plateZeron100",
+ RECIPE_IndustrialWireFactoryController);
+ }
+
+ // Tiered Tanks
+ if (CORE.ConfigSwitches.enableMachine_FluidTanks) {
+ Logger.WARNING("Is New Horizons Loaded? " + GTNH);
+ if (!GTNH) {
+
+ // Allows clearing stored fluids.
+ GregtechItemList[] aTanks = new GregtechItemList[] {
+ GregtechItemList.GT_FluidTank_ULV, GregtechItemList.GT_FluidTank_LV,
+ GregtechItemList.GT_FluidTank_MV,
+ GregtechItemList.GT_FluidTank_HV, GregtechItemList.GT_FluidTank_EV,
+ GregtechItemList.GT_FluidTank_IV,
+ GregtechItemList.GT_FluidTank_LuV, GregtechItemList.GT_FluidTank_ZPM,
+ GregtechItemList.GT_FluidTank_UV,
+ GregtechItemList.GT_FluidTank_MAX
+ };
+ for (GregtechItemList aTank : aTanks) {
+ RecipeUtils.addShapedGregtechRecipe(
+ aTank.get(1), null, null, null, null, null, null, null, null, aTank.get(1));
+ }
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[1],
+ CI.component_Plate[1],
+ CI.component_Plate[1],
+ CI.component_Plate[1],
+ pipeTier1,
+ CI.component_Plate[1],
+ CI.component_Plate[1],
+ GregtechItemList.Fluid_Cell_144L.get(1),
+ CI.component_Plate[1],
+ GregtechItemList.GT_FluidTank_ULV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[2],
+ CI.component_Plate[2],
+ CI.component_Plate[2],
+ CI.component_Plate[2],
+ pipeTier2,
+ CI.component_Plate[2],
+ CI.component_Plate[2],
+ CI.electricPump_LV,
+ CI.component_Plate[2],
+ GregtechItemList.GT_FluidTank_LV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[3],
+ CI.component_Plate[3],
+ CI.component_Plate[3],
+ CI.component_Plate[3],
+ pipeTier3,
+ CI.component_Plate[3],
+ CI.component_Plate[3],
+ CI.electricPump_MV,
+ CI.component_Plate[3],
+ GregtechItemList.GT_FluidTank_MV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[4],
+ CI.component_Plate[4],
+ CI.component_Plate[4],
+ CI.component_Plate[4],
+ pipeTier4,
+ CI.component_Plate[4],
+ CI.component_Plate[4],
+ CI.electricPump_HV,
+ CI.component_Plate[4],
+ GregtechItemList.GT_FluidTank_HV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[5],
+ CI.component_Plate[5],
+ CI.component_Plate[5],
+ CI.component_Plate[5],
+ pipeTier5,
+ CI.component_Plate[5],
+ CI.component_Plate[5],
+ CI.electricPump_EV,
+ CI.component_Plate[5],
+ GregtechItemList.GT_FluidTank_EV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[6],
+ CI.component_Plate[6],
+ CI.component_Plate[6],
+ CI.component_Plate[6],
+ pipeTier6,
+ CI.component_Plate[6],
+ CI.component_Plate[6],
+ CI.electricPump_IV,
+ CI.component_Plate[6],
+ GregtechItemList.GT_FluidTank_IV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[7],
+ CI.component_Plate[7],
+ CI.component_Plate[7],
+ CI.component_Plate[7],
+ pipeTier7,
+ CI.component_Plate[7],
+ CI.component_Plate[7],
+ CI.electricPump_LuV,
+ CI.component_Plate[7],
+ GregtechItemList.GT_FluidTank_LuV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[8],
+ CI.component_Plate[8],
+ CI.component_Plate[8],
+ CI.component_Plate[8],
+ pipeTier8,
+ CI.component_Plate[8],
+ CI.component_Plate[8],
+ CI.electricPump_ZPM,
+ CI.component_Plate[8],
+ GregtechItemList.GT_FluidTank_ZPM.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[9],
+ CI.component_Plate[9],
+ CI.component_Plate[9],
+ CI.component_Plate[9],
+ pipeTier9,
+ CI.component_Plate[9],
+ CI.component_Plate[9],
+ CI.electricPump_UV,
+ CI.component_Plate[9],
+ GregtechItemList.GT_FluidTank_UV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[10],
+ CI.component_Plate[10],
+ CI.component_Plate[10],
+ CI.component_Plate[10],
+ pipeTier10,
+ CI.component_Plate[10],
+ CI.component_Plate[10],
+ CI.electricPump_MAX,
+ CI.component_Plate[10],
+ GregtechItemList.GT_FluidTank_MAX.get(1));
+ } else {
+
+ CI.component_Plate[1] = "plateTin";
+ pipeTier1 = "pipeLargeClay";
+ CI.circuitTier1 = ItemList.Circuit_Primitive.get(1);
+ CI.component_Plate[2] = "plateCopper";
+ pipeTier2 = "pipeHugeClay";
+ CI.component_Plate[3] = "plateBronze";
+ pipeTier3 = "pipeMediumBronze";
+ CI.component_Plate[4] = "plateIron";
+ pipeTier4 = "pipeMediumSteel";
+ CI.component_Plate[5] = "plateSteel";
+ CI.component_Plate[6] = "plateRedstone";
+ CI.component_Plate[7] = "plateAluminium";
+ CI.component_Plate[8] = "plateDarkSteel";
+ ItemStack waterBucket = ItemUtils.getSimpleStack(Items.water_bucket);
+
+ // Allows clearing stored fluids.
+ GregtechItemList[] aTanks = new GregtechItemList[] {
+ GregtechItemList.GT_FluidTank_ULV,
+ GregtechItemList.GT_FluidTank_LV,
+ GregtechItemList.GT_FluidTank_MV,
+ GregtechItemList.GT_FluidTank_HV
+ };
+ for (GregtechItemList aTank : aTanks) {
+ RecipeUtils.addShapedGregtechRecipe(
+ aTank.get(1), null, null, null, null, null, null, null, null, aTank.get(1));
+ }
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[1],
+ CI.component_Plate[5],
+ CI.component_Plate[1],
+ CI.component_Plate[4],
+ pipeTier1,
+ CI.component_Plate[4],
+ CI.component_Plate[4],
+ waterBucket,
+ CI.component_Plate[4],
+ GregtechItemList.GT_FluidTank_ULV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[5],
+ CI.component_Plate[4],
+ CI.component_Plate[5],
+ CI.component_Plate[3],
+ pipeTier2,
+ CI.component_Plate[3],
+ CI.component_Plate[3],
+ CI.electricPump_LV,
+ CI.component_Plate[3],
+ GregtechItemList.GT_FluidTank_LV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[8],
+ CI.component_Plate[3],
+ CI.component_Plate[8],
+ CI.component_Plate[5],
+ pipeTier3,
+ CI.component_Plate[5],
+ CI.component_Plate[5],
+ CI.electricPump_LV,
+ CI.component_Plate[5],
+ GregtechItemList.GT_FluidTank_MV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.circuitTier1,
+ CI.component_Plate[7],
+ CI.circuitTier1,
+ CI.component_Plate[8],
+ pipeTier4,
+ CI.component_Plate[8],
+ CI.circuitTier1,
+ CI.electricPump_MV,
+ CI.circuitTier1,
+ GregtechItemList.GT_FluidTank_HV.get(1));
+ }
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_MultiTank) {
+ // Industrial Multi Tank
+ // RECIPE_IndustrialMultiTankController = GregtechItemList.Industrial_MultiTank.get(1);
+ RECIPE_IndustrialMultiTankFrame = GregtechItemList.Casing_MultitankExterior.get(Casing_Amount);
+
+ // Industrial Multi Tank Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "stickGrisium",
+ "plateGrisium",
+ "stickGrisium",
+ "plateGrisium",
+ "frameGtGrisium",
+ "plateGrisium",
+ "plateGrisium",
+ "plateGrisium",
+ "plateGrisium",
+ RECIPE_IndustrialMultiTankFrame);
+ // Industrial Multi Tank
+ RecipeUtils.addShapedGregtechRecipe(
+ "pipeHugeTantalloy60",
+ "gearGrisium",
+ "pipeHugeTantalloy60",
+ CI.circuitTier4,
+ RECIPE_IndustrialMultiTankFrame,
+ CI.circuitTier4,
+ "plateDoubleGrisium",
+ "rotorGrisium",
+ "plateDoubleGrisium",
+ RECIPE_IndustrialMultiTankController);
+ }
+ // TODO
+
+ // Semi-Fluid Generators
+ ItemStack[][] aSemiFluidInputs = new ItemStack[3][6];
+ aSemiFluidInputs[0] = new ItemStack[] {
+ CI.getNumberedBioCircuit(14),
+ CI.getTieredMachineHull(1, 1),
+ CI.getElectricPiston(1, GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.circuit, 1, GTNH ? 4 : 2),
+ CI.getPlate(1, GTNH ? 8 : 4),
+ CI.getGear(1, GTNH ? 4 : 2)
+ };
+ aSemiFluidInputs[1] = new ItemStack[] {
+ CI.getNumberedCircuit(14),
+ CI.getTieredMachineHull(2, 1),
+ CI.getElectricPiston(2, GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.circuit, 2, GTNH ? 4 : 2),
+ CI.getPlate(2, GTNH ? 8 : 4),
+ CI.getGear(2, GTNH ? 4 : 2)
+ };
+ aSemiFluidInputs[2] = new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(14),
+ CI.getTieredMachineHull(3, 1),
+ CI.getElectricPiston(3, GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.circuit, 3, GTNH ? 4 : 2),
+ CI.getPlate(3, GTNH ? 8 : 4),
+ CI.getGear(3, GTNH ? 4 : 2)
+ };
+ FluidStack[] aSemiFluidFluidInputs = new FluidStack[] {
+ ALLOY.BRONZE.getFluidStack(144 * 8),
+ ALLOY.STEEL.getFluidStack(144 * 8),
+ ELEMENT.getInstance().ALUMINIUM.getFluidStack(144 * 8),
+ };
+
+ // ItemUtils.simpleMetaStack("IC2:blockGenerator:7", 7, 1);
+ ItemStack[] aSemifluids = new ItemStack[] {
+ GregtechItemList.Generator_SemiFluid_LV.get(1),
+ GregtechItemList.Generator_SemiFluid_MV.get(1),
+ GregtechItemList.Generator_SemiFluid_HV.get(1)
+ };
+ for (int o = 0; o < 3; o++) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ aSemiFluidInputs[o],
+ aSemiFluidFluidInputs[o],
+ aSemifluids[o],
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(o + 1));
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_AlloyBlastSmelter) {
+ // Industrial Blast Smelter
+ RECIPE_IndustrialBlastSmelterController = GregtechItemList.Industrial_AlloyBlastSmelter.get(1);
+ RECIPE_IndustrialBlastSmelterFrame = GregtechItemList.Casing_BlastSmelter.get(Casing_Amount);
+ RECIPE_IndustrialBlastSmelterCoil = GregtechItemList.Casing_Coil_BlastSmelter.get(Casing_Amount);
+
+ // Blast Smelter
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateZirconiumCarbide",
+ CI.circuitTier4,
+ "plateZirconiumCarbide",
+ cableTier4,
+ EV_MACHINE_AlloySmelter,
+ cableTier4,
+ "plateZirconiumCarbide",
+ CI.circuitTier3,
+ "plateZirconiumCarbide",
+ RECIPE_IndustrialBlastSmelterController);
+ // Blast Smelter Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateZirconiumCarbide",
+ CI.component_Rod[5],
+ "plateZirconiumCarbide",
+ CI.component_Rod[5],
+ "frameGtTumbaga",
+ CI.component_Rod[5],
+ "plateZirconiumCarbide",
+ CI.component_Rod[5],
+ "plateZirconiumCarbide",
+ RECIPE_IndustrialBlastSmelterFrame);
+ // Blast Smelter Coil
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateStaballoy",
+ "plateStaballoy",
+ "plateStaballoy",
+ "frameGtStaballoy",
+ CI.gearboxCasing_Tier_3,
+ "frameGtStaballoy",
+ "plateStaballoy",
+ "plateStaballoy",
+ "plateStaballoy",
+ RECIPE_IndustrialBlastSmelterCoil);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_MatterFabricator) {
+ // Industrial Matter Fabricator
+ RECIPE_IndustrialMatterFabController = GregtechItemList.Industrial_MassFab.get(1);
+ RECIPE_IndustrialMatterFabFrame = GregtechItemList.Casing_MatterFab.get(Casing_Amount);
+ RECIPE_IndustrialMatterFabCoil = GregtechItemList.Casing_MatterGen.get(Casing_Amount);
+
+ // Matter Fabricator CPU
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getDoublePlate(8, 1),
+ CI.circuitTier5,
+ CI.getPlate(8, 1),
+ cableTier8,
+ CI.machineCasing_LuV,
+ cableTier8,
+ CI.getPlate(8, 1),
+ CI.circuitTier5,
+ CI.getPlate(8, 1),
+ RECIPE_IndustrialMatterFabController);
+ // Matter Fabricator Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateNiobiumCarbide",
+ CI.component_Rod[8],
+ "plateNiobiumCarbide",
+ CI.component_Rod[8],
+ "frameGtInconel690",
+ CI.component_Rod[8],
+ "plateNiobiumCarbide",
+ CI.component_Rod[8],
+ "plateNiobiumCarbide",
+ RECIPE_IndustrialMatterFabFrame);
+ // Matter Fabricator Coil
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getPlate(6, 1),
+ CI.getPlate(7, 1),
+ CI.getPlate(6, 1),
+ "frameGtStellite",
+ CI.machineCasing_UV,
+ "frameGtStellite",
+ CI.getPlate(6, 1),
+ CI.getPlate(7, 1),
+ CI.getPlate(6, 1),
+ RECIPE_IndustrialMatterFabCoil);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialSifter) {
+ // Industrial Sieve
+ RECIPE_IndustrialSieveController = GregtechItemList.Industrial_Sifter.get(1);
+ RECIPE_IndustrialSieveFrame = GregtechItemList.Casing_Sifter.get(Casing_Amount);
+ RECIPE_IndustrialSieveGrate = GregtechItemList.Casing_SifterGrate.get(Casing_Amount);
+
+ // Industrial Sieve
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateEglinSteel",
+ CI.circuitTier3,
+ "plateEglinSteel",
+ cableTier4,
+ EV_MACHINE_Sifter,
+ cableTier4,
+ "plateEglinSteel",
+ CI.circuitTier3,
+ "plateEglinSteel",
+ RECIPE_IndustrialSieveController);
+ // Industrial Sieve Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateEglinSteel",
+ "plateEglinSteel",
+ "plateEglinSteel",
+ "plateEglinSteel",
+ "frameGtTumbaga",
+ "plateEglinSteel",
+ "plateEglinSteel",
+ "plateEglinSteel",
+ "plateEglinSteel",
+ RECIPE_IndustrialSieveFrame);
+ // Industrial Sieve Grate
+ RecipeUtils.addShapedGregtechRecipe(
+ "frameGtEglinSteel",
+ "wireFineSteel",
+ "frameGtEglinSteel",
+ "wireFineSteel",
+ "wireFineSteel",
+ "wireFineSteel",
+ "frameGtEglinSteel",
+ "wireFineSteel",
+ "frameGtEglinSteel",
+ RECIPE_IndustrialSieveGrate);
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer) {
+ // Industrial Tree Farmer
+ RECIPE_TreeFarmController = GregtechItemList.Industrial_TreeFarm.get(1);
+ RECIPE_TreeFarmFrame = GregtechItemList.Casing_PLACEHOLDER_TreeFarmer.get(Casing_Amount);
+ // Industrial Tree Farm Controller
+ if (!GTNH) {
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateEglinSteel",
+ "rotorEglinSteel",
+ "plateEglinSteel",
+ "cableGt02Steel",
+ "pipeMediumSteel",
+ "cableGt02Steel",
+ "plateEglinSteel",
+ CI.machineCasing_MV,
+ "plateEglinSteel",
+ RECIPE_TreeFarmController);
+ } else {
+ RecipeUtils.addShapedGregtechRecipe(
+ ItemList.Field_Generator_IV.get(1),
+ ALLOY.INCOLOY_MA956.getRotor(1),
+ ItemList.Field_Generator_IV.get(1),
+ ALLOY.NITINOL_60.getPlate(1),
+ GregtechItemList.GTPP_Casing_IV.get(1),
+ ALLOY.NITINOL_60.getPlate(1),
+ ItemList.Field_Generator_IV.get(1),
+ ALLOY.INCONEL_792.getComponentByPrefix(OrePrefixes.pipeMedium, 1),
+ ItemList.Field_Generator_IV.get(1),
+ RECIPE_TreeFarmController);
+ }
+ // Industrial Tree Farm Frame
+ GT_Values.RA.addAssemblerRecipe(
+ new ItemStack[] {
+ GT_Utility.getIntegratedCircuit(2),
+ ALLOY.INCONEL_625.getFrameBox(1),
+ ALLOY.HASTELLOY_X.getComponentByPrefix(OrePrefixes.pipeTiny, 1),
+ ItemList.Electric_Pump_EV.get(2),
+ ItemList.HV_Coil.get(4),
+ ItemList.IC2_Plantball.get(8),
+ GT_OreDictUnificator.get(OrePrefixes.plank, Materials.Wood, 6),
+ },
+ GT_ModHandler.getDistilledWater(8000),
+ RECIPE_TreeFarmFrame,
+ 60,
+ 1960);
+ }
+
+ if (CORE.ConfigSwitches.enableMachine_Tesseracts) {
+ // Tesseracts
+ RECIPE_TesseractGenerator = GregtechItemList.GT4_Tesseract_Generator.get(1);
+ RECIPE_TesseractTerminal = GregtechItemList.GT4_Tesseract_Terminal.get(1);
+ // Tesseract Generator
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateTitanium",
+ "circuitMaster",
+ "plateTitanium",
+ "circuitMaster",
+ ItemUtils.getSimpleStack(Blocks.ender_chest),
+ "circuitMaster",
+ "plateTitanium",
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ "plateTitanium",
+ RECIPE_TesseractGenerator);
+ // Tesseract Terminal
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateTitanium",
+ "circuitElite",
+ "plateTitanium",
+ "circuitElite",
+ ItemUtils.getSimpleStack(Blocks.ender_chest),
+ "circuitElite",
+ "plateTitanium",
+ CI.machineHull_EV,
+ "plateTitanium",
+ RECIPE_TesseractTerminal);
+ }
+
+ if (CORE.ConfigSwitches.enableMachine_SimpleWasher) {
+ ItemStack plateWrought = ItemUtils.getItemStackOfAmountFromOreDict("plateWroughtIron", 1);
+ ItemStack washerPipe;
+
+ if (CORE.ConfigSwitches.enableCustom_Pipes) {
+ washerPipe = ItemUtils.getItemStackOfAmountFromOreDict("pipeLargeClay", 1);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateWrought,
+ CI.electricPump_LV,
+ plateWrought,
+ plateWrought,
+ washerPipe,
+ plateWrought,
+ plateWrought,
+ CI.machineCasing_ULV,
+ plateWrought,
+ GregtechItemList.SimpleDustWasher_ULV.get(1));
+ }
+ // Add Recipe
+ washerPipe = ItemUtils.getItemStackOfAmountFromOreDict("pipeLargeCopper", 1);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateWrought,
+ CI.electricPump_LV,
+ plateWrought,
+ plateWrought,
+ washerPipe,
+ plateWrought,
+ plateWrought,
+ CI.machineCasing_ULV,
+ plateWrought,
+ GregtechItemList.SimpleDustWasher_ULV.get(1));
+
+ int aSimpleWasherTier = 2;
+ int aSlot = 0;
+ ItemStack[][] aInputsForSimpleWashers = new ItemStack[4][6];
+
+ aInputsForSimpleWashers[0] = new ItemStack[] {
+ CI.getTieredMachineHull(2),
+ CI.getTieredComponent(OrePrefixes.screw, 2, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.plate, 1, GTNH ? 8 : 4),
+ CI.getTieredComponent(OrePrefixes.rod, 2, GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.circuit, 2, GTNH ? 3 : 1),
+ };
+ aInputsForSimpleWashers[1] = new ItemStack[] {
+ CI.getTieredMachineHull(4),
+ CI.getTieredComponent(OrePrefixes.screw, 4, GTNH ? 24 : 12),
+ CI.getTieredComponent(OrePrefixes.plate, 3, GTNH ? 12 : 6),
+ CI.getTieredComponent(OrePrefixes.rod, 4, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.circuit, 4, GTNH ? 4 : 2),
+ };
+ aInputsForSimpleWashers[2] = new ItemStack[] {
+ CI.getTieredMachineHull(6),
+ CI.getTieredComponent(OrePrefixes.screw, 6, GTNH ? 48 : 24),
+ CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 8 : 4),
+ CI.getTieredComponent(OrePrefixes.circuit, 6, GTNH ? 6 : 3),
+ };
+ aInputsForSimpleWashers[3] = new ItemStack[] {
+ CI.getTieredMachineHull(8),
+ CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 64 : 32),
+ CI.getTieredComponent(OrePrefixes.plate, 7, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.rod, 8, GTNH ? 10 : 5),
+ CI.getTieredComponent(OrePrefixes.circuit, 8, GTNH ? 8 : 4),
+ };
+
+ ItemStack[] aSimpleWashers = new ItemStack[] {
+ GregtechItemList.SimpleDustWasher_MV.get(1),
+ GregtechItemList.SimpleDustWasher_EV.get(1),
+ GregtechItemList.SimpleDustWasher_LuV.get(1),
+ GregtechItemList.SimpleDustWasher_UV.get(1)
+ };
+ for (int i = 0; i < 4; i++) {
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ aInputsForSimpleWashers[aSlot],
+ CI.getTieredFluid(aSimpleWasherTier, 144 * aSimpleWasherTier),
+ aSimpleWashers[aSlot],
+ 20 * 15 * aSimpleWasherTier,
+ (int) GT_Values.V[aSimpleWasherTier]);
+
+ aSimpleWasherTier += 2;
+ aSlot++;
+ }
+ }
+
+ if (CORE.ConfigSwitches.enableMachine_Pollution && PollutionUtils.isPollutionEnabled()) {
+
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateCarbon",
+ "plateCarbon",
+ "plateCarbon",
+ "dustCarbon",
+ "dustCarbon",
+ "dustCarbon",
+ "plateCarbon",
+ "plateCarbon",
+ "plateCarbon",
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1));
+
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateCarbon",
+ "plateCarbon",
+ "plateCarbon",
+ "cellLithiumPeroxide",
+ "dustCarbon",
+ "cellLithiumPeroxide",
+ "plateCarbon",
+ "plateCarbon",
+ "plateCarbon",
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1));
+
+ // Pollution Detector
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateSteel",
+ CI.sensor_LV,
+ "plateSteel",
+ "plateSteel",
+ CI.electricMotor_LV,
+ "plateSteel",
+ CI.getTieredCircuit(1),
+ CI.machineHull_LV,
+ CI.getTieredCircuit(1),
+ GregtechItemList.Pollution_Detector.get(1));
+
+ // ULV
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[0],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1),
+ CI.component_Plate[0],
+ CI.component_Plate[0],
+ CI.electricMotor_ULV,
+ CI.component_Plate[0],
+ CI.getTieredCircuit(0),
+ CI.machineHull_ULV,
+ CI.getTieredCircuit(0),
+ GregtechItemList.Pollution_Cleaner_ULV.get(1));
+ // LV
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[1],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1),
+ CI.component_Plate[1],
+ CI.component_Plate[1],
+ CI.electricMotor_LV,
+ CI.component_Plate[1],
+ CI.getTieredCircuit(1),
+ CI.machineHull_LV,
+ CI.getTieredCircuit(1),
+ GregtechItemList.Pollution_Cleaner_LV.get(1));
+ // MV
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[2],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1),
+ CI.component_Plate[2],
+ CI.component_Plate[2],
+ CI.electricMotor_MV,
+ CI.component_Plate[2],
+ CI.getTieredCircuit(2),
+ CI.machineHull_MV,
+ CI.getTieredCircuit(2),
+ GregtechItemList.Pollution_Cleaner_MV.get(1));
+ // HV
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[3],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1),
+ CI.component_Plate[3],
+ CI.component_Plate[3],
+ CI.electricMotor_HV,
+ CI.component_Plate[3],
+ CI.getTieredCircuit(3),
+ CI.machineHull_HV,
+ CI.getTieredCircuit(3),
+ GregtechItemList.Pollution_Cleaner_HV.get(1));
+ // EV
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[4],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1),
+ CI.component_Plate[4],
+ CI.component_Plate[4],
+ CI.electricMotor_EV,
+ CI.component_Plate[4],
+ CI.getTieredCircuit(4),
+ CI.machineHull_EV,
+ CI.getTieredCircuit(4),
+ GregtechItemList.Pollution_Cleaner_EV.get(1));
+ // IV
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[5],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1),
+ CI.component_Plate[5],
+ CI.component_Plate[5],
+ CI.electricMotor_IV,
+ CI.component_Plate[5],
+ CI.getTieredCircuit(5),
+ CI.machineHull_IV,
+ CI.getTieredCircuit(5),
+ GregtechItemList.Pollution_Cleaner_IV.get(1));
+ // LuV
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[6],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1),
+ CI.component_Plate[6],
+ CI.component_Plate[6],
+ CI.electricMotor_LuV,
+ CI.component_Plate[6],
+ CI.getTieredCircuit(6),
+ CI.machineHull_LuV,
+ CI.getTieredCircuit(6),
+ GregtechItemList.Pollution_Cleaner_LuV.get(1));
+ // ZPM
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[7],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1),
+ CI.component_Plate[7],
+ CI.component_Plate[7],
+ CI.electricMotor_ZPM,
+ CI.component_Plate[7],
+ CI.getTieredCircuit(7),
+ CI.machineHull_ZPM,
+ CI.getTieredCircuit(7),
+ GregtechItemList.Pollution_Cleaner_ZPM.get(1));
+ // UV
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[8],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1),
+ CI.component_Plate[8],
+ CI.component_Plate[8],
+ CI.electricMotor_UV,
+ CI.component_Plate[8],
+ CI.getTieredCircuit(8),
+ CI.machineHull_UV,
+ CI.getTieredCircuit(8),
+ GregtechItemList.Pollution_Cleaner_UV.get(1));
+ // MAX
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[9],
+ ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 1, 1),
+ CI.component_Plate[9],
+ CI.component_Plate[9],
+ CI.electricMotor_MAX,
+ CI.component_Plate[9],
+ CI.getTieredCircuit(9),
+ CI.machineHull_MAX,
+ CI.getTieredCircuit(9),
+ GregtechItemList.Pollution_Cleaner_MAX.get(1));
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_ThermalBoiler) {
+ RECIPE_ThermalBoilerController = GregtechItemList.GT4_Thermal_Boiler.get(1);
+ RECIPE_ThermalBoilerCasing = GregtechItemList.Casing_ThermalContainment.get(GTNH ? 1 : 2);
+ ItemStack centrifugeHV =
+ GTNH ? ItemList.Machine_IV_Centrifuge.get(1) : ItemList.Machine_EV_Centrifuge.get(1);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ "craftingGeothermalGenerator",
+ centrifugeHV,
+ "craftingGeothermalGenerator",
+ "gearGtTitanium",
+ CI.getTieredCircuitOreDictName(6),
+ "gearGtTitanium",
+ "craftingGeothermalGenerator",
+ centrifugeHV,
+ "craftingGeothermalGenerator",
+ RECIPE_ThermalBoilerController);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ "craftingGeothermalGenerator",
+ centrifugeHV,
+ "craftingGeothermalGenerator",
+ "gearGtTungstenSteel",
+ CI.getTieredCircuitOreDictName(5),
+ "gearGtTungstenSteel",
+ "craftingGeothermalGenerator",
+ centrifugeHV,
+ "craftingGeothermalGenerator",
+ RECIPE_ThermalBoilerController);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ ALLOY.MARAGING350.getPlate(1),
+ "plateStainlessSteel",
+ ALLOY.MARAGING350.getPlate(1),
+ "circuitAdvanced",
+ CI.machineCasing_HV,
+ "circuitAdvanced",
+ ALLOY.MARAGING350.getPlate(1),
+ ALLOY.MARAGING350.getPlate(1),
+ ALLOY.MARAGING350.getPlate(1),
+ RECIPE_ThermalBoilerCasing);
+
+ // Lava Filter Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(18),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFineSteel", GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict("ringTumbaga", GTNH ? 32 : 16),
+ ItemUtils.getItemStackOfAmountFromOreDict("foilCopper", GTNH ? 8 : 4),
+ ItemUtils.getItemStackWithMeta(
+ LoadedMods.IndustrialCraft2, "IC2:itemPartCarbonMesh", "RawCarbonMesh", 0, 64),
+ },
+ CI.getTieredFluid(3, 144),
+ ItemUtils.getSimpleStack(ModItems.itemLavaFilter, GTNH ? 8 : 16),
+ 1600,
+ 240);
+ }
+
+ // Air Intake Hatch
+ ItemList FluidRegulator_IV = ItemUtils.getValueOfItemList("FluidRegulator_IV", ItemList.Pump_IV);
+ ItemStack aTieredFluidRegulator =
+ CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? FluidRegulator_IV.get(1) : ItemList.Pump_IV.get(1);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[6],
+ ItemList.Casing_Grate.get(1),
+ CI.component_Plate[6],
+ CI.component_Plate[6],
+ CI.getFluidRegulator(5, 1),
+ CI.component_Plate[6],
+ CI.getTieredCircuit(5),
+ ItemList.Hatch_Input_IV.get(1),
+ CI.getTieredCircuit(5),
+ GregtechItemList.Hatch_Air_Intake.get(1));
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getPlate(6, 1),
+ ItemList.Casing_Gearbox_Titanium.get(1),
+ CI.getPlate(6, 1),
+ CI.getPlate(6, 1),
+ CI.getFluidRegulator(5, 1),
+ CI.getPlate(6, 1),
+ CI.getTieredCircuit(6),
+ ItemList.Hatch_Input_IV.get(1),
+ CI.getTieredCircuit(6),
+ GregtechItemList.Hatch_Reservoir.get(1));
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getPlate(7, 1),
+ GregtechItemList.Hatch_Air_Intake.get(1),
+ CI.getPlate(7, 1),
+ CI.getPlate(7, 1),
+ CI.getFluidRegulator(7, 1),
+ CI.getPlate(7, 1),
+ CI.getTieredCircuit(7),
+ ItemList.Hatch_Input_ZPM.get(1),
+ CI.getTieredCircuit(7),
+ GregtechItemList.Hatch_Air_Intake_Extreme.get(1));
+
+ if (CORE.ConfigSwitches.enableMultiblock_LiquidFluorideThoriumReactor) {
+
+ // Thorium Reactor
+ RECIPE_LFTRController = GregtechItemList.ThoriumReactor.get(1);
+ RECIPE_LFTRInnerCasing = GregtechItemList.Casing_Reactor_II.get(1); // Zeron
+ RECIPE_LFTROuterCasing = GregtechItemList.Casing_Reactor_I.get(1); // Hastelloy
+
+ ItemStack controlCircuit = ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR);
+ if (!GTNH) {
+ RecipeUtils.addShapedGregtechRecipe(
+ controlCircuit,
+ "cableGt12NaquadahAlloy",
+ controlCircuit,
+ "plateDoubleHastelloyN",
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ "plateDoubleHastelloyN",
+ "plateThorium232",
+ CI.machineHull_EV,
+ "plateThorium232",
+ RECIPE_LFTRController);
+ } else {
+ RecipeUtils.addShapedGregtechRecipe(
+ controlCircuit,
+ "cableGt12Naquadah",
+ controlCircuit,
+ "plateDoubleHastelloyN",
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ "plateDoubleHastelloyN",
+ "plateThorium232",
+ CI.machineHull_IV,
+ "plateThorium232",
+ RECIPE_LFTRController);
+ }
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateDoubleHastelloyC276",
+ CI.craftingToolScrewdriver,
+ "plateDoubleHastelloyC276",
+ "gearGtTalonite",
+ CI.fieldGenerator_MV,
+ "gearGtTalonite",
+ "plateDoubleHastelloyC276",
+ CI.craftingToolHammer_Hard,
+ "plateDoubleHastelloyC276",
+ RECIPE_LFTRInnerCasing);
+
+ ItemStack IC2HeatPlate = ItemUtils.getItemStackFromFQRN("IC2:reactorPlatingHeat", 1);
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateDoubleHastelloyN",
+ IC2HeatPlate,
+ "plateDoubleHastelloyN",
+ IC2HeatPlate,
+ "frameGtHastelloyC276",
+ IC2HeatPlate,
+ "plateDoubleHastelloyN",
+ IC2HeatPlate,
+ "plateDoubleHastelloyN",
+ RECIPE_LFTROuterCasing);
+
+ // LFTR Control Circuit
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 1),
+ CI.fieldGenerator_HV
+ },
+ null,
+ controlCircuit,
+ 240 * 20,
+ 500);
+
+ // Fission Fuel Plant
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getTieredCircuitOreDictName(5),
+ CI.craftingToolSolderingIron,
+ CI.getTieredCircuitOreDictName(5),
+ "plateDenseTungstenSteel",
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ "plateDenseTungstenSteel",
+ "gearGtStellite",
+ CI.machineHull_IV,
+ "gearGtStellite",
+ GregtechItemList.Industrial_FuelRefinery.get(1));
+
+ ItemStack mInnerTank;
+
+ if (GTNH || !CORE.ConfigSwitches.enableMachine_FluidTanks) {
+ mInnerTank = ItemList.Quantum_Tank_LV.get(1);
+ } else {
+ mInnerTank = GregtechItemList.GT_FluidTank_EV.get(1);
+ }
+
+ // Incoloy Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateIncoloyDS",
+ "pipeHugeStaballoy",
+ "plateIncoloyDS",
+ "gearGtIncoloyDS",
+ mInnerTank,
+ "gearGtIncoloyDS",
+ "plateIncoloyDS",
+ "pipeHugeStaballoy",
+ "plateIncoloyDS",
+ GregtechItemList.Casing_Refinery_Internal.get(Casing_Amount));
+
+ // Hastelloy-N Sealant Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateIncoloyMA956",
+ "plateHastelloyN",
+ "plateIncoloyMA956",
+ "plateHastelloyN",
+ "frameGtHastelloyC276",
+ "plateHastelloyN",
+ "plateIncoloyMA956",
+ "plateHastelloyN",
+ "plateIncoloyMA956",
+ GregtechItemList.Casing_Refinery_External.get(Casing_Amount));
+
+ // Hastelloy-X Structural Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "ringInconel792",
+ "gearGtHastelloyX",
+ CI.component_Plate[5],
+ CI.craftingToolHammer_Hard,
+ "frameGtHastelloyC276",
+ CI.craftingToolWrench,
+ CI.component_Plate[5],
+ CI.getTieredMachineCasing(4),
+ "ringInconel792",
+ GregtechItemList.Casing_Refinery_Structural.get(Casing_Amount));
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getPlate(5, 1),
+ ALLOY.HASTELLOY_X.getPlateDouble(1),
+ CI.getPlate(5, 1),
+ CI.getPlate(5, 1),
+ CI.getTieredMachineCasing(5),
+ CI.getPlate(5, 1),
+ CI.getRobotArm(5, 1),
+ ItemList.Casing_FrostProof.get(1),
+ CI.getRobotArm(5, 1),
+ GregtechItemList.ColdTrap_IV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getPlate(7, 1),
+ ALLOY.HS188A.getPlateDouble(1),
+ CI.getPlate(7, 1),
+ CI.getPlate(7, 1),
+ GregtechItemList.ColdTrap_IV.get(1),
+ CI.getPlate(7, 1),
+ CI.getRobotArm(7, 1),
+ ItemList.Casing_FrostProof.get(1),
+ CI.getRobotArm(7, 1),
+ GregtechItemList.ColdTrap_ZPM.get(1));
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getFieldGenerator(3, 1),
+ CI.getRobotArm(5, 1),
+ CI.getPlate(5, 1),
+ ALLOY.HASTELLOY_N.getPlateDouble(1),
+ ItemList.Machine_IV_ChemicalReactor.get(1),
+ ALLOY.HASTELLOY_N.getPlateDouble(1),
+ CI.getPlate(5, 1),
+ ALLOY.HASTELLOY_N.getPlateDouble(1),
+ CI.getFieldGenerator(3, 1),
+ GregtechItemList.ReactorProcessingUnit_IV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getFieldGenerator(5, 1),
+ CI.getRobotArm(7, 1),
+ CI.getPlate(7, 1),
+ ALLOY.HS188A.getPlateDouble(1),
+ GregtechItemList.ReactorProcessingUnit_IV.get(1),
+ ALLOY.HS188A.getPlateDouble(1),
+ CI.getPlate(7, 1),
+ ALLOY.HS188A.getPlateDouble(1),
+ CI.getFieldGenerator(5, 1),
+ GregtechItemList.ReactorProcessingUnit_ZPM.get(1));
+ }
+
+ // Shelves
+ RecipeUtils.addShapedGregtechRecipe(
+ "screwWood",
+ "plateWood",
+ "screwWood",
+ CI.craftingToolHammer_Hard,
+ "frameGtWood",
+ CI.craftingToolHammer_Soft,
+ "plateWood",
+ "plateWood",
+ "plateWood",
+ GregtechItemList.GT4_Shelf.get(2));
+
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {GregtechItemList.GT4_Shelf.get(1)}, GregtechItemList.GT4_Shelf_Compartment.get(1));
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {GregtechItemList.GT4_Shelf_Compartment.get(1)},
+ GregtechItemList.GT4_Shelf_Desk.get(1));
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {GregtechItemList.GT4_Shelf_Desk.get(1)}, GregtechItemList.GT4_Shelf_Iron.get(1));
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {GregtechItemList.GT4_Shelf_Iron.get(1)},
+ GregtechItemList.GT4_Shelf_FileCabinet.get(1));
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {GregtechItemList.GT4_Shelf_FileCabinet.get(1)}, GregtechItemList.GT4_Shelf.get(1));
+
+ // Cyclotron
+ if (CORE.ConfigSwitches.enableMultiblock_Cyclotron) {
+ RECIPE_CyclotronController = GregtechItemList.COMET_Cyclotron.get(1);
+ RECIPE_CyclotronOuterCasing = GregtechItemList.Casing_Cyclotron_External.get(Casing_Amount);
+ RECIPE_CyclotronInnerCoil = GregtechItemList.Casing_Cyclotron_Coil.get(1);
+
+ // Outer Casing
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemList.Casing_FrostProof.get(1),
+ ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 0, GTNH ? 8 : 4),
+ ALLOY.INCOLOY_DS.getPlate(GTNH ? 16 : 8),
+ ALLOY.INCONEL_690.getScrew(GTNH ? 32 : 16),
+ ALLOY.EGLIN_STEEL.getLongRod(GTNH ? 16 : 4),
+ CI.getElectricPiston(3, GTNH ? 4 : 2)
+ },
+ ALLOY.ZIRCONIUM_CARBIDE.getFluidStack(144 * 8), // Input Fluid
+ RECIPE_CyclotronOuterCasing,
+ 30 * 20 * 2,
+ MaterialUtils.getVoltageForTier(4));
+
+ // Inner Coil
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemList.Casing_Coil_Nichrome.get(1),
+ ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 1, GTNH ? 32 : 8),
+ ALLOY.INCOLOY_MA956.getPlate(GTNH ? 16 : 8),
+ ALLOY.TANTALLOY_61.getBolt(GTNH ? 32 : 16),
+ ALLOY.INCOLOY_020.getScrew(GTNH ? 64 : 32),
+ CI.getFieldGenerator(4, GTNH ? 2 : 1)
+ },
+ ALLOY.HG1223.getFluidStack(144 * 5), // Input Fluid
+ RECIPE_CyclotronInnerCoil,
+ 60 * 20 * 2,
+ MaterialUtils.getVoltageForTier(5));
+
+ // Controller
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.machineHull_IV,
+ ItemUtils.getSimpleStack(RECIPE_CyclotronInnerCoil, GTNH ? 4 : 2),
+ ALLOY.INCOLOY_020.getPlate(GTNH ? 16 : 8),
+ ALLOY.TANTALLOY_61.getGear(GTNH ? 4 : 2),
+ ALLOY.INCOLOY_MA956.getScrew(GTNH ? 64 : 16),
+ ItemUtils.getItemStackOfAmountFromOreDict(
+ CI.getTieredCircuitOreDictName(GTNH ? 6 : 5), GTNH ? 8 : 16)
+ },
+ ALLOY.INCOLOY_020.getFluidStack(144 * 9), // Input Fluid
+ RECIPE_CyclotronController,
+ 60 * 20 * 5,
+ MaterialUtils.getVoltageForTier(5));
+ }
+
+ // Mazut
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Controller_LargeSemifluidGenerator.get(1L), CI.bitsd, new Object[] {
+ "PCP",
+ "EME",
+ "GWG",
+ 'M',
+ ItemList.Hull_EV,
+ 'P',
+ ItemList.Electric_Piston_EV,
+ 'E',
+ ItemList.Electric_Pump_EV,
+ 'C',
+ OrePrefixes.circuit.get(Materials.Data),
+ 'W',
+ OrePrefixes.cableGt08.get(Materials.Electrum),
+ 'G',
+ ALLOY.INCONEL_792.getGear(1)
+ });
+
+ if (CORE.ConfigSwitches.enableMultiblock_PowerSubstation) {
+ RecipeUtils.addShapedRecipe(
+ "screwTitanium",
+ "plateIncoloy020",
+ "screwTitanium",
+ "plateIncoloy020",
+ "frameGtIncoloyMA956",
+ "plateIncoloy020",
+ "screwTitanium",
+ "plateIncoloy020",
+ "screwTitanium",
+ GregtechItemList.Casing_Power_SubStation.get(Casing_Amount));
+
+ ItemStack mBattery = ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR);
+
+ RecipeUtils.addShapedRecipe(
+ "plateIncoloyMA956",
+ mBattery,
+ "plateIncoloyMA956",
+ GregtechItemList.Casing_Power_SubStation.get(1),
+ GregtechItemList.Casing_Vanadium_Redox.get(1),
+ GregtechItemList.Casing_Power_SubStation.get(1),
+ "plateIncoloy020",
+ "plateIncoloyMA956",
+ "plateIncoloy020",
+ GregtechItemList.PowerSubStation.get(1));
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialThermalCentrifuge) {
+ RecipeUtils.addShapedRecipe(
+ "plateRedSteel",
+ CI.craftingToolHammer_Hard,
+ "plateRedSteel",
+ "plateRedSteel",
+ "frameGtBlackSteel",
+ "plateRedSteel",
+ "plateRedSteel",
+ CI.craftingToolWrench,
+ "plateRedSteel",
+ GregtechItemList.Casing_ThermalCentrifuge.get(Casing_Amount));
+
+ RecipeUtils.addShapedRecipe(
+ "plateRedSteel",
+ "circuitData",
+ "plateRedSteel",
+ "stickTalonite",
+ EV_MACHINE_ThermalCentrifuge,
+ "stickTalonite",
+ "plateRedSteel",
+ "gearGtTalonite",
+ "plateRedSteel",
+ GregtechItemList.Industrial_ThermalCentrifuge.get(1));
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialWashPlant) {
+ RecipeUtils.addShapedRecipe(
+ "plateGrisium",
+ CI.craftingToolHammer_Hard,
+ "plateGrisium",
+ "plateTalonite",
+ "frameGtGrisium",
+ "plateTalonite",
+ "plateGrisium",
+ CI.craftingToolWrench,
+ "plateGrisium",
+ GregtechItemList.Casing_WashPlant.get(Casing_Amount));
+
+ RecipeUtils.addShapedRecipe(
+ "plateGrisium",
+ CI.electricPump_MV,
+ "plateGrisium",
+ "plateTalonite",
+ EV_MACHINE_OreWasher,
+ "plateTalonite",
+ "plateGrisium",
+ "circuitData",
+ "plateGrisium",
+ GregtechItemList.Industrial_WashPlant.get(1));
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_LargeAutoCrafter) {
+
+ ItemStack aCoreBlock = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK
+ ? ItemUtils.getValueOfItemList(
+ "Block_IridiumTungstensteel",
+ 1,
+ ItemUtils.getItemStackOfAmountFromOreDict("blockOsmiridium", 1))
+ : ItemUtils.getItemStackOfAmountFromOreDict("blockOsmiridium", 1);
+
+ aCoreBlock.stackSize = GTNH ? 2 : 1;
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(GregtechItemList.Casing_Multi_Use.get(1), GTNH ? 2 : 1),
+ aCoreBlock,
+ CI.getTieredComponent(OrePrefixes.circuit, GTNH ? 3 : 2, 16),
+ CI.getTieredComponent(OrePrefixes.screw, GTNH ? 6 : 5, 32),
+ CI.getTieredComponent(OrePrefixes.bolt, GTNH ? 6 : 5, 12),
+ CI.getTieredComponent(OrePrefixes.plate, GTNH ? 7 : 6, 8),
+ },
+ CI.getTertiaryTieredFluid(6, 144 * (GTNH ? 12 : 4)),
+ GregtechItemList.Casing_Autocrafter.get(Casing_Amount),
+ 20 * 60 * 2,
+ MaterialUtils.getVoltageForTier(GTNH ? 6 : 5));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ GregtechItemList.Casing_Refinery_Structural.get(4),
+ ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR, GTNH ? 2 : 1),
+ CI.getTieredComponent(OrePrefixes.cableGt08, GTNH ? 7 : 6, GTNH ? 32 : 16),
+ CI.getTransmissionComponent(GTNH ? 6 : 5, 2),
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ },
+ CI.getTieredFluid(7, 144 * (GTNH ? 32 : 8)),
+ GregtechItemList.GT4_Multi_Crafter.get(1),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(GTNH ? 6 : 5));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(GregtechItemList.Casing_Multi_Use.get(1), Casing_Amount),
+ CI.getEmitter(GTNH ? 5 : 4, GTNH ? 4 : 2),
+ CI.getRobotArm(GTNH ? 5 : 4, GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.circuit, GTNH ? 3 : 2, 8),
+ CI.getTieredComponent(OrePrefixes.screw, GTNH ? 4 : 3, 8),
+ CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 4),
+ },
+ CI.getAlternativeTieredFluid(5, 144 * 4),
+ ItemUtils.getSimpleStack(ModBlocks.blockProjectTable),
+ 20 * 30 * 3,
+ MaterialUtils.getVoltageForTier(GTNH ? 5 : 4));
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialCuttingMachine) {
+ ItemStack plate = ALLOY.MARAGING300.getPlate(1);
+ RecipeUtils.addShapedRecipe(
+ plate,
+ CI.craftingToolHammer_Hard,
+ plate,
+ "plateStellite",
+ "frameGtTalonite",
+ "plateStellite",
+ plate,
+ CI.craftingToolWrench,
+ plate,
+ GregtechItemList.Casing_CuttingFactoryFrame.get(Casing_Amount));
+
+ RecipeUtils.addShapedRecipe(
+ plate,
+ CI.getTieredCircuit(3),
+ plate,
+ "wireFinePlatinum",
+ EV_MACHINE_Cutter,
+ "wireFinePlatinum",
+ plate,
+ CI.getTieredCircuit(4),
+ plate,
+ GregtechItemList.Industrial_CuttingFactoryController.get(1));
+ }
+
+ // EV_MACHINE_Extruder
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialExtrudingMachine) {
+ ItemStack plate = ALLOY.INCONEL_690.getPlate(1);
+ RecipeUtils.addShapedRecipe(
+ plate,
+ CI.craftingToolHammer_Hard,
+ plate,
+ "plateTalonite",
+ "frameGtStaballoy",
+ "plateTalonite",
+ plate,
+ CI.craftingToolWrench,
+ plate,
+ GregtechItemList.Casing_Extruder.get(Casing_Amount));
+
+ RecipeUtils.addShapedRecipe(
+ plate,
+ CI.getTieredCircuit(4),
+ plate,
+ CI.electricPiston_EV,
+ EV_MACHINE_Extruder,
+ CI.electricPiston_EV,
+ plate,
+ CI.getTieredCircuit(4),
+ plate,
+ GregtechItemList.Industrial_Extruder.get(1));
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialFishingPort) {
+ ItemStack plate = ALLOY.AQUATIC_STEEL.getPlate(1);
+ RecipeUtils.addShapedRecipe(
+ plate,
+ CI.craftingToolHammer_Hard,
+ plate,
+ "plateEglinSteel",
+ "frameGtEglinSteel",
+ "plateEglinSteel",
+ plate,
+ CI.craftingToolWrench,
+ plate,
+ GregtechItemList.Casing_FishPond.get(Casing_Amount));
+
+ RecipeUtils.addShapedRecipe(
+ plate,
+ CI.getTieredCircuit(3),
+ plate,
+ "wireFineElectrum",
+ ItemUtils.getSimpleStack(ModBlocks.blockFishTrap),
+ "wireFineElectrum",
+ plate,
+ CI.getTieredCircuit(2),
+ plate,
+ GregtechItemList.Industrial_FishingPond.get(1));
+ }
+
+ if (true) {
+ // Advanced Vacuum Freezer
+ ItemStack plate = ALLOY.HG1223.getPlateDouble(1);
+ ItemStack gear = ALLOY.INCOLOY_MA956.getGear(1);
+ ItemStack frame = ALLOY.LAFIUM.getFrameBox(1);
+ ItemStack cell1 = ItemList.Reactor_Coolant_He_6.get(1);
+ ItemStack cell2 = ItemList.Reactor_Coolant_NaK_6.get(1);
+
+ RecipeUtils.addShapedRecipe(
+ plate,
+ gear,
+ plate,
+ cell1,
+ frame,
+ cell2,
+ plate,
+ gear,
+ plate,
+ GregtechItemList.Casing_AdvancedVacuum.get(Casing_Amount));
+ RecipeUtils.addShapedRecipe(
+ gear,
+ CI.getTieredCircuit(6),
+ gear,
+ CI.electricPiston_IV,
+ GregtechItemList.Casing_AdvancedVacuum.get(1),
+ CI.electricPiston_IV,
+ plate,
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ plate,
+ GregtechItemList.Industrial_Cryogenic_Freezer.get(1));
+
+ // Advanced Blast Furnace
+ plate = ALLOY.HASTELLOY_N.getPlateDouble(1);
+ gear = ALLOY.HASTELLOY_W.getGear(1);
+ frame = ALLOY.HASTELLOY_X.getFrameBox(1);
+ cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1);
+ cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1);
+ ItemStack cell3 = ItemUtils.simpleMetaStack("IC2:reactorVentDiamond:1:1", 1, 1);
+
+ RecipeUtils.addShapedRecipe(
+ plate,
+ cell1,
+ plate,
+ cell3,
+ frame,
+ cell2,
+ plate,
+ gear,
+ plate,
+ GregtechItemList.Casing_Adv_BlastFurnace.get(Casing_Amount));
+ RecipeUtils.addShapedRecipe(
+ gear,
+ CI.getTieredCircuit(6),
+ gear,
+ CI.robotArm_IV,
+ GregtechItemList.Casing_Adv_BlastFurnace.get(1),
+ CI.robotArm_IV,
+ plate,
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ plate,
+ GregtechItemList.Machine_Adv_BlastFurnace.get(1));
+
+ // Advanced Implosion Compressor
+ plate = ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 1);
+ gear = ALLOY.LEAGRISIUM.getGear(1);
+ frame = ALLOY.CINOBITE.getFrameBox(1);
+ cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1);
+ cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1);
+
+ RecipeUtils.addShapedRecipe(
+ gear,
+ CI.getTieredCircuit(6),
+ gear,
+ CI.fieldGenerator_IV,
+ CI.machineHull_ZPM,
+ CI.robotArm_IV,
+ plate,
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ plate,
+ GregtechItemList.Machine_Adv_ImplosionCompressor.get(1));
+
+ // Supply Depot
+ plate = ALLOY.TUNGSTEN_CARBIDE.getPlateDouble(1);
+ gear = ALLOY.TRINIUM_TITANIUM.getRing(1);
+ frame = ALLOY.TUNGSTEN_CARBIDE.getFrameBox(1);
+ cell1 = CI.conveyorModule_EV;
+ cell2 = CI.electricMotor_IV;
+ ItemStack casingAmazon = GregtechItemList.Casing_AmazonWarehouse.get(1);
+ ItemStack aTieredUnboxinator = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK
+ ? ItemUtils.getValueOfItemList(
+ "Machine_LuV_Unboxinator", 1, ItemList.Machine_IV_Unboxinator.get(1))
+ : ItemList.Machine_IV_Unboxinator.get(1);
+
+ RecipeUtils.addShapedRecipe(
+ plate,
+ ItemUtils.getItemStackOfAmountFromOreDict("cableGt12VanadiumGallium", 1),
+ plate,
+ cell1,
+ frame,
+ cell2,
+ plate,
+ gear,
+ plate,
+ GregtechItemList.Casing_AmazonWarehouse.get(Casing_Amount));
+ RecipeUtils.addShapedRecipe(
+ casingAmazon,
+ CI.getTieredCircuit(7),
+ casingAmazon,
+ CI.robotArm_LuV,
+ aTieredUnboxinator,
+ CI.robotArm_LuV,
+ CI.conveyorModule_LuV,
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ CI.conveyorModule_LuV,
+ GregtechItemList.Amazon_Warehouse_Controller.get(1));
+
+ // Industrial Mixing Machine
+ RecipeUtils.addShapedRecipe(
+ "plateStaballoy",
+ CI.getTieredCircuit(5),
+ "plateStaballoy",
+ "plateZirconiumCarbide",
+ EV_MACHINE_Mixer,
+ "plateZirconiumCarbide",
+ "plateStaballoy",
+ CI.getTieredCircuit(5),
+ "plateStaballoy",
+ GregtechItemList.Industrial_Mixer.get(1));
+ }
+
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialMultiMachine) {
+ ItemStack plate = ALLOY.STABALLOY.getPlate(1);
+
+ ItemStack o_Compressor;
+ ItemStack o_Lathe;
+ ItemStack o_Electromagnet;
+ ItemStack o_Fermenter;
+ ItemStack o_Distillery;
+ ItemStack o_Extractor;
+ if (GTNH) {
+ o_Compressor = ItemList.Machine_IV_Compressor.get(1);
+ o_Lathe = ItemList.Machine_IV_Lathe.get(1);
+ o_Electromagnet = ItemList.Machine_IV_Polarizer.get(1);
+ o_Fermenter = ItemList.Machine_IV_Fermenter.get(1);
+ o_Distillery = ItemList.Machine_IV_FluidExtractor.get(1);
+ o_Extractor = ItemList.Machine_IV_Extractor.get(1);
+ } else {
+ o_Compressor = ItemList.Machine_EV_Compressor.get(1);
+ o_Lathe = ItemList.Machine_EV_Lathe.get(1);
+ o_Electromagnet = ItemList.Machine_EV_Polarizer.get(1);
+ o_Fermenter = ItemList.Machine_EV_Fermenter.get(1);
+ o_Distillery = ItemList.Machine_EV_FluidExtractor.get(1);
+ o_Extractor = ItemList.Machine_EV_Extractor.get(1);
+ }
+ RecipeUtils.addShapedRecipe(
+ plate,
+ CI.craftingToolHammer_Hard,
+ plate,
+ "plateStainlessSteel",
+ "frameGtZirconiumCarbide",
+ "plateStainlessSteel",
+ plate,
+ CI.craftingToolWrench,
+ plate,
+ GregtechItemList.Casing_Multi_Use.get(Casing_Amount));
+
+ RecipeUtils.addShapedRecipe(
+ o_Compressor,
+ o_Lathe,
+ o_Electromagnet,
+ plate,
+ ItemUtils.getSimpleStack(ModBlocks.blockProjectTable),
+ plate,
+ o_Fermenter,
+ o_Distillery,
+ o_Extractor,
+ GregtechItemList.Industrial_MultiMachine.get(1));
+ }
+
+ /*
+ * 6/1/19 - Content additions
+ */
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+
+ ItemStack aDrillController = ItemUtils.getValueOfItemList("OreDrill4", ItemList.Hull_UV)
+ .get(1);
+
+ // Drilling Platform
+ /*CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ aDrillController,
+ ItemUtils.getItemStackOfAmountFromOreDict("frameGtTriniumNaquadahCarbonite", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(9), 2 * (GTNH ? 4 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.conveyorModule_UV : CI.conveyorModule_ZPM), 2 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.electricPump_UV : CI.electricPump_ZPM), 4 * (GTNH ? 2 : 1)),
+ },
+ ALLOY.LAFIUM.getFluid(144 * 8 * (GTNH ? 2 : 1)),
+ GregtechItemList.BedrockMiner_MKI.get(1),
+ (int) GT_Values.V[5],
+ (int) GT_Values.V[7]);*/
+
+ // Drilling Platform Casings
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("frameGtTriniumNaquadahCarbonite", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict(
+ "plateDoubleTriniumTitaniumAlloy", 1 * (GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict("gearGtPikyonium64B", 2 * (GTNH ? 2 : 1)),
+ ALLOY.TRINIUM_REINFORCED_STEEL.getPlateDouble(4 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack(
+ (GTNH ? CI.machineHull_UV : CI.machineHull_LuV), 1 * (GTNH ? 2 : 1)),
+ },
+ ALLOY.MARAGING350.getFluidStack(144 * 16 * (GTNH ? 2 : 1)),
+ GregtechItemList.Casing_BedrockMiner.get(1),
+ (int) GT_Values.V[4],
+ (int) GT_Values.V[6]);
+ }
+ }
+
+ int aCostMultiplier = GTNH ? 2 : 1;
+
+ // Mystic Frame
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ GregtechItemList.Casing_Multi_Use.get(1),
+ ItemList.Field_Generator_MV.get(1, CI.circuitTier7),
+ ItemList.Field_Generator_HV.get(1, CI.circuitTier7),
+ ItemList.Emitter_HV.get(1, CI.circuitTier7),
+ ItemList.Sensor_HV.get(1, CI.circuitTier7),
+ CI.getTieredComponent(OrePrefixes.plate, 7, 8 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.wireGt08, 8, 4 * aCostMultiplier),
+ },
+ CI.getTieredFluid(6, (144 * 8)), // Input Fluid
+ ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame, 2),
+ 45 * 20 * 1 * (6),
+ MaterialUtils.getVoltageForTier(6));
+ GT_MetaTileEntity_Disassembler.addBlacklist(ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame, 1));
+
+ // Player Doors
+ ItemStack[] aDoorInputs = new ItemStack[] {
+ ItemUtils.getSimpleStack(Blocks.log2),
+ ItemUtils.getSimpleStack(Blocks.iron_block),
+ ItemUtils.getSimpleStack(Blocks.glass),
+ ItemUtils.getSimpleStack(Blocks.packed_ice),
+ ItemUtils.getSimpleStack(Blocks.cactus),
+ };
+ ItemStack[] aDoorOutputs = new ItemStack[] {
+ ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorWooden),
+ ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorIron),
+ ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorCustom_Glass),
+ ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorCustom_Ice),
+ ItemUtils.getSimpleStack(ModBlocks.blockPlayerDoorCustom_Cactus),
+ };
+
+ for (int y = 0; y < aDoorInputs.length; y++) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Items.iron_door),
+ aDoorInputs[y],
+ ItemList.Sensor_LV.get(1, CI.circuitTier7),
+ CI.getTieredComponent(OrePrefixes.plate, 1, 2 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.wireGt02, 1, 2 * aCostMultiplier),
+ ItemUtils.getSimpleStack(Items.redstone, 16)
+ },
+ CI.getTieredFluid(1, (144 * 2)), // Input Fluid
+ aDoorOutputs[y],
+ 100,
+ MaterialUtils.getVoltageForTier(1));
+ }
+
+ Logger.INFO("Done loading recipes for the Various machine blocks.");
+ }
+
+ private static void controlCores() {
+
+ Material[] aMat_A = new Material[] {
+ ALLOY.POTIN,
+ ALLOY.ZIRCONIUM_CARBIDE,
+ ALLOY.TANTALLOY_61,
+ ALLOY.INCONEL_792,
+ ALLOY.STABALLOY,
+ ALLOY.TALONITE,
+ ALLOY.HASTELLOY_N,
+ ALLOY.HG1223,
+ ALLOY.LAFIUM,
+ ALLOY.PIKYONIUM
+ };
+ Material[] aMat_B = new Material[] {
+ ALLOY.TUMBAGA,
+ ALLOY.SILICON_CARBIDE,
+ ALLOY.EGLIN_STEEL,
+ ALLOY.NICHROME,
+ ALLOY.TUNGSTEN_CARBIDE,
+ ALLOY.STELLITE,
+ ALLOY.HASTELLOY_C276,
+ ALLOY.NITINOL_60,
+ ALLOY.ZERON_100,
+ ALLOY.CINOBITE
+ };
+
+ Item aBaseCore = ModItems.itemControlCore;
+ ItemStack[] aInputPrevTier = new ItemStack[] {
+ GTNH
+ ? ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore3", 1)
+ : ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore2", 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 0, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 1, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 2, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 3, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 4, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 5, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 6, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 7, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 8, 1),
+ };
+ ItemStack[] aOutput = new ItemStack[] {
+ ItemUtils.simpleMetaStack(aBaseCore, 0, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 1, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 2, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 3, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 4, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 5, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 6, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 7, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 8, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 9, 1),
+ };
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.machineHull_HV,
+ aOutput[1],
+ aMat_A[1].getGear(GTNH ? 4 : 2),
+ aMat_B[2].getPlateDouble(GTNH ? 16 : 8),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + (GTNH ? "2" : "1"), GTNH ? 4 : 2),
+ ItemUtils.getItemStackOfAmountFromOreDict(
+ CI.getTieredCircuitOreDictName(GTNH ? 3 : 2), GTNH ? 10 : 5)
+ },
+ aMat_B[3].getFluidStack(144 * 8), // Input Fluid
+ GregtechItemList.Hatch_Control_Core.get(1),
+ 60 * 20 * 5,
+ MaterialUtils.getVoltageForTier(3));
+
+ for (int i = 0; i < 10; i++) {
+ boolean aDub = false;
+ ItemStack aPlateStack = aMat_A[i].getPlateDouble((GTNH ? 16 : 8) * (aDub ? 2 : 1));
+ ItemStack aGearStack = aMat_B[i].getGear(GTNH ? 4 : 2 * (aDub ? 2 : 1));
+ ItemStack aRodStack = aMat_A[i].getLongRod(GTNH ? 16 : 8 * (aDub ? 2 : 1));
+ ItemStack aScrewStack = aMat_B[i].getScrew(32 * (aDub ? 2 : 1));
+
+ if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
+ aPlateStack = aMat_A[i].getPlate((GTNH ? 16 : 8) * (aDub ? 2 : 1) * 2);
+ if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
+ aPlateStack = aMat_B[i].getPlateDouble((GTNH ? 16 : 8) * (aDub ? 2 : 1));
+ if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
+ aPlateStack = aMat_B[i].getPlate((GTNH ? 16 : 8) * (aDub ? 2 : 1) * 2);
+ }
+ }
+ }
+ if (!ItemUtils.checkForInvalidItems(aGearStack)) {
+ aGearStack = aMat_A[i].getGear(GTNH ? 8 : 4 * (aDub ? 2 : 1));
+ }
+ if (!ItemUtils.checkForInvalidItems(aRodStack)) {
+ aRodStack = aMat_B[i].getLongRod(GTNH ? 32 : 16 * (aDub ? 2 : 1));
+ }
+ if (!ItemUtils.checkForInvalidItems(aScrewStack)) {
+ aScrewStack = aMat_A[i].getScrew(32 * (aDub ? 2 : 1));
+ }
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getEnergyCore(i, 4),
+ aPlateStack,
+ aGearStack,
+ aRodStack,
+ aScrewStack,
+ ItemUtils.getItemStackOfAmountFromOreDict(
+ CI.getTieredCircuitOreDictName((int) (4 + Math.ceil((double) i / (double) 2))),
+ GTNH ? (i * 2 * 2) : (i * 2))
+ },
+ CI.getTieredFluid(i, 144 * 4 * (i + 1)), // Input Fluid
+ aOutput[i],
+ 60 * 20 * 1 * (i + 1),
+ MaterialUtils.getVoltageForTier(i));
+ }
+ }
+
+ private static void energyCores() {
+
+ // Simpler Recipes for normal Players, Force assembly crafting in GTNH
+ if (!GTNH) {
+ // Buffer Core
+ /*RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[1], cableTier1, CI.component_Plate[1],
+ "circuitPrimitive", "plateStaballoy", "circuitPrimitive",
+ CI.component_Plate[1], cableTier1, CI.component_Plate[1],
+ RECIPE_BufferCore_ULV);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[2], cableTier2, CI.component_Plate[2],
+ RECIPE_BufferCore_ULV, CI.machineHull_HV, RECIPE_BufferCore_ULV,
+ CI.component_Plate[2], cableTier2, CI.component_Plate[2],
+ RECIPE_BufferCore_LV);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[3], cableTier3, CI.component_Plate[3],
+ RECIPE_BufferCore_LV, CI.circuitTier2, RECIPE_BufferCore_LV,
+ CI.component_Plate[3], cableTier3, CI.component_Plate[3],
+ RECIPE_BufferCore_MV);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[4], cableTier4, CI.component_Plate[4],
+ RECIPE_BufferCore_MV, CI.circuitTier3, RECIPE_BufferCore_MV,
+ CI.component_Plate[4], cableTier4, CI.component_Plate[4],
+ RECIPE_BufferCore_HV);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[5], cableTier5, CI.component_Plate[5],
+ RECIPE_BufferCore_HV, CI.circuitTier4, RECIPE_BufferCore_HV,
+ CI.component_Plate[5], cableTier5, CI.component_Plate[5],
+ RECIPE_BufferCore_EV);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[6], cableTier6, CI.component_Plate[6],
+ RECIPE_BufferCore_EV, CI.circuitTier5, RECIPE_BufferCore_EV,
+ CI.component_Plate[6], cableTier6, CI.component_Plate[6],
+ RECIPE_BufferCore_IV);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[7], cableTier7, CI.component_Plate[7],
+ RECIPE_BufferCore_IV, CI.circuitTier6, RECIPE_BufferCore_IV,
+ CI.component_Plate[7], cableTier7, CI.component_Plate[7],
+ RECIPE_BufferCore_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[8], cableTier8, CI.component_Plate[8],
+ RECIPE_BufferCore_LuV, CI.circuitTier7, RECIPE_BufferCore_LuV,
+ CI.component_Plate[8], cableTier8, CI.component_Plate[8],
+ RECIPE_BufferCore_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[9], cableTier9, CI.component_Plate[9],
+ RECIPE_BufferCore_ZPM, CI.circuitTier8, RECIPE_BufferCore_ZPM,
+ CI.component_Plate[9], cableTier9, CI.component_Plate[9],
+ RECIPE_BufferCore_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[10], cableTier10, CI.component_Plate[10],
+ RECIPE_BufferCore_UV, CI.circuitTier9, RECIPE_BufferCore_UV,
+ CI.component_Plate[10], cableTier10, CI.component_Plate[10],
+ RECIPE_BufferCore_MAX);*/
+
+ /*RecipeUtils.addShapedGregtechRecipe(
+ wireTier1, RECIPE_BufferCore_ULV, wireTier1,
+ wireTier1, CI.machineCasing_ULV, wireTier1,
+ CI.circuitPrimitive, CI.circuitTier1, CI.circuitPrimitive,
+ RECIPE_Buffer_ULV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier2, RECIPE_BufferCore_LV, wireTier2,
+ wireTier2, CI.machineCasing_LV, wireTier2,
+ CI.circuitTier1, RECIPE_BufferCore_LV, CI.circuitTier1,
+ RECIPE_Buffer_LV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier3, RECIPE_BufferCore_MV, wireTier3,
+ wireTier3, CI.machineCasing_MV, wireTier3,
+ CI.circuitTier2, RECIPE_BufferCore_MV, CI.circuitTier2,
+ RECIPE_Buffer_MV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier4, RECIPE_BufferCore_HV, wireTier4,
+ wireTier4, CI.machineCasing_HV, wireTier4,
+ CI.circuitTier3, RECIPE_BufferCore_HV, CI.circuitTier3,
+ RECIPE_Buffer_HV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier5, RECIPE_BufferCore_EV, wireTier5,
+ wireTier5, CI.machineCasing_EV, wireTier5,
+ CI.circuitTier4, RECIPE_BufferCore_EV, CI.circuitTier4,
+ RECIPE_Buffer_EV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier6, RECIPE_BufferCore_IV, wireTier6,
+ wireTier6, CI.machineCasing_IV, wireTier6,
+ CI.circuitTier5, RECIPE_BufferCore_IV, CI.circuitTier5,
+ RECIPE_Buffer_IV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier7, RECIPE_BufferCore_LuV, wireTier7,
+ wireTier7, CI.machineCasing_LuV, wireTier7,
+ CI.circuitTier6, RECIPE_BufferCore_LuV, CI.circuitTier6,
+ RECIPE_Buffer_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier8, RECIPE_BufferCore_ZPM, wireTier8,
+ wireTier8, CI.machineCasing_ZPM, wireTier8,
+ CI.circuitTier7, RECIPE_BufferCore_ZPM, CI.circuitTier7,
+ RECIPE_Buffer_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier9, RECIPE_BufferCore_UV, wireTier9,
+ wireTier9, CI.machineCasing_UV, wireTier9,
+ CI.circuitTier8, RECIPE_BufferCore_UV, CI.circuitTier8,
+ RECIPE_Buffer_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[11], RECIPE_BufferCore_MAX, CI.component_Plate[11],
+ wireTier10, CI.machineCasing_MAX, wireTier10,
+ CI.circuitTier9, RECIPE_BufferCore_MAX, CI.circuitTier9,
+ RECIPE_Buffer_MAX);*/
+ }
+
+ ItemStack[] aBufferOutput = new ItemStack[] {
+ RECIPE_Buffer_ULV,
+ RECIPE_Buffer_LV,
+ RECIPE_Buffer_MV,
+ RECIPE_Buffer_HV,
+ RECIPE_Buffer_EV,
+ RECIPE_Buffer_IV,
+ RECIPE_Buffer_LuV,
+ RECIPE_Buffer_ZPM,
+ RECIPE_Buffer_UV,
+ RECIPE_Buffer_MAX
+ };
+
+ ItemStack[] aOutput = new ItemStack[] {
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "1", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "2", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "3", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "4", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "5", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "6", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "7", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "8", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "9", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "10", 1)
+ };
+
+ int aCostMultiplier = GTNH ? 4 : 1;
+
+ for (int i = 0; i < 10; i++) {
+
+ ItemStack aPrevTier = (i == 0 ? CI.getTieredMachineHull(GTNH ? 2 : 1) : aOutput[i - 1]);
+ aPrevTier.stackSize = GTNH ? 2 : 1;
+ int aTier = (i + 1);
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ aPrevTier,
+ CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.cableGt04, i, 2 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.circuit, aTier, 2 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.screw, aTier, 6 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.bolt, i, 12 * (GTNH ? 2 : 1)),
+ },
+ CI.getTieredFluid(i, (144 * 4 * aTier)), // Input Fluid
+ aOutput[i],
+ 45 * 10 * 1 * (aTier),
+ MaterialUtils.getVoltageForTier(i));
+
+ // Energy Buffer
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(aOutput[i], 4),
+ CI.getTieredComponent(OrePrefixes.plate, aTier, 8 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.wireGt08, i, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.circuit, i, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.stickLong, aTier, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.gearGt, i, 5 * (GTNH ? 2 : 1)),
+ },
+ CI.getTieredFluid(aTier, (144 * 16 * aTier)), // Input Fluid
+ aBufferOutput[i],
+ 45 * 20 * 1 * (aTier),
+ MaterialUtils.getVoltageForTier(i));
+ }
+ }
+
+ private static void wirelessChargers() {
+
+ ItemStack[] aChargers = new ItemStack[] {
+ null,
+ GregtechItemList.Charger_LV.get(1),
+ GregtechItemList.Charger_MV.get(1),
+ GregtechItemList.Charger_HV.get(1),
+ GregtechItemList.Charger_EV.get(1),
+ GregtechItemList.Charger_IV.get(1),
+ GregtechItemList.Charger_LuV.get(1),
+ GregtechItemList.Charger_ZPM.get(1),
+ GregtechItemList.Charger_UV.get(1),
+ GregtechItemList.Charger_MAX.get(1)
+ };
+
+ int aCostMultiplier = GTNH ? 2 : 1;
+
+ for (int i = 0; i < 10; i++) {
+ if (i == 0) {
+ continue;
+ }
+ int aTier = (i + 1);
+ ItemStack[] aInputs = new ItemStack[] {
+ CI.getTieredMachineHull(i, 1 * aCostMultiplier),
+ CI.getTransmissionComponent(i, 2 * aCostMultiplier),
+ CI.getFieldGenerator(i, 1 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.circuit, aTier, 2 * aCostMultiplier),
+ };
+ CORE.RA.addSixSlotAssemblingRecipe(
+ aInputs,
+ CI.getAlternativeTieredFluid(i, (144 * 2 * aTier)), // Input Fluid
+ aChargers[i],
+ 45 * 10 * 1 * (aTier),
+ MaterialUtils.getVoltageForTier(i));
+ }
+ }
+
+ private static void largeArcFurnace() {
+ int aCostMultiplier = GTNH ? 2 : 1;
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getTieredMachineHull(-1, 1 * aCostMultiplier),
+ CI.getTransmissionComponent(2, 2 * aCostMultiplier),
+ CI.getElectricPiston(4, 2 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.plate, 5, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.pipeSmall, 4, 1 * aCostMultiplier),
+ },
+ CI.getAlternativeTieredFluid(5, (144 * 2 * 4)), // Input Fluid
+ GregtechItemList.Casing_Industrial_Arc_Furnace.get(Casing_Amount),
+ 20 * 10 * 1 * (6),
+ MaterialUtils.getVoltageForTier(5));
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ GregtechItemList.Casing_Industrial_Arc_Furnace.get(Casing_Amount),
+ CI.getFieldGenerator(4, 2 * aCostMultiplier),
+ CI.getRobotArm(5, 4 * aCostMultiplier),
+ CI.getEnergyCore(4, 2 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.plate, 6, 8 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.circuit, 5, 8 * aCostMultiplier),
+ },
+ CI.getAlternativeTieredFluid(6, (144 * 4 * 5)), // Input Fluid
+ GregtechItemList.Industrial_Arc_Furnace.get(1),
+ 60 * 20 * 8,
+ MaterialUtils.getVoltageForTier(6));
+ }
+
+ private static void industrialVacuumFurnace() {
+ int aCostMultiplier = GTNH ? 2 : 1;
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getTieredMachineHull(-1, 1 * aCostMultiplier),
+ CI.getHeatCoil(2),
+ CI.getElectricPiston(3, 2 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.plate, 6, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.gearGt, 6, 2 * aCostMultiplier),
+ },
+ CI.getTertiaryTieredFluid(5, (144 * 2 * 4 * aCostMultiplier)), // Input Fluid
+ GregtechItemList.Casing_Vacuum_Furnace.get(Casing_Amount),
+ 20 * 10 * 6,
+ MaterialUtils.getVoltageForTier(6));
+
+ ;
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ GregtechItemList.Casing_Vacuum_Furnace.get(aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.wireGt16, 7, 4 * aCostMultiplier),
+ CI.getEnergyCore(6, 1 * aCostMultiplier),
+ CI.getRobotArm(4, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.plate, 7, 8 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.circuit, 6, 8 * aCostMultiplier),
+ },
+ CI.getTieredFluid(7, (144 * 4 * 5 * aCostMultiplier)), // Input Fluid
+ GregtechItemList.Controller_Vacuum_Furnace.get(1),
+ 60 * 20 * 12,
+ MaterialUtils.getVoltageForTier(7));
+ }
+
+ private static void milling() {
+
+ /*public static ItemStack RECIPE_ISAMill_Controller;
+ public static ItemStack RECIPE_ISAMill_Gearbox;
+ public static ItemStack RECIPE_ISAMill_Casing;
+ public static ItemStack RECIPE_ISAMill_Hatch;
+ public static ItemStack RECIPE_Flotation_Controller;
+ public static ItemStack RECIPE_Flotation_Casing;*/
+
+ // Isa Mill Controller
+ CORE.RA.addAssemblylineRecipe(
+ ItemList.Machine_IV_Macerator.get(1),
+ 20 * 60 * 20,
+ new Object[] {
+ GregtechItemList.Casing_IsaMill_Gearbox.get(4),
+ CI.getTieredGTPPMachineCasing(6, 4),
+ ItemList.Component_Grinder_Tungsten.get(16),
+ new Object[] {CI.getTieredCircuitOreDictName(6), 8},
+ ALLOY.INCONEL_625.getGear(8),
+ ALLOY.INCONEL_625.getPlate(32),
+ ALLOY.ZERON_100.getPlateDouble(8),
+ ALLOY.ZERON_100.getPlateDouble(8),
+ ALLOY.ZERON_100.getScrew(64),
+ CI.getTieredComponentOfMaterial(Materials.NiobiumTitanium, OrePrefixes.wireFine, 32),
+ CI.getTieredComponentOfMaterial(Materials.NiobiumTitanium, OrePrefixes.wireFine, 32),
+ CI.getTieredComponentOfMaterial(Materials.Titanium, OrePrefixes.foil, 16),
+ CI.getTieredComponentOfMaterial(Materials.Titanium, OrePrefixes.foil, 16),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(6, 16 * 144),
+ CI.getAlternativeTieredFluid(6, 32 * 144),
+ CI.getTertiaryTieredFluid(6, 32 * 144)
+ },
+ GregtechItemList.Controller_IsaMill.get(1),
+ 20 * 60 * 10,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Isa Mill Gearbox
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(7),
+ ItemList.Casing_Gearbox_Titanium.get(2),
+ ALLOY.INCONEL_625.getGear(4),
+ CI.getTieredComponentOfMaterial(Materials.HSSE, OrePrefixes.gearGtSmall, 8),
+ ALLOY.INCONEL_625.getPlate(16),
+ ALLOY.ZERON_100.getBolt(16),
+ },
+ ALLOY.TUNGSTENSTEEL.getFluidStack(8 * 144),
+ GregtechItemList.Casing_IsaMill_Gearbox.get(1),
+ 60 * 20 * 2,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Isa Mill Casing
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(7),
+ CI.getTieredGTPPMachineCasing(5, 1),
+ ALLOY.INCONEL_625.getPlate(8),
+ ALLOY.ZERON_100.getRod(4),
+ CI.getTieredComponentOfMaterial(Materials.HSSG, OrePrefixes.gearGtSmall, 4),
+ ALLOY.ZERON_100.getScrew(8),
+ },
+ ELEMENT.getInstance().TITANIUM.getFluidStack(4 * 144),
+ GregtechItemList.Casing_IsaMill_Casing.get(1),
+ 60 * 20 * 2,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Isa Mill Pipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(7),
+ CI.getTieredGTPPMachineCasing(4, 2),
+ ALLOY.INCONEL_625.getPlateDouble(4),
+ ALLOY.INCOLOY_MA956.getRing(8),
+ CI.getTieredComponentOfMaterial(Materials.HSSE, OrePrefixes.plate, 8),
+ ALLOY.INCOLOY_MA956.getBolt(16),
+ },
+ ELEMENT.getInstance().ALUMINIUM.getFluidStack(8 * 144),
+ GregtechItemList.Casing_IsaMill_Pipe.get(1),
+ 60 * 20 * 8,
+ MaterialUtils.getVoltageForTier(4));
+
+ // Flotation Cell Controller
+ CORE.RA.addAssemblylineRecipe(
+ ItemList.Distillation_Tower.get(1),
+ 20 * 60 * 20,
+ new Object[] {
+ GregtechItemList.Casing_Flotation_Cell.get(4),
+ CI.getTieredGTPPMachineCasing(5, 4),
+ ItemList.Machine_IV_Distillery.get(1),
+ new Object[] {CI.getTieredCircuitOreDictName(6), 8},
+ ALLOY.STELLITE.getGear(8),
+ ALLOY.STELLITE.getPlate(32),
+ ALLOY.HASTELLOY_N.getPlateDouble(8),
+ ALLOY.HASTELLOY_N.getPlateDouble(8),
+ ALLOY.HASTELLOY_N.getScrew(64),
+ CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64),
+ CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64),
+ CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32),
+ CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(5, 16 * 144),
+ CI.getAlternativeTieredFluid(4, 32 * 144),
+ CI.getTertiaryTieredFluid(4, 32 * 144)
+ },
+ GregtechItemList.Controller_Flotation_Cell.get(1),
+ 20 * 60 * 10,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Flotation Cell Casing
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(7),
+ CI.getTieredGTPPMachineCasing(4, 1),
+ ALLOY.AQUATIC_STEEL.getPlate(8),
+ ALLOY.STELLITE.getRing(8),
+ CI.getTieredComponentOfMaterial(Materials.HSSG, OrePrefixes.plateDouble, 4),
+ ALLOY.HASTELLOY_N.getScrew(8),
+ },
+ ALLOY.STAINLESS_STEEL.getFluidStack(8 * 144),
+ GregtechItemList.Casing_Flotation_Cell.get(1),
+ 60 * 20 * 2,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Milling Bus
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(7),
+ CI.getTieredGTPPMachineCasing(5, 1),
+ ItemList.Hatch_Input_Bus_EV.get(1),
+ CI.getTieredComponentOfMaterial(Materials.Titanium, OrePrefixes.gearGt, 8),
+ CI.getTieredComponentOfMaterial(Materials.TungstenSteel, OrePrefixes.plate, 32),
+ CI.getTieredComponentOfMaterial(Materials.SolderingAlloy, OrePrefixes.wireFine, 16),
+ },
+ ELEMENT.getInstance().TUNGSTEN.getFluidStack(8 * 144),
+ GregtechItemList.Bus_Milling_Balls.get(1),
+ 60 * 20 * 4,
+ MaterialUtils.getVoltageForTier(5));
+ }
+
+ private static void sparging() {
+
+ // Sparge Tower Research
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(8),
+ ELEMENT.getInstance().HELIUM.getCell(8),
+ ELEMENT.getInstance().FLUORINE.getCell(8),
+ ALLOY.HS188A.getIngot(8),
+ ItemList.Distillation_Tower.get(1)
+ },
+ null,
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_10_SPARGING, 1),
+ 60 * 20 * 5,
+ MaterialUtils.getVoltageForTier(5));
+
+ // Sparge Tower Controller
+ CORE.RA.addAssemblylineRecipe(
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_10_SPARGING, 1),
+ 20 * 60 * 20,
+ new Object[] {
+ GregtechItemList.Casing_Sparge_Tower_Exterior.get(4),
+ CI.getTieredGTPPMachineCasing(4, 4),
+ ItemList.Machine_IV_Distillery.get(1),
+ new Object[] {CI.getTieredCircuitOreDictName(5), 8},
+ ALLOY.HS188A.getGear(8),
+ ALLOY.HS188A.getPlate(32),
+ ALLOY.HASTELLOY_N.getPlateDouble(8),
+ ALLOY.HASTELLOY_N.getPlateDouble(8),
+ ALLOY.HASTELLOY_N.getScrew(64),
+ CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64),
+ CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64),
+ CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32),
+ CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(4, 16 * 144),
+ CI.getAlternativeTieredFluid(3, 32 * 144),
+ CI.getTertiaryTieredFluid(3, 32 * 144)
+ },
+ GregtechItemList.Controller_Sparge_Tower.get(1),
+ 20 * 60 * 10,
+ MaterialUtils.getVoltageForTier(6));
+
+ // Sparge Tower Casing
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(8),
+ CI.getTieredGTPPMachineCasing(3, 1),
+ ALLOY.HS188A.getPlate(8),
+ ALLOY.HASTELLOY_N.getRing(4),
+ CI.getTieredComponentOfMaterial(Materials.TungstenSteel, OrePrefixes.plateDouble, 4),
+ ALLOY.HASTELLOY_N.getScrew(4),
+ },
+ ALLOY.STAINLESS_STEEL.getFluidStack(8 * 144),
+ GregtechItemList.Casing_Sparge_Tower_Exterior.get(1),
+ 60 * 20 * 2,
+ MaterialUtils.getVoltageForTier(5));
+ }
+
+ private static void chisels() {
+ ItemStack[] aChisels = new ItemStack[] {
+ GregtechItemList.GT_Chisel_LV.get(1),
+ GregtechItemList.GT_Chisel_MV.get(1),
+ GregtechItemList.GT_Chisel_HV.get(1),
+ };
+ for (int i = 1; i < 4; i++) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(10 + i),
+ CI.getTieredMachineCasing(i),
+ CI.getPlate(i, 4),
+ CI.getElectricMotor(i, 2),
+ CI.getConveyor(i, 2),
+ CI.getRobotArm(i, 1)
+ },
+ CI.getTieredFluid(i, 144 * 4),
+ aChisels[i - 1],
+ 20 * 20,
+ MaterialUtils.getVoltageForTier(i));
+ }
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(14),
+ aChisels[2],
+ CI.getPlate(4, 8),
+ CI.getElectricMotor(4, 8),
+ CI.getConveyor(4, 8),
+ CI.getRobotArm(4, 4)
+ },
+ CI.getTieredFluid(4, 144 * 8),
+ GregtechItemList.Controller_IndustrialAutoChisel.get(1),
+ 20 * 20,
+ MaterialUtils.getVoltageForTier(4));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(14),
+ ItemList.Casing_SolidSteel.get(2),
+ CI.getPlate(4, 2),
+ CI.getTieredComponent(OrePrefixes.plate, 3, 4),
+ CI.getTieredComponent(OrePrefixes.ring, 3, 8),
+ CI.getTieredComponent(OrePrefixes.rod, 2, 4),
+ },
+ CI.getTieredFluid(2, 144 * 2),
+ GregtechItemList.Casing_IndustrialAutoChisel.get(1),
+ 20 * 20,
+ MaterialUtils.getVoltageForTier(3));
+ }
+
+ private static void rockBreaker() {
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(12),
+ ItemList.Machine_EV_RockBreaker.get(1),
+ ALLOY.STAINLESS_STEEL.getPlate(8),
+ ALLOY.STAINLESS_STEEL.getRing(4),
+ CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.plateDouble, 8),
+ ALLOY.EGLIN_STEEL.getScrew(8),
+ },
+ ELEMENT.getInstance().ALUMINIUM.getFluidStack(144 * 8),
+ GregtechItemList.Controller_IndustrialRockBreaker.get(1),
+ 60 * 20 * 2,
+ MaterialUtils.getVoltageForTier(4));
+ }
+
+ private static void fakeMachineCasingCovers() {
+ GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] {
+ GregtechItemList.FakeMachineCasingPlate_ULV,
+ GregtechItemList.FakeMachineCasingPlate_LV,
+ GregtechItemList.FakeMachineCasingPlate_MV,
+ GregtechItemList.FakeMachineCasingPlate_HV,
+ GregtechItemList.FakeMachineCasingPlate_EV,
+ GregtechItemList.FakeMachineCasingPlate_IV,
+ GregtechItemList.FakeMachineCasingPlate_LuV,
+ GregtechItemList.FakeMachineCasingPlate_ZPM,
+ GregtechItemList.FakeMachineCasingPlate_UV,
+ GregtechItemList.FakeMachineCasingPlate_MAX,
+ };
+ int aMaxTier = GT_Values.VOLTAGE_NAMES.length;
+ if (!GTNH) {
+ aMaxTier = 10;
+ }
+ ItemStack aTier[] = new ItemStack[aMaxTier];
+ for (int i = 0; i < aMaxTier; i++) {
+ aTier[i] = ItemUtils.simpleMetaStack(CoverManager.Cover_Gt_Machine_Casing, i, 7);
+ }
+ // Deprecate old recipes
+ for (int i = 0; i < 10; i++) {
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {mMachineCasingCovers[i].get(1)}, ItemUtils.getSimpleStack(aTier[i], 1));
+ }
+ // Add recipes for new ones
+ for (int i = 0; i < aMaxTier; i++) {
+ GT_Values.RA.addCutterRecipe(
+ CI.getTieredMachineCasing(i), aTier[i], null, 20 * 5 * i, (int) GT_Values.V[i]);
+ }
+ }
+
+ private static void ztonesCoverRecipes() {
+
+ if (!Loader.isModLoaded("Ztones")) {
+ return;
+ }
+ Class ModBlocksClass = ReflectionUtils.getClass("com.riciJak.Ztones.init.ModBlocks");
+ Block agon = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "agonBlock"));
+ Block korp = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "korpBlock"));
+ Block jelt = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "jeltBlock"));
+ Block bitt = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "bittBlock"));
+ Block iszm = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "iszmBlock"));
+
+ // "agon", "iszm", "korp", "jelt", "bitt"
+
+ ItemStack[] aBlocks = new ItemStack[] {
+ ItemUtils.getSimpleStack(agon),
+ ItemUtils.getSimpleStack(iszm),
+ ItemUtils.getSimpleStack(korp),
+ ItemUtils.getSimpleStack(jelt),
+ ItemUtils.getSimpleStack(bitt)
+ };
+ MetaCustomCoverItem[] aCovers = new MetaCustomCoverItem[] {
+ CoverManager.Cover_Agon,
+ CoverManager.Cover_Iszm,
+ CoverManager.Cover_Korp,
+ CoverManager.Cover_Jelt,
+ CoverManager.Cover_Bitt
+ };
+
+ ItemStack aInputs[][] = new ItemStack[5][16];
+ ItemStack aOutputs[][] = new ItemStack[5][16];
+ for (int a = 0; a < 5; a++) {
+ for (int i = 0; i < 16; i++) {
+ aInputs[a][i] = ItemUtils.simpleMetaStack(aBlocks[a].getItem(), i, 1);
+ aOutputs[a][i] = ItemUtils.simpleMetaStack(aCovers[a], i, 9);
+ }
+ }
+ for (int a = 0; a < 5; a++) {
+ for (int i = 0; i < 16; i++) {
+ if (GTNH) continue;
+ ItemStack aInput = aInputs[a][i];
+ ItemStack aOutput = aOutputs[a][i];
+ if (GT_Values.RA.addCutterRecipe(aInput, aOutput, null, 20 * 5, 16)) {
+ Logger.INFO("Added Cutting recipe for " + aInput.getDisplayName());
+ }
+
+ if (CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {CI.getNumberedCircuit((i / 4) + 4), aOutput},
+ FluidUtils.getWildcardFluidStack("glue", 250),
+ aInput,
+ 20 * 10,
+ 16)) {
+ Logger.INFO("Added Assembly recipe for " + aInput.getDisplayName());
+ }
+ }
+ }
+ }
+
+ private static void superBuses() {
+ GregtechItemList[] mSuperBusesInput = new GregtechItemList[] {
+ GregtechItemList.Hatch_SuperBus_Input_ULV,
+ GregtechItemList.Hatch_SuperBus_Input_LV,
+ GregtechItemList.Hatch_SuperBus_Input_MV,
+ GregtechItemList.Hatch_SuperBus_Input_HV,
+ GregtechItemList.Hatch_SuperBus_Input_EV,
+ GregtechItemList.Hatch_SuperBus_Input_IV,
+ GregtechItemList.Hatch_SuperBus_Input_LuV,
+ GregtechItemList.Hatch_SuperBus_Input_ZPM,
+ GregtechItemList.Hatch_SuperBus_Input_UV,
+ GregtechItemList.Hatch_SuperBus_Input_MAX,
+ };
+
+ GregtechItemList[] mSuperBusesOutput = new GregtechItemList[] {
+ GregtechItemList.Hatch_SuperBus_Output_ULV,
+ GregtechItemList.Hatch_SuperBus_Output_LV,
+ GregtechItemList.Hatch_SuperBus_Output_MV,
+ GregtechItemList.Hatch_SuperBus_Output_HV,
+ GregtechItemList.Hatch_SuperBus_Output_EV,
+ GregtechItemList.Hatch_SuperBus_Output_IV,
+ GregtechItemList.Hatch_SuperBus_Output_LuV,
+ GregtechItemList.Hatch_SuperBus_Output_ZPM,
+ GregtechItemList.Hatch_SuperBus_Output_UV,
+ GregtechItemList.Hatch_SuperBus_Output_MAX,
+ };
+
+ ItemStack[] mInputHatch = new ItemStack[] {
+ ItemList.Hatch_Input_Bus_EV.get(1),
+ ItemList.Hatch_Input_Bus_IV.get(1),
+ ItemList.Hatch_Input_Bus_LuV.get(1),
+ ItemList.Hatch_Input_Bus_ZPM.get(1),
+ ItemList.Hatch_Input_Bus_UV.get(1),
+ ItemList.Hatch_Input_Bus_MAX.get(1),
+ GregtechItemList.Hatch_SuperBus_Input_LV.get(1),
+ GregtechItemList.Hatch_SuperBus_Input_MV.get(1),
+ GregtechItemList.Hatch_SuperBus_Input_HV.get(1),
+ GregtechItemList.Hatch_SuperBus_Input_EV.get(1),
+ };
+
+ ItemStack[] mOutputHatch = new ItemStack[] {
+ ItemList.Hatch_Output_Bus_EV.get(1),
+ ItemList.Hatch_Output_Bus_IV.get(1),
+ ItemList.Hatch_Output_Bus_LuV.get(1),
+ ItemList.Hatch_Output_Bus_ZPM.get(1),
+ ItemList.Hatch_Output_Bus_UV.get(1),
+ ItemList.Hatch_Output_Bus_MAX.get(1),
+ GregtechItemList.Hatch_SuperBus_Output_LV.get(1),
+ GregtechItemList.Hatch_SuperBus_Output_MV.get(1),
+ GregtechItemList.Hatch_SuperBus_Output_HV.get(1),
+ GregtechItemList.Hatch_SuperBus_Output_EV.get(1),
+ };
+
+ // Special Case recipes for ULV buses
+ {
+ int i = 0;
+ ItemStack[] aInputs1 = new ItemStack[] {
+ CI.getNumberedCircuit(17),
+ mInputHatch[i],
+ CI.getElectricMotor(i, GTNH ? 8 : 2),
+ CI.getConveyor(i, GTNH ? 10 : 5),
+ CI.getBolt(i, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
+ };
+ Logger.INFO("[FIND] " + ItemUtils.getArrayStackNames(aInputs1));
+ ItemStack[] aOutputs1 = new ItemStack[] {
+ CI.getNumberedCircuit(18),
+ mOutputHatch[i],
+ CI.getElectricPiston(i, GTNH ? 8 : 2),
+ CI.getConveyor(i, GTNH ? 10 : 5),
+ CI.getGear(i, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
+ };
+ Logger.INFO("[FIND] " + ItemUtils.getArrayStackNames(aOutputs1));
+
+ FluidStack a1 = CI.getAlternativeTieredFluid(i, 144 * 8);
+ FluidStack a2 = CI.getTertiaryTieredFluid(i, 144 * 8);
+
+ Logger.INFO("[FIND] Input Bus Fluid: " + ItemUtils.getFluidName(a1));
+ Logger.INFO("[FIND] Output Bus Fluid: " + ItemUtils.getFluidName(a2));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ aInputs1, a1, mSuperBusesInput[i].get(1), 20 * 30 * 2 * i, (int) GT_Values.V[i]);
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ aOutputs1, a2, mSuperBusesOutput[i].get(1), 20 * 30 * 2 * i, (int) GT_Values.V[i]);
+ }
+
+ // Input Buses
+ for (int i = 1; i < 10; i++) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(17),
+ mInputHatch[i],
+ CI.getElectricMotor(i, GTNH ? 8 : 2),
+ CI.getConveyor(i, GTNH ? 10 : 5),
+ CI.getBolt(i, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
+ },
+ CI.getAlternativeTieredFluid(i, 144 * 8),
+ mSuperBusesInput[i].get(1),
+ 20 * 30 * 2 * i,
+ (int) GT_Values.V[i]);
+ }
+ // Output Buses
+ for (int i = 1; i < 10; i++) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(18),
+ mOutputHatch[i],
+ CI.getElectricPiston(i, GTNH ? 8 : 2),
+ CI.getConveyor(i, GTNH ? 10 : 5),
+ CI.getGear(i, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
+ },
+ CI.getTertiaryTieredFluid(i, 144 * 8),
+ mSuperBusesOutput[i].get(1),
+ 20 * 30 * 2 * i,
+ (int) GT_Values.V[i]);
+ }
+ }
+
+ private static void roundRobinators() {
+
+ RecipeUtils.addShapedGregtechRecipe(
+ ItemUtils.getSimpleStack(Blocks.hopper),
+ "circuitPrimitive",
+ ItemUtils.getSimpleStack(Blocks.hopper),
+ CI.craftingToolWrench,
+ CI.machineCasing_ULV,
+ CI.craftingToolScrewdriver,
+ ItemUtils.getSimpleStack(Blocks.hopper),
+ "circuitPrimitive",
+ ItemUtils.getSimpleStack(Blocks.hopper),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1));
+
+ ItemStack[] aRobinators = new ItemStack[] {
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 1, 1),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 2, 1),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 3, 1),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 4, 1),
+ };
+
+ int aCostMultiplier = GTNH ? 2 : 1;
+
+ for (int i = 0; i < 5; i++) {
+ if (i == 0) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(17),
+ CI.getTieredMachineCasing(0),
+ ItemUtils.getSimpleStack(Blocks.hopper, 4),
+ CI.getTieredComponent(OrePrefixes.circuit, 0, 2)
+ },
+ GT_Values.NF, // Input Fluid
+ aRobinators[i],
+ 45 * 10 * 1,
+ 8);
+ continue;
+ }
+ int aTier = i + 1;
+ ItemStack[] aInputs = new ItemStack[] {
+ aRobinators[i - 1],
+ CI.getTieredMachineHull(aTier, 1 * aCostMultiplier),
+ CI.getConveyor(aTier, 2 * aCostMultiplier),
+ CI.getElectricMotor(aTier, 2 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.circuit, i, 2 * aCostMultiplier),
+ };
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ aInputs,
+ GT_Values.NF, // Input Fluid
+ aRobinators[i],
+ 45 * 10 * 1 * (i + 1),
+ MaterialUtils.getVoltageForTier(i));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java
index 3ed2f5f168..953345141b 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java
@@ -20,439 +20,661 @@ import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import net.minecraft.item.ItemStack;
-public class RECIPES_Old_Circuits implements IOreRecipeRegistrator {
- public RECIPES_Old_Circuits() {
- OrePrefixes.crafting.add(this);
- }
-
- @Override
- public void registerOre(final OrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) {
- if (aOreDictName.equals(OreDictNames.craftingLensRed.toString())) {
- Logger.INFO("[Old Feature - Circuits] Adding recipes for old circuits. (Part 2)");
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Copper, 1L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Wiring_Basic.get(1L, new Object[0]), 64, 30);
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.AnnealedCopper, 1L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Wiring_Basic.get(1L, new Object[0]), 64, 30);
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Gold, 1L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Wiring_Advanced.get(1L, new Object[0]), 64, 120);
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Electrum, 1L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Wiring_Advanced.get(1L, new Object[0]), 64, 120);
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Platinum, 1L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Wiring_Elite.get(1L, new Object[0]), 64, 480);
- }
-
- else if (aOreDictName.equals(OreDictNames.craftingLensGreen.toString())) {
- Logger.INFO("[Old Feature - Circuits] Adding recipes for old circuits. (Part 3)");
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Olivine, 1L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1L, new Object[0]), 256, 480);
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Emerald, 1L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1L, new Object[0]), 256, 480);
- }
-
- else if (aOreDictName.equals(OreDictNames.craftingLensBlue.toString()) || aOreDictName.equals(OreDictNames.craftingLensCyan.toString()) || aOreDictName.equals(OreDictNames.craftingLensLightBlue.toString())) {
- Logger.INFO("[Old Feature - Circuits] Adding recipes for old circuits. (Part 4)");
- GT_Values.RA.addLaserEngraverRecipe(ItemList.IC2_LapotronCrystal.getWildcard(1L, new Object[0]), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(3L, new Object[0]), 256, 480);
- }
- }
-
-
- private static boolean addCircuitRecipes(){
- Logger.INFO("[Old Feature - Circuits] Adding recipes for old circuits. (Part 1)");
- GT_ModHandler.addShapelessCraftingRecipe(GregtechItemList.Old_Circuit_Primitive.get(1L, new Object[0]), new Object[]{GT_ModHandler.getIC2Item("casingadviron", 1L), OrePrefixes.wireGt01.get(Materials.RedAlloy), OrePrefixes.wireGt01.get(Materials.RedAlloy), OrePrefixes.wireGt01.get(Materials.Tin)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), new Object[]{"WWW", "CPC", "WWW", 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OreDictNames.craftingWireCopper, 'P', OrePrefixes.plate.get(Materials.Steel)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), new Object[]{"WCW", "WPW", "WCW", 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OreDictNames.craftingWireCopper, 'P', OrePrefixes.plate.get(Materials.Steel)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), new Object[]{"WWW", "CPC", "WWW", 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'P', OrePrefixes.plate.get(Materials.Steel)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), new Object[]{"WCW", "WPW", "WCW", 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'P', OrePrefixes.plate.get(Materials.Steel)});
-
- GT_Values.RA.addFormingPressRecipe(GregtechItemList.Old_Empty_Board_Basic.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Wiring_Basic.get(4L, new Object[0]), GregtechItemList.Old_Circuit_Board_Basic.get(1L, new Object[0]), 32, 16);
- GT_Values.RA.addFormingPressRecipe(GregtechItemList.Old_Empty_Board_Basic.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Wiring_Advanced.get(4L, new Object[0]), GregtechItemList.Old_Circuit_Board_Advanced.get(1L, new Object[0]), 32, 64);
- GT_Values.RA.addFormingPressRecipe(GregtechItemList.Old_Empty_Board_Elite.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Wiring_Elite.get(4L, new Object[0]), GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]), 32, 256);
-
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lapis, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), GregtechItemList.Old_Circuit_Parts_Advanced.get(2L, new Object[0]), 32, 64);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), GregtechItemList.Old_Circuit_Parts_Advanced.get(2L, new Object[0]), 32, 64);
-
- int tMultiplier;
- for (Materials tMat : Materials.values()) {
- if ((tMat.mStandardMoltenFluid != null) && (tMat.contains(SubTag.SOLDERING_MATERIAL)))
- {
- tMultiplier = tMat.contains(SubTag.SOLDERING_MATERIAL_BAD) ? 4 : tMat.contains(SubTag.SOLDERING_MATERIAL_GOOD) ? 1 : 2;
-
- GT_Values.RA.addAssemblerRecipe(ItemList.IC2_Item_Casing_Steel.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.RedAlloy, 2L), tMat.getMolten(144L * tMultiplier / 8L), GregtechItemList.Old_Circuit_Primitive.get(1L, new Object[0]), 16, 8);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 1L), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.RedAlloy, 1L), tMat.getMolten(144L * tMultiplier / 8L), GregtechItemList.Old_Circuit_Primitive.get(1L, new Object[0]), 16, 8);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Basic.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Primitive.get(2L, new Object[0]), tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), 32, 16);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Primitive.get(2L, new Object[0]), tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Old_Circuit_Good.get(1L, new Object[0]), 32, 16);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Advanced.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Advanced.get(2L, new Object[0]), tMat.getMolten(144L * tMultiplier / 2L), GregtechItemList.Old_Circuit_Advanced.get(1L, new Object[0]), 32, 64);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Advanced.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1L, new Object[0]), tMat.getMolten(144L * tMultiplier / 2L), GregtechItemList.Old_Circuit_Data.get(1L, new Object[0]), 32, 64);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Data.get(3L, new Object[0]), tMat.getMolten(144L * tMultiplier / 1L), GregtechItemList.Old_Circuit_Elite.get(1L, new Object[0]), 32, 256);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]), ItemList.Circuit_Parts_Crystal_Chip_Master.get(3L, new Object[0]), tMat.getMolten(144L * tMultiplier / 1L), GregtechItemList.Old_Circuit_Master.get(1L, new Object[0]), 32, 256);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(3L, new Object[0]), tMat.getMolten(144L * tMultiplier / 1L), GregtechItemList.Old_Circuit_Master.get(1L, new Object[0]), 32, 256);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Data.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 2L), tMat.getMolten(144L * tMultiplier / 2L), GregtechItemList.Old_Tool_DataStick.get(1L, new Object[0]), 128, 64);
- }
- }
-
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Elite.get(2L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(18L, new Object[0]), GT_Values.NF, GregtechItemList.Old_Tool_DataOrb.get(1L, new Object[0]), 512, 256);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Master.get(2L, new Object[0]), ItemList.Circuit_Parts_Crystal_Chip_Master.get(18L, new Object[0]), GT_Values.NF, ItemList.Energy_LapotronicOrb.get(1L, new Object[0]), 512, 1024);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Master.get(2L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(18L, new Object[0]), GT_Values.NF, ItemList.Energy_LapotronicOrb.get(1L, new Object[0]), 512, 1024);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 1L), GregtechItemList.Old_Empty_Board_Basic.get(1L, new Object[0]), 32, 16);
-
- Materials plasticType = Materials.get("Polytetrafluoroethylene") != null ? Materials.get("Polytetrafluoroethylene") : Materials.Plastic;
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 2L), GT_OreDictUnificator.get(OrePrefixes.plate, plasticType, 1L), GregtechItemList.Old_Empty_Board_Elite.get(1L, new Object[0]), 32, 256);
-
-
-
- return true;
- }
-
- public static boolean handleCircuits(){
- hideCircuitsNEI();
- addCircuitRecipes();
- removeNewCircuits();
- generateTradeRecipes();
- return true;
- }
-
- private static boolean setItemList(ItemList Set, GregtechItemList Get) {
- try{
- Set.set(Get.get(1));
- return true;
- }
- catch (Throwable t) {}
- return false;
- }
-
- private static boolean removeNewCircuits(){
- Logger.INFO("[Old Feature - Circuits] Overriding .28+ circuit values in the GT5u Itemlist with values from GT++.");
-
- boolean newVersion = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() >= 30;
-
- setItemList(ItemList.Circuit_Primitive, GregtechItemList.Old_Circuit_Primitive);
- setItemList(ItemList.Circuit_Basic, GregtechItemList.Old_Circuit_Basic);
- setItemList(ItemList.Circuit_Good, GregtechItemList.Old_Circuit_Good);
- setItemList(ItemList.Circuit_Advanced, GregtechItemList.Old_Circuit_Advanced);
- //ItemList.Circuit_Data, GregtechItemList.Old_Circuit_Data);
- setItemList(ItemList.Circuit_Elite, GregtechItemList.Old_Circuit_Elite);
- setItemList(ItemList.Circuit_Master, GregtechItemList.Old_Circuit_Master);
- setItemList(ItemList.Circuit_Ultimate, GregtechItemList.Old_Circuit_Ultimate);
-
- /**
- * Try Set New circuits to have old replacements
- */
-
- //Basic
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Microprocessor"), GregtechItemList.Old_Circuit_Basic); //NEW
- }
- //Good
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Integrated_Good"), GregtechItemList.Old_Circuit_Good); //New
- }
- //Advanced
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Nanoprocessor"), GregtechItemList.Old_Circuit_Advanced);
- }
- //Data
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Quantumprocessor"), GregtechItemList.Old_Circuit_Data);
- }
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Nanocomputer"), GregtechItemList.Old_Circuit_Data);
- }
- //Elite
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Crystalprocessor"), GregtechItemList.Old_Circuit_Elite);
- }
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Quantumcomputer"), GregtechItemList.Old_Circuit_Elite);
- }
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Elitenanocomputer"), GregtechItemList.Old_Circuit_Elite);
- }
- //Master
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Neuroprocessor"), GregtechItemList.Old_Circuit_Master);
- }
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Masterquantumcomputer"), GregtechItemList.Old_Circuit_Master);
- }
- //Ultimate
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Wetwarecomputer"), GregtechItemList.Old_Circuit_Ultimate);
- }
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Ultimatecrystalcomputer"), GregtechItemList.Old_Circuit_Ultimate);
- }
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Quantummainframe"), GregtechItemList.Old_Circuit_Ultimate);
- }
- //Superconductor
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Wetwaresupercomputer"), GregtechItemList.Circuit_IV);
- }
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Crystalmainframe"), GregtechItemList.Circuit_IV);
- }
- //Infinite
- if (newVersion) {
- setItemList(ItemList.valueOf("Circuit_Wetwaremainframe"), GregtechItemList.Circuit_LuV);
- }
-
- //set data orbs and sticks to their new replacements
- setItemList(ItemList.Tool_DataStick, GregtechItemList.Old_Tool_DataStick);
- setItemList(ItemList.Tool_DataOrb, GregtechItemList.Old_Tool_DataOrb);
-
- setItemList(ItemList.Circuit_Board_Basic, GregtechItemList.Old_Circuit_Board_Basic);
- setItemList(ItemList.Circuit_Board_Advanced, GregtechItemList.Old_Circuit_Board_Advanced);
- setItemList(ItemList.Circuit_Board_Elite, GregtechItemList.Old_Circuit_Board_Elite);
- setItemList(ItemList.Circuit_Parts_Advanced, GregtechItemList.Old_Circuit_Parts_Advanced);
- setItemList(ItemList.Circuit_Parts_Wiring_Basic, GregtechItemList.Old_Circuit_Parts_Wiring_Basic);
- setItemList(ItemList.Circuit_Parts_Wiring_Advanced, GregtechItemList.Old_Circuit_Parts_Wiring_Advanced);
- setItemList(ItemList.Circuit_Parts_Wiring_Elite, GregtechItemList.Old_Circuit_Parts_Wiring_Elite);
- setItemList(ItemList.Circuit_Parts_Crystal_Chip_Elite, GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite);
- setItemList(ItemList.Circuit_Parts_Crystal_Chip_Master, GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master);
-
- return true;
- }
-
- private static boolean generateTradeRecipes(){
-
- //Data stick and Data orbs.
- //GT Type to GT++ Type
- RecipeUtils.recipeBuilder(
- CI.craftingToolScrewdriver, null, null,
- ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32708", 32708, 1), null, null,
- null, null, null,
- GregtechItemList.Old_Tool_DataStick.get(1));
- RecipeUtils.recipeBuilder(
- CI.craftingToolScrewdriver, null, null,
- ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32707", 32707, 1), null, null,
- null, null, null,
- GregtechItemList.Old_Tool_DataOrb.get(1));
-
- //GT++ Type to GT Type
- RecipeUtils.recipeBuilder(
- CI.craftingToolScrewdriver, null, null,
- GregtechItemList.Old_Tool_DataStick.get(1), null, null,
- null, null, null,
- ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32708", 32708, 1));
- RecipeUtils.recipeBuilder(
- CI.craftingToolScrewdriver, null, null,
- GregtechItemList.Old_Tool_DataOrb.get(1), null, null,
- null, null, null,
- ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32707", 32707, 1));
-
-
-
- //Primitive
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32700", 32700, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitPrimitive", 1));
-
- //Basic
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32701", 32701, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitBasic", 1));
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.03:32078", 32078, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitBasic", 1));
-
- //Good
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32702", 32702, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitGood", 1));
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32702", 32702, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitGood", 1));
-
- //Advanced
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32703", 32703, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitAdvanced", 1));
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32703", 32703, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitAdvanced", 1));
-
- //Data
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32704", 32704, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitData", 1));
-
- //Elite
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32705", 32705, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitElite", 1));
-
- //Master
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32706", 32706, 1)},
- ItemUtils.getItemStackOfAmountFromOreDict("circuitMaster", 1));
-
-
-
- //Components
- //Green Chip
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32713", 32713, 1)},
- GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1));
- //Blue Chip
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32714", 32714, 1)},
- GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(1));
-
- //Basic Board
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32710", 32710, 1)},
- GregtechItemList.Old_Circuit_Board_Basic.get(1));
- //Advanced Board
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32711", 32711, 1)},
- GregtechItemList.Old_Circuit_Board_Advanced.get(1));
- //Elite Board
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[]{ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32712", 32712, 1)},
- GregtechItemList.Old_Circuit_Board_Elite.get(1));
-
-
- //remove a few recipes
- /*GT_ModHandler.removeRecipeByOutput(ItemUtils.simpleMetaStack("gregtech:gt.metaitem.03:32070", 32070, 1));
- GT_ModHandler.removeRecipeByOutput(ItemUtils.simpleMetaStack("gregtech:gt.metaitem.03:32069", 32069, 1));
- if (LoadedMods.Extra_Utils){
- ItemStack EQU = ItemUtils.simpleMetaStack("ExtraUtilities:enderQuarryUpgrade", 0, 1);
- if (EQU != null){
- GT_ModHandler.removeRecipeByOutput(EQU);
- GT_Values.RA.addAssemblerRecipe(
- ItemUtils.simpleMetaStack("ExtraUtilities:decorativeBlock1:12", 12, 1),
- GregtechItemList.Old_Circuit_Master.get(1),
- EQU,
- 80*20,
- 2);
- }
- }
- if (LoadedMods.GalacticraftCore){
- ItemStack ACW = ItemUtils.simpleMetaStack("GalacticraftCore:item.basicItem:14", 14, 1);
- if (ACW != null){
- GT_ModHandler.removeRecipeByOutput(ACW);
- GT_Values.RA.addAssemblerRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("gemDiamond", 1),
- GregtechItemList.Old_Circuit_Board_Advanced.get(1),
- ACW,
- 160*20,
- 4);
- }
- ItemStack ACW2 = ItemUtils.simpleMetaStack("GalacticraftCore:item.basicItem:13", 13, 1);
- if (ACW2 != null){
- GT_ModHandler.removeRecipeByOutput(ACW2);
- GT_Values.RA.addAssemblerRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("gemDiamond", 1),
- GregtechItemList.Old_Circuit_Board_Basic.get(1),
- ACW2,
- 80*20,
- 2);
- }
- }*/
-
- return true;
- }
-
- private static boolean hideCircuitsNEI(){
- Boolean isNEILoaded = Loader.isModLoaded("NotEnoughItems");
- if (isNEILoaded && !CORE.ConfigSwitches.showHiddenNEIItems){
- Logger.INFO("[Old Feature - Circuits] Hiding .28+ circuits in NEI.");
- String[] CircuitToHide = {
- "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_Integrated_Good",
- "Circuit_Good",
- "Circuit_Advanced",
- "Circuit_Data",
- "Circuit_Elite",
- "Circuit_Master",
- "Circuit_Ultimate",
- "Circuit_Board_Coated",
- "Circuit_Board_Phenolic",
- "Circuit_Board_Epoxy",
- "Circuit_Board_Fiberglass",
- "Circuit_Board_Multifiberglass",
- "Circuit_Board_Wetware",
- "Circuit_Parts_Resistor",
- "Circuit_Parts_ResistorSMD",
- "Circuit_Parts_Glass_Tube",
- "Circuit_Parts_Vacuum_Tube",
- "Circuit_Parts_Coil",
- "Circuit_Parts_Diode",
- "Circuit_Parts_DiodeSMD",
- "Circuit_Parts_Transistor",
- "Circuit_Parts_TransistorSMD",
- "Circuit_Parts_Capacitor",
- "Circuit_Parts_CapacitorSMD",
- "Circuit_Silicon_Ingot",
- "Circuit_Silicon_Ingot2",
- "Circuit_Silicon_Ingot3",
- "Circuit_Silicon_Wafer",
- "Circuit_Silicon_Wafer2",
- "Circuit_Silicon_Wafer3",
- "Circuit_Wafer_ILC",
- "Circuit_Chip_ILC",
- "Circuit_Wafer_Ram",
- "Circuit_Chip_Ram",
- "Circuit_Wafer_NAND",
- "Circuit_Chip_NAND",
- "Circuit_Wafer_NOR",
- "Circuit_Chip_NOR",
- "Circuit_Wafer_CPU",
- "Circuit_Chip_CPU",
- "Circuit_Wafer_SoC",
- "Circuit_Chip_SoC",
- "Circuit_Wafer_SoC2",
- "Circuit_Chip_SoC2",
- "Circuit_Wafer_PIC",
- "Circuit_Chip_PIC",
- "Circuit_Wafer_HPIC",
- "Circuit_Chip_HPIC",
- "Circuit_Wafer_NanoCPU",
- "Circuit_Chip_NanoCPU",
- "Circuit_Wafer_QuantumCPU",
- "Circuit_Chip_QuantumCPU",
- "Circuit_Chip_CrystalCPU",
- "Circuit_Chip_CrystalSoC",
- "Circuit_Chip_NeuroCPU",
- "Circuit_Chip_Stemcell",
- "Circuit_Processor",
- "Circuit_Computer",
- "Circuit_Nanoprocessor",
- "Circuit_Nanocomputer",
- "Circuit_Elitenanocomputer",
- "Circuit_Quantumprocessor",
- "Circuit_Quantumcomputer",
- "Circuit_Masterquantumcomputer",
- "Circuit_Quantummainframe",
- "Circuit_Crystalprocessor",
- "Circuit_Crystalcomputer",
- "Circuit_Ultimatecrystalcomputer",
- "Circuit_Crystalmainframe",
- "Circuit_Neuroprocessor",
- "Circuit_Wetwarecomputer",
- "Circuit_Wetwaresupercomputer",
- "Circuit_Wetwaremainframe",
- "Circuit_Parts_RawCrystalChip",
- //Circuits Additions in .30/.31
- "Circuit_Board_Plastic",
- "Circuit_Parts_GlassFiber",
- "Circuit_Parts_PetriDish",
- "Circuit_Microprocessor"
- };
-
- for (String component : CircuitToHide){
- try {
- ItemUtils.hideItemFromNEI(ItemUtils.getValueOfItemList(component, null).get(1L, new Object[0]));
- } catch (IllegalArgumentException I){
- Logger.INFO("Could not find "+component+" in the Gregtech item list.");
- Logger.INFO("This is NOT an error, simply a notification.");
- }
- }
- }
- return true;
- }
-
+public class RECIPES_Old_Circuits implements IOreRecipeRegistrator {
+ public RECIPES_Old_Circuits() {
+ OrePrefixes.crafting.add(this);
+ }
+
+ @Override
+ public void registerOre(
+ final OrePrefixes aPrefix,
+ final Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ if (aOreDictName.equals(OreDictNames.craftingLensRed.toString())) {
+ Logger.INFO("[Old Feature - Circuits] Adding recipes for old circuits. (Part 2)");
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Copper, 1L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Old_Circuit_Parts_Wiring_Basic.get(1L, new Object[0]),
+ 64,
+ 30);
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.AnnealedCopper, 1L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Old_Circuit_Parts_Wiring_Basic.get(1L, new Object[0]),
+ 64,
+ 30);
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Gold, 1L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Old_Circuit_Parts_Wiring_Advanced.get(1L, new Object[0]),
+ 64,
+ 120);
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Electrum, 1L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Old_Circuit_Parts_Wiring_Advanced.get(1L, new Object[0]),
+ 64,
+ 120);
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Platinum, 1L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Old_Circuit_Parts_Wiring_Elite.get(1L, new Object[0]),
+ 64,
+ 480);
+ } else if (aOreDictName.equals(OreDictNames.craftingLensGreen.toString())) {
+ Logger.INFO("[Old Feature - Circuits] Adding recipes for old circuits. (Part 3)");
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Olivine, 1L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1L, new Object[0]),
+ 256,
+ 480);
+ GT_Values.RA.addLaserEngraverRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Emerald, 1L),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1L, new Object[0]),
+ 256,
+ 480);
+ } else if (aOreDictName.equals(OreDictNames.craftingLensBlue.toString())
+ || aOreDictName.equals(OreDictNames.craftingLensCyan.toString())
+ || aOreDictName.equals(OreDictNames.craftingLensLightBlue.toString())) {
+ Logger.INFO("[Old Feature - Circuits] Adding recipes for old circuits. (Part 4)");
+ GT_Values.RA.addLaserEngraverRecipe(
+ ItemList.IC2_LapotronCrystal.getWildcard(1L, new Object[0]),
+ GT_Utility.copyAmount(0L, new Object[] {aStack}),
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(3L, new Object[0]),
+ 256,
+ 480);
+ }
+ }
+
+ private static boolean addCircuitRecipes() {
+ Logger.INFO("[Old Feature - Circuits] Adding recipes for old circuits. (Part 1)");
+ GT_ModHandler.addShapelessCraftingRecipe(
+ GregtechItemList.Old_Circuit_Primitive.get(1L, new Object[0]), new Object[] {
+ GT_ModHandler.getIC2Item("casingadviron", 1L),
+ OrePrefixes.wireGt01.get(Materials.RedAlloy),
+ OrePrefixes.wireGt01.get(Materials.RedAlloy),
+ OrePrefixes.wireGt01.get(Materials.Tin)
+ });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), new Object[] {
+ "WWW",
+ "CPC",
+ "WWW",
+ 'C',
+ OrePrefixes.circuit.get(Materials.Primitive),
+ 'W',
+ OreDictNames.craftingWireCopper,
+ 'P',
+ OrePrefixes.plate.get(Materials.Steel)
+ });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), new Object[] {
+ "WCW",
+ "WPW",
+ "WCW",
+ 'C',
+ OrePrefixes.circuit.get(Materials.Primitive),
+ 'W',
+ OreDictNames.craftingWireCopper,
+ 'P',
+ OrePrefixes.plate.get(Materials.Steel)
+ });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), new Object[] {
+ "WWW",
+ "CPC",
+ "WWW",
+ 'C',
+ OrePrefixes.circuit.get(Materials.Primitive),
+ 'W',
+ OrePrefixes.cableGt01.get(Materials.RedAlloy),
+ 'P',
+ OrePrefixes.plate.get(Materials.Steel)
+ });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]), new Object[] {
+ "WCW",
+ "WPW",
+ "WCW",
+ 'C',
+ OrePrefixes.circuit.get(Materials.Primitive),
+ 'W',
+ OrePrefixes.cableGt01.get(Materials.RedAlloy),
+ 'P',
+ OrePrefixes.plate.get(Materials.Steel)
+ });
+
+ GT_Values.RA.addFormingPressRecipe(
+ GregtechItemList.Old_Empty_Board_Basic.get(1L, new Object[0]),
+ GregtechItemList.Old_Circuit_Parts_Wiring_Basic.get(4L, new Object[0]),
+ GregtechItemList.Old_Circuit_Board_Basic.get(1L, new Object[0]),
+ 32,
+ 16);
+ GT_Values.RA.addFormingPressRecipe(
+ GregtechItemList.Old_Empty_Board_Basic.get(1L, new Object[0]),
+ GregtechItemList.Old_Circuit_Parts_Wiring_Advanced.get(4L, new Object[0]),
+ GregtechItemList.Old_Circuit_Board_Advanced.get(1L, new Object[0]),
+ 32,
+ 64);
+ GT_Values.RA.addFormingPressRecipe(
+ GregtechItemList.Old_Empty_Board_Elite.get(1L, new Object[0]),
+ GregtechItemList.Old_Circuit_Parts_Wiring_Elite.get(4L, new Object[0]),
+ GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]),
+ 32,
+ 256);
+
+ GT_Values.RA.addFormingPressRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lapis, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L),
+ GregtechItemList.Old_Circuit_Parts_Advanced.get(2L, new Object[0]),
+ 32,
+ 64);
+ GT_Values.RA.addFormingPressRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L),
+ GregtechItemList.Old_Circuit_Parts_Advanced.get(2L, new Object[0]),
+ 32,
+ 64);
+
+ int tMultiplier;
+ for (Materials tMat : Materials.values()) {
+ if ((tMat.mStandardMoltenFluid != null) && (tMat.contains(SubTag.SOLDERING_MATERIAL))) {
+ tMultiplier = tMat.contains(SubTag.SOLDERING_MATERIAL_BAD)
+ ? 4
+ : tMat.contains(SubTag.SOLDERING_MATERIAL_GOOD) ? 1 : 2;
+
+ GT_Values.RA.addAssemblerRecipe(
+ ItemList.IC2_Item_Casing_Steel.get(1L, new Object[0]),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.RedAlloy, 2L),
+ tMat.getMolten(144L * tMultiplier / 8L),
+ GregtechItemList.Old_Circuit_Primitive.get(1L, new Object[0]),
+ 16,
+ 8);
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.RedAlloy, 1L),
+ tMat.getMolten(144L * tMultiplier / 8L),
+ GregtechItemList.Old_Circuit_Primitive.get(1L, new Object[0]),
+ 16,
+ 8);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Board_Basic.get(1L, new Object[0]),
+ GregtechItemList.Old_Circuit_Primitive.get(2L, new Object[0]),
+ tMat.getMolten(144L * tMultiplier / 4L),
+ GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]),
+ 32,
+ 16);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Basic.get(1L, new Object[0]),
+ GregtechItemList.Old_Circuit_Primitive.get(2L, new Object[0]),
+ tMat.getMolten(144L * tMultiplier / 4L),
+ GregtechItemList.Old_Circuit_Good.get(1L, new Object[0]),
+ 32,
+ 16);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Board_Advanced.get(1L, new Object[0]),
+ GregtechItemList.Old_Circuit_Parts_Advanced.get(2L, new Object[0]),
+ tMat.getMolten(144L * tMultiplier / 2L),
+ GregtechItemList.Old_Circuit_Advanced.get(1L, new Object[0]),
+ 32,
+ 64);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Board_Advanced.get(1L, new Object[0]),
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1L, new Object[0]),
+ tMat.getMolten(144L * tMultiplier / 2L),
+ GregtechItemList.Old_Circuit_Data.get(1L, new Object[0]),
+ 32,
+ 64);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]),
+ GregtechItemList.Old_Circuit_Data.get(3L, new Object[0]),
+ tMat.getMolten(144L * tMultiplier / 1L),
+ GregtechItemList.Old_Circuit_Elite.get(1L, new Object[0]),
+ 32,
+ 256);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]),
+ ItemList.Circuit_Parts_Crystal_Chip_Master.get(3L, new Object[0]),
+ tMat.getMolten(144L * tMultiplier / 1L),
+ GregtechItemList.Old_Circuit_Master.get(1L, new Object[0]),
+ 32,
+ 256);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]),
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(3L, new Object[0]),
+ tMat.getMolten(144L * tMultiplier / 1L),
+ GregtechItemList.Old_Circuit_Master.get(1L, new Object[0]),
+ 32,
+ 256);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Data.get(1L, new Object[0]),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 2L),
+ tMat.getMolten(144L * tMultiplier / 2L),
+ GregtechItemList.Old_Tool_DataStick.get(1L, new Object[0]),
+ 128,
+ 64);
+ }
+ }
+
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Elite.get(2L, new Object[0]),
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(18L, new Object[0]),
+ GT_Values.NF,
+ GregtechItemList.Old_Tool_DataOrb.get(1L, new Object[0]),
+ 512,
+ 256);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Master.get(2L, new Object[0]),
+ ItemList.Circuit_Parts_Crystal_Chip_Master.get(18L, new Object[0]),
+ GT_Values.NF,
+ ItemList.Energy_LapotronicOrb.get(1L, new Object[0]),
+ 512,
+ 1024);
+ GT_Values.RA.addAssemblerRecipe(
+ GregtechItemList.Old_Circuit_Master.get(2L, new Object[0]),
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(18L, new Object[0]),
+ GT_Values.NF,
+ ItemList.Energy_LapotronicOrb.get(1L, new Object[0]),
+ 512,
+ 1024);
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 1L),
+ GregtechItemList.Old_Empty_Board_Basic.get(1L, new Object[0]),
+ 32,
+ 16);
+
+ Materials plasticType = Materials.get("Polytetrafluoroethylene") != null
+ ? Materials.get("Polytetrafluoroethylene")
+ : Materials.Plastic;
+ GT_Values.RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 2L),
+ GT_OreDictUnificator.get(OrePrefixes.plate, plasticType, 1L),
+ GregtechItemList.Old_Empty_Board_Elite.get(1L, new Object[0]),
+ 32,
+ 256);
+
+ return true;
+ }
+
+ public static boolean handleCircuits() {
+ hideCircuitsNEI();
+ addCircuitRecipes();
+ removeNewCircuits();
+ generateTradeRecipes();
+ return true;
+ }
+
+ private static boolean setItemList(ItemList Set, GregtechItemList Get) {
+ try {
+ Set.set(Get.get(1));
+ return true;
+ } catch (Throwable t) {
+ }
+ return false;
+ }
+
+ private static boolean removeNewCircuits() {
+ Logger.INFO(
+ "[Old Feature - Circuits] Overriding .28+ circuit values in the GT5u Itemlist with values from GT++.");
+
+ boolean newVersion = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() >= 30;
+
+ setItemList(ItemList.Circuit_Primitive, GregtechItemList.Old_Circuit_Primitive);
+ setItemList(ItemList.Circuit_Basic, GregtechItemList.Old_Circuit_Basic);
+ setItemList(ItemList.Circuit_Good, GregtechItemList.Old_Circuit_Good);
+ setItemList(ItemList.Circuit_Advanced, GregtechItemList.Old_Circuit_Advanced);
+ // ItemList.Circuit_Data, GregtechItemList.Old_Circuit_Data);
+ setItemList(ItemList.Circuit_Elite, GregtechItemList.Old_Circuit_Elite);
+ setItemList(ItemList.Circuit_Master, GregtechItemList.Old_Circuit_Master);
+ setItemList(ItemList.Circuit_Ultimate, GregtechItemList.Old_Circuit_Ultimate);
+
+ /**
+ * Try Set New circuits to have old replacements
+ */
+
+ // Basic
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Microprocessor"), GregtechItemList.Old_Circuit_Basic); // NEW
+ }
+ // Good
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Integrated_Good"), GregtechItemList.Old_Circuit_Good); // New
+ }
+ // Advanced
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Nanoprocessor"), GregtechItemList.Old_Circuit_Advanced);
+ }
+ // Data
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Quantumprocessor"), GregtechItemList.Old_Circuit_Data);
+ }
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Nanocomputer"), GregtechItemList.Old_Circuit_Data);
+ }
+ // Elite
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Crystalprocessor"), GregtechItemList.Old_Circuit_Elite);
+ }
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Quantumcomputer"), GregtechItemList.Old_Circuit_Elite);
+ }
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Elitenanocomputer"), GregtechItemList.Old_Circuit_Elite);
+ }
+ // Master
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Neuroprocessor"), GregtechItemList.Old_Circuit_Master);
+ }
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Masterquantumcomputer"), GregtechItemList.Old_Circuit_Master);
+ }
+ // Ultimate
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Wetwarecomputer"), GregtechItemList.Old_Circuit_Ultimate);
+ }
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Ultimatecrystalcomputer"), GregtechItemList.Old_Circuit_Ultimate);
+ }
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Quantummainframe"), GregtechItemList.Old_Circuit_Ultimate);
+ }
+ // Superconductor
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Wetwaresupercomputer"), GregtechItemList.Circuit_IV);
+ }
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Crystalmainframe"), GregtechItemList.Circuit_IV);
+ }
+ // Infinite
+ if (newVersion) {
+ setItemList(ItemList.valueOf("Circuit_Wetwaremainframe"), GregtechItemList.Circuit_LuV);
+ }
+
+ // set data orbs and sticks to their new replacements
+ setItemList(ItemList.Tool_DataStick, GregtechItemList.Old_Tool_DataStick);
+ setItemList(ItemList.Tool_DataOrb, GregtechItemList.Old_Tool_DataOrb);
+
+ setItemList(ItemList.Circuit_Board_Basic, GregtechItemList.Old_Circuit_Board_Basic);
+ setItemList(ItemList.Circuit_Board_Advanced, GregtechItemList.Old_Circuit_Board_Advanced);
+ setItemList(ItemList.Circuit_Board_Elite, GregtechItemList.Old_Circuit_Board_Elite);
+ setItemList(ItemList.Circuit_Parts_Advanced, GregtechItemList.Old_Circuit_Parts_Advanced);
+ setItemList(ItemList.Circuit_Parts_Wiring_Basic, GregtechItemList.Old_Circuit_Parts_Wiring_Basic);
+ setItemList(ItemList.Circuit_Parts_Wiring_Advanced, GregtechItemList.Old_Circuit_Parts_Wiring_Advanced);
+ setItemList(ItemList.Circuit_Parts_Wiring_Elite, GregtechItemList.Old_Circuit_Parts_Wiring_Elite);
+ setItemList(ItemList.Circuit_Parts_Crystal_Chip_Elite, GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite);
+ setItemList(ItemList.Circuit_Parts_Crystal_Chip_Master, GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master);
+
+ return true;
+ }
+
+ private static boolean generateTradeRecipes() {
+
+ // Data stick and Data orbs.
+ // GT Type to GT++ Type
+ RecipeUtils.recipeBuilder(
+ CI.craftingToolScrewdriver,
+ null,
+ null,
+ ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32708", 32708, 1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ GregtechItemList.Old_Tool_DataStick.get(1));
+ RecipeUtils.recipeBuilder(
+ CI.craftingToolScrewdriver,
+ null,
+ null,
+ ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32707", 32707, 1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ GregtechItemList.Old_Tool_DataOrb.get(1));
+
+ // GT++ Type to GT Type
+ RecipeUtils.recipeBuilder(
+ CI.craftingToolScrewdriver,
+ null,
+ null,
+ GregtechItemList.Old_Tool_DataStick.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32708", 32708, 1));
+ RecipeUtils.recipeBuilder(
+ CI.craftingToolScrewdriver,
+ null,
+ null,
+ GregtechItemList.Old_Tool_DataOrb.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32707", 32707, 1));
+
+ // Primitive
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32700", 32700, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitPrimitive", 1));
+
+ // Basic
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32701", 32701, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitBasic", 1));
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.03:32078", 32078, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitBasic", 1));
+
+ // Good
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32702", 32702, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitGood", 1));
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32702", 32702, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitGood", 1));
+
+ // Advanced
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32703", 32703, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitAdvanced", 1));
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32703", 32703, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitAdvanced", 1));
+
+ // Data
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32704", 32704, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitData", 1));
+
+ // Elite
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32705", 32705, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitElite", 1));
+
+ // Master
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32706", 32706, 1)},
+ ItemUtils.getItemStackOfAmountFromOreDict("circuitMaster", 1));
+
+ // Components
+ // Green Chip
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32713", 32713, 1)},
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1));
+ // Blue Chip
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32714", 32714, 1)},
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(1));
+
+ // Basic Board
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32710", 32710, 1)},
+ GregtechItemList.Old_Circuit_Board_Basic.get(1));
+ // Advanced Board
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32711", 32711, 1)},
+ GregtechItemList.Old_Circuit_Board_Advanced.get(1));
+ // Elite Board
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32712", 32712, 1)},
+ GregtechItemList.Old_Circuit_Board_Elite.get(1));
+
+ // remove a few recipes
+ /*GT_ModHandler.removeRecipeByOutput(ItemUtils.simpleMetaStack("gregtech:gt.metaitem.03:32070", 32070, 1));
+ GT_ModHandler.removeRecipeByOutput(ItemUtils.simpleMetaStack("gregtech:gt.metaitem.03:32069", 32069, 1));
+ if (LoadedMods.Extra_Utils){
+ ItemStack EQU = ItemUtils.simpleMetaStack("ExtraUtilities:enderQuarryUpgrade", 0, 1);
+ if (EQU != null){
+ GT_ModHandler.removeRecipeByOutput(EQU);
+ GT_Values.RA.addAssemblerRecipe(
+ ItemUtils.simpleMetaStack("ExtraUtilities:decorativeBlock1:12", 12, 1),
+ GregtechItemList.Old_Circuit_Master.get(1),
+ EQU,
+ 80*20,
+ 2);
+ }
+ }
+ if (LoadedMods.GalacticraftCore){
+ ItemStack ACW = ItemUtils.simpleMetaStack("GalacticraftCore:item.basicItem:14", 14, 1);
+ if (ACW != null){
+ GT_ModHandler.removeRecipeByOutput(ACW);
+ GT_Values.RA.addAssemblerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("gemDiamond", 1),
+ GregtechItemList.Old_Circuit_Board_Advanced.get(1),
+ ACW,
+ 160*20,
+ 4);
+ }
+ ItemStack ACW2 = ItemUtils.simpleMetaStack("GalacticraftCore:item.basicItem:13", 13, 1);
+ if (ACW2 != null){
+ GT_ModHandler.removeRecipeByOutput(ACW2);
+ GT_Values.RA.addAssemblerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("gemDiamond", 1),
+ GregtechItemList.Old_Circuit_Board_Basic.get(1),
+ ACW2,
+ 80*20,
+ 2);
+ }
+ }*/
+
+ return true;
+ }
+
+ private static boolean hideCircuitsNEI() {
+ Boolean isNEILoaded = Loader.isModLoaded("NotEnoughItems");
+ if (isNEILoaded && !CORE.ConfigSwitches.showHiddenNEIItems) {
+ Logger.INFO("[Old Feature - Circuits] Hiding .28+ circuits in NEI.");
+ String[] CircuitToHide = {
+ "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_Integrated_Good",
+ "Circuit_Good",
+ "Circuit_Advanced",
+ "Circuit_Data",
+ "Circuit_Elite",
+ "Circuit_Master",
+ "Circuit_Ultimate",
+ "Circuit_Board_Coated",
+ "Circuit_Board_Phenolic",
+ "Circuit_Board_Epoxy",
+ "Circuit_Board_Fiberglass",
+ "Circuit_Board_Multifiberglass",
+ "Circuit_Board_Wetware",
+ "Circuit_Parts_Resistor",
+ "Circuit_Parts_ResistorSMD",
+ "Circuit_Parts_Glass_Tube",
+ "Circuit_Parts_Vacuum_Tube",
+ "Circuit_Parts_Coil",
+ "Circuit_Parts_Diode",
+ "Circuit_Parts_DiodeSMD",
+ "Circuit_Parts_Transistor",
+ "Circuit_Parts_TransistorSMD",
+ "Circuit_Parts_Capacitor",
+ "Circuit_Parts_CapacitorSMD",
+ "Circuit_Silicon_Ingot",
+ "Circuit_Silicon_Ingot2",
+ "Circuit_Silicon_Ingot3",
+ "Circuit_Silicon_Wafer",
+ "Circuit_Silicon_Wafer2",
+ "Circuit_Silicon_Wafer3",
+ "Circuit_Wafer_ILC",
+ "Circuit_Chip_ILC",
+ "Circuit_Wafer_Ram",
+ "Circuit_Chip_Ram",
+ "Circuit_Wafer_NAND",
+ "Circuit_Chip_NAND",
+ "Circuit_Wafer_NOR",
+ "Circuit_Chip_NOR",
+ "Circuit_Wafer_CPU",
+ "Circuit_Chip_CPU",
+ "Circuit_Wafer_SoC",
+ "Circuit_Chip_SoC",
+ "Circuit_Wafer_SoC2",
+ "Circuit_Chip_SoC2",
+ "Circuit_Wafer_PIC",
+ "Circuit_Chip_PIC",
+ "Circuit_Wafer_HPIC",
+ "Circuit_Chip_HPIC",
+ "Circuit_Wafer_NanoCPU",
+ "Circuit_Chip_NanoCPU",
+ "Circuit_Wafer_QuantumCPU",
+ "Circuit_Chip_QuantumCPU",
+ "Circuit_Chip_CrystalCPU",
+ "Circuit_Chip_CrystalSoC",
+ "Circuit_Chip_NeuroCPU",
+ "Circuit_Chip_Stemcell",
+ "Circuit_Processor",
+ "Circuit_Computer",
+ "Circuit_Nanoprocessor",
+ "Circuit_Nanocomputer",
+ "Circuit_Elitenanocomputer",
+ "Circuit_Quantumprocessor",
+ "Circuit_Quantumcomputer",
+ "Circuit_Masterquantumcomputer",
+ "Circuit_Quantummainframe",
+ "Circuit_Crystalprocessor",
+ "Circuit_Crystalcomputer",
+ "Circuit_Ultimatecrystalcomputer",
+ "Circuit_Crystalmainframe",
+ "Circuit_Neuroprocessor",
+ "Circuit_Wetwarecomputer",
+ "Circuit_Wetwaresupercomputer",
+ "Circuit_Wetwaremainframe",
+ "Circuit_Parts_RawCrystalChip",
+ // Circuits Additions in .30/.31
+ "Circuit_Board_Plastic",
+ "Circuit_Parts_GlassFiber",
+ "Circuit_Parts_PetriDish",
+ "Circuit_Microprocessor"
+ };
+
+ for (String component : CircuitToHide) {
+ try {
+ ItemUtils.hideItemFromNEI(
+ ItemUtils.getValueOfItemList(component, null).get(1L, new Object[0]));
+ } catch (IllegalArgumentException I) {
+ Logger.INFO("Could not find " + component + " in the Gregtech item list.");
+ Logger.INFO("This is NOT an error, simply a notification.");
+ }
+ }
+ }
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java
index 860a87deae..b55bb260dd 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java
@@ -15,7 +15,6 @@ import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.material.ORES;
@@ -29,225 +28,211 @@ import net.minecraftforge.fluids.FluidStack;
public class RECIPES_RareEarthProcessing {
- private static ItemStack mDustSodiumHydroxide;
- private static ItemStack mDustSalt;
- private static FluidStack mSaltWater;
- private static FluidStack mBrine;
- private static FluidStack mHydrogenChloride;
-
- public static void init() {
-
- // Salt Check and Assignment
- mDustSalt = ItemUtils.getItemStackOfAmountFromOreDict("dustSalt", 1);
- if (mDustSalt == null) {
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_CHLORIDE, false);
- mDustSalt = SODIUM_CHLORIDE.getDust(1);
- }
- else {
- SODIUM_CHLORIDE.registerComponentForMaterial(OrePrefixes.dust, mDustSalt);
- }
-
- // Salt water Check and Assignment
- mSaltWater = FluidUtils.getFluidStack("saltwater", 1000);
- if (mSaltWater == null) {
- Fluid f = SALT_WATER.generateFluid();
- SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000));
- mSaltWater = SALT_WATER.getFluidStack(1000);
- }
- else {
- SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(mSaltWater, 1000));
- }
-
- // Brine Check and assignment
- mBrine = FluidUtils.getFluidStack("brine", 1000);
- if (mBrine == null) {
- Fluid f = BRINE.generateFluid();
- BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000));
- mBrine = BRINE.getFluidStack(1000);
- }
- else {
- BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(mBrine, 1000));
- }
-
- // Check Sodium Hydroxide Exists, generate if not.
- mDustSodiumHydroxide = ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1);
- if (mDustSodiumHydroxide == null) {
- mDustSodiumHydroxide = ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide_GT5U", 1);
- if (mDustSodiumHydroxide == null) {
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_HYDROXIDE, false);
- mDustSodiumHydroxide = SODIUM_HYDROXIDE.getDust(1);
- }
- else {
- SODIUM_HYDROXIDE.registerComponentForMaterial(OrePrefixes.dust, mDustSodiumHydroxide);
- }
- }
- else {
- SODIUM_HYDROXIDE.registerComponentForMaterial(OrePrefixes.dust, mDustSodiumHydroxide);
- }
-
- // Hydrogen Chloride Check and assignment
- mHydrogenChloride = FluidUtils.getFluidStack("hydrogenchloride", 1000);
- if (mHydrogenChloride == null) {
- HYDROGEN_CHLORIDE.generateFluid();
- mHydrogenChloride = BRINE.getFluidStack(1000);
- }
- else {
- HYDROGEN_CHLORIDE.registerComponentForMaterial(FluidUtils.getFluidStack(mHydrogenChloride, 1000));
- }
-
-
- // Add Process for creating Brine
- CORE.RA.addBrewingRecipe(
- ItemUtils.getSimpleStack(mDustSalt, 16),
- MISC_MATERIALS.SALT_WATER.getFluidStack(2000),
- FluidUtils.getFluidStack(mBrine, 4000),
- 20 * 20,
- 120,
- false);
-
- // Chloralkali process
- GT_Values.RA.addElectrolyzerRecipe(
- CI.getNumberedCircuit(16),
- CI.emptyCells(4),
- FluidUtils.getFluidStack(mBrine, 4000),
- null, // Out
- ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2),
- ItemUtils.getSimpleStack(mDustSodiumHydroxide, 2),
- null,
- null,
- null,
- new int[] {10000, 10000, 10000},
- 20 * 30,
- 120);
-
- // Generate Special Laser Recipe
- CORE.RA.addMixerRecipe(
- CI.getNumberedBioCircuit(2),
- ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1),
- null,
- null,
- null,
- ItemUtils.getSimpleStack(ModItems.cellHydrogenChlorideMix, 2),
- null,
- null,
- null,
- 20 * 10,
- 480);
-
- CORE.RA.addUvLaserRecipe(
- ItemUtils.getSimpleStack(ModItems.cellHydrogenChlorideMix, 4),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 4),
- 20 * 30,
- 480);
-
-
- // Set Material Tiers correctly
- ORES.GREENOCKITE.vTier = 1;
- RARE_EARTH_LOW.vTier = 1;
- RARE_EARTH_MID.vTier = 3;
- RARE_EARTH_HIGH.vTier = 5;
-
- // Set Material Voltages correctly
- ORES.GREENOCKITE.vVoltageMultiplier = 30;
- RARE_EARTH_LOW.vVoltageMultiplier = 30;
- RARE_EARTH_MID.vVoltageMultiplier = 480;
- RARE_EARTH_HIGH.vVoltageMultiplier = 7680;
-
- // Set Material Tooltips to be shorter
- RARE_EARTH_LOW.vChemicalFormula = "??????";
- RARE_EARTH_MID.vChemicalFormula = "??????";
- RARE_EARTH_HIGH.vChemicalFormula = "??????";
-
- // Set Material Tooltips to be shorter
- RARE_EARTH_LOW.vChemicalSymbol = "??";
- RARE_EARTH_MID.vChemicalSymbol = "??";
- RARE_EARTH_HIGH.vChemicalSymbol = "??";
-
- // Generate Ore Materials
- MaterialGenerator.generateOreMaterial(RARE_EARTH_LOW);
- MaterialGenerator.generateOreMaterial(RARE_EARTH_MID);
- MaterialGenerator.generateOreMaterial(RARE_EARTH_HIGH);
-
- ItemStack aRareEarth = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.RareEarth, 1L);
-
- Fluid aSulfuric = FluidUtils.getFluidStack("sulfuricacid", 1).getFluid();
- Fluid aHydrocholric = FluidUtils.getFluidStack("hydrogenchloride", 1).getFluid();
- Fluid aNitric = FluidUtils.getFluidStack("hydrofluoricacid", 1).getFluid();
-
-
-
- // LV Rare Earth
- GT_Values.RA.addChemicalBathRecipe(
- ItemUtils.getSimpleStack(aRareEarth, 3),
- FluidUtils.getFluidStack(aSulfuric, 1000),
- RARE_EARTH_LOW.getCrushed(2),
- RARE_EARTH_LOW.getCrushed(2),
- RARE_EARTH_LOW.getCrushed(2),
- new int[] {10000, 10000, 10000},
- 20 * 30,
- MaterialUtils.getVoltageForTier(1));
-
- // HV Rare Earth
- GT_Values.RA.addChemicalBathRecipe(
- ItemUtils.getSimpleStack(aRareEarth, 6),
- FluidUtils.getFluidStack(aHydrocholric, 2000),
- RARE_EARTH_MID.getCrushed(4),
- RARE_EARTH_MID.getCrushed(4),
- RARE_EARTH_MID.getCrushed(4),
- new int[] {10000, 9000, 8000},
- 20 * 30,
- MaterialUtils.getVoltageForTier(3));
-
- // IV Rare Earth
- GT_Values.RA.addChemicalBathRecipe(
- ItemUtils.getSimpleStack(aRareEarth, 9),
- FluidUtils.getHydrofluoricAcid(3000),
- RARE_EARTH_HIGH.getCrushed(6),
- RARE_EARTH_HIGH.getCrushed(6),
- RARE_EARTH_HIGH.getCrushed(6),
- new int[] {10000, 9000, 8000},
- 20 * 30,
- MaterialUtils.getVoltageForTier(5));
-
- if (FluidUtils.doesHydrofluoricAcidGtExist()) {
- // IV Rare Earth
- GT_Values.RA.addChemicalBathRecipe(
- ItemUtils.getSimpleStack(aRareEarth, 9),
- FluidUtils.getHydrofluoricAcidGT(6000),
- RARE_EARTH_HIGH.getCrushed(6),
- RARE_EARTH_HIGH.getCrushed(6),
- RARE_EARTH_HIGH.getCrushed(6),
- new int[] {9000, 8000, 7000},
- 20 * 30,
- MaterialUtils.getVoltageForTier(5));
- }
-
-
- }
-
-
- public static void processCopperRecipes() {
-
- // Rare Earth Processing
- /*GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1),
- new ItemStack[] {
- ELEMENT.getInstance().YTTRIUM.getSmallDust(1),
- ELEMENT.getInstance().NEODYMIUM.getSmallDust(1),
- ELEMENT.getInstance().LANTHANUM.getSmallDust(1),
- ELEMENT.getInstance().CERIUM.getSmallDust(1),
- ELEMENT.getInstance().CADMIUM.getSmallDust(1),
- ELEMENT.getInstance().CAESIUM.getSmallDust(1),
- ORES.SAMARSKITE_YB.getSmallDust(1),
- ORES.FLORENCITE.getSmallDust(1),
- ORES.FLUORCAPHITE.getSmallDust(1),
- //ELEMENT.getInstance().YTTERBIUM.getTinyDust(1),
- //ELEMENT.getInstance().SAMARIUM.getTinyDust(1),
- //ELEMENT.getInstance().GADOLINIUM.getTinyDust(1)
- },
- new int[] { 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 }, 20 * 30, 500);*/
-
- }
-
+ private static ItemStack mDustSodiumHydroxide;
+ private static ItemStack mDustSalt;
+ private static FluidStack mSaltWater;
+ private static FluidStack mBrine;
+ private static FluidStack mHydrogenChloride;
+
+ public static void init() {
+
+ // Salt Check and Assignment
+ mDustSalt = ItemUtils.getItemStackOfAmountFromOreDict("dustSalt", 1);
+ if (mDustSalt == null) {
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_CHLORIDE, false);
+ mDustSalt = SODIUM_CHLORIDE.getDust(1);
+ } else {
+ SODIUM_CHLORIDE.registerComponentForMaterial(OrePrefixes.dust, mDustSalt);
+ }
+
+ // Salt water Check and Assignment
+ mSaltWater = FluidUtils.getFluidStack("saltwater", 1000);
+ if (mSaltWater == null) {
+ Fluid f = SALT_WATER.generateFluid();
+ SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000));
+ mSaltWater = SALT_WATER.getFluidStack(1000);
+ } else {
+ SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(mSaltWater, 1000));
+ }
+
+ // Brine Check and assignment
+ mBrine = FluidUtils.getFluidStack("brine", 1000);
+ if (mBrine == null) {
+ Fluid f = BRINE.generateFluid();
+ BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000));
+ mBrine = BRINE.getFluidStack(1000);
+ } else {
+ BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(mBrine, 1000));
+ }
+
+ // Check Sodium Hydroxide Exists, generate if not.
+ mDustSodiumHydroxide = ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1);
+ if (mDustSodiumHydroxide == null) {
+ mDustSodiumHydroxide = ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide_GT5U", 1);
+ if (mDustSodiumHydroxide == null) {
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_HYDROXIDE, false);
+ mDustSodiumHydroxide = SODIUM_HYDROXIDE.getDust(1);
+ } else {
+ SODIUM_HYDROXIDE.registerComponentForMaterial(OrePrefixes.dust, mDustSodiumHydroxide);
+ }
+ } else {
+ SODIUM_HYDROXIDE.registerComponentForMaterial(OrePrefixes.dust, mDustSodiumHydroxide);
+ }
+
+ // Hydrogen Chloride Check and assignment
+ mHydrogenChloride = FluidUtils.getFluidStack("hydrogenchloride", 1000);
+ if (mHydrogenChloride == null) {
+ HYDROGEN_CHLORIDE.generateFluid();
+ mHydrogenChloride = BRINE.getFluidStack(1000);
+ } else {
+ HYDROGEN_CHLORIDE.registerComponentForMaterial(FluidUtils.getFluidStack(mHydrogenChloride, 1000));
+ }
+
+ // Add Process for creating Brine
+ CORE.RA.addBrewingRecipe(
+ ItemUtils.getSimpleStack(mDustSalt, 16),
+ MISC_MATERIALS.SALT_WATER.getFluidStack(2000),
+ FluidUtils.getFluidStack(mBrine, 4000),
+ 20 * 20,
+ 120,
+ false);
+
+ // Chloralkali process
+ GT_Values.RA.addElectrolyzerRecipe(
+ CI.getNumberedCircuit(16),
+ CI.emptyCells(4),
+ FluidUtils.getFluidStack(mBrine, 4000),
+ null, // Out
+ ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2),
+ ItemUtils.getSimpleStack(mDustSodiumHydroxide, 2),
+ null,
+ null,
+ null,
+ new int[] {10000, 10000, 10000},
+ 20 * 30,
+ 120);
+
+ // Generate Special Laser Recipe
+ CORE.RA.addMixerRecipe(
+ CI.getNumberedBioCircuit(2),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1),
+ null,
+ null,
+ null,
+ ItemUtils.getSimpleStack(ModItems.cellHydrogenChlorideMix, 2),
+ null,
+ null,
+ null,
+ 20 * 10,
+ 480);
+
+ CORE.RA.addUvLaserRecipe(
+ ItemUtils.getSimpleStack(ModItems.cellHydrogenChlorideMix, 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 4),
+ 20 * 30,
+ 480);
+
+ // Set Material Tiers correctly
+ ORES.GREENOCKITE.vTier = 1;
+ RARE_EARTH_LOW.vTier = 1;
+ RARE_EARTH_MID.vTier = 3;
+ RARE_EARTH_HIGH.vTier = 5;
+
+ // Set Material Voltages correctly
+ ORES.GREENOCKITE.vVoltageMultiplier = 30;
+ RARE_EARTH_LOW.vVoltageMultiplier = 30;
+ RARE_EARTH_MID.vVoltageMultiplier = 480;
+ RARE_EARTH_HIGH.vVoltageMultiplier = 7680;
+
+ // Set Material Tooltips to be shorter
+ RARE_EARTH_LOW.vChemicalFormula = "??????";
+ RARE_EARTH_MID.vChemicalFormula = "??????";
+ RARE_EARTH_HIGH.vChemicalFormula = "??????";
+
+ // Set Material Tooltips to be shorter
+ RARE_EARTH_LOW.vChemicalSymbol = "??";
+ RARE_EARTH_MID.vChemicalSymbol = "??";
+ RARE_EARTH_HIGH.vChemicalSymbol = "??";
+
+ // Generate Ore Materials
+ MaterialGenerator.generateOreMaterial(RARE_EARTH_LOW);
+ MaterialGenerator.generateOreMaterial(RARE_EARTH_MID);
+ MaterialGenerator.generateOreMaterial(RARE_EARTH_HIGH);
+
+ ItemStack aRareEarth = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.RareEarth, 1L);
+
+ Fluid aSulfuric = FluidUtils.getFluidStack("sulfuricacid", 1).getFluid();
+ Fluid aHydrocholric = FluidUtils.getFluidStack("hydrogenchloride", 1).getFluid();
+ Fluid aNitric = FluidUtils.getFluidStack("hydrofluoricacid", 1).getFluid();
+
+ // LV Rare Earth
+ GT_Values.RA.addChemicalBathRecipe(
+ ItemUtils.getSimpleStack(aRareEarth, 3),
+ FluidUtils.getFluidStack(aSulfuric, 1000),
+ RARE_EARTH_LOW.getCrushed(2),
+ RARE_EARTH_LOW.getCrushed(2),
+ RARE_EARTH_LOW.getCrushed(2),
+ new int[] {10000, 10000, 10000},
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(1));
+
+ // HV Rare Earth
+ GT_Values.RA.addChemicalBathRecipe(
+ ItemUtils.getSimpleStack(aRareEarth, 6),
+ FluidUtils.getFluidStack(aHydrocholric, 2000),
+ RARE_EARTH_MID.getCrushed(4),
+ RARE_EARTH_MID.getCrushed(4),
+ RARE_EARTH_MID.getCrushed(4),
+ new int[] {10000, 9000, 8000},
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(3));
+
+ // IV Rare Earth
+ GT_Values.RA.addChemicalBathRecipe(
+ ItemUtils.getSimpleStack(aRareEarth, 9),
+ FluidUtils.getHydrofluoricAcid(3000),
+ RARE_EARTH_HIGH.getCrushed(6),
+ RARE_EARTH_HIGH.getCrushed(6),
+ RARE_EARTH_HIGH.getCrushed(6),
+ new int[] {10000, 9000, 8000},
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(5));
+
+ if (FluidUtils.doesHydrofluoricAcidGtExist()) {
+ // IV Rare Earth
+ GT_Values.RA.addChemicalBathRecipe(
+ ItemUtils.getSimpleStack(aRareEarth, 9),
+ FluidUtils.getHydrofluoricAcidGT(6000),
+ RARE_EARTH_HIGH.getCrushed(6),
+ RARE_EARTH_HIGH.getCrushed(6),
+ RARE_EARTH_HIGH.getCrushed(6),
+ new int[] {9000, 8000, 7000},
+ 20 * 30,
+ MaterialUtils.getVoltageForTier(5));
+ }
+ }
+
+ public static void processCopperRecipes() {
+
+ // Rare Earth Processing
+ /*GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1),
+ new ItemStack[] {
+ ELEMENT.getInstance().YTTRIUM.getSmallDust(1),
+ ELEMENT.getInstance().NEODYMIUM.getSmallDust(1),
+ ELEMENT.getInstance().LANTHANUM.getSmallDust(1),
+ ELEMENT.getInstance().CERIUM.getSmallDust(1),
+ ELEMENT.getInstance().CADMIUM.getSmallDust(1),
+ ELEMENT.getInstance().CAESIUM.getSmallDust(1),
+ ORES.SAMARSKITE_YB.getSmallDust(1),
+ ORES.FLORENCITE.getSmallDust(1),
+ ORES.FLUORCAPHITE.getSmallDust(1),
+ //ELEMENT.getInstance().YTTERBIUM.getTinyDust(1),
+ //ELEMENT.getInstance().SAMARIUM.getTinyDust(1),
+ //ELEMENT.getInstance().GADOLINIUM.getTinyDust(1)
+ },
+ new int[] { 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 }, 20 * 30, 500);*/
+
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java
index 9a2ea8bad0..674ba9e7bb 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java
@@ -14,42 +14,55 @@ import net.minecraft.item.ItemStack;
public class RECIPES_SeleniumProcessing {
- public static void init() {
-
- //We need this
- MaterialUtils.generateSpecialDustAndAssignToAMaterial(MISC_MATERIALS.SELENIUM_DIOXIDE, false);
-
- // Makes Selenium Dioxide
- processCopperRecipes();
-
- //Liquify the Dried Dioxide
- AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), 13, FluidUtils.getSteam(500), null, MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(1000), 20, 1024);
-
- // Produce Selenious Acid
- AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getCell(1), 14, FluidUtils.getHotWater(4000), CI.emptyCells(1), MISC_MATERIALS.SELENIOUS_ACID.getFluidStack(1000), 20, 2048);
-
- // Make Selenium
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(14),
- ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 8),
- ELEMENT.getInstance().CARBON.getDust(16),
- },
- MISC_MATERIALS.SELENIOUS_ACID.getFluidStack(750),
- ELEMENT.getInstance().SELENIUM.getFluidStack(144 * 1),
- new ItemStack[] {
- CI.emptyCells(8),
- ELEMENT.getInstance().SELENIUM.getIngot(1),
- ELEMENT.getInstance().SELENIUM.getIngot(1),
- },
- new int[] {10000, 2000, 2000},
- 20 * 300,
- 7200);
-
+ public static void init() {
+
+ // We need this
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(MISC_MATERIALS.SELENIUM_DIOXIDE, false);
+
+ // Makes Selenium Dioxide
+ processCopperRecipes();
+
+ // Liquify the Dried Dioxide
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ 13,
+ FluidUtils.getSteam(500),
+ null,
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(1000),
+ 20,
+ 1024);
+
+ // Produce Selenious Acid
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getCell(1),
+ 14,
+ FluidUtils.getHotWater(4000),
+ CI.emptyCells(1),
+ MISC_MATERIALS.SELENIOUS_ACID.getFluidStack(1000),
+ 20,
+ 2048);
+
+ // Make Selenium
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(14),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 8),
+ ELEMENT.getInstance().CARBON.getDust(16),
+ },
+ MISC_MATERIALS.SELENIOUS_ACID.getFluidStack(750),
+ ELEMENT.getInstance().SELENIUM.getFluidStack(144 * 1),
+ new ItemStack[] {
+ CI.emptyCells(8),
+ ELEMENT.getInstance().SELENIUM.getIngot(1),
+ ELEMENT.getInstance().SELENIUM.getIngot(1),
+ },
+ new int[] {10000, 2000, 2000},
+ 20 * 300,
+ 7200);
- /*// Old recipes for Selenium Roasting
+ /*// Old recipes for Selenium Roasting
CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
+ new ItemStack[] {
ItemUtils.getGregtechCircuit(16),
ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPyrite", 8),
ELEMENT.getInstance().CARBON.getDust(32),
@@ -58,9 +71,9 @@ public class RECIPES_SeleniumProcessing {
ELEMENT.getInstance().SELENIUM.getFluid(144),
0,
20 * 300,
- 2000);
+ 2000);
CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
+ new ItemStack[] {
ItemUtils.getGregtechCircuit(17),
ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedChalcopyrite", 8),
ELEMENT.getInstance().CARBON.getDust(32),
@@ -71,7 +84,7 @@ public class RECIPES_SeleniumProcessing {
20 * 300,
2000);
CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
+ new ItemStack[] {
ItemUtils.getGregtechCircuit(18),
ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedGalena", 8),
ELEMENT.getInstance().CARBON.getDust(32),
@@ -80,143 +93,101 @@ public class RECIPES_SeleniumProcessing {
ELEMENT.getInstance().SELENIUM.getFluid(144),
0,
20 * 300,
- 2000);*/
- }
-
-
- public static void processCopperRecipes() {
-
- //Copper
- CORE.RA.addDehydratorRecipe(
- new ItemStack[]{
- CI.getNumberedAdvancedCircuit(23),
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Copper, 1), // Item Input
- },
- FluidUtils.getHotWater(1000), // Fluid
- MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(20), // Fluid
- new ItemStack[] {
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Copper, 1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- }, // Output
- new int[] {
- 10000,
- 100,
- 100,
- 500,
- 500,
- 500,
- 1000,
- 1000,
- 1000
- },
- 40 * 20, // Time in ticks
- 1024); // EU
-
- //Tetra
- CORE.RA.addDehydratorRecipe(
- new ItemStack[]{
- CI.getNumberedAdvancedCircuit(23),
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Tetrahedrite, 1), // Item Input
- },
- FluidUtils.getHotWater(1000), // Fluid
- MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid
- new ItemStack[] {
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Tetrahedrite, 1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- }, // Output
- new int[] {
- 10000,
- 100,
- 100,
- 300,
- 300,
- 300,
- 800,
- 800,
- 800
- },
- 40 * 20, // Time in ticks
- 1024); // EU
+ 2000);*/
+ }
- //Chalco
- CORE.RA.addDehydratorRecipe(
- new ItemStack[]{
- CI.getNumberedAdvancedCircuit(23),
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Chalcopyrite, 1), // Item Input
- },
- FluidUtils.getHotWater(1000), // Fluid
- MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid
- new ItemStack[] {
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Chalcopyrite, 1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- }, // Output
- new int[] {
- 10000,
- 100,
- 100,
- 300,
- 300,
- 300,
- 800,
- 800,
- 800
- },
- 40 * 20, // Time in ticks
- 1024); // EU
-
- //Malachite
- CORE.RA.addDehydratorRecipe(
- new ItemStack[]{
- CI.getNumberedAdvancedCircuit(23),
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Malachite, 1), // Item Input
- },
- FluidUtils.getHotWater(1000), // Fluid
- MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid
- new ItemStack[] {
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Malachite, 1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
- }, // Output
- new int[] {
- 10000,
- 100,
- 100,
- 300,
- 300,
- 300,
- 800,
- 800,
- 800
- },
- 40 * 20, // Time in ticks
- 1024); // EU
- }
+ public static void processCopperRecipes() {
+ // Copper
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(23),
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Copper, 1), // Item Input
+ },
+ FluidUtils.getHotWater(1000), // Fluid
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(20), // Fluid
+ new ItemStack[] {
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Copper, 1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ }, // Output
+ new int[] {10000, 100, 100, 500, 500, 500, 1000, 1000, 1000},
+ 40 * 20, // Time in ticks
+ 1024); // EU
+
+ // Tetra
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(23),
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Tetrahedrite, 1), // Item Input
+ },
+ FluidUtils.getHotWater(1000), // Fluid
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid
+ new ItemStack[] {
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Tetrahedrite, 1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ }, // Output
+ new int[] {10000, 100, 100, 300, 300, 300, 800, 800, 800},
+ 40 * 20, // Time in ticks
+ 1024); // EU
+
+ // Chalco
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(23),
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Chalcopyrite, 1), // Item Input
+ },
+ FluidUtils.getHotWater(1000), // Fluid
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid
+ new ItemStack[] {
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Chalcopyrite, 1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ }, // Output
+ new int[] {10000, 100, 100, 300, 300, 300, 800, 800, 800},
+ 40 * 20, // Time in ticks
+ 1024); // EU
+
+ // Malachite
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(23),
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Malachite, 1), // Item Input
+ },
+ FluidUtils.getHotWater(1000), // Fluid
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid
+ new ItemStack[] {
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Malachite, 1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ }, // Output
+ new int[] {10000, 100, 100, 300, 300, 300, 800, 800, 800},
+ 40 * 20, // Time in ticks
+ 1024); // EU
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java
index 7ffdcf295b..b561de2e43 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java
@@ -1,35 +1,31 @@
package gtPlusPlus.core.recipe;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.LoadedMods;
+import net.minecraft.item.ItemStack;
public class RECIPES_Shapeless {
- static ItemStack dustStaballoy;
-
- //Circuits
- static String circuitPrimitive = "circuitPrimitive";
- static String circuitBasic = "circuitBasic";
- static String circuitGood = "circuitGood";
- static String circuitAdvanced = "circuitAdvanced";
- static String circuitData = "circuitData";
- static String circuitElite = "circuitElite";
- static String circuitMaster = "circuitMaster";
- static String circuitUltimate = "circuitUltimate";
- static ItemStack gearboxCasing_Tier_1;
-
- public static final void loadRecipes(){
- //run();
- Logger.INFO("Loading Shapeless Recipes.");
- }
-
- private static void run(){
- //Gregtech items
- if (LoadedMods.Gregtech){
-
- }
- }
-
+ static ItemStack dustStaballoy;
+
+ // Circuits
+ static String circuitPrimitive = "circuitPrimitive";
+ static String circuitBasic = "circuitBasic";
+ static String circuitGood = "circuitGood";
+ static String circuitAdvanced = "circuitAdvanced";
+ static String circuitData = "circuitData";
+ static String circuitElite = "circuitElite";
+ static String circuitMaster = "circuitMaster";
+ static String circuitUltimate = "circuitUltimate";
+ static ItemStack gearboxCasing_Tier_1;
+
+ public static final void loadRecipes() {
+ // run();
+ Logger.INFO("Loading Shapeless Recipes.");
+ }
+
+ private static void run() {
+ // Gregtech items
+ if (LoadedMods.Gregtech) {}
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java
index 42448e6b74..38832b07fe 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java
@@ -1,181 +1,201 @@
package gtPlusPlus.core.recipe;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.RecipeUtils;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.RecipeUtils;
import net.minecraftforge.oredict.OreDictionary;
public class RECIPES_Tools {
- //Outputs
- public static ItemStack RECIPE_StaballoyPickaxe = new ItemStack(ModItems.itemStaballoyPickaxe);
- public static ItemStack RECIPE_StaballoyAxe = new ItemStack(ModItems.itemStaballoyAxe);
- public static ItemStack RECIPE_SandstoneHammer = new ItemStack(ModItems.itemSandstoneHammer);
- //public static ItemStack RECIPE_StaballoyIngot = new ItemStack(ModItems.itemIngotStaballoy);
- public static ItemStack RECIPE_SandStone = new ItemStack(Blocks.sandstone, 2);
- public static ItemStack RECIPE_Sand = new ItemStack(Blocks.sand, 4);
- public static ItemStack RECIPE_FireStarter = ItemUtils.getSimpleStack(ModItems.itemBasicFireMaker);
-
- public static ItemStack RECIPE_DivisionSigil;
-
- //MC Items
- public static Item Apple = Items.apple;
-
- //MC Blocks
- public static Block CobbleStone = Blocks.cobblestone;
- public static Block Dirt = Blocks.dirt;
- public static Block Sand = Blocks.sand;
- public static Block Gravel = Blocks.gravel;
- public static Block Sandstone = Blocks.sandstone;
-
- //null
- public static String empty = " ";
-
- //Batteries
- public static String batteryBasic = "batteryBasic";
- public static String batteryAdvanced = "batteryAdvanced";
- public static String batteryElite = "batteryElite";
- public static String batteryMaster = "batteryMaster";
- public static String batteryUltimate = "batteryUltimate";
-
- //Circuits
- public static String circuitPrimitive = "circuitPrimitive";
- public static String circuitBasic = "circuitBasic";
- public static String circuitGood = "circuitGood";
- public static String circuitAdvanced = "circuitAdvanced";
- public static String circuitElite = "circuitElite";
- public static String circuitMaster = "circuitMaster";
- public static String circuitUltimate = "circuitUltimate";
-
- //Cables
- public static String cableGt01Electrum = "cableGt01Electrum";
- public static String cableGt02Electrum = "cableGt02Electrum";
- public static String cableGt01RedstoneAlloy = "cableGt01RedstoneAlloy";
- public static String cableGt02RedstoneAlloy = "cableGt02RedstoneAlloy";
- public static String cableGt01Copper = "cableGt01Copper";
- public static String cableGt02Copper = "cableGt02Copper";
- public static String cableGt01AnnealedCopper = "cableGt01AnnealedCopper";
- public static String cableGt02AnnealedCopper = "cableGt02AnnealedCopper";
-
- //Rods
- public static String stickWood = "stickWood";
- public static String stickStaballoy= "stickStaballoy";
- public static String stickTitanium= "stickTitanium";
- public static String stickIron= "stickIron";
- public static String stickGold= "stickGold";
- public static String stickSilver= "stickSilver";
- public static String stickSteel= "stickSteel";
- public static String stickBronze= "stickBronze";
- public static String stickTungsten= "stickTungsten";
- public static String stickRedAlloy= "stickRedAlloy";
- public static String stickInvar= "stickInvar";
- public static String stickElectrum= "stickElectrum";
- public static String stickElectricalSteel= "stickElectricalSteel";
-
- //Plates
- public static String plateStaballoy= "plateStaballoy";
- public static String plateTitanium= "plateTitanium";
- public static String plateIron= "plateIron";
- public static String plateGold= "plateGold";
- public static String plateSilver= "plateSilver";
- public static String plateSteel= "plateSteel";
- public static String plateBronze= "plateBronze";
- public static String plateTungsten= "plateTungsten";
- public static String plateRedAlloy= "plateRedAlloy";
- public static String plateInvar= "plateInvar";
- public static String plateElectrum= "plateElectrum";
- public static String plateElectricalSteel= "plateElectricalSteel";
-
- //Ingots
- public static String ingotStaballoy= "ingotStaballoy";
- public static String ingotTitanium= "ingotTitanium";
- public static String ingotIron= "ingotIron";
- public static String ingotGold= "ingotGold";
- public static String ingotSilver= "ingotSilver";
- public static String ingotSteel= "ingotSteel";
- public static String ingotBronze= "ingotBronze";
- public static String ingotTungsten= "ingotTungsten";
- public static String ingotRedAlloy= "ingotRedAlloy";
- public static String ingotInvar= "ingotInvar";
- public static String ingotElectrum= "ingotElectrum";
- public static String ingotUranium= "ingotUranium";
- public static String ingotElectricalSteel= "ingotElectricalSteel";
-
- //Crafting Tools
- public static String craftingToolHardHammer = "craftingToolHardHammer";
- public static String craftingToolSoftHammer = "craftingToolSoftHammer";
- public static String craftingToolFile = "craftingToolFile";
- public static String craftingToolSaw = "craftingToolSaw";
- public static String craftingToolPickaxe = "craftingToolPickaxe";
- public static String craftingToolWrench = "craftingToolWrench";
- public static String craftingToolCrowbar = "craftingToolCrowbar";
- public static String craftingToolKnife = "craftingToolKnife";
- public static String craftingToolScrewdriver = "craftingToolScrewdriver";
-
- public static ItemStack sandHammer = new ItemStack (ModItems.itemSandstoneHammer, 1, OreDictionary.WILDCARD_VALUE);
- public static String craftingToolSandHammer = "craftingToolSandHammer";
-
- public static ItemStack personalCloakingDevice = ItemUtils.getSimpleStack(ModItems.itemPersonalCloakingDevice);
- public static String plateDoubleNiChrome = "plateDoubleNichrome";
- public static String plateIridiumAlloy = "plateAlloyIridium";
-
- public static final void loadRecipes(){
-
-
- run();
-
- }
-
- private static void run(){
- //Staballoy Pickaxe
- RecipeUtils.addShapedRecipe(
- plateStaballoy, plateStaballoy, ingotStaballoy,
- craftingToolFile, stickTungsten, craftingToolHardHammer,
- craftingToolWrench, stickTungsten, craftingToolHardHammer,
- RECIPE_StaballoyPickaxe);
-
- //Staballoy Axe
- RecipeUtils.addShapedRecipe(
- plateStaballoy, ingotStaballoy, craftingToolHardHammer,
- plateStaballoy, stickTungsten, craftingToolHardHammer,
- craftingToolFile, stickTungsten, craftingToolWrench,
- RECIPE_StaballoyAxe);
-
- //Cobble to Sand
- RecipeUtils.addShapedRecipe(
- CobbleStone, CobbleStone, CobbleStone,
- CobbleStone, sandHammer, CobbleStone,
- CobbleStone, CobbleStone, CobbleStone,
- RECIPE_Sand);
-
- //Sand to Sandstone
- RecipeUtils.addShapedRecipe(
- Sand, Sand, Sand,
- Sand, sandHammer, Sand,
- Sand, Sand, Sand,
- RECIPE_SandStone);
-
- //Sandstone Hammer
- RecipeUtils.addShapedRecipe(
- plateElectrum, ingotElectrum, plateElectrum,
- craftingToolScrewdriver, stickBronze, craftingToolHardHammer,
- null, stickSteel, null,
- RECIPE_SandstoneHammer);
-
- //Basic Firemaker
- RecipeUtils.addShapedRecipe(
- "cropWheat", "cropWheat", "cropWheat",
- ItemUtils.getSimpleStack(Items.string), stickWood, ItemUtils.getSimpleStack(Items.string),
- "cropWheat", "cropWheat", "cropWheat",
- RECIPE_FireStarter);
-
- }
-
+ // Outputs
+ public static ItemStack RECIPE_StaballoyPickaxe = new ItemStack(ModItems.itemStaballoyPickaxe);
+ public static ItemStack RECIPE_StaballoyAxe = new ItemStack(ModItems.itemStaballoyAxe);
+ public static ItemStack RECIPE_SandstoneHammer = new ItemStack(ModItems.itemSandstoneHammer);
+ // public static ItemStack RECIPE_StaballoyIngot = new ItemStack(ModItems.itemIngotStaballoy);
+ public static ItemStack RECIPE_SandStone = new ItemStack(Blocks.sandstone, 2);
+ public static ItemStack RECIPE_Sand = new ItemStack(Blocks.sand, 4);
+ public static ItemStack RECIPE_FireStarter = ItemUtils.getSimpleStack(ModItems.itemBasicFireMaker);
+
+ public static ItemStack RECIPE_DivisionSigil;
+
+ // MC Items
+ public static Item Apple = Items.apple;
+
+ // MC Blocks
+ public static Block CobbleStone = Blocks.cobblestone;
+ public static Block Dirt = Blocks.dirt;
+ public static Block Sand = Blocks.sand;
+ public static Block Gravel = Blocks.gravel;
+ public static Block Sandstone = Blocks.sandstone;
+
+ // null
+ public static String empty = " ";
+
+ // Batteries
+ public static String batteryBasic = "batteryBasic";
+ public static String batteryAdvanced = "batteryAdvanced";
+ public static String batteryElite = "batteryElite";
+ public static String batteryMaster = "batteryMaster";
+ public static String batteryUltimate = "batteryUltimate";
+
+ // Circuits
+ public static String circuitPrimitive = "circuitPrimitive";
+ public static String circuitBasic = "circuitBasic";
+ public static String circuitGood = "circuitGood";
+ public static String circuitAdvanced = "circuitAdvanced";
+ public static String circuitElite = "circuitElite";
+ public static String circuitMaster = "circuitMaster";
+ public static String circuitUltimate = "circuitUltimate";
+
+ // Cables
+ public static String cableGt01Electrum = "cableGt01Electrum";
+ public static String cableGt02Electrum = "cableGt02Electrum";
+ public static String cableGt01RedstoneAlloy = "cableGt01RedstoneAlloy";
+ public static String cableGt02RedstoneAlloy = "cableGt02RedstoneAlloy";
+ public static String cableGt01Copper = "cableGt01Copper";
+ public static String cableGt02Copper = "cableGt02Copper";
+ public static String cableGt01AnnealedCopper = "cableGt01AnnealedCopper";
+ public static String cableGt02AnnealedCopper = "cableGt02AnnealedCopper";
+
+ // Rods
+ public static String stickWood = "stickWood";
+ public static String stickStaballoy = "stickStaballoy";
+ public static String stickTitanium = "stickTitanium";
+ public static String stickIron = "stickIron";
+ public static String stickGold = "stickGold";
+ public static String stickSilver = "stickSilver";
+ public static String stickSteel = "stickSteel";
+ public static String stickBronze = "stickBronze";
+ public static String stickTungsten = "stickTungsten";
+ public static String stickRedAlloy = "stickRedAlloy";
+ public static String stickInvar = "stickInvar";
+ public static String stickElectrum = "stickElectrum";
+ public static String stickElectricalSteel = "stickElectricalSteel";
+
+ // Plates
+ public static String plateStaballoy = "plateStaballoy";
+ public static String plateTitanium = "plateTitanium";
+ public static String plateIron = "plateIron";
+ public static String plateGold = "plateGold";
+ public static String plateSilver = "plateSilver";
+ public static String plateSteel = "plateSteel";
+ public static String plateBronze = "plateBronze";
+ public static String plateTungsten = "plateTungsten";
+ public static String plateRedAlloy = "plateRedAlloy";
+ public static String plateInvar = "plateInvar";
+ public static String plateElectrum = "plateElectrum";
+ public static String plateElectricalSteel = "plateElectricalSteel";
+
+ // Ingots
+ public static String ingotStaballoy = "ingotStaballoy";
+ public static String ingotTitanium = "ingotTitanium";
+ public static String ingotIron = "ingotIron";
+ public static String ingotGold = "ingotGold";
+ public static String ingotSilver = "ingotSilver";
+ public static String ingotSteel = "ingotSteel";
+ public static String ingotBronze = "ingotBronze";
+ public static String ingotTungsten = "ingotTungsten";
+ public static String ingotRedAlloy = "ingotRedAlloy";
+ public static String ingotInvar = "ingotInvar";
+ public static String ingotElectrum = "ingotElectrum";
+ public static String ingotUranium = "ingotUranium";
+ public static String ingotElectricalSteel = "ingotElectricalSteel";
+
+ // Crafting Tools
+ public static String craftingToolHardHammer = "craftingToolHardHammer";
+ public static String craftingToolSoftHammer = "craftingToolSoftHammer";
+ public static String craftingToolFile = "craftingToolFile";
+ public static String craftingToolSaw = "craftingToolSaw";
+ public static String craftingToolPickaxe = "craftingToolPickaxe";
+ public static String craftingToolWrench = "craftingToolWrench";
+ public static String craftingToolCrowbar = "craftingToolCrowbar";
+ public static String craftingToolKnife = "craftingToolKnife";
+ public static String craftingToolScrewdriver = "craftingToolScrewdriver";
+
+ public static ItemStack sandHammer = new ItemStack(ModItems.itemSandstoneHammer, 1, OreDictionary.WILDCARD_VALUE);
+ public static String craftingToolSandHammer = "craftingToolSandHammer";
+
+ public static ItemStack personalCloakingDevice = ItemUtils.getSimpleStack(ModItems.itemPersonalCloakingDevice);
+ public static String plateDoubleNiChrome = "plateDoubleNichrome";
+ public static String plateIridiumAlloy = "plateAlloyIridium";
+
+ public static final void loadRecipes() {
+
+ run();
+ }
+
+ private static void run() {
+ // Staballoy Pickaxe
+ RecipeUtils.addShapedRecipe(
+ plateStaballoy,
+ plateStaballoy,
+ ingotStaballoy,
+ craftingToolFile,
+ stickTungsten,
+ craftingToolHardHammer,
+ craftingToolWrench,
+ stickTungsten,
+ craftingToolHardHammer,
+ RECIPE_StaballoyPickaxe);
+
+ // Staballoy Axe
+ RecipeUtils.addShapedRecipe(
+ plateStaballoy,
+ ingotStaballoy,
+ craftingToolHardHammer,
+ plateStaballoy,
+ stickTungsten,
+ craftingToolHardHammer,
+ craftingToolFile,
+ stickTungsten,
+ craftingToolWrench,
+ RECIPE_StaballoyAxe);
+
+ // Cobble to Sand
+ RecipeUtils.addShapedRecipe(
+ CobbleStone,
+ CobbleStone,
+ CobbleStone,
+ CobbleStone,
+ sandHammer,
+ CobbleStone,
+ CobbleStone,
+ CobbleStone,
+ CobbleStone,
+ RECIPE_Sand);
+
+ // Sand to Sandstone
+ RecipeUtils.addShapedRecipe(Sand, Sand, Sand, Sand, sandHammer, Sand, Sand, Sand, Sand, RECIPE_SandStone);
+
+ // Sandstone Hammer
+ RecipeUtils.addShapedRecipe(
+ plateElectrum,
+ ingotElectrum,
+ plateElectrum,
+ craftingToolScrewdriver,
+ stickBronze,
+ craftingToolHardHammer,
+ null,
+ stickSteel,
+ null,
+ RECIPE_SandstoneHammer);
+
+ // Basic Firemaker
+ RecipeUtils.addShapedRecipe(
+ "cropWheat",
+ "cropWheat",
+ "cropWheat",
+ ItemUtils.getSimpleStack(Items.string),
+ stickWood,
+ ItemUtils.getSimpleStack(Items.string),
+ "cropWheat",
+ "cropWheat",
+ "cropWheat",
+ RECIPE_FireStarter);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPE_Batteries.java b/src/main/java/gtPlusPlus/core/recipe/RECIPE_Batteries.java
index 5476ef0e8d..62cd9f3800 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPE_Batteries.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPE_Batteries.java
@@ -1,52 +1,65 @@
package gtPlusPlus.core.recipe;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.ItemList;
-
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.item.ItemStack;
public class RECIPE_Batteries {
- static ItemStack RECIPE_Battery_Sodium = GregtechItemList.Battery_RE_EV_Sodium.get(1);
- static ItemStack RECIPE_Battery_Cadmium = GregtechItemList.Battery_RE_EV_Cadmium.get(1);
- static ItemStack RECIPE_Battery_Lithium = GregtechItemList.Battery_RE_EV_Lithium.get(1);
- static ItemStack GT_Battery_Sodium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32539, 1);
- static ItemStack GT_Battery_Cadmium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32537, 1);
- static ItemStack GT_Battery_Lithium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32538, 1);
- static ItemStack machineTransformer_EV;
-
- public static void loadRecipes(){
-
- if (LoadedMods.Gregtech){
- machineTransformer_EV = ItemList.Transformer_EV_HV.get(1);
- run();
- }
- }
-
- private static void run(){
+ static ItemStack RECIPE_Battery_Sodium = GregtechItemList.Battery_RE_EV_Sodium.get(1);
+ static ItemStack RECIPE_Battery_Cadmium = GregtechItemList.Battery_RE_EV_Cadmium.get(1);
+ static ItemStack RECIPE_Battery_Lithium = GregtechItemList.Battery_RE_EV_Lithium.get(1);
+ static ItemStack GT_Battery_Sodium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32539, 1);
+ static ItemStack GT_Battery_Cadmium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32537, 1);
+ static ItemStack GT_Battery_Lithium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32538, 1);
+ static ItemStack machineTransformer_EV;
+ public static void loadRecipes() {
- RecipeUtils.addShapedGregtechRecipe(
- GT_Battery_Sodium, RECIPES_Machines.cableTier4, GT_Battery_Sodium,
- CI.circuitTier3, machineTransformer_EV, CI.circuitTier3,
- GT_Battery_Sodium, RECIPES_Machines.cableTier4, GT_Battery_Sodium,
- RECIPE_Battery_Sodium);
- RecipeUtils.addShapedGregtechRecipe(
- GT_Battery_Cadmium, RECIPES_Machines.cableTier4, GT_Battery_Cadmium,
- CI.circuitTier3, machineTransformer_EV, CI.circuitTier3,
- GT_Battery_Cadmium, RECIPES_Machines.cableTier4, GT_Battery_Cadmium,
- RECIPE_Battery_Cadmium);
- RecipeUtils.addShapedGregtechRecipe(
- GT_Battery_Lithium, RECIPES_Machines.cableTier4, GT_Battery_Lithium,
- CI.circuitTier3, machineTransformer_EV, CI.circuitTier3,
- GT_Battery_Lithium, RECIPES_Machines.cableTier4, GT_Battery_Lithium,
- RECIPE_Battery_Lithium);
+ if (LoadedMods.Gregtech) {
+ machineTransformer_EV = ItemList.Transformer_EV_HV.get(1);
+ run();
+ }
+ }
- }
+ private static void run() {
+ RecipeUtils.addShapedGregtechRecipe(
+ GT_Battery_Sodium,
+ RECIPES_Machines.cableTier4,
+ GT_Battery_Sodium,
+ CI.circuitTier3,
+ machineTransformer_EV,
+ CI.circuitTier3,
+ GT_Battery_Sodium,
+ RECIPES_Machines.cableTier4,
+ GT_Battery_Sodium,
+ RECIPE_Battery_Sodium);
+ RecipeUtils.addShapedGregtechRecipe(
+ GT_Battery_Cadmium,
+ RECIPES_Machines.cableTier4,
+ GT_Battery_Cadmium,
+ CI.circuitTier3,
+ machineTransformer_EV,
+ CI.circuitTier3,
+ GT_Battery_Cadmium,
+ RECIPES_Machines.cableTier4,
+ GT_Battery_Cadmium,
+ RECIPE_Battery_Cadmium);
+ RecipeUtils.addShapedGregtechRecipe(
+ GT_Battery_Lithium,
+ RECIPES_Machines.cableTier4,
+ GT_Battery_Lithium,
+ CI.circuitTier3,
+ machineTransformer_EV,
+ CI.circuitTier3,
+ GT_Battery_Lithium,
+ RECIPES_Machines.cableTier4,
+ GT_Battery_Lithium,
+ RECIPE_Battery_Lithium);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/ShapedRecipeObject.java b/src/main/java/gtPlusPlus/core/recipe/ShapedRecipeObject.java
index 0d25d2bec9..67cf787b13 100644
--- a/src/main/java/gtPlusPlus/core/recipe/ShapedRecipeObject.java
+++ b/src/main/java/gtPlusPlus/core/recipe/ShapedRecipeObject.java
@@ -1,43 +1,57 @@
package gtPlusPlus.core.recipe;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import net.minecraft.item.ItemStack;
public class ShapedRecipeObject {
- public Object object_A;
- public Object object_B;
- public Object object_C;
- public Object object_D;
- public Object object_E;
- public Object object_F;
- public Object object_G;
- public Object object_H;
- public Object object_I;
- public ItemStack object_OUTPUT;
-
- public ShapedRecipeObject(
- final Object input_A,final Object input_B,final Object input_C,
- final Object input_D,final Object input_E,final Object input_F,
- final Object input_G,final Object input_H,final Object input_I,
- final ItemStack input_Output){
- this.object_A = input_A;
- this.object_B = input_B;
- this.object_C = input_C;
- this.object_D = input_D;
- this.object_E = input_E;
- this.object_F = input_F;
- this.object_G = input_G;
- this.object_H = input_H;
- this.object_I = input_I;
- this.object_OUTPUT = input_Output;
- Logger.SPECIFIC_WARNING("ShapedRecipeObject", "New object created.", 36);
- }
+ public Object object_A;
+ public Object object_B;
+ public Object object_C;
+ public Object object_D;
+ public Object object_E;
+ public Object object_F;
+ public Object object_G;
+ public Object object_H;
+ public Object object_I;
+ public ItemStack object_OUTPUT;
- public void buildRecipe(){
- RecipeUtils.recipeBuilder(this.object_A, this.object_B, this.object_C, this.object_D, this.object_E, this.object_F, this.object_G, this.object_H, this.object_I, this.object_OUTPUT);
- }
+ public ShapedRecipeObject(
+ final Object input_A,
+ final Object input_B,
+ final Object input_C,
+ final Object input_D,
+ final Object input_E,
+ final Object input_F,
+ final Object input_G,
+ final Object input_H,
+ final Object input_I,
+ final ItemStack input_Output) {
+ this.object_A = input_A;
+ this.object_B = input_B;
+ this.object_C = input_C;
+ this.object_D = input_D;
+ this.object_E = input_E;
+ this.object_F = input_F;
+ this.object_G = input_G;
+ this.object_H = input_H;
+ this.object_I = input_I;
+ this.object_OUTPUT = input_Output;
+ Logger.SPECIFIC_WARNING("ShapedRecipeObject", "New object created.", 36);
+ }
+ public void buildRecipe() {
+ RecipeUtils.recipeBuilder(
+ this.object_A,
+ this.object_B,
+ this.object_C,
+ this.object_D,
+ this.object_E,
+ this.object_F,
+ this.object_G,
+ this.object_H,
+ this.object_I,
+ this.object_OUTPUT);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/common/CI.java b/src/main/java/gtPlusPlus/core/recipe/common/CI.java
index f656cfe9f0..f3689897e5 100644
--- a/src/main/java/gtPlusPlus/core/recipe/common/CI.java
+++ b/src/main/java/gtPlusPlus/core/recipe/common/CI.java
@@ -26,1384 +26,1213 @@ import net.minecraftforge.fluids.FluidStack;
public class CI {
- //null
- public static ItemStack _NULL = ItemUtils.getErrorStack(1);
-
- //bits
- public static long bits = GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE
- | GT_ModHandler.RecipeBits.BUFFERED;
- public static long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED;
-
- //Circuits
- public static Object circuitPrimitive;
- public static Object circuitTier1;
- public static Object circuitTier2;
- public static Object circuitTier3;
- public static Object circuitTier4;
- public static Object circuitTier5;
- public static Object circuitTier6;
- public static Object circuitTier7;
- public static Object circuitTier8;
- public static Object circuitTier9;
-
- //Machine Components
- public static ItemStack electricMotor_ULV;
- public static ItemStack electricMotor_LV;
- public static ItemStack electricMotor_MV;
- public static ItemStack electricMotor_HV;
- public static ItemStack electricMotor_EV;
- public static ItemStack electricMotor_IV;
- public static ItemStack electricMotor_LuV;
- public static ItemStack electricMotor_ZPM;
- public static ItemStack electricMotor_UV;
- public static ItemStack electricMotor_MAX;
- public static ItemStack electricPump_ULV;
- public static ItemStack electricPump_LV;
- public static ItemStack electricPump_MV;
- public static ItemStack electricPump_HV;
- public static ItemStack electricPump_EV;
- public static ItemStack electricPump_IV;
- public static ItemStack electricPump_LuV;
- public static ItemStack electricPump_ZPM;
- public static ItemStack electricPump_UV;
- public static ItemStack electricPump_MAX;
- public static ItemStack electricPiston_ULV;
- public static ItemStack electricPiston_LV;
- public static ItemStack electricPiston_MV;
- public static ItemStack electricPiston_HV;
- public static ItemStack electricPiston_EV;
- public static ItemStack electricPiston_IV;
- public static ItemStack electricPiston_LuV;
- public static ItemStack electricPiston_ZPM;
- public static ItemStack electricPiston_UV ;
- public static ItemStack electricPiston_MAX;
- public static ItemStack robotArm_ULV;
- public static ItemStack robotArm_LV;
- public static ItemStack robotArm_MV;
- public static ItemStack robotArm_HV;
- public static ItemStack robotArm_EV;
- public static ItemStack robotArm_IV;
- public static ItemStack robotArm_LuV;
- public static ItemStack robotArm_ZPM;
- public static ItemStack robotArm_UV;
- public static ItemStack robotArm_MAX;
- public static ItemStack conveyorModule_ULV;
- public static ItemStack conveyorModule_LV;
- public static ItemStack conveyorModule_MV;
- public static ItemStack conveyorModule_HV;
- public static ItemStack conveyorModule_EV;
- public static ItemStack conveyorModule_IV;
- public static ItemStack conveyorModule_LuV;
- public static ItemStack conveyorModule_ZPM;
- public static ItemStack conveyorModule_UV;
- public static ItemStack conveyorModule_MAX;
- public static ItemStack emitter_ULV;
- public static ItemStack emitter_LV;
- public static ItemStack emitter_MV;
- public static ItemStack emitter_HV;
- public static ItemStack emitter_EV;
- public static ItemStack emitter_IV;
- public static ItemStack emitter_LuV;
- public static ItemStack emitter_ZPM;
- public static ItemStack emitter_UV;
- public static ItemStack emitter_MAX;
- public static ItemStack fieldGenerator_ULV;
- public static ItemStack fieldGenerator_LV;
- public static ItemStack fieldGenerator_MV;
- public static ItemStack fieldGenerator_HV;
- public static ItemStack fieldGenerator_EV;
- public static ItemStack fieldGenerator_IV;
- public static ItemStack fieldGenerator_LuV;
- public static ItemStack fieldGenerator_ZPM;
- public static ItemStack fieldGenerator_UV;
- public static ItemStack fieldGenerator_MAX;
- public static ItemStack sensor_ULV;
- public static ItemStack sensor_LV;
- public static ItemStack sensor_MV;
- public static ItemStack sensor_HV;
- public static ItemStack sensor_EV;
- public static ItemStack sensor_IV;
- public static ItemStack sensor_LuV;
- public static ItemStack sensor_ZPM;
- public static ItemStack sensor_UV;
- public static ItemStack sensor_MAX;
-
- public static ItemStack fluidRegulator_LV;
- public static ItemStack fluidRegulator_MV;
- public static ItemStack fluidRegulator_HV;
- public static ItemStack fluidRegulator_EV;
- public static ItemStack fluidRegulator_IV;
- public static ItemStack fluidRegulator_LuV;
- public static ItemStack fluidRegulator_ZPM;
- public static ItemStack fluidRegulator_UV;
-
- //Machine Casings
- public static ItemStack machineCasing_ULV;
- public static ItemStack machineCasing_LV;
- public static ItemStack machineCasing_MV;
- public static ItemStack machineCasing_HV;
- public static ItemStack machineCasing_EV;
- public static ItemStack machineCasing_IV;
- public static ItemStack machineCasing_LuV;
- public static ItemStack machineCasing_ZPM;
- public static ItemStack machineCasing_UV;
- public static ItemStack machineCasing_MAX;
-
- //Machine Hulls
- public static ItemStack machineHull_ULV;
- public static ItemStack machineHull_LV;
- public static ItemStack machineHull_MV;
- public static ItemStack machineHull_HV;
- public static ItemStack machineHull_EV;
- public static ItemStack machineHull_IV;
- public static ItemStack machineHull_LuV;
- public static ItemStack machineHull_ZPM;
- public static ItemStack machineHull_UV;
- public static ItemStack machineHull_MAX;
-
- //Gearbox Casings
- public static ItemStack gearboxCasing_Tier_1;
- public static ItemStack gearboxCasing_Tier_2;
- public static ItemStack gearboxCasing_Tier_3;
- public static ItemStack gearboxCasing_Tier_4;
-
- public static String[] component_Plate;
- public static String[] component_Rod;
- public static String[] component_Ingot;
-
- //Crafting Tools
- public static String craftingToolWrench = "craftingToolWrench";
- public static String craftingToolHammer_Hard = "craftingToolHardHammer";
- public static String craftingToolHammer_Soft = "craftingToolSoftHammer";
- public static String craftingToolScrewdriver = "craftingToolScrewdriver";
- public static String craftingToolFile = "craftingToolFile";
- public static String craftingToolMortar = "craftingToolMortar";
- public static String craftingToolKnife = "craftingToolKnife";
- public static String craftingToolCrowbar = "craftingToolCrowbar";
- public static String craftingToolSaw = "craftingToolSaw";
- public static String craftingToolWireCutter = "craftingToolWirecutter";
- public static String craftingToolSolderingIron = "craftingToolSolderingIron";
-
- //Explosives
- public static ItemStack explosivePowderKeg;
- public static ItemStack explosiveTNT;
- public static ItemStack explosiveITNT;
-
- public static Materials[] tieredMaterials = new Materials[] {
- Materials.Iron, Materials.Steel, Materials.Aluminium,
- Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel,
- Materials.Chrome, Materials.Iridium, Materials.Osmium,
- Materials.Neutronium
- };;
-
- public static void preInit(){
-
- //Tiered Components
- component_Plate = new String[]{
- getTieredComponent(OrePrefixes.plate, 0),
- getTieredComponent(OrePrefixes.plate, 1),
- getTieredComponent(OrePrefixes.plate, 2),
- getTieredComponent(OrePrefixes.plate, 3),
- getTieredComponent(OrePrefixes.plate, 4),
- getTieredComponent(OrePrefixes.plate, 5),
- getTieredComponent(OrePrefixes.plate, 6),
- getTieredComponent(OrePrefixes.plate, 7),
- getTieredComponent(OrePrefixes.plate, 8),
- getTieredComponent(OrePrefixes.plate, 9),
- getTieredComponent(OrePrefixes.plate, 10),
- getTieredComponent(OrePrefixes.plate, 11)
- };
- component_Rod = new String[]{
- getTieredComponent(OrePrefixes.stick, 0),
- getTieredComponent(OrePrefixes.stick, 1),
- getTieredComponent(OrePrefixes.stick, 2),
- getTieredComponent(OrePrefixes.stick, 3),
- getTieredComponent(OrePrefixes.stick, 4),
- getTieredComponent(OrePrefixes.stick, 5),
- getTieredComponent(OrePrefixes.stick, 6),
- getTieredComponent(OrePrefixes.stick, 7),
- getTieredComponent(OrePrefixes.stick, 8),
- getTieredComponent(OrePrefixes.stick, 9),
- getTieredComponent(OrePrefixes.stick, 10),
- getTieredComponent(OrePrefixes.stick, 11)
- };
- component_Ingot = new String[]{
- getTieredComponent(OrePrefixes.ingot, 0),
- getTieredComponent(OrePrefixes.ingot, 1),
- getTieredComponent(OrePrefixes.ingot, 2),
- getTieredComponent(OrePrefixes.ingot, 3),
- getTieredComponent(OrePrefixes.ingot, 4),
- getTieredComponent(OrePrefixes.ingot, 5),
- getTieredComponent(OrePrefixes.ingot, 6),
- getTieredComponent(OrePrefixes.ingot, 7),
- getTieredComponent(OrePrefixes.ingot, 8),
- getTieredComponent(OrePrefixes.ingot, 9),
- getTieredComponent(OrePrefixes.ingot, 10),
- getTieredComponent(OrePrefixes.ingot, 11)
- };
-
- //Circuits
- circuitPrimitive = getTieredCircuit(0);
- circuitTier1 = getTieredCircuit(1);
- circuitTier2 = getTieredCircuit(2);
- circuitTier3 = getTieredCircuit(3);
- circuitTier4 = getTieredCircuit(4);
- circuitTier5 = getTieredCircuit(5);
- circuitTier6 = getTieredCircuit(6);
- circuitTier7 = getTieredCircuit(7);
- circuitTier8 = getTieredCircuit(8);
- circuitTier9 = getTieredCircuit(9);
-
- }
-
- public static Object getTieredCircuit(int tier){
- if (CORE.ConfigSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH){
- if (tier == 0){
- return GregtechItemList.Old_Circuit_Primitive.get(1);
- }
- else if (tier == 1){
- return GregtechItemList.Old_Circuit_Basic.get(1);
- }
- else if (tier == 2){
- return GregtechItemList.Old_Circuit_Good.get(1);
- }
- else if (tier == 3){
- return GregtechItemList.Old_Circuit_Advanced.get(1);
- }
- else if (tier == 4){
- return GregtechItemList.Old_Circuit_Data.get(1);
- }
- else if (tier == 5){
- return GregtechItemList.Old_Circuit_Elite.get(1);
- }
- else if (tier == 6){
- return GregtechItemList.Old_Circuit_Master.get(1);
- }
- else if (tier == 7){
- return GregtechItemList.Old_Circuit_Ultimate.get(1);
- }
- else if (tier == 8){
- return GregtechItemList.Circuit_IV.get(1);
- }
- else if (tier == 9){
- return GregtechItemList.Circuit_LuV.get(1);
- }
- else if (tier == 10){
- return GregtechItemList.Circuit_ZPM.get(1);
- }
- }
- else {
- return getTieredCircuitOreDictName(tier);
- }
- return _NULL;
- }
-
- public static ItemStack[] getAllCircuitsOfTier(int tier){
- return ItemUtils.getStackOfAllOreDictGroup(getTieredCircuitOreDictName(tier));
- }
-
- public static String getTieredCircuitOreDictName(int tier){
- if (tier == 0){
- return "circuitPrimitive";
- }
- else if (tier == 1){
- return "circuitBasic";
- }
- else if (tier == 2){
- return "circuitGood";
- }
- else if (tier == 3){
- return "circuitAdvanced";
- }
- else if (tier == 4){
- return "circuitData";
- }
- else if (tier == 5){
- return "circuitElite";
- }
- else if (tier == 6){
- return "circuitMaster";
- }
- else if (tier == 7){
- return "circuitUltimate";
- }
- else if (tier == 8){
- return "circuitSuperconductor";
- }
- else if (tier == 9){
- return "circuitInfinite";
- }
- else if (tier == 10){
- return "circuitQuantum";
- }
- else {
- return "circuitPrimitive";
- }
- }
-
- public static ItemStack getNumberedCircuit(int Meta){
- return ItemUtils.getGregtechCircuit(Meta);
- }
-
- private static Object getMaterialFromTier(int tier){
- if (tier == 0){
- return Materials.Wood;
- }
- else if (tier == 1){
- return Materials.Lead;
- }
- else if (tier == 2){
- return Materials.Bronze;
- }
- else if (tier == 3){
- return Materials.Steel;
- }
- else if (tier == 4){
- return ALLOY.EGLIN_STEEL;
- }
- else if (tier == 5){
- return Materials.Aluminium;
- }
- else if (tier == 6){
- return ALLOY.MARAGING250;
- }
- else if (tier == 7){
- return ALLOY.TANTALLOY_61;
- }
- else if (tier == 8){
- return ALLOY.INCONEL_792;
- }
- else if (tier == 9){
- return ALLOY.ZERON_100;
- }
- else if (tier == 10){
- return Materials.NaquadahEnriched;
- }
- else if (tier == 11){
- return Materials.Neutronium;
- }
- return Materials._NULL;
- }
-
- @Deprecated
- public static String getTieredComponent(OrePrefixes type, int tier){
- Object material = getMaterialFromTier(tier);
- if (material != null){
- if (material instanceof Materials){
- //return (ItemStack) type.get(material);
- String materialName = ((Materials) material).mDefaultLocalName;
- Logger.INFO("Searching for a component named "+type.name()+materialName);
- //return ItemUtils.getItemStackOfAmountFromOreDict(type.name()+materialName, 1);
- return (type.name()+materialName);
- }
- else {
- String materialName = (Utils.sanitizeString(((Material) material).getLocalizedName()));
- Logger.INFO("Searching for a component named "+type.name()+materialName);
- //return ItemUtils.getItemStackOfAmountFromOreDict(type.name()+materialName, 1);
- return (type.name()+materialName);
- }
- }
- Logger.INFO("[Components] Failed getting a tiered component. "+type.name()+" | "+tier);
- return null;
- }
-
- public static ItemStack getDataOrb(){
- if (CORE.ConfigSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH){
- return GregtechItemList.Old_Tool_DataOrb.get(1);
- }
- else {
- return ItemList.Tool_DataOrb.get(1);
- }
- }
-
- public static ItemStack getDataStick(){
- if (CORE.ConfigSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH){
- return GregtechItemList.Old_Tool_DataStick.get(1);
- }
- else {
- return ItemList.Tool_DataStick.get(1);
- }
- }
-
- public static final ItemStack getTieredMachineHull(int tier){
- if (tier == 0){
- return machineHull_ULV;
- }
- else if (tier == 1){
- return machineHull_LV;
- }
- else if (tier == 2){
- return machineHull_MV;
- }
- else if (tier == 3){
- return machineHull_HV;
- }
- else if (tier == 4){
- return machineHull_EV;
- }
- else if (tier == 5){
- return machineHull_IV;
- }
- else if (tier == 6){
- return machineHull_LuV;
- }
- else if (tier == 7){
- return machineHull_ZPM;
- }
- else if (tier == 8){
- return machineHull_UV;
- }
- else if (tier == 9){
- return machineHull_MAX;
- }
- else {
- return GregtechItemList.Casing_Multi_Use.get(1);
- }
- }
-
- public static final ItemStack getTieredMachineCasing(int tier){
- if (tier == 0){
- if (machineCasing_ULV == null) {
- machineCasing_ULV = ItemList.Casing_ULV.get(1);
- }
- return machineCasing_ULV;
- }
- else if (tier == 1){
- return machineCasing_LV;
- }
- else if (tier == 2){
- return machineCasing_MV;
- }
- else if (tier == 3){
- return machineCasing_HV;
- }
- else if (tier == 4){
- return machineCasing_EV;
- }
- else if (tier == 5){
- return machineCasing_IV;
- }
- else if (tier == 6){
- return machineCasing_LuV;
- }
- else if (tier == 7){
- return machineCasing_ZPM;
- }
- else if (tier == 8){
- return machineCasing_UV;
- }
- else if (tier == 9){
- return machineCasing_MAX;
- }
- else {
- return GregtechItemList.Casing_Multi_Use.get(1);
- }
- }
-
- public static void init() {
- //Set Explosives
- explosivePowderKeg = ItemUtils.getValueOfItemList("Block_Powderbarrel", 1, ItemUtils.getSimpleStack(Items.gunpowder, 16));
- explosiveTNT = ItemUtils.getSimpleStack(Blocks.tnt).copy();
- explosiveITNT = Ic2Items.industrialTnt.copy();
-
- //Machine Casings
- machineCasing_ULV = ItemList.Casing_ULV.get(1);
- machineCasing_LV = ItemList.Casing_LV.get(1);
- machineCasing_MV = ItemList.Casing_MV.get(1);
- machineCasing_HV = ItemList.Casing_HV.get(1);
- machineCasing_EV = ItemList.Casing_EV.get(1);
- machineCasing_IV = ItemList.Casing_IV.get(1);
- machineCasing_LuV = ItemList.Casing_LuV.get(1);
- machineCasing_ZPM = ItemList.Casing_ZPM.get(1);
- machineCasing_UV = ItemList.Casing_UV.get(1);
- machineCasing_MAX = ItemList.Casing_MAX.get(1);
-
- //Machine Hulls
- machineHull_ULV = ItemList.Hull_ULV.get(1);
- machineHull_LV = ItemList.Hull_LV.get(1);
- machineHull_MV = ItemList.Hull_MV.get(1);
- machineHull_HV = ItemList.Hull_HV.get(1);
- machineHull_EV = ItemList.Hull_EV.get(1);
- machineHull_IV = ItemList.Hull_IV.get(1);
- machineHull_LuV = ItemList.Hull_LuV.get(1);
- machineHull_ZPM = ItemList.Hull_ZPM.get(1);
- machineHull_UV = ItemList.Hull_UV.get(1);
- machineHull_MAX = ItemList.Hull_MAX.get(1);
-
- //Gear box Casings
- gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
- gearboxCasing_Tier_2 = ItemList.Casing_Gearbox_Steel.get(1);
- gearboxCasing_Tier_3 = ItemList.Casing_Gearbox_Titanium.get(1);
- gearboxCasing_Tier_4 = ItemList.Casing_Gearbox_TungstenSteel.get(1);
-
- //Machine Components
- LOADER_Machine_Components.initialise();
- }
-
- public static ItemStack emptyCells(int i) {
- return ItemUtils.getEmptyCell(i);
- }
-
- private static final Material[] aMaterial_Main = new Material[] {
- ALLOY.POTIN,
- ALLOY.TUMBAGA,
- ALLOY.EGLIN_STEEL,
- ALLOY.INCONEL_792,
- ALLOY.INCOLOY_MA956,
- ALLOY.NITINOL_60,
- ALLOY.ZERON_100,
- ALLOY.PIKYONIUM,
- ELEMENT.STANDALONE.ADVANCED_NITINOL,
- ALLOY.ABYSSAL,
- ALLOY.QUANTUM,
- ELEMENT.STANDALONE.HYPOGEN
- };
-
- private static final Material[] aMaterial_Secondary = new Material[] {
- ALLOY.STEEL,
- ALLOY.SILICON_CARBIDE,
- ALLOY.BABBIT_ALLOY,
- ALLOY.INCONEL_690,
- ALLOY.STELLITE,
- ALLOY.ARCANITE,
- ALLOY.LAFIUM,
- ALLOY.CINOBITE,
- ALLOY.TITANSTEEL,
- ALLOY.OCTIRON,
- ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN,
- ELEMENT.STANDALONE.HYPOGEN
- };
-
- private static final Material[] aMaterial_Tertiary = new Material[] {
- ELEMENT.getInstance().LEAD,
- ELEMENT.getInstance().ALUMINIUM,
- ELEMENT.STANDALONE.BLACK_METAL,
- ELEMENT.getInstance().TITANIUM,
- ALLOY.HASTELLOY_N,
- ALLOY.ENERGYCRYSTAL,
- ALLOY.TRINIUM_NAQUADAH_CARBON,
- ALLOY.TRINIUM_REINFORCED_STEEL, //Arceus
- ALLOY.TITANSTEEL,
- ELEMENT.STANDALONE.ASTRAL_TITANIUM,
- ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN,
- ELEMENT.STANDALONE.HYPOGEN
- };
-
- private static final Materials[] aMaterial_Cables = new Materials[] {
- !CORE.GTNH ? Materials.Lead : Materials.Tin,
- Materials.Cobalt,
- Materials.AnnealedCopper,
- Materials.Gold,
- Materials.Titanium,
- Materials.Nichrome,
- Materials.Platinum,
- Materials.YttriumBariumCuprate,
- Materials.Naquadah,
- Materials.Duranium,
- Materials.Superconductor,
- };
-
- private static final Materials[] aMaterial_Circuits = new Materials[] {
- Materials.Primitive,
- Materials.Basic,
- Materials.Good,
- Materials.Advanced,
- Materials.Data,
- Materials.Data,
- Materials.Elite,
- Materials.Master,
- Materials.Ultimate,
- Materials.Superconductor,
- Materials.Infinite,
- };
-
- private static final Material[][] aMaster = new Material[][] {aMaterial_Main, aMaterial_Secondary, aMaterial_Tertiary};
-
-
- public static FluidStack getTieredFluid(int aTier, int aAmount) {
- return getTieredFluid(aTier, aAmount, 0);
- }
-
- public static FluidStack getAlternativeTieredFluid(int aTier, int aAmount) {
- return getTieredFluid(aTier, aAmount, 1);
- }
-
- public static FluidStack getTertiaryTieredFluid(int aTier, int aAmount) {
- return getTieredFluid(aTier, aAmount, 2);
- }
-
- public static FluidStack getTieredFluid(int aTier, int aAmount, int aType) {
- // Weird Legacy handling
- /*ItemStack aCell = getTieredComponent(OrePrefixes.liquid, aTier, 1);
- FluidStack a = GT_Utility.getFluidForFilledItem(aCell, true);
- if (a == null) {
- a = aMaster[aType][aTier].getFluid(aAmount);
- }*/
-
- // Modern Handling
- FluidStack a = aMaster[aType][aTier].getFluidStack(aAmount);
- if (a == null) {
- ItemStack aCell = getTieredComponent(OrePrefixes.liquid, aTier, 1);
- if (aCell != null) {
- a = GT_Utility.getFluidForFilledItem(aCell, true);
- a.amount = aAmount;
- }
- }
- return a;
- }
-
- public static ItemStack getEnergyCore(int aTier, int aAmount) {
- ItemStack[] aOutput = new ItemStack[] {
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"1", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"2", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"3", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"4", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"5", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"6", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"7", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"8", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"9", 1),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+"10", 1)
- };
- return ItemUtils.getSimpleStack(aOutput[MathUtils.balance(aTier, 0, 9)], aAmount);
- }
-
- public static ItemStack getPlate(int aTier, int aAmount) {
- return getTieredComponent(OrePrefixes.plate, aTier, aAmount);
- }
-
- public static ItemStack getDoublePlate(int aTier, int aAmount) {
- return getTieredComponent(OrePrefixes.plateDouble, aTier, aAmount);
- }
-
- public static ItemStack getGear(int aTier, int aAmount) {
- return getTieredComponent(OrePrefixes.gearGt, aTier, aAmount);
- }
-
- public static ItemStack getIngot(int aTier, int aAmount) {
- return getTieredComponent(OrePrefixes.ingot, aTier, aAmount);
- }
-
- public static ItemStack getBolt(int aTier, int aAmount) {
- return getTieredComponent(OrePrefixes.bolt, aTier, aAmount);
- }
-
- public static ItemStack getScrew(int aTier, int aAmount) {
- return getTieredComponent(OrePrefixes.screw, aTier, aAmount);
- }
-
- public static ItemStack getCircuit(int aTier, int aAmount) {
- return getTieredComponent(OrePrefixes.circuit, aTier, aAmount);
- }
-
- public static ItemStack getTieredComponent(OrePrefixes aPrefix, int aTier, int aAmount) {
- aTier = Math.max(0, aTier);
-
- Material m = null;
-
- if (aPrefix == OrePrefixes.liquid) {
- int aMatID = (aTier == 0 || aTier == 2 || aTier == 5 || aTier == 8 ? 0 : (aTier == 1 || aTier == 3 || aTier == 6 || aTier == 9 ? 1 : 2));
- ItemStack aCell = aMaster[aMatID][aTier].getCell(aAmount);
- return aCell;
- }
-
- if (aPrefix == OrePrefixes.circuit) {
- /*if (aTier == 4) {
- return ItemUtils.getSimpleStack(CI.getDataStick(), aAmount);
- }
- else if (aTier == 5) {
- return ItemUtils.getSimpleStack(CI.getDataOrb(), aAmount);
- }*/
- return ItemUtils.getOrePrefixStack(OrePrefixes.circuit, aMaterial_Circuits[aTier], aAmount);
- }
-
- //Check for Cables first, catch SuperConductor case and swap to wire.
- if (aPrefix == OrePrefixes.cableGt01 || aPrefix == OrePrefixes.cableGt02 || aPrefix == OrePrefixes.cableGt04 || aPrefix == OrePrefixes.cableGt08 || aPrefix == OrePrefixes.cableGt12) {
- //Special Handler
- if (aTier == 10) {
- if (aPrefix == OrePrefixes.cableGt01) {
- aPrefix = OrePrefixes.wireGt02;
- }
- else if (aPrefix == OrePrefixes.cableGt02) {
- aPrefix = OrePrefixes.wireGt04;
- }
- else if (aPrefix == OrePrefixes.cableGt04) {
- aPrefix = OrePrefixes.wireGt08;
- }
- else if (aPrefix == OrePrefixes.cableGt08) {
- aPrefix = OrePrefixes.wireGt12;
- }
- else if (aPrefix == OrePrefixes.cableGt12) {
- aPrefix = OrePrefixes.wireGt16;
- }
- }
- else {
- return ItemUtils.getOrePrefixStack(aPrefix, aMaterial_Cables[aTier], aAmount);
- }
-
-
- }
- if (aPrefix == OrePrefixes.wireGt01 || aPrefix == OrePrefixes.wireGt02 || aPrefix == OrePrefixes.wireGt04 || aPrefix == OrePrefixes.wireGt08 || aPrefix == OrePrefixes.wireGt12 || aPrefix == OrePrefixes.wireGt16) {
- return ItemUtils.getOrePrefixStack(aPrefix, aMaterial_Cables[aTier], aAmount);
- }
-
- if (aPrefix == OrePrefixes.pipeTiny || aPrefix == OrePrefixes.pipeSmall || aPrefix == OrePrefixes.pipe || aPrefix == OrePrefixes.pipeMedium || aPrefix == OrePrefixes.pipeLarge || aPrefix == OrePrefixes.pipeHuge) {
-
- if (aPrefix == OrePrefixes.pipe) {
- aPrefix = OrePrefixes.pipeMedium;
- }
-
- if (aTier == 0) {
- return ItemUtils.getOrePrefixStack(aPrefix, Materials.Lead, aAmount);
- }
- else if (aTier == 1) {
- return ItemUtils.getOrePrefixStack(aPrefix, Materials.Steel, aAmount);
- }
- else if (aTier == 2) {
- return ItemUtils.getOrePrefixStack(aPrefix, Materials.StainlessSteel, aAmount);
- }
- else if (aTier == 3) {
- return ItemUtils.getOrePrefixStack(aPrefix, Materials.Tungsten, aAmount);
- }
- else if (aTier == 4) {
- return ItemUtils.getOrePrefixStack(aPrefix, Materials.TungstenSteel, aAmount);
- }
- else if (aTier == 5) {
- return ItemUtils.getOrePrefixStack(aPrefix, ALLOY.MARAGING350, aAmount);
- }
- else if (aTier == 6) {
- return ItemUtils.getOrePrefixStack(aPrefix, ALLOY.STABALLOY, aAmount);
- }
- else if (aTier == 7) {
- return ItemUtils.getOrePrefixStack(aPrefix, ALLOY.HASTELLOY_X, aAmount);
- }
- else if (aTier == 8) {
- return ItemUtils.getOrePrefixStack(aPrefix, Materials.Ultimate, aAmount);
- }
- else if (aTier == 9) {
- return ItemUtils.getOrePrefixStack(OrePrefixes.pipeMedium, Materials.Superconductor, aAmount);
- }
- else if (aTier == 10) {
- return ItemUtils.getOrePrefixStack(aPrefix, Materials.Europium, aAmount);
- }
- else {
- return ItemUtils.getOrePrefixStack(aPrefix, Materials.Titanium, aAmount);
- }
- }
-
- if (aPrefix == OrePrefixes.rod) {
- aPrefix = OrePrefixes.stick;
- }
-
- if (aPrefix == OrePrefixes.gear || aPrefix == OrePrefixes.gearGt) {
- m = aMaster[0][aTier];
- }
- else if (aPrefix == OrePrefixes.rod || aPrefix == OrePrefixes.stick) {
- m = aMaster[0][aTier];
- }
- else if (aPrefix == OrePrefixes.stickLong) {
- m = aMaster[1][aTier];
- }
- else if (aPrefix == OrePrefixes.bolt) {
- m = aMaster[2][aTier];
- }
- else if (aPrefix == OrePrefixes.screw) {
- m = aMaster[0][aTier];
- }
- else if (aPrefix == OrePrefixes.rotor) {
- m = aMaster[1][aTier];
- }
- else if (aPrefix == OrePrefixes.frame || aPrefix == OrePrefixes.frameGt) {
- m = aMaster[2][aTier];
- }
- else if (aPrefix == OrePrefixes.ingot) {
- m = aMaster[1][aTier];
- }
- else if (aPrefix == OrePrefixes.plate) {
- m = aMaster[0][aTier];
- }
- else if (aPrefix == OrePrefixes.plateDouble) {
- m = aMaster[0][aTier];
- }
- else if (aPrefix == OrePrefixes.ring) {
- m = aMaster[2][aTier];
- }
- else if (aPrefix == OrePrefixes.cell) {
- m = aMaster[1][aTier];
- }
- else {
- m = aMaterial_Main[aTier];
- }
-
- ItemStack aReturn = ItemUtils.getOrePrefixStack(aPrefix, m, aAmount);
-
- //If Invalid, Try First Material
- if (!ItemUtils.checkForInvalidItems(aReturn)) {
- m = aMaster[0][aTier];
- aReturn = ItemUtils.getOrePrefixStack(aPrefix, m, aAmount);
-
- //If Invalid, Try Second Material
- if (!ItemUtils.checkForInvalidItems(aReturn)) {
- m = aMaster[1][aTier];
- aReturn = ItemUtils.getOrePrefixStack(aPrefix, m, aAmount);
-
- //If Invalid, Try Third Material
- if (!ItemUtils.checkForInvalidItems(aReturn)) {
- m = aMaster[2][aTier];
- aReturn = ItemUtils.getOrePrefixStack(aPrefix, m, aAmount);
-
- //All Invalid? Ok, shit.
- //Let's add a special error ingot.
- if (!ItemUtils.checkForInvalidItems(aReturn)) {
- aReturn = ItemUtils.getErrorStack(1, (aPrefix.toString()+m.getLocalizedName()+" x"+aAmount));
- }
- }
- }
- }
-
- return aReturn;
-
-
- }
-
- public static ItemStack getElectricMotor(int aTier, int aSize) {
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.electricMotor_ULV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricMotor_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricMotor_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricMotor_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricMotor_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricMotor_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricMotor_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricMotor_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricMotor_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricMotor_MAX;
- }
- else {
- aType = CI.electricMotor_LV;
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
- public static ItemStack getFluidRegulator(int aTier, int aSize) {
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- return CI.getElectricPump(aTier, aSize);
- }
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fluidRegulator_UV;
- }
- else {
- aType = CI.fluidRegulator_LV;
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
- public static ItemStack getElectricPiston(int aTier, int aSize) {
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.electricPiston_ULV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPiston_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPiston_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPiston_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPiston_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPiston_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPiston_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPiston_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPiston_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPiston_MAX;
- }
- else {
- aType = CI.electricPiston_LV;
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
- public static ItemStack getElectricPump(int aTier, int aSize) {
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.electricPump_ULV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPump_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPump_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPump_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPump_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPump_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPump_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPump_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPump_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.electricPump_MAX;
- }
- else {
- aType = CI.electricPump_LV;
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
- public static ItemStack getRobotArm(int aTier, int aSize) {
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.robotArm_ULV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.robotArm_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.robotArm_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.robotArm_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.robotArm_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.robotArm_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.robotArm_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.robotArm_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.robotArm_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.robotArm_MAX;
- }
- else {
- aType = CI.robotArm_LV;
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
- public static ItemStack getConveyor(int aTier, int aSize) {
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_ULV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.conveyorModule_MAX;
- }
- else {
- aType = CI.conveyorModule_LV;
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
- public static ItemStack getEmitter(int aTier, int aSize) {
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.emitter_ULV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.emitter_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.emitter_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.emitter_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.emitter_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.emitter_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.emitter_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.emitter_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.emitter_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.emitter_MAX;
- }
- else {
- aType = CI.emitter_LV;
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
- public static ItemStack getSensor(int aTier, int aSize) {
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.sensor_ULV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.sensor_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.sensor_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.sensor_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.sensor_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.sensor_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.sensor_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.sensor_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.sensor_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.sensor_MAX;
- }
- else {
- aType = CI.sensor_LV;
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
- public static ItemStack getFieldGenerator(int aTier, int aSize) {
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_ULV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.fieldGenerator_MAX;
- }
- else {
- aType = CI.fieldGenerator_LV;
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
-
-
- public static ItemStack getTieredMachineHull(int aTier, int aSize) {
- ItemStack aType;
- int aLazyTier = 0;
- if (aTier == aLazyTier++) {
- aType = CI.machineHull_ULV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.machineHull_LV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.machineHull_MV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.machineHull_HV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.machineHull_EV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.machineHull_IV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.machineHull_LuV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.machineHull_ZPM;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.machineHull_UV;
- }
- else if (aTier == aLazyTier++) {
- aType = CI.machineHull_MAX;
- }
- else {
- aType = GregtechItemList.Casing_Multi_Use.get(1, CI.machineHull_MV);
- }
- return ItemUtils.getSimpleStack(aType, aSize);
- }
-
- public static ItemStack getHeatCoil(int i) {
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- if (i == 1) {
- return ItemList.Casing_Coil_Kanthal.get(1);
- } else if (i == 2) {
- return ItemList.Casing_Coil_Nichrome.get(1);
- } else {
- return ItemList.Casing_Coil_Cupronickel.get(1);
- }
- } else {
- if (!CORE.GTNH) {
- if (i > 6) {
- i = 6;
- }
- } else {
- if (i > 8) {
- i = 8;
- }
- }
- return ItemUtils.simpleMetaStack(StaticFields59.getBlockCasings5(), i, 1);
- }
-
- }
-
- public static ItemStack getNumberedBioCircuit(int i) {
- return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, i, 0);
- }
-
- public static ItemStack getNumberedAdvancedCircuit(int i) {
- return ItemUtils.simpleMetaStack(GenericChem.mAdvancedCircuit, i, 0);
- }
-
- public static ItemStack getTieredGTPPMachineCasing(int aTier, int aAmount) {
- GregtechItemList[] aHulls = new GregtechItemList[] {
- GregtechItemList.GTPP_Casing_ULV,
- GregtechItemList.GTPP_Casing_LV,
- GregtechItemList.GTPP_Casing_MV,
- GregtechItemList.GTPP_Casing_HV,
- GregtechItemList.GTPP_Casing_EV,
- GregtechItemList.GTPP_Casing_IV,
- GregtechItemList.GTPP_Casing_LuV,
- GregtechItemList.GTPP_Casing_ZPM,
- GregtechItemList.GTPP_Casing_UV,
- GregtechItemList.GTPP_Casing_MAX
- };
- return aHulls[aTier].get(aAmount);
- }
-
- public static ItemStack getTieredComponentOfMaterial(Materials aMaterial, OrePrefixes aPrefix, int aAmount) {
- return ItemUtils.getOrePrefixStack(aPrefix, aMaterial, aAmount);
- }
-
- public static ItemStack getTransmissionComponent(int aTier, int aAmount) {
- GregtechItemList[] aTransParts = new GregtechItemList[] {
- GregtechItemList.TransmissionComponent_ULV,
- GregtechItemList.TransmissionComponent_LV,
- GregtechItemList.TransmissionComponent_MV,
- GregtechItemList.TransmissionComponent_HV,
- GregtechItemList.TransmissionComponent_EV,
- GregtechItemList.TransmissionComponent_IV,
- GregtechItemList.TransmissionComponent_LuV,
- GregtechItemList.TransmissionComponent_ZPM,
- GregtechItemList.TransmissionComponent_UV,
- GregtechItemList.TransmissionComponent_MAX,
- };
- return aTransParts[aTier].get(aAmount);
- }
-
- public static ItemStack getEmptyCatalyst(int aAmount) {
- return ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 13, aAmount);
- }
-
- /**
- * Aluminium + Silver Catalyst
- * @param aAmount - Stacksize
- * @return - A Catalyst stack of given size
- */
- public static ItemStack getGreenCatalyst(int aAmount) {
- return ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 14, aAmount);
- }
-
- /**
- * Iron + Copper Catalyst
- * @param aAmount - Stacksize
- * @return - A Catalyst stack of given size
- */
- public static ItemStack getRedCatalyst(int aAmount) {
- return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 0, aAmount);
- }
-
- /**
- * Tungsten + Nickel Catalyst
- * @param aAmount - Stacksize
- * @return - A Catalyst stack of given size
- */
- public static ItemStack getYellowCatalyst(int aAmount) {
- return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 1, aAmount);
- }
-
- /**
- * Cobalt + Titanium Catalyst
- * @param aAmount - Stacksize
- * @return - A Catalyst stack of given size
- */
- public static ItemStack getBlueCatalyst(int aAmount) {
- return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 2, aAmount);
- }
-
- /**
- * Vanadium + Palladium Catalyst
- * @param aAmount - Stacksize
- * @return - A Catalyst stack of given size
- */
- public static ItemStack getOrangeCatalyst(int aAmount) {
- return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 3, aAmount);
- }
-
- /**
- * Iridium + Ruthenium Catalyst
- * @param aAmount - Stacksize
- * @return - A Catalyst stack of given size
- */
- public static ItemStack getPurpleCatalyst(int aAmount) {
- return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 4, aAmount);
- }
-
- /**
- * Aluminium + Nickel Catalyst
- * @param aAmount - Stacksize
- * @return - A Catalyst stack of given size
- */
- public static ItemStack getBrownCatalyst(int aAmount) {
- return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 5, aAmount);
- }
-
- /**
- * Platinum + Rhodium Catalyst
- * @param aAmount - Stacksize
- * @return - A Catalyst stack of given size
- */
- public static ItemStack getPinkCatalyst(int aAmount) {
- return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 6, aAmount);
- }
-
+ // null
+ public static ItemStack _NULL = ItemUtils.getErrorStack(1);
+
+ // bits
+ public static long bits = GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED;
+ public static long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED;
+
+ // Circuits
+ public static Object circuitPrimitive;
+ public static Object circuitTier1;
+ public static Object circuitTier2;
+ public static Object circuitTier3;
+ public static Object circuitTier4;
+ public static Object circuitTier5;
+ public static Object circuitTier6;
+ public static Object circuitTier7;
+ public static Object circuitTier8;
+ public static Object circuitTier9;
+
+ // Machine Components
+ public static ItemStack electricMotor_ULV;
+ public static ItemStack electricMotor_LV;
+ public static ItemStack electricMotor_MV;
+ public static ItemStack electricMotor_HV;
+ public static ItemStack electricMotor_EV;
+ public static ItemStack electricMotor_IV;
+ public static ItemStack electricMotor_LuV;
+ public static ItemStack electricMotor_ZPM;
+ public static ItemStack electricMotor_UV;
+ public static ItemStack electricMotor_MAX;
+ public static ItemStack electricPump_ULV;
+ public static ItemStack electricPump_LV;
+ public static ItemStack electricPump_MV;
+ public static ItemStack electricPump_HV;
+ public static ItemStack electricPump_EV;
+ public static ItemStack electricPump_IV;
+ public static ItemStack electricPump_LuV;
+ public static ItemStack electricPump_ZPM;
+ public static ItemStack electricPump_UV;
+ public static ItemStack electricPump_MAX;
+ public static ItemStack electricPiston_ULV;
+ public static ItemStack electricPiston_LV;
+ public static ItemStack electricPiston_MV;
+ public static ItemStack electricPiston_HV;
+ public static ItemStack electricPiston_EV;
+ public static ItemStack electricPiston_IV;
+ public static ItemStack electricPiston_LuV;
+ public static ItemStack electricPiston_ZPM;
+ public static ItemStack electricPiston_UV;
+ public static ItemStack electricPiston_MAX;
+ public static ItemStack robotArm_ULV;
+ public static ItemStack robotArm_LV;
+ public static ItemStack robotArm_MV;
+ public static ItemStack robotArm_HV;
+ public static ItemStack robotArm_EV;
+ public static ItemStack robotArm_IV;
+ public static ItemStack robotArm_LuV;
+ public static ItemStack robotArm_ZPM;
+ public static ItemStack robotArm_UV;
+ public static ItemStack robotArm_MAX;
+ public static ItemStack conveyorModule_ULV;
+ public static ItemStack conveyorModule_LV;
+ public static ItemStack conveyorModule_MV;
+ public static ItemStack conveyorModule_HV;
+ public static ItemStack conveyorModule_EV;
+ public static ItemStack conveyorModule_IV;
+ public static ItemStack conveyorModule_LuV;
+ public static ItemStack conveyorModule_ZPM;
+ public static ItemStack conveyorModule_UV;
+ public static ItemStack conveyorModule_MAX;
+ public static ItemStack emitter_ULV;
+ public static ItemStack emitter_LV;
+ public static ItemStack emitter_MV;
+ public static ItemStack emitter_HV;
+ public static ItemStack emitter_EV;
+ public static ItemStack emitter_IV;
+ public static ItemStack emitter_LuV;
+ public static ItemStack emitter_ZPM;
+ public static ItemStack emitter_UV;
+ public static ItemStack emitter_MAX;
+ public static ItemStack fieldGenerator_ULV;
+ public static ItemStack fieldGenerator_LV;
+ public static ItemStack fieldGenerator_MV;
+ public static ItemStack fieldGenerator_HV;
+ public static ItemStack fieldGenerator_EV;
+ public static ItemStack fieldGenerator_IV;
+ public static ItemStack fieldGenerator_LuV;
+ public static ItemStack fieldGenerator_ZPM;
+ public static ItemStack fieldGenerator_UV;
+ public static ItemStack fieldGenerator_MAX;
+ public static ItemStack sensor_ULV;
+ public static ItemStack sensor_LV;
+ public static ItemStack sensor_MV;
+ public static ItemStack sensor_HV;
+ public static ItemStack sensor_EV;
+ public static ItemStack sensor_IV;
+ public static ItemStack sensor_LuV;
+ public static ItemStack sensor_ZPM;
+ public static ItemStack sensor_UV;
+ public static ItemStack sensor_MAX;
+
+ public static ItemStack fluidRegulator_LV;
+ public static ItemStack fluidRegulator_MV;
+ public static ItemStack fluidRegulator_HV;
+ public static ItemStack fluidRegulator_EV;
+ public static ItemStack fluidRegulator_IV;
+ public static ItemStack fluidRegulator_LuV;
+ public static ItemStack fluidRegulator_ZPM;
+ public static ItemStack fluidRegulator_UV;
+
+ // Machine Casings
+ public static ItemStack machineCasing_ULV;
+ public static ItemStack machineCasing_LV;
+ public static ItemStack machineCasing_MV;
+ public static ItemStack machineCasing_HV;
+ public static ItemStack machineCasing_EV;
+ public static ItemStack machineCasing_IV;
+ public static ItemStack machineCasing_LuV;
+ public static ItemStack machineCasing_ZPM;
+ public static ItemStack machineCasing_UV;
+ public static ItemStack machineCasing_MAX;
+
+ // Machine Hulls
+ public static ItemStack machineHull_ULV;
+ public static ItemStack machineHull_LV;
+ public static ItemStack machineHull_MV;
+ public static ItemStack machineHull_HV;
+ public static ItemStack machineHull_EV;
+ public static ItemStack machineHull_IV;
+ public static ItemStack machineHull_LuV;
+ public static ItemStack machineHull_ZPM;
+ public static ItemStack machineHull_UV;
+ public static ItemStack machineHull_MAX;
+
+ // Gearbox Casings
+ public static ItemStack gearboxCasing_Tier_1;
+ public static ItemStack gearboxCasing_Tier_2;
+ public static ItemStack gearboxCasing_Tier_3;
+ public static ItemStack gearboxCasing_Tier_4;
+
+ public static String[] component_Plate;
+ public static String[] component_Rod;
+ public static String[] component_Ingot;
+
+ // Crafting Tools
+ public static String craftingToolWrench = "craftingToolWrench";
+ public static String craftingToolHammer_Hard = "craftingToolHardHammer";
+ public static String craftingToolHammer_Soft = "craftingToolSoftHammer";
+ public static String craftingToolScrewdriver = "craftingToolScrewdriver";
+ public static String craftingToolFile = "craftingToolFile";
+ public static String craftingToolMortar = "craftingToolMortar";
+ public static String craftingToolKnife = "craftingToolKnife";
+ public static String craftingToolCrowbar = "craftingToolCrowbar";
+ public static String craftingToolSaw = "craftingToolSaw";
+ public static String craftingToolWireCutter = "craftingToolWirecutter";
+ public static String craftingToolSolderingIron = "craftingToolSolderingIron";
+
+ // Explosives
+ public static ItemStack explosivePowderKeg;
+ public static ItemStack explosiveTNT;
+ public static ItemStack explosiveITNT;
+
+ public static Materials[] tieredMaterials = new Materials[] {
+ Materials.Iron, Materials.Steel, Materials.Aluminium,
+ Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel,
+ Materials.Chrome, Materials.Iridium, Materials.Osmium,
+ Materials.Neutronium
+ };
+ ;
+
+ public static void preInit() {
+
+ // Tiered Components
+ component_Plate = new String[] {
+ getTieredComponent(OrePrefixes.plate, 0),
+ getTieredComponent(OrePrefixes.plate, 1),
+ getTieredComponent(OrePrefixes.plate, 2),
+ getTieredComponent(OrePrefixes.plate, 3),
+ getTieredComponent(OrePrefixes.plate, 4),
+ getTieredComponent(OrePrefixes.plate, 5),
+ getTieredComponent(OrePrefixes.plate, 6),
+ getTieredComponent(OrePrefixes.plate, 7),
+ getTieredComponent(OrePrefixes.plate, 8),
+ getTieredComponent(OrePrefixes.plate, 9),
+ getTieredComponent(OrePrefixes.plate, 10),
+ getTieredComponent(OrePrefixes.plate, 11)
+ };
+ component_Rod = new String[] {
+ getTieredComponent(OrePrefixes.stick, 0),
+ getTieredComponent(OrePrefixes.stick, 1),
+ getTieredComponent(OrePrefixes.stick, 2),
+ getTieredComponent(OrePrefixes.stick, 3),
+ getTieredComponent(OrePrefixes.stick, 4),
+ getTieredComponent(OrePrefixes.stick, 5),
+ getTieredComponent(OrePrefixes.stick, 6),
+ getTieredComponent(OrePrefixes.stick, 7),
+ getTieredComponent(OrePrefixes.stick, 8),
+ getTieredComponent(OrePrefixes.stick, 9),
+ getTieredComponent(OrePrefixes.stick, 10),
+ getTieredComponent(OrePrefixes.stick, 11)
+ };
+ component_Ingot = new String[] {
+ getTieredComponent(OrePrefixes.ingot, 0),
+ getTieredComponent(OrePrefixes.ingot, 1),
+ getTieredComponent(OrePrefixes.ingot, 2),
+ getTieredComponent(OrePrefixes.ingot, 3),
+ getTieredComponent(OrePrefixes.ingot, 4),
+ getTieredComponent(OrePrefixes.ingot, 5),
+ getTieredComponent(OrePrefixes.ingot, 6),
+ getTieredComponent(OrePrefixes.ingot, 7),
+ getTieredComponent(OrePrefixes.ingot, 8),
+ getTieredComponent(OrePrefixes.ingot, 9),
+ getTieredComponent(OrePrefixes.ingot, 10),
+ getTieredComponent(OrePrefixes.ingot, 11)
+ };
+
+ // Circuits
+ circuitPrimitive = getTieredCircuit(0);
+ circuitTier1 = getTieredCircuit(1);
+ circuitTier2 = getTieredCircuit(2);
+ circuitTier3 = getTieredCircuit(3);
+ circuitTier4 = getTieredCircuit(4);
+ circuitTier5 = getTieredCircuit(5);
+ circuitTier6 = getTieredCircuit(6);
+ circuitTier7 = getTieredCircuit(7);
+ circuitTier8 = getTieredCircuit(8);
+ circuitTier9 = getTieredCircuit(9);
+ }
+
+ public static Object getTieredCircuit(int tier) {
+ if (CORE.ConfigSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) {
+ if (tier == 0) {
+ return GregtechItemList.Old_Circuit_Primitive.get(1);
+ } else if (tier == 1) {
+ return GregtechItemList.Old_Circuit_Basic.get(1);
+ } else if (tier == 2) {
+ return GregtechItemList.Old_Circuit_Good.get(1);
+ } else if (tier == 3) {
+ return GregtechItemList.Old_Circuit_Advanced.get(1);
+ } else if (tier == 4) {
+ return GregtechItemList.Old_Circuit_Data.get(1);
+ } else if (tier == 5) {
+ return GregtechItemList.Old_Circuit_Elite.get(1);
+ } else if (tier == 6) {
+ return GregtechItemList.Old_Circuit_Master.get(1);
+ } else if (tier == 7) {
+ return GregtechItemList.Old_Circuit_Ultimate.get(1);
+ } else if (tier == 8) {
+ return GregtechItemList.Circuit_IV.get(1);
+ } else if (tier == 9) {
+ return GregtechItemList.Circuit_LuV.get(1);
+ } else if (tier == 10) {
+ return GregtechItemList.Circuit_ZPM.get(1);
+ }
+ } else {
+ return getTieredCircuitOreDictName(tier);
+ }
+ return _NULL;
+ }
+
+ public static ItemStack[] getAllCircuitsOfTier(int tier) {
+ return ItemUtils.getStackOfAllOreDictGroup(getTieredCircuitOreDictName(tier));
+ }
+
+ public static String getTieredCircuitOreDictName(int tier) {
+ if (tier == 0) {
+ return "circuitPrimitive";
+ } else if (tier == 1) {
+ return "circuitBasic";
+ } else if (tier == 2) {
+ return "circuitGood";
+ } else if (tier == 3) {
+ return "circuitAdvanced";
+ } else if (tier == 4) {
+ return "circuitData";
+ } else if (tier == 5) {
+ return "circuitElite";
+ } else if (tier == 6) {
+ return "circuitMaster";
+ } else if (tier == 7) {
+ return "circuitUltimate";
+ } else if (tier == 8) {
+ return "circuitSuperconductor";
+ } else if (tier == 9) {
+ return "circuitInfinite";
+ } else if (tier == 10) {
+ return "circuitQuantum";
+ } else {
+ return "circuitPrimitive";
+ }
+ }
+
+ public static ItemStack getNumberedCircuit(int Meta) {
+ return ItemUtils.getGregtechCircuit(Meta);
+ }
+
+ private static Object getMaterialFromTier(int tier) {
+ if (tier == 0) {
+ return Materials.Wood;
+ } else if (tier == 1) {
+ return Materials.Lead;
+ } else if (tier == 2) {
+ return Materials.Bronze;
+ } else if (tier == 3) {
+ return Materials.Steel;
+ } else if (tier == 4) {
+ return ALLOY.EGLIN_STEEL;
+ } else if (tier == 5) {
+ return Materials.Aluminium;
+ } else if (tier == 6) {
+ return ALLOY.MARAGING250;
+ } else if (tier == 7) {
+ return ALLOY.TANTALLOY_61;
+ } else if (tier == 8) {
+ return ALLOY.INCONEL_792;
+ } else if (tier == 9) {
+ return ALLOY.ZERON_100;
+ } else if (tier == 10) {
+ return Materials.NaquadahEnriched;
+ } else if (tier == 11) {
+ return Materials.Neutronium;
+ }
+ return Materials._NULL;
+ }
+
+ @Deprecated
+ public static String getTieredComponent(OrePrefixes type, int tier) {
+ Object material = getMaterialFromTier(tier);
+ if (material != null) {
+ if (material instanceof Materials) {
+ // return (ItemStack) type.get(material);
+ String materialName = ((Materials) material).mDefaultLocalName;
+ Logger.INFO("Searching for a component named " + type.name() + materialName);
+ // return ItemUtils.getItemStackOfAmountFromOreDict(type.name()+materialName, 1);
+ return (type.name() + materialName);
+ } else {
+ String materialName = (Utils.sanitizeString(((Material) material).getLocalizedName()));
+ Logger.INFO("Searching for a component named " + type.name() + materialName);
+ // return ItemUtils.getItemStackOfAmountFromOreDict(type.name()+materialName, 1);
+ return (type.name() + materialName);
+ }
+ }
+ Logger.INFO("[Components] Failed getting a tiered component. " + type.name() + " | " + tier);
+ return null;
+ }
+
+ public static ItemStack getDataOrb() {
+ if (CORE.ConfigSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) {
+ return GregtechItemList.Old_Tool_DataOrb.get(1);
+ } else {
+ return ItemList.Tool_DataOrb.get(1);
+ }
+ }
+
+ public static ItemStack getDataStick() {
+ if (CORE.ConfigSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) {
+ return GregtechItemList.Old_Tool_DataStick.get(1);
+ } else {
+ return ItemList.Tool_DataStick.get(1);
+ }
+ }
+
+ public static final ItemStack getTieredMachineHull(int tier) {
+ if (tier == 0) {
+ return machineHull_ULV;
+ } else if (tier == 1) {
+ return machineHull_LV;
+ } else if (tier == 2) {
+ return machineHull_MV;
+ } else if (tier == 3) {
+ return machineHull_HV;
+ } else if (tier == 4) {
+ return machineHull_EV;
+ } else if (tier == 5) {
+ return machineHull_IV;
+ } else if (tier == 6) {
+ return machineHull_LuV;
+ } else if (tier == 7) {
+ return machineHull_ZPM;
+ } else if (tier == 8) {
+ return machineHull_UV;
+ } else if (tier == 9) {
+ return machineHull_MAX;
+ } else {
+ return GregtechItemList.Casing_Multi_Use.get(1);
+ }
+ }
+
+ public static final ItemStack getTieredMachineCasing(int tier) {
+ if (tier == 0) {
+ if (machineCasing_ULV == null) {
+ machineCasing_ULV = ItemList.Casing_ULV.get(1);
+ }
+ return machineCasing_ULV;
+ } else if (tier == 1) {
+ return machineCasing_LV;
+ } else if (tier == 2) {
+ return machineCasing_MV;
+ } else if (tier == 3) {
+ return machineCasing_HV;
+ } else if (tier == 4) {
+ return machineCasing_EV;
+ } else if (tier == 5) {
+ return machineCasing_IV;
+ } else if (tier == 6) {
+ return machineCasing_LuV;
+ } else if (tier == 7) {
+ return machineCasing_ZPM;
+ } else if (tier == 8) {
+ return machineCasing_UV;
+ } else if (tier == 9) {
+ return machineCasing_MAX;
+ } else {
+ return GregtechItemList.Casing_Multi_Use.get(1);
+ }
+ }
+
+ public static void init() {
+ // Set Explosives
+ explosivePowderKeg =
+ ItemUtils.getValueOfItemList("Block_Powderbarrel", 1, ItemUtils.getSimpleStack(Items.gunpowder, 16));
+ explosiveTNT = ItemUtils.getSimpleStack(Blocks.tnt).copy();
+ explosiveITNT = Ic2Items.industrialTnt.copy();
+
+ // Machine Casings
+ machineCasing_ULV = ItemList.Casing_ULV.get(1);
+ machineCasing_LV = ItemList.Casing_LV.get(1);
+ machineCasing_MV = ItemList.Casing_MV.get(1);
+ machineCasing_HV = ItemList.Casing_HV.get(1);
+ machineCasing_EV = ItemList.Casing_EV.get(1);
+ machineCasing_IV = ItemList.Casing_IV.get(1);
+ machineCasing_LuV = ItemList.Casing_LuV.get(1);
+ machineCasing_ZPM = ItemList.Casing_ZPM.get(1);
+ machineCasing_UV = ItemList.Casing_UV.get(1);
+ machineCasing_MAX = ItemList.Casing_MAX.get(1);
+
+ // Machine Hulls
+ machineHull_ULV = ItemList.Hull_ULV.get(1);
+ machineHull_LV = ItemList.Hull_LV.get(1);
+ machineHull_MV = ItemList.Hull_MV.get(1);
+ machineHull_HV = ItemList.Hull_HV.get(1);
+ machineHull_EV = ItemList.Hull_EV.get(1);
+ machineHull_IV = ItemList.Hull_IV.get(1);
+ machineHull_LuV = ItemList.Hull_LuV.get(1);
+ machineHull_ZPM = ItemList.Hull_ZPM.get(1);
+ machineHull_UV = ItemList.Hull_UV.get(1);
+ machineHull_MAX = ItemList.Hull_MAX.get(1);
+
+ // Gear box Casings
+ gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
+ gearboxCasing_Tier_2 = ItemList.Casing_Gearbox_Steel.get(1);
+ gearboxCasing_Tier_3 = ItemList.Casing_Gearbox_Titanium.get(1);
+ gearboxCasing_Tier_4 = ItemList.Casing_Gearbox_TungstenSteel.get(1);
+
+ // Machine Components
+ LOADER_Machine_Components.initialise();
+ }
+
+ public static ItemStack emptyCells(int i) {
+ return ItemUtils.getEmptyCell(i);
+ }
+
+ private static final Material[] aMaterial_Main = new Material[] {
+ ALLOY.POTIN,
+ ALLOY.TUMBAGA,
+ ALLOY.EGLIN_STEEL,
+ ALLOY.INCONEL_792,
+ ALLOY.INCOLOY_MA956,
+ ALLOY.NITINOL_60,
+ ALLOY.ZERON_100,
+ ALLOY.PIKYONIUM,
+ ELEMENT.STANDALONE.ADVANCED_NITINOL,
+ ALLOY.ABYSSAL,
+ ALLOY.QUANTUM,
+ ELEMENT.STANDALONE.HYPOGEN
+ };
+
+ private static final Material[] aMaterial_Secondary = new Material[] {
+ ALLOY.STEEL,
+ ALLOY.SILICON_CARBIDE,
+ ALLOY.BABBIT_ALLOY,
+ ALLOY.INCONEL_690,
+ ALLOY.STELLITE,
+ ALLOY.ARCANITE,
+ ALLOY.LAFIUM,
+ ALLOY.CINOBITE,
+ ALLOY.TITANSTEEL,
+ ALLOY.OCTIRON,
+ ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN,
+ ELEMENT.STANDALONE.HYPOGEN
+ };
+
+ private static final Material[] aMaterial_Tertiary = new Material[] {
+ ELEMENT.getInstance().LEAD,
+ ELEMENT.getInstance().ALUMINIUM,
+ ELEMENT.STANDALONE.BLACK_METAL,
+ ELEMENT.getInstance().TITANIUM,
+ ALLOY.HASTELLOY_N,
+ ALLOY.ENERGYCRYSTAL,
+ ALLOY.TRINIUM_NAQUADAH_CARBON,
+ ALLOY.TRINIUM_REINFORCED_STEEL, // Arceus
+ ALLOY.TITANSTEEL,
+ ELEMENT.STANDALONE.ASTRAL_TITANIUM,
+ ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN,
+ ELEMENT.STANDALONE.HYPOGEN
+ };
+
+ private static final Materials[] aMaterial_Cables = new Materials[] {
+ !CORE.GTNH ? Materials.Lead : Materials.Tin,
+ Materials.Cobalt,
+ Materials.AnnealedCopper,
+ Materials.Gold,
+ Materials.Titanium,
+ Materials.Nichrome,
+ Materials.Platinum,
+ Materials.YttriumBariumCuprate,
+ Materials.Naquadah,
+ Materials.Duranium,
+ Materials.Superconductor,
+ };
+
+ private static final Materials[] aMaterial_Circuits = new Materials[] {
+ Materials.Primitive,
+ Materials.Basic,
+ Materials.Good,
+ Materials.Advanced,
+ Materials.Data,
+ Materials.Data,
+ Materials.Elite,
+ Materials.Master,
+ Materials.Ultimate,
+ Materials.Superconductor,
+ Materials.Infinite,
+ };
+
+ private static final Material[][] aMaster =
+ new Material[][] {aMaterial_Main, aMaterial_Secondary, aMaterial_Tertiary};
+
+ public static FluidStack getTieredFluid(int aTier, int aAmount) {
+ return getTieredFluid(aTier, aAmount, 0);
+ }
+
+ public static FluidStack getAlternativeTieredFluid(int aTier, int aAmount) {
+ return getTieredFluid(aTier, aAmount, 1);
+ }
+
+ public static FluidStack getTertiaryTieredFluid(int aTier, int aAmount) {
+ return getTieredFluid(aTier, aAmount, 2);
+ }
+
+ public static FluidStack getTieredFluid(int aTier, int aAmount, int aType) {
+ // Weird Legacy handling
+ /*ItemStack aCell = getTieredComponent(OrePrefixes.liquid, aTier, 1);
+ FluidStack a = GT_Utility.getFluidForFilledItem(aCell, true);
+ if (a == null) {
+ a = aMaster[aType][aTier].getFluid(aAmount);
+ }*/
+
+ // Modern Handling
+ FluidStack a = aMaster[aType][aTier].getFluidStack(aAmount);
+ if (a == null) {
+ ItemStack aCell = getTieredComponent(OrePrefixes.liquid, aTier, 1);
+ if (aCell != null) {
+ a = GT_Utility.getFluidForFilledItem(aCell, true);
+ a.amount = aAmount;
+ }
+ }
+ return a;
+ }
+
+ public static ItemStack getEnergyCore(int aTier, int aAmount) {
+ ItemStack[] aOutput = new ItemStack[] {
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "1", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "2", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "3", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "4", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "5", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "6", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "7", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "8", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "9", 1),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + "10", 1)
+ };
+ return ItemUtils.getSimpleStack(aOutput[MathUtils.balance(aTier, 0, 9)], aAmount);
+ }
+
+ public static ItemStack getPlate(int aTier, int aAmount) {
+ return getTieredComponent(OrePrefixes.plate, aTier, aAmount);
+ }
+
+ public static ItemStack getDoublePlate(int aTier, int aAmount) {
+ return getTieredComponent(OrePrefixes.plateDouble, aTier, aAmount);
+ }
+
+ public static ItemStack getGear(int aTier, int aAmount) {
+ return getTieredComponent(OrePrefixes.gearGt, aTier, aAmount);
+ }
+
+ public static ItemStack getIngot(int aTier, int aAmount) {
+ return getTieredComponent(OrePrefixes.ingot, aTier, aAmount);
+ }
+
+ public static ItemStack getBolt(int aTier, int aAmount) {
+ return getTieredComponent(OrePrefixes.bolt, aTier, aAmount);
+ }
+
+ public static ItemStack getScrew(int aTier, int aAmount) {
+ return getTieredComponent(OrePrefixes.screw, aTier, aAmount);
+ }
+
+ public static ItemStack getCircuit(int aTier, int aAmount) {
+ return getTieredComponent(OrePrefixes.circuit, aTier, aAmount);
+ }
+
+ public static ItemStack getTieredComponent(OrePrefixes aPrefix, int aTier, int aAmount) {
+ aTier = Math.max(0, aTier);
+
+ Material m = null;
+
+ if (aPrefix == OrePrefixes.liquid) {
+ int aMatID = (aTier == 0 || aTier == 2 || aTier == 5 || aTier == 8
+ ? 0
+ : (aTier == 1 || aTier == 3 || aTier == 6 || aTier == 9 ? 1 : 2));
+ ItemStack aCell = aMaster[aMatID][aTier].getCell(aAmount);
+ return aCell;
+ }
+
+ if (aPrefix == OrePrefixes.circuit) {
+ /*if (aTier == 4) {
+ return ItemUtils.getSimpleStack(CI.getDataStick(), aAmount);
+ }
+ else if (aTier == 5) {
+ return ItemUtils.getSimpleStack(CI.getDataOrb(), aAmount);
+ }*/
+ return ItemUtils.getOrePrefixStack(OrePrefixes.circuit, aMaterial_Circuits[aTier], aAmount);
+ }
+
+ // Check for Cables first, catch SuperConductor case and swap to wire.
+ if (aPrefix == OrePrefixes.cableGt01
+ || aPrefix == OrePrefixes.cableGt02
+ || aPrefix == OrePrefixes.cableGt04
+ || aPrefix == OrePrefixes.cableGt08
+ || aPrefix == OrePrefixes.cableGt12) {
+ // Special Handler
+ if (aTier == 10) {
+ if (aPrefix == OrePrefixes.cableGt01) {
+ aPrefix = OrePrefixes.wireGt02;
+ } else if (aPrefix == OrePrefixes.cableGt02) {
+ aPrefix = OrePrefixes.wireGt04;
+ } else if (aPrefix == OrePrefixes.cableGt04) {
+ aPrefix = OrePrefixes.wireGt08;
+ } else if (aPrefix == OrePrefixes.cableGt08) {
+ aPrefix = OrePrefixes.wireGt12;
+ } else if (aPrefix == OrePrefixes.cableGt12) {
+ aPrefix = OrePrefixes.wireGt16;
+ }
+ } else {
+ return ItemUtils.getOrePrefixStack(aPrefix, aMaterial_Cables[aTier], aAmount);
+ }
+ }
+ if (aPrefix == OrePrefixes.wireGt01
+ || aPrefix == OrePrefixes.wireGt02
+ || aPrefix == OrePrefixes.wireGt04
+ || aPrefix == OrePrefixes.wireGt08
+ || aPrefix == OrePrefixes.wireGt12
+ || aPrefix == OrePrefixes.wireGt16) {
+ return ItemUtils.getOrePrefixStack(aPrefix, aMaterial_Cables[aTier], aAmount);
+ }
+
+ if (aPrefix == OrePrefixes.pipeTiny
+ || aPrefix == OrePrefixes.pipeSmall
+ || aPrefix == OrePrefixes.pipe
+ || aPrefix == OrePrefixes.pipeMedium
+ || aPrefix == OrePrefixes.pipeLarge
+ || aPrefix == OrePrefixes.pipeHuge) {
+
+ if (aPrefix == OrePrefixes.pipe) {
+ aPrefix = OrePrefixes.pipeMedium;
+ }
+
+ if (aTier == 0) {
+ return ItemUtils.getOrePrefixStack(aPrefix, Materials.Lead, aAmount);
+ } else if (aTier == 1) {
+ return ItemUtils.getOrePrefixStack(aPrefix, Materials.Steel, aAmount);
+ } else if (aTier == 2) {
+ return ItemUtils.getOrePrefixStack(aPrefix, Materials.StainlessSteel, aAmount);
+ } else if (aTier == 3) {
+ return ItemUtils.getOrePrefixStack(aPrefix, Materials.Tungsten, aAmount);
+ } else if (aTier == 4) {
+ return ItemUtils.getOrePrefixStack(aPrefix, Materials.TungstenSteel, aAmount);
+ } else if (aTier == 5) {
+ return ItemUtils.getOrePrefixStack(aPrefix, ALLOY.MARAGING350, aAmount);
+ } else if (aTier == 6) {
+ return ItemUtils.getOrePrefixStack(aPrefix, ALLOY.STABALLOY, aAmount);
+ } else if (aTier == 7) {
+ return ItemUtils.getOrePrefixStack(aPrefix, ALLOY.HASTELLOY_X, aAmount);
+ } else if (aTier == 8) {
+ return ItemUtils.getOrePrefixStack(aPrefix, Materials.Ultimate, aAmount);
+ } else if (aTier == 9) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.pipeMedium, Materials.Superconductor, aAmount);
+ } else if (aTier == 10) {
+ return ItemUtils.getOrePrefixStack(aPrefix, Materials.Europium, aAmount);
+ } else {
+ return ItemUtils.getOrePrefixStack(aPrefix, Materials.Titanium, aAmount);
+ }
+ }
+
+ if (aPrefix == OrePrefixes.rod) {
+ aPrefix = OrePrefixes.stick;
+ }
+
+ if (aPrefix == OrePrefixes.gear || aPrefix == OrePrefixes.gearGt) {
+ m = aMaster[0][aTier];
+ } else if (aPrefix == OrePrefixes.rod || aPrefix == OrePrefixes.stick) {
+ m = aMaster[0][aTier];
+ } else if (aPrefix == OrePrefixes.stickLong) {
+ m = aMaster[1][aTier];
+ } else if (aPrefix == OrePrefixes.bolt) {
+ m = aMaster[2][aTier];
+ } else if (aPrefix == OrePrefixes.screw) {
+ m = aMaster[0][aTier];
+ } else if (aPrefix == OrePrefixes.rotor) {
+ m = aMaster[1][aTier];
+ } else if (aPrefix == OrePrefixes.frame || aPrefix == OrePrefixes.frameGt) {
+ m = aMaster[2][aTier];
+ } else if (aPrefix == OrePrefixes.ingot) {
+ m = aMaster[1][aTier];
+ } else if (aPrefix == OrePrefixes.plate) {
+ m = aMaster[0][aTier];
+ } else if (aPrefix == OrePrefixes.plateDouble) {
+ m = aMaster[0][aTier];
+ } else if (aPrefix == OrePrefixes.ring) {
+ m = aMaster[2][aTier];
+ } else if (aPrefix == OrePrefixes.cell) {
+ m = aMaster[1][aTier];
+ } else {
+ m = aMaterial_Main[aTier];
+ }
+
+ ItemStack aReturn = ItemUtils.getOrePrefixStack(aPrefix, m, aAmount);
+
+ // If Invalid, Try First Material
+ if (!ItemUtils.checkForInvalidItems(aReturn)) {
+ m = aMaster[0][aTier];
+ aReturn = ItemUtils.getOrePrefixStack(aPrefix, m, aAmount);
+
+ // If Invalid, Try Second Material
+ if (!ItemUtils.checkForInvalidItems(aReturn)) {
+ m = aMaster[1][aTier];
+ aReturn = ItemUtils.getOrePrefixStack(aPrefix, m, aAmount);
+
+ // If Invalid, Try Third Material
+ if (!ItemUtils.checkForInvalidItems(aReturn)) {
+ m = aMaster[2][aTier];
+ aReturn = ItemUtils.getOrePrefixStack(aPrefix, m, aAmount);
+
+ // All Invalid? Ok, shit.
+ // Let's add a special error ingot.
+ if (!ItemUtils.checkForInvalidItems(aReturn)) {
+ aReturn = ItemUtils.getErrorStack(
+ 1, (aPrefix.toString() + m.getLocalizedName() + " x" + aAmount));
+ }
+ }
+ }
+ }
+
+ return aReturn;
+ }
+
+ public static ItemStack getElectricMotor(int aTier, int aSize) {
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_ULV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricMotor_MAX;
+ } else {
+ aType = CI.electricMotor_LV;
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getFluidRegulator(int aTier, int aSize) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return CI.getElectricPump(aTier, aSize);
+ }
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fluidRegulator_UV;
+ } else {
+ aType = CI.fluidRegulator_LV;
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getElectricPiston(int aTier, int aSize) {
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_ULV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPiston_MAX;
+ } else {
+ aType = CI.electricPiston_LV;
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getElectricPump(int aTier, int aSize) {
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.electricPump_ULV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPump_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPump_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPump_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPump_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPump_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPump_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPump_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPump_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.electricPump_MAX;
+ } else {
+ aType = CI.electricPump_LV;
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getRobotArm(int aTier, int aSize) {
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.robotArm_ULV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.robotArm_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.robotArm_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.robotArm_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.robotArm_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.robotArm_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.robotArm_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.robotArm_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.robotArm_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.robotArm_MAX;
+ } else {
+ aType = CI.robotArm_LV;
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getConveyor(int aTier, int aSize) {
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_ULV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.conveyorModule_MAX;
+ } else {
+ aType = CI.conveyorModule_LV;
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getEmitter(int aTier, int aSize) {
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.emitter_ULV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.emitter_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.emitter_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.emitter_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.emitter_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.emitter_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.emitter_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.emitter_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.emitter_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.emitter_MAX;
+ } else {
+ aType = CI.emitter_LV;
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getSensor(int aTier, int aSize) {
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.sensor_ULV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.sensor_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.sensor_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.sensor_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.sensor_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.sensor_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.sensor_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.sensor_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.sensor_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.sensor_MAX;
+ } else {
+ aType = CI.sensor_LV;
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getFieldGenerator(int aTier, int aSize) {
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_ULV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.fieldGenerator_MAX;
+ } else {
+ aType = CI.fieldGenerator_LV;
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getTieredMachineHull(int aTier, int aSize) {
+ ItemStack aType;
+ int aLazyTier = 0;
+ if (aTier == aLazyTier++) {
+ aType = CI.machineHull_ULV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.machineHull_LV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.machineHull_MV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.machineHull_HV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.machineHull_EV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.machineHull_IV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.machineHull_LuV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.machineHull_ZPM;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.machineHull_UV;
+ } else if (aTier == aLazyTier++) {
+ aType = CI.machineHull_MAX;
+ } else {
+ aType = GregtechItemList.Casing_Multi_Use.get(1, CI.machineHull_MV);
+ }
+ return ItemUtils.getSimpleStack(aType, aSize);
+ }
+
+ public static ItemStack getHeatCoil(int i) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if (i == 1) {
+ return ItemList.Casing_Coil_Kanthal.get(1);
+ } else if (i == 2) {
+ return ItemList.Casing_Coil_Nichrome.get(1);
+ } else {
+ return ItemList.Casing_Coil_Cupronickel.get(1);
+ }
+ } else {
+ if (!CORE.GTNH) {
+ if (i > 6) {
+ i = 6;
+ }
+ } else {
+ if (i > 8) {
+ i = 8;
+ }
+ }
+ return ItemUtils.simpleMetaStack(StaticFields59.getBlockCasings5(), i, 1);
+ }
+ }
+
+ public static ItemStack getNumberedBioCircuit(int i) {
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, i, 0);
+ }
+
+ public static ItemStack getNumberedAdvancedCircuit(int i) {
+ return ItemUtils.simpleMetaStack(GenericChem.mAdvancedCircuit, i, 0);
+ }
+
+ public static ItemStack getTieredGTPPMachineCasing(int aTier, int aAmount) {
+ GregtechItemList[] aHulls = new GregtechItemList[] {
+ GregtechItemList.GTPP_Casing_ULV,
+ GregtechItemList.GTPP_Casing_LV,
+ GregtechItemList.GTPP_Casing_MV,
+ GregtechItemList.GTPP_Casing_HV,
+ GregtechItemList.GTPP_Casing_EV,
+ GregtechItemList.GTPP_Casing_IV,
+ GregtechItemList.GTPP_Casing_LuV,
+ GregtechItemList.GTPP_Casing_ZPM,
+ GregtechItemList.GTPP_Casing_UV,
+ GregtechItemList.GTPP_Casing_MAX
+ };
+ return aHulls[aTier].get(aAmount);
+ }
+
+ public static ItemStack getTieredComponentOfMaterial(Materials aMaterial, OrePrefixes aPrefix, int aAmount) {
+ return ItemUtils.getOrePrefixStack(aPrefix, aMaterial, aAmount);
+ }
+
+ public static ItemStack getTransmissionComponent(int aTier, int aAmount) {
+ GregtechItemList[] aTransParts = new GregtechItemList[] {
+ GregtechItemList.TransmissionComponent_ULV,
+ GregtechItemList.TransmissionComponent_LV,
+ GregtechItemList.TransmissionComponent_MV,
+ GregtechItemList.TransmissionComponent_HV,
+ GregtechItemList.TransmissionComponent_EV,
+ GregtechItemList.TransmissionComponent_IV,
+ GregtechItemList.TransmissionComponent_LuV,
+ GregtechItemList.TransmissionComponent_ZPM,
+ GregtechItemList.TransmissionComponent_UV,
+ GregtechItemList.TransmissionComponent_MAX,
+ };
+ return aTransParts[aTier].get(aAmount);
+ }
+
+ public static ItemStack getEmptyCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 13, aAmount);
+ }
+
+ /**
+ * Aluminium + Silver Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getGreenCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 14, aAmount);
+ }
+
+ /**
+ * Iron + Copper Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getRedCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 0, aAmount);
+ }
+
+ /**
+ * Tungsten + Nickel Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getYellowCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 1, aAmount);
+ }
+
+ /**
+ * Cobalt + Titanium Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getBlueCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 2, aAmount);
+ }
+
+ /**
+ * Vanadium + Palladium Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getOrangeCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 3, aAmount);
+ }
+
+ /**
+ * Iridium + Ruthenium Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getPurpleCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 4, aAmount);
+ }
+
+ /**
+ * Aluminium + Nickel Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getBrownCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 5, aAmount);
+ }
+
+ /**
+ * Platinum + Rhodium Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getPinkCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 6, aAmount);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotAirFilter.java b/src/main/java/gtPlusPlus/core/slots/SlotAirFilter.java
index 92e9bebe21..8ad0b000bc 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotAirFilter.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotAirFilter.java
@@ -7,24 +7,23 @@ import net.minecraft.item.ItemStack;
public class SlotAirFilter extends Slot {
- public SlotAirFilter(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
- }
+ public SlotAirFilter(final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ }
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (itemstack == null) {
- return false;
- }
- if (itemstack.getItem() instanceof ItemAirFilter){
- return true;
- }
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if (itemstack == null) {
+ return false;
+ }
+ if (itemstack.getItem() instanceof ItemAirFilter) {
+ return true;
+ }
+ return false;
+ }
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotBlueprint.java b/src/main/java/gtPlusPlus/core/slots/SlotBlueprint.java
index 532f2f0822..56d39233e7 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotBlueprint.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotBlueprint.java
@@ -1,31 +1,29 @@
package gtPlusPlus.core.slots;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.interfaces.IItemBlueprint;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.interfaces.IItemBlueprint;
-
public class SlotBlueprint extends Slot {
- public SlotBlueprint(final IInventory inventory, final int x, final int y, final int z) {
- super(inventory, x, y, z);
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (itemstack.getItem() instanceof IItemBlueprint) {
- Logger.WARNING(itemstack.getDisplayName() + " is a valid Blueprint.");
- return true;
- }
- Logger.WARNING(itemstack.getDisplayName() + " is not a valid Blueprint.");
- return false;
- }
+ public SlotBlueprint(final IInventory inventory, final int x, final int y, final int z) {
+ super(inventory, x, y, z);
+ }
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if (itemstack.getItem() instanceof IItemBlueprint) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid Blueprint.");
+ return true;
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid Blueprint.");
+ return false;
+ }
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotBuzzSaw.java b/src/main/java/gtPlusPlus/core/slots/SlotBuzzSaw.java
index 94b0b9ecc7..0caee5e6d0 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotBuzzSaw.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotBuzzSaw.java
@@ -1,77 +1,73 @@
package gtPlusPlus.core.slots;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.OrePrefixes;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.common.items.GT_MetaGenerated_Item_02;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
public class SlotBuzzSaw extends Slot {
- public SAWTOOL currentTool = SAWTOOL.NONE;
-
- public SlotBuzzSaw(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
-
- }
+ public SAWTOOL currentTool = SAWTOOL.NONE;
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- boolean isValid = false;
+ public SlotBuzzSaw(final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ }
- if (itemstack != null) {
- if ((itemstack.getItem() instanceof GT_MetaGenerated_Item_02)
- || (itemstack.getItem() instanceof GT_MetaGenerated_Tool)) {
- // Buzzsaw Blade //TODO
- /*
- * if (OrePrefixes.toolHeadBuzzSaw.contains(itemstack)){ isValid
- * = false; }
- */
- if (OrePrefixes.craftingTool.contains(itemstack)) {
- if (itemstack.getDisplayName().toLowerCase().contains("saw")
- || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.10")
- || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.110")
- || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.112")
- || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.114")
- || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.140")) {
- if (itemstack.getItemDamage() == 10) {
- isValid = true;
- this.currentTool = SAWTOOL.SAW;
- }
- else if (itemstack.getItemDamage() == 110) {
- isValid = true;
- this.currentTool = SAWTOOL.CHAINSAW;
- }
- else if (itemstack.getItemDamage() == 112) {
- isValid = true;
- this.currentTool = SAWTOOL.CHAINSAW;
- }
- else if (itemstack.getItemDamage() == 114) {
- isValid = true;
- this.currentTool = SAWTOOL.CHAINSAW;
- }
- else if (itemstack.getItemDamage() == 140) {
- isValid = true;
- this.currentTool = SAWTOOL.BUZZSAW;
- }
- return isValid;
- }
- }
- }
- }
- this.currentTool = SAWTOOL.NONE;
- return isValid;
- }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ boolean isValid = false;
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ if (itemstack != null) {
+ if ((itemstack.getItem() instanceof GT_MetaGenerated_Item_02)
+ || (itemstack.getItem() instanceof GT_MetaGenerated_Tool)) {
+ // Buzzsaw Blade //TODO
+ /*
+ * if (OrePrefixes.toolHeadBuzzSaw.contains(itemstack)){ isValid
+ * = false; }
+ */
+ if (OrePrefixes.craftingTool.contains(itemstack)) {
+ if (itemstack.getDisplayName().toLowerCase().contains("saw")
+ || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.10")
+ || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.110")
+ || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.112")
+ || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.114")
+ || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.140")) {
+ if (itemstack.getItemDamage() == 10) {
+ isValid = true;
+ this.currentTool = SAWTOOL.SAW;
+ } else if (itemstack.getItemDamage() == 110) {
+ isValid = true;
+ this.currentTool = SAWTOOL.CHAINSAW;
+ } else if (itemstack.getItemDamage() == 112) {
+ isValid = true;
+ this.currentTool = SAWTOOL.CHAINSAW;
+ } else if (itemstack.getItemDamage() == 114) {
+ isValid = true;
+ this.currentTool = SAWTOOL.CHAINSAW;
+ } else if (itemstack.getItemDamage() == 140) {
+ isValid = true;
+ this.currentTool = SAWTOOL.BUZZSAW;
+ }
+ return isValid;
+ }
+ }
+ }
+ }
+ this.currentTool = SAWTOOL.NONE;
+ return isValid;
+ }
- public enum SAWTOOL {
- NONE, SAW, BUZZSAW, CHAINSAW
- }
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ public enum SAWTOOL {
+ NONE,
+ SAW,
+ BUZZSAW,
+ CHAINSAW
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/main/java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
index 1029d37a78..4bfda45170 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
@@ -10,36 +10,35 @@ import net.minecraftforge.fluids.FluidStack;
public class SlotChemicalPlantInput extends Slot {
- public SlotChemicalPlantInput(final IInventory inventory, final int index, final int x, final int y) {
- super(inventory, index, x, y);
- }
+ public SlotChemicalPlantInput(final IInventory inventory, final int index, final int x, final int y) {
+ super(inventory, index, x, y);
+ }
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- return isItemValidForChemicalPlantSlot(itemstack);
- }
-
- public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) {
- boolean validItem = GTPP_Recipe_Map.sChemicalPlantRecipes.containsInput(aStack);
- if (!validItem) {
- for (GT_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) {
- if (f.mFluidInputs.length > 0) {
- for (FluidStack g : f.mFluidInputs) {
- if (g != null) {
- if (FluidContainerRegistry.containsFluid(aStack, g)) {
- return true;
- }
- }
- }
- }
- }
- }
- return validItem;
- }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValidForChemicalPlantSlot(itemstack);
+ }
- @Override
- public int getSlotStackLimit() {
- return 64;
- }
+ public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) {
+ boolean validItem = GTPP_Recipe_Map.sChemicalPlantRecipes.containsInput(aStack);
+ if (!validItem) {
+ for (GT_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) {
+ if (f.mFluidInputs.length > 0) {
+ for (FluidStack g : f.mFluidInputs) {
+ if (g != null) {
+ if (FluidContainerRegistry.containsFluid(aStack, g)) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return validItem;
+ }
+ @Override
+ public int getSlotStackLimit() {
+ return 64;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotCrafting.java b/src/main/java/gtPlusPlus/core/slots/SlotCrafting.java
index 42b7b585e2..8d7c0946ec 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotCrafting.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotCrafting.java
@@ -1,7 +1,6 @@
package gtPlusPlus.core.slots;
import cpw.mods.fml.common.FMLCommonHandler;
-
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -9,143 +8,149 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.*;
import net.minecraft.stats.AchievementList;
-
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
public class SlotCrafting extends Slot {
- /** The craft matrix inventory linked to this result slot. */
- private final IInventory craftMatrix;
- /** The player that is using the GUI where this slot resides. */
- private final EntityPlayer thePlayer;
- /**
- * The number of items that have been crafted so far. Gets passed to
- * ItemStack.onCrafting before being reset.
- */
- private int amountCrafted;
- private static final String __OBFID = "CL_00001761";
-
- public SlotCrafting(final EntityPlayer p_i1823_1_, final IInventory p_i1823_2_, final IInventory p_i1823_3_,
- final int p_i1823_4_, final int p_i1823_5_, final int p_i1823_6_) {
- super(p_i1823_3_, p_i1823_4_, p_i1823_5_, p_i1823_6_);
- this.thePlayer = p_i1823_1_;
- this.craftMatrix = p_i1823_2_;
- }
-
- /**
- * Check if the stack is a valid item for this slot. Always true beside for
- * the armor slots.
- */
- @Override
- public boolean isItemValid(final ItemStack p_75214_1_) {
- return false;
- }
-
- /**
- * Decrease the size of the stack in slot (first int arg) by the amount of
- * the second int arg. Returns the new stack.
- */
- @Override
- public ItemStack decrStackSize(final int p_75209_1_) {
- if (this.getHasStack()) {
- this.amountCrafted += Math.min(p_75209_1_, this.getStack().stackSize);
- }
-
- return super.decrStackSize(p_75209_1_);
- }
-
- /**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood. Typically increases an internal count then calls
- * onCrafting(item).
- */
- @Override
- protected void onCrafting(final ItemStack p_75210_1_, final int p_75210_2_) {
- this.amountCrafted += p_75210_2_;
- this.onCrafting(p_75210_1_);
- }
-
- /**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood.
- */
- @Override
- protected void onCrafting(final ItemStack p_75208_1_) {
- p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
- this.amountCrafted = 0;
-
- if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) {
- this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
- }
-
- if (p_75208_1_.getItem() instanceof ItemPickaxe) {
- this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
- }
-
- if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.furnace)) {
- this.thePlayer.addStat(AchievementList.buildFurnace, 1);
- }
-
- if (p_75208_1_.getItem() instanceof ItemHoe) {
- this.thePlayer.addStat(AchievementList.buildHoe, 1);
- }
-
- if (p_75208_1_.getItem() == Items.bread) {
- this.thePlayer.addStat(AchievementList.makeBread, 1);
- }
-
- if (p_75208_1_.getItem() == Items.cake) {
- this.thePlayer.addStat(AchievementList.bakeCake, 1);
- }
-
- if ((p_75208_1_.getItem() instanceof ItemPickaxe)
- && (((ItemPickaxe) p_75208_1_.getItem()).func_150913_i() != Item.ToolMaterial.WOOD)) {
- this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
- }
-
- if (p_75208_1_.getItem() instanceof ItemSword) {
- this.thePlayer.addStat(AchievementList.buildSword, 1);
- }
-
- if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) {
- this.thePlayer.addStat(AchievementList.enchantments, 1);
- }
-
- if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) {
- this.thePlayer.addStat(AchievementList.bookcase, 1);
- }
- }
-
- @Override
- public void onPickupFromSlot(final EntityPlayer p_82870_1_, final ItemStack p_82870_2_) {
- FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, this.craftMatrix);
- this.onCrafting(p_82870_2_);
-
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) {
- final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
-
- if (itemstack1 != null) {
- this.craftMatrix.decrStackSize(i, 1);
-
- if (itemstack1.getItem().hasContainerItem(itemstack1)) {
- final ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
-
- if ((itemstack2 != null) && itemstack2.isItemStackDamageable()
- && (itemstack2.getItemDamage() > itemstack2.getMaxDamage())) {
- MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2));
- continue;
- }
-
- if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1)
- || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) {
- if (this.craftMatrix.getStackInSlot(i) == null) {
- this.craftMatrix.setInventorySlotContents(i, itemstack2);
- } else {
- this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false);
- }
- }
- }
- }
- }
- }
-} \ No newline at end of file
+ /** The craft matrix inventory linked to this result slot. */
+ private final IInventory craftMatrix;
+ /** The player that is using the GUI where this slot resides. */
+ private final EntityPlayer thePlayer;
+ /**
+ * The number of items that have been crafted so far. Gets passed to
+ * ItemStack.onCrafting before being reset.
+ */
+ private int amountCrafted;
+
+ private static final String __OBFID = "CL_00001761";
+
+ public SlotCrafting(
+ final EntityPlayer p_i1823_1_,
+ final IInventory p_i1823_2_,
+ final IInventory p_i1823_3_,
+ final int p_i1823_4_,
+ final int p_i1823_5_,
+ final int p_i1823_6_) {
+ super(p_i1823_3_, p_i1823_4_, p_i1823_5_, p_i1823_6_);
+ this.thePlayer = p_i1823_1_;
+ this.craftMatrix = p_i1823_2_;
+ }
+
+ /**
+ * Check if the stack is a valid item for this slot. Always true beside for
+ * the armor slots.
+ */
+ @Override
+ public boolean isItemValid(final ItemStack p_75214_1_) {
+ return false;
+ }
+
+ /**
+ * Decrease the size of the stack in slot (first int arg) by the amount of
+ * the second int arg. Returns the new stack.
+ */
+ @Override
+ public ItemStack decrStackSize(final int p_75209_1_) {
+ if (this.getHasStack()) {
+ this.amountCrafted += Math.min(p_75209_1_, this.getStack().stackSize);
+ }
+
+ return super.decrStackSize(p_75209_1_);
+ }
+
+ /**
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
+ * not ore and wood. Typically increases an internal count then calls
+ * onCrafting(item).
+ */
+ @Override
+ protected void onCrafting(final ItemStack p_75210_1_, final int p_75210_2_) {
+ this.amountCrafted += p_75210_2_;
+ this.onCrafting(p_75210_1_);
+ }
+
+ /**
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
+ * not ore and wood.
+ */
+ @Override
+ protected void onCrafting(final ItemStack p_75208_1_) {
+ p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
+ this.amountCrafted = 0;
+
+ if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) {
+ this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
+ }
+
+ if (p_75208_1_.getItem() instanceof ItemPickaxe) {
+ this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
+ }
+
+ if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.furnace)) {
+ this.thePlayer.addStat(AchievementList.buildFurnace, 1);
+ }
+
+ if (p_75208_1_.getItem() instanceof ItemHoe) {
+ this.thePlayer.addStat(AchievementList.buildHoe, 1);
+ }
+
+ if (p_75208_1_.getItem() == Items.bread) {
+ this.thePlayer.addStat(AchievementList.makeBread, 1);
+ }
+
+ if (p_75208_1_.getItem() == Items.cake) {
+ this.thePlayer.addStat(AchievementList.bakeCake, 1);
+ }
+
+ if ((p_75208_1_.getItem() instanceof ItemPickaxe)
+ && (((ItemPickaxe) p_75208_1_.getItem()).func_150913_i() != Item.ToolMaterial.WOOD)) {
+ this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
+ }
+
+ if (p_75208_1_.getItem() instanceof ItemSword) {
+ this.thePlayer.addStat(AchievementList.buildSword, 1);
+ }
+
+ if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) {
+ this.thePlayer.addStat(AchievementList.enchantments, 1);
+ }
+
+ if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) {
+ this.thePlayer.addStat(AchievementList.bookcase, 1);
+ }
+ }
+
+ @Override
+ public void onPickupFromSlot(final EntityPlayer p_82870_1_, final ItemStack p_82870_2_) {
+ FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, this.craftMatrix);
+ this.onCrafting(p_82870_2_);
+
+ for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) {
+ final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
+
+ if (itemstack1 != null) {
+ this.craftMatrix.decrStackSize(i, 1);
+
+ if (itemstack1.getItem().hasContainerItem(itemstack1)) {
+ final ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
+
+ if ((itemstack2 != null)
+ && itemstack2.isItemStackDamageable()
+ && (itemstack2.getItemDamage() > itemstack2.getMaxDamage())) {
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2));
+ continue;
+ }
+
+ if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1)
+ || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) {
+ if (this.craftMatrix.getStackInSlot(i) == null) {
+ this.craftMatrix.setInventorySlotContents(i, itemstack2);
+ } else {
+ this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false);
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java b/src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java
index 3608c3724c..cf96dd69e2 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java
@@ -1,7 +1,6 @@
package gtPlusPlus.core.slots;
import cpw.mods.fml.common.FMLCommonHandler;
-
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -10,138 +9,138 @@ import net.minecraft.item.*;
import net.minecraft.stats.AchievementList;
public class SlotCraftingNoCollect extends SlotCrafting {
- /** The craft matrix inventory linked to this result slot. */
- private final IInventory craftMatrix;
- /** The player that is using the GUI where this slot resides. */
- private EntityPlayer thePlayer;
- /**
- * The number of items that have been crafted so far. Gets passed to
- * ItemStack.onCrafting before being reset.
- */
- private int amountCrafted;
-
- public SlotCraftingNoCollect(EntityPlayer player, IInventory inventory, IInventory inventory2, int x, int y,
- int z) {
- super(player, inventory, inventory2, x, y, z);
- this.thePlayer = player;
- this.craftMatrix = inventory;
- }
-
- /**
- * Check if the stack is a valid item for this slot. Always true beside for
- * the armor slots.
- */
- @Override
- public boolean isItemValid(ItemStack p_75214_1_) {
- return false;
- }
-
- /**
- * Decrease the size of the stack in slot (first int arg) by the amount of
- * the second int arg. Returns the new stack.
- */
- @Override
- public ItemStack decrStackSize(int amount) {
- if (this.getHasStack()) {
- this.amountCrafted += Math.min(amount, this.getStack().stackSize);
- }
-
- return super.decrStackSize(amount);
- }
-
- /**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood. Typically increases an internal count then calls
- * onCrafting(item).
- */
- @Override
- protected void onCrafting(ItemStack output, int amount) {
- this.amountCrafted += amount;
- this.onCrafting(output);
- }
-
- /**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood.
- */
- @Override
- protected void onCrafting(ItemStack output) {
- output.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
- this.amountCrafted = 0;
-
- if (output.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) {
- this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
- }
-
- if (output.getItem() instanceof ItemPickaxe) {
- this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
- }
-
- if (output.getItem() == Item.getItemFromBlock(Blocks.furnace)) {
- this.thePlayer.addStat(AchievementList.buildFurnace, 1);
- }
-
- if (output.getItem() instanceof ItemHoe) {
- this.thePlayer.addStat(AchievementList.buildHoe, 1);
- }
-
- if (output.getItem() == Items.bread) {
- this.thePlayer.addStat(AchievementList.makeBread, 1);
- }
-
- if (output.getItem() == Items.cake) {
- this.thePlayer.addStat(AchievementList.bakeCake, 1);
- }
-
- if (output.getItem() instanceof ItemPickaxe
- && ((ItemPickaxe) output.getItem()).func_150913_i() != Item.ToolMaterial.WOOD) {
- this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
- }
-
- if (output.getItem() instanceof ItemSword) {
- this.thePlayer.addStat(AchievementList.buildSword, 1);
- }
-
- if (output.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) {
- this.thePlayer.addStat(AchievementList.enchantments, 1);
- }
-
- if (output.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) {
- this.thePlayer.addStat(AchievementList.bookcase, 1);
- }
- }
-
- @Override
- public void onPickupFromSlot(EntityPlayer player, ItemStack output) {
- FMLCommonHandler.instance().firePlayerCraftingEvent(player, output, craftMatrix);
- this.onCrafting(output);
-
- /*
- * for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) {
- * ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
- *
- * if (itemstack1 != null) { this.craftMatrix.decrStackSize(i, 1);
- *
- * if (itemstack1.getItem().hasContainerItem(itemstack1)) { ItemStack
- * itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
- *
- * if (itemstack2 != null && itemstack2.isItemStackDamageable() &&
- * itemstack2.getItemDamage() > itemstack2.getMaxDamage()) {
- * MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer,
- * itemstack2)); continue; }
- *
- * if
- * (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1)
- * || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) {
- * if (this.craftMatrix.getStackInSlot(i) == null) {
- * this.craftMatrix.setInventorySlotContents(i, itemstack2); } else {
- * this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false); } }
- * } } }
- */
- }
-
- @Override
- public boolean canTakeStack(EntityPlayer player) {
- return false;
- }
-} \ No newline at end of file
+ /** The craft matrix inventory linked to this result slot. */
+ private final IInventory craftMatrix;
+ /** The player that is using the GUI where this slot resides. */
+ private EntityPlayer thePlayer;
+ /**
+ * The number of items that have been crafted so far. Gets passed to
+ * ItemStack.onCrafting before being reset.
+ */
+ private int amountCrafted;
+
+ public SlotCraftingNoCollect(
+ EntityPlayer player, IInventory inventory, IInventory inventory2, int x, int y, int z) {
+ super(player, inventory, inventory2, x, y, z);
+ this.thePlayer = player;
+ this.craftMatrix = inventory;
+ }
+
+ /**
+ * Check if the stack is a valid item for this slot. Always true beside for
+ * the armor slots.
+ */
+ @Override
+ public boolean isItemValid(ItemStack p_75214_1_) {
+ return false;
+ }
+
+ /**
+ * Decrease the size of the stack in slot (first int arg) by the amount of
+ * the second int arg. Returns the new stack.
+ */
+ @Override
+ public ItemStack decrStackSize(int amount) {
+ if (this.getHasStack()) {
+ this.amountCrafted += Math.min(amount, this.getStack().stackSize);
+ }
+
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
+ * not ore and wood. Typically increases an internal count then calls
+ * onCrafting(item).
+ */
+ @Override
+ protected void onCrafting(ItemStack output, int amount) {
+ this.amountCrafted += amount;
+ this.onCrafting(output);
+ }
+
+ /**
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
+ * not ore and wood.
+ */
+ @Override
+ protected void onCrafting(ItemStack output) {
+ output.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
+ this.amountCrafted = 0;
+
+ if (output.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) {
+ this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
+ }
+
+ if (output.getItem() instanceof ItemPickaxe) {
+ this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
+ }
+
+ if (output.getItem() == Item.getItemFromBlock(Blocks.furnace)) {
+ this.thePlayer.addStat(AchievementList.buildFurnace, 1);
+ }
+
+ if (output.getItem() instanceof ItemHoe) {
+ this.thePlayer.addStat(AchievementList.buildHoe, 1);
+ }
+
+ if (output.getItem() == Items.bread) {
+ this.thePlayer.addStat(AchievementList.makeBread, 1);
+ }
+
+ if (output.getItem() == Items.cake) {
+ this.thePlayer.addStat(AchievementList.bakeCake, 1);
+ }
+
+ if (output.getItem() instanceof ItemPickaxe
+ && ((ItemPickaxe) output.getItem()).func_150913_i() != Item.ToolMaterial.WOOD) {
+ this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
+ }
+
+ if (output.getItem() instanceof ItemSword) {
+ this.thePlayer.addStat(AchievementList.buildSword, 1);
+ }
+
+ if (output.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) {
+ this.thePlayer.addStat(AchievementList.enchantments, 1);
+ }
+
+ if (output.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) {
+ this.thePlayer.addStat(AchievementList.bookcase, 1);
+ }
+ }
+
+ @Override
+ public void onPickupFromSlot(EntityPlayer player, ItemStack output) {
+ FMLCommonHandler.instance().firePlayerCraftingEvent(player, output, craftMatrix);
+ this.onCrafting(output);
+
+ /*
+ * for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) {
+ * ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
+ *
+ * if (itemstack1 != null) { this.craftMatrix.decrStackSize(i, 1);
+ *
+ * if (itemstack1.getItem().hasContainerItem(itemstack1)) { ItemStack
+ * itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
+ *
+ * if (itemstack2 != null && itemstack2.isItemStackDamageable() &&
+ * itemstack2.getItemDamage() > itemstack2.getMaxDamage()) {
+ * MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer,
+ * itemstack2)); continue; }
+ *
+ * if
+ * (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1)
+ * || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) {
+ * if (this.craftMatrix.getStackInSlot(i) == null) {
+ * this.craftMatrix.setInventorySlotContents(i, itemstack2); } else {
+ * this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false); } }
+ * } } }
+ */
+ }
+
+ @Override
+ public boolean canTakeStack(EntityPlayer player) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotDataStick.java b/src/main/java/gtPlusPlus/core/slots/SlotDataStick.java
index ce97a2fdbf..69feaa3384 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotDataStick.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotDataStick.java
@@ -1,42 +1,41 @@
package gtPlusPlus.core.slots;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.recipe.common.CI;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.recipe.common.CI;
-
public class SlotDataStick extends Slot {
- public SlotDataStick(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
+ public SlotDataStick(final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ }
- }
+ public static ItemStack[] mDataItems = new ItemStack[2];
- public static ItemStack[] mDataItems = new ItemStack[2];
-
- @Override
- public synchronized boolean isItemValid(final ItemStack itemstack) {
- boolean isValid = false;
- if (itemstack != null) {
- if (mDataItems[0] == null) {
- mDataItems[0] = CI.getDataStick();
- }
- if (mDataItems[1] == null) {
- mDataItems[1] = CI.getDataOrb();
- }
- if (mDataItems[0] != null && mDataItems[1] != null) {
- if (GT_Utility.areStacksEqual(itemstack, mDataItems[0], true) || GT_Utility.areStacksEqual(itemstack, mDataItems[1], true) ) {
- isValid = true;
- }
- }
- }
- return isValid;
- }
+ @Override
+ public synchronized boolean isItemValid(final ItemStack itemstack) {
+ boolean isValid = false;
+ if (itemstack != null) {
+ if (mDataItems[0] == null) {
+ mDataItems[0] = CI.getDataStick();
+ }
+ if (mDataItems[1] == null) {
+ mDataItems[1] = CI.getDataOrb();
+ }
+ if (mDataItems[0] != null && mDataItems[1] != null) {
+ if (GT_Utility.areStacksEqual(itemstack, mDataItems[0], true)
+ || GT_Utility.areStacksEqual(itemstack, mDataItems[1], true)) {
+ isValid = true;
+ }
+ }
+ }
+ return isValid;
+ }
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotElectric.java b/src/main/java/gtPlusPlus/core/slots/SlotElectric.java
index a747432a74..9c14afc6cc 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotElectric.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotElectric.java
@@ -1,45 +1,48 @@
package gtPlusPlus.core.slots;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_MetaGenerated_Tool;
-
import ic2.api.info.Info;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
public class SlotElectric extends Slot {
-
- public SlotElectric(final IInventory inventory, final int x, final int y, final int z) {
- super(inventory, x, y, z);
- }
-
- public SlotElectric(IGregTechTileEntity mTileEntity, int i, int j, int k) {
- this(mTileEntity.getIInventory(mTileEntity.getXCoord(), mTileEntity.getYCoord(), mTileEntity.getZCoord()), i, j, k);
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if ((accepts(itemstack)) || (itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof IElectricItem)) {
- return true;
- }
- return false;
- }
-
- public boolean accepts(final ItemStack stack) {
- if (stack == null) {
- return false;
- }
- return (Info.itemEnergy.getEnergyValue(stack) > 0.0D)
- || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), 4, true, true, true) > 0.0D);
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ public SlotElectric(final IInventory inventory, final int x, final int y, final int z) {
+ super(inventory, x, y, z);
+ }
+
+ public SlotElectric(IGregTechTileEntity mTileEntity, int i, int j, int k) {
+ this(
+ mTileEntity.getIInventory(mTileEntity.getXCoord(), mTileEntity.getYCoord(), mTileEntity.getZCoord()),
+ i,
+ j,
+ k);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if ((accepts(itemstack))
+ || (itemstack.getItem() instanceof GT_MetaGenerated_Tool)
+ || (itemstack.getItem() instanceof IElectricItem)) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean accepts(final ItemStack stack) {
+ if (stack == null) {
+ return false;
+ }
+ return (Info.itemEnergy.getEnergyValue(stack) > 0.0D)
+ || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), 4, true, true, true) > 0.0D);
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotFrame.java b/src/main/java/gtPlusPlus/core/slots/SlotFrame.java
index 4168ded5bc..593ec747e8 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotFrame.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotFrame.java
@@ -1,26 +1,23 @@
package gtPlusPlus.core.slots;
+import forestry.api.apiculture.IHiveFrame;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import forestry.api.apiculture.IHiveFrame;
-
public class SlotFrame extends Slot {
- public SlotFrame(final IInventory inventory, final int x, final int y, final int z) {
- super(inventory, x, y, z);
-
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- return itemstack.getItem() instanceof IHiveFrame;
- }
+ public SlotFrame(final IInventory inventory, final int x, final int y, final int z) {
+ super(inventory, x, y, z);
+ }
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return itemstack.getItem() instanceof IHiveFrame;
+ }
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotFuelRod.java b/src/main/java/gtPlusPlus/core/slots/SlotFuelRod.java
index b50b679665..18c5878e35 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotFuelRod.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotFuelRod.java
@@ -1,55 +1,51 @@
package gtPlusPlus.core.slots;
+import gregtech.api.enums.ItemList;
+import ic2.core.Ic2Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import gregtech.api.enums.ItemList;
-
-import ic2.core.Ic2Items;
-
public class SlotFuelRod extends Slot {
- public SlotFuelRod(final IInventory inventory, final int index, final int x, final int y) {
- super(inventory, index, x, y);
-
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- boolean returnValue = false;
- // Uranium Rods
- if (itemstack.getItem() == Ic2Items.reactorUraniumSimple.getItem()) {
- returnValue = true;
- } else if (itemstack.getItem() == Ic2Items.reactorUraniumDual.getItem()) {
- returnValue = true;
- } else if (itemstack.getItem() == Ic2Items.reactorUraniumQuad.getItem()) {
- returnValue = true;
- }
-
- // Mox Rods
- if (itemstack.getItem() == Ic2Items.reactorMOXSimple.getItem()) {
- returnValue = true;
- } else if (itemstack.getItem() == Ic2Items.reactorMOXDual.getItem()) {
- returnValue = true;
- } else if (itemstack.getItem() == Ic2Items.reactorMOXQuad.getItem()) {
- returnValue = true;
- }
-
- // Thorium Rods
- if (itemstack.getItem() == ItemList.ThoriumCell_1.getItem()) {
- returnValue = true;
- } else if (itemstack.getItem() == ItemList.ThoriumCell_2.getItem()) {
- returnValue = true;
- } else if (itemstack.getItem() == ItemList.ThoriumCell_4.getItem()) {
- returnValue = true;
- }
- return returnValue;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
-
+ public SlotFuelRod(final IInventory inventory, final int index, final int x, final int y) {
+ super(inventory, index, x, y);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ boolean returnValue = false;
+ // Uranium Rods
+ if (itemstack.getItem() == Ic2Items.reactorUraniumSimple.getItem()) {
+ returnValue = true;
+ } else if (itemstack.getItem() == Ic2Items.reactorUraniumDual.getItem()) {
+ returnValue = true;
+ } else if (itemstack.getItem() == Ic2Items.reactorUraniumQuad.getItem()) {
+ returnValue = true;
+ }
+
+ // Mox Rods
+ if (itemstack.getItem() == Ic2Items.reactorMOXSimple.getItem()) {
+ returnValue = true;
+ } else if (itemstack.getItem() == Ic2Items.reactorMOXDual.getItem()) {
+ returnValue = true;
+ } else if (itemstack.getItem() == Ic2Items.reactorMOXQuad.getItem()) {
+ returnValue = true;
+ }
+
+ // Thorium Rods
+ if (itemstack.getItem() == ItemList.ThoriumCell_1.getItem()) {
+ returnValue = true;
+ } else if (itemstack.getItem() == ItemList.ThoriumCell_2.getItem()) {
+ returnValue = true;
+ } else if (itemstack.getItem() == ItemList.ThoriumCell_4.getItem()) {
+ returnValue = true;
+ }
+ return returnValue;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotGeneric.java b/src/main/java/gtPlusPlus/core/slots/SlotGeneric.java
index 533539d914..bfb384efe8 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotGeneric.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotGeneric.java
@@ -6,18 +6,17 @@ import net.minecraft.item.ItemStack;
public class SlotGeneric extends Slot {
- public SlotGeneric(final IInventory inventory, final int aSlotID, final int x, final int y) {
- super(inventory, aSlotID, x, y);
- }
+ public SlotGeneric(final IInventory inventory, final int aSlotID, final int x, final int y) {
+ super(inventory, aSlotID, x, y);
+ }
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- return true;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 64;
- }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return true;
+ }
+ @Override
+ public int getSlotStackLimit() {
+ return 64;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotGtTool.java b/src/main/java/gtPlusPlus/core/slots/SlotGtTool.java
index 54e25362db..ea2d8f3a93 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotGtTool.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotGtTool.java
@@ -1,33 +1,29 @@
package gtPlusPlus.core.slots;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gtPlusPlus.api.objects.Logger;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-
-import gtPlusPlus.api.objects.Logger;
-
public class SlotGtTool extends Slot {
- public SlotGtTool(final IInventory inventory, final int x, final int y, final int z) {
- super(inventory, x, y, z);
-
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) {
- Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool.");
- return true;
- }
- Logger.WARNING(itemstack.getDisplayName() + " is not a valid Tool.");
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
-
+ public SlotGtTool(final IInventory inventory, final int x, final int y, final int z) {
+ super(inventory, x, y, z);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool.");
+ return true;
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid Tool.");
+ return false;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotGtToolElectric.java b/src/main/java/gtPlusPlus/core/slots/SlotGtToolElectric.java
index c0e3340769..c7013660dc 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotGtToolElectric.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotGtToolElectric.java
@@ -1,94 +1,95 @@
package gtPlusPlus.core.slots;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.items.GT_MetaGenerated_Tool;
-
import gtPlusPlus.api.objects.Logger;
import ic2.api.info.Info;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
+import net.minecraft.init.Items;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
public class SlotGtToolElectric extends SlotGtTool {
- public int tier;
- private ItemStack content;
-
- public SlotGtToolElectric(final IInventory base, final int x, final int y, final int z, final int tier,
- final boolean allowRedstoneDust) {
- super(base, x, y, z);
- this.tier = tier;
- this.allowRedstoneDust = allowRedstoneDust;
- }
-
- public boolean accepts(final ItemStack stack) {
- if (stack == null) {
- return false;
- }
- if ((stack.getItem() == Items.redstone) && (!this.allowRedstoneDust)) {
- return false;
- }
- return (Info.itemEnergy.getEnergyValue(stack) > 0.0D)
- || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), this.tier, true, true, true) > 0.0D);
- }
-
- public double discharge(final double amount, final boolean ignoreLimit) {
- if (amount <= 0.0D) {
- throw new IllegalArgumentException("Amount must be > 0.");
- }
- final ItemStack stack = this.get(0);
- if (stack == null) {
- return 0.0D;
- }
- 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 -= 1;
- if (stack.stackSize <= 0) {
- this.put(0, null);
- }
- }
- return realAmount;
- }
-
- public void setTier(final int tier1) {
- this.tier = tier1;
- }
-
- public boolean allowRedstoneDust = true;
-
- public ItemStack get() {
- return this.get(0);
- }
-
- public ItemStack get(final int index) {
- return this.content;
- }
-
- public void put(final ItemStack content) {
- this.put(0, content);
- }
-
- public void put(final int index, final ItemStack content) {
- this.content = content;
- this.onChanged();
- }
-
- public void onChanged() {
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if ((itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof IElectricItem)) {
- Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool.");
- return true;
- }
- Logger.WARNING(itemstack.getDisplayName() + " is not a valid Tool.");
- return false;
- }
-
+ public int tier;
+ private ItemStack content;
+
+ public SlotGtToolElectric(
+ final IInventory base,
+ final int x,
+ final int y,
+ final int z,
+ final int tier,
+ final boolean allowRedstoneDust) {
+ super(base, x, y, z);
+ this.tier = tier;
+ this.allowRedstoneDust = allowRedstoneDust;
+ }
+
+ public boolean accepts(final ItemStack stack) {
+ if (stack == null) {
+ return false;
+ }
+ if ((stack.getItem() == Items.redstone) && (!this.allowRedstoneDust)) {
+ return false;
+ }
+ return (Info.itemEnergy.getEnergyValue(stack) > 0.0D)
+ || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), this.tier, true, true, true) > 0.0D);
+ }
+
+ public double discharge(final double amount, final boolean ignoreLimit) {
+ if (amount <= 0.0D) {
+ throw new IllegalArgumentException("Amount must be > 0.");
+ }
+ final ItemStack stack = this.get(0);
+ if (stack == null) {
+ return 0.0D;
+ }
+ 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 -= 1;
+ if (stack.stackSize <= 0) {
+ this.put(0, null);
+ }
+ }
+ return realAmount;
+ }
+
+ public void setTier(final int tier1) {
+ this.tier = tier1;
+ }
+
+ public boolean allowRedstoneDust = true;
+
+ public ItemStack get() {
+ return this.get(0);
+ }
+
+ public ItemStack get(final int index) {
+ return this.content;
+ }
+
+ public void put(final ItemStack content) {
+ this.put(0, content);
+ }
+
+ public void put(final int index, final ItemStack content) {
+ this.content = content;
+ this.onChanged();
+ }
+
+ public void onChanged() {}
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if ((itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof IElectricItem)) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool.");
+ return true;
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid Tool.");
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java b/src/main/java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java
index 8c8a118abb..702f678804 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java
@@ -1,105 +1,104 @@
package gtPlusPlus.core.slots;
+import gtPlusPlus.core.recipe.common.CI;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.recipe.common.CI;
-
public class SlotIntegratedCircuit extends Slot {
- public static Item mCircuitItem;
- public static Item mCircuitItem2;
- public static Item mCircuitItem3;
- private final short mCircuitLock;
+ public static Item mCircuitItem;
+ public static Item mCircuitItem2;
+ public static Item mCircuitItem3;
+ private final short mCircuitLock;
- public SlotIntegratedCircuit(final IInventory inventory, final int slot, final int x, final int y) {
- this(Short.MAX_VALUE+1, inventory, slot, x, y);
- }
+ public SlotIntegratedCircuit(final IInventory inventory, final int slot, final int x, final int y) {
+ this(Short.MAX_VALUE + 1, inventory, slot, x, y);
+ }
- public SlotIntegratedCircuit(int mTypeLock, final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
- if (mTypeLock > Short.MAX_VALUE || mTypeLock < Short.MIN_VALUE) {
- mCircuitLock = -1;
- }
- else {
- mCircuitLock = (short) mTypeLock;
- }
- }
+ public SlotIntegratedCircuit(int mTypeLock, final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ if (mTypeLock > Short.MAX_VALUE || mTypeLock < Short.MIN_VALUE) {
+ mCircuitLock = -1;
+ } else {
+ mCircuitLock = (short) mTypeLock;
+ }
+ }
- @Override
- public synchronized boolean isItemValid(final ItemStack itemstack) {
- return isItemValidForSlot(mCircuitLock, itemstack);
- }
+ @Override
+ public synchronized boolean isItemValid(final ItemStack itemstack) {
+ return isItemValidForSlot(mCircuitLock, itemstack);
+ }
- public static synchronized boolean isItemValidForSlot(final ItemStack itemstack) {
- return isItemValidForSlot(-1, itemstack);
- }
+ public static synchronized boolean isItemValidForSlot(final ItemStack itemstack) {
+ return isItemValidForSlot(-1, itemstack);
+ }
- public static synchronized boolean isItemValidForSlot(int aLockedCircuitNumber, final ItemStack itemstack) {
- boolean isValid = false;
- if (mCircuitItem == null) {
- mCircuitItem = CI.getNumberedCircuit(0).getItem();
- }
- if (mCircuitItem2 == null) {
- mCircuitItem2 = CI.getNumberedBioCircuit(0).getItem();
- }
- if (mCircuitItem3 == null) {
- mCircuitItem3 = CI.getNumberedAdvancedCircuit(0).getItem();
- }
- if (mCircuitItem != null && mCircuitItem2 != null && mCircuitItem3 != null) {
- if (itemstack != null) {
- if (itemstack.getItem() == mCircuitItem || itemstack.getItem() == mCircuitItem2 || itemstack.getItem() == mCircuitItem3) {
- if (aLockedCircuitNumber == -1) {
- isValid = true;
- }
- else {
- if (itemstack.getItemDamage() == aLockedCircuitNumber) {
- isValid = true;
- }
- }
- }
- }
- }
- return isValid;
- }
+ public static synchronized boolean isItemValidForSlot(int aLockedCircuitNumber, final ItemStack itemstack) {
+ boolean isValid = false;
+ if (mCircuitItem == null) {
+ mCircuitItem = CI.getNumberedCircuit(0).getItem();
+ }
+ if (mCircuitItem2 == null) {
+ mCircuitItem2 = CI.getNumberedBioCircuit(0).getItem();
+ }
+ if (mCircuitItem3 == null) {
+ mCircuitItem3 = CI.getNumberedAdvancedCircuit(0).getItem();
+ }
+ if (mCircuitItem != null && mCircuitItem2 != null && mCircuitItem3 != null) {
+ if (itemstack != null) {
+ if (itemstack.getItem() == mCircuitItem
+ || itemstack.getItem() == mCircuitItem2
+ || itemstack.getItem() == mCircuitItem3) {
+ if (aLockedCircuitNumber == -1) {
+ isValid = true;
+ } else {
+ if (itemstack.getItemDamage() == aLockedCircuitNumber) {
+ isValid = true;
+ }
+ }
+ }
+ }
+ }
+ return isValid;
+ }
- /**
- * Returns the circuit type. -1 is invalid, 0 is standard, 1 is GT++ bio.
- * @param itemstack - the Circuit Stack.
- * @return
- */
- public static synchronized int isRegularProgrammableCircuit(final ItemStack itemstack) {
- if (mCircuitItem == null) {
- mCircuitItem = CI.getNumberedCircuit(0).getItem();
- }
- if (mCircuitItem2 == null) {
- mCircuitItem2 = CI.getNumberedBioCircuit(0).getItem();
- }
- if (mCircuitItem3 == null) {
- mCircuitItem3 = CI.getNumberedAdvancedCircuit(0).getItem();
- }
- if (mCircuitItem != null && mCircuitItem2 != null && mCircuitItem3 != null) {
- if (itemstack != null) {
- if (itemstack.getItem() == mCircuitItem || itemstack.getItem() == mCircuitItem2 || itemstack.getItem() == mCircuitItem3) {
- if (itemstack.getItem() == mCircuitItem) {
- return 0;
- }
- else if (itemstack.getItem() == mCircuitItem2) {
- return 1;
- }
- else if (itemstack.getItem() == mCircuitItem3) {
- return 2;
- }
- }
- }
- }
- return -1;
- }
+ /**
+ * Returns the circuit type. -1 is invalid, 0 is standard, 1 is GT++ bio.
+ * @param itemstack - the Circuit Stack.
+ * @return
+ */
+ public static synchronized int isRegularProgrammableCircuit(final ItemStack itemstack) {
+ if (mCircuitItem == null) {
+ mCircuitItem = CI.getNumberedCircuit(0).getItem();
+ }
+ if (mCircuitItem2 == null) {
+ mCircuitItem2 = CI.getNumberedBioCircuit(0).getItem();
+ }
+ if (mCircuitItem3 == null) {
+ mCircuitItem3 = CI.getNumberedAdvancedCircuit(0).getItem();
+ }
+ if (mCircuitItem != null && mCircuitItem2 != null && mCircuitItem3 != null) {
+ if (itemstack != null) {
+ if (itemstack.getItem() == mCircuitItem
+ || itemstack.getItem() == mCircuitItem2
+ || itemstack.getItem() == mCircuitItem3) {
+ if (itemstack.getItem() == mCircuitItem) {
+ return 0;
+ } else if (itemstack.getItem() == mCircuitItem2) {
+ return 1;
+ } else if (itemstack.getItem() == mCircuitItem3) {
+ return 2;
+ }
+ }
+ }
+ }
+ return -1;
+ }
- @Override
- public int getSlotStackLimit() {
- return 64;
- }
+ @Override
+ public int getSlotStackLimit() {
+ return 64;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java b/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
index 3aa551f966..7711858dae 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
@@ -1,26 +1,25 @@
package gtPlusPlus.core.slots;
+import gtPlusPlus.core.item.base.BaseItemBackpack;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.item.base.BaseItemBackpack;
-
public class SlotItemBackpackInv extends Slot {
- public SlotItemBackpackInv(final IInventory inv, final int index, final int xPos, final int yPos) {
- super(inv, index, xPos, yPos);
- }
+ public SlotItemBackpackInv(final IInventory inv, final int index, final int xPos, final int yPos) {
+ super(inv, index, xPos, yPos);
+ }
- // This is the only method we need to override so that
- // we can't place our inventory-storing Item within
- // its own inventory (thus making it permanently inaccessible)
- // as well as preventing abuse of storing backpacks within backpacks
- /**
- * Check if the stack is a valid item for this slot.
- */
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- // Everything returns true except an instance of our Item
- return !(itemstack.getItem() instanceof BaseItemBackpack);
- }
-} \ No newline at end of file
+ // This is the only method we need to override so that
+ // we can't place our inventory-storing Item within
+ // its own inventory (thus making it permanently inaccessible)
+ // as well as preventing abuse of storing backpacks within backpacks
+ /**
+ * Check if the stack is a valid item for this slot.
+ */
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ // Everything returns true except an instance of our Item
+ return !(itemstack.getItem() instanceof BaseItemBackpack);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotJukebox.java b/src/main/java/gtPlusPlus/core/slots/SlotJukebox.java
index 0f8af988a1..1351e5c188 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotJukebox.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotJukebox.java
@@ -7,31 +7,29 @@ import net.minecraft.item.ItemStack;
public class SlotJukebox extends SlotGeneric {
- private final boolean isDisplay;
-
-
- public SlotJukebox(IInventory inventory, int x, int y, int z) {
- this(inventory, x, y, z, false);
- }
-
- public SlotJukebox(IInventory inventory, int x, int y, int z, boolean display) {
- super(inventory, x, y, z);
- isDisplay = display;
- }
-
- @Override
- public boolean isItemValid(ItemStack itemstack) {
- return (itemstack != null && itemstack.getItem() instanceof ItemRecord);
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
-
- @Override
- public boolean canTakeStack(EntityPlayer p_82869_1_) {
- return !isDisplay;
- }
-
+ private final boolean isDisplay;
+
+ public SlotJukebox(IInventory inventory, int x, int y, int z) {
+ this(inventory, x, y, z, false);
+ }
+
+ public SlotJukebox(IInventory inventory, int x, int y, int z, boolean display) {
+ super(inventory, x, y, z);
+ isDisplay = display;
+ }
+
+ @Override
+ public boolean isItemValid(ItemStack itemstack) {
+ return (itemstack != null && itemstack.getItem() instanceof ItemRecord);
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+ @Override
+ public boolean canTakeStack(EntityPlayer p_82869_1_) {
+ return !isDisplay;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotLockedInput.java b/src/main/java/gtPlusPlus/core/slots/SlotLockedInput.java
index c67f8acfeb..41a3236275 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotLockedInput.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotLockedInput.java
@@ -1,57 +1,53 @@
package gtPlusPlus.core.slots;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
public class SlotLockedInput extends Slot {
- private ItemStack mLockStack;
- private final IGregTechTileEntity mEntity;
- private boolean mChecked = false;
-
- public SlotLockedInput(final IGregTechTileEntity inventory, final int index, final int x, final int y, ItemStack lockStack) {
- super(inventory, index, x, y);
- mLockStack = lockStack;
- mEntity = inventory;
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (mEntity == null) {
- return false;
- }
- else {
- if (!mChecked) {
- try {
- mLockStack = (ItemStack) ReflectionUtils.getField(this.mEntity.getMetaTileEntity().getClass(), "mItemStack").get(this.mEntity.getMetaTileEntity());
- }
- catch (Throwable t) {
- t.printStackTrace();
- mLockStack = null;
- }
- mChecked = true;
- }
- }
-
- if (mLockStack == null) {
- return true;
- }
- else {
- if (ItemStack.areItemStacksEqual(itemstack, mLockStack)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return mLockStack == null ? 64 : mLockStack.getMaxStackSize();
- }
-
+ private ItemStack mLockStack;
+ private final IGregTechTileEntity mEntity;
+ private boolean mChecked = false;
+
+ public SlotLockedInput(
+ final IGregTechTileEntity inventory, final int index, final int x, final int y, ItemStack lockStack) {
+ super(inventory, index, x, y);
+ mLockStack = lockStack;
+ mEntity = inventory;
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if (mEntity == null) {
+ return false;
+ } else {
+ if (!mChecked) {
+ try {
+ mLockStack = (ItemStack) ReflectionUtils.getField(
+ this.mEntity.getMetaTileEntity().getClass(), "mItemStack")
+ .get(this.mEntity.getMetaTileEntity());
+ } catch (Throwable t) {
+ t.printStackTrace();
+ mLockStack = null;
+ }
+ mChecked = true;
+ }
+ }
+
+ if (mLockStack == null) {
+ return true;
+ } else {
+ if (ItemStack.areItemStacksEqual(itemstack, mLockStack)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return mLockStack == null ? 64 : mLockStack.getMaxStackSize();
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotLunchBox.java b/src/main/java/gtPlusPlus/core/slots/SlotLunchBox.java
index bb82a28936..341921814f 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotLunchBox.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotLunchBox.java
@@ -1,30 +1,28 @@
package gtPlusPlus.core.slots;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.FoodUtils;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.minecraft.FoodUtils;
-
public class SlotLunchBox extends SlotGtTool {
-
- public SlotLunchBox(final IInventory base, final int x, final int y, final int z) {
- super(base, x, y, z);
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- return isItemValid_STATIC(itemstack);
- }
-
- public static boolean isItemValid_STATIC(final ItemStack itemstack) {
- if ((itemstack.getItem() instanceof ItemFood) || (FoodUtils.isFood(itemstack))) {
- Logger.WARNING(itemstack.getDisplayName() + " is a valid food.");
- return true;
- }
- Logger.WARNING(itemstack.getDisplayName() + " is not a valid food.");
- return false;
- }
+ public SlotLunchBox(final IInventory base, final int x, final int y, final int z) {
+ super(base, x, y, z);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValid_STATIC(itemstack);
+ }
+
+ public static boolean isItemValid_STATIC(final ItemStack itemstack) {
+ if ((itemstack.getItem() instanceof ItemFood) || (FoodUtils.isFood(itemstack))) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid food.");
+ return true;
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid food.");
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotMagicToolBag.java b/src/main/java/gtPlusPlus/core/slots/SlotMagicToolBag.java
index d555f10a44..6427dccc69 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotMagicToolBag.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotMagicToolBag.java
@@ -1,29 +1,28 @@
package gtPlusPlus.core.slots;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.FoodUtils;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.minecraft.FoodUtils;
public class SlotMagicToolBag extends SlotGtTool {
-
- public SlotMagicToolBag(final IInventory base, final int x, final int y, final int z) {
- super(base, x, y, z);
- }
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- return isItemValid_STATIC(itemstack);
- }
-
- public static boolean isItemValid_STATIC(final ItemStack itemstack) {
- if ((itemstack.getItem() instanceof ItemFood) || (FoodUtils.isFood(itemstack))) {
- Logger.WARNING(itemstack.getDisplayName() + " is a valid food.");
- return true;
- }
- Logger.WARNING(itemstack.getDisplayName() + " is not a valid food.");
- return false;
- }
-
+ public SlotMagicToolBag(final IInventory base, final int x, final int y, final int z) {
+ super(base, x, y, z);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValid_STATIC(itemstack);
+ }
+
+ public static boolean isItemValid_STATIC(final ItemStack itemstack) {
+ if ((itemstack.getItem() instanceof ItemFood) || (FoodUtils.isFood(itemstack))) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid food.");
+ return true;
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid food.");
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java b/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java
index 4aef5bc877..47a3beb393 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java
@@ -1,32 +1,30 @@
package gtPlusPlus.core.slots;
+import gtPlusPlus.core.item.bauble.ModularBauble;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.item.bauble.ModularBauble;
-
public class SlotModularBauble extends Slot {
- public SlotModularBauble(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
-
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- boolean isValid = false;
-
- if (itemstack != null) {
- if (itemstack.getItem() instanceof ModularBauble) {
- isValid = true;
- }
- }
- return isValid;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ public SlotModularBauble(final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ boolean isValid = false;
+
+ if (itemstack != null) {
+ if (itemstack.getItem() instanceof ModularBauble) {
+ isValid = true;
+ }
+ }
+ return isValid;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java b/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java
index dae62f0415..f73f27b788 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java
@@ -2,55 +2,54 @@ package gtPlusPlus.core.slots;
import static gtPlusPlus.core.tileentities.machines.TileEntityModularityTable.*;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.Pair;
+import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
+import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers;
import java.util.Iterator;
import java.util.Map.Entry;
-
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers;
-
public class SlotModularBaubleUpgrades extends Slot {
- public SlotModularBaubleUpgrades(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
-
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- boolean isValid = false;
- if (itemstack != null) {
- Logger.INFO("trying to insert " + itemstack.getDisplayName());
- Logger.INFO("Valid Upgrade count: " + mValidUpgradeList.size());
-
- Iterator<Entry<ItemStack, BT>> it = mValidUpgradeListFormChange.entrySet().iterator();
- while (it.hasNext()) {
- Entry<ItemStack, BT> pair = it.next();
- if (pair.getKey().getItem() == itemstack.getItem()
- && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
- isValid = true;
- }
- }
-
- Iterator<Entry<ItemStack, Pair<Modifiers, Integer>>> it2 = mValidUpgradeList.entrySet().iterator();
- while (it2.hasNext()) {
- Entry<ItemStack, Pair<Modifiers, Integer>> pair = it2.next();
- if (pair.getKey().getItem() == itemstack.getItem()
- && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
- isValid = true;
- }
- }
- }
- return isValid;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 64;
- }
+ public SlotModularBaubleUpgrades(final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ boolean isValid = false;
+ if (itemstack != null) {
+ Logger.INFO("trying to insert " + itemstack.getDisplayName());
+ Logger.INFO("Valid Upgrade count: " + mValidUpgradeList.size());
+
+ Iterator<Entry<ItemStack, BT>> it =
+ mValidUpgradeListFormChange.entrySet().iterator();
+ while (it.hasNext()) {
+ Entry<ItemStack, BT> pair = it.next();
+ if (pair.getKey().getItem() == itemstack.getItem()
+ && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
+ isValid = true;
+ }
+ }
+
+ Iterator<Entry<ItemStack, Pair<Modifiers, Integer>>> it2 =
+ mValidUpgradeList.entrySet().iterator();
+ while (it2.hasNext()) {
+ Entry<ItemStack, Pair<Modifiers, Integer>> pair = it2.next();
+ if (pair.getKey().getItem() == itemstack.getItem()
+ && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
+ isValid = true;
+ }
+ }
+ }
+ return isValid;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 64;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotNoInput.java b/src/main/java/gtPlusPlus/core/slots/SlotNoInput.java
index 1a1cf62e2b..d4e8696075 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotNoInput.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotNoInput.java
@@ -6,18 +6,17 @@ import net.minecraft.item.ItemStack;
public class SlotNoInput extends Slot {
- public SlotNoInput(final IInventory inventory, final int index, final int x, final int y) {
- super(inventory, index, x, y);
- }
+ public SlotNoInput(final IInventory inventory, final int index, final int x, final int y) {
+ super(inventory, index, x, y);
+ }
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 0;
- }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return false;
+ }
+ @Override
+ public int getSlotStackLimit() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotNoInputLogging.java b/src/main/java/gtPlusPlus/core/slots/SlotNoInputLogging.java
index 762714ac94..230a299d41 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotNoInputLogging.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotNoInputLogging.java
@@ -8,29 +8,27 @@ import net.minecraft.item.ItemStack;
public class SlotNoInputLogging extends SlotNoInput {
- private final int aSlotIndex;
-
- public SlotNoInputLogging(final IInventory inventory, final int index, final int x, final int y) {
- super(inventory, index, x, y);
- aSlotIndex = index;
- Logger.INFO("Slot "+index+" is doing logging");
- }
+ private final int aSlotIndex;
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (ItemUtils.checkForInvalidItems(itemstack)) {
- Logger.INFO("Tried Inserting "+ItemUtils.getItemName(itemstack)+" into slot "+aSlotIndex);
- Block b = Block.getBlockFromItem(itemstack.getItem());
- Logger.INFO(""+itemstack.getUnlocalizedName());
- if (b != null) {
- Logger.INFO(""+b.getLocalizedName());
- Logger.INFO(""+b.getUnlocalizedName());
- }
- }
- else {
- Logger.INFO("Bad Itemstack");
- }
- return false;
- }
+ public SlotNoInputLogging(final IInventory inventory, final int index, final int x, final int y) {
+ super(inventory, index, x, y);
+ aSlotIndex = index;
+ Logger.INFO("Slot " + index + " is doing logging");
+ }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if (ItemUtils.checkForInvalidItems(itemstack)) {
+ Logger.INFO("Tried Inserting " + ItemUtils.getItemName(itemstack) + " into slot " + aSlotIndex);
+ Block b = Block.getBlockFromItem(itemstack.getItem());
+ Logger.INFO("" + itemstack.getUnlocalizedName());
+ if (b != null) {
+ Logger.INFO("" + b.getLocalizedName());
+ Logger.INFO("" + b.getUnlocalizedName());
+ }
+ } else {
+ Logger.INFO("Bad Itemstack");
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotOutput.java b/src/main/java/gtPlusPlus/core/slots/SlotOutput.java
index f22e0645f5..dc469b32a4 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotOutput.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotOutput.java
@@ -1,96 +1,99 @@
package gtPlusPlus.core.slots;
import cpw.mods.fml.common.FMLCommonHandler;
-
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
-
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
public class SlotOutput extends SlotCrafting {
- private final IInventory craftMatrix;
- private final EntityPlayer thePlayer;
- private int amountCrafted;
+ private final IInventory craftMatrix;
+ private final EntityPlayer thePlayer;
+ private int amountCrafted;
- public SlotOutput(final EntityPlayer player, final InventoryCrafting craftingInventory,
- final IInventory p_i45790_3_, final int slotIndex, final int xPosition, final int yPosition) {
- super(player, craftingInventory, p_i45790_3_, slotIndex, xPosition, yPosition);
- this.thePlayer = player;
- this.craftMatrix = craftingInventory;
- }
+ public SlotOutput(
+ final EntityPlayer player,
+ final InventoryCrafting craftingInventory,
+ final IInventory p_i45790_3_,
+ final int slotIndex,
+ final int xPosition,
+ final int yPosition) {
+ super(player, craftingInventory, p_i45790_3_, slotIndex, xPosition, yPosition);
+ this.thePlayer = player;
+ this.craftMatrix = craftingInventory;
+ }
- /**
- * Check if the stack is a valid item for this slot. Always true beside for
- * the armor slots.
- */
- @Override
- public boolean isItemValid(final ItemStack par1ItemStack) {
- return false;
- }
+ /**
+ * Check if the stack is a valid item for this slot. Always true beside for
+ * the armor slots.
+ */
+ @Override
+ public boolean isItemValid(final ItemStack par1ItemStack) {
+ return false;
+ }
- /**
- * Decrease the size of the stack in slot (first int arg) by the amount of
- * the second int arg. Returns the new stack.
- */
- @Override
- public ItemStack decrStackSize(final int par1) {
- if (this.getHasStack()) {
- this.amountCrafted += Math.min(par1, this.getStack().stackSize);
- }
- return super.decrStackSize(par1);
- }
+ /**
+ * Decrease the size of the stack in slot (first int arg) by the amount of
+ * the second int arg. Returns the new stack.
+ */
+ @Override
+ public ItemStack decrStackSize(final int par1) {
+ if (this.getHasStack()) {
+ this.amountCrafted += Math.min(par1, this.getStack().stackSize);
+ }
+ return super.decrStackSize(par1);
+ }
- /**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood. Typically increases an internal count then calls
- * onCrafting(item).
- */
- @Override
- protected void onCrafting(final ItemStack par1ItemStack, final int par2) {
- this.amountCrafted += par2;
- this.onCrafting(par1ItemStack);
- }
+ /**
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
+ * not ore and wood. Typically increases an internal count then calls
+ * onCrafting(item).
+ */
+ @Override
+ protected void onCrafting(final ItemStack par1ItemStack, final int par2) {
+ this.amountCrafted += par2;
+ this.onCrafting(par1ItemStack);
+ }
- /**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood.
- */
- @Override
- protected void onCrafting(final ItemStack stack) {
- stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
- this.amountCrafted = 0;
- }
+ /**
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
+ * not ore and wood.
+ */
+ @Override
+ protected void onCrafting(final ItemStack stack) {
+ stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
+ this.amountCrafted = 0;
+ }
- @Override
- public void onPickupFromSlot(final EntityPlayer playerIn, final ItemStack stack) {
- {
- FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, this.craftMatrix);
- this.onCrafting(stack);
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) {
- final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
- if (itemstack1 != null) {
- this.craftMatrix.decrStackSize(i, 1);
- if (itemstack1.getItem().hasContainerItem(itemstack1)) {
- ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
- if (itemstack2.isItemStackDamageable()
- && (itemstack2.getItemDamage() > itemstack2.getMaxDamage())) {
- MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2));
- itemstack2 = null;
- }
- if (!this.thePlayer.inventory.addItemStackToInventory(itemstack2)) {
- if (this.craftMatrix.getStackInSlot(i) == null) {
- this.craftMatrix.setInventorySlotContents(i, itemstack2);
- } else {
- this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false);
- }
- }
- }
- }
- }
- }
- }
-} \ No newline at end of file
+ @Override
+ public void onPickupFromSlot(final EntityPlayer playerIn, final ItemStack stack) {
+ {
+ FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, this.craftMatrix);
+ this.onCrafting(stack);
+ for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) {
+ final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
+ if (itemstack1 != null) {
+ this.craftMatrix.decrStackSize(i, 1);
+ if (itemstack1.getItem().hasContainerItem(itemstack1)) {
+ ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
+ if (itemstack2.isItemStackDamageable()
+ && (itemstack2.getItemDamage() > itemstack2.getMaxDamage())) {
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2));
+ itemstack2 = null;
+ }
+ if (!this.thePlayer.inventory.addItemStackToInventory(itemstack2)) {
+ if (this.craftMatrix.getStackInSlot(i) == null) {
+ this.craftMatrix.setInventorySlotContents(i, itemstack2);
+ } else {
+ this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotPollutionScrubber.java b/src/main/java/gtPlusPlus/core/slots/SlotPollutionScrubber.java
index 6dd3745d09..7025943908 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotPollutionScrubber.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotPollutionScrubber.java
@@ -1,66 +1,67 @@
package gtPlusPlus.core.slots;
-import java.util.HashMap;
-
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.item.general.ItemAirFilter;
import gtPlusPlus.core.item.general.ItemBasicScrubberTurbine;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
+import java.util.HashMap;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class SlotPollutionScrubber extends Slot {
- private final int mType;
- private final int mTier;
-
- private static HashMap<Integer, ItemStack> mConveyorMap = new HashMap<Integer, ItemStack>();
-
- static {
- for (int i=0; i<(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? 9 : 5); i++) {
- mConveyorMap.put(i, CI.getConveyor(i, 1));
- }
- }
+ private final int mType;
+ private final int mTier;
+
+ private static HashMap<Integer, ItemStack> mConveyorMap = new HashMap<Integer, ItemStack>();
+
+ static {
+ for (int i = 0; i < (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? 9 : 5); i++) {
+ mConveyorMap.put(i, CI.getConveyor(i, 1));
+ }
+ }
- public SlotPollutionScrubber(final int aType, final int aTier, final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
- mType = aType;
- mTier = aTier;
- }
+ public SlotPollutionScrubber(
+ final int aType, final int aTier, final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ mType = aType;
+ mTier = aTier;
+ }
- @Override
- public synchronized boolean isItemValid(final ItemStack itemstack) {
- return isItemValidForSlot(this, itemstack);
- }
+ @Override
+ public synchronized boolean isItemValid(final ItemStack itemstack) {
+ return isItemValidForSlot(this, itemstack);
+ }
- public static synchronized boolean isItemValidForSlot(final SlotPollutionScrubber aSlot, final ItemStack itemstack) {
- if (aSlot.mType == 0) {
- if (itemstack.getItem() instanceof ItemBasicScrubberTurbine) {
- return true;
- }
- if (itemstack.getItem() instanceof GT_MetaGenerated_Tool && itemstack.getItemDamage() >= 170 && itemstack.getItemDamage() <= 179){
- return true;
- }
- }
- else if (aSlot.mType == 1) {
- if (itemstack.getItem() instanceof ItemAirFilter) {
- return true;
- }
- }
- else if (aSlot.mType == 2) {
- ItemStack aConveyorStack = mConveyorMap.get(aSlot.mTier);
- if (GT_Utility.areStacksEqual(itemstack, aConveyorStack, true)) {
- return true;
- }
- }
- return false;
- }
+ public static synchronized boolean isItemValidForSlot(
+ final SlotPollutionScrubber aSlot, final ItemStack itemstack) {
+ if (aSlot.mType == 0) {
+ if (itemstack.getItem() instanceof ItemBasicScrubberTurbine) {
+ return true;
+ }
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Tool
+ && itemstack.getItemDamage() >= 170
+ && itemstack.getItemDamage() <= 179) {
+ return true;
+ }
+ } else if (aSlot.mType == 1) {
+ if (itemstack.getItem() instanceof ItemAirFilter) {
+ return true;
+ }
+ } else if (aSlot.mType == 2) {
+ ItemStack aConveyorStack = mConveyorMap.get(aSlot.mTier);
+ if (GT_Utility.areStacksEqual(itemstack, aConveyorStack, true)) {
+ return true;
+ }
+ }
+ return false;
+ }
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotRTG.java b/src/main/java/gtPlusPlus/core/slots/SlotRTG.java
index 181052cc57..f07fdd2894 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotRTG.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotRTG.java
@@ -1,26 +1,23 @@
package gtPlusPlus.core.slots;
+import ic2.core.Ic2Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import ic2.core.Ic2Items;
-
public class SlotRTG extends Slot {
- public SlotRTG(final IInventory inventory, final int x, final int y, final int z) {
- super(inventory, x, y, z);
-
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- return itemstack.getItem().getClass() == Ic2Items.RTGPellets.getItem().getClass();
- }
+ public SlotRTG(final IInventory inventory, final int x, final int y, final int z) {
+ super(inventory, x, y, z);
+ }
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return itemstack.getItem().getClass() == Ic2Items.RTGPellets.getItem().getClass();
+ }
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotToolBox.java b/src/main/java/gtPlusPlus/core/slots/SlotToolBox.java
index 87967b75b5..54b8f0bd92 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotToolBox.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotToolBox.java
@@ -1,113 +1,119 @@
package gtPlusPlus.core.slots;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.ItemTool;
import gregtech.api.items.GT_MetaGenerated_Tool;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.ItemTool;
public class SlotToolBox extends SlotGtTool {
-
- private static final AutoMap<Class> mSupportedCustomTools = new AutoMap<Class>();
-
- static {
- //Look for Supported custom tool types
- Class temp;
- //IHL Pumps
- temp = ReflectionUtils.getClass("ihl.handpump.IHLHandPump");
- if (temp != null) {
- mSupportedCustomTools.put(temp);
- temp = null;
- }
+ private static final AutoMap<Class> mSupportedCustomTools = new AutoMap<Class>();
+
+ static {
+ // Look for Supported custom tool types
+ Class temp;
+
+ // IHL Pumps
+ temp = ReflectionUtils.getClass("ihl.handpump.IHLHandPump");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+ // IC2 Electrics
+ temp = ReflectionUtils.getClass("ic2.api.item.IElectricItem");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+ // IC2 Boxables
+ temp = ReflectionUtils.getClass(" ic2.api.item.IBoxable");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+ // Tinkers Tools
+ temp = ReflectionUtils.getClass("tconstruct.library.tools.Weapon");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+ // BattleGear Weapons
+ temp = ReflectionUtils.getClass("mods.battlegear2.api.weapons.IBattlegearWeapon");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+ // OpenMods
+ String[] OpenModsContent = new String[] {
+ "openblocks.common.item.ItemDevNull",
+ "openblocks.common.item.ItemHangGlider",
+ "openblocks.common.item.ItemWrench",
+ "openblocks.common.item.ItemSleepingBag"
+ };
+ for (String t : OpenModsContent) {
+ temp = ReflectionUtils.getClass(t);
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+ }
+
+ // GC Wrench
+ temp = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.items.ItemUniversalWrench");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+
+ // EIO
+ String[] EioContent = new String[] {
+ "crazypants.enderio.api.tool.ITool",
+ "crazypants.enderio.item.ItemMagnet",
+ "crazypants.enderio.item.ItemConduitProbe"
+ };
+ for (String t : EioContent) {
+ temp = ReflectionUtils.getClass(t);
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+ }
- //IC2 Electrics
- temp = ReflectionUtils.getClass("ic2.api.item.IElectricItem");
- if (temp != null) {
- mSupportedCustomTools.put(temp);
- temp = null;
- }
-
- //IC2 Boxables
- temp = ReflectionUtils.getClass(" ic2.api.item.IBoxable");
- if (temp != null) {
- mSupportedCustomTools.put(temp);
- temp = null;
- }
-
- //Tinkers Tools
- temp = ReflectionUtils.getClass("tconstruct.library.tools.Weapon");
- if (temp != null) {
- mSupportedCustomTools.put(temp);
- temp = null;
- }
- //BattleGear Weapons
- temp = ReflectionUtils.getClass("mods.battlegear2.api.weapons.IBattlegearWeapon");
- if (temp != null) {
- mSupportedCustomTools.put(temp);
- temp = null;
- }
-
-
- //OpenMods
- String[] OpenModsContent = new String[] {"openblocks.common.item.ItemDevNull", "openblocks.common.item.ItemHangGlider", "openblocks.common.item.ItemWrench", "openblocks.common.item.ItemSleepingBag"};
- for (String t : OpenModsContent) {
- temp = ReflectionUtils.getClass(t);
- if (temp != null) {
- mSupportedCustomTools.put(temp);
- temp = null;
- }
- }
+ // Forestry
+ temp = ReflectionUtils.getClass("forestry.core.items.ItemForestryTool");
+ if (temp != null) {
+ mSupportedCustomTools.put(temp);
+ temp = null;
+ }
+ }
- //GC Wrench
- temp = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.items.ItemUniversalWrench");
- if (temp != null) {
- mSupportedCustomTools.put(temp);
- temp = null;
- }
-
- //EIO
- String[] EioContent = new String[] {"crazypants.enderio.api.tool.ITool", "crazypants.enderio.item.ItemMagnet", "crazypants.enderio.item.ItemConduitProbe"};
- for (String t : EioContent) {
- temp = ReflectionUtils.getClass(t);
- if (temp != null) {
- mSupportedCustomTools.put(temp);
- temp = null;
- }
- }
-
- //Forestry
- temp = ReflectionUtils.getClass("forestry.core.items.ItemForestryTool");
- if (temp != null) {
- mSupportedCustomTools.put(temp);
- temp = null;
- }
- }
-
- public SlotToolBox(final IInventory base, final int x, final int y, final int z) {
- super(base, x, y, z);
- }
+ public SlotToolBox(final IInventory base, final int x, final int y, final int z) {
+ super(base, x, y, z);
+ }
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- return isItemValid_STATIC(itemstack);
- }
-
- public static boolean isItemValid_STATIC(final ItemStack itemstack) {
- if ((itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof ItemTool)) {
- Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool.");
- return true;
- }
- for (Class C : mSupportedCustomTools) {
- if (C.isInstance(itemstack.getItem())) {
- return true;
- }
- }
- Logger.WARNING(itemstack.getDisplayName() + " is not a valid Tool.");
- return false;
- }
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValid_STATIC(itemstack);
+ }
+ public static boolean isItemValid_STATIC(final ItemStack itemstack) {
+ if ((itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof ItemTool)) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool.");
+ return true;
+ }
+ for (Class C : mSupportedCustomTools) {
+ if (C.isInstance(itemstack.getItem())) {
+ return true;
+ }
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid Tool.");
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotVolumetricFlask.java b/src/main/java/gtPlusPlus/core/slots/SlotVolumetricFlask.java
index b8955f6dc8..0decde112d 100644
--- a/src/main/java/gtPlusPlus/core/slots/SlotVolumetricFlask.java
+++ b/src/main/java/gtPlusPlus/core/slots/SlotVolumetricFlask.java
@@ -8,23 +8,23 @@ import net.minecraft.item.ItemStack;
public class SlotVolumetricFlask extends Slot {
- public static Item mFlask;
+ public static Item mFlask;
- public SlotVolumetricFlask(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
- }
+ public SlotVolumetricFlask(final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ }
- @Override
- public synchronized boolean isItemValid(final ItemStack itemstack) {
- return isItemValidForSlot(itemstack);
- }
+ @Override
+ public synchronized boolean isItemValid(final ItemStack itemstack) {
+ return isItemValidForSlot(itemstack);
+ }
- public static synchronized boolean isItemValidForSlot(final ItemStack itemstack) {
- return VolumetricFlaskHelper.isVolumetricFlask(itemstack);
- }
+ public static synchronized boolean isItemValidForSlot(final ItemStack itemstack) {
+ return VolumetricFlaskHelper.isVolumetricFlask(itemstack);
+ }
- @Override
- public int getSlotStackLimit() {
- return 16;
- }
+ @Override
+ public int getSlotStackLimit() {
+ return 16;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java
index 0fcbb6a576..1ec58b0813 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java
@@ -26,42 +26,43 @@ import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
public class ModTileEntities {
- public static void init() {
- Logger.INFO("Registering Tile Entities.");
- GameRegistry.registerTileEntity(TileEntityPooCollector.class, "TileEntityPooCollector");
- GameRegistry.registerTileEntity(TileEntityAdvPooCollector.class, "TileEntityAdvPooCollector");
- GameRegistry.registerTileEntity(TileEntityFishTrap.class, "TileFishTrap");
- GameRegistry.registerTileEntity(TileEntityFirepit.class, "TileFirePit");
- GameRegistry.registerTileEntity(TileEntityInfiniteFluid.class, "TileInfiniteFluid");
- GameRegistry.registerTileEntity(TileEntityProjectTable.class, "TileProjectTable");
- GameRegistry.registerTileEntity(TileEntityTradeTable.class, "TileTradeTable");
- GameRegistry.registerTileEntity(TileEntityModularityTable.class, "TileEntityModularityTable");
- GameRegistry.registerTileEntity(TileEntityXpConverter.class, "TileEntityXpConverter");
- GameRegistry.registerTileEntity(TileEntityGenericSpawner.class, "TileEntityGenericSpawner");
- GameRegistry.registerTileEntity(TileEntityCircuitProgrammer.class, "TileCircuitProgrammer");
- GameRegistry.registerTileEntity(TileEntityPlayerDoorBase.class, "TilePlayerDoorBase");
- GameRegistry.registerTileEntity(TileEntityDecayablesChest.class, "TileDecayablesChest");
- GameRegistry.registerTileEntity(TileEntitySuperJukebox.class, "TileEntitySuperJukebox");
- GameRegistry.registerTileEntity(TileEntitySuperLight.class, "TileEntitySuperLight");
- GameRegistry.registerTileEntity(TileEntityPestKiller.class, "TileEntityPestKiller");
- GameRegistry.registerTileEntity(TileEntityRoundRobinator.class, "TileEntityRoundRobinator");
- GameRegistry.registerTileEntity(TileEntityEggBox.class, "TileEggBox");
-
- if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
- GameRegistry.registerTileEntity(TileEntityVolumetricFlaskSetter.class, "TileEntityVolumetricFlaskSetter");
- }
-
- //Mod TEs
- if (LoadedMods.Thaumcraft){
-
- }
- blacklistTilesFromAcceleration();
- }
-
- private static void blacklistTilesFromAcceleration() {
- Meta_GT_Proxy.setTileEntityClassAsBlacklistedInWorldAccelerator("gtPlusPlus.core.tileentities.general.TileEntityFishTrap");
- Meta_GT_Proxy.setTileEntityClassAsBlacklistedInWorldAccelerator("gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest");
- Meta_GT_Proxy.setTileEntityClassAsBlacklistedInWorldAccelerator("gtPlusPlus.core.tileentities.general.TileEggBox");
- }
+ public static void init() {
+ Logger.INFO("Registering Tile Entities.");
+ GameRegistry.registerTileEntity(TileEntityPooCollector.class, "TileEntityPooCollector");
+ GameRegistry.registerTileEntity(TileEntityAdvPooCollector.class, "TileEntityAdvPooCollector");
+ GameRegistry.registerTileEntity(TileEntityFishTrap.class, "TileFishTrap");
+ GameRegistry.registerTileEntity(TileEntityFirepit.class, "TileFirePit");
+ GameRegistry.registerTileEntity(TileEntityInfiniteFluid.class, "TileInfiniteFluid");
+ GameRegistry.registerTileEntity(TileEntityProjectTable.class, "TileProjectTable");
+ GameRegistry.registerTileEntity(TileEntityTradeTable.class, "TileTradeTable");
+ GameRegistry.registerTileEntity(TileEntityModularityTable.class, "TileEntityModularityTable");
+ GameRegistry.registerTileEntity(TileEntityXpConverter.class, "TileEntityXpConverter");
+ GameRegistry.registerTileEntity(TileEntityGenericSpawner.class, "TileEntityGenericSpawner");
+ GameRegistry.registerTileEntity(TileEntityCircuitProgrammer.class, "TileCircuitProgrammer");
+ GameRegistry.registerTileEntity(TileEntityPlayerDoorBase.class, "TilePlayerDoorBase");
+ GameRegistry.registerTileEntity(TileEntityDecayablesChest.class, "TileDecayablesChest");
+ GameRegistry.registerTileEntity(TileEntitySuperJukebox.class, "TileEntitySuperJukebox");
+ GameRegistry.registerTileEntity(TileEntitySuperLight.class, "TileEntitySuperLight");
+ GameRegistry.registerTileEntity(TileEntityPestKiller.class, "TileEntityPestKiller");
+ GameRegistry.registerTileEntity(TileEntityRoundRobinator.class, "TileEntityRoundRobinator");
+ GameRegistry.registerTileEntity(TileEntityEggBox.class, "TileEggBox");
+ if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
+ GameRegistry.registerTileEntity(TileEntityVolumetricFlaskSetter.class, "TileEntityVolumetricFlaskSetter");
+ }
+
+ // Mod TEs
+ if (LoadedMods.Thaumcraft) {}
+
+ blacklistTilesFromAcceleration();
+ }
+
+ private static void blacklistTilesFromAcceleration() {
+ Meta_GT_Proxy.setTileEntityClassAsBlacklistedInWorldAccelerator(
+ "gtPlusPlus.core.tileentities.general.TileEntityFishTrap");
+ Meta_GT_Proxy.setTileEntityClassAsBlacklistedInWorldAccelerator(
+ "gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest");
+ Meta_GT_Proxy.setTileEntityClassAsBlacklistedInWorldAccelerator(
+ "gtPlusPlus.core.tileentities.general.TileEggBox");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java b/src/main/java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java
index 839bcc353a..ff1484a984 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java
@@ -8,32 +8,32 @@ import net.minecraft.tileentity.TileEntity;
public class TILE_ENTITY_BASE extends TileEntity {
- @Override
- public void writeToNBT(final NBTTagCompound tag) {
- super.writeToNBT(tag);
- this.writeCustomNBT(tag);
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound tag) {
- super.readFromNBT(tag);
- this.readCustomNBT(tag);
- }
-
- public void writeCustomNBT(final NBTTagCompound tag) {}
- public void readCustomNBT(final NBTTagCompound tag) {}
-
- @Override
- public Packet getDescriptionPacket() {
- final NBTTagCompound tag = new NBTTagCompound();
- this.writeCustomNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, -999, tag);
- }
-
- @Override
- public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity packet) {
- super.onDataPacket(net, packet);
- this.readCustomNBT(packet.func_148857_g());
- }
-
+ @Override
+ public void writeToNBT(final NBTTagCompound tag) {
+ super.writeToNBT(tag);
+ this.writeCustomNBT(tag);
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound tag) {
+ super.readFromNBT(tag);
+ this.readCustomNBT(tag);
+ }
+
+ public void writeCustomNBT(final NBTTagCompound tag) {}
+
+ public void readCustomNBT(final NBTTagCompound tag) {}
+
+ @Override
+ public Packet getDescriptionPacket() {
+ final NBTTagCompound tag = new NBTTagCompound();
+ this.writeCustomNBT(tag);
+ return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, -999, tag);
+ }
+
+ @Override
+ public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity packet) {
+ super.onDataPacket(net, packet);
+ this.readCustomNBT(packet.func_148857_g());
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/base/TileBasicTank.java b/src/main/java/gtPlusPlus/core/tileentities/base/TileBasicTank.java
index 671a49fca5..32a39a7096 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/base/TileBasicTank.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/base/TileBasicTank.java
@@ -10,141 +10,197 @@ import net.minecraftforge.fluids.IFluidTank;
public class TileBasicTank extends TileEntityBase implements IFluidHandler, IFluidTank {
- public final BTF_FluidTank mTank;
-
- public TileBasicTank(int aMaxSlots, int aFluidCapacity) {
- super(aMaxSlots);
- mTank = new BTF_FluidTank(aFluidCapacity);
- }
-
- @Override
- public boolean onPreTick(long aTick) {
-
- if (this.isServerSide()) {
- if (mTank.isFluidChangingAllowed() && mTank.getFillableStack() != null
- && mTank.getFillableStack().amount <= 0) {
- mTank.setFillableStack((FluidStack) null);
- }
- }
-
- return super.onPreTick(aTick);
-
- }
-
-
- private final boolean canFillEx(ForgeDirection aSide, Fluid aFluid) {
- return this.fill(aSide, new FluidStack(aFluid, 1), false) == 1;
- }
-
-
- private final boolean canDrainEx(ForgeDirection aSide, Fluid aFluid) {
- return this.drain(aSide, new FluidStack(aFluid, 1), false) != null;
- }
-
-
- private final FluidTankInfo[] getTankInfoEx(ForgeDirection aSide) {
- return mTank.getCapacity() <= 0 ? new FluidTankInfo[0]
- : new FluidTankInfo[]{mTank.getInfo()};
- }
-
- private final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- return mTank.fill(aFluid, doFill);
- }
-
-
- private final int fillEx(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- return this.fill_default(aSide, aFluid, doFill);
- }
-
-
- private final FluidStack drainEx(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- return mTank.getFluid() != null && aFluid != null && mTank.getFluid().isFluidEqual(aFluid)
- ? mTank.drain(aFluid.amount, doDrain)
- : null;
- }
-
-
- private final FluidStack drainEx(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- return mTank.drain(maxDrain, doDrain);
- }
-
-
- public boolean isLiquidInput(byte aSide) {
- return true;
- }
-
- public boolean isLiquidOutput(byte aSide) {
- return true;
- }
-
- @Override
+ public final BTF_FluidTank mTank;
+
+ public TileBasicTank(int aMaxSlots, int aFluidCapacity) {
+ super(aMaxSlots);
+ mTank = new BTF_FluidTank(aFluidCapacity);
+ }
+
+ @Override
+ public boolean onPreTick(long aTick) {
+
+ if (this.isServerSide()) {
+ if (mTank.isFluidChangingAllowed()
+ && mTank.getFillableStack() != null
+ && mTank.getFillableStack().amount <= 0) {
+ mTank.setFillableStack((FluidStack) null);
+ }
+ }
+
+ return super.onPreTick(aTick);
+ }
+
+ private final boolean canFillEx(ForgeDirection aSide, Fluid aFluid) {
+ return this.fill(aSide, new FluidStack(aFluid, 1), false) == 1;
+ }
+
+ private final boolean canDrainEx(ForgeDirection aSide, Fluid aFluid) {
+ return this.drain(aSide, new FluidStack(aFluid, 1), false) != null;
+ }
+
+ private final FluidTankInfo[] getTankInfoEx(ForgeDirection aSide) {
+ return mTank.getCapacity() <= 0 ? new FluidTankInfo[0] : new FluidTankInfo[] {mTank.getInfo()};
+ }
+
+ private final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return mTank.fill(aFluid, doFill);
+ }
+
+ private final int fillEx(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return this.fill_default(aSide, aFluid, doFill);
+ }
+
+ private final FluidStack drainEx(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ return mTank.getFluid() != null && aFluid != null && mTank.getFluid().isFluidEqual(aFluid)
+ ? mTank.drain(aFluid.amount, doDrain)
+ : null;
+ }
+
+ private final FluidStack drainEx(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ return mTank.drain(maxDrain, doDrain);
+ }
+
+ public boolean isLiquidInput(byte aSide) {
+ return true;
+ }
+
+ public boolean isLiquidOutput(byte aSide) {
+ return true;
+ }
+
+ @Override
public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mInputDisabled) && (aSide == ForgeDirection.UNKNOWN || (this.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 this.fillEx(aSide, aFluid, doFill);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mInputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (this.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 this.fillEx(aSide, aFluid, doFill);
return 0;
}
@Override
public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mOutputDisabled) && (aSide == ForgeDirection.UNKNOWN || (this.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), this.getFluid() == null ? null : this.getFluid().getFluid(), this))))
- return this.drainEx(aSide, maxDrain, doDrain);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mOutputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (this.isLiquidOutput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSide((byte) aSide.ordinal())
+ .letsFluidOut(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getCoverDataAtSide((byte) aSide.ordinal()),
+ this.getFluid() == null
+ ? null
+ : this.getFluid().getFluid(),
+ this)))) return this.drainEx(aSide, maxDrain, doDrain);
return null;
}
@Override
public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mOutputDisabled) && (aSide == ForgeDirection.UNKNOWN || (this.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 this.drainEx(aSide, aFluid, doDrain);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mOutputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (this.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 this.drainEx(aSide, aFluid, doDrain);
return null;
}
@Override
public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mInputDisabled) && (aSide == ForgeDirection.UNKNOWN || (this.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))))
- return this.canFillEx(aSide, aFluid);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mInputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (this.isLiquidInput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSide((byte) aSide.ordinal())
+ .letsFluidIn(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getCoverDataAtSide((byte) aSide.ordinal()),
+ aFluid,
+ this)))) return this.canFillEx(aSide, aFluid);
return false;
}
@Override
public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mOutputDisabled) && (aSide == ForgeDirection.UNKNOWN || (this.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))))
- return this.canDrainEx(aSide, aFluid);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mOutputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (this.isLiquidOutput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSide((byte) aSide.ordinal())
+ .letsFluidOut(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getCoverDataAtSide((byte) aSide.ordinal()),
+ aFluid,
+ this)))) return this.canDrainEx(aSide, aFluid);
return false;
}
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (canAccessData() && (aSide == ForgeDirection.UNKNOWN || (this.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this)) || (this.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this))))
- return this.getTankInfoEx(aSide);
- return new FluidTankInfo[]{};
- }
-
- @Override
- public FluidStack getFluid() {
- return mTank.getFluid();
- }
-
- @Override
- public int getFluidAmount() {
- return mTank.getFluidAmount();
- }
-
- @Override
- public FluidTankInfo getInfo() {
- return mTank.getInfo();
- }
-
- @Override
- public int fill(FluidStack resource, boolean doFill) {
- return mTank.fill(resource, doFill);
- }
-
- @Override
- public FluidStack drain(int maxDrain, boolean doDrain) {
- return mTank.drain(maxDrain, doDrain);
- }
-
-
-
-
+ if (canAccessData()
+ && (aSide == ForgeDirection.UNKNOWN
+ || (this.isLiquidInput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSide((byte) aSide.ordinal())
+ .letsFluidIn(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getCoverDataAtSide((byte) aSide.ordinal()),
+ null,
+ this))
+ || (this.isLiquidOutput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSide((byte) aSide.ordinal())
+ .letsFluidOut(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getCoverDataAtSide((byte) aSide.ordinal()),
+ null,
+ this)))) return this.getTankInfoEx(aSide);
+ return new FluidTankInfo[] {};
+ }
+
+ @Override
+ public FluidStack getFluid() {
+ return mTank.getFluid();
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return mTank.getFluidAmount();
+ }
+
+ @Override
+ public FluidTankInfo getInfo() {
+ return mTank.getInfo();
+ }
+
+ @Override
+ public int fill(FluidStack resource, boolean doFill) {
+ return mTank.fill(resource, doFill);
+ }
+
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return mTank.drain(maxDrain, doDrain);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java b/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java
index 5b67a318be..f52ce86a99 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.tileentities.base;
-import java.util.UUID;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
@@ -14,6 +12,12 @@ import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.ISerializableObject;
+import gtPlusPlus.api.interfaces.ILazyCoverable;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.minecraft.BTF_Inventory;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
+import ic2.api.Direction;
+import java.util.UUID;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@@ -26,186 +30,182 @@ import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.IFluidHandler;
-import gtPlusPlus.api.interfaces.ILazyCoverable;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.minecraft.BTF_Inventory;
-import gtPlusPlus.core.util.data.ArrayUtils;
-import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-import ic2.api.Direction;
public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregTechDeviceInformation, IDescribable {
- private String customName;
- public String mOwnerName = "null";
- public String mOwnerUUID = "null";
- private boolean mIsOwnerOP = false;
-
- public final BTF_Inventory mInventory;
-
- public TileEntityBase(int aCapacity) {
- mInventory = new BTF_Inventory(aCapacity, this);
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag){
- if(!nbt.hasKey(tag))
- {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt){
- super.writeToNBT(nbt);
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- nbt.setBoolean("mIsOwnerOP", this.mIsOwnerOP);
- nbt.setString("mOwnerName", this.mOwnerName);
- nbt.setString("mOwnerUUID", this.mOwnerUUID);
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt){
-
- super.readFromNBT(nbt);
-
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
-
- this.mIsOwnerOP = nbt.getBoolean("mIsOwnerOP");
- this.mOwnerName = nbt.getString("mOwnerName");
- this.mOwnerUUID = nbt.getString("mOwnerUUID");
- }
-
- @Override
- public void updateEntity() {
- long aTick = System.currentTimeMillis();
- this.isDead = false;
- if (!firstTicked) {
- onFirstTick();
- }
- try{
- if (this.isServerSide()){
- onPreTick(aTick);
- }
- } catch (Throwable t){
- Logger.ERROR("Tile Entity Encountered an error in it's pre-tick stage.");
- t.printStackTrace();
- }
- try{
- if (this.isServerSide()){
- onTick(aTick);
- }
- } catch (Throwable t){
- Logger.ERROR("Tile Entity Encountered an error in it's tick stage.");
- t.printStackTrace();
- }
- try{
- if (this.isServerSide()){
- onPostTick(aTick);
- }
- } catch (Throwable t){
- Logger.ERROR("Tile Entity Encountered an error in it's post-tick stage.");
- t.printStackTrace();
- }
- }
-
- public boolean onPreTick(long aTick) {
- return true;
- }
-
- public boolean onTick(long aTick){
- try{
- if (this.isServerSide()){
- processRecipe();
- }
- } catch (Throwable t){
- Logger.ERROR("Tile Entity Encountered an error in it's processing of a recipe stage.");
- t.printStackTrace();
- }
- return true;
- }
-
- public boolean onPostTick(long aTick){
- return true;
- }
-
- public boolean processRecipe(){
- return true;
- }
-
- @Override
- public boolean canUpdate() {
- return true;
- }
-
- public String getOwner(){
- if (this.mOwnerName == null){
- return "null";
- }
- return this.mOwnerName;
- }
-
- public UUID getOwnerUUID(){
- return UUID.fromString(this.mOwnerUUID);
- }
-
- public boolean isOwnerOP() {
- return mIsOwnerOP;
- }
-
- public void setOwnerInformation(String mName, String mUUID, boolean mOP){
- if (isServerSide()){
- if (this.mOwnerName == null || this.mOwnerUUID == null || this.mOwnerName.equals("null") || this.mOwnerUUID.equals("null")){
- this.mOwnerName = mName;
- this.mOwnerUUID = mUUID;
- this.mIsOwnerOP = mOP;
- }
- }
- }
-
- public boolean isServerSide(){
- if (this.hasWorldObj()){
- if (!this.getWorldObj().isRemote){
- return true;
- }
- }
- return false;
- }
-
- public final boolean isClientSide() {
- return this.worldObj.isRemote;
- }
-
- public String getCustomName() {
- return this.customName;
- }
-
- public void setCustomName(String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.tileentity.name";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return this.customName != null && !this.customName.equals("");
- }
-
- @Override
- public int getSizeInventory() {
- return this.mInventory.getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(int aIndex) {
- return this.mInventory.getStackInSlot(aIndex);
- }
+ private String customName;
+ public String mOwnerName = "null";
+ public String mOwnerUUID = "null";
+ private boolean mIsOwnerOP = false;
+
+ public final BTF_Inventory mInventory;
+
+ public TileEntityBase(int aCapacity) {
+ mInventory = new BTF_Inventory(aCapacity, this);
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ nbt.setBoolean("mIsOwnerOP", this.mIsOwnerOP);
+ nbt.setString("mOwnerName", this.mOwnerName);
+ nbt.setString("mOwnerUUID", this.mOwnerUUID);
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+
+ super.readFromNBT(nbt);
+
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+
+ this.mIsOwnerOP = nbt.getBoolean("mIsOwnerOP");
+ this.mOwnerName = nbt.getString("mOwnerName");
+ this.mOwnerUUID = nbt.getString("mOwnerUUID");
+ }
+
+ @Override
+ public void updateEntity() {
+ long aTick = System.currentTimeMillis();
+ this.isDead = false;
+ if (!firstTicked) {
+ onFirstTick();
+ }
+ try {
+ if (this.isServerSide()) {
+ onPreTick(aTick);
+ }
+ } catch (Throwable t) {
+ Logger.ERROR("Tile Entity Encountered an error in it's pre-tick stage.");
+ t.printStackTrace();
+ }
+ try {
+ if (this.isServerSide()) {
+ onTick(aTick);
+ }
+ } catch (Throwable t) {
+ Logger.ERROR("Tile Entity Encountered an error in it's tick stage.");
+ t.printStackTrace();
+ }
+ try {
+ if (this.isServerSide()) {
+ onPostTick(aTick);
+ }
+ } catch (Throwable t) {
+ Logger.ERROR("Tile Entity Encountered an error in it's post-tick stage.");
+ t.printStackTrace();
+ }
+ }
+
+ public boolean onPreTick(long aTick) {
+ return true;
+ }
+
+ public boolean onTick(long aTick) {
+ try {
+ if (this.isServerSide()) {
+ processRecipe();
+ }
+ } catch (Throwable t) {
+ Logger.ERROR("Tile Entity Encountered an error in it's processing of a recipe stage.");
+ t.printStackTrace();
+ }
+ return true;
+ }
+
+ public boolean onPostTick(long aTick) {
+ return true;
+ }
+
+ public boolean processRecipe() {
+ return true;
+ }
+
+ @Override
+ public boolean canUpdate() {
+ return true;
+ }
+
+ public String getOwner() {
+ if (this.mOwnerName == null) {
+ return "null";
+ }
+ return this.mOwnerName;
+ }
+
+ public UUID getOwnerUUID() {
+ return UUID.fromString(this.mOwnerUUID);
+ }
+
+ public boolean isOwnerOP() {
+ return mIsOwnerOP;
+ }
+
+ public void setOwnerInformation(String mName, String mUUID, boolean mOP) {
+ if (isServerSide()) {
+ if (this.mOwnerName == null
+ || this.mOwnerUUID == null
+ || this.mOwnerName.equals("null")
+ || this.mOwnerUUID.equals("null")) {
+ this.mOwnerName = mName;
+ this.mOwnerUUID = mUUID;
+ this.mIsOwnerOP = mOP;
+ }
+ }
+ }
+
+ public boolean isServerSide() {
+ if (this.hasWorldObj()) {
+ if (!this.getWorldObj().isRemote) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public final boolean isClientSide() {
+ return this.worldObj.isRemote;
+ }
+
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ public void setCustomName(String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.tileentity.name";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.customName != null && !this.customName.equals("");
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.mInventory.getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex) {
+ return this.mInventory.getStackInSlot(aIndex);
+ }
@Override
public ItemStack decrStackSize(int aIndex, int aAmount) {
@@ -216,37 +216,37 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
return null;
}
- @Override
- public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
- return this.mInventory.getStackInSlotOnClosing(p_70304_1_);
- }
+ @Override
+ public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
+ return this.mInventory.getStackInSlotOnClosing(p_70304_1_);
+ }
- @Override
- public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
- this.mInventory.setInventorySlotContents(p_70299_1_, p_70299_2_);
- }
+ @Override
+ public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
+ this.mInventory.setInventorySlotContents(p_70299_1_, p_70299_2_);
+ }
- @Override
- public int getInventoryStackLimit() {
- return this.mInventory.getInventoryStackLimit();
- }
+ @Override
+ public int getInventoryStackLimit() {
+ return this.mInventory.getInventoryStackLimit();
+ }
- @Override
- public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
- return this.mInventory.isUseableByPlayer(p_70300_1_);
- }
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
+ return this.mInventory.isUseableByPlayer(p_70300_1_);
+ }
- @Override
- public void openInventory() {
- this.mInventory.openInventory();
- }
+ @Override
+ public void openInventory() {
+ this.mInventory.openInventory();
+ }
- @Override
- public void closeInventory() {
- this.mInventory.closeInventory();
- }
+ @Override
+ public void closeInventory() {
+ this.mInventory.closeInventory();
+ }
- /**
+ /**
* Can put aStack into Slot
*/
@Override
@@ -260,8 +260,21 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
*/
@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 mInventory.getAccessibleSlotsFromSide(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 mInventory.getAccessibleSlotsFromSide(aSide);
return new int[0];
}
@@ -270,7 +283,16 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
*/
@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) && mInventory.canInsertItem(aIndex, aStack, aSide);
+ return canAccessData()
+ && (mRunningThroughTick || !mInputDisabled)
+ && getCoverBehaviorAtSide((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getCoverDataAtSide((byte) aSide),
+ aIndex,
+ this)
+ && mInventory.canInsertItem(aIndex, aStack, aSide);
}
/**
@@ -278,566 +300,612 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
*/
@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) && mInventory.canExtractItem(aIndex, aStack, aSide);
- }
-
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return this.canAccessData() ? this.mInventory.isValidSlot(aIndex) : false;
- }
-
-
-
-
- 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 };
- protected TileEntityBase mMetaTileEntity;
- protected long mStoredEnergy = 0;
- protected int mAverageEUInputIndex = 0, mAverageEUOutputIndex = 0;
- protected boolean mReleaseEnergy = false;
- protected int[] mAverageEUInput = new int[11], mAverageEUOutput = new int[11];
- 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;
- protected boolean mRunningThroughTick = false;
- protected boolean mInputDisabled = false;
- protected boolean mOutputDisabled = false;
- private boolean mMuffler = false;
- private boolean mLockUpgrade = false;
- private boolean mActive = false;
- private boolean mRedstone = false;
- private boolean mWorkUpdate = false;
- private boolean mSteamConverter = false;
- private boolean mInventoryChanged = false;
- private boolean mWorks = true;
- private boolean mNeedsUpdate = true;
- private boolean mNeedsBlockUpdate = true;
- private boolean mSendClientData = false;
- private boolean oRedstone = false;
- private boolean mEnergyStateReady = false;
- private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0,
- oTexturePage = 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;
- protected long mTickTimer = 0;
- private long oOutput = 0;
- private long mAcceptedAmperes = Long.MAX_VALUE;
-
-
- /**
- * Cover Support
- */
-
- public void issueClientUpdate() {
- this.mSendClientData = true;
- }
-
+ return canAccessData()
+ && (mRunningThroughTick || !mOutputDisabled)
+ && getCoverBehaviorAtSide((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getCoverDataAtSide((byte) aSide),
+ aIndex,
+ this)
+ && mInventory.canExtractItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return this.canAccessData() ? this.mInventory.isValidSlot(aIndex) : false;
+ }
+
+ 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
+ };
+ protected TileEntityBase mMetaTileEntity;
+ protected long mStoredEnergy = 0;
+ protected int mAverageEUInputIndex = 0, mAverageEUOutputIndex = 0;
+ protected boolean mReleaseEnergy = false;
+ protected int[] mAverageEUInput = new int[11], mAverageEUOutput = new int[11];
+ 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;
+ protected boolean mRunningThroughTick = false;
+ protected boolean mInputDisabled = false;
+ protected boolean mOutputDisabled = false;
+ private boolean mMuffler = false;
+ private boolean mLockUpgrade = false;
+ private boolean mActive = false;
+ private boolean mRedstone = false;
+ private boolean mWorkUpdate = false;
+ private boolean mSteamConverter = false;
+ private boolean mInventoryChanged = false;
+ private boolean mWorks = true;
+ private boolean mNeedsUpdate = true;
+ private boolean mNeedsBlockUpdate = true;
+ private boolean mSendClientData = false;
+ private boolean oRedstone = false;
+ private boolean mEnergyStateReady = false;
+ private byte mColor = 0,
+ oColor = 0,
+ mStrongRedstone = 0,
+ oRedstoneData = 63,
+ oTextureData = 0,
+ oUpdateData = 0,
+ oTexturePage = 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;
+ protected long mTickTimer = 0;
+ private long oOutput = 0;
+ private long mAcceptedAmperes = Long.MAX_VALUE;
+
+ /**
+ * Cover Support
+ */
+ public void issueClientUpdate() {
+ this.mSendClientData = true;
+ }
+
protected final boolean canAccessData() {
return !isDead() && !this.isInvalid();
}
- @Override
- public void issueBlockUpdate() {
- super.markDirty();
- }
-
- @Override
- public void issueCoverUpdate(byte aSide) {
- this.issueClientUpdate();
- }
-
- @Override
- public void receiveCoverData(byte coverSide, int coverID, int coverData) {
- if ((coverSide >= 0 && coverSide < 6) && (mCoverSides[coverSide] == coverID))
- setCoverDataAtSide(coverSide, coverData);
- }
-
- @Override
- public long getTimer() {
- return this.mTickTimer;
- }
-
-
-
-
-
-
-
- public long getOutputAmperage() {
- return this.canAccessData() && this.mMetaTileEntity.isElectric() ? this.mMetaTileEntity.maxAmperesOut() : 0L;
- }
-
- public long getOutputVoltage() {
- return this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetOutput()
- ? this.mMetaTileEntity.maxEUOutput()
- : 0L;
- }
-
- public long getInputAmperage() {
- return this.canAccessData() && this.mMetaTileEntity.isElectric() ? this.mMetaTileEntity.maxAmperesIn() : 0L;
- }
-
- public long getInputVoltage() {
- return this.canAccessData() && this.mMetaTileEntity.isElectric()
- ? this.mMetaTileEntity.maxEUInput()
- : 2147483647L;
- }
-
- @Override
- public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
- return !this.canAccessData() ? false : (this.mHasEnoughEnergy = this.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy));
- }
-
- @Override
- public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
- if (!this.canAccessData()) {
- return false;
- } else if (this.getStoredEU() >= this.getEUCapacity() && !aIgnoreTooMuchEnergy) {
- return false;
- } else {
- this.setStoredEU(this.mMetaTileEntity.getEUVar() + aEnergy);
- return true;
- }
- }
-
- @Override
- public boolean inputEnergyFrom(byte aSide) {
- return aSide == 6
- ? true
- : (!this.isServerSide()
- ? this.isEnergyInputSide(aSide)
- : aSide >= 0 && aSide < 6 && this.mActiveEUInputs[aSide] && !this.mReleaseEnergy);
- }
-
- @Override
- public boolean outputsEnergyTo(byte aSide) {
- return aSide == 6
- ? true
- : (!this.isServerSide()
- ? this.isEnergyOutputSide(aSide)
- : aSide >= 0 && aSide < 6 && this.mActiveEUOutputs[aSide] || this.mReleaseEnergy);
- }
-
- private boolean isEnergyInputSide(byte aSide) {
- if (aSide >= 0 && aSide < 6) {
- if (!this.getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this)) {
- return false;
- }
-
- if (this.isInvalid() || this.mReleaseEnergy) {
- return false;
- }
-
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetInput()) {
- return this.mMetaTileEntity.isInputFacing(aSide);
- }
- }
-
- return false;
- }
-
- private boolean isEnergyOutputSide(byte aSide) {
- if (aSide >= 0 && aSide < 6) {
- if (!this.getCoverBehaviorAtSide(aSide).letsEnergyOut(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this)) {
- return false;
- }
-
- if (this.isInvalid() || this.mReleaseEnergy) {
- return this.mReleaseEnergy;
- }
-
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetOutput()) {
- return this.mMetaTileEntity.isOutputFacing(aSide);
- }
- }
-
- return false;
- }
-
- public boolean isOutputFacing(byte aSide) {
- return false;
- }
-
- public boolean isInputFacing(byte aSide) {
- return false;
- }
-
- private final TileEntity[] mBufferedTileEntities = new TileEntity[6];
- public boolean ignoreUnloadedChunks = true;
- public boolean isDead = false;
-
- private final void clearNullMarkersFromTileEntityBuffer() {
- for (int i = 0; i < this.mBufferedTileEntities.length; ++i) {
- if (this.mBufferedTileEntities[i] == this) {
- this.mBufferedTileEntities[i] = null;
- }
- }
-
- }
-
- protected final void clearTileEntityBuffer() {
- for (int i = 0; i < this.mBufferedTileEntities.length; ++i) {
- this.mBufferedTileEntities[i] = null;
- }
-
- }
-
- public final World getWorld() {
- return this.worldObj;
- }
-
- public final int getXCoord() {
- return this.xCoord;
- }
-
- public final short getYCoord() {
- return (short) this.yCoord;
- }
-
- public final int getZCoord() {
- return this.zCoord;
- }
-
- public final int getOffsetX(byte aSide, int aMultiplier) {
- return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier;
- }
-
- public final short getOffsetY(byte aSide, int aMultiplier) {
- return (short) (this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier);
- }
-
- public final int getOffsetZ(byte aSide, int aMultiplier) {
- return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier;
- }
-
- public final boolean openGUI(EntityPlayer aPlayer) {
- return this.openGUI(aPlayer, 0);
- }
-
- public final boolean openGUI(EntityPlayer aPlayer, int aID) {
- if (aPlayer == null) {
- return false;
- } else {
- aPlayer.openGui(GT_Values.GT, aID, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
- return true;
- }
- }
-
- public final int getRandomNumber(int aRange) {
- return this.worldObj.rand.nextInt(aRange);
- }
-
- public final BiomeGenBase getBiome(int aX, int aZ) {
- return this.worldObj.getBiomeGenForCoords(aX, aZ);
- }
-
- public final BiomeGenBase getBiome() {
- return this.getBiome(this.xCoord, this.zCoord);
- }
-
- public final Block getBlockOffset(int aX, int aY, int aZ) {
- return this.getBlock(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
- }
-
- public final Block getBlockAtSide(byte aSide) {
- return this.getBlockAtSideAndDistance(aSide, 1);
- }
-
- public final Block getBlockAtSideAndDistance(byte aSide, int aDistance) {
- return this.getBlock(this.getOffsetX(aSide, aDistance), this.getOffsetY(aSide, aDistance),
- this.getOffsetZ(aSide, aDistance));
- }
-
- public final byte getMetaIDOffset(int aX, int aY, int aZ) {
- return this.getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
- }
-
- public final byte getMetaIDAtSide(byte aSide) {
- return this.getMetaIDAtSideAndDistance(aSide, 1);
- }
-
- public final byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) {
- return this.getMetaID(this.getOffsetX(aSide, aDistance), this.getOffsetY(aSide, aDistance),
- this.getOffsetZ(aSide, aDistance));
- }
-
- public final byte getLightLevelOffset(int aX, int aY, int aZ) {
- return this.getLightLevel(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
- }
-
- public final byte getLightLevelAtSide(byte aSide) {
- return this.getLightLevelAtSideAndDistance(aSide, 1);
- }
-
- public final byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) {
- return this.getLightLevel(this.getOffsetX(aSide, aDistance), this.getOffsetY(aSide, aDistance),
- this.getOffsetZ(aSide, aDistance));
- }
-
- public final boolean getOpacityOffset(int aX, int aY, int aZ) {
- return this.getOpacity(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
- }
-
- public final boolean getOpacityAtSide(byte aSide) {
- return this.getOpacityAtSideAndDistance(aSide, 1);
- }
-
- public final boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) {
- return this.getOpacity(this.getOffsetX(aSide, aDistance), this.getOffsetY(aSide, aDistance),
- this.getOffsetZ(aSide, aDistance));
- }
-
- public final boolean getSkyOffset(int aX, int aY, int aZ) {
- return this.getSky(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
- }
-
- public final boolean getSkyAtSide(byte aSide) {
- return this.getSkyAtSideAndDistance(aSide, 1);
- }
-
- public final boolean getSkyAtSideAndDistance(byte aSide, int aDistance) {
- return this.getSky(this.getOffsetX(aSide, aDistance), this.getOffsetY(aSide, aDistance),
- this.getOffsetZ(aSide, aDistance));
- }
-
- public final boolean getAirOffset(int aX, int aY, int aZ) {
- return this.getAir(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
- }
-
- public final boolean getAirAtSide(byte aSide) {
- return this.getAirAtSideAndDistance(aSide, 1);
- }
-
- public final boolean getAirAtSideAndDistance(byte aSide, int aDistance) {
- return this.getAir(this.getOffsetX(aSide, aDistance), this.getOffsetY(aSide, aDistance),
- this.getOffsetZ(aSide, aDistance));
- }
-
- public final TileEntity getTileEntityOffset(int aX, int aY, int aZ) {
- return this.getTileEntity(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
- }
-
- public final TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) {
- return aDistance == 1
- ? this.getTileEntityAtSide(aSide)
- : this.getTileEntity(this.getOffsetX(aSide, aDistance), this.getOffsetY(aSide, aDistance),
- this.getOffsetZ(aSide, aDistance));
- }
-
- public final IInventory getIInventory(int aX, int aY, int aZ) {
- TileEntity tTileEntity = this.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IInventory ? (IInventory) tTileEntity : null;
- }
-
- public final IInventory getIInventoryOffset(int aX, int aY, int aZ) {
- TileEntity tTileEntity = this.getTileEntityOffset(aX, aY, aZ);
- return tTileEntity instanceof IInventory ? (IInventory) tTileEntity : null;
- }
-
- public final IInventory getIInventoryAtSide(byte aSide) {
- TileEntity tTileEntity = this.getTileEntityAtSide(aSide);
- return tTileEntity instanceof IInventory ? (IInventory) tTileEntity : null;
- }
-
- public final IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) {
- TileEntity tTileEntity = this.getTileEntityAtSideAndDistance(aSide, aDistance);
- return tTileEntity instanceof IInventory ? (IInventory) tTileEntity : null;
- }
-
- public final IFluidHandler getITankContainer(int aX, int aY, int aZ) {
- TileEntity tTileEntity = this.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IFluidHandler ? (IFluidHandler) tTileEntity : null;
- }
-
- public final IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) {
- TileEntity tTileEntity = this.getTileEntityOffset(aX, aY, aZ);
- return tTileEntity instanceof IFluidHandler ? (IFluidHandler) tTileEntity : null;
- }
-
- public final IFluidHandler getITankContainerAtSide(byte aSide) {
- TileEntity tTileEntity = this.getTileEntityAtSide(aSide);
- return tTileEntity instanceof IFluidHandler ? (IFluidHandler) tTileEntity : null;
- }
-
- public final IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) {
- TileEntity tTileEntity = this.getTileEntityAtSideAndDistance(aSide, aDistance);
- return tTileEntity instanceof IFluidHandler ? (IFluidHandler) tTileEntity : null;
- }
-
- public final IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) {
- TileEntity tTileEntity = this.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTileEntity : null;
- }
-
- public final IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) {
- TileEntity tTileEntity = this.getTileEntityOffset(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTileEntity : null;
- }
-
- public final IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) {
- TileEntity tTileEntity = this.getTileEntityAtSide(aSide);
- return tTileEntity instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTileEntity : null;
- }
-
- public final IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) {
- TileEntity tTileEntity = this.getTileEntityAtSideAndDistance(aSide, aDistance);
- return tTileEntity instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTileEntity : null;
- }
-
- public final Block getBlock(int aX, int aY, int aZ) {
- return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? Blocks.air
- : this.worldObj.getBlock(aX, aY, aZ);
- }
-
- public final byte getMetaID(int aX, int aY, int aZ) {
- return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? 0
- : (byte) this.worldObj.getBlockMetadata(aX, aY, aZ);
- }
-
- public final byte getLightLevel(int aX, int aY, int aZ) {
- return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? 0
- : (byte) ((int) (this.worldObj.getLightBrightness(aX, aY, aZ) * 15.0F));
- }
-
- public final boolean getSky(int aX, int aY, int aZ) {
- return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? true
- : this.worldObj.canBlockSeeTheSky(aX, aY, aZ);
- }
-
- public final boolean getOpacity(int aX, int aY, int aZ) {
- return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? false
- : GT_Utility.isOpaqueBlock(this.worldObj, aX, aY, aZ);
- }
-
- public final boolean getAir(int aX, int aY, int aZ) {
- return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? true
- : GT_Utility.isBlockAir(this.worldObj, aX, aY, aZ);
- }
-
- public final TileEntity getTileEntity(int aX, int aY, int aZ) {
- return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
- ? null
- : this.worldObj.getTileEntity(aX, aY, aZ);
- }
-
- public final TileEntity getTileEntityAtSide(byte aSide) {
- if (aSide >= 0 && aSide < 6 && this.mBufferedTileEntities[aSide] != this) {
- int tX = this.getOffsetX(aSide, 1);
- short tY = this.getOffsetY(aSide, 1);
- int tZ = this.getOffsetZ(aSide, 1);
- if (this.crossedChunkBorder(tX, tZ)) {
- this.mBufferedTileEntities[aSide] = null;
- if (this.ignoreUnloadedChunks && !this.worldObj.blockExists(tX, tY, tZ)) {
- return null;
- }
- }
-
- if (this.mBufferedTileEntities[aSide] == null) {
- this.mBufferedTileEntities[aSide] = this.worldObj.getTileEntity(tX, tY, tZ);
- if (this.mBufferedTileEntities[aSide] == null) {
- this.mBufferedTileEntities[aSide] = this;
- return null;
- } else {
- return this.mBufferedTileEntities[aSide];
- }
- } else if (this.mBufferedTileEntities[aSide].isInvalid()) {
- this.mBufferedTileEntities[aSide] = null;
- return this.getTileEntityAtSide(aSide);
- } else {
- return this.mBufferedTileEntities[aSide].xCoord == tX && this.mBufferedTileEntities[aSide].yCoord == tY
- && this.mBufferedTileEntities[aSide].zCoord == tZ ? this.mBufferedTileEntities[aSide] : null;
- }
- } else {
- return null;
- }
- }
-
- public boolean isDead() {
- return this.isDead || this.isInvalidTileEntity();
- }
-
- public void validate() {
- this.clearNullMarkersFromTileEntityBuffer();
- super.validate();
- }
-
- public void invalidate() {
- this.clearNullMarkersFromTileEntityBuffer();
- super.invalidate();
- }
-
- public void onChunkUnload() {
- this.clearNullMarkersFromTileEntityBuffer();
- super.onChunkUnload();
- this.isDead = true;
- }
-
- public final void onAdjacentBlockChange(int aX, int aY, int aZ) {
- this.clearNullMarkersFromTileEntityBuffer();
- }
-
- public final void sendBlockEvent(byte aID, byte aValue) {
- GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj,
- new GT_Packet_Block_Event(this.xCoord, (short) this.yCoord, this.zCoord, aID, aValue), this.xCoord,
- this.zCoord);
- }
-
- private boolean crossedChunkBorder(int aX, int aZ) {
- return aX >> 4 != this.xCoord >> 4 || aZ >> 4 != this.zCoord >> 4;
- }
-
- public final void setOnFire() {
- GT_Utility.setCoordsOnFire(this.worldObj, this.xCoord, this.yCoord, this.zCoord, false);
- }
-
- public final void setToFire() {
- this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, Blocks.fire);
- }
-
- public String trans(String aKey, String aEnglish) {
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
- }
+ @Override
+ public void issueBlockUpdate() {
+ super.markDirty();
+ }
+
+ @Override
+ public void issueCoverUpdate(byte aSide) {
+ this.issueClientUpdate();
+ }
+
+ @Override
+ public void receiveCoverData(byte coverSide, int coverID, int coverData) {
+ if ((coverSide >= 0 && coverSide < 6) && (mCoverSides[coverSide] == coverID))
+ setCoverDataAtSide(coverSide, coverData);
+ }
+
+ @Override
+ public long getTimer() {
+ return this.mTickTimer;
+ }
+
+ public long getOutputAmperage() {
+ return this.canAccessData() && this.mMetaTileEntity.isElectric() ? this.mMetaTileEntity.maxAmperesOut() : 0L;
+ }
+
+ public long getOutputVoltage() {
+ return this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetOutput()
+ ? this.mMetaTileEntity.maxEUOutput()
+ : 0L;
+ }
+
+ public long getInputAmperage() {
+ return this.canAccessData() && this.mMetaTileEntity.isElectric() ? this.mMetaTileEntity.maxAmperesIn() : 0L;
+ }
+
+ public long getInputVoltage() {
+ return this.canAccessData() && this.mMetaTileEntity.isElectric()
+ ? this.mMetaTileEntity.maxEUInput()
+ : 2147483647L;
+ }
+
+ @Override
+ public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ return !this.canAccessData()
+ ? false
+ : (this.mHasEnoughEnergy = this.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy));
+ }
+
+ @Override
+ public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ if (!this.canAccessData()) {
+ return false;
+ } else if (this.getStoredEU() >= this.getEUCapacity() && !aIgnoreTooMuchEnergy) {
+ return false;
+ } else {
+ this.setStoredEU(this.mMetaTileEntity.getEUVar() + aEnergy);
+ return true;
+ }
+ }
+
+ @Override
+ public boolean inputEnergyFrom(byte aSide) {
+ return aSide == 6
+ ? true
+ : (!this.isServerSide()
+ ? this.isEnergyInputSide(aSide)
+ : aSide >= 0 && aSide < 6 && this.mActiveEUInputs[aSide] && !this.mReleaseEnergy);
+ }
+
+ @Override
+ public boolean outputsEnergyTo(byte aSide) {
+ return aSide == 6
+ ? true
+ : (!this.isServerSide()
+ ? this.isEnergyOutputSide(aSide)
+ : aSide >= 0 && aSide < 6 && this.mActiveEUOutputs[aSide] || this.mReleaseEnergy);
+ }
+
+ private boolean isEnergyInputSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) {
+ if (!this.getCoverBehaviorAtSide(aSide)
+ .letsEnergyIn(aSide, this.getCoverIDAtSide(aSide), this.getCoverDataAtSide(aSide), this)) {
+ return false;
+ }
+
+ if (this.isInvalid() || this.mReleaseEnergy) {
+ return false;
+ }
+
+ if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetInput()) {
+ return this.mMetaTileEntity.isInputFacing(aSide);
+ }
+ }
+
+ return false;
+ }
+
+ private boolean isEnergyOutputSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) {
+ if (!this.getCoverBehaviorAtSide(aSide)
+ .letsEnergyOut(aSide, this.getCoverIDAtSide(aSide), this.getCoverDataAtSide(aSide), this)) {
+ return false;
+ }
+
+ if (this.isInvalid() || this.mReleaseEnergy) {
+ return this.mReleaseEnergy;
+ }
+
+ if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetOutput()) {
+ return this.mMetaTileEntity.isOutputFacing(aSide);
+ }
+ }
+
+ return false;
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
+
+ public boolean isInputFacing(byte aSide) {
+ return false;
+ }
+
+ private final TileEntity[] mBufferedTileEntities = new TileEntity[6];
+ public boolean ignoreUnloadedChunks = true;
+ public boolean isDead = false;
+
+ private final void clearNullMarkersFromTileEntityBuffer() {
+ for (int i = 0; i < this.mBufferedTileEntities.length; ++i) {
+ if (this.mBufferedTileEntities[i] == this) {
+ this.mBufferedTileEntities[i] = null;
+ }
+ }
+ }
+
+ protected final void clearTileEntityBuffer() {
+ for (int i = 0; i < this.mBufferedTileEntities.length; ++i) {
+ this.mBufferedTileEntities[i] = null;
+ }
+ }
+
+ public final World getWorld() {
+ return this.worldObj;
+ }
+
+ public final int getXCoord() {
+ return this.xCoord;
+ }
+
+ public final short getYCoord() {
+ return (short) this.yCoord;
+ }
+
+ public final int getZCoord() {
+ return this.zCoord;
+ }
+
+ public final int getOffsetX(byte aSide, int aMultiplier) {
+ return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier;
+ }
+
+ public final short getOffsetY(byte aSide, int aMultiplier) {
+ return (short) (this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier);
+ }
+
+ public final int getOffsetZ(byte aSide, int aMultiplier) {
+ return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier;
+ }
+
+ public final boolean openGUI(EntityPlayer aPlayer) {
+ return this.openGUI(aPlayer, 0);
+ }
+
+ public final boolean openGUI(EntityPlayer aPlayer, int aID) {
+ if (aPlayer == null) {
+ return false;
+ } else {
+ aPlayer.openGui(GT_Values.GT, aID, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
+ return true;
+ }
+ }
+
+ public final int getRandomNumber(int aRange) {
+ return this.worldObj.rand.nextInt(aRange);
+ }
+
+ public final BiomeGenBase getBiome(int aX, int aZ) {
+ return this.worldObj.getBiomeGenForCoords(aX, aZ);
+ }
+
+ public final BiomeGenBase getBiome() {
+ return this.getBiome(this.xCoord, this.zCoord);
+ }
+
+ public final Block getBlockOffset(int aX, int aY, int aZ) {
+ return this.getBlock(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
+ }
+
+ public final Block getBlockAtSide(byte aSide) {
+ return this.getBlockAtSideAndDistance(aSide, 1);
+ }
+
+ public final Block getBlockAtSideAndDistance(byte aSide, int aDistance) {
+ return this.getBlock(
+ this.getOffsetX(aSide, aDistance),
+ this.getOffsetY(aSide, aDistance),
+ this.getOffsetZ(aSide, aDistance));
+ }
+
+ public final byte getMetaIDOffset(int aX, int aY, int aZ) {
+ return this.getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
+ }
+
+ public final byte getMetaIDAtSide(byte aSide) {
+ return this.getMetaIDAtSideAndDistance(aSide, 1);
+ }
+
+ public final byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) {
+ return this.getMetaID(
+ this.getOffsetX(aSide, aDistance),
+ this.getOffsetY(aSide, aDistance),
+ this.getOffsetZ(aSide, aDistance));
+ }
+
+ public final byte getLightLevelOffset(int aX, int aY, int aZ) {
+ return this.getLightLevel(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
+ }
+
+ public final byte getLightLevelAtSide(byte aSide) {
+ return this.getLightLevelAtSideAndDistance(aSide, 1);
+ }
+
+ public final byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) {
+ return this.getLightLevel(
+ this.getOffsetX(aSide, aDistance),
+ this.getOffsetY(aSide, aDistance),
+ this.getOffsetZ(aSide, aDistance));
+ }
+
+ public final boolean getOpacityOffset(int aX, int aY, int aZ) {
+ return this.getOpacity(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
+ }
+
+ public final boolean getOpacityAtSide(byte aSide) {
+ return this.getOpacityAtSideAndDistance(aSide, 1);
+ }
+
+ public final boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) {
+ return this.getOpacity(
+ this.getOffsetX(aSide, aDistance),
+ this.getOffsetY(aSide, aDistance),
+ this.getOffsetZ(aSide, aDistance));
+ }
+
+ public final boolean getSkyOffset(int aX, int aY, int aZ) {
+ return this.getSky(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
+ }
+
+ public final boolean getSkyAtSide(byte aSide) {
+ return this.getSkyAtSideAndDistance(aSide, 1);
+ }
+
+ public final boolean getSkyAtSideAndDistance(byte aSide, int aDistance) {
+ return this.getSky(
+ this.getOffsetX(aSide, aDistance),
+ this.getOffsetY(aSide, aDistance),
+ this.getOffsetZ(aSide, aDistance));
+ }
+
+ public final boolean getAirOffset(int aX, int aY, int aZ) {
+ return this.getAir(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
+ }
+
+ public final boolean getAirAtSide(byte aSide) {
+ return this.getAirAtSideAndDistance(aSide, 1);
+ }
+
+ public final boolean getAirAtSideAndDistance(byte aSide, int aDistance) {
+ return this.getAir(
+ this.getOffsetX(aSide, aDistance),
+ this.getOffsetY(aSide, aDistance),
+ this.getOffsetZ(aSide, aDistance));
+ }
+
+ public final TileEntity getTileEntityOffset(int aX, int aY, int aZ) {
+ return this.getTileEntity(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
+ }
+
+ public final TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) {
+ return aDistance == 1
+ ? this.getTileEntityAtSide(aSide)
+ : this.getTileEntity(
+ this.getOffsetX(aSide, aDistance),
+ this.getOffsetY(aSide, aDistance),
+ this.getOffsetZ(aSide, aDistance));
+ }
+
+ public final IInventory getIInventory(int aX, int aY, int aZ) {
+ TileEntity tTileEntity = this.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IInventory ? (IInventory) tTileEntity : null;
+ }
+
+ public final IInventory getIInventoryOffset(int aX, int aY, int aZ) {
+ TileEntity tTileEntity = this.getTileEntityOffset(aX, aY, aZ);
+ return tTileEntity instanceof IInventory ? (IInventory) tTileEntity : null;
+ }
+
+ public final IInventory getIInventoryAtSide(byte aSide) {
+ TileEntity tTileEntity = this.getTileEntityAtSide(aSide);
+ return tTileEntity instanceof IInventory ? (IInventory) tTileEntity : null;
+ }
+
+ public final IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) {
+ TileEntity tTileEntity = this.getTileEntityAtSideAndDistance(aSide, aDistance);
+ return tTileEntity instanceof IInventory ? (IInventory) tTileEntity : null;
+ }
+
+ public final IFluidHandler getITankContainer(int aX, int aY, int aZ) {
+ TileEntity tTileEntity = this.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IFluidHandler ? (IFluidHandler) tTileEntity : null;
+ }
+
+ public final IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) {
+ TileEntity tTileEntity = this.getTileEntityOffset(aX, aY, aZ);
+ return tTileEntity instanceof IFluidHandler ? (IFluidHandler) tTileEntity : null;
+ }
+
+ public final IFluidHandler getITankContainerAtSide(byte aSide) {
+ TileEntity tTileEntity = this.getTileEntityAtSide(aSide);
+ return tTileEntity instanceof IFluidHandler ? (IFluidHandler) tTileEntity : null;
+ }
+
+ public final IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) {
+ TileEntity tTileEntity = this.getTileEntityAtSideAndDistance(aSide, aDistance);
+ return tTileEntity instanceof IFluidHandler ? (IFluidHandler) tTileEntity : null;
+ }
+
+ public final IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) {
+ TileEntity tTileEntity = this.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTileEntity : null;
+ }
+
+ public final IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) {
+ TileEntity tTileEntity = this.getTileEntityOffset(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTileEntity : null;
+ }
+
+ public final IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) {
+ TileEntity tTileEntity = this.getTileEntityAtSide(aSide);
+ return tTileEntity instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTileEntity : null;
+ }
+
+ public final IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) {
+ TileEntity tTileEntity = this.getTileEntityAtSideAndDistance(aSide, aDistance);
+ return tTileEntity instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTileEntity : null;
+ }
+
+ public final Block getBlock(int aX, int aY, int aZ) {
+ return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
+ ? Blocks.air
+ : this.worldObj.getBlock(aX, aY, aZ);
+ }
+
+ public final byte getMetaID(int aX, int aY, int aZ) {
+ return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
+ ? 0
+ : (byte) this.worldObj.getBlockMetadata(aX, aY, aZ);
+ }
+
+ public final byte getLightLevel(int aX, int aY, int aZ) {
+ return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
+ ? 0
+ : (byte) ((int) (this.worldObj.getLightBrightness(aX, aY, aZ) * 15.0F));
+ }
+
+ public final boolean getSky(int aX, int aY, int aZ) {
+ return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
+ ? true
+ : this.worldObj.canBlockSeeTheSky(aX, aY, aZ);
+ }
+
+ public final boolean getOpacity(int aX, int aY, int aZ) {
+ return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
+ ? false
+ : GT_Utility.isOpaqueBlock(this.worldObj, aX, aY, aZ);
+ }
+
+ public final boolean getAir(int aX, int aY, int aZ) {
+ return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
+ ? true
+ : GT_Utility.isBlockAir(this.worldObj, aX, aY, aZ);
+ }
+
+ public final TileEntity getTileEntity(int aX, int aY, int aZ) {
+ return this.ignoreUnloadedChunks && this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ)
+ ? null
+ : this.worldObj.getTileEntity(aX, aY, aZ);
+ }
+
+ public final TileEntity getTileEntityAtSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6 && this.mBufferedTileEntities[aSide] != this) {
+ int tX = this.getOffsetX(aSide, 1);
+ short tY = this.getOffsetY(aSide, 1);
+ int tZ = this.getOffsetZ(aSide, 1);
+ if (this.crossedChunkBorder(tX, tZ)) {
+ this.mBufferedTileEntities[aSide] = null;
+ if (this.ignoreUnloadedChunks && !this.worldObj.blockExists(tX, tY, tZ)) {
+ return null;
+ }
+ }
+
+ if (this.mBufferedTileEntities[aSide] == null) {
+ this.mBufferedTileEntities[aSide] = this.worldObj.getTileEntity(tX, tY, tZ);
+ if (this.mBufferedTileEntities[aSide] == null) {
+ this.mBufferedTileEntities[aSide] = this;
+ return null;
+ } else {
+ return this.mBufferedTileEntities[aSide];
+ }
+ } else if (this.mBufferedTileEntities[aSide].isInvalid()) {
+ this.mBufferedTileEntities[aSide] = null;
+ return this.getTileEntityAtSide(aSide);
+ } else {
+ return this.mBufferedTileEntities[aSide].xCoord == tX
+ && this.mBufferedTileEntities[aSide].yCoord == tY
+ && this.mBufferedTileEntities[aSide].zCoord == tZ
+ ? this.mBufferedTileEntities[aSide]
+ : null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public boolean isDead() {
+ return this.isDead || this.isInvalidTileEntity();
+ }
+
+ public void validate() {
+ this.clearNullMarkersFromTileEntityBuffer();
+ super.validate();
+ }
+
+ public void invalidate() {
+ this.clearNullMarkersFromTileEntityBuffer();
+ super.invalidate();
+ }
+
+ public void onChunkUnload() {
+ this.clearNullMarkersFromTileEntityBuffer();
+ super.onChunkUnload();
+ this.isDead = true;
+ }
+
+ public final void onAdjacentBlockChange(int aX, int aY, int aZ) {
+ this.clearNullMarkersFromTileEntityBuffer();
+ }
+
+ public final void sendBlockEvent(byte aID, byte aValue) {
+ GT_Values.NW.sendPacketToAllPlayersInRange(
+ this.worldObj,
+ new GT_Packet_Block_Event(this.xCoord, (short) this.yCoord, this.zCoord, aID, aValue),
+ this.xCoord,
+ this.zCoord);
+ }
+
+ private boolean crossedChunkBorder(int aX, int aZ) {
+ return aX >> 4 != this.xCoord >> 4 || aZ >> 4 != this.zCoord >> 4;
+ }
+
+ public final void setOnFire() {
+ GT_Utility.setCoordsOnFire(this.worldObj, this.xCoord, this.yCoord, this.zCoord, false);
+ }
+
+ public final void setToFire() {
+ this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, Blocks.fire);
+ }
+
+ public String trans(String aKey, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ }
@Override
public byte getInternalInputRedstoneSignal(byte aSide) {
- return (byte) (getCoverBehaviorAtSide(aSide).getRedstoneInput(aSide, getInputRedstoneSignal(aSide), getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) & 15);
+ 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);
+ return (byte) (worldObj.getIndirectPowerLevelTo(
+ getOffsetX(aSide, 1), getOffsetY(aSide, 1), getOffsetZ(aSide, 1), aSide)
+ & 15);
}
@Override
public byte getOutputRedstoneSignal(byte aSide) {
- return getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ? mSidedRedstone[aSide] : getGeneralRS(aSide);
+ return getCoverBehaviorAtSide(aSide)
+ .manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)
+ ? mSidedRedstone[aSide]
+ : getGeneralRS(aSide);
+ }
+
+ public boolean allowGeneralRedstoneOutput() {
+ return false;
}
-
- public boolean allowGeneralRedstoneOutput() {
- return false;
- }
-
- public byte getGeneralRS(byte aSide){
- return allowGeneralRedstoneOutput() ? mSidedRedstone[aSide] : 0;
+
+ public byte getGeneralRS(byte aSide) {
+ return allowGeneralRedstoneOutput() ? mSidedRedstone[aSide] : 0;
}
@Override
public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength) {
- if (!getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ if (!getCoverBehaviorAtSide(aSide)
+ .manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
setOutputRedstoneSignal(aSide, aStrength);
}
@@ -873,24 +941,24 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
}
}
- @Override
- public boolean setCoverIDAtSideNoUpdate(byte aSide, int aID) {
- if (aSide >= 0 && aSide < 6) {
- mCoverSides[aSide] = aID;
- mCoverData[aSide] = 0;
- mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID);
- return true;
- }
- return false;
- }
-
- @Override
- public void setCoverIdAndDataAtSide(byte aSide, int aId, ISerializableObject aData) {
- setCoverIDAtSide(aSide, aId);
- setCoverDataAtSide(aSide, aData);
- }
-
- @Override
+ @Override
+ public boolean setCoverIDAtSideNoUpdate(byte aSide, int aID) {
+ if (aSide >= 0 && aSide < 6) {
+ mCoverSides[aSide] = aID;
+ mCoverData[aSide] = 0;
+ mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void setCoverIdAndDataAtSide(byte aSide, int aId, ISerializableObject aData) {
+ setCoverIDAtSide(aSide, aId);
+ setCoverDataAtSide(aSide, aData);
+ }
+
+ @Override
public void setCoverItemAtSide(byte aSide, ItemStack aCover) {
GregTech_API.getCoverBehavior(aCover).placeCover(aSide, aCover, this);
}
@@ -940,8 +1008,7 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
public long getAverageElectricInput() {
int rEU = 0;
for (int i = 0; i < mAverageEUInput.length; i++) {
- if (i != mAverageEUInputIndex)
- rEU += mAverageEUInput[i];
+ if (i != mAverageEUInputIndex) rEU += mAverageEUInput[i];
}
return rEU / (mAverageEUInput.length - 1);
}
@@ -950,23 +1017,30 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
public long getAverageElectricOutput() {
int rEU = 0;
for (int i = 0; i < mAverageEUOutput.length; i++) {
- if (i != mAverageEUOutputIndex)
- rEU += mAverageEUOutput[i];
+ if (i != mAverageEUOutputIndex) rEU += mAverageEUOutput[i];
}
return rEU / (mAverageEUOutput.length - 1);
}
- public boolean hasSidedRedstoneOutputBehavior() {
- return false;
- }
+ public boolean hasSidedRedstoneOutputBehavior() {
+ return false;
+ }
@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 (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);
+ 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;
@@ -1000,7 +1074,9 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
@Override
public byte getStrongOutputRedstoneSignal(byte aSide) {
- return aSide >= 0 && aSide < 6 && (mStrongRedstone & (1 << aSide)) != 0 ? (byte) (mSidedRedstone[aSide] & 15) : 0;
+ return aSide >= 0 && aSide < 6 && (mStrongRedstone & (1 << aSide)) != 0
+ ? (byte) (mSidedRedstone[aSide] & 15)
+ : 0;
}
@Override
@@ -1011,13 +1087,25 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
@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 (!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)) {
+ 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;
@@ -1027,8 +1115,10 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
@Override
public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (!canAccessData() || !mMetaTileEntity.isElectric() || !outputsEnergyTo(aSide) || getStoredEU() - (aVoltage * aAmperage) < mMetaTileEntity.getMinimumStoredEU())
- return false;
+ if (!canAccessData()
+ || !mMetaTileEntity.isElectric()
+ || !outputsEnergyTo(aSide)
+ || getStoredEU() - (aVoltage * aAmperage) < mMetaTileEntity.getMinimumStoredEU()) return false;
if (decreaseStoredEU(aVoltage * aAmperage, false)) {
mAverageEUOutput[mAverageEUOutputIndex] += aVoltage * aAmperage;
return true;
@@ -1036,106 +1126,87 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
return false;
}
-
public double getOutputEnergyUnitsPerTick() {
return oOutput;
}
-
public boolean isTeleporterCompatible(ForgeDirection aSide) {
return false;
}
-
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;
+ 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);
+ 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 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 void setStored(int aEU) {
if (canAccessData()) setStoredEU(aEU);
}
-
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;
}
@@ -1144,7 +1215,6 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
return inputEnergyFrom((byte) aDirection.toSideValue());
}
-
public boolean emitsEnergyTo(TileEntity aReceiver, Direction aDirection) {
return outputsEnergyTo((byte) aDirection.toSideValue());
}
@@ -1164,7 +1234,9 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
return true;
}
aStack = GT_OreDictUnificator.get(aStack);
- if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) {
+ if (GT_Utility.areStacksEqual(tStack, aStack)
+ && tStack.stackSize + aStack.stackSize
+ <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) {
tStack.stackSize += aStack.stackSize;
return true;
}
@@ -1182,181 +1254,170 @@ public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregT
mInventoryChanged = true;
}
-
-
/**
* To Do
*/
-
- public boolean isElectric() {
- return true;
- }
-
- public boolean isEnetOutput() {
- return false;
- }
-
- public boolean isEnetInput() {
- return false;
- }
-
- public long maxEUStore() {
- return 0L;
- }
-
- public long maxEUInput() {
- return 0L;
- }
-
- public long maxEUOutput() {
- return 0L;
- }
-
- public long maxAmperesOut() {
- return 1L;
- }
-
- public long maxAmperesIn() {
- return 1L;
- }
-
- public void doEnergyExplosion() {
- if (this.getUniversalEnergyCapacity() > 0L
- && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) {
- this.doExplosion(this.oOutput * (long) (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity()
- ? 4
- : (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2L ? 2 : 1)));
- GT_Mod arg9999 = GT_Mod.instance;
- GT_Mod.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(this.mOwnerName),
- "electricproblems");
- }
-
- }
-
- public void doExplosion(long aAmount) {
- if (this.canAccessData()) {
- if (GregTech_API.sMachineWireFire && this.mMetaTileEntity.isElectric()) {
- try {
- this.mReleaseEnergy = true;
- Util.emitEnergyToNetwork(GT_Values.V[5], Math.max(1L, this.getStoredEU() / GT_Values.V[5]), this);
- } catch (Exception arg4) {
- }
- }
- this.mReleaseEnergy = false;
- this.onExplosion();
- PollutionUtils.addPollution(this, 100000);
- this.mMetaTileEntity.doExplosion(aAmount);
- }
-
- }
-
- public void onExplosion() {
-
- }
-
- @Override
- public String[] getDescription() {
- return this.canAccessData() ? this.mMetaTileEntity.getDescription() : new String[0];
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public String[] getInfoData() {
- return null;
- }
-
- public long getEUVar() {
- return this.mStoredEnergy;
- }
-
- public void setEUVar(long aEnergy) {
- this.mStoredEnergy = aEnergy;
- }
-
- public long getStoredEU() {
- return this.canAccessData() ? Math.min(this.mMetaTileEntity.getEUVar(), this.getEUCapacity()) : 0L;
- }
-
- public long getEUCapacity() {
- return this.canAccessData() ? this.mMetaTileEntity.maxEUStore() : 0L;
- }
-
- public long getMinimumStoredEU() {
- return 512L;
- }
-
- public boolean setStoredEU(long aEnergy) {
- if (!this.canAccessData()) {
- return false;
- } else {
- if (aEnergy < 0L) {
- aEnergy = 0L;
- }
-
- this.mMetaTileEntity.setEUVar(aEnergy);
- return true;
- }
- }
-
- public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) {
- if (!this.canAccessData()) {
- return false;
- } else if (this.mMetaTileEntity.getEUVar() - aEnergy < 0L && !aIgnoreTooLessEnergy) {
- return false;
- } else {
- this.setStoredEU(this.mMetaTileEntity.getEUVar() - aEnergy);
- if (this.mMetaTileEntity.getEUVar() < 0L) {
- this.setStoredEU(0L);
- return false;
- } else {
- return true;
- }
- }
- }
-
- //Required as of 5.09.32-pre5
- public boolean energyStateReady() {
- return false;
- }
-
-
- private boolean firstTicked = false;
-
- public boolean onFirstTick() {
- if (!firstTicked) {
- firstTicked = true;
- if (this.mInventory != null) {
- this.mInventory.purgeNulls();
- return true;
- }
- }
- return false;
- }
-
-
- /**
- * Adds support for the newer function added by https://github.com/Blood-Asp/GT5-Unofficial/commit/73ee102b63efd92c0f164a7ed7a79ebcd2619617#diff-3051838621d8ae87aa5ccd1345e1f07d
- */
- public boolean inputEnergyFrom(byte arg0, boolean arg1) {
- // TODO Auto-generated method stub
- return false;
- }
-
-
- /**
- * Adds support for the newer function added by https://github.com/Blood-Asp/GT5-Unofficial/commit/73ee102b63efd92c0f164a7ed7a79ebcd2619617#diff-3051838621d8ae87aa5ccd1345e1f07d
- */
- public boolean outputsEnergyTo(byte arg0, boolean arg1) {
- // TODO Auto-generated method stub
- return false;
- }
-
-
+ public boolean isElectric() {
+ return true;
+ }
+ public boolean isEnetOutput() {
+ return false;
+ }
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ public long maxEUStore() {
+ return 0L;
+ }
+
+ public long maxEUInput() {
+ return 0L;
+ }
+
+ public long maxEUOutput() {
+ return 0L;
+ }
+
+ public long maxAmperesOut() {
+ return 1L;
+ }
+ public long maxAmperesIn() {
+ return 1L;
+ }
+
+ public void doEnergyExplosion() {
+ if (this.getUniversalEnergyCapacity() > 0L
+ && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) {
+ this.doExplosion(this.oOutput
+ * (long)
+ (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity()
+ ? 4
+ : (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2L
+ ? 2
+ : 1)));
+ GT_Mod arg9999 = GT_Mod.instance;
+ GT_Mod.achievements.issueAchievement(
+ this.getWorldObj().getPlayerEntityByName(this.mOwnerName), "electricproblems");
+ }
+ }
+
+ public void doExplosion(long aAmount) {
+ if (this.canAccessData()) {
+ if (GregTech_API.sMachineWireFire && this.mMetaTileEntity.isElectric()) {
+ try {
+ this.mReleaseEnergy = true;
+ Util.emitEnergyToNetwork(GT_Values.V[5], Math.max(1L, this.getStoredEU() / GT_Values.V[5]), this);
+ } catch (Exception arg4) {
+ }
+ }
+ this.mReleaseEnergy = false;
+ this.onExplosion();
+ PollutionUtils.addPollution(this, 100000);
+ this.mMetaTileEntity.doExplosion(aAmount);
+ }
+ }
+
+ public void onExplosion() {}
+
+ @Override
+ public String[] getDescription() {
+ return this.canAccessData() ? this.mMetaTileEntity.getDescription() : new String[0];
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return null;
+ }
+
+ public long getEUVar() {
+ return this.mStoredEnergy;
+ }
+
+ public void setEUVar(long aEnergy) {
+ this.mStoredEnergy = aEnergy;
+ }
+
+ public long getStoredEU() {
+ return this.canAccessData() ? Math.min(this.mMetaTileEntity.getEUVar(), this.getEUCapacity()) : 0L;
+ }
+
+ public long getEUCapacity() {
+ return this.canAccessData() ? this.mMetaTileEntity.maxEUStore() : 0L;
+ }
+
+ public long getMinimumStoredEU() {
+ return 512L;
+ }
+
+ public boolean setStoredEU(long aEnergy) {
+ if (!this.canAccessData()) {
+ return false;
+ } else {
+ if (aEnergy < 0L) {
+ aEnergy = 0L;
+ }
+
+ this.mMetaTileEntity.setEUVar(aEnergy);
+ return true;
+ }
+ }
+
+ public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ if (!this.canAccessData()) {
+ return false;
+ } else if (this.mMetaTileEntity.getEUVar() - aEnergy < 0L && !aIgnoreTooLessEnergy) {
+ return false;
+ } else {
+ this.setStoredEU(this.mMetaTileEntity.getEUVar() - aEnergy);
+ if (this.mMetaTileEntity.getEUVar() < 0L) {
+ this.setStoredEU(0L);
+ return false;
+ } else {
+ return true;
+ }
+ }
+ }
+
+ // Required as of 5.09.32-pre5
+ public boolean energyStateReady() {
+ return false;
+ }
+
+ private boolean firstTicked = false;
+
+ public boolean onFirstTick() {
+ if (!firstTicked) {
+ firstTicked = true;
+ if (this.mInventory != null) {
+ this.mInventory.purgeNulls();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Adds support for the newer function added by https://github.com/Blood-Asp/GT5-Unofficial/commit/73ee102b63efd92c0f164a7ed7a79ebcd2619617#diff-3051838621d8ae87aa5ccd1345e1f07d
+ */
+ public boolean inputEnergyFrom(byte arg0, boolean arg1) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ * Adds support for the newer function added by https://github.com/Blood-Asp/GT5-Unofficial/commit/73ee102b63efd92c0f164a7ed7a79ebcd2619617#diff-3051838621d8ae87aa5ccd1345e1f07d
+ */
+ public boolean outputsEnergyTo(byte arg0, boolean arg1) {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/base/TilePoweredGT.java b/src/main/java/gtPlusPlus/core/tileentities/base/TilePoweredGT.java
index fb599b0bae..257dc740ea 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/base/TilePoweredGT.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/base/TilePoweredGT.java
@@ -1,37 +1,16 @@
/*package gtPlusPlus.core.tileentities.base;
-import net.minecraft.block.Block;
-import net.minecraft.entity.Entity;
-import net.minecraft.init.Blocks;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.Packet;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.net.GT_Packet;
-import gregtech.api.net.GT_Packet_Block_Event;
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.api.interfaces.IGregtechPower;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import net.minecraftforge.common.util.ForgeDirection;
public abstract class TilePoweredGT extends TileEntityBase implements IGregtechPower {
-
+
public static AutoMap<TilePoweredGT> mPoweredEntities = new AutoMap<TilePoweredGT>();
-
+
//Base Tile Fields
public boolean ignoreUnloadedChunks;
public boolean isDead;
//Meta Tile Fields
private long mAcceptedAmperes;
-
+
private boolean[] mActiveEUInputs;
private boolean[] mActiveEUOutputs;
protected int[] mAverageEUInput;
@@ -57,13 +36,13 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
this.isDead = false;
mPoweredEntities.put(this);
}
-
+
@Override
public boolean acceptsRotationalEnergy(byte p0) {
return false;
}
- private boolean canAccessData() {
+ private boolean canAccessData() {
return this.isInvalid() ? false : true;
}
@@ -121,7 +100,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
}
return true;
}
-
+
public void doExplosion(final long aExplosionPower) {
final float tStrength = (aExplosionPower < GT_Values.V[0])
? 1.0f
@@ -287,7 +266,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
}
return null;
}
-
+
@Override
public final IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(final byte aSide, final int aDistance) {
final TileEntity tTileEntity = this.getTileEntityAtSideAndDistance(aSide, aDistance);
@@ -617,9 +596,9 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
return aSide >= 0 && aSide < 6 && this.mActiveEUInputs[aSide] && !this.mReleaseEnergy;
}
return this.isEnergyInputSide(aSide);
- }
-
-
+ }
+
+
public final boolean isClientSide() {
return this.worldObj.isRemote;
}
@@ -628,13 +607,13 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
public boolean isDead() {
return this.isDead;
}
-
+
private boolean isElectric() {
return true;
}
private boolean isEnergyInputSide(final byte aSide) {
- if (aSide >= 0 && aSide < 6) {
+ if (aSide >= 0 && aSide < 6) {
if (this.isInvalid() || this.mReleaseEnergy) {
return false;
}
@@ -644,9 +623,9 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
}
return false;
}
-
+
private boolean isEnergyOutputSide(final byte aSide) {
- if (aSide >= 0 && aSide < 6) {
+ if (aSide >= 0 && aSide < 6) {
if (this.isInvalid() || this.mReleaseEnergy) {
return this.mReleaseEnergy;
}
@@ -673,8 +652,8 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
public boolean isInputFacing(final byte aSide) {
return false;
}
-
-
+
+
@Override
@@ -706,7 +685,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
public long maxAmperesOut() {
return 1L;
}
-
+
public long maxEUInput() {
return 0L;
}
@@ -714,7 +693,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
public long maxEUOutput() {
return 0L;
}
-
+
public long maxEUStore() {
return 0L;
}
@@ -722,7 +701,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
public long maxSteamStore() {
return 256000L;
}
-
+
public final void onAdjacentBlockChange(final int aX, final int aY, final int aZ) {
this.clearNullMarkersFromTileEntityBuffer();
}
@@ -761,7 +740,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
//this.onMachineBlockUpdate();
}
}
-
+
public void setSteamVar(final long aSteam) {
mStoredSteam = aSteam;
}
@@ -776,7 +755,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
this.setEUVar(aEnergy);
return true;
}
-
+
public boolean setStoredSteam(long aEnergy) {
if (!this.canAccessData()) {
return false;
@@ -800,9 +779,9 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
super.readFromNBT(nbt);
}
-
-
-
+
+
+
@Override
public boolean onPreTick(long aTick) {
return onPreTick(this, this.mTickTimer);
@@ -850,12 +829,12 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
super.onChunkUnload();
this.isDead = true;
}
-
-
+
+
public void updateEntity() {
super.updateEntity();
this.isDead = false;
-
+
this.mRunningThroughTick = true;
long tTime = System.currentTimeMillis();
int tCode = 0;
@@ -873,7 +852,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
this.oX = this.xCoord;
this.oY = this.yCoord;
this.oZ = this.zCoord;
-
+
this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord,
(TileEntity) this);
this.onFirstTick(this);
@@ -887,7 +866,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
++tCode;
if (!aSideClient) {
break Label_1743;
- }
+ }
if (this.mNeedsUpdate) {
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.mNeedsUpdate = false;
@@ -902,7 +881,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
case 7 : {
if (aSideServer && this.mTickTimer > 10L) {
for (byte i = (byte) (tCode - 2); i < 6; ++i) {
-
+
}
}
}
@@ -932,7 +911,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
if (!aSideServer) {
break Label_1743;
}
-
+
if (this.xCoord != this.oX || this.yCoord != this.oY || this.zCoord != this.oZ) {
this.oX = this.xCoord;
this.oY = this.yCoord;
@@ -941,7 +920,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
this.clearTileEntityBuffer();
}
if (this.mFacing != this.oFacing) {
- this.oFacing = this.mFacing;
+ this.oFacing = this.mFacing;
this.issueBlockUpdate();
}
if (this.mTickTimer > 20L && this.isElectric()) {
@@ -986,7 +965,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
if (!this.hasValidMetaTileEntity()) {
this.mRunningThroughTick = false;
return;
- }
+ }
}
}
if (!this.hasValidMetaTileEntity()) {
@@ -1144,7 +1123,7 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
private void onFirstTick(TilePoweredGT tilePoweredGT) {
// TODO Auto-generated method stub
-
+
}
private boolean hasValidMetaTileEntity() {
@@ -1158,11 +1137,11 @@ public abstract class TilePoweredGT extends TileEntityBase implements IGregtechP
public void issueClientUpdate() {
this.mSendClientData = true;
}
-
+
public Packet getDescriptionPacket() {
this.issueClientUpdate();
return null;
}
-
+
}
-*/ \ No newline at end of file
+*/
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
index 835d9da2cd..63cda85458 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
@@ -1,5 +1,10 @@
package gtPlusPlus.core.tileentities.general;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.inventories.InventoryCircuitProgrammer;
+import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.slots.SlotIntegratedCircuit;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
@@ -8,300 +13,287 @@ import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.inventories.InventoryCircuitProgrammer;
-import gtPlusPlus.core.recipe.common.CI;
-import gtPlusPlus.core.slots.SlotIntegratedCircuit;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInventory {
- private int tickCount = 0;
- private final InventoryCircuitProgrammer inventoryContents;
- private String customName;
- public int locationX;
- public int locationY;
- public int locationZ;
- private int aCurrentMode = 0;
-
- public TileEntityCircuitProgrammer() {
- this.inventoryContents = new InventoryCircuitProgrammer();
- this.setTileLocation();
- }
-
- public boolean setTileLocation() {
- if (this.hasWorldObj()) {
- if (!this.getWorldObj().isRemote) {
- this.locationX = this.xCoord;
- this.locationY = this.yCoord;
- this.locationZ = this.zCoord;
- return true;
- }
- }
- return false;
- }
-
- //Rename to hasCircuitToConfigure
- public final boolean hasCircuitToConfigure() {
- for (ItemStack i : this.getInventory().getInventory()) {
- if (i == null) {
- continue;
- }
- else {
- return true;
- }
- }
- return false;
- }
-
- public InventoryCircuitProgrammer getInventory() {
- return this.inventoryContents;
- }
-
- public boolean addOutput() {
- ItemStack[] aInputs = this.getInventory().getInventory().clone();
- //Check if there is output in slot.
- Boolean hasOutput = false;
- if (aInputs[25] != null) {
- hasOutput = true;
- }
- AutoMap<Integer> aValidSlots = new AutoMap<Integer>();
- int aSlotCount = 0;
- for (ItemStack i : aInputs) {
- if (i != null) {
- aValidSlots.put(aSlotCount);
- }
- aSlotCount++;
- }
- for (int e : aValidSlots) {
- boolean doAdd = false;
- ItemStack g = this.getStackInSlot(e);
- int aSize = 0;
- ItemStack aInputStack = null;
- int aTypeInSlot = SlotIntegratedCircuit.isRegularProgrammableCircuit(g);
- if (aTypeInSlot >= 0 && g != null) {
- // No Existing Output
- if (!hasOutput) {
- aSize = g.stackSize;
- doAdd = true;
- }
- // Existing Output
- else {
- ItemStack f = this.getStackInSlot(25);
- int aTypeInCheckedSlot = SlotIntegratedCircuit.isRegularProgrammableCircuit(f);
- // Check that the Circuit in the Output slot is not null and the same type as the circuit input.
- if (aTypeInCheckedSlot >= 0 && (aTypeInSlot == aTypeInCheckedSlot) && f != null) {
- if (g.getItem() == f.getItem() && f.getItemDamage() == e) {
- aSize = f.stackSize + g.stackSize;
- if (aSize > 64) {
- aInputStack = g.copy();
- aInputStack.stackSize = (aSize-64);
- }
- doAdd = true;
- }
- }
- }
- if (doAdd) {
- // Check Circuit Type
- ItemStack aOutput;
- if (aTypeInSlot == 0) {
- aOutput = CI.getNumberedCircuit(e);
- }
- else if (aTypeInSlot == 1) {
- aOutput = CI.getNumberedBioCircuit(e);
- }
- else if (aTypeInSlot == 2) {
- aOutput = CI.getNumberedAdvancedCircuit(e);
- }
- else {
- aOutput = null;
- }
-
- if (aOutput != null) {
- aOutput.stackSize = aSize;
- this.setInventorySlotContents(e, aInputStack);
- this.setInventorySlotContents(25, aOutput);
- return true;
- }
- }
- }
- continue;
- }
- return false;
- }
-
- @Override
- public void updateEntity() {
- try{
- if (!this.worldObj.isRemote) {
- if (tickCount % 10 == 0) {
- if (hasCircuitToConfigure()) {
- this.addOutput();
- this.markDirty();
- }
- }
- this.tickCount++;
- }
- }
- catch (final Throwable t){}
- }
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- // Utils.LOG_WARNING("Trying to write NBT data to TE.");
- final NBTTagCompound chestData = new NBTTagCompound();
- this.inventoryContents.writeToNBT(chestData);
- nbt.setTag("ContentsChest", chestData);
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- nbt.setInteger("aCurrentMode", aCurrentMode);
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- // Utils.LOG_WARNING("Trying to read NBT data from TE.");
- this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- aCurrentMode = nbt.getInteger("aCurrentMode");
- }
-
- @Override
- public int getSizeInventory() {
- return this.getInventory().getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.getInventory().getStackInSlot(slot);
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int count) {
- return this.getInventory().decrStackSize(slot, count);
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- return this.getInventory().getStackInSlotOnClosing(slot);
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.getInventory().setInventorySlotContents(slot, stack);
- }
-
- @Override
- public int getInventoryStackLimit() {
- return this.getInventory().getInventoryStackLimit();
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return this.getInventory().isUseableByPlayer(entityplayer);
- }
-
- @Override
- public void openInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().openInventory();
- }
-
- @Override
- public void closeInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().closeInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return this.getInventory().isItemValidForSlot(slot, itemstack);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- final int[] accessibleSides = new int[this.getSizeInventory()];
- for (int r=0; r<this.getInventory().getSizeInventory(); r++){
- accessibleSides[r]=r;
- }
- return accessibleSides;
-
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return p_102007_1_ >= 0 && p_102007_1_ <= 24;
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return p_102008_1_ == 25;
- }
-
- public String getCustomName() {
- return this.customName;
- }
-
- public void setCustomName(final String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.circuitprogrammer";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
- }
-
- @Override
- public Packet getDescriptionPacket() {
- final NBTTagCompound tag = new NBTTagCompound();
- this.writeToNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
- }
-
- @Override
- public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
- final NBTTagCompound tag = pkt.func_148857_g();
- this.readFromNBT(tag);
- }
-
- public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) {
- try {
- if (aCurrentMode == 24) {
- aCurrentMode = 0;
- }
- else {
- aCurrentMode++;
- }
- PlayerUtils.messagePlayer(player, "Now configuring units for type "+aCurrentMode+".");
- return true;
- }
- catch (Throwable t) {
- return false;
- }
- }
-
+ private int tickCount = 0;
+ private final InventoryCircuitProgrammer inventoryContents;
+ private String customName;
+ public int locationX;
+ public int locationY;
+ public int locationZ;
+ private int aCurrentMode = 0;
+
+ public TileEntityCircuitProgrammer() {
+ this.inventoryContents = new InventoryCircuitProgrammer();
+ this.setTileLocation();
+ }
+
+ public boolean setTileLocation() {
+ if (this.hasWorldObj()) {
+ if (!this.getWorldObj().isRemote) {
+ this.locationX = this.xCoord;
+ this.locationY = this.yCoord;
+ this.locationZ = this.zCoord;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // Rename to hasCircuitToConfigure
+ public final boolean hasCircuitToConfigure() {
+ for (ItemStack i : this.getInventory().getInventory()) {
+ if (i == null) {
+ continue;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public InventoryCircuitProgrammer getInventory() {
+ return this.inventoryContents;
+ }
+
+ public boolean addOutput() {
+ ItemStack[] aInputs = this.getInventory().getInventory().clone();
+ // Check if there is output in slot.
+ Boolean hasOutput = false;
+ if (aInputs[25] != null) {
+ hasOutput = true;
+ }
+ AutoMap<Integer> aValidSlots = new AutoMap<Integer>();
+ int aSlotCount = 0;
+ for (ItemStack i : aInputs) {
+ if (i != null) {
+ aValidSlots.put(aSlotCount);
+ }
+ aSlotCount++;
+ }
+ for (int e : aValidSlots) {
+ boolean doAdd = false;
+ ItemStack g = this.getStackInSlot(e);
+ int aSize = 0;
+ ItemStack aInputStack = null;
+ int aTypeInSlot = SlotIntegratedCircuit.isRegularProgrammableCircuit(g);
+ if (aTypeInSlot >= 0 && g != null) {
+ // No Existing Output
+ if (!hasOutput) {
+ aSize = g.stackSize;
+ doAdd = true;
+ }
+ // Existing Output
+ else {
+ ItemStack f = this.getStackInSlot(25);
+ int aTypeInCheckedSlot = SlotIntegratedCircuit.isRegularProgrammableCircuit(f);
+ // Check that the Circuit in the Output slot is not null and the same type as the circuit input.
+ if (aTypeInCheckedSlot >= 0 && (aTypeInSlot == aTypeInCheckedSlot) && f != null) {
+ if (g.getItem() == f.getItem() && f.getItemDamage() == e) {
+ aSize = f.stackSize + g.stackSize;
+ if (aSize > 64) {
+ aInputStack = g.copy();
+ aInputStack.stackSize = (aSize - 64);
+ }
+ doAdd = true;
+ }
+ }
+ }
+ if (doAdd) {
+ // Check Circuit Type
+ ItemStack aOutput;
+ if (aTypeInSlot == 0) {
+ aOutput = CI.getNumberedCircuit(e);
+ } else if (aTypeInSlot == 1) {
+ aOutput = CI.getNumberedBioCircuit(e);
+ } else if (aTypeInSlot == 2) {
+ aOutput = CI.getNumberedAdvancedCircuit(e);
+ } else {
+ aOutput = null;
+ }
+
+ if (aOutput != null) {
+ aOutput.stackSize = aSize;
+ this.setInventorySlotContents(e, aInputStack);
+ this.setInventorySlotContents(25, aOutput);
+ return true;
+ }
+ }
+ }
+ continue;
+ }
+ return false;
+ }
+
+ @Override
+ public void updateEntity() {
+ try {
+ if (!this.worldObj.isRemote) {
+ if (tickCount % 10 == 0) {
+ if (hasCircuitToConfigure()) {
+ this.addOutput();
+ this.markDirty();
+ }
+ }
+ this.tickCount++;
+ }
+ } catch (final Throwable t) {
+ }
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ // Utils.LOG_WARNING("Trying to write NBT data to TE.");
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.inventoryContents.writeToNBT(chestData);
+ nbt.setTag("ContentsChest", chestData);
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ nbt.setInteger("aCurrentMode", aCurrentMode);
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ // Utils.LOG_WARNING("Trying to read NBT data from TE.");
+ this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+ aCurrentMode = nbt.getInteger("aCurrentMode");
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.getInventory().getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.getInventory().getStackInSlot(slot);
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int count) {
+ return this.getInventory().decrStackSize(slot, count);
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ return this.getInventory().getStackInSlotOnClosing(slot);
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.getInventory().setInventorySlotContents(slot, stack);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return this.getInventory().getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return this.getInventory().isUseableByPlayer(entityplayer);
+ }
+
+ @Override
+ public void openInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().closeInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return this.getInventory().isItemValidForSlot(slot, itemstack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ final int[] accessibleSides = new int[this.getSizeInventory()];
+ for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
+ accessibleSides[r] = r;
+ }
+ return accessibleSides;
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return p_102007_1_ >= 0 && p_102007_1_ <= 24;
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return p_102008_1_ == 25;
+ }
+
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ public void setCustomName(final String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.circuitprogrammer";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.customName != null) && !this.customName.equals("");
+ }
+
+ @Override
+ public Packet getDescriptionPacket() {
+ final NBTTagCompound tag = new NBTTagCompound();
+ this.writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
+ }
+
+ @Override
+ public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
+ final NBTTagCompound tag = pkt.func_148857_g();
+ this.readFromNBT(tag);
+ }
+
+ public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) {
+ try {
+ if (aCurrentMode == 24) {
+ aCurrentMode = 0;
+ } else {
+ aCurrentMode++;
+ }
+ PlayerUtils.messagePlayer(player, "Now configuring units for type " + aCurrentMode + ".");
+ return true;
+ } catch (Throwable t) {
+ return false;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java
index db93e9c4fc..aaf95a3291 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityDecayablesChest.java
@@ -13,347 +13,353 @@ import net.minecraft.world.World;
public class TileEntityDecayablesChest extends TileEntity implements ISidedInventory {
- private final Inventory_DecayablesChest inventoryContents;
-
- /** Determines if the check for adjacent chests has taken place. */
- public boolean adjacentChestChecked;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityDecayablesChest adjacentChestZNeg;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityDecayablesChest adjacentChestXPos;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityDecayablesChest adjacentChestXNeg;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityDecayablesChest adjacentChestZPos;
- /** The current angle of the lid (between 0 and 1) */
- public float lidAngle;
- /** The angle of the lid last tick */
- public float prevLidAngle;
- /** The number of players currently using this chest */
- public int numPlayersUsing;
-
- private String customName;
-
- private int cachedChestType;
- private int tickCount = 0;
-
- public TileEntityDecayablesChest() {
- this.inventoryContents = new Inventory_DecayablesChest();
- }
-
- public Inventory_DecayablesChest getInventory() {
- return this.inventoryContents;
- }
-
- @Override
- public void updateEntity() {
-
- // Try do chesty stuff
- try {
- this.updateEntityChest();
- } catch (Throwable t) {
-
- }
-
- try {
- if (!this.worldObj.isRemote) {
- this.tickCount++;
- if ((this.tickCount % 10) == 0) {
- cachedChestType = 1;
- }
-
- if ((this.tickCount % 20) == 0) {
- for (ItemStack inv : this.getInventory().getInventory()) {
- if (inv == null) {
- continue;
- }
- if (inv.getItem() instanceof DustDecayable) {
- DustDecayable D = (DustDecayable) inv.getItem();
- tryUpdateDecayable(D, inv, this.worldObj);
- }
- }
-
- }
- updateSlots();
- }
- } catch (final Throwable t) {
- }
- }
-
- public void tryUpdateDecayable(final DustDecayable b, ItemStack iStack, final World world) {
- if (world == null || iStack == null) {
- return;
- }
- if (world.isRemote) {
- return;
- }
-
- boolean a1, a2;
- int u = 0;
- a1 = b.isTicking(world, iStack);
- a2 = false;
- int SECONDS_TO_PROCESS = 1;
- while (u < (20 * SECONDS_TO_PROCESS)) {
- if (!a1) {
- break;
- }
- a1 = b.isTicking(world, iStack);
- a2 = b.tickItemTag(world, iStack);
- u++;
- }
- Logger.MACHINE_INFO("| "+b.getUnlocalizedName()+" | "+a1+"/"+a2);
-
- if (!a1 && !a2) {
- ItemStack replacement = ItemUtils.getSimpleStack(b.getDecayResult());
- replacement.stackSize = 1;
- //iStack = replacement.copy();
- for (int fff = 0; fff < this.inventoryContents.getSizeInventory(); fff++) {
- if (this.inventoryContents.getStackInSlot(fff) == iStack) {
- this.inventoryContents.setInventorySlotContents(fff, replacement.copy());
- }
- }
-
- updateSlots();
- this.inventoryContents.
- markDirty();
- }
- }
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- // Utils.LOG_WARNING("Trying to write NBT data to TE.");
- final NBTTagCompound chestData = new NBTTagCompound();
- this.inventoryContents.writeToNBT(chestData);
- nbt.setTag("ContentsChest", chestData);
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- // Utils.LOG_WARNING("Trying to read NBT data from TE.");
- this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- }
-
- @Override
- public int getSizeInventory() {
- return this.getInventory().getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.getInventory().getStackInSlot(slot);
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int count) {
- return this.getInventory().decrStackSize(slot, count);
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- return this.getInventory().getStackInSlotOnClosing(slot);
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.getInventory().setInventorySlotContents(slot, stack);
- }
-
- @Override
- public int getInventoryStackLimit() {
- return this.getInventory().getInventoryStackLimit();
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return this.getInventory().isUseableByPlayer(entityplayer);
- }
-
- @Override
- public void openInventory() {
- if (this.numPlayersUsing < 0) {
- this.numPlayersUsing = 0;
- }
- if (!this.worldObj.isRemote) {
- this.numPlayersUsing++;
- cachedChestType = 1;
- }
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().openInventory();
- }
-
- @Override
- public void closeInventory() {
- if (!this.worldObj.isRemote) {
- this.numPlayersUsing--;
- cachedChestType = 1;
- }
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().closeInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return this.getInventory().isItemValidForSlot(slot, itemstack);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- final int[] accessibleSides = new int[this.getSizeInventory()];
- for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
- accessibleSides[r] = r;
- }
- return accessibleSides;
-
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return this.getInventory().isItemValidForSlot(0, p_102007_2_);
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return this.getInventory().isItemValidForSlot(0, p_102008_2_);
- }
-
- public String getCustomName() {
- return this.customName;
- }
-
- public void setCustomName(final String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.DecayablesChest";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
- }
-
- /**
- * Causes the TileEntity to reset all it's cached values for it's container
- * Block, metadata and in the case of chests, the adjacent chest check
- */
- public void updateContainingBlockInfo() {
- super.updateContainingBlockInfo();
- this.adjacentChestChecked = false;
- }
-
- /**
- * Performs the check for adjacent chests to determine if this chest is double
- * or not.
- */
- public void checkForAdjacentChests() {
- if (!this.adjacentChestChecked) {
- this.adjacentChestChecked = true;
- this.adjacentChestZNeg = null;
- this.adjacentChestXPos = null;
- this.adjacentChestXNeg = null;
- this.adjacentChestZPos = null;
- }
- }
-
- public void updateEntityChest() {
- float f;
- this.prevLidAngle = this.lidAngle;
- f = 0.04F;
- double d2;
- if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null
- && this.adjacentChestXNeg == null) {
- double d1 = (double) this.xCoord + 0.5D;
- d2 = (double) this.zCoord + 0.5D;
- this.worldObj.playSoundEffect(d1, (double) this.yCoord + 0.5D, d2, "random.chestopen", 0.5F,
- this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
- }
-
- if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) {
- float f1 = this.lidAngle;
- if (this.numPlayersUsing > 0) {
- //this.lidAngle += f;
- this.lidAngle += (float) (f * (1 + 0.10 * 0.01));
- } else {
- //this.lidAngle -= f;
- this.lidAngle -= (float) (f * (1 + 0.10 * 0.01));
- }
- if (this.lidAngle > 1.0F) {
- this.lidAngle = 1.0F;
- }
- float f2 = 0.5F;
- if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) {
- d2 = (double) this.xCoord + 0.5D;
- double d0 = (double) this.zCoord + 0.5D;
- this.worldObj.playSoundEffect(d2, (double) this.yCoord + 0.5D, d0, "random.chestclosed", 0.5F,
- this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
- }
-
- if (this.lidAngle < 0.0F) {
- this.lidAngle = 0.0F;
- }
- }
- }
-
- /**
- * Called when a client event is received with the event number and argument,
- * see World.sendClientEvent
- */
- public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) {
- if (p_145842_1_ == 1)
- {
- this.numPlayersUsing = p_145842_2_;
- return true;
- }
- else
- {
- return super.receiveClientEvent(p_145842_1_, p_145842_2_);
- }
- }
-
- /**
- * invalidates a tile entity
- */
- public final void invalidate() {
- super.invalidate();
- cachedChestType = 1;
- this.updateContainingBlockInfo();
- this.checkForAdjacentChests();
- }
-
- private final int updateSlots() {
- //Have slots changed?
- if (cachedChestType == 0) {
- return 0;
- }
- ItemUtils.organiseInventory(getInventory());
- cachedChestType = 0;
- return cachedChestType;
-
- }
-
+ private final Inventory_DecayablesChest inventoryContents;
+
+ /** Determines if the check for adjacent chests has taken place. */
+ public boolean adjacentChestChecked;
+ /** Contains the chest tile located adjacent to this one (if any) */
+ public TileEntityDecayablesChest adjacentChestZNeg;
+ /** Contains the chest tile located adjacent to this one (if any) */
+ public TileEntityDecayablesChest adjacentChestXPos;
+ /** Contains the chest tile located adjacent to this one (if any) */
+ public TileEntityDecayablesChest adjacentChestXNeg;
+ /** Contains the chest tile located adjacent to this one (if any) */
+ public TileEntityDecayablesChest adjacentChestZPos;
+ /** The current angle of the lid (between 0 and 1) */
+ public float lidAngle;
+ /** The angle of the lid last tick */
+ public float prevLidAngle;
+ /** The number of players currently using this chest */
+ public int numPlayersUsing;
+
+ private String customName;
+
+ private int cachedChestType;
+ private int tickCount = 0;
+
+ public TileEntityDecayablesChest() {
+ this.inventoryContents = new Inventory_DecayablesChest();
+ }
+
+ public Inventory_DecayablesChest getInventory() {
+ return this.inventoryContents;
+ }
+
+ @Override
+ public void updateEntity() {
+
+ // Try do chesty stuff
+ try {
+ this.updateEntityChest();
+ } catch (Throwable t) {
+
+ }
+
+ try {
+ if (!this.worldObj.isRemote) {
+ this.tickCount++;
+ if ((this.tickCount % 10) == 0) {
+ cachedChestType = 1;
+ }
+
+ if ((this.tickCount % 20) == 0) {
+ for (ItemStack inv : this.getInventory().getInventory()) {
+ if (inv == null) {
+ continue;
+ }
+ if (inv.getItem() instanceof DustDecayable) {
+ DustDecayable D = (DustDecayable) inv.getItem();
+ tryUpdateDecayable(D, inv, this.worldObj);
+ }
+ }
+ }
+ updateSlots();
+ }
+ } catch (final Throwable t) {
+ }
+ }
+
+ public void tryUpdateDecayable(final DustDecayable b, ItemStack iStack, final World world) {
+ if (world == null || iStack == null) {
+ return;
+ }
+ if (world.isRemote) {
+ return;
+ }
+
+ boolean a1, a2;
+ int u = 0;
+ a1 = b.isTicking(world, iStack);
+ a2 = false;
+ int SECONDS_TO_PROCESS = 1;
+ while (u < (20 * SECONDS_TO_PROCESS)) {
+ if (!a1) {
+ break;
+ }
+ a1 = b.isTicking(world, iStack);
+ a2 = b.tickItemTag(world, iStack);
+ u++;
+ }
+ Logger.MACHINE_INFO("| " + b.getUnlocalizedName() + " | " + a1 + "/" + a2);
+
+ if (!a1 && !a2) {
+ ItemStack replacement = ItemUtils.getSimpleStack(b.getDecayResult());
+ replacement.stackSize = 1;
+ // iStack = replacement.copy();
+ for (int fff = 0; fff < this.inventoryContents.getSizeInventory(); fff++) {
+ if (this.inventoryContents.getStackInSlot(fff) == iStack) {
+ this.inventoryContents.setInventorySlotContents(fff, replacement.copy());
+ }
+ }
+
+ updateSlots();
+ this.inventoryContents.markDirty();
+ }
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ // Utils.LOG_WARNING("Trying to write NBT data to TE.");
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.inventoryContents.writeToNBT(chestData);
+ nbt.setTag("ContentsChest", chestData);
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ // Utils.LOG_WARNING("Trying to read NBT data from TE.");
+ this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.getInventory().getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.getInventory().getStackInSlot(slot);
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int count) {
+ return this.getInventory().decrStackSize(slot, count);
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ return this.getInventory().getStackInSlotOnClosing(slot);
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.getInventory().setInventorySlotContents(slot, stack);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return this.getInventory().getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return this.getInventory().isUseableByPlayer(entityplayer);
+ }
+
+ @Override
+ public void openInventory() {
+ if (this.numPlayersUsing < 0) {
+ this.numPlayersUsing = 0;
+ }
+ if (!this.worldObj.isRemote) {
+ this.numPlayersUsing++;
+ cachedChestType = 1;
+ }
+ this.worldObj.addBlockEvent(
+ this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ if (!this.worldObj.isRemote) {
+ this.numPlayersUsing--;
+ cachedChestType = 1;
+ }
+ this.worldObj.addBlockEvent(
+ this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().closeInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return this.getInventory().isItemValidForSlot(slot, itemstack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ final int[] accessibleSides = new int[this.getSizeInventory()];
+ for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
+ accessibleSides[r] = r;
+ }
+ return accessibleSides;
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return this.getInventory().isItemValidForSlot(0, p_102007_2_);
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return this.getInventory().isItemValidForSlot(0, p_102008_2_);
+ }
+
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ public void setCustomName(final String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.DecayablesChest";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.customName != null) && !this.customName.equals("");
+ }
+
+ /**
+ * Causes the TileEntity to reset all it's cached values for it's container
+ * Block, metadata and in the case of chests, the adjacent chest check
+ */
+ public void updateContainingBlockInfo() {
+ super.updateContainingBlockInfo();
+ this.adjacentChestChecked = false;
+ }
+
+ /**
+ * Performs the check for adjacent chests to determine if this chest is double
+ * or not.
+ */
+ public void checkForAdjacentChests() {
+ if (!this.adjacentChestChecked) {
+ this.adjacentChestChecked = true;
+ this.adjacentChestZNeg = null;
+ this.adjacentChestXPos = null;
+ this.adjacentChestXNeg = null;
+ this.adjacentChestZPos = null;
+ }
+ }
+
+ public void updateEntityChest() {
+ float f;
+ this.prevLidAngle = this.lidAngle;
+ f = 0.04F;
+ double d2;
+ if (this.numPlayersUsing > 0
+ && this.lidAngle == 0.0F
+ && this.adjacentChestZNeg == null
+ && this.adjacentChestXNeg == null) {
+ double d1 = (double) this.xCoord + 0.5D;
+ d2 = (double) this.zCoord + 0.5D;
+ this.worldObj.playSoundEffect(
+ d1,
+ (double) this.yCoord + 0.5D,
+ d2,
+ "random.chestopen",
+ 0.5F,
+ this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
+ }
+
+ if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) {
+ float f1 = this.lidAngle;
+ if (this.numPlayersUsing > 0) {
+ // this.lidAngle += f;
+ this.lidAngle += (float) (f * (1 + 0.10 * 0.01));
+ } else {
+ // this.lidAngle -= f;
+ this.lidAngle -= (float) (f * (1 + 0.10 * 0.01));
+ }
+ if (this.lidAngle > 1.0F) {
+ this.lidAngle = 1.0F;
+ }
+ float f2 = 0.5F;
+ if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) {
+ d2 = (double) this.xCoord + 0.5D;
+ double d0 = (double) this.zCoord + 0.5D;
+ this.worldObj.playSoundEffect(
+ d2,
+ (double) this.yCoord + 0.5D,
+ d0,
+ "random.chestclosed",
+ 0.5F,
+ this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
+ }
+
+ if (this.lidAngle < 0.0F) {
+ this.lidAngle = 0.0F;
+ }
+ }
+ }
+
+ /**
+ * Called when a client event is received with the event number and argument,
+ * see World.sendClientEvent
+ */
+ public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) {
+ if (p_145842_1_ == 1) {
+ this.numPlayersUsing = p_145842_2_;
+ return true;
+ } else {
+ return super.receiveClientEvent(p_145842_1_, p_145842_2_);
+ }
+ }
+
+ /**
+ * invalidates a tile entity
+ */
+ public final void invalidate() {
+ super.invalidate();
+ cachedChestType = 1;
+ this.updateContainingBlockInfo();
+ this.checkForAdjacentChests();
+ }
+
+ private final int updateSlots() {
+ // Have slots changed?
+ if (cachedChestType == 0) {
+ return 0;
+ }
+ ItemUtils.organiseInventory(getInventory());
+ cachedChestType = 0;
+ return cachedChestType;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java
index 0c428537cb..c47a6fa092 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java
@@ -13,347 +13,353 @@ import net.minecraft.world.World;
public class TileEntityEggBox extends TileEntity implements ISidedInventory {
- private final Inventory_EggBox inventoryContents;
-
- /** Determines if the check for adjacent chests has taken place. */
- public boolean adjacentChestChecked;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityEggBox adjacentChestZNeg;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityEggBox adjacentChestXPos;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityEggBox adjacentChestXNeg;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityEggBox adjacentChestZPos;
- /** The current angle of the lid (between 0 and 1) */
- public float lidAngle;
- /** The angle of the lid last tick */
- public float prevLidAngle;
- /** The number of players currently using this chest */
- public int numPlayersUsing;
-
- private String customName;
-
- private int cachedChestType;
- private int tickCount = 0;
-
- public TileEntityEggBox() {
- this.inventoryContents = new Inventory_EggBox();
- }
-
- public Inventory_EggBox getInventory() {
- return this.inventoryContents;
- }
-
- @Override
- public void updateEntity() {
-
- // Try do chesty stuff
- try {
- this.updateEntityChest();
- } catch (Throwable t) {
-
- }
-
- try {
- if (!this.worldObj.isRemote) {
- this.tickCount++;
- if ((this.tickCount % 10) == 0) {
- cachedChestType = 1;
- }
-
- if ((this.tickCount % 20) == 0) {
- for (ItemStack inv : this.getInventory().getInventory()) {
- if (inv == null) {
- continue;
- }
- if (inv.getItem() instanceof ItemGiantEgg) {
- ItemGiantEgg D = (ItemGiantEgg) inv.getItem();
- tryUpdateDecayable(D, inv, this.worldObj);
- }
- }
-
- }
- updateSlots();
- }
- } catch (final Throwable t) {
- }
- }
-
- public void tryUpdateDecayable(final ItemGiantEgg d, ItemStack iStack, final World world) {
- if (world == null || iStack == null) {
- return;
- }
- if (world.isRemote) {
- return;
- }
-
- boolean a1, a2;
- int u = 0;
- a1 = d.isTicking(world, iStack);
- a2 = false;
- int SECONDS_TO_PROCESS = 1;
- while (u < (20 * SECONDS_TO_PROCESS)) {
- if (!a1) {
- break;
- }
- a1 = d.isTicking(world, iStack);
- a2 = d.tickItemTag(world, iStack);
- u++;
- }
- Logger.MACHINE_INFO("| "+d.getUnlocalizedName()+" | "+a1+"/"+a2);
-
- if (!a1 && !a2) {
- ItemStack replacement = ItemUtils.getSimpleStack(d.getHatchResult(), 1);
- replacement.stackSize = 1;
- //iStack = replacement.copy();
- for (int fff = 0; fff < this.inventoryContents.getSizeInventory(); fff++) {
- if (this.inventoryContents.getStackInSlot(fff) == iStack) {
- this.inventoryContents.setInventorySlotContents(fff, replacement.copy());
- }
- }
-
- updateSlots();
- this.inventoryContents.
- markDirty();
- }
- }
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- // Utils.LOG_WARNING("Trying to write NBT data to TE.");
- final NBTTagCompound chestData = new NBTTagCompound();
- this.inventoryContents.writeToNBT(chestData);
- nbt.setTag("ContentsChest", chestData);
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- // Utils.LOG_WARNING("Trying to read NBT data from TE.");
- this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- }
-
- @Override
- public int getSizeInventory() {
- return this.getInventory().getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.getInventory().getStackInSlot(slot);
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int count) {
- return this.getInventory().decrStackSize(slot, count);
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- return this.getInventory().getStackInSlotOnClosing(slot);
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.getInventory().setInventorySlotContents(slot, stack);
- }
-
- @Override
- public int getInventoryStackLimit() {
- return this.getInventory().getInventoryStackLimit();
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return this.getInventory().isUseableByPlayer(entityplayer);
- }
-
- @Override
- public void openInventory() {
- if (this.numPlayersUsing < 0) {
- this.numPlayersUsing = 0;
- }
- if (!this.worldObj.isRemote) {
- this.numPlayersUsing++;
- cachedChestType = 1;
- }
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().openInventory();
- }
-
- @Override
- public void closeInventory() {
- if (!this.worldObj.isRemote) {
- this.numPlayersUsing--;
- cachedChestType = 1;
- }
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().closeInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return this.getInventory().isItemValidForSlot(slot, itemstack);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- final int[] accessibleSides = new int[this.getSizeInventory()];
- for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
- accessibleSides[r] = r;
- }
- return accessibleSides;
-
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return this.getInventory().isItemValidForSlot(0, p_102007_2_);
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return this.getInventory().isItemValidForSlot(0, p_102008_2_);
- }
-
- public String getCustomName() {
- return this.customName;
- }
-
- public void setCustomName(final String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.EggBox";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
- }
-
- /**
- * Causes the TileEntity to reset all it's cached values for it's container
- * Block, metadata and in the case of chests, the adjacent chest check
- */
- public void updateContainingBlockInfo() {
- super.updateContainingBlockInfo();
- this.adjacentChestChecked = false;
- }
-
- /**
- * Performs the check for adjacent chests to determine if this chest is double
- * or not.
- */
- public void checkForAdjacentChests() {
- if (!this.adjacentChestChecked) {
- this.adjacentChestChecked = true;
- this.adjacentChestZNeg = null;
- this.adjacentChestXPos = null;
- this.adjacentChestXNeg = null;
- this.adjacentChestZPos = null;
- }
- }
-
- public void updateEntityChest() {
- float f;
- this.prevLidAngle = this.lidAngle;
- f = 0.04F;
- double d2;
- if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null
- && this.adjacentChestXNeg == null) {
- double d1 = (double) this.xCoord + 0.5D;
- d2 = (double) this.zCoord + 0.5D;
- this.worldObj.playSoundEffect(d1, (double) this.yCoord + 0.5D, d2, "random.chestopen", 0.5F,
- this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
- }
-
- if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) {
- float f1 = this.lidAngle;
- if (this.numPlayersUsing > 0) {
- //this.lidAngle += f;
- this.lidAngle += (float) (f * (1 + 0.10 * 0.01));
- } else {
- //this.lidAngle -= f;
- this.lidAngle -= (float) (f * (1 + 0.10 * 0.01));
- }
- if (this.lidAngle > 1.0F) {
- this.lidAngle = 1.0F;
- }
- float f2 = 0.5F;
- if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) {
- d2 = (double) this.xCoord + 0.5D;
- double d0 = (double) this.zCoord + 0.5D;
- this.worldObj.playSoundEffect(d2, (double) this.yCoord + 0.5D, d0, "random.chestclosed", 0.5F,
- this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
- }
-
- if (this.lidAngle < 0.0F) {
- this.lidAngle = 0.0F;
- }
- }
- }
-
- /**
- * Called when a client event is received with the event number and argument,
- * see World.sendClientEvent
- */
- public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) {
- if (p_145842_1_ == 1)
- {
- this.numPlayersUsing = p_145842_2_;
- return true;
- }
- else
- {
- return super.receiveClientEvent(p_145842_1_, p_145842_2_);
- }
- }
-
- /**
- * invalidates a tile entity
- */
- public final void invalidate() {
- super.invalidate();
- cachedChestType = 1;
- this.updateContainingBlockInfo();
- this.checkForAdjacentChests();
- }
-
- private final int updateSlots() {
- //Have slots changed?
- if (cachedChestType == 0) {
- return 0;
- }
- ItemUtils.organiseInventory(getInventory());
- cachedChestType = 0;
- return cachedChestType;
-
- }
-
+ private final Inventory_EggBox inventoryContents;
+
+ /** Determines if the check for adjacent chests has taken place. */
+ public boolean adjacentChestChecked;
+ /** Contains the chest tile located adjacent to this one (if any) */
+ public TileEntityEggBox adjacentChestZNeg;
+ /** Contains the chest tile located adjacent to this one (if any) */
+ public TileEntityEggBox adjacentChestXPos;
+ /** Contains the chest tile located adjacent to this one (if any) */
+ public TileEntityEggBox adjacentChestXNeg;
+ /** Contains the chest tile located adjacent to this one (if any) */
+ public TileEntityEggBox adjacentChestZPos;
+ /** The current angle of the lid (between 0 and 1) */
+ public float lidAngle;
+ /** The angle of the lid last tick */
+ public float prevLidAngle;
+ /** The number of players currently using this chest */
+ public int numPlayersUsing;
+
+ private String customName;
+
+ private int cachedChestType;
+ private int tickCount = 0;
+
+ public TileEntityEggBox() {
+ this.inventoryContents = new Inventory_EggBox();
+ }
+
+ public Inventory_EggBox getInventory() {
+ return this.inventoryContents;
+ }
+
+ @Override
+ public void updateEntity() {
+
+ // Try do chesty stuff
+ try {
+ this.updateEntityChest();
+ } catch (Throwable t) {
+
+ }
+
+ try {
+ if (!this.worldObj.isRemote) {
+ this.tickCount++;
+ if ((this.tickCount % 10) == 0) {
+ cachedChestType = 1;
+ }
+
+ if ((this.tickCount % 20) == 0) {
+ for (ItemStack inv : this.getInventory().getInventory()) {
+ if (inv == null) {
+ continue;
+ }
+ if (inv.getItem() instanceof ItemGiantEgg) {
+ ItemGiantEgg D = (ItemGiantEgg) inv.getItem();
+ tryUpdateDecayable(D, inv, this.worldObj);
+ }
+ }
+ }
+ updateSlots();
+ }
+ } catch (final Throwable t) {
+ }
+ }
+
+ public void tryUpdateDecayable(final ItemGiantEgg d, ItemStack iStack, final World world) {
+ if (world == null || iStack == null) {
+ return;
+ }
+ if (world.isRemote) {
+ return;
+ }
+
+ boolean a1, a2;
+ int u = 0;
+ a1 = d.isTicking(world, iStack);
+ a2 = false;
+ int SECONDS_TO_PROCESS = 1;
+ while (u < (20 * SECONDS_TO_PROCESS)) {
+ if (!a1) {
+ break;
+ }
+ a1 = d.isTicking(world, iStack);
+ a2 = d.tickItemTag(world, iStack);
+ u++;
+ }
+ Logger.MACHINE_INFO("| " + d.getUnlocalizedName() + " | " + a1 + "/" + a2);
+
+ if (!a1 && !a2) {
+ ItemStack replacement = ItemUtils.getSimpleStack(d.getHatchResult(), 1);
+ replacement.stackSize = 1;
+ // iStack = replacement.copy();
+ for (int fff = 0; fff < this.inventoryContents.getSizeInventory(); fff++) {
+ if (this.inventoryContents.getStackInSlot(fff) == iStack) {
+ this.inventoryContents.setInventorySlotContents(fff, replacement.copy());
+ }
+ }
+
+ updateSlots();
+ this.inventoryContents.markDirty();
+ }
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ // Utils.LOG_WARNING("Trying to write NBT data to TE.");
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.inventoryContents.writeToNBT(chestData);
+ nbt.setTag("ContentsChest", chestData);
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ // Utils.LOG_WARNING("Trying to read NBT data from TE.");
+ this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.getInventory().getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.getInventory().getStackInSlot(slot);
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int count) {
+ return this.getInventory().decrStackSize(slot, count);
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ return this.getInventory().getStackInSlotOnClosing(slot);
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.getInventory().setInventorySlotContents(slot, stack);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return this.getInventory().getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return this.getInventory().isUseableByPlayer(entityplayer);
+ }
+
+ @Override
+ public void openInventory() {
+ if (this.numPlayersUsing < 0) {
+ this.numPlayersUsing = 0;
+ }
+ if (!this.worldObj.isRemote) {
+ this.numPlayersUsing++;
+ cachedChestType = 1;
+ }
+ this.worldObj.addBlockEvent(
+ this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ if (!this.worldObj.isRemote) {
+ this.numPlayersUsing--;
+ cachedChestType = 1;
+ }
+ this.worldObj.addBlockEvent(
+ this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().closeInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return this.getInventory().isItemValidForSlot(slot, itemstack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ final int[] accessibleSides = new int[this.getSizeInventory()];
+ for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
+ accessibleSides[r] = r;
+ }
+ return accessibleSides;
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return this.getInventory().isItemValidForSlot(0, p_102007_2_);
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return this.getInventory().isItemValidForSlot(0, p_102008_2_);
+ }
+
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ public void setCustomName(final String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.EggBox";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.customName != null) && !this.customName.equals("");
+ }
+
+ /**
+ * Causes the TileEntity to reset all it's cached values for it's container
+ * Block, metadata and in the case of chests, the adjacent chest check
+ */
+ public void updateContainingBlockInfo() {
+ super.updateContainingBlockInfo();
+ this.adjacentChestChecked = false;
+ }
+
+ /**
+ * Performs the check for adjacent chests to determine if this chest is double
+ * or not.
+ */
+ public void checkForAdjacentChests() {
+ if (!this.adjacentChestChecked) {
+ this.adjacentChestChecked = true;
+ this.adjacentChestZNeg = null;
+ this.adjacentChestXPos = null;
+ this.adjacentChestXNeg = null;
+ this.adjacentChestZPos = null;
+ }
+ }
+
+ public void updateEntityChest() {
+ float f;
+ this.prevLidAngle = this.lidAngle;
+ f = 0.04F;
+ double d2;
+ if (this.numPlayersUsing > 0
+ && this.lidAngle == 0.0F
+ && this.adjacentChestZNeg == null
+ && this.adjacentChestXNeg == null) {
+ double d1 = (double) this.xCoord + 0.5D;
+ d2 = (double) this.zCoord + 0.5D;
+ this.worldObj.playSoundEffect(
+ d1,
+ (double) this.yCoord + 0.5D,
+ d2,
+ "random.chestopen",
+ 0.5F,
+ this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
+ }
+
+ if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) {
+ float f1 = this.lidAngle;
+ if (this.numPlayersUsing > 0) {
+ // this.lidAngle += f;
+ this.lidAngle += (float) (f * (1 + 0.10 * 0.01));
+ } else {
+ // this.lidAngle -= f;
+ this.lidAngle -= (float) (f * (1 + 0.10 * 0.01));
+ }
+ if (this.lidAngle > 1.0F) {
+ this.lidAngle = 1.0F;
+ }
+ float f2 = 0.5F;
+ if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) {
+ d2 = (double) this.xCoord + 0.5D;
+ double d0 = (double) this.zCoord + 0.5D;
+ this.worldObj.playSoundEffect(
+ d2,
+ (double) this.yCoord + 0.5D,
+ d0,
+ "random.chestclosed",
+ 0.5F,
+ this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
+ }
+
+ if (this.lidAngle < 0.0F) {
+ this.lidAngle = 0.0F;
+ }
+ }
+ }
+
+ /**
+ * Called when a client event is received with the event number and argument,
+ * see World.sendClientEvent
+ */
+ public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) {
+ if (p_145842_1_ == 1) {
+ this.numPlayersUsing = p_145842_2_;
+ return true;
+ } else {
+ return super.receiveClientEvent(p_145842_1_, p_145842_2_);
+ }
+ }
+
+ /**
+ * invalidates a tile entity
+ */
+ public final void invalidate() {
+ super.invalidate();
+ cachedChestType = 1;
+ this.updateContainingBlockInfo();
+ this.checkForAdjacentChests();
+ }
+
+ private final int updateSlots() {
+ // Have slots changed?
+ if (cachedChestType == 0) {
+ return 0;
+ }
+ ItemUtils.organiseInventory(getInventory());
+ cachedChestType = 0;
+ return cachedChestType;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java
index 49fde8ee64..67e044fc36 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java
@@ -1,39 +1,37 @@
package gtPlusPlus.core.tileentities.general;
import java.util.UUID;
-
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
-public class TileEntityFirepit extends TileEntity{
-
- private UUID ownerUUID;
+public class TileEntityFirepit extends TileEntity {
- public UUID getOwnerUUID() {
- return this.ownerUUID;
- }
+ private UUID ownerUUID;
- public void setOwnerUUID(final UUID ownerUUID) {
- this.ownerUUID = ownerUUID;
- this.markDirty();
- }
+ public UUID getOwnerUUID() {
+ return this.ownerUUID;
+ }
- @Override
- public void writeToNBT(final NBTTagCompound tagCompound) {
- super.writeToNBT(tagCompound);
+ public void setOwnerUUID(final UUID ownerUUID) {
+ this.ownerUUID = ownerUUID;
+ this.markDirty();
+ }
- final UUID ownerUUID = this.getOwnerUUID();
- if (ownerUUID != null){
- tagCompound.setLong("OwnerUUIDMost", ownerUUID.getMostSignificantBits());
- tagCompound.setLong("OwnerUUIDLeast", ownerUUID.getLeastSignificantBits());
- }
- }
+ @Override
+ public void writeToNBT(final NBTTagCompound tagCompound) {
+ super.writeToNBT(tagCompound);
- @Override
- public void readFromNBT(final NBTTagCompound tagCompound) {
- super.readFromNBT(tagCompound);
+ final UUID ownerUUID = this.getOwnerUUID();
+ if (ownerUUID != null) {
+ tagCompound.setLong("OwnerUUIDMost", ownerUUID.getMostSignificantBits());
+ tagCompound.setLong("OwnerUUIDLeast", ownerUUID.getLeastSignificantBits());
+ }
+ }
- this.setOwnerUUID(new UUID(tagCompound.getLong("OwnerUUIDMost"), tagCompound.getLong("OwnerUUIDLeast")));
- }
+ @Override
+ public void readFromNBT(final NBTTagCompound tagCompound) {
+ super.readFromNBT(tagCompound);
+ this.setOwnerUUID(new UUID(tagCompound.getLong("OwnerUUIDMost"), tagCompound.getLong("OwnerUUIDLeast")));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java
index beff269428..bd49b67f73 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java
@@ -1,7 +1,13 @@
package gtPlusPlus.core.tileentities.general;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.inventories.InventoryFishTrap;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import java.util.Random;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -10,401 +16,404 @@ import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
-
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.inventories.InventoryFishTrap;
-import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraftforge.common.FishingHooks;
public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
- private int tickCount = 0;
- private boolean isInWater = false;
- private final InventoryFishTrap inventoryContents;
- private String customName;
- private int locationX;
- private int locationY;
- private int locationZ;
- private int waterSides = 0;
- private int baseTickRate = 600 * 5;
-
- public TileEntityFishTrap() {
- this.inventoryContents = new InventoryFishTrap();// number of slots -
- // without product
- // slot
- this.setTileLocation();
- }
-
- public boolean setTileLocation() {
- if (this.hasWorldObj()) {
- if (!this.getWorldObj().isRemote) {
- this.locationX = this.xCoord;
- this.locationY = this.yCoord;
- this.locationZ = this.zCoord;
- return true;
- }
- }
- return false;
- }
-
- public final boolean isSurroundedByWater() {
- this.setTileLocation();
- final Block[] surroundingBlocks = new Block[6];
- if (this.hasWorldObj()) {
- if (!this.getWorldObj().isRemote) {
- surroundingBlocks[0] = this.worldObj.getBlock(this.locationX, this.locationY + 1, this.locationZ); // Above
- surroundingBlocks[1] = this.worldObj.getBlock(this.locationX, this.locationY - 1, this.locationZ); // Below
- surroundingBlocks[2] = this.worldObj.getBlock(this.locationX + 1, this.locationY, this.locationZ);
- surroundingBlocks[3] = this.worldObj.getBlock(this.locationX - 1, this.locationY, this.locationZ);
- surroundingBlocks[4] = this.worldObj.getBlock(this.locationX, this.locationY, this.locationZ + 1);
- surroundingBlocks[5] = this.worldObj.getBlock(this.locationX, this.locationY, this.locationZ - 1);
- int waterCount = 0;
- int trapCount = 0;
- for (final Block checkBlock : surroundingBlocks) {
- if ((checkBlock == Blocks.water) || (checkBlock == Blocks.flowing_water)
- || checkBlock.getUnlocalizedName().toLowerCase().contains("water")
- || (checkBlock == ModBlocks.blockFishTrap)) {
- if (checkBlock != ModBlocks.blockFishTrap) {
- waterCount++;
- }
- else {
- waterCount++;
- trapCount++;
- }
- }
- }
- if ((waterCount >= 2) && (trapCount <= 4)) {
- int aCheck = trapCount + waterCount;
- this.waterSides = MathUtils.balance(aCheck, 0, 6);
- Logger.MACHINE_INFO("Valid Trap. "+waterCount+" | "+(this.tickCount/20)+"/"+(this.baseTickRate/20));
- return true;
- }
- else if ((waterCount >= 2) && (trapCount > 4)) {
- Logger.MACHINE_INFO("Too many fish traps surrounding this one.");
- Logger.MACHINE_INFO("Not adding Loot to the fishtrap at x[" + this.locationX + "] y[" + this.locationY
- + "] z[" + this.locationZ + "] (Ticking for loot every " + this.baseTickRate + " ticks)");
- }
- }
- }
- // Utils.LOG_MACHINE_INFO("Error finding water");
- return false;
- }
-
- public InventoryFishTrap getInventory() {
- return this.inventoryContents;
- }
-
- public boolean tryAddLoot() {
- if (this.getInventory().getInventory() != null) {
- int checkingSlot = 0;
- ItemUtils.organiseInventory(getInventory());
- final ItemStack loot = this.generateLootForFishTrap().copy();
- try {
- //Utils.LOG_MACHINE_INFO("Trying to add "+loot.getDisplayName()+" | "+loot.getItemDamage());
- for (final ItemStack contents : this.getInventory().getInventory()) {
-
-
- if (GT_Utility.areStacksEqual(loot, contents)){
- if (contents.stackSize < contents.getMaxStackSize()) {
- //Utils.LOG_MACHINE_INFO("3-Trying to add one more "+loot.getDisplayName()+"meta: "+loot.getItemDamage()+" to an existing stack of "+contents.getDisplayName()+" with a size of "+contents.stackSize);
- contents.stackSize++;
- this.markDirty();
- return true;
- }
- }
- checkingSlot++;
- }
- checkingSlot = 0;
- for (final ItemStack contents : this.getInventory().getInventory()) {
- if (contents == null) {
- //Utils.LOG_MACHINE_INFO("Adding Item To Empty Slot. "+(checkingSlot+1));
- this.getInventory().setInventorySlotContents(checkingSlot, loot);
- this.markDirty();
- return true;
- }
- checkingSlot++;
- }
- }
- catch (final NullPointerException n) {
- }
- }
- this.markDirty();
- return false;
- }
-
- private ItemStack generateLootForFishTrap() {
- final int lootWeight = MathUtils.randInt(0, 100);
- ItemStack loot;
- if (lootWeight <= 5) {
- loot = ItemUtils.getSimpleStack(Items.slime_ball);
- }
- else if (lootWeight <= 10) {
- loot = ItemUtils.getSimpleStack(Items.bone);
- }
- else if (lootWeight <= 15) {
- loot = ItemUtils.getSimpleStack(Blocks.sand);
- }
- else if (lootWeight <= 20) {
- loot = ItemUtils.simpleMetaStack(Items.dye, 0, 1);
- }
- // Junk Loot
- else if (lootWeight <= 23) {
- if (LoadedMods.PamsHarvestcraft) {
- loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(seaweed, 1);
- }
- else {
- loot = ItemUtils.getSimpleStack(Blocks.dirt);
- }
- }
- // Pam Fish
- else if (lootWeight <= 99) {
- final Random xstr = new Random();
- loot = FishingHooks.getRandomFishable(xstr, 100);
- }
-
- else if (lootWeight == 100){
- final int rareLoot = MathUtils.randInt(1, 10);
- if (rareLoot <= 4) {
- loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nuggetIron", 1);
- if (loot == null){
- loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotIron", 1);
- }
- }
- else if (rareLoot <= 7) {
- loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nuggetGold", 1);
- if (loot == null){
- loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotGold", 1);
- }
- }
- else if (rareLoot <= 9){
- loot = ItemUtils.getSimpleStack(Items.emerald);
- }
- else {
- loot = ItemUtils.getSimpleStack(Items.diamond);
- }
- }
- else {
- loot = ItemUtils.getSimpleStack(Blocks.diamond_ore);
- }
- loot.stackSize=1;
- Logger.MACHINE_INFO("Adding x"+loot.stackSize+" "+loot.getDisplayName()+".");
- return loot;
- }
-
- @Override
- public void updateEntity() {
- try{
- if (!this.worldObj.isRemote) {
- this.tickCount++;
- //Logger.MACHINE_INFO("Ticking "+this.tickCount);
- // Check if the Tile is within water once per second.
- if ((this.tickCount % 20) == 0) {
- this.isInWater = this.isSurroundedByWater();
- }
-
- if (this.isInWater) {
- this.calculateTickrate();
- }
-
- // Try add some loot once every 30 seconds.
- if (this.tickCount >= this.baseTickRate) {
- if (this.isInWater) {
- // Add loot
- Logger.MACHINE_INFO("Adding Loot to the fishtrap at x["+this.locationX+"] y["+this.locationY+"] z["+this.locationZ+"] (Ticking for loot every "+this.baseTickRate+" ticks)");
-
- int aExtraLootChance = MathUtils.randInt(1, 1000);
- if (aExtraLootChance >= 999) {
- this.tryAddLoot();
- this.tryAddLoot();
- this.tryAddLoot();
- }
- else {
- this.tryAddLoot();
- }
-
- this.markDirty();
- }
- else {
- Logger.MACHINE_INFO("Not in water.");
- this.markDirty();
- }
- this.tickCount = 0;
- }
- if (this.tickCount >= (this.baseTickRate + 500)) {
- Logger.MACHINE_INFO("Resetting tick counter");
- this.tickCount = 0;
- }
-
- }
- }
- catch (final Throwable t){}
- }
-
- public void calculateTickrate() {
- int water = this.waterSides;
- //int variance = (int) ((MathUtils.randInt(-200, 200)/water)*0.5);
- if (water <= 1) {
- this.baseTickRate = 0;
- } else if (water == 2) {
- this.baseTickRate = 6800;
- } else if (water == 3) {
- this.baseTickRate = 5600;
- } else if (water == 4) {
- this.baseTickRate = 4400;
- } else if (water == 5) {
- this.baseTickRate = 3200;
- } else {
- this.baseTickRate = 1750;
- }
- if (water > 1) {
- //this.baseTickRate += variance;
- }
- }
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- // Utils.LOG_MACHINE_INFO("Trying to write NBT data to TE.");
- final NBTTagCompound chestData = new NBTTagCompound();
- this.inventoryContents.writeToNBT(chestData);
- nbt.setTag("ContentsChest", chestData);
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- // Utils.LOG_MACHINE_INFO("Trying to read NBT data from TE.");
- this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- }
-
- final static String prefix = "food";
- final static String suffix = "raw";
- final static String seaweed = "cropSeaweed";
- final static String greenheartFish = "Greenheartfish";
- private static final String[] harvestcraftFish = { "Anchovy", "Bass", "Carp", "Catfish", "Charr", "Clam", "Crab",
- "Crayfish", "Eel", "Frog", "Grouper", "Herring", "Jellyfish", "Mudfish", "Octopus", "Perch", "Scallop",
- "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye" };
-
- public static void pamsHarvestCraftCompat() {
- for (int i = 0; i < harvestcraftFish.length; i++) {
-
- }
- }
-
- @Override
- public int getSizeInventory() {
- return this.getInventory().getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.getInventory().getStackInSlot(slot);
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int count) {
- return this.getInventory().decrStackSize(slot, count);
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- return this.getInventory().getStackInSlotOnClosing(slot);
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.getInventory().setInventorySlotContents(slot, stack);
- }
-
- @Override
- public int getInventoryStackLimit() {
- return this.getInventory().getInventoryStackLimit();
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return this.getInventory().isUseableByPlayer(entityplayer);
- }
-
- @Override
- public void openInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().openInventory();
- }
-
- @Override
- public void closeInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().closeInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return this.getInventory().isItemValidForSlot(slot, itemstack);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- final int[] accessibleSides = new int[this.getSizeInventory()];
- for (int r=0; r<this.getInventory().getSizeInventory(); r++){
- accessibleSides[r]=r;
- }
- return accessibleSides;
-
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return true;
- }
-
- public String getCustomName() {
- return this.customName;
- }
-
- public void setCustomName(final String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.fishtrap";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
- }
-
+ private int tickCount = 0;
+ private boolean isInWater = false;
+ private final InventoryFishTrap inventoryContents;
+ private String customName;
+ private int locationX;
+ private int locationY;
+ private int locationZ;
+ private int waterSides = 0;
+ private int baseTickRate = 600 * 5;
+
+ public TileEntityFishTrap() {
+ this.inventoryContents = new InventoryFishTrap(); // number of slots -
+ // without product
+ // slot
+ this.setTileLocation();
+ }
+
+ public boolean setTileLocation() {
+ if (this.hasWorldObj()) {
+ if (!this.getWorldObj().isRemote) {
+ this.locationX = this.xCoord;
+ this.locationY = this.yCoord;
+ this.locationZ = this.zCoord;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public final boolean isSurroundedByWater() {
+ this.setTileLocation();
+ final Block[] surroundingBlocks = new Block[6];
+ if (this.hasWorldObj()) {
+ if (!this.getWorldObj().isRemote) {
+ surroundingBlocks[0] =
+ this.worldObj.getBlock(this.locationX, this.locationY + 1, this.locationZ); // Above
+ surroundingBlocks[1] =
+ this.worldObj.getBlock(this.locationX, this.locationY - 1, this.locationZ); // Below
+ surroundingBlocks[2] = this.worldObj.getBlock(this.locationX + 1, this.locationY, this.locationZ);
+ surroundingBlocks[3] = this.worldObj.getBlock(this.locationX - 1, this.locationY, this.locationZ);
+ surroundingBlocks[4] = this.worldObj.getBlock(this.locationX, this.locationY, this.locationZ + 1);
+ surroundingBlocks[5] = this.worldObj.getBlock(this.locationX, this.locationY, this.locationZ - 1);
+ int waterCount = 0;
+ int trapCount = 0;
+ for (final Block checkBlock : surroundingBlocks) {
+ if ((checkBlock == Blocks.water)
+ || (checkBlock == Blocks.flowing_water)
+ || checkBlock.getUnlocalizedName().toLowerCase().contains("water")
+ || (checkBlock == ModBlocks.blockFishTrap)) {
+ if (checkBlock != ModBlocks.blockFishTrap) {
+ waterCount++;
+ } else {
+ waterCount++;
+ trapCount++;
+ }
+ }
+ }
+ if ((waterCount >= 2) && (trapCount <= 4)) {
+ int aCheck = trapCount + waterCount;
+ this.waterSides = MathUtils.balance(aCheck, 0, 6);
+ Logger.MACHINE_INFO("Valid Trap. " + waterCount + " | " + (this.tickCount / 20) + "/"
+ + (this.baseTickRate / 20));
+ return true;
+ } else if ((waterCount >= 2) && (trapCount > 4)) {
+ Logger.MACHINE_INFO("Too many fish traps surrounding this one.");
+ Logger.MACHINE_INFO(
+ "Not adding Loot to the fishtrap at x[" + this.locationX + "] y[" + this.locationY + "] z["
+ + this.locationZ + "] (Ticking for loot every " + this.baseTickRate + " ticks)");
+ }
+ }
+ }
+ // Utils.LOG_MACHINE_INFO("Error finding water");
+ return false;
+ }
+
+ public InventoryFishTrap getInventory() {
+ return this.inventoryContents;
+ }
+
+ public boolean tryAddLoot() {
+ if (this.getInventory().getInventory() != null) {
+ int checkingSlot = 0;
+ ItemUtils.organiseInventory(getInventory());
+ final ItemStack loot = this.generateLootForFishTrap().copy();
+ try {
+ // Utils.LOG_MACHINE_INFO("Trying to add "+loot.getDisplayName()+" | "+loot.getItemDamage());
+ for (final ItemStack contents : this.getInventory().getInventory()) {
+
+ if (GT_Utility.areStacksEqual(loot, contents)) {
+ if (contents.stackSize < contents.getMaxStackSize()) {
+ // Utils.LOG_MACHINE_INFO("3-Trying to add one more "+loot.getDisplayName()+"meta:
+ // "+loot.getItemDamage()+" to an existing stack of "+contents.getDisplayName()+" with a
+ // size of "+contents.stackSize);
+ contents.stackSize++;
+ this.markDirty();
+ return true;
+ }
+ }
+ checkingSlot++;
+ }
+ checkingSlot = 0;
+ for (final ItemStack contents : this.getInventory().getInventory()) {
+ if (contents == null) {
+ // Utils.LOG_MACHINE_INFO("Adding Item To Empty Slot. "+(checkingSlot+1));
+ this.getInventory().setInventorySlotContents(checkingSlot, loot);
+ this.markDirty();
+ return true;
+ }
+ checkingSlot++;
+ }
+ } catch (final NullPointerException n) {
+ }
+ }
+ this.markDirty();
+ return false;
+ }
+
+ private ItemStack generateLootForFishTrap() {
+ final int lootWeight = MathUtils.randInt(0, 100);
+ ItemStack loot;
+ if (lootWeight <= 5) {
+ loot = ItemUtils.getSimpleStack(Items.slime_ball);
+ } else if (lootWeight <= 10) {
+ loot = ItemUtils.getSimpleStack(Items.bone);
+ } else if (lootWeight <= 15) {
+ loot = ItemUtils.getSimpleStack(Blocks.sand);
+ } else if (lootWeight <= 20) {
+ loot = ItemUtils.simpleMetaStack(Items.dye, 0, 1);
+ }
+ // Junk Loot
+ else if (lootWeight <= 23) {
+ if (LoadedMods.PamsHarvestcraft) {
+ loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(seaweed, 1);
+ } else {
+ loot = ItemUtils.getSimpleStack(Blocks.dirt);
+ }
+ }
+ // Pam Fish
+ else if (lootWeight <= 99) {
+ final Random xstr = new Random();
+ loot = FishingHooks.getRandomFishable(xstr, 100);
+ } else if (lootWeight == 100) {
+ final int rareLoot = MathUtils.randInt(1, 10);
+ if (rareLoot <= 4) {
+ loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nuggetIron", 1);
+ if (loot == null) {
+ loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotIron", 1);
+ }
+ } else if (rareLoot <= 7) {
+ loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nuggetGold", 1);
+ if (loot == null) {
+ loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotGold", 1);
+ }
+ } else if (rareLoot <= 9) {
+ loot = ItemUtils.getSimpleStack(Items.emerald);
+ } else {
+ loot = ItemUtils.getSimpleStack(Items.diamond);
+ }
+ } else {
+ loot = ItemUtils.getSimpleStack(Blocks.diamond_ore);
+ }
+ loot.stackSize = 1;
+ Logger.MACHINE_INFO("Adding x" + loot.stackSize + " " + loot.getDisplayName() + ".");
+ return loot;
+ }
+
+ @Override
+ public void updateEntity() {
+ try {
+ if (!this.worldObj.isRemote) {
+ this.tickCount++;
+ // Logger.MACHINE_INFO("Ticking "+this.tickCount);
+ // Check if the Tile is within water once per second.
+ if ((this.tickCount % 20) == 0) {
+ this.isInWater = this.isSurroundedByWater();
+ }
+
+ if (this.isInWater) {
+ this.calculateTickrate();
+ }
+
+ // Try add some loot once every 30 seconds.
+ if (this.tickCount >= this.baseTickRate) {
+ if (this.isInWater) {
+ // Add loot
+ Logger.MACHINE_INFO("Adding Loot to the fishtrap at x[" + this.locationX + "] y["
+ + this.locationY + "] z[" + this.locationZ + "] (Ticking for loot every "
+ + this.baseTickRate + " ticks)");
+
+ int aExtraLootChance = MathUtils.randInt(1, 1000);
+ if (aExtraLootChance >= 999) {
+ this.tryAddLoot();
+ this.tryAddLoot();
+ this.tryAddLoot();
+ } else {
+ this.tryAddLoot();
+ }
+
+ this.markDirty();
+ } else {
+ Logger.MACHINE_INFO("Not in water.");
+ this.markDirty();
+ }
+ this.tickCount = 0;
+ }
+ if (this.tickCount >= (this.baseTickRate + 500)) {
+ Logger.MACHINE_INFO("Resetting tick counter");
+ this.tickCount = 0;
+ }
+ }
+ } catch (final Throwable t) {
+ }
+ }
+
+ public void calculateTickrate() {
+ int water = this.waterSides;
+ // int variance = (int) ((MathUtils.randInt(-200, 200)/water)*0.5);
+ if (water <= 1) {
+ this.baseTickRate = 0;
+ } else if (water == 2) {
+ this.baseTickRate = 6800;
+ } else if (water == 3) {
+ this.baseTickRate = 5600;
+ } else if (water == 4) {
+ this.baseTickRate = 4400;
+ } else if (water == 5) {
+ this.baseTickRate = 3200;
+ } else {
+ this.baseTickRate = 1750;
+ }
+ if (water > 1) {
+ // this.baseTickRate += variance;
+ }
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ // Utils.LOG_MACHINE_INFO("Trying to write NBT data to TE.");
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.inventoryContents.writeToNBT(chestData);
+ nbt.setTag("ContentsChest", chestData);
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ // Utils.LOG_MACHINE_INFO("Trying to read NBT data from TE.");
+ this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+ }
+
+ static final String prefix = "food";
+ static final String suffix = "raw";
+ static final String seaweed = "cropSeaweed";
+ static final String greenheartFish = "Greenheartfish";
+ private static final String[] harvestcraftFish = {
+ "Anchovy",
+ "Bass",
+ "Carp",
+ "Catfish",
+ "Charr",
+ "Clam",
+ "Crab",
+ "Crayfish",
+ "Eel",
+ "Frog",
+ "Grouper",
+ "Herring",
+ "Jellyfish",
+ "Mudfish",
+ "Octopus",
+ "Perch",
+ "Scallop",
+ "Shrimp",
+ "Snail",
+ "Snapper",
+ "Tilapia",
+ "Trout",
+ "Tuna",
+ "Turtle",
+ "Walleye"
+ };
+
+ public static void pamsHarvestCraftCompat() {
+ for (int i = 0; i < harvestcraftFish.length; i++) {}
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.getInventory().getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.getInventory().getStackInSlot(slot);
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int count) {
+ return this.getInventory().decrStackSize(slot, count);
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ return this.getInventory().getStackInSlotOnClosing(slot);
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.getInventory().setInventorySlotContents(slot, stack);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return this.getInventory().getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return this.getInventory().isUseableByPlayer(entityplayer);
+ }
+
+ @Override
+ public void openInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().closeInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return this.getInventory().isItemValidForSlot(slot, itemstack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ final int[] accessibleSides = new int[this.getSizeInventory()];
+ for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
+ accessibleSides[r] = r;
+ }
+ return accessibleSides;
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return true;
+ }
+
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ public void setCustomName(final String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.fishtrap";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.customName != null) && !this.customName.equals("");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java
index 8a2d9d9f51..d45ebd77f7 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java
@@ -1,124 +1,116 @@
package gtPlusPlus.core.tileentities.general;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-
import gregtech.api.enums.GT_Values;
-
import gtPlusPlus.core.inventories.InventoryHeliumGenerator;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
-public class TileEntityHeliumGenerator extends TileEntity{
-
- private int tickCount = 0;
- private final InventoryHeliumGenerator inventoryContents; //TODO
- private int locationX;
- private int locationY;
- private int locationZ;
- private int baseTickRate = 1200;
-
- public TileEntityHeliumGenerator(){
- this.inventoryContents = new InventoryHeliumGenerator();//number of slots - without product slot
- this.setTileLocation();
- }
-
- public boolean setTileLocation(){
- if (this.hasWorldObj()){
- if (!this.getWorldObj().isRemote){
- this.locationX = this.xCoord;
- this.locationY = this.yCoord;
- this.locationZ = this.zCoord;
- return true;
- }
- }
- return false;
- }
-
- public InventoryHeliumGenerator getInventory(){
- return this.inventoryContents;
- }
-
- public boolean tryAddLoot(){
- if (this.getInventory().getInventory() != null){
- int checkingSlot = 0;
- final ItemStack loot = this.generateLootForFishTrap();
- for (final ItemStack contents : this.getInventory().getInventory()){
- if (contents == null){
- this.getInventory().setInventorySlotContents(checkingSlot, loot);
- this.markDirty();
- return true;
- }
- else if (contents.getItem() == loot.getItem()){
- if (contents.stackSize < contents.getMaxStackSize()){
- contents.stackSize++;
- this.markDirty();
- return true;
- }
- else {
- this.getInventory().setInventorySlotContents(checkingSlot, loot);
- this.markDirty();
- return true;
- }
- }
- else {
-
- }
- checkingSlot++;
- }
- }
- this.markDirty();
- return false;
- }
-
- private ItemStack generateLootForFishTrap() {
- final int lootWeight = MathUtils.randInt(0, 1000);
- ItemStack loot = GT_Values.NI;
- if (lootWeight > 990){
- loot = ItemUtils.getSimpleStack(Items.slime_ball);
- }
- return loot;
- }
-
- @Override
- public void updateEntity(){
- if (!this.worldObj.isRemote){
-
- }
- }
-
- public void calculateTickrate(){
- int calculateTickrate = 0;
- this.baseTickRate = calculateTickrate;
- }
-
- public boolean anyPlayerInRange(){
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag){
- if(!nbt.hasKey(tag)){
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt){
- super.writeToNBT(nbt);
- //Utils.LOG_INFO("Trying to write NBT data to TE.");
- final NBTTagCompound chestData = new NBTTagCompound();
- this.inventoryContents.writeToNBT(chestData);
- nbt.setTag("ContentsChest", chestData);
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt){
- super.readFromNBT(nbt);
- //Utils.LOG_INFO("Trying to read NBT data from TE.");
- this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- }
-
+public class TileEntityHeliumGenerator extends TileEntity {
+
+ private int tickCount = 0;
+ private final InventoryHeliumGenerator inventoryContents; // TODO
+ private int locationX;
+ private int locationY;
+ private int locationZ;
+ private int baseTickRate = 1200;
+
+ public TileEntityHeliumGenerator() {
+ this.inventoryContents = new InventoryHeliumGenerator(); // number of slots - without product slot
+ this.setTileLocation();
+ }
+
+ public boolean setTileLocation() {
+ if (this.hasWorldObj()) {
+ if (!this.getWorldObj().isRemote) {
+ this.locationX = this.xCoord;
+ this.locationY = this.yCoord;
+ this.locationZ = this.zCoord;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public InventoryHeliumGenerator getInventory() {
+ return this.inventoryContents;
+ }
+
+ public boolean tryAddLoot() {
+ if (this.getInventory().getInventory() != null) {
+ int checkingSlot = 0;
+ final ItemStack loot = this.generateLootForFishTrap();
+ for (final ItemStack contents : this.getInventory().getInventory()) {
+ if (contents == null) {
+ this.getInventory().setInventorySlotContents(checkingSlot, loot);
+ this.markDirty();
+ return true;
+ } else if (contents.getItem() == loot.getItem()) {
+ if (contents.stackSize < contents.getMaxStackSize()) {
+ contents.stackSize++;
+ this.markDirty();
+ return true;
+ } else {
+ this.getInventory().setInventorySlotContents(checkingSlot, loot);
+ this.markDirty();
+ return true;
+ }
+ } else {
+
+ }
+ checkingSlot++;
+ }
+ }
+ this.markDirty();
+ return false;
+ }
+
+ private ItemStack generateLootForFishTrap() {
+ final int lootWeight = MathUtils.randInt(0, 1000);
+ ItemStack loot = GT_Values.NI;
+ if (lootWeight > 990) {
+ loot = ItemUtils.getSimpleStack(Items.slime_ball);
+ }
+ return loot;
+ }
+
+ @Override
+ public void updateEntity() {
+ if (!this.worldObj.isRemote) {}
+ }
+
+ public void calculateTickrate() {
+ int calculateTickrate = 0;
+ this.baseTickRate = calculateTickrate;
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ // Utils.LOG_INFO("Trying to write NBT data to TE.");
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.inventoryContents.writeToNBT(chestData);
+ nbt.setTag("ContentsChest", chestData);
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ // Utils.LOG_INFO("Trying to read NBT data from TE.");
+ this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java
index 9ddf2065bc..a21448bce7 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityInfiniteFluid.java
@@ -5,135 +5,132 @@ import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
-
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.*;
public class TileEntityInfiniteFluid extends TileEntity implements IFluidHandler {
- public FluidTank tank = new FluidTank(Integer.MAX_VALUE);
- private boolean needsUpdate = false;
- private int updateTimer = 0;
-
- public TileEntityInfiniteFluid() {
- }
-
- @Override
- public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
- needsUpdate = true;
- return this.tank.fill(resource, doFill);
- }
-
- @Override
- public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
- needsUpdate = true;
- return this.tank.drain(resource.amount, doDrain);
- }
-
- @Override
- public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
- needsUpdate = true;
- FluidStack fluid = this.tank.getFluid();
- // return this.tank.drain(maxDrain, doDrain);
- if (fluid == null) {
- return null;
- }
-
- int drained = maxDrain;
- if (fluid.amount < drained) {
- drained = fluid.amount;
- }
-
- FluidStack stack = new FluidStack(fluid, drained);
- if (doDrain) {
- fluid.amount -= drained;
- if (fluid.amount <= 0) {
- fluid = null;
- }
-
- if (this != null) {
- FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, this.getWorldObj(), this.xCoord,
- this.yCoord, this.zCoord, this.tank, 0));
- }
- }
- return stack;
- }
-
- @Override
- public boolean canFill(ForgeDirection from, Fluid fluid) {
- return true;
- }
-
- @Override
- public boolean canDrain(ForgeDirection from, Fluid fluid) {
- return true;
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(ForgeDirection from) {
- return new FluidTankInfo[] { this.tank.getInfo() };
- }
-
- public float getAdjustedVolume() {
- needsUpdate = true;
- float amount = tank.getFluidAmount();
- float capacity = tank.getCapacity();
- float volume = (amount / capacity) * 0.8F;
- return volume;
- }
-
- @Override
- public void updateEntity() {
-
- if (this.tank.getFluid() != null){
- FluidStack bigStorage = this.tank.getFluid();
- bigStorage.amount = this.tank.getCapacity();
- this.tank.setFluid(bigStorage);
- }
-
- if (needsUpdate) {
-
- if (this.tank.getFluid() != null){
- FluidStack bigStorage = this.tank.getFluid();
- bigStorage.amount = this.tank.getCapacity();
- this.tank.setFluid(bigStorage);
- }
-
- if (updateTimer == 0) {
- updateTimer = 10; // every 10 ticks it will send an update
- } else {
- --updateTimer;
- if (updateTimer == 0) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- needsUpdate = false;
- }
- }
- }
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
- tank.readFromNBT(tag);
- super.readFromNBT(tag);
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
- tank.writeToNBT(tag);
- super.writeToNBT(tag);
- }
-
- @Override
- public Packet getDescriptionPacket() {
- NBTTagCompound tag = new NBTTagCompound();
- writeToNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
- }
-
- @Override
- public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
- NBTTagCompound tag = pkt.func_148857_g();
- readFromNBT(tag);
- }
-
+ public FluidTank tank = new FluidTank(Integer.MAX_VALUE);
+ private boolean needsUpdate = false;
+ private int updateTimer = 0;
+
+ public TileEntityInfiniteFluid() {}
+
+ @Override
+ public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
+ needsUpdate = true;
+ return this.tank.fill(resource, doFill);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
+ needsUpdate = true;
+ return this.tank.drain(resource.amount, doDrain);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
+ needsUpdate = true;
+ FluidStack fluid = this.tank.getFluid();
+ // return this.tank.drain(maxDrain, doDrain);
+ if (fluid == null) {
+ return null;
+ }
+
+ int drained = maxDrain;
+ if (fluid.amount < drained) {
+ drained = fluid.amount;
+ }
+
+ FluidStack stack = new FluidStack(fluid, drained);
+ if (doDrain) {
+ fluid.amount -= drained;
+ if (fluid.amount <= 0) {
+ fluid = null;
+ }
+
+ if (this != null) {
+ FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(
+ fluid, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this.tank, 0));
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection from, Fluid fluid) {
+ return true;
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection from, Fluid fluid) {
+ return true;
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection from) {
+ return new FluidTankInfo[] {this.tank.getInfo()};
+ }
+
+ public float getAdjustedVolume() {
+ needsUpdate = true;
+ float amount = tank.getFluidAmount();
+ float capacity = tank.getCapacity();
+ float volume = (amount / capacity) * 0.8F;
+ return volume;
+ }
+
+ @Override
+ public void updateEntity() {
+
+ if (this.tank.getFluid() != null) {
+ FluidStack bigStorage = this.tank.getFluid();
+ bigStorage.amount = this.tank.getCapacity();
+ this.tank.setFluid(bigStorage);
+ }
+
+ if (needsUpdate) {
+
+ if (this.tank.getFluid() != null) {
+ FluidStack bigStorage = this.tank.getFluid();
+ bigStorage.amount = this.tank.getCapacity();
+ this.tank.setFluid(bigStorage);
+ }
+
+ if (updateTimer == 0) {
+ updateTimer = 10; // every 10 ticks it will send an update
+ } else {
+ --updateTimer;
+ if (updateTimer == 0) {
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ needsUpdate = false;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound tag) {
+ tank.readFromNBT(tag);
+ super.readFromNBT(tag);
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound tag) {
+ tank.writeToNBT(tag);
+ super.writeToNBT(tag);
+ }
+
+ @Override
+ public Packet getDescriptionPacket() {
+ NBTTagCompound tag = new NBTTagCompound();
+ writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
+ }
+
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
+ NBTTagCompound tag = pkt.func_148857_g();
+ readFromNBT(tag);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityPlayerDoorBase.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityPlayerDoorBase.java
index 48f05fe0fd..a9ac7683d4 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityPlayerDoorBase.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityPlayerDoorBase.java
@@ -1,11 +1,10 @@
package gtPlusPlus.core.tileentities.general;
-import java.util.ArrayList;
-import java.util.List;
-
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.util.minecraft.EntityUtils;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDoor;
import net.minecraft.entity.Entity;
@@ -17,269 +16,261 @@ import net.minecraft.world.chunk.Chunk;
public class TileEntityPlayerDoorBase extends TileEntity {
- public boolean mIsOpen = false;
- private short mMeta = 0;
- private long mTickCounter = 0;
- private final Block mBlockType;
- private BlockPos mNeighbourDoor;
+ public boolean mIsOpen = false;
+ private short mMeta = 0;
+ private long mTickCounter = 0;
+ private final Block mBlockType;
+ private BlockPos mNeighbourDoor;
+
+ public TileEntityPlayerDoorBase(Block aBlock, int meta) {
+ mBlockType = aBlock;
+ }
- public TileEntityPlayerDoorBase(Block aBlock, int meta) {
- mBlockType = aBlock;
- }
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ super.readFromNBT(aNBT);
+ this.mIsOpen = aNBT.getBoolean("mIsOpen");
+ }
- @Override
- public void readFromNBT(NBTTagCompound aNBT) {
- super.readFromNBT(aNBT);
- this.mIsOpen = aNBT.getBoolean("mIsOpen");
- }
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ super.writeToNBT(aNBT);
+ aNBT.setBoolean("mIsOpen", mIsOpen);
+ }
- @Override
- public void writeToNBT(NBTTagCompound aNBT) {
- super.writeToNBT(aNBT);
- aNBT.setBoolean("mIsOpen", mIsOpen);
- }
+ public int getNeighbourState() {
- public int getNeighbourState() {
+ if (mNeighbourDoor != null) {
+ World aWorld = this.worldObj;
+ if (aWorld != null) {
+ TileEntity t = aWorld.getTileEntity(mNeighbourDoor.xPos, mNeighbourDoor.yPos, mNeighbourDoor.zPos);
+ // Custom Door
+ if (t != null) {
+ if (t instanceof TileEntityPlayerDoorBase) {
+ TileEntityPlayerDoorBase d = (TileEntityPlayerDoorBase) t;
+ if (d.mIsOpen) {
+ return 100;
+ } else {
+ return -100;
+ }
+ } else return -100;
+ }
+ // Vanilla Door
+ else {
+ Block aBlock = mNeighbourDoor.getBlockAtPos();
+ BlockDoor aDoor = (aBlock instanceof BlockDoor ? (BlockDoor) aBlock : null);
+ if (aDoor != null) {
+ int i1 = aDoor.func_150012_g(
+ mNeighbourDoor.world, mNeighbourDoor.xPos, mNeighbourDoor.yPos, mNeighbourDoor.zPos);
+ if ((i1 & 4) != 0) {
+ return 100;
+ } else {
+ return -100;
+ }
+ }
+ }
+ }
+ }
+ return 0;
+ }
- if (mNeighbourDoor != null) {
- World aWorld = this.worldObj;
- if (aWorld != null) {
- TileEntity t = aWorld.getTileEntity(mNeighbourDoor.xPos, mNeighbourDoor.yPos, mNeighbourDoor.zPos);
- // Custom Door
- if (t != null) {
- if (t instanceof TileEntityPlayerDoorBase) {
- TileEntityPlayerDoorBase d = (TileEntityPlayerDoorBase) t;
- if (d.mIsOpen) {
- return 100;
- } else {
- return -100;
- }
- } else
- return -100;
- }
- // Vanilla Door
- else {
- Block aBlock = mNeighbourDoor.getBlockAtPos();
- BlockDoor aDoor = (aBlock instanceof BlockDoor ? (BlockDoor) aBlock : null);
- if (aDoor != null) {
- int i1 = aDoor.func_150012_g(mNeighbourDoor.world, mNeighbourDoor.xPos, mNeighbourDoor.yPos,
- mNeighbourDoor.zPos);
- if ((i1 & 4) != 0) {
- return 100;
- } else {
- return -100;
- }
- }
- }
- }
- }
- return 0;
- }
+ AutoMap<Entity> mNearbyEntityCache = new AutoMap<Entity>();
- AutoMap<Entity> mNearbyEntityCache = new AutoMap<Entity>();
-
- @Override
- public void updateEntity() {
+ @Override
+ public void updateEntity() {
- if (this.getWorldObj().isRemote) {
- return;
- }
+ if (this.getWorldObj().isRemote) {
+ return;
+ }
- // Look For Neighbours
- if (mTickCounter % 100 == 0 || mTickCounter == 0) {
- World aWorld = this.getWorldObj();
- BlockPos aThisPos = new BlockPos(xCoord, yCoord, zCoord, aWorld);
- BlockPos[] aNeighbors = new BlockPos[4];
- aNeighbors[0] = aThisPos.getXNeg();
- aNeighbors[1] = aThisPos.getXPos();
- aNeighbors[2] = aThisPos.getZNeg();
- aNeighbors[3] = aThisPos.getZPos();
- boolean aFoundDoor = false;
- for (BlockPos b : aNeighbors) {
- Block aBlock = aWorld.getBlock(b.xPos, b.yPos, b.zPos);
- BlockDoor aDoor = (aBlock instanceof BlockDoor ? (BlockDoor) aBlock : null);
- if (aDoor != null) {
- mNeighbourDoor = b;
- aFoundDoor = true;
- if (mMeta == 0) {
- TileEntity t = aWorld.getTileEntity(b.xPos, b.yPos, b.zPos);
- if (t != null) {
- if (t instanceof TileEntityPlayerDoorBase) {
- TileEntityPlayerDoorBase d = (TileEntityPlayerDoorBase) t;
- if (d.mMeta != 0) {
- //Logger.INFO("Found Door with Mode set other than 0, assuming slave role.");
- mMeta = -1;
- }
- else {
- //Logger.INFO("Found door with no mode set, assuming we are master.");
- mMeta = 1;
- }
- }
- else {
- //Logger.INFO("Custom door from another mod, assuming slave role.");
- mMeta = -1;
- }
- }
- else {
- //Logger.INFO("No Tile Entity found, Door is probably vanilla, assuming slave role.");
- mMeta = -1;
- }
- }
- break;
- }
- }
- if (mMeta < 1 && !aFoundDoor) {
- //Logger.INFO("Found No Valid Doors around, setting this one to master mode.");
- mMeta = 1;
- }
- }
+ // Look For Neighbours
+ if (mTickCounter % 100 == 0 || mTickCounter == 0) {
+ World aWorld = this.getWorldObj();
+ BlockPos aThisPos = new BlockPos(xCoord, yCoord, zCoord, aWorld);
+ BlockPos[] aNeighbors = new BlockPos[4];
+ aNeighbors[0] = aThisPos.getXNeg();
+ aNeighbors[1] = aThisPos.getXPos();
+ aNeighbors[2] = aThisPos.getZNeg();
+ aNeighbors[3] = aThisPos.getZPos();
+ boolean aFoundDoor = false;
+ for (BlockPos b : aNeighbors) {
+ Block aBlock = aWorld.getBlock(b.xPos, b.yPos, b.zPos);
+ BlockDoor aDoor = (aBlock instanceof BlockDoor ? (BlockDoor) aBlock : null);
+ if (aDoor != null) {
+ mNeighbourDoor = b;
+ aFoundDoor = true;
+ if (mMeta == 0) {
+ TileEntity t = aWorld.getTileEntity(b.xPos, b.yPos, b.zPos);
+ if (t != null) {
+ if (t instanceof TileEntityPlayerDoorBase) {
+ TileEntityPlayerDoorBase d = (TileEntityPlayerDoorBase) t;
+ if (d.mMeta != 0) {
+ // Logger.INFO("Found Door with Mode set other than 0, assuming slave role.");
+ mMeta = -1;
+ } else {
+ // Logger.INFO("Found door with no mode set, assuming we are master.");
+ mMeta = 1;
+ }
+ } else {
+ // Logger.INFO("Custom door from another mod, assuming slave role.");
+ mMeta = -1;
+ }
+ } else {
+ // Logger.INFO("No Tile Entity found, Door is probably vanilla, assuming slave role.");
+ mMeta = -1;
+ }
+ }
+ break;
+ }
+ }
+ if (mMeta < 1 && !aFoundDoor) {
+ // Logger.INFO("Found No Valid Doors around, setting this one to master mode.");
+ mMeta = 1;
+ }
+ }
- World aWorld = this.getWorldObj();
- Block aBlock = aWorld.getBlock(xCoord, yCoord, zCoord);
- BlockPos aThisPos = new BlockPos(xCoord, yCoord, zCoord, this.worldObj);
-
- if (mTickCounter % 20 == 0) {
- int x = 0, y = 0, z = 0;
- x = this.xCoord;
- y = this.yCoord;
- z = this.zCoord;
- //List aEntityList = aWorld.loadedEntityList;
- List<Entity> aEntityList = new ArrayList<Entity>();
- Chunk aThisChunk = aWorld.getChunkFromBlockCoords(x, z);
- for (List l : aThisChunk.entityLists) {
- aEntityList.addAll(l);
- }
- for (Object o : aEntityList) {
- if (o != null) {
- if (o instanceof Entity) {
- if (o instanceof EntityPlayer) {
- continue;
- }
- else {
- Entity e = (Entity) o;
- BlockPos p = EntityUtils.findBlockPosUnderEntity(e);
- if (p != null) {
- int newY = p.yPos+1;
- if (e.getDistance(xCoord, yCoord, zCoord) <= 2){
- mNearbyEntityCache.put(e);
- }
- else if (aThisPos.distanceFrom(p.xPos, newY, p.zPos) <= 2) {
- mNearbyEntityCache.put(e);
- }
- }
- }
- }
- }
- }
- }
+ World aWorld = this.getWorldObj();
+ Block aBlock = aWorld.getBlock(xCoord, yCoord, zCoord);
+ BlockPos aThisPos = new BlockPos(xCoord, yCoord, zCoord, this.worldObj);
- if (mTickCounter % 4 == 0) {
- for (Entity y : mNearbyEntityCache) {
- if (y.getDistance(xCoord, yCoord, zCoord) > 2){
- mNearbyEntityCache.remove(y);
- }
- }
-
- boolean foundMonster = mNearbyEntityCache.size() > 0;
- int aNeighbourDoorState = 0;
- if (mNeighbourDoor != null) {
- aNeighbourDoorState = getNeighbourState();
- }
- BlockDoor aDoor = (aBlock instanceof BlockDoor ? (BlockDoor) aBlock : null);
- boolean aPlayers = checkForPlayers(this.getWorldObj());
+ if (mTickCounter % 20 == 0) {
+ int x = 0, y = 0, z = 0;
+ x = this.xCoord;
+ y = this.yCoord;
+ z = this.zCoord;
+ // List aEntityList = aWorld.loadedEntityList;
+ List<Entity> aEntityList = new ArrayList<Entity>();
+ Chunk aThisChunk = aWorld.getChunkFromBlockCoords(x, z);
+ for (List l : aThisChunk.entityLists) {
+ aEntityList.addAll(l);
+ }
+ for (Object o : aEntityList) {
+ if (o != null) {
+ if (o instanceof Entity) {
+ if (o instanceof EntityPlayer) {
+ continue;
+ } else {
+ Entity e = (Entity) o;
+ BlockPos p = EntityUtils.findBlockPosUnderEntity(e);
+ if (p != null) {
+ int newY = p.yPos + 1;
+ if (e.getDistance(xCoord, yCoord, zCoord) <= 2) {
+ mNearbyEntityCache.put(e);
+ } else if (aThisPos.distanceFrom(p.xPos, newY, p.zPos) <= 2) {
+ mNearbyEntityCache.put(e);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
- if (aDoor != null) {
- //If neighbour state != 0 and we are in slave mode
- if (aNeighbourDoorState != 0 && mMeta == -1) {
- if (aNeighbourDoorState == 100) {
- if (!mIsOpen && !foundMonster) {
- //Logger.INFO("Opening Door (Slave)");
- aDoor.func_150014_a(aWorld, this.xCoord, this.yCoord, this.zCoord, true);
- mIsOpen = true;
- }
- } else if (aNeighbourDoorState == -100 || foundMonster) {
- if (mIsOpen) {
- //Logger.INFO("Closing Door (Slave)");
- aDoor.func_150014_a(aWorld, this.xCoord, this.yCoord, this.zCoord, false);
- mIsOpen = false;
- }
- }
- //We are master, proceed
- } else {
- //No redstone found, allow automatic handling
- if (aDoor != null && !hasRedstone()) {
- //Found a nearby player
- if (aPlayers) {
- //If we are closed and there are no monsters nearby, open
- if (!mIsOpen && !foundMonster) {
- //Logger.INFO("Opening Door (Mstr)");
- aDoor.func_150014_a(aWorld, this.xCoord, this.yCoord, this.zCoord, true);
- mIsOpen = true;
- } else {
- // Logger.INFO("Doing Nothing, Door is in correct state.");
- }
- //Did not find nearby player
- } else {
- //If we are open or there is a monster nearby, close.
- if (mIsOpen || foundMonster) {
- //Logger.INFO("Closing Door (Mstr)");
- aDoor.func_150014_a(aWorld, this.xCoord, this.yCoord, this.zCoord, false);
- mIsOpen = false;
- } else {
- // Logger.INFO("Doing Nothing, Door is in correct state.");
- }
- }
- }
- }
- }
+ if (mTickCounter % 4 == 0) {
+ for (Entity y : mNearbyEntityCache) {
+ if (y.getDistance(xCoord, yCoord, zCoord) > 2) {
+ mNearbyEntityCache.remove(y);
+ }
+ }
- }
- super.updateEntity();
- mTickCounter++;
- }
+ boolean foundMonster = mNearbyEntityCache.size() > 0;
+ int aNeighbourDoorState = 0;
+ if (mNeighbourDoor != null) {
+ aNeighbourDoorState = getNeighbourState();
+ }
+ BlockDoor aDoor = (aBlock instanceof BlockDoor ? (BlockDoor) aBlock : null);
+ boolean aPlayers = checkForPlayers(this.getWorldObj());
- @Override
- public int getBlockMetadata() {
- return this.mMeta;
- }
+ if (aDoor != null) {
+ // If neighbour state != 0 and we are in slave mode
+ if (aNeighbourDoorState != 0 && mMeta == -1) {
+ if (aNeighbourDoorState == 100) {
+ if (!mIsOpen && !foundMonster) {
+ // Logger.INFO("Opening Door (Slave)");
+ aDoor.func_150014_a(aWorld, this.xCoord, this.yCoord, this.zCoord, true);
+ mIsOpen = true;
+ }
+ } else if (aNeighbourDoorState == -100 || foundMonster) {
+ if (mIsOpen) {
+ // Logger.INFO("Closing Door (Slave)");
+ aDoor.func_150014_a(aWorld, this.xCoord, this.yCoord, this.zCoord, false);
+ mIsOpen = false;
+ }
+ }
+ // We are master, proceed
+ } else {
+ // No redstone found, allow automatic handling
+ if (aDoor != null && !hasRedstone()) {
+ // Found a nearby player
+ if (aPlayers) {
+ // If we are closed and there are no monsters nearby, open
+ if (!mIsOpen && !foundMonster) {
+ // Logger.INFO("Opening Door (Mstr)");
+ aDoor.func_150014_a(aWorld, this.xCoord, this.yCoord, this.zCoord, true);
+ mIsOpen = true;
+ } else {
+ // Logger.INFO("Doing Nothing, Door is in correct state.");
+ }
+ // Did not find nearby player
+ } else {
+ // If we are open or there is a monster nearby, close.
+ if (mIsOpen || foundMonster) {
+ // Logger.INFO("Closing Door (Mstr)");
+ aDoor.func_150014_a(aWorld, this.xCoord, this.yCoord, this.zCoord, false);
+ mIsOpen = false;
+ } else {
+ // Logger.INFO("Doing Nothing, Door is in correct state.");
+ }
+ }
+ }
+ }
+ }
+ }
+ super.updateEntity();
+ mTickCounter++;
+ }
- public boolean hasRedstone() {
- World aWorld = this.worldObj;
- if (aWorld != null && !aWorld.isRemote) {
- return aWorld.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)
- || aWorld.isBlockIndirectlyGettingPowered(xCoord, yCoord + 1, zCoord);
- }
- return false;
- }
+ @Override
+ public int getBlockMetadata() {
+ return this.mMeta;
+ }
- @Override
- public Block getBlockType() {
- return mBlockType;
- }
+ public boolean hasRedstone() {
+ World aWorld = this.worldObj;
+ if (aWorld != null && !aWorld.isRemote) {
+ return aWorld.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)
+ || aWorld.isBlockIndirectlyGettingPowered(xCoord, yCoord + 1, zCoord);
+ }
+ return false;
+ }
- @Override
- public boolean canUpdate() {
- return true;
- }
+ @Override
+ public Block getBlockType() {
+ return mBlockType;
+ }
- private boolean checkForPlayers(World aWorld) {
- int x = 0, y = 0, z = 0;
- x = this.xCoord;
- y = this.yCoord;
- z = this.zCoord;
- EntityPlayer aPlayer = aWorld.getClosestPlayer(x, y, z, 3.5D);
- if (aPlayer != null) {
- return true;
- }
- return false;
- }
+ @Override
+ public boolean canUpdate() {
+ return true;
+ }
- private short getClosedMeta() {
- return 0;
- }
+ private boolean checkForPlayers(World aWorld) {
+ int x = 0, y = 0, z = 0;
+ x = this.xCoord;
+ y = this.yCoord;
+ z = this.zCoord;
+ EntityPlayer aPlayer = aWorld.getClosestPlayer(x, y, z, 3.5D);
+ if (aPlayer != null) {
+ return true;
+ }
+ return false;
+ }
- private short getOpenMeta() {
- return 1;
- }
+ private short getClosedMeta() {
+ return 0;
+ }
+ private short getOpenMeta() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
index 6e18834786..bfb56180d2 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
@@ -1,312 +1,298 @@
package gtPlusPlus.core.tileentities.general;
+import gtPlusPlus.core.block.ModBlocks;
import java.util.Random;
-
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
-import gtPlusPlus.core.block.ModBlocks;
-
-
-
-public class TileEntityReverter extends TileEntity
-{
- private static final int REVERT_CHANCE = 10;
- public int radius = 16;
- public int diameter = (8 * this.radius) + 4;
- public double requiredPlayerRange = 64.0D;
- public Random rand = new Random();
- private int tickCount;
- private boolean slowScan;
- private int ticksSinceChange;
- private Block[] blockData;
- private byte[] metaData;
+public class TileEntityReverter extends TileEntity {
+ private static final int REVERT_CHANCE = 10;
+ public int radius = 16;
+ public int diameter = (8 * this.radius) + 4;
+ public double requiredPlayerRange = 64.0D;
+ public Random rand = new Random();
+ private int tickCount;
+ private boolean slowScan;
+ private int ticksSinceChange;
+ private Block[] blockData;
+ private byte[] metaData;
- @Override
- public boolean canUpdate(){
- return true;
- }
+ @Override
+ public boolean canUpdate() {
+ return true;
+ }
- @Override
- public void updateEntity()
- {
- if (this.anyPlayerInRange())
- {
- this.tickCount += 1;
- if (this.worldObj.isRemote)
- {
- final double var1 = this.xCoord + this.worldObj.rand.nextFloat();
- final double var3 = this.yCoord + this.worldObj.rand.nextFloat();
- final double var5 = this.zCoord + this.worldObj.rand.nextFloat();
+ @Override
+ public void updateEntity() {
+ if (this.anyPlayerInRange()) {
+ this.tickCount += 1;
+ if (this.worldObj.isRemote) {
+ final double var1 = this.xCoord + this.worldObj.rand.nextFloat();
+ final double var3 = this.yCoord + this.worldObj.rand.nextFloat();
+ final double var5 = this.zCoord + this.worldObj.rand.nextFloat();
- this.worldObj.spawnParticle("enchantmenttable", var1, var3, var5, 0.0D, 0.0D, 0.0D);
- if (this.rand.nextInt(5) == 0)
- {
- this.makeRandomOutline();
- this.makeRandomOutline();
- this.makeRandomOutline();
- }
- }
- else
- {
- if ((this.blockData == null) || (this.metaData == null))
- {
- this.captureBlockData();
- this.slowScan = true;
- }
- if ((!this.slowScan) || ((this.tickCount % 20) == 0)) {
- if (this.scanAndRevertChanges())
- {
- this.slowScan = false;
- this.ticksSinceChange = 0;
- }
- else
- {
- this.ticksSinceChange += 1;
- if (this.ticksSinceChange > 20) {
- this.slowScan = true;
- }
- }
- }
- }
- }
- else
- {
- this.blockData = null;
- this.metaData = null;
+ this.worldObj.spawnParticle("enchantmenttable", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+ if (this.rand.nextInt(5) == 0) {
+ this.makeRandomOutline();
+ this.makeRandomOutline();
+ this.makeRandomOutline();
+ }
+ } else {
+ if ((this.blockData == null) || (this.metaData == null)) {
+ this.captureBlockData();
+ this.slowScan = true;
+ }
+ if ((!this.slowScan) || ((this.tickCount % 20) == 0)) {
+ if (this.scanAndRevertChanges()) {
+ this.slowScan = false;
+ this.ticksSinceChange = 0;
+ } else {
+ this.ticksSinceChange += 1;
+ if (this.ticksSinceChange > 20) {
+ this.slowScan = true;
+ }
+ }
+ }
+ }
+ } else {
+ this.blockData = null;
+ this.metaData = null;
- this.tickCount = 0;
- }
- }
+ this.tickCount = 0;
+ }
+ }
- private void makeRandomOutline()
- {
- this.makeOutline(this.rand.nextInt(12));
- }
+ private void makeRandomOutline() {
+ this.makeOutline(this.rand.nextInt(12));
+ }
- private void makeOutline(final int outline)
- {
- double sx = this.xCoord;
- double sy = this.yCoord;
- double sz = this.zCoord;
+ private void makeOutline(final int outline) {
+ double sx = this.xCoord;
+ double sy = this.yCoord;
+ double sz = this.zCoord;
- double dx = this.xCoord;
- double dy = this.yCoord;
- double dz = this.zCoord;
- switch (outline)
- {
- case 0:
- sx -= this.radius;
- dx -= this.radius;
- sz -= this.radius;
- dz += this.radius + 1;
- case 8:
- sx -= this.radius;
- dx += this.radius + 1;
- sz -= this.radius;
- dz -= this.radius;
- break;
- case 1:
- case 9:
- sx -= this.radius;
- dx -= this.radius;
- sz -= this.radius;
- dz += this.radius + 1;
- break;
- case 2:
- case 10:
- sx -= this.radius;
- dx += this.radius + 1;
- sz += this.radius + 1;
- dz += this.radius + 1;
- break;
- case 3:
- case 11:
- sx += this.radius + 1;
- dx += this.radius + 1;
- sz -= this.radius;
- dz += this.radius + 1;
- break;
- case 4:
- sx -= this.radius;
- dx -= this.radius;
- sz -= this.radius;
- dz -= this.radius;
- break;
- case 5:
- sx += this.radius + 1;
- dx += this.radius + 1;
- sz -= this.radius;
- dz -= this.radius;
- break;
- case 6:
- sx += this.radius + 1;
- dx += this.radius + 1;
- sz += this.radius + 1;
- dz += this.radius + 1;
- break;
- case 7:
- sx -= this.radius;
- dx -= this.radius;
- sz += this.radius + 1;
- dz += this.radius + 1;
- }
- switch (outline)
- {
- case 0:
- case 1:
- case 2:
- case 3:
- sy += this.radius + 1;
- dy += this.radius + 1;
- break;
- case 4:
- case 5:
- case 6:
- case 7:
- sy -= this.radius;
- dy += this.radius + 1;
- break;
- case 8:
- case 9:
- case 10:
- case 11:
- sy -= this.radius;
- dy -= this.radius;
- }
- if (this.rand.nextBoolean()) {
- this.drawParticleLine(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, dx, dy, dz);
- } else {
- this.drawParticleLine(sx, sy, sz, this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D);
- }
- this.drawParticleLine(sx, sy, sz, dx, dy, dz);
- }
+ double dx = this.xCoord;
+ double dy = this.yCoord;
+ double dz = this.zCoord;
+ switch (outline) {
+ case 0:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz -= this.radius;
+ dz += this.radius + 1;
+ case 8:
+ sx -= this.radius;
+ dx += this.radius + 1;
+ sz -= this.radius;
+ dz -= this.radius;
+ break;
+ case 1:
+ case 9:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz -= this.radius;
+ dz += this.radius + 1;
+ break;
+ case 2:
+ case 10:
+ sx -= this.radius;
+ dx += this.radius + 1;
+ sz += this.radius + 1;
+ dz += this.radius + 1;
+ break;
+ case 3:
+ case 11:
+ sx += this.radius + 1;
+ dx += this.radius + 1;
+ sz -= this.radius;
+ dz += this.radius + 1;
+ break;
+ case 4:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz -= this.radius;
+ dz -= this.radius;
+ break;
+ case 5:
+ sx += this.radius + 1;
+ dx += this.radius + 1;
+ sz -= this.radius;
+ dz -= this.radius;
+ break;
+ case 6:
+ sx += this.radius + 1;
+ dx += this.radius + 1;
+ sz += this.radius + 1;
+ dz += this.radius + 1;
+ break;
+ case 7:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz += this.radius + 1;
+ dz += this.radius + 1;
+ }
+ switch (outline) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ sy += this.radius + 1;
+ dy += this.radius + 1;
+ break;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ sy -= this.radius;
+ dy += this.radius + 1;
+ break;
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ sy -= this.radius;
+ dy -= this.radius;
+ }
+ if (this.rand.nextBoolean()) {
+ this.drawParticleLine(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, dx, dy, dz);
+ } else {
+ this.drawParticleLine(sx, sy, sz, this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D);
+ }
+ this.drawParticleLine(sx, sy, sz, dx, dy, dz);
+ }
- protected void drawParticleLine(final double srcX, final double srcY, final double srcZ, final double destX, final double destY, final double destZ)
- {
- final int particles = 16;
- for (int i = 0; i < particles; i++)
- {
- final double trailFactor = i / (particles - 1.0D);
+ protected void drawParticleLine(
+ final double srcX,
+ final double srcY,
+ final double srcZ,
+ final double destX,
+ final double destY,
+ final double destZ) {
+ final int particles = 16;
+ for (int i = 0; i < particles; i++) {
+ final double trailFactor = i / (particles - 1.0D);
- final double tx = srcX + ((destX - srcX) * trailFactor) + (this.rand.nextFloat() * 0.005D);
- final double ty = srcY + ((destY - srcY) * trailFactor) + (this.rand.nextFloat() * 0.005D);
- final double tz = srcZ + ((destZ - srcZ) * trailFactor) + (this.rand.nextFloat() * 0.005D);
- this.worldObj.spawnParticle("portal", tx, ty, tz, 0.0D, 0.0D, 0.0D);
- }
- }
+ final double tx = srcX + ((destX - srcX) * trailFactor) + (this.rand.nextFloat() * 0.005D);
+ final double ty = srcY + ((destY - srcY) * trailFactor) + (this.rand.nextFloat() * 0.005D);
+ final double tz = srcZ + ((destZ - srcZ) * trailFactor) + (this.rand.nextFloat() * 0.005D);
+ this.worldObj.spawnParticle("portal", tx, ty, tz, 0.0D, 0.0D, 0.0D);
+ }
+ }
- private boolean scanAndRevertChanges()
- {
- int index = 0;
- boolean reverted = false;
- for (int x = -this.radius; x <= this.radius; x++) {
- for (int y = -this.radius; y <= this.radius; y++) {
- for (int z = -this.radius; z <= this.radius; z++)
- {
- final Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
- final byte meta = (byte)this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
- if (this.blockData[index] != blockID) {
- if (this.revertBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z, blockID, meta, this.blockData[index], this.metaData[index]))
- {
- reverted = true;
- }
- else
- {
- this.blockData[index] = blockID;
- this.metaData[index] = meta;
- }
- }
- index++;
- }
- }
- }
- return reverted;
- }
+ private boolean scanAndRevertChanges() {
+ int index = 0;
+ boolean reverted = false;
+ for (int x = -this.radius; x <= this.radius; x++) {
+ for (int y = -this.radius; y <= this.radius; y++) {
+ for (int z = -this.radius; z <= this.radius; z++) {
+ final Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ final byte meta =
+ (byte) this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ if (this.blockData[index] != blockID) {
+ if (this.revertBlock(
+ this.xCoord + x,
+ this.yCoord + y,
+ this.zCoord + z,
+ blockID,
+ meta,
+ this.blockData[index],
+ this.metaData[index])) {
+ reverted = true;
+ } else {
+ this.blockData[index] = blockID;
+ this.metaData[index] = meta;
+ }
+ }
+ index++;
+ }
+ }
+ }
+ return reverted;
+ }
- private boolean revertBlock(final int x, final int y, final int z, final Block thereBlockID, final byte thereMeta, final Block replaceBlockID, byte replaceMeta)
- {
- /*if ((thereBlockID == Blocks.air) && (!replaceBlockID.getMaterial().blocksMovement()))
- {
- System.out.println("Not replacing block " + replaceBlockID + " because it doesn't block movement");
+ private boolean revertBlock(
+ final int x,
+ final int y,
+ final int z,
+ final Block thereBlockID,
+ final byte thereMeta,
+ final Block replaceBlockID,
+ byte replaceMeta) {
+ /*if ((thereBlockID == Blocks.air) && (!replaceBlockID.getMaterial().blocksMovement()))
+ {
+ System.out.println("Not replacing block " + replaceBlockID + " because it doesn't block movement");
- return false;
- }*/
- if (this.isUnrevertable(thereBlockID, thereMeta, replaceBlockID, replaceMeta)) {
- return false;
- }
- if (this.rand.nextInt(5) == 0)
- {
- if (replaceBlockID != Blocks.air)
- {
- //replaceBlockID = null;
- replaceMeta = 4;
- }
- this.worldObj.setBlock(x, y, z, replaceBlockID, replaceMeta, 2);
- if (thereBlockID == Blocks.air)
- {
- this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(replaceBlockID) + (replaceMeta << 12));
- }
- else if (replaceBlockID == Blocks.air)
- {
- this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(thereBlockID) + (thereMeta << 12));
- thereBlockID.dropBlockAsItem(this.worldObj, x, y, z, thereMeta, 0);
- }
- }
- return true;
- }
+ return false;
+ }*/
+ if (this.isUnrevertable(thereBlockID, thereMeta, replaceBlockID, replaceMeta)) {
+ return false;
+ }
+ if (this.rand.nextInt(5) == 0) {
+ if (replaceBlockID != Blocks.air) {
+ // replaceBlockID = null;
+ replaceMeta = 4;
+ }
+ this.worldObj.setBlock(x, y, z, replaceBlockID, replaceMeta, 2);
+ if (thereBlockID == Blocks.air) {
+ this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(replaceBlockID) + (replaceMeta << 12));
+ } else if (replaceBlockID == Blocks.air) {
+ this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(thereBlockID) + (thereMeta << 12));
+ thereBlockID.dropBlockAsItem(this.worldObj, x, y, z, thereMeta, 0);
+ }
+ }
+ return true;
+ }
- private boolean isUnrevertable(final Block thereBlockID, final byte thereMeta, final Block replaceBlockID, final byte replaceMeta)
- {
- if ((thereBlockID == ModBlocks.blockGriefSaver) || (replaceBlockID == ModBlocks.blockGriefSaver)) {
- return true;
- }
- /*if (((thereBlockID == towerTranslucent) && (thereMeta != 4)) || ((replaceBlockID == towerTranslucent) && (replaceMeta != 4))) {
- return true;
- }*/
- if ((thereBlockID == Blocks.redstone_lamp) && (replaceBlockID == Blocks.lit_redstone_lamp)) {
- return true;
- }
- if ((thereBlockID == Blocks.lit_redstone_lamp) && (replaceBlockID == Blocks.redstone_lamp)) {
- return true;
- }
- /*if ((thereBlockID == Blocks.water) || (replaceBlockID == Blocks.flowing_water)) {
- return true;
- }
- if ((thereBlockID == Blocks.flowing_water) || (replaceBlockID == Blocks.water)) {
- return true;
- }*/
- if (replaceBlockID == Blocks.tnt) {
- return true;
- }
- return false;
- }
+ private boolean isUnrevertable(
+ final Block thereBlockID, final byte thereMeta, final Block replaceBlockID, final byte replaceMeta) {
+ if ((thereBlockID == ModBlocks.blockGriefSaver) || (replaceBlockID == ModBlocks.blockGriefSaver)) {
+ return true;
+ }
+ /*if (((thereBlockID == towerTranslucent) && (thereMeta != 4)) || ((replaceBlockID == towerTranslucent) && (replaceMeta != 4))) {
+ return true;
+ }*/
+ if ((thereBlockID == Blocks.redstone_lamp) && (replaceBlockID == Blocks.lit_redstone_lamp)) {
+ return true;
+ }
+ if ((thereBlockID == Blocks.lit_redstone_lamp) && (replaceBlockID == Blocks.redstone_lamp)) {
+ return true;
+ }
+ /*if ((thereBlockID == Blocks.water) || (replaceBlockID == Blocks.flowing_water)) {
+ return true;
+ }
+ if ((thereBlockID == Blocks.flowing_water) || (replaceBlockID == Blocks.water)) {
+ return true;
+ }*/
+ if (replaceBlockID == Blocks.tnt) {
+ return true;
+ }
+ return false;
+ }
- private void captureBlockData()
- {
- this.blockData = new Block[this.diameter * this.diameter * this.diameter];
- this.metaData = new byte[this.diameter * this.diameter * this.diameter];
+ private void captureBlockData() {
+ this.blockData = new Block[this.diameter * this.diameter * this.diameter];
+ this.metaData = new byte[this.diameter * this.diameter * this.diameter];
- int index = 0;
- for (int x = -this.radius; x <= this.radius; x++) {
- for (int y = -this.radius; y <= this.radius; y++) {
- for (int z = -this.radius; z <= this.radius; z++)
- {
- final Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
- final int meta = this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ int index = 0;
+ for (int x = -this.radius; x <= this.radius; x++) {
+ for (int y = -this.radius; y <= this.radius; y++) {
+ for (int z = -this.radius; z <= this.radius; z++) {
+ final Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ final int meta = this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
- this.blockData[index] = blockID;
- this.metaData[index] = ((byte)meta);
+ this.blockData[index] = blockID;
+ this.metaData[index] = ((byte) meta);
- index++;
- }
- }
- }
- }
+ index++;
+ }
+ }
+ }
+ }
- public boolean anyPlayerInRange()
- {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, this.requiredPlayerRange) != null;
- }
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(
+ this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, this.requiredPlayerRange)
+ != null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java
index bc096c0d53..f063abb53c 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java
@@ -19,389 +19,383 @@ import net.minecraftforge.fluids.FluidStack;
public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISidedInventory {
- private int tickCount = 0;
- private final Inventory_VolumetricFlaskSetter inventoryContents;
- private String customName;
- public int locationX;
- public int locationY;
- public int locationZ;
- private int aCurrentMode = 0;
- private int aCustomValue = 1000;
-
- public TileEntityVolumetricFlaskSetter() {
- this.inventoryContents = new Inventory_VolumetricFlaskSetter();
- this.setTileLocation();
- }
-
- public int getCustomValue() {
- //Logger.INFO("Value: "+this.aCustomValue);
- return this.aCustomValue;
- }
-
- public void setCustomValue(int aVal) {
- log("Old Value: "+this.aCustomValue);
- this.aCustomValue = (short) MathUtils.balance(aVal, 0, Short.MAX_VALUE);
- log("New Value: "+this.aCustomValue);
- markDirty();
- }
-
- public boolean setTileLocation() {
- if (this.hasWorldObj()) {
- if (!this.getWorldObj().isRemote) {
- this.locationX = this.xCoord;
- this.locationY = this.yCoord;
- this.locationZ = this.zCoord;
- return true;
- }
- }
- return false;
- }
-
- //Rename to hasCircuitToConfigure
- public final boolean hasFlask() {
- for (int i=0;i<this.getInventory().getInventory().length-1;i++) {
- if (i == Container_VolumetricFlaskSetter.SLOT_OUTPUT) {
- continue;
- }
- if (this.getInventory().getInventory()[i] != null) {
- return true;
- }
- }
- return false;
- }
-
- public Inventory_VolumetricFlaskSetter getInventory() {
- return this.inventoryContents;
- }
-
- private int getFlaskType(ItemStack aStack) {
- if (VolumetricFlaskHelper.isNormalVolumetricFlask(aStack)) {
- return 1;
- }
- else if (VolumetricFlaskHelper.isLargeVolumetricFlask(aStack)) {
- return 2;
- }
- else if (VolumetricFlaskHelper.isGiganticVolumetricFlask(aStack)) {
- return 3;
- }
- return 0;
- }
-
- private int getCapacityForSlot(int aSlot) {
- switch (aSlot) {
- case 0: //16
- return 16;
- case 1: //36
- return 36;
- case 2: //144
- return 144;
- case 3: //432
- return 432;
- case 4: //576
- return 576;
- case 5: //720
- return 720;
- case 6: //864
- return 864;
- case 7: //Custom
- return getCustomValue();
- }
- return 1000;
- }
-
- public boolean addOutput() {
-
- // Don't do anything unless we have items
- if (!hasFlask()) {
- Logger.INFO("No Flasks.");
- return false;
- }
-
-
- ItemStack[] aInputs = this.getInventory().getInventory().clone();
-
-
- //Check if there is output in slot.
- Boolean hasOutput = false;
- if (aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT] != null) {
- hasOutput = true;
- if (aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT].stackSize >= 16) {
- return false;
- }
- }
- AutoMap<Integer> aValidSlots = new AutoMap<Integer>();
- int aSlotCount = 0;
- for (ItemStack i : aInputs) {
- if (i != null) {
- aValidSlots.put(aSlotCount);
- }
- aSlotCount++;
- }
- for (int e : aValidSlots) {
-
- // Skip slot 7 (Custom) unless it has a value > 0
- if (e == 7 && getCustomValue() <= 0) {
- log("Skipping Custom slot as value <= 0");
- continue;
- }
- if (e == Container_VolumetricFlaskSetter.SLOT_OUTPUT) {
- continue;
- }
-
- boolean doAdd = false;
- ItemStack g = this.getStackInSlot(e);
- FluidStack aInputFluidStack = VolumetricFlaskHelper.getFlaskFluid(g);
- int aSize = 0;
- ItemStack aInputStack = null;
- int aTypeInSlot = getFlaskType(g);
- if (aTypeInSlot > 0 && g != null) {
- // No Existing Output
- if (!hasOutput) {
- aSize = g.stackSize;
- doAdd = true;
- }
- // Existing Output
- else {
- ItemStack f = aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT];
- FluidStack aFluidInCheckedSlot = VolumetricFlaskHelper.getFlaskFluid(f);
- int aTypeInCheckedSlot = getFlaskType(f);
- // Check that the Circuit in the Output slot is not null and the same type as the circuit input.
- if (aTypeInCheckedSlot > 0 && (aTypeInSlot == aTypeInCheckedSlot) && f != null) {
- if (g.getItem() == f.getItem() && VolumetricFlaskHelper.getFlaskCapacity(f) == getCapacityForSlot(e) && ((aInputFluidStack == null && aFluidInCheckedSlot == null) || aInputFluidStack.isFluidEqual(aFluidInCheckedSlot))) {
- log("Input Slot Flask Contains: "+(aInputFluidStack != null ? aInputFluidStack.getLocalizedName() : "Empty"));
- log("Output Slot Flask Contains: "+(aFluidInCheckedSlot != null ? aFluidInCheckedSlot.getLocalizedName() : "Empty"));
- aSize = f.stackSize + g.stackSize;
- if (aSize > 16) {
- aInputStack = g.copy();
- aInputStack.stackSize = (aSize-16);
- }
- doAdd = true;
- }
- }
- }
- if (doAdd) {
- // Check Circuit Type
- ItemStack aOutput;
- FluidStack aOutputFluid = null;
- if (!VolumetricFlaskHelper.isFlaskEmpty(g)) {
- aOutputFluid = aInputFluidStack.copy();
- }
- if (aTypeInSlot == 1) {
- aOutput = VolumetricFlaskHelper.getVolumetricFlask(1);
- }
- else if (aTypeInSlot == 2) {
- aOutput = VolumetricFlaskHelper.getLargeVolumetricFlask(1);
- }
- else if (aTypeInSlot == 3) {
- aOutput = VolumetricFlaskHelper.getGiganticVolumetricFlask(1);
- }
- else {
- aOutput = null;
- }
- if (aOutput != null) {
- aOutput.stackSize = aSize;
- int aCapacity = getCapacityForSlot(e);
- VolumetricFlaskHelper.setNewFlaskCapacity(aOutput, aCapacity);
- if (aOutputFluid != null) {
- if (aOutputFluid.amount > aCapacity) {
- aOutputFluid.amount = aCapacity;
- }
- VolumetricFlaskHelper.setFluid(aOutput, aOutputFluid);
- }
- this.setInventorySlotContents(e, aInputStack);
- this.setInventorySlotContents(Container_VolumetricFlaskSetter.SLOT_OUTPUT, aOutput);
- return true;
- }
- }
- }
- continue;
- }
- return false;
- }
-
- @Override
- public void updateEntity() {
- try{
- if (!this.worldObj.isRemote) {
- if (tickCount % 10 == 0) {
- if (hasFlask()) {
- this.addOutput();
- this.markDirty();
- }
- }
- this.tickCount++;
- }
- }
- catch (final Throwable t){}
- }
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- // Utils.LOG_WARNING("Trying to write NBT data to TE.");
- final NBTTagCompound chestData = new NBTTagCompound();
- this.inventoryContents.writeToNBT(chestData);
- nbt.setTag("ContentsChest", chestData);
- nbt.setInteger("aCustomValue", aCustomValue);
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- nbt.setInteger("aCurrentMode", aCurrentMode);
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- // Utils.LOG_WARNING("Trying to read NBT data from TE.");
- this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- this.aCustomValue = nbt.getInteger("aCustomValue");
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- aCurrentMode = nbt.getInteger("aCurrentMode");
- }
-
- @Override
- public int getSizeInventory() {
- return this.getInventory().getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.getInventory().getStackInSlot(slot);
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int count) {
- return this.getInventory().decrStackSize(slot, count);
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- return this.getInventory().getStackInSlotOnClosing(slot);
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.getInventory().setInventorySlotContents(slot, stack);
- }
-
- @Override
- public int getInventoryStackLimit() {
- return this.getInventory().getInventoryStackLimit();
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return this.getInventory().isUseableByPlayer(entityplayer);
- }
-
- @Override
- public void openInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().openInventory();
- }
-
- @Override
- public void closeInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().closeInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return this.getInventory().isItemValidForSlot(slot, itemstack);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- final int[] accessibleSides = new int[this.getSizeInventory()];
- for (int r=0; r<this.getInventory().getSizeInventory(); r++){
- accessibleSides[r]=r;
- }
- return accessibleSides;
-
- }
-
- @Override
- public boolean canInsertItem(final int aSlot, final ItemStack p_102007_2_, final int p_102007_3_) {
- return aSlot == aCurrentMode;
- }
-
- @Override
- public boolean canExtractItem(final int aSlot, final ItemStack p_102008_2_, final int p_102008_3_) {
- return aSlot == Container_VolumetricFlaskSetter.SLOT_OUTPUT;
- }
-
- public String getCustomName() {
- return this.customName;
- }
-
- public void setCustomName(final String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.VolumetricFlaskSetter";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
- }
-
- @Override
- public Packet getDescriptionPacket() {
- final NBTTagCompound tag = new NBTTagCompound();
- this.writeToNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
- }
-
- @Override
- public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
- final NBTTagCompound tag = pkt.func_148857_g();
- this.readFromNBT(tag);
- }
-
- public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) {
-
- if (player.isSneaking()) {
- PlayerUtils.messagePlayer(player, "Value: "+this.getCustomValue());
- }
-
- try {
- if (aCurrentMode == 7) {
- aCurrentMode = 0;
- }
- else {
- aCurrentMode++;
- }
- PlayerUtils.messagePlayer(player, "Slot "+aCurrentMode+" is now default.");
- return true;
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- public void log(String aString) {
- Logger.INFO("[Flask-Tile] "+aString);
- }
-
+ private int tickCount = 0;
+ private final Inventory_VolumetricFlaskSetter inventoryContents;
+ private String customName;
+ public int locationX;
+ public int locationY;
+ public int locationZ;
+ private int aCurrentMode = 0;
+ private int aCustomValue = 1000;
+
+ public TileEntityVolumetricFlaskSetter() {
+ this.inventoryContents = new Inventory_VolumetricFlaskSetter();
+ this.setTileLocation();
+ }
+
+ public int getCustomValue() {
+ // Logger.INFO("Value: "+this.aCustomValue);
+ return this.aCustomValue;
+ }
+
+ public void setCustomValue(int aVal) {
+ log("Old Value: " + this.aCustomValue);
+ this.aCustomValue = (short) MathUtils.balance(aVal, 0, Short.MAX_VALUE);
+ log("New Value: " + this.aCustomValue);
+ markDirty();
+ }
+
+ public boolean setTileLocation() {
+ if (this.hasWorldObj()) {
+ if (!this.getWorldObj().isRemote) {
+ this.locationX = this.xCoord;
+ this.locationY = this.yCoord;
+ this.locationZ = this.zCoord;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // Rename to hasCircuitToConfigure
+ public final boolean hasFlask() {
+ for (int i = 0; i < this.getInventory().getInventory().length - 1; i++) {
+ if (i == Container_VolumetricFlaskSetter.SLOT_OUTPUT) {
+ continue;
+ }
+ if (this.getInventory().getInventory()[i] != null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public Inventory_VolumetricFlaskSetter getInventory() {
+ return this.inventoryContents;
+ }
+
+ private int getFlaskType(ItemStack aStack) {
+ if (VolumetricFlaskHelper.isNormalVolumetricFlask(aStack)) {
+ return 1;
+ } else if (VolumetricFlaskHelper.isLargeVolumetricFlask(aStack)) {
+ return 2;
+ } else if (VolumetricFlaskHelper.isGiganticVolumetricFlask(aStack)) {
+ return 3;
+ }
+ return 0;
+ }
+
+ private int getCapacityForSlot(int aSlot) {
+ switch (aSlot) {
+ case 0: // 16
+ return 16;
+ case 1: // 36
+ return 36;
+ case 2: // 144
+ return 144;
+ case 3: // 432
+ return 432;
+ case 4: // 576
+ return 576;
+ case 5: // 720
+ return 720;
+ case 6: // 864
+ return 864;
+ case 7: // Custom
+ return getCustomValue();
+ }
+ return 1000;
+ }
+
+ public boolean addOutput() {
+
+ // Don't do anything unless we have items
+ if (!hasFlask()) {
+ Logger.INFO("No Flasks.");
+ return false;
+ }
+
+ ItemStack[] aInputs = this.getInventory().getInventory().clone();
+
+ // Check if there is output in slot.
+ Boolean hasOutput = false;
+ if (aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT] != null) {
+ hasOutput = true;
+ if (aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT].stackSize >= 16) {
+ return false;
+ }
+ }
+ AutoMap<Integer> aValidSlots = new AutoMap<Integer>();
+ int aSlotCount = 0;
+ for (ItemStack i : aInputs) {
+ if (i != null) {
+ aValidSlots.put(aSlotCount);
+ }
+ aSlotCount++;
+ }
+ for (int e : aValidSlots) {
+
+ // Skip slot 7 (Custom) unless it has a value > 0
+ if (e == 7 && getCustomValue() <= 0) {
+ log("Skipping Custom slot as value <= 0");
+ continue;
+ }
+ if (e == Container_VolumetricFlaskSetter.SLOT_OUTPUT) {
+ continue;
+ }
+
+ boolean doAdd = false;
+ ItemStack g = this.getStackInSlot(e);
+ FluidStack aInputFluidStack = VolumetricFlaskHelper.getFlaskFluid(g);
+ int aSize = 0;
+ ItemStack aInputStack = null;
+ int aTypeInSlot = getFlaskType(g);
+ if (aTypeInSlot > 0 && g != null) {
+ // No Existing Output
+ if (!hasOutput) {
+ aSize = g.stackSize;
+ doAdd = true;
+ }
+ // Existing Output
+ else {
+ ItemStack f = aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT];
+ FluidStack aFluidInCheckedSlot = VolumetricFlaskHelper.getFlaskFluid(f);
+ int aTypeInCheckedSlot = getFlaskType(f);
+ // Check that the Circuit in the Output slot is not null and the same type as the circuit input.
+ if (aTypeInCheckedSlot > 0 && (aTypeInSlot == aTypeInCheckedSlot) && f != null) {
+ if (g.getItem() == f.getItem()
+ && VolumetricFlaskHelper.getFlaskCapacity(f) == getCapacityForSlot(e)
+ && ((aInputFluidStack == null && aFluidInCheckedSlot == null)
+ || aInputFluidStack.isFluidEqual(aFluidInCheckedSlot))) {
+ log("Input Slot Flask Contains: "
+ + (aInputFluidStack != null ? aInputFluidStack.getLocalizedName() : "Empty"));
+ log("Output Slot Flask Contains: "
+ + (aFluidInCheckedSlot != null ? aFluidInCheckedSlot.getLocalizedName() : "Empty"));
+ aSize = f.stackSize + g.stackSize;
+ if (aSize > 16) {
+ aInputStack = g.copy();
+ aInputStack.stackSize = (aSize - 16);
+ }
+ doAdd = true;
+ }
+ }
+ }
+ if (doAdd) {
+ // Check Circuit Type
+ ItemStack aOutput;
+ FluidStack aOutputFluid = null;
+ if (!VolumetricFlaskHelper.isFlaskEmpty(g)) {
+ aOutputFluid = aInputFluidStack.copy();
+ }
+ if (aTypeInSlot == 1) {
+ aOutput = VolumetricFlaskHelper.getVolumetricFlask(1);
+ } else if (aTypeInSlot == 2) {
+ aOutput = VolumetricFlaskHelper.getLargeVolumetricFlask(1);
+ } else if (aTypeInSlot == 3) {
+ aOutput = VolumetricFlaskHelper.getGiganticVolumetricFlask(1);
+ } else {
+ aOutput = null;
+ }
+ if (aOutput != null) {
+ aOutput.stackSize = aSize;
+ int aCapacity = getCapacityForSlot(e);
+ VolumetricFlaskHelper.setNewFlaskCapacity(aOutput, aCapacity);
+ if (aOutputFluid != null) {
+ if (aOutputFluid.amount > aCapacity) {
+ aOutputFluid.amount = aCapacity;
+ }
+ VolumetricFlaskHelper.setFluid(aOutput, aOutputFluid);
+ }
+ this.setInventorySlotContents(e, aInputStack);
+ this.setInventorySlotContents(Container_VolumetricFlaskSetter.SLOT_OUTPUT, aOutput);
+ return true;
+ }
+ }
+ }
+ continue;
+ }
+ return false;
+ }
+
+ @Override
+ public void updateEntity() {
+ try {
+ if (!this.worldObj.isRemote) {
+ if (tickCount % 10 == 0) {
+ if (hasFlask()) {
+ this.addOutput();
+ this.markDirty();
+ }
+ }
+ this.tickCount++;
+ }
+ } catch (final Throwable t) {
+ }
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ // Utils.LOG_WARNING("Trying to write NBT data to TE.");
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.inventoryContents.writeToNBT(chestData);
+ nbt.setTag("ContentsChest", chestData);
+ nbt.setInteger("aCustomValue", aCustomValue);
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ nbt.setInteger("aCurrentMode", aCurrentMode);
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ // Utils.LOG_WARNING("Trying to read NBT data from TE.");
+ this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ this.aCustomValue = nbt.getInteger("aCustomValue");
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+ aCurrentMode = nbt.getInteger("aCurrentMode");
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.getInventory().getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.getInventory().getStackInSlot(slot);
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int count) {
+ return this.getInventory().decrStackSize(slot, count);
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ return this.getInventory().getStackInSlotOnClosing(slot);
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.getInventory().setInventorySlotContents(slot, stack);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return this.getInventory().getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return this.getInventory().isUseableByPlayer(entityplayer);
+ }
+
+ @Override
+ public void openInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().closeInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return this.getInventory().isItemValidForSlot(slot, itemstack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ final int[] accessibleSides = new int[this.getSizeInventory()];
+ for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
+ accessibleSides[r] = r;
+ }
+ return accessibleSides;
+ }
+
+ @Override
+ public boolean canInsertItem(final int aSlot, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return aSlot == aCurrentMode;
+ }
+
+ @Override
+ public boolean canExtractItem(final int aSlot, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return aSlot == Container_VolumetricFlaskSetter.SLOT_OUTPUT;
+ }
+
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ public void setCustomName(final String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.VolumetricFlaskSetter";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.customName != null) && !this.customName.equals("");
+ }
+
+ @Override
+ public Packet getDescriptionPacket() {
+ final NBTTagCompound tag = new NBTTagCompound();
+ this.writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
+ }
+
+ @Override
+ public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
+ final NBTTagCompound tag = pkt.func_148857_g();
+ this.readFromNBT(tag);
+ }
+
+ public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) {
+
+ if (player.isSneaking()) {
+ PlayerUtils.messagePlayer(player, "Value: " + this.getCustomValue());
+ }
+
+ try {
+ if (aCurrentMode == 7) {
+ aCurrentMode = 0;
+ } else {
+ aCurrentMode++;
+ }
+ PlayerUtils.messagePlayer(player, "Slot " + aCurrentMode + " is now default.");
+ return true;
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ public void log(String aString) {
+ Logger.INFO("[Flask-Tile] " + aString);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java
index 2816596515..8b72ca911f 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java
@@ -1,298 +1,296 @@
package gtPlusPlus.core.tileentities.general;
-import org.lwjgl.input.Keyboard;
-
+import gtPlusPlus.api.objects.minecraft.BTF_FluidTank;
+import gtPlusPlus.core.tileentities.base.TileBasicTank;
+import gtPlusPlus.core.util.minecraft.EnchantingUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
-import gtPlusPlus.api.objects.minecraft.BTF_FluidTank;
-import gtPlusPlus.core.tileentities.base.TileBasicTank;
-import gtPlusPlus.core.util.minecraft.EnchantingUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.*;
+import org.lwjgl.input.Keyboard;
public class TileEntityXpConverter extends TileBasicTank {
- public BTF_FluidTank tankEssence = new BTF_FluidTank((int) (64000*EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP));
- public BTF_FluidTank tankLiquidXp = new BTF_FluidTank(64000);
- private boolean mConvertToEssence = true;
-
- public TileEntityXpConverter() {
- super (4, 32000);
- }
-
- private void changeMode(){
- if (this.mConvertToEssence){
- this.mConvertToEssence = false;
- return;
- }
- else {
- this.mConvertToEssence = true;
- return;
- }
- }
+ public BTF_FluidTank tankEssence =
+ new BTF_FluidTank((int) (64000 * EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP));
+ public BTF_FluidTank tankLiquidXp = new BTF_FluidTank(64000);
+ private boolean mConvertToEssence = true;
- public float getAdjustedVolume() {
- if (this.mConvertToEssence){
- if ((this.tankLiquidXp.getFluid() != null) && (this.tankLiquidXp.getFluidAmount() >= 100) && (this.tankEssence.getFluidAmount() <= (this.tankEssence.getCapacity()-(100*EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP)))){
- final FluidStack bigStorage = EnchantingUtils.getEssenceFromLiquidXp(100);
- this.tankEssence.fill(bigStorage, true);
- this.tankLiquidXp.drain(100, true);
- return (this.tankEssence.getCapacity()-this.tankEssence.getFluidAmount());
- }
- }
- else {
- final double rm = EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP;
- if ((this.tankEssence.getFluid() != null) && (this.tankEssence.getFluidAmount() >= rm) && (this.tankLiquidXp.getFluidAmount() <= (this.tankLiquidXp.getCapacity()-rm))){
- final FluidStack bigStorage = EnchantingUtils.getLiquidXP(1);
- this.tankLiquidXp.fill(bigStorage, true);
- this.tankEssence.drain((int) rm, true);
- return (this.tankLiquidXp.getCapacity()-this.tankLiquidXp.getFluidAmount());
- }
- }
- return 0f;
- }
+ public TileEntityXpConverter() {
+ super(4, 32000);
+ }
- @Override
- public void readFromNBT(final NBTTagCompound tag) {
- this.tankEssence.readFromNBT(tag);
- this.tankLiquidXp.readFromNBT(tag);
- this.mConvertToEssence = tag.getBoolean("mConvertToEssence");
- super.readFromNBT(tag);
- }
+ private void changeMode() {
+ if (this.mConvertToEssence) {
+ this.mConvertToEssence = false;
+ return;
+ } else {
+ this.mConvertToEssence = true;
+ return;
+ }
+ }
- @Override
- public void writeToNBT(final NBTTagCompound tag) {
- this.tankEssence.writeToNBT(tag);
- this.tankLiquidXp.writeToNBT(tag);
- tag.setBoolean("mConvertToEssence", this.mConvertToEssence);
- super.writeToNBT(tag);
- }
+ public float getAdjustedVolume() {
+ if (this.mConvertToEssence) {
+ if ((this.tankLiquidXp.getFluid() != null)
+ && (this.tankLiquidXp.getFluidAmount() >= 100)
+ && (this.tankEssence.getFluidAmount()
+ <= (this.tankEssence.getCapacity()
+ - (100 * EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP)))) {
+ final FluidStack bigStorage = EnchantingUtils.getEssenceFromLiquidXp(100);
+ this.tankEssence.fill(bigStorage, true);
+ this.tankLiquidXp.drain(100, true);
+ return (this.tankEssence.getCapacity() - this.tankEssence.getFluidAmount());
+ }
+ } else {
+ final double rm = EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP;
+ if ((this.tankEssence.getFluid() != null)
+ && (this.tankEssence.getFluidAmount() >= rm)
+ && (this.tankLiquidXp.getFluidAmount() <= (this.tankLiquidXp.getCapacity() - rm))) {
+ final FluidStack bigStorage = EnchantingUtils.getLiquidXP(1);
+ this.tankLiquidXp.fill(bigStorage, true);
+ this.tankEssence.drain((int) rm, true);
+ return (this.tankLiquidXp.getCapacity() - this.tankLiquidXp.getFluidAmount());
+ }
+ }
+ return 0f;
+ }
- @Override
- public Packet getDescriptionPacket() {
- final NBTTagCompound tag = new NBTTagCompound();
- this.writeToNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
- }
+ @Override
+ public void readFromNBT(final NBTTagCompound tag) {
+ this.tankEssence.readFromNBT(tag);
+ this.tankLiquidXp.readFromNBT(tag);
+ this.mConvertToEssence = tag.getBoolean("mConvertToEssence");
+ super.readFromNBT(tag);
+ }
- @Override
- public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
- final NBTTagCompound tag = pkt.func_148857_g();
- this.readFromNBT(tag);
- }
+ @Override
+ public void writeToNBT(final NBTTagCompound tag) {
+ this.tankEssence.writeToNBT(tag);
+ this.tankLiquidXp.writeToNBT(tag);
+ tag.setBoolean("mConvertToEssence", this.mConvertToEssence);
+ super.writeToNBT(tag);
+ }
- public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ) {
- if (this.isServerSide()){
- if (this.mConvertToEssence){
- PlayerUtils.messagePlayer(aPlayer, "Converting from Mob Essence to Liquid Xp.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Converting from Liquid Xp to Mob Essence.");
- }
- //Mode Change
- this.changeMode();
- }
- }
+ @Override
+ public Packet getDescriptionPacket() {
+ final NBTTagCompound tag = new NBTTagCompound();
+ this.writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
+ }
- public void onRightClick(final byte aSide, final EntityPlayer aPlayer, final int aX, final int aY, final int aZ) {
- if ((Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54))) {
- String mInput;
- String mOutput;
+ @Override
+ public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
+ final NBTTagCompound tag = pkt.func_148857_g();
+ this.readFromNBT(tag);
+ }
- if (this.mConvertToEssence){
- mInput = "Liquid Xp";
- mOutput = "Mob Essence";
- }
- else {
- mInput = "Mob Essence";
- mOutput = "Liquid Xp";
- }
+ public void onScrewdriverRightClick(
+ final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ) {
+ if (this.isServerSide()) {
+ if (this.mConvertToEssence) {
+ PlayerUtils.messagePlayer(aPlayer, "Converting from Mob Essence to Liquid Xp.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Converting from Liquid Xp to Mob Essence.");
+ }
+ // Mode Change
+ this.changeMode();
+ }
+ }
- PlayerUtils.messagePlayer(aPlayer, "Input: "+mInput+".");
- PlayerUtils.messagePlayer(aPlayer, "Output: "+mOutput+".");
- }
- }
+ public void onRightClick(final byte aSide, final EntityPlayer aPlayer, final int aX, final int aY, final int aZ) {
+ if ((Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54))) {
+ String mInput;
+ String mOutput;
- @Override
- public boolean onPreTick(long aTick) {
- boolean aSuperResult = super.onPreTick(aTick);
- long aTankSpaceLeft = 0;
- double aAmount = 0;
- int aRuns = 0;
- if (this.mConvertToEssence) {
- aTankSpaceLeft = (this.tankEssence.getCapacity()-this.tankEssence.getFluidAmount());
- aAmount = EnchantingUtils.getEssenceFromLiquidXp(100).amount;
- }
- else {
- aTankSpaceLeft = (this.tankLiquidXp.getCapacity()-this.tankLiquidXp.getFluidAmount());
- aAmount = EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP;
- }
- aRuns = (int) (aTankSpaceLeft / aAmount);
- for (int i=0;i<aRuns;i++) {
- if (getAdjustedVolume() == 0) {
- break;
- }
- }
- return aSuperResult;
- }
+ if (this.mConvertToEssence) {
+ mInput = "Liquid Xp";
+ mOutput = "Mob Essence";
+ } else {
+ mInput = "Mob Essence";
+ mOutput = "Liquid Xp";
+ }
- @Override
- public boolean isLiquidInput(byte aSide) {
- if (mConvertToEssence) {
- if (aSide == 0 || aSide == 1) {
- return false;
- }
- } else {
- if (aSide == 0 || aSide == 1) {
- return true;
- }
- }
- return false;
- }
+ PlayerUtils.messagePlayer(aPlayer, "Input: " + mInput + ".");
+ PlayerUtils.messagePlayer(aPlayer, "Output: " + mOutput + ".");
+ }
+ }
- @Override
- public boolean isLiquidOutput(byte aSide) {
- if (mConvertToEssence) {
- if (aSide == 0 || aSide == 1) {
- return true;
- }
- } else {
- if (aSide == 0 || aSide == 1) {
- return false;
- }
- }
- return false;
- }
+ @Override
+ public boolean onPreTick(long aTick) {
+ boolean aSuperResult = super.onPreTick(aTick);
+ long aTankSpaceLeft = 0;
+ double aAmount = 0;
+ int aRuns = 0;
+ if (this.mConvertToEssence) {
+ aTankSpaceLeft = (this.tankEssence.getCapacity() - this.tankEssence.getFluidAmount());
+ aAmount = EnchantingUtils.getEssenceFromLiquidXp(100).amount;
+ } else {
+ aTankSpaceLeft = (this.tankLiquidXp.getCapacity() - this.tankLiquidXp.getFluidAmount());
+ aAmount = EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP;
+ }
+ aRuns = (int) (aTankSpaceLeft / aAmount);
+ for (int i = 0; i < aRuns; i++) {
+ if (getAdjustedVolume() == 0) {
+ break;
+ }
+ }
+ return aSuperResult;
+ }
- @Override
- public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (mConvertToEssence) {
- if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
- return this.tankLiquidXp.fill(aFluid, doFill);
- }
- } else {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return this.tankEssence.fill(aFluid, doFill);
- }
- }
- return 0;
- }
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ if (mConvertToEssence) {
+ if (aSide == 0 || aSide == 1) {
+ return false;
+ }
+ } else {
+ if (aSide == 0 || aSide == 1) {
+ return true;
+ }
+ }
+ return false;
+ }
- @Override
- public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- if (mConvertToEssence) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return this.tankEssence.drain(maxDrain, doDrain);
- }
- } else {
- if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
- return this.tankLiquidXp.drain(maxDrain, doDrain);
- }
- }
- return null;
- }
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ if (mConvertToEssence) {
+ if (aSide == 0 || aSide == 1) {
+ return true;
+ }
+ } else {
+ if (aSide == 0 || aSide == 1) {
+ return false;
+ }
+ }
+ return false;
+ }
- @Override
- public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- if (mConvertToEssence) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return this.tankEssence.drain(aFluid, doDrain);
- }
- } else {
- if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
- return this.tankLiquidXp.drain(aFluid, doDrain);
- }
- }
- return null;
- }
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (mConvertToEssence) {
+ if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
+ return this.tankLiquidXp.fill(aFluid, doFill);
+ }
+ } else {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return this.tankEssence.fill(aFluid, doFill);
+ }
+ }
+ return 0;
+ }
- @Override
- public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- if (mConvertToEssence) {
- if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
- return this.tankLiquidXp.canTankBeFilled();
- }
- } else {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return this.tankEssence.canTankBeFilled();
- }
- }
- return false;
- }
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ if (mConvertToEssence) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return this.tankEssence.drain(maxDrain, doDrain);
+ }
+ } else {
+ if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
+ return this.tankLiquidXp.drain(maxDrain, doDrain);
+ }
+ }
+ return null;
+ }
- @Override
- public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- if (mConvertToEssence) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return this.tankEssence.canTankBeEmptied();
- }
- } else {
- if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
- return this.tankLiquidXp.canTankBeEmptied();
- }
- }
- return false;
- }
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ if (mConvertToEssence) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return this.tankEssence.drain(aFluid, doDrain);
+ }
+ } else {
+ if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
+ return this.tankLiquidXp.drain(aFluid, doDrain);
+ }
+ }
+ return null;
+ }
- @Override
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return new FluidTankInfo[] { this.tankEssence.getInfo() };
- } else {
- return new FluidTankInfo[] { this.tankLiquidXp.getInfo() };
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ if (mConvertToEssence) {
+ if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
+ return this.tankLiquidXp.canTankBeFilled();
+ }
+ } else {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return this.tankEssence.canTankBeFilled();
+ }
+ }
+ return false;
+ }
- }
- }
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ if (mConvertToEssence) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return this.tankEssence.canTankBeEmptied();
+ }
+ } else {
+ if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
+ return this.tankLiquidXp.canTankBeEmptied();
+ }
+ }
+ return false;
+ }
- @Override
- public FluidStack getFluid() {
- if (mConvertToEssence) {
- return this.tankEssence.getFluid();
- }
- else {
- return this.tankLiquidXp.getFluid();
- }
- }
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return new FluidTankInfo[] {this.tankEssence.getInfo()};
+ } else {
+ return new FluidTankInfo[] {this.tankLiquidXp.getInfo()};
+ }
+ }
- @Override
- public int getFluidAmount() {
- if (mConvertToEssence) {
- return this.tankEssence.getFluidAmount();
- }
- else {
- return this.tankLiquidXp.getFluidAmount();
- }
- }
+ @Override
+ public FluidStack getFluid() {
+ if (mConvertToEssence) {
+ return this.tankEssence.getFluid();
+ } else {
+ return this.tankLiquidXp.getFluid();
+ }
+ }
- @Override
- public FluidTankInfo getInfo() {
- if (mConvertToEssence) {
- return this.tankEssence.getInfo();
- } else {
- return this.tankLiquidXp.getInfo();
- }
- }
+ @Override
+ public int getFluidAmount() {
+ if (mConvertToEssence) {
+ return this.tankEssence.getFluidAmount();
+ } else {
+ return this.tankLiquidXp.getFluidAmount();
+ }
+ }
- @Override
- public int fill(FluidStack resource, boolean doFill) {
- if (mConvertToEssence) {
- return this.tankEssence.fill(resource, doFill);
- } else {
- return this.tankLiquidXp.fill(resource, doFill);
- }
- }
+ @Override
+ public FluidTankInfo getInfo() {
+ if (mConvertToEssence) {
+ return this.tankEssence.getInfo();
+ } else {
+ return this.tankLiquidXp.getInfo();
+ }
+ }
- @Override
- public FluidStack drain(int maxDrain, boolean doDrain) {
- if (mConvertToEssence) {
- return this.tankEssence.drain(maxDrain, doDrain);
- } else {
- return this.tankLiquidXp.drain(maxDrain, doDrain);
- }
- }
+ @Override
+ public int fill(FluidStack resource, boolean doFill) {
+ if (mConvertToEssence) {
+ return this.tankEssence.fill(resource, doFill);
+ } else {
+ return this.tankLiquidXp.fill(resource, doFill);
+ }
+ }
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ if (mConvertToEssence) {
+ return this.tankEssence.drain(maxDrain, doDrain);
+ } else {
+ return this.tankLiquidXp.drain(maxDrain, doDrain);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java b/src/main/java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java
index eda0c65e46..32401bf0ec 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java
@@ -16,199 +16,191 @@ import net.minecraft.world.IBlockAccess;
public abstract class TileEntityRedstoneHandler extends TileEntity implements IToolable {
- private final int mTileType;
- private BlockPos mTilePos;
- private boolean mRequiresUpdate = false;
- private Long mStartTime;
- private Byte mRedstoneLevel;
-
- public boolean mLightMode = false;
- public float mLightValue = 0;
-
- /**
- * Sets the Redstone Handler Type.
- * @param aTileType - A type of the handler designated by an int. 0 = receiver, 1 = emitter, 2 = both, anything else = nothing.
- */
- public TileEntityRedstoneHandler(int aTileType) {
- mTileType = aTileType;
- registerTileEntity();
- }
-
- private void registerTileEntity() {
- if (!EntityUtils.isTileEntityRegistered(getTileEntityClass(), getTileEntityNameForRegistration())) {
- GameRegistry.registerTileEntity(getTileEntityClass(), getTileEntityNameForRegistration());
- }
- }
-
- protected abstract Class<? extends TileEntity> getTileEntityClass();
-
- protected abstract String getTileEntityNameForRegistration();
-
- public Block getBlock() {
- return mTilePos != null ? mTilePos.getBlockAtPos() : Blocks.redstone_block;
- }
-
- public final boolean isLight() {
- return mLightMode;
- }
-
- public final float getLightBrightness() {
- if (!isLight()) {
- return 0;
- }
- else {
- return mLightValue;
- }
- }
-
- @Override
- public void readFromNBT(NBTTagCompound aNBT) {
- mStartTime = aNBT.getLong("mStartTime");
- mInvName = aNBT.getString("mInvName");
- mLightValue = aNBT.getFloat("mLightValue");
- mLightMode = aNBT.getBoolean("mLightMode");
- mRedstoneLevel = aNBT.getByte("mRedstoneLevel");
- super.readFromNBT(aNBT);
- }
-
- @Override
- public void writeToNBT(NBTTagCompound aNBT) {
- aNBT.setInteger("mTileType", mTileType);
- aNBT.setLong("mStartTime", mStartTime);
- aNBT.setString("mInvName", mInvName);
- aNBT.setFloat("mLightValue", getLightBrightness());
- aNBT.setBoolean("mLightMode", isLight());
- aNBT.setByte("mRedstoneLevel", mRedstoneLevel);
- super.writeToNBT(aNBT);
- }
-
-
- private boolean mHasUpdatedRecently = false;
-
- private final boolean init() {
- if (mTilePos == null) {
- try {
- mTilePos = new BlockPos(this);
- } catch (Throwable t) {
- return false;
- }
- }
- if (mStartTime == null) {
- try {
- mStartTime = System.currentTimeMillis();
- } catch (Throwable t) {
- return false;
- }
- }
- return true;
- }
- private Long mLastUpdate;
- private String mInvName = "";
-
- @Override
- public void updateEntity() {
- //Handle init
- if (!init()) {
- return;
- }
- if (mRequiresUpdate || mLastUpdate == null) {
- mRequiresUpdate = false;
- mHasUpdatedRecently = true;
- mLastUpdate = System.currentTimeMillis();
- if (mTilePos.world.getBlockLightValue(xCoord, yCoord, zCoord) != getLightBrightness()/0.0625f) {
- mTilePos.getBlockAtPos().setLightLevel(getLightBrightness()/0.0625f);
- mTilePos.world.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, (int) (getLightBrightness()/0.0625f));
- mTilePos.world.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord);
- Logger.INFO("Updating Light");
- }
- mTilePos.world.scheduleBlockUpdate(xCoord, yCoord, zCoord, mTilePos.getBlockAtPos(), 1);
- markDirty();
- }
- if (Utils.getMillisSince(mLastUpdate, System.currentTimeMillis()) >= 5000) {
- if (mHasUpdatedRecently) {
- mHasUpdatedRecently = false;
- this.markForUpdate();
- }
- }
-
- if (Utils.getMillisSince(mStartTime, System.currentTimeMillis()) % 50 == 0) {
-
- }
-
-
-
- super.updateEntity();
- }
-
- public final void markForUpdate() {
- mRequiresUpdate = true;
- }
-
- public final boolean hasUpdatedRecently() {
- return mHasUpdatedRecently;
- }
-
- @Override
- public int getBlockMetadata() {
- return super.getBlockMetadata();
- }
-
- @Override
- public void markDirty() {
- super.markDirty();
- }
-
- @Override
- public boolean canUpdate() {
- return true;
- }
-
- public void setRedstoneState(boolean aRedstoneActive) {
-
- }
-
- public void setCurrentTextureArray(IIcon[] aTextures) {
-
- }
-
+ private final int mTileType;
+ private BlockPos mTilePos;
+ private boolean mRequiresUpdate = false;
+ private Long mStartTime;
+ private Byte mRedstoneLevel;
+
+ public boolean mLightMode = false;
+ public float mLightValue = 0;
+
+ /**
+ * Sets the Redstone Handler Type.
+ * @param aTileType - A type of the handler designated by an int. 0 = receiver, 1 = emitter, 2 = both, anything else = nothing.
+ */
+ public TileEntityRedstoneHandler(int aTileType) {
+ mTileType = aTileType;
+ registerTileEntity();
+ }
+
+ private void registerTileEntity() {
+ if (!EntityUtils.isTileEntityRegistered(getTileEntityClass(), getTileEntityNameForRegistration())) {
+ GameRegistry.registerTileEntity(getTileEntityClass(), getTileEntityNameForRegistration());
+ }
+ }
+
+ protected abstract Class<? extends TileEntity> getTileEntityClass();
+
+ protected abstract String getTileEntityNameForRegistration();
+
+ public Block getBlock() {
+ return mTilePos != null ? mTilePos.getBlockAtPos() : Blocks.redstone_block;
+ }
+
+ public final boolean isLight() {
+ return mLightMode;
+ }
+
+ public final float getLightBrightness() {
+ if (!isLight()) {
+ return 0;
+ } else {
+ return mLightValue;
+ }
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ mStartTime = aNBT.getLong("mStartTime");
+ mInvName = aNBT.getString("mInvName");
+ mLightValue = aNBT.getFloat("mLightValue");
+ mLightMode = aNBT.getBoolean("mLightMode");
+ mRedstoneLevel = aNBT.getByte("mRedstoneLevel");
+ super.readFromNBT(aNBT);
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ aNBT.setInteger("mTileType", mTileType);
+ aNBT.setLong("mStartTime", mStartTime);
+ aNBT.setString("mInvName", mInvName);
+ aNBT.setFloat("mLightValue", getLightBrightness());
+ aNBT.setBoolean("mLightMode", isLight());
+ aNBT.setByte("mRedstoneLevel", mRedstoneLevel);
+ super.writeToNBT(aNBT);
+ }
+
+ private boolean mHasUpdatedRecently = false;
+
+ private final boolean init() {
+ if (mTilePos == null) {
+ try {
+ mTilePos = new BlockPos(this);
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+ if (mStartTime == null) {
+ try {
+ mStartTime = System.currentTimeMillis();
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private Long mLastUpdate;
+ private String mInvName = "";
+
+ @Override
+ public void updateEntity() {
+ // Handle init
+ if (!init()) {
+ return;
+ }
+ if (mRequiresUpdate || mLastUpdate == null) {
+ mRequiresUpdate = false;
+ mHasUpdatedRecently = true;
+ mLastUpdate = System.currentTimeMillis();
+ if (mTilePos.world.getBlockLightValue(xCoord, yCoord, zCoord) != getLightBrightness() / 0.0625f) {
+ mTilePos.getBlockAtPos().setLightLevel(getLightBrightness() / 0.0625f);
+ mTilePos.world.setLightValue(
+ EnumSkyBlock.Block, xCoord, yCoord, zCoord, (int) (getLightBrightness() / 0.0625f));
+ mTilePos.world.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord);
+ Logger.INFO("Updating Light");
+ }
+ mTilePos.world.scheduleBlockUpdate(xCoord, yCoord, zCoord, mTilePos.getBlockAtPos(), 1);
+ markDirty();
+ }
+ if (Utils.getMillisSince(mLastUpdate, System.currentTimeMillis()) >= 5000) {
+ if (mHasUpdatedRecently) {
+ mHasUpdatedRecently = false;
+ this.markForUpdate();
+ }
+ }
+
+ if (Utils.getMillisSince(mStartTime, System.currentTimeMillis()) % 50 == 0) {}
+
+ super.updateEntity();
+ }
+
+ public final void markForUpdate() {
+ mRequiresUpdate = true;
+ }
+
+ public final boolean hasUpdatedRecently() {
+ return mHasUpdatedRecently;
+ }
+
+ @Override
+ public int getBlockMetadata() {
+ return super.getBlockMetadata();
+ }
+
+ @Override
+ public void markDirty() {
+ super.markDirty();
+ }
+
+ @Override
+ public boolean canUpdate() {
+ return true;
+ }
+
+ public void setRedstoneState(boolean aRedstoneActive) {}
+
+ public void setCurrentTextureArray(IIcon[] aTextures) {}
+
/**
* Used to see if one of the blocks next to you or your block is getting power from a neighboring block. Used by
* items like TNT or Doors so they don't have redstone going straight into them. Args: x, y, z
*/
- public boolean isGettingIndirectlyPowered() {
- if (mTilePos == null) {
- return false;
- }
- return mTilePos.world.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
- }
-
- public int getStrongestIndirectPower() {
- if (mTilePos == null) {
- return 0;
- }
- return mTilePos.world.getStrongestIndirectPower(xCoord, yCoord, zCoord);
- }
-
+ public boolean isGettingIndirectlyPowered() {
+ if (mTilePos == null) {
+ return false;
+ }
+ return mTilePos.world.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
+ }
+
+ public int getStrongestIndirectPower() {
+ if (mTilePos == null) {
+ return 0;
+ }
+ return mTilePos.world.getStrongestIndirectPower(xCoord, yCoord, zCoord);
+ }
+
/**
* Gets the power level from a certain block face. Args: x, y, z, direction
*/
- public int getIndirectPowerForSide(int aSide) {
- if (mTilePos == null || aSide <0 || aSide > 5) {
- return 0;
- }
- return mTilePos.world.getIndirectPowerLevelTo(xCoord, yCoord, zCoord, aSide);
- }
-
- /**
+ public int getIndirectPowerForSide(int aSide) {
+ if (mTilePos == null || aSide < 0 || aSide > 5) {
+ return 0;
+ }
+ return mTilePos.world.getIndirectPowerLevelTo(xCoord, yCoord, zCoord, aSide);
+ }
+
+ /**
* Returns the highest redstone signal strength powering the given block. Args: X, Y, Z.
*/
- public int getBlockPowerInput() {
- if (mTilePos == null) {
- return 0;
- }
- return mTilePos.world.getBlockPowerInput(xCoord, yCoord, zCoord);
- }
-
+ public int getBlockPowerInput() {
+ if (mTilePos == null) {
+ return 0;
+ }
+ return mTilePos.world.getBlockPowerInput(xCoord, yCoord, zCoord);
+ }
+
/**
* Determine if this block can make a redstone connection on the side provided,
* Useful to control which sides are inputs and outputs for redstone wires.
@@ -227,12 +219,12 @@ public abstract class TileEntityRedstoneHandler extends TileEntity implements IT
* @param side The side that is trying to make the connection
* @return True to make the connection
*/
- public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) {
- if (mTilePos == null) {
- return false;
- }
- return canAcceptRedstoneSignal() || canSupplyRedstoneSignal();
- }
+ public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) {
+ if (mTilePos == null) {
+ return false;
+ }
+ return canAcceptRedstoneSignal() || canSupplyRedstoneSignal();
+ }
/**
* Called to determine whether to allow the a block to handle its own indirect power rather than using the default rules.
@@ -243,12 +235,12 @@ public abstract class TileEntityRedstoneHandler extends TileEntity implements IT
* @param side The INPUT side of the block to be powered - ie the opposite of this block's output side
* @return Whether Block#isProvidingWeakPower should be called when determining indirect power
*/
- public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) {
- if (mTilePos == null) {
- return false;
- }
+ public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) {
+ if (mTilePos == null) {
+ return false;
+ }
return getBlock().isNormalCube();
- }
+ }
/**
* If this block should be notified of weak changes.
@@ -262,207 +254,181 @@ public abstract class TileEntityRedstoneHandler extends TileEntity implements IT
* @param side The side to check
* @return true To be notified of changes
*/
- public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) {
- if (mTilePos == null) {
- return false;
- }
- return false;
- }
-
-
- /**
- * Override this to change the level of redstone output.
- * @return
- */
- public int getRedstoneLevel() {
- if (mTilePos == null || mRedstoneLevel == null) {
- return 0;
- }
- else {
- if (canSupplyRedstoneSignal()) {
- if (this.hasUpdatedRecently()) {
- int aInputPower = getInputPowerLevel();
- mRedstoneLevel = (byte) ((aInputPower >= 0 && aInputPower <= 127) ? aInputPower : 0);
- }
- return mRedstoneLevel;
- }
- }
- return 0;
- }
-
-
- public boolean providesWeakPower() {
- return isProvidingPower();
- }
-
- public boolean providesStrongPower() {
- return isProvidingPower();
- }
-
-
- /**
- * Returns the amount of week power this block is providing to a side.
- * @param world
- * @param x
- * @param y
- * @param z
- * @param side
- * @return
- */
- public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
- if (!providesWeakPower()) {
- return 0;
- }
- return getOutputPowerLevel();
- }
- /**
- * Returns the amount of strong power this block is providing to a side.
- * @param world
- * @param x
- * @param y
- * @param z
- * @param side
- * @return
- */
- public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
- if (!providesStrongPower()) {
- return 0;
- }
- return getOutputPowerLevel();
- }
-
-
-
-
-
-
-
- /*
- * Alk's Simplified Redstone Handling functions (Fuck redstone)
- */
-
- /**
- *
- * @return - Does this Block supply redstone signal at all?
- */
- public final boolean isPowered() {
- return canAcceptRedstoneSignal() && getInputPowerLevel() > 0;
- }
-
- /**
- *
- * @return - Can this Block provide redstone signal at all?
- */
- public final boolean isProvidingPower() {
- return canSupplyRedstoneSignal() && getOutputPowerLevel() > 0;
- }
-
- /**
- *
- * @return - (0-15) Redstone Output signal level
- */
- public final int getOutputPowerLevel() {
- return getRedstoneLevel();
- }
-
- /**
- *
- * @return (0-15) Redstone Input Signal level
- */
- public final int getInputPowerLevel() {
- return getBlockPowerInput();
- }
-
- /**
- *
- * @return - Does this Tile Entity support outputting redstone?
- */
- public final boolean canSupplyRedstoneSignal() {
- return mTileType == 1 || mTileType == 2;
- }
-
- /**
- *
- * @return - Does this Tile Entity support inputting redstone?
- */
- public final boolean canAcceptRedstoneSignal() {
- return mTileType == 0 || mTileType == 2;
- }
-
-
- @Override
- public boolean isScrewdriverable() {
- return false;
- }
-
-
- @Override
- public boolean onScrewdriverLMB() {
- return false;
- }
-
-
- @Override
- public boolean onScrewdriverRMB() {
- return false;
- }
-
-
- @Override
- public boolean isWrenchable() {
- return false;
- }
-
-
- @Override
- public boolean onWrenchLMB() {
- return false;
- }
-
-
- @Override
- public boolean onWrenchRMB() {
- return false;
- }
-
-
- @Override
- public boolean isMalletable() {
- return false;
- }
-
-
- @Override
- public boolean onMalletLMB() {
- return false;
- }
-
-
- @Override
- public boolean onMalletRMB() {
- return false;
- }
-
-
- public void setCustomName(String displayName) {
- this.mInvName = displayName;
- }
-
- public String getCustomName() {
- return this.mInvName;
- }
-
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.mInvName : "container.redstone.generic";
- }
-
- public boolean hasCustomInventoryName() {
- return (this.mInvName != null) && !this.mInvName.equals("");
- }
-
-
-
-
-
-
+ public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) {
+ if (mTilePos == null) {
+ return false;
+ }
+ return false;
+ }
+
+ /**
+ * Override this to change the level of redstone output.
+ * @return
+ */
+ public int getRedstoneLevel() {
+ if (mTilePos == null || mRedstoneLevel == null) {
+ return 0;
+ } else {
+ if (canSupplyRedstoneSignal()) {
+ if (this.hasUpdatedRecently()) {
+ int aInputPower = getInputPowerLevel();
+ mRedstoneLevel = (byte) ((aInputPower >= 0 && aInputPower <= 127) ? aInputPower : 0);
+ }
+ return mRedstoneLevel;
+ }
+ }
+ return 0;
+ }
+
+ public boolean providesWeakPower() {
+ return isProvidingPower();
+ }
+
+ public boolean providesStrongPower() {
+ return isProvidingPower();
+ }
+
+ /**
+ * Returns the amount of week power this block is providing to a side.
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param side
+ * @return
+ */
+ public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
+ if (!providesWeakPower()) {
+ return 0;
+ }
+ return getOutputPowerLevel();
+ }
+ /**
+ * Returns the amount of strong power this block is providing to a side.
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param side
+ * @return
+ */
+ public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
+ if (!providesStrongPower()) {
+ return 0;
+ }
+ return getOutputPowerLevel();
+ }
+
+ /*
+ * Alk's Simplified Redstone Handling functions (Fuck redstone)
+ */
+
+ /**
+ *
+ * @return - Does this Block supply redstone signal at all?
+ */
+ public final boolean isPowered() {
+ return canAcceptRedstoneSignal() && getInputPowerLevel() > 0;
+ }
+
+ /**
+ *
+ * @return - Can this Block provide redstone signal at all?
+ */
+ public final boolean isProvidingPower() {
+ return canSupplyRedstoneSignal() && getOutputPowerLevel() > 0;
+ }
+
+ /**
+ *
+ * @return - (0-15) Redstone Output signal level
+ */
+ public final int getOutputPowerLevel() {
+ return getRedstoneLevel();
+ }
+
+ /**
+ *
+ * @return (0-15) Redstone Input Signal level
+ */
+ public final int getInputPowerLevel() {
+ return getBlockPowerInput();
+ }
+
+ /**
+ *
+ * @return - Does this Tile Entity support outputting redstone?
+ */
+ public final boolean canSupplyRedstoneSignal() {
+ return mTileType == 1 || mTileType == 2;
+ }
+
+ /**
+ *
+ * @return - Does this Tile Entity support inputting redstone?
+ */
+ public final boolean canAcceptRedstoneSignal() {
+ return mTileType == 0 || mTileType == 2;
+ }
+
+ @Override
+ public boolean isScrewdriverable() {
+ return false;
+ }
+
+ @Override
+ public boolean onScrewdriverLMB() {
+ return false;
+ }
+
+ @Override
+ public boolean onScrewdriverRMB() {
+ return false;
+ }
+
+ @Override
+ public boolean isWrenchable() {
+ return false;
+ }
+
+ @Override
+ public boolean onWrenchLMB() {
+ return false;
+ }
+
+ @Override
+ public boolean onWrenchRMB() {
+ return false;
+ }
+
+ @Override
+ public boolean isMalletable() {
+ return false;
+ }
+
+ @Override
+ public boolean onMalletLMB() {
+ return false;
+ }
+
+ @Override
+ public boolean onMalletRMB() {
+ return false;
+ }
+
+ public void setCustomName(String displayName) {
+ this.mInvName = displayName;
+ }
+
+ public String getCustomName() {
+ return this.mInvName;
+ }
+
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.mInvName : "container.redstone.generic";
+ }
+
+ public boolean hasCustomInventoryName() {
+ return (this.mInvName != null) && !this.mInvName.equals("");
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java
index 6bb4c932dc..258e0e88e6 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java
@@ -19,137 +19,118 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
public class TileEntityAdvPooCollector extends TileEntityBaseFluidCollector {
-
- public TileEntityAdvPooCollector() {
- super(18, 128000);
- }
+ public TileEntityAdvPooCollector() {
+ super(18, 128000);
+ }
- @Override
- public boolean canFill(ForgeDirection from, Fluid fluid) {
- return false;
- }
+ @Override
+ public boolean canFill(ForgeDirection from, Fluid fluid) {
+ return false;
+ }
- @Override
- public boolean canDrain(ForgeDirection from, Fluid fluid) {
- return true;
- }
-
- public void onPreLogicTick() {
-
- }
-
- public <V> boolean addDrop(V aPooMaker) {
- int aChance = MathUtils.randInt(0, 50000);
- if (aChance > 0) {
- ItemStack aPoop;
- if (aChance<= 200) {
- aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustManureByproducts", 1);
- }
- else if (aChance <= 1000) {
- aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
- }
- else if (aChance <= 2000) {
- aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyManureByproducts", 1);
- }
- else {
- return false;
- }
-
- //Add to inventory if not full, else espawn in world
- if (!this.mInventory.addItemStack(aPoop)) {
- EntityItem entity = new EntityItem(worldObj, xCoord, yCoord+1.5, zCoord, aPoop);
- worldObj.spawnEntityInWorld(entity);
- }
-
- }
-
-
- return false;
- }
+ @Override
+ public boolean canDrain(ForgeDirection from, Fluid fluid) {
+ return true;
+ }
- private static AutoMap<Class> aEntityToDrain = new AutoMap<Class>();
-
- @Override
- public AutoMap<Class> aThingsToLookFor() {
- if (aEntityToDrain.isEmpty()) {
- aEntityToDrain.add(EntityAnimal.class);
- aEntityToDrain.add(IAnimals.class);
- aEntityToDrain.add(EntityVillager.class);
- aEntityToDrain.add(EntityPlayer.class);
- }
- return aEntityToDrain;
- }
+ public void onPreLogicTick() {}
- @Override
- public <V> int onPostTick(V aPooMaker) {
- if (this.tank.getFluidAmount() < this.tank.getCapacity()) {
- int aPooAmount = 0;
- // Vanilla Animals
- if (aPooMaker instanceof EntityChicken) {
- aPooAmount = MathUtils.randInt(1, 40);
- }
- else if (aPooMaker instanceof EntityHorse) {
- aPooAmount = MathUtils.randInt(20, 40);
- }
- else if (aPooMaker instanceof EntityCow) {
- aPooAmount = MathUtils.randInt(18, 45);
- }
- else if (aPooMaker instanceof EntityMooshroom) {
- aPooAmount = 17;
- }
- else if (aPooMaker instanceof EntitySheep) {
- aPooAmount = MathUtils.randInt(8, 30);
- }
-
- else {
- if (aPooMaker instanceof EntityAnimal || aPooMaker instanceof IAnimals) {
- aPooAmount = MathUtils.randInt(5, 35);
- }
- else if (aPooMaker instanceof EntityVillager) {
- aPooAmount = MathUtils.randInt(25, 30);
- }
- else if (aPooMaker instanceof EntityPlayer) {
- aPooAmount = MathUtils.randInt(1, 3);
- }
- else {
- aPooAmount = MathUtils.randInt(1, 10);
- }
- }
- aPooAmount = Math.max(Math.min(this.tank.getCapacity()-this.tank.getFluidAmount(), aPooAmount), 1);
- return Math.max(1, (aPooAmount * MathUtils.getRandomFromArray(new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4}) / 10));
- }
- else {
- return 0;
- }
- }
+ public <V> boolean addDrop(V aPooMaker) {
+ int aChance = MathUtils.randInt(0, 50000);
+ if (aChance > 0) {
+ ItemStack aPoop;
+ if (aChance <= 200) {
+ aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustManureByproducts", 1);
+ } else if (aChance <= 1000) {
+ aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
+ } else if (aChance <= 2000) {
+ aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyManureByproducts", 1);
+ } else {
+ return false;
+ }
- @Override
- public Fluid fluidToProvide() {
- return AgriculturalChem.PoopJuice;
- }
+ // Add to inventory if not full, else espawn in world
+ if (!this.mInventory.addItemStack(aPoop)) {
+ EntityItem entity = new EntityItem(worldObj, xCoord, yCoord + 1.5, zCoord, aPoop);
+ worldObj.spawnEntityInWorld(entity);
+ }
+ }
- @Override
- public ItemStack itemToSpawnInWorldIfTankIsFull() {
- int a = MathUtils.randInt(0, 75);
- ItemStack aItem = null;
- if (a <= 30) {
- aItem = ItemUtils.getSimpleStack(AgriculturalChem.dustDirt);
- }
- else if (a <= 40) {
- aItem = ItemUtils.getItemStackOfAmountFromOreDict("dustManureByproducts", 1);
- }
- else if (a <= 55) {
- aItem = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
- }
- return aItem;
- }
-
- public int getBaseTickRate() {
- return MathUtils.randInt(50, 200);
- }
-
-
-
+ return false;
+ }
+ private static AutoMap<Class> aEntityToDrain = new AutoMap<Class>();
+
+ @Override
+ public AutoMap<Class> aThingsToLookFor() {
+ if (aEntityToDrain.isEmpty()) {
+ aEntityToDrain.add(EntityAnimal.class);
+ aEntityToDrain.add(IAnimals.class);
+ aEntityToDrain.add(EntityVillager.class);
+ aEntityToDrain.add(EntityPlayer.class);
+ }
+ return aEntityToDrain;
+ }
+
+ @Override
+ public <V> int onPostTick(V aPooMaker) {
+ if (this.tank.getFluidAmount() < this.tank.getCapacity()) {
+ int aPooAmount = 0;
+ // Vanilla Animals
+ if (aPooMaker instanceof EntityChicken) {
+ aPooAmount = MathUtils.randInt(1, 40);
+ } else if (aPooMaker instanceof EntityHorse) {
+ aPooAmount = MathUtils.randInt(20, 40);
+ } else if (aPooMaker instanceof EntityCow) {
+ aPooAmount = MathUtils.randInt(18, 45);
+ } else if (aPooMaker instanceof EntityMooshroom) {
+ aPooAmount = 17;
+ } else if (aPooMaker instanceof EntitySheep) {
+ aPooAmount = MathUtils.randInt(8, 30);
+ } else {
+ if (aPooMaker instanceof EntityAnimal || aPooMaker instanceof IAnimals) {
+ aPooAmount = MathUtils.randInt(5, 35);
+ } else if (aPooMaker instanceof EntityVillager) {
+ aPooAmount = MathUtils.randInt(25, 30);
+ } else if (aPooMaker instanceof EntityPlayer) {
+ aPooAmount = MathUtils.randInt(1, 3);
+ } else {
+ aPooAmount = MathUtils.randInt(1, 10);
+ }
+ }
+ aPooAmount = Math.max(Math.min(this.tank.getCapacity() - this.tank.getFluidAmount(), aPooAmount), 1);
+ return Math.max(
+ 1,
+ (aPooAmount
+ * MathUtils.getRandomFromArray(
+ new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4})
+ / 10));
+ } else {
+ return 0;
+ }
+ }
+
+ @Override
+ public Fluid fluidToProvide() {
+ return AgriculturalChem.PoopJuice;
+ }
+
+ @Override
+ public ItemStack itemToSpawnInWorldIfTankIsFull() {
+ int a = MathUtils.randInt(0, 75);
+ ItemStack aItem = null;
+ if (a <= 30) {
+ aItem = ItemUtils.getSimpleStack(AgriculturalChem.dustDirt);
+ } else if (a <= 40) {
+ aItem = ItemUtils.getItemStackOfAmountFromOreDict("dustManureByproducts", 1);
+ } else if (a <= 55) {
+ aItem = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
+ }
+ return aItem;
+ }
+
+ public int getBaseTickRate() {
+ return MathUtils.randInt(50, 200);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java
index cdae4cf829..b7985b5b7f 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.tileentities.machines;
-import java.util.List;
-
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.BTF_FluidTank;
import gtPlusPlus.api.objects.minecraft.BlockPos;
@@ -9,6 +7,7 @@ import gtPlusPlus.core.tileentities.base.TileEntityBase;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -28,211 +27,205 @@ import net.minecraftforge.fluids.IFluidHandler;
public abstract class TileEntityBaseFluidCollector extends TileEntityBase implements IFluidHandler {
- public final FluidTank tank;
- private boolean needsUpdate = false;
- private int updateTimer = 0;
- private long internalTickCounter = 0;
- private BlockPos internalBlockLocation;
-
- public TileEntityBaseFluidCollector(int aInvSlotCount, int aTankCapcity) {
- super(aInvSlotCount);
- tank = new BTF_FluidTank(aTankCapcity);
- }
-
- @Override
- public final int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
- needsUpdate = true;
- return this.tank.fill(resource, doFill);
- }
-
- @Override
- public final FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
- needsUpdate = true;
- return this.tank.drain(resource.amount, doDrain);
- }
-
- @Override
- public final FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
- needsUpdate = true;
- FluidStack fluid = this.tank.getFluid();
- // return this.tank.drain(maxDrain, doDrain);
- if (fluid == null) {
- return null;
- }
-
- int drained = maxDrain;
- if (fluid.amount < drained) {
- drained = fluid.amount;
- }
-
- FluidStack stack = new FluidStack(fluid, drained);
- if (doDrain) {
- fluid.amount -= drained;
- if (fluid.amount <= 0) {
- fluid = null;
- }
-
- if (this != null) {
- FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, this.getWorldObj(), this.xCoord,
- this.yCoord, this.zCoord, this.tank, 0));
- }
- }
- return stack;
- }
-
- @Override
- public boolean canFill(ForgeDirection from, Fluid fluid) {
- return false;
- }
-
- @Override
- public boolean canDrain(ForgeDirection from, Fluid fluid) {
- return true;
- }
-
- @Override
- public final FluidTankInfo[] getTankInfo(ForgeDirection from) {
- return new FluidTankInfo[] { this.tank.getInfo() };
- }
-
- @Override
- public final void updateEntity() {
- super.updateEntity();
- onPreLogicTick();
- logicTick();
- if (needsUpdate) {
- if (updateTimer == 0) {
- updateTimer = 10; // every 10 ticks it will send an update
- } else {
- --updateTimer;
- if (updateTimer == 0) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- needsUpdate = false;
- }
- }
- }
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
- tank.readFromNBT(tag);
- super.readFromNBT(tag);
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
- tank.writeToNBT(tag);
- super.writeToNBT(tag);
- }
-
- @Override
- public final Packet getDescriptionPacket() {
- NBTTagCompound tag = new NBTTagCompound();
- writeToNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
- }
-
- @Override
- public final void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
- NBTTagCompound tag = pkt.func_148857_g();
- readFromNBT(tag);
- }
-
- public int getBaseTickRate() {
- return MathUtils.randInt(200, 300);
- }
-
- public abstract AutoMap<Class> aThingsToLookFor();
-
- public abstract void onPreLogicTick();
-
- public final void logicTick() {
-
- if (this.worldObj == null || this.worldObj.isRemote) {
- return;
- }
- if (internalTickCounter % getBaseTickRate() == 0) {
- if (internalBlockLocation == null) {
- internalBlockLocation = new BlockPos(this);
- }
- BlockPos p = internalBlockLocation;
- if (p != null) {
- if (p.world != null) {
- World w = this.worldObj;
- if (w == null) {
- return;
- }
- Chunk c = w.getChunkFromBlockCoords(p.xPos, p.zPos);
- if (c != null) {
- if (c.isChunkLoaded) {
- int startX = p.xPos - 2;
- int startY = p.yPos;
- int startZ = p.zPos - 2;
- int endX = p.xPos + 3;
- int endY = p.yPos + 5;
- int endZ = p.zPos + 3;
- AxisAlignedBB box = AxisAlignedBB.getBoundingBox(startX, startY, startZ, endX, endY, endZ);
- if (box != null) {
- for (Class c2 : aThingsToLookFor()) {
- tickEntityType(w, box, c2);
- }
- } else {
- return;
- }
- }
- }
- }
- }
-
- }
-
- internalTickCounter++;
- }
-
- @SuppressWarnings("unchecked")
- public final void tickEntityType(World w, AxisAlignedBB box, Class aClassToFind) {
- List<?> entities = w.getEntitiesWithinAABB(aClassToFind, box);
- if (entities != null && !entities.isEmpty()) {
- interactWithEntities(entities);
- }
- }
-
- public final <V> void interactWithEntities(List<V> entities) {
- for (V aEntity : entities) {
- addDrop(aEntity);
- if (this.tank.getFluidAmount() < this.tank.getCapacity()) {
- int aFluidAmount = onPostTick(aEntity);
- aFluidAmount = Math.max(Math.min(this.tank.getCapacity()-this.tank.getFluidAmount(), aFluidAmount), 1);
- this.tank.fill(FluidUtils.getFluidStack(fluidToProvide(), aFluidAmount), true);
- }
- else {
- ItemStack aDirtStack = ItemUtils.getSimpleStack(itemToSpawnInWorldIfTankIsFull(), 1);
- if (!ItemUtils.checkForInvalidItems(aDirtStack)) {
- return;
- }
- if (!this.mInventory.addItemStack(aDirtStack)) {
- EntityItem entity = new EntityItem(worldObj, xCoord, yCoord+1.5, zCoord, aDirtStack);
- worldObj.spawnEntityInWorld(entity);
- }
- }
- }
- }
-
-
- /**
- * Return the amount of fluid for this entity type
- * @param aEntity
- * @return
- */
- public abstract <V> int onPostTick(V aEntity);
-
- public abstract <V> boolean addDrop(V aPooMaker);
-
- public abstract Fluid fluidToProvide();
-
- public abstract ItemStack itemToSpawnInWorldIfTankIsFull();
-
-
-
-
+ public final FluidTank tank;
+ private boolean needsUpdate = false;
+ private int updateTimer = 0;
+ private long internalTickCounter = 0;
+ private BlockPos internalBlockLocation;
+
+ public TileEntityBaseFluidCollector(int aInvSlotCount, int aTankCapcity) {
+ super(aInvSlotCount);
+ tank = new BTF_FluidTank(aTankCapcity);
+ }
+
+ @Override
+ public final int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
+ needsUpdate = true;
+ return this.tank.fill(resource, doFill);
+ }
+
+ @Override
+ public final FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
+ needsUpdate = true;
+ return this.tank.drain(resource.amount, doDrain);
+ }
+
+ @Override
+ public final FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
+ needsUpdate = true;
+ FluidStack fluid = this.tank.getFluid();
+ // return this.tank.drain(maxDrain, doDrain);
+ if (fluid == null) {
+ return null;
+ }
+
+ int drained = maxDrain;
+ if (fluid.amount < drained) {
+ drained = fluid.amount;
+ }
+
+ FluidStack stack = new FluidStack(fluid, drained);
+ if (doDrain) {
+ fluid.amount -= drained;
+ if (fluid.amount <= 0) {
+ fluid = null;
+ }
+
+ if (this != null) {
+ FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(
+ fluid, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this.tank, 0));
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection from, Fluid fluid) {
+ return false;
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection from, Fluid fluid) {
+ return true;
+ }
+
+ @Override
+ public final FluidTankInfo[] getTankInfo(ForgeDirection from) {
+ return new FluidTankInfo[] {this.tank.getInfo()};
+ }
+
+ @Override
+ public final void updateEntity() {
+ super.updateEntity();
+ onPreLogicTick();
+ logicTick();
+ if (needsUpdate) {
+ if (updateTimer == 0) {
+ updateTimer = 10; // every 10 ticks it will send an update
+ } else {
+ --updateTimer;
+ if (updateTimer == 0) {
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ needsUpdate = false;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound tag) {
+ tank.readFromNBT(tag);
+ super.readFromNBT(tag);
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound tag) {
+ tank.writeToNBT(tag);
+ super.writeToNBT(tag);
+ }
+
+ @Override
+ public final Packet getDescriptionPacket() {
+ NBTTagCompound tag = new NBTTagCompound();
+ writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
+ }
+
+ @Override
+ public final void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
+ NBTTagCompound tag = pkt.func_148857_g();
+ readFromNBT(tag);
+ }
+
+ public int getBaseTickRate() {
+ return MathUtils.randInt(200, 300);
+ }
+
+ public abstract AutoMap<Class> aThingsToLookFor();
+
+ public abstract void onPreLogicTick();
+
+ public final void logicTick() {
+
+ if (this.worldObj == null || this.worldObj.isRemote) {
+ return;
+ }
+ if (internalTickCounter % getBaseTickRate() == 0) {
+ if (internalBlockLocation == null) {
+ internalBlockLocation = new BlockPos(this);
+ }
+ BlockPos p = internalBlockLocation;
+ if (p != null) {
+ if (p.world != null) {
+ World w = this.worldObj;
+ if (w == null) {
+ return;
+ }
+ Chunk c = w.getChunkFromBlockCoords(p.xPos, p.zPos);
+ if (c != null) {
+ if (c.isChunkLoaded) {
+ int startX = p.xPos - 2;
+ int startY = p.yPos;
+ int startZ = p.zPos - 2;
+ int endX = p.xPos + 3;
+ int endY = p.yPos + 5;
+ int endZ = p.zPos + 3;
+ AxisAlignedBB box = AxisAlignedBB.getBoundingBox(startX, startY, startZ, endX, endY, endZ);
+ if (box != null) {
+ for (Class c2 : aThingsToLookFor()) {
+ tickEntityType(w, box, c2);
+ }
+ } else {
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ internalTickCounter++;
+ }
+
+ @SuppressWarnings("unchecked")
+ public final void tickEntityType(World w, AxisAlignedBB box, Class aClassToFind) {
+ List<?> entities = w.getEntitiesWithinAABB(aClassToFind, box);
+ if (entities != null && !entities.isEmpty()) {
+ interactWithEntities(entities);
+ }
+ }
+
+ public final <V> void interactWithEntities(List<V> entities) {
+ for (V aEntity : entities) {
+ addDrop(aEntity);
+ if (this.tank.getFluidAmount() < this.tank.getCapacity()) {
+ int aFluidAmount = onPostTick(aEntity);
+ aFluidAmount =
+ Math.max(Math.min(this.tank.getCapacity() - this.tank.getFluidAmount(), aFluidAmount), 1);
+ this.tank.fill(FluidUtils.getFluidStack(fluidToProvide(), aFluidAmount), true);
+ } else {
+ ItemStack aDirtStack = ItemUtils.getSimpleStack(itemToSpawnInWorldIfTankIsFull(), 1);
+ if (!ItemUtils.checkForInvalidItems(aDirtStack)) {
+ return;
+ }
+ if (!this.mInventory.addItemStack(aDirtStack)) {
+ EntityItem entity = new EntityItem(worldObj, xCoord, yCoord + 1.5, zCoord, aDirtStack);
+ worldObj.spawnEntityInWorld(entity);
+ }
+ }
+ }
+ }
+
+ /**
+ * Return the amount of fluid for this entity type
+ * @param aEntity
+ * @return
+ */
+ public abstract <V> int onPostTick(V aEntity);
+
+ public abstract <V> boolean addDrop(V aPooMaker);
+
+ public abstract Fluid fluidToProvide();
+
+ public abstract ItemStack itemToSpawnInWorldIfTankIsFull();
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java
index 8ba43bb197..0e8000ebb3 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java
@@ -1,18 +1,6 @@
package gtPlusPlus.core.tileentities.machines;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.ISidedInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.enums.ItemList;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.container.Container_ModularityTable;
@@ -24,457 +12,461 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.ModularArmourUtils;
import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.inventory.ISidedInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
-public class TileEntityModularityTable extends TileEntityBase implements ISidedInventory{
-
- public InventoryModularMain inventoryGrid;
- public InventoryModularOutput inventoryOutputs;
- public InventoryModularOutput mTempRecipeStorage;
- private Container_ModularityTable container;
- private String customName;
- private int mRecipeTimeRemaining = -1;
-
- public TileEntityModularityTable() {
- super(16);
- this.inventoryGrid = new InventoryModularMain();
- this.inventoryOutputs = new InventoryModularOutput();
- this.mTempRecipeStorage = new InventoryModularOutput();
- this.canUpdate();
- generateAllValidUpgrades();
- }
-
- public void setContainer(Container_ModularityTable container_ModularityTable) {
- this.container = container_ModularityTable;
- }
-
- public Container_ModularityTable getContainer() {
- return this.container;
- }
-
- public int getRecipeTime(){
- return this.mRecipeTimeRemaining;
- }
-
- @Override
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- nbt.setInteger("mRecipeTime", this.mRecipeTimeRemaining);
- this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput"));
- this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid"));
- this.mTempRecipeStorage.writeToNBT(this.getTag(nbt, "ContentsRecipeTemp"));
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- this.mRecipeTimeRemaining = nbt.getInteger("mRecipeTime");
- this.inventoryOutputs.readFromNBT(nbt.getCompoundTag("ContentsOutput"));
- this.inventoryGrid.readFromNBT(nbt.getCompoundTag("ContentsGrid"));
- this.mTempRecipeStorage.readFromNBT(nbt.getCompoundTag("ContentsRecipeTemp"));
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- }
-
- protected ItemStack mOutputStack; //Upgraded Bauble
- protected ItemStack mInputstackA; //Bauble
- protected ItemStack mInputstackB; //Upgrade
-
- public ItemStack getPendingOutputItem(){
- this.mRecipeTimeRemaining--;
- return this.mOutputStack;
- }
-
- public ItemStack[] getCurrentInputItems(){
- if (this.mRecipeTimeRemaining < 0){
- return null;
- }
- else {
- return new ItemStack[]{this.mInputstackA, this.mInputstackB};
- }
- }
-
- public boolean setInputStacks(ItemStack tBauble, ItemStack tUpgrade){
- if (tBauble != null){
- this.mInputstackA = tBauble;
- }
- else {
- this.mInputstackA = null;
- }
- if (tUpgrade != null){
- this.mInputstackB = tBauble;
- }
- else {
- this.mInputstackB = null;
- }
- if (this.mInputstackA != null && this.mInputstackB != null){
- return true;
- }
- return false;
- }
-
- public boolean setOutputStack(ItemStack mNewBauble){
- if (mNewBauble != null){
- this.mOutputStack = mNewBauble;
- return true;
- }
- else {
- this.mOutputStack = null;
- return false;
- }
- }
-
- public boolean clearRecipeData(){
- this.mInputstackA = null;
- this.mInputstackB = null;
- this.mOutputStack = null;
- return true;
- }
-
- @Override
- public boolean canUpdate() {
- return true;
- }
-
- public static Map<ItemStack, Pair<Modifiers, Integer>> mValidUpgradeList = new HashMap<ItemStack, Pair<Modifiers, Integer>>();
- public static Map<ItemStack, BT> mValidUpgradeListFormChange = new HashMap<ItemStack, BT>();
-
- private static boolean generateAllValidUpgrades() {
-
- // Form Change
- generateUpgradeFormData(ItemList.Sensor_MV.get(1), BT.TYPE_RING);
- generateUpgradeFormData(ItemList.Electric_Piston_MV.get(1), BT.TYPE_BELT);
- generateUpgradeFormData(ItemList.Emitter_MV.get(1), BT.TYPE_AMULET);
-
- // Damage Boost
- generateUpgradeData(ItemList.Electric_Motor_LV.get(1), Modifiers.BOOST_DAMAGE, 1);
- generateUpgradeData(ItemList.Electric_Motor_MV.get(1), Modifiers.BOOST_DAMAGE, 2);
- generateUpgradeData(ItemList.Electric_Motor_HV.get(1), Modifiers.BOOST_DAMAGE, 3);
- generateUpgradeData(ItemList.Electric_Motor_EV.get(1), Modifiers.BOOST_DAMAGE, 4);
- generateUpgradeData(ItemList.Electric_Motor_IV.get(1), Modifiers.BOOST_DAMAGE, 5);
-
- // Defence Boost
- generateUpgradeData(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateAluminium", 1), Modifiers.BOOST_DEF, 1);
- generateUpgradeData(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateStainlessSteel", 1), Modifiers.BOOST_DEF, 2);
- generateUpgradeData(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateTungsten", 1), Modifiers.BOOST_DEF, 3);
- generateUpgradeData(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateTungstenSteel", 1), Modifiers.BOOST_DEF, 4);
- generateUpgradeData(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateNaquadah", 1), Modifiers.BOOST_DEF, 5);
-
- // Hp Boost
- generateUpgradeData(ItemUtils.simpleMetaStack(Items.golden_apple, 0, 1), Modifiers.BOOST_HP, 1);
- generateUpgradeData(ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1), Modifiers.BOOST_HP, 2);
- generateUpgradeData(ItemUtils.simpleMetaStack(Items.nether_star, 0, 1), Modifiers.BOOST_HP, 3);
- generateUpgradeData(ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32725", 32725, 1), Modifiers.BOOST_HP,
- 4);
- generateUpgradeData(ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32726", 32726, 1), Modifiers.BOOST_HP,
- 5);
-
- return true;
- }
-
- public static boolean generateUpgradeData(ItemStack tStack, Modifiers tMod, int tLevel) {
- Pair<Modifiers, Integer> tTemp = new Pair<Modifiers, Integer>(tMod, tLevel);
- if (mValidUpgradeList.put(tStack, tTemp) != null) {
- return true;
- }
- return false;
- }
-
- public static boolean generateUpgradeFormData(ItemStack tStack, BT tMod) {
- if (mValidUpgradeListFormChange.put(tStack, tMod) != null) {
- return true;
- }
- return false;
- }
-
- public static boolean addUpgrade(ItemStack tStack, ItemStack tBauble) {
-
- try {
- Iterator<Entry<ItemStack, BT>> it = mValidUpgradeListFormChange.entrySet().iterator();
- while (it.hasNext()) {
- Entry<ItemStack, BT> pair = it.next();
- if (pair.getKey().getItem() == tStack.getItem()
- && pair.getKey().getItemDamage() == tStack.getItemDamage()) {
- ModularArmourUtils.setBaubleType(tBauble, pair.getValue());
- tBauble.setItemDamage(ModularArmourUtils.getBaubleTypeID(tBauble));
- return true;
- }
- }
- } catch (Throwable t) {
-
- }
- try {
- Iterator<Entry<ItemStack, Pair<Modifiers, Integer>>> it2 = mValidUpgradeList.entrySet().iterator();
- while (it2.hasNext()) {
- Entry<ItemStack, Pair<Modifiers, Integer>> pair = it2.next();
- if (pair.getKey().getItem() == tStack.getItem()
- && pair.getKey().getItemDamage() == tStack.getItemDamage()) {
- Pair<Modifiers, Integer> newPair = pair.getValue();
- ModularArmourUtils.setModifierLevel(tBauble, newPair);
- return true;
- }
- }
- } catch (Throwable t) {
-
- }
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 11;
- }
-
- @Override
- public ItemStack getStackInSlot(int slot) {
- if (slot >= this.inventoryGrid.getSizeInventory()){
- return this.inventoryOutputs.getStackInSlot(slot-9);
- }
- else if (slot < this.inventoryGrid.getSizeInventory()){
- return this.inventoryGrid.getStackInSlot(slot);
- }
- else {
- return null;
- }
- }
-
- @Override
- public ItemStack decrStackSize(int slot, int count) {
- if (slot < this.inventoryGrid.getSizeInventory()){
- return this.inventoryGrid.decrStackSize(slot, count);
- }
- else if (slot >= this.inventoryGrid.getSizeInventory()){
- return this.inventoryOutputs.decrStackSize(slot-9, count);
- }
- else {
- return null;
- }
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int slot) {
- return this.getStackInSlot(slot);
- }
-
- @Override
- public void setInventorySlotContents(int slot, ItemStack stack) {
- if (slot >= this.inventoryGrid.getSizeInventory()){
- this.inventoryOutputs.setInventorySlotContents(slot-9, stack);
- }
- else if (slot < this.inventoryGrid.getSizeInventory()){
- this.inventoryGrid.setInventorySlotContents(slot, stack);
- }
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer entityplayer) {
- return true;
- }
-
- @Override
- public void openInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.inventoryGrid.openInventory();
- this.inventoryOutputs.openInventory();
- }
-
- @Override
- public void closeInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.inventoryGrid.openInventory();
- this.inventoryOutputs.openInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
- if (slot >= this.inventoryGrid.getSizeInventory()){
- return this.inventoryOutputs.isItemValidForSlot(slot-9, itemstack);
- }
- else if (slot < this.inventoryGrid.getSizeInventory()){
- return this.inventoryGrid.isItemValidForSlot(slot, itemstack);
- }
- else {
- return false;
- }
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(int side) {
- int[] accessibleSides = new int[this.getSizeInventory()];
- for (int r=0; r<this.getSizeInventory(); r++){
- accessibleSides[r]=r;
- }
- return accessibleSides;
-
- }
-
- @Override
- public boolean canInsertItem(int slot, ItemStack item, int side) {
- Logger.INFO("Slot:"+slot+" | side? "+side);
-
- /*if (side == 1){
- return this.inventoryOutputs.isItemValidForSlot(slot-9, item);
- } */
- if (slot >= 9){
- return this.inventoryOutputs.isItemValidForSlot(slot-9, item);
- }
- else {
- return this.inventoryGrid.isItemValidForSlot(slot, item);
- }
- }
-
- @Override
- public boolean canExtractItem(int slot, ItemStack item, int side) {
- Logger.INFO("Slot:"+slot+" | side? "+side);
- if (slot == 11 || slot <= 8){
- return true;
- }
- return false;
- }
-
- @Override
- public String getCustomName() {
- return this.customName;
- }
-
- @Override
- public void setCustomName(String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.fishtrap";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return this.customName != null && !this.customName.equals("");
- }
-
- @Override
- public boolean onPreTick(long aTick) {
- //Check for active recipe
- if (this.mRecipeTimeRemaining > -1 || (this.mTempRecipeStorage != null) && (this.mTempRecipeStorage.getRecipeTime() > -1)){
- if ((this.mTempRecipeStorage != null) && this.mTempRecipeStorage.getRecipeTime() > -1){
- if (this.mRecipeTimeRemaining < this.mTempRecipeStorage.getRecipeTime()){
- this.mRecipeTimeRemaining = this.mTempRecipeStorage.getRecipeTime();
- this.markDirty();
- }
- }
- if (this.mInputstackA != null && this.mInputstackB != null && this.mOutputStack != null){
- this.mTempRecipeStorage.setInventorySlotContents(0, this.mInputstackA);
- this.mTempRecipeStorage.setInventorySlotContents(1, this.mInputstackB);
- this.mTempRecipeStorage.setInventorySlotContents(2, this.mOutputStack);
- this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining);
- this.markDirty();
- }
- }
- return true;
- }
-
- @Override
- public boolean onPostTick(long aTick) {
- if (mRecipeTimeRemaining == 0){
- this.inventoryOutputs.setInventorySlotContents(2, this.getPendingOutputItem());
- clearRecipeData();
- this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining);
- this.markDirty();
- }
- else if (mRecipeTimeRemaining > 0){
- mRecipeTimeRemaining--;
- this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining);
- }
- return true;
- }
-
- @Override
- public boolean processRecipe() {
- boolean removeInputA = false;
- boolean removeInputB = false;
- // Data stick
- ItemStack tBauble = this.inventoryOutputs.getStackInSlot(0);
- ItemStack tUpgrade = this.inventoryOutputs.getStackInSlot(1);
- if (tBauble != null && tUpgrade != null && this.container != null) {
- if (tBauble.getItem() instanceof ModularBauble && this.mRecipeTimeRemaining == -1) {
- if (tUpgrade != null && tBauble != null) {
- removeInputA = true;
- this.setInputStacks(tBauble, tUpgrade);
- try {
- removeInputB = addUpgrade(tUpgrade, tBauble);
- if (!removeInputB) {
- }
- } catch (Throwable t) {
- }
- if (removeInputA && removeInputB) {
- if (this.setOutputStack(tBauble)){
- if (this.inventoryOutputs.getStackInSlot(1).stackSize > 1) {
- ItemStack mTempStack = this.inventoryOutputs.getStackInSlot(1);
- mTempStack.stackSize--;
- this.inventoryOutputs.setInventorySlotContents(1, mTempStack);
- } else {
- this.inventoryOutputs.setInventorySlotContents(1, null);
- }
- this.inventoryOutputs.setInventorySlotContents(0, null);
- this.mRecipeTimeRemaining = 80;
- this.markDirty();
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- public static boolean isValidModularPiece(final ItemStack itemstack){
- if (itemstack.getItem() instanceof ModularBauble){
- return true;
- }
- return false;
- }
-
- public static boolean isValidUpgrade(final ItemStack itemstack) {
- boolean isValid = false;
- if (itemstack != null){
- Iterator<Entry<ItemStack, BT>> it = mValidUpgradeListFormChange.entrySet().iterator();
- while (it.hasNext()) {
- Entry<ItemStack, BT> pair = it.next();
- if (pair.getKey().getItem() == itemstack.getItem()
- && pair.getKey().getItemDamage() == itemstack.getItemDamage()){
- isValid = true;
- }
- }
- Iterator<Entry<ItemStack, Pair<Modifiers, Integer>>> it2 = mValidUpgradeList.entrySet().iterator();
- while (it2.hasNext()) {
- Entry<ItemStack, Pair<Modifiers, Integer>> pair = it2.next();
- if (pair.getKey().getItem() == itemstack.getItem()
- && pair.getKey().getItemDamage() == itemstack.getItemDamage()){
- isValid = true;
- }
- }
- }
- return isValid;
- }
-
-} \ No newline at end of file
+public class TileEntityModularityTable extends TileEntityBase implements ISidedInventory {
+
+ public InventoryModularMain inventoryGrid;
+ public InventoryModularOutput inventoryOutputs;
+ public InventoryModularOutput mTempRecipeStorage;
+ private Container_ModularityTable container;
+ private String customName;
+ private int mRecipeTimeRemaining = -1;
+
+ public TileEntityModularityTable() {
+ super(16);
+ this.inventoryGrid = new InventoryModularMain();
+ this.inventoryOutputs = new InventoryModularOutput();
+ this.mTempRecipeStorage = new InventoryModularOutput();
+ this.canUpdate();
+ generateAllValidUpgrades();
+ }
+
+ public void setContainer(Container_ModularityTable container_ModularityTable) {
+ this.container = container_ModularityTable;
+ }
+
+ public Container_ModularityTable getContainer() {
+ return this.container;
+ }
+
+ public int getRecipeTime() {
+ return this.mRecipeTimeRemaining;
+ }
+
+ @Override
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ nbt.setInteger("mRecipeTime", this.mRecipeTimeRemaining);
+ this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput"));
+ this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid"));
+ this.mTempRecipeStorage.writeToNBT(this.getTag(nbt, "ContentsRecipeTemp"));
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ this.mRecipeTimeRemaining = nbt.getInteger("mRecipeTime");
+ this.inventoryOutputs.readFromNBT(nbt.getCompoundTag("ContentsOutput"));
+ this.inventoryGrid.readFromNBT(nbt.getCompoundTag("ContentsGrid"));
+ this.mTempRecipeStorage.readFromNBT(nbt.getCompoundTag("ContentsRecipeTemp"));
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+ }
+
+ protected ItemStack mOutputStack; // Upgraded Bauble
+ protected ItemStack mInputstackA; // Bauble
+ protected ItemStack mInputstackB; // Upgrade
+
+ public ItemStack getPendingOutputItem() {
+ this.mRecipeTimeRemaining--;
+ return this.mOutputStack;
+ }
+
+ public ItemStack[] getCurrentInputItems() {
+ if (this.mRecipeTimeRemaining < 0) {
+ return null;
+ } else {
+ return new ItemStack[] {this.mInputstackA, this.mInputstackB};
+ }
+ }
+
+ public boolean setInputStacks(ItemStack tBauble, ItemStack tUpgrade) {
+ if (tBauble != null) {
+ this.mInputstackA = tBauble;
+ } else {
+ this.mInputstackA = null;
+ }
+ if (tUpgrade != null) {
+ this.mInputstackB = tBauble;
+ } else {
+ this.mInputstackB = null;
+ }
+ if (this.mInputstackA != null && this.mInputstackB != null) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean setOutputStack(ItemStack mNewBauble) {
+ if (mNewBauble != null) {
+ this.mOutputStack = mNewBauble;
+ return true;
+ } else {
+ this.mOutputStack = null;
+ return false;
+ }
+ }
+
+ public boolean clearRecipeData() {
+ this.mInputstackA = null;
+ this.mInputstackB = null;
+ this.mOutputStack = null;
+ return true;
+ }
+
+ @Override
+ public boolean canUpdate() {
+ return true;
+ }
+
+ public static Map<ItemStack, Pair<Modifiers, Integer>> mValidUpgradeList =
+ new HashMap<ItemStack, Pair<Modifiers, Integer>>();
+ public static Map<ItemStack, BT> mValidUpgradeListFormChange = new HashMap<ItemStack, BT>();
+
+ private static boolean generateAllValidUpgrades() {
+
+ // Form Change
+ generateUpgradeFormData(ItemList.Sensor_MV.get(1), BT.TYPE_RING);
+ generateUpgradeFormData(ItemList.Electric_Piston_MV.get(1), BT.TYPE_BELT);
+ generateUpgradeFormData(ItemList.Emitter_MV.get(1), BT.TYPE_AMULET);
+
+ // Damage Boost
+ generateUpgradeData(ItemList.Electric_Motor_LV.get(1), Modifiers.BOOST_DAMAGE, 1);
+ generateUpgradeData(ItemList.Electric_Motor_MV.get(1), Modifiers.BOOST_DAMAGE, 2);
+ generateUpgradeData(ItemList.Electric_Motor_HV.get(1), Modifiers.BOOST_DAMAGE, 3);
+ generateUpgradeData(ItemList.Electric_Motor_EV.get(1), Modifiers.BOOST_DAMAGE, 4);
+ generateUpgradeData(ItemList.Electric_Motor_IV.get(1), Modifiers.BOOST_DAMAGE, 5);
+
+ // Defence Boost
+ generateUpgradeData(
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateAluminium", 1), Modifiers.BOOST_DEF, 1);
+ generateUpgradeData(
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateStainlessSteel", 1), Modifiers.BOOST_DEF, 2);
+ generateUpgradeData(
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateTungsten", 1), Modifiers.BOOST_DEF, 3);
+ generateUpgradeData(
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateTungstenSteel", 1), Modifiers.BOOST_DEF, 4);
+ generateUpgradeData(
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateNaquadah", 1), Modifiers.BOOST_DEF, 5);
+
+ // Hp Boost
+ generateUpgradeData(ItemUtils.simpleMetaStack(Items.golden_apple, 0, 1), Modifiers.BOOST_HP, 1);
+ generateUpgradeData(ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1), Modifiers.BOOST_HP, 2);
+ generateUpgradeData(ItemUtils.simpleMetaStack(Items.nether_star, 0, 1), Modifiers.BOOST_HP, 3);
+ generateUpgradeData(
+ ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32725", 32725, 1), Modifiers.BOOST_HP, 4);
+ generateUpgradeData(
+ ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32726", 32726, 1), Modifiers.BOOST_HP, 5);
+
+ return true;
+ }
+
+ public static boolean generateUpgradeData(ItemStack tStack, Modifiers tMod, int tLevel) {
+ Pair<Modifiers, Integer> tTemp = new Pair<Modifiers, Integer>(tMod, tLevel);
+ if (mValidUpgradeList.put(tStack, tTemp) != null) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean generateUpgradeFormData(ItemStack tStack, BT tMod) {
+ if (mValidUpgradeListFormChange.put(tStack, tMod) != null) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean addUpgrade(ItemStack tStack, ItemStack tBauble) {
+
+ try {
+ Iterator<Entry<ItemStack, BT>> it =
+ mValidUpgradeListFormChange.entrySet().iterator();
+ while (it.hasNext()) {
+ Entry<ItemStack, BT> pair = it.next();
+ if (pair.getKey().getItem() == tStack.getItem()
+ && pair.getKey().getItemDamage() == tStack.getItemDamage()) {
+ ModularArmourUtils.setBaubleType(tBauble, pair.getValue());
+ tBauble.setItemDamage(ModularArmourUtils.getBaubleTypeID(tBauble));
+ return true;
+ }
+ }
+ } catch (Throwable t) {
+
+ }
+ try {
+ Iterator<Entry<ItemStack, Pair<Modifiers, Integer>>> it2 =
+ mValidUpgradeList.entrySet().iterator();
+ while (it2.hasNext()) {
+ Entry<ItemStack, Pair<Modifiers, Integer>> pair = it2.next();
+ if (pair.getKey().getItem() == tStack.getItem()
+ && pair.getKey().getItemDamage() == tStack.getItemDamage()) {
+ Pair<Modifiers, Integer> newPair = pair.getValue();
+ ModularArmourUtils.setModifierLevel(tBauble, newPair);
+ return true;
+ }
+ }
+ } catch (Throwable t) {
+
+ }
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 11;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int slot) {
+ if (slot >= this.inventoryGrid.getSizeInventory()) {
+ return this.inventoryOutputs.getStackInSlot(slot - 9);
+ } else if (slot < this.inventoryGrid.getSizeInventory()) {
+ return this.inventoryGrid.getStackInSlot(slot);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public ItemStack decrStackSize(int slot, int count) {
+ if (slot < this.inventoryGrid.getSizeInventory()) {
+ return this.inventoryGrid.decrStackSize(slot, count);
+ } else if (slot >= this.inventoryGrid.getSizeInventory()) {
+ return this.inventoryOutputs.decrStackSize(slot - 9, count);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot) {
+ return this.getStackInSlot(slot);
+ }
+
+ @Override
+ public void setInventorySlotContents(int slot, ItemStack stack) {
+ if (slot >= this.inventoryGrid.getSizeInventory()) {
+ this.inventoryOutputs.setInventorySlotContents(slot - 9, stack);
+ } else if (slot < this.inventoryGrid.getSizeInventory()) {
+ this.inventoryGrid.setInventorySlotContents(slot, stack);
+ }
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer entityplayer) {
+ return true;
+ }
+
+ @Override
+ public void openInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.inventoryGrid.openInventory();
+ this.inventoryOutputs.openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.inventoryGrid.openInventory();
+ this.inventoryOutputs.openInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
+ if (slot >= this.inventoryGrid.getSizeInventory()) {
+ return this.inventoryOutputs.isItemValidForSlot(slot - 9, itemstack);
+ } else if (slot < this.inventoryGrid.getSizeInventory()) {
+ return this.inventoryGrid.isItemValidForSlot(slot, itemstack);
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int side) {
+ int[] accessibleSides = new int[this.getSizeInventory()];
+ for (int r = 0; r < this.getSizeInventory(); r++) {
+ accessibleSides[r] = r;
+ }
+ return accessibleSides;
+ }
+
+ @Override
+ public boolean canInsertItem(int slot, ItemStack item, int side) {
+ Logger.INFO("Slot:" + slot + " | side? " + side);
+
+ /*if (side == 1){
+ return this.inventoryOutputs.isItemValidForSlot(slot-9, item);
+ } */
+ if (slot >= 9) {
+ return this.inventoryOutputs.isItemValidForSlot(slot - 9, item);
+ } else {
+ return this.inventoryGrid.isItemValidForSlot(slot, item);
+ }
+ }
+
+ @Override
+ public boolean canExtractItem(int slot, ItemStack item, int side) {
+ Logger.INFO("Slot:" + slot + " | side? " + side);
+ if (slot == 11 || slot <= 8) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ @Override
+ public void setCustomName(String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.fishtrap";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return this.customName != null && !this.customName.equals("");
+ }
+
+ @Override
+ public boolean onPreTick(long aTick) {
+ // Check for active recipe
+ if (this.mRecipeTimeRemaining > -1
+ || (this.mTempRecipeStorage != null) && (this.mTempRecipeStorage.getRecipeTime() > -1)) {
+ if ((this.mTempRecipeStorage != null) && this.mTempRecipeStorage.getRecipeTime() > -1) {
+ if (this.mRecipeTimeRemaining < this.mTempRecipeStorage.getRecipeTime()) {
+ this.mRecipeTimeRemaining = this.mTempRecipeStorage.getRecipeTime();
+ this.markDirty();
+ }
+ }
+ if (this.mInputstackA != null && this.mInputstackB != null && this.mOutputStack != null) {
+ this.mTempRecipeStorage.setInventorySlotContents(0, this.mInputstackA);
+ this.mTempRecipeStorage.setInventorySlotContents(1, this.mInputstackB);
+ this.mTempRecipeStorage.setInventorySlotContents(2, this.mOutputStack);
+ this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining);
+ this.markDirty();
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean onPostTick(long aTick) {
+ if (mRecipeTimeRemaining == 0) {
+ this.inventoryOutputs.setInventorySlotContents(2, this.getPendingOutputItem());
+ clearRecipeData();
+ this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining);
+ this.markDirty();
+ } else if (mRecipeTimeRemaining > 0) {
+ mRecipeTimeRemaining--;
+ this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean processRecipe() {
+ boolean removeInputA = false;
+ boolean removeInputB = false;
+ // Data stick
+ ItemStack tBauble = this.inventoryOutputs.getStackInSlot(0);
+ ItemStack tUpgrade = this.inventoryOutputs.getStackInSlot(1);
+ if (tBauble != null && tUpgrade != null && this.container != null) {
+ if (tBauble.getItem() instanceof ModularBauble && this.mRecipeTimeRemaining == -1) {
+ if (tUpgrade != null && tBauble != null) {
+ removeInputA = true;
+ this.setInputStacks(tBauble, tUpgrade);
+ try {
+ removeInputB = addUpgrade(tUpgrade, tBauble);
+ if (!removeInputB) {}
+ } catch (Throwable t) {
+ }
+ if (removeInputA && removeInputB) {
+ if (this.setOutputStack(tBauble)) {
+ if (this.inventoryOutputs.getStackInSlot(1).stackSize > 1) {
+ ItemStack mTempStack = this.inventoryOutputs.getStackInSlot(1);
+ mTempStack.stackSize--;
+ this.inventoryOutputs.setInventorySlotContents(1, mTempStack);
+ } else {
+ this.inventoryOutputs.setInventorySlotContents(1, null);
+ }
+ this.inventoryOutputs.setInventorySlotContents(0, null);
+ this.mRecipeTimeRemaining = 80;
+ this.markDirty();
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean isValidModularPiece(final ItemStack itemstack) {
+ if (itemstack.getItem() instanceof ModularBauble) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isValidUpgrade(final ItemStack itemstack) {
+ boolean isValid = false;
+ if (itemstack != null) {
+ Iterator<Entry<ItemStack, BT>> it =
+ mValidUpgradeListFormChange.entrySet().iterator();
+ while (it.hasNext()) {
+ Entry<ItemStack, BT> pair = it.next();
+ if (pair.getKey().getItem() == itemstack.getItem()
+ && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
+ isValid = true;
+ }
+ }
+ Iterator<Entry<ItemStack, Pair<Modifiers, Integer>>> it2 =
+ mValidUpgradeList.entrySet().iterator();
+ while (it2.hasNext()) {
+ Entry<ItemStack, Pair<Modifiers, Integer>> pair = it2.next();
+ if (pair.getKey().getItem() == itemstack.getItem()
+ && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
+ isValid = true;
+ }
+ }
+ }
+ return isValid;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java
index a16a9e91a7..df50bd98a9 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.tileentities.machines;
-import java.util.ArrayList;
-import java.util.List;
-
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.BTF_FluidTank;
@@ -14,6 +11,8 @@ import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.player.EntityPlayer;
@@ -38,468 +37,462 @@ import net.minecraftforge.oredict.OreDictionary;
public class TileEntityPestKiller extends TileEntity implements ISidedInventory, IFluidHandler {
- private final int mBaseTickRate = 20 * 30;
- private final InventoryPestKiller mInventory;
- private final FluidTank mTank;
- private int mChunkX;
- private int mChunkZ;
- private boolean mSet = false;
-
- private int mTickCounter = 0;
- private int mUpdateTick = 0;
- private boolean mNeedsUpdate = false;
- private String mCustomName;
-
- private static final AutoMap<Class<?>> mEntityMap = new AutoMap<Class<?>>();
-
- static {
- mEntityMap.put(EntityBat.class);
- if (LoadedMods.Forestry) {
- mEntityMap.put(ReflectionUtils.getClass("forestry.lepidopterology.entities.EntityButterfly"));
- }
- }
-
- public TileEntityPestKiller() {
- this.mInventory = new InventoryPestKiller();
- mTank = new BTF_FluidTank(2000);
- }
-
- public InventoryPestKiller getInventory() {
- return this.mInventory;
- }
-
- public FluidTank getTank() {
- return mTank;
- }
-
- private final void setup() {
- World w = this.worldObj;
- if (w != null) {
- Chunk c = w.getChunkFromBlockCoords(this.xCoord, this.zCoord);
- if (c != null) {
- mChunkX = c.xPosition;
- mChunkZ = c.zPosition;
- mSet = true;
- }
- }
- }
-
- @SuppressWarnings("rawtypes")
- public boolean tryKillPests() {
- int min = 0;
- int max = 0;
- switch (getTier()) {
- case 1:
- min = -2;
- max = 3;
- break;
- case 2:
- min = -4;
- max = 5;
- break;
- default:
- // code block
- }
- int aChunkCount = 0;
- AutoMap<Entity> entities = new AutoMap<Entity>();
- if (min != 0 && max != 0) {
- for (int x = min; x < max; x++) {
- for (int z = min; z < max; z++) {
- Chunk c = getChunkFromOffsetIfLoaded(x, z);
- if (c != null) {
- if (c.hasEntities) {
- aChunkCount++;
- List[] lists = c.entityLists;
- for (List o : lists) {
- for (Object e : o) {
- if (e instanceof Entity) {
- for (Class<?> C : mEntityMap) {
- if (e.getClass().equals(C) || C.isAssignableFrom(e.getClass())) {
- entities.put((Entity) e);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } else {
- Chunk c = getChunkFromOffsetIfLoaded(0, 0);
- if (c != null) {
- if (c.hasEntities) {
- List[] lists = c.entityLists;
- for (List o : lists) {
- for (Object e : o) {
- if (e instanceof Entity) {
- for (Class<?> C : mEntityMap) {
- if (e.getClass().equals(C) || C.isAssignableFrom(e.getClass())) {
- entities.put((Entity) e);
- }
- }
- }
- }
- }
- }
- }
- }
- boolean killed = false;
- if (!entities.isEmpty()) {
- for (Entity e : entities) {
- if (e != null) {
- if (e.isEntityAlive()) {
- if (this.mTank.getFluidAmount() >= 1 || getTier() == 0) {
- if (getTier() > 0) {
- int aChanceToUse = MathUtils.randInt(1, (100 * getTier()));
- if (aChanceToUse == 1) {
- this.mTank.drain(1, true);
- }
- }
- EntityUtils.doDamage(e, DamageSource.generic, Short.MAX_VALUE);
- e.setDead();
- killed = true;
- }
- }
- }
- }
- }
- updateTileEntity();
- return killed;
- }
-
- public Chunk getChunkFromOffsetIfLoaded(int x, int y) {
- Chunk c = this.worldObj.getChunkFromChunkCoords(mChunkX + x, mChunkZ + y);
- if (c.isChunkLoaded) {
- return c;
- }
- return null;
- }
-
- public int getTier() {
- if (this.mTank != null) {
- FluidStack f = mTank.getFluid();
- if (f != null) {
- if (f.isFluidEqual(FluidUtils.getWildcardFluidStack("formaldehyde", 1))) {
- return 1;
- } else if (f.isFluidEqual(MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1))) {
- return 2;
- }
- }
- }
- return 0;
- }
-
- @Override
- public void updateEntity() {
- if (worldObj.isRemote) {
- return;
- }
- if (!mSet) {
- setup();
- }
- this.mTickCounter++;
- if (this.mTank != null) {
- if (this.hasFluidSpace()) {
- handleInventory();
- }
- }
- if (this.mTickCounter % this.mBaseTickRate == 0) {
- tryKillPests();
- }
- updateTick();
- }
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- mTank.writeToNBT(nbt);
- super.writeToNBT(nbt);
- // Utils.LOG_MACHINE_INFO("Trying to write NBT data to TE.");
- final NBTTagCompound chestData = new NBTTagCompound();
- this.mInventory.writeToNBT(chestData);
- nbt.setTag("ContentsChest", chestData);
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- mTank.readFromNBT(nbt);
- super.readFromNBT(nbt);
- // Utils.LOG_MACHINE_INFO("Trying to read NBT data from TE.");
- this.mInventory.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- }
-
- @Override
- public int getSizeInventory() {
- return this.getInventory().getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.getInventory().getStackInSlot(slot);
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int count) {
- return this.getInventory().decrStackSize(slot, count);
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- return this.getInventory().getStackInSlotOnClosing(slot);
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.getInventory().setInventorySlotContents(slot, stack);
- }
-
- @Override
- public int getInventoryStackLimit() {
- return this.getInventory().getInventoryStackLimit();
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return this.getInventory().isUseableByPlayer(entityplayer);
- }
-
- @Override
- public void openInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().openInventory();
- }
-
- @Override
- public void closeInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().closeInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return this.getInventory().isItemValidForSlot(slot, itemstack);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- final int[] accessibleSides = new int[this.getSizeInventory()];
- for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
- accessibleSides[r] = r;
- }
- return accessibleSides;
-
- }
-
- @Override
- public boolean canInsertItem(final int aSlot, final ItemStack aStack, final int p_102007_3_) {
- if (this.getInventory().getInventory()[0] == null) {
- return true;
- } else if (GT_Utility.areStacksEqual(aStack, this.getInventory().getInventory()[0])) {
- if (this.getInventory().getInventory()[0].stackSize < 64) {
- int diff = 64 - this.getInventory().getInventory()[0].stackSize;
- if (aStack.stackSize <= diff) {
- return true;
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean canExtractItem(final int aSlot, final ItemStack aStack, final int p_102008_3_) {
- if (this.getInventory().getInventory()[1] == null) {
- return false;
- } else {
- return true;
- }
- }
-
- public String getCustomName() {
- return this.mCustomName;
- }
-
- public void setCustomName(final String customName) {
- this.mCustomName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.mCustomName : "container.pestkiller";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return (this.mCustomName != null) && !this.mCustomName.equals("");
- }
-
- @Override
- public final int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
- updateTileEntity();
- return this.mTank.fill(resource, doFill);
- }
-
- @Override
- public final FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
- updateTileEntity();
- return this.mTank.drain(resource.amount, doDrain);
- }
-
- @Override
- public final FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
- FluidStack fluid = this.mTank.getFluid();
- // return this.tank.drain(maxDrain, doDrain);
- if (fluid == null) {
- return null;
- }
-
- int drained = maxDrain;
- if (fluid.amount < drained) {
- drained = fluid.amount;
- }
-
- FluidStack stack = new FluidStack(fluid, drained);
- if (doDrain) {
- fluid.amount -= drained;
- if (fluid.amount <= 0) {
- fluid = null;
- }
-
- if (this != null) {
- FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, this.getWorldObj(), this.xCoord,
- this.yCoord, this.zCoord, this.mTank, 0));
- }
- }
- updateTileEntity();
- return stack;
- }
-
- @Override
- public boolean canFill(ForgeDirection from, Fluid fluid) {
- return mTank.getFluid() == null || mTank.getFluid().getFluid().equals(fluid);
- }
-
- @Override
- public boolean canDrain(ForgeDirection from, Fluid fluid) {
- return false;
- }
-
- @Override
- public final FluidTankInfo[] getTankInfo(ForgeDirection from) {
- return new FluidTankInfo[] { this.mTank.getInfo() };
- }
-
- @Override
- public final Packet getDescriptionPacket() {
- NBTTagCompound tag = new NBTTagCompound();
- writeToNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
- }
-
- @Override
- public final void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
- NBTTagCompound tag = pkt.func_148857_g();
- readFromNBT(tag);
- }
-
-
- public boolean hasFluidSpace() {
- if (this.mTank.getFluidAmount() <= 1000) {
- return true;
- }
- return false;
- }
-
- public boolean drainCell() {
- boolean didFill = false;
- ItemStack aInput = this.getStackInSlot(0);
- if (aInput == null) {
- return false;
- }
- aInput = aInput.copy();
- if (aInput != null && (this.getStackInSlot(1) == null || this.getStackInSlot(1).stackSize < 64)) {
- ArrayList<ItemStack> t1Cells = OreDictionary.getOres("cellFormaldehyde");
- ArrayList<ItemStack> t2Cells = OreDictionary.getOres("cellHydrogenCyanide");
- didFill = addFluid(t1Cells, aInput, FluidUtils.getWildcardFluidStack("formaldehyde", 1000));
- if (!didFill) {
- didFill = addFluid(t2Cells, aInput, MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1000));
- }
- }
-
- return didFill;
- }
-
- public boolean handleInventory() {
- if (this.getInventory() != null && drainCell()) {
- this.decrStackSize(0, 1);
- if (this.getStackInSlot(1) == null) {
- this.setInventorySlotContents(1, CI.emptyCells(1));
- } else {
- this.getStackInSlot(1).stackSize++;
- }
- this.updateTileEntity();
- return true;
- } else {
- return false;
- }
- }
-
- public boolean addFluid(ArrayList<ItemStack> inputs, ItemStack aInput, FluidStack aFluidForInput) {
- for (ItemStack a : inputs) {
- if (GT_Utility.areStacksEqual(a, aInput)) {
- if (mTank.getFluid() == null || mTank.getFluid()
- .isFluidEqual(aFluidForInput)) {
- boolean didFill = fill(ForgeDirection.UNKNOWN, aFluidForInput, true) > 0;
- return didFill;
- }
- } else {
- continue;
- }
- }
- return false;
- }
-
- public void updateTileEntity() {
- this.getInventory().markDirty();
- this.markDirty();
- this.mNeedsUpdate = true;
- }
-
- private final void updateTick() {
- if (mNeedsUpdate) {
- if (mUpdateTick == 0) {
- mUpdateTick = 4; // every 4 ticks it will send an update
- } else {
- --mUpdateTick;
- if (mUpdateTick == 0) {
- markDirty();
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- mNeedsUpdate = false;
- }
- }
- }
- }
-
-
-
+ private final int mBaseTickRate = 20 * 30;
+ private final InventoryPestKiller mInventory;
+ private final FluidTank mTank;
+ private int mChunkX;
+ private int mChunkZ;
+ private boolean mSet = false;
+
+ private int mTickCounter = 0;
+ private int mUpdateTick = 0;
+ private boolean mNeedsUpdate = false;
+ private String mCustomName;
+
+ private static final AutoMap<Class<?>> mEntityMap = new AutoMap<Class<?>>();
+
+ static {
+ mEntityMap.put(EntityBat.class);
+ if (LoadedMods.Forestry) {
+ mEntityMap.put(ReflectionUtils.getClass("forestry.lepidopterology.entities.EntityButterfly"));
+ }
+ }
+
+ public TileEntityPestKiller() {
+ this.mInventory = new InventoryPestKiller();
+ mTank = new BTF_FluidTank(2000);
+ }
+
+ public InventoryPestKiller getInventory() {
+ return this.mInventory;
+ }
+
+ public FluidTank getTank() {
+ return mTank;
+ }
+
+ private final void setup() {
+ World w = this.worldObj;
+ if (w != null) {
+ Chunk c = w.getChunkFromBlockCoords(this.xCoord, this.zCoord);
+ if (c != null) {
+ mChunkX = c.xPosition;
+ mChunkZ = c.zPosition;
+ mSet = true;
+ }
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ public boolean tryKillPests() {
+ int min = 0;
+ int max = 0;
+ switch (getTier()) {
+ case 1:
+ min = -2;
+ max = 3;
+ break;
+ case 2:
+ min = -4;
+ max = 5;
+ break;
+ default:
+ // code block
+ }
+ int aChunkCount = 0;
+ AutoMap<Entity> entities = new AutoMap<Entity>();
+ if (min != 0 && max != 0) {
+ for (int x = min; x < max; x++) {
+ for (int z = min; z < max; z++) {
+ Chunk c = getChunkFromOffsetIfLoaded(x, z);
+ if (c != null) {
+ if (c.hasEntities) {
+ aChunkCount++;
+ List[] lists = c.entityLists;
+ for (List o : lists) {
+ for (Object e : o) {
+ if (e instanceof Entity) {
+ for (Class<?> C : mEntityMap) {
+ if (e.getClass().equals(C) || C.isAssignableFrom(e.getClass())) {
+ entities.put((Entity) e);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ Chunk c = getChunkFromOffsetIfLoaded(0, 0);
+ if (c != null) {
+ if (c.hasEntities) {
+ List[] lists = c.entityLists;
+ for (List o : lists) {
+ for (Object e : o) {
+ if (e instanceof Entity) {
+ for (Class<?> C : mEntityMap) {
+ if (e.getClass().equals(C) || C.isAssignableFrom(e.getClass())) {
+ entities.put((Entity) e);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ boolean killed = false;
+ if (!entities.isEmpty()) {
+ for (Entity e : entities) {
+ if (e != null) {
+ if (e.isEntityAlive()) {
+ if (this.mTank.getFluidAmount() >= 1 || getTier() == 0) {
+ if (getTier() > 0) {
+ int aChanceToUse = MathUtils.randInt(1, (100 * getTier()));
+ if (aChanceToUse == 1) {
+ this.mTank.drain(1, true);
+ }
+ }
+ EntityUtils.doDamage(e, DamageSource.generic, Short.MAX_VALUE);
+ e.setDead();
+ killed = true;
+ }
+ }
+ }
+ }
+ }
+ updateTileEntity();
+ return killed;
+ }
+
+ public Chunk getChunkFromOffsetIfLoaded(int x, int y) {
+ Chunk c = this.worldObj.getChunkFromChunkCoords(mChunkX + x, mChunkZ + y);
+ if (c.isChunkLoaded) {
+ return c;
+ }
+ return null;
+ }
+
+ public int getTier() {
+ if (this.mTank != null) {
+ FluidStack f = mTank.getFluid();
+ if (f != null) {
+ if (f.isFluidEqual(FluidUtils.getWildcardFluidStack("formaldehyde", 1))) {
+ return 1;
+ } else if (f.isFluidEqual(MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1))) {
+ return 2;
+ }
+ }
+ }
+ return 0;
+ }
+
+ @Override
+ public void updateEntity() {
+ if (worldObj.isRemote) {
+ return;
+ }
+ if (!mSet) {
+ setup();
+ }
+ this.mTickCounter++;
+ if (this.mTank != null) {
+ if (this.hasFluidSpace()) {
+ handleInventory();
+ }
+ }
+ if (this.mTickCounter % this.mBaseTickRate == 0) {
+ tryKillPests();
+ }
+ updateTick();
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ mTank.writeToNBT(nbt);
+ super.writeToNBT(nbt);
+ // Utils.LOG_MACHINE_INFO("Trying to write NBT data to TE.");
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.mInventory.writeToNBT(chestData);
+ nbt.setTag("ContentsChest", chestData);
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ mTank.readFromNBT(nbt);
+ super.readFromNBT(nbt);
+ // Utils.LOG_MACHINE_INFO("Trying to read NBT data from TE.");
+ this.mInventory.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return this.getInventory().getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot) {
+ return this.getInventory().getStackInSlot(slot);
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int count) {
+ return this.getInventory().decrStackSize(slot, count);
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot) {
+ return this.getInventory().getStackInSlotOnClosing(slot);
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
+ this.getInventory().setInventorySlotContents(slot, stack);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return this.getInventory().getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return this.getInventory().isUseableByPlayer(entityplayer);
+ }
+
+ @Override
+ public void openInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ this.getInventory().closeInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return this.getInventory().isItemValidForSlot(slot, itemstack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ final int[] accessibleSides = new int[this.getSizeInventory()];
+ for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
+ accessibleSides[r] = r;
+ }
+ return accessibleSides;
+ }
+
+ @Override
+ public boolean canInsertItem(final int aSlot, final ItemStack aStack, final int p_102007_3_) {
+ if (this.getInventory().getInventory()[0] == null) {
+ return true;
+ } else if (GT_Utility.areStacksEqual(aStack, this.getInventory().getInventory()[0])) {
+ if (this.getInventory().getInventory()[0].stackSize < 64) {
+ int diff = 64 - this.getInventory().getInventory()[0].stackSize;
+ if (aStack.stackSize <= diff) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(final int aSlot, final ItemStack aStack, final int p_102008_3_) {
+ if (this.getInventory().getInventory()[1] == null) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ public String getCustomName() {
+ return this.mCustomName;
+ }
+
+ public void setCustomName(final String customName) {
+ this.mCustomName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.mCustomName : "container.pestkiller";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.mCustomName != null) && !this.mCustomName.equals("");
+ }
+
+ @Override
+ public final int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
+ updateTileEntity();
+ return this.mTank.fill(resource, doFill);
+ }
+
+ @Override
+ public final FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
+ updateTileEntity();
+ return this.mTank.drain(resource.amount, doDrain);
+ }
+
+ @Override
+ public final FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
+ FluidStack fluid = this.mTank.getFluid();
+ // return this.tank.drain(maxDrain, doDrain);
+ if (fluid == null) {
+ return null;
+ }
+
+ int drained = maxDrain;
+ if (fluid.amount < drained) {
+ drained = fluid.amount;
+ }
+
+ FluidStack stack = new FluidStack(fluid, drained);
+ if (doDrain) {
+ fluid.amount -= drained;
+ if (fluid.amount <= 0) {
+ fluid = null;
+ }
+
+ if (this != null) {
+ FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(
+ fluid, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this.mTank, 0));
+ }
+ }
+ updateTileEntity();
+ return stack;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection from, Fluid fluid) {
+ return mTank.getFluid() == null || mTank.getFluid().getFluid().equals(fluid);
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection from, Fluid fluid) {
+ return false;
+ }
+
+ @Override
+ public final FluidTankInfo[] getTankInfo(ForgeDirection from) {
+ return new FluidTankInfo[] {this.mTank.getInfo()};
+ }
+
+ @Override
+ public final Packet getDescriptionPacket() {
+ NBTTagCompound tag = new NBTTagCompound();
+ writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
+ }
+
+ @Override
+ public final void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
+ NBTTagCompound tag = pkt.func_148857_g();
+ readFromNBT(tag);
+ }
+
+ public boolean hasFluidSpace() {
+ if (this.mTank.getFluidAmount() <= 1000) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean drainCell() {
+ boolean didFill = false;
+ ItemStack aInput = this.getStackInSlot(0);
+ if (aInput == null) {
+ return false;
+ }
+ aInput = aInput.copy();
+ if (aInput != null && (this.getStackInSlot(1) == null || this.getStackInSlot(1).stackSize < 64)) {
+ ArrayList<ItemStack> t1Cells = OreDictionary.getOres("cellFormaldehyde");
+ ArrayList<ItemStack> t2Cells = OreDictionary.getOres("cellHydrogenCyanide");
+ didFill = addFluid(t1Cells, aInput, FluidUtils.getWildcardFluidStack("formaldehyde", 1000));
+ if (!didFill) {
+ didFill = addFluid(t2Cells, aInput, MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1000));
+ }
+ }
+
+ return didFill;
+ }
+
+ public boolean handleInventory() {
+ if (this.getInventory() != null && drainCell()) {
+ this.decrStackSize(0, 1);
+ if (this.getStackInSlot(1) == null) {
+ this.setInventorySlotContents(1, CI.emptyCells(1));
+ } else {
+ this.getStackInSlot(1).stackSize++;
+ }
+ this.updateTileEntity();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean addFluid(ArrayList<ItemStack> inputs, ItemStack aInput, FluidStack aFluidForInput) {
+ for (ItemStack a : inputs) {
+ if (GT_Utility.areStacksEqual(a, aInput)) {
+ if (mTank.getFluid() == null || mTank.getFluid().isFluidEqual(aFluidForInput)) {
+ boolean didFill = fill(ForgeDirection.UNKNOWN, aFluidForInput, true) > 0;
+ return didFill;
+ }
+ } else {
+ continue;
+ }
+ }
+ return false;
+ }
+
+ public void updateTileEntity() {
+ this.getInventory().markDirty();
+ this.markDirty();
+ this.mNeedsUpdate = true;
+ }
+
+ private final void updateTick() {
+ if (mNeedsUpdate) {
+ if (mUpdateTick == 0) {
+ mUpdateTick = 4; // every 4 ticks it will send an update
+ } else {
+ --mUpdateTick;
+ if (mUpdateTick == 0) {
+ markDirty();
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ mNeedsUpdate = false;
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java
index 25348a31f8..4087472ce3 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java
@@ -17,131 +17,109 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
public class TileEntityPooCollector extends TileEntityBaseFluidCollector {
-
- public TileEntityPooCollector() {
- super(9, 8000);
- }
+ public TileEntityPooCollector() {
+ super(9, 8000);
+ }
- @Override
- public boolean canFill(ForgeDirection from, Fluid fluid) {
- return false;
- }
+ @Override
+ public boolean canFill(ForgeDirection from, Fluid fluid) {
+ return false;
+ }
- @Override
- public boolean canDrain(ForgeDirection from, Fluid fluid) {
- return true;
- }
-
- public void onPreLogicTick() {
-
- }
-
- public <V> boolean addDrop(V aPooMaker) {
- int aChance = MathUtils.randInt(0, 50000);
- if (aChance > 0) {
- ItemStack aPoop;
- if (aChance<= 100) {
- aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustManureByproducts", 1);
- }
- else if (aChance <= 500) {
- aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
- }
- else if (aChance <= 1250) {
- aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyManureByproducts", 1);
- }
- else {
- return false;
- }
- if (!ItemUtils.checkForInvalidItems(aPoop)) {
- return false;
- }
-
- //Add poop to world
- //Logger.INFO("Adding animal waste for "+aPooMaker.getCommandSenderName());
-
- //Add to inventory if not full, else espawn in world
- if (!this.mInventory.addItemStack(aPoop)) {
- EntityItem entity = new EntityItem(worldObj, xCoord, yCoord+1.5, zCoord, aPoop);
- worldObj.spawnEntityInWorld(entity);
- }
-
- }
-
-
- return false;
- }
+ @Override
+ public boolean canDrain(ForgeDirection from, Fluid fluid) {
+ return true;
+ }
- private static AutoMap<Class> aEntityToDrain = new AutoMap<Class>();
-
- @Override
- public AutoMap<Class> aThingsToLookFor() {
- if (aEntityToDrain.isEmpty()) {
- aEntityToDrain.add(EntityAnimal.class);
- aEntityToDrain.add(IAnimals.class);
- }
- return aEntityToDrain;
- }
+ public void onPreLogicTick() {}
- @Override
- public <V> int onPostTick(V aPooMaker) {
- if (this.tank.getFluidAmount() < this.tank.getCapacity()) {
- int aPooAmount = 0;
- // Vanilla Animals
- if (aPooMaker instanceof EntityChicken) {
- aPooAmount = MathUtils.randInt(1, 40);
- }
- else if (aPooMaker instanceof EntityHorse) {
- aPooAmount = MathUtils.randInt(20, 40);
- }
- else if (aPooMaker instanceof EntityCow) {
- aPooAmount = MathUtils.randInt(18, 45);
- }
- else if (aPooMaker instanceof EntityMooshroom) {
- aPooAmount = 17;
- }
- else if (aPooMaker instanceof EntitySheep) {
- aPooAmount = MathUtils.randInt(8, 30);
- }
-
- else {
- if (aPooMaker instanceof EntityAnimal || aPooMaker instanceof IAnimals) {
- aPooAmount = MathUtils.randInt(5, 35);
- }
- else {
- aPooAmount = MathUtils.randInt(1, 10);
- }
- }
- aPooAmount = Math.max((Math.min(this.tank.getCapacity()-this.tank.getFluidAmount(), aPooAmount)/10), 1);
- return aPooAmount;
- }
- else {
- return 0;
- }
- }
+ public <V> boolean addDrop(V aPooMaker) {
+ int aChance = MathUtils.randInt(0, 50000);
+ if (aChance > 0) {
+ ItemStack aPoop;
+ if (aChance <= 100) {
+ aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustManureByproducts", 1);
+ } else if (aChance <= 500) {
+ aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
+ } else if (aChance <= 1250) {
+ aPoop = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyManureByproducts", 1);
+ } else {
+ return false;
+ }
+ if (!ItemUtils.checkForInvalidItems(aPoop)) {
+ return false;
+ }
- @Override
- public Fluid fluidToProvide() {
- return AgriculturalChem.PoopJuice;
- }
+ // Add poop to world
+ // Logger.INFO("Adding animal waste for "+aPooMaker.getCommandSenderName());
- @Override
- public ItemStack itemToSpawnInWorldIfTankIsFull() {
- int a = MathUtils.randInt(0, 100);
- ItemStack aItem = null;
- if (a <= 30) {
- aItem = ItemUtils.getSimpleStack(AgriculturalChem.dustDirt);
- }
- else if (a <= 40) {
- aItem = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
- }
- else if (a <= 55) {
- aItem = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyManureByproducts", 1);
- }
- return aItem;
- }
-
-
-
+ // Add to inventory if not full, else espawn in world
+ if (!this.mInventory.addItemStack(aPoop)) {
+ EntityItem entity = new EntityItem(worldObj, xCoord, yCoord + 1.5, zCoord, aPoop);
+ worldObj.spawnEntityInWorld(entity);
+ }
+ }
+ return false;
+ }
+
+ private static AutoMap<Class> aEntityToDrain = new AutoMap<Class>();
+
+ @Override
+ public AutoMap<Class> aThingsToLookFor() {
+ if (aEntityToDrain.isEmpty()) {
+ aEntityToDrain.add(EntityAnimal.class);
+ aEntityToDrain.add(IAnimals.class);
+ }
+ return aEntityToDrain;
+ }
+
+ @Override
+ public <V> int onPostTick(V aPooMaker) {
+ if (this.tank.getFluidAmount() < this.tank.getCapacity()) {
+ int aPooAmount = 0;
+ // Vanilla Animals
+ if (aPooMaker instanceof EntityChicken) {
+ aPooAmount = MathUtils.randInt(1, 40);
+ } else if (aPooMaker instanceof EntityHorse) {
+ aPooAmount = MathUtils.randInt(20, 40);
+ } else if (aPooMaker instanceof EntityCow) {
+ aPooAmount = MathUtils.randInt(18, 45);
+ } else if (aPooMaker instanceof EntityMooshroom) {
+ aPooAmount = 17;
+ } else if (aPooMaker instanceof EntitySheep) {
+ aPooAmount = MathUtils.randInt(8, 30);
+ } else {
+ if (aPooMaker instanceof EntityAnimal || aPooMaker instanceof IAnimals) {
+ aPooAmount = MathUtils.randInt(5, 35);
+ } else {
+ aPooAmount = MathUtils.randInt(1, 10);
+ }
+ }
+ aPooAmount = Math.max((Math.min(this.tank.getCapacity() - this.tank.getFluidAmount(), aPooAmount) / 10), 1);
+ return aPooAmount;
+ } else {
+ return 0;
+ }
+ }
+
+ @Override
+ public Fluid fluidToProvide() {
+ return AgriculturalChem.PoopJuice;
+ }
+
+ @Override
+ public ItemStack itemToSpawnInWorldIfTankIsFull() {
+ int a = MathUtils.randInt(0, 100);
+ ItemStack aItem = null;
+ if (a <= 30) {
+ aItem = ItemUtils.getSimpleStack(AgriculturalChem.dustDirt);
+ } else if (a <= 40) {
+ aItem = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallManureByproducts", 1);
+ } else if (a <= 55) {
+ aItem = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyManureByproducts", 1);
+ }
+ return aItem;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java
index 8c87baf6a9..0ca1b24ef4 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java
@@ -1,19 +1,7 @@
package gtPlusPlus.core.tileentities.machines;
-import java.util.List;
-import java.util.Vector;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.InventoryCrafting;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-
import gregtech.api.enums.ItemList;
import gregtech.common.items.GT_MetaGenerated_Item_01;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.container.Container_ProjectTable;
import gtPlusPlus.core.inventories.projecttable.InventoryProjectMain;
@@ -30,259 +18,295 @@ import ic2.api.network.INetworkDataProvider;
import ic2.api.network.INetworkUpdateListener;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
+import java.util.List;
+import java.util.Vector;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.InventoryCrafting;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
-public class TileEntityProjectTable extends TileEntity implements INetworkDataProvider, INetworkUpdateListener, IWrenchable{
-
- public InventoryProjectMain inventoryGrid;
- public InventoryProjectOutput inventoryOutputs;
-
- /** The crafting matrix inventory (3x3). */
- public InventoryCrafting craftMatrix;
- public IInventory craftResult;
- private Container_ProjectTable container;
-
- public TileEntityProjectTable(){
- this.inventoryGrid = new InventoryProjectMain();//number of slots - without product slot
- this.inventoryOutputs = new InventoryProjectOutput();//number of slots - without product slot
- this.canUpdate();
- }
-
- public void setContainer(Container_ProjectTable container){
- this.container = container;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag){
- if(!nbt.hasKey(tag))
- {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt){
- super.writeToNBT(nbt);
- nbt.setShort("facing", this.facing);
- this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid"));
- this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput"));
-
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt){
- super.readFromNBT(nbt);
- this.prevFacing = (this.facing = nbt.getShort("facing"));
- this.inventoryGrid.readFromNBT(nbt.getCompoundTag("ContentsGrid"));
- this.inventoryOutputs.readFromNBT(nbt.getCompoundTag("ContentsOutput"));
- }
-
- @Override
- public List<String> getNetworkedFields(){
- final List<String> ret = new Vector(2);
- ret.add("facing");
- return ret;
- }
-
-
- @Override
- public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side){
- return false;
- }
-
- private short facing = 0;
- public short prevFacing = 0;
-
- @Override
- public void setFacing(final short facing1){
- this.facing = facing1;
- if (this.prevFacing != facing1) {
- IC2.network.get().updateTileEntityField(this, "facing");
- }
- this.prevFacing = facing1;
- }
-
- @Override
- public short getFacing(){
- return this.facing;
- }
-
-
- @Override
- public boolean wrenchCanRemove(final EntityPlayer entityPlayer){
- return true;
- }
-
- @Override
- public float getWrenchDropRate(){
- return 1.0F;
- }
-
- @Override
- public ItemStack getWrenchDrop(final EntityPlayer entityPlayer){
- return new ItemStack(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), 1, this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord));
- }
-
- @Override
- public void onNetworkUpdate(final String field) {
- this.prevFacing = this.facing;
-
- }
-
- @Override
- public void updateEntity() {
- if (!this.worldObj.isRemote){
- //Data stick
- ItemStack dataStick = this.inventoryOutputs.getStackInSlot(0);
- if (dataStick != null && this.container != null && container.getOutputContent() != null){
- if ((dataStick.getItem() instanceof GT_MetaGenerated_Item_01 && dataStick.getItemDamage() == 32708)
- || (dataStick == ItemList.Tool_DataStick.get(1))
- || (dataStick == GregtechItemList.Old_Tool_DataStick.get(1))
- || (dataStick.getItem() instanceof MetaGeneratedGregtechItems && dataStick.getItemDamage() == 32208)){
-
- Logger.INFO("Found Data Stick and valid container.");
-
-
- ItemStack outputComponent = container.getOutputContent();
- ItemStack[] craftInputComponent = container.getInputComponents();
-
-
- ItemStack newStick = NBTUtils.writeItemsToNBT(dataStick, new ItemStack[]{outputComponent}, "Output");
- newStick = NBTUtils.writeItemsToNBT(newStick, craftInputComponent);
- NBTUtils.setBookTitle(newStick, "Encrypted Project Data");
- NBTUtils.setBoolean(newStick, "mEncrypted", true);
- int slotm=0;
- Logger.WARNING("Uploading to Data Stick.");
- for (ItemStack is : NBTUtils.readItemsFromNBT(newStick)){
- if (is != null){
- Logger.WARNING("Uploaded "+is.getDisplayName()+" into memory slot "+slotm+".");
- }
- else {
- Logger.WARNING("Left memory slot "+slotm+" blank.");
- }
- slotm++;
- }
- Logger.WARNING("Encrypting Data Stick.");
- this.inventoryOutputs.setInventorySlotContents(1, newStick);
- this.inventoryOutputs.setInventorySlotContents(0, null);
- }
- }
-
- //Utils.LOG_INFO("Doing thing 1");
- if (dataStick != null)
- if (dataStick.getItem() instanceof ModularBauble){
- Logger.INFO("Doing thing 2");
- ItemStack tBauble = dataStick;
- dataStick = null;
- this.inventoryOutputs.setInventorySlotContents(0, dataStick);
- if (this.inventoryGrid != null){
- Logger.INFO("Doing things");
- ItemStack[] tStack = container.getInputComponents();
- if (tStack != null){
- //Utils.LOG_INFO(""+tStack.length);
- if (tBauble != null){
- for (int i=0;i<tStack.length;i++){
-
- ItemStack testStack;
- if ((testStack = container.inventoryGrid.getStackInSlot(i)) != null){
- Logger.INFO("FOUND: "+testStack.getDisplayName());
- }
-
- if (tStack[i] != null){
- Logger.INFO("found "+tStack[i].getDisplayName());
- try {
- if (tStack[i].getItem() == Items.feather){
- ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_BELT);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
- if (tStack[i].getItem() == Items.bed){
- ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_RING);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
- if (tStack[i].getItem() == Items.boat){
- ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_AMULET);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
-
- if (tStack[i].getItem() == Items.egg){
- ModularArmourUtils.setModifierLevel(tBauble, Modifiers.BOOST_HOLY, ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_HOLY)+1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
-
- if (tStack[i].getItem() == Items.baked_potato){
- ModularArmourUtils.setModifierLevel(tBauble, Modifiers.BOOST_DEF, ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DEF)+1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
-
- if (tStack[i].getItem() == Items.cooked_beef){
- ModularArmourUtils.setModifierLevel(tBauble, Modifiers.BOOST_HP, ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_HP)+1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
-
- if (tStack[i] == ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:17019", 17019, 1)){
- ModularArmourUtils.setModifierLevel(tBauble, Modifiers.BOOST_DEF, ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DEF)+1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- }
- if (tStack[i] == ItemList.Electric_Motor_LV.get(1)){
- ModularArmourUtils.setModifierLevel(tBauble, Modifiers.BOOST_DAMAGE, ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DAMAGE)+1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- }
- else if (tStack[i] == ItemList.Electric_Motor_MV.get(1)){
- ModularArmourUtils.setModifierLevel(tBauble, Modifiers.BOOST_DAMAGE, ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DAMAGE)+2);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- }
- else if (tStack[i] == ItemList.Electric_Motor_HV.get(1)){
- ModularArmourUtils.setModifierLevel(tBauble, Modifiers.BOOST_DAMAGE, ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DAMAGE)+3);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- }
- }
- catch (Throwable t){
-
- }
- }
- }
- Logger.INFO("set new Modular bauble");
- this.inventoryOutputs.setInventorySlotContents(1, tBauble);
- }
- }
- }
- }
- }
- super.updateEntity();
- }
-
- @Override
- public boolean canUpdate() {
- return true;
- }
-
-
-
-
-
-} \ No newline at end of file
+public class TileEntityProjectTable extends TileEntity
+ implements INetworkDataProvider, INetworkUpdateListener, IWrenchable {
+
+ public InventoryProjectMain inventoryGrid;
+ public InventoryProjectOutput inventoryOutputs;
+
+ /** The crafting matrix inventory (3x3). */
+ public InventoryCrafting craftMatrix;
+
+ public IInventory craftResult;
+ private Container_ProjectTable container;
+
+ public TileEntityProjectTable() {
+ this.inventoryGrid = new InventoryProjectMain(); // number of slots - without product slot
+ this.inventoryOutputs = new InventoryProjectOutput(); // number of slots - without product slot
+ this.canUpdate();
+ }
+
+ public void setContainer(Container_ProjectTable container) {
+ this.container = container;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ nbt.setShort("facing", this.facing);
+ this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid"));
+ this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput"));
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ this.prevFacing = (this.facing = nbt.getShort("facing"));
+ this.inventoryGrid.readFromNBT(nbt.getCompoundTag("ContentsGrid"));
+ this.inventoryOutputs.readFromNBT(nbt.getCompoundTag("ContentsOutput"));
+ }
+
+ @Override
+ public List<String> getNetworkedFields() {
+ final List<String> ret = new Vector(2);
+ ret.add("facing");
+ return ret;
+ }
+
+ @Override
+ public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side) {
+ return false;
+ }
+
+ private short facing = 0;
+ public short prevFacing = 0;
+
+ @Override
+ public void setFacing(final short facing1) {
+ this.facing = facing1;
+ if (this.prevFacing != facing1) {
+ IC2.network.get().updateTileEntityField(this, "facing");
+ }
+ this.prevFacing = facing1;
+ }
+
+ @Override
+ public short getFacing() {
+ return this.facing;
+ }
+
+ @Override
+ public boolean wrenchCanRemove(final EntityPlayer entityPlayer) {
+ return true;
+ }
+
+ @Override
+ public float getWrenchDropRate() {
+ return 1.0F;
+ }
+
+ @Override
+ public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) {
+ return new ItemStack(
+ this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord),
+ 1,
+ this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord));
+ }
+
+ @Override
+ public void onNetworkUpdate(final String field) {
+ this.prevFacing = this.facing;
+ }
+
+ @Override
+ public void updateEntity() {
+ if (!this.worldObj.isRemote) {
+ // Data stick
+ ItemStack dataStick = this.inventoryOutputs.getStackInSlot(0);
+ if (dataStick != null && this.container != null && container.getOutputContent() != null) {
+ if ((dataStick.getItem() instanceof GT_MetaGenerated_Item_01 && dataStick.getItemDamage() == 32708)
+ || (dataStick == ItemList.Tool_DataStick.get(1))
+ || (dataStick == GregtechItemList.Old_Tool_DataStick.get(1))
+ || (dataStick.getItem() instanceof MetaGeneratedGregtechItems
+ && dataStick.getItemDamage() == 32208)) {
+
+ Logger.INFO("Found Data Stick and valid container.");
+
+ ItemStack outputComponent = container.getOutputContent();
+ ItemStack[] craftInputComponent = container.getInputComponents();
+
+ ItemStack newStick =
+ NBTUtils.writeItemsToNBT(dataStick, new ItemStack[] {outputComponent}, "Output");
+ newStick = NBTUtils.writeItemsToNBT(newStick, craftInputComponent);
+ NBTUtils.setBookTitle(newStick, "Encrypted Project Data");
+ NBTUtils.setBoolean(newStick, "mEncrypted", true);
+ int slotm = 0;
+ Logger.WARNING("Uploading to Data Stick.");
+ for (ItemStack is : NBTUtils.readItemsFromNBT(newStick)) {
+ if (is != null) {
+ Logger.WARNING("Uploaded " + is.getDisplayName() + " into memory slot " + slotm + ".");
+ } else {
+ Logger.WARNING("Left memory slot " + slotm + " blank.");
+ }
+ slotm++;
+ }
+ Logger.WARNING("Encrypting Data Stick.");
+ this.inventoryOutputs.setInventorySlotContents(1, newStick);
+ this.inventoryOutputs.setInventorySlotContents(0, null);
+ }
+ }
+
+ // Utils.LOG_INFO("Doing thing 1");
+ if (dataStick != null)
+ if (dataStick.getItem() instanceof ModularBauble) {
+ Logger.INFO("Doing thing 2");
+ ItemStack tBauble = dataStick;
+ dataStick = null;
+ this.inventoryOutputs.setInventorySlotContents(0, dataStick);
+ if (this.inventoryGrid != null) {
+ Logger.INFO("Doing things");
+ ItemStack[] tStack = container.getInputComponents();
+ if (tStack != null) {
+ // Utils.LOG_INFO(""+tStack.length);
+ if (tBauble != null) {
+ for (int i = 0; i < tStack.length; i++) {
+
+ ItemStack testStack;
+ if ((testStack = container.inventoryGrid.getStackInSlot(i)) != null) {
+ Logger.INFO("FOUND: " + testStack.getDisplayName());
+ }
+
+ if (tStack[i] != null) {
+ Logger.INFO("found " + tStack[i].getDisplayName());
+ try {
+ if (tStack[i].getItem() == Items.feather) {
+ ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_BELT);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ this.inventoryGrid.setInventorySlotContents(i, null);
+ }
+ if (tStack[i].getItem() == Items.bed) {
+ ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_RING);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ this.inventoryGrid.setInventorySlotContents(i, null);
+ }
+ if (tStack[i].getItem() == Items.boat) {
+ ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_AMULET);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ this.inventoryGrid.setInventorySlotContents(i, null);
+ }
+
+ if (tStack[i].getItem() == Items.egg) {
+ ModularArmourUtils.setModifierLevel(
+ tBauble,
+ Modifiers.BOOST_HOLY,
+ ModularArmourUtils.getModifierLevel(
+ tBauble, Modifiers.BOOST_HOLY)
+ + 1);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ this.inventoryGrid.setInventorySlotContents(i, null);
+ }
+
+ if (tStack[i].getItem() == Items.baked_potato) {
+ ModularArmourUtils.setModifierLevel(
+ tBauble,
+ Modifiers.BOOST_DEF,
+ ModularArmourUtils.getModifierLevel(
+ tBauble, Modifiers.BOOST_DEF)
+ + 1);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ this.inventoryGrid.setInventorySlotContents(i, null);
+ }
+
+ if (tStack[i].getItem() == Items.cooked_beef) {
+ ModularArmourUtils.setModifierLevel(
+ tBauble,
+ Modifiers.BOOST_HP,
+ ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_HP)
+ + 1);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ this.inventoryGrid.setInventorySlotContents(i, null);
+ }
+
+ if (tStack[i]
+ == ItemUtils.simpleMetaStack(
+ "gregtech:gt.metaitem.01:17019", 17019, 1)) {
+ ModularArmourUtils.setModifierLevel(
+ tBauble,
+ Modifiers.BOOST_DEF,
+ ModularArmourUtils.getModifierLevel(
+ tBauble, Modifiers.BOOST_DEF)
+ + 1);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ }
+ if (tStack[i] == ItemList.Electric_Motor_LV.get(1)) {
+ ModularArmourUtils.setModifierLevel(
+ tBauble,
+ Modifiers.BOOST_DAMAGE,
+ ModularArmourUtils.getModifierLevel(
+ tBauble, Modifiers.BOOST_DAMAGE)
+ + 1);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ } else if (tStack[i] == ItemList.Electric_Motor_MV.get(1)) {
+ ModularArmourUtils.setModifierLevel(
+ tBauble,
+ Modifiers.BOOST_DAMAGE,
+ ModularArmourUtils.getModifierLevel(
+ tBauble, Modifiers.BOOST_DAMAGE)
+ + 2);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ } else if (tStack[i] == ItemList.Electric_Motor_HV.get(1)) {
+ ModularArmourUtils.setModifierLevel(
+ tBauble,
+ Modifiers.BOOST_DAMAGE,
+ ModularArmourUtils.getModifierLevel(
+ tBauble, Modifiers.BOOST_DAMAGE)
+ + 3);
+ Logger.INFO("buffed Modular bauble");
+ tStack[i] = null;
+ container.inventoryGrid.setInventorySlotContents(i, null);
+ }
+ } catch (Throwable t) {
+
+ }
+ }
+ }
+ Logger.INFO("set new Modular bauble");
+ this.inventoryOutputs.setInventorySlotContents(1, tBauble);
+ }
+ }
+ }
+ }
+ }
+ super.updateEntity();
+ }
+
+ @Override
+ public boolean canUpdate() {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java
index a220997c84..840893703a 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.tileentities.machines;
-import java.util.List;
-
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.handler.GuiHandler;
@@ -9,6 +7,7 @@ import gtPlusPlus.core.inventories.Inventory_RoundRobinator;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.command.IEntitySelector;
@@ -32,708 +31,645 @@ import net.minecraft.world.World;
public class TileEntityRoundRobinator extends TileEntity implements ISidedInventory, IHopper {
- private int tickCount = 0;
- private final Inventory_RoundRobinator inventoryContents;
- private String customName;
- public int locationX;
- public int locationY;
- public int locationZ;
- private int aData = 1111;
- private int aTier = 1;
- private int aTickRate = 100;
-
- public TileEntityRoundRobinator() {
- this.inventoryContents = new Inventory_RoundRobinator();
- this.setTileLocation();
- }
-
- public boolean setTileLocation() {
- if (this.hasWorldObj()) {
- if (!this.getWorldObj().isRemote) {
- this.locationX = this.xCoord;
- this.locationY = this.yCoord;
- this.locationZ = this.zCoord;
- this.aTier = this.getWorldObj().getBlockMetadata(locationX, locationY, locationZ) + 1;
- return true;
- }
- }
- return false;
- }
-
- //Rename to hasCircuitToConfigure
- public final boolean hasInventoryContents() {
- for (ItemStack i : this.aHopperInventory) {
- if (i == null) {
- continue;
- }
- else {
- return true;
- }
- }
- return false;
- }
-
- public Inventory_RoundRobinator getInventory() {
- return this.inventoryContents;
- }
-
- public int getTier() {
- return this.aTier;
- }
-
- public int getTickRate() {
- return this.aTickRate;
- }
-
- @Override
- public void updateEntity() {
- try{
- // TODO
- if (this.worldObj != null && !this.worldObj.isRemote){
- setTileLocation();
- aTickRate = (60-(aTier*10));
- if (this.getTier() == 1) {
- // 20 s
- aTickRate = 400;
- }
- else if (this.getTier() == 2) {
- // 5
- aTickRate = 100;
- }
- else if (this.getTier() == 3) {
- // 1
- aTickRate = 20;
- }
- else if (this.getTier() == 4) {
- // 1/5
- aTickRate = 10;
- }
- else if (this.getTier() == 5) {
- // 1/20
- aTickRate = 1;
- }
- else {
- aTickRate = 999999;
- }
-
- if (tickCount % getTickRate() == 0) {
- if (hasInventoryContents()) {
- Logger.WARNING("Trying to move items. "+aTickRate);
- this.tryProcessItems();
- }
- }
- this.tickCount++;
- }
- }
- catch (final Throwable t){
- t.printStackTrace();
- }
- }
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- nbt.setInteger("aCurrentMode", aData);
- this.writeToNBT2(nbt);
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- aData = nbt.getInteger("aCurrentMode");
- this.readFromNBT2(nbt);
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return this.getInventory().isUseableByPlayer(entityplayer);
- }
-
- @Override
- public void openInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- //this.getInventory().openInventory();
- }
-
- @Override
- public void closeInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- //this.getInventory().closeInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return true;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int aSide) {
- return new int[] {0, 1, 2, 3, 4};
- }
-
- @Override
- public boolean canInsertItem(final int aSlot, final ItemStack aStack, final int aSide) {
- return aSide < 2;
- }
-
- @Override
- public boolean canExtractItem(final int aSlot, final ItemStack aStack, final int aSide) {
- return false;
- }
-
- public String getCustomName() {
- return this.customName;
- }
-
- public void setCustomName(final String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.roundrobinator";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
- }
-
- @Override
- public Packet getDescriptionPacket() {
- final NBTTagCompound tag = new NBTTagCompound();
- this.writeToNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
- }
-
- @Override
- public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
- final NBTTagCompound tag = pkt.func_148857_g();
- this.readFromNBT(tag);
- }
-
-
- public boolean onRightClick(byte side, EntityPlayer player, int x, int y, int z) {
- if (player != null && player.getHeldItem() == null) {
- if (!player.isSneaking() && !KeyboardUtils.isShiftKeyDown()) {
- player.openGui(GTplusplus.instance, GuiHandler.GUI16, player.getEntityWorld(), x, y, z);
- }
- else {
- String InventoryContents = ItemUtils.getArrayStackNames(this.aHopperInventory);
- PlayerUtils.messagePlayer(player, "Contents: "+InventoryContents+" | "+getDataString());
- }
- return true;
- }
- else {
- return false;
- }
- }
-
- public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) {
- try {
- if (side < 2) {
- // Top/Bottom
- }
- else {
- if (toggleSide(side)) {
- PlayerUtils.messagePlayer(player, "Enabling side "+side+".");
- }
- else {
- PlayerUtils.messagePlayer(player, "Disabling side "+side+".");
- }
- PlayerUtils.messagePlayer(player, "Mode String: "+aData+"");
- }
- return true;
- }
- catch (Throwable t) {
- t.printStackTrace();
- return false;
- }
- }
-
- public int getDataString() {
- return aData;
- }
-
- public boolean[] getActiveSides() {
- this.markDirty();
- String s = String.valueOf(aData);
- if (s == null || s.length() != 4) {
- s = "1111";
- }
- boolean[] aActiveSides = new boolean[4];
- for (int i=0;i<4;i++) {
- char ch = s.charAt(i);
- if (ch == '1') {
- aActiveSides[i] = true;
- }
- else {
- aActiveSides[i] = false;
- }
- }
- return aActiveSides;
- }
-
- /**
- * Toggle active state of side
- * @param aSide - Forge Direction / Side
- * @return - True if the side is now Active, false if now disabled.
- */
- public boolean toggleSide(int aSide) {
- setSideActive(!getSideActive(aSide), aSide);
- return getSideActive(aSide);
- }
-
-
- public void setSideActive(boolean aActive, int aSide) {
- try {
- if (aSide < 2) {
- }
- else {
- if (aData < 1111) {
- aData = 1111;
- }
- else if (aData > 2222) {
- aData = 2222;
- }
- String s = String.valueOf(aData);
- StringBuilder aDataString = new StringBuilder(s);
- int aIndex = aSide - 2;
- if (aActive) {
- aDataString.setCharAt(aIndex, '1');
- }
- else {
- aDataString.setCharAt(aIndex, '2');
- }
- aData = Integer.valueOf(aDataString.toString());
- this.markDirty();
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- public boolean getSideActive(int aSide) {
- this.markDirty();
- try {
- if (aSide < 2) {
- return false;
- }
- else {
- if (aData < 1111) {
- aData = 1111;
- }
- else if (aData > 2222) {
- aData = 2222;
- }
- String s = String.valueOf(aData);
- int aIndex = aSide - 2;
- char ch = s.charAt(aIndex);
- if (ch == '1') {
- return true;
- }
- else {
- return false;
- }
-
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- return false;
- }
- }
-
- @Override
- public double getXPos() {
- return this.locationX;
- }
-
- @Override
- public double getYPos() {
- return this.locationY;
- }
-
- @Override
- public double getZPos() {
- return this.locationZ;
- }
-
-
-
-
-
-
-
-
- // TODO
-
-
-
- /*
- * Hopper Code
- */
-
-
- private ItemStack[] aHopperInventory = new ItemStack[5];
-
- public int getSizeInventory() {
- return this.aHopperInventory.length;
- }
-
- public ItemStack getStackInSlot(int aSlot) {
- return this.aHopperInventory[aSlot];
- }
-
- /**
- * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
- * new stack.
- */
- public ItemStack decrStackSize(int aSlot, int aMinimumSizeOfExistingStack)
- {
- if (this.aHopperInventory[aSlot] != null)
- {
- ItemStack itemstack;
-
- if (this.aHopperInventory[aSlot].stackSize <= aMinimumSizeOfExistingStack)
- {
- itemstack = this.aHopperInventory[aSlot];
- this.aHopperInventory[aSlot] = null;
- return itemstack;
- }
- else
- {
- itemstack = this.aHopperInventory[aSlot].splitStack(aMinimumSizeOfExistingStack);
-
- if (this.aHopperInventory[aSlot].stackSize == 0)
- {
- this.aHopperInventory[aSlot] = null;
- }
-
- return itemstack;
- }
- }
- else
- {
- return null;
- }
- }
-
- /**
- * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
- * like when you close a workbench GUI.
- */
- public ItemStack getStackInSlotOnClosing(int aSlot)
- {
- if (this.aHopperInventory[aSlot] != null)
- {
- ItemStack itemstack = this.aHopperInventory[aSlot];
- this.aHopperInventory[aSlot] = null;
- return itemstack;
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
- */
- public void setInventorySlotContents(int aSlot, ItemStack aStack)
- {
- this.aHopperInventory[aSlot] = aStack;
-
- if (aStack != null && aStack.stackSize > this.getInventoryStackLimit())
- {
- aStack.stackSize = this.getInventoryStackLimit();
- }
- }
-
- public boolean tryProcessItems() {
- if (this.worldObj != null && !this.worldObj.isRemote) {
- boolean didSomething = false;
- if (!this.isEmpty()) {
- Logger.WARNING("Has Items, Trying to push to all active directions.");
- didSomething = this.tryPushItemsIntoNeighbours();
- }
- if (didSomething) {
- this.markDirty();
- return true;
- }
- }
- return false;
- }
-
- /**
- * Is Empty
- * @return
- */
- private boolean isEmpty() {
- ItemStack[] aitemstack = this.aHopperInventory;
- int i = aitemstack.length;
-
- for (int j = 0; j < i; ++j) {
- ItemStack itemstack = aitemstack[j];
-
- if (itemstack != null) {
- return false;
- }
- }
-
- return true;
- }
-
- private boolean tryPushItemsIntoNeighbours() {
-
- boolean aDidPush = false;
-
- for (int u = 2; u < 6; u++) {
- if (!this.getSideActive(u)) {
- Logger.WARNING("Not pushing on side "+u);
- continue;
- }
-
- Logger.WARNING("Pushing on side "+u);
- IInventory iinventory = this.getInventoryFromFacing(u);
-
- if (iinventory == null) {
- Logger.WARNING("No inventory found.");
- continue;
- }
- else {
-
- int i = Facing.oppositeSide[u];
- Logger.WARNING("Using Opposite direction: "+i);
-
- if (this.isInventoryFull(iinventory, i)) {
- Logger.WARNING("Target is full, skipping.");
- continue;
- }
- else {
- Logger.WARNING("Target has space, let's move a single item.");
- for (int j = 0; j < this.getSizeInventory(); ++j) {
- if (this.getStackInSlot(j) != null) {
- ItemStack itemstack = this.getStackInSlot(j).copy();
- ItemStack itemstack1 = setStackInNeighbour(iinventory, this.decrStackSize(j, 1), i);
- if (itemstack1 == null || itemstack1.stackSize == 0) {
- iinventory.markDirty();
- aDidPush = true;
- continue;
- }
- this.setInventorySlotContents(j, itemstack);
- }
- }
- }
- }
- }
-
- return aDidPush;
- }
-
- private boolean isInventoryFull(IInventory aInv, int aSide) {
- if (aInv instanceof ISidedInventory && aSide > -1) {
- ISidedInventory isidedinventory = (ISidedInventory)aInv;
- int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide);
-
- for (int l = 0; l < aint.length; ++l)
- {
- ItemStack itemstack1 = isidedinventory.getStackInSlot(aint[l]);
-
- if (itemstack1 == null || itemstack1.stackSize != itemstack1.getMaxStackSize())
- {
- return false;
- }
- }
- }
- else {
- int j = aInv.getSizeInventory();
-
- for (int k = 0; k < j; ++k)
- {
- ItemStack itemstack = aInv.getStackInSlot(k);
-
- if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize())
- {
- return false;
- }
- }
- }
- return true;
- }
-
- public static ItemStack setStackInNeighbour(IInventory aNeighbour, ItemStack aStack, int aSide) {
- if (aNeighbour instanceof ISidedInventory && aSide > -1)
- {
- ISidedInventory isidedinventory = (ISidedInventory)aNeighbour;
- int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide);
-
- for (int l = 0; l < aint.length && aStack != null && aStack.stackSize > 0; ++l)
- {
- aStack = tryMoveStack(aNeighbour, aStack, aint[l], aSide);
- }
- }
- else
- {
- int j = aNeighbour.getSizeInventory();
-
- for (int k = 0; k < j && aStack != null && aStack.stackSize > 0; ++k)
- {
- aStack = tryMoveStack(aNeighbour, aStack, k, aSide);
- }
- }
-
- if (aStack != null && aStack.stackSize == 0)
- {
- aStack = null;
- }
-
- return aStack;
- }
-
- private static boolean canInsertItemIntoNeighbour(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) {
- return !aNeighbour.isItemValidForSlot(aSlot, aStack) ? false : !(aNeighbour instanceof ISidedInventory) || ((ISidedInventory)aNeighbour).canInsertItem(aSlot, aStack, aSide);
- }
-
- private static ItemStack tryMoveStack(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) {
- ItemStack itemstack1 = aNeighbour.getStackInSlot(aSlot);
- if (canInsertItemIntoNeighbour(aNeighbour, aStack, aSlot, aSide)) {
- boolean aDidSomething = false;
- if (itemstack1 == null) {
- //Forge: BUGFIX: Again, make things respect max stack sizes.
- int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit());
- if (max >= aStack.stackSize) {
- aNeighbour.setInventorySlotContents(aSlot, aStack);
- aStack = null;
- }
- else {
- aNeighbour.setInventorySlotContents(aSlot, aStack.splitStack(max));
- }
- aDidSomething = true;
- }
- else if (areItemStacksEqual(itemstack1, aStack)) {
- //Forge: BUGFIX: Again, make things respect max stack sizes.
- int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit());
- if (max > itemstack1.stackSize) {
- int l = Math.min(aStack.stackSize, max - itemstack1.stackSize);
- aStack.stackSize -= l;
- itemstack1.stackSize += l;
- aDidSomething = l > 0;
- }
- }
- if (aDidSomething){
- aNeighbour.markDirty();
- }
- }
- return aStack;
- }
-
- private IInventory getInventoryFromFacing(int aSide)
- {
- int i = aSide;
- return tryFindInvetoryAtXYZ(this.getWorldObj(), (double)(this.xCoord + Facing.offsetsXForSide[i]), (double)(this.yCoord + Facing.offsetsYForSide[i]), (double)(this.zCoord + Facing.offsetsZForSide[i]));
- }
-
- public static IInventory tryFindInvetoryAtXYZ(World aWorld, double aX, double aY, double aZ)
- {
- IInventory iinventory = null;
- int sX = MathHelper.floor_double(aX);
- int sY = MathHelper.floor_double(aY);
- int sZ = MathHelper.floor_double(aZ);
- TileEntity tileentity = aWorld.getTileEntity(sX, sY, sZ);
-
- if (tileentity != null && tileentity instanceof IInventory)
- {
- iinventory = (IInventory)tileentity;
-
- if (iinventory instanceof TileEntityChest)
- {
- Block block = aWorld.getBlock(sX, sY, sZ);
-
- if (block instanceof BlockChest)
- {
- iinventory = ((BlockChest)block).func_149951_m(aWorld, sX, sY, sZ);
- }
- }
- }
-
- if (iinventory == null)
- {
- List list = aWorld.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1.0D, aY + 1.0D, aZ + 1.0D), IEntitySelector.selectInventories);
-
- if (list != null && list.size() > 0)
- {
- iinventory = (IInventory)list.get(aWorld.rand.nextInt(list.size()));
- }
- }
-
- return iinventory;
- }
-
- private static boolean areItemStacksEqual(ItemStack aStack, ItemStack aStack2) {
- return aStack.getItem() != aStack2.getItem() ? false : (aStack.getItemDamage() != aStack2.getItemDamage() ? false : (aStack.stackSize > aStack.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(aStack, aStack2)));
- }
-
- public void readFromNBT2(NBTTagCompound p_145839_1_) {
- super.readFromNBT(p_145839_1_);
- NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
- this.aHopperInventory = new ItemStack[this.getSizeInventory()];
- for (int i = 0; i < nbttaglist.tagCount(); ++i) {
- NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
- byte b0 = nbttagcompound1.getByte("Slot");
- if (b0 >= 0 && b0 < this.aHopperInventory.length) {
- this.aHopperInventory[b0] = ItemStack.loadItemStackFromNBT(
- nbttagcompound1
- );
- }
- }
- }
-
- public void writeToNBT2(NBTTagCompound aNBT) {
- super.writeToNBT(aNBT);
- NBTTagList nbttaglist = new NBTTagList();
- for (int i = 0; i < this.aHopperInventory.length; ++i) {
- if (this.aHopperInventory[i] != null) {
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- nbttagcompound1.setByte("Slot", (byte) i);
- this.aHopperInventory[i].writeToNBT(nbttagcompound1);
- nbttaglist.appendTag(nbttagcompound1);
- }
- }
- aNBT.setTag("Items", nbttaglist);
- }
-
-
-
-
-
-
-
+ private int tickCount = 0;
+ private final Inventory_RoundRobinator inventoryContents;
+ private String customName;
+ public int locationX;
+ public int locationY;
+ public int locationZ;
+ private int aData = 1111;
+ private int aTier = 1;
+ private int aTickRate = 100;
+
+ public TileEntityRoundRobinator() {
+ this.inventoryContents = new Inventory_RoundRobinator();
+ this.setTileLocation();
+ }
+
+ public boolean setTileLocation() {
+ if (this.hasWorldObj()) {
+ if (!this.getWorldObj().isRemote) {
+ this.locationX = this.xCoord;
+ this.locationY = this.yCoord;
+ this.locationZ = this.zCoord;
+ this.aTier = this.getWorldObj().getBlockMetadata(locationX, locationY, locationZ) + 1;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // Rename to hasCircuitToConfigure
+ public final boolean hasInventoryContents() {
+ for (ItemStack i : this.aHopperInventory) {
+ if (i == null) {
+ continue;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public Inventory_RoundRobinator getInventory() {
+ return this.inventoryContents;
+ }
+
+ public int getTier() {
+ return this.aTier;
+ }
+
+ public int getTickRate() {
+ return this.aTickRate;
+ }
+
+ @Override
+ public void updateEntity() {
+ try {
+ // TODO
+ if (this.worldObj != null && !this.worldObj.isRemote) {
+ setTileLocation();
+ aTickRate = (60 - (aTier * 10));
+ if (this.getTier() == 1) {
+ // 20 s
+ aTickRate = 400;
+ } else if (this.getTier() == 2) {
+ // 5
+ aTickRate = 100;
+ } else if (this.getTier() == 3) {
+ // 1
+ aTickRate = 20;
+ } else if (this.getTier() == 4) {
+ // 1/5
+ aTickRate = 10;
+ } else if (this.getTier() == 5) {
+ // 1/20
+ aTickRate = 1;
+ } else {
+ aTickRate = 999999;
+ }
+
+ if (tickCount % getTickRate() == 0) {
+ if (hasInventoryContents()) {
+ Logger.WARNING("Trying to move items. " + aTickRate);
+ this.tryProcessItems();
+ }
+ }
+ this.tickCount++;
+ }
+ } catch (final Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ nbt.setInteger("aCurrentMode", aData);
+ this.writeToNBT2(nbt);
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+ aData = nbt.getInteger("aCurrentMode");
+ this.readFromNBT2(nbt);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return this.getInventory().isUseableByPlayer(entityplayer);
+ }
+
+ @Override
+ public void openInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ // this.getInventory().openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ // this.getInventory().closeInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return true;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int aSide) {
+ return new int[] {0, 1, 2, 3, 4};
+ }
+
+ @Override
+ public boolean canInsertItem(final int aSlot, final ItemStack aStack, final int aSide) {
+ return aSide < 2;
+ }
+
+ @Override
+ public boolean canExtractItem(final int aSlot, final ItemStack aStack, final int aSide) {
+ return false;
+ }
+
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ public void setCustomName(final String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.roundrobinator";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.customName != null) && !this.customName.equals("");
+ }
+
+ @Override
+ public Packet getDescriptionPacket() {
+ final NBTTagCompound tag = new NBTTagCompound();
+ this.writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
+ }
+
+ @Override
+ public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
+ final NBTTagCompound tag = pkt.func_148857_g();
+ this.readFromNBT(tag);
+ }
+
+ public boolean onRightClick(byte side, EntityPlayer player, int x, int y, int z) {
+ if (player != null && player.getHeldItem() == null) {
+ if (!player.isSneaking() && !KeyboardUtils.isShiftKeyDown()) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI16, player.getEntityWorld(), x, y, z);
+ } else {
+ String InventoryContents = ItemUtils.getArrayStackNames(this.aHopperInventory);
+ PlayerUtils.messagePlayer(player, "Contents: " + InventoryContents + " | " + getDataString());
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) {
+ try {
+ if (side < 2) {
+ // Top/Bottom
+ } else {
+ if (toggleSide(side)) {
+ PlayerUtils.messagePlayer(player, "Enabling side " + side + ".");
+ } else {
+ PlayerUtils.messagePlayer(player, "Disabling side " + side + ".");
+ }
+ PlayerUtils.messagePlayer(player, "Mode String: " + aData + "");
+ }
+ return true;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return false;
+ }
+ }
+
+ public int getDataString() {
+ return aData;
+ }
+
+ public boolean[] getActiveSides() {
+ this.markDirty();
+ String s = String.valueOf(aData);
+ if (s == null || s.length() != 4) {
+ s = "1111";
+ }
+ boolean[] aActiveSides = new boolean[4];
+ for (int i = 0; i < 4; i++) {
+ char ch = s.charAt(i);
+ if (ch == '1') {
+ aActiveSides[i] = true;
+ } else {
+ aActiveSides[i] = false;
+ }
+ }
+ return aActiveSides;
+ }
+
+ /**
+ * Toggle active state of side
+ * @param aSide - Forge Direction / Side
+ * @return - True if the side is now Active, false if now disabled.
+ */
+ public boolean toggleSide(int aSide) {
+ setSideActive(!getSideActive(aSide), aSide);
+ return getSideActive(aSide);
+ }
+
+ public void setSideActive(boolean aActive, int aSide) {
+ try {
+ if (aSide < 2) {
+ } else {
+ if (aData < 1111) {
+ aData = 1111;
+ } else if (aData > 2222) {
+ aData = 2222;
+ }
+ String s = String.valueOf(aData);
+ StringBuilder aDataString = new StringBuilder(s);
+ int aIndex = aSide - 2;
+ if (aActive) {
+ aDataString.setCharAt(aIndex, '1');
+ } else {
+ aDataString.setCharAt(aIndex, '2');
+ }
+ aData = Integer.valueOf(aDataString.toString());
+ this.markDirty();
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ public boolean getSideActive(int aSide) {
+ this.markDirty();
+ try {
+ if (aSide < 2) {
+ return false;
+ } else {
+ if (aData < 1111) {
+ aData = 1111;
+ } else if (aData > 2222) {
+ aData = 2222;
+ }
+ String s = String.valueOf(aData);
+ int aIndex = aSide - 2;
+ char ch = s.charAt(aIndex);
+ if (ch == '1') {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return false;
+ }
+ }
+
+ @Override
+ public double getXPos() {
+ return this.locationX;
+ }
+
+ @Override
+ public double getYPos() {
+ return this.locationY;
+ }
+
+ @Override
+ public double getZPos() {
+ return this.locationZ;
+ }
+
+ // TODO
+
+ /*
+ * Hopper Code
+ */
+
+ private ItemStack[] aHopperInventory = new ItemStack[5];
+
+ public int getSizeInventory() {
+ return this.aHopperInventory.length;
+ }
+
+ public ItemStack getStackInSlot(int aSlot) {
+ return this.aHopperInventory[aSlot];
+ }
+
+ /**
+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
+ * new stack.
+ */
+ public ItemStack decrStackSize(int aSlot, int aMinimumSizeOfExistingStack) {
+ if (this.aHopperInventory[aSlot] != null) {
+ ItemStack itemstack;
+
+ if (this.aHopperInventory[aSlot].stackSize <= aMinimumSizeOfExistingStack) {
+ itemstack = this.aHopperInventory[aSlot];
+ this.aHopperInventory[aSlot] = null;
+ return itemstack;
+ } else {
+ itemstack = this.aHopperInventory[aSlot].splitStack(aMinimumSizeOfExistingStack);
+
+ if (this.aHopperInventory[aSlot].stackSize == 0) {
+ this.aHopperInventory[aSlot] = null;
+ }
+
+ return itemstack;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
+ * like when you close a workbench GUI.
+ */
+ public ItemStack getStackInSlotOnClosing(int aSlot) {
+ if (this.aHopperInventory[aSlot] != null) {
+ ItemStack itemstack = this.aHopperInventory[aSlot];
+ this.aHopperInventory[aSlot] = null;
+ return itemstack;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
+ */
+ public void setInventorySlotContents(int aSlot, ItemStack aStack) {
+ this.aHopperInventory[aSlot] = aStack;
+
+ if (aStack != null && aStack.stackSize > this.getInventoryStackLimit()) {
+ aStack.stackSize = this.getInventoryStackLimit();
+ }
+ }
+
+ public boolean tryProcessItems() {
+ if (this.worldObj != null && !this.worldObj.isRemote) {
+ boolean didSomething = false;
+ if (!this.isEmpty()) {
+ Logger.WARNING("Has Items, Trying to push to all active directions.");
+ didSomething = this.tryPushItemsIntoNeighbours();
+ }
+ if (didSomething) {
+ this.markDirty();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Is Empty
+ * @return
+ */
+ private boolean isEmpty() {
+ ItemStack[] aitemstack = this.aHopperInventory;
+ int i = aitemstack.length;
+
+ for (int j = 0; j < i; ++j) {
+ ItemStack itemstack = aitemstack[j];
+
+ if (itemstack != null) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private boolean tryPushItemsIntoNeighbours() {
+
+ boolean aDidPush = false;
+
+ for (int u = 2; u < 6; u++) {
+ if (!this.getSideActive(u)) {
+ Logger.WARNING("Not pushing on side " + u);
+ continue;
+ }
+
+ Logger.WARNING("Pushing on side " + u);
+ IInventory iinventory = this.getInventoryFromFacing(u);
+
+ if (iinventory == null) {
+ Logger.WARNING("No inventory found.");
+ continue;
+ } else {
+
+ int i = Facing.oppositeSide[u];
+ Logger.WARNING("Using Opposite direction: " + i);
+
+ if (this.isInventoryFull(iinventory, i)) {
+ Logger.WARNING("Target is full, skipping.");
+ continue;
+ } else {
+ Logger.WARNING("Target has space, let's move a single item.");
+ for (int j = 0; j < this.getSizeInventory(); ++j) {
+ if (this.getStackInSlot(j) != null) {
+ ItemStack itemstack = this.getStackInSlot(j).copy();
+ ItemStack itemstack1 = setStackInNeighbour(iinventory, this.decrStackSize(j, 1), i);
+ if (itemstack1 == null || itemstack1.stackSize == 0) {
+ iinventory.markDirty();
+ aDidPush = true;
+ continue;
+ }
+ this.setInventorySlotContents(j, itemstack);
+ }
+ }
+ }
+ }
+ }
+
+ return aDidPush;
+ }
+
+ private boolean isInventoryFull(IInventory aInv, int aSide) {
+ if (aInv instanceof ISidedInventory && aSide > -1) {
+ ISidedInventory isidedinventory = (ISidedInventory) aInv;
+ int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide);
+
+ for (int l = 0; l < aint.length; ++l) {
+ ItemStack itemstack1 = isidedinventory.getStackInSlot(aint[l]);
+
+ if (itemstack1 == null || itemstack1.stackSize != itemstack1.getMaxStackSize()) {
+ return false;
+ }
+ }
+ } else {
+ int j = aInv.getSizeInventory();
+
+ for (int k = 0; k < j; ++k) {
+ ItemStack itemstack = aInv.getStackInSlot(k);
+
+ if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public static ItemStack setStackInNeighbour(IInventory aNeighbour, ItemStack aStack, int aSide) {
+ if (aNeighbour instanceof ISidedInventory && aSide > -1) {
+ ISidedInventory isidedinventory = (ISidedInventory) aNeighbour;
+ int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide);
+
+ for (int l = 0; l < aint.length && aStack != null && aStack.stackSize > 0; ++l) {
+ aStack = tryMoveStack(aNeighbour, aStack, aint[l], aSide);
+ }
+ } else {
+ int j = aNeighbour.getSizeInventory();
+
+ for (int k = 0; k < j && aStack != null && aStack.stackSize > 0; ++k) {
+ aStack = tryMoveStack(aNeighbour, aStack, k, aSide);
+ }
+ }
+
+ if (aStack != null && aStack.stackSize == 0) {
+ aStack = null;
+ }
+
+ return aStack;
+ }
+
+ private static boolean canInsertItemIntoNeighbour(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) {
+ return !aNeighbour.isItemValidForSlot(aSlot, aStack)
+ ? false
+ : !(aNeighbour instanceof ISidedInventory)
+ || ((ISidedInventory) aNeighbour).canInsertItem(aSlot, aStack, aSide);
+ }
+
+ private static ItemStack tryMoveStack(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) {
+ ItemStack itemstack1 = aNeighbour.getStackInSlot(aSlot);
+ if (canInsertItemIntoNeighbour(aNeighbour, aStack, aSlot, aSide)) {
+ boolean aDidSomething = false;
+ if (itemstack1 == null) {
+ // Forge: BUGFIX: Again, make things respect max stack sizes.
+ int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit());
+ if (max >= aStack.stackSize) {
+ aNeighbour.setInventorySlotContents(aSlot, aStack);
+ aStack = null;
+ } else {
+ aNeighbour.setInventorySlotContents(aSlot, aStack.splitStack(max));
+ }
+ aDidSomething = true;
+ } else if (areItemStacksEqual(itemstack1, aStack)) {
+ // Forge: BUGFIX: Again, make things respect max stack sizes.
+ int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit());
+ if (max > itemstack1.stackSize) {
+ int l = Math.min(aStack.stackSize, max - itemstack1.stackSize);
+ aStack.stackSize -= l;
+ itemstack1.stackSize += l;
+ aDidSomething = l > 0;
+ }
+ }
+ if (aDidSomething) {
+ aNeighbour.markDirty();
+ }
+ }
+ return aStack;
+ }
+
+ private IInventory getInventoryFromFacing(int aSide) {
+ int i = aSide;
+ return tryFindInvetoryAtXYZ(
+ this.getWorldObj(),
+ (double) (this.xCoord + Facing.offsetsXForSide[i]),
+ (double) (this.yCoord + Facing.offsetsYForSide[i]),
+ (double) (this.zCoord + Facing.offsetsZForSide[i]));
+ }
+
+ public static IInventory tryFindInvetoryAtXYZ(World aWorld, double aX, double aY, double aZ) {
+ IInventory iinventory = null;
+ int sX = MathHelper.floor_double(aX);
+ int sY = MathHelper.floor_double(aY);
+ int sZ = MathHelper.floor_double(aZ);
+ TileEntity tileentity = aWorld.getTileEntity(sX, sY, sZ);
+
+ if (tileentity != null && tileentity instanceof IInventory) {
+ iinventory = (IInventory) tileentity;
+
+ if (iinventory instanceof TileEntityChest) {
+ Block block = aWorld.getBlock(sX, sY, sZ);
+
+ if (block instanceof BlockChest) {
+ iinventory = ((BlockChest) block).func_149951_m(aWorld, sX, sY, sZ);
+ }
+ }
+ }
+
+ if (iinventory == null) {
+ List list = aWorld.getEntitiesWithinAABBExcludingEntity(
+ (Entity) null,
+ AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1.0D, aY + 1.0D, aZ + 1.0D),
+ IEntitySelector.selectInventories);
+
+ if (list != null && list.size() > 0) {
+ iinventory = (IInventory) list.get(aWorld.rand.nextInt(list.size()));
+ }
+ }
+
+ return iinventory;
+ }
+
+ private static boolean areItemStacksEqual(ItemStack aStack, ItemStack aStack2) {
+ return aStack.getItem() != aStack2.getItem()
+ ? false
+ : (aStack.getItemDamage() != aStack2.getItemDamage()
+ ? false
+ : (aStack.stackSize > aStack.getMaxStackSize()
+ ? false
+ : ItemStack.areItemStackTagsEqual(aStack, aStack2)));
+ }
+
+ public void readFromNBT2(NBTTagCompound p_145839_1_) {
+ super.readFromNBT(p_145839_1_);
+ NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
+ this.aHopperInventory = new ItemStack[this.getSizeInventory()];
+ for (int i = 0; i < nbttaglist.tagCount(); ++i) {
+ NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
+ byte b0 = nbttagcompound1.getByte("Slot");
+ if (b0 >= 0 && b0 < this.aHopperInventory.length) {
+ this.aHopperInventory[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
+ }
+ }
+ }
+
+ public void writeToNBT2(NBTTagCompound aNBT) {
+ super.writeToNBT(aNBT);
+ NBTTagList nbttaglist = new NBTTagList();
+ for (int i = 0; i < this.aHopperInventory.length; ++i) {
+ if (this.aHopperInventory[i] != null) {
+ NBTTagCompound nbttagcompound1 = new NBTTagCompound();
+ nbttagcompound1.setByte("Slot", (byte) i);
+ this.aHopperInventory[i].writeToNBT(nbttagcompound1);
+ nbttaglist.appendTag(nbttagcompound1);
+ }
+ }
+ aNBT.setTag("Items", nbttaglist);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java
index ad7ec3d0b3..260e559c09 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java
@@ -1,133 +1,122 @@
package gtPlusPlus.core.tileentities.machines;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gtPlusPlus.core.container.Container_TradeTable;
import gtPlusPlus.core.inventories.tradetable.InventoryTradeMain;
import gtPlusPlus.core.inventories.tradetable.InventoryTradeOutput;
import gtPlusPlus.core.tileentities.base.TileEntityBase;
import gtPlusPlus.core.util.minecraft.NBTUtils;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
public class TileEntityTradeTable extends TileEntityBase {
- public InventoryTradeMain inventoryGrid;
- public InventoryTradeOutput inventoryOutputs;
-
- private Container_TradeTable container;
-
- public TileEntityTradeTable(){
- super(2);
- this.inventoryGrid = new InventoryTradeMain();//number of slots - without product slot
- this.inventoryOutputs = new InventoryTradeOutput();//number of slots - without product slot
- }
-
- public void setContainer(Container_TradeTable container_TradeTable){
- this.container = container_TradeTable;
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt){
- super.writeToNBT(nbt);
- this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid"));
- this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput"));
-
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt){
- this.inventoryGrid.readFromNBT(nbt);
- this.inventoryOutputs.readFromNBT(nbt);
- super.readFromNBT(nbt);
- }
-
- @Override
- public void updateEntity() {
- if (!this.worldObj.isRemote){
- ItemStack slot0;
- try{
-
- slot0 = this.inventoryOutputs.getStackInSlot(0);
- if (slot0 != null && slot0.hasTagCompound()){
- NBTUtils.tryIterateNBTData(slot0);
- this.inventoryOutputs.setInventorySlotContents(0, null);
- this.inventoryOutputs.setInventorySlotContents(1, slot0);
- }
-
- }
- catch (Throwable t){
- t.printStackTrace();
- this.inventoryOutputs.setInventorySlotContents(0, null);
- }
-
- }
- super.updateEntity();
- }
-
- @Override
- public int getSizeInventory() {
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(int p_70301_1_) {
- return null;
- }
-
- @Override
- public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
- return null;
- }
-
- @Override
- public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
-
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
- return true;
- }
-
- @Override
- public void openInventory() {
-
- }
-
- @Override
- public void closeInventory() {
-
- }
-
- @Override
- public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
- return false;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
- return new int[] {};
- }
-
- @Override
- public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
- return false;
- }
-
-} \ No newline at end of file
+ public InventoryTradeMain inventoryGrid;
+ public InventoryTradeOutput inventoryOutputs;
+
+ private Container_TradeTable container;
+
+ public TileEntityTradeTable() {
+ super(2);
+ this.inventoryGrid = new InventoryTradeMain(); // number of slots - without product slot
+ this.inventoryOutputs = new InventoryTradeOutput(); // number of slots - without product slot
+ }
+
+ public void setContainer(Container_TradeTable container_TradeTable) {
+ this.container = container_TradeTable;
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid"));
+ this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput"));
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ this.inventoryGrid.readFromNBT(nbt);
+ this.inventoryOutputs.readFromNBT(nbt);
+ super.readFromNBT(nbt);
+ }
+
+ @Override
+ public void updateEntity() {
+ if (!this.worldObj.isRemote) {
+ ItemStack slot0;
+ try {
+
+ slot0 = this.inventoryOutputs.getStackInSlot(0);
+ if (slot0 != null && slot0.hasTagCompound()) {
+ NBTUtils.tryIterateNBTData(slot0);
+ this.inventoryOutputs.setInventorySlotContents(0, null);
+ this.inventoryOutputs.setInventorySlotContents(1, slot0);
+ }
+
+ } catch (Throwable t) {
+ t.printStackTrace();
+ this.inventoryOutputs.setInventorySlotContents(0, null);
+ }
+ }
+ super.updateEntity();
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int p_70301_1_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {}
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
+ return true;
+ }
+
+ @Override
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
+ return false;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
+ return new int[] {};
+ }
+
+ @Override
+ public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/MovingAverageLong.java b/src/main/java/gtPlusPlus/core/util/MovingAverageLong.java
index f59aa20ecd..fee1fe84bc 100644
--- a/src/main/java/gtPlusPlus/core/util/MovingAverageLong.java
+++ b/src/main/java/gtPlusPlus/core/util/MovingAverageLong.java
@@ -1,11 +1,10 @@
package gtPlusPlus.core.util;
-import net.minecraft.nbt.NBTTagCompound;
-
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;
+import net.minecraft.nbt.NBTTagCompound;
public class MovingAverageLong {
private final long[] storage;
diff --git a/src/main/java/gtPlusPlus/core/util/Utils.java b/src/main/java/gtPlusPlus/core/util/Utils.java
index ac61abdd30..274d180de8 100644
--- a/src/main/java/gtPlusPlus/core/util/Utils.java
+++ b/src/main/java/gtPlusPlus/core/util/Utils.java
@@ -1,36 +1,11 @@
package gtPlusPlus.core.util;
-import java.awt.Color;
-import java.awt.Graphics;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import javax.xml.bind.DatatypeConverter;
-
-import org.apache.commons.lang3.EnumUtils;
-
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
@@ -55,6 +30,26 @@ import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner;
import ic2.core.Ic2Items;
import ic2.core.init.InternalName;
import ic2.core.item.resources.ItemCell;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.ObjectOutput;
+import java.io.ObjectOutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+import javax.xml.bind.DatatypeConverter;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
@@ -73,888 +68,921 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
+import org.apache.commons.lang3.EnumUtils;
public class Utils {
- public static final int WILDCARD_VALUE = Short.MAX_VALUE;
-
- public static final boolean isServer() {
- return FMLCommonHandler.instance().getEffectiveSide().isServer();
- }
-
- public static final boolean isClient() {
- return FMLCommonHandler.instance().getEffectiveSide().isClient();
- }
-
- static class ShortTimerTask extends TimerTask {
- @Override
- public void run() {
- Logger.WARNING("Timer expired.");
- }
- }
-
- public static TC_AspectStack getTcAspectStack(final TC_Aspects aspect, final long size) {
- return getTcAspectStack(aspect.name(), (int) size);
- }
-
- public static TC_AspectStack getTcAspectStack(final String aspect, final long size) {
- return getTcAspectStack(aspect, (int) size);
- }
-
- public static TC_AspectStack getTcAspectStack(final TC_Aspects aspect, final int size) {
- return getTcAspectStack(aspect.name(), size);
- }
-
- public static TC_AspectStack getTcAspectStack(final String aspect, final int size) {
-
- TC_AspectStack returnValue = null;
-
- if (aspect.toUpperCase().equals("COGNITIO")) {
- // Adds in Compat for older GT Versions which Misspell aspects.
- try {
- if (EnumUtils.isValidEnum(TC_Aspects.class, "COGNITIO")) {
- Logger.WARNING("TC Aspect found - " + aspect);
- returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITIO"), size);
- } else {
- Logger.INFO("Fallback TC Aspect found - " + aspect
- + " - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
- returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITO"), size);
- }
- } catch (final NoSuchFieldError r) {
- Logger.INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
- }
- } else if (aspect.toUpperCase().equals("EXANIMUS")) {
- // Adds in Compat for older GT Versions which Misspell aspects.
- try {
- if (EnumUtils.isValidEnum(TC_Aspects.class, "EXANIMUS")) {
- Logger.WARNING("TC Aspect found - " + aspect);
- returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXANIMUS"), size);
- } else {
- Logger.INFO("Fallback TC Aspect found - " + aspect
- + " - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
- returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXAMINIS"), size);
- }
- } catch (final NoSuchFieldError r) {
- Logger.INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
- }
-
- } else if (aspect.toUpperCase().equals("PRAECANTATIO")) {
- // Adds in Compat for older GT Versions which Misspell aspects.
- try {
- if (EnumUtils.isValidEnum(TC_Aspects.class, "PRAECANTATIO")) {
- Logger.WARNING("TC Aspect found - " + aspect);
- returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTATIO"), size);
- } else {
- Logger.INFO("Fallback TC Aspect found - " + aspect
- + " - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
- returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTIO"), size);
- }
- } catch (final NoSuchFieldError r) {
- Logger.INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
- }
- } else {
- Logger.WARNING("TC Aspect found - " + aspect);
- returnValue = new TC_AspectStack(TC_Aspects.valueOf(aspect), size);
- }
-
- return returnValue;
- }
-
- public static boolean containsMatch(final boolean strict, final ItemStack[] inputs, final ItemStack... targets) {
- for (final ItemStack input : inputs) {
- for (final ItemStack target : targets) {
- if (itemMatches(target, input, strict)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static boolean itemMatches(final ItemStack target, final ItemStack input, final boolean strict) {
- if ((input == null) || (target == null)) {
- return false;
- }
- return ((target.getItem() == input.getItem()) && (((target.getItemDamage() == WILDCARD_VALUE) && !strict)
- || (target.getItemDamage() == input.getItemDamage())));
- }
-
- //Register an event to both busses.
- public static void registerEvent(Object o){
- MinecraftForge.EVENT_BUS.register(o);
- FMLCommonHandler.instance().bus().register(o);
- }
-
- public static void paintBox(final Graphics g, final int MinA, final int MinB, final int MaxA, final int MaxB) {
- g.drawRect(MinA, MinB, MaxA, MaxB);
- }
-
- // Send a message to all players on the server
- public static void sendServerMessage(final String translationKey) {
- sendServerMessage(new ChatComponentText(translationKey));
- }
-
- // Send a message to all players on the server
- public static void sendServerMessage(final IChatComponent chatComponent) {
- MinecraftServer.getServer().getConfigurationManager().sendChatMsg(chatComponent);
- }
-
- /**
- * Returns if that Liquid is IC2Steam.
- */
- public static boolean isIC2Steam(final FluidStack aFluid) {
- if (aFluid == null) {
- return false;
- }
- return aFluid.isFluidEqual(getIC2Steam(1));
- }
-
- /**
- * Returns a Liquid Stack with given amount of IC2Steam.
- */
- public static FluidStack getIC2Steam(final long aAmount) {
- return FluidRegistry.getFluidStack("ic2steam", (int) aAmount);
- }
-
- /*
- * public static void recipeBuilderBlock(ItemStack slot_1, ItemStack slot_2,
- * ItemStack slot_3, ItemStack slot_4, ItemStack slot_5, ItemStack slot_6,
- * ItemStack slot_7, ItemStack slot_8, ItemStack slot_9, Block resultBlock){
- * GameRegistry.addRecipe(new ItemStack(resultBlock), new Object[] {"ABC",
- * "DEF", "GHI", 'A',slot_1,'B',slot_2,'C',slot_3,
- * 'D',slot_4,'E',slot_5,'F',slot_6, 'G',slot_7,'H',slot_8,'I',slot_9 }); }
- */
-
- public static String checkCorrectMiningToolForBlock(final Block currentBlock, final World currentWorld) {
- String correctTool = "";
- if (!currentWorld.isRemote) {
- try {
- correctTool = currentBlock.getHarvestTool(0);
- Logger.WARNING(correctTool);
-
- } catch (final NullPointerException e) {
-
- }
- }
-
- return correctTool;
- }
-
- /**
- *
- * @param colourStr
- * e.g. "#FFFFFF"
- * @return String - formatted "rgb(0,0,0)"
- */
- public static String hex2RgbFormatted(final String hexString) {
- final Color c = new Color(Integer.valueOf(hexString.substring(1, 3), 16),
- Integer.valueOf(hexString.substring(3, 5), 16), Integer.valueOf(hexString.substring(5, 7), 16));
-
- final StringBuffer sb = new StringBuffer();
- sb.append("rgb(");
- sb.append(c.getRed());
- sb.append(",");
- sb.append(c.getGreen());
- sb.append(",");
- sb.append(c.getBlue());
- sb.append(")");
- return sb.toString();
- }
-
- /**
- *
- * @param colourStr
- * e.g. "#FFFFFF"
- * @return
- */
- public static Color hex2Rgb(final String colorStr) {
- return new Color(Integer.valueOf(colorStr.substring(1, 3), 16), Integer.valueOf(colorStr.substring(3, 5), 16),
- Integer.valueOf(colorStr.substring(5, 7), 16));
- }
-
- /**
- *
- * @param colourInt
- * e.g. 0XFFFFFF
- * @return Colour
- */
- public static Color hex2Rgb(final int colourInt) {
- return Color.decode(String.valueOf(colourInt));
- }
-
- /**
- *
- * @param colourInt
- * e.g. 0XFFFFFF
- * @return short[]
- */
- public static short[] hex2RgbShort(final int colourInt) {
- final Color rgb = Color.decode(String.valueOf(colourInt));
- final short[] rgba = { (short) rgb.getRed(), (short) rgb.getGreen(), (short) rgb.getBlue(),
- (short) rgb.getAlpha() };
- return rgba;
- }
-
- public static Timer ShortTimer(final int seconds) {
- Timer timer;
- timer = new Timer();
- timer.schedule(new ShortTimerTask(), seconds * 1000);
- return timer;
- }
-
- public static String byteToHex(final byte b) {
- final int i = b & 0xFF;
- return Integer.toHexString(i);
- }
-
- public static Object[] convertListToArray(final List<Object> sourceList) {
- final Object[] targetArray = sourceList.toArray(new Object[sourceList.size()]);
- return targetArray;
- }
-
- public static List<Object> convertArrayToFixedSizeList(final Object[] sourceArray) {
- final List<Object> targetList = Arrays.asList(sourceArray);
- return targetList;
- }
-
- public static List<Object> convertArrayToList(final Object[] sourceArray) {
- final List<Object> targetList = new ArrayList<>(Arrays.asList(sourceArray));
- return targetList;
- }
-
- public static List<Object> convertArrayListToList(final ArrayList<Object> sourceArray) {
- final List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray));
- return targetList;
- }
-
- public static void spawnCustomParticle(final Entity entity) {
- GTplusplus.proxy.generateMysteriousParticles(entity);
- }
-
- public static void spawnFX(final World world, final int x, final int y, final int z, final String particleName,
- Object particleName2) {
- if (!world.isRemote) {
- if ((particleName2 == null) || particleName2.equals("")) {
- particleName2 = particleName;
- }
- final int l = MathUtils.randInt(0, 4);
- final double d0 = x + 0.5F;
- final double d1 = y + 0.7F;
- final double d2 = z + 0.5F;
- final double d3 = 0.2199999988079071D;
- final double d4 = 0.27000001072883606D;
-
- if (l == 1) {
- world.spawnParticle(particleName, d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
- } else if (l == 2) {
- world.spawnParticle((String) particleName2, d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
- } else if (l == 3) {
- world.spawnParticle(particleName, d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
- } else if (l == 4) {
- world.spawnParticle((String) particleName2, d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
- } else {
- world.spawnParticle(particleName, d0, d1, d2, 0.0D, 0.0D, 0.0D);
- if (particleName2 != null) {
- world.spawnParticle((String) particleName2, d0, d1, d2, 0.0D, 0.0D, 0.0D);
- }
- }
- }
- }
-
- public static int rgbtoHexValue(final int r, final int g, final int b) {
- if ((r > 255) || (g > 255) || (b > 255) || (r < 0) || (g < 0) || (b < 0)) {
- return 0;
- }
- final Color c = new Color(r, g, b);
- String temp = Integer.toHexString(c.getRGB() & 0xFFFFFF).toUpperCase();
- temp = Utils.appenedHexNotationToString(String.valueOf(temp));
- Logger.WARNING("Made " + temp + " - Hopefully it's not a mess.");
- Logger.WARNING("It will decode into " + Integer.decode(temp) + ".");
- return Integer.decode(temp);
- }
-
- /*
- * http://javadevnotes.com/java-left-pad-string-with-zeros-examples
- */
- public static String padWithZerosLefts(final String originalString, final int length) {
- final StringBuilder sb = new StringBuilder();
- while ((sb.length() + originalString.length()) < length) {
- sb.append('0');
- }
- sb.append(originalString);
- final String paddedString = sb.toString();
- return paddedString;
- }
-
- public static String padWithZerosRight(final int value, final int length) {
- String originalString = String.valueOf(value);
- final StringBuilder sb = new StringBuilder();
- while ((sb.length() + originalString.length()) < length) {
- sb.append('0');
- }
- //sb.append(originalString);
- if (sb.length() > 0)
- originalString = (originalString + sb.toString());
- final String paddedString = sb.toString();
- return originalString;
- }
-
- /*
- * Original Code by Chandana Napagoda -
- * https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.
- * html
- */
- public static Map<Integer, String> hexColourGenerator(final int colorCount) {
- final int maxColorValue = 16777215;
- // this is decimal value of the "FFFFFF"
- final int devidedvalue = maxColorValue / colorCount;
- int countValue = 0;
- final HashMap<Integer, String> hexColorMap = new HashMap<>();
- for (int a = 0; (a < colorCount) && (maxColorValue >= countValue); a++) {
- if (a != 0) {
- countValue += devidedvalue;
- hexColorMap.put(a, Integer.toHexString(0x10000 | countValue).substring(1).toUpperCase());
- } else {
- hexColorMap.put(a, Integer.toHexString(0x10000 | countValue).substring(1).toUpperCase());
- }
- }
- return hexColorMap;
- }
-
- /*
- * Original Code by Chandana Napagoda -
- * https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.
- * html
- */
- public static Map<Integer, String> hexColourGeneratorRandom(final int colorCount) {
- final HashMap<Integer, String> hexColorMap = new HashMap<>();
- for (int a = 0; a < colorCount; a++) {
- String code = "" + (int) (Math.random() * 256);
- code = code + code + code;
- final int i = Integer.parseInt(code);
- hexColorMap.put(a, Integer.toHexString(0x1000000 | i).substring(1).toUpperCase());
- Logger.WARNING("" + Integer.toHexString(0x1000000 | i).substring(1).toUpperCase());
- }
- return hexColorMap;
- }
-
- public static String appenedHexNotationToString(final Object hexAsStringOrInt) {
- final String hexChar = "0x";
- String result;
- if (hexAsStringOrInt.getClass() == String.class) {
-
- if (((String) hexAsStringOrInt).length() != 6) {
- final String temp = padWithZerosLefts((String) hexAsStringOrInt, 6);
- result = temp;
- }
- result = hexChar + hexAsStringOrInt;
- return result;
- } else if (hexAsStringOrInt.getClass() == Integer.class || hexAsStringOrInt.getClass() == int.class) {
- String aa = String.valueOf(hexAsStringOrInt);
- if (aa.length() != 6) {
- final String temp = padWithZerosLefts(aa, 6);
- result = temp;
- }
- else {
- result = hexChar + String.valueOf(hexAsStringOrInt);
- }
- return result;
- } else {
- return null;
- }
- }
-
- public static Integer appenedHexNotationToInteger(final int hexAsStringOrInt) {
- final String hexChar = "0x";
- String result;
- Logger.WARNING(String.valueOf(hexAsStringOrInt));
- result = hexChar + String.valueOf(hexAsStringOrInt);
- return Integer.getInteger(result);
- }
-
- public static boolean doesEntryExistAlreadyInOreDictionary(final String OreDictName) {
- if (OreDictionary.getOres(OreDictName).size() != 0) {
- return true;
- }
- return false;
- }
-
- public static boolean invertBoolean(final boolean booleans) {
- if (booleans == true) {
- return false;
- }
- return true;
- }
-
- public static File getMcDir() {
- if (Utils.isClient()) {
- if (Minecraft.getMinecraft() != null) {
- return Minecraft.getMinecraft().mcDataDir;
- }
- }
- return new File(".");
- }
-
- private static short cellID = 15;
-
- public static ItemStack createInternalNameAndFluidCell(final String s) {
- Logger.WARNING("1");
- final InternalName yourName = EnumHelper.addEnum(InternalName.class, s, new Class[0], new Object[0]);
- Logger.WARNING("2 " + yourName.name());
- final ItemCell item = (ItemCell) Ic2Items.cell.getItem();
- Logger.WARNING("3 " + item.getUnlocalizedName());
- try {
- Logger.WARNING("4");
- final Class<? extends ItemCell> clz = item.getClass();
- Logger.WARNING("5 " + clz.getSimpleName());
- final Method methode = clz.getDeclaredMethod("addCell", int.class, InternalName.class, Block[].class);
- Logger.WARNING("6 " + methode.getName());
- methode.setAccessible(true);
- Logger.WARNING("7 " + methode.isAccessible());
- final ItemStack temp = (ItemStack) methode.invoke(item, cellID++, yourName, new Block[0]);
- Logger.WARNING("Successfully created " + temp.getDisplayName() + "s.");
- FluidContainerRegistry.registerFluidContainer(FluidUtils.getFluidStack(s.toLowerCase(), 1000), temp.copy(),
- Ic2Items.cell.copy());
- ItemUtils.addItemToOreDictionary(temp.copy(), "cell" + s);
- return temp;
- } catch (final Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static ItemStack createInternalNameAndFluidCellNoOreDict(final String s) {
- Logger.WARNING("1");
- final InternalName yourName = EnumHelper.addEnum(InternalName.class, s, new Class[0], new Object[0]);
- Logger.WARNING("2 " + yourName.name());
- final ItemCell item = (ItemCell) Ic2Items.cell.getItem();
- Logger.WARNING("3 " + item.getUnlocalizedName());
- try {
- Logger.WARNING("4");
- final Class<? extends ItemCell> clz = item.getClass();
- Logger.WARNING("5 " + clz.getSimpleName());
- final Method methode = clz.getDeclaredMethod("addCell", int.class, InternalName.class, Block[].class);
- Logger.WARNING("6 " + methode.getName());
- methode.setAccessible(true);
- Logger.WARNING("7 " + methode.isAccessible());
- final ItemStack temp = (ItemStack) methode.invoke(item, cellID++, yourName, new Block[0]);
- Logger.WARNING("Successfully created " + temp.getDisplayName() + "s.");
- FluidContainerRegistry.registerFluidContainer(FluidUtils.getFluidStack(s.toLowerCase(), 1000), temp.copy(),
- Ic2Items.cell.copy());
- // ItemUtils.addItemToOreDictionary(temp.copy(), "cell"+s);
- return temp;
- } catch (final Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static String sanitizeString(final String input, final char[] aDontRemove) {
-
- String output;
- AutoMap<String> aToRemoveMap = new AutoMap<String>();
-
- aToRemoveMap.put(" ");
- aToRemoveMap.put("-");
- aToRemoveMap.put("_");
- aToRemoveMap.put("~");
- aToRemoveMap.put("?");
- aToRemoveMap.put("!");
- aToRemoveMap.put("@");
- aToRemoveMap.put("#");
- aToRemoveMap.put("$");
- aToRemoveMap.put("%");
- aToRemoveMap.put("^");
- aToRemoveMap.put("&");
- aToRemoveMap.put("*");
- aToRemoveMap.put("(");
- aToRemoveMap.put(")");
- aToRemoveMap.put("{");
- aToRemoveMap.put("}");
- aToRemoveMap.put("[");
- aToRemoveMap.put("]");
- aToRemoveMap.put(" ");
-
- for (String s : aToRemoveMap) {
- for (char e : aDontRemove) {
- if (s.charAt(0) == e) {
- aToRemoveMap.remove("s");
- }
- }
- }
- output = input;
- for (String A : aToRemoveMap) {
- output = output.replace(A, "");
- }
- return output;
-
- }
-
- public static String sanitizeString(final String input) {
- String temp;
- String output;
-
- temp = input.replace(" ", "");
- temp = temp.replace("-", "");
- temp = temp.replace("_", "");
- temp = temp.replace("?", "");
- temp = temp.replace("!", "");
- temp = temp.replace("@", "");
- temp = temp.replace("#", "");
- temp = temp.replace("(", "");
- temp = temp.replace(")", "");
- temp = temp.replace("{", "");
- temp = temp.replace("}", "");
- temp = temp.replace("[", "");
- temp = temp.replace("]", "");
- temp = temp.replace(" ", "");
- output = temp;
- return output;
-
- }
-
- public static String sanitizeStringKeepBrackets(final String input) {
- String temp;
- String output;
-
- temp = input.replace(" ", "");
- temp = temp.replace("-", "");
- temp = temp.replace("_", "");
- temp = temp.replace("?", "");
- temp = temp.replace("!", "");
- temp = temp.replace("@", "");
- temp = temp.replace("#", "");
- temp = temp.replace(" ", "");
- output = temp;
- return output;
-
- }
-
- public static String[] parseVersion(final String version) {
- return parseVersion(version, "//.");
- }
-
- public static String[] parseVersion(final String version, final String delimiter) {
- final String[] versionArray = version.split(delimiter);
- return versionArray;
- }
-
- public static Versioning compareModVersion(final String currentVersion, final String expectedVersion) {
- return compareModVersion(currentVersion, expectedVersion, "//.");
- }
-
- public static Versioning compareModVersion(final String currentVersion, final String expectedVersion,
- final String delimiter) {
- final String[] a = parseVersion(currentVersion, delimiter);
- final String[] b = parseVersion(expectedVersion, delimiter);
- final int[] c = new int[a.length];
- final int[] d = new int[b.length];
- for (int r = 0; r < a.length; r++) {
- c[r] = Integer.parseInt(a[r]);
- }
- for (int r = 0; r < b.length; r++) {
- d[r] = Integer.parseInt(b[r]);
- }
- final Versioning[] e = new Versioning[MathUtils.returnLargestNumber(c.length, d.length)];
- for (int r = 0; r < e.length; r++) {
-
- if (c[r] > d[r]) {
- e[r] = Versioning.NEWER;
- } else if (c[r] < d[r]) {
- e[r] = Versioning.OLDER;
- } else if (c[r] == d[r]) {
- e[r] = Versioning.EQUAL;
- }
- }
-
- for (int r = 0; r < e.length; r++) {
- if (e[0] == Versioning.NEWER) {
- return Versioning.NEWER;
- } else if (e[0] == Versioning.OLDER) {
- return Versioning.OLDER;
- } else {
- if (e[r] == Versioning.OLDER) {
-
- }
-
- return Versioning.NEWER;
- }
- }
-
- return null;
- }
-
- public static ToolMaterial generateToolMaterialFromGT(final Materials gtMaterial) {
- final String name = Utils.sanitizeString(gtMaterial.mDefaultLocalName);
- final int harvestLevel = gtMaterial.mToolQuality;
- final int durability = gtMaterial.mDurability;
- final float damage = gtMaterial.mToolQuality;
- final int efficiency = (int) gtMaterial.mToolSpeed;
- final int enchantability = gtMaterial.mEnchantmentToolsLevel;
- final ToolMaterial temp = EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage,
- enchantability);
- return temp;
-
- }
-
- public static ToolMaterial generateToolMaterial(final Material material) {
- final String name = material.getLocalizedName();
- final int harvestLevel = material.vHarvestLevel;
- final int durability = (int) material.vDurability;
- final float damage = material.vToolQuality;
- final int efficiency = material.vToolQuality;
- // int enchantability = material.mEnchantmentToolsLevel;
- Logger.INFO("ToolMaterial stats for " + material.getLocalizedName() + " | harvestLevel:" + harvestLevel
- + " | durability:" + durability + " | toolQuality:" + damage + " | toolSpeed:" + damage);
- final ToolMaterial temp = EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage, 0);
- return temp;
-
- }
-
- public static enum Versioning {
- EQUAL(0), NEWER(1), OLDER(-1);
- private final int versioningInfo;
-
- private Versioning(final int versionStatus) {
- this.versioningInfo = versionStatus;
- }
-
- public int getTexture() {
- return this.versioningInfo;
- }
- }
+ public static final int WILDCARD_VALUE = Short.MAX_VALUE;
+
+ public static final boolean isServer() {
+ return FMLCommonHandler.instance().getEffectiveSide().isServer();
+ }
+
+ public static final boolean isClient() {
+ return FMLCommonHandler.instance().getEffectiveSide().isClient();
+ }
+
+ static class ShortTimerTask extends TimerTask {
+ @Override
+ public void run() {
+ Logger.WARNING("Timer expired.");
+ }
+ }
+
+ public static TC_AspectStack getTcAspectStack(final TC_Aspects aspect, final long size) {
+ return getTcAspectStack(aspect.name(), (int) size);
+ }
+
+ public static TC_AspectStack getTcAspectStack(final String aspect, final long size) {
+ return getTcAspectStack(aspect, (int) size);
+ }
+
+ public static TC_AspectStack getTcAspectStack(final TC_Aspects aspect, final int size) {
+ return getTcAspectStack(aspect.name(), size);
+ }
+
+ public static TC_AspectStack getTcAspectStack(final String aspect, final int size) {
+
+ TC_AspectStack returnValue = null;
+
+ if (aspect.toUpperCase().equals("COGNITIO")) {
+ // Adds in Compat for older GT Versions which Misspell aspects.
+ try {
+ if (EnumUtils.isValidEnum(TC_Aspects.class, "COGNITIO")) {
+ Logger.WARNING("TC Aspect found - " + aspect);
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITIO"), size);
+ } else {
+ Logger.INFO(
+ "Fallback TC Aspect found - " + aspect
+ + " - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITO"), size);
+ }
+ } catch (final NoSuchFieldError r) {
+ Logger.INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
+ }
+ } else if (aspect.toUpperCase().equals("EXANIMUS")) {
+ // Adds in Compat for older GT Versions which Misspell aspects.
+ try {
+ if (EnumUtils.isValidEnum(TC_Aspects.class, "EXANIMUS")) {
+ Logger.WARNING("TC Aspect found - " + aspect);
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXANIMUS"), size);
+ } else {
+ Logger.INFO(
+ "Fallback TC Aspect found - " + aspect
+ + " - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXAMINIS"), size);
+ }
+ } catch (final NoSuchFieldError r) {
+ Logger.INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
+ }
+
+ } else if (aspect.toUpperCase().equals("PRAECANTATIO")) {
+ // Adds in Compat for older GT Versions which Misspell aspects.
+ try {
+ if (EnumUtils.isValidEnum(TC_Aspects.class, "PRAECANTATIO")) {
+ Logger.WARNING("TC Aspect found - " + aspect);
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTATIO"), size);
+ } else {
+ Logger.INFO(
+ "Fallback TC Aspect found - " + aspect
+ + " - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTIO"), size);
+ }
+ } catch (final NoSuchFieldError r) {
+ Logger.INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
+ }
+ } else {
+ Logger.WARNING("TC Aspect found - " + aspect);
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf(aspect), size);
+ }
+
+ return returnValue;
+ }
+
+ public static boolean containsMatch(final boolean strict, final ItemStack[] inputs, final ItemStack... targets) {
+ for (final ItemStack input : inputs) {
+ for (final ItemStack target : targets) {
+ if (itemMatches(target, input, strict)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean itemMatches(final ItemStack target, final ItemStack input, final boolean strict) {
+ if ((input == null) || (target == null)) {
+ return false;
+ }
+ return ((target.getItem() == input.getItem())
+ && (((target.getItemDamage() == WILDCARD_VALUE) && !strict)
+ || (target.getItemDamage() == input.getItemDamage())));
+ }
+
+ // Register an event to both busses.
+ public static void registerEvent(Object o) {
+ MinecraftForge.EVENT_BUS.register(o);
+ FMLCommonHandler.instance().bus().register(o);
+ }
+
+ public static void paintBox(final Graphics g, final int MinA, final int MinB, final int MaxA, final int MaxB) {
+ g.drawRect(MinA, MinB, MaxA, MaxB);
+ }
+
+ // Send a message to all players on the server
+ public static void sendServerMessage(final String translationKey) {
+ sendServerMessage(new ChatComponentText(translationKey));
+ }
+
+ // Send a message to all players on the server
+ public static void sendServerMessage(final IChatComponent chatComponent) {
+ MinecraftServer.getServer().getConfigurationManager().sendChatMsg(chatComponent);
+ }
+
+ /**
+ * Returns if that Liquid is IC2Steam.
+ */
+ public static boolean isIC2Steam(final FluidStack aFluid) {
+ if (aFluid == null) {
+ return false;
+ }
+ return aFluid.isFluidEqual(getIC2Steam(1));
+ }
+
+ /**
+ * Returns a Liquid Stack with given amount of IC2Steam.
+ */
+ public static FluidStack getIC2Steam(final long aAmount) {
+ return FluidRegistry.getFluidStack("ic2steam", (int) aAmount);
+ }
+
+ /*
+ * public static void recipeBuilderBlock(ItemStack slot_1, ItemStack slot_2,
+ * ItemStack slot_3, ItemStack slot_4, ItemStack slot_5, ItemStack slot_6,
+ * ItemStack slot_7, ItemStack slot_8, ItemStack slot_9, Block resultBlock){
+ * GameRegistry.addRecipe(new ItemStack(resultBlock), new Object[] {"ABC",
+ * "DEF", "GHI", 'A',slot_1,'B',slot_2,'C',slot_3,
+ * 'D',slot_4,'E',slot_5,'F',slot_6, 'G',slot_7,'H',slot_8,'I',slot_9 }); }
+ */
+
+ public static String checkCorrectMiningToolForBlock(final Block currentBlock, final World currentWorld) {
+ String correctTool = "";
+ if (!currentWorld.isRemote) {
+ try {
+ correctTool = currentBlock.getHarvestTool(0);
+ Logger.WARNING(correctTool);
+
+ } catch (final NullPointerException e) {
+
+ }
+ }
+
+ return correctTool;
+ }
+
+ /**
+ *
+ * @param colourStr
+ * e.g. "#FFFFFF"
+ * @return String - formatted "rgb(0,0,0)"
+ */
+ public static String hex2RgbFormatted(final String hexString) {
+ final Color c = new Color(
+ Integer.valueOf(hexString.substring(1, 3), 16),
+ Integer.valueOf(hexString.substring(3, 5), 16),
+ Integer.valueOf(hexString.substring(5, 7), 16));
+
+ final StringBuffer sb = new StringBuffer();
+ sb.append("rgb(");
+ sb.append(c.getRed());
+ sb.append(",");
+ sb.append(c.getGreen());
+ sb.append(",");
+ sb.append(c.getBlue());
+ sb.append(")");
+ return sb.toString();
+ }
+
+ /**
+ *
+ * @param colourStr
+ * e.g. "#FFFFFF"
+ * @return
+ */
+ public static Color hex2Rgb(final String colorStr) {
+ return new Color(
+ Integer.valueOf(colorStr.substring(1, 3), 16),
+ Integer.valueOf(colorStr.substring(3, 5), 16),
+ Integer.valueOf(colorStr.substring(5, 7), 16));
+ }
+
+ /**
+ *
+ * @param colourInt
+ * e.g. 0XFFFFFF
+ * @return Colour
+ */
+ public static Color hex2Rgb(final int colourInt) {
+ return Color.decode(String.valueOf(colourInt));
+ }
+
+ /**
+ *
+ * @param colourInt
+ * e.g. 0XFFFFFF
+ * @return short[]
+ */
+ public static short[] hex2RgbShort(final int colourInt) {
+ final Color rgb = Color.decode(String.valueOf(colourInt));
+ final short[] rgba = {
+ (short) rgb.getRed(), (short) rgb.getGreen(), (short) rgb.getBlue(), (short) rgb.getAlpha()
+ };
+ return rgba;
+ }
+
+ public static Timer ShortTimer(final int seconds) {
+ Timer timer;
+ timer = new Timer();
+ timer.schedule(new ShortTimerTask(), seconds * 1000);
+ return timer;
+ }
+
+ public static String byteToHex(final byte b) {
+ final int i = b & 0xFF;
+ return Integer.toHexString(i);
+ }
+
+ public static Object[] convertListToArray(final List<Object> sourceList) {
+ final Object[] targetArray = sourceList.toArray(new Object[sourceList.size()]);
+ return targetArray;
+ }
+
+ public static List<Object> convertArrayToFixedSizeList(final Object[] sourceArray) {
+ final List<Object> targetList = Arrays.asList(sourceArray);
+ return targetList;
+ }
+
+ public static List<Object> convertArrayToList(final Object[] sourceArray) {
+ final List<Object> targetList = new ArrayList<>(Arrays.asList(sourceArray));
+ return targetList;
+ }
+
+ public static List<Object> convertArrayListToList(final ArrayList<Object> sourceArray) {
+ final List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray));
+ return targetList;
+ }
+
+ public static void spawnCustomParticle(final Entity entity) {
+ GTplusplus.proxy.generateMysteriousParticles(entity);
+ }
+
+ public static void spawnFX(
+ final World world, final int x, final int y, final int z, final String particleName, Object particleName2) {
+ if (!world.isRemote) {
+ if ((particleName2 == null) || particleName2.equals("")) {
+ particleName2 = particleName;
+ }
+ final int l = MathUtils.randInt(0, 4);
+ final double d0 = x + 0.5F;
+ final double d1 = y + 0.7F;
+ final double d2 = z + 0.5F;
+ final double d3 = 0.2199999988079071D;
+ final double d4 = 0.27000001072883606D;
+
+ if (l == 1) {
+ world.spawnParticle(particleName, d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
+ } else if (l == 2) {
+ world.spawnParticle((String) particleName2, d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
+ } else if (l == 3) {
+ world.spawnParticle(particleName, d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
+ } else if (l == 4) {
+ world.spawnParticle((String) particleName2, d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
+ } else {
+ world.spawnParticle(particleName, d0, d1, d2, 0.0D, 0.0D, 0.0D);
+ if (particleName2 != null) {
+ world.spawnParticle((String) particleName2, d0, d1, d2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+ }
+
+ public static int rgbtoHexValue(final int r, final int g, final int b) {
+ if ((r > 255) || (g > 255) || (b > 255) || (r < 0) || (g < 0) || (b < 0)) {
+ return 0;
+ }
+ final Color c = new Color(r, g, b);
+ String temp = Integer.toHexString(c.getRGB() & 0xFFFFFF).toUpperCase();
+ temp = Utils.appenedHexNotationToString(String.valueOf(temp));
+ Logger.WARNING("Made " + temp + " - Hopefully it's not a mess.");
+ Logger.WARNING("It will decode into " + Integer.decode(temp) + ".");
+ return Integer.decode(temp);
+ }
+
+ /*
+ * http://javadevnotes.com/java-left-pad-string-with-zeros-examples
+ */
+ public static String padWithZerosLefts(final String originalString, final int length) {
+ final StringBuilder sb = new StringBuilder();
+ while ((sb.length() + originalString.length()) < length) {
+ sb.append('0');
+ }
+ sb.append(originalString);
+ final String paddedString = sb.toString();
+ return paddedString;
+ }
+
+ public static String padWithZerosRight(final int value, final int length) {
+ String originalString = String.valueOf(value);
+ final StringBuilder sb = new StringBuilder();
+ while ((sb.length() + originalString.length()) < length) {
+ sb.append('0');
+ }
+ // sb.append(originalString);
+ if (sb.length() > 0) originalString = (originalString + sb.toString());
+ final String paddedString = sb.toString();
+ return originalString;
+ }
+
+ /*
+ * Original Code by Chandana Napagoda -
+ * https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.
+ * html
+ */
+ public static Map<Integer, String> hexColourGenerator(final int colorCount) {
+ final int maxColorValue = 16777215;
+ // this is decimal value of the "FFFFFF"
+ final int devidedvalue = maxColorValue / colorCount;
+ int countValue = 0;
+ final HashMap<Integer, String> hexColorMap = new HashMap<>();
+ for (int a = 0; (a < colorCount) && (maxColorValue >= countValue); a++) {
+ if (a != 0) {
+ countValue += devidedvalue;
+ hexColorMap.put(
+ a,
+ Integer.toHexString(0x10000 | countValue).substring(1).toUpperCase());
+ } else {
+ hexColorMap.put(
+ a,
+ Integer.toHexString(0x10000 | countValue).substring(1).toUpperCase());
+ }
+ }
+ return hexColorMap;
+ }
+
+ /*
+ * Original Code by Chandana Napagoda -
+ * https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.
+ * html
+ */
+ public static Map<Integer, String> hexColourGeneratorRandom(final int colorCount) {
+ final HashMap<Integer, String> hexColorMap = new HashMap<>();
+ for (int a = 0; a < colorCount; a++) {
+ String code = "" + (int) (Math.random() * 256);
+ code = code + code + code;
+ final int i = Integer.parseInt(code);
+ hexColorMap.put(a, Integer.toHexString(0x1000000 | i).substring(1).toUpperCase());
+ Logger.WARNING("" + Integer.toHexString(0x1000000 | i).substring(1).toUpperCase());
+ }
+ return hexColorMap;
+ }
+
+ public static String appenedHexNotationToString(final Object hexAsStringOrInt) {
+ final String hexChar = "0x";
+ String result;
+ if (hexAsStringOrInt.getClass() == String.class) {
+
+ if (((String) hexAsStringOrInt).length() != 6) {
+ final String temp = padWithZerosLefts((String) hexAsStringOrInt, 6);
+ result = temp;
+ }
+ result = hexChar + hexAsStringOrInt;
+ return result;
+ } else if (hexAsStringOrInt.getClass() == Integer.class || hexAsStringOrInt.getClass() == int.class) {
+ String aa = String.valueOf(hexAsStringOrInt);
+ if (aa.length() != 6) {
+ final String temp = padWithZerosLefts(aa, 6);
+ result = temp;
+ } else {
+ result = hexChar + String.valueOf(hexAsStringOrInt);
+ }
+ return result;
+ } else {
+ return null;
+ }
+ }
+
+ public static Integer appenedHexNotationToInteger(final int hexAsStringOrInt) {
+ final String hexChar = "0x";
+ String result;
+ Logger.WARNING(String.valueOf(hexAsStringOrInt));
+ result = hexChar + String.valueOf(hexAsStringOrInt);
+ return Integer.getInteger(result);
+ }
+
+ public static boolean doesEntryExistAlreadyInOreDictionary(final String OreDictName) {
+ if (OreDictionary.getOres(OreDictName).size() != 0) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean invertBoolean(final boolean booleans) {
+ if (booleans == true) {
+ return false;
+ }
+ return true;
+ }
+
+ public static File getMcDir() {
+ if (Utils.isClient()) {
+ if (Minecraft.getMinecraft() != null) {
+ return Minecraft.getMinecraft().mcDataDir;
+ }
+ }
+ return new File(".");
+ }
+
+ private static short cellID = 15;
+
+ public static ItemStack createInternalNameAndFluidCell(final String s) {
+ Logger.WARNING("1");
+ final InternalName yourName = EnumHelper.addEnum(InternalName.class, s, new Class[0], new Object[0]);
+ Logger.WARNING("2 " + yourName.name());
+ final ItemCell item = (ItemCell) Ic2Items.cell.getItem();
+ Logger.WARNING("3 " + item.getUnlocalizedName());
+ try {
+ Logger.WARNING("4");
+ final Class<? extends ItemCell> clz = item.getClass();
+ Logger.WARNING("5 " + clz.getSimpleName());
+ final Method methode = clz.getDeclaredMethod("addCell", int.class, InternalName.class, Block[].class);
+ Logger.WARNING("6 " + methode.getName());
+ methode.setAccessible(true);
+ Logger.WARNING("7 " + methode.isAccessible());
+ final ItemStack temp = (ItemStack) methode.invoke(item, cellID++, yourName, new Block[0]);
+ Logger.WARNING("Successfully created " + temp.getDisplayName() + "s.");
+ FluidContainerRegistry.registerFluidContainer(
+ FluidUtils.getFluidStack(s.toLowerCase(), 1000), temp.copy(), Ic2Items.cell.copy());
+ ItemUtils.addItemToOreDictionary(temp.copy(), "cell" + s);
+ return temp;
+ } catch (final Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static ItemStack createInternalNameAndFluidCellNoOreDict(final String s) {
+ Logger.WARNING("1");
+ final InternalName yourName = EnumHelper.addEnum(InternalName.class, s, new Class[0], new Object[0]);
+ Logger.WARNING("2 " + yourName.name());
+ final ItemCell item = (ItemCell) Ic2Items.cell.getItem();
+ Logger.WARNING("3 " + item.getUnlocalizedName());
+ try {
+ Logger.WARNING("4");
+ final Class<? extends ItemCell> clz = item.getClass();
+ Logger.WARNING("5 " + clz.getSimpleName());
+ final Method methode = clz.getDeclaredMethod("addCell", int.class, InternalName.class, Block[].class);
+ Logger.WARNING("6 " + methode.getName());
+ methode.setAccessible(true);
+ Logger.WARNING("7 " + methode.isAccessible());
+ final ItemStack temp = (ItemStack) methode.invoke(item, cellID++, yourName, new Block[0]);
+ Logger.WARNING("Successfully created " + temp.getDisplayName() + "s.");
+ FluidContainerRegistry.registerFluidContainer(
+ FluidUtils.getFluidStack(s.toLowerCase(), 1000), temp.copy(), Ic2Items.cell.copy());
+ // ItemUtils.addItemToOreDictionary(temp.copy(), "cell"+s);
+ return temp;
+ } catch (final Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static String sanitizeString(final String input, final char[] aDontRemove) {
+
+ String output;
+ AutoMap<String> aToRemoveMap = new AutoMap<String>();
+
+ aToRemoveMap.put(" ");
+ aToRemoveMap.put("-");
+ aToRemoveMap.put("_");
+ aToRemoveMap.put("~");
+ aToRemoveMap.put("?");
+ aToRemoveMap.put("!");
+ aToRemoveMap.put("@");
+ aToRemoveMap.put("#");
+ aToRemoveMap.put("$");
+ aToRemoveMap.put("%");
+ aToRemoveMap.put("^");
+ aToRemoveMap.put("&");
+ aToRemoveMap.put("*");
+ aToRemoveMap.put("(");
+ aToRemoveMap.put(")");
+ aToRemoveMap.put("{");
+ aToRemoveMap.put("}");
+ aToRemoveMap.put("[");
+ aToRemoveMap.put("]");
+ aToRemoveMap.put(" ");
+
+ for (String s : aToRemoveMap) {
+ for (char e : aDontRemove) {
+ if (s.charAt(0) == e) {
+ aToRemoveMap.remove("s");
+ }
+ }
+ }
+ output = input;
+ for (String A : aToRemoveMap) {
+ output = output.replace(A, "");
+ }
+ return output;
+ }
+
+ public static String sanitizeString(final String input) {
+ String temp;
+ String output;
+
+ temp = input.replace(" ", "");
+ temp = temp.replace("-", "");
+ temp = temp.replace("_", "");
+ temp = temp.replace("?", "");
+ temp = temp.replace("!", "");
+ temp = temp.replace("@", "");
+ temp = temp.replace("#", "");
+ temp = temp.replace("(", "");
+ temp = temp.replace(")", "");
+ temp = temp.replace("{", "");
+ temp = temp.replace("}", "");
+ temp = temp.replace("[", "");
+ temp = temp.replace("]", "");
+ temp = temp.replace(" ", "");
+ output = temp;
+ return output;
+ }
+
+ public static String sanitizeStringKeepBrackets(final String input) {
+ String temp;
+ String output;
+
+ temp = input.replace(" ", "");
+ temp = temp.replace("-", "");
+ temp = temp.replace("_", "");
+ temp = temp.replace("?", "");
+ temp = temp.replace("!", "");
+ temp = temp.replace("@", "");
+ temp = temp.replace("#", "");
+ temp = temp.replace(" ", "");
+ output = temp;
+ return output;
+ }
+
+ public static String[] parseVersion(final String version) {
+ return parseVersion(version, "//.");
+ }
+
+ public static String[] parseVersion(final String version, final String delimiter) {
+ final String[] versionArray = version.split(delimiter);
+ return versionArray;
+ }
+
+ public static Versioning compareModVersion(final String currentVersion, final String expectedVersion) {
+ return compareModVersion(currentVersion, expectedVersion, "//.");
+ }
+
+ public static Versioning compareModVersion(
+ final String currentVersion, final String expectedVersion, final String delimiter) {
+ final String[] a = parseVersion(currentVersion, delimiter);
+ final String[] b = parseVersion(expectedVersion, delimiter);
+ final int[] c = new int[a.length];
+ final int[] d = new int[b.length];
+ for (int r = 0; r < a.length; r++) {
+ c[r] = Integer.parseInt(a[r]);
+ }
+ for (int r = 0; r < b.length; r++) {
+ d[r] = Integer.parseInt(b[r]);
+ }
+ final Versioning[] e = new Versioning[MathUtils.returnLargestNumber(c.length, d.length)];
+ for (int r = 0; r < e.length; r++) {
+
+ if (c[r] > d[r]) {
+ e[r] = Versioning.NEWER;
+ } else if (c[r] < d[r]) {
+ e[r] = Versioning.OLDER;
+ } else if (c[r] == d[r]) {
+ e[r] = Versioning.EQUAL;
+ }
+ }
+
+ for (int r = 0; r < e.length; r++) {
+ if (e[0] == Versioning.NEWER) {
+ return Versioning.NEWER;
+ } else if (e[0] == Versioning.OLDER) {
+ return Versioning.OLDER;
+ } else {
+ if (e[r] == Versioning.OLDER) {}
+
+ return Versioning.NEWER;
+ }
+ }
+
+ return null;
+ }
+
+ public static ToolMaterial generateToolMaterialFromGT(final Materials gtMaterial) {
+ final String name = Utils.sanitizeString(gtMaterial.mDefaultLocalName);
+ final int harvestLevel = gtMaterial.mToolQuality;
+ final int durability = gtMaterial.mDurability;
+ final float damage = gtMaterial.mToolQuality;
+ final int efficiency = (int) gtMaterial.mToolSpeed;
+ final int enchantability = gtMaterial.mEnchantmentToolsLevel;
+ final ToolMaterial temp =
+ EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage, enchantability);
+ return temp;
+ }
+
+ public static ToolMaterial generateToolMaterial(final Material material) {
+ final String name = material.getLocalizedName();
+ final int harvestLevel = material.vHarvestLevel;
+ final int durability = (int) material.vDurability;
+ final float damage = material.vToolQuality;
+ final int efficiency = material.vToolQuality;
+ // int enchantability = material.mEnchantmentToolsLevel;
+ Logger.INFO("ToolMaterial stats for " + material.getLocalizedName() + " | harvestLevel:" + harvestLevel
+ + " | durability:" + durability + " | toolQuality:" + damage + " | toolSpeed:" + damage);
+ final ToolMaterial temp = EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage, 0);
+ return temp;
+ }
+
+ public static enum Versioning {
+ EQUAL(0),
+ NEWER(1),
+ OLDER(-1);
+ private final int versioningInfo;
+
+ private Versioning(final int versionStatus) {
+ this.versioningInfo = versionStatus;
+ }
+
+ public int getTexture() {
+ return this.versioningInfo;
+ }
+ }
public static String addBookTitleLocalization(final String aTitle) {
return GT_LanguageManager.addStringLocalization(
- new StringBuilder().append("Book.").append(aTitle).append(".Name").toString(), aTitle, !GregTech_API.sPostloadFinished);
+ new StringBuilder()
+ .append("Book.")
+ .append(aTitle)
+ .append(".Name")
+ .toString(),
+ aTitle,
+ !GregTech_API.sPostloadFinished);
}
public static String[] addBookPagesLocalization(final String aTitle, final String[] aPages) {
String[] aLocalizationPages = new String[aPages.length];
for (byte i = 0; i < aPages.length; i = (byte) (i + 1)) {
- aLocalizationPages[i] = GT_LanguageManager
- .addStringLocalization(new StringBuilder().append("Book.").append(aTitle).append(".Page")
- .append((i < 10) ? new StringBuilder().append("0").append(i).toString() : Byte.valueOf(i))
- .toString(), aPages[i], !GregTech_API.sPostloadFinished);
+ aLocalizationPages[i] = GT_LanguageManager.addStringLocalization(
+ new StringBuilder()
+ .append("Book.")
+ .append(aTitle)
+ .append(".Page")
+ .append(
+ (i < 10)
+ ? new StringBuilder()
+ .append("0")
+ .append(i)
+ .toString()
+ : Byte.valueOf(i))
+ .toString(),
+ aPages[i],
+ !GregTech_API.sPostloadFinished);
}
return aLocalizationPages;
}
- public static ItemStack getWrittenBook(final ItemStack aBook, final int aID, final String aMapping, final String aTitle, final String aAuthor,
- final String[] aPages) {
- if (GT_Utility.isStringInvalid(aMapping)) {
- return null;
- }
- ItemStack rStack = CORE.sBookList.get(aMapping);
- if (rStack != null) {
- return GT_Utility.copyAmount(1L, new Object[] { rStack });
- }
- if ((GT_Utility.isStringInvalid(aTitle)) || (GT_Utility.isStringInvalid(aAuthor)) || (aPages.length <= 0)) {
- return null;
- }
- final int vMeta = aID;
- rStack = (aBook == null ? new ItemStack(ModItems.itemCustomBook, 1, vMeta) : aBook);
- final NBTTagCompound tNBT = new NBTTagCompound();
+ public static ItemStack getWrittenBook(
+ final ItemStack aBook,
+ final int aID,
+ final String aMapping,
+ final String aTitle,
+ final String aAuthor,
+ final String[] aPages) {
+ if (GT_Utility.isStringInvalid(aMapping)) {
+ return null;
+ }
+ ItemStack rStack = CORE.sBookList.get(aMapping);
+ if (rStack != null) {
+ return GT_Utility.copyAmount(1L, new Object[] {rStack});
+ }
+ if ((GT_Utility.isStringInvalid(aTitle)) || (GT_Utility.isStringInvalid(aAuthor)) || (aPages.length <= 0)) {
+ return null;
+ }
+ final int vMeta = aID;
+ rStack = (aBook == null ? new ItemStack(ModItems.itemCustomBook, 1, vMeta) : aBook);
+ final NBTTagCompound tNBT = new NBTTagCompound();
String localizationTitle = addBookTitleLocalization(aTitle);
- tNBT.setString("title", localizationTitle);
- tNBT.setString("author", aAuthor);
- final NBTTagList tNBTList = new NBTTagList();
+ tNBT.setString("title", localizationTitle);
+ tNBT.setString("author", aAuthor);
+ final NBTTagList tNBTList = new NBTTagList();
final String[] aLocalizationPages = addBookPagesLocalization(aTitle, aPages);
for (byte i = 0; i < aPages.length; i = (byte) (i + 1)) {
- aPages[i] = aLocalizationPages[i].replaceAll("<BR>", "\n");
- if (i < 48) {
- if (aPages[i].length() < 256) {
- tNBTList.appendTag(new NBTTagString(aPages[i]));
- }
- else {
- Logger.INFO("WARNING: String for written Book too long! -> "+aPages[i]);
- GT_Log.err.println(new StringBuilder().append("WARNING: String for written Book too long! -> ")
- .append(aPages[i]).toString());
- }
- } else {
- Logger.INFO("WARNING: Too much Pages for written Book! -> "+aTitle);
- GT_Log.err.println(new StringBuilder().append("WARNING: Too much Pages for written Book! -> ")
- .append(aTitle).toString());
- break;
- }
- }
- tNBTList.appendTag(new NBTTagString(new StringBuilder().append("Credits to ").append(aAuthor)
- .append(" for writing this Book. This was Book Nr. ").append(aID)
- .append(" at its creation. Gotta get 'em all!").toString()));
- tNBT.setTag("pages", tNBTList);
- rStack.setTagCompound(tNBT);
- GT_Log.out.println(new StringBuilder().append("GT++_Mod: Added Book to Book++ List - Mapping: '")
- .append(aMapping).append("' - Name: '").append(aTitle).append("' - Author: '").append(aAuthor)
- .append("'").toString());
- NBTUtils.createIntegerTagCompound(rStack, "stats", "mMeta", vMeta);
- CORE.sBookList.put(aMapping, rStack);
- Logger.INFO("Creating book: " + aTitle + " by " + aAuthor + ". Using Meta " + vMeta + ".");
- return GT_Utility.copy(new Object[] { rStack });
- }
-
- @SuppressWarnings({ "unused", "unchecked" })
- public static Pair<Integer, Integer> getGregtechVersion(){
- Pair<Integer, Integer> version;
- if (GT_Mod.VERSION == 509){
- Class<GT_Mod> clazz;
- try {
-
- if (LoadedMods.BeyondRealityCore) {
- //Safely assume it's Beyond Reality running .28-pre (If it's not, tough shit really?)
- return new Pair<Integer, Integer>(9, 28);
- }
-
- clazz = (Class<GT_Mod>) ReflectionUtils.getClass("gregtech.GT_Mod");
- Field mSubversion = ReflectionUtils.getField(clazz, "SUBVERSION");
- if (mSubversion != null){
- int mSub = 0;
- mSub = mSubversion.getInt(clazz);
- if (mSub != 0){
- version = new Pair<Integer, Integer>(9, mSub);
- return version;
- }
- }
- }
- catch (Throwable t){
-
- }
- }
- //5.08.33
- else if (GT_Mod.VERSION == 508){
- version = new Pair<Integer, Integer>(8, 33);
- return version;
-
- }
- //5.07.07
- else if (GT_Mod.VERSION == 507){
- version = new Pair<Integer, Integer>(7, 7);
- return version;
-
- }
- //Returb Bad Value
- version = new Pair<Integer, Integer>(0, 0);
- return version;
- }
-
- public static int getGregtechVersionAsInt(){
- Pair<Integer, Integer> ver = getGregtechVersion();
- return 50000+(ver.getKey()*100)+(ver.getValue());
- }
-
- public static String getGregtechVersionAsString(){
- Pair<Integer, Integer> ver = getGregtechVersion();
- return "5."+ver.getKey()+"."+ver.getValue();
- }
-
- public static int getGregtechSubVersion(){
- Pair<Integer, Integer> ver = getGregtechVersion();
- return ver.getValue();
- }
-
- public static SecureRandom generateSecureRandom(){
- SecureRandom secRan;
- String secRanType;
-
- if (SystemUtils.isWindows()){
- secRanType = "Windows-PRNG";
- }
- else {
- secRanType = "NativePRNG";
- }
- try {
- secRan = SecureRandom.getInstance(secRanType);
- // Default constructor would have returned insecure SHA1PRNG algorithm, so make an explicit call.
- byte[] b = new byte[64] ;
- secRan.nextBytes(b);
- return secRan;
- }
- catch (NoSuchAlgorithmException e) {
- return null;
- }
- }
-
-
- public static String calculateChecksumMD5(Object bytes) {
- byte[] result = new byte[] {};
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutput out = null;
- try {
- out = new ObjectOutputStream(bos);
- out.writeObject(bytes);
- out.flush();
- result = bos.toByteArray();
- }
- catch (IOException e) {
- } finally {
- try {
- bos.close();
- }
- catch (IOException e) {}
- }
- return calculateChecksumMD5(result);
- }
-
- public static String calculateChecksumMD5(byte[] bytes) {
- MessageDigest md;
- try {
- md = MessageDigest.getInstance("MD5");
- md.update(bytes);
- byte[] digest = md.digest();
- String myHash = DatatypeConverter.printHexBinary(digest).toUpperCase();
- return myHash;
- }
- catch (NoSuchAlgorithmException e) {
- return null;
- }
- }
-
- public static boolean createNewMobSpawner(int aID, Entity aEntity) {
- if (aEntity instanceof Entity) {
- Class c = aEntity.getClass();
- return createNewMobSpawner(aID, c);
- }
- return false;
- }
-
- public static boolean createNewMobSpawner(int aID, Class aEntity) {
- Logger.INFO("[Spawn] Generating new spawner for entity with class ("+aEntity.getSimpleName()+").");
- if (TileEntityGenericSpawner.registerNewMobSpawner(aID, (Class<Entity>) aEntity)) {
- EntityRegistration x = EntityRegistry.instance().lookupModSpawn((Class<? extends Entity>) aEntity, true);
- if (x != null) {
- Logger.INFO("[Spawn] Registration for "+x.getEntityName()+" successful");
- return true;
- }
- else {
- Logger.INFO("[Spawn] Registration for "+aEntity.getSimpleName()+" successful");
- return true;
- }
- }
- Logger.INFO("[Spawn] Mob Spawner creation for "+aEntity.getName()+" failed");
- return false;
- }
-
- public static long getMillisSince(long aStartTime, long aCurrentTime) {
- return (aCurrentTime - aStartTime);
- }
-
- public static long getSecondsFromMillis(long aMillis) {
- return (aMillis/1000);
- }
-
- public static long getTicksFromSeconds(long aSeconds) {
- return (aSeconds*20);
- }
-
- public static byte getTier(long l) {
- byte i = -1;
- do {
- ++i;
- if (i >= GT_Values.V.length) {
- return i;
- }
- } while (l > GT_Values.V[i]);
- i = (byte) MathUtils.getValueWithinRange(i, 0, 15);
- return i;
- }
+ aPages[i] = aLocalizationPages[i].replaceAll("<BR>", "\n");
+ if (i < 48) {
+ if (aPages[i].length() < 256) {
+ tNBTList.appendTag(new NBTTagString(aPages[i]));
+ } else {
+ Logger.INFO("WARNING: String for written Book too long! -> " + aPages[i]);
+ GT_Log.err.println(new StringBuilder()
+ .append("WARNING: String for written Book too long! -> ")
+ .append(aPages[i])
+ .toString());
+ }
+ } else {
+ Logger.INFO("WARNING: Too much Pages for written Book! -> " + aTitle);
+ GT_Log.err.println(new StringBuilder()
+ .append("WARNING: Too much Pages for written Book! -> ")
+ .append(aTitle)
+ .toString());
+ break;
+ }
+ }
+ tNBTList.appendTag(new NBTTagString(new StringBuilder()
+ .append("Credits to ")
+ .append(aAuthor)
+ .append(" for writing this Book. This was Book Nr. ")
+ .append(aID)
+ .append(" at its creation. Gotta get 'em all!")
+ .toString()));
+ tNBT.setTag("pages", tNBTList);
+ rStack.setTagCompound(tNBT);
+ GT_Log.out.println(new StringBuilder()
+ .append("GT++_Mod: Added Book to Book++ List - Mapping: '")
+ .append(aMapping)
+ .append("' - Name: '")
+ .append(aTitle)
+ .append("' - Author: '")
+ .append(aAuthor)
+ .append("'")
+ .toString());
+ NBTUtils.createIntegerTagCompound(rStack, "stats", "mMeta", vMeta);
+ CORE.sBookList.put(aMapping, rStack);
+ Logger.INFO("Creating book: " + aTitle + " by " + aAuthor + ". Using Meta " + vMeta + ".");
+ return GT_Utility.copy(new Object[] {rStack});
+ }
+
+ @SuppressWarnings({"unused", "unchecked"})
+ public static Pair<Integer, Integer> getGregtechVersion() {
+ Pair<Integer, Integer> version;
+ if (GT_Mod.VERSION == 509) {
+ Class<GT_Mod> clazz;
+ try {
+
+ if (LoadedMods.BeyondRealityCore) {
+ // Safely assume it's Beyond Reality running .28-pre (If it's not, tough shit really?)
+ return new Pair<Integer, Integer>(9, 28);
+ }
+
+ clazz = (Class<GT_Mod>) ReflectionUtils.getClass("gregtech.GT_Mod");
+ Field mSubversion = ReflectionUtils.getField(clazz, "SUBVERSION");
+ if (mSubversion != null) {
+ int mSub = 0;
+ mSub = mSubversion.getInt(clazz);
+ if (mSub != 0) {
+ version = new Pair<Integer, Integer>(9, mSub);
+ return version;
+ }
+ }
+ } catch (Throwable t) {
+
+ }
+ }
+ // 5.08.33
+ else if (GT_Mod.VERSION == 508) {
+ version = new Pair<Integer, Integer>(8, 33);
+ return version;
+
+ }
+ // 5.07.07
+ else if (GT_Mod.VERSION == 507) {
+ version = new Pair<Integer, Integer>(7, 7);
+ return version;
+ }
+ // Returb Bad Value
+ version = new Pair<Integer, Integer>(0, 0);
+ return version;
+ }
+
+ public static int getGregtechVersionAsInt() {
+ Pair<Integer, Integer> ver = getGregtechVersion();
+ return 50000 + (ver.getKey() * 100) + (ver.getValue());
+ }
+
+ public static String getGregtechVersionAsString() {
+ Pair<Integer, Integer> ver = getGregtechVersion();
+ return "5." + ver.getKey() + "." + ver.getValue();
+ }
+
+ public static int getGregtechSubVersion() {
+ Pair<Integer, Integer> ver = getGregtechVersion();
+ return ver.getValue();
+ }
+
+ public static SecureRandom generateSecureRandom() {
+ SecureRandom secRan;
+ String secRanType;
+
+ if (SystemUtils.isWindows()) {
+ secRanType = "Windows-PRNG";
+ } else {
+ secRanType = "NativePRNG";
+ }
+ try {
+ secRan = SecureRandom.getInstance(secRanType);
+ // Default constructor would have returned insecure SHA1PRNG algorithm, so make an explicit call.
+ byte[] b = new byte[64];
+ secRan.nextBytes(b);
+ return secRan;
+ } catch (NoSuchAlgorithmException e) {
+ return null;
+ }
+ }
+
+ public static String calculateChecksumMD5(Object bytes) {
+ byte[] result = new byte[] {};
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutput out = null;
+ try {
+ out = new ObjectOutputStream(bos);
+ out.writeObject(bytes);
+ out.flush();
+ result = bos.toByteArray();
+ } catch (IOException e) {
+ } finally {
+ try {
+ bos.close();
+ } catch (IOException e) {
+ }
+ }
+ return calculateChecksumMD5(result);
+ }
+
+ public static String calculateChecksumMD5(byte[] bytes) {
+ MessageDigest md;
+ try {
+ md = MessageDigest.getInstance("MD5");
+ md.update(bytes);
+ byte[] digest = md.digest();
+ String myHash = DatatypeConverter.printHexBinary(digest).toUpperCase();
+ return myHash;
+ } catch (NoSuchAlgorithmException e) {
+ return null;
+ }
+ }
+ public static boolean createNewMobSpawner(int aID, Entity aEntity) {
+ if (aEntity instanceof Entity) {
+ Class c = aEntity.getClass();
+ return createNewMobSpawner(aID, c);
+ }
+ return false;
+ }
+
+ public static boolean createNewMobSpawner(int aID, Class aEntity) {
+ Logger.INFO("[Spawn] Generating new spawner for entity with class (" + aEntity.getSimpleName() + ").");
+ if (TileEntityGenericSpawner.registerNewMobSpawner(aID, (Class<Entity>) aEntity)) {
+ EntityRegistration x = EntityRegistry.instance().lookupModSpawn((Class<? extends Entity>) aEntity, true);
+ if (x != null) {
+ Logger.INFO("[Spawn] Registration for " + x.getEntityName() + " successful");
+ return true;
+ } else {
+ Logger.INFO("[Spawn] Registration for " + aEntity.getSimpleName() + " successful");
+ return true;
+ }
+ }
+ Logger.INFO("[Spawn] Mob Spawner creation for " + aEntity.getName() + " failed");
+ return false;
+ }
+
+ public static long getMillisSince(long aStartTime, long aCurrentTime) {
+ return (aCurrentTime - aStartTime);
+ }
+
+ public static long getSecondsFromMillis(long aMillis) {
+ return (aMillis / 1000);
+ }
+
+ public static long getTicksFromSeconds(long aSeconds) {
+ return (aSeconds * 20);
+ }
+
+ public static byte getTier(long l) {
+ byte i = -1;
+ do {
+ ++i;
+ if (i >= GT_Values.V.length) {
+ return i;
+ }
+ } while (l > GT_Values.V[i]);
+ i = (byte) MathUtils.getValueWithinRange(i, 0, 15);
+ return i;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/data/AES.java b/src/main/java/gtPlusPlus/core/util/data/AES.java
index 1183cdd8e7..e782a48148 100644
--- a/src/main/java/gtPlusPlus/core/util/data/AES.java
+++ b/src/main/java/gtPlusPlus/core/util/data/AES.java
@@ -1 +1,153 @@
-\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u0020\u0067\u0074\u0050\u006c\u0075\u0073\u0050\u006c\u0075\u0073\u002e\u0063\u006f\u0072\u0065\u002e\u0075\u0074\u0069\u006c\u002e\u0064\u0061\u0074\u0061\u003b\u000d\u000a\u0069\u006d\u0070\u006f\u0072\u0074\u0020\u006a\u0061\u0076\u0061\u002e\u0069\u006f\u002e\u0055\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0045\u006e\u0063\u006f\u0064\u0069\u006e\u0067\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u003b\u000d\u000a\u0069\u006d\u0070\u006f\u0072\u0074\u0020\u006a\u0061\u0076\u0061\u002e\u006d\u0061\u0074\u0068\u002e\u0042\u0069\u0067\u0049\u006e\u0074\u0065\u0067\u0065\u0072\u003b\u000d\u000a\u0069\u006d\u0070\u006f\u0072\u0074\u0020\u006a\u0061\u0076\u0061\u002e\u006e\u0069\u006f\u002e\u0063\u0068\u0061\u0072\u0073\u0065\u0074\u002e\u0053\u0074\u0061\u006e\u0064\u0061\u0072\u0064\u0043\u0068\u0061\u0072\u0073\u0065\u0074\u0073\u003b\u000d\u000a\u0069\u006d\u0070\u006f\u0072\u0074\u0020\u006a\u0061\u0076\u0061\u002e\u0073\u0065\u0063\u0075\u0072\u0069\u0074\u0079\u002e\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0044\u0069\u0067\u0065\u0073\u0074\u003b\u000d\u000a\u0069\u006d\u0070\u006f\u0072\u0074\u0020\u006a\u0061\u0076\u0061\u002e\u0073\u0065\u0063\u0075\u0072\u0069\u0074\u0079\u002e\u004e\u006f\u0053\u0075\u0063\u0068\u0041\u006c\u0067\u006f\u0072\u0069\u0074\u0068\u006d\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u003b\u000d\u000a\u0069\u006d\u0070\u006f\u0072\u0074\u0020\u006a\u0061\u0076\u0061\u002e\u0075\u0074\u0069\u006c\u002e\u0041\u0072\u0072\u0061\u0079\u0073\u003b\u000d\u000a\u0069\u006d\u0070\u006f\u0072\u0074\u0020\u006a\u0061\u0076\u0061\u002e\u0075\u0074\u0069\u006c\u002e\u0042\u0061\u0073\u0065\u0036\u0034\u003b\u000d\u000a\u0069\u006d\u0070\u006f\u0072\u0074\u0020\u006a\u0061\u0076\u0061\u0078\u002e\u0063\u0072\u0079\u0070\u0074\u006f\u002e\u0043\u0069\u0070\u0068\u0065\u0072\u003b\u000d\u000a\u0069\u006d\u0070\u006f\u0072\u0074\u0020\u006a\u0061\u0076\u0061\u0078\u002e\u0063\u0072\u0079\u0070\u0074\u006f\u002e\u0073\u0070\u0065\u0063\u002e\u0053\u0065\u0063\u0072\u0065\u0074\u004b\u0065\u0079\u0053\u0070\u0065\u0063\u003b\u000d\u000a\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0063\u006c\u0061\u0073\u0073\u0020\u0041\u0045\u0053\u0020\u007b\u000d\u000a\u0009\u0070\u0072\u0069\u0076\u0061\u0074\u0065\u0020\u0066\u0069\u006e\u0061\u006c\u0020\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0073\u0065\u0063\u0072\u0065\u0074\u003b\u003b\u000d\u000a\u0009\u0070\u0072\u0069\u0076\u0061\u0074\u0065\u0020\u0066\u0069\u006e\u0061\u006c\u0020\u0053\u0065\u0063\u0072\u0065\u0074\u004b\u0065\u0079\u0053\u0070\u0065\u0063\u0020\u0073\u0065\u0063\u0072\u0065\u0074\u004b\u0065\u0079\u003b\u000d\u000a\u0009\u0070\u0072\u0069\u0076\u0061\u0074\u0065\u0020\u0066\u0069\u006e\u0061\u006c\u0020\u0062\u0079\u0074\u0065\u005b\u005d\u0020\u006b\u0065\u0079\u003b\u0009\u000d\u000a\u0009\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0041\u0045\u0053\u0028\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0074\u0068\u0069\u0073\u0028\u0022\u0044\u0061\u0072\u006b\u006e\u0065\u0073\u0073\u0020\u0049\u006e\u0020\u0054\u0068\u0065\u0069\u0072\u0020\u0048\u0065\u0061\u0072\u0074\u0073\u0022\u0029\u003b\u0009\u0009\u000d\u000a\u0009\u007d\u0009\u000d\u000a\u0009\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0041\u0045\u0053\u0028\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0061\u0053\u0065\u0063\u0072\u0065\u0074\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0073\u0065\u0063\u0072\u0065\u0074\u0020\u003d\u0020\u0061\u0053\u0065\u0063\u0072\u0065\u0074\u003b\u000d\u000a\u0009\u0009\u006b\u0065\u0079\u0020\u003d\u0020\u0067\u0065\u0074\u0042\u0079\u0074\u0065\u0073\u0028\u0067\u0065\u0074\u0048\u0061\u0073\u0068\u0065\u0064\u0053\u0074\u0072\u0069\u006e\u0067\u0028\u0073\u0065\u0063\u0072\u0065\u0074\u0029\u0029\u003b\u000d\u000a\u0009\u0009\u0073\u0065\u0063\u0072\u0065\u0074\u004b\u0065\u0079\u0020\u003d\u0020\u0067\u0065\u006e\u0065\u0072\u0061\u0074\u0065\u004b\u0065\u0079\u0028\u006b\u0065\u0079\u0029\u003b\u000d\u000a\u0009\u007d\u000d\u000a\u0009\u0070\u0072\u0069\u0076\u0061\u0074\u0065\u0020\u0073\u0074\u0061\u0074\u0069\u0063\u0020\u0066\u0069\u006e\u0061\u006c\u0020\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0067\u0065\u0074\u0048\u0061\u0073\u0068\u0065\u0064\u0053\u0074\u0072\u0069\u006e\u0067\u0028\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0061\u0053\u0074\u0072\u0069\u006e\u0067\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0074\u006f\u0048\u0065\u0078\u0053\u0074\u0072\u0069\u006e\u0067\u0028\u0067\u0065\u0074\u0053\u0048\u0041\u0028\u0061\u0053\u0074\u0072\u0069\u006e\u0067\u0029\u0029\u003b\u000d\u000a\u0009\u007d\u000d\u000a\u0009\u0070\u0072\u0069\u0076\u0061\u0074\u0065\u0020\u0073\u0074\u0061\u0074\u0069\u0063\u0020\u0066\u0069\u006e\u0061\u006c\u0020\u0062\u0079\u0074\u0065\u005b\u005d\u0020\u0067\u0065\u0074\u0053\u0048\u0041\u0028\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0069\u006e\u0070\u0075\u0074\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0044\u0069\u0067\u0065\u0073\u0074\u0020\u006d\u0064\u003b\u000d\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u006d\u0064\u0020\u003d\u0020\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0044\u0069\u0067\u0065\u0073\u0074\u002e\u0067\u0065\u0074\u0049\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0028\u0022\u0053\u0048\u0041\u002d\u0032\u0035\u0036\u0022\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u006d\u0064\u002e\u0064\u0069\u0067\u0065\u0073\u0074\u0028\u0069\u006e\u0070\u0075\u0074\u002e\u0067\u0065\u0074\u0042\u0079\u0074\u0065\u0073\u0028\u0053\u0074\u0061\u006e\u0064\u0061\u0072\u0064\u0043\u0068\u0061\u0072\u0073\u0065\u0074\u0073\u002e\u0055\u0054\u0046\u005f\u0038\u0029\u0029\u003b\u000d\u000a\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u004e\u006f\u0053\u0075\u0063\u0068\u0041\u006c\u0067\u006f\u0072\u0069\u0074\u0068\u006d\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0020\u0065\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0065\u002e\u0070\u0072\u0069\u006e\u0074\u0053\u0074\u0061\u0063\u006b\u0054\u0072\u0061\u0063\u0065\u0028\u0029\u003b\u000d\u000a\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u006e\u0065\u0077\u0020\u0062\u0079\u0074\u0065\u005b\u005d\u007b\u007d\u003b\u000d\u000a\u0009\u007d\u000d\u000a\u0009\u0070\u0072\u0069\u0076\u0061\u0074\u0065\u0020\u0073\u0074\u0061\u0074\u0069\u0063\u0020\u0066\u0069\u006e\u0061\u006c\u0020\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0074\u006f\u0048\u0065\u0078\u0053\u0074\u0072\u0069\u006e\u0067\u0028\u0062\u0079\u0074\u0065\u005b\u005d\u0020\u0068\u0061\u0073\u0068\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0042\u0069\u0067\u0049\u006e\u0074\u0065\u0067\u0065\u0072\u0020\u006e\u0075\u006d\u0062\u0065\u0072\u0020\u003d\u0020\u006e\u0065\u0077\u0020\u0042\u0069\u0067\u0049\u006e\u0074\u0065\u0067\u0065\u0072\u0028\u0031\u002c\u0020\u0068\u0061\u0073\u0068\u0029\u003b\u000d\u000a\u0009\u0009\u0053\u0074\u0072\u0069\u006e\u0067\u0042\u0075\u0069\u006c\u0064\u0065\u0072\u0020\u0068\u0065\u0078\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u003d\u0020\u006e\u0065\u0077\u0020\u0053\u0074\u0072\u0069\u006e\u0067\u0042\u0075\u0069\u006c\u0064\u0065\u0072\u0028\u006e\u0075\u006d\u0062\u0065\u0072\u002e\u0074\u006f\u0053\u0074\u0072\u0069\u006e\u0067\u0028\u0031\u0036\u0029\u0029\u003b\u000d\u000a\u0009\u0009\u0077\u0068\u0069\u006c\u0065\u0020\u0028\u0068\u0065\u0078\u0053\u0074\u0072\u0069\u006e\u0067\u002e\u006c\u0065\u006e\u0067\u0074\u0068\u0028\u0029\u0020\u003c\u0020\u0033\u0032\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0068\u0065\u0078\u0053\u0074\u0072\u0069\u006e\u0067\u002e\u0069\u006e\u0073\u0065\u0072\u0074\u0028\u0030\u002c\u0020\u0027\u0030\u0027\u0029\u003b\u000d\u000a\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0068\u0065\u0078\u0053\u0074\u0072\u0069\u006e\u0067\u002e\u0074\u006f\u0053\u0074\u0072\u0069\u006e\u0067\u0028\u0029\u003b\u000d\u000a\u0009\u007d\u000d\u000a\u0009\u0070\u0072\u0069\u0076\u0061\u0074\u0065\u0020\u0066\u0069\u006e\u0061\u006c\u0020\u0062\u0079\u0074\u0065\u005b\u005d\u0020\u0067\u0065\u0074\u0042\u0079\u0074\u0065\u0073\u0028\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0061\u004b\u0065\u0079\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0062\u0079\u0074\u0065\u005b\u005d\u0020\u0061\u004b\u0065\u0079\u0044\u0061\u0074\u0061\u003b\u000d\u000a\u0009\u0009\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0044\u0069\u0067\u0065\u0073\u0074\u0020\u0073\u0068\u0061\u003b\u000d\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0073\u0068\u0061\u0020\u003d\u0020\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0044\u0069\u0067\u0065\u0073\u0074\u002e\u0067\u0065\u0074\u0049\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0028\u0022\u0053\u0048\u0041\u002d\u0032\u0035\u0036\u0022\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0073\u0068\u0061\u002e\u0064\u0069\u0067\u0065\u0073\u0074\u0028\u0061\u004b\u0065\u0079\u002e\u0067\u0065\u0074\u0042\u0079\u0074\u0065\u0073\u0028\u0053\u0074\u0061\u006e\u0064\u0061\u0072\u0064\u0043\u0068\u0061\u0072\u0073\u0065\u0074\u0073\u002e\u0055\u0054\u0046\u005f\u0038\u0029\u0029\u003b\u0020\u000d\u000a\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u004e\u006f\u0053\u0075\u0063\u0068\u0041\u006c\u0067\u006f\u0072\u0069\u0074\u0068\u006d\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0020\u0065\u0031\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0065\u0031\u002e\u0070\u0072\u0069\u006e\u0074\u0053\u0074\u0061\u0063\u006b\u0054\u0072\u0061\u0063\u0065\u0028\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0009\u0061\u004b\u0065\u0079\u0044\u0061\u0074\u0061\u0020\u003d\u0020\u0061\u004b\u0065\u0079\u002e\u0067\u0065\u0074\u0042\u0079\u0074\u0065\u0073\u0028\u0022\u0055\u0054\u0046\u002d\u0038\u0022\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0009\u0073\u0068\u0061\u0020\u003d\u0020\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0044\u0069\u0067\u0065\u0073\u0074\u002e\u0067\u0065\u0074\u0049\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0028\u0022\u0053\u0048\u0041\u002d\u0031\u0022\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0009\u0061\u004b\u0065\u0079\u0044\u0061\u0074\u0061\u0020\u003d\u0020\u0073\u0068\u0061\u002e\u0064\u0069\u0067\u0065\u0073\u0074\u0028\u006b\u0065\u0079\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0009\u0061\u004b\u0065\u0079\u0044\u0061\u0074\u0061\u0020\u003d\u0020\u0041\u0072\u0072\u0061\u0079\u0073\u002e\u0063\u006f\u0070\u0079\u004f\u0066\u0028\u006b\u0065\u0079\u002c\u0020\u0031\u0036\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0061\u004b\u0065\u0079\u0044\u0061\u0074\u0061\u003b\u000d\u000a\u0009\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0009\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u004e\u006f\u0053\u0075\u0063\u0068\u0041\u006c\u0067\u006f\u0072\u0069\u0074\u0068\u006d\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0020\u0065\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0009\u0065\u002e\u0070\u0072\u0069\u006e\u0074\u0053\u0074\u0061\u0063\u006b\u0054\u0072\u0061\u0063\u0065\u0028\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0009\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u0055\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0045\u006e\u0063\u006f\u0064\u0069\u006e\u0067\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0020\u0065\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0009\u0065\u002e\u0070\u0072\u0069\u006e\u0074\u0053\u0074\u0061\u0063\u006b\u0054\u0072\u0061\u0063\u0065\u0028\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u007d\u0009\u0009\u000d\u000a\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u006e\u0065\u0077\u0020\u0062\u0079\u0074\u0065\u005b\u005d\u0020\u007b\u007d\u003b\u000d\u000a\u0009\u007d\u000d\u000a\u0009\u0070\u0072\u0069\u0076\u0061\u0074\u0065\u0020\u0066\u0069\u006e\u0061\u006c\u0020\u0053\u0065\u0063\u0072\u0065\u0074\u004b\u0065\u0079\u0053\u0070\u0065\u0063\u0020\u0067\u0065\u006e\u0065\u0072\u0061\u0074\u0065\u004b\u0065\u0079\u0028\u0062\u0079\u0074\u0065\u005b\u005d\u0020\u0061\u004b\u0065\u0079\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u006e\u0065\u0077\u0020\u0053\u0065\u0063\u0072\u0065\u0074\u004b\u0065\u0079\u0053\u0070\u0065\u0063\u0028\u0061\u004b\u0065\u0079\u002c\u0020\u0022\u0041\u0045\u0053\u0022\u0029\u003b\u000d\u000a\u0009\u007d\u000d\u000a\u0009\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0065\u006e\u0063\u006f\u0064\u0065\u0028\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0073\u0074\u0072\u0054\u006f\u0045\u006e\u0063\u0072\u0079\u0070\u0074\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0043\u0069\u0070\u0068\u0065\u0072\u0020\u0063\u0069\u0070\u0068\u0065\u0072\u0020\u003d\u0020\u0043\u0069\u0070\u0068\u0065\u0072\u002e\u0067\u0065\u0074\u0049\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0028\u0022\u0041\u0045\u0053\u002f\u0045\u0043\u0042\u002f\u0050\u004b\u0043\u0053\u0035\u0050\u0061\u0064\u0064\u0069\u006e\u0067\u0022\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0063\u0069\u0070\u0068\u0065\u0072\u002e\u0069\u006e\u0069\u0074\u0028\u0043\u0069\u0070\u0068\u0065\u0072\u002e\u0045\u004e\u0043\u0052\u0059\u0050\u0054\u005f\u004d\u004f\u0044\u0045\u002c\u0020\u0073\u0065\u0063\u0072\u0065\u0074\u004b\u0065\u0079\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0042\u0061\u0073\u0065\u0036\u0034\u002e\u0067\u0065\u0074\u0045\u006e\u0063\u006f\u0064\u0065\u0072\u0028\u0029\u002e\u0065\u006e\u0063\u006f\u0064\u0065\u0054\u006f\u0053\u0074\u0072\u0069\u006e\u0067\u0028\u0063\u0069\u0070\u0068\u0065\u0072\u002e\u0064\u006f\u0046\u0069\u006e\u0061\u006c\u0028\u0073\u0074\u0072\u0054\u006f\u0045\u006e\u0063\u0072\u0079\u0070\u0074\u002e\u0067\u0065\u0074\u0042\u0079\u0074\u0065\u0073\u0028\u0022\u0055\u0054\u0046\u002d\u0038\u0022\u0029\u0029\u0029\u003b\u000d\u000a\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0020\u0065\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0053\u0079\u0073\u0074\u0065\u006d\u002e\u006f\u0075\u0074\u002e\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028\u0022\u0045\u0072\u0072\u006f\u0072\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0065\u006e\u0063\u0072\u0079\u0070\u0074\u0069\u006e\u0067\u003a\u0020\u0022\u0020\u002b\u0020\u0065\u002e\u0074\u006f\u0053\u0074\u0072\u0069\u006e\u0067\u0028\u0029\u0029\u003b\u000d\u000a\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u006e\u0075\u006c\u006c\u003b\u000d\u000a\u0009\u007d\u000d\u000a\u0009\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0064\u0065\u0063\u006f\u0064\u0065\u0028\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0073\u0074\u0072\u0054\u006f\u0044\u0065\u0063\u0072\u0079\u0070\u0074\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u000d\u000a\u0009\u0009\u0009\u0043\u0069\u0070\u0068\u0065\u0072\u0020\u0063\u0069\u0070\u0068\u0065\u0072\u0020\u003d\u0020\u0043\u0069\u0070\u0068\u0065\u0072\u002e\u0067\u0065\u0074\u0049\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0028\u0022\u0041\u0045\u0053\u002f\u0045\u0043\u0042\u002f\u0050\u004b\u0043\u0053\u0035\u0050\u0041\u0044\u0044\u0049\u004e\u0047\u0022\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0063\u0069\u0070\u0068\u0065\u0072\u002e\u0069\u006e\u0069\u0074\u0028\u0043\u0069\u0070\u0068\u0065\u0072\u002e\u0044\u0045\u0043\u0052\u0059\u0050\u0054\u005f\u004d\u004f\u0044\u0045\u002c\u0020\u0073\u0065\u0063\u0072\u0065\u0074\u004b\u0065\u0079\u0029\u003b\u000d\u000a\u0009\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u006e\u0065\u0077\u0020\u0053\u0074\u0072\u0069\u006e\u0067\u0028\u0063\u0069\u0070\u0068\u0065\u0072\u002e\u0064\u006f\u0046\u0069\u006e\u0061\u006c\u0028\u0042\u0061\u0073\u0065\u0036\u0034\u002e\u0067\u0065\u0074\u0044\u0065\u0063\u006f\u0064\u0065\u0072\u0028\u0029\u002e\u0064\u0065\u0063\u006f\u0064\u0065\u0028\u0073\u0074\u0072\u0054\u006f\u0044\u0065\u0063\u0072\u0079\u0070\u0074\u0029\u0029\u0029\u003b\u000d\u000a\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0020\u0065\u0029\u0020\u007b\u000d\u000a\u0009\u0009\u007d\u000d\u000a\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u006e\u0075\u006c\u006c\u003b\u000d\u000a\u0009\u007d\u000d\u000a\u007d \ No newline at end of file
+package gtPlusPlus.core.util.data;
+
+import java.io.UnsupportedEncodingException;
+import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
+import java.util.Base64;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+
+public class AES {
+
+ private final String secret;
+ ;
+
+ private final SecretKeySpec secretKey;
+
+ private final byte[] key;
+
+ public AES() {
+
+ this("Darkness In Their Hearts");
+ }
+
+ public AES(String aSecret) {
+
+ secret = aSecret;
+
+ key = getBytes(getHashedString(secret));
+
+ secretKey = generateKey(key);
+ }
+
+ private static final String getHashedString(String aString) {
+
+ return toHexString(getSHA(aString));
+ }
+
+ private static final byte[] getSHA(String input) {
+
+ MessageDigest md;
+
+ try {
+
+ md = MessageDigest.getInstance("SHA-256");
+
+ return md.digest(input.getBytes(StandardCharsets.UTF_8));
+
+ } catch (NoSuchAlgorithmException e) {
+
+ e.printStackTrace();
+ }
+
+ return new byte[] {};
+ }
+
+ private static final String toHexString(byte[] hash) {
+
+ BigInteger number = new BigInteger(1, hash);
+
+ StringBuilder hexString = new StringBuilder(number.toString(16));
+
+ while (hexString.length() < 32) {
+
+ hexString.insert(0, '0');
+ }
+
+ return hexString.toString();
+ }
+
+ private final byte[] getBytes(String aKey) {
+
+ byte[] aKeyData;
+
+ MessageDigest sha;
+
+ try {
+
+ sha = MessageDigest.getInstance("SHA-256");
+
+ return sha.digest(aKey.getBytes(StandardCharsets.UTF_8));
+
+ } catch (NoSuchAlgorithmException e1) {
+
+ e1.printStackTrace();
+
+ try {
+
+ aKeyData = aKey.getBytes("UTF-8");
+
+ sha = MessageDigest.getInstance("SHA-1");
+
+ aKeyData = sha.digest(key);
+
+ aKeyData = Arrays.copyOf(key, 16);
+
+ return aKeyData;
+
+ } catch (NoSuchAlgorithmException e) {
+
+ e.printStackTrace();
+
+ } catch (UnsupportedEncodingException e) {
+
+ e.printStackTrace();
+ }
+ }
+
+ return new byte[] {};
+ }
+
+ private final SecretKeySpec generateKey(byte[] aKey) {
+
+ return new SecretKeySpec(aKey, "AES");
+ }
+
+ public String encode(String strToEncrypt) {
+
+ try {
+
+ Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+
+ cipher.init(Cipher.ENCRYPT_MODE, secretKey);
+
+ return Base64.getEncoder().encodeToString(cipher.doFinal(strToEncrypt.getBytes("UTF-8")));
+
+ } catch (Exception e) {
+
+ System.out.println("Error while encrypting: " + e.toString());
+ }
+
+ return null;
+ }
+
+ public String decode(String strToDecrypt) {
+
+ try {
+
+ Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
+
+ cipher.init(Cipher.DECRYPT_MODE, secretKey);
+
+ return new String(cipher.doFinal(Base64.getDecoder().decode(strToDecrypt)));
+
+ } catch (Exception e) {
+
+ }
+
+ return null;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java b/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java
index 62f703f5f5..8630ac5abf 100644
--- a/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java
@@ -1,121 +1,115 @@
package gtPlusPlus.core.util.data;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
public class ArrayUtils {
- public static <V> V[] expandArray(final V[] someArray, final V newValueToAdd) {
- V[] series = someArray;
- series = addElement(series, newValueToAdd);
- return series;
- }
+ public static <V> V[] expandArray(final V[] someArray, final V newValueToAdd) {
+ V[] series = someArray;
+ series = addElement(series, newValueToAdd);
+ return series;
+ }
- private static <V> V[] addElement(V[] series, final V newValueToAdd) {
- series = Arrays.copyOf(series, series.length + 1);
- series[series.length - 1] = newValueToAdd;
- return series;
- }
-
- public static <V> V[] insertElementAtIndex(V[] aArray, int aIndex, V aObjectToInsert) {
- V[] newArray = Arrays.copyOf(aArray, aArray.length + 1);
- for (int i=0;i<aIndex;i++) {
- newArray[i] = aArray[i];
- }
- newArray[aIndex] = aObjectToInsert;
- for (int i=(aIndex+1);i<newArray.length;i++) {
- newArray[i] = aArray[i-1];
- }
- return newArray;
- }
-
- /*public static <V> Object getMostCommonElement(List<V> list) {
- Optional r = list.stream().map(V::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey);
- return r.get();
- }*/
+ private static <V> V[] addElement(V[] series, final V newValueToAdd) {
+ series = Arrays.copyOf(series, series.length + 1);
+ series[series.length - 1] = newValueToAdd;
+ return series;
+ }
+ public static <V> V[] insertElementAtIndex(V[] aArray, int aIndex, V aObjectToInsert) {
+ V[] newArray = Arrays.copyOf(aArray, aArray.length + 1);
+ for (int i = 0; i < aIndex; i++) {
+ newArray[i] = aArray[i];
+ }
+ newArray[aIndex] = aObjectToInsert;
+ for (int i = (aIndex + 1); i < newArray.length; i++) {
+ newArray[i] = aArray[i - 1];
+ }
+ return newArray;
+ }
- public static Object[] removeNulls(final Object[] v) {
- List<Object> list = new ArrayList<Object>(Arrays.asList(v));
- list.removeAll(Collections.singleton((Object)null));
- return list.toArray(new Object[list.size()]);
- }
-
- public static ItemStack[] removeNulls(final ItemStack[] v) {
- List<ItemStack> list = new ArrayList<ItemStack>(Arrays.asList(v));
- list.removeAll(Collections.singleton((ItemStack)null));
- return list.toArray(new ItemStack[list.size()]);
- }
+ /*public static <V> Object getMostCommonElement(List<V> list) {
+ Optional r = list.stream().map(V::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey);
+ return r.get();
+ }*/
- @SuppressWarnings("unchecked")
- public static <T> Set<T> combineSetData(Set<T> S, Set<T> J) {
- Set<T> mData = new HashSet<T>();
- T[] array1 = (T[]) S.toArray();
- Collections.addAll(mData, array1);
- T[] array2 = (T[]) J.toArray();
- Collections.addAll(mData, array2);
- return mData;
- }
+ public static Object[] removeNulls(final Object[] v) {
+ List<Object> list = new ArrayList<Object>(Arrays.asList(v));
+ list.removeAll(Collections.singleton((Object) null));
+ return list.toArray(new Object[list.size()]);
+ }
- public static <A> AutoMap<A> mergeTwoMaps(AutoMap<A> a, AutoMap<A> b) {
- AutoMap<A> c = new AutoMap<A>();
- for (A g : a.values()) {
- c.put(g);
- }
- for (A g : b.values()) {
- c.put(g);
- }
- return c;
- }
-
- public static <T> T[][] rotateArrayClockwise(T[][] mat) {
- Logger.INFO("Rotating Array 90' Clockwise");
- try {
- final int M = mat.length;
- final int N = mat[0].length;
- Logger.INFO("Dimension X: "+M);
- Logger.INFO("Dimension Z: "+N);
- @SuppressWarnings("unchecked")
- T[][] ret = (T[][]) new Object[N][M];
- for (int r = 0; r < M; r++) {
- for (int c = 0; c < N; c++) {
- ret[c][M-1-r] = mat[r][c];
- }
- }
- Logger.INFO("Returning Rotated Array");
- return ret;
- }
- catch (Throwable t) {
- t.printStackTrace();
- return null;
- }
- }
+ public static ItemStack[] removeNulls(final ItemStack[] v) {
+ List<ItemStack> list = new ArrayList<ItemStack>(Arrays.asList(v));
+ list.removeAll(Collections.singleton((ItemStack) null));
+ return list.toArray(new ItemStack[list.size()]);
+ }
- public static String toString(Object[] aArray, String string) {
- return org.apache.commons.lang3.ArrayUtils.toString(aArray, string);
- }
+ @SuppressWarnings("unchecked")
+ public static <T> Set<T> combineSetData(Set<T> S, Set<T> J) {
+ Set<T> mData = new HashSet<T>();
+ T[] array1 = (T[]) S.toArray();
+ Collections.addAll(mData, array1);
+ T[] array2 = (T[]) J.toArray();
+ Collections.addAll(mData, array2);
+ return mData;
+ }
- public static String toString(Object[] aArray) {
- return org.apache.commons.lang3.ArrayUtils.toString(aArray);
- }
+ public static <A> AutoMap<A> mergeTwoMaps(AutoMap<A> a, AutoMap<A> b) {
+ AutoMap<A> c = new AutoMap<A>();
+ for (A g : a.values()) {
+ c.put(g);
+ }
+ for (A g : b.values()) {
+ c.put(g);
+ }
+ return c;
+ }
- public static <T> Object[] getArrayFromArrayList(ArrayList<T> aArrayList) {
- Object[] aGenericArray = new Object[aArrayList.size()];
- int aIndex = 0;
- for (T object : aArrayList) {
- aGenericArray[aIndex++] = object;
- }
- return aGenericArray;
- }
+ public static <T> T[][] rotateArrayClockwise(T[][] mat) {
+ Logger.INFO("Rotating Array 90' Clockwise");
+ try {
+ final int M = mat.length;
+ final int N = mat[0].length;
+ Logger.INFO("Dimension X: " + M);
+ Logger.INFO("Dimension Z: " + N);
+ @SuppressWarnings("unchecked")
+ T[][] ret = (T[][]) new Object[N][M];
+ for (int r = 0; r < M; r++) {
+ for (int c = 0; c < N; c++) {
+ ret[c][M - 1 - r] = mat[r][c];
+ }
+ }
+ Logger.INFO("Returning Rotated Array");
+ return ret;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return null;
+ }
+ }
-}
+ public static String toString(Object[] aArray, String string) {
+ return org.apache.commons.lang3.ArrayUtils.toString(aArray, string);
+ }
+ public static String toString(Object[] aArray) {
+ return org.apache.commons.lang3.ArrayUtils.toString(aArray);
+ }
+
+ public static <T> Object[] getArrayFromArrayList(ArrayList<T> aArrayList) {
+ Object[] aGenericArray = new Object[aArrayList.size()];
+ int aIndex = 0;
+ for (T object : aArrayList) {
+ aGenericArray[aIndex++] = object;
+ }
+ return aGenericArray;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/data/EnumUtils.java b/src/main/java/gtPlusPlus/core/util/data/EnumUtils.java
index edcc071b54..2a74edb5aa 100644
--- a/src/main/java/gtPlusPlus/core/util/data/EnumUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/EnumUtils.java
@@ -5,47 +5,42 @@ import com.google.common.base.Optional;
public class EnumUtils {
- /**
- * Returns the value of an Enum if it exists.
- * If value is not found, case-insensitive search will occur.
- * If value still not found, an IllegalArgumentException is thrown.
- **/
- public static <T extends Enum<T>> T getValue(Class<T> enumeration, String name) {
- Optional<T> j = Enums.getIfPresent(enumeration, name);
- T VALUE;
- if (j == null || !j.isPresent()) {
- VALUE = valueOfIgnoreCase(enumeration, name);
- }
- else {
- VALUE = j.get();
- }
- return VALUE;
- }
-
- /**
- * Finds the value of the given enumeration by name, case-insensitive.
- * Throws an IllegalArgumentException if no match is found.
- **/
- private static <T extends Enum<T>> T valueOfIgnoreCase(Class<T> enumeration, String name) {
+ /**
+ * Returns the value of an Enum if it exists.
+ * If value is not found, case-insensitive search will occur.
+ * If value still not found, an IllegalArgumentException is thrown.
+ **/
+ public static <T extends Enum<T>> T getValue(Class<T> enumeration, String name) {
+ Optional<T> j = Enums.getIfPresent(enumeration, name);
+ T VALUE;
+ if (j == null || !j.isPresent()) {
+ VALUE = valueOfIgnoreCase(enumeration, name);
+ } else {
+ VALUE = j.get();
+ }
+ return VALUE;
+ }
- for (T enumValue : enumeration.getEnumConstants()) {
- if (enumValue.name().equalsIgnoreCase(name)) {
- return enumValue;
- }
- }
+ /**
+ * Finds the value of the given enumeration by name, case-insensitive.
+ * Throws an IllegalArgumentException if no match is found.
+ **/
+ private static <T extends Enum<T>> T valueOfIgnoreCase(Class<T> enumeration, String name) {
- throw new IllegalArgumentException(String.format(
- "There is no value with name '%s' in Enum %s",
- name, enumeration.getName()
- ));
- }
+ for (T enumValue : enumeration.getEnumConstants()) {
+ if (enumValue.name().equalsIgnoreCase(name)) {
+ return enumValue;
+ }
+ }
- public static Object getValue(Class class1, String materialName, boolean bool) {
- if (Enum.class.isInstance(class1)){
- return getValue(class1, materialName);
- }
- return null;
- }
-
-
+ throw new IllegalArgumentException(
+ String.format("There is no value with name '%s' in Enum %s", name, enumeration.getName()));
+ }
+
+ public static Object getValue(Class class1, String materialName, boolean bool) {
+ if (Enum.class.isInstance(class1)) {
+ return getValue(class1, materialName);
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/data/FileUtils.java b/src/main/java/gtPlusPlus/core/util/data/FileUtils.java
index bec5e0eeff..19f868c2a9 100644
--- a/src/main/java/gtPlusPlus/core/util/data/FileUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/FileUtils.java
@@ -1,5 +1,7 @@
package gtPlusPlus.core.util.data;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.Utils;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
@@ -11,94 +13,89 @@ import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.List;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.Utils;
-
public class FileUtils {
- private static final Charset utf8 = StandardCharsets.UTF_8;
+ private static final Charset utf8 = StandardCharsets.UTF_8;
+
+ public static boolean doesFileExist(File f) {
+ if (f != null && f.exists() && !f.isDirectory()) {
+ return true;
+ }
+ return false;
+ }
- public static boolean doesFileExist(File f) {
- if (f != null && f.exists() && !f.isDirectory()) {
- return true;
- }
- return false;
- }
+ public static File createFile(String path, String filename, String extension) {
+ File file = new File(Utils.getMcDir(), path + filename + extension);
+ return createFile(file);
+ }
- public static File createFile(String path, String filename, String extension) {
- File file = new File(Utils.getMcDir(), path + filename + extension);
- return createFile(file);
- }
-
- public static File createFile(File aFile) {
- boolean blnCreated = false;
- Logger.INFO("Trying to use path "+aFile.getPath());
- try {
- Logger.INFO("Trying to use path "+aFile.getCanonicalPath());
- Logger.INFO("Trying to use absolute path "+aFile.getAbsolutePath());
- blnCreated = aFile.createNewFile();
- } catch (IOException ioe) {
- Logger.INFO("Error while creating a new empty file :" + ioe);
- return null;
- }
- return blnCreated ? aFile : null;
- }
+ public static File createFile(File aFile) {
+ boolean blnCreated = false;
+ Logger.INFO("Trying to use path " + aFile.getPath());
+ try {
+ Logger.INFO("Trying to use path " + aFile.getCanonicalPath());
+ Logger.INFO("Trying to use absolute path " + aFile.getAbsolutePath());
+ blnCreated = aFile.createNewFile();
+ } catch (IOException ioe) {
+ Logger.INFO("Error while creating a new empty file :" + ioe);
+ return null;
+ }
+ return blnCreated ? aFile : null;
+ }
- public static File getFile(String filename, String extension) {
- return getFile("", filename, extension);
- }
+ public static File getFile(String filename, String extension) {
+ return getFile("", filename, extension);
+ }
- public static File getFile(String path, String filename, String extension) {
- if (path == null || path.length() <= 0) {
- path = "";
- }
- else {
- path = path + "/";
- }
- if (filename == null || filename.length() <= 0) {
- return null;
- }
- if (extension == null || extension.length() <= 0) {
- extension = ".txt";
- }
- else {
- extension = "." + extension;
- }
- File file = new File(Utils.getMcDir(), path + filename + extension);
- boolean doesExist = doesFileExist(file);
+ public static File getFile(String path, String filename, String extension) {
+ if (path == null || path.length() <= 0) {
+ path = "";
+ } else {
+ path = path + "/";
+ }
+ if (filename == null || filename.length() <= 0) {
+ return null;
+ }
+ if (extension == null || extension.length() <= 0) {
+ extension = ".txt";
+ } else {
+ extension = "." + extension;
+ }
+ File file = new File(Utils.getMcDir(), path + filename + extension);
+ boolean doesExist = doesFileExist(file);
- if (doesExist) {
- Logger.INFO("Found File: " + file.getAbsolutePath());
- return file;
- } else {
- Logger.INFO("Creating file, as it was not found.");
- return createFile(path, filename, extension);
- }
- }
+ if (doesExist) {
+ Logger.INFO("Found File: " + file.getAbsolutePath());
+ return file;
+ } else {
+ Logger.INFO("Creating file, as it was not found.");
+ return createFile(path, filename, extension);
+ }
+ }
- public static boolean appendListToFile(File file, List<String> content) {
- try {
- long oldSize;
- long newSize;
- if (doesFileExist(file)) {
- Path p = Paths.get(file.getPath());
- if (p != null && Files.isWritable(p)) {
- oldSize = Files.size(p);
- try {
- Files.write(p, content, utf8, StandardOpenOption.APPEND);
- } catch (IOException e) {
- e.printStackTrace();
- }
- newSize = Files.size(p);
- return newSize > oldSize;
- }
- }
- } catch (IOException e) {
- }
- return false;
- }
+ public static boolean appendListToFile(File file, List<String> content) {
+ try {
+ long oldSize;
+ long newSize;
+ if (doesFileExist(file)) {
+ Path p = Paths.get(file.getPath());
+ if (p != null && Files.isWritable(p)) {
+ oldSize = Files.size(p);
+ try {
+ Files.write(p, content, utf8, StandardOpenOption.APPEND);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ newSize = Files.size(p);
+ return newSize > oldSize;
+ }
+ }
+ } catch (IOException e) {
+ }
+ return false;
+ }
- /**
+ /**
* Reads the contents of a file line by line to a List of Strings using the default encoding for the VM.
* The file is always closed.
*
@@ -109,10 +106,9 @@ public class FileUtils {
*/
public static List<String> readLines(File file) {
try {
- return org.apache.commons.io.FileUtils.readLines(file, utf8);
- }
- catch (IOException e) {
- return new ArrayList<String>();
- }
+ return org.apache.commons.io.FileUtils.readLines(file, utf8);
+ } catch (IOException e) {
+ return new ArrayList<String>();
+ }
}
}
diff --git a/src/main/java/gtPlusPlus/core/util/data/LocaleUtils.java b/src/main/java/gtPlusPlus/core/util/data/LocaleUtils.java
index d1a35a661b..a67262c4bd 100644
--- a/src/main/java/gtPlusPlus/core/util/data/LocaleUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/LocaleUtils.java
@@ -1,90 +1,82 @@
package gtPlusPlus.core.util.data;
-import java.io.*;
-
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.registry.GameData;
-
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.io.*;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
public class LocaleUtils {
- public static boolean generateFakeLocaleFile() {
- for (ModContainer modcontainer : Loader.instance().getModList()){
- if (modcontainer.getModId().toLowerCase().equals("miscutils")) {
- String S = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
- writeToFile(S);
- dumpItemsAndBlocksForModContainer(modcontainer);
- }
- }
- return true;
- }
+ public static boolean generateFakeLocaleFile() {
+ for (ModContainer modcontainer : Loader.instance().getModList()) {
+ if (modcontainer.getModId().toLowerCase().equals("miscutils")) {
+ String S = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
+ writeToFile(S);
+ dumpItemsAndBlocksForModContainer(modcontainer);
+ }
+ }
+ return true;
+ }
+
+ public static boolean dumpItemsAndBlocksForModContainer(ModContainer mod) {
+ writeToFile("Dumping Items from " + mod.getModId() + ".");
+ for (Object C : GameData.getItemRegistry()) {
+
+ try {
+
+ if (C != null) {
+ if (C instanceof Item) {
+ Item R = (Item) C;
+ ItemStack IS = ItemUtils.getSimpleStack(R);
+ String modid = ItemUtils.getModId(IS);
+ if (modid.equals("miscutils") || modid.equals("ToxicEverglades")) {
+ String S = "[" + modid + "] " + IS.getUnlocalizedName() + ".name=";
+ writeToFile(S);
+ }
+ }
+ }
- public static boolean dumpItemsAndBlocksForModContainer(ModContainer mod) {
- writeToFile("Dumping Items from "+mod.getModId()+".");
- for (Object C : GameData.getItemRegistry()) {
-
- try {
-
- if (C != null) {
- if (C instanceof Item) {
- Item R = (Item) C;
- ItemStack IS = ItemUtils.getSimpleStack(R);
- String modid = ItemUtils.getModId(IS);
- if (modid.equals("miscutils") || modid.equals("ToxicEverglades")) {
- String S = "["+modid+"] "+IS.getUnlocalizedName()+".name=";
- writeToFile(S);
- }
- }
- }
-
- }
- catch (Throwable T) {}
-
- }
- writeToFile("Dumping Blocks from "+mod.getModId()+".");
- for (Object B : GameData.getBlockRegistry()) {
-
- try {
-
- if (B != null) {
- if (B instanceof Block) {
- Block R = (Block) B;
- ItemStack IS = ItemUtils.getSimpleStack(R);
- String modid = ItemUtils.getModId(IS);
- if (modid.equals("miscutils") || modid.equals("ToxicEverglades")) {
- String S = "["+modid+"] "+IS.getUnlocalizedName()+".name=";
- writeToFile(S);
- }
- }
- }
-
- }
- catch (Throwable T) {}
-
- }
+ } catch (Throwable T) {
+ }
+ }
+ writeToFile("Dumping Blocks from " + mod.getModId() + ".");
+ for (Object B : GameData.getBlockRegistry()) {
+ try {
- return true;
- }
+ if (B != null) {
+ if (B instanceof Block) {
+ Block R = (Block) B;
+ ItemStack IS = ItemUtils.getSimpleStack(R);
+ String modid = ItemUtils.getModId(IS);
+ if (modid.equals("miscutils") || modid.equals("ToxicEverglades")) {
+ String S = "[" + modid + "] " + IS.getUnlocalizedName() + ".name=";
+ writeToFile(S);
+ }
+ }
+ }
- public static void writeToFile(String S) {
- try {
- File F = new File(Utils.getMcDir(), "config/GTplusplus/en_US.lang");
- BufferedWriter writer;
- writer = new BufferedWriter(new FileWriter(F, true));
- writer.write(S);
- writer.newLine();
- writer.close();
- }
- catch (IOException e) {}
- }
+ } catch (Throwable T) {
+ }
+ }
+ return true;
+ }
+ public static void writeToFile(String S) {
+ try {
+ File F = new File(Utils.getMcDir(), "config/GTplusplus/en_US.lang");
+ BufferedWriter writer;
+ writer = new BufferedWriter(new FileWriter(F, true));
+ writer.write(S);
+ writer.newLine();
+ writer.close();
+ } catch (IOException e) {
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/data/LoggingUtils.java b/src/main/java/gtPlusPlus/core/util/data/LoggingUtils.java
index 8415ab32fe..16c04f2c34 100644
--- a/src/main/java/gtPlusPlus/core/util/data/LoggingUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/LoggingUtils.java
@@ -5,45 +5,43 @@ import java.util.Date;
public class LoggingUtils {
- public static void profileLog(final Object o) {
- try {
- String content;
- final File file = new File("GregtechTimingsTC.txt");
- // if file doesnt exists, then create it
- if (!file.exists()) {
- file.createNewFile();
- final FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
- final BufferedWriter bw = new BufferedWriter(fw);
- bw.write("============================================================");
- bw.write(System.lineSeparator());
- bw.close();
- }
- if (o instanceof String) {
- content = (String) o;
- } else {
- content = o.toString();
- }
- final FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
- final BufferedWriter bw = new BufferedWriter(fw);
- bw.write(content);
- bw.write(System.lineSeparator());
- bw.close();
- System.out.println("Data Logged.");
+ public static void profileLog(final Object o) {
+ try {
+ String content;
+ final File file = new File("GregtechTimingsTC.txt");
+ // if file doesnt exists, then create it
+ if (!file.exists()) {
+ file.createNewFile();
+ final FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
+ final BufferedWriter bw = new BufferedWriter(fw);
+ bw.write("============================================================");
+ bw.write(System.lineSeparator());
+ bw.close();
+ }
+ if (o instanceof String) {
+ content = (String) o;
+ } else {
+ content = o.toString();
+ }
+ final FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
+ final BufferedWriter bw = new BufferedWriter(fw);
+ bw.write(content);
+ bw.write(System.lineSeparator());
+ bw.close();
+ System.out.println("Data Logged.");
- } catch (final IOException e) {
- System.out.println("Data logging failed.");
- }
- }
-
- public static boolean logCurrentSystemTime(final String message) {
- final Date date = new Date(System.currentTimeMillis());
- try {
- profileLog(message + " | " + date.toString());
- return true;
- } catch (final Throwable r) {
- return false;
- }
-
- }
+ } catch (final IOException e) {
+ System.out.println("Data logging failed.");
+ }
+ }
+ public static boolean logCurrentSystemTime(final String message) {
+ final Date date = new Date(System.currentTimeMillis());
+ try {
+ profileLog(message + " | " + date.toString());
+ return true;
+ } catch (final Throwable r) {
+ return false;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/data/StringUtils.java b/src/main/java/gtPlusPlus/core/util/data/StringUtils.java
index 2372d04c15..af40dbae41 100644
--- a/src/main/java/gtPlusPlus/core/util/data/StringUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/StringUtils.java
@@ -6,214 +6,219 @@ import gtPlusPlus.core.util.Utils;
public class StringUtils {
- public static String superscript(String str) {
- str = str.replaceAll("0", "\u2070");
- str = str.replaceAll("1", "\u00B9");
- str = str.replaceAll("2", "\u00B2");
- str = str.replaceAll("3", "\u00B3");
- str = str.replaceAll("4", "\u2074");
- str = str.replaceAll("5", "\u2075");
- str = str.replaceAll("6", "\u2076");
- str = str.replaceAll("7", "\u2077");
- str = str.replaceAll("8", "\u2078");
- str = str.replaceAll("9", "\u2079");
- return str;
- }
-
- public static String subscript(String str) {
- str = str.replaceAll("0", "\u2080");
- str = str.replaceAll("1", "\u2081");
- str = str.replaceAll("2", "\u2082");
- str = str.replaceAll("3", "\u2083");
- str = str.replaceAll("4", "\u2084");
- str = str.replaceAll("5", "\u2085");
- str = str.replaceAll("6", "\u2086");
- str = str.replaceAll("7", "\u2087");
- str = str.replaceAll("8", "\u2088");
- str = str.replaceAll("9", "\u2089");
- return str;
- }
-
- public static boolean containsSuperOrSubScript(final String s){
- if (s.contains(StringUtils.superscript("0"))) {
- return true;
- }
- else if (s.contains(StringUtils.superscript("1"))) {
- return true;
- }
- else if (s.contains(StringUtils.superscript("2"))) {
- return true;
- }
- else if (s.contains(StringUtils.superscript("3"))) {
- return true;
- }
- else if (s.contains(StringUtils.superscript("4"))) {
- return true;
- }
- else if (s.contains(StringUtils.superscript("5"))) {
- return true;
- }
- else if (s.contains(StringUtils.superscript("6"))) {
- return true;
- }
- else if (s.contains(StringUtils.superscript("7"))) {
- return true;
- }
- else if (s.contains(StringUtils.superscript("8"))) {
- return true;
- }
- else if (s.contains(StringUtils.superscript("9"))) {
- return true;
- }
- if (s.contains(StringUtils.subscript("0"))) {
- return true;
- }
- else if (s.contains(StringUtils.subscript("1"))) {
- return true;
- }
- else if (s.contains(StringUtils.subscript("2"))) {
- return true;
- }
- else if (s.contains(StringUtils.subscript("3"))) {
- return true;
- }
- else if (s.contains(StringUtils.subscript("4"))) {
- return true;
- }
- else if (s.contains(StringUtils.subscript("5"))) {
- return true;
- }
- else if (s.contains(StringUtils.subscript("6"))) {
- return true;
- }
- else if (s.contains(StringUtils.subscript("7"))) {
- return true;
- }
- else if (s.contains(StringUtils.subscript("8"))) {
- return true;
- }
- else if (s.contains(StringUtils.subscript("9"))) {
- return true;
- }
- return false;
- }
-
- //Can call this Enum for formatting.
- public static enum TextUtils {
- blue('1'), green('2'), teal('3'), maroon('4'), purple('5'), orange('6'), lightGray('7'), darkGray('8'), lightBlue(
- '9'), black('0'), lime('a'), aqua('b'), red('c'), pink('d'), yellow('e'), white('f');
-
- private char colourValue;
- private TextUtils(final char value) {
- this.colourValue = value;
- }
- public String colour() {
- return getFormatter() + this.colourValue;
- }
- private String getFormatter() {
- return "\u00A7"; // Returns §.
- }
- }
-
- public static String firstLetterCaps(String data) {
- String firstLetter = data.substring(0,1).toUpperCase();
- String restLetters = data.substring(1).toLowerCase();
- return firstLetter + restLetters;
- }
-
- public static <V> String getDataStringFromArray(V[] parameterTypes) {
- if (parameterTypes == null || parameterTypes.length == 0) {
- return "empty/null";
- }
- else {
- String aData = "";
- for (V y : parameterTypes) {
- if (y != null) {
- aData += ", "+y.toString();
- }
- }
- return aData;
- }
- }
-
-
-
- /**
- * Is this a special regex character for delimination? (.$|()[]{}^?*+\\)
- * @param aChar - The char to test
- * @return - Is this a special character?
- */
- public static boolean isSpecialCharacter(char aChar) {
- if (aChar == '"' || aChar == '.' || aChar == '$' || aChar == '|' || aChar == '(' || aChar == ')' || aChar == '['
- || aChar == ']' || aChar == '{' || aChar == '}' || aChar == '^' || aChar == '?' || aChar == '*'
- || aChar == '+' || aChar == '\\') {
- return true;
- }
- return false;
- }
-
- public static boolean isEscaped(String aString) {
- return aString.substring(0, 1).equals("\\");
- }
-
- public static String splitAndUppercase(String aInput, String aDelim) {
-
- if (!isEscaped(aDelim)) {
- boolean isSpecial = false;
- for (int o=0;o<aInput.length();o++) {
- if (isSpecialCharacter(aInput.charAt(o))) {
- isSpecial = true;
- }
- }
- if (isSpecial) {
- aDelim = "\\"+aDelim;
- }
- }
-
-
- Logger.INFO("Splitting "+aInput);
- String[] aSplit = aInput.split(aDelim);
- Logger.INFO("Split into "+aSplit == null ? ""+0 : aSplit.length+" parts.");
- if (aSplit == null || aSplit.length == 0) {
- return aInput;
- }
- else {
- AutoMap<String> aTemp = new AutoMap<String>();
- for (String s : aSplit) {
- Logger.INFO("Found: "+s);
- s = s.replace(".", "");
- s = Utils.sanitizeString(s);
- s = firstLetterCaps(s);
- Logger.INFO("Formatted & Captilized: "+s);
- aTemp.put(s);
- }
- Logger.INFO("Rebuilding");
- String aReturn = "";
- for (String s : aTemp) {
- aReturn += s;
- Logger.INFO("Step: "+aReturn);
- }
- return aReturn;
- }
- }
-
- public static int characterCount(String aString, char aChar) {
- return characterCount(aString, ""+aChar);
- }
-
- public static int characterCount(String aString, String aChar) {
- int aLength = aString.length();
- int aFound = 0;
- if (aLength == 0 || !aString.contains(aChar)) {
- return 0;
- }
- else {
- for (int index = 0; index < aLength; index++) {
- if (aString.substring(index, index+1).equals(aChar)) {
- aFound++;
- }
- }
- return aFound;
- }
- }
+ public static String superscript(String str) {
+ str = str.replaceAll("0", "\u2070");
+ str = str.replaceAll("1", "\u00B9");
+ str = str.replaceAll("2", "\u00B2");
+ str = str.replaceAll("3", "\u00B3");
+ str = str.replaceAll("4", "\u2074");
+ str = str.replaceAll("5", "\u2075");
+ str = str.replaceAll("6", "\u2076");
+ str = str.replaceAll("7", "\u2077");
+ str = str.replaceAll("8", "\u2078");
+ str = str.replaceAll("9", "\u2079");
+ return str;
+ }
+
+ public static String subscript(String str) {
+ str = str.replaceAll("0", "\u2080");
+ str = str.replaceAll("1", "\u2081");
+ str = str.replaceAll("2", "\u2082");
+ str = str.replaceAll("3", "\u2083");
+ str = str.replaceAll("4", "\u2084");
+ str = str.replaceAll("5", "\u2085");
+ str = str.replaceAll("6", "\u2086");
+ str = str.replaceAll("7", "\u2087");
+ str = str.replaceAll("8", "\u2088");
+ str = str.replaceAll("9", "\u2089");
+ return str;
+ }
+
+ public static boolean containsSuperOrSubScript(final String s) {
+ if (s.contains(StringUtils.superscript("0"))) {
+ return true;
+ } else if (s.contains(StringUtils.superscript("1"))) {
+ return true;
+ } else if (s.contains(StringUtils.superscript("2"))) {
+ return true;
+ } else if (s.contains(StringUtils.superscript("3"))) {
+ return true;
+ } else if (s.contains(StringUtils.superscript("4"))) {
+ return true;
+ } else if (s.contains(StringUtils.superscript("5"))) {
+ return true;
+ } else if (s.contains(StringUtils.superscript("6"))) {
+ return true;
+ } else if (s.contains(StringUtils.superscript("7"))) {
+ return true;
+ } else if (s.contains(StringUtils.superscript("8"))) {
+ return true;
+ } else if (s.contains(StringUtils.superscript("9"))) {
+ return true;
+ }
+ if (s.contains(StringUtils.subscript("0"))) {
+ return true;
+ } else if (s.contains(StringUtils.subscript("1"))) {
+ return true;
+ } else if (s.contains(StringUtils.subscript("2"))) {
+ return true;
+ } else if (s.contains(StringUtils.subscript("3"))) {
+ return true;
+ } else if (s.contains(StringUtils.subscript("4"))) {
+ return true;
+ } else if (s.contains(StringUtils.subscript("5"))) {
+ return true;
+ } else if (s.contains(StringUtils.subscript("6"))) {
+ return true;
+ } else if (s.contains(StringUtils.subscript("7"))) {
+ return true;
+ } else if (s.contains(StringUtils.subscript("8"))) {
+ return true;
+ } else if (s.contains(StringUtils.subscript("9"))) {
+ return true;
+ }
+ return false;
+ }
+
+ // Can call this Enum for formatting.
+ public static enum TextUtils {
+ blue('1'),
+ green('2'),
+ teal('3'),
+ maroon('4'),
+ purple('5'),
+ orange('6'),
+ lightGray('7'),
+ darkGray('8'),
+ lightBlue('9'),
+ black('0'),
+ lime('a'),
+ aqua('b'),
+ red('c'),
+ pink('d'),
+ yellow('e'),
+ white('f');
+
+ private char colourValue;
+
+ private TextUtils(final char value) {
+ this.colourValue = value;
+ }
+
+ public String colour() {
+ return getFormatter() + this.colourValue;
+ }
+
+ private String getFormatter() {
+ return "\u00A7"; // Returns §.
+ }
+ }
+
+ public static String firstLetterCaps(String data) {
+ String firstLetter = data.substring(0, 1).toUpperCase();
+ String restLetters = data.substring(1).toLowerCase();
+ return firstLetter + restLetters;
+ }
+
+ public static <V> String getDataStringFromArray(V[] parameterTypes) {
+ if (parameterTypes == null || parameterTypes.length == 0) {
+ return "empty/null";
+ } else {
+ String aData = "";
+ for (V y : parameterTypes) {
+ if (y != null) {
+ aData += ", " + y.toString();
+ }
+ }
+ return aData;
+ }
+ }
+
+ /**
+ * Is this a special regex character for delimination? (.$|()[]{}^?*+\\)
+ * @param aChar - The char to test
+ * @return - Is this a special character?
+ */
+ public static boolean isSpecialCharacter(char aChar) {
+ if (aChar == '"'
+ || aChar == '.'
+ || aChar == '$'
+ || aChar == '|'
+ || aChar == '('
+ || aChar == ')'
+ || aChar == '['
+ || aChar == ']'
+ || aChar == '{'
+ || aChar == '}'
+ || aChar == '^'
+ || aChar == '?'
+ || aChar == '*'
+ || aChar == '+'
+ || aChar == '\\') {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isEscaped(String aString) {
+ return aString.substring(0, 1).equals("\\");
+ }
+
+ public static String splitAndUppercase(String aInput, String aDelim) {
+
+ if (!isEscaped(aDelim)) {
+ boolean isSpecial = false;
+ for (int o = 0; o < aInput.length(); o++) {
+ if (isSpecialCharacter(aInput.charAt(o))) {
+ isSpecial = true;
+ }
+ }
+ if (isSpecial) {
+ aDelim = "\\" + aDelim;
+ }
+ }
+
+ Logger.INFO("Splitting " + aInput);
+ String[] aSplit = aInput.split(aDelim);
+ Logger.INFO("Split into " + aSplit == null ? "" + 0 : aSplit.length + " parts.");
+ if (aSplit == null || aSplit.length == 0) {
+ return aInput;
+ } else {
+ AutoMap<String> aTemp = new AutoMap<String>();
+ for (String s : aSplit) {
+ Logger.INFO("Found: " + s);
+ s = s.replace(".", "");
+ s = Utils.sanitizeString(s);
+ s = firstLetterCaps(s);
+ Logger.INFO("Formatted & Captilized: " + s);
+ aTemp.put(s);
+ }
+ Logger.INFO("Rebuilding");
+ String aReturn = "";
+ for (String s : aTemp) {
+ aReturn += s;
+ Logger.INFO("Step: " + aReturn);
+ }
+ return aReturn;
+ }
+ }
+
+ public static int characterCount(String aString, char aChar) {
+ return characterCount(aString, "" + aChar);
+ }
+
+ public static int characterCount(String aString, String aChar) {
+ int aLength = aString.length();
+ int aFound = 0;
+ if (aLength == 0 || !aString.contains(aChar)) {
+ return 0;
+ } else {
+ for (int index = 0; index < aLength; index++) {
+ if (aString.substring(index, index + 1).equals(aChar)) {
+ aFound++;
+ }
+ }
+ return aFound;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/data/UUIDUtils.java b/src/main/java/gtPlusPlus/core/util/data/UUIDUtils.java
index d6b32314b1..71634b3af7 100644
--- a/src/main/java/gtPlusPlus/core/util/data/UUIDUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/UUIDUtils.java
@@ -5,21 +5,20 @@ import java.util.UUID;
public class UUIDUtils {
- //UUID Methods below created by https://gist.github.com/jeffjohnson9046
- //https://gist.github.com/jeffjohnson9046/c663dd22bbe6bb0b3f5e
+ // UUID Methods below created by https://gist.github.com/jeffjohnson9046
+ // https://gist.github.com/jeffjohnson9046/c663dd22bbe6bb0b3f5e
- public static byte[] getBytesFromUUID(UUID uuid) {
- ByteBuffer bb = ByteBuffer.wrap(new byte[16]);
- bb.putLong(uuid.getMostSignificantBits());
- bb.putLong(uuid.getLeastSignificantBits());
- return bb.array();
- }
-
- public static UUID getUUIDFromBytes(byte[] bytes) {
- ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
- Long high = byteBuffer.getLong();
- Long low = byteBuffer.getLong();
- return new UUID(high, low);
- }
+ public static byte[] getBytesFromUUID(UUID uuid) {
+ ByteBuffer bb = ByteBuffer.wrap(new byte[16]);
+ bb.putLong(uuid.getMostSignificantBits());
+ bb.putLong(uuid.getLeastSignificantBits());
+ return bb.array();
+ }
+ public static UUID getUUIDFromBytes(byte[] bytes) {
+ ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
+ Long high = byteBuffer.getLong();
+ Long low = byteBuffer.getLong();
+ return new UUID(high, low);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_INIT.java b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_INIT.java
index f8fc15c778..a6441ee558 100644
--- a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_INIT.java
+++ b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_INIT.java
@@ -4,34 +4,25 @@ import gtPlusPlus.preloader.CORE_Preloader;
public class DEBUG_INIT {
- public static void registerBlocks(){
- //Debug Loading
- if (CORE_Preloader.DEBUG_MODE){
-
- }
- }
-
- public static void registerItems(){
- /*ModItems.itemDebugShapeSpawner = new DEBUG_ITEM_ShapeSpawner("itemDebugShapeSpawner", AddToCreativeTab.tabMisc, 1, 500);
- GameRegistry.registerItem(ModItems.itemDebugShapeSpawner, "itemDebugShapeSpawner");
- ModItems.itemBedLocator_Base = new BedLocator_Base("itemBedLocator_Base");
- GameRegistry.registerItem(ModItems.itemBedLocator_Base, "itemBedLocator_Base");
- ModItems.itemBaseItemWithCharge = new BaseItemWithCharge("itemBaseItemWithCharge", 0, 1000);
- GameRegistry.registerItem(ModItems.itemBaseItemWithCharge, "itemBaseItemWithCharge");*/
- }
-
- public static void registerTEs(){
-
- }
-
- public static void registerMisc(){
-
-
-
- }
-
- public static void registerHandlers(){
- //MinecraftForge.EVENT_BUS.register(new DEBUG_ScreenOverlay());
- }
-
+ public static void registerBlocks() {
+ // Debug Loading
+ if (CORE_Preloader.DEBUG_MODE) {}
+ }
+
+ public static void registerItems() {
+ /*ModItems.itemDebugShapeSpawner = new DEBUG_ITEM_ShapeSpawner("itemDebugShapeSpawner", AddToCreativeTab.tabMisc, 1, 500);
+ GameRegistry.registerItem(ModItems.itemDebugShapeSpawner, "itemDebugShapeSpawner");
+ ModItems.itemBedLocator_Base = new BedLocator_Base("itemBedLocator_Base");
+ GameRegistry.registerItem(ModItems.itemBedLocator_Base, "itemBedLocator_Base");
+ ModItems.itemBaseItemWithCharge = new BaseItemWithCharge("itemBaseItemWithCharge", 0, 1000);
+ GameRegistry.registerItem(ModItems.itemBaseItemWithCharge, "itemBaseItemWithCharge");*/
+ }
+
+ public static void registerTEs() {}
+
+ public static void registerMisc() {}
+
+ public static void registerHandlers() {
+ // MinecraftForge.EVENT_BUS.register(new DEBUG_ScreenOverlay());
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java
index d1e65afe3e..cd8ca0e536 100644
--- a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java
+++ b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java
@@ -2,57 +2,50 @@ package gtPlusPlus.core.util.debug;
import static net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK;
-import java.util.List;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.BaseItemGeneric;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.BaseItemGeneric;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
-public class DEBUG_ITEM_ShapeSpawner extends BaseItemGeneric{
-
- public DEBUG_ITEM_ShapeSpawner(String s, CreativeTabs c, int stackSize, int maxDmg) {
- super(s, c, stackSize, maxDmg);
- s = "itemDebugShapeSpawner";
- c = AddToCreativeTab.tabMisc;
- stackSize = 1;
- maxDmg = 500;
- }
-
- @Override
- public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player){
-
- if (!world.isRemote){
- Logger.INFO("Constructing the shape for the "+"VACUUM FREEZER");
- final Thread thread = new Thread(new DEBUG_TimerThread(world, player));
- thread.start();
- }
- return stack;
- }
-
-
-
- @SubscribeEvent
- public void playerInteractEventHandler(final PlayerInteractEvent event)
- {
- if (event.isCanceled() || event.world.isRemote || (event.action != RIGHT_CLICK_BLOCK)) {
- return;
- }
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GOLD+"For Testing Gregtech Shapes!");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
+public class DEBUG_ITEM_ShapeSpawner extends BaseItemGeneric {
+
+ public DEBUG_ITEM_ShapeSpawner(String s, CreativeTabs c, int stackSize, int maxDmg) {
+ super(s, c, stackSize, maxDmg);
+ s = "itemDebugShapeSpawner";
+ c = AddToCreativeTab.tabMisc;
+ stackSize = 1;
+ maxDmg = 500;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
+
+ if (!world.isRemote) {
+ Logger.INFO("Constructing the shape for the " + "VACUUM FREEZER");
+ final Thread thread = new Thread(new DEBUG_TimerThread(world, player));
+ thread.start();
+ }
+ return stack;
+ }
+
+ @SubscribeEvent
+ public void playerInteractEventHandler(final PlayerInteractEvent event) {
+ if (event.isCanceled() || event.world.isRemote || (event.action != RIGHT_CLICK_BLOCK)) {
+ return;
+ }
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GOLD + "For Testing Gregtech Shapes!");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java
index 2e46b171f9..b4d2480a02 100644
--- a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java
+++ b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java
@@ -2,13 +2,6 @@ package gtPlusPlus.core.util.debug;
import static gregtech.api.enums.GT_Values.V;
-import java.util.ArrayList;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
@@ -27,892 +20,966 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
-
+import java.util.ArrayList;
+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 DEBUG_MULTIBLOCK_ShapeSpawner extends MetaTileEntity {
- public static boolean disableMaintenance;
- public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = false, mCrowbar = false, mRunningOnLoad = 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 ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<>();
- public ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<>();
- public ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<>();
- public ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<>();
- public ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<>();
- public ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<>();
- public ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<>();
- public ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<>();
-
- public DEBUG_MULTIBLOCK_ShapeSpawner(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, 2);
- DEBUG_MULTIBLOCK_ShapeSpawner.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
- }
-
- public DEBUG_MULTIBLOCK_ShapeSpawner(final String aName) {
- super(aName, 2);
- DEBUG_MULTIBLOCK_ShapeSpawner.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
- }
-
- public static boolean isValidMetaTileEntity(final MetaTileEntity aMetaTileEntity) {
- return (aMetaTileEntity.getBaseMetaTileEntity() != null) && (aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity) && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCoverID) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex > 0;
- }
-
- @Override
- public int getProgresstime() {
- return this.mProgresstime;
- }
-
- @Override
- public int maxProgresstime() {
- return this.mMaxProgresstime;
- }
-
- @Override
- public int increaseProgress(final int aProgress) {
- return aProgress;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mEUt", this.mEUt);
- aNBT.setInteger("mProgresstime", this.mProgresstime);
- aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
- aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
- aNBT.setInteger("mEfficiency", this.mEfficiency);
- aNBT.setInteger("mPollution", this.mPollution);
- aNBT.setInteger("mRuntime", this.mRuntime);
-
- if (this.mOutputItems != null) {
- for (int i = 0; i < this.mOutputItems.length; i++) {
- if (this.mOutputItems[i] != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItems[i].writeToNBT(tNBT);
- aNBT.setTag("mOutputItem" + i, tNBT);
- }
- }
- }
- if (this.mOutputFluids != null) {
- for (int i = 0; i < this.mOutputFluids.length; i++) {
- if (this.mOutputFluids[i] != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputFluids[i].writeToNBT(tNBT);
- aNBT.setTag("mOutputFluids" + i, tNBT);
- }
- }
- }
-
- aNBT.setBoolean("mWrench", this.mWrench);
- aNBT.setBoolean("mScrewdriver", this.mScrewdriver);
- aNBT.setBoolean("mSoftHammer", this.mSoftHammer);
- aNBT.setBoolean("mHardHammer", this.mHardHammer);
- aNBT.setBoolean("mSolderingTool", this.mSolderingTool);
- aNBT.setBoolean("mCrowbar", this.mCrowbar);
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mEUt = aNBT.getInteger("mEUt");
- this.mProgresstime = aNBT.getInteger("mProgresstime");
- this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- if (this.mMaxProgresstime > 0) {
- this.mRunningOnLoad = true;
- }
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mEfficiency = aNBT.getInteger("mEfficiency");
- this.mPollution = aNBT.getInteger("mPollution");
- this.mRuntime = aNBT.getInteger("mRuntime");
- this.mOutputItems = new ItemStack[this.getAmountOfOutputs()];
- for (int i = 0; i < this.mOutputItems.length; i++) {
- this.mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
- }
- this.mOutputFluids = new FluidStack[this.getAmountOfOutputs()];
- for (int i = 0; i < this.mOutputFluids.length; i++) {
- this.mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
- }
- this.mWrench = aNBT.getBoolean("mWrench");
- this.mScrewdriver = aNBT.getBoolean("mScrewdriver");
- this.mSoftHammer = aNBT.getBoolean("mSoftHammer");
- this.mHardHammer = aNBT.getBoolean("mHardHammer");
- this.mSolderingTool = aNBT.getBoolean("mSolderingTool");
- this.mCrowbar = aNBT.getBoolean("mCrowbar");
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MultiblockDisplay.png");
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return 2;
- }
-
- @Override
- public void onMachineBlockUpdate() {
- this.mUpdate = 50;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mEfficiency < 0) {
- this.mEfficiency = 0;
- }
- if ((--this.mUpdate == 0) || (--this.mStartUpCheck == 0)) {
- this.mInputHatches.clear();
- this.mInputBusses.clear();
- this.mOutputHatches.clear();
- this.mOutputBusses.clear();
- this.mDynamoHatches.clear();
- this.mEnergyHatches.clear();
- this.mMufflerHatches.clear();
- this.mMaintenanceHatches.clear();
- this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]);
- }
- if (this.mStartUpCheck < 0) {
- if (this.mMachine) {
- for (final GT_MetaTileEntity_Hatch_Maintenance tHatch : this.mMaintenanceHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- if (!DEBUG_MULTIBLOCK_ShapeSpawner.disableMaintenance) {
- if (tHatch.mWrench) {
- this.mWrench = true;
- }
- if (tHatch.mScrewdriver) {
- this.mScrewdriver = true;
- }
- if (tHatch.mSoftHammer) {
- this.mSoftHammer = true;
- }
- if (tHatch.mHardHammer) {
- this.mHardHammer = true;
- }
- if (tHatch.mSolderingTool) {
- this.mSolderingTool = true;
- }
- if (tHatch.mCrowbar) {
- this.mCrowbar = true;
- }
- } else {
- this.mWrench = true;
- this.mScrewdriver = true;
- this.mSoftHammer = true;
- this.mHardHammer = true;
- this.mSolderingTool = true;
- this.mCrowbar = true;
- }
-
- tHatch.mWrench = false;
- tHatch.mScrewdriver = false;
- tHatch.mSoftHammer = false;
- tHatch.mHardHammer = false;
- tHatch.mSolderingTool = false;
- tHatch.mCrowbar = false;
- }
- }
- if (this.getRepairStatus() > 0) {
- if ((this.mMaxProgresstime > 0) && this.doRandomMaintenanceDamage()) {
- if (this.onRunningTick(this.mInventory[1])) {
- if (!this.polluteEnvironment(this.getPollutionPerTick(this.mInventory[1]))) {
- this.stopMachine();
- }
- if ((this.mMaxProgresstime > 0) && (++this.mProgresstime >= this.mMaxProgresstime)) {
- if (this.mOutputItems != null) {
- for (final ItemStack tStack : this.mOutputItems) {
- if (tStack != null) {
- try {
- GT_Mod.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack);
- } catch (final Exception e) {
- }
- this.addOutput(tStack);
- }
- }
- }
- if ((this.mOutputFluids != null) && (this.mOutputFluids.length == 1)) {
- for (final FluidStack tStack : this.mOutputFluids) {
- if (tStack != null) {
- this.addOutput(tStack);
- }
- }
- } else if ((this.mOutputFluids != null) && (this.mOutputFluids.length > 1)) {
- this.addFluidOutputs(this.mOutputFluids);
- }
- this.mEfficiency = Math.max(0, Math.min(this.mEfficiency + this.mEfficiencyIncrease, this.getMaxEfficiency(this.mInventory[1]) - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)));
- this.mOutputItems = null;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- this.mEfficiencyIncrease = 0;
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.checkRecipe(this.mInventory[1]);
- }
- if ((this.mOutputFluids != null) && (this.mOutputFluids.length > 0)) {
- if (this.mOutputFluids.length > 1) {
- GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "oilplant");
- }
- }
- }
- }
- } else {
- if (((aTick % 100) == 0) || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) {
-
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.checkRecipe(this.mInventory[1]);
- }
- if (this.mMaxProgresstime <= 0) {
- this.mEfficiency = Math.max(0, this.mEfficiency - 1000);
- }
- }
- }
- } else {
- this.stopMachine();
- }
- } else {
- this.stopMachine();
- }
- }
- aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mWrench ? 0 : 1) | (this.mScrewdriver ? 0 : 2) | (this.mSoftHammer ? 0 : 4) | (this.mHardHammer ? 0 : 8) | (this.mSolderingTool ? 0 : 16) | (this.mCrowbar ? 0 : 32) | (this.mMachine ? 0 : 64));
- aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0);
- }
- }
-
- public boolean polluteEnvironment(final int aPollutionLevel) {
- this.mPollution += aPollutionLevel;
- for (final GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- if (this.mPollution >= 10000) {
- if (tHatch.polluteEnvironment()) {
- this.mPollution -= 10000;
- }
- } else {
- break;
- }
- }
- }
- return this.mPollution < 10000;
- }
-
- /**
- * Called every tick the Machine runs
- */
- public boolean onRunningTick(final ItemStack aStack) {
- if (this.mEUt > 0) {
- this.addEnergyOutput(((long) this.mEUt * this.mEfficiency) / 10000);
- return true;
- }
- if (this.mEUt < 0) {
- if (!this.drainEnergyInput(((long) -this.mEUt * 10000) / Math.max(1000, this.mEfficiency))) {
- this.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() {
- this.mOutputItems = null;
- this.mEUt = 0;
- this.mEfficiency = 0;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- this.mEfficiencyIncrease = 0;
- this.getBaseMetaTileEntity().disableWorking();
- }
-
- public int getRepairStatus() {
- return (this.mWrench ? 1 : 0) + (this.mScrewdriver ? 1 : 0) + (this.mSoftHammer ? 1 : 0) + (this.mHardHammer ? 1 : 0) + (this.mSolderingTool ? 1 : 0) + (this.mCrowbar ? 1 : 0);
- }
-
- public int getIdealStatus() {
- return 6;
- }
-
- public boolean doRandomMaintenanceDamage() {
- if (!this.isCorrectMachinePart(this.mInventory[1]) || (this.getRepairStatus() == 0)) {
- this.stopMachine();
- return false;
- }
- if (this.mRuntime++ > 1000) {
- this.mRuntime = 0;
- if (this.getBaseMetaTileEntity().getRandomNumber(6000) == 0) {
- switch (this.getBaseMetaTileEntity().getRandomNumber(6)) {
- case 0:
- this.mWrench = false;
- break;
- case 1:
- this.mScrewdriver = false;
- break;
- case 2:
- this.mSoftHammer = false;
- break;
- case 3:
- this.mHardHammer = false;
- break;
- case 4:
- this.mSolderingTool = false;
- break;
- case 5:
- this.mCrowbar = false;
- break;
- }
- }
- if ((this.mInventory[1] != null) && (this.getBaseMetaTileEntity().getRandomNumber(2) == 0) && !this.mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) {
- if (this.mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
- final NBTTagCompound tNBT = this.mInventory[1].getTagCompound();
- if (tNBT != null) {
- NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents");
- if (!tNBT.getBoolean("mDis")) {
- tNBT2 = new NBTTagCompound();
- final Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[1]);
- final ItemStack tTurbine = GT_OreDictUnificator.get(OrePrefixes.turbineBlade, tMaterial, 1);
- final int i = this.mInventory[1].getItemDamage();
- if (i == 170) {
- ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Magnalium, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- } else if (i == 172) {
- ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Titanium, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- } else if (i == 174) {
- ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TungstenSteel, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- } else if (i == 176) {
- ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Americium, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- }
- tNBT.setTag("GT.CraftingComponents", tNBT2);
- tNBT.setBoolean("mDis", true);
- this.mInventory[1].setTagCompound(tNBT);
-
- }
- }
-
- ((GT_MetaGenerated_Tool) this.mInventory[1].getItem()).doDamage(this.mInventory[1], (long) Math.min(this.mEUt / 5, Math.pow(this.mEUt, 0.7)));
- if (this.mInventory[1].stackSize == 0) {
- this.mInventory[1] = null;
- }
- }
- }
- }
- return true;
- }
-
- public void explodeMultiblock() {
- this.mInventory[1] = null;
- for (final MetaTileEntity tTileEntity : this.mInputBusses) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mOutputBusses) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mInputHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mOutputHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mDynamoHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mMufflerHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mEnergyHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mMaintenanceHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
- }
- this.getBaseMetaTileEntity().doExplosion(V[8]);
- }
-
- public boolean addEnergyOutput(final long aEU) {
- if (aEU <= 0) {
- return true;
- }
- for (final GT_MetaTileEntity_Hatch_Dynamo tHatch : this.mDynamoHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(aEU, false)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public long getMaxInputVoltage() {
- long rVoltage = 0;
- for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
- }
- }
- return rVoltage;
- }
-
- public boolean drainEnergyInput(final long aEU) {
- if (aEU <= 0) {
- return true;
- }
- for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean addOutput(final FluidStack aLiquid) {
- if (aLiquid == null) {
- return false;
- }
- final FluidStack tLiquid = aLiquid.copy();
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) {
- final int tAmount = tHatch.fill(tLiquid, false);
- if (tAmount >= tLiquid.amount) {
- return tHatch.fill(tLiquid, true) >= tLiquid.amount;
- } else if (tAmount > 0) {
- tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true);
- }
- }
- }
- return false;
- }
-
- private void addFluidOutputs(final FluidStack[] mOutputFluids2) {
- for (int i = 0; i < mOutputFluids2.length; i++) {
- if ((this.mOutputHatches.size() > i) && (this.mOutputHatches.get(i) != null) && (mOutputFluids2[i] != null) && isValidMetaTileEntity(this.mOutputHatches.get(i))) {
- this.mOutputHatches.get(i).fill(mOutputFluids2[i], true);
- }
- }
-
- }
-
- public boolean depleteInput(final FluidStack aLiquid) {
- if (aLiquid == null) {
- return false;
- }
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.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 (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
- if (isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) {
- if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, aStack)) {
- return true;
- }
- }
- }
- }
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.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(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- final FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
- if (aLiquid != null) {
- return this.depleteInput(aLiquid);
- }
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.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 (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
- tHatch.mRecipeMap = this.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<ItemStack> getStoredOutputs() {
- final ArrayList<ItemStack> rList = new ArrayList<>();
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1));
- }
- }
- for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
- if (isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- }
- return rList;
- }
-
- public ArrayList<FluidStack> getStoredFluids() {
- final ArrayList<FluidStack> rList = new ArrayList<>();
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (isValidMetaTileEntity(tHatch) && (tHatch.getFillableStack() != null)) {
- rList.add(tHatch.getFillableStack());
- }
- }
- return rList;
- }
-
- public ArrayList<ItemStack> getStoredInputs() {
- final ArrayList<ItemStack> rList = new ArrayList<>();
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (isValidMetaTileEntity(tHatch) && (tHatch.getBaseMetaTileEntity().getStackInSlot(0) != null)) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(0));
- }
- }
- for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
- tHatch.mRecipeMap = this.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 (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
- }
- }
- for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
- if (isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
- }
- }
- }
-
- public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final 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 this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
- return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
- return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
- return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
- return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
- return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addMaintenanceToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addEnergyInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addDynamoToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addMufflerToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final 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 = this.getRecipeMap();
- return this.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 = this.getRecipeMap();
- return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addOutputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
- }
- return false;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[]{"Progress:", (this.mProgresstime / 20) + "secs", (this.mMaxProgresstime / 20) + "secs", "Efficiency:", (this.mEfficiency / 100.0F) + "%", "Problems:", "" + (this.getIdealStatus() - this.getRepairStatus())};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
+ public static boolean disableMaintenance;
+ public boolean mMachine = false,
+ mWrench = false,
+ mScrewdriver = false,
+ mSoftHammer = false,
+ mHardHammer = false,
+ mSolderingTool = false,
+ mCrowbar = false,
+ mRunningOnLoad = 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 ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<>();
+ public ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<>();
+ public ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<>();
+
+ public DEBUG_MULTIBLOCK_ShapeSpawner(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional, 2);
+ DEBUG_MULTIBLOCK_ShapeSpawner.disableMaintenance = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ }
+
+ public DEBUG_MULTIBLOCK_ShapeSpawner(final String aName) {
+ super(aName, 2);
+ DEBUG_MULTIBLOCK_ShapeSpawner.disableMaintenance = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ }
+
+ public static boolean isValidMetaTileEntity(final MetaTileEntity aMetaTileEntity) {
+ return (aMetaTileEntity.getBaseMetaTileEntity() != null)
+ && (aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity)
+ && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
+ }
+
+ @Override
+ public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCoverID) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return aIndex > 0;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return this.mProgresstime;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return this.mMaxProgresstime;
+ }
+
+ @Override
+ public int increaseProgress(final int aProgress) {
+ return aProgress;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setInteger("mEUt", this.mEUt);
+ aNBT.setInteger("mProgresstime", this.mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
+ aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
+ aNBT.setInteger("mEfficiency", this.mEfficiency);
+ aNBT.setInteger("mPollution", this.mPollution);
+ aNBT.setInteger("mRuntime", this.mRuntime);
+
+ if (this.mOutputItems != null) {
+ for (int i = 0; i < this.mOutputItems.length; i++) {
+ if (this.mOutputItems[i] != null) {
+ final NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItems[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem" + i, tNBT);
+ }
+ }
+ }
+ if (this.mOutputFluids != null) {
+ for (int i = 0; i < this.mOutputFluids.length; i++) {
+ if (this.mOutputFluids[i] != null) {
+ final NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputFluids[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputFluids" + i, tNBT);
+ }
+ }
+ }
+
+ aNBT.setBoolean("mWrench", this.mWrench);
+ aNBT.setBoolean("mScrewdriver", this.mScrewdriver);
+ aNBT.setBoolean("mSoftHammer", this.mSoftHammer);
+ aNBT.setBoolean("mHardHammer", this.mHardHammer);
+ aNBT.setBoolean("mSolderingTool", this.mSolderingTool);
+ aNBT.setBoolean("mCrowbar", this.mCrowbar);
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mEUt = aNBT.getInteger("mEUt");
+ this.mProgresstime = aNBT.getInteger("mProgresstime");
+ this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ if (this.mMaxProgresstime > 0) {
+ this.mRunningOnLoad = true;
+ }
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mEfficiency = aNBT.getInteger("mEfficiency");
+ this.mPollution = aNBT.getInteger("mPollution");
+ this.mRuntime = aNBT.getInteger("mRuntime");
+ this.mOutputItems = new ItemStack[this.getAmountOfOutputs()];
+ for (int i = 0; i < this.mOutputItems.length; i++) {
+ this.mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
+ }
+ this.mOutputFluids = new FluidStack[this.getAmountOfOutputs()];
+ for (int i = 0; i < this.mOutputFluids.length; i++) {
+ this.mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
+ }
+ this.mWrench = aNBT.getBoolean("mWrench");
+ this.mScrewdriver = aNBT.getBoolean("mScrewdriver");
+ this.mSoftHammer = aNBT.getBoolean("mSoftHammer");
+ this.mHardHammer = aNBT.getBoolean("mHardHammer");
+ this.mSolderingTool = aNBT.getBoolean("mSolderingTool");
+ this.mCrowbar = aNBT.getBoolean("mCrowbar");
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MultiblockDisplay.png");
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return 2;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ this.mUpdate = 50;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mEfficiency < 0) {
+ this.mEfficiency = 0;
+ }
+ if ((--this.mUpdate == 0) || (--this.mStartUpCheck == 0)) {
+ this.mInputHatches.clear();
+ this.mInputBusses.clear();
+ this.mOutputHatches.clear();
+ this.mOutputBusses.clear();
+ this.mDynamoHatches.clear();
+ this.mEnergyHatches.clear();
+ this.mMufflerHatches.clear();
+ this.mMaintenanceHatches.clear();
+ this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]);
+ }
+ if (this.mStartUpCheck < 0) {
+ if (this.mMachine) {
+ for (final GT_MetaTileEntity_Hatch_Maintenance tHatch : this.mMaintenanceHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (!DEBUG_MULTIBLOCK_ShapeSpawner.disableMaintenance) {
+ if (tHatch.mWrench) {
+ this.mWrench = true;
+ }
+ if (tHatch.mScrewdriver) {
+ this.mScrewdriver = true;
+ }
+ if (tHatch.mSoftHammer) {
+ this.mSoftHammer = true;
+ }
+ if (tHatch.mHardHammer) {
+ this.mHardHammer = true;
+ }
+ if (tHatch.mSolderingTool) {
+ this.mSolderingTool = true;
+ }
+ if (tHatch.mCrowbar) {
+ this.mCrowbar = true;
+ }
+ } else {
+ this.mWrench = true;
+ this.mScrewdriver = true;
+ this.mSoftHammer = true;
+ this.mHardHammer = true;
+ this.mSolderingTool = true;
+ this.mCrowbar = true;
+ }
+
+ tHatch.mWrench = false;
+ tHatch.mScrewdriver = false;
+ tHatch.mSoftHammer = false;
+ tHatch.mHardHammer = false;
+ tHatch.mSolderingTool = false;
+ tHatch.mCrowbar = false;
+ }
+ }
+ if (this.getRepairStatus() > 0) {
+ if ((this.mMaxProgresstime > 0) && this.doRandomMaintenanceDamage()) {
+ if (this.onRunningTick(this.mInventory[1])) {
+ if (!this.polluteEnvironment(this.getPollutionPerTick(this.mInventory[1]))) {
+ this.stopMachine();
+ }
+ if ((this.mMaxProgresstime > 0) && (++this.mProgresstime >= this.mMaxProgresstime)) {
+ if (this.mOutputItems != null) {
+ for (final ItemStack tStack : this.mOutputItems) {
+ if (tStack != null) {
+ try {
+ GT_Mod.achievements.issueAchivementHatch(
+ aBaseMetaTileEntity
+ .getWorld()
+ .getPlayerEntityByName(
+ aBaseMetaTileEntity.getOwnerName()),
+ tStack);
+ } catch (final Exception e) {
+ }
+ this.addOutput(tStack);
+ }
+ }
+ }
+ if ((this.mOutputFluids != null) && (this.mOutputFluids.length == 1)) {
+ for (final FluidStack tStack : this.mOutputFluids) {
+ if (tStack != null) {
+ this.addOutput(tStack);
+ }
+ }
+ } else if ((this.mOutputFluids != null) && (this.mOutputFluids.length > 1)) {
+ this.addFluidOutputs(this.mOutputFluids);
+ }
+ this.mEfficiency = Math.max(
+ 0,
+ Math.min(
+ this.mEfficiency + this.mEfficiencyIncrease,
+ this.getMaxEfficiency(this.mInventory[1])
+ - ((this.getIdealStatus() - this.getRepairStatus())
+ * 1000)));
+ this.mOutputItems = null;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ this.mEfficiencyIncrease = 0;
+ if (aBaseMetaTileEntity.isAllowedToWork()) {
+ this.checkRecipe(this.mInventory[1]);
+ }
+ if ((this.mOutputFluids != null) && (this.mOutputFluids.length > 0)) {
+ if (this.mOutputFluids.length > 1) {
+ GT_Mod.achievements.issueAchievement(
+ aBaseMetaTileEntity
+ .getWorld()
+ .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
+ "oilplant");
+ }
+ }
+ }
+ }
+ } else {
+ if (((aTick % 100) == 0)
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
+ || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+
+ if (aBaseMetaTileEntity.isAllowedToWork()) {
+ this.checkRecipe(this.mInventory[1]);
+ }
+ if (this.mMaxProgresstime <= 0) {
+ this.mEfficiency = Math.max(0, this.mEfficiency - 1000);
+ }
+ }
+ }
+ } else {
+ this.stopMachine();
+ }
+ } else {
+ this.stopMachine();
+ }
+ }
+ aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127)
+ | (this.mWrench ? 0 : 1)
+ | (this.mScrewdriver ? 0 : 2)
+ | (this.mSoftHammer ? 0 : 4)
+ | (this.mHardHammer ? 0 : 8)
+ | (this.mSolderingTool ? 0 : 16)
+ | (this.mCrowbar ? 0 : 32)
+ | (this.mMachine ? 0 : 64));
+ aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0);
+ }
+ }
+
+ public boolean polluteEnvironment(final int aPollutionLevel) {
+ this.mPollution += aPollutionLevel;
+ for (final GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (this.mPollution >= 10000) {
+ if (tHatch.polluteEnvironment()) {
+ this.mPollution -= 10000;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+ return this.mPollution < 10000;
+ }
+
+ /**
+ * Called every tick the Machine runs
+ */
+ public boolean onRunningTick(final ItemStack aStack) {
+ if (this.mEUt > 0) {
+ this.addEnergyOutput(((long) this.mEUt * this.mEfficiency) / 10000);
+ return true;
+ }
+ if (this.mEUt < 0) {
+ if (!this.drainEnergyInput(((long) -this.mEUt * 10000) / Math.max(1000, this.mEfficiency))) {
+ this.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() {
+ this.mOutputItems = null;
+ this.mEUt = 0;
+ this.mEfficiency = 0;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ this.mEfficiencyIncrease = 0;
+ this.getBaseMetaTileEntity().disableWorking();
+ }
+
+ public int getRepairStatus() {
+ return (this.mWrench ? 1 : 0)
+ + (this.mScrewdriver ? 1 : 0)
+ + (this.mSoftHammer ? 1 : 0)
+ + (this.mHardHammer ? 1 : 0)
+ + (this.mSolderingTool ? 1 : 0)
+ + (this.mCrowbar ? 1 : 0);
+ }
+
+ public int getIdealStatus() {
+ return 6;
+ }
+
+ public boolean doRandomMaintenanceDamage() {
+ if (!this.isCorrectMachinePart(this.mInventory[1]) || (this.getRepairStatus() == 0)) {
+ this.stopMachine();
+ return false;
+ }
+ if (this.mRuntime++ > 1000) {
+ this.mRuntime = 0;
+ if (this.getBaseMetaTileEntity().getRandomNumber(6000) == 0) {
+ switch (this.getBaseMetaTileEntity().getRandomNumber(6)) {
+ case 0:
+ this.mWrench = false;
+ break;
+ case 1:
+ this.mScrewdriver = false;
+ break;
+ case 2:
+ this.mSoftHammer = false;
+ break;
+ case 3:
+ this.mHardHammer = false;
+ break;
+ case 4:
+ this.mSolderingTool = false;
+ break;
+ case 5:
+ this.mCrowbar = false;
+ break;
+ }
+ }
+ if ((this.mInventory[1] != null)
+ && (this.getBaseMetaTileEntity().getRandomNumber(2) == 0)
+ && !this.mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) {
+ if (this.mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
+ final NBTTagCompound tNBT = this.mInventory[1].getTagCompound();
+ if (tNBT != null) {
+ NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents");
+ if (!tNBT.getBoolean("mDis")) {
+ tNBT2 = new NBTTagCompound();
+ final Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[1]);
+ final ItemStack tTurbine = GT_OreDictUnificator.get(OrePrefixes.turbineBlade, tMaterial, 1);
+ final int i = this.mInventory[1].getItemDamage();
+ if (i == 170) {
+ ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Magnalium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 172) {
+ ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Titanium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 174) {
+ ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TungstenSteel, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 176) {
+ ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Americium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ }
+ tNBT.setTag("GT.CraftingComponents", tNBT2);
+ tNBT.setBoolean("mDis", true);
+ this.mInventory[1].setTagCompound(tNBT);
+ }
+ }
+
+ ((GT_MetaGenerated_Tool) this.mInventory[1].getItem())
+ .doDamage(this.mInventory[1], (long) Math.min(this.mEUt / 5, Math.pow(this.mEUt, 0.7)));
+ if (this.mInventory[1].stackSize == 0) {
+ this.mInventory[1] = null;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ public void explodeMultiblock() {
+ this.mInventory[1] = null;
+ for (final MetaTileEntity tTileEntity : this.mInputBusses) {
+ tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+ for (final MetaTileEntity tTileEntity : this.mOutputBusses) {
+ tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+ for (final MetaTileEntity tTileEntity : this.mInputHatches) {
+ tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+ for (final MetaTileEntity tTileEntity : this.mOutputHatches) {
+ tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+ for (final MetaTileEntity tTileEntity : this.mDynamoHatches) {
+ tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+ for (final MetaTileEntity tTileEntity : this.mMufflerHatches) {
+ tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+ for (final MetaTileEntity tTileEntity : this.mEnergyHatches) {
+ tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+ for (final MetaTileEntity tTileEntity : this.mMaintenanceHatches) {
+ tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+ this.getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+
+ public boolean addEnergyOutput(final long aEU) {
+ if (aEU <= 0) {
+ return true;
+ }
+ for (final GT_MetaTileEntity_Hatch_Dynamo tHatch : this.mDynamoHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(aEU, false)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public long getMaxInputVoltage() {
+ long rVoltage = 0;
+ for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ }
+ }
+ return rVoltage;
+ }
+
+ public boolean drainEnergyInput(final long aEU) {
+ if (aEU <= 0) {
+ return true;
+ }
+ for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean addOutput(final FluidStack aLiquid) {
+ if (aLiquid == null) {
+ return false;
+ }
+ final FluidStack tLiquid = aLiquid.copy();
+ for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid)
+ ? tHatch.outputsSteam()
+ : tHatch.outputsLiquids()) {
+ final int tAmount = tHatch.fill(tLiquid, false);
+ if (tAmount >= tLiquid.amount) {
+ return tHatch.fill(tLiquid, true) >= tLiquid.amount;
+ } else if (tAmount > 0) {
+ tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true);
+ }
+ }
+ }
+ return false;
+ }
+
+ private void addFluidOutputs(final FluidStack[] mOutputFluids2) {
+ for (int i = 0; i < mOutputFluids2.length; i++) {
+ if ((this.mOutputHatches.size() > i)
+ && (this.mOutputHatches.get(i) != null)
+ && (mOutputFluids2[i] != null)
+ && isValidMetaTileEntity(this.mOutputHatches.get(i))) {
+ this.mOutputHatches.get(i).fill(mOutputFluids2[i], true);
+ }
+ }
+ }
+
+ public boolean depleteInput(final FluidStack aLiquid) {
+ if (aLiquid == null) {
+ return false;
+ }
+ for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
+ tHatch.mRecipeMap = this.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 (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) {
+ if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, aStack)) {
+ return true;
+ }
+ }
+ }
+ }
+ for (final GT_MetaTileEntity_Hatch_Output tHatch : this.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(final ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) {
+ return false;
+ }
+ final FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
+ if (aLiquid != null) {
+ return this.depleteInput(aLiquid);
+ }
+ for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
+ tHatch.mRecipeMap = this.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 (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
+ tHatch.mRecipeMap = this.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<ItemStack> getStoredOutputs() {
+ final ArrayList<ItemStack> rList = new ArrayList<>();
+ for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1));
+ }
+ }
+ for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ return rList;
+ }
+
+ public ArrayList<FluidStack> getStoredFluids() {
+ final ArrayList<FluidStack> rList = new ArrayList<>();
+ for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
+ tHatch.mRecipeMap = this.getRecipeMap();
+ if (isValidMetaTileEntity(tHatch) && (tHatch.getFillableStack() != null)) {
+ rList.add(tHatch.getFillableStack());
+ }
+ }
+ return rList;
+ }
+
+ public ArrayList<ItemStack> getStoredInputs() {
+ final ArrayList<ItemStack> rList = new ArrayList<>();
+ for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
+ tHatch.mRecipeMap = this.getRecipeMap();
+ if (isValidMetaTileEntity(tHatch) && (tHatch.getBaseMetaTileEntity().getStackInSlot(0) != null)) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(0));
+ }
+ }
+ for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
+ tHatch.mRecipeMap = this.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 (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ tHatch.updateSlots();
+ }
+ }
+ for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
+ if (isValidMetaTileEntity(tHatch)) {
+ tHatch.updateSlots();
+ }
+ }
+ }
+
+ public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final 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 this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addMaintenanceToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addEnergyInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addDynamoToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addMufflerToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final 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 = this.getRecipeMap();
+ return this.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 = this.getRecipeMap();
+ return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addOutputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[] {
+ "Progress:",
+ (this.mProgresstime / 20) + "secs",
+ (this.mMaxProgresstime / 20) + "secs",
+ "Efficiency:",
+ (this.mEfficiency / 100.0F) + "%",
+ "Problems:",
+ "" + (this.getIdealStatus() - this.getRepairStatus())
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java
index 1c6a8e9278..de29c35820 100644
--- a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java
+++ b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java
@@ -1,47 +1,45 @@
package gtPlusPlus.core.util.debug;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.item.Item;
-
import net.minecraftforge.client.event.RenderGameOverlayEvent;
public class DEBUG_ScreenOverlay extends Gui {
- int width, height;
- Minecraft mc = Minecraft.getMinecraft();
-
- @SubscribeEvent
- public void eventHandler(final RenderGameOverlayEvent.Text event)
- {
+ int width, height;
+ Minecraft mc = Minecraft.getMinecraft();
- //if (mc.thePlayer.getHeldItem().equals(ModItems.itemStaballoyPickaxe)){
- final ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
- final FontRenderer fontRender = this.mc.fontRenderer;
- this.width = res.getScaledWidth();
- this.height = res.getScaledHeight();
- Minecraft.getMinecraft().entityRenderer.setupOverlayRendering();
- final String str = "Words";
- Item heldItem = null;
+ @SubscribeEvent
+ public void eventHandler(final RenderGameOverlayEvent.Text event) {
- try{heldItem = this.mc.thePlayer.getHeldItem().getItem();
+ // if (mc.thePlayer.getHeldItem().equals(ModItems.itemStaballoyPickaxe)){
+ final ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
+ final FontRenderer fontRender = this.mc.fontRenderer;
+ this.width = res.getScaledWidth();
+ this.height = res.getScaledHeight();
+ Minecraft.getMinecraft().entityRenderer.setupOverlayRendering();
+ final String str = "Words";
+ Item heldItem = null;
- if (heldItem != null){
- /*if (heldItem instanceof StaballoyPickaxe){
+ try {
+ heldItem = this.mc.thePlayer.getHeldItem().getItem();
- int dmg =((StaballoyPickaxe) heldItem).getDamage(((StaballoyPickaxe) heldItem).thisPickaxe);
+ if (heldItem != null) {
+ /*if (heldItem instanceof StaballoyPickaxe){
- ((StaballoyPickaxe) heldItem).checkFacing(((StaballoyPickaxe) heldItem).localWorld);
- str = "DAMAGE: "+ dmg +" | FACING: "+((StaballoyPickaxe) heldItem).FACING+" | FACING_HORIZONTAL: "+((StaballoyPickaxe) heldItem).FACING_HORIZONTAL+" | LOOKING DIRECTION: "+((StaballoyPickaxe) heldItem).lookingDirection;
+ int dmg =((StaballoyPickaxe) heldItem).getDamage(((StaballoyPickaxe) heldItem).thisPickaxe);
- drawString(fontRender, str, (this.width - fontRender.getStringWidth(str)) / 2, this.height / 10, 0xFFAA00);
- }*/
- }
- }catch(final NullPointerException e){}
+ ((StaballoyPickaxe) heldItem).checkFacing(((StaballoyPickaxe) heldItem).localWorld);
+ str = "DAMAGE: "+ dmg +" | FACING: "+((StaballoyPickaxe) heldItem).FACING+" | FACING_HORIZONTAL: "+((StaballoyPickaxe) heldItem).FACING_HORIZONTAL+" | LOOKING DIRECTION: "+((StaballoyPickaxe) heldItem).lookingDirection;
- }
-} \ No newline at end of file
+ drawString(fontRender, str, (this.width - fontRender.getStringWidth(str)) / 2, this.height / 10, 0xFFAA00);
+ }*/
+ }
+ } catch (final NullPointerException e) {
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java
index 50d12871cb..004657ebcc 100644
--- a/src/main/java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java
+++ b/src/main/java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java
@@ -1,64 +1,62 @@
package gtPlusPlus.core.util.debug;
+import gtPlusPlus.api.objects.Logger;
import java.util.concurrent.TimeUnit;
-
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.Logger;
import net.minecraftforge.common.util.ForgeDirection;
public class DEBUG_TimerThread implements Runnable {
- private final World world;
- private final EntityPlayer player;
-
-
- public DEBUG_TimerThread(final World WORLD, final EntityPlayer PLAYER) {
- this.world = WORLD;
- this.player = PLAYER;
- }
-
- @Override
- public void run(){
- int xDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posX).offsetX;
- int zDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posZ).offsetZ;
-
- final int stepX = Minecraft.getMinecraft().objectMouseOver.blockX;
- final int stepY = Minecraft.getMinecraft().objectMouseOver.blockY;
- final int stepZ = Minecraft.getMinecraft().objectMouseOver.blockZ;
- Logger.INFO("Clicked on a Block @ "+"[X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]"+" with xDir:"+xDir+" zDir:"+zDir);
- this.world.setBlock(stepX, stepY, stepZ, Blocks.bedrock,0,3);
- Logger.INFO("Makng it Bedrock for future investment.");
- //for (int i = -1; i <= 1; i++) {
- //stepX = stepX+i;
- for (int i = stepX-1; i <= (stepX+1); i++){
- for (int j = stepZ-1; j <= (stepZ+1); j++){
- for (int h = stepY-1; h <= (stepY+1); h++){
-
- xDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posX).offsetX;
- zDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posZ).offsetZ;
-
- //for (int j = -1; j <= 1; j++) {
- //stepZ = stepZ+j;
- //for (int h = -1; h <= 1; h++) {
- //stepY = stepY+h;
- Logger.INFO("Placing Block @ "+"[X:"+i+"][Y:"+h+"][Z:"+j+"]"+" with xDir:"+xDir+" zDir:"+zDir);
- if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) {
- this.world.setBlock(i, h, j, Blocks.stone,0,3);
- }
- else {
- Logger.INFO("Not even sure what this is for, but I got here.");
- }
- try {
- TimeUnit.MILLISECONDS.sleep(500);
- } catch (final InterruptedException e1) {
- e1.printStackTrace();
- }
- }
- }
- }
- }
-} \ No newline at end of file
+ private final World world;
+ private final EntityPlayer player;
+
+ public DEBUG_TimerThread(final World WORLD, final EntityPlayer PLAYER) {
+ this.world = WORLD;
+ this.player = PLAYER;
+ }
+
+ @Override
+ public void run() {
+ int xDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posX).offsetX;
+ int zDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posZ).offsetZ;
+
+ final int stepX = Minecraft.getMinecraft().objectMouseOver.blockX;
+ final int stepY = Minecraft.getMinecraft().objectMouseOver.blockY;
+ final int stepZ = Minecraft.getMinecraft().objectMouseOver.blockZ;
+ Logger.INFO("Clicked on a Block @ " + "[X:" + stepX + "][Y:" + stepY + "][Z:" + stepZ + "]" + " with xDir:"
+ + xDir + " zDir:" + zDir);
+ this.world.setBlock(stepX, stepY, stepZ, Blocks.bedrock, 0, 3);
+ Logger.INFO("Makng it Bedrock for future investment.");
+ // for (int i = -1; i <= 1; i++) {
+ // stepX = stepX+i;
+ for (int i = stepX - 1; i <= (stepX + 1); i++) {
+ for (int j = stepZ - 1; j <= (stepZ + 1); j++) {
+ for (int h = stepY - 1; h <= (stepY + 1); h++) {
+
+ xDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posX).offsetX;
+ zDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posZ).offsetZ;
+
+ // for (int j = -1; j <= 1; j++) {
+ // stepZ = stepZ+j;
+ // for (int h = -1; h <= 1; h++) {
+ // stepY = stepY+h;
+ Logger.INFO("Placing Block @ " + "[X:" + i + "][Y:" + h + "][Z:" + j + "]" + " with xDir:" + xDir
+ + " zDir:" + zDir);
+ if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) {
+ this.world.setBlock(i, h, j, Blocks.stone, 0, 3);
+ } else {
+ Logger.INFO("Not even sure what this is for, but I got here.");
+ }
+ try {
+ TimeUnit.MILLISECONDS.sleep(500);
+ } catch (final InterruptedException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java b/src/main/java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java
index 7cb1054d53..cf3580f5b7 100644
--- a/src/main/java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java
+++ b/src/main/java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java
@@ -1,343 +1,1139 @@
package gtPlusPlus.core.util.debug;
import java.nio.ByteBuffer;
-
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
-
/**
* User: The Grey Ghost
* Date: 9/02/14
*/
-public class UtilityGL11Debug
-{
- public class GLproperty
- {
- public GLproperty(final int init_gLconstant, final String init_name, final String init_description, final String init_category, final String init_fetchCommand) {
- this.gLconstant = init_gLconstant;
- this.name = init_name;
- this.description = init_description;
- this.category = init_category;
- this.fetchCommand = init_fetchCommand;
- }
+public class UtilityGL11Debug {
+ public class GLproperty {
+ public GLproperty(
+ final int init_gLconstant,
+ final String init_name,
+ final String init_description,
+ final String init_category,
+ final String init_fetchCommand) {
+ this.gLconstant = init_gLconstant;
+ this.name = init_name;
+ this.description = init_description;
+ this.category = init_category;
+ this.fetchCommand = init_fetchCommand;
+ }
- public int gLconstant;
- public String name;
- public String description;
- public String category;
- public String fetchCommand;
- }
+ public int gLconstant;
+ public String name;
+ public String description;
+ public String category;
+ public String fetchCommand;
+ }
- public static UtilityGL11Debug instance = new UtilityGL11Debug();
+ public static UtilityGL11Debug instance = new UtilityGL11Debug();
- public GLproperty[] propertyList =
+ public GLproperty[] propertyList = {
+ new GLproperty(GL11.GL_CURRENT_COLOR, "GL_CURRENT_COLOR", "Current color", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_INDEX, "GL_CURRENT_INDEX", "Current color index", "current", "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_CURRENT_TEXTURE_COORDS,
+ "GL_CURRENT_TEXTURE_COORDS",
+ "Current texture coordinates",
+ "current",
+ "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_NORMAL, "GL_CURRENT_NORMAL", "Current normal", "current", "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_CURRENT_RASTER_POSITION,
+ "GL_CURRENT_RASTER_POSITION",
+ "Current raster position",
+ "current",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_CURRENT_RASTER_DISTANCE,
+ "GL_CURRENT_RASTER_DISTANCE",
+ "Current raster distance",
+ "current",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_CURRENT_RASTER_COLOR,
+ "GL_CURRENT_RASTER_COLOR",
+ "Color associated with raster position",
+ "current",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_CURRENT_RASTER_INDEX,
+ "GL_CURRENT_RASTER_INDEX",
+ "Color index associated with raster position",
+ "current",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_CURRENT_RASTER_TEXTURE_COORDS,
+ "GL_CURRENT_RASTER_TEXTURE_COORDS",
+ "Texture coordinates associated with raster position",
+ "current",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_CURRENT_RASTER_POSITION_VALID,
+ "GL_CURRENT_RASTER_POSITION_VALID",
+ "Raster position valid bit",
+ "current",
+ "glGetBooleanv()"),
+ new GLproperty(GL11.GL_EDGE_FLAG, "GL_EDGE_FLAG", "Edge flag", "current", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY, "GL_VERTEX_ARRAY", "Vertex array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_VERTEX_ARRAY_SIZE,
+ "GL_VERTEX_ARRAY_SIZE",
+ "Coordinates per vertex",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_VERTEX_ARRAY_TYPE,
+ "GL_VERTEX_ARRAY_TYPE",
+ "Type of vertex coordinates",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_VERTEX_ARRAY_STRIDE,
+ "GL_VERTEX_ARRAY_STRIDE",
+ "Stride between vertices",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_VERTEX_ARRAY_POINTER,
+ "GL_VERTEX_ARRAY_POINTER",
+ "Pointer to the vertex array",
+ "vertex-array",
+ "glGetPointerv()"),
+ new GLproperty(GL11.GL_NORMAL_ARRAY, "GL_NORMAL_ARRAY", "Normal array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_NORMAL_ARRAY_TYPE,
+ "GL_NORMAL_ARRAY_TYPE",
+ "Type of normal coordinates",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_NORMAL_ARRAY_STRIDE,
+ "GL_NORMAL_ARRAY_STRIDE",
+ "Stride between normals",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_NORMAL_ARRAY_POINTER,
+ "GL_NORMAL_ARRAY_POINTER",
+ "Pointer to the normal array",
+ "vertex-array",
+ "glGetPointerv()"),
+ new GLproperty(
+ GL11.GL_COLOR_ARRAY, "GL_COLOR_ARRAY", "RGBA color array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_COLOR_ARRAY_SIZE,
+ "GL_COLOR_ARRAY_SIZE",
+ "Colors per vertex",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_COLOR_ARRAY_TYPE,
+ "GL_COLOR_ARRAY_TYPE",
+ "Type of color components",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_COLOR_ARRAY_STRIDE,
+ "GL_COLOR_ARRAY_STRIDE",
+ "Stride between colors",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_COLOR_ARRAY_POINTER,
+ "GL_COLOR_ARRAY_POINTER",
+ "Pointer to the color array",
+ "vertex-array",
+ "glGetPointerv()"),
+ new GLproperty(
+ GL11.GL_INDEX_ARRAY, "GL_INDEX_ARRAY", "Color-index array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_INDEX_ARRAY_TYPE,
+ "GL_INDEX_ARRAY_TYPE",
+ "Type of color indices",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_INDEX_ARRAY_STRIDE,
+ "GL_INDEX_ARRAY_STRIDE",
+ "Stride between color indices",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_INDEX_ARRAY_POINTER,
+ "GL_INDEX_ARRAY_POINTER",
+ "Pointer to the index array",
+ "vertex-array",
+ "glGetPointerv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_COORD_ARRAY,
+ "GL_TEXTURE_COORD_ARRAY",
+ "Texture coordinate array enable",
+ "vertex-array",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_COORD_ARRAY_SIZE,
+ "GL_TEXTURE_COORD_ARRAY_SIZE",
+ "Texture coordinates per element",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_COORD_ARRAY_TYPE,
+ "GL_TEXTURE_COORD_ARRAY_TYPE",
+ "Type of texture coordinates",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_COORD_ARRAY_STRIDE,
+ "GL_TEXTURE_COORD_ARRAY_STRIDE",
+ "Stride between texture coordinates",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_COORD_ARRAY_POINTER,
+ "GL_TEXTURE_COORD_ARRAY_POINTER",
+ "Pointer to the texture coordinate array",
+ "vertex-array",
+ "glGetPointerv()"),
+ new GLproperty(
+ GL11.GL_EDGE_FLAG_ARRAY,
+ "GL_EDGE_FLAG_ARRAY",
+ "Edge flag array enable",
+ "vertex-array",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_EDGE_FLAG_ARRAY_STRIDE,
+ "GL_EDGE_FLAG_ARRAY_STRIDE",
+ "Stride between edge flags",
+ "vertex-array",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_EDGE_FLAG_ARRAY_POINTER,
+ "GL_EDGE_FLAG_ARRAY_POINTER",
+ "Pointer to the edge flag array",
+ "vertex-array",
+ "glGetPointerv()"),
+ new GLproperty(
+ GL11.GL_MODELVIEW_MATRIX, "GL_MODELVIEW_MATRIX", "Modelview matrix stack", "matrix", "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_PROJECTION_MATRIX,
+ "GL_PROJECTION_MATRIX",
+ "Projection matrix stack",
+ "matrix",
+ "glGetFloatv()"),
+ new GLproperty(GL11.GL_TEXTURE_MATRIX, "GL_TEXTURE_MATRIX", "Texture matrix stack", "matrix", "glGetFloatv()"),
+ new GLproperty(GL11.GL_VIEWPORT, "GL_VIEWPORT", "Viewport origin and extent", "viewport", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DEPTH_RANGE, "GL_DEPTH_RANGE", "Depth range near and far", "viewport", "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_MODELVIEW_STACK_DEPTH,
+ "GL_MODELVIEW_STACK_DEPTH",
+ "Modelview matrix stack pointer",
+ "matrix",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_PROJECTION_STACK_DEPTH,
+ "GL_PROJECTION_STACK_DEPTH",
+ "Projection matrix stack pointer",
+ "matrix",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_STACK_DEPTH,
+ "GL_TEXTURE_STACK_DEPTH",
+ "Texture matrix stack pointer",
+ "matrix",
+ "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MATRIX_MODE, "GL_MATRIX_MODE", "Current matrix mode", "transform", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_NORMALIZE,
+ "GL_NORMALIZE",
+ "Current normal normalization on/off",
+ "transform/ enable",
+ "glIsEnabled()"),
+ new GLproperty(GL11.GL_FOG_COLOR, "GL_FOG_COLOR", "Fog color", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_INDEX, "GL_FOG_INDEX", "Fog index", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_DENSITY, "GL_FOG_DENSITY", "Exponential fog density", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_START, "GL_FOG_START", "Linear fog start", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_END, "GL_FOG_END", "Linear fog end", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_MODE, "GL_FOG_MODE", "Fog mode", "fog", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FOG, "GL_FOG", "True if fog enabled", "fog/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_SHADE_MODEL, "GL_SHADE_MODEL", "glShadeModel() setting", "lighting", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_LIGHTING, "GL_LIGHTING", "True if lighting is enabled", "lighting/e nable", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_COLOR_MATERIAL,
+ "GL_COLOR_MATERIAL",
+ "True if color tracking is enabled",
+ "lighting",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_COLOR_MATERIAL_PARAMETER,
+ "GL_COLOR_MATERIAL_PARAMETER",
+ "Material properties tracking current color",
+ "lighting",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_COLOR_MATERIAL_FACE,
+ "GL_COLOR_MATERIAL_FACE",
+ "Face(s) affected by color tracking",
+ "lighting",
+ "glGetIntegerv()"),
+ new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_EMISSION, "GL_EMISSION", "Emissive material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(
+ GL11.GL_SHININESS, "GL_SHININESS", "Specular exponent of material", "lighting", "glGetMaterialfv()"),
+ new GLproperty(
+ GL11.GL_LIGHT_MODEL_AMBIENT,
+ "GL_LIGHT_MODEL_AMBIENT",
+ "Ambient scene color",
+ "lighting",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_LIGHT_MODEL_LOCAL_VIEWER,
+ "GL_LIGHT_MODEL_LOCAL_VIEWER",
+ "Viewer is local",
+ "lighting",
+ "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_LIGHT_MODEL_TWO_SIDE,
+ "GL_LIGHT_MODEL_TWO_SIDE",
+ "Use two-sided lighting",
+ "lighting",
+ "glGetBooleanv()"),
+ new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient intensity of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse intensity of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular intensity of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_POSITION, "GL_POSITION", "Position of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(
+ GL11.GL_CONSTANT_ATTENUATION,
+ "GL_CONSTANT_ATTENUATION",
+ "Constant attenuation factor",
+ "lighting",
+ "glGetLightfv()"),
+ new GLproperty(
+ GL11.GL_LINEAR_ATTENUATION,
+ "GL_LINEAR_ATTENUATION",
+ "Linear attenuation factor",
+ "lighting",
+ "glGetLightfv()"),
+ new GLproperty(
+ GL11.GL_QUADRATIC_ATTENUATION,
+ "GL_QUADRATIC_ATTENUATION",
+ "Quadratic attenuation factor",
+ "lighting",
+ "glGetLightfv()"),
+ new GLproperty(
+ GL11.GL_SPOT_DIRECTION,
+ "GL_SPOT_DIRECTION",
+ "Spotlight direction of light i",
+ "lighting",
+ "glGetLightfv()"),
+ new GLproperty(
+ GL11.GL_SPOT_EXPONENT,
+ "GL_SPOT_EXPONENT",
+ "Spotlight exponent of light i",
+ "lighting",
+ "glGetLightfv()"),
+ new GLproperty(
+ GL11.GL_SPOT_CUTOFF, "GL_SPOT_CUTOFF", "Spotlight angle of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_LIGHT0, "GL_LIGHT0", "True if light 0 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT1, "GL_LIGHT1", "True if light 1 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT2, "GL_LIGHT2", "True if light 2 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT3, "GL_LIGHT3", "True if light 3 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT4, "GL_LIGHT4", "True if light 4 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT5, "GL_LIGHT5", "True if light 5 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT6, "GL_LIGHT6", "True if light 6 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT7, "GL_LIGHT7", "True if light 7 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_COLOR_INDEXES,
+ "GL_COLOR_INDEXES",
+ "ca, cd, and cs for color-index lighting",
+ "lighting/e nable",
+ "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_POINT_SIZE, "GL_POINT_SIZE", "Point size", "point", "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_POINT_SMOOTH, "GL_POINT_SMOOTH", "Point antialiasing on", "point/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LINE_WIDTH, "GL_LINE_WIDTH", "Line width", "line", "glGetFloatv()"),
+ new GLproperty(GL11.GL_LINE_SMOOTH, "GL_LINE_SMOOTH", "Line antialiasing on", "line/enable", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_LINE_STIPPLE_PATTERN, "GL_LINE_STIPPLE_PATTERN", "Line stipple", "line", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_LINE_STIPPLE_REPEAT,
+ "GL_LINE_STIPPLE_REPEAT",
+ "Line stipple repeat",
+ "line",
+ "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LINE_STIPPLE, "GL_LINE_STIPPLE", "Line stipple enable", "line/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_CULL_FACE, "GL_CULL_FACE", "Polygon culling enabled", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_CULL_FACE_MODE,
+ "GL_CULL_FACE_MODE",
+ "Cull front-/back-facing polygons",
+ "polygon",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_FRONT_FACE,
+ "GL_FRONT_FACE",
+ "Polygon front-face CW/CCW indicator",
+ "polygon",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_POLYGON_SMOOTH,
+ "GL_POLYGON_SMOOTH",
+ "Polygon antialiasing on",
+ "polygon/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_POLYGON_MODE,
+ "GL_POLYGON_MODE",
+ "Polygon rasterization mode (front and back)",
+ "polygon",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_POLYGON_OFFSET_FACTOR,
+ "GL_POLYGON_OFFSET_FACTOR",
+ "Polygon offset factor",
+ "polygon",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_POLYGON_OFFSET_POINT,
+ "GL_POLYGON_OFFSET_POINT",
+ "Polygon offset enable for GL_POINT mode rasterization",
+ "polygon/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_POLYGON_OFFSET_LINE,
+ "GL_POLYGON_OFFSET_LINE",
+ "Polygon offset enable for GL_LINE mode rasterization",
+ "polygon/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_POLYGON_OFFSET_FILL,
+ "GL_POLYGON_OFFSET_FILL",
+ "Polygon offset enable for GL_FILL mode rasterization",
+ "polygon/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_POLYGON_STIPPLE,
+ "GL_POLYGON_STIPPLE",
+ "Polygon stipple enable",
+ "polygon/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_1D,
+ "GL_TEXTURE_1D",
+ "True if 1-D texturing enabled ",
+ "texture/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_2D,
+ "GL_TEXTURE_2D",
+ "True if 2-D texturing enabled ",
+ "texture/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_BINDING_1D,
+ "GL_TEXTURE_BINDING_1D",
+ "Texture object bound to GL_TEXTURE_1D",
+ "texture",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_BINDING_2D,
+ "GL_TEXTURE_BINDING_2D",
+ "Texture object bound to GL_TEXTURE_2D",
+ "texture",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE, "GL_TEXTURE", "x-D texture image at level of detail i", "UNUSED", "glGetTexImage()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_WIDTH,
+ "GL_TEXTURE_WIDTH",
+ "x-D texture image i's width",
+ "UNUSED",
+ "glGetTexLevelParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_HEIGHT,
+ "GL_TEXTURE_HEIGHT",
+ "x-D texture image i's height",
+ "UNUSED",
+ "glGetTexLevelParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_BORDER,
+ "GL_TEXTURE_BORDER",
+ "x-D texture image i's border width",
+ "UNUSED",
+ "glGetTexLevelParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_RED_SIZE,
+ "GL_TEXTURE_RED_SIZE",
+ "x-D texture image i's red resolution",
+ "UNUSED",
+ "glGetTexLevelParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_GREEN_SIZE,
+ "GL_TEXTURE_GREEN_SIZE",
+ "x-D texture image i's green resolution",
+ "UNUSED",
+ "glGetTexLevelParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_BLUE_SIZE,
+ "GL_TEXTURE_BLUE_SIZE",
+ "x-D texture image i's blue resolution",
+ "UNUSED",
+ "glGetTexLevelParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_ALPHA_SIZE,
+ "GL_TEXTURE_ALPHA_SIZE",
+ "x-D texture image i's alpha resolution",
+ "UNUSED",
+ "glGetTexLevelParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_LUMINANCE_SIZE,
+ "GL_TEXTURE_LUMINANCE_SIZE",
+ "x-D texture image i's luminance resolution",
+ "UNUSED",
+ "glGetTexLevelParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_INTENSITY_SIZE,
+ "GL_TEXTURE_INTENSITY_SIZE",
+ "x-D texture image i's intensity resolution",
+ "UNUSED",
+ "glGetTexLevelParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_BORDER_COLOR,
+ "GL_TEXTURE_BORDER_COLOR",
+ "Texture border color",
+ "texture",
+ "glGetTexParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_MIN_FILTER,
+ "GL_TEXTURE_MIN_FILTER",
+ "Texture minification function",
+ "texture",
+ "glGetTexParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_MAG_FILTER,
+ "GL_TEXTURE_MAG_FILTER",
+ "Texture magnification function",
+ "texture",
+ "glGetTexParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_WRAP_S,
+ "GL_TEXTURE_WRAP_S",
+ "Texture wrap mode (x is S or T)",
+ "texture",
+ "glGetTexParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_WRAP_T,
+ "GL_TEXTURE_WRAP_T",
+ "Texture wrap mode (x is S or T)",
+ "texture",
+ "glGetTexParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_PRIORITY,
+ "GL_TEXTURE_PRIORITY",
+ "Texture object priority",
+ "texture",
+ "glGetTexParameter*()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_ENV_MODE,
+ "GL_TEXTURE_ENV_MODE",
+ "Texture application function",
+ "texture",
+ "glGetTexEnviv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_ENV_COLOR,
+ "GL_TEXTURE_ENV_COLOR",
+ "Texture environment color",
+ "texture",
+ "glGetTexEnvfv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_GEN_S,
+ "GL_TEXTURE_GEN_S",
+ "Texgen enabled (x is S, T, R, or Q)",
+ "texture/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_GEN_T,
+ "GL_TEXTURE_GEN_T",
+ "Texgen enabled (x is S, T, R, or Q)",
+ "texture/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_GEN_R,
+ "GL_TEXTURE_GEN_R",
+ "Texgen enabled (x is S, T, R, or Q)",
+ "texture/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_GEN_Q,
+ "GL_TEXTURE_GEN_Q",
+ "Texgen enabled (x is S, T, R, or Q)",
+ "texture/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_EYE_PLANE, "GL_EYE_PLANE", "Texgen plane equation coefficients", "texture", "glGetTexGenfv()"),
+ new GLproperty(
+ GL11.GL_OBJECT_PLANE,
+ "GL_OBJECT_PLANE",
+ "Texgen object linear coefficients",
+ "texture",
+ "glGetTexGenfv()"),
+ new GLproperty(
+ GL11.GL_TEXTURE_GEN_MODE,
+ "GL_TEXTURE_GEN_MODE",
+ "Function used for texgen",
+ "texture",
+ "glGetTexGeniv()"),
+ new GLproperty(
+ GL11.GL_SCISSOR_TEST, "GL_SCISSOR_TEST", "Scissoring enabled", "scissor/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_SCISSOR_BOX, "GL_SCISSOR_BOX", "Scissor box", "scissor", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_ALPHA_TEST, "GL_ALPHA_TEST", "Alpha test enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_ALPHA_TEST_FUNC,
+ "GL_ALPHA_TEST_FUNC",
+ "Alpha test function",
+ "color-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_ALPHA_TEST_REF,
+ "GL_ALPHA_TEST_REF",
+ "Alpha test reference value",
+ "color-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_STENCIL_TEST,
+ "GL_STENCIL_TEST",
+ "Stenciling enabled",
+ "stencil-buffer/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_STENCIL_FUNC, "GL_STENCIL_FUNC", "Stencil function", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_STENCIL_VALUE_MASK,
+ "GL_STENCIL_VALUE_MASK",
+ "Stencil mask",
+ "stencil-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_STENCIL_REF, "GL_STENCIL_REF", "Stencil reference value", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_STENCIL_FAIL, "GL_STENCIL_FAIL", "Stencil fail action", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_STENCIL_PASS_DEPTH_FAIL,
+ "GL_STENCIL_PASS_DEPTH_FAIL",
+ "Stencil depth buffer fail action",
+ "stencil-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_STENCIL_PASS_DEPTH_PASS,
+ "GL_STENCIL_PASS_DEPTH_PASS",
+ "Stencil depth buffer pass action",
+ "stencil-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_DEPTH_TEST, "GL_DEPTH_TEST", "Depth buffer enabled", "depth-buffer/ena ble", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_DEPTH_FUNC, "GL_DEPTH_FUNC", "Depth buffer test function", "depth-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_BLEND, "GL_BLEND", "Blending enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_BLEND_SRC, "GL_BLEND_SRC", "Blending source function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_BLEND_DST, "GL_BLEND_DST", "Blending destination function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DITHER, "GL_DITHER", "Dithering enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_INDEX_LOGIC_OP,
+ "GL_INDEX_LOGIC_OP",
+ "Color index logical operation enabled",
+ "color-buffer/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_COLOR_LOGIC_OP,
+ "GL_COLOR_LOGIC_OP",
+ "RGBA color logical operation enabled",
+ "color-buffer/enable",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_LOGIC_OP_MODE,
+ "GL_LOGIC_OP_MODE",
+ "Logical operation function",
+ "color-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_DRAW_BUFFER,
+ "GL_DRAW_BUFFER",
+ "Buffers selected for drawing",
+ "color-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_INDEX_WRITEMASK,
+ "GL_INDEX_WRITEMASK",
+ "Color-index writemask",
+ "color-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_COLOR_WRITEMASK,
+ "GL_COLOR_WRITEMASK",
+ "Color write enables; R, G, B, or A",
+ "color-buffer",
+ "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_DEPTH_WRITEMASK,
+ "GL_DEPTH_WRITEMASK",
+ "Depth buffer enabled for writing",
+ "depth-buffer",
+ "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_STENCIL_WRITEMASK,
+ "GL_STENCIL_WRITEMASK",
+ "Stencil-buffer writemask",
+ "stencil-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_COLOR_CLEAR_VALUE,
+ "GL_COLOR_CLEAR_VALUE",
+ "Color-buffer clear value (RGBA mode)",
+ "color-buffer",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_INDEX_CLEAR_VALUE,
+ "GL_INDEX_CLEAR_VALUE",
+ "Color-buffer clear value (color-index mode)",
+ "color-buffer",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_DEPTH_CLEAR_VALUE,
+ "GL_DEPTH_CLEAR_VALUE",
+ "Depth-buffer clear value",
+ "depth-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_STENCIL_CLEAR_VALUE,
+ "GL_STENCIL_CLEAR_VALUE",
+ "Stencil-buffer clear value",
+ "stencil-buffer",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_ACCUM_CLEAR_VALUE,
+ "GL_ACCUM_CLEAR_VALUE",
+ "Accumulation-buffer clear value",
+ "accum-buffer",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_UNPACK_SWAP_BYTES,
+ "GL_UNPACK_SWAP_BYTES",
+ "Value of GL_UNPACK_SWAP_BYTES",
+ "pixel-store",
+ "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_UNPACK_LSB_FIRST,
+ "GL_UNPACK_LSB_FIRST",
+ "Value of GL_UNPACK_LSB_FIRST",
+ "pixel-store",
+ "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_UNPACK_ROW_LENGTH,
+ "GL_UNPACK_ROW_LENGTH",
+ "Value of GL_UNPACK_ROW_LENGTH",
+ "pixel-store",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_UNPACK_SKIP_ROWS,
+ "GL_UNPACK_SKIP_ROWS",
+ "Value of GL_UNPACK_SKIP_ROWS",
+ "pixel-store",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_UNPACK_SKIP_PIXELS,
+ "GL_UNPACK_SKIP_PIXELS",
+ "Value of GL_UNPACK_SKIP_PIXELS",
+ "pixel-store",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_UNPACK_ALIGNMENT,
+ "GL_UNPACK_ALIGNMENT",
+ "Value of GL_UNPACK_ALIGNMENT",
+ "pixel-store",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_PACK_SWAP_BYTES,
+ "GL_PACK_SWAP_BYTES",
+ "Value of GL_PACK_SWAP_BYTES",
+ "pixel-store",
+ "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_PACK_LSB_FIRST,
+ "GL_PACK_LSB_FIRST",
+ "Value of GL_PACK_LSB_FIRST",
+ "pixel-store",
+ "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_PACK_ROW_LENGTH,
+ "GL_PACK_ROW_LENGTH",
+ "Value of GL_PACK_ROW_LENGTH",
+ "pixel-store",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_PACK_SKIP_ROWS,
+ "GL_PACK_SKIP_ROWS",
+ "Value of GL_PACK_SKIP_ROWS",
+ "pixel-store",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_PACK_SKIP_PIXELS,
+ "GL_PACK_SKIP_PIXELS",
+ "Value of GL_PACK_SKIP_PIXELS",
+ "pixel-store",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_PACK_ALIGNMENT,
+ "GL_PACK_ALIGNMENT",
+ "Value of GL_PACK_ALIGNMENT",
+ "pixel-store",
+ "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAP_COLOR, "GL_MAP_COLOR", "True if colors are mapped", "pixel", "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_MAP_STENCIL, "GL_MAP_STENCIL", "True if stencil values are mapped", "pixel", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_INDEX_SHIFT, "GL_INDEX_SHIFT", "Value of GL_INDEX_SHIFT", "pixel", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_OFFSET, "GL_INDEX_OFFSET", "Value of GL_INDEX_OFFSET", "pixel", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ZOOM_X, "GL_ZOOM_X", "x zoom factor", "pixel", "glGetFloatv()"),
+ new GLproperty(GL11.GL_ZOOM_Y, "GL_ZOOM_Y", "y zoom factor", "pixel", "glGetFloatv()"),
+ new GLproperty(GL11.GL_READ_BUFFER, "GL_READ_BUFFER", "Read source buffer", "pixel", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ORDER, "GL_ORDER", "1D map order", "capability", "glGetMapiv()"),
+ new GLproperty(GL11.GL_ORDER, "GL_ORDER", "2D map orders", "capability", "glGetMapiv()"),
+ new GLproperty(GL11.GL_COEFF, "GL_COEFF", "1D control points", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_COEFF, "GL_COEFF", "2D control points", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "1D domain endpoints", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "2D domain endpoints", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_MAP1_GRID_DOMAIN, "GL_MAP1_GRID_DOMAIN", "1D grid endpoints", "eval", "glGetFloatv()"),
+ new GLproperty(GL11.GL_MAP2_GRID_DOMAIN, "GL_MAP2_GRID_DOMAIN", "2D grid endpoints", "eval", "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_MAP1_GRID_SEGMENTS, "GL_MAP1_GRID_SEGMENTS", "1D grid divisions", "eval", "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_MAP2_GRID_SEGMENTS, "GL_MAP2_GRID_SEGMENTS", "2D grid divisions", "eval", "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_AUTO_NORMAL,
+ "GL_AUTO_NORMAL",
+ "True if automatic normal generation enabled",
+ "eval",
+ "glIsEnabled()"),
+ new GLproperty(
+ GL11.GL_PERSPECTIVE_CORRECTION_HINT,
+ "GL_PERSPECTIVE_CORRECTION_HINT",
+ "Perspective correction hint",
+ "hint",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_POINT_SMOOTH_HINT, "GL_POINT_SMOOTH_HINT", "Point smooth hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LINE_SMOOTH_HINT, "GL_LINE_SMOOTH_HINT", "Line smooth hint", "hint", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_POLYGON_SMOOTH_HINT,
+ "GL_POLYGON_SMOOTH_HINT",
+ "Polygon smooth hint",
+ "hint",
+ "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FOG_HINT, "GL_FOG_HINT", "Fog hint", "hint", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_LIGHTS, "GL_MAX_LIGHTS", "Maximum number of lights", "capability", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_CLIP_PLANES,
+ "GL_MAX_CLIP_PLANES",
+ "Maximum number of user clipping planes",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_MODELVIEW_STACK_DEPTH,
+ "GL_MAX_MODELVIEW_STACK_DEPTH",
+ "Maximum modelview-matrix stack depth",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_PROJECTION_STACK_DEPTH,
+ "GL_MAX_PROJECTION_STACK_DEPTH",
+ "Maximum projection-matrix stack depth",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_TEXTURE_STACK_DEPTH,
+ "GL_MAX_TEXTURE_STACK_DEPTH",
+ "Maximum depth of texture matrix stack",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_SUBPIXEL_BITS,
+ "GL_SUBPIXEL_BITS",
+ "Number of bits of subpixel precision in x and y",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_TEXTURE_SIZE,
+ "GL_MAX_TEXTURE_SIZE",
+ "See discussion in Texture Proxy in Chapter 9",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_PIXEL_MAP_TABLE,
+ "GL_MAX_PIXEL_MAP_TABLE",
+ "Maximum size of a glPixelMap() translation table",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_NAME_STACK_DEPTH,
+ "GL_MAX_NAME_STACK_DEPTH",
+ "Maximum selection-name stack depth",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_LIST_NESTING,
+ "GL_MAX_LIST_NESTING",
+ "Maximum display-list call nesting",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_EVAL_ORDER,
+ "GL_MAX_EVAL_ORDER",
+ "Maximum evaluator polynomial order",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_VIEWPORT_DIMS,
+ "GL_MAX_VIEWPORT_DIMS",
+ "Maximum viewport dimensions",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_ATTRIB_STACK_DEPTH,
+ "GL_MAX_ATTRIB_STACK_DEPTH",
+ "Maximum depth of the attribute stack",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_MAX_CLIENT_ATTRIB_STACK_DEPTH,
+ "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH",
+ "Maximum depth of the client attribute stack",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_AUX_BUFFERS, "GL_AUX_BUFFERS", "Number of auxiliary buffers", "capability", "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_RGBA_MODE, "GL_RGBA_MODE", "True if color buffers store RGBA", "capability", "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_INDEX_MODE,
+ "GL_INDEX_MODE",
+ "True if color buffers store indices",
+ "capability",
+ "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_DOUBLEBUFFER,
+ "GL_DOUBLEBUFFER",
+ "True if front and back buffers exist",
+ "capability",
+ "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_STEREO, "GL_STEREO", "True if left and right buffers exist", "capability", "glGetBooleanv()"),
+ new GLproperty(
+ GL11.GL_POINT_SIZE_RANGE,
+ "GL_POINT_SIZE_RANGE",
+ "Range (low to high) of antialiased point sizes",
+ "capability",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_POINT_SIZE_GRANULARITY,
+ "GL_POINT_SIZE_GRANULARITY",
+ "Antialiased point-size granularity",
+ "capability",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_LINE_WIDTH_RANGE,
+ "GL_LINE_WIDTH_RANGE",
+ "Range (low to high) of antialiased line widths",
+ "capability",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_LINE_WIDTH_GRANULARITY,
+ "GL_LINE_WIDTH_GRANULARITY",
+ "Antialiased line-width granularity",
+ "capability",
+ "glGetFloatv()"),
+ new GLproperty(
+ GL11.GL_RED_BITS,
+ "GL_RED_BITS",
+ "Number of bits per red component in color buffers",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_GREEN_BITS,
+ "GL_GREEN_BITS",
+ "Number of bits per green component in color buffers",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_BLUE_BITS,
+ "GL_BLUE_BITS",
+ "Number of bits per blue component in color buffers",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_ALPHA_BITS,
+ "GL_ALPHA_BITS",
+ "Number of bits per alpha component in color buffers",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_INDEX_BITS,
+ "GL_INDEX_BITS",
+ "Number of bits per index in color buffers",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_DEPTH_BITS,
+ "GL_DEPTH_BITS",
+ "Number of depth-buffer bitplanes",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_STENCIL_BITS,
+ "GL_STENCIL_BITS",
+ "Number of stencil bitplanes",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_ACCUM_RED_BITS,
+ "GL_ACCUM_RED_BITS",
+ "Number of bits per red component in the accumulation buffer",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_ACCUM_GREEN_BITS,
+ "GL_ACCUM_GREEN_BITS",
+ "Number of bits per green component in the accumulation buffer",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_ACCUM_BLUE_BITS,
+ "GL_ACCUM_BLUE_BITS",
+ "Number of bits per blue component in the accumulation buffer",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_ACCUM_ALPHA_BITS,
+ "GL_ACCUM_ALPHA_BITS",
+ "Number of bits per alpha component in the accumulation buffer",
+ "capability",
+ "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LIST_BASE, "GL_LIST_BASE", "Setting of glListBase()", "list", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_LIST_INDEX,
+ "GL_LIST_INDEX",
+ "Number of display list under construction; 0 if none",
+ "current",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_LIST_MODE,
+ "GL_LIST_MODE",
+ "Mode of display list under construction; undefined if none",
+ "current",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_ATTRIB_STACK_DEPTH,
+ "GL_ATTRIB_STACK_DEPTH",
+ "Attribute stack pointer",
+ "current",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_CLIENT_ATTRIB_STACK_DEPTH,
+ "GL_CLIENT_ATTRIB_STACK_DEPTH",
+ "Client attribute stack pointer",
+ "current",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_NAME_STACK_DEPTH, "GL_NAME_STACK_DEPTH", "Name stack depth", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_RENDER_MODE, "GL_RENDER_MODE", "glRenderMode() setting", "current", "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_SELECTION_BUFFER_POINTER,
+ "GL_SELECTION_BUFFER_POINTER",
+ "Pointer to selection buffer",
+ "select",
+ "glGetPointerv()"),
+ new GLproperty(
+ GL11.GL_SELECTION_BUFFER_SIZE,
+ "GL_SELECTION_BUFFER_SIZE",
+ "Size of selection buffer",
+ "select",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_FEEDBACK_BUFFER_POINTER,
+ "GL_FEEDBACK_BUFFER_POINTER",
+ "Pointer to feedback buffer",
+ "feedback",
+ "glGetPointerv()"),
+ new GLproperty(
+ GL11.GL_FEEDBACK_BUFFER_SIZE,
+ "GL_FEEDBACK_BUFFER_SIZE",
+ "Size of feedback buffer",
+ "feedback",
+ "glGetIntegerv()"),
+ new GLproperty(
+ GL11.GL_FEEDBACK_BUFFER_TYPE,
+ "GL_FEEDBACK_BUFFER_TYPE",
+ "Type of feedback buffer",
+ "feedback",
+ "glGetIntegerv()"),
+ };
- {
- new GLproperty(GL11.GL_CURRENT_COLOR, "GL_CURRENT_COLOR", "Current color", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_INDEX, "GL_CURRENT_INDEX", "Current color index", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_TEXTURE_COORDS, "GL_CURRENT_TEXTURE_COORDS", "Current texture coordinates", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_NORMAL, "GL_CURRENT_NORMAL", "Current normal", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_POSITION, "GL_CURRENT_RASTER_POSITION", "Current raster position", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_DISTANCE, "GL_CURRENT_RASTER_DISTANCE", "Current raster distance", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_COLOR, "GL_CURRENT_RASTER_COLOR", "Color associated with raster position", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_INDEX, "GL_CURRENT_RASTER_INDEX", "Color index associated with raster position", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_TEXTURE_COORDS, "GL_CURRENT_RASTER_TEXTURE_COORDS", "Texture coordinates associated with raster position", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_POSITION_VALID, "GL_CURRENT_RASTER_POSITION_VALID", "Raster position valid bit", "current", "glGetBooleanv()"),
- new GLproperty(GL11.GL_EDGE_FLAG, "GL_EDGE_FLAG", "Edge flag", "current", "glGetBooleanv()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY, "GL_VERTEX_ARRAY", "Vertex array enable", "vertex-array", "glIsEnabled()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY_SIZE, "GL_VERTEX_ARRAY_SIZE", "Coordinates per vertex", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY_TYPE, "GL_VERTEX_ARRAY_TYPE", "Type of vertex coordinates", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY_STRIDE, "GL_VERTEX_ARRAY_STRIDE", "Stride between vertices", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY_POINTER, "GL_VERTEX_ARRAY_POINTER", "Pointer to the vertex array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_NORMAL_ARRAY, "GL_NORMAL_ARRAY", "Normal array enable", "vertex-array", "glIsEnabled()"),
- new GLproperty(GL11.GL_NORMAL_ARRAY_TYPE, "GL_NORMAL_ARRAY_TYPE", "Type of normal coordinates", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_NORMAL_ARRAY_STRIDE, "GL_NORMAL_ARRAY_STRIDE", "Stride between normals", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_NORMAL_ARRAY_POINTER, "GL_NORMAL_ARRAY_POINTER", "Pointer to the normal array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_COLOR_ARRAY, "GL_COLOR_ARRAY", "RGBA color array enable", "vertex-array", "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_ARRAY_SIZE, "GL_COLOR_ARRAY_SIZE", "Colors per vertex", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_ARRAY_TYPE, "GL_COLOR_ARRAY_TYPE", "Type of color components", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_ARRAY_STRIDE, "GL_COLOR_ARRAY_STRIDE", "Stride between colors", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_ARRAY_POINTER, "GL_COLOR_ARRAY_POINTER", "Pointer to the color array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_INDEX_ARRAY, "GL_INDEX_ARRAY", "Color-index array enable", "vertex-array", "glIsEnabled()"),
- new GLproperty(GL11.GL_INDEX_ARRAY_TYPE, "GL_INDEX_ARRAY_TYPE", "Type of color indices", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_ARRAY_STRIDE, "GL_INDEX_ARRAY_STRIDE", "Stride between color indices", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_ARRAY_POINTER, "GL_INDEX_ARRAY_POINTER", "Pointer to the index array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY, "GL_TEXTURE_COORD_ARRAY", "Texture coordinate array enable", "vertex-array", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_SIZE, "GL_TEXTURE_COORD_ARRAY_SIZE", "Texture coordinates per element", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_TYPE, "GL_TEXTURE_COORD_ARRAY_TYPE", "Type of texture coordinates", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_STRIDE, "GL_TEXTURE_COORD_ARRAY_STRIDE", "Stride between texture coordinates", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_POINTER, "GL_TEXTURE_COORD_ARRAY_POINTER", "Pointer to the texture coordinate array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_EDGE_FLAG_ARRAY, "GL_EDGE_FLAG_ARRAY", "Edge flag array enable", "vertex-array", "glIsEnabled()"),
- new GLproperty(GL11.GL_EDGE_FLAG_ARRAY_STRIDE, "GL_EDGE_FLAG_ARRAY_STRIDE", "Stride between edge flags", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_EDGE_FLAG_ARRAY_POINTER, "GL_EDGE_FLAG_ARRAY_POINTER", "Pointer to the edge flag array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_MODELVIEW_MATRIX, "GL_MODELVIEW_MATRIX", "Modelview matrix stack", "matrix", "glGetFloatv()"),
- new GLproperty(GL11.GL_PROJECTION_MATRIX, "GL_PROJECTION_MATRIX", "Projection matrix stack", "matrix", "glGetFloatv()"),
- new GLproperty(GL11.GL_TEXTURE_MATRIX, "GL_TEXTURE_MATRIX", "Texture matrix stack", "matrix", "glGetFloatv()"),
- new GLproperty(GL11.GL_VIEWPORT, "GL_VIEWPORT", "Viewport origin and extent", "viewport", "glGetIntegerv()"),
- new GLproperty(GL11.GL_DEPTH_RANGE, "GL_DEPTH_RANGE", "Depth range near and far", "viewport", "glGetFloatv()"),
- new GLproperty(GL11.GL_MODELVIEW_STACK_DEPTH, "GL_MODELVIEW_STACK_DEPTH", "Modelview matrix stack pointer", "matrix", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PROJECTION_STACK_DEPTH, "GL_PROJECTION_STACK_DEPTH", "Projection matrix stack pointer", "matrix", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_STACK_DEPTH, "GL_TEXTURE_STACK_DEPTH", "Texture matrix stack pointer", "matrix", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MATRIX_MODE, "GL_MATRIX_MODE", "Current matrix mode", "transform", "glGetIntegerv()"),
- new GLproperty(GL11.GL_NORMALIZE, "GL_NORMALIZE", "Current normal normalization on/off", "transform/ enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_FOG_COLOR, "GL_FOG_COLOR", "Fog color", "fog", "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_INDEX, "GL_FOG_INDEX", "Fog index", "fog", "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_DENSITY, "GL_FOG_DENSITY", "Exponential fog density", "fog", "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_START, "GL_FOG_START", "Linear fog start", "fog", "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_END, "GL_FOG_END", "Linear fog end", "fog", "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_MODE, "GL_FOG_MODE", "Fog mode", "fog", "glGetIntegerv()"),
- new GLproperty(GL11.GL_FOG, "GL_FOG", "True if fog enabled", "fog/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_SHADE_MODEL, "GL_SHADE_MODEL", "glShadeModel() setting", "lighting", "glGetIntegerv()"),
- new GLproperty(GL11.GL_LIGHTING, "GL_LIGHTING", "True if lighting is enabled", "lighting/e nable", "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_MATERIAL, "GL_COLOR_MATERIAL", "True if color tracking is enabled", "lighting", "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_MATERIAL_PARAMETER, "GL_COLOR_MATERIAL_PARAMETER", "Material properties tracking current color", "lighting", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_MATERIAL_FACE, "GL_COLOR_MATERIAL_FACE", "Face(s) affected by color tracking", "lighting", "glGetIntegerv()"),
- new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient material color", "lighting", "glGetMaterialfv()"),
- new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse material color", "lighting", "glGetMaterialfv()"),
- new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular material color", "lighting", "glGetMaterialfv()"),
- new GLproperty(GL11.GL_EMISSION, "GL_EMISSION", "Emissive material color", "lighting", "glGetMaterialfv()"),
- new GLproperty(GL11.GL_SHININESS, "GL_SHININESS", "Specular exponent of material", "lighting", "glGetMaterialfv()"),
- new GLproperty(GL11.GL_LIGHT_MODEL_AMBIENT, "GL_LIGHT_MODEL_AMBIENT", "Ambient scene color", "lighting", "glGetFloatv()"),
- new GLproperty(GL11.GL_LIGHT_MODEL_LOCAL_VIEWER, "GL_LIGHT_MODEL_LOCAL_VIEWER", "Viewer is local", "lighting", "glGetBooleanv()"),
- new GLproperty(GL11.GL_LIGHT_MODEL_TWO_SIDE, "GL_LIGHT_MODEL_TWO_SIDE", "Use two-sided lighting", "lighting", "glGetBooleanv()"),
- new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient intensity of light i", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse intensity of light i", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular intensity of light i", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_POSITION, "GL_POSITION", "Position of light i", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_CONSTANT_ATTENUATION, "GL_CONSTANT_ATTENUATION", "Constant attenuation factor", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_LINEAR_ATTENUATION, "GL_LINEAR_ATTENUATION", "Linear attenuation factor", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_QUADRATIC_ATTENUATION, "GL_QUADRATIC_ATTENUATION", "Quadratic attenuation factor", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_SPOT_DIRECTION, "GL_SPOT_DIRECTION", "Spotlight direction of light i", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_SPOT_EXPONENT, "GL_SPOT_EXPONENT", "Spotlight exponent of light i", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_SPOT_CUTOFF, "GL_SPOT_CUTOFF", "Spotlight angle of light i", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_LIGHT0, "GL_LIGHT0", "True if light 0 enabled", "lighting/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT1, "GL_LIGHT1", "True if light 1 enabled", "lighting/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT2, "GL_LIGHT2", "True if light 2 enabled", "lighting/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT3, "GL_LIGHT3", "True if light 3 enabled", "lighting/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT4, "GL_LIGHT4", "True if light 4 enabled", "lighting/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT5, "GL_LIGHT5", "True if light 5 enabled", "lighting/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT6, "GL_LIGHT6", "True if light 6 enabled", "lighting/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT7, "GL_LIGHT7", "True if light 7 enabled", "lighting/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_INDEXES, "GL_COLOR_INDEXES", "ca, cd, and cs for color-index lighting", "lighting/e nable", "glGetMaterialfv()"),
- new GLproperty(GL11.GL_POINT_SIZE, "GL_POINT_SIZE", "Point size", "point", "glGetFloatv()"),
- new GLproperty(GL11.GL_POINT_SMOOTH, "GL_POINT_SMOOTH", "Point antialiasing on", "point/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LINE_WIDTH, "GL_LINE_WIDTH", "Line width", "line", "glGetFloatv()"),
- new GLproperty(GL11.GL_LINE_SMOOTH, "GL_LINE_SMOOTH", "Line antialiasing on", "line/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LINE_STIPPLE_PATTERN, "GL_LINE_STIPPLE_PATTERN", "Line stipple", "line", "glGetIntegerv()"),
- new GLproperty(GL11.GL_LINE_STIPPLE_REPEAT, "GL_LINE_STIPPLE_REPEAT", "Line stipple repeat", "line", "glGetIntegerv()"),
- new GLproperty(GL11.GL_LINE_STIPPLE, "GL_LINE_STIPPLE", "Line stipple enable", "line/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_CULL_FACE, "GL_CULL_FACE", "Polygon culling enabled", "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_CULL_FACE_MODE, "GL_CULL_FACE_MODE", "Cull front-/back-facing polygons", "polygon", "glGetIntegerv()"),
- new GLproperty(GL11.GL_FRONT_FACE, "GL_FRONT_FACE", "Polygon front-face CW/CCW indicator", "polygon", "glGetIntegerv()"),
- new GLproperty(GL11.GL_POLYGON_SMOOTH, "GL_POLYGON_SMOOTH", "Polygon antialiasing on", "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_POLYGON_MODE, "GL_POLYGON_MODE", "Polygon rasterization mode (front and back)", "polygon", "glGetIntegerv()"),
- new GLproperty(GL11.GL_POLYGON_OFFSET_FACTOR, "GL_POLYGON_OFFSET_FACTOR", "Polygon offset factor", "polygon", "glGetFloatv()"),
- new GLproperty(GL11.GL_POLYGON_OFFSET_POINT, "GL_POLYGON_OFFSET_POINT", "Polygon offset enable for GL_POINT mode rasterization", "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_POLYGON_OFFSET_LINE, "GL_POLYGON_OFFSET_LINE", "Polygon offset enable for GL_LINE mode rasterization", "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_POLYGON_OFFSET_FILL, "GL_POLYGON_OFFSET_FILL", "Polygon offset enable for GL_FILL mode rasterization", "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_POLYGON_STIPPLE, "GL_POLYGON_STIPPLE", "Polygon stipple enable", "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_1D, "GL_TEXTURE_1D", "True if 1-D texturing enabled ", "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_2D, "GL_TEXTURE_2D", "True if 2-D texturing enabled ", "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_BINDING_1D, "GL_TEXTURE_BINDING_1D", "Texture object bound to GL_TEXTURE_1D", "texture", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_BINDING_2D, "GL_TEXTURE_BINDING_2D", "Texture object bound to GL_TEXTURE_2D", "texture", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE, "GL_TEXTURE", "x-D texture image at level of detail i", "UNUSED", "glGetTexImage()"),
- new GLproperty(GL11.GL_TEXTURE_WIDTH, "GL_TEXTURE_WIDTH", "x-D texture image i's width", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_HEIGHT, "GL_TEXTURE_HEIGHT", "x-D texture image i's height", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_BORDER, "GL_TEXTURE_BORDER", "x-D texture image i's border width", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_RED_SIZE, "GL_TEXTURE_RED_SIZE", "x-D texture image i's red resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_GREEN_SIZE, "GL_TEXTURE_GREEN_SIZE", "x-D texture image i's green resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_BLUE_SIZE, "GL_TEXTURE_BLUE_SIZE", "x-D texture image i's blue resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_ALPHA_SIZE, "GL_TEXTURE_ALPHA_SIZE", "x-D texture image i's alpha resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_LUMINANCE_SIZE, "GL_TEXTURE_LUMINANCE_SIZE", "x-D texture image i's luminance resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_INTENSITY_SIZE, "GL_TEXTURE_INTENSITY_SIZE", "x-D texture image i's intensity resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_BORDER_COLOR, "GL_TEXTURE_BORDER_COLOR", "Texture border color", "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_MIN_FILTER, "GL_TEXTURE_MIN_FILTER", "Texture minification function", "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_MAG_FILTER, "GL_TEXTURE_MAG_FILTER", "Texture magnification function", "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_WRAP_S, "GL_TEXTURE_WRAP_S", "Texture wrap mode (x is S or T)", "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_WRAP_T, "GL_TEXTURE_WRAP_T", "Texture wrap mode (x is S or T)", "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_PRIORITY, "GL_TEXTURE_PRIORITY", "Texture object priority", "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_ENV_MODE, "GL_TEXTURE_ENV_MODE", "Texture application function", "texture", "glGetTexEnviv()"),
- new GLproperty(GL11.GL_TEXTURE_ENV_COLOR, "GL_TEXTURE_ENV_COLOR", "Texture environment color", "texture", "glGetTexEnvfv()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_S, "GL_TEXTURE_GEN_S", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_T, "GL_TEXTURE_GEN_T", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_R, "GL_TEXTURE_GEN_R", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_Q, "GL_TEXTURE_GEN_Q", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_EYE_PLANE, "GL_EYE_PLANE", "Texgen plane equation coefficients", "texture", "glGetTexGenfv()"),
- new GLproperty(GL11.GL_OBJECT_PLANE, "GL_OBJECT_PLANE", "Texgen object linear coefficients", "texture", "glGetTexGenfv()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_MODE, "GL_TEXTURE_GEN_MODE", "Function used for texgen", "texture", "glGetTexGeniv()"),
- new GLproperty(GL11.GL_SCISSOR_TEST, "GL_SCISSOR_TEST", "Scissoring enabled", "scissor/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_SCISSOR_BOX, "GL_SCISSOR_BOX", "Scissor box", "scissor", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ALPHA_TEST, "GL_ALPHA_TEST", "Alpha test enabled", "color-buffer/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_ALPHA_TEST_FUNC, "GL_ALPHA_TEST_FUNC", "Alpha test function", "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ALPHA_TEST_REF, "GL_ALPHA_TEST_REF", "Alpha test reference value", "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_TEST, "GL_STENCIL_TEST", "Stenciling enabled", "stencil-buffer/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_STENCIL_FUNC, "GL_STENCIL_FUNC", "Stencil function", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_VALUE_MASK, "GL_STENCIL_VALUE_MASK", "Stencil mask", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_REF, "GL_STENCIL_REF", "Stencil reference value", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_FAIL, "GL_STENCIL_FAIL", "Stencil fail action", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_PASS_DEPTH_FAIL, "GL_STENCIL_PASS_DEPTH_FAIL", "Stencil depth buffer fail action", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_PASS_DEPTH_PASS, "GL_STENCIL_PASS_DEPTH_PASS", "Stencil depth buffer pass action", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_DEPTH_TEST, "GL_DEPTH_TEST", "Depth buffer enabled", "depth-buffer/ena ble", "glIsEnabled()"),
- new GLproperty(GL11.GL_DEPTH_FUNC, "GL_DEPTH_FUNC", "Depth buffer test function", "depth-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_BLEND, "GL_BLEND", "Blending enabled", "color-buffer/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_BLEND_SRC, "GL_BLEND_SRC", "Blending source function", "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_BLEND_DST, "GL_BLEND_DST", "Blending destination function", "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_DITHER, "GL_DITHER", "Dithering enabled", "color-buffer/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_INDEX_LOGIC_OP, "GL_INDEX_LOGIC_OP", "Color index logical operation enabled", "color-buffer/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_LOGIC_OP, "GL_COLOR_LOGIC_OP", "RGBA color logical operation enabled", "color-buffer/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LOGIC_OP_MODE, "GL_LOGIC_OP_MODE", "Logical operation function", "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_DRAW_BUFFER, "GL_DRAW_BUFFER", "Buffers selected for drawing", "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_WRITEMASK, "GL_INDEX_WRITEMASK", "Color-index writemask", "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_WRITEMASK, "GL_COLOR_WRITEMASK", "Color write enables; R, G, B, or A", "color-buffer", "glGetBooleanv()"),
- new GLproperty(GL11.GL_DEPTH_WRITEMASK, "GL_DEPTH_WRITEMASK", "Depth buffer enabled for writing", "depth-buffer", "glGetBooleanv()"),
- new GLproperty(GL11.GL_STENCIL_WRITEMASK, "GL_STENCIL_WRITEMASK", "Stencil-buffer writemask", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_CLEAR_VALUE, "GL_COLOR_CLEAR_VALUE", "Color-buffer clear value (RGBA mode)", "color-buffer", "glGetFloatv()"),
- new GLproperty(GL11.GL_INDEX_CLEAR_VALUE, "GL_INDEX_CLEAR_VALUE", "Color-buffer clear value (color-index mode)", "color-buffer", "glGetFloatv()"),
- new GLproperty(GL11.GL_DEPTH_CLEAR_VALUE, "GL_DEPTH_CLEAR_VALUE", "Depth-buffer clear value", "depth-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_CLEAR_VALUE, "GL_STENCIL_CLEAR_VALUE", "Stencil-buffer clear value", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_CLEAR_VALUE, "GL_ACCUM_CLEAR_VALUE", "Accumulation-buffer clear value", "accum-buffer", "glGetFloatv()"),
- new GLproperty(GL11.GL_UNPACK_SWAP_BYTES, "GL_UNPACK_SWAP_BYTES", "Value of GL_UNPACK_SWAP_BYTES", "pixel-store", "glGetBooleanv()"),
- new GLproperty(GL11.GL_UNPACK_LSB_FIRST, "GL_UNPACK_LSB_FIRST", "Value of GL_UNPACK_LSB_FIRST", "pixel-store", "glGetBooleanv()"),
- new GLproperty(GL11.GL_UNPACK_ROW_LENGTH, "GL_UNPACK_ROW_LENGTH", "Value of GL_UNPACK_ROW_LENGTH", "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_UNPACK_SKIP_ROWS, "GL_UNPACK_SKIP_ROWS", "Value of GL_UNPACK_SKIP_ROWS", "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_UNPACK_SKIP_PIXELS, "GL_UNPACK_SKIP_PIXELS", "Value of GL_UNPACK_SKIP_PIXELS", "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_UNPACK_ALIGNMENT, "GL_UNPACK_ALIGNMENT", "Value of GL_UNPACK_ALIGNMENT", "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PACK_SWAP_BYTES, "GL_PACK_SWAP_BYTES", "Value of GL_PACK_SWAP_BYTES", "pixel-store", "glGetBooleanv()"),
- new GLproperty(GL11.GL_PACK_LSB_FIRST, "GL_PACK_LSB_FIRST", "Value of GL_PACK_LSB_FIRST", "pixel-store", "glGetBooleanv()"),
- new GLproperty(GL11.GL_PACK_ROW_LENGTH, "GL_PACK_ROW_LENGTH", "Value of GL_PACK_ROW_LENGTH", "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PACK_SKIP_ROWS, "GL_PACK_SKIP_ROWS", "Value of GL_PACK_SKIP_ROWS", "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PACK_SKIP_PIXELS, "GL_PACK_SKIP_PIXELS", "Value of GL_PACK_SKIP_PIXELS", "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PACK_ALIGNMENT, "GL_PACK_ALIGNMENT", "Value of GL_PACK_ALIGNMENT", "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAP_COLOR, "GL_MAP_COLOR", "True if colors are mapped", "pixel", "glGetBooleanv()"),
- new GLproperty(GL11.GL_MAP_STENCIL, "GL_MAP_STENCIL", "True if stencil values are mapped", "pixel", "glGetBooleanv()"),
- new GLproperty(GL11.GL_INDEX_SHIFT, "GL_INDEX_SHIFT", "Value of GL_INDEX_SHIFT", "pixel", "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_OFFSET, "GL_INDEX_OFFSET", "Value of GL_INDEX_OFFSET", "pixel", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ZOOM_X, "GL_ZOOM_X", "x zoom factor", "pixel", "glGetFloatv()"),
- new GLproperty(GL11.GL_ZOOM_Y, "GL_ZOOM_Y", "y zoom factor", "pixel", "glGetFloatv()"),
- new GLproperty(GL11.GL_READ_BUFFER, "GL_READ_BUFFER", "Read source buffer", "pixel", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ORDER, "GL_ORDER", "1D map order", "capability", "glGetMapiv()"),
- new GLproperty(GL11.GL_ORDER, "GL_ORDER", "2D map orders", "capability", "glGetMapiv()"),
- new GLproperty(GL11.GL_COEFF, "GL_COEFF", "1D control points", "capability", "glGetMapfv()"),
- new GLproperty(GL11.GL_COEFF, "GL_COEFF", "2D control points", "capability", "glGetMapfv()"),
- new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "1D domain endpoints", "capability", "glGetMapfv()"),
- new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "2D domain endpoints", "capability", "glGetMapfv()"),
- new GLproperty(GL11.GL_MAP1_GRID_DOMAIN, "GL_MAP1_GRID_DOMAIN", "1D grid endpoints", "eval", "glGetFloatv()"),
- new GLproperty(GL11.GL_MAP2_GRID_DOMAIN, "GL_MAP2_GRID_DOMAIN", "2D grid endpoints", "eval", "glGetFloatv()"),
- new GLproperty(GL11.GL_MAP1_GRID_SEGMENTS, "GL_MAP1_GRID_SEGMENTS", "1D grid divisions", "eval", "glGetFloatv()"),
- new GLproperty(GL11.GL_MAP2_GRID_SEGMENTS, "GL_MAP2_GRID_SEGMENTS", "2D grid divisions", "eval", "glGetFloatv()"),
- new GLproperty(GL11.GL_AUTO_NORMAL, "GL_AUTO_NORMAL", "True if automatic normal generation enabled", "eval", "glIsEnabled()"),
- new GLproperty(GL11.GL_PERSPECTIVE_CORRECTION_HINT, "GL_PERSPECTIVE_CORRECTION_HINT", "Perspective correction hint", "hint", "glGetIntegerv()"),
- new GLproperty(GL11.GL_POINT_SMOOTH_HINT, "GL_POINT_SMOOTH_HINT", "Point smooth hint", "hint", "glGetIntegerv()"),
- new GLproperty(GL11.GL_LINE_SMOOTH_HINT, "GL_LINE_SMOOTH_HINT", "Line smooth hint", "hint", "glGetIntegerv()"),
- new GLproperty(GL11.GL_POLYGON_SMOOTH_HINT, "GL_POLYGON_SMOOTH_HINT", "Polygon smooth hint", "hint", "glGetIntegerv()"),
- new GLproperty(GL11.GL_FOG_HINT, "GL_FOG_HINT", "Fog hint", "hint", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_LIGHTS, "GL_MAX_LIGHTS", "Maximum number of lights", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_CLIP_PLANES, "GL_MAX_CLIP_PLANES", "Maximum number of user clipping planes", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_MODELVIEW_STACK_DEPTH, "GL_MAX_MODELVIEW_STACK_DEPTH", "Maximum modelview-matrix stack depth", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH", "Maximum projection-matrix stack depth", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_TEXTURE_STACK_DEPTH, "GL_MAX_TEXTURE_STACK_DEPTH", "Maximum depth of texture matrix stack", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_SUBPIXEL_BITS, "GL_SUBPIXEL_BITS", "Number of bits of subpixel precision in x and y", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_TEXTURE_SIZE, "GL_MAX_TEXTURE_SIZE", "See discussion in Texture Proxy in Chapter 9", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_PIXEL_MAP_TABLE, "GL_MAX_PIXEL_MAP_TABLE", "Maximum size of a glPixelMap() translation table", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_NAME_STACK_DEPTH, "GL_MAX_NAME_STACK_DEPTH", "Maximum selection-name stack depth", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_LIST_NESTING, "GL_MAX_LIST_NESTING", "Maximum display-list call nesting", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_EVAL_ORDER, "GL_MAX_EVAL_ORDER", "Maximum evaluator polynomial order", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_VIEWPORT_DIMS, "GL_MAX_VIEWPORT_DIMS", "Maximum viewport dimensions", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_ATTRIB_STACK_DEPTH, "GL_MAX_ATTRIB_STACK_DEPTH", "Maximum depth of the attribute stack", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", "Maximum depth of the client attribute stack", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_AUX_BUFFERS, "GL_AUX_BUFFERS", "Number of auxiliary buffers", "capability", "glGetBooleanv()"),
- new GLproperty(GL11.GL_RGBA_MODE, "GL_RGBA_MODE", "True if color buffers store RGBA", "capability", "glGetBooleanv()"),
- new GLproperty(GL11.GL_INDEX_MODE, "GL_INDEX_MODE", "True if color buffers store indices", "capability", "glGetBooleanv()"),
- new GLproperty(GL11.GL_DOUBLEBUFFER, "GL_DOUBLEBUFFER", "True if front and back buffers exist", "capability", "glGetBooleanv()"),
- new GLproperty(GL11.GL_STEREO, "GL_STEREO", "True if left and right buffers exist", "capability", "glGetBooleanv()"),
- new GLproperty(GL11.GL_POINT_SIZE_RANGE, "GL_POINT_SIZE_RANGE", "Range (low to high) of antialiased point sizes", "capability", "glGetFloatv()"),
- new GLproperty(GL11.GL_POINT_SIZE_GRANULARITY, "GL_POINT_SIZE_GRANULARITY", "Antialiased point-size granularity", "capability", "glGetFloatv()"),
- new GLproperty(GL11.GL_LINE_WIDTH_RANGE, "GL_LINE_WIDTH_RANGE", "Range (low to high) of antialiased line widths", "capability", "glGetFloatv()"),
- new GLproperty(GL11.GL_LINE_WIDTH_GRANULARITY, "GL_LINE_WIDTH_GRANULARITY", "Antialiased line-width granularity", "capability", "glGetFloatv()"),
- new GLproperty(GL11.GL_RED_BITS, "GL_RED_BITS", "Number of bits per red component in color buffers", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_GREEN_BITS, "GL_GREEN_BITS", "Number of bits per green component in color buffers", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_BLUE_BITS, "GL_BLUE_BITS", "Number of bits per blue component in color buffers", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ALPHA_BITS, "GL_ALPHA_BITS", "Number of bits per alpha component in color buffers", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_BITS, "GL_INDEX_BITS", "Number of bits per index in color buffers", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_DEPTH_BITS, "GL_DEPTH_BITS", "Number of depth-buffer bitplanes", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_BITS, "GL_STENCIL_BITS", "Number of stencil bitplanes", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_RED_BITS, "GL_ACCUM_RED_BITS", "Number of bits per red component in the accumulation buffer", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_GREEN_BITS, "GL_ACCUM_GREEN_BITS", "Number of bits per green component in the accumulation buffer", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_BLUE_BITS, "GL_ACCUM_BLUE_BITS", "Number of bits per blue component in the accumulation buffer", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_ALPHA_BITS, "GL_ACCUM_ALPHA_BITS", "Number of bits per alpha component in the accumulation buffer", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_LIST_BASE, "GL_LIST_BASE", "Setting of glListBase()", "list", "glGetIntegerv()"),
- new GLproperty(GL11.GL_LIST_INDEX, "GL_LIST_INDEX", "Number of display list under construction; 0 if none", "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_LIST_MODE, "GL_LIST_MODE", "Mode of display list under construction; undefined if none", "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ATTRIB_STACK_DEPTH, "GL_ATTRIB_STACK_DEPTH", "Attribute stack pointer", "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_CLIENT_ATTRIB_STACK_DEPTH, "GL_CLIENT_ATTRIB_STACK_DEPTH", "Client attribute stack pointer", "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_NAME_STACK_DEPTH, "GL_NAME_STACK_DEPTH", "Name stack depth", "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_RENDER_MODE, "GL_RENDER_MODE", "glRenderMode() setting", "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_SELECTION_BUFFER_POINTER, "GL_SELECTION_BUFFER_POINTER", "Pointer to selection buffer", "select", "glGetPointerv()"),
- new GLproperty(GL11.GL_SELECTION_BUFFER_SIZE, "GL_SELECTION_BUFFER_SIZE", "Size of selection buffer", "select", "glGetIntegerv()"),
- new GLproperty(GL11.GL_FEEDBACK_BUFFER_POINTER, "GL_FEEDBACK_BUFFER_POINTER", "Pointer to feedback buffer", "feedback", "glGetPointerv()"),
- new GLproperty(GL11.GL_FEEDBACK_BUFFER_SIZE, "GL_FEEDBACK_BUFFER_SIZE", "Size of feedback buffer", "feedback", "glGetIntegerv()"),
- new GLproperty(GL11.GL_FEEDBACK_BUFFER_TYPE, "GL_FEEDBACK_BUFFER_TYPE", "Type of feedback buffer", "feedback", "glGetIntegerv()"),
- };
+ public static void dumpOpenGLstate() {}
- public static void dumpOpenGLstate()
- {
- }
+ public static void dumpAllIsEnabled() // Call This
+ {
+ for (int i = 0; i < instance.propertyList.length; ++i) {
- public static void dumpAllIsEnabled() //Call This
- {
- for (int i = 0; i < instance.propertyList.length; ++i)
+ if (instance.propertyList[i].fetchCommand == "glIsEnabled()") {
- {
- if (instance.propertyList[i].fetchCommand == "glIsEnabled()")
+ System.out.print(instance.propertyList[i].name + ":");
+ System.out.print(GL11.glIsEnabled(instance.propertyList[i].gLconstant));
+ System.out.println(" (" + instance.propertyList[i].description + ")");
+ }
+ }
+ }
- {
- System.out.print(instance.propertyList[i].name + ":");
- System.out.print(GL11.glIsEnabled(instance.propertyList[i].gLconstant));
- System.out.println(" (" + instance.propertyList[i].description + ")");
- }
- }
- }
+ public static void dumpAllType(final String type) {
- public static void dumpAllType(final String type)
+ for (int i = 0; i < instance.propertyList.length; ++i) {
- {
- for (int i = 0; i < instance.propertyList.length; ++i)
+ if (instance.propertyList[i].category.equals(type)) {
- {
- if (instance.propertyList[i].category.equals(type))
+ System.out.print(instance.propertyList[i].name + ":");
+ System.out.println(getPropertyAsString(i));
+ System.out.println(" (" + instance.propertyList[i].description + ")");
+ }
+ }
+ }
- {
- System.out.print(instance.propertyList[i].name + ":");
- System.out.println(getPropertyAsString(i));
- System.out.println(" (" + instance.propertyList[i].description + ")");
- }
- }
- }
+ private static String getPropertyAsString(final int propertyListIndex) {
+ final int gLconstant = instance.propertyList[propertyListIndex].gLconstant;
+ if (instance.propertyList[propertyListIndex].fetchCommand.equals("glIsEnabled()")) {
+ return "" + GL11.glIsEnabled(gLconstant);
+ }
- private static String getPropertyAsString(final int propertyListIndex)
- {
- final int gLconstant = instance.propertyList[propertyListIndex].gLconstant;
- if (instance.propertyList[propertyListIndex].fetchCommand.equals("glIsEnabled()")) {
- return "" + GL11.glIsEnabled(gLconstant);
- }
+ if (instance.propertyList[propertyListIndex].fetchCommand == "glGetBooleanv()") {
- if (instance.propertyList[propertyListIndex].fetchCommand == "glGetBooleanv()")
+ final ByteBuffer params = BufferUtils.createByteBuffer(16);
- {
- final ByteBuffer params = BufferUtils.createByteBuffer(16);
+ GL11.glGetBoolean(gLconstant, params);
+ String out = "";
+ for (int i = 0; i < params.capacity(); ++i) {
- GL11.glGetBoolean(gLconstant, params);
- String out = "";
- for (int i = 0; i < params.capacity(); ++i)
+ out += (i == 0 ? "" : ", ") + params.get(i);
+ }
+ return out;
+ }
- {
- out += (i == 0 ? "" : ", ") + params.get(i);
- }
- return out;
- }
-
- return "";
- }
+ return "";
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java
index 4ff929c643..54a5ef8668 100644
--- a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java
@@ -1,811 +1,772 @@
package gtPlusPlus.core.util.math;
-import java.text.NumberFormat;
-import java.util.Map;
-import java.util.Random;
-
import gregtech.api.enums.GT_Values;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
+import java.text.NumberFormat;
+import java.util.Map;
+import java.util.Random;
public class MathUtils {
- final static Random rand = CORE.RANDOM;
-
- /** Formats a number with group separator and at most 2 fraction digits. */
- private static final NumberFormat sNumberFormat = NumberFormat.getInstance();
-
- static {
- sNumberFormat.setMaximumFractionDigits(2);
- }
-
- /**
- * Returns a psuedo-random number between min and max, inclusive.
- * The difference between min and max can be at most
- * Integer.MAX_VALUE - 1.
- *
- * @param min Minimim value
- * @param max Maximim value. Must be greater than min.
- * @return Integer between min and max, inclusive.
- * @see java.util.Random#nextInt(int)
- */
- public static int randInt(final int min, final int max) {
- // nextInt is normally exclusive of the top value,
- // so add 1 to make it inclusive
- return rand.nextInt((max - min) + 1) + min;
- }
-
- public static double getChanceOfXOverYRuns(final double x, final double y){
- return (1-Math.pow((1-x), y));
- }
-
-
- /**
- * Returns a psuedo-random number between min and max, inclusive.
- * The difference between min and max can be at most
- * Long.MAX_VALUE - 1.
- *
- * @param min Minimim value
- * @param max Maximim value. Must be greater than min.
- * @return Long between min and max, inclusive.
- * @see java.util.Random#nextLong(long)
- */
- public static long randLong(final long min, final long max) {
- // nextInt is normally exclusive of the top value,
- // so add 1 to make it inclusive
- return MathUtils.nextLong(rand,(max - min) + 1) + min;
- }
- private static long nextLong(final Random rng, final long n) {
- // error checking and 2^x checking removed for simplicity.
- long bits, val;
- do {
- bits = (rng.nextLong() << 1) >>> 1;
- val = bits % n;
- } while (((bits-val)+(n-1)) < 0L);
- return val;
- }
-
-
- /**
- * Returns a psuedo-random number between min and max, inclusive.
- * The difference between min and max can be at most
- * Double.MAX_VALUE - 1.
- *
- * @param min Minimim value
- * @param max Maximim value. Must be greater than min.
- * @return Double between min and max, inclusive.
- * @see java.util.Random#nextDouble(double)
- */
- public static double randDouble(final double min, final double max) {
- // nextInt is normally exclusive of the top value,
- // so add 1 to make it inclusive
- return MathUtils.nextDouble(rand,(max - min) + 1) + min;
- }
-
- private static double nextDouble(final Random rng, final double n) {
- // error checking and 2^x checking removed for simplicity.
- double bits, val;
- do {
- bits = (rng.nextLong() << 1) >>> 1;
- val = bits % n;
- } while (((bits-val)+(n-1)) < 0L);
- return val;
- }
-
- /**
- * Returns a psuedo-random number between min and max, inclusive.
- * The difference between min and max can be at most
- * Float.MAX_VALUE - 1.
- *
- * @param min Minimim value
- * @param max Maximim value. Must be greater than min.
- * @return Float between min and max, inclusive.
- * @see java.util.Random#nextFloat(float)
- */
- public static float randFloat(final float min, final float max) {
- // nextInt is normally exclusive of the top value,
- // so add 1 to make it inclusive
- return MathUtils.nextFloat(rand,(max - min) + 1) + min;
- }
-
- private static float nextFloat(final Random rng, final float n) {
- // error checking and 2^x checking removed for simplicity.
- float bits, val;
- do {
- bits = (rng.nextLong() << 1) >>> 1;
- val = bits % n;
- } while (((bits-val)+(n-1)) < 0L);
- return val;
- }
-
-
- /**
- * Returns a percentage.
- * The returned number is the % of X in Y.
- * Supports Doubles.
- *
- * @param current Current value.
- * @param max Maximim value. Must be greater than min.
- * @return double between min and max, inclusive.
- */
- public static double findPercentage(final double current, final double max){
- return Math.round(((current / max) * 100) * 100.00) / 100.00;
- }
-
- /**
- * Returns a percentage.
- * The returned number is the % of X in Y.
- * Supports Floats.
- *
- * @param current Current value.
- * @param max Maximim value. Must be greater than min.
- * @return double between min and max, inclusive.
- */
- public static float findPercentage(final float current, final float max){
- return (float) (Math.round(((current / max) * 100) * 100.00) / 100.00);
- }
-
- public static int findPercentageOfInt(long input, float percentage){
- return (int)(input*(percentage/100.0f));
- }
-
-
- //Smooth Rounding Function
- /**
- * Returns a double.
- * The returned number is d rounded to the nearest d.01.
- * Supports Doubles.
- *
- * @param current Current value.
- * @return double Rounded value.
- */
- public static double decimalRounding(final double d) {
- return Math.round(d * 2) / 2.0;
- }
-
-
- //Smooth Rounding Function (Nearest 5)
- /**
- * Returns a double.
- * The returned number is d rounded to the nearest d.5.
- * Supports Doubles.
- *
- * @param current Current value.
- * @return double Rounded value.
- */
- public static double decimalRoundingToWholes(final double d) {
- return 5*(Math.round(d/5));
- }
-
- //Smooth Rounding Function
- /**
- * Returns a integer.
- * The returned number is d rounded to the nearest flat integer.
- * Supports Doubles as input.
- *
- * @param current Current value.
- * @return integer Rounded value.
- */
- public static int roundToClosestInt(final double d) {
- return (int) (Math.round(d * 2) / 2.0);
- }
-
- public static int roundToClosestMultiple(final double number, final int multiple) {
- int result = multiple;
- if ((number % multiple) == 0) {
- return (int) number;
- }
- // If not already multiple of given number
- if ((number % multiple) != 0) {
- final int division = (int) ((number / multiple) + 1);
- result = division * multiple;
- }
- return result;
- }
-
-
- //Smooth Rounding Function
- /**
- * Returns a long.
- * The returned number is d rounded to the nearest flat long.
- * Supports Doubles as input.
- *
- * @param current Current value.
- * @return long Rounded value.
- */
- public static long roundToClosestLong(final double d) {
- return (long) (Math.round(d * 2) / 2.0);
- }
-
-
- /**
- * Returns a boolean.
- * The returned boolean is wether or not X evenly fits in to Y.
- * Supports ints.
- *
- * @param x Value A.
- * @param y Value B. Must be greater than min.
- * @return boolean Whether or not it divides evenly.
- */
- public static boolean divideXintoY(final int x, final int y){
- if ((x % y) == 0)
- {
- return true;
- }
- return false;
- }
-
-
- /**
- * Returns a boolean.
- * The returned boolean is based on the odd/eveness of the input.
- * Supports ints.
- *
- * @param x Value A.
- * @return boolean Whether or not it divides evenly.
- */
- public static boolean isNumberEven(final long x){
- if ((x % 2) == 0)
- {
- return true;
- }
- return false;
- }
-
-
-
- /**
- * Returns an int.
- * The returned number is the value on i + 273.15F.
- * Supports ints.
- *
- * @param i Temp in Celcius.
- * @return int The celcius temp returned as Kelvin, rounded to the readest whole.
- */
- public static float celsiusToKelvin(final int i){
- final double f = i + 273.15F;
- return (int)decimalRoundingToWholes(f);
- }
-
-
- /**
- * Returns a hexInteger.
- * The returned number is the hex value of the input.
- * Supports ints.
- *
- * @param input Current value.
- * @return hexInteger.
- */
- public static int getHexNumberFromInt(final int input){
- final String result = Integer.toHexString(input);
- final int resultINT = Integer.getInteger(result);
- return resultINT;
- }
-
-
- /**
- * Returns a hexInteger.
- * The returned value is between min and max.
- * Supports ints.
- *
- * @param min Minimum value.
- * @param max Maximium value. Must be greater than min.
- * @return hexInteger between min and max, inclusive.
- */
- public static int generateRandomHexValue(final int min, final int max){
- return getHexNumberFromInt(randInt(min, max));
- }
-
-
- /**
- * Returns a random hex value.
- * The returned value is between 000000-ffffff.
- *
- * @return hexInteger between min and max, inclusive.
- */
- public static int generateSingularRandomHexValue(){
- String temp;
- final int randomInt = randInt(1, 5);
- final Map<Integer, String> colours = Utils.hexColourGeneratorRandom(5);
-
- if ((colours.get(randomInt) != null) && (colours.size() > 0)){
- temp = colours.get(randomInt);
- }
- else {
- temp = "0F0F0F";
- }
-
- Logger.WARNING("Operating with "+temp);
- temp = Utils.appenedHexNotationToString(String.valueOf(temp));
- Logger.WARNING("Made "+temp+" - Hopefully it's not a mess.");
- Logger.WARNING("It will decode into "+Integer.decode(temp)+".");
- return Integer.decode(temp);
- }
-
- public static long[] simplifyNumbersToSmallestForm(final long[] inputArray){
- final long GCD = gcd(inputArray);
- final long[] outputArray = new long[inputArray.length];
- for (int i=0;i<inputArray.length;i++){
- if (GCD != 0) {
- outputArray[i] = (inputArray[i]/GCD);
- } else {
- outputArray[i] = inputArray[i];
- }
- }
- if (outputArray.length > 0) {
- return outputArray;
- }
- return new long[] {};
- }
-
- private static long gcd(long a, long b){
- while (b > 0)
- {
- final long temp = b;
- b = a % b; // % is remainder
- a = temp;
- }
- return a;
- }
-
- private static long gcd(final long[] input){
- long result = input[0];
- for(int i = 1; i < input.length; i++) {
- result = gcd(result, input[i]);
- }
- return result;
- }
-
- final public static int getRgbAsHex(final short[] RGBA){
- final int returnValue = Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]);
- return (returnValue == 0) ? 0 : returnValue;
- }
-
-
- public final static int returnLargestNumber(final int a, final int b){
- if (a > b){
- return a;
- }
- else if (a == b){
- return a;
- }
- else {
- return b;
- }
- }
-
- public static byte safeByte(long number){
- return number>Byte.MAX_VALUE ? Byte.MAX_VALUE :(byte)number;
- }
-
- public static short safeShort(long number){
- return number>Short.MAX_VALUE ? Short.MAX_VALUE :(short)number;
- }
-
- public static int safeInt(long number, int margin){
- return number>Integer.MAX_VALUE-margin ? Integer.MAX_VALUE-margin :(int)number;
- }
-
- public static int safeInt(long number){
- return number>GT_Values.V[GT_Values.V.length-1] ? safeInt(GT_Values.V[GT_Values.V.length-1],1) : number<Integer.MIN_VALUE ? Integer.MIN_VALUE : (int)number;
- }
-
- public static int getRandomFromArray(int[] mValues) {
- int[] mLargeChanceArray = new int[(mValues.length-1)*1000];
- int mValueSelection;
- for (int g = 0; g < mLargeChanceArray.length; g++) {
- mValueSelection = randInt(0, mValues.length-1);
- mLargeChanceArray[g] = mValues[mValueSelection];
- }
- return mLargeChanceArray[randInt(0, mLargeChanceArray.length-1)];
-
- }
-
-
- /*
- * Averages
- */
-
- public static byte getByteAverage(AutoMap<Byte> aDataSet) {
- byte[] aNewSet = new byte[aDataSet.size()];
- for (int u=0;u<aDataSet.size();u++) {
- byte b = getSafeByte(aDataSet.get(u));
- aNewSet[u] = b;
- }
- return getByteAverage(aNewSet);
- }
-
- public static short getShortAverage(AutoMap<Short> aDataSet) {
- short[] aNewSet = new short[aDataSet.size()];
- for (int u=0;u<aDataSet.size();u++) {
- short b = getSafeShort(aDataSet.get(u));
- aNewSet[u] = b;
- }
- return getShortAverage(aNewSet);
- }
-
- public static int getIntAverage(AutoMap<Integer> aDataSet) {
- int[] aNewSet = new int[aDataSet.size()];
- for (int u=0;u<aDataSet.size();u++) {
- int b = getSafeInt(aDataSet.get(u));
- aNewSet[u] = b;
- }
- return getIntAverage(aNewSet);
- }
-
- public static float getFloatAverage(AutoMap<Float> aDataSet) {
- float[] aNewSet = new float[aDataSet.size()];
- for (int u=0;u<aDataSet.size();u++) {
- float b = getSafeFloat(aDataSet.get(u));
- aNewSet[u] = b;
- }
- return getFloatAverage(aNewSet);
- }
-
- public static long getLongAverage(AutoMap<Long> aDataSet) {
- long[] aNewSet = new long[aDataSet.size()];
- for (int u=0;u<aDataSet.size();u++) {
- long b = getSafeLong(aDataSet.get(u));
- aNewSet[u] = b;
- }
- return getLongAverage(aNewSet);
- }
-
- public static double getDoubleAverage(AutoMap<Double> aDataSet) {
- double[] aNewSet = new double[aDataSet.size()];
- for (int u=0;u<aDataSet.size();u++) {
- double b = getSafeDouble(aDataSet.get(u));
- aNewSet[u] = b;
- }
- return getDoubleAverage(aNewSet);
- }
-
-
-
- public static byte getByteAverage(byte[] aDataSet) {
- if (aDataSet.length <= 0) {
- return 0;
- }
- int divisor = aDataSet.length;
- byte total = 0;
- for (byte i : aDataSet) {
- total += i;
- }
- byte result = safeByte(total/divisor);
- return result;
- }
-
- public static short getShortAverage(short[] aDataSet) {
- if (aDataSet.length <= 0) {
- return 0;
- }
- int divisor = aDataSet.length;
- Logger.WARNING("Calculating Average Short. Divisor: "+divisor);
- short total = 0;
- for (short i : aDataSet) {
- Logger.WARNING("Adding "+i);
- total += i;
- }
- short result = safeShort((total/divisor));
- Logger.WARNING("Average: "+result);
- return result;
- }
- public static int getIntAverage(int[] aDataSet) {
- if (aDataSet.length <= 0) {
- return 0;
- }
- int divisor = aDataSet.length;
- int total = 0;
- for (int i : aDataSet) {
- total += i;
- }
- int result = safeInt(total/divisor);
- return result;
- }
- public static float getFloatAverage(float[] aDataSet) {
- if (aDataSet.length <= 0) {
- return 0;
- }
- int divisor = aDataSet.length;
- float total = 0;
- for (float i : aDataSet) {
- total += i;
- }
- float result = (total/divisor);
- return result;
- }
- public static long getLongAverage(long[] aDataSet) {
- if (aDataSet.length <= 0) {
- return 0;
- }
- int divisor = aDataSet.length;
- long total = 0;
- for (long i : aDataSet) {
- total += i;
- }
- long result = (total/divisor);
- return result;
- }
- public static double getDoubleAverage(double[] aDataSet) {
- if (aDataSet.length <= 0) {
- return 0;
- }
- int divisor = aDataSet.length;
- double total = 0;
- for (double i : aDataSet) {
- total += i;
- }
- double result = (total/divisor);
- return result;
- }
-
- public static int howManyPlaces(int aValueForGen) {
- if (aValueForGen < 0) {
- aValueForGen = makeNegative(aValueForGen);
- }
- String a = String.valueOf(aValueForGen);
- return a.length();
- }
-
- /**
- * Inverts the value, making Positives into Negatives and vice versa.
- * @param aPositive - An int value, either positive or negative.
- * @return - Inverted int Value.
- */
- public static int makeNegative(int aPositive) {
- if (aPositive > 0) {
- return -aPositive;
- }
- else if (aPositive < 0) {
- return +aPositive;
- }
- else {
- return 0;
- }
- }
-
- public static <V> V safeCast(Object aNumberType) {
- long a1;
- double a2;
- a1 = Long.parseLong(aNumberType.toString());
- a2 = Double.parseDouble(aNumberType.toString());
-
- if ((aNumberType.getClass() == byte.class) || (aNumberType instanceof Byte)){
- if (a1 >= Byte.MIN_VALUE && a1 <= Byte.MAX_VALUE) {
- String s = ""+a1;
- Byte s1 = Byte.valueOf(s);
- return (V) s1;
- }
- }
- else if ((aNumberType.getClass() == short.class) || (aNumberType instanceof Short)){
- if (a1 >= Short.MIN_VALUE && a1 <= Short.MAX_VALUE) {
- String s = ""+a1;
- Short s1 = Short.valueOf(s);
- return (V) s1;
-
- }
- }
- else if ((aNumberType.getClass() == int.class) || (aNumberType instanceof Integer)){
- if (a1 >= Integer.MIN_VALUE && a1 <= Integer.MAX_VALUE) {
- String s = ""+a1;
- Integer s1 = Integer.valueOf(s);
- return (V) s1;
-
- }
- }
- else if ((aNumberType.getClass() == long.class) || (aNumberType instanceof Long)){
- if (a1 >= Long.MIN_VALUE && a1 <= Long.MAX_VALUE) {
- String s = ""+a1;
- Long s1 = Long.valueOf(s);
- return (V) s1;
- }
- }
- else if ((aNumberType.getClass() == float.class) || (aNumberType instanceof Float)){
- if (a2 >= Float.MIN_VALUE && a2 <= Float.MAX_VALUE) {
- String s = ""+a1;
- Float s1 = Float.valueOf(s);
- return (V) s1;
-
- }
- }
- else if ((aNumberType.getClass() == double.class) || (aNumberType instanceof Double)){
- if (a2 >= Double.MIN_VALUE && a2 <= Double.MAX_VALUE) {
- String s = ""+a1;
- Double s1 = Double.valueOf(s);
- return (V) s1;
-
- }
- }
-
- Integer o = 0;
- return (V) o;
-
- }
-
- public static byte getSafeByte(Byte b) {
- Byte a = safeCast(b);
- return a.byteValue();
- }
-
- public static short getSafeShort(Short b) {
- Short a = safeCast(b);
- return a.shortValue();
- }
-
- public static int getSafeInt(Integer b) {
- Integer a = safeCast(b);
- return a.intValue();
- }
-
- public static long getSafeLong(Long b) {
- Long a = safeCast(b);
- return a.longValue();
- }
-
- public static float getSafeFloat(Float b) {
- Float a = safeCast(b);
- return a.floatValue();
- }
-
- public static double getSafeDouble(Double b) {
- Double a = safeCast(b);
- return a.doubleValue();
- }
-
-
- public static long safeCast_IntToLong(int o) {
- long i = o;
- return i;
- }
-
- public static int safeCast_LongToInt(long o) {
- if (o > Integer.MAX_VALUE) {
- return Integer.MAX_VALUE;
- }
- else {
- int i = (int) o;
- return i;
- }
- }
-
- public static short safeCast_IntToShort(int o) {
- if (o > Short.MAX_VALUE) {
- return Short.MAX_VALUE;
- }
- else {
- short i = (short) o;
- return i;
- }
- }
-
- public static int safeCast_ShortToInt(short o) {
- int i = (int) o;
- return i;
- }
-
- public static byte safeCast_ShortToByte(short o) {
- if (o > Byte.MAX_VALUE) {
- return Byte.MAX_VALUE;
- }
- else {
- byte i = (byte) o;
- return i;
- }
- }
-
- public static short safeCast_ByteToshort(byte o) {
- short i = (short) o;
- return i;
- }
-
- /**
- * Balances a number within a range.
- * @param aInput - The number to balance
- * @param aMin - The minimum bounds
- * @param aMax - The maximum bounds
- * @return - An Integer which will be between the bounds, or a boundary value.
- */
- public static int balance(int aInput, int aMin, int aMax) {
- return Math.max(Math.min(aInput, aMax), aMin);
- }
-
- /**
- * Balances a number within a range.
- * @param aInput - The number to balance
- * @param aMin - The minimum bounds
- * @param aMax - The maximum bounds
- * @return - A Number which will be between the bounds, or a boundary value.
- */
- public static Number balance(Number aInput, Number aMin, Number aMax) {
- return max(min(aInput, aMax), aMin);
- }
-
- /**
- * Balances a number within a range.
- * @param aInput - The number to balance
- * @param aMin - The minimum bounds
- * @param aMax - The maximum bounds
- * @return - An Integer which will be between the bounds, or a boundary value.
- */
- public static int balanceInt(Number aInput, Number aMin, Number aMax) {
- return MathUtils.safeCast_LongToInt((long) balance(max(min(aInput, aMax), aMin), Integer.MIN_VALUE, Integer.MAX_VALUE));
- }
-
- /**
- * Balances a number within a range.
- * @param aInput - The number to balance
- * @param aMin - The minimum bounds
- * @param aMax - The maximum bounds
- * @return - A Long which will be between the bounds, or a boundary value.
- */
- public static long balanceLong(Number aInput, Number aMin, Number aMax) {
- return (long) balance(max(min(aInput, aMax), aMin), Long.MIN_VALUE, Long.MAX_VALUE);
- }
-
- public static int getValueWithinRange(int i, int aMin, int aMax) {
- int aAmount = Math.max(Math.min(i, aMax), aMin);
- return aAmount;
- }
-
- public static Pair<Integer, Integer> splitLongIntoIntegers(long aLong){
- int aIntMaxInLong = (int) Math.min(Integer.MAX_VALUE, Math.floor(aLong/Integer.MAX_VALUE));
- int aRemainder = (int) (aLong - (aIntMaxInLong * Integer.MAX_VALUE));
- return new Pair<Integer, Integer>(aIntMaxInLong, aRemainder);
- }
-
-
-
-
- /**
- * Returns the smaller of two {@code Number}s. That is,
- * the result the argument closer to the value of
- * {@link Long#MIN_VALUE}. If the arguments have the same
- * value, the result is that same value.
- *
- * @param a an argument.
- * @param b another argument.
- * @return the smaller of {@code a} and {@code b}.
- */
- public static Number min(Number a, Number b) {
- return (a.longValue() <= b.longValue()) ? a : b;
- }
-
- /**
- * Returns the greater of two {@code Number}s. That is, the
- * result is the argument closer to the value of
- * {@link Long#MAX_VALUE}. If the arguments have the same value,
- * the result is that same value.
- *
- * @param a an argument.
- * @param b another argument.
- * @return the larger of {@code a} and {@code b}.
- */
- public static Number max(Number a, Number b) {
- return (a.longValue() >= b.longValue()) ? a : b;
- }
-
- public static long combineTwoIntegersToLong(int a, int b) {
- long val = (((long) a) << 32) | (b & 0xffffffffL);
- return val;
- }
-
- public static int[] splitLongIntoTwoIntegers(long aNum) {
- int a = (int) (aNum >> 32);
- int b = (int) aNum;
- return new int[] {a, b};
- }
-
- public static String formatNumbers(long aNumber) {
- return sNumberFormat.format(aNumber);
- }
-
- public static String formatNumbers(double aNumber) {
- return sNumberFormat.format(aNumber);
- }
-
-
+ static final Random rand = CORE.RANDOM;
+
+ /** Formats a number with group separator and at most 2 fraction digits. */
+ private static final NumberFormat sNumberFormat = NumberFormat.getInstance();
+
+ static {
+ sNumberFormat.setMaximumFractionDigits(2);
+ }
+
+ /**
+ * Returns a psuedo-random number between min and max, inclusive.
+ * The difference between min and max can be at most
+ * Integer.MAX_VALUE - 1.
+ *
+ * @param min Minimim value
+ * @param max Maximim value. Must be greater than min.
+ * @return Integer between min and max, inclusive.
+ * @see java.util.Random#nextInt(int)
+ */
+ public static int randInt(final int min, final int max) {
+ // nextInt is normally exclusive of the top value,
+ // so add 1 to make it inclusive
+ return rand.nextInt((max - min) + 1) + min;
+ }
+
+ public static double getChanceOfXOverYRuns(final double x, final double y) {
+ return (1 - Math.pow((1 - x), y));
+ }
+
+ /**
+ * Returns a psuedo-random number between min and max, inclusive.
+ * The difference between min and max can be at most
+ * Long.MAX_VALUE - 1.
+ *
+ * @param min Minimim value
+ * @param max Maximim value. Must be greater than min.
+ * @return Long between min and max, inclusive.
+ * @see java.util.Random#nextLong(long)
+ */
+ public static long randLong(final long min, final long max) {
+ // nextInt is normally exclusive of the top value,
+ // so add 1 to make it inclusive
+ return MathUtils.nextLong(rand, (max - min) + 1) + min;
+ }
+
+ private static long nextLong(final Random rng, final long n) {
+ // error checking and 2^x checking removed for simplicity.
+ long bits, val;
+ do {
+ bits = (rng.nextLong() << 1) >>> 1;
+ val = bits % n;
+ } while (((bits - val) + (n - 1)) < 0L);
+ return val;
+ }
+
+ /**
+ * Returns a psuedo-random number between min and max, inclusive.
+ * The difference between min and max can be at most
+ * Double.MAX_VALUE - 1.
+ *
+ * @param min Minimim value
+ * @param max Maximim value. Must be greater than min.
+ * @return Double between min and max, inclusive.
+ * @see java.util.Random#nextDouble(double)
+ */
+ public static double randDouble(final double min, final double max) {
+ // nextInt is normally exclusive of the top value,
+ // so add 1 to make it inclusive
+ return MathUtils.nextDouble(rand, (max - min) + 1) + min;
+ }
+
+ private static double nextDouble(final Random rng, final double n) {
+ // error checking and 2^x checking removed for simplicity.
+ double bits, val;
+ do {
+ bits = (rng.nextLong() << 1) >>> 1;
+ val = bits % n;
+ } while (((bits - val) + (n - 1)) < 0L);
+ return val;
+ }
+
+ /**
+ * Returns a psuedo-random number between min and max, inclusive.
+ * The difference between min and max can be at most
+ * Float.MAX_VALUE - 1.
+ *
+ * @param min Minimim value
+ * @param max Maximim value. Must be greater than min.
+ * @return Float between min and max, inclusive.
+ * @see java.util.Random#nextFloat(float)
+ */
+ public static float randFloat(final float min, final float max) {
+ // nextInt is normally exclusive of the top value,
+ // so add 1 to make it inclusive
+ return MathUtils.nextFloat(rand, (max - min) + 1) + min;
+ }
+
+ private static float nextFloat(final Random rng, final float n) {
+ // error checking and 2^x checking removed for simplicity.
+ float bits, val;
+ do {
+ bits = (rng.nextLong() << 1) >>> 1;
+ val = bits % n;
+ } while (((bits - val) + (n - 1)) < 0L);
+ return val;
+ }
+
+ /**
+ * Returns a percentage.
+ * The returned number is the % of X in Y.
+ * Supports Doubles.
+ *
+ * @param current Current value.
+ * @param max Maximim value. Must be greater than min.
+ * @return double between min and max, inclusive.
+ */
+ public static double findPercentage(final double current, final double max) {
+ return Math.round(((current / max) * 100) * 100.00) / 100.00;
+ }
+
+ /**
+ * Returns a percentage.
+ * The returned number is the % of X in Y.
+ * Supports Floats.
+ *
+ * @param current Current value.
+ * @param max Maximim value. Must be greater than min.
+ * @return double between min and max, inclusive.
+ */
+ public static float findPercentage(final float current, final float max) {
+ return (float) (Math.round(((current / max) * 100) * 100.00) / 100.00);
+ }
+
+ public static int findPercentageOfInt(long input, float percentage) {
+ return (int) (input * (percentage / 100.0f));
+ }
+
+ // Smooth Rounding Function
+ /**
+ * Returns a double.
+ * The returned number is d rounded to the nearest d.01.
+ * Supports Doubles.
+ *
+ * @param current Current value.
+ * @return double Rounded value.
+ */
+ public static double decimalRounding(final double d) {
+ return Math.round(d * 2) / 2.0;
+ }
+
+ // Smooth Rounding Function (Nearest 5)
+ /**
+ * Returns a double.
+ * The returned number is d rounded to the nearest d.5.
+ * Supports Doubles.
+ *
+ * @param current Current value.
+ * @return double Rounded value.
+ */
+ public static double decimalRoundingToWholes(final double d) {
+ return 5 * (Math.round(d / 5));
+ }
+
+ // Smooth Rounding Function
+ /**
+ * Returns a integer.
+ * The returned number is d rounded to the nearest flat integer.
+ * Supports Doubles as input.
+ *
+ * @param current Current value.
+ * @return integer Rounded value.
+ */
+ public static int roundToClosestInt(final double d) {
+ return (int) (Math.round(d * 2) / 2.0);
+ }
+
+ public static int roundToClosestMultiple(final double number, final int multiple) {
+ int result = multiple;
+ if ((number % multiple) == 0) {
+ return (int) number;
+ }
+ // If not already multiple of given number
+ if ((number % multiple) != 0) {
+ final int division = (int) ((number / multiple) + 1);
+ result = division * multiple;
+ }
+ return result;
+ }
+
+ // Smooth Rounding Function
+ /**
+ * Returns a long.
+ * The returned number is d rounded to the nearest flat long.
+ * Supports Doubles as input.
+ *
+ * @param current Current value.
+ * @return long Rounded value.
+ */
+ public static long roundToClosestLong(final double d) {
+ return (long) (Math.round(d * 2) / 2.0);
+ }
+
+ /**
+ * Returns a boolean.
+ * The returned boolean is wether or not X evenly fits in to Y.
+ * Supports ints.
+ *
+ * @param x Value A.
+ * @param y Value B. Must be greater than min.
+ * @return boolean Whether or not it divides evenly.
+ */
+ public static boolean divideXintoY(final int x, final int y) {
+ if ((x % y) == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns a boolean.
+ * The returned boolean is based on the odd/eveness of the input.
+ * Supports ints.
+ *
+ * @param x Value A.
+ * @return boolean Whether or not it divides evenly.
+ */
+ public static boolean isNumberEven(final long x) {
+ if ((x % 2) == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns an int.
+ * The returned number is the value on i + 273.15F.
+ * Supports ints.
+ *
+ * @param i Temp in Celcius.
+ * @return int The celcius temp returned as Kelvin, rounded to the readest whole.
+ */
+ public static float celsiusToKelvin(final int i) {
+ final double f = i + 273.15F;
+ return (int) decimalRoundingToWholes(f);
+ }
+
+ /**
+ * Returns a hexInteger.
+ * The returned number is the hex value of the input.
+ * Supports ints.
+ *
+ * @param input Current value.
+ * @return hexInteger.
+ */
+ public static int getHexNumberFromInt(final int input) {
+ final String result = Integer.toHexString(input);
+ final int resultINT = Integer.getInteger(result);
+ return resultINT;
+ }
+
+ /**
+ * Returns a hexInteger.
+ * The returned value is between min and max.
+ * Supports ints.
+ *
+ * @param min Minimum value.
+ * @param max Maximium value. Must be greater than min.
+ * @return hexInteger between min and max, inclusive.
+ */
+ public static int generateRandomHexValue(final int min, final int max) {
+ return getHexNumberFromInt(randInt(min, max));
+ }
+
+ /**
+ * Returns a random hex value.
+ * The returned value is between 000000-ffffff.
+ *
+ * @return hexInteger between min and max, inclusive.
+ */
+ public static int generateSingularRandomHexValue() {
+ String temp;
+ final int randomInt = randInt(1, 5);
+ final Map<Integer, String> colours = Utils.hexColourGeneratorRandom(5);
+
+ if ((colours.get(randomInt) != null) && (colours.size() > 0)) {
+ temp = colours.get(randomInt);
+ } else {
+ temp = "0F0F0F";
+ }
+
+ Logger.WARNING("Operating with " + temp);
+ temp = Utils.appenedHexNotationToString(String.valueOf(temp));
+ Logger.WARNING("Made " + temp + " - Hopefully it's not a mess.");
+ Logger.WARNING("It will decode into " + Integer.decode(temp) + ".");
+ return Integer.decode(temp);
+ }
+
+ public static long[] simplifyNumbersToSmallestForm(final long[] inputArray) {
+ final long GCD = gcd(inputArray);
+ final long[] outputArray = new long[inputArray.length];
+ for (int i = 0; i < inputArray.length; i++) {
+ if (GCD != 0) {
+ outputArray[i] = (inputArray[i] / GCD);
+ } else {
+ outputArray[i] = inputArray[i];
+ }
+ }
+ if (outputArray.length > 0) {
+ return outputArray;
+ }
+ return new long[] {};
+ }
+
+ private static long gcd(long a, long b) {
+ while (b > 0) {
+ final long temp = b;
+ b = a % b; // % is remainder
+ a = temp;
+ }
+ return a;
+ }
+
+ private static long gcd(final long[] input) {
+ long result = input[0];
+ for (int i = 1; i < input.length; i++) {
+ result = gcd(result, input[i]);
+ }
+ return result;
+ }
+
+ public static final int getRgbAsHex(final short[] RGBA) {
+ final int returnValue = Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]);
+ return (returnValue == 0) ? 0 : returnValue;
+ }
+
+ public static final int returnLargestNumber(final int a, final int b) {
+ if (a > b) {
+ return a;
+ } else if (a == b) {
+ return a;
+ } else {
+ return b;
+ }
+ }
+
+ public static byte safeByte(long number) {
+ return number > Byte.MAX_VALUE ? Byte.MAX_VALUE : (byte) number;
+ }
+
+ public static short safeShort(long number) {
+ return number > Short.MAX_VALUE ? Short.MAX_VALUE : (short) number;
+ }
+
+ public static int safeInt(long number, int margin) {
+ return number > Integer.MAX_VALUE - margin ? Integer.MAX_VALUE - margin : (int) number;
+ }
+
+ public static int safeInt(long number) {
+ return number > GT_Values.V[GT_Values.V.length - 1]
+ ? safeInt(GT_Values.V[GT_Values.V.length - 1], 1)
+ : number < Integer.MIN_VALUE ? Integer.MIN_VALUE : (int) number;
+ }
+
+ public static int getRandomFromArray(int[] mValues) {
+ int[] mLargeChanceArray = new int[(mValues.length - 1) * 1000];
+ int mValueSelection;
+ for (int g = 0; g < mLargeChanceArray.length; g++) {
+ mValueSelection = randInt(0, mValues.length - 1);
+ mLargeChanceArray[g] = mValues[mValueSelection];
+ }
+ return mLargeChanceArray[randInt(0, mLargeChanceArray.length - 1)];
+ }
+
+ /*
+ * Averages
+ */
+
+ public static byte getByteAverage(AutoMap<Byte> aDataSet) {
+ byte[] aNewSet = new byte[aDataSet.size()];
+ for (int u = 0; u < aDataSet.size(); u++) {
+ byte b = getSafeByte(aDataSet.get(u));
+ aNewSet[u] = b;
+ }
+ return getByteAverage(aNewSet);
+ }
+
+ public static short getShortAverage(AutoMap<Short> aDataSet) {
+ short[] aNewSet = new short[aDataSet.size()];
+ for (int u = 0; u < aDataSet.size(); u++) {
+ short b = getSafeShort(aDataSet.get(u));
+ aNewSet[u] = b;
+ }
+ return getShortAverage(aNewSet);
+ }
+
+ public static int getIntAverage(AutoMap<Integer> aDataSet) {
+ int[] aNewSet = new int[aDataSet.size()];
+ for (int u = 0; u < aDataSet.size(); u++) {
+ int b = getSafeInt(aDataSet.get(u));
+ aNewSet[u] = b;
+ }
+ return getIntAverage(aNewSet);
+ }
+
+ public static float getFloatAverage(AutoMap<Float> aDataSet) {
+ float[] aNewSet = new float[aDataSet.size()];
+ for (int u = 0; u < aDataSet.size(); u++) {
+ float b = getSafeFloat(aDataSet.get(u));
+ aNewSet[u] = b;
+ }
+ return getFloatAverage(aNewSet);
+ }
+
+ public static long getLongAverage(AutoMap<Long> aDataSet) {
+ long[] aNewSet = new long[aDataSet.size()];
+ for (int u = 0; u < aDataSet.size(); u++) {
+ long b = getSafeLong(aDataSet.get(u));
+ aNewSet[u] = b;
+ }
+ return getLongAverage(aNewSet);
+ }
+
+ public static double getDoubleAverage(AutoMap<Double> aDataSet) {
+ double[] aNewSet = new double[aDataSet.size()];
+ for (int u = 0; u < aDataSet.size(); u++) {
+ double b = getSafeDouble(aDataSet.get(u));
+ aNewSet[u] = b;
+ }
+ return getDoubleAverage(aNewSet);
+ }
+
+ public static byte getByteAverage(byte[] aDataSet) {
+ if (aDataSet.length <= 0) {
+ return 0;
+ }
+ int divisor = aDataSet.length;
+ byte total = 0;
+ for (byte i : aDataSet) {
+ total += i;
+ }
+ byte result = safeByte(total / divisor);
+ return result;
+ }
+
+ public static short getShortAverage(short[] aDataSet) {
+ if (aDataSet.length <= 0) {
+ return 0;
+ }
+ int divisor = aDataSet.length;
+ Logger.WARNING("Calculating Average Short. Divisor: " + divisor);
+ short total = 0;
+ for (short i : aDataSet) {
+ Logger.WARNING("Adding " + i);
+ total += i;
+ }
+ short result = safeShort((total / divisor));
+ Logger.WARNING("Average: " + result);
+ return result;
+ }
+
+ public static int getIntAverage(int[] aDataSet) {
+ if (aDataSet.length <= 0) {
+ return 0;
+ }
+ int divisor = aDataSet.length;
+ int total = 0;
+ for (int i : aDataSet) {
+ total += i;
+ }
+ int result = safeInt(total / divisor);
+ return result;
+ }
+
+ public static float getFloatAverage(float[] aDataSet) {
+ if (aDataSet.length <= 0) {
+ return 0;
+ }
+ int divisor = aDataSet.length;
+ float total = 0;
+ for (float i : aDataSet) {
+ total += i;
+ }
+ float result = (total / divisor);
+ return result;
+ }
+
+ public static long getLongAverage(long[] aDataSet) {
+ if (aDataSet.length <= 0) {
+ return 0;
+ }
+ int divisor = aDataSet.length;
+ long total = 0;
+ for (long i : aDataSet) {
+ total += i;
+ }
+ long result = (total / divisor);
+ return result;
+ }
+
+ public static double getDoubleAverage(double[] aDataSet) {
+ if (aDataSet.length <= 0) {
+ return 0;
+ }
+ int divisor = aDataSet.length;
+ double total = 0;
+ for (double i : aDataSet) {
+ total += i;
+ }
+ double result = (total / divisor);
+ return result;
+ }
+
+ public static int howManyPlaces(int aValueForGen) {
+ if (aValueForGen < 0) {
+ aValueForGen = makeNegative(aValueForGen);
+ }
+ String a = String.valueOf(aValueForGen);
+ return a.length();
+ }
+
+ /**
+ * Inverts the value, making Positives into Negatives and vice versa.
+ * @param aPositive - An int value, either positive or negative.
+ * @return - Inverted int Value.
+ */
+ public static int makeNegative(int aPositive) {
+ if (aPositive > 0) {
+ return -aPositive;
+ } else if (aPositive < 0) {
+ return +aPositive;
+ } else {
+ return 0;
+ }
+ }
+
+ public static <V> V safeCast(Object aNumberType) {
+ long a1;
+ double a2;
+ a1 = Long.parseLong(aNumberType.toString());
+ a2 = Double.parseDouble(aNumberType.toString());
+
+ if ((aNumberType.getClass() == byte.class) || (aNumberType instanceof Byte)) {
+ if (a1 >= Byte.MIN_VALUE && a1 <= Byte.MAX_VALUE) {
+ String s = "" + a1;
+ Byte s1 = Byte.valueOf(s);
+ return (V) s1;
+ }
+ } else if ((aNumberType.getClass() == short.class) || (aNumberType instanceof Short)) {
+ if (a1 >= Short.MIN_VALUE && a1 <= Short.MAX_VALUE) {
+ String s = "" + a1;
+ Short s1 = Short.valueOf(s);
+ return (V) s1;
+ }
+ } else if ((aNumberType.getClass() == int.class) || (aNumberType instanceof Integer)) {
+ if (a1 >= Integer.MIN_VALUE && a1 <= Integer.MAX_VALUE) {
+ String s = "" + a1;
+ Integer s1 = Integer.valueOf(s);
+ return (V) s1;
+ }
+ } else if ((aNumberType.getClass() == long.class) || (aNumberType instanceof Long)) {
+ if (a1 >= Long.MIN_VALUE && a1 <= Long.MAX_VALUE) {
+ String s = "" + a1;
+ Long s1 = Long.valueOf(s);
+ return (V) s1;
+ }
+ } else if ((aNumberType.getClass() == float.class) || (aNumberType instanceof Float)) {
+ if (a2 >= Float.MIN_VALUE && a2 <= Float.MAX_VALUE) {
+ String s = "" + a1;
+ Float s1 = Float.valueOf(s);
+ return (V) s1;
+ }
+ } else if ((aNumberType.getClass() == double.class) || (aNumberType instanceof Double)) {
+ if (a2 >= Double.MIN_VALUE && a2 <= Double.MAX_VALUE) {
+ String s = "" + a1;
+ Double s1 = Double.valueOf(s);
+ return (V) s1;
+ }
+ }
+
+ Integer o = 0;
+ return (V) o;
+ }
+
+ public static byte getSafeByte(Byte b) {
+ Byte a = safeCast(b);
+ return a.byteValue();
+ }
+
+ public static short getSafeShort(Short b) {
+ Short a = safeCast(b);
+ return a.shortValue();
+ }
+
+ public static int getSafeInt(Integer b) {
+ Integer a = safeCast(b);
+ return a.intValue();
+ }
+
+ public static long getSafeLong(Long b) {
+ Long a = safeCast(b);
+ return a.longValue();
+ }
+
+ public static float getSafeFloat(Float b) {
+ Float a = safeCast(b);
+ return a.floatValue();
+ }
+
+ public static double getSafeDouble(Double b) {
+ Double a = safeCast(b);
+ return a.doubleValue();
+ }
+
+ public static long safeCast_IntToLong(int o) {
+ long i = o;
+ return i;
+ }
+
+ public static int safeCast_LongToInt(long o) {
+ if (o > Integer.MAX_VALUE) {
+ return Integer.MAX_VALUE;
+ } else {
+ int i = (int) o;
+ return i;
+ }
+ }
+
+ public static short safeCast_IntToShort(int o) {
+ if (o > Short.MAX_VALUE) {
+ return Short.MAX_VALUE;
+ } else {
+ short i = (short) o;
+ return i;
+ }
+ }
+
+ public static int safeCast_ShortToInt(short o) {
+ int i = (int) o;
+ return i;
+ }
+
+ public static byte safeCast_ShortToByte(short o) {
+ if (o > Byte.MAX_VALUE) {
+ return Byte.MAX_VALUE;
+ } else {
+ byte i = (byte) o;
+ return i;
+ }
+ }
+
+ public static short safeCast_ByteToshort(byte o) {
+ short i = (short) o;
+ return i;
+ }
+
+ /**
+ * Balances a number within a range.
+ * @param aInput - The number to balance
+ * @param aMin - The minimum bounds
+ * @param aMax - The maximum bounds
+ * @return - An Integer which will be between the bounds, or a boundary value.
+ */
+ public static int balance(int aInput, int aMin, int aMax) {
+ return Math.max(Math.min(aInput, aMax), aMin);
+ }
+
+ /**
+ * Balances a number within a range.
+ * @param aInput - The number to balance
+ * @param aMin - The minimum bounds
+ * @param aMax - The maximum bounds
+ * @return - A Number which will be between the bounds, or a boundary value.
+ */
+ public static Number balance(Number aInput, Number aMin, Number aMax) {
+ return max(min(aInput, aMax), aMin);
+ }
+
+ /**
+ * Balances a number within a range.
+ * @param aInput - The number to balance
+ * @param aMin - The minimum bounds
+ * @param aMax - The maximum bounds
+ * @return - An Integer which will be between the bounds, or a boundary value.
+ */
+ public static int balanceInt(Number aInput, Number aMin, Number aMax) {
+ return MathUtils.safeCast_LongToInt(
+ (long) balance(max(min(aInput, aMax), aMin), Integer.MIN_VALUE, Integer.MAX_VALUE));
+ }
+
+ /**
+ * Balances a number within a range.
+ * @param aInput - The number to balance
+ * @param aMin - The minimum bounds
+ * @param aMax - The maximum bounds
+ * @return - A Long which will be between the bounds, or a boundary value.
+ */
+ public static long balanceLong(Number aInput, Number aMin, Number aMax) {
+ return (long) balance(max(min(aInput, aMax), aMin), Long.MIN_VALUE, Long.MAX_VALUE);
+ }
+
+ public static int getValueWithinRange(int i, int aMin, int aMax) {
+ int aAmount = Math.max(Math.min(i, aMax), aMin);
+ return aAmount;
+ }
+
+ public static Pair<Integer, Integer> splitLongIntoIntegers(long aLong) {
+ int aIntMaxInLong = (int) Math.min(Integer.MAX_VALUE, Math.floor(aLong / Integer.MAX_VALUE));
+ int aRemainder = (int) (aLong - (aIntMaxInLong * Integer.MAX_VALUE));
+ return new Pair<Integer, Integer>(aIntMaxInLong, aRemainder);
+ }
+
+ /**
+ * Returns the smaller of two {@code Number}s. That is,
+ * the result the argument closer to the value of
+ * {@link Long#MIN_VALUE}. If the arguments have the same
+ * value, the result is that same value.
+ *
+ * @param a an argument.
+ * @param b another argument.
+ * @return the smaller of {@code a} and {@code b}.
+ */
+ public static Number min(Number a, Number b) {
+ return (a.longValue() <= b.longValue()) ? a : b;
+ }
+
+ /**
+ * Returns the greater of two {@code Number}s. That is, the
+ * result is the argument closer to the value of
+ * {@link Long#MAX_VALUE}. If the arguments have the same value,
+ * the result is that same value.
+ *
+ * @param a an argument.
+ * @param b another argument.
+ * @return the larger of {@code a} and {@code b}.
+ */
+ public static Number max(Number a, Number b) {
+ return (a.longValue() >= b.longValue()) ? a : b;
+ }
+
+ public static long combineTwoIntegersToLong(int a, int b) {
+ long val = (((long) a) << 32) | (b & 0xffffffffL);
+ return val;
+ }
+
+ public static int[] splitLongIntoTwoIntegers(long aNum) {
+ int a = (int) (aNum >> 32);
+ int b = (int) aNum;
+ return new int[] {a, b};
+ }
+
+ public static String formatNumbers(long aNumber) {
+ return sNumberFormat.format(aNumber);
+ }
+
+ public static String formatNumbers(double aNumber) {
+ return sNumberFormat.format(aNumber);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ClientUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ClientUtils.java
index 806f83d830..ce14c07489 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/ClientUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/ClientUtils.java
@@ -7,12 +7,11 @@ import gtPlusPlus.core.lib.CORE;
public class ClientUtils {
- static {
- if (FMLCommonHandler.instance().getSide() == Side.SERVER) {
- Logger.ERROR("Something tried to access the ClientUtils class from the Server Side.");
- Logger.ERROR("Soft crashing to prevent data corruption.");
- CORE.crash();
- }
- }
-
+ static {
+ if (FMLCommonHandler.instance().getSide() == Side.SERVER) {
+ Logger.ERROR("Something tried to access the ClientUtils class from the Server Side.");
+ Logger.ERROR("Soft crashing to prevent data corruption.");
+ CORE.crash();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/EnchantingUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/EnchantingUtils.java
index 2f273d5f7f..3871d11941 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/EnchantingUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/EnchantingUtils.java
@@ -6,97 +6,84 @@ import net.minecraftforge.fluids.FluidStack;
public class EnchantingUtils {
-
- public static final int XP_PER_BOTTLE = 8;
- public static final int RATIO = 20;
- public static final int LIQUID_PER_XP_BOTTLE = 160;
- public static final double RATIO_MOB_ESSENCE_TO_LIQUID_XP = 13.32;
-
- public static int liquidToXpRatio(final int liquid) {
- return liquid / RATIO;
- }
-
- public static int xpToLiquidRatio(final int xp) {
- return xp * RATIO;
- }
-
- public static FluidStack getEssenceFromLiquidXp(final int xpAmount){
- if (xpAmount <= 0){
- return null;
- }
- return getMobEssence((int) (xpAmount*RATIO_MOB_ESSENCE_TO_LIQUID_XP));
- }
-
- public static FluidStack getLiquidXpFromEssence(final int essenceAmount){
- if (essenceAmount <= 0){
- return null;
- }
- return getLiquidXP((int) (essenceAmount/RATIO_MOB_ESSENCE_TO_LIQUID_XP));
- }
-
- public static int getLiquidForLevel(final int level) {
- final int xp = getExperienceForLevel(level);
- return xpToLiquidRatio(xp);
- }
-
- public static int getLevelForLiquid(final int liquid) {
- final int xp = liquidToXpRatio(liquid);
- return getLevelForExperience(xp);
- }
-
- public static int getExperienceForLevel(final int level) {
- if (level == 0) {
- return 0;
- }
- if ((level > 0) && (level < 16)) {
- return level * 17;
- }
- if ((level > 15) && (level < 31)) {
- return (int) (((1.5 * Math.pow(level, 2.0)) - (29.5 * level)) + 360.0);
- }
- return (int) (((3.5 * Math.pow(level, 2.0)) - (151.5 * level)) + 2220.0);
- }
-
- public static int getXpToNextLevel(final int level) {
- final int levelXP = getLevelForExperience(level);
- final int nextXP = getExperienceForLevel(level + 1);
- return nextXP - levelXP;
- }
-
- public static int getLevelForExperience(final int experience) {
- int i;
- for (i = 0; getExperienceForLevel(i) <= experience; ++i) {
- }
- return i - 1;
- }
-
-
-
-
-
-
-
- //Xp Fluids
- public static FluidStack getMobEssence(final int amount){
- Logger.WARNING("Trying to get a fluid stack of Mob Essence.");
- try {
- return FluidRegistry.getFluidStack("mobessence", amount).copy();
- }
- catch (final Throwable e){
- return null;
- }
-
- }
-
- public static FluidStack getLiquidXP(final int amount){
- Logger.WARNING("Trying to get a fluid stack of Liquid XP.");
- try {
- return FluidRegistry.getFluidStack("xpjuice", amount).copy();
- }
- catch (final Throwable e){
- return null;
- }
-
- }
-
+ public static final int XP_PER_BOTTLE = 8;
+ public static final int RATIO = 20;
+ public static final int LIQUID_PER_XP_BOTTLE = 160;
+ public static final double RATIO_MOB_ESSENCE_TO_LIQUID_XP = 13.32;
+
+ public static int liquidToXpRatio(final int liquid) {
+ return liquid / RATIO;
+ }
+
+ public static int xpToLiquidRatio(final int xp) {
+ return xp * RATIO;
+ }
+
+ public static FluidStack getEssenceFromLiquidXp(final int xpAmount) {
+ if (xpAmount <= 0) {
+ return null;
+ }
+ return getMobEssence((int) (xpAmount * RATIO_MOB_ESSENCE_TO_LIQUID_XP));
+ }
+
+ public static FluidStack getLiquidXpFromEssence(final int essenceAmount) {
+ if (essenceAmount <= 0) {
+ return null;
+ }
+ return getLiquidXP((int) (essenceAmount / RATIO_MOB_ESSENCE_TO_LIQUID_XP));
+ }
+
+ public static int getLiquidForLevel(final int level) {
+ final int xp = getExperienceForLevel(level);
+ return xpToLiquidRatio(xp);
+ }
+
+ public static int getLevelForLiquid(final int liquid) {
+ final int xp = liquidToXpRatio(liquid);
+ return getLevelForExperience(xp);
+ }
+
+ public static int getExperienceForLevel(final int level) {
+ if (level == 0) {
+ return 0;
+ }
+ if ((level > 0) && (level < 16)) {
+ return level * 17;
+ }
+ if ((level > 15) && (level < 31)) {
+ return (int) (((1.5 * Math.pow(level, 2.0)) - (29.5 * level)) + 360.0);
+ }
+ return (int) (((3.5 * Math.pow(level, 2.0)) - (151.5 * level)) + 2220.0);
+ }
+
+ public static int getXpToNextLevel(final int level) {
+ final int levelXP = getLevelForExperience(level);
+ final int nextXP = getExperienceForLevel(level + 1);
+ return nextXP - levelXP;
+ }
+
+ public static int getLevelForExperience(final int experience) {
+ int i;
+ for (i = 0; getExperienceForLevel(i) <= experience; ++i) {}
+ return i - 1;
+ }
+
+ // Xp Fluids
+ public static FluidStack getMobEssence(final int amount) {
+ Logger.WARNING("Trying to get a fluid stack of Mob Essence.");
+ try {
+ return FluidRegistry.getFluidStack("mobessence", amount).copy();
+ } catch (final Throwable e) {
+ return null;
+ }
+ }
+
+ public static FluidStack getLiquidXP(final int amount) {
+ Logger.WARNING("Trying to get a fluid stack of Liquid XP.");
+ try {
+ return FluidRegistry.getFluidStack("xpjuice", amount).copy();
+ } catch (final Throwable e) {
+ return null;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/EnergyUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/EnergyUtils.java
index 8b02ea9c7c..207faeefce 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/EnergyUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/EnergyUtils.java
@@ -9,126 +9,115 @@ import net.minecraft.item.ItemStack;
public class EnergyUtils {
- public static class EU {
-
- public static boolean isElectricItem(ItemStack aStack) {
- if (aStack == null || aStack.getItem() == null || aStack.getItem() instanceof ItemRedstone) {
- return false;
- }
- if (aStack.getItem() instanceof ISpecialElectricItem) {
- return true;
- }
- else if (aStack.getItem() instanceof IElectricItem) {
- return true;
- }
- else if (aStack.getItem() instanceof IElectricItemManager) {
- return true;
- }
- else {
- return GT_ModHandler.isElectricItem(aStack);
- }
- }
-
- public static boolean isChargerItem(ItemStack aStack) {
- return GT_ModHandler.isChargerItem(aStack);
- }
-
- public static boolean charge(ItemStack aStack, int aEnergyToInsert, int aTier) {
- return 0 != GT_ModHandler.chargeElectricItem(aStack, aEnergyToInsert, aTier, true, false);
- }
-
- public static boolean discharge(ItemStack aStack, int aEnergyToDrain, int aTier) {
- if (isElectricItem(aStack)) {
- int tTier = ((IElectricItem) aStack.getItem()).getTier(aStack);
- int aDischargeValue = GT_ModHandler.dischargeElectricItem(aStack, aEnergyToDrain, tTier, true, false, false);
- //Logger.INFO("Trying to drain "+aDischargeValue);
- return aDischargeValue > 0;
- }
- else {
- return false;
- }
- }
-
- public static long getMaxStorage(ItemStack aStack) {
- if (isElectricItem(aStack)) {
- if (aStack.getItem() instanceof ISpecialElectricItem) {
- ISpecialElectricItem bStack = (ISpecialElectricItem) aStack.getItem();
- return (long) bStack.getMaxCharge(aStack);
- }
- if (aStack.getItem() instanceof IElectricItem) {
- IElectricItem bStack = (IElectricItem) aStack.getItem();
- return (long) bStack.getMaxCharge(aStack);
- }
- if (aStack.getItem() instanceof IElectricItemManager) {
- IElectricItemManager bStack = (IElectricItemManager) aStack.getItem();
- return (long) bStack.getCharge(aStack);
- }
- }
- else {
- return 0;
- }
- return 0;
- }
-
- public static long getCharge(ItemStack aStack) {
- if (isElectricItem(aStack)) {
- if (aStack.getItem() instanceof ISpecialElectricItem) {
- ISpecialElectricItem bStack = (ISpecialElectricItem) aStack.getItem();
- return (long) bStack.getManager(aStack).getCharge(aStack);
- }
- if (aStack.getItem() instanceof IElectricItemManager) {
- IElectricItemManager bStack = (IElectricItemManager) aStack.getItem();
- return (long) bStack.getCharge(aStack);
- }
- }
- else {
- return 0;
- }
- return 0;
- }
-
- public static boolean hasCharge(ItemStack aStack) {
- if (isElectricItem(aStack)) {
- if (aStack.getItem() instanceof ISpecialElectricItem) {
- ISpecialElectricItem bStack = (ISpecialElectricItem) aStack.getItem();
- return bStack.canProvideEnergy(aStack);
- }
- if (aStack.getItem() instanceof IElectricItem) {
- IElectricItem bStack = (IElectricItem) aStack.getItem();
- return bStack.canProvideEnergy(aStack);
- }
- if (aStack.getItem() instanceof IElectricItemManager) {
- IElectricItemManager bStack = (IElectricItemManager) aStack.getItem();
- return bStack.getCharge(aStack) > 0;
- }
- }
- else {
- return false;
- }
- return false;
- }
-
- public static int getTier(ItemStack aStack) {
- if (isElectricItem(aStack)) {
- if (aStack.getItem() instanceof ISpecialElectricItem) {
- ISpecialElectricItem bStack = (ISpecialElectricItem) aStack.getItem();
- return bStack.getTier(aStack);
- }
- if (aStack.getItem() instanceof IElectricItem) {
- IElectricItem bStack = (IElectricItem) aStack.getItem();
- return bStack.getTier(aStack);
- }
- }
- else {
- return 0;
- }
- return 0;
- }
-
- }
-
- public static class RF {
-
- }
-
+ public static class EU {
+
+ public static boolean isElectricItem(ItemStack aStack) {
+ if (aStack == null || aStack.getItem() == null || aStack.getItem() instanceof ItemRedstone) {
+ return false;
+ }
+ if (aStack.getItem() instanceof ISpecialElectricItem) {
+ return true;
+ } else if (aStack.getItem() instanceof IElectricItem) {
+ return true;
+ } else if (aStack.getItem() instanceof IElectricItemManager) {
+ return true;
+ } else {
+ return GT_ModHandler.isElectricItem(aStack);
+ }
+ }
+
+ public static boolean isChargerItem(ItemStack aStack) {
+ return GT_ModHandler.isChargerItem(aStack);
+ }
+
+ public static boolean charge(ItemStack aStack, int aEnergyToInsert, int aTier) {
+ return 0 != GT_ModHandler.chargeElectricItem(aStack, aEnergyToInsert, aTier, true, false);
+ }
+
+ public static boolean discharge(ItemStack aStack, int aEnergyToDrain, int aTier) {
+ if (isElectricItem(aStack)) {
+ int tTier = ((IElectricItem) aStack.getItem()).getTier(aStack);
+ int aDischargeValue =
+ GT_ModHandler.dischargeElectricItem(aStack, aEnergyToDrain, tTier, true, false, false);
+ // Logger.INFO("Trying to drain "+aDischargeValue);
+ return aDischargeValue > 0;
+ } else {
+ return false;
+ }
+ }
+
+ public static long getMaxStorage(ItemStack aStack) {
+ if (isElectricItem(aStack)) {
+ if (aStack.getItem() instanceof ISpecialElectricItem) {
+ ISpecialElectricItem bStack = (ISpecialElectricItem) aStack.getItem();
+ return (long) bStack.getMaxCharge(aStack);
+ }
+ if (aStack.getItem() instanceof IElectricItem) {
+ IElectricItem bStack = (IElectricItem) aStack.getItem();
+ return (long) bStack.getMaxCharge(aStack);
+ }
+ if (aStack.getItem() instanceof IElectricItemManager) {
+ IElectricItemManager bStack = (IElectricItemManager) aStack.getItem();
+ return (long) bStack.getCharge(aStack);
+ }
+ } else {
+ return 0;
+ }
+ return 0;
+ }
+
+ public static long getCharge(ItemStack aStack) {
+ if (isElectricItem(aStack)) {
+ if (aStack.getItem() instanceof ISpecialElectricItem) {
+ ISpecialElectricItem bStack = (ISpecialElectricItem) aStack.getItem();
+ return (long) bStack.getManager(aStack).getCharge(aStack);
+ }
+ if (aStack.getItem() instanceof IElectricItemManager) {
+ IElectricItemManager bStack = (IElectricItemManager) aStack.getItem();
+ return (long) bStack.getCharge(aStack);
+ }
+ } else {
+ return 0;
+ }
+ return 0;
+ }
+
+ public static boolean hasCharge(ItemStack aStack) {
+ if (isElectricItem(aStack)) {
+ if (aStack.getItem() instanceof ISpecialElectricItem) {
+ ISpecialElectricItem bStack = (ISpecialElectricItem) aStack.getItem();
+ return bStack.canProvideEnergy(aStack);
+ }
+ if (aStack.getItem() instanceof IElectricItem) {
+ IElectricItem bStack = (IElectricItem) aStack.getItem();
+ return bStack.canProvideEnergy(aStack);
+ }
+ if (aStack.getItem() instanceof IElectricItemManager) {
+ IElectricItemManager bStack = (IElectricItemManager) aStack.getItem();
+ return bStack.getCharge(aStack) > 0;
+ }
+ } else {
+ return false;
+ }
+ return false;
+ }
+
+ public static int getTier(ItemStack aStack) {
+ if (isElectricItem(aStack)) {
+ if (aStack.getItem() instanceof ISpecialElectricItem) {
+ ISpecialElectricItem bStack = (ISpecialElectricItem) aStack.getItem();
+ return bStack.getTier(aStack);
+ }
+ if (aStack.getItem() instanceof IElectricItem) {
+ IElectricItem bStack = (IElectricItem) aStack.getItem();
+ return bStack.getTier(aStack);
+ }
+ } else {
+ return 0;
+ }
+ return 0;
+ }
+ }
+
+ public static class RF {}
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/EntityUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/EntityUtils.java
index fda7b0b738..9c6fab90cd 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/EntityUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/EntityUtils.java
@@ -1,11 +1,5 @@
package gtPlusPlus.core.util.minecraft;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-
import cpw.mods.fml.common.registry.EntityRegistry;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -15,6 +9,11 @@ import gtPlusPlus.core.handler.events.EntityDeathHandler;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import ic2.core.IC2Potion;
import ic2.core.item.armor.ItemArmorHazmat;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.entity.*;
import net.minecraft.entity.player.EntityPlayer;
@@ -28,93 +27,99 @@ import net.minecraft.world.biome.BiomeGenBase;
public class EntityUtils {
- public static void setEntityOnFire(final Entity aEntity, final int length){
- if (!isEntityImmuneToFire(aEntity)) {
- aEntity.setFire(length);
- }
- }
-
- public static boolean isEntityOnFire(final Entity aEntity) {
- Field aIsOnFire = ReflectionUtils.getField(Entity.class, "fire");
- if (aIsOnFire != null) {
- int aFireTime = (int) ReflectionUtils.getFieldValue(aIsOnFire, aEntity);
- return aFireTime > 0;
- }
- return false;
- }
-
- public static boolean isEntityImmuneToFire(Entity aEntity) {
- return aEntity.isImmuneToFire();
- }
+ public static void setEntityOnFire(final Entity aEntity, final int length) {
+ if (!isEntityImmuneToFire(aEntity)) {
+ aEntity.setFire(length);
+ }
+ }
- public static int getFacingDirection(final Entity entity){
- final int d = MathHelper.floor_double((entity.rotationYaw * 4.0F) / 360 + 0.50) & 3;
- return d;
- }
+ public static boolean isEntityOnFire(final Entity aEntity) {
+ Field aIsOnFire = ReflectionUtils.getField(Entity.class, "fire");
+ if (aIsOnFire != null) {
+ int aFireTime = (int) ReflectionUtils.getFieldValue(aIsOnFire, aEntity);
+ return aFireTime > 0;
+ }
+ return false;
+ }
- @Deprecated
- public static Block findBlockUnderEntityNonBoundingBox(final Entity parEntity){
- final int blockX = MathHelper.floor_double(parEntity.posX);
- final int blockY = MathHelper.floor_double(parEntity.posY-0.2D - parEntity.yOffset);
- final int blockZ = MathHelper.floor_double(parEntity.posZ);
- return parEntity.worldObj.getBlock(blockX, blockY, blockZ);
- }
+ public static boolean isEntityImmuneToFire(Entity aEntity) {
+ return aEntity.isImmuneToFire();
+ }
- public static Block findBlockUnderEntity(final Entity parEntity){
- final int blockX = MathHelper.floor_double(parEntity.posX);
- final int blockY = MathHelper.floor_double(parEntity.boundingBox.minY)-1;
- final int blockZ = MathHelper.floor_double(parEntity.posZ);
- return parEntity.worldObj.getBlock(blockX, blockY, blockZ);
- }
+ public static int getFacingDirection(final Entity entity) {
+ final int d = MathHelper.floor_double((entity.rotationYaw * 4.0F) / 360 + 0.50) & 3;
+ return d;
+ }
- public static BlockPos findBlockPosUnderEntity(final Entity parEntity){
- final int blockX = MathHelper.floor_double(parEntity.posX);
- final int blockY = MathHelper.floor_double(parEntity.boundingBox.minY)-1;
- final int blockZ = MathHelper.floor_double(parEntity.posZ);
- return new BlockPos(blockX, blockY, blockZ, parEntity.worldObj);
- }
-
- public static BlockPos findBlockPosOfEntity(final Entity parEntity){
- final int blockX = MathHelper.floor_double(parEntity.posX);
- final int blockY = MathHelper.floor_double(parEntity.boundingBox.minY);
- final int blockZ = MathHelper.floor_double(parEntity.posZ);
- return new BlockPos(blockX, blockY, blockZ, parEntity.worldObj);
- }
+ @Deprecated
+ public static Block findBlockUnderEntityNonBoundingBox(final Entity parEntity) {
+ final int blockX = MathHelper.floor_double(parEntity.posX);
+ final int blockY = MathHelper.floor_double(parEntity.posY - 0.2D - parEntity.yOffset);
+ final int blockZ = MathHelper.floor_double(parEntity.posZ);
+ return parEntity.worldObj.getBlock(blockX, blockY, blockZ);
+ }
- //TODO
- public static void registerEntityToBiomeSpawns(final Class<EntityLiving> classy, final EnumCreatureType EntityType, final BiomeGenBase baseBiomeGen){
- EntityRegistry.addSpawn(classy, 6, 1, 5, EntityType, baseBiomeGen); //change the values to vary the spawn rarity, biome, etc.
- }
+ public static Block findBlockUnderEntity(final Entity parEntity) {
+ final int blockX = MathHelper.floor_double(parEntity.posX);
+ final int blockY = MathHelper.floor_double(parEntity.boundingBox.minY) - 1;
+ final int blockZ = MathHelper.floor_double(parEntity.posZ);
+ return parEntity.worldObj.getBlock(blockX, blockY, blockZ);
+ }
+
+ public static BlockPos findBlockPosUnderEntity(final Entity parEntity) {
+ final int blockX = MathHelper.floor_double(parEntity.posX);
+ final int blockY = MathHelper.floor_double(parEntity.boundingBox.minY) - 1;
+ final int blockZ = MathHelper.floor_double(parEntity.posZ);
+ return new BlockPos(blockX, blockY, blockZ, parEntity.worldObj);
+ }
+
+ public static BlockPos findBlockPosOfEntity(final Entity parEntity) {
+ final int blockX = MathHelper.floor_double(parEntity.posX);
+ final int blockY = MathHelper.floor_double(parEntity.boundingBox.minY);
+ final int blockZ = MathHelper.floor_double(parEntity.posZ);
+ return new BlockPos(blockX, blockY, blockZ, parEntity.worldObj);
+ }
+
+ // TODO
+ public static void registerEntityToBiomeSpawns(
+ final Class<EntityLiving> classy, final EnumCreatureType EntityType, final BiomeGenBase baseBiomeGen) {
+ EntityRegistry.addSpawn(
+ classy, 6, 1, 5, EntityType, baseBiomeGen); // change the values to vary the spawn rarity, biome, etc.
+ }
+
+ public static boolean applyRadiationDamageToEntity(
+ final int stackSize, final int radiationLevel, final World world, final Entity entityHolding) {
+ if (!world.isRemote) {
+ if ((radiationLevel > 0) && (entityHolding instanceof EntityLivingBase)) {
+ final EntityLivingBase entityLiving = (EntityLivingBase) entityHolding;
+ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode) {
+ if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving)
+ && !GT_Utility.isWearingFullRadioHazmat(entityLiving)) {
+ int duration;
+ if (entityLiving.getActivePotionEffect(IC2Potion.radiation) != null) {
+ // Utils.LOG_INFO("t");
+ duration = (radiationLevel * 5)
+ + entityLiving
+ .getActivePotionEffect(IC2Potion.radiation)
+ .getDuration();
+ } else {
+ // Utils.LOG_INFO("f");
+ duration = radiationLevel * 30;
+ }
+ // IC2Potion.radiation.applyTo(entityLiving, duration, damage * 15);
+ applyRadioactivity(entityLiving, radiationLevel, stackSize);
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
- public static boolean applyRadiationDamageToEntity(final int stackSize, final int radiationLevel, final World world, final Entity entityHolding){
- if (!world.isRemote){
- if ((radiationLevel > 0) && (entityHolding instanceof EntityLivingBase)) {
- final EntityLivingBase entityLiving = (EntityLivingBase) entityHolding;
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving) && !GT_Utility.isWearingFullRadioHazmat(entityLiving)) {
- int duration;
- if (entityLiving.getActivePotionEffect(IC2Potion.radiation) != null){
- //Utils.LOG_INFO("t");
- duration = (radiationLevel*5)+entityLiving.getActivePotionEffect(IC2Potion.radiation).getDuration();
- }
- else {
- //Utils.LOG_INFO("f");
- duration = radiationLevel*30;
- }
- //IC2Potion.radiation.applyTo(entityLiving, duration, damage * 15);
- applyRadioactivity(entityLiving, radiationLevel, stackSize);
- }
- }
- }
- return true;
- }
- return false;
- }
-
public static boolean isWearingFullFrostHazmat(EntityLivingBase aEntity) {
for (byte i = 1; i < 5; i++)
if (!HazmatUtils.providesProtetion_Frost(aEntity.getEquipmentInSlot(i))) {
- return false;
+ return false;
}
return true;
}
@@ -122,7 +127,7 @@ public class EntityUtils {
public static boolean isWearingFullHeatHazmat(EntityLivingBase aEntity) {
for (byte i = 1; i < 5; i++)
if (!HazmatUtils.providesProtetion_Fire(aEntity.getEquipmentInSlot(i))) {
- return false;
+ return false;
}
return true;
}
@@ -130,7 +135,7 @@ public class EntityUtils {
public static boolean isWearingFullBioHazmat(EntityLivingBase aEntity) {
for (byte i = 1; i < 5; i++)
if (!HazmatUtils.providesProtetion_Biohazard(aEntity.getEquipmentInSlot(i))) {
- return false;
+ return false;
}
return true;
}
@@ -138,7 +143,7 @@ public class EntityUtils {
public static boolean isWearingFullRadioHazmat(EntityLivingBase aEntity) {
for (byte i = 1; i < 5; i++)
if (!HazmatUtils.providesProtetion_Radiation(aEntity.getEquipmentInSlot(i))) {
- return false;
+ return false;
}
return true;
}
@@ -146,7 +151,7 @@ public class EntityUtils {
public static boolean isWearingFullElectroHazmat(EntityLivingBase aEntity) {
for (byte i = 1; i < 5; i++)
if (!HazmatUtils.providesProtetion_Electricity(aEntity.getEquipmentInSlot(i))) {
- return false;
+ return false;
}
return true;
}
@@ -154,137 +159,186 @@ public class EntityUtils {
public static boolean isWearingFullGasHazmat(EntityLivingBase aEntity) {
for (byte i = 1; i < 5; i++)
if (!HazmatUtils.providesProtetion_Gas(aEntity.getEquipmentInSlot(i))) {
- return false;
+ return false;
}
return true;
}
-
+
public static boolean applyRadioactivity(EntityLivingBase aEntity, int aLevel, int aAmountOfItems) {
- if (aLevel > 0 && aEntity != null && aEntity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD && aEntity.getCreatureAttribute() != EnumCreatureAttribute.ARTHROPOD && !ItemArmorHazmat.hasCompleteHazmat(aEntity)) {
+ if (aLevel > 0
+ && aEntity != null
+ && aEntity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD
+ && aEntity.getCreatureAttribute() != EnumCreatureAttribute.ARTHROPOD
+ && !ItemArmorHazmat.hasCompleteHazmat(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(IC2Potion.radiation.id, aLevel * 180 * aAmountOfItems + Math.max(0, ((tEffect = aEntity.getActivePotionEffect(Potion.potionTypes[24])) == null ? 0 : tEffect.getDuration())), Math.max(0, (5 * aLevel) / 7)));
+ 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(
+ IC2Potion.radiation.id,
+ aLevel * 180 * aAmountOfItems
+ + Math.max(
+ 0,
+ ((tEffect = aEntity.getActivePotionEffect(Potion.potionTypes[24])) == null
+ ? 0
+ : tEffect.getDuration())),
+ Math.max(0, (5 * aLevel) / 7)));
return true;
}
return false;
}
- public static boolean applyHeatDamageToEntity(final int heatLevel, final World world, final Entity entityHolding){
- if (!world.isRemote){
- if ((heatLevel > 0) && (entityHolding instanceof EntityLivingBase)) {
- final EntityLivingBase entityLiving = (EntityLivingBase) entityHolding;
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- if (!GT_Utility.isWearingFullHeatHazmat(entityLiving)) {
- return GT_Utility.applyHeatDamage(entityLiving, heatLevel);
- }
- }
- }
- }
- return false;
- }
+ public static boolean applyHeatDamageToEntity(final int heatLevel, final World world, final Entity entityHolding) {
+ if (!world.isRemote) {
+ if ((heatLevel > 0) && (entityHolding instanceof EntityLivingBase)) {
+ final EntityLivingBase entityLiving = (EntityLivingBase) entityHolding;
+ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode) {
+ if (!GT_Utility.isWearingFullHeatHazmat(entityLiving)) {
+ return GT_Utility.applyHeatDamage(entityLiving, heatLevel);
+ }
+ }
+ }
+ }
+ return false;
+ }
+ /**
+ * Static Version of the method used in {@code doFireDamage(entity, int)} to save memory.
+ */
+ private static volatile Method dealFireDamage = null;
- /**
- * Static Version of the method used in {@code doFireDamage(entity, int)} to save memory.
- */
- private volatile static Method dealFireDamage = null;
+ /**
+ * Reflective Call to do Fire Damage to an entity (Does not set entity on fire though)
+ */
+ public static synchronized boolean doFireDamage(Entity entity, int amount) {
+ if (dealFireDamage == null) {
+ dealFireDamage = ReflectionUtils.getMethod(Entity.class, "dealFireDamage", int.class);
+ } else {
+ try {
+ dealFireDamage.invoke(entity, amount);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+ return false;
+ }
- /**
- * Reflective Call to do Fire Damage to an entity (Does not set entity on fire though)
- */
- public synchronized static boolean doFireDamage(Entity entity, int amount){
- if (dealFireDamage == null){
- dealFireDamage = ReflectionUtils.getMethod(Entity.class, "dealFireDamage", int.class);
- }
- else {
- try {
- dealFireDamage.invoke(entity, amount);
- }
- catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
- }
- return false;
- }
+ public static void doDamage(Entity entity, DamageSource dmg, int i) {
+ entity.attackEntityFrom(dmg, i);
+ }
- public static void doDamage(Entity entity, DamageSource dmg, int i) {
- entity.attackEntityFrom(dmg, i);
- }
+ public static boolean isTileEntityRegistered(Class aTileClass, String aTileName) {
+ Field aRegistry = ReflectionUtils.getField(
+ ReflectionUtils.getClass("net.minecraft.tileentity.TileEntity"), "nameToClassMap");
+ Field aRegistry2 = ReflectionUtils.getField(
+ ReflectionUtils.getClass("net.minecraft.tileentity.TileEntity"), "classToNameMap");
+ try {
+ Object o = aRegistry.get(null);
+ if (o != null) {
+ Map nameToClassMap = (Map) o;
+ if (!nameToClassMap.containsKey(aTileName)) {
+ o = aRegistry2.get(null);
+ if (o != null) {
+ Map classToNameMap = (Map) o;
+ if (!classToNameMap.containsKey(aTileClass)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ } else {
+ return true;
+ }
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
- public static boolean isTileEntityRegistered(Class aTileClass, String aTileName) {
- Field aRegistry = ReflectionUtils.getField(ReflectionUtils.getClass("net.minecraft.tileentity.TileEntity"), "nameToClassMap");
- Field aRegistry2 = ReflectionUtils.getField(ReflectionUtils.getClass("net.minecraft.tileentity.TileEntity"), "classToNameMap");
- try {
- Object o = aRegistry.get(null);
- if (o != null) {
- Map nameToClassMap = (Map) o;
- if (!nameToClassMap.containsKey(aTileName)) {
- o = aRegistry2.get(null);
- if (o != null) {
- Map classToNameMap = (Map) o;
- if (!classToNameMap.containsKey(aTileClass)) {
- return false;
- }
- else {
- return true;
- }
- }
- }
- else {
- return true;
- }
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {
- e.printStackTrace();
- }
- return false;
- }
+ public static double getDistance(Entity p1, Entity p2) {
+ return Math.sqrt(
+ Math.pow(p1.posX - p2.posX, 2) + Math.pow(p1.posY - p2.posY, 2) + Math.pow(p1.posZ - p2.posZ, 2));
+ }
- public static double getDistance(Entity p1, Entity p2) {
- return Math.sqrt( Math.pow(p1.posX - p2.posX, 2) + Math.pow(p1.posY - p2.posY, 2) + Math.pow(p1.posZ - p2.posZ, 2));
- }
+ public static AutoMap<Entity> getEntitiesWithinBoundingBoxExcluding(Entity aExclusion, AABB aBoundingBox) {
+ if (aExclusion == null) {
+ return new AutoMap<Entity>();
+ } else {
+ List<Entity> aEntities =
+ aBoundingBox.world().getEntitiesWithinAABBExcludingEntity(aExclusion, aBoundingBox.get());
+ return new AutoMap<Entity>(aEntities);
+ }
+ }
- public static AutoMap<Entity> getEntitiesWithinBoundingBoxExcluding(Entity aExclusion, AABB aBoundingBox){
- if (aExclusion == null) {
- return new AutoMap<Entity>();
- }
- else {
- List<Entity> aEntities = aBoundingBox.world().getEntitiesWithinAABBExcludingEntity(aExclusion, aBoundingBox.get());
- return new AutoMap<Entity>(aEntities);
- }
- }
+ public static AutoMap<Entity> getEntitiesWithinBoundingBox(Class aEntityType, AABB aBoundingBox) {
+ if (aEntityType == null) {
+ return new AutoMap<Entity>();
+ } else {
+ List<Entity> aEntities = aBoundingBox.world().getEntitiesWithinAABB(aEntityType, aBoundingBox.get());
+ return new AutoMap<Entity>(aEntities);
+ }
+ }
- public static AutoMap<Entity> getEntitiesWithinBoundingBox(Class aEntityType, AABB aBoundingBox){
- if (aEntityType == null) {
- return new AutoMap<Entity>();
- }
- else {
- List<Entity> aEntities = aBoundingBox.world().getEntitiesWithinAABB(aEntityType, aBoundingBox.get());
- return new AutoMap<Entity>(aEntities);
- }
- }
-
- /**
- * Provides the ability to provide custom drops upon the death of EntityLivingBase objects. Simplified function with static Max drop size of 1.
- * @param aMobClass - The Base Class you want to drop this item.
- * @param aStack - The ItemStack, stack size is not respected.
- * @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
- */
- public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aChance) {
- registerDropsForMob(aMobClass, aStack, 1, aChance);
- }
-
- /**
- * Provides the ability to provide custom drops upon the death of EntityLivingBase objects.
- * @param aMobClass - The Base Class you want to drop this item.
- * @param aStack - The ItemStack, stack size is not respected.
- * @param aMaxAmount - The maximum size of the ItemStack which drops.
- * @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
- */
- public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aMaxAmount, int aChance) {
- EntityDeathHandler.registerDropsForMob(aMobClass, aStack, aMaxAmount, aChance);
- }
+ /**
+ * Provides the ability to provide custom drops upon the death of EntityLivingBase objects. Simplified function with static Max drop size of 1.
+ * @param aMobClass - The Base Class you want to drop this item.
+ * @param aStack - The ItemStack, stack size is not respected.
+ * @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
+ */
+ public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aChance) {
+ registerDropsForMob(aMobClass, aStack, 1, aChance);
+ }
+ /**
+ * Provides the ability to provide custom drops upon the death of EntityLivingBase objects.
+ * @param aMobClass - The Base Class you want to drop this item.
+ * @param aStack - The ItemStack, stack size is not respected.
+ * @param aMaxAmount - The maximum size of the ItemStack which drops.
+ * @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
+ */
+ public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aMaxAmount, int aChance) {
+ EntityDeathHandler.registerDropsForMob(aMobClass, aStack, aMaxAmount, aChance);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java
index fe190fa107..2125eff0e5 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/FluidUtils.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.util.minecraft;
-import java.util.HashMap;
-
import gregtech.api.enums.Dyes;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -16,6 +14,7 @@ import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import java.util.HashMap;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -26,643 +25,810 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
public class FluidUtils {
-
- private static HashMap<String, Fluid> sFluidCache = new HashMap<String, Fluid>();
-
- public static FluidStack getWater(final int amount){
- return FluidUtils.getFluidStack("water", amount);
- }
-
- public static FluidStack getDistilledWater(final int amount){
- return FluidUtils.getFluidStack("ic2distilledwater", amount);
- }
-
- public static FluidStack getHotWater(final int amount) {
- return FluidUtils.getFluidStack("ic2hotwater", amount);
- }
-
- public static FluidStack getLava(final int amount){
- return FluidUtils.getFluidStack("lava", amount);
- }
-
- public static FluidStack getPahoehoeLava(final int amount){
- return FluidUtils.getFluidStack("ic2pahoehoelava", amount);
- }
-
- public static FluidStack getMilk(final int amount){
- return FluidUtils.getFluidStack("milk", amount);
- }
-
- public static FluidStack getColdCoolant(final int amount){
- return FluidUtils.getFluidStack("ic2coolant", amount);
- }
-
- public static FluidStack getHotCoolant(final int amount){
- return FluidUtils.getFluidStack("ic2hotcoolant", amount);
- }
-
- public static FluidStack getSteam(final int amount){
- return FluidUtils.getFluidStack("steam", amount);
- }
-
- public static FluidStack getIC2Steam(final int amount){
- return FluidUtils.getFluidStack("ic2steam", amount);
- }
-
- public static FluidStack getSuperHeatedSteam(final int amount){
- return FluidUtils.getFluidStack("ic2superheatedsteam", amount);
- }
-
- @Deprecated
- /**
- * Do not use - Gives third tier steam - Not implemented
- * @param amount
- * @return
- */
- public static FluidStack getHyperSteam(final int amount){
- return FluidUtils.getFluidStack("water", amount);
- }
-
- public static FluidStack getUUA(final int amount){
- return FluidUtils.getFluidStack("uuamplifier", amount);
- }
-
- public static FluidStack getUUM(final int amount){
- return FluidUtils.getFluidStack("ic2uumatter", amount);
- }
-
- public static FluidStack getHydrofluoricAcid(int amount) {
- return FluidUtils.getFluidStack("hydrofluoricacid", amount);
- }
-
- public static Fluid sGregtechHydrofluoricAcid = null;
-
- public static FluidStack getHydrofluoricAcidGT(int amount) {
- if (sGregtechHydrofluoricAcid == null) {
- FluidStack aGTHF = FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 1);
- sGregtechHydrofluoricAcid = aGTHF != null ? aGTHF.getFluid() : getHydrofluoricAcid(1).getFluid();
- }
- return FluidUtils.getFluidStack(sGregtechHydrofluoricAcid, amount);
- }
-
- public static boolean doesHydrofluoricAcidGtExist() {
- if (sGregtechHydrofluoricAcid == null) {
- getHydrofluoricAcidGT(1);
- }
- return sGregtechHydrofluoricAcid != null && sGregtechHydrofluoricAcid != getHydrofluoricAcid(1).getFluid();
- }
-
- private static FluidStack createFluidStack(Fluid aFluid, int aAmount) {
- if (aFluid != null) {
- return new FluidStack(aFluid, aAmount);
- }
- return null;
- }
-
- public static FluidStack getFluidStack(final String aFluidName, final int aAmount){
- Fluid aFluid = sFluidCache.get(aFluidName);
- if (aFluid != null) {
- return createFluidStack(aFluid, aAmount);
- }
- else {
- Fluid aLookupFluid = FluidRegistry.getFluid(aFluidName);
- if (aLookupFluid != null) {
- sFluidCache.put(aFluidName, aLookupFluid);
- return createFluidStack(aLookupFluid, aAmount);
- }
- }
- return null;
- }
-
- public static FluidStack getFluidStack(final FluidStack aFluidStack, final int aAmount) {
- if (aFluidStack == null) {
- return null;
- }
- return new FluidStack(aFluidStack, aAmount);
- }
-
- public static FluidStack getFluidStack(final Fluid aFluid, final int aAmount) {
- if (aFluid == null) {
- return null;
- }
- return new FluidStack(aFluid, aAmount);
- }
-
- public static FluidStack[] getFluidStackArray(final String fluidName, final int amount){
- Logger.WARNING("Trying to get a fluid stack of "+fluidName);
- try {
- final FluidStack[] singleFluid = {getFluidStack(fluidName, amount)};
- return singleFluid;
- }
- catch (final Throwable e){
- return null;
- }
-
- }
-
- public static FluidStack[] getFluidStackArray(final FluidStack fluidName, final int amount){
- Logger.WARNING("Trying to get a fluid stack of "+fluidName);
- try {
- final FluidStack[] singleFluid = {getFluidStack(fluidName, amount)};
- return singleFluid;
- }
- catch (final Throwable e){
- return null;
- }
-
- }
-
- public static Fluid addGtFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
- return addGtFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, true);
- }
-
-
- public static Fluid addGtFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
- Fluid g = addGTFluid(aName, "fluid.autogenerated", aLocalized, aMaterial != null ? aMaterial.mRGBa : new short[]{255, 255, 255, 0}, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
- if (g != null) {
- if (aMaterial != null) {
- switch (aState) {
- case 1: {
- aMaterial.mFluid = (g);
- break;
- }
- case 2: {
- aMaterial.mGas = (g);
- break;
- }
- case 3: {
- aMaterial.mPlasma = (g);
- break;
- }
- }
- }
- return g;
- }
- return null;
- }
-
- public static Fluid addGTFluid(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
- return addGTFluid("molten."+aName, "molten.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
- }
-
- public static Fluid addGTFluidNonMolten(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
- return addGTFluid("fluid."+aName, "fluid.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
- }
-
- public static Fluid addGTFluidNoPrefix(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
- return addGTFluid(aName, "fluid.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
- }
- //Gass
- public static Fluid addGtGas(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
- return addGTFluid(aName, "fluid.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
- }
-
- public static Fluid addGTPlasma(final Material aMaterial) {
- if (aMaterial.getLocalizedName().toLowerCase().contains("clay") || (aMaterial.getComposites().size()>1) || aMaterial.getLocalizedName().toLowerCase().contains("wrought")){
- return null;
- }
- Logger.INFO("Generating a "+aMaterial.getLocalizedName()+" Plasma Cell");
- if (aMaterial.vComponentCount != 1){
- Logger.INFO("Compound made from: ");
- for (final MaterialStack x : aMaterial.getComposites()){
- Logger.INFO(x.getStackMaterial().getLocalizedName());
- }
- Logger.INFO("Material is a composite, not generating plasma.");
- return null;
- }
-
- ItemStack temp = null;
- //Generate a Cell if we need to
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellPlasma"+aMaterial.getUnlocalizedName(), 1) == null){
- new BaseItemPlasmaCell(aMaterial);
- temp = aMaterial.getPlasmaCell(1);
- }
- else {
- temp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellPlasma"+aMaterial.getUnlocalizedName(), 1);
- }
- if (temp != null){
- return addGTFluid(
- "plasma." + Utils.sanitizeString(aMaterial.getLocalizedName().toLowerCase()),
- "plasma.autogenerated",
- aMaterial.getLocalizedName() + " Plasma",
- aMaterial.getRGBA(),
- 3,
- 10000,
- temp,
- ItemUtils.getEmptyCell(),
- 1000,
- false);
- }
- return null;
- }
-
- public static Fluid addGTFluid(String aName, final String aTexture, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateFilledCell) {
-
- String aNameOriginal = aName;
- Logger.INFO("Generating Fluid for "+aName);
-
- aName = Utils.sanitizeString(aName.toLowerCase());
-
- String aLocalName = (aLocalized == null) ? aName : aLocalized;
-
- Fluid rFluid;
- Fluid gFluid = FluidRegistry.getFluid(aName);
- FluidStack aCheck = FluidUtils.getWildcardFluidStack(aName.toLowerCase(), 1000);
- boolean register = false;
- if (aCheck != null) {
- rFluid = aCheck.getFluid();
- }
- else if (gFluid != null) {
- rFluid = gFluid;
- }
- else {
- rFluid = new FluidGT6(aName, aTexture, (aRGBa != null) ? aRGBa : Dyes._NULL.getRGBA());
- register = true;
-
- }
-
- if (register) {
- GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalName);
- if (FluidRegistry.registerFluid(rFluid)) {
- switch (aState) {
- case 0: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(10000);
- break;
- }
- case 1:
- case 4: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(1000);
- break;
- }
- case 2: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-100);
- rFluid.setViscosity(200);
- break;
- }
- case 3: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-10000);
- rFluid.setViscosity(10);
- rFluid.setLuminosity(15);
- break;
- }
- }
- }
- }
-
-
- String aNameNonMolten = aLocalName.contains("Molten") ? aLocalName.replace("Molten", "") : aLocalName;
-
- if (aFullContainer == null) {
- ItemStack oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aLocalName, 1);
- aFullContainer = oreStack;
- if (aFullContainer == null) {
- oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aNameOriginal, 1);
- aFullContainer = oreStack;
- if (aFullContainer == null) {
- oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aNameNonMolten, 1);
- aFullContainer = oreStack;
- if (aFullContainer != null) {
- Logger.INFO("Found cell for "+aNameNonMolten);
- }
- }
- else {
- Logger.INFO("Found cell for "+aNameOriginal);
- }
- }
- else {
- Logger.INFO("Found cell for "+aLocalName);
- }
- }
-
- Item tempCell = null;
- //Generate a Cell if we need to
- if (aGenerateFilledCell && aFullContainer == null) {
- String aMatName = aNameOriginal;
- if (aMatName.contains("molten.")) {
- aMatName = aMatName.replace("molten.", "");
- aMatName = aMatName.substring(0, 1).toUpperCase() + aMatName.substring(1);
- }
- if (aMatName.contains("fluid.")) {
- aMatName = aMatName.replace("fluid.", "");
- aMatName = aMatName.substring(0, 1).toUpperCase() + aMatName.substring(1);
- }
- Logger.INFO("Generating cell for "+aMatName+", "+aLocalName);
- tempCell = new BaseItemComponent(aMatName, aLocalName, aRGBa);
- aFullContainer = ItemUtils.getSimpleStack(tempCell);
- }
-
- if ((rFluid.getTemperature() == new Fluid("test").getTemperature()) || (rFluid.getTemperature() <= 0)) {
- rFluid.setTemperature((int) (aTemperatureK));
- }
- if ((aFullContainer != null) && (aEmptyContainer != null) && !FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
- CORE.RA.addFluidCannerRecipe(CI.emptyCells(1), aFullContainer, new FluidStack(rFluid, aFluidAmount));
- }
- else {
- //Utils.LOG_INFO("Failed creating recipes to fill/empty cells of "+aName+".");
- }
- return rFluid;
- }
-
- public static boolean valid(final Object aStack) {
- return (aStack != null) && (aStack instanceof ItemStack) && (((ItemStack)aStack).getItem() != null) && (((ItemStack)aStack).stackSize >= 0);
- }
-
- public static boolean invalid(final Object aStack) {
- return (aStack == null) || !(aStack instanceof ItemStack) || (((ItemStack)aStack).getItem() == null) || (((ItemStack)aStack).stackSize < 0);
- }
-
- public static boolean equal(final ItemStack aStack1, final ItemStack aStack2) {
- return equal(aStack1, aStack2, false);
- }
-
- public static boolean equal(final ItemStack aStack1, final ItemStack aStack2, final boolean aIgnoreNBT) {
- return (aStack1 != null) && (aStack2 != null) && equal_(aStack1, aStack2, aIgnoreNBT);
- }
-
- public static boolean equal_(final ItemStack aStack1, final ItemStack aStack2, final boolean aIgnoreNBT) {
- return (aStack1.getItem() == aStack2.getItem()) && (aIgnoreNBT || ((aStack1.getTagCompound() == null == (aStack2.getTagCompound() == null)) && ((aStack1.getTagCompound() == null) || aStack1.getTagCompound().equals(aStack2.getTagCompound())))) && ((meta(aStack1) == meta(aStack2)) || (meta(aStack1) == 32767) || (meta(aStack2) == 32767));
- }
-
- public static ItemStack copy(final Object... aStacks) {
- for (final Object tStack : aStacks) {
- if (valid(tStack)) {
- return ((ItemStack)tStack).copy();
- }
- }
- return null;
- }
-
- public static ItemStack copyMeta(final long aMetaData, final Object... aStacks) {
- final ItemStack rStack = copy(aStacks);
- if (invalid(rStack)) {
- return null;
- }
- return meta(rStack, aMetaData);
- }
-
- public static short meta(final ItemStack aStack) {
- return (short)Items.feather.getDamage(aStack);
- }
-
- public static ItemStack meta(final ItemStack aStack, final long aMeta) {
- Items.feather.setDamage(aStack, (short)aMeta);
- return aStack;
- }
-
- public static ItemStack amount(final long aAmount, final Object... aStacks) {
- final ItemStack rStack = copy(aStacks);
- if (invalid(rStack)) {
- return null;
- }
- rStack.stackSize = (int)aAmount;
- return rStack;
- }
-
- public static ItemStack container(final ItemStack aStack, final boolean aCheckIFluidContainerItems) {
- if (invalid(aStack)) {
- return null;
- }
- if (aStack.getItem().hasContainerItem(aStack)) {
- return aStack.getItem().getContainerItem(aStack);
- }
- if (equal(aStack, ItemUtils.getEmptyCell(), true)) {
- return null;
- }
- if (aCheckIFluidContainerItems && (aStack.getItem() instanceof IFluidContainerItem) && (((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) > 0)) {
- final ItemStack tStack = amount(1L, aStack);
- ((IFluidContainerItem)aStack.getItem()).drain(tStack, Integer.MAX_VALUE, true);
- if (!equal(aStack, tStack)) {
- return tStack;
- }
- return null;
- }
- if (equal(aStack, ItemList.IC2_ForgeHammer.get(1)) || equal(aStack, ItemList.IC2_WireCutter.get(1))) {
- return copyMeta(meta(aStack) + 1, aStack);
- }
- return null;
- }
-
- public static ItemStack container(final ItemStack aStack, final boolean aCheckIFluidContainerItems, final int aStacksize) {
- return amount(aStacksize, container(aStack, aCheckIFluidContainerItems));
- }
-
- public final static Fluid generateFluid(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, boolean aGenerateCell){
- FluidStack aFStack = (FluidUtils.getFluidStack("molten"+"."+unlocalizedName.toLowerCase(), 1));
- if (aFStack == null){
- Logger.WARNING("Generating our own fluid.");
-/* ItemStack cell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1);
- if (cell == null){
- final Item temp = new BaseItemComponent(unlocalizedName, localizedName, RGBA);
- cell = ItemUtils.getSimpleStack(temp);
- }*/
- final Fluid gtFluid = FluidUtils.addGTFluid(
- unlocalizedName,
- "Molten "+localizedName,
- RGBA,
- 4,
- MeltingPoint,
- null,
- ItemUtils.getEmptyCell(),
- 1000,
- aGenerateCell);
-
- return gtFluid;
- }
- else {
- Logger.INFO("FLUID GENERATION FAILED FOR "+localizedName+", ALREADY EXISTS");
- return aFStack.getFluid();
- }
- }
-
- public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final boolean aGenerateCell){
- return generateFluidNonMolten(unlocalizedName, localizedName, MeltingPoint, RGBA, null, null, 0, aGenerateCell);
- }
-
-
- public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final ItemStack dustStack, final ItemStack dustStack2){
- return generateFluidNonMolten(unlocalizedName, localizedName, MeltingPoint, RGBA, dustStack, dustStack2, 144, true);
- }
-
- public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final ItemStack dustStack, final ItemStack dustStack2, final boolean aGenerateCell){
- return generateFluidNonMolten(unlocalizedName, localizedName, MeltingPoint, RGBA, dustStack, dustStack2, 144, aGenerateCell);
- }
-
- public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, ItemStack dustStack, final ItemStack dustStack2, final int amountPerItem, final boolean aGenerateCell){
- if (dustStack == null){
- dustStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+Utils.sanitizeString(localizedName), 1);
- }
- FluidStack aFStack = (FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1));
- if (aFStack == null){
- Logger.WARNING("Generating our own fluid.");
-
- final Fluid gtFluid = FluidUtils.addGTFluidNonMolten(
- unlocalizedName,
- localizedName,
- RGBA,
- 4,
- MeltingPoint,
- null,
- ItemUtils.getEmptyCell(),
- 1000,
- aGenerateCell);
-
- if (dustStack != null){
- CORE.RA.addFluidExtractionRecipe(
- dustStack, //Input 2
- FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output
- 1*20, //Duration
- 16 //Eu Tick
- );
- }
- if (dustStack2 != null){
- CORE.RA.addFluidExtractionRecipe(
- dustStack2, //Input 2
- FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output
- 1*20, //Duration
- 16 //Eu Tick
- );
- }
-
- return gtFluid;
- }
- else {
- Logger.INFO("FLUID GENERATION FAILED FOR "+localizedName+", ALREADY EXISTS");
- return aFStack.getFluid();
- }
- }
-
- public final static Fluid generateFluidNoPrefix(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA){
- return generateFluidNoPrefix(unlocalizedName, localizedName, MeltingPoint, RGBA, true);
- }
-
- public final static Fluid generateFluidNoPrefix(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final boolean aGenerateCell){
- Fluid gtFluid;
- if (FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1) == null){
- Logger.WARNING("Generating our own fluid.");
- gtFluid = FluidUtils.addGTFluidNoPrefix(
- unlocalizedName,
- localizedName,
- RGBA,
- 4,
- MeltingPoint,
- null,
- ItemUtils.getEmptyCell(),
- 1000,
- aGenerateCell);
- }
- else {
- gtFluid = FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1).getFluid();
- }
- //Generate a Cell if we need to
-// if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1) == null){
-// new BaseItemCell(unlocalizedName, localizedName, RGBA, gtFluid);
-// }
- return gtFluid;
- }
-
- public final static Fluid generateGas(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final boolean aGenerateCell){
- Fluid gtFluid;
- if (FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1) == null){
- Logger.WARNING("Generating our own gas.");
- gtFluid = FluidUtils.addGtGas(
- unlocalizedName,
- localizedName,
- RGBA,
- 3,
- MeltingPoint,
- null,
- ItemUtils.getEmptyCell(),
- 1000,
- aGenerateCell);
- }
- else {
- gtFluid = FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1).getFluid();
- }
- //Generate a Cell if we need to
-/* if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1) == null){
- new BaseItemCell(unlocalizedName, localizedName, RGBA, gtFluid);
- }*/
- return gtFluid;
- }
-
-
-
-
- public static FluidStack getMobEssence(final int amount){
- return EnchantingUtils.getMobEssence(amount);
- }
-
- public static FluidStack getLiquidXP(final int amount){
- return EnchantingUtils.getLiquidXP(amount);
- }
-
- public static boolean doesFluidExist(String aFluidName) {
- FluidStack aFStack1 = (FluidUtils.getFluidStack("molten"+"."+aFluidName.toLowerCase(), 1));
- FluidStack aFStack2 = (FluidUtils.getFluidStack("fluid"+"."+aFluidName.toLowerCase(), 1));
- FluidStack aFStack3 = (FluidUtils.getFluidStack(aFluidName.toLowerCase(), 1));
- FluidStack aFStack4 = (FluidUtils.getFluidStack(aFluidName, 1));
- FluidStack aFStack5 = (FluidUtils.getFluidStack("liquid_"+aFluidName.toLowerCase(), 1));
- FluidStack aFStack6 = (FluidUtils.getFluidStack("liquid"+"."+aFluidName.toLowerCase(), 1));
- return aFStack1 != null || aFStack2 != null || aFStack3 != null || aFStack4 != null || aFStack5 != null || aFStack6 != null;
- }
-
- public static FluidStack getWildcardFluidStack(String aFluidName, int amount) {
- FluidStack aFStack1 = (FluidUtils.getFluidStack(aFluidName, amount));
- FluidStack aFStack2 = (FluidUtils.getFluidStack(aFluidName.toLowerCase(), amount));
- FluidStack aFStack3 = (FluidUtils.getFluidStack("molten"+"."+aFluidName.toLowerCase(), amount));
- FluidStack aFStack4 = (FluidUtils.getFluidStack("fluid"+"."+aFluidName.toLowerCase(), amount));
- FluidStack aFStack5 = (FluidUtils.getFluidStack("liquid_"+aFluidName.toLowerCase(), amount));
- FluidStack aFStack6 = (FluidUtils.getFluidStack("liquid"+"."+aFluidName.toLowerCase(), amount));
- if (aFStack1 != null) {
- return aFStack1;
- }
- if (aFStack2 != null) {
- return aFStack2;
- }
- if (aFStack3 != null) {
- return aFStack3;
- }
- if (aFStack4 != null) {
- return aFStack4;
- }
- if (aFStack5 != null) {
- return aFStack5;
- }
- if (aFStack6 != null) {
- return aFStack6;
- }
- return null;
- }
-
- public static FluidStack getWildcardFluidStack(Materials aMaterial, int amount) {
- FluidStack aFStack1 = aMaterial.getFluid(amount);
- FluidStack aFStack2 = aMaterial.getGas(amount);
- FluidStack aFStack3 = aMaterial.getMolten(amount);
- FluidStack aFStack4 = aMaterial.getSolid(amount);
- if (aFStack1 != null) {
- return aFStack1;
- }
- else if (aFStack2 != null) {
- return aFStack2;
- }
- else if (aFStack3 != null) {
- return aFStack3;
- }
- else if (aFStack4 != null) {
- return aFStack4;
- }
- else {
- return null;
- }
- }
-
- public static FluidStack getAir(int aAmount) {
- return FluidUtils.getFluidStack("air", aAmount);
- }
-
+ private static HashMap<String, Fluid> sFluidCache = new HashMap<String, Fluid>();
+
+ public static FluidStack getWater(final int amount) {
+ return FluidUtils.getFluidStack("water", amount);
+ }
+
+ public static FluidStack getDistilledWater(final int amount) {
+ return FluidUtils.getFluidStack("ic2distilledwater", amount);
+ }
+
+ public static FluidStack getHotWater(final int amount) {
+ return FluidUtils.getFluidStack("ic2hotwater", amount);
+ }
+
+ public static FluidStack getLava(final int amount) {
+ return FluidUtils.getFluidStack("lava", amount);
+ }
+
+ public static FluidStack getPahoehoeLava(final int amount) {
+ return FluidUtils.getFluidStack("ic2pahoehoelava", amount);
+ }
+
+ public static FluidStack getMilk(final int amount) {
+ return FluidUtils.getFluidStack("milk", amount);
+ }
+
+ public static FluidStack getColdCoolant(final int amount) {
+ return FluidUtils.getFluidStack("ic2coolant", amount);
+ }
+
+ public static FluidStack getHotCoolant(final int amount) {
+ return FluidUtils.getFluidStack("ic2hotcoolant", amount);
+ }
+
+ public static FluidStack getSteam(final int amount) {
+ return FluidUtils.getFluidStack("steam", amount);
+ }
+
+ public static FluidStack getIC2Steam(final int amount) {
+ return FluidUtils.getFluidStack("ic2steam", amount);
+ }
+
+ public static FluidStack getSuperHeatedSteam(final int amount) {
+ return FluidUtils.getFluidStack("ic2superheatedsteam", amount);
+ }
+
+ @Deprecated
+ /**
+ * Do not use - Gives third tier steam - Not implemented
+ * @param amount
+ * @return
+ */
+ public static FluidStack getHyperSteam(final int amount) {
+ return FluidUtils.getFluidStack("water", amount);
+ }
+
+ public static FluidStack getUUA(final int amount) {
+ return FluidUtils.getFluidStack("uuamplifier", amount);
+ }
+
+ public static FluidStack getUUM(final int amount) {
+ return FluidUtils.getFluidStack("ic2uumatter", amount);
+ }
+
+ public static FluidStack getHydrofluoricAcid(int amount) {
+ return FluidUtils.getFluidStack("hydrofluoricacid", amount);
+ }
+
+ public static Fluid sGregtechHydrofluoricAcid = null;
+
+ public static FluidStack getHydrofluoricAcidGT(int amount) {
+ if (sGregtechHydrofluoricAcid == null) {
+ FluidStack aGTHF = FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 1);
+ sGregtechHydrofluoricAcid =
+ aGTHF != null ? aGTHF.getFluid() : getHydrofluoricAcid(1).getFluid();
+ }
+ return FluidUtils.getFluidStack(sGregtechHydrofluoricAcid, amount);
+ }
+
+ public static boolean doesHydrofluoricAcidGtExist() {
+ if (sGregtechHydrofluoricAcid == null) {
+ getHydrofluoricAcidGT(1);
+ }
+ return sGregtechHydrofluoricAcid != null
+ && sGregtechHydrofluoricAcid != getHydrofluoricAcid(1).getFluid();
+ }
+
+ private static FluidStack createFluidStack(Fluid aFluid, int aAmount) {
+ if (aFluid != null) {
+ return new FluidStack(aFluid, aAmount);
+ }
+ return null;
+ }
+
+ public static FluidStack getFluidStack(final String aFluidName, final int aAmount) {
+ Fluid aFluid = sFluidCache.get(aFluidName);
+ if (aFluid != null) {
+ return createFluidStack(aFluid, aAmount);
+ } else {
+ Fluid aLookupFluid = FluidRegistry.getFluid(aFluidName);
+ if (aLookupFluid != null) {
+ sFluidCache.put(aFluidName, aLookupFluid);
+ return createFluidStack(aLookupFluid, aAmount);
+ }
+ }
+ return null;
+ }
+
+ public static FluidStack getFluidStack(final FluidStack aFluidStack, final int aAmount) {
+ if (aFluidStack == null) {
+ return null;
+ }
+ return new FluidStack(aFluidStack, aAmount);
+ }
+
+ public static FluidStack getFluidStack(final Fluid aFluid, final int aAmount) {
+ if (aFluid == null) {
+ return null;
+ }
+ return new FluidStack(aFluid, aAmount);
+ }
+
+ public static FluidStack[] getFluidStackArray(final String fluidName, final int amount) {
+ Logger.WARNING("Trying to get a fluid stack of " + fluidName);
+ try {
+ final FluidStack[] singleFluid = {getFluidStack(fluidName, amount)};
+ return singleFluid;
+ } catch (final Throwable e) {
+ return null;
+ }
+ }
+
+ public static FluidStack[] getFluidStackArray(final FluidStack fluidName, final int amount) {
+ Logger.WARNING("Trying to get a fluid stack of " + fluidName);
+ try {
+ final FluidStack[] singleFluid = {getFluidStack(fluidName, amount)};
+ return singleFluid;
+ } catch (final Throwable e) {
+ return null;
+ }
+ }
+
+ public static Fluid addGtFluid(
+ final String aName,
+ final String aLocalized,
+ final GT_Materials aMaterial,
+ final int aState,
+ final long aTemperatureK,
+ final ItemStack aFullContainer,
+ final ItemStack aEmptyContainer,
+ final int aFluidAmount) {
+ return addGtFluid(
+ aName,
+ aLocalized,
+ aMaterial,
+ aState,
+ aTemperatureK,
+ aFullContainer,
+ aEmptyContainer,
+ aFluidAmount,
+ true);
+ }
+
+ public static Fluid addGtFluid(
+ final String aName,
+ final String aLocalized,
+ final GT_Materials aMaterial,
+ final int aState,
+ final long aTemperatureK,
+ final ItemStack aFullContainer,
+ final ItemStack aEmptyContainer,
+ final int aFluidAmount,
+ final boolean aGenerateCell) {
+ Fluid g = addGTFluid(
+ aName,
+ "fluid.autogenerated",
+ aLocalized,
+ aMaterial != null ? aMaterial.mRGBa : new short[] {255, 255, 255, 0},
+ aState,
+ aTemperatureK,
+ aFullContainer,
+ aEmptyContainer,
+ aFluidAmount,
+ aGenerateCell);
+ if (g != null) {
+ if (aMaterial != null) {
+ switch (aState) {
+ case 1: {
+ aMaterial.mFluid = (g);
+ break;
+ }
+ case 2: {
+ aMaterial.mGas = (g);
+ break;
+ }
+ case 3: {
+ aMaterial.mPlasma = (g);
+ break;
+ }
+ }
+ }
+ return g;
+ }
+ return null;
+ }
+
+ public static Fluid addGTFluid(
+ final String aName,
+ final String aLocalized,
+ final short[] aRGBa,
+ final int aState,
+ final long aTemperatureK,
+ final ItemStack aFullContainer,
+ final ItemStack aEmptyContainer,
+ final int aFluidAmount,
+ final boolean aGenerateCell) {
+ return addGTFluid(
+ "molten." + aName,
+ "molten.autogenerated",
+ aLocalized,
+ aRGBa,
+ aState,
+ aTemperatureK,
+ aFullContainer,
+ aEmptyContainer,
+ aFluidAmount,
+ aGenerateCell);
+ }
+
+ public static Fluid addGTFluidNonMolten(
+ final String aName,
+ final String aLocalized,
+ final short[] aRGBa,
+ final int aState,
+ final long aTemperatureK,
+ final ItemStack aFullContainer,
+ final ItemStack aEmptyContainer,
+ final int aFluidAmount,
+ final boolean aGenerateCell) {
+ return addGTFluid(
+ "fluid." + aName,
+ "fluid.autogenerated",
+ aLocalized,
+ aRGBa,
+ aState,
+ aTemperatureK,
+ aFullContainer,
+ aEmptyContainer,
+ aFluidAmount,
+ aGenerateCell);
+ }
+
+ public static Fluid addGTFluidNoPrefix(
+ final String aName,
+ final String aLocalized,
+ final short[] aRGBa,
+ final int aState,
+ final long aTemperatureK,
+ final ItemStack aFullContainer,
+ final ItemStack aEmptyContainer,
+ final int aFluidAmount,
+ final boolean aGenerateCell) {
+ return addGTFluid(
+ aName,
+ "fluid.autogenerated",
+ aLocalized,
+ aRGBa,
+ aState,
+ aTemperatureK,
+ aFullContainer,
+ aEmptyContainer,
+ aFluidAmount,
+ aGenerateCell);
+ }
+ // Gass
+ public static Fluid addGtGas(
+ final String aName,
+ final String aLocalized,
+ final short[] aRGBa,
+ final int aState,
+ final long aTemperatureK,
+ final ItemStack aFullContainer,
+ final ItemStack aEmptyContainer,
+ final int aFluidAmount,
+ final boolean aGenerateCell) {
+ return addGTFluid(
+ aName,
+ "fluid.autogenerated",
+ aLocalized,
+ aRGBa,
+ aState,
+ aTemperatureK,
+ aFullContainer,
+ aEmptyContainer,
+ aFluidAmount,
+ aGenerateCell);
+ }
+
+ public static Fluid addGTPlasma(final Material aMaterial) {
+ if (aMaterial.getLocalizedName().toLowerCase().contains("clay")
+ || (aMaterial.getComposites().size() > 1)
+ || aMaterial.getLocalizedName().toLowerCase().contains("wrought")) {
+ return null;
+ }
+ Logger.INFO("Generating a " + aMaterial.getLocalizedName() + " Plasma Cell");
+ if (aMaterial.vComponentCount != 1) {
+ Logger.INFO("Compound made from: ");
+ for (final MaterialStack x : aMaterial.getComposites()) {
+ Logger.INFO(x.getStackMaterial().getLocalizedName());
+ }
+ Logger.INFO("Material is a composite, not generating plasma.");
+ return null;
+ }
+
+ ItemStack temp = null;
+ // Generate a Cell if we need to
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellPlasma" + aMaterial.getUnlocalizedName(), 1)
+ == null) {
+ new BaseItemPlasmaCell(aMaterial);
+ temp = aMaterial.getPlasmaCell(1);
+ } else {
+ temp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellPlasma" + aMaterial.getUnlocalizedName(), 1);
+ }
+ if (temp != null) {
+ return addGTFluid(
+ "plasma."
+ + Utils.sanitizeString(aMaterial.getLocalizedName().toLowerCase()),
+ "plasma.autogenerated",
+ aMaterial.getLocalizedName() + " Plasma",
+ aMaterial.getRGBA(),
+ 3,
+ 10000,
+ temp,
+ ItemUtils.getEmptyCell(),
+ 1000,
+ false);
+ }
+ return null;
+ }
+
+ public static Fluid addGTFluid(
+ String aName,
+ final String aTexture,
+ final String aLocalized,
+ final short[] aRGBa,
+ final int aState,
+ final long aTemperatureK,
+ ItemStack aFullContainer,
+ final ItemStack aEmptyContainer,
+ final int aFluidAmount,
+ final boolean aGenerateFilledCell) {
+
+ String aNameOriginal = aName;
+ Logger.INFO("Generating Fluid for " + aName);
+
+ aName = Utils.sanitizeString(aName.toLowerCase());
+
+ String aLocalName = (aLocalized == null) ? aName : aLocalized;
+
+ Fluid rFluid;
+ Fluid gFluid = FluidRegistry.getFluid(aName);
+ FluidStack aCheck = FluidUtils.getWildcardFluidStack(aName.toLowerCase(), 1000);
+ boolean register = false;
+ if (aCheck != null) {
+ rFluid = aCheck.getFluid();
+ } else if (gFluid != null) {
+ rFluid = gFluid;
+ } else {
+ rFluid = new FluidGT6(aName, aTexture, (aRGBa != null) ? aRGBa : Dyes._NULL.getRGBA());
+ register = true;
+ }
+
+ if (register) {
+ GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalName);
+ if (FluidRegistry.registerFluid(rFluid)) {
+ switch (aState) {
+ case 0: {
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(10000);
+ break;
+ }
+ case 1:
+ case 4: {
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(1000);
+ break;
+ }
+ case 2: {
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-100);
+ rFluid.setViscosity(200);
+ break;
+ }
+ case 3: {
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-10000);
+ rFluid.setViscosity(10);
+ rFluid.setLuminosity(15);
+ break;
+ }
+ }
+ }
+ }
+
+ String aNameNonMolten = aLocalName.contains("Molten") ? aLocalName.replace("Molten", "") : aLocalName;
+
+ if (aFullContainer == null) {
+ ItemStack oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + aLocalName, 1);
+ aFullContainer = oreStack;
+ if (aFullContainer == null) {
+ oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + aNameOriginal, 1);
+ aFullContainer = oreStack;
+ if (aFullContainer == null) {
+ oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + aNameNonMolten, 1);
+ aFullContainer = oreStack;
+ if (aFullContainer != null) {
+ Logger.INFO("Found cell for " + aNameNonMolten);
+ }
+ } else {
+ Logger.INFO("Found cell for " + aNameOriginal);
+ }
+ } else {
+ Logger.INFO("Found cell for " + aLocalName);
+ }
+ }
+
+ Item tempCell = null;
+ // Generate a Cell if we need to
+ if (aGenerateFilledCell && aFullContainer == null) {
+ String aMatName = aNameOriginal;
+ if (aMatName.contains("molten.")) {
+ aMatName = aMatName.replace("molten.", "");
+ aMatName = aMatName.substring(0, 1).toUpperCase() + aMatName.substring(1);
+ }
+ if (aMatName.contains("fluid.")) {
+ aMatName = aMatName.replace("fluid.", "");
+ aMatName = aMatName.substring(0, 1).toUpperCase() + aMatName.substring(1);
+ }
+ Logger.INFO("Generating cell for " + aMatName + ", " + aLocalName);
+ tempCell = new BaseItemComponent(aMatName, aLocalName, aRGBa);
+ aFullContainer = ItemUtils.getSimpleStack(tempCell);
+ }
+
+ if ((rFluid.getTemperature() == new Fluid("test").getTemperature()) || (rFluid.getTemperature() <= 0)) {
+ rFluid.setTemperature((int) (aTemperatureK));
+ }
+ if ((aFullContainer != null)
+ && (aEmptyContainer != null)
+ && !FluidContainerRegistry.registerFluidContainer(
+ new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
+ CORE.RA.addFluidCannerRecipe(CI.emptyCells(1), aFullContainer, new FluidStack(rFluid, aFluidAmount));
+ } else {
+ // Utils.LOG_INFO("Failed creating recipes to fill/empty cells of "+aName+".");
+ }
+ return rFluid;
+ }
+
+ public static boolean valid(final Object aStack) {
+ return (aStack != null)
+ && (aStack instanceof ItemStack)
+ && (((ItemStack) aStack).getItem() != null)
+ && (((ItemStack) aStack).stackSize >= 0);
+ }
+
+ public static boolean invalid(final Object aStack) {
+ return (aStack == null)
+ || !(aStack instanceof ItemStack)
+ || (((ItemStack) aStack).getItem() == null)
+ || (((ItemStack) aStack).stackSize < 0);
+ }
+
+ public static boolean equal(final ItemStack aStack1, final ItemStack aStack2) {
+ return equal(aStack1, aStack2, false);
+ }
+
+ public static boolean equal(final ItemStack aStack1, final ItemStack aStack2, final boolean aIgnoreNBT) {
+ return (aStack1 != null) && (aStack2 != null) && equal_(aStack1, aStack2, aIgnoreNBT);
+ }
+
+ public static boolean equal_(final ItemStack aStack1, final ItemStack aStack2, final boolean aIgnoreNBT) {
+ return (aStack1.getItem() == aStack2.getItem())
+ && (aIgnoreNBT
+ || ((aStack1.getTagCompound() == null == (aStack2.getTagCompound() == null))
+ && ((aStack1.getTagCompound() == null)
+ || aStack1.getTagCompound().equals(aStack2.getTagCompound()))))
+ && ((meta(aStack1) == meta(aStack2)) || (meta(aStack1) == 32767) || (meta(aStack2) == 32767));
+ }
+
+ public static ItemStack copy(final Object... aStacks) {
+ for (final Object tStack : aStacks) {
+ if (valid(tStack)) {
+ return ((ItemStack) tStack).copy();
+ }
+ }
+ return null;
+ }
+
+ public static ItemStack copyMeta(final long aMetaData, final Object... aStacks) {
+ final ItemStack rStack = copy(aStacks);
+ if (invalid(rStack)) {
+ return null;
+ }
+ return meta(rStack, aMetaData);
+ }
+
+ public static short meta(final ItemStack aStack) {
+ return (short) Items.feather.getDamage(aStack);
+ }
+
+ public static ItemStack meta(final ItemStack aStack, final long aMeta) {
+ Items.feather.setDamage(aStack, (short) aMeta);
+ return aStack;
+ }
+
+ public static ItemStack amount(final long aAmount, final Object... aStacks) {
+ final ItemStack rStack = copy(aStacks);
+ if (invalid(rStack)) {
+ return null;
+ }
+ rStack.stackSize = (int) aAmount;
+ return rStack;
+ }
+
+ public static ItemStack container(final ItemStack aStack, final boolean aCheckIFluidContainerItems) {
+ if (invalid(aStack)) {
+ return null;
+ }
+ if (aStack.getItem().hasContainerItem(aStack)) {
+ return aStack.getItem().getContainerItem(aStack);
+ }
+ if (equal(aStack, ItemUtils.getEmptyCell(), true)) {
+ return null;
+ }
+ if (aCheckIFluidContainerItems
+ && (aStack.getItem() instanceof IFluidContainerItem)
+ && (((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0)) {
+ final ItemStack tStack = amount(1L, aStack);
+ ((IFluidContainerItem) aStack.getItem()).drain(tStack, Integer.MAX_VALUE, true);
+ if (!equal(aStack, tStack)) {
+ return tStack;
+ }
+ return null;
+ }
+ if (equal(aStack, ItemList.IC2_ForgeHammer.get(1)) || equal(aStack, ItemList.IC2_WireCutter.get(1))) {
+ return copyMeta(meta(aStack) + 1, aStack);
+ }
+ return null;
+ }
+
+ public static ItemStack container(
+ final ItemStack aStack, final boolean aCheckIFluidContainerItems, final int aStacksize) {
+ return amount(aStacksize, container(aStack, aCheckIFluidContainerItems));
+ }
+
+ public static final Fluid generateFluid(
+ final String unlocalizedName,
+ final String localizedName,
+ final int MeltingPoint,
+ final short[] RGBA,
+ boolean aGenerateCell) {
+ FluidStack aFStack = (FluidUtils.getFluidStack("molten" + "." + unlocalizedName.toLowerCase(), 1));
+ if (aFStack == null) {
+ Logger.WARNING("Generating our own fluid.");
+ /* ItemStack cell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1);
+ if (cell == null){
+ final Item temp = new BaseItemComponent(unlocalizedName, localizedName, RGBA);
+ cell = ItemUtils.getSimpleStack(temp);
+ }*/
+ final Fluid gtFluid = FluidUtils.addGTFluid(
+ unlocalizedName,
+ "Molten " + localizedName,
+ RGBA,
+ 4,
+ MeltingPoint,
+ null,
+ ItemUtils.getEmptyCell(),
+ 1000,
+ aGenerateCell);
+
+ return gtFluid;
+ } else {
+ Logger.INFO("FLUID GENERATION FAILED FOR " + localizedName + ", ALREADY EXISTS");
+ return aFStack.getFluid();
+ }
+ }
+
+ public static final Fluid generateFluidNonMolten(
+ final String unlocalizedName,
+ final String localizedName,
+ final int MeltingPoint,
+ final short[] RGBA,
+ final boolean aGenerateCell) {
+ return generateFluidNonMolten(unlocalizedName, localizedName, MeltingPoint, RGBA, null, null, 0, aGenerateCell);
+ }
+
+ public static final Fluid generateFluidNonMolten(
+ final String unlocalizedName,
+ final String localizedName,
+ final int MeltingPoint,
+ final short[] RGBA,
+ final ItemStack dustStack,
+ final ItemStack dustStack2) {
+ return generateFluidNonMolten(
+ unlocalizedName, localizedName, MeltingPoint, RGBA, dustStack, dustStack2, 144, true);
+ }
+
+ public static final Fluid generateFluidNonMolten(
+ final String unlocalizedName,
+ final String localizedName,
+ final int MeltingPoint,
+ final short[] RGBA,
+ final ItemStack dustStack,
+ final ItemStack dustStack2,
+ final boolean aGenerateCell) {
+ return generateFluidNonMolten(
+ unlocalizedName, localizedName, MeltingPoint, RGBA, dustStack, dustStack2, 144, aGenerateCell);
+ }
+
+ public static final Fluid generateFluidNonMolten(
+ final String unlocalizedName,
+ final String localizedName,
+ final int MeltingPoint,
+ final short[] RGBA,
+ ItemStack dustStack,
+ final ItemStack dustStack2,
+ final int amountPerItem,
+ final boolean aGenerateCell) {
+ if (dustStack == null) {
+ dustStack =
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust" + Utils.sanitizeString(localizedName), 1);
+ }
+ FluidStack aFStack = (FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1));
+ if (aFStack == null) {
+ Logger.WARNING("Generating our own fluid.");
+
+ final Fluid gtFluid = FluidUtils.addGTFluidNonMolten(
+ unlocalizedName,
+ localizedName,
+ RGBA,
+ 4,
+ MeltingPoint,
+ null,
+ ItemUtils.getEmptyCell(),
+ 1000,
+ aGenerateCell);
+
+ if (dustStack != null) {
+ CORE.RA.addFluidExtractionRecipe(
+ dustStack, // Input 2
+ FluidUtils.getFluidStack(gtFluid, amountPerItem), // Fluid Output
+ 1 * 20, // Duration
+ 16 // Eu Tick
+ );
+ }
+ if (dustStack2 != null) {
+ CORE.RA.addFluidExtractionRecipe(
+ dustStack2, // Input 2
+ FluidUtils.getFluidStack(gtFluid, amountPerItem), // Fluid Output
+ 1 * 20, // Duration
+ 16 // Eu Tick
+ );
+ }
+
+ return gtFluid;
+ } else {
+ Logger.INFO("FLUID GENERATION FAILED FOR " + localizedName + ", ALREADY EXISTS");
+ return aFStack.getFluid();
+ }
+ }
+
+ public static final Fluid generateFluidNoPrefix(
+ final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA) {
+ return generateFluidNoPrefix(unlocalizedName, localizedName, MeltingPoint, RGBA, true);
+ }
+
+ public static final Fluid generateFluidNoPrefix(
+ final String unlocalizedName,
+ final String localizedName,
+ final int MeltingPoint,
+ final short[] RGBA,
+ final boolean aGenerateCell) {
+ Fluid gtFluid;
+ if (FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1) == null) {
+ Logger.WARNING("Generating our own fluid.");
+ gtFluid = FluidUtils.addGTFluidNoPrefix(
+ unlocalizedName,
+ localizedName,
+ RGBA,
+ 4,
+ MeltingPoint,
+ null,
+ ItemUtils.getEmptyCell(),
+ 1000,
+ aGenerateCell);
+ } else {
+ gtFluid = FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1).getFluid();
+ }
+ // Generate a Cell if we need to
+ // if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1) == null){
+ // new BaseItemCell(unlocalizedName, localizedName, RGBA, gtFluid);
+ // }
+ return gtFluid;
+ }
+
+ public static final Fluid generateGas(
+ final String unlocalizedName,
+ final String localizedName,
+ final int MeltingPoint,
+ final short[] RGBA,
+ final boolean aGenerateCell) {
+ Fluid gtFluid;
+ if (FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1) == null) {
+ Logger.WARNING("Generating our own gas.");
+ gtFluid = FluidUtils.addGtGas(
+ unlocalizedName,
+ localizedName,
+ RGBA,
+ 3,
+ MeltingPoint,
+ null,
+ ItemUtils.getEmptyCell(),
+ 1000,
+ aGenerateCell);
+ } else {
+ gtFluid = FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1).getFluid();
+ }
+ // Generate a Cell if we need to
+ /* if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1) == null){
+ new BaseItemCell(unlocalizedName, localizedName, RGBA, gtFluid);
+ }*/
+ return gtFluid;
+ }
+
+ public static FluidStack getMobEssence(final int amount) {
+ return EnchantingUtils.getMobEssence(amount);
+ }
+
+ public static FluidStack getLiquidXP(final int amount) {
+ return EnchantingUtils.getLiquidXP(amount);
+ }
+
+ public static boolean doesFluidExist(String aFluidName) {
+ FluidStack aFStack1 = (FluidUtils.getFluidStack("molten" + "." + aFluidName.toLowerCase(), 1));
+ FluidStack aFStack2 = (FluidUtils.getFluidStack("fluid" + "." + aFluidName.toLowerCase(), 1));
+ FluidStack aFStack3 = (FluidUtils.getFluidStack(aFluidName.toLowerCase(), 1));
+ FluidStack aFStack4 = (FluidUtils.getFluidStack(aFluidName, 1));
+ FluidStack aFStack5 = (FluidUtils.getFluidStack("liquid_" + aFluidName.toLowerCase(), 1));
+ FluidStack aFStack6 = (FluidUtils.getFluidStack("liquid" + "." + aFluidName.toLowerCase(), 1));
+ return aFStack1 != null
+ || aFStack2 != null
+ || aFStack3 != null
+ || aFStack4 != null
+ || aFStack5 != null
+ || aFStack6 != null;
+ }
+
+ public static FluidStack getWildcardFluidStack(String aFluidName, int amount) {
+ FluidStack aFStack1 = (FluidUtils.getFluidStack(aFluidName, amount));
+ FluidStack aFStack2 = (FluidUtils.getFluidStack(aFluidName.toLowerCase(), amount));
+ FluidStack aFStack3 = (FluidUtils.getFluidStack("molten" + "." + aFluidName.toLowerCase(), amount));
+ FluidStack aFStack4 = (FluidUtils.getFluidStack("fluid" + "." + aFluidName.toLowerCase(), amount));
+ FluidStack aFStack5 = (FluidUtils.getFluidStack("liquid_" + aFluidName.toLowerCase(), amount));
+ FluidStack aFStack6 = (FluidUtils.getFluidStack("liquid" + "." + aFluidName.toLowerCase(), amount));
+ if (aFStack1 != null) {
+ return aFStack1;
+ }
+ if (aFStack2 != null) {
+ return aFStack2;
+ }
+ if (aFStack3 != null) {
+ return aFStack3;
+ }
+ if (aFStack4 != null) {
+ return aFStack4;
+ }
+ if (aFStack5 != null) {
+ return aFStack5;
+ }
+ if (aFStack6 != null) {
+ return aFStack6;
+ }
+ return null;
+ }
+
+ public static FluidStack getWildcardFluidStack(Materials aMaterial, int amount) {
+ FluidStack aFStack1 = aMaterial.getFluid(amount);
+ FluidStack aFStack2 = aMaterial.getGas(amount);
+ FluidStack aFStack3 = aMaterial.getMolten(amount);
+ FluidStack aFStack4 = aMaterial.getSolid(amount);
+ if (aFStack1 != null) {
+ return aFStack1;
+ } else if (aFStack2 != null) {
+ return aFStack2;
+ } else if (aFStack3 != null) {
+ return aFStack3;
+ } else if (aFStack4 != null) {
+ return aFStack4;
+ } else {
+ return null;
+ }
+ }
+
+ public static FluidStack getAir(int aAmount) {
+ return FluidUtils.getFluidStack("air", aAmount);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/FoodUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/FoodUtils.java
index 9f5d4f36ca..129548d1db 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/FoodUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/FoodUtils.java
@@ -10,51 +10,51 @@ import net.minecraft.item.ItemStack;
public class FoodUtils {
- public static final Class IEdibleClass;
-
- static {
- IEdibleClass = ReflectionUtils.getClass("squeek.applecore.api.food.IEdible");
- }
-
- public static boolean isFood(ItemStack food) {
-
- if (food == null) {
- return false;
- }
-
- Item item = food.getItem();
-
- if(item == null) {
- return false;
- }
-
- EnumAction action = item.getItemUseAction(food);
-
- if(item instanceof ItemBlock || action == EnumAction.eat || action == EnumAction.drink) {
- if(getUnmodifiedFoodValues(food) > 0) {
- return true;
- }
- }
-
- return false;
- }
-
- private static int getUnmodifiedFoodValues(ItemStack stack) {
-
- if (stack == null) {
- return 0;
- }
-
- Item item = stack.getItem();
-
- if(item == null) {
- return 0;
- }
-
- if(IEdibleClass.isInstance(item) || item instanceof ItemFood || item == Items.cake) {
- return 1;
- }
-
- return 0;
- }
+ public static final Class IEdibleClass;
+
+ static {
+ IEdibleClass = ReflectionUtils.getClass("squeek.applecore.api.food.IEdible");
+ }
+
+ public static boolean isFood(ItemStack food) {
+
+ if (food == null) {
+ return false;
+ }
+
+ Item item = food.getItem();
+
+ if (item == null) {
+ return false;
+ }
+
+ EnumAction action = item.getItemUseAction(food);
+
+ if (item instanceof ItemBlock || action == EnumAction.eat || action == EnumAction.drink) {
+ if (getUnmodifiedFoodValues(food) > 0) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static int getUnmodifiedFoodValues(ItemStack stack) {
+
+ if (stack == null) {
+ return 0;
+ }
+
+ Item item = stack.getItem();
+
+ if (item == null) {
+ return 0;
+ }
+
+ if (IEdibleClass.isInstance(item) || item instanceof ItemFood || item == Items.cake) {
+ return 1;
+ }
+
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
index 0e2fff3f35..6c1442cb0d 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
@@ -2,10 +2,6 @@ package gtPlusPlus.core.util.minecraft;
import static gregtech.api.GregTech_API.*;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gregtech.api.objects.GT_HashSet;
import gregtech.api.objects.GT_ItemStack;
@@ -21,6 +17,8 @@ import ic2.core.Ic2Items;
import ic2.core.item.armor.ItemArmorHazmat;
import ic2.core.item.armor.ItemArmorNanoSuit;
import ic2.core.item.armor.ItemArmorQuantumSuit;
+import java.lang.reflect.Field;
+import java.util.HashMap;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -29,576 +27,567 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent;
public class HazmatUtils {
- public static final GT_HashSet<GT_ItemStack> sHazmatList = new GT_HashSet<GT_ItemStack>();
-
- private static final HashMap<String, AutoMap<String>> mToolTips = new HashMap<String, AutoMap<String>>();
-
- private static boolean mInit = false;
- private static HazmatUtils mInstance;
-
- @SuppressWarnings("rawtypes")
- public static void init() {
- if (mInit) {
- return;
- }
- //doInit(); Disabled, hazmat moved to gt5u
- }
- public static void doInit() {
-
- mInstance = new HazmatUtils();
-
- sHazmatList.add(ItemUtils.getSimpleStack(Ic2Items.hazmatHelmet, 1));
- sHazmatList.add(ItemUtils.getSimpleStack(Ic2Items.hazmatChestplate, 1));
- sHazmatList.add(ItemUtils.getSimpleStack(Ic2Items.hazmatLeggings, 1));
- sHazmatList.add(ItemUtils.getSimpleStack(Ic2Items.hazmatBoots, 1));
-
- // Make Nano a hazmat suit
- // Make Quantum a hazmat suit
-
-
- if (LoadedMods.IndustrialCraft2 || LoadedMods.IndustrialCraft2Classic) {
- AutoMap<ItemStack> aVanillaIC2Armour = new AutoMap<ItemStack>();
- aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.nanoHelmet, 1));
- aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.nanoBodyarmor, 1));
- aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.nanoLeggings, 1));
- aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.nanoBoots, 1));
- aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.quantumHelmet, 1));
- aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.quantumBodyarmor, 1));
- aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.quantumLeggings, 1));
- aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.quantumBoots, 1));
- for (ItemStack aItem : aVanillaIC2Armour) {
- addProtection(aItem);
- }
- Logger.INFO("[Hazmat] Registered IC2 Items as hazmat gear.");
- }
-
- if (LoadedMods.isModLoaded("EMT")) {
- AutoMap<Field> aItemFields = new AutoMap<Field>();
- Class aItemsEMT = ReflectionUtils.getClass("emt.init.EMTItems");
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "nanoThaumicHelmet"));
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "nanoWing"));
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "nanoBootsTraveller"));
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "quantumThaumicHelmet"));
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "quantumWing"));
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "quantumArmor"));
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "quantumBootsTraveller"));
- AutoMap<ItemStack> aEMT = new AutoMap<ItemStack>();
- for (Field aItemField : aItemFields) {
- Item aItemObject = null;
- if (aItemField != null) {
- try {
- aItemObject = (Item) aItemField.get(null);
- }
- catch (Exception t) {
- t.printStackTrace();
- }
- }
- if (aItemObject != null) {
- aEMT.add(ItemUtils.getSimpleStack(aItemObject));
- }
- else {
- Logger.INFO("[Hazmat] Could not get "+aItemField.getName()+" from "+aItemsEMT.getName());
- }
- }
- Logger.INFO("[Hazmat] Registering "+aEMT.size()+" EMT Items as hazmat gear.");
- for (ItemStack aItem : aEMT) {
- addProtection(aItem);
- }
- Logger.INFO("[Hazmat] Registered EMT Items as hazmat gear.");
- }
-
- if (LoadedMods.isModLoaded("DraconicEvolution")) {
- AutoMap<Field> aItemFields = new AutoMap<Field>();
- Class aItemsDE = ReflectionUtils.getClass("com.brandon3055.draconicevolution.ModItems");
-
- aItemFields.add(ReflectionUtils.getField(aItemsDE, "draconicHelm"));
- aItemFields.add(ReflectionUtils.getField(aItemsDE, "draconicChest"));
- aItemFields.add(ReflectionUtils.getField(aItemsDE, "draconicLeggs"));
- aItemFields.add(ReflectionUtils.getField(aItemsDE, "draconicBoots"));
- aItemFields.add(ReflectionUtils.getField(aItemsDE, "wyvernHelm"));
- aItemFields.add(ReflectionUtils.getField(aItemsDE, "wyvernChest"));
- aItemFields.add(ReflectionUtils.getField(aItemsDE, "wyvernLeggs"));
- aItemFields.add(ReflectionUtils.getField(aItemsDE, "wyvernBoots"));
- AutoMap<ItemStack> aItemMap = new AutoMap<ItemStack>();
- for (Field aItemField : aItemFields) {
- Item aItemObject = null;
- if (aItemField != null) {
- try {
- aItemObject = (Item) aItemField.get(null);
- }
- catch (Exception t) {
- t.printStackTrace();
- }
- }
- if (aItemObject != null) {
- aItemMap.add(ItemUtils.getSimpleStack(aItemObject));
- }
- else {
- Logger.INFO("[Hazmat] Could not get "+aItemField.getName()+" from "+aItemsDE.getName());
- }
- }
- Logger.INFO("[Hazmat] Registering "+aItemMap.size()+" Draconic Evolution Items as hazmat gear.");
- for (ItemStack aItem : aItemMap) {
- addProtection(aItem);
- }
- Logger.INFO("[Hazmat] Registered Draconic Evolution Items as hazmat gear.");
- }
-
- if (LoadedMods.isModLoaded("TaintedMagic")) {
- AutoMap<Field> aItemFields = new AutoMap<Field>();
- Class aItemsTaintedMagic = ReflectionUtils.getClass("taintedmagic.common.registry.ItemRegistry");
-
- aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemShadowFortressHelmet"));
- aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemShadowFortressChestplate"));
- aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemShadowFortressLeggings"));
- aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemVoidwalkerBoots"));
- AutoMap<ItemStack> aItemMap = new AutoMap<ItemStack>();
- for (Field aItemField : aItemFields) {
- Item aItemObject = null;
- if (aItemField != null) {
- try {
- aItemObject = (Item) aItemField.get(null);
- }
- catch (Exception t) {
- t.printStackTrace();
- }
- }
- if (aItemObject != null) {
- aItemMap.add(ItemUtils.getSimpleStack(aItemObject));
- }
- else {
- Logger.INFO("[Hazmat] Could not get "+aItemField.getName()+" from "+aItemsTaintedMagic.getName());
- }
- }
- Logger.INFO("[Hazmat] Registering "+aItemMap.size()+" Tainted Magic Items as hazmat gear.");
- for (ItemStack aItem : aItemMap) {
- addProtection(aItem);
- }
- Logger.INFO("[Hazmat] Registered Tainted Magic Items as hazmat gear.");
- }
-
- if (LoadedMods.isModLoaded("WitchingGadgets")) {
- AutoMap<Field> aItemFields = new AutoMap<Field>();
- Class aItemsTaintedMagic = ReflectionUtils.getClass("witchinggadgets.common.WGContent");
-
- aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemPrimordialHelm"));
- aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemPrimordialChest"));
- aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemPrimordialLegs"));
- aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemPrimordialBoots"));
- AutoMap<ItemStack> aItemMap = new AutoMap<ItemStack>();
- for (Field aItemField : aItemFields) {
- Item aItemObject = null;
- if (aItemField != null) {
- try {
- aItemObject = (Item) aItemField.get(null);
- }
- catch (Exception t) {
- t.printStackTrace();
- }
- }
- if (aItemObject != null) {
- aItemMap.add(ItemUtils.getSimpleStack(aItemObject));
- }
- else {
- Logger.INFO("[Hazmat] Could not get "+aItemField.getName()+" from "+aItemsTaintedMagic.getName());
- }
- }
- Logger.INFO("[Hazmat] Registering "+aItemMap.size()+" Witching Gadgets Items as hazmat gear.");
- for (ItemStack aItem : aItemMap) {
- addProtection(aItem);
- }
- Logger.INFO("[Hazmat] Registered Witching Gadgets Items as hazmat gear.");
- }
-
- if (LoadedMods.isModLoaded("ThaumicTinkerer")) {
- /*
- AutoMap<Item> aItems = new AutoMap<Item>();
- Class aMainTT = ReflectionUtils.getClass("thaumic.tinkerer.common.ThaumicTinkerer");
- Class aItemRegistryTT = ReflectionUtils.getClass("thaumic.tinkerer.common.registry.TTRegistry");
- Field aRegistryInstance = ReflectionUtils.getField(aMainTT, "registry");
- Object aRegistry = ReflectionUtils.getFieldValue(aRegistryInstance);
- Method aFuckingStupidMethodHandlingMethod = ReflectionUtils.getMethod(aItemRegistryTT, "getFirstItemFromClass", new Class[] {Class.class});
- Item aIchorHelm = (Item) ReflectionUtils.invokeNonBool(aRegistry, aFuckingStupidMethodHandlingMethod, new Object[] {ReflectionUtils.getClass("thaumic.tinkerer.common.item.kami.armor.ItemGemHelm")});
- Item aIchorChest = (Item) ReflectionUtils.invokeNonBool(aRegistry, aFuckingStupidMethodHandlingMethod, new Object[] {ReflectionUtils.getClass("thaumic.tinkerer.common.item.kami.armor.ItemGemChest")});
- Item aIchorLegs = (Item) ReflectionUtils.invokeNonBool(aRegistry, aFuckingStupidMethodHandlingMethod, new Object[] {ReflectionUtils.getClass("thaumic.tinkerer.common.item.kami.armor.ItemGemLegs")});
- Item aIchorBoots = (Item) ReflectionUtils.invokeNonBool(aRegistry, aFuckingStupidMethodHandlingMethod, new Object[] {ReflectionUtils.getClass("thaumic.tinkerer.common.item.kami.armor.ItemGemBoots")});
- aItems.add(aIchorHelm);
- aItems.add(aIchorChest);
- aItems.add(aIchorLegs);
- aItems.add(aIchorBoots);
- AutoMap<ItemStack> aItemMap = new AutoMap<ItemStack>();
- int aIndex = 0;
- for (Item aItem : aItems) {
- Item aItemObject = null;
- if (aItem != null) {
- aItemMap.add(ItemUtils.getSimpleStack(aItemObject));
- }
- else {
- Logger.INFO("[Hazmat] Could not get item "+aIndex+" from "+aItemRegistryTT.getName());
- }
- aIndex++;
- }
- Logger.INFO("[Hazmat] Registering "+aItemMap.size()+" Thaumic Tinkerer Items as hazmat gear.");
- for (ItemStack aItem : aItemMap) {
- addProtection(aItem);
- }
- Logger.INFO("[Hazmat] Registered Thaumic Tinkerer Items as hazmat gear.");
- */
- Logger.INFO("[Hazmat] Did not register Thaumic Tinkerer Items as hazmat gear.");
- }
-
- if (LoadedMods.isModLoaded("GraviSuite")) {
- AutoMap<Field> aItemFields = new AutoMap<Field>();
- Class aItemsGravisuite = ReflectionUtils.getClass("gravisuite.GraviSuite");
- aItemFields.add(ReflectionUtils.getField(aItemsGravisuite, "advNanoChestPlate"));
- aItemFields.add(ReflectionUtils.getField(aItemsGravisuite, "graviChestPlate"));
- AutoMap<ItemStack> aGravisuite = new AutoMap<ItemStack>();
- for (Field aItemField : aItemFields) {
- Item aItemObject = ReflectionUtils.getFieldValue(aItemField);
- if (aItemObject != null) {
- aGravisuite.add(ItemUtils.getSimpleStack(aItemObject));
- }
- }
- Logger.INFO("[Hazmat] Registering "+aGravisuite.size()+" Gravisuit Items as hazmat gear.");
- for (ItemStack aItem : aGravisuite) {
- addProtection(aItem);
- }
- Logger.INFO("[Hazmat] Registered Gravisuit Items as hazmat gear.");
- }
-
- if (LoadedMods.isModLoaded("AdvancedSolarPanel")) {
- AutoMap<Field> aItemFields = new AutoMap<Field>();
- Class aItemsEMT = ReflectionUtils.getClass("advsolar.common.AdvancedSolarPanel");
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "advancedSolarHelmet"));
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "hybridSolarHelmet"));
- aItemFields.add(ReflectionUtils.getField(aItemsEMT, "ultimateSolarHelmet"));
- AutoMap<ItemStack> aASP = new AutoMap<ItemStack>();
- for (Field aItemField : aItemFields) {
- Item aItemObject = ReflectionUtils.getFieldValue(aItemField);
- if (aItemObject != null) {
- aASP.add(ItemUtils.getSimpleStack(aItemObject));
- }
- }
- Logger.INFO("[Hazmat] Registering "+aASP.size()+" Adv. Solar Items as hazmat gear.");
- for (ItemStack aItem : aASP) {
- addProtection(aItem);
- }
- Logger.INFO("[Hazmat] Registered Adv. Solar Items as hazmat gear.");
- }
-
- Utils.registerEvent(mInstance);
- Logger.INFO("[Hazmat] Registered Tooltip handler for hazmat gear.");
- mInit = true;
-
- }
-
- private final static String mToolTipText = "Provides protection from:";
-
- @SubscribeEvent
- public void onItemTooltip(ItemTooltipEvent event) {
- //Logger.INFO("Ticking Hazmat handler");
- if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
-
- if (event.itemStack == null || isVanillaHazmatPiece(event.itemStack)) {
- //Logger.INFO("[Hazmat] Invalid Itemstack or vanilla hazmat");
- return;
- } else {
- ItemStack aStackTemp = event.itemStack;
- GT_ItemStack aStack = new GT_ItemStack(aStackTemp);
- if (isNanoArmourPiece(aStackTemp) || isQuantumArmourPiece(aStackTemp)) {
- event.toolTip.add(EnumChatFormatting.DARK_PURPLE+"Provides full hazmat protection.");
- }
- else {
- //Logger.INFO("[Hazmat] Finding Tooltip Data");
- String[] aTooltips = getTooltips(aStack);
- if (aTooltips == null || aTooltips.length == 0) {
- //Logger.INFO("[Hazmat] No Info!");
- return;
- } else {
- //Logger.INFO("[Hazmat] Found Tooltips!");
- if (providesProtection(aStackTemp)) {
- event.toolTip.add(EnumChatFormatting.LIGHT_PURPLE+"Provides full hazmat protection.");
- } else {
- event.toolTip.add(mToolTipText);
- for (String r : aTooltips) {
- event.toolTip.add(" - " + r);
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * Static function to replace
- * {@link #ic2.core.item.armor.ItemArmorHazmat.hasCompleteHazmat(EntityLivingBase)}.
- * Because IC2 doesn't let us register things ourself, anything registered via
- * GT/GT++ will return true.
- *
- * @param living - Entity Wearing Armour
- * @return - Does {@link EntityLivingBase} have a full hazmat suit on?
- */
- public static boolean hasCompleteHazmat(EntityLivingBase living) {
- // Entity is Null, cannot have Hazmat.
- if (living == null || living.isDead) {
- return false;
- } else {
-
- // Map All Player Armour slots
- AutoMap<ItemStack> aEquipment = new AutoMap<ItemStack>();
- for (int i = 1; i < 5; ++i) {
- ItemStack stack = living.getEquipmentInSlot(i);
-
- // Item is Null, cannot have full suit
- if (stack == null) {
- return false;
- } else {
- aEquipment.put(stack);
- }
- }
-
- // Compare Equipment to all items mapped for full hazmat.
- for (ItemStack aSlotStack : aEquipment) {
- if (!isHazmatPiece(aSlotStack)) {
- //Logger.INFO("Found item which is not hazmat. "+ItemUtils.getItemName(aSlotStack));
- return false;
- }
- }
-
- // We are in some kind of full hazmat, huzzah!
- //Logger.INFO("Has full hazmat.");
- return true;
- }
- }
-
- /**
- * Is this item vanilla IC2 hazmat?
- *
- * @param aArmour - The Armour to provide protection.
- * @return
- */
- public static boolean isVanillaHazmatPiece(ItemStack aArmour) {
- return aArmour != null ? aArmour.getItem() instanceof ItemArmorHazmat : false;
- }
-
- /**
- * Is this item vanilla IC2 Nanosuit?
- *
- * @param aArmour - The Armour to provide protection.
- * @return
- */
- public static boolean isNanoArmourPiece(ItemStack aArmour) {
- return aArmour != null ? aArmour.getItem() instanceof ItemArmorNanoSuit : false;
- }
-
- /**
- * Is this item vanilla IC2 Quantum?
- *
- * @param aArmour - The Armour to provide protection.
- * @return
- */
- public static boolean isQuantumArmourPiece(ItemStack aArmour) {
- return aArmour != null ? aArmour.getItem() instanceof ItemArmorQuantumSuit : false;
- }
-
- /**
- * Is this item a registered piece of full hazmat? (Provides all 6 protections)
- *
- * @param aStack - The Armour to provide protection.
- * @return
- */
- public static boolean isHazmatPiece(ItemStack aStack) {
- return isVanillaHazmatPiece(aStack) || providesProtection(aStack);
- }
-
- /**
- * Registers the {@link ItemStack} to all types of protection. Provides full
- * hazmat protection. Frost, Fire, Bio, Gas, Radioaton & Electricity.
- *
- * @param aStack - The Armour to provide protection.
- * @return - Did we register this ItemStack properly?
- */
- public static boolean addProtection(ItemStack aVanStack) {
- if (!ItemUtils.checkForInvalidItems(aVanStack)) {
- Logger.INFO("=================Bad Hazmat Addition======================");
- Logger.INFO("Called from: "+ReflectionUtils.getMethodName(0));
- Logger.INFO(ReflectionUtils.getMethodName(1));
- Logger.INFO(ReflectionUtils.getMethodName(2));
- Logger.INFO(ReflectionUtils.getMethodName(3));
- Logger.INFO(ReflectionUtils.getMethodName(4));
- Logger.INFO(ReflectionUtils.getMethodName(5));
- Logger.INFO(ReflectionUtils.getMethodName(6));
- Logger.INFO("==========================================================");
- return false;
- }
- Logger.INFO("[Hazmat] Registering " + ItemUtils.getItemName(aVanStack) + " for full Hazmat protection.");
- GT_ItemStack aStack = getGtStackFromVanilla(aVanStack);
- AutoMap<Boolean> aAdded = new AutoMap<Boolean>();
- aAdded.put(addProtection_Frost(aStack));
- aAdded.put(addProtection_Fire(aStack));
- aAdded.put(addProtection_Biohazard(aStack));
- aAdded.put(addProtection_Gas(aStack));
- aAdded.put(addProtection_Radiation(aStack));
- aAdded.put(addProtection_Electricty(aStack));
- for (boolean b : aAdded) {
- if (!b) {
- return false;
- }
- }
- Logger.INFO("[Hazmat] Protection added for all 6 damage types, registering to master Hazmat list.");
- sHazmatList.add(aStack);
- return true;
- }
-
- public static boolean addProtection_Frost(GT_ItemStack aStack) {
- registerTooltip(aStack, EnumChatFormatting.AQUA + "Frost");
- return addProtection_Generic(sFrostHazmatList, aStack);
- }
-
- public static boolean addProtection_Fire(GT_ItemStack aStack) {
- registerTooltip(aStack, EnumChatFormatting.DARK_RED + "Heat");
- return addProtection_Generic(sHeatHazmatList, aStack);
- }
-
- public static boolean addProtection_Biohazard(GT_ItemStack aStack) {
- registerTooltip(aStack, EnumChatFormatting.GREEN + "Biohazards");
- return addProtection_Generic(sBioHazmatList, aStack);
- }
-
- public static boolean addProtection_Gas(GT_ItemStack aStack) {
- registerTooltip(aStack, EnumChatFormatting.WHITE + "Gas");
- return addProtection_Generic(sGasHazmatList, aStack);
- }
-
- public static boolean addProtection_Radiation(GT_ItemStack aStack) {
- registerTooltip(aStack, EnumChatFormatting.DARK_GREEN + "Radiation");
- return addProtection_Generic(sRadioHazmatList, aStack);
- }
-
- public static boolean addProtection_Electricty(GT_ItemStack aStack) {
- registerTooltip(aStack, EnumChatFormatting.YELLOW + "Electricity");
- return addProtection_Generic(sElectroHazmatList, aStack);
- }
-
- private static boolean addProtection_Generic(GT_HashSet<GT_ItemStack> aSet, GT_ItemStack aStack) {
- int aMapSize = aSet.size();
- aSet.add(aStack);
- return aMapSize < aSet.size();
- }
-
- /**
- * Does this item provide hazmat protection? (Protection against Frost, Heat,
- * Bio, Gas, Rads, Elec) An item may return false even if it protects against
- * all six damage types. This is because it's not actually registered as hazmat
- * correct.
- *
- * @param aStack - The item to check for protection
- * @return
- */
- public static boolean providesProtection(ItemStack aStack) {
- return providesProtetion_Generic(sHazmatList, aStack);
- }
-
- public static boolean providesProtetion_Frost(ItemStack aStack) {
- return providesProtetion_Generic(sFrostHazmatList, aStack);
- }
-
- public static boolean providesProtetion_Fire(ItemStack aStack) {
- return providesProtetion_Generic(sHeatHazmatList, aStack);
- }
-
- public static boolean providesProtetion_Biohazard(ItemStack aStack) {
- return providesProtetion_Generic(sBioHazmatList, aStack);
- }
-
- public static boolean providesProtetion_Gas(ItemStack aStack) {
- return providesProtetion_Generic(sGasHazmatList, aStack);
- }
-
- public static boolean providesProtetion_Radiation(ItemStack aStack) {
- return providesProtetion_Generic(sRadioHazmatList, aStack);
- }
-
- public static boolean providesProtetion_Electricity(ItemStack aStack) {
- return providesProtetion_Generic(sElectroHazmatList, aStack);
- }
-
- private static boolean providesProtetion_Generic(GT_HashSet<GT_ItemStack> aSet, ItemStack aStack) {
- if (isVanillaHazmatPiece(aStack)) {
- return true;
- }
- for (GT_ItemStack o : aSet) {
- if (o != null && o.mItem != null && aStack != null && aStack.getItem() != null) {
- if (GT_Utility.areStacksEqual(o.toStack(), aStack, true)) {
- return true;
- }
- if (o.isStackEqual(aStack)){
- return true;
- }
- if (o.mItem == aStack.getItem() && EnergyUtils.EU.isElectricItem(aStack)) {
- return true;
- }
- }
- }
- return false;
- }
-
- private static String[] getTooltips(GT_ItemStack aStack) {
- String aKey = convertGtItemstackToStringDataIgnoreDamage(aStack);
- AutoMap<String> aTempTooltipData = mToolTips.get(aKey);
- if (aTempTooltipData == null || aTempTooltipData.isEmpty()) {
- //Logger.INFO("[Hazmat] Item was not mapped for TTs - "+aKey);
- return new String[] {};
- } else {
- //Logger.INFO("[Hazmat] Item was mapped for TTs");
- //Collections.sort(aTempTooltipData);
- //Logger.INFO("[Hazmat] Sorted TTs");
-
- String[] mBuiltOutput = new String[aTempTooltipData.size()];
- int aIndex = 0;
- for (String i : aTempTooltipData) {
- mBuiltOutput[aIndex++] = i;
- }
-
- return mBuiltOutput;
- }
- }
-
- private static void registerTooltip(GT_ItemStack aStack, String aTooltip) {
- String aKey = convertGtItemstackToStringDataIgnoreDamage(aStack);
- Logger.INFO("[Hazmat] Mapping " + aTooltip + " for " + aKey);
- AutoMap<String> aTempTooltipData = mToolTips.get(aKey);
- if (aTempTooltipData == null) {
- Logger.INFO("No data mapped yet, creating.");
- aTempTooltipData = new AutoMap<String>();
- mToolTips.put(aKey, aTempTooltipData);
- }
- aTempTooltipData.add(aTooltip);
- }
-
- public static ItemStack getStackFromGtStack(GT_ItemStack aGtStack) {
- return ItemUtils.simpleMetaStack(aGtStack.mItem, aGtStack.mMetaData, aGtStack.mStackSize);
- }
-
- public static GT_ItemStack getGtStackFromVanilla(ItemStack aStack) {
- return new GT_ItemStack(aStack);
- }
-
- private static String convertGtItemstackToStringData(GT_ItemStack aStack) {
- if (aStack == null) {
- return "NULL";
- } else {
- return aStack.mItem.getUnlocalizedName() + "." + aStack.mMetaData + "." + aStack.mStackSize;
- }
- }
-
- private static String convertGtItemstackToStringDataIgnoreDamage(GT_ItemStack aStack) {
- if (aStack == null) {
- return "NULL";
- } else {
- return aStack.mItem.getUnlocalizedName() + "." + aStack.mStackSize;
- }
- }
-
+ public static final GT_HashSet<GT_ItemStack> sHazmatList = new GT_HashSet<GT_ItemStack>();
+
+ private static final HashMap<String, AutoMap<String>> mToolTips = new HashMap<String, AutoMap<String>>();
+
+ private static boolean mInit = false;
+ private static HazmatUtils mInstance;
+
+ @SuppressWarnings("rawtypes")
+ public static void init() {
+ if (mInit) {
+ return;
+ }
+ // doInit(); Disabled, hazmat moved to gt5u
+ }
+
+ public static void doInit() {
+
+ mInstance = new HazmatUtils();
+
+ sHazmatList.add(ItemUtils.getSimpleStack(Ic2Items.hazmatHelmet, 1));
+ sHazmatList.add(ItemUtils.getSimpleStack(Ic2Items.hazmatChestplate, 1));
+ sHazmatList.add(ItemUtils.getSimpleStack(Ic2Items.hazmatLeggings, 1));
+ sHazmatList.add(ItemUtils.getSimpleStack(Ic2Items.hazmatBoots, 1));
+
+ // Make Nano a hazmat suit
+ // Make Quantum a hazmat suit
+
+ if (LoadedMods.IndustrialCraft2 || LoadedMods.IndustrialCraft2Classic) {
+ AutoMap<ItemStack> aVanillaIC2Armour = new AutoMap<ItemStack>();
+ aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.nanoHelmet, 1));
+ aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.nanoBodyarmor, 1));
+ aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.nanoLeggings, 1));
+ aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.nanoBoots, 1));
+ aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.quantumHelmet, 1));
+ aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.quantumBodyarmor, 1));
+ aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.quantumLeggings, 1));
+ aVanillaIC2Armour.add(ItemUtils.getSimpleStack(Ic2Items.quantumBoots, 1));
+ for (ItemStack aItem : aVanillaIC2Armour) {
+ addProtection(aItem);
+ }
+ Logger.INFO("[Hazmat] Registered IC2 Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("EMT")) {
+ AutoMap<Field> aItemFields = new AutoMap<Field>();
+ Class aItemsEMT = ReflectionUtils.getClass("emt.init.EMTItems");
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "nanoThaumicHelmet"));
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "nanoWing"));
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "nanoBootsTraveller"));
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "quantumThaumicHelmet"));
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "quantumWing"));
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "quantumArmor"));
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "quantumBootsTraveller"));
+ AutoMap<ItemStack> aEMT = new AutoMap<ItemStack>();
+ for (Field aItemField : aItemFields) {
+ Item aItemObject = null;
+ if (aItemField != null) {
+ try {
+ aItemObject = (Item) aItemField.get(null);
+ } catch (Exception t) {
+ t.printStackTrace();
+ }
+ }
+ if (aItemObject != null) {
+ aEMT.add(ItemUtils.getSimpleStack(aItemObject));
+ } else {
+ Logger.INFO("[Hazmat] Could not get " + aItemField.getName() + " from " + aItemsEMT.getName());
+ }
+ }
+ Logger.INFO("[Hazmat] Registering " + aEMT.size() + " EMT Items as hazmat gear.");
+ for (ItemStack aItem : aEMT) {
+ addProtection(aItem);
+ }
+ Logger.INFO("[Hazmat] Registered EMT Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("DraconicEvolution")) {
+ AutoMap<Field> aItemFields = new AutoMap<Field>();
+ Class aItemsDE = ReflectionUtils.getClass("com.brandon3055.draconicevolution.ModItems");
+
+ aItemFields.add(ReflectionUtils.getField(aItemsDE, "draconicHelm"));
+ aItemFields.add(ReflectionUtils.getField(aItemsDE, "draconicChest"));
+ aItemFields.add(ReflectionUtils.getField(aItemsDE, "draconicLeggs"));
+ aItemFields.add(ReflectionUtils.getField(aItemsDE, "draconicBoots"));
+ aItemFields.add(ReflectionUtils.getField(aItemsDE, "wyvernHelm"));
+ aItemFields.add(ReflectionUtils.getField(aItemsDE, "wyvernChest"));
+ aItemFields.add(ReflectionUtils.getField(aItemsDE, "wyvernLeggs"));
+ aItemFields.add(ReflectionUtils.getField(aItemsDE, "wyvernBoots"));
+ AutoMap<ItemStack> aItemMap = new AutoMap<ItemStack>();
+ for (Field aItemField : aItemFields) {
+ Item aItemObject = null;
+ if (aItemField != null) {
+ try {
+ aItemObject = (Item) aItemField.get(null);
+ } catch (Exception t) {
+ t.printStackTrace();
+ }
+ }
+ if (aItemObject != null) {
+ aItemMap.add(ItemUtils.getSimpleStack(aItemObject));
+ } else {
+ Logger.INFO("[Hazmat] Could not get " + aItemField.getName() + " from " + aItemsDE.getName());
+ }
+ }
+ Logger.INFO("[Hazmat] Registering " + aItemMap.size() + " Draconic Evolution Items as hazmat gear.");
+ for (ItemStack aItem : aItemMap) {
+ addProtection(aItem);
+ }
+ Logger.INFO("[Hazmat] Registered Draconic Evolution Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("TaintedMagic")) {
+ AutoMap<Field> aItemFields = new AutoMap<Field>();
+ Class aItemsTaintedMagic = ReflectionUtils.getClass("taintedmagic.common.registry.ItemRegistry");
+
+ aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemShadowFortressHelmet"));
+ aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemShadowFortressChestplate"));
+ aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemShadowFortressLeggings"));
+ aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemVoidwalkerBoots"));
+ AutoMap<ItemStack> aItemMap = new AutoMap<ItemStack>();
+ for (Field aItemField : aItemFields) {
+ Item aItemObject = null;
+ if (aItemField != null) {
+ try {
+ aItemObject = (Item) aItemField.get(null);
+ } catch (Exception t) {
+ t.printStackTrace();
+ }
+ }
+ if (aItemObject != null) {
+ aItemMap.add(ItemUtils.getSimpleStack(aItemObject));
+ } else {
+ Logger.INFO(
+ "[Hazmat] Could not get " + aItemField.getName() + " from " + aItemsTaintedMagic.getName());
+ }
+ }
+ Logger.INFO("[Hazmat] Registering " + aItemMap.size() + " Tainted Magic Items as hazmat gear.");
+ for (ItemStack aItem : aItemMap) {
+ addProtection(aItem);
+ }
+ Logger.INFO("[Hazmat] Registered Tainted Magic Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("WitchingGadgets")) {
+ AutoMap<Field> aItemFields = new AutoMap<Field>();
+ Class aItemsTaintedMagic = ReflectionUtils.getClass("witchinggadgets.common.WGContent");
+
+ aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemPrimordialHelm"));
+ aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemPrimordialChest"));
+ aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemPrimordialLegs"));
+ aItemFields.add(ReflectionUtils.getField(aItemsTaintedMagic, "ItemPrimordialBoots"));
+ AutoMap<ItemStack> aItemMap = new AutoMap<ItemStack>();
+ for (Field aItemField : aItemFields) {
+ Item aItemObject = null;
+ if (aItemField != null) {
+ try {
+ aItemObject = (Item) aItemField.get(null);
+ } catch (Exception t) {
+ t.printStackTrace();
+ }
+ }
+ if (aItemObject != null) {
+ aItemMap.add(ItemUtils.getSimpleStack(aItemObject));
+ } else {
+ Logger.INFO(
+ "[Hazmat] Could not get " + aItemField.getName() + " from " + aItemsTaintedMagic.getName());
+ }
+ }
+ Logger.INFO("[Hazmat] Registering " + aItemMap.size() + " Witching Gadgets Items as hazmat gear.");
+ for (ItemStack aItem : aItemMap) {
+ addProtection(aItem);
+ }
+ Logger.INFO("[Hazmat] Registered Witching Gadgets Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("ThaumicTinkerer")) {
+ /*
+ AutoMap<Item> aItems = new AutoMap<Item>();
+ Class aMainTT = ReflectionUtils.getClass("thaumic.tinkerer.common.ThaumicTinkerer");
+ Class aItemRegistryTT = ReflectionUtils.getClass("thaumic.tinkerer.common.registry.TTRegistry");
+ Field aRegistryInstance = ReflectionUtils.getField(aMainTT, "registry");
+ Object aRegistry = ReflectionUtils.getFieldValue(aRegistryInstance);
+ Method aFuckingStupidMethodHandlingMethod = ReflectionUtils.getMethod(aItemRegistryTT, "getFirstItemFromClass", new Class[] {Class.class});
+ Item aIchorHelm = (Item) ReflectionUtils.invokeNonBool(aRegistry, aFuckingStupidMethodHandlingMethod, new Object[] {ReflectionUtils.getClass("thaumic.tinkerer.common.item.kami.armor.ItemGemHelm")});
+ Item aIchorChest = (Item) ReflectionUtils.invokeNonBool(aRegistry, aFuckingStupidMethodHandlingMethod, new Object[] {ReflectionUtils.getClass("thaumic.tinkerer.common.item.kami.armor.ItemGemChest")});
+ Item aIchorLegs = (Item) ReflectionUtils.invokeNonBool(aRegistry, aFuckingStupidMethodHandlingMethod, new Object[] {ReflectionUtils.getClass("thaumic.tinkerer.common.item.kami.armor.ItemGemLegs")});
+ Item aIchorBoots = (Item) ReflectionUtils.invokeNonBool(aRegistry, aFuckingStupidMethodHandlingMethod, new Object[] {ReflectionUtils.getClass("thaumic.tinkerer.common.item.kami.armor.ItemGemBoots")});
+ aItems.add(aIchorHelm);
+ aItems.add(aIchorChest);
+ aItems.add(aIchorLegs);
+ aItems.add(aIchorBoots);
+ AutoMap<ItemStack> aItemMap = new AutoMap<ItemStack>();
+ int aIndex = 0;
+ for (Item aItem : aItems) {
+ Item aItemObject = null;
+ if (aItem != null) {
+ aItemMap.add(ItemUtils.getSimpleStack(aItemObject));
+ }
+ else {
+ Logger.INFO("[Hazmat] Could not get item "+aIndex+" from "+aItemRegistryTT.getName());
+ }
+ aIndex++;
+ }
+ Logger.INFO("[Hazmat] Registering "+aItemMap.size()+" Thaumic Tinkerer Items as hazmat gear.");
+ for (ItemStack aItem : aItemMap) {
+ addProtection(aItem);
+ }
+ Logger.INFO("[Hazmat] Registered Thaumic Tinkerer Items as hazmat gear.");
+ */
+ Logger.INFO("[Hazmat] Did not register Thaumic Tinkerer Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("GraviSuite")) {
+ AutoMap<Field> aItemFields = new AutoMap<Field>();
+ Class aItemsGravisuite = ReflectionUtils.getClass("gravisuite.GraviSuite");
+ aItemFields.add(ReflectionUtils.getField(aItemsGravisuite, "advNanoChestPlate"));
+ aItemFields.add(ReflectionUtils.getField(aItemsGravisuite, "graviChestPlate"));
+ AutoMap<ItemStack> aGravisuite = new AutoMap<ItemStack>();
+ for (Field aItemField : aItemFields) {
+ Item aItemObject = ReflectionUtils.getFieldValue(aItemField);
+ if (aItemObject != null) {
+ aGravisuite.add(ItemUtils.getSimpleStack(aItemObject));
+ }
+ }
+ Logger.INFO("[Hazmat] Registering " + aGravisuite.size() + " Gravisuit Items as hazmat gear.");
+ for (ItemStack aItem : aGravisuite) {
+ addProtection(aItem);
+ }
+ Logger.INFO("[Hazmat] Registered Gravisuit Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("AdvancedSolarPanel")) {
+ AutoMap<Field> aItemFields = new AutoMap<Field>();
+ Class aItemsEMT = ReflectionUtils.getClass("advsolar.common.AdvancedSolarPanel");
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "advancedSolarHelmet"));
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "hybridSolarHelmet"));
+ aItemFields.add(ReflectionUtils.getField(aItemsEMT, "ultimateSolarHelmet"));
+ AutoMap<ItemStack> aASP = new AutoMap<ItemStack>();
+ for (Field aItemField : aItemFields) {
+ Item aItemObject = ReflectionUtils.getFieldValue(aItemField);
+ if (aItemObject != null) {
+ aASP.add(ItemUtils.getSimpleStack(aItemObject));
+ }
+ }
+ Logger.INFO("[Hazmat] Registering " + aASP.size() + " Adv. Solar Items as hazmat gear.");
+ for (ItemStack aItem : aASP) {
+ addProtection(aItem);
+ }
+ Logger.INFO("[Hazmat] Registered Adv. Solar Items as hazmat gear.");
+ }
+
+ Utils.registerEvent(mInstance);
+ Logger.INFO("[Hazmat] Registered Tooltip handler for hazmat gear.");
+ mInit = true;
+ }
+
+ private static final String mToolTipText = "Provides protection from:";
+
+ @SubscribeEvent
+ public void onItemTooltip(ItemTooltipEvent event) {
+ // Logger.INFO("Ticking Hazmat handler");
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+
+ if (event.itemStack == null || isVanillaHazmatPiece(event.itemStack)) {
+ // Logger.INFO("[Hazmat] Invalid Itemstack or vanilla hazmat");
+ return;
+ } else {
+ ItemStack aStackTemp = event.itemStack;
+ GT_ItemStack aStack = new GT_ItemStack(aStackTemp);
+ if (isNanoArmourPiece(aStackTemp) || isQuantumArmourPiece(aStackTemp)) {
+ event.toolTip.add(EnumChatFormatting.DARK_PURPLE + "Provides full hazmat protection.");
+ } else {
+ // Logger.INFO("[Hazmat] Finding Tooltip Data");
+ String[] aTooltips = getTooltips(aStack);
+ if (aTooltips == null || aTooltips.length == 0) {
+ // Logger.INFO("[Hazmat] No Info!");
+ return;
+ } else {
+ // Logger.INFO("[Hazmat] Found Tooltips!");
+ if (providesProtection(aStackTemp)) {
+ event.toolTip.add(EnumChatFormatting.LIGHT_PURPLE + "Provides full hazmat protection.");
+ } else {
+ event.toolTip.add(mToolTipText);
+ for (String r : aTooltips) {
+ event.toolTip.add(" - " + r);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Static function to replace
+ * {@link #ic2.core.item.armor.ItemArmorHazmat.hasCompleteHazmat(EntityLivingBase)}.
+ * Because IC2 doesn't let us register things ourself, anything registered via
+ * GT/GT++ will return true.
+ *
+ * @param living - Entity Wearing Armour
+ * @return - Does {@link EntityLivingBase} have a full hazmat suit on?
+ */
+ public static boolean hasCompleteHazmat(EntityLivingBase living) {
+ // Entity is Null, cannot have Hazmat.
+ if (living == null || living.isDead) {
+ return false;
+ } else {
+
+ // Map All Player Armour slots
+ AutoMap<ItemStack> aEquipment = new AutoMap<ItemStack>();
+ for (int i = 1; i < 5; ++i) {
+ ItemStack stack = living.getEquipmentInSlot(i);
+
+ // Item is Null, cannot have full suit
+ if (stack == null) {
+ return false;
+ } else {
+ aEquipment.put(stack);
+ }
+ }
+
+ // Compare Equipment to all items mapped for full hazmat.
+ for (ItemStack aSlotStack : aEquipment) {
+ if (!isHazmatPiece(aSlotStack)) {
+ // Logger.INFO("Found item which is not hazmat. "+ItemUtils.getItemName(aSlotStack));
+ return false;
+ }
+ }
+
+ // We are in some kind of full hazmat, huzzah!
+ // Logger.INFO("Has full hazmat.");
+ return true;
+ }
+ }
+
+ /**
+ * Is this item vanilla IC2 hazmat?
+ *
+ * @param aArmour - The Armour to provide protection.
+ * @return
+ */
+ public static boolean isVanillaHazmatPiece(ItemStack aArmour) {
+ return aArmour != null ? aArmour.getItem() instanceof ItemArmorHazmat : false;
+ }
+
+ /**
+ * Is this item vanilla IC2 Nanosuit?
+ *
+ * @param aArmour - The Armour to provide protection.
+ * @return
+ */
+ public static boolean isNanoArmourPiece(ItemStack aArmour) {
+ return aArmour != null ? aArmour.getItem() instanceof ItemArmorNanoSuit : false;
+ }
+
+ /**
+ * Is this item vanilla IC2 Quantum?
+ *
+ * @param aArmour - The Armour to provide protection.
+ * @return
+ */
+ public static boolean isQuantumArmourPiece(ItemStack aArmour) {
+ return aArmour != null ? aArmour.getItem() instanceof ItemArmorQuantumSuit : false;
+ }
+
+ /**
+ * Is this item a registered piece of full hazmat? (Provides all 6 protections)
+ *
+ * @param aStack - The Armour to provide protection.
+ * @return
+ */
+ public static boolean isHazmatPiece(ItemStack aStack) {
+ return isVanillaHazmatPiece(aStack) || providesProtection(aStack);
+ }
+
+ /**
+ * Registers the {@link ItemStack} to all types of protection. Provides full
+ * hazmat protection. Frost, Fire, Bio, Gas, Radioaton & Electricity.
+ *
+ * @param aStack - The Armour to provide protection.
+ * @return - Did we register this ItemStack properly?
+ */
+ public static boolean addProtection(ItemStack aVanStack) {
+ if (!ItemUtils.checkForInvalidItems(aVanStack)) {
+ Logger.INFO("=================Bad Hazmat Addition======================");
+ Logger.INFO("Called from: " + ReflectionUtils.getMethodName(0));
+ Logger.INFO(ReflectionUtils.getMethodName(1));
+ Logger.INFO(ReflectionUtils.getMethodName(2));
+ Logger.INFO(ReflectionUtils.getMethodName(3));
+ Logger.INFO(ReflectionUtils.getMethodName(4));
+ Logger.INFO(ReflectionUtils.getMethodName(5));
+ Logger.INFO(ReflectionUtils.getMethodName(6));
+ Logger.INFO("==========================================================");
+ return false;
+ }
+ Logger.INFO("[Hazmat] Registering " + ItemUtils.getItemName(aVanStack) + " for full Hazmat protection.");
+ GT_ItemStack aStack = getGtStackFromVanilla(aVanStack);
+ AutoMap<Boolean> aAdded = new AutoMap<Boolean>();
+ aAdded.put(addProtection_Frost(aStack));
+ aAdded.put(addProtection_Fire(aStack));
+ aAdded.put(addProtection_Biohazard(aStack));
+ aAdded.put(addProtection_Gas(aStack));
+ aAdded.put(addProtection_Radiation(aStack));
+ aAdded.put(addProtection_Electricty(aStack));
+ for (boolean b : aAdded) {
+ if (!b) {
+ return false;
+ }
+ }
+ Logger.INFO("[Hazmat] Protection added for all 6 damage types, registering to master Hazmat list.");
+ sHazmatList.add(aStack);
+ return true;
+ }
+
+ public static boolean addProtection_Frost(GT_ItemStack aStack) {
+ registerTooltip(aStack, EnumChatFormatting.AQUA + "Frost");
+ return addProtection_Generic(sFrostHazmatList, aStack);
+ }
+
+ public static boolean addProtection_Fire(GT_ItemStack aStack) {
+ registerTooltip(aStack, EnumChatFormatting.DARK_RED + "Heat");
+ return addProtection_Generic(sHeatHazmatList, aStack);
+ }
+
+ public static boolean addProtection_Biohazard(GT_ItemStack aStack) {
+ registerTooltip(aStack, EnumChatFormatting.GREEN + "Biohazards");
+ return addProtection_Generic(sBioHazmatList, aStack);
+ }
+
+ public static boolean addProtection_Gas(GT_ItemStack aStack) {
+ registerTooltip(aStack, EnumChatFormatting.WHITE + "Gas");
+ return addProtection_Generic(sGasHazmatList, aStack);
+ }
+
+ public static boolean addProtection_Radiation(GT_ItemStack aStack) {
+ registerTooltip(aStack, EnumChatFormatting.DARK_GREEN + "Radiation");
+ return addProtection_Generic(sRadioHazmatList, aStack);
+ }
+
+ public static boolean addProtection_Electricty(GT_ItemStack aStack) {
+ registerTooltip(aStack, EnumChatFormatting.YELLOW + "Electricity");
+ return addProtection_Generic(sElectroHazmatList, aStack);
+ }
+
+ private static boolean addProtection_Generic(GT_HashSet<GT_ItemStack> aSet, GT_ItemStack aStack) {
+ int aMapSize = aSet.size();
+ aSet.add(aStack);
+ return aMapSize < aSet.size();
+ }
+
+ /**
+ * Does this item provide hazmat protection? (Protection against Frost, Heat,
+ * Bio, Gas, Rads, Elec) An item may return false even if it protects against
+ * all six damage types. This is because it's not actually registered as hazmat
+ * correct.
+ *
+ * @param aStack - The item to check for protection
+ * @return
+ */
+ public static boolean providesProtection(ItemStack aStack) {
+ return providesProtetion_Generic(sHazmatList, aStack);
+ }
+
+ public static boolean providesProtetion_Frost(ItemStack aStack) {
+ return providesProtetion_Generic(sFrostHazmatList, aStack);
+ }
+
+ public static boolean providesProtetion_Fire(ItemStack aStack) {
+ return providesProtetion_Generic(sHeatHazmatList, aStack);
+ }
+
+ public static boolean providesProtetion_Biohazard(ItemStack aStack) {
+ return providesProtetion_Generic(sBioHazmatList, aStack);
+ }
+
+ public static boolean providesProtetion_Gas(ItemStack aStack) {
+ return providesProtetion_Generic(sGasHazmatList, aStack);
+ }
+
+ public static boolean providesProtetion_Radiation(ItemStack aStack) {
+ return providesProtetion_Generic(sRadioHazmatList, aStack);
+ }
+
+ public static boolean providesProtetion_Electricity(ItemStack aStack) {
+ return providesProtetion_Generic(sElectroHazmatList, aStack);
+ }
+
+ private static boolean providesProtetion_Generic(GT_HashSet<GT_ItemStack> aSet, ItemStack aStack) {
+ if (isVanillaHazmatPiece(aStack)) {
+ return true;
+ }
+ for (GT_ItemStack o : aSet) {
+ if (o != null && o.mItem != null && aStack != null && aStack.getItem() != null) {
+ if (GT_Utility.areStacksEqual(o.toStack(), aStack, true)) {
+ return true;
+ }
+ if (o.isStackEqual(aStack)) {
+ return true;
+ }
+ if (o.mItem == aStack.getItem() && EnergyUtils.EU.isElectricItem(aStack)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private static String[] getTooltips(GT_ItemStack aStack) {
+ String aKey = convertGtItemstackToStringDataIgnoreDamage(aStack);
+ AutoMap<String> aTempTooltipData = mToolTips.get(aKey);
+ if (aTempTooltipData == null || aTempTooltipData.isEmpty()) {
+ // Logger.INFO("[Hazmat] Item was not mapped for TTs - "+aKey);
+ return new String[] {};
+ } else {
+ // Logger.INFO("[Hazmat] Item was mapped for TTs");
+ // Collections.sort(aTempTooltipData);
+ // Logger.INFO("[Hazmat] Sorted TTs");
+
+ String[] mBuiltOutput = new String[aTempTooltipData.size()];
+ int aIndex = 0;
+ for (String i : aTempTooltipData) {
+ mBuiltOutput[aIndex++] = i;
+ }
+
+ return mBuiltOutput;
+ }
+ }
+
+ private static void registerTooltip(GT_ItemStack aStack, String aTooltip) {
+ String aKey = convertGtItemstackToStringDataIgnoreDamage(aStack);
+ Logger.INFO("[Hazmat] Mapping " + aTooltip + " for " + aKey);
+ AutoMap<String> aTempTooltipData = mToolTips.get(aKey);
+ if (aTempTooltipData == null) {
+ Logger.INFO("No data mapped yet, creating.");
+ aTempTooltipData = new AutoMap<String>();
+ mToolTips.put(aKey, aTempTooltipData);
+ }
+ aTempTooltipData.add(aTooltip);
+ }
+
+ public static ItemStack getStackFromGtStack(GT_ItemStack aGtStack) {
+ return ItemUtils.simpleMetaStack(aGtStack.mItem, aGtStack.mMetaData, aGtStack.mStackSize);
+ }
+
+ public static GT_ItemStack getGtStackFromVanilla(ItemStack aStack) {
+ return new GT_ItemStack(aStack);
+ }
+
+ private static String convertGtItemstackToStringData(GT_ItemStack aStack) {
+ if (aStack == null) {
+ return "NULL";
+ } else {
+ return aStack.mItem.getUnlocalizedName() + "." + aStack.mMetaData + "." + aStack.mStackSize;
+ }
+ }
+
+ private static String convertGtItemstackToStringDataIgnoreDamage(GT_ItemStack aStack) {
+ if (aStack == null) {
+ return "NULL";
+ } else {
+ return aStack.mItem.getUnlocalizedName() + "." + aStack.mStackSize;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java
index fe67c88d69..8fc5b90b62 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/InventoryUtils.java
@@ -1,12 +1,10 @@
package gtPlusPlus.core.util.minecraft;
-import java.util.Random;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.IInventory;
@@ -16,73 +14,82 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class InventoryUtils {
-
- private final static Random mRandom = new Random();
-
- public static void dropInventoryItems(World world, int x, int y, int z, Block block) {
- TileEntity tileentity = world.getTileEntity(x, y, z);
- if (tileentity != null && tileentity instanceof IInventory && ((IInventory) tileentity).getSizeInventory() > 0) {
-
- IInventory aTileInv = (IInventory) tileentity;
- int aMinSlot = 0;
- int aMaxSlot = aTileInv.getSizeInventory()-1;
-
- for (int i1 = aMinSlot; i1 < aMaxSlot; ++i1) {
- ItemStack itemstack = aTileInv.getStackInSlot(i1);
+ private static final Random mRandom = new Random();
+
+ public static void dropInventoryItems(World world, int x, int y, int z, Block block) {
+ TileEntity tileentity = world.getTileEntity(x, y, z);
+
+ if (tileentity != null
+ && tileentity instanceof IInventory
+ && ((IInventory) tileentity).getSizeInventory() > 0) {
+
+ IInventory aTileInv = (IInventory) tileentity;
+ int aMinSlot = 0;
+ int aMaxSlot = aTileInv.getSizeInventory() - 1;
- if (itemstack != null) {
- float f = mRandom.nextFloat() * 0.8F + 0.1F;
- float f1 = mRandom.nextFloat() * 0.8F + 0.1F;
- EntityItem entityitem;
+ for (int i1 = aMinSlot; i1 < aMaxSlot; ++i1) {
+ ItemStack itemstack = aTileInv.getStackInSlot(i1);
- for (float f2 = mRandom.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem)) {
- int j1 = mRandom.nextInt(21) + 10;
+ if (itemstack != null) {
+ float f = mRandom.nextFloat() * 0.8F + 0.1F;
+ float f1 = mRandom.nextFloat() * 0.8F + 0.1F;
+ EntityItem entityitem;
- if (j1 > itemstack.stackSize) {
- j1 = itemstack.stackSize;
- }
+ for (float f2 = mRandom.nextFloat() * 0.8F + 0.1F;
+ itemstack.stackSize > 0;
+ world.spawnEntityInWorld(entityitem)) {
+ int j1 = mRandom.nextInt(21) + 10;
- itemstack.stackSize -= j1;
- entityitem = new EntityItem(world, x + f, y + f1, z + f2,
- new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
- float f3 = 0.05F;
- entityitem.motionX = (float) mRandom.nextGaussian() * f3;
- entityitem.motionY = (float) mRandom.nextGaussian() * f3 + 0.2F;
- entityitem.motionZ = (float) mRandom.nextGaussian() * f3;
+ if (j1 > itemstack.stackSize) {
+ j1 = itemstack.stackSize;
+ }
- if (itemstack.hasTagCompound()) {
- entityitem.getEntityItem()
- .setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
- }
- }
- }
- }
+ itemstack.stackSize -= j1;
+ entityitem = new EntityItem(
+ world,
+ x + f,
+ y + f1,
+ z + f2,
+ new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
+ float f3 = 0.05F;
+ entityitem.motionX = (float) mRandom.nextGaussian() * f3;
+ entityitem.motionY = (float) mRandom.nextGaussian() * f3 + 0.2F;
+ entityitem.motionZ = (float) mRandom.nextGaussian() * f3;
- world.func_147453_f(x, y, z, block);
- }
+ if (itemstack.hasTagCompound()) {
+ entityitem.getEntityItem().setTagCompound((NBTTagCompound)
+ itemstack.getTagCompound().copy());
+ }
+ }
+ }
+ }
- }
+ world.func_147453_f(x, y, z, block);
+ }
+ }
- public static void sortInventoryItems(MetaTileEntity aTile) {
- sortInventoryItems(aTile.getBaseMetaTileEntity());
- }
+ public static void sortInventoryItems(MetaTileEntity aTile) {
+ sortInventoryItems(aTile.getBaseMetaTileEntity());
+ }
- public static void sortInventoryItems(IGregTechTileEntity aBaseMetaTileEntity) {
- IInventory mInv = aBaseMetaTileEntity.getIInventory(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord());
- AutoMap<ItemStack> aInvContents = new AutoMap<ItemStack>();
- int aSize = mInv.getSizeInventory();
- for (int slot=0; slot<aSize; slot++) {
- aInvContents.put(mInv.getStackInSlot(slot));
- }
- ItemStack[] mInventory = aInvContents.toArray();
- 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(aBaseMetaTileEntity, aBaseMetaTileEntity, j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- }
- }
- }
- }
-
+ public static void sortInventoryItems(IGregTechTileEntity aBaseMetaTileEntity) {
+ IInventory mInv = aBaseMetaTileEntity.getIInventory(
+ aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord());
+ AutoMap<ItemStack> aInvContents = new AutoMap<ItemStack>();
+ int aSize = mInv.getSizeInventory();
+ for (int slot = 0; slot < aSize; slot++) {
+ aInvContents.put(mInv.getStackInSlot(slot));
+ }
+ ItemStack[] mInventory = aInvContents.toArray();
+ 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(
+ aBaseMetaTileEntity, aBaseMetaTileEntity, j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index 32d838b036..ad7bcdd063 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -1,10 +1,5 @@
package gtPlusPlus.core.util.minecraft;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
import gregtech.api.enums.GT_Values;
@@ -27,7 +22,6 @@ import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust;
import gtPlusPlus.core.item.base.plates.BaseItemPlate_OLD;
import gtPlusPlus.core.item.chemistry.AgriculturalChem;
import gtPlusPlus.core.item.chemistry.GenericChem;
-import gtPlusPlus.core.item.chemistry.RocketFuels;
import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase;
import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase;
import gtPlusPlus.core.lib.CORE;
@@ -41,6 +35,10 @@ import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentData;
@@ -58,1368 +56,1407 @@ import net.minecraftforge.oredict.OreDictionary;
public class ItemUtils {
- public static ItemStack getSimpleStack(final Item x) {
- return getSimpleStack(x, 1);
- }
-
- public static ItemStack getSimpleStack(final Block x) {
- return simpleMetaStack(Item.getItemFromBlock(x), 0, 1);
- }
-
-
- public static ItemStack getSimpleStack(final Block x, int i) {
- if (i == 0) {
- return getSimpleStack(x, i, 1);
- }
-
- return getSimpleStack(x, 0, i);
- }
-
- public static ItemStack getSimpleStack(final Block x, int meta, int i) {
- return simpleMetaStack(Item.getItemFromBlock(x), meta, i);
- }
-
- public static ItemStack getSimpleStack(final Item x, final int i) {
- try {
- final ItemStack r = new ItemStack(x, i);
- return r.copy();
- } catch (final Throwable e) {
- return null;
- }
- }
-
- public static ItemStack getSimpleStack(final ItemStack x, final int i) {
- try {
- final ItemStack r = x.copy();
- r.stackSize = i;
- return r;
- } catch (final Throwable e) {
- return null;
- }
- }
-
- public static final int WILDCARD_VALUE = Short.MAX_VALUE;
-
- public static ItemStack getWildcardStack(final Item x) {
- final ItemStack y = new ItemStack(x, 1, WILDCARD_VALUE);
- return y;
- }
-
- public static ItemStack getWildcardStack(final ItemStack x) {
- final ItemStack y = ItemUtils.simpleMetaStack(x, WILDCARD_VALUE, 1);
- return y;
- }
-
- public static ItemStack getIC2Cell(final String S) {
- final ItemStack moreTemp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + S, 1);
-
- if (moreTemp == null) {
- final int cellID = 0;
- final ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, cellID);
- return temp != null ? temp : null;
- }
-
- return moreTemp;
- }
-
- public static ItemStack getIC2Cell(final int meta) {
- final ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, meta);
- return temp != null ? temp : null;
- }
-
- public static ItemStack getEmptyCell() {
- return getEmptyCell(1);
- }
-
- public static ItemStack getEmptyCell(int i) {
- if (ItemList.Cell_Empty.hasBeenSet()) {
- return ItemList.Cell_Empty.get(i);
- }
- final ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", i, 0);
- return temp != null ? temp : null;
- }
-
- public static void getItemForOreDict(final String FQRN, final String oreDictName, final String itemName,
- final int meta) {
- try {
- Item em = null;
- final Item em1 = getItemFromFQRN(FQRN);
- // Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
- if (em1 != null) {
- em = em1;
- }
- if (em != null) {
-
- final ItemStack metaStack = new ItemStack(em, 1, meta);
- GT_OreDictUnificator.registerOre(oreDictName, metaStack);
-
- /*
- * ItemStack itemStackWithMeta = new ItemStack(em,1,meta);
- * GT_OreDictUnificator.registerOre(oreDictName, new
- * ItemStack(itemStackWithMeta.getItem()));
- */
- }
- } catch (final NullPointerException e) {
- Logger.ERROR(itemName + " not found. [NULL]");
- }
- }
-
- public static void addItemToOreDictionary(ItemStack stack, final String oreDictName, boolean useWildcardMeta) {
- if (useWildcardMeta) {
- stack = ItemUtils.getWildcardStack(stack);
- }
- try {
- OreDictionary.registerOre(oreDictName, stack);
- } catch (final NullPointerException e) {
- Logger.ERROR(ItemUtils.getItemName(stack) + " not registered. [NULL]");
- }
- }
-
- public static void addItemToOreDictionary(final ItemStack stack, final String oreDictName) {
- addItemToOreDictionary(stack, oreDictName, false);
- }
-
- public static ItemStack getItemStackWithMeta(final boolean MOD, final String FQRN, final String itemName,
- final int meta, final int itemstackSize) {
- if (MOD) {
- try {
- Item em = null;
- final Item em1 = getItemFromFQRN(FQRN);
- // Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
- if (em1 != null) {
- if (null == em) {
- em = em1;
- }
- if (em != null) {
- final ItemStack metaStack = new ItemStack(em, itemstackSize, meta);
- return metaStack;
- }
- }
- return null;
- } catch (final NullPointerException e) {
- Logger.ERROR(itemName + " not found. [NULL]");
- return null;
- }
- }
- return null;
- }
-
- public static ItemStack simpleMetaStack(final String FQRN, final int meta, final int itemstackSize) {
- try {
- Item em = null;
- final Item em1 = getItemFromFQRN(FQRN);
- // Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
- if (em1 != null) {
- if (null == em) {
- em = em1;
- }
- if (em != null) {
- final ItemStack metaStack = new ItemStack(em, itemstackSize, meta);
- return metaStack;
- }
- }
- return null;
- } catch (final NullPointerException e) {
- Logger.ERROR(FQRN + " not found. [NULL]");
- return null;
- }
- }
-
- public static ItemStack simpleMetaStack(ItemStack simpleStack, int meta, int size) {
- return simpleMetaStack(simpleStack.getItem(), meta, size);
- }
-
- public static ItemStack simpleMetaStack(final Item item, int meta, int size) {
- if (item == null) {
- return null;
- }
- if (meta < 0 || meta > Short.MAX_VALUE) {
- meta = 0;
- }
- if (size < 0 || size > 64) {
- size = 1;
- }
- //Logger.INFO("Found Metastack: " + item.getUnlocalizedName() + ":" + meta);
- //Logger.INFO(""+ReflectionUtils.getMethodName(0));
- //Logger.INFO(""+ReflectionUtils.getMethodName(1));
- //Logger.INFO(""+ReflectionUtils.getMethodName(2));
- //Logger.INFO(""+ReflectionUtils.getMethodName(3));
- //Logger.INFO(""+ReflectionUtils.getMethodName(4));
- final ItemStack metaStack = new ItemStack(item, size, meta);
- return metaStack;
- }
-
- public static ItemStack simpleMetaStack(final Block block, final int meta, final int size) {
- return simpleMetaStack(Item.getItemFromBlock(block), meta, size);
- }
-
- public static ItemStack getCorrectStacktype(final String fqrn, final int stackSize) {
- final String oreDict = "ore:";
- ItemStack temp;
- if (fqrn.toLowerCase().contains(oreDict.toLowerCase())) {
- final String sanitizedName = fqrn.replace(oreDict, "");
- temp = ItemUtils.getItemStackFromFQRN(sanitizedName, stackSize);
- return temp;
- }
- final String[] fqrnSplit = fqrn.split(":");
- String temp1;
- String temp2;
- temp1 = fqrnSplit[1];
- if (fqrnSplit.length < 3) {
- temp2 = "0";
- } else {
- temp2 = fqrnSplit[2];
- }
- temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, temp1, Integer.parseInt(temp2), stackSize);
- return temp;
- }
-
- public static ItemStack getCorrectStacktype(final Object item_Input, final int stackSize) {
- if (item_Input instanceof String) {
- return getItemStackOfAmountFromOreDictNoBroken((String) item_Input, stackSize);
- } else if (item_Input instanceof ItemStack) {
- return (ItemStack) item_Input;
- }
- return null;
- }
-
- public static Item getItemFromFQRN(final String fqrn) // fqrn = fully qualified resource name
- {
- final String[] fqrnSplit = fqrn.split(":");
- return GameRegistry.findItem(fqrnSplit[0], fqrnSplit[1]);
- }
-
- public static ItemStack getItemStackFromFQRN(final String fqrn, final int Size) // fqrn = fully qualified resource name
- {
- Logger.INFO("Trying to split string '"+fqrn+"'.");
- final String[] fqrnSplit = fqrn.split(":");
- if (fqrnSplit.length < 2) {
- return null;
- }
- else {
- if (fqrnSplit.length == 2) {
- Logger.INFO("Mod: "+fqrnSplit[0]+", Item: "+fqrnSplit[1]);
- return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
- }
- else if (fqrnSplit.length == 3 && fqrnSplit[2] != null && fqrnSplit[2].length() > 0) {
- Logger.INFO("Mod: "+fqrnSplit[0]+", Item: "+fqrnSplit[1]+", Meta: "+fqrnSplit[2]);
- ItemStack aStack = GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
- int aMeta = Integer.parseInt(fqrnSplit[2]);
- if (aStack != null && (aMeta >= 0 && aMeta <= Short.MAX_VALUE)){
- return ItemUtils.simpleMetaStack(aStack, aMeta, Size);
- }
- else {
- Logger.INFO("Could not find instance of Item: "+fqrnSplit[1]);
-
- }
- }
-
- }
- return null;
- }
-
- public static void generateSpawnEgg(final String entityModID, final String parSpawnName, final int colourEgg,
- final int colourOverlay) {
- final Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay)
- .setUnlocalizedName("spawn_egg_" + parSpawnName.toLowerCase())
- .setTextureName(CORE.MODID + ":spawn_egg");
- GameRegistry.registerItem(itemSpawnEgg, "spawnEgg" + parSpawnName);
- }
-
- public static ItemStack[] validItemsForOreDict(final String oredictName) {
- final List<?> validNames = MaterialUtils.oreDictValuesForEntry(oredictName);
- final ItemStack[] inputs = new ItemStack[validNames.size()];
- for (int i = 0; i < validNames.size(); i++) {
- inputs[i] = (ItemStack) validNames.get(i);
- }
- return inputs;
- }
-
- public static ItemStack getItemStackOfAmountFromOreDict(String oredictName, final int amount) {
- String mTemp = oredictName;
-
- if (oredictName.contains("-") || oredictName.contains("_")) {
- mTemp = Utils.sanitizeString(mTemp, new char[] {'-', '_'});
- }
- else {
- mTemp = Utils.sanitizeString(mTemp);
- }
-
-
-
- if (oredictName.contains("rod")) {
- String s = "stick"+oredictName.substring(3);
- oredictName = s;
- }
-
- // Banned Materials and replacements for GT5.8 compat.
-
- if (oredictName.toLowerCase().contains("ingotclay")) {
- return getSimpleStack(Items.clay_ball, amount);
- }
-
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- if (oredictName.toLowerCase().contains("rutile")) {
- mTemp = oredictName.replace("Rutile", "Titanium");
- }
- if (oredictName.toLowerCase().contains("vanadiumsteel")) {
- mTemp = oredictName.replace("VanadiumSteel", "StainlessSteel");
- }
- }
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(mTemp);
- if (!oreDictList.isEmpty()) {
- final ItemStack returnValue = oreDictList.get(0).copy();
- returnValue.stackSize = amount;
- return returnValue;
- }
- Logger.INFO("Failed to find `" + oredictName + "` in OD.");
- return getErrorStack(amount, oredictName+" x"+amount);
- //return getItemStackOfAmountFromOreDictNoBroken(mTemp, amount);
- }
-
- public static ItemStack getItemStackOfAmountFromOreDictNoBroken(String oredictName, final int amount) {
- if (CORE_Preloader.DEBUG_MODE) {
- Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(1));
- Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(2));
- Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(3));
- Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(4));
- Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(5));
- }
-
- try {
-
- if (oredictName.contains("-") || oredictName.contains("_")) {
- oredictName = Utils.sanitizeString(oredictName, new char[] {'-', '_'});
- }
- else {
- oredictName = Utils.sanitizeString(oredictName);
- }
-
- // Adds a check to grab dusts using GT methodology if possible.
- ItemStack returnValue = null;
- if (oredictName.toLowerCase().contains("dust")) {
- final String MaterialName = oredictName.toLowerCase().replace("dust", "");
- final Materials m = Materials.get(MaterialName);
- if (m != null && m != Materials._NULL) {
- returnValue = getGregtechDust(m, amount);
- if (checkForInvalidItems(returnValue)) {
- return returnValue;
- }
- }
- }
- if (returnValue == null) {
- returnValue = getItemStackOfAmountFromOreDict(oredictName, amount);
- if (ItemUtils.checkForInvalidItems(returnValue)) {
- return returnValue.copy();
- }
- }
-
- Logger.RECIPE(oredictName + " was not valid.");
- return null;
- } catch (final Throwable t) {
- return null;
- }
- }
-
- public static ItemStack getGregtechDust(final Materials material, final int amount) {
- final ItemStack returnValue = GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L);
- if (returnValue != null) {
- if (ItemUtils.checkForInvalidItems(returnValue)) {
- return returnValue.copy();
- }
- }
- Logger.WARNING(material + " was not valid.");
- return null;
- }
-
- // NullFormula
- public static Item[] generateSpecialUseDusts(final String unlocalizedName, final String materialName,
- final int Colour) {
- return generateSpecialUseDusts(unlocalizedName, materialName, "NullFormula", Colour);
- }
-
- public static Item[] generateSpecialUseDusts(final String unlocalizedName, final String materialName,
- String mChemForm, final int Colour) {
- final Item[] output = {
- new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, mChemForm, Colour, "Dust"),
- new BaseItemDustUnique("itemDustSmall" + unlocalizedName, materialName, mChemForm, Colour, "Small"),
- new BaseItemDustUnique("itemDustTiny" + unlocalizedName, materialName, mChemForm, Colour, "Tiny") };
-
- //Generate Shaped/Shapeless Recipes
-
- final ItemStack normalDust = ItemUtils.getSimpleStack(output[0]);
- final ItemStack smallDust = ItemUtils.getSimpleStack(output[1]);
- final ItemStack tinyDust = ItemUtils.getSimpleStack(output[2]);
-
- CORE.RA.addpackagerRecipe(ItemList.Schematic_Dust.get(0), smallDust, tinyDust, normalDust);
-
- if (ItemUtils.checkForInvalidItems(tinyDust) && ItemUtils.checkForInvalidItems(normalDust)) {
- if (RecipeUtils.addShapedRecipe(
- tinyDust, tinyDust, tinyDust,
- tinyDust, tinyDust, tinyDust,
- tinyDust, tinyDust, tinyDust,
- normalDust)){
- Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+materialName+" - Success");
- }
- else {
- Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+materialName+" - Failed");
- }
-
- if (RecipeUtils.addShapedRecipe(
- normalDust, null, null,
- null, null, null,
- null, null, null,
- ItemUtils.getSimpleStack(tinyDust, 9))){
- Logger.WARNING("9 Tiny dust from 1 Recipe: "+materialName+" - Success");
- }
- else {
- Logger.WARNING("9 Tiny dust from 1 Recipe: "+materialName+" - Failed");
- }
- }
-
- if (ItemUtils.checkForInvalidItems(smallDust) && ItemUtils.checkForInvalidItems(normalDust)) {
- if (RecipeUtils.addShapedRecipe(
- smallDust, smallDust, null,
- smallDust, smallDust, null,
- null, null, null,
- normalDust)){
- Logger.WARNING("4 Small dust to 1 Dust Recipe: "+materialName+" - Success");
- }
- else {
- Logger.WARNING("4 Small dust to 1 Dust Recipe: "+materialName+" - Failed");
- }
- if (RecipeUtils.addShapedRecipe(
- null, normalDust, null,
- null, null, null,
- null, null, null,
- ItemUtils.getSimpleStack(smallDust, 4))){
- Logger.WARNING("4 Small dust from 1 Dust Recipe: "+materialName+" - Success");
- }
- else {
- Logger.WARNING("4 Small dust from 1 Dust Recipe: "+materialName+" - Failed");
- }
- }
-
- return output;
- }
-
- public static Item generateSpecialUsePlate(final String internalName, final String displayName, final short[] rgb,
- final int radioactivity) {
- return generateSpecialUsePlate(internalName, displayName, Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]),
- radioactivity);
- }
-
- public static Item generateSpecialUsePlate(final String internalName, final String displayName,
- final String mFormula, final short[] rgb, final int radioactivity) {
- return generateSpecialUsePlate(internalName, displayName, mFormula, Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]),
- radioactivity);
- }
-
- public static Item generateSpecialUsePlate(final String internalName, final String displayName, final int rgb,
- final int radioactivity) {
- return new BaseItemPlate_OLD(internalName, displayName, rgb, radioactivity);
- }
-
- public static Item generateSpecialUsePlate(final String internalName, final String displayName,
- final String mFormula, final int rgb, final int radioactivity) {
- return new BaseItemPlate_OLD(internalName, displayName, mFormula, rgb, radioactivity);
- }
-
-
- public static Item[] generateSpecialUseDusts(final Material material, final boolean onlyLargeDust) {
- return generateSpecialUseDusts(material, onlyLargeDust, false);
- }
-
- public static Item[] generateSpecialUseDusts(final Material material, final boolean onlyLargeDust, final boolean disableExtraRecipes) {
- final String materialName = material.getLocalizedName();
- final String unlocalizedName = Utils.sanitizeString(materialName);
- final int Colour = material.getRgbAsHex();
- final String aChemForm = material.vChemicalFormula;
- final boolean isChemFormvalid = (aChemForm != null && aChemForm.length() > 0);
- Item[] output = null;
- if (onlyLargeDust == false) {
- output = new Item[] { new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, isChemFormvalid ? aChemForm : "", Colour, "Dust"),
- new BaseItemDustUnique("itemDustSmall" + unlocalizedName, materialName, isChemFormvalid ? aChemForm : "", Colour, "Small"),
- new BaseItemDustUnique("itemDustTiny" + unlocalizedName, materialName, isChemFormvalid ? aChemForm : "", Colour, "Tiny") };
- } else {
- output = new Item[] { new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, Colour, "Dust") };
- }
-
- new RecipeGen_DustGeneration(material, disableExtraRecipes);
-
- return output;
- }
-
- public static MultiPickaxeBase generateMultiPick(final boolean GT_Durability, final Materials material) {
- final ToolMaterial customMaterial = Utils.generateToolMaterialFromGT(material);
- final int enchantLevel = material.mEnchantmentToolsLevel;
- final Object enchant = new Pair(material.mEnchantmentTools, enchantLevel);
- return generateMultiPick(GT_Durability, customMaterial, material.mDefaultLocalName, material.mDurability,
- material.mRGBa, enchant);
- }
-
- public static MultiPickaxeBase generateMultiPick(final Material material) {
- final ToolMaterial customMaterial = Utils.generateToolMaterial(material);
- return generateMultiPick(true, customMaterial, material.getLocalizedName(), (int) material.vDurability,
- material.getRGBA(), null);
- }
-
- public static MultiPickaxeBase generateMultiPick(final boolean GT_Durability, final ToolMaterial customMaterial,
- final String name, final int durability, final short[] rgba, final Object enchantment) {
- Logger.WARNING("Generating a Multi-Pick out of " + name);
- final short[] rgb = rgba;
- int dur = customMaterial.getMaxUses();
- Logger.WARNING("Determined durability for " + name + " is " + dur);
- if (GT_Durability) {
- dur = durability * 100;
- Logger.WARNING("Using gregtech durability value, " + name + " is now " + dur + ".");
- } else if (dur <= 0) {
- dur = durability;
- Logger.WARNING("Determined durability too low, " + name + " is now " + dur
- + " based on the GT material durability.");
- }
- if (dur <= 0) {
- Logger.WARNING("Still too low, " + name + " will now go unused.");
- return null;
- }
-
- Object enchant;
- if (enchantment != null) {
- if (enchantment instanceof Pair) {
- enchant = enchantment;
- }
- } else {
- enchant = null;
- }
-
- final MultiPickaxeBase MP_Redstone = new MultiPickaxeBase(name + " Multipick", (customMaterial), dur,
- Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]), enchantment);
-
- if (MP_Redstone.isValid) {
- return MP_Redstone;
- }
- Logger.WARNING("Pickaxe was not valid.");
- return null;
- }
-
- public static MultiSpadeBase generateMultiShovel(final boolean GT_Durability, final Materials material) {
- final ToolMaterial customMaterial = Utils.generateToolMaterialFromGT(material);
- return generateMultiShovel(GT_Durability, customMaterial, material.mDefaultLocalName, material.mDurability,
- material.mRGBa);
- }
-
- public static MultiSpadeBase generateMultiShovel(final Material material) {
- final ToolMaterial customMaterial = Utils.generateToolMaterial(material);
- return generateMultiShovel(true, customMaterial, material.getLocalizedName(), (int) material.vDurability,
- material.getRGBA());
- }
-
- public static MultiSpadeBase generateMultiShovel(final boolean GT_Durability, final ToolMaterial customMaterial,
- final String name, final int durability, final short[] rgba) {
- Logger.WARNING("Generating a Multi-Spade out of " + name);
- final short[] rgb = rgba;
- int dur = customMaterial.getMaxUses();
- Logger.WARNING("Determined durability for " + name + " is " + dur);
- if (GT_Durability) {
- dur = durability * 100;
- Logger.WARNING("Using gregtech durability value, " + name + " is now " + dur + ".");
- } else if (dur <= 0) {
- dur = durability;
- Logger.WARNING("Determined durability too low, " + name + " is now " + dur
- + " based on the GT material durability.");
- }
- if (dur <= 0) {
- Logger.WARNING("Still too low, " + name + " will now go unused.");
- return null;
- }
- final MultiSpadeBase MP_Redstone = new MultiSpadeBase(name + " Multispade", (customMaterial), dur,
- Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]));
-
- if (MP_Redstone.isValid) {
- return MP_Redstone;
- }
- return null;
- }
-
- public static BaseItemDecidust generateDecidust(final Materials material) {
- if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null) {
- final Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
- if (placeholder != null) {
- generateDecidust(placeholder);
- }
- }
- return null;
- }
-
- public static BaseItemDecidust generateDecidust(final Material material) {
- if ((material.getDust(1) != null) && MaterialUtils.hasValidRGBA(material.getRGBA())) {
- final BaseItemDecidust Decidust = new BaseItemDecidust(material);
- return Decidust;
- }
- return null;
- }
-
- public static BaseItemCentidust generateCentidust(final Materials material) {
- if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null) {
- final Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
- if (placeholder != null) {
- generateCentidust(placeholder);
- }
- }
- return null;
- }
-
- public static BaseItemCentidust generateCentidust(final Material material) {
- if ((material.getDust(1) != null) && MaterialUtils.hasValidRGBA(material.getRGBA())) {
- final BaseItemCentidust Centidust = new BaseItemCentidust(material);
- return Centidust;
- }
- return null;
- }
-
- public static boolean isRadioactive(final String materialName) {
- int sRadiation = 0;
- if (materialName.toLowerCase().contains("uranium")) {
- sRadiation = 2;
- } else if (materialName.toLowerCase().contains("plutonium")) {
- sRadiation = 4;
- } else if (materialName.toLowerCase().contains("thorium")) {
- sRadiation = 1;
- }
- if (sRadiation >= 1) {
- return true;
- }
- return false;
- }
-
- public static int getRadioactivityLevel(final String materialName) {
- int sRadiation = 0;
- if (materialName.toLowerCase().contains("uranium")) {
- sRadiation = 2;
- } else if (materialName.toLowerCase().contains("plutonium")) {
- sRadiation = 4;
- } else if (materialName.toLowerCase().contains("thorium")) {
- sRadiation = 1;
- }
- return sRadiation;
- }
-
- public static String getArrayStackNames(ArrayList<?> aStack) {
- Object aType = aStack.get(0);
- if (aType instanceof FluidStack) {
- FluidStack[] aItems = new FluidStack[aStack.size()];
- for (int i=0;i<aItems.length;i++) {
- aItems[i] = (FluidStack) aStack.get(i);
- }
- return getArrayStackNames(aItems);
- }
- if (aType instanceof ItemStack) {
- ItemStack[] aItems = new ItemStack[aStack.size()];
- for (int i=0;i<aItems.length;i++) {
- aItems[i] = (ItemStack) aStack.get(i);
- }
- return getArrayStackNames(aItems);
- }
- return "";
- }
-
- public static String getArrayStackNames(final AutoMap<?> aStack) {
- Object aType = aStack.get(0);
- if (aType instanceof FluidStack) {
- FluidStack[] aItems = new FluidStack[aStack.size()];
- for (int i=0;i<aItems.length;i++) {
- aItems[i] = (FluidStack) aStack.get(i);
- }
- return getArrayStackNames(aItems);
- }
- if (aType instanceof ItemStack) {
- ItemStack[] aItems = new ItemStack[aStack.size()];
- for (int i=0;i<aItems.length;i++) {
- aItems[i] = (ItemStack) aStack.get(i);
- }
- return getArrayStackNames(aItems);
- }
- return "";
- }
-
- public static String getArrayStackNames(final FluidStack[] aStack) {
- String itemNames = "Fluid Array: ";
- for (final FluidStack alph : aStack) {
- if (alph != null) {
- final String temp = itemNames;
- itemNames = temp + ", " + alph.getLocalizedName() + " x" + alph.amount;
- } else {
- final String temp = itemNames;
- itemNames = temp + ", " + "null" + " x" + "0";
- }
- }
- return itemNames;
- }
-
- public static String getArrayStackNames(final ItemStack[] aStack) {
- String itemNames = "";
- int aPos = 0;
- for (final ItemStack alph : aStack) {
- if (alph == null) {
- continue;
- }
- if (alph != null) {
- final String temp = itemNames;
- itemNames = temp + (aPos > 0 ? ", " : "") + alph.getDisplayName() + " x" + alph.stackSize;
- aPos++;
- }
- }
- return itemNames;
- }
-
- public static String[] getArrayStackNamesAsArray(final ItemStack[] aStack) {
- final String[] itemNames = aStack == null ? new String[] {} : new String[aStack.length];
- if (aStack != null){
- Logger.INFO(""+aStack.length);
- }
-
- if (aStack == null || aStack.length < 1) {
- return itemNames;
- }
-
- int arpos = 0;
- for (final ItemStack alph : aStack) {
- if (alph == null) {
- continue;
- }
- try {
- itemNames[arpos] = alph.getDisplayName();
- arpos++;
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
- return itemNames;
-
- }
-
- public static String getFluidArrayStackNames(final FluidStack[] aStack) {
- String itemNames = "Fluid Array: ";
- for (final FluidStack alph : aStack) {
- final String temp = itemNames;
- itemNames = temp + ", " + alph.getFluid().getName() + " x" + alph.amount;
- }
- return itemNames;
-
- }
-
- public static ItemStack getGregtechCircuit(final int Meta) {
- return ItemUtils.getItemStackWithMeta(LoadedMods.Gregtech, "gregtech:gt.integrated_circuit", "Gregtech Circuit",
- Meta, 0);
- }
-
- public static ItemStack[] getBlockDrops(final ArrayList<ItemStack> blockDrops) {
- if (blockDrops == null) {
- return null;
- }
- if (blockDrops.isEmpty()) {
- return null;
- }
- final ItemStack[] outputs = new ItemStack[blockDrops.size()];
- short forCounter = 0;
- for (final ItemStack I : blockDrops) {
- outputs[forCounter++] = I;
- }
- return outputs;
- }
-
- private static Map<Item, String> mModidCache = new HashMap<Item, String>();
-
- private static String getModId(final Item item) {
- if (mModidCache.containsKey(item)) {
- return mModidCache.get(item);
- }
- String value = "";
- try {
- final GameRegistry.UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(item);
- if (id != null) {
- final String modname = (id.modId == null ? id.name : id.modId);
- value = ((id == null) || id.modId.equals("")) ? "minecraft" : modname;
- }
- } catch (final Throwable t) {
- try {
- final UniqueIdentifier t2 = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(item));
- if (t2 != null) {
- final String modname = (t2.modId == null ? t2.name : t2.modId);
- value = ((t2 == null) || t2.modId.equals("")) ? "minecraft" : modname;
- }
- } catch (final Throwable t3) {
- t3.printStackTrace();
- value = "bad modid";
- }
- }
- if (!mModidCache.containsKey(item)) {
- return mModidCache.put(item, value);
- }
- return value;
- }
-
- public static String getModId(final ItemStack key) {
- return getModId(key.getItem());
- }
-
- // Take 2 - GT/GT++ Dusts
- public static ItemStack getGregtechDust(final String oredictName, final int amount) {
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
- if (!oreDictList.isEmpty()) {
- ItemStack returnvalue;
- for (int xrc = 0; xrc < oreDictList.size(); xrc++) {
- final String modid = getModId(oreDictList.get(xrc).getItem());
- if (modid != null && (modid.equals("gregtech") || modid.equals(CORE.MODID))) {
- returnvalue = oreDictList.get(xrc).copy();
- returnvalue.stackSize = amount;
- return returnvalue;
- }
- }
- }
- return getNonTinkersDust(oredictName, amount);
- }
-
- // Anything But Tinkers Dust
- public static ItemStack getNonTinkersDust(final String oredictName, final int amount) {
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
- if (!oreDictList.isEmpty()) {
- ItemStack returnvalue;
- for (int xrc = 0; xrc < oreDictList.size(); xrc++) {
- final String modid = getModId(oreDictList.get(xrc).getItem());
- if (modid != null && !modid.equals("tconstruct")) {
- returnvalue = oreDictList.get(xrc).copy();
- returnvalue.stackSize = amount;
- return returnvalue;
- }
- }
- }
- // If only Tinkers dust exists, bow down and just use it.
- return getItemStackOfAmountFromOreDictNoBroken(oredictName, amount);
- }
-
- @Deprecated
- public static ItemStack getGregtechOreStack(OrePrefixes mPrefix, Materials mMat, int mAmount) {
-
- ItemStack aTemp = getOrePrefixStack(mPrefix, mMat, mAmount);
- if (aTemp != null) {
- return aTemp;
- }
-
- String mName = MaterialUtils.getMaterialName(mMat);
-
- String mItemName = mPrefix.name() + mName;
- // Utils.LOG_INFO("[Component Maker] Trying to get "+mItemName+".");
- ItemStack gregstack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(mItemName, mAmount);
- if (gregstack == null) {
- // Utils.LOG_INFO("[Component Maker] Failed to get "+mItemName+".");
- return null;
- }
- // Utils.LOG_INFO("[Component Maker] Found "+mItemName+".");
- return (gregstack);
- }
-
- public static ItemStack getOrePrefixStack(OrePrefixes mPrefix, Material mMat, int mAmount) {
-
- String mName = Utils.sanitizeString(mMat.getLocalizedName());
-
- String mItemName = mPrefix.name() + mName;
- ItemStack gregstack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(mItemName, mAmount);
- if (gregstack == null) {
- return null;
- }
- return (gregstack);
- }
-
- public static ItemStack getOrePrefixStack(OrePrefixes mPrefix, Materials mMat, int mAmount) {
- if (mPrefix == OrePrefixes.rod) {
- mPrefix = OrePrefixes.stick;
- }
- ItemStack aGtStack = GT_OreDictUnificator.get(mPrefix, mMat, mAmount);
- if (aGtStack == null) {
- Logger.INFO(
- "Failed to find `" + mPrefix + MaterialUtils.getMaterialName(mMat) + "` in OD. [Prefix Search]");
- return getErrorStack(mAmount, (mPrefix.toString()+MaterialUtils.getMaterialName(mMat)+" x"+mAmount));
- } else {
- return aGtStack;
- }
- }
-
- public static ItemStack getErrorStack(int mAmount) {
- return getErrorStack(mAmount, null);
- }
-
- public static ItemStack getErrorStack(int mAmount, String aName) {
- ItemStack g = getSimpleStack(ModItems.AAA_Broken, 1);
- if (aName != null) {
- //NBTUtils.setString(g, "Lore", EnumChatFormatting.RED+aName);
- NBTUtils.setBookTitle(g, EnumChatFormatting.RED+aName);
- //NBTUtils.setBookTitle(g, EnumChatFormatting.YELLOW+"Maybe Alkalus should know about this");
- }
- return g;
- }
-
- public static ItemStack[] getStackOfAllOreDictGroup(String oredictname) {
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictname);
- if (!oreDictList.isEmpty()) {
- final ItemStack[] returnValues = new ItemStack[oreDictList.size()];
- for (int i = 0; i < oreDictList.size(); i++) {
- if (oreDictList.get(i) != null) {
- returnValues[i] = oreDictList.get(i);
- }
- }
- return returnValues.length > 0 ? returnValues : null;
- } else {
- return null;
- }
- }
-
- public static boolean registerFuel(ItemStack aBurnable, int burn) {
- return CORE.burnables.add(new Pair<Integer, ItemStack>(burn, aBurnable));
- }
-
- public static String getLocalizedNameOfBlock(BlockPos pos) {
- Block block = pos.world.getBlock(pos.xPos, pos.yPos, pos.zPos);
- int metaData = pos.world.getBlockMetadata(pos.xPos, pos.yPos, pos.zPos);
- return LangUtils.getLocalizedNameOfBlock(block, metaData);
- }
-
- public static boolean checkForInvalidItems(ItemStack mInput) {
- return checkForInvalidItems(new ItemStack[] { mInput });
- }
-
- public static boolean checkForInvalidItems(ItemStack[] mInput) {
- return checkForInvalidItems(mInput, new ItemStack[] {});
- }
-
- /**
- *
- * @param mInputs
- * @return {@link Boolean} - True if {@link ItemStack}[] only contains valid
- * items.
- */
- public static boolean checkForInvalidItems(ItemStack[] mInputs, ItemStack[] mOutputs) {
- if (mInputs == null || mOutputs == null) {
- return false;
- }
-
- if (mInputs.length > 0) {
- for (ItemStack stack : mInputs) {
- if (stack != null) {
- if (stack.getItem() != null) {
- if (stack.getItem() == ModItems.AAA_Broken
- || stack.getItem().getClass() == ModItems.AAA_Broken.getClass()) {
- return false;
- } else if (stack.getItem() == ModItems.ZZZ_Empty
- || stack.getItem().getClass() == ModItems.ZZZ_Empty.getClass()) {
- return false;
- } else {
- continue;
- }
- } else {
- continue;
- }
- } else {
- return false;
- }
- }
- }
- if (mOutputs.length > 0) {
- for (ItemStack stack : mOutputs) {
- if (stack != null) {
- if (stack.getItem() != null) {
- if (stack.getItem() == ModItems.AAA_Broken
- || stack.getItem().getClass() == ModItems.AAA_Broken.getClass()) {
- return false;
- } else if (stack.getItem() == ModItems.ZZZ_Empty
- || stack.getItem().getClass() == ModItems.ZZZ_Empty.getClass()) {
- return false;
- } else {
- continue;
- }
- } else {
- continue;
- }
- } else {
- return false;
- }
- }
- }
-
- return true;
- }
-
-
- public static IInventory organiseInventory(IInventory aInputInventory) {
- ItemStack[] p = new ItemStack[aInputInventory.getSizeInventory()];
- for (int o = 0; o < aInputInventory.getSizeInventory(); o++) {
- p[o] = aInputInventory.getStackInSlot(o);
- }
- //ItemStack[] g = organiseInventory(p);
-
- IInventory aTemp = aInputInventory;
- for (int i = 0; i < p.length; ++i) {
- for (int j = i + 1; j < p.length; ++j) {
- if (p[j] != null && (p[i] == null
- || GT_Utility.areStacksEqual(p[i], p[j]))) {
- GT_Utility.moveStackFromSlotAToSlotB(aTemp, aTemp, j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- }
- }
- }
-
- /*
- for (int o = 0; o < aInputInventory.getSizeInventory(); o++) {
- aTemp.setInventorySlotContents(o, g[o]);
- }*/
- return aTemp;
- }
-
-
- public static ItemStack[] organiseInventory(ItemStack[] aInputs) {
-
- //Update Slots
- int aInvSize = aInputs.length;
- ItemStack[] newArray = new ItemStack[aInvSize];
-
-
- //Try merge stacks
- for (int i = 0; i < aInvSize; i++) {
- for (int i2 = 0; i2 < aInvSize; i2++) {
- if (i != i2) {
- ItemStack[] t1 = new ItemStack[] {aInputs[i], aInputs[i2]};
- if (t1[0] == null || t1[1] == null) {
- continue;
- }
- else if (!GT_Utility.areStacksEqual(t1[0], t1[1])) {
- continue;
- }
- //Try Merge
- else {
-
- if (GT_Utility.areStacksEqual(t1[0], t1[1])) {
- while ((t1[0].stackSize < 64 && t1[1].stackSize > 0)) {
- t1[0].stackSize++;
- t1[1].stackSize--;
- if (t1[1].stackSize <= 0) {
- t1[1] = null;
- break;
- }
- if (t1[0].stackSize == 64) {
- break;
- }
- }
- newArray[i] = t1[1];
- newArray[i2] = t1[0];
- }
- }
- }
- }
- }
-
- ItemStack[] newArray2 = new ItemStack[aInvSize];
-
- //Move nulls to end
- int count2 = 0;
- for (int i = 0; i < aInvSize; i++)
- if (newArray[i] != null)
- newArray2[count2++] = newArray[i];
- while (count2 < aInvSize)
- newArray2[count2++] = null;
-
- return newArray2;
-
-
- }
-
- public static String getFluidName(FluidStack aFluid) {
- return aFluid != null ? aFluid.getFluid().getLocalizedName(aFluid) : "NULL";
- }
-
- public static String getFluidName(Fluid aFluid) {
- return aFluid != null ? aFluid.getLocalizedName() : "NULL";
- }
-
- public static String getItemName(ItemStack aStack) {
- if (aStack == null) {
- return "ERROR - Empty Stack";
- }
- String aDisplay = null;
- try {
- aDisplay = ("" + StatCollector
- .translateToLocal(aStack.getItem().getUnlocalizedNameInefficiently(aStack) + ".name"))
- .trim();
- if (aStack.hasTagCompound()) {
- if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("display", 10)) {
- NBTTagCompound nbttagcompound = aStack.stackTagCompound.getCompoundTag("display");
-
- if (nbttagcompound.hasKey("Name", 8)) {
- aDisplay = nbttagcompound.getString("Name");
- }
- }
- }
- } catch (Throwable t) {
-
- }
- if (aDisplay == null || aDisplay.length() <= 0) {
- aDisplay = aStack.getUnlocalizedName() + ":" + aStack.getItemDamage();
- } else {
- aDisplay += " | Meta: " + aStack.getItemDamage();
- }
- return aDisplay;
- }
-
- public static String getUnlocalizedItemName(ItemStack aStack) {
- if (aStack == null) {
- return "ERROR.Empty.Stack";
- }
- String aDisplay = null;
- try {
- aDisplay = (aStack.getUnlocalizedName()).trim();
- }
- catch (Throwable t) {
- aDisplay = aStack.getItem().getUnlocalizedName();
- }
- if (aDisplay == null || aDisplay.length() <= 0) {
- aDisplay = aStack.getItem().getUnlocalizedNameInefficiently(aStack);
- }
- return aDisplay;
- }
-
- public static boolean isItemGregtechTool(ItemStack aStack) {
- if (aStack == null) {
- return false;
- }
- final Item mItem = aStack.getItem();
- final Item aSkookum = ItemUtils.getItemFromFQRN("miscutils:gt.plusplus.metatool.01");
- final Class aSkookClass = aSkookum.getClass();
- if (aSkookClass.isInstance(mItem) || mItem instanceof GT_MetaGenerated_Tool_01 || mItem instanceof MetaGeneratedGregtechTools || mItem instanceof Gregtech_MetaTool || mItem == aSkookum) {
- return true;
- }
- return false;
- }
-
- public static boolean isToolWrench(ItemStack aWrench) {
- if (isItemGregtechTool(aWrench) && (aWrench.getItemDamage() == 16 || aWrench.getItemDamage() == 120 || aWrench.getItemDamage() == 122 || aWrench.getItemDamage() == 124 || aWrench.getItemDamage() == 7734)) {
- return true;
- }
- return false;
- }
-
- public static boolean isToolMallet(ItemStack aMallet) {
- if (isItemGregtechTool(aMallet) && (aMallet.getItemDamage() == 14)) {
- return true;
- }
- return false;
- }
-
- public static boolean isToolScrewdriver(ItemStack aScrewdriver) {
- if (isItemGregtechTool(aScrewdriver) && (aScrewdriver.getItemDamage() == 22 || aScrewdriver.getItemDamage() == 150)) {
- return true;
- }
- return false;
- }
-
- public static boolean isToolCrowbar(ItemStack aCrowbar) {
- if (isItemGregtechTool(aCrowbar) && (aCrowbar.getItemDamage() == 20)) {
- return true;
- }
- return false;
- }
-
- public static boolean isToolWirecutters(ItemStack aWirecutters) {
- if (isItemGregtechTool(aWirecutters) && (aWirecutters.getItemDamage() == 26)) {
- return true;
- }
- return false;
- }
-
- public static boolean isToolHammer(ItemStack aHammer) {
- if (isItemGregtechTool(aHammer) && (aHammer.getItemDamage() == 12 || aHammer.getItemDamage() == 7734)) {
- return true;
- }
- return false;
- }
-
- public static boolean isToolSolderingIron(ItemStack aSoldering) {
- if (isItemGregtechTool(aSoldering) && (aSoldering.getItemDamage() == 160)) {
- return true;
- }
- return false;
- }
-
- public static ItemStack[] cleanItemStackArray(ItemStack[] input) {
- int aArraySize = input.length;
- ItemStack[] aOutput = new ItemStack[aArraySize];
- AutoMap<ItemStack> aCleanedItems = new AutoMap<ItemStack>();
- for (ItemStack checkStack : input) {
- if (ItemUtils.checkForInvalidItems(checkStack)) {
- aCleanedItems.put(checkStack);
- }
- }
- for (int i=0;i<aArraySize;i++) {
- ItemStack aMappedStack = aCleanedItems.get(i);
- if (aMappedStack != null){
- aOutput[i] = aMappedStack;
- }
- }
- return aOutput;
- }
-
- public static ItemStack getEnchantedBook(Enchantment aEnch, int aLevel) {
- return enchantItem(new ItemStack(Items.enchanted_book), aEnch, aLevel);
- }
-
- public static ItemStack enchantItem(ItemStack aStack, Enchantment aEnch, int aLevel) {
- Items.enchanted_book.addEnchantment(aStack, new EnchantmentData(aEnch, aLevel));
- return aStack;
- }
-
- public static boolean doesOreDictHaveEntryFor(String string) {
- return OreDictUtils.containsValidEntries(string);
- }
-
- public static void hideItemFromNEI(ItemStack aItemToHide) {
- codechicken.nei.api.API.hideItem(aItemToHide);
- }
-
- public static ItemStack getNullStack() {
- return GT_Values.NI;
- }
-
- public static ItemStack depleteStack(ItemStack aStack) {
- return depleteStack(aStack, 1);
- }
-
- public static ItemStack depleteStack(ItemStack aStack, int aAmount) {
- final int cap = aStack.stackSize;
- if (cap >= 1 && cap >= aAmount) {
- ItemStack aDepStack = aStack.copy();
- aDepStack.stackSize = (MathUtils.balance((aDepStack.stackSize - 1), 0, 64));
- if (aDepStack.stackSize > 0) {
- return aDepStack;
- }
- }
- return getNullStack();
- }
-
- public static boolean isControlCircuit(ItemStack aStack) {
- if (aStack != null) {
- Item aItem = aStack.getItem();
- if (aItem == CI.getNumberedBioCircuit(0).getItem() || aItem == CI.getNumberedCircuit(0).getItem() || aItem == CI.getNumberedAdvancedCircuit(0).getItem()) {
- return true;
- }
- }
- return false;
- }
-
- public static boolean isCatalyst(ItemStack aStack) {
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mBlueCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mBrownCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mOrangeCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mPurpleCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mRedCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mYellowCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mPinkCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mFormaldehydeCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mSolidAcidCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mInfiniteMutationCatalyst, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, AgriculturalChem.mGreenCatalyst, true)) {
- return true;
- }
- return false;
- }
-
- public static boolean isMillingBall(ItemStack aStack) {
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallAlumina, true)) {
- return true;
- }
- if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallSoapstone, true)) {
- return true;
- }
- return false;
- }
-
- public static String getLocalizedNameOfBlock(Block aBlock, int aMeta) {
- return LangUtils.getLocalizedNameOfBlock(aBlock, aMeta);
- }
-
-
-
- public static boolean doesItemListEntryExist(String string) {
- ItemList[] aListValues = ItemList.class.getEnumConstants();
- for (ItemList aItem : aListValues) {
- if (aItem != null) {
- if (aItem.name().equals(string) || aItem.name().toLowerCase().equals(string.toLowerCase())) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static ItemList getValueOfItemList(String string, ItemList aOther) {
- ItemList[] aListValues = ItemList.class.getEnumConstants();
- for (ItemList aItem : aListValues) {
- if (aItem != null) {
- if (aItem.name().equals(string) || aItem.name().toLowerCase().equals(string.toLowerCase())) {
- return aItem;
- }
- }
- }
- Logger.INFO("Tried to obtain '"+string+"' from the GT ItemList, however it does not exist.");
- if (aOther != null) {
- Logger.INFO("Using fallback option instead - "+aOther.name());
- }
- return aOther;
- }
-
- public static ItemStack getValueOfItemList(String string, int aAmount, ItemList aOther) {
- return getValueOfItemList(string, aOther).get(aAmount);
- }
-
- public static ItemStack getValueOfItemList(String string, int aAmount, ItemStack aOther) {
- ItemList[] aListValues = ItemList.class.getEnumConstants();
- for (ItemList aItem : aListValues) {
- if (aItem != null) {
- if (aItem.name().equals(string) || aItem.name().toLowerCase().equals(string.toLowerCase())) {
- return aItem.get(aAmount);
- }
- }
- }
- Logger.INFO("Tried to obtain '"+string+"' from the GT ItemList, however it does not exist.");
- if (aOther != null) {
- Logger.INFO("Using fallback option instead - "+ItemUtils.getItemName(aOther));
- }
- return aOther;
- }
-
- public static boolean areItemsEqual(ItemStack aStack1, ItemStack aStack2) {
- return areItemsEqual(aStack1, aStack2, true);
- }
-
- public static boolean areItemsEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) {
- return GT_Utility.areStacksEqual(aStack1, aStack2, aIgnoreNBT);
- }
-
+ public static ItemStack getSimpleStack(final Item x) {
+ return getSimpleStack(x, 1);
+ }
+
+ public static ItemStack getSimpleStack(final Block x) {
+ return simpleMetaStack(Item.getItemFromBlock(x), 0, 1);
+ }
+
+ public static ItemStack getSimpleStack(final Block x, int i) {
+ if (i == 0) {
+ return getSimpleStack(x, i, 1);
+ }
+
+ return getSimpleStack(x, 0, i);
+ }
+
+ public static ItemStack getSimpleStack(final Block x, int meta, int i) {
+ return simpleMetaStack(Item.getItemFromBlock(x), meta, i);
+ }
+
+ public static ItemStack getSimpleStack(final Item x, final int i) {
+ try {
+ final ItemStack r = new ItemStack(x, i);
+ return r.copy();
+ } catch (final Throwable e) {
+ return null;
+ }
+ }
+
+ public static ItemStack getSimpleStack(final ItemStack x, final int i) {
+ try {
+ final ItemStack r = x.copy();
+ r.stackSize = i;
+ return r;
+ } catch (final Throwable e) {
+ return null;
+ }
+ }
+
+ public static final int WILDCARD_VALUE = Short.MAX_VALUE;
+
+ public static ItemStack getWildcardStack(final Item x) {
+ final ItemStack y = new ItemStack(x, 1, WILDCARD_VALUE);
+ return y;
+ }
+
+ public static ItemStack getWildcardStack(final ItemStack x) {
+ final ItemStack y = ItemUtils.simpleMetaStack(x, WILDCARD_VALUE, 1);
+ return y;
+ }
+
+ public static ItemStack getIC2Cell(final String S) {
+ final ItemStack moreTemp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + S, 1);
+
+ if (moreTemp == null) {
+ final int cellID = 0;
+ final ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, cellID);
+ return temp != null ? temp : null;
+ }
+
+ return moreTemp;
+ }
+
+ public static ItemStack getIC2Cell(final int meta) {
+ final ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, meta);
+ return temp != null ? temp : null;
+ }
+
+ public static ItemStack getEmptyCell() {
+ return getEmptyCell(1);
+ }
+
+ public static ItemStack getEmptyCell(int i) {
+ if (ItemList.Cell_Empty.hasBeenSet()) {
+ return ItemList.Cell_Empty.get(i);
+ }
+ final ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", i, 0);
+ return temp != null ? temp : null;
+ }
+
+ public static void getItemForOreDict(
+ final String FQRN, final String oreDictName, final String itemName, final int meta) {
+ try {
+ Item em = null;
+ final Item em1 = getItemFromFQRN(FQRN);
+ // Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null) {
+ em = em1;
+ }
+ if (em != null) {
+
+ final ItemStack metaStack = new ItemStack(em, 1, meta);
+ GT_OreDictUnificator.registerOre(oreDictName, metaStack);
+
+ /*
+ * ItemStack itemStackWithMeta = new ItemStack(em,1,meta);
+ * GT_OreDictUnificator.registerOre(oreDictName, new
+ * ItemStack(itemStackWithMeta.getItem()));
+ */
+ }
+ } catch (final NullPointerException e) {
+ Logger.ERROR(itemName + " not found. [NULL]");
+ }
+ }
+
+ public static void addItemToOreDictionary(ItemStack stack, final String oreDictName, boolean useWildcardMeta) {
+ if (useWildcardMeta) {
+ stack = ItemUtils.getWildcardStack(stack);
+ }
+ try {
+ OreDictionary.registerOre(oreDictName, stack);
+ } catch (final NullPointerException e) {
+ Logger.ERROR(ItemUtils.getItemName(stack) + " not registered. [NULL]");
+ }
+ }
+
+ public static void addItemToOreDictionary(final ItemStack stack, final String oreDictName) {
+ addItemToOreDictionary(stack, oreDictName, false);
+ }
+
+ public static ItemStack getItemStackWithMeta(
+ final boolean MOD, final String FQRN, final String itemName, final int meta, final int itemstackSize) {
+ if (MOD) {
+ try {
+ Item em = null;
+ final Item em1 = getItemFromFQRN(FQRN);
+ // Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null) {
+ if (null == em) {
+ em = em1;
+ }
+ if (em != null) {
+ final ItemStack metaStack = new ItemStack(em, itemstackSize, meta);
+ return metaStack;
+ }
+ }
+ return null;
+ } catch (final NullPointerException e) {
+ Logger.ERROR(itemName + " not found. [NULL]");
+ return null;
+ }
+ }
+ return null;
+ }
+
+ public static ItemStack simpleMetaStack(final String FQRN, final int meta, final int itemstackSize) {
+ try {
+ Item em = null;
+ final Item em1 = getItemFromFQRN(FQRN);
+ // Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null) {
+ if (null == em) {
+ em = em1;
+ }
+ if (em != null) {
+ final ItemStack metaStack = new ItemStack(em, itemstackSize, meta);
+ return metaStack;
+ }
+ }
+ return null;
+ } catch (final NullPointerException e) {
+ Logger.ERROR(FQRN + " not found. [NULL]");
+ return null;
+ }
+ }
+
+ public static ItemStack simpleMetaStack(ItemStack simpleStack, int meta, int size) {
+ return simpleMetaStack(simpleStack.getItem(), meta, size);
+ }
+
+ public static ItemStack simpleMetaStack(final Item item, int meta, int size) {
+ if (item == null) {
+ return null;
+ }
+ if (meta < 0 || meta > Short.MAX_VALUE) {
+ meta = 0;
+ }
+ if (size < 0 || size > 64) {
+ size = 1;
+ }
+ // Logger.INFO("Found Metastack: " + item.getUnlocalizedName() + ":" + meta);
+ // Logger.INFO(""+ReflectionUtils.getMethodName(0));
+ // Logger.INFO(""+ReflectionUtils.getMethodName(1));
+ // Logger.INFO(""+ReflectionUtils.getMethodName(2));
+ // Logger.INFO(""+ReflectionUtils.getMethodName(3));
+ // Logger.INFO(""+ReflectionUtils.getMethodName(4));
+ final ItemStack metaStack = new ItemStack(item, size, meta);
+ return metaStack;
+ }
+
+ public static ItemStack simpleMetaStack(final Block block, final int meta, final int size) {
+ return simpleMetaStack(Item.getItemFromBlock(block), meta, size);
+ }
+
+ public static ItemStack getCorrectStacktype(final String fqrn, final int stackSize) {
+ final String oreDict = "ore:";
+ ItemStack temp;
+ if (fqrn.toLowerCase().contains(oreDict.toLowerCase())) {
+ final String sanitizedName = fqrn.replace(oreDict, "");
+ temp = ItemUtils.getItemStackFromFQRN(sanitizedName, stackSize);
+ return temp;
+ }
+ final String[] fqrnSplit = fqrn.split(":");
+ String temp1;
+ String temp2;
+ temp1 = fqrnSplit[1];
+ if (fqrnSplit.length < 3) {
+ temp2 = "0";
+ } else {
+ temp2 = fqrnSplit[2];
+ }
+ temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, temp1, Integer.parseInt(temp2), stackSize);
+ return temp;
+ }
+
+ public static ItemStack getCorrectStacktype(final Object item_Input, final int stackSize) {
+ if (item_Input instanceof String) {
+ return getItemStackOfAmountFromOreDictNoBroken((String) item_Input, stackSize);
+ } else if (item_Input instanceof ItemStack) {
+ return (ItemStack) item_Input;
+ }
+ return null;
+ }
+
+ public static Item getItemFromFQRN(final String fqrn) // fqrn = fully qualified resource name
+ {
+ final String[] fqrnSplit = fqrn.split(":");
+ return GameRegistry.findItem(fqrnSplit[0], fqrnSplit[1]);
+ }
+
+ public static ItemStack getItemStackFromFQRN(
+ final String fqrn, final int Size) // fqrn = fully qualified resource name
+ {
+ Logger.INFO("Trying to split string '" + fqrn + "'.");
+ final String[] fqrnSplit = fqrn.split(":");
+ if (fqrnSplit.length < 2) {
+ return null;
+ } else {
+ if (fqrnSplit.length == 2) {
+ Logger.INFO("Mod: " + fqrnSplit[0] + ", Item: " + fqrnSplit[1]);
+ return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
+ } else if (fqrnSplit.length == 3 && fqrnSplit[2] != null && fqrnSplit[2].length() > 0) {
+ Logger.INFO("Mod: " + fqrnSplit[0] + ", Item: " + fqrnSplit[1] + ", Meta: " + fqrnSplit[2]);
+ ItemStack aStack = GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
+ int aMeta = Integer.parseInt(fqrnSplit[2]);
+ if (aStack != null && (aMeta >= 0 && aMeta <= Short.MAX_VALUE)) {
+ return ItemUtils.simpleMetaStack(aStack, aMeta, Size);
+ } else {
+ Logger.INFO("Could not find instance of Item: " + fqrnSplit[1]);
+ }
+ }
+ }
+ return null;
+ }
+
+ public static void generateSpawnEgg(
+ final String entityModID, final String parSpawnName, final int colourEgg, final int colourOverlay) {
+ final Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay)
+ .setUnlocalizedName("spawn_egg_" + parSpawnName.toLowerCase())
+ .setTextureName(CORE.MODID + ":spawn_egg");
+ GameRegistry.registerItem(itemSpawnEgg, "spawnEgg" + parSpawnName);
+ }
+
+ public static ItemStack[] validItemsForOreDict(final String oredictName) {
+ final List<?> validNames = MaterialUtils.oreDictValuesForEntry(oredictName);
+ final ItemStack[] inputs = new ItemStack[validNames.size()];
+ for (int i = 0; i < validNames.size(); i++) {
+ inputs[i] = (ItemStack) validNames.get(i);
+ }
+ return inputs;
+ }
+
+ public static ItemStack getItemStackOfAmountFromOreDict(String oredictName, final int amount) {
+ String mTemp = oredictName;
+
+ if (oredictName.contains("-") || oredictName.contains("_")) {
+ mTemp = Utils.sanitizeString(mTemp, new char[] {'-', '_'});
+ } else {
+ mTemp = Utils.sanitizeString(mTemp);
+ }
+
+ if (oredictName.contains("rod")) {
+ String s = "stick" + oredictName.substring(3);
+ oredictName = s;
+ }
+
+ // Banned Materials and replacements for GT5.8 compat.
+
+ if (oredictName.toLowerCase().contains("ingotclay")) {
+ return getSimpleStack(Items.clay_ball, amount);
+ }
+
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if (oredictName.toLowerCase().contains("rutile")) {
+ mTemp = oredictName.replace("Rutile", "Titanium");
+ }
+ if (oredictName.toLowerCase().contains("vanadiumsteel")) {
+ mTemp = oredictName.replace("VanadiumSteel", "StainlessSteel");
+ }
+ }
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(mTemp);
+ if (!oreDictList.isEmpty()) {
+ final ItemStack returnValue = oreDictList.get(0).copy();
+ returnValue.stackSize = amount;
+ return returnValue;
+ }
+ Logger.INFO("Failed to find `" + oredictName + "` in OD.");
+ return getErrorStack(amount, oredictName + " x" + amount);
+ // return getItemStackOfAmountFromOreDictNoBroken(mTemp, amount);
+ }
+
+ public static ItemStack getItemStackOfAmountFromOreDictNoBroken(String oredictName, final int amount) {
+ if (CORE_Preloader.DEBUG_MODE) {
+ Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(1));
+ Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(2));
+ Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(3));
+ Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(4));
+ Logger.WARNING("Looking up: " + oredictName + " - from method: " + ReflectionUtils.getMethodName(5));
+ }
+
+ try {
+
+ if (oredictName.contains("-") || oredictName.contains("_")) {
+ oredictName = Utils.sanitizeString(oredictName, new char[] {'-', '_'});
+ } else {
+ oredictName = Utils.sanitizeString(oredictName);
+ }
+
+ // Adds a check to grab dusts using GT methodology if possible.
+ ItemStack returnValue = null;
+ if (oredictName.toLowerCase().contains("dust")) {
+ final String MaterialName = oredictName.toLowerCase().replace("dust", "");
+ final Materials m = Materials.get(MaterialName);
+ if (m != null && m != Materials._NULL) {
+ returnValue = getGregtechDust(m, amount);
+ if (checkForInvalidItems(returnValue)) {
+ return returnValue;
+ }
+ }
+ }
+ if (returnValue == null) {
+ returnValue = getItemStackOfAmountFromOreDict(oredictName, amount);
+ if (ItemUtils.checkForInvalidItems(returnValue)) {
+ return returnValue.copy();
+ }
+ }
+
+ Logger.RECIPE(oredictName + " was not valid.");
+ return null;
+ } catch (final Throwable t) {
+ return null;
+ }
+ }
+
+ public static ItemStack getGregtechDust(final Materials material, final int amount) {
+ final ItemStack returnValue = GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L);
+ if (returnValue != null) {
+ if (ItemUtils.checkForInvalidItems(returnValue)) {
+ return returnValue.copy();
+ }
+ }
+ Logger.WARNING(material + " was not valid.");
+ return null;
+ }
+
+ // NullFormula
+ public static Item[] generateSpecialUseDusts(
+ final String unlocalizedName, final String materialName, final int Colour) {
+ return generateSpecialUseDusts(unlocalizedName, materialName, "NullFormula", Colour);
+ }
+
+ public static Item[] generateSpecialUseDusts(
+ final String unlocalizedName, final String materialName, String mChemForm, final int Colour) {
+ final Item[] output = {
+ new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, mChemForm, Colour, "Dust"),
+ new BaseItemDustUnique("itemDustSmall" + unlocalizedName, materialName, mChemForm, Colour, "Small"),
+ new BaseItemDustUnique("itemDustTiny" + unlocalizedName, materialName, mChemForm, Colour, "Tiny")
+ };
+
+ // Generate Shaped/Shapeless Recipes
+
+ final ItemStack normalDust = ItemUtils.getSimpleStack(output[0]);
+ final ItemStack smallDust = ItemUtils.getSimpleStack(output[1]);
+ final ItemStack tinyDust = ItemUtils.getSimpleStack(output[2]);
+
+ CORE.RA.addpackagerRecipe(ItemList.Schematic_Dust.get(0), smallDust, tinyDust, normalDust);
+
+ if (ItemUtils.checkForInvalidItems(tinyDust) && ItemUtils.checkForInvalidItems(normalDust)) {
+ if (RecipeUtils.addShapedRecipe(
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ normalDust)) {
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + materialName + " - Success");
+ } else {
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + materialName + " - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ normalDust,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ ItemUtils.getSimpleStack(tinyDust, 9))) {
+ Logger.WARNING("9 Tiny dust from 1 Recipe: " + materialName + " - Success");
+ } else {
+ Logger.WARNING("9 Tiny dust from 1 Recipe: " + materialName + " - Failed");
+ }
+ }
+
+ if (ItemUtils.checkForInvalidItems(smallDust) && ItemUtils.checkForInvalidItems(normalDust)) {
+ if (RecipeUtils.addShapedRecipe(
+ smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, normalDust)) {
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: " + materialName + " - Success");
+ } else {
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: " + materialName + " - Failed");
+ }
+ if (RecipeUtils.addShapedRecipe(
+ null,
+ normalDust,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ ItemUtils.getSimpleStack(smallDust, 4))) {
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: " + materialName + " - Success");
+ } else {
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: " + materialName + " - Failed");
+ }
+ }
+
+ return output;
+ }
+
+ public static Item generateSpecialUsePlate(
+ final String internalName, final String displayName, final short[] rgb, final int radioactivity) {
+ return generateSpecialUsePlate(
+ internalName, displayName, Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]), radioactivity);
+ }
+
+ public static Item generateSpecialUsePlate(
+ final String internalName,
+ final String displayName,
+ final String mFormula,
+ final short[] rgb,
+ final int radioactivity) {
+ return generateSpecialUsePlate(
+ internalName, displayName, mFormula, Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]), radioactivity);
+ }
+
+ public static Item generateSpecialUsePlate(
+ final String internalName, final String displayName, final int rgb, final int radioactivity) {
+ return new BaseItemPlate_OLD(internalName, displayName, rgb, radioactivity);
+ }
+
+ public static Item generateSpecialUsePlate(
+ final String internalName,
+ final String displayName,
+ final String mFormula,
+ final int rgb,
+ final int radioactivity) {
+ return new BaseItemPlate_OLD(internalName, displayName, mFormula, rgb, radioactivity);
+ }
+
+ public static Item[] generateSpecialUseDusts(final Material material, final boolean onlyLargeDust) {
+ return generateSpecialUseDusts(material, onlyLargeDust, false);
+ }
+
+ public static Item[] generateSpecialUseDusts(
+ final Material material, final boolean onlyLargeDust, final boolean disableExtraRecipes) {
+ final String materialName = material.getLocalizedName();
+ final String unlocalizedName = Utils.sanitizeString(materialName);
+ final int Colour = material.getRgbAsHex();
+ final String aChemForm = material.vChemicalFormula;
+ final boolean isChemFormvalid = (aChemForm != null && aChemForm.length() > 0);
+ Item[] output = null;
+ if (onlyLargeDust == false) {
+ output = new Item[] {
+ new BaseItemDustUnique(
+ "itemDust" + unlocalizedName, materialName, isChemFormvalid ? aChemForm : "", Colour, "Dust"),
+ new BaseItemDustUnique(
+ "itemDustSmall" + unlocalizedName,
+ materialName,
+ isChemFormvalid ? aChemForm : "",
+ Colour,
+ "Small"),
+ new BaseItemDustUnique(
+ "itemDustTiny" + unlocalizedName,
+ materialName,
+ isChemFormvalid ? aChemForm : "",
+ Colour,
+ "Tiny")
+ };
+ } else {
+ output = new Item[] {new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, Colour, "Dust")};
+ }
+
+ new RecipeGen_DustGeneration(material, disableExtraRecipes);
+
+ return output;
+ }
+
+ public static MultiPickaxeBase generateMultiPick(final boolean GT_Durability, final Materials material) {
+ final ToolMaterial customMaterial = Utils.generateToolMaterialFromGT(material);
+ final int enchantLevel = material.mEnchantmentToolsLevel;
+ final Object enchant = new Pair(material.mEnchantmentTools, enchantLevel);
+ return generateMultiPick(
+ GT_Durability,
+ customMaterial,
+ material.mDefaultLocalName,
+ material.mDurability,
+ material.mRGBa,
+ enchant);
+ }
+
+ public static MultiPickaxeBase generateMultiPick(final Material material) {
+ final ToolMaterial customMaterial = Utils.generateToolMaterial(material);
+ return generateMultiPick(
+ true,
+ customMaterial,
+ material.getLocalizedName(),
+ (int) material.vDurability,
+ material.getRGBA(),
+ null);
+ }
+
+ public static MultiPickaxeBase generateMultiPick(
+ final boolean GT_Durability,
+ final ToolMaterial customMaterial,
+ final String name,
+ final int durability,
+ final short[] rgba,
+ final Object enchantment) {
+ Logger.WARNING("Generating a Multi-Pick out of " + name);
+ final short[] rgb = rgba;
+ int dur = customMaterial.getMaxUses();
+ Logger.WARNING("Determined durability for " + name + " is " + dur);
+ if (GT_Durability) {
+ dur = durability * 100;
+ Logger.WARNING("Using gregtech durability value, " + name + " is now " + dur + ".");
+ } else if (dur <= 0) {
+ dur = durability;
+ Logger.WARNING("Determined durability too low, " + name + " is now " + dur
+ + " based on the GT material durability.");
+ }
+ if (dur <= 0) {
+ Logger.WARNING("Still too low, " + name + " will now go unused.");
+ return null;
+ }
+
+ Object enchant;
+ if (enchantment != null) {
+ if (enchantment instanceof Pair) {
+ enchant = enchantment;
+ }
+ } else {
+ enchant = null;
+ }
+
+ final MultiPickaxeBase MP_Redstone = new MultiPickaxeBase(
+ name + " Multipick", (customMaterial), dur, Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]), enchantment);
+
+ if (MP_Redstone.isValid) {
+ return MP_Redstone;
+ }
+ Logger.WARNING("Pickaxe was not valid.");
+ return null;
+ }
+
+ public static MultiSpadeBase generateMultiShovel(final boolean GT_Durability, final Materials material) {
+ final ToolMaterial customMaterial = Utils.generateToolMaterialFromGT(material);
+ return generateMultiShovel(
+ GT_Durability, customMaterial, material.mDefaultLocalName, material.mDurability, material.mRGBa);
+ }
+
+ public static MultiSpadeBase generateMultiShovel(final Material material) {
+ final ToolMaterial customMaterial = Utils.generateToolMaterial(material);
+ return generateMultiShovel(
+ true, customMaterial, material.getLocalizedName(), (int) material.vDurability, material.getRGBA());
+ }
+
+ public static MultiSpadeBase generateMultiShovel(
+ final boolean GT_Durability,
+ final ToolMaterial customMaterial,
+ final String name,
+ final int durability,
+ final short[] rgba) {
+ Logger.WARNING("Generating a Multi-Spade out of " + name);
+ final short[] rgb = rgba;
+ int dur = customMaterial.getMaxUses();
+ Logger.WARNING("Determined durability for " + name + " is " + dur);
+ if (GT_Durability) {
+ dur = durability * 100;
+ Logger.WARNING("Using gregtech durability value, " + name + " is now " + dur + ".");
+ } else if (dur <= 0) {
+ dur = durability;
+ Logger.WARNING("Determined durability too low, " + name + " is now " + dur
+ + " based on the GT material durability.");
+ }
+ if (dur <= 0) {
+ Logger.WARNING("Still too low, " + name + " will now go unused.");
+ return null;
+ }
+ final MultiSpadeBase MP_Redstone = new MultiSpadeBase(
+ name + " Multispade", (customMaterial), dur, Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]));
+
+ if (MP_Redstone.isValid) {
+ return MP_Redstone;
+ }
+ return null;
+ }
+
+ public static BaseItemDecidust generateDecidust(final Materials material) {
+ if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null) {
+ final Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
+ if (placeholder != null) {
+ generateDecidust(placeholder);
+ }
+ }
+ return null;
+ }
+
+ public static BaseItemDecidust generateDecidust(final Material material) {
+ if ((material.getDust(1) != null) && MaterialUtils.hasValidRGBA(material.getRGBA())) {
+ final BaseItemDecidust Decidust = new BaseItemDecidust(material);
+ return Decidust;
+ }
+ return null;
+ }
+
+ public static BaseItemCentidust generateCentidust(final Materials material) {
+ if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null) {
+ final Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
+ if (placeholder != null) {
+ generateCentidust(placeholder);
+ }
+ }
+ return null;
+ }
+
+ public static BaseItemCentidust generateCentidust(final Material material) {
+ if ((material.getDust(1) != null) && MaterialUtils.hasValidRGBA(material.getRGBA())) {
+ final BaseItemCentidust Centidust = new BaseItemCentidust(material);
+ return Centidust;
+ }
+ return null;
+ }
+
+ public static boolean isRadioactive(final String materialName) {
+ int sRadiation = 0;
+ if (materialName.toLowerCase().contains("uranium")) {
+ sRadiation = 2;
+ } else if (materialName.toLowerCase().contains("plutonium")) {
+ sRadiation = 4;
+ } else if (materialName.toLowerCase().contains("thorium")) {
+ sRadiation = 1;
+ }
+ if (sRadiation >= 1) {
+ return true;
+ }
+ return false;
+ }
+
+ public static int getRadioactivityLevel(final String materialName) {
+ int sRadiation = 0;
+ if (materialName.toLowerCase().contains("uranium")) {
+ sRadiation = 2;
+ } else if (materialName.toLowerCase().contains("plutonium")) {
+ sRadiation = 4;
+ } else if (materialName.toLowerCase().contains("thorium")) {
+ sRadiation = 1;
+ }
+ return sRadiation;
+ }
+
+ public static String getArrayStackNames(ArrayList<?> aStack) {
+ Object aType = aStack.get(0);
+ if (aType instanceof FluidStack) {
+ FluidStack[] aItems = new FluidStack[aStack.size()];
+ for (int i = 0; i < aItems.length; i++) {
+ aItems[i] = (FluidStack) aStack.get(i);
+ }
+ return getArrayStackNames(aItems);
+ }
+ if (aType instanceof ItemStack) {
+ ItemStack[] aItems = new ItemStack[aStack.size()];
+ for (int i = 0; i < aItems.length; i++) {
+ aItems[i] = (ItemStack) aStack.get(i);
+ }
+ return getArrayStackNames(aItems);
+ }
+ return "";
+ }
+
+ public static String getArrayStackNames(final AutoMap<?> aStack) {
+ Object aType = aStack.get(0);
+ if (aType instanceof FluidStack) {
+ FluidStack[] aItems = new FluidStack[aStack.size()];
+ for (int i = 0; i < aItems.length; i++) {
+ aItems[i] = (FluidStack) aStack.get(i);
+ }
+ return getArrayStackNames(aItems);
+ }
+ if (aType instanceof ItemStack) {
+ ItemStack[] aItems = new ItemStack[aStack.size()];
+ for (int i = 0; i < aItems.length; i++) {
+ aItems[i] = (ItemStack) aStack.get(i);
+ }
+ return getArrayStackNames(aItems);
+ }
+ return "";
+ }
+
+ public static String getArrayStackNames(final FluidStack[] aStack) {
+ String itemNames = "Fluid Array: ";
+ for (final FluidStack alph : aStack) {
+ if (alph != null) {
+ final String temp = itemNames;
+ itemNames = temp + ", " + alph.getLocalizedName() + " x" + alph.amount;
+ } else {
+ final String temp = itemNames;
+ itemNames = temp + ", " + "null" + " x" + "0";
+ }
+ }
+ return itemNames;
+ }
+
+ public static String getArrayStackNames(final ItemStack[] aStack) {
+ String itemNames = "";
+ int aPos = 0;
+ for (final ItemStack alph : aStack) {
+ if (alph == null) {
+ continue;
+ }
+ if (alph != null) {
+ final String temp = itemNames;
+ itemNames = temp + (aPos > 0 ? ", " : "") + alph.getDisplayName() + " x" + alph.stackSize;
+ aPos++;
+ }
+ }
+ return itemNames;
+ }
+
+ public static String[] getArrayStackNamesAsArray(final ItemStack[] aStack) {
+ final String[] itemNames = aStack == null ? new String[] {} : new String[aStack.length];
+ if (aStack != null) {
+ Logger.INFO("" + aStack.length);
+ }
+
+ if (aStack == null || aStack.length < 1) {
+ return itemNames;
+ }
+
+ int arpos = 0;
+ for (final ItemStack alph : aStack) {
+ if (alph == null) {
+ continue;
+ }
+ try {
+ itemNames[arpos] = alph.getDisplayName();
+ arpos++;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ return itemNames;
+ }
+
+ public static String getFluidArrayStackNames(final FluidStack[] aStack) {
+ String itemNames = "Fluid Array: ";
+ for (final FluidStack alph : aStack) {
+ final String temp = itemNames;
+ itemNames = temp + ", " + alph.getFluid().getName() + " x" + alph.amount;
+ }
+ return itemNames;
+ }
+
+ public static ItemStack getGregtechCircuit(final int Meta) {
+ return ItemUtils.getItemStackWithMeta(
+ LoadedMods.Gregtech, "gregtech:gt.integrated_circuit", "Gregtech Circuit", Meta, 0);
+ }
+
+ public static ItemStack[] getBlockDrops(final ArrayList<ItemStack> blockDrops) {
+ if (blockDrops == null) {
+ return null;
+ }
+ if (blockDrops.isEmpty()) {
+ return null;
+ }
+ final ItemStack[] outputs = new ItemStack[blockDrops.size()];
+ short forCounter = 0;
+ for (final ItemStack I : blockDrops) {
+ outputs[forCounter++] = I;
+ }
+ return outputs;
+ }
+
+ private static Map<Item, String> mModidCache = new HashMap<Item, String>();
+
+ private static String getModId(final Item item) {
+ if (mModidCache.containsKey(item)) {
+ return mModidCache.get(item);
+ }
+ String value = "";
+ try {
+ final GameRegistry.UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(item);
+ if (id != null) {
+ final String modname = (id.modId == null ? id.name : id.modId);
+ value = ((id == null) || id.modId.equals("")) ? "minecraft" : modname;
+ }
+ } catch (final Throwable t) {
+ try {
+ final UniqueIdentifier t2 = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(item));
+ if (t2 != null) {
+ final String modname = (t2.modId == null ? t2.name : t2.modId);
+ value = ((t2 == null) || t2.modId.equals("")) ? "minecraft" : modname;
+ }
+ } catch (final Throwable t3) {
+ t3.printStackTrace();
+ value = "bad modid";
+ }
+ }
+ if (!mModidCache.containsKey(item)) {
+ return mModidCache.put(item, value);
+ }
+ return value;
+ }
+
+ public static String getModId(final ItemStack key) {
+ return getModId(key.getItem());
+ }
+
+ // Take 2 - GT/GT++ Dusts
+ public static ItemStack getGregtechDust(final String oredictName, final int amount) {
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ if (!oreDictList.isEmpty()) {
+ ItemStack returnvalue;
+ for (int xrc = 0; xrc < oreDictList.size(); xrc++) {
+ final String modid = getModId(oreDictList.get(xrc).getItem());
+ if (modid != null && (modid.equals("gregtech") || modid.equals(CORE.MODID))) {
+ returnvalue = oreDictList.get(xrc).copy();
+ returnvalue.stackSize = amount;
+ return returnvalue;
+ }
+ }
+ }
+ return getNonTinkersDust(oredictName, amount);
+ }
+
+ // Anything But Tinkers Dust
+ public static ItemStack getNonTinkersDust(final String oredictName, final int amount) {
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ if (!oreDictList.isEmpty()) {
+ ItemStack returnvalue;
+ for (int xrc = 0; xrc < oreDictList.size(); xrc++) {
+ final String modid = getModId(oreDictList.get(xrc).getItem());
+ if (modid != null && !modid.equals("tconstruct")) {
+ returnvalue = oreDictList.get(xrc).copy();
+ returnvalue.stackSize = amount;
+ return returnvalue;
+ }
+ }
+ }
+ // If only Tinkers dust exists, bow down and just use it.
+ return getItemStackOfAmountFromOreDictNoBroken(oredictName, amount);
+ }
+
+ @Deprecated
+ public static ItemStack getGregtechOreStack(OrePrefixes mPrefix, Materials mMat, int mAmount) {
+
+ ItemStack aTemp = getOrePrefixStack(mPrefix, mMat, mAmount);
+ if (aTemp != null) {
+ return aTemp;
+ }
+
+ String mName = MaterialUtils.getMaterialName(mMat);
+
+ String mItemName = mPrefix.name() + mName;
+ // Utils.LOG_INFO("[Component Maker] Trying to get "+mItemName+".");
+ ItemStack gregstack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(mItemName, mAmount);
+ if (gregstack == null) {
+ // Utils.LOG_INFO("[Component Maker] Failed to get "+mItemName+".");
+ return null;
+ }
+ // Utils.LOG_INFO("[Component Maker] Found "+mItemName+".");
+ return (gregstack);
+ }
+
+ public static ItemStack getOrePrefixStack(OrePrefixes mPrefix, Material mMat, int mAmount) {
+
+ String mName = Utils.sanitizeString(mMat.getLocalizedName());
+
+ String mItemName = mPrefix.name() + mName;
+ ItemStack gregstack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(mItemName, mAmount);
+ if (gregstack == null) {
+ return null;
+ }
+ return (gregstack);
+ }
+
+ public static ItemStack getOrePrefixStack(OrePrefixes mPrefix, Materials mMat, int mAmount) {
+ if (mPrefix == OrePrefixes.rod) {
+ mPrefix = OrePrefixes.stick;
+ }
+ ItemStack aGtStack = GT_OreDictUnificator.get(mPrefix, mMat, mAmount);
+ if (aGtStack == null) {
+ Logger.INFO(
+ "Failed to find `" + mPrefix + MaterialUtils.getMaterialName(mMat) + "` in OD. [Prefix Search]");
+ return getErrorStack(mAmount, (mPrefix.toString() + MaterialUtils.getMaterialName(mMat) + " x" + mAmount));
+ } else {
+ return aGtStack;
+ }
+ }
+
+ public static ItemStack getErrorStack(int mAmount) {
+ return getErrorStack(mAmount, null);
+ }
+
+ public static ItemStack getErrorStack(int mAmount, String aName) {
+ ItemStack g = getSimpleStack(ModItems.AAA_Broken, 1);
+ if (aName != null) {
+ // NBTUtils.setString(g, "Lore", EnumChatFormatting.RED+aName);
+ NBTUtils.setBookTitle(g, EnumChatFormatting.RED + aName);
+ // NBTUtils.setBookTitle(g, EnumChatFormatting.YELLOW+"Maybe Alkalus should know about this");
+ }
+ return g;
+ }
+
+ public static ItemStack[] getStackOfAllOreDictGroup(String oredictname) {
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictname);
+ if (!oreDictList.isEmpty()) {
+ final ItemStack[] returnValues = new ItemStack[oreDictList.size()];
+ for (int i = 0; i < oreDictList.size(); i++) {
+ if (oreDictList.get(i) != null) {
+ returnValues[i] = oreDictList.get(i);
+ }
+ }
+ return returnValues.length > 0 ? returnValues : null;
+ } else {
+ return null;
+ }
+ }
+
+ public static boolean registerFuel(ItemStack aBurnable, int burn) {
+ return CORE.burnables.add(new Pair<Integer, ItemStack>(burn, aBurnable));
+ }
+
+ public static String getLocalizedNameOfBlock(BlockPos pos) {
+ Block block = pos.world.getBlock(pos.xPos, pos.yPos, pos.zPos);
+ int metaData = pos.world.getBlockMetadata(pos.xPos, pos.yPos, pos.zPos);
+ return LangUtils.getLocalizedNameOfBlock(block, metaData);
+ }
+
+ public static boolean checkForInvalidItems(ItemStack mInput) {
+ return checkForInvalidItems(new ItemStack[] {mInput});
+ }
+
+ public static boolean checkForInvalidItems(ItemStack[] mInput) {
+ return checkForInvalidItems(mInput, new ItemStack[] {});
+ }
+
+ /**
+ *
+ * @param mInputs
+ * @return {@link Boolean} - True if {@link ItemStack}[] only contains valid
+ * items.
+ */
+ public static boolean checkForInvalidItems(ItemStack[] mInputs, ItemStack[] mOutputs) {
+ if (mInputs == null || mOutputs == null) {
+ return false;
+ }
+
+ if (mInputs.length > 0) {
+ for (ItemStack stack : mInputs) {
+ if (stack != null) {
+ if (stack.getItem() != null) {
+ if (stack.getItem() == ModItems.AAA_Broken
+ || stack.getItem().getClass() == ModItems.AAA_Broken.getClass()) {
+ return false;
+ } else if (stack.getItem() == ModItems.ZZZ_Empty
+ || stack.getItem().getClass() == ModItems.ZZZ_Empty.getClass()) {
+ return false;
+ } else {
+ continue;
+ }
+ } else {
+ continue;
+ }
+ } else {
+ return false;
+ }
+ }
+ }
+ if (mOutputs.length > 0) {
+ for (ItemStack stack : mOutputs) {
+ if (stack != null) {
+ if (stack.getItem() != null) {
+ if (stack.getItem() == ModItems.AAA_Broken
+ || stack.getItem().getClass() == ModItems.AAA_Broken.getClass()) {
+ return false;
+ } else if (stack.getItem() == ModItems.ZZZ_Empty
+ || stack.getItem().getClass() == ModItems.ZZZ_Empty.getClass()) {
+ return false;
+ } else {
+ continue;
+ }
+ } else {
+ continue;
+ }
+ } else {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public static IInventory organiseInventory(IInventory aInputInventory) {
+ ItemStack[] p = new ItemStack[aInputInventory.getSizeInventory()];
+ for (int o = 0; o < aInputInventory.getSizeInventory(); o++) {
+ p[o] = aInputInventory.getStackInSlot(o);
+ }
+ // ItemStack[] g = organiseInventory(p);
+
+ IInventory aTemp = aInputInventory;
+ for (int i = 0; i < p.length; ++i) {
+ for (int j = i + 1; j < p.length; ++j) {
+ if (p[j] != null && (p[i] == null || GT_Utility.areStacksEqual(p[i], p[j]))) {
+ GT_Utility.moveStackFromSlotAToSlotB(aTemp, aTemp, j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ }
+ }
+ }
+
+ /*
+ for (int o = 0; o < aInputInventory.getSizeInventory(); o++) {
+ aTemp.setInventorySlotContents(o, g[o]);
+ }*/
+ return aTemp;
+ }
+
+ public static ItemStack[] organiseInventory(ItemStack[] aInputs) {
+
+ // Update Slots
+ int aInvSize = aInputs.length;
+ ItemStack[] newArray = new ItemStack[aInvSize];
+
+ // Try merge stacks
+ for (int i = 0; i < aInvSize; i++) {
+ for (int i2 = 0; i2 < aInvSize; i2++) {
+ if (i != i2) {
+ ItemStack[] t1 = new ItemStack[] {aInputs[i], aInputs[i2]};
+ if (t1[0] == null || t1[1] == null) {
+ continue;
+ } else if (!GT_Utility.areStacksEqual(t1[0], t1[1])) {
+ continue;
+ }
+ // Try Merge
+ else {
+
+ if (GT_Utility.areStacksEqual(t1[0], t1[1])) {
+ while ((t1[0].stackSize < 64 && t1[1].stackSize > 0)) {
+ t1[0].stackSize++;
+ t1[1].stackSize--;
+ if (t1[1].stackSize <= 0) {
+ t1[1] = null;
+ break;
+ }
+ if (t1[0].stackSize == 64) {
+ break;
+ }
+ }
+ newArray[i] = t1[1];
+ newArray[i2] = t1[0];
+ }
+ }
+ }
+ }
+ }
+
+ ItemStack[] newArray2 = new ItemStack[aInvSize];
+
+ // Move nulls to end
+ int count2 = 0;
+ for (int i = 0; i < aInvSize; i++) if (newArray[i] != null) newArray2[count2++] = newArray[i];
+ while (count2 < aInvSize) newArray2[count2++] = null;
+
+ return newArray2;
+ }
+
+ public static String getFluidName(FluidStack aFluid) {
+ return aFluid != null ? aFluid.getFluid().getLocalizedName(aFluid) : "NULL";
+ }
+
+ public static String getFluidName(Fluid aFluid) {
+ return aFluid != null ? aFluid.getLocalizedName() : "NULL";
+ }
+
+ public static String getItemName(ItemStack aStack) {
+ if (aStack == null) {
+ return "ERROR - Empty Stack";
+ }
+ String aDisplay = null;
+ try {
+ aDisplay = (""
+ + StatCollector.translateToLocal(
+ aStack.getItem().getUnlocalizedNameInefficiently(aStack) + ".name"))
+ .trim();
+ if (aStack.hasTagCompound()) {
+ if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("display", 10)) {
+ NBTTagCompound nbttagcompound = aStack.stackTagCompound.getCompoundTag("display");
+
+ if (nbttagcompound.hasKey("Name", 8)) {
+ aDisplay = nbttagcompound.getString("Name");
+ }
+ }
+ }
+ } catch (Throwable t) {
+
+ }
+ if (aDisplay == null || aDisplay.length() <= 0) {
+ aDisplay = aStack.getUnlocalizedName() + ":" + aStack.getItemDamage();
+ } else {
+ aDisplay += " | Meta: " + aStack.getItemDamage();
+ }
+ return aDisplay;
+ }
+
+ public static String getUnlocalizedItemName(ItemStack aStack) {
+ if (aStack == null) {
+ return "ERROR.Empty.Stack";
+ }
+ String aDisplay = null;
+ try {
+ aDisplay = (aStack.getUnlocalizedName()).trim();
+ } catch (Throwable t) {
+ aDisplay = aStack.getItem().getUnlocalizedName();
+ }
+ if (aDisplay == null || aDisplay.length() <= 0) {
+ aDisplay = aStack.getItem().getUnlocalizedNameInefficiently(aStack);
+ }
+ return aDisplay;
+ }
+
+ public static boolean isItemGregtechTool(ItemStack aStack) {
+ if (aStack == null) {
+ return false;
+ }
+ final Item mItem = aStack.getItem();
+ final Item aSkookum = ItemUtils.getItemFromFQRN("miscutils:gt.plusplus.metatool.01");
+ final Class aSkookClass = aSkookum.getClass();
+ if (aSkookClass.isInstance(mItem)
+ || mItem instanceof GT_MetaGenerated_Tool_01
+ || mItem instanceof MetaGeneratedGregtechTools
+ || mItem instanceof Gregtech_MetaTool
+ || mItem == aSkookum) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isToolWrench(ItemStack aWrench) {
+ if (isItemGregtechTool(aWrench)
+ && (aWrench.getItemDamage() == 16
+ || aWrench.getItemDamage() == 120
+ || aWrench.getItemDamage() == 122
+ || aWrench.getItemDamage() == 124
+ || aWrench.getItemDamage() == 7734)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isToolMallet(ItemStack aMallet) {
+ if (isItemGregtechTool(aMallet) && (aMallet.getItemDamage() == 14)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isToolScrewdriver(ItemStack aScrewdriver) {
+ if (isItemGregtechTool(aScrewdriver)
+ && (aScrewdriver.getItemDamage() == 22 || aScrewdriver.getItemDamage() == 150)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isToolCrowbar(ItemStack aCrowbar) {
+ if (isItemGregtechTool(aCrowbar) && (aCrowbar.getItemDamage() == 20)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isToolWirecutters(ItemStack aWirecutters) {
+ if (isItemGregtechTool(aWirecutters) && (aWirecutters.getItemDamage() == 26)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isToolHammer(ItemStack aHammer) {
+ if (isItemGregtechTool(aHammer) && (aHammer.getItemDamage() == 12 || aHammer.getItemDamage() == 7734)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isToolSolderingIron(ItemStack aSoldering) {
+ if (isItemGregtechTool(aSoldering) && (aSoldering.getItemDamage() == 160)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static ItemStack[] cleanItemStackArray(ItemStack[] input) {
+ int aArraySize = input.length;
+ ItemStack[] aOutput = new ItemStack[aArraySize];
+ AutoMap<ItemStack> aCleanedItems = new AutoMap<ItemStack>();
+ for (ItemStack checkStack : input) {
+ if (ItemUtils.checkForInvalidItems(checkStack)) {
+ aCleanedItems.put(checkStack);
+ }
+ }
+ for (int i = 0; i < aArraySize; i++) {
+ ItemStack aMappedStack = aCleanedItems.get(i);
+ if (aMappedStack != null) {
+ aOutput[i] = aMappedStack;
+ }
+ }
+ return aOutput;
+ }
+
+ public static ItemStack getEnchantedBook(Enchantment aEnch, int aLevel) {
+ return enchantItem(new ItemStack(Items.enchanted_book), aEnch, aLevel);
+ }
+
+ public static ItemStack enchantItem(ItemStack aStack, Enchantment aEnch, int aLevel) {
+ Items.enchanted_book.addEnchantment(aStack, new EnchantmentData(aEnch, aLevel));
+ return aStack;
+ }
+
+ public static boolean doesOreDictHaveEntryFor(String string) {
+ return OreDictUtils.containsValidEntries(string);
+ }
+
+ public static void hideItemFromNEI(ItemStack aItemToHide) {
+ codechicken.nei.api.API.hideItem(aItemToHide);
+ }
+
+ public static ItemStack getNullStack() {
+ return GT_Values.NI;
+ }
+
+ public static ItemStack depleteStack(ItemStack aStack) {
+ return depleteStack(aStack, 1);
+ }
+
+ public static ItemStack depleteStack(ItemStack aStack, int aAmount) {
+ final int cap = aStack.stackSize;
+ if (cap >= 1 && cap >= aAmount) {
+ ItemStack aDepStack = aStack.copy();
+ aDepStack.stackSize = (MathUtils.balance((aDepStack.stackSize - 1), 0, 64));
+ if (aDepStack.stackSize > 0) {
+ return aDepStack;
+ }
+ }
+ return getNullStack();
+ }
+
+ public static boolean isControlCircuit(ItemStack aStack) {
+ if (aStack != null) {
+ Item aItem = aStack.getItem();
+ if (aItem == CI.getNumberedBioCircuit(0).getItem()
+ || aItem == CI.getNumberedCircuit(0).getItem()
+ || aItem == CI.getNumberedAdvancedCircuit(0).getItem()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean isCatalyst(ItemStack aStack) {
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mBlueCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mBrownCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mOrangeCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mPurpleCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mRedCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mYellowCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mPinkCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mFormaldehydeCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mSolidAcidCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mInfiniteMutationCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, AgriculturalChem.mGreenCatalyst, true)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isMillingBall(ItemStack aStack) {
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallAlumina, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallSoapstone, true)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static String getLocalizedNameOfBlock(Block aBlock, int aMeta) {
+ return LangUtils.getLocalizedNameOfBlock(aBlock, aMeta);
+ }
+
+ public static boolean doesItemListEntryExist(String string) {
+ ItemList[] aListValues = ItemList.class.getEnumConstants();
+ for (ItemList aItem : aListValues) {
+ if (aItem != null) {
+ if (aItem.name().equals(string) || aItem.name().toLowerCase().equals(string.toLowerCase())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public static ItemList getValueOfItemList(String string, ItemList aOther) {
+ ItemList[] aListValues = ItemList.class.getEnumConstants();
+ for (ItemList aItem : aListValues) {
+ if (aItem != null) {
+ if (aItem.name().equals(string) || aItem.name().toLowerCase().equals(string.toLowerCase())) {
+ return aItem;
+ }
+ }
+ }
+ Logger.INFO("Tried to obtain '" + string + "' from the GT ItemList, however it does not exist.");
+ if (aOther != null) {
+ Logger.INFO("Using fallback option instead - " + aOther.name());
+ }
+ return aOther;
+ }
+
+ public static ItemStack getValueOfItemList(String string, int aAmount, ItemList aOther) {
+ return getValueOfItemList(string, aOther).get(aAmount);
+ }
+
+ public static ItemStack getValueOfItemList(String string, int aAmount, ItemStack aOther) {
+ ItemList[] aListValues = ItemList.class.getEnumConstants();
+ for (ItemList aItem : aListValues) {
+ if (aItem != null) {
+ if (aItem.name().equals(string) || aItem.name().toLowerCase().equals(string.toLowerCase())) {
+ return aItem.get(aAmount);
+ }
+ }
+ }
+ Logger.INFO("Tried to obtain '" + string + "' from the GT ItemList, however it does not exist.");
+ if (aOther != null) {
+ Logger.INFO("Using fallback option instead - " + ItemUtils.getItemName(aOther));
+ }
+ return aOther;
+ }
+
+ public static boolean areItemsEqual(ItemStack aStack1, ItemStack aStack2) {
+ return areItemsEqual(aStack1, aStack2, true);
+ }
+
+ public static boolean areItemsEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) {
+ return GT_Utility.areStacksEqual(aStack1, aStack2, aIgnoreNBT);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/LangUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/LangUtils.java
index 0b24e962af..8517d129b2 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/LangUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/LangUtils.java
@@ -1,14 +1,13 @@
package gtPlusPlus.core.util.minecraft;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
import cpw.mods.fml.common.registry.LanguageRegistry;
import gregtech.api.util.GT_LanguageManager;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -17,134 +16,129 @@ import net.minecraft.util.StatCollector;
public class LangUtils {
-
- public static boolean rewriteEntryForLanguageRegistry(String aKey, String aNewValue){
- return rewriteEntryForLanguageRegistry("en_US", aKey, aNewValue);
- }
-
- @SuppressWarnings("unchecked")
- public static boolean rewriteEntryForLanguageRegistry(String aLang, String aKey, String aNewValue){
- LanguageRegistry aInstance = LanguageRegistry.instance();
- Field aModLanguageData = ReflectionUtils.getField(LanguageRegistry.class, "modLanguageData");
- if (aModLanguageData != null){
- Map<String,Properties> aProps = new HashMap<String, Properties>();
- Object aInstanceProps;
- try {
- aInstanceProps = aModLanguageData.get(aInstance);
- if (aInstanceProps != null){
- aProps = (Map<String, Properties>) aInstanceProps;
- Properties aLangProps = aProps.get(aLang);
- if (aLangProps != null){
- if (aLangProps.containsKey(aKey)) {
- aLangProps.remove(aKey);
- aLangProps.put(aKey, aNewValue);
- }
- else {
- aLangProps.put(aKey, aNewValue);
- }
- aProps.remove(aLang);
- aProps.put(aLang, aLangProps);
- ReflectionUtils.setField(aInstance, aModLanguageData, aProps);
- }
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
-
- }
- }
- return false;
- }
-
- public static String trans(String aNr, String aEnglish) {
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_GTPP_" + aNr, aEnglish, false);
- }
-
-
-
- /**
- * Quick Block Name Lookup that is friendly to servers and locale.
- */
- private static final Map<String, String> mLocaleCache = new HashMap<String, String>();
-
- public static String getLocalizedNameOfBlock(Block aBlock, int aMeta) {
- if (aBlock != null) {
- return getLocalizedNameOfItemStack(ItemUtils.simpleMetaStack(aBlock, aMeta, 1));
- }
- return "Bad Block Name";
- }
-
- public static String getLocalizedNameOfItem(Item aItem, int aMeta) {
- if (aItem != null) {
- return getLocalizedNameOfItemStack(ItemUtils.simpleMetaStack(aItem, aMeta, 1));
- }
- return "Bad Item Name";
- }
-
- public static String getLocalizedNameOfItemStack(ItemStack aStack) {
- String aUnlocalized;
- if (aStack != null) {
- aUnlocalized = ItemUtils.getUnlocalizedItemName(aStack)+"."+aStack.getItemDamage()+".name";
- if (aUnlocalized == null || aUnlocalized.length() <= 0) {
- return "Bad Locale Data";
- }
- String mCacheKey = aUnlocalized;
- if (mLocaleCache.containsKey(mCacheKey)) {
- // Recache the key if it's invalid.
- if (mLocaleCache.get(mCacheKey).toLowerCase().contains(".name") || mLocaleCache.get(mCacheKey).toLowerCase().contains("|")) {
- mLocaleCache.remove(mCacheKey);
- String mNew;
- try {
- mNew = ("" + StatCollector
- .translateToLocal(aStack.getItem().getUnlocalizedNameInefficiently(aStack) + ".name"))
- .trim();
- if (aStack.hasTagCompound()) {
- if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("display", 10)) {
- NBTTagCompound nbttagcompound = aStack.stackTagCompound.getCompoundTag("display");
-
- if (nbttagcompound.hasKey("Name", 8)) {
- mNew = nbttagcompound.getString("Name");
- }
- }
- }
- } catch (Throwable t) {
- mNew = "ERROR - Empty Stack";
- }
- Logger.INFO("Re-caching "+mNew+" into locale cache. Key: "+mCacheKey);
- mLocaleCache.put(mCacheKey, mNew);
- }
- Logger.INFO("Returning Cached Value. Key: "+mCacheKey);
- return mLocaleCache.get(mCacheKey);
- }
- else {
- String unlocalizedName = aStack.getItem().getUnlocalizedName(aStack);
- Logger.INFO("Cached New Value. UnlocalName: "+unlocalizedName);
- String blockName = StatCollector.translateToLocal(unlocalizedName + ".name");
- Logger.INFO("Cached New Value. TranslatedName: "+unlocalizedName);
- if (blockName.toLowerCase().contains(".name") || blockName.toLowerCase().contains("|")) {
- try {
- blockName = ("" + StatCollector
- .translateToLocal(aStack.getItem().getUnlocalizedNameInefficiently(aStack) + ".name"))
- .trim();
- if (aStack.hasTagCompound()) {
- if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("display", 10)) {
- NBTTagCompound nbttagcompound = aStack.stackTagCompound.getCompoundTag("display");
- if (nbttagcompound.hasKey("Name", 8)) {
- blockName = nbttagcompound.getString("Name");
- }
- }
- }
- } catch (Throwable t) {
- blockName = "ERROR - Empty Stack";
- }
- }
- mLocaleCache.put(mCacheKey, blockName);
- Logger.INFO("Cached New Value. Key: "+mCacheKey);
- return blockName;
- }
-
- }
- return "Bad ItemStack Name";
- }
-
-
+ public static boolean rewriteEntryForLanguageRegistry(String aKey, String aNewValue) {
+ return rewriteEntryForLanguageRegistry("en_US", aKey, aNewValue);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static boolean rewriteEntryForLanguageRegistry(String aLang, String aKey, String aNewValue) {
+ LanguageRegistry aInstance = LanguageRegistry.instance();
+ Field aModLanguageData = ReflectionUtils.getField(LanguageRegistry.class, "modLanguageData");
+ if (aModLanguageData != null) {
+ Map<String, Properties> aProps = new HashMap<String, Properties>();
+ Object aInstanceProps;
+ try {
+ aInstanceProps = aModLanguageData.get(aInstance);
+ if (aInstanceProps != null) {
+ aProps = (Map<String, Properties>) aInstanceProps;
+ Properties aLangProps = aProps.get(aLang);
+ if (aLangProps != null) {
+ if (aLangProps.containsKey(aKey)) {
+ aLangProps.remove(aKey);
+ aLangProps.put(aKey, aNewValue);
+ } else {
+ aLangProps.put(aKey, aNewValue);
+ }
+ aProps.remove(aLang);
+ aProps.put(aLang, aLangProps);
+ ReflectionUtils.setField(aInstance, aModLanguageData, aProps);
+ }
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+
+ }
+ }
+ return false;
+ }
+
+ public static String trans(String aNr, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_GTPP_" + aNr, aEnglish, false);
+ }
+
+ /**
+ * Quick Block Name Lookup that is friendly to servers and locale.
+ */
+ private static final Map<String, String> mLocaleCache = new HashMap<String, String>();
+
+ public static String getLocalizedNameOfBlock(Block aBlock, int aMeta) {
+ if (aBlock != null) {
+ return getLocalizedNameOfItemStack(ItemUtils.simpleMetaStack(aBlock, aMeta, 1));
+ }
+ return "Bad Block Name";
+ }
+
+ public static String getLocalizedNameOfItem(Item aItem, int aMeta) {
+ if (aItem != null) {
+ return getLocalizedNameOfItemStack(ItemUtils.simpleMetaStack(aItem, aMeta, 1));
+ }
+ return "Bad Item Name";
+ }
+
+ public static String getLocalizedNameOfItemStack(ItemStack aStack) {
+ String aUnlocalized;
+ if (aStack != null) {
+ aUnlocalized = ItemUtils.getUnlocalizedItemName(aStack) + "." + aStack.getItemDamage() + ".name";
+ if (aUnlocalized == null || aUnlocalized.length() <= 0) {
+ return "Bad Locale Data";
+ }
+ String mCacheKey = aUnlocalized;
+ if (mLocaleCache.containsKey(mCacheKey)) {
+ // Recache the key if it's invalid.
+ if (mLocaleCache.get(mCacheKey).toLowerCase().contains(".name")
+ || mLocaleCache.get(mCacheKey).toLowerCase().contains("|")) {
+ mLocaleCache.remove(mCacheKey);
+ String mNew;
+ try {
+ mNew = (""
+ + StatCollector.translateToLocal(
+ aStack.getItem().getUnlocalizedNameInefficiently(aStack) + ".name"))
+ .trim();
+ if (aStack.hasTagCompound()) {
+ if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("display", 10)) {
+ NBTTagCompound nbttagcompound = aStack.stackTagCompound.getCompoundTag("display");
+
+ if (nbttagcompound.hasKey("Name", 8)) {
+ mNew = nbttagcompound.getString("Name");
+ }
+ }
+ }
+ } catch (Throwable t) {
+ mNew = "ERROR - Empty Stack";
+ }
+ Logger.INFO("Re-caching " + mNew + " into locale cache. Key: " + mCacheKey);
+ mLocaleCache.put(mCacheKey, mNew);
+ }
+ Logger.INFO("Returning Cached Value. Key: " + mCacheKey);
+ return mLocaleCache.get(mCacheKey);
+ } else {
+ String unlocalizedName = aStack.getItem().getUnlocalizedName(aStack);
+ Logger.INFO("Cached New Value. UnlocalName: " + unlocalizedName);
+ String blockName = StatCollector.translateToLocal(unlocalizedName + ".name");
+ Logger.INFO("Cached New Value. TranslatedName: " + unlocalizedName);
+ if (blockName.toLowerCase().contains(".name")
+ || blockName.toLowerCase().contains("|")) {
+ try {
+ blockName = (""
+ + StatCollector.translateToLocal(
+ aStack.getItem().getUnlocalizedNameInefficiently(aStack) + ".name"))
+ .trim();
+ if (aStack.hasTagCompound()) {
+ if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("display", 10)) {
+ NBTTagCompound nbttagcompound = aStack.stackTagCompound.getCompoundTag("display");
+ if (nbttagcompound.hasKey("Name", 8)) {
+ blockName = nbttagcompound.getString("Name");
+ }
+ }
+ }
+ } catch (Throwable t) {
+ blockName = "ERROR - Empty Stack";
+ }
+ }
+ mLocaleCache.put(mCacheKey, blockName);
+ Logger.INFO("Cached New Value. Key: " + mCacheKey);
+ return blockName;
+ }
+ }
+ return "Bad ItemStack Name";
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 73ccfdf8a5..3d42bcda84 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.util.minecraft;
-import java.util.*;
-
import gregtech.api.enums.*;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
@@ -19,502 +17,524 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.data.*;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.*;
import net.minecraft.item.*;
import net.minecraftforge.oredict.OreDictionary;
public class MaterialUtils {
- public static short firstID = 791;
-
- @SuppressWarnings({ "rawtypes", "unused" })
- private static Class[][] commonTypes =
-{{Materials.class, int.class, TextureSet.class, float.class, int.class,
- int.class, int.class, int.class, int.class, int.class, int.class,
- String.class, int.class, int.class, int.class, int.class, boolean.class,
- boolean.class, int.class, int.class, int.class, Dyes.class, int.class,
- List.class , List.class}};
-
- public static List<?> oreDictValuesForEntry(final String oredictName){
- List<?> oredictItemNames;
- if(OreDictionary.doesOreNameExist(oredictName)){
- final List<ItemStack> oredictItems = OreDictionary.getOres(oredictName);
- oredictItemNames = oredictItems;
- return oredictItemNames;
- }
- return null;
- }
-
- private static Map<String, Material> mGeneratedMaterialMap = new HashMap();
-
- public static Material generateMaterialFromGtENUM(final Materials material){
- return generateMaterialFromGtENUM(material, null, null);
- }
-
- public static Material generateMaterialFromGtENUM(final Materials material, TextureSet aCustomTextures){
- return generateMaterialFromGtENUM(material, null, aCustomTextures);
- }
-
- public static Material generateMaterialFromGtENUM(final Materials material, short[] customRGB){
- return generateMaterialFromGtENUM(material, customRGB, null);
- }
-
- public static Material generateMaterialFromGtENUM(final Materials material, short[] customRGB, TextureSet aCustomTextures){
- String aMaterialKey = getMaterialName(material).toLowerCase();
- if (mGeneratedMaterialMap.containsKey(aMaterialKey)) {
- return mGeneratedMaterialMap.get(aMaterialKey);
- }
-
- try {
- @SuppressWarnings("deprecation")
- String name = material.name();
- final short[] rgba = (customRGB == null ? material.mRGBa : customRGB);
- final int melting = material.mMeltingPoint;
- final int boiling = material.mBlastFurnaceTemp;
- final long protons = material.getProtons();
- final long neutrons = material.getNeutrons();
- final boolean blastFurnace = material.mBlastFurnaceRequired;
- Integer radioactivity = 0;
- if (material.isRadioactive()){
- ItemStack aDustStack = ItemUtils.getOrePrefixStack(OrePrefixes.dust, material, 1);
- radioactivity = aDustStack != null ? GT_Utility.getRadioactivityLevel(aDustStack) : 0;
- if (radioactivity == 0) {
- long aProtons = material.getProtons();
- radioactivity = (int) Math.min(Math.max((aProtons / 30), 1), 9);
- }
- }
- Logger.MATERIALS("[Debug] Calculated Radiation level to be "+radioactivity.intValue()+".");
- TextureSet iconSet = null;
- if (aCustomTextures == null) {
- if (material.isRadioactive()) {
- iconSet = TextureSets.NUCLEAR.get();
- }
- else {
- iconSet = material.mIconSet;
- }
- }
- else {
- iconSet = aCustomTextures;
- }
- if (iconSet == null || iconSet.mSetName.toLowerCase().contains("fluid")) {
- iconSet = TextureSet.SET_METALLIC;
- }
- Logger.MATERIALS("[Debug] Calculated Texture Set to be "+iconSet.mSetName+".");
-
-
- final int durability = material.mDurability;
- boolean mGenerateCell = false;
- boolean mGenerateFluid = true;
- MaterialState materialState;
- String chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mChemicalFormula));
- final Element element = material.mElement;
-
-
- //Weird Blacklist of Bad Chemical Strings
- if (material.mElement == Element.Pb || material.mElement == Element.Na || material.mElement == Element.Ar){
- chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mElement.name()));
- }
-
- //Determine default state
- Logger.MATERIALS("[Debug] Setting State of GT generated material. "+material.mDefaultLocalName);
- if (material.getMolten(1) != null || material.getSolid(1) != null){
- materialState = MaterialState.SOLID;
- Logger.MATERIALS("[Debug] Molten or Solid was not null.");
- if (material.getMolten(1) == null && material.getSolid(1) != null){
- Logger.MATERIALS("[Debug] Molten is Null, Solid is not. Enabling cell generation.");
- mGenerateCell = true;
- }
- else if (material.getMolten(1) != null && material.getSolid(1) == null){
- Logger.MATERIALS("[Debug] Molten is not Null, Solid is null. Not enabling cell generation.");
- //mGenerateCell = true;
- }
- Logger.MATERIALS("[Debug] State set as solid.");
- }
- else if (material.getFluid(1) != null){
- Logger.MATERIALS("[Debug] State set as liquid.");
- materialState = MaterialState.LIQUID;
- }
- else if (material.getGas(1) != null){
- Logger.MATERIALS("[Debug] State set as gas.");
- materialState = MaterialState.GAS;
- }/*
- else if (material.getPlasma(1) != null){
- Logger.MATERIALS("[Debug] State set as plasma.");
- materialState = MaterialState.PLASMA;
- }*/
- else {
- Logger.MATERIALS("[Debug] State set as solid. This material has no alternative states, so for safety we wont generate anything.");
- materialState = MaterialState.SOLID;
- mGenerateFluid = false;
- }
-
-
- if (name.toLowerCase().contains("infused")){
- final String tempname = name.substring(7, name.length());
- name = "Infused " + tempname;
- }
- if (hasValidRGBA(rgba) || (element == Element.H) || ((material == Materials.InfusedAir) || (material == Materials.InfusedFire) || (material == Materials.InfusedEarth) || (material == Materials.InfusedWater))){
- //ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material);
- //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material);
- Material M = new Material(name, materialState,iconSet, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity, mGenerateCell, mGenerateFluid);
- mGeneratedMaterialMap.put(aMaterialKey, M);
- return M;
- }
- else {
- Logger.DEBUG_MATERIALS("Failed to generate GT++ material instance for "+material.name() +" | Valid RGB? "+(hasValidRGBA(rgba)));
- }
- }
- catch (Throwable t) {
- Logger.DEBUG_MATERIALS("Failed to generate GT++ material instance for "+material.name());
- t.printStackTrace();
- }
- return null;
-
- }
-
- public static Material generateQuickMaterial(final String materialName, final MaterialState defaultState, final short[] colour, final int sRadioactivity) {
- String aMaterialKey = materialName.toLowerCase();
- if (mGeneratedMaterialMap.containsKey(aMaterialKey)) {
- return mGeneratedMaterialMap.get(aMaterialKey);
- }
-
- final Material temp = new Material(
- materialName,
- defaultState,
- colour,
- 1000, //melting
- 3000, //boiling
- 50, //Protons
- 50, //Neutrons
- false,
- "",
- sRadioactivity);
- mGeneratedMaterialMap.put(aMaterialKey, temp);
- return temp;
- }
-
- public static boolean hasValidRGBA(final short[] rgba){
- if (rgba == null || rgba.length < 3 || rgba.length > 4){
- return false;
- }
- return true;
- }
-
- public static int getTierOfMaterial(final double aMeltingPoint){
-
- return aMeltingPoint < 1000 ? 0 : (MathUtils.roundToClosestInt(aMeltingPoint/1000f));
-
-
- /*if ((aMeltingPoint >= 0) && (aMeltingPoint <= 1000)){
- return 1;
- }
- else if((aMeltingPoint >= 1001) && (aMeltingPoint <= 2000)){
- return 2;
- }
- else if((aMeltingPoint >= 2001) && (aMeltingPoint <= 3000)){
- return 3;
- }
- else if((aMeltingPoint >= 3001) && (aMeltingPoint <= 4000)){
- return 4;
- }
- else if((aMeltingPoint >= 4001) && (aMeltingPoint <= 5000)){
- return 5;
- }
- else if((aMeltingPoint >= 5001) && (aMeltingPoint <= 6000)){
- return 6;
- }
- else if((aMeltingPoint >= 6001) && (aMeltingPoint <= 7000)){
- return 7;
- }
- else if((aMeltingPoint >= 7001) && (aMeltingPoint <= 8000)){
- return 8;
- }
- else if((aMeltingPoint >= 8001) && (aMeltingPoint <= 9000)){
- return 9;
- }
- else if((aMeltingPoint >= 9001) && (aMeltingPoint <= 9999)){
- return 10;
- }
- else {
- return 0;
- }*/
- }
-
- public static int getVoltageForTier(int aTier) {
- //aTier += 1; - Probably some logic to this, idk.
-
- switch(aTier){
- case 0:
- return 16;
- case 1:
- return 30;
- case 2:
- return 120;
- case 3:
- return 480;
- case 4:
- return 1920;
- case 5:
- return 7680;
- case 6:
- return 30720;
- case 7:
- return 122880;
- case 8:
- return 491520;
- case 9:
- return 1966080;
- case 10:
- return 7864320;
- case 11:
- return 31457280;
- case 12:
- return 125829120;
- case 13:
- return 503316480;
- case 14:
- return 2013265920;
- default:
- return Integer.MAX_VALUE;
- }
-
- /*else {
- int newTier = aTier - 1;
- return (int) ((4*(Math.pow(4, newTier)))*7.5);
- }*/
- }
-
- private static Materials getMaterialByName(String materialName) {
-
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- return (Materials) EnumUtils.getValue(gregtech.api.enums.Materials.class, materialName, false);
- }
- else {
- for (Materials m : Materials.values()) {
- if (MaterialUtils.getMaterialName(m).toLowerCase().equals(materialName.toLowerCase())) {
- return m;
- }
- }
- return null;
- }
- }
-
- @SuppressWarnings("deprecation")
- public static String getMaterialName(Materials mat){
-
- String mName = null;
-
- try {
- mName = (String) ReflectionUtils.getField(Materials.class, "mDefaultLocalName").get(mat);
- if (mName == null) {
- mName = (String) ReflectionUtils.getField(Materials.class, "mName").get(mat);
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
- }
-
-
- if (mName == null || mName.equals("")){
- mName = mat.name();
- }
- return mName;
- }
-
- public static TextureSet getMostCommonTextureSet(List<Material> list) {
- TypeCounter<TextureSet> aCounter = new TypeCounter<TextureSet>(TextureSet.class);
- for (Material m : list) {
- TextureSet t = m.getTextureSet();
- if (t == null) {
- t = Materials.Gold.mIconSet;
- }
- if (t != null) {
- aCounter.add(t, t.mSetName);
- }
- }
- return aCounter.getResults();
- /*Optional<TextureSet> r = list.stream().map(Material::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey);
- TextureSet o = (r != null && r.isPresent() && r.get() != null) ? r.get() : null;
- return o;*/
- }
-
-
-
- public static Materials getMaterial(String aMaterialName, String aFallbackMaterialName) {
- Materials g = getMaterial(aMaterialName);
- if (g == null) {
- g = getMaterial(aFallbackMaterialName);
- }
- if (g == null) {
- Logger.INFO("Failed finding material '"+aMaterialName+"' & fallback '"+aFallbackMaterialName+"', returning _NULL.");
- CORE.crash();
- //g = Materials._NULL;
- }
- return g;
- }
-
- public static Materials getMaterial(String aMaterialName) {
- Materials m = gtPlusPlus.xmod.gregtech.common.StaticFields59.getMaterial(aMaterialName);
- if (m == null) {
- m = getMaterialByName(aMaterialName);
- }
- if (m == null) {
- Logger.INFO("Failed finding material '"+aMaterialName+"', returning _NULL.");
- m = Materials._NULL;
- }
- return m;
- }
-
- public static AutoMap<Material> getCompoundMaterialsRecursively(Material aMat){
- return getCompoundMaterialsRecursively_Speiger(aMat);
- /*
- AutoMap<Material> aDataSet = new AutoMap<Material>();
- final int HARD_LIMIT = 1000;
- int mLoopCounter = 0;
- if (aMat.getComposites().size() > 0) {
- try {
- List<Material> xList = Lists.newLinkedList();
- for (MaterialStack kj : aMat.getComposites()) {
- xList.add(kj.getStackMaterial());
- }
- if (xList.isEmpty()) {
- aDataSet.put(aMat);
- return aDataSet;
- }
- ListIterator<Material> listIterator = xList.listIterator();
- while(listIterator.hasNext()){
- Material e = listIterator.next();
- listIterator.remove();
- if (mLoopCounter > HARD_LIMIT) {
- break;
- }
-
- if (e.getComposites().isEmpty()) {
- aDataSet.put(e);
- }
- else {
- for (MaterialStack x : e.getComposites()) {
- listIterator.add(x.getStackMaterial());
- }
- }
- mLoopCounter++;
-
-
- }}
- catch (Throwable t) {
- aDataSet.put(aMat);
- t.printStackTrace();
- }
- }
- if (aDataSet.isEmpty()) {
- aDataSet.put(aMat);
- return aDataSet;
- }
- return aDataSet;
- */}
-
- public static AutoMap<Material> getCompoundMaterialsRecursively_Speiger(Material toSearch) {
- AutoMap<Material> resultList = new AutoMap<Material>();
- if (toSearch.getComposites().isEmpty()) {
- resultList.put(toSearch);
- return resultList;
- }
- final int HARD_LIMIT = 1000;
-
- // Could be a Deque but i dont use the interface
- // enough to use it as default.
- LinkedList<Material> toCheck = new LinkedList<Material>();
-
- toCheck.add(toSearch);
- int processed = 0;
- while (toCheck.size() > 0 && processed < HARD_LIMIT) {
- Material current = toCheck.remove();
- if (current.getComposites().isEmpty()) {
- resultList.put(current);
- } else {
- for (MaterialStack entry : current.getComposites()) {
- toCheck.add(entry.getStackMaterial());
- }
- }
- processed++;
- }
- return resultList;
- }
-
- public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, Material aMaterial) {
- generateComponentAndAssignToAMaterial(aType, aMaterial, true);
- }
-
- public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, Material aMaterial, boolean generateRecipes) {
- Item aGC;
- if (aType == ComponentTypes.PLATEHEAVY) {
- aGC = new BaseItemPlateHeavy(aMaterial);
- }
- else if (aType == ComponentTypes.FINEWIRE) {
- aGC = new BaseItemFineWire(aMaterial);
- }
- else if (aType == ComponentTypes.FOIL) {
- aGC = new BaseItemFoil(aMaterial);
- }
- else {
- aGC = new BaseItemComponent(aMaterial, aType);
- }
- if (aGC != null) {
- String aFormattedLangName = aType.getName();
-
- if (!aFormattedLangName.startsWith(" ")) {
- if (aFormattedLangName.contains("@")) {
- String[] aSplit = aFormattedLangName.split("@");
- aFormattedLangName = aSplit[0] + " " + aMaterial.getLocalizedName() + " " + aSplit[1];
- }
- }
-
- if (aFormattedLangName.equals(aType.getName())) {
- aFormattedLangName = aMaterial.getLocalizedName() + aFormattedLangName;
-
- }
-
-
-
- Logger.MATERIALS("[Lang] "+aGC.getUnlocalizedName()+".name="+aFormattedLangName);
- aMaterial.registerComponentForMaterial(aType, ItemUtils.getSimpleStack(aGC));
- }
- }
-
-
-
-
-
-
-
-
- public static void generateSpecialDustAndAssignToAMaterial(Material aMaterial) {
- generateSpecialDustAndAssignToAMaterial(aMaterial, true);
- }
-
- public static void generateSpecialDustAndAssignToAMaterial(Material aMaterial, boolean generateMixerRecipes) {
- Item[] aDusts = ItemUtils.generateSpecialUseDusts(aMaterial, false, Utils.invertBoolean(generateMixerRecipes));
- if (aDusts != null && aDusts.length > 0) {
- aMaterial.registerComponentForMaterial(OrePrefixes.dust, ItemUtils.getSimpleStack(aDusts[0]));
- aMaterial.registerComponentForMaterial(OrePrefixes.dustSmall, ItemUtils.getSimpleStack(aDusts[1]));
- aMaterial.registerComponentForMaterial(OrePrefixes.dustTiny, ItemUtils.getSimpleStack(aDusts[2]));
- }
-
- }
-
- public static boolean doesMaterialExist(String aMatName) {
- for (Materials m : Materials.values()) {
- if (m.name().toLowerCase().equals(aMatName.toLowerCase())) {
- return true;
- }
- }
- return false;
- }
-
- public static boolean isNullGregtechMaterial(Materials aGregtechMaterial) {
- if (aGregtechMaterial == Materials._NULL || aGregtechMaterial.equals(Materials._NULL) || aGregtechMaterial.name().equals(Materials._NULL.name())) {
- return true;
- }
- return false;
- }
-
-
-} \ No newline at end of file
+ public static short firstID = 791;
+
+ @SuppressWarnings({"rawtypes", "unused"})
+ private static Class[][] commonTypes = {
+ {
+ Materials.class,
+ int.class,
+ TextureSet.class,
+ float.class,
+ int.class,
+ int.class,
+ int.class,
+ int.class,
+ int.class,
+ int.class,
+ int.class,
+ String.class,
+ int.class,
+ int.class,
+ int.class,
+ int.class,
+ boolean.class,
+ boolean.class,
+ int.class,
+ int.class,
+ int.class,
+ Dyes.class,
+ int.class,
+ List.class,
+ List.class
+ }
+ };
+
+ public static List<?> oreDictValuesForEntry(final String oredictName) {
+ List<?> oredictItemNames;
+ if (OreDictionary.doesOreNameExist(oredictName)) {
+ final List<ItemStack> oredictItems = OreDictionary.getOres(oredictName);
+ oredictItemNames = oredictItems;
+ return oredictItemNames;
+ }
+ return null;
+ }
+
+ private static Map<String, Material> mGeneratedMaterialMap = new HashMap();
+
+ public static Material generateMaterialFromGtENUM(final Materials material) {
+ return generateMaterialFromGtENUM(material, null, null);
+ }
+
+ public static Material generateMaterialFromGtENUM(final Materials material, TextureSet aCustomTextures) {
+ return generateMaterialFromGtENUM(material, null, aCustomTextures);
+ }
+
+ public static Material generateMaterialFromGtENUM(final Materials material, short[] customRGB) {
+ return generateMaterialFromGtENUM(material, customRGB, null);
+ }
+
+ public static Material generateMaterialFromGtENUM(
+ final Materials material, short[] customRGB, TextureSet aCustomTextures) {
+ String aMaterialKey = getMaterialName(material).toLowerCase();
+ if (mGeneratedMaterialMap.containsKey(aMaterialKey)) {
+ return mGeneratedMaterialMap.get(aMaterialKey);
+ }
+
+ try {
+ @SuppressWarnings("deprecation")
+ String name = material.name();
+ final short[] rgba = (customRGB == null ? material.mRGBa : customRGB);
+ final int melting = material.mMeltingPoint;
+ final int boiling = material.mBlastFurnaceTemp;
+ final long protons = material.getProtons();
+ final long neutrons = material.getNeutrons();
+ final boolean blastFurnace = material.mBlastFurnaceRequired;
+ Integer radioactivity = 0;
+ if (material.isRadioactive()) {
+ ItemStack aDustStack = ItemUtils.getOrePrefixStack(OrePrefixes.dust, material, 1);
+ radioactivity = aDustStack != null ? GT_Utility.getRadioactivityLevel(aDustStack) : 0;
+ if (radioactivity == 0) {
+ long aProtons = material.getProtons();
+ radioactivity = (int) Math.min(Math.max((aProtons / 30), 1), 9);
+ }
+ }
+ Logger.MATERIALS("[Debug] Calculated Radiation level to be " + radioactivity.intValue() + ".");
+ TextureSet iconSet = null;
+ if (aCustomTextures == null) {
+ if (material.isRadioactive()) {
+ iconSet = TextureSets.NUCLEAR.get();
+ } else {
+ iconSet = material.mIconSet;
+ }
+ } else {
+ iconSet = aCustomTextures;
+ }
+ if (iconSet == null || iconSet.mSetName.toLowerCase().contains("fluid")) {
+ iconSet = TextureSet.SET_METALLIC;
+ }
+ Logger.MATERIALS("[Debug] Calculated Texture Set to be " + iconSet.mSetName + ".");
+
+ final int durability = material.mDurability;
+ boolean mGenerateCell = false;
+ boolean mGenerateFluid = true;
+ MaterialState materialState;
+ String chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mChemicalFormula));
+ final Element element = material.mElement;
+
+ // Weird Blacklist of Bad Chemical Strings
+ if (material.mElement == Element.Pb || material.mElement == Element.Na || material.mElement == Element.Ar) {
+ chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mElement.name()));
+ }
+
+ // Determine default state
+ Logger.MATERIALS("[Debug] Setting State of GT generated material. " + material.mDefaultLocalName);
+ if (material.getMolten(1) != null || material.getSolid(1) != null) {
+ materialState = MaterialState.SOLID;
+ Logger.MATERIALS("[Debug] Molten or Solid was not null.");
+ if (material.getMolten(1) == null && material.getSolid(1) != null) {
+ Logger.MATERIALS("[Debug] Molten is Null, Solid is not. Enabling cell generation.");
+ mGenerateCell = true;
+ } else if (material.getMolten(1) != null && material.getSolid(1) == null) {
+ Logger.MATERIALS("[Debug] Molten is not Null, Solid is null. Not enabling cell generation.");
+ // mGenerateCell = true;
+ }
+ Logger.MATERIALS("[Debug] State set as solid.");
+ } else if (material.getFluid(1) != null) {
+ Logger.MATERIALS("[Debug] State set as liquid.");
+ materialState = MaterialState.LIQUID;
+ } else if (material.getGas(1) != null) {
+ Logger.MATERIALS("[Debug] State set as gas.");
+ materialState = MaterialState.GAS;
+ } /*
+ else if (material.getPlasma(1) != null){
+ Logger.MATERIALS("[Debug] State set as plasma.");
+ materialState = MaterialState.PLASMA;
+ }*/ else {
+ Logger.MATERIALS(
+ "[Debug] State set as solid. This material has no alternative states, so for safety we wont generate anything.");
+ materialState = MaterialState.SOLID;
+ mGenerateFluid = false;
+ }
+
+ if (name.toLowerCase().contains("infused")) {
+ final String tempname = name.substring(7, name.length());
+ name = "Infused " + tempname;
+ }
+ if (hasValidRGBA(rgba)
+ || (element == Element.H)
+ || ((material == Materials.InfusedAir)
+ || (material == Materials.InfusedFire)
+ || (material == Materials.InfusedEarth)
+ || (material == Materials.InfusedWater))) {
+ // ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material);
+ // ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material);
+ Material M = new Material(
+ name,
+ materialState,
+ iconSet,
+ durability,
+ rgba,
+ melting,
+ boiling,
+ protons,
+ neutrons,
+ blastFurnace,
+ chemicalFormula,
+ radioactivity,
+ mGenerateCell,
+ mGenerateFluid);
+ mGeneratedMaterialMap.put(aMaterialKey, M);
+ return M;
+ } else {
+ Logger.DEBUG_MATERIALS("Failed to generate GT++ material instance for " + material.name()
+ + " | Valid RGB? " + (hasValidRGBA(rgba)));
+ }
+ } catch (Throwable t) {
+ Logger.DEBUG_MATERIALS("Failed to generate GT++ material instance for " + material.name());
+ t.printStackTrace();
+ }
+ return null;
+ }
+
+ public static Material generateQuickMaterial(
+ final String materialName,
+ final MaterialState defaultState,
+ final short[] colour,
+ final int sRadioactivity) {
+ String aMaterialKey = materialName.toLowerCase();
+ if (mGeneratedMaterialMap.containsKey(aMaterialKey)) {
+ return mGeneratedMaterialMap.get(aMaterialKey);
+ }
+
+ final Material temp = new Material(
+ materialName,
+ defaultState,
+ colour,
+ 1000, // melting
+ 3000, // boiling
+ 50, // Protons
+ 50, // Neutrons
+ false,
+ "",
+ sRadioactivity);
+ mGeneratedMaterialMap.put(aMaterialKey, temp);
+ return temp;
+ }
+
+ public static boolean hasValidRGBA(final short[] rgba) {
+ if (rgba == null || rgba.length < 3 || rgba.length > 4) {
+ return false;
+ }
+ return true;
+ }
+
+ public static int getTierOfMaterial(final double aMeltingPoint) {
+
+ return aMeltingPoint < 1000 ? 0 : (MathUtils.roundToClosestInt(aMeltingPoint / 1000f));
+
+ /*if ((aMeltingPoint >= 0) && (aMeltingPoint <= 1000)){
+ return 1;
+ }
+ else if((aMeltingPoint >= 1001) && (aMeltingPoint <= 2000)){
+ return 2;
+ }
+ else if((aMeltingPoint >= 2001) && (aMeltingPoint <= 3000)){
+ return 3;
+ }
+ else if((aMeltingPoint >= 3001) && (aMeltingPoint <= 4000)){
+ return 4;
+ }
+ else if((aMeltingPoint >= 4001) && (aMeltingPoint <= 5000)){
+ return 5;
+ }
+ else if((aMeltingPoint >= 5001) && (aMeltingPoint <= 6000)){
+ return 6;
+ }
+ else if((aMeltingPoint >= 6001) && (aMeltingPoint <= 7000)){
+ return 7;
+ }
+ else if((aMeltingPoint >= 7001) && (aMeltingPoint <= 8000)){
+ return 8;
+ }
+ else if((aMeltingPoint >= 8001) && (aMeltingPoint <= 9000)){
+ return 9;
+ }
+ else if((aMeltingPoint >= 9001) && (aMeltingPoint <= 9999)){
+ return 10;
+ }
+ else {
+ return 0;
+ }*/
+ }
+
+ public static int getVoltageForTier(int aTier) {
+ // aTier += 1; - Probably some logic to this, idk.
+
+ switch (aTier) {
+ case 0:
+ return 16;
+ case 1:
+ return 30;
+ case 2:
+ return 120;
+ case 3:
+ return 480;
+ case 4:
+ return 1920;
+ case 5:
+ return 7680;
+ case 6:
+ return 30720;
+ case 7:
+ return 122880;
+ case 8:
+ return 491520;
+ case 9:
+ return 1966080;
+ case 10:
+ return 7864320;
+ case 11:
+ return 31457280;
+ case 12:
+ return 125829120;
+ case 13:
+ return 503316480;
+ case 14:
+ return 2013265920;
+ default:
+ return Integer.MAX_VALUE;
+ }
+
+ /*else {
+ int newTier = aTier - 1;
+ return (int) ((4*(Math.pow(4, newTier)))*7.5);
+ }*/
+ }
+
+ private static Materials getMaterialByName(String materialName) {
+
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return (Materials) EnumUtils.getValue(gregtech.api.enums.Materials.class, materialName, false);
+ } else {
+ for (Materials m : Materials.values()) {
+ if (MaterialUtils.getMaterialName(m).toLowerCase().equals(materialName.toLowerCase())) {
+ return m;
+ }
+ }
+ return null;
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public static String getMaterialName(Materials mat) {
+
+ String mName = null;
+
+ try {
+ mName = (String) ReflectionUtils.getField(Materials.class, "mDefaultLocalName")
+ .get(mat);
+ if (mName == null) {
+ mName = (String)
+ ReflectionUtils.getField(Materials.class, "mName").get(mat);
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+
+ if (mName == null || mName.equals("")) {
+ mName = mat.name();
+ }
+ return mName;
+ }
+
+ public static TextureSet getMostCommonTextureSet(List<Material> list) {
+ TypeCounter<TextureSet> aCounter = new TypeCounter<TextureSet>(TextureSet.class);
+ for (Material m : list) {
+ TextureSet t = m.getTextureSet();
+ if (t == null) {
+ t = Materials.Gold.mIconSet;
+ }
+ if (t != null) {
+ aCounter.add(t, t.mSetName);
+ }
+ }
+ return aCounter.getResults();
+ /*Optional<TextureSet> r = list.stream().map(Material::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey);
+ TextureSet o = (r != null && r.isPresent() && r.get() != null) ? r.get() : null;
+ return o;*/
+ }
+
+ public static Materials getMaterial(String aMaterialName, String aFallbackMaterialName) {
+ Materials g = getMaterial(aMaterialName);
+ if (g == null) {
+ g = getMaterial(aFallbackMaterialName);
+ }
+ if (g == null) {
+ Logger.INFO("Failed finding material '" + aMaterialName + "' & fallback '" + aFallbackMaterialName
+ + "', returning _NULL.");
+ CORE.crash();
+ // g = Materials._NULL;
+ }
+ return g;
+ }
+
+ public static Materials getMaterial(String aMaterialName) {
+ Materials m = gtPlusPlus.xmod.gregtech.common.StaticFields59.getMaterial(aMaterialName);
+ if (m == null) {
+ m = getMaterialByName(aMaterialName);
+ }
+ if (m == null) {
+ Logger.INFO("Failed finding material '" + aMaterialName + "', returning _NULL.");
+ m = Materials._NULL;
+ }
+ return m;
+ }
+
+ public static AutoMap<Material> getCompoundMaterialsRecursively(Material aMat) {
+ return getCompoundMaterialsRecursively_Speiger(aMat);
+ /*
+ AutoMap<Material> aDataSet = new AutoMap<Material>();
+ final int HARD_LIMIT = 1000;
+ int mLoopCounter = 0;
+ if (aMat.getComposites().size() > 0) {
+ try {
+ List<Material> xList = Lists.newLinkedList();
+ for (MaterialStack kj : aMat.getComposites()) {
+ xList.add(kj.getStackMaterial());
+ }
+ if (xList.isEmpty()) {
+ aDataSet.put(aMat);
+ return aDataSet;
+ }
+ ListIterator<Material> listIterator = xList.listIterator();
+ while(listIterator.hasNext()){
+ Material e = listIterator.next();
+ listIterator.remove();
+ if (mLoopCounter > HARD_LIMIT) {
+ break;
+ }
+
+ if (e.getComposites().isEmpty()) {
+ aDataSet.put(e);
+ }
+ else {
+ for (MaterialStack x : e.getComposites()) {
+ listIterator.add(x.getStackMaterial());
+ }
+ }
+ mLoopCounter++;
+
+
+ }}
+ catch (Throwable t) {
+ aDataSet.put(aMat);
+ t.printStackTrace();
+ }
+ }
+ if (aDataSet.isEmpty()) {
+ aDataSet.put(aMat);
+ return aDataSet;
+ }
+ return aDataSet;
+ */ }
+
+ public static AutoMap<Material> getCompoundMaterialsRecursively_Speiger(Material toSearch) {
+ AutoMap<Material> resultList = new AutoMap<Material>();
+ if (toSearch.getComposites().isEmpty()) {
+ resultList.put(toSearch);
+ return resultList;
+ }
+ final int HARD_LIMIT = 1000;
+
+ // Could be a Deque but i dont use the interface
+ // enough to use it as default.
+ LinkedList<Material> toCheck = new LinkedList<Material>();
+
+ toCheck.add(toSearch);
+ int processed = 0;
+ while (toCheck.size() > 0 && processed < HARD_LIMIT) {
+ Material current = toCheck.remove();
+ if (current.getComposites().isEmpty()) {
+ resultList.put(current);
+ } else {
+ for (MaterialStack entry : current.getComposites()) {
+ toCheck.add(entry.getStackMaterial());
+ }
+ }
+ processed++;
+ }
+ return resultList;
+ }
+
+ public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, Material aMaterial) {
+ generateComponentAndAssignToAMaterial(aType, aMaterial, true);
+ }
+
+ public static void generateComponentAndAssignToAMaterial(
+ ComponentTypes aType, Material aMaterial, boolean generateRecipes) {
+ Item aGC;
+ if (aType == ComponentTypes.PLATEHEAVY) {
+ aGC = new BaseItemPlateHeavy(aMaterial);
+ } else if (aType == ComponentTypes.FINEWIRE) {
+ aGC = new BaseItemFineWire(aMaterial);
+ } else if (aType == ComponentTypes.FOIL) {
+ aGC = new BaseItemFoil(aMaterial);
+ } else {
+ aGC = new BaseItemComponent(aMaterial, aType);
+ }
+ if (aGC != null) {
+ String aFormattedLangName = aType.getName();
+
+ if (!aFormattedLangName.startsWith(" ")) {
+ if (aFormattedLangName.contains("@")) {
+ String[] aSplit = aFormattedLangName.split("@");
+ aFormattedLangName = aSplit[0] + " " + aMaterial.getLocalizedName() + " " + aSplit[1];
+ }
+ }
+
+ if (aFormattedLangName.equals(aType.getName())) {
+ aFormattedLangName = aMaterial.getLocalizedName() + aFormattedLangName;
+ }
+
+ Logger.MATERIALS("[Lang] " + aGC.getUnlocalizedName() + ".name=" + aFormattedLangName);
+ aMaterial.registerComponentForMaterial(aType, ItemUtils.getSimpleStack(aGC));
+ }
+ }
+
+ public static void generateSpecialDustAndAssignToAMaterial(Material aMaterial) {
+ generateSpecialDustAndAssignToAMaterial(aMaterial, true);
+ }
+
+ public static void generateSpecialDustAndAssignToAMaterial(Material aMaterial, boolean generateMixerRecipes) {
+ Item[] aDusts = ItemUtils.generateSpecialUseDusts(aMaterial, false, Utils.invertBoolean(generateMixerRecipes));
+ if (aDusts != null && aDusts.length > 0) {
+ aMaterial.registerComponentForMaterial(OrePrefixes.dust, ItemUtils.getSimpleStack(aDusts[0]));
+ aMaterial.registerComponentForMaterial(OrePrefixes.dustSmall, ItemUtils.getSimpleStack(aDusts[1]));
+ aMaterial.registerComponentForMaterial(OrePrefixes.dustTiny, ItemUtils.getSimpleStack(aDusts[2]));
+ }
+ }
+
+ public static boolean doesMaterialExist(String aMatName) {
+ for (Materials m : Materials.values()) {
+ if (m.name().toLowerCase().equals(aMatName.toLowerCase())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean isNullGregtechMaterial(Materials aGregtechMaterial) {
+ if (aGregtechMaterial == Materials._NULL
+ || aGregtechMaterial.equals(Materials._NULL)
+ || aGregtechMaterial.name().equals(Materials._NULL.name())) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java
index 080b5665a3..cdfe1e5076 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java
@@ -1,265 +1,266 @@
package gtPlusPlus.core.util.minecraft;
+import gregtech.common.GT_Worldgen_GT_Ore_Layer;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.util.HashMap;
-
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
-import gregtech.common.GT_Worldgen_GT_Ore_Layer;
+public class MiningUtils {
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
+ public static Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld) {
+ String correctTool = "";
+ if (!currentWorld.isRemote) {
+ try {
+ correctTool = currentBlock.getHarvestTool(0);
+ // Utils.LOG_WARNING(correctTool);
+ if (correctTool.equals("pickaxe")) {
+ return true;
+ }
+ } catch (final NullPointerException e) {
+ return false;
+ }
+ }
+ return false;
+ }
-public class MiningUtils {
+ private static void removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z) {
+ try {
+ final Block block = world.getBlock(X, Y, Z);
+ if (canPickaxeBlock(block, world)) {
+ if ((block != Blocks.bedrock)
+ && (block.getBlockHardness(world, X, Y, Z) != -1)
+ && (block.getBlockHardness(world, X, Y, Z) <= 100)
+ && (block != Blocks.water)
+ && (block != Blocks.lava)) {
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+
+ } else {
+ Logger.WARNING("Incorrect Tool for mining this block.");
+ }
+ }
+ } catch (final NullPointerException e) {
+
+ }
+ }
+
+ public static boolean getBlockType(final Block block, final World world, final int[] xyz, final int miningLevel) {
+ final String LIQUID = "liquid";
+ final String BLOCK = "block";
+ final String ORE = "ore";
+ final String AIR = "air";
+ String blockClass = "";
+
+ if (world.isRemote) {
+ return false;
+ }
+
+ if (block == Blocks.end_stone) {
+ return true;
+ }
+ if (block == Blocks.stone) {
+ return true;
+ }
+ if (block == Blocks.sandstone) {
+ return true;
+ }
+ if (block == Blocks.netherrack) {
+ return true;
+ }
+ if (block == Blocks.nether_brick) {
+ return true;
+ }
+ if (block == Blocks.nether_brick_stairs) {
+ return true;
+ }
+ if (block == Blocks.nether_brick_fence) {
+ return true;
+ }
+ if (block == Blocks.glowstone) {
+ return true;
+ }
+
+ try {
+ blockClass = block.getClass().toString().toLowerCase();
+ Logger.WARNING(blockClass);
+ if (blockClass.toLowerCase().contains(LIQUID)) {
+ Logger.WARNING(block.toString() + " is a Liquid.");
+ return false;
+ } else if (blockClass.toLowerCase().contains(ORE)) {
+ Logger.WARNING(block.toString() + " is an Ore.");
+ return true;
+ } else if (block.getHarvestLevel(world.getBlockMetadata(xyz[0], xyz[1], xyz[2])) >= miningLevel) {
+ Logger.WARNING(block.toString() + " is minable.");
+ return true;
+ } else if (blockClass.toLowerCase().contains(AIR)) {
+ Logger.WARNING(block.toString() + " is Air.");
+ return false;
+ } else if (blockClass.toLowerCase().contains(BLOCK)) {
+ Logger.WARNING(block.toString() + " is a block of some kind.");
+ return false;
+ } else {
+ Logger.WARNING(block.toString() + " is mystery.");
+ return false;
+ }
+ } catch (final NullPointerException e) {
+ return false;
+ }
+ }
+
+ public static int mMoonID = -99;
+ public static int mMarsID = -99;
+ public static int mCometsID = -99;
- public static Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld){
- String correctTool = "";
- if (!currentWorld.isRemote){
- try {
- correctTool = currentBlock.getHarvestTool(0);
- //Utils.LOG_WARNING(correctTool);
- if (correctTool.equals("pickaxe")){
- return true;}
- } catch (final NullPointerException e){
- return false;}
- }
- return false;
- }
+ public static AutoMap<GT_Worldgen_GT_Ore_Layer> getOresForDim(int dim) {
+ if (dim == -1) {
+ return Ores_Nether;
+ } else if (dim == 1) {
+ return Ores_End;
+ } else if (dim == mMoonID) {
+ return Ores_Moon;
+ } else if (dim == mMarsID) {
+ return Ores_Mars;
+ } else if (dim == mCometsID) {
+ return Ores_Comets;
+ } else {
+ return Ores_Overworld;
+ }
+ }
- private static void removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z){
- try {
- final Block block = world.getBlock(X, Y, Z);
- if (canPickaxeBlock(block, world)){
- if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
- block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
- world.setBlockToAir(X, Y, Z);
+ public static void iterateAllOreTypes() {
+ HashMap<String, Integer> M = new HashMap<String, Integer>();
+ String aTextWorldGen = null;
+ if (MiningUtils.findAndMapOreTypesFromGT()) {
+ int mapKey = 0;
+ for (AutoMap<GT_Worldgen_GT_Ore_Layer> g : MiningUtils.mOreMaps) {
+ for (GT_Worldgen_GT_Ore_Layer h : g) {
- }
- else {
- Logger.WARNING("Incorrect Tool for mining this block.");
- }
- }
- } catch (final NullPointerException e){
+ try {
+ aTextWorldGen =
+ (String) ReflectionUtils.getField(GT_Worldgen_GT_Ore_Layer.class, "aTextWorldgen")
+ .get(h);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ aTextWorldGen = h.mWorldGenName;
+ }
- }
- }
+ // if (M.containsKey(h.aTextWorldgen + h.mWorldGenName)) {
+ M.put(aTextWorldGen + h.mWorldGenName, mapKey);
+ Logger.INFO("Found Vein type: " + aTextWorldGen + h.mWorldGenName + " in map with key: " + mapKey);
+ // }
+ }
+ mapKey++;
+ }
+ }
+ }
- public static boolean getBlockType(final Block block, final World world, final int[] xyz, final int miningLevel){
- final String LIQUID = "liquid";
- final String BLOCK = "block";
- final String ORE = "ore";
- final String AIR = "air";
- String blockClass = "";
+ public static AutoMap<GT_Worldgen_GT_Ore_Layer>[] mOreMaps = new AutoMap[7];
+ private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Overworld = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
+ private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Nether = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
+ private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_End = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
+ private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Moon = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
+ private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Mars = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
+ private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Comets = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
+ private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Misc = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
- if (world.isRemote){
- return false;
- }
+ public static boolean findAndMapOreTypesFromGT() {
+ // Gets Moon ID
- if (block == Blocks.end_stone) {
- return true;
- }
- if (block == Blocks.stone) {
- return true;
- }
- if (block == Blocks.sandstone) {
- return true;
- }
- if (block == Blocks.netherrack) {
- return true;
- }
- if (block == Blocks.nether_brick) {
- return true;
- }
- if (block == Blocks.nether_brick_stairs) {
- return true;
- }
- if (block == Blocks.nether_brick_fence) {
- return true;
- }
- if (block == Blocks.glowstone) {
- return true;
- }
+ boolean aEndAsteroids;
+ try {
+ if (ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore") != null
+ && mMoonID == -99) {
+ mMoonID = ReflectionUtils.getField(
+ ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore"),
+ "idDimensionMoon")
+ .getInt(null);
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ // Gets Mars ID
+ try {
+ if (ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars") != null
+ && mMarsID == -99) {
+ mMarsID = ReflectionUtils.getField(
+ ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars"),
+ "dimensionIDMars")
+ .getInt(null);
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ // Get Comets ID
+ try {
+ if (ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids")
+ != null
+ && mCometsID == -99) {
+ mCometsID = ReflectionUtils.getField(
+ ReflectionUtils.getClass(
+ "micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids"),
+ "dimensionIDAsteroids")
+ .getInt(null);
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
- try {
- blockClass = block.getClass().toString().toLowerCase();
- Logger.WARNING(blockClass);
- if (blockClass.toLowerCase().contains(LIQUID)){
- Logger.WARNING(block.toString()+" is a Liquid.");
- return false;
- }
- else if (blockClass.toLowerCase().contains(ORE)){
- Logger.WARNING(block.toString()+" is an Ore.");
- return true;
- }
- else if (block.getHarvestLevel(world.getBlockMetadata(xyz[0], xyz[1], xyz[2])) >= miningLevel){
- Logger.WARNING(block.toString()+" is minable.");
- return true;
- }
- else if (blockClass.toLowerCase().contains(AIR)){
- Logger.WARNING(block.toString()+" is Air.");
- return false;
- }
- else if (blockClass.toLowerCase().contains(BLOCK)){
- Logger.WARNING(block.toString()+" is a block of some kind.");
- return false;
- }
- else {
- Logger.WARNING(block.toString()+" is mystery.");
- return false;
- }
- }
- catch(final NullPointerException e){
- return false;
- }
- }
+ // Clear Cache
+ Ores_Overworld.clear();
+ Ores_Nether.clear();
+ Ores_End.clear();
+ Ores_Misc.clear();
- public static int mMoonID =-99;
- public static int mMarsID = -99;
- public static int mCometsID = -99;
- public static AutoMap<GT_Worldgen_GT_Ore_Layer> getOresForDim(int dim) {
- if (dim == -1) {
- return Ores_Nether;
- }
- else if (dim == 1) {
- return Ores_End;
- }
- else if (dim == mMoonID) {
- return Ores_Moon;
- }
- else if (dim == mMarsID) {
- return Ores_Mars;
- }
- else if (dim == mCometsID) {
- return Ores_Comets;
- }
- else {
- return Ores_Overworld;
- }
-
- }
-
- public static void iterateAllOreTypes() {
- HashMap<String, Integer> M = new HashMap<String, Integer>();
- String aTextWorldGen = null;
- if (MiningUtils.findAndMapOreTypesFromGT()) {
- int mapKey = 0;
- for (AutoMap<GT_Worldgen_GT_Ore_Layer> g : MiningUtils.mOreMaps) {
- for (GT_Worldgen_GT_Ore_Layer h : g) {
-
- try {
- aTextWorldGen = (String) ReflectionUtils.getField(GT_Worldgen_GT_Ore_Layer.class, "aTextWorldgen").get(h);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- aTextWorldGen = h.mWorldGenName;
- }
-
- //if (M.containsKey(h.aTextWorldgen + h.mWorldGenName)) {
- M.put(aTextWorldGen + h.mWorldGenName, mapKey);
- Logger.INFO("Found Vein type: " + aTextWorldGen + h.mWorldGenName + " in map with key: "+mapKey);
- //}
- }
- mapKey++;
- }
- }
- }
-
- public static AutoMap<GT_Worldgen_GT_Ore_Layer>[] mOreMaps = new AutoMap[7];
- private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Overworld = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
- private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Nether = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
- private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_End = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
- private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Moon = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
- private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Mars = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
- private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Comets = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
- private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Misc = new AutoMap<GT_Worldgen_GT_Ore_Layer>();
-
- public static boolean findAndMapOreTypesFromGT() {
- //Gets Moon ID
-
- boolean aEndAsteroids;
- try {
- if (ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore") != null && mMoonID == -99) {
- mMoonID = ReflectionUtils.getField(ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore"), "idDimensionMoon").getInt(null);
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {}
-
- //Gets Mars ID
- try {
- if (ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars") != null && mMarsID == -99) {
- mMarsID = ReflectionUtils.getField(ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars"), "dimensionIDMars").getInt(null);
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {}
-
- //Get Comets ID
- try {
- if (ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids") != null && mCometsID == -99) {
- mCometsID = ReflectionUtils.getField(ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids"), "dimensionIDAsteroids").getInt(null);
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {}
+ for (GT_Worldgen_GT_Ore_Layer x : GT_Worldgen_GT_Ore_Layer.sList) {
+ if (x.mEnabled) {
- //Clear Cache
- Ores_Overworld.clear();
- Ores_Nether.clear();
- Ores_End.clear();
- Ores_Misc.clear();
-
- for (GT_Worldgen_GT_Ore_Layer x : GT_Worldgen_GT_Ore_Layer.sList) {
- if (x.mEnabled) {
-
+ try {
+ aEndAsteroids = ReflectionUtils.getField(GT_Worldgen_GT_Ore_Layer.class, "mEndAsteroid")
+ .getBoolean(x);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ aEndAsteroids = false;
+ }
- try {
- aEndAsteroids = ReflectionUtils.getField(GT_Worldgen_GT_Ore_Layer.class, "mEndAsteroid").getBoolean(x);
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
- aEndAsteroids = false;
- }
-
- if (x.mOverworld) {
- Ores_Overworld.put(x);
- }
- if (x.mNether) {
- Ores_Nether.put(x);
- }
- if (x.mEnd || aEndAsteroids) {
- Ores_End.put(x);
- }
- if (x.mOverworld || x.mNether || (x.mEnd || aEndAsteroids)) {
- continue;
- }
- /*if (x.mMoon) {
- Ores_Moon.put(x);
- continue;
- }
- if (x.mMars) {
- Ores_Mars.put(x);
- continue;
- }
- if (x.mAsteroid) {
- Ores_Comets.put(x);
- continue;
- }*/
- Ores_Misc.put(x);
- continue;
- }
- else {
- Ores_Comets.put(x);
- }
- }
-
-
- mOreMaps[0] = Ores_Overworld;
- mOreMaps[1] = Ores_Nether;
- mOreMaps[2] = Ores_End;
- mOreMaps[3] = Ores_Moon;
- mOreMaps[4] = Ores_Mars;
- mOreMaps[5] = Ores_Comets;
- mOreMaps[6] = Ores_Misc;
- return true;
- }
+ if (x.mOverworld) {
+ Ores_Overworld.put(x);
+ }
+ if (x.mNether) {
+ Ores_Nether.put(x);
+ }
+ if (x.mEnd || aEndAsteroids) {
+ Ores_End.put(x);
+ }
+ if (x.mOverworld || x.mNether || (x.mEnd || aEndAsteroids)) {
+ continue;
+ }
+ /*if (x.mMoon) {
+ Ores_Moon.put(x);
+ continue;
+ }
+ if (x.mMars) {
+ Ores_Mars.put(x);
+ continue;
+ }
+ if (x.mAsteroid) {
+ Ores_Comets.put(x);
+ continue;
+ }*/
+ Ores_Misc.put(x);
+ continue;
+ } else {
+ Ores_Comets.put(x);
+ }
+ }
+ mOreMaps[0] = Ores_Overworld;
+ mOreMaps[1] = Ores_Nether;
+ mOreMaps[2] = Ores_End;
+ mOreMaps[3] = Ores_Moon;
+ mOreMaps[4] = Ores_Mars;
+ mOreMaps[5] = Ores_Comets;
+ mOreMaps[6] = Ores_Misc;
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ModularArmourUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ModularArmourUtils.java
index e3ffb5c410..c4eb8cff64 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/ModularArmourUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/ModularArmourUtils.java
@@ -1,161 +1,162 @@
package gtPlusPlus.core.util.minecraft;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-import gregtech.api.util.GT_Utility;
-
import baubles.api.BaubleType;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
public class ModularArmourUtils {
- public static ItemStack addComponent(ItemStack tArmour, ItemStack[] tComponents) {
- if (tArmour != null) {
- ItemStack rArmour = NBTUtils.writeItemsToGtCraftingComponents(tArmour, tComponents, true);
- if (rArmour != null) {
-
- }
- }
- return null;
- }
-
- public static enum Modifiers {
- BOOST_HP("skill.hpboost"), BOOST_DEF("skill.defenceboost"), BOOST_SPEED("skill.speedboost"), BOOST_MINING(
- "skill.miningboost"), BOOST_DAMAGE("skill.damageboost"), BOOST_HOLY("skill.holyboost");
- private String MODIFIER_NAME;
-
- private Modifiers(final String mModifier) {
- this.MODIFIER_NAME = mModifier;
- }
-
- public String getModifier() {
- return this.MODIFIER_NAME;
- }
-
- public boolean isValidLevel(int i) {
- if (i >= 0 && i <= 100) {
- return true;
- }
- return false;
- }
- }
-
- public static enum BT {
- TYPE_AMULET(BaubleType.AMULET, 0), TYPE_RING(BaubleType.RING, 1), TYPE_BELT(BaubleType.BELT, 2);
- private final BaubleType mType;
- private final int mID;
- private final String mBaubleType;
-
- private BT(final BaubleType tType, int tID) {
- this.mType = tType;
- this.mID = tID;
- this.mBaubleType = tType.name().toLowerCase();
- }
-
- public BaubleType getType() {
- return this.mType;
- }
-
- public BT getThis() {
- return this;
- }
-
- public BaubleType getBaubleByID(int tID) {
- if (tID == 0) {
- return BaubleType.AMULET;
- } else if (tID == 1) {
- return BaubleType.RING;
- } else if (tID == 2) {
- return BaubleType.BELT;
- } else {
- return BaubleType.RING;
- }
- }
-
- public int getID() {
- return this.mID;
- }
-
- public String getTypeAsString() {
- return this.mBaubleType;
- }
- }
-
- public static void setModifierLevel(ItemStack aStack, Pair<Modifiers, Integer> mPair) {
- setModifierLevel(aStack, mPair.getKey(), mPair.getValue().intValue());
- }
-
- public static void setModifierLevel(ItemStack aStack, Modifiers aMod, Integer aInt) {
- setModifierLevel(aStack, aMod, aInt.intValue());
- }
-
- public static void setModifierLevel(ItemStack aStack, Modifiers aMod, int aInt) {
-
- int mCurrentLevel = getModifierLevel(aStack, aMod);
- int mNewTotalLevel = mCurrentLevel + aInt;
-
- NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
- if (aMod.isValidLevel(mNewTotalLevel)) {
- tNBT.setInteger(aMod.getModifier(), mNewTotalLevel);
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- } else {
- if (getModifierLevel(aStack, aMod) > 100) {
- setModifierLevel(aStack, aMod, 100);
- }
- }
- }
-
- public static int getModifierLevel(ItemStack aStack, Pair<Modifiers, Integer> newPair) {
- return getModifierLevel(aStack, newPair.getKey());
- }
-
- public static int getModifierLevel(ItemStack aStack, Modifiers aMod) {
- NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
- return tNBT.getInteger(aMod.getModifier());
- }
-
- public static void setBaubleType(ItemStack aStack, BT aMod) {
- Logger.INFO("Changing bauble type.");
- NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
- if (aMod != null) {
- tNBT.setInteger("mBaubleType", aMod.getID());
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- }
- }
-
- public static int getBaubleTypeID(ItemStack aStack) {
- NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
- return tNBT.getInteger("mBaubleType");
- }
-
- public static BaubleType getBaubleType(ItemStack aStack) {
- NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
- return getBaubleByID(tNBT.getInteger("mBaubleType"));
- }
-
- public static BaubleType getBaubleByID(int tID) {
- if (tID == 0) {
- return BaubleType.AMULET;
- } else if (tID == 1) {
- return BaubleType.RING;
- } else if (tID == 2) {
- return BaubleType.BELT;
- } else {
- return BaubleType.RING;
- }
- }
-
- public static ItemStack setDefaultStats(ItemStack aStack) {
- ItemStack tempStack = aStack;
- setModifierLevel(tempStack, Modifiers.BOOST_DAMAGE, 0);
- setModifierLevel(tempStack, Modifiers.BOOST_DEF, 0);
- setModifierLevel(tempStack, Modifiers.BOOST_HOLY, 0);
- setModifierLevel(tempStack, Modifiers.BOOST_HP, 0);
- setModifierLevel(tempStack, Modifiers.BOOST_MINING, 0);
- setModifierLevel(tempStack, Modifiers.BOOST_SPEED, 0);
- return tempStack;
- }
-
+ public static ItemStack addComponent(ItemStack tArmour, ItemStack[] tComponents) {
+ if (tArmour != null) {
+ ItemStack rArmour = NBTUtils.writeItemsToGtCraftingComponents(tArmour, tComponents, true);
+ if (rArmour != null) {}
+ }
+ return null;
+ }
+
+ public static enum Modifiers {
+ BOOST_HP("skill.hpboost"),
+ BOOST_DEF("skill.defenceboost"),
+ BOOST_SPEED("skill.speedboost"),
+ BOOST_MINING("skill.miningboost"),
+ BOOST_DAMAGE("skill.damageboost"),
+ BOOST_HOLY("skill.holyboost");
+ private String MODIFIER_NAME;
+
+ private Modifiers(final String mModifier) {
+ this.MODIFIER_NAME = mModifier;
+ }
+
+ public String getModifier() {
+ return this.MODIFIER_NAME;
+ }
+
+ public boolean isValidLevel(int i) {
+ if (i >= 0 && i <= 100) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public static enum BT {
+ TYPE_AMULET(BaubleType.AMULET, 0),
+ TYPE_RING(BaubleType.RING, 1),
+ TYPE_BELT(BaubleType.BELT, 2);
+ private final BaubleType mType;
+ private final int mID;
+ private final String mBaubleType;
+
+ private BT(final BaubleType tType, int tID) {
+ this.mType = tType;
+ this.mID = tID;
+ this.mBaubleType = tType.name().toLowerCase();
+ }
+
+ public BaubleType getType() {
+ return this.mType;
+ }
+
+ public BT getThis() {
+ return this;
+ }
+
+ public BaubleType getBaubleByID(int tID) {
+ if (tID == 0) {
+ return BaubleType.AMULET;
+ } else if (tID == 1) {
+ return BaubleType.RING;
+ } else if (tID == 2) {
+ return BaubleType.BELT;
+ } else {
+ return BaubleType.RING;
+ }
+ }
+
+ public int getID() {
+ return this.mID;
+ }
+
+ public String getTypeAsString() {
+ return this.mBaubleType;
+ }
+ }
+
+ public static void setModifierLevel(ItemStack aStack, Pair<Modifiers, Integer> mPair) {
+ setModifierLevel(aStack, mPair.getKey(), mPair.getValue().intValue());
+ }
+
+ public static void setModifierLevel(ItemStack aStack, Modifiers aMod, Integer aInt) {
+ setModifierLevel(aStack, aMod, aInt.intValue());
+ }
+
+ public static void setModifierLevel(ItemStack aStack, Modifiers aMod, int aInt) {
+
+ int mCurrentLevel = getModifierLevel(aStack, aMod);
+ int mNewTotalLevel = mCurrentLevel + aInt;
+
+ NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
+ if (aMod.isValidLevel(mNewTotalLevel)) {
+ tNBT.setInteger(aMod.getModifier(), mNewTotalLevel);
+ GT_Utility.ItemNBT.setNBT(aStack, tNBT);
+ } else {
+ if (getModifierLevel(aStack, aMod) > 100) {
+ setModifierLevel(aStack, aMod, 100);
+ }
+ }
+ }
+
+ public static int getModifierLevel(ItemStack aStack, Pair<Modifiers, Integer> newPair) {
+ return getModifierLevel(aStack, newPair.getKey());
+ }
+
+ public static int getModifierLevel(ItemStack aStack, Modifiers aMod) {
+ NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
+ return tNBT.getInteger(aMod.getModifier());
+ }
+
+ public static void setBaubleType(ItemStack aStack, BT aMod) {
+ Logger.INFO("Changing bauble type.");
+ NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
+ if (aMod != null) {
+ tNBT.setInteger("mBaubleType", aMod.getID());
+ GT_Utility.ItemNBT.setNBT(aStack, tNBT);
+ }
+ }
+
+ public static int getBaubleTypeID(ItemStack aStack) {
+ NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
+ return tNBT.getInteger("mBaubleType");
+ }
+
+ public static BaubleType getBaubleType(ItemStack aStack) {
+ NBTTagCompound tNBT = NBTUtils.getNBT(aStack);
+ return getBaubleByID(tNBT.getInteger("mBaubleType"));
+ }
+
+ public static BaubleType getBaubleByID(int tID) {
+ if (tID == 0) {
+ return BaubleType.AMULET;
+ } else if (tID == 1) {
+ return BaubleType.RING;
+ } else if (tID == 2) {
+ return BaubleType.BELT;
+ } else {
+ return BaubleType.RING;
+ }
+ }
+
+ public static ItemStack setDefaultStats(ItemStack aStack) {
+ ItemStack tempStack = aStack;
+ setModifierLevel(tempStack, Modifiers.BOOST_DAMAGE, 0);
+ setModifierLevel(tempStack, Modifiers.BOOST_DEF, 0);
+ setModifierLevel(tempStack, Modifiers.BOOST_HOLY, 0);
+ setModifierLevel(tempStack, Modifiers.BOOST_HP, 0);
+ setModifierLevel(tempStack, Modifiers.BOOST_MINING, 0);
+ setModifierLevel(tempStack, Modifiers.BOOST_SPEED, 0);
+ return tempStack;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java
index 7ed4d887cc..c235cd0e0b 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/NBTUtils.java
@@ -2,579 +2,575 @@ package gtPlusPlus.core.util.minecraft;
import static gtPlusPlus.core.item.ModItems.ZZZ_Empty;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.util.HashMap;
import java.util.Map;
-
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-
public class NBTUtils {
- public static NBTTagCompound getNBT(ItemStack aStack) {
- NBTTagCompound rNBT = aStack.getTagCompound();
- return ((rNBT == null) ? new NBTTagCompound() : rNBT);
- }
-
- public static void setBookTitle(ItemStack aStack, String aTitle) {
- NBTTagCompound tNBT = getNBT(aStack);
- tNBT.setString("title", aTitle);
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- }
-
- public static String getBookTitle(ItemStack aStack) {
- NBTTagCompound tNBT = getNBT(aStack);
- return tNBT.getString("title");
- }
-
- public static ItemStack[] readItemsFromNBT(ItemStack itemstack) {
- NBTTagCompound tNBT = getNBT(itemstack);
- final NBTTagList list = tNBT.getTagList("Items", 10);
- ItemStack inventory[] = new ItemStack[list.tagCount()];
- for (int i = 0; i < list.tagCount(); i++) {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if ((slot >= 0) && (slot < list.tagCount())) {
- if (ItemStack.loadItemStackFromNBT(data) == ItemUtils.getSimpleStack(ZZZ_Empty)) {
- inventory[slot] = null;
- } else {
- inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
-
- }
- }
- return inventory;
- }
-
- public static ItemStack[] readItemsFromNBT(ItemStack itemstack, String customkey) {
- NBTTagCompound tNBT = getNBT(itemstack);
- final NBTTagList list = tNBT.getTagList(customkey, 10);
- ItemStack inventory[] = new ItemStack[list.tagCount()];
- for (int i = 0; i < list.tagCount(); i++) {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if ((slot >= 0) && (slot < list.tagCount())) {
- if (ItemStack.loadItemStackFromNBT(data) == ItemUtils.getSimpleStack(ZZZ_Empty)) {
- inventory[slot] = null;
- } else {
- inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
-
- }
- }
- return inventory;
- }
-
- public static ItemStack writeItemsToNBT(ItemStack itemstack, ItemStack[] stored) {
- NBTTagCompound tNBT = getNBT(itemstack);
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < stored.length; i++) {
- final ItemStack stack = stored[i];
- if (stack != null) {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- } else {
- final NBTTagCompound data = new NBTTagCompound();
- ItemStack nullstack = ItemUtils.getSimpleStack(ZZZ_Empty);
- nullstack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- tNBT.setTag("Items", list);
- itemstack.setTagCompound(tNBT);
- return itemstack;
- }
-
- public static ItemStack writeItemsToNBT(ItemStack itemstack, ItemStack[] stored, String customkey) {
- NBTTagCompound tNBT = getNBT(itemstack);
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < stored.length; i++) {
- final ItemStack stack = stored[i];
- if (stack != null) {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- tNBT.setTag(customkey, list);
- itemstack.setTagCompound(tNBT);
- return itemstack;
- }
-
- public static ItemStack writeItemsToGtCraftingComponents(ItemStack rStack, ItemStack[] input, boolean copyTags) {
- try {
- ItemStack stored[] = new ItemStack[9];
- if (input.length != 9) {
- for (int e=0;e<input.length;e++) {
- if (input[e] != null)
- stored[e] = input[e];
- }
- }
-
- if (copyTags) {
- for (int i = 0; i < stored.length; i++) {
- if (stored[i] != null && stored[i].hasTagCompound()) {
- rStack.setTagCompound((NBTTagCompound) stored[i].getTagCompound().copy());
- break;
- }
- }
- }
-
- NBTTagCompound rNBT = rStack.getTagCompound(), tNBT = new NBTTagCompound();
- if (rNBT == null)
- rNBT = new NBTTagCompound();
- for (int i = 0; i < 9; i++) {
- ItemStack tStack = stored[i];
- if (tStack != null && GT_Utility.getContainerItem(tStack, true) == null
- && !(tStack.getItem() instanceof GT_MetaGenerated_Tool)) {
- tStack = GT_Utility.copyAmount(1, tStack);
- if (GT_Utility.isStackValid(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);
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- return rStack;
- }
-
- public static void setBoolean(ItemStack aStack, String aTag, boolean aBoolean) {
- NBTTagCompound tNBT = getNBT(aStack);
- tNBT.setBoolean(aTag, aBoolean);
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- }
-
- public static boolean getBoolean(ItemStack aStack, String aTag) {
- NBTTagCompound tNBT = getNBT(aStack);
- return tNBT.getBoolean(aTag);
- }
-
- public static void setInteger(ItemStack aStack, String aTag, int aInt) {
- NBTTagCompound tNBT = getNBT(aStack);
- tNBT.setInteger(aTag, aInt);
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- }
-
- public static int getInteger(ItemStack aStack, String aTag) {
- NBTTagCompound tNBT = getNBT(aStack);
- return tNBT.getInteger(aTag);
- }
-
- public static void setLong(ItemStack aStack, String aTag, long aInt) {
- NBTTagCompound tNBT = getNBT(aStack);
- tNBT.setLong(aTag, aInt);
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- }
-
- public static long getLong(ItemStack aStack, String aTag) {
- NBTTagCompound tNBT = getNBT(aStack);
- return tNBT.getLong(aTag);
- }
-
- public static void setFloat(ItemStack aStack, String aTag, float aInt) {
- NBTTagCompound tNBT = getNBT(aStack);
- tNBT.setFloat(aTag, aInt);
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- }
-
- public static float getFloat(ItemStack aStack, String aTag) {
- NBTTagCompound tNBT = getNBT(aStack);
- return tNBT.getFloat(aTag);
- }
-
- public static void setString(ItemStack aStack, String aTag, String aString) {
- NBTTagCompound tNBT = getNBT(aStack);
- tNBT.setString(aTag, aString);
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- }
-
- public static String getString(ItemStack aStack, String aTag) {
- NBTTagCompound tNBT = getNBT(aStack);
- return tNBT.getString(aTag);
- }
-
- public static boolean doesStringExist(ItemStack aStack, String aTag) {
- NBTTagCompound tNBT = getNBT(aStack);
- return tNBT.hasKey(aTag);
- }
-
- public static boolean tryIterateNBTData(ItemStack aStack) {
- try {
- NBTTagCompound aNBT = NBTUtils.getNBT(aStack);
- if (aNBT != null) {
- if (!aNBT.hasNoTags()) {
- Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
- if (mInternalMap != null) {
- for (Map.Entry<?, ?> e : mInternalMap.entrySet()) {
- Logger.INFO("Key: " + e.getKey().toString() + " | Value: " + e.getValue());
- }
- return true;
- } else {
- Logger.INFO("Data map reflected from NBTTagCompound was not valid.");
- return false;
- }
- }
- }
- } catch (Throwable t) {}
- return false;
- }
-
- // Botania soulbind handling
- public static boolean setBotanicaSoulboundOwner(ItemStack aStack, String aName) {
- final String TAG_SOULBIND = "soulbind";
- NBTTagCompound tNBT = getNBT(aStack);
- tNBT.setString(TAG_SOULBIND, aName);
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- if (NBTUtils.doesStringExist(aStack, TAG_SOULBIND)) {
- return true;
- } else {
- return false;
- }
- }
-
- public static String getBotanicaSoulboundOwner(ItemStack aStack) {
- final String TAG_SOULBIND = "soulbind";
- NBTTagCompound tNBT = getNBT(aStack);
- return tNBT.getString(TAG_SOULBIND);
- }
-
- public static boolean hasKey(ItemStack stack, String key) {
- final NBTTagCompound itemData = getNBT(stack);
- if (itemData.hasKey(key)) {
- return true;
- }
- return false;
- }
-
- public static boolean createIntegerTagCompound(ItemStack rStack, String tagName, String keyName, int keyValue) {
- final NBTTagCompound tagMain = getNBT(rStack);
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setInteger(keyName, keyValue);
- tagMain.setTag(tagName, tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static boolean createLongTagCompound(ItemStack rStack, String tagName, String keyName, long keyValue) {
- final NBTTagCompound tagMain = getNBT(rStack);
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong(keyName, keyValue);
- tagMain.setTag(tagName, tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static boolean createStringTagCompound(ItemStack rStack, String tagName, String keyName, String keyValue) {
- final NBTTagCompound tagMain = getNBT(rStack);
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setString(keyName, keyValue);
- tagMain.setTag(tagName, tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static boolean createFloatTagCompound(ItemStack rStack, String tagName, String keyName, float keyValue) {
- final NBTTagCompound tagMain = getNBT(rStack);
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setFloat(keyName, keyValue);
- tagMain.setTag(tagName, tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static boolean createDoubleTagCompound(ItemStack rStack, String tagName, String keyName, double keyValue) {
- final NBTTagCompound tagMain = getNBT(rStack);
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setDouble(keyName, keyValue);
- tagMain.setTag(tagName, tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static boolean createBooleanTagCompound(ItemStack rStack, String tagName, String keyName, boolean keyValue) {
- final NBTTagCompound tagMain = getNBT(rStack);
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setBoolean(keyName, keyValue);
- tagMain.setTag(tagName, tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static boolean createTagCompound(ItemStack rStack, String tagName, NBTTagCompound keyValue) {
- final NBTTagCompound tagMain = getNBT(rStack);
- NBTTagCompound tagNBT = keyValue;
- tagMain.setTag(tagName, tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static int getIntegerTagCompound(ItemStack aStack, String tagName, String keyName) {
- NBTTagCompound aNBT = getNBT(aStack);
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag(tagName);
- if (aNBT != null) {
- return aNBT.getInteger(keyName);
- }
- }
- return 0;
- }
-
- public static long getLongTagCompound(ItemStack aStack, String tagName, String keyName) {
- NBTTagCompound aNBT = getNBT(aStack);
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag(tagName);
- if (aNBT != null) {
- return aNBT.getLong(keyName);
- }
- }
- return 0L;
- }
-
- public static String getStringTagCompound(ItemStack aStack, String tagName, String keyName) {
- NBTTagCompound aNBT = getNBT(aStack);
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag(tagName);
- if (aNBT != null) {
- return aNBT.getString(keyName);
- }
- }
- return null;
- }
-
- public static float getFloatTagCompound(ItemStack aStack, String tagName, String keyName) {
- NBTTagCompound aNBT = getNBT(aStack);
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag(tagName);
- if (aNBT != null) {
- return aNBT.getFloat(keyName);
- }
- }
- return 0;
- }
-
- public static double getDoubleTagCompound(ItemStack aStack, String tagName, String keyName) {
- NBTTagCompound aNBT = getNBT(aStack);
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag(tagName);
- if (aNBT != null) {
- return aNBT.getDouble(keyName);
- }
- }
- return 0;
- }
-
- public static boolean getBooleanTagCompound(ItemStack aStack, String tagName, String keyName) {
- NBTTagCompound aNBT = getNBT(aStack);
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag(tagName);
- if (aNBT != null) {
- return aNBT.getBoolean(keyName);
- }
- }
- return false;
- }
-
- public static NBTTagCompound getTagCompound(ItemStack aStack, String tagName) {
- NBTTagCompound aNBT = getNBT(aStack);
- if (aNBT != null && hasKey(aStack, tagName)) {
- aNBT = aNBT.getCompoundTag(tagName);
- if (aNBT != null) {
- return aNBT;
- }
- }
- return null;
- }
-
- public static boolean hasKeyInTagCompound(ItemStack stack, String tag, String key) {
- NBTTagCompound aNBT = stack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag(tag);
- if (aNBT.hasKey(key)) {
- return true;
- }
- }
- return false;
- }
-
- public static Map getTagMap(NBTTagCompound aNBT) {
- Map tagMap = new HashMap();
- if (!aNBT.hasNoTags()) {
- Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
- if (mInternalMap != null && !mInternalMap.isEmpty()) {
- tagMap.putAll(mInternalMap);
- }
- }
- return tagMap;
- }
-
- public static boolean isTagString(NBTTagCompound aNBT, String aTagName) {
- Map<?, ?> aTagMap = getTagMap(aNBT);
- if (aTagMap != null && !aTagMap.isEmpty()) {
- for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
- if (e.getKey().equals(aTagName)) {
- Object aValue = e.getValue();
- if (aValue instanceof String) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static boolean isTagInteger(NBTTagCompound aNBT, String aTagName) {
- Map<?, ?> aTagMap = getTagMap(aNBT);
- if (aTagMap != null && !aTagMap.isEmpty()) {
- for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
- if (e.getKey().equals(aTagName)) {
- Object aValue = e.getValue();
- if (int.class.isInstance(aValue) || aValue instanceof Integer) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static boolean isTagLong(NBTTagCompound aNBT, String aTagName) {
- Map<?, ?> aTagMap = getTagMap(aNBT);
- if (aTagMap != null && !aTagMap.isEmpty()) {
- for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
- if (e.getKey().equals(aTagName)) {
- Object aValue = e.getValue();
- if (long.class.isInstance(aValue) || aValue instanceof Long) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static boolean isTagFloat(NBTTagCompound aNBT, String aTagName) {
- Map<?, ?> aTagMap = getTagMap(aNBT);
- if (aTagMap != null && !aTagMap.isEmpty()) {
- for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
- if (e.getKey().equals(aTagName)) {
- Object aValue = e.getValue();
- if (float.class.isInstance(aValue) || aValue instanceof Float) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static boolean isTagDouble(NBTTagCompound aNBT, String aTagName) {
- Map<?, ?> aTagMap = getTagMap(aNBT);
- if (aTagMap != null && !aTagMap.isEmpty()) {
- for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
- if (e.getKey().equals(aTagName)) {
- Object aValue = e.getValue();
- if (double.class.isInstance(aValue) || aValue instanceof Double) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static boolean isTagBoolean(NBTTagCompound aNBT, String aTagName) {
- Map<?, ?> aTagMap = getTagMap(aNBT);
- if (aTagMap != null && !aTagMap.isEmpty()) {
- for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
- if (e.getKey().equals(aTagName)) {
- Object aValue = e.getValue();
- if (boolean.class.isInstance(aValue) || aValue instanceof Boolean) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static boolean tryCloneTagCompoundDataIntoSubTag(ItemStack aStack, NBTTagCompound aTagCompound) {
- try {
- NBTTagCompound aNBT = aTagCompound;
- if (aNBT != null) {
- if (!aNBT.hasNoTags()) {
- Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
- if (mInternalMap != null) {
- for (Map.Entry<?, ?> e : mInternalMap.entrySet()) {
- Logger.INFO("Key: " + e.getKey().toString() + " | Value: " + e.getValue().toString());
- if (e.getValue().getClass() == String.class){
- createStringTagCompound(aStack, "mEntityTag", (String) e.getKey(), (String) e.getValue());
- }
- else if (e.getValue().getClass() == Boolean.class || e.getValue().getClass() == boolean.class){
- createBooleanTagCompound(aStack, "mEntityTag", (String) e.getKey(), (Boolean) e.getValue());
- }
- else if (e.getValue().getClass() == Integer.class || e.getValue().getClass() == int.class){
- createIntegerTagCompound(aStack, "mEntityTag", (String) e.getKey(), (Integer) e.getValue());
- }
- else if (e.getValue().getClass() == Double.class || e.getValue().getClass() == double.class){
- createDoubleTagCompound(aStack, "mEntityTag", (String) e.getKey(), (Double) e.getValue());
- }
- else if (e.getValue().getClass() == Long.class || e.getValue().getClass() == long.class){
- createLongTagCompound(aStack, "mEntityTag", (String) e.getKey(), (Long) e.getValue());
- }
- else if (e.getValue().getClass() == Float.class || e.getValue().getClass() == float.class){
- createFloatTagCompound(aStack, "mEntityTag", (String) e.getKey(), (Float) e.getValue());
- }
- else {
-
-
- }
-
- }
- return true;
- }
- }
- }
- return false;
- } catch (Throwable t) {
- return false;
- }
- }
-
- public static NBTTagCompound getEntityCustomData(Entity aEntity){
- return ReflectionUtils.getField(aEntity, "customEntityData");
- }
-
- public static boolean setEntityCustomData(Entity aEntity, NBTTagCompound aTag){
- return ReflectionUtils.setField(aEntity, "customEntityData", aTag);
- }
-
- public static boolean hasTagCompound(ItemStack aStack) {
- return aStack.hasTagCompound();
- }
-
- public static void createEmptyTagCompound(ItemStack aStack) {
- if (!hasTagCompound(aStack)) {
- NBTTagCompound aTag = new NBTTagCompound();
- aStack.setTagCompound(aTag);
- }
- }
-
+ public static NBTTagCompound getNBT(ItemStack aStack) {
+ NBTTagCompound rNBT = aStack.getTagCompound();
+ return ((rNBT == null) ? new NBTTagCompound() : rNBT);
+ }
+
+ public static void setBookTitle(ItemStack aStack, String aTitle) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ tNBT.setString("title", aTitle);
+ GT_Utility.ItemNBT.setNBT(aStack, tNBT);
+ }
+
+ public static String getBookTitle(ItemStack aStack) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ return tNBT.getString("title");
+ }
+
+ public static ItemStack[] readItemsFromNBT(ItemStack itemstack) {
+ NBTTagCompound tNBT = getNBT(itemstack);
+ final NBTTagList list = tNBT.getTagList("Items", 10);
+ ItemStack inventory[] = new ItemStack[list.tagCount()];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < list.tagCount())) {
+ if (ItemStack.loadItemStackFromNBT(data) == ItemUtils.getSimpleStack(ZZZ_Empty)) {
+ inventory[slot] = null;
+ } else {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+ return inventory;
+ }
+
+ public static ItemStack[] readItemsFromNBT(ItemStack itemstack, String customkey) {
+ NBTTagCompound tNBT = getNBT(itemstack);
+ final NBTTagList list = tNBT.getTagList(customkey, 10);
+ ItemStack inventory[] = new ItemStack[list.tagCount()];
+ for (int i = 0; i < list.tagCount(); i++) {
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if ((slot >= 0) && (slot < list.tagCount())) {
+ if (ItemStack.loadItemStackFromNBT(data) == ItemUtils.getSimpleStack(ZZZ_Empty)) {
+ inventory[slot] = null;
+ } else {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+ return inventory;
+ }
+
+ public static ItemStack writeItemsToNBT(ItemStack itemstack, ItemStack[] stored) {
+ NBTTagCompound tNBT = getNBT(itemstack);
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < stored.length; i++) {
+ final ItemStack stack = stored[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ } else {
+ final NBTTagCompound data = new NBTTagCompound();
+ ItemStack nullstack = ItemUtils.getSimpleStack(ZZZ_Empty);
+ nullstack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ tNBT.setTag("Items", list);
+ itemstack.setTagCompound(tNBT);
+ return itemstack;
+ }
+
+ public static ItemStack writeItemsToNBT(ItemStack itemstack, ItemStack[] stored, String customkey) {
+ NBTTagCompound tNBT = getNBT(itemstack);
+ final NBTTagList list = new NBTTagList();
+ for (int i = 0; i < stored.length; i++) {
+ final ItemStack stack = stored[i];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ tNBT.setTag(customkey, list);
+ itemstack.setTagCompound(tNBT);
+ return itemstack;
+ }
+
+ public static ItemStack writeItemsToGtCraftingComponents(ItemStack rStack, ItemStack[] input, boolean copyTags) {
+ try {
+ ItemStack stored[] = new ItemStack[9];
+ if (input.length != 9) {
+ for (int e = 0; e < input.length; e++) {
+ if (input[e] != null) stored[e] = input[e];
+ }
+ }
+
+ if (copyTags) {
+ for (int i = 0; i < stored.length; i++) {
+ if (stored[i] != null && stored[i].hasTagCompound()) {
+ rStack.setTagCompound(
+ (NBTTagCompound) stored[i].getTagCompound().copy());
+ break;
+ }
+ }
+ }
+
+ NBTTagCompound rNBT = rStack.getTagCompound(), tNBT = new NBTTagCompound();
+ if (rNBT == null) rNBT = new NBTTagCompound();
+ for (int i = 0; i < 9; i++) {
+ ItemStack tStack = stored[i];
+ if (tStack != null
+ && GT_Utility.getContainerItem(tStack, true) == null
+ && !(tStack.getItem() instanceof GT_MetaGenerated_Tool)) {
+ tStack = GT_Utility.copyAmount(1, tStack);
+ if (GT_Utility.isStackValid(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);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ return rStack;
+ }
+
+ public static void setBoolean(ItemStack aStack, String aTag, boolean aBoolean) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ tNBT.setBoolean(aTag, aBoolean);
+ GT_Utility.ItemNBT.setNBT(aStack, tNBT);
+ }
+
+ public static boolean getBoolean(ItemStack aStack, String aTag) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ return tNBT.getBoolean(aTag);
+ }
+
+ public static void setInteger(ItemStack aStack, String aTag, int aInt) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ tNBT.setInteger(aTag, aInt);
+ GT_Utility.ItemNBT.setNBT(aStack, tNBT);
+ }
+
+ public static int getInteger(ItemStack aStack, String aTag) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ return tNBT.getInteger(aTag);
+ }
+
+ public static void setLong(ItemStack aStack, String aTag, long aInt) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ tNBT.setLong(aTag, aInt);
+ GT_Utility.ItemNBT.setNBT(aStack, tNBT);
+ }
+
+ public static long getLong(ItemStack aStack, String aTag) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ return tNBT.getLong(aTag);
+ }
+
+ public static void setFloat(ItemStack aStack, String aTag, float aInt) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ tNBT.setFloat(aTag, aInt);
+ GT_Utility.ItemNBT.setNBT(aStack, tNBT);
+ }
+
+ public static float getFloat(ItemStack aStack, String aTag) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ return tNBT.getFloat(aTag);
+ }
+
+ public static void setString(ItemStack aStack, String aTag, String aString) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ tNBT.setString(aTag, aString);
+ GT_Utility.ItemNBT.setNBT(aStack, tNBT);
+ }
+
+ public static String getString(ItemStack aStack, String aTag) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ return tNBT.getString(aTag);
+ }
+
+ public static boolean doesStringExist(ItemStack aStack, String aTag) {
+ NBTTagCompound tNBT = getNBT(aStack);
+ return tNBT.hasKey(aTag);
+ }
+
+ public static boolean tryIterateNBTData(ItemStack aStack) {
+ try {
+ NBTTagCompound aNBT = NBTUtils.getNBT(aStack);
+ if (aNBT != null) {
+ if (!aNBT.hasNoTags()) {
+ Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
+ if (mInternalMap != null) {
+ for (Map.Entry<?, ?> e : mInternalMap.entrySet()) {
+ Logger.INFO("Key: " + e.getKey().toString() + " | Value: " + e.getValue());
+ }
+ return true;
+ } else {
+ Logger.INFO("Data map reflected from NBTTagCompound was not valid.");
+ return false;
+ }
+ }
+ }
+ } catch (Throwable t) {
+ }
+ return false;
+ }
+
+ // Botania soulbind handling
+ public static boolean setBotanicaSoulboundOwner(ItemStack aStack, String aName) {
+ final String TAG_SOULBIND = "soulbind";
+ NBTTagCompound tNBT = getNBT(aStack);
+ tNBT.setString(TAG_SOULBIND, aName);
+ GT_Utility.ItemNBT.setNBT(aStack, tNBT);
+ if (NBTUtils.doesStringExist(aStack, TAG_SOULBIND)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public static String getBotanicaSoulboundOwner(ItemStack aStack) {
+ final String TAG_SOULBIND = "soulbind";
+ NBTTagCompound tNBT = getNBT(aStack);
+ return tNBT.getString(TAG_SOULBIND);
+ }
+
+ public static boolean hasKey(ItemStack stack, String key) {
+ final NBTTagCompound itemData = getNBT(stack);
+ if (itemData.hasKey(key)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean createIntegerTagCompound(ItemStack rStack, String tagName, String keyName, int keyValue) {
+ final NBTTagCompound tagMain = getNBT(rStack);
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setInteger(keyName, keyValue);
+ tagMain.setTag(tagName, tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static boolean createLongTagCompound(ItemStack rStack, String tagName, String keyName, long keyValue) {
+ final NBTTagCompound tagMain = getNBT(rStack);
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong(keyName, keyValue);
+ tagMain.setTag(tagName, tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static boolean createStringTagCompound(ItemStack rStack, String tagName, String keyName, String keyValue) {
+ final NBTTagCompound tagMain = getNBT(rStack);
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setString(keyName, keyValue);
+ tagMain.setTag(tagName, tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static boolean createFloatTagCompound(ItemStack rStack, String tagName, String keyName, float keyValue) {
+ final NBTTagCompound tagMain = getNBT(rStack);
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setFloat(keyName, keyValue);
+ tagMain.setTag(tagName, tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static boolean createDoubleTagCompound(ItemStack rStack, String tagName, String keyName, double keyValue) {
+ final NBTTagCompound tagMain = getNBT(rStack);
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setDouble(keyName, keyValue);
+ tagMain.setTag(tagName, tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static boolean createBooleanTagCompound(ItemStack rStack, String tagName, String keyName, boolean keyValue) {
+ final NBTTagCompound tagMain = getNBT(rStack);
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setBoolean(keyName, keyValue);
+ tagMain.setTag(tagName, tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static boolean createTagCompound(ItemStack rStack, String tagName, NBTTagCompound keyValue) {
+ final NBTTagCompound tagMain = getNBT(rStack);
+ NBTTagCompound tagNBT = keyValue;
+ tagMain.setTag(tagName, tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static int getIntegerTagCompound(ItemStack aStack, String tagName, String keyName) {
+ NBTTagCompound aNBT = getNBT(aStack);
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag(tagName);
+ if (aNBT != null) {
+ return aNBT.getInteger(keyName);
+ }
+ }
+ return 0;
+ }
+
+ public static long getLongTagCompound(ItemStack aStack, String tagName, String keyName) {
+ NBTTagCompound aNBT = getNBT(aStack);
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag(tagName);
+ if (aNBT != null) {
+ return aNBT.getLong(keyName);
+ }
+ }
+ return 0L;
+ }
+
+ public static String getStringTagCompound(ItemStack aStack, String tagName, String keyName) {
+ NBTTagCompound aNBT = getNBT(aStack);
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag(tagName);
+ if (aNBT != null) {
+ return aNBT.getString(keyName);
+ }
+ }
+ return null;
+ }
+
+ public static float getFloatTagCompound(ItemStack aStack, String tagName, String keyName) {
+ NBTTagCompound aNBT = getNBT(aStack);
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag(tagName);
+ if (aNBT != null) {
+ return aNBT.getFloat(keyName);
+ }
+ }
+ return 0;
+ }
+
+ public static double getDoubleTagCompound(ItemStack aStack, String tagName, String keyName) {
+ NBTTagCompound aNBT = getNBT(aStack);
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag(tagName);
+ if (aNBT != null) {
+ return aNBT.getDouble(keyName);
+ }
+ }
+ return 0;
+ }
+
+ public static boolean getBooleanTagCompound(ItemStack aStack, String tagName, String keyName) {
+ NBTTagCompound aNBT = getNBT(aStack);
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag(tagName);
+ if (aNBT != null) {
+ return aNBT.getBoolean(keyName);
+ }
+ }
+ return false;
+ }
+
+ public static NBTTagCompound getTagCompound(ItemStack aStack, String tagName) {
+ NBTTagCompound aNBT = getNBT(aStack);
+ if (aNBT != null && hasKey(aStack, tagName)) {
+ aNBT = aNBT.getCompoundTag(tagName);
+ if (aNBT != null) {
+ return aNBT;
+ }
+ }
+ return null;
+ }
+
+ public static boolean hasKeyInTagCompound(ItemStack stack, String tag, String key) {
+ NBTTagCompound aNBT = stack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag(tag);
+ if (aNBT.hasKey(key)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static Map getTagMap(NBTTagCompound aNBT) {
+ Map tagMap = new HashMap();
+ if (!aNBT.hasNoTags()) {
+ Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
+ if (mInternalMap != null && !mInternalMap.isEmpty()) {
+ tagMap.putAll(mInternalMap);
+ }
+ }
+ return tagMap;
+ }
+
+ public static boolean isTagString(NBTTagCompound aNBT, String aTagName) {
+ Map<?, ?> aTagMap = getTagMap(aNBT);
+ if (aTagMap != null && !aTagMap.isEmpty()) {
+ for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
+ if (e.getKey().equals(aTagName)) {
+ Object aValue = e.getValue();
+ if (aValue instanceof String) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean isTagInteger(NBTTagCompound aNBT, String aTagName) {
+ Map<?, ?> aTagMap = getTagMap(aNBT);
+ if (aTagMap != null && !aTagMap.isEmpty()) {
+ for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
+ if (e.getKey().equals(aTagName)) {
+ Object aValue = e.getValue();
+ if (int.class.isInstance(aValue) || aValue instanceof Integer) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean isTagLong(NBTTagCompound aNBT, String aTagName) {
+ Map<?, ?> aTagMap = getTagMap(aNBT);
+ if (aTagMap != null && !aTagMap.isEmpty()) {
+ for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
+ if (e.getKey().equals(aTagName)) {
+ Object aValue = e.getValue();
+ if (long.class.isInstance(aValue) || aValue instanceof Long) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean isTagFloat(NBTTagCompound aNBT, String aTagName) {
+ Map<?, ?> aTagMap = getTagMap(aNBT);
+ if (aTagMap != null && !aTagMap.isEmpty()) {
+ for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
+ if (e.getKey().equals(aTagName)) {
+ Object aValue = e.getValue();
+ if (float.class.isInstance(aValue) || aValue instanceof Float) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean isTagDouble(NBTTagCompound aNBT, String aTagName) {
+ Map<?, ?> aTagMap = getTagMap(aNBT);
+ if (aTagMap != null && !aTagMap.isEmpty()) {
+ for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
+ if (e.getKey().equals(aTagName)) {
+ Object aValue = e.getValue();
+ if (double.class.isInstance(aValue) || aValue instanceof Double) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean isTagBoolean(NBTTagCompound aNBT, String aTagName) {
+ Map<?, ?> aTagMap = getTagMap(aNBT);
+ if (aTagMap != null && !aTagMap.isEmpty()) {
+ for (Map.Entry<?, ?> e : aTagMap.entrySet()) {
+ if (e.getKey().equals(aTagName)) {
+ Object aValue = e.getValue();
+ if (boolean.class.isInstance(aValue) || aValue instanceof Boolean) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean tryCloneTagCompoundDataIntoSubTag(ItemStack aStack, NBTTagCompound aTagCompound) {
+ try {
+ NBTTagCompound aNBT = aTagCompound;
+ if (aNBT != null) {
+ if (!aNBT.hasNoTags()) {
+ Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
+ if (mInternalMap != null) {
+ for (Map.Entry<?, ?> e : mInternalMap.entrySet()) {
+ Logger.INFO("Key: " + e.getKey().toString() + " | Value: "
+ + e.getValue().toString());
+ if (e.getValue().getClass() == String.class) {
+ createStringTagCompound(
+ aStack, "mEntityTag", (String) e.getKey(), (String) e.getValue());
+ } else if (e.getValue().getClass() == Boolean.class
+ || e.getValue().getClass() == boolean.class) {
+ createBooleanTagCompound(
+ aStack, "mEntityTag", (String) e.getKey(), (Boolean) e.getValue());
+ } else if (e.getValue().getClass() == Integer.class
+ || e.getValue().getClass() == int.class) {
+ createIntegerTagCompound(
+ aStack, "mEntityTag", (String) e.getKey(), (Integer) e.getValue());
+ } else if (e.getValue().getClass() == Double.class
+ || e.getValue().getClass() == double.class) {
+ createDoubleTagCompound(
+ aStack, "mEntityTag", (String) e.getKey(), (Double) e.getValue());
+ } else if (e.getValue().getClass() == Long.class
+ || e.getValue().getClass() == long.class) {
+ createLongTagCompound(aStack, "mEntityTag", (String) e.getKey(), (Long) e.getValue());
+ } else if (e.getValue().getClass() == Float.class
+ || e.getValue().getClass() == float.class) {
+ createFloatTagCompound(aStack, "mEntityTag", (String) e.getKey(), (Float) e.getValue());
+ } else {
+
+ }
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ public static NBTTagCompound getEntityCustomData(Entity aEntity) {
+ return ReflectionUtils.getField(aEntity, "customEntityData");
+ }
+
+ public static boolean setEntityCustomData(Entity aEntity, NBTTagCompound aTag) {
+ return ReflectionUtils.setField(aEntity, "customEntityData", aTag);
+ }
+
+ public static boolean hasTagCompound(ItemStack aStack) {
+ return aStack.hasTagCompound();
+ }
+
+ public static void createEmptyTagCompound(ItemStack aStack) {
+ if (!hasTagCompound(aStack)) {
+ NBTTagCompound aTag = new NBTTagCompound();
+ aStack.setTagCompound(aTag);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/OreDictUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/OreDictUtils.java
index 324d39b863..359b336889 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/OreDictUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/OreDictUtils.java
@@ -1,25 +1,22 @@
package gtPlusPlus.core.util.minecraft;
import java.util.List;
-
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class OreDictUtils {
- public static boolean containsValidEntries(String aOreName) {
- boolean a = OreDictionary.doesOreNameExist(aOreName);
- List<ItemStack> b = OreDictionary.getOres(aOreName, false);
-
- if (!a) {
- return false;
- }
- else {
- if (b == null || b.isEmpty()) {
- return false;
- }
- }
- return true;
- }
-
+ public static boolean containsValidEntries(String aOreName) {
+ boolean a = OreDictionary.doesOreNameExist(aOreName);
+ List<ItemStack> b = OreDictionary.getOres(aOreName, false);
+
+ if (!a) {
+ return false;
+ } else {
+ if (b == null || b.isEmpty()) {
+ return false;
+ }
+ }
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
index f2be723726..038672c259 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
@@ -1,11 +1,10 @@
package gtPlusPlus.core.util.minecraft;
-import java.util.*;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.*;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -20,246 +19,257 @@ import net.minecraftforge.common.util.FakePlayer;
public class PlayerUtils {
- public static final Map<String, EntityPlayer> mCachedFakePlayers = new WeakHashMap<String, EntityPlayer>();
- private static final Class mThaumcraftFakePlayer;
-
- static {
- if (ReflectionUtils.doesClassExist("thaumcraft.common.lib.FakeThaumcraftPlayer")) {
- mThaumcraftFakePlayer = ReflectionUtils.getClass("thaumcraft.common.lib.FakeThaumcraftPlayer");
- }
- else {
- mThaumcraftFakePlayer = null;
- }
- }
+ public static final Map<String, EntityPlayer> mCachedFakePlayers = new WeakHashMap<String, EntityPlayer>();
+ private static final Class mThaumcraftFakePlayer;
+
+ static {
+ if (ReflectionUtils.doesClassExist("thaumcraft.common.lib.FakeThaumcraftPlayer")) {
+ mThaumcraftFakePlayer = ReflectionUtils.getClass("thaumcraft.common.lib.FakeThaumcraftPlayer");
+ } else {
+ mThaumcraftFakePlayer = null;
+ }
+ }
+
+ public static void messagePlayer(final EntityPlayer P, final String S) {
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, S);
+ }
+
+ public static void messagePlayer(final EntityPlayer P, final IChatComponent S) {
+ P.addChatComponentMessage(S);
+ }
+
+ public static EntityPlayer getPlayer(final String name) {
+ try {
+ final List<EntityPlayer> i = new ArrayList<>();
+ final Iterator<EntityPlayerMP> iterator = MinecraftServer.getServer()
+ .getConfigurationManager()
+ .playerEntityList
+ .iterator();
+ while (iterator.hasNext()) {
+ i.add((iterator.next()));
+ }
+ for (final EntityPlayer temp : i) {
+ if (temp.getDisplayName().toLowerCase().equals(name.toLowerCase())) {
+ return temp;
+ }
+ }
+ } catch (final Throwable e) {
+ }
+ return null;
+ }
+
+ public static EntityPlayer getPlayerOnServerFromUUID(final UUID parUUID) {
+ if (parUUID == null) {
+ return null;
+ }
+ final List<EntityPlayerMP> allPlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
+ for (final EntityPlayerMP player : allPlayers) {
+ if (player.getUniqueID().equals(parUUID)) {
+ return player;
+ }
+ }
+ return null;
+ }
+
+ // Not Clientside
+ public static EntityPlayer getPlayerInWorld(final World world, final String Name) {
+ final List<EntityPlayer> i = world.playerEntities;
+ final Minecraft mc = Minecraft.getMinecraft();
+ try {
+ for (final EntityPlayer temp : i) {
+ if (temp.getDisplayName().toLowerCase().equals(Name.toLowerCase())) {
+ return temp;
+ }
+ }
+ } catch (final NullPointerException e) {
+ }
+ return null;
+ }
+
+ public static boolean isPlayerOP(final EntityPlayer player) {
+ if (player.canCommandSenderUseCommand(2, "")) {
+ return true;
+ }
+ return false;
+ }
- public static void messagePlayer(final EntityPlayer P, final String S){
- gregtech.api.util.GT_Utility.sendChatToPlayer(P, S);
- }
-
- public static void messagePlayer(final EntityPlayer P, final IChatComponent S){
- P.addChatComponentMessage(S);
- }
+ // Not Clientside
+ public static ItemStack getItemStackInPlayersHand(final World world, final String Name) {
+ final EntityPlayer thePlayer = getPlayer(Name);
+ ItemStack heldItem = null;
+ try {
+ heldItem = thePlayer.getHeldItem();
+ } catch (final NullPointerException e) {
+ return null;
+ }
+ if (heldItem != null) {
+ return heldItem;
+ }
+ return null;
+ }
- public static EntityPlayer getPlayer(final String name){
- try{
- final List<EntityPlayer> i = new ArrayList<>();
- final Iterator<EntityPlayerMP> iterator = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator();
- while (iterator.hasNext()) {
- i.add((iterator.next()));
- }
- for (final EntityPlayer temp : i) {
- if (temp.getDisplayName().toLowerCase().equals(name.toLowerCase())){
- return temp;
- }
- }
- }
- catch(final Throwable e){}
- return null;
- }
+ @SideOnly(Side.CLIENT)
+ public static ItemStack getItemStackInPlayersHand() {
+ final Minecraft mc = Minecraft.getMinecraft();
+ ItemStack heldItem = null;
+ try {
+ heldItem = mc.thePlayer.getHeldItem();
+ } catch (final NullPointerException e) {
+ return null;
+ }
+ if (heldItem != null) {
+ return heldItem;
+ }
+ return null;
+ }
- public static EntityPlayer getPlayerOnServerFromUUID(final UUID parUUID){
- if (parUUID == null)
- {
- return null;
- }
- final List<EntityPlayerMP> allPlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
- for (final EntityPlayerMP player : allPlayers)
- {
- if (player.getUniqueID().equals(parUUID))
- {
- return player;
- }
- }
- return null;
- }
+ public static ItemStack getItemStackInPlayersHand(final EntityPlayer player) {
+ ItemStack heldItem = null;
+ try {
+ heldItem = player.getHeldItem();
+ } catch (final NullPointerException e) {
+ e.printStackTrace();
+ return null;
+ }
+ if (heldItem != null) {
+ return heldItem;
+ } else {
+ if (Utils.isClient()) {
+ heldItem = player.getItemInUse();
+ } else {
+ heldItem = player.getCurrentEquippedItem();
+ }
+ }
+ return heldItem;
+ }
- //Not Clientside
- public static EntityPlayer getPlayerInWorld(final World world, final String Name){
- final List<EntityPlayer> i = world.playerEntities;
- final Minecraft mc = Minecraft.getMinecraft();
- try{
- for (final EntityPlayer temp : i) {
- if (temp.getDisplayName().toLowerCase().equals(Name.toLowerCase())){
- return temp;
- }
- }
- }
- catch(final NullPointerException e){}
- return null;
- }
+ @SideOnly(Side.CLIENT)
+ public static Item getItemInPlayersHandClient() {
+ final Minecraft mc = Minecraft.getMinecraft();
+ Item heldItem = null;
- public static boolean isPlayerOP(final EntityPlayer player){
- if (player.canCommandSenderUseCommand(2, "")){
- return true;
- }
- return false;
- }
+ try {
+ heldItem = mc.thePlayer.getHeldItem().getItem();
+ } catch (final NullPointerException e) {
+ return null;
+ }
- //Not Clientside
- public static ItemStack getItemStackInPlayersHand(final World world, final String Name){
- final EntityPlayer thePlayer = getPlayer(Name);
- ItemStack heldItem = null;
- try{heldItem = thePlayer.getHeldItem();
- }catch(final NullPointerException e){return null;}
- if (heldItem != null){
- return heldItem;
- }
- return null;
- }
+ if (heldItem != null) {
+ return heldItem;
+ }
- @SideOnly(Side.CLIENT)
- public static ItemStack getItemStackInPlayersHand(){
- final Minecraft mc = Minecraft.getMinecraft();
- ItemStack heldItem = null;
- try{heldItem = mc.thePlayer.getHeldItem();
- }catch(final NullPointerException e){return null;}
- if (heldItem != null){
- return heldItem;
- }
- return null;
- }
+ return null;
+ }
- public static ItemStack getItemStackInPlayersHand(final EntityPlayer player){
- ItemStack heldItem = null;
- try{
- heldItem = player.getHeldItem();
- }
- catch(final NullPointerException e){
- e.printStackTrace();
- return null;
- }
- if (heldItem != null){
- return heldItem;
- }
- else {
- if (Utils.isClient()) {
- heldItem = player.getItemInUse();
- }
- else {
- heldItem = player.getCurrentEquippedItem();
- }
- }
- return heldItem;
- }
+ public static Item getItemInPlayersHand(final EntityPlayer player) {
+ Item heldItem = null;
+ try {
+ heldItem = player.getHeldItem().getItem();
+ } catch (final NullPointerException e) {
+ return null;
+ }
- @SideOnly(Side.CLIENT)
- public static Item getItemInPlayersHandClient(){
- final Minecraft mc = Minecraft.getMinecraft();
- Item heldItem = null;
+ if (heldItem != null) {
+ return heldItem;
+ }
+ return null;
+ }
- try{heldItem = mc.thePlayer.getHeldItem().getItem();
- }catch(final NullPointerException e){return null;}
+ public static final EntityPlayer getPlayerEntityByName(final String aPlayerName) {
+ final EntityPlayer player = PlayerUtils.getPlayer(aPlayerName);
+ if (player != null) {
+ return player;
+ }
+ return null;
+ }
- if (heldItem != null){
- return heldItem;
- }
+ public static final UUID getPlayersUUIDByName(final String aPlayerName) {
+ final EntityPlayer player = PlayerUtils.getPlayer(aPlayerName);
+ if (player != null) {
+ return player.getUniqueID();
+ }
+ return null;
+ }
- return null;
- }
+ @SideOnly(Side.CLIENT)
+ public static final boolean isPlayerAlkalus() {
+ if (Utils.isServer()) {
+ return false;
+ }
+ return isPlayerAlkalus(Minecraft.getMinecraft().thePlayer);
+ }
- public static Item getItemInPlayersHand(final EntityPlayer player){
- Item heldItem = null;
- try{
- heldItem = player.getHeldItem().getItem();
- }catch(final NullPointerException e){return null;}
+ public static final boolean isPlayerAlkalus(EntityPlayer player) {
+ if (player != null) {
+ if (player.getDisplayName().toLowerCase().equals("draknyte1")
+ || player.getDisplayName().toLowerCase().equals("alkalus")) {
+ return true;
+ }
+ }
+ return false;
+ }
- if (heldItem != null){
- return heldItem;
- }
- return null;
- }
+ public static void messageAllPlayers(String string) {
+ Utils.sendServerMessage(string);
+ }
- public final static EntityPlayer getPlayerEntityByName(final String aPlayerName){
- final EntityPlayer player = PlayerUtils.getPlayer(aPlayerName);
- if (player != null){
- return player;
- }
- return null;
- }
+ public static boolean isCreative(EntityPlayer aPlayer) {
+ return aPlayer.capabilities.isCreativeMode;
+ }
- public final static UUID getPlayersUUIDByName(final String aPlayerName){
- final EntityPlayer player = PlayerUtils.getPlayer(aPlayerName);
- if (player != null){
- return player.getUniqueID();
- }
- return null;
- }
-
- @SideOnly(Side.CLIENT)
- public static final boolean isPlayerAlkalus(){
- if (Utils.isServer()){
- return false;
- }
- return isPlayerAlkalus(Minecraft.getMinecraft().thePlayer);
- }
-
- public static final boolean isPlayerAlkalus(EntityPlayer player){
- if (player != null){
- if (player.getDisplayName().toLowerCase().equals("draknyte1") || player.getDisplayName().toLowerCase().equals("alkalus")){
- return true;
- }
- }
- return false;
- }
+ public static boolean canTakeDamage(EntityPlayer aPlayer) {
+ return !aPlayer.capabilities.disableDamage;
+ }
- public static void messageAllPlayers(String string) {
- Utils.sendServerMessage(string);
- }
+ public static void cacheFakePlayer(EntityPlayer aPlayer) {
+ ChunkCoordinates aChunkLocation = aPlayer.getPlayerCoordinates();
+ // Cache Fake Player
+ if (aPlayer instanceof FakePlayer
+ || (mThaumcraftFakePlayer != null && mThaumcraftFakePlayer.isInstance(aPlayer))
+ || (aPlayer.getCommandSenderName() == null
+ || aPlayer.getCommandSenderName().length() <= 0)
+ || (aPlayer.isEntityInvulnerable()
+ && !aPlayer.canCommandSenderUseCommand(0, "")
+ && (aChunkLocation == null)
+ || (aChunkLocation.posX == 0 && aChunkLocation.posY == 0 && aChunkLocation.posZ == 0))) {
+ mCachedFakePlayers.put(aPlayer.getUniqueID().toString(), aPlayer);
+ }
+ }
- public static boolean isCreative(EntityPlayer aPlayer) {
- return aPlayer.capabilities.isCreativeMode;
- }
-
- public static boolean canTakeDamage(EntityPlayer aPlayer) {
- return !aPlayer.capabilities.disableDamage;
- }
-
- public static void cacheFakePlayer(EntityPlayer aPlayer) {
- ChunkCoordinates aChunkLocation = aPlayer.getPlayerCoordinates();
- // Cache Fake Player
- if (aPlayer instanceof FakePlayer || (mThaumcraftFakePlayer != null && mThaumcraftFakePlayer.isInstance(aPlayer))
- || (aPlayer.getCommandSenderName() == null
- || aPlayer.getCommandSenderName().length() <= 0)
- || (aPlayer.isEntityInvulnerable() && !aPlayer.canCommandSenderUseCommand(0, "")
- && (aChunkLocation == null) || (aChunkLocation.posX == 0 && aChunkLocation.posY == 0
- && aChunkLocation.posZ == 0))) {
- mCachedFakePlayers.put(aPlayer.getUniqueID().toString(), aPlayer);
- }
- }
-
- public static boolean isCachedFakePlayer(String aUUID) {
- return mCachedFakePlayers.containsKey(aUUID);
- }
-
- public static boolean isRealPlayer(EntityLivingBase aEntity) {
- if (aEntity instanceof EntityPlayer) {
- EntityPlayer p = (EntityPlayer) aEntity;
- ChunkCoordinates aChunkLocation = p.getPlayerCoordinates();
- if (p instanceof FakePlayer) {
- cacheFakePlayer(p);
- return false;
- }
- if (mThaumcraftFakePlayer != null && mThaumcraftFakePlayer.isInstance(p) ) {
- cacheFakePlayer(p);
- return false;
- }
- if (p.getCommandSenderName() == null) {
- cacheFakePlayer(p);
- return false;
- }
- if (p.getCommandSenderName().length() <= 0) {
- cacheFakePlayer(p);
- return false;
- }
- if (p.isEntityInvulnerable() && !p.canCommandSenderUseCommand(0, "") && (aChunkLocation.posX == 0 && aChunkLocation.posY == 0 && aChunkLocation.posZ == 0)) {
- cacheFakePlayer(p);
- return false;
- }
- if (!isCachedFakePlayer(p.getUniqueID().toString())) {
- return true;
- }
- }
- return false;
- }
+ public static boolean isCachedFakePlayer(String aUUID) {
+ return mCachedFakePlayers.containsKey(aUUID);
+ }
+ public static boolean isRealPlayer(EntityLivingBase aEntity) {
+ if (aEntity instanceof EntityPlayer) {
+ EntityPlayer p = (EntityPlayer) aEntity;
+ ChunkCoordinates aChunkLocation = p.getPlayerCoordinates();
+ if (p instanceof FakePlayer) {
+ cacheFakePlayer(p);
+ return false;
+ }
+ if (mThaumcraftFakePlayer != null && mThaumcraftFakePlayer.isInstance(p)) {
+ cacheFakePlayer(p);
+ return false;
+ }
+ if (p.getCommandSenderName() == null) {
+ cacheFakePlayer(p);
+ return false;
+ }
+ if (p.getCommandSenderName().length() <= 0) {
+ cacheFakePlayer(p);
+ return false;
+ }
+ if (p.isEntityInvulnerable()
+ && !p.canCommandSenderUseCommand(0, "")
+ && (aChunkLocation.posX == 0 && aChunkLocation.posY == 0 && aChunkLocation.posZ == 0)) {
+ cacheFakePlayer(p);
+ return false;
+ }
+ if (!isCachedFakePlayer(p.getUniqueID().toString())) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java
index 595635d411..ba55ce262a 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java
@@ -1,10 +1,5 @@
package gtPlusPlus.core.util.minecraft;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.Materials;
import gregtech.api.objects.ItemData;
@@ -24,6 +19,10 @@ import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.data.ArrayUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -35,580 +34,659 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
public class RecipeUtils {
-public static int mInvalidID = 1;
- public static boolean recipeBuilder(final Object slot_1, final Object slot_2, final Object slot_3, final Object slot_4, final Object slot_5, final Object slot_6, final Object slot_7, final Object slot_8, final Object slot_9, ItemStack resultItem){
-
- //Old Debug Code, useful for finding recipes loading too early.
- /*if (gtPlusPlus.GTplusplus.CURRENT_LOAD_PHASE != GTplusplus.INIT_PHASE.POST_INIT) {
- Logger.RECIPE(ReflectionUtils.getMethodName(1));
- Logger.RECIPE(ReflectionUtils.getMethodName(2));
- Logger.RECIPE(ReflectionUtils.getMethodName(3));
- Logger.RECIPE(ReflectionUtils.getMethodName(4));
- Logger.RECIPE(ReflectionUtils.getMethodName(5));
- Logger.RECIPE(ReflectionUtils.getMethodName(6));
- Logger.RECIPE(ReflectionUtils.getMethodName(7));
- Logger.RECIPE(ReflectionUtils.getMethodName(8));
- Logger.RECIPE(ReflectionUtils.getMethodName(9));
- FMLCommonHandler.instance().exitJava(1, true);
- }*/
-
- if (resultItem == null){
- Logger.RECIPE("[Fix] Found a recipe with an invalid output, yet had a valid inputs. Using Dummy output so recipe can be found..");
- resultItem = ItemUtils.getItemStackOfAmountFromOreDict("givemeabrokenitem", 1);
- resultItem.setItemDamage(mInvalidID++);
- RegistrationHandler.recipesFailed++;
- //return false;
- }
- else if ((slot_1 == null) && (slot_2 == null) && (slot_3 == null) &&
- (slot_4 == null) && (slot_5 == null) && (slot_6 == null) &&
- (slot_7 == null) && (slot_8 == null) && (slot_9 == null)){
- Logger.RECIPE("[Fix] Found a recipe with 0 inputs, yet had a valid output.");
- Logger.RECIPE("[Fix] Error found while adding a recipe for: "+resultItem != null ? resultItem.getDisplayName() : "Bad Output Item"+" | Please report this issue on Github.");
- RegistrationHandler.recipesFailed++;
- return false;
- }
-
- Object[] o = new Object[] {slot_1, slot_2, slot_3, slot_4, slot_5, slot_6, slot_7, slot_8, slot_9};
-
- try {
- int size = COMPAT_HANDLER.mRecipesToGenerate.size();
- COMPAT_HANDLER.mRecipesToGenerate.put(new InternalRecipeObject(o, resultItem, false));
- //Utils.LOG_WARNING("Success! Added a recipe for "+resultItem.getDisplayName());
- if (COMPAT_HANDLER.mRecipesToGenerate.size() > size) {
- if (!COMPAT_HANDLER.areInitItemsLoaded){
- RegistrationHandler.recipesSuccess++;
- }
- else {
- LateRegistrationHandler.recipesSuccess++;
- }
- return true;
- }
- return false;
- }
- catch(RuntimeException k){
- //k.getMessage();
- //k.getClass();
- //k.printStackTrace();
- //k.getLocalizedMessage();
- Logger.RECIPE("[Fix] Invalid Recipe detected for: "+resultItem != null ? resultItem.getUnlocalizedName() : "INVALID OUTPUT ITEM");
- if (!COMPAT_HANDLER.areInitItemsLoaded){
- RegistrationHandler.recipesFailed++;
- }
- else {
- LateRegistrationHandler.recipesFailed++;
- }
- return false;
- }
- }
-
- public static void shapelessBuilder(final ItemStack Output, final Object slot_1, final Object slot_2, final Object slot_3, final Object slot_4, final Object slot_5, final Object slot_6, final Object slot_7, final Object slot_8, final Object slot_9){
- //Item output_ITEM = Output.getItem();
-
- final ArrayList<Object> validSlots = new ArrayList<>();
-
- Logger.WARNING("Trying to add a recipe for "+Output.toString());
- String a,b,c,d,e,f,g,h,i;
- if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);}
- Logger.WARNING(a);
- if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);}
- Logger.WARNING(b);
- if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);}
- Logger.WARNING(c);
- if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);}
- Logger.WARNING(d);
- if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);}
- Logger.WARNING(e);
- if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);}
- Logger.WARNING(f);
- if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);}
- Logger.WARNING(g);
- if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);}
- Logger.WARNING(h);
- if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);}
- Logger.WARNING(i);
-
-
- Logger.ERROR("_______");
- Logger.ERROR("|"+a+"|"+b+"|"+c+"|");
- Logger.ERROR("_______");
- Logger.ERROR("|"+d+"|"+e+"|"+f+"|");
- Logger.ERROR("_______");
- Logger.ERROR("|"+g+"|"+h+"|"+i+"|");
- Logger.ERROR("_______");
-
- validSlots.add(0, a);
- validSlots.add(1, b);
- validSlots.add(2, c);
- validSlots.add(3, d);
- validSlots.add(4, e);
- validSlots.add(5, f);
- validSlots.add(6, g);
- validSlots.add(7, h);
- validSlots.add(8, i);
-
- try {
- //GameRegistry.addRecipe(new ShapelessOreRecipe(Output, outputAmount), (Object[]) validSlots.toArray());
- GameRegistry.addRecipe(new ShapelessOreRecipe(Output, validSlots.toArray()));
- //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2});
- Logger.RECIPE("Success! Added a recipe for "+Output.getDisplayName());
- RegistrationHandler.recipesSuccess++;
- }
- catch(final RuntimeException k){
- k.getMessage();
- k.getClass();
- k.printStackTrace();
- k.getLocalizedMessage();
- Logger.RECIPE("[Fix] Invalid Recipe detected for: "+Output.getUnlocalizedName());
- RegistrationHandler.recipesFailed++;
- }
-
-
- //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2});
- }
-
- public static void recipeBuilder(final Object[] array, final ItemStack outPut) {
- Logger.SPECIFIC_WARNING("object Array - recipeBuilder", "Attempting to build a recipe using an object array as an input, splitting it, then running the normal recipeBuilder() method.", 396);
- Object a=null;
- Object b=null;
- Object c=null;
- Object d=null;
- Object e=null;
- Object f=null;
- Object g=null;
- Object h=null;
- Object i=null;
- for(int z =0; z <= array.length; z++){
- array[z].toString();
- switch(z)
- {
- case 0:
- a = array[z];
- break;
- case 1:
- b = array[z];
- break;
- case 2:
- c = array[z];
- break;
- case 3:
- d = array[z];
- break;
- case 4:
- e = array[z];
- break;
- case 5:
- f = array[z];
- break;
- case 6:
- g = array[z];
- break;
- case 7:
- h = array[z];
- break;
- case 8:
- i = array[z];
- break;
- default:
- break;
- }
- recipeBuilder(a, b, c, d, e, f, g, h, i, outPut);
- }
- }
-
- public static boolean removeCraftingRecipe(Object x){
- if (null == x){return false;}
- if (x instanceof String){
- final Item R = ItemUtils.getItemFromFQRN((String) x);
- if (R != null){
- x = R;
- }
- else {
- return false;
- }
- }
- if ((x instanceof Item) || (x instanceof ItemStack)){
- if (x instanceof Item){
- final ItemStack r = new ItemStack((Item) x);
- Logger.RECIPE("Removing Recipe for "+r.getUnlocalizedName());
- }
- else {
- Logger.RECIPE("Removing Recipe for "+((ItemStack) x).getUnlocalizedName());
- }
- if (x instanceof ItemStack){
- final Item r = ((ItemStack) x).getItem();
- if (null != r){
- x = r;
- }
- else {
- Logger.RECIPE("Recipe removal failed - Tell Alkalus.");
- return false;
- }
- }
- if (RecipeUtils.attemptRecipeRemoval((Item) x)){
- Logger.RECIPE("Recipe removal successful");
- return true;
- }
- Logger.RECIPE("Recipe removal failed - Tell Alkalus.");
- return false;
- }
- return false;
- }
-
- private static boolean attemptRecipeRemoval(final Item I){
- Logger.RECIPE("Create list of recipes.");
- final List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
- final Iterator<IRecipe> items = recipes.iterator();
- Logger.RECIPE("Begin list iteration.");
- while (items.hasNext()) {
- final ItemStack is = items.next().getRecipeOutput();
- if ((is != null) && (is.getItem() == I)){
- items.remove();
- Logger.RECIPE("Remove a recipe with "+I.getUnlocalizedName()+" as output.");
- continue;
- }
- }
- Logger.RECIPE("All recipes should be gone?");
- if (!items.hasNext()){
- Logger.RECIPE("We iterated once, let's try again to double check.");
- final Iterator<IRecipe> items2 = recipes.iterator();
- while (items2.hasNext()) {
- final ItemStack is = items2.next().getRecipeOutput();
- if ((is != null) && (is.getItem() == I)){
- items.remove();
- Logger.RECIPE("REMOVING MISSED RECIPE - RECHECK CONSTRUCTORS");
- return true;
- }
- }
- Logger.RECIPE("Should be all gone now after double checking, so return true.");
- return true;
- }
- Logger.RECIPE("Return false, because something went wrong.");
- return false;
- }
-
-
-
- public static boolean addShapedGregtechRecipeForTypes(
- final Object InputItem1, final Object InputItem2, final Object InputItem3,
- final Object InputItem4, final Object InputItem5, final Object InputItem6,
- final Object InputItem7, final Object InputItem8, final Object InputItem9,
- final ItemStack OutputItem){
-
- int using = 0, recipeSlotCurrent = 0;
- boolean[] hasMultiStack = new boolean[9];
- boolean inUse[] = {false, false, false};
- ItemStack array[][] = new ItemStack[3][9];
-
- Object[] inputs = {
- InputItem1, InputItem2, InputItem3,
- InputItem4, InputItem5, InputItem6,
- InputItem7, InputItem8, InputItem9};
-
- for (Object o : inputs){
- if (o.getClass().isArray()){
- if (inUse[using] == false){
- inUse[using] = true;
- array[using] = (ItemStack[]) o;
- hasMultiStack[recipeSlotCurrent] = true;
- using++;
- }
- }
- else {
- hasMultiStack[recipeSlotCurrent] = false;
- }
- recipeSlotCurrent++;
- }
-
- int using2 = 0;
- for (boolean t : inUse){
-
- if (t){
- if (array[using2] != null){
- //addShapedGregtechRecipe
- }
- }
- using2++;
- }
-
-
- return false;
- }
-
-
-
- public static boolean addShapedGregtechRecipe(
- final Object InputItem1, final Object InputItem2, final Object InputItem3,
- final Object InputItem4, final Object InputItem5, final Object InputItem6,
- final Object InputItem7, final Object InputItem8, final Object InputItem9,
- final ItemStack OutputItem){
-
- Object[] o = {
- InputItem1, InputItem2, InputItem3,
- InputItem4, InputItem5, InputItem6,
- InputItem7, InputItem8, InputItem9
- };
-
-
- if (gtPlusPlus.GTplusplus.CURRENT_LOAD_PHASE != GTplusplus.INIT_PHASE.POST_INIT) {
- CORE.crash("Load Phase "+gtPlusPlus.GTplusplus.CURRENT_LOAD_PHASE+" should be "+GTplusplus.INIT_PHASE.POST_INIT+". Unable to register recipe.");
- }
-
-
- int size = COMPAT_HANDLER.mGtRecipesToGenerate.size();
- COMPAT_HANDLER.mGtRecipesToGenerate.put(new InternalRecipeObject(o, OutputItem, true));
-
- if (COMPAT_HANDLER.mGtRecipesToGenerate.size() > size) {
- if (!COMPAT_HANDLER.areInitItemsLoaded){
- RegistrationHandler.recipesSuccess++;
- }
- else {
- LateRegistrationHandler.recipesSuccess++;
- }
- return true;
- }
- return false;
-
- }
-
- public static boolean addShapedGregtechRecipe(final Object[] inputs, ItemStack output){
-
- if (inputs.length != 9){
- Logger.RECIPE("[Fix] Input array for "+output.getDisplayName()+" does not equal 9. "+inputs.length+" is the actual size.");
- RegistrationHandler.recipesFailed++;
- return false;
- }
-
- for (int x=0;x<9;x++){
- if (inputs[x] == null){
- inputs[x] = " ";
- Logger.WARNING("Input slot "+x+" changed from NULL to a blank space.");
- }
- else if (!(inputs[x] instanceof ItemStack) && !(inputs[x] instanceof String) && !(inputs[x] instanceof Item)){
- if (output != null){
- Logger.RECIPE("[Fix] Invalid Item inserted into inputArray. Item:"+output.getDisplayName()+" has a bad recipe. Please report to Alkalus.");
- RegistrationHandler.recipesFailed++;
- return false;
- }
- else {
- Logger.RECIPE("[Fix] Output is Null for a recipe. Report to Alkalus.");
- output = ItemUtils.getItemStackOfAmountFromOreDict("sadibasdkjnad", 1);
- RegistrationHandler.recipesFailed++;
- }
- }
- }
-
- int size = COMPAT_HANDLER.mGtRecipesToGenerate.size();
- COMPAT_HANDLER.mGtRecipesToGenerate.put(new InternalRecipeObject(inputs, output, true));
-
- if (COMPAT_HANDLER.mGtRecipesToGenerate.size() > size) {
- if (!COMPAT_HANDLER.areInitItemsLoaded){
- RegistrationHandler.recipesSuccess++;
- }
- else {
- LateRegistrationHandler.recipesSuccess++;
- }
- return true;
- }
- return false;
- }
-
- public static boolean addShapelessGregtechRecipe(
- final Object InputItem1, final Object InputItem2, final Object InputItem3,
- final Object InputItem4, final Object InputItem5, final Object InputItem6,
- final Object InputItem7, final Object InputItem8, final Object InputItem9,
- final ItemStack OutputItem){
-
- Object[] inputItems = {
- InputItem1, InputItem2, InputItem3,
- InputItem4, InputItem5, InputItem6,
- InputItem7, InputItem8, InputItem9
- };
- return addShapelessGregtechRecipe(inputItems, OutputItem);
- }
-
- public static boolean addShapelessGregtechRecipe(final Object[] inputItems, final ItemStack OutputItem){
- //Catch Invalid Recipes
- if (inputItems.length > 9 || inputItems.length < 1){
- if (OutputItem != null){
- Logger.RECIPE("[Fix] Invalid input array for shapeless recipe, which should output "+OutputItem.getDisplayName());
- }
- return false;
- }
- //let gregtech handle shapeless recipes.
- if (GT_ModHandler.addShapelessCraftingRecipe(OutputItem, inputItems)){
- return true;
- }
- return false;
- }
-
- public static ItemStack getItemStackFromOreDict(final String oredictName){
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
- return oreDictList.get(0);
- }
-
- public static boolean buildShapelessRecipe(final ItemStack output, final Object[] input){
- return ShapelessUtils.addShapelessRecipe(output, input);
- }
-
- public static boolean generateMortarRecipe(ItemStack aStack, ItemStack aOutput) {
- return RecipeUtils.addShapedGregtechRecipe(
- aStack, null, null,
- CI.craftingToolMortar, null, null,
- null, null, null,
- aOutput);
- }
-
- public static boolean doesGregtechRecipeHaveEqualCells(GT_Recipe x) {
- if (x.mInputs.length == 0 && x.mOutputs.length == 0) {
- return true;
- }
-
- final int tInputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(x.mInputs);
- final int tOutputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(x.mOutputs);
-
- if (tInputAmount < tOutputAmount) {
- if (!Materials.Tin.contains(x.mInputs)) {
- return false;
- }
- else {
- return true;
- }
- }
- else if (tInputAmount > tOutputAmount && !Materials.Tin.contains(x.mOutputs)) {
- return false;
- }
- else {
- return true;
- }
- }
-
- public static String[] getRecipeInfo(GT_Recipe m) {
- if (m == null) {
- return new String[] {};
- }
- AutoMap<String> result = new AutoMap<String>();
- result.put(m.toString());
- result.put("Input "+ItemUtils.getArrayStackNames(m.mInputs));
- result.put("Output "+ItemUtils.getArrayStackNames(m.mOutputs));
- result.put("Input "+ItemUtils.getArrayStackNames(m.mFluidInputs));
- result.put("Output "+ItemUtils.getArrayStackNames(m.mFluidOutputs));
- result.put("Can be buffered? "+m.mCanBeBuffered);
- result.put("Duration: "+m.mDuration);
- result.put("EU/t: "+m.mEUt);
- result.put("Is Hidden? "+m.mHidden);
- result.put("Is Enabled? "+m.mEnabled);
- result.put("Special Value: "+m.mSpecialValue);
- result.put("=====================================");
- String s[] = result.toArray();
- return s;
- }
-
-
- public static class InternalRecipeObject implements RunnableWithInfo<String> {
- final ItemStack mOutput;
- final ShapedOreRecipe mRecipe;
- public final boolean isValid;
-
- public InternalRecipeObject(Object[] aInputs, ItemStack aOutput, boolean gtRecipe) {
- Logger.RECIPE("===================================");
- mOutput = aOutput != null ? aOutput.copy() : null;
- Object[] aFiltered = new Object[9];
- int aValid = 0;
- for (Object o : aInputs) {
- if (o instanceof ItemStack) {
- aFiltered[aValid++] = o;
- }
- else if (o instanceof Item) {
- aFiltered[aValid++] = ItemUtils.getSimpleStack((Item) o);
- }
- else if (o instanceof Block) {
- aFiltered[aValid++] = ItemUtils.getSimpleStack((Block) o);
- }
- else if (o instanceof String) {
- aFiltered[aValid++] = o;
- }
- else if (o == null) {
- aFiltered[aValid++] = null;
- }
- else {
- Logger.RECIPE("Cleaned a "+o.getClass().getSimpleName()+" from recipe input.");
- }
- }
-
- int validCounter = 0, invalidCounter = 0;
- for (Object p : aFiltered) {
- if (p instanceof ItemStack) {
- validCounter++;
- }
- else if (p instanceof Item) {
- validCounter++;
- }
- else if (p instanceof Block) {
- validCounter++;
- }
- else if (p instanceof String) {
- validCounter++;
- }
- else if (p == null) {
- validCounter++;
- }
- else {
- invalidCounter++;
- }
- }
-
- Logger.RECIPE("Using "+validCounter+" valid inputs and "+invalidCounter+" invalid inputs.");
- ShapedRecipe r = new ShapedRecipe(aFiltered, mOutput);
- if (r != null && r.mRecipe != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- mRecipe = r != null ? r.mRecipe : null;
- }
-
- @Override
- public void run() {
- if (this.isValid) {
- GameRegistry.addRecipe(mRecipe);
- }
- else {
- Logger.RECIPE("[Fix] Invalid shapped recipe outputting "+mOutput != null ? mOutput.getDisplayName() : "Bad Output Item");
- }
- }
-
- @Override
- public String getInfoData() {
- if (mOutput != null && mOutput instanceof ItemStack) {
- return ((ItemStack) mOutput).getDisplayName();
- }
- return "";
- }
-
- }
-
-
- public static boolean removeGtRecipe(GT_Recipe aRecipeToRemove, GT_Recipe_Map aRecipeMap) {
- if (aRecipeMap.mRecipeList.contains(aRecipeToRemove)) {
- return aRecipeMap.mRecipeList.remove(aRecipeToRemove);
- }
- return false;
- }
-
- public static boolean addGtRecipe(GT_Recipe aRecipeToAdd, GT_Recipe_Map aRecipeMap) {
+ public static int mInvalidID = 1;
+
+ public static boolean recipeBuilder(
+ final Object slot_1,
+ final Object slot_2,
+ final Object slot_3,
+ final Object slot_4,
+ final Object slot_5,
+ final Object slot_6,
+ final Object slot_7,
+ final Object slot_8,
+ final Object slot_9,
+ ItemStack resultItem) {
+
+ // Old Debug Code, useful for finding recipes loading too early.
+ /*if (gtPlusPlus.GTplusplus.CURRENT_LOAD_PHASE != GTplusplus.INIT_PHASE.POST_INIT) {
+ Logger.RECIPE(ReflectionUtils.getMethodName(1));
+ Logger.RECIPE(ReflectionUtils.getMethodName(2));
+ Logger.RECIPE(ReflectionUtils.getMethodName(3));
+ Logger.RECIPE(ReflectionUtils.getMethodName(4));
+ Logger.RECIPE(ReflectionUtils.getMethodName(5));
+ Logger.RECIPE(ReflectionUtils.getMethodName(6));
+ Logger.RECIPE(ReflectionUtils.getMethodName(7));
+ Logger.RECIPE(ReflectionUtils.getMethodName(8));
+ Logger.RECIPE(ReflectionUtils.getMethodName(9));
+ FMLCommonHandler.instance().exitJava(1, true);
+ }*/
+
+ if (resultItem == null) {
+ Logger.RECIPE(
+ "[Fix] Found a recipe with an invalid output, yet had a valid inputs. Using Dummy output so recipe can be found..");
+ resultItem = ItemUtils.getItemStackOfAmountFromOreDict("givemeabrokenitem", 1);
+ resultItem.setItemDamage(mInvalidID++);
+ RegistrationHandler.recipesFailed++;
+ // return false;
+ } else if ((slot_1 == null)
+ && (slot_2 == null)
+ && (slot_3 == null)
+ && (slot_4 == null)
+ && (slot_5 == null)
+ && (slot_6 == null)
+ && (slot_7 == null)
+ && (slot_8 == null)
+ && (slot_9 == null)) {
+ Logger.RECIPE("[Fix] Found a recipe with 0 inputs, yet had a valid output.");
+ Logger.RECIPE(
+ "[Fix] Error found while adding a recipe for: " + resultItem != null
+ ? resultItem.getDisplayName()
+ : "Bad Output Item" + " | Please report this issue on Github.");
+ RegistrationHandler.recipesFailed++;
+ return false;
+ }
+
+ Object[] o = new Object[] {slot_1, slot_2, slot_3, slot_4, slot_5, slot_6, slot_7, slot_8, slot_9};
+
+ try {
+ int size = COMPAT_HANDLER.mRecipesToGenerate.size();
+ COMPAT_HANDLER.mRecipesToGenerate.put(new InternalRecipeObject(o, resultItem, false));
+ // Utils.LOG_WARNING("Success! Added a recipe for "+resultItem.getDisplayName());
+ if (COMPAT_HANDLER.mRecipesToGenerate.size() > size) {
+ if (!COMPAT_HANDLER.areInitItemsLoaded) {
+ RegistrationHandler.recipesSuccess++;
+ } else {
+ LateRegistrationHandler.recipesSuccess++;
+ }
+ return true;
+ }
+ return false;
+ } catch (RuntimeException k) {
+ // k.getMessage();
+ // k.getClass();
+ // k.printStackTrace();
+ // k.getLocalizedMessage();
+ Logger.RECIPE(
+ "[Fix] Invalid Recipe detected for: " + resultItem != null
+ ? resultItem.getUnlocalizedName()
+ : "INVALID OUTPUT ITEM");
+ if (!COMPAT_HANDLER.areInitItemsLoaded) {
+ RegistrationHandler.recipesFailed++;
+ } else {
+ LateRegistrationHandler.recipesFailed++;
+ }
+ return false;
+ }
+ }
+
+ public static void shapelessBuilder(
+ final ItemStack Output,
+ final Object slot_1,
+ final Object slot_2,
+ final Object slot_3,
+ final Object slot_4,
+ final Object slot_5,
+ final Object slot_6,
+ final Object slot_7,
+ final Object slot_8,
+ final Object slot_9) {
+ // Item output_ITEM = Output.getItem();
+
+ final ArrayList<Object> validSlots = new ArrayList<>();
+
+ Logger.WARNING("Trying to add a recipe for " + Output.toString());
+ String a, b, c, d, e, f, g, h, i;
+ if (slot_1 == null) {
+ a = " ";
+ } else {
+ a = "1";
+ validSlots.add('1');
+ validSlots.add(slot_1);
+ }
+ Logger.WARNING(a);
+ if (slot_2 == null) {
+ b = " ";
+ } else {
+ b = "2";
+ validSlots.add('2');
+ validSlots.add(slot_2);
+ }
+ Logger.WARNING(b);
+ if (slot_3 == null) {
+ c = " ";
+ } else {
+ c = "3";
+ validSlots.add('3');
+ validSlots.add(slot_3);
+ }
+ Logger.WARNING(c);
+ if (slot_4 == null) {
+ d = " ";
+ } else {
+ d = "4";
+ validSlots.add('4');
+ validSlots.add(slot_4);
+ }
+ Logger.WARNING(d);
+ if (slot_5 == null) {
+ e = " ";
+ } else {
+ e = "5";
+ validSlots.add('5');
+ validSlots.add(slot_5);
+ }
+ Logger.WARNING(e);
+ if (slot_6 == null) {
+ f = " ";
+ } else {
+ f = "6";
+ validSlots.add('6');
+ validSlots.add(slot_6);
+ }
+ Logger.WARNING(f);
+ if (slot_7 == null) {
+ g = " ";
+ } else {
+ g = "7";
+ validSlots.add('7');
+ validSlots.add(slot_7);
+ }
+ Logger.WARNING(g);
+ if (slot_8 == null) {
+ h = " ";
+ } else {
+ h = "8";
+ validSlots.add('8');
+ validSlots.add(slot_8);
+ }
+ Logger.WARNING(h);
+ if (slot_9 == null) {
+ i = " ";
+ } else {
+ i = "9";
+ validSlots.add('9');
+ validSlots.add(slot_9);
+ }
+ Logger.WARNING(i);
+
+ Logger.ERROR("_______");
+ Logger.ERROR("|" + a + "|" + b + "|" + c + "|");
+ Logger.ERROR("_______");
+ Logger.ERROR("|" + d + "|" + e + "|" + f + "|");
+ Logger.ERROR("_______");
+ Logger.ERROR("|" + g + "|" + h + "|" + i + "|");
+ Logger.ERROR("_______");
+
+ validSlots.add(0, a);
+ validSlots.add(1, b);
+ validSlots.add(2, c);
+ validSlots.add(3, d);
+ validSlots.add(4, e);
+ validSlots.add(5, f);
+ validSlots.add(6, g);
+ validSlots.add(7, h);
+ validSlots.add(8, i);
+
+ try {
+ // GameRegistry.addRecipe(new ShapelessOreRecipe(Output, outputAmount), (Object[]) validSlots.toArray());
+ GameRegistry.addRecipe(new ShapelessOreRecipe(Output, validSlots.toArray()));
+ // GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2});
+ Logger.RECIPE("Success! Added a recipe for " + Output.getDisplayName());
+ RegistrationHandler.recipesSuccess++;
+ } catch (final RuntimeException k) {
+ k.getMessage();
+ k.getClass();
+ k.printStackTrace();
+ k.getLocalizedMessage();
+ Logger.RECIPE("[Fix] Invalid Recipe detected for: " + Output.getUnlocalizedName());
+ RegistrationHandler.recipesFailed++;
+ }
+
+ // GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2});
+ }
+
+ public static void recipeBuilder(final Object[] array, final ItemStack outPut) {
+ Logger.SPECIFIC_WARNING(
+ "object Array - recipeBuilder",
+ "Attempting to build a recipe using an object array as an input, splitting it, then running the normal recipeBuilder() method.",
+ 396);
+ Object a = null;
+ Object b = null;
+ Object c = null;
+ Object d = null;
+ Object e = null;
+ Object f = null;
+ Object g = null;
+ Object h = null;
+ Object i = null;
+ for (int z = 0; z <= array.length; z++) {
+ array[z].toString();
+ switch (z) {
+ case 0:
+ a = array[z];
+ break;
+ case 1:
+ b = array[z];
+ break;
+ case 2:
+ c = array[z];
+ break;
+ case 3:
+ d = array[z];
+ break;
+ case 4:
+ e = array[z];
+ break;
+ case 5:
+ f = array[z];
+ break;
+ case 6:
+ g = array[z];
+ break;
+ case 7:
+ h = array[z];
+ break;
+ case 8:
+ i = array[z];
+ break;
+ default:
+ break;
+ }
+ recipeBuilder(a, b, c, d, e, f, g, h, i, outPut);
+ }
+ }
+
+ public static boolean removeCraftingRecipe(Object x) {
+ if (null == x) {
+ return false;
+ }
+ if (x instanceof String) {
+ final Item R = ItemUtils.getItemFromFQRN((String) x);
+ if (R != null) {
+ x = R;
+ } else {
+ return false;
+ }
+ }
+ if ((x instanceof Item) || (x instanceof ItemStack)) {
+ if (x instanceof Item) {
+ final ItemStack r = new ItemStack((Item) x);
+ Logger.RECIPE("Removing Recipe for " + r.getUnlocalizedName());
+ } else {
+ Logger.RECIPE("Removing Recipe for " + ((ItemStack) x).getUnlocalizedName());
+ }
+ if (x instanceof ItemStack) {
+ final Item r = ((ItemStack) x).getItem();
+ if (null != r) {
+ x = r;
+ } else {
+ Logger.RECIPE("Recipe removal failed - Tell Alkalus.");
+ return false;
+ }
+ }
+ if (RecipeUtils.attemptRecipeRemoval((Item) x)) {
+ Logger.RECIPE("Recipe removal successful");
+ return true;
+ }
+ Logger.RECIPE("Recipe removal failed - Tell Alkalus.");
+ return false;
+ }
+ return false;
+ }
+
+ private static boolean attemptRecipeRemoval(final Item I) {
+ Logger.RECIPE("Create list of recipes.");
+ final List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
+ final Iterator<IRecipe> items = recipes.iterator();
+ Logger.RECIPE("Begin list iteration.");
+ while (items.hasNext()) {
+ final ItemStack is = items.next().getRecipeOutput();
+ if ((is != null) && (is.getItem() == I)) {
+ items.remove();
+ Logger.RECIPE("Remove a recipe with " + I.getUnlocalizedName() + " as output.");
+ continue;
+ }
+ }
+ Logger.RECIPE("All recipes should be gone?");
+ if (!items.hasNext()) {
+ Logger.RECIPE("We iterated once, let's try again to double check.");
+ final Iterator<IRecipe> items2 = recipes.iterator();
+ while (items2.hasNext()) {
+ final ItemStack is = items2.next().getRecipeOutput();
+ if ((is != null) && (is.getItem() == I)) {
+ items.remove();
+ Logger.RECIPE("REMOVING MISSED RECIPE - RECHECK CONSTRUCTORS");
+ return true;
+ }
+ }
+ Logger.RECIPE("Should be all gone now after double checking, so return true.");
+ return true;
+ }
+ Logger.RECIPE("Return false, because something went wrong.");
+ return false;
+ }
+
+ public static boolean addShapedGregtechRecipeForTypes(
+ final Object InputItem1,
+ final Object InputItem2,
+ final Object InputItem3,
+ final Object InputItem4,
+ final Object InputItem5,
+ final Object InputItem6,
+ final Object InputItem7,
+ final Object InputItem8,
+ final Object InputItem9,
+ final ItemStack OutputItem) {
+
+ int using = 0, recipeSlotCurrent = 0;
+ boolean[] hasMultiStack = new boolean[9];
+ boolean inUse[] = {false, false, false};
+ ItemStack array[][] = new ItemStack[3][9];
+
+ Object[] inputs = {
+ InputItem1, InputItem2, InputItem3,
+ InputItem4, InputItem5, InputItem6,
+ InputItem7, InputItem8, InputItem9
+ };
+
+ for (Object o : inputs) {
+ if (o.getClass().isArray()) {
+ if (inUse[using] == false) {
+ inUse[using] = true;
+ array[using] = (ItemStack[]) o;
+ hasMultiStack[recipeSlotCurrent] = true;
+ using++;
+ }
+ } else {
+ hasMultiStack[recipeSlotCurrent] = false;
+ }
+ recipeSlotCurrent++;
+ }
+
+ int using2 = 0;
+ for (boolean t : inUse) {
+
+ if (t) {
+ if (array[using2] != null) {
+ // addShapedGregtechRecipe
+ }
+ }
+ using2++;
+ }
+
+ return false;
+ }
+
+ public static boolean addShapedGregtechRecipe(
+ final Object InputItem1,
+ final Object InputItem2,
+ final Object InputItem3,
+ final Object InputItem4,
+ final Object InputItem5,
+ final Object InputItem6,
+ final Object InputItem7,
+ final Object InputItem8,
+ final Object InputItem9,
+ final ItemStack OutputItem) {
+
+ Object[] o = {
+ InputItem1, InputItem2, InputItem3,
+ InputItem4, InputItem5, InputItem6,
+ InputItem7, InputItem8, InputItem9
+ };
+
+ if (gtPlusPlus.GTplusplus.CURRENT_LOAD_PHASE != GTplusplus.INIT_PHASE.POST_INIT) {
+ CORE.crash("Load Phase " + gtPlusPlus.GTplusplus.CURRENT_LOAD_PHASE + " should be "
+ + GTplusplus.INIT_PHASE.POST_INIT + ". Unable to register recipe.");
+ }
+
+ int size = COMPAT_HANDLER.mGtRecipesToGenerate.size();
+ COMPAT_HANDLER.mGtRecipesToGenerate.put(new InternalRecipeObject(o, OutputItem, true));
+
+ if (COMPAT_HANDLER.mGtRecipesToGenerate.size() > size) {
+ if (!COMPAT_HANDLER.areInitItemsLoaded) {
+ RegistrationHandler.recipesSuccess++;
+ } else {
+ LateRegistrationHandler.recipesSuccess++;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean addShapedGregtechRecipe(final Object[] inputs, ItemStack output) {
+
+ if (inputs.length != 9) {
+ Logger.RECIPE("[Fix] Input array for " + output.getDisplayName() + " does not equal 9. " + inputs.length
+ + " is the actual size.");
+ RegistrationHandler.recipesFailed++;
+ return false;
+ }
+
+ for (int x = 0; x < 9; x++) {
+ if (inputs[x] == null) {
+ inputs[x] = " ";
+ Logger.WARNING("Input slot " + x + " changed from NULL to a blank space.");
+ } else if (!(inputs[x] instanceof ItemStack)
+ && !(inputs[x] instanceof String)
+ && !(inputs[x] instanceof Item)) {
+ if (output != null) {
+ Logger.RECIPE("[Fix] Invalid Item inserted into inputArray. Item:" + output.getDisplayName()
+ + " has a bad recipe. Please report to Alkalus.");
+ RegistrationHandler.recipesFailed++;
+ return false;
+ } else {
+ Logger.RECIPE("[Fix] Output is Null for a recipe. Report to Alkalus.");
+ output = ItemUtils.getItemStackOfAmountFromOreDict("sadibasdkjnad", 1);
+ RegistrationHandler.recipesFailed++;
+ }
+ }
+ }
+
+ int size = COMPAT_HANDLER.mGtRecipesToGenerate.size();
+ COMPAT_HANDLER.mGtRecipesToGenerate.put(new InternalRecipeObject(inputs, output, true));
+
+ if (COMPAT_HANDLER.mGtRecipesToGenerate.size() > size) {
+ if (!COMPAT_HANDLER.areInitItemsLoaded) {
+ RegistrationHandler.recipesSuccess++;
+ } else {
+ LateRegistrationHandler.recipesSuccess++;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean addShapelessGregtechRecipe(
+ final Object InputItem1,
+ final Object InputItem2,
+ final Object InputItem3,
+ final Object InputItem4,
+ final Object InputItem5,
+ final Object InputItem6,
+ final Object InputItem7,
+ final Object InputItem8,
+ final Object InputItem9,
+ final ItemStack OutputItem) {
+
+ Object[] inputItems = {
+ InputItem1, InputItem2, InputItem3,
+ InputItem4, InputItem5, InputItem6,
+ InputItem7, InputItem8, InputItem9
+ };
+ return addShapelessGregtechRecipe(inputItems, OutputItem);
+ }
+
+ public static boolean addShapelessGregtechRecipe(final Object[] inputItems, final ItemStack OutputItem) {
+ // Catch Invalid Recipes
+ if (inputItems.length > 9 || inputItems.length < 1) {
+ if (OutputItem != null) {
+ Logger.RECIPE("[Fix] Invalid input array for shapeless recipe, which should output "
+ + OutputItem.getDisplayName());
+ }
+ return false;
+ }
+ // let gregtech handle shapeless recipes.
+ if (GT_ModHandler.addShapelessCraftingRecipe(OutputItem, inputItems)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static ItemStack getItemStackFromOreDict(final String oredictName) {
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ return oreDictList.get(0);
+ }
+
+ public static boolean buildShapelessRecipe(final ItemStack output, final Object[] input) {
+ return ShapelessUtils.addShapelessRecipe(output, input);
+ }
+
+ public static boolean generateMortarRecipe(ItemStack aStack, ItemStack aOutput) {
+ return RecipeUtils.addShapedGregtechRecipe(
+ aStack, null, null, CI.craftingToolMortar, null, null, null, null, null, aOutput);
+ }
+
+ public static boolean doesGregtechRecipeHaveEqualCells(GT_Recipe x) {
+ if (x.mInputs.length == 0 && x.mOutputs.length == 0) {
+ return true;
+ }
+
+ final int tInputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(x.mInputs);
+ final int tOutputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(x.mOutputs);
+
+ if (tInputAmount < tOutputAmount) {
+ if (!Materials.Tin.contains(x.mInputs)) {
+ return false;
+ } else {
+ return true;
+ }
+ } else if (tInputAmount > tOutputAmount && !Materials.Tin.contains(x.mOutputs)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ public static String[] getRecipeInfo(GT_Recipe m) {
+ if (m == null) {
+ return new String[] {};
+ }
+ AutoMap<String> result = new AutoMap<String>();
+ result.put(m.toString());
+ result.put("Input " + ItemUtils.getArrayStackNames(m.mInputs));
+ result.put("Output " + ItemUtils.getArrayStackNames(m.mOutputs));
+ result.put("Input " + ItemUtils.getArrayStackNames(m.mFluidInputs));
+ result.put("Output " + ItemUtils.getArrayStackNames(m.mFluidOutputs));
+ result.put("Can be buffered? " + m.mCanBeBuffered);
+ result.put("Duration: " + m.mDuration);
+ result.put("EU/t: " + m.mEUt);
+ result.put("Is Hidden? " + m.mHidden);
+ result.put("Is Enabled? " + m.mEnabled);
+ result.put("Special Value: " + m.mSpecialValue);
+ result.put("=====================================");
+ String s[] = result.toArray();
+ return s;
+ }
+
+ public static class InternalRecipeObject implements RunnableWithInfo<String> {
+ final ItemStack mOutput;
+ final ShapedOreRecipe mRecipe;
+ public final boolean isValid;
+
+ public InternalRecipeObject(Object[] aInputs, ItemStack aOutput, boolean gtRecipe) {
+ Logger.RECIPE("===================================");
+ mOutput = aOutput != null ? aOutput.copy() : null;
+ Object[] aFiltered = new Object[9];
+ int aValid = 0;
+ for (Object o : aInputs) {
+ if (o instanceof ItemStack) {
+ aFiltered[aValid++] = o;
+ } else if (o instanceof Item) {
+ aFiltered[aValid++] = ItemUtils.getSimpleStack((Item) o);
+ } else if (o instanceof Block) {
+ aFiltered[aValid++] = ItemUtils.getSimpleStack((Block) o);
+ } else if (o instanceof String) {
+ aFiltered[aValid++] = o;
+ } else if (o == null) {
+ aFiltered[aValid++] = null;
+ } else {
+ Logger.RECIPE("Cleaned a " + o.getClass().getSimpleName() + " from recipe input.");
+ }
+ }
+
+ int validCounter = 0, invalidCounter = 0;
+ for (Object p : aFiltered) {
+ if (p instanceof ItemStack) {
+ validCounter++;
+ } else if (p instanceof Item) {
+ validCounter++;
+ } else if (p instanceof Block) {
+ validCounter++;
+ } else if (p instanceof String) {
+ validCounter++;
+ } else if (p == null) {
+ validCounter++;
+ } else {
+ invalidCounter++;
+ }
+ }
+
+ Logger.RECIPE("Using " + validCounter + " valid inputs and " + invalidCounter + " invalid inputs.");
+ ShapedRecipe r = new ShapedRecipe(aFiltered, mOutput);
+ if (r != null && r.mRecipe != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ mRecipe = r != null ? r.mRecipe : null;
+ }
+
+ @Override
+ public void run() {
+ if (this.isValid) {
+ GameRegistry.addRecipe(mRecipe);
+ } else {
+ Logger.RECIPE(
+ "[Fix] Invalid shapped recipe outputting " + mOutput != null
+ ? mOutput.getDisplayName()
+ : "Bad Output Item");
+ }
+ }
+
+ @Override
+ public String getInfoData() {
+ if (mOutput != null && mOutput instanceof ItemStack) {
+ return ((ItemStack) mOutput).getDisplayName();
+ }
+ return "";
+ }
+ }
+
+ public static boolean removeGtRecipe(GT_Recipe aRecipeToRemove, GT_Recipe_Map aRecipeMap) {
+ if (aRecipeMap.mRecipeList.contains(aRecipeToRemove)) {
+ return aRecipeMap.mRecipeList.remove(aRecipeToRemove);
+ }
+ return false;
+ }
+
+ public static boolean addGtRecipe(GT_Recipe aRecipeToAdd, GT_Recipe_Map aRecipeMap) {
if (!aRecipeMap.mRecipeList.contains(aRecipeToAdd)) {
return aRecipeMap.mRecipeList.add(aRecipeToAdd);
}
- return false;
- }
-
+ return false;
+ }
+
public static boolean removeRecipeByOutput(ItemStack aOutput) {
return removeRecipeByOutput(aOutput, true, false, false);
}
- public static boolean removeRecipeByOutput(ItemStack aOutput, boolean aIgnoreNBT,
- boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) {
+ public static boolean removeRecipeByOutput(
+ ItemStack aOutput,
+ boolean aIgnoreNBT,
+ boolean aNotRemoveShapelessRecipes,
+ boolean aOnlyRemoveNativeHandlers) {
if (aOutput == null) {
return false;
} else {
@@ -622,10 +700,12 @@ public static int mInvalidID = 1;
if (!aNotRemoveShapelessRecipes
|| !(tRecipe instanceof ShapelessRecipes) && !(tRecipe instanceof ShapelessOreRecipe)) {
if (aOnlyRemoveNativeHandlers) {
- if (!gregtech.api.util.GT_ModHandler.sNativeRecipeClasses.contains(tRecipe.getClass().getName())) {
+ if (!gregtech.api.util.GT_ModHandler.sNativeRecipeClasses.contains(
+ tRecipe.getClass().getName())) {
continue;
}
- } else if (gregtech.api.util.GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) {
+ } else if (gregtech.api.util.GT_ModHandler.sSpecialRecipeClasses.contains(
+ tRecipe.getClass().getName())) {
continue;
}
@@ -642,162 +722,162 @@ public static int mInvalidID = 1;
}
}
+ public static void addSmeltingRecipe(ItemStack aStackInput, ItemStack aStackOutput) {
+ addSmeltingRecipe(aStackInput, aStackOutput, 0f);
+ }
+
+ public static void addSmeltingRecipe(ItemStack aStackInput, ItemStack aStackOutput, float aXpGained) {
+
+ GameRegistry.addSmelting(aStackInput, aStackOutput, aXpGained);
+ }
+
+ public static boolean addShapedRecipe(
+ Object Input_1,
+ Object Input_2,
+ Object Input_3,
+ Object Input_4,
+ Object Input_5,
+ Object Input_6,
+ Object Input_7,
+ Object Input_8,
+ Object Input_9,
+ ItemStack aOutputStack) {
+ return addShapedRecipe(
+ new Object[] {Input_1, Input_2, Input_3, Input_4, Input_5, Input_6, Input_7, Input_8, Input_9},
+ aOutputStack);
+ }
+
+ private static boolean addShapedRecipe(Object[] Inputs, ItemStack aOutputStack) {
+ Object[] Slots = new Object[9];
+
+ String aFullString = "";
+ String aFullStringExpanded = "abcdefghi";
+
+ for (int i = 0; i < 9; i++) {
+ Object o = Inputs[i];
+
+ if (o instanceof ItemStack) {
+ Slots[i] = ItemUtils.getSimpleStack((ItemStack) o, 1);
+ aFullString += aFullStringExpanded.charAt(i);
+ } else if (o instanceof Item) {
+ Slots[i] = ItemUtils.getSimpleStack((Item) o, 1);
+ aFullString += aFullStringExpanded.charAt(i);
+ } else if (o instanceof Block) {
+ Slots[i] = ItemUtils.getSimpleStack((Block) o, 1);
+ aFullString += aFullStringExpanded.charAt(i);
+ } else if (o instanceof String) {
+ Slots[i] = o;
+ aFullString += aFullStringExpanded.charAt(i);
+ } else if (o instanceof ItemData) {
+ ItemData aData = (ItemData) o;
+ ItemStack aStackFromGT = ItemUtils.getOrePrefixStack(aData.mPrefix, aData.mMaterial.mMaterial, 1);
+ Slots[i] = aStackFromGT;
+ aFullString += aFullStringExpanded.charAt(i);
+ } else if (o == null) {
+ Slots[i] = null;
+ aFullString += " ";
+ } else {
+ Slots[i] = null;
+ Logger.INFO("Cleaned a " + o.getClass().getSimpleName() + " from recipe input.");
+ Logger.INFO("ERROR");
+ CORE.crash("Bad Shaped Recipe.");
+ }
+ }
+ Logger.RECIPE("Using String: " + aFullString);
+
+ String aRow1 = aFullString.substring(0, 3);
+ String aRow2 = aFullString.substring(3, 6);
+ String aRow3 = aFullString.substring(6, 9);
+ Logger.RECIPE("" + aRow1);
+ Logger.RECIPE("" + aRow2);
+ Logger.RECIPE("" + aRow3);
+
+ String[] aStringData = new String[] {aRow1, aRow2, aRow3};
+ Object[] aDataObject = new Object[19];
+ aDataObject[0] = aStringData;
+ int aIndex = 0;
+
+ for (int u = 1; u < 20; u += 2) {
+ if (aIndex == 9) {
+ break;
+ }
+ if (aFullString.charAt(aIndex) != (' ')) {
+ aDataObject[u] = aFullString.charAt(aIndex);
+ aDataObject[u + 1] = Slots[aIndex];
+ Logger.INFO("(" + aIndex + ") " + aFullString.charAt(aIndex) + " | "
+ + (Slots[aIndex] instanceof ItemStack
+ ? ItemUtils.getItemName((ItemStack) Slots[aIndex])
+ : Slots[aIndex] instanceof String ? (String) Slots[aIndex] : "Unknown"));
+ }
+ aIndex++;
+ }
+
+ Logger.RECIPE("Data Size: " + aDataObject.length);
+ aDataObject = ArrayUtils.removeNulls(aDataObject);
+ Logger.RECIPE("Clean Size: " + aDataObject.length);
+ Logger.RECIPE("ArrayData: " + Arrays.toString(aDataObject));
+
+ ShapedOreRecipe aRecipe = new ShapedOreRecipe(aOutputStack, aDataObject);
+
+ /*ShapedOreRecipe aRecipe = new ShapedOreRecipe(aOutputStack,
+ aStringData,
+ 'a', Slots[0],
+ 'b', Slots[1],
+ 'c', Slots[2],
+ 'd', Slots[3],
+ 'e', Slots[4],
+ 'f', Slots[5],
+ 'g', Slots[6],
+ 'h', Slots[7],
+ 'i', Slots[8]);*/
+
+ int size = COMPAT_HANDLER.mRecipesToGenerate.size();
+ COMPAT_HANDLER.mRecipesToGenerate.put(new InternalRecipeObject2(aRecipe));
+ if (COMPAT_HANDLER.mRecipesToGenerate.size() > size) {
+ if (!COMPAT_HANDLER.areInitItemsLoaded) {
+ RegistrationHandler.recipesSuccess++;
+ } else {
+ LateRegistrationHandler.recipesSuccess++;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public static class InternalRecipeObject2 implements RunnableWithInfo<String> {
+
+ final ItemStack mOutput;
+ final ShapedOreRecipe mRecipe;
+ final boolean isValid;
- public static void addSmeltingRecipe(ItemStack aStackInput, ItemStack aStackOutput) {
- addSmeltingRecipe(aStackInput, aStackOutput, 0f);
- }
-
- public static void addSmeltingRecipe(ItemStack aStackInput, ItemStack aStackOutput, float aXpGained) {
-
- GameRegistry.addSmelting(aStackInput, aStackOutput, aXpGained);
-
- }
-
- public static boolean addShapedRecipe(
- Object Input_1, Object Input_2, Object Input_3,
- Object Input_4, Object Input_5, Object Input_6,
- Object Input_7, Object Input_8, Object Input_9,
- ItemStack aOutputStack) {
- return addShapedRecipe(new Object[] {Input_1, Input_2, Input_3, Input_4, Input_5, Input_6, Input_7, Input_8, Input_9}, aOutputStack);
- }
-
- private static boolean addShapedRecipe(Object[] Inputs, ItemStack aOutputStack) {
- Object[] Slots = new Object[9];
-
- String aFullString = "";
- String aFullStringExpanded = "abcdefghi";
-
- for (int i=0; i<9; i++) {
- Object o = Inputs[i];
-
- if (o instanceof ItemStack) {
- Slots[i] = ItemUtils.getSimpleStack((ItemStack) o, 1);
- aFullString += aFullStringExpanded.charAt(i);
- }
- else if (o instanceof Item) {
- Slots[i] = ItemUtils.getSimpleStack((Item) o, 1);
- aFullString += aFullStringExpanded.charAt(i);
- }
- else if (o instanceof Block) {
- Slots[i] = ItemUtils.getSimpleStack((Block) o, 1);
- aFullString += aFullStringExpanded.charAt(i);
- }
- else if (o instanceof String) {
- Slots[i] = o;
- aFullString += aFullStringExpanded.charAt(i);
- }
- else if (o instanceof ItemData) {
- ItemData aData = (ItemData) o;
- ItemStack aStackFromGT = ItemUtils.getOrePrefixStack(aData.mPrefix, aData.mMaterial.mMaterial, 1);
- Slots[i] = aStackFromGT;
- aFullString += aFullStringExpanded.charAt(i);
- }
- else if (o == null) {
- Slots[i] = null;
- aFullString += " ";
- }
- else {
- Slots[i] = null;
- Logger.INFO("Cleaned a "+o.getClass().getSimpleName()+" from recipe input.");
- Logger.INFO("ERROR");
- CORE.crash("Bad Shaped Recipe.");
- }
- }
- Logger.RECIPE("Using String: "+aFullString);
-
- String aRow1 = aFullString.substring(0, 3);
- String aRow2 = aFullString.substring(3, 6);
- String aRow3 = aFullString.substring(6, 9);
- Logger.RECIPE(""+aRow1);
- Logger.RECIPE(""+aRow2);
- Logger.RECIPE(""+aRow3);
-
- String[] aStringData = new String[] {aRow1, aRow2, aRow3};
- Object[] aDataObject = new Object[19];
- aDataObject[0] = aStringData;
- int aIndex = 0;
-
-
- for (int u=1;u<20;u+=2) {
- if (aIndex == 9) {
- break;
- }
- if (aFullString.charAt(aIndex) != (' ')) {
- aDataObject[u] = aFullString.charAt(aIndex);
- aDataObject[u+1] = Slots[aIndex];
- Logger.INFO("("+aIndex+") "+aFullString.charAt(aIndex)+" | "+ (Slots[aIndex] instanceof ItemStack ? ItemUtils.getItemName((ItemStack) Slots[aIndex]) : Slots[aIndex] instanceof String ? (String) Slots[aIndex] : "Unknown"));
- }
- aIndex++;
- }
-
- Logger.RECIPE("Data Size: "+aDataObject.length);
- aDataObject = ArrayUtils.removeNulls(aDataObject);
- Logger.RECIPE("Clean Size: "+aDataObject.length);
- Logger.RECIPE("ArrayData: "+Arrays.toString(aDataObject));
-
- ShapedOreRecipe aRecipe = new ShapedOreRecipe(aOutputStack, aDataObject);
-
- /*ShapedOreRecipe aRecipe = new ShapedOreRecipe(aOutputStack,
- aStringData,
- 'a', Slots[0],
- 'b', Slots[1],
- 'c', Slots[2],
- 'd', Slots[3],
- 'e', Slots[4],
- 'f', Slots[5],
- 'g', Slots[6],
- 'h', Slots[7],
- 'i', Slots[8]);*/
-
- int size = COMPAT_HANDLER.mRecipesToGenerate.size();
- COMPAT_HANDLER.mRecipesToGenerate.put(new InternalRecipeObject2(aRecipe));
- if (COMPAT_HANDLER.mRecipesToGenerate.size() > size) {
- if (!COMPAT_HANDLER.areInitItemsLoaded){
- RegistrationHandler.recipesSuccess++;
- }
- else {
- LateRegistrationHandler.recipesSuccess++;
- }
- return true;
- }
- return false;
- }
- public static class InternalRecipeObject2 implements RunnableWithInfo<String> {
-
- final ItemStack mOutput;
- final ShapedOreRecipe mRecipe;
- final boolean isValid;
-
- public InternalRecipeObject2(ShapedOreRecipe aRecipe) {
- mRecipe = aRecipe;
- mOutput = aRecipe.getRecipeOutput();
- if (mOutput != null) {
- this.isValid = true;
- }
- else {
- this.isValid = false;
- }
- }
-
- @Override
- public void run() {
- if (this.isValid) {
- GameRegistry.addRecipe(mRecipe);
- }
- else {
- Logger.INFO("[Fix] Invalid shapped recipe outputting "+mOutput != null ? mOutput.getDisplayName() : "Bad Output Item");
- }
- }
-
- @Override
- public String getInfoData() {
- if (mOutput != null && mOutput instanceof ItemStack) {
- return ((ItemStack) mOutput).getDisplayName();
- }
- return "";
- }
-
- }
+ public InternalRecipeObject2(ShapedOreRecipe aRecipe) {
+ mRecipe = aRecipe;
+ mOutput = aRecipe.getRecipeOutput();
+ if (mOutput != null) {
+ this.isValid = true;
+ } else {
+ this.isValid = false;
+ }
+ }
+ @Override
+ public void run() {
+ if (this.isValid) {
+ GameRegistry.addRecipe(mRecipe);
+ } else {
+ Logger.INFO(
+ "[Fix] Invalid shapped recipe outputting " + mOutput != null
+ ? mOutput.getDisplayName()
+ : "Bad Output Item");
+ }
+ }
+ @Override
+ public String getInfoData() {
+ if (mOutput != null && mOutput instanceof ItemStack) {
+ return ((ItemStack) mOutput).getDisplayName();
+ }
+ return "";
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ShapelessUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ShapelessUtils.java
index 3caa9d4e4f..5994bf5f67 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/ShapelessUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/ShapelessUtils.java
@@ -1,56 +1,40 @@
package gtPlusPlus.core.util.minecraft;
+import gtPlusPlus.api.objects.Logger;
import java.util.ArrayList;
-
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.ShapelessRecipes;
-import gtPlusPlus.api.objects.Logger;
-
public class ShapelessUtils {
-
- public static boolean addShapelessRecipe(final ItemStack output, final Object ... params)
- {
- final ArrayList<ItemStack> arraylist = new ArrayList<>();
- final Object[] aobject = params;
- final int i = params.length;
-
- for (int j = 0; j < i; ++j)
- {
- final Object object1 = aobject[j];
-
- if (object1 instanceof ItemStack)
- {
- arraylist.add(((ItemStack)object1).copy());
- }
- else if (object1 instanceof Item)
- {
- arraylist.add(new ItemStack((Item)object1));
- }
- else
- {
- if ((object1 == null))
- {
- Logger.INFO(("Invalid shapeless input, ignoring!"));
- }
- else if (!(object1 instanceof Block) && (object1 != null))
- {
- Logger.INFO(("Invalid shapeless recipe!"));
- return false;
- }
- else {
- arraylist.add(new ItemStack((Block)object1));
- }
- }
- }
- CraftingManager.getInstance().getRecipeList().add(new ShapelessRecipes(output, arraylist));
- //CraftingManager.getInstance().addShapelessRecipe(output, arraylist);
- return true;
- }
-
-
+ public static boolean addShapelessRecipe(final ItemStack output, final Object... params) {
+ final ArrayList<ItemStack> arraylist = new ArrayList<>();
+ final Object[] aobject = params;
+ final int i = params.length;
+
+ for (int j = 0; j < i; ++j) {
+ final Object object1 = aobject[j];
+
+ if (object1 instanceof ItemStack) {
+ arraylist.add(((ItemStack) object1).copy());
+ } else if (object1 instanceof Item) {
+ arraylist.add(new ItemStack((Item) object1));
+ } else {
+ if ((object1 == null)) {
+ Logger.INFO(("Invalid shapeless input, ignoring!"));
+ } else if (!(object1 instanceof Block) && (object1 != null)) {
+ Logger.INFO(("Invalid shapeless recipe!"));
+ return false;
+ } else {
+ arraylist.add(new ItemStack((Block) object1));
+ }
+ }
+ }
+ CraftingManager.getInstance().getRecipeList().add(new ShapelessRecipes(output, arraylist));
+ // CraftingManager.getInstance().addShapelessRecipe(output, arraylist);
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
index 242a63c712..33ef1b89e3 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
@@ -2,8 +2,6 @@ package gtPlusPlus.core.util.minecraft.gregtech;
import static gtPlusPlus.core.lib.CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK;
-import org.apache.commons.lang3.ArrayUtils;
-
import gregtech.GT_Mod;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -20,172 +18,162 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.fluids.FluidStack;
+import org.apache.commons.lang3.ArrayUtils;
public class PollutionUtils {
- private static boolean mIsPollutionEnabled = true;
-
- public static AutoMap<FluidStack> mPollutionFluidStacks = new AutoMap<FluidStack>();
-
- static {
- if (MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
- mIsPollutionEnabled = mPollution();
- } else {
- mIsPollutionEnabled = false;
- }
- }
-
- public static boolean isPollutionEnabled() {
- return mIsPollutionEnabled;
- }
-
- private static boolean mPollution() {
- return GT_Mod.gregtechproxy.mPollution;
- }
-
- public static boolean addPollution(IGregTechTileEntity te, int pollutionValue) {
- if (mIsPollutionEnabled) {
- GT_Pollution.addPollution(te, pollutionValue);
- return true;
- }
- return false;
- }
-
- public static boolean addPollution(IHasWorldObjectAndCoords aTileOfSomeSort, int pollutionValue) {
- if (mIsPollutionEnabled) {
- IHasWorldObjectAndCoords j = (IHasWorldObjectAndCoords) aTileOfSomeSort;
- Chunk c = j.getWorld().getChunkFromBlockCoords(j.getXCoord(), j.getZCoord());
- return addPollution(c, pollutionValue);
- }
- return false;
- }
-
- public static boolean addPollution(Chunk aChunk, int pollutionValue) {
- if (mIsPollutionEnabled) {
- GT_Pollution.addPollution(aChunk, pollutionValue);
- return true;
- }
- return false;
- }
-
- public static boolean removePollution(IGregTechTileEntity te, int pollutionValue) {
- return addPollution(te, -pollutionValue);
- }
-
- public static boolean removePollution(IHasWorldObjectAndCoords aTileOfSomeSort, int pollutionValue) {
- return addPollution(aTileOfSomeSort, -pollutionValue);
- }
-
- public static boolean removePollution(Chunk aChunk, int pollutionValue) {
- return addPollution(aChunk, -pollutionValue);
- }
-
- public static boolean nullifyPollution(IGregTechTileEntity te) {
- if (te == null) {
- return false;
- }
- return nullifyPollution((IHasWorldObjectAndCoords) te);
- }
-
- public static boolean nullifyPollution(IHasWorldObjectAndCoords aTileOfSomeSort) {
- if (aTileOfSomeSort == null) {
- return false;
- }
- IHasWorldObjectAndCoords j = (IHasWorldObjectAndCoords) aTileOfSomeSort;
- Chunk c = j.getWorld().getChunkFromBlockCoords(j.getXCoord(), j.getZCoord());
- return nullifyPollution(c);
- }
-
- public static boolean nullifyPollution(Chunk aChunk) {
- if (mIsPollutionEnabled) {
- if (aChunk == null) {
- return false;
- }
- int getCurrentPollution = getPollution(aChunk);
- if (getCurrentPollution <= 0) {
- return false;
- }
- else {
- return removePollution(aChunk, getCurrentPollution);
- }
- }
- return false;
- }
-
- public static int getPollution(IGregTechTileEntity te) {
- return GT_Pollution.getPollution(te);
- }
-
- public static int getPollution(Chunk te) {
- return GT_Pollution.getPollution(te);
- }
-
- public static boolean setPollutionFluids() {
- if (mPollutionFluidStacks.isEmpty()) {
- FluidStack CD, CM, SD;
- CD = FluidUtils.getFluidStack("carbondioxide", 1000);
- CM = FluidUtils.getFluidStack("carbonmonoxide", 1000);
- SD = FluidUtils.getFluidStack("sulfurdioxide", 1000);
- if (PollutionUtils.mPollutionFluidStacks.size() == 0) {
- if (CD != null) {
- Logger.INFO("[PollutionCompat] Found carbon dioxide fluid, registering it.");
- PollutionUtils.mPollutionFluidStacks.put(CD);
- MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(CD);
- ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1);
- if (ItemUtils.checkForInvalidItems(cellCD)) {
- Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component.");
- MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD);
- }
- else {
- Logger.INFO("[PollutionCompat] Did not find carbon dioxide cell, registering new component.");
- new BaseItemCell(MISC_MATERIALS.CARBON_DIOXIDE);
- }
- }
- else {
- MaterialGenerator.generate(MISC_MATERIALS.CARBON_DIOXIDE, false, false);
- }
-
- if (CM != null) {
- Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it.");
- PollutionUtils.mPollutionFluidStacks.put(CM);
- MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(CM);
- ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonMonoxide", 1);
- if (ItemUtils.checkForInvalidItems(cellCD)) {
- Logger.INFO("[PollutionCompat] Found carbon monoxide cell, registering component.");
- MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD);
- }
- else {
- Logger.INFO("[PollutionCompat] Did not find carbon monoxide cell, registering new component.");
- new BaseItemCell(MISC_MATERIALS.CARBON_MONOXIDE);
- }
- }
- else {
- MaterialGenerator.generate(MISC_MATERIALS.CARBON_MONOXIDE, false, false);
- }
-
- if (SD != null) {
- Logger.INFO("[PollutionCompat] Found sulfur dioxide fluid, registering it.");
- PollutionUtils.mPollutionFluidStacks.put(SD);
- }
- }
- if (PollutionUtils.mPollutionFluidStacks.size() > 0) {
- return true;
- }
- return false;
- }
- else {
- if (mPollutionFluidStacks.size() != 3) {
- Logger.INFO("Unable to detect all 3 pollution fluids. Found: ");
- Logger.INFO(ArrayUtils.toString(mPollutionFluidStacks));
- return false;
- }
- else {
- return true;
- }
- }
-
-
-
- }
-
+ private static boolean mIsPollutionEnabled = true;
+
+ public static AutoMap<FluidStack> mPollutionFluidStacks = new AutoMap<FluidStack>();
+
+ static {
+ if (MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
+ mIsPollutionEnabled = mPollution();
+ } else {
+ mIsPollutionEnabled = false;
+ }
+ }
+
+ public static boolean isPollutionEnabled() {
+ return mIsPollutionEnabled;
+ }
+
+ private static boolean mPollution() {
+ return GT_Mod.gregtechproxy.mPollution;
+ }
+
+ public static boolean addPollution(IGregTechTileEntity te, int pollutionValue) {
+ if (mIsPollutionEnabled) {
+ GT_Pollution.addPollution(te, pollutionValue);
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean addPollution(IHasWorldObjectAndCoords aTileOfSomeSort, int pollutionValue) {
+ if (mIsPollutionEnabled) {
+ IHasWorldObjectAndCoords j = (IHasWorldObjectAndCoords) aTileOfSomeSort;
+ Chunk c = j.getWorld().getChunkFromBlockCoords(j.getXCoord(), j.getZCoord());
+ return addPollution(c, pollutionValue);
+ }
+ return false;
+ }
+
+ public static boolean addPollution(Chunk aChunk, int pollutionValue) {
+ if (mIsPollutionEnabled) {
+ GT_Pollution.addPollution(aChunk, pollutionValue);
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean removePollution(IGregTechTileEntity te, int pollutionValue) {
+ return addPollution(te, -pollutionValue);
+ }
+
+ public static boolean removePollution(IHasWorldObjectAndCoords aTileOfSomeSort, int pollutionValue) {
+ return addPollution(aTileOfSomeSort, -pollutionValue);
+ }
+
+ public static boolean removePollution(Chunk aChunk, int pollutionValue) {
+ return addPollution(aChunk, -pollutionValue);
+ }
+
+ public static boolean nullifyPollution(IGregTechTileEntity te) {
+ if (te == null) {
+ return false;
+ }
+ return nullifyPollution((IHasWorldObjectAndCoords) te);
+ }
+
+ public static boolean nullifyPollution(IHasWorldObjectAndCoords aTileOfSomeSort) {
+ if (aTileOfSomeSort == null) {
+ return false;
+ }
+ IHasWorldObjectAndCoords j = (IHasWorldObjectAndCoords) aTileOfSomeSort;
+ Chunk c = j.getWorld().getChunkFromBlockCoords(j.getXCoord(), j.getZCoord());
+ return nullifyPollution(c);
+ }
+
+ public static boolean nullifyPollution(Chunk aChunk) {
+ if (mIsPollutionEnabled) {
+ if (aChunk == null) {
+ return false;
+ }
+ int getCurrentPollution = getPollution(aChunk);
+ if (getCurrentPollution <= 0) {
+ return false;
+ } else {
+ return removePollution(aChunk, getCurrentPollution);
+ }
+ }
+ return false;
+ }
+
+ public static int getPollution(IGregTechTileEntity te) {
+ return GT_Pollution.getPollution(te);
+ }
+
+ public static int getPollution(Chunk te) {
+ return GT_Pollution.getPollution(te);
+ }
+
+ public static boolean setPollutionFluids() {
+ if (mPollutionFluidStacks.isEmpty()) {
+ FluidStack CD, CM, SD;
+ CD = FluidUtils.getFluidStack("carbondioxide", 1000);
+ CM = FluidUtils.getFluidStack("carbonmonoxide", 1000);
+ SD = FluidUtils.getFluidStack("sulfurdioxide", 1000);
+ if (PollutionUtils.mPollutionFluidStacks.size() == 0) {
+ if (CD != null) {
+ Logger.INFO("[PollutionCompat] Found carbon dioxide fluid, registering it.");
+ PollutionUtils.mPollutionFluidStacks.put(CD);
+ MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(CD);
+ ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1);
+ if (ItemUtils.checkForInvalidItems(cellCD)) {
+ Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component.");
+ MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD);
+ } else {
+ Logger.INFO("[PollutionCompat] Did not find carbon dioxide cell, registering new component.");
+ new BaseItemCell(MISC_MATERIALS.CARBON_DIOXIDE);
+ }
+ } else {
+ MaterialGenerator.generate(MISC_MATERIALS.CARBON_DIOXIDE, false, false);
+ }
+
+ if (CM != null) {
+ Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it.");
+ PollutionUtils.mPollutionFluidStacks.put(CM);
+ MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(CM);
+ ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonMonoxide", 1);
+ if (ItemUtils.checkForInvalidItems(cellCD)) {
+ Logger.INFO("[PollutionCompat] Found carbon monoxide cell, registering component.");
+ MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD);
+ } else {
+ Logger.INFO("[PollutionCompat] Did not find carbon monoxide cell, registering new component.");
+ new BaseItemCell(MISC_MATERIALS.CARBON_MONOXIDE);
+ }
+ } else {
+ MaterialGenerator.generate(MISC_MATERIALS.CARBON_MONOXIDE, false, false);
+ }
+
+ if (SD != null) {
+ Logger.INFO("[PollutionCompat] Found sulfur dioxide fluid, registering it.");
+ PollutionUtils.mPollutionFluidStacks.put(SD);
+ }
+ }
+ if (PollutionUtils.mPollutionFluidStacks.size() > 0) {
+ return true;
+ }
+ return false;
+ } else {
+ if (mPollutionFluidStacks.size() != 3) {
+ Logger.INFO("Unable to detect all 3 pollution fluids. Found: ");
+ Logger.INFO(ArrayUtils.toString(mPollutionFluidStacks));
+ return false;
+ } else {
+ return true;
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/material/MaterialBuilder.java b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/material/MaterialBuilder.java
index 44c0f66732..1b35ead9f1 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/material/MaterialBuilder.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/material/MaterialBuilder.java
@@ -1,244 +1,244 @@
package gtPlusPlus.core.util.minecraft.gregtech.material;
public class MaterialBuilder {
- /*public static final int DIESEL = 0, GAS = 1, THERMAL = 2, SEMIFLUID = 3, PLASMA = 4, MAGIC = 5;
-
- private int metaItemSubID;
- private TextureSet iconSet;
- private float toolSpeed = 1.0f;
- private int durability = 0;
- private int toolQuality = 0;
- private int types = 0;
- private int r = 255, g = 255, b = 255, a = 0;
- private String name;
- private String defaultLocalName;
- private int fuelType = 0;
- private int fuelPower = 0;
- private int meltingPoint = 0;
- private int blastFurnaceTemp = 0;
- private boolean blastFurnaceRequired = false;
- private boolean transparent = false;
- private int oreValue = 1;
- private int densityMultiplier = 1;
- private int densityDivider = 1;
- private Dyes color = Dyes._NULL;
- private int extraData = 0;
- private List<MaterialStack> materialList = new ArrayList<MaterialStack>();
- private List<TC_Aspects.TC_AspectStack> aspects = new ArrayList<TC_Aspects.TC_AspectStack>();
- private boolean canBeCracked = false;
- private int liquidTemperature = 300;
- private int gasTemperature = 300;
-
- public MaterialBuilder(int metaItemSubID, TextureSet iconSet, String defaultLocalName) {
- this.metaItemSubID = metaItemSubID;
- this.iconSet = iconSet;
- this.name = defaultLocalName.replace(" ", "").replace("-", "");
- this.defaultLocalName = defaultLocalName;
- }
-
- public Materials constructMaterial() {
- return new Materials(
- metaItemSubID, iconSet, toolSpeed, durability, toolQuality, types, r, g, b, a, name, defaultLocalName, fuelType, fuelPower, meltingPoint, blastFurnaceTemp,
- blastFurnaceRequired, transparent, oreValue, densityMultiplier, densityDivider, color, extraData, materialList, aspects);
-
- }
-
- public MaterialBuilder setName(String name){
- this.name = name;
- return this;
- }
-
- public MaterialBuilder setTypes(int types){
- this.types = types;
- return this;
- }
-
- public MaterialBuilder addDustItems(){
- types = types | 1;
- return this;
- }
-
- public MaterialBuilder addMetalItems(){
- types = types | 2;
- return this;
- }
-
- public MaterialBuilder addGemItems(){
- types = types | 4;
- return this;
- }
-
- public MaterialBuilder addOreItems(){
- types = types | 8;
- return this;
- }
-
- public MaterialBuilder addCell(){
- types = types | 16;
- return this;
- }
-
- public MaterialBuilder addPlasma(){
- types = types | 32;
- return this;
- }
-
- public MaterialBuilder addToolHeadItems(){
- types = types | 64;
- return this;
- }
-
- public MaterialBuilder addGearItems(){
- types = types | 128;
- return this;
- }
-
- public MaterialBuilder addFluid(){
- return this;
- }
-
- public MaterialBuilder addGas(){
- return this;
- }
-
-
- public MaterialBuilder setRGBA(int r, int g, int b, int a){
- this.r = r;
- this.g = g;
- this.b = b;
- this.a = a;
- return this;
- }
-
- public MaterialBuilder setRGB(int r, int g, int b){
- this.r = r;
- this.g = g;
- this.b = b;
- return this;
- }
-
- public MaterialBuilder setTransparent(boolean transparent){
- this.transparent = transparent;
- return this;
- }
-
- public MaterialBuilder setColor(Dyes color){
- this.color = color;
- return this;
- }
-
-
- public MaterialBuilder setToolSpeed(float toolSpeed) {
- this.toolSpeed = toolSpeed;
- return this;
- }
-
- public MaterialBuilder setDurability(int durability) {
- this.durability = durability;
- return this;
- }
-
- public MaterialBuilder setToolQuality(int toolQuality) {
- this.toolQuality = toolQuality;
- return this;
- }
-
-
- public MaterialBuilder setFuelType(int fuelType) {
- this.fuelType = fuelType;
- return this;
- }
-
- public MaterialBuilder setFuelPower(int fuelPower) {
- this.fuelPower = fuelPower;
- return this;
- }
-
- public MaterialBuilder setMeltingPoint(int meltingPoint) {
- this.meltingPoint = meltingPoint;
- return this;
- }
-
- public MaterialBuilder setBlastFurnaceTemp(int blastFurnaceTemp) {
- this.blastFurnaceTemp = blastFurnaceTemp;
- return this;
- }
-
- public MaterialBuilder setBlastFurnaceRequired(boolean blastFurnaceRequired) {
- this.blastFurnaceRequired = blastFurnaceRequired;
- return this;
- }
-
- public MaterialBuilder setOreValue(int oreValue) {
- this.oreValue = oreValue;
- return this;
- }
-
- public MaterialBuilder setDensityMultiplier(int densityMultiplier) {
- this.densityMultiplier = densityMultiplier;
- return this;
- }
-
- public MaterialBuilder setDensityDivider(int densityDivider) {
- this.densityDivider = densityDivider;
- return this;
- }
-
- public MaterialBuilder setExtraData(int extraData) {
- this.extraData = extraData;
- return this;
- }
-
- public MaterialBuilder addElectrolyzerRecipe(){
- extraData = extraData | 1;
- return this;
- }
-
- public MaterialBuilder addCentrifugeRecipe(){
- extraData = extraData | 2;
- return this;
- }
-
- public MaterialBuilder setMaterialList(List<MaterialStack> materialList) {
- this.materialList = materialList;
- return this;
- }
-
- public MaterialBuilder setMaterialList(MaterialStack ... materials) {
- this.materialList = Arrays.asList(materials);
- return this;
- }
-
- public MaterialBuilder setAspects(List<TC_Aspects.TC_AspectStack> aspects) {
- this.aspects = aspects;
- return this;
- }
-
- public int getLiquidTemperature() {
- return liquidTemperature;
- }
-
- public MaterialBuilder setLiquidTemperature(int liquidTemperature) {
- this.liquidTemperature = liquidTemperature;
- return this;
- }
-
- public int getGasTemperature() {
- return gasTemperature;
- }
-
- public MaterialBuilder setGasTemperature(int gasTemperature) {
- this.gasTemperature = gasTemperature;
- return this;
- }
-
- public boolean canBeCracked() {
- return canBeCracked;
- }
-
- public MaterialBuilder setCanBeCracked(boolean canBeCracked) {
- this.canBeCracked = canBeCracked;
- return this;
- }
-*/
-} \ No newline at end of file
+ /*public static final int DIESEL = 0, GAS = 1, THERMAL = 2, SEMIFLUID = 3, PLASMA = 4, MAGIC = 5;
+
+ private int metaItemSubID;
+ private TextureSet iconSet;
+ private float toolSpeed = 1.0f;
+ private int durability = 0;
+ private int toolQuality = 0;
+ private int types = 0;
+ private int r = 255, g = 255, b = 255, a = 0;
+ private String name;
+ private String defaultLocalName;
+ private int fuelType = 0;
+ private int fuelPower = 0;
+ private int meltingPoint = 0;
+ private int blastFurnaceTemp = 0;
+ private boolean blastFurnaceRequired = false;
+ private boolean transparent = false;
+ private int oreValue = 1;
+ private int densityMultiplier = 1;
+ private int densityDivider = 1;
+ private Dyes color = Dyes._NULL;
+ private int extraData = 0;
+ private List<MaterialStack> materialList = new ArrayList<MaterialStack>();
+ private List<TC_Aspects.TC_AspectStack> aspects = new ArrayList<TC_Aspects.TC_AspectStack>();
+ private boolean canBeCracked = false;
+ private int liquidTemperature = 300;
+ private int gasTemperature = 300;
+
+ public MaterialBuilder(int metaItemSubID, TextureSet iconSet, String defaultLocalName) {
+ this.metaItemSubID = metaItemSubID;
+ this.iconSet = iconSet;
+ this.name = defaultLocalName.replace(" ", "").replace("-", "");
+ this.defaultLocalName = defaultLocalName;
+ }
+
+ public Materials constructMaterial() {
+ return new Materials(
+ metaItemSubID, iconSet, toolSpeed, durability, toolQuality, types, r, g, b, a, name, defaultLocalName, fuelType, fuelPower, meltingPoint, blastFurnaceTemp,
+ blastFurnaceRequired, transparent, oreValue, densityMultiplier, densityDivider, color, extraData, materialList, aspects);
+
+ }
+
+ public MaterialBuilder setName(String name){
+ this.name = name;
+ return this;
+ }
+
+ public MaterialBuilder setTypes(int types){
+ this.types = types;
+ return this;
+ }
+
+ public MaterialBuilder addDustItems(){
+ types = types | 1;
+ return this;
+ }
+
+ public MaterialBuilder addMetalItems(){
+ types = types | 2;
+ return this;
+ }
+
+ public MaterialBuilder addGemItems(){
+ types = types | 4;
+ return this;
+ }
+
+ public MaterialBuilder addOreItems(){
+ types = types | 8;
+ return this;
+ }
+
+ public MaterialBuilder addCell(){
+ types = types | 16;
+ return this;
+ }
+
+ public MaterialBuilder addPlasma(){
+ types = types | 32;
+ return this;
+ }
+
+ public MaterialBuilder addToolHeadItems(){
+ types = types | 64;
+ return this;
+ }
+
+ public MaterialBuilder addGearItems(){
+ types = types | 128;
+ return this;
+ }
+
+ public MaterialBuilder addFluid(){
+ return this;
+ }
+
+ public MaterialBuilder addGas(){
+ return this;
+ }
+
+
+ public MaterialBuilder setRGBA(int r, int g, int b, int a){
+ this.r = r;
+ this.g = g;
+ this.b = b;
+ this.a = a;
+ return this;
+ }
+
+ public MaterialBuilder setRGB(int r, int g, int b){
+ this.r = r;
+ this.g = g;
+ this.b = b;
+ return this;
+ }
+
+ public MaterialBuilder setTransparent(boolean transparent){
+ this.transparent = transparent;
+ return this;
+ }
+
+ public MaterialBuilder setColor(Dyes color){
+ this.color = color;
+ return this;
+ }
+
+
+ public MaterialBuilder setToolSpeed(float toolSpeed) {
+ this.toolSpeed = toolSpeed;
+ return this;
+ }
+
+ public MaterialBuilder setDurability(int durability) {
+ this.durability = durability;
+ return this;
+ }
+
+ public MaterialBuilder setToolQuality(int toolQuality) {
+ this.toolQuality = toolQuality;
+ return this;
+ }
+
+
+ public MaterialBuilder setFuelType(int fuelType) {
+ this.fuelType = fuelType;
+ return this;
+ }
+
+ public MaterialBuilder setFuelPower(int fuelPower) {
+ this.fuelPower = fuelPower;
+ return this;
+ }
+
+ public MaterialBuilder setMeltingPoint(int meltingPoint) {
+ this.meltingPoint = meltingPoint;
+ return this;
+ }
+
+ public MaterialBuilder setBlastFurnaceTemp(int blastFurnaceTemp) {
+ this.blastFurnaceTemp = blastFurnaceTemp;
+ return this;
+ }
+
+ public MaterialBuilder setBlastFurnaceRequired(boolean blastFurnaceRequired) {
+ this.blastFurnaceRequired = blastFurnaceRequired;
+ return this;
+ }
+
+ public MaterialBuilder setOreValue(int oreValue) {
+ this.oreValue = oreValue;
+ return this;
+ }
+
+ public MaterialBuilder setDensityMultiplier(int densityMultiplier) {
+ this.densityMultiplier = densityMultiplier;
+ return this;
+ }
+
+ public MaterialBuilder setDensityDivider(int densityDivider) {
+ this.densityDivider = densityDivider;
+ return this;
+ }
+
+ public MaterialBuilder setExtraData(int extraData) {
+ this.extraData = extraData;
+ return this;
+ }
+
+ public MaterialBuilder addElectrolyzerRecipe(){
+ extraData = extraData | 1;
+ return this;
+ }
+
+ public MaterialBuilder addCentrifugeRecipe(){
+ extraData = extraData | 2;
+ return this;
+ }
+
+ public MaterialBuilder setMaterialList(List<MaterialStack> materialList) {
+ this.materialList = materialList;
+ return this;
+ }
+
+ public MaterialBuilder setMaterialList(MaterialStack ... materials) {
+ this.materialList = Arrays.asList(materials);
+ return this;
+ }
+
+ public MaterialBuilder setAspects(List<TC_Aspects.TC_AspectStack> aspects) {
+ this.aspects = aspects;
+ return this;
+ }
+
+ public int getLiquidTemperature() {
+ return liquidTemperature;
+ }
+
+ public MaterialBuilder setLiquidTemperature(int liquidTemperature) {
+ this.liquidTemperature = liquidTemperature;
+ return this;
+ }
+
+ public int getGasTemperature() {
+ return gasTemperature;
+ }
+
+ public MaterialBuilder setGasTemperature(int gasTemperature) {
+ this.gasTemperature = gasTemperature;
+ return this;
+ }
+
+ public boolean canBeCracked() {
+ return canBeCracked;
+ }
+
+ public MaterialBuilder setCanBeCracked(boolean canBeCracked) {
+ this.canBeCracked = canBeCracked;
+ return this;
+ }
+ */
+}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/recipehandlers/GregtechRecipe.java b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/recipehandlers/GregtechRecipe.java
index 635239bbfc..cbd92c3f4e 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/recipehandlers/GregtechRecipe.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/recipehandlers/GregtechRecipe.java
@@ -1,3 +1,3 @@
package gtPlusPlus.core.util.minecraft.gregtech.recipehandlers;
-public final class GregtechRecipe {} \ No newline at end of file
+public final class GregtechRecipe {}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/network/CustomPacket.java b/src/main/java/gtPlusPlus/core/util/minecraft/network/CustomPacket.java
index def836eac9..6a7a33bd8e 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/network/CustomPacket.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/network/CustomPacket.java
@@ -9,31 +9,31 @@ import java.io.IOException;
import mods.railcraft.common.util.misc.Game;
public abstract class CustomPacket {
- public static final String CHANNEL_NAME = "GTPP";
+ public static final String CHANNEL_NAME = "GTPP";
- public enum PacketType {
+ public enum PacketType {
TILE_ENTITY,
- }
-
- public FMLProxyPacket getPacket() {
- ByteArrayOutputStream bytes = new ByteArrayOutputStream();
- DataOutputStream data = new DataOutputStream(bytes);
- try {
- data.writeByte(this.getID());
- this.writeData(data);
- } catch (IOException var4) {
- Game.logThrowable("Error constructing packet: {0}", var4, new Object[]{this.getClass()});
- }
- return new FMLProxyPacket(Unpooled.wrappedBuffer(bytes.toByteArray()), "GTPP");
- }
-
- public abstract void writeData(DataOutputStream var1) throws IOException;
-
- public abstract void readData(DataInputStream var1) throws IOException;
-
- public abstract int getID();
-
- public String toString() {
- return this.getClass().getSimpleName();
- }
-} \ No newline at end of file
+ }
+
+ public FMLProxyPacket getPacket() {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ DataOutputStream data = new DataOutputStream(bytes);
+ try {
+ data.writeByte(this.getID());
+ this.writeData(data);
+ } catch (IOException var4) {
+ Game.logThrowable("Error constructing packet: {0}", var4, new Object[] {this.getClass()});
+ }
+ return new FMLProxyPacket(Unpooled.wrappedBuffer(bytes.toByteArray()), "GTPP");
+ }
+
+ public abstract void writeData(DataOutputStream var1) throws IOException;
+
+ public abstract void readData(DataInputStream var1) throws IOException;
+
+ public abstract int getID();
+
+ public String toString() {
+ return this.getClass().getSimpleName();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketBuilder.java b/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketBuilder.java
index edbc6aaf83..30e981b1a0 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketBuilder.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketBuilder.java
@@ -4,22 +4,21 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.world.WorldServer;
public class PacketBuilder {
-
- private static PacketBuilder instance;
- public static PacketBuilder instance() {
- if (instance == null) {
- instance = new PacketBuilder();
- }
- return instance;
- }
+ private static PacketBuilder instance;
- public void sendTileEntityPacket(IGregTechTileEntity tile) {
- if (tile.getWorld() instanceof WorldServer) {
- WorldServer world = (WorldServer) tile.getWorld();
- PacketTileEntity pkt = new PacketTileEntity(tile);
- PacketDispatcher.sendToWatchers(pkt, world, tile.getXCoord(), tile.getZCoord());
- }
- }
-
-} \ No newline at end of file
+ public static PacketBuilder instance() {
+ if (instance == null) {
+ instance = new PacketBuilder();
+ }
+ return instance;
+ }
+
+ public void sendTileEntityPacket(IGregTechTileEntity tile) {
+ if (tile.getWorld() instanceof WorldServer) {
+ WorldServer world = (WorldServer) tile.getWorld();
+ PacketTileEntity pkt = new PacketTileEntity(tile);
+ PacketDispatcher.sendToWatchers(pkt, world, tile.getXCoord(), tile.getZCoord());
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketDispatcher.java b/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketDispatcher.java
index f61a6f2b6c..4b6fc5aa85 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketDispatcher.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketDispatcher.java
@@ -4,7 +4,6 @@ import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.ReflectionHelper;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.preloader.DevHelper;
-
import java.lang.reflect.Method;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.Packet;
@@ -13,76 +12,78 @@ import net.minecraft.world.WorldServer;
@SuppressWarnings("unchecked")
public class PacketDispatcher {
- private static final Class playerInstanceClass;
- private static final Method getOrCreateChunkWatcher;
- private static final Method sendToAllPlayersWatchingChunk;
+ private static final Class playerInstanceClass;
+ private static final Method getOrCreateChunkWatcher;
+ private static final Method sendToAllPlayersWatchingChunk;
- public static void sendToServer(CustomPacket packet) {
- PacketHandler.INSTANCE.channel.sendToServer(packet.getPacket());
- }
+ public static void sendToServer(CustomPacket packet) {
+ PacketHandler.INSTANCE.channel.sendToServer(packet.getPacket());
+ }
- public static void sendToPlayer(CustomPacket packet, EntityPlayerMP player) {
- PacketHandler.INSTANCE.channel.sendTo(packet.getPacket(), player);
- }
+ public static void sendToPlayer(CustomPacket packet, EntityPlayerMP player) {
+ PacketHandler.INSTANCE.channel.sendTo(packet.getPacket(), player);
+ }
- public static void sendToAll(CustomPacket packet) {
- PacketHandler.INSTANCE.channel.sendToAll(packet.getPacket());
- }
+ public static void sendToAll(CustomPacket packet) {
+ PacketHandler.INSTANCE.channel.sendToAll(packet.getPacket());
+ }
- public static void sendToAllAround(CustomPacket packet, TargetPoint zone) {
- PacketHandler.INSTANCE.channel.sendToAllAround(packet.getPacket(), zone);
- }
+ public static void sendToAllAround(CustomPacket packet, TargetPoint zone) {
+ PacketHandler.INSTANCE.channel.sendToAllAround(packet.getPacket(), zone);
+ }
- public static void sendToDimension(CustomPacket packet, int dimensionId) {
- PacketHandler.INSTANCE.channel.sendToDimension(packet.getPacket(), dimensionId);
- }
+ public static void sendToDimension(CustomPacket packet, int dimensionId) {
+ PacketHandler.INSTANCE.channel.sendToDimension(packet.getPacket(), dimensionId);
+ }
- public static void sendToWatchers(CustomPacket packet, WorldServer world, int worldX, int worldZ) {
- try {
- Object playerInstance = getOrCreateChunkWatcher.invoke(world.getPlayerManager(), worldX >> 4, worldZ >> 4,
- false);
- if (playerInstance != null) {
- sendToAllPlayersWatchingChunk.invoke(playerInstance, packet.getPacket());
- }
+ public static void sendToWatchers(CustomPacket packet, WorldServer world, int worldX, int worldZ) {
+ try {
+ Object playerInstance =
+ getOrCreateChunkWatcher.invoke(world.getPlayerManager(), worldX >> 4, worldZ >> 4, false);
+ if (playerInstance != null) {
+ sendToAllPlayersWatchingChunk.invoke(playerInstance, packet.getPacket());
+ }
- } catch (Exception var5) {
- Logger.ERROR("Reflection Failure in PacketDispatcher.sendToWatchers() {0} {1}" + 20 + var5 +
- new Object[]{getOrCreateChunkWatcher.getName() + sendToAllPlayersWatchingChunk.getName()});
- throw new RuntimeException(var5);
- }
- }
+ } catch (Exception var5) {
+ Logger.ERROR("Reflection Failure in PacketDispatcher.sendToWatchers() {0} {1}" + 20 + var5
+ + new Object[] {getOrCreateChunkWatcher.getName() + sendToAllPlayersWatchingChunk.getName()});
+ throw new RuntimeException(var5);
+ }
+ }
- static {
- try {
- playerInstanceClass = PlayerManager.class.getDeclaredClasses()[0];
+ static {
+ try {
+ playerInstanceClass = PlayerManager.class.getDeclaredClasses()[0];
- Method a, b;
-
- try {
- a = DevHelper.getForgeMethod(PlayerManager.class, "getOrCreateChunkWatcher", int.class, int.class, boolean.class);
- }
- catch (Throwable t) {
- a = ReflectionHelper.findMethod(playerInstanceClass, (Object) null,
- new String[]{"func_72690_a", "getOrCreateChunkWatcher"},
- new Class[]{Integer.TYPE, Integer.TYPE, Boolean.TYPE});
- }
- try {
- b = DevHelper.getForgeMethod(PlayerManager.class, "sendToAllPlayersWatchingChunk", Packet.class);
- }
- catch (Throwable t) {
- b = ReflectionHelper.findMethod(playerInstanceClass, (Object) null,
- new String[]{"func_151251_a", "sendToAllPlayersWatchingChunk"},
- new Class[]{Packet.class});
- }
+ Method a, b;
+ try {
+ a = DevHelper.getForgeMethod(
+ PlayerManager.class, "getOrCreateChunkWatcher", int.class, int.class, boolean.class);
+ } catch (Throwable t) {
+ a = ReflectionHelper.findMethod(
+ playerInstanceClass,
+ (Object) null,
+ new String[] {"func_72690_a", "getOrCreateChunkWatcher"},
+ new Class[] {Integer.TYPE, Integer.TYPE, Boolean.TYPE});
+ }
+ try {
+ b = DevHelper.getForgeMethod(PlayerManager.class, "sendToAllPlayersWatchingChunk", Packet.class);
+ } catch (Throwable t) {
+ b = ReflectionHelper.findMethod(
+ playerInstanceClass,
+ (Object) null,
+ new String[] {"func_151251_a", "sendToAllPlayersWatchingChunk"},
+ new Class[] {Packet.class});
+ }
- getOrCreateChunkWatcher = a;
- sendToAllPlayersWatchingChunk = b;
- getOrCreateChunkWatcher.setAccessible(true);
- sendToAllPlayersWatchingChunk.setAccessible(true);
- } catch (Exception var1) {
- Logger.ERROR("Reflection Failure in PacketDispatcher initalization {0} {1}" + var1);
- throw new RuntimeException(var1);
- }
- }
-} \ No newline at end of file
+ getOrCreateChunkWatcher = a;
+ sendToAllPlayersWatchingChunk = b;
+ getOrCreateChunkWatcher.setAccessible(true);
+ sendToAllPlayersWatchingChunk.setAccessible(true);
+ } catch (Exception var1) {
+ Logger.ERROR("Reflection Failure in PacketDispatcher initalization {0} {1}" + var1);
+ throw new RuntimeException(var1);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketHandler.java b/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketHandler.java
index 158f9f9483..bd7e1fbcb8 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketHandler.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketHandler.java
@@ -2,11 +2,11 @@ package gtPlusPlus.core.util.minecraft.network;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.FMLEventChannel;
+import cpw.mods.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent;
+import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.network.CustomPacket.PacketType;
-import cpw.mods.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent;
-import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
@@ -15,57 +15,55 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.NetHandlerPlayServer;
public class PacketHandler {
- public static final PacketHandler INSTANCE = new PacketHandler();
- private static final PacketType[] packetTypes = PacketType.values();
- final FMLEventChannel channel;
+ public static final PacketHandler INSTANCE = new PacketHandler();
+ private static final PacketType[] packetTypes = PacketType.values();
+ final FMLEventChannel channel;
- private PacketHandler() {
- this.channel = NetworkRegistry.INSTANCE.newEventDrivenChannel("GTPP");
- this.channel.register(this);
- }
+ private PacketHandler() {
+ this.channel = NetworkRegistry.INSTANCE.newEventDrivenChannel("GTPP");
+ this.channel.register(this);
+ }
- public static void init() {
- }
+ public static void init() {}
- @SubscribeEvent
- public void onPacket(ServerCustomPacketEvent event) {
- byte[] data = new byte[event.packet.payload().readableBytes()];
- event.packet.payload().readBytes(data);
- this.onPacketData(data, ((NetHandlerPlayServer) event.handler).playerEntity);
- }
+ @SubscribeEvent
+ public void onPacket(ServerCustomPacketEvent event) {
+ byte[] data = new byte[event.packet.payload().readableBytes()];
+ event.packet.payload().readBytes(data);
+ this.onPacketData(data, ((NetHandlerPlayServer) event.handler).playerEntity);
+ }
- @SubscribeEvent
- public void onPacket(ClientCustomPacketEvent event) {
- byte[] data = new byte[event.packet.payload().readableBytes()];
- event.packet.payload().readBytes(data);
- this.onPacketData(data, (EntityPlayerMP) null);
- }
+ @SubscribeEvent
+ public void onPacket(ClientCustomPacketEvent event) {
+ byte[] data = new byte[event.packet.payload().readableBytes()];
+ event.packet.payload().readBytes(data);
+ this.onPacketData(data, (EntityPlayerMP) null);
+ }
- public void onPacketData(byte[] bData, EntityPlayerMP player) {
- DataInputStream data = new DataInputStream(new ByteArrayInputStream(bData));
+ public void onPacketData(byte[] bData, EntityPlayerMP player) {
+ DataInputStream data = new DataInputStream(new ByteArrayInputStream(bData));
- try {
- byte packetID = data.readByte();
- if (packetID < 0) {
- return;
- }
- PacketType type = packetTypes[packetID];
- Object pkt;
-
- switch(type.ordinal()) {
- case 0:
- pkt = new PacketTileEntity();
- break;
- default:
- return;
- }
+ try {
+ byte packetID = data.readByte();
+ if (packetID < 0) {
+ return;
+ }
+ PacketType type = packetTypes[packetID];
+ Object pkt;
- if (pkt != null) {
- ((CustomPacket)pkt).readData(data);
- }
- } catch (IOException var7) {
- Logger.ERROR("Exception in PacketHandler.onPacketData: {0}"+ var7 + new Object[]{Arrays.toString(bData)});
- }
+ switch (type.ordinal()) {
+ case 0:
+ pkt = new PacketTileEntity();
+ break;
+ default:
+ return;
+ }
- }
-} \ No newline at end of file
+ if (pkt != null) {
+ ((CustomPacket) pkt).readData(data);
+ }
+ } catch (IOException var7) {
+ Logger.ERROR("Exception in PacketHandler.onPacketData: {0}" + var7 + new Object[] {Arrays.toString(bData)});
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketTileEntity.java b/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketTileEntity.java
index d59bee3c27..265d78a7f4 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketTileEntity.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/network/PacketTileEntity.java
@@ -5,7 +5,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.api.interfaces.IGregtechPacketEntity;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -15,65 +14,64 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class PacketTileEntity extends CustomPacket {
- private IGregTechTileEntity tile;
- private IGregtechPacketEntity ptile;
+ private IGregTechTileEntity tile;
+ private IGregtechPacketEntity ptile;
- public PacketTileEntity() {
- }
+ public PacketTileEntity() {}
- public PacketTileEntity(IGregTechTileEntity tile) {
- this.tile = tile;
- if (tile instanceof IGregtechPacketEntity) {
- ptile = (IGregtechPacketEntity) tile;
- }
- }
+ public PacketTileEntity(IGregTechTileEntity tile) {
+ this.tile = tile;
+ if (tile instanceof IGregtechPacketEntity) {
+ ptile = (IGregtechPacketEntity) tile;
+ }
+ }
- public void writeData(DataOutputStream data) throws IOException {
- if (ptile != null) {
- data.writeInt(this.tile.getXCoord());
- data.writeInt(this.tile.getYCoord());
- data.writeInt(this.tile.getZCoord());
- data.writeShort(this.tile.getMetaTileID());
- this.ptile.writePacketData(data);
- }
- }
+ public void writeData(DataOutputStream data) throws IOException {
+ if (ptile != null) {
+ data.writeInt(this.tile.getXCoord());
+ data.writeInt(this.tile.getYCoord());
+ data.writeInt(this.tile.getZCoord());
+ data.writeShort(this.tile.getMetaTileID());
+ this.ptile.writePacketData(data);
+ }
+ }
- @SideOnly(Side.CLIENT)
- public void readData(DataInputStream data) throws IOException {
- Minecraft mc = FMLClientHandler.instance().getClient();
- World world = mc != null ? mc.theWorld : null;
- if (world != null) {
- int x = data.readInt();
- int y = data.readInt();
- int z = data.readInt();
- short id = data.readShort();
- if (id >= 0 && y >= 0 && world.blockExists(x, y, z)) {
- TileEntity te = world.getTileEntity(x, y, z);
- if (te instanceof IGregTechTileEntity) {
- this.tile = (IGregTechTileEntity) te;
- if (this.tile.getMetaTileID() != id) {
- this.tile = null;
- }
- } else {
- this.tile = null;
- }
- if (this.tile != null) {
- if (tile instanceof IGregtechPacketEntity) {
- ptile = (IGregtechPacketEntity) tile;
- try {
- this.ptile.readPacketData(data);
- } catch (IOException var10) {
- throw var10;
- } catch (RuntimeException var11) {
- Game.logThrowable("Exception in PacketTileEntity.readData:", var11, new Object[0]);
- }
- }
- }
- }
- }
- }
+ @SideOnly(Side.CLIENT)
+ public void readData(DataInputStream data) throws IOException {
+ Minecraft mc = FMLClientHandler.instance().getClient();
+ World world = mc != null ? mc.theWorld : null;
+ if (world != null) {
+ int x = data.readInt();
+ int y = data.readInt();
+ int z = data.readInt();
+ short id = data.readShort();
+ if (id >= 0 && y >= 0 && world.blockExists(x, y, z)) {
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te instanceof IGregTechTileEntity) {
+ this.tile = (IGregTechTileEntity) te;
+ if (this.tile.getMetaTileID() != id) {
+ this.tile = null;
+ }
+ } else {
+ this.tile = null;
+ }
+ if (this.tile != null) {
+ if (tile instanceof IGregtechPacketEntity) {
+ ptile = (IGregtechPacketEntity) tile;
+ try {
+ this.ptile.readPacketData(data);
+ } catch (IOException var10) {
+ throw var10;
+ } catch (RuntimeException var11) {
+ Game.logThrowable("Exception in PacketTileEntity.readData:", var11, new Object[0]);
+ }
+ }
+ }
+ }
+ }
+ }
- public int getID() {
- return 0;
- }
-} \ No newline at end of file
+ public int getID() {
+ return 0;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/particles/BlockBreakParticles.java b/src/main/java/gtPlusPlus/core/util/minecraft/particles/BlockBreakParticles.java
index 9046a57120..f848ea49be 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/particles/BlockBreakParticles.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/particles/BlockBreakParticles.java
@@ -1,18 +1,16 @@
package gtPlusPlus.core.util.minecraft.particles;
+import gtPlusPlus.xmod.forestry.HANDLER_FR;
import net.minecraft.block.Block;
import net.minecraft.world.World;
-import gtPlusPlus.xmod.forestry.HANDLER_FR;
-
public class BlockBreakParticles {
- public BlockBreakParticles(final World world, final int x, final int y, final int z, final Block block){
- try {
- HANDLER_FR.createBlockBreakParticles(world, x, y, z, block);
- } catch (final Throwable T){
-
- }
- }
+ public BlockBreakParticles(final World world, final int x, final int y, final int z, final Block block) {
+ try {
+ HANDLER_FR.createBlockBreakParticles(world, x, y, z, block);
+ } catch (final Throwable T) {
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/particles/EntityParticleFXMysterious.java b/src/main/java/gtPlusPlus/core/util/minecraft/particles/EntityParticleFXMysterious.java
index d996cf705a..6c21e8addf 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/particles/EntityParticleFXMysterious.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/particles/EntityParticleFXMysterious.java
@@ -3,15 +3,18 @@ package gtPlusPlus.core.util.minecraft.particles;
import net.minecraft.client.particle.EntityAuraFX;
import net.minecraft.world.World;
-public class EntityParticleFXMysterious extends EntityAuraFX
-{
- public EntityParticleFXMysterious(final World parWorld,
- final double parX, final double parY, final double parZ,
- final double parMotionX, final double parMotionY, final double parMotionZ)
- {
- super(parWorld, parX, parY, parZ, parMotionX, parMotionY, parMotionZ);
- this.setParticleTextureIndex(82); // same as happy villager
- this.particleScale = 2.0F;
- this.setRBGColorF(0x88, 0x00, 0x88);
- }
+public class EntityParticleFXMysterious extends EntityAuraFX {
+ public EntityParticleFXMysterious(
+ final World parWorld,
+ final double parX,
+ final double parY,
+ final double parZ,
+ final double parMotionX,
+ final double parMotionY,
+ final double parMotionZ) {
+ super(parWorld, parX, parY, parZ, parMotionX, parMotionY, parMotionZ);
+ this.setParticleTextureIndex(82); // same as happy villager
+ this.particleScale = 2.0F;
+ this.setRBGColorF(0x88, 0x00, 0x88);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/player/PlayerCache.java b/src/main/java/gtPlusPlus/core/util/player/PlayerCache.java
index 753124dcd7..7159345d86 100644
--- a/src/main/java/gtPlusPlus/core/util/player/PlayerCache.java
+++ b/src/main/java/gtPlusPlus/core/util/player/PlayerCache.java
@@ -1,160 +1,149 @@
package gtPlusPlus.core.util.player;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
import java.io.*;
import java.util.*;
-
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
-
public class PlayerCache {
- private static final File cache = new File("PlayerCache.dat");
-
- public static final void initCache() {
- if (CORE.PlayerCache == null){
- try {
-
- if (cache != null){
- CORE.PlayerCache = PlayerCache.readPropertiesFileAsMap();
- Logger.INFO("Loaded PlayerCache.dat");
- }
-
-
- } catch (final Exception e) {
- Logger.INFO("Failed to initialise PlayerCache.dat");
- PlayerCache.createPropertiesFile("PLAYER_", "DATA");
- //e.printStackTrace();
- }
- }
- }
-
- public static void createPropertiesFile(final String playerName, final String playerUUIDasString) {
- try {
- final Properties props = new Properties();
- props.setProperty(playerName+" ", playerUUIDasString);
- final OutputStream out = new FileOutputStream(cache);
- props.store(out, "Player Cache.");
- Logger.INFO("PlayerCache.dat created for future use.");
- out.close();
- }
- catch (final Exception e ) {
- e.printStackTrace();
- }
- }
-
- public static void appendParamChanges(final String playerName, final String playerUUIDasString) {
- final HashMap<String, UUID> playerInfo = new HashMap<>();
- playerInfo.put(playerName, UUID.fromString(playerUUIDasString));
-
- /*try {
- Utils.LOG_INFO("Attempting to load "+cache.getName());
- properties.load(new FileInputStream(cache));
- if (properties == null || properties.equals(null)){
- Utils.LOG_INFO("Please wait.");
- }
- else {
- Utils.LOG_INFO("Loaded PlayerCache.dat");
- properties.setProperty(playerName+"_", playerUUIDasString);
- FileOutputStream fr=new FileOutputStream(cache);
- properties.store(fr, "Player Cache.");
- fr.close();
- }
-
- } */
-
- try
- {
- final FileOutputStream fos = new FileOutputStream("PlayerCache.dat");
- final ObjectOutputStream oos = new ObjectOutputStream(fos);
- oos.writeObject(playerInfo);
- oos.close();
- fos.close();
- Logger.INFO("Serialized Player data saved in PlayerCache.dat");
- }
-
- catch (final IOException e) {
- Logger.INFO("No PlayerCache file found, creating one.");
- createPropertiesFile(playerName, playerUUIDasString);
- }
- }
-
- /**
- * Reads a "properties" file, and returns it as a Map
- * (a collection of key/value pairs).
- *
- * Credit due to Alvin Alexander - http://alvinalexander.com/java/java-properties-file-map-example?nocache=1#comment-8215
- * Changed slightly as the filename and delimiter are constant in my case.
- *
- * @param filename The properties filename to read.
- * @param delimiter The string (or character) that separates the key
- * from the value in the properties file.
- * @return The Map that contains the key/value pairs.
- * @throws Exception
- */
- @Deprecated
- public static Map<String, String> readPropertiesFileAsMapOld() throws Exception {
- final String delimiter = "=";
- @SuppressWarnings({ "rawtypes", "unchecked" })
- final
- Map<String, String> map = new HashMap<>();
- final BufferedReader reader = new BufferedReader(new FileReader(cache));
- String line;
- while ((line = reader.readLine()) != null)
- {
- if (line.trim().length()==0) {
- continue;
- }
- if (line.charAt(0)=='#') {
- continue;
- }
- // assumption here is that proper lines are like "String : <a href="http://xxx.yyy.zzz/foo/bar"" title="http://xxx.yyy.zzz/foo/bar"">http://xxx.yyy.zzz/foo/bar"</a>,
- // and the ":" is the delimiter
- final int delimPosition = line.indexOf(delimiter);
- final String key = line.substring(0, delimPosition-1).trim();
- final String value = line.substring(delimPosition+1).trim();
- map.put(key, value);
- }
- reader.close();
- CORE.PlayerCache = map;
- return map;
- }
-
- public static HashMap<String, UUID> readPropertiesFileAsMap() {
- HashMap<String, UUID> map = null;
- try
- {
- final FileInputStream fis = new FileInputStream(cache);
- final ObjectInputStream ois = new ObjectInputStream(fis);
- map = (HashMap<String, UUID>) ois.readObject();
- ois.close();
- fis.close();
- }catch(final IOException ioe)
- {
- ioe.printStackTrace();
- return null;
- }catch(final ClassNotFoundException c)
- {
- Logger.INFO("Class not found");
- c.printStackTrace();
- return null;
- }
- Logger.WARNING("Deserialized PlayerCache..");
- return map;
- }
-
- public static String lookupPlayerByUUID(final UUID UUID){
- if (UUID == null) {
- return null;
- }
- final List<EntityPlayerMP> allPlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
- for (final EntityPlayerMP player : allPlayers) {
- if (player.getUniqueID().equals(UUID)) {
- return player.getDisplayName();
- }
- }
- return "Offline Player.";
- }
+ private static final File cache = new File("PlayerCache.dat");
+
+ public static final void initCache() {
+ if (CORE.PlayerCache == null) {
+ try {
+
+ if (cache != null) {
+ CORE.PlayerCache = PlayerCache.readPropertiesFileAsMap();
+ Logger.INFO("Loaded PlayerCache.dat");
+ }
+
+ } catch (final Exception e) {
+ Logger.INFO("Failed to initialise PlayerCache.dat");
+ PlayerCache.createPropertiesFile("PLAYER_", "DATA");
+ // e.printStackTrace();
+ }
+ }
+ }
+
+ public static void createPropertiesFile(final String playerName, final String playerUUIDasString) {
+ try {
+ final Properties props = new Properties();
+ props.setProperty(playerName + " ", playerUUIDasString);
+ final OutputStream out = new FileOutputStream(cache);
+ props.store(out, "Player Cache.");
+ Logger.INFO("PlayerCache.dat created for future use.");
+ out.close();
+ } catch (final Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void appendParamChanges(final String playerName, final String playerUUIDasString) {
+ final HashMap<String, UUID> playerInfo = new HashMap<>();
+ playerInfo.put(playerName, UUID.fromString(playerUUIDasString));
+
+ /*try {
+ Utils.LOG_INFO("Attempting to load "+cache.getName());
+ properties.load(new FileInputStream(cache));
+ if (properties == null || properties.equals(null)){
+ Utils.LOG_INFO("Please wait.");
+ }
+ else {
+ Utils.LOG_INFO("Loaded PlayerCache.dat");
+ properties.setProperty(playerName+"_", playerUUIDasString);
+ FileOutputStream fr=new FileOutputStream(cache);
+ properties.store(fr, "Player Cache.");
+ fr.close();
+ }
+
+ } */
+
+ try {
+ final FileOutputStream fos = new FileOutputStream("PlayerCache.dat");
+ final ObjectOutputStream oos = new ObjectOutputStream(fos);
+ oos.writeObject(playerInfo);
+ oos.close();
+ fos.close();
+ Logger.INFO("Serialized Player data saved in PlayerCache.dat");
+ } catch (final IOException e) {
+ Logger.INFO("No PlayerCache file found, creating one.");
+ createPropertiesFile(playerName, playerUUIDasString);
+ }
+ }
+
+ /**
+ * Reads a "properties" file, and returns it as a Map
+ * (a collection of key/value pairs).
+ *
+ * Credit due to Alvin Alexander - http://alvinalexander.com/java/java-properties-file-map-example?nocache=1#comment-8215
+ * Changed slightly as the filename and delimiter are constant in my case.
+ *
+ * @param filename The properties filename to read.
+ * @param delimiter The string (or character) that separates the key
+ * from the value in the properties file.
+ * @return The Map that contains the key/value pairs.
+ * @throws Exception
+ */
+ @Deprecated
+ public static Map<String, String> readPropertiesFileAsMapOld() throws Exception {
+ final String delimiter = "=";
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ final Map<String, String> map = new HashMap<>();
+ final BufferedReader reader = new BufferedReader(new FileReader(cache));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ if (line.trim().length() == 0) {
+ continue;
+ }
+ if (line.charAt(0) == '#') {
+ continue;
+ }
+ // assumption here is that proper lines are like "String : <a href="http://xxx.yyy.zzz/foo/bar""
+ // title="http://xxx.yyy.zzz/foo/bar"">http://xxx.yyy.zzz/foo/bar"</a>,
+ // and the ":" is the delimiter
+ final int delimPosition = line.indexOf(delimiter);
+ final String key = line.substring(0, delimPosition - 1).trim();
+ final String value = line.substring(delimPosition + 1).trim();
+ map.put(key, value);
+ }
+ reader.close();
+ CORE.PlayerCache = map;
+ return map;
+ }
+
+ public static HashMap<String, UUID> readPropertiesFileAsMap() {
+ HashMap<String, UUID> map = null;
+ try {
+ final FileInputStream fis = new FileInputStream(cache);
+ final ObjectInputStream ois = new ObjectInputStream(fis);
+ map = (HashMap<String, UUID>) ois.readObject();
+ ois.close();
+ fis.close();
+ } catch (final IOException ioe) {
+ ioe.printStackTrace();
+ return null;
+ } catch (final ClassNotFoundException c) {
+ Logger.INFO("Class not found");
+ c.printStackTrace();
+ return null;
+ }
+ Logger.WARNING("Deserialized PlayerCache..");
+ return map;
+ }
+
+ public static String lookupPlayerByUUID(final UUID UUID) {
+ if (UUID == null) {
+ return null;
+ }
+ final List<EntityPlayerMP> allPlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
+ for (final EntityPlayerMP player : allPlayers) {
+ if (player.getUniqueID().equals(UUID)) {
+ return player.getDisplayName();
+ }
+ }
+ return "Offline Player.";
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java b/src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
index fc8e84cb61..10b689f044 100644
--- a/src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
+++ b/src/main/java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.util.reflect;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.internal.IGT_RecipeAdder;
import gregtech.api.util.GT_Recipe;
@@ -10,282 +7,271 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public final class AddGregtechRecipe {
-
-
+
public static boolean importPyroRecipe(GT_Recipe aRecipe) {
-
+
int aModifiedTime = (int) (aRecipe.mDuration * 0.8);
-
- if (aRecipe.mInputs == null || aRecipe.mFluidInputs == null || aRecipe.mFluidOutputs == null || aRecipe.mOutputs == null) {
- return false;
- }
- if (aRecipe.mInputs.length > 2 || aRecipe.mFluidInputs.length > 1 || aRecipe.mFluidOutputs.length > 1 || aRecipe.mOutputs.length > 9) {
+
+ if (aRecipe.mInputs == null
+ || aRecipe.mFluidInputs == null
+ || aRecipe.mFluidOutputs == null
+ || aRecipe.mOutputs == null) {
return false;
}
- else if (aRecipe.mInputs.length <= 0) {
+ if (aRecipe.mInputs.length > 2
+ || aRecipe.mFluidInputs.length > 1
+ || aRecipe.mFluidOutputs.length > 1
+ || aRecipe.mOutputs.length > 9) {
+ return false;
+ } else if (aRecipe.mInputs.length <= 0) {
return false;
}
-
+
int aCircuitNumber = -1;
Item aCircuit = CI.getNumberedCircuit(1).getItem();
boolean hasCircuit = false;
-
+
for (ItemStack a : aRecipe.mInputs) {
if (a != null && a.getItem() == aCircuit) {
- hasCircuit = true;
- aCircuitNumber = a.getItemDamage();
- break;
+ hasCircuit = true;
+ aCircuitNumber = a.getItemDamage();
+ break;
}
}
-
+
ItemStack aInputItem = null;
if (!hasCircuit || aCircuitNumber < 1) {
- return false;
+ return false;
}
-
+
for (ItemStack a : aRecipe.mInputs) {
if (a != null && a.getItem() != aCircuit) {
- aInputItem = a;
- break;
+ aInputItem = a;
+ break;
}
}
-
+
return CORE.RA.addCokeOvenRecipe(
- aCircuitNumber,
- aInputItem,
- aRecipe.mFluidInputs,
- aRecipe.mFluidOutputs,
- aRecipe.mOutputs,
- aModifiedTime,
- aRecipe.mEUt);
-
+ aCircuitNumber,
+ aInputItem,
+ aRecipe.mFluidInputs,
+ aRecipe.mFluidOutputs,
+ aRecipe.mOutputs,
+ aModifiedTime,
+ aRecipe.mEUt);
}
-
-
- public static boolean addCokeAndPyrolyseRecipes(
- ItemStack input1, int circuitNumber,
- FluidStack inputFluid1,
- ItemStack output1,
- FluidStack outputFluid1,
- int timeInSeconds,
- int euTick
- ){
- //Seconds Conversion
- int TIME = timeInSeconds*20;
- int TIMEPYRO = TIME+(TIME/5);
- CORE.RA.addCokeOvenRecipe(
- input1,
- ItemUtils.getGregtechCircuit(circuitNumber),
- inputFluid1,
- outputFluid1,
- output1,
- TIME,
- euTick);
- PyrolyseOven(
- input1,
- inputFluid1,
- circuitNumber,
- output1,
- outputFluid1,
- TIMEPYRO,
- euTick);
-
-
- return false;
- }
-
-
+ public static boolean addCokeAndPyrolyseRecipes(
+ ItemStack input1,
+ int circuitNumber,
+ FluidStack inputFluid1,
+ ItemStack output1,
+ FluidStack outputFluid1,
+ int timeInSeconds,
+ int euTick) {
+ // Seconds Conversion
+ int TIME = timeInSeconds * 20;
+ int TIMEPYRO = TIME + (TIME / 5);
+ CORE.RA.addCokeOvenRecipe(
+ input1, ItemUtils.getGregtechCircuit(circuitNumber), inputFluid1, outputFluid1, output1, TIME, euTick);
+ PyrolyseOven(input1, inputFluid1, circuitNumber, output1, outputFluid1, TIMEPYRO, euTick);
- public static boolean PyrolyseOven(final ItemStack p0, final FluidStack p1, final int p2, final ItemStack p3,
- final FluidStack p4, final int p5, final int p6){
-
- try {
- IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
- if (IGT_RecipeAdder != null){
- Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
- Method addRecipe = classRA.getMethod("addPyrolyseRecipe", ItemStack.class, FluidStack.class, int.class, ItemStack.class, FluidStack.class, int.class, int.class);
- if (addRecipe != null){
- return (boolean) addRecipe.invoke(IGT_RecipeAdder, p0, p1, p2, p3, p4, p5, p6);
- }
- }
- }
- catch (SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- return false;
- }
-
-
-
- public static boolean addAssemblylineRecipe(
- ItemStack aResearchItem,
- int aResearchTime,
- ItemStack[] aInputs,
- FluidStack[] aFluidInputs,
- ItemStack aOutput,
- int aDuration, int aEUt){
- /*
- try {
- IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
- if (IGT_RecipeAdder != null){
- Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
-
- for(Method current : classRA.getDeclaredMethods()){
- //Utils.LOG_INFO("-----------------------------------------------");
- ////Utils.LOG_INFO("Found method: "+current.getName());
- //Utils.LOG_INFO("With Parameters: ");
- //Utils.LOG_INFO("===============================================");
- for (Class<?> P : current.getParameterTypes()){
- //Utils.LOG_INFO(""+P.getName());
- //Utils.LOG_INFO(""+P.getClass().getName());
- }
- //Utils.LOG_INFO("===============================================");
- }
-
- try {
- Method testRA = GT_Values.RA.getClass().getMethod("addAssemblylineRecipe", GT_Values.RA.getClass(), aResearchItem.getClass(), int.class, aInputs.getClass(), aFluidInputs.getClass(), aOutput.getClass(), int.class, int.class);
- testRA.invoke(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt);
- }
- catch (Throwable masndj){
- masndj.printStackTrace();
- }
-
+ return false;
+ }
- Method addRecipe = classRA.getDeclaredMethod(
- "addAssemblylineRecipe",
- ItemStack.class,
- int.class,
- ItemStack.class,
- FluidStack.class,
- ItemStack.class,
- int.class,
- int.class);
- if (addRecipe != null){
- return (boolean) addRecipe.invoke(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt);
- }
- }
- }
- catch (SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Utils.LOG_INFO("[Assembly Line] - Failed to add recipe, due to GT not being .09 branch. Research: "+aResearchItem.getDisplayName()+" | Result: "+aOutput.getDisplayName());
- e.printStackTrace();
- return false;
- }
- Utils.LOG_INFO("[Assembly Line] - Failed to add recipe. Research: "+aResearchItem.getDisplayName()+" | Result: "+aOutput.getDisplayName());
- */return false;
- }
+ public static boolean PyrolyseOven(
+ final ItemStack p0,
+ final FluidStack p1,
+ final int p2,
+ final ItemStack p3,
+ final FluidStack p4,
+ final int p5,
+ final int p6) {
- public static boolean addCircuitAssemblerRecipe(
- ItemStack[] aInputs,
- FluidStack aFluidInput,
- ItemStack aOutput,
- int aDuration,
- int aEUt) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- try {
- IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
- if (IGT_RecipeAdder != null){
- Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
- Method addRecipe = classRA.getMethod(
- "addCircuitAssemblerRecipe",
- ItemStack.class,
- FluidStack.class,
- ItemStack.class,
- int.class,
- int.class);
- if (addRecipe != null){
- if (aFluidInput.isFluidEqual(FluidUtils.getFluidStack("molten.tin", 1))){
- boolean[] didAdd = new boolean[3];
- FluidStack moltenMetal = FluidUtils.getFluidStack("molten.tin", 144);
- //Tin
- didAdd[0] = (boolean) addRecipe.invoke(
- IGT_RecipeAdder,
- aInputs,
- moltenMetal,
- aOutput,
- aDuration,
- aEUt);
- moltenMetal = FluidUtils.getFluidStack("molten.lead", 144);
- //Lead
- didAdd[1] = (boolean) addRecipe.invoke(
- IGT_RecipeAdder,
- aInputs,
- moltenMetal,
- aOutput,
- aDuration,
- aEUt);
- moltenMetal = FluidUtils.getFluidStack("molten.solderingalloy", 144/2);
- //Soldering Alloy
- didAdd[2] = (boolean) addRecipe.invoke(
- IGT_RecipeAdder,
- aInputs,
- moltenMetal,
- aOutput,
- aDuration,
- aEUt);
+ try {
+ IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
+ if (IGT_RecipeAdder != null) {
+ Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
+ Method addRecipe = classRA.getMethod(
+ "addPyrolyseRecipe",
+ ItemStack.class,
+ FluidStack.class,
+ int.class,
+ ItemStack.class,
+ FluidStack.class,
+ int.class,
+ int.class);
+ if (addRecipe != null) {
+ return (boolean) addRecipe.invoke(IGT_RecipeAdder, p0, p1, p2, p3, p4, p5, p6);
+ }
+ }
+ } catch (SecurityException
+ | NoSuchMethodException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ return false;
+ }
+ return false;
+ }
- if (didAdd[0] && didAdd[1] && didAdd[2]){
- return true;
- }
- else {
- return false;
- }
- }
- else {
- return (boolean) addRecipe.invoke(
- IGT_RecipeAdder,
- aInputs,
- aFluidInput,
- aOutput,
- aDuration,
- aEUt);
- }
- }
- }
- }
- catch (SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
- return false;
- }
+ public static boolean addAssemblylineRecipe(
+ ItemStack aResearchItem,
+ int aResearchTime,
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack aOutput,
+ int aDuration,
+ int aEUt) {
+ /*
+ try {
+ IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
+ if (IGT_RecipeAdder != null){
+ Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
+ for(Method current : classRA.getDeclaredMethods()){
+ //Utils.LOG_INFO("-----------------------------------------------");
+ ////Utils.LOG_INFO("Found method: "+current.getName());
+ //Utils.LOG_INFO("With Parameters: ");
+ //Utils.LOG_INFO("===============================================");
+ for (Class<?> P : current.getParameterTypes()){
+ //Utils.LOG_INFO(""+P.getName());
+ //Utils.LOG_INFO(""+P.getClass().getName());
+ }
+ //Utils.LOG_INFO("===============================================");
+ }
- public static boolean addChemicalRecipeForBasicMachineOnly(final ItemStack p0, final ItemStack p1, final FluidStack p2, final FluidStack p3, final ItemStack p4, final ItemStack p5, final int p6, final int p7){
+ try {
+ Method testRA = GT_Values.RA.getClass().getMethod("addAssemblylineRecipe", GT_Values.RA.getClass(), aResearchItem.getClass(), int.class, aInputs.getClass(), aFluidInputs.getClass(), aOutput.getClass(), int.class, int.class);
+ testRA.invoke(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt);
+ }
+ catch (Throwable masndj){
+ masndj.printStackTrace();
+ }
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- try {
- IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
- if (IGT_RecipeAdder != null){
- Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
- //final ItemStack p0, final ItemStack p1, final FluidStack p2, final FluidStack p3, final ItemStack p4, final ItemStack p5, final int p6, final int p7
- Method addRecipe = classRA.getMethod("addChemicalRecipeForBasicMachineOnly", ItemStack.class, ItemStack.class, FluidStack.class, FluidStack.class, ItemStack.class, ItemStack.class, int.class, int.class);
- if (addRecipe != null){
- return (boolean) addRecipe.invoke(IGT_RecipeAdder, p0, p1, p2, p3, p4, p5, p6, p7);
- }
- }
- }
- catch (SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- }
+ Method addRecipe = classRA.getDeclaredMethod(
+ "addAssemblylineRecipe",
+ ItemStack.class,
+ int.class,
+ ItemStack.class,
+ FluidStack.class,
+ ItemStack.class,
+ int.class,
+ int.class);
+ if (addRecipe != null){
+ return (boolean) addRecipe.invoke(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt);
+ }
+ }
+ }
+ catch (SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ Utils.LOG_INFO("[Assembly Line] - Failed to add recipe, due to GT not being .09 branch. Research: "+aResearchItem.getDisplayName()+" | Result: "+aOutput.getDisplayName());
+ e.printStackTrace();
+ return false;
+ }
+ Utils.LOG_INFO("[Assembly Line] - Failed to add recipe. Research: "+aResearchItem.getDisplayName()+" | Result: "+aOutput.getDisplayName());
+ */ return false;
+ }
- return GT_Values.RA.addChemicalRecipe(
- p0,
- p1,
- p2,
- p3,
- p4,
- p6);
+ public static boolean addCircuitAssemblerRecipe(
+ ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try {
+ IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
+ if (IGT_RecipeAdder != null) {
+ Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
+ Method addRecipe = classRA.getMethod(
+ "addCircuitAssemblerRecipe",
+ ItemStack.class,
+ FluidStack.class,
+ ItemStack.class,
+ int.class,
+ int.class);
+ if (addRecipe != null) {
+ if (aFluidInput.isFluidEqual(FluidUtils.getFluidStack("molten.tin", 1))) {
+ boolean[] didAdd = new boolean[3];
+ FluidStack moltenMetal = FluidUtils.getFluidStack("molten.tin", 144);
+ // Tin
+ didAdd[0] = (boolean)
+ addRecipe.invoke(IGT_RecipeAdder, aInputs, moltenMetal, aOutput, aDuration, aEUt);
+ moltenMetal = FluidUtils.getFluidStack("molten.lead", 144);
+ // Lead
+ didAdd[1] = (boolean)
+ addRecipe.invoke(IGT_RecipeAdder, aInputs, moltenMetal, aOutput, aDuration, aEUt);
+ moltenMetal = FluidUtils.getFluidStack("molten.solderingalloy", 144 / 2);
+ // Soldering Alloy
+ didAdd[2] = (boolean)
+ addRecipe.invoke(IGT_RecipeAdder, aInputs, moltenMetal, aOutput, aDuration, aEUt);
- }
+ if (didAdd[0] && didAdd[1] && didAdd[2]) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return (boolean)
+ addRecipe.invoke(IGT_RecipeAdder, aInputs, aFluidInput, aOutput, aDuration, aEUt);
+ }
+ }
+ }
+ } catch (SecurityException
+ | NoSuchMethodException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ return false;
+ }
+ }
+ return false;
+ }
+ public static boolean addChemicalRecipeForBasicMachineOnly(
+ final ItemStack p0,
+ final ItemStack p1,
+ final FluidStack p2,
+ final FluidStack p3,
+ final ItemStack p4,
+ final ItemStack p5,
+ final int p6,
+ final int p7) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try {
+ IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
+ if (IGT_RecipeAdder != null) {
+ Class<? extends IGT_RecipeAdder> classRA = IGT_RecipeAdder.getClass();
+ // final ItemStack p0, final ItemStack p1, final FluidStack p2, final FluidStack p3, final ItemStack
+ // p4, final ItemStack p5, final int p6, final int p7
+ Method addRecipe = classRA.getMethod(
+ "addChemicalRecipeForBasicMachineOnly",
+ ItemStack.class,
+ ItemStack.class,
+ FluidStack.class,
+ FluidStack.class,
+ ItemStack.class,
+ ItemStack.class,
+ int.class,
+ int.class);
+ if (addRecipe != null) {
+ return (boolean) addRecipe.invoke(IGT_RecipeAdder, p0, p1, p2, p3, p4, p5, p6, p7);
+ }
+ }
+ } catch (SecurityException
+ | NoSuchMethodException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ }
+ }
-} \ No newline at end of file
+ return GT_Values.RA.addChemicalRecipe(p0, p1, p2, p3, p4, p6);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ProxyFinder.java b/src/main/java/gtPlusPlus/core/util/reflect/ProxyFinder.java
index aaa9b2fae7..6c3be2e6df 100644
--- a/src/main/java/gtPlusPlus/core/util/reflect/ProxyFinder.java
+++ b/src/main/java/gtPlusPlus/core/util/reflect/ProxyFinder.java
@@ -1,55 +1,53 @@
package gtPlusPlus.core.util.reflect;
-import java.lang.reflect.Field;
-
import cpw.mods.fml.common.SidedProxy;
+import java.lang.reflect.Field;
public class ProxyFinder {
- public static Object getServerProxy(final Object modInstance) throws ReflectiveOperationException {
- for(final Field field : modInstance.getClass().getDeclaredFields()) {
- if(field.isAnnotationPresent(SidedProxy.class)) {
- final SidedProxy sidedProxy = field.getAnnotation(SidedProxy.class);
- final Object fieldValue = field.get(modInstance);
- try {
- final Class<?> serverSideClass = ReflectionUtils.getClass(sidedProxy.serverSide());
- if(serverSideClass.isAssignableFrom(fieldValue.getClass())) {
- final Object serverProxy = serverSideClass.cast(fieldValue);
- //do what you want with server proxy instance
- return serverProxy;
- }
+ public static Object getServerProxy(final Object modInstance) throws ReflectiveOperationException {
+ for (final Field field : modInstance.getClass().getDeclaredFields()) {
+ if (field.isAnnotationPresent(SidedProxy.class)) {
+ final SidedProxy sidedProxy = field.getAnnotation(SidedProxy.class);
+ final Object fieldValue = field.get(modInstance);
+ try {
+ final Class<?> serverSideClass = ReflectionUtils.getClass(sidedProxy.serverSide());
+ if (serverSideClass.isAssignableFrom(fieldValue.getClass())) {
+ final Object serverProxy = serverSideClass.cast(fieldValue);
+ // do what you want with server proxy instance
+ return serverProxy;
+ }
- } catch (final NoClassDefFoundError err) {
- //its client side
- return null;
- }
- break;
- }
- }
- return null;
- }
-
- public static Object getClientProxy(final Object modInstance) throws ReflectiveOperationException {
- for(final Field field : modInstance.getClass().getDeclaredFields()) {
- if(field.isAnnotationPresent(SidedProxy.class)) {
- final SidedProxy sidedProxy = field.getAnnotation(SidedProxy.class);
- final Object fieldValue = field.get(modInstance);
- try {
- final Class<?> clientSideClass = ReflectionUtils.getClass(sidedProxy.clientSide());
- if(clientSideClass.isAssignableFrom(fieldValue.getClass())) {
- final Object clientProxy = clientSideClass.cast(fieldValue);
- //do what you want with client proxy instance
- return clientProxy;
- }
+ } catch (final NoClassDefFoundError err) {
+ // its client side
+ return null;
+ }
+ break;
+ }
+ }
+ return null;
+ }
- } catch (final NoClassDefFoundError err) {
- //its server side
- return null;
- }
- break;
- }
- }
- return null;
- }
+ public static Object getClientProxy(final Object modInstance) throws ReflectiveOperationException {
+ for (final Field field : modInstance.getClass().getDeclaredFields()) {
+ if (field.isAnnotationPresent(SidedProxy.class)) {
+ final SidedProxy sidedProxy = field.getAnnotation(SidedProxy.class);
+ final Object fieldValue = field.get(modInstance);
+ try {
+ final Class<?> clientSideClass = ReflectionUtils.getClass(sidedProxy.clientSide());
+ if (clientSideClass.isAssignableFrom(fieldValue.getClass())) {
+ final Object clientProxy = clientSideClass.cast(fieldValue);
+ // do what you want with client proxy instance
+ return clientProxy;
+ }
-} \ No newline at end of file
+ } catch (final NoClassDefFoundError err) {
+ // its server side
+ return null;
+ }
+ break;
+ }
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 112c4f1f02..c493ce1aa9 100644
--- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -1,5 +1,8 @@
package gtPlusPlus.core.util.reflect;
+import com.google.common.reflect.ClassPath;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.data.StringUtils;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
@@ -15,1115 +18,1070 @@ import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-
import org.apache.commons.lang3.ArrayUtils;
-import com.google.common.reflect.ClassPath;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.data.StringUtils;
-
public class ReflectionUtils {
- public static Map<String, Class<?>> mCachedClasses = new LinkedHashMap<String, Class<?>>();
- public static Map<String, CachedMethod> mCachedMethods = new LinkedHashMap<String, CachedMethod>();
- public static Map<String, CachedField> mCachedFields = new LinkedHashMap<String, CachedField>();
- public static Map<String, CachedConstructor> mCachedConstructors = new LinkedHashMap<String, CachedConstructor>();
-
- private static class CachedConstructor {
-
- private final Constructor<?> METHOD;
-
- public CachedConstructor(Constructor<?> aCons) {
- METHOD = aCons;
- }
-
- public Constructor<?> get() {
- return METHOD;
- }
-
- }
-
- private static class CachedMethod {
-
- private final boolean STATIC;
- private final Method METHOD;
-
- public CachedMethod(Method aMethod, boolean isStatic) {
- METHOD = aMethod;
- STATIC = isStatic;
- }
-
- public Method get() {
- return METHOD;
- }
-
- public boolean type() {
- return STATIC;
- }
-
- }
-
- private static class CachedField {
-
- private final boolean STATIC;
- private final Field FIELD;
-
- public CachedField(Field aField, boolean isStatic) {
- FIELD = aField;
- STATIC = isStatic;
- }
-
- public Field get() {
- return FIELD;
- }
-
- public boolean type() {
- return STATIC;
- }
-
- }
-
- private static boolean cacheClass(Class<?> aClass) {
- if (aClass == null) {
- return false;
- }
- Class<?> y = mCachedClasses.get(aClass.getCanonicalName());
- if (y == null) {
- mCachedClasses.put(aClass.getCanonicalName(), aClass);
- return true;
- }
- return false;
- }
-
- private static boolean cacheMethod(Class<?> aClass, Method aMethod) {
- if (aMethod == null) {
- return false;
- }
- boolean isStatic = Modifier.isStatic(aMethod.getModifiers());
- CachedMethod y = mCachedMethods.get(aClass.getName()+"."+aMethod.getName()+"."+ArrayUtils.toString(aMethod.getParameterTypes()));
- if (y == null) {
- mCachedMethods.put(aClass.getName()+"."+aMethod.getName()+"."+ArrayUtils.toString(aMethod.getParameterTypes()), new CachedMethod(aMethod, isStatic));
- return true;
- }
- return false;
- }
-
- private static boolean cacheField(Class<?> aClass, Field aField) {
- if (aField == null) {
- return false;
- }
- boolean isStatic = Modifier.isStatic(aField.getModifiers());
- CachedField y = mCachedFields.get(aClass.getName()+"."+aField.getName());
- if (y == null) {
- mCachedFields.put(aClass.getName()+"."+aField.getName(), new CachedField(aField, isStatic));
- return true;
- }
- return false;
- }
-
- private static boolean cacheConstructor(Class<?> aClass, Constructor<?> aConstructor) {
- if (aConstructor == null) {
- return false;
- }
- CachedConstructor y = mCachedConstructors.get(aClass.getName()+"."+ArrayUtils.toString(aConstructor.getParameterTypes()));
- if (y == null) {
- mCachedConstructors.put(aClass.getName()+"."+ArrayUtils.toString(aConstructor.getParameterTypes()), new CachedConstructor(aConstructor));
- return true;
- }
- return false;
- }
-
-
- /**
- * Returns a cached {@link Constructor} object.
- * @param aClass - Class containing the Constructor.
- * @param aTypes - Varags Class Types for objects constructor.
- * @return - Valid, non-final, {@link Method} object, or {@link null}.
- */
- public static Constructor<?> getConstructor(Class<?> aClass, Class<?>... aTypes) {
- if (aClass == null || aTypes == null) {
- return null;
- }
-
- String aMethodKey = ArrayUtils.toString(aTypes);
- //Logger.REFLECTION("Looking up method in cache: "+(aClass.getName()+"."+aMethodName + "." + aMethodKey));
- CachedConstructor y = mCachedConstructors.get(aClass.getName() + "." + aMethodKey);
- if (y == null) {
- Constructor<?> u = getConstructor_Internal(aClass, aTypes);
- if (u != null) {
- Logger.REFLECTION("Caching Constructor: "+aClass.getName() + "." + aMethodKey);
- cacheConstructor(aClass, u);
- return u;
- } else {
- return null;
- }
- } else {
- return y.get();
- }
- }
-
-
-
-
- /**
- * Returns a cached {@link Class} object.
- * @param aClassCanonicalName - The canonical name of the underlying class.
- * @return - Valid, {@link Class} object, or {@link null}.
- */
- public static Class<?> getClass(String aClassCanonicalName) {
- if (aClassCanonicalName == null || aClassCanonicalName.length() <= 0) {
- return null;
- }
- Class<?> y = mCachedClasses.get(aClassCanonicalName);
- if (y == null) {
- y = getClass_Internal(aClassCanonicalName);
- if (y != null) {
- Logger.REFLECTION("Caching Class: "+aClassCanonicalName);
- cacheClass(y);
- }
- }
- return y;
- }
-
-
-
- /**
- * Returns a cached {@link Method} object. Wraps {@link #getMethod(Class, String, Class...)}.
- * @param aObject - Object containing the Method.
- * @param aMethodName - Method's name in {@link String} form.
- * @param aTypes - Class Array of Types for {@link Method}'s constructor.
- * @return - Valid, non-final, {@link Method} object, or {@link null}.
- */
- public static Method getMethod(Object aObject, String aMethodName, Class[] aTypes) {
- return getMethod(aObject.getClass(), aMethodName, aTypes);
- }
-
-
- /**
- * Returns a cached {@link Method} object.
- * @param aClass - Class containing the Method.
- * @param aMethodName - Method's name in {@link String} form.
- * @param aTypes - Varags Class Types for {@link Method}'s constructor.
- * @return - Valid, non-final, {@link Method} object, or {@link null}.
- */
- public static Method getMethod(Class<?> aClass, String aMethodName, Class<?>... aTypes) {
- if (aClass == null || aMethodName == null || aMethodName.length() <= 0) {
- return null;
- }
- String aMethodKey = ArrayUtils.toString(aTypes);
- //Logger.REFLECTION("Looking up method in cache: "+(aClass.getName()+"."+aMethodName + "." + aMethodKey));
- CachedMethod y = mCachedMethods.get(aClass.getName()+"."+aMethodName + "." + aMethodKey);
- if (y == null) {
- Method u = getMethod_Internal(aClass, aMethodName, aTypes);
- if (u != null) {
- Logger.REFLECTION("Caching Method: "+aMethodName + "." + aMethodKey);
- cacheMethod(aClass, u);
- return u;
- } else {
- return null;
- }
- } else {
- return y.get();
- }
- }
-
- public static boolean isStaticMethod(Class<?> aClass, String aMethodName, Class<?>... aTypes) {
- return isStaticMethod(ReflectionUtils.getMethod(aClass, aMethodName, aTypes));
- }
-
- public static boolean isStaticMethod(Method aMethod) {
- if (aMethod != null && Modifier.isStatic(aMethod.getModifiers())) {
- return true;
- }
- return false;
- }
-
-
-
- /**
- * Returns a cached {@link Field} object.
- * @param aClass - Class containing the Method.
- * @param aFieldName - Field name in {@link String} form.
- * @return - Valid, non-final, {@link Field} object, or {@link null}.
- */
- public static Field getField(final Class<?> aClass, final String aFieldName) {
- if (aClass == null || aFieldName == null || aFieldName.length() <= 0) {
- return null;
- }
- CachedField y = mCachedFields.get(aClass.getName()+"."+aFieldName);
- if (y == null) {
- Field u;
- try {
- u = getField_Internal(aClass, aFieldName);
- if (u != null) {
- Logger.REFLECTION("Caching Field '"+aFieldName+"' from "+aClass.getName());
- cacheField(aClass, u);
- return u;
- }
- } catch (NoSuchFieldException e) {
- }
- return null;
-
- } else {
- return y.get();
- }
- }
-
- public static Field[] getAllFields(final Class<?> aClass) {
- if (aClass == null) {
- return null;
- }
- Field[] aFields = aClass.getDeclaredFields();
- for (Field f : aFields) {
- CachedField y = mCachedFields.get(aClass.getName()+"."+f.getName());
- if (y == null) {
- makeFieldAccessible(f);
- cacheField(aClass, f);
- }
- }
- return aFields;
- }
-
- /**
- * Returns a cached {@link Field} object.
- * @param aInstance - {@link Object} to get the field instance from.
- * @param aFieldName - Field name in {@link String} form.
- * @return - Valid, non-final, {@link Field} object, or {@link null}.
- */
- public static <T> T getField(final Object aInstance, final String aFieldName) {
- try {
- return (T) getField(aInstance.getClass(), aFieldName).get(aInstance);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return null;
- }
- }
-
-
-
-
- /*
- * Utility Functions
- */
-
- public static boolean doesClassExist(final String classname) {
- return isClassPresent(classname);
- }
-
-
- /**
- * Returns the class of the objects type parameter
- * @param o - Object to examine paramters on
- * @return - a Class<?> or null
- */
- public static Class<?> getTypeOfGenericObject(Object o) {
- Class<?> aTypeParam = findSuperClassParameterType(o, o.getClass(), 0);
- if (aTypeParam == null) {
- aTypeParam = findSubClassParameterType(o, o.getClass(), 0);
- }
- return aTypeParam;
- }
-
- public static void makeFieldAccessible(final Field field) {
- if (!Modifier.isPublic(field.getModifiers()) ||
- !Modifier.isPublic(field.getDeclaringClass().getModifiers()))
- {
- field.setAccessible(true);
- }
- }
-
- public static void makeMethodAccessible(final Method field) {
- if (!Modifier.isPublic(field.getModifiers()) ||
- !Modifier.isPublic(field.getDeclaringClass().getModifiers()))
- {
- field.setAccessible(true);
- }
- }
-
- /**
- * Get the method name for a depth in call stack. <br />
- * Utility function
- * @param depth depth in the call stack (0 means current method, 1 means call method, ...)
- * @return Method name
- */
- public static String getMethodName(final int depth) {
- final StackTraceElement[] ste = new Throwable().getStackTrace();
- //System. out.println(ste[ste.length-depth].getClassName()+"#"+ste[ste.length-depth].getMethodName());
- if (ste.length < depth) {
- return "No valid stack.";
- }
- return ste[depth+1].getMethodName();
- }
-
-
- /**
- *
- * @param aPackageName - The full {@link Package} name in {@link String} form.
- * @return - {@link Boolean} object. True if loaded > 0 classes.
- */
- public static boolean dynamicallyLoadClassesInPackage(String aPackageName) {
- ClassLoader classLoader = ReflectionUtils.class.getClassLoader();
- int loaded = 0;
- try {
- ClassPath path = ClassPath.from(classLoader);
- for (ClassPath.ClassInfo info : path.getTopLevelClassesRecursive(aPackageName)) {
- Class<?> clazz = Class.forName(info.getName(), true, classLoader);
- if (clazz != null) {
- loaded++;
- Logger.INFO("Found "+clazz.getCanonicalName()+". ["+loaded+"]");
- }
- }
- } catch (ClassNotFoundException | IOException e) {
-
- }
-
- return loaded > 0;
- }
-
- public static void loadClass(String aClassName) {
- try {
- Class.forName(aClassName, true, ReflectionUtils.class.getClassLoader());
- }
- catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- }
-
-
-
- public static boolean setField(final Object object, final String fieldName, final Object fieldValue) {
- Class<?> clazz;
- if (object instanceof Class) {
- clazz = (Class<?>) object;
- }
- else {
- clazz = object.getClass();
- }
- while (clazz != null) {
- try {
- final Field field = getField(clazz, fieldName);
- if (field != null) {
- setFieldValue_Internal(object, field, fieldValue);
- return true;
- }
- } catch (final NoSuchFieldException e) {
- Logger.REFLECTION("setField("+object.toString()+", "+fieldName+") failed.");
- clazz = clazz.getSuperclass();
- } catch (final Exception e) {
- Logger.REFLECTION("setField("+object.toString()+", "+fieldName+") failed.");
- throw new IllegalStateException(e);
- }
- }
- return false;
-
-
- }
-
- public static boolean setField(final Object object, final Field field, final Object fieldValue) {
- if (field == null) return false;
- Class<?> clazz;
- if (object instanceof Class) {
- clazz = (Class<?>) object;
- }
- else {
- clazz = object.getClass();
- }
- while (clazz != null) {
- try {
- final Field field2 = getField(clazz, field.getName());
- if (field2 != null) {
- setFieldValue_Internal(object, field, fieldValue);
- return true;
- }
- } catch (final NoSuchFieldException e) {
- Logger.REFLECTION("setField("+object.toString()+", "+field.getName()+") failed.");
- clazz = clazz.getSuperclass();
- } catch (final Exception e) {
- Logger.REFLECTION("setField("+object.toString()+", "+field.getName()+") failed.");
- throw new IllegalStateException(e);
- }
- }
- return false;
- }
-
-
- /**
- * Allows to change the state of an immutable instance. Huh?!?
- */
- public static void setFinalFieldValue(Class<?> clazz, String fieldName, Object newValue) {
- Field nameField = getField(clazz, fieldName);
- try {
- setFieldValue_Internal(clazz, nameField, newValue);
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- /**
- * Allows to change the state of an immutable instance. Huh?!?
- */
- public static void setFinalFieldValue(Class<?> clazz, Field field, Object newValue) {
- try {
- setFieldValue_Internal(clazz, field, newValue);
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- @Deprecated
- public static void setFinalStatic(Field field, Object newValue) throws Exception {
- field.setAccessible(true);
- Field modifiersField = Field.class.getDeclaredField("modifiers");
- modifiersField.setAccessible(true);
- modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
- field.set(null, newValue);
- }
-
-
- public static void setByte(Object clazz, String fieldName, byte newValue) throws Exception {
- Field nameField = getField(clazz.getClass(), fieldName);
- nameField.setAccessible(true);
- int modifiers = nameField.getModifiers();
- Field modifierField = nameField.getClass().getDeclaredField("modifiers");
- modifiers = modifiers & ~Modifier.FINAL;
- modifierField.setAccessible(true);
- modifierField.setInt(nameField, modifiers);
- //Utils.LOG_INFO("O-"+(byte) nameField.get(clazz) + " | "+newValue);
- nameField.setByte(clazz, newValue);
- //Utils.LOG_INFO("N-"+(byte) nameField.get(clazz));
-
- /*final Field fieldA = getField(clazz.getClass(), fieldName);
- fieldA.setAccessible(true);
- fieldA.setByte(clazz, newValue);*/
-
- }
-
- public static boolean invoke(Object objectInstance, String methodName, Class[] parameters, Object[] values){
- if (objectInstance == null || methodName == null || parameters == null || values == null){
- return false;
- }
- Class<?> mLocalClass = (objectInstance instanceof Class ? (Class<?>) objectInstance : objectInstance.getClass());
- Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+mLocalClass.getCanonicalName()+".");
- try {
- Method mInvokingMethod = mLocalClass.getDeclaredMethod(methodName, parameters);
- if (mInvokingMethod != null){
- return invoke(objectInstance, mInvokingMethod, values);
- }
- }
- catch (NoSuchMethodException | SecurityException | IllegalArgumentException e) {
- Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+mLocalClass.getName());
- }
-
- Logger.REFLECTION("Invoke failed or did something wrong.");
- return false;
- }
-
- public static boolean invoke(Object objectInstance, Method method, Object[] values){
- if (method == null || values == null || (!ReflectionUtils.isStaticMethod(method) && objectInstance == null)){
- //Logger.REFLECTION("Null value when trying to Dynamically invoke "+methodName+" on an object of type: "+objectInstance.getClass().getName());
- return false;
- }
- String methodName = method.getName();
- String classname = objectInstance != null ? objectInstance.getClass().getCanonicalName() : method.getDeclaringClass().getCanonicalName();
- Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+classname+".");
- try {
- Method mInvokingMethod = method;
- if (mInvokingMethod != null){
- Logger.REFLECTION(methodName+" was not null.");
- if ((boolean) mInvokingMethod.invoke(objectInstance, values)){
- Logger.REFLECTION("Successfully invoked "+methodName+".");
- return true;
- }
- else {
- Logger.REFLECTION("Invocation failed for "+methodName+".");
- }
- }
- }
- catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+classname);
- }
- Logger.REFLECTION("Invoke failed or did something wrong.");
- return false;
- }
-
- public static boolean invokeVoid(Object objectInstance, Method method, Object[] values){
- if (method == null || values == null || (!ReflectionUtils.isStaticMethod(method) && objectInstance == null)){
- //Logger.REFLECTION("Null value when trying to Dynamically invoke "+methodName+" on an object of type: "+objectInstance.getClass().getName());
- return false;
- }
- String methodName = method.getName();
- String classname = objectInstance != null ? objectInstance.getClass().getCanonicalName() : method.getDeclaringClass().getCanonicalName();
- Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+classname+".");
- try {
- Method mInvokingMethod = method;
- if (mInvokingMethod != null){
- Logger.REFLECTION(methodName+" was not null.");
- mInvokingMethod.invoke(objectInstance, values);
- Logger.REFLECTION("Successfully invoked "+methodName+".");
- return true;
- }
- }
- catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+classname);
- }
- Logger.REFLECTION("Invoke failed or did something wrong.");
- return false;
- }
-
- public static boolean invokeVoid(Object objectInstance, String methodName, Class[] parameters, Object[] values){
- if (objectInstance == null || methodName == null || parameters == null || values == null){
- return false;
- }
- Class<?> mLocalClass = (objectInstance instanceof Class ? (Class<?>) objectInstance : objectInstance.getClass());
- Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+mLocalClass.getCanonicalName()+".");
- try {
- Method mInvokingMethod = mLocalClass.getDeclaredMethod(methodName, parameters);
- if (mInvokingMethod != null){
- Logger.REFLECTION(methodName+" was not null.");
- mInvokingMethod.invoke(objectInstance, values);
- Logger.REFLECTION("Successfully invoked "+methodName+".");
- return true;
- }
- else {
- Logger.REFLECTION(methodName+" is null.");
- }
- }
- catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+mLocalClass.getName());
- }
-
- Logger.REFLECTION("Invoke failed or did something wrong.");
- return false;
- }
-
-
- public static Object invokeNonBool(Object objectInstance, Method method, Object[] values){
- if ((!ReflectionUtils.isStaticMethod(method) && objectInstance == null) || method == null || values == null){
- return false;
- }
- String methodName = method.getName();
- String classname = objectInstance != null ? objectInstance.getClass().getCanonicalName() : method.getDeclaringClass().getCanonicalName();
- Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+classname+".");
- try {
- return method.invoke(objectInstance, values);
- }
- catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+classname);
- }
-
- Logger.REFLECTION("Invoke failed or did something wrong.");
- return null;
- }
-
- public static Object invokeNonBool(Object objectInstance, String methodName, Class[] parameters, Object[] values){
- if (objectInstance == null || methodName == null || parameters == null || values == null){
- return false;
- }
- Class<?> mLocalClass = (objectInstance instanceof Class ? (Class<?>) objectInstance : objectInstance.getClass());
- Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+mLocalClass.getCanonicalName()+".");
- try {
- Method mInvokingMethod = mLocalClass.getDeclaredMethod(methodName, parameters);
- if (mInvokingMethod != null){
- Logger.REFLECTION(methodName+" was not null.");
- return mInvokingMethod.invoke(objectInstance, values);
- }
- else {
- Logger.REFLECTION(methodName+" is null.");
- }
- }
- catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+mLocalClass.getName());
- }
-
- Logger.REFLECTION("Invoke failed or did something wrong.");
- return null;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /*
- * Internal Magic that probably should not get exposed.
- */
-
-
-
-
-
-
-
-
-
- /*
- *
- * Below Code block is used for determining generic types associated with type<E>
- *
- */
-
-
- //https://xebia.com/blog/acessing-generic-types-at-runtime-in-java/
- //https://www.javacodegeeks.com/2013/12/advanced-java-generics-retreiving-generic-type-arguments.html
- public static Class<?> findSuperClassParameterType(Object instance, Class<?> classOfInterest, int parameterIndex) {
- Class<?> subClass = instance.getClass();
- while (classOfInterest != subClass.getSuperclass()) {
- // instance.getClass() is no subclass of classOfInterest or instance is a direct instance of classOfInterest
- subClass = subClass.getSuperclass();
- if (subClass == null) {
- return null;
- }
- }
- ParameterizedType parameterizedType = (ParameterizedType) subClass.getGenericSuperclass();
- Class<?> aReturn;
- aReturn = (Class<?>) parameterizedType.getActualTypeArguments()[parameterIndex];
- return aReturn;
- }
-
- public static Class<?> findSubClassParameterType(Object instance, Class<?> classOfInterest, int parameterIndex) {
- Map<Type, Type> typeMap = new HashMap<Type, Type>();
- Class<?> instanceClass = instance.getClass();
- while (classOfInterest != instanceClass.getSuperclass()) {
- extractTypeArguments(typeMap, instanceClass);
- instanceClass = instanceClass.getSuperclass();
- if (instanceClass == null) {
- return null;
- }
- }
-
- ParameterizedType parameterizedType = (ParameterizedType) instanceClass.getGenericSuperclass();
- Type actualType = parameterizedType.getActualTypeArguments()[parameterIndex];
- if (typeMap.containsKey(actualType)) {
- actualType = typeMap.get(actualType);
- }
- if (actualType instanceof Class) {
- return (Class<?>) actualType;
- } else if (actualType instanceof TypeVariable) {
- return browseNestedTypes(instance, (TypeVariable<?>) actualType);
- } else {
- return null;
- }
- }
-
- private static void extractTypeArguments(Map<Type, Type> typeMap, Class<?> clazz) {
- Type genericSuperclass = clazz.getGenericSuperclass();
- if (!(genericSuperclass instanceof ParameterizedType)) {
- return;
- }
-
- ParameterizedType parameterizedType = (ParameterizedType) genericSuperclass;
- Type[] typeParameter = ((Class<?>) parameterizedType.getRawType()).getTypeParameters();
- Type[] actualTypeArgument = parameterizedType.getActualTypeArguments();
- for (int i = 0; i < typeParameter.length; i++) {
- if(typeMap.containsKey(actualTypeArgument[i])) {
- actualTypeArgument[i] = typeMap.get(actualTypeArgument[i]);
- }
- typeMap.put(typeParameter[i], actualTypeArgument[i]);
- }
- }
-
- private static Class<?> browseNestedTypes(Object instance, TypeVariable<?> actualType) {
- Class<?> instanceClass = instance.getClass();
- List<Class<?>> nestedOuterTypes = new LinkedList<Class<?>>();
- for (Class<?> enclosingClass = instanceClass
- .getEnclosingClass(); enclosingClass != null; enclosingClass = enclosingClass.getEnclosingClass()) {
- try {
- Field this$0 = instanceClass.getDeclaredField("this$0");
- Object outerInstance = this$0.get(instance);
- Class<?> outerClass = outerInstance.getClass();
- nestedOuterTypes.add(outerClass);
- Map<Type, Type> outerTypeMap = new HashMap<Type, Type>();
- extractTypeArguments(outerTypeMap, outerClass);
- for (Map.Entry<Type, Type> entry : outerTypeMap.entrySet()) {
- if (!(entry.getKey() instanceof TypeVariable)) {
- continue;
- }
- TypeVariable<?> foundType = (TypeVariable<?>) entry.getKey();
- if (foundType.getName().equals(actualType.getName())
- && isInnerClass(foundType.getGenericDeclaration(), actualType.getGenericDeclaration())) {
- if (entry.getValue() instanceof Class) {
- return (Class<?>) entry.getValue();
- }
- actualType = (TypeVariable<?>) entry.getValue();
- }
- }
- } catch (NoSuchFieldException | IllegalAccessException e) {
-
- }
-
- }
- return null;
- }
-
- private static boolean isInnerClass(GenericDeclaration outerDeclaration, GenericDeclaration innerDeclaration) {
- if (!(outerDeclaration instanceof Class) || !(innerDeclaration instanceof Class)) {
- return false;
- }
- Class<?> outerClass = (Class<?>) outerDeclaration;
- Class<?> innerClass = (Class<?>) innerDeclaration;
- while ((innerClass = innerClass.getEnclosingClass()) != null) {
- if (innerClass == outerClass) {
- return true;
- }
- }
- return false;
- }
-
-
- /*
- *
- * End of Generics Block
- *
- */
-
-
-
- private static Field getField_Internal(final Class<?> clazz, final String fieldName) throws NoSuchFieldException {
- try {
- Logger.REFLECTION("Field: Internal Lookup: "+fieldName);
- Field k = clazz.getDeclaredField(fieldName);
- makeFieldAccessible(k);
- //Logger.REFLECTION("Got Field from Class. "+fieldName+" did exist within "+clazz.getCanonicalName()+".");
- return k;
- } catch (final NoSuchFieldException e) {
- Logger.REFLECTION("Field: Internal Lookup Failed: "+fieldName);
- final Class<?> superClass = clazz.getSuperclass();
- if (superClass == null) {
- Logger.REFLECTION("Unable to find field '"+fieldName+"'");
- //Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+".");
- throw e;
- }
- Logger.REFLECTION("Method: Recursion Lookup: "+fieldName+" - Checking in "+superClass.getName());
- //Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+". Trying super class.");
- return getField_Internal(superClass, fieldName);
- }
- }
-
- /**
- * if (isPresent("com.optionaldependency.DependencyClass")) ||
- * This block will never execute when the dependency is not present. There is
- * therefore no more risk of code throwing NoClassDefFoundException.
- */
- private static boolean isClassPresent(final String className) {
- try {
- Class.forName(className);
- return true;
- } catch (final Throwable ex) {
- // Class or one of its dependencies is not present...
- return false;
- }
- }
-
- @Deprecated
- public static Method getMethodViaReflection(final Class<?> lookupClass, final String methodName,
- final boolean invoke) throws Exception {
- final Class<? extends Class> lookup = lookupClass.getClass();
- final Method m = lookup.getDeclaredMethod(methodName);
- m.setAccessible(true);// Abracadabra
- if (invoke) {
- m.invoke(lookup);// now its OK
- }
- return m;
- }
-
- private static Method getMethod_Internal(Class<?> aClass, String aMethodName, Class<?>... aTypes) {
- Method m = null;
- try {
- Logger.REFLECTION("Method: Internal Lookup: "+aMethodName);
- m = aClass.getDeclaredMethod(aMethodName, aTypes);
- if (m != null) {
- m.setAccessible(true);
- int modifiers = m.getModifiers();
- Field modifierField = m.getClass().getDeclaredField("modifiers");
- modifiers = modifiers & ~Modifier.FINAL;
- modifierField.setAccessible(true);
- modifierField.setInt(m, modifiers);
- }
- }
- catch (Throwable t) {
- Logger.REFLECTION("Method: Internal Lookup Failed: "+aMethodName);
- try {
- m = getMethodRecursively(aClass, aMethodName);
- } catch (NoSuchMethodException e) {
- Logger.REFLECTION("Unable to find method '"+aMethodName+"'");
- e.printStackTrace();
- dumpClassInfo(aClass);
- }
- }
- return m;
- }
-
- private static Constructor<?> getConstructor_Internal(Class<?> aClass, Class<?>... aTypes) {
- Constructor<?> c = null;
- try {
- Logger.REFLECTION("Constructor: Internal Lookup: "+aClass.getName());
- c = aClass.getDeclaredConstructor(aTypes);
- if (c != null) {
- c.setAccessible(true);
- int modifiers = c.getModifiers();
- Field modifierField = c.getClass().getDeclaredField("modifiers");
- modifiers = modifiers & ~Modifier.FINAL;
- modifierField.setAccessible(true);
- modifierField.setInt(c, modifiers);
- }
- }
- catch (Throwable t) {
- Logger.REFLECTION("Constructor: Internal Lookup Failed: "+aClass.getName());
- try {
- c = getConstructorRecursively(aClass, aTypes);
- } catch (Exception e) {
- Logger.REFLECTION("Unable to find method '"+aClass.getName()+"'");
- e.printStackTrace();
- dumpClassInfo(aClass);
- }
- }
- return c;
- }
-
- private static Constructor<?> getConstructorRecursively(Class<?> aClass, Class<?>... aTypes) throws Exception {
- try {
- Logger.REFLECTION("Constructor: Recursion Lookup: "+aClass.getName());
- Constructor<?> c = aClass.getConstructor(aTypes);
- if (c != null) {
- c.setAccessible(true);
- int modifiers = c.getModifiers();
- Field modifierField = c.getClass().getDeclaredField("modifiers");
- modifiers = modifiers & ~Modifier.FINAL;
- modifierField.setAccessible(true);
- modifierField.setInt(c, modifiers);
- }
- return c;
- } catch (final NoSuchMethodException | IllegalArgumentException | IllegalAccessException e) {
- final Class<?> superClass = aClass.getSuperclass();
- if (superClass == null || superClass == Object.class) {
- throw e;
- }
- return getConstructor_Internal(superClass, aTypes);
- }
- }
-
- private static Method getMethodRecursively(final Class<?> clazz, final String aMethodName) throws NoSuchMethodException {
- try {
- Logger.REFLECTION("Method: Recursion Lookup: "+aMethodName);
- Method k = clazz.getDeclaredMethod(aMethodName);
- makeMethodAccessible(k);
- return k;
- } catch (final NoSuchMethodException e) {
- final Class<?> superClass = clazz.getSuperclass();
- if (superClass == null || superClass == Object.class) {
- throw e;
- }
- return getMethod_Internal(superClass, aMethodName);
- }
- }
-
- private static void dumpClassInfo(Class<?> aClass) {
- Logger.INFO("We ran into an error processing reflection in "+aClass.getName()+", dumping all data for debugging.");
- // Get the methods
- Method[] methods = aClass.getDeclaredMethods();
- Field[] fields = aClass.getDeclaredFields();
- Constructor[] consts = aClass.getDeclaredConstructors();
-
- Logger.INFO("Dumping all Methods.");
- for (Method method : methods) {
- System.out.println(method.getName()+" | "+StringUtils.getDataStringFromArray(method.getParameterTypes()));
- }
- Logger.INFO("Dumping all Fields.");
- for (Field f : fields) {
- System.out.println(f.getName());
- }
- Logger.INFO("Dumping all Constructors.");
- for (Constructor<?> c : consts) {
- System.out.println(c.getName()+" | "+c.getParameterCount()+" | "+StringUtils.getDataStringFromArray(c.getParameterTypes()));
- }
- }
-
- private static Class<?> getNonPublicClass(final String className) {
- Class<?> c = null;
- try {
- c = Class.forName(className);
- } catch (final ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // full package name --------^^^^^^^^^^
- // or simpler without Class.forName:
- // Class<package1.A> c = package1.A.class;
-
- if (null != c) {
- // In our case we need to use
- Constructor<?> constructor = null;
- try {
- constructor = c.getDeclaredConstructor();
- } catch (NoSuchMethodException | SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // note: getConstructor() can return only public constructors
- // so we needed to search for any Declared constructor
-
- // now we need to make this constructor accessible
- if (null != constructor) {
- constructor.setAccessible(true);// ABRACADABRA!
-
- try {
- final Object o = constructor.newInstance();
- return (Class<?>) o;
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- return null;
- }
-
- private static Class<?> getClass_Internal(String string) {
- Class<?> aClass = null;
- if (ReflectionUtils.doesClassExist(string)) {
- try {
- aClass = Class.forName(string);
- }
- catch (ClassNotFoundException e) {
- aClass = getNonPublicClass(string);
- }
- }
-
- if (aClass == null) {
- String aClassName = "";
- Logger.REFLECTION("Splitting "+string+" to try look for hidden classes.");
- String[] aData = string.split("\\.");
- Logger.REFLECTION("Obtained "+aData.length+" pieces.");
- for (int i=0;i<(aData.length-1);i++) {
- aClassName += (i > 0) ? "."+aData[i] : ""+aData[i];
- Logger.REFLECTION("Building: "+aClassName);
- }
- if (aClassName != null && aClassName.length() > 0) {
- Logger.REFLECTION("Trying to search '"+aClassName+"' for inner classes.");
- Class<?> clazz = ReflectionUtils.getClass(aClassName);
- if (clazz != null) {
- Class[] y = clazz.getDeclaredClasses();
- if (y == null || y.length <= 0) {
- Logger.REFLECTION("No hidden inner classes found.");
- return null;
- }
- else {
- boolean found = false;
- for (Class<?> h : y) {
- Logger.REFLECTION("Found hidden inner class: "+h.getCanonicalName());
- if (h.getSimpleName().toLowerCase().equals(aData[aData.length-1].toLowerCase())) {
- Logger.REFLECTION("Found correct class. ["+aData[aData.length-1]+"] Caching at correct location: "+string);
- Logger.REFLECTION("Found at location: "+h.getCanonicalName());
- ReflectionUtils.mCachedClasses.put(string, h);
- aClass = h;
- found = true;
- break;
- }
- }
- if (!found) {
- return null;
- }
- }
- }
- else {
- return null;
- }
- }
- else {
- return null;
- }
- }
- return aClass;
- }
-
- /**
- *
- * Set the value of a field reflectively.
- */
- private static void setFieldValue_Internal(Object owner, Field field, Object value) throws Exception {
- makeModifiable(field);
- field.set(owner, value);
- }
-
- /**
- * Force the field to be modifiable and accessible.
- */
- private static void makeModifiable(Field nameField) throws Exception {
- nameField.setAccessible(true);
- Field modifiers = getField(Field.class, "modifiers");
- modifiers.setAccessible(true);
- modifiers.setInt(nameField, nameField.getModifiers() & ~Modifier.FINAL);
- }
-
-
- public static boolean doesFieldExist(String clazz, String string) {
- return doesFieldExist(ReflectionUtils.getClass(clazz), string);
- }
-
- public static boolean doesFieldExist(Class<?> clazz, String string) {
- if (clazz != null) {
- if (ReflectionUtils.getField(clazz, string) != null) {
- return true;
- }
- }
- return false;
- }
-
- public static <T> T getFieldValue(Field field) {
- return getFieldValue(field, null);
- }
-
- public static <T> T getFieldValue(Field field, Object instance) {
- try {
- return (T) field.get(instance);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- return null;
- }
-
- public static <T> T createNewInstanceFromConstructor(Constructor aConstructor, Object[] aArgs) {
- T aInstance;
- try {
- aInstance = (T) aConstructor.newInstance(aArgs);
- if (aInstance != null) {
- return aInstance;
- }
- }
- catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static Enum getEnum(Class<Enum> sgtbees, String name) {
- if (sgtbees.isEnum()) {
- Object[] aValues = sgtbees.getEnumConstants();
- for (Object o : aValues) {
- if (o.toString().toLowerCase().equals(name.toLowerCase())) {
- return (Enum) o;
- }
- }
- }
- return null;
- }
-
-
+ public static Map<String, Class<?>> mCachedClasses = new LinkedHashMap<String, Class<?>>();
+ public static Map<String, CachedMethod> mCachedMethods = new LinkedHashMap<String, CachedMethod>();
+ public static Map<String, CachedField> mCachedFields = new LinkedHashMap<String, CachedField>();
+ public static Map<String, CachedConstructor> mCachedConstructors = new LinkedHashMap<String, CachedConstructor>();
+
+ private static class CachedConstructor {
+
+ private final Constructor<?> METHOD;
+
+ public CachedConstructor(Constructor<?> aCons) {
+ METHOD = aCons;
+ }
+
+ public Constructor<?> get() {
+ return METHOD;
+ }
+ }
+
+ private static class CachedMethod {
+
+ private final boolean STATIC;
+ private final Method METHOD;
+
+ public CachedMethod(Method aMethod, boolean isStatic) {
+ METHOD = aMethod;
+ STATIC = isStatic;
+ }
+
+ public Method get() {
+ return METHOD;
+ }
+
+ public boolean type() {
+ return STATIC;
+ }
+ }
+
+ private static class CachedField {
+
+ private final boolean STATIC;
+ private final Field FIELD;
+
+ public CachedField(Field aField, boolean isStatic) {
+ FIELD = aField;
+ STATIC = isStatic;
+ }
+
+ public Field get() {
+ return FIELD;
+ }
+
+ public boolean type() {
+ return STATIC;
+ }
+ }
+
+ private static boolean cacheClass(Class<?> aClass) {
+ if (aClass == null) {
+ return false;
+ }
+ Class<?> y = mCachedClasses.get(aClass.getCanonicalName());
+ if (y == null) {
+ mCachedClasses.put(aClass.getCanonicalName(), aClass);
+ return true;
+ }
+ return false;
+ }
+
+ private static boolean cacheMethod(Class<?> aClass, Method aMethod) {
+ if (aMethod == null) {
+ return false;
+ }
+ boolean isStatic = Modifier.isStatic(aMethod.getModifiers());
+ CachedMethod y = mCachedMethods.get(
+ aClass.getName() + "." + aMethod.getName() + "." + ArrayUtils.toString(aMethod.getParameterTypes()));
+ if (y == null) {
+ mCachedMethods.put(
+ aClass.getName() + "." + aMethod.getName() + "." + ArrayUtils.toString(aMethod.getParameterTypes()),
+ new CachedMethod(aMethod, isStatic));
+ return true;
+ }
+ return false;
+ }
+
+ private static boolean cacheField(Class<?> aClass, Field aField) {
+ if (aField == null) {
+ return false;
+ }
+ boolean isStatic = Modifier.isStatic(aField.getModifiers());
+ CachedField y = mCachedFields.get(aClass.getName() + "." + aField.getName());
+ if (y == null) {
+ mCachedFields.put(aClass.getName() + "." + aField.getName(), new CachedField(aField, isStatic));
+ return true;
+ }
+ return false;
+ }
+
+ private static boolean cacheConstructor(Class<?> aClass, Constructor<?> aConstructor) {
+ if (aConstructor == null) {
+ return false;
+ }
+ CachedConstructor y =
+ mCachedConstructors.get(aClass.getName() + "." + ArrayUtils.toString(aConstructor.getParameterTypes()));
+ if (y == null) {
+ mCachedConstructors.put(
+ aClass.getName() + "." + ArrayUtils.toString(aConstructor.getParameterTypes()),
+ new CachedConstructor(aConstructor));
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns a cached {@link Constructor} object.
+ * @param aClass - Class containing the Constructor.
+ * @param aTypes - Varags Class Types for objects constructor.
+ * @return - Valid, non-final, {@link Method} object, or {@link null}.
+ */
+ public static Constructor<?> getConstructor(Class<?> aClass, Class<?>... aTypes) {
+ if (aClass == null || aTypes == null) {
+ return null;
+ }
+
+ String aMethodKey = ArrayUtils.toString(aTypes);
+ // Logger.REFLECTION("Looking up method in cache: "+(aClass.getName()+"."+aMethodName + "." + aMethodKey));
+ CachedConstructor y = mCachedConstructors.get(aClass.getName() + "." + aMethodKey);
+ if (y == null) {
+ Constructor<?> u = getConstructor_Internal(aClass, aTypes);
+ if (u != null) {
+ Logger.REFLECTION("Caching Constructor: " + aClass.getName() + "." + aMethodKey);
+ cacheConstructor(aClass, u);
+ return u;
+ } else {
+ return null;
+ }
+ } else {
+ return y.get();
+ }
+ }
+
+ /**
+ * Returns a cached {@link Class} object.
+ * @param aClassCanonicalName - The canonical name of the underlying class.
+ * @return - Valid, {@link Class} object, or {@link null}.
+ */
+ public static Class<?> getClass(String aClassCanonicalName) {
+ if (aClassCanonicalName == null || aClassCanonicalName.length() <= 0) {
+ return null;
+ }
+ Class<?> y = mCachedClasses.get(aClassCanonicalName);
+ if (y == null) {
+ y = getClass_Internal(aClassCanonicalName);
+ if (y != null) {
+ Logger.REFLECTION("Caching Class: " + aClassCanonicalName);
+ cacheClass(y);
+ }
+ }
+ return y;
+ }
+
+ /**
+ * Returns a cached {@link Method} object. Wraps {@link #getMethod(Class, String, Class...)}.
+ * @param aObject - Object containing the Method.
+ * @param aMethodName - Method's name in {@link String} form.
+ * @param aTypes - Class Array of Types for {@link Method}'s constructor.
+ * @return - Valid, non-final, {@link Method} object, or {@link null}.
+ */
+ public static Method getMethod(Object aObject, String aMethodName, Class[] aTypes) {
+ return getMethod(aObject.getClass(), aMethodName, aTypes);
+ }
+
+ /**
+ * Returns a cached {@link Method} object.
+ * @param aClass - Class containing the Method.
+ * @param aMethodName - Method's name in {@link String} form.
+ * @param aTypes - Varags Class Types for {@link Method}'s constructor.
+ * @return - Valid, non-final, {@link Method} object, or {@link null}.
+ */
+ public static Method getMethod(Class<?> aClass, String aMethodName, Class<?>... aTypes) {
+ if (aClass == null || aMethodName == null || aMethodName.length() <= 0) {
+ return null;
+ }
+ String aMethodKey = ArrayUtils.toString(aTypes);
+ // Logger.REFLECTION("Looking up method in cache: "+(aClass.getName()+"."+aMethodName + "." + aMethodKey));
+ CachedMethod y = mCachedMethods.get(aClass.getName() + "." + aMethodName + "." + aMethodKey);
+ if (y == null) {
+ Method u = getMethod_Internal(aClass, aMethodName, aTypes);
+ if (u != null) {
+ Logger.REFLECTION("Caching Method: " + aMethodName + "." + aMethodKey);
+ cacheMethod(aClass, u);
+ return u;
+ } else {
+ return null;
+ }
+ } else {
+ return y.get();
+ }
+ }
+
+ public static boolean isStaticMethod(Class<?> aClass, String aMethodName, Class<?>... aTypes) {
+ return isStaticMethod(ReflectionUtils.getMethod(aClass, aMethodName, aTypes));
+ }
+
+ public static boolean isStaticMethod(Method aMethod) {
+ if (aMethod != null && Modifier.isStatic(aMethod.getModifiers())) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns a cached {@link Field} object.
+ * @param aClass - Class containing the Method.
+ * @param aFieldName - Field name in {@link String} form.
+ * @return - Valid, non-final, {@link Field} object, or {@link null}.
+ */
+ public static Field getField(final Class<?> aClass, final String aFieldName) {
+ if (aClass == null || aFieldName == null || aFieldName.length() <= 0) {
+ return null;
+ }
+ CachedField y = mCachedFields.get(aClass.getName() + "." + aFieldName);
+ if (y == null) {
+ Field u;
+ try {
+ u = getField_Internal(aClass, aFieldName);
+ if (u != null) {
+ Logger.REFLECTION("Caching Field '" + aFieldName + "' from " + aClass.getName());
+ cacheField(aClass, u);
+ return u;
+ }
+ } catch (NoSuchFieldException e) {
+ }
+ return null;
+
+ } else {
+ return y.get();
+ }
+ }
+
+ public static Field[] getAllFields(final Class<?> aClass) {
+ if (aClass == null) {
+ return null;
+ }
+ Field[] aFields = aClass.getDeclaredFields();
+ for (Field f : aFields) {
+ CachedField y = mCachedFields.get(aClass.getName() + "." + f.getName());
+ if (y == null) {
+ makeFieldAccessible(f);
+ cacheField(aClass, f);
+ }
+ }
+ return aFields;
+ }
+
+ /**
+ * Returns a cached {@link Field} object.
+ * @param aInstance - {@link Object} to get the field instance from.
+ * @param aFieldName - Field name in {@link String} form.
+ * @return - Valid, non-final, {@link Field} object, or {@link null}.
+ */
+ public static <T> T getField(final Object aInstance, final String aFieldName) {
+ try {
+ return (T) getField(aInstance.getClass(), aFieldName).get(aInstance);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return null;
+ }
+ }
+
+ /*
+ * Utility Functions
+ */
+
+ public static boolean doesClassExist(final String classname) {
+ return isClassPresent(classname);
+ }
+
+ /**
+ * Returns the class of the objects type parameter
+ * @param o - Object to examine paramters on
+ * @return - a Class<?> or null
+ */
+ public static Class<?> getTypeOfGenericObject(Object o) {
+ Class<?> aTypeParam = findSuperClassParameterType(o, o.getClass(), 0);
+ if (aTypeParam == null) {
+ aTypeParam = findSubClassParameterType(o, o.getClass(), 0);
+ }
+ return aTypeParam;
+ }
+
+ public static void makeFieldAccessible(final Field field) {
+ if (!Modifier.isPublic(field.getModifiers())
+ || !Modifier.isPublic(field.getDeclaringClass().getModifiers())) {
+ field.setAccessible(true);
+ }
+ }
+
+ public static void makeMethodAccessible(final Method field) {
+ if (!Modifier.isPublic(field.getModifiers())
+ || !Modifier.isPublic(field.getDeclaringClass().getModifiers())) {
+ field.setAccessible(true);
+ }
+ }
+
+ /**
+ * Get the method name for a depth in call stack. <br />
+ * Utility function
+ * @param depth depth in the call stack (0 means current method, 1 means call method, ...)
+ * @return Method name
+ */
+ public static String getMethodName(final int depth) {
+ final StackTraceElement[] ste = new Throwable().getStackTrace();
+ // System. out.println(ste[ste.length-depth].getClassName()+"#"+ste[ste.length-depth].getMethodName());
+ if (ste.length < depth) {
+ return "No valid stack.";
+ }
+ return ste[depth + 1].getMethodName();
+ }
+
+ /**
+ *
+ * @param aPackageName - The full {@link Package} name in {@link String} form.
+ * @return - {@link Boolean} object. True if loaded > 0 classes.
+ */
+ public static boolean dynamicallyLoadClassesInPackage(String aPackageName) {
+ ClassLoader classLoader = ReflectionUtils.class.getClassLoader();
+ int loaded = 0;
+ try {
+ ClassPath path = ClassPath.from(classLoader);
+ for (ClassPath.ClassInfo info : path.getTopLevelClassesRecursive(aPackageName)) {
+ Class<?> clazz = Class.forName(info.getName(), true, classLoader);
+ if (clazz != null) {
+ loaded++;
+ Logger.INFO("Found " + clazz.getCanonicalName() + ". [" + loaded + "]");
+ }
+ }
+ } catch (ClassNotFoundException | IOException e) {
+
+ }
+
+ return loaded > 0;
+ }
+
+ public static void loadClass(String aClassName) {
+ try {
+ Class.forName(aClassName, true, ReflectionUtils.class.getClassLoader());
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static boolean setField(final Object object, final String fieldName, final Object fieldValue) {
+ Class<?> clazz;
+ if (object instanceof Class) {
+ clazz = (Class<?>) object;
+ } else {
+ clazz = object.getClass();
+ }
+ while (clazz != null) {
+ try {
+ final Field field = getField(clazz, fieldName);
+ if (field != null) {
+ setFieldValue_Internal(object, field, fieldValue);
+ return true;
+ }
+ } catch (final NoSuchFieldException e) {
+ Logger.REFLECTION("setField(" + object.toString() + ", " + fieldName + ") failed.");
+ clazz = clazz.getSuperclass();
+ } catch (final Exception e) {
+ Logger.REFLECTION("setField(" + object.toString() + ", " + fieldName + ") failed.");
+ throw new IllegalStateException(e);
+ }
+ }
+ return false;
+ }
+
+ public static boolean setField(final Object object, final Field field, final Object fieldValue) {
+ if (field == null) return false;
+ Class<?> clazz;
+ if (object instanceof Class) {
+ clazz = (Class<?>) object;
+ } else {
+ clazz = object.getClass();
+ }
+ while (clazz != null) {
+ try {
+ final Field field2 = getField(clazz, field.getName());
+ if (field2 != null) {
+ setFieldValue_Internal(object, field, fieldValue);
+ return true;
+ }
+ } catch (final NoSuchFieldException e) {
+ Logger.REFLECTION("setField(" + object.toString() + ", " + field.getName() + ") failed.");
+ clazz = clazz.getSuperclass();
+ } catch (final Exception e) {
+ Logger.REFLECTION("setField(" + object.toString() + ", " + field.getName() + ") failed.");
+ throw new IllegalStateException(e);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Allows to change the state of an immutable instance. Huh?!?
+ */
+ public static void setFinalFieldValue(Class<?> clazz, String fieldName, Object newValue) {
+ Field nameField = getField(clazz, fieldName);
+ try {
+ setFieldValue_Internal(clazz, nameField, newValue);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ /**
+ * Allows to change the state of an immutable instance. Huh?!?
+ */
+ public static void setFinalFieldValue(Class<?> clazz, Field field, Object newValue) {
+ try {
+ setFieldValue_Internal(clazz, field, newValue);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ @Deprecated
+ public static void setFinalStatic(Field field, Object newValue) throws Exception {
+ field.setAccessible(true);
+ Field modifiersField = Field.class.getDeclaredField("modifiers");
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
+ field.set(null, newValue);
+ }
+
+ public static void setByte(Object clazz, String fieldName, byte newValue) throws Exception {
+ Field nameField = getField(clazz.getClass(), fieldName);
+ nameField.setAccessible(true);
+ int modifiers = nameField.getModifiers();
+ Field modifierField = nameField.getClass().getDeclaredField("modifiers");
+ modifiers = modifiers & ~Modifier.FINAL;
+ modifierField.setAccessible(true);
+ modifierField.setInt(nameField, modifiers);
+ // Utils.LOG_INFO("O-"+(byte) nameField.get(clazz) + " | "+newValue);
+ nameField.setByte(clazz, newValue);
+ // Utils.LOG_INFO("N-"+(byte) nameField.get(clazz));
+
+ /*final Field fieldA = getField(clazz.getClass(), fieldName);
+ fieldA.setAccessible(true);
+ fieldA.setByte(clazz, newValue);*/
+
+ }
+
+ public static boolean invoke(Object objectInstance, String methodName, Class[] parameters, Object[] values) {
+ if (objectInstance == null || methodName == null || parameters == null || values == null) {
+ return false;
+ }
+ Class<?> mLocalClass =
+ (objectInstance instanceof Class ? (Class<?>) objectInstance : objectInstance.getClass());
+ Logger.REFLECTION(
+ "Trying to invoke " + methodName + " on an instance of " + mLocalClass.getCanonicalName() + ".");
+ try {
+ Method mInvokingMethod = mLocalClass.getDeclaredMethod(methodName, parameters);
+ if (mInvokingMethod != null) {
+ return invoke(objectInstance, mInvokingMethod, values);
+ }
+ } catch (NoSuchMethodException | SecurityException | IllegalArgumentException e) {
+ Logger.REFLECTION(
+ "Failed to Dynamically invoke " + methodName + " on an object of type: " + mLocalClass.getName());
+ }
+
+ Logger.REFLECTION("Invoke failed or did something wrong.");
+ return false;
+ }
+
+ public static boolean invoke(Object objectInstance, Method method, Object[] values) {
+ if (method == null || values == null || (!ReflectionUtils.isStaticMethod(method) && objectInstance == null)) {
+ // Logger.REFLECTION("Null value when trying to Dynamically invoke "+methodName+" on an object of type:
+ // "+objectInstance.getClass().getName());
+ return false;
+ }
+ String methodName = method.getName();
+ String classname = objectInstance != null
+ ? objectInstance.getClass().getCanonicalName()
+ : method.getDeclaringClass().getCanonicalName();
+ Logger.REFLECTION("Trying to invoke " + methodName + " on an instance of " + classname + ".");
+ try {
+ Method mInvokingMethod = method;
+ if (mInvokingMethod != null) {
+ Logger.REFLECTION(methodName + " was not null.");
+ if ((boolean) mInvokingMethod.invoke(objectInstance, values)) {
+ Logger.REFLECTION("Successfully invoked " + methodName + ".");
+ return true;
+ } else {
+ Logger.REFLECTION("Invocation failed for " + methodName + ".");
+ }
+ }
+ } catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ Logger.REFLECTION("Failed to Dynamically invoke " + methodName + " on an object of type: " + classname);
+ }
+ Logger.REFLECTION("Invoke failed or did something wrong.");
+ return false;
+ }
+
+ public static boolean invokeVoid(Object objectInstance, Method method, Object[] values) {
+ if (method == null || values == null || (!ReflectionUtils.isStaticMethod(method) && objectInstance == null)) {
+ // Logger.REFLECTION("Null value when trying to Dynamically invoke "+methodName+" on an object of type:
+ // "+objectInstance.getClass().getName());
+ return false;
+ }
+ String methodName = method.getName();
+ String classname = objectInstance != null
+ ? objectInstance.getClass().getCanonicalName()
+ : method.getDeclaringClass().getCanonicalName();
+ Logger.REFLECTION("Trying to invoke " + methodName + " on an instance of " + classname + ".");
+ try {
+ Method mInvokingMethod = method;
+ if (mInvokingMethod != null) {
+ Logger.REFLECTION(methodName + " was not null.");
+ mInvokingMethod.invoke(objectInstance, values);
+ Logger.REFLECTION("Successfully invoked " + methodName + ".");
+ return true;
+ }
+ } catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ Logger.REFLECTION("Failed to Dynamically invoke " + methodName + " on an object of type: " + classname);
+ }
+ Logger.REFLECTION("Invoke failed or did something wrong.");
+ return false;
+ }
+
+ public static boolean invokeVoid(Object objectInstance, String methodName, Class[] parameters, Object[] values) {
+ if (objectInstance == null || methodName == null || parameters == null || values == null) {
+ return false;
+ }
+ Class<?> mLocalClass =
+ (objectInstance instanceof Class ? (Class<?>) objectInstance : objectInstance.getClass());
+ Logger.REFLECTION(
+ "Trying to invoke " + methodName + " on an instance of " + mLocalClass.getCanonicalName() + ".");
+ try {
+ Method mInvokingMethod = mLocalClass.getDeclaredMethod(methodName, parameters);
+ if (mInvokingMethod != null) {
+ Logger.REFLECTION(methodName + " was not null.");
+ mInvokingMethod.invoke(objectInstance, values);
+ Logger.REFLECTION("Successfully invoked " + methodName + ".");
+ return true;
+ } else {
+ Logger.REFLECTION(methodName + " is null.");
+ }
+ } catch (NoSuchMethodException
+ | SecurityException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ Logger.REFLECTION(
+ "Failed to Dynamically invoke " + methodName + " on an object of type: " + mLocalClass.getName());
+ }
+
+ Logger.REFLECTION("Invoke failed or did something wrong.");
+ return false;
+ }
+
+ public static Object invokeNonBool(Object objectInstance, Method method, Object[] values) {
+ if ((!ReflectionUtils.isStaticMethod(method) && objectInstance == null) || method == null || values == null) {
+ return false;
+ }
+ String methodName = method.getName();
+ String classname = objectInstance != null
+ ? objectInstance.getClass().getCanonicalName()
+ : method.getDeclaringClass().getCanonicalName();
+ Logger.REFLECTION("Trying to invoke " + methodName + " on an instance of " + classname + ".");
+ try {
+ return method.invoke(objectInstance, values);
+ } catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ Logger.REFLECTION("Failed to Dynamically invoke " + methodName + " on an object of type: " + classname);
+ }
+
+ Logger.REFLECTION("Invoke failed or did something wrong.");
+ return null;
+ }
+
+ public static Object invokeNonBool(Object objectInstance, String methodName, Class[] parameters, Object[] values) {
+ if (objectInstance == null || methodName == null || parameters == null || values == null) {
+ return false;
+ }
+ Class<?> mLocalClass =
+ (objectInstance instanceof Class ? (Class<?>) objectInstance : objectInstance.getClass());
+ Logger.REFLECTION(
+ "Trying to invoke " + methodName + " on an instance of " + mLocalClass.getCanonicalName() + ".");
+ try {
+ Method mInvokingMethod = mLocalClass.getDeclaredMethod(methodName, parameters);
+ if (mInvokingMethod != null) {
+ Logger.REFLECTION(methodName + " was not null.");
+ return mInvokingMethod.invoke(objectInstance, values);
+ } else {
+ Logger.REFLECTION(methodName + " is null.");
+ }
+ } catch (NoSuchMethodException
+ | SecurityException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ Logger.REFLECTION(
+ "Failed to Dynamically invoke " + methodName + " on an object of type: " + mLocalClass.getName());
+ }
+
+ Logger.REFLECTION("Invoke failed or did something wrong.");
+ return null;
+ }
+
+ /*
+ * Internal Magic that probably should not get exposed.
+ */
+
+ /*
+ *
+ * Below Code block is used for determining generic types associated with type<E>
+ *
+ */
+
+ // https://xebia.com/blog/acessing-generic-types-at-runtime-in-java/
+ // https://www.javacodegeeks.com/2013/12/advanced-java-generics-retreiving-generic-type-arguments.html
+ public static Class<?> findSuperClassParameterType(Object instance, Class<?> classOfInterest, int parameterIndex) {
+ Class<?> subClass = instance.getClass();
+ while (classOfInterest != subClass.getSuperclass()) {
+ // instance.getClass() is no subclass of classOfInterest or instance is a direct instance of classOfInterest
+ subClass = subClass.getSuperclass();
+ if (subClass == null) {
+ return null;
+ }
+ }
+ ParameterizedType parameterizedType = (ParameterizedType) subClass.getGenericSuperclass();
+ Class<?> aReturn;
+ aReturn = (Class<?>) parameterizedType.getActualTypeArguments()[parameterIndex];
+ return aReturn;
+ }
+
+ public static Class<?> findSubClassParameterType(Object instance, Class<?> classOfInterest, int parameterIndex) {
+ Map<Type, Type> typeMap = new HashMap<Type, Type>();
+ Class<?> instanceClass = instance.getClass();
+ while (classOfInterest != instanceClass.getSuperclass()) {
+ extractTypeArguments(typeMap, instanceClass);
+ instanceClass = instanceClass.getSuperclass();
+ if (instanceClass == null) {
+ return null;
+ }
+ }
+
+ ParameterizedType parameterizedType = (ParameterizedType) instanceClass.getGenericSuperclass();
+ Type actualType = parameterizedType.getActualTypeArguments()[parameterIndex];
+ if (typeMap.containsKey(actualType)) {
+ actualType = typeMap.get(actualType);
+ }
+ if (actualType instanceof Class) {
+ return (Class<?>) actualType;
+ } else if (actualType instanceof TypeVariable) {
+ return browseNestedTypes(instance, (TypeVariable<?>) actualType);
+ } else {
+ return null;
+ }
+ }
+
+ private static void extractTypeArguments(Map<Type, Type> typeMap, Class<?> clazz) {
+ Type genericSuperclass = clazz.getGenericSuperclass();
+ if (!(genericSuperclass instanceof ParameterizedType)) {
+ return;
+ }
+
+ ParameterizedType parameterizedType = (ParameterizedType) genericSuperclass;
+ Type[] typeParameter = ((Class<?>) parameterizedType.getRawType()).getTypeParameters();
+ Type[] actualTypeArgument = parameterizedType.getActualTypeArguments();
+ for (int i = 0; i < typeParameter.length; i++) {
+ if (typeMap.containsKey(actualTypeArgument[i])) {
+ actualTypeArgument[i] = typeMap.get(actualTypeArgument[i]);
+ }
+ typeMap.put(typeParameter[i], actualTypeArgument[i]);
+ }
+ }
+
+ private static Class<?> browseNestedTypes(Object instance, TypeVariable<?> actualType) {
+ Class<?> instanceClass = instance.getClass();
+ List<Class<?>> nestedOuterTypes = new LinkedList<Class<?>>();
+ for (Class<?> enclosingClass = instanceClass.getEnclosingClass();
+ enclosingClass != null;
+ enclosingClass = enclosingClass.getEnclosingClass()) {
+ try {
+ Field this$0 = instanceClass.getDeclaredField("this$0");
+ Object outerInstance = this$0.get(instance);
+ Class<?> outerClass = outerInstance.getClass();
+ nestedOuterTypes.add(outerClass);
+ Map<Type, Type> outerTypeMap = new HashMap<Type, Type>();
+ extractTypeArguments(outerTypeMap, outerClass);
+ for (Map.Entry<Type, Type> entry : outerTypeMap.entrySet()) {
+ if (!(entry.getKey() instanceof TypeVariable)) {
+ continue;
+ }
+ TypeVariable<?> foundType = (TypeVariable<?>) entry.getKey();
+ if (foundType.getName().equals(actualType.getName())
+ && isInnerClass(foundType.getGenericDeclaration(), actualType.getGenericDeclaration())) {
+ if (entry.getValue() instanceof Class) {
+ return (Class<?>) entry.getValue();
+ }
+ actualType = (TypeVariable<?>) entry.getValue();
+ }
+ }
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+
+ }
+ }
+ return null;
+ }
+
+ private static boolean isInnerClass(GenericDeclaration outerDeclaration, GenericDeclaration innerDeclaration) {
+ if (!(outerDeclaration instanceof Class) || !(innerDeclaration instanceof Class)) {
+ return false;
+ }
+ Class<?> outerClass = (Class<?>) outerDeclaration;
+ Class<?> innerClass = (Class<?>) innerDeclaration;
+ while ((innerClass = innerClass.getEnclosingClass()) != null) {
+ if (innerClass == outerClass) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /*
+ *
+ * End of Generics Block
+ *
+ */
+
+ private static Field getField_Internal(final Class<?> clazz, final String fieldName) throws NoSuchFieldException {
+ try {
+ Logger.REFLECTION("Field: Internal Lookup: " + fieldName);
+ Field k = clazz.getDeclaredField(fieldName);
+ makeFieldAccessible(k);
+ // Logger.REFLECTION("Got Field from Class. "+fieldName+" did exist within "+clazz.getCanonicalName()+".");
+ return k;
+ } catch (final NoSuchFieldException e) {
+ Logger.REFLECTION("Field: Internal Lookup Failed: " + fieldName);
+ final Class<?> superClass = clazz.getSuperclass();
+ if (superClass == null) {
+ Logger.REFLECTION("Unable to find field '" + fieldName + "'");
+ // Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within
+ // "+clazz.getCanonicalName()+".");
+ throw e;
+ }
+ Logger.REFLECTION("Method: Recursion Lookup: " + fieldName + " - Checking in " + superClass.getName());
+ // Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within
+ // "+clazz.getCanonicalName()+". Trying super class.");
+ return getField_Internal(superClass, fieldName);
+ }
+ }
+
+ /**
+ * if (isPresent("com.optionaldependency.DependencyClass")) ||
+ * This block will never execute when the dependency is not present. There is
+ * therefore no more risk of code throwing NoClassDefFoundException.
+ */
+ private static boolean isClassPresent(final String className) {
+ try {
+ Class.forName(className);
+ return true;
+ } catch (final Throwable ex) {
+ // Class or one of its dependencies is not present...
+ return false;
+ }
+ }
+
+ @Deprecated
+ public static Method getMethodViaReflection(
+ final Class<?> lookupClass, final String methodName, final boolean invoke) throws Exception {
+ final Class<? extends Class> lookup = lookupClass.getClass();
+ final Method m = lookup.getDeclaredMethod(methodName);
+ m.setAccessible(true); // Abracadabra
+ if (invoke) {
+ m.invoke(lookup); // now its OK
+ }
+ return m;
+ }
+
+ private static Method getMethod_Internal(Class<?> aClass, String aMethodName, Class<?>... aTypes) {
+ Method m = null;
+ try {
+ Logger.REFLECTION("Method: Internal Lookup: " + aMethodName);
+ m = aClass.getDeclaredMethod(aMethodName, aTypes);
+ if (m != null) {
+ m.setAccessible(true);
+ int modifiers = m.getModifiers();
+ Field modifierField = m.getClass().getDeclaredField("modifiers");
+ modifiers = modifiers & ~Modifier.FINAL;
+ modifierField.setAccessible(true);
+ modifierField.setInt(m, modifiers);
+ }
+ } catch (Throwable t) {
+ Logger.REFLECTION("Method: Internal Lookup Failed: " + aMethodName);
+ try {
+ m = getMethodRecursively(aClass, aMethodName);
+ } catch (NoSuchMethodException e) {
+ Logger.REFLECTION("Unable to find method '" + aMethodName + "'");
+ e.printStackTrace();
+ dumpClassInfo(aClass);
+ }
+ }
+ return m;
+ }
+
+ private static Constructor<?> getConstructor_Internal(Class<?> aClass, Class<?>... aTypes) {
+ Constructor<?> c = null;
+ try {
+ Logger.REFLECTION("Constructor: Internal Lookup: " + aClass.getName());
+ c = aClass.getDeclaredConstructor(aTypes);
+ if (c != null) {
+ c.setAccessible(true);
+ int modifiers = c.getModifiers();
+ Field modifierField = c.getClass().getDeclaredField("modifiers");
+ modifiers = modifiers & ~Modifier.FINAL;
+ modifierField.setAccessible(true);
+ modifierField.setInt(c, modifiers);
+ }
+ } catch (Throwable t) {
+ Logger.REFLECTION("Constructor: Internal Lookup Failed: " + aClass.getName());
+ try {
+ c = getConstructorRecursively(aClass, aTypes);
+ } catch (Exception e) {
+ Logger.REFLECTION("Unable to find method '" + aClass.getName() + "'");
+ e.printStackTrace();
+ dumpClassInfo(aClass);
+ }
+ }
+ return c;
+ }
+
+ private static Constructor<?> getConstructorRecursively(Class<?> aClass, Class<?>... aTypes) throws Exception {
+ try {
+ Logger.REFLECTION("Constructor: Recursion Lookup: " + aClass.getName());
+ Constructor<?> c = aClass.getConstructor(aTypes);
+ if (c != null) {
+ c.setAccessible(true);
+ int modifiers = c.getModifiers();
+ Field modifierField = c.getClass().getDeclaredField("modifiers");
+ modifiers = modifiers & ~Modifier.FINAL;
+ modifierField.setAccessible(true);
+ modifierField.setInt(c, modifiers);
+ }
+ return c;
+ } catch (final NoSuchMethodException | IllegalArgumentException | IllegalAccessException e) {
+ final Class<?> superClass = aClass.getSuperclass();
+ if (superClass == null || superClass == Object.class) {
+ throw e;
+ }
+ return getConstructor_Internal(superClass, aTypes);
+ }
+ }
+
+ private static Method getMethodRecursively(final Class<?> clazz, final String aMethodName)
+ throws NoSuchMethodException {
+ try {
+ Logger.REFLECTION("Method: Recursion Lookup: " + aMethodName);
+ Method k = clazz.getDeclaredMethod(aMethodName);
+ makeMethodAccessible(k);
+ return k;
+ } catch (final NoSuchMethodException e) {
+ final Class<?> superClass = clazz.getSuperclass();
+ if (superClass == null || superClass == Object.class) {
+ throw e;
+ }
+ return getMethod_Internal(superClass, aMethodName);
+ }
+ }
+
+ private static void dumpClassInfo(Class<?> aClass) {
+ Logger.INFO("We ran into an error processing reflection in " + aClass.getName()
+ + ", dumping all data for debugging.");
+ // Get the methods
+ Method[] methods = aClass.getDeclaredMethods();
+ Field[] fields = aClass.getDeclaredFields();
+ Constructor[] consts = aClass.getDeclaredConstructors();
+
+ Logger.INFO("Dumping all Methods.");
+ for (Method method : methods) {
+ System.out.println(
+ method.getName() + " | " + StringUtils.getDataStringFromArray(method.getParameterTypes()));
+ }
+ Logger.INFO("Dumping all Fields.");
+ for (Field f : fields) {
+ System.out.println(f.getName());
+ }
+ Logger.INFO("Dumping all Constructors.");
+ for (Constructor<?> c : consts) {
+ System.out.println(c.getName() + " | " + c.getParameterCount() + " | "
+ + StringUtils.getDataStringFromArray(c.getParameterTypes()));
+ }
+ }
+
+ private static Class<?> getNonPublicClass(final String className) {
+ Class<?> c = null;
+ try {
+ c = Class.forName(className);
+ } catch (final ClassNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // full package name --------^^^^^^^^^^
+ // or simpler without Class.forName:
+ // Class<package1.A> c = package1.A.class;
+
+ if (null != c) {
+ // In our case we need to use
+ Constructor<?> constructor = null;
+ try {
+ constructor = c.getDeclaredConstructor();
+ } catch (NoSuchMethodException | SecurityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // note: getConstructor() can return only public constructors
+ // so we needed to search for any Declared constructor
+
+ // now we need to make this constructor accessible
+ if (null != constructor) {
+ constructor.setAccessible(true); // ABRACADABRA!
+
+ try {
+ final Object o = constructor.newInstance();
+ return (Class<?>) o;
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ return null;
+ }
+
+ private static Class<?> getClass_Internal(String string) {
+ Class<?> aClass = null;
+ if (ReflectionUtils.doesClassExist(string)) {
+ try {
+ aClass = Class.forName(string);
+ } catch (ClassNotFoundException e) {
+ aClass = getNonPublicClass(string);
+ }
+ }
+
+ if (aClass == null) {
+ String aClassName = "";
+ Logger.REFLECTION("Splitting " + string + " to try look for hidden classes.");
+ String[] aData = string.split("\\.");
+ Logger.REFLECTION("Obtained " + aData.length + " pieces.");
+ for (int i = 0; i < (aData.length - 1); i++) {
+ aClassName += (i > 0) ? "." + aData[i] : "" + aData[i];
+ Logger.REFLECTION("Building: " + aClassName);
+ }
+ if (aClassName != null && aClassName.length() > 0) {
+ Logger.REFLECTION("Trying to search '" + aClassName + "' for inner classes.");
+ Class<?> clazz = ReflectionUtils.getClass(aClassName);
+ if (clazz != null) {
+ Class[] y = clazz.getDeclaredClasses();
+ if (y == null || y.length <= 0) {
+ Logger.REFLECTION("No hidden inner classes found.");
+ return null;
+ } else {
+ boolean found = false;
+ for (Class<?> h : y) {
+ Logger.REFLECTION("Found hidden inner class: " + h.getCanonicalName());
+ if (h.getSimpleName().toLowerCase().equals(aData[aData.length - 1].toLowerCase())) {
+ Logger.REFLECTION("Found correct class. [" + aData[aData.length - 1]
+ + "] Caching at correct location: " + string);
+ Logger.REFLECTION("Found at location: " + h.getCanonicalName());
+ ReflectionUtils.mCachedClasses.put(string, h);
+ aClass = h;
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ return null;
+ }
+ }
+ } else {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+ return aClass;
+ }
+
+ /**
+ *
+ * Set the value of a field reflectively.
+ */
+ private static void setFieldValue_Internal(Object owner, Field field, Object value) throws Exception {
+ makeModifiable(field);
+ field.set(owner, value);
+ }
+
+ /**
+ * Force the field to be modifiable and accessible.
+ */
+ private static void makeModifiable(Field nameField) throws Exception {
+ nameField.setAccessible(true);
+ Field modifiers = getField(Field.class, "modifiers");
+ modifiers.setAccessible(true);
+ modifiers.setInt(nameField, nameField.getModifiers() & ~Modifier.FINAL);
+ }
+
+ public static boolean doesFieldExist(String clazz, String string) {
+ return doesFieldExist(ReflectionUtils.getClass(clazz), string);
+ }
+
+ public static boolean doesFieldExist(Class<?> clazz, String string) {
+ if (clazz != null) {
+ if (ReflectionUtils.getField(clazz, string) != null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static <T> T getFieldValue(Field field) {
+ return getFieldValue(field, null);
+ }
+
+ public static <T> T getFieldValue(Field field, Object instance) {
+ try {
+ return (T) field.get(instance);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ return null;
+ }
+
+ public static <T> T createNewInstanceFromConstructor(Constructor aConstructor, Object[] aArgs) {
+ T aInstance;
+ try {
+ aInstance = (T) aConstructor.newInstance(aArgs);
+ if (aInstance != null) {
+ return aInstance;
+ }
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static Enum getEnum(Class<Enum> sgtbees, String name) {
+ if (sgtbees.isEnum()) {
+ Object[] aValues = sgtbees.getEnumConstants();
+ for (Object o : aValues) {
+ if (o.toString().toLowerCase().equals(name.toLowerCase())) {
+ return (Enum) o;
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/sys/KeyboardUtils.java b/src/main/java/gtPlusPlus/core/util/sys/KeyboardUtils.java
index ea87677ee2..3e26d8ff35 100644
--- a/src/main/java/gtPlusPlus/core/util/sys/KeyboardUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/sys/KeyboardUtils.java
@@ -1,39 +1,36 @@
package gtPlusPlus.core.util.sys;
-import org.lwjgl.input.Keyboard;
-
import net.minecraft.client.Minecraft;
+import org.lwjgl.input.Keyboard;
public class KeyboardUtils {
- public static boolean isCtrlKeyDown(){
- try {
- if (!Keyboard.isCreated()) {
- return false;
- }
- // prioritize CONTROL, but allow OPTION as well on Mac (note: GuiScreen's isCtrlKeyDown only checks for the OPTION key on Mac)
- boolean isCtrlKeyDown = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
- if (!isCtrlKeyDown && Minecraft.isRunningOnMac)
- isCtrlKeyDown = Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA);
-
- return isCtrlKeyDown;
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- public static boolean isShiftKeyDown(){
- try {
- if (!Keyboard.isCreated()) {
- return false;
- }
- return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
- }
- catch (Throwable t) {
- return false;
- }
-
- }
-
+ public static boolean isCtrlKeyDown() {
+ try {
+ if (!Keyboard.isCreated()) {
+ return false;
+ }
+ // prioritize CONTROL, but allow OPTION as well on Mac (note: GuiScreen's isCtrlKeyDown only checks for the
+ // OPTION key on Mac)
+ boolean isCtrlKeyDown =
+ Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
+ if (!isCtrlKeyDown && Minecraft.isRunningOnMac)
+ isCtrlKeyDown = Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA);
+
+ return isCtrlKeyDown;
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ public static boolean isShiftKeyDown() {
+ try {
+ if (!Keyboard.isCreated()) {
+ return false;
+ }
+ return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
+ } catch (Throwable t) {
+ return false;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/sys/Log.java b/src/main/java/gtPlusPlus/core/util/sys/Log.java
index fcd4f34c1b..026bb533c7 100644
--- a/src/main/java/gtPlusPlus/core/util/sys/Log.java
+++ b/src/main/java/gtPlusPlus/core/util/sys/Log.java
@@ -4,21 +4,21 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public final class Log {
- public static final Logger LOGGER = LogManager.getLogger("MiscUtils");
+ public static final Logger LOGGER = LogManager.getLogger("MiscUtils");
- public static void warn(final String msg) {
- LOGGER.warn(msg);
- }
+ public static void warn(final String msg) {
+ LOGGER.warn(msg);
+ }
- public static void error(final String msg) {
- LOGGER.error(msg);
- }
+ public static void error(final String msg) {
+ LOGGER.error(msg);
+ }
- public static void info(final String msg) {
- LOGGER.info(msg);
- }
+ public static void info(final String msg) {
+ LOGGER.info(msg);
+ }
- public static void debug(final String msg) {
- LOGGER.debug(msg);
- }
+ public static void debug(final String msg) {
+ LOGGER.debug(msg);
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/util/sys/SystemUtils.java b/src/main/java/gtPlusPlus/core/util/sys/SystemUtils.java
index 2788ba688e..662a3261c0 100644
--- a/src/main/java/gtPlusPlus/core/util/sys/SystemUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/sys/SystemUtils.java
@@ -2,89 +2,84 @@ package gtPlusPlus.core.util.sys;
public class SystemUtils {
- private static OS SystemType;
-
- public static OS getOS(){
- if (SystemType != null){
- return SystemType;
- }
- else {
- SystemType = getOperatingSystem();
- return SystemType;
- }
- }
-
- /**
- * Try invoke the runtime's Garbage Collector.
- */
- public static void invokeGC() {
- try {
- Runtime r = Runtime.getRuntime();
- r.gc();
- }
- catch (Throwable t) {
- //Do nothing.
- }
- }
-
- public static boolean isWindows() {
- return (getOSString().indexOf("win") >= 0);
- }
+ private static OS SystemType;
- public static boolean isMac() {
- return (getOSString().indexOf("mac") >= 0);
- }
+ public static OS getOS() {
+ if (SystemType != null) {
+ return SystemType;
+ } else {
+ SystemType = getOperatingSystem();
+ return SystemType;
+ }
+ }
- public static boolean isUnix() {
- return (getOSString().indexOf("nix") >= 0 || getOSString().indexOf("nux") >= 0 || getOSString().indexOf("aix") > 0 );
- }
+ /**
+ * Try invoke the runtime's Garbage Collector.
+ */
+ public static void invokeGC() {
+ try {
+ Runtime r = Runtime.getRuntime();
+ r.gc();
+ } catch (Throwable t) {
+ // Do nothing.
+ }
+ }
- public static boolean isSolaris() {
- return (getOSString().indexOf("sunos") >= 0);
- }
+ public static boolean isWindows() {
+ return (getOSString().indexOf("win") >= 0);
+ }
- public static String getOSString(){
- try {
- return System.getProperty("os.name").toLowerCase();
- }
- catch (Throwable t){
- return "other";
- }
- }
-
- public static OS getOperatingSystem(){
- if (isMac()){
- return OS.MAC;
- }
- else if (isWindows()){
- return OS.WINDOWS;
- }
- else if (isUnix()){
- return OS.UNIX;
- }
- else if (isSolaris()){
- return OS.SOLARIS;
- }
- else {
- return OS.OTHER;
- }
- }
-
- public static enum OS {
- MAC(1),
- WINDOWS(2),
- UNIX(3),
- SOLARIS(4),
- OTHER(0);
+ public static boolean isMac() {
+ return (getOSString().indexOf("mac") >= 0);
+ }
- private int mID;
- private OS (final int ID){
- this.mID = ID;
- }
+ public static boolean isUnix() {
+ return (getOSString().indexOf("nix") >= 0
+ || getOSString().indexOf("nux") >= 0
+ || getOSString().indexOf("aix") > 0);
+ }
- public int getID() {
- return this.mID;
- }
- }
-
+ public static boolean isSolaris() {
+ return (getOSString().indexOf("sunos") >= 0);
+ }
+
+ public static String getOSString() {
+ try {
+ return System.getProperty("os.name").toLowerCase();
+ } catch (Throwable t) {
+ return "other";
+ }
+ }
+
+ public static OS getOperatingSystem() {
+ if (isMac()) {
+ return OS.MAC;
+ } else if (isWindows()) {
+ return OS.WINDOWS;
+ } else if (isUnix()) {
+ return OS.UNIX;
+ } else if (isSolaris()) {
+ return OS.SOLARIS;
+ } else {
+ return OS.OTHER;
+ }
+ }
+
+ public static enum OS {
+ MAC(1),
+ WINDOWS(2),
+ UNIX(3),
+ SOLARIS(4),
+ OTHER(0);
+
+ private int mID;
+
+ private OS(final int ID) {
+ this.mID = ID;
+ }
+
+ public int getID() {
+ return this.mID;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/world/damage/BaseCustomDamageSource.java b/src/main/java/gtPlusPlus/core/world/damage/BaseCustomDamageSource.java
index 3778beacfb..c3ebf70052 100644
--- a/src/main/java/gtPlusPlus/core/world/damage/BaseCustomDamageSource.java
+++ b/src/main/java/gtPlusPlus/core/world/damage/BaseCustomDamageSource.java
@@ -3,20 +3,17 @@ package gtPlusPlus.core.world.damage;
import net.minecraft.entity.Entity;
import net.minecraft.util.EntityDamageSourceIndirect;
-public class BaseCustomDamageSource extends EntityDamageSourceIndirect {
+public class BaseCustomDamageSource extends EntityDamageSourceIndirect {
- public BaseCustomDamageSource(String name, Entity transmitter, Entity indirectSource) {
- super(name, transmitter, indirectSource);
- this.setDifficultyScaled();
- }
-
- /**
+ public BaseCustomDamageSource(String name, Entity transmitter, Entity indirectSource) {
+ super(name, transmitter, indirectSource);
+ this.setDifficultyScaled();
+ }
+
+ /**
* Return whether this damage source will have its damage amount scaled based on the current difficulty.
*/
- public boolean isDifficultyScaled()
- {
- return true;
+ public boolean isDifficultyScaled() {
+ return true;
}
-
-
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/core/world/explosions/ExplosionHandler.java b/src/main/java/gtPlusPlus/core/world/explosions/ExplosionHandler.java
index 8d96aa2ff1..7bbc7a7edd 100644
--- a/src/main/java/gtPlusPlus/core/world/explosions/ExplosionHandler.java
+++ b/src/main/java/gtPlusPlus/core/world/explosions/ExplosionHandler.java
@@ -5,27 +5,41 @@ import net.minecraft.world.World;
public class ExplosionHandler {
- /**
- * Creates an explosion. Args: entity, x, y, z, strength
- */
- public MiningExplosion createExplosion(final World world, final Entity entityObj, final double x, final double y, final double z, final float size, final boolean makesFlames, final boolean makesSmoke)
- {
- return this.newExplosion(world, entityObj, x, y, z, size, makesFlames, makesSmoke);
- }
-
- /**
- * returns a new explosion.
- */
- public MiningExplosion newExplosion(final World world, final Entity entityObj, final double x, final double y, final double z, final float size, final boolean makesFlames, final boolean makesSmoke){
- final MiningExplosion explosion = new MiningExplosion(world, entityObj, x, y, z, size);
- explosion.isFlaming = makesFlames;
- explosion.isSmoking = makesSmoke;
- if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(world, explosion)) {
- return explosion;
- }
- explosion.doExplosionA();
- explosion.doExplosionB(true);
- return explosion;
- }
+ /**
+ * Creates an explosion. Args: entity, x, y, z, strength
+ */
+ public MiningExplosion createExplosion(
+ final World world,
+ final Entity entityObj,
+ final double x,
+ final double y,
+ final double z,
+ final float size,
+ final boolean makesFlames,
+ final boolean makesSmoke) {
+ return this.newExplosion(world, entityObj, x, y, z, size, makesFlames, makesSmoke);
+ }
+ /**
+ * returns a new explosion.
+ */
+ public MiningExplosion newExplosion(
+ final World world,
+ final Entity entityObj,
+ final double x,
+ final double y,
+ final double z,
+ final float size,
+ final boolean makesFlames,
+ final boolean makesSmoke) {
+ final MiningExplosion explosion = new MiningExplosion(world, entityObj, x, y, z, size);
+ explosion.isFlaming = makesFlames;
+ explosion.isSmoking = makesSmoke;
+ if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(world, explosion)) {
+ return explosion;
+ }
+ explosion.doExplosionA();
+ explosion.doExplosionB(true);
+ return explosion;
+ }
}
diff --git a/src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java b/src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java
index 792e47085e..d36c75bfa3 100644
--- a/src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java
+++ b/src/main/java/gtPlusPlus/core/world/explosions/MiningExplosion.java
@@ -1,7 +1,9 @@
package gtPlusPlus.core.world.explosions;
+import gtPlusPlus.api.objects.random.XSTR;
+import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
+import gtPlusPlus.core.util.math.MathUtils;
import java.util.*;
-
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentProtection;
@@ -14,262 +16,420 @@ import net.minecraft.world.ChunkPosition;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.random.XSTR;
-import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
-import gtPlusPlus.core.util.math.MathUtils;
-
public class MiningExplosion extends Explosion {
- private final int field_77289_h = 16;
- private final Random explosionRNG = new XSTR();
- private final World worldObj;
+ private final int field_77289_h = 16;
+ private final Random explosionRNG = new XSTR();
+ private final World worldObj;
+
+ private final Map<Entity, Vec3> field_77288_k = new HashMap<>();
- private final Map<Entity, Vec3> field_77288_k = new HashMap<>();
- public MiningExplosion(final World worldObj, final Entity entityObj, final double x, final double y, final double z, final float size)
- {
- super(worldObj, entityObj, x, y, z, size);
- this.worldObj = worldObj;
- this.exploder = entityObj;
- this.explosionSize = size;
- this.explosionX = x;
- this.explosionY = y;
- this.explosionZ = z;
- }
+ public MiningExplosion(
+ final World worldObj,
+ final Entity entityObj,
+ final double x,
+ final double y,
+ final double z,
+ final float size) {
+ super(worldObj, entityObj, x, y, z, size);
+ this.worldObj = worldObj;
+ this.exploder = entityObj;
+ this.explosionSize = size;
+ this.explosionX = x;
+ this.explosionY = y;
+ this.explosionZ = z;
+ }
- /**
- * Does the first part of the explosion (destroy blocks)
- */
- @SuppressWarnings("unchecked")
- @Override
- public void doExplosionA()
- {
- final float f = this.explosionSize;
- final HashSet<ChunkPosition> hashset = new HashSet<>();
- int i;
- int j;
- int k;
- double d5;
- double d6;
- double d7;
+ /**
+ * Does the first part of the explosion (destroy blocks)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void doExplosionA() {
+ final float f = this.explosionSize;
+ final HashSet<ChunkPosition> hashset = new HashSet<>();
+ int i;
+ int j;
+ int k;
+ double d5;
+ double d6;
+ double d7;
- for (i = 0; i < this.field_77289_h; ++i)
- {
- for (j = 0; j < this.field_77289_h; ++j)
- {
- for (k = 0; k < this.field_77289_h; ++k)
- {
- if ((i == 0) || (i == (this.field_77289_h - 1)) || (j == 0) || (j == (this.field_77289_h - 1)) || (k == 0) || (k == (this.field_77289_h - 1)))
- {
- double d0 = ((i / (this.field_77289_h - 1.0F)) * 2.0F) - 1.0F;
- double d1 = ((j / (this.field_77289_h - 1.0F)) * 2.0F) - 1.0F;
- double d2 = ((k / (this.field_77289_h - 1.0F)) * 2.0F) - 1.0F;
- final double d3 = Math.sqrt((d0 * d0) + (d1 * d1) + (d2 * d2));
- d0 /= d3;
- d1 /= d3;
- d2 /= d3;
- float f1 = this.explosionSize * (0.7F + (this.worldObj.rand.nextFloat() * 0.6F));
- d5 = this.explosionX;
- d6 = this.explosionY;
- d7 = this.explosionZ;
+ for (i = 0; i < this.field_77289_h; ++i) {
+ for (j = 0; j < this.field_77289_h; ++j) {
+ for (k = 0; k < this.field_77289_h; ++k) {
+ if ((i == 0)
+ || (i == (this.field_77289_h - 1))
+ || (j == 0)
+ || (j == (this.field_77289_h - 1))
+ || (k == 0)
+ || (k == (this.field_77289_h - 1))) {
+ double d0 = ((i / (this.field_77289_h - 1.0F)) * 2.0F) - 1.0F;
+ double d1 = ((j / (this.field_77289_h - 1.0F)) * 2.0F) - 1.0F;
+ double d2 = ((k / (this.field_77289_h - 1.0F)) * 2.0F) - 1.0F;
+ final double d3 = Math.sqrt((d0 * d0) + (d1 * d1) + (d2 * d2));
+ d0 /= d3;
+ d1 /= d3;
+ d2 /= d3;
+ float f1 = this.explosionSize * (0.7F + (this.worldObj.rand.nextFloat() * 0.6F));
+ d5 = this.explosionX;
+ d6 = this.explosionY;
+ d7 = this.explosionZ;
- for (final float f2 = 0.3F; f1 > 0.0F; f1 -= f2 * 0.75F)
- {
- final int j1 = MathHelper.floor_double(d5);
- final int k1 = MathHelper.floor_double(d6);
- final int l1 = MathHelper.floor_double(d7);
- final Block block = this.worldObj.getBlock(j1, k1, l1);
+ for (final float f2 = 0.3F; f1 > 0.0F; f1 -= f2 * 0.75F) {
+ final int j1 = MathHelper.floor_double(d5);
+ final int k1 = MathHelper.floor_double(d6);
+ final int l1 = MathHelper.floor_double(d7);
+ final Block block = this.worldObj.getBlock(j1, k1, l1);
- if (block.getMaterial() != Material.air)
- {
- final float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder, this.worldObj, j1, k1, l1, this.explosionX, this.explosionY, this.explosionZ);
- f1 -= (f3 + 0.3F) * f2;
- }
+ if (block.getMaterial() != Material.air) {
+ final float f3 = this.exploder != null
+ ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block)
+ : block.getExplosionResistance(
+ this.exploder,
+ this.worldObj,
+ j1,
+ k1,
+ l1,
+ this.explosionX,
+ this.explosionY,
+ this.explosionZ);
+ f1 -= (f3 + 0.3F) * f2;
+ }
- if ((f1 > 0.0F) && ((this.exploder == null) || this.exploder.func_145774_a(this, this.worldObj, j1, k1, l1, block, f1)))
- {
- hashset.add(new ChunkPosition(j1, k1, l1));
- }
+ if ((f1 > 0.0F)
+ && ((this.exploder == null)
+ || this.exploder.func_145774_a(
+ this, this.worldObj, j1, k1, l1, block, f1))) {
+ hashset.add(new ChunkPosition(j1, k1, l1));
+ }
- d5 += d0 * f2;
- d6 += d1 * f2;
- d7 += d2 * f2;
- }
- }
- }
- }
- }
+ d5 += d0 * f2;
+ d6 += d1 * f2;
+ d7 += d2 * f2;
+ }
+ }
+ }
+ }
+ }
- this.affectedBlockPositions.addAll(hashset);
- this.explosionSize *= 2.0F;
- i = MathHelper.floor_double(this.explosionX - this.explosionSize - 1.0D);
- j = MathHelper.floor_double(this.explosionX + this.explosionSize + 1.0D);
- k = MathHelper.floor_double(this.explosionY - this.explosionSize - 1.0D);
- final int i2 = MathHelper.floor_double(this.explosionY + this.explosionSize + 1.0D);
- final int l = MathHelper.floor_double(this.explosionZ - this.explosionSize - 1.0D);
- final int j2 = MathHelper.floor_double(this.explosionZ + this.explosionSize + 1.0D);
- final List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, AxisAlignedBB.getBoundingBox(i, k, l, j, i2, j2));
- net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.worldObj, this, list, this.explosionSize);
- final Vec3 vec3 = Vec3.createVectorHelper(this.explosionX, this.explosionY, this.explosionZ);
+ this.affectedBlockPositions.addAll(hashset);
+ this.explosionSize *= 2.0F;
+ i = MathHelper.floor_double(this.explosionX - this.explosionSize - 1.0D);
+ j = MathHelper.floor_double(this.explosionX + this.explosionSize + 1.0D);
+ k = MathHelper.floor_double(this.explosionY - this.explosionSize - 1.0D);
+ final int i2 = MathHelper.floor_double(this.explosionY + this.explosionSize + 1.0D);
+ final int l = MathHelper.floor_double(this.explosionZ - this.explosionSize - 1.0D);
+ final int j2 = MathHelper.floor_double(this.explosionZ + this.explosionSize + 1.0D);
+ final List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
+ this.exploder, AxisAlignedBB.getBoundingBox(i, k, l, j, i2, j2));
+ net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.worldObj, this, list, this.explosionSize);
+ final Vec3 vec3 = Vec3.createVectorHelper(this.explosionX, this.explosionY, this.explosionZ);
- for (int i1 = 0; i1 < list.size(); ++i1)
- {
- final Entity entity = list.get(i1);
- final double d4 = entity.getDistance(this.explosionX, this.explosionY, this.explosionZ) / this.explosionSize;
+ for (int i1 = 0; i1 < list.size(); ++i1) {
+ final Entity entity = list.get(i1);
+ final double d4 =
+ entity.getDistance(this.explosionX, this.explosionY, this.explosionZ) / this.explosionSize;
- if (d4 <= 1.0D)
- {
- d5 = entity.posX - this.explosionX;
- d6 = (entity.posY + entity.getEyeHeight()) - this.explosionY;
- d7 = entity.posZ - this.explosionZ;
- final double d9 = MathHelper.sqrt_double((d5 * d5) + (d6 * d6) + (d7 * d7));
+ if (d4 <= 1.0D) {
+ d5 = entity.posX - this.explosionX;
+ d6 = (entity.posY + entity.getEyeHeight()) - this.explosionY;
+ d7 = entity.posZ - this.explosionZ;
+ final double d9 = MathHelper.sqrt_double((d5 * d5) + (d6 * d6) + (d7 * d7));
- if (d9 != 0.0D)
- {
- d5 /= d9;
- d6 /= d9;
- d7 /= d9;
- final double d10 = this.worldObj.getBlockDensity(vec3, entity.boundingBox);
- final double d11 = (1.0D - d4) * d10;
- entity.attackEntityFrom(DamageSource.setExplosionSource(this), ((int)(((((d11 * d11) + d11) / 2.0D) * 8.0D * this.explosionSize) + 1.0D)));
- final double d8 = EnchantmentProtection.func_92092_a(entity, d11);
- entity.motionX += d5 * d8;
- entity.motionY += d6 * d8;
- entity.motionZ += d7 * d8;
+ if (d9 != 0.0D) {
+ d5 /= d9;
+ d6 /= d9;
+ d7 /= d9;
+ final double d10 = this.worldObj.getBlockDensity(vec3, entity.boundingBox);
+ final double d11 = (1.0D - d4) * d10;
+ entity.attackEntityFrom(DamageSource.setExplosionSource(this), ((int)
+ (((((d11 * d11) + d11) / 2.0D) * 8.0D * this.explosionSize) + 1.0D)));
+ final double d8 = EnchantmentProtection.func_92092_a(entity, d11);
+ entity.motionX += d5 * d8;
+ entity.motionY += d6 * d8;
+ entity.motionZ += d7 * d8;
- if (entity instanceof EntityPlayer)
- {
- this.field_77288_k.put(entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11));
- }
- }
- }
- }
+ if (entity instanceof EntityPlayer) {
+ this.field_77288_k.put(entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11));
+ }
+ }
+ }
+ }
- this.explosionSize = f;
- }
+ this.explosionSize = f;
+ }
- /**
- * Does the second part of the explosion (sound, particles, drop spawn)
- */
- @Override
- public void doExplosionB(final boolean p_77279_1_)
- {
- this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + ((this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F)) * 0.7F);
+ /**
+ * Does the second part of the explosion (sound, particles, drop spawn)
+ */
+ @Override
+ public void doExplosionB(final boolean p_77279_1_) {
+ this.worldObj.playSoundEffect(
+ this.explosionX,
+ this.explosionY,
+ this.explosionZ,
+ "random.explode",
+ 4.0F,
+ (1.0F + ((this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F)) * 0.7F);
- if ((this.explosionSize >= 2.0F) && this.isSmoking)
- {
- this.worldObj.spawnParticle("hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("smoke", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("cloud", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("explode", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largeexplode", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("hugeexplosion", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- }
- else
- {
- this.worldObj.spawnParticle("largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("smoke", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("cloud", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("explode", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largeexplode", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- }
+ if ((this.explosionSize >= 2.0F) && this.isSmoking) {
+ this.worldObj.spawnParticle(
+ "hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle(
+ "smoke",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "explode",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "hugeexplosion",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ } else {
+ this.worldObj.spawnParticle(
+ "largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle(
+ "smoke",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "explode",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
- Iterator<ChunkPosition> iterator;
- ChunkPosition chunkposition;
- int i;
- int j;
- int k;
- Block block;
+ Iterator<ChunkPosition> iterator;
+ ChunkPosition chunkposition;
+ int i;
+ int j;
+ int k;
+ Block block;
- if (this.isSmoking)
- {
- iterator = this.affectedBlockPositions.iterator();
+ if (this.isSmoking) {
+ iterator = this.affectedBlockPositions.iterator();
- while (iterator.hasNext())
- {
- chunkposition = iterator.next();
- i = chunkposition.chunkPosX;
- j = chunkposition.chunkPosY;
- k = chunkposition.chunkPosZ;
- block = this.worldObj.getBlock(i, j, k);
+ while (iterator.hasNext()) {
+ chunkposition = iterator.next();
+ i = chunkposition.chunkPosX;
+ j = chunkposition.chunkPosY;
+ k = chunkposition.chunkPosZ;
+ block = this.worldObj.getBlock(i, j, k);
- if (p_77279_1_)
- {
- final double d0 = i + this.worldObj.rand.nextFloat();
- final double d1 = j + this.worldObj.rand.nextFloat();
- final double d2 = k + this.worldObj.rand.nextFloat();
- double d3 = d0 - this.explosionX;
- double d4 = d1 - this.explosionY;
- double d5 = d2 - this.explosionZ;
- final double d6 = MathHelper.sqrt_double((d3 * d3) + (d4 * d4) + (d5 * d5));
- d3 /= d6;
- d4 /= d6;
- d5 /= d6;
- double d7 = 0.5D / ((d6 / this.explosionSize) + 0.1D);
- d7 *= (this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat()) + 0.3F;
- d3 *= d7;
- d4 *= d7;
- d5 *= d7;
- this.worldObj.spawnParticle("explode", (d0 + (this.explosionX * 1.0D)) / 2.0D, (d1 + (this.explosionY * 1.0D)) / 2.0D, (d2 + (this.explosionZ * 1.0D)) / 2.0D, d3, d4, d5);
- this.worldObj.spawnParticle("smoke", d0, d1, d2, d3, d4, d5);
- this.worldObj.spawnParticle("smoke", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largesmoke", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("cloud", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("flame", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("explode", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("largeexplode", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
- this.worldObj.spawnParticle("hugeexplosion", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
-
- }
+ if (p_77279_1_) {
+ final double d0 = i + this.worldObj.rand.nextFloat();
+ final double d1 = j + this.worldObj.rand.nextFloat();
+ final double d2 = k + this.worldObj.rand.nextFloat();
+ double d3 = d0 - this.explosionX;
+ double d4 = d1 - this.explosionY;
+ double d5 = d2 - this.explosionZ;
+ final double d6 = MathHelper.sqrt_double((d3 * d3) + (d4 * d4) + (d5 * d5));
+ d3 /= d6;
+ d4 /= d6;
+ d5 /= d6;
+ double d7 = 0.5D / ((d6 / this.explosionSize) + 0.1D);
+ d7 *= (this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat()) + 0.3F;
+ d3 *= d7;
+ d4 *= d7;
+ d5 *= d7;
+ this.worldObj.spawnParticle(
+ "explode",
+ (d0 + (this.explosionX * 1.0D)) / 2.0D,
+ (d1 + (this.explosionY * 1.0D)) / 2.0D,
+ (d2 + (this.explosionZ * 1.0D)) / 2.0D,
+ d3,
+ d4,
+ d5);
+ this.worldObj.spawnParticle("smoke", d0, d1, d2, d3, d4, d5);
+ this.worldObj.spawnParticle(
+ "smoke",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largesmoke",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "cloud",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "flame",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "explode",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "largeexplode",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ this.worldObj.spawnParticle(
+ "hugeexplosion",
+ this.explosionX + MathUtils.randDouble(0, 1),
+ this.explosionY + MathUtils.randDouble(0, 1),
+ this.explosionZ + MathUtils.randDouble(0, 1),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
- if (block.getMaterial() != Material.air)
- {
- if (block.canDropFromExplosion(this))
- {
- //world, x, y, z, world.getBlockMetadata(x, y, z), dropProb, 0
- block.dropBlockAsItemWithChance(this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1F, 0);
- }
+ if (block.getMaterial() != Material.air) {
+ if (block.canDropFromExplosion(this)) {
+ // world, x, y, z, world.getBlockMetadata(x, y, z), dropProb, 0
+ block.dropBlockAsItemWithChance(
+ this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1F, 0);
+ }
- block.onBlockExploded(this.worldObj, i, j, k, this);
- }
- }
- }
+ block.onBlockExploded(this.worldObj, i, j, k, this);
+ }
+ }
+ }
- if (this.isFlaming)
- {
- iterator = this.affectedBlockPositions.iterator();
+ if (this.isFlaming) {
+ iterator = this.affectedBlockPositions.iterator();
- while (iterator.hasNext())
- {
- chunkposition = iterator.next();
- i = chunkposition.chunkPosX;
- j = chunkposition.chunkPosY;
- k = chunkposition.chunkPosZ;
- block = this.worldObj.getBlock(i, j, k);
- final Block block1 = this.worldObj.getBlock(i, j - 1, k);
+ while (iterator.hasNext()) {
+ chunkposition = iterator.next();
+ i = chunkposition.chunkPosX;
+ j = chunkposition.chunkPosY;
+ k = chunkposition.chunkPosZ;
+ block = this.worldObj.getBlock(i, j, k);
+ final Block block1 = this.worldObj.getBlock(i, j - 1, k);
- if ((block.getMaterial() == Material.air) && block1.func_149730_j() && (this.explosionRNG.nextInt(3) == 0))
- {
- this.worldObj.setBlock(i, j, k, Blocks.fire);
- }
- }
- }
- }
+ if ((block.getMaterial() == Material.air)
+ && block1.func_149730_j()
+ && (this.explosionRNG.nextInt(3) == 0)) {
+ this.worldObj.setBlock(i, j, k, Blocks.fire);
+ }
+ }
+ }
+ }
- @Override
- public Map<Entity, Vec3> func_77277_b()
- {
- return this.field_77288_k;
- }
+ @Override
+ public Map<Entity, Vec3> func_77277_b() {
+ return this.field_77288_k;
+ }
- /**
- * Returns either the entity that placed the explosive block, the entity that caused the explosion or null.
- */
- @Override
- public EntityLivingBase getExplosivePlacedBy()
- {
- return this.exploder == null ? null : (this.exploder instanceof EntityPrimedMiningExplosive ? ((EntityPrimedMiningExplosive)this.exploder).getTntPlacedBy() : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase)this.exploder : null));
- }
-} \ No newline at end of file
+ /**
+ * Returns either the entity that placed the explosive block, the entity that caused the explosion or null.
+ */
+ @Override
+ public EntityLivingBase getExplosivePlacedBy() {
+ return this.exploder == null
+ ? null
+ : (this.exploder instanceof EntityPrimedMiningExplosive
+ ? ((EntityPrimedMiningExplosive) this.exploder).getTntPlacedBy()
+ : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase) this.exploder : null));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java b/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java
index ef8aa080c2..bc137390b6 100644
--- a/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java
+++ b/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java
@@ -1,9 +1,5 @@
package gtPlusPlus.everglades;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
@@ -27,179 +23,186 @@ import gtPlusPlus.everglades.gen.gt.WorldGen_Ores;
import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.xmod.gregtech.HANDLER_GT;
import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.config.Configuration;
@MCVersion(value = "1.7.10")
-@Mod(modid = Everglades.MODID, name = Everglades.NAME, version = Everglades.VERSION, dependencies = "required-after:Forge; after:dreamcraft; after:IC2; after:ihl; required-after:gregtech; required-after:miscutils;")
+@Mod(
+ modid = Everglades.MODID,
+ name = Everglades.NAME,
+ version = Everglades.VERSION,
+ dependencies =
+ "required-after:Forge; after:dreamcraft; after:IC2; after:ihl; required-after:gregtech; required-after:miscutils;")
public class GTplusplus_Everglades implements ActionListener {
- //Mod Instance
- @Mod.Instance(Everglades.MODID)
- public static GTplusplus_Everglades instance;
-
- // Dark World Handler
- protected static volatile Biome_Everglades Everglades_Biome;
- protected static volatile Dimension_Everglades Everglades_Dimension;
- public static int globalEvergladesPortalSpawnTimer = 0;
-
- // Pre-Init
- @Mod.EventHandler
- public void preInit(final FMLPreInitializationEvent event) {
- Logger.INFO("Loading " + Everglades.MODID + " V" + Everglades.VERSION);
-
- //Setup
- setVars(event);
-
- setEvergladesBiome(new Biome_Everglades());
- Everglades_Dimension = new Dimension_Everglades();
-
- // Load Dark World
- getEvergladesBiome().instance = instance;
- Everglades_Dimension.instance = instance;
- getEvergladesBiome().preInit(event);
-
- //Load/Set Custom Ore Gen
- HANDLER_GT.sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg")));
-
- }
-
- @EventHandler
- public void load(final FMLInitializationEvent e) {
- Logger.INFO("Begin resource allocation for " + Everglades.MODID + " V" +Everglades.VERSION);
-
- //Load World and Biome
- GameRegistry.registerWorldGenerator(new WorldGen_GT_Base(), Short.MAX_VALUE);
- getEvergladesBiome().load();
- Everglades_Dimension.load();
-
- }
-
- public static synchronized void GenerateOreMaterials() {
- MaterialGenerator.generateOreMaterial(ORES.CROCROITE);
- MaterialGenerator.generateOreMaterial(ORES.GEIKIELITE);
- MaterialGenerator.generateOreMaterial(ORES.NICHROMITE);
- MaterialGenerator.generateOreMaterial(ORES.TITANITE);
- MaterialGenerator.generateOreMaterial(ORES.ZIMBABWEITE);
- MaterialGenerator.generateOreMaterial(ORES.ZIRCONILITE);
- MaterialGenerator.generateOreMaterial(ORES.GADOLINITE_CE);
- MaterialGenerator.generateOreMaterial(ORES.GADOLINITE_Y);
- MaterialGenerator.generateOreMaterial(ORES.LEPERSONNITE);
- MaterialGenerator.generateOreMaterial(ORES.SAMARSKITE_Y);
- MaterialGenerator.generateOreMaterial(ORES.SAMARSKITE_YB);
- MaterialGenerator.generateOreMaterial(ORES.XENOTIME);
- MaterialGenerator.generateOreMaterial(ORES.YTTRIAITE);
- MaterialGenerator.generateOreMaterial(ORES.YTTRIALITE);
- MaterialGenerator.generateOreMaterial(ORES.YTTROCERITE);
- MaterialGenerator.generateOreMaterial(ORES.ZIRCON);
- MaterialGenerator.generateOreMaterial(ORES.POLYCRASE);
- MaterialGenerator.generateOreMaterial(ORES.ZIRCOPHYLLITE);
- MaterialGenerator.generateOreMaterial(ORES.ZIRKELITE);
- MaterialGenerator.generateOreMaterial(ORES.LANTHANITE_LA);
- MaterialGenerator.generateOreMaterial(ORES.LANTHANITE_CE);
- MaterialGenerator.generateOreMaterial(ORES.LANTHANITE_ND);
- MaterialGenerator.generateOreMaterial(ORES.AGARDITE_Y);
- MaterialGenerator.generateOreMaterial(ORES.AGARDITE_CD);
- MaterialGenerator.generateOreMaterial(ORES.AGARDITE_LA);
- MaterialGenerator.generateOreMaterial(ORES.AGARDITE_ND);
- MaterialGenerator.generateOreMaterial(ORES.HIBONITE);
- MaterialGenerator.generateOreMaterial(ORES.CERITE);
- MaterialGenerator.generateOreMaterial(ORES.FLUORCAPHITE);
- MaterialGenerator.generateOreMaterial(ORES.FLORENCITE);
- MaterialGenerator.generateOreMaterial(ORES.CRYOLITE);
-
- MaterialGenerator.generateOreMaterial(ORES.LAUTARITE);
- MaterialGenerator.generateOreMaterial(ORES.LAFOSSAITE);
- MaterialGenerator.generateOreMaterial(ORES.DEMICHELEITE_BR);
- MaterialGenerator.generateOreMaterial(ORES.COMANCHEITE);
- MaterialGenerator.generateOreMaterial(ORES.PERROUDITE);
- MaterialGenerator.generateOreMaterial(ORES.HONEAITE);
- MaterialGenerator.generateOreMaterial(ORES.ALBURNITE);
- MaterialGenerator.generateOreMaterial(ORES.MIESSIITE);
- MaterialGenerator.generateOreMaterial(ORES.KASHINITE);
- MaterialGenerator.generateOreMaterial(ORES.IRARSITE);
- MaterialGenerator.generateOreMaterial(ORES.GREENOCKITE);
- MaterialGenerator.generateOreMaterial(ORES.RADIOBARITE);
- MaterialGenerator.generateOreMaterial(ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT);
-
- //Custom Ores
- if (LoadedMods.Big_Reactors) {
- MaterialGenerator.generateOreMaterial(ELEMENT.getInstance().YELLORIUM, false, false, true, new short[] {255, 242, 10});
- }
-
- }
-
- protected synchronized void setVars(FMLPreInitializationEvent event){
- //Init WorldGen config.
- HANDLER_GT.sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg")));
-
- if (DimensionManager.isDimensionRegistered(Dimension_Everglades.DIMID)){
- Dimension_Everglades.DIMID = DimensionManager.getNextFreeDimId();
- }
-
- /*
- * Set World Generation Values
- */
- WorldGen_Ores.generateValidOreVeins();
- WorldGen_GT_Base.oreveinPercentage = 64;
- WorldGen_GT_Base.oreveinAttempts = 16;
- WorldGen_GT_Base.oreveinMaxPlacementAttempts = 4;
- if (CORE_Preloader.DEBUG_MODE || CORE.DEVENV){
- WorldGen_GT_Base.debugWorldGen = true;
- }
- DarkWorldContentLoader.run();
- }
-
- @EventHandler
- public void serverLoad(FMLServerStartingEvent event) {
- getEvergladesBiome().serverLoad(event);
- }
-
- /*@Override
- public int getBurnTime(ItemStack fuel) {
- if (DarkWorld_Biome.addFuel(fuel) != 0)
- return DarkWorld_Biome.addFuel(fuel);
- if (DarkWorld_Dimension.addFuel(fuel) != 0)
- return DarkWorld_Dimension.addFuel(fuel);
- return 0;
- }*/
-
- /*@Override
- public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
- chunkX = chunkX * 16;
- chunkZ = chunkZ * 16;
-
- if (world.provider.dimensionId == Dimension_DarkWorld.DIMID) {
- DarkWorld_Biome.generateSurface(world, random, chunkX, chunkZ);
- }
-
- //What does this even do?
- if (world.provider.dimensionId == -1) {
- DarkWorld_Biome.generateNether(world, random, chunkX, chunkZ);
- }
- if (world.provider.dimensionId == 0) {
- DarkWorld_Biome.generateSurface(world, random, chunkX, chunkZ);
- }
-
- }*/
-
- @EventHandler
- public static void postInit(final FMLPostInitializationEvent e) {
- Logger.INFO("Finished loading Everglades plugin for GT++.");
- }
-
- public static synchronized Biome_Everglades getEvergladesBiome() {
- return Everglades_Biome;
- }
-
- public static synchronized void setEvergladesBiome(Biome_Everglades darkWorld_Biome) {
- Everglades_Biome = darkWorld_Biome;
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
+ // Mod Instance
+ @Mod.Instance(Everglades.MODID)
+ public static GTplusplus_Everglades instance;
+
+ // Dark World Handler
+ protected static volatile Biome_Everglades Everglades_Biome;
+ protected static volatile Dimension_Everglades Everglades_Dimension;
+ public static int globalEvergladesPortalSpawnTimer = 0;
+
+ // Pre-Init
+ @Mod.EventHandler
+ public void preInit(final FMLPreInitializationEvent event) {
+ Logger.INFO("Loading " + Everglades.MODID + " V" + Everglades.VERSION);
+
+ // Setup
+ setVars(event);
+
+ setEvergladesBiome(new Biome_Everglades());
+ Everglades_Dimension = new Dimension_Everglades();
+
+ // Load Dark World
+ getEvergladesBiome().instance = instance;
+ Everglades_Dimension.instance = instance;
+ getEvergladesBiome().preInit(event);
+
+ // Load/Set Custom Ore Gen
+ HANDLER_GT.sCustomWorldgenFile = new GTPP_Config(new Configuration(
+ new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg")));
+ }
+
+ @EventHandler
+ public void load(final FMLInitializationEvent e) {
+ Logger.INFO("Begin resource allocation for " + Everglades.MODID + " V" + Everglades.VERSION);
+
+ // Load World and Biome
+ GameRegistry.registerWorldGenerator(new WorldGen_GT_Base(), Short.MAX_VALUE);
+ getEvergladesBiome().load();
+ Everglades_Dimension.load();
+ }
+
+ public static synchronized void GenerateOreMaterials() {
+ MaterialGenerator.generateOreMaterial(ORES.CROCROITE);
+ MaterialGenerator.generateOreMaterial(ORES.GEIKIELITE);
+ MaterialGenerator.generateOreMaterial(ORES.NICHROMITE);
+ MaterialGenerator.generateOreMaterial(ORES.TITANITE);
+ MaterialGenerator.generateOreMaterial(ORES.ZIMBABWEITE);
+ MaterialGenerator.generateOreMaterial(ORES.ZIRCONILITE);
+ MaterialGenerator.generateOreMaterial(ORES.GADOLINITE_CE);
+ MaterialGenerator.generateOreMaterial(ORES.GADOLINITE_Y);
+ MaterialGenerator.generateOreMaterial(ORES.LEPERSONNITE);
+ MaterialGenerator.generateOreMaterial(ORES.SAMARSKITE_Y);
+ MaterialGenerator.generateOreMaterial(ORES.SAMARSKITE_YB);
+ MaterialGenerator.generateOreMaterial(ORES.XENOTIME);
+ MaterialGenerator.generateOreMaterial(ORES.YTTRIAITE);
+ MaterialGenerator.generateOreMaterial(ORES.YTTRIALITE);
+ MaterialGenerator.generateOreMaterial(ORES.YTTROCERITE);
+ MaterialGenerator.generateOreMaterial(ORES.ZIRCON);
+ MaterialGenerator.generateOreMaterial(ORES.POLYCRASE);
+ MaterialGenerator.generateOreMaterial(ORES.ZIRCOPHYLLITE);
+ MaterialGenerator.generateOreMaterial(ORES.ZIRKELITE);
+ MaterialGenerator.generateOreMaterial(ORES.LANTHANITE_LA);
+ MaterialGenerator.generateOreMaterial(ORES.LANTHANITE_CE);
+ MaterialGenerator.generateOreMaterial(ORES.LANTHANITE_ND);
+ MaterialGenerator.generateOreMaterial(ORES.AGARDITE_Y);
+ MaterialGenerator.generateOreMaterial(ORES.AGARDITE_CD);
+ MaterialGenerator.generateOreMaterial(ORES.AGARDITE_LA);
+ MaterialGenerator.generateOreMaterial(ORES.AGARDITE_ND);
+ MaterialGenerator.generateOreMaterial(ORES.HIBONITE);
+ MaterialGenerator.generateOreMaterial(ORES.CERITE);
+ MaterialGenerator.generateOreMaterial(ORES.FLUORCAPHITE);
+ MaterialGenerator.generateOreMaterial(ORES.FLORENCITE);
+ MaterialGenerator.generateOreMaterial(ORES.CRYOLITE);
+
+ MaterialGenerator.generateOreMaterial(ORES.LAUTARITE);
+ MaterialGenerator.generateOreMaterial(ORES.LAFOSSAITE);
+ MaterialGenerator.generateOreMaterial(ORES.DEMICHELEITE_BR);
+ MaterialGenerator.generateOreMaterial(ORES.COMANCHEITE);
+ MaterialGenerator.generateOreMaterial(ORES.PERROUDITE);
+ MaterialGenerator.generateOreMaterial(ORES.HONEAITE);
+ MaterialGenerator.generateOreMaterial(ORES.ALBURNITE);
+ MaterialGenerator.generateOreMaterial(ORES.MIESSIITE);
+ MaterialGenerator.generateOreMaterial(ORES.KASHINITE);
+ MaterialGenerator.generateOreMaterial(ORES.IRARSITE);
+ MaterialGenerator.generateOreMaterial(ORES.GREENOCKITE);
+ MaterialGenerator.generateOreMaterial(ORES.RADIOBARITE);
+ MaterialGenerator.generateOreMaterial(ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT);
+
+ // Custom Ores
+ if (LoadedMods.Big_Reactors) {
+ MaterialGenerator.generateOreMaterial(
+ ELEMENT.getInstance().YELLORIUM, false, false, true, new short[] {255, 242, 10});
+ }
+ }
+
+ protected synchronized void setVars(FMLPreInitializationEvent event) {
+ // Init WorldGen config.
+ HANDLER_GT.sCustomWorldgenFile = new GTPP_Config(new Configuration(
+ new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg")));
+
+ if (DimensionManager.isDimensionRegistered(Dimension_Everglades.DIMID)) {
+ Dimension_Everglades.DIMID = DimensionManager.getNextFreeDimId();
+ }
+
+ /*
+ * Set World Generation Values
+ */
+ WorldGen_Ores.generateValidOreVeins();
+ WorldGen_GT_Base.oreveinPercentage = 64;
+ WorldGen_GT_Base.oreveinAttempts = 16;
+ WorldGen_GT_Base.oreveinMaxPlacementAttempts = 4;
+ if (CORE_Preloader.DEBUG_MODE || CORE.DEVENV) {
+ WorldGen_GT_Base.debugWorldGen = true;
+ }
+ DarkWorldContentLoader.run();
+ }
+
+ @EventHandler
+ public void serverLoad(FMLServerStartingEvent event) {
+ getEvergladesBiome().serverLoad(event);
+ }
+
+ /*@Override
+ public int getBurnTime(ItemStack fuel) {
+ if (DarkWorld_Biome.addFuel(fuel) != 0)
+ return DarkWorld_Biome.addFuel(fuel);
+ if (DarkWorld_Dimension.addFuel(fuel) != 0)
+ return DarkWorld_Dimension.addFuel(fuel);
+ return 0;
+ }*/
+
+ /*@Override
+ public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
+ chunkX = chunkX * 16;
+ chunkZ = chunkZ * 16;
+
+ if (world.provider.dimensionId == Dimension_DarkWorld.DIMID) {
+ DarkWorld_Biome.generateSurface(world, random, chunkX, chunkZ);
+ }
+
+ //What does this even do?
+ if (world.provider.dimensionId == -1) {
+ DarkWorld_Biome.generateNether(world, random, chunkX, chunkZ);
+ }
+ if (world.provider.dimensionId == 0) {
+ DarkWorld_Biome.generateSurface(world, random, chunkX, chunkZ);
+ }
+
+ }*/
+
+ @EventHandler
+ public static void postInit(final FMLPostInitializationEvent e) {
+ Logger.INFO("Finished loading Everglades plugin for GT++.");
+ }
+
+ public static synchronized Biome_Everglades getEvergladesBiome() {
+ return Everglades_Biome;
+ }
+
+ public static synchronized void setEvergladesBiome(Biome_Everglades darkWorld_Biome) {
+ Everglades_Biome = darkWorld_Biome;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java b/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java
index 0f8acd75b4..f443a6560d 100644
--- a/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java
+++ b/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java
@@ -3,8 +3,9 @@ package gtPlusPlus.everglades.biome;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*;
+import gtPlusPlus.everglades.gen.WorldGenDeadLilly;
+import gtPlusPlus.everglades.gen.WorldGenMinable_Custom;
import java.util.Random;
-
import net.minecraft.block.BlockFlower;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
@@ -12,27 +13,23 @@ import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeDecorator;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.*;
-
-import gtPlusPlus.everglades.gen.WorldGenDeadLilly;
-import gtPlusPlus.everglades.gen.WorldGenMinable_Custom;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import net.minecraftforge.event.terraingen.OreGenEvent;
import net.minecraftforge.event.terraingen.TerrainGen;
public class BiomeGenerator_Custom extends BiomeDecorator {
-
+
public WorldGenerator fluoriteGen;
- public BiomeGenerator_Custom(){
- //Basic Blocks
+ public BiomeGenerator_Custom() {
+ // Basic Blocks
this.sandGen = new WorldGenMinable_Custom(Blocks.sand, 12);
this.gravelAsSandGen = new WorldGenMinable_Custom(Blocks.gravel, 8);
this.dirtGen = new WorldGenMinable_Custom(Blocks.dirt, 32);
this.gravelGen = new WorldGenMinable_Custom(Blocks.gravel, 12);
-
-
- //Oregen
+
+ // Oregen
this.coalGen = new WorldGenMinable_Custom(Blocks.coal_ore, 16);
this.ironGen = new WorldGenMinable_Custom(Blocks.iron_ore, 12);
this.goldGen = new WorldGenMinable_Custom(Blocks.gold_ore, 12);
@@ -40,8 +37,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
this.diamondGen = new WorldGenMinable_Custom(Blocks.diamond_ore, 12);
this.lapisGen = new WorldGenMinable_Custom(Blocks.lapis_ore, 8);
// this.fluoriteGen = new WorldGenMinable_Custom(ModBlocks.blockOreFluorite, 20);
-
- //Nature
+
+ // Nature
this.yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower);
this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom);
this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom);
@@ -49,25 +46,22 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
this.reedGen = new WorldGenReed();
this.cactusGen = new WorldGenCactus();
this.waterlilyGen = new WorldGenDeadLilly();
-
+
this.flowersPerChunk = 1;
this.grassPerChunk = 5;
this.sandPerChunk = 3;
this.sandPerChunk2 = 5;
this.clayPerChunk = 7;
-
+
this.generateLakes = true;
}
@Override
- public void decorateChunk(World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_)
- {
- if (this.currentWorld != null)
- {
+ public void decorateChunk(
+ World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) {
+ if (this.currentWorld != null) {
throw new RuntimeException("Already decorating!!");
- }
- else
- {
+ } else {
this.currentWorld = p_150512_1_;
this.randomGenerator = p_150512_2_;
this.chunk_X = p_150512_4_;
@@ -79,8 +73,7 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
}
@Override
- protected void genDecorations(BiomeGenBase p_150513_1_)
- {
+ protected void genDecorations(BiomeGenBase p_150513_1_) {
MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
this.generateOres();
int i;
@@ -88,33 +81,32 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
int k;
boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND);
- for (i = 0; doGen && i < this.sandPerChunk2; ++i)
- {
+ for (i = 0; doGen && i < this.sandPerChunk2; ++i) {
j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- this.sandGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
+ this.sandGen.generate(
+ this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY);
- for (i = 0; doGen && i < this.clayPerChunk; ++i)
- {
+ for (i = 0; doGen && i < this.clayPerChunk; ++i) {
j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- this.clayGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
+ this.clayGen.generate(
+ this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2);
- for (i = 0; doGen && i < this.sandPerChunk; ++i)
- {
+ for (i = 0; doGen && i < this.sandPerChunk; ++i) {
j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- this.gravelAsSandGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
+ this.gravelAsSandGen.generate(
+ this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k);
}
i = this.treesPerChunk;
- if (this.randomGenerator.nextInt(10) == 0)
- {
+ if (this.randomGenerator.nextInt(10) == 0) {
++i;
}
@@ -122,47 +114,42 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
int i1;
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE);
- for (j = 0; doGen && j < i; ++j)
- {
+ for (j = 0; doGen && j < i; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = this.currentWorld.getHeightValue(k, l);
WorldGenAbstractTree worldgenabstracttree = p_150513_1_.func_150567_a(this.randomGenerator);
worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);
- if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, k, i1, l))
- {
+ if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, k, i1, l)) {
worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, k, i1, l);
}
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, BIG_SHROOM);
- for (j = 0; doGen && j < this.bigMushroomsPerChunk; ++j)
- {
+ for (j = 0; doGen && j < this.bigMushroomsPerChunk; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, k, this.currentWorld.getHeightValue(k, l), l);
+ this.bigMushroomGen.generate(
+ this.currentWorld, this.randomGenerator, k, this.currentWorld.getHeightValue(k, l), l);
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS);
- for (j = 0; doGen && j < this.flowersPerChunk; ++j)
- {
+ for (j = 0; doGen && j < this.flowersPerChunk; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = nextInt(this.currentWorld.getHeightValue(k, l) + 32);
String s = p_150513_1_.func_150572_a(this.randomGenerator, k, i1, l);
BlockFlower blockflower = BlockFlower.func_149857_e(s);
- if (blockflower.getMaterial() != Material.air)
- {
+ if (blockflower.getMaterial() != Material.air) {
this.yellowFlowerGen.func_150550_a(blockflower, BlockFlower.func_149856_f(s));
this.yellowFlowerGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
}
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS);
- for (j = 0; doGen && j < this.grassPerChunk; ++j)
- {
+ for (j = 0; doGen && j < this.grassPerChunk; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
@@ -171,8 +158,7 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH);
- for (j = 0; doGen && j < this.deadBushPerChunk; ++j)
- {
+ for (j = 0; doGen && j < this.deadBushPerChunk; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
@@ -180,13 +166,13 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD);
- for (j = 0; doGen && j < this.waterlilyPerChunk; ++j)
- {
+ for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
- for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1)
- {
+ for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
+ i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l);
+ --i1) {
;
}
@@ -194,18 +180,15 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM);
- for (j = 0; doGen && j < this.mushroomsPerChunk; ++j)
- {
- if (this.randomGenerator.nextInt(4) == 0)
- {
+ for (j = 0; doGen && j < this.mushroomsPerChunk; ++j) {
+ if (this.randomGenerator.nextInt(4) == 0) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = this.currentWorld.getHeightValue(k, l);
this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
}
- if (this.randomGenerator.nextInt(8) == 0)
- {
+ if (this.randomGenerator.nextInt(8) == 0) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
@@ -213,16 +196,14 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
}
}
- if (doGen && this.randomGenerator.nextInt(4) == 0)
- {
+ if (doGen && this.randomGenerator.nextInt(4) == 0) {
j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k);
}
- if (doGen && this.randomGenerator.nextInt(8) == 0)
- {
+ if (doGen && this.randomGenerator.nextInt(8) == 0) {
j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
@@ -230,16 +211,14 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED);
- for (j = 0; doGen && j < this.reedsPerChunk; ++j)
- {
+ for (j = 0; doGen && j < this.reedsPerChunk; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
}
- for (j = 0; doGen && j < 10; ++j)
- {
+ for (j = 0; doGen && j < 10; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
@@ -247,8 +226,7 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, PUMPKIN);
- if (doGen && this.randomGenerator.nextInt(32) == 0)
- {
+ if (doGen && this.randomGenerator.nextInt(32) == 0) {
j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
@@ -256,8 +234,7 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS);
- for (j = 0; doGen && j < this.cactiPerChunk; ++j)
- {
+ for (j = 0; doGen && j < this.cactiPerChunk; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
@@ -265,20 +242,18 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
}
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE);
- if (doGen && this.generateLakes)
- {
- for (j = 0; j < 50; ++j)
- {
+ if (doGen && this.generateLakes) {
+ for (j = 0; j < 50; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8);
i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
(new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, k, l, i1);
}
- for (j = 0; j < 20; ++j)
- {
+ for (j = 0; j < 20; ++j) {
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
- l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8);
+ l = this.randomGenerator.nextInt(
+ this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8);
i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
(new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, k, l, i1);
}
@@ -291,10 +266,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
* Standard ore generation helper. Generates most ores.
*/
@Override
- protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_)
- {
- for (int l = 0; l < p_76795_1_; ++l)
- {
+ protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) {
+ for (int l = 0; l < p_76795_1_; ++l) {
int i1 = this.chunk_X + this.randomGenerator.nextInt(16);
int j1 = this.randomGenerator.nextInt(p_76795_4_ - p_76795_3_) + p_76795_3_;
int k1 = this.chunk_Z + this.randomGenerator.nextInt(16);
@@ -306,12 +279,12 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
* Standard ore generation helper. Generates Lapis Lazuli.
*/
@Override
- protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_)
- {
- for (int l = 0; l < p_76793_1_; ++l)
- {
+ protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) {
+ for (int l = 0; l < p_76793_1_; ++l) {
int i1 = this.chunk_X + this.randomGenerator.nextInt(16);
- int j1 = this.randomGenerator.nextInt(p_76793_4_) + this.randomGenerator.nextInt(p_76793_4_) + (p_76793_3_ - p_76793_4_);
+ int j1 = this.randomGenerator.nextInt(p_76793_4_)
+ + this.randomGenerator.nextInt(p_76793_4_)
+ + (p_76793_3_ - p_76793_4_);
int k1 = this.chunk_Z + this.randomGenerator.nextInt(16);
p_76793_2_.generate(this.currentWorld, this.randomGenerator, i1, j1, k1);
}
@@ -321,31 +294,29 @@ public class BiomeGenerator_Custom extends BiomeDecorator {
* Generates ores in the current chunk
*/
@Override
- protected void generateOres()
- {
+ protected void generateOres() {
MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT))
- this.genStandardOre1(20, this.dirtGen, 0, 256);
+ this.genStandardOre1(20, this.dirtGen, 0, 256);
if (TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen, chunk_X, chunk_Z, GRAVEL))
- this.genStandardOre1(10, this.gravelGen, 0, 256);
+ this.genStandardOre1(10, this.gravelGen, 0, 256);
if (TerrainGen.generateOre(currentWorld, randomGenerator, coalGen, chunk_X, chunk_Z, COAL))
- this.genStandardOre1(20, this.coalGen, 0, 128);
+ this.genStandardOre1(20, this.coalGen, 0, 128);
if (TerrainGen.generateOre(currentWorld, randomGenerator, ironGen, chunk_X, chunk_Z, IRON))
- this.genStandardOre1(20, this.ironGen, 0, 64);
+ this.genStandardOre1(20, this.ironGen, 0, 64);
if (TerrainGen.generateOre(currentWorld, randomGenerator, goldGen, chunk_X, chunk_Z, GOLD))
- this.genStandardOre1(2, this.goldGen, 0, 32);
+ this.genStandardOre1(2, this.goldGen, 0, 32);
if (TerrainGen.generateOre(currentWorld, randomGenerator, redstoneGen, chunk_X, chunk_Z, REDSTONE))
- this.genStandardOre1(8, this.redstoneGen, 0, 16);
+ this.genStandardOre1(8, this.redstoneGen, 0, 16);
if (TerrainGen.generateOre(currentWorld, randomGenerator, diamondGen, chunk_X, chunk_Z, DIAMOND))
- this.genStandardOre1(1, this.diamondGen, 0, 16);
+ this.genStandardOre1(1, this.diamondGen, 0, 16);
if (TerrainGen.generateOre(currentWorld, randomGenerator, lapisGen, chunk_X, chunk_Z, LAPIS))
- this.genStandardOre2(1, this.lapisGen, 16, 16);
+ this.genStandardOre2(1, this.lapisGen, 16, 16);
MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
}
private int nextInt(int i) {
- if (i <= 1)
- return 0;
+ if (i <= 1) return 0;
return this.randomGenerator.nextInt(i);
- }
-} \ No newline at end of file
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java b/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java
index b31f6d034e..214b86d196 100644
--- a/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java
+++ b/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java
@@ -1,150 +1,141 @@
package gtPlusPlus.everglades.biome;
-import java.lang.reflect.Field;
-import java.util.Random;
-
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.entity.monster.EntityPigZombie;
-import net.minecraft.entity.passive.EntityBat;
-import net.minecraft.entity.passive.EntitySquid;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-import net.minecraft.world.biome.BiomeGenBase;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.entity.monster.EntitySickBlaze;
import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.everglades.dimension.Dimension_Everglades;
+import java.lang.reflect.Field;
+import java.util.Random;
+import net.minecraft.entity.monster.EntityPigZombie;
+import net.minecraft.entity.passive.EntityBat;
+import net.minecraft.entity.passive.EntitySquid;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeManager;
public class Biome_Everglades {
- public static BiomeGenEverglades biome = new BiomeGenEverglades();
-
- public Object instance;
-
- public Biome_Everglades() {
- }
-
- public void load() {
- BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DEAD);
- BiomeManager.addSpawnBiome(biome);
- }
-
- public void generateNether(World world, Random random, int chunkX, int chunkZ) {
- }
-
- public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
- }
-
- public void registerRenderers() {
- }
-
- public int addFuel(ItemStack fuel) {
- return 0;
- }
-
- public void serverLoad(FMLServerStartingEvent event) {
- }
-
- public void preInit(FMLPreInitializationEvent event) {
- }
-
- static class BiomeGenEverglades extends BiomeGenBase {
- @SuppressWarnings("unchecked")
- public BiomeGenEverglades() {
- super(CORE.EVERGLADESBIOME_ID);
- //this.setBiomeID();
- this.theBiomeDecorator = new BiomeGenerator_Custom();
- this.theBiomeDecorator.treesPerChunk = 10;
- //Logger.INFO("Dark World Temperature Category: "+getTempCategory());
- this.setBiomeName("Toxic Everglades");
- this.topBlock = Dimension_Everglades.blockTopLayer;
- this.fillerBlock = Dimension_Everglades.blockSecondLayer;
- this.enableRain = true;
- this.enableSnow = false;
- this.rainfall = 0.7F;
- this.setHeight(new BiomeGenBase.Height(0.3F, 0.5F));
- this.heightVariation = 0.4F;
- this.waterColorMultiplier = 0x17290A;
- this.rootHeight = -0.25f; //Ground level
-
- this.spawnableMonsterList.clear();
- this.spawnableCreatureList.clear();
- this.spawnableWaterCreatureList.clear();
- this.spawnableCaveCreatureList.clear();
-
- //Enemies
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySickBlaze.class, 100, 2, 6));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 75, 4, 16));
- this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityStaballoyConstruct.class, 20, 1, 2));
-
- //Animals
- this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 1, 1, 6));
- this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
-
- }
-
- private synchronized boolean setBiomeID() {
- try {
- Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList");
- Field mClone = mInternalBiomeList;
- BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null);
- BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length];
- for (int index=0;index<mTempList.length;index++) {
- mTempList[index] = mOriginalList[index];
- }
- if (mTempList != null){
- mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this;
- mInternalBiomeList.set(null, mTempList);
- if (mTempList != mInternalBiomeList.get(null)){
- ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList);
- Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
- return true;
- }
- else {
- Logger.REFLECTION("Failed to set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
- }
- }
- return false;
- }
- catch (Exception e) {
- Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+".");
- e.printStackTrace();
- return false;
- }
- }
-
- @SideOnly(Side.CLIENT)
- public int getBiomeGrassColor() {
- return 0x111f11;
- }
-
- @SideOnly(Side.CLIENT)
- public int getBiomeFoliageColor() {
- return 0x111f11;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getSkyColorByTemp(float par1) {
- return 0xF67A14;
- }
-
- @SuppressWarnings({ "unchecked", "unused" })
- private boolean addToMonsterSpawnLists(Class<?> EntityClass, int a, int b, int c){
- //this.spawnableMonsterList.add(new SpawnListEntry(EntityClass, a, b, c));
- this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c));
- return true;
- }
-
- }
-
+ public static BiomeGenEverglades biome = new BiomeGenEverglades();
+
+ public Object instance;
+
+ public Biome_Everglades() {}
+
+ public void load() {
+ BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DEAD);
+ BiomeManager.addSpawnBiome(biome);
+ }
+
+ public void generateNether(World world, Random random, int chunkX, int chunkZ) {}
+
+ public void generateSurface(World world, Random random, int chunkX, int chunkZ) {}
+
+ public void registerRenderers() {}
+
+ public int addFuel(ItemStack fuel) {
+ return 0;
+ }
+
+ public void serverLoad(FMLServerStartingEvent event) {}
+
+ public void preInit(FMLPreInitializationEvent event) {}
+
+ static class BiomeGenEverglades extends BiomeGenBase {
+ @SuppressWarnings("unchecked")
+ public BiomeGenEverglades() {
+ super(CORE.EVERGLADESBIOME_ID);
+ // this.setBiomeID();
+ this.theBiomeDecorator = new BiomeGenerator_Custom();
+ this.theBiomeDecorator.treesPerChunk = 10;
+ // Logger.INFO("Dark World Temperature Category: "+getTempCategory());
+ this.setBiomeName("Toxic Everglades");
+ this.topBlock = Dimension_Everglades.blockTopLayer;
+ this.fillerBlock = Dimension_Everglades.blockSecondLayer;
+ this.enableRain = true;
+ this.enableSnow = false;
+ this.rainfall = 0.7F;
+ this.setHeight(new BiomeGenBase.Height(0.3F, 0.5F));
+ this.heightVariation = 0.4F;
+ this.waterColorMultiplier = 0x17290A;
+ this.rootHeight = -0.25f; // Ground level
+
+ this.spawnableMonsterList.clear();
+ this.spawnableCreatureList.clear();
+ this.spawnableWaterCreatureList.clear();
+ this.spawnableCaveCreatureList.clear();
+
+ // Enemies
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySickBlaze.class, 100, 2, 6));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 75, 4, 16));
+ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityStaballoyConstruct.class, 20, 1, 2));
+
+ // Animals
+ this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 1, 1, 6));
+ this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
+ }
+
+ private synchronized boolean setBiomeID() {
+ try {
+ Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList");
+ Field mClone = mInternalBiomeList;
+ BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null);
+ BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length];
+ for (int index = 0; index < mTempList.length; index++) {
+ mTempList[index] = mOriginalList[index];
+ }
+ if (mTempList != null) {
+ mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this;
+ mInternalBiomeList.set(null, mTempList);
+ if (mTempList != mInternalBiomeList.get(null)) {
+ ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList);
+ Logger.REFLECTION(
+ "Set Biome ID for " + this.biomeName + " Biome internally in 'biomeList' field from "
+ + BiomeGenBase.class.getCanonicalName() + ".");
+ return true;
+ } else {
+ Logger.REFLECTION("Failed to set Biome ID for " + this.biomeName
+ + " Biome internally in 'biomeList' field from " + BiomeGenBase.class.getCanonicalName()
+ + ".");
+ }
+ }
+ return false;
+ } catch (Exception e) {
+ Logger.REFLECTION(
+ "Could not access 'biomeList' field in " + BiomeGenBase.class.getCanonicalName() + ".");
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public int getBiomeGrassColor() {
+ return 0x111f11;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public int getBiomeFoliageColor() {
+ return 0x111f11;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getSkyColorByTemp(float par1) {
+ return 0xF67A14;
+ }
+
+ @SuppressWarnings({"unchecked", "unused"})
+ private boolean addToMonsterSpawnLists(Class<?> EntityClass, int a, int b, int c) {
+ // this.spawnableMonsterList.add(new SpawnListEntry(EntityClass, a, b, c));
+ this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c));
+ return true;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java b/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java
index b69a8ea555..9a84d6cc99 100644
--- a/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java
+++ b/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java
@@ -6,26 +6,28 @@ import net.minecraft.world.gen.layer.IntCache;
public class GenLayerBiomes extends GenLayer {
- protected BiomeGenBase[] allowedBiomes = { Biome_Everglades.biome, };
+ protected BiomeGenBase[] allowedBiomes = {
+ Biome_Everglades.biome,
+ };
- public GenLayerBiomes(long seed) {
- super(seed);
- }
+ public GenLayerBiomes(long seed) {
+ super(seed);
+ }
- public GenLayerBiomes(long seed, GenLayer genlayer) {
- super(seed);
- this.parent = genlayer;
- }
+ public GenLayerBiomes(long seed, GenLayer genlayer) {
+ super(seed);
+ this.parent = genlayer;
+ }
- @Override
- public int[] getInts(int x, int z, int width, int depth) {
- int[] dest = IntCache.getIntCache(width * depth);
- for (int dz = 0; dz < depth; dz++) {
- for (int dx = 0; dx < width; dx++) {
- this.initChunkSeed(dx + x, dz + z);
- dest[(dx + dz * width)] = this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
- }
- }
- return dest;
- }
-} \ No newline at end of file
+ @Override
+ public int[] getInts(int x, int z, int width, int depth) {
+ int[] dest = IntCache.getIntCache(width * depth);
+ for (int dz = 0; dz < depth; dz++) {
+ for (int dx = 0; dx < width; dx++) {
+ this.initChunkSeed(dx + x, dz + z);
+ dest[(dx + dz * width)] = this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
+ }
+ }
+ return dest;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java b/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java
index 8034921dce..59b4924355 100644
--- a/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java
+++ b/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java
@@ -7,26 +7,26 @@ import net.minecraft.world.gen.layer.GenLayerZoom;
public class GenLayerEverglades extends GenLayer {
- public GenLayerEverglades(long seed) {
- super(seed);
- }
+ public GenLayerEverglades(long seed) {
+ super(seed);
+ }
- public static GenLayer[] makeTheWorld(long seed, WorldType type) {
- GenLayer biomes = new GenLayerBiomes(1L);
- biomes = new GenLayerZoom(1000L, biomes);
- biomes = new GenLayerZoom(1001L, biomes);
- biomes = new GenLayerZoom(1002L, biomes);
- biomes = new GenLayerZoom(1003L, biomes);
- biomes = new GenLayerZoom(1004L, biomes);
- biomes = new GenLayerZoom(1005L, biomes);
- GenLayer genlayervoronoizoom = new GenLayerVoronoiZoom(10L, biomes);
- biomes.initWorldGenSeed(seed);
- genlayervoronoizoom.initWorldGenSeed(seed);
- return new GenLayer[] { biomes, genlayervoronoizoom };
- }
+ public static GenLayer[] makeTheWorld(long seed, WorldType type) {
+ GenLayer biomes = new GenLayerBiomes(1L);
+ biomes = new GenLayerZoom(1000L, biomes);
+ biomes = new GenLayerZoom(1001L, biomes);
+ biomes = new GenLayerZoom(1002L, biomes);
+ biomes = new GenLayerZoom(1003L, biomes);
+ biomes = new GenLayerZoom(1004L, biomes);
+ biomes = new GenLayerZoom(1005L, biomes);
+ GenLayer genlayervoronoizoom = new GenLayerVoronoiZoom(10L, biomes);
+ biomes.initWorldGenSeed(seed);
+ genlayervoronoizoom.initWorldGenSeed(seed);
+ return new GenLayer[] {biomes, genlayervoronoizoom};
+ }
- @Override
- public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) {
- return new int[] {};
- }
-} \ No newline at end of file
+ @Override
+ public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) {
+ return new int[] {};
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldGround.java b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldGround.java
index f68c97b3c5..85154ef1fb 100644
--- a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldGround.java
+++ b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldGround.java
@@ -1,25 +1,22 @@
package gtPlusPlus.everglades.block;
import cpw.mods.fml.common.registry.LanguageRegistry;
-
-import net.minecraft.block.BlockGrass;
-
import gtPlusPlus.api.interfaces.ITileTooltip;
import gtPlusPlus.core.creative.AddToCreativeTab;
+import net.minecraft.block.BlockGrass;
-public class BlockDarkWorldGround extends BlockGrass implements ITileTooltip{
-
- public BlockDarkWorldGround() {
- this.setCreativeTab(AddToCreativeTab.tabBOP);
- this.setBlockName("blockDarkWorldGround");
- this.setHardness(1.0F);
- this.setBlockTextureName("minecraft" + ":" + "grass");
- LanguageRegistry.addName(this, "Unstable Earth");
- }
+public class BlockDarkWorldGround extends BlockGrass implements ITileTooltip {
- @Override
- public int getTooltipID() {
- return 2;
- }
+ public BlockDarkWorldGround() {
+ this.setCreativeTab(AddToCreativeTab.tabBOP);
+ this.setBlockName("blockDarkWorldGround");
+ this.setHardness(1.0F);
+ this.setBlockTextureName("minecraft" + ":" + "grass");
+ LanguageRegistry.addName(this, "Unstable Earth");
+ }
+ @Override
+ public int getTooltipID() {
+ return 2;
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPollutedDirt.java b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPollutedDirt.java
index a1fcc588b5..043f632804 100644
--- a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPollutedDirt.java
+++ b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPollutedDirt.java
@@ -3,72 +3,66 @@ package gtPlusPlus.everglades.block;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.core.creative.AddToCreativeTab;
import net.minecraft.block.BlockDirt;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-
-public class BlockDarkWorldPollutedDirt extends BlockDirt implements ITileTooltip{
+public class BlockDarkWorldPollutedDirt extends BlockDirt implements ITileTooltip {
- public BlockDarkWorldPollutedDirt() {
- this.setCreativeTab(AddToCreativeTab.tabBOP);
- this.setBlockName("blockDarkWorldGround2");
- this.setHardness(0.5F);
- this.setBlockTextureName("minecraft" + ":" + "dirt");
- LanguageRegistry.addName(this, "Polluted Soil");
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getBlockColor()
- {
- double d0 = 0.5D;
- double d1 = 1.0D;
- return ColorizerGrass.getGrassColor(d0, d1);
- }
+ public BlockDarkWorldPollutedDirt() {
+ this.setCreativeTab(AddToCreativeTab.tabBOP);
+ this.setBlockName("blockDarkWorldGround2");
+ this.setHardness(0.5F);
+ this.setBlockTextureName("minecraft" + ":" + "dirt");
+ LanguageRegistry.addName(this, "Polluted Soil");
+ }
- /**
- * Returns the color this block should be rendered. Used by leaves.
- */
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderColor(int p_149741_1_)
- {
- return this.getBlockColor();
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getBlockColor() {
+ double d0 = 0.5D;
+ double d1 = 1.0D;
+ return ColorizerGrass.getGrassColor(d0, d1);
+ }
- /**
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
- * when first determining what to render.
- */
- @Override
- @SideOnly(Side.CLIENT)
- public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_)
- {
- int l = 0;
- int i1 = 0;
- int j1 = 0;
+ /**
+ * Returns the color this block should be rendered. Used by leaves.
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderColor(int p_149741_1_) {
+ return this.getBlockColor();
+ }
- for (int k1 = -1; k1 <= 1; ++k1)
- {
- for (int l1 = -1; l1 <= 1; ++l1)
- {
- int i2 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1).getBiomeGrassColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1);
- l += (i2 & 16711680) >> 16;
- i1 += (i2 & 65280) >> 8;
- j1 += i2 & 255;
- }
- }
+ /**
+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
+ * when first determining what to render.
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) {
+ int l = 0;
+ int i1 = 0;
+ int j1 = 0;
- return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255;
- }
+ for (int k1 = -1; k1 <= 1; ++k1) {
+ for (int l1 = -1; l1 <= 1; ++l1) {
+ int i2 = p_149720_1_
+ .getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1)
+ .getBiomeGrassColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1);
+ l += (i2 & 16711680) >> 16;
+ i1 += (i2 & 65280) >> 8;
+ j1 += i2 & 255;
+ }
+ }
- @Override
- public int getTooltipID() {
- return 3;
- }
+ return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255;
+ }
+ @Override
+ public int getTooltipID() {
+ return 3;
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPortalFrame.java b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPortalFrame.java
index 09dea46ab1..96f32be8a1 100644
--- a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPortalFrame.java
+++ b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPortalFrame.java
@@ -1,30 +1,26 @@
package gtPlusPlus.everglades.block;
import cpw.mods.fml.common.registry.LanguageRegistry;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-
import gtPlusPlus.api.interfaces.ITileTooltip;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
-public class BlockDarkWorldPortalFrame extends Block implements ITileTooltip{
-
- public BlockDarkWorldPortalFrame() {
- super(Material.iron);
- this.setCreativeTab(AddToCreativeTab.tabBOP);
- this.setBlockName("blockDarkWorldPortalFrame");
- this.setHardness(3.0F);
- this.setLightLevel(0.5F);
- this.setBlockTextureName(CORE.MODID + ":" + "metro/TEXTURE_TECH_PANEL_A");
- LanguageRegistry.addName(this, "Containment Frame");
-
- }
-
- @Override
- public int getTooltipID() {
- return 0;
- }
-
+public class BlockDarkWorldPortalFrame extends Block implements ITileTooltip {
+
+ public BlockDarkWorldPortalFrame() {
+ super(Material.iron);
+ this.setCreativeTab(AddToCreativeTab.tabBOP);
+ this.setBlockName("blockDarkWorldPortalFrame");
+ this.setHardness(3.0F);
+ this.setLightLevel(0.5F);
+ this.setBlockTextureName(CORE.MODID + ":" + "metro/TEXTURE_TECH_PANEL_A");
+ LanguageRegistry.addName(this, "Containment Frame");
+ }
+
+ @Override
+ public int getTooltipID() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldSludgeFluid.java b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldSludgeFluid.java
index 3c0445c86d..155319deaa 100644
--- a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldSludgeFluid.java
+++ b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldSludgeFluid.java
@@ -3,99 +3,89 @@ package gtPlusPlus.everglades.block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialLiquid;
-
import net.minecraftforge.fluids.Fluid;
public class BlockDarkWorldSludgeFluid extends Fluid {
-
- public static final Material SLUDGE = new MaterialLiquid(MapColor.dirtColor);
-
- protected static int mapColor = 0xFFFFFFFF;
- protected static float overlayAlpha = 0.2F;
- //protected static SoundEvent emptySound = SoundEvents.ITEM_BUCKET_EMPTY;
- //protected static SoundEvent fillSound = SoundEvents.ITEM_BUCKET_FILL;
- protected static Material material = SLUDGE;
-
-
- public BlockDarkWorldSludgeFluid(String fluidName, int rgbColour) {
- this(fluidName, rgbColour, null);
- }
-
- public BlockDarkWorldSludgeFluid(String fluidName, int rgbColour, Float overlayAlpha) {
- super(fluidName);
- setColor(rgbColour);
- if (overlayAlpha != null){
- setAlpha(overlayAlpha.floatValue());
- }
- else {
- setAlpha(0);
- }
- }
-
- @Override
- public int getColor()
- {
- return mapColor;
- }
-
- public BlockDarkWorldSludgeFluid setColor(int parColor)
- {
- mapColor = parColor;
- return this;
- }
-
- public float getAlpha()
- {
- return overlayAlpha;
- }
-
- public BlockDarkWorldSludgeFluid setAlpha(float parOverlayAlpha)
- {
- overlayAlpha = parOverlayAlpha;
- return this;
- }
-
- /*public blockDarkWorldSludgeFluid setEmptySound(SoundEvent parSound)
- {
- emptySound = parSound;
- return this;
- }
-
- public SoundEvent getEmptySound()
- {
- return emptySound;
- }
-
- @Override
- public blockDarkWorldSludgeFluid setFillSound(SoundEvent parSound)
- {
- fillSound = parSound;
- return this;
- }
-
- @Override
- public SoundEvent getFillSound()
- {
- return fillSound;
- }*/
-
- public BlockDarkWorldSludgeFluid setMaterial(Material parMaterial)
- {
- material = parMaterial;
- return this;
- }
-
- public Material getMaterial()
- {
- return material;
- }
-
- /*@Override
- public boolean doesVaporize(FluidStack fluidStack)
- {
- if (block == null)
- return false;
- return block.getDefaultState().getMaterial() == getMaterial();
- }*/
+ public static final Material SLUDGE = new MaterialLiquid(MapColor.dirtColor);
+
+ protected static int mapColor = 0xFFFFFFFF;
+ protected static float overlayAlpha = 0.2F;
+ // protected static SoundEvent emptySound = SoundEvents.ITEM_BUCKET_EMPTY;
+ // protected static SoundEvent fillSound = SoundEvents.ITEM_BUCKET_FILL;
+ protected static Material material = SLUDGE;
+
+ public BlockDarkWorldSludgeFluid(String fluidName, int rgbColour) {
+ this(fluidName, rgbColour, null);
+ }
+
+ public BlockDarkWorldSludgeFluid(String fluidName, int rgbColour, Float overlayAlpha) {
+ super(fluidName);
+ setColor(rgbColour);
+ if (overlayAlpha != null) {
+ setAlpha(overlayAlpha.floatValue());
+ } else {
+ setAlpha(0);
+ }
+ }
+
+ @Override
+ public int getColor() {
+ return mapColor;
+ }
+
+ public BlockDarkWorldSludgeFluid setColor(int parColor) {
+ mapColor = parColor;
+ return this;
+ }
+
+ public float getAlpha() {
+ return overlayAlpha;
+ }
+
+ public BlockDarkWorldSludgeFluid setAlpha(float parOverlayAlpha) {
+ overlayAlpha = parOverlayAlpha;
+ return this;
+ }
+
+ /*public blockDarkWorldSludgeFluid setEmptySound(SoundEvent parSound)
+ {
+ emptySound = parSound;
+ return this;
+ }
+
+ public SoundEvent getEmptySound()
+ {
+ return emptySound;
+ }
+
+ @Override
+ public blockDarkWorldSludgeFluid setFillSound(SoundEvent parSound)
+ {
+ fillSound = parSound;
+ return this;
+ }
+
+ @Override
+ public SoundEvent getFillSound()
+ {
+ return fillSound;
+ }*/
+
+ public BlockDarkWorldSludgeFluid setMaterial(Material parMaterial) {
+ material = parMaterial;
+ return this;
+ }
+
+ public Material getMaterial() {
+ return material;
+ }
+
+ /*@Override
+ public boolean doesVaporize(FluidStack fluidStack)
+ {
+ if (block == null)
+ return false;
+ return block.getDefaultState().getMaterial() == getMaterial();
+ }*/
}
diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java b/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java
index e64968888d..d4385bc701 100644
--- a/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java
+++ b/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java
@@ -1,10 +1,15 @@
package gtPlusPlus.everglades.block;
-import java.util.Random;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.everglades.dimension.Dimension_Everglades;
+import gtPlusPlus.everglades.world.TeleporterDimensionMod;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
@@ -19,385 +24,382 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.everglades.dimension.Dimension_Everglades;
-import gtPlusPlus.everglades.world.TeleporterDimensionMod;
-
-public class BlockEvergladesPortal extends BlockBreakable implements ITileTooltip{
- IIcon gor = null, dol = null, st1 = null, st2 = null, st3 = null, st4 = null;
-
- public BlockEvergladesPortal() {
- super("portal", Material.portal, false);
- this.setTickRandomly(true);
- this.setHardness(-1.0F);
- this.setLightLevel(0.75F);
- this.setCreativeTab(CreativeTabs.tabBlock);
- this.setBlockName("blockDarkWorldPortal");
-
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public IIcon getIcon(int i, int par2) {
-
- if (i == 0)
- return gor;
-
- else if (i == 1)
- return dol;
-
- else if (i == 2)
- return st1;
-
- else if (i == 3)
- return st2;
-
- else if (i == 4)
- return st4;
-
- else if (i == 5)
- return st3;
-
- else
- return gor;
-
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(IIconRegister reg) {
- this.gor = reg.registerIcon("portal");
- this.dol = reg.registerIcon("portal");
- this.st1 = reg.registerIcon("portal");
- this.st2 = reg.registerIcon("portal");
- this.st3 = reg.registerIcon("portal");
- this.st4 = reg.registerIcon("portal");
- }
-
- /**
- * Ticks the block if it's been scheduled
- */
- @Override
- public void updateTick(World par1World, int x, int y, int z, Random par5Random) {
- super.updateTick(par1World, x, y, z, par5Random);
-
- int blockCount = 0;
- BlockPos portal = new BlockPos(x, y, z, par1World.provider.dimensionId);
-
- for (BlockPos side : portal.getSurroundingBlocks()) {
- Block b = side.getBlockAtPos();
- if (b == Dimension_Everglades.blockPortalFrame || b == Dimension_Everglades.portalBlock) {
- blockCount++;
- }
- }
- if (blockCount < 4) {
- par1World.setBlockToAir(x, y, z);
- }
-
- }
-
- /**
- * Returns a bounding box from the pool of bounding boxes (this means
- * this box can change after the pool has been cleared to be reused)
- */
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
- return null;
- }
-
- /**
- * Updates the blocks bounds based on its current state. Args: world, x,
- * y, z
- */
- @Override
- public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
- float f;
- float f1;
- if (par1IBlockAccess.getBlock(par2 - 1, par3, par4) != this && par1IBlockAccess.getBlock(par2 + 1, par3, par4) != this) {
- f = 0.125F;
- f1 = 0.5F;
- this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
- } else {
- f = 0.5F;
- f1 = 0.125F;
- this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
- }
- }
-
- /**
- * 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;
- }
-
- /**
- * Checks to see if this location is valid to create a portal and will
- * return True if it does. Args: world, x, y, z
- */
- public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) {
- byte b0 = 0;
- byte b1 = 0;
- if (par1World.getBlock(par2 - 1, par3, par4) == Dimension_Everglades.blockPortalFrame
- || par1World.getBlock(par2 + 1, par3, par4) == Dimension_Everglades.blockPortalFrame) {
- b0 = 1;
- }
- if (par1World.getBlock(par2, par3, par4 - 1) == Dimension_Everglades.blockPortalFrame
- || par1World.getBlock(par2, par3, par4 + 1) == Dimension_Everglades.blockPortalFrame) {
- b1 = 1;
- }
- if (b0 == b1) {
- return false;
- } else {
- if (par1World.getBlock(par2 - b0, par3, par4 - b1) == Blocks.air) {
- par2 -= b0;
- par4 -= b1;
- }
- int l;
- int i1;
- for (l = -1; l <= 2; ++l) {
- for (i1 = -1; i1 <= 3; ++i1) {
- boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;
- if (l != -1 && l != 2 || i1 != -1 && i1 != 3) {
- Block j1 = par1World.getBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l);
- if (flag) {
- if (j1 != Dimension_Everglades.blockPortalFrame) {
- return false;
- }
- }
- /*
- * else if (j1 != 0 && j1 !=
- * Main.TutorialFire.blockID) { return false; }
- */
- }
- }
- }
- for (l = 0; l < 2; ++l) {
- for (i1 = 0; i1 < 3; ++i1) {
- par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, this, 0, 2);
- }
- }
- return true;
- }
- }
-
- /**
- * Lets the block know when one of its neighbor changes. Doesn't know
- * which neighbor changed (coordinates passed are their own) Args: x, y,
- * z, neighbor blockID
- */
- public void onNeighborBlockChange(BlockPos pos) {
- int x = pos.xPos, y = pos.yPos, z = pos.zPos;
- Logger.INFO("Trigger");
- int blockCount = 0;
- BlockPos portal = pos;
- World par1World = portal.world;
- for (BlockPos side : portal.getSurroundingBlocks()) {
- Block b = side.getBlockAtPos();
- if (b == Dimension_Everglades.blockPortalFrame || b == Dimension_Everglades.portalBlock) {
- blockCount++;
- }
- }
- if (blockCount < 4) {
- par1World.setBlockToAir(x, y, z);
- par1World.scheduleBlockUpdate(x, y, z, portal.getBlockAtPos(), 0);
- }
-
-
-
- byte b0 = 0;
- byte b1 = 1;
- if (par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this) {
- b0 = 1;
- b1 = 0;
- }
- int i1;
- for (i1 = y; par1World.getBlock(x, i1 - 1, z) == this; --i1) {
- ;
- }
- if (par1World.getBlock(x, i1 - 1, z) != Dimension_Everglades.blockPortalFrame) {
- par1World.setBlockToAir(x, y, z);
- } else {
- int j1;
- for (j1 = 1; j1 < 4 && par1World.getBlock(x, i1 + j1, z) == this; ++j1) {
- ;
- }
- if (j1 == 3 && par1World.getBlock(x, i1 + j1, z) == Dimension_Everglades.blockPortalFrame) {
- boolean flag = par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this;
- boolean flag1 = par1World.getBlock(x, y, z - 1) == this || par1World.getBlock(x, y, z + 1) == this;
- if (flag && flag1) {
- par1World.setBlockToAir(x, y, z);
- } else {
- if ((par1World.getBlock(x + b0, y, z + b1) != Dimension_Everglades.blockPortalFrame || par1World
- .getBlock(x - b0, y, z - b1) != this)
- && (par1World.getBlock(x - b0, y, z - b1) != Dimension_Everglades.blockPortalFrame || par1World.getBlock(x + b0, y,
- z + b1) != this)) {
- par1World.setBlockToAir(x, y, z);
- }
- }
- } else {
- par1World.setBlockToAir(x, y, z);
- }
- }
- }
-
- @Override
- public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
- onNeighborBlockChange(new BlockPos(x, y, z, world.provider.dimensionId));
- super.onNeighborBlockChange(world, x, y, z, block);
- }
-
- /*@Override
- public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) {
- onNeighborBlockChange(new BlockPos(x, y, z, world.));
- super.onNeighborChange(world, x, y, z, tileX, tileY, tileZ);
- }*/
-
- @Override
- @SideOnly(Side.CLIENT)
- /**
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
- * coordinates. Args: blockAccess, x, y, z, side
- */
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
- if (par1IBlockAccess.getBlock(par2, par3, par4) == this) {
- return false;
- } else {
- boolean flag = par1IBlockAccess.getBlock(par2 - 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 - 2, par3, par4) != this;
- boolean flag1 = par1IBlockAccess.getBlock(par2 + 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 + 2, par3, par4) != this;
- boolean flag2 = par1IBlockAccess.getBlock(par2, par3, par4 - 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 - 2) != this;
- boolean flag3 = par1IBlockAccess.getBlock(par2, par3, par4 + 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 + 2) != this;
- boolean flag4 = flag || flag1;
- boolean flag5 = flag2 || flag3;
- return flag4 && par5 == 4 ? true : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3));
- }
- }
-
- /**
- * Returns the quantity of items to drop on block destruction.
- */
- @Override
- public int quantityDropped(Random par1Random) {
- return 0;
- }
-
- /**
- * Triggered whenever an entity collides with this block (enters into
- * the block). Args: world, x, y, z, entity
- */
- @Override
- public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
- if ((par5Entity.ridingEntity == null) && (par5Entity.riddenByEntity == null) && ((par5Entity instanceof EntityPlayerMP))) {
- EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity;
- if (thePlayer.timeUntilPortal > 0) {
- thePlayer.timeUntilPortal = 100;
- } else if (thePlayer.dimension != Dimension_Everglades.DIMID) {
- thePlayer.timeUntilPortal = 100;
- thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, Dimension_Everglades.DIMID,
- new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(Dimension_Everglades.DIMID)));
- } else {
- thePlayer.timeUntilPortal = 100;
- thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0,
- new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(0)));
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- /**
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
- */
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- /**
- * A randomly called display update to be able to add particles or other items for display
- */
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
- if (CORE.RANDOM.nextInt(100) == 0) {
- par1World.playSound(par2 + 0.5D, par3 + 0.5D, par4 + 0.5D, "portal.portal", 0.5F,
- CORE.RANDOM.nextFloat() * 0.4F + 0.8F, false);
- }
- for (int l = 0; l < 4; ++l) {
- double d0 = par2 + CORE.RANDOM.nextFloat();
- double d1 = par3 + CORE.RANDOM.nextFloat();
- double d2 = par4 + CORE.RANDOM.nextFloat();
- double d3 = 0.0D;
- double d4 = 0.0D;
- double d5 = 0.0D;
- int i1 = CORE.RANDOM.nextInt(2) * 2 - 1;
- d3 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
- d4 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
- d5 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
- if (par1World.getBlock(par2 - 1, par3, par4) != this && par1World.getBlock(par2 + 1, par3, par4) != this) {
- d0 = par2 + 0.5D + 0.25D * i1;
- d3 = CORE.RANDOM.nextFloat() * 2.0F * i1;
- } else {
- d2 = par4 + 0.5D + 0.25D * i1;
- d5 = CORE.RANDOM.nextFloat() * 2.0F * i1;
- }
- par1World.spawnParticle("reddust", d0+0.1D, d1, d2, d3, d4, d5);
- par1World.spawnParticle("smoke", d0, d1+0.1D, d2, 0, 0, 0);
-
- Random R = new Random();
-
- if (R.nextInt(10) == 0){
- par1World.spawnParticle("largesmoke", d0, d1, d2, 0, 0+0.2D, 0);
- }
- else if (R.nextInt(5)==1){
- par1World.spawnParticle("flame", d0, d1, d2, 0, 0+0.1D, 0);
- }
- }
- }
-
- @SideOnly(Side.CLIENT)
- /**
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
- */
- public int idPicked(World par1World, int par2, int par3, int par4) {
- return 0;
- }
-
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){
- return Utils.rgbtoHexValue(0, 255, 0);
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- return Utils.rgbtoHexValue(0, 255, 0);
- }
-
- @Override
- public String getLocalizedName() {
- return EnumChatFormatting.OBFUSCATED+super.getLocalizedName();
- }
-
- @Override
- public int getTooltipID() {
- return 1;
- }
+public class BlockEvergladesPortal extends BlockBreakable implements ITileTooltip {
+ IIcon gor = null, dol = null, st1 = null, st2 = null, st3 = null, st4 = null;
+
+ public BlockEvergladesPortal() {
+ super("portal", Material.portal, false);
+ this.setTickRandomly(true);
+ this.setHardness(-1.0F);
+ this.setLightLevel(0.75F);
+ this.setCreativeTab(CreativeTabs.tabBlock);
+ this.setBlockName("blockDarkWorldPortal");
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public IIcon getIcon(int i, int par2) {
+
+ if (i == 0) return gor;
+ else if (i == 1) return dol;
+ else if (i == 2) return st1;
+ else if (i == 3) return st2;
+ else if (i == 4) return st4;
+ else if (i == 5) return st3;
+ else return gor;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister reg) {
+ this.gor = reg.registerIcon("portal");
+ this.dol = reg.registerIcon("portal");
+ this.st1 = reg.registerIcon("portal");
+ this.st2 = reg.registerIcon("portal");
+ this.st3 = reg.registerIcon("portal");
+ this.st4 = reg.registerIcon("portal");
+ }
+
+ /**
+ * Ticks the block if it's been scheduled
+ */
+ @Override
+ public void updateTick(World par1World, int x, int y, int z, Random par5Random) {
+ super.updateTick(par1World, x, y, z, par5Random);
+
+ int blockCount = 0;
+ BlockPos portal = new BlockPos(x, y, z, par1World.provider.dimensionId);
+
+ for (BlockPos side : portal.getSurroundingBlocks()) {
+ Block b = side.getBlockAtPos();
+ if (b == Dimension_Everglades.blockPortalFrame || b == Dimension_Everglades.portalBlock) {
+ blockCount++;
+ }
+ }
+ if (blockCount < 4) {
+ par1World.setBlockToAir(x, y, z);
+ }
+ }
+
+ /**
+ * Returns a bounding box from the pool of bounding boxes (this means
+ * this box can change after the pool has been cleared to be reused)
+ */
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
+ return null;
+ }
+
+ /**
+ * Updates the blocks bounds based on its current state. Args: world, x,
+ * y, z
+ */
+ @Override
+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
+ float f;
+ float f1;
+ if (par1IBlockAccess.getBlock(par2 - 1, par3, par4) != this
+ && par1IBlockAccess.getBlock(par2 + 1, par3, par4) != this) {
+ f = 0.125F;
+ f1 = 0.5F;
+ this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
+ } else {
+ f = 0.5F;
+ f1 = 0.125F;
+ this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
+ }
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Checks to see if this location is valid to create a portal and will
+ * return True if it does. Args: world, x, y, z
+ */
+ public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) {
+ byte b0 = 0;
+ byte b1 = 0;
+ if (par1World.getBlock(par2 - 1, par3, par4) == Dimension_Everglades.blockPortalFrame
+ || par1World.getBlock(par2 + 1, par3, par4) == Dimension_Everglades.blockPortalFrame) {
+ b0 = 1;
+ }
+ if (par1World.getBlock(par2, par3, par4 - 1) == Dimension_Everglades.blockPortalFrame
+ || par1World.getBlock(par2, par3, par4 + 1) == Dimension_Everglades.blockPortalFrame) {
+ b1 = 1;
+ }
+ if (b0 == b1) {
+ return false;
+ } else {
+ if (par1World.getBlock(par2 - b0, par3, par4 - b1) == Blocks.air) {
+ par2 -= b0;
+ par4 -= b1;
+ }
+ int l;
+ int i1;
+ for (l = -1; l <= 2; ++l) {
+ for (i1 = -1; i1 <= 3; ++i1) {
+ boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;
+ if (l != -1 && l != 2 || i1 != -1 && i1 != 3) {
+ Block j1 = par1World.getBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l);
+ if (flag) {
+ if (j1 != Dimension_Everglades.blockPortalFrame) {
+ return false;
+ }
+ }
+ /*
+ * else if (j1 != 0 && j1 !=
+ * Main.TutorialFire.blockID) { return false; }
+ */
+ }
+ }
+ }
+ for (l = 0; l < 2; ++l) {
+ for (i1 = 0; i1 < 3; ++i1) {
+ par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, this, 0, 2);
+ }
+ }
+ return true;
+ }
+ }
+
+ /**
+ * Lets the block know when one of its neighbor changes. Doesn't know
+ * which neighbor changed (coordinates passed are their own) Args: x, y,
+ * z, neighbor blockID
+ */
+ public void onNeighborBlockChange(BlockPos pos) {
+ int x = pos.xPos, y = pos.yPos, z = pos.zPos;
+ Logger.INFO("Trigger");
+ int blockCount = 0;
+ BlockPos portal = pos;
+ World par1World = portal.world;
+ for (BlockPos side : portal.getSurroundingBlocks()) {
+ Block b = side.getBlockAtPos();
+ if (b == Dimension_Everglades.blockPortalFrame || b == Dimension_Everglades.portalBlock) {
+ blockCount++;
+ }
+ }
+ if (blockCount < 4) {
+ par1World.setBlockToAir(x, y, z);
+ par1World.scheduleBlockUpdate(x, y, z, portal.getBlockAtPos(), 0);
+ }
+
+ byte b0 = 0;
+ byte b1 = 1;
+ if (par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this) {
+ b0 = 1;
+ b1 = 0;
+ }
+ int i1;
+ for (i1 = y; par1World.getBlock(x, i1 - 1, z) == this; --i1) {
+ ;
+ }
+ if (par1World.getBlock(x, i1 - 1, z) != Dimension_Everglades.blockPortalFrame) {
+ par1World.setBlockToAir(x, y, z);
+ } else {
+ int j1;
+ for (j1 = 1; j1 < 4 && par1World.getBlock(x, i1 + j1, z) == this; ++j1) {
+ ;
+ }
+ if (j1 == 3 && par1World.getBlock(x, i1 + j1, z) == Dimension_Everglades.blockPortalFrame) {
+ boolean flag = par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this;
+ boolean flag1 = par1World.getBlock(x, y, z - 1) == this || par1World.getBlock(x, y, z + 1) == this;
+ if (flag && flag1) {
+ par1World.setBlockToAir(x, y, z);
+ } else {
+ if ((par1World.getBlock(x + b0, y, z + b1) != Dimension_Everglades.blockPortalFrame
+ || par1World.getBlock(x - b0, y, z - b1) != this)
+ && (par1World.getBlock(x - b0, y, z - b1) != Dimension_Everglades.blockPortalFrame
+ || par1World.getBlock(x + b0, y, z + b1) != this)) {
+ par1World.setBlockToAir(x, y, z);
+ }
+ }
+ } else {
+ par1World.setBlockToAir(x, y, z);
+ }
+ }
+ }
+
+ @Override
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
+ onNeighborBlockChange(new BlockPos(x, y, z, world.provider.dimensionId));
+ super.onNeighborBlockChange(world, x, y, z, block);
+ }
+
+ /*@Override
+ public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) {
+ onNeighborBlockChange(new BlockPos(x, y, z, world.));
+ super.onNeighborChange(world, x, y, z, tileX, tileY, tileZ);
+ }*/
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ /**
+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
+ * coordinates. Args: blockAccess, x, y, z, side
+ */
+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
+ if (par1IBlockAccess.getBlock(par2, par3, par4) == this) {
+ return false;
+ } else {
+ boolean flag = par1IBlockAccess.getBlock(par2 - 1, par3, par4) == this
+ && par1IBlockAccess.getBlock(par2 - 2, par3, par4) != this;
+ boolean flag1 = par1IBlockAccess.getBlock(par2 + 1, par3, par4) == this
+ && par1IBlockAccess.getBlock(par2 + 2, par3, par4) != this;
+ boolean flag2 = par1IBlockAccess.getBlock(par2, par3, par4 - 1) == this
+ && par1IBlockAccess.getBlock(par2, par3, par4 - 2) != this;
+ boolean flag3 = par1IBlockAccess.getBlock(par2, par3, par4 + 1) == this
+ && par1IBlockAccess.getBlock(par2, par3, par4 + 2) != this;
+ boolean flag4 = flag || flag1;
+ boolean flag5 = flag2 || flag3;
+ return flag4 && par5 == 4
+ ? true
+ : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3));
+ }
+ }
+
+ /**
+ * Returns the quantity of items to drop on block destruction.
+ */
+ @Override
+ public int quantityDropped(Random par1Random) {
+ return 0;
+ }
+
+ /**
+ * Triggered whenever an entity collides with this block (enters into
+ * the block). Args: world, x, y, z, entity
+ */
+ @Override
+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
+ if ((par5Entity.ridingEntity == null)
+ && (par5Entity.riddenByEntity == null)
+ && ((par5Entity instanceof EntityPlayerMP))) {
+ EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity;
+ if (thePlayer.timeUntilPortal > 0) {
+ thePlayer.timeUntilPortal = 100;
+ } else if (thePlayer.dimension != Dimension_Everglades.DIMID) {
+ thePlayer.timeUntilPortal = 100;
+ thePlayer
+ .mcServer
+ .getConfigurationManager()
+ .transferPlayerToDimension(
+ thePlayer,
+ Dimension_Everglades.DIMID,
+ new TeleporterDimensionMod(
+ thePlayer.mcServer.worldServerForDimension(Dimension_Everglades.DIMID)));
+ } else {
+ thePlayer.timeUntilPortal = 100;
+ thePlayer
+ .mcServer
+ .getConfigurationManager()
+ .transferPlayerToDimension(
+ thePlayer,
+ 0,
+ new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(0)));
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ /**
+ * A randomly called display update to be able to add particles or other items for display
+ */
+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
+ if (CORE.RANDOM.nextInt(100) == 0) {
+ par1World.playSound(
+ par2 + 0.5D,
+ par3 + 0.5D,
+ par4 + 0.5D,
+ "portal.portal",
+ 0.5F,
+ CORE.RANDOM.nextFloat() * 0.4F + 0.8F,
+ false);
+ }
+ for (int l = 0; l < 4; ++l) {
+ double d0 = par2 + CORE.RANDOM.nextFloat();
+ double d1 = par3 + CORE.RANDOM.nextFloat();
+ double d2 = par4 + CORE.RANDOM.nextFloat();
+ double d3 = 0.0D;
+ double d4 = 0.0D;
+ double d5 = 0.0D;
+ int i1 = CORE.RANDOM.nextInt(2) * 2 - 1;
+ d3 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
+ d4 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
+ d5 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D;
+ if (par1World.getBlock(par2 - 1, par3, par4) != this && par1World.getBlock(par2 + 1, par3, par4) != this) {
+ d0 = par2 + 0.5D + 0.25D * i1;
+ d3 = CORE.RANDOM.nextFloat() * 2.0F * i1;
+ } else {
+ d2 = par4 + 0.5D + 0.25D * i1;
+ d5 = CORE.RANDOM.nextFloat() * 2.0F * i1;
+ }
+ par1World.spawnParticle("reddust", d0 + 0.1D, d1, d2, d3, d4, d5);
+ par1World.spawnParticle("smoke", d0, d1 + 0.1D, d2, 0, 0, 0);
+
+ Random R = new Random();
+
+ if (R.nextInt(10) == 0) {
+ par1World.spawnParticle("largesmoke", d0, d1, d2, 0, 0 + 0.2D, 0);
+ } else if (R.nextInt(5) == 1) {
+ par1World.spawnParticle("flame", d0, d1, d2, 0, 0 + 0.1D, 0);
+ }
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ /**
+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
+ */
+ public int idPicked(World par1World, int par2, int par3, int par4) {
+ return 0;
+ }
+
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
+ return Utils.rgbtoHexValue(0, 255, 0);
+ }
+
+ @Override
+ public int getRenderColor(final int aMeta) {
+ return Utils.rgbtoHexValue(0, 255, 0);
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return EnumChatFormatting.OBFUSCATED + super.getLocalizedName();
+ }
+
+ @Override
+ public int getTooltipID() {
+ return 1;
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/everglades/block/DarkWorldContentLoader.java b/src/main/java/gtPlusPlus/everglades/block/DarkWorldContentLoader.java
index 9d0e425e3a..86c7053dfc 100644
--- a/src/main/java/gtPlusPlus/everglades/block/DarkWorldContentLoader.java
+++ b/src/main/java/gtPlusPlus/everglades/block/DarkWorldContentLoader.java
@@ -3,69 +3,66 @@ package gtPlusPlus.everglades.block;
import static gtPlusPlus.everglades.dimension.Dimension_Everglades.*;
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.init.Blocks;
-
import gtPlusPlus.core.block.base.BlockBaseFluid;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.everglades.item.ItemBlockToxicEverglades;
import gtPlusPlus.everglades.item.ItemEvergladesPortalTrigger;
+import net.minecraft.init.Blocks;
import net.minecraftforge.fluids.FluidRegistry;
public class DarkWorldContentLoader {
- //Static Vars
- public static BlockDarkWorldSludgeFluid SLUDGE;
-
-
- public synchronized static void run() {
- initMisc();
- initItems();
- initBlocks();
- }
-
- public synchronized static boolean initMisc(){
-
- //Fluids
- SLUDGE = (BlockDarkWorldSludgeFluid) new BlockDarkWorldSludgeFluid(
- "sludge",
- Utils.rgbtoHexValue(30, 130, 30))
- .setDensity(1800)
- .setGaseous(false)
- .setLuminosity(2)
- .setViscosity(25000)
- .setTemperature(300);
- FluidRegistry.registerFluid(SLUDGE);
-
- return true;
- }
-
- public synchronized static boolean initItems(){
- portalItem = (ItemEvergladesPortalTrigger) (new ItemEvergladesPortalTrigger().setUnlocalizedName("everglades.trigger"));
- GameRegistry.registerItem(portalItem, "everglades.trigger");
- return true;
- }
-
- public synchronized static boolean initBlocks(){
-
- //Create Block Instances
- blockFluidLakes = new BlockBaseFluid("Sludge", SLUDGE, BlockDarkWorldSludgeFluid.SLUDGE).setLightLevel(2f).setLightOpacity(1).setBlockName("fluidSludge");
- portalBlock = new BlockEvergladesPortal();
- blockTopLayer = new BlockDarkWorldGround();
- blockSecondLayer = new BlockDarkWorldPollutedDirt();
- blockPortalFrame = new BlockDarkWorldPortalFrame();
-
- //Registry
- GameRegistry.registerBlock(portalBlock, ItemBlockToxicEverglades.class, "dimensionDarkWorld_portal");
- GameRegistry.registerBlock(blockTopLayer, ItemBlockToxicEverglades.class, "blockDarkWorldGround");
- GameRegistry.registerBlock(blockSecondLayer, ItemBlockToxicEverglades.class, "blockDarkWorldGround2");
- GameRegistry.registerBlock(blockPortalFrame, ItemBlockToxicEverglades.class, "blockDarkWorldPortalFrame");
-
- //Make Flammable
- Blocks.fire.setFireInfo(blockTopLayer, 30, 20);
-
- return true;
- }
-
-
+ // Static Vars
+ public static BlockDarkWorldSludgeFluid SLUDGE;
+
+ public static synchronized void run() {
+ initMisc();
+ initItems();
+ initBlocks();
+ }
+
+ public static synchronized boolean initMisc() {
+
+ // Fluids
+ SLUDGE = (BlockDarkWorldSludgeFluid) new BlockDarkWorldSludgeFluid("sludge", Utils.rgbtoHexValue(30, 130, 30))
+ .setDensity(1800)
+ .setGaseous(false)
+ .setLuminosity(2)
+ .setViscosity(25000)
+ .setTemperature(300);
+ FluidRegistry.registerFluid(SLUDGE);
+
+ return true;
+ }
+
+ public static synchronized boolean initItems() {
+ portalItem = (ItemEvergladesPortalTrigger)
+ (new ItemEvergladesPortalTrigger().setUnlocalizedName("everglades.trigger"));
+ GameRegistry.registerItem(portalItem, "everglades.trigger");
+ return true;
+ }
+
+ public static synchronized boolean initBlocks() {
+
+ // Create Block Instances
+ blockFluidLakes = new BlockBaseFluid("Sludge", SLUDGE, BlockDarkWorldSludgeFluid.SLUDGE)
+ .setLightLevel(2f)
+ .setLightOpacity(1)
+ .setBlockName("fluidSludge");
+ portalBlock = new BlockEvergladesPortal();
+ blockTopLayer = new BlockDarkWorldGround();
+ blockSecondLayer = new BlockDarkWorldPollutedDirt();
+ blockPortalFrame = new BlockDarkWorldPortalFrame();
+
+ // Registry
+ GameRegistry.registerBlock(portalBlock, ItemBlockToxicEverglades.class, "dimensionDarkWorld_portal");
+ GameRegistry.registerBlock(blockTopLayer, ItemBlockToxicEverglades.class, "blockDarkWorldGround");
+ GameRegistry.registerBlock(blockSecondLayer, ItemBlockToxicEverglades.class, "blockDarkWorldGround2");
+ GameRegistry.registerBlock(blockPortalFrame, ItemBlockToxicEverglades.class, "blockDarkWorldPortalFrame");
+
+ // Make Flammable
+ Blocks.fire.setFireInfo(blockTopLayer, 30, 20);
+
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/dimension/Dimension_Everglades.java b/src/main/java/gtPlusPlus/everglades/dimension/Dimension_Everglades.java
index 33b36a9ae0..cf53f0f061 100644
--- a/src/main/java/gtPlusPlus/everglades/dimension/Dimension_Everglades.java
+++ b/src/main/java/gtPlusPlus/everglades/dimension/Dimension_Everglades.java
@@ -1,30 +1,28 @@
package gtPlusPlus.everglades.dimension;
-import net.minecraft.block.Block;
-import net.minecraft.init.Blocks;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.everglades.block.BlockEvergladesPortal;
import gtPlusPlus.everglades.item.ItemEvergladesPortalTrigger;
import gtPlusPlus.everglades.world.WorldProviderMod;
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
import net.minecraftforge.common.DimensionManager;
public class Dimension_Everglades {
- public Object instance;
- public static int DIMID = CORE.EVERGLADES_ID;
- public static BlockEvergladesPortal portalBlock;
- public static ItemEvergladesPortalTrigger portalItem;
- public static Block blockTopLayer;
- public static Block blockSecondLayer;
- public static Block blockMainFiller = Blocks.stone;
- public static Block blockSecondaryFiller;
- public static Block blockFluidLakes;
- public static Block blockPortalFrame;
-
- public void load() {
- DimensionManager.registerProviderType(DIMID, WorldProviderMod.class, false);
- DimensionManager.registerDimension(DIMID, DIMID);
- }
+ public Object instance;
+ public static int DIMID = CORE.EVERGLADES_ID;
+ public static BlockEvergladesPortal portalBlock;
+ public static ItemEvergladesPortalTrigger portalItem;
+ public static Block blockTopLayer;
+ public static Block blockSecondLayer;
+ public static Block blockMainFiller = Blocks.stone;
+ public static Block blockSecondaryFiller;
+ public static Block blockFluidLakes;
+ public static Block blockPortalFrame;
+ public void load() {
+ DimensionManager.registerProviderType(DIMID, WorldProviderMod.class, false);
+ DimensionManager.registerDimension(DIMID, DIMID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/gen/WorldGenDeadLilly.java b/src/main/java/gtPlusPlus/everglades/gen/WorldGenDeadLilly.java
index 0314f71eec..ded79aec6a 100644
--- a/src/main/java/gtPlusPlus/everglades/gen/WorldGenDeadLilly.java
+++ b/src/main/java/gtPlusPlus/everglades/gen/WorldGenDeadLilly.java
@@ -1,7 +1,6 @@
package gtPlusPlus.everglades.gen;
import java.util.Random;
-
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenWaterlily;
@@ -9,20 +8,17 @@ import net.minecraft.world.gen.feature.WorldGenWaterlily;
public class WorldGenDeadLilly extends WorldGenWaterlily {
@Override
- public boolean generate(World world, Random rand, int x, int y, int z)
- {
- for (int l = 0; l < 10; ++l)
- {
+ public boolean generate(World world, Random rand, int x, int y, int z) {
+ for (int l = 0; l < 10; ++l) {
int i1 = x + rand.nextInt(8) - rand.nextInt(8);
int j1 = y + rand.nextInt(4) - rand.nextInt(4);
int k1 = z + rand.nextInt(8) - rand.nextInt(8);
- if (world.isAirBlock(i1, j1, k1) && Blocks.waterlily.canPlaceBlockAt(world, i1, j1, k1))
- {
+ if (world.isAirBlock(i1, j1, k1) && Blocks.waterlily.canPlaceBlockAt(world, i1, j1, k1)) {
world.setBlock(i1, j1, k1, Blocks.waterlily, 0, 2);
}
}
return true;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java b/src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java
index 303f7353f0..1480c8651a 100644
--- a/src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java
+++ b/src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java
@@ -2,89 +2,86 @@ package gtPlusPlus.everglades.gen;
import static gtPlusPlus.core.lib.CORE.PI;
+import gtPlusPlus.api.objects.Logger;
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.gen.feature.WorldGenMinable;
-import gtPlusPlus.api.objects.Logger;
-
-public class WorldGenMinable_Custom extends WorldGenMinable
-{
- /** The block to generate. */
- private Block oreToGenerate;
- /** The number of blocks to generate. */
- private int numberOfBlocks;
- /** The block to replace. */
- private Block blockToReplace;
- /** The meta of the block. */
- private int mineableBlockMeta;
+public class WorldGenMinable_Custom extends WorldGenMinable {
+ /** The block to generate. */
+ private Block oreToGenerate;
+ /** The number of blocks to generate. */
+ private int numberOfBlocks;
+ /** The block to replace. */
+ private Block blockToReplace;
+ /** The meta of the block. */
+ private int mineableBlockMeta;
- public WorldGenMinable_Custom(final Block block, final int count){
- super(block, count, Blocks.stone);
- }
+ public WorldGenMinable_Custom(final Block block, final int count) {
+ super(block, count, Blocks.stone);
+ }
- public WorldGenMinable_Custom(final Block block, final int count, final Block target){
- super(block, count, target);
- this.oreToGenerate = block;
- this.numberOfBlocks = count;
- this.blockToReplace = target;
- }
+ public WorldGenMinable_Custom(final Block block, final int count, final Block target) {
+ super(block, count, target);
+ this.oreToGenerate = block;
+ this.numberOfBlocks = count;
+ this.blockToReplace = target;
+ }
- public WorldGenMinable_Custom(final Block block, final int meta, final int number, final Block target){
- this(block, number, target);
- this.mineableBlockMeta = meta;
- }
+ public WorldGenMinable_Custom(final Block block, final int meta, final int number, final Block target) {
+ this(block, number, target);
+ this.mineableBlockMeta = meta;
+ }
- @Override
- public boolean generate(final World world, final Random rand, final int x, final int y, final int z)
- {
- final float f = rand.nextFloat() * PI;
- final double d0 = x + 16 + ((MathHelper.sin(f) * this.numberOfBlocks) / 4.0F);
- final double d1 = (x + 16) - ((MathHelper.sin(f) * this.numberOfBlocks) / 4.0F);
- final double d2 = z + 16 + ((MathHelper.cos(f) * this.numberOfBlocks) / 4.0F);
- final double d3 = (z + 16) - ((MathHelper.cos(f) * this.numberOfBlocks) / 4.0F);
- final double d4 = (y + rand.nextInt(8)) - 1;
- final double d5 = (y + rand.nextInt(8)) - 1;
+ @Override
+ public boolean generate(final World world, final Random rand, final int x, final int y, final int z) {
+ final float f = rand.nextFloat() * PI;
+ final double d0 = x + 16 + ((MathHelper.sin(f) * this.numberOfBlocks) / 4.0F);
+ final double d1 = (x + 16) - ((MathHelper.sin(f) * this.numberOfBlocks) / 4.0F);
+ final double d2 = z + 16 + ((MathHelper.cos(f) * this.numberOfBlocks) / 4.0F);
+ final double d3 = (z + 16) - ((MathHelper.cos(f) * this.numberOfBlocks) / 4.0F);
+ final double d4 = (y + rand.nextInt(8)) - 1;
+ final double d5 = (y + rand.nextInt(8)) - 1;
- for (int l = 0; l <= this.numberOfBlocks; ++l)
- {
- final double d6 = d0 + (((d1 - d0) * l) / this.numberOfBlocks);
- final double d7 = d4 + (((d5 - d4) * l) / this.numberOfBlocks);
- final double d8 = d2 + (((d3 - d2) * l) / this.numberOfBlocks);
- final double d9 = (rand.nextDouble() * this.numberOfBlocks) / 8.0D;
- final double d10 = ((MathHelper.sin((l * PI) / this.numberOfBlocks) + 1.0F) * d9) + 1.0D;
- final double d11 = ((MathHelper.sin((l * PI) / this.numberOfBlocks) + 1.0F) * d9) + 1.0D;
- final int i1 = MathHelper.floor_double(d6 - (d10 / 2.0D));
- final int j1 = MathHelper.floor_double(d7 - (d11 / 2.0D));
- final int k1 = MathHelper.floor_double(d8 - (d10 / 2.0D));
- final int l1 = MathHelper.floor_double(d6 + (d10 / 2.0D));
- final int i2 = MathHelper.floor_double(d7 + (d11 / 2.0D));
- final int j2 = MathHelper.floor_double(d8 + (d10 / 2.0D));
+ for (int l = 0; l <= this.numberOfBlocks; ++l) {
+ final double d6 = d0 + (((d1 - d0) * l) / this.numberOfBlocks);
+ final double d7 = d4 + (((d5 - d4) * l) / this.numberOfBlocks);
+ final double d8 = d2 + (((d3 - d2) * l) / this.numberOfBlocks);
+ final double d9 = (rand.nextDouble() * this.numberOfBlocks) / 8.0D;
+ final double d10 = ((MathHelper.sin((l * PI) / this.numberOfBlocks) + 1.0F) * d9) + 1.0D;
+ final double d11 = ((MathHelper.sin((l * PI) / this.numberOfBlocks) + 1.0F) * d9) + 1.0D;
+ final int i1 = MathHelper.floor_double(d6 - (d10 / 2.0D));
+ final int j1 = MathHelper.floor_double(d7 - (d11 / 2.0D));
+ final int k1 = MathHelper.floor_double(d8 - (d10 / 2.0D));
+ final int l1 = MathHelper.floor_double(d6 + (d10 / 2.0D));
+ final int i2 = MathHelper.floor_double(d7 + (d11 / 2.0D));
+ final int j2 = MathHelper.floor_double(d8 + (d10 / 2.0D));
- for (int k2 = i1; k2 <= l1; ++k2){
- final double d12 = ((k2 + 0.5D) - d6) / (d10 / 2.0D);
- if ((d12 * d12) < 1.0D){
- for (int l2 = j1; l2 <= i2; ++l2){
- final double d13 = ((l2 + 0.5D) - d7) / (d11 / 2.0D);
- if (((d12 * d12) + (d13 * d13)) < 1.0D){
- for (int i3 = k1; i3 <= j2; ++i3){
- final double d14 = ((i3 + 0.5D) - d8) / (d10 / 2.0D);
- if ((((d12 * d12) + (d13 * d13) + (d14 * d14)) < 1.0D) && world.getBlock(k2, l2, i3).isReplaceableOreGen(world, k2, l2, i3, this.blockToReplace))
- {
- world.setBlock(k2, l2, i3, this.oreToGenerate, this.mineableBlockMeta, 3);
- Logger.INFO("Generated a "+this.oreToGenerate.getLocalizedName()+" at x: "+k2+" | y: "+l2+" | z: "+i3);
- }
- }
- }
- }
- }
- }
- }
+ for (int k2 = i1; k2 <= l1; ++k2) {
+ final double d12 = ((k2 + 0.5D) - d6) / (d10 / 2.0D);
+ if ((d12 * d12) < 1.0D) {
+ for (int l2 = j1; l2 <= i2; ++l2) {
+ final double d13 = ((l2 + 0.5D) - d7) / (d11 / 2.0D);
+ if (((d12 * d12) + (d13 * d13)) < 1.0D) {
+ for (int i3 = k1; i3 <= j2; ++i3) {
+ final double d14 = ((i3 + 0.5D) - d8) / (d10 / 2.0D);
+ if ((((d12 * d12) + (d13 * d13) + (d14 * d14)) < 1.0D)
+ && world.getBlock(k2, l2, i3)
+ .isReplaceableOreGen(world, k2, l2, i3, this.blockToReplace)) {
+ world.setBlock(k2, l2, i3, this.oreToGenerate, this.mineableBlockMeta, 3);
+ Logger.INFO("Generated a " + this.oreToGenerate.getLocalizedName() + " at x: " + k2
+ + " | y: " + l2 + " | z: " + i3);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
- return true;
- }
-} \ No newline at end of file
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT.java b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT.java
index 2035cfe096..ae60ca1b4e 100644
--- a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT.java
+++ b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT.java
@@ -1,49 +1,60 @@
package gtPlusPlus.everglades.gen.gt;
+import gtPlusPlus.xmod.gregtech.HANDLER_GT;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
-
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
-import gtPlusPlus.xmod.gregtech.HANDLER_GT;
-
public abstract class WorldGen_GT {
- public final String mWorldGenName;
- public final boolean mEnabled;
- private final Map<String, Boolean> mDimensionMap = new ConcurrentHashMap<String, Boolean>();
-
- public WorldGen_GT(String aName, List aList, boolean aDefault) {
- this.mWorldGenName = aName;
- this.mEnabled = HANDLER_GT.sCustomWorldgenFile.get("worldgen", this.mWorldGenName, aDefault);
- if (this.mEnabled) {
- aList.add(this);
- }
-
- }
-
- public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX,
- int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
- return false;
- }
-
- 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 = (Boolean) this.mDimensionMap.get(aDimName);
- if (tAllowed == null) {
- boolean tValue = HANDLER_GT.sCustomWorldgenFile.get("worldgen.dimensions." + this.mWorldGenName, aDimName,
- aDimensionType == aAllowedDimensionType);
- this.mDimensionMap.put(aDimName, Boolean.valueOf(tValue));
- return tValue;
- } else {
- return tAllowed.booleanValue();
- }
- }
-} \ No newline at end of file
+ public final String mWorldGenName;
+ public final boolean mEnabled;
+ private final Map<String, Boolean> mDimensionMap = new ConcurrentHashMap<String, Boolean>();
+
+ public WorldGen_GT(String aName, List aList, boolean aDefault) {
+ this.mWorldGenName = aName;
+ this.mEnabled = HANDLER_GT.sCustomWorldgenFile.get("worldgen", this.mWorldGenName, aDefault);
+ if (this.mEnabled) {
+ aList.add(this);
+ }
+ }
+
+ public boolean executeWorldgen(
+ World aWorld,
+ Random aRandom,
+ String aBiome,
+ int aDimensionType,
+ int aChunkX,
+ int aChunkZ,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider) {
+ return false;
+ }
+
+ 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 = (Boolean) this.mDimensionMap.get(aDimName);
+ if (tAllowed == null) {
+ boolean tValue = HANDLER_GT.sCustomWorldgenFile.get(
+ "worldgen.dimensions." + this.mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType);
+ this.mDimensionMap.put(aDimName, Boolean.valueOf(tValue));
+ return tValue;
+ } else {
+ return tAllowed.booleanValue();
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java
index f1d62cf58e..cbf07372fc 100644
--- a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java
+++ b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java
@@ -1,471 +1,538 @@
package gtPlusPlus.everglades.gen.gt;
-import java.util.*;
-
import cpw.mods.fml.common.IWorldGenerator;
-
-import net.minecraft.block.Block;
-import net.minecraft.world.World;
-import net.minecraft.world.chunk.Chunk;
-import net.minecraft.world.chunk.IChunkProvider;
-import net.minecraft.world.gen.feature.WorldGenMinable;
-
import gregtech.api.util.GT_Log;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import gtPlusPlus.xmod.gregtech.HANDLER_GT;
+import java.util.*;
+import net.minecraft.block.Block;
+import net.minecraft.world.World;
+import net.minecraft.world.chunk.Chunk;
+import net.minecraft.world.chunk.IChunkProvider;
+import net.minecraft.world.gen.feature.WorldGenMinable;
public class WorldGen_GT_Base implements IWorldGenerator {
- /**
- * Class Variables
- */
-
- /**
- * Control percentage of filled 3x3 chunks. Lower number means less oreveins
- * spawn
- */
- public static int oreveinPercentage;
- /**
- * Control number of attempts to find a valid orevein. Generally this
- * maximum limit isn't hit, selecting a vein is cheap
- */
- public static int oreveinAttempts;
- /**
- * Control number of attempts to place a valid orevein. If a vein wasn't
- * placed due to height restrictions, completely in the water, etc, another
- * attempt is tried.
- */
- public static int oreveinMaxPlacementAttempts;
- /**
- * Debug parameter for world generation. Tracks chunks added/removed from
- * run queue.
- */
- public static boolean debugWorldGen = false;
- /**
- * Try re-implement Richard Hendrick's Chunk by Chunk Ore Generation from
- * his GT5u fork.
- */
-
- public static List<Runnable> mList = new ArrayList<Runnable>();
- public static HashSet<Long> ProcChunks = new HashSet<Long>();
- // This is probably not going to work. Trying to create a fake orevein to
- // put into hashtable when there will be no ores in a vein.
- public static WorldGen_GT_Ore_Layer noOresInVein = new WorldGen_GT_Ore_Layer("vein0", 0, 255, 0, 0,
- 0, ELEMENT.getInstance().IRON, ELEMENT.getInstance().IRON, ELEMENT.getInstance().IRON, ELEMENT.getInstance().IRON);
-
- public static Hashtable<Long, WorldGen_GT_Ore_Layer> validOreveins = new Hashtable<Long, WorldGen_GT_Ore_Layer>(
- 1024);
-
- public boolean mIsGenerating = false;
- public static final Object listLock = new Object();
- // private static boolean gcAsteroids = true;
-
- public WorldGen_GT_Base() {
- if (debugWorldGen) {
- GT_Log.out.println("GTPP_Worldgenerator created");
- }
- }
-
- @Override
- public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
- IChunkProvider chunkProvider) {
- if (world.provider.dimensionId == Dimension_Everglades.DIMID) {
- generateSafely(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
- }
- }
-
- public synchronized void generateSafely(Random random, int chunkX, int chunkZ, World world,
- IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
- int xDim = Dimension_Everglades.DIMID;
- switch (world.provider.dimensionId) {
- case -1: // Nether
- // generateNether(world, random, chunkX * 16, chunkZ * 16);
- break;
- case 0: // Overworld
- // generateSurface(world, random, chunkX * 16, chunkZ * 16);
- break;
- case 1: // End
- // generateEnd(world, random, chunkX * 16, chunkZ * 16);
- break;
- default: // Any other dimension
- if (world.provider.dimensionId != xDim) {
- break;
- }
- else {
- generateEverglades(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
- break;
- }
- }
- }
-
- private synchronized void generateEverglades(Random aRandom, int aX, int aZ, World aWorld,
- IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
- Logger.WORLD("Trying to Generate Dimension.");
- synchronized (listLock) {
- Logger.WORLD("Locked List addition.");
- if (WorldGen_GT_Base.mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) + 1), aX, aZ,
- Dimension_Everglades.DIMID,
- aWorld, aChunkGenerator, aChunkProvider,
- aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName))){
- Logger.WORLD("Locked List addition. Success.");
- }
- else {
- Logger.WORLD("Locked List addition. Fail.");
- }
- if (debugWorldGen)
- GT_Log.out.println("ADD WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId
- + " chunk x:" + aX + " z:" + aZ + " SIZE: " + WorldGen_GT_Base.mList.size());
- }
-
- if (!this.mIsGenerating) {
- Logger.WORLD("Is not generating.");
- this.mIsGenerating = true;
- Logger.WORLD("Setting Generation to true.");
- int mList_sS = WorldGen_GT_Base.mList.size();
- mList_sS = Math.min(mList_sS, 3); // Run a maximum of 3 chunks at a
- // time through worldgen. Extra
- // chunks get done later.
- for (int i = 0; i < mList_sS; i++) {
- WorldGenContainer toRun = (WorldGenContainer) WorldGen_GT_Base.mList.get(0);
- if (debugWorldGen)
- GT_Log.out.println("RUN WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId
- + " chunk x:" + toRun.mX + " z:" + toRun.mZ + " SIZE: " + WorldGen_GT_Base.mList.size()
- + " i: " + i);
- synchronized (listLock) {
- Logger.WORLD("Locked List Removal.");
- WorldGen_GT_Base.mList.remove(0);
- }
- toRun.run();
- }
- this.mIsGenerating = false;
- Logger.WORLD("Is Generating now set to false..");
- }
- }
-
- public void generateOre(Block block, World world, Random random, int chunk_x, int chunk_z, int maxX, int maxZ,
- int maxVeinSize, int chancesToSpawn, int minY, int maxY, Block generateIn) {
- int heightRange = maxY - minY;
- WorldGenMinable worldgenminable = new WorldGenMinable(block, maxVeinSize, generateIn);
- for (int k1 = 0; k1 < chancesToSpawn; ++k1) {
- int xrand = random.nextInt(16);
- int yrand = random.nextInt(heightRange) + minY;
- int zrand = random.nextInt(16);
- worldgenminable.generate(world, random, chunk_x + xrand, yrand, chunk_z + zrand);
- }
- }
-
- public static class WorldGenContainer implements Runnable {
- public final Random mRandom;
- public final int mX;
- public final int mZ;
- public final int mDimensionType;
- public final World mWorld;
- public final IChunkProvider mChunkGenerator;
- public final IChunkProvider mChunkProvider;
- public final String mBiome;
-
- // Local class to track which orevein seeds must be checked when doing
- // chunkified worldgen
- class NearbySeeds {
- public int mX;
- public int mZ;
-
- NearbySeeds(int x, int z) {
- this.mX = x;
- this.mZ = z;
- }
- };
-
- public static ArrayList<NearbySeeds> seedList = new ArrayList<NearbySeeds>();
-
- // aX and aZ are now the by-chunk X and Z for the chunk of interest
- public WorldGenContainer(Random aRandom, int aX, int aZ, int aDimensionType, World aWorld,
- IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider, String aBiome) {
- this.mRandom = aRandom;
- this.mX = aX;
- this.mZ = aZ;
- this.mDimensionType = aDimensionType;
- this.mWorld = aWorld;
- this.mChunkGenerator = aChunkGenerator;
- this.mChunkProvider = aChunkProvider;
- this.mBiome = aBiome;
- }
-
- public void worldGenFindVein(int oreseedX, int oreseedZ) {
- // Explanation of oreveinseed implementation.
- // (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen
- // passes, one with getSeed set to +1 the original world seed. This
- // pushes that +1 off the low bits of oreseedZ, so that the hashes
- // are far apart for the two passes.
- // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the
- // dimension in the top bits of the hash, to make sure to get unique
- // hashes per dimension
- // ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in
- // the bits 29-55. Cuts off the top few bits of the chunk so we have
- // bits for dimension.
- // ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the
- // bits 0-27. Cuts off the top few bits of the chunk so we have bits
- // for dimension.
- long oreveinSeed = (this.mWorld.getSeed() << 16) ^ ((this.mWorld.provider.dimensionId & 0xffL) << 56
- | ((oreseedX & 0x000000000fffffffL) << 28) | (oreseedZ & 0x000000000fffffffL)); // Use
- // an
- // RNG
- // that
- // is
- // identical
- // every
- // time
- // it
- // is
- // called
- // for
- // this
- // oreseed.
- XSTR oreveinRNG = new XSTR(oreveinSeed);
- int oreveinPercentageRoll = oreveinRNG.nextInt(100); // Roll the
- // dice, see
- // if we get
- // an
- // orevein
- // here at
- // all
- int noOrePlacedCount = 0;
- String tDimensionName = "";
- if (debugWorldGen) {
- tDimensionName = this.mWorld.provider.getDimensionName();
- }
-
- if (debugWorldGen){
- GT_Log.out.println(" Finding oreveins for oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ="
- + this.mZ + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " worldSeed="
- + this.mWorld.getSeed());
- }
-
- Logger.INFO("[World Generation Debug] !validOreveins.containsKey(oreveinSeed) | oreveinSeed: "+oreveinSeed);
- // Search for a valid orevein for this dimension
- if (!validOreveins.containsKey(oreveinSeed)) {
-
-
- Logger.INFO("[World Generation Debug] oreveinPercentageRoll < oreveinPercentage? "+((oreveinPercentageRoll < oreveinPercentage)));
- Logger.INFO("[World Generation Debug] WorldGen_GT_Ore_Layer.sWeight > 0? "+(WorldGen_GT_Ore_Layer.sWeight > 0));
- Logger.INFO("[World Generation Debug] WorldGen_GT_Ore_Layer.sList.size() > 0? "+(WorldGen_GT_Ore_Layer.sList.size() > 0));
- if ((oreveinPercentageRoll < oreveinPercentage) && (WorldGen_GT_Ore_Layer.sWeight > 0)
- && (WorldGen_GT_Ore_Layer.sList.size() > 0)) {
- int placementAttempts = 0;
- boolean oreveinFound = false;
- int i;
- for (i = 0; (i < oreveinAttempts) && (!oreveinFound)
- && (placementAttempts < oreveinMaxPlacementAttempts); i++) {
- Logger.INFO("[World Generation Debug] i: "+i);
- Logger.INFO("[World Generation Debug] placementAttempts: "+placementAttempts);
- Logger.INFO("[World Generation Debug] oreveinAttempts: "+oreveinAttempts);
- Logger.INFO("[World Generation Debug] (placementAttempts < oreveinMaxPlacementAttempts): "+(placementAttempts < oreveinMaxPlacementAttempts));
- Logger.INFO("[World Generation Debug] oreveinFound: "+oreveinFound);
- int tRandomWeight = oreveinRNG.nextInt(WorldGen_GT_Ore_Layer.sWeight);
- for (WorldGen_GT_Ore_Layer tWorldGen : WorldGen_GT_Ore_Layer.sList) {
- Logger.INFO("[World Generation Debug] Iterating sList - Size: "+WorldGen_GT_Ore_Layer.sList.size());
- tRandomWeight -= (tWorldGen).mWeight;
- if (tRandomWeight <= 0) {
- try {
- // Adjust the seed so that this layer has a
- // series of unique random numbers.
- // Otherwise multiple attempts at this same
- // oreseed will get the same offset and X/Z
- // values. If an orevein failed, any orevein
- // with the
- // same minimum heights would fail as well.
- // This prevents that, giving each orevein a
- // unique height each pass through here.
- int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld,
- new XSTR(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))), this.mBiome,
- this.mDimensionType, this.mX * 16, this.mZ * 16, oreseedX * 16,
- oreseedZ * 16, this.mChunkGenerator, this.mChunkProvider);
- switch (placementResult) {
- case WorldGen_GT_Ore_Layer.ORE_PLACED:
- if (debugWorldGen)
- GT_Log.out.println(" Added oreveinSeed=" + oreveinSeed
- + " tries at oremix=" + i + " placementAttempts="
- + placementAttempts + " dimensionName=" + tDimensionName);
- validOreveins.put(oreveinSeed, tWorldGen);
- oreveinFound = true;
- Logger.INFO("[World Generation Debug] ORE_PLACED");
- break;
- case WorldGen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
- placementAttempts++;
- Logger.INFO("[World Generation Debug] NO_ORE_IN_BOTTOM_LAYER | Attempts: "+placementAttempts);
- // SHould do retry in this case
- // until out of chances
- break;
- case WorldGen_GT_Ore_Layer.NO_OVERLAP:
- // Orevein didn't reach this chunk,
- // can't add it yet to the hash
- Logger.INFO("[World Generation Debug] NO_OVERLAP");
- if (debugWorldGen) GT_Log.out.println(
- " Added far oreveinSeed=" + oreveinSeed + " " +
- ( tWorldGen).mWorldGenName +
- " tries at oremix=" + i +
- " placementAttempts=" + placementAttempts +
- " dimensionName=" + tDimensionName
- );
- validOreveins.put(oreveinSeed, tWorldGen);
- oreveinFound = true;
- break;
- case WorldGen_GT_Ore_Layer.NO_OVERLAP_AIR_BLOCK:
- if (debugWorldGen) GT_Log.out.println(
- " No overlap and air block in test spot=" + oreveinSeed + " " +
- ( tWorldGen).mWorldGenName +
- " tries at oremix=" + i +
- " placementAttempts=" + placementAttempts +
- " dimensionName=" + tDimensionName
- );
- // SHould do retry in this case until out of chances
- Logger.INFO("[World Generation Debug] NO_OVERLAP_AIR_BLOCK");
- placementAttempts++;
- break;
- }
- break; // Try the next orevein
- }
- catch (Throwable e) {
- if (debugWorldGen)
- GT_Log.out.println("Exception occurred on oreVein" + tWorldGen + " oreveinSeed="
- + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ + " oreseedX="
- + oreseedX + " oreseedZ=" + oreseedZ);
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- // Only add an empty orevein if are unable to place a vein
- // at the oreseed chunk.
- if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)) {
- if (debugWorldGen)
- GT_Log.out.println(" Empty oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ
- + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " tries at oremix=" + i
- + " placementAttempts=" + placementAttempts + " dimensionName=" + tDimensionName);
- validOreveins.put(oreveinSeed, noOresInVein);
- }
- }
- else if (oreveinPercentageRoll >= oreveinPercentage) {
- if (debugWorldGen)
- GT_Log.out.println(" Skipped oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ
- + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " RNG=" + oreveinPercentageRoll
- + " %=" + oreveinPercentage + " dimensionName=" + tDimensionName);
- validOreveins.put(oreveinSeed, noOresInVein);
- }
- }
- else {
- // oreseed is located in the previously processed table
- if (debugWorldGen)
- GT_Log.out.print(" Valid oreveinSeed=" + oreveinSeed + " validOreveins.size()="
- + validOreveins.size() + " ");
- WorldGen_GT_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed);
- oreveinRNG.setSeed(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))); // Reset
- // RNG
- // to
- // only
- // be
- // based
- // on
- // oreseed
- // X/Z
- // and
- // type
- // of
- // vein
- int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, oreveinRNG, this.mBiome,
- this.mDimensionType, this.mX * 16, this.mZ * 16, oreseedX * 16, oreseedZ * 16,
- this.mChunkGenerator, this.mChunkProvider);
- switch (placementResult) {
- case WorldGen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
- if (debugWorldGen)
- GT_Log.out.println(" No ore in bottom layer");
- break;
- case WorldGen_GT_Ore_Layer.NO_OVERLAP:
- if (debugWorldGen)
- GT_Log.out.println(" No overlap");
- break;
- }
- }
- }
-
- @Override
- public void run() {
- long startTime = System.nanoTime();
- int oreveinMaxSize;
-
- // Determine bounding box on how far out to check for oreveins
- // affecting this chunk
- // For now, manually reducing oreveinMaxSize when not in the
- // Underdark for performance
- if (this.mWorld.provider.getDimensionName().equals("Underdark")) {
- oreveinMaxSize = 24; // Leave Deep Dark/Underdark max oregen at
- // 32, instead of 64
- }
- else {
- oreveinMaxSize = 48;
- }
-
- int wXbox = this.mX - (oreveinMaxSize / 16);
- int eXbox = this.mX + (oreveinMaxSize / 16 + 1); // Need to add 1
- // since it is
- // compared
- // using a <
- int nZbox = this.mZ - (oreveinMaxSize / 16);
- int sZbox = this.mZ + (oreveinMaxSize / 16 + 1);
-
- // Search for orevein seeds and add to the list;
- for (int x = wXbox; x < eXbox; x++) {
- for (int z = nZbox; z < sZbox; z++) {
- // Determine if this X/Z is an orevein seed
- if (((Math.abs(x) % 3) == 1) && ((Math.abs(z) % 3) == 1)) {
- if (debugWorldGen)
- GT_Log.out.println("Adding seed x=" + x + " z=" + z);
- seedList.add(new NearbySeeds(x, z));
- }
- }
- }
-
- // Now process each oreseed vs this requested chunk
- for (; seedList.size() != 0; seedList.remove(0)) {
- if (debugWorldGen)
- GT_Log.out.println("Processing seed x=" + seedList.get(0).mX + " z=" + seedList.get(0).mZ);
- worldGenFindVein(seedList.get(0).mX, seedList.get(0).mZ);
- }
-
- long oregenTime = System.nanoTime();
-
- // Do leftover worldgen for this chunk (GT_Stones and GT_small_ores)
- try {
- for (WorldGen_GT tWorldGen : HANDLER_GT.sWorldgenListEverglades) {
- /*
- * if (debugWorldGen) GT_Log.out.println(
- * "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName );
- */
- tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, this.mX * 16,
- this.mZ * 16, this.mChunkGenerator, this.mChunkProvider);
- }
- }
- catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
-
- long leftOverTime = System.nanoTime();
-
- Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ);
- if (tChunk != null) {
- tChunk.isModified = true;
- }
- long endTime = System.nanoTime();
- long duration = (endTime - startTime);
- if (debugWorldGen) {
- GT_Log.out.println(" Oregen took " + (oregenTime - startTime) + " Leftover gen took "
- + (leftOverTime - oregenTime) + " Worldgen took " + duration + " nanoseconds");
- }
- }
- }
-
+ /**
+ * Class Variables
+ */
+
+ /**
+ * Control percentage of filled 3x3 chunks. Lower number means less oreveins
+ * spawn
+ */
+ public static int oreveinPercentage;
+ /**
+ * Control number of attempts to find a valid orevein. Generally this
+ * maximum limit isn't hit, selecting a vein is cheap
+ */
+ public static int oreveinAttempts;
+ /**
+ * Control number of attempts to place a valid orevein. If a vein wasn't
+ * placed due to height restrictions, completely in the water, etc, another
+ * attempt is tried.
+ */
+ public static int oreveinMaxPlacementAttempts;
+ /**
+ * Debug parameter for world generation. Tracks chunks added/removed from
+ * run queue.
+ */
+ public static boolean debugWorldGen = false;
+ /**
+ * Try re-implement Richard Hendrick's Chunk by Chunk Ore Generation from
+ * his GT5u fork.
+ */
+ public static List<Runnable> mList = new ArrayList<Runnable>();
+
+ public static HashSet<Long> ProcChunks = new HashSet<Long>();
+ // This is probably not going to work. Trying to create a fake orevein to
+ // put into hashtable when there will be no ores in a vein.
+ public static WorldGen_GT_Ore_Layer noOresInVein = new WorldGen_GT_Ore_Layer(
+ "vein0",
+ 0,
+ 255,
+ 0,
+ 0,
+ 0,
+ ELEMENT.getInstance().IRON,
+ ELEMENT.getInstance().IRON,
+ ELEMENT.getInstance().IRON,
+ ELEMENT.getInstance().IRON);
+
+ public static Hashtable<Long, WorldGen_GT_Ore_Layer> validOreveins =
+ new Hashtable<Long, WorldGen_GT_Ore_Layer>(1024);
+
+ public boolean mIsGenerating = false;
+ public static final Object listLock = new Object();
+ // private static boolean gcAsteroids = true;
+
+ public WorldGen_GT_Base() {
+ if (debugWorldGen) {
+ GT_Log.out.println("GTPP_Worldgenerator created");
+ }
+ }
+
+ @Override
+ public void generate(
+ Random random,
+ int chunkX,
+ int chunkZ,
+ World world,
+ IChunkProvider chunkGenerator,
+ IChunkProvider chunkProvider) {
+ if (world.provider.dimensionId == Dimension_Everglades.DIMID) {
+ generateSafely(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
+ }
+ }
+
+ public synchronized void generateSafely(
+ Random random,
+ int chunkX,
+ int chunkZ,
+ World world,
+ IChunkProvider chunkGenerator,
+ IChunkProvider chunkProvider) {
+ int xDim = Dimension_Everglades.DIMID;
+ switch (world.provider.dimensionId) {
+ case -1: // Nether
+ // generateNether(world, random, chunkX * 16, chunkZ * 16);
+ break;
+ case 0: // Overworld
+ // generateSurface(world, random, chunkX * 16, chunkZ * 16);
+ break;
+ case 1: // End
+ // generateEnd(world, random, chunkX * 16, chunkZ * 16);
+ break;
+ default: // Any other dimension
+ if (world.provider.dimensionId != xDim) {
+ break;
+ } else {
+ generateEverglades(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
+ break;
+ }
+ }
+ }
+
+ private synchronized void generateEverglades(
+ Random aRandom,
+ int aX,
+ int aZ,
+ World aWorld,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider) {
+ Logger.WORLD("Trying to Generate Dimension.");
+ synchronized (listLock) {
+ Logger.WORLD("Locked List addition.");
+ if (WorldGen_GT_Base.mList.add(new WorldGenContainer(
+ new XSTR(Math.abs(aRandom.nextInt()) + 1),
+ aX,
+ aZ,
+ Dimension_Everglades.DIMID,
+ aWorld,
+ aChunkGenerator,
+ aChunkProvider,
+ aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName))) {
+ Logger.WORLD("Locked List addition. Success.");
+ } else {
+ Logger.WORLD("Locked List addition. Fail.");
+ }
+ if (debugWorldGen)
+ GT_Log.out.println("ADD WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId
+ + " chunk x:" + aX + " z:" + aZ + " SIZE: " + WorldGen_GT_Base.mList.size());
+ }
+
+ if (!this.mIsGenerating) {
+ Logger.WORLD("Is not generating.");
+ this.mIsGenerating = true;
+ Logger.WORLD("Setting Generation to true.");
+ int mList_sS = WorldGen_GT_Base.mList.size();
+ mList_sS = Math.min(mList_sS, 3); // Run a maximum of 3 chunks at a
+ // time through worldgen. Extra
+ // chunks get done later.
+ for (int i = 0; i < mList_sS; i++) {
+ WorldGenContainer toRun = (WorldGenContainer) WorldGen_GT_Base.mList.get(0);
+ if (debugWorldGen)
+ GT_Log.out.println("RUN WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId
+ + " chunk x:" + toRun.mX + " z:" + toRun.mZ + " SIZE: " + WorldGen_GT_Base.mList.size()
+ + " i: " + i);
+ synchronized (listLock) {
+ Logger.WORLD("Locked List Removal.");
+ WorldGen_GT_Base.mList.remove(0);
+ }
+ toRun.run();
+ }
+ this.mIsGenerating = false;
+ Logger.WORLD("Is Generating now set to false..");
+ }
+ }
+
+ public void generateOre(
+ Block block,
+ World world,
+ Random random,
+ int chunk_x,
+ int chunk_z,
+ int maxX,
+ int maxZ,
+ int maxVeinSize,
+ int chancesToSpawn,
+ int minY,
+ int maxY,
+ Block generateIn) {
+ int heightRange = maxY - minY;
+ WorldGenMinable worldgenminable = new WorldGenMinable(block, maxVeinSize, generateIn);
+ for (int k1 = 0; k1 < chancesToSpawn; ++k1) {
+ int xrand = random.nextInt(16);
+ int yrand = random.nextInt(heightRange) + minY;
+ int zrand = random.nextInt(16);
+ worldgenminable.generate(world, random, chunk_x + xrand, yrand, chunk_z + zrand);
+ }
+ }
+
+ public static class WorldGenContainer implements Runnable {
+ public final Random mRandom;
+ public final int mX;
+ public final int mZ;
+ public final int mDimensionType;
+ public final World mWorld;
+ public final IChunkProvider mChunkGenerator;
+ public final IChunkProvider mChunkProvider;
+ public final String mBiome;
+
+ // Local class to track which orevein seeds must be checked when doing
+ // chunkified worldgen
+ class NearbySeeds {
+ public int mX;
+ public int mZ;
+
+ NearbySeeds(int x, int z) {
+ this.mX = x;
+ this.mZ = z;
+ }
+ }
+ ;
+
+ public static ArrayList<NearbySeeds> seedList = new ArrayList<NearbySeeds>();
+
+ // aX and aZ are now the by-chunk X and Z for the chunk of interest
+ public WorldGenContainer(
+ Random aRandom,
+ int aX,
+ int aZ,
+ int aDimensionType,
+ World aWorld,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider,
+ String aBiome) {
+ this.mRandom = aRandom;
+ this.mX = aX;
+ this.mZ = aZ;
+ this.mDimensionType = aDimensionType;
+ this.mWorld = aWorld;
+ this.mChunkGenerator = aChunkGenerator;
+ this.mChunkProvider = aChunkProvider;
+ this.mBiome = aBiome;
+ }
+
+ public void worldGenFindVein(int oreseedX, int oreseedZ) {
+ // Explanation of oreveinseed implementation.
+ // (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen
+ // passes, one with getSeed set to +1 the original world seed. This
+ // pushes that +1 off the low bits of oreseedZ, so that the hashes
+ // are far apart for the two passes.
+ // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the
+ // dimension in the top bits of the hash, to make sure to get unique
+ // hashes per dimension
+ // ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in
+ // the bits 29-55. Cuts off the top few bits of the chunk so we have
+ // bits for dimension.
+ // ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the
+ // bits 0-27. Cuts off the top few bits of the chunk so we have bits
+ // for dimension.
+ long oreveinSeed = (this.mWorld.getSeed() << 16)
+ ^ ((this.mWorld.provider.dimensionId & 0xffL) << 56
+ | ((oreseedX & 0x000000000fffffffL) << 28)
+ | (oreseedZ & 0x000000000fffffffL)); // Use
+ // an
+ // RNG
+ // that
+ // is
+ // identical
+ // every
+ // time
+ // it
+ // is
+ // called
+ // for
+ // this
+ // oreseed.
+ XSTR oreveinRNG = new XSTR(oreveinSeed);
+ int oreveinPercentageRoll = oreveinRNG.nextInt(100); // Roll the
+ // dice, see
+ // if we get
+ // an
+ // orevein
+ // here at
+ // all
+ int noOrePlacedCount = 0;
+ String tDimensionName = "";
+ if (debugWorldGen) {
+ tDimensionName = this.mWorld.provider.getDimensionName();
+ }
+
+ if (debugWorldGen) {
+ GT_Log.out.println(" Finding oreveins for oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ="
+ + this.mZ + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " worldSeed="
+ + this.mWorld.getSeed());
+ }
+
+ Logger.INFO(
+ "[World Generation Debug] !validOreveins.containsKey(oreveinSeed) | oreveinSeed: " + oreveinSeed);
+ // Search for a valid orevein for this dimension
+ if (!validOreveins.containsKey(oreveinSeed)) {
+
+ Logger.INFO("[World Generation Debug] oreveinPercentageRoll < oreveinPercentage? "
+ + ((oreveinPercentageRoll < oreveinPercentage)));
+ Logger.INFO("[World Generation Debug] WorldGen_GT_Ore_Layer.sWeight > 0? "
+ + (WorldGen_GT_Ore_Layer.sWeight > 0));
+ Logger.INFO("[World Generation Debug] WorldGen_GT_Ore_Layer.sList.size() > 0? "
+ + (WorldGen_GT_Ore_Layer.sList.size() > 0));
+ if ((oreveinPercentageRoll < oreveinPercentage)
+ && (WorldGen_GT_Ore_Layer.sWeight > 0)
+ && (WorldGen_GT_Ore_Layer.sList.size() > 0)) {
+ int placementAttempts = 0;
+ boolean oreveinFound = false;
+ int i;
+ for (i = 0;
+ (i < oreveinAttempts)
+ && (!oreveinFound)
+ && (placementAttempts < oreveinMaxPlacementAttempts);
+ i++) {
+ Logger.INFO("[World Generation Debug] i: " + i);
+ Logger.INFO("[World Generation Debug] placementAttempts: " + placementAttempts);
+ Logger.INFO("[World Generation Debug] oreveinAttempts: " + oreveinAttempts);
+ Logger.INFO("[World Generation Debug] (placementAttempts < oreveinMaxPlacementAttempts): "
+ + (placementAttempts < oreveinMaxPlacementAttempts));
+ Logger.INFO("[World Generation Debug] oreveinFound: " + oreveinFound);
+ int tRandomWeight = oreveinRNG.nextInt(WorldGen_GT_Ore_Layer.sWeight);
+ for (WorldGen_GT_Ore_Layer tWorldGen : WorldGen_GT_Ore_Layer.sList) {
+ Logger.INFO("[World Generation Debug] Iterating sList - Size: "
+ + WorldGen_GT_Ore_Layer.sList.size());
+ tRandomWeight -= (tWorldGen).mWeight;
+ if (tRandomWeight <= 0) {
+ try {
+ // Adjust the seed so that this layer has a
+ // series of unique random numbers.
+ // Otherwise multiple attempts at this same
+ // oreseed will get the same offset and X/Z
+ // values. If an orevein failed, any orevein
+ // with the
+ // same minimum heights would fail as well.
+ // This prevents that, giving each orevein a
+ // unique height each pass through here.
+ int placementResult = tWorldGen.executeWorldgenChunkified(
+ this.mWorld,
+ new XSTR(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))),
+ this.mBiome,
+ this.mDimensionType,
+ this.mX * 16,
+ this.mZ * 16,
+ oreseedX * 16,
+ oreseedZ * 16,
+ this.mChunkGenerator,
+ this.mChunkProvider);
+ switch (placementResult) {
+ case WorldGen_GT_Ore_Layer.ORE_PLACED:
+ if (debugWorldGen)
+ GT_Log.out.println(" Added oreveinSeed=" + oreveinSeed
+ + " tries at oremix=" + i + " placementAttempts="
+ + placementAttempts + " dimensionName=" + tDimensionName);
+ validOreveins.put(oreveinSeed, tWorldGen);
+ oreveinFound = true;
+ Logger.INFO("[World Generation Debug] ORE_PLACED");
+ break;
+ case WorldGen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
+ placementAttempts++;
+ Logger.INFO("[World Generation Debug] NO_ORE_IN_BOTTOM_LAYER | Attempts: "
+ + placementAttempts);
+ // SHould do retry in this case
+ // until out of chances
+ break;
+ case WorldGen_GT_Ore_Layer.NO_OVERLAP:
+ // Orevein didn't reach this chunk,
+ // can't add it yet to the hash
+ Logger.INFO("[World Generation Debug] NO_OVERLAP");
+ if (debugWorldGen)
+ GT_Log.out.println(" Added far oreveinSeed=" + oreveinSeed + " "
+ + (tWorldGen).mWorldGenName
+ + " tries at oremix="
+ + i + " placementAttempts="
+ + placementAttempts + " dimensionName="
+ + tDimensionName);
+ validOreveins.put(oreveinSeed, tWorldGen);
+ oreveinFound = true;
+ break;
+ case WorldGen_GT_Ore_Layer.NO_OVERLAP_AIR_BLOCK:
+ if (debugWorldGen)
+ GT_Log.out.println(" No overlap and air block in test spot="
+ + oreveinSeed + " " + (tWorldGen).mWorldGenName
+ + " tries at oremix="
+ + i + " placementAttempts="
+ + placementAttempts + " dimensionName="
+ + tDimensionName);
+ // SHould do retry in this case until out of chances
+ Logger.INFO("[World Generation Debug] NO_OVERLAP_AIR_BLOCK");
+ placementAttempts++;
+ break;
+ }
+ break; // Try the next orevein
+ } catch (Throwable e) {
+ if (debugWorldGen)
+ GT_Log.out.println("Exception occurred on oreVein" + tWorldGen + " oreveinSeed="
+ + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ + " oreseedX="
+ + oreseedX + " oreseedZ=" + oreseedZ);
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ }
+ // Only add an empty orevein if are unable to place a vein
+ // at the oreseed chunk.
+ if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)) {
+ if (debugWorldGen)
+ GT_Log.out.println(" Empty oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ
+ + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " tries at oremix=" + i
+ + " placementAttempts=" + placementAttempts + " dimensionName=" + tDimensionName);
+ validOreveins.put(oreveinSeed, noOresInVein);
+ }
+ } else if (oreveinPercentageRoll >= oreveinPercentage) {
+ if (debugWorldGen)
+ GT_Log.out.println(" Skipped oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ
+ + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " RNG=" + oreveinPercentageRoll
+ + " %=" + oreveinPercentage + " dimensionName=" + tDimensionName);
+ validOreveins.put(oreveinSeed, noOresInVein);
+ }
+ } else {
+ // oreseed is located in the previously processed table
+ if (debugWorldGen)
+ GT_Log.out.print(" Valid oreveinSeed=" + oreveinSeed + " validOreveins.size()="
+ + validOreveins.size() + " ");
+ WorldGen_GT_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed);
+ oreveinRNG.setSeed(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))); // Reset
+ // RNG
+ // to
+ // only
+ // be
+ // based
+ // on
+ // oreseed
+ // X/Z
+ // and
+ // type
+ // of
+ // vein
+ int placementResult = tWorldGen.executeWorldgenChunkified(
+ this.mWorld,
+ oreveinRNG,
+ this.mBiome,
+ this.mDimensionType,
+ this.mX * 16,
+ this.mZ * 16,
+ oreseedX * 16,
+ oreseedZ * 16,
+ this.mChunkGenerator,
+ this.mChunkProvider);
+ switch (placementResult) {
+ case WorldGen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
+ if (debugWorldGen) GT_Log.out.println(" No ore in bottom layer");
+ break;
+ case WorldGen_GT_Ore_Layer.NO_OVERLAP:
+ if (debugWorldGen) GT_Log.out.println(" No overlap");
+ break;
+ }
+ }
+ }
+
+ @Override
+ public void run() {
+ long startTime = System.nanoTime();
+ int oreveinMaxSize;
+
+ // Determine bounding box on how far out to check for oreveins
+ // affecting this chunk
+ // For now, manually reducing oreveinMaxSize when not in the
+ // Underdark for performance
+ if (this.mWorld.provider.getDimensionName().equals("Underdark")) {
+ oreveinMaxSize = 24; // Leave Deep Dark/Underdark max oregen at
+ // 32, instead of 64
+ } else {
+ oreveinMaxSize = 48;
+ }
+
+ int wXbox = this.mX - (oreveinMaxSize / 16);
+ int eXbox = this.mX + (oreveinMaxSize / 16 + 1); // Need to add 1
+ // since it is
+ // compared
+ // using a <
+ int nZbox = this.mZ - (oreveinMaxSize / 16);
+ int sZbox = this.mZ + (oreveinMaxSize / 16 + 1);
+
+ // Search for orevein seeds and add to the list;
+ for (int x = wXbox; x < eXbox; x++) {
+ for (int z = nZbox; z < sZbox; z++) {
+ // Determine if this X/Z is an orevein seed
+ if (((Math.abs(x) % 3) == 1) && ((Math.abs(z) % 3) == 1)) {
+ if (debugWorldGen) GT_Log.out.println("Adding seed x=" + x + " z=" + z);
+ seedList.add(new NearbySeeds(x, z));
+ }
+ }
+ }
+
+ // Now process each oreseed vs this requested chunk
+ for (; seedList.size() != 0; seedList.remove(0)) {
+ if (debugWorldGen)
+ GT_Log.out.println("Processing seed x=" + seedList.get(0).mX + " z=" + seedList.get(0).mZ);
+ worldGenFindVein(seedList.get(0).mX, seedList.get(0).mZ);
+ }
+
+ long oregenTime = System.nanoTime();
+
+ // Do leftover worldgen for this chunk (GT_Stones and GT_small_ores)
+ try {
+ for (WorldGen_GT tWorldGen : HANDLER_GT.sWorldgenListEverglades) {
+ /*
+ * if (debugWorldGen) GT_Log.out.println(
+ * "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName );
+ */
+ tWorldGen.executeWorldgen(
+ this.mWorld,
+ this.mRandom,
+ this.mBiome,
+ this.mDimensionType,
+ this.mX * 16,
+ this.mZ * 16,
+ this.mChunkGenerator,
+ this.mChunkProvider);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+
+ long leftOverTime = System.nanoTime();
+
+ Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ);
+ if (tChunk != null) {
+ tChunk.isModified = true;
+ }
+ long endTime = System.nanoTime();
+ long duration = (endTime - startTime);
+ if (debugWorldGen) {
+ GT_Log.out.println(" Oregen took " + (oregenTime - startTime) + " Leftover gen took "
+ + (leftOverTime - oregenTime) + " Worldgen took " + duration + " nanoseconds");
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java
index 140098ee06..ee4dc51461 100644
--- a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java
+++ b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java
@@ -2,23 +2,11 @@ package gtPlusPlus.everglades.gen.gt;
import static gtPlusPlus.everglades.gen.gt.WorldGen_GT_Base.debugWorldGen;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.*;
-
-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;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_Log;
import gregtech.common.blocks.GT_Block_Ores;
import gregtech.common.blocks.GT_TileEntity_Ores;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
@@ -26,489 +14,606 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import gtPlusPlus.xmod.gregtech.HANDLER_GT;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.*;
+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 WorldGen_GT_Ore_Layer
-extends WorldGen_GT {
- public static ArrayList<WorldGen_GT_Ore_Layer> sList = new ArrayList<WorldGen_GT_Ore_Layer>();
- public static int sWeight = 0;
- public final short mMinY;
- public final short mMaxY;
- public final short mWeight;
- public final short mDensity;
- public final short mSize;
- public Block mPrimaryMeta;
- public Block mSecondaryMeta;
- public Block mBetweenMeta;
- public Block mSporadicMeta;
- public final Material mPrimary;
- public final Material mSecondary;
- public final Material mBetween;
- public final Material mSporadic;
-
- public static boolean mUpdated = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK;
- public static final Block mStoneTypes;
-
- //public final String mBiome;
- public final String mRestrictBiome;
- public final boolean mOverworld;
- public final boolean mNether;
- public final boolean mEnd;
- public static final int WRONG_BIOME=0;
- public static final int WRONG_DIMENSION=1;
- public static final int NO_ORE_IN_BOTTOM_LAYER=2;
- public static final int NO_OVERLAP=3;
- public static final int ORE_PLACED=4;
- public static final int NO_OVERLAP_AIR_BLOCK=5;
-
- //public final boolean mMoon;
- //public final boolean mMars;
- //public final boolean mAsteroid;
- public final String aTextWorldgen = "worldgen.";
-
- static {
- if (mUpdated) {
- Object tempBlock = null;
- try {
- Field temp = ReflectionUtils.getField(GregTech_API.class, "sBlockStones");
- tempBlock = temp.get(null);
- }
- catch (IllegalArgumentException | IllegalAccessException e) {}
- mStoneTypes = (Block) tempBlock;
- }
- else {
- mStoneTypes = null;
- }
- }
-
-
- public WorldGen_GT_Ore_Layer(String aName, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) {
- this(aName, true, aMinY, aMaxY, aWeight, aDensity, aSize, false, false, false, false, false, false, aPrimary, aSecondary, aBetween, aSporadic);
- }
-
-
- public WorldGen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) {
- super(aName, sList, aDefault);
- Logger.WORLD("Creating Ore Layer Object");
- this.mOverworld = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
- this.mNether = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether);
- this.mEnd = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd);
- //this.mMoon = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon);
- //this.mMars = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars);
- //this.mAsteroid = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid);
- this.mMinY = 5;
- short mMaxY = 14;
- if (mMaxY < (this.mMinY + 7)) {
- GT_Log.out.println(
- "Oremix " + this.mWorldGenName +
- " has invalid Min/Max heights!"
- );
- mMaxY = (short) (this.mMinY + 7);
- }
- this.mMaxY = mMaxY;
- this.mWeight = ((short) HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
- this.mDensity = ((short) HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
- this.mSize = ((short) Math.max(1, HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
- this.mPrimary = aPrimary;
- this.mSecondary = aSecondary;
- this.mBetween = aBetween;
- this.mSporadic = aSporadic;
- this.mPrimaryMeta = aPrimary.getOreBlock(1);
- this.mSecondaryMeta = aSecondary.getOreBlock(1);
- this.mBetweenMeta = aBetween.getOreBlock(1);
- this.mSporadicMeta = aSporadic.getOreBlock(1);
- this.mRestrictBiome = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
-
- //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does not exist");
- //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist");
- //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist");
- //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist");
-
- if (this.mEnabled) {
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- sWeight += this.mWeight;
- }
- }
-
- public int executeWorldgenChunkified(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, int aSeedX, int aSeedZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
-
- //Debug Handler
- /**
- * This handles Variables that are null during Init
- */
-
- if (this.mPrimaryMeta == Blocks.stone || this.mSecondaryMeta == Blocks.stone
- || this.mBetweenMeta == Blocks.stone || this.mSporadicMeta == Blocks.stone){
- this.mPrimaryMeta = this.mPrimary.getOreBlock(1);
- this.mSecondaryMeta = this.mSecondary.getOreBlock(1);
- this.mBetweenMeta = this.mBetween.getOreBlock(1);
- this.mSporadicMeta = this.mSporadic.getOreBlock(1);
- Logger.WORLD("[Vein Generator] An Ore in a Vein had defaulted back to a default value, so they have now been reset to correct values.");
- }
-
- if( mWorldGenName.equals("vein0") ) {
- if (debugWorldGen) GT_Log.out.println(
- " NoOresInVein-vein0"
- );
- // This is a special empty orevein
- Logger.WORLD("[World Generation Debug] Special Empty Vein placed.");
- return ORE_PLACED;
- }
- if (aDimensionType != Dimension_Everglades.DIMID) {
- /* // Debug code, but spams log
- if (debugWorldGen) {
- GT_Log.out.println(
- "Wrong dimension"
- );
+public class WorldGen_GT_Ore_Layer extends WorldGen_GT {
+ public static ArrayList<WorldGen_GT_Ore_Layer> sList = new ArrayList<WorldGen_GT_Ore_Layer>();
+ public static int sWeight = 0;
+ public final short mMinY;
+ public final short mMaxY;
+ public final short mWeight;
+ public final short mDensity;
+ public final short mSize;
+ public Block mPrimaryMeta;
+ public Block mSecondaryMeta;
+ public Block mBetweenMeta;
+ public Block mSporadicMeta;
+ public final Material mPrimary;
+ public final Material mSecondary;
+ public final Material mBetween;
+ public final Material mSporadic;
+
+ public static boolean mUpdated = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK;
+ public static final Block mStoneTypes;
+
+ // public final String mBiome;
+ public final String mRestrictBiome;
+ public final boolean mOverworld;
+ public final boolean mNether;
+ public final boolean mEnd;
+ public static final int WRONG_BIOME = 0;
+ public static final int WRONG_DIMENSION = 1;
+ public static final int NO_ORE_IN_BOTTOM_LAYER = 2;
+ public static final int NO_OVERLAP = 3;
+ public static final int ORE_PLACED = 4;
+ public static final int NO_OVERLAP_AIR_BLOCK = 5;
+
+ // public final boolean mMoon;
+ // public final boolean mMars;
+ // public final boolean mAsteroid;
+ public final String aTextWorldgen = "worldgen.";
+
+ static {
+ if (mUpdated) {
+ Object tempBlock = null;
+ try {
+ Field temp = ReflectionUtils.getField(GregTech_API.class, "sBlockStones");
+ tempBlock = temp.get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
}
- */
- Logger.WORLD("[World Generation Debug] Wrong dimension.");
- return WRONG_DIMENSION;
- }
- if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
- return WRONG_BIOME;
- }
- int[] placeCount=new int[4];
-
- int tMinY = mMinY + aRandom.nextInt(mMaxY - mMinY - 5);
- // Determine West/East ends of orevein
- int wXVein = aSeedX - aRandom.nextInt(mSize); // West side
- int eXVein = aSeedX + 16 + aRandom.nextInt(mSize);
- // Limit Orevein to only blocks present in current chunk
- int wX = Math.max( wXVein, aChunkX + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
- int eX = Math.min( eXVein, aChunkX + 2 + 16);
- if (wX >= eX) { //No overlap between orevein and this chunk exists in X
- Block tBlock = aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8);
- if (tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Dimension_Everglades.blockSecondLayer) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Dimension_Everglades.blockMainFiller) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Dimension_Everglades.blockSecondaryFiller) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.netherrack) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.end_stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, GregTech_API.sBlockGranites) ||
- (mUpdated && tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, mStoneTypes)) ) {
- // Didn't reach, but could have placed. Save orevein for future use.
- return NO_OVERLAP;
- } else {
- // Didn't reach, but couldn't place in test spot anywys, try for another orevein
- return NO_OVERLAP_AIR_BLOCK;
- }
- }
- // Determine North/Sound ends of orevein
- int nZVein = aSeedZ - aRandom.nextInt(mSize);
- int sZVein = aSeedZ + 16 + aRandom.nextInt(mSize);
-
- int nZ = Math.max(nZVein, aChunkZ + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
- int sZ = Math.min(sZVein, aChunkZ + 2 + 16);
- if (nZ >= sZ) { //No overlap between orevein and this chunk exists in Z
- Block tBlock = aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8);
- if (tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.netherrack) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, Blocks.end_stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, GregTech_API.sBlockGranites) ||
- (mUpdated && tBlock.isReplaceableOreGen(aWorld, aChunkX+8, tMinY, aChunkZ + 8, mStoneTypes)) ) {
- // Didn't reach, but could have placed. Save orevein for future use.
- return NO_OVERLAP;
- } else {
- // Didn't reach, but couldn't place in test spot anywys, try for another orevein
- return NO_OVERLAP_AIR_BLOCK;
- }
-
- }
-
- if (debugWorldGen) {
- String tDimensionName = aWorld.provider.getDimensionName();
- GT_Log.out.print(
- "Trying Orevein:" + this.mWorldGenName +
- " Dimension=" + tDimensionName +
- " mX="+aChunkX/16+
- " mZ="+aChunkZ/16+
- " oreseedX="+ aSeedX/16 +
- " oreseedZ="+ aSeedZ/16 +
- " cY="+tMinY
- );
- }
- // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed should always be max density due to truncation of Math.sqrt().
- int localDensity = (Math.max(1, this.mDensity / ((int)Math.sqrt(2 + Math.pow(aChunkX/16 - aSeedX/16, 2) + Math.pow(aChunkZ/16 - aSeedZ/16, 2)))));
-
- // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll 1 pass through the loop
- // Now we do bottom-level-first oregen, and work our way upwards.
- int level = tMinY - 1; //Dunno why, but the first layer is actually played one below tMinY. Go figure.
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta != null) ) {
- if (setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- /*if ((placeCount[1]+placeCount[3])==0) {
+ mStoneTypes = (Block) tempBlock;
+ } else {
+ mStoneTypes = null;
+ }
+ }
+
+ public WorldGen_GT_Ore_Layer(
+ String aName,
+ int aMinY,
+ int aMaxY,
+ int aWeight,
+ int aDensity,
+ int aSize,
+ Material aPrimary,
+ Material aSecondary,
+ Material aBetween,
+ Material aSporadic) {
+ this(
+ aName,
+ true,
+ aMinY,
+ aMaxY,
+ aWeight,
+ aDensity,
+ aSize,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ aPrimary,
+ aSecondary,
+ aBetween,
+ aSporadic);
+ }
+
+ public WorldGen_GT_Ore_Layer(
+ String aName,
+ boolean aDefault,
+ int aMinY,
+ int aMaxY,
+ int aWeight,
+ int aDensity,
+ int aSize,
+ boolean aOverworld,
+ boolean aNether,
+ boolean aEnd,
+ boolean GC_UNUSED1,
+ boolean GC_UNUSED2,
+ boolean GC_UNUSED3,
+ Material aPrimary,
+ Material aSecondary,
+ Material aBetween,
+ Material aSporadic) {
+ super(aName, sList, aDefault);
+ Logger.WORLD("Creating Ore Layer Object");
+ this.mOverworld =
+ HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
+ this.mNether = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether);
+ this.mEnd = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd);
+ // this.mMoon = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon);
+ // this.mMars = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars);
+ // this.mAsteroid = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid",
+ // aAsteroid);
+ this.mMinY = 5;
+ short mMaxY = 14;
+ if (mMaxY < (this.mMinY + 7)) {
+ GT_Log.out.println("Oremix " + this.mWorldGenName + " has invalid Min/Max heights!");
+ mMaxY = (short) (this.mMinY + 7);
+ }
+ this.mMaxY = mMaxY;
+ this.mWeight = ((short)
+ HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
+ this.mDensity =
+ ((short) HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
+ this.mSize = ((short)
+ Math.max(1, HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
+ this.mPrimary = aPrimary;
+ this.mSecondary = aSecondary;
+ this.mBetween = aBetween;
+ this.mSporadic = aSporadic;
+ this.mPrimaryMeta = aPrimary.getOreBlock(1);
+ this.mSecondaryMeta = aSecondary.getOreBlock(1);
+ this.mBetweenMeta = aBetween.getOreBlock(1);
+ this.mSporadicMeta = aSporadic.getOreBlock(1);
+ this.mRestrictBiome =
+ HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
+
+ // if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new
+ // IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does
+ // not exist");
+ // if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new
+ // IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + "
+ // does not exist");
+ // if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new
+ // IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does
+ // not exist");
+ // if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new
+ // IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does
+ // not exist");
+
+ if (this.mEnabled) {
+ // GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY,
+ // aWeight, aOverworld, aNether, aEnd);
+ // GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY,
+ // aWeight, aOverworld, aNether, aEnd);
+ // GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY,
+ // aWeight, aOverworld, aNether, aEnd);
+ // GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY,
+ // aWeight, aOverworld, aNether, aEnd);
+ sWeight += this.mWeight;
+ }
+ }
+
+ public int executeWorldgenChunkified(
+ World aWorld,
+ Random aRandom,
+ String aBiome,
+ int aDimensionType,
+ int aChunkX,
+ int aChunkZ,
+ int aSeedX,
+ int aSeedZ,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider) {
+
+ // Debug Handler
+ /**
+ * This handles Variables that are null during Init
+ */
+ if (this.mPrimaryMeta == Blocks.stone
+ || this.mSecondaryMeta == Blocks.stone
+ || this.mBetweenMeta == Blocks.stone
+ || this.mSporadicMeta == Blocks.stone) {
+ this.mPrimaryMeta = this.mPrimary.getOreBlock(1);
+ this.mSecondaryMeta = this.mSecondary.getOreBlock(1);
+ this.mBetweenMeta = this.mBetween.getOreBlock(1);
+ this.mSporadicMeta = this.mSporadic.getOreBlock(1);
+ Logger.WORLD(
+ "[Vein Generator] An Ore in a Vein had defaulted back to a default value, so they have now been reset to correct values.");
+ }
+
+ if (mWorldGenName.equals("vein0")) {
+ if (debugWorldGen) GT_Log.out.println(" NoOresInVein-vein0");
+ // This is a special empty orevein
+ Logger.WORLD("[World Generation Debug] Special Empty Vein placed.");
+ return ORE_PLACED;
+ }
+ if (aDimensionType != Dimension_Everglades.DIMID) {
+ /* // Debug code, but spams log
+ if (debugWorldGen) {
+ GT_Log.out.println(
+ "Wrong dimension"
+ );
+ }
+ */
+ Logger.WORLD("[World Generation Debug] Wrong dimension.");
+ return WRONG_DIMENSION;
+ }
+ if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
+ return WRONG_BIOME;
+ }
+ int[] placeCount = new int[4];
+
+ int tMinY = mMinY + aRandom.nextInt(mMaxY - mMinY - 5);
+ // Determine West/East ends of orevein
+ int wXVein = aSeedX - aRandom.nextInt(mSize); // West side
+ int eXVein = aSeedX + 16 + aRandom.nextInt(mSize);
+ // Limit Orevein to only blocks present in current chunk
+ int wX = Math.max(wXVein, aChunkX + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
+ int eX = Math.min(eXVein, aChunkX + 2 + 16);
+ if (wX >= eX) { // No overlap between orevein and this chunk exists in X
+ Block tBlock = aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8);
+ if (tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.stone)
+ || tBlock.isReplaceableOreGen(
+ aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Dimension_Everglades.blockSecondLayer)
+ || tBlock.isReplaceableOreGen(
+ aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Dimension_Everglades.blockMainFiller)
+ || tBlock.isReplaceableOreGen(
+ aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Dimension_Everglades.blockSecondaryFiller)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.netherrack)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.end_stone)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, GregTech_API.sBlockGranites)
+ || (mUpdated && tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, mStoneTypes))) {
+ // Didn't reach, but could have placed. Save orevein for future use.
+ return NO_OVERLAP;
+ } else {
+ // Didn't reach, but couldn't place in test spot anywys, try for another orevein
+ return NO_OVERLAP_AIR_BLOCK;
+ }
+ }
+ // Determine North/Sound ends of orevein
+ int nZVein = aSeedZ - aRandom.nextInt(mSize);
+ int sZVein = aSeedZ + 16 + aRandom.nextInt(mSize);
+
+ int nZ = Math.max(nZVein, aChunkZ + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
+ int sZ = Math.min(sZVein, aChunkZ + 2 + 16);
+ if (nZ >= sZ) { // No overlap between orevein and this chunk exists in Z
+ Block tBlock = aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8);
+ if (tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.stone)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.netherrack)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.end_stone)
+ || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, GregTech_API.sBlockGranites)
+ || (mUpdated && tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, mStoneTypes))) {
+ // Didn't reach, but could have placed. Save orevein for future use.
+ return NO_OVERLAP;
+ } else {
+ // Didn't reach, but couldn't place in test spot anywys, try for another orevein
+ return NO_OVERLAP_AIR_BLOCK;
+ }
+ }
+
+ if (debugWorldGen) {
+ String tDimensionName = aWorld.provider.getDimensionName();
+ GT_Log.out.print("Trying Orevein:" + this.mWorldGenName + " Dimension="
+ + tDimensionName + " mX="
+ + aChunkX / 16 + " mZ="
+ + aChunkZ / 16 + " oreseedX="
+ + aSeedX / 16 + " oreseedZ="
+ + aSeedZ / 16 + " cY="
+ + tMinY);
+ }
+ // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed
+ // should always be max density due to truncation of Math.sqrt().
+ int localDensity = (Math.max(
+ 1,
+ this.mDensity
+ / ((int) Math.sqrt(2
+ + Math.pow(aChunkX / 16 - aSeedX / 16, 2)
+ + Math.pow(aChunkZ / 16 - aSeedZ / 16, 2)))));
+
+ // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll
+ // 1 pass through the loop
+ // Now we do bottom-level-first oregen, and work our way upwards.
+ int level = tMinY - 1; // Dunno why, but the first layer is actually played one below tMinY. Go figure.
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSecondaryMeta != null)) {
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
+ placeCount[1]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ /*if ((placeCount[1]+placeCount[3])==0) {
if (debugWorldGen) GT_Log.out.println(
" No ore in bottom layer"
);
return NO_ORE_IN_BOTTOM_LAYER; // Exit early, didn't place anything in the bottom layer
}*/
- Logger.WORLD("[World Generation Debug] Trying to set Ores?");
- for (level = tMinY; level < (tMinY-1+3); level++) {
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta != null) ) {
- if (setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- }
- // Low Middle layer is between + sporadic
- // level should be = tMinY-1+3 from end of for loop
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta != null) ) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
- placeCount[2]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- // High Middle layer is between + primary + sporadic
- level++; // Increment level to next layer
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta != null) ) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
- placeCount[2]++;
- }
- }
- else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta != null) ) {
- if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
- placeCount[0]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- // Top two layers are primary + sporadic
- level++; // Increment level to next layer
- for( ; level < (tMinY + 6); level++){ // should do two layers
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta != null) ) {
- if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
- placeCount[0]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta != null) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
- placeCount[3]++;
- }
- }
- }
- }
- if (debugWorldGen) {
- String tDimensionName = aWorld.provider.getDimensionName();
- GT_Log.out.println(
- "Generated Orevein:" + this.mWorldGenName +
- " Dimension=" + tDimensionName +
- " mX="+aChunkX/16+
- " mZ="+aChunkZ/16+
- " oreseedX="+ aSeedX/16 +
- " oreseedZ="+ aSeedZ/16 +
- " cY="+tMinY+
- " wXVein" + wXVein +
- " eXVein" + eXVein +
- " nZVein" + nZVein +
- " sZVein" + sZVein +
- " locDen=" + localDensity +
- " Den=" + this.mDensity +
- " Sec="+placeCount[1]+
- " Spo="+placeCount[3]+
- " Bet="+placeCount[2]+
- " Pri="+placeCount[0]
- );
- }
- // Something (at least the bottom layer must have 1 block) must have been placed, return true
- return ORE_PLACED;
- }
-
- private String fString = "unset", ore1String = "unset", ore2String = "unset", ore3String = "unset", ore4String = "unset";
- Map<Materials, String> gtOreMap = new HashMap<Materials, String>();
-
- @SuppressWarnings("deprecation")
- public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, Block aMetaData, boolean isSmallOre,
- boolean air) {
- if (!air) {
- aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1));
- }
-
- //Set GT ORE
- if (aMetaData instanceof GT_Block_Ores){
- if (ore1String.equals("unset")) {
- ore1String = Utils.sanitizeString(this.mPrimary.getLocalizedName().toLowerCase());
- }
- if (ore2String.equals("unset")) {
- ore2String = Utils.sanitizeString(this.mSecondaryMeta.getLocalizedName().toLowerCase());
- }
- if (ore3String.equals("unset")) {
- ore3String = Utils.sanitizeString(this.mBetweenMeta.getLocalizedName().toLowerCase());
- }
- if (ore4String.equals("unset")) {
- ore4String = Utils.sanitizeString(this.mSporadicMeta.getLocalizedName().toLowerCase());
- }
-
- if (this.mPrimaryMeta == aMetaData){
- for (Materials f : Materials.values()){
- if (!gtOreMap.containsKey(f)) {
- gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
- }
- fString = gtOreMap.get(f);
- if (fString.contains(ore1String)){
- int r = f.mMetaItemSubID;
- if (setOreBlock(aWorld, aX, aY, aZ, r, false)){
- Logger.WORLD("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- }
- }
- if (this.mSecondaryMeta == aMetaData){
- for (Materials f : Materials.values()){
- if (!gtOreMap.containsKey(f)) {
- gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
- }
- fString = gtOreMap.get(f);
- if (fString.contains(ore2String)){
- int r = f.mMetaItemSubID;
- if (setOreBlock(aWorld, aX, aY, aZ, r, false)){
- Logger.WORLD("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- }
- }
- if (this.mBetweenMeta == aMetaData){
- for (Materials f : Materials.values()){
- if (!gtOreMap.containsKey(f)) {
- gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
- }
- fString = gtOreMap.get(f);
- if (fString.contains(ore3String)){
- int r = f.mMetaItemSubID;
- if (setOreBlock(aWorld, aX, aY, aZ, r, false)){
- Logger.WORLD("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- }
- }
- if (this.mSporadicMeta == aMetaData){
- for (Materials f : Materials.values()){
- if (!gtOreMap.containsKey(f)) {
- gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
- }
- fString = gtOreMap.get(f);
- if (fString.contains(ore4String)){
- int r = f.mMetaItemSubID;
- if (setOreBlock(aWorld, aX, aY, aZ, r, false)){
- Logger.WORLD("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- }
- }
-
- }
-
- Block tBlock = aWorld.getBlock(aX, aY, aZ);
- Block tOreBlock = aMetaData;
- int BlockMeta = aWorld.getBlockMetadata(aX, aY, aZ);
- String BlockName = tBlock.getUnlocalizedName();
- if (
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sand) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites) ||
- (mUpdated && tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, mStoneTypes)) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockSecondLayer) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockMainFiller) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockSecondaryFiller) ||
- tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sandstone)) {
-
- if (aWorld.setBlock(aX, aY, aZ, tOreBlock, 0, 3)){
- Logger.WORLD("[World Generation Debug] Set "+tOreBlock.getLocalizedName()+" at X: "+aX+" | Y: "+aY+" | Z: "+aZ);
- return true;
- }
- }
- return false;
- }
-
+ Logger.WORLD("[World Generation Debug] Trying to set Ores?");
+ for (level = tMinY; level < (tMinY - 1 + 3); level++) {
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSecondaryMeta != null)) {
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
+ placeCount[1]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ }
+ // Low Middle layer is between + sporadic
+ // level should be = tMinY-1+3 from end of for loop
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if ((aRandom.nextInt(2) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mBetweenMeta
+ != null)) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
+ placeCount[2]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ // High Middle layer is between + primary + sporadic
+ level++; // Increment level to next layer
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if ((aRandom.nextInt(2) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mBetweenMeta
+ != null)) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
+ placeCount[2]++;
+ }
+ } else if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mPrimaryMeta != null)) {
+ if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
+ placeCount[0]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ // Top two layers are primary + sporadic
+ level++; // Increment level to next layer
+ for (; level < (tMinY + 6); level++) { // should do two layers
+ for (int tX = wX; tX < eX; tX++) {
+ int placeX = Math.max(
+ 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
+ for (int tZ = nZ; tZ < sZ; tZ++) {
+ int placeZ = Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity);
+ if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mPrimaryMeta != null)) {
+ if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
+ placeCount[0]++;
+ }
+ } else if ((aRandom.nextInt(7) == 0)
+ && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0))
+ && (this.mSporadicMeta
+ != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to
+ // compensate
+ if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++;
+ }
+ }
+ }
+ }
+ if (debugWorldGen) {
+ String tDimensionName = aWorld.provider.getDimensionName();
+ GT_Log.out.println("Generated Orevein:" + this.mWorldGenName + " Dimension="
+ + tDimensionName + " mX="
+ + aChunkX / 16 + " mZ="
+ + aChunkZ / 16 + " oreseedX="
+ + aSeedX / 16 + " oreseedZ="
+ + aSeedZ / 16 + " cY="
+ + tMinY + " wXVein"
+ + wXVein + " eXVein"
+ + eXVein + " nZVein"
+ + nZVein + " sZVein"
+ + sZVein + " locDen="
+ + localDensity + " Den="
+ + this.mDensity + " Sec="
+ + placeCount[1] + " Spo="
+ + placeCount[3] + " Bet="
+ + placeCount[2] + " Pri="
+ + placeCount[0]);
+ }
+ // Something (at least the bottom layer must have 1 block) must have been placed, return true
+ return ORE_PLACED;
+ }
+
+ private String fString = "unset",
+ ore1String = "unset",
+ ore2String = "unset",
+ ore3String = "unset",
+ ore4String = "unset";
+ Map<Materials, String> gtOreMap = new HashMap<Materials, String>();
+
+ @SuppressWarnings("deprecation")
+ public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, Block aMetaData, boolean isSmallOre, boolean air) {
+ if (!air) {
+ aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1));
+ }
+
+ // Set GT ORE
+ if (aMetaData instanceof GT_Block_Ores) {
+ if (ore1String.equals("unset")) {
+ ore1String =
+ Utils.sanitizeString(this.mPrimary.getLocalizedName().toLowerCase());
+ }
+ if (ore2String.equals("unset")) {
+ ore2String = Utils.sanitizeString(
+ this.mSecondaryMeta.getLocalizedName().toLowerCase());
+ }
+ if (ore3String.equals("unset")) {
+ ore3String = Utils.sanitizeString(
+ this.mBetweenMeta.getLocalizedName().toLowerCase());
+ }
+ if (ore4String.equals("unset")) {
+ ore4String = Utils.sanitizeString(
+ this.mSporadicMeta.getLocalizedName().toLowerCase());
+ }
- private boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int mMetaItemSubID, boolean useless){
+ if (this.mPrimaryMeta == aMetaData) {
+ for (Materials f : Materials.values()) {
+ if (!gtOreMap.containsKey(f)) {
+ gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
+ }
+ fString = gtOreMap.get(f);
+ if (fString.contains(ore1String)) {
+ int r = f.mMetaItemSubID;
+ if (setOreBlock(aWorld, aX, aY, aZ, r, false)) {
+ Logger.WORLD("[World Generation Debug] Set " + f.mDefaultLocalName + " Ore at X: " + aX
+ + " | Y: " + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ }
+ }
+ if (this.mSecondaryMeta == aMetaData) {
+ for (Materials f : Materials.values()) {
+ if (!gtOreMap.containsKey(f)) {
+ gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
+ }
+ fString = gtOreMap.get(f);
+ if (fString.contains(ore2String)) {
+ int r = f.mMetaItemSubID;
+ if (setOreBlock(aWorld, aX, aY, aZ, r, false)) {
+ Logger.WORLD("[World Generation Debug] Set " + f.mDefaultLocalName + " Ore at X: " + aX
+ + " | Y: " + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ }
+ }
+ if (this.mBetweenMeta == aMetaData) {
+ for (Materials f : Materials.values()) {
+ if (!gtOreMap.containsKey(f)) {
+ gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
+ }
+ fString = gtOreMap.get(f);
+ if (fString.contains(ore3String)) {
+ int r = f.mMetaItemSubID;
+ if (setOreBlock(aWorld, aX, aY, aZ, r, false)) {
+ Logger.WORLD("[World Generation Debug] Set " + f.mDefaultLocalName + " Ore at X: " + aX
+ + " | Y: " + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ }
+ }
+ if (this.mSporadicMeta == aMetaData) {
+ for (Materials f : Materials.values()) {
+ if (!gtOreMap.containsKey(f)) {
+ gtOreMap.put(f, Utils.sanitizeString(f.name().toLowerCase()));
+ }
+ fString = gtOreMap.get(f);
+ if (fString.contains(ore4String)) {
+ int r = f.mMetaItemSubID;
+ if (setOreBlock(aWorld, aX, aY, aZ, r, false)) {
+ Logger.WORLD("[World Generation Debug] Set " + f.mDefaultLocalName + " Ore at X: " + aX
+ + " | Y: " + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ Block tBlock = aWorld.getBlock(aX, aY, aZ);
+ Block tOreBlock = aMetaData;
+ int BlockMeta = aWorld.getBlockMetadata(aX, aY, aZ);
+ String BlockName = tBlock.getUnlocalizedName();
+ if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sand)
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt)
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)
+ || (mUpdated && tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, mStoneTypes))
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockSecondLayer)
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockMainFiller)
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Dimension_Everglades.blockSecondaryFiller)
+ || tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sandstone)) {
+
+ if (aWorld.setBlock(aX, aY, aZ, tOreBlock, 0, 3)) {
+ Logger.WORLD("[World Generation Debug] Set " + tOreBlock.getLocalizedName() + " at X: " + aX + " | Y: "
+ + aY + " | Z: " + aZ);
+ return true;
+ }
+ }
+ return false;
+ }
- //Get Class and Methods
- Method setOres = null;
- boolean is08 = !CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK;
+ private boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int mMetaItemSubID, boolean useless) {
- //GT 5.08
- if (is08){
- try {
- setOres = GT_TileEntity_Ores.class.getDeclaredMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class);
- }
- catch (NoSuchMethodException | SecurityException e) {
+ // Get Class and Methods
+ Method setOres = null;
+ boolean is08 = !CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK;
- }
- }
- //GT 5.09
- else {
- try {
- setOres = GT_TileEntity_Ores.class.getDeclaredMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class, boolean.class);
- }
- catch (NoSuchMethodException | SecurityException e) {
+ // GT 5.08
+ if (is08) {
+ try {
+ setOres = GT_TileEntity_Ores.class.getDeclaredMethod(
+ "setOreBlock", World.class, int.class, int.class, int.class, int.class);
+ } catch (NoSuchMethodException | SecurityException e) {
- }
- }
+ }
+ }
+ // GT 5.09
+ else {
+ try {
+ setOres = GT_TileEntity_Ores.class.getDeclaredMethod(
+ "setOreBlock", World.class, int.class, int.class, int.class, int.class, boolean.class);
+ } catch (NoSuchMethodException | SecurityException e) {
- try {
- if (is08 && setOres != null){
- setOres.invoke(null, aWorld, aX, aY, aZ, mMetaItemSubID);
- }
- else if (!is08 && setOres != null){
- setOres.invoke(null, aWorld, aX, aY, aZ, mMetaItemSubID, useless);
- }
- else {
- return false;
- }}
- catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+
+ try {
+ if (is08 && setOres != null) {
+ setOres.invoke(null, aWorld, aX, aY, aZ, mMetaItemSubID);
+ } else if (!is08 && setOres != null) {
+ setOres.invoke(null, aWorld, aX, aY, aZ, mMetaItemSubID, useless);
+ } else {
+ return false;
+ }
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- return false;
- }
-} \ No newline at end of file
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_Ores.java b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_Ores.java
index 0715f86e01..77676d8cfa 100644
--- a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_Ores.java
+++ b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_Ores.java
@@ -1,97 +1,101 @@
package gtPlusPlus.everglades.gen.gt;
-import java.util.Hashtable;
-
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.material.ORES;
import gtPlusPlus.core.material.nuclear.FLUORIDES;
+import java.util.Hashtable;
public class WorldGen_Ores {
- public static WorldGen_GT_Ore_Layer BaseVein = new WorldGen_GT_Ore_Layer("veinA", 20, 40, 1, 1, 128,
- ELEMENT.getInstance().IRON, ELEMENT.getInstance().IRON, ELEMENT.getInstance().IRON,
- ELEMENT.getInstance().IRON);
-
- /**
- * Custom ore Veins
- */
-
- public static WorldGen_GT_Ore_Layer Vein1 = new WorldGen_GT_Ore_Layer("vein1", 0, 60, 30, 2, 16, ORES.AGARDITE_CD,
- ORES.AGARDITE_LA, ORES.DEMICHELEITE_BR, ORES.IRARSITE);
-
- public static WorldGen_GT_Ore_Layer Vein2 = new WorldGen_GT_Ore_Layer("vein2", 0, 60, 30, 2, 16, ORES.AGARDITE_ND,
- ORES.AGARDITE_Y, ORES.KASHINITE, ORES.CERITE);
-
- public static WorldGen_GT_Ore_Layer Vein3 = new WorldGen_GT_Ore_Layer("vein3", 0, 60, 30, 3, 32, ORES.CERITE,
- ORES.NICHROMITE, ORES.XENOTIME, ORES.HIBONITE);
-
- public static WorldGen_GT_Ore_Layer Vein4 = new WorldGen_GT_Ore_Layer("vein4", 0, 60, 40, 3, 32, ORES.GEIKIELITE,
- ORES.CRYOLITE, ORES.GADOLINITE_CE, ORES.AGARDITE_ND);
-
- public static WorldGen_GT_Ore_Layer Vein5 = new WorldGen_GT_Ore_Layer("vein5", 30, 128, 20, 2, 48, ORES.HIBONITE,
- ORES.YTTRIALITE, ORES.ZIRCONILITE, ORES.CERITE);
- public static WorldGen_GT_Ore_Layer Vein6 = new WorldGen_GT_Ore_Layer("vein6", 0, 40, 20, 2, 48, ORES.XENOTIME,
- ORES.ZIRKELITE, ORES.CROCROITE, ORES.IRARSITE);
- public static WorldGen_GT_Ore_Layer Vein7 = new WorldGen_GT_Ore_Layer("vein7", 40, 128, 20, 2, 48, ORES.HONEAITE,
- ORES.MIESSIITE, ORES.SAMARSKITE_Y, ORES.SAMARSKITE_YB);
- public static WorldGen_GT_Ore_Layer Vein8 = new WorldGen_GT_Ore_Layer("vein8", 0, 40, 20, 2, 48, ORES.TITANITE,
- ORES.ZIMBABWEITE, ORES.ZIRCON, ORES.FLORENCITE);
-
- public static WorldGen_GT_Ore_Layer Vein9 = new WorldGen_GT_Ore_Layer("vein9", 10, 30, 20, 1, 48,
- ORES.LANTHANITE_CE, FLUORIDES.FLUORITE, ORES.LAFOSSAITE, ORES.FLORENCITE);
- public static WorldGen_GT_Ore_Layer Vein10 = new WorldGen_GT_Ore_Layer("vein10", 20, 50, 20, 2, 32, ORES.GEIKIELITE,
- ORES.YTTROCERITE, ORES.LANTHANITE_LA, ORES.RADIOBARITE);
- public static WorldGen_GT_Ore_Layer Vein11 = new WorldGen_GT_Ore_Layer("vein11", 30, 70, 20, 1, 48,
- FLUORIDES.FLUORITE, ORES.KASHINITE, ORES.ZIRCON, ORES.CRYOLITE);
- public static WorldGen_GT_Ore_Layer Vein12 = new WorldGen_GT_Ore_Layer("vein12", 40, 80, 20, 3, 32, ORES.CERITE,
- ORES.ALBURNITE, ORES.MIESSIITE, ORES.HIBONITE);
-
- /**
- * Best Rarest Veins 2017
- */
-
- public static WorldGen_GT_Ore_Layer Vein13 = new WorldGen_GT_Ore_Layer("vein13", 5, 15, 5, 1, 16, ORES.CRYOLITE,
- ORES.RADIOBARITE, ORES.HONEAITE, ORES.FLORENCITE);
-
- public static WorldGen_GT_Ore_Layer Vein14 = new WorldGen_GT_Ore_Layer("vein14", 10, 20, 8, 2, 16,
- ORES.DEMICHELEITE_BR, ORES.PERROUDITE, ORES.IRARSITE, ORES.RADIOBARITE);
-
- public static WorldGen_GT_Ore_Layer Vein15 = new WorldGen_GT_Ore_Layer("vein15", 5, 25, 5, 3, 24, ORES.FLUORCAPHITE,
- ORES.LAFOSSAITE, ORES.GADOLINITE_CE, ORES.GADOLINITE_Y);
-
- public static WorldGen_GT_Ore_Layer Vein16 = new WorldGen_GT_Ore_Layer("vein16", 0, 25, 4, 2, 32, ORES.YTTROCERITE,
- ORES.LEPERSONNITE, ORES.LAUTARITE, FLUORIDES.FLUORITE);
-
- public static WorldGen_GT_Ore_Layer Vein17 = new WorldGen_GT_Ore_Layer("vein17", 10, 35, 4, 1, 32, ORES.FLORENCITE,
- ORES.LAUTARITE, ORES.SAMARSKITE_YB, ORES.POLYCRASE);
- public static WorldGen_GT_Ore_Layer Vein18 = new WorldGen_GT_Ore_Layer("vein18", 15, 40, 4, 1, 48,
- ORES.GADOLINITE_CE, ORES.GADOLINITE_Y, ORES.AGARDITE_LA, ORES.AGARDITE_CD);
-
- public static Hashtable<Long, WorldGen_GT_Ore_Layer> validOreveins = new Hashtable<Long, WorldGen_GT_Ore_Layer>(
- 1024);
-
- static long ID = 0;
-
- public static void generateValidOreVeins() {
- validOreveins.put(ID++, BaseVein);
- validOreveins.put(ID++, Vein1);
- validOreveins.put(ID++, Vein2);
- validOreveins.put(ID++, Vein3);
- validOreveins.put(ID++, Vein4);
- validOreveins.put(ID++, Vein5);
- validOreveins.put(ID++, Vein6);
- validOreveins.put(ID++, Vein7);
- validOreveins.put(ID++, Vein8);
- validOreveins.put(ID++, Vein9);
- validOreveins.put(ID++, Vein10);
- validOreveins.put(ID++, Vein11);
- validOreveins.put(ID++, Vein12);
- validOreveins.put(ID++, Vein13);
- validOreveins.put(ID++, Vein14);
- validOreveins.put(ID++, Vein15);
- validOreveins.put(ID++, Vein16);
- validOreveins.put(ID++, Vein17);
- validOreveins.put(ID++, Vein18);
- }
-
+ public static WorldGen_GT_Ore_Layer BaseVein = new WorldGen_GT_Ore_Layer(
+ "veinA",
+ 20,
+ 40,
+ 1,
+ 1,
+ 128,
+ ELEMENT.getInstance().IRON,
+ ELEMENT.getInstance().IRON,
+ ELEMENT.getInstance().IRON,
+ ELEMENT.getInstance().IRON);
+
+ /**
+ * Custom ore Veins
+ */
+ public static WorldGen_GT_Ore_Layer Vein1 = new WorldGen_GT_Ore_Layer(
+ "vein1", 0, 60, 30, 2, 16, ORES.AGARDITE_CD, ORES.AGARDITE_LA, ORES.DEMICHELEITE_BR, ORES.IRARSITE);
+
+ public static WorldGen_GT_Ore_Layer Vein2 = new WorldGen_GT_Ore_Layer(
+ "vein2", 0, 60, 30, 2, 16, ORES.AGARDITE_ND, ORES.AGARDITE_Y, ORES.KASHINITE, ORES.CERITE);
+
+ public static WorldGen_GT_Ore_Layer Vein3 = new WorldGen_GT_Ore_Layer(
+ "vein3", 0, 60, 30, 3, 32, ORES.CERITE, ORES.NICHROMITE, ORES.XENOTIME, ORES.HIBONITE);
+
+ public static WorldGen_GT_Ore_Layer Vein4 = new WorldGen_GT_Ore_Layer(
+ "vein4", 0, 60, 40, 3, 32, ORES.GEIKIELITE, ORES.CRYOLITE, ORES.GADOLINITE_CE, ORES.AGARDITE_ND);
+
+ public static WorldGen_GT_Ore_Layer Vein5 = new WorldGen_GT_Ore_Layer(
+ "vein5", 30, 128, 20, 2, 48, ORES.HIBONITE, ORES.YTTRIALITE, ORES.ZIRCONILITE, ORES.CERITE);
+ public static WorldGen_GT_Ore_Layer Vein6 = new WorldGen_GT_Ore_Layer(
+ "vein6", 0, 40, 20, 2, 48, ORES.XENOTIME, ORES.ZIRKELITE, ORES.CROCROITE, ORES.IRARSITE);
+ public static WorldGen_GT_Ore_Layer Vein7 = new WorldGen_GT_Ore_Layer(
+ "vein7", 40, 128, 20, 2, 48, ORES.HONEAITE, ORES.MIESSIITE, ORES.SAMARSKITE_Y, ORES.SAMARSKITE_YB);
+ public static WorldGen_GT_Ore_Layer Vein8 = new WorldGen_GT_Ore_Layer(
+ "vein8", 0, 40, 20, 2, 48, ORES.TITANITE, ORES.ZIMBABWEITE, ORES.ZIRCON, ORES.FLORENCITE);
+
+ public static WorldGen_GT_Ore_Layer Vein9 = new WorldGen_GT_Ore_Layer(
+ "vein9", 10, 30, 20, 1, 48, ORES.LANTHANITE_CE, FLUORIDES.FLUORITE, ORES.LAFOSSAITE, ORES.FLORENCITE);
+ public static WorldGen_GT_Ore_Layer Vein10 = new WorldGen_GT_Ore_Layer(
+ "vein10", 20, 50, 20, 2, 32, ORES.GEIKIELITE, ORES.YTTROCERITE, ORES.LANTHANITE_LA, ORES.RADIOBARITE);
+ public static WorldGen_GT_Ore_Layer Vein11 = new WorldGen_GT_Ore_Layer(
+ "vein11", 30, 70, 20, 1, 48, FLUORIDES.FLUORITE, ORES.KASHINITE, ORES.ZIRCON, ORES.CRYOLITE);
+ public static WorldGen_GT_Ore_Layer Vein12 = new WorldGen_GT_Ore_Layer(
+ "vein12", 40, 80, 20, 3, 32, ORES.CERITE, ORES.ALBURNITE, ORES.MIESSIITE, ORES.HIBONITE);
+
+ /**
+ * Best Rarest Veins 2017
+ */
+ public static WorldGen_GT_Ore_Layer Vein13 = new WorldGen_GT_Ore_Layer(
+ "vein13", 5, 15, 5, 1, 16, ORES.CRYOLITE, ORES.RADIOBARITE, ORES.HONEAITE, ORES.FLORENCITE);
+
+ public static WorldGen_GT_Ore_Layer Vein14 = new WorldGen_GT_Ore_Layer(
+ "vein14", 10, 20, 8, 2, 16, ORES.DEMICHELEITE_BR, ORES.PERROUDITE, ORES.IRARSITE, ORES.RADIOBARITE);
+
+ public static WorldGen_GT_Ore_Layer Vein15 = new WorldGen_GT_Ore_Layer(
+ "vein15", 5, 25, 5, 3, 24, ORES.FLUORCAPHITE, ORES.LAFOSSAITE, ORES.GADOLINITE_CE, ORES.GADOLINITE_Y);
+
+ public static WorldGen_GT_Ore_Layer Vein16 = new WorldGen_GT_Ore_Layer(
+ "vein16", 0, 25, 4, 2, 32, ORES.YTTROCERITE, ORES.LEPERSONNITE, ORES.LAUTARITE, FLUORIDES.FLUORITE);
+
+ public static WorldGen_GT_Ore_Layer Vein17 = new WorldGen_GT_Ore_Layer(
+ "vein17", 10, 35, 4, 1, 32, ORES.FLORENCITE, ORES.LAUTARITE, ORES.SAMARSKITE_YB, ORES.POLYCRASE);
+ public static WorldGen_GT_Ore_Layer Vein18 = new WorldGen_GT_Ore_Layer(
+ "vein18", 15, 40, 4, 1, 48, ORES.GADOLINITE_CE, ORES.GADOLINITE_Y, ORES.AGARDITE_LA, ORES.AGARDITE_CD);
+
+ public static Hashtable<Long, WorldGen_GT_Ore_Layer> validOreveins =
+ new Hashtable<Long, WorldGen_GT_Ore_Layer>(1024);
+
+ static long ID = 0;
+
+ public static void generateValidOreVeins() {
+ validOreveins.put(ID++, BaseVein);
+ validOreveins.put(ID++, Vein1);
+ validOreveins.put(ID++, Vein2);
+ validOreveins.put(ID++, Vein3);
+ validOreveins.put(ID++, Vein4);
+ validOreveins.put(ID++, Vein5);
+ validOreveins.put(ID++, Vein6);
+ validOreveins.put(ID++, Vein7);
+ validOreveins.put(ID++, Vein8);
+ validOreveins.put(ID++, Vein9);
+ validOreveins.put(ID++, Vein10);
+ validOreveins.put(ID++, Vein11);
+ validOreveins.put(ID++, Vein12);
+ validOreveins.put(ID++, Vein13);
+ validOreveins.put(ID++, Vein14);
+ validOreveins.put(ID++, Vein15);
+ validOreveins.put(ID++, Vein16);
+ validOreveins.put(ID++, Vein17);
+ validOreveins.put(ID++, Vein18);
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/item/ItemBlockToxicEverglades.java b/src/main/java/gtPlusPlus/everglades/item/ItemBlockToxicEverglades.java
index ce4182c598..51776df839 100644
--- a/src/main/java/gtPlusPlus/everglades/item/ItemBlockToxicEverglades.java
+++ b/src/main/java/gtPlusPlus/everglades/item/ItemBlockToxicEverglades.java
@@ -1,42 +1,35 @@
package gtPlusPlus.everglades.item;
+import gtPlusPlus.api.interfaces.ITileTooltip;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-
public class ItemBlockToxicEverglades extends ItemBlock {
-
- protected final int mID;
-
- public ItemBlockToxicEverglades(final Block block) {
- super(block);
- this.mID = ((ITileTooltip) block).getTooltipID();
- }
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.mID == 0){ //blockDarkWorldPortalFrame
- list.add("Use this to access the Toxic Everglades.");
- list.add("Assembled in the same shape as the Nether Portal.");
- }
- else if (this.mID == 1){ //blockDarkWorldPortal
- list.add("Place this if you are lazy to create the portal structure, slacker.");
- }
- else if (this.mID == 2){ //blockDarkWorldGround
- list.add("Will burn very quickly if it happens to catch fire.");
- }
- else if (this.mID == 3){ //blockDarkWorldPollutedDirt
- list.add("Maybe you can do something with this?.");
- if (stack.getItemDamage() > 0) {
- list.add("This smells worse than a bean fart...");
- }
- }
- }
-
+ protected final int mID;
+
+ public ItemBlockToxicEverglades(final Block block) {
+ super(block);
+ this.mID = ((ITileTooltip) block).getTooltipID();
+ }
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.mID == 0) { // blockDarkWorldPortalFrame
+ list.add("Use this to access the Toxic Everglades.");
+ list.add("Assembled in the same shape as the Nether Portal.");
+ } else if (this.mID == 1) { // blockDarkWorldPortal
+ list.add("Place this if you are lazy to create the portal structure, slacker.");
+ } else if (this.mID == 2) { // blockDarkWorldGround
+ list.add("Will burn very quickly if it happens to catch fire.");
+ } else if (this.mID == 3) { // blockDarkWorldPollutedDirt
+ list.add("Maybe you can do something with this?.");
+ if (stack.getItemDamage() > 0) {
+ list.add("This smells worse than a bean fart...");
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/everglades/item/ItemEvergladesPortalTrigger.java b/src/main/java/gtPlusPlus/everglades/item/ItemEvergladesPortalTrigger.java
index 3119de19b9..02e0394760 100644
--- a/src/main/java/gtPlusPlus/everglades/item/ItemEvergladesPortalTrigger.java
+++ b/src/main/java/gtPlusPlus/everglades/item/ItemEvergladesPortalTrigger.java
@@ -1,7 +1,10 @@
package gtPlusPlus.everglades.item;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,90 +15,96 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.everglades.dimension.Dimension_Everglades;
-
public class ItemEvergladesPortalTrigger extends Item {
- public ItemEvergladesPortalTrigger() {
- super();
- this.maxStackSize = 1;
- setMaxDamage(64);
- setCreativeTab(CreativeTabs.tabTools);
- this.setTextureName(CORE.MODID + ":" + "itemAlkalusDisk");
- }
+ public ItemEvergladesPortalTrigger() {
+ super();
+ this.maxStackSize = 1;
+ setMaxDamage(64);
+ setCreativeTab(CreativeTabs.tabTools);
+ this.setTextureName(CORE.MODID + ":" + "itemAlkalusDisk");
+ }
- @Override
- public Item setMaxStackSize(int int1) {
- return super.setMaxStackSize(1);
- }
+ @Override
+ public Item setMaxStackSize(int int1) {
+ return super.setMaxStackSize(1);
+ }
- @Override
- public EnumRarity getRarity(ItemStack thisItem) {
- return EnumRarity.epic;
- }
+ @Override
+ public EnumRarity getRarity(ItemStack thisItem) {
+ return EnumRarity.epic;
+ }
- @Override
- public boolean hasEffect(ItemStack par1ItemStack, int pass) {
- return true;
- }
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack, int pass) {
+ return true;
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return EnumChatFormatting.GOLD+"Alkalus Disk ["+EnumChatFormatting.RED+"Activated"+EnumChatFormatting.GOLD+"]";
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return EnumChatFormatting.GOLD + "Alkalus Disk [" + EnumChatFormatting.RED + "Activated"
+ + EnumChatFormatting.GOLD + "]";
+ }
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GREEN+"Shines the way, towards the far away Everglades.");
- list.add(EnumChatFormatting.GREEN+"This item produces such a temperature, that you'd hate to use it incorrectly.");
- super.addInformation(stack, aPlayer, list, bool);
- }
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add(EnumChatFormatting.GREEN + "Shines the way, towards the far away Everglades.");
+ list.add(EnumChatFormatting.GREEN
+ + "This item produces such a temperature, that you'd hate to use it incorrectly.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- return Utils.rgbtoHexValue(255, 128, 0);
- }
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ return Utils.rgbtoHexValue(255, 128, 0);
+ }
- @Override
- public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7,
- float par8, float par9, float par10) {
- if (par7 == 0) {
- par5--;
- }
- if (par7 == 1) {
- par5++;
- }
- if (par7 == 2) {
- par6--;
- }
- if (par7 == 3) {
- par6++;
- }
- if (par7 == 4) {
- par4--;
- }
- if (par7 == 5) {
- par4++;
- }
- if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
- return false;
- }
- Block i1 = par3World.getBlock(par4, par5, par6);
- if (i1 == Blocks.air) {
- par3World.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
- if (Dimension_Everglades.portalBlock.tryToCreatePortal(par3World, par4, par5, par6)){
- //Make a Portal
- }
- else {
- if (!par3World.isRemote){
- par3World.setBlock(par4, par5, par6, ModBlocks.blockHellfire, 0, 3);
- }
- }
- }
- par1ItemStack.damageItem(1, par2EntityPlayer);
- return true;
- }
-} \ No newline at end of file
+ @Override
+ public boolean onItemUse(
+ ItemStack par1ItemStack,
+ EntityPlayer par2EntityPlayer,
+ World par3World,
+ int par4,
+ int par5,
+ int par6,
+ int par7,
+ float par8,
+ float par9,
+ float par10) {
+ if (par7 == 0) {
+ par5--;
+ }
+ if (par7 == 1) {
+ par5++;
+ }
+ if (par7 == 2) {
+ par6--;
+ }
+ if (par7 == 3) {
+ par6++;
+ }
+ if (par7 == 4) {
+ par4--;
+ }
+ if (par7 == 5) {
+ par4++;
+ }
+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
+ return false;
+ }
+ Block i1 = par3World.getBlock(par4, par5, par6);
+ if (i1 == Blocks.air) {
+ par3World.playSoundEffect(
+ par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
+ if (Dimension_Everglades.portalBlock.tryToCreatePortal(par3World, par4, par5, par6)) {
+ // Make a Portal
+ } else {
+ if (!par3World.isRemote) {
+ par3World.setBlock(par4, par5, par6, ModBlocks.blockHellfire, 0, 3);
+ }
+ }
+ }
+ par1ItemStack.damageItem(1, par2EntityPlayer);
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/object/BoxedQuad.java b/src/main/java/gtPlusPlus/everglades/object/BoxedQuad.java
index d0fbc4247b..d407cd6f21 100644
--- a/src/main/java/gtPlusPlus/everglades/object/BoxedQuad.java
+++ b/src/main/java/gtPlusPlus/everglades/object/BoxedQuad.java
@@ -1,56 +1,53 @@
package gtPlusPlus.everglades.object;
-import net.minecraft.block.Block;
-
import gtPlusPlus.api.objects.data.Pair;
+import net.minecraft.block.Block;
-public class BoxedQuad<K,V,C,R> {
-
- private final Pair<Block, Integer> key;
- private final Pair<Block, Integer> value;
- private final Pair<Block, Integer> value2;
- private final Pair<Block, Integer> value3;
- private final Pair<Block, Integer> [] mInternalPairArray;
-
-
- public BoxedQuad(final Pair<Block, Integer> key, final Pair<Block, Integer> value, final Pair<Block, Integer> value2, final Pair<Block, Integer> value3){
- this.key = key;
- this.value = value;
- this.value2 = value2;
- this.value3 = value3;
- mInternalPairArray = new Pair[]{key, value, value2, value3};
- }
-
- final public Pair<Block, Integer> getKey(){
- return this.key;
- }
-
- final public Pair<Block, Integer> getValue_1(){
- return this.value;
- }
-
- final public Pair<Block, Integer> getValue_2(){
- return this.value2;
- }
-
- final public Pair<Block, Integer> getValue_3(){
- return this.value3;
- }
-
- final synchronized Pair<Block, Integer> unbox(int pos){
- return this.mInternalPairArray[pos];
- }
-
- final synchronized Block getBlock(int pos){
- return this.mInternalPairArray[pos].getKey();
- }
-
- final synchronized int getMeta(int pos){
- return this.mInternalPairArray[pos].getValue();
- }
-
-
-
-
-
-} \ No newline at end of file
+public class BoxedQuad<K, V, C, R> {
+
+ private final Pair<Block, Integer> key;
+ private final Pair<Block, Integer> value;
+ private final Pair<Block, Integer> value2;
+ private final Pair<Block, Integer> value3;
+ private final Pair<Block, Integer>[] mInternalPairArray;
+
+ public BoxedQuad(
+ final Pair<Block, Integer> key,
+ final Pair<Block, Integer> value,
+ final Pair<Block, Integer> value2,
+ final Pair<Block, Integer> value3) {
+ this.key = key;
+ this.value = value;
+ this.value2 = value2;
+ this.value3 = value3;
+ mInternalPairArray = new Pair[] {key, value, value2, value3};
+ }
+
+ public final Pair<Block, Integer> getKey() {
+ return this.key;
+ }
+
+ public final Pair<Block, Integer> getValue_1() {
+ return this.value;
+ }
+
+ public final Pair<Block, Integer> getValue_2() {
+ return this.value2;
+ }
+
+ public final Pair<Block, Integer> getValue_3() {
+ return this.value3;
+ }
+
+ final synchronized Pair<Block, Integer> unbox(int pos) {
+ return this.mInternalPairArray[pos];
+ }
+
+ final synchronized Block getBlock(int pos) {
+ return this.mInternalPairArray[pos].getKey();
+ }
+
+ final synchronized int getMeta(int pos) {
+ return this.mInternalPairArray[pos].getValue();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/world/CustomWorldType.java b/src/main/java/gtPlusPlus/everglades/world/CustomWorldType.java
index 5a5344ca65..95ea14858e 100644
--- a/src/main/java/gtPlusPlus/everglades/world/CustomWorldType.java
+++ b/src/main/java/gtPlusPlus/everglades/world/CustomWorldType.java
@@ -3,57 +3,54 @@ package gtPlusPlus.everglades.world;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-
import net.minecraft.world.WorldType;
-public class CustomWorldType extends WorldType{
-
- public CustomWorldType(String name) {
- super(name);
- }
-
- public CustomWorldType(int p_i1959_1_, String p_i1959_2_){
- this("test");
- try {
- //System.out.println(Arrays.toString(getClass().getSuperclass().getMethods()));
- Method m = getClass().getSuperclass().getDeclaredMethod("WorldType", new Class<?>[]{});
- m.setAccessible(true);
- m.invoke(this, p_i1959_1_, p_i1959_2_, 0);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public CustomWorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_){
- this("test2");
- try {
- //System.out.println(Arrays.toString(getClass().getSuperclass().getMethods()));
- Method m = getClass().getSuperclass().getDeclaredMethod("WorldType", new Class<?>[]{});
- m.setAccessible(true);
- m.invoke(this, p_i1960_1_, p_i1960_2_, p_i1960_3_);
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
- private WorldType getMC(){
- try {
- Constructor<WorldType> c = WorldType.class.getDeclaredConstructor();
- c.setAccessible(true); // solution
- return c.newInstance();
-
- // production code should handle these exceptions more gracefully
- } catch (InvocationTargetException x) {
- x.printStackTrace();
- } catch (NoSuchMethodException x) {
- x.printStackTrace();
- } catch (InstantiationException x) {
- x.printStackTrace();
- } catch (IllegalAccessException x) {
- x.printStackTrace();
- }
- return null;
- }
+public class CustomWorldType extends WorldType {
+
+ public CustomWorldType(String name) {
+ super(name);
+ }
+
+ public CustomWorldType(int p_i1959_1_, String p_i1959_2_) {
+ this("test");
+ try {
+ // System.out.println(Arrays.toString(getClass().getSuperclass().getMethods()));
+ Method m = getClass().getSuperclass().getDeclaredMethod("WorldType", new Class<?>[] {});
+ m.setAccessible(true);
+ m.invoke(this, p_i1959_1_, p_i1959_2_, 0);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public CustomWorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_) {
+ this("test2");
+ try {
+ // System.out.println(Arrays.toString(getClass().getSuperclass().getMethods()));
+ Method m = getClass().getSuperclass().getDeclaredMethod("WorldType", new Class<?>[] {});
+ m.setAccessible(true);
+ m.invoke(this, p_i1960_1_, p_i1960_2_, p_i1960_3_);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private WorldType getMC() {
+ try {
+ Constructor<WorldType> c = WorldType.class.getDeclaredConstructor();
+ c.setAccessible(true); // solution
+ return c.newInstance();
+
+ // production code should handle these exceptions more gracefully
+ } catch (InvocationTargetException x) {
+ x.printStackTrace();
+ } catch (NoSuchMethodException x) {
+ x.printStackTrace();
+ } catch (InstantiationException x) {
+ x.printStackTrace();
+ } catch (IllegalAccessException x) {
+ x.printStackTrace();
+ }
+ return null;
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/everglades/world/EvergladesPortalPosition.java b/src/main/java/gtPlusPlus/everglades/world/EvergladesPortalPosition.java
index 227d32502b..bfeb8c94ad 100644
--- a/src/main/java/gtPlusPlus/everglades/world/EvergladesPortalPosition.java
+++ b/src/main/java/gtPlusPlus/everglades/world/EvergladesPortalPosition.java
@@ -3,12 +3,12 @@ package gtPlusPlus.everglades.world;
import net.minecraft.util.ChunkCoordinates;
public class EvergladesPortalPosition extends ChunkCoordinates {
- public long field_85087_d;
- final TeleporterDimensionMod field_85088_e;
+ public long field_85087_d;
+ final TeleporterDimensionMod field_85088_e;
- public EvergladesPortalPosition(TeleporterDimensionMod gladesTeleporter, int par2, int par3, int par4, long par5) {
- super(par2, par3, par4);
- this.field_85088_e = gladesTeleporter;
- this.field_85087_d = par5;
- }
-} \ No newline at end of file
+ public EvergladesPortalPosition(TeleporterDimensionMod gladesTeleporter, int par2, int par3, int par4, long par5) {
+ super(par2, par3, par4);
+ this.field_85088_e = gladesTeleporter;
+ this.field_85087_d = par5;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java b/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java
index e67a882638..ee8488ab75 100644
--- a/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java
+++ b/src/main/java/gtPlusPlus/everglades/world/TeleporterDimensionMod.java
@@ -1,7 +1,7 @@
package gtPlusPlus.everglades.world;
+import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import java.util.*;
-
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.*;
@@ -9,463 +9,463 @@ import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.Teleporter;
import net.minecraft.world.WorldServer;
-import gtPlusPlus.everglades.dimension.Dimension_Everglades;
-
public class TeleporterDimensionMod extends Teleporter {
- private final WorldServer worldServerInstance;
- /**
- * A private Random() function in Teleporter
- */
- private final Random random;
- /**
- * Stores successful portal placement locations for rapid lookup.
- */
- private final LongHashMap destinationCoordinateCache = new LongHashMap();
- /**
- * A list of valid keys for the destinationCoordainteCache. These are
- * based on the X & Z of the players initial location.
- */
- @SuppressWarnings("rawtypes")
- private final List destinationCoordinateKeys = new ArrayList();
-
- public TeleporterDimensionMod(WorldServer par1WorldServer) {
- super(par1WorldServer);
- this.worldServerInstance = par1WorldServer;
- this.random = new Random(par1WorldServer.getSeed());
- }
-
- /**
- * Place an entity in a nearby portal, creating one if necessary.
- */
- @Override
- public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
- if (this.worldServerInstance.provider.dimensionId != 1) {
- if (!this.placeInExistingPortal(par1Entity, par2, par4, par6, par8)) {
- this.makePortal(par1Entity);
- this.placeInExistingPortal(par1Entity, par2, par4, par6, par8);
- }
- }
- else {
- int i = MathHelper.floor_double(par1Entity.posX);
- int j = MathHelper.floor_double(par1Entity.posY) - 1;
- int k = MathHelper.floor_double(par1Entity.posZ);
- byte b0 = 1;
- byte b1 = 0;
-
- for (int l = -2; l <= 2; ++l) {
- for (int i1 = -2; i1 <= 2; ++i1) {
- for (int j1 = -1; j1 < 3; ++j1) {
- int k1 = i + i1 * b0 + l * b1;
- int l1 = j + j1;
- int i2 = k + i1 * b1 - l * b0;
- boolean flag = j1 < 0;
- this.worldServerInstance.setBlock(k1, l1, i2, flag ? Dimension_Everglades.blockPortalFrame : Blocks.air);
- }
- }
- }
-
- par1Entity.setLocationAndAngles(i, j, k, par1Entity.rotationYaw, 0.0F);
- par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
- }
- }
-
- /**
- * Place an entity in a nearby portal which already exists.
- */
- @Override
- public boolean placeInExistingPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
- short short1 = 128;
- double d3 = -1.0D;
- int i = 0;
- int j = 0;
- int k = 0;
- int l = MathHelper.floor_double(par1Entity.posX);
- int i1 = MathHelper.floor_double(par1Entity.posZ);
- long j1 = ChunkCoordIntPair.chunkXZ2Int(l, i1);
- boolean flag = true;
- double d7;
- int l3;
-
- if (this.destinationCoordinateCache.containsItem(j1)) {
- Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition) this.destinationCoordinateCache
- .getValueByKey(j1);
- d3 = 0.0D;
- i = portalposition.posX;
- j = portalposition.posY;
- k = portalposition.posZ;
- portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
- flag = false;
- }
- else {
- for (l3 = l - short1; l3 <= l + short1; ++l3) {
- double d4 = l3 + 0.5D - par1Entity.posX;
-
- for (int l1 = i1 - short1; l1 <= i1 + short1; ++l1) {
- double d5 = l1 + 0.5D - par1Entity.posZ;
-
- for (int i2 = this.worldServerInstance.getActualHeight() - 1; i2 >= 0; --i2) {
- if (this.worldServerInstance.getBlock(l3, i2, l1) == Dimension_Everglades.portalBlock) {
- while (this.worldServerInstance.getBlock(l3, i2 - 1, l1) == Dimension_Everglades.portalBlock) {
- --i2;
- }
-
- d7 = i2 + 0.5D - par1Entity.posY;
- double d8 = d4 * d4 + d7 * d7 + d5 * d5;
-
- if (d3 < 0.0D || d8 < d3) {
- d3 = d8;
- i = l3;
- j = i2;
- k = l1;
- }
- }
- }
- }
- }
- }
-
- if (d3 >= 0.0D) {
- if (flag) {
- this.destinationCoordinateCache.add(j1,
- new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime()));
- this.destinationCoordinateKeys.add(Long.valueOf(j1));
- }
-
- double d11 = i + 0.5D;
- double d6 = j + 0.5D;
- d7 = k + 0.5D;
- int i4 = -1;
-
- if (this.worldServerInstance.getBlock(i - 1, j, k) == Dimension_Everglades.portalBlock) {
- i4 = 2;
- }
-
- if (this.worldServerInstance.getBlock(i + 1, j, k) == Dimension_Everglades.portalBlock) {
- i4 = 0;
- }
-
- if (this.worldServerInstance.getBlock(i, j, k - 1) == Dimension_Everglades.portalBlock) {
- i4 = 3;
- }
-
- if (this.worldServerInstance.getBlock(i, j, k + 1) == Dimension_Everglades.portalBlock) {
- i4 = 1;
- }
-
- int j2 = par1Entity.getTeleportDirection();
-
- if (i4 > -1) {
- int k2 = Direction.rotateLeft[i4];
- int l2 = Direction.offsetX[i4];
- int i3 = Direction.offsetZ[i4];
- int j3 = Direction.offsetX[k2];
- int k3 = Direction.offsetZ[k2];
- boolean flag1 = !this.worldServerInstance.isAirBlock(i + l2 + j3, j, k + i3 + k3)
- || !this.worldServerInstance.isAirBlock(i + l2 + j3, j + 1, k + i3 + k3);
- boolean flag2 = !this.worldServerInstance.isAirBlock(i + l2, j, k + i3)
- || !this.worldServerInstance.isAirBlock(i + l2, j + 1, k + i3);
-
- if (flag1 && flag2) {
- i4 = Direction.rotateOpposite[i4];
- k2 = Direction.rotateOpposite[k2];
- l2 = Direction.offsetX[i4];
- i3 = Direction.offsetZ[i4];
- j3 = Direction.offsetX[k2];
- k3 = Direction.offsetZ[k2];
- l3 = i - j3;
- d11 -= j3;
- int k1 = k - k3;
- d7 -= k3;
- flag1 = !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j, k1 + i3 + k3)
- || !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j + 1, k1 + i3 + k3);
- flag2 = !this.worldServerInstance.isAirBlock(l3 + l2, j, k1 + i3)
- || !this.worldServerInstance.isAirBlock(l3 + l2, j + 1, k1 + i3);
- }
-
- float f1 = 0.5F;
- float f2 = 0.5F;
-
- if (!flag1 && flag2) {
- f1 = 1.0F;
- }
- else if (flag1 && !flag2) {
- f1 = 0.0F;
- }
- else if (flag1 && flag2) {
- f2 = 0.0F;
- }
-
- d11 += j3 * f1 + f2 * l2;
- d7 += k3 * f1 + f2 * i3;
- float f3 = 0.0F;
- float f4 = 0.0F;
- float f5 = 0.0F;
- float f6 = 0.0F;
-
- if (i4 == j2) {
- f3 = 1.0F;
- f4 = 1.0F;
- }
- else if (i4 == Direction.rotateOpposite[j2]) {
- f3 = -1.0F;
- f4 = -1.0F;
- }
- else if (i4 == Direction.rotateRight[j2]) {
- f5 = 1.0F;
- f6 = -1.0F;
- }
- else {
- f5 = -1.0F;
- f6 = 1.0F;
- }
-
- double d9 = par1Entity.motionX;
- double d10 = par1Entity.motionZ;
- par1Entity.motionX = d9 * f3 + d10 * f6;
- par1Entity.motionZ = d9 * f5 + d10 * f4;
- par1Entity.rotationYaw = par8 - j2 * 90 + i4 * 90;
- }
- else {
- par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
- }
-
- par1Entity.setLocationAndAngles(d11, d6, d7, par1Entity.rotationYaw, par1Entity.rotationPitch);
- return true;
- }
- else {
- return false;
- }
- }
-
- @Override
- public boolean makePortal(Entity par1Entity) {
- byte b0 = 16;
- double d0 = -1.0D;
- int i = MathHelper.floor_double(par1Entity.posX);
- int j = MathHelper.floor_double(par1Entity.posY);
- int k = MathHelper.floor_double(par1Entity.posZ);
- int l = i;
- int i1 = j;
- int j1 = k;
- int k1 = 0;
- int l1 = this.random.nextInt(4);
- int i2;
- double d1;
- double d2;
- int k2;
- int i3;
- int k3;
- int j3;
- int i4;
- int l3;
- int k4;
- int j4;
- int i5;
- int l4;
- double d3;
- double d4;
-
- for (i2 = i - b0; i2 <= i + b0; ++i2) {
- d1 = i2 + 0.5D - par1Entity.posX;
-
- for (k2 = k - b0; k2 <= k + b0; ++k2) {
- d2 = k2 + 0.5D - par1Entity.posZ;
- label274:
-
- for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) {
- if (this.worldServerInstance.isAirBlock(i2, i3, k2)) {
- while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) {
- --i3;
- }
-
- for (j3 = l1; j3 < l1 + 4; ++j3) {
- k3 = j3 % 2;
- l3 = 1 - k3;
-
- if (j3 % 4 >= 2) {
- k3 = -k3;
- l3 = -l3;
- }
-
- for (i4 = 0; i4 < 3; ++i4) {
- for (j4 = 0; j4 < 4; ++j4) {
- for (k4 = -1; k4 < 4; ++k4) {
- l4 = i2 + (j4 - 1) * k3 + i4 * l3;
- i5 = i3 + k4;
- int j5 = k2 + (j4 - 1) * l3 - i4 * k3;
-
- if (k4 < 0
- && !this.worldServerInstance.getBlock(l4, i5, j5).getMaterial()
- .isSolid()
- || k4 >= 0 && !this.worldServerInstance.isAirBlock(l4, i5, j5)) {
- continue label274;
- }
- }
- }
- }
-
- d4 = i3 + 0.5D - par1Entity.posY;
- d3 = d1 * d1 + d4 * d4 + d2 * d2;
-
- if (d0 < 0.0D || d3 < d0) {
- d0 = d3;
- l = i2;
- i1 = i3;
- j1 = k2;
- k1 = j3 % 4;
- }
- }
- }
- }
- }
- }
-
- if (d0 < 0.0D) {
- for (i2 = i - b0; i2 <= i + b0; ++i2) {
- d1 = i2 + 0.5D - par1Entity.posX;
-
- for (k2 = k - b0; k2 <= k + b0; ++k2) {
- d2 = k2 + 0.5D - par1Entity.posZ;
- label222:
-
- for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) {
- if (this.worldServerInstance.isAirBlock(i2, i3, k2)) {
- while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) {
- --i3;
- }
-
- for (j3 = l1; j3 < l1 + 2; ++j3) {
- k3 = j3 % 2;
- l3 = 1 - k3;
-
- for (i4 = 0; i4 < 4; ++i4) {
- for (j4 = -1; j4 < 4; ++j4) {
- k4 = i2 + (i4 - 1) * k3;
- l4 = i3 + j4;
- i5 = k2 + (i4 - 1) * l3;
-
- if (j4 < 0
- && !this.worldServerInstance.getBlock(k4, l4, i5).getMaterial()
- .isSolid()
- || j4 >= 0 && !this.worldServerInstance.isAirBlock(k4, l4, i5)) {
- continue label222;
- }
- }
- }
-
- d4 = i3 + 0.5D - par1Entity.posY;
- d3 = d1 * d1 + d4 * d4 + d2 * d2;
-
- if (d0 < 0.0D || d3 < d0) {
- d0 = d3;
- l = i2;
- i1 = i3;
- j1 = k2;
- k1 = j3 % 2;
- }
- }
- }
- }
- }
- }
- }
-
- int k5 = l;
- int j2 = i1;
- k2 = j1;
- int l5 = k1 % 2;
- int l2 = 1 - l5;
-
- if (k1 % 4 >= 2) {
- l5 = -l5;
- l2 = -l2;
- }
-
- boolean flag;
-
- if (d0 < 0.0D) {
- if (i1 < 70) {
- i1 = 70;
- }
-
- if (i1 > this.worldServerInstance.getActualHeight() - 10) {
- i1 = this.worldServerInstance.getActualHeight() - 10;
- }
-
- j2 = i1;
-
- for (i3 = -1; i3 <= 1; ++i3) {
- for (j3 = 1; j3 < 3; ++j3) {
- for (k3 = -1; k3 < 3; ++k3) {
- l3 = k5 + (j3 - 1) * l5 + i3 * l2;
- i4 = j2 + k3;
- j4 = k2 + (j3 - 1) * l2 - i3 * l5;
- flag = k3 < 0;
- this.worldServerInstance.setBlock(l3, i4, j4, flag ? Dimension_Everglades.blockPortalFrame : Blocks.air);
- }
- }
- }
- }
-
- for (i3 = 0; i3 < 4; ++i3) {
- for (j3 = 0; j3 < 4; ++j3) {
- for (k3 = -1; k3 < 4; ++k3) {
- l3 = k5 + (j3 - 1) * l5;
- i4 = j2 + k3;
- j4 = k2 + (j3 - 1) * l2;
- flag = j3 == 0 || j3 == 3 || k3 == -1 || k3 == 3;
- this.worldServerInstance.setBlock(l3, i4, j4, flag ? Dimension_Everglades.blockPortalFrame : Dimension_Everglades.portalBlock, 0, 2);
- }
- }
-
- for (j3 = 0; j3 < 4; ++j3) {
- for (k3 = -1; k3 < 4; ++k3) {
- l3 = k5 + (j3 - 1) * l5;
- i4 = j2 + k3;
- j4 = k2 + (j3 - 1) * l2;
- this.worldServerInstance.notifyBlocksOfNeighborChange(l3, i4, j4,
- this.worldServerInstance.getBlock(l3, i4, j4));
- }
- }
- }
-
- return true;
- }
-
- /**
- * called periodically to remove out-of-date portal locations from the
- * cache list. Argument par1 is a WorldServer.getTotalWorldTime() value.
- */
- @Override
- public void removeStalePortalLocations(long par1) {
- if (par1 % 100L == 0L) {
- @SuppressWarnings("rawtypes")
- Iterator iterator = this.destinationCoordinateKeys.iterator();
- long j = par1 - 600L;
-
- while (iterator.hasNext()) {
- Long olong = (Long) iterator.next();
- Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition) this.destinationCoordinateCache
- .getValueByKey(olong.longValue());
-
- if (portalposition == null || portalposition.lastUpdateTime < j) {
- iterator.remove();
- this.destinationCoordinateCache.remove(olong.longValue());
- }
- }
- }
- }
-
- public class PortalPosition extends ChunkCoordinates {
- /**
- * The worldtime at which this PortalPosition was last verified
- */
- public long lastUpdateTime;
-
- public PortalPosition(int par2, int par3, int par4, long par5) {
- super(par2, par3, par4);
- this.lastUpdateTime = par5;
- }
- }
-} \ No newline at end of file
+ private final WorldServer worldServerInstance;
+ /**
+ * A private Random() function in Teleporter
+ */
+ private final Random random;
+ /**
+ * Stores successful portal placement locations for rapid lookup.
+ */
+ private final LongHashMap destinationCoordinateCache = new LongHashMap();
+ /**
+ * A list of valid keys for the destinationCoordainteCache. These are
+ * based on the X & Z of the players initial location.
+ */
+ @SuppressWarnings("rawtypes")
+ private final List destinationCoordinateKeys = new ArrayList();
+
+ public TeleporterDimensionMod(WorldServer par1WorldServer) {
+ super(par1WorldServer);
+ this.worldServerInstance = par1WorldServer;
+ this.random = new Random(par1WorldServer.getSeed());
+ }
+
+ /**
+ * Place an entity in a nearby portal, creating one if necessary.
+ */
+ @Override
+ public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
+ if (this.worldServerInstance.provider.dimensionId != 1) {
+ if (!this.placeInExistingPortal(par1Entity, par2, par4, par6, par8)) {
+ this.makePortal(par1Entity);
+ this.placeInExistingPortal(par1Entity, par2, par4, par6, par8);
+ }
+ } else {
+ int i = MathHelper.floor_double(par1Entity.posX);
+ int j = MathHelper.floor_double(par1Entity.posY) - 1;
+ int k = MathHelper.floor_double(par1Entity.posZ);
+ byte b0 = 1;
+ byte b1 = 0;
+
+ for (int l = -2; l <= 2; ++l) {
+ for (int i1 = -2; i1 <= 2; ++i1) {
+ for (int j1 = -1; j1 < 3; ++j1) {
+ int k1 = i + i1 * b0 + l * b1;
+ int l1 = j + j1;
+ int i2 = k + i1 * b1 - l * b0;
+ boolean flag = j1 < 0;
+ this.worldServerInstance.setBlock(
+ k1, l1, i2, flag ? Dimension_Everglades.blockPortalFrame : Blocks.air);
+ }
+ }
+ }
+
+ par1Entity.setLocationAndAngles(i, j, k, par1Entity.rotationYaw, 0.0F);
+ par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
+ }
+ }
+
+ /**
+ * Place an entity in a nearby portal which already exists.
+ */
+ @Override
+ public boolean placeInExistingPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
+ short short1 = 128;
+ double d3 = -1.0D;
+ int i = 0;
+ int j = 0;
+ int k = 0;
+ int l = MathHelper.floor_double(par1Entity.posX);
+ int i1 = MathHelper.floor_double(par1Entity.posZ);
+ long j1 = ChunkCoordIntPair.chunkXZ2Int(l, i1);
+ boolean flag = true;
+ double d7;
+ int l3;
+
+ if (this.destinationCoordinateCache.containsItem(j1)) {
+ Teleporter.PortalPosition portalposition =
+ (Teleporter.PortalPosition) this.destinationCoordinateCache.getValueByKey(j1);
+ d3 = 0.0D;
+ i = portalposition.posX;
+ j = portalposition.posY;
+ k = portalposition.posZ;
+ portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
+ flag = false;
+ } else {
+ for (l3 = l - short1; l3 <= l + short1; ++l3) {
+ double d4 = l3 + 0.5D - par1Entity.posX;
+
+ for (int l1 = i1 - short1; l1 <= i1 + short1; ++l1) {
+ double d5 = l1 + 0.5D - par1Entity.posZ;
+
+ for (int i2 = this.worldServerInstance.getActualHeight() - 1; i2 >= 0; --i2) {
+ if (this.worldServerInstance.getBlock(l3, i2, l1) == Dimension_Everglades.portalBlock) {
+ while (this.worldServerInstance.getBlock(l3, i2 - 1, l1)
+ == Dimension_Everglades.portalBlock) {
+ --i2;
+ }
+
+ d7 = i2 + 0.5D - par1Entity.posY;
+ double d8 = d4 * d4 + d7 * d7 + d5 * d5;
+
+ if (d3 < 0.0D || d8 < d3) {
+ d3 = d8;
+ i = l3;
+ j = i2;
+ k = l1;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (d3 >= 0.0D) {
+ if (flag) {
+ this.destinationCoordinateCache.add(
+ j1, new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime()));
+ this.destinationCoordinateKeys.add(Long.valueOf(j1));
+ }
+
+ double d11 = i + 0.5D;
+ double d6 = j + 0.5D;
+ d7 = k + 0.5D;
+ int i4 = -1;
+
+ if (this.worldServerInstance.getBlock(i - 1, j, k) == Dimension_Everglades.portalBlock) {
+ i4 = 2;
+ }
+
+ if (this.worldServerInstance.getBlock(i + 1, j, k) == Dimension_Everglades.portalBlock) {
+ i4 = 0;
+ }
+
+ if (this.worldServerInstance.getBlock(i, j, k - 1) == Dimension_Everglades.portalBlock) {
+ i4 = 3;
+ }
+
+ if (this.worldServerInstance.getBlock(i, j, k + 1) == Dimension_Everglades.portalBlock) {
+ i4 = 1;
+ }
+
+ int j2 = par1Entity.getTeleportDirection();
+
+ if (i4 > -1) {
+ int k2 = Direction.rotateLeft[i4];
+ int l2 = Direction.offsetX[i4];
+ int i3 = Direction.offsetZ[i4];
+ int j3 = Direction.offsetX[k2];
+ int k3 = Direction.offsetZ[k2];
+ boolean flag1 = !this.worldServerInstance.isAirBlock(i + l2 + j3, j, k + i3 + k3)
+ || !this.worldServerInstance.isAirBlock(i + l2 + j3, j + 1, k + i3 + k3);
+ boolean flag2 = !this.worldServerInstance.isAirBlock(i + l2, j, k + i3)
+ || !this.worldServerInstance.isAirBlock(i + l2, j + 1, k + i3);
+
+ if (flag1 && flag2) {
+ i4 = Direction.rotateOpposite[i4];
+ k2 = Direction.rotateOpposite[k2];
+ l2 = Direction.offsetX[i4];
+ i3 = Direction.offsetZ[i4];
+ j3 = Direction.offsetX[k2];
+ k3 = Direction.offsetZ[k2];
+ l3 = i - j3;
+ d11 -= j3;
+ int k1 = k - k3;
+ d7 -= k3;
+ flag1 = !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j, k1 + i3 + k3)
+ || !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j + 1, k1 + i3 + k3);
+ flag2 = !this.worldServerInstance.isAirBlock(l3 + l2, j, k1 + i3)
+ || !this.worldServerInstance.isAirBlock(l3 + l2, j + 1, k1 + i3);
+ }
+
+ float f1 = 0.5F;
+ float f2 = 0.5F;
+
+ if (!flag1 && flag2) {
+ f1 = 1.0F;
+ } else if (flag1 && !flag2) {
+ f1 = 0.0F;
+ } else if (flag1 && flag2) {
+ f2 = 0.0F;
+ }
+
+ d11 += j3 * f1 + f2 * l2;
+ d7 += k3 * f1 + f2 * i3;
+ float f3 = 0.0F;
+ float f4 = 0.0F;
+ float f5 = 0.0F;
+ float f6 = 0.0F;
+
+ if (i4 == j2) {
+ f3 = 1.0F;
+ f4 = 1.0F;
+ } else if (i4 == Direction.rotateOpposite[j2]) {
+ f3 = -1.0F;
+ f4 = -1.0F;
+ } else if (i4 == Direction.rotateRight[j2]) {
+ f5 = 1.0F;
+ f6 = -1.0F;
+ } else {
+ f5 = -1.0F;
+ f6 = 1.0F;
+ }
+
+ double d9 = par1Entity.motionX;
+ double d10 = par1Entity.motionZ;
+ par1Entity.motionX = d9 * f3 + d10 * f6;
+ par1Entity.motionZ = d9 * f5 + d10 * f4;
+ par1Entity.rotationYaw = par8 - j2 * 90 + i4 * 90;
+ } else {
+ par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
+ }
+
+ par1Entity.setLocationAndAngles(d11, d6, d7, par1Entity.rotationYaw, par1Entity.rotationPitch);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean makePortal(Entity par1Entity) {
+ byte b0 = 16;
+ double d0 = -1.0D;
+ int i = MathHelper.floor_double(par1Entity.posX);
+ int j = MathHelper.floor_double(par1Entity.posY);
+ int k = MathHelper.floor_double(par1Entity.posZ);
+ int l = i;
+ int i1 = j;
+ int j1 = k;
+ int k1 = 0;
+ int l1 = this.random.nextInt(4);
+ int i2;
+ double d1;
+ double d2;
+ int k2;
+ int i3;
+ int k3;
+ int j3;
+ int i4;
+ int l3;
+ int k4;
+ int j4;
+ int i5;
+ int l4;
+ double d3;
+ double d4;
+
+ for (i2 = i - b0; i2 <= i + b0; ++i2) {
+ d1 = i2 + 0.5D - par1Entity.posX;
+
+ for (k2 = k - b0; k2 <= k + b0; ++k2) {
+ d2 = k2 + 0.5D - par1Entity.posZ;
+ label274:
+ for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) {
+ if (this.worldServerInstance.isAirBlock(i2, i3, k2)) {
+ while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) {
+ --i3;
+ }
+
+ for (j3 = l1; j3 < l1 + 4; ++j3) {
+ k3 = j3 % 2;
+ l3 = 1 - k3;
+
+ if (j3 % 4 >= 2) {
+ k3 = -k3;
+ l3 = -l3;
+ }
+
+ for (i4 = 0; i4 < 3; ++i4) {
+ for (j4 = 0; j4 < 4; ++j4) {
+ for (k4 = -1; k4 < 4; ++k4) {
+ l4 = i2 + (j4 - 1) * k3 + i4 * l3;
+ i5 = i3 + k4;
+ int j5 = k2 + (j4 - 1) * l3 - i4 * k3;
+
+ if (k4 < 0
+ && !this.worldServerInstance
+ .getBlock(l4, i5, j5)
+ .getMaterial()
+ .isSolid()
+ || k4 >= 0 && !this.worldServerInstance.isAirBlock(l4, i5, j5)) {
+ continue label274;
+ }
+ }
+ }
+ }
+
+ d4 = i3 + 0.5D - par1Entity.posY;
+ d3 = d1 * d1 + d4 * d4 + d2 * d2;
+
+ if (d0 < 0.0D || d3 < d0) {
+ d0 = d3;
+ l = i2;
+ i1 = i3;
+ j1 = k2;
+ k1 = j3 % 4;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (d0 < 0.0D) {
+ for (i2 = i - b0; i2 <= i + b0; ++i2) {
+ d1 = i2 + 0.5D - par1Entity.posX;
+
+ for (k2 = k - b0; k2 <= k + b0; ++k2) {
+ d2 = k2 + 0.5D - par1Entity.posZ;
+ label222:
+ for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) {
+ if (this.worldServerInstance.isAirBlock(i2, i3, k2)) {
+ while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) {
+ --i3;
+ }
+
+ for (j3 = l1; j3 < l1 + 2; ++j3) {
+ k3 = j3 % 2;
+ l3 = 1 - k3;
+
+ for (i4 = 0; i4 < 4; ++i4) {
+ for (j4 = -1; j4 < 4; ++j4) {
+ k4 = i2 + (i4 - 1) * k3;
+ l4 = i3 + j4;
+ i5 = k2 + (i4 - 1) * l3;
+
+ if (j4 < 0
+ && !this.worldServerInstance
+ .getBlock(k4, l4, i5)
+ .getMaterial()
+ .isSolid()
+ || j4 >= 0 && !this.worldServerInstance.isAirBlock(k4, l4, i5)) {
+ continue label222;
+ }
+ }
+ }
+
+ d4 = i3 + 0.5D - par1Entity.posY;
+ d3 = d1 * d1 + d4 * d4 + d2 * d2;
+
+ if (d0 < 0.0D || d3 < d0) {
+ d0 = d3;
+ l = i2;
+ i1 = i3;
+ j1 = k2;
+ k1 = j3 % 2;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ int k5 = l;
+ int j2 = i1;
+ k2 = j1;
+ int l5 = k1 % 2;
+ int l2 = 1 - l5;
+
+ if (k1 % 4 >= 2) {
+ l5 = -l5;
+ l2 = -l2;
+ }
+
+ boolean flag;
+
+ if (d0 < 0.0D) {
+ if (i1 < 70) {
+ i1 = 70;
+ }
+
+ if (i1 > this.worldServerInstance.getActualHeight() - 10) {
+ i1 = this.worldServerInstance.getActualHeight() - 10;
+ }
+
+ j2 = i1;
+
+ for (i3 = -1; i3 <= 1; ++i3) {
+ for (j3 = 1; j3 < 3; ++j3) {
+ for (k3 = -1; k3 < 3; ++k3) {
+ l3 = k5 + (j3 - 1) * l5 + i3 * l2;
+ i4 = j2 + k3;
+ j4 = k2 + (j3 - 1) * l2 - i3 * l5;
+ flag = k3 < 0;
+ this.worldServerInstance.setBlock(
+ l3, i4, j4, flag ? Dimension_Everglades.blockPortalFrame : Blocks.air);
+ }
+ }
+ }
+ }
+
+ for (i3 = 0; i3 < 4; ++i3) {
+ for (j3 = 0; j3 < 4; ++j3) {
+ for (k3 = -1; k3 < 4; ++k3) {
+ l3 = k5 + (j3 - 1) * l5;
+ i4 = j2 + k3;
+ j4 = k2 + (j3 - 1) * l2;
+ flag = j3 == 0 || j3 == 3 || k3 == -1 || k3 == 3;
+ this.worldServerInstance.setBlock(
+ l3,
+ i4,
+ j4,
+ flag ? Dimension_Everglades.blockPortalFrame : Dimension_Everglades.portalBlock,
+ 0,
+ 2);
+ }
+ }
+
+ for (j3 = 0; j3 < 4; ++j3) {
+ for (k3 = -1; k3 < 4; ++k3) {
+ l3 = k5 + (j3 - 1) * l5;
+ i4 = j2 + k3;
+ j4 = k2 + (j3 - 1) * l2;
+ this.worldServerInstance.notifyBlocksOfNeighborChange(
+ l3, i4, j4, this.worldServerInstance.getBlock(l3, i4, j4));
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * called periodically to remove out-of-date portal locations from the
+ * cache list. Argument par1 is a WorldServer.getTotalWorldTime() value.
+ */
+ @Override
+ public void removeStalePortalLocations(long par1) {
+ if (par1 % 100L == 0L) {
+ @SuppressWarnings("rawtypes")
+ Iterator iterator = this.destinationCoordinateKeys.iterator();
+ long j = par1 - 600L;
+
+ while (iterator.hasNext()) {
+ Long olong = (Long) iterator.next();
+ Teleporter.PortalPosition portalposition =
+ (Teleporter.PortalPosition) this.destinationCoordinateCache.getValueByKey(olong.longValue());
+
+ if (portalposition == null || portalposition.lastUpdateTime < j) {
+ iterator.remove();
+ this.destinationCoordinateCache.remove(olong.longValue());
+ }
+ }
+ }
+ }
+
+ public class PortalPosition extends ChunkCoordinates {
+ /**
+ * The worldtime at which this PortalPosition was last verified
+ */
+ public long lastUpdateTime;
+
+ public PortalPosition(int par2, int par3, int par4, long par5) {
+ super(par2, par3, par4);
+ this.lastUpdateTime = par5;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java b/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
index fc1b2ac425..7618885d08 100644
--- a/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
+++ b/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
@@ -1,12 +1,11 @@
package gtPlusPlus.everglades.world;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.everglades.biome.GenLayerEverglades;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.util.ReportedException;
@@ -19,245 +18,240 @@ import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
-import gtPlusPlus.everglades.biome.GenLayerEverglades;
-
public class WorldChunkManagerCustom extends WorldChunkManager {
- private GenLayer genBiomes;
- /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
- private GenLayer biomeIndexLayer;
- /** The BiomeCache object for this world. */
- private BiomeCache biomeCache;
- /** A list of biomes that the player can spawn in. */
- private List<BiomeGenBase> biomesToSpawnIn;
-
- @SuppressWarnings({ "rawtypes" })
- public WorldChunkManagerCustom() {
- this.biomeCache = new BiomeCache(this);
- this.biomesToSpawnIn = new ArrayList();
- this.biomesToSpawnIn.addAll(allowedBiomes); // TODO
- }
-
- public WorldChunkManagerCustom(long seed, WorldType worldType) {
- this();
- // i changed this to my GenLayerDarkWorld
- GenLayer[] agenlayer = GenLayerEverglades.makeTheWorld(seed, worldType);
-
- agenlayer = getModdedBiomeGenerators(worldType, seed, agenlayer);
- this.genBiomes = agenlayer[0];
- this.biomeIndexLayer = agenlayer[1];
-
- }
-
- public WorldChunkManagerCustom(World world) {
- this(world.getSeed(), world.getWorldInfo().getTerrainType());
-
- }
-
- /**
- * Gets the list of valid biomes for the player to spawn in.
- */
- @Override
- public List<BiomeGenBase> getBiomesToSpawnIn() {
- return this.biomesToSpawnIn;
- }
-
- /**
- * Returns a list of rainfall values for the specified blocks. Args:
- * listToReuse, x, z, width, length.
- */
- @Override
- public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length) {
- IntCache.resetIntCache();
-
- if (listToReuse == null || listToReuse.length < width * length) {
- listToReuse = new float[width * length];
- }
-
- int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);
-
- for (int i1 = 0; i1 < width * length; ++i1) {
- try {
- float f = BiomeGenBase.getBiome(aint[i1]).getIntRainfall() / 65536.0F;
-
- if (f > 1.0F) {
- f = 1.0F;
- }
-
- listToReuse[i1] = f;
- }
- catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
- CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock");
- crashreportcategory.addCrashSection("biome id", Integer.valueOf(i1));
- crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(listToReuse.length));
- crashreportcategory.addCrashSection("x", Integer.valueOf(x));
- crashreportcategory.addCrashSection("z", Integer.valueOf(z));
- crashreportcategory.addCrashSection("w", Integer.valueOf(width));
- crashreportcategory.addCrashSection("h", Integer.valueOf(length));
- throw new ReportedException(crashreport);
- }
- }
-
- return listToReuse;
- }
-
- /**
- * Return an adjusted version of a given temperature based on the y
- * height
- */
- @Override
- @SideOnly(Side.CLIENT)
- public float getTemperatureAtHeight(float par1, int par2) {
- return par1;
- }
-
- /**
- * Returns an array of biomes for the location input.
- */
- @Override
- public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) {
- IntCache.resetIntCache();
-
- if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5) {
- par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
- }
-
- int[] aint = this.genBiomes.getInts(par2, par3, par4, par5);
-
- try {
- for (int i = 0; i < par4 * par5; ++i) {
- par1ArrayOfBiomeGenBase[i] = BiomeGenBase.getBiome(aint[i]);
- }
-
- return par1ArrayOfBiomeGenBase;
- }
- catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
- CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
- crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(par1ArrayOfBiomeGenBase.length));
- crashreportcategory.addCrashSection("x", Integer.valueOf(par2));
- crashreportcategory.addCrashSection("z", Integer.valueOf(par3));
- crashreportcategory.addCrashSection("w", Integer.valueOf(par4));
- crashreportcategory.addCrashSection("h", Integer.valueOf(par5));
- throw new ReportedException(crashreport);
- }
- }
-
- /**
- * Returns biomes to use for the blocks and loads the other data like
- * temperature and humidity onto the WorldChunkManager Args:
- * oldBiomeList, x, z, width, depth
- */
- @Override
- public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth) {
- return this.getBiomeGenAt(oldBiomeList, x, z, width, depth, true);
- }
-
- /**
- * Return a list of biomes for the specified blocks. Args: listToReuse,
- * x, y, width, length, cacheFlag (if false, don't check biomeCache to
- * avoid infinite loop in BiomeCacheBlock)
- */
- @Override
- public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] listToReuse, int x, int y, int width, int length, boolean cacheFlag) {
- IntCache.resetIntCache();
-
- if (listToReuse == null || listToReuse.length < width * length) {
- listToReuse = new BiomeGenBase[width * length];
- }
-
- if (cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (y & 15) == 0) {
- BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(x, y);
- System.arraycopy(abiomegenbase1, 0, listToReuse, 0, width * length);
- return listToReuse;
- }
- else {
- int[] aint = this.biomeIndexLayer.getInts(x, y, width, length);
-
- for (int i = 0; i < width * length; ++i) {
- listToReuse[i] = BiomeGenBase.getBiome(aint[i]);
- }
- return listToReuse;
- }
- }
-
- /**
- * checks given Chunk's Biomes against List of allowed ones
- */
- @Override
- @SuppressWarnings("rawtypes")
- public boolean areBiomesViable(int x, int y, int z, List par4List) {
- IntCache.resetIntCache();
- int l = x - z >> 2;
- int i1 = y - z >> 2;
- int j1 = x + z >> 2;
- int k1 = y + z >> 2;
- int l1 = j1 - l + 1;
- int i2 = k1 - i1 + 1;
- int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
-
- try {
- for (int j2 = 0; j2 < l1 * i2; ++j2) {
- BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[j2]);
-
- if (!par4List.contains(biomegenbase)) {
- return false;
- }
- }
-
- return true;
- }
- catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
- CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer");
- crashreportcategory.addCrashSection("Layer", this.genBiomes.toString());
- crashreportcategory.addCrashSection("x", Integer.valueOf(x));
- crashreportcategory.addCrashSection("z", Integer.valueOf(y));
- crashreportcategory.addCrashSection("radius", Integer.valueOf(z));
- crashreportcategory.addCrashSection("allowed", par4List);
- throw new ReportedException(crashreport);
- }
- }
-
- /**
- * Finds a valid position within a range, that is in one of the listed
- * biomes. Searches {par1,par2} +-par3 blocks. Strongly favors positive
- * y positions.
- */
- @Override
- @SuppressWarnings("rawtypes")
- public ChunkPosition findBiomePosition(int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, Random p_150795_5_) {
- IntCache.resetIntCache();
- int l = p_150795_1_ - p_150795_3_ >> 2;
- int i1 = p_150795_2_ - p_150795_3_ >> 2;
- int j1 = p_150795_1_ + p_150795_3_ >> 2;
- int k1 = p_150795_2_ + p_150795_3_ >> 2;
- int l1 = j1 - l + 1;
- int i2 = k1 - i1 + 1;
- int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
- ChunkPosition chunkposition = null;
- int j2 = 0;
-
- for (int k2 = 0; k2 < l1 * i2; ++k2) {
- int l2 = l + k2 % l1 << 2;
- int i3 = i1 + k2 / l1 << 2;
- BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[k2]);
-
- if (p_150795_4_.contains(biomegenbase) && (chunkposition == null || p_150795_5_.nextInt(j2 + 1) == 0)) {
- chunkposition = new ChunkPosition(l2, 0, i3);
- ++j2;
- }
- }
-
- return chunkposition;
- }
-
- /**
- * Calls the WorldChunkManager's biomeCache.cleanupCache()
- */
- @Override
- public void cleanupCache() {
- this.biomeCache.cleanupCache();
- }
-} \ No newline at end of file
+ private GenLayer genBiomes;
+ /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
+ private GenLayer biomeIndexLayer;
+ /** The BiomeCache object for this world. */
+ private BiomeCache biomeCache;
+ /** A list of biomes that the player can spawn in. */
+ private List<BiomeGenBase> biomesToSpawnIn;
+
+ @SuppressWarnings({"rawtypes"})
+ public WorldChunkManagerCustom() {
+ this.biomeCache = new BiomeCache(this);
+ this.biomesToSpawnIn = new ArrayList();
+ this.biomesToSpawnIn.addAll(allowedBiomes); // TODO
+ }
+
+ public WorldChunkManagerCustom(long seed, WorldType worldType) {
+ this();
+ // i changed this to my GenLayerDarkWorld
+ GenLayer[] agenlayer = GenLayerEverglades.makeTheWorld(seed, worldType);
+
+ agenlayer = getModdedBiomeGenerators(worldType, seed, agenlayer);
+ this.genBiomes = agenlayer[0];
+ this.biomeIndexLayer = agenlayer[1];
+ }
+
+ public WorldChunkManagerCustom(World world) {
+ this(world.getSeed(), world.getWorldInfo().getTerrainType());
+ }
+
+ /**
+ * Gets the list of valid biomes for the player to spawn in.
+ */
+ @Override
+ public List<BiomeGenBase> getBiomesToSpawnIn() {
+ return this.biomesToSpawnIn;
+ }
+
+ /**
+ * Returns a list of rainfall values for the specified blocks. Args:
+ * listToReuse, x, z, width, length.
+ */
+ @Override
+ public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length) {
+ IntCache.resetIntCache();
+
+ if (listToReuse == null || listToReuse.length < width * length) {
+ listToReuse = new float[width * length];
+ }
+
+ int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);
+
+ for (int i1 = 0; i1 < width * length; ++i1) {
+ try {
+ float f = BiomeGenBase.getBiome(aint[i1]).getIntRainfall() / 65536.0F;
+
+ if (f > 1.0F) {
+ f = 1.0F;
+ }
+
+ listToReuse[i1] = f;
+ } catch (Throwable throwable) {
+ CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
+ CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock");
+ crashreportcategory.addCrashSection("biome id", Integer.valueOf(i1));
+ crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(listToReuse.length));
+ crashreportcategory.addCrashSection("x", Integer.valueOf(x));
+ crashreportcategory.addCrashSection("z", Integer.valueOf(z));
+ crashreportcategory.addCrashSection("w", Integer.valueOf(width));
+ crashreportcategory.addCrashSection("h", Integer.valueOf(length));
+ throw new ReportedException(crashreport);
+ }
+ }
+
+ return listToReuse;
+ }
+
+ /**
+ * Return an adjusted version of a given temperature based on the y
+ * height
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public float getTemperatureAtHeight(float par1, int par2) {
+ return par1;
+ }
+
+ /**
+ * Returns an array of biomes for the location input.
+ */
+ @Override
+ public BiomeGenBase[] getBiomesForGeneration(
+ BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) {
+ IntCache.resetIntCache();
+
+ if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5) {
+ par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
+ }
+
+ int[] aint = this.genBiomes.getInts(par2, par3, par4, par5);
+
+ try {
+ for (int i = 0; i < par4 * par5; ++i) {
+ par1ArrayOfBiomeGenBase[i] = BiomeGenBase.getBiome(aint[i]);
+ }
+
+ return par1ArrayOfBiomeGenBase;
+ } catch (Throwable throwable) {
+ CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
+ CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
+ crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(par1ArrayOfBiomeGenBase.length));
+ crashreportcategory.addCrashSection("x", Integer.valueOf(par2));
+ crashreportcategory.addCrashSection("z", Integer.valueOf(par3));
+ crashreportcategory.addCrashSection("w", Integer.valueOf(par4));
+ crashreportcategory.addCrashSection("h", Integer.valueOf(par5));
+ throw new ReportedException(crashreport);
+ }
+ }
+
+ /**
+ * Returns biomes to use for the blocks and loads the other data like
+ * temperature and humidity onto the WorldChunkManager Args:
+ * oldBiomeList, x, z, width, depth
+ */
+ @Override
+ public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth) {
+ return this.getBiomeGenAt(oldBiomeList, x, z, width, depth, true);
+ }
+
+ /**
+ * Return a list of biomes for the specified blocks. Args: listToReuse,
+ * x, y, width, length, cacheFlag (if false, don't check biomeCache to
+ * avoid infinite loop in BiomeCacheBlock)
+ */
+ @Override
+ public BiomeGenBase[] getBiomeGenAt(
+ BiomeGenBase[] listToReuse, int x, int y, int width, int length, boolean cacheFlag) {
+ IntCache.resetIntCache();
+
+ if (listToReuse == null || listToReuse.length < width * length) {
+ listToReuse = new BiomeGenBase[width * length];
+ }
+
+ if (cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (y & 15) == 0) {
+ BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(x, y);
+ System.arraycopy(abiomegenbase1, 0, listToReuse, 0, width * length);
+ return listToReuse;
+ } else {
+ int[] aint = this.biomeIndexLayer.getInts(x, y, width, length);
+
+ for (int i = 0; i < width * length; ++i) {
+ listToReuse[i] = BiomeGenBase.getBiome(aint[i]);
+ }
+ return listToReuse;
+ }
+ }
+
+ /**
+ * checks given Chunk's Biomes against List of allowed ones
+ */
+ @Override
+ @SuppressWarnings("rawtypes")
+ public boolean areBiomesViable(int x, int y, int z, List par4List) {
+ IntCache.resetIntCache();
+ int l = x - z >> 2;
+ int i1 = y - z >> 2;
+ int j1 = x + z >> 2;
+ int k1 = y + z >> 2;
+ int l1 = j1 - l + 1;
+ int i2 = k1 - i1 + 1;
+ int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
+
+ try {
+ for (int j2 = 0; j2 < l1 * i2; ++j2) {
+ BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[j2]);
+
+ if (!par4List.contains(biomegenbase)) {
+ return false;
+ }
+ }
+
+ return true;
+ } catch (Throwable throwable) {
+ CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
+ CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer");
+ crashreportcategory.addCrashSection("Layer", this.genBiomes.toString());
+ crashreportcategory.addCrashSection("x", Integer.valueOf(x));
+ crashreportcategory.addCrashSection("z", Integer.valueOf(y));
+ crashreportcategory.addCrashSection("radius", Integer.valueOf(z));
+ crashreportcategory.addCrashSection("allowed", par4List);
+ throw new ReportedException(crashreport);
+ }
+ }
+
+ /**
+ * Finds a valid position within a range, that is in one of the listed
+ * biomes. Searches {par1,par2} +-par3 blocks. Strongly favors positive
+ * y positions.
+ */
+ @Override
+ @SuppressWarnings("rawtypes")
+ public ChunkPosition findBiomePosition(
+ int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, Random p_150795_5_) {
+ IntCache.resetIntCache();
+ int l = p_150795_1_ - p_150795_3_ >> 2;
+ int i1 = p_150795_2_ - p_150795_3_ >> 2;
+ int j1 = p_150795_1_ + p_150795_3_ >> 2;
+ int k1 = p_150795_2_ + p_150795_3_ >> 2;
+ int l1 = j1 - l + 1;
+ int i2 = k1 - i1 + 1;
+ int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
+ ChunkPosition chunkposition = null;
+ int j2 = 0;
+
+ for (int k2 = 0; k2 < l1 * i2; ++k2) {
+ int l2 = l + k2 % l1 << 2;
+ int i3 = i1 + k2 / l1 << 2;
+ BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[k2]);
+
+ if (p_150795_4_.contains(biomegenbase) && (chunkposition == null || p_150795_5_.nextInt(j2 + 1) == 0)) {
+ chunkposition = new ChunkPosition(l2, 0, i3);
+ ++j2;
+ }
+ }
+
+ return chunkposition;
+ }
+
+ /**
+ * Calls the WorldChunkManager's biomeCache.cleanupCache()
+ */
+ @Override
+ public void cleanupCache() {
+ this.biomeCache.cleanupCache();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/everglades/world/WorldProviderMod.java b/src/main/java/gtPlusPlus/everglades/world/WorldProviderMod.java
index b5945bcd21..1bd026af72 100644
--- a/src/main/java/gtPlusPlus/everglades/world/WorldProviderMod.java
+++ b/src/main/java/gtPlusPlus/everglades/world/WorldProviderMod.java
@@ -2,70 +2,67 @@ package gtPlusPlus.everglades.world;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.everglades.chunk.ChunkProviderModded;
+import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import net.minecraft.util.Vec3;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldType;
import net.minecraft.world.chunk.IChunkProvider;
-import gtPlusPlus.everglades.chunk.ChunkProviderModded;
-import gtPlusPlus.everglades.dimension.Dimension_Everglades;
-
public class WorldProviderMod extends WorldProvider {
- @Override
- public void registerWorldChunkManager() {
- this.worldChunkMgr = new WorldChunkManagerCustom(this.worldObj.getSeed(), WorldType.AMPLIFIED);
- this.isHellWorld = false;
- this.hasNoSky = false;
- this.dimensionId = Dimension_Everglades.DIMID;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public Vec3 getFogColor(float par1, float par2) {
- return Vec3.createVectorHelper(0.01568627450980392D, 0.09019607843137255D, 0.0D);
- }
+ @Override
+ public void registerWorldChunkManager() {
+ this.worldChunkMgr = new WorldChunkManagerCustom(this.worldObj.getSeed(), WorldType.AMPLIFIED);
+ this.isHellWorld = false;
+ this.hasNoSky = false;
+ this.dimensionId = Dimension_Everglades.DIMID;
+ }
- @Override
- public IChunkProvider createChunkGenerator() {
- return new ChunkProviderModded(this.worldObj, this.worldObj.getSeed() - 1278);
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Vec3 getFogColor(float par1, float par2) {
+ return Vec3.createVectorHelper(0.01568627450980392D, 0.09019607843137255D, 0.0D);
+ }
- @Override
- public boolean isSurfaceWorld() {
- return true;
- }
+ @Override
+ public IChunkProvider createChunkGenerator() {
+ return new ChunkProviderModded(this.worldObj, this.worldObj.getSeed() - 1278);
+ }
- @Override
- public boolean canCoordinateBeSpawn(int par1, int par2) {
- return false;
- }
+ @Override
+ public boolean isSurfaceWorld() {
+ return true;
+ }
- @Override
- public boolean canRespawnHere() {
- return true;
- }
+ @Override
+ public boolean canCoordinateBeSpawn(int par1, int par2) {
+ return false;
+ }
- @Override
- public float getSunBrightness(float par1) {
- return (par1*2F);
- }
+ @Override
+ public boolean canRespawnHere() {
+ return true;
+ }
- @Override
- public float getStarBrightness(float par1) {
- return (par1*5F);
- }
+ @Override
+ public float getSunBrightness(float par1) {
+ return (par1 * 2F);
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public boolean doesXZShowFog(int par1, int par2) {
- return true;
- }
+ @Override
+ public float getStarBrightness(float par1) {
+ return (par1 * 5F);
+ }
- @Override
- public String getDimensionName() {
- return "dimensionDarkWorld";
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean doesXZShowFog(int par1, int par2) {
+ return true;
+ }
-} \ No newline at end of file
+ @Override
+ public String getDimensionName() {
+ return "dimensionDarkWorld";
+ }
+}
diff --git a/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java
index 04d1a201a5..e84b7a1d03 100644
--- a/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java
+++ b/src/main/java/gtPlusPlus/nei/DecayableRecipeHandler.java
@@ -1,10 +1,5 @@
package gtPlusPlus.nei;
-import java.awt.Rectangle;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
@@ -16,6 +11,10 @@ import gtPlusPlus.core.item.materials.DustDecayable;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.VanillaColours;
import gtPlusPlus.nei.handlers.NeiTextureHandler;
+import java.awt.Rectangle;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
@@ -23,242 +22,238 @@ import net.minecraft.util.StatCollector;
public class DecayableRecipeHandler extends TemplateRecipeHandler {
- public static final String mNEIName = "Decayables";
-
- public String getRecipeName() {
- return StatCollector.translateToLocal("GTPP.container.decaychest.name");
- }
-
- public String getGuiTexture() {
- return CORE.MODID + ":textures/gui/nei/decayables.png";
- }
-
- public Class<? extends GuiContainer> getGuiClass() {
- return GUI_DecayablesChest.class;
- }
-
- public String getOverlayIdentifier() {
- return "GTPP_Decayables";
- }
-
- public int recipiesPerPage() {
- return 1;
- }
-
- public void loadTransferRects() {
- this.transferRects.add(new RecipeTransferRect(new Rectangle(6, 3, 16, 16), getOverlayIdentifier(), new Object[0]));
- }
-
- public void loadCraftingRecipes(ItemStack result) {
- if (result == null || (!DustDecayable.class.isInstance(result.getItem())
- && !BaseItemDustUnique.class.isInstance(result.getItem()))) {
- return;
- }
- if (result != null) {
- //Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result));
- }
- final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
- for (final DecayableRecipe recipe : recipes) {
- if (recipe.isValid()) {
- final ItemStack input = recipe.mInput.copy();
- final ItemStack output = recipe.mOutput.copy();
- if (!GT_Utility.areStacksEqual(result, output, true)) {
- continue;
- }
- //Logger.INFO("Showing Usage result for "+ItemUtils.getItemName(result));
- final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
- this.arecipes.add(rec);
- sort();
- }
- }
- }
-
- public void loadCraftingRecipes(String outputId, Object... results) {
- if (outputId.equals(getOverlayIdentifier()) && this.getClass() == DecayableRecipeHandler.class) {
- final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
- for (final DecayableRecipe recipe : recipes) {
- if (recipe.isValid()) {
- final ItemStack input = recipe.mInput.copy();
- final ItemStack output = recipe.mOutput.copy();
- final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
- this.arecipes.add(rec);
- sort();
- }
- }
- } else {
- super.loadCraftingRecipes(outputId, results);
- }
- }
-
- public void loadUsageRecipes(ItemStack ingredient) {
- final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
- if (ingredient != null) {
- //Logger.INFO("Looking up Usage results for "+ItemUtils.getItemName(ingredient));
- }
- for (final DecayableRecipe recipe : recipes) {
- if (recipe.isValid()) {
- final ItemStack input = recipe.mInput.copy();
- final ItemStack output = recipe.mOutput.copy();
- if (!GT_Utility.areStacksEqual(ingredient, input, true)) {
- continue;
- }
- //Logger.INFO("Showing up Usage results for "+ItemUtils.getItemName(ingredient));
- final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
- //rec.setIngredientPermutation((Collection) rec.input, ingredient);
- this.arecipes.add(rec);
- sort();
- }
- }
- }
-
- private final void sort() {
- List<DecayableRecipeNEI> g = new ArrayList<DecayableRecipeNEI>();
- for (CachedRecipe u : arecipes) {
- g.add((DecayableRecipeNEI) u);
- }
- if (g != null && !g.isEmpty()) {
- Collections.sort(g);
- }
- }
-
- public void drawExtras(int recipeIndex) {
- DecayableRecipeNEI recipe = (DecayableRecipeNEI) this.arecipes.get(recipeIndex);
-
- //GuiDraw.drawStringC(I18n.format("GTPP.container.decaychest.result", new Object[]{}), 43, 10, 8421504, false);
-
- int cost = recipe.time;
- if (cost > 0) {
-
- // NEI Strings
- String s = I18n.format("GTPP.nei.info", new Object[] { cost });
- String s0 = I18n.format("GTPP.nei.timetaken", new Object[] { cost });
-
- // Time Strings
- String s1 = I18n.format("GTPP.time.ticks", new Object[] { cost });
- String s2 = I18n.format("GTPP.time.seconds", new Object[] { cost });
- String s3 = I18n.format("GTPP.time.minutes", new Object[] { cost });
- String s4 = I18n.format("GTPP.time.hours", new Object[] { cost });
- String s5 = I18n.format("GTPP.time.days", new Object[] { cost });
- String s6 = I18n.format("GTPP.time.months", new Object[] { cost });
- int y = 20;
-
- int secs = cost / 20;
- int mins = secs / 60;
- int hours = mins / 60;
- int days = hours / 24;
- int months = days / 30;
-
- String suffix;
- int formattedTime;
- if (cost <= 20) {
- suffix = s1;
- formattedTime = cost;
- } else if (cost <= (20 * 60)) {
- suffix = s2;
- formattedTime = secs;
- } else if (cost <= (20 * 60 * 60)) {
- suffix = s3;
- formattedTime = mins;
- } else if (cost <= (20 * 60 * 60 * 24)) {
- suffix = s4;
- formattedTime = hours;
- } else if (cost < (20 * 60 * 60 * 24 * 30)) {
- suffix = s5;
- formattedTime = days;
- } else if (cost <= (20 * 60 * 60 * 24 * 30)) {
- suffix = s6;
- formattedTime = months;
- } else {
- suffix = s1;
- formattedTime = cost;
- }
-
- int x = 5;
- GuiDraw.drawString(s, x, 25, VanillaColours.DYE_BLACK.getAsInt(), false);
- GuiDraw.drawString(s0, x, 40, VanillaColours.DYE_BLACK.getAsInt(), false);
-
- GuiDraw.drawString(suffix, x + 16, y + 30, VanillaColours.DYE_BLACK.getAsInt(), false);
-
- //Values
- GuiDraw.drawString(("" + formattedTime), x, y + 30, VanillaColours.DYE_GREEN.getAsInt(), false);
-
- if (hours > 1) {
- int aLeftoverMinutes = (cost - (hours * (20 * 60 * 60)));
- if (aLeftoverMinutes > 0) {
- int secs2 = aLeftoverMinutes / 20;
- int mins2 = secs2 / 60;
- GuiDraw.drawString(s3, x + 16, y + 42, VanillaColours.DYE_BLACK.getAsInt(), false);
- GuiDraw.drawString(("" + mins2), x, y + 42, VanillaColours.DYE_GREEN.getAsInt(), false);
-
- }
-
- }
-
- }
-
- NeiTextureHandler.RECIPE_BUTTON.renderIcon(6.0D, 3.0D, 16.0D, 16.0D, 0.0D, true);
- }
-
- public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe implements Comparable<CachedRecipe> {
- private PositionedStack input;
- private PositionedStack output;
- public int time;
-
- @Override
- public PositionedStack getIngredient() {
- return this.input;
- }
-
- public PositionedStack getResult() {
- return this.output;
- }
-
- public DecayableRecipeNEI(final ItemStack input, final ItemStack result, final int time) {
- super();
- this.input = new PositionedStack(input, 93, 24);
- this.output = new PositionedStack(result, 142, 42);
- this.time = time;
- }
-
- @Override
- public int compareTo(CachedRecipe o) {
- boolean b = DecayableRecipeNEI.class.isInstance(o);
- if (b) {
- DecayableRecipeNEI p = (DecayableRecipeNEI) o;
- if (p.time > this.time) {
- return 1;
- } else if (p.time == this.time) {
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj != null) {
- if (DecayableRecipeNEI.class.isInstance(obj)) {
- DecayableRecipeNEI p = (DecayableRecipeNEI) obj;
- if (p != null) {
- // Time check first to keep it simple and not unbox the Recipes.
- if (p.time == this.time) {
- ItemStack aInput = p.input.item;
- ItemStack aOutput = p.output.item;
- if (GT_Utility.areStacksEqual(aInput, this.input.item, true)) {
- if (GT_Utility.areStacksEqual(aOutput, this.output.item, true)) {
- return true;
- }
- }
- }
- }
-
- }
- }
- return false;
- }
-
-
- }
-} \ No newline at end of file
+ public static final String mNEIName = "Decayables";
+
+ public String getRecipeName() {
+ return StatCollector.translateToLocal("GTPP.container.decaychest.name");
+ }
+
+ public String getGuiTexture() {
+ return CORE.MODID + ":textures/gui/nei/decayables.png";
+ }
+
+ public Class<? extends GuiContainer> getGuiClass() {
+ return GUI_DecayablesChest.class;
+ }
+
+ public String getOverlayIdentifier() {
+ return "GTPP_Decayables";
+ }
+
+ public int recipiesPerPage() {
+ return 1;
+ }
+
+ public void loadTransferRects() {
+ this.transferRects.add(
+ new RecipeTransferRect(new Rectangle(6, 3, 16, 16), getOverlayIdentifier(), new Object[0]));
+ }
+
+ public void loadCraftingRecipes(ItemStack result) {
+ if (result == null
+ || (!DustDecayable.class.isInstance(result.getItem())
+ && !BaseItemDustUnique.class.isInstance(result.getItem()))) {
+ return;
+ }
+ if (result != null) {
+ // Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result));
+ }
+ final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
+ for (final DecayableRecipe recipe : recipes) {
+ if (recipe.isValid()) {
+ final ItemStack input = recipe.mInput.copy();
+ final ItemStack output = recipe.mOutput.copy();
+ if (!GT_Utility.areStacksEqual(result, output, true)) {
+ continue;
+ }
+ // Logger.INFO("Showing Usage result for "+ItemUtils.getItemName(result));
+ final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
+ this.arecipes.add(rec);
+ sort();
+ }
+ }
+ }
+
+ public void loadCraftingRecipes(String outputId, Object... results) {
+ if (outputId.equals(getOverlayIdentifier()) && this.getClass() == DecayableRecipeHandler.class) {
+ final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
+ for (final DecayableRecipe recipe : recipes) {
+ if (recipe.isValid()) {
+ final ItemStack input = recipe.mInput.copy();
+ final ItemStack output = recipe.mOutput.copy();
+ final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
+ this.arecipes.add(rec);
+ sort();
+ }
+ }
+ } else {
+ super.loadCraftingRecipes(outputId, results);
+ }
+ }
+
+ public void loadUsageRecipes(ItemStack ingredient) {
+ final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
+ if (ingredient != null) {
+ // Logger.INFO("Looking up Usage results for "+ItemUtils.getItemName(ingredient));
+ }
+ for (final DecayableRecipe recipe : recipes) {
+ if (recipe.isValid()) {
+ final ItemStack input = recipe.mInput.copy();
+ final ItemStack output = recipe.mOutput.copy();
+ if (!GT_Utility.areStacksEqual(ingredient, input, true)) {
+ continue;
+ }
+ // Logger.INFO("Showing up Usage results for "+ItemUtils.getItemName(ingredient));
+ final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
+ // rec.setIngredientPermutation((Collection) rec.input, ingredient);
+ this.arecipes.add(rec);
+ sort();
+ }
+ }
+ }
+
+ private final void sort() {
+ List<DecayableRecipeNEI> g = new ArrayList<DecayableRecipeNEI>();
+ for (CachedRecipe u : arecipes) {
+ g.add((DecayableRecipeNEI) u);
+ }
+ if (g != null && !g.isEmpty()) {
+ Collections.sort(g);
+ }
+ }
+
+ public void drawExtras(int recipeIndex) {
+ DecayableRecipeNEI recipe = (DecayableRecipeNEI) this.arecipes.get(recipeIndex);
+
+ // GuiDraw.drawStringC(I18n.format("GTPP.container.decaychest.result", new Object[]{}), 43, 10, 8421504, false);
+
+ int cost = recipe.time;
+ if (cost > 0) {
+
+ // NEI Strings
+ String s = I18n.format("GTPP.nei.info", new Object[] {cost});
+ String s0 = I18n.format("GTPP.nei.timetaken", new Object[] {cost});
+
+ // Time Strings
+ String s1 = I18n.format("GTPP.time.ticks", new Object[] {cost});
+ String s2 = I18n.format("GTPP.time.seconds", new Object[] {cost});
+ String s3 = I18n.format("GTPP.time.minutes", new Object[] {cost});
+ String s4 = I18n.format("GTPP.time.hours", new Object[] {cost});
+ String s5 = I18n.format("GTPP.time.days", new Object[] {cost});
+ String s6 = I18n.format("GTPP.time.months", new Object[] {cost});
+ int y = 20;
+
+ int secs = cost / 20;
+ int mins = secs / 60;
+ int hours = mins / 60;
+ int days = hours / 24;
+ int months = days / 30;
+
+ String suffix;
+ int formattedTime;
+ if (cost <= 20) {
+ suffix = s1;
+ formattedTime = cost;
+ } else if (cost <= (20 * 60)) {
+ suffix = s2;
+ formattedTime = secs;
+ } else if (cost <= (20 * 60 * 60)) {
+ suffix = s3;
+ formattedTime = mins;
+ } else if (cost <= (20 * 60 * 60 * 24)) {
+ suffix = s4;
+ formattedTime = hours;
+ } else if (cost < (20 * 60 * 60 * 24 * 30)) {
+ suffix = s5;
+ formattedTime = days;
+ } else if (cost <= (20 * 60 * 60 * 24 * 30)) {
+ suffix = s6;
+ formattedTime = months;
+ } else {
+ suffix = s1;
+ formattedTime = cost;
+ }
+
+ int x = 5;
+ GuiDraw.drawString(s, x, 25, VanillaColours.DYE_BLACK.getAsInt(), false);
+ GuiDraw.drawString(s0, x, 40, VanillaColours.DYE_BLACK.getAsInt(), false);
+
+ GuiDraw.drawString(suffix, x + 16, y + 30, VanillaColours.DYE_BLACK.getAsInt(), false);
+
+ // Values
+ GuiDraw.drawString(("" + formattedTime), x, y + 30, VanillaColours.DYE_GREEN.getAsInt(), false);
+
+ if (hours > 1) {
+ int aLeftoverMinutes = (cost - (hours * (20 * 60 * 60)));
+ if (aLeftoverMinutes > 0) {
+ int secs2 = aLeftoverMinutes / 20;
+ int mins2 = secs2 / 60;
+ GuiDraw.drawString(s3, x + 16, y + 42, VanillaColours.DYE_BLACK.getAsInt(), false);
+ GuiDraw.drawString(("" + mins2), x, y + 42, VanillaColours.DYE_GREEN.getAsInt(), false);
+ }
+ }
+ }
+
+ NeiTextureHandler.RECIPE_BUTTON.renderIcon(6.0D, 3.0D, 16.0D, 16.0D, 0.0D, true);
+ }
+
+ public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe implements Comparable<CachedRecipe> {
+ private PositionedStack input;
+ private PositionedStack output;
+ public int time;
+
+ @Override
+ public PositionedStack getIngredient() {
+ return this.input;
+ }
+
+ public PositionedStack getResult() {
+ return this.output;
+ }
+
+ public DecayableRecipeNEI(final ItemStack input, final ItemStack result, final int time) {
+ super();
+ this.input = new PositionedStack(input, 93, 24);
+ this.output = new PositionedStack(result, 142, 42);
+ this.time = time;
+ }
+
+ @Override
+ public int compareTo(CachedRecipe o) {
+ boolean b = DecayableRecipeNEI.class.isInstance(o);
+ if (b) {
+ DecayableRecipeNEI p = (DecayableRecipeNEI) o;
+ if (p.time > this.time) {
+ return 1;
+ } else if (p.time == this.time) {
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj != null) {
+ if (DecayableRecipeNEI.class.isInstance(obj)) {
+ DecayableRecipeNEI p = (DecayableRecipeNEI) obj;
+ if (p != null) {
+ // Time check first to keep it simple and not unbox the Recipes.
+ if (p.time == this.time) {
+ ItemStack aInput = p.input.item;
+ ItemStack aOutput = p.output.item;
+ if (GT_Utility.areStacksEqual(aInput, this.input.item, true)) {
+ if (GT_Utility.areStacksEqual(aOutput, this.output.item, true)) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
index 27dce789ae..f080a0bf44 100644
--- a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
+++ b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
@@ -1,57 +1,61 @@
package gtPlusPlus.nei;
-import java.util.*;
-
-import gregtech.nei.GT_NEI_DefaultHandler;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.*;
import cpw.mods.fml.common.event.FMLInterModComms;
import gregtech.api.enums.GT_Values;
import gregtech.api.util.*;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.nei.GT_NEI_DefaultHandler;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.*;
import net.minecraft.item.ItemStack;
public class GTPP_NEI_DefaultHandler extends GT_NEI_DefaultHandler {
- public GTPP_NEI_DefaultHandler(final GT_Recipe_Map tMap) {
- super(tMap);
- if (!NEI_GT_Config.sIsAdded) {
- FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
- GuiCraftingRecipe.craftinghandlers.add(this);
- GuiUsageRecipe.usagehandlers.add(this);
- }
- }
+ public GTPP_NEI_DefaultHandler(final GT_Recipe_Map tMap) {
+ super(tMap);
+ if (!NEI_GT_Config.sIsAdded) {
+ FMLInterModComms.sendRuntimeMessage(
+ GT_Values.GT,
+ "NEIPlugins",
+ "register-crafting-handler",
+ "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
+ GuiCraftingRecipe.craftinghandlers.add(this);
+ GuiUsageRecipe.usagehandlers.add(this);
+ }
+ }
- @Override
- public TemplateRecipeHandler newInstance() {
- return new GTPP_NEI_DefaultHandler(this.mRecipeMap);
- }
+ @Override
+ public TemplateRecipeHandler newInstance() {
+ return new GTPP_NEI_DefaultHandler(this.mRecipeMap);
+ }
- @Override
- public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack aStack, List<String> currenttip, int aRecipeIndex) {
- super.handleItemTooltip(gui, aStack, currenttip, aRecipeIndex);
- CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
- if (tObject instanceof CachedDefaultRecipe) {
- CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
- for (PositionedStack tStack : tRecipe.mOutputs) {
- // no-op
- }
- for (PositionedStack tStack : tRecipe.mInputs) {
- if (aStack == tStack.item) {
- if (ItemUtils.isMillingBall(aStack)) {
- currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process"));
- currenttip.add("Does not always get consumed in the process");
- }
- if (ItemUtils.isCatalyst(aStack)) {
- currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process"));
- currenttip.add("Does not always get consumed in the process");
- currenttip.add("Higher tier pipe casings allow this item to last longer");
- }
- }
- }
- }
+ @Override
+ public List<String> handleItemTooltip(
+ GuiRecipe<?> gui, ItemStack aStack, List<String> currenttip, int aRecipeIndex) {
+ super.handleItemTooltip(gui, aStack, currenttip, aRecipeIndex);
+ CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
+ if (tObject instanceof CachedDefaultRecipe) {
+ CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
+ for (PositionedStack tStack : tRecipe.mOutputs) {
+ // no-op
+ }
+ for (PositionedStack tStack : tRecipe.mInputs) {
+ if (aStack == tStack.item) {
+ if (ItemUtils.isMillingBall(aStack)) {
+ currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process"));
+ currenttip.add("Does not always get consumed in the process");
+ }
+ if (ItemUtils.isCatalyst(aStack)) {
+ currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process"));
+ currenttip.add("Does not always get consumed in the process");
+ currenttip.add("Higher tier pipe casings allow this item to last longer");
+ }
+ }
+ }
+ }
- return currenttip;
- }
+ return currenttip;
+ }
}
diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
index 2ea0121ed9..0a04e0abf7 100644
--- a/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
+++ b/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
@@ -5,42 +5,37 @@ import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map;
public class GT_NEI_FluidReactor extends GTPP_NEI_DefaultHandler {
- public GT_NEI_FluidReactor() {
- super(GTPP_Recipe_Map.sChemicalPlantRecipes);
- }
+ public GT_NEI_FluidReactor() {
+ super(GTPP_Recipe_Map.sChemicalPlantRecipes);
+ }
- @Override
- public TemplateRecipeHandler newInstance() {
- return new GT_NEI_FluidReactor();
- }
+ @Override
+ public TemplateRecipeHandler newInstance() {
+ return new GT_NEI_FluidReactor();
+ }
- @Override
- protected String getSpecialInfo(int specialValue) {
- String aTierMaterial = " - ";
- if (specialValue <= 0) {
- aTierMaterial += "Bronze";
- }
- else if (specialValue == 1) {
- aTierMaterial += "Steel";
- }
- else if (specialValue == 2) {
- aTierMaterial += "Aluminium";
- }
- else if (specialValue == 3) {
- aTierMaterial += "Stainless Steel";
- }
- else if (specialValue == 4) {
- aTierMaterial += "Titanium";
- }
- else if (specialValue == 5) {
- aTierMaterial += "Tungsten Steel";
- }
- else if (specialValue == 6) {
- aTierMaterial += "Laurenium";
- }
- else if (specialValue == 7) {
- aTierMaterial += "Botmium";
- }
- return this.mRecipeMap.mNEISpecialValuePre + (specialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + aTierMaterial;
- }
+ @Override
+ protected String getSpecialInfo(int specialValue) {
+ String aTierMaterial = " - ";
+ if (specialValue <= 0) {
+ aTierMaterial += "Bronze";
+ } else if (specialValue == 1) {
+ aTierMaterial += "Steel";
+ } else if (specialValue == 2) {
+ aTierMaterial += "Aluminium";
+ } else if (specialValue == 3) {
+ aTierMaterial += "Stainless Steel";
+ } else if (specialValue == 4) {
+ aTierMaterial += "Titanium";
+ } else if (specialValue == 5) {
+ aTierMaterial += "Tungsten Steel";
+ } else if (specialValue == 6) {
+ aTierMaterial += "Laurenium";
+ } else if (specialValue == 7) {
+ aTierMaterial += "Botmium";
+ }
+ return this.mRecipeMap.mNEISpecialValuePre
+ + (specialValue * this.mRecipeMap.mNEISpecialValueMultiplier)
+ + aTierMaterial;
+ }
}
diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java
index 82f6299bbb..f0555906eb 100644
--- a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java
+++ b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java
@@ -6,22 +6,34 @@ import gtPlusPlus.core.util.math.MathUtils;
public class GT_NEI_LFTR extends GT_NEI_MultiNoCell {
- public GT_NEI_LFTR() {
- super(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes);
- }
-
- @Override
- public TemplateRecipeHandler newInstance() {
- return new GT_NEI_LFTR();
- }
+ public GT_NEI_LFTR() {
+ super(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes);
+ }
- @Override
- public void drawExtras(final int aRecipeIndex) {
- final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
- final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
- drawText(10, 83, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216);
- drawText(10, 93, this.mRecipeMap.mNEISpecialValuePre + MathUtils.formatNumbers((((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier)) + this.mRecipeMap.mNEISpecialValuePost, -16777216);
- drawText(10, 103, "Dynamo: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216);
- drawText(10, 113, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt * 4)) + " EU", -16777216);
- }
+ @Override
+ public TemplateRecipeHandler newInstance() {
+ return new GT_NEI_LFTR();
+ }
+
+ @Override
+ public void drawExtras(final int aRecipeIndex) {
+ final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
+ final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
+ drawText(
+ 10,
+ 83,
+ "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs",
+ -16777216);
+ drawText(
+ 10,
+ 93,
+ this.mRecipeMap.mNEISpecialValuePre
+ + MathUtils.formatNumbers(
+ (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue
+ * this.mRecipeMap.mNEISpecialValueMultiplier))
+ + this.mRecipeMap.mNEISpecialValuePost,
+ -16777216);
+ drawText(10, 103, "Dynamo: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216);
+ drawText(10, 113, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt * 4)) + " EU", -16777216);
+ }
}
diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java
index c534335b3d..62d2a26cf5 100644
--- a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java
+++ b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java
@@ -1,14 +1,5 @@
package gtPlusPlus.nei;
-import java.awt.Rectangle;
-import java.lang.ref.SoftReference;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import org.lwjgl.opengl.GL11;
-
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.GuiCraftingRecipe;
@@ -26,70 +17,87 @@ import gregtech.api.util.GasSpargingRecipe;
import gregtech.api.util.GasSpargingRecipeMap;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.awt.Rectangle;
+import java.lang.ref.SoftReference;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.stream.Collectors;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
+import org.lwjgl.opengl.GL11;
public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler {
- public static final String mNEIName = GasSpargingRecipeMap.mNEIDisplayName;
+ public static final String mNEIName = GasSpargingRecipeMap.mNEIDisplayName;
private SoftReference<List<GasSpargingRecipeNEI>> mCachedRecipes = null;
- public GT_NEI_LFTR_Sparging() {
- this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier(), new Object[0]));
- if (!NEI_GT_Config.sIsAdded) {
- FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
- GuiCraftingRecipe.craftinghandlers.add(this);
- GuiUsageRecipe.usagehandlers.add(this);
- }
- }
-
- public String getRecipeName() {
- return mNEIName;
- }
-
- public String getGuiTexture() {
- return GasSpargingRecipeMap.mNEIGUIPath;
- }
-
- public String getOverlayIdentifier() {
- return gregtech.api.util.GasSpargingRecipeMap.mUnlocalizedName;
- }
-
- public int recipiesPerPage() {
- return 1;
- }
-
- @Override
- public void drawBackground(final int recipe) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- GuiDraw.changeTexture(this.getGuiTexture());
- GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 68);
- }
-
- public void loadTransferRects() {
- this.transferRects.add(new RecipeTransferRect(new Rectangle(72, 14, 22, 16), getOverlayIdentifier(), new Object[0]));
- }
-
+ public GT_NEI_LFTR_Sparging() {
+ this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
+ new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier(), new Object[0]));
+ if (!NEI_GT_Config.sIsAdded) {
+ FMLInterModComms.sendRuntimeMessage(
+ GT_Values.GT,
+ "NEIPlugins",
+ "register-crafting-handler",
+ "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
+ GuiCraftingRecipe.craftinghandlers.add(this);
+ GuiUsageRecipe.usagehandlers.add(this);
+ }
+ }
+
+ public String getRecipeName() {
+ return mNEIName;
+ }
+
+ public String getGuiTexture() {
+ return GasSpargingRecipeMap.mNEIGUIPath;
+ }
+
+ public String getOverlayIdentifier() {
+ return gregtech.api.util.GasSpargingRecipeMap.mUnlocalizedName;
+ }
+
+ public int recipiesPerPage() {
+ return 1;
+ }
+
+ @Override
+ public void drawBackground(final int recipe) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GuiDraw.changeTexture(this.getGuiTexture());
+ GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 68);
+ }
+
+ public void loadTransferRects() {
+ this.transferRects.add(
+ new RecipeTransferRect(new Rectangle(72, 14, 22, 16), getOverlayIdentifier(), new Object[0]));
+ }
+
public List<GasSpargingRecipeNEI> getCache() {
List<GasSpargingRecipeNEI> cache;
if (mCachedRecipes == null || (cache = mCachedRecipes.get()) == null) {
- cache = GasSpargingRecipeMap.mRecipes.stream() // do not use parallel stream. This is already parallelized by NEI
- .sorted()
- .map(temp -> {return createCachedRecipe(temp);})
- .collect(Collectors.toList());
+ cache =
+ GasSpargingRecipeMap.mRecipes
+ .stream() // do not use parallel stream. This is already parallelized by NEI
+ .sorted()
+ .map(temp -> {
+ return createCachedRecipe(temp);
+ })
+ .collect(Collectors.toList());
// while the NEI parallelize handlers, for each individual handler it still uses sequential execution model
// so we do not need any synchronization here
mCachedRecipes = new SoftReference<>(cache);
}
return cache;
}
-
+
public GasSpargingRecipeNEI createCachedRecipe(GasSpargingRecipe aRecipe) {
- return new GasSpargingRecipeNEI(aRecipe);
+ return new GasSpargingRecipeNEI(aRecipe);
}
-
+
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals(getOverlayIdentifier())) {
arecipes.addAll(getCache());
@@ -104,7 +112,9 @@ public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler {
ArrayList<ItemStack> tResults = new ArrayList<>();
tResults.add(aResult);
tResults.add(GT_OreDictUnificator.get(true, aResult));
- if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
+ if ((tPrefixMaterial != null)
+ && (!tPrefixMaterial.mBlackListed)
+ && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L));
}
@@ -114,14 +124,12 @@ public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler {
if (tFluid != null) {
tFluidStack = tFluid;
tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false));
- }
- else tFluidStack = GT_Utility.getFluidFromDisplayStack(aResult);
+ } else tFluidStack = GT_Utility.getFluidFromDisplayStack(aResult);
if (tFluidStack != null) {
tResults.addAll(GT_Utility.getContainersFromFluid(tFluidStack));
}
for (GasSpargingRecipeNEI recipe : getCache()) {
- if (tResults.stream().anyMatch(stack -> recipe.contains(recipe.mOutputs, stack)))
- arecipes.add(recipe);
+ if (tResults.stream().anyMatch(stack -> recipe.contains(recipe.mOutputs, stack))) arecipes.add(recipe);
}
}
@@ -141,237 +149,320 @@ public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler {
if (tFluid != null) {
tFluidStack = tFluid;
tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false));
- }
- else tFluidStack = GT_Utility.getFluidFromDisplayStack(aInput);
+ } else tFluidStack = GT_Utility.getFluidFromDisplayStack(aInput);
if (tFluidStack != null) {
tInputs.addAll(GT_Utility.getContainersFromFluid(tFluidStack));
}
for (GasSpargingRecipeNEI recipe : getCache()) {
- if (tInputs.stream().anyMatch(stack -> recipe.contains(recipe.mInputs, stack)))
- arecipes.add(recipe);
+ if (tInputs.stream().anyMatch(stack -> recipe.contains(recipe.mInputs, stack))) arecipes.add(recipe);
+ }
+ }
+
+ protected static void drawText(int aX, int aY, String aString, int aColor) {
+ Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor);
+ }
+
+ public void drawExtras(int aRecipeIndex) {
+ final long tEUt = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
+ final long tDuration = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
+ drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216);
+ drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216);
+ drawText(
+ 10,
+ 93,
+ "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs",
+ -16777216);
+ drawText(10, 103, "Gas not used to sparge is", -16777216);
+ drawText(10, 113, "returned alongside outputs.", -16777216);
+ }
+
+ @Override
+ public List<String> handleItemTooltip(
+ final GuiRecipe<?> gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) {
+ final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
+ if ((tObject instanceof GasSpargingRecipeNEI)) {
+ final GasSpargingRecipeNEI tRecipe = (GasSpargingRecipeNEI) tObject;
+ ItemStack aSpargeInput = tRecipe.mOutputs.get(0).item;
+ ItemStack aSpentFuel = tRecipe.mOutputs.get(1).item;
+ for (final PositionedStack tStack : tRecipe.mOutputs) {
+ if (aStack == tStack.item) {
+ if (ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) {
+ if (GT_Utility.areStacksEqual(aStack, aSpentFuel, true)) {
+ break;
+ }
+ if (GT_Utility.areStacksEqual(aStack, aSpargeInput, true)) {
+ currenttip.add("The amount returned is the remainder after all other outputs.");
+ }
+ currenttip.add("Maximum Output: " + (((FixedPositionedStack) tStack).mChance / 100) + "."
+ + ((((FixedPositionedStack) tStack).mChance % 100) < 10
+ ? "0" + (((FixedPositionedStack) tStack).mChance % 100)
+ : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100))
+ + "L");
+ break;
+ }
+ break;
+ }
+ }
+ for (final PositionedStack tStack : tRecipe.mInputs) {
+ if (GT_Utility.areStacksEqual(aStack, tStack.item)) {
+ if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true))
+ || (tStack.item.stackSize != 0)) {
+ break;
+ }
+ if (ItemUtils.isControlCircuit(aStack)) {
+ currenttip.add("Does not get consumed in the process");
+ }
+ break;
+ }
+ }
+ }
+ return currenttip;
+ }
+
+ public class FixedPositionedStack extends PositionedStack {
+ public final int mChance;
+ public boolean permutated = false;
+
+ public FixedPositionedStack(final Object object, final int x, final int y) {
+ this(object, x, y, 0);
+ }
+
+ public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) {
+ super(object, x, y, true);
+ this.mChance = aChance;
+ }
+
+ @Override
+ public void generatePermutations() {
+ if (this.permutated) {
+ return;
+ }
+ final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>();
+ for (final ItemStack tStack : this.items) {
+ if (GT_Utility.isStackValid(tStack)) {
+ if (tStack.getItemDamage() == 32767) {
+ final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem());
+ if (!permutations.isEmpty()) {
+ ItemStack stack;
+ for (final Iterator<ItemStack> i$ = permutations.iterator();
+ i$.hasNext();
+ tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[] {stack}))) {
+ stack = i$.next();
+ }
+ } else {
+ final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize);
+ base.stackTagCompound = tStack.stackTagCompound;
+ tDisplayStacks.add(base);
+ }
+ } else {
+ tDisplayStacks.add(GT_Utility.copy(new Object[] {tStack}));
+ }
+ }
+ }
+ this.items = (tDisplayStacks.toArray(new ItemStack[0]));
+ if (this.items.length == 0) {
+ this.items = new ItemStack[] {new ItemStack(Blocks.fire)};
+ }
+ this.permutated = true;
+ this.setPermutationToRender(0);
}
}
- protected static void drawText(int aX, int aY, String aString, int aColor) {
- Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor);
- }
-
- public void drawExtras(int aRecipeIndex) {
- final long tEUt = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
- final long tDuration = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
- drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216);
- drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216);
- drawText(10, 93, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216);
- drawText(10, 103, "Gas not used to sparge is", -16777216);
- drawText(10, 113, "returned alongside outputs.", -16777216);
- }
-
- @Override
- public List<String> handleItemTooltip(final GuiRecipe<?> gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) {
- final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
- if ((tObject instanceof GasSpargingRecipeNEI)) {
- final GasSpargingRecipeNEI tRecipe = (GasSpargingRecipeNEI) tObject;
- ItemStack aSpargeInput = tRecipe.mOutputs.get(0).item;
- ItemStack aSpentFuel = tRecipe.mOutputs.get(1).item;
- for (final PositionedStack tStack : tRecipe.mOutputs) {
- if (aStack == tStack.item) {
- if (ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) {
- if (GT_Utility.areStacksEqual(aStack, aSpentFuel, true)) {
- break;
- }
- if (GT_Utility.areStacksEqual(aStack, aSpargeInput, true)) {
- currenttip.add("The amount returned is the remainder after all other outputs.");
- }
- currenttip.add("Maximum Output: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "L");
- break;
- }
- break;
- }
- }
- for (final PositionedStack tStack : tRecipe.mInputs) {
- if (GT_Utility.areStacksEqual(aStack, tStack.item)) {
- if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) ||
- (tStack.item.stackSize != 0)) {
- break;
- }
- if (ItemUtils.isControlCircuit(aStack)) {
- currenttip.add("Does not get consumed in the process");
- }
- break;
- }
- }
- }
- return currenttip;
- }
-
- public class FixedPositionedStack
- extends PositionedStack {
- public final int mChance;
- public boolean permutated = false;
-
- public FixedPositionedStack(final Object object, final int x, final int y) {
- this(object, x, y, 0);
- }
-
- public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) {
- super(object, x, y, true);
- this.mChance = aChance;
- }
-
- @Override
- public void generatePermutations() {
- if (this.permutated) {
- return;
- }
- final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>();
- for (final ItemStack tStack : this.items) {
- if (GT_Utility.isStackValid(tStack)) {
- if (tStack.getItemDamage() == 32767) {
- final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem());
- if (!permutations.isEmpty()) {
- ItemStack stack;
- for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) {
- stack = i$.next();
- }
- } else {
- final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize);
- base.stackTagCompound = tStack.stackTagCompound;
- tDisplayStacks.add(base);
- }
- } else {
- tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack}));
- }
- }
- }
- this.items = (tDisplayStacks.toArray(new ItemStack[0]));
- if (this.items.length == 0) {
- this.items = new ItemStack[]{new ItemStack(Blocks.fire)};
- }
- this.permutated = true;
- this.setPermutationToRender(0);
- }
- }
-
- public class GasSpargingRecipeNEI extends CachedRecipe implements Comparable<CachedRecipe> {
-
- public final GasSpargingRecipe mRecipe;
- public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>();
- public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>();
-
- public GasSpargingRecipeNEI(GasSpargingRecipe tRecipe) {
- super();
- this.mRecipe = tRecipe;
- int tStartIndex = 0;
- if (tRecipe.mFluidInputs.length > 0) {
- if ((tRecipe.mFluidInputs[0] != null) && (tRecipe.mFluidInputs[0].getFluid() != null)) {
- this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[0], true), 30, 5));
- }
- if ((tRecipe.mFluidInputs.length > 1) && (tRecipe.mFluidInputs[1] != null) && (tRecipe.mFluidInputs[1].getFluid() != null)) {
- this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[1], true), 12, 5));
- }
- if ((tRecipe.mFluidInputs.length > 2) && (tRecipe.mFluidInputs[2] != null) && (tRecipe.mFluidInputs[2].getFluid() != null)) {
- this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[2], true), 48, 5));
- }
- if ((tRecipe.mFluidInputs.length > 3) && (tRecipe.mFluidInputs[3] != null) && (tRecipe.mFluidInputs[3].getFluid() != null)) {
- this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[3], true), 12, 23));
- }
- if ((tRecipe.mFluidInputs.length > 4) && (tRecipe.mFluidInputs[4] != null) && (tRecipe.mFluidInputs[4].getFluid() != null)) {
- this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[4], true), 30, 23));
- }
- if ((tRecipe.mFluidInputs.length > 5) && (tRecipe.mFluidInputs[5] != null) && (tRecipe.mFluidInputs[5].getFluid() != null)) {
- this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[5], true), 48, 23));
- }
- if ((tRecipe.mFluidInputs.length > 6) && (tRecipe.mFluidInputs[6] != null) && (tRecipe.mFluidInputs[6].getFluid() != null)) {
- this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[6], true), 12, 41));
- }
- if ((tRecipe.mFluidInputs.length > 7) && (tRecipe.mFluidInputs[7] != null) && (tRecipe.mFluidInputs[7].getFluid() != null)) {
- this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[7], true), 30, 41));
- }
- if ((tRecipe.mFluidInputs.length > 8) && (tRecipe.mFluidInputs[8] != null) && (tRecipe.mFluidInputs[8].getFluid() != null)) {
- this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[8], true), 48, 41));
- }
- }
-
- tStartIndex = 0;
- if (tRecipe.mFluidOutputs.length > 0) {
- if ((tRecipe.mFluidOutputs[0] != null) && (tRecipe.mFluidOutputs[0].getFluid() != null)) {
- this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[0], false), 120, 5, tRecipe.getMaxOutput(tStartIndex++)));
- }
- if ((tRecipe.mFluidOutputs.length > 1) && (tRecipe.mFluidOutputs[1] != null) && (tRecipe.mFluidOutputs[1].getFluid() != null)) {
- this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[1], true), 102, 5, tRecipe.getMaxOutput(tStartIndex++)));
- }
- if ((tRecipe.mFluidOutputs.length > 2) && (tRecipe.mFluidOutputs[2] != null) && (tRecipe.mFluidOutputs[2].getFluid() != null)) {
- this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[2], false), 138, 5, tRecipe.getMaxOutput(tStartIndex++)));
- }
- if ((tRecipe.mFluidOutputs.length > 3) && (tRecipe.mFluidOutputs[3] != null) && (tRecipe.mFluidOutputs[3].getFluid() != null)) {
- this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[3], false), 102, 23, tRecipe.getMaxOutput(tStartIndex++)));
- }
- if ((tRecipe.mFluidOutputs.length > 4) && (tRecipe.mFluidOutputs[4] != null) && (tRecipe.mFluidOutputs[4].getFluid() != null)) {
- this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[4], false), 120, 23, tRecipe.getMaxOutput(tStartIndex++)));
- }
- if ((tRecipe.mFluidOutputs.length > 5) && (tRecipe.mFluidOutputs[5] != null) && (tRecipe.mFluidOutputs[5].getFluid() != null)) {
- this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[5], false), 138, 23, tRecipe.getMaxOutput(tStartIndex++)));
- }
- if ((tRecipe.mFluidOutputs.length > 6) && (tRecipe.mFluidOutputs[6] != null) && (tRecipe.mFluidOutputs[6].getFluid() != null)) {
- this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[6], false), 102, 41, tRecipe.getMaxOutput(tStartIndex++)));
- }
- if ((tRecipe.mFluidOutputs.length > 7) && (tRecipe.mFluidOutputs[7] != null) && (tRecipe.mFluidOutputs[7].getFluid() != null)) {
- this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[7], false), 120, 41, tRecipe.getMaxOutput(tStartIndex++)));
- }
- if ((tRecipe.mFluidOutputs.length > 8) && (tRecipe.mFluidOutputs[8] != null) && (tRecipe.mFluidOutputs[8].getFluid() != null)) {
- this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[8], false), 138, 41, tRecipe.getMaxOutput(tStartIndex++)));
- }
- }
- }
-
- @Override
- public int compareTo(CachedRecipe o) {
- boolean b = GasSpargingRecipeNEI.class.isInstance(o);
- if (b) {
- GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) o;
- if (p.mOutputs.size() > this.mOutputs.size()) {
- return 1;
- } else if (p.mOutputs.size() == this.mOutputs.size()) {
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj != null) {
- if (GasSpargingRecipeNEI.class.isInstance(obj)) {
- GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) obj;
- if (p != null) {
- if (GT_Utility.areStacksEqual(p.mInputs.get(0).item, this.mInputs.get(0).item, true)) {
- if (p.mOutputs.size() == this.mOutputs.size()) {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- @Override
- public List<PositionedStack> getIngredients() {
- return this.getCycledIngredients(GT_NEI_LFTR_Sparging.this.cycleticks / 10, this.mInputs);
- }
-
- @Override
- public PositionedStack getResult() {
- return null;
- }
-
- @Override
- public List<PositionedStack> getOtherStacks() {
- return this.mOutputs;
- }
-
-
- }
+ public class GasSpargingRecipeNEI extends CachedRecipe implements Comparable<CachedRecipe> {
+
+ public final GasSpargingRecipe mRecipe;
+ public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>();
+ public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>();
+
+ public GasSpargingRecipeNEI(GasSpargingRecipe tRecipe) {
+ super();
+ this.mRecipe = tRecipe;
+ int tStartIndex = 0;
+ if (tRecipe.mFluidInputs.length > 0) {
+ if ((tRecipe.mFluidInputs[0] != null) && (tRecipe.mFluidInputs[0].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[0], true), 30, 5));
+ }
+ if ((tRecipe.mFluidInputs.length > 1)
+ && (tRecipe.mFluidInputs[1] != null)
+ && (tRecipe.mFluidInputs[1].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[1], true), 12, 5));
+ }
+ if ((tRecipe.mFluidInputs.length > 2)
+ && (tRecipe.mFluidInputs[2] != null)
+ && (tRecipe.mFluidInputs[2].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[2], true), 48, 5));
+ }
+ if ((tRecipe.mFluidInputs.length > 3)
+ && (tRecipe.mFluidInputs[3] != null)
+ && (tRecipe.mFluidInputs[3].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[3], true), 12, 23));
+ }
+ if ((tRecipe.mFluidInputs.length > 4)
+ && (tRecipe.mFluidInputs[4] != null)
+ && (tRecipe.mFluidInputs[4].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[4], true), 30, 23));
+ }
+ if ((tRecipe.mFluidInputs.length > 5)
+ && (tRecipe.mFluidInputs[5] != null)
+ && (tRecipe.mFluidInputs[5].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[5], true), 48, 23));
+ }
+ if ((tRecipe.mFluidInputs.length > 6)
+ && (tRecipe.mFluidInputs[6] != null)
+ && (tRecipe.mFluidInputs[6].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[6], true), 12, 41));
+ }
+ if ((tRecipe.mFluidInputs.length > 7)
+ && (tRecipe.mFluidInputs[7] != null)
+ && (tRecipe.mFluidInputs[7].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[7], true), 30, 41));
+ }
+ if ((tRecipe.mFluidInputs.length > 8)
+ && (tRecipe.mFluidInputs[8] != null)
+ && (tRecipe.mFluidInputs[8].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[8], true), 48, 41));
+ }
+ }
+
+ tStartIndex = 0;
+ if (tRecipe.mFluidOutputs.length > 0) {
+ if ((tRecipe.mFluidOutputs[0] != null) && (tRecipe.mFluidOutputs[0].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[0], false),
+ 120,
+ 5,
+ tRecipe.getMaxOutput(tStartIndex++)));
+ }
+ if ((tRecipe.mFluidOutputs.length > 1)
+ && (tRecipe.mFluidOutputs[1] != null)
+ && (tRecipe.mFluidOutputs[1].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[1], true),
+ 102,
+ 5,
+ tRecipe.getMaxOutput(tStartIndex++)));
+ }
+ if ((tRecipe.mFluidOutputs.length > 2)
+ && (tRecipe.mFluidOutputs[2] != null)
+ && (tRecipe.mFluidOutputs[2].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[2], false),
+ 138,
+ 5,
+ tRecipe.getMaxOutput(tStartIndex++)));
+ }
+ if ((tRecipe.mFluidOutputs.length > 3)
+ && (tRecipe.mFluidOutputs[3] != null)
+ && (tRecipe.mFluidOutputs[3].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[3], false),
+ 102,
+ 23,
+ tRecipe.getMaxOutput(tStartIndex++)));
+ }
+ if ((tRecipe.mFluidOutputs.length > 4)
+ && (tRecipe.mFluidOutputs[4] != null)
+ && (tRecipe.mFluidOutputs[4].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[4], false),
+ 120,
+ 23,
+ tRecipe.getMaxOutput(tStartIndex++)));
+ }
+ if ((tRecipe.mFluidOutputs.length > 5)
+ && (tRecipe.mFluidOutputs[5] != null)
+ && (tRecipe.mFluidOutputs[5].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[5], false),
+ 138,
+ 23,
+ tRecipe.getMaxOutput(tStartIndex++)));
+ }
+ if ((tRecipe.mFluidOutputs.length > 6)
+ && (tRecipe.mFluidOutputs[6] != null)
+ && (tRecipe.mFluidOutputs[6].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[6], false),
+ 102,
+ 41,
+ tRecipe.getMaxOutput(tStartIndex++)));
+ }
+ if ((tRecipe.mFluidOutputs.length > 7)
+ && (tRecipe.mFluidOutputs[7] != null)
+ && (tRecipe.mFluidOutputs[7].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[7], false),
+ 120,
+ 41,
+ tRecipe.getMaxOutput(tStartIndex++)));
+ }
+ if ((tRecipe.mFluidOutputs.length > 8)
+ && (tRecipe.mFluidOutputs[8] != null)
+ && (tRecipe.mFluidOutputs[8].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(
+ GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[8], false),
+ 138,
+ 41,
+ tRecipe.getMaxOutput(tStartIndex++)));
+ }
+ }
+ }
+
+ @Override
+ public int compareTo(CachedRecipe o) {
+ boolean b = GasSpargingRecipeNEI.class.isInstance(o);
+ if (b) {
+ GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) o;
+ if (p.mOutputs.size() > this.mOutputs.size()) {
+ return 1;
+ } else if (p.mOutputs.size() == this.mOutputs.size()) {
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj != null) {
+ if (GasSpargingRecipeNEI.class.isInstance(obj)) {
+ GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) obj;
+ if (p != null) {
+ if (GT_Utility.areStacksEqual(p.mInputs.get(0).item, this.mInputs.get(0).item, true)) {
+ if (p.mOutputs.size() == this.mOutputs.size()) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public List<PositionedStack> getIngredients() {
+ return this.getCycledIngredients(GT_NEI_LFTR_Sparging.this.cycleticks / 10, this.mInputs);
+ }
+
+ @Override
+ public PositionedStack getResult() {
+ return null;
+ }
+
+ @Override
+ public List<PositionedStack> getOtherStacks() {
+ return this.mOutputs;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java
index 26d11e1803..074371c8f3 100644
--- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java
+++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java
@@ -1,34 +1,33 @@
package gtPlusPlus.nei;
-import org.lwjgl.opengl.GL11;
-
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.recipe.TemplateRecipeHandler;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import org.lwjgl.opengl.GL11;
/**
* Used for larger GUI ("basicmachines/FissionFuel")
*/
public class GT_NEI_MultiNoCell extends GTPP_NEI_DefaultHandler {
- public GT_NEI_MultiNoCell(GT_Recipe_Map aMap) {
- super(aMap);
- }
+ public GT_NEI_MultiNoCell(GT_Recipe_Map aMap) {
+ super(aMap);
+ }
- @Override
- public TemplateRecipeHandler newInstance() {
- return new GT_NEI_MultiNoCell(mRecipeMap);
- }
+ @Override
+ public TemplateRecipeHandler newInstance() {
+ return new GT_NEI_MultiNoCell(mRecipeMap);
+ }
- @Override
- public void drawBackground(final int recipe) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- GuiDraw.changeTexture(this.getGuiTexture());
- GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 89);
- }
+ @Override
+ public void drawBackground(final int recipe) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GuiDraw.changeTexture(this.getGuiTexture());
+ GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 89);
+ }
- @Override
- protected int getDescriptionYOffset() {
- return 85;
- }
+ @Override
+ protected int getDescriptionYOffset() {
+ return 85;
+ }
}
diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java
index 8ea1dec802..9dadd870d1 100644
--- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java
+++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java
@@ -6,24 +6,27 @@ import gtPlusPlus.core.util.math.MathUtils;
public class GT_NEI_MultiSolarTower extends GT_NEI_MultiNoCell {
- public GT_NEI_MultiSolarTower(GT_Recipe_Map aMap) {
- super(aMap);
- }
+ public GT_NEI_MultiSolarTower(GT_Recipe_Map aMap) {
+ super(aMap);
+ }
- @Override
- public TemplateRecipeHandler newInstance() {
- return new GT_NEI_MultiSolarTower(mRecipeMap);
- }
+ @Override
+ public TemplateRecipeHandler newInstance() {
+ return new GT_NEI_MultiSolarTower(mRecipeMap);
+ }
- @Override
- public void drawExtras(final int aRecipeIndex) {
- final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
- if (tDuration > 0) {
- drawText(10, 90, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216);
- }
- drawText(5, 100, "Solar Heater rings boost tier", -16777216);
- drawText(5, 110, "R1:T1, R2:T2, R3:T4, R4:T8, R5:T16", -16777216);
- drawText(5, 120, "Input Amount = 1000 x T", -16777216);
- }
-
+ @Override
+ public void drawExtras(final int aRecipeIndex) {
+ final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
+ if (tDuration > 0) {
+ drawText(
+ 10,
+ 90,
+ "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs",
+ -16777216);
+ }
+ drawText(5, 100, "Solar Heater rings boost tier", -16777216);
+ drawText(5, 110, "R1:T1, R2:T2, R3:T4, R4:T8, R5:T16", -16777216);
+ drawText(5, 120, "Input Amount = 1000 x T", -16777216);
+ }
}
diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java
index ea175f4ddb..5617237044 100644
--- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java
+++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java
@@ -1,51 +1,54 @@
package gtPlusPlus.nei;
-import java.util.List;
-
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.GuiRecipe;
import codechicken.nei.recipe.TemplateRecipeHandler;
import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map;
import gtPlusPlus.core.item.ModItems;
+import java.util.List;
import net.minecraft.item.ItemStack;
public class GT_NEI_MultiTreeGrowthSimulator extends GT_NEI_MultiNoCell {
-
- public GT_NEI_MultiTreeGrowthSimulator() {
- super(GTPP_Recipe_Map.sTreeSimFakeRecipes);
- }
- @Override
- public TemplateRecipeHandler newInstance() {
- return new GT_NEI_MultiTreeGrowthSimulator();
- }
+ public GT_NEI_MultiTreeGrowthSimulator() {
+ super(GTPP_Recipe_Map.sTreeSimFakeRecipes);
+ }
+
+ @Override
+ public TemplateRecipeHandler newInstance() {
+ return new GT_NEI_MultiTreeGrowthSimulator();
+ }
+
+ @Override
+ public void drawExtras(final int aRecipeIndex) {
+ if (ModItems.fluidFertBasic != null) {
+ drawText(5, 90, "Chance of Sapling output if", -16777216);
+ drawText(5, 100, "" + ModItems.fluidFertBasic.getLocalizedName() + " is provided.", -16777216);
+ drawText(5, 110, "This is optional.", -16777216);
+ }
+ }
- @Override
- public void drawExtras(final int aRecipeIndex) {
- if (ModItems.fluidFertBasic != null) {
- drawText(5, 90, "Chance of Sapling output if", -16777216);
- drawText(5, 100, ""+ModItems.fluidFertBasic.getLocalizedName()+" is provided.", -16777216);
- drawText(5, 110, "This is optional.", -16777216);
- }
- }
-
- @Override
- public List<String> handleItemTooltip(final GuiRecipe<?> gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) {
- final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
- if (tObject instanceof CachedDefaultRecipe) {
- final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
- for (final PositionedStack tStack : tRecipe.mOutputs) {
- if (aStack == tStack.item) {
- if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) {
- break;
- }
- if (ModItems.fluidFertBasic != null) {
- currenttip.add("Chance output if "+ModItems.fluidFertBasic.getLocalizedName()+" is provided.");
- }
- break;
- }
- }
- }
- return currenttip;
- }
+ @Override
+ public List<String> handleItemTooltip(
+ final GuiRecipe<?> gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) {
+ final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
+ if (tObject instanceof CachedDefaultRecipe) {
+ final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
+ for (final PositionedStack tStack : tRecipe.mOutputs) {
+ if (aStack == tStack.item) {
+ if ((!(tStack instanceof FixedPositionedStack))
+ || (((FixedPositionedStack) tStack).mChance <= 0)
+ || (((FixedPositionedStack) tStack).mChance == 10000)) {
+ break;
+ }
+ if (ModItems.fluidFertBasic != null) {
+ currenttip.add(
+ "Chance output if " + ModItems.fluidFertBasic.getLocalizedName() + " is provided.");
+ }
+ break;
+ }
+ }
+ }
+ return currenttip;
+ }
}
diff --git a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java
index 053eec139b..a49f124e84 100644
--- a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java
+++ b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java
@@ -10,95 +10,97 @@ import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-public class NEI_GT_Config
-implements IConfigureNEI {
-
- public static boolean sIsAdded = true;
-
- private static final AutoMap<String> mUniqueRecipeMapHandling = new AutoMap<String>();
-
- @Override
- public synchronized void loadConfig() {
- sIsAdded = false;
+public class NEI_GT_Config implements IConfigureNEI {
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFissionFuelProcessing.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sChemicalPlantRecipes.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName);
+ public static boolean sIsAdded = true;
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sThermalFuels.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sSolarTowerRecipes.mUnlocalizedName);
- mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sTreeSimFakeRecipes.mUnlocalizedName);
-
- // Standard GT Recipe Maps
- Logger.INFO("NEI Registration: "+GTPP_Recipe_Map_Internal.sMappingsEx.size()+" sMappingEx");
- for (final GT_Recipe_Map tMap : GTPP_Recipe_Map_Internal.sMappingsEx) {
- if (tMap.mNEIAllowed) {
- if (!mUniqueRecipeMapHandling.contains(tMap.mUnlocalizedName)) {
- Logger.INFO("NEI Registration: Registering NEI handler for "+tMap.mNEIName);
- new GTPP_NEI_DefaultHandler(tMap);
- }
- else {
- Logger.INFO("NEI Registration: Not allowed to register NEI handler for "+tMap.mNEIName);
- }
- }
- else {
- Logger.INFO("NEI Registration: Skipping registration of NEI handler for "+tMap.mNEIName);
- }
- }
-
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sChemicalPlantRecipes.mNEIName);
- new GT_NEI_FluidReactor();
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mNEIName);
- new GT_NEI_LFTR();
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sFissionFuelProcessing.mNEIName);
- new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sFissionFuelProcessing);
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sVacuumFurnaceRecipes.mNEIName);
- new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sVacuumFurnaceRecipes);
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sThermalFuels.mNEIName);
- new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sThermalFuels);
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sSolarTowerRecipes.mNEIName);
- new GT_NEI_MultiSolarTower(GTPP_Recipe_Map.sSolarTowerRecipes);
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sTreeSimFakeRecipes.mNEIName);
- new GT_NEI_MultiTreeGrowthSimulator();
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mNEIName);
- new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sAdvFreezerRecipes_GT);
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mNEIName);
- new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT);
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mNEIName);
- new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT);
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mNEIName);
- new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockMixerRecipes_GT);
- Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mNEIName);
- new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sAlloyBlastSmelterRecipes);
+ private static final AutoMap<String> mUniqueRecipeMapHandling = new AutoMap<String>();
- Logger.INFO("NEI Registration: Registering NEI handler for "+DecayableRecipeHandler.mNEIName);
- API.registerRecipeHandler(new DecayableRecipeHandler());
- API.registerUsageHandler(new DecayableRecipeHandler());
+ @Override
+ public synchronized void loadConfig() {
+ sIsAdded = false;
- Logger.INFO("NEI Registration: Registering NEI handler for "+GT_NEI_LFTR_Sparging.mNEIName);
- new GT_NEI_LFTR_Sparging();
-
- // Hide Flasks
- if (Utils.isClient()) {
- codechicken.nei.api.API.addItemListEntry(GregtechItemList.VOLUMETRIC_FLASK_8k.get(1));
- codechicken.nei.api.API.addItemListEntry(GregtechItemList.VOLUMETRIC_FLASK_32k.get(1));
- }
- sIsAdded = true;
- }
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFissionFuelProcessing.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sChemicalPlantRecipes.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName);
- @Override
- public String getName() {
- return "GT++ NEI Plugin";
- }
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sThermalFuels.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sSolarTowerRecipes.mUnlocalizedName);
+ mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sTreeSimFakeRecipes.mUnlocalizedName);
- @Override
- public String getVersion() {
- return "(1.12)";
- }
+ // Standard GT Recipe Maps
+ Logger.INFO("NEI Registration: " + GTPP_Recipe_Map_Internal.sMappingsEx.size() + " sMappingEx");
+ for (final GT_Recipe_Map tMap : GTPP_Recipe_Map_Internal.sMappingsEx) {
+ if (tMap.mNEIAllowed) {
+ if (!mUniqueRecipeMapHandling.contains(tMap.mUnlocalizedName)) {
+ Logger.INFO("NEI Registration: Registering NEI handler for " + tMap.mNEIName);
+ new GTPP_NEI_DefaultHandler(tMap);
+ } else {
+ Logger.INFO("NEI Registration: Not allowed to register NEI handler for " + tMap.mNEIName);
+ }
+ } else {
+ Logger.INFO("NEI Registration: Skipping registration of NEI handler for " + tMap.mNEIName);
+ }
+ }
+
+ Logger.INFO("NEI Registration: Registering NEI handler for " + GTPP_Recipe_Map.sChemicalPlantRecipes.mNEIName);
+ new GT_NEI_FluidReactor();
+ Logger.INFO("NEI Registration: Registering NEI handler for "
+ + GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mNEIName);
+ new GT_NEI_LFTR();
+ Logger.INFO("NEI Registration: Registering NEI handler for " + GTPP_Recipe_Map.sFissionFuelProcessing.mNEIName);
+ new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sFissionFuelProcessing);
+ Logger.INFO("NEI Registration: Registering NEI handler for " + GTPP_Recipe_Map.sVacuumFurnaceRecipes.mNEIName);
+ new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sVacuumFurnaceRecipes);
+ Logger.INFO("NEI Registration: Registering NEI handler for " + GTPP_Recipe_Map.sThermalFuels.mNEIName);
+ new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sThermalFuels);
+ Logger.INFO("NEI Registration: Registering NEI handler for " + GTPP_Recipe_Map.sSolarTowerRecipes.mNEIName);
+ new GT_NEI_MultiSolarTower(GTPP_Recipe_Map.sSolarTowerRecipes);
+ Logger.INFO("NEI Registration: Registering NEI handler for " + GTPP_Recipe_Map.sTreeSimFakeRecipes.mNEIName);
+ new GT_NEI_MultiTreeGrowthSimulator();
+ Logger.INFO("NEI Registration: Registering NEI handler for " + GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mNEIName);
+ new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sAdvFreezerRecipes_GT);
+ Logger.INFO("NEI Registration: Registering NEI handler for "
+ + GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mNEIName);
+ new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT);
+ Logger.INFO("NEI Registration: Registering NEI handler for "
+ + GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mNEIName);
+ new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT);
+ Logger.INFO(
+ "NEI Registration: Registering NEI handler for " + GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mNEIName);
+ new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockMixerRecipes_GT);
+ Logger.INFO(
+ "NEI Registration: Registering NEI handler for " + GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mNEIName);
+ new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sAlloyBlastSmelterRecipes);
+
+ Logger.INFO("NEI Registration: Registering NEI handler for " + DecayableRecipeHandler.mNEIName);
+ API.registerRecipeHandler(new DecayableRecipeHandler());
+ API.registerUsageHandler(new DecayableRecipeHandler());
+
+ Logger.INFO("NEI Registration: Registering NEI handler for " + GT_NEI_LFTR_Sparging.mNEIName);
+ new GT_NEI_LFTR_Sparging();
+
+ // Hide Flasks
+ if (Utils.isClient()) {
+ codechicken.nei.api.API.addItemListEntry(GregtechItemList.VOLUMETRIC_FLASK_8k.get(1));
+ codechicken.nei.api.API.addItemListEntry(GregtechItemList.VOLUMETRIC_FLASK_32k.get(1));
+ }
+ sIsAdded = true;
+ }
+
+ @Override
+ public String getName() {
+ return "GT++ NEI Plugin";
+ }
+
+ @Override
+ public String getVersion() {
+ return "(1.12)";
+ }
}
diff --git a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java
index 80589c6811..48c62173c0 100644
--- a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java
+++ b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java
@@ -1,7 +1,6 @@
package gtPlusPlus.nei;
import cpw.mods.fml.common.event.FMLInterModComms;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import net.minecraft.nbt.NBTTagCompound;
@@ -54,7 +53,7 @@ public class NEI_IMC_Sender {
sendCatalyst("gtpp.recipe.treefarm", "gregtech:gt.blockmachines:836");
if (LoadedMods.AdvancedSolarPanel) {
- sendHandler("gtpp.recipe.moleculartransformer", "AdvancedSolarPanel:BlockMolecularTransformer");
+ sendHandler("gtpp.recipe.moleculartransformer", "AdvancedSolarPanel:BlockMolecularTransformer");
sendCatalyst("gtpp.recipe.moleculartransformer", "gregtech:gt.blockmachines:31072");
}
@@ -76,19 +75,18 @@ public class NEI_IMC_Sender {
sendCatalyst("crafting", "gregtech:gt.blockmachines:31097", -10);
sendCatalyst("crafting", "gregtech:gt.blockmachines:31098", -10);
-// if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
-// // Compound Fabricator
-// sendCatalyst("gt.recipe.fakeAssemblylineProcess", "gregtech:gt.blockmachines:31024");
-// }
+ // if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ // // Compound Fabricator
+ // sendCatalyst("gt.recipe.fakeAssemblylineProcess", "gregtech:gt.blockmachines:31024");
+ // }
sendCatalyst("gt.recipe.complexfusionreactor", "gregtech:gt.blockmachines:965", -1);
}
-
private static void sendHandler(String aRecipeName, String aBlock) {
- sendHandler(aRecipeName, aBlock, 2);
+ sendHandler(aRecipeName, aBlock, 2);
}
-
+
private static void sendHandler(String aRecipeName, String aBlock, int aRecipesPerPage) {
NBTTagCompound aNBT = new NBTTagCompound();
aNBT.setString("handler", aRecipeName);
diff --git a/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java b/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
index 30c159ca93..1da2c7145c 100644
--- a/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
+++ b/src/main/java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
@@ -10,20 +10,19 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
-
/**
* Based on crazypants.enderio.gui.IconEIO
- *
+ *
* @author Original EIO Author
*
* This is free and unencumbered software released into the public
* domain.
- *
+ *
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
- *
+ *
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the
@@ -31,7 +30,7 @@ import org.lwjgl.opengl.GL11;
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -39,7 +38,7 @@ import org.lwjgl.opengl.GL11;
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
* For more information, please refer to <http://unlicense.org/>
*
* https://github.com/SleepyTrousers/EnderIO/blob/release/1.7.10/2.2/src/main/java/crazypants/render/RenderUtil.java
@@ -47,118 +46,120 @@ import org.lwjgl.opengl.GL11;
*/
public final class NeiTextureHandler {
- public static final NeiTextureHandler RECIPE = new NeiTextureHandler(16, 132, 16, 16);
- public static final NeiTextureHandler RECIPE_BUTTON = new NeiTextureHandler(128, 116, 24, 24);
-
- public final double minU;
- public final double maxU;
- public final double minV;
- public final double maxV;
- public final double width;
- public final double height;
-
- public static final ResourceLocation TEXTURE = new ResourceLocation(CORE.MODID + ":textures/gui/nei/widgets.png");
-
- public NeiTextureHandler(int x, int y) {
- this(x, y, 16, 16);
- }
-
- public NeiTextureHandler(int x, int y, int width, int height) {
- this((double) width, (double) height, (double) ((float) (0.00390625D * (double) x)),
- (double) ((float) (0.00390625D * (double) (x + width))), (double) ((float) (0.00390625D * (double) y)),
- (double) ((float) (0.00390625D * (double) (y + height))));
- }
-
- public NeiTextureHandler(double width, double height, double minU, double maxU, double minV, double maxV) {
- this.width = width;
- this.height = height;
- this.minU = minU;
- this.maxU = maxU;
- this.minV = minV;
- this.maxV = maxV;
- }
-
- public void renderIcon(double x, double y) {
- this.renderIcon(x, y, this.width, this.height, 0.0D, false);
- }
-
- public void renderIcon(double x, double y, boolean doDraw) {
- this.renderIcon(x, y, this.width, this.height, 0.0D, doDraw);
- }
-
- public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw) {
- this.renderIcon(x, y, width, height, zLevel, doDraw, false);
- }
-
- public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw,
- boolean flipY) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- Tessellator tessellator = Tessellator.instance;
- if (doDraw) {
- bindTexture(TEXTURE);
- tessellator.startDrawingQuads();
- }
-
- if (flipY) {
- tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.minV);
- tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.minV);
- tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.maxV);
- tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.maxV);
- } else {
- tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.maxV);
- tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.maxV);
- tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.minV);
- tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.minV);
- }
-
- if (doDraw) {
- tessellator.draw();
- }
-
- }
-
- public static final ResourceLocation BLOCK_TEX;
- public static final ResourceLocation ITEM_TEX;
- public static final ResourceLocation GLINT_TEX;
- public static int BRIGHTNESS_MAX;
-
- static {
- BLOCK_TEX = TextureMap.locationBlocksTexture;
- ITEM_TEX = TextureMap.locationItemsTexture;
- GLINT_TEX = new ResourceLocation("textures/misc/enchanted_item_glint.png");
- BRIGHTNESS_MAX = 15728880;
- }
-
- public static TextureManager engine() {
- return Minecraft.getMinecraft().renderEngine;
- }
-
- public static void bindItemTexture(ItemStack stack) {
- engine().bindTexture(stack.getItemSpriteNumber() == 0 ? BLOCK_TEX : ITEM_TEX);
- }
-
- public static void bindItemTexture() {
- engine().bindTexture(ITEM_TEX);
- }
-
- public static void bindBlockTexture() {
- engine().bindTexture(BLOCK_TEX);
- }
-
- public static void bindGlintTexture() {
- engine().bindTexture(BLOCK_TEX);
- }
-
- public static void bindTexture(String string) {
- engine().bindTexture(new ResourceLocation(string));
- }
-
- public static void bindTexture(ResourceLocation tex) {
- engine().bindTexture(tex);
- }
-
- public static FontRenderer fontRenderer() {
- return Minecraft.getMinecraft().fontRenderer;
- }
-
-} \ No newline at end of file
+ public static final NeiTextureHandler RECIPE = new NeiTextureHandler(16, 132, 16, 16);
+ public static final NeiTextureHandler RECIPE_BUTTON = new NeiTextureHandler(128, 116, 24, 24);
+
+ public final double minU;
+ public final double maxU;
+ public final double minV;
+ public final double maxV;
+ public final double width;
+ public final double height;
+
+ public static final ResourceLocation TEXTURE = new ResourceLocation(CORE.MODID + ":textures/gui/nei/widgets.png");
+
+ public NeiTextureHandler(int x, int y) {
+ this(x, y, 16, 16);
+ }
+
+ public NeiTextureHandler(int x, int y, int width, int height) {
+ this(
+ (double) width,
+ (double) height,
+ (double) ((float) (0.00390625D * (double) x)),
+ (double) ((float) (0.00390625D * (double) (x + width))),
+ (double) ((float) (0.00390625D * (double) y)),
+ (double) ((float) (0.00390625D * (double) (y + height))));
+ }
+
+ public NeiTextureHandler(double width, double height, double minU, double maxU, double minV, double maxV) {
+ this.width = width;
+ this.height = height;
+ this.minU = minU;
+ this.maxU = maxU;
+ this.minV = minV;
+ this.maxV = maxV;
+ }
+
+ public void renderIcon(double x, double y) {
+ this.renderIcon(x, y, this.width, this.height, 0.0D, false);
+ }
+
+ public void renderIcon(double x, double y, boolean doDraw) {
+ this.renderIcon(x, y, this.width, this.height, 0.0D, doDraw);
+ }
+
+ public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw) {
+ this.renderIcon(x, y, width, height, zLevel, doDraw, false);
+ }
+
+ public void renderIcon(
+ double x, double y, double width, double height, double zLevel, boolean doDraw, boolean flipY) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ Tessellator tessellator = Tessellator.instance;
+ if (doDraw) {
+ bindTexture(TEXTURE);
+ tessellator.startDrawingQuads();
+ }
+
+ if (flipY) {
+ tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.minV);
+ tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.minV);
+ tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.maxV);
+ tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.maxV);
+ } else {
+ tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.maxV);
+ tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.maxV);
+ tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.minV);
+ tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.minV);
+ }
+
+ if (doDraw) {
+ tessellator.draw();
+ }
+ }
+
+ public static final ResourceLocation BLOCK_TEX;
+ public static final ResourceLocation ITEM_TEX;
+ public static final ResourceLocation GLINT_TEX;
+ public static int BRIGHTNESS_MAX;
+
+ static {
+ BLOCK_TEX = TextureMap.locationBlocksTexture;
+ ITEM_TEX = TextureMap.locationItemsTexture;
+ GLINT_TEX = new ResourceLocation("textures/misc/enchanted_item_glint.png");
+ BRIGHTNESS_MAX = 15728880;
+ }
+
+ public static TextureManager engine() {
+ return Minecraft.getMinecraft().renderEngine;
+ }
+
+ public static void bindItemTexture(ItemStack stack) {
+ engine().bindTexture(stack.getItemSpriteNumber() == 0 ? BLOCK_TEX : ITEM_TEX);
+ }
+
+ public static void bindItemTexture() {
+ engine().bindTexture(ITEM_TEX);
+ }
+
+ public static void bindBlockTexture() {
+ engine().bindTexture(BLOCK_TEX);
+ }
+
+ public static void bindGlintTexture() {
+ engine().bindTexture(BLOCK_TEX);
+ }
+
+ public static void bindTexture(String string) {
+ engine().bindTexture(new ResourceLocation(string));
+ }
+
+ public static void bindTexture(ResourceLocation tex) {
+ engine().bindTexture(tex);
+ }
+
+ public static FontRenderer fontRenderer() {
+ return Minecraft.getMinecraft().fontRenderer;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java b/src/main/java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java
index c6e98581ff..f83d33ad6c 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java
@@ -2,59 +2,58 @@ package gtPlusPlus.plugin.agrichem;
public enum AlgaeDefinition {
- /*
- * In general, the productivity of freshwater algae is primarily limited by
- * the availability of the nutrient phosphate (PO4-3), while that of
- * marine algae is limited by nitrate (NO3-) or ammonium (NH4+).
- * Some algal species, however, may have unusual nutrient requirements,
- * and their productivity may be limited by certain micronutrients,
- * such as silica, in the case of diatoms.
- */
-
- Euglenophyta("Euglenophyta", "Euglenoids", true, false, getRGB(147, 168, 50)),
- Chrysophyta("Chrysophyta", "Golden-Brown Algae", true, true, getRGB(186, 146, 0)),
- Pyrrophyta("Pyrrophyta", "Fire Algae", true, true, getRGB(250, 118, 2)),
- Chlorophyta("Chlorophyta", "Green Algae", true, true, getRGB(99, 181, 62)),
- Rhodophyta("Rhodophyta", "Red Algae", false, true, getRGB(153, 5, 22)),
- Paeophyta("Paeophyta", "Brown Algae", false, true, getRGB(94, 78, 47)),
- Xanthophyta("Xanthophyta", "Yellow-Green Algae", true, false, getRGB(118, 138, 16));
+ /*
+ * In general, the productivity of freshwater algae is primarily limited by
+ * the availability of the nutrient phosphate (PO4-3), while that of
+ * marine algae is limited by nitrate (NO3-) or ammonium (NH4+).
+ * Some algal species, however, may have unusual nutrient requirements,
+ * and their productivity may be limited by certain micronutrients,
+ * such as silica, in the case of diatoms.
+ */
- public final String mScientificName;
- public final String mSimpleName;
- public final boolean mSaltWater;
- public final boolean mFreshWater;
- public final int mColour;
-
- AlgaeDefinition(String aScientificName, String aSimpleName, boolean aFresh, boolean aSalt, int aColour) {
- mScientificName = aScientificName;
- mSimpleName = aSimpleName;
- mFreshWater = aFresh;
- mSaltWater = aSalt;
- mColour = aColour;
- }
-
- public static AlgaeDefinition getByIndex(int aIndex) {
- switch(aIndex) {
- default:
- case 0:
- return Euglenophyta;
- case 1:
- return Chrysophyta;
- case 2:
- return Pyrrophyta;
- case 3:
- return Chlorophyta;
- case 4:
- return Rhodophyta;
- case 5:
- return Paeophyta;
- case 6:
- return Xanthophyta;
- }
- }
-
- private final static int getRGB(int r, int g, int b) {
- return AlgaeUtils.rgbtoHexValue(r, g, b);
- }
-
+ Euglenophyta("Euglenophyta", "Euglenoids", true, false, getRGB(147, 168, 50)),
+ Chrysophyta("Chrysophyta", "Golden-Brown Algae", true, true, getRGB(186, 146, 0)),
+ Pyrrophyta("Pyrrophyta", "Fire Algae", true, true, getRGB(250, 118, 2)),
+ Chlorophyta("Chlorophyta", "Green Algae", true, true, getRGB(99, 181, 62)),
+ Rhodophyta("Rhodophyta", "Red Algae", false, true, getRGB(153, 5, 22)),
+ Paeophyta("Paeophyta", "Brown Algae", false, true, getRGB(94, 78, 47)),
+ Xanthophyta("Xanthophyta", "Yellow-Green Algae", true, false, getRGB(118, 138, 16));
+
+ public final String mScientificName;
+ public final String mSimpleName;
+ public final boolean mSaltWater;
+ public final boolean mFreshWater;
+ public final int mColour;
+
+ AlgaeDefinition(String aScientificName, String aSimpleName, boolean aFresh, boolean aSalt, int aColour) {
+ mScientificName = aScientificName;
+ mSimpleName = aSimpleName;
+ mFreshWater = aFresh;
+ mSaltWater = aSalt;
+ mColour = aColour;
+ }
+
+ public static AlgaeDefinition getByIndex(int aIndex) {
+ switch (aIndex) {
+ default:
+ case 0:
+ return Euglenophyta;
+ case 1:
+ return Chrysophyta;
+ case 2:
+ return Pyrrophyta;
+ case 3:
+ return Chlorophyta;
+ case 4:
+ return Rhodophyta;
+ case 5:
+ return Paeophyta;
+ case 6:
+ return Xanthophyta;
+ }
+ }
+
+ private static final int getRGB(int r, int g, int b) {
+ return AlgaeUtils.rgbtoHexValue(r, g, b);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java b/src/main/java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java
index 73ff23888c..4906d0483f 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java
@@ -4,8 +4,7 @@ import gtPlusPlus.core.util.Utils;
public class AlgaeUtils {
- public static int rgbtoHexValue(final int r, final int g, final int b) {
- return Utils.rgbtoHexValue(r, g, b);
- }
-
+ public static int rgbtoHexValue(final int r, final int g, final int b) {
+ return Utils.rgbtoHexValue(r, g, b);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
index c5402a6a41..9c7e89f1f5 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
@@ -2,12 +2,6 @@ package gtPlusPlus.plugin.agrichem;
import static gtPlusPlus.core.lib.CORE.GTNH;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -33,6 +27,11 @@ import gtPlusPlus.plugin.agrichem.block.AgrichemFluids;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.railcraft.utils.RailcraftUtils;
import ic2.core.Ic2Items;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -44,1381 +43,1311 @@ import net.minecraftforge.oredict.OreDictionary;
public class BioRecipes {
- private static Item mFert;
- private static Item mDustDirt;
-
- private static Fluid mSalineWater;
- private static Fluid mDistilledWater;
- private static Fluid mThermalWater;
- private static Fluid mAir;
- private static Fluid mSulfuricWasteWater;
- private static Fluid mAmmonia;
- private static Fluid mMethanol;
- private static Fluid mAceticAcid;
- private static Fluid mPropionicAcid;
- private static Fluid mLiquidPlastic;
- private static Fluid mFermentationBase;
- private static Fluid mCarbonDioxide;
- private static Fluid mCarbonMonoxide;
- private static Fluid mEthylene;
- private static Fluid mEthanol;
- private static Fluid mChlorine;
- private static Fluid mHydrogen;
- private static Fluid mDilutedSulfuricAcid;
- private static Fluid mSulfuricAcid;
- private static Fluid mUrea;
- public static Fluid mFormaldehyde;
- private static Fluid mLiquidResin;
- private static Fluid mMethane;
- private static Fluid mBenzene;
- private static Fluid mEthylbenzene;
- private static Fluid mStyrene;
- private static Fluid mButanol;
- private static Fluid mAcetone;
-
-
- private static final ItemStack getGreenAlgaeRecipeChip() {
- return getBioChip(4);
- }
- private static final ItemStack getBrownAlgaeRecipeChip() {
- return getBioChip(8);
- }
- private static final ItemStack getGoldenBrownAlgaeRecipeChip() {
- return getBioChip(12);
- }
- private static final ItemStack getRedAlgaeRecipeChip() {
- return getBioChip(16);
- }
-
- private static final ItemStack getBioChip(int aID) {
- return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, aID, 0);
- }
-
- public static void init() {
- Logger.INFO("[Bio] Setting Variables");
- initRecipeVars();
- Logger.INFO("[Bio] Generating Biochip Recipes");
- recipeBioChip();
- Logger.INFO("[Bio] Generating Recipes");
- recipeAlgaeBiomass();
- Logger.INFO("[Bio] Finished with recipes");
- }
-
- private static final void initRecipeVars() {
- mFert = AgriculturalChem.dustOrganicFertilizer;
- mDustDirt = AgriculturalChem.dustDirt;
-
- // 5.08 Salt Water Solution ;)
- if (!FluidUtils.doesFluidExist("saltwater")){
- mSalineWater = FluidUtils.generateFluidNoPrefix("saltwater", "Salt Water", 200, new short[]{10, 30, 220, 100});
- }
- else {
- Materials aSaltWater = MaterialUtils.getMaterial("saltwater");
- if (aSaltWater != null) {
- FluidStack aWaterStack = aSaltWater.getFluid(1);
- if (aWaterStack != null) {
- mSalineWater = aSaltWater.getFluid(1).getFluid();
- }
- }
- if (mSalineWater == null) {
- mSalineWater = FluidUtils.getWildcardFluidStack("saltwater", 1).getFluid();
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellSaltWater", 1) == null){
- new BaseItemComponent("saltwater", "Salt Water", new short[] {10, 30, 220});
- }
- }
-
- mDistilledWater = FluidUtils.getDistilledWater(1).getFluid();
- mThermalWater = FluidUtils.getFluidStack("ic2hotwater", 1).getFluid();
- mAir = FluidUtils.getFluidStack("air", 1).getFluid();
- mSulfuricWasteWater = FluidUtils.getFluidStack("sulfuricapatite", 1).getFluid();
- mAmmonia = MISC_MATERIALS.AMMONIA.getFluidStack(1).getFluid();
- mEthylene = FluidUtils.getFluidStack("ethylene", 1).getFluid();
- mEthanol = FluidUtils.getFluidStack("bioethanol", 1).getFluid();
- mDilutedSulfuricAcid = FluidUtils.getFluidStack("dilutedsulfuricacid", 1).getFluid();
- mSulfuricAcid = FluidUtils.getFluidStack("sulfuricacid", 1).getFluid();
- mFormaldehyde = FluidUtils.getFluidStack("fluid.formaldehyde", 1).getFluid();
- mMethane = FluidUtils.getFluidStack("methane", 1).getFluid();
- mBenzene = FluidUtils.getFluidStack("benzene", 1).getFluid();
- mEthylbenzene = FluidUtils.getFluidStack("fluid.ethylbenzene", 1).getFluid();
- mStyrene = FluidUtils.getFluidStack("styrene", 1).getFluid();
- mMethanol = FluidUtils.getFluidStack("methanol", 1).getFluid();
- mLiquidPlastic = FluidUtils.getWildcardFluidStack("plastic", 1).getFluid();
- mCarbonDioxide = MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(1).getFluid();
- mCarbonMonoxide = MISC_MATERIALS.CARBON_MONOXIDE.getFluidStack(1).getFluid();
- mChlorine = FluidUtils.getFluidStack("chlorine", 1).getFluid();
- mHydrogen = FluidUtils.getFluidStack("hydrogen", 1).getFluid();
- mAceticAcid = AgrichemFluids.mAceticAcid;
- mPropionicAcid = AgrichemFluids.mPropionicAcid;
- mUrea = AgrichemFluids.mUrea;
- mLiquidResin = AgrichemFluids.mLiquidResin;
- mFermentationBase = AgrichemFluids.mFermentationBase;
- mButanol = AgrichemFluids.mButanol;
- mAcetone = AgrichemFluids.mAcetone;
- }
-
- private static void recipeAlgaeBiomass() {
-
- // TODO
- // Add in recipes to get initial Biomass
-
- recipeGreenAlgae();
- recipeBrownAlgae();
- recipeGoldenBrownAlgae();
- recipeRedAlgae();
- recipeWoodPellets();
- recipeWoodBricks();
- recipeCellulosePulp();
- recipeCatalystCarrier();
- recipeAluminiumSilverCatalyst();
- recipeAceticAcid();
- recipePropionicAcid();
- recipeFermentationBase();
- recipeEthanol();
- recipeCelluloseFibre();
- recipeGoldenBrownCelluloseFiber();
- recipeRedCelluloseFiber();
- recipeSodiumHydroxide();
- recipeSodiumCarbonate();
- recipePelletMold();
- recipeAluminiumPellet();
- recipeAlumina();
- recipeAluminium();
- recipeCalciumCarbonate();
- recipeLithiumChloride();
- recipeAlginicAcid();
- recipeSulfuricAcid();
- recipeUrea();
- recipeRawBioResin();
- recipeLiquidResin();
- recipeCompost();
- recipeMethane();
- recipeBenzene();
- recipeStyrene();
- registerFuels();
- }
-
- private static void registerFuels() {
-
- // Burnables
- ItemUtils.registerFuel(ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), 800);
- ItemUtils.registerFuel(ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 1), 4800);
-
- // Gas Fuels
- //GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1);
-
- //Combustion Fuels
- GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 1), null, 400, 0);
-
- }
- private static void recipeGreenAlgae() {
- // Compost
- GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4),
- ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
-
- // Turn into Cellulose
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getGreenAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 5),
- 5 * 30,
- 16);
-
-
- }
-
- private static void recipeBrownAlgae() {
- // Compost
- GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 2),
- ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
-
- // Alginic acid
- CORE.RA.addExtractorRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10),
- ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 2),
- 3 * 15,
- 30);
-
- // Lithium Chloride
- GT_Values.RA.addBlastRecipe(
- getBrownAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 20),
- GT_Values.NF,
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 5),
- GT_Values.NI,
- 120,
- 120,
- 1200);
-
- // Sodium Carbonate
- CORE.RA.addChemicalRecipe(
- getBrownAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 40),
- FluidUtils.getDistilledWater(2000),
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 20),
- 20 * 30,
- 30);
-
- }
-
- private static void recipeGoldenBrownAlgae() {
- // Compost
- GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
-
- // Turn into Cellulose
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getGoldenBrownAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 10)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 5),
- 5 * 30,
- 120);
-
- }
-
- private static void recipeRedAlgae() {
- // Compost
- GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 2));
-
- // Turn into Cellulose
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getRedAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 10)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 5),
- 5 * 30,
- 240);
-
- }
-
- private static void recipeCelluloseFibre() {
-
- CORE.RA.addChemicalRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 8),
- ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 2),
- GT_Values.NF,
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 10),
- 10 * 20,
- 16);
-
- // Craft into Wood Pellets
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getBioChip(2),
- ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 24),
- 12 * 4,
- 8);
-
- // Methanol Extraction
- GT_Values.RA.addFluidExtractionRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12),
- GT_Values.NI,
- FluidUtils.getFluidStack(mMethanol, 1000),
- 10000,
- 5 * 30,
- 30);
-
- // Compost
- GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 3),
- ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
-
- // Plastic
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(16),
- ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 4),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mAceticAcid, 500),
- FluidUtils.getFluidStack(BioRecipes.mPropionicAcid, 500),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mLiquidPlastic, (1000)),
- },
- 10 * 20,
- 240,
- 2);
-
- }
-
- private static void recipeWoodPellets() {
- // Shapeless Recipe
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1)
- }, ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2));
-
- // Extruder Recipe
- GT_Values.RA.addExtruderRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12),
- ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 0),
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 3),
- 20 * 10,
- 16);
-
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getBioChip(2),
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 8)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2),
- 20 * 5,
- 8);
-
- // CO2
- CORE.RA.addFluidExtractionRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
- FluidUtils.getFluidStack(mCarbonDioxide, 70),
- 10*20,
- 30);
-
-
- // Add Charcoal Recipe
- if (LoadedMods.Railcraft) {
- RailcraftUtils.addCokeOvenRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
- true,
- true,
- ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3),
- GT_Values.NF,
- 1200);
- }
- CORE.RA.addCokeOvenRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
- getBioChip(3),
- null,
- GT_Values.NF,
- ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3),
- 120,
- 16);
-
- }
-
- private static void recipeWoodBricks() {
-
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getBioChip(3),
- ItemUtils.getOrePrefixStack(OrePrefixes.dust, Materials.Wood, 50)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 1),
- 100 * 20,
- 16);
- }
-
- private static void recipeCellulosePulp() {
-
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getBioChip(2),
- ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 4)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(Items.paper, 4),
- 2 * 20,
- 16);
- }
-
- private static void recipeCatalystCarrier() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getBioChip(20),
- ItemUtils.getItemStackOfAmountFromOreDict("plateSteel", GTNH ? 8 : 4),
- ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 4 : 2),
- ItemUtils.getItemStackOfAmountFromOreDict("screwTin", GTNH ? 6 : 3)
- },
- GT_Values.NF,
- CI.getEmptyCatalyst(1),
- 300 * 20,
- 16);
- }
-
- private static void recipeAluminiumSilverCatalyst() {
- // Assembly Recipe
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getBioChip(4),
- CI.getEmptyCatalyst(10),
- ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 4)
- },
- GT_Values.NF,
- CI.getGreenCatalyst(10),
- 20 * 20,
- 30);
- }
-
- private static void recipeAceticAcid() {
-
- /* GT_Values.RA.addMixerRecipe(
- CI.getGreenCatalyst(10),
- var2,
- var3, var4,
- var5, // Fluid in
- var6, // Fluid out
- var7, // Item Out
- var8, // Time
- var9); // Eu
- */
-
- //CH4O + CO = C2H4O2
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getGreenCatalyst(0)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mMethanol, 700),
- FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 700),
- },
- new ItemStack[] {
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mAceticAcid, 700),
- },
- 120 * 20,
- 60,
- 1);
-
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(14),
- CI.emptyCells(1)
- },
- FluidUtils.getFluidStack(mFermentationBase, 1000),
- null,
- new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 2),
- ItemUtils.getItemStackOfAmountFromOreDict("cellAceticAcid", 1)
- },
- new int[] {10000, 10000},
- 60 * 20,
- 16);
-
- }
-
-
-
- public final static HashSet<GT_ItemStack> mFruits = new HashSet<GT_ItemStack>();
- public final static HashSet<GT_ItemStack> mVege = new HashSet<GT_ItemStack>();
- public final static HashSet<GT_ItemStack> mNuts = new HashSet<GT_ItemStack>();
- public final static HashSet<GT_ItemStack> mSeeds = new HashSet<GT_ItemStack>();
-
- public final static AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>();
- public final static AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>();
-
- private static void processFermentationOreDict() {
- processOreDictEntry("listAllfruit", mFruits);
- processOreDictEntry("listAllFruit", mFruits);
- processOreDictEntry("listAllveggie", mVege);
- processOreDictEntry("listAllVeggie", mVege);
- processOreDictEntry("listAllnut", mNuts);
- processOreDictEntry("listAllNut", mNuts);
- processOreDictEntry("listAllseed", mSeeds);
- processOreDictEntry("listAllSeed", mSeeds);
-
- if (!mFruits.isEmpty()) {
- for (GT_ItemStack g : mFruits) {
- mList_Master_FruitVege.put(g.toStack());
- }
- }
- if (!mVege.isEmpty()) {
- for (GT_ItemStack g : mVege) {
- mList_Master_FruitVege.put(g.toStack());
- }
- }
- if (!mNuts.isEmpty()) {
- for (GT_ItemStack g : mNuts) {
- mList_Master_FruitVege.put(g.toStack());
- }
- }
- if (!mSeeds.isEmpty()) {
- for (GT_ItemStack g : mSeeds) {
- mList_Master_Seeds.put(g.toStack());
- }
- }
- }
-
- // Make Fermentation
- private static void processOreDictEntry(String aOreName, HashSet<GT_ItemStack> mfruits2) {
- ArrayList<ItemStack> aTemp = OreDictionary.getOres(aOreName);
- if (!aTemp.isEmpty()) {
- for (ItemStack stack : aTemp) {
- mfruits2.add(new GT_ItemStack(stack));
- }
- }
- }
-
-
- private static void recipeFermentationBase() {
- processFermentationOreDict();
- AutoMap<ItemStack> aFruitVege = mList_Master_FruitVege;
- AutoMap<ItemStack> aSeeds = mList_Master_Seeds;
- ArrayList<ItemStack> aMap = OreDictionary.getOres("cropSugarbeet");
- for (ItemStack a : aFruitVege) {
- if (aMap.contains(a)) {
- continue;
- }
- if (ItemUtils.checkForInvalidItems(a)) {
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(2),
- ItemUtils.getSimpleStack(a, 10)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
- },
- 30 * 20,
- 2,
- 0);
- }
-
- }
- for (ItemStack a : aSeeds) {
- if (ItemUtils.checkForInvalidItems(a)) {
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(3),
- ItemUtils.getSimpleStack(a, 20)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
- },
- 30 * 20,
- 2,
- 0);
- }
- }
-
- // Sugar Cane
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(4),
- ItemUtils.getSimpleStack(Items.reeds, 32)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
- },
- 30 * 20,
- 30,
- 0);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(5),
- ItemUtils.getSimpleStack(Items.reeds, 32),
- ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 2)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 2000),
- },
- 10 * 20,
- 30,
- 0);
-
- // Sugar Beet
- if (OreDictUtils.containsValidEntries("cropSugarbeet")) {
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(4),
- ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 4),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
- },
- 30 * 20,
- 30,
- 0);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(5),
- ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 4),
- ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 2)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 2000),
- },
- 10 * 20,
- 30,
- 0);
- }
-
- // Produce Acetone, Butanol and Ethanol
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(5),
- ItemUtils.getItemStackOfAmountFromOreDict("cellFermentationBase", 48),
- ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 6),
- ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 16),
- },
- new FluidStack[] {
-
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 18),
- ItemUtils.getItemStackOfAmountFromOreDict("cellAcetone", 9),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEthanol", 3),
- CI.emptyCells(18)
- },
- new FluidStack[] {
-
- },
- 100 * 20,
- 32,
- 1);
-
- }
-
- private static void recipePropionicAcid() {
- //C2H4 + CO + H2O = C3H6O2
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getGreenCatalyst(0)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mEthylene, 1000),
- FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 1000),
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
- },
- new ItemStack[] {
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mPropionicAcid, 1000),
- },
- 10 * 20,
- 60,
- 1);
- }
-
- private static void recipeEthanol() {
-
- CORE.RA.addDistilleryRecipe(
- BioRecipes.getBioChip(2),
- FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
- FluidUtils.getFluidStack(BioRecipes.mEthanol, 100),
- null,
- 20 * 20,
- 60,
- false);
-
- }
-
- private static void recipeGoldenBrownCelluloseFiber() {
- CORE.RA.addFluidExtractionRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 5),
- FluidUtils.getFluidStack(BioRecipes.mAmmonia, 500),
- 10 * 30,
- 120);
- }
-
- private static void recipeRedCelluloseFiber() {
- CORE.RA.addExtractorRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 3),
- ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 5),
- 3 * 30,
- 240);
- }
-
- private static void recipeSodiumHydroxide() {
- //NaCl·H2O = NaOH + Cl + H
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(4)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mSalineWater, 1000),
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 3)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mChlorine, 1000),
- FluidUtils.getFluidStack(BioRecipes.mHydrogen, 1000),
- },
- 300 * 20,
- 120,
- 1);
-
- //Na + H2O = NaOH + H
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 5)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 5000),
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 15)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mHydrogen, 5000),
- },
- 60 * 20,
- 60,
- 1);
- }
-
- private static void recipeSodiumCarbonate() {
-
- if (OreDictUtils.containsValidEntries("fuelCoke")) {
- //Na2CO3 + Al2O3 =C= 2NaAlO2 + CO2
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(18),
- ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 1),
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6),
- ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 5)
- },
- new FluidStack[] {
-
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 8)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 1000),
- },
- 120 * 20,
- 120,
- 1);
-
- }
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(18),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 2),
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6),
- ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 5)
- },
- new FluidStack[] {
-
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 8)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 1000),
- },
- 180 * 20,
- 120,
- 1);
-
- }
-
- private static void recipePelletMold() {
- GregtechItemList.Pellet_Mold.set(ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 1));
- GT_Values.RA.addLatheRecipe(
- ALLOY.TUMBAGA.getBlock(1),
- GregtechItemList.Pellet_Mold.get(1),
- null,
- 20 * 30 * 15,
- 90);
- }
-
- private static void recipeAluminiumPellet() {
-
- // Ore Names, no prefix
- AutoMap<String> aOreNames = new AutoMap<String>();
-
- aOreNames.put("Lazurite");
- aOreNames.put("Bauxite");
- aOreNames.put("Grossular");
- aOreNames.put("Pyrope");
- aOreNames.put("Sodalite");
- aOreNames.put("Spodumene");
- aOreNames.put("Ruby");
- aOreNames.put("Sapphire");
- aOreNames.put("GreenSapphire");
-
- // Voltage
- HashMap<String, Integer> aOreData1 = new HashMap<String, Integer>();
- // Input Count
- HashMap<String, Integer> aOreData2 = new HashMap<String, Integer>();
- // Output Count
- HashMap<String, Integer> aOreData3 = new HashMap<String, Integer>();
-
- aOreData1.put("Lazurite", 120);
- aOreData1.put("Bauxite", 90);
- aOreData1.put("Grossular", 90);
- aOreData1.put("Pyrope", 90);
- aOreData1.put("Sodalite", 90);
- aOreData1.put("Spodumene", 90);
- aOreData1.put("Ruby", 60);
- aOreData1.put("Sapphire", 30);
- aOreData1.put("GreenSapphire", 30);
- aOreData2.put("Lazurite", 14);
- aOreData2.put("Bauxite", 39);
- aOreData2.put("Grossular", 20);
- aOreData2.put("Pyrope", 20);
- aOreData2.put("Sodalite", 11);
- aOreData2.put("Spodumene", 10);
- aOreData2.put("Ruby", 6);
- aOreData2.put("Sapphire", 5);
- aOreData2.put("GreenSapphire", 5);
- aOreData3.put("Lazurite", 3);
- aOreData3.put("Bauxite", 16);
- aOreData3.put("Grossular", 2);
- aOreData3.put("Pyrope", 2);
- aOreData3.put("Sodalite", 3);
- aOreData3.put("Spodumene", 1);
- aOreData3.put("Ruby", 2);
- aOreData3.put("Sapphire", 2);
- aOreData3.put("GreenSapphire", 2);
-
- // Assemble all valid crushed ore types for making pellet mix
- HashMap<String, ItemStack> aOreCache = new HashMap<String, ItemStack>();
- for (String aOreName : aOreNames) {
- String aTemp = aOreName;
- aOreName = "crushedPurified" + aOreName;
- if (ItemUtils.doesOreDictHaveEntryFor(aOreName)) {
- aOreCache.put(aTemp, ItemUtils.getItemStackOfAmountFromOreDict(aOreName, 1));
- }
- }
-
- for (String aOreName : aOreNames) {
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(14),
- ItemUtils.getSimpleStack(aOreCache.get(aOreName), aOreData2.get(aOreName))
- },
- new FluidStack[] {
- FluidUtils.getSteam(2000 * aOreData2.get(aOreName))
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mCleanAluminiumMix, (int) (Math.ceil(aOreData3.get(aOreName) * 1.4)))
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(AgriculturalChem.RedMud, 100 * (int) (Math.ceil(aOreData3.get(aOreName) * 1.4)))
- },
- 20 * 60,
- aOreData1.get(aOreName),
- aOreName.equals("Bauxite") ? 2 : 1);
- }
-
- GT_Values.RA.addExtruderRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mCleanAluminiumMix, 3),
- ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 0),
- ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 4),
- 20 * 30,
- 64);
- }
-
- private static void recipeAlumina() {
- //2NaAlO2 + 2NaOH + 2CO2 = Al2O3 + 2Na2CO3 + H2O
- GT_Values.RA.addBlastRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 8),
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 6),
- FluidUtils.getFluidStack(mCarbonDioxide, 2000),
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 5),
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 12),
- 20 * 40,
- 120,
- 1200);
- }
-
- private static void recipeAluminium() {
- //2Al2O3 + 3C = 4Al + 3CO2
- GT_Values.RA.addBlastRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 10),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 3),
- GT_Values.NF,
- Materials.CarbonDioxide.getGas(3000),
- ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4),
- null,
- 20 * 120,
- 120,
- 1600);
- }
-
- private static void recipeCalciumCarbonate() {
-
- }
-
- private static void recipeLithiumChloride() {
-
- if (OreDictUtils.containsValidEntries("dustRockSalt")) {
- GT_Values.RA.addElectrolyzerRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustRockSalt", 8),
- ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 10),
- FluidUtils.getFluidStack(BioRecipes.mAir, 4000),
- FluidUtils.getFluidStack(BioRecipes.mChlorine, 500),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLithium", 5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallPotassium", 5),
- new int[] {7500, 8000, 8500, 9000, 7500, 8500},
- 60 * 30,
- 60);
- }
- if (OreDictUtils.containsValidEntries("dustPotash")) {
- GT_Values.RA.addElectrolyzerRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustPotash", 10),
- ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 16),
- FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000),
- FluidUtils.getFluidStack(BioRecipes.mChlorine, 250),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 5),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLithium", 7),
- ItemUtils.getItemStackOfAmountFromOreDict("dustAsh", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustAsh", 2),
- new int[] {7500, 8000, 8500, 9000, 9000, 9000},
- 45 * 30,
- 90);
- }
-
- }
-
- private static void recipeAlginicAcid() {
-
- /*// Turn into Cellulose Pulp
- CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- getBioChip(7),
- ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20),
- ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 5)
- },
- GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 20),
- 90 * 20,
- 16);*/
- }
-
- private static void recipeSulfuricAcid() {
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(7),
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10),
- ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 6)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 5000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 5000),
- },
- 50 * 20,
- 60,
- 1);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(7),
- ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 2),
- ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 5000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 5000),
- },
- 6 * 20,
- 180,
- 3);
-
- }
-
- private static void recipeUrea() {
-
- //2NH3 + CO2 = CH4N2O + H2O
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(9),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mAmmonia, 600),
- FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 300),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mUrea, 300),
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 300),
- },
- 5 * 20,
- 30,
- 1);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(9),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mUrea, 200),
- FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 200),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 200)
- },
- 5 * 20,
- 30,
- 1);
- }
-
- private static void recipeRawBioResin() {
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(3),
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 5),
- ItemUtils.getSimpleStack(Blocks.dirt, 1)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 100),
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1),
- },
- new FluidStack[] {
-
- },
- 1 * 20,
- 30,
- 1);
- }
-
- private static void recipeLiquidResin() {
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(3),
- ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mEthanol, 200),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 500),
- },
- 5 * 20,
- 30,
- 1);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(3),
- ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 8)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 144),
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(Ic2Items.resin, 32)
- },
- new FluidStack[] {
-
- },
- 60 * 20,
- 30,
- 1);
-
-
- }
-
- private static void recipeCompost() {
- ItemStack aFert;
- if (LoadedMods.Forestry) {
- aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertForestry, 32);
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(11),
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16),
- ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 8)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mUrea, 200),
- },
- new ItemStack[] {
- aFert
- },
- new FluidStack[] {
-
- },
- 30 * 20,
- 60,
- 1);
- }
-
- aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertIC2, 32);
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(12),
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16),
- ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 8)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mUrea, 200),
- },
- new ItemStack[] {
- aFert
- },
- new FluidStack[] {
-
- },
- 30 * 20,
- 60,
- 1);
-
- }
-
- private static void recipeMethane() {
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(12),
- ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 10)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 500),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mMethane, 500),
- },
- 5 * 20,
- 64,
- 1);
-
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(13),
- ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 8),
- ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 6),
- ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 4)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mMethane, 2000),
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mEthylene, 2000),
- },
- 10 * 20,
- 60,
- 1);
- }
-
- private static void recipeBenzene() {
-
- //6CH4 = C6H6 + 18H
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(19),
- CI.getGreenCatalyst(0),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mMethane, 6000),
- },
- new ItemStack[] {
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mBenzene, 1000),
- Materials.Hydrogen.getGas(18000)
- },
- 8 * 20,
- 120,
- 2);
- }
-
- private static void recipeStyrene() {
-
- //C8H10 = C8H8 + 2H
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- getBioChip(20),
- CI.getGreenCatalyst(0),
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mEthylbenzene, 100),
- },
- new ItemStack[] {
- },
- new FluidStack[] {
- FluidUtils.getFluidStack(BioRecipes.mStyrene, 100),
- Materials.Hydrogen.getGas(200)
- },
- 16 * 20,
- 480,
- 2);
- }
-
- private static void recipeBioChip() {
- GT_ModHandler.addShapelessCraftingRecipe(
- GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 0L), 0, new Object[]{OrePrefixes.circuit.get(Materials.Primitive)});
-
- long bits = 0;
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits,
- new Object[]{"d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits,
- new Object[]{" d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits,
- new Object[]{" d", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits,
- new Object[]{" ", " Pd", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits,
- new Object[]{" ", " P ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits,
- new Object[]{" ", " P ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits,
- new Object[]{" ", " P ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits,
- new Object[]{" ", "dP ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits,
- new Object[]{"P d", " ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits,
- new Object[]{"P ", " d", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits,
- new Object[]{"P ", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits,
- new Object[]{"P ", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits,
- new Object[]{" P", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits,
- new Object[]{" P", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits,
- new Object[]{" P", " ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits,
- new Object[]{" P", "d ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits,
- new Object[]{" ", " ", "d P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits,
- new Object[]{" ", "d ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits,
- new Object[]{"d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits,
- new Object[]{" d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits,
- new Object[]{"d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits,
- new Object[]{" d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits,
- new Object[]{" d", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits,
- new Object[]{" ", " d", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- }
-
- public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) {
- Method mAddRecipe = ReflectionUtils.getMethod(GT_ModHandler.class, "addCraftingRecipe", new Class[] {
- ItemStack.class, Enchantment[].class, int[].class,
- boolean.class, boolean.class, boolean.class, boolean.class,
- boolean.class, boolean.class, boolean.class, boolean.class,
- boolean.class, boolean.class, boolean.class, boolean.class,
- boolean.class, Object[].class});
- boolean didInvoke = false;
- if (mAddRecipe != null) {
- try {
- didInvoke = (boolean) mAddRecipe.invoke(null, aResult,
- new Enchantment[] {},
- new int[] {},
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- true,
- aRecipe);
- }
- catch (IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- return didInvoke;
- }
-
-
+ private static Item mFert;
+ private static Item mDustDirt;
+
+ private static Fluid mSalineWater;
+ private static Fluid mDistilledWater;
+ private static Fluid mThermalWater;
+ private static Fluid mAir;
+ private static Fluid mSulfuricWasteWater;
+ private static Fluid mAmmonia;
+ private static Fluid mMethanol;
+ private static Fluid mAceticAcid;
+ private static Fluid mPropionicAcid;
+ private static Fluid mLiquidPlastic;
+ private static Fluid mFermentationBase;
+ private static Fluid mCarbonDioxide;
+ private static Fluid mCarbonMonoxide;
+ private static Fluid mEthylene;
+ private static Fluid mEthanol;
+ private static Fluid mChlorine;
+ private static Fluid mHydrogen;
+ private static Fluid mDilutedSulfuricAcid;
+ private static Fluid mSulfuricAcid;
+ private static Fluid mUrea;
+ public static Fluid mFormaldehyde;
+ private static Fluid mLiquidResin;
+ private static Fluid mMethane;
+ private static Fluid mBenzene;
+ private static Fluid mEthylbenzene;
+ private static Fluid mStyrene;
+ private static Fluid mButanol;
+ private static Fluid mAcetone;
+
+ private static final ItemStack getGreenAlgaeRecipeChip() {
+ return getBioChip(4);
+ }
+
+ private static final ItemStack getBrownAlgaeRecipeChip() {
+ return getBioChip(8);
+ }
+
+ private static final ItemStack getGoldenBrownAlgaeRecipeChip() {
+ return getBioChip(12);
+ }
+
+ private static final ItemStack getRedAlgaeRecipeChip() {
+ return getBioChip(16);
+ }
+
+ private static final ItemStack getBioChip(int aID) {
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, aID, 0);
+ }
+
+ public static void init() {
+ Logger.INFO("[Bio] Setting Variables");
+ initRecipeVars();
+ Logger.INFO("[Bio] Generating Biochip Recipes");
+ recipeBioChip();
+ Logger.INFO("[Bio] Generating Recipes");
+ recipeAlgaeBiomass();
+ Logger.INFO("[Bio] Finished with recipes");
+ }
+
+ private static final void initRecipeVars() {
+ mFert = AgriculturalChem.dustOrganicFertilizer;
+ mDustDirt = AgriculturalChem.dustDirt;
+
+ // 5.08 Salt Water Solution ;)
+ if (!FluidUtils.doesFluidExist("saltwater")) {
+ mSalineWater =
+ FluidUtils.generateFluidNoPrefix("saltwater", "Salt Water", 200, new short[] {10, 30, 220, 100});
+ } else {
+ Materials aSaltWater = MaterialUtils.getMaterial("saltwater");
+ if (aSaltWater != null) {
+ FluidStack aWaterStack = aSaltWater.getFluid(1);
+ if (aWaterStack != null) {
+ mSalineWater = aSaltWater.getFluid(1).getFluid();
+ }
+ }
+ if (mSalineWater == null) {
+ mSalineWater = FluidUtils.getWildcardFluidStack("saltwater", 1).getFluid();
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellSaltWater", 1) == null) {
+ new BaseItemComponent("saltwater", "Salt Water", new short[] {10, 30, 220});
+ }
+ }
+
+ mDistilledWater = FluidUtils.getDistilledWater(1).getFluid();
+ mThermalWater = FluidUtils.getFluidStack("ic2hotwater", 1).getFluid();
+ mAir = FluidUtils.getFluidStack("air", 1).getFluid();
+ mSulfuricWasteWater = FluidUtils.getFluidStack("sulfuricapatite", 1).getFluid();
+ mAmmonia = MISC_MATERIALS.AMMONIA.getFluidStack(1).getFluid();
+ mEthylene = FluidUtils.getFluidStack("ethylene", 1).getFluid();
+ mEthanol = FluidUtils.getFluidStack("bioethanol", 1).getFluid();
+ mDilutedSulfuricAcid =
+ FluidUtils.getFluidStack("dilutedsulfuricacid", 1).getFluid();
+ mSulfuricAcid = FluidUtils.getFluidStack("sulfuricacid", 1).getFluid();
+ mFormaldehyde = FluidUtils.getFluidStack("fluid.formaldehyde", 1).getFluid();
+ mMethane = FluidUtils.getFluidStack("methane", 1).getFluid();
+ mBenzene = FluidUtils.getFluidStack("benzene", 1).getFluid();
+ mEthylbenzene = FluidUtils.getFluidStack("fluid.ethylbenzene", 1).getFluid();
+ mStyrene = FluidUtils.getFluidStack("styrene", 1).getFluid();
+ mMethanol = FluidUtils.getFluidStack("methanol", 1).getFluid();
+ mLiquidPlastic = FluidUtils.getWildcardFluidStack("plastic", 1).getFluid();
+ mCarbonDioxide = MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(1).getFluid();
+ mCarbonMonoxide = MISC_MATERIALS.CARBON_MONOXIDE.getFluidStack(1).getFluid();
+ mChlorine = FluidUtils.getFluidStack("chlorine", 1).getFluid();
+ mHydrogen = FluidUtils.getFluidStack("hydrogen", 1).getFluid();
+ mAceticAcid = AgrichemFluids.mAceticAcid;
+ mPropionicAcid = AgrichemFluids.mPropionicAcid;
+ mUrea = AgrichemFluids.mUrea;
+ mLiquidResin = AgrichemFluids.mLiquidResin;
+ mFermentationBase = AgrichemFluids.mFermentationBase;
+ mButanol = AgrichemFluids.mButanol;
+ mAcetone = AgrichemFluids.mAcetone;
+ }
+
+ private static void recipeAlgaeBiomass() {
+
+ // TODO
+ // Add in recipes to get initial Biomass
+
+ recipeGreenAlgae();
+ recipeBrownAlgae();
+ recipeGoldenBrownAlgae();
+ recipeRedAlgae();
+ recipeWoodPellets();
+ recipeWoodBricks();
+ recipeCellulosePulp();
+ recipeCatalystCarrier();
+ recipeAluminiumSilverCatalyst();
+ recipeAceticAcid();
+ recipePropionicAcid();
+ recipeFermentationBase();
+ recipeEthanol();
+ recipeCelluloseFibre();
+ recipeGoldenBrownCelluloseFiber();
+ recipeRedCelluloseFiber();
+ recipeSodiumHydroxide();
+ recipeSodiumCarbonate();
+ recipePelletMold();
+ recipeAluminiumPellet();
+ recipeAlumina();
+ recipeAluminium();
+ recipeCalciumCarbonate();
+ recipeLithiumChloride();
+ recipeAlginicAcid();
+ recipeSulfuricAcid();
+ recipeUrea();
+ recipeRawBioResin();
+ recipeLiquidResin();
+ recipeCompost();
+ recipeMethane();
+ recipeBenzene();
+ recipeStyrene();
+ registerFuels();
+ }
+
+ private static void registerFuels() {
+
+ // Burnables
+ ItemUtils.registerFuel(ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), 800);
+ ItemUtils.registerFuel(ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 1), 4800);
+
+ // Gas Fuels
+ // GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1);
+
+ // Combustion Fuels
+ GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 1), null, 400, 0);
+ }
+
+ private static void recipeGreenAlgae() {
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
+
+ // Turn into Cellulose
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getGreenAlgaeRecipeChip(), ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 5),
+ 5 * 30,
+ 16);
+ }
+
+ private static void recipeBrownAlgae() {
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 2),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
+
+ // Alginic acid
+ CORE.RA.addExtractorRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 2),
+ 3 * 15,
+ 30);
+
+ // Lithium Chloride
+ GT_Values.RA.addBlastRecipe(
+ getBrownAlgaeRecipeChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 20),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 5),
+ GT_Values.NI,
+ 120,
+ 120,
+ 1200);
+
+ // Sodium Carbonate
+ CORE.RA.addChemicalRecipe(
+ getBrownAlgaeRecipeChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 40),
+ FluidUtils.getDistilledWater(2000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 20),
+ 20 * 30,
+ 30);
+ }
+
+ private static void recipeGoldenBrownAlgae() {
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
+
+ // Turn into Cellulose
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getGoldenBrownAlgaeRecipeChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 10)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 5),
+ 5 * 30,
+ 120);
+ }
+
+ private static void recipeRedAlgae() {
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 2));
+
+ // Turn into Cellulose
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getRedAlgaeRecipeChip(), ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 10)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 5),
+ 5 * 30,
+ 240);
+ }
+
+ private static void recipeCelluloseFibre() {
+
+ CORE.RA.addChemicalRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 8),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 2),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 10),
+ 10 * 20,
+ 16);
+
+ // Craft into Wood Pellets
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {getBioChip(2), ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12)},
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 24),
+ 12 * 4,
+ 8);
+
+ // Methanol Extraction
+ GT_Values.RA.addFluidExtractionRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12),
+ GT_Values.NI,
+ FluidUtils.getFluidStack(mMethanol, 1000),
+ 10000,
+ 5 * 30,
+ 30);
+
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
+
+ // Plastic
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(16), ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 4),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mAceticAcid, 500),
+ FluidUtils.getFluidStack(BioRecipes.mPropionicAcid, 500),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidPlastic, (1000)),
+ },
+ 10 * 20,
+ 240,
+ 2);
+ }
+
+ private static void recipeWoodPellets() {
+ // Shapeless Recipe
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1)
+ },
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2));
+
+ // Extruder Recipe
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12),
+ ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 0),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 3),
+ 20 * 10,
+ 16);
+
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {getBioChip(2), ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 8)},
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2),
+ 20 * 5,
+ 8);
+
+ // CO2
+ CORE.RA.addFluidExtractionRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ FluidUtils.getFluidStack(mCarbonDioxide, 70),
+ 10 * 20,
+ 30);
+
+ // Add Charcoal Recipe
+ if (LoadedMods.Railcraft) {
+ RailcraftUtils.addCokeOvenRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
+ true,
+ true,
+ ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3),
+ GT_Values.NF,
+ 1200);
+ }
+ CORE.RA.addCokeOvenRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
+ getBioChip(3),
+ null,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3),
+ 120,
+ 16);
+ }
+
+ private static void recipeWoodBricks() {
+
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {getBioChip(3), ItemUtils.getOrePrefixStack(OrePrefixes.dust, Materials.Wood, 50)},
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 1),
+ 100 * 20,
+ 16);
+ }
+
+ private static void recipeCellulosePulp() {
+
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {getBioChip(2), ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 4)},
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(Items.paper, 4),
+ 2 * 20,
+ 16);
+ }
+
+ private static void recipeCatalystCarrier() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getBioChip(20),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateSteel", GTNH ? 8 : 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 4 : 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("screwTin", GTNH ? 6 : 3)
+ },
+ GT_Values.NF,
+ CI.getEmptyCatalyst(1),
+ 300 * 20,
+ 16);
+ }
+
+ private static void recipeAluminiumSilverCatalyst() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ getBioChip(4),
+ CI.getEmptyCatalyst(10),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 4)
+ },
+ GT_Values.NF,
+ CI.getGreenCatalyst(10),
+ 20 * 20,
+ 30);
+ }
+
+ private static void recipeAceticAcid() {
+
+ /* GT_Values.RA.addMixerRecipe(
+ CI.getGreenCatalyst(10),
+ var2,
+ var3, var4,
+ var5, // Fluid in
+ var6, // Fluid out
+ var7, // Item Out
+ var8, // Time
+ var9); // Eu
+ */
+
+ // CH4O + CO = C2H4O2
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getGreenCatalyst(0)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethanol, 700),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 700),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mAceticAcid, 700),
+ },
+ 120 * 20,
+ 60,
+ 1);
+
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedBioCircuit(14), CI.emptyCells(1)},
+ FluidUtils.getFluidStack(mFermentationBase, 1000),
+ null,
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellAceticAcid", 1)
+ },
+ new int[] {10000, 10000},
+ 60 * 20,
+ 16);
+ }
+
+ public static final HashSet<GT_ItemStack> mFruits = new HashSet<GT_ItemStack>();
+ public static final HashSet<GT_ItemStack> mVege = new HashSet<GT_ItemStack>();
+ public static final HashSet<GT_ItemStack> mNuts = new HashSet<GT_ItemStack>();
+ public static final HashSet<GT_ItemStack> mSeeds = new HashSet<GT_ItemStack>();
+
+ public static final AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>();
+ public static final AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>();
+
+ private static void processFermentationOreDict() {
+ processOreDictEntry("listAllfruit", mFruits);
+ processOreDictEntry("listAllFruit", mFruits);
+ processOreDictEntry("listAllveggie", mVege);
+ processOreDictEntry("listAllVeggie", mVege);
+ processOreDictEntry("listAllnut", mNuts);
+ processOreDictEntry("listAllNut", mNuts);
+ processOreDictEntry("listAllseed", mSeeds);
+ processOreDictEntry("listAllSeed", mSeeds);
+
+ if (!mFruits.isEmpty()) {
+ for (GT_ItemStack g : mFruits) {
+ mList_Master_FruitVege.put(g.toStack());
+ }
+ }
+ if (!mVege.isEmpty()) {
+ for (GT_ItemStack g : mVege) {
+ mList_Master_FruitVege.put(g.toStack());
+ }
+ }
+ if (!mNuts.isEmpty()) {
+ for (GT_ItemStack g : mNuts) {
+ mList_Master_FruitVege.put(g.toStack());
+ }
+ }
+ if (!mSeeds.isEmpty()) {
+ for (GT_ItemStack g : mSeeds) {
+ mList_Master_Seeds.put(g.toStack());
+ }
+ }
+ }
+
+ // Make Fermentation
+ private static void processOreDictEntry(String aOreName, HashSet<GT_ItemStack> mfruits2) {
+ ArrayList<ItemStack> aTemp = OreDictionary.getOres(aOreName);
+ if (!aTemp.isEmpty()) {
+ for (ItemStack stack : aTemp) {
+ mfruits2.add(new GT_ItemStack(stack));
+ }
+ }
+ }
+
+ private static void recipeFermentationBase() {
+ processFermentationOreDict();
+ AutoMap<ItemStack> aFruitVege = mList_Master_FruitVege;
+ AutoMap<ItemStack> aSeeds = mList_Master_Seeds;
+ ArrayList<ItemStack> aMap = OreDictionary.getOres("cropSugarbeet");
+ for (ItemStack a : aFruitVege) {
+ if (aMap.contains(a)) {
+ continue;
+ }
+ if (ItemUtils.checkForInvalidItems(a)) {
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getBioChip(2), ItemUtils.getSimpleStack(a, 10)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
+ },
+ 30 * 20,
+ 2,
+ 0);
+ }
+ }
+ for (ItemStack a : aSeeds) {
+ if (ItemUtils.checkForInvalidItems(a)) {
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getBioChip(3), ItemUtils.getSimpleStack(a, 20)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
+ },
+ 30 * 20,
+ 2,
+ 0);
+ }
+ }
+
+ // Sugar Cane
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getBioChip(4), ItemUtils.getSimpleStack(Items.reeds, 32)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
+ },
+ 30 * 20,
+ 30,
+ 0);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(5),
+ ItemUtils.getSimpleStack(Items.reeds, 32),
+ ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 2)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 2000),
+ },
+ 10 * 20,
+ 30,
+ 0);
+
+ // Sugar Beet
+ if (OreDictUtils.containsValidEntries("cropSugarbeet")) {
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(4), ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 4),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
+ },
+ 30 * 20,
+ 30,
+ 0);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(5),
+ ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 4),
+ ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 2)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 2000),
+ },
+ 10 * 20,
+ 30,
+ 0);
+ }
+
+ // Produce Acetone, Butanol and Ethanol
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(5),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellFermentationBase", 48),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 6),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 16),
+ },
+ new FluidStack[] {},
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 18),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellAcetone", 9),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEthanol", 3),
+ CI.emptyCells(18)
+ },
+ new FluidStack[] {},
+ 100 * 20,
+ 32,
+ 1);
+ }
+
+ private static void recipePropionicAcid() {
+ // C2H4 + CO + H2O = C3H6O2
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {CI.getGreenCatalyst(0)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthylene, 1000),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 1000),
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mPropionicAcid, 1000),
+ },
+ 10 * 20,
+ 60,
+ 1);
+ }
+
+ private static void recipeEthanol() {
+
+ CORE.RA.addDistilleryRecipe(
+ BioRecipes.getBioChip(2),
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
+ FluidUtils.getFluidStack(BioRecipes.mEthanol, 100),
+ null,
+ 20 * 20,
+ 60,
+ false);
+ }
+
+ private static void recipeGoldenBrownCelluloseFiber() {
+ CORE.RA.addFluidExtractionRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 5),
+ FluidUtils.getFluidStack(BioRecipes.mAmmonia, 500),
+ 10 * 30,
+ 120);
+ }
+
+ private static void recipeRedCelluloseFiber() {
+ CORE.RA.addExtractorRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 3),
+ ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 5),
+ 3 * 30,
+ 240);
+ }
+
+ private static void recipeSodiumHydroxide() {
+ // NaCl·H2O = NaOH + Cl + H
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getBioChip(4)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mSalineWater, 1000),
+ },
+ new ItemStack[] {ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 3)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mChlorine, 1000),
+ FluidUtils.getFluidStack(BioRecipes.mHydrogen, 1000),
+ },
+ 300 * 20,
+ 120,
+ 1);
+
+ // Na + H2O = NaOH + H
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getBioChip(5), ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 5)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 5000),
+ },
+ new ItemStack[] {ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 15)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mHydrogen, 5000),
+ },
+ 60 * 20,
+ 60,
+ 1);
+ }
+
+ private static void recipeSodiumCarbonate() {
+
+ if (OreDictUtils.containsValidEntries("fuelCoke")) {
+ // Na2CO3 + Al2O3 =C= 2NaAlO2 + CO2
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(18),
+ ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 5)
+ },
+ new FluidStack[] {},
+ new ItemStack[] {ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 8)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 1000),
+ },
+ 120 * 20,
+ 120,
+ 1);
+ }
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(18),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 2),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 5)
+ },
+ new FluidStack[] {},
+ new ItemStack[] {ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 8)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 1000),
+ },
+ 180 * 20,
+ 120,
+ 1);
+ }
+
+ private static void recipePelletMold() {
+ GregtechItemList.Pellet_Mold.set(ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 1));
+ GT_Values.RA.addLatheRecipe(
+ ALLOY.TUMBAGA.getBlock(1), GregtechItemList.Pellet_Mold.get(1), null, 20 * 30 * 15, 90);
+ }
+
+ private static void recipeAluminiumPellet() {
+
+ // Ore Names, no prefix
+ AutoMap<String> aOreNames = new AutoMap<String>();
+
+ aOreNames.put("Lazurite");
+ aOreNames.put("Bauxite");
+ aOreNames.put("Grossular");
+ aOreNames.put("Pyrope");
+ aOreNames.put("Sodalite");
+ aOreNames.put("Spodumene");
+ aOreNames.put("Ruby");
+ aOreNames.put("Sapphire");
+ aOreNames.put("GreenSapphire");
+
+ // Voltage
+ HashMap<String, Integer> aOreData1 = new HashMap<String, Integer>();
+ // Input Count
+ HashMap<String, Integer> aOreData2 = new HashMap<String, Integer>();
+ // Output Count
+ HashMap<String, Integer> aOreData3 = new HashMap<String, Integer>();
+
+ aOreData1.put("Lazurite", 120);
+ aOreData1.put("Bauxite", 90);
+ aOreData1.put("Grossular", 90);
+ aOreData1.put("Pyrope", 90);
+ aOreData1.put("Sodalite", 90);
+ aOreData1.put("Spodumene", 90);
+ aOreData1.put("Ruby", 60);
+ aOreData1.put("Sapphire", 30);
+ aOreData1.put("GreenSapphire", 30);
+ aOreData2.put("Lazurite", 14);
+ aOreData2.put("Bauxite", 39);
+ aOreData2.put("Grossular", 20);
+ aOreData2.put("Pyrope", 20);
+ aOreData2.put("Sodalite", 11);
+ aOreData2.put("Spodumene", 10);
+ aOreData2.put("Ruby", 6);
+ aOreData2.put("Sapphire", 5);
+ aOreData2.put("GreenSapphire", 5);
+ aOreData3.put("Lazurite", 3);
+ aOreData3.put("Bauxite", 16);
+ aOreData3.put("Grossular", 2);
+ aOreData3.put("Pyrope", 2);
+ aOreData3.put("Sodalite", 3);
+ aOreData3.put("Spodumene", 1);
+ aOreData3.put("Ruby", 2);
+ aOreData3.put("Sapphire", 2);
+ aOreData3.put("GreenSapphire", 2);
+
+ // Assemble all valid crushed ore types for making pellet mix
+ HashMap<String, ItemStack> aOreCache = new HashMap<String, ItemStack>();
+ for (String aOreName : aOreNames) {
+ String aTemp = aOreName;
+ aOreName = "crushedPurified" + aOreName;
+ if (ItemUtils.doesOreDictHaveEntryFor(aOreName)) {
+ aOreCache.put(aTemp, ItemUtils.getItemStackOfAmountFromOreDict(aOreName, 1));
+ }
+ }
+
+ for (String aOreName : aOreNames) {
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(14),
+ ItemUtils.getSimpleStack(aOreCache.get(aOreName), aOreData2.get(aOreName))
+ },
+ new FluidStack[] {FluidUtils.getSteam(2000 * aOreData2.get(aOreName))},
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(
+ AgriculturalChem.mCleanAluminiumMix, (int) (Math.ceil(aOreData3.get(aOreName) * 1.4)))
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(
+ AgriculturalChem.RedMud, 100 * (int) (Math.ceil(aOreData3.get(aOreName) * 1.4)))
+ },
+ 20 * 60,
+ aOreData1.get(aOreName),
+ aOreName.equals("Bauxite") ? 2 : 1);
+ }
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCleanAluminiumMix, 3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 0),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 4),
+ 20 * 30,
+ 64);
+ }
+
+ private static void recipeAlumina() {
+ // 2NaAlO2 + 2NaOH + 2CO2 = Al2O3 + 2Na2CO3 + H2O
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 8),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 6),
+ FluidUtils.getFluidStack(mCarbonDioxide, 2000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 5),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 12),
+ 20 * 40,
+ 120,
+ 1200);
+ }
+
+ private static void recipeAluminium() {
+ // 2Al2O3 + 3C = 4Al + 3CO2
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 10),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 3),
+ GT_Values.NF,
+ Materials.CarbonDioxide.getGas(3000),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4),
+ null,
+ 20 * 120,
+ 120,
+ 1600);
+ }
+
+ private static void recipeCalciumCarbonate() {}
+
+ private static void recipeLithiumChloride() {
+
+ if (OreDictUtils.containsValidEntries("dustRockSalt")) {
+ GT_Values.RA.addElectrolyzerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRockSalt", 8),
+ ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 10),
+ FluidUtils.getFluidStack(BioRecipes.mAir, 4000),
+ FluidUtils.getFluidStack(BioRecipes.mChlorine, 500),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLithium", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallPotassium", 5),
+ new int[] {7500, 8000, 8500, 9000, 7500, 8500},
+ 60 * 30,
+ 60);
+ }
+ if (OreDictUtils.containsValidEntries("dustPotash")) {
+ GT_Values.RA.addElectrolyzerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPotash", 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 16),
+ FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000),
+ FluidUtils.getFluidStack(BioRecipes.mChlorine, 250),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLithium", 7),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAsh", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAsh", 2),
+ new int[] {7500, 8000, 8500, 9000, 9000, 9000},
+ 45 * 30,
+ 90);
+ }
+ }
+
+ private static void recipeAlginicAcid() {
+
+ /*// Turn into Cellulose Pulp
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(7),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 5)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 20),
+ 90 * 20,
+ 16);*/
+ }
+
+ private static void recipeSulfuricAcid() {
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(7),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 6)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 5000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 5000),
+ },
+ 50 * 20,
+ 60,
+ 1);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(7),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 2),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 5000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 5000),
+ },
+ 6 * 20,
+ 180,
+ 3);
+ }
+
+ private static void recipeUrea() {
+
+ // 2NH3 + CO2 = CH4N2O + H2O
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(9),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mAmmonia, 600),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 300),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 300),
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 300),
+ },
+ 5 * 20,
+ 30,
+ 1);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(9),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 200),
+ FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 200),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 200)},
+ 5 * 20,
+ 30,
+ 1);
+ }
+
+ private static void recipeRawBioResin() {
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 5),
+ ItemUtils.getSimpleStack(Blocks.dirt, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 100),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1),
+ },
+ new FluidStack[] {},
+ 1 * 20,
+ 30,
+ 1);
+ }
+
+ private static void recipeLiquidResin() {
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getBioChip(3), ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthanol, 200),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 500),
+ },
+ 5 * 20,
+ 30,
+ 1);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getBioChip(3), ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 8)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 144),
+ },
+ new ItemStack[] {ItemUtils.getSimpleStack(Ic2Items.resin, 32)},
+ new FluidStack[] {},
+ 60 * 20,
+ 30,
+ 1);
+ }
+
+ private static void recipeCompost() {
+ ItemStack aFert;
+ if (LoadedMods.Forestry) {
+ aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertForestry, 32);
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(11),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 8)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 200),
+ },
+ new ItemStack[] {aFert},
+ new FluidStack[] {},
+ 30 * 20,
+ 60,
+ 1);
+ }
+
+ aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertIC2, 32);
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(12),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 8)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 200),
+ },
+ new ItemStack[] {aFert},
+ new FluidStack[] {},
+ 30 * 20,
+ 60,
+ 1);
+ }
+
+ private static void recipeMethane() {
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {getBioChip(12), ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 10)},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 500),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethane, 500),
+ },
+ 5 * 20,
+ 64,
+ 1);
+
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(13),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 8),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 6),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 4)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethane, 2000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthylene, 2000),
+ },
+ 10 * 20,
+ 60,
+ 1);
+ }
+
+ private static void recipeBenzene() {
+
+ // 6CH4 = C6H6 + 18H
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(19), CI.getGreenCatalyst(0),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethane, 6000),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {FluidUtils.getFluidStack(BioRecipes.mBenzene, 1000), Materials.Hydrogen.getGas(18000)
+ },
+ 8 * 20,
+ 120,
+ 2);
+ }
+
+ private static void recipeStyrene() {
+
+ // C8H10 = C8H8 + 2H
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ getBioChip(20), CI.getGreenCatalyst(0),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthylbenzene, 100),
+ },
+ new ItemStack[] {},
+ new FluidStack[] {FluidUtils.getFluidStack(BioRecipes.mStyrene, 100), Materials.Hydrogen.getGas(200)},
+ 16 * 20,
+ 480,
+ 2);
+ }
+
+ private static void recipeBioChip() {
+ GT_ModHandler.addShapelessCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 0L),
+ 0,
+ new Object[] {OrePrefixes.circuit.get(Materials.Primitive)});
+
+ long bits = 0;
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits, new Object[] {
+ "d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits, new Object[] {
+ " d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits, new Object[] {
+ " d", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits, new Object[] {
+ " ", " Pd", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits, new Object[] {
+ " ", " P ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits, new Object[] {
+ " ", " P ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits, new Object[] {
+ " ", " P ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits, new Object[] {
+ " ", "dP ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits, new Object[] {
+ "P d", " ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits, new Object[] {
+ "P ", " d", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits, new Object[] {
+ "P ", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits, new Object[] {
+ "P ", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits, new Object[] {
+ " P", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits, new Object[] {
+ " P", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits, new Object[] {
+ " P", " ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits, new Object[] {
+ " P", "d ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits, new Object[] {
+ " ", " ", "d P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits, new Object[] {
+ " ", "d ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits, new Object[] {
+ "d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits, new Object[] {
+ " d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits, new Object[] {
+ "d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits, new Object[] {
+ " d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits, new Object[] {
+ " d", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ addCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits, new Object[] {
+ " ", " d", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])
+ });
+ }
+
+ public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) {
+ Method mAddRecipe = ReflectionUtils.getMethod(GT_ModHandler.class, "addCraftingRecipe", new Class[] {
+ ItemStack.class,
+ Enchantment[].class,
+ int[].class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ Object[].class
+ });
+ boolean didInvoke = false;
+ if (mAddRecipe != null) {
+ try {
+ didInvoke = (boolean) mAddRecipe.invoke(
+ null,
+ aResult,
+ new Enchantment[] {},
+ new int[] {},
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ aRecipe);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return didInvoke;
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java b/src/main/java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java
index 4cf31e9335..923f1698d1 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java
@@ -1,70 +1,58 @@
package gtPlusPlus.plugin.agrichem;
-import java.util.List;
-
import gtPlusPlus.api.interfaces.IPlugin;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.plugin.agrichem.block.AgrichemFluids;
import gtPlusPlus.plugin.agrichem.fluids.FluidLoader;
-import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase;
-import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase;
-import gtPlusPlus.plugin.agrichem.item.algae.ItemBioChip;
import gtPlusPlus.plugin.manager.Core_Manager;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.oredict.OreDictionary;
public class Core_Agrichem implements IPlugin {
- final static Core_Agrichem mInstance;
-
-
- static {
- mInstance = new Core_Agrichem();
- Core_Manager.registerPlugin(mInstance);
- mInstance.log("Preparing "+mInstance.getPluginName()+" for use.");
- }
-
- @Override
- public boolean preInit() {
- mInstance.log("Generating Fluids");
- FluidLoader.generate();
- AgrichemFluids.init();
- mInstance.log("Generating Items");
- return true;
- }
-
- @Override
- public boolean init() {
- mInstance.log("Setting Items");
- return true;
- }
-
- @Override
- public boolean postInit() {
- mInstance.log("Generating Recipes");
- return true;
- }
-
- @Override
- public boolean serverStart() {
- return true;
- }
-
- @Override
- public boolean serverStop() {
- return true;
- }
-
- @Override
- public String getPluginName() {
- return "GT++ Agrichemistry Module";
- }
-
- @Override
- public String getPluginAbbreviation() {
- return "FARM";
- }
-
+ static final Core_Agrichem mInstance;
+
+ static {
+ mInstance = new Core_Agrichem();
+ Core_Manager.registerPlugin(mInstance);
+ mInstance.log("Preparing " + mInstance.getPluginName() + " for use.");
+ }
+
+ @Override
+ public boolean preInit() {
+ mInstance.log("Generating Fluids");
+ FluidLoader.generate();
+ AgrichemFluids.init();
+ mInstance.log("Generating Items");
+ return true;
+ }
+
+ @Override
+ public boolean init() {
+ mInstance.log("Setting Items");
+ return true;
+ }
+
+ @Override
+ public boolean postInit() {
+ mInstance.log("Generating Recipes");
+ return true;
+ }
+
+ @Override
+ public boolean serverStart() {
+ return true;
+ }
+
+ @Override
+ public boolean serverStop() {
+ return true;
+ }
+
+ @Override
+ public String getPluginName() {
+ return "GT++ Agrichemistry Module";
+ }
+
+ @Override
+ public String getPluginAbbreviation() {
+ return "FARM";
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/IAlgalItem.java b/src/main/java/gtPlusPlus/plugin/agrichem/IAlgalItem.java
index fada07d062..995734a05b 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/IAlgalItem.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/IAlgalItem.java
@@ -5,8 +5,7 @@ import net.minecraft.item.ItemStack;
public interface IAlgalItem {
- public abstract AlgaeDefinition getAlgaeType(ItemStack aStack);
-
- public abstract AlgaeGeneticData getSpeciesData(ItemStack aStack);
-
+ public abstract AlgaeDefinition getAlgaeType(ItemStack aStack);
+
+ public abstract AlgaeGeneticData getSpeciesData(ItemStack aStack);
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java b/src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
index 039dd702da..8f3ef7a5e6 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
@@ -6,83 +6,76 @@ import net.minecraftforge.fluids.FluidRegistry;
public class AgrichemFluids {
- /*
- * Saline Water - saltwater
- * Sulfuric Waste Water - sulfuricapatite
- * Methanol - methanol
- * Hot Water - ic2hotwater
- * Acetic Acid
- * Propionic Acid
- * Fermentation Base
- * Ethylene - ethylene
- * Ethanol - bioethanol
- * Diluted SA - filutedsulfuricacid
- * Sulfuric Acid - sulfuricacid
- * Urea
- * Formaldehyde - fluid.formaldehyde
- * Liquid Resin
- * Methane - methane
- * Benzene - benzene
- * Ethylbenzene - fluid.ethylbenzene
- * Styrene - styrene
- */
+ /*
+ * Saline Water - saltwater
+ * Sulfuric Waste Water - sulfuricapatite
+ * Methanol - methanol
+ * Hot Water - ic2hotwater
+ * Acetic Acid
+ * Propionic Acid
+ * Fermentation Base
+ * Ethylene - ethylene
+ * Ethanol - bioethanol
+ * Diluted SA - filutedsulfuricacid
+ * Sulfuric Acid - sulfuricacid
+ * Urea
+ * Formaldehyde - fluid.formaldehyde
+ * Liquid Resin
+ * Methane - methane
+ * Benzene - benzene
+ * Ethylbenzene - fluid.ethylbenzene
+ * Styrene - styrene
+ */
- public static Fluid mAceticAcid;
- public static Fluid mPropionicAcid;
- public static Fluid mFermentationBase;
- public static Fluid mUrea;
- public static Fluid mLiquidResin;
- public static Fluid mAcetone;
- public static Fluid mButanol;
-
-
-
- public static void init() {
- if (!FluidRegistry.isFluidRegistered("aceticacid")) {
- mAceticAcid = FluidUtils.generateFluidNoPrefix("aceticacid", "Acetic Acid", 200, new short[] { 97, 168, 96, 100 }, true);
- }
- else {
- mAceticAcid = FluidRegistry.getFluid("aceticacid");
- }
- if (!FluidRegistry.isFluidRegistered("propionicacid")) {
- mPropionicAcid = FluidUtils.generateFluidNoPrefix("propionicacid", "Propionic Acid", 200, new short[] { 198, 209, 148, 100 }, true);
- }
- else {
- mPropionicAcid = FluidRegistry.getFluid("propionicacid");
- }
- if (!FluidRegistry.isFluidRegistered("fermentation.base")) {
- mFermentationBase = FluidUtils.generateFluidNoPrefix("fermentation.base", "Fermentation Base", 200, new short[] { 107, 100, 63, 100 }, true);
- }
- else {
- mFermentationBase = FluidRegistry.getFluid("fermentation.base");
- }
- if (!FluidRegistry.isFluidRegistered("ureamix")) {
- mUrea = FluidUtils.generateFluidNoPrefix("ureamix", "Urea Mix", 200, new short[] { 71, 55, 12, 100 }, true);
- }
- else {
- mUrea = FluidRegistry.getFluid("ureamix");
- }
- if (!FluidRegistry.isFluidRegistered("liquidresin")) {
- mLiquidResin = FluidUtils.generateFluidNoPrefix("liquidresin", "Liquid Resin", 200, new short[] { 59, 58, 56, 100 }, true);
- }
- else {
- mLiquidResin = FluidRegistry.getFluid("liquidresin");
- }
-
- if (!FluidRegistry.isFluidRegistered("acetone")) {
- mAcetone = FluidUtils.generateFluidNoPrefix("acetone", "Acetone", 200, new short[] { 59, 58, 56, 100 }, true);
- }
- else {
- mAcetone = FluidRegistry.getFluid("acetone");
- }
- if (!FluidRegistry.isFluidRegistered("butanol")) {
- mButanol = FluidUtils.generateFluidNoPrefix("butanol", "Butanol", 200, new short[] { 159, 58, 56, 100 }, true);
- }
- else {
- mButanol = FluidRegistry.getFluid("butanol");
- }
- }
-
-
-
+ public static Fluid mAceticAcid;
+ public static Fluid mPropionicAcid;
+ public static Fluid mFermentationBase;
+ public static Fluid mUrea;
+ public static Fluid mLiquidResin;
+ public static Fluid mAcetone;
+ public static Fluid mButanol;
+
+ public static void init() {
+ if (!FluidRegistry.isFluidRegistered("aceticacid")) {
+ mAceticAcid = FluidUtils.generateFluidNoPrefix(
+ "aceticacid", "Acetic Acid", 200, new short[] {97, 168, 96, 100}, true);
+ } else {
+ mAceticAcid = FluidRegistry.getFluid("aceticacid");
+ }
+ if (!FluidRegistry.isFluidRegistered("propionicacid")) {
+ mPropionicAcid = FluidUtils.generateFluidNoPrefix(
+ "propionicacid", "Propionic Acid", 200, new short[] {198, 209, 148, 100}, true);
+ } else {
+ mPropionicAcid = FluidRegistry.getFluid("propionicacid");
+ }
+ if (!FluidRegistry.isFluidRegistered("fermentation.base")) {
+ mFermentationBase = FluidUtils.generateFluidNoPrefix(
+ "fermentation.base", "Fermentation Base", 200, new short[] {107, 100, 63, 100}, true);
+ } else {
+ mFermentationBase = FluidRegistry.getFluid("fermentation.base");
+ }
+ if (!FluidRegistry.isFluidRegistered("ureamix")) {
+ mUrea = FluidUtils.generateFluidNoPrefix("ureamix", "Urea Mix", 200, new short[] {71, 55, 12, 100}, true);
+ } else {
+ mUrea = FluidRegistry.getFluid("ureamix");
+ }
+ if (!FluidRegistry.isFluidRegistered("liquidresin")) {
+ mLiquidResin = FluidUtils.generateFluidNoPrefix(
+ "liquidresin", "Liquid Resin", 200, new short[] {59, 58, 56, 100}, true);
+ } else {
+ mLiquidResin = FluidRegistry.getFluid("liquidresin");
+ }
+
+ if (!FluidRegistry.isFluidRegistered("acetone")) {
+ mAcetone = FluidUtils.generateFluidNoPrefix("acetone", "Acetone", 200, new short[] {59, 58, 56, 100}, true);
+ } else {
+ mAcetone = FluidRegistry.getFluid("acetone");
+ }
+ if (!FluidRegistry.isFluidRegistered("butanol")) {
+ mButanol =
+ FluidUtils.generateFluidNoPrefix("butanol", "Butanol", 200, new short[] {159, 58, 56, 100}, true);
+ } else {
+ mButanol = FluidRegistry.getFluid("butanol");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/fluids/FluidLoader.java b/src/main/java/gtPlusPlus/plugin/agrichem/fluids/FluidLoader.java
index a60a8c09de..24a0d5fb8f 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/fluids/FluidLoader.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/fluids/FluidLoader.java
@@ -3,19 +3,17 @@ package gtPlusPlus.plugin.agrichem.fluids;
import gtPlusPlus.core.fluids.FluidFactory;
public class FluidLoader {
-
- private static final int ID_DIRTY_WATER = 50;
- private static final int ID_RAW_SEWERAGE = 51;
- private static final int ID_GUANO = 52;
- private static final int ID_POOPJUICE = 53;
-
- public static void generate() {
- FluidFactory.generate(ID_DIRTY_WATER, "dirtywater", new short[] {25, 25, 180});
- FluidFactory.generate(ID_RAW_SEWERAGE, "sewerage", new short[] {100, 45, 25});
- FluidFactory.generate(ID_GUANO, "guano", new short[] {175, 175, 180});
- FluidFactory.generate(ID_POOPJUICE, "poo", new short[] {75, 45, 10});
-
- }
-
+ private static final int ID_DIRTY_WATER = 50;
+ private static final int ID_RAW_SEWERAGE = 51;
+ private static final int ID_GUANO = 52;
+ private static final int ID_POOPJUICE = 53;
+
+ public static void generate() {
+
+ FluidFactory.generate(ID_DIRTY_WATER, "dirtywater", new short[] {25, 25, 180});
+ FluidFactory.generate(ID_RAW_SEWERAGE, "sewerage", new short[] {100, 45, 25});
+ FluidFactory.generate(ID_GUANO, "guano", new short[] {175, 175, 180});
+ FluidFactory.generate(ID_POOPJUICE, "poo", new short[] {75, 45, 10});
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java
index abeebc054d..cd0007bf02 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java
@@ -1,15 +1,14 @@
package gtPlusPlus.plugin.agrichem.item.algae;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.OreDictUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.creativetab.CreativeTabs;
@@ -25,288 +24,269 @@ import net.minecraftforge.oredict.OreDictionary;
public class ItemAgrichemBase extends Item {
- final protected IIcon base[];
-
- /*
- * 0 - Algae Biomass
- * 1 - Green Algae Biomass
- * 2 - Brown Algae Biomass
- * 3 - Golden-Brown Algae Biomass
- * 4 - Red Algae Biomass
- * 5 - Cellulose Fiber
- * 6 - Golden-Brown Cellulose Fiber
- * 7 - Red Cellulose Fiber
- * 8 - Compost
- * 9 - Wood Pellet
- * 10 - Wood Brick
- * 11 - Cellulose Pulp
- * 12 - Raw Bio Resin
- * 13 - Catalyst Carrier
- * 14 - Green Metal Catalyst
- * 15 - Alginic Acid
- * 16 - Alumina
- * 17 - Aluminium Pellet
- * 18 - Sodium Aluminate
- * 19 - Sodium Hydroxide // Exists in Newer GT
- * 20 - Sodium Carbonate
- * 21 - Lithium Chloride
- * 22 - Pellet Mold
- * 23 - Clean Aluminium Mix
- * 24 - Pinecone
- * 25 - Crushed Pine
- */
-
- public ItemAgrichemBase() {
- this.setHasSubtypes(true);
- this.setNoRepair();
- this.setMaxStackSize(64);
- this.setMaxDamage(0);
- base = new IIcon[26];
- this.setUnlocalizedName("BasicAgrichemItem");
- GameRegistry.registerItem(this, this.getUnlocalizedName());
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean shouldRotateAroundWhenRendering() {
- return super.shouldRotateAroundWhenRendering();
- }
-
- @Override
- public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
- super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- return super.getItemStackDisplayName(aStack);
- }
-
- @Override
- public EnumRarity getRarity(ItemStack p_77613_1_) {
- return EnumRarity.common;
- }
-
- @Override
- public boolean requiresMultipleRenderPasses() {
- return false;
- }
-
- private static boolean mHasCheckedForSodiumHydroxide = false;
- private static boolean mShowSodiumHydroxide = true;
-
- private static boolean checkSodiumHydroxide() {
- if (mHasCheckedForSodiumHydroxide) {
- return mShowSodiumHydroxide;
- }
- else {
- if (OreDictUtils.containsValidEntries("dustSodiumHydroxide_GT5U")
- || OreDictUtils.containsValidEntries("dustSodiumHydroxide")) {
- List<ItemStack> aTest = OreDictionary.getOres(
- "dustSodiumHydroxide", false
- );
- if (aTest.isEmpty()) {
- aTest = OreDictionary.getOres(
- "dustSodiumHydroxide_GT5U", false
- );
- if (!aTest.isEmpty()) {
- mShowSodiumHydroxide = false;
- }
- }
- else {
- mShowSodiumHydroxide = false;
- }
- }
- }
- mHasCheckedForSodiumHydroxide = true;
- return mShowSodiumHydroxide;
- }
-
- @Override
- public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
- for (int i=0;i<base.length;i++) {
- if (i == 19) {
- // Only show if it doesn't exist.
- if (checkSodiumHydroxide()) {
- aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
- }
- }
- else {
- aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
- }
- }
- }
-
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return stack.getItemDamage();
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public void registerIcons(final IIconRegister u) {
- for (int i=0;i<this.base.length;i++) {
- String aPath = CORE.MODID + ":" + "bioscience/MetaItem1/"+i;
- this.base[i] = u.registerIcon(aPath);
- }
- }
-
-
- private boolean isTextureValid(String aPath) {
- if (aPath == null) {
- return false;
- }
- else if (aPath.indexOf(92) == -1) {
- Constructor aTextureAtlasSprite = ReflectionUtils.getConstructor(
- TextureAtlasSprite.class, String.class
- );
- if (aTextureAtlasSprite != null) {
- try {
- TextureAtlasSprite aTestAtlas = (TextureAtlasSprite) aTextureAtlasSprite.newInstance(
- aPath
- );
- if (aTestAtlas != null) {
- return true;
- }
- }
- catch (InstantiationException | IllegalAccessException
- | IllegalArgumentException
- | InvocationTargetException e) {
- }
- }
- }
- return false;
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- return this.base[damage];
- }
-
- @Override
- public IIcon getIconFromDamage(int damage) {
- return this.base[damage];
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- return this.base[stack.getItemDamage()];
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return this.base[stack.getItemDamage()];
- }
-
- @Override
+ protected final IIcon base[];
+
+ /*
+ * 0 - Algae Biomass
+ * 1 - Green Algae Biomass
+ * 2 - Brown Algae Biomass
+ * 3 - Golden-Brown Algae Biomass
+ * 4 - Red Algae Biomass
+ * 5 - Cellulose Fiber
+ * 6 - Golden-Brown Cellulose Fiber
+ * 7 - Red Cellulose Fiber
+ * 8 - Compost
+ * 9 - Wood Pellet
+ * 10 - Wood Brick
+ * 11 - Cellulose Pulp
+ * 12 - Raw Bio Resin
+ * 13 - Catalyst Carrier
+ * 14 - Green Metal Catalyst
+ * 15 - Alginic Acid
+ * 16 - Alumina
+ * 17 - Aluminium Pellet
+ * 18 - Sodium Aluminate
+ * 19 - Sodium Hydroxide // Exists in Newer GT
+ * 20 - Sodium Carbonate
+ * 21 - Lithium Chloride
+ * 22 - Pellet Mold
+ * 23 - Clean Aluminium Mix
+ * 24 - Pinecone
+ * 25 - Crushed Pine
+ */
+
+ public ItemAgrichemBase() {
+ this.setHasSubtypes(true);
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ base = new IIcon[26];
+ this.setUnlocalizedName("BasicAgrichemItem");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(
+ ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.common;
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return false;
+ }
+
+ private static boolean mHasCheckedForSodiumHydroxide = false;
+ private static boolean mShowSodiumHydroxide = true;
+
+ private static boolean checkSodiumHydroxide() {
+ if (mHasCheckedForSodiumHydroxide) {
+ return mShowSodiumHydroxide;
+ } else {
+ if (OreDictUtils.containsValidEntries("dustSodiumHydroxide_GT5U")
+ || OreDictUtils.containsValidEntries("dustSodiumHydroxide")) {
+ List<ItemStack> aTest = OreDictionary.getOres("dustSodiumHydroxide", false);
+ if (aTest.isEmpty()) {
+ aTest = OreDictionary.getOres("dustSodiumHydroxide_GT5U", false);
+ if (!aTest.isEmpty()) {
+ mShowSodiumHydroxide = false;
+ }
+ } else {
+ mShowSodiumHydroxide = false;
+ }
+ }
+ }
+ mHasCheckedForSodiumHydroxide = true;
+ return mShowSodiumHydroxide;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ for (int i = 0; i < base.length; i++) {
+ if (i == 19) {
+ // Only show if it doesn't exist.
+ if (checkSodiumHydroxide()) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ } else {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ for (int i = 0; i < this.base.length; i++) {
+ String aPath = CORE.MODID + ":" + "bioscience/MetaItem1/" + i;
+ this.base[i] = u.registerIcon(aPath);
+ }
+ }
+
+ private boolean isTextureValid(String aPath) {
+ if (aPath == null) {
+ return false;
+ } else if (aPath.indexOf(92) == -1) {
+ Constructor aTextureAtlasSprite = ReflectionUtils.getConstructor(TextureAtlasSprite.class, String.class);
+ if (aTextureAtlasSprite != null) {
+ try {
+ TextureAtlasSprite aTestAtlas = (TextureAtlasSprite) aTextureAtlasSprite.newInstance(aPath);
+ if (aTestAtlas != null) {
+ return true;
+ }
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
public String getUnlocalizedName(ItemStack stack) {
- return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack aStack) {
+ if (ItemUtils.isCatalyst(aStack)) {
+ if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
+ createCatalystNBT(aStack);
+ }
+ double currentDamage = getCatalystDamage(aStack);
+ return currentDamage / getCatalystMaxDamage(aStack);
+ } else {
+ return 1D;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) {
+ boolean aHasSpecialTooltips = false;
+ int aMaxDamage = 0;
+ int aDamageSegment = 0;
+ int aDam = 0;
+ EnumChatFormatting durability = EnumChatFormatting.GRAY;
+ if (ItemUtils.isCatalyst(aStack)) {
+ list.add(EnumChatFormatting.GRAY + "Active Reaction Agent");
+ aMaxDamage = getCatalystMaxDamage(aStack);
+ aDamageSegment = aMaxDamage / 5;
+ aDam = aMaxDamage - getCatalystDamage(aStack);
+ aHasSpecialTooltips = true;
+ }
+ if (aHasSpecialTooltips) {
+ if (aDam > aDamageSegment * 3) {
+ durability = EnumChatFormatting.GREEN;
+ } else if (aDam > aDamageSegment * 2) {
+ durability = EnumChatFormatting.YELLOW;
+ } else if (aDam > aDamageSegment) {
+ durability = EnumChatFormatting.GOLD;
+ } else if (aDam >= 0) {
+ durability = EnumChatFormatting.RED;
+ }
+ list.add(durability + "" + (aDam) + EnumChatFormatting.GRAY + " / " + aMaxDamage);
+ }
+ super.addInformation(aStack, player, list, bool);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack aStack) {
+ if (ItemUtils.isCatalyst(aStack)) {
+ int aDam = getCatalystDamage(aStack);
+ return aDam > 0;
+ }
+ return false;
+ }
+
+ public static boolean createCatalystNBT(ItemStack rStack) {
+ return ItemGenericChemBase.createCatalystNBT(rStack);
+ }
+
+ public static int getCatalystDamage(ItemStack aStack) {
+ return ItemGenericChemBase.getCatalystDamage(aStack);
+ }
+
+ public static int getCatalystMaxDamage(ItemStack aStack) {
+ return ItemGenericChemBase.getCatalystMaxDamage(aStack);
+ }
+
+ public static void setCatalystDamage(ItemStack aStack, int aAmount) {
+ ItemGenericChemBase.setCatalystDamage(aStack, aAmount);
}
-
-
-
- @Override
- public double getDurabilityForDisplay(ItemStack aStack) {
- if (ItemUtils.isCatalyst(aStack)) {
- if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()){
- createCatalystNBT(aStack);
- }
- double currentDamage = getCatalystDamage(aStack);
- return currentDamage / getCatalystMaxDamage(aStack);
- }
- else {
- return 1D;
- }
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) {
- boolean aHasSpecialTooltips = false;
- int aMaxDamage = 0;
- int aDamageSegment = 0;
- int aDam = 0;
- EnumChatFormatting durability = EnumChatFormatting.GRAY;
- if (ItemUtils.isCatalyst(aStack)) {
- list.add(EnumChatFormatting.GRAY+"Active Reaction Agent");
- aMaxDamage = getCatalystMaxDamage(aStack);
- aDamageSegment = aMaxDamage / 5;
- aDam = aMaxDamage-getCatalystDamage(aStack);
- aHasSpecialTooltips = true;
- }
- if (aHasSpecialTooltips) {
- if (aDam > aDamageSegment * 3){
- durability = EnumChatFormatting.GREEN;
- }
- else if (aDam > aDamageSegment * 2){
- durability = EnumChatFormatting.YELLOW;
- }
- else if (aDam > aDamageSegment){
- durability = EnumChatFormatting.GOLD;
- }
- else if (aDam >= 0){
- durability = EnumChatFormatting.RED;
- }
- list.add(durability+""+(aDam)+EnumChatFormatting.GRAY+" / "+aMaxDamage);
- }
- super.addInformation(aStack, player, list, bool);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack aStack) {
- if (ItemUtils.isCatalyst(aStack)) {
- int aDam = getCatalystDamage(aStack);
- return aDam > 0;
- }
- return false;
- }
-
- public static boolean createCatalystNBT(ItemStack rStack){
- return ItemGenericChemBase.createCatalystNBT(rStack);
- }
-
- public static int getCatalystDamage(ItemStack aStack) {
- return ItemGenericChemBase.getCatalystDamage(aStack);
- }
-
- public static int getCatalystMaxDamage(ItemStack aStack) {
- return ItemGenericChemBase.getCatalystMaxDamage(aStack);
- }
-
- public static void setCatalystDamage(ItemStack aStack,int aAmount) {
- ItemGenericChemBase.setCatalystDamage(aStack, aAmount);
- }
-
- public static int getMaxCatalystDurability(ItemStack aStack) {
- return ItemGenericChemBase.getMaxCatalystDurability(aStack);
- }
+ public static int getMaxCatalystDurability(ItemStack aStack) {
+ return ItemGenericChemBase.getMaxCatalystDurability(aStack);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
index 6b31a42809..89c8447b84 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
@@ -1,7 +1,5 @@
package gtPlusPlus.plugin.agrichem.item.algae;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
@@ -10,6 +8,7 @@ import gtPlusPlus.plugin.agrichem.AlgaeDefinition;
import gtPlusPlus.plugin.agrichem.IAlgalItem;
import gtPlusPlus.plugin.agrichem.logic.AlgaeGeneticData;
import gtPlusPlus.plugin.agrichem.logic.AlgaeGrowthRequirement;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -24,212 +23,203 @@ import net.minecraft.world.World;
public class ItemAlgaeBase extends Item implements IAlgalItem {
- protected IIcon base;
- protected IIcon overlay;
-
- public ItemAlgaeBase() {
- this.setHasSubtypes(true);
- this.setMaxDamage(127);
- this.setNoRepair();
- this.setMaxStackSize(32);
- this.setUnlocalizedName("BasicAlgaeItem");
- GameRegistry.registerItem(this, this.getUnlocalizedName());
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean shouldRotateAroundWhenRendering() {
- return super.shouldRotateAroundWhenRendering();
- }
-
- @Override
- public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
- if (!p_77663_1_.hasTagCompound() || p_77663_1_.getTagCompound().hasNoTags()) {
- p_77663_1_ = initNBT(p_77663_1_);
- }
- super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- return EnumChatFormatting.UNDERLINE+super.getItemStackDisplayName(aStack);
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
- int aDam = aStack.getItemDamage();
- try {
- aList.add(AlgaeDefinition.getByIndex(aDam).mSimpleName);
- if (!aStack.hasTagCompound() || aStack.getTagCompound().hasNoTags()) {
- aStack = initNBT(aStack);
- }
- else {
- NBTTagCompound aNBT = aStack.getTagCompound();
- boolean mRequiresLight = aNBT.getBoolean("mRequiresLight");
- boolean mSaltWater = aNBT.getBoolean("mSaltWater");
- boolean mFreshWater = aNBT.getBoolean("mFreshWater");
- byte mTempTolerance = aNBT.getByte("mTempTolerance");
- float mFertility = aNBT.getFloat("mFertility");
- float mProductionSpeed = aNBT.getFloat("mProductionSpeed");
- byte mLifespan = aNBT.getByte("mLifespan");
- int mGeneration = aNBT.getInteger("mGeneration");
-
- aList.add("Requires Light: "+mRequiresLight);
- aList.add("Salt Water: "+mSaltWater);
- aList.add("Fresh Water: "+mFreshWater);
- aList.add("Temp Tolerance: "+mTempTolerance);
- aList.add("Growth: "+mFertility);
- aList.add("Production: "+mProductionSpeed);
- aList.add("Lifespan in days: "+mLifespan);
- aList.add("Generation: "+mGeneration);
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
- }
-
- @Override
- public EnumRarity getRarity(ItemStack p_77613_1_) {
- return EnumRarity.uncommon;
- }
-
- @Override
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
- @Override
- public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
- for (int i=0;i<AlgaeDefinition.values().length;i++) {
- aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
- }
- }
-
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return stack.getItemDamage();
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public int getColorFromItemStack(ItemStack aStack, int aMeta) {
- return AlgaeDefinition.getByIndex(aStack.getItemDamage()).mColour;
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if(pass == 0) {
- return this.base;
- }
- return this.overlay;
- }
-
- @Override
- public void registerIcons(final IIconRegister i) {
- this.base = i.registerIcon(CORE.MODID + ":" + "bioscience/BasicAlgae");
- this.overlay = i.registerIcon(CORE.MODID + ":" + "bioscience/BasicAlgae" + "_Overlay");
- }
-
- public static ItemStack initNBT(ItemStack aFreshAlgae) {
- NBTTagCompound aNewTag = new NBTTagCompound();
- ItemAlgaeBase aItem;
- if (aFreshAlgae.getItem() instanceof ItemAlgaeBase) {
- aItem = (ItemAlgaeBase) aFreshAlgae.getItem();
- if (!aFreshAlgae.hasTagCompound()) {
- AlgaeGeneticData y = aItem.getSpeciesData(aFreshAlgae);
- aNewTag = y.writeToNBT();
- aFreshAlgae.setTagCompound(aNewTag);
- }
- else {
- aNewTag = aFreshAlgae.getTagCompound();
- }
- }
- return aFreshAlgae;
- }
-
- @Override
- public AlgaeDefinition getAlgaeType(ItemStack aStack) {
- return AlgaeDefinition.getByIndex(aStack != null ? aStack.getItemDamage() : 3);
- }
-
- @Override
- public AlgaeGeneticData getSpeciesData(ItemStack aStack) {
- NBTTagCompound aTag;
- if (!aStack.hasTagCompound() || aStack.getTagCompound().hasNoTags()) {
- aTag = new NBTTagCompound();
- AlgaeGeneticData aGenes;
- if (aStack.getItemDamage() < 3 || aStack.getItemDamage() > 5) {
- aGenes = new AlgaeGeneticData();
- aTag = aGenes.writeToNBT();
- }
- else {
- byte aTemp, aLifespan;
- float aFert, aSpeed;
-
- int aDam = aStack.getItemDamage();
- aTemp = (byte) (aDam == 3 ? 0 : aDam == 4 ? 2 : 1);
- aLifespan = (byte) (aDam == 3 ? 1 : aDam == 4 ? 3f : 2f);
- aFert = (float) (aDam == 3 ? 2f : aDam == 4 ? 1f : 1.75f);
- aSpeed = (float) (aDam == 3 ? 1f : aDam == 4 ? 1.5f : 2f);
-
- aGenes = new AlgaeGeneticData(
- true, true,
- AlgaeDefinition.getByIndex(aDam).mSaltWater, AlgaeDefinition.getByIndex(aDam).mFreshWater,
- aTemp,
- aFert,
- aSpeed,
- aLifespan,
- 0,
- new AutoMap<AlgaeGrowthRequirement>());
- aTag = aGenes.writeToNBT();
- }
- }
- else {
- aTag = aStack.getTagCompound();
- }
-
-
-
-
- return new AlgaeGeneticData(aTag);
- }
-
-
-
-
+ protected IIcon base;
+ protected IIcon overlay;
+
+ public ItemAlgaeBase() {
+ this.setHasSubtypes(true);
+ this.setMaxDamage(127);
+ this.setNoRepair();
+ this.setMaxStackSize(32);
+ this.setUnlocalizedName("BasicAlgaeItem");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(
+ ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ if (!p_77663_1_.hasTagCompound() || p_77663_1_.getTagCompound().hasNoTags()) {
+ p_77663_1_ = initNBT(p_77663_1_);
+ }
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return EnumChatFormatting.UNDERLINE + super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ int aDam = aStack.getItemDamage();
+ try {
+ aList.add(AlgaeDefinition.getByIndex(aDam).mSimpleName);
+ if (!aStack.hasTagCompound() || aStack.getTagCompound().hasNoTags()) {
+ aStack = initNBT(aStack);
+ } else {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ boolean mRequiresLight = aNBT.getBoolean("mRequiresLight");
+ boolean mSaltWater = aNBT.getBoolean("mSaltWater");
+ boolean mFreshWater = aNBT.getBoolean("mFreshWater");
+ byte mTempTolerance = aNBT.getByte("mTempTolerance");
+ float mFertility = aNBT.getFloat("mFertility");
+ float mProductionSpeed = aNBT.getFloat("mProductionSpeed");
+ byte mLifespan = aNBT.getByte("mLifespan");
+ int mGeneration = aNBT.getInteger("mGeneration");
+
+ aList.add("Requires Light: " + mRequiresLight);
+ aList.add("Salt Water: " + mSaltWater);
+ aList.add("Fresh Water: " + mFreshWater);
+ aList.add("Temp Tolerance: " + mTempTolerance);
+ aList.add("Growth: " + mFertility);
+ aList.add("Production: " + mProductionSpeed);
+ aList.add("Lifespan in days: " + mLifespan);
+ aList.add("Generation: " + mGeneration);
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ for (int i = 0; i < AlgaeDefinition.values().length; i++) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack aStack, int aMeta) {
+ return AlgaeDefinition.getByIndex(aStack.getItemDamage()).mColour;
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if (pass == 0) {
+ return this.base;
+ }
+ return this.overlay;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister i) {
+ this.base = i.registerIcon(CORE.MODID + ":" + "bioscience/BasicAlgae");
+ this.overlay = i.registerIcon(CORE.MODID + ":" + "bioscience/BasicAlgae" + "_Overlay");
+ }
+
+ public static ItemStack initNBT(ItemStack aFreshAlgae) {
+ NBTTagCompound aNewTag = new NBTTagCompound();
+ ItemAlgaeBase aItem;
+ if (aFreshAlgae.getItem() instanceof ItemAlgaeBase) {
+ aItem = (ItemAlgaeBase) aFreshAlgae.getItem();
+ if (!aFreshAlgae.hasTagCompound()) {
+ AlgaeGeneticData y = aItem.getSpeciesData(aFreshAlgae);
+ aNewTag = y.writeToNBT();
+ aFreshAlgae.setTagCompound(aNewTag);
+ } else {
+ aNewTag = aFreshAlgae.getTagCompound();
+ }
+ }
+ return aFreshAlgae;
+ }
+
+ @Override
+ public AlgaeDefinition getAlgaeType(ItemStack aStack) {
+ return AlgaeDefinition.getByIndex(aStack != null ? aStack.getItemDamage() : 3);
+ }
+
+ @Override
+ public AlgaeGeneticData getSpeciesData(ItemStack aStack) {
+ NBTTagCompound aTag;
+ if (!aStack.hasTagCompound() || aStack.getTagCompound().hasNoTags()) {
+ aTag = new NBTTagCompound();
+ AlgaeGeneticData aGenes;
+ if (aStack.getItemDamage() < 3 || aStack.getItemDamage() > 5) {
+ aGenes = new AlgaeGeneticData();
+ aTag = aGenes.writeToNBT();
+ } else {
+ byte aTemp, aLifespan;
+ float aFert, aSpeed;
+
+ int aDam = aStack.getItemDamage();
+ aTemp = (byte) (aDam == 3 ? 0 : aDam == 4 ? 2 : 1);
+ aLifespan = (byte) (aDam == 3 ? 1 : aDam == 4 ? 3f : 2f);
+ aFert = (float) (aDam == 3 ? 2f : aDam == 4 ? 1f : 1.75f);
+ aSpeed = (float) (aDam == 3 ? 1f : aDam == 4 ? 1.5f : 2f);
+
+ aGenes = new AlgaeGeneticData(
+ true,
+ true,
+ AlgaeDefinition.getByIndex(aDam).mSaltWater,
+ AlgaeDefinition.getByIndex(aDam).mFreshWater,
+ aTemp,
+ aFert,
+ aSpeed,
+ aLifespan,
+ 0,
+ new AutoMap<AlgaeGrowthRequirement>());
+ aTag = aGenes.writeToNBT();
+ }
+ } else {
+ aTag = aStack.getTagCompound();
+ }
+
+ return new AlgaeGeneticData(aTag);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java
index f876839f5f..7e4c68b2f4 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java
@@ -1,9 +1,5 @@
package gtPlusPlus.plugin.agrichem.item.algae;
-import java.util.*;
-import java.util.function.BiFunction;
-import java.util.function.Predicate;
-
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
@@ -16,6 +12,9 @@ import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.*;
+import java.util.function.BiFunction;
+import java.util.function.Predicate;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -32,207 +31,230 @@ import net.minecraftforge.common.util.FakePlayer;
import org.apache.commons.lang3.tuple.Pair;
public class ItemBioChip extends Item implements INetworkUpdatableItem {
- private static final List<ItemStack> ALL_VARIANTS = new ArrayList<>();
-
- protected IIcon base;
-
- public ItemBioChip() {
- this.setHasSubtypes(true);
- this.setNoRepair();
- this.setMaxStackSize(64);
- this.setMaxDamage(0);
- this.setUnlocalizedName("BioRecipeSelector");
- GameRegistry.registerItem(this, this.getUnlocalizedName());
- ALL_VARIANTS.add(new ItemStack(this, 0, 0));
- for (int i = 1; i <= 24; i++) {
- ItemStack aStack = new ItemStack(this, 0, i);
- ALL_VARIANTS.add(aStack);
- }
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean shouldRotateAroundWhenRendering() {
- return super.shouldRotateAroundWhenRendering();
- }
-
- @Override
- public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
- super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- return super.getItemStackDisplayName(aStack);
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
- try {
- aList.add("Configuration == "+aStack.getItemDamage());
- aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".tooltip.0").toString(), "Right click to reconfigure"));
- aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".tooltip.1").toString(), "Needs a screwdriver or circuit programming tool"));
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
- }
-
- @Override
- public EnumRarity getRarity(ItemStack p_77613_1_) {
- return EnumRarity.common;
- }
-
- @Override
- public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
- aList.add(ItemUtils.simpleMetaStack(aItem, 0, 1));
- }
-
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return stack.getItemDamage();
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public void registerIcons(final IIconRegister u) {
- this.base = u.registerIcon(CORE.MODID + ":" + "bioscience/BioCircuit");
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- return this.base;
- }
-
- @Override
- public IIcon getIconFromDamage(int damage) {
- return this.base;
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- return this.base;
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return this.base;
- }
-
- @Override
+ private static final List<ItemStack> ALL_VARIANTS = new ArrayList<>();
+
+ protected IIcon base;
+
+ public ItemBioChip() {
+ this.setHasSubtypes(true);
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ this.setUnlocalizedName("BioRecipeSelector");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ ALL_VARIANTS.add(new ItemStack(this, 0, 0));
+ for (int i = 1; i <= 24; i++) {
+ ItemStack aStack = new ItemStack(this, 0, i);
+ ALL_VARIANTS.add(aStack);
+ }
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(
+ ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ try {
+ aList.add("Configuration == " + aStack.getItemDamage());
+ aList.add(GT_LanguageManager.addStringLocalization(
+ new StringBuilder()
+ .append(getUnlocalizedName())
+ .append(".tooltip.0")
+ .toString(),
+ "Right click to reconfigure"));
+ aList.add(GT_LanguageManager.addStringLocalization(
+ new StringBuilder()
+ .append(getUnlocalizedName())
+ .append(".tooltip.1")
+ .toString(),
+ "Needs a screwdriver or circuit programming tool"));
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.common;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, 0, 1));
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ this.base = u.registerIcon(CORE.MODID + ":" + "bioscience/BioCircuit");
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ return this.base;
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return this.base;
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return this.base;
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return this.base;
+ }
+
+ @Override
public String getUnlocalizedName(ItemStack stack) {
- return super.getUnlocalizedName();
- }
-
- @Override
- public boolean receive(ItemStack stack, EntityPlayerMP player, NBTTagCompound tag) {
- int meta = tag.hasKey("meta", Constants.NBT.TAG_BYTE) ? tag.getByte("meta") : -1;
- if (meta < 0 || meta > 24)
- return true;
-
- if (!player.capabilities.isCreativeMode) {
- Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> toolIndex = findConfiguratorInInv(player);
- if (toolIndex == null) return true;
-
- ItemStack[] mainInventory = player.inventory.mainInventory;
- mainInventory[toolIndex.getKey()] = toolIndex.getValue().apply(mainInventory[toolIndex.getKey()], player);
- }
- stack.setItemDamage(meta);
-
- return true;
- }
-
- @Override
- public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
- // nothing on server side or fake player
- if (player instanceof FakePlayer || !world.isRemote) return false;
- // check if any screwdriver
- ItemStack configuratorStack;
- if (player.capabilities.isCreativeMode) {
- configuratorStack = null;
- } else {
- Pair<Integer, ?> configurator = findConfiguratorInInv(player);
- if (configurator == null) {
- int count;
- try {
- count = Integer.parseInt(StatCollector.translateToLocal("GT5U.item.programmed_circuit.no_screwdriver.count"));
- } catch (NumberFormatException e) {
- player.addChatComponentMessage(new ChatComponentText("Error in translation GT5U.item.programmed_circuit.no_screwdriver.count: " + e.getMessage()));
- count = 1;
- }
- player.addChatComponentMessage(new ChatComponentTranslation("GT5U.item.programmed_circuit.no_screwdriver." + XSTR.XSTR_INSTANCE.nextInt(count)));
- return false;
- }
- configuratorStack = player.inventory.mainInventory[configurator.getKey()];
- }
- openSelectorGui(configuratorStack, stack.getItemDamage());
- return true;
- }
-
- private void openSelectorGui(ItemStack configurator, int meta) {
- FMLCommonHandler.instance().showGuiScreen(new GT_GUIDialogSelectItem(
- StatCollector.translateToLocal("GT5U.item.programmed_circuit.select.header"),
- configurator,
- null,
- ItemBioChip::onConfigured,
- ALL_VARIANTS,
- meta,
- true
- ));
- }
-
- private static void onConfigured(ItemStack stack) {
- NBTTagCompound tag = new NBTTagCompound();
- tag.setByte("meta", (byte) stack.getItemDamage());
- GT_Values.NW.sendToServer(new GT_Packet_UpdateItem(tag));
- }
-
- private static Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> findConfiguratorInInv(EntityPlayer player) {
- ItemStack[] mainInventory = player.inventory.mainInventory;
- for (int j = 0, mainInventoryLength = mainInventory.length; j < mainInventoryLength; j++) {
- ItemStack toolStack = mainInventory[j];
-
- if (!GT_Utility.isStackValid(toolStack))
- continue;
-
- for (Map.Entry<Predicate<ItemStack>, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> p : GregTech_API.sCircuitProgrammerList.entrySet())
- if (p.getKey().test(toolStack))
- return Pair.of(j, p.getValue());
- }
- return null;
- }
+ return super.getUnlocalizedName();
+ }
+
+ @Override
+ public boolean receive(ItemStack stack, EntityPlayerMP player, NBTTagCompound tag) {
+ int meta = tag.hasKey("meta", Constants.NBT.TAG_BYTE) ? tag.getByte("meta") : -1;
+ if (meta < 0 || meta > 24) return true;
+
+ if (!player.capabilities.isCreativeMode) {
+ Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> toolIndex = findConfiguratorInInv(player);
+ if (toolIndex == null) return true;
+
+ ItemStack[] mainInventory = player.inventory.mainInventory;
+ mainInventory[toolIndex.getKey()] = toolIndex.getValue().apply(mainInventory[toolIndex.getKey()], player);
+ }
+ stack.setItemDamage(meta);
+
+ return true;
+ }
+
+ @Override
+ public boolean onItemUse(
+ ItemStack stack,
+ EntityPlayer player,
+ World world,
+ int x,
+ int y,
+ int z,
+ int side,
+ float xOffset,
+ float yOffset,
+ float zOffset) {
+ // nothing on server side or fake player
+ if (player instanceof FakePlayer || !world.isRemote) return false;
+ // check if any screwdriver
+ ItemStack configuratorStack;
+ if (player.capabilities.isCreativeMode) {
+ configuratorStack = null;
+ } else {
+ Pair<Integer, ?> configurator = findConfiguratorInInv(player);
+ if (configurator == null) {
+ int count;
+ try {
+ count = Integer.parseInt(
+ StatCollector.translateToLocal("GT5U.item.programmed_circuit.no_screwdriver.count"));
+ } catch (NumberFormatException e) {
+ player.addChatComponentMessage(new ChatComponentText(
+ "Error in translation GT5U.item.programmed_circuit.no_screwdriver.count: "
+ + e.getMessage()));
+ count = 1;
+ }
+ player.addChatComponentMessage(new ChatComponentTranslation(
+ "GT5U.item.programmed_circuit.no_screwdriver." + XSTR.XSTR_INSTANCE.nextInt(count)));
+ return false;
+ }
+ configuratorStack = player.inventory.mainInventory[configurator.getKey()];
+ }
+ openSelectorGui(configuratorStack, stack.getItemDamage());
+ return true;
+ }
+
+ private void openSelectorGui(ItemStack configurator, int meta) {
+ FMLCommonHandler.instance()
+ .showGuiScreen(new GT_GUIDialogSelectItem(
+ StatCollector.translateToLocal("GT5U.item.programmed_circuit.select.header"),
+ configurator,
+ null,
+ ItemBioChip::onConfigured,
+ ALL_VARIANTS,
+ meta,
+ true));
+ }
+
+ private static void onConfigured(ItemStack stack) {
+ NBTTagCompound tag = new NBTTagCompound();
+ tag.setByte("meta", (byte) stack.getItemDamage());
+ GT_Values.NW.sendToServer(new GT_Packet_UpdateItem(tag));
+ }
+
+ private static Pair<Integer, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> findConfiguratorInInv(
+ EntityPlayer player) {
+ ItemStack[] mainInventory = player.inventory.mainInventory;
+ for (int j = 0, mainInventoryLength = mainInventory.length; j < mainInventoryLength; j++) {
+ ItemStack toolStack = mainInventory[j];
+
+ if (!GT_Utility.isStackValid(toolStack)) continue;
+
+ for (Map.Entry<Predicate<ItemStack>, BiFunction<ItemStack, EntityPlayerMP, ItemStack>> p :
+ GregTech_API.sCircuitProgrammerList.entrySet())
+ if (p.getKey().test(toolStack)) return Pair.of(j, p.getValue());
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java b/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java
index dfe0f50b47..3e0bbafeeb 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java
@@ -4,127 +4,133 @@ import gtPlusPlus.api.objects.data.AutoMap;
import net.minecraft.nbt.NBTTagCompound;
public class AlgaeGeneticData {
-
- private final int mLifespan;
-
- private final int mGeneration;
-
- private final boolean mIsDominant;
-
- private final boolean mRequiresLight;
-
- private final boolean mSaltWater;
-
- private final boolean mFreshWater;
-
- private final byte mTempTolerance;
-
- private final float mFertility;
-
- private final float mProductionSpeed;
-
- private final AutoMap<AlgaeGrowthRequirement> mSpecialRequirements;
-
-
- public AlgaeGeneticData() {
- this(true, true, true, true, (byte) 0, 1f, 1f, (byte) 30, 0, new AutoMap<AlgaeGrowthRequirement>());
- }
-
- public AlgaeGeneticData(boolean isDominant, boolean requiresLight, boolean isSalt, boolean isFresh,
- byte aTempTolerance, float aFertility, float aSpeed, byte aLifespan, int aGeneration, AutoMap<AlgaeGrowthRequirement> aRequirements) {
- mIsDominant = isDominant;
- mRequiresLight = requiresLight;
- mSaltWater = isSalt;
- mFreshWater = isFresh;
- mTempTolerance = aTempTolerance;
- mFertility = aFertility;
- mProductionSpeed = aSpeed;
- mLifespan = aLifespan;
- mGeneration = aGeneration;
- mSpecialRequirements = aRequirements;
- }
-
-
- public AlgaeGeneticData(NBTTagCompound aNBT) {
- if (aNBT == null || aNBT.hasNoTags()) {
- mIsDominant = true;
- mRequiresLight = true;
- mSaltWater = true;
- mFreshWater = true;
- mTempTolerance = 0;
- mFertility = 1;
- mProductionSpeed = 1;
- mLifespan = 30;
- mGeneration = 0;
- }
- else {
- mIsDominant = aNBT.getBoolean("mIsDominant");
- mRequiresLight = aNBT.getBoolean("mRequiresLight");
- mSaltWater = aNBT.getBoolean("mSaltWater");
- mFreshWater = aNBT.getBoolean("mFreshWater");
- mTempTolerance = aNBT.getByte("mTempTolerance");
- mFertility = aNBT.getFloat("mFertility");
- mProductionSpeed = aNBT.getFloat("mProductionSpeed");
- mLifespan = aNBT.getByte("mLifespan");
- mGeneration = aNBT.getInteger("mGeneration");
- }
- mSpecialRequirements = new AutoMap<AlgaeGrowthRequirement>();
- }
-
- /**
- * In MC Days
- */
- public final int getLifespan() {
- return this.mLifespan;
- }
-
- public final boolean isDominant() {
- return this.mIsDominant;
- }
-
- public final boolean RequiresLight() {
- return this.mRequiresLight;
- }
-
- public final boolean isSaltWater() {
- return this.mSaltWater;
- }
-
- public final boolean isFreshWater() {
- return this.mFreshWater;
- }
-
- public final byte getTempTolerance() {
- return this.mTempTolerance;
- }
-
- public final float getFertility() {
- return this.mFertility;
- }
-
- public final float getProductionSpeed() {
- return this.mProductionSpeed;
- }
-
- public final int getGeneration() {
- return this.mGeneration;
- }
-
- public final AutoMap<AlgaeGrowthRequirement> getSpecialRequirements() {
- return this.mSpecialRequirements;
- }
-
- public NBTTagCompound writeToNBT() {
- NBTTagCompound aGenes = new NBTTagCompound();
- aGenes.setBoolean("mIsDominant", this.mIsDominant);
- aGenes.setBoolean("mRequiresLight", this.mRequiresLight);
- aGenes.setBoolean("mSaltWater", this.mSaltWater);
- aGenes.setBoolean("mFreshWater", this.mFreshWater);
- aGenes.setInteger("mLifespan", this.mLifespan);
- aGenes.setInteger("mGeneration", this.mGeneration);
- aGenes.setByte("mTempTolerance", this.mTempTolerance);
- aGenes.setFloat("mFertility", this.mFertility);
- aGenes.setFloat("mProductionSpeed", this.mProductionSpeed);
- return aGenes;
- }
+
+ private final int mLifespan;
+
+ private final int mGeneration;
+
+ private final boolean mIsDominant;
+
+ private final boolean mRequiresLight;
+
+ private final boolean mSaltWater;
+
+ private final boolean mFreshWater;
+
+ private final byte mTempTolerance;
+
+ private final float mFertility;
+
+ private final float mProductionSpeed;
+
+ private final AutoMap<AlgaeGrowthRequirement> mSpecialRequirements;
+
+ public AlgaeGeneticData() {
+ this(true, true, true, true, (byte) 0, 1f, 1f, (byte) 30, 0, new AutoMap<AlgaeGrowthRequirement>());
+ }
+
+ public AlgaeGeneticData(
+ boolean isDominant,
+ boolean requiresLight,
+ boolean isSalt,
+ boolean isFresh,
+ byte aTempTolerance,
+ float aFertility,
+ float aSpeed,
+ byte aLifespan,
+ int aGeneration,
+ AutoMap<AlgaeGrowthRequirement> aRequirements) {
+ mIsDominant = isDominant;
+ mRequiresLight = requiresLight;
+ mSaltWater = isSalt;
+ mFreshWater = isFresh;
+ mTempTolerance = aTempTolerance;
+ mFertility = aFertility;
+ mProductionSpeed = aSpeed;
+ mLifespan = aLifespan;
+ mGeneration = aGeneration;
+ mSpecialRequirements = aRequirements;
+ }
+
+ public AlgaeGeneticData(NBTTagCompound aNBT) {
+ if (aNBT == null || aNBT.hasNoTags()) {
+ mIsDominant = true;
+ mRequiresLight = true;
+ mSaltWater = true;
+ mFreshWater = true;
+ mTempTolerance = 0;
+ mFertility = 1;
+ mProductionSpeed = 1;
+ mLifespan = 30;
+ mGeneration = 0;
+ } else {
+ mIsDominant = aNBT.getBoolean("mIsDominant");
+ mRequiresLight = aNBT.getBoolean("mRequiresLight");
+ mSaltWater = aNBT.getBoolean("mSaltWater");
+ mFreshWater = aNBT.getBoolean("mFreshWater");
+ mTempTolerance = aNBT.getByte("mTempTolerance");
+ mFertility = aNBT.getFloat("mFertility");
+ mProductionSpeed = aNBT.getFloat("mProductionSpeed");
+ mLifespan = aNBT.getByte("mLifespan");
+ mGeneration = aNBT.getInteger("mGeneration");
+ }
+ mSpecialRequirements = new AutoMap<AlgaeGrowthRequirement>();
+ }
+
+ /**
+ * In MC Days
+ */
+ public final int getLifespan() {
+ return this.mLifespan;
+ }
+
+ public final boolean isDominant() {
+ return this.mIsDominant;
+ }
+
+ public final boolean RequiresLight() {
+ return this.mRequiresLight;
+ }
+
+ public final boolean isSaltWater() {
+ return this.mSaltWater;
+ }
+
+ public final boolean isFreshWater() {
+ return this.mFreshWater;
+ }
+
+ public final byte getTempTolerance() {
+ return this.mTempTolerance;
+ }
+
+ public final float getFertility() {
+ return this.mFertility;
+ }
+
+ public final float getProductionSpeed() {
+ return this.mProductionSpeed;
+ }
+
+ public final int getGeneration() {
+ return this.mGeneration;
+ }
+
+ public final AutoMap<AlgaeGrowthRequirement> getSpecialRequirements() {
+ return this.mSpecialRequirements;
+ }
+
+ public NBTTagCompound writeToNBT() {
+ NBTTagCompound aGenes = new NBTTagCompound();
+ aGenes.setBoolean("mIsDominant", this.mIsDominant);
+ aGenes.setBoolean("mRequiresLight", this.mRequiresLight);
+ aGenes.setBoolean("mSaltWater", this.mSaltWater);
+ aGenes.setBoolean("mFreshWater", this.mFreshWater);
+ aGenes.setInteger("mLifespan", this.mLifespan);
+ aGenes.setInteger("mGeneration", this.mGeneration);
+ aGenes.setByte("mTempTolerance", this.mTempTolerance);
+ aGenes.setFloat("mFertility", this.mFertility);
+ aGenes.setFloat("mProductionSpeed", this.mProductionSpeed);
+ return aGenes;
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java b/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java
index 6bddc9d085..0c8c0c816f 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java
@@ -1,5 +1,3 @@
package gtPlusPlus.plugin.agrichem.logic;
-public class AlgaeGrowthRequirement {
-
-}
+public class AlgaeGrowthRequirement {}
diff --git a/src/main/java/gtPlusPlus/plugin/fishing/Core_Fishing.java b/src/main/java/gtPlusPlus/plugin/fishing/Core_Fishing.java
index 48706bc986..78c2f9d3a7 100644
--- a/src/main/java/gtPlusPlus/plugin/fishing/Core_Fishing.java
+++ b/src/main/java/gtPlusPlus/plugin/fishing/Core_Fishing.java
@@ -5,50 +5,49 @@ import gtPlusPlus.plugin.manager.Core_Manager;
public class Core_Fishing implements IPlugin {
- final static Core_Fishing mInstance;
-
- static {
- mInstance = new Core_Fishing();
- mInstance.log("Preparing "+mInstance.getPluginName()+" for use.");
- }
-
- Core_Fishing() {
- Core_Manager.registerPlugin(this);
- }
-
- @Override
- public boolean preInit() {
- return false;
- }
-
- @Override
- public boolean init() {
- return false;
- }
-
- @Override
- public boolean postInit() {
- return false;
- }
-
- @Override
- public boolean serverStart() {
- return false;
- }
-
- @Override
- public boolean serverStop() {
- return false;
- }
-
- @Override
- public String getPluginName() {
- return "GT++ Fishing Module";
- }
-
- @Override
- public String getPluginAbbreviation() {
- return "Fish";
- }
-
+ static final Core_Fishing mInstance;
+
+ static {
+ mInstance = new Core_Fishing();
+ mInstance.log("Preparing " + mInstance.getPluginName() + " for use.");
+ }
+
+ Core_Fishing() {
+ Core_Manager.registerPlugin(this);
+ }
+
+ @Override
+ public boolean preInit() {
+ return false;
+ }
+
+ @Override
+ public boolean init() {
+ return false;
+ }
+
+ @Override
+ public boolean postInit() {
+ return false;
+ }
+
+ @Override
+ public boolean serverStart() {
+ return false;
+ }
+
+ @Override
+ public boolean serverStop() {
+ return false;
+ }
+
+ @Override
+ public String getPluginName() {
+ return "GT++ Fishing Module";
+ }
+
+ @Override
+ public String getPluginAbbreviation() {
+ return "Fish";
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/fishing/block/BlockFishEggs.java b/src/main/java/gtPlusPlus/plugin/fishing/block/BlockFishEggs.java
index c11d4fa333..238c6813bc 100644
--- a/src/main/java/gtPlusPlus/plugin/fishing/block/BlockFishEggs.java
+++ b/src/main/java/gtPlusPlus/plugin/fishing/block/BlockFishEggs.java
@@ -3,10 +3,9 @@ package gtPlusPlus.plugin.fishing.block;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
-public class BlockFishEggs extends Block{
-
- protected BlockFishEggs() {
- super(Material.water);
- }
+public class BlockFishEggs extends Block {
+ protected BlockFishEggs() {
+ super(Material.water);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/fishing/item/BaseFish.java b/src/main/java/gtPlusPlus/plugin/fishing/item/BaseFish.java
index d96d8d8cfd..7a43e66730 100644
--- a/src/main/java/gtPlusPlus/plugin/fishing/item/BaseFish.java
+++ b/src/main/java/gtPlusPlus/plugin/fishing/item/BaseFish.java
@@ -1,10 +1,9 @@
package gtPlusPlus.plugin.fishing.item;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.plugin.fishing.misc.BaseFishTypes;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,26 +16,20 @@ import net.minecraft.potion.PotionHelper;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import gtPlusPlus.plugin.fishing.misc.BaseFishTypes;
-
-public class BaseFish extends ItemFood
-{
+public class BaseFish extends ItemFood {
private final boolean isCooked;
- public BaseFish(boolean cooked)
- {
+ public BaseFish(boolean cooked) {
super(0, 0.0F, false);
this.isCooked = cooked;
}
- public int func_150905_g(ItemStack p_150905_1_)
- {
+ public int func_150905_g(ItemStack p_150905_1_) {
BaseFishTypes fishtype = BaseFishTypes.getFishTypeFromStackDamage(p_150905_1_);
return this.isCooked && fishtype.isCooked() ? fishtype.func_150970_e() : fishtype.func_150975_c();
}
- public float func_150906_h(ItemStack p_150906_1_)
- {
+ public float func_150906_h(ItemStack p_150906_1_) {
BaseFishTypes fishtype = BaseFishTypes.getFishTypeFromStackDamage(p_150906_1_);
return this.isCooked && fishtype.isCooked() ? fishtype.func_150977_f() : fishtype.func_150967_d();
}
@@ -44,30 +37,27 @@ public class BaseFish extends ItemFood
/**
* Returns a string representing what this item does to a potion.
*/
- public String getPotionEffect(ItemStack p_150896_1_)
- {
- return BaseFishTypes.getFishTypeFromStackDamage(p_150896_1_) == BaseFishTypes.PUFFERFISH ? PotionHelper.field_151423_m : null;
+ public String getPotionEffect(ItemStack p_150896_1_) {
+ return BaseFishTypes.getFishTypeFromStackDamage(p_150896_1_) == BaseFishTypes.PUFFERFISH
+ ? PotionHelper.field_151423_m
+ : null;
}
@SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister p_94581_1_)
- {
+ public void registerIcons(IIconRegister p_94581_1_) {
BaseFishTypes[] afishtype = BaseFishTypes.values();
int i = afishtype.length;
- for (int j = 0; j < i; ++j)
- {
+ for (int j = 0; j < i; ++j) {
BaseFishTypes fishtype = afishtype[j];
fishtype.func_150968_a(p_94581_1_);
}
}
- protected void onFoodEaten(ItemStack fish, World world, EntityPlayer player)
- {
+ protected void onFoodEaten(ItemStack fish, World world, EntityPlayer player) {
BaseFishTypes fishtype = BaseFishTypes.getFishTypeFromStackDamage(fish);
- if (fishtype == BaseFishTypes.PUFFERFISH)
- {
+ if (fishtype == BaseFishTypes.PUFFERFISH) {
player.addPotionEffect(new PotionEffect(Potion.poison.id, 1200, 3));
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 300, 2));
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 1));
@@ -80,8 +70,7 @@ public class BaseFish extends ItemFood
* Gets an icon index based on an item's damage value
*/
@SideOnly(Side.CLIENT)
- public IIcon getIconFromDamage(int dmg)
- {
+ public IIcon getIconFromDamage(int dmg) {
BaseFishTypes fishtype = BaseFishTypes.getFishTypeFromDamageValue(dmg);
return this.isCooked && fishtype.isCooked() ? fishtype.func_150979_h() : fishtype.func_150971_g();
}
@@ -90,17 +79,14 @@ public class BaseFish extends ItemFood
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
@SideOnly(Side.CLIENT)
- public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_)
- {
+ public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) {
BaseFishTypes[] afishtype = BaseFishTypes.values();
int i = afishtype.length;
- for (int j = 0; j < i; ++j)
- {
+ for (int j = 0; j < i; ++j) {
BaseFishTypes fishtype = afishtype[j];
- if (!this.isCooked || fishtype.isCooked())
- {
+ if (!this.isCooked || fishtype.isCooked()) {
p_150895_3_.add(new ItemStack(this, 1, fishtype.getFishID()));
}
}
@@ -110,10 +96,9 @@ public class BaseFish extends ItemFood
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
* different names based on their damage or NBT.
*/
- public String getUnlocalizedName(ItemStack p_77667_1_)
- {
+ public String getUnlocalizedName(ItemStack p_77667_1_) {
BaseFishTypes fishtype = BaseFishTypes.getFishTypeFromStackDamage(p_77667_1_);
- return this.getUnlocalizedName() + "." + fishtype.getFishName() + "." + (this.isCooked && fishtype.isCooked() ? "cooked" : "raw");
+ return this.getUnlocalizedName() + "." + fishtype.getFishName() + "."
+ + (this.isCooked && fishtype.isCooked() ? "cooked" : "raw");
}
-
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/plugin/fishing/misc/BaseFishTypes.java b/src/main/java/gtPlusPlus/plugin/fishing/misc/BaseFishTypes.java
index ea8d04b5d3..70046828b4 100644
--- a/src/main/java/gtPlusPlus/plugin/fishing/misc/BaseFishTypes.java
+++ b/src/main/java/gtPlusPlus/plugin/fishing/misc/BaseFishTypes.java
@@ -1,140 +1,125 @@
package gtPlusPlus.plugin.fishing.misc;
-import java.util.Map;
import com.google.common.collect.Maps;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.plugin.fishing.item.BaseFish;
+import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import gtPlusPlus.plugin.fishing.item.BaseFish;
-
-public enum BaseFishTypes{
-
- COD(0, "cod", 2, 0.1F, 5, 0.6F),
- SALMON(1, "salmon", 2, 0.1F, 6, 0.8F),
- CLOWNFISH(2, "clownfish", 1, 0.1F),
- PUFFERFISH(3, "pufferfish", 1, 0.1F);
-
-
-
-
- private static final Map<Integer, BaseFishTypes> mFishMap = Maps.newHashMap();
- private final int mID;
- private final String mFishName;
- @SideOnly(Side.CLIENT)
- private IIcon iicon;
- @SideOnly(Side.CLIENT)
- private IIcon iicon2;
- private final int field_150991_j;
- private final float field_150992_k;
- private final int field_150989_l;
- private final float field_150990_m;
- private boolean isCooked = false;
-
- private BaseFishTypes(int p_i45336_3_, String p_i45336_4_, int p_i45336_5_, float p_i45336_6_, int p_i45336_7_, float p_i45336_8_)
- {
- this.mID = p_i45336_3_;
- this.mFishName = p_i45336_4_;
- this.field_150991_j = p_i45336_5_;
- this.field_150992_k = p_i45336_6_;
- this.field_150989_l = p_i45336_7_;
- this.field_150990_m = p_i45336_8_;
- this.isCooked = true;
- }
-
- private BaseFishTypes(int p_i45337_3_, String p_i45337_4_, int p_i45337_5_, float p_i45337_6_)
- {
- this.mID = p_i45337_3_;
- this.mFishName = p_i45337_4_;
- this.field_150991_j = p_i45337_5_;
- this.field_150992_k = p_i45337_6_;
- this.field_150989_l = 0;
- this.field_150990_m = 0.0F;
- this.isCooked = false;
- }
-
- public int getFishID()
- {
- return this.mID;
- }
-
- public String getFishName()
- {
- return this.mFishName;
- }
-
- public int func_150975_c()
- {
- return this.field_150991_j;
- }
-
- public float func_150967_d()
- {
- return this.field_150992_k;
- }
-
- public int func_150970_e()
- {
- return this.field_150989_l;
- }
-
- public float func_150977_f()
- {
- return this.field_150990_m;
- }
-
- @SideOnly(Side.CLIENT)
- public void func_150968_a(IIconRegister p_150968_1_)
- {
- this.iicon = p_150968_1_.registerIcon("fish_" + this.mFishName + "_raw");
-
- if (this.isCooked)
- {
- this.iicon2 = p_150968_1_.registerIcon("fish_" + this.mFishName + "_cooked");
- }
- }
-
- @SideOnly(Side.CLIENT)
- public IIcon func_150971_g()
- {
- return this.iicon;
- }
-
- @SideOnly(Side.CLIENT)
- public IIcon func_150979_h()
- {
- return this.iicon2;
- }
-
- public boolean isCooked()
- {
- return this.isCooked;
- }
-
- public static BaseFishTypes getFishTypeFromDamageValue(int dmg)
- {
- BaseFishTypes fishtype = (BaseFishTypes)mFishMap.get(Integer.valueOf(dmg));
- return fishtype == null ? COD : fishtype;
+public enum BaseFishTypes {
+ COD(0, "cod", 2, 0.1F, 5, 0.6F),
+ SALMON(1, "salmon", 2, 0.1F, 6, 0.8F),
+ CLOWNFISH(2, "clownfish", 1, 0.1F),
+ PUFFERFISH(3, "pufferfish", 1, 0.1F);
+
+ private static final Map<Integer, BaseFishTypes> mFishMap = Maps.newHashMap();
+ private final int mID;
+ private final String mFishName;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon iicon;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon iicon2;
+
+ private final int field_150991_j;
+ private final float field_150992_k;
+ private final int field_150989_l;
+ private final float field_150990_m;
+ private boolean isCooked = false;
+
+ private BaseFishTypes(
+ int p_i45336_3_,
+ String p_i45336_4_,
+ int p_i45336_5_,
+ float p_i45336_6_,
+ int p_i45336_7_,
+ float p_i45336_8_) {
+ this.mID = p_i45336_3_;
+ this.mFishName = p_i45336_4_;
+ this.field_150991_j = p_i45336_5_;
+ this.field_150992_k = p_i45336_6_;
+ this.field_150989_l = p_i45336_7_;
+ this.field_150990_m = p_i45336_8_;
+ this.isCooked = true;
+ }
+
+ private BaseFishTypes(int p_i45337_3_, String p_i45337_4_, int p_i45337_5_, float p_i45337_6_) {
+ this.mID = p_i45337_3_;
+ this.mFishName = p_i45337_4_;
+ this.field_150991_j = p_i45337_5_;
+ this.field_150992_k = p_i45337_6_;
+ this.field_150989_l = 0;
+ this.field_150990_m = 0.0F;
+ this.isCooked = false;
+ }
+
+ public int getFishID() {
+ return this.mID;
+ }
+
+ public String getFishName() {
+ return this.mFishName;
+ }
+
+ public int func_150975_c() {
+ return this.field_150991_j;
+ }
+
+ public float func_150967_d() {
+ return this.field_150992_k;
+ }
+
+ public int func_150970_e() {
+ return this.field_150989_l;
+ }
+
+ public float func_150977_f() {
+ return this.field_150990_m;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void func_150968_a(IIconRegister p_150968_1_) {
+ this.iicon = p_150968_1_.registerIcon("fish_" + this.mFishName + "_raw");
+
+ if (this.isCooked) {
+ this.iicon2 = p_150968_1_.registerIcon("fish_" + this.mFishName + "_cooked");
}
-
- public static BaseFishTypes getFishTypeFromStackDamage(ItemStack fish)
- {
- return fish.getItem() instanceof BaseFish ? getFishTypeFromDamageValue(fish.getItemDamage()) : COD;
- }
-
- static
- {
- BaseFishTypes[] var0 = values();
- int var1 = var0.length;
-
- for (int var2 = 0; var2 < var1; ++var2)
- {
- BaseFishTypes var3 = var0[var2];
- mFishMap.put(Integer.valueOf(var3.getFishID()), var3);
- }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public IIcon func_150971_g() {
+ return this.iicon;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public IIcon func_150979_h() {
+ return this.iicon2;
+ }
+
+ public boolean isCooked() {
+ return this.isCooked;
+ }
+
+ public static BaseFishTypes getFishTypeFromDamageValue(int dmg) {
+ BaseFishTypes fishtype = (BaseFishTypes) mFishMap.get(Integer.valueOf(dmg));
+ return fishtype == null ? COD : fishtype;
+ }
+
+ public static BaseFishTypes getFishTypeFromStackDamage(ItemStack fish) {
+ return fish.getItem() instanceof BaseFish ? getFishTypeFromDamageValue(fish.getItemDamage()) : COD;
+ }
+
+ static {
+ BaseFishTypes[] var0 = values();
+ int var1 = var0.length;
+
+ for (int var2 = 0; var2 < var1; ++var2) {
+ BaseFishTypes var3 = var0[var2];
+ mFishMap.put(Integer.valueOf(var3.getFishID()), var3);
}
- } \ No newline at end of file
+ }
+}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java b/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java
index d67ff24d7b..4d87a746f3 100644
--- a/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java
+++ b/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java
@@ -2,6 +2,5 @@ package gtPlusPlus.plugin.fixes.interfaces;
public interface IBugFix {
- public boolean isFixValid();
-
+ public boolean isFixValid();
}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java
index 2bfd05e5be..82757a2434 100644
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java
+++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java
@@ -9,87 +9,87 @@ import net.minecraft.item.ItemStack;
public class Core_VanillaFixes implements IPlugin {
- final static Core_VanillaFixes mInstance;
- final static VanillaBedHeightFix mBedFixInstance;
- final static VanillaBackgroundMusicFix mMusicFixInstance;
+ static final Core_VanillaFixes mInstance;
+ static final VanillaBedHeightFix mBedFixInstance;
+ static final VanillaBackgroundMusicFix mMusicFixInstance;
- static {
- mInstance = new Core_VanillaFixes();
- mBedFixInstance = new VanillaBedHeightFix(mInstance);
- mMusicFixInstance = new VanillaBackgroundMusicFix(mInstance);
- mInstance.log("Preparing "+mInstance.getPluginName()+" for use.");
- }
-
- Core_VanillaFixes() {
- Core_Manager.registerPlugin(this);
- }
-
- @Override
- public boolean preInit() {
- return fixVanillaOD();
- }
+ static {
+ mInstance = new Core_VanillaFixes();
+ mBedFixInstance = new VanillaBedHeightFix(mInstance);
+ mMusicFixInstance = new VanillaBackgroundMusicFix(mInstance);
+ mInstance.log("Preparing " + mInstance.getPluginName() + " for use.");
+ }
- @Override
- public boolean init() {
- return true;
- }
+ Core_VanillaFixes() {
+ Core_Manager.registerPlugin(this);
+ }
- @Override
- public boolean postInit() {
- return true;
- }
+ @Override
+ public boolean preInit() {
+ return fixVanillaOD();
+ }
- @Override
- public boolean serverStart() {
- mMusicFixInstance.manage();
- return true;
- }
+ @Override
+ public boolean init() {
+ return true;
+ }
- @Override
- public boolean serverStop() {
- return true;
- }
+ @Override
+ public boolean postInit() {
+ return true;
+ }
- @Override
- public String getPluginName() {
- return "GT++ Vanilla Fixes Module";
- }
+ @Override
+ public boolean serverStart() {
+ mMusicFixInstance.manage();
+ return true;
+ }
- @Override
- public String getPluginAbbreviation() {
- return "VFIX";
- }
-
- private boolean fixVanillaOD() {
- registerToOreDict(ItemUtils.getSimpleStack(Items.blaze_rod), "rodBlaze");
- registerToOreDict(ItemUtils.getSimpleStack(Items.nether_wart), "cropNetherWart");
- registerToOreDict(ItemUtils.getSimpleStack(Items.reeds), "sugarcane");
- registerToOreDict(ItemUtils.getSimpleStack(Items.paper), "paper");
- registerToOreDict(ItemUtils.getSimpleStack(Items.ender_pearl), "enderpearl");
- registerToOreDict(ItemUtils.getSimpleStack(Items.bone), "bone");
- registerToOreDict(ItemUtils.getSimpleStack(Items.gunpowder), "gunpowder");
- registerToOreDict(ItemUtils.getSimpleStack(Items.string), "string");
- registerToOreDict(ItemUtils.getSimpleStack(Items.nether_star), "netherStar");
- registerToOreDict(ItemUtils.getSimpleStack(Items.leather), "leather");
- registerToOreDict(ItemUtils.getSimpleStack(Items.feather), "feather");
- registerToOreDict(ItemUtils.getSimpleStack(Items.egg), "egg");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.end_stone), "endstone");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.vine), "vine");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.cactus), "blockCactus");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.grass), "grass");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.obsidian), "obsidian");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.crafting_table), "workbench");
- return true;
- }
-
- private void registerToOreDict(ItemStack aStack, String aString) {
- if (aStack.getItem() == Items.blaze_rod) {
- mInstance.log("Registering "+aStack.getDisplayName()+" to OreDictionary under the tag '"+aString+"'.");
- }
- else {
- mInstance.log("Registering "+aStack.getDisplayName()+" to OreDictionary under the tag '"+aString+"'. (Added to Forge in 1.8.9)");
- }
- ItemUtils.addItemToOreDictionary(aStack, aString);
- }
+ @Override
+ public boolean serverStop() {
+ return true;
+ }
+ @Override
+ public String getPluginName() {
+ return "GT++ Vanilla Fixes Module";
+ }
+
+ @Override
+ public String getPluginAbbreviation() {
+ return "VFIX";
+ }
+
+ private boolean fixVanillaOD() {
+ registerToOreDict(ItemUtils.getSimpleStack(Items.blaze_rod), "rodBlaze");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.nether_wart), "cropNetherWart");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.reeds), "sugarcane");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.paper), "paper");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.ender_pearl), "enderpearl");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.bone), "bone");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.gunpowder), "gunpowder");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.string), "string");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.nether_star), "netherStar");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.leather), "leather");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.feather), "feather");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.egg), "egg");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.end_stone), "endstone");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.vine), "vine");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.cactus), "blockCactus");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.grass), "grass");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.obsidian), "obsidian");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.crafting_table), "workbench");
+ return true;
+ }
+
+ private void registerToOreDict(ItemStack aStack, String aString) {
+ if (aStack.getItem() == Items.blaze_rod) {
+ mInstance.log(
+ "Registering " + aStack.getDisplayName() + " to OreDictionary under the tag '" + aString + "'.");
+ } else {
+ mInstance.log("Registering " + aStack.getDisplayName() + " to OreDictionary under the tag '" + aString
+ + "'. (Added to Forge in 1.8.9)");
+ }
+ ItemUtils.addItemToOreDictionary(aStack, aString);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java
index bfd73407f7..ebf7729e92 100644
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java
+++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java
@@ -1,63 +1,61 @@
package gtPlusPlus.plugin.fixes.vanilla;
-import java.util.Timer;
-import java.util.TimerTask;
-
import gtPlusPlus.api.interfaces.IPlugin;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.plugin.fixes.interfaces.IBugFix;
import gtPlusPlus.plugin.fixes.vanilla.music.MusicTocker;
import gtPlusPlus.preloader.CORE_Preloader;
+import java.util.Timer;
+import java.util.TimerTask;
public class VanillaBackgroundMusicFix implements IBugFix {
- private final IPlugin mParent;
- private final boolean enabled;
- private MusicTocker mFixInstance;
-
- public VanillaBackgroundMusicFix(IPlugin minstance) {
- mParent = minstance;
- if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isClient()) {
- mParent.log("[BGM] Registering BGM delay Fix.");
- enabled = true;
- mFixInstance = new MusicTocker(mParent);
- } else if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isServer()) {
- mParent.log("[BGM] Tried registering BGM delay Fix on Server, disabling.");
- enabled = false;
- } else {
- mParent.log("[BGM] Not registering BGM delay Fix.");
- enabled = false;
- }
- }
-
- public boolean isFixValid() {
- return enabled;
- }
-
- public void manage() {
- if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isClient()) {
- TimerTask task = new ManageTask(this.mFixInstance);
- Timer timer = new Timer("BGM-WatchDog");
- long delay = 1000 * 60;
- timer.scheduleAtFixedRate(task, delay, 5000);
- }
- }
-
- private static class ManageTask extends TimerTask {
- private final MusicTocker A;
-
- public ManageTask(MusicTocker a) {
- A = a;
- }
-
- @Override
- public void run() {
- if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isClient()) {
- if (!A.mVanillaManager) {
- A.run();
- }
- }
- }
- }
-
+ private final IPlugin mParent;
+ private final boolean enabled;
+ private MusicTocker mFixInstance;
+
+ public VanillaBackgroundMusicFix(IPlugin minstance) {
+ mParent = minstance;
+ if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isClient()) {
+ mParent.log("[BGM] Registering BGM delay Fix.");
+ enabled = true;
+ mFixInstance = new MusicTocker(mParent);
+ } else if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isServer()) {
+ mParent.log("[BGM] Tried registering BGM delay Fix on Server, disabling.");
+ enabled = false;
+ } else {
+ mParent.log("[BGM] Not registering BGM delay Fix.");
+ enabled = false;
+ }
+ }
+
+ public boolean isFixValid() {
+ return enabled;
+ }
+
+ public void manage() {
+ if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isClient()) {
+ TimerTask task = new ManageTask(this.mFixInstance);
+ Timer timer = new Timer("BGM-WatchDog");
+ long delay = 1000 * 60;
+ timer.scheduleAtFixedRate(task, delay, 5000);
+ }
+ }
+
+ private static class ManageTask extends TimerTask {
+ private final MusicTocker A;
+
+ public ManageTask(MusicTocker a) {
+ A = a;
+ }
+
+ @Override
+ public void run() {
+ if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isClient()) {
+ if (!A.mVanillaManager) {
+ A.run();
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
index f33cc71fc6..cadb47e50d 100644
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
+++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
@@ -1,8 +1,5 @@
package gtPlusPlus.plugin.fixes.vanilla;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gtPlusPlus.api.interfaces.IPlugin;
@@ -11,72 +8,76 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.plugin.fixes.interfaces.IBugFix;
import gtPlusPlus.preloader.DevHelper;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent;
public class VanillaBedHeightFix implements IBugFix {
- private final Method mSleepInBedAt;
- private final IPlugin mParent;
-
- public VanillaBedHeightFix(IPlugin minstance) {
- mParent = minstance;
- if (DevHelper.isValidHelperObject()) {
- Method m;
- if (DevHelper.isObfuscatedEnvironment()) {
- m = ReflectionUtils.getMethod(EntityPlayer.class, "func_71018_a", int.class, int.class, int.class);
- }
- else {
- m = ReflectionUtils.getMethod(net.minecraft.entity.player.EntityPlayer.class, "sleepInBedAt", int.class, int.class, int.class);
- }
- if (m != null) {
- mSleepInBedAt = m;
- mParent.log("Registering Bed Height Fix.");
- Utils.registerEvent(this);
- } else {
- mSleepInBedAt = null;
- }
- } else {
- mSleepInBedAt = null;
- }
- }
-
- public boolean isFixValid() {
- return mSleepInBedAt != null;
- }
+ private final Method mSleepInBedAt;
+ private final IPlugin mParent;
- /**
- * Fix created by deNULL -
- * https://github.com/deNULL/BugPatch/blob/master/src/main/java/ru/denull/BugPatch/mod/ClientEvents.java#L45
- *
- * @param evt
- * - The event where a player sleeps
- */
+ public VanillaBedHeightFix(IPlugin minstance) {
+ mParent = minstance;
+ if (DevHelper.isValidHelperObject()) {
+ Method m;
+ if (DevHelper.isObfuscatedEnvironment()) {
+ m = ReflectionUtils.getMethod(EntityPlayer.class, "func_71018_a", int.class, int.class, int.class);
+ } else {
+ m = ReflectionUtils.getMethod(
+ net.minecraft.entity.player.EntityPlayer.class,
+ "sleepInBedAt",
+ int.class,
+ int.class,
+ int.class);
+ }
+ if (m != null) {
+ mSleepInBedAt = m;
+ mParent.log("Registering Bed Height Fix.");
+ Utils.registerEvent(this);
+ } else {
+ mSleepInBedAt = null;
+ }
+ } else {
+ mSleepInBedAt = null;
+ }
+ }
- @SubscribeEvent(priority = EventPriority.HIGHEST)
- public void playerSleepInBed(PlayerSleepInBedEvent evt) {
- Logger.WARNING("Sleep Event Detected. Player is sleeping at Y: " + evt.y);
- if (evt.y <= 0 && isFixValid()) {
- int correctY = 256 + evt.y;
- if (correctY <= 0) {
- Logger.WARNING(
- "You're trying to sleep at y=" + evt.y + ", which is impossibly low. However, fixed y value is "
- + correctY + ", which is still below 0. Falling back to default behavior.");
- } else {
- Logger.WARNING("You're trying to sleep at y=" + evt.y
- + ". This is probably caused by overflow, stopping original event; retrying with y=" + correctY
- + ".");
- evt.result = EntityPlayer.EnumStatus.OTHER_PROBLEM;
- try {
- mSleepInBedAt.invoke(evt.entityPlayer, evt.x, correctY, evt.z);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.WARNING("Encountered an error trying to sleep.");
- }
- }
- } else if (!isFixValid()) {
- Logger.WARNING(
- "Method sleepInBedAt was not found in EntityPlayer (wrong MC and/or Forge version?), unable to fix");
- }
- }
+ public boolean isFixValid() {
+ return mSleepInBedAt != null;
+ }
+ /**
+ * Fix created by deNULL -
+ * https://github.com/deNULL/BugPatch/blob/master/src/main/java/ru/denull/BugPatch/mod/ClientEvents.java#L45
+ *
+ * @param evt
+ * - The event where a player sleeps
+ */
+ @SubscribeEvent(priority = EventPriority.HIGHEST)
+ public void playerSleepInBed(PlayerSleepInBedEvent evt) {
+ Logger.WARNING("Sleep Event Detected. Player is sleeping at Y: " + evt.y);
+ if (evt.y <= 0 && isFixValid()) {
+ int correctY = 256 + evt.y;
+ if (correctY <= 0) {
+ Logger.WARNING(
+ "You're trying to sleep at y=" + evt.y + ", which is impossibly low. However, fixed y value is "
+ + correctY + ", which is still below 0. Falling back to default behavior.");
+ } else {
+ Logger.WARNING("You're trying to sleep at y=" + evt.y
+ + ". This is probably caused by overflow, stopping original event; retrying with y=" + correctY
+ + ".");
+ evt.result = EntityPlayer.EnumStatus.OTHER_PROBLEM;
+ try {
+ mSleepInBedAt.invoke(evt.entityPlayer, evt.x, correctY, evt.z);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ Logger.WARNING("Encountered an error trying to sleep.");
+ }
+ }
+ } else if (!isFixValid()) {
+ Logger.WARNING(
+ "Method sleepInBedAt was not found in EntityPlayer (wrong MC and/or Forge version?), unable to fix");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java
index 452c902e05..17fbc9ae29 100644
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java
+++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java
@@ -1,8 +1,5 @@
package gtPlusPlus.plugin.fixes.vanilla.music;
-import java.lang.reflect.Field;
-import java.util.Random;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.api.interfaces.IPlugin;
@@ -10,6 +7,8 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.CORE_Preloader;
+import java.lang.reflect.Field;
+import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.MusicTicker;
@@ -19,112 +18,111 @@ import net.minecraft.util.MathHelper;
@SideOnly(Side.CLIENT)
public class MusicTocker extends MusicTicker implements Runnable {
- private final Random mRandom = new XSTR();
- private final Minecraft mMinecraft;
- private final IPlugin mPlugin;
- private ISound mSound;
- private int mTimeUntilNextTrack = 100;
-
- public boolean mVanillaManager = false;
+ private final Random mRandom = new XSTR();
+ private final Minecraft mMinecraft;
+ private final IPlugin mPlugin;
+ private ISound mSound;
+ private int mTimeUntilNextTrack = 100;
+
+ public boolean mVanillaManager = false;
+
+ public MusicTocker(IPlugin aPlugin) {
+ super(Minecraft.getMinecraft());
+ mPlugin = aPlugin;
+ mMinecraft = Minecraft.getMinecraft();
+ mPlugin.log("[BGM] Created BGM Watchdog with a delay of " + getDelay() + " ticks.");
+ inject();
+ }
+
+ private static int getDelay() {
+ return CORE_Preloader.enableWatchdogBGM;
+ }
+
+ private boolean inject() {
+ mPlugin.log("[BGM] Inject new Watchdog into Minecraft instance.");
+ ReflectionUtils.setField(Minecraft.getMinecraft(), "mcMusicTicker", this);
+ mPlugin.log("[BGM] Verifying...");
+ Field f = ReflectionUtils.getField(Minecraft.class, "mcMusicTicker");
+ try {
+ Object m = f.get(mMinecraft);
+ if (m != null) {
+ if (m instanceof MusicTocker || m.getClass().isAssignableFrom(getClass())) {
+ mPlugin.log("[BGM] Success.");
+ return true;
+ } else if (m instanceof MusicTicker || m.getClass().isAssignableFrom(MusicTicker.class)) {
+ mPlugin.log("[BGM] Found Vanilla MusicTicker, but may be instance of MusicTocker.");
+ return true;
+ }
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+
+ mPlugin.log("[BGM] Failed.");
+ return false;
+ }
- public MusicTocker(IPlugin aPlugin) {
- super(Minecraft.getMinecraft());
- mPlugin = aPlugin;
- mMinecraft = Minecraft.getMinecraft();
- mPlugin.log("[BGM] Created BGM Watchdog with a delay of "+getDelay()+" ticks.");
- inject();
- }
+ private final void updateInternalNumber() {
+ if (ReflectionUtils.doesFieldExist(getClass(), "field_147676_d")) {
+ ReflectionUtils.setField(this, "field_147676_d", mTimeUntilNextTrack);
+ }
+ }
- private static int getDelay() {
- return CORE_Preloader.enableWatchdogBGM;
- }
+ private final void updateInternalSound(ISound aSound) {
+ if (ReflectionUtils.doesFieldExist(getClass(), "field_147678_c")) {
+ ReflectionUtils.setField(this, "field_147678_c", aSound);
+ }
+ }
- private boolean inject() {
- mPlugin.log("[BGM] Inject new Watchdog into Minecraft instance.");
- ReflectionUtils.setField(Minecraft.getMinecraft(), "mcMusicTicker", this);
- mPlugin.log("[BGM] Verifying...");
- Field f = ReflectionUtils.getField(Minecraft.class, "mcMusicTicker");
- try {
- Object m = f.get(mMinecraft);
- if (m != null) {
- if (m instanceof MusicTocker || m.getClass().isAssignableFrom(getClass())) {
- mPlugin.log("[BGM] Success.");
- return true;
- }
- else if (m instanceof MusicTicker || m.getClass().isAssignableFrom(MusicTicker.class)) {
- mPlugin.log("[BGM] Found Vanilla MusicTicker, but may be instance of MusicTocker.");
- return true;
- }
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
-
- mPlugin.log("[BGM] Failed.");
- return false;
- }
-
- private final void updateInternalNumber() {
- if (ReflectionUtils.doesFieldExist(getClass(), "field_147676_d")) {
- ReflectionUtils.setField(this, "field_147676_d", mTimeUntilNextTrack);
- }
- }
-
- private final void updateInternalSound(ISound aSound) {
- if (ReflectionUtils.doesFieldExist(getClass(), "field_147678_c")) {
- ReflectionUtils.setField(this, "field_147678_c", aSound);
- }
- }
+ /**
+ * Updates the JList with a new model.
+ */
+ @Override
+ public void update() {
+ run();
+ mVanillaManager = true;
+ }
- /**
- * Updates the JList with a new model.
- */
- @Override
- public void update() {
- run();
- mVanillaManager = true;
- }
+ @Override
+ public void run() {
+ MusicType musictype = this.mMinecraft.func_147109_W();
- @Override
- public void run() {
- MusicType musictype = this.mMinecraft.func_147109_W();
-
- if (this.mSound != null) {
- if (!musictype.getMusicTickerLocation().equals(this.mSound.getPositionedSoundLocation())) {
- this.mMinecraft.getSoundHandler().stopSound(this.mSound);
- this.mTimeUntilNextTrack = MathHelper.getRandomIntegerInRange(this.mRandom, 0, getDelay() / 2);
- updateInternalNumber();
- Logger.INFO("[BGM] Adjusted BGM delay 1");
- }
- if (!this.mMinecraft.getSoundHandler().isSoundPlaying(this.mSound)) {
- this.mSound = null;
- updateInternalSound(null);
- this.mTimeUntilNextTrack = Math.min(MathHelper.getRandomIntegerInRange(this.mRandom, getDelay(), getDelay() * 2), this.mTimeUntilNextTrack);
- updateInternalNumber();
- Logger.INFO("[BGM] Adjusted BGM delay 2");
- }
- }
- else if (this.mSound == null && this.mTimeUntilNextTrack-- <= 0) {
- this.mSound = PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation());
- updateInternalSound(mSound);
- this.mMinecraft.getSoundHandler().playSound(this.mSound);
- this.mTimeUntilNextTrack = getDelay();
- updateInternalNumber();
- Logger.INFO("[BGM] Adjusted BGM 3");
- }
-
- /*
- * try { // Get Value stored in underlying object. Integer aRealDelay =
- * (Integer) ReflectionUtils.getField(getClass(), "field_147676_d").get(this);
- *
- * if (aRealDelay == null) { return; } else { if (aRealDelay > getDelay() ||
- * aRealDelay <= 0) { this.mTimeUntilNextTrack = getDelay();
- * updateInternalNumber(); } else { this.mTimeUntilNextTrack -= 5 * 20;
- * updateInternalNumber(); } aRealDelay = (Integer)
- * ReflectionUtils.getField(getClass(), "field_147676_d").get(this);
- * Logger.INFO("[BGM] Adjusted BGM - "+aRealDelay); }
- *
- * } catch (IllegalArgumentException | IllegalAccessException e) { }
- */
- }
+ if (this.mSound != null) {
+ if (!musictype.getMusicTickerLocation().equals(this.mSound.getPositionedSoundLocation())) {
+ this.mMinecraft.getSoundHandler().stopSound(this.mSound);
+ this.mTimeUntilNextTrack = MathHelper.getRandomIntegerInRange(this.mRandom, 0, getDelay() / 2);
+ updateInternalNumber();
+ Logger.INFO("[BGM] Adjusted BGM delay 1");
+ }
+ if (!this.mMinecraft.getSoundHandler().isSoundPlaying(this.mSound)) {
+ this.mSound = null;
+ updateInternalSound(null);
+ this.mTimeUntilNextTrack = Math.min(
+ MathHelper.getRandomIntegerInRange(this.mRandom, getDelay(), getDelay() * 2),
+ this.mTimeUntilNextTrack);
+ updateInternalNumber();
+ Logger.INFO("[BGM] Adjusted BGM delay 2");
+ }
+ } else if (this.mSound == null && this.mTimeUntilNextTrack-- <= 0) {
+ this.mSound = PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation());
+ updateInternalSound(mSound);
+ this.mMinecraft.getSoundHandler().playSound(this.mSound);
+ this.mTimeUntilNextTrack = getDelay();
+ updateInternalNumber();
+ Logger.INFO("[BGM] Adjusted BGM 3");
+ }
-} \ No newline at end of file
+ /*
+ * try { // Get Value stored in underlying object. Integer aRealDelay =
+ * (Integer) ReflectionUtils.getField(getClass(), "field_147676_d").get(this);
+ *
+ * if (aRealDelay == null) { return; } else { if (aRealDelay > getDelay() ||
+ * aRealDelay <= 0) { this.mTimeUntilNextTrack = getDelay();
+ * updateInternalNumber(); } else { this.mTimeUntilNextTrack -= 5 * 20;
+ * updateInternalNumber(); } aRealDelay = (Integer)
+ * ReflectionUtils.getField(getClass(), "field_147676_d").get(this);
+ * Logger.INFO("[BGM] Adjusted BGM - "+aRealDelay); }
+ *
+ * } catch (IllegalArgumentException | IllegalAccessException e) { }
+ */
+ }
+}
diff --git a/src/main/java/gtPlusPlus/plugin/manager/Core_Manager.java b/src/main/java/gtPlusPlus/plugin/manager/Core_Manager.java
index 45e85d68ac..fd64ed8b24 100644
--- a/src/main/java/gtPlusPlus/plugin/manager/Core_Manager.java
+++ b/src/main/java/gtPlusPlus/plugin/manager/Core_Manager.java
@@ -7,104 +7,97 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils;
public class Core_Manager {
- public static AutoMap<IPlugin> mPlugins = new AutoMap<IPlugin>();
-
- /**
- * @param plugin - Dynamically registers the plugin for loading.
- */
- public static void registerPlugin(IPlugin plugin) {
- Logger.INFO("[Plugin] " + "Registered "+plugin.getPluginName()+".");
- mPlugins.put(plugin);
- }
-
- /**
- * Dynamically loads all class objects within the "gtPlusPlus.plugin" package.
- */
- public static void veryEarlyInit() {
- if (ReflectionUtils.dynamicallyLoadClassesInPackage("gtPlusPlus.plugin")) {
- Logger.INFO("[Plugin] Plugin System loaded.");
- }
- }
-
- public static boolean preInit() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.preInit()) {
- Logger.INFO("[Plugin] Completed Pre-Init Phase for "+h.getPluginName()+".");
- }
- else {
- Logger.INFO("[Plugin] Failed during Pre-Init Phase for "+h.getPluginName()+".");
- }
- }
- return true;
- }
- catch (Throwable t) {}
- return false;
- }
-
- public static boolean init() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.init()) {
- Logger.INFO("[Plugin] Completed Init Phase for "+h.getPluginName()+".");
- }
- else {
- Logger.INFO("[Plugin] Failed during Init Phase for "+h.getPluginName()+".");
- }
- }
- return true;
- }
- catch (Throwable t) {}
- return false;
- }
-
- public static boolean postInit() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.postInit()) {
- Logger.INFO("[Plugin] Completed Post-Init Phase for "+h.getPluginName()+".");
- }
- else {
- Logger.INFO("[Plugin] Failed during Post-Init Phase for "+h.getPluginName()+".");
- }
- }
- return true;
- }
- catch (Throwable t) {}
- return false;
- }
-
- public static boolean serverStart() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.serverStart()) {
- Logger.INFO("[Plugin] Completed Server Start Phase for "+h.getPluginName()+".");
- }
- else {
- Logger.INFO("[Plugin] Failed during Server Start Phase for "+h.getPluginName()+".");
- }
- }
- return true;
- }
- catch (Throwable t) {}
- return false;
- }
-
- public static boolean serverStop() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.serverStop()) {
- Logger.INFO("[Plugin] Completed Server Stop Phase for "+h.getPluginName()+".");
- }
- else {
- Logger.INFO("[Plugin] Failed during Server Stop Phase for "+h.getPluginName()+".");
- }
- }
- return true;
- }
- catch (Throwable t) {}
- return false;
- }
-
-
+ public static AutoMap<IPlugin> mPlugins = new AutoMap<IPlugin>();
+
+ /**
+ * @param plugin - Dynamically registers the plugin for loading.
+ */
+ public static void registerPlugin(IPlugin plugin) {
+ Logger.INFO("[Plugin] " + "Registered " + plugin.getPluginName() + ".");
+ mPlugins.put(plugin);
+ }
+
+ /**
+ * Dynamically loads all class objects within the "gtPlusPlus.plugin" package.
+ */
+ public static void veryEarlyInit() {
+ if (ReflectionUtils.dynamicallyLoadClassesInPackage("gtPlusPlus.plugin")) {
+ Logger.INFO("[Plugin] Plugin System loaded.");
+ }
+ }
+
+ public static boolean preInit() {
+ try {
+ for (IPlugin h : mPlugins) {
+ if (h.preInit()) {
+ Logger.INFO("[Plugin] Completed Pre-Init Phase for " + h.getPluginName() + ".");
+ } else {
+ Logger.INFO("[Plugin] Failed during Pre-Init Phase for " + h.getPluginName() + ".");
+ }
+ }
+ return true;
+ } catch (Throwable t) {
+ }
+ return false;
+ }
+
+ public static boolean init() {
+ try {
+ for (IPlugin h : mPlugins) {
+ if (h.init()) {
+ Logger.INFO("[Plugin] Completed Init Phase for " + h.getPluginName() + ".");
+ } else {
+ Logger.INFO("[Plugin] Failed during Init Phase for " + h.getPluginName() + ".");
+ }
+ }
+ return true;
+ } catch (Throwable t) {
+ }
+ return false;
+ }
+
+ public static boolean postInit() {
+ try {
+ for (IPlugin h : mPlugins) {
+ if (h.postInit()) {
+ Logger.INFO("[Plugin] Completed Post-Init Phase for " + h.getPluginName() + ".");
+ } else {
+ Logger.INFO("[Plugin] Failed during Post-Init Phase for " + h.getPluginName() + ".");
+ }
+ }
+ return true;
+ } catch (Throwable t) {
+ }
+ return false;
+ }
+
+ public static boolean serverStart() {
+ try {
+ for (IPlugin h : mPlugins) {
+ if (h.serverStart()) {
+ Logger.INFO("[Plugin] Completed Server Start Phase for " + h.getPluginName() + ".");
+ } else {
+ Logger.INFO("[Plugin] Failed during Server Start Phase for " + h.getPluginName() + ".");
+ }
+ }
+ return true;
+ } catch (Throwable t) {
+ }
+ return false;
+ }
+
+ public static boolean serverStop() {
+ try {
+ for (IPlugin h : mPlugins) {
+ if (h.serverStop()) {
+ Logger.INFO("[Plugin] Completed Server Stop Phase for " + h.getPluginName() + ".");
+ } else {
+ Logger.INFO("[Plugin] Failed during Server Stop Phase for " + h.getPluginName() + ".");
+ }
+ }
+ return true;
+ } catch (Throwable t) {
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/sulfurchem/Core_SulfuricChemistry.java b/src/main/java/gtPlusPlus/plugin/sulfurchem/Core_SulfuricChemistry.java
index ed6762c69d..166261c9cb 100644
--- a/src/main/java/gtPlusPlus/plugin/sulfurchem/Core_SulfuricChemistry.java
+++ b/src/main/java/gtPlusPlus/plugin/sulfurchem/Core_SulfuricChemistry.java
@@ -17,298 +17,301 @@ import net.minecraftforge.fluids.FluidStack;
public class Core_SulfuricChemistry implements IPlugin {
- final static Core_SulfuricChemistry mInstance;
- private static boolean shouldLoad = false;
+ static final Core_SulfuricChemistry mInstance;
+ private static boolean shouldLoad = false;
- private static AutoMap<GT_Recipe> mRemovedRecipes1 = new AutoMap<GT_Recipe>();
- private static AutoMap<GT_Recipe> mRemovedRecipes2 = new AutoMap<GT_Recipe>();
+ private static AutoMap<GT_Recipe> mRemovedRecipes1 = new AutoMap<GT_Recipe>();
+ private static AutoMap<GT_Recipe> mRemovedRecipes2 = new AutoMap<GT_Recipe>();
- static {
- mInstance = new Core_SulfuricChemistry();
- Core_Manager.registerPlugin(mInstance);
- mInstance.log("Preparing "+mInstance.getPluginName()+" for use.");
- }
+ static {
+ mInstance = new Core_SulfuricChemistry();
+ Core_Manager.registerPlugin(mInstance);
+ mInstance.log("Preparing " + mInstance.getPluginName() + " for use.");
+ }
- @Override
- public boolean preInit() {
- if (/*CORE.ConfigSwitches.enableSulfuricAcidFix || *//*CORE.DEVENV*/false) {
- shouldLoad = true;
- }
- if (shouldLoad)
- return true;
- return false;
- }
+ @Override
+ public boolean preInit() {
+ if (
+ /*CORE.ConfigSwitches.enableSulfuricAcidFix || */
+ /*CORE.DEVENV*/ false) {
+ shouldLoad = true;
+ }
+ if (shouldLoad) return true;
+ return false;
+ }
- @Override
- public boolean init() {
- if (shouldLoad)
- return true;
- return false;
- }
+ @Override
+ public boolean init() {
+ if (shouldLoad) return true;
+ return false;
+ }
- @Override
- public boolean postInit() {
- if (shouldLoad) {
- try {
- int disabled = disableSulfurTrioxide();
- log("Disabled "+disabled+" Sulfur Trioxide Chemistry recipes.");
- int disabled2 = disableSulfuricAcid();
- log("Disabled "+disabled2+" Sulfuric Acid Chemistry recipes.");
- int addedNew = addRevisedGT6Recipes();
- log("Added "+addedNew+" new Sulfuric Chemistry recipes.");
-
- if (CORE.DEVENV || CORE_Preloader.DEBUG_MODE) {
- for (int i=0;i<2;i++) {
- for (GT_Recipe m : mRemovedRecipes1) {
- String[] mInfo = RecipeUtils.getRecipeInfo(m);
- log("Removed Recipe");
- for (int r=0;r<mInfo.length;r++) {
- log(mInfo[r]);
- }
- }
- for (GT_Recipe m : mRemovedRecipes2) {
- String[] mInfo = RecipeUtils.getRecipeInfo(m);
- log("Removed Recipe");
- for (int r=0;r<mInfo.length;r++) {
- log(mInfo[r]);
- }
- }
- }
- }
- return disabled > 0 && addedNew > 0;
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
- return false;
- }
+ @Override
+ public boolean postInit() {
+ if (shouldLoad) {
+ try {
+ int disabled = disableSulfurTrioxide();
+ log("Disabled " + disabled + " Sulfur Trioxide Chemistry recipes.");
+ int disabled2 = disableSulfuricAcid();
+ log("Disabled " + disabled2 + " Sulfuric Acid Chemistry recipes.");
+ int addedNew = addRevisedGT6Recipes();
+ log("Added " + addedNew + " new Sulfuric Chemistry recipes.");
- @Override
- public boolean serverStart() {
- return false;
- }
+ if (CORE.DEVENV || CORE_Preloader.DEBUG_MODE) {
+ for (int i = 0; i < 2; i++) {
+ for (GT_Recipe m : mRemovedRecipes1) {
+ String[] mInfo = RecipeUtils.getRecipeInfo(m);
+ log("Removed Recipe");
+ for (int r = 0; r < mInfo.length; r++) {
+ log(mInfo[r]);
+ }
+ }
+ for (GT_Recipe m : mRemovedRecipes2) {
+ String[] mInfo = RecipeUtils.getRecipeInfo(m);
+ log("Removed Recipe");
+ for (int r = 0; r < mInfo.length; r++) {
+ log(mInfo[r]);
+ }
+ }
+ }
+ }
+ return disabled > 0 && addedNew > 0;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ return false;
+ }
- @Override
- public boolean serverStop() {
- return false;
- }
+ @Override
+ public boolean serverStart() {
+ return false;
+ }
- @Override
- public String getPluginName() {
- return "GT++ Revised Sulfuric Chemistry Module";
- }
+ @Override
+ public boolean serverStop() {
+ return false;
+ }
- public int addRevisedGT6Recipes() {
+ @Override
+ public String getPluginName() {
+ return "GT++ Revised Sulfuric Chemistry Module";
+ }
- String catalyst = "dustPlatinum";
- int mCountAdded = 0;
+ public int addRevisedGT6Recipes() {
- /**
- * Sulfur Trioxide Recipes
- */
- //Air
- if (CORE.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict(catalyst, 0),
- ItemUtils.getItemStackOfAmountFromOreDict("cellAir", 1),
- FluidUtils.getFluidStack("sulfurdioxide", 3000),
- FluidUtils.getFluidStack("sulfurtrioxide", 4000),
- CI.emptyCells(1),
- null,
- 16,
- 16)) {
- mCountAdded++;
- }
- if (CORE.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict(catalyst, 0),
- ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurDioxide", 3),
- FluidUtils.getFluidStack("air", 1000),
- FluidUtils.getFluidStack("sulfurtrioxide", 4000),
- CI.emptyCells(3),
- null,
- 16,
- 16)) {
- mCountAdded++;
- }
- //Oxygen
- if (CORE.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict(catalyst, 0),
- ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
- FluidUtils.getFluidStack("sulfurdioxide", 3000),
- FluidUtils.getFluidStack("sulfurtrioxide", 4000),
- CI.emptyCells(1),
- null,
- 16,
- 16)) {
- mCountAdded++;
- }
- if (CORE.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict(catalyst, 0),
- ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurDioxide", 3),
- FluidUtils.getFluidStack("oxygen", 1000),
- FluidUtils.getFluidStack("sulfurtrioxide", 4000),
- CI.emptyCells(3),
- null,
- 16,
- 16)) {
- mCountAdded++;
- }
+ String catalyst = "dustPlatinum";
+ int mCountAdded = 0;
- /**
- * Sulfuric Acid Recipes
- */
+ /**
+ * Sulfur Trioxide Recipes
+ */
+ // Air
+ if (CORE.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict(catalyst, 0),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellAir", 1),
+ FluidUtils.getFluidStack("sulfurdioxide", 3000),
+ FluidUtils.getFluidStack("sulfurtrioxide", 4000),
+ CI.emptyCells(1),
+ null,
+ 16,
+ 16)) {
+ mCountAdded++;
+ }
+ if (CORE.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict(catalyst, 0),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurDioxide", 3),
+ FluidUtils.getFluidStack("air", 1000),
+ FluidUtils.getFluidStack("sulfurtrioxide", 4000),
+ CI.emptyCells(3),
+ null,
+ 16,
+ 16)) {
+ mCountAdded++;
+ }
+ // Oxygen
+ if (CORE.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict(catalyst, 0),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
+ FluidUtils.getFluidStack("sulfurdioxide", 3000),
+ FluidUtils.getFluidStack("sulfurtrioxide", 4000),
+ CI.emptyCells(1),
+ null,
+ 16,
+ 16)) {
+ mCountAdded++;
+ }
+ if (CORE.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict(catalyst, 0),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurDioxide", 3),
+ FluidUtils.getFluidStack("oxygen", 1000),
+ FluidUtils.getFluidStack("sulfurtrioxide", 4000),
+ CI.emptyCells(3),
+ null,
+ 16,
+ 16)) {
+ mCountAdded++;
+ }
- if (CORE.RA.addChemicalRecipe(
- CI.getNumberedCircuit(22),
- ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurTrioxide", 1),
- FluidUtils.getFluidStack("water", 750),
- Materials.SulfuricAcid.getFluid(1750),
- CI.emptyCells(1),
- null,
- 20,
- 20)) {
- mCountAdded++;
- }
- if (CORE.RA.addChemicalRecipe(
- CI.getNumberedCircuit(22),
- ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 3),
- FluidUtils.getFluidStack("sulfurtrioxide", 4000),
- Materials.SulfuricAcid.getFluid(7000),
- CI.emptyCells(3),
- null,
- 20,
- 20)) {
- mCountAdded++;
- }
+ /**
+ * Sulfuric Acid Recipes
+ */
+ if (CORE.RA.addChemicalRecipe(
+ CI.getNumberedCircuit(22),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurTrioxide", 1),
+ FluidUtils.getFluidStack("water", 750),
+ Materials.SulfuricAcid.getFluid(1750),
+ CI.emptyCells(1),
+ null,
+ 20,
+ 20)) {
+ mCountAdded++;
+ }
+ if (CORE.RA.addChemicalRecipe(
+ CI.getNumberedCircuit(22),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 3),
+ FluidUtils.getFluidStack("sulfurtrioxide", 4000),
+ Materials.SulfuricAcid.getFluid(7000),
+ CI.emptyCells(3),
+ null,
+ 20,
+ 20)) {
+ mCountAdded++;
+ }
- return mCountAdded;
- }
+ return mCountAdded;
+ }
+ public int disableSulfurTrioxide() {
+ int mDisabled = 0;
+ FluidStack mStack = FluidUtils.getFluidStack("sulfurtrioxide", 1);
+ // Single Block Recipes
+ recipe:
+ for (GT_Recipe r : GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList) {
+ for (ItemStack i : r.mOutputs) {
+ i.stackSize = 1;
+ if (ItemStack.areItemStacksEqual(
+ i, ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurTrioxide", 1))) {
+ mRemovedRecipes1.put(r);
+ r.mEnabled = false;
+ r.mHidden = true;
+ mDisabled++;
+ continue recipe;
+ }
+ continue;
+ }
+ for (FluidStack f : r.mFluidOutputs) {
+ f.amount = 1;
+ if (FluidStack.areFluidStackTagsEqual(f, mStack)) {
+ mRemovedRecipes1.put(r);
+ r.mEnabled = false;
+ r.mHidden = true;
+ mDisabled++;
+ continue recipe;
+ }
+ continue;
+ }
+ }
- public int disableSulfurTrioxide() {
- int mDisabled = 0;
- FluidStack mStack = FluidUtils.getFluidStack("sulfurtrioxide", 1);
- //Single Block Recipes
- recipe : for (GT_Recipe r : GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList) {
- for (ItemStack i : r.mOutputs) {
- i.stackSize = 1;
- if (ItemStack.areItemStacksEqual(i, ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurTrioxide", 1))) {
- mRemovedRecipes1.put(r);
- r.mEnabled = false;
- r.mHidden = true;
- mDisabled++;
- continue recipe;
- }
- continue;
- }
- for (FluidStack f : r.mFluidOutputs) {
- f.amount = 1;
- if (FluidStack.areFluidStackTagsEqual(f, mStack)) {
- mRemovedRecipes1.put(r);
- r.mEnabled = false;
- r.mHidden = true;
- mDisabled++;
- continue recipe;
- }
- continue;
- }
- }
+ // Multi Block Recipes
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ recipe:
+ for (GT_Recipe r : StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList) {
+ for (ItemStack i : r.mOutputs) {
+ i.stackSize = 1;
+ if (ItemStack.areItemStacksEqual(
+ i, ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurTrioxide", 1))) {
+ mRemovedRecipes1.put(r);
+ r.mEnabled = false;
+ r.mHidden = true;
+ mDisabled++;
+ continue recipe;
+ }
+ continue;
+ }
+ for (FluidStack f : r.mFluidOutputs) {
+ f.amount = 1;
+ if (FluidStack.areFluidStackTagsEqual(f, mStack)) {
+ mRemovedRecipes1.put(r);
+ r.mEnabled = false;
+ r.mHidden = true;
+ mDisabled++;
+ continue recipe;
+ }
+ continue;
+ }
+ }
+ }
- //Multi Block Recipes
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- recipe : for (GT_Recipe r : StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList) {
- for (ItemStack i : r.mOutputs) {
- i.stackSize = 1;
- if (ItemStack.areItemStacksEqual(i, ItemUtils.getItemStackOfAmountFromOreDict("cellSulfurTrioxide", 1))) {
- mRemovedRecipes1.put(r);
- r.mEnabled = false;
- r.mHidden = true;
- mDisabled++;
- continue recipe;
- }
- continue;
- }
- for (FluidStack f : r.mFluidOutputs) {
- f.amount = 1;
- if (FluidStack.areFluidStackTagsEqual(f, mStack)) {
- mRemovedRecipes1.put(r);
- r.mEnabled = false;
- r.mHidden = true;
- mDisabled++;
- continue recipe;
- }
- continue;
- }
- }
- }
+ return mDisabled;
+ }
- return mDisabled;
- }
+ public int disableSulfuricAcid() {
+ int mDisabled = 0;
+ FluidStack mStack = FluidUtils.getFluidStack("sulfuricacid", 1);
+ // Single Block Recipes
- public int disableSulfuricAcid() {
- int mDisabled = 0;
- FluidStack mStack = FluidUtils.getFluidStack("sulfuricacid", 1);
- //Single Block Recipes
-
- recipe : for (GT_Recipe r : GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList) {
- for (ItemStack i : r.mOutputs) {
- i.stackSize = 1;
- if (ItemStack.areItemStacksEqual(i, ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 1))) {
- mRemovedRecipes2.put(r);
- r.mEnabled = false;
- r.mHidden = true;
- mDisabled++;
- continue recipe;
- }
- continue;
- }
- for (FluidStack f : r.mFluidOutputs) {
- f.amount = 1;
- if (FluidStack.areFluidStackTagsEqual(f, mStack)) {
- mRemovedRecipes2.put(r);
- r.mEnabled = false;
- r.mHidden = true;
- mDisabled++;
- continue recipe;
- }
- continue;
- }
- }
+ recipe:
+ for (GT_Recipe r : GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList) {
+ for (ItemStack i : r.mOutputs) {
+ i.stackSize = 1;
+ if (ItemStack.areItemStacksEqual(i, ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 1))) {
+ mRemovedRecipes2.put(r);
+ r.mEnabled = false;
+ r.mHidden = true;
+ mDisabled++;
+ continue recipe;
+ }
+ continue;
+ }
+ for (FluidStack f : r.mFluidOutputs) {
+ f.amount = 1;
+ if (FluidStack.areFluidStackTagsEqual(f, mStack)) {
+ mRemovedRecipes2.put(r);
+ r.mEnabled = false;
+ r.mHidden = true;
+ mDisabled++;
+ continue recipe;
+ }
+ continue;
+ }
+ }
- //Multi Block Recipes
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- recipe : for (GT_Recipe r : StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList) {
- for (ItemStack i : r.mOutputs) {
- i.stackSize = 1;
- if (ItemStack.areItemStacksEqual(i, ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 1))) {
- mRemovedRecipes2.put(r);
- r.mEnabled = false;
- r.mHidden = true;
- mDisabled++;
- continue recipe;
- }
- continue;
- }
- for (FluidStack f : r.mFluidOutputs) {
- f.amount = 1;
- if (FluidStack.areFluidStackTagsEqual(f, mStack)) {
- mRemovedRecipes2.put(r);
- r.mEnabled = false;
- r.mHidden = true;
- mDisabled++;
- continue recipe;
- }
- continue;
- }
- }
- }
+ // Multi Block Recipes
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ recipe:
+ for (GT_Recipe r : StaticFields59.getLargeChemicalReactorRecipeMap().mRecipeList) {
+ for (ItemStack i : r.mOutputs) {
+ i.stackSize = 1;
+ if (ItemStack.areItemStacksEqual(
+ i, ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 1))) {
+ mRemovedRecipes2.put(r);
+ r.mEnabled = false;
+ r.mHidden = true;
+ mDisabled++;
+ continue recipe;
+ }
+ continue;
+ }
+ for (FluidStack f : r.mFluidOutputs) {
+ f.amount = 1;
+ if (FluidStack.areFluidStackTagsEqual(f, mStack)) {
+ mRemovedRecipes2.put(r);
+ r.mEnabled = false;
+ r.mHidden = true;
+ mDisabled++;
+ continue recipe;
+ }
+ continue;
+ }
+ }
+ }
- return mDisabled;
- }
-
- @Override
- public String getPluginAbbreviation() {
- return "RSCM";
- }
+ return mDisabled;
+ }
+ @Override
+ public String getPluginAbbreviation() {
+ return "RSCM";
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/Core_VillagerAdditions.java b/src/main/java/gtPlusPlus/plugin/villagers/Core_VillagerAdditions.java
index 09e4c4865f..3eba3333b4 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/Core_VillagerAdditions.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/Core_VillagerAdditions.java
@@ -2,129 +2,135 @@ package gtPlusPlus.plugin.villagers;
import static gtPlusPlus.plugin.villagers.VillagerUtils.mVillagerMap;
-import java.util.HashMap;
-
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
import gtPlusPlus.api.interfaces.IPlugin;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
-import gtPlusPlus.core.entity.monster.EntityGiantChickenBase;
-import gtPlusPlus.core.entity.monster.EntitySickBlaze;
-import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.plugin.manager.Core_Manager;
-import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner;
import gtPlusPlus.plugin.villagers.entity.EntityBaseVillager;
import gtPlusPlus.plugin.villagers.entity.EntityNativeAustralian;
import gtPlusPlus.plugin.villagers.trade.TradeHandlerAboriginal;
import gtPlusPlus.plugin.villagers.trade.TradeHandlerBanker;
import gtPlusPlus.plugin.villagers.trade.TradeHandlerTechnician;
import gtPlusPlus.plugin.villagers.trade.TradeHandlerTrader;
+import java.util.HashMap;
import net.minecraft.util.ResourceLocation;
public class Core_VillagerAdditions implements IPlugin {
- public final static Core_VillagerAdditions mInstance;
- private static boolean shouldLoad = false;
+ public static final Core_VillagerAdditions mInstance;
+ private static boolean shouldLoad = false;
+
+ public static final HashMap<Integer, ResourceLocation> mVillagerSkins = new HashMap<Integer, ResourceLocation>();
+ public static final AutoMap<Pair<Integer, IVillageTradeHandler>> mVillagerTrades =
+ new AutoMap<Pair<Integer, IVillageTradeHandler>>();
- public static final HashMap<Integer, ResourceLocation> mVillagerSkins = new HashMap<Integer, ResourceLocation>();
- public static final AutoMap<Pair<Integer, IVillageTradeHandler>> mVillagerTrades = new AutoMap<Pair<Integer, IVillageTradeHandler>>();
+ static {
+ mInstance = new Core_VillagerAdditions();
+ Core_Manager.registerPlugin(mInstance);
+ mInstance.log("Preparing " + mInstance.getPluginName() + " for use.");
+ }
- static {
- mInstance = new Core_VillagerAdditions();
- Core_Manager.registerPlugin(mInstance);
- mInstance.log("Preparing "+mInstance.getPluginName()+" for use.");
- }
+ @Override
+ public boolean preInit() {
+ if (
+ /*CORE.ConfigSwitches.enableSulfuricAcidFix || */ CORE.DEVENV) {
+ shouldLoad = true;
+ }
+ if (shouldLoad) {
+ // Register Custom Villager Entity
+ EntityRegistry.registerGlobalEntityID(
+ EntityBaseVillager.class,
+ "WiseVillager",
+ EntityRegistry.findGlobalUniqueEntityId(),
+ Utils.rgbtoHexValue(180, 120, 120),
+ Utils.rgbtoHexValue(0, 0, 0));
+ EntityRegistry.registerGlobalEntityID(
+ EntityNativeAustralian.class,
+ "Aboriginal",
+ EntityRegistry.findGlobalUniqueEntityId(),
+ Utils.rgbtoHexValue(50, 50, 50),
+ Utils.rgbtoHexValue(25, 25, 25));
+ VillagerUtils.registerNewVillager(0, "Banker", "Banker", "Banker", "banker", new TradeHandlerBanker());
+ VillagerUtils.registerNewVillager(
+ 1, "Technician", "Technician", "Technician", "technician", new TradeHandlerTechnician());
+ VillagerUtils.registerNewVillager(2, "Trader", "Trader", "Trader", "trader", new TradeHandlerTrader());
+ VillagerUtils.registerNewVillager(
+ 3, "Aboriginal", "Aboriginal", "Aboriginal", "aboriginal", new TradeHandlerAboriginal());
- @Override
- public boolean preInit() {
- if (/*CORE.ConfigSwitches.enableSulfuricAcidFix || */CORE.DEVENV) {
- shouldLoad = true;
- }
- if (shouldLoad) {
- //Register Custom Villager Entity
- EntityRegistry.registerGlobalEntityID(EntityBaseVillager.class, "WiseVillager", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(180, 120, 120), Utils.rgbtoHexValue(0, 0, 0));
- EntityRegistry.registerGlobalEntityID(EntityNativeAustralian.class, "Aboriginal", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(50, 50, 50), Utils.rgbtoHexValue(25, 25, 25));
- VillagerUtils.registerNewVillager(0, "Banker", "Banker", "Banker", "banker", new TradeHandlerBanker());
- VillagerUtils.registerNewVillager(1, "Technician", "Technician", "Technician", "technician", new TradeHandlerTechnician());
- VillagerUtils.registerNewVillager(2, "Trader", "Trader", "Trader", "trader", new TradeHandlerTrader());
- VillagerUtils.registerNewVillager(3, "Aboriginal", "Aboriginal", "Aboriginal", "aboriginal", new TradeHandlerAboriginal());
-
- if (mVillagerMap.size() > 0) {
- for (VillagerObject g : mVillagerMap.values()) {
- if (g != null && g.mID >= 0) {
- VillagerRegistry.instance().registerVillagerId(7735+g.mID);
- log("Registered a Custom Villager with ID of "+g.mID+".");
- //Utils.createNewMobSpawner(10+g.mID, EntityBaseVillager.class);
- if (mVillagerSkins.get(g.mID) != null) {
- VillagerRegistry.instance().registerVillagerSkin(7735+g.mID, mVillagerSkins.get(g.mID));
- log("Registered a Custom Skin for Villager with ID of "+g.mID+".");
- }
- }
- }
- }
-
- //Register all Villager ID's and their Custom Trades.
- if (mVillagerTrades.size() > 0) {
- for (Pair<Integer, IVillageTradeHandler> g : mVillagerTrades) {
- if (g != null && g.getKey() != null) {
- if (g.getValue() != null) {
- VillagerRegistry.instance().registerVillageTradeHandler(g.getKey(), g.getValue());
- log("Registered a Custom Trade for Villager with ID of "+g.getKey()+".");
- }
- }
- }
- }
- return true;
- }
- return false;
- }
+ if (mVillagerMap.size() > 0) {
+ for (VillagerObject g : mVillagerMap.values()) {
+ if (g != null && g.mID >= 0) {
+ VillagerRegistry.instance().registerVillagerId(7735 + g.mID);
+ log("Registered a Custom Villager with ID of " + g.mID + ".");
+ // Utils.createNewMobSpawner(10+g.mID, EntityBaseVillager.class);
+ if (mVillagerSkins.get(g.mID) != null) {
+ VillagerRegistry.instance().registerVillagerSkin(7735 + g.mID, mVillagerSkins.get(g.mID));
+ log("Registered a Custom Skin for Villager with ID of " + g.mID + ".");
+ }
+ }
+ }
+ }
- @Override
- public boolean init() {
- if (shouldLoad) {
- return true;
- }
- return false;
- }
+ // Register all Villager ID's and their Custom Trades.
+ if (mVillagerTrades.size() > 0) {
+ for (Pair<Integer, IVillageTradeHandler> g : mVillagerTrades) {
+ if (g != null && g.getKey() != null) {
+ if (g.getValue() != null) {
+ VillagerRegistry.instance().registerVillageTradeHandler(g.getKey(), g.getValue());
+ log("Registered a Custom Trade for Villager with ID of " + g.getKey() + ".");
+ }
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
- @Override
- public boolean postInit() {
- if (shouldLoad) {
- return true;
- }
- return false;
- }
+ @Override
+ public boolean init() {
+ if (shouldLoad) {
+ return true;
+ }
+ return false;
+ }
- @Override
- public boolean serverStart() {
- if (shouldLoad) {
- return true;
- }
- return false;
- }
+ @Override
+ public boolean postInit() {
+ if (shouldLoad) {
+ return true;
+ }
+ return false;
+ }
- @Override
- public boolean serverStop() {
- if (shouldLoad) {
- return true;
- }
- return false;
- }
+ @Override
+ public boolean serverStart() {
+ if (shouldLoad) {
+ return true;
+ }
+ return false;
+ }
- @Override
- public String getPluginName() {
- return "GT++ Enhanced Villagers";
- }
+ @Override
+ public boolean serverStop() {
+ if (shouldLoad) {
+ return true;
+ }
+ return false;
+ }
- @Override
- public String getPluginAbbreviation() {
- return "Bank";
- }
+ @Override
+ public String getPluginName() {
+ return "GT++ Enhanced Villagers";
+ }
+ @Override
+ public String getPluginAbbreviation() {
+ return "Bank";
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/NameLists.java b/src/main/java/gtPlusPlus/plugin/villagers/NameLists.java
index e9cd254503..3c5eccbcc2 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/NameLists.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/NameLists.java
@@ -1,994 +1,9782 @@
package gtPlusPlus.plugin.villagers;
-import org.apache.commons.lang3.StringUtils;
-
import gtPlusPlus.core.util.math.MathUtils;
+import org.apache.commons.lang3.StringUtils;
public class NameLists {
- public static final String[] mFirstNames;
- public static final String[] mLastNames;
- public static final String[] mScottishFirstNames;
-
- static {
- mFirstNames = generateFirstNames();
- mLastNames = generateLastNames();
- mScottishFirstNames = generateScottishFirstNames();
- }
+ public static final String[] mFirstNames;
+ public static final String[] mLastNames;
+ public static final String[] mScottishFirstNames;
+
+ static {
+ mFirstNames = generateFirstNames();
+ mLastNames = generateLastNames();
+ mScottishFirstNames = generateScottishFirstNames();
+ }
+ private static final String[] generateScottishFirstNames() {
+ return new String[] {
+ "Aadam",
+ "Aadit",
+ "Aahron",
+ "Aaran",
+ "Aaren",
+ "Aarez",
+ "Aarman",
+ "Aaron",
+ "Aaron-James",
+ "Aarron",
+ "Aaryan",
+ "Aaryn",
+ "Aayan",
+ "Aazaan",
+ "Abaan",
+ "Abbas",
+ "Abdallah",
+ "Abdalroof",
+ "Abdihakim",
+ "Abdirahman",
+ "Abdisalam",
+ "Abdul",
+ "Abdul-Aziz",
+ "Abdulbasir",
+ "Abdulkadir",
+ "Abdulkarem",
+ "Abdulkhader",
+ "Abdullah",
+ "Abdul-Majeed",
+ "Abdulmalik",
+ "Abdul-Rehman",
+ "Abdur",
+ "Abdurraheem",
+ "Abdur-Rahman",
+ "Abdur-Rehmaan",
+ "Abel",
+ "Abhinav",
+ "Abhisumant",
+ "Abid",
+ "Abir",
+ "Abraham",
+ "Abu",
+ "Abubakar",
+ "Ace",
+ "Adain",
+ "Adam",
+ "Adam-James",
+ "Addison",
+ "Addisson",
+ "Adegbola",
+ "Adegbolahan",
+ "Aden",
+ "Adenn",
+ "Adie",
+ "Adil",
+ "Aditya",
+ "Adnan",
+ "Adrian",
+ "Adrien",
+ "Aedan",
+ "Aedin",
+ "Aedyn",
+ "Aeron",
+ "Afonso",
+ "Ahmad",
+ "Ahmed",
+ "Ahmed-Aziz",
+ "Ahoua",
+ "Ahtasham",
+ "Aiadan",
+ "Aidan",
+ "Aiden",
+ "Aiden-Jack",
+ "Aiden-Vee",
+ "Aidian",
+ "Aidy",
+ "Ailin",
+ "Aiman",
+ "Ainsley",
+ "Ainslie",
+ "Airen",
+ "Airidas",
+ "Airlie",
+ "AJ",
+ "Ajay",
+ "A-Jay",
+ "Ajayraj",
+ "Akan",
+ "Akram",
+ "Al",
+ "Ala'",
+ "Alan",
+ "Alanas",
+ "Alasdair",
+ "Alastair",
+ "Alber",
+ "Albert",
+ "Albie",
+ "Aldred",
+ "Alec",
+ "Aled",
+ "Aleem",
+ "Aleksandar",
+ "Aleksander",
+ "Aleksandr",
+ "Aleksandrs",
+ "Alekzander",
+ "Alessandro",
+ "Alessio",
+ "Alex",
+ "Alexander",
+ "Alexei",
+ "Alexx",
+ "Alexzander",
+ "Alf",
+ "Alfee",
+ "Alfie",
+ "Alfred",
+ "Alfy",
+ "Alhaji",
+ "Al-Hassan",
+ "Ali",
+ "Aliekber",
+ "Alieu",
+ "Alihaider",
+ "Alisdair",
+ "Alishan",
+ "Alistair",
+ "Alistar",
+ "Alister",
+ "Aliyaan",
+ "Allan",
+ "Allan-Laiton",
+ "Allen",
+ "Allesandro",
+ "Allister",
+ "Ally",
+ "Alphonse",
+ "Altyiab",
+ "Alum",
+ "Alvern",
+ "Alvin",
+ "Alyas",
+ "Amaan",
+ "Aman",
+ "Amani",
+ "Ambanimoh",
+ "Ameer",
+ "Amgad",
+ "Ami",
+ "Amin",
+ "Amir",
+ "Ammaar",
+ "Ammar",
+ "Ammer",
+ "Amolpreet",
+ "Amos",
+ "Amrinder",
+ "Amrit",
+ "Amro",
+ "Anay",
+ "Andrea",
+ "Andreas",
+ "Andrei",
+ "Andrejs",
+ "Andrew",
+ "Andy",
+ "Anees",
+ "Anesu",
+ "Angel",
+ "Angelo",
+ "Angus",
+ "Anir",
+ "Anis",
+ "Anish",
+ "Anmolpreet",
+ "Annan",
+ "Anndra",
+ "Anselm",
+ "Anthony",
+ "Anthony-John",
+ "Antoine",
+ "Anton",
+ "Antoni",
+ "Antonio",
+ "Antony",
+ "Antonyo",
+ "Anubhav",
+ "Aodhan",
+ "Aon",
+ "Aonghus",
+ "Apisai",
+ "Arafat",
+ "Aran",
+ "Arandeep",
+ "Arann",
+ "Aray",
+ "Arayan",
+ "Archibald",
+ "Archie",
+ "Arda",
+ "Ardal",
+ "Ardeshir",
+ "Areeb",
+ "Areez",
+ "Aref",
+ "Arfin",
+ "Argyle",
+ "Argyll",
+ "Ari",
+ "Aria",
+ "Arian",
+ "Arihant",
+ "Aristomenis",
+ "Aristotelis",
+ "Arjuna",
+ "Arlo",
+ "Armaan",
+ "Arman",
+ "Armen",
+ "Arnab",
+ "Arnav",
+ "Arnold",
+ "Aron",
+ "Aronas",
+ "Arran",
+ "Arrham",
+ "Arron",
+ "Arryn",
+ "Arsalan",
+ "Artem",
+ "Arthur",
+ "Artur",
+ "Arturo",
+ "Arun",
+ "Arunas",
+ "Arved",
+ "Arya",
+ "Aryan",
+ "Aryankhan",
+ "Aryian",
+ "Aryn",
+ "Asa",
+ "Asfhan",
+ "Ash",
+ "Ashlee-jay",
+ "Ashley",
+ "Ashton",
+ "Ashton-Lloyd",
+ "Ashtyn",
+ "Ashwin",
+ "Asif",
+ "Asim",
+ "Aslam",
+ "Asrar",
+ "Ata",
+ "Atal",
+ "Atapattu",
+ "Ateeq",
+ "Athol",
+ "Athon",
+ "Athos-Carlos",
+ "Atli",
+ "Atom",
+ "Attila",
+ "Aulay",
+ "Aun",
+ "Austen",
+ "Austin",
+ "Avani",
+ "Averon",
+ "Avi",
+ "Avinash",
+ "Avraham",
+ "Awais",
+ "Awwal",
+ "Axel",
+ "Ayaan",
+ "Ayan",
+ "Aydan",
+ "Ayden",
+ "Aydin",
+ "Aydon",
+ "Ayman",
+ "Ayomide",
+ "Ayren",
+ "Ayrton",
+ "Aytug",
+ "Ayub",
+ "Ayyub",
+ "Azaan",
+ "Azedine",
+ "Azeem",
+ "Azim",
+ "Aziz",
+ "Azlan",
+ "Azzam",
+ "Azzedine",
+ "Babatunmise",
+ "Babur",
+ "Bader",
+ "Badr",
+ "Badsha",
+ "Bailee",
+ "Bailey",
+ "Bailie",
+ "Bailley",
+ "Baillie",
+ "Baley",
+ "Balian",
+ "Banan",
+ "Barath",
+ "Barkley",
+ "Barney",
+ "Baron",
+ "Barrie",
+ "Barry",
+ "Bartlomiej",
+ "Bartosz",
+ "Basher",
+ "Basile",
+ "Baxter",
+ "Baye",
+ "Bayley",
+ "Beau",
+ "Beinn",
+ "Bekim",
+ "Believe",
+ "Ben",
+ "Bendeguz",
+ "Benedict",
+ "Benjamin",
+ "Benjamyn",
+ "Benji",
+ "Benn",
+ "Bennett",
+ "Benny",
+ "Benoit",
+ "Bentley",
+ "Berkay",
+ "Bernard",
+ "Bertie",
+ "Bevin",
+ "Bezalel",
+ "Bhaaldeen",
+ "Bharath",
+ "Bilal",
+ "Bill",
+ "Billy",
+ "Binod",
+ "Bjorn",
+ "Blaike",
+ "Blaine",
+ "Blair",
+ "Blaire",
+ "Blake",
+ "Blazej",
+ "Blazey",
+ "Blessing",
+ "Blue",
+ "Blyth",
+ "Bo",
+ "Boab",
+ "Bob",
+ "Bobby",
+ "Bobby-Lee",
+ "Bodhan",
+ "Boedyn",
+ "Bogdan",
+ "Bohbi",
+ "Bony",
+ "Bowen",
+ "Bowie",
+ "Boyd",
+ "Bracken",
+ "Brad",
+ "Bradan",
+ "Braden",
+ "Bradley",
+ "Bradlie",
+ "Bradly",
+ "Brady",
+ "Bradyn",
+ "Braeden",
+ "Braiden",
+ "Brajan",
+ "Brandan",
+ "Branden",
+ "Brandon",
+ "Brandonlee",
+ "Brandon-Lee",
+ "Brandyn",
+ "Brannan",
+ "Brayden",
+ "Braydon",
+ "Braydyn",
+ "Breandan",
+ "Brehme",
+ "Brendan",
+ "Brendon",
+ "Brendyn",
+ "Breogan",
+ "Bret",
+ "Brett",
+ "Briaddon",
+ "Brian",
+ "Brodi",
+ "Brodie",
+ "Brody",
+ "Brogan",
+ "Broghan",
+ "Brooke",
+ "Brooklin",
+ "Brooklyn",
+ "Bruce",
+ "Bruin",
+ "Bruno",
+ "Brunon",
+ "Bryan",
+ "Bryce",
+ "Bryden",
+ "Brydon",
+ "Brydon-Craig",
+ "Bryn",
+ "Brynmor",
+ "Bryson",
+ "Buddy",
+ "Bully",
+ "Burak",
+ "Burhan",
+ "Butali",
+ "Butchi",
+ "Byron",
+ "Cabhan",
+ "Cadan",
+ "Cade",
+ "Caden",
+ "Cadon",
+ "Cadyn",
+ "Caedan",
+ "Caedyn",
+ "Cael",
+ "Caelan",
+ "Caelen",
+ "Caethan",
+ "Cahl",
+ "Cahlum",
+ "Cai",
+ "Caidan",
+ "Caiden",
+ "Caiden-Paul",
+ "Caidyn",
+ "Caie",
+ "Cailaen",
+ "Cailean",
+ "Caileb-John",
+ "Cailin",
+ "Cain",
+ "Caine",
+ "Cairn",
+ "Cal",
+ "Calan",
+ "Calder",
+ "Cale",
+ "Calean",
+ "Caleb",
+ "Calen",
+ "Caley",
+ "Calib",
+ "Calin",
+ "Callahan",
+ "Callan",
+ "Callan-Adam",
+ "Calley",
+ "Callie",
+ "Callin",
+ "Callum",
+ "Callun",
+ "Callyn",
+ "Calum",
+ "Calum-James",
+ "Calvin",
+ "Cambell",
+ "Camerin",
+ "Cameron",
+ "Campbel",
+ "Campbell",
+ "Camron",
+ "Caolain",
+ "Caolan",
+ "Carl",
+ "Carlo",
+ "Carlos",
+ "Carrich",
+ "Carrick",
+ "Carson",
+ "Carter",
+ "Carwyn",
+ "Casey",
+ "Casper",
+ "Cassy",
+ "Cathal",
+ "Cator",
+ "Cavan",
+ "Cayden",
+ "Cayden-Robert",
+ "Cayden-Tiamo",
+ "Ceejay",
+ "Ceilan",
+ "Ceiran",
+ "Ceirin",
+ "Ceiron",
+ "Cejay",
+ "Celik",
+ "Cephas",
+ "Cesar",
+ "Cesare",
+ "Chad",
+ "Chaitanya",
+ "Chang-Ha",
+ "Charles",
+ "Charley",
+ "Charlie",
+ "Charly",
+ "Chase",
+ "Che",
+ "Chester",
+ "Chevy",
+ "Chi",
+ "Chibudom",
+ "Chidera",
+ "Chimsom",
+ "Chin",
+ "Chintu",
+ "Chiqal",
+ "Chiron",
+ "Chris",
+ "Chris-Daniel",
+ "Chrismedi",
+ "Christian",
+ "Christie",
+ "Christoph",
+ "Christopher",
+ "Christopher-Lee",
+ "Christy",
+ "Chu",
+ "Chukwuemeka",
+ "Cian",
+ "Ciann",
+ "Ciar",
+ "Ciaran",
+ "Ciarian",
+ "Cieran",
+ "Cillian",
+ "Cillin",
+ "Cinar",
+ "CJ",
+ "C-Jay",
+ "Clark",
+ "Clarke",
+ "Clayton",
+ "Clement",
+ "Clifford",
+ "Clyde",
+ "Cobain",
+ "Coban",
+ "Coben",
+ "Cobi",
+ "Cobie",
+ "Coby",
+ "Codey",
+ "Codi",
+ "Codie",
+ "Cody",
+ "Cody-Lee",
+ "Coel",
+ "Cohan",
+ "Cohen",
+ "Colby",
+ "Cole",
+ "Colin",
+ "Coll",
+ "Colm",
+ "Colt",
+ "Colton",
+ "Colum",
+ "Colvin",
+ "Comghan",
+ "Conal",
+ "Conall",
+ "Conan",
+ "Conar",
+ "Conghaile",
+ "Conlan",
+ "Conley",
+ "Conli",
+ "Conlin",
+ "Conlly",
+ "Conlon",
+ "Conlyn",
+ "Connal",
+ "Connall",
+ "Connan",
+ "Connar",
+ "Connel",
+ "Connell",
+ "Conner",
+ "Connolly",
+ "Connor",
+ "Connor-David",
+ "Conor",
+ "Conrad",
+ "Cooper",
+ "Copeland",
+ "Coray",
+ "Corben",
+ "Corbin",
+ "Corey",
+ "Corey-James",
+ "Corey-Jay",
+ "Cori",
+ "Corie",
+ "Corin",
+ "Cormac",
+ "Cormack",
+ "Cormak",
+ "Corran",
+ "Corrie",
+ "Cory",
+ "Cosmo",
+ "Coupar",
+ "Craig",
+ "Craig-James",
+ "Crawford",
+ "Creag",
+ "Crispin",
+ "Cristian",
+ "Crombie",
+ "Cruiz",
+ "Cruz",
+ "Cuillin",
+ "Cullen",
+ "Cullin",
+ "Curtis",
+ "Cyrus",
+ "Daanyaal",
+ "Daegan",
+ "Daegyu",
+ "Dafydd",
+ "Dagon",
+ "Dailey",
+ "Daimhin",
+ "Daithi",
+ "Dakota",
+ "Daksh",
+ "Dale",
+ "Dalong",
+ "Dalton",
+ "Damian",
+ "Damien",
+ "Damon",
+ "Dan",
+ "Danar",
+ "Dane",
+ "Danial",
+ "Daniel",
+ "Daniele",
+ "Daniel-James",
+ "Daniels",
+ "Daniil",
+ "Danish",
+ "Daniyal",
+ "Danniel",
+ "Danny",
+ "Dante",
+ "Danyal",
+ "Danyil",
+ "Danys",
+ "Daood",
+ "Dara",
+ "Darach",
+ "Daragh",
+ "Darcy",
+ "D'arcy",
+ "Dareh",
+ "Daren",
+ "Darien",
+ "Darius",
+ "Darl",
+ "Darn",
+ "Darrach",
+ "Darragh",
+ "Darrel",
+ "Darrell",
+ "Darren",
+ "Darrie",
+ "Darrius",
+ "Darroch",
+ "Darryl",
+ "Darryn",
+ "Darwyn",
+ "Daryl",
+ "Daryn",
+ "Daud",
+ "Daumantas",
+ "Davi",
+ "David",
+ "David-Jay",
+ "David-Lee",
+ "Davie",
+ "Davis",
+ "Davy",
+ "Dawid",
+ "Dawson",
+ "Dawud",
+ "Dayem",
+ "Daymian",
+ "Deacon",
+ "Deagan",
+ "Dean",
+ "Deano",
+ "Decklan",
+ "Declain",
+ "Declan",
+ "Declyan",
+ "Declyn",
+ "Dedeniseoluwa",
+ "Deecan",
+ "Deegan",
+ "Deelan",
+ "Deklain-Jaimes",
+ "Del",
+ "Demetrius",
+ "Denis",
+ "Deniss",
+ "Dennan",
+ "Dennin",
+ "Dennis",
+ "Denny",
+ "Dennys",
+ "Denon",
+ "Denton",
+ "Denver",
+ "Denzel",
+ "Deon",
+ "Derek",
+ "Derick",
+ "Derin",
+ "Dermot",
+ "Derren",
+ "Derrie",
+ "Derrin",
+ "Derron",
+ "Derry",
+ "Derryn",
+ "Deryn",
+ "Deshawn",
+ "Desmond",
+ "Dev",
+ "Devan",
+ "Devin",
+ "Devlin",
+ "Devlyn",
+ "Devon",
+ "Devrin",
+ "Devyn",
+ "Dex",
+ "Dexter",
+ "Dhani",
+ "Dharam",
+ "Dhavid",
+ "Dhyia",
+ "Diarmaid",
+ "Diarmid",
+ "Diarmuid",
+ "Didier",
+ "Diego",
+ "Diesel",
+ "Diesil",
+ "Digby",
+ "Dilan",
+ "Dilano",
+ "Dillan",
+ "Dillon",
+ "Dilraj",
+ "Dimitri",
+ "Dinaras",
+ "Dion",
+ "Dissanayake",
+ "Dmitri",
+ "Doire",
+ "Dolan",
+ "Domanic",
+ "Domenico",
+ "Domhnall",
+ "Dominic",
+ "Dominick",
+ "Dominik",
+ "Donald",
+ "Donnacha",
+ "Donnie",
+ "Dorian",
+ "Dougal",
+ "Douglas",
+ "Dougray",
+ "Drakeo",
+ "Dre",
+ "Dregan",
+ "Drew",
+ "Dugald",
+ "Duncan",
+ "Duriel",
+ "Dustin",
+ "Dylan",
+ "Dylan-Jack",
+ "Dylan-James",
+ "Dylan-John",
+ "Dylan-Patrick",
+ "Dylin",
+ "Dyllan",
+ "Dyllan-James",
+ "Dyllon",
+ "Eadie",
+ "Eagann",
+ "Eamon",
+ "Eamonn",
+ "Eason",
+ "Eassan",
+ "Easton",
+ "Ebow",
+ "Ed",
+ "Eddie",
+ "Eden",
+ "Ediomi",
+ "Edison",
+ "Eduardo",
+ "Eduards",
+ "Edward",
+ "Edwin",
+ "Edwyn",
+ "Eesa",
+ "Efan",
+ "Efe",
+ "Ege",
+ "Ehsan",
+ "Ehsen",
+ "Eiddon",
+ "Eidhan",
+ "Eihli",
+ "Eimantas",
+ "Eisa",
+ "Eli",
+ "Elias",
+ "Elijah",
+ "Eliot",
+ "Elisau",
+ "Eljay",
+ "Eljon",
+ "Elliot",
+ "Elliott",
+ "Ellis",
+ "Ellisandro",
+ "Elshan",
+ "Elvin",
+ "Elyan",
+ "Emanuel",
+ "Emerson",
+ "Emil",
+ "Emile",
+ "Emir",
+ "Emlyn",
+ "Emmanuel",
+ "Emmet",
+ "Eng",
+ "Eniola",
+ "Enis",
+ "Ennis",
+ "Enrico",
+ "Enrique",
+ "Enzo",
+ "Eoghain",
+ "Eoghan",
+ "Eoin",
+ "Eonan",
+ "Erdehan",
+ "Eren",
+ "Erencem",
+ "Eric",
+ "Ericlee",
+ "Erik",
+ "Eriz",
+ "Ernie-Jacks",
+ "Eroni",
+ "Eryk",
+ "Eshan",
+ "Essa",
+ "Esteban",
+ "Ethan",
+ "Etienne",
+ "Etinosa",
+ "Euan",
+ "Eugene",
+ "Evan",
+ "Evann",
+ "Ewan",
+ "Ewen",
+ "Ewing",
+ "Exodi",
+ "Ezekiel",
+ "Ezra",
+ "Fabian",
+ "Fahad",
+ "Faheem",
+ "Faisal",
+ "Faizaan",
+ "Famara",
+ "Fares",
+ "Farhaan",
+ "Farhan",
+ "Farren",
+ "Farzad",
+ "Fauzaan",
+ "Favour",
+ "Fawaz",
+ "Fawkes",
+ "Faysal",
+ "Fearghus",
+ "Feden",
+ "Felix",
+ "Fergal",
+ "Fergie",
+ "Fergus",
+ "Ferre",
+ "Fezaan",
+ "Fiachra",
+ "Fikret",
+ "Filip",
+ "Filippo",
+ "Finan",
+ "Findlay",
+ "Findlay-James",
+ "Findlie",
+ "Finlay",
+ "Finley",
+ "Finn",
+ "Finnan",
+ "Finnean",
+ "Finnen",
+ "Finnlay",
+ "Finnley",
+ "Fintan",
+ "Fionn",
+ "Firaaz",
+ "Fletcher",
+ "Flint",
+ "Florin",
+ "Flyn",
+ "Flynn",
+ "Fodeba",
+ "Folarinwa",
+ "Forbes",
+ "Forgan",
+ "Forrest",
+ "Fox",
+ "Francesco",
+ "Francis",
+ "Francisco",
+ "Franciszek",
+ "Franco",
+ "Frank",
+ "Frankie",
+ "Franklin",
+ "Franko",
+ "Fraser",
+ "Frazer",
+ "Fred",
+ "Freddie",
+ "Frederick",
+ "Fruin",
+ "Fyfe",
+ "Fyn",
+ "Fynlay",
+ "Fynn",
+ "Gabriel",
+ "Gallagher",
+ "Gareth",
+ "Garren",
+ "Garrett",
+ "Garry",
+ "Gary",
+ "Gavin",
+ "Gavin-Lee",
+ "Gene",
+ "Geoff",
+ "Geoffrey",
+ "Geomer",
+ "Geordan",
+ "Geordie",
+ "George",
+ "Georgia",
+ "Georgy",
+ "Gerard",
+ "Ghyll",
+ "Giacomo",
+ "Gian",
+ "Giancarlo",
+ "Gianluca",
+ "Gianmarco",
+ "Gideon",
+ "Gil",
+ "Gio",
+ "Girijan",
+ "Girius",
+ "Gjan",
+ "Glascott",
+ "Glen",
+ "Glenn",
+ "Gordon",
+ "Grady",
+ "Graeme",
+ "Graham",
+ "Grahame",
+ "Grant",
+ "Grayson",
+ "Greg",
+ "Gregor",
+ "Gregory",
+ "Greig",
+ "Griffin",
+ "Griffyn",
+ "Grzegorz",
+ "Guang",
+ "Guerin",
+ "Guillaume",
+ "Gurardass",
+ "Gurdeep",
+ "Gursees",
+ "Gurthar",
+ "Gurveer",
+ "Gurwinder",
+ "Gus",
+ "Gustav",
+ "Guthrie",
+ "Guy",
+ "Gytis",
+ "Habeeb",
+ "Hadji",
+ "Hadyn",
+ "Hagun",
+ "Haiden",
+ "Haider",
+ "Hamad",
+ "Hamid",
+ "Hamish",
+ "Hamza",
+ "Hamzah",
+ "Han",
+ "Hansen",
+ "Hao",
+ "Hareem",
+ "Hari",
+ "Harikrishna",
+ "Haris",
+ "Harish",
+ "Harjeevan",
+ "Harjyot",
+ "Harlee",
+ "Harleigh",
+ "Harley",
+ "Harman",
+ "Harnek",
+ "Harold",
+ "Haroon",
+ "Harper",
+ "Harri",
+ "Harrington",
+ "Harris",
+ "Harrison",
+ "Harry",
+ "Harvey",
+ "Harvie",
+ "Harvinder",
+ "Hasan",
+ "Haseeb",
+ "Hashem",
+ "Hashim",
+ "Hassan",
+ "Hassanali",
+ "Hately",
+ "Havila",
+ "Hayden",
+ "Haydn",
+ "Haydon",
+ "Haydyn",
+ "Hcen",
+ "Hector",
+ "Heddle",
+ "Heidar",
+ "Heini",
+ "Hendri",
+ "Henri",
+ "Henry",
+ "Herbert",
+ "Heyden",
+ "Hiro",
+ "Hirvaansh",
+ "Hishaam",
+ "Hogan",
+ "Honey",
+ "Hong",
+ "Hope",
+ "Hopkin",
+ "Hosea",
+ "Howard",
+ "Howie",
+ "Hristomir",
+ "Hubert",
+ "Hugh",
+ "Hugo",
+ "Humza",
+ "Hunter",
+ "Husnain",
+ "Hussain",
+ "Hussan",
+ "Hussnain",
+ "Hussnan",
+ "Hyden",
+ "I",
+ "Iagan",
+ "Iain",
+ "Ian",
+ "Ibraheem",
+ "Ibrahim",
+ "Idahosa",
+ "Idrees",
+ "Idris",
+ "Iestyn",
+ "Ieuan",
+ "Igor",
+ "Ihtisham",
+ "Ijay",
+ "Ikechukwu",
+ "Ikemsinachukwu",
+ "Ilyaas",
+ "Ilyas",
+ "Iman",
+ "Immanuel",
+ "Inan",
+ "Indy",
+ "Ines",
+ "Innes",
+ "Ioannis",
+ "Ireayomide",
+ "Ireoluwa",
+ "Irvin",
+ "Irvine",
+ "Isa",
+ "Isaa",
+ "Isaac",
+ "Isaiah",
+ "Isak",
+ "Isher",
+ "Ishwar",
+ "Isimeli",
+ "Isira",
+ "Ismaeel",
+ "Ismail",
+ "Israel",
+ "Issiaka",
+ "Ivan",
+ "Ivar",
+ "Izaak",
+ "J",
+ "Jaay",
+ "Jac",
+ "Jace",
+ "Jack",
+ "Jacki",
+ "Jackie",
+ "Jack-James",
+ "Jackson",
+ "Jacky",
+ "Jacob",
+ "Jacques",
+ "Jad",
+ "Jaden",
+ "Jadon",
+ "Jadyn",
+ "Jae",
+ "Jagat",
+ "Jago",
+ "Jaheim",
+ "Jahid",
+ "Jahy",
+ "Jai",
+ "Jaida",
+ "Jaiden",
+ "Jaidyn",
+ "Jaii",
+ "Jaime",
+ "Jai-Rajaram",
+ "Jaise",
+ "Jak",
+ "Jake",
+ "Jakey",
+ "Jakob",
+ "Jaksyn",
+ "Jakub",
+ "Jamaal",
+ "Jamal",
+ "Jameel",
+ "Jameil",
+ "James",
+ "James-Paul",
+ "Jamey",
+ "Jamie",
+ "Jan",
+ "Jaosha",
+ "Jardine",
+ "Jared",
+ "Jarell",
+ "Jarl",
+ "Jarno",
+ "Jarred",
+ "Jarvi",
+ "Jasey-Jay",
+ "Jasim",
+ "Jaskaran",
+ "Jason",
+ "Jasper",
+ "Jaxon",
+ "Jaxson",
+ "Jay",
+ "Jaydan",
+ "Jayden",
+ "Jayden-James",
+ "Jayden-Lee",
+ "Jayden-Paul",
+ "Jayden-Thomas",
+ "Jaydn",
+ "Jaydon",
+ "Jaydyn",
+ "Jayhan",
+ "Jay-Jay",
+ "Jayke",
+ "Jaymie",
+ "Jayse",
+ "Jayson",
+ "Jaz",
+ "Jazeb",
+ "Jazib",
+ "Jazz",
+ "Jean",
+ "Jean-Lewis",
+ "Jean-Pierre",
+ "Jebadiah",
+ "Jed",
+ "Jedd",
+ "Jedidiah",
+ "Jeemie",
+ "Jeevan",
+ "Jeffrey",
+ "Jensen",
+ "Jenson",
+ "Jensyn",
+ "Jeremy",
+ "Jerome",
+ "Jeronimo",
+ "Jerrick",
+ "Jerry",
+ "Jesse",
+ "Jesuseun",
+ "Jeswin",
+ "Jevan",
+ "Jeyun",
+ "Jez",
+ "Jia",
+ "Jian",
+ "Jiao",
+ "Jimmy",
+ "Jincheng",
+ "JJ",
+ "Joaquin",
+ "Joash",
+ "Jock",
+ "Jody",
+ "Joe",
+ "Joeddy",
+ "Joel",
+ "Joey",
+ "Joey-Jack",
+ "Johann",
+ "Johannes",
+ "Johansson",
+ "John",
+ "Johnathan",
+ "Johndean",
+ "Johnjay",
+ "John-Michael",
+ "Johnnie",
+ "Johnny",
+ "Johnpaul",
+ "John-Paul",
+ "John-Scott",
+ "Johnson",
+ "Jole",
+ "Jomuel",
+ "Jon",
+ "Jonah",
+ "Jonatan",
+ "Jonathan",
+ "Jonathon",
+ "Jonny",
+ "Jonothan",
+ "Jon-Paul",
+ "Jonson",
+ "Joojo",
+ "Jordan",
+ "Jordi",
+ "Jordon",
+ "Jordy",
+ "Jordyn",
+ "Jorge",
+ "Joris",
+ "Jorryn",
+ "Josan",
+ "Josef",
+ "Joseph",
+ "Josese",
+ "Josh",
+ "Joshiah",
+ "Joshua",
+ "Josiah",
+ "Joss",
+ "Jostelle",
+ "Joynul",
+ "Juan",
+ "Jubin",
+ "Judah",
+ "Jude",
+ "Jules",
+ "Julian",
+ "Julien",
+ "Jun",
+ "Junior",
+ "Jura",
+ "Justan",
+ "Justin",
+ "Justinas",
+ "Kaan",
+ "Kabeer",
+ "Kabir",
+ "Kacey",
+ "Kacper",
+ "Kade",
+ "Kaden",
+ "Kadin",
+ "Kadyn",
+ "Kaeden",
+ "Kael",
+ "Kaelan",
+ "Kaelin",
+ "Kaelum",
+ "Kai",
+ "Kaid",
+ "Kaidan",
+ "Kaiden",
+ "Kaidinn",
+ "Kaidyn",
+ "Kaileb",
+ "Kailin",
+ "Kain",
+ "Kaine",
+ "Kainin",
+ "Kainui",
+ "Kairn",
+ "Kaison",
+ "Kaiwen",
+ "Kajally",
+ "Kajetan",
+ "Kalani",
+ "Kale",
+ "Kaleb",
+ "Kaleem",
+ "Kal-el",
+ "Kalen",
+ "Kalin",
+ "Kallan",
+ "Kallin",
+ "Kalum",
+ "Kalvin",
+ "Kalvyn",
+ "Kameron",
+ "Kames",
+ "Kamil",
+ "Kamran",
+ "Kamron",
+ "Kane",
+ "Karam",
+ "Karamvir",
+ "Karandeep",
+ "Kareem",
+ "Karim",
+ "Karimas",
+ "Karl",
+ "Karol",
+ "Karson",
+ "Karsyn",
+ "Karthikeya",
+ "Kasey",
+ "Kash",
+ "Kashif",
+ "Kasim",
+ "Kasper",
+ "Kasra",
+ "Kavin",
+ "Kayam",
+ "Kaydan",
+ "Kayden",
+ "Kaydin",
+ "Kaydn",
+ "Kaydyn",
+ "Kaydyne",
+ "Kayleb",
+ "Kaylem",
+ "Kaylum",
+ "Kayne",
+ "Kaywan",
+ "Kealan",
+ "Kealon",
+ "Kean",
+ "Keane",
+ "Kearney",
+ "Keatin",
+ "Keaton",
+ "Keavan",
+ "Keayn",
+ "Kedrick",
+ "Keegan",
+ "Keelan",
+ "Keelin",
+ "Keeman",
+ "Keenan",
+ "Keenan-Lee",
+ "Keeton",
+ "Kehinde",
+ "Keigan",
+ "Keilan",
+ "Keir",
+ "Keiran",
+ "Keiren",
+ "Keiron",
+ "Keiryn",
+ "Keison",
+ "Keith",
+ "Keivlin",
+ "Kelam",
+ "Kelan",
+ "Kellan",
+ "Kellen",
+ "Kelso",
+ "Kelum",
+ "Kelvan",
+ "Kelvin",
+ "Ken",
+ "Kenan",
+ "Kendall",
+ "Kendyn",
+ "Kenlin",
+ "Kenneth",
+ "Kensey",
+ "Kenton",
+ "Kenyon",
+ "Kenzeigh",
+ "Kenzi",
+ "Kenzie",
+ "Kenzo",
+ "Kenzy",
+ "Keo",
+ "Ker",
+ "Kern",
+ "Kerr",
+ "Kevan",
+ "Kevin",
+ "Kevyn",
+ "Kez",
+ "Khai",
+ "Khalan",
+ "Khaleel",
+ "Khaya",
+ "Khevien",
+ "Khizar",
+ "Khizer",
+ "Kia",
+ "Kian",
+ "Kian-James",
+ "Kiaran",
+ "Kiarash",
+ "Kie",
+ "Kiefer",
+ "Kiegan",
+ "Kienan",
+ "Kier",
+ "Kieran",
+ "Kieran-Scott",
+ "Kieren",
+ "Kierin",
+ "Kiern",
+ "Kieron",
+ "Kieryn",
+ "Kile",
+ "Killian",
+ "Kimi",
+ "Kingston",
+ "Kinneil",
+ "Kinnon",
+ "Kinsey",
+ "Kiran",
+ "Kirk",
+ "Kirwin",
+ "Kit",
+ "Kiya",
+ "Kiyonari",
+ "Kjae",
+ "Klein",
+ "Klevis",
+ "Kobe",
+ "Kobi",
+ "Koby",
+ "Koddi",
+ "Koden",
+ "Kodi",
+ "Kodie",
+ "Kody",
+ "Kofi",
+ "Kogan",
+ "Kohen",
+ "Kole",
+ "Konan",
+ "Konar",
+ "Konnor",
+ "Konrad",
+ "Koray",
+ "Korben",
+ "Korbyn",
+ "Korey",
+ "Kori",
+ "Korrin",
+ "Kory",
+ "Koushik",
+ "Kris",
+ "Krish",
+ "Krishan",
+ "Kriss",
+ "Kristian",
+ "Kristin",
+ "Kristofer",
+ "Kristoffer",
+ "Kristopher",
+ "Kruz",
+ "Krzysiek",
+ "Krzysztof",
+ "Ksawery",
+ "Ksawier",
+ "Kuba",
+ "Kurt",
+ "Kurtis",
+ "Kurtis-Jae",
+ "Kyaan",
+ "Kyan",
+ "Kyde",
+ "Kyden",
+ "Kye",
+ "Kyel",
+ "Kyhran",
+ "Kyie",
+ "Kylan",
+ "Kylar",
+ "Kyle",
+ "Kyle-Derek",
+ "Kylian",
+ "Kym",
+ "Kynan",
+ "Kyral",
+ "Kyran",
+ "Kyren",
+ "Kyrillos",
+ "Kyro",
+ "Kyron",
+ "Kyrran",
+ "Lachlainn",
+ "Lachlan",
+ "Lachlann",
+ "Lael",
+ "Lagan",
+ "Laird",
+ "Laison",
+ "Lakshya",
+ "Lance",
+ "Lancelot",
+ "Landon",
+ "Lang",
+ "Lasse",
+ "Latif",
+ "Lauchlan",
+ "Lauchlin",
+ "Laughlan",
+ "Lauren",
+ "Laurence",
+ "Laurie",
+ "Lawlyn",
+ "Lawrence",
+ "Lawrie",
+ "Lawson",
+ "Layne",
+ "Layton",
+ "Lee",
+ "Leigh",
+ "Leigham",
+ "Leighton",
+ "Leilan",
+ "Leiten",
+ "Leithen",
+ "Leland",
+ "Lenin",
+ "Lennan",
+ "Lennen",
+ "Lennex",
+ "Lennon",
+ "Lennox",
+ "Lenny",
+ "Leno",
+ "Lenon",
+ "Lenyn",
+ "Leo",
+ "Leon",
+ "Leonard",
+ "Leonardas",
+ "Leonardo",
+ "Lepeng",
+ "Leroy",
+ "Leven",
+ "Levi",
+ "Levon",
+ "Levy",
+ "Lewie",
+ "Lewin",
+ "Lewis",
+ "Lex",
+ "Leydon",
+ "Leyland",
+ "Leylann",
+ "Leyton",
+ "Liall",
+ "Liam",
+ "Liam-Stephen",
+ "Limo",
+ "Lincoln",
+ "Lincoln-John",
+ "Lincon",
+ "Linden",
+ "Linton",
+ "Lionel",
+ "Lisandro",
+ "Litrell",
+ "Liyonela-Elam",
+ "LLeyton",
+ "Lliam",
+ "Lloyd",
+ "Lloyde",
+ "Loche",
+ "Lochlan",
+ "Lochlann",
+ "Lochlan-Oliver",
+ "Lock",
+ "Lockey",
+ "Logan",
+ "Logann",
+ "Logan-Rhys",
+ "Loghan",
+ "Lokesh",
+ "Loki",
+ "Lomond",
+ "Lorcan",
+ "Lorenz",
+ "Lorenzo",
+ "Lorne",
+ "Loudon",
+ "Loui",
+ "Louie",
+ "Louis",
+ "Loukas",
+ "Lovell",
+ "Luc",
+ "Luca",
+ "Lucais",
+ "Lucas",
+ "Lucca",
+ "Lucian",
+ "Luciano",
+ "Lucien",
+ "Lucus",
+ "Luic",
+ "Luis",
+ "Luk",
+ "Luka",
+ "Lukas",
+ "Lukasz",
+ "Luke",
+ "Lukmaan",
+ "Luqman",
+ "Lyall",
+ "Lyle",
+ "Lyndsay",
+ "Lysander",
+ "Maanav",
+ "Maaz",
+ "Mac",
+ "Macallum",
+ "Macaulay",
+ "Macauley",
+ "Macaully",
+ "Machlan",
+ "Maciej",
+ "Mack",
+ "Mackenzie",
+ "Mackenzy",
+ "Mackie",
+ "Macsen",
+ "Macy",
+ "Madaki",
+ "Maddison",
+ "Maddox",
+ "Madison",
+ "Madison-Jake",
+ "Madox",
+ "Mael",
+ "Magnus",
+ "Mahan",
+ "Mahdi",
+ "Mahmoud",
+ "Maias",
+ "Maison",
+ "Maisum",
+ "Maitlind",
+ "Majid",
+ "Makensie",
+ "Makenzie",
+ "Makin",
+ "Maksim",
+ "Maksymilian",
+ "Malachai",
+ "Malachi",
+ "Malachy",
+ "Malakai",
+ "Malakhy",
+ "Malcolm",
+ "Malik",
+ "Malikye",
+ "Malo",
+ "Ma'moon",
+ "Manas",
+ "Maneet",
+ "Manmohan",
+ "Manolo",
+ "Manson",
+ "Mantej",
+ "Manuel",
+ "Manus",
+ "Marc",
+ "Marc-Anthony",
+ "Marcel",
+ "Marcello",
+ "Marcin",
+ "Marco",
+ "Marcos",
+ "Marcous",
+ "Marcquis",
+ "Marcus",
+ "Mario",
+ "Marios",
+ "Marius",
+ "Mark",
+ "Marko",
+ "Markus",
+ "Marley",
+ "Marlin",
+ "Marlon",
+ "Maros",
+ "Marshall",
+ "Martin",
+ "Marty",
+ "Martyn",
+ "Marvellous",
+ "Marvin",
+ "Marwan",
+ "Maryk",
+ "Marzuq",
+ "Mashhood",
+ "Mason",
+ "Mason-Jay",
+ "Masood",
+ "Masson",
+ "Matas",
+ "Matej",
+ "Mateusz",
+ "Mathew",
+ "Mathias",
+ "Mathu",
+ "Mathuyan",
+ "Mati",
+ "Matt",
+ "Matteo",
+ "Matthew",
+ "Matthew-William",
+ "Matthias",
+ "Max",
+ "Maxim",
+ "Maximilian",
+ "Maximillian",
+ "Maximus",
+ "Maxwell",
+ "Maxx",
+ "Mayeul",
+ "Mayson",
+ "Mazin",
+ "Mcbride",
+ "McCaulley",
+ "McKade",
+ "McKauley",
+ "McKay",
+ "McKenzie",
+ "McLay",
+ "Meftah",
+ "Mehmet",
+ "Mehraz",
+ "Meko",
+ "Melville",
+ "Meshach",
+ "Meyzhward",
+ "Micah",
+ "Michael",
+ "Michael-Alexander",
+ "Michael-James",
+ "Michal",
+ "Michat",
+ "Micheal",
+ "Michee",
+ "Mickey",
+ "Miguel",
+ "Mika",
+ "Mikael",
+ "Mi'kael",
+ "Mikee",
+ "Mikey",
+ "Mikhail",
+ "Mikolaj",
+ "Miles",
+ "Millar",
+ "Miller",
+ "Milo",
+ "Milos",
+ "Milosz",
+ "Mir",
+ "Mirza",
+ "Mitch",
+ "Mitchel",
+ "Mitchell",
+ "Moad",
+ "Moayd",
+ "Mobeen",
+ "Modoulamin",
+ "Modu",
+ "Mohamad",
+ "Mohamed",
+ "Mohammad",
+ "Mohammad-Bilal",
+ "Mohammed",
+ "Mohanad",
+ "Mohd",
+ "Momin",
+ "Momooreoluwa",
+ "Montague",
+ "Montgomery",
+ "Monty",
+ "Moore",
+ "Moosa",
+ "Moray",
+ "Morgan",
+ "Morgyn",
+ "Morris",
+ "Morton",
+ "Moshy",
+ "Motade",
+ "Moyes",
+ "Msughter",
+ "Mueez",
+ "Muhamadjavad",
+ "Muhammad",
+ "Muhammed",
+ "Muhsin",
+ "Muir",
+ "Munachi",
+ "Muneeb",
+ "Mungo",
+ "Munir",
+ "Munmair",
+ "Munro",
+ "Murdo",
+ "Murray",
+ "Murrough",
+ "Murry",
+ "Musa",
+ "Musse",
+ "Mustafa",
+ "Mustapha",
+ "Muzammil",
+ "Muzzammil",
+ "Mykie",
+ "Myles",
+ "Mylo",
+ "Nabeel",
+ "Nadeem",
+ "Nader",
+ "Nagib",
+ "Naif",
+ "Nairn",
+ "Narvic",
+ "Nash",
+ "Nasser",
+ "Nassir",
+ "Natan",
+ "Nate",
+ "Nathan",
+ "Nathanael",
+ "Nathanial",
+ "Nathaniel",
+ "Nathan-Rae",
+ "Nawfal",
+ "Nayan",
+ "Neco",
+ "Neil",
+ "Nelson",
+ "Neo",
+ "Neshawn",
+ "Nevan",
+ "Nevin",
+ "Ngonidzashe",
+ "Nial",
+ "Niall",
+ "Nicholas",
+ "Nick",
+ "Nickhill",
+ "Nicki",
+ "Nickson",
+ "Nicky",
+ "Nico",
+ "Nicodemus",
+ "Nicol",
+ "Nicolae",
+ "Nicolas",
+ "Nidhish",
+ "Nihaal",
+ "Nihal",
+ "Nikash",
+ "Nikhil",
+ "Niki",
+ "Nikita",
+ "Nikodem",
+ "Nikolai",
+ "Nikos",
+ "Nilav",
+ "Niraj",
+ "Niro",
+ "Niven",
+ "Noah",
+ "Noel",
+ "Nolan",
+ "Noor",
+ "Norman",
+ "Norrie",
+ "Nuada",
+ "Nyah",
+ "Oakley",
+ "Oban",
+ "Obieluem",
+ "Obosa",
+ "Odhran",
+ "Odin",
+ "Odynn",
+ "Ogheneochuko",
+ "Ogheneruno",
+ "Ohran",
+ "Oilibhear",
+ "Oisin",
+ "Ojima-Ojo",
+ "Okeoghene",
+ "Olaf",
+ "Ola-Oluwa",
+ "Olaoluwapolorimi",
+ "Ole",
+ "Olie",
+ "Oliver",
+ "Olivier",
+ "Oliwier",
+ "Ollie",
+ "Olurotimi",
+ "Oluwadamilare",
+ "Oluwadamiloju",
+ "Oluwafemi",
+ "Oluwafikunayomi",
+ "Oluwalayomi",
+ "Oluwatobiloba",
+ "Oluwatoni",
+ "Omar",
+ "Omri",
+ "Oran",
+ "Orin",
+ "Orlando",
+ "Orley",
+ "Orran",
+ "Orrick",
+ "Orrin",
+ "Orson",
+ "Oryn",
+ "Oscar",
+ "Osesenagha",
+ "Oskar",
+ "Ossian",
+ "Oswald",
+ "Otto",
+ "Owain",
+ "Owais",
+ "Owen",
+ "Owyn",
+ "Oz",
+ "Ozzy",
+ "Pablo",
+ "Pacey",
+ "Padraig",
+ "Paolo",
+ "Pardeepraj",
+ "Parkash",
+ "Parker",
+ "Pascoe",
+ "Pasquale",
+ "Patrick",
+ "Patrick-John",
+ "Patrikas",
+ "Patryk",
+ "Paul",
+ "Pavit",
+ "Pawel",
+ "Pawlo",
+ "Pearce",
+ "Pearse",
+ "Pearsen",
+ "Pedram",
+ "Pedro",
+ "Peirce",
+ "Peiyan",
+ "Pele",
+ "Peni",
+ "Peregrine",
+ "Peter",
+ "Phani",
+ "Philip",
+ "Philippos",
+ "Phinehas",
+ "Phoenix",
+ "Phoevos",
+ "Pierce",
+ "Pierre-Antoine",
+ "Pieter",
+ "Pietro",
+ "Piotr",
+ "Porter",
+ "Prabhjoit",
+ "Prabodhan",
+ "Praise",
+ "Pranav",
+ "Pravin",
+ "Precious",
+ "Prentice",
+ "Presley",
+ "Preston",
+ "Preston-Jay",
+ "Prinay",
+ "Prince",
+ "Prithvi",
+ "Promise",
+ "Puneetpaul",
+ "Pushkar",
+ "Qasim",
+ "Qirui",
+ "Quinlan",
+ "Quinn",
+ "Radmiras",
+ "Raees",
+ "Raegan",
+ "Rafael",
+ "Rafal",
+ "Rafferty",
+ "Rafi",
+ "Raheem",
+ "Rahil",
+ "Rahim",
+ "Rahman",
+ "Raith",
+ "Raithin",
+ "Raja",
+ "Rajab-Ali",
+ "Rajan",
+ "Ralfs",
+ "Ralph",
+ "Ramanas",
+ "Ramit",
+ "Ramone",
+ "Ramsay",
+ "Ramsey",
+ "Rana",
+ "Ranolph",
+ "Raphael",
+ "Rasmus",
+ "Rasul",
+ "Raul",
+ "Raunaq",
+ "Ravin",
+ "Ray",
+ "Rayaan",
+ "Rayan",
+ "Rayane",
+ "Rayden",
+ "Rayhan",
+ "Raymond",
+ "Rayne",
+ "Rayyan",
+ "Raza",
+ "Reace",
+ "Reagan",
+ "Reean",
+ "Reece",
+ "Reed",
+ "Reegan",
+ "Rees",
+ "Reese",
+ "Reeve",
+ "Regan",
+ "Regean",
+ "Reggie",
+ "Rehaan",
+ "Rehan",
+ "Reice",
+ "Reid",
+ "Reigan",
+ "Reilly",
+ "Reily",
+ "Reis",
+ "Reiss",
+ "Remigiusz",
+ "Remo",
+ "Remy",
+ "Ren",
+ "Renars",
+ "Reng",
+ "Rennie",
+ "Reno",
+ "Reo",
+ "Reuben",
+ "Rexford",
+ "Reynold",
+ "Rhein",
+ "Rheo",
+ "Rhett",
+ "Rheyden",
+ "Rhian",
+ "Rhoan",
+ "Rholmark",
+ "Rhoridh",
+ "Rhuairidh",
+ "Rhuan",
+ "Rhuaridh",
+ "Rhudi",
+ "Rhy",
+ "Rhyan",
+ "Rhyley",
+ "Rhyon",
+ "Rhys",
+ "Rhys-Bernard",
+ "Rhyse",
+ "Riach",
+ "Rian",
+ "Ricards",
+ "Riccardo",
+ "Ricco",
+ "Rice",
+ "Richard",
+ "Richey",
+ "Richie",
+ "Ricky",
+ "Rico",
+ "Ridley",
+ "Ridwan",
+ "Rihab",
+ "Rihan",
+ "Rihards",
+ "Rihonn",
+ "Rikki",
+ "Riley",
+ "Rio",
+ "Rioden",
+ "Rishi",
+ "Ritchie",
+ "Rivan",
+ "Riyadh",
+ "Riyaj",
+ "Roan",
+ "Roark",
+ "Roary",
+ "Rob",
+ "Robbi",
+ "Robbie",
+ "Robbie-lee",
+ "Robby",
+ "Robert",
+ "Robert-Gordon",
+ "Robertjohn",
+ "Robi",
+ "Robin",
+ "Rocco",
+ "Roddy",
+ "Roderick",
+ "Rodrigo",
+ "Roen",
+ "Rogan",
+ "Roger",
+ "Rohaan",
+ "Rohan",
+ "Rohin",
+ "Rohit",
+ "Rokas",
+ "Roman",
+ "Ronald",
+ "Ronan",
+ "Ronan-Benedict",
+ "Ronin",
+ "Ronnie",
+ "Rooke",
+ "Roray",
+ "Rori",
+ "Rorie",
+ "Rory",
+ "Roshan",
+ "Ross",
+ "Ross-Andrew",
+ "Rossi",
+ "Rowan",
+ "Rowen",
+ "Roy",
+ "Ruadhan",
+ "Ruaidhri",
+ "Ruairi",
+ "Ruairidh",
+ "Ruan",
+ "Ruaraidh",
+ "Ruari",
+ "Ruaridh",
+ "Ruben",
+ "Rubhan",
+ "Rubin",
+ "Rubyn",
+ "Rudi",
+ "Rudy",
+ "Rufus",
+ "Rui",
+ "Ruo",
+ "Rupert",
+ "Ruslan",
+ "Russel",
+ "Russell",
+ "Ryaan",
+ "Ryan",
+ "Ryan-Lee",
+ "Ryden",
+ "Ryder",
+ "Ryese",
+ "Ryhs",
+ "Rylan",
+ "Rylay",
+ "Rylee",
+ "Ryleigh",
+ "Ryley",
+ "Rylie",
+ "Ryo",
+ "Ryszard",
+ "Saad",
+ "Sabeen",
+ "Sachkirat",
+ "Saffi",
+ "Saghun",
+ "Sahaib",
+ "Sahbian",
+ "Sahil",
+ "Saif",
+ "Saifaddine",
+ "Saim",
+ "Sajid",
+ "Sajjad",
+ "Salahudin",
+ "Salman",
+ "Salter",
+ "Salvador",
+ "Sam",
+ "Saman",
+ "Samar",
+ "Samarjit",
+ "Samatar",
+ "Sambrid",
+ "Sameer",
+ "Sami",
+ "Samir",
+ "Sami-Ullah",
+ "Samual",
+ "Samuel",
+ "Samuela",
+ "Samy",
+ "Sanaullah",
+ "Sandro",
+ "Sandy",
+ "Sanfur",
+ "Sanjay",
+ "Santiago",
+ "Santino",
+ "Satveer",
+ "Saul",
+ "Saunders",
+ "Savin",
+ "Sayad",
+ "Sayeed",
+ "Sayf",
+ "Scot",
+ "Scott",
+ "Scott-Alexander",
+ "Seaan",
+ "Seamas",
+ "Seamus",
+ "Sean",
+ "Seane",
+ "Sean-James",
+ "Sean-Paul",
+ "Sean-Ray",
+ "Seb",
+ "Sebastian",
+ "Sebastien",
+ "Selasi",
+ "Seonaidh",
+ "Sephiroth",
+ "Sergei",
+ "Sergio",
+ "Seth",
+ "Sethu",
+ "Seumas",
+ "Shaarvin",
+ "Shadow",
+ "Shae",
+ "Shahmir",
+ "Shai",
+ "Shane",
+ "Shannon",
+ "Sharland",
+ "Sharoz",
+ "Shaughn",
+ "Shaun",
+ "Shaunpaul",
+ "Shaun-Paul",
+ "Shaun-Thomas",
+ "Shaurya",
+ "Shaw",
+ "Shawn",
+ "Shawnpaul",
+ "Shay",
+ "Shayaan",
+ "Shayan",
+ "Shaye",
+ "Shayne",
+ "Shazil",
+ "Shea",
+ "Sheafan",
+ "Sheigh",
+ "Shenuk",
+ "Sher",
+ "Shergo",
+ "Sheriff",
+ "Sherwyn",
+ "Shiloh",
+ "Shiraz",
+ "Shreeram",
+ "Shreyas",
+ "Shyam",
+ "Siddhant",
+ "Siddharth",
+ "Sidharth",
+ "Sidney",
+ "Siergiej",
+ "Silas",
+ "Simon",
+ "Sinai",
+ "Skye",
+ "Sofian",
+ "Sohaib",
+ "Sohail",
+ "Soham",
+ "Sohan",
+ "Sol",
+ "Solomon",
+ "Sonneey",
+ "Sonni",
+ "Sonny",
+ "Sorley",
+ "Soul",
+ "Spencer",
+ "Spondon",
+ "Stanislaw",
+ "Stanley",
+ "Stefan",
+ "Stefano",
+ "Stefin",
+ "Stephen",
+ "Stephenjunior",
+ "Steve",
+ "Steven",
+ "Steven-lee",
+ "Stevie",
+ "Stewart",
+ "Stewarty",
+ "Strachan",
+ "Struan",
+ "Stuart",
+ "Su",
+ "Subhaan",
+ "Sudais",
+ "Suheyb",
+ "Suilven",
+ "Sukhi",
+ "Sukhpal",
+ "Sukhvir",
+ "Sulayman",
+ "Sullivan",
+ "Sultan",
+ "Sung",
+ "Sunny",
+ "Suraj",
+ "Surien",
+ "Sweyn",
+ "Syed",
+ "Sylvain",
+ "Symon",
+ "Szymon",
+ "Tadd",
+ "Taddy",
+ "Tadhg",
+ "Taegan",
+ "Taegen",
+ "Tai",
+ "Tait",
+ "Taiwo",
+ "Talha",
+ "Taliesin",
+ "Talon",
+ "Talorcan",
+ "Tamar",
+ "Tamiem",
+ "Tammam",
+ "Tanay",
+ "Tane",
+ "Tanner",
+ "Tanvir",
+ "Tanzeel",
+ "Taonga",
+ "Tarik",
+ "Tariq-Jay",
+ "Tate",
+ "Taylan",
+ "Taylar",
+ "Tayler",
+ "Taylor",
+ "Taylor-Jay",
+ "Taylor-Lee",
+ "Tayo",
+ "Tayyab",
+ "Tayye",
+ "Tayyib",
+ "Teagan",
+ "Tee",
+ "Teejay",
+ "Tee-jay",
+ "Tegan",
+ "Teighen",
+ "Teiyib",
+ "Te-Jay",
+ "Temba",
+ "Teo",
+ "Teodor",
+ "Teos",
+ "Terry",
+ "Teydren",
+ "Theo",
+ "Theodore",
+ "Thiago",
+ "Thierry",
+ "Thom",
+ "Thomas",
+ "Thomas-Jay",
+ "Thomson",
+ "Thorben",
+ "Thorfinn",
+ "Thrinei",
+ "Thumbiko",
+ "Tiago",
+ "Tian",
+ "Tiarnan",
+ "Tibet",
+ "Tieran",
+ "Tiernan",
+ "Timothy",
+ "Timucin",
+ "Tiree",
+ "Tisloh",
+ "Titi",
+ "Titus",
+ "Tiylar",
+ "TJ",
+ "Tjay",
+ "T'jay",
+ "T-Jay",
+ "Tobey",
+ "Tobi",
+ "Tobias",
+ "Tobie",
+ "Toby",
+ "Todd",
+ "Tokinaga",
+ "Toluwalase",
+ "Tom",
+ "Tomas",
+ "Tomasz",
+ "Tommi-Lee",
+ "Tommy",
+ "Tomson",
+ "Tony",
+ "Torin",
+ "Torquil",
+ "Torran",
+ "Torrin",
+ "Torsten",
+ "Trafford",
+ "Trai",
+ "Travis",
+ "Tre",
+ "Trent",
+ "Trey",
+ "Tristain",
+ "Tristan",
+ "Troy",
+ "Tubagus",
+ "Turki",
+ "Turner",
+ "Ty",
+ "Ty-Alexander",
+ "Tye",
+ "Tyelor",
+ "Tylar",
+ "Tyler",
+ "Tyler-James",
+ "Tyler-Jay",
+ "Tyllor",
+ "Tylor",
+ "Tymom",
+ "Tymon",
+ "Tymoteusz",
+ "Tyra",
+ "Tyree",
+ "Tyrnan",
+ "Tyrone",
+ "Tyson",
+ "Ubaid",
+ "Ubayd",
+ "Uchenna",
+ "Uilleam",
+ "Umair",
+ "Umar",
+ "Umer",
+ "Umut",
+ "Urban",
+ "Uri",
+ "Usman",
+ "Uzair",
+ "Uzayr",
+ "Valen",
+ "Valentin",
+ "Valentino",
+ "Valery",
+ "Valo",
+ "Vasyl",
+ "Vedantsinh",
+ "Veeran",
+ "Victor",
+ "Victory",
+ "Vinay",
+ "Vince",
+ "Vincent",
+ "Vincenzo",
+ "Vinh",
+ "Vinnie",
+ "Vithujan",
+ "Vladimir",
+ "Vladislav",
+ "Vrishin",
+ "Vuyolwethu",
+ "Wabuya",
+ "Wai",
+ "Walid",
+ "Wallace",
+ "Walter",
+ "Waqaas",
+ "Warkhas",
+ "Warren",
+ "Warrick",
+ "Wasif",
+ "Wayde",
+ "Wayne",
+ "Wei",
+ "Wen",
+ "Wesley",
+ "Wesley-Scott",
+ "Wiktor",
+ "Wilkie",
+ "Will",
+ "William",
+ "William-John",
+ "Willum",
+ "Wilson",
+ "Windsor",
+ "Wojciech",
+ "Woyenbrakemi",
+ "Wyatt",
+ "Wylie",
+ "Wynn",
+ "Xabier",
+ "Xander",
+ "Xavier",
+ "Xiao",
+ "Xida",
+ "Xin",
+ "Xue",
+ "Yadgor",
+ "Yago",
+ "Yahya",
+ "Yakup",
+ "Yang",
+ "Yanick",
+ "Yann",
+ "Yannick",
+ "Yaseen",
+ "Yasin",
+ "Yasir",
+ "Yassin",
+ "Yoji",
+ "Yong",
+ "Yoolgeun",
+ "Yorgos",
+ "Youcef",
+ "Yousif",
+ "Youssef",
+ "Yu",
+ "Yuanyu",
+ "Yuri",
+ "Yusef",
+ "Yusuf",
+ "Yves",
+ "Zaaine",
+ "Zaak",
+ "Zac",
+ "Zach",
+ "Zachariah",
+ "Zacharias",
+ "Zacharie",
+ "Zacharius",
+ "Zachariya",
+ "Zachary",
+ "Zachary-Marc",
+ "Zachery",
+ "Zack",
+ "Zackary",
+ "Zaid",
+ "Zain",
+ "Zaine",
+ "Zaineddine",
+ "Zainedin",
+ "Zak",
+ "Zakaria",
+ "Zakariya",
+ "Zakary",
+ "Zaki",
+ "Zakir",
+ "Zakk",
+ "Zamaar",
+ "Zander",
+ "Zane",
+ "Zarran",
+ "Zayd",
+ "Zayn",
+ "Zayne",
+ "Ze",
+ "Zechariah",
+ "Zeek",
+ "Zeeshan",
+ "Zeid",
+ "Zein",
+ "Zen",
+ "Zendel",
+ "Zenith",
+ "Zennon",
+ "Zeph",
+ "Zerah",
+ "Zhen",
+ "Zhi",
+ "Zhong",
+ "Zhuo",
+ "Zi",
+ "Zidane",
+ "Zijie",
+ "Zinedine",
+ "Zion",
+ "Zishan",
+ "Ziya",
+ "Ziyaan",
+ "Zohaib",
+ "Zohair",
+ "Zoubaeir",
+ "Zubair",
+ "Zubayr",
+ "Zuriel",
+ "Jaime",
+ "Jayden",
+ "Josie",
+ "Juliet",
+ "Karys",
+ "Kathleen",
+ "Kendra",
+ "Keri",
+ "Keris",
+ "Kirstin",
+ "Klaudia",
+ "Luisa",
+ "Lydia",
+ "Maeve",
+ "Marnie",
+ "Miah",
+ "Mirrin",
+ "Nancy",
+ "Nia",
+ "Nikki",
+ "Oliwia",
+ "Paris",
+ "Piper",
+ "Pippa",
+ "Polly",
+ "Rhona",
+ "Safa",
+ "Saira",
+ "Sarah-Louise",
+ "Shona",
+ "Sorcha",
+ "Stacey",
+ "Tessa",
+ "Tiffany",
+ "Verity",
+ "Zarah",
+ "Zoya",
+ "Alexandria",
+ "Alina",
+ "Alison",
+ "Angela",
+ "Arianna",
+ "Chanel",
+ "Chelsey",
+ "Coral",
+ "Corinne",
+ "Danni",
+ "Darci",
+ "Dionne",
+ "Eliza",
+ "Elsie",
+ "Fatima",
+ "Freyja",
+ "Holli",
+ "Jane",
+ "Joanne",
+ "Karina",
+ "Katrina",
+ "Kaylah",
+ "Kaylee",
+ "Lori",
+ "Mila",
+ "Nikita",
+ "Penny",
+ "Sylvie",
+ "Tammy",
+ "Alexa",
+ "Brooklyn",
+ "Caragh",
+ "Codie",
+ "Constance",
+ "Dana",
+ "Demi-Lee",
+ "Emilie",
+ "Esther",
+ "Frankie",
+ "Isabelle",
+ "Jamie-Leigh",
+ "Jessie",
+ "Josephine",
+ "Kady",
+ "Kaila",
+ "Kerri",
+ "Kirstie",
+ "Lyla",
+ "Macey",
+ "Maisy",
+ "Margaret",
+ "Marie",
+ "Maryam",
+ "Mercedes",
+ "Mischa",
+ "Rosa",
+ "Serena",
+ "Sian",
+ "Tamzin",
+ "Vanessa",
+ "Violet",
+ "Yasmine",
+ "Aisha",
+ "Aleisha",
+ "Ana",
+ "Daniella",
+ "Elsa",
+ "Jodi",
+ "Karly",
+ "Leigha",
+ "Lila",
+ "Melanie",
+ "Miriam",
+ "Regan",
+ "Sally",
+ "Saskia",
+ "Simone",
+ "Tess",
+ "Thea",
+ "Zainab",
+ "Arwen",
+ "Bonnie",
+ "Eloise",
+ "Emma-Louise",
+ "Halle",
+ "Hana",
+ "Honey",
+ "Jamie-Lee",
+ "Karla",
+ "Leia",
+ "Leila",
+ "Madeline",
+ "Neave",
+ "Orlaith",
+ "Rhea",
+ "Sarah-Jane",
+ "Tara",
+ "Adele",
+ "Alannah",
+ "Alesha",
+ "Annabelle",
+ "Ayla",
+ "Becca",
+ "Darcie",
+ "Ebony",
+ "Erica",
+ "Georgie",
+ "Hanna",
+ "Julie",
+ "Kadie",
+ "Kelly",
+ "Kiara",
+ "Lillie",
+ "Mariam",
+ "Mikayla",
+ "Monica",
+ "Roisin",
+ "Savannah",
+ "Sky",
+ "Zahra",
+ "Alanna",
+ "Caoimhe",
+ "Chanelle",
+ "Elisha",
+ "Emilia",
+ "Iris",
+ "Kacie",
+ "Lia",
+ "Maja",
+ "Mary",
+ "Michelle",
+ "Tyler",
+ "Willow",
+ "Yasmin",
+ "Becky",
+ "Billie",
+ "Clara",
+ "Claudia",
+ "Cody",
+ "Elena",
+ "Eryn",
+ "Georgina",
+ "Kayley",
+ "Kimberley",
+ "Kira",
+ "Laila",
+ "Lauryn",
+ "Murron",
+ "Natalia",
+ "Ruth",
+ "Siobhan",
+ "Tiana",
+ "Bethan",
+ "Brodie",
+ "Cameron",
+ "Cassie",
+ "Harriet",
+ "Helen",
+ "Kathryn",
+ "Kyra",
+ "Mairi",
+ "Mckenzie",
+ "Tilly",
+ "Zuzanna",
+ "April",
+ "Christina",
+ "Claire",
+ "Darcey",
+ "Fern",
+ "Fiona",
+ "Joanna",
+ "Lucia",
+ "Charli",
+ "Jamie",
+ "Karis",
+ "Mackenzie",
+ "Marissa",
+ "Rihanna",
+ "Teagan",
+ "Tiegan",
+ "Kaitlin",
+ "Keeley",
+ "Leigh",
+ "Nadia",
+ "Alix",
+ "Callie",
+ "Carrie",
+ "Eden",
+ "Esme",
+ "Hazel",
+ "Miya",
+ "Nieve",
+ "Sadie",
+ "Sasha",
+ "Sinead",
+ "Stella",
+ "Ashleigh",
+ "Jade",
+ "Jemma",
+ "Michaela",
+ "Alexis",
+ "Aoife",
+ "Francesca",
+ "Lisa",
+ "Matilda",
+ "Annabel",
+ "Carmen",
+ "Eleanor",
+ "Faye",
+ "Kaci",
+ "Kasey",
+ "Kerry",
+ "Louisa",
+ "Macy",
+ "Mhairi",
+ "Rebekah",
+ "Teigan",
+ "Amie",
+ "Brogan",
+ "Catriona",
+ "Scarlett",
+ "Connie",
+ "Katelyn",
+ "Kenzie",
+ "Lexi",
+ "Nicola",
+ "Sienna",
+ "Abbi",
+ "Angel",
+ "Martha",
+ "Anya",
+ "Toni",
+ "Chantelle",
+ "Gabriella",
+ "Lexie",
+ "Abbey",
+ "Bailey",
+ "Isobel",
+ "Kelsie",
+ "Maia",
+ "Nina",
+ "Darcy",
+ "Lacey",
+ "Lana",
+ "Sofia",
+ "Stephanie",
+ "Ellen",
+ "Alicia",
+ "Gabrielle",
+ "Heidi",
+ "Jorja",
+ "Kyla",
+ "Rhiannon",
+ "Tegan",
+ "Maddison",
+ "Madeleine",
+ "Morven",
+ "Rowan",
+ "Lucie",
+ "Milly",
+ "Annie",
+ "Ashley",
+ "Ellis",
+ "Hope",
+ "Mirren",
+ "Rose",
+ "Alexandra",
+ "Jodie",
+ "Kacey",
+ "Phoebe",
+ "Tia",
+ "Ailsa",
+ "Alana",
+ "Kirsten",
+ "Charlie",
+ "Katy",
+ "Lilly",
+ "Alyssa",
+ "Maria",
+ "Naomi",
+ "Alisha",
+ "Danielle",
+ "Lola",
+ "Ciara",
+ "Elle",
+ "Faith",
+ "Natasha",
+ "Katherine",
+ "Lois",
+ "Mollie",
+ "Carla",
+ "Catherine",
+ "Cerys",
+ "Maisie",
+ "Victoria",
+ "Amelie",
+ "Demi",
+ "Gracie",
+ "Carys",
+ "Isabella",
+ "Leona",
+ "Alex",
+ "Hollie",
+ "Sara",
+ "Caitlyn",
+ "Kiera",
+ "Lara",
+ "Kate",
+ "Louise",
+ "Libby",
+ "Rhianna",
+ "Rosie",
+ "Alice",
+ "Julia",
+ "Maya",
+ "Natalie",
+ "Chelsea",
+ "Layla",
+ "Samantha",
+ "Heather",
+ "Kirsty",
+ "Rachael",
+ "Charley",
+ "Imogen",
+ "Elise",
+ "Hayley",
+ "Kelsey",
+ "Kara",
+ "Orla",
+ "Abi",
+ "Gemma",
+ "Laura",
+ "Mya",
+ "Bethany",
+ "Jasmine",
+ "Melissa",
+ "Poppy",
+ "Casey",
+ "Elizabeth",
+ "Kaitlyn",
+ "Carly",
+ "Abby",
+ "Neve",
+ "Courtney",
+ "Jennifer",
+ "Sophia",
+ "Shannon",
+ "Georgia",
+ "Amber",
+ "Robyn",
+ "Beth",
+ "Zara",
+ "Amelia",
+ "Taylor",
+ "Daisy",
+ "Paige",
+ "Kayleigh",
+ "Summer",
+ "Madison",
+ "Jenna",
+ "Morgan",
+ "Evie",
+ "Nicole",
+ "Ella",
+ "Cara",
+ "Iona",
+ "Eve",
+ "Zoe",
+ "Kayla",
+ "Molly",
+ "Abigail",
+ "Charlotte",
+ "Millie",
+ "Holly",
+ "Leah",
+ "Keira",
+ "Lily",
+ "Freya",
+ "Caitlin",
+ "Lauren",
+ "Rachel",
+ "Anna",
+ "Sarah",
+ "Ruby",
+ "Aimee",
+ "Mia",
+ "Skye",
+ "Abbie",
+ "Eva",
+ "Eilidh",
+ "Niamh",
+ "Megan",
+ "Brooke",
+ "Isla",
+ "Rebecca",
+ "Ava",
+ "Grace",
+ "Jessica",
+ "Hannah",
+ "Olivia",
+ "Chloe",
+ "Emily",
+ "Amy",
+ "Ellie",
+ "Erin",
+ "Katie",
+ "Lucy",
+ "Emma",
+ "Sophie"
+ };
+ }
- private static final String[] generateScottishFirstNames() {
- return new String[] { "Aadam", "Aadit", "Aahron", "Aaran", "Aaren",
- "Aarez", "Aarman", "Aaron", "Aaron-James", "Aarron", "Aaryan", "Aaryn", "Aayan", "Aazaan", "Abaan", "Abbas",
- "Abdallah", "Abdalroof", "Abdihakim", "Abdirahman", "Abdisalam", "Abdul", "Abdul-Aziz", "Abdulbasir",
- "Abdulkadir", "Abdulkarem", "Abdulkhader", "Abdullah", "Abdul-Majeed", "Abdulmalik", "Abdul-Rehman",
- "Abdur", "Abdurraheem", "Abdur-Rahman", "Abdur-Rehmaan", "Abel", "Abhinav", "Abhisumant", "Abid", "Abir",
- "Abraham", "Abu", "Abubakar", "Ace", "Adain", "Adam", "Adam-James", "Addison", "Addisson", "Adegbola",
- "Adegbolahan", "Aden", "Adenn", "Adie", "Adil", "Aditya", "Adnan", "Adrian", "Adrien", "Aedan", "Aedin",
- "Aedyn", "Aeron", "Afonso", "Ahmad", "Ahmed", "Ahmed-Aziz", "Ahoua", "Ahtasham", "Aiadan", "Aidan", "Aiden",
- "Aiden-Jack", "Aiden-Vee", "Aidian", "Aidy", "Ailin", "Aiman", "Ainsley", "Ainslie", "Airen", "Airidas",
- "Airlie", "AJ", "Ajay", "A-Jay", "Ajayraj", "Akan", "Akram", "Al", "Ala'", "Alan", "Alanas", "Alasdair",
- "Alastair", "Alber", "Albert", "Albie", "Aldred", "Alec", "Aled", "Aleem", "Aleksandar", "Aleksander",
- "Aleksandr", "Aleksandrs", "Alekzander", "Alessandro", "Alessio", "Alex", "Alexander", "Alexei", "Alexx",
- "Alexzander", "Alf", "Alfee", "Alfie", "Alfred", "Alfy", "Alhaji", "Al-Hassan", "Ali", "Aliekber", "Alieu",
- "Alihaider", "Alisdair", "Alishan", "Alistair", "Alistar", "Alister", "Aliyaan", "Allan", "Allan-Laiton",
- "Allen", "Allesandro", "Allister", "Ally", "Alphonse", "Altyiab", "Alum", "Alvern", "Alvin", "Alyas",
- "Amaan", "Aman", "Amani", "Ambanimoh", "Ameer", "Amgad", "Ami", "Amin", "Amir", "Ammaar", "Ammar", "Ammer",
- "Amolpreet", "Amos", "Amrinder", "Amrit", "Amro", "Anay", "Andrea", "Andreas", "Andrei", "Andrejs",
- "Andrew", "Andy", "Anees", "Anesu", "Angel", "Angelo", "Angus", "Anir", "Anis", "Anish", "Anmolpreet",
- "Annan", "Anndra", "Anselm", "Anthony", "Anthony-John", "Antoine", "Anton", "Antoni", "Antonio", "Antony",
- "Antonyo", "Anubhav", "Aodhan", "Aon", "Aonghus", "Apisai", "Arafat", "Aran", "Arandeep", "Arann", "Aray",
- "Arayan", "Archibald", "Archie", "Arda", "Ardal", "Ardeshir", "Areeb", "Areez", "Aref", "Arfin", "Argyle",
- "Argyll", "Ari", "Aria", "Arian", "Arihant", "Aristomenis", "Aristotelis", "Arjuna", "Arlo", "Armaan",
- "Arman", "Armen", "Arnab", "Arnav", "Arnold", "Aron", "Aronas", "Arran", "Arrham", "Arron", "Arryn",
- "Arsalan", "Artem", "Arthur", "Artur", "Arturo", "Arun", "Arunas", "Arved", "Arya", "Aryan", "Aryankhan",
- "Aryian", "Aryn", "Asa", "Asfhan", "Ash", "Ashlee-jay", "Ashley", "Ashton", "Ashton-Lloyd", "Ashtyn",
- "Ashwin", "Asif", "Asim", "Aslam", "Asrar", "Ata", "Atal", "Atapattu", "Ateeq", "Athol", "Athon",
- "Athos-Carlos", "Atli", "Atom", "Attila", "Aulay", "Aun", "Austen", "Austin", "Avani", "Averon", "Avi",
- "Avinash", "Avraham", "Awais", "Awwal", "Axel", "Ayaan", "Ayan", "Aydan", "Ayden", "Aydin", "Aydon",
- "Ayman", "Ayomide", "Ayren", "Ayrton", "Aytug", "Ayub", "Ayyub", "Azaan", "Azedine", "Azeem", "Azim",
- "Aziz", "Azlan", "Azzam", "Azzedine", "Babatunmise", "Babur", "Bader", "Badr", "Badsha", "Bailee", "Bailey",
- "Bailie", "Bailley", "Baillie", "Baley", "Balian", "Banan", "Barath", "Barkley", "Barney", "Baron",
- "Barrie", "Barry", "Bartlomiej", "Bartosz", "Basher", "Basile", "Baxter", "Baye", "Bayley", "Beau", "Beinn",
- "Bekim", "Believe", "Ben", "Bendeguz", "Benedict", "Benjamin", "Benjamyn", "Benji", "Benn", "Bennett",
- "Benny", "Benoit", "Bentley", "Berkay", "Bernard", "Bertie", "Bevin", "Bezalel", "Bhaaldeen", "Bharath",
- "Bilal", "Bill", "Billy", "Binod", "Bjorn", "Blaike", "Blaine", "Blair", "Blaire", "Blake", "Blazej",
- "Blazey", "Blessing", "Blue", "Blyth", "Bo", "Boab", "Bob", "Bobby", "Bobby-Lee", "Bodhan", "Boedyn",
- "Bogdan", "Bohbi", "Bony", "Bowen", "Bowie", "Boyd", "Bracken", "Brad", "Bradan", "Braden", "Bradley",
- "Bradlie", "Bradly", "Brady", "Bradyn", "Braeden", "Braiden", "Brajan", "Brandan", "Branden", "Brandon",
- "Brandonlee", "Brandon-Lee", "Brandyn", "Brannan", "Brayden", "Braydon", "Braydyn", "Breandan", "Brehme",
- "Brendan", "Brendon", "Brendyn", "Breogan", "Bret", "Brett", "Briaddon", "Brian", "Brodi", "Brodie",
- "Brody", "Brogan", "Broghan", "Brooke", "Brooklin", "Brooklyn", "Bruce", "Bruin", "Bruno", "Brunon",
- "Bryan", "Bryce", "Bryden", "Brydon", "Brydon-Craig", "Bryn", "Brynmor", "Bryson", "Buddy", "Bully",
- "Burak", "Burhan", "Butali", "Butchi", "Byron", "Cabhan", "Cadan", "Cade", "Caden", "Cadon", "Cadyn",
- "Caedan", "Caedyn", "Cael", "Caelan", "Caelen", "Caethan", "Cahl", "Cahlum", "Cai", "Caidan", "Caiden",
- "Caiden-Paul", "Caidyn", "Caie", "Cailaen", "Cailean", "Caileb-John", "Cailin", "Cain", "Caine", "Cairn",
- "Cal", "Calan", "Calder", "Cale", "Calean", "Caleb", "Calen", "Caley", "Calib", "Calin", "Callahan",
- "Callan", "Callan-Adam", "Calley", "Callie", "Callin", "Callum", "Callun", "Callyn", "Calum", "Calum-James",
- "Calvin", "Cambell", "Camerin", "Cameron", "Campbel", "Campbell", "Camron", "Caolain", "Caolan", "Carl",
- "Carlo", "Carlos", "Carrich", "Carrick", "Carson", "Carter", "Carwyn", "Casey", "Casper", "Cassy", "Cathal",
- "Cator", "Cavan", "Cayden", "Cayden-Robert", "Cayden-Tiamo", "Ceejay", "Ceilan", "Ceiran", "Ceirin",
- "Ceiron", "Cejay", "Celik", "Cephas", "Cesar", "Cesare", "Chad", "Chaitanya", "Chang-Ha", "Charles",
- "Charley", "Charlie", "Charly", "Chase", "Che", "Chester", "Chevy", "Chi", "Chibudom", "Chidera", "Chimsom",
- "Chin", "Chintu", "Chiqal", "Chiron", "Chris", "Chris-Daniel", "Chrismedi", "Christian", "Christie",
- "Christoph", "Christopher", "Christopher-Lee", "Christy", "Chu", "Chukwuemeka", "Cian", "Ciann", "Ciar",
- "Ciaran", "Ciarian", "Cieran", "Cillian", "Cillin", "Cinar", "CJ", "C-Jay", "Clark", "Clarke", "Clayton",
- "Clement", "Clifford", "Clyde", "Cobain", "Coban", "Coben", "Cobi", "Cobie", "Coby", "Codey", "Codi",
- "Codie", "Cody", "Cody-Lee", "Coel", "Cohan", "Cohen", "Colby", "Cole", "Colin", "Coll", "Colm", "Colt",
- "Colton", "Colum", "Colvin", "Comghan", "Conal", "Conall", "Conan", "Conar", "Conghaile", "Conlan",
- "Conley", "Conli", "Conlin", "Conlly", "Conlon", "Conlyn", "Connal", "Connall", "Connan", "Connar",
- "Connel", "Connell", "Conner", "Connolly", "Connor", "Connor-David", "Conor", "Conrad", "Cooper",
- "Copeland", "Coray", "Corben", "Corbin", "Corey", "Corey-James", "Corey-Jay", "Cori", "Corie", "Corin",
- "Cormac", "Cormack", "Cormak", "Corran", "Corrie", "Cory", "Cosmo", "Coupar", "Craig", "Craig-James",
- "Crawford", "Creag", "Crispin", "Cristian", "Crombie", "Cruiz", "Cruz", "Cuillin", "Cullen", "Cullin",
- "Curtis", "Cyrus", "Daanyaal", "Daegan", "Daegyu", "Dafydd", "Dagon", "Dailey", "Daimhin", "Daithi",
- "Dakota", "Daksh", "Dale", "Dalong", "Dalton", "Damian", "Damien", "Damon", "Dan", "Danar", "Dane",
- "Danial", "Daniel", "Daniele", "Daniel-James", "Daniels", "Daniil", "Danish", "Daniyal", "Danniel", "Danny",
- "Dante", "Danyal", "Danyil", "Danys", "Daood", "Dara", "Darach", "Daragh", "Darcy", "D'arcy", "Dareh",
- "Daren", "Darien", "Darius", "Darl", "Darn", "Darrach", "Darragh", "Darrel", "Darrell", "Darren", "Darrie",
- "Darrius", "Darroch", "Darryl", "Darryn", "Darwyn", "Daryl", "Daryn", "Daud", "Daumantas", "Davi", "David",
- "David-Jay", "David-Lee", "Davie", "Davis", "Davy", "Dawid", "Dawson", "Dawud", "Dayem", "Daymian",
- "Deacon", "Deagan", "Dean", "Deano", "Decklan", "Declain", "Declan", "Declyan", "Declyn", "Dedeniseoluwa",
- "Deecan", "Deegan", "Deelan", "Deklain-Jaimes", "Del", "Demetrius", "Denis", "Deniss", "Dennan", "Dennin",
- "Dennis", "Denny", "Dennys", "Denon", "Denton", "Denver", "Denzel", "Deon", "Derek", "Derick", "Derin",
- "Dermot", "Derren", "Derrie", "Derrin", "Derron", "Derry", "Derryn", "Deryn", "Deshawn", "Desmond", "Dev",
- "Devan", "Devin", "Devlin", "Devlyn", "Devon", "Devrin", "Devyn", "Dex", "Dexter", "Dhani", "Dharam",
- "Dhavid", "Dhyia", "Diarmaid", "Diarmid", "Diarmuid", "Didier", "Diego", "Diesel", "Diesil", "Digby",
- "Dilan", "Dilano", "Dillan", "Dillon", "Dilraj", "Dimitri", "Dinaras", "Dion", "Dissanayake", "Dmitri",
- "Doire", "Dolan", "Domanic", "Domenico", "Domhnall", "Dominic", "Dominick", "Dominik", "Donald", "Donnacha",
- "Donnie", "Dorian", "Dougal", "Douglas", "Dougray", "Drakeo", "Dre", "Dregan", "Drew", "Dugald", "Duncan",
- "Duriel", "Dustin", "Dylan", "Dylan-Jack", "Dylan-James", "Dylan-John", "Dylan-Patrick", "Dylin", "Dyllan",
- "Dyllan-James", "Dyllon", "Eadie", "Eagann", "Eamon", "Eamonn", "Eason", "Eassan", "Easton", "Ebow", "Ed",
- "Eddie", "Eden", "Ediomi", "Edison", "Eduardo", "Eduards", "Edward", "Edwin", "Edwyn", "Eesa", "Efan",
- "Efe", "Ege", "Ehsan", "Ehsen", "Eiddon", "Eidhan", "Eihli", "Eimantas", "Eisa", "Eli", "Elias", "Elijah",
- "Eliot", "Elisau", "Eljay", "Eljon", "Elliot", "Elliott", "Ellis", "Ellisandro", "Elshan", "Elvin", "Elyan",
- "Emanuel", "Emerson", "Emil", "Emile", "Emir", "Emlyn", "Emmanuel", "Emmet", "Eng", "Eniola", "Enis",
- "Ennis", "Enrico", "Enrique", "Enzo", "Eoghain", "Eoghan", "Eoin", "Eonan", "Erdehan", "Eren", "Erencem",
- "Eric", "Ericlee", "Erik", "Eriz", "Ernie-Jacks", "Eroni", "Eryk", "Eshan", "Essa", "Esteban", "Ethan",
- "Etienne", "Etinosa", "Euan", "Eugene", "Evan", "Evann", "Ewan", "Ewen", "Ewing", "Exodi", "Ezekiel",
- "Ezra", "Fabian", "Fahad", "Faheem", "Faisal", "Faizaan", "Famara", "Fares", "Farhaan", "Farhan", "Farren",
- "Farzad", "Fauzaan", "Favour", "Fawaz", "Fawkes", "Faysal", "Fearghus", "Feden", "Felix", "Fergal",
- "Fergie", "Fergus", "Ferre", "Fezaan", "Fiachra", "Fikret", "Filip", "Filippo", "Finan", "Findlay",
- "Findlay-James", "Findlie", "Finlay", "Finley", "Finn", "Finnan", "Finnean", "Finnen", "Finnlay", "Finnley",
- "Fintan", "Fionn", "Firaaz", "Fletcher", "Flint", "Florin", "Flyn", "Flynn", "Fodeba", "Folarinwa",
- "Forbes", "Forgan", "Forrest", "Fox", "Francesco", "Francis", "Francisco", "Franciszek", "Franco", "Frank",
- "Frankie", "Franklin", "Franko", "Fraser", "Frazer", "Fred", "Freddie", "Frederick", "Fruin", "Fyfe", "Fyn",
- "Fynlay", "Fynn", "Gabriel", "Gallagher", "Gareth", "Garren", "Garrett", "Garry", "Gary", "Gavin",
- "Gavin-Lee", "Gene", "Geoff", "Geoffrey", "Geomer", "Geordan", "Geordie", "George", "Georgia", "Georgy",
- "Gerard", "Ghyll", "Giacomo", "Gian", "Giancarlo", "Gianluca", "Gianmarco", "Gideon", "Gil", "Gio",
- "Girijan", "Girius", "Gjan", "Glascott", "Glen", "Glenn", "Gordon", "Grady", "Graeme", "Graham", "Grahame",
- "Grant", "Grayson", "Greg", "Gregor", "Gregory", "Greig", "Griffin", "Griffyn", "Grzegorz", "Guang",
- "Guerin", "Guillaume", "Gurardass", "Gurdeep", "Gursees", "Gurthar", "Gurveer", "Gurwinder", "Gus",
- "Gustav", "Guthrie", "Guy", "Gytis", "Habeeb", "Hadji", "Hadyn", "Hagun", "Haiden", "Haider", "Hamad",
- "Hamid", "Hamish", "Hamza", "Hamzah", "Han", "Hansen", "Hao", "Hareem", "Hari", "Harikrishna", "Haris",
- "Harish", "Harjeevan", "Harjyot", "Harlee", "Harleigh", "Harley", "Harman", "Harnek", "Harold", "Haroon",
- "Harper", "Harri", "Harrington", "Harris", "Harrison", "Harry", "Harvey", "Harvie", "Harvinder", "Hasan",
- "Haseeb", "Hashem", "Hashim", "Hassan", "Hassanali", "Hately", "Havila", "Hayden", "Haydn", "Haydon",
- "Haydyn", "Hcen", "Hector", "Heddle", "Heidar", "Heini", "Hendri", "Henri", "Henry", "Herbert", "Heyden",
- "Hiro", "Hirvaansh", "Hishaam", "Hogan", "Honey", "Hong", "Hope", "Hopkin", "Hosea", "Howard", "Howie",
- "Hristomir", "Hubert", "Hugh", "Hugo", "Humza", "Hunter", "Husnain", "Hussain", "Hussan", "Hussnain",
- "Hussnan", "Hyden", "I", "Iagan", "Iain", "Ian", "Ibraheem", "Ibrahim", "Idahosa", "Idrees", "Idris",
- "Iestyn", "Ieuan", "Igor", "Ihtisham", "Ijay", "Ikechukwu", "Ikemsinachukwu", "Ilyaas", "Ilyas", "Iman",
- "Immanuel", "Inan", "Indy", "Ines", "Innes", "Ioannis", "Ireayomide", "Ireoluwa", "Irvin", "Irvine", "Isa",
- "Isaa", "Isaac", "Isaiah", "Isak", "Isher", "Ishwar", "Isimeli", "Isira", "Ismaeel", "Ismail", "Israel",
- "Issiaka", "Ivan", "Ivar", "Izaak", "J", "Jaay", "Jac", "Jace", "Jack", "Jacki", "Jackie", "Jack-James",
- "Jackson", "Jacky", "Jacob", "Jacques", "Jad", "Jaden", "Jadon", "Jadyn", "Jae", "Jagat", "Jago", "Jaheim",
- "Jahid", "Jahy", "Jai", "Jaida", "Jaiden", "Jaidyn", "Jaii", "Jaime", "Jai-Rajaram", "Jaise", "Jak", "Jake",
- "Jakey", "Jakob", "Jaksyn", "Jakub", "Jamaal", "Jamal", "Jameel", "Jameil", "James", "James-Paul", "Jamey",
- "Jamie", "Jan", "Jaosha", "Jardine", "Jared", "Jarell", "Jarl", "Jarno", "Jarred", "Jarvi", "Jasey-Jay",
- "Jasim", "Jaskaran", "Jason", "Jasper", "Jaxon", "Jaxson", "Jay", "Jaydan", "Jayden", "Jayden-James",
- "Jayden-Lee", "Jayden-Paul", "Jayden-Thomas", "Jaydn", "Jaydon", "Jaydyn", "Jayhan", "Jay-Jay", "Jayke",
- "Jaymie", "Jayse", "Jayson", "Jaz", "Jazeb", "Jazib", "Jazz", "Jean", "Jean-Lewis", "Jean-Pierre",
- "Jebadiah", "Jed", "Jedd", "Jedidiah", "Jeemie", "Jeevan", "Jeffrey", "Jensen", "Jenson", "Jensyn",
- "Jeremy", "Jerome", "Jeronimo", "Jerrick", "Jerry", "Jesse", "Jesuseun", "Jeswin", "Jevan", "Jeyun", "Jez",
- "Jia", "Jian", "Jiao", "Jimmy", "Jincheng", "JJ", "Joaquin", "Joash", "Jock", "Jody", "Joe", "Joeddy",
- "Joel", "Joey", "Joey-Jack", "Johann", "Johannes", "Johansson", "John", "Johnathan", "Johndean", "Johnjay",
- "John-Michael", "Johnnie", "Johnny", "Johnpaul", "John-Paul", "John-Scott", "Johnson", "Jole", "Jomuel",
- "Jon", "Jonah", "Jonatan", "Jonathan", "Jonathon", "Jonny", "Jonothan", "Jon-Paul", "Jonson", "Joojo",
- "Jordan", "Jordi", "Jordon", "Jordy", "Jordyn", "Jorge", "Joris", "Jorryn", "Josan", "Josef", "Joseph",
- "Josese", "Josh", "Joshiah", "Joshua", "Josiah", "Joss", "Jostelle", "Joynul", "Juan", "Jubin", "Judah",
- "Jude", "Jules", "Julian", "Julien", "Jun", "Junior", "Jura", "Justan", "Justin", "Justinas", "Kaan",
- "Kabeer", "Kabir", "Kacey", "Kacper", "Kade", "Kaden", "Kadin", "Kadyn", "Kaeden", "Kael", "Kaelan",
- "Kaelin", "Kaelum", "Kai", "Kaid", "Kaidan", "Kaiden", "Kaidinn", "Kaidyn", "Kaileb", "Kailin", "Kain",
- "Kaine", "Kainin", "Kainui", "Kairn", "Kaison", "Kaiwen", "Kajally", "Kajetan", "Kalani", "Kale", "Kaleb",
- "Kaleem", "Kal-el", "Kalen", "Kalin", "Kallan", "Kallin", "Kalum", "Kalvin", "Kalvyn", "Kameron", "Kames",
- "Kamil", "Kamran", "Kamron", "Kane", "Karam", "Karamvir", "Karandeep", "Kareem", "Karim", "Karimas", "Karl",
- "Karol", "Karson", "Karsyn", "Karthikeya", "Kasey", "Kash", "Kashif", "Kasim", "Kasper", "Kasra", "Kavin",
- "Kayam", "Kaydan", "Kayden", "Kaydin", "Kaydn", "Kaydyn", "Kaydyne", "Kayleb", "Kaylem", "Kaylum", "Kayne",
- "Kaywan", "Kealan", "Kealon", "Kean", "Keane", "Kearney", "Keatin", "Keaton", "Keavan", "Keayn", "Kedrick",
- "Keegan", "Keelan", "Keelin", "Keeman", "Keenan", "Keenan-Lee", "Keeton", "Kehinde", "Keigan", "Keilan",
- "Keir", "Keiran", "Keiren", "Keiron", "Keiryn", "Keison", "Keith", "Keivlin", "Kelam", "Kelan", "Kellan",
- "Kellen", "Kelso", "Kelum", "Kelvan", "Kelvin", "Ken", "Kenan", "Kendall", "Kendyn", "Kenlin", "Kenneth",
- "Kensey", "Kenton", "Kenyon", "Kenzeigh", "Kenzi", "Kenzie", "Kenzo", "Kenzy", "Keo", "Ker", "Kern", "Kerr",
- "Kevan", "Kevin", "Kevyn", "Kez", "Khai", "Khalan", "Khaleel", "Khaya", "Khevien", "Khizar", "Khizer",
- "Kia", "Kian", "Kian-James", "Kiaran", "Kiarash", "Kie", "Kiefer", "Kiegan", "Kienan", "Kier", "Kieran",
- "Kieran-Scott", "Kieren", "Kierin", "Kiern", "Kieron", "Kieryn", "Kile", "Killian", "Kimi", "Kingston",
- "Kinneil", "Kinnon", "Kinsey", "Kiran", "Kirk", "Kirwin", "Kit", "Kiya", "Kiyonari", "Kjae", "Klein",
- "Klevis", "Kobe", "Kobi", "Koby", "Koddi", "Koden", "Kodi", "Kodie", "Kody", "Kofi", "Kogan", "Kohen",
- "Kole", "Konan", "Konar", "Konnor", "Konrad", "Koray", "Korben", "Korbyn", "Korey", "Kori", "Korrin",
- "Kory", "Koushik", "Kris", "Krish", "Krishan", "Kriss", "Kristian", "Kristin", "Kristofer", "Kristoffer",
- "Kristopher", "Kruz", "Krzysiek", "Krzysztof", "Ksawery", "Ksawier", "Kuba", "Kurt", "Kurtis", "Kurtis-Jae",
- "Kyaan", "Kyan", "Kyde", "Kyden", "Kye", "Kyel", "Kyhran", "Kyie", "Kylan", "Kylar", "Kyle", "Kyle-Derek",
- "Kylian", "Kym", "Kynan", "Kyral", "Kyran", "Kyren", "Kyrillos", "Kyro", "Kyron", "Kyrran", "Lachlainn",
- "Lachlan", "Lachlann", "Lael", "Lagan", "Laird", "Laison", "Lakshya", "Lance", "Lancelot", "Landon", "Lang",
- "Lasse", "Latif", "Lauchlan", "Lauchlin", "Laughlan", "Lauren", "Laurence", "Laurie", "Lawlyn", "Lawrence",
- "Lawrie", "Lawson", "Layne", "Layton", "Lee", "Leigh", "Leigham", "Leighton", "Leilan", "Leiten", "Leithen",
- "Leland", "Lenin", "Lennan", "Lennen", "Lennex", "Lennon", "Lennox", "Lenny", "Leno", "Lenon", "Lenyn",
- "Leo", "Leon", "Leonard", "Leonardas", "Leonardo", "Lepeng", "Leroy", "Leven", "Levi", "Levon", "Levy",
- "Lewie", "Lewin", "Lewis", "Lex", "Leydon", "Leyland", "Leylann", "Leyton", "Liall", "Liam", "Liam-Stephen",
- "Limo", "Lincoln", "Lincoln-John", "Lincon", "Linden", "Linton", "Lionel", "Lisandro", "Litrell",
- "Liyonela-Elam", "LLeyton", "Lliam", "Lloyd", "Lloyde", "Loche", "Lochlan", "Lochlann", "Lochlan-Oliver",
- "Lock", "Lockey", "Logan", "Logann", "Logan-Rhys", "Loghan", "Lokesh", "Loki", "Lomond", "Lorcan", "Lorenz",
- "Lorenzo", "Lorne", "Loudon", "Loui", "Louie", "Louis", "Loukas", "Lovell", "Luc", "Luca", "Lucais",
- "Lucas", "Lucca", "Lucian", "Luciano", "Lucien", "Lucus", "Luic", "Luis", "Luk", "Luka", "Lukas", "Lukasz",
- "Luke", "Lukmaan", "Luqman", "Lyall", "Lyle", "Lyndsay", "Lysander", "Maanav", "Maaz", "Mac", "Macallum",
- "Macaulay", "Macauley", "Macaully", "Machlan", "Maciej", "Mack", "Mackenzie", "Mackenzy", "Mackie",
- "Macsen", "Macy", "Madaki", "Maddison", "Maddox", "Madison", "Madison-Jake", "Madox", "Mael", "Magnus",
- "Mahan", "Mahdi", "Mahmoud", "Maias", "Maison", "Maisum", "Maitlind", "Majid", "Makensie", "Makenzie",
- "Makin", "Maksim", "Maksymilian", "Malachai", "Malachi", "Malachy", "Malakai", "Malakhy", "Malcolm",
- "Malik", "Malikye", "Malo", "Ma'moon", "Manas", "Maneet", "Manmohan", "Manolo", "Manson", "Mantej",
- "Manuel", "Manus", "Marc", "Marc-Anthony", "Marcel", "Marcello", "Marcin", "Marco", "Marcos", "Marcous",
- "Marcquis", "Marcus", "Mario", "Marios", "Marius", "Mark", "Marko", "Markus", "Marley", "Marlin", "Marlon",
- "Maros", "Marshall", "Martin", "Marty", "Martyn", "Marvellous", "Marvin", "Marwan", "Maryk", "Marzuq",
- "Mashhood", "Mason", "Mason-Jay", "Masood", "Masson", "Matas", "Matej", "Mateusz", "Mathew", "Mathias",
- "Mathu", "Mathuyan", "Mati", "Matt", "Matteo", "Matthew", "Matthew-William", "Matthias", "Max", "Maxim",
- "Maximilian", "Maximillian", "Maximus", "Maxwell", "Maxx", "Mayeul", "Mayson", "Mazin", "Mcbride",
- "McCaulley", "McKade", "McKauley", "McKay", "McKenzie", "McLay", "Meftah", "Mehmet", "Mehraz", "Meko",
- "Melville", "Meshach", "Meyzhward", "Micah", "Michael", "Michael-Alexander", "Michael-James", "Michal",
- "Michat", "Micheal", "Michee", "Mickey", "Miguel", "Mika", "Mikael", "Mi'kael", "Mikee", "Mikey", "Mikhail",
- "Mikolaj", "Miles", "Millar", "Miller", "Milo", "Milos", "Milosz", "Mir", "Mirza", "Mitch", "Mitchel",
- "Mitchell", "Moad", "Moayd", "Mobeen", "Modoulamin", "Modu", "Mohamad", "Mohamed", "Mohammad",
- "Mohammad-Bilal", "Mohammed", "Mohanad", "Mohd", "Momin", "Momooreoluwa", "Montague", "Montgomery", "Monty",
- "Moore", "Moosa", "Moray", "Morgan", "Morgyn", "Morris", "Morton", "Moshy", "Motade", "Moyes", "Msughter",
- "Mueez", "Muhamadjavad", "Muhammad", "Muhammed", "Muhsin", "Muir", "Munachi", "Muneeb", "Mungo", "Munir",
- "Munmair", "Munro", "Murdo", "Murray", "Murrough", "Murry", "Musa", "Musse", "Mustafa", "Mustapha",
- "Muzammil", "Muzzammil", "Mykie", "Myles", "Mylo", "Nabeel", "Nadeem", "Nader", "Nagib", "Naif", "Nairn",
- "Narvic", "Nash", "Nasser", "Nassir", "Natan", "Nate", "Nathan", "Nathanael", "Nathanial", "Nathaniel",
- "Nathan-Rae", "Nawfal", "Nayan", "Neco", "Neil", "Nelson", "Neo", "Neshawn", "Nevan", "Nevin",
- "Ngonidzashe", "Nial", "Niall", "Nicholas", "Nick", "Nickhill", "Nicki", "Nickson", "Nicky", "Nico",
- "Nicodemus", "Nicol", "Nicolae", "Nicolas", "Nidhish", "Nihaal", "Nihal", "Nikash", "Nikhil", "Niki",
- "Nikita", "Nikodem", "Nikolai", "Nikos", "Nilav", "Niraj", "Niro", "Niven", "Noah", "Noel", "Nolan", "Noor",
- "Norman", "Norrie", "Nuada", "Nyah", "Oakley", "Oban", "Obieluem", "Obosa", "Odhran", "Odin", "Odynn",
- "Ogheneochuko", "Ogheneruno", "Ohran", "Oilibhear", "Oisin", "Ojima-Ojo", "Okeoghene", "Olaf", "Ola-Oluwa",
- "Olaoluwapolorimi", "Ole", "Olie", "Oliver", "Olivier", "Oliwier", "Ollie", "Olurotimi", "Oluwadamilare",
- "Oluwadamiloju", "Oluwafemi", "Oluwafikunayomi", "Oluwalayomi", "Oluwatobiloba", "Oluwatoni", "Omar",
- "Omri", "Oran", "Orin", "Orlando", "Orley", "Orran", "Orrick", "Orrin", "Orson", "Oryn", "Oscar",
- "Osesenagha", "Oskar", "Ossian", "Oswald", "Otto", "Owain", "Owais", "Owen", "Owyn", "Oz", "Ozzy", "Pablo",
- "Pacey", "Padraig", "Paolo", "Pardeepraj", "Parkash", "Parker", "Pascoe", "Pasquale", "Patrick",
- "Patrick-John", "Patrikas", "Patryk", "Paul", "Pavit", "Pawel", "Pawlo", "Pearce", "Pearse", "Pearsen",
- "Pedram", "Pedro", "Peirce", "Peiyan", "Pele", "Peni", "Peregrine", "Peter", "Phani", "Philip", "Philippos",
- "Phinehas", "Phoenix", "Phoevos", "Pierce", "Pierre-Antoine", "Pieter", "Pietro", "Piotr", "Porter",
- "Prabhjoit", "Prabodhan", "Praise", "Pranav", "Pravin", "Precious", "Prentice", "Presley", "Preston",
- "Preston-Jay", "Prinay", "Prince", "Prithvi", "Promise", "Puneetpaul", "Pushkar", "Qasim", "Qirui",
- "Quinlan", "Quinn", "Radmiras", "Raees", "Raegan", "Rafael", "Rafal", "Rafferty", "Rafi", "Raheem", "Rahil",
- "Rahim", "Rahman", "Raith", "Raithin", "Raja", "Rajab-Ali", "Rajan", "Ralfs", "Ralph", "Ramanas", "Ramit",
- "Ramone", "Ramsay", "Ramsey", "Rana", "Ranolph", "Raphael", "Rasmus", "Rasul", "Raul", "Raunaq", "Ravin",
- "Ray", "Rayaan", "Rayan", "Rayane", "Rayden", "Rayhan", "Raymond", "Rayne", "Rayyan", "Raza", "Reace",
- "Reagan", "Reean", "Reece", "Reed", "Reegan", "Rees", "Reese", "Reeve", "Regan", "Regean", "Reggie",
- "Rehaan", "Rehan", "Reice", "Reid", "Reigan", "Reilly", "Reily", "Reis", "Reiss", "Remigiusz", "Remo",
- "Remy", "Ren", "Renars", "Reng", "Rennie", "Reno", "Reo", "Reuben", "Rexford", "Reynold", "Rhein", "Rheo",
- "Rhett", "Rheyden", "Rhian", "Rhoan", "Rholmark", "Rhoridh", "Rhuairidh", "Rhuan", "Rhuaridh", "Rhudi",
- "Rhy", "Rhyan", "Rhyley", "Rhyon", "Rhys", "Rhys-Bernard", "Rhyse", "Riach", "Rian", "Ricards", "Riccardo",
- "Ricco", "Rice", "Richard", "Richey", "Richie", "Ricky", "Rico", "Ridley", "Ridwan", "Rihab", "Rihan",
- "Rihards", "Rihonn", "Rikki", "Riley", "Rio", "Rioden", "Rishi", "Ritchie", "Rivan", "Riyadh", "Riyaj",
- "Roan", "Roark", "Roary", "Rob", "Robbi", "Robbie", "Robbie-lee", "Robby", "Robert", "Robert-Gordon",
- "Robertjohn", "Robi", "Robin", "Rocco", "Roddy", "Roderick", "Rodrigo", "Roen", "Rogan", "Roger", "Rohaan",
- "Rohan", "Rohin", "Rohit", "Rokas", "Roman", "Ronald", "Ronan", "Ronan-Benedict", "Ronin", "Ronnie",
- "Rooke", "Roray", "Rori", "Rorie", "Rory", "Roshan", "Ross", "Ross-Andrew", "Rossi", "Rowan", "Rowen",
- "Roy", "Ruadhan", "Ruaidhri", "Ruairi", "Ruairidh", "Ruan", "Ruaraidh", "Ruari", "Ruaridh", "Ruben",
- "Rubhan", "Rubin", "Rubyn", "Rudi", "Rudy", "Rufus", "Rui", "Ruo", "Rupert", "Ruslan", "Russel", "Russell",
- "Ryaan", "Ryan", "Ryan-Lee", "Ryden", "Ryder", "Ryese", "Ryhs", "Rylan", "Rylay", "Rylee", "Ryleigh",
- "Ryley", "Rylie", "Ryo", "Ryszard", "Saad", "Sabeen", "Sachkirat", "Saffi", "Saghun", "Sahaib", "Sahbian",
- "Sahil", "Saif", "Saifaddine", "Saim", "Sajid", "Sajjad", "Salahudin", "Salman", "Salter", "Salvador",
- "Sam", "Saman", "Samar", "Samarjit", "Samatar", "Sambrid", "Sameer", "Sami", "Samir", "Sami-Ullah",
- "Samual", "Samuel", "Samuela", "Samy", "Sanaullah", "Sandro", "Sandy", "Sanfur", "Sanjay", "Santiago",
- "Santino", "Satveer", "Saul", "Saunders", "Savin", "Sayad", "Sayeed", "Sayf", "Scot", "Scott",
- "Scott-Alexander", "Seaan", "Seamas", "Seamus", "Sean", "Seane", "Sean-James", "Sean-Paul", "Sean-Ray",
- "Seb", "Sebastian", "Sebastien", "Selasi", "Seonaidh", "Sephiroth", "Sergei", "Sergio", "Seth", "Sethu",
- "Seumas", "Shaarvin", "Shadow", "Shae", "Shahmir", "Shai", "Shane", "Shannon", "Sharland", "Sharoz",
- "Shaughn", "Shaun", "Shaunpaul", "Shaun-Paul", "Shaun-Thomas", "Shaurya", "Shaw", "Shawn", "Shawnpaul",
- "Shay", "Shayaan", "Shayan", "Shaye", "Shayne", "Shazil", "Shea", "Sheafan", "Sheigh", "Shenuk", "Sher",
- "Shergo", "Sheriff", "Sherwyn", "Shiloh", "Shiraz", "Shreeram", "Shreyas", "Shyam", "Siddhant", "Siddharth",
- "Sidharth", "Sidney", "Siergiej", "Silas", "Simon", "Sinai", "Skye", "Sofian", "Sohaib", "Sohail", "Soham",
- "Sohan", "Sol", "Solomon", "Sonneey", "Sonni", "Sonny", "Sorley", "Soul", "Spencer", "Spondon", "Stanislaw",
- "Stanley", "Stefan", "Stefano", "Stefin", "Stephen", "Stephenjunior", "Steve", "Steven", "Steven-lee",
- "Stevie", "Stewart", "Stewarty", "Strachan", "Struan", "Stuart", "Su", "Subhaan", "Sudais", "Suheyb",
- "Suilven", "Sukhi", "Sukhpal", "Sukhvir", "Sulayman", "Sullivan", "Sultan", "Sung", "Sunny", "Suraj",
- "Surien", "Sweyn", "Syed", "Sylvain", "Symon", "Szymon", "Tadd", "Taddy", "Tadhg", "Taegan", "Taegen",
- "Tai", "Tait", "Taiwo", "Talha", "Taliesin", "Talon", "Talorcan", "Tamar", "Tamiem", "Tammam", "Tanay",
- "Tane", "Tanner", "Tanvir", "Tanzeel", "Taonga", "Tarik", "Tariq-Jay", "Tate", "Taylan", "Taylar", "Tayler",
- "Taylor", "Taylor-Jay", "Taylor-Lee", "Tayo", "Tayyab", "Tayye", "Tayyib", "Teagan", "Tee", "Teejay",
- "Tee-jay", "Tegan", "Teighen", "Teiyib", "Te-Jay", "Temba", "Teo", "Teodor", "Teos", "Terry", "Teydren",
- "Theo", "Theodore", "Thiago", "Thierry", "Thom", "Thomas", "Thomas-Jay", "Thomson", "Thorben", "Thorfinn",
- "Thrinei", "Thumbiko", "Tiago", "Tian", "Tiarnan", "Tibet", "Tieran", "Tiernan", "Timothy", "Timucin",
- "Tiree", "Tisloh", "Titi", "Titus", "Tiylar", "TJ", "Tjay", "T'jay", "T-Jay", "Tobey", "Tobi", "Tobias",
- "Tobie", "Toby", "Todd", "Tokinaga", "Toluwalase", "Tom", "Tomas", "Tomasz", "Tommi-Lee", "Tommy", "Tomson",
- "Tony", "Torin", "Torquil", "Torran", "Torrin", "Torsten", "Trafford", "Trai", "Travis", "Tre", "Trent",
- "Trey", "Tristain", "Tristan", "Troy", "Tubagus", "Turki", "Turner", "Ty", "Ty-Alexander", "Tye", "Tyelor",
- "Tylar", "Tyler", "Tyler-James", "Tyler-Jay", "Tyllor", "Tylor", "Tymom", "Tymon", "Tymoteusz", "Tyra",
- "Tyree", "Tyrnan", "Tyrone", "Tyson", "Ubaid", "Ubayd", "Uchenna", "Uilleam", "Umair", "Umar", "Umer",
- "Umut", "Urban", "Uri", "Usman", "Uzair", "Uzayr", "Valen", "Valentin", "Valentino", "Valery", "Valo",
- "Vasyl", "Vedantsinh", "Veeran", "Victor", "Victory", "Vinay", "Vince", "Vincent", "Vincenzo", "Vinh",
- "Vinnie", "Vithujan", "Vladimir", "Vladislav", "Vrishin", "Vuyolwethu", "Wabuya", "Wai", "Walid", "Wallace",
- "Walter", "Waqaas", "Warkhas", "Warren", "Warrick", "Wasif", "Wayde", "Wayne", "Wei", "Wen", "Wesley",
- "Wesley-Scott", "Wiktor", "Wilkie", "Will", "William", "William-John", "Willum", "Wilson", "Windsor",
- "Wojciech", "Woyenbrakemi", "Wyatt", "Wylie", "Wynn", "Xabier", "Xander", "Xavier", "Xiao", "Xida", "Xin",
- "Xue", "Yadgor", "Yago", "Yahya", "Yakup", "Yang", "Yanick", "Yann", "Yannick", "Yaseen", "Yasin", "Yasir",
- "Yassin", "Yoji", "Yong", "Yoolgeun", "Yorgos", "Youcef", "Yousif", "Youssef", "Yu", "Yuanyu", "Yuri",
- "Yusef", "Yusuf", "Yves", "Zaaine", "Zaak", "Zac", "Zach", "Zachariah", "Zacharias", "Zacharie",
- "Zacharius", "Zachariya", "Zachary", "Zachary-Marc", "Zachery", "Zack", "Zackary", "Zaid", "Zain", "Zaine",
- "Zaineddine", "Zainedin", "Zak", "Zakaria", "Zakariya", "Zakary", "Zaki", "Zakir", "Zakk", "Zamaar",
- "Zander", "Zane", "Zarran", "Zayd", "Zayn", "Zayne", "Ze", "Zechariah", "Zeek", "Zeeshan", "Zeid", "Zein",
- "Zen", "Zendel", "Zenith", "Zennon", "Zeph", "Zerah", "Zhen", "Zhi", "Zhong", "Zhuo", "Zi", "Zidane",
- "Zijie", "Zinedine", "Zion", "Zishan", "Ziya", "Ziyaan", "Zohaib", "Zohair", "Zoubaeir", "Zubair", "Zubayr",
- "Zuriel", "Jaime", "Jayden", "Josie", "Juliet", "Karys", "Kathleen", "Kendra", "Keri", "Keris", "Kirstin",
- "Klaudia", "Luisa", "Lydia", "Maeve", "Marnie", "Miah", "Mirrin", "Nancy", "Nia", "Nikki", "Oliwia",
- "Paris", "Piper", "Pippa", "Polly", "Rhona", "Safa", "Saira", "Sarah-Louise", "Shona", "Sorcha", "Stacey",
- "Tessa", "Tiffany", "Verity", "Zarah", "Zoya", "Alexandria", "Alina", "Alison", "Angela", "Arianna",
- "Chanel", "Chelsey", "Coral", "Corinne", "Danni", "Darci", "Dionne", "Eliza", "Elsie", "Fatima", "Freyja",
- "Holli", "Jane", "Joanne", "Karina", "Katrina", "Kaylah", "Kaylee", "Lori", "Mila", "Nikita", "Penny",
- "Sylvie", "Tammy", "Alexa", "Brooklyn", "Caragh", "Codie", "Constance", "Dana", "Demi-Lee", "Emilie",
- "Esther", "Frankie", "Isabelle", "Jamie-Leigh", "Jessie", "Josephine", "Kady", "Kaila", "Kerri", "Kirstie",
- "Lyla", "Macey", "Maisy", "Margaret", "Marie", "Maryam", "Mercedes", "Mischa", "Rosa", "Serena", "Sian",
- "Tamzin", "Vanessa", "Violet", "Yasmine", "Aisha", "Aleisha", "Ana", "Daniella", "Elsa", "Jodi", "Karly",
- "Leigha", "Lila", "Melanie", "Miriam", "Regan", "Sally", "Saskia", "Simone", "Tess", "Thea", "Zainab",
- "Arwen", "Bonnie", "Eloise", "Emma-Louise", "Halle", "Hana", "Honey", "Jamie-Lee", "Karla", "Leia", "Leila",
- "Madeline", "Neave", "Orlaith", "Rhea", "Sarah-Jane", "Tara", "Adele", "Alannah", "Alesha", "Annabelle",
- "Ayla", "Becca", "Darcie", "Ebony", "Erica", "Georgie", "Hanna", "Julie", "Kadie", "Kelly", "Kiara",
- "Lillie", "Mariam", "Mikayla", "Monica", "Roisin", "Savannah", "Sky", "Zahra", "Alanna", "Caoimhe",
- "Chanelle", "Elisha", "Emilia", "Iris", "Kacie", "Lia", "Maja", "Mary", "Michelle", "Tyler", "Willow",
- "Yasmin", "Becky", "Billie", "Clara", "Claudia", "Cody", "Elena", "Eryn", "Georgina", "Kayley", "Kimberley",
- "Kira", "Laila", "Lauryn", "Murron", "Natalia", "Ruth", "Siobhan", "Tiana", "Bethan", "Brodie", "Cameron",
- "Cassie", "Harriet", "Helen", "Kathryn", "Kyra", "Mairi", "Mckenzie", "Tilly", "Zuzanna", "April",
- "Christina", "Claire", "Darcey", "Fern", "Fiona", "Joanna", "Lucia", "Charli", "Jamie", "Karis",
- "Mackenzie", "Marissa", "Rihanna", "Teagan", "Tiegan", "Kaitlin", "Keeley", "Leigh", "Nadia", "Alix",
- "Callie", "Carrie", "Eden", "Esme", "Hazel", "Miya", "Nieve", "Sadie", "Sasha", "Sinead", "Stella",
- "Ashleigh", "Jade", "Jemma", "Michaela", "Alexis", "Aoife", "Francesca", "Lisa", "Matilda", "Annabel",
- "Carmen", "Eleanor", "Faye", "Kaci", "Kasey", "Kerry", "Louisa", "Macy", "Mhairi", "Rebekah", "Teigan",
- "Amie", "Brogan", "Catriona", "Scarlett", "Connie", "Katelyn", "Kenzie", "Lexi", "Nicola", "Sienna", "Abbi",
- "Angel", "Martha", "Anya", "Toni", "Chantelle", "Gabriella", "Lexie", "Abbey", "Bailey", "Isobel", "Kelsie",
- "Maia", "Nina", "Darcy", "Lacey", "Lana", "Sofia", "Stephanie", "Ellen", "Alicia", "Gabrielle", "Heidi",
- "Jorja", "Kyla", "Rhiannon", "Tegan", "Maddison", "Madeleine", "Morven", "Rowan", "Lucie", "Milly", "Annie",
- "Ashley", "Ellis", "Hope", "Mirren", "Rose", "Alexandra", "Jodie", "Kacey", "Phoebe", "Tia", "Ailsa",
- "Alana", "Kirsten", "Charlie", "Katy", "Lilly", "Alyssa", "Maria", "Naomi", "Alisha", "Danielle", "Lola",
- "Ciara", "Elle", "Faith", "Natasha", "Katherine", "Lois", "Mollie", "Carla", "Catherine", "Cerys", "Maisie",
- "Victoria", "Amelie", "Demi", "Gracie", "Carys", "Isabella", "Leona", "Alex", "Hollie", "Sara", "Caitlyn",
- "Kiera", "Lara", "Kate", "Louise", "Libby", "Rhianna", "Rosie", "Alice", "Julia", "Maya", "Natalie",
- "Chelsea", "Layla", "Samantha", "Heather", "Kirsty", "Rachael", "Charley", "Imogen", "Elise", "Hayley",
- "Kelsey", "Kara", "Orla", "Abi", "Gemma", "Laura", "Mya", "Bethany", "Jasmine", "Melissa", "Poppy", "Casey",
- "Elizabeth", "Kaitlyn", "Carly", "Abby", "Neve", "Courtney", "Jennifer", "Sophia", "Shannon", "Georgia",
- "Amber", "Robyn", "Beth", "Zara", "Amelia", "Taylor", "Daisy", "Paige", "Kayleigh", "Summer", "Madison",
- "Jenna", "Morgan", "Evie", "Nicole", "Ella", "Cara", "Iona", "Eve", "Zoe", "Kayla", "Molly", "Abigail",
- "Charlotte", "Millie", "Holly", "Leah", "Keira", "Lily", "Freya", "Caitlin", "Lauren", "Rachel", "Anna",
- "Sarah", "Ruby", "Aimee", "Mia", "Skye", "Abbie", "Eva", "Eilidh", "Niamh", "Megan", "Brooke", "Isla",
- "Rebecca", "Ava", "Grace", "Jessica", "Hannah", "Olivia", "Chloe", "Emily", "Amy", "Ellie", "Erin", "Katie",
- "Lucy", "Emma", "Sophie" };
- }
+ private static final String[] generateFirstNames() {
+ return new String[] {
+ "AARON",
+ "ABBIE",
+ "ABBY",
+ "ABEL",
+ "ABIGAIL",
+ "ABRAHAM",
+ "ADA",
+ "ADAM",
+ "ADAN",
+ "ADDIE",
+ "ADELA",
+ "ADELAIDE",
+ "ADELE",
+ "ADELINE",
+ "ADOLFO",
+ "ADOLPH",
+ "ADRIAN",
+ "ADRIANA",
+ "ADRIENNE",
+ "AGNES",
+ "AGUSTIN",
+ "AIDA",
+ "AILEEN",
+ "AIMEE",
+ "AISHA",
+ "AL",
+ "ALAN",
+ "ALANA",
+ "ALBA",
+ "ALBERT",
+ "ALBERTA",
+ "ALBERTO",
+ "ALEJANDRA",
+ "ALEJANDRO",
+ "ALEX",
+ "ALEXANDER",
+ "ALEXANDRA",
+ "ALEXANDRIA",
+ "ALEXIS",
+ "ALFONSO",
+ "ALFRED",
+ "ALFREDA",
+ "ALFREDO",
+ "ALI",
+ "ALICE",
+ "ALICIA",
+ "ALINE",
+ "ALISA",
+ "ALISHA",
+ "ALISON",
+ "ALISSA",
+ "ALLAN",
+ "ALLEN",
+ "ALLENE",
+ "ALLIE",
+ "ALLISON",
+ "ALLYSON",
+ "ALMA",
+ "ALONZO",
+ "ALPHONSO",
+ "ALTA",
+ "ALTHEA",
+ "ALTON",
+ "ALVARO",
+ "ALVIN",
+ "ALYCE",
+ "ALYSON",
+ "ALYSSA",
+ "AMALIA",
+ "AMANDA",
+ "AMBER",
+ "AMELIA",
+ "AMIE",
+ "AMOS",
+ "AMPARO",
+ "AMY",
+ "ANA",
+ "ANASTASIA",
+ "ANDRE",
+ "ANDREA",
+ "ANDRES",
+ "ANDREW",
+ "ANDY",
+ "ANGEL",
+ "ANGELA",
+ "ANGELIA",
+ "ANGELICA",
+ "ANGELINA",
+ "ANGELINE",
+ "ANGELIQUE",
+ "ANGELITA",
+ "ANGELO",
+ "ANGIE",
+ "ANITA",
+ "ANN",
+ "ANNA",
+ "ANNABELLE",
+ "ANNE",
+ "ANNETTE",
+ "ANNIE",
+ "ANNMARIE",
+ "ANTHONY",
+ "ANTIONETTE",
+ "ANTOINE",
+ "ANTOINETTE",
+ "ANTON",
+ "ANTONIA",
+ "ANTONIO",
+ "ANTONY",
+ "APRIL",
+ "ARACELI",
+ "ARCHIE",
+ "ARLENE",
+ "ARLINE",
+ "ARMAND",
+ "ARMANDO",
+ "ARNOLD",
+ "ARRON",
+ "ART",
+ "ARTHUR",
+ "ARTURO",
+ "ASHLEE",
+ "ASHLEIGH",
+ "ASHLEY",
+ "AUBREY",
+ "AUDRA",
+ "AUDREY",
+ "AUGUST",
+ "AUGUSTA",
+ "AURELIA",
+ "AURELIO",
+ "AURORA",
+ "AUSTIN",
+ "AUTUMN",
+ "AVA",
+ "AVERY",
+ "AVIS",
+ "BARBARA",
+ "BARBRA",
+ "BARNEY",
+ "BARRY",
+ "BART",
+ "BASIL",
+ "BEATRICE",
+ "BEATRIZ",
+ "BEAU",
+ "BECKY",
+ "BELINDA",
+ "BEN",
+ "BENITA",
+ "BENITO",
+ "BENJAMIN",
+ "BENNETT",
+ "BENNIE",
+ "BENNY",
+ "BERNADETTE",
+ "BERNADINE",
+ "BERNARD",
+ "BERNARDO",
+ "BERNICE",
+ "BERNIE",
+ "BERT",
+ "BERTA",
+ "BERTHA",
+ "BERTIE",
+ "BERYL",
+ "BESSIE",
+ "BETH",
+ "BETHANY",
+ "BETSY",
+ "BETTE",
+ "BETTIE",
+ "BETTY",
+ "BETTYE",
+ "BEULAH",
+ "BEVERLEY",
+ "BEVERLY",
+ "BIANCA",
+ "BILL",
+ "BILLIE",
+ "BILLY",
+ "BLAINE",
+ "BLAIR",
+ "BLAKE",
+ "BLANCA",
+ "BLANCHE",
+ "BOB",
+ "BOBBI",
+ "BOBBIE",
+ "BOBBY",
+ "BONITA",
+ "BONNIE",
+ "BOOKER",
+ "BOYD",
+ "BRAD",
+ "BRADFORD",
+ "BRADLEY",
+ "BRADY",
+ "BRAIN",
+ "BRANDEN",
+ "BRANDI",
+ "BRANDIE",
+ "BRANDON",
+ "BRANDY",
+ "BRENDA",
+ "BRENDAN",
+ "BRENT",
+ "BRET",
+ "BRETT",
+ "BRIAN",
+ "BRIANA",
+ "BRIANNA",
+ "BRIDGET",
+ "BRIDGETT",
+ "BRIDGETTE",
+ "BRIGITTE",
+ "BRITNEY",
+ "BRITTANY",
+ "BRITTNEY",
+ "BROCK",
+ "BROOKE",
+ "BRUCE",
+ "BRUNO",
+ "BRYAN",
+ "BRYANT",
+ "BRYCE",
+ "BRYON",
+ "BUDDY",
+ "BUFORD",
+ "BURTON",
+ "BYRON",
+ "CAITLIN",
+ "CALEB",
+ "CALLIE",
+ "CALVIN",
+ "CAMERON",
+ "CAMILLA",
+ "CAMILLE",
+ "CANDACE",
+ "CANDICE",
+ "CANDY",
+ "CARA",
+ "CAREY",
+ "CARISSA",
+ "CARL",
+ "CARLA",
+ "CARLENE",
+ "CARLO",
+ "CARLOS",
+ "CARLTON",
+ "CARLY",
+ "CARMELA",
+ "CARMELLA",
+ "CARMELO",
+ "CARMEN",
+ "CAROL",
+ "CAROLE",
+ "CAROLINA",
+ "CAROLINE",
+ "CAROLYN",
+ "CARRIE",
+ "CARROLL",
+ "CARSON",
+ "CARTER",
+ "CARY",
+ "CARYN",
+ "CASANDRA",
+ "CASEY",
+ "CASSANDRA",
+ "CASSIE",
+ "CATALINA",
+ "CATHERINE",
+ "CATHLEEN",
+ "CATHRYN",
+ "CATHY",
+ "CECELIA",
+ "CECIL",
+ "CECILE",
+ "CECILIA",
+ "CEDRIC",
+ "CELESTE",
+ "CELIA",
+ "CELINA",
+ "CESAR",
+ "CHAD",
+ "CHANDRA",
+ "CHARITY",
+ "CHARLENE",
+ "CHARLES",
+ "CHARLEY",
+ "CHARLIE",
+ "CHARLOTTE",
+ "CHARMAINE",
+ "CHASE",
+ "CHASITY",
+ "CHELSEA",
+ "CHELSEY",
+ "CHERI",
+ "CHERIE",
+ "CHERRY",
+ "CHERYL",
+ "CHESTER",
+ "CHRIS",
+ "CHRISTA",
+ "CHRISTI",
+ "CHRISTIAN",
+ "CHRISTIE",
+ "CHRISTINA",
+ "CHRISTINE",
+ "CHRISTOPHER",
+ "CHRISTY",
+ "CHRYSTAL",
+ "CHUCK",
+ "CINDY",
+ "CLAIR",
+ "CLAIRE",
+ "CLARA",
+ "CLARE",
+ "CLARENCE",
+ "CLARICE",
+ "CLARISSA",
+ "CLARK",
+ "CLAUDE",
+ "CLAUDETTE",
+ "CLAUDIA",
+ "CLAUDINE",
+ "CLAY",
+ "CLAYTON",
+ "CLEMENT",
+ "CLEO",
+ "CLEVELAND",
+ "CLIFF",
+ "CLIFFORD",
+ "CLIFTON",
+ "CLINT",
+ "CLINTON",
+ "CLYDE",
+ "CODY",
+ "COLBY",
+ "COLE",
+ "COLEEN",
+ "COLETTE",
+ "COLIN",
+ "COLLEEN",
+ "COLLIN",
+ "CONCEPCION",
+ "CONCETTA",
+ "CONNIE",
+ "CONRAD",
+ "CONSTANCE",
+ "CONSUELO",
+ "CORA",
+ "COREY",
+ "CORINA",
+ "CORINE",
+ "CORINNE",
+ "CORNELIA",
+ "CORNELIUS",
+ "CORNELL",
+ "CORRINE",
+ "CORTNEY",
+ "CORY",
+ "COURTNEY",
+ "COY",
+ "CRAIG",
+ "CRISTINA",
+ "CRUZ",
+ "CRYSTAL",
+ "CURT",
+ "CURTIS",
+ "CYNTHIA",
+ "DAISY",
+ "DALE",
+ "DALLAS",
+ "DALTON",
+ "DAMIAN",
+ "DAMIEN",
+ "DAMON",
+ "DAN",
+ "DANA",
+ "DANE",
+ "DANIAL",
+ "DANIEL",
+ "DANIELLE",
+ "DANNY",
+ "DANTE",
+ "DAPHNE",
+ "DARCY",
+ "DAREN",
+ "DARIN",
+ "DARIUS",
+ "DARLA",
+ "DARLENE",
+ "DARNELL",
+ "DARREL",
+ "DARRELL",
+ "DARREN",
+ "DARRIN",
+ "DARRYL",
+ "DARWIN",
+ "DARYL",
+ "DAVE",
+ "DAVID",
+ "DAVIS",
+ "DAWN",
+ "DAYNA",
+ "DEAN",
+ "DEANA",
+ "DEANN",
+ "DEANNA",
+ "DEANNE",
+ "DEBBIE",
+ "DEBORA",
+ "DEBORAH",
+ "DEBRA",
+ "DEE",
+ "DEENA",
+ "DEIDRA",
+ "DEIDRE",
+ "DEIRDRE",
+ "DELBERT",
+ "DELIA",
+ "DELLA",
+ "DELMAR",
+ "DELORES",
+ "DELORIS",
+ "DEMETRIUS",
+ "DENA",
+ "DENICE",
+ "DENIS",
+ "DENISE",
+ "DENNIS",
+ "DENNY",
+ "DENVER",
+ "DEREK",
+ "DERICK",
+ "DERRICK",
+ "DESIREE",
+ "DESMOND",
+ "DESSIE",
+ "DEVIN",
+ "DEVON",
+ "DEWAYNE",
+ "DEWEY",
+ "DEXTER",
+ "DIANA",
+ "DIANE",
+ "DIANN",
+ "DIANNA",
+ "DIANNE",
+ "DICK",
+ "DIEGO",
+ "DINA",
+ "DION",
+ "DIONNE",
+ "DIRK",
+ "DIXIE",
+ "DOLLIE",
+ "DOLLY",
+ "DOLORES",
+ "DOMINGO",
+ "DOMINIC",
+ "DOMINICK",
+ "DOMINIQUE",
+ "DON",
+ "DONA",
+ "DONALD",
+ "DONNA",
+ "DONNELL",
+ "DONNIE",
+ "DONNY",
+ "DONOVAN",
+ "DORA",
+ "DOREEN",
+ "DORETHA",
+ "DORIS",
+ "DOROTHEA",
+ "DOROTHY",
+ "DORTHY",
+ "DOUG",
+ "DOUGLAS",
+ "DOYLE",
+ "DREW",
+ "DUANE",
+ "DUDLEY",
+ "DUSTIN",
+ "DWAYNE",
+ "DWIGHT",
+ "DYLAN",
+ "EARL",
+ "EARLENE",
+ "EARLINE",
+ "EARNEST",
+ "EARNESTINE",
+ "EBONY",
+ "ED",
+ "EDDIE",
+ "EDDY",
+ "EDGAR",
+ "EDITH",
+ "EDMOND",
+ "EDMUND",
+ "EDNA",
+ "EDUARDO",
+ "EDWARD",
+ "EDWARDO",
+ "EDWIN",
+ "EDWINA",
+ "EDYTHE",
+ "EFFIE",
+ "EFRAIN",
+ "EILEEN",
+ "ELAINE",
+ "ELBA",
+ "ELBERT",
+ "ELDA",
+ "ELDON",
+ "ELEANOR",
+ "ELENA",
+ "ELI",
+ "ELIAS",
+ "ELIJAH",
+ "ELINOR",
+ "ELISA",
+ "ELISABETH",
+ "ELISE",
+ "ELISHA",
+ "ELIZA",
+ "ELIZABETH",
+ "ELLA",
+ "ELLEN",
+ "ELLIOT",
+ "ELLIOTT",
+ "ELLIS",
+ "ELMA",
+ "ELMER",
+ "ELNORA",
+ "ELOISE",
+ "ELSA",
+ "ELSIE",
+ "ELTON",
+ "ELVA",
+ "ELVIA",
+ "ELVIN",
+ "ELVIRA",
+ "ELVIS",
+ "ELWOOD",
+ "EMANUEL",
+ "EMERSON",
+ "EMERY",
+ "EMIL",
+ "EMILIA",
+ "EMILIE",
+ "EMILIO",
+ "EMILY",
+ "EMMA",
+ "EMMANUEL",
+ "EMMETT",
+ "EMORY",
+ "ENID",
+ "ENRIQUE",
+ "ERIC",
+ "ERICA",
+ "ERICK",
+ "ERICKA",
+ "ERIK",
+ "ERIKA",
+ "ERIN",
+ "ERMA",
+ "ERNA",
+ "ERNEST",
+ "ERNESTINE",
+ "ERNESTO",
+ "ERNIE",
+ "ERROL",
+ "ERVIN",
+ "ERWIN",
+ "ESMERALDA",
+ "ESPERANZA",
+ "ESSIE",
+ "ESTEBAN",
+ "ESTELA",
+ "ESTELLA",
+ "ESTELLE",
+ "ESTER",
+ "ESTHER",
+ "ETHAN",
+ "ETHEL",
+ "ETTA",
+ "EUGENE",
+ "EUGENIA",
+ "EULA",
+ "EUNICE",
+ "EVA",
+ "EVAN",
+ "EVANGELINA",
+ "EVANGELINE",
+ "EVE",
+ "EVELYN",
+ "EVERETT",
+ "FABIAN",
+ "FAITH",
+ "FANNIE",
+ "FANNY",
+ "FAY",
+ "FAYE",
+ "FEDERICO",
+ "FELECIA",
+ "FELICIA",
+ "FELIPE",
+ "FELIX",
+ "FERN",
+ "FERNANDO",
+ "FIDEL",
+ "FLETCHER",
+ "FLORA",
+ "FLORENCE",
+ "FLORINE",
+ "FLOSSIE",
+ "FLOYD",
+ "FORREST",
+ "FRAN",
+ "FRANCES",
+ "FRANCESCA",
+ "FRANCINE",
+ "FRANCIS",
+ "FRANCISCA",
+ "FRANCISCO",
+ "FRANK",
+ "FRANKIE",
+ "FRANKLIN",
+ "FRED",
+ "FREDA",
+ "FREDDIE",
+ "FREDDY",
+ "FREDERIC",
+ "FREDERICK",
+ "FREDRICK",
+ "FREIDA",
+ "FRIEDA",
+ "GABRIEL",
+ "GABRIELA",
+ "GABRIELLE",
+ "GAIL",
+ "GALE",
+ "GALEN",
+ "GARLAND",
+ "GARRETT",
+ "GARRY",
+ "GARY",
+ "GAVIN",
+ "GAY",
+ "GAYLA",
+ "GAYLE",
+ "GENA",
+ "GENARO",
+ "GENE",
+ "GENEVA",
+ "GENEVIEVE",
+ "GEOFFREY",
+ "GEORGE",
+ "GEORGETTE",
+ "GEORGIA",
+ "GEORGINA",
+ "GERALD",
+ "GERALDINE",
+ "GERARD",
+ "GERARDO",
+ "GERI",
+ "GERMAINE",
+ "GERMAN",
+ "GERRY",
+ "GERTRUDE",
+ "GILBERT",
+ "GILBERTO",
+ "GILDA",
+ "GINA",
+ "GINGER",
+ "GLADYS",
+ "GLEN",
+ "GLENDA",
+ "GLENN",
+ "GLENNA",
+ "GLORIA",
+ "GOLDIE",
+ "GONZALO",
+ "GORDON",
+ "GRACE",
+ "GRACIE",
+ "GRACIELA",
+ "GRADY",
+ "GRAHAM",
+ "GRANT",
+ "GREG",
+ "GREGG",
+ "GREGORIO",
+ "GREGORY",
+ "GRETA",
+ "GRETCHEN",
+ "GROVER",
+ "GUADALUPE",
+ "GUILLERMO",
+ "GUS",
+ "GUSSIE",
+ "GUSTAVO",
+ "GUY",
+ "GWEN",
+ "GWENDOLYN",
+ "HAL",
+ "HALEY",
+ "HALLIE",
+ "HANNAH",
+ "HANS",
+ "HARLAN",
+ "HARLEY",
+ "HAROLD",
+ "HARRIET",
+ "HARRIETT",
+ "HARRIS",
+ "HARRISON",
+ "HARRY",
+ "HARVEY",
+ "HATTIE",
+ "HAZEL",
+ "HEATH",
+ "HEATHER",
+ "HECTOR",
+ "HEIDI",
+ "HELEN",
+ "HELENA",
+ "HELENE",
+ "HELGA",
+ "HENRIETTA",
+ "HENRY",
+ "HERBERT",
+ "HERIBERTO",
+ "HERMAN",
+ "HERMINIA",
+ "HESTER",
+ "HILARY",
+ "HILDA",
+ "HILLARY",
+ "HIRAM",
+ "HOLLIE",
+ "HOLLIS",
+ "HOLLY",
+ "HOMER",
+ "HOPE",
+ "HORACE",
+ "HOUSTON",
+ "HOWARD",
+ "HUBERT",
+ "HUGH",
+ "HUGO",
+ "HUMBERTO",
+ "HUNG",
+ "HUNTER",
+ "IAN",
+ "IDA",
+ "IGNACIO",
+ "ILA",
+ "ILENE",
+ "IMELDA",
+ "IMOGENE",
+ "INA",
+ "INES",
+ "INEZ",
+ "INGRID",
+ "IRA",
+ "IRENE",
+ "IRIS",
+ "IRMA",
+ "IRVIN",
+ "IRVING",
+ "IRWIN",
+ "ISAAC",
+ "ISABEL",
+ "ISABELLA",
+ "ISABELLE",
+ "ISAIAH",
+ "ISIDRO",
+ "ISMAEL",
+ "ISRAEL",
+ "ISSAC",
+ "IVA",
+ "IVAN",
+ "IVY",
+ "JACK",
+ "JACKIE",
+ "JACKLYN",
+ "JACKSON",
+ "JACLYN",
+ "JACOB",
+ "JACQUELINE",
+ "JACQUELYN",
+ "JACQUES",
+ "JADE",
+ "JAIME",
+ "JAKE",
+ "JAMAL",
+ "JAME",
+ "JAMES",
+ "JAMI",
+ "JAMIE",
+ "JAN",
+ "JANA",
+ "JANE",
+ "JANELL",
+ "JANELLE",
+ "JANET",
+ "JANETTE",
+ "JANICE",
+ "JANIE",
+ "JANINE",
+ "JANIS",
+ "JANNA",
+ "JANNIE",
+ "JARED",
+ "JARROD",
+ "JARVIS",
+ "JASMIN",
+ "JASMINE",
+ "JASON",
+ "JASPER",
+ "JAVIER",
+ "JAY",
+ "JAYNE",
+ "JAYSON",
+ "JEAN",
+ "JEANETTE",
+ "JEANIE",
+ "JEANINE",
+ "JEANNE",
+ "JEANNETTE",
+ "JEANNIE",
+ "JEANNINE",
+ "JEFF",
+ "JEFFERSON",
+ "JEFFERY",
+ "JEFFREY",
+ "JEFFRY",
+ "JENIFER",
+ "JENNA",
+ "JENNIE",
+ "JENNIFER",
+ "JENNY",
+ "JERALD",
+ "JEREMIAH",
+ "JEREMY",
+ "JERI",
+ "JERMAINE",
+ "JEROME",
+ "JERRI",
+ "JERRY",
+ "JESS",
+ "JESSE",
+ "JESSICA",
+ "JESSIE",
+ "JESUS",
+ "JEWEL",
+ "JEWELL",
+ "JILL",
+ "JILLIAN",
+ "JIM",
+ "JIMMIE",
+ "JIMMY",
+ "JO",
+ "JOAN",
+ "JOANN",
+ "JOANNA",
+ "JOANNE",
+ "JOAQUIN",
+ "JOCELYN",
+ "JODI",
+ "JODIE",
+ "JODY",
+ "JOE",
+ "JOEL",
+ "JOESPH",
+ "JOEY",
+ "JOHANNA",
+ "JOHN",
+ "JOHNATHAN",
+ "JOHNATHON",
+ "JOHNNIE",
+ "JOHNNY",
+ "JOLENE",
+ "JON",
+ "JONATHAN",
+ "JONATHON",
+ "JONI",
+ "JORDAN",
+ "JORGE",
+ "JOSE",
+ "JOSEFA",
+ "JOSEFINA",
+ "JOSEPH",
+ "JOSEPHINE",
+ "JOSH",
+ "JOSHUA",
+ "JOSIE",
+ "JOSUE",
+ "JOY",
+ "JOYCE",
+ "JUAN",
+ "JUANA",
+ "JUANITA",
+ "JUDI",
+ "JUDITH",
+ "JUDY",
+ "JULIA",
+ "JULIAN",
+ "JULIANA",
+ "JULIANNE",
+ "JULIE",
+ "JULIET",
+ "JULIETTE",
+ "JULIO",
+ "JULIUS",
+ "JUNE",
+ "JUNIOR",
+ "JUSTIN",
+ "JUSTINA",
+ "JUSTINE",
+ "KAITLIN",
+ "KAITLYN",
+ "KARA",
+ "KAREN",
+ "KARI",
+ "KARIN",
+ "KARINA",
+ "KARL",
+ "KARLA",
+ "KARYN",
+ "KASEY",
+ "KATE",
+ "KATELYN",
+ "KATHARINE",
+ "KATHERINE",
+ "KATHERYN",
+ "KATHI",
+ "KATHIE",
+ "KATHLEEN",
+ "KATHRINE",
+ "KATHRYN",
+ "KATHY",
+ "KATIE",
+ "KATINA",
+ "KATRINA",
+ "KATY",
+ "KAY",
+ "KAYE",
+ "KAYLA",
+ "KEISHA",
+ "KEITH",
+ "KELLEY",
+ "KELLI",
+ "KELLIE",
+ "KELLY",
+ "KELSEY",
+ "KELVIN",
+ "KEN",
+ "KENDALL",
+ "KENDRA",
+ "KENDRICK",
+ "KENNETH",
+ "KENNY",
+ "KENT",
+ "KENYA",
+ "KERI",
+ "KERMIT",
+ "KERRI",
+ "KERRY",
+ "KEVIN",
+ "KIM",
+ "KIMBERLEE",
+ "KIMBERLEY",
+ "KIMBERLY",
+ "KIRBY",
+ "KIRK",
+ "KIRSTEN",
+ "KITTY",
+ "KRIS",
+ "KRISTA",
+ "KRISTEN",
+ "KRISTI",
+ "KRISTIE",
+ "KRISTIN",
+ "KRISTINA",
+ "KRISTINE",
+ "KRISTOPHER",
+ "KRISTY",
+ "KRYSTAL",
+ "KURT",
+ "KURTIS",
+ "KYLE",
+ "LACEY",
+ "LACY",
+ "LADONNA",
+ "LAKEISHA",
+ "LAKESHA",
+ "LAKISHA",
+ "LAMAR",
+ "LAMONT",
+ "LANA",
+ "LANCE",
+ "LANDON",
+ "LANE",
+ "LARA",
+ "LARRY",
+ "LASHONDA",
+ "LATANYA",
+ "LATASHA",
+ "LATISHA",
+ "LATONYA",
+ "LATOYA",
+ "LAURA",
+ "LAUREL",
+ "LAUREN",
+ "LAURENCE",
+ "LAURI",
+ "LAURIE",
+ "LAVERNE",
+ "LAVONNE",
+ "LAWANDA",
+ "LAWRENCE",
+ "LEA",
+ "LEAH",
+ "LEANN",
+ "LEANNA",
+ "LEANNE",
+ "LEE",
+ "LEEANN",
+ "LEIGH",
+ "LEILA",
+ "LELA",
+ "LELAND",
+ "LELIA",
+ "LENA",
+ "LENORA",
+ "LENORE",
+ "LEO",
+ "LEOLA",
+ "LEON",
+ "LEONA",
+ "LEONARD",
+ "LEONARDO",
+ "LEONEL",
+ "LEONOR",
+ "LEROY",
+ "LESA",
+ "LESLEY",
+ "LESLIE",
+ "LESSIE",
+ "LESTER",
+ "LETA",
+ "LETHA",
+ "LETICIA",
+ "LETITIA",
+ "LEVI",
+ "LEWIS",
+ "LIBBY",
+ "LIDIA",
+ "LILA",
+ "LILIA",
+ "LILIAN",
+ "LILIANA",
+ "LILLIAN",
+ "LILLIE",
+ "LILLY",
+ "LILY",
+ "LINA",
+ "LINCOLN",
+ "LINDA",
+ "LINDSAY",
+ "LINDSEY",
+ "LINWOOD",
+ "LIONEL",
+ "LISA",
+ "LIZ",
+ "LIZA",
+ "LIZZIE",
+ "LLOYD",
+ "LOGAN",
+ "LOIS",
+ "LOLA",
+ "LOLITA",
+ "LONNIE",
+ "LORA",
+ "LORAINE",
+ "LOREN",
+ "LORENA",
+ "LORENE",
+ "LORENZO",
+ "LORETTA",
+ "LORI",
+ "LORIE",
+ "LORNA",
+ "LORRAINE",
+ "LORRIE",
+ "LOTTIE",
+ "LOU",
+ "LOUELLA",
+ "LOUIE",
+ "LOUIS",
+ "LOUISA",
+ "LOUISE",
+ "LOURDES",
+ "LOWELL",
+ "LOYD",
+ "LUANN",
+ "LUCAS",
+ "LUCIA",
+ "LUCILE",
+ "LUCILLE",
+ "LUCINDA",
+ "LUCY",
+ "LUELLA",
+ "LUIS",
+ "LUISA",
+ "LUKE",
+ "LULA",
+ "LUPE",
+ "LUTHER",
+ "LUZ",
+ "LYDIA",
+ "LYLE",
+ "LYNDA",
+ "LYNETTE",
+ "LYNN",
+ "LYNNE",
+ "LYNNETTE",
+ "MA",
+ "MABEL",
+ "MABLE",
+ "MACK",
+ "MADELEINE",
+ "MADELINE",
+ "MADELYN",
+ "MADGE",
+ "MAE",
+ "MAGDALENA",
+ "MAGGIE",
+ "MAI",
+ "MALCOLM",
+ "MALINDA",
+ "MALLORY",
+ "MAMIE",
+ "MANDY",
+ "MANUEL",
+ "MANUELA",
+ "MARA",
+ "MARC",
+ "MARCEL",
+ "MARCELINO",
+ "MARCELLA",
+ "MARCI",
+ "MARCIA",
+ "MARCIE",
+ "MARCO",
+ "MARCOS",
+ "MARCUS",
+ "MARCY",
+ "MARGARET",
+ "MARGARITA",
+ "MARGERY",
+ "MARGIE",
+ "MARGO",
+ "MARGOT",
+ "MARGRET",
+ "MARGUERITE",
+ "MARI",
+ "MARIA",
+ "MARIAN",
+ "MARIANA",
+ "MARIANNE",
+ "MARIANO",
+ "MARIBEL",
+ "MARICELA",
+ "MARIE",
+ "MARIETTA",
+ "MARILYN",
+ "MARINA",
+ "MARIO",
+ "MARION",
+ "MARISA",
+ "MARISOL",
+ "MARISSA",
+ "MARITZA",
+ "MARJORIE",
+ "MARK",
+ "MARLA",
+ "MARLENE",
+ "MARLIN",
+ "MARLON",
+ "MARQUITA",
+ "MARSHA",
+ "MARSHALL",
+ "MARTA",
+ "MARTHA",
+ "MARTIN",
+ "MARTINA",
+ "MARTY",
+ "MARVA",
+ "MARVIN",
+ "MARY",
+ "MARYANN",
+ "MARYANNE",
+ "MARYELLEN",
+ "MARYLOU",
+ "MASON",
+ "MATHEW",
+ "MATILDA",
+ "MATT",
+ "MATTHEW",
+ "MATTIE",
+ "MAUDE",
+ "MAURA",
+ "MAUREEN",
+ "MAURICE",
+ "MAURICIO",
+ "MAVIS",
+ "MAX",
+ "MAXINE",
+ "MAXWELL",
+ "MAY",
+ "MAYNARD",
+ "MAYRA",
+ "MEAGAN",
+ "MEGAN",
+ "MEGHAN",
+ "MELANIE",
+ "MELBA",
+ "MELINDA",
+ "MELISA",
+ "MELISSA",
+ "MELLISA",
+ "MELODY",
+ "MELVA",
+ "MELVIN",
+ "MERCEDES",
+ "MEREDITH",
+ "MERLE",
+ "MERLIN",
+ "MERRILL",
+ "MIA",
+ "MICAH",
+ "MICHAEL",
+ "MICHAELA",
+ "MICHEAL",
+ "MICHEL",
+ "MICHELE",
+ "MICHELL",
+ "MICHELLE",
+ "MICKEY",
+ "MIGUEL",
+ "MIKE",
+ "MILAGROS",
+ "MILDRED",
+ "MILES",
+ "MILLARD",
+ "MILLICENT",
+ "MILLIE",
+ "MILTON",
+ "MINA",
+ "MINDY",
+ "MINERVA",
+ "MINNIE",
+ "MIRANDA",
+ "MIRIAM",
+ "MISTY",
+ "MITCHELL",
+ "MITZI",
+ "MOHAMMAD",
+ "MOISES",
+ "MOLLIE",
+ "MOLLY",
+ "MONA",
+ "MONICA",
+ "MONIKA",
+ "MONIQUE",
+ "MONROE",
+ "MONTE",
+ "MONTY",
+ "MORGAN",
+ "MORRIS",
+ "MOSES",
+ "MURIEL",
+ "MURRAY",
+ "MYRA",
+ "MYRNA",
+ "MYRON",
+ "MYRTLE",
+ "NADIA",
+ "NADINE",
+ "NAN",
+ "NANCY",
+ "NANETTE",
+ "NANNIE",
+ "NAOMI",
+ "NATALIA",
+ "NATALIE",
+ "NATASHA",
+ "NATHAN",
+ "NATHANIEL",
+ "NEAL",
+ "NED",
+ "NEIL",
+ "NELDA",
+ "NELL",
+ "NELLIE",
+ "NELLY",
+ "NELSON",
+ "NESTOR",
+ "NETTIE",
+ "NEVA",
+ "NICHOLAS",
+ "NICHOLE",
+ "NICK",
+ "NICKOLAS",
+ "NICOLAS",
+ "NICOLE",
+ "NIKKI",
+ "NINA",
+ "NITA",
+ "NOAH",
+ "NOE",
+ "NOEL",
+ "NOELLE",
+ "NOEMI",
+ "NOLA",
+ "NOLAN",
+ "NONA",
+ "NORA",
+ "NORBERT",
+ "NOREEN",
+ "NORMA",
+ "NORMAN",
+ "NORRIS",
+ "NUMBERS",
+ "OCTAVIA",
+ "OCTAVIO",
+ "ODELL",
+ "ODESSA",
+ "OFELIA",
+ "OLA",
+ "OLGA",
+ "OLIVE",
+ "OLIVER",
+ "OLIVIA",
+ "OLLIE",
+ "OMAR",
+ "OPAL",
+ "OPHELIA",
+ "ORA",
+ "ORLANDO",
+ "ORVILLE",
+ "OSCAR",
+ "OTIS",
+ "OTTO",
+ "OWEN",
+ "PABLO",
+ "PAIGE",
+ "PAM",
+ "PAMALA",
+ "PAMELA",
+ "PANSY",
+ "PASQUALE",
+ "PAT",
+ "PATRICA",
+ "PATRICE",
+ "PATRICIA",
+ "PATRICK",
+ "PATSY",
+ "PATTI",
+ "PATTY",
+ "PAUL",
+ "PAULA",
+ "PAULETTE",
+ "PAULINE",
+ "PEARL",
+ "PEARLIE",
+ "PEDRO",
+ "PEGGY",
+ "PENELOPE",
+ "PENNY",
+ "PERCY",
+ "PERRY",
+ "PETE",
+ "PETER",
+ "PETRA",
+ "PHIL",
+ "PHILIP",
+ "PHILLIP",
+ "PHOEBE",
+ "PHYLLIS",
+ "PIERRE",
+ "POLLY",
+ "PRESTON",
+ "PRISCILLA",
+ "QUEEN",
+ "QUENTIN",
+ "QUINCY",
+ "QUINTON",
+ "RACHAEL",
+ "RACHEL",
+ "RACHELLE",
+ "RAE",
+ "RAFAEL",
+ "RALPH",
+ "RAMIRO",
+ "RAMON",
+ "RAMONA",
+ "RANDAL",
+ "RANDALL",
+ "RANDI",
+ "RANDOLPH",
+ "RANDY",
+ "RAPHAEL",
+ "RAQUEL",
+ "RAUL",
+ "RAY",
+ "RAYMOND",
+ "RAYMUNDO",
+ "REBA",
+ "REBECCA",
+ "REBEKAH",
+ "REED",
+ "REGGIE",
+ "REGINA",
+ "REGINALD",
+ "RENA",
+ "RENAE",
+ "RENE",
+ "RENEE",
+ "REUBEN",
+ "REVA",
+ "REX",
+ "REYNA",
+ "REYNALDO",
+ "RHEA",
+ "RHODA",
+ "RHONDA",
+ "RICARDO",
+ "RICHARD",
+ "RICK",
+ "RICKEY",
+ "RICKIE",
+ "RICKY",
+ "RIGOBERTO",
+ "RILEY",
+ "RITA",
+ "ROB",
+ "ROBBIE",
+ "ROBBY",
+ "ROBERT",
+ "ROBERTA",
+ "ROBERTO",
+ "ROBIN",
+ "ROBYN",
+ "ROCCO",
+ "ROCHELLE",
+ "ROCIO",
+ "ROCKY",
+ "ROD",
+ "RODERICK",
+ "RODGER",
+ "RODNEY",
+ "RODOLFO",
+ "RODRIGO",
+ "ROGELIO",
+ "ROGER",
+ "ROLAND",
+ "ROLANDO",
+ "ROMAN",
+ "ROMEO",
+ "RON",
+ "RONALD",
+ "RONDA",
+ "RONNIE",
+ "ROOSEVELT",
+ "RORY",
+ "ROSA",
+ "ROSALIA",
+ "ROSALIE",
+ "ROSALIND",
+ "ROSALINDA",
+ "ROSALYN",
+ "ROSANNA",
+ "ROSANNE",
+ "ROSARIO",
+ "ROSCOE",
+ "ROSE",
+ "ROSEANN",
+ "ROSELLA",
+ "ROSEMARIE",
+ "ROSEMARY",
+ "ROSETTA",
+ "ROSIE",
+ "ROSLYN",
+ "ROSS",
+ "ROWENA",
+ "ROXANNE",
+ "ROXIE",
+ "ROY",
+ "ROYCE",
+ "RUBEN",
+ "RUBY",
+ "RUDOLPH",
+ "RUDY",
+ "RUFUS",
+ "RUSSEL",
+ "RUSSELL",
+ "RUSTY",
+ "RUTH",
+ "RUTHIE",
+ "RYAN",
+ "SABRINA",
+ "SADIE",
+ "SALLIE",
+ "SALLY",
+ "SALVADOR",
+ "SALVATORE",
+ "SAM",
+ "SAMANTHA",
+ "SAMMIE",
+ "SAMMY",
+ "SAMUEL",
+ "SANDRA",
+ "SANDY",
+ "SANFORD",
+ "SANTIAGO",
+ "SANTOS",
+ "SARA",
+ "SARAH",
+ "SASHA",
+ "SAUL",
+ "SAUNDRA",
+ "SAVANNAH",
+ "SCOT",
+ "SCOTT",
+ "SCOTTY",
+ "SEAN",
+ "SEBASTIAN",
+ "SELENA",
+ "SELINA",
+ "SELMA",
+ "SERENA",
+ "SERGIO",
+ "SETH",
+ "SHANA",
+ "SHANE",
+ "SHANNA",
+ "SHANNON",
+ "SHARI",
+ "SHARLENE",
+ "SHARON",
+ "SHARRON",
+ "SHAUN",
+ "SHAUNA",
+ "SHAWN",
+ "SHAWNA",
+ "SHEENA",
+ "SHEILA",
+ "SHELBY",
+ "SHELDON",
+ "SHELIA",
+ "SHELLEY",
+ "SHELLY",
+ "SHELTON",
+ "SHEREE",
+ "SHERI",
+ "SHERMAN",
+ "SHERRI",
+ "SHERRIE",
+ "SHERRY",
+ "SHERYL",
+ "SHIRLEY",
+ "SIDNEY",
+ "SIERRA",
+ "SILAS",
+ "SILVIA",
+ "SIMON",
+ "SIMONE",
+ "SOCORRO",
+ "SOFIA",
+ "SOLOMON",
+ "SON",
+ "SONDRA",
+ "SONIA",
+ "SONJA",
+ "SONNY",
+ "SONYA",
+ "SOPHIA",
+ "SOPHIE",
+ "SPENCER",
+ "STACEY",
+ "STACI",
+ "STACIE",
+ "STACY",
+ "STAN",
+ "STANLEY",
+ "STEFAN",
+ "STEFANIE",
+ "STELLA",
+ "STEPHAN",
+ "STEPHANIE",
+ "STEPHEN",
+ "STERLING",
+ "STEVE",
+ "STEVEN",
+ "STEWART",
+ "STUART",
+ "SUE",
+ "SUMMER",
+ "SUSAN",
+ "SUSANA",
+ "SUSANNA",
+ "SUSANNE",
+ "SUSIE",
+ "SUZANNE",
+ "SUZETTE",
+ "SYBIL",
+ "SYDNEY",
+ "SYLVESTER",
+ "SYLVIA",
+ "TABATHA",
+ "TABITHA",
+ "TAMARA",
+ "TAMEKA",
+ "TAMERA",
+ "TAMI",
+ "TAMIKA",
+ "TAMMI",
+ "TAMMIE",
+ "TAMMY",
+ "TAMRA",
+ "TANIA",
+ "TANISHA",
+ "TANYA",
+ "TARA",
+ "TASHA",
+ "TAYLOR",
+ "TED",
+ "TEDDY",
+ "TERENCE",
+ "TERESA",
+ "TERI",
+ "TERRA",
+ "TERRANCE",
+ "TERRELL",
+ "TERRENCE",
+ "TERRI",
+ "TERRIE",
+ "TERRY",
+ "TESSA",
+ "THADDEUS",
+ "THELMA",
+ "THEODORE",
+ "THERESA",
+ "THERESE",
+ "THERON",
+ "THOMAS",
+ "THURMAN",
+ "TIA",
+ "TIFFANY",
+ "TIM",
+ "TIMMY",
+ "TIMOTHY",
+ "TINA",
+ "TISHA",
+ "TOBY",
+ "TODD",
+ "TOM",
+ "TOMAS",
+ "TOMMIE",
+ "TOMMY",
+ "TONI",
+ "TONIA",
+ "TONY",
+ "TONYA",
+ "TORI",
+ "TRACEY",
+ "TRACI",
+ "TRACIE",
+ "TRACY",
+ "TRAVIS",
+ "TRENT",
+ "TRENTON",
+ "TREVOR",
+ "TRICIA",
+ "TRINA",
+ "TRISHA",
+ "TRISTAN",
+ "TROY",
+ "TRUDY",
+ "TRUMAN",
+ "TWILA",
+ "TY",
+ "TYLER",
+ "TYRONE",
+ "TYSON",
+ "ULYSSES",
+ "URSULA",
+ "VALARIE",
+ "VALERIA",
+ "VALERIE",
+ "VAN",
+ "VANCE",
+ "VANESSA",
+ "VAUGHN",
+ "VELMA",
+ "VERA",
+ "VERN",
+ "VERNA",
+ "VERNON",
+ "VERONICA",
+ "VICENTE",
+ "VICKI",
+ "VICKIE",
+ "VICKY",
+ "VICTOR",
+ "VICTORIA",
+ "VILMA",
+ "VINCE",
+ "VINCENT",
+ "VIOLA",
+ "VIOLET",
+ "VIRGIE",
+ "VIRGIL",
+ "VIRGINIA",
+ "VITO",
+ "VIVIAN",
+ "VONDA",
+ "WADE",
+ "WALLACE",
+ "WALTER",
+ "WANDA",
+ "WARD",
+ "WARREN",
+ "WAYNE",
+ "WELDON",
+ "WENDELL",
+ "WENDI",
+ "WENDY",
+ "WESLEY",
+ "WHITNEY",
+ "WILBERT",
+ "WILBUR",
+ "WILDA",
+ "WILEY",
+ "WILFORD",
+ "WILFRED",
+ "WILFREDO",
+ "WILL",
+ "WILLA",
+ "WILLARD",
+ "WILLIAM",
+ "WILLIAMS",
+ "WILLIE",
+ "WILLIS",
+ "WILMA",
+ "WILMER",
+ "WILSON",
+ "WINFRED",
+ "WINIFRED",
+ "WINNIE",
+ "WINSTON",
+ "WM",
+ "WOODROW",
+ "XAVIER",
+ "YESENIA",
+ "YOLANDA",
+ "YOUNG",
+ "YVETTE",
+ "YVONNE",
+ "ZACHARY",
+ "ZACHERY",
+ "ZELDA",
+ "ZELMA"
+ };
+ }
- private static final String[] generateFirstNames() {
- return new String[] { "AARON", "ABBIE", "ABBY", "ABEL", "ABIGAIL", "ABRAHAM",
- "ADA", "ADAM", "ADAN", "ADDIE", "ADELA", "ADELAIDE", "ADELE", "ADELINE", "ADOLFO", "ADOLPH", "ADRIAN",
- "ADRIANA", "ADRIENNE", "AGNES", "AGUSTIN", "AIDA", "AILEEN", "AIMEE", "AISHA", "AL", "ALAN", "ALANA",
- "ALBA", "ALBERT", "ALBERTA", "ALBERTO", "ALEJANDRA", "ALEJANDRO", "ALEX", "ALEXANDER", "ALEXANDRA",
- "ALEXANDRIA", "ALEXIS", "ALFONSO", "ALFRED", "ALFREDA", "ALFREDO", "ALI", "ALICE", "ALICIA", "ALINE",
- "ALISA", "ALISHA", "ALISON", "ALISSA", "ALLAN", "ALLEN", "ALLENE", "ALLIE", "ALLISON", "ALLYSON", "ALMA",
- "ALONZO", "ALPHONSO", "ALTA", "ALTHEA", "ALTON", "ALVARO", "ALVIN", "ALYCE", "ALYSON", "ALYSSA", "AMALIA",
- "AMANDA", "AMBER", "AMELIA", "AMIE", "AMOS", "AMPARO", "AMY", "ANA", "ANASTASIA", "ANDRE", "ANDREA",
- "ANDRES", "ANDREW", "ANDY", "ANGEL", "ANGELA", "ANGELIA", "ANGELICA", "ANGELINA", "ANGELINE", "ANGELIQUE",
- "ANGELITA", "ANGELO", "ANGIE", "ANITA", "ANN", "ANNA", "ANNABELLE", "ANNE", "ANNETTE", "ANNIE", "ANNMARIE",
- "ANTHONY", "ANTIONETTE", "ANTOINE", "ANTOINETTE", "ANTON", "ANTONIA", "ANTONIO", "ANTONY", "APRIL",
- "ARACELI", "ARCHIE", "ARLENE", "ARLINE", "ARMAND", "ARMANDO", "ARNOLD", "ARRON", "ART", "ARTHUR", "ARTURO",
- "ASHLEE", "ASHLEIGH", "ASHLEY", "AUBREY", "AUDRA", "AUDREY", "AUGUST", "AUGUSTA", "AURELIA", "AURELIO",
- "AURORA", "AUSTIN", "AUTUMN", "AVA", "AVERY", "AVIS", "BARBARA", "BARBRA", "BARNEY", "BARRY", "BART",
- "BASIL", "BEATRICE", "BEATRIZ", "BEAU", "BECKY", "BELINDA", "BEN", "BENITA", "BENITO", "BENJAMIN",
- "BENNETT", "BENNIE", "BENNY", "BERNADETTE", "BERNADINE", "BERNARD", "BERNARDO", "BERNICE", "BERNIE", "BERT",
- "BERTA", "BERTHA", "BERTIE", "BERYL", "BESSIE", "BETH", "BETHANY", "BETSY", "BETTE", "BETTIE", "BETTY",
- "BETTYE", "BEULAH", "BEVERLEY", "BEVERLY", "BIANCA", "BILL", "BILLIE", "BILLY", "BLAINE", "BLAIR", "BLAKE",
- "BLANCA", "BLANCHE", "BOB", "BOBBI", "BOBBIE", "BOBBY", "BONITA", "BONNIE", "BOOKER", "BOYD", "BRAD",
- "BRADFORD", "BRADLEY", "BRADY", "BRAIN", "BRANDEN", "BRANDI", "BRANDIE", "BRANDON", "BRANDY", "BRENDA",
- "BRENDAN", "BRENT", "BRET", "BRETT", "BRIAN", "BRIANA", "BRIANNA", "BRIDGET", "BRIDGETT", "BRIDGETTE",
- "BRIGITTE", "BRITNEY", "BRITTANY", "BRITTNEY", "BROCK", "BROOKE", "BRUCE", "BRUNO", "BRYAN", "BRYANT",
- "BRYCE", "BRYON", "BUDDY", "BUFORD", "BURTON", "BYRON", "CAITLIN", "CALEB", "CALLIE", "CALVIN", "CAMERON",
- "CAMILLA", "CAMILLE", "CANDACE", "CANDICE", "CANDY", "CARA", "CAREY", "CARISSA", "CARL", "CARLA", "CARLENE",
- "CARLO", "CARLOS", "CARLTON", "CARLY", "CARMELA", "CARMELLA", "CARMELO", "CARMEN", "CAROL", "CAROLE",
- "CAROLINA", "CAROLINE", "CAROLYN", "CARRIE", "CARROLL", "CARSON", "CARTER", "CARY", "CARYN", "CASANDRA",
- "CASEY", "CASSANDRA", "CASSIE", "CATALINA", "CATHERINE", "CATHLEEN", "CATHRYN", "CATHY", "CECELIA", "CECIL",
- "CECILE", "CECILIA", "CEDRIC", "CELESTE", "CELIA", "CELINA", "CESAR", "CHAD", "CHANDRA", "CHARITY",
- "CHARLENE", "CHARLES", "CHARLEY", "CHARLIE", "CHARLOTTE", "CHARMAINE", "CHASE", "CHASITY", "CHELSEA",
- "CHELSEY", "CHERI", "CHERIE", "CHERRY", "CHERYL", "CHESTER", "CHRIS", "CHRISTA", "CHRISTI", "CHRISTIAN",
- "CHRISTIE", "CHRISTINA", "CHRISTINE", "CHRISTOPHER", "CHRISTY", "CHRYSTAL", "CHUCK", "CINDY", "CLAIR",
- "CLAIRE", "CLARA", "CLARE", "CLARENCE", "CLARICE", "CLARISSA", "CLARK", "CLAUDE", "CLAUDETTE", "CLAUDIA",
- "CLAUDINE", "CLAY", "CLAYTON", "CLEMENT", "CLEO", "CLEVELAND", "CLIFF", "CLIFFORD", "CLIFTON", "CLINT",
- "CLINTON", "CLYDE", "CODY", "COLBY", "COLE", "COLEEN", "COLETTE", "COLIN", "COLLEEN", "COLLIN",
- "CONCEPCION", "CONCETTA", "CONNIE", "CONRAD", "CONSTANCE", "CONSUELO", "CORA", "COREY", "CORINA", "CORINE",
- "CORINNE", "CORNELIA", "CORNELIUS", "CORNELL", "CORRINE", "CORTNEY", "CORY", "COURTNEY", "COY", "CRAIG",
- "CRISTINA", "CRUZ", "CRYSTAL", "CURT", "CURTIS", "CYNTHIA", "DAISY", "DALE", "DALLAS", "DALTON", "DAMIAN",
- "DAMIEN", "DAMON", "DAN", "DANA", "DANE", "DANIAL", "DANIEL", "DANIELLE", "DANNY", "DANTE", "DAPHNE",
- "DARCY", "DAREN", "DARIN", "DARIUS", "DARLA", "DARLENE", "DARNELL", "DARREL", "DARRELL", "DARREN", "DARRIN",
- "DARRYL", "DARWIN", "DARYL", "DAVE", "DAVID", "DAVIS", "DAWN", "DAYNA", "DEAN", "DEANA", "DEANN", "DEANNA",
- "DEANNE", "DEBBIE", "DEBORA", "DEBORAH", "DEBRA", "DEE", "DEENA", "DEIDRA", "DEIDRE", "DEIRDRE", "DELBERT",
- "DELIA", "DELLA", "DELMAR", "DELORES", "DELORIS", "DEMETRIUS", "DENA", "DENICE", "DENIS", "DENISE",
- "DENNIS", "DENNY", "DENVER", "DEREK", "DERICK", "DERRICK", "DESIREE", "DESMOND", "DESSIE", "DEVIN", "DEVON",
- "DEWAYNE", "DEWEY", "DEXTER", "DIANA", "DIANE", "DIANN", "DIANNA", "DIANNE", "DICK", "DIEGO", "DINA",
- "DION", "DIONNE", "DIRK", "DIXIE", "DOLLIE", "DOLLY", "DOLORES", "DOMINGO", "DOMINIC", "DOMINICK",
- "DOMINIQUE", "DON", "DONA", "DONALD", "DONNA", "DONNELL", "DONNIE", "DONNY", "DONOVAN", "DORA", "DOREEN",
- "DORETHA", "DORIS", "DOROTHEA", "DOROTHY", "DORTHY", "DOUG", "DOUGLAS", "DOYLE", "DREW", "DUANE", "DUDLEY",
- "DUSTIN", "DWAYNE", "DWIGHT", "DYLAN", "EARL", "EARLENE", "EARLINE", "EARNEST", "EARNESTINE", "EBONY", "ED",
- "EDDIE", "EDDY", "EDGAR", "EDITH", "EDMOND", "EDMUND", "EDNA", "EDUARDO", "EDWARD", "EDWARDO", "EDWIN",
- "EDWINA", "EDYTHE", "EFFIE", "EFRAIN", "EILEEN", "ELAINE", "ELBA", "ELBERT", "ELDA", "ELDON", "ELEANOR",
- "ELENA", "ELI", "ELIAS", "ELIJAH", "ELINOR", "ELISA", "ELISABETH", "ELISE", "ELISHA", "ELIZA", "ELIZABETH",
- "ELLA", "ELLEN", "ELLIOT", "ELLIOTT", "ELLIS", "ELMA", "ELMER", "ELNORA", "ELOISE", "ELSA", "ELSIE",
- "ELTON", "ELVA", "ELVIA", "ELVIN", "ELVIRA", "ELVIS", "ELWOOD", "EMANUEL", "EMERSON", "EMERY", "EMIL",
- "EMILIA", "EMILIE", "EMILIO", "EMILY", "EMMA", "EMMANUEL", "EMMETT", "EMORY", "ENID", "ENRIQUE", "ERIC",
- "ERICA", "ERICK", "ERICKA", "ERIK", "ERIKA", "ERIN", "ERMA", "ERNA", "ERNEST", "ERNESTINE", "ERNESTO",
- "ERNIE", "ERROL", "ERVIN", "ERWIN", "ESMERALDA", "ESPERANZA", "ESSIE", "ESTEBAN", "ESTELA", "ESTELLA",
- "ESTELLE", "ESTER", "ESTHER", "ETHAN", "ETHEL", "ETTA", "EUGENE", "EUGENIA", "EULA", "EUNICE", "EVA",
- "EVAN", "EVANGELINA", "EVANGELINE", "EVE", "EVELYN", "EVERETT", "FABIAN", "FAITH", "FANNIE", "FANNY", "FAY",
- "FAYE", "FEDERICO", "FELECIA", "FELICIA", "FELIPE", "FELIX", "FERN", "FERNANDO", "FIDEL", "FLETCHER",
- "FLORA", "FLORENCE", "FLORINE", "FLOSSIE", "FLOYD", "FORREST", "FRAN", "FRANCES", "FRANCESCA", "FRANCINE",
- "FRANCIS", "FRANCISCA", "FRANCISCO", "FRANK", "FRANKIE", "FRANKLIN", "FRED", "FREDA", "FREDDIE", "FREDDY",
- "FREDERIC", "FREDERICK", "FREDRICK", "FREIDA", "FRIEDA", "GABRIEL", "GABRIELA", "GABRIELLE", "GAIL", "GALE",
- "GALEN", "GARLAND", "GARRETT", "GARRY", "GARY", "GAVIN", "GAY", "GAYLA", "GAYLE", "GENA", "GENARO", "GENE",
- "GENEVA", "GENEVIEVE", "GEOFFREY", "GEORGE", "GEORGETTE", "GEORGIA", "GEORGINA", "GERALD", "GERALDINE",
- "GERARD", "GERARDO", "GERI", "GERMAINE", "GERMAN", "GERRY", "GERTRUDE", "GILBERT", "GILBERTO", "GILDA",
- "GINA", "GINGER", "GLADYS", "GLEN", "GLENDA", "GLENN", "GLENNA", "GLORIA", "GOLDIE", "GONZALO", "GORDON",
- "GRACE", "GRACIE", "GRACIELA", "GRADY", "GRAHAM", "GRANT", "GREG", "GREGG", "GREGORIO", "GREGORY", "GRETA",
- "GRETCHEN", "GROVER", "GUADALUPE", "GUILLERMO", "GUS", "GUSSIE", "GUSTAVO", "GUY", "GWEN", "GWENDOLYN",
- "HAL", "HALEY", "HALLIE", "HANNAH", "HANS", "HARLAN", "HARLEY", "HAROLD", "HARRIET", "HARRIETT", "HARRIS",
- "HARRISON", "HARRY", "HARVEY", "HATTIE", "HAZEL", "HEATH", "HEATHER", "HECTOR", "HEIDI", "HELEN", "HELENA",
- "HELENE", "HELGA", "HENRIETTA", "HENRY", "HERBERT", "HERIBERTO", "HERMAN", "HERMINIA", "HESTER", "HILARY",
- "HILDA", "HILLARY", "HIRAM", "HOLLIE", "HOLLIS", "HOLLY", "HOMER", "HOPE", "HORACE", "HOUSTON", "HOWARD",
- "HUBERT", "HUGH", "HUGO", "HUMBERTO", "HUNG", "HUNTER", "IAN", "IDA", "IGNACIO", "ILA", "ILENE", "IMELDA",
- "IMOGENE", "INA", "INES", "INEZ", "INGRID", "IRA", "IRENE", "IRIS", "IRMA", "IRVIN", "IRVING", "IRWIN",
- "ISAAC", "ISABEL", "ISABELLA", "ISABELLE", "ISAIAH", "ISIDRO", "ISMAEL", "ISRAEL", "ISSAC", "IVA", "IVAN",
- "IVY", "JACK", "JACKIE", "JACKLYN", "JACKSON", "JACLYN", "JACOB", "JACQUELINE", "JACQUELYN", "JACQUES",
- "JADE", "JAIME", "JAKE", "JAMAL", "JAME", "JAMES", "JAMI", "JAMIE", "JAN", "JANA", "JANE", "JANELL",
- "JANELLE", "JANET", "JANETTE", "JANICE", "JANIE", "JANINE", "JANIS", "JANNA", "JANNIE", "JARED", "JARROD",
- "JARVIS", "JASMIN", "JASMINE", "JASON", "JASPER", "JAVIER", "JAY", "JAYNE", "JAYSON", "JEAN", "JEANETTE",
- "JEANIE", "JEANINE", "JEANNE", "JEANNETTE", "JEANNIE", "JEANNINE", "JEFF", "JEFFERSON", "JEFFERY",
- "JEFFREY", "JEFFRY", "JENIFER", "JENNA", "JENNIE", "JENNIFER", "JENNY", "JERALD", "JEREMIAH", "JEREMY",
- "JERI", "JERMAINE", "JEROME", "JERRI", "JERRY", "JESS", "JESSE", "JESSICA", "JESSIE", "JESUS", "JEWEL",
- "JEWELL", "JILL", "JILLIAN", "JIM", "JIMMIE", "JIMMY", "JO", "JOAN", "JOANN", "JOANNA", "JOANNE", "JOAQUIN",
- "JOCELYN", "JODI", "JODIE", "JODY", "JOE", "JOEL", "JOESPH", "JOEY", "JOHANNA", "JOHN", "JOHNATHAN",
- "JOHNATHON", "JOHNNIE", "JOHNNY", "JOLENE", "JON", "JONATHAN", "JONATHON", "JONI", "JORDAN", "JORGE",
- "JOSE", "JOSEFA", "JOSEFINA", "JOSEPH", "JOSEPHINE", "JOSH", "JOSHUA", "JOSIE", "JOSUE", "JOY", "JOYCE",
- "JUAN", "JUANA", "JUANITA", "JUDI", "JUDITH", "JUDY", "JULIA", "JULIAN", "JULIANA", "JULIANNE", "JULIE",
- "JULIET", "JULIETTE", "JULIO", "JULIUS", "JUNE", "JUNIOR", "JUSTIN", "JUSTINA", "JUSTINE", "KAITLIN",
- "KAITLYN", "KARA", "KAREN", "KARI", "KARIN", "KARINA", "KARL", "KARLA", "KARYN", "KASEY", "KATE", "KATELYN",
- "KATHARINE", "KATHERINE", "KATHERYN", "KATHI", "KATHIE", "KATHLEEN", "KATHRINE", "KATHRYN", "KATHY",
- "KATIE", "KATINA", "KATRINA", "KATY", "KAY", "KAYE", "KAYLA", "KEISHA", "KEITH", "KELLEY", "KELLI",
- "KELLIE", "KELLY", "KELSEY", "KELVIN", "KEN", "KENDALL", "KENDRA", "KENDRICK", "KENNETH", "KENNY", "KENT",
- "KENYA", "KERI", "KERMIT", "KERRI", "KERRY", "KEVIN", "KIM", "KIMBERLEE", "KIMBERLEY", "KIMBERLY", "KIRBY",
- "KIRK", "KIRSTEN", "KITTY", "KRIS", "KRISTA", "KRISTEN", "KRISTI", "KRISTIE", "KRISTIN", "KRISTINA",
- "KRISTINE", "KRISTOPHER", "KRISTY", "KRYSTAL", "KURT", "KURTIS", "KYLE", "LACEY", "LACY", "LADONNA",
- "LAKEISHA", "LAKESHA", "LAKISHA", "LAMAR", "LAMONT", "LANA", "LANCE", "LANDON", "LANE", "LARA", "LARRY",
- "LASHONDA", "LATANYA", "LATASHA", "LATISHA", "LATONYA", "LATOYA", "LAURA", "LAUREL", "LAUREN", "LAURENCE",
- "LAURI", "LAURIE", "LAVERNE", "LAVONNE", "LAWANDA", "LAWRENCE", "LEA", "LEAH", "LEANN", "LEANNA", "LEANNE",
- "LEE", "LEEANN", "LEIGH", "LEILA", "LELA", "LELAND", "LELIA", "LENA", "LENORA", "LENORE", "LEO", "LEOLA",
- "LEON", "LEONA", "LEONARD", "LEONARDO", "LEONEL", "LEONOR", "LEROY", "LESA", "LESLEY", "LESLIE", "LESSIE",
- "LESTER", "LETA", "LETHA", "LETICIA", "LETITIA", "LEVI", "LEWIS", "LIBBY", "LIDIA", "LILA", "LILIA",
- "LILIAN", "LILIANA", "LILLIAN", "LILLIE", "LILLY", "LILY", "LINA", "LINCOLN", "LINDA", "LINDSAY", "LINDSEY",
- "LINWOOD", "LIONEL", "LISA", "LIZ", "LIZA", "LIZZIE", "LLOYD", "LOGAN", "LOIS", "LOLA", "LOLITA", "LONNIE",
- "LORA", "LORAINE", "LOREN", "LORENA", "LORENE", "LORENZO", "LORETTA", "LORI", "LORIE", "LORNA", "LORRAINE",
- "LORRIE", "LOTTIE", "LOU", "LOUELLA", "LOUIE", "LOUIS", "LOUISA", "LOUISE", "LOURDES", "LOWELL", "LOYD",
- "LUANN", "LUCAS", "LUCIA", "LUCILE", "LUCILLE", "LUCINDA", "LUCY", "LUELLA", "LUIS", "LUISA", "LUKE",
- "LULA", "LUPE", "LUTHER", "LUZ", "LYDIA", "LYLE", "LYNDA", "LYNETTE", "LYNN", "LYNNE", "LYNNETTE", "MA",
- "MABEL", "MABLE", "MACK", "MADELEINE", "MADELINE", "MADELYN", "MADGE", "MAE", "MAGDALENA", "MAGGIE", "MAI",
- "MALCOLM", "MALINDA", "MALLORY", "MAMIE", "MANDY", "MANUEL", "MANUELA", "MARA", "MARC", "MARCEL",
- "MARCELINO", "MARCELLA", "MARCI", "MARCIA", "MARCIE", "MARCO", "MARCOS", "MARCUS", "MARCY", "MARGARET",
- "MARGARITA", "MARGERY", "MARGIE", "MARGO", "MARGOT", "MARGRET", "MARGUERITE", "MARI", "MARIA", "MARIAN",
- "MARIANA", "MARIANNE", "MARIANO", "MARIBEL", "MARICELA", "MARIE", "MARIETTA", "MARILYN", "MARINA", "MARIO",
- "MARION", "MARISA", "MARISOL", "MARISSA", "MARITZA", "MARJORIE", "MARK", "MARLA", "MARLENE", "MARLIN",
- "MARLON", "MARQUITA", "MARSHA", "MARSHALL", "MARTA", "MARTHA", "MARTIN", "MARTINA", "MARTY", "MARVA",
- "MARVIN", "MARY", "MARYANN", "MARYANNE", "MARYELLEN", "MARYLOU", "MASON", "MATHEW", "MATILDA", "MATT",
- "MATTHEW", "MATTIE", "MAUDE", "MAURA", "MAUREEN", "MAURICE", "MAURICIO", "MAVIS", "MAX", "MAXINE",
- "MAXWELL", "MAY", "MAYNARD", "MAYRA", "MEAGAN", "MEGAN", "MEGHAN", "MELANIE", "MELBA", "MELINDA", "MELISA",
- "MELISSA", "MELLISA", "MELODY", "MELVA", "MELVIN", "MERCEDES", "MEREDITH", "MERLE", "MERLIN", "MERRILL",
- "MIA", "MICAH", "MICHAEL", "MICHAELA", "MICHEAL", "MICHEL", "MICHELE", "MICHELL", "MICHELLE", "MICKEY",
- "MIGUEL", "MIKE", "MILAGROS", "MILDRED", "MILES", "MILLARD", "MILLICENT", "MILLIE", "MILTON", "MINA",
- "MINDY", "MINERVA", "MINNIE", "MIRANDA", "MIRIAM", "MISTY", "MITCHELL", "MITZI", "MOHAMMAD", "MOISES",
- "MOLLIE", "MOLLY", "MONA", "MONICA", "MONIKA", "MONIQUE", "MONROE", "MONTE", "MONTY", "MORGAN", "MORRIS",
- "MOSES", "MURIEL", "MURRAY", "MYRA", "MYRNA", "MYRON", "MYRTLE", "NADIA", "NADINE", "NAN", "NANCY",
- "NANETTE", "NANNIE", "NAOMI", "NATALIA", "NATALIE", "NATASHA", "NATHAN", "NATHANIEL", "NEAL", "NED", "NEIL",
- "NELDA", "NELL", "NELLIE", "NELLY", "NELSON", "NESTOR", "NETTIE", "NEVA", "NICHOLAS", "NICHOLE", "NICK",
- "NICKOLAS", "NICOLAS", "NICOLE", "NIKKI", "NINA", "NITA", "NOAH", "NOE", "NOEL", "NOELLE", "NOEMI", "NOLA",
- "NOLAN", "NONA", "NORA", "NORBERT", "NOREEN", "NORMA", "NORMAN", "NORRIS", "NUMBERS", "OCTAVIA", "OCTAVIO",
- "ODELL", "ODESSA", "OFELIA", "OLA", "OLGA", "OLIVE", "OLIVER", "OLIVIA", "OLLIE", "OMAR", "OPAL", "OPHELIA",
- "ORA", "ORLANDO", "ORVILLE", "OSCAR", "OTIS", "OTTO", "OWEN", "PABLO", "PAIGE", "PAM", "PAMALA", "PAMELA",
- "PANSY", "PASQUALE", "PAT", "PATRICA", "PATRICE", "PATRICIA", "PATRICK", "PATSY", "PATTI", "PATTY", "PAUL",
- "PAULA", "PAULETTE", "PAULINE", "PEARL", "PEARLIE", "PEDRO", "PEGGY", "PENELOPE", "PENNY", "PERCY", "PERRY",
- "PETE", "PETER", "PETRA", "PHIL", "PHILIP", "PHILLIP", "PHOEBE", "PHYLLIS", "PIERRE", "POLLY", "PRESTON",
- "PRISCILLA", "QUEEN", "QUENTIN", "QUINCY", "QUINTON", "RACHAEL", "RACHEL", "RACHELLE", "RAE", "RAFAEL",
- "RALPH", "RAMIRO", "RAMON", "RAMONA", "RANDAL", "RANDALL", "RANDI", "RANDOLPH", "RANDY", "RAPHAEL",
- "RAQUEL", "RAUL", "RAY", "RAYMOND", "RAYMUNDO", "REBA", "REBECCA", "REBEKAH", "REED", "REGGIE", "REGINA",
- "REGINALD", "RENA", "RENAE", "RENE", "RENEE", "REUBEN", "REVA", "REX", "REYNA", "REYNALDO", "RHEA", "RHODA",
- "RHONDA", "RICARDO", "RICHARD", "RICK", "RICKEY", "RICKIE", "RICKY", "RIGOBERTO", "RILEY", "RITA", "ROB",
- "ROBBIE", "ROBBY", "ROBERT", "ROBERTA", "ROBERTO", "ROBIN", "ROBYN", "ROCCO", "ROCHELLE", "ROCIO", "ROCKY",
- "ROD", "RODERICK", "RODGER", "RODNEY", "RODOLFO", "RODRIGO", "ROGELIO", "ROGER", "ROLAND", "ROLANDO",
- "ROMAN", "ROMEO", "RON", "RONALD", "RONDA", "RONNIE", "ROOSEVELT", "RORY", "ROSA", "ROSALIA", "ROSALIE",
- "ROSALIND", "ROSALINDA", "ROSALYN", "ROSANNA", "ROSANNE", "ROSARIO", "ROSCOE", "ROSE", "ROSEANN", "ROSELLA",
- "ROSEMARIE", "ROSEMARY", "ROSETTA", "ROSIE", "ROSLYN", "ROSS", "ROWENA", "ROXANNE", "ROXIE", "ROY", "ROYCE",
- "RUBEN", "RUBY", "RUDOLPH", "RUDY", "RUFUS", "RUSSEL", "RUSSELL", "RUSTY", "RUTH", "RUTHIE", "RYAN",
- "SABRINA", "SADIE", "SALLIE", "SALLY", "SALVADOR", "SALVATORE", "SAM", "SAMANTHA", "SAMMIE", "SAMMY",
- "SAMUEL", "SANDRA", "SANDY", "SANFORD", "SANTIAGO", "SANTOS", "SARA", "SARAH", "SASHA", "SAUL", "SAUNDRA",
- "SAVANNAH", "SCOT", "SCOTT", "SCOTTY", "SEAN", "SEBASTIAN", "SELENA", "SELINA", "SELMA", "SERENA", "SERGIO",
- "SETH", "SHANA", "SHANE", "SHANNA", "SHANNON", "SHARI", "SHARLENE", "SHARON", "SHARRON", "SHAUN", "SHAUNA",
- "SHAWN", "SHAWNA", "SHEENA", "SHEILA", "SHELBY", "SHELDON", "SHELIA", "SHELLEY", "SHELLY", "SHELTON",
- "SHEREE", "SHERI", "SHERMAN", "SHERRI", "SHERRIE", "SHERRY", "SHERYL", "SHIRLEY", "SIDNEY", "SIERRA",
- "SILAS", "SILVIA", "SIMON", "SIMONE", "SOCORRO", "SOFIA", "SOLOMON", "SON", "SONDRA", "SONIA", "SONJA",
- "SONNY", "SONYA", "SOPHIA", "SOPHIE", "SPENCER", "STACEY", "STACI", "STACIE", "STACY", "STAN", "STANLEY",
- "STEFAN", "STEFANIE", "STELLA", "STEPHAN", "STEPHANIE", "STEPHEN", "STERLING", "STEVE", "STEVEN", "STEWART",
- "STUART", "SUE", "SUMMER", "SUSAN", "SUSANA", "SUSANNA", "SUSANNE", "SUSIE", "SUZANNE", "SUZETTE", "SYBIL",
- "SYDNEY", "SYLVESTER", "SYLVIA", "TABATHA", "TABITHA", "TAMARA", "TAMEKA", "TAMERA", "TAMI", "TAMIKA",
- "TAMMI", "TAMMIE", "TAMMY", "TAMRA", "TANIA", "TANISHA", "TANYA", "TARA", "TASHA", "TAYLOR", "TED", "TEDDY",
- "TERENCE", "TERESA", "TERI", "TERRA", "TERRANCE", "TERRELL", "TERRENCE", "TERRI", "TERRIE", "TERRY",
- "TESSA", "THADDEUS", "THELMA", "THEODORE", "THERESA", "THERESE", "THERON", "THOMAS", "THURMAN", "TIA",
- "TIFFANY", "TIM", "TIMMY", "TIMOTHY", "TINA", "TISHA", "TOBY", "TODD", "TOM", "TOMAS", "TOMMIE", "TOMMY",
- "TONI", "TONIA", "TONY", "TONYA", "TORI", "TRACEY", "TRACI", "TRACIE", "TRACY", "TRAVIS", "TRENT",
- "TRENTON", "TREVOR", "TRICIA", "TRINA", "TRISHA", "TRISTAN", "TROY", "TRUDY", "TRUMAN", "TWILA", "TY",
- "TYLER", "TYRONE", "TYSON", "ULYSSES", "URSULA", "VALARIE", "VALERIA", "VALERIE", "VAN", "VANCE", "VANESSA",
- "VAUGHN", "VELMA", "VERA", "VERN", "VERNA", "VERNON", "VERONICA", "VICENTE", "VICKI", "VICKIE", "VICKY",
- "VICTOR", "VICTORIA", "VILMA", "VINCE", "VINCENT", "VIOLA", "VIOLET", "VIRGIE", "VIRGIL", "VIRGINIA",
- "VITO", "VIVIAN", "VONDA", "WADE", "WALLACE", "WALTER", "WANDA", "WARD", "WARREN", "WAYNE", "WELDON",
- "WENDELL", "WENDI", "WENDY", "WESLEY", "WHITNEY", "WILBERT", "WILBUR", "WILDA", "WILEY", "WILFORD",
- "WILFRED", "WILFREDO", "WILL", "WILLA", "WILLARD", "WILLIAM", "WILLIAMS", "WILLIE", "WILLIS", "WILMA",
- "WILMER", "WILSON", "WINFRED", "WINIFRED", "WINNIE", "WINSTON", "WM", "WOODROW", "XAVIER", "YESENIA",
- "YOLANDA", "YOUNG", "YVETTE", "YVONNE", "ZACHARY", "ZACHERY", "ZELDA", "ZELMA" };
- }
+ private static final String[] generateLastNames() {
+ return new String[] {
+ "AARON",
+ "ABBOTT",
+ "ABEL",
+ "ABELL",
+ "ABERNATHY",
+ "ABNER",
+ "ABNEY",
+ "ABRAHAM",
+ "ABRAMS",
+ "ABREU",
+ "ACEVEDO",
+ "ACKER",
+ "ACKERMAN",
+ "ACKLEY",
+ "ACOSTA",
+ "ACUNA",
+ "ADAIR",
+ "ADAM",
+ "ADAME",
+ "ADAMS",
+ "ADAMSON",
+ "ADCOCK",
+ "ADDISON",
+ "ADKINS",
+ "ADLER",
+ "AGEE",
+ "AGNEW",
+ "AGUAYO",
+ "AGUIAR",
+ "AGUILAR",
+ "AGUILERA",
+ "AGUIRRE",
+ "AHERN",
+ "AHMAD",
+ "AHMED",
+ "AHRENS",
+ "AIELLO",
+ "AIKEN",
+ "AINSWORTH",
+ "AKERS",
+ "AKIN",
+ "AKINS",
+ "ALANIZ",
+ "ALARCON",
+ "ALBA",
+ "ALBERS",
+ "ALBERT",
+ "ALBERTSON",
+ "ALBRECHT",
+ "ALBRIGHT",
+ "ALCALA",
+ "ALCORN",
+ "ALDERMAN",
+ "ALDRICH",
+ "ALDRIDGE",
+ "ALEMAN",
+ "ALEXANDER",
+ "ALFARO",
+ "ALFONSO",
+ "ALFORD",
+ "ALFRED",
+ "ALGER",
+ "ALI",
+ "ALICEA",
+ "ALLAN",
+ "ALLARD",
+ "ALLEN",
+ "ALLEY",
+ "ALLISON",
+ "ALLMAN",
+ "ALLRED",
+ "ALMANZA",
+ "ALMEIDA",
+ "ALMOND",
+ "ALONSO",
+ "ALONZO",
+ "ALSTON",
+ "ALTMAN",
+ "ALVARADO",
+ "ALVAREZ",
+ "ALVES",
+ "AMADOR",
+ "AMARAL",
+ "AMATO",
+ "AMAYA",
+ "AMBROSE",
+ "AMES",
+ "AMMONS",
+ "AMOS",
+ "AMUNDSON",
+ "ANAYA",
+ "ANDERS",
+ "ANDERSEN",
+ "ANDERSON",
+ "ANDRADE",
+ "ANDRE",
+ "ANDRES",
+ "ANDREW",
+ "ANDREWS",
+ "ANDRUS",
+ "ANGEL",
+ "ANGELO",
+ "ANGLIN",
+ "ANGULO",
+ "ANTHONY",
+ "ANTOINE",
+ "ANTONIO",
+ "APODACA",
+ "APONTE",
+ "APPEL",
+ "APPLE",
+ "APPLEGATE",
+ "APPLETON",
+ "AQUINO",
+ "ARAGON",
+ "ARANDA",
+ "ARAUJO",
+ "ARCE",
+ "ARCHER",
+ "ARCHIBALD",
+ "ARCHIE",
+ "ARCHULETA",
+ "ARELLANO",
+ "AREVALO",
+ "ARIAS",
+ "ARMENTA",
+ "ARMIJO",
+ "ARMSTEAD",
+ "ARMSTRONG",
+ "ARNDT",
+ "ARNETT",
+ "ARNOLD",
+ "ARREDONDO",
+ "ARREOLA",
+ "ARRIAGA",
+ "ARRINGTON",
+ "ARROYO",
+ "ARSENAULT",
+ "ARTEAGA",
+ "ARTHUR",
+ "ARTIS",
+ "ASBURY",
+ "ASH",
+ "ASHBY",
+ "ASHCRAFT",
+ "ASHE",
+ "ASHER",
+ "ASHFORD",
+ "ASHLEY",
+ "ASHMORE",
+ "ASHTON",
+ "ASHWORTH",
+ "ASKEW",
+ "ATCHISON",
+ "ATHERTON",
+ "ATKINS",
+ "ATKINSON",
+ "ATWELL",
+ "ATWOOD",
+ "AUGUST",
+ "AUGUSTINE",
+ "AULT",
+ "AUSTIN",
+ "AUTRY",
+ "AVALOS",
+ "AVERY",
+ "AVILA",
+ "AVILES",
+ "AYALA",
+ "AYERS",
+ "AYRES",
+ "BABB",
+ "BABCOCK",
+ "BABIN",
+ "BACA",
+ "BACH",
+ "BACHMAN",
+ "BACK",
+ "BACON",
+ "BADER",
+ "BADGER",
+ "BADILLO",
+ "BAER",
+ "BAEZ",
+ "BAGGETT",
+ "BAGLEY",
+ "BAGWELL",
+ "BAILEY",
+ "BAIN",
+ "BAINES",
+ "BAIR",
+ "BAIRD",
+ "BAKER",
+ "BALDERAS",
+ "BALDWIN",
+ "BALES",
+ "BALL",
+ "BALLARD",
+ "BANDA",
+ "BANDY",
+ "BANKS",
+ "BANKSTON",
+ "BANNISTER",
+ "BANUELOS",
+ "BAPTISTE",
+ "BARAJAS",
+ "BARBA",
+ "BARBEE",
+ "BARBER",
+ "BARBOSA",
+ "BARBOUR",
+ "BARCLAY",
+ "BARDEN",
+ "BARELA",
+ "BARFIELD",
+ "BARGER",
+ "BARHAM",
+ "BARKER",
+ "BARKLEY",
+ "BARKSDALE",
+ "BARLOW",
+ "BARNARD",
+ "BARNES",
+ "BARNETT",
+ "BARNETTE",
+ "BARNEY",
+ "BARNHART",
+ "BARNHILL",
+ "BARON",
+ "BARONE",
+ "BARR",
+ "BARRAZA",
+ "BARRERA",
+ "BARRETO",
+ "BARRETT",
+ "BARRIENTOS",
+ "BARRIOS",
+ "BARRON",
+ "BARROW",
+ "BARROWS",
+ "BARRY",
+ "BARTELS",
+ "BARTH",
+ "BARTHOLOMEW",
+ "BARTLETT",
+ "BARTLEY",
+ "BARTON",
+ "BASHAM",
+ "BASKIN",
+ "BASS",
+ "BASSETT",
+ "BATCHELOR",
+ "BATEMAN",
+ "BATES",
+ "BATISTA",
+ "BATISTE",
+ "BATSON",
+ "BATTAGLIA",
+ "BATTEN",
+ "BATTLE",
+ "BATTLES",
+ "BATTS",
+ "BAUER",
+ "BAUGH",
+ "BAUGHMAN",
+ "BAUM",
+ "BAUMAN",
+ "BAUMANN",
+ "BAUMGARDNER",
+ "BAUMGARTNER",
+ "BAUTISTA",
+ "BAXLEY",
+ "BAXTER",
+ "BAYER",
+ "BAYLOR",
+ "BAYNE",
+ "BAYS",
+ "BEACH",
+ "BEAL",
+ "BEALE",
+ "BEALL",
+ "BEALS",
+ "BEAM",
+ "BEAMON",
+ "BEAN",
+ "BEANE",
+ "BEAR",
+ "BEARD",
+ "BEARDEN",
+ "BEASLEY",
+ "BEATTIE",
+ "BEATTY",
+ "BEATY",
+ "BEAUCHAMP",
+ "BEAUDOIN",
+ "BEAULIEU",
+ "BEAUREGARD",
+ "BEAVER",
+ "BEAVERS",
+ "BECERRA",
+ "BECK",
+ "BECKER",
+ "BECKETT",
+ "BECKHAM",
+ "BECKMAN",
+ "BECKWITH",
+ "BECNEL",
+ "BEDARD",
+ "BEDFORD",
+ "BEEBE",
+ "BEELER",
+ "BEERS",
+ "BEESON",
+ "BEGAY",
+ "BEGLEY",
+ "BEHRENS",
+ "BELANGER",
+ "BELCHER",
+ "BELL",
+ "BELLAMY",
+ "BELLO",
+ "BELT",
+ "BELTON",
+ "BELTRAN",
+ "BENAVIDES",
+ "BENAVIDEZ",
+ "BENDER",
+ "BENEDICT",
+ "BENEFIELD",
+ "BENITEZ",
+ "BENJAMIN",
+ "BENNER",
+ "BENNETT",
+ "BENOIT",
+ "BENSON",
+ "BENTLEY",
+ "BENTON",
+ "BERG",
+ "BERGER",
+ "BERGERON",
+ "BERGMAN",
+ "BERGSTROM",
+ "BERLIN",
+ "BERMAN",
+ "BERMUDEZ",
+ "BERNAL",
+ "BERNARD",
+ "BERNHARDT",
+ "BERNIER",
+ "BERNSTEIN",
+ "BERRIOS",
+ "BERRY",
+ "BERRYMAN",
+ "BERTRAM",
+ "BERTRAND",
+ "BERUBE",
+ "BESS",
+ "BEST",
+ "BETANCOURT",
+ "BETHEA",
+ "BETHEL",
+ "BETTS",
+ "BETZ",
+ "BEVERLY",
+ "BEVINS",
+ "BEYER",
+ "BIBLE",
+ "BICKFORD",
+ "BIDDLE",
+ "BIGELOW",
+ "BIGGS",
+ "BILLINGS",
+ "BILLINGSLEY",
+ "BILLIOT",
+ "BILLS",
+ "BILLUPS",
+ "BILODEAU",
+ "BINDER",
+ "BINGHAM",
+ "BINKLEY",
+ "BIRCH",
+ "BIRD",
+ "BISHOP",
+ "BISSON",
+ "BITTNER",
+ "BIVENS",
+ "BIVINS",
+ "BLACK",
+ "BLACKBURN",
+ "BLACKMAN",
+ "BLACKMON",
+ "BLACKWELL",
+ "BLACKWOOD",
+ "BLAINE",
+ "BLAIR",
+ "BLAIS",
+ "BLAKE",
+ "BLAKELY",
+ "BLALOCK",
+ "BLANCHARD",
+ "BLANCHETTE",
+ "BLANCO",
+ "BLAND",
+ "BLANK",
+ "BLANKENSHIP",
+ "BLANTON",
+ "BLAYLOCK",
+ "BLEDSOE",
+ "BLEVINS",
+ "BLISS",
+ "BLOCK",
+ "BLOCKER",
+ "BLODGETT",
+ "BLOOM",
+ "BLOUNT",
+ "BLUE",
+ "BLUM",
+ "BLUNT",
+ "BLYTHE",
+ "BOATRIGHT",
+ "BOATWRIGHT",
+ "BOBBITT",
+ "BOBO",
+ "BOCK",
+ "BOEHM",
+ "BOETTCHER",
+ "BOGAN",
+ "BOGGS",
+ "BOHANNON",
+ "BOHN",
+ "BOISVERT",
+ "BOLAND",
+ "BOLDEN",
+ "BOLDUC",
+ "BOLEN",
+ "BOLES",
+ "BOLIN",
+ "BOLING",
+ "BOLLING",
+ "BOLLINGER",
+ "BOLT",
+ "BOLTON",
+ "BOND",
+ "BONDS",
+ "BONE",
+ "BONILLA",
+ "BONNER",
+ "BOOKER",
+ "BOONE",
+ "BOOTH",
+ "BOOTHE",
+ "BORDELON",
+ "BORDEN",
+ "BORDERS",
+ "BOREN",
+ "BORGES",
+ "BORREGO",
+ "BOSS",
+ "BOSTIC",
+ "BOSTICK",
+ "BOSTON",
+ "BOSWELL",
+ "BOTTOMS",
+ "BOUCHARD",
+ "BOUCHER",
+ "BOUDREAU",
+ "BOUDREAUX",
+ "BOUNDS",
+ "BOURGEOIS",
+ "BOURNE",
+ "BOURQUE",
+ "BOWDEN",
+ "BOWEN",
+ "BOWENS",
+ "BOWER",
+ "BOWERS",
+ "BOWIE",
+ "BOWLES",
+ "BOWLIN",
+ "BOWLING",
+ "BOWMAN",
+ "BOWSER",
+ "BOX",
+ "BOYCE",
+ "BOYD",
+ "BOYER",
+ "BOYKIN",
+ "BOYLE",
+ "BOYLES",
+ "BOYNTON",
+ "BOZEMAN",
+ "BRACKEN",
+ "BRACKETT",
+ "BRADBURY",
+ "BRADEN",
+ "BRADFORD",
+ "BRADLEY",
+ "BRADSHAW",
+ "BRADY",
+ "BRAGG",
+ "BRANCH",
+ "BRAND",
+ "BRANDENBURG",
+ "BRANDON",
+ "BRANDT",
+ "BRANHAM",
+ "BRANNON",
+ "BRANSON",
+ "BRANT",
+ "BRANTLEY",
+ "BRASWELL",
+ "BRATCHER",
+ "BRATTON",
+ "BRAUN",
+ "BRAVO",
+ "BRAXTON",
+ "BRAY",
+ "BRAZIL",
+ "BREAUX",
+ "BREEDEN",
+ "BREEDLOVE",
+ "BREEN",
+ "BRENNAN",
+ "BRENNER",
+ "BRENT",
+ "BREWER",
+ "BREWSTER",
+ "BRICE",
+ "BRIDGES",
+ "BRIGGS",
+ "BRIGHT",
+ "BRILEY",
+ "BRILL",
+ "BRIM",
+ "BRINK",
+ "BRINKLEY",
+ "BRINKMAN",
+ "BRINSON",
+ "BRIONES",
+ "BRISCOE",
+ "BRISENO",
+ "BRITO",
+ "BRITT",
+ "BRITTAIN",
+ "BRITTON",
+ "BROADNAX",
+ "BROADWAY",
+ "BROCK",
+ "BROCKMAN",
+ "BRODERICK",
+ "BRODY",
+ "BROGAN",
+ "BRONSON",
+ "BROOKINS",
+ "BROOKS",
+ "BROOME",
+ "BROTHERS",
+ "BROUGHTON",
+ "BROUSSARD",
+ "BROWDER",
+ "BROWER",
+ "BROWN",
+ "BROWNE",
+ "BROWNELL",
+ "BROWNING",
+ "BROWNLEE",
+ "BROYLES",
+ "BRUBAKER",
+ "BRUCE",
+ "BRUMFIELD",
+ "BRUNER",
+ "BRUNNER",
+ "BRUNO",
+ "BRUNS",
+ "BRUNSON",
+ "BRUTON",
+ "BRYAN",
+ "BRYANT",
+ "BRYSON",
+ "BUCHANAN",
+ "BUCHER",
+ "BUCK",
+ "BUCKINGHAM",
+ "BUCKLEY",
+ "BUCKNER",
+ "BUENO",
+ "BUFFINGTON",
+ "BUFORD",
+ "BUI",
+ "BULL",
+ "BULLARD",
+ "BULLOCK",
+ "BUMGARNER",
+ "BUNCH",
+ "BUNDY",
+ "BUNKER",
+ "BUNN",
+ "BUNNELL",
+ "BUNTING",
+ "BURCH",
+ "BURCHETT",
+ "BURCHFIELD",
+ "BURDEN",
+ "BURDETTE",
+ "BURDICK",
+ "BURGE",
+ "BURGER",
+ "BURGESS",
+ "BURGOS",
+ "BURK",
+ "BURKE",
+ "BURKETT",
+ "BURKHART",
+ "BURKHOLDER",
+ "BURKS",
+ "BURLESON",
+ "BURLEY",
+ "BURNETT",
+ "BURNETTE",
+ "BURNEY",
+ "BURNHAM",
+ "BURNS",
+ "BURNSIDE",
+ "BURR",
+ "BURRELL",
+ "BURRIS",
+ "BURROUGHS",
+ "BURROW",
+ "BURROWS",
+ "BURT",
+ "BURTON",
+ "BUSBY",
+ "BUSCH",
+ "BUSH",
+ "BUSS",
+ "BUSSEY",
+ "BUSTAMANTE",
+ "BUSTOS",
+ "BUTCHER",
+ "BUTLER",
+ "BUTTERFIELD",
+ "BUTTON",
+ "BUTTS",
+ "BUXTON",
+ "BYARS",
+ "BYERS",
+ "BYNUM",
+ "BYRD",
+ "BYRNE",
+ "BYRNES",
+ "CABALLERO",
+ "CABAN",
+ "CABLE",
+ "CABRAL",
+ "CABRERA",
+ "CADE",
+ "CADY",
+ "CAGLE",
+ "CAHILL",
+ "CAIN",
+ "CALABRESE",
+ "CALDERON",
+ "CALDWELL",
+ "CALHOUN",
+ "CALKINS",
+ "CALL",
+ "CALLAGHAN",
+ "CALLAHAN",
+ "CALLAWAY",
+ "CALLENDER",
+ "CALLOWAY",
+ "CALVERT",
+ "CALVIN",
+ "CAMACHO",
+ "CAMARILLO",
+ "CAMBELL",
+ "CAMERON",
+ "CAMP",
+ "CAMPBELL",
+ "CAMPOS",
+ "CANADA",
+ "CANADY",
+ "CANALES",
+ "CANDELARIA",
+ "CANFIELD",
+ "CANNON",
+ "CANO",
+ "CANTRELL",
+ "CANTU",
+ "CANTWELL",
+ "CANTY",
+ "CAPPS",
+ "CARABALLO",
+ "CARAWAY",
+ "CARBAJAL",
+ "CARBONE",
+ "CARD",
+ "CARDEN",
+ "CARDENAS",
+ "CARDER",
+ "CARDONA",
+ "CARDOZA",
+ "CARDWELL",
+ "CAREY",
+ "CARL",
+ "CARLIN",
+ "CARLISLE",
+ "CARLOS",
+ "CARLSON",
+ "CARLTON",
+ "CARMAN",
+ "CARMICHAEL",
+ "CARMONA",
+ "CARNAHAN",
+ "CARNES",
+ "CARNEY",
+ "CARO",
+ "CARON",
+ "CARPENTER",
+ "CARR",
+ "CARRANZA",
+ "CARRASCO",
+ "CARRERA",
+ "CARRICO",
+ "CARRIER",
+ "CARRILLO",
+ "CARRINGTON",
+ "CARRION",
+ "CARROLL",
+ "CARSON",
+ "CARSWELL",
+ "CARTER",
+ "CARTWRIGHT",
+ "CARUSO",
+ "CARVALHO",
+ "CARVER",
+ "CARY",
+ "CASAS",
+ "CASE",
+ "CASEY",
+ "CASH",
+ "CASILLAS",
+ "CASKEY",
+ "CASON",
+ "CASPER",
+ "CASS",
+ "CASSELL",
+ "CASSIDY",
+ "CASTANEDA",
+ "CASTEEL",
+ "CASTELLANO",
+ "CASTELLANOS",
+ "CASTILLO",
+ "CASTLE",
+ "CASTLEBERRY",
+ "CASTRO",
+ "CASWELL",
+ "CATALANO",
+ "CATES",
+ "CATHEY",
+ "CATO",
+ "CATRON",
+ "CAUDILL",
+ "CAUDLE",
+ "CAUSEY",
+ "CAVANAUGH",
+ "CAVAZOS",
+ "CAVE",
+ "CECIL",
+ "CENTENO",
+ "CERDA",
+ "CERVANTES",
+ "CHACON",
+ "CHADWICK",
+ "CHAFFIN",
+ "CHALMERS",
+ "CHAMBERLAIN",
+ "CHAMBERLIN",
+ "CHAMBERS",
+ "CHAMBLISS",
+ "CHAMPAGNE",
+ "CHAMPION",
+ "CHAN",
+ "CHANCE",
+ "CHANDLER",
+ "CHANEY",
+ "CHANG",
+ "CHAPA",
+ "CHAPIN",
+ "CHAPMAN",
+ "CHAPPELL",
+ "CHARLES",
+ "CHARLTON",
+ "CHASE",
+ "CHASTAIN",
+ "CHATMAN",
+ "CHAU",
+ "CHAVARRIA",
+ "CHAVES",
+ "CHAVEZ",
+ "CHAVIS",
+ "CHEATHAM",
+ "CHEEK",
+ "CHEN",
+ "CHENEY",
+ "CHENG",
+ "CHERRY",
+ "CHESSER",
+ "CHESTER",
+ "CHESTNUT",
+ "CHEUNG",
+ "CHEW",
+ "CHILD",
+ "CHILDERS",
+ "CHILDRESS",
+ "CHILDS",
+ "CHILTON",
+ "CHIN",
+ "CHISHOLM",
+ "CHISM",
+ "CHISOLM",
+ "CHITWOOD",
+ "CHO",
+ "CHOATE",
+ "CHOI",
+ "CHONG",
+ "CHOW",
+ "CHRISTENSEN",
+ "CHRISTENSON",
+ "CHRISTIAN",
+ "CHRISTIANSEN",
+ "CHRISTIANSON",
+ "CHRISTIE",
+ "CHRISTMAN",
+ "CHRISTMAS",
+ "CHRISTOPHER",
+ "CHRISTY",
+ "CHU",
+ "CHUN",
+ "CHUNG",
+ "CHURCH",
+ "CHURCHILL",
+ "CINTRON",
+ "CISNEROS",
+ "CLANCY",
+ "CLANTON",
+ "CLAPP",
+ "CLARK",
+ "CLARKE",
+ "CLARKSON",
+ "CLARY",
+ "CLAUSEN",
+ "CLAWSON",
+ "CLAY",
+ "CLAYTON",
+ "CLEARY",
+ "CLEGG",
+ "CLEM",
+ "CLEMENS",
+ "CLEMENT",
+ "CLEMENTS",
+ "CLEMMONS",
+ "CLEMONS",
+ "CLEVELAND",
+ "CLEVENGER",
+ "CLICK",
+ "CLIFFORD",
+ "CLIFTON",
+ "CLINE",
+ "CLINTON",
+ "CLOSE",
+ "CLOUD",
+ "CLOUGH",
+ "CLOUTIER",
+ "COATES",
+ "COATS",
+ "COBB",
+ "COBBS",
+ "COBLE",
+ "COBURN",
+ "COCHRAN",
+ "COCHRANE",
+ "COCKRELL",
+ "CODY",
+ "COE",
+ "COFFEY",
+ "COFFIN",
+ "COFFMAN",
+ "COGGINS",
+ "COHEN",
+ "COHN",
+ "COKER",
+ "COLBERT",
+ "COLBURN",
+ "COLBY",
+ "COLE",
+ "COLEMAN",
+ "COLES",
+ "COLEY",
+ "COLLADO",
+ "COLLAZO",
+ "COLLEY",
+ "COLLIER",
+ "COLLINS",
+ "COLON",
+ "COLSON",
+ "COLVIN",
+ "COLWELL",
+ "COMBS",
+ "COMEAUX",
+ "COMER",
+ "COMPTON",
+ "COMSTOCK",
+ "CONAWAY",
+ "CONCEPCION",
+ "CONDON",
+ "CONE",
+ "CONGER",
+ "CONKLIN",
+ "CONLEY",
+ "CONN",
+ "CONNELL",
+ "CONNELLY",
+ "CONNER",
+ "CONNERS",
+ "CONNOLLY",
+ "CONNOR",
+ "CONNORS",
+ "CONOVER",
+ "CONRAD",
+ "CONROY",
+ "CONTE",
+ "CONTI",
+ "CONTRERAS",
+ "CONWAY",
+ "CONYERS",
+ "COOK",
+ "COOKE",
+ "COOKS",
+ "COOKSEY",
+ "COOLEY",
+ "COOMBS",
+ "COON",
+ "COONEY",
+ "COONS",
+ "COOPER",
+ "COPE",
+ "COPELAND",
+ "COPLEY",
+ "COPPOLA",
+ "CORBETT",
+ "CORBIN",
+ "CORBITT",
+ "CORCORAN",
+ "CORDELL",
+ "CORDERO",
+ "CORDOVA",
+ "COREY",
+ "CORLEY",
+ "CORMIER",
+ "CORNELIUS",
+ "CORNELL",
+ "CORNETT",
+ "CORNISH",
+ "CORNWELL",
+ "CORONA",
+ "CORONADO",
+ "CORRAL",
+ "CORREA",
+ "CORREIA",
+ "CORRIGAN",
+ "CORTES",
+ "CORTEZ",
+ "CORWIN",
+ "COSBY",
+ "COSGROVE",
+ "COSTA",
+ "COSTELLO",
+ "COTA",
+ "COTE",
+ "COTHRAN",
+ "COTTER",
+ "COTTON",
+ "COTTRELL",
+ "COUCH",
+ "COUGHLIN",
+ "COULTER",
+ "COUNCIL",
+ "COUNTS",
+ "COURTNEY",
+ "COUSINS",
+ "COUTURE",
+ "COVERT",
+ "COVEY",
+ "COVINGTON",
+ "COWAN",
+ "COWARD",
+ "COWART",
+ "COWELL",
+ "COWLES",
+ "COWLEY",
+ "COX",
+ "COY",
+ "COYLE",
+ "COYNE",
+ "CRABTREE",
+ "CRADDOCK",
+ "CRAFT",
+ "CRAIG",
+ "CRAIN",
+ "CRAMER",
+ "CRANDALL",
+ "CRANE",
+ "CRANFORD",
+ "CRAVEN",
+ "CRAWFORD",
+ "CRAWLEY",
+ "CRAYTON",
+ "CREAMER",
+ "CREECH",
+ "CREEL",
+ "CREIGHTON",
+ "CRENSHAW",
+ "CRESPO",
+ "CREWS",
+ "CRIDER",
+ "CRISP",
+ "CRIST",
+ "CRISWELL",
+ "CRITTENDEN",
+ "CROCKER",
+ "CROCKETT",
+ "CROFT",
+ "CROMER",
+ "CROMWELL",
+ "CRONIN",
+ "CROOK",
+ "CROOKS",
+ "CROSBY",
+ "CROSS",
+ "CROTEAU",
+ "CROUCH",
+ "CROUSE",
+ "CROW",
+ "CROWDER",
+ "CROWE",
+ "CROWELL",
+ "CROWLEY",
+ "CRUM",
+ "CRUMP",
+ "CRUSE",
+ "CRUTCHER",
+ "CRUTCHFIELD",
+ "CRUZ",
+ "CUELLAR",
+ "CUEVAS",
+ "CULBERTSON",
+ "CULLEN",
+ "CULP",
+ "CULPEPPER",
+ "CULVER",
+ "CUMMINGS",
+ "CUMMINS",
+ "CUNNINGHAM",
+ "CUPP",
+ "CURLEY",
+ "CURRAN",
+ "CURRIE",
+ "CURRIER",
+ "CURRY",
+ "CURTIN",
+ "CURTIS",
+ "CUSHMAN",
+ "CUSTER",
+ "CUTLER",
+ "CYR",
+ "DABNEY",
+ "DAHL",
+ "DAIGLE",
+ "DAILEY",
+ "DAILY",
+ "DALE",
+ "DALEY",
+ "DALLAS",
+ "DALTON",
+ "DALY",
+ "DAMICO",
+ "DAMON",
+ "DAMRON",
+ "DANCY",
+ "DANG",
+ "DANGELO",
+ "DANIEL",
+ "DANIELS",
+ "DANIELSON",
+ "DANNER",
+ "DARBY",
+ "DARDEN",
+ "DARLING",
+ "DARNELL",
+ "DASILVA",
+ "DAUGHERTY",
+ "DAUGHTRY",
+ "DAVENPORT",
+ "DAVID",
+ "DAVIDSON",
+ "DAVIES",
+ "DAVILA",
+ "DAVIS",
+ "DAVISON",
+ "DAWKINS",
+ "DAWSON",
+ "DAY",
+ "DAYTON",
+ "DEAL",
+ "DEAN",
+ "DEATON",
+ "DEBERRY",
+ "DECKER",
+ "DEES",
+ "DEHART",
+ "DEJESUS",
+ "DELACRUZ",
+ "DELAGARZA",
+ "DELANEY",
+ "DELAROSA",
+ "DELATORRE",
+ "DELEON",
+ "DELGADILLO",
+ "DELGADO",
+ "DELL",
+ "DELLINGER",
+ "DELOACH",
+ "DELONG",
+ "DELOSSANTOS",
+ "DELUCA",
+ "DELVALLE",
+ "DEMARCO",
+ "DEMERS",
+ "DEMPSEY",
+ "DENHAM",
+ "DENNEY",
+ "DENNING",
+ "DENNIS",
+ "DENNISON",
+ "DENNY",
+ "DENSON",
+ "DENT",
+ "DENTON",
+ "DEROSA",
+ "DERR",
+ "DERRICK",
+ "DESANTIS",
+ "DESIMONE",
+ "DEVINE",
+ "DEVITO",
+ "DEVLIN",
+ "DEVORE",
+ "DEVRIES",
+ "DEW",
+ "DEWEY",
+ "DEWITT",
+ "DEXTER",
+ "DIAL",
+ "DIAMOND",
+ "DIAS",
+ "DIAZ",
+ "DICK",
+ "DICKENS",
+ "DICKERSON",
+ "DICKEY",
+ "DICKINSON",
+ "DICKSON",
+ "DIEHL",
+ "DIETRICH",
+ "DIETZ",
+ "DIGGS",
+ "DILL",
+ "DILLARD",
+ "DILLON",
+ "DINKINS",
+ "DION",
+ "DIX",
+ "DIXON",
+ "DO",
+ "DOAN",
+ "DOBBINS",
+ "DOBBS",
+ "DOBSON",
+ "DOCKERY",
+ "DODD",
+ "DODDS",
+ "DODGE",
+ "DODSON",
+ "DOE",
+ "DOHERTY",
+ "DOLAN",
+ "DOLL",
+ "DOLLAR",
+ "DOMINGO",
+ "DOMINGUEZ",
+ "DOMINQUEZ",
+ "DONAHUE",
+ "DONALD",
+ "DONALDSON",
+ "DONATO",
+ "DONNELL",
+ "DONNELLY",
+ "DONOHUE",
+ "DONOVAN",
+ "DOOLEY",
+ "DOOLITTLE",
+ "DORAN",
+ "DORMAN",
+ "DORN",
+ "DORRIS",
+ "DORSEY",
+ "DORTCH",
+ "DOSS",
+ "DOTSON",
+ "DOTY",
+ "DOUCETTE",
+ "DOUGHERTY",
+ "DOUGHTY",
+ "DOUGLAS",
+ "DOUGLASS",
+ "DOVE",
+ "DOVER",
+ "DOW",
+ "DOWD",
+ "DOWDY",
+ "DOWELL",
+ "DOWLING",
+ "DOWNEY",
+ "DOWNING",
+ "DOWNS",
+ "DOYLE",
+ "DOZIER",
+ "DRAKE",
+ "DRAPER",
+ "DRAYTON",
+ "DREW",
+ "DRISCOLL",
+ "DRIVER",
+ "DRUMMOND",
+ "DRURY",
+ "DUARTE",
+ "DUBE",
+ "DUBOIS",
+ "DUBOSE",
+ "DUCKETT",
+ "DUCKWORTH",
+ "DUDLEY",
+ "DUFF",
+ "DUFFY",
+ "DUGAN",
+ "DUGAS",
+ "DUGGAN",
+ "DUGGER",
+ "DUKE",
+ "DUKES",
+ "DUMAS",
+ "DUMONT",
+ "DUNAWAY",
+ "DUNBAR",
+ "DUNCAN",
+ "DUNHAM",
+ "DUNLAP",
+ "DUNN",
+ "DUNNE",
+ "DUNNING",
+ "DUONG",
+ "DUPONT",
+ "DUPRE",
+ "DUPREE",
+ "DUPUIS",
+ "DURAN",
+ "DURAND",
+ "DURANT",
+ "DURBIN",
+ "DURDEN",
+ "DURHAM",
+ "DURKIN",
+ "DURR",
+ "DUTTON",
+ "DUVAL",
+ "DUVALL",
+ "DWYER",
+ "DYE",
+ "DYER",
+ "DYKES",
+ "DYSON",
+ "EAGLE",
+ "EARL",
+ "EARLE",
+ "EARLEY",
+ "EARLS",
+ "EARLY",
+ "EARNEST",
+ "EASLEY",
+ "EASON",
+ "EAST",
+ "EASTER",
+ "EASTERLING",
+ "EASTMAN",
+ "EASTON",
+ "EATON",
+ "EAVES",
+ "EBERT",
+ "ECHEVARRIA",
+ "ECHOLS",
+ "ECKERT",
+ "EDDY",
+ "EDGAR",
+ "EDGE",
+ "EDMOND",
+ "EDMONDS",
+ "EDMONDSON",
+ "EDWARD",
+ "EDWARDS",
+ "EGAN",
+ "EGGLESTON",
+ "ELAM",
+ "ELDER",
+ "ELDRIDGE",
+ "ELIAS",
+ "ELIZONDO",
+ "ELKINS",
+ "ELLER",
+ "ELLINGTON",
+ "ELLIOT",
+ "ELLIOTT",
+ "ELLIS",
+ "ELLISON",
+ "ELLSWORTH",
+ "ELMORE",
+ "ELROD",
+ "ELSTON",
+ "ELY",
+ "EMANUEL",
+ "EMBRY",
+ "EMERSON",
+ "EMERY",
+ "EMMONS",
+ "ENG",
+ "ENGEL",
+ "ENGLAND",
+ "ENGLE",
+ "ENGLISH",
+ "ENNIS",
+ "ENOS",
+ "ENRIGHT",
+ "ENRIQUEZ",
+ "EPPERSON",
+ "EPPS",
+ "EPSTEIN",
+ "ERDMANN",
+ "ERICKSON",
+ "ERNST",
+ "ERVIN",
+ "ERWIN",
+ "ESCALANTE",
+ "ESCAMILLA",
+ "ESCOBAR",
+ "ESCOBEDO",
+ "ESPARZA",
+ "ESPINAL",
+ "ESPINO",
+ "ESPINOSA",
+ "ESPINOZA",
+ "ESPOSITO",
+ "ESQUIVEL",
+ "ESTEP",
+ "ESTES",
+ "ESTRADA",
+ "ESTRELLA",
+ "ETHERIDGE",
+ "ETHRIDGE",
+ "EUBANKS",
+ "EVANS",
+ "EVERETT",
+ "EVERHART",
+ "EVERS",
+ "EVERSON",
+ "EWING",
+ "EZELL",
+ "FABER",
+ "FABIAN",
+ "FAGAN",
+ "FAHEY",
+ "FAIN",
+ "FAIR",
+ "FAIRBANKS",
+ "FAIRCHILD",
+ "FAIRLEY",
+ "FAISON",
+ "FAJARDO",
+ "FALCON",
+ "FALK",
+ "FALLON",
+ "FALLS",
+ "FANNING",
+ "FARIAS",
+ "FARLEY",
+ "FARMER",
+ "FARNSWORTH",
+ "FARR",
+ "FARRAR",
+ "FARRELL",
+ "FARRINGTON",
+ "FARRIS",
+ "FARROW",
+ "FAULK",
+ "FAULKNER",
+ "FAUST",
+ "FAY",
+ "FEENEY",
+ "FELDER",
+ "FELDMAN",
+ "FELICIANO",
+ "FELIX",
+ "FELLOWS",
+ "FELTON",
+ "FELTS",
+ "FENNELL",
+ "FENNER",
+ "FENTON",
+ "FERGUSON",
+ "FERNANDES",
+ "FERNANDEZ",
+ "FERRARA",
+ "FERRARI",
+ "FERRARO",
+ "FERREIRA",
+ "FERRELL",
+ "FERRER",
+ "FERRIS",
+ "FERRY",
+ "FIELD",
+ "FIELDER",
+ "FIELDS",
+ "FIERRO",
+ "FIFE",
+ "FIGUEROA",
+ "FINCH",
+ "FINCHER",
+ "FINDLEY",
+ "FINE",
+ "FINK",
+ "FINLEY",
+ "FINN",
+ "FINNEGAN",
+ "FINNEY",
+ "FIORE",
+ "FISCHER",
+ "FISH",
+ "FISHER",
+ "FISHMAN",
+ "FISK",
+ "FITCH",
+ "FITE",
+ "FITTS",
+ "FITZGERALD",
+ "FITZPATRICK",
+ "FITZSIMMONS",
+ "FLAGG",
+ "FLAHERTY",
+ "FLANAGAN",
+ "FLANDERS",
+ "FLANIGAN",
+ "FLANNERY",
+ "FLECK",
+ "FLEMING",
+ "FLEMMING",
+ "FLETCHER",
+ "FLINT",
+ "FLOOD",
+ "FLORA",
+ "FLORENCE",
+ "FLORES",
+ "FLOREZ",
+ "FLOURNOY",
+ "FLOWERS",
+ "FLOYD",
+ "FLYNN",
+ "FOGARTY",
+ "FOGG",
+ "FOGLE",
+ "FOLEY",
+ "FOLSE",
+ "FOLSOM",
+ "FOLTZ",
+ "FONG",
+ "FONSECA",
+ "FONTAINE",
+ "FONTENOT",
+ "FOOTE",
+ "FORBES",
+ "FORD",
+ "FOREMAN",
+ "FOREST",
+ "FORET",
+ "FORMAN",
+ "FORNEY",
+ "FORREST",
+ "FORRESTER",
+ "FORSTER",
+ "FORSYTH",
+ "FORSYTHE",
+ "FORT",
+ "FORTE",
+ "FORTENBERRY",
+ "FORTIER",
+ "FORTIN",
+ "FORTNER",
+ "FORTUNE",
+ "FOSS",
+ "FOSTER",
+ "FOUNTAIN",
+ "FOURNIER",
+ "FOUST",
+ "FOWLER",
+ "FOX",
+ "FOY",
+ "FRALEY",
+ "FRAME",
+ "FRANCE",
+ "FRANCIS",
+ "FRANCISCO",
+ "FRANCO",
+ "FRANCOIS",
+ "FRANK",
+ "FRANKLIN",
+ "FRANKS",
+ "FRANTZ",
+ "FRANZ",
+ "FRASER",
+ "FRASIER",
+ "FRAZER",
+ "FRAZIER",
+ "FREDERICK",
+ "FREDERICKS",
+ "FREDRICK",
+ "FREDRICKSON",
+ "FREE",
+ "FREED",
+ "FREEDMAN",
+ "FREEMAN",
+ "FREESE",
+ "FREITAS",
+ "FRENCH",
+ "FREUND",
+ "FREY",
+ "FRIAS",
+ "FRICK",
+ "FRIEDMAN",
+ "FRIEND",
+ "FRIERSON",
+ "FRIES",
+ "FRITZ",
+ "FRIZZELL",
+ "FROST",
+ "FRY",
+ "FRYE",
+ "FRYER",
+ "FUCHS",
+ "FUENTES",
+ "FUGATE",
+ "FULCHER",
+ "FULLER",
+ "FULLERTON",
+ "FULMER",
+ "FULTON",
+ "FULTZ",
+ "FUNDERBURK",
+ "FUNK",
+ "FUQUA",
+ "FURMAN",
+ "FURR",
+ "FUSCO",
+ "GABLE",
+ "GABRIEL",
+ "GADDIS",
+ "GADDY",
+ "GAFFNEY",
+ "GAGE",
+ "GAGNE",
+ "GAGNON",
+ "GAINES",
+ "GAINEY",
+ "GAITHER",
+ "GALARZA",
+ "GALBRAITH",
+ "GALE",
+ "GALINDO",
+ "GALLAGHER",
+ "GALLANT",
+ "GALLARDO",
+ "GALLEGOS",
+ "GALLO",
+ "GALLOWAY",
+ "GALVAN",
+ "GALVEZ",
+ "GALVIN",
+ "GAMBLE",
+ "GAMBOA",
+ "GAMEZ",
+ "GANDY",
+ "GANN",
+ "GANNON",
+ "GANT",
+ "GANTT",
+ "GARAY",
+ "GARBER",
+ "GARCIA",
+ "GARDINER",
+ "GARDNER",
+ "GARLAND",
+ "GARMON",
+ "GARNER",
+ "GARNETT",
+ "GARRETT",
+ "GARRIS",
+ "GARRISON",
+ "GARVEY",
+ "GARVIN",
+ "GARY",
+ "GARZA",
+ "GASKIN",
+ "GASKINS",
+ "GASS",
+ "GASTON",
+ "GATES",
+ "GATEWOOD",
+ "GATLIN",
+ "GAULT",
+ "GAUTHIER",
+ "GAVIN",
+ "GAY",
+ "GAYLORD",
+ "GEARY",
+ "GEE",
+ "GEER",
+ "GEIGER",
+ "GENTILE",
+ "GENTRY",
+ "GEORGE",
+ "GERALD",
+ "GERARD",
+ "GERBER",
+ "GERMAN",
+ "GETZ",
+ "GIBBONS",
+ "GIBBS",
+ "GIBSON",
+ "GIFFORD",
+ "GIL",
+ "GILBERT",
+ "GILBERTSON",
+ "GILBREATH",
+ "GILCHRIST",
+ "GILES",
+ "GILL",
+ "GILLEN",
+ "GILLESPIE",
+ "GILLETTE",
+ "GILLEY",
+ "GILLIAM",
+ "GILLILAND",
+ "GILLIS",
+ "GILMAN",
+ "GILMER",
+ "GILMORE",
+ "GILSON",
+ "GINN",
+ "GIORDANO",
+ "GIPSON",
+ "GIRARD",
+ "GIRON",
+ "GIROUX",
+ "GIST",
+ "GIVENS",
+ "GLADDEN",
+ "GLADNEY",
+ "GLASER",
+ "GLASGOW",
+ "GLASS",
+ "GLAZE",
+ "GLEASON",
+ "GLENN",
+ "GLOVER",
+ "GLYNN",
+ "GOAD",
+ "GOBLE",
+ "GODDARD",
+ "GODFREY",
+ "GODINEZ",
+ "GODWIN",
+ "GOEBEL",
+ "GOETZ",
+ "GOFF",
+ "GOFORTH",
+ "GOINS",
+ "GOLD",
+ "GOLDBERG",
+ "GOLDEN",
+ "GOLDMAN",
+ "GOLDSMITH",
+ "GOLDSTEIN",
+ "GOMES",
+ "GOMEZ",
+ "GONSALVES",
+ "GONZALES",
+ "GONZALEZ",
+ "GOOCH",
+ "GOOD",
+ "GOODE",
+ "GOODEN",
+ "GOODIN",
+ "GOODING",
+ "GOODMAN",
+ "GOODRICH",
+ "GOODSON",
+ "GOODWIN",
+ "GOOLSBY",
+ "GORDON",
+ "GORE",
+ "GORHAM",
+ "GORMAN",
+ "GOSS",
+ "GOSSETT",
+ "GOUGH",
+ "GOULD",
+ "GOULET",
+ "GRACE",
+ "GRACIA",
+ "GRADY",
+ "GRAF",
+ "GRAFF",
+ "GRAGG",
+ "GRAHAM",
+ "GRANADOS",
+ "GRANGER",
+ "GRANT",
+ "GRANTHAM",
+ "GRAVES",
+ "GRAY",
+ "GRAYSON",
+ "GREATHOUSE",
+ "GRECO",
+ "GREEN",
+ "GREENBERG",
+ "GREENE",
+ "GREENFIELD",
+ "GREENLEE",
+ "GREENWOOD",
+ "GREER",
+ "GREGG",
+ "GREGORY",
+ "GREINER",
+ "GRENIER",
+ "GRESHAM",
+ "GREY",
+ "GRICE",
+ "GRIDER",
+ "GRIER",
+ "GRIFFIN",
+ "GRIFFIS",
+ "GRIFFITH",
+ "GRIFFITHS",
+ "GRIGGS",
+ "GRIGSBY",
+ "GRIMES",
+ "GRIMM",
+ "GRISHAM",
+ "GRISSOM",
+ "GRISWOLD",
+ "GROCE",
+ "GROGAN",
+ "GROOMS",
+ "GROSS",
+ "GROSSMAN",
+ "GROVE",
+ "GROVER",
+ "GROVES",
+ "GRUBB",
+ "GRUBBS",
+ "GRUBER",
+ "GUAJARDO",
+ "GUENTHER",
+ "GUERIN",
+ "GUERRA",
+ "GUERRERO",
+ "GUESS",
+ "GUEST",
+ "GUEVARA",
+ "GUFFEY",
+ "GUIDRY",
+ "GUILLEN",
+ "GUILLORY",
+ "GUINN",
+ "GULLEY",
+ "GUNDERSON",
+ "GUNN",
+ "GUNTER",
+ "GUNTHER",
+ "GURLEY",
+ "GUSTAFSON",
+ "GUTHRIE",
+ "GUTIERREZ",
+ "GUY",
+ "GUYTON",
+ "GUZMAN",
+ "HA",
+ "HAAG",
+ "HAAS",
+ "HAASE",
+ "HACKER",
+ "HACKETT",
+ "HACKNEY",
+ "HADDEN",
+ "HADLEY",
+ "HAGAN",
+ "HAGEN",
+ "HAGER",
+ "HAGGARD",
+ "HAGGERTY",
+ "HAHN",
+ "HAIGHT",
+ "HAILEY",
+ "HAINES",
+ "HAIR",
+ "HAIRSTON",
+ "HALCOMB",
+ "HALE",
+ "HALES",
+ "HALEY",
+ "HALL",
+ "HALLER",
+ "HALLMAN",
+ "HALSEY",
+ "HALSTEAD",
+ "HALVERSON",
+ "HAM",
+ "HAMBLIN",
+ "HAMBY",
+ "HAMEL",
+ "HAMER",
+ "HAMILTON",
+ "HAMLIN",
+ "HAMM",
+ "HAMMER",
+ "HAMMETT",
+ "HAMMOND",
+ "HAMMONDS",
+ "HAMMONS",
+ "HAMPTON",
+ "HAMRICK",
+ "HAN",
+ "HANCOCK",
+ "HAND",
+ "HANDLEY",
+ "HANDY",
+ "HANES",
+ "HANEY",
+ "HANKINS",
+ "HANKS",
+ "HANLEY",
+ "HANLON",
+ "HANNA",
+ "HANNAH",
+ "HANNAN",
+ "HANNON",
+ "HANSEN",
+ "HANSON",
+ "HARBIN",
+ "HARDAWAY",
+ "HARDEE",
+ "HARDEN",
+ "HARDER",
+ "HARDESTY",
+ "HARDIN",
+ "HARDING",
+ "HARDISON",
+ "HARDMAN",
+ "HARDWICK",
+ "HARDY",
+ "HARE",
+ "HARGIS",
+ "HARGRAVE",
+ "HARGROVE",
+ "HARKINS",
+ "HARLAN",
+ "HARLEY",
+ "HARLOW",
+ "HARMAN",
+ "HARMON",
+ "HARMS",
+ "HARNESS",
+ "HARP",
+ "HARPER",
+ "HARR",
+ "HARRELL",
+ "HARRINGTON",
+ "HARRIS",
+ "HARRISON",
+ "HARRY",
+ "HART",
+ "HARTER",
+ "HARTLEY",
+ "HARTMAN",
+ "HARTMANN",
+ "HARTWELL",
+ "HARVEY",
+ "HARWELL",
+ "HARWOOD",
+ "HASKELL",
+ "HASKINS",
+ "HASS",
+ "HASSELL",
+ "HASTINGS",
+ "HATCH",
+ "HATCHER",
+ "HATCHETT",
+ "HATFIELD",
+ "HATHAWAY",
+ "HATLEY",
+ "HATTON",
+ "HAUGEN",
+ "HAUSER",
+ "HAVENS",
+ "HAWES",
+ "HAWK",
+ "HAWKINS",
+ "HAWKS",
+ "HAWLEY",
+ "HAWTHORNE",
+ "HAY",
+ "HAYDEN",
+ "HAYES",
+ "HAYNES",
+ "HAYS",
+ "HAYWARD",
+ "HAYWOOD",
+ "HAZEL",
+ "HEAD",
+ "HEADLEY",
+ "HEADRICK",
+ "HEALEY",
+ "HEALY",
+ "HEARD",
+ "HEARN",
+ "HEATH",
+ "HEATON",
+ "HEBERT",
+ "HECK",
+ "HECKMAN",
+ "HEDGES",
+ "HEDRICK",
+ "HEFFNER",
+ "HEFLIN",
+ "HEFNER",
+ "HEIM",
+ "HEIN",
+ "HEINRICH",
+ "HEINZ",
+ "HELD",
+ "HELLER",
+ "HELM",
+ "HELMS",
+ "HELTON",
+ "HEMBREE",
+ "HEMPHILL",
+ "HENDERSON",
+ "HENDON",
+ "HENDRICK",
+ "HENDRICKS",
+ "HENDRICKSON",
+ "HENDRIX",
+ "HENKE",
+ "HENLEY",
+ "HENNESSEY",
+ "HENNING",
+ "HENRY",
+ "HENSLEY",
+ "HENSON",
+ "HER",
+ "HERBERT",
+ "HEREDIA",
+ "HERMAN",
+ "HERMANN",
+ "HERNANDEZ",
+ "HERNDON",
+ "HERR",
+ "HERRERA",
+ "HERRICK",
+ "HERRIN",
+ "HERRING",
+ "HERRINGTON",
+ "HERRMANN",
+ "HERRON",
+ "HERSHBERGER",
+ "HERZOG",
+ "HESS",
+ "HESTER",
+ "HEWITT",
+ "HEYWARD",
+ "HIATT",
+ "HIBBARD",
+ "HICKEY",
+ "HICKMAN",
+ "HICKS",
+ "HICKSON",
+ "HIDALGO",
+ "HIGDON",
+ "HIGGINBOTHAM",
+ "HIGGINS",
+ "HIGGS",
+ "HIGH",
+ "HIGHTOWER",
+ "HILDEBRAND",
+ "HILDRETH",
+ "HILL",
+ "HILLARD",
+ "HILLER",
+ "HILLIARD",
+ "HILLMAN",
+ "HILLS",
+ "HILTON",
+ "HIMES",
+ "HINDMAN",
+ "HINDS",
+ "HINES",
+ "HINKLE",
+ "HINOJOSA",
+ "HINSON",
+ "HINTON",
+ "HIRSCH",
+ "HITCHCOCK",
+ "HITE",
+ "HITT",
+ "HO",
+ "HOANG",
+ "HOBBS",
+ "HOBSON",
+ "HODGE",
+ "HODGES",
+ "HODGSON",
+ "HOFF",
+ "HOFFMAN",
+ "HOFFMANN",
+ "HOGAN",
+ "HOGG",
+ "HOGUE",
+ "HOKE",
+ "HOLBROOK",
+ "HOLCOMB",
+ "HOLCOMBE",
+ "HOLDEN",
+ "HOLDER",
+ "HOLGUIN",
+ "HOLIDAY",
+ "HOLLAND",
+ "HOLLENBECK",
+ "HOLLEY",
+ "HOLLIDAY",
+ "HOLLINGSWORTH",
+ "HOLLINS",
+ "HOLLIS",
+ "HOLLOMAN",
+ "HOLLOWAY",
+ "HOLLY",
+ "HOLM",
+ "HOLMAN",
+ "HOLMES",
+ "HOLT",
+ "HOLTON",
+ "HOLTZ",
+ "HOMAN",
+ "HOMER",
+ "HONEYCUTT",
+ "HONG",
+ "HOOD",
+ "HOOK",
+ "HOOKER",
+ "HOOKS",
+ "HOOPER",
+ "HOOVER",
+ "HOPE",
+ "HOPKINS",
+ "HOPPE",
+ "HOPPER",
+ "HOPSON",
+ "HORAN",
+ "HORN",
+ "HORNE",
+ "HORNER",
+ "HORNSBY",
+ "HOROWITZ",
+ "HORSLEY",
+ "HORTON",
+ "HORVATH",
+ "HOSKINS",
+ "HOSTETLER",
+ "HOUCK",
+ "HOUGH",
+ "HOUGHTON",
+ "HOULE",
+ "HOUSE",
+ "HOUSER",
+ "HOUSTON",
+ "HOWARD",
+ "HOWE",
+ "HOWELL",
+ "HOWERTON",
+ "HOWES",
+ "HOWLAND",
+ "HOY",
+ "HOYLE",
+ "HOYT",
+ "HSU",
+ "HUANG",
+ "HUBBARD",
+ "HUBER",
+ "HUBERT",
+ "HUDDLESTON",
+ "HUDGENS",
+ "HUDGINS",
+ "HUDSON",
+ "HUERTA",
+ "HUEY",
+ "HUFF",
+ "HUFFMAN",
+ "HUGGINS",
+ "HUGHES",
+ "HUGHEY",
+ "HULL",
+ "HULSEY",
+ "HUMES",
+ "HUMMEL",
+ "HUMPHREY",
+ "HUMPHREYS",
+ "HUMPHRIES",
+ "HUNDLEY",
+ "HUNT",
+ "HUNTER",
+ "HUNTINGTON",
+ "HUNTLEY",
+ "HURD",
+ "HURLEY",
+ "HURST",
+ "HURT",
+ "HURTADO",
+ "HUSKEY",
+ "HUSSEY",
+ "HUSTON",
+ "HUTCHENS",
+ "HUTCHERSON",
+ "HUTCHESON",
+ "HUTCHINGS",
+ "HUTCHINS",
+ "HUTCHINSON",
+ "HUTCHISON",
+ "HUTSON",
+ "HUTTO",
+ "HUTTON",
+ "HUYNH",
+ "HWANG",
+ "HYATT",
+ "HYDE",
+ "HYLAND",
+ "HYLTON",
+ "HYMAN",
+ "HYNES",
+ "IBARRA",
+ "INGLE",
+ "INGRAHAM",
+ "INGRAM",
+ "INMAN",
+ "IRBY",
+ "IRELAND",
+ "IRISH",
+ "IRIZARRY",
+ "IRONS",
+ "IRVIN",
+ "IRVINE",
+ "IRVING",
+ "IRWIN",
+ "ISAAC",
+ "ISAACS",
+ "ISAACSON",
+ "ISBELL",
+ "ISOM",
+ "ISON",
+ "ISRAEL",
+ "IVERSON",
+ "IVES",
+ "IVEY",
+ "IVORY",
+ "IVY",
+ "JACK",
+ "JACKMAN",
+ "JACKS",
+ "JACKSON",
+ "JACOB",
+ "JACOBS",
+ "JACOBSEN",
+ "JACOBSON",
+ "JACOBY",
+ "JACQUES",
+ "JAEGER",
+ "JAMES",
+ "JAMESON",
+ "JAMISON",
+ "JANES",
+ "JANKOWSKI",
+ "JANSEN",
+ "JANSSEN",
+ "JARAMILLO",
+ "JARRELL",
+ "JARRETT",
+ "JARVIS",
+ "JASPER",
+ "JAY",
+ "JAYNES",
+ "JEAN",
+ "JEFFERIES",
+ "JEFFERS",
+ "JEFFERSON",
+ "JEFFERY",
+ "JEFFREY",
+ "JEFFRIES",
+ "JENKINS",
+ "JENNINGS",
+ "JENSEN",
+ "JENSON",
+ "JERNIGAN",
+ "JESSUP",
+ "JETER",
+ "JETT",
+ "JEWELL",
+ "JEWETT",
+ "JIMENEZ",
+ "JOBE",
+ "JOE",
+ "JOHANSEN",
+ "JOHN",
+ "JOHNS",
+ "JOHNSON",
+ "JOHNSTON",
+ "JOINER",
+ "JOLLEY",
+ "JOLLY",
+ "JONES",
+ "JORDAN",
+ "JORDON",
+ "JORGENSEN",
+ "JORGENSON",
+ "JOSE",
+ "JOSEPH",
+ "JOY",
+ "JOYCE",
+ "JOYNER",
+ "JUAREZ",
+ "JUDD",
+ "JUDE",
+ "JUDGE",
+ "JUDKINS",
+ "JULIAN",
+ "JUNG",
+ "JUSTICE",
+ "JUSTUS",
+ "KAHN",
+ "KAISER",
+ "KAMINSKI",
+ "KANE",
+ "KANG",
+ "KAPLAN",
+ "KARR",
+ "KASPER",
+ "KATZ",
+ "KAUFFMAN",
+ "KAUFMAN",
+ "KAY",
+ "KAYE",
+ "KEANE",
+ "KEARNEY",
+ "KEARNS",
+ "KEATING",
+ "KEATON",
+ "KECK",
+ "KEE",
+ "KEEFE",
+ "KEEFER",
+ "KEEGAN",
+ "KEEL",
+ "KEELER",
+ "KEELING",
+ "KEEN",
+ "KEENAN",
+ "KEENE",
+ "KEENER",
+ "KEENEY",
+ "KEETON",
+ "KEITH",
+ "KELLEHER",
+ "KELLER",
+ "KELLEY",
+ "KELLOGG",
+ "KELLUM",
+ "KELLY",
+ "KELSEY",
+ "KELSO",
+ "KEMP",
+ "KEMPER",
+ "KENDALL",
+ "KENDRICK",
+ "KENNEDY",
+ "KENNEY",
+ "KENNY",
+ "KENT",
+ "KENYON",
+ "KERN",
+ "KERNS",
+ "KERR",
+ "KESSLER",
+ "KETCHUM",
+ "KEY",
+ "KEYES",
+ "KEYS",
+ "KEYSER",
+ "KHAN",
+ "KIDD",
+ "KIDWELL",
+ "KIEFER",
+ "KILGORE",
+ "KILLIAN",
+ "KILPATRICK",
+ "KIM",
+ "KIMBALL",
+ "KIMBLE",
+ "KIMBRELL",
+ "KIMBROUGH",
+ "KIMMEL",
+ "KINARD",
+ "KINCAID",
+ "KINDER",
+ "KING",
+ "KINGSLEY",
+ "KINNEY",
+ "KINSEY",
+ "KIRBY",
+ "KIRCHNER",
+ "KIRK",
+ "KIRKLAND",
+ "KIRKPATRICK",
+ "KIRKWOOD",
+ "KISER",
+ "KISH",
+ "KITCHEN",
+ "KITCHENS",
+ "KLEIN",
+ "KLINE",
+ "KLINGER",
+ "KNAPP",
+ "KNIGHT",
+ "KNOLL",
+ "KNOTT",
+ "KNOTTS",
+ "KNOWLES",
+ "KNOWLTON",
+ "KNOX",
+ "KNUDSEN",
+ "KNUDSON",
+ "KNUTSON",
+ "KOCH",
+ "KOEHLER",
+ "KOENIG",
+ "KOHL",
+ "KOHLER",
+ "KOHN",
+ "KOLB",
+ "KONG",
+ "KOONCE",
+ "KOONTZ",
+ "KOPP",
+ "KOVACH",
+ "KOWALSKI",
+ "KOZAK",
+ "KOZLOWSKI",
+ "KRAFT",
+ "KRAMER",
+ "KRAUS",
+ "KRAUSE",
+ "KRAUSS",
+ "KREBS",
+ "KRIEGER",
+ "KROLL",
+ "KRUEGER",
+ "KRUG",
+ "KRUGER",
+ "KRUSE",
+ "KUHN",
+ "KUNKEL",
+ "KUNTZ",
+ "KUNZ",
+ "KURTZ",
+ "KUYKENDALL",
+ "KYLE",
+ "LABBE",
+ "LABELLE",
+ "LACEY",
+ "LACHANCE",
+ "LACKEY",
+ "LACROIX",
+ "LACY",
+ "LADD",
+ "LADNER",
+ "LAFFERTY",
+ "LAFLAMME",
+ "LAFLEUR",
+ "LAI",
+ "LAIRD",
+ "LAKE",
+ "LAM",
+ "LAMAR",
+ "LAMB",
+ "LAMBERT",
+ "LAMM",
+ "LANCASTER",
+ "LANCE",
+ "LAND",
+ "LANDERS",
+ "LANDIS",
+ "LANDON",
+ "LANDRUM",
+ "LANDRY",
+ "LANE",
+ "LANEY",
+ "LANG",
+ "LANGDON",
+ "LANGE",
+ "LANGER",
+ "LANGFORD",
+ "LANGLEY",
+ "LANGLOIS",
+ "LANGSTON",
+ "LANHAM",
+ "LANIER",
+ "LANKFORD",
+ "LANNING",
+ "LANTZ",
+ "LAPLANTE",
+ "LAPOINTE",
+ "LAPORTE",
+ "LARA",
+ "LARGE",
+ "LARKIN",
+ "LAROCHE",
+ "LAROSE",
+ "LARRY",
+ "LARSEN",
+ "LARSON",
+ "LARUE",
+ "LASH",
+ "LASHLEY",
+ "LASSITER",
+ "LASTER",
+ "LATHAM",
+ "LATIMER",
+ "LATTIMORE",
+ "LAU",
+ "LAUER",
+ "LAUGHLIN",
+ "LAVENDER",
+ "LAVIGNE",
+ "LAVOIE",
+ "LAW",
+ "LAWHORN",
+ "LAWLER",
+ "LAWLESS",
+ "LAWRENCE",
+ "LAWS",
+ "LAWSON",
+ "LAWTON",
+ "LAY",
+ "LAYMAN",
+ "LAYNE",
+ "LAYTON",
+ "LE",
+ "LEA",
+ "LEACH",
+ "LEAHY",
+ "LEAK",
+ "LEAKE",
+ "LEAL",
+ "LEAR",
+ "LEARY",
+ "LEAVITT",
+ "LEBLANC",
+ "LEBRON",
+ "LECLAIR",
+ "LEDBETTER",
+ "LEDESMA",
+ "LEDFORD",
+ "LEDOUX",
+ "LEE",
+ "LEEPER",
+ "LEES",
+ "LEFEBVRE",
+ "LEGER",
+ "LEGG",
+ "LEGGETT",
+ "LEHMAN",
+ "LEHMANN",
+ "LEIGH",
+ "LEIGHTON",
+ "LEMASTER",
+ "LEMAY",
+ "LEMIEUX",
+ "LEMKE",
+ "LEMMON",
+ "LEMON",
+ "LEMONS",
+ "LEMUS",
+ "LENNON",
+ "LENTZ",
+ "LENZ",
+ "LEON",
+ "LEONARD",
+ "LEONE",
+ "LERMA",
+ "LERNER",
+ "LEROY",
+ "LESLIE",
+ "LESSARD",
+ "LESTER",
+ "LEUNG",
+ "LEVESQUE",
+ "LEVI",
+ "LEVIN",
+ "LEVINE",
+ "LEVY",
+ "LEW",
+ "LEWANDOWSKI",
+ "LEWIS",
+ "LEYVA",
+ "LI",
+ "LIBBY",
+ "LIDDELL",
+ "LIEBERMAN",
+ "LIGHT",
+ "LIGHTFOOT",
+ "LIGHTNER",
+ "LIGON",
+ "LILES",
+ "LILLEY",
+ "LILLY",
+ "LIM",
+ "LIMA",
+ "LIMON",
+ "LIN",
+ "LINARES",
+ "LINCOLN",
+ "LIND",
+ "LINDBERG",
+ "LINDER",
+ "LINDGREN",
+ "LINDLEY",
+ "LINDQUIST",
+ "LINDSAY",
+ "LINDSEY",
+ "LINDSTROM",
+ "LINK",
+ "LINKOUS",
+ "LINN",
+ "LINTON",
+ "LINVILLE",
+ "LIPSCOMB",
+ "LIRA",
+ "LISTER",
+ "LITTLE",
+ "LITTLEFIELD",
+ "LITTLEJOHN",
+ "LITTLETON",
+ "LIU",
+ "LIVELY",
+ "LIVINGSTON",
+ "LLOYD",
+ "LO",
+ "LOCKE",
+ "LOCKETT",
+ "LOCKHART",
+ "LOCKLEAR",
+ "LOCKWOOD",
+ "LOERA",
+ "LOFTIN",
+ "LOFTIS",
+ "LOFTON",
+ "LOGAN",
+ "LOGSDON",
+ "LOGUE",
+ "LOMAX",
+ "LOMBARD",
+ "LOMBARDI",
+ "LOMBARDO",
+ "LONDON",
+ "LONG",
+ "LONGO",
+ "LONGORIA",
+ "LOOMIS",
+ "LOONEY",
+ "LOPER",
+ "LOPES",
+ "LOPEZ",
+ "LORD",
+ "LORENZ",
+ "LORENZO",
+ "LOTT",
+ "LOUIS",
+ "LOVE",
+ "LOVEJOY",
+ "LOVELACE",
+ "LOVELESS",
+ "LOVELL",
+ "LOVETT",
+ "LOVING",
+ "LOW",
+ "LOWE",
+ "LOWELL",
+ "LOWERY",
+ "LOWMAN",
+ "LOWRY",
+ "LOY",
+ "LOYA",
+ "LOYD",
+ "LOZANO",
+ "LU",
+ "LUCAS",
+ "LUCE",
+ "LUCERO",
+ "LUCIANO",
+ "LUCKETT",
+ "LUDWIG",
+ "LUGO",
+ "LUIS",
+ "LUJAN",
+ "LUKE",
+ "LUMPKIN",
+ "LUNA",
+ "LUND",
+ "LUNDBERG",
+ "LUNDY",
+ "LUNSFORD",
+ "LUONG",
+ "LUSK",
+ "LUSTER",
+ "LUTHER",
+ "LUTTRELL",
+ "LUTZ",
+ "LY",
+ "LYLE",
+ "LYLES",
+ "LYMAN",
+ "LYNCH",
+ "LYNN",
+ "LYON",
+ "LYONS",
+ "LYTLE",
+ "MA",
+ "MAAS",
+ "MABE",
+ "MABRY",
+ "MACDONALD",
+ "MACE",
+ "MACHADO",
+ "MACIAS",
+ "MACK",
+ "MACKAY",
+ "MACKENZIE",
+ "MACKEY",
+ "MACKIE",
+ "MACKLIN",
+ "MACLEAN",
+ "MACLEOD",
+ "MACON",
+ "MADDEN",
+ "MADDOX",
+ "MADERA",
+ "MADISON",
+ "MADRID",
+ "MADRIGAL",
+ "MADSEN",
+ "MAES",
+ "MAESTAS",
+ "MAGANA",
+ "MAGEE",
+ "MAGGARD",
+ "MAGNUSON",
+ "MAGUIRE",
+ "MAHAFFEY",
+ "MAHAN",
+ "MAHER",
+ "MAHON",
+ "MAHONEY",
+ "MAIER",
+ "MAIN",
+ "MAJOR",
+ "MAJORS",
+ "MAKI",
+ "MALCOLM",
+ "MALDONADO",
+ "MALLEY",
+ "MALLORY",
+ "MALLOY",
+ "MALONE",
+ "MALONEY",
+ "MANCINI",
+ "MANCUSO",
+ "MANESS",
+ "MANGUM",
+ "MANLEY",
+ "MANN",
+ "MANNING",
+ "MANNS",
+ "MANSFIELD",
+ "MANSON",
+ "MANUEL",
+ "MANZO",
+ "MAPLE",
+ "MAPLES",
+ "MARBLE",
+ "MARCH",
+ "MARCHAND",
+ "MARCOTTE",
+ "MARCUM",
+ "MARCUS",
+ "MARES",
+ "MARIN",
+ "MARINO",
+ "MARION",
+ "MARK",
+ "MARKHAM",
+ "MARKLEY",
+ "MARKS",
+ "MARLER",
+ "MARLOW",
+ "MARLOWE",
+ "MARQUEZ",
+ "MARQUIS",
+ "MARR",
+ "MARRERO",
+ "MARROQUIN",
+ "MARSH",
+ "MARSHALL",
+ "MARTEL",
+ "MARTELL",
+ "MARTENS",
+ "MARTIN",
+ "MARTINDALE",
+ "MARTINEZ",
+ "MARTINO",
+ "MARTINS",
+ "MARTINSON",
+ "MARTZ",
+ "MARVIN",
+ "MARX",
+ "MASON",
+ "MASSEY",
+ "MASSIE",
+ "MAST",
+ "MASTERS",
+ "MASTERSON",
+ "MATA",
+ "MATHENY",
+ "MATHESON",
+ "MATHEWS",
+ "MATHIAS",
+ "MATHIS",
+ "MATLOCK",
+ "MATNEY",
+ "MATOS",
+ "MATSON",
+ "MATTESON",
+ "MATTHEW",
+ "MATTHEWS",
+ "MATTINGLY",
+ "MATTISON",
+ "MATTOS",
+ "MATTOX",
+ "MATTSON",
+ "MAULDIN",
+ "MAUPIN",
+ "MAURER",
+ "MAURO",
+ "MAXEY",
+ "MAXFIELD",
+ "MAXWELL",
+ "MAY",
+ "MAYBERRY",
+ "MAYER",
+ "MAYERS",
+ "MAYES",
+ "MAYFIELD",
+ "MAYHEW",
+ "MAYNARD",
+ "MAYO",
+ "MAYS",
+ "MAZZA",
+ "MCADAMS",
+ "MCAFEE",
+ "MCALISTER",
+ "MCALLISTER",
+ "MCARTHUR",
+ "MCBEE",
+ "MCBRIDE",
+ "MCCABE",
+ "MCCAFFREY",
+ "MCCAIN",
+ "MCCALL",
+ "MCCALLISTER",
+ "MCCALLUM",
+ "MCCANN",
+ "MCCANTS",
+ "MCCARTER",
+ "MCCARTHY",
+ "MCCARTNEY",
+ "MCCARTY",
+ "MCCASKILL",
+ "MCCAULEY",
+ "MCCLAIN",
+ "MCCLANAHAN",
+ "MCCLARY",
+ "MCCLEARY",
+ "MCCLELLAN",
+ "MCCLELLAND",
+ "MCCLENDON",
+ "MCCLINTOCK",
+ "MCCLINTON",
+ "MCCLOSKEY",
+ "MCCLOUD",
+ "MCCLUNG",
+ "MCCLURE",
+ "MCCOLLUM",
+ "MCCOMBS",
+ "MCCONNELL",
+ "MCCOOL",
+ "MCCORD",
+ "MCCORKLE",
+ "MCCORMACK",
+ "MCCORMICK",
+ "MCCOY",
+ "MCCRACKEN",
+ "MCCRARY",
+ "MCCRAY",
+ "MCCREARY",
+ "MCCUE",
+ "MCCULLOCH",
+ "MCCULLOUGH",
+ "MCCUNE",
+ "MCCURDY",
+ "MCCURRY",
+ "MCCUTCHEON",
+ "MCDADE",
+ "MCDANIEL",
+ "MCDANIELS",
+ "MCDERMOTT",
+ "MCDONALD",
+ "MCDONNELL",
+ "MCDONOUGH",
+ "MCDOUGAL",
+ "MCDOUGALL",
+ "MCDOWELL",
+ "MCDUFFIE",
+ "MCELROY",
+ "MCEWEN",
+ "MCFADDEN",
+ "MCFALL",
+ "MCFARLAND",
+ "MCFARLANE",
+ "MCGEE",
+ "MCGEHEE",
+ "MCGHEE",
+ "MCGILL",
+ "MCGINNIS",
+ "MCGOVERN",
+ "MCGOWAN",
+ "MCGRATH",
+ "MCGRAW",
+ "MCGREGOR",
+ "MCGREW",
+ "MCGRIFF",
+ "MCGUIRE",
+ "MCHENRY",
+ "MCHUGH",
+ "MCINNIS",
+ "MCINTIRE",
+ "MCINTOSH",
+ "MCINTYRE",
+ "MCKAY",
+ "MCKEE",
+ "MCKEEVER",
+ "MCKENNA",
+ "MCKENNEY",
+ "MCKENZIE",
+ "MCKEON",
+ "MCKEOWN",
+ "MCKINLEY",
+ "MCKINNEY",
+ "MCKINNON",
+ "MCKNIGHT",
+ "MCLAIN",
+ "MCLAUGHLIN",
+ "MCLAURIN",
+ "MCLEAN",
+ "MCLEMORE",
+ "MCLENDON",
+ "MCLEOD",
+ "MCMAHAN",
+ "MCMAHON",
+ "MCMANUS",
+ "MCMASTER",
+ "MCMILLAN",
+ "MCMILLEN",
+ "MCMILLIAN",
+ "MCMULLEN",
+ "MCMURRAY",
+ "MCNABB",
+ "MCNAIR",
+ "MCNALLY",
+ "MCNAMARA",
+ "MCNEAL",
+ "MCNEELY",
+ "MCNEIL",
+ "MCNEILL",
+ "MCNULTY",
+ "MCNUTT",
+ "MCPHERSON",
+ "MCQUEEN",
+ "MCRAE",
+ "MCREYNOLDS",
+ "MCSWAIN",
+ "MCVAY",
+ "MCVEY",
+ "MCWHORTER",
+ "MCWILLIAMS",
+ "MEACHAM",
+ "MEAD",
+ "MEADE",
+ "MEADOR",
+ "MEADOWS",
+ "MEANS",
+ "MEARS",
+ "MEDEIROS",
+ "MEDINA",
+ "MEDLEY",
+ "MEDLIN",
+ "MEDLOCK",
+ "MEDRANO",
+ "MEEHAN",
+ "MEEK",
+ "MEEKER",
+ "MEEKS",
+ "MEIER",
+ "MEJIA",
+ "MELANCON",
+ "MELENDEZ",
+ "MELLO",
+ "MELTON",
+ "MELVIN",
+ "MENA",
+ "MENARD",
+ "MENDENHALL",
+ "MENDEZ",
+ "MENDOZA",
+ "MENENDEZ",
+ "MERCADO",
+ "MERCER",
+ "MERCHANT",
+ "MERCIER",
+ "MEREDITH",
+ "MERRELL",
+ "MERRICK",
+ "MERRILL",
+ "MERRIMAN",
+ "MERRITT",
+ "MESA",
+ "MESSENGER",
+ "MESSER",
+ "MESSINA",
+ "METCALF",
+ "METZ",
+ "METZGER",
+ "METZLER",
+ "MEYER",
+ "MEYERS",
+ "MEZA",
+ "MICHAEL",
+ "MICHAELS",
+ "MICHAUD",
+ "MICHEL",
+ "MICKENS",
+ "MIDDLETON",
+ "MILAM",
+ "MILBURN",
+ "MILES",
+ "MILLARD",
+ "MILLER",
+ "MILLIGAN",
+ "MILLIKEN",
+ "MILLS",
+ "MILNE",
+ "MILNER",
+ "MILTON",
+ "MIMS",
+ "MINER",
+ "MINNICK",
+ "MINOR",
+ "MINTER",
+ "MINTON",
+ "MINTZ",
+ "MIRANDA",
+ "MIRELES",
+ "MITCHELL",
+ "MIXON",
+ "MIZE",
+ "MOBLEY",
+ "MOCK",
+ "MOE",
+ "MOELLER",
+ "MOEN",
+ "MOFFETT",
+ "MOFFITT",
+ "MOHR",
+ "MOJICA",
+ "MOLINA",
+ "MOLL",
+ "MONACO",
+ "MONAGHAN",
+ "MONAHAN",
+ "MONEY",
+ "MONIZ",
+ "MONK",
+ "MONROE",
+ "MONSON",
+ "MONTAGUE",
+ "MONTALVO",
+ "MONTANEZ",
+ "MONTANO",
+ "MONTEMAYOR",
+ "MONTERO",
+ "MONTES",
+ "MONTEZ",
+ "MONTGOMERY",
+ "MONTOYA",
+ "MOODY",
+ "MOON",
+ "MOONEY",
+ "MOORE",
+ "MOORMAN",
+ "MORA",
+ "MORALES",
+ "MORAN",
+ "MOREAU",
+ "MOREHEAD",
+ "MORELAND",
+ "MORENO",
+ "MOREY",
+ "MORGAN",
+ "MORIARTY",
+ "MORIN",
+ "MORLEY",
+ "MORRELL",
+ "MORRILL",
+ "MORRIS",
+ "MORRISON",
+ "MORRISSEY",
+ "MORROW",
+ "MORSE",
+ "MORTENSEN",
+ "MORTON",
+ "MOSBY",
+ "MOSELEY",
+ "MOSER",
+ "MOSES",
+ "MOSHER",
+ "MOSIER",
+ "MOSLEY",
+ "MOSS",
+ "MOTLEY",
+ "MOTT",
+ "MOULTON",
+ "MOULTRIE",
+ "MOUNT",
+ "MOWERY",
+ "MOYA",
+ "MOYE",
+ "MOYER",
+ "MUELLER",
+ "MUHAMMAD",
+ "MUIR",
+ "MULKEY",
+ "MULL",
+ "MULLEN",
+ "MULLER",
+ "MULLIGAN",
+ "MULLIN",
+ "MULLINS",
+ "MULLIS",
+ "MUNCY",
+ "MUNDY",
+ "MUNIZ",
+ "MUNN",
+ "MUNOZ",
+ "MUNSON",
+ "MURDOCK",
+ "MURILLO",
+ "MURPHY",
+ "MURRAY",
+ "MURRELL",
+ "MURRY",
+ "MUSE",
+ "MUSGROVE",
+ "MUSSER",
+ "MYERS",
+ "MYLES",
+ "MYRICK",
+ "NABORS",
+ "NADEAU",
+ "NAGEL",
+ "NAGLE",
+ "NAGY",
+ "NAJERA",
+ "NAKAMURA",
+ "NALL",
+ "NANCE",
+ "NAPIER",
+ "NAQUIN",
+ "NARANJO",
+ "NARVAEZ",
+ "NASH",
+ "NATHAN",
+ "NATION",
+ "NAVA",
+ "NAVARRETE",
+ "NAVARRO",
+ "NAYLOR",
+ "NEAL",
+ "NEALY",
+ "NEEDHAM",
+ "NEEL",
+ "NEELEY",
+ "NEELY",
+ "NEFF",
+ "NEGRETE",
+ "NEGRON",
+ "NEIL",
+ "NEILL",
+ "NELMS",
+ "NELSON",
+ "NESBITT",
+ "NESMITH",
+ "NESS",
+ "NESTOR",
+ "NETTLES",
+ "NEUMAN",
+ "NEUMANN",
+ "NEVAREZ",
+ "NEVILLE",
+ "NEW",
+ "NEWBERRY",
+ "NEWBY",
+ "NEWCOMB",
+ "NEWELL",
+ "NEWKIRK",
+ "NEWMAN",
+ "NEWSOM",
+ "NEWSOME",
+ "NEWTON",
+ "NG",
+ "NGO",
+ "NGUYEN",
+ "NICHOLAS",
+ "NICHOLS",
+ "NICHOLSON",
+ "NICKEL",
+ "NICKERSON",
+ "NIELSEN",
+ "NIELSON",
+ "NIETO",
+ "NIEVES",
+ "NILES",
+ "NIX",
+ "NIXON",
+ "NOBLE",
+ "NOBLES",
+ "NOE",
+ "NOEL",
+ "NOLAN",
+ "NOLAND",
+ "NOLEN",
+ "NOLL",
+ "NOONAN",
+ "NORFLEET",
+ "NORIEGA",
+ "NORMAN",
+ "NORRIS",
+ "NORTH",
+ "NORTON",
+ "NORWOOD",
+ "NOVAK",
+ "NOVOTNY",
+ "NOWAK",
+ "NOWLIN",
+ "NOYES",
+ "NUGENT",
+ "NULL",
+ "NUMBERS",
+ "NUNES",
+ "NUNEZ",
+ "NUNLEY",
+ "NUNN",
+ "NUTT",
+ "NUTTER",
+ "NYE",
+ "OAKES",
+ "OAKLEY",
+ "OAKS",
+ "OATES",
+ "OBRIEN",
+ "OBRYAN",
+ "OCAMPO",
+ "OCASIO",
+ "OCHOA",
+ "OCHS",
+ "OCONNELL",
+ "OCONNER",
+ "OCONNOR",
+ "ODELL",
+ "ODEN",
+ "ODOM",
+ "ODONNELL",
+ "ODUM",
+ "OGDEN",
+ "OGLE",
+ "OGLESBY",
+ "OH",
+ "OHARA",
+ "OJEDA",
+ "OKEEFE",
+ "OLDHAM",
+ "OLDS",
+ "OLEARY",
+ "OLIPHANT",
+ "OLIVA",
+ "OLIVARES",
+ "OLIVAREZ",
+ "OLIVAS",
+ "OLIVE",
+ "OLIVEIRA",
+ "OLIVER",
+ "OLIVO",
+ "OLMSTEAD",
+ "OLSEN",
+ "OLSON",
+ "OLVERA",
+ "OMALLEY",
+ "ONEAL",
+ "ONEIL",
+ "ONEILL",
+ "ONTIVEROS",
+ "ORDONEZ",
+ "OREILLY",
+ "ORELLANA",
+ "ORLANDO",
+ "ORNELAS",
+ "OROSCO",
+ "OROURKE",
+ "OROZCO",
+ "ORR",
+ "ORTA",
+ "ORTEGA",
+ "ORTIZ",
+ "OSBORN",
+ "OSBORNE",
+ "OSBURN",
+ "OSGOOD",
+ "OSHEA",
+ "OSORIO",
+ "OSTEEN",
+ "OSTRANDER",
+ "OSULLIVAN",
+ "OSWALD",
+ "OSWALT",
+ "OTERO",
+ "OTIS",
+ "OTOOLE",
+ "OTT",
+ "OTTO",
+ "OUELLETTE",
+ "OUTLAW",
+ "OVERBY",
+ "OVERSTREET",
+ "OVERTON",
+ "OWEN",
+ "OWENS",
+ "PACE",
+ "PACHECO",
+ "PACK",
+ "PACKARD",
+ "PACKER",
+ "PADGETT",
+ "PADILLA",
+ "PAGAN",
+ "PAGE",
+ "PAIGE",
+ "PAINE",
+ "PAINTER",
+ "PAK",
+ "PALACIOS",
+ "PALMA",
+ "PALMER",
+ "PALUMBO",
+ "PANNELL",
+ "PANTOJA",
+ "PAPE",
+ "PAPPAS",
+ "PAQUETTE",
+ "PARADIS",
+ "PARDO",
+ "PAREDES",
+ "PARENT",
+ "PARHAM",
+ "PARIS",
+ "PARISH",
+ "PARK",
+ "PARKER",
+ "PARKINSON",
+ "PARKS",
+ "PARNELL",
+ "PARR",
+ "PARRA",
+ "PARRIS",
+ "PARRISH",
+ "PARROTT",
+ "PARRY",
+ "PARSON",
+ "PARSONS",
+ "PARTIN",
+ "PARTRIDGE",
+ "PASSMORE",
+ "PATE",
+ "PATEL",
+ "PATERSON",
+ "PATINO",
+ "PATRICK",
+ "PATTEN",
+ "PATTERSON",
+ "PATTON",
+ "PAUL",
+ "PAULEY",
+ "PAULSEN",
+ "PAULSON",
+ "PAXTON",
+ "PAYNE",
+ "PAYTON",
+ "PAZ",
+ "PEACE",
+ "PEACHEY",
+ "PEACOCK",
+ "PEAK",
+ "PEARCE",
+ "PEARSON",
+ "PEASE",
+ "PECK",
+ "PEDERSEN",
+ "PEDERSON",
+ "PEEBLES",
+ "PEEK",
+ "PEEL",
+ "PEELER",
+ "PEEPLES",
+ "PELLETIER",
+ "PELTIER",
+ "PEMBERTON",
+ "PENA",
+ "PENCE",
+ "PENDER",
+ "PENDERGRASS",
+ "PENDLETON",
+ "PENN",
+ "PENNELL",
+ "PENNINGTON",
+ "PENNY",
+ "PEOPLES",
+ "PEPPER",
+ "PERALES",
+ "PERALTA",
+ "PERDUE",
+ "PEREA",
+ "PEREIRA",
+ "PEREZ",
+ "PERKINS",
+ "PERREAULT",
+ "PERRIN",
+ "PERRON",
+ "PERRY",
+ "PERRYMAN",
+ "PERSON",
+ "PETER",
+ "PETERMAN",
+ "PETERS",
+ "PETERSEN",
+ "PETERSON",
+ "PETIT",
+ "PETRIE",
+ "PETTIGREW",
+ "PETTIS",
+ "PETTIT",
+ "PETTWAY",
+ "PETTY",
+ "PEYTON",
+ "PFEIFER",
+ "PFEIFFER",
+ "PHAM",
+ "PHAN",
+ "PHELAN",
+ "PHELPS",
+ "PHIFER",
+ "PHILLIPS",
+ "PHIPPS",
+ "PICARD",
+ "PICKARD",
+ "PICKENS",
+ "PICKERING",
+ "PICKETT",
+ "PIERCE",
+ "PIERRE",
+ "PIERSON",
+ "PIKE",
+ "PILCHER",
+ "PIMENTEL",
+ "PINA",
+ "PINCKNEY",
+ "PINEDA",
+ "PINKERTON",
+ "PINKSTON",
+ "PINO",
+ "PINSON",
+ "PINTO",
+ "PIPER",
+ "PIPKIN",
+ "PIPPIN",
+ "PITMAN",
+ "PITRE",
+ "PITT",
+ "PITTMAN",
+ "PITTS",
+ "PLACE",
+ "PLANTE",
+ "PLATT",
+ "PLEASANT",
+ "PLUMMER",
+ "PLUNKETT",
+ "POE",
+ "POGUE",
+ "POINDEXTER",
+ "POINTER",
+ "POIRIER",
+ "POLANCO",
+ "POLAND",
+ "POLING",
+ "POLK",
+ "POLLACK",
+ "POLLARD",
+ "POLLOCK",
+ "POMEROY",
+ "PONCE",
+ "POND",
+ "PONDER",
+ "POOL",
+ "POOLE",
+ "POORE",
+ "POPE",
+ "POPP",
+ "PORTER",
+ "PORTERFIELD",
+ "PORTILLO",
+ "POSEY",
+ "POST",
+ "POSTON",
+ "POTTER",
+ "POTTS",
+ "POULIN",
+ "POUNDS",
+ "POWELL",
+ "POWER",
+ "POWERS",
+ "PRADO",
+ "PRATER",
+ "PRATHER",
+ "PRATT",
+ "PRENTICE",
+ "PRESCOTT",
+ "PRESLEY",
+ "PRESSLEY",
+ "PRESTON",
+ "PREWITT",
+ "PRICE",
+ "PRICHARD",
+ "PRIDE",
+ "PRIDGEN",
+ "PRIEST",
+ "PRIETO",
+ "PRINCE",
+ "PRINGLE",
+ "PRITCHARD",
+ "PRITCHETT",
+ "PROCTOR",
+ "PROFFITT",
+ "PROSSER",
+ "PROVOST",
+ "PRUETT",
+ "PRUITT",
+ "PRYOR",
+ "PUCKETT",
+ "PUENTE",
+ "PUGH",
+ "PULIDO",
+ "PULLEN",
+ "PULLEY",
+ "PULLIAM",
+ "PURCELL",
+ "PURDY",
+ "PURNELL",
+ "PURVIS",
+ "PUTMAN",
+ "PUTNAM",
+ "PYLE",
+ "QUALLS",
+ "QUARLES",
+ "QUEEN",
+ "QUEZADA",
+ "QUICK",
+ "QUIGLEY",
+ "QUILLEN",
+ "QUINLAN",
+ "QUINN",
+ "QUINONES",
+ "QUINONEZ",
+ "QUINTANA",
+ "QUINTANILLA",
+ "QUINTERO",
+ "QUIROZ",
+ "RADER",
+ "RADFORD",
+ "RAFFERTY",
+ "RAGAN",
+ "RAGLAND",
+ "RAGSDALE",
+ "RAINES",
+ "RAINEY",
+ "RAINS",
+ "RALEY",
+ "RALPH",
+ "RALSTON",
+ "RAMEY",
+ "RAMIREZ",
+ "RAMON",
+ "RAMOS",
+ "RAMSAY",
+ "RAMSEY",
+ "RAND",
+ "RANDALL",
+ "RANDLE",
+ "RANDOLPH",
+ "RANEY",
+ "RANGEL",
+ "RANKIN",
+ "RANSOM",
+ "RAPP",
+ "RASH",
+ "RASMUSSEN",
+ "RATCLIFF",
+ "RATLIFF",
+ "RAU",
+ "RAUCH",
+ "RAWLINGS",
+ "RAWLINS",
+ "RAWLS",
+ "RAY",
+ "RAYBURN",
+ "RAYFORD",
+ "RAYMOND",
+ "RAYNOR",
+ "RAZO",
+ "REA",
+ "READ",
+ "REAGAN",
+ "REARDON",
+ "REAVES",
+ "RECTOR",
+ "REDD",
+ "REDDEN",
+ "REDDICK",
+ "REDDING",
+ "REDDY",
+ "REDMAN",
+ "REDMON",
+ "REDMOND",
+ "REECE",
+ "REED",
+ "REEDER",
+ "REEDY",
+ "REES",
+ "REESE",
+ "REEVES",
+ "REGALADO",
+ "REGAN",
+ "REGISTER",
+ "REICH",
+ "REICHERT",
+ "REID",
+ "REILLY",
+ "REINHARDT",
+ "REINHART",
+ "REIS",
+ "REITER",
+ "RENDON",
+ "RENFRO",
+ "RENNER",
+ "RENO",
+ "RENTERIA",
+ "REUTER",
+ "REY",
+ "REYES",
+ "REYNA",
+ "REYNOLDS",
+ "REYNOSO",
+ "RHEA",
+ "RHOADES",
+ "RHOADS",
+ "RHODEN",
+ "RHODES",
+ "RICCI",
+ "RICE",
+ "RICH",
+ "RICHARD",
+ "RICHARDS",
+ "RICHARDSON",
+ "RICHEY",
+ "RICHIE",
+ "RICHMOND",
+ "RICHTER",
+ "RICKARD",
+ "RICKER",
+ "RICKETTS",
+ "RICKMAN",
+ "RICKS",
+ "RICO",
+ "RIDDELL",
+ "RIDDICK",
+ "RIDDLE",
+ "RIDENOUR",
+ "RIDER",
+ "RIDGEWAY",
+ "RIDLEY",
+ "RIFE",
+ "RIGBY",
+ "RIGGINS",
+ "RIGGS",
+ "RIGSBY",
+ "RILEY",
+ "RINALDI",
+ "RINEHART",
+ "RING",
+ "RIOS",
+ "RIPLEY",
+ "RITCHEY",
+ "RITCHIE",
+ "RITTER",
+ "RIVAS",
+ "RIVERA",
+ "RIVERS",
+ "RIZZO",
+ "ROACH",
+ "ROARK",
+ "ROBB",
+ "ROBBINS",
+ "ROBERGE",
+ "ROBERSON",
+ "ROBERT",
+ "ROBERTS",
+ "ROBERTSON",
+ "ROBEY",
+ "ROBINETTE",
+ "ROBINS",
+ "ROBINSON",
+ "ROBISON",
+ "ROBLES",
+ "ROBSON",
+ "ROBY",
+ "ROCHA",
+ "ROCHE",
+ "ROCK",
+ "ROCKWELL",
+ "RODEN",
+ "RODERICK",
+ "RODGERS",
+ "RODRIGUE",
+ "RODRIGUES",
+ "RODRIGUEZ",
+ "RODRIQUEZ",
+ "ROE",
+ "ROGER",
+ "ROGERS",
+ "ROHR",
+ "ROJAS",
+ "ROLAND",
+ "ROLDAN",
+ "ROLLER",
+ "ROLLINS",
+ "ROMAN",
+ "ROMANO",
+ "ROMEO",
+ "ROMERO",
+ "ROMO",
+ "RONEY",
+ "ROONEY",
+ "ROOT",
+ "ROPER",
+ "ROQUE",
+ "ROSA",
+ "ROSADO",
+ "ROSALES",
+ "ROSARIO",
+ "ROSAS",
+ "ROSE",
+ "ROSEN",
+ "ROSENBAUM",
+ "ROSENBERG",
+ "ROSENTHAL",
+ "ROSS",
+ "ROSSER",
+ "ROSSI",
+ "ROTH",
+ "ROUNDS",
+ "ROUNDTREE",
+ "ROUNTREE",
+ "ROUSE",
+ "ROUSH",
+ "ROUSSEAU",
+ "ROUSSEL",
+ "ROWAN",
+ "ROWE",
+ "ROWELL",
+ "ROWLAND",
+ "ROWLEY",
+ "ROY",
+ "ROYAL",
+ "ROYBAL",
+ "ROYER",
+ "ROYSTER",
+ "RUBIN",
+ "RUBIO",
+ "RUBY",
+ "RUCKER",
+ "RUDD",
+ "RUDOLPH",
+ "RUFF",
+ "RUFFIN",
+ "RUIZ",
+ "RUNYAN",
+ "RUNYON",
+ "RUPERT",
+ "RUPP",
+ "RUSH",
+ "RUSHING",
+ "RUSS",
+ "RUSSELL",
+ "RUSSO",
+ "RUST",
+ "RUTH",
+ "RUTHERFORD",
+ "RUTLEDGE",
+ "RYAN",
+ "RYDER",
+ "SAAVEDRA",
+ "SABO",
+ "SACCO",
+ "SADLER",
+ "SAENZ",
+ "SAGE",
+ "SAGER",
+ "SALAS",
+ "SALAZAR",
+ "SALCEDO",
+ "SALCIDO",
+ "SALDANA",
+ "SALDIVAR",
+ "SALERNO",
+ "SALES",
+ "SALGADO",
+ "SALINAS",
+ "SALISBURY",
+ "SALLEE",
+ "SALLEY",
+ "SALMON",
+ "SALTER",
+ "SAM",
+ "SAMMONS",
+ "SAMPLE",
+ "SAMPLES",
+ "SAMPSON",
+ "SAMS",
+ "SAMSON",
+ "SAMUEL",
+ "SAMUELS",
+ "SANBORN",
+ "SANCHES",
+ "SANCHEZ",
+ "SANDBERG",
+ "SANDER",
+ "SANDERS",
+ "SANDERSON",
+ "SANDLIN",
+ "SANDOVAL",
+ "SANDS",
+ "SANFORD",
+ "SANTANA",
+ "SANTIAGO",
+ "SANTOS",
+ "SAPP",
+ "SARGENT",
+ "SASSER",
+ "SATTERFIELD",
+ "SAUCEDO",
+ "SAUCIER",
+ "SAUER",
+ "SAULS",
+ "SAUNDERS",
+ "SAVAGE",
+ "SAVOY",
+ "SAWYER",
+ "SAWYERS",
+ "SAXON",
+ "SAXTON",
+ "SAYERS",
+ "SAYLOR",
+ "SAYRE",
+ "SCALES",
+ "SCANLON",
+ "SCARBOROUGH",
+ "SCARBROUGH",
+ "SCHAEFER",
+ "SCHAEFFER",
+ "SCHAFER",
+ "SCHAFFER",
+ "SCHELL",
+ "SCHERER",
+ "SCHILLER",
+ "SCHILLING",
+ "SCHINDLER",
+ "SCHMID",
+ "SCHMIDT",
+ "SCHMITT",
+ "SCHMITZ",
+ "SCHNEIDER",
+ "SCHOFIELD",
+ "SCHOLL",
+ "SCHOONOVER",
+ "SCHOTT",
+ "SCHRADER",
+ "SCHREIBER",
+ "SCHREINER",
+ "SCHROEDER",
+ "SCHUBERT",
+ "SCHULER",
+ "SCHULTE",
+ "SCHULTZ",
+ "SCHULZ",
+ "SCHULZE",
+ "SCHUMACHER",
+ "SCHUSTER",
+ "SCHWAB",
+ "SCHWARTZ",
+ "SCHWARZ",
+ "SCHWEITZER",
+ "SCOGGINS",
+ "SCOTT",
+ "SCRIBNER",
+ "SCROGGINS",
+ "SCRUGGS",
+ "SCULLY",
+ "SEAL",
+ "SEALS",
+ "SEAMAN",
+ "SEARCY",
+ "SEARS",
+ "SEATON",
+ "SEAY",
+ "SEE",
+ "SEELEY",
+ "SEGURA",
+ "SEIBERT",
+ "SEIDEL",
+ "SEIFERT",
+ "SEILER",
+ "SEITZ",
+ "SELBY",
+ "SELF",
+ "SELL",
+ "SELLERS",
+ "SELLS",
+ "SENA",
+ "SEPULVEDA",
+ "SERNA",
+ "SERRANO",
+ "SESSIONS",
+ "SETTLE",
+ "SETTLES",
+ "SEVERSON",
+ "SEWARD",
+ "SEWELL",
+ "SEXTON",
+ "SEYMORE",
+ "SEYMOUR",
+ "SHACKELFORD",
+ "SHADE",
+ "SHAFER",
+ "SHAFFER",
+ "SHAH",
+ "SHANK",
+ "SHANKS",
+ "SHANNON",
+ "SHAPIRO",
+ "SHARKEY",
+ "SHARP",
+ "SHARPE",
+ "SHAVER",
+ "SHAW",
+ "SHAY",
+ "SHEA",
+ "SHEARER",
+ "SHEEHAN",
+ "SHEETS",
+ "SHEFFIELD",
+ "SHELBY",
+ "SHELDON",
+ "SHELL",
+ "SHELLEY",
+ "SHELLY",
+ "SHELTON",
+ "SHEPARD",
+ "SHEPHARD",
+ "SHEPHERD",
+ "SHEPPARD",
+ "SHERIDAN",
+ "SHERMAN",
+ "SHERRILL",
+ "SHERROD",
+ "SHERRY",
+ "SHERWOOD",
+ "SHIELDS",
+ "SHIFFLETT",
+ "SHIN",
+ "SHINN",
+ "SHIPLEY",
+ "SHIPMAN",
+ "SHIPP",
+ "SHIRLEY",
+ "SHIVELY",
+ "SHIVERS",
+ "SHOCKLEY",
+ "SHOEMAKER",
+ "SHOOK",
+ "SHORE",
+ "SHORES",
+ "SHORT",
+ "SHORTER",
+ "SHRADER",
+ "SHULER",
+ "SHULL",
+ "SHULTZ",
+ "SHUMAKER",
+ "SHUMAN",
+ "SHUMATE",
+ "SIBLEY",
+ "SIDES",
+ "SIEGEL",
+ "SIERRA",
+ "SIGLER",
+ "SIKES",
+ "SILER",
+ "SILLS",
+ "SILVA",
+ "SILVER",
+ "SILVERMAN",
+ "SILVERS",
+ "SILVIA",
+ "SIMMONS",
+ "SIMMS",
+ "SIMON",
+ "SIMONE",
+ "SIMONS",
+ "SIMONSON",
+ "SIMPKINS",
+ "SIMPSON",
+ "SIMS",
+ "SINCLAIR",
+ "SINGER",
+ "SINGH",
+ "SINGLETARY",
+ "SINGLETON",
+ "SIPES",
+ "SISCO",
+ "SISK",
+ "SISSON",
+ "SIZEMORE",
+ "SKAGGS",
+ "SKELTON",
+ "SKIDMORE",
+ "SKINNER",
+ "SKIPPER",
+ "SLACK",
+ "SLADE",
+ "SLAGLE",
+ "SLATER",
+ "SLATON",
+ "SLATTERY",
+ "SLAUGHTER",
+ "SLAYTON",
+ "SLEDGE",
+ "SLOAN",
+ "SLOCUM",
+ "SLONE",
+ "SMALL",
+ "SMALLEY",
+ "SMALLS",
+ "SMALLWOOD",
+ "SMART",
+ "SMILEY",
+ "SMITH",
+ "SMITHSON",
+ "SMOOT",
+ "SMOTHERS",
+ "SMYTH",
+ "SNEAD",
+ "SNEED",
+ "SNELL",
+ "SNIDER",
+ "SNIPES",
+ "SNODGRASS",
+ "SNOW",
+ "SNOWDEN",
+ "SNYDER",
+ "SOARES",
+ "SOLANO",
+ "SOLIS",
+ "SOLIZ",
+ "SOLOMON",
+ "SOMERS",
+ "SOMERVILLE",
+ "SOMMER",
+ "SOMMERS",
+ "SONG",
+ "SORENSEN",
+ "SORENSON",
+ "SORIA",
+ "SORIANO",
+ "SORRELL",
+ "SOSA",
+ "SOTELO",
+ "SOTO",
+ "SOUSA",
+ "SOUTH",
+ "SOUTHARD",
+ "SOUTHERLAND",
+ "SOUTHERN",
+ "SOUZA",
+ "SOWELL",
+ "SOWERS",
+ "SPAIN",
+ "SPALDING",
+ "SPANGLER",
+ "SPANN",
+ "SPARKMAN",
+ "SPARKS",
+ "SPARROW",
+ "SPAULDING",
+ "SPEAR",
+ "SPEARMAN",
+ "SPEARS",
+ "SPEED",
+ "SPEER",
+ "SPEIGHT",
+ "SPELLMAN",
+ "SPENCE",
+ "SPENCER",
+ "SPERRY",
+ "SPICER",
+ "SPILLMAN",
+ "SPINKS",
+ "SPIVEY",
+ "SPOONER",
+ "SPRADLIN",
+ "SPRAGUE",
+ "SPRIGGS",
+ "SPRING",
+ "SPRINGER",
+ "SPROUSE",
+ "SPRUILL",
+ "SPURGEON",
+ "SPURLOCK",
+ "SQUIRES",
+ "STACEY",
+ "STACK",
+ "STACKHOUSE",
+ "STACY",
+ "STAFFORD",
+ "STAGGS",
+ "STAHL",
+ "STALEY",
+ "STALLINGS",
+ "STALLWORTH",
+ "STAMM",
+ "STAMPER",
+ "STAMPS",
+ "STANFIELD",
+ "STANFORD",
+ "STANLEY",
+ "STANTON",
+ "STAPLES",
+ "STAPLETON",
+ "STARK",
+ "STARKEY",
+ "STARKS",
+ "STARLING",
+ "STARNES",
+ "STARR",
+ "STATEN",
+ "STATON",
+ "STAUFFER",
+ "STCLAIR",
+ "STEADMAN",
+ "STEARNS",
+ "STEED",
+ "STEEL",
+ "STEELE",
+ "STEEN",
+ "STEFFEN",
+ "STEGALL",
+ "STEIN",
+ "STEINBERG",
+ "STEINER",
+ "STEPHEN",
+ "STEPHENS",
+ "STEPHENSON",
+ "STEPP",
+ "STERLING",
+ "STERN",
+ "STEVENS",
+ "STEVENSON",
+ "STEWARD",
+ "STEWART",
+ "STIDHAM",
+ "STILES",
+ "STILL",
+ "STILLMAN",
+ "STILLWELL",
+ "STILTNER",
+ "STINE",
+ "STINNETT",
+ "STINSON",
+ "STITT",
+ "STJOHN",
+ "STOCK",
+ "STOCKTON",
+ "STODDARD",
+ "STOKER",
+ "STOKES",
+ "STOLL",
+ "STONE",
+ "STONER",
+ "STOREY",
+ "STORY",
+ "STOTT",
+ "STOUT",
+ "STOVALL",
+ "STOVER",
+ "STOWE",
+ "STPIERRE",
+ "STRAIN",
+ "STRAND",
+ "STRANGE",
+ "STRATTON",
+ "STRAUB",
+ "STRAUSS",
+ "STREET",
+ "STREETER",
+ "STRICKLAND",
+ "STRINGER",
+ "STRONG",
+ "STROTHER",
+ "STROUD",
+ "STROUP",
+ "STRUNK",
+ "STUART",
+ "STUBBLEFIELD",
+ "STUBBS",
+ "STUCKEY",
+ "STULL",
+ "STUMP",
+ "STURDIVANT",
+ "STURGEON",
+ "STURGILL",
+ "STURGIS",
+ "STURM",
+ "STYLES",
+ "SUAREZ",
+ "SUGGS",
+ "SULLIVAN",
+ "SUMMERLIN",
+ "SUMMERS",
+ "SUMNER",
+ "SUMPTER",
+ "SUN",
+ "SUTHERLAND",
+ "SUTTER",
+ "SUTTON",
+ "SWAFFORD",
+ "SWAIN",
+ "SWAN",
+ "SWANK",
+ "SWANN",
+ "SWANSON",
+ "SWARTZ",
+ "SWEARINGEN",
+ "SWEAT",
+ "SWEENEY",
+ "SWEET",
+ "SWENSON",
+ "SWIFT",
+ "SWISHER",
+ "SWITZER",
+ "SWOPE",
+ "SYKES",
+ "SYLVESTER",
+ "TABER",
+ "TABOR",
+ "TACKETT",
+ "TAFT",
+ "TAGGART",
+ "TALBERT",
+ "TALBOT",
+ "TALBOTT",
+ "TALLENT",
+ "TALLEY",
+ "TAM",
+ "TAMAYO",
+ "TAN",
+ "TANAKA",
+ "TANG",
+ "TANNER",
+ "TAPIA",
+ "TAPP",
+ "TARVER",
+ "TATE",
+ "TATUM",
+ "TAVARES",
+ "TAYLOR",
+ "TEAGUE",
+ "TEAL",
+ "TEEL",
+ "TEETER",
+ "TEJADA",
+ "TEJEDA",
+ "TELLEZ",
+ "TEMPLE",
+ "TEMPLETON",
+ "TENNANT",
+ "TENNEY",
+ "TERRELL",
+ "TERRILL",
+ "TERRY",
+ "THACKER",
+ "THAMES",
+ "THAO",
+ "THARP",
+ "THATCHER",
+ "THAYER",
+ "THERIAULT",
+ "THERIOT",
+ "THIBODEAU",
+ "THIBODEAUX",
+ "THIEL",
+ "THIGPEN",
+ "THOMAS",
+ "THOMASON",
+ "THOMPSON",
+ "THOMSEN",
+ "THOMSON",
+ "THORN",
+ "THORNBURG",
+ "THORNE",
+ "THORNHILL",
+ "THORNTON",
+ "THORP",
+ "THORPE",
+ "THORTON",
+ "THRASH",
+ "THRASHER",
+ "THURMAN",
+ "THURSTON",
+ "TIBBETTS",
+ "TIBBS",
+ "TICE",
+ "TIDWELL",
+ "TIERNEY",
+ "TIJERINA",
+ "TILLER",
+ "TILLERY",
+ "TILLEY",
+ "TILLMAN",
+ "TILTON",
+ "TIMM",
+ "TIMMONS",
+ "TINKER",
+ "TINSLEY",
+ "TIPTON",
+ "TIRADO",
+ "TISDALE",
+ "TITUS",
+ "TOBIAS",
+ "TOBIN",
+ "TODD",
+ "TOLBERT",
+ "TOLEDO",
+ "TOLER",
+ "TOLIVER",
+ "TOLLIVER",
+ "TOM",
+ "TOMLIN",
+ "TOMLINSON",
+ "TOMPKINS",
+ "TONEY",
+ "TONG",
+ "TORO",
+ "TORRENCE",
+ "TORRES",
+ "TORREZ",
+ "TOTH",
+ "TOTTEN",
+ "TOVAR",
+ "TOWNES",
+ "TOWNS",
+ "TOWNSEND",
+ "TRACY",
+ "TRAHAN",
+ "TRAMMELL",
+ "TRAN",
+ "TRAPP",
+ "TRASK",
+ "TRAVERS",
+ "TRAVIS",
+ "TRAYLOR",
+ "TREADWAY",
+ "TREADWELL",
+ "TREJO",
+ "TREMBLAY",
+ "TRENT",
+ "TREVINO",
+ "TRIBBLE",
+ "TRICE",
+ "TRIMBLE",
+ "TRINIDAD",
+ "TRIPLETT",
+ "TRIPP",
+ "TROTTER",
+ "TROUT",
+ "TROUTMAN",
+ "TROY",
+ "TRUDEAU",
+ "TRUE",
+ "TRUITT",
+ "TRUJILLO",
+ "TRUONG",
+ "TUBBS",
+ "TUCK",
+ "TUCKER",
+ "TUGGLE",
+ "TURK",
+ "TURLEY",
+ "TURMAN",
+ "TURNBULL",
+ "TURNER",
+ "TURNEY",
+ "TURPIN",
+ "TUTTLE",
+ "TYLER",
+ "TYNER",
+ "TYREE",
+ "TYSON",
+ "ULRICH",
+ "UNDERHILL",
+ "UNDERWOOD",
+ "UNGER",
+ "UPCHURCH",
+ "UPSHAW",
+ "UPTON",
+ "URBAN",
+ "URBINA",
+ "URIBE",
+ "USHER",
+ "UTLEY",
+ "VAIL",
+ "VALADEZ",
+ "VALDES",
+ "VALDEZ",
+ "VALENCIA",
+ "VALENTI",
+ "VALENTIN",
+ "VALENTINE",
+ "VALENZUELA",
+ "VALERIO",
+ "VALLE",
+ "VALLEJO",
+ "VALLES",
+ "VAN",
+ "VANBUREN",
+ "VANCE",
+ "VANDIVER",
+ "VANDYKE",
+ "VANG",
+ "VANHOOSE",
+ "VANHORN",
+ "VANMETER",
+ "VANN",
+ "VANOVER",
+ "VANWINKLE",
+ "VARELA",
+ "VARGAS",
+ "VARNER",
+ "VARNEY",
+ "VASQUEZ",
+ "VAUGHAN",
+ "VAUGHN",
+ "VAUGHT",
+ "VAZQUEZ",
+ "VEAL",
+ "VEGA",
+ "VELA",
+ "VELASCO",
+ "VELASQUEZ",
+ "VELAZQUEZ",
+ "VELEZ",
+ "VENABLE",
+ "VENEGAS",
+ "VENTURA",
+ "VERA",
+ "VERDIN",
+ "VERGARA",
+ "VERNON",
+ "VEST",
+ "VETTER",
+ "VICK",
+ "VICKERS",
+ "VICKERY",
+ "VICTOR",
+ "VIDAL",
+ "VIEIRA",
+ "VIERA",
+ "VIGIL",
+ "VILLA",
+ "VILLALOBOS",
+ "VILLANUEVA",
+ "VILLAREAL",
+ "VILLARREAL",
+ "VILLASENOR",
+ "VILLEGAS",
+ "VINCENT",
+ "VINES",
+ "VINSON",
+ "VITALE",
+ "VO",
+ "VOGEL",
+ "VOGT",
+ "VOSS",
+ "VU",
+ "VUE",
+ "WADDELL",
+ "WADE",
+ "WADSWORTH",
+ "WAGGONER",
+ "WAGNER",
+ "WAGONER",
+ "WAHL",
+ "WAITE",
+ "WAKEFIELD",
+ "WALDEN",
+ "WALDRON",
+ "WALDROP",
+ "WALKER",
+ "WALL",
+ "WALLACE",
+ "WALLEN",
+ "WALLER",
+ "WALLING",
+ "WALLIS",
+ "WALLS",
+ "WALSH",
+ "WALSTON",
+ "WALTER",
+ "WALTERS",
+ "WALTON",
+ "WAMPLER",
+ "WANG",
+ "WARD",
+ "WARDEN",
+ "WARE",
+ "WARFIELD",
+ "WARNER",
+ "WARREN",
+ "WASHBURN",
+ "WASHINGTON",
+ "WASSON",
+ "WATERMAN",
+ "WATERS",
+ "WATKINS",
+ "WATSON",
+ "WATT",
+ "WATTERS",
+ "WATTS",
+ "WAUGH",
+ "WAY",
+ "WAYNE",
+ "WEATHERFORD",
+ "WEATHERLY",
+ "WEATHERS",
+ "WEAVER",
+ "WEBB",
+ "WEBBER",
+ "WEBER",
+ "WEBSTER",
+ "WEDDLE",
+ "WEED",
+ "WEEKS",
+ "WEEMS",
+ "WEINBERG",
+ "WEINER",
+ "WEINSTEIN",
+ "WEIR",
+ "WEIS",
+ "WEISS",
+ "WELCH",
+ "WELDON",
+ "WELKER",
+ "WELLER",
+ "WELLMAN",
+ "WELLS",
+ "WELSH",
+ "WENDT",
+ "WENGER",
+ "WENTWORTH",
+ "WENTZ",
+ "WENZEL",
+ "WERNER",
+ "WERTZ",
+ "WESLEY",
+ "WEST",
+ "WESTBROOK",
+ "WESTER",
+ "WESTFALL",
+ "WESTMORELAND",
+ "WESTON",
+ "WETZEL",
+ "WHALEN",
+ "WHALEY",
+ "WHARTON",
+ "WHATLEY",
+ "WHEAT",
+ "WHEATLEY",
+ "WHEATON",
+ "WHEELER",
+ "WHELAN",
+ "WHIPPLE",
+ "WHITAKER",
+ "WHITCOMB",
+ "WHITE",
+ "WHITED",
+ "WHITEHEAD",
+ "WHITEHURST",
+ "WHITEMAN",
+ "WHITESIDE",
+ "WHITFIELD",
+ "WHITING",
+ "WHITLEY",
+ "WHITLOCK",
+ "WHITLOW",
+ "WHITMAN",
+ "WHITMIRE",
+ "WHITMORE",
+ "WHITNEY",
+ "WHITSON",
+ "WHITT",
+ "WHITTAKER",
+ "WHITTEN",
+ "WHITTINGTON",
+ "WHITTLE",
+ "WHITWORTH",
+ "WHYTE",
+ "WICK",
+ "WICKER",
+ "WICKHAM",
+ "WICKS",
+ "WIESE",
+ "WIGGINS",
+ "WILBANKS",
+ "WILBER",
+ "WILBUR",
+ "WILBURN",
+ "WILCOX",
+ "WILD",
+ "WILDE",
+ "WILDER",
+ "WILES",
+ "WILEY",
+ "WILHELM",
+ "WILHITE",
+ "WILKE",
+ "WILKERSON",
+ "WILKES",
+ "WILKINS",
+ "WILKINSON",
+ "WILKS",
+ "WILL",
+ "WILLARD",
+ "WILLETT",
+ "WILLEY",
+ "WILLIAM",
+ "WILLIAMS",
+ "WILLIAMSON",
+ "WILLIFORD",
+ "WILLINGHAM",
+ "WILLIS",
+ "WILLOUGHBY",
+ "WILLS",
+ "WILLSON",
+ "WILMOTH",
+ "WILSON",
+ "WILT",
+ "WIMBERLY",
+ "WINCHESTER",
+ "WINDHAM",
+ "WINFIELD",
+ "WINFREY",
+ "WING",
+ "WINGATE",
+ "WINGFIELD",
+ "WINKLER",
+ "WINN",
+ "WINSLOW",
+ "WINSTEAD",
+ "WINSTON",
+ "WINTER",
+ "WINTERS",
+ "WIRTH",
+ "WISE",
+ "WISEMAN",
+ "WISNIEWSKI",
+ "WITCHER",
+ "WITHERS",
+ "WITHERSPOON",
+ "WITHROW",
+ "WITT",
+ "WITTE",
+ "WOFFORD",
+ "WOLF",
+ "WOLFE",
+ "WOLFF",
+ "WOLFORD",
+ "WOMACK",
+ "WONG",
+ "WOO",
+ "WOOD",
+ "WOODALL",
+ "WOODARD",
+ "WOODBURY",
+ "WOODCOCK",
+ "WOODEN",
+ "WOODLEY",
+ "WOODRUFF",
+ "WOODS",
+ "WOODSON",
+ "WOODWARD",
+ "WOODWORTH",
+ "WOODY",
+ "WOOLDRIDGE",
+ "WOOLEY",
+ "WOOTEN",
+ "WORD",
+ "WORDEN",
+ "WORKMAN",
+ "WORLEY",
+ "WORRELL",
+ "WORSHAM",
+ "WORTH",
+ "WORTHAM",
+ "WORTHINGTON",
+ "WORTHY",
+ "WRAY",
+ "WREN",
+ "WRIGHT",
+ "WU",
+ "WYANT",
+ "WYATT",
+ "WYLIE",
+ "WYMAN",
+ "WYNN",
+ "WYNNE",
+ "XIONG",
+ "YAMAMOTO",
+ "YANCEY",
+ "YANEZ",
+ "YANG",
+ "YARBROUGH",
+ "YATES",
+ "YAZZIE",
+ "YBARRA",
+ "YEAGER",
+ "YEE",
+ "YI",
+ "YOCUM",
+ "YODER",
+ "YOO",
+ "YOON",
+ "YORK",
+ "YOST",
+ "YOUNG",
+ "YOUNGBLOOD",
+ "YOUNGER",
+ "YOUNT",
+ "YU",
+ "ZAMBRANO",
+ "ZAMORA",
+ "ZAPATA",
+ "ZARAGOZA",
+ "ZARATE",
+ "ZAVALA",
+ "ZEIGLER",
+ "ZELLER",
+ "ZEPEDA",
+ "ZHANG",
+ "ZIEGLER",
+ "ZIELINSKI",
+ "ZIMMER",
+ "ZIMMERMAN",
+ "ZINK",
+ "ZOOK",
+ "ZUNIGA"
+ };
+ }
- private static final String[] generateLastNames() {
- return new String[] { "AARON", "ABBOTT", "ABEL", "ABELL", "ABERNATHY", "ABNER",
- "ABNEY", "ABRAHAM", "ABRAMS", "ABREU", "ACEVEDO", "ACKER", "ACKERMAN", "ACKLEY", "ACOSTA", "ACUNA", "ADAIR",
- "ADAM", "ADAME", "ADAMS", "ADAMSON", "ADCOCK", "ADDISON", "ADKINS", "ADLER", "AGEE", "AGNEW", "AGUAYO",
- "AGUIAR", "AGUILAR", "AGUILERA", "AGUIRRE", "AHERN", "AHMAD", "AHMED", "AHRENS", "AIELLO", "AIKEN",
- "AINSWORTH", "AKERS", "AKIN", "AKINS", "ALANIZ", "ALARCON", "ALBA", "ALBERS", "ALBERT", "ALBERTSON",
- "ALBRECHT", "ALBRIGHT", "ALCALA", "ALCORN", "ALDERMAN", "ALDRICH", "ALDRIDGE", "ALEMAN", "ALEXANDER",
- "ALFARO", "ALFONSO", "ALFORD", "ALFRED", "ALGER", "ALI", "ALICEA", "ALLAN", "ALLARD", "ALLEN", "ALLEY",
- "ALLISON", "ALLMAN", "ALLRED", "ALMANZA", "ALMEIDA", "ALMOND", "ALONSO", "ALONZO", "ALSTON", "ALTMAN",
- "ALVARADO", "ALVAREZ", "ALVES", "AMADOR", "AMARAL", "AMATO", "AMAYA", "AMBROSE", "AMES", "AMMONS", "AMOS",
- "AMUNDSON", "ANAYA", "ANDERS", "ANDERSEN", "ANDERSON", "ANDRADE", "ANDRE", "ANDRES", "ANDREW", "ANDREWS",
- "ANDRUS", "ANGEL", "ANGELO", "ANGLIN", "ANGULO", "ANTHONY", "ANTOINE", "ANTONIO", "APODACA", "APONTE",
- "APPEL", "APPLE", "APPLEGATE", "APPLETON", "AQUINO", "ARAGON", "ARANDA", "ARAUJO", "ARCE", "ARCHER",
- "ARCHIBALD", "ARCHIE", "ARCHULETA", "ARELLANO", "AREVALO", "ARIAS", "ARMENTA", "ARMIJO", "ARMSTEAD",
- "ARMSTRONG", "ARNDT", "ARNETT", "ARNOLD", "ARREDONDO", "ARREOLA", "ARRIAGA", "ARRINGTON", "ARROYO",
- "ARSENAULT", "ARTEAGA", "ARTHUR", "ARTIS", "ASBURY", "ASH", "ASHBY", "ASHCRAFT", "ASHE", "ASHER", "ASHFORD",
- "ASHLEY", "ASHMORE", "ASHTON", "ASHWORTH", "ASKEW", "ATCHISON", "ATHERTON", "ATKINS", "ATKINSON", "ATWELL",
- "ATWOOD", "AUGUST", "AUGUSTINE", "AULT", "AUSTIN", "AUTRY", "AVALOS", "AVERY", "AVILA", "AVILES", "AYALA",
- "AYERS", "AYRES", "BABB", "BABCOCK", "BABIN", "BACA", "BACH", "BACHMAN", "BACK", "BACON", "BADER", "BADGER",
- "BADILLO", "BAER", "BAEZ", "BAGGETT", "BAGLEY", "BAGWELL", "BAILEY", "BAIN", "BAINES", "BAIR", "BAIRD",
- "BAKER", "BALDERAS", "BALDWIN", "BALES", "BALL", "BALLARD", "BANDA", "BANDY", "BANKS", "BANKSTON",
- "BANNISTER", "BANUELOS", "BAPTISTE", "BARAJAS", "BARBA", "BARBEE", "BARBER", "BARBOSA", "BARBOUR",
- "BARCLAY", "BARDEN", "BARELA", "BARFIELD", "BARGER", "BARHAM", "BARKER", "BARKLEY", "BARKSDALE", "BARLOW",
- "BARNARD", "BARNES", "BARNETT", "BARNETTE", "BARNEY", "BARNHART", "BARNHILL", "BARON", "BARONE", "BARR",
- "BARRAZA", "BARRERA", "BARRETO", "BARRETT", "BARRIENTOS", "BARRIOS", "BARRON", "BARROW", "BARROWS", "BARRY",
- "BARTELS", "BARTH", "BARTHOLOMEW", "BARTLETT", "BARTLEY", "BARTON", "BASHAM", "BASKIN", "BASS", "BASSETT",
- "BATCHELOR", "BATEMAN", "BATES", "BATISTA", "BATISTE", "BATSON", "BATTAGLIA", "BATTEN", "BATTLE", "BATTLES",
- "BATTS", "BAUER", "BAUGH", "BAUGHMAN", "BAUM", "BAUMAN", "BAUMANN", "BAUMGARDNER", "BAUMGARTNER",
- "BAUTISTA", "BAXLEY", "BAXTER", "BAYER", "BAYLOR", "BAYNE", "BAYS", "BEACH", "BEAL", "BEALE", "BEALL",
- "BEALS", "BEAM", "BEAMON", "BEAN", "BEANE", "BEAR", "BEARD", "BEARDEN", "BEASLEY", "BEATTIE", "BEATTY",
- "BEATY", "BEAUCHAMP", "BEAUDOIN", "BEAULIEU", "BEAUREGARD", "BEAVER", "BEAVERS", "BECERRA", "BECK",
- "BECKER", "BECKETT", "BECKHAM", "BECKMAN", "BECKWITH", "BECNEL", "BEDARD", "BEDFORD", "BEEBE", "BEELER",
- "BEERS", "BEESON", "BEGAY", "BEGLEY", "BEHRENS", "BELANGER", "BELCHER", "BELL", "BELLAMY", "BELLO", "BELT",
- "BELTON", "BELTRAN", "BENAVIDES", "BENAVIDEZ", "BENDER", "BENEDICT", "BENEFIELD", "BENITEZ", "BENJAMIN",
- "BENNER", "BENNETT", "BENOIT", "BENSON", "BENTLEY", "BENTON", "BERG", "BERGER", "BERGERON", "BERGMAN",
- "BERGSTROM", "BERLIN", "BERMAN", "BERMUDEZ", "BERNAL", "BERNARD", "BERNHARDT", "BERNIER", "BERNSTEIN",
- "BERRIOS", "BERRY", "BERRYMAN", "BERTRAM", "BERTRAND", "BERUBE", "BESS", "BEST", "BETANCOURT", "BETHEA",
- "BETHEL", "BETTS", "BETZ", "BEVERLY", "BEVINS", "BEYER", "BIBLE", "BICKFORD", "BIDDLE", "BIGELOW", "BIGGS",
- "BILLINGS", "BILLINGSLEY", "BILLIOT", "BILLS", "BILLUPS", "BILODEAU", "BINDER", "BINGHAM", "BINKLEY",
- "BIRCH", "BIRD", "BISHOP", "BISSON", "BITTNER", "BIVENS", "BIVINS", "BLACK", "BLACKBURN", "BLACKMAN",
- "BLACKMON", "BLACKWELL", "BLACKWOOD", "BLAINE", "BLAIR", "BLAIS", "BLAKE", "BLAKELY", "BLALOCK",
- "BLANCHARD", "BLANCHETTE", "BLANCO", "BLAND", "BLANK", "BLANKENSHIP", "BLANTON", "BLAYLOCK", "BLEDSOE",
- "BLEVINS", "BLISS", "BLOCK", "BLOCKER", "BLODGETT", "BLOOM", "BLOUNT", "BLUE", "BLUM", "BLUNT", "BLYTHE",
- "BOATRIGHT", "BOATWRIGHT", "BOBBITT", "BOBO", "BOCK", "BOEHM", "BOETTCHER", "BOGAN", "BOGGS", "BOHANNON",
- "BOHN", "BOISVERT", "BOLAND", "BOLDEN", "BOLDUC", "BOLEN", "BOLES", "BOLIN", "BOLING", "BOLLING",
- "BOLLINGER", "BOLT", "BOLTON", "BOND", "BONDS", "BONE", "BONILLA", "BONNER", "BOOKER", "BOONE", "BOOTH",
- "BOOTHE", "BORDELON", "BORDEN", "BORDERS", "BOREN", "BORGES", "BORREGO", "BOSS", "BOSTIC", "BOSTICK",
- "BOSTON", "BOSWELL", "BOTTOMS", "BOUCHARD", "BOUCHER", "BOUDREAU", "BOUDREAUX", "BOUNDS", "BOURGEOIS",
- "BOURNE", "BOURQUE", "BOWDEN", "BOWEN", "BOWENS", "BOWER", "BOWERS", "BOWIE", "BOWLES", "BOWLIN", "BOWLING",
- "BOWMAN", "BOWSER", "BOX", "BOYCE", "BOYD", "BOYER", "BOYKIN", "BOYLE", "BOYLES", "BOYNTON", "BOZEMAN",
- "BRACKEN", "BRACKETT", "BRADBURY", "BRADEN", "BRADFORD", "BRADLEY", "BRADSHAW", "BRADY", "BRAGG", "BRANCH",
- "BRAND", "BRANDENBURG", "BRANDON", "BRANDT", "BRANHAM", "BRANNON", "BRANSON", "BRANT", "BRANTLEY",
- "BRASWELL", "BRATCHER", "BRATTON", "BRAUN", "BRAVO", "BRAXTON", "BRAY", "BRAZIL", "BREAUX", "BREEDEN",
- "BREEDLOVE", "BREEN", "BRENNAN", "BRENNER", "BRENT", "BREWER", "BREWSTER", "BRICE", "BRIDGES", "BRIGGS",
- "BRIGHT", "BRILEY", "BRILL", "BRIM", "BRINK", "BRINKLEY", "BRINKMAN", "BRINSON", "BRIONES", "BRISCOE",
- "BRISENO", "BRITO", "BRITT", "BRITTAIN", "BRITTON", "BROADNAX", "BROADWAY", "BROCK", "BROCKMAN",
- "BRODERICK", "BRODY", "BROGAN", "BRONSON", "BROOKINS", "BROOKS", "BROOME", "BROTHERS", "BROUGHTON",
- "BROUSSARD", "BROWDER", "BROWER", "BROWN", "BROWNE", "BROWNELL", "BROWNING", "BROWNLEE", "BROYLES",
- "BRUBAKER", "BRUCE", "BRUMFIELD", "BRUNER", "BRUNNER", "BRUNO", "BRUNS", "BRUNSON", "BRUTON", "BRYAN",
- "BRYANT", "BRYSON", "BUCHANAN", "BUCHER", "BUCK", "BUCKINGHAM", "BUCKLEY", "BUCKNER", "BUENO", "BUFFINGTON",
- "BUFORD", "BUI", "BULL", "BULLARD", "BULLOCK", "BUMGARNER", "BUNCH", "BUNDY", "BUNKER", "BUNN", "BUNNELL",
- "BUNTING", "BURCH", "BURCHETT", "BURCHFIELD", "BURDEN", "BURDETTE", "BURDICK", "BURGE", "BURGER", "BURGESS",
- "BURGOS", "BURK", "BURKE", "BURKETT", "BURKHART", "BURKHOLDER", "BURKS", "BURLESON", "BURLEY", "BURNETT",
- "BURNETTE", "BURNEY", "BURNHAM", "BURNS", "BURNSIDE", "BURR", "BURRELL", "BURRIS", "BURROUGHS", "BURROW",
- "BURROWS", "BURT", "BURTON", "BUSBY", "BUSCH", "BUSH", "BUSS", "BUSSEY", "BUSTAMANTE", "BUSTOS", "BUTCHER",
- "BUTLER", "BUTTERFIELD", "BUTTON", "BUTTS", "BUXTON", "BYARS", "BYERS", "BYNUM", "BYRD", "BYRNE", "BYRNES",
- "CABALLERO", "CABAN", "CABLE", "CABRAL", "CABRERA", "CADE", "CADY", "CAGLE", "CAHILL", "CAIN", "CALABRESE",
- "CALDERON", "CALDWELL", "CALHOUN", "CALKINS", "CALL", "CALLAGHAN", "CALLAHAN", "CALLAWAY", "CALLENDER",
- "CALLOWAY", "CALVERT", "CALVIN", "CAMACHO", "CAMARILLO", "CAMBELL", "CAMERON", "CAMP", "CAMPBELL", "CAMPOS",
- "CANADA", "CANADY", "CANALES", "CANDELARIA", "CANFIELD", "CANNON", "CANO", "CANTRELL", "CANTU", "CANTWELL",
- "CANTY", "CAPPS", "CARABALLO", "CARAWAY", "CARBAJAL", "CARBONE", "CARD", "CARDEN", "CARDENAS", "CARDER",
- "CARDONA", "CARDOZA", "CARDWELL", "CAREY", "CARL", "CARLIN", "CARLISLE", "CARLOS", "CARLSON", "CARLTON",
- "CARMAN", "CARMICHAEL", "CARMONA", "CARNAHAN", "CARNES", "CARNEY", "CARO", "CARON", "CARPENTER", "CARR",
- "CARRANZA", "CARRASCO", "CARRERA", "CARRICO", "CARRIER", "CARRILLO", "CARRINGTON", "CARRION", "CARROLL",
- "CARSON", "CARSWELL", "CARTER", "CARTWRIGHT", "CARUSO", "CARVALHO", "CARVER", "CARY", "CASAS", "CASE",
- "CASEY", "CASH", "CASILLAS", "CASKEY", "CASON", "CASPER", "CASS", "CASSELL", "CASSIDY", "CASTANEDA",
- "CASTEEL", "CASTELLANO", "CASTELLANOS", "CASTILLO", "CASTLE", "CASTLEBERRY", "CASTRO", "CASWELL",
- "CATALANO", "CATES", "CATHEY", "CATO", "CATRON", "CAUDILL", "CAUDLE", "CAUSEY", "CAVANAUGH", "CAVAZOS",
- "CAVE", "CECIL", "CENTENO", "CERDA", "CERVANTES", "CHACON", "CHADWICK", "CHAFFIN", "CHALMERS",
- "CHAMBERLAIN", "CHAMBERLIN", "CHAMBERS", "CHAMBLISS", "CHAMPAGNE", "CHAMPION", "CHAN", "CHANCE", "CHANDLER",
- "CHANEY", "CHANG", "CHAPA", "CHAPIN", "CHAPMAN", "CHAPPELL", "CHARLES", "CHARLTON", "CHASE", "CHASTAIN",
- "CHATMAN", "CHAU", "CHAVARRIA", "CHAVES", "CHAVEZ", "CHAVIS", "CHEATHAM", "CHEEK", "CHEN", "CHENEY",
- "CHENG", "CHERRY", "CHESSER", "CHESTER", "CHESTNUT", "CHEUNG", "CHEW", "CHILD", "CHILDERS", "CHILDRESS",
- "CHILDS", "CHILTON", "CHIN", "CHISHOLM", "CHISM", "CHISOLM", "CHITWOOD", "CHO", "CHOATE", "CHOI", "CHONG",
- "CHOW", "CHRISTENSEN", "CHRISTENSON", "CHRISTIAN", "CHRISTIANSEN", "CHRISTIANSON", "CHRISTIE", "CHRISTMAN",
- "CHRISTMAS", "CHRISTOPHER", "CHRISTY", "CHU", "CHUN", "CHUNG", "CHURCH", "CHURCHILL", "CINTRON", "CISNEROS",
- "CLANCY", "CLANTON", "CLAPP", "CLARK", "CLARKE", "CLARKSON", "CLARY", "CLAUSEN", "CLAWSON", "CLAY",
- "CLAYTON", "CLEARY", "CLEGG", "CLEM", "CLEMENS", "CLEMENT", "CLEMENTS", "CLEMMONS", "CLEMONS", "CLEVELAND",
- "CLEVENGER", "CLICK", "CLIFFORD", "CLIFTON", "CLINE", "CLINTON", "CLOSE", "CLOUD", "CLOUGH", "CLOUTIER",
- "COATES", "COATS", "COBB", "COBBS", "COBLE", "COBURN", "COCHRAN", "COCHRANE", "COCKRELL", "CODY", "COE",
- "COFFEY", "COFFIN", "COFFMAN", "COGGINS", "COHEN", "COHN", "COKER", "COLBERT", "COLBURN", "COLBY", "COLE",
- "COLEMAN", "COLES", "COLEY", "COLLADO", "COLLAZO", "COLLEY", "COLLIER", "COLLINS", "COLON", "COLSON",
- "COLVIN", "COLWELL", "COMBS", "COMEAUX", "COMER", "COMPTON", "COMSTOCK", "CONAWAY", "CONCEPCION", "CONDON",
- "CONE", "CONGER", "CONKLIN", "CONLEY", "CONN", "CONNELL", "CONNELLY", "CONNER", "CONNERS", "CONNOLLY",
- "CONNOR", "CONNORS", "CONOVER", "CONRAD", "CONROY", "CONTE", "CONTI", "CONTRERAS", "CONWAY", "CONYERS",
- "COOK", "COOKE", "COOKS", "COOKSEY", "COOLEY", "COOMBS", "COON", "COONEY", "COONS", "COOPER", "COPE",
- "COPELAND", "COPLEY", "COPPOLA", "CORBETT", "CORBIN", "CORBITT", "CORCORAN", "CORDELL", "CORDERO",
- "CORDOVA", "COREY", "CORLEY", "CORMIER", "CORNELIUS", "CORNELL", "CORNETT", "CORNISH", "CORNWELL", "CORONA",
- "CORONADO", "CORRAL", "CORREA", "CORREIA", "CORRIGAN", "CORTES", "CORTEZ", "CORWIN", "COSBY", "COSGROVE",
- "COSTA", "COSTELLO", "COTA", "COTE", "COTHRAN", "COTTER", "COTTON", "COTTRELL", "COUCH", "COUGHLIN",
- "COULTER", "COUNCIL", "COUNTS", "COURTNEY", "COUSINS", "COUTURE", "COVERT", "COVEY", "COVINGTON", "COWAN",
- "COWARD", "COWART", "COWELL", "COWLES", "COWLEY", "COX", "COY", "COYLE", "COYNE", "CRABTREE", "CRADDOCK",
- "CRAFT", "CRAIG", "CRAIN", "CRAMER", "CRANDALL", "CRANE", "CRANFORD", "CRAVEN", "CRAWFORD", "CRAWLEY",
- "CRAYTON", "CREAMER", "CREECH", "CREEL", "CREIGHTON", "CRENSHAW", "CRESPO", "CREWS", "CRIDER", "CRISP",
- "CRIST", "CRISWELL", "CRITTENDEN", "CROCKER", "CROCKETT", "CROFT", "CROMER", "CROMWELL", "CRONIN", "CROOK",
- "CROOKS", "CROSBY", "CROSS", "CROTEAU", "CROUCH", "CROUSE", "CROW", "CROWDER", "CROWE", "CROWELL",
- "CROWLEY", "CRUM", "CRUMP", "CRUSE", "CRUTCHER", "CRUTCHFIELD", "CRUZ", "CUELLAR", "CUEVAS", "CULBERTSON",
- "CULLEN", "CULP", "CULPEPPER", "CULVER", "CUMMINGS", "CUMMINS", "CUNNINGHAM", "CUPP", "CURLEY", "CURRAN",
- "CURRIE", "CURRIER", "CURRY", "CURTIN", "CURTIS", "CUSHMAN", "CUSTER", "CUTLER", "CYR", "DABNEY", "DAHL",
- "DAIGLE", "DAILEY", "DAILY", "DALE", "DALEY", "DALLAS", "DALTON", "DALY", "DAMICO", "DAMON", "DAMRON",
- "DANCY", "DANG", "DANGELO", "DANIEL", "DANIELS", "DANIELSON", "DANNER", "DARBY", "DARDEN", "DARLING",
- "DARNELL", "DASILVA", "DAUGHERTY", "DAUGHTRY", "DAVENPORT", "DAVID", "DAVIDSON", "DAVIES", "DAVILA",
- "DAVIS", "DAVISON", "DAWKINS", "DAWSON", "DAY", "DAYTON", "DEAL", "DEAN", "DEATON", "DEBERRY", "DECKER",
- "DEES", "DEHART", "DEJESUS", "DELACRUZ", "DELAGARZA", "DELANEY", "DELAROSA", "DELATORRE", "DELEON",
- "DELGADILLO", "DELGADO", "DELL", "DELLINGER", "DELOACH", "DELONG", "DELOSSANTOS", "DELUCA", "DELVALLE",
- "DEMARCO", "DEMERS", "DEMPSEY", "DENHAM", "DENNEY", "DENNING", "DENNIS", "DENNISON", "DENNY", "DENSON",
- "DENT", "DENTON", "DEROSA", "DERR", "DERRICK", "DESANTIS", "DESIMONE", "DEVINE", "DEVITO", "DEVLIN",
- "DEVORE", "DEVRIES", "DEW", "DEWEY", "DEWITT", "DEXTER", "DIAL", "DIAMOND", "DIAS", "DIAZ", "DICK",
- "DICKENS", "DICKERSON", "DICKEY", "DICKINSON", "DICKSON", "DIEHL", "DIETRICH", "DIETZ", "DIGGS", "DILL",
- "DILLARD", "DILLON", "DINKINS", "DION", "DIX", "DIXON", "DO", "DOAN", "DOBBINS", "DOBBS", "DOBSON",
- "DOCKERY", "DODD", "DODDS", "DODGE", "DODSON", "DOE", "DOHERTY", "DOLAN", "DOLL", "DOLLAR", "DOMINGO",
- "DOMINGUEZ", "DOMINQUEZ", "DONAHUE", "DONALD", "DONALDSON", "DONATO", "DONNELL", "DONNELLY", "DONOHUE",
- "DONOVAN", "DOOLEY", "DOOLITTLE", "DORAN", "DORMAN", "DORN", "DORRIS", "DORSEY", "DORTCH", "DOSS", "DOTSON",
- "DOTY", "DOUCETTE", "DOUGHERTY", "DOUGHTY", "DOUGLAS", "DOUGLASS", "DOVE", "DOVER", "DOW", "DOWD", "DOWDY",
- "DOWELL", "DOWLING", "DOWNEY", "DOWNING", "DOWNS", "DOYLE", "DOZIER", "DRAKE", "DRAPER", "DRAYTON", "DREW",
- "DRISCOLL", "DRIVER", "DRUMMOND", "DRURY", "DUARTE", "DUBE", "DUBOIS", "DUBOSE", "DUCKETT", "DUCKWORTH",
- "DUDLEY", "DUFF", "DUFFY", "DUGAN", "DUGAS", "DUGGAN", "DUGGER", "DUKE", "DUKES", "DUMAS", "DUMONT",
- "DUNAWAY", "DUNBAR", "DUNCAN", "DUNHAM", "DUNLAP", "DUNN", "DUNNE", "DUNNING", "DUONG", "DUPONT", "DUPRE",
- "DUPREE", "DUPUIS", "DURAN", "DURAND", "DURANT", "DURBIN", "DURDEN", "DURHAM", "DURKIN", "DURR", "DUTTON",
- "DUVAL", "DUVALL", "DWYER", "DYE", "DYER", "DYKES", "DYSON", "EAGLE", "EARL", "EARLE", "EARLEY", "EARLS",
- "EARLY", "EARNEST", "EASLEY", "EASON", "EAST", "EASTER", "EASTERLING", "EASTMAN", "EASTON", "EATON",
- "EAVES", "EBERT", "ECHEVARRIA", "ECHOLS", "ECKERT", "EDDY", "EDGAR", "EDGE", "EDMOND", "EDMONDS",
- "EDMONDSON", "EDWARD", "EDWARDS", "EGAN", "EGGLESTON", "ELAM", "ELDER", "ELDRIDGE", "ELIAS", "ELIZONDO",
- "ELKINS", "ELLER", "ELLINGTON", "ELLIOT", "ELLIOTT", "ELLIS", "ELLISON", "ELLSWORTH", "ELMORE", "ELROD",
- "ELSTON", "ELY", "EMANUEL", "EMBRY", "EMERSON", "EMERY", "EMMONS", "ENG", "ENGEL", "ENGLAND", "ENGLE",
- "ENGLISH", "ENNIS", "ENOS", "ENRIGHT", "ENRIQUEZ", "EPPERSON", "EPPS", "EPSTEIN", "ERDMANN", "ERICKSON",
- "ERNST", "ERVIN", "ERWIN", "ESCALANTE", "ESCAMILLA", "ESCOBAR", "ESCOBEDO", "ESPARZA", "ESPINAL", "ESPINO",
- "ESPINOSA", "ESPINOZA", "ESPOSITO", "ESQUIVEL", "ESTEP", "ESTES", "ESTRADA", "ESTRELLA", "ETHERIDGE",
- "ETHRIDGE", "EUBANKS", "EVANS", "EVERETT", "EVERHART", "EVERS", "EVERSON", "EWING", "EZELL", "FABER",
- "FABIAN", "FAGAN", "FAHEY", "FAIN", "FAIR", "FAIRBANKS", "FAIRCHILD", "FAIRLEY", "FAISON", "FAJARDO",
- "FALCON", "FALK", "FALLON", "FALLS", "FANNING", "FARIAS", "FARLEY", "FARMER", "FARNSWORTH", "FARR",
- "FARRAR", "FARRELL", "FARRINGTON", "FARRIS", "FARROW", "FAULK", "FAULKNER", "FAUST", "FAY", "FEENEY",
- "FELDER", "FELDMAN", "FELICIANO", "FELIX", "FELLOWS", "FELTON", "FELTS", "FENNELL", "FENNER", "FENTON",
- "FERGUSON", "FERNANDES", "FERNANDEZ", "FERRARA", "FERRARI", "FERRARO", "FERREIRA", "FERRELL", "FERRER",
- "FERRIS", "FERRY", "FIELD", "FIELDER", "FIELDS", "FIERRO", "FIFE", "FIGUEROA", "FINCH", "FINCHER",
- "FINDLEY", "FINE", "FINK", "FINLEY", "FINN", "FINNEGAN", "FINNEY", "FIORE", "FISCHER", "FISH", "FISHER",
- "FISHMAN", "FISK", "FITCH", "FITE", "FITTS", "FITZGERALD", "FITZPATRICK", "FITZSIMMONS", "FLAGG",
- "FLAHERTY", "FLANAGAN", "FLANDERS", "FLANIGAN", "FLANNERY", "FLECK", "FLEMING", "FLEMMING", "FLETCHER",
- "FLINT", "FLOOD", "FLORA", "FLORENCE", "FLORES", "FLOREZ", "FLOURNOY", "FLOWERS", "FLOYD", "FLYNN",
- "FOGARTY", "FOGG", "FOGLE", "FOLEY", "FOLSE", "FOLSOM", "FOLTZ", "FONG", "FONSECA", "FONTAINE", "FONTENOT",
- "FOOTE", "FORBES", "FORD", "FOREMAN", "FOREST", "FORET", "FORMAN", "FORNEY", "FORREST", "FORRESTER",
- "FORSTER", "FORSYTH", "FORSYTHE", "FORT", "FORTE", "FORTENBERRY", "FORTIER", "FORTIN", "FORTNER", "FORTUNE",
- "FOSS", "FOSTER", "FOUNTAIN", "FOURNIER", "FOUST", "FOWLER", "FOX", "FOY", "FRALEY", "FRAME", "FRANCE",
- "FRANCIS", "FRANCISCO", "FRANCO", "FRANCOIS", "FRANK", "FRANKLIN", "FRANKS", "FRANTZ", "FRANZ", "FRASER",
- "FRASIER", "FRAZER", "FRAZIER", "FREDERICK", "FREDERICKS", "FREDRICK", "FREDRICKSON", "FREE", "FREED",
- "FREEDMAN", "FREEMAN", "FREESE", "FREITAS", "FRENCH", "FREUND", "FREY", "FRIAS", "FRICK", "FRIEDMAN",
- "FRIEND", "FRIERSON", "FRIES", "FRITZ", "FRIZZELL", "FROST", "FRY", "FRYE", "FRYER", "FUCHS", "FUENTES",
- "FUGATE", "FULCHER", "FULLER", "FULLERTON", "FULMER", "FULTON", "FULTZ", "FUNDERBURK", "FUNK", "FUQUA",
- "FURMAN", "FURR", "FUSCO", "GABLE", "GABRIEL", "GADDIS", "GADDY", "GAFFNEY", "GAGE", "GAGNE", "GAGNON",
- "GAINES", "GAINEY", "GAITHER", "GALARZA", "GALBRAITH", "GALE", "GALINDO", "GALLAGHER", "GALLANT",
- "GALLARDO", "GALLEGOS", "GALLO", "GALLOWAY", "GALVAN", "GALVEZ", "GALVIN", "GAMBLE", "GAMBOA", "GAMEZ",
- "GANDY", "GANN", "GANNON", "GANT", "GANTT", "GARAY", "GARBER", "GARCIA", "GARDINER", "GARDNER", "GARLAND",
- "GARMON", "GARNER", "GARNETT", "GARRETT", "GARRIS", "GARRISON", "GARVEY", "GARVIN", "GARY", "GARZA",
- "GASKIN", "GASKINS", "GASS", "GASTON", "GATES", "GATEWOOD", "GATLIN", "GAULT", "GAUTHIER", "GAVIN", "GAY",
- "GAYLORD", "GEARY", "GEE", "GEER", "GEIGER", "GENTILE", "GENTRY", "GEORGE", "GERALD", "GERARD", "GERBER",
- "GERMAN", "GETZ", "GIBBONS", "GIBBS", "GIBSON", "GIFFORD", "GIL", "GILBERT", "GILBERTSON", "GILBREATH",
- "GILCHRIST", "GILES", "GILL", "GILLEN", "GILLESPIE", "GILLETTE", "GILLEY", "GILLIAM", "GILLILAND", "GILLIS",
- "GILMAN", "GILMER", "GILMORE", "GILSON", "GINN", "GIORDANO", "GIPSON", "GIRARD", "GIRON", "GIROUX", "GIST",
- "GIVENS", "GLADDEN", "GLADNEY", "GLASER", "GLASGOW", "GLASS", "GLAZE", "GLEASON", "GLENN", "GLOVER",
- "GLYNN", "GOAD", "GOBLE", "GODDARD", "GODFREY", "GODINEZ", "GODWIN", "GOEBEL", "GOETZ", "GOFF", "GOFORTH",
- "GOINS", "GOLD", "GOLDBERG", "GOLDEN", "GOLDMAN", "GOLDSMITH", "GOLDSTEIN", "GOMES", "GOMEZ", "GONSALVES",
- "GONZALES", "GONZALEZ", "GOOCH", "GOOD", "GOODE", "GOODEN", "GOODIN", "GOODING", "GOODMAN", "GOODRICH",
- "GOODSON", "GOODWIN", "GOOLSBY", "GORDON", "GORE", "GORHAM", "GORMAN", "GOSS", "GOSSETT", "GOUGH", "GOULD",
- "GOULET", "GRACE", "GRACIA", "GRADY", "GRAF", "GRAFF", "GRAGG", "GRAHAM", "GRANADOS", "GRANGER", "GRANT",
- "GRANTHAM", "GRAVES", "GRAY", "GRAYSON", "GREATHOUSE", "GRECO", "GREEN", "GREENBERG", "GREENE",
- "GREENFIELD", "GREENLEE", "GREENWOOD", "GREER", "GREGG", "GREGORY", "GREINER", "GRENIER", "GRESHAM", "GREY",
- "GRICE", "GRIDER", "GRIER", "GRIFFIN", "GRIFFIS", "GRIFFITH", "GRIFFITHS", "GRIGGS", "GRIGSBY", "GRIMES",
- "GRIMM", "GRISHAM", "GRISSOM", "GRISWOLD", "GROCE", "GROGAN", "GROOMS", "GROSS", "GROSSMAN", "GROVE",
- "GROVER", "GROVES", "GRUBB", "GRUBBS", "GRUBER", "GUAJARDO", "GUENTHER", "GUERIN", "GUERRA", "GUERRERO",
- "GUESS", "GUEST", "GUEVARA", "GUFFEY", "GUIDRY", "GUILLEN", "GUILLORY", "GUINN", "GULLEY", "GUNDERSON",
- "GUNN", "GUNTER", "GUNTHER", "GURLEY", "GUSTAFSON", "GUTHRIE", "GUTIERREZ", "GUY", "GUYTON", "GUZMAN", "HA",
- "HAAG", "HAAS", "HAASE", "HACKER", "HACKETT", "HACKNEY", "HADDEN", "HADLEY", "HAGAN", "HAGEN", "HAGER",
- "HAGGARD", "HAGGERTY", "HAHN", "HAIGHT", "HAILEY", "HAINES", "HAIR", "HAIRSTON", "HALCOMB", "HALE", "HALES",
- "HALEY", "HALL", "HALLER", "HALLMAN", "HALSEY", "HALSTEAD", "HALVERSON", "HAM", "HAMBLIN", "HAMBY", "HAMEL",
- "HAMER", "HAMILTON", "HAMLIN", "HAMM", "HAMMER", "HAMMETT", "HAMMOND", "HAMMONDS", "HAMMONS", "HAMPTON",
- "HAMRICK", "HAN", "HANCOCK", "HAND", "HANDLEY", "HANDY", "HANES", "HANEY", "HANKINS", "HANKS", "HANLEY",
- "HANLON", "HANNA", "HANNAH", "HANNAN", "HANNON", "HANSEN", "HANSON", "HARBIN", "HARDAWAY", "HARDEE",
- "HARDEN", "HARDER", "HARDESTY", "HARDIN", "HARDING", "HARDISON", "HARDMAN", "HARDWICK", "HARDY", "HARE",
- "HARGIS", "HARGRAVE", "HARGROVE", "HARKINS", "HARLAN", "HARLEY", "HARLOW", "HARMAN", "HARMON", "HARMS",
- "HARNESS", "HARP", "HARPER", "HARR", "HARRELL", "HARRINGTON", "HARRIS", "HARRISON", "HARRY", "HART",
- "HARTER", "HARTLEY", "HARTMAN", "HARTMANN", "HARTWELL", "HARVEY", "HARWELL", "HARWOOD", "HASKELL",
- "HASKINS", "HASS", "HASSELL", "HASTINGS", "HATCH", "HATCHER", "HATCHETT", "HATFIELD", "HATHAWAY", "HATLEY",
- "HATTON", "HAUGEN", "HAUSER", "HAVENS", "HAWES", "HAWK", "HAWKINS", "HAWKS", "HAWLEY", "HAWTHORNE", "HAY",
- "HAYDEN", "HAYES", "HAYNES", "HAYS", "HAYWARD", "HAYWOOD", "HAZEL", "HEAD", "HEADLEY", "HEADRICK", "HEALEY",
- "HEALY", "HEARD", "HEARN", "HEATH", "HEATON", "HEBERT", "HECK", "HECKMAN", "HEDGES", "HEDRICK", "HEFFNER",
- "HEFLIN", "HEFNER", "HEIM", "HEIN", "HEINRICH", "HEINZ", "HELD", "HELLER", "HELM", "HELMS", "HELTON",
- "HEMBREE", "HEMPHILL", "HENDERSON", "HENDON", "HENDRICK", "HENDRICKS", "HENDRICKSON", "HENDRIX", "HENKE",
- "HENLEY", "HENNESSEY", "HENNING", "HENRY", "HENSLEY", "HENSON", "HER", "HERBERT", "HEREDIA", "HERMAN",
- "HERMANN", "HERNANDEZ", "HERNDON", "HERR", "HERRERA", "HERRICK", "HERRIN", "HERRING", "HERRINGTON",
- "HERRMANN", "HERRON", "HERSHBERGER", "HERZOG", "HESS", "HESTER", "HEWITT", "HEYWARD", "HIATT", "HIBBARD",
- "HICKEY", "HICKMAN", "HICKS", "HICKSON", "HIDALGO", "HIGDON", "HIGGINBOTHAM", "HIGGINS", "HIGGS", "HIGH",
- "HIGHTOWER", "HILDEBRAND", "HILDRETH", "HILL", "HILLARD", "HILLER", "HILLIARD", "HILLMAN", "HILLS",
- "HILTON", "HIMES", "HINDMAN", "HINDS", "HINES", "HINKLE", "HINOJOSA", "HINSON", "HINTON", "HIRSCH",
- "HITCHCOCK", "HITE", "HITT", "HO", "HOANG", "HOBBS", "HOBSON", "HODGE", "HODGES", "HODGSON", "HOFF",
- "HOFFMAN", "HOFFMANN", "HOGAN", "HOGG", "HOGUE", "HOKE", "HOLBROOK", "HOLCOMB", "HOLCOMBE", "HOLDEN",
- "HOLDER", "HOLGUIN", "HOLIDAY", "HOLLAND", "HOLLENBECK", "HOLLEY", "HOLLIDAY", "HOLLINGSWORTH", "HOLLINS",
- "HOLLIS", "HOLLOMAN", "HOLLOWAY", "HOLLY", "HOLM", "HOLMAN", "HOLMES", "HOLT", "HOLTON", "HOLTZ", "HOMAN",
- "HOMER", "HONEYCUTT", "HONG", "HOOD", "HOOK", "HOOKER", "HOOKS", "HOOPER", "HOOVER", "HOPE", "HOPKINS",
- "HOPPE", "HOPPER", "HOPSON", "HORAN", "HORN", "HORNE", "HORNER", "HORNSBY", "HOROWITZ", "HORSLEY", "HORTON",
- "HORVATH", "HOSKINS", "HOSTETLER", "HOUCK", "HOUGH", "HOUGHTON", "HOULE", "HOUSE", "HOUSER", "HOUSTON",
- "HOWARD", "HOWE", "HOWELL", "HOWERTON", "HOWES", "HOWLAND", "HOY", "HOYLE", "HOYT", "HSU", "HUANG",
- "HUBBARD", "HUBER", "HUBERT", "HUDDLESTON", "HUDGENS", "HUDGINS", "HUDSON", "HUERTA", "HUEY", "HUFF",
- "HUFFMAN", "HUGGINS", "HUGHES", "HUGHEY", "HULL", "HULSEY", "HUMES", "HUMMEL", "HUMPHREY", "HUMPHREYS",
- "HUMPHRIES", "HUNDLEY", "HUNT", "HUNTER", "HUNTINGTON", "HUNTLEY", "HURD", "HURLEY", "HURST", "HURT",
- "HURTADO", "HUSKEY", "HUSSEY", "HUSTON", "HUTCHENS", "HUTCHERSON", "HUTCHESON", "HUTCHINGS", "HUTCHINS",
- "HUTCHINSON", "HUTCHISON", "HUTSON", "HUTTO", "HUTTON", "HUYNH", "HWANG", "HYATT", "HYDE", "HYLAND",
- "HYLTON", "HYMAN", "HYNES", "IBARRA", "INGLE", "INGRAHAM", "INGRAM", "INMAN", "IRBY", "IRELAND", "IRISH",
- "IRIZARRY", "IRONS", "IRVIN", "IRVINE", "IRVING", "IRWIN", "ISAAC", "ISAACS", "ISAACSON", "ISBELL", "ISOM",
- "ISON", "ISRAEL", "IVERSON", "IVES", "IVEY", "IVORY", "IVY", "JACK", "JACKMAN", "JACKS", "JACKSON", "JACOB",
- "JACOBS", "JACOBSEN", "JACOBSON", "JACOBY", "JACQUES", "JAEGER", "JAMES", "JAMESON", "JAMISON", "JANES",
- "JANKOWSKI", "JANSEN", "JANSSEN", "JARAMILLO", "JARRELL", "JARRETT", "JARVIS", "JASPER", "JAY", "JAYNES",
- "JEAN", "JEFFERIES", "JEFFERS", "JEFFERSON", "JEFFERY", "JEFFREY", "JEFFRIES", "JENKINS", "JENNINGS",
- "JENSEN", "JENSON", "JERNIGAN", "JESSUP", "JETER", "JETT", "JEWELL", "JEWETT", "JIMENEZ", "JOBE", "JOE",
- "JOHANSEN", "JOHN", "JOHNS", "JOHNSON", "JOHNSTON", "JOINER", "JOLLEY", "JOLLY", "JONES", "JORDAN",
- "JORDON", "JORGENSEN", "JORGENSON", "JOSE", "JOSEPH", "JOY", "JOYCE", "JOYNER", "JUAREZ", "JUDD", "JUDE",
- "JUDGE", "JUDKINS", "JULIAN", "JUNG", "JUSTICE", "JUSTUS", "KAHN", "KAISER", "KAMINSKI", "KANE", "KANG",
- "KAPLAN", "KARR", "KASPER", "KATZ", "KAUFFMAN", "KAUFMAN", "KAY", "KAYE", "KEANE", "KEARNEY", "KEARNS",
- "KEATING", "KEATON", "KECK", "KEE", "KEEFE", "KEEFER", "KEEGAN", "KEEL", "KEELER", "KEELING", "KEEN",
- "KEENAN", "KEENE", "KEENER", "KEENEY", "KEETON", "KEITH", "KELLEHER", "KELLER", "KELLEY", "KELLOGG",
- "KELLUM", "KELLY", "KELSEY", "KELSO", "KEMP", "KEMPER", "KENDALL", "KENDRICK", "KENNEDY", "KENNEY", "KENNY",
- "KENT", "KENYON", "KERN", "KERNS", "KERR", "KESSLER", "KETCHUM", "KEY", "KEYES", "KEYS", "KEYSER", "KHAN",
- "KIDD", "KIDWELL", "KIEFER", "KILGORE", "KILLIAN", "KILPATRICK", "KIM", "KIMBALL", "KIMBLE", "KIMBRELL",
- "KIMBROUGH", "KIMMEL", "KINARD", "KINCAID", "KINDER", "KING", "KINGSLEY", "KINNEY", "KINSEY", "KIRBY",
- "KIRCHNER", "KIRK", "KIRKLAND", "KIRKPATRICK", "KIRKWOOD", "KISER", "KISH", "KITCHEN", "KITCHENS", "KLEIN",
- "KLINE", "KLINGER", "KNAPP", "KNIGHT", "KNOLL", "KNOTT", "KNOTTS", "KNOWLES", "KNOWLTON", "KNOX", "KNUDSEN",
- "KNUDSON", "KNUTSON", "KOCH", "KOEHLER", "KOENIG", "KOHL", "KOHLER", "KOHN", "KOLB", "KONG", "KOONCE",
- "KOONTZ", "KOPP", "KOVACH", "KOWALSKI", "KOZAK", "KOZLOWSKI", "KRAFT", "KRAMER", "KRAUS", "KRAUSE",
- "KRAUSS", "KREBS", "KRIEGER", "KROLL", "KRUEGER", "KRUG", "KRUGER", "KRUSE", "KUHN", "KUNKEL", "KUNTZ",
- "KUNZ", "KURTZ", "KUYKENDALL", "KYLE", "LABBE", "LABELLE", "LACEY", "LACHANCE", "LACKEY", "LACROIX", "LACY",
- "LADD", "LADNER", "LAFFERTY", "LAFLAMME", "LAFLEUR", "LAI", "LAIRD", "LAKE", "LAM", "LAMAR", "LAMB",
- "LAMBERT", "LAMM", "LANCASTER", "LANCE", "LAND", "LANDERS", "LANDIS", "LANDON", "LANDRUM", "LANDRY", "LANE",
- "LANEY", "LANG", "LANGDON", "LANGE", "LANGER", "LANGFORD", "LANGLEY", "LANGLOIS", "LANGSTON", "LANHAM",
- "LANIER", "LANKFORD", "LANNING", "LANTZ", "LAPLANTE", "LAPOINTE", "LAPORTE", "LARA", "LARGE", "LARKIN",
- "LAROCHE", "LAROSE", "LARRY", "LARSEN", "LARSON", "LARUE", "LASH", "LASHLEY", "LASSITER", "LASTER",
- "LATHAM", "LATIMER", "LATTIMORE", "LAU", "LAUER", "LAUGHLIN", "LAVENDER", "LAVIGNE", "LAVOIE", "LAW",
- "LAWHORN", "LAWLER", "LAWLESS", "LAWRENCE", "LAWS", "LAWSON", "LAWTON", "LAY", "LAYMAN", "LAYNE", "LAYTON",
- "LE", "LEA", "LEACH", "LEAHY", "LEAK", "LEAKE", "LEAL", "LEAR", "LEARY", "LEAVITT", "LEBLANC", "LEBRON",
- "LECLAIR", "LEDBETTER", "LEDESMA", "LEDFORD", "LEDOUX", "LEE", "LEEPER", "LEES", "LEFEBVRE", "LEGER",
- "LEGG", "LEGGETT", "LEHMAN", "LEHMANN", "LEIGH", "LEIGHTON", "LEMASTER", "LEMAY", "LEMIEUX", "LEMKE",
- "LEMMON", "LEMON", "LEMONS", "LEMUS", "LENNON", "LENTZ", "LENZ", "LEON", "LEONARD", "LEONE", "LERMA",
- "LERNER", "LEROY", "LESLIE", "LESSARD", "LESTER", "LEUNG", "LEVESQUE", "LEVI", "LEVIN", "LEVINE", "LEVY",
- "LEW", "LEWANDOWSKI", "LEWIS", "LEYVA", "LI", "LIBBY", "LIDDELL", "LIEBERMAN", "LIGHT", "LIGHTFOOT",
- "LIGHTNER", "LIGON", "LILES", "LILLEY", "LILLY", "LIM", "LIMA", "LIMON", "LIN", "LINARES", "LINCOLN",
- "LIND", "LINDBERG", "LINDER", "LINDGREN", "LINDLEY", "LINDQUIST", "LINDSAY", "LINDSEY", "LINDSTROM", "LINK",
- "LINKOUS", "LINN", "LINTON", "LINVILLE", "LIPSCOMB", "LIRA", "LISTER", "LITTLE", "LITTLEFIELD",
- "LITTLEJOHN", "LITTLETON", "LIU", "LIVELY", "LIVINGSTON", "LLOYD", "LO", "LOCKE", "LOCKETT", "LOCKHART",
- "LOCKLEAR", "LOCKWOOD", "LOERA", "LOFTIN", "LOFTIS", "LOFTON", "LOGAN", "LOGSDON", "LOGUE", "LOMAX",
- "LOMBARD", "LOMBARDI", "LOMBARDO", "LONDON", "LONG", "LONGO", "LONGORIA", "LOOMIS", "LOONEY", "LOPER",
- "LOPES", "LOPEZ", "LORD", "LORENZ", "LORENZO", "LOTT", "LOUIS", "LOVE", "LOVEJOY", "LOVELACE", "LOVELESS",
- "LOVELL", "LOVETT", "LOVING", "LOW", "LOWE", "LOWELL", "LOWERY", "LOWMAN", "LOWRY", "LOY", "LOYA", "LOYD",
- "LOZANO", "LU", "LUCAS", "LUCE", "LUCERO", "LUCIANO", "LUCKETT", "LUDWIG", "LUGO", "LUIS", "LUJAN", "LUKE",
- "LUMPKIN", "LUNA", "LUND", "LUNDBERG", "LUNDY", "LUNSFORD", "LUONG", "LUSK", "LUSTER", "LUTHER", "LUTTRELL",
- "LUTZ", "LY", "LYLE", "LYLES", "LYMAN", "LYNCH", "LYNN", "LYON", "LYONS", "LYTLE", "MA", "MAAS", "MABE",
- "MABRY", "MACDONALD", "MACE", "MACHADO", "MACIAS", "MACK", "MACKAY", "MACKENZIE", "MACKEY", "MACKIE",
- "MACKLIN", "MACLEAN", "MACLEOD", "MACON", "MADDEN", "MADDOX", "MADERA", "MADISON", "MADRID", "MADRIGAL",
- "MADSEN", "MAES", "MAESTAS", "MAGANA", "MAGEE", "MAGGARD", "MAGNUSON", "MAGUIRE", "MAHAFFEY", "MAHAN",
- "MAHER", "MAHON", "MAHONEY", "MAIER", "MAIN", "MAJOR", "MAJORS", "MAKI", "MALCOLM", "MALDONADO", "MALLEY",
- "MALLORY", "MALLOY", "MALONE", "MALONEY", "MANCINI", "MANCUSO", "MANESS", "MANGUM", "MANLEY", "MANN",
- "MANNING", "MANNS", "MANSFIELD", "MANSON", "MANUEL", "MANZO", "MAPLE", "MAPLES", "MARBLE", "MARCH",
- "MARCHAND", "MARCOTTE", "MARCUM", "MARCUS", "MARES", "MARIN", "MARINO", "MARION", "MARK", "MARKHAM",
- "MARKLEY", "MARKS", "MARLER", "MARLOW", "MARLOWE", "MARQUEZ", "MARQUIS", "MARR", "MARRERO", "MARROQUIN",
- "MARSH", "MARSHALL", "MARTEL", "MARTELL", "MARTENS", "MARTIN", "MARTINDALE", "MARTINEZ", "MARTINO",
- "MARTINS", "MARTINSON", "MARTZ", "MARVIN", "MARX", "MASON", "MASSEY", "MASSIE", "MAST", "MASTERS",
- "MASTERSON", "MATA", "MATHENY", "MATHESON", "MATHEWS", "MATHIAS", "MATHIS", "MATLOCK", "MATNEY", "MATOS",
- "MATSON", "MATTESON", "MATTHEW", "MATTHEWS", "MATTINGLY", "MATTISON", "MATTOS", "MATTOX", "MATTSON",
- "MAULDIN", "MAUPIN", "MAURER", "MAURO", "MAXEY", "MAXFIELD", "MAXWELL", "MAY", "MAYBERRY", "MAYER",
- "MAYERS", "MAYES", "MAYFIELD", "MAYHEW", "MAYNARD", "MAYO", "MAYS", "MAZZA", "MCADAMS", "MCAFEE",
- "MCALISTER", "MCALLISTER", "MCARTHUR", "MCBEE", "MCBRIDE", "MCCABE", "MCCAFFREY", "MCCAIN", "MCCALL",
- "MCCALLISTER", "MCCALLUM", "MCCANN", "MCCANTS", "MCCARTER", "MCCARTHY", "MCCARTNEY", "MCCARTY", "MCCASKILL",
- "MCCAULEY", "MCCLAIN", "MCCLANAHAN", "MCCLARY", "MCCLEARY", "MCCLELLAN", "MCCLELLAND", "MCCLENDON",
- "MCCLINTOCK", "MCCLINTON", "MCCLOSKEY", "MCCLOUD", "MCCLUNG", "MCCLURE", "MCCOLLUM", "MCCOMBS", "MCCONNELL",
- "MCCOOL", "MCCORD", "MCCORKLE", "MCCORMACK", "MCCORMICK", "MCCOY", "MCCRACKEN", "MCCRARY", "MCCRAY",
- "MCCREARY", "MCCUE", "MCCULLOCH", "MCCULLOUGH", "MCCUNE", "MCCURDY", "MCCURRY", "MCCUTCHEON", "MCDADE",
- "MCDANIEL", "MCDANIELS", "MCDERMOTT", "MCDONALD", "MCDONNELL", "MCDONOUGH", "MCDOUGAL", "MCDOUGALL",
- "MCDOWELL", "MCDUFFIE", "MCELROY", "MCEWEN", "MCFADDEN", "MCFALL", "MCFARLAND", "MCFARLANE", "MCGEE",
- "MCGEHEE", "MCGHEE", "MCGILL", "MCGINNIS", "MCGOVERN", "MCGOWAN", "MCGRATH", "MCGRAW", "MCGREGOR", "MCGREW",
- "MCGRIFF", "MCGUIRE", "MCHENRY", "MCHUGH", "MCINNIS", "MCINTIRE", "MCINTOSH", "MCINTYRE", "MCKAY", "MCKEE",
- "MCKEEVER", "MCKENNA", "MCKENNEY", "MCKENZIE", "MCKEON", "MCKEOWN", "MCKINLEY", "MCKINNEY", "MCKINNON",
- "MCKNIGHT", "MCLAIN", "MCLAUGHLIN", "MCLAURIN", "MCLEAN", "MCLEMORE", "MCLENDON", "MCLEOD", "MCMAHAN",
- "MCMAHON", "MCMANUS", "MCMASTER", "MCMILLAN", "MCMILLEN", "MCMILLIAN", "MCMULLEN", "MCMURRAY", "MCNABB",
- "MCNAIR", "MCNALLY", "MCNAMARA", "MCNEAL", "MCNEELY", "MCNEIL", "MCNEILL", "MCNULTY", "MCNUTT", "MCPHERSON",
- "MCQUEEN", "MCRAE", "MCREYNOLDS", "MCSWAIN", "MCVAY", "MCVEY", "MCWHORTER", "MCWILLIAMS", "MEACHAM", "MEAD",
- "MEADE", "MEADOR", "MEADOWS", "MEANS", "MEARS", "MEDEIROS", "MEDINA", "MEDLEY", "MEDLIN", "MEDLOCK",
- "MEDRANO", "MEEHAN", "MEEK", "MEEKER", "MEEKS", "MEIER", "MEJIA", "MELANCON", "MELENDEZ", "MELLO", "MELTON",
- "MELVIN", "MENA", "MENARD", "MENDENHALL", "MENDEZ", "MENDOZA", "MENENDEZ", "MERCADO", "MERCER", "MERCHANT",
- "MERCIER", "MEREDITH", "MERRELL", "MERRICK", "MERRILL", "MERRIMAN", "MERRITT", "MESA", "MESSENGER",
- "MESSER", "MESSINA", "METCALF", "METZ", "METZGER", "METZLER", "MEYER", "MEYERS", "MEZA", "MICHAEL",
- "MICHAELS", "MICHAUD", "MICHEL", "MICKENS", "MIDDLETON", "MILAM", "MILBURN", "MILES", "MILLARD", "MILLER",
- "MILLIGAN", "MILLIKEN", "MILLS", "MILNE", "MILNER", "MILTON", "MIMS", "MINER", "MINNICK", "MINOR", "MINTER",
- "MINTON", "MINTZ", "MIRANDA", "MIRELES", "MITCHELL", "MIXON", "MIZE", "MOBLEY", "MOCK", "MOE", "MOELLER",
- "MOEN", "MOFFETT", "MOFFITT", "MOHR", "MOJICA", "MOLINA", "MOLL", "MONACO", "MONAGHAN", "MONAHAN", "MONEY",
- "MONIZ", "MONK", "MONROE", "MONSON", "MONTAGUE", "MONTALVO", "MONTANEZ", "MONTANO", "MONTEMAYOR", "MONTERO",
- "MONTES", "MONTEZ", "MONTGOMERY", "MONTOYA", "MOODY", "MOON", "MOONEY", "MOORE", "MOORMAN", "MORA",
- "MORALES", "MORAN", "MOREAU", "MOREHEAD", "MORELAND", "MORENO", "MOREY", "MORGAN", "MORIARTY", "MORIN",
- "MORLEY", "MORRELL", "MORRILL", "MORRIS", "MORRISON", "MORRISSEY", "MORROW", "MORSE", "MORTENSEN", "MORTON",
- "MOSBY", "MOSELEY", "MOSER", "MOSES", "MOSHER", "MOSIER", "MOSLEY", "MOSS", "MOTLEY", "MOTT", "MOULTON",
- "MOULTRIE", "MOUNT", "MOWERY", "MOYA", "MOYE", "MOYER", "MUELLER", "MUHAMMAD", "MUIR", "MULKEY", "MULL",
- "MULLEN", "MULLER", "MULLIGAN", "MULLIN", "MULLINS", "MULLIS", "MUNCY", "MUNDY", "MUNIZ", "MUNN", "MUNOZ",
- "MUNSON", "MURDOCK", "MURILLO", "MURPHY", "MURRAY", "MURRELL", "MURRY", "MUSE", "MUSGROVE", "MUSSER",
- "MYERS", "MYLES", "MYRICK", "NABORS", "NADEAU", "NAGEL", "NAGLE", "NAGY", "NAJERA", "NAKAMURA", "NALL",
- "NANCE", "NAPIER", "NAQUIN", "NARANJO", "NARVAEZ", "NASH", "NATHAN", "NATION", "NAVA", "NAVARRETE",
- "NAVARRO", "NAYLOR", "NEAL", "NEALY", "NEEDHAM", "NEEL", "NEELEY", "NEELY", "NEFF", "NEGRETE", "NEGRON",
- "NEIL", "NEILL", "NELMS", "NELSON", "NESBITT", "NESMITH", "NESS", "NESTOR", "NETTLES", "NEUMAN", "NEUMANN",
- "NEVAREZ", "NEVILLE", "NEW", "NEWBERRY", "NEWBY", "NEWCOMB", "NEWELL", "NEWKIRK", "NEWMAN", "NEWSOM",
- "NEWSOME", "NEWTON", "NG", "NGO", "NGUYEN", "NICHOLAS", "NICHOLS", "NICHOLSON", "NICKEL", "NICKERSON",
- "NIELSEN", "NIELSON", "NIETO", "NIEVES", "NILES", "NIX", "NIXON", "NOBLE", "NOBLES", "NOE", "NOEL", "NOLAN",
- "NOLAND", "NOLEN", "NOLL", "NOONAN", "NORFLEET", "NORIEGA", "NORMAN", "NORRIS", "NORTH", "NORTON",
- "NORWOOD", "NOVAK", "NOVOTNY", "NOWAK", "NOWLIN", "NOYES", "NUGENT", "NULL", "NUMBERS", "NUNES", "NUNEZ",
- "NUNLEY", "NUNN", "NUTT", "NUTTER", "NYE", "OAKES", "OAKLEY", "OAKS", "OATES", "OBRIEN", "OBRYAN", "OCAMPO",
- "OCASIO", "OCHOA", "OCHS", "OCONNELL", "OCONNER", "OCONNOR", "ODELL", "ODEN", "ODOM", "ODONNELL", "ODUM",
- "OGDEN", "OGLE", "OGLESBY", "OH", "OHARA", "OJEDA", "OKEEFE", "OLDHAM", "OLDS", "OLEARY", "OLIPHANT",
- "OLIVA", "OLIVARES", "OLIVAREZ", "OLIVAS", "OLIVE", "OLIVEIRA", "OLIVER", "OLIVO", "OLMSTEAD", "OLSEN",
- "OLSON", "OLVERA", "OMALLEY", "ONEAL", "ONEIL", "ONEILL", "ONTIVEROS", "ORDONEZ", "OREILLY", "ORELLANA",
- "ORLANDO", "ORNELAS", "OROSCO", "OROURKE", "OROZCO", "ORR", "ORTA", "ORTEGA", "ORTIZ", "OSBORN", "OSBORNE",
- "OSBURN", "OSGOOD", "OSHEA", "OSORIO", "OSTEEN", "OSTRANDER", "OSULLIVAN", "OSWALD", "OSWALT", "OTERO",
- "OTIS", "OTOOLE", "OTT", "OTTO", "OUELLETTE", "OUTLAW", "OVERBY", "OVERSTREET", "OVERTON", "OWEN", "OWENS",
- "PACE", "PACHECO", "PACK", "PACKARD", "PACKER", "PADGETT", "PADILLA", "PAGAN", "PAGE", "PAIGE", "PAINE",
- "PAINTER", "PAK", "PALACIOS", "PALMA", "PALMER", "PALUMBO", "PANNELL", "PANTOJA", "PAPE", "PAPPAS",
- "PAQUETTE", "PARADIS", "PARDO", "PAREDES", "PARENT", "PARHAM", "PARIS", "PARISH", "PARK", "PARKER",
- "PARKINSON", "PARKS", "PARNELL", "PARR", "PARRA", "PARRIS", "PARRISH", "PARROTT", "PARRY", "PARSON",
- "PARSONS", "PARTIN", "PARTRIDGE", "PASSMORE", "PATE", "PATEL", "PATERSON", "PATINO", "PATRICK", "PATTEN",
- "PATTERSON", "PATTON", "PAUL", "PAULEY", "PAULSEN", "PAULSON", "PAXTON", "PAYNE", "PAYTON", "PAZ", "PEACE",
- "PEACHEY", "PEACOCK", "PEAK", "PEARCE", "PEARSON", "PEASE", "PECK", "PEDERSEN", "PEDERSON", "PEEBLES",
- "PEEK", "PEEL", "PEELER", "PEEPLES", "PELLETIER", "PELTIER", "PEMBERTON", "PENA", "PENCE", "PENDER",
- "PENDERGRASS", "PENDLETON", "PENN", "PENNELL", "PENNINGTON", "PENNY", "PEOPLES", "PEPPER", "PERALES",
- "PERALTA", "PERDUE", "PEREA", "PEREIRA", "PEREZ", "PERKINS", "PERREAULT", "PERRIN", "PERRON", "PERRY",
- "PERRYMAN", "PERSON", "PETER", "PETERMAN", "PETERS", "PETERSEN", "PETERSON", "PETIT", "PETRIE", "PETTIGREW",
- "PETTIS", "PETTIT", "PETTWAY", "PETTY", "PEYTON", "PFEIFER", "PFEIFFER", "PHAM", "PHAN", "PHELAN", "PHELPS",
- "PHIFER", "PHILLIPS", "PHIPPS", "PICARD", "PICKARD", "PICKENS", "PICKERING", "PICKETT", "PIERCE", "PIERRE",
- "PIERSON", "PIKE", "PILCHER", "PIMENTEL", "PINA", "PINCKNEY", "PINEDA", "PINKERTON", "PINKSTON", "PINO",
- "PINSON", "PINTO", "PIPER", "PIPKIN", "PIPPIN", "PITMAN", "PITRE", "PITT", "PITTMAN", "PITTS", "PLACE",
- "PLANTE", "PLATT", "PLEASANT", "PLUMMER", "PLUNKETT", "POE", "POGUE", "POINDEXTER", "POINTER", "POIRIER",
- "POLANCO", "POLAND", "POLING", "POLK", "POLLACK", "POLLARD", "POLLOCK", "POMEROY", "PONCE", "POND",
- "PONDER", "POOL", "POOLE", "POORE", "POPE", "POPP", "PORTER", "PORTERFIELD", "PORTILLO", "POSEY", "POST",
- "POSTON", "POTTER", "POTTS", "POULIN", "POUNDS", "POWELL", "POWER", "POWERS", "PRADO", "PRATER", "PRATHER",
- "PRATT", "PRENTICE", "PRESCOTT", "PRESLEY", "PRESSLEY", "PRESTON", "PREWITT", "PRICE", "PRICHARD", "PRIDE",
- "PRIDGEN", "PRIEST", "PRIETO", "PRINCE", "PRINGLE", "PRITCHARD", "PRITCHETT", "PROCTOR", "PROFFITT",
- "PROSSER", "PROVOST", "PRUETT", "PRUITT", "PRYOR", "PUCKETT", "PUENTE", "PUGH", "PULIDO", "PULLEN",
- "PULLEY", "PULLIAM", "PURCELL", "PURDY", "PURNELL", "PURVIS", "PUTMAN", "PUTNAM", "PYLE", "QUALLS",
- "QUARLES", "QUEEN", "QUEZADA", "QUICK", "QUIGLEY", "QUILLEN", "QUINLAN", "QUINN", "QUINONES", "QUINONEZ",
- "QUINTANA", "QUINTANILLA", "QUINTERO", "QUIROZ", "RADER", "RADFORD", "RAFFERTY", "RAGAN", "RAGLAND",
- "RAGSDALE", "RAINES", "RAINEY", "RAINS", "RALEY", "RALPH", "RALSTON", "RAMEY", "RAMIREZ", "RAMON", "RAMOS",
- "RAMSAY", "RAMSEY", "RAND", "RANDALL", "RANDLE", "RANDOLPH", "RANEY", "RANGEL", "RANKIN", "RANSOM", "RAPP",
- "RASH", "RASMUSSEN", "RATCLIFF", "RATLIFF", "RAU", "RAUCH", "RAWLINGS", "RAWLINS", "RAWLS", "RAY",
- "RAYBURN", "RAYFORD", "RAYMOND", "RAYNOR", "RAZO", "REA", "READ", "REAGAN", "REARDON", "REAVES", "RECTOR",
- "REDD", "REDDEN", "REDDICK", "REDDING", "REDDY", "REDMAN", "REDMON", "REDMOND", "REECE", "REED", "REEDER",
- "REEDY", "REES", "REESE", "REEVES", "REGALADO", "REGAN", "REGISTER", "REICH", "REICHERT", "REID", "REILLY",
- "REINHARDT", "REINHART", "REIS", "REITER", "RENDON", "RENFRO", "RENNER", "RENO", "RENTERIA", "REUTER",
- "REY", "REYES", "REYNA", "REYNOLDS", "REYNOSO", "RHEA", "RHOADES", "RHOADS", "RHODEN", "RHODES", "RICCI",
- "RICE", "RICH", "RICHARD", "RICHARDS", "RICHARDSON", "RICHEY", "RICHIE", "RICHMOND", "RICHTER", "RICKARD",
- "RICKER", "RICKETTS", "RICKMAN", "RICKS", "RICO", "RIDDELL", "RIDDICK", "RIDDLE", "RIDENOUR", "RIDER",
- "RIDGEWAY", "RIDLEY", "RIFE", "RIGBY", "RIGGINS", "RIGGS", "RIGSBY", "RILEY", "RINALDI", "RINEHART", "RING",
- "RIOS", "RIPLEY", "RITCHEY", "RITCHIE", "RITTER", "RIVAS", "RIVERA", "RIVERS", "RIZZO", "ROACH", "ROARK",
- "ROBB", "ROBBINS", "ROBERGE", "ROBERSON", "ROBERT", "ROBERTS", "ROBERTSON", "ROBEY", "ROBINETTE", "ROBINS",
- "ROBINSON", "ROBISON", "ROBLES", "ROBSON", "ROBY", "ROCHA", "ROCHE", "ROCK", "ROCKWELL", "RODEN",
- "RODERICK", "RODGERS", "RODRIGUE", "RODRIGUES", "RODRIGUEZ", "RODRIQUEZ", "ROE", "ROGER", "ROGERS", "ROHR",
- "ROJAS", "ROLAND", "ROLDAN", "ROLLER", "ROLLINS", "ROMAN", "ROMANO", "ROMEO", "ROMERO", "ROMO", "RONEY",
- "ROONEY", "ROOT", "ROPER", "ROQUE", "ROSA", "ROSADO", "ROSALES", "ROSARIO", "ROSAS", "ROSE", "ROSEN",
- "ROSENBAUM", "ROSENBERG", "ROSENTHAL", "ROSS", "ROSSER", "ROSSI", "ROTH", "ROUNDS", "ROUNDTREE", "ROUNTREE",
- "ROUSE", "ROUSH", "ROUSSEAU", "ROUSSEL", "ROWAN", "ROWE", "ROWELL", "ROWLAND", "ROWLEY", "ROY", "ROYAL",
- "ROYBAL", "ROYER", "ROYSTER", "RUBIN", "RUBIO", "RUBY", "RUCKER", "RUDD", "RUDOLPH", "RUFF", "RUFFIN",
- "RUIZ", "RUNYAN", "RUNYON", "RUPERT", "RUPP", "RUSH", "RUSHING", "RUSS", "RUSSELL", "RUSSO", "RUST", "RUTH",
- "RUTHERFORD", "RUTLEDGE", "RYAN", "RYDER", "SAAVEDRA", "SABO", "SACCO", "SADLER", "SAENZ", "SAGE", "SAGER",
- "SALAS", "SALAZAR", "SALCEDO", "SALCIDO", "SALDANA", "SALDIVAR", "SALERNO", "SALES", "SALGADO", "SALINAS",
- "SALISBURY", "SALLEE", "SALLEY", "SALMON", "SALTER", "SAM", "SAMMONS", "SAMPLE", "SAMPLES", "SAMPSON",
- "SAMS", "SAMSON", "SAMUEL", "SAMUELS", "SANBORN", "SANCHES", "SANCHEZ", "SANDBERG", "SANDER", "SANDERS",
- "SANDERSON", "SANDLIN", "SANDOVAL", "SANDS", "SANFORD", "SANTANA", "SANTIAGO", "SANTOS", "SAPP", "SARGENT",
- "SASSER", "SATTERFIELD", "SAUCEDO", "SAUCIER", "SAUER", "SAULS", "SAUNDERS", "SAVAGE", "SAVOY", "SAWYER",
- "SAWYERS", "SAXON", "SAXTON", "SAYERS", "SAYLOR", "SAYRE", "SCALES", "SCANLON", "SCARBOROUGH", "SCARBROUGH",
- "SCHAEFER", "SCHAEFFER", "SCHAFER", "SCHAFFER", "SCHELL", "SCHERER", "SCHILLER", "SCHILLING", "SCHINDLER",
- "SCHMID", "SCHMIDT", "SCHMITT", "SCHMITZ", "SCHNEIDER", "SCHOFIELD", "SCHOLL", "SCHOONOVER", "SCHOTT",
- "SCHRADER", "SCHREIBER", "SCHREINER", "SCHROEDER", "SCHUBERT", "SCHULER", "SCHULTE", "SCHULTZ", "SCHULZ",
- "SCHULZE", "SCHUMACHER", "SCHUSTER", "SCHWAB", "SCHWARTZ", "SCHWARZ", "SCHWEITZER", "SCOGGINS", "SCOTT",
- "SCRIBNER", "SCROGGINS", "SCRUGGS", "SCULLY", "SEAL", "SEALS", "SEAMAN", "SEARCY", "SEARS", "SEATON",
- "SEAY", "SEE", "SEELEY", "SEGURA", "SEIBERT", "SEIDEL", "SEIFERT", "SEILER", "SEITZ", "SELBY", "SELF",
- "SELL", "SELLERS", "SELLS", "SENA", "SEPULVEDA", "SERNA", "SERRANO", "SESSIONS", "SETTLE", "SETTLES",
- "SEVERSON", "SEWARD", "SEWELL", "SEXTON", "SEYMORE", "SEYMOUR", "SHACKELFORD", "SHADE", "SHAFER", "SHAFFER",
- "SHAH", "SHANK", "SHANKS", "SHANNON", "SHAPIRO", "SHARKEY", "SHARP", "SHARPE", "SHAVER", "SHAW", "SHAY",
- "SHEA", "SHEARER", "SHEEHAN", "SHEETS", "SHEFFIELD", "SHELBY", "SHELDON", "SHELL", "SHELLEY", "SHELLY",
- "SHELTON", "SHEPARD", "SHEPHARD", "SHEPHERD", "SHEPPARD", "SHERIDAN", "SHERMAN", "SHERRILL", "SHERROD",
- "SHERRY", "SHERWOOD", "SHIELDS", "SHIFFLETT", "SHIN", "SHINN", "SHIPLEY", "SHIPMAN", "SHIPP", "SHIRLEY",
- "SHIVELY", "SHIVERS", "SHOCKLEY", "SHOEMAKER", "SHOOK", "SHORE", "SHORES", "SHORT", "SHORTER", "SHRADER",
- "SHULER", "SHULL", "SHULTZ", "SHUMAKER", "SHUMAN", "SHUMATE", "SIBLEY", "SIDES", "SIEGEL", "SIERRA",
- "SIGLER", "SIKES", "SILER", "SILLS", "SILVA", "SILVER", "SILVERMAN", "SILVERS", "SILVIA", "SIMMONS",
- "SIMMS", "SIMON", "SIMONE", "SIMONS", "SIMONSON", "SIMPKINS", "SIMPSON", "SIMS", "SINCLAIR", "SINGER",
- "SINGH", "SINGLETARY", "SINGLETON", "SIPES", "SISCO", "SISK", "SISSON", "SIZEMORE", "SKAGGS", "SKELTON",
- "SKIDMORE", "SKINNER", "SKIPPER", "SLACK", "SLADE", "SLAGLE", "SLATER", "SLATON", "SLATTERY", "SLAUGHTER",
- "SLAYTON", "SLEDGE", "SLOAN", "SLOCUM", "SLONE", "SMALL", "SMALLEY", "SMALLS", "SMALLWOOD", "SMART",
- "SMILEY", "SMITH", "SMITHSON", "SMOOT", "SMOTHERS", "SMYTH", "SNEAD", "SNEED", "SNELL", "SNIDER", "SNIPES",
- "SNODGRASS", "SNOW", "SNOWDEN", "SNYDER", "SOARES", "SOLANO", "SOLIS", "SOLIZ", "SOLOMON", "SOMERS",
- "SOMERVILLE", "SOMMER", "SOMMERS", "SONG", "SORENSEN", "SORENSON", "SORIA", "SORIANO", "SORRELL", "SOSA",
- "SOTELO", "SOTO", "SOUSA", "SOUTH", "SOUTHARD", "SOUTHERLAND", "SOUTHERN", "SOUZA", "SOWELL", "SOWERS",
- "SPAIN", "SPALDING", "SPANGLER", "SPANN", "SPARKMAN", "SPARKS", "SPARROW", "SPAULDING", "SPEAR", "SPEARMAN",
- "SPEARS", "SPEED", "SPEER", "SPEIGHT", "SPELLMAN", "SPENCE", "SPENCER", "SPERRY", "SPICER", "SPILLMAN",
- "SPINKS", "SPIVEY", "SPOONER", "SPRADLIN", "SPRAGUE", "SPRIGGS", "SPRING", "SPRINGER", "SPROUSE", "SPRUILL",
- "SPURGEON", "SPURLOCK", "SQUIRES", "STACEY", "STACK", "STACKHOUSE", "STACY", "STAFFORD", "STAGGS", "STAHL",
- "STALEY", "STALLINGS", "STALLWORTH", "STAMM", "STAMPER", "STAMPS", "STANFIELD", "STANFORD", "STANLEY",
- "STANTON", "STAPLES", "STAPLETON", "STARK", "STARKEY", "STARKS", "STARLING", "STARNES", "STARR", "STATEN",
- "STATON", "STAUFFER", "STCLAIR", "STEADMAN", "STEARNS", "STEED", "STEEL", "STEELE", "STEEN", "STEFFEN",
- "STEGALL", "STEIN", "STEINBERG", "STEINER", "STEPHEN", "STEPHENS", "STEPHENSON", "STEPP", "STERLING",
- "STERN", "STEVENS", "STEVENSON", "STEWARD", "STEWART", "STIDHAM", "STILES", "STILL", "STILLMAN",
- "STILLWELL", "STILTNER", "STINE", "STINNETT", "STINSON", "STITT", "STJOHN", "STOCK", "STOCKTON", "STODDARD",
- "STOKER", "STOKES", "STOLL", "STONE", "STONER", "STOREY", "STORY", "STOTT", "STOUT", "STOVALL", "STOVER",
- "STOWE", "STPIERRE", "STRAIN", "STRAND", "STRANGE", "STRATTON", "STRAUB", "STRAUSS", "STREET", "STREETER",
- "STRICKLAND", "STRINGER", "STRONG", "STROTHER", "STROUD", "STROUP", "STRUNK", "STUART", "STUBBLEFIELD",
- "STUBBS", "STUCKEY", "STULL", "STUMP", "STURDIVANT", "STURGEON", "STURGILL", "STURGIS", "STURM", "STYLES",
- "SUAREZ", "SUGGS", "SULLIVAN", "SUMMERLIN", "SUMMERS", "SUMNER", "SUMPTER", "SUN", "SUTHERLAND", "SUTTER",
- "SUTTON", "SWAFFORD", "SWAIN", "SWAN", "SWANK", "SWANN", "SWANSON", "SWARTZ", "SWEARINGEN", "SWEAT",
- "SWEENEY", "SWEET", "SWENSON", "SWIFT", "SWISHER", "SWITZER", "SWOPE", "SYKES", "SYLVESTER", "TABER",
- "TABOR", "TACKETT", "TAFT", "TAGGART", "TALBERT", "TALBOT", "TALBOTT", "TALLENT", "TALLEY", "TAM", "TAMAYO",
- "TAN", "TANAKA", "TANG", "TANNER", "TAPIA", "TAPP", "TARVER", "TATE", "TATUM", "TAVARES", "TAYLOR",
- "TEAGUE", "TEAL", "TEEL", "TEETER", "TEJADA", "TEJEDA", "TELLEZ", "TEMPLE", "TEMPLETON", "TENNANT",
- "TENNEY", "TERRELL", "TERRILL", "TERRY", "THACKER", "THAMES", "THAO", "THARP", "THATCHER", "THAYER",
- "THERIAULT", "THERIOT", "THIBODEAU", "THIBODEAUX", "THIEL", "THIGPEN", "THOMAS", "THOMASON", "THOMPSON",
- "THOMSEN", "THOMSON", "THORN", "THORNBURG", "THORNE", "THORNHILL", "THORNTON", "THORP", "THORPE", "THORTON",
- "THRASH", "THRASHER", "THURMAN", "THURSTON", "TIBBETTS", "TIBBS", "TICE", "TIDWELL", "TIERNEY", "TIJERINA",
- "TILLER", "TILLERY", "TILLEY", "TILLMAN", "TILTON", "TIMM", "TIMMONS", "TINKER", "TINSLEY", "TIPTON",
- "TIRADO", "TISDALE", "TITUS", "TOBIAS", "TOBIN", "TODD", "TOLBERT", "TOLEDO", "TOLER", "TOLIVER",
- "TOLLIVER", "TOM", "TOMLIN", "TOMLINSON", "TOMPKINS", "TONEY", "TONG", "TORO", "TORRENCE", "TORRES",
- "TORREZ", "TOTH", "TOTTEN", "TOVAR", "TOWNES", "TOWNS", "TOWNSEND", "TRACY", "TRAHAN", "TRAMMELL", "TRAN",
- "TRAPP", "TRASK", "TRAVERS", "TRAVIS", "TRAYLOR", "TREADWAY", "TREADWELL", "TREJO", "TREMBLAY", "TRENT",
- "TREVINO", "TRIBBLE", "TRICE", "TRIMBLE", "TRINIDAD", "TRIPLETT", "TRIPP", "TROTTER", "TROUT", "TROUTMAN",
- "TROY", "TRUDEAU", "TRUE", "TRUITT", "TRUJILLO", "TRUONG", "TUBBS", "TUCK", "TUCKER", "TUGGLE", "TURK",
- "TURLEY", "TURMAN", "TURNBULL", "TURNER", "TURNEY", "TURPIN", "TUTTLE", "TYLER", "TYNER", "TYREE", "TYSON",
- "ULRICH", "UNDERHILL", "UNDERWOOD", "UNGER", "UPCHURCH", "UPSHAW", "UPTON", "URBAN", "URBINA", "URIBE",
- "USHER", "UTLEY", "VAIL", "VALADEZ", "VALDES", "VALDEZ", "VALENCIA", "VALENTI", "VALENTIN", "VALENTINE",
- "VALENZUELA", "VALERIO", "VALLE", "VALLEJO", "VALLES", "VAN", "VANBUREN", "VANCE", "VANDIVER", "VANDYKE",
- "VANG", "VANHOOSE", "VANHORN", "VANMETER", "VANN", "VANOVER", "VANWINKLE", "VARELA", "VARGAS", "VARNER",
- "VARNEY", "VASQUEZ", "VAUGHAN", "VAUGHN", "VAUGHT", "VAZQUEZ", "VEAL", "VEGA", "VELA", "VELASCO",
- "VELASQUEZ", "VELAZQUEZ", "VELEZ", "VENABLE", "VENEGAS", "VENTURA", "VERA", "VERDIN", "VERGARA", "VERNON",
- "VEST", "VETTER", "VICK", "VICKERS", "VICKERY", "VICTOR", "VIDAL", "VIEIRA", "VIERA", "VIGIL", "VILLA",
- "VILLALOBOS", "VILLANUEVA", "VILLAREAL", "VILLARREAL", "VILLASENOR", "VILLEGAS", "VINCENT", "VINES",
- "VINSON", "VITALE", "VO", "VOGEL", "VOGT", "VOSS", "VU", "VUE", "WADDELL", "WADE", "WADSWORTH", "WAGGONER",
- "WAGNER", "WAGONER", "WAHL", "WAITE", "WAKEFIELD", "WALDEN", "WALDRON", "WALDROP", "WALKER", "WALL",
- "WALLACE", "WALLEN", "WALLER", "WALLING", "WALLIS", "WALLS", "WALSH", "WALSTON", "WALTER", "WALTERS",
- "WALTON", "WAMPLER", "WANG", "WARD", "WARDEN", "WARE", "WARFIELD", "WARNER", "WARREN", "WASHBURN",
- "WASHINGTON", "WASSON", "WATERMAN", "WATERS", "WATKINS", "WATSON", "WATT", "WATTERS", "WATTS", "WAUGH",
- "WAY", "WAYNE", "WEATHERFORD", "WEATHERLY", "WEATHERS", "WEAVER", "WEBB", "WEBBER", "WEBER", "WEBSTER",
- "WEDDLE", "WEED", "WEEKS", "WEEMS", "WEINBERG", "WEINER", "WEINSTEIN", "WEIR", "WEIS", "WEISS", "WELCH",
- "WELDON", "WELKER", "WELLER", "WELLMAN", "WELLS", "WELSH", "WENDT", "WENGER", "WENTWORTH", "WENTZ",
- "WENZEL", "WERNER", "WERTZ", "WESLEY", "WEST", "WESTBROOK", "WESTER", "WESTFALL", "WESTMORELAND", "WESTON",
- "WETZEL", "WHALEN", "WHALEY", "WHARTON", "WHATLEY", "WHEAT", "WHEATLEY", "WHEATON", "WHEELER", "WHELAN",
- "WHIPPLE", "WHITAKER", "WHITCOMB", "WHITE", "WHITED", "WHITEHEAD", "WHITEHURST", "WHITEMAN", "WHITESIDE",
- "WHITFIELD", "WHITING", "WHITLEY", "WHITLOCK", "WHITLOW", "WHITMAN", "WHITMIRE", "WHITMORE", "WHITNEY",
- "WHITSON", "WHITT", "WHITTAKER", "WHITTEN", "WHITTINGTON", "WHITTLE", "WHITWORTH", "WHYTE", "WICK",
- "WICKER", "WICKHAM", "WICKS", "WIESE", "WIGGINS", "WILBANKS", "WILBER", "WILBUR", "WILBURN", "WILCOX",
- "WILD", "WILDE", "WILDER", "WILES", "WILEY", "WILHELM", "WILHITE", "WILKE", "WILKERSON", "WILKES",
- "WILKINS", "WILKINSON", "WILKS", "WILL", "WILLARD", "WILLETT", "WILLEY", "WILLIAM", "WILLIAMS",
- "WILLIAMSON", "WILLIFORD", "WILLINGHAM", "WILLIS", "WILLOUGHBY", "WILLS", "WILLSON", "WILMOTH", "WILSON",
- "WILT", "WIMBERLY", "WINCHESTER", "WINDHAM", "WINFIELD", "WINFREY", "WING", "WINGATE", "WINGFIELD",
- "WINKLER", "WINN", "WINSLOW", "WINSTEAD", "WINSTON", "WINTER", "WINTERS", "WIRTH", "WISE", "WISEMAN",
- "WISNIEWSKI", "WITCHER", "WITHERS", "WITHERSPOON", "WITHROW", "WITT", "WITTE", "WOFFORD", "WOLF", "WOLFE",
- "WOLFF", "WOLFORD", "WOMACK", "WONG", "WOO", "WOOD", "WOODALL", "WOODARD", "WOODBURY", "WOODCOCK", "WOODEN",
- "WOODLEY", "WOODRUFF", "WOODS", "WOODSON", "WOODWARD", "WOODWORTH", "WOODY", "WOOLDRIDGE", "WOOLEY",
- "WOOTEN", "WORD", "WORDEN", "WORKMAN", "WORLEY", "WORRELL", "WORSHAM", "WORTH", "WORTHAM", "WORTHINGTON",
- "WORTHY", "WRAY", "WREN", "WRIGHT", "WU", "WYANT", "WYATT", "WYLIE", "WYMAN", "WYNN", "WYNNE", "XIONG",
- "YAMAMOTO", "YANCEY", "YANEZ", "YANG", "YARBROUGH", "YATES", "YAZZIE", "YBARRA", "YEAGER", "YEE", "YI",
- "YOCUM", "YODER", "YOO", "YOON", "YORK", "YOST", "YOUNG", "YOUNGBLOOD", "YOUNGER", "YOUNT", "YU",
- "ZAMBRANO", "ZAMORA", "ZAPATA", "ZARAGOZA", "ZARATE", "ZAVALA", "ZEIGLER", "ZELLER", "ZEPEDA", "ZHANG",
- "ZIEGLER", "ZIELINSKI", "ZIMMER", "ZIMMERMAN", "ZINK", "ZOOK", "ZUNIGA" };
- }
+ public static String generateRandomName() {
+ String first, last;
- public static String generateRandomName() {
- String first, last;
-
- boolean isScottish = (MathUtils.randInt(0, 10) >= 9);
-
- if (isScottish) {
- first = mScottishFirstNames[MathUtils.randInt(0, mScottishFirstNames.length - 1)].toLowerCase();
- }
- else {
- first = mFirstNames[MathUtils.randInt(0, mFirstNames.length - 1)].toLowerCase();
- }
-
- last = mLastNames[MathUtils.randInt(0, mLastNames.length - 1)].toLowerCase();
- if (first.equalsIgnoreCase(last)) {
- while (first.equalsIgnoreCase(last))
- first = mFirstNames[MathUtils.randInt(0, mFirstNames.length - 1)].toLowerCase();
- }
- first = StringUtils.capitalize(first);
- last = StringUtils.capitalize(last);
- return first + " " + last;
+ boolean isScottish = (MathUtils.randInt(0, 10) >= 9);
- }
+ if (isScottish) {
+ first = mScottishFirstNames[MathUtils.randInt(0, mScottishFirstNames.length - 1)].toLowerCase();
+ } else {
+ first = mFirstNames[MathUtils.randInt(0, mFirstNames.length - 1)].toLowerCase();
+ }
+ last = mLastNames[MathUtils.randInt(0, mLastNames.length - 1)].toLowerCase();
+ if (first.equalsIgnoreCase(last)) {
+ while (first.equalsIgnoreCase(last))
+ first = mFirstNames[MathUtils.randInt(0, mFirstNames.length - 1)].toLowerCase();
+ }
+ first = StringUtils.capitalize(first);
+ last = StringUtils.capitalize(last);
+ return first + " " + last;
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/VillagerEventHandler.java b/src/main/java/gtPlusPlus/plugin/villagers/VillagerEventHandler.java
index b515f0979e..160b384150 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/VillagerEventHandler.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/VillagerEventHandler.java
@@ -2,46 +2,40 @@ package gtPlusPlus.plugin.villagers;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.plugin.villagers.entity.EntityBaseVillager;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.passive.EntityVillager;
-import net.minecraft.world.World;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
public class VillagerEventHandler {
- private final static VillagerEventHandler mInstance;
-
- static {
- mInstance = new VillagerEventHandler();
- Utils.registerEvent(mInstance);
- }
-
- @SubscribeEvent
- public void onEntityJoinWorld(EntityJoinWorldEvent event){
-
-
- /*try {
- if (event.entity != null && event.entity instanceof EntityLivingBase && event.entity instanceof EntityVillager){
- EntityVillager entity = (EntityVillager) event.entity;
- World world = entity.worldObj;
- int profession = entity.getProfession();
- if (world != null && (profession >= 7735 && profession <= 7737)){
- EntityBaseVillager mNew = new EntityBaseVillager(world, profession);
- mNew.copyLocationAndAnglesFrom(entity);
- if (mNew != null) {
- world.removeEntity(entity);
- world.spawnEntityInWorld(mNew);
- }
- }
-
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- return;
- }*/
-
- }
-
+ private static final VillagerEventHandler mInstance;
+
+ static {
+ mInstance = new VillagerEventHandler();
+ Utils.registerEvent(mInstance);
+ }
+
+ @SubscribeEvent
+ public void onEntityJoinWorld(EntityJoinWorldEvent event) {
+
+ /*try {
+ if (event.entity != null && event.entity instanceof EntityLivingBase && event.entity instanceof EntityVillager){
+ EntityVillager entity = (EntityVillager) event.entity;
+ World world = entity.worldObj;
+ int profession = entity.getProfession();
+ if (world != null && (profession >= 7735 && profession <= 7737)){
+ EntityBaseVillager mNew = new EntityBaseVillager(world, profession);
+ mNew.copyLocationAndAnglesFrom(entity);
+ if (mNew != null) {
+ world.removeEntity(entity);
+ world.spawnEntityInWorld(mNew);
+ }
+ }
+
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ return;
+ }*/
+
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/VillagerObject.java b/src/main/java/gtPlusPlus/plugin/villagers/VillagerObject.java
index a5587a1b52..ad49741726 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/VillagerObject.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/VillagerObject.java
@@ -7,34 +7,38 @@ import net.minecraft.util.ResourceLocation;
public class VillagerObject {
- public final int mID;
- public final String mName;
- public final IVillageTradeHandler mCustomTrade;
-
-
- public VillagerObject(int aID, String aName, Object aProfession, Object aCareer, Object aSkin, IVillageTradeHandler aCustomTrade) {
-
- mID = aID;
- mName = aName;
- mCustomTrade = aCustomTrade;
-
- //Register Custom Trade to Registry.
- if (aCustomTrade != null) {
- Core_VillagerAdditions.mVillagerTrades.put(new Pair<Integer, IVillageTradeHandler>(7735+aID, aCustomTrade));
- }
- //Register Skin to Registry.
- if (aSkin != null) {
-
- if (aSkin instanceof String) {
- String s = (String) aSkin;
- aSkin = new ResourceLocation(CORE.MODID+":"+"textures/entity/villager/"+s+".png");
- }
- if (aSkin instanceof ResourceLocation) {
- Core_VillagerAdditions.mVillagerSkins.put(aID, (ResourceLocation) aSkin);
- }
-
- }
- VillagerUtils.registerNewVillager(aID, this);
- }
-
+ public final int mID;
+ public final String mName;
+ public final IVillageTradeHandler mCustomTrade;
+
+ public VillagerObject(
+ int aID,
+ String aName,
+ Object aProfession,
+ Object aCareer,
+ Object aSkin,
+ IVillageTradeHandler aCustomTrade) {
+
+ mID = aID;
+ mName = aName;
+ mCustomTrade = aCustomTrade;
+
+ // Register Custom Trade to Registry.
+ if (aCustomTrade != null) {
+ Core_VillagerAdditions.mVillagerTrades.put(
+ new Pair<Integer, IVillageTradeHandler>(7735 + aID, aCustomTrade));
+ }
+ // Register Skin to Registry.
+ if (aSkin != null) {
+
+ if (aSkin instanceof String) {
+ String s = (String) aSkin;
+ aSkin = new ResourceLocation(CORE.MODID + ":" + "textures/entity/villager/" + s + ".png");
+ }
+ if (aSkin instanceof ResourceLocation) {
+ Core_VillagerAdditions.mVillagerSkins.put(aID, (ResourceLocation) aSkin);
+ }
+ }
+ VillagerUtils.registerNewVillager(aID, this);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/VillagerUtils.java b/src/main/java/gtPlusPlus/plugin/villagers/VillagerUtils.java
index f252ad068d..abdb16721c 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/VillagerUtils.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/VillagerUtils.java
@@ -1,23 +1,23 @@
package gtPlusPlus.plugin.villagers;
-import java.util.HashMap;
-
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
+import java.util.HashMap;
public class VillagerUtils {
- public static final HashMap<Integer, VillagerObject> mVillagerMap = new HashMap<Integer, VillagerObject>();
-
- public static void registerNewVillager(int aID, String aName, Object aProfession, Object aCareer, Object aSkin, IVillageTradeHandler aCustomTrade) {
- registerNewVillager(aID, new VillagerObject(aID, aName, aProfession, aCareer, aSkin, aCustomTrade));
- }
-
- public static void registerNewVillager(int aID, VillagerObject aVillager) {
- mVillagerMap.put(aID, aVillager);
- }
+ public static final HashMap<Integer, VillagerObject> mVillagerMap = new HashMap<Integer, VillagerObject>();
+
+ public static void registerNewVillager(
+ int aID,
+ String aName,
+ Object aProfession,
+ Object aCareer,
+ Object aSkin,
+ IVillageTradeHandler aCustomTrade) {
+ registerNewVillager(aID, new VillagerObject(aID, aName, aProfession, aCareer, aSkin, aCustomTrade));
+ }
-
-
-
-
+ public static void registerNewVillager(int aID, VillagerObject aVillager) {
+ mVillagerMap.put(aID, aVillager);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/block/BlockGenericSpawner.java b/src/main/java/gtPlusPlus/plugin/villagers/block/BlockGenericSpawner.java
index 916f360012..82650fbd70 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/block/BlockGenericSpawner.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/block/BlockGenericSpawner.java
@@ -2,14 +2,13 @@ package gtPlusPlus.plugin.villagers.block;
import static gtPlusPlus.core.lib.CORE.RANDOM;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.itemblock.ItemBlockSpawner;
import gtPlusPlus.plugin.villagers.Core_VillagerAdditions;
import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner;
+import java.util.List;
import net.minecraft.block.BlockMobSpawner;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@@ -19,42 +18,38 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockGenericSpawner extends BlockMobSpawner {
-
- public BlockGenericSpawner() {
- this.disableStats();
- this.setHardness(5.0F);
- this.setStepSound(soundTypeMetal);
- this.setBlockName("blockMobSpawnerEx");
- this.setBlockTextureName("mob_spawner");
- this.setResistance(2000.0F);
- GameRegistry.registerBlock(this, ItemBlockSpawner.class, "blockMobSpawnerEx");
- Core_VillagerAdditions.mInstance.log("Registered Custom Spawner Block.");
- }
-
- /**
+
+ public BlockGenericSpawner() {
+ this.disableStats();
+ this.setHardness(5.0F);
+ this.setStepSound(soundTypeMetal);
+ this.setBlockName("blockMobSpawnerEx");
+ this.setBlockTextureName("mob_spawner");
+ this.setResistance(2000.0F);
+ GameRegistry.registerBlock(this, ItemBlockSpawner.class, "blockMobSpawnerEx");
+ Core_VillagerAdditions.mInstance.log("Registered Custom Spawner Block.");
+ }
+
+ /**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*/
@Override
- public TileEntity createNewTileEntity(World world, int meta)
- {
+ public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityGenericSpawner(meta);
}
-
+
@Override
- public int getExpDrop(IBlockAccess world, int metadata, int fortune){
+ public int getExpDrop(IBlockAccess world, int metadata, int fortune) {
return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
}
-
+
/**
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
*/
@SideOnly(Side.CLIENT)
- public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_)
- {
- for (int i = 0; i < Math.max(1,TileEntityGenericSpawner.mSpawners.size()); ++i)
- {
+ public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
+ for (int i = 0; i < Math.max(1, TileEntityGenericSpawner.mSpawners.size()); ++i) {
p_149666_3_.add(new ItemStack(p_149666_1_, 1, i));
}
}
-
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java b/src/main/java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java
index c29aadb16b..655d1c567c 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java
@@ -1,15 +1,14 @@
package gtPlusPlus.plugin.villagers.entity;
-import java.lang.reflect.Field;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.VillagerRegistry;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.plugin.villagers.NameLists;
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Random;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -30,509 +29,541 @@ import net.minecraft.world.World;
public class EntityBaseVillager extends EntityVillager {
- // public static final VillagerProfession mProfession;
-
- /*
- *
- * Your problem is that you are extending EntityVillager, but buyingList and
- * addDefaultEquipment are both PRIVATE members of EntityVillager - you cannot
- * use or override them without Reflection or ASM.
- *
- * What you can do, however, is override getRecipes to return your own list, but
- * because you override EntityVillager, your mob is still using the villager's
- * buyingList (which is NULL) when useRecipe or any other villager method is
- * called. You either have to override every method from EntityVillager which
- * interacts with buyingList and make it use your own list, or you need to not
- * extend EntityVillager and just implement IMerchant instead.
- */
-
- private final int mRoleID;
-
- public EntityBaseVillager(World aWorld){
- this(aWorld, 0);
- }
-
- public EntityBaseVillager(World aWorld, int aID) {
- super(aWorld, aID);
- mRoleID = aID;
- }
-
- @Override
- public void writeEntityToNBT(NBTTagCompound aNBT) {
- if (this.hasCustomNameTag()) {
- if (!aNBT.hasKey("aCustomName")) {
- aNBT.setString("aCustomName", this.getCommandSenderName());
- }
- }
- super.writeEntityToNBT(aNBT);
- }
-
- @Override
- public void readEntityFromNBT(NBTTagCompound aNBT) {
- if (aNBT.hasKey("aCustomName")) {
- if (!this.getCustomNameTag().equals(aNBT.getString("aCustomName"))) {
- this.setCustomNameTag(aNBT.getString("aCustomName"));
- }
- }
- super.readEntityFromNBT(aNBT);
- }
-
- @Override
- public void writeToNBT(NBTTagCompound aNBT) {
- // TODO Auto-generated method stub
- super.writeToNBT(aNBT);
- }
-
- @Override
- public void readFromNBT(NBTTagCompound aNBT) {
- // TODO Auto-generated method stub
- super.readFromNBT(aNBT);
- }
-
- @Override
- protected boolean canDespawn() {
- return !this.hasCustomNameTag();
- }
-
- @Override
- public void setProfession(int p_70938_1_) {
- super.setProfession(p_70938_1_);
- }
-
- @Override
- public int getProfession() {
- int prof = super.getProfession();
- //Logger.INFO(""+mRoleID);
- return prof < 7735 ? 7738 : prof;
- }
-
- @Override
- public void useRecipe(MerchantRecipe p_70933_1_) {
- super.useRecipe(p_70933_1_);
- }
-
- @Override
- public void setRecipes(MerchantRecipeList p_70930_1_) {
- super.setRecipes(p_70930_1_);
- }
-
- public boolean shouldAlwaysSprint() {
- return false;
- };
-
- @Override
- public void onLivingUpdate() {
-
- // Set Custom Name
- if (!this.hasCustomNameTag()) {
- this.setCustomNameTag(NameLists.generateRandomName());
- }
-
- super.onLivingUpdate();
-
- // Make these guys always sprint
- if (shouldAlwaysSprint()) {
- if (!this.isSprinting()) {
- this.setSprinting(true);
- }
- }
- else {
- if (this.isSprinting()) {
- this.setSprinting(false);
- }
- }
-
- }
-
- @Override
- public Entity getEntityToAttack() {
- return super.getEntityToAttack();
- }
-
- @Override
- public boolean getAlwaysRenderNameTag() {
- return hasCustomNameTag();
- }
-
- @Override
- public Random getRNG() {
- return CORE.RANDOM;
- }
-
- @Override
- public void setSprinting(boolean bool) {
- super.setSprinting(bool);
- }
-
- /**
- * Custom Shit
- */
-
- protected float getField_82191_bN() {
- Field v82191 = ReflectionUtils.getField(getClass(), "field_82191_bN");
- try {
- return v82191 != null ? v82191.getFloat(this) : 0f;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return 0f;
- }
- }
-
- protected void setField_82191_bN(float f) {
- try {
- ReflectionUtils.setField(this, "field_82191_bN", f);
- } catch (IllegalArgumentException e) {
- }
- }
-
- protected boolean getNeedsInitilization() {
- Field v82191 = ReflectionUtils.getField(EntityVillager.class, "needsInitilization");
- try {
- return v82191 != null ? v82191.getBoolean(this) : false;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return false;
- }
- }
-
- protected void setNeedsInitilization(boolean f) {
- try {
- ReflectionUtils.setField(this, "needsInitilization", f);
- } catch (IllegalArgumentException e) {
- }
- }
-
- protected MerchantRecipeList getBuyingList() {
- Field v82191;
- MerchantRecipeList o = null;
- v82191 = ReflectionUtils.getField(getClass(), "buyingList");
- try {
- if (v82191 != null)
- o = (MerchantRecipeList) v82191.get(this);
- Logger.WARNING("Is BuyingList Valid? " + (v82191 != null));
- return v82191 != null ? o : null;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- e.printStackTrace();
- return null;
- }
-
- }
-
- protected void setBuyingList(MerchantRecipeList f) {
- try {
- Logger.WARNING("set BuyingList? "+(ReflectionUtils.setField(this, "buyingList", f)));
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- }
- }
-
- protected Village getVillageObject() {
- Field v82191 = ReflectionUtils.getField(getClass(), "villageObj");
- try {
- return v82191 != null ? (Village) v82191.get(this) : null;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return null;
- }
- }
-
- protected String getLastBuyingPlayer() {
- Field v82191 = ReflectionUtils.getField(getClass(), "lastBuyingPlayer");
- try {
- return v82191 != null ? (String) v82191.get(this) : "";
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return "";
- }
- }
-
- public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) {
- if (getBuyingList() == null) {
- this.addDefaultEquipmentAndRecipies(1);
- }
- return getBuyingList();
- }
-
- /**
- * Adjusts the probability of obtaining a given recipe being offered by a
- * villager
- */
- private float adjustProbability(float p_82188_1_) {
- float f1 = p_82188_1_ + getField_82191_bN();
- return f1 > 0.9F ? 0.9F - (f1 - 0.9F) : f1;
- }
-
- /**
- * based on the villagers profession add items, equipment, and recipies adds
- * par1 random items to the list of things that the villager wants to buy. (at
- * most 1 of each wanted type is added)
- */
- private void addDefaultEquipmentAndRecipies(int p_70950_1_) {
- if (this.getBuyingList() != null) {
- setField_82191_bN(MathHelper.sqrt_float((float) this.getBuyingList().size()) * 0.2F);
- } else {
- setField_82191_bN(0.0F);
- }
-
- MerchantRecipeList merchantrecipelist;
- merchantrecipelist = new MerchantRecipeList();
- VillagerRegistry.manageVillagerTrades(merchantrecipelist, this, this.getProfession(), this.rand);
- int k;
- label50:
-
- switch (this.getProfession()) {
- case 0:
- addPurchaseRecipe(merchantrecipelist, Items.wheat, this.rand, this.adjustProbability(0.9F));
- addPurchaseRecipe(merchantrecipelist, Item.getItemFromBlock(Blocks.wool), this.rand,
- this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.chicken, this.rand, this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.cooked_fished, this.rand, this.adjustProbability(0.4F));
- addEmeraldTrade(merchantrecipelist, Items.bread, this.rand, this.adjustProbability(0.9F));
- addEmeraldTrade(merchantrecipelist, Items.melon, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.apple, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.cookie, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.shears, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.flint_and_steel, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.cooked_chicken, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.arrow, this.rand, this.adjustProbability(0.5F));
-
- if (this.rand.nextFloat() < this.adjustProbability(0.5F)) {
- merchantrecipelist.add(new MerchantRecipe(new ItemStack(Blocks.gravel, 10),
- new ItemStack(Items.emerald), new ItemStack(Items.flint, 4 + this.rand.nextInt(2), 0)));
- }
-
- break;
- case 1:
- addPurchaseRecipe(merchantrecipelist, Items.paper, this.rand, this.adjustProbability(0.8F));
- addPurchaseRecipe(merchantrecipelist, Items.book, this.rand, this.adjustProbability(0.8F));
- addPurchaseRecipe(merchantrecipelist, Items.written_book, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Item.getItemFromBlock(Blocks.bookshelf), this.rand,
- this.adjustProbability(0.8F));
- addEmeraldTrade(merchantrecipelist, Item.getItemFromBlock(Blocks.glass), this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.compass, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.clock, this.rand, this.adjustProbability(0.2F));
-
- if (this.rand.nextFloat() < this.adjustProbability(0.07F)) {
- Enchantment enchantment = Enchantment.enchantmentsBookList[this.rand
- .nextInt(Enchantment.enchantmentsBookList.length)];
- int i1 = MathHelper.getRandomIntegerInRange(this.rand, enchantment.getMinLevel(),
- enchantment.getMaxLevel());
- ItemStack itemstack = Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, i1));
- k = 2 + this.rand.nextInt(5 + i1 * 10) + 3 * i1;
- merchantrecipelist
- .add(new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, k), itemstack));
- }
-
- break;
- case 2:
- addEmeraldTrade(merchantrecipelist, Items.ender_eye, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.experience_bottle, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.redstone, this.rand, this.adjustProbability(0.4F));
- addEmeraldTrade(merchantrecipelist, Item.getItemFromBlock(Blocks.glowstone), this.rand,
- this.adjustProbability(0.3F));
- Item[] aitem = new Item[] { Items.iron_sword, Items.diamond_sword, Items.iron_chestplate,
- Items.diamond_chestplate, Items.iron_axe, Items.diamond_axe, Items.iron_pickaxe,
- Items.diamond_pickaxe };
- Item[] aitem1 = aitem;
- int j = aitem.length;
- k = 0;
-
- while (true) {
- if (k >= j) {
- break label50;
- }
-
- Item item = aitem1[k];
-
- if (this.rand.nextFloat() < this.adjustProbability(0.05F)) {
- merchantrecipelist.add(new MerchantRecipe(new ItemStack(item, 1, 0),
- new ItemStack(Items.emerald, 2 + this.rand.nextInt(3), 0),
- EnchantmentHelper.addRandomEnchantment(this.rand, new ItemStack(item, 1, 0),
- 5 + this.rand.nextInt(15))));
- }
-
- ++k;
- }
- case 3:
- addPurchaseRecipe(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F));
- addPurchaseRecipe(merchantrecipelist, Items.iron_ingot, this.rand, this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.gold_ingot, this.rand, this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.diamond, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.iron_sword, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_sword, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.iron_axe, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_axe, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.iron_pickaxe, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_pickaxe, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.iron_shovel, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_shovel, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_hoe, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_hoe, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_boots, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_boots, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_helmet, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_helmet, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_chestplate, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_chestplate, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_leggings, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_leggings, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.chainmail_boots, this.rand, this.adjustProbability(0.1F));
- addEmeraldTrade(merchantrecipelist, Items.chainmail_helmet, this.rand, this.adjustProbability(0.1F));
- addEmeraldTrade(merchantrecipelist, Items.chainmail_chestplate, this.rand, this.adjustProbability(0.1F));
- addEmeraldTrade(merchantrecipelist, Items.chainmail_leggings, this.rand, this.adjustProbability(0.1F));
- break;
- case 4:
- addPurchaseRecipe(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F));
- addPurchaseRecipe(merchantrecipelist, Items.porkchop, this.rand, this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.beef, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.saddle, this.rand, this.adjustProbability(0.1F));
- addEmeraldTrade(merchantrecipelist, Items.leather_chestplate, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.leather_boots, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.leather_helmet, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.leather_leggings, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.cooked_porkchop, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.cooked_beef, this.rand, this.adjustProbability(0.3F));
- }
-
- if (merchantrecipelist.isEmpty()) {
- addPurchaseRecipe(merchantrecipelist, Items.gold_ingot, this.rand, 1.0F);
- }
-
- Collections.shuffle(merchantrecipelist);
-
- if (this.getBuyingList() == null) {
- this.setBuyingList(new MerchantRecipeList());
- }
-
- for (int l = 0; l < p_70950_1_ && l < merchantrecipelist.size(); ++l) {
- try {
- this.getBuyingList().addToListWithCheck((MerchantRecipe) merchantrecipelist.get(l));
- }
- catch (Throwable t) {
- Logger.INFO("Villager with ID "+this.entityUniqueID.toString()+" at | X: "+this.posX+" Y: "+this.posY+" Z: "+this.posZ+" may have corrupt trades, it is advised to remove/kill it.");
- }
- }
-
- try {
- if (this.getBuyingList() != null) {
- for (Object g : this.getBuyingList()) {
- if (g != null) {
- if (g instanceof MerchantRecipe) {
- MerchantRecipe m = (MerchantRecipe) g;
- ItemStack selling = m.getItemToSell();
- ItemStack[] buying = new ItemStack[] {m.getItemToBuy(), m.getSecondItemToBuy() != null ? m.getSecondItemToBuy() : null};
- if (selling == null) {
- Logger.WARNING("Villager is Selling an invalid item");
- }
- else if (buying[0] == null && buying[1] == null) {
- Logger.WARNING("Villager is buying two invalid items");
- }
- else {
- Logger.WARNING("Villager is Selling x"+selling.stackSize+selling.getDisplayName()+" for x"+buying[0].stackSize+" "+buying[0].getDisplayName()+buying[1] != null ? " and for x"+buying[1].stackSize+" "+buying[1].getDisplayName() : "");
- }
- }
- else
- Logger.WARNING("Found: "+g.getClass().getName());
- }
- }
- }
- else {
-
- }
- }
- catch (Throwable t) {
-
- }
-
- }
-
- /**
- * main AI tick function, replaces updateEntityActionState
- */
- @Override
- protected void updateAITick() {
- if (!this.isTrading()) {
- if (this.getNeedsInitilization()) {
- if (this.getBuyingList().size() > 1) {
- Iterator<MerchantRecipe> iterator = this.getBuyingList().iterator();
-
- while (iterator.hasNext()) {
- MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
-
- if (merchantrecipe.isRecipeDisabled()) {
- merchantrecipe.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
- }
- }
- }
-
- this.addDefaultEquipmentAndRecipies(1);
- this.setNeedsInitilization(false);
-
- if (this.getVillageObject() != null && this.getLastBuyingPlayer() != null) {
- this.worldObj.setEntityState(this, (byte) 14);
- this.getVillageObject().setReputationForPlayer(this.getLastBuyingPlayer(), 1);
- }
- }
- }
- super.updateAITick();
- }
-
- public static void addEmeraldTrade(MerchantRecipeList aRecipeList, Item aItem, Random aRand, float aChance) {
- if (aRand.nextFloat() < aChance) {
- int i = getLootAmount_BlacksmithSellingList(aItem, aRand);
- ItemStack itemstack;
- ItemStack itemstack1;
-
- if (i < 0) {
- itemstack = new ItemStack(Items.emerald, 1, 0);
- itemstack1 = new ItemStack(aItem, -i, 0);
- } else {
- itemstack = new ItemStack(Items.emerald, i, 0);
- itemstack1 = new ItemStack(aItem, 1, 0);
- }
-
- aRecipeList.add(new MerchantRecipe(itemstack, itemstack1));
- }
- }
-
- public static void addCustomTrade(MerchantRecipeList aRecipeList, ItemStack aItem1, ItemStack aItem2, ItemStack aItem3, Random aRand, float aChance) {
- if (aRand.nextFloat() < aChance) {
- aRecipeList.add(new MerchantRecipe(aItem1, aItem2, aItem3));
- }
- }
-
- private static int getLootAmount_BlacksmithSellingList(Item aItem, Random aRand) {
- Tuple tuple = (Tuple) blacksmithSellingList.get(aItem);
- return tuple == null ? 1
- : (((Integer) tuple.getFirst()).intValue() >= ((Integer) tuple.getSecond()).intValue()
- ? ((Integer) tuple.getFirst()).intValue()
- : ((Integer) tuple.getFirst()).intValue() + aRand.nextInt(
- ((Integer) tuple.getSecond()).intValue() - ((Integer) tuple.getFirst()).intValue()));
- }
-
- public static void addPurchaseRecipe(MerchantRecipeList aTradeList, Item aItem, Random aRand, float aChance) {
- if (aRand.nextFloat() < aChance) {
- aTradeList.add(new MerchantRecipe(getSimpleLootStack(aItem, aRand), Items.emerald));
- }
- }
-
- private static ItemStack getSimpleLootStack(Item aItem, Random aRand) {
- return new ItemStack(aItem, getLootAmount_VillagerSellingList(aItem, aRand), 0);
- }
-
- public static void addPurchaseRecipe(MerchantRecipeList aTradeList, Item aItem, int aMeta, Random aRand, float aChance) {
- if (aRand.nextFloat() < aChance) {
- aTradeList.add(new MerchantRecipe(getComplexLootStack(aItem, aMeta, aRand), Items.emerald));
- }
- }
-
- private static ItemStack getComplexLootStack(Item aItem, int aMeta, Random aRand) {
- return new ItemStack(aItem, getLootAmount_VillagerSellingList(aItem, aRand), aMeta);
- }
-
- private static int getLootAmount_VillagerSellingList(Item aItem, Random aRand) {
- Tuple tuple = (Tuple) villagersSellingList.get(aItem);
- return tuple == null ? 1
- : (((Integer) tuple.getFirst()).intValue() >= ((Integer) tuple.getSecond()).intValue()
- ? ((Integer) tuple.getFirst()).intValue()
- : ((Integer) tuple.getFirst()).intValue() + aRand.nextInt(
- ((Integer) tuple.getSecond()).intValue() - ((Integer) tuple.getFirst()).intValue()));
- }
-
+ // public static final VillagerProfession mProfession;
+
+ /*
+ *
+ * Your problem is that you are extending EntityVillager, but buyingList and
+ * addDefaultEquipment are both PRIVATE members of EntityVillager - you cannot
+ * use or override them without Reflection or ASM.
+ *
+ * What you can do, however, is override getRecipes to return your own list, but
+ * because you override EntityVillager, your mob is still using the villager's
+ * buyingList (which is NULL) when useRecipe or any other villager method is
+ * called. You either have to override every method from EntityVillager which
+ * interacts with buyingList and make it use your own list, or you need to not
+ * extend EntityVillager and just implement IMerchant instead.
+ */
+
+ private final int mRoleID;
+
+ public EntityBaseVillager(World aWorld) {
+ this(aWorld, 0);
+ }
+
+ public EntityBaseVillager(World aWorld, int aID) {
+ super(aWorld, aID);
+ mRoleID = aID;
+ }
+
+ @Override
+ public void writeEntityToNBT(NBTTagCompound aNBT) {
+ if (this.hasCustomNameTag()) {
+ if (!aNBT.hasKey("aCustomName")) {
+ aNBT.setString("aCustomName", this.getCommandSenderName());
+ }
+ }
+ super.writeEntityToNBT(aNBT);
+ }
+
+ @Override
+ public void readEntityFromNBT(NBTTagCompound aNBT) {
+ if (aNBT.hasKey("aCustomName")) {
+ if (!this.getCustomNameTag().equals(aNBT.getString("aCustomName"))) {
+ this.setCustomNameTag(aNBT.getString("aCustomName"));
+ }
+ }
+ super.readEntityFromNBT(aNBT);
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ // TODO Auto-generated method stub
+ super.writeToNBT(aNBT);
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ // TODO Auto-generated method stub
+ super.readFromNBT(aNBT);
+ }
+
+ @Override
+ protected boolean canDespawn() {
+ return !this.hasCustomNameTag();
+ }
+
+ @Override
+ public void setProfession(int p_70938_1_) {
+ super.setProfession(p_70938_1_);
+ }
+
+ @Override
+ public int getProfession() {
+ int prof = super.getProfession();
+ // Logger.INFO(""+mRoleID);
+ return prof < 7735 ? 7738 : prof;
+ }
+
+ @Override
+ public void useRecipe(MerchantRecipe p_70933_1_) {
+ super.useRecipe(p_70933_1_);
+ }
+
+ @Override
+ public void setRecipes(MerchantRecipeList p_70930_1_) {
+ super.setRecipes(p_70930_1_);
+ }
+
+ public boolean shouldAlwaysSprint() {
+ return false;
+ }
+ ;
+
+ @Override
+ public void onLivingUpdate() {
+
+ // Set Custom Name
+ if (!this.hasCustomNameTag()) {
+ this.setCustomNameTag(NameLists.generateRandomName());
+ }
+
+ super.onLivingUpdate();
+
+ // Make these guys always sprint
+ if (shouldAlwaysSprint()) {
+ if (!this.isSprinting()) {
+ this.setSprinting(true);
+ }
+ } else {
+ if (this.isSprinting()) {
+ this.setSprinting(false);
+ }
+ }
+ }
+
+ @Override
+ public Entity getEntityToAttack() {
+ return super.getEntityToAttack();
+ }
+
+ @Override
+ public boolean getAlwaysRenderNameTag() {
+ return hasCustomNameTag();
+ }
+
+ @Override
+ public Random getRNG() {
+ return CORE.RANDOM;
+ }
+
+ @Override
+ public void setSprinting(boolean bool) {
+ super.setSprinting(bool);
+ }
+
+ /**
+ * Custom Shit
+ */
+ protected float getField_82191_bN() {
+ Field v82191 = ReflectionUtils.getField(getClass(), "field_82191_bN");
+ try {
+ return v82191 != null ? v82191.getFloat(this) : 0f;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return 0f;
+ }
+ }
+
+ protected void setField_82191_bN(float f) {
+ try {
+ ReflectionUtils.setField(this, "field_82191_bN", f);
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ protected boolean getNeedsInitilization() {
+ Field v82191 = ReflectionUtils.getField(EntityVillager.class, "needsInitilization");
+ try {
+ return v82191 != null ? v82191.getBoolean(this) : false;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return false;
+ }
+ }
+
+ protected void setNeedsInitilization(boolean f) {
+ try {
+ ReflectionUtils.setField(this, "needsInitilization", f);
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ protected MerchantRecipeList getBuyingList() {
+ Field v82191;
+ MerchantRecipeList o = null;
+ v82191 = ReflectionUtils.getField(getClass(), "buyingList");
+ try {
+ if (v82191 != null) o = (MerchantRecipeList) v82191.get(this);
+ Logger.WARNING("Is BuyingList Valid? " + (v82191 != null));
+ return v82191 != null ? o : null;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ protected void setBuyingList(MerchantRecipeList f) {
+ try {
+ Logger.WARNING("set BuyingList? " + (ReflectionUtils.setField(this, "buyingList", f)));
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ }
+ }
+
+ protected Village getVillageObject() {
+ Field v82191 = ReflectionUtils.getField(getClass(), "villageObj");
+ try {
+ return v82191 != null ? (Village) v82191.get(this) : null;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return null;
+ }
+ }
+
+ protected String getLastBuyingPlayer() {
+ Field v82191 = ReflectionUtils.getField(getClass(), "lastBuyingPlayer");
+ try {
+ return v82191 != null ? (String) v82191.get(this) : "";
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return "";
+ }
+ }
+
+ public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) {
+ if (getBuyingList() == null) {
+ this.addDefaultEquipmentAndRecipies(1);
+ }
+ return getBuyingList();
+ }
+
+ /**
+ * Adjusts the probability of obtaining a given recipe being offered by a
+ * villager
+ */
+ private float adjustProbability(float p_82188_1_) {
+ float f1 = p_82188_1_ + getField_82191_bN();
+ return f1 > 0.9F ? 0.9F - (f1 - 0.9F) : f1;
+ }
+
+ /**
+ * based on the villagers profession add items, equipment, and recipies adds
+ * par1 random items to the list of things that the villager wants to buy. (at
+ * most 1 of each wanted type is added)
+ */
+ private void addDefaultEquipmentAndRecipies(int p_70950_1_) {
+ if (this.getBuyingList() != null) {
+ setField_82191_bN(MathHelper.sqrt_float((float) this.getBuyingList().size()) * 0.2F);
+ } else {
+ setField_82191_bN(0.0F);
+ }
+
+ MerchantRecipeList merchantrecipelist;
+ merchantrecipelist = new MerchantRecipeList();
+ VillagerRegistry.manageVillagerTrades(merchantrecipelist, this, this.getProfession(), this.rand);
+ int k;
+ label50:
+ switch (this.getProfession()) {
+ case 0:
+ addPurchaseRecipe(merchantrecipelist, Items.wheat, this.rand, this.adjustProbability(0.9F));
+ addPurchaseRecipe(
+ merchantrecipelist,
+ Item.getItemFromBlock(Blocks.wool),
+ this.rand,
+ this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.chicken, this.rand, this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.cooked_fished, this.rand, this.adjustProbability(0.4F));
+ addEmeraldTrade(merchantrecipelist, Items.bread, this.rand, this.adjustProbability(0.9F));
+ addEmeraldTrade(merchantrecipelist, Items.melon, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.apple, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.cookie, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.shears, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.flint_and_steel, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.cooked_chicken, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.arrow, this.rand, this.adjustProbability(0.5F));
+
+ if (this.rand.nextFloat() < this.adjustProbability(0.5F)) {
+ merchantrecipelist.add(new MerchantRecipe(
+ new ItemStack(Blocks.gravel, 10),
+ new ItemStack(Items.emerald),
+ new ItemStack(Items.flint, 4 + this.rand.nextInt(2), 0)));
+ }
+
+ break;
+ case 1:
+ addPurchaseRecipe(merchantrecipelist, Items.paper, this.rand, this.adjustProbability(0.8F));
+ addPurchaseRecipe(merchantrecipelist, Items.book, this.rand, this.adjustProbability(0.8F));
+ addPurchaseRecipe(merchantrecipelist, Items.written_book, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(
+ merchantrecipelist,
+ Item.getItemFromBlock(Blocks.bookshelf),
+ this.rand,
+ this.adjustProbability(0.8F));
+ addEmeraldTrade(
+ merchantrecipelist,
+ Item.getItemFromBlock(Blocks.glass),
+ this.rand,
+ this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.compass, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.clock, this.rand, this.adjustProbability(0.2F));
+
+ if (this.rand.nextFloat() < this.adjustProbability(0.07F)) {
+ Enchantment enchantment = Enchantment.enchantmentsBookList[
+ this.rand.nextInt(Enchantment.enchantmentsBookList.length)];
+ int i1 = MathHelper.getRandomIntegerInRange(
+ this.rand, enchantment.getMinLevel(), enchantment.getMaxLevel());
+ ItemStack itemstack =
+ Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, i1));
+ k = 2 + this.rand.nextInt(5 + i1 * 10) + 3 * i1;
+ merchantrecipelist.add(
+ new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, k), itemstack));
+ }
+
+ break;
+ case 2:
+ addEmeraldTrade(merchantrecipelist, Items.ender_eye, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.experience_bottle, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.redstone, this.rand, this.adjustProbability(0.4F));
+ addEmeraldTrade(
+ merchantrecipelist,
+ Item.getItemFromBlock(Blocks.glowstone),
+ this.rand,
+ this.adjustProbability(0.3F));
+ Item[] aitem = new Item[] {
+ Items.iron_sword,
+ Items.diamond_sword,
+ Items.iron_chestplate,
+ Items.diamond_chestplate,
+ Items.iron_axe,
+ Items.diamond_axe,
+ Items.iron_pickaxe,
+ Items.diamond_pickaxe
+ };
+ Item[] aitem1 = aitem;
+ int j = aitem.length;
+ k = 0;
+
+ while (true) {
+ if (k >= j) {
+ break label50;
+ }
+
+ Item item = aitem1[k];
+
+ if (this.rand.nextFloat() < this.adjustProbability(0.05F)) {
+ merchantrecipelist.add(new MerchantRecipe(
+ new ItemStack(item, 1, 0),
+ new ItemStack(Items.emerald, 2 + this.rand.nextInt(3), 0),
+ EnchantmentHelper.addRandomEnchantment(
+ this.rand, new ItemStack(item, 1, 0), 5 + this.rand.nextInt(15))));
+ }
+
+ ++k;
+ }
+ case 3:
+ addPurchaseRecipe(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F));
+ addPurchaseRecipe(merchantrecipelist, Items.iron_ingot, this.rand, this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.gold_ingot, this.rand, this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.diamond, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_sword, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_sword, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_axe, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_axe, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_pickaxe, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_pickaxe, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_shovel, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_shovel, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_hoe, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_hoe, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_boots, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_boots, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_helmet, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_helmet, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_chestplate, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_chestplate, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_leggings, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_leggings, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.chainmail_boots, this.rand, this.adjustProbability(0.1F));
+ addEmeraldTrade(merchantrecipelist, Items.chainmail_helmet, this.rand, this.adjustProbability(0.1F));
+ addEmeraldTrade(
+ merchantrecipelist, Items.chainmail_chestplate, this.rand, this.adjustProbability(0.1F));
+ addEmeraldTrade(merchantrecipelist, Items.chainmail_leggings, this.rand, this.adjustProbability(0.1F));
+ break;
+ case 4:
+ addPurchaseRecipe(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F));
+ addPurchaseRecipe(merchantrecipelist, Items.porkchop, this.rand, this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.beef, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.saddle, this.rand, this.adjustProbability(0.1F));
+ addEmeraldTrade(merchantrecipelist, Items.leather_chestplate, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.leather_boots, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.leather_helmet, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.leather_leggings, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.cooked_porkchop, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.cooked_beef, this.rand, this.adjustProbability(0.3F));
+ }
+
+ if (merchantrecipelist.isEmpty()) {
+ addPurchaseRecipe(merchantrecipelist, Items.gold_ingot, this.rand, 1.0F);
+ }
+
+ Collections.shuffle(merchantrecipelist);
+
+ if (this.getBuyingList() == null) {
+ this.setBuyingList(new MerchantRecipeList());
+ }
+
+ for (int l = 0; l < p_70950_1_ && l < merchantrecipelist.size(); ++l) {
+ try {
+ this.getBuyingList().addToListWithCheck((MerchantRecipe) merchantrecipelist.get(l));
+ } catch (Throwable t) {
+ Logger.INFO("Villager with ID " + this.entityUniqueID.toString() + " at | X: " + this.posX + " Y: "
+ + this.posY + " Z: " + this.posZ
+ + " may have corrupt trades, it is advised to remove/kill it.");
+ }
+ }
+
+ try {
+ if (this.getBuyingList() != null) {
+ for (Object g : this.getBuyingList()) {
+ if (g != null) {
+ if (g instanceof MerchantRecipe) {
+ MerchantRecipe m = (MerchantRecipe) g;
+ ItemStack selling = m.getItemToSell();
+ ItemStack[] buying = new ItemStack[] {
+ m.getItemToBuy(), m.getSecondItemToBuy() != null ? m.getSecondItemToBuy() : null
+ };
+ if (selling == null) {
+ Logger.WARNING("Villager is Selling an invalid item");
+ } else if (buying[0] == null && buying[1] == null) {
+ Logger.WARNING("Villager is buying two invalid items");
+ } else {
+ Logger.WARNING(
+ "Villager is Selling x" + selling.stackSize + selling.getDisplayName()
+ + " for x" + buying[0].stackSize + " "
+ + buying[0].getDisplayName() + buying[1]
+ != null
+ ? " and for x" + buying[1].stackSize + " " + buying[1].getDisplayName()
+ : "");
+ }
+ } else Logger.WARNING("Found: " + g.getClass().getName());
+ }
+ }
+ } else {
+
+ }
+ } catch (Throwable t) {
+
+ }
+ }
+
+ /**
+ * main AI tick function, replaces updateEntityActionState
+ */
+ @Override
+ protected void updateAITick() {
+ if (!this.isTrading()) {
+ if (this.getNeedsInitilization()) {
+ if (this.getBuyingList().size() > 1) {
+ Iterator<MerchantRecipe> iterator = this.getBuyingList().iterator();
+
+ while (iterator.hasNext()) {
+ MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
+
+ if (merchantrecipe.isRecipeDisabled()) {
+ merchantrecipe.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
+ }
+ }
+ }
+
+ this.addDefaultEquipmentAndRecipies(1);
+ this.setNeedsInitilization(false);
+
+ if (this.getVillageObject() != null && this.getLastBuyingPlayer() != null) {
+ this.worldObj.setEntityState(this, (byte) 14);
+ this.getVillageObject().setReputationForPlayer(this.getLastBuyingPlayer(), 1);
+ }
+ }
+ }
+ super.updateAITick();
+ }
+
+ public static void addEmeraldTrade(MerchantRecipeList aRecipeList, Item aItem, Random aRand, float aChance) {
+ if (aRand.nextFloat() < aChance) {
+ int i = getLootAmount_BlacksmithSellingList(aItem, aRand);
+ ItemStack itemstack;
+ ItemStack itemstack1;
+
+ if (i < 0) {
+ itemstack = new ItemStack(Items.emerald, 1, 0);
+ itemstack1 = new ItemStack(aItem, -i, 0);
+ } else {
+ itemstack = new ItemStack(Items.emerald, i, 0);
+ itemstack1 = new ItemStack(aItem, 1, 0);
+ }
+
+ aRecipeList.add(new MerchantRecipe(itemstack, itemstack1));
+ }
+ }
+
+ public static void addCustomTrade(
+ MerchantRecipeList aRecipeList,
+ ItemStack aItem1,
+ ItemStack aItem2,
+ ItemStack aItem3,
+ Random aRand,
+ float aChance) {
+ if (aRand.nextFloat() < aChance) {
+ aRecipeList.add(new MerchantRecipe(aItem1, aItem2, aItem3));
+ }
+ }
+
+ private static int getLootAmount_BlacksmithSellingList(Item aItem, Random aRand) {
+ Tuple tuple = (Tuple) blacksmithSellingList.get(aItem);
+ return tuple == null
+ ? 1
+ : (((Integer) tuple.getFirst()).intValue() >= ((Integer) tuple.getSecond()).intValue()
+ ? ((Integer) tuple.getFirst()).intValue()
+ : ((Integer) tuple.getFirst()).intValue()
+ + aRand.nextInt(((Integer) tuple.getSecond()).intValue()
+ - ((Integer) tuple.getFirst()).intValue()));
+ }
+
+ public static void addPurchaseRecipe(MerchantRecipeList aTradeList, Item aItem, Random aRand, float aChance) {
+ if (aRand.nextFloat() < aChance) {
+ aTradeList.add(new MerchantRecipe(getSimpleLootStack(aItem, aRand), Items.emerald));
+ }
+ }
+
+ private static ItemStack getSimpleLootStack(Item aItem, Random aRand) {
+ return new ItemStack(aItem, getLootAmount_VillagerSellingList(aItem, aRand), 0);
+ }
+
+ public static void addPurchaseRecipe(
+ MerchantRecipeList aTradeList, Item aItem, int aMeta, Random aRand, float aChance) {
+ if (aRand.nextFloat() < aChance) {
+ aTradeList.add(new MerchantRecipe(getComplexLootStack(aItem, aMeta, aRand), Items.emerald));
+ }
+ }
+
+ private static ItemStack getComplexLootStack(Item aItem, int aMeta, Random aRand) {
+ return new ItemStack(aItem, getLootAmount_VillagerSellingList(aItem, aRand), aMeta);
+ }
+
+ private static int getLootAmount_VillagerSellingList(Item aItem, Random aRand) {
+ Tuple tuple = (Tuple) villagersSellingList.get(aItem);
+ return tuple == null
+ ? 1
+ : (((Integer) tuple.getFirst()).intValue() >= ((Integer) tuple.getSecond()).intValue()
+ ? ((Integer) tuple.getFirst()).intValue()
+ : ((Integer) tuple.getFirst()).intValue()
+ + aRand.nextInt(((Integer) tuple.getSecond()).intValue()
+ - ((Integer) tuple.getFirst()).intValue()));
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java b/src/main/java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java
index 4f9e2954a4..000d98af0d 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java
@@ -1,15 +1,13 @@
package gtPlusPlus.plugin.villagers.entity;
-import java.lang.reflect.Field;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.VillagerRegistry;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import gtPlusPlus.plugin.villagers.NameLists;
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Random;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -32,494 +30,528 @@ import net.minecraft.world.World;
public class EntityNativeAustralian extends EntityVillager {
- // public static final VillagerProfession mProfession;
-
- /*
- *
- * Your problem is that you are extending EntityVillager, but buyingList and
- * addDefaultEquipment are both PRIVATE members of EntityVillager - you cannot
- * use or override them without Reflection or ASM.
- *
- * What you can do, however, is override getRecipes to return your own list, but
- * because you override EntityVillager, your mob is still using the villager's
- * buyingList (which is NULL) when useRecipe or any other villager method is
- * called. You either have to override every method from EntityVillager which
- * interacts with buyingList and make it use your own list, or you need to not
- * extend EntityVillager and just implement IMerchant instead.
- */
-
- private final int mRoleID;
-
- public EntityNativeAustralian(World aWorld) {
- super(aWorld, 7738);
- mRoleID = 7738;
- }
-
- public EntityVillager createChild(EntityAgeable p_90011_1_){
- EntityNativeAustralian entityvillager = new EntityNativeAustralian(this.worldObj);
- entityvillager.onSpawnWithEgg((IEntityLivingData)null);
- return entityvillager;
- }
-
- public boolean allowLeashing()
- {
- return true;
- }
-
- @Override
- public void writeEntityToNBT(NBTTagCompound aNBT) {
- if (this.hasCustomNameTag()) {
- if (!aNBT.hasKey("aCustomName")) {
- aNBT.setString("aCustomName", this.getCommandSenderName());
- }
- }
- super.writeEntityToNBT(aNBT);
- }
-
- @Override
- public void readEntityFromNBT(NBTTagCompound aNBT) {
- if (aNBT.hasKey("aCustomName")) {
- if (!this.getCustomNameTag().equals(aNBT.getString("aCustomName"))) {
- this.setCustomNameTag(aNBT.getString("aCustomName"));
- }
- }
- super.readEntityFromNBT(aNBT);
- }
-
- @Override
- public void writeToNBT(NBTTagCompound aNBT) {
- // TODO Auto-generated method stub
- super.writeToNBT(aNBT);
- }
-
- @Override
- public void readFromNBT(NBTTagCompound aNBT) {
- // TODO Auto-generated method stub
- super.readFromNBT(aNBT);
- }
-
- @Override
- protected boolean canDespawn() {
- return !false;
- }
-
- @Override
- public void setProfession(int p_70938_1_) {
- super.setProfession(7738);
- }
-
- @Override
- public int getProfession() {
- return mRoleID;
- }
-
- @Override
- public void useRecipe(MerchantRecipe p_70933_1_) {
- super.useRecipe(p_70933_1_);
- }
-
- @Override
- public void setRecipes(MerchantRecipeList p_70930_1_) {
- super.setRecipes(p_70930_1_);
- }
-
- public boolean shouldAlwaysSprint() {
- return false;
- };
-
- @Override
- public void onLivingUpdate() {
- super.onLivingUpdate();
- }
-
- @Override
- public Entity getEntityToAttack() {
- return super.getEntityToAttack();
- }
-
- @Override
- public boolean getAlwaysRenderNameTag() {
- return hasCustomNameTag();
- }
-
- @Override
- public Random getRNG() {
- return CORE.RANDOM;
- }
-
- @Override
- public void setSprinting(boolean bool) {
- super.setSprinting(bool);
- }
-
- /**
- * Custom Shit
- */
-
- protected float getField_82191_bN() {
- Field v82191 = ReflectionUtils.getField(getClass(), "field_82191_bN");
- try {
- return v82191 != null ? v82191.getFloat(this) : 0f;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return 0f;
- }
- }
-
- protected void setField_82191_bN(float f) {
- try {
- ReflectionUtils.setField(this, "field_82191_bN", f);
- } catch (IllegalArgumentException e) {
- }
- }
-
- protected boolean getNeedsInitilization() {
- Field v82191 = ReflectionUtils.getField(EntityVillager.class, "needsInitilization");
- try {
- return v82191 != null ? v82191.getBoolean(this) : false;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return false;
- }
- }
-
- protected void setNeedsInitilization(boolean f) {
- try {
- ReflectionUtils.setField(this, "needsInitilization", f);
- } catch (IllegalArgumentException e) {
- }
- }
-
- protected MerchantRecipeList getBuyingList() {
- Field v82191;
- MerchantRecipeList o = null;
- v82191 = ReflectionUtils.getField(getClass(), "buyingList");
- try {
- if (v82191 != null)
- o = (MerchantRecipeList) v82191.get(this);
- Logger.WARNING("Is BuyingList Valid? " + (v82191 != null));
- return v82191 != null ? o : null;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- e.printStackTrace();
- return null;
- }
- }
-
- protected void setBuyingList(MerchantRecipeList f) {
- try {
- Logger.WARNING("set BuyingList? "+(ReflectionUtils.setField(this, "buyingList", f)));
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- }
- }
-
- protected Village getVillageObject() {
- Field v82191 = ReflectionUtils.getField(getClass(), "villageObj");
- try {
- return v82191 != null ? (Village) v82191.get(this) : null;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return null;
- }
- }
-
- protected String getLastBuyingPlayer() {
- Field v82191 = ReflectionUtils.getField(getClass(), "lastBuyingPlayer");
- try {
- return v82191 != null ? (String) v82191.get(this) : "";
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return "";
- }
- }
-
- public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) {
- if (getBuyingList() == null) {
- this.addDefaultEquipmentAndRecipies(1);
- }
- return getBuyingList();
- }
-
- /**
- * Adjusts the probability of obtaining a given recipe being offered by a
- * villager
- */
- private float adjustProbability(float p_82188_1_) {
- float f1 = p_82188_1_ + getField_82191_bN();
- return f1 > 0.9F ? 0.9F - (f1 - 0.9F) : f1;
- }
-
- /**
- * based on the villagers profession add items, equipment, and recipies adds
- * par1 random items to the list of things that the villager wants to buy. (at
- * most 1 of each wanted type is added)
- */
- private void addDefaultEquipmentAndRecipies(int p_70950_1_) {
- if (this.getBuyingList() != null) {
- setField_82191_bN(MathHelper.sqrt_float((float) this.getBuyingList().size()) * 0.2F);
- } else {
- setField_82191_bN(0.0F);
- }
-
- MerchantRecipeList merchantrecipelist;
- merchantrecipelist = new MerchantRecipeList();
- VillagerRegistry.manageVillagerTrades(merchantrecipelist, this, this.getProfession(), this.rand);
- int k;
- label50:
-
- switch (this.getProfession()) {
- case 0:
- addPurchaseRecipe(merchantrecipelist, Items.wheat, this.rand, this.adjustProbability(0.9F));
- addPurchaseRecipe(merchantrecipelist, Item.getItemFromBlock(Blocks.wool), this.rand,
- this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.chicken, this.rand, this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.cooked_fished, this.rand, this.adjustProbability(0.4F));
- addEmeraldTrade(merchantrecipelist, Items.bread, this.rand, this.adjustProbability(0.9F));
- addEmeraldTrade(merchantrecipelist, Items.melon, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.apple, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.cookie, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.shears, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.flint_and_steel, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.cooked_chicken, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.arrow, this.rand, this.adjustProbability(0.5F));
-
- if (this.rand.nextFloat() < this.adjustProbability(0.5F)) {
- merchantrecipelist.add(new MerchantRecipe(new ItemStack(Blocks.gravel, 10),
- new ItemStack(Items.emerald), new ItemStack(Items.flint, 4 + this.rand.nextInt(2), 0)));
- }
-
- break;
- case 1:
- addPurchaseRecipe(merchantrecipelist, Items.paper, this.rand, this.adjustProbability(0.8F));
- addPurchaseRecipe(merchantrecipelist, Items.book, this.rand, this.adjustProbability(0.8F));
- addPurchaseRecipe(merchantrecipelist, Items.written_book, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Item.getItemFromBlock(Blocks.bookshelf), this.rand,
- this.adjustProbability(0.8F));
- addEmeraldTrade(merchantrecipelist, Item.getItemFromBlock(Blocks.glass), this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.compass, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.clock, this.rand, this.adjustProbability(0.2F));
-
- if (this.rand.nextFloat() < this.adjustProbability(0.07F)) {
- Enchantment enchantment = Enchantment.enchantmentsBookList[this.rand
- .nextInt(Enchantment.enchantmentsBookList.length)];
- int i1 = MathHelper.getRandomIntegerInRange(this.rand, enchantment.getMinLevel(),
- enchantment.getMaxLevel());
- ItemStack itemstack = Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, i1));
- k = 2 + this.rand.nextInt(5 + i1 * 10) + 3 * i1;
- merchantrecipelist
- .add(new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, k), itemstack));
- }
-
- break;
- case 2:
- addEmeraldTrade(merchantrecipelist, Items.ender_eye, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.experience_bottle, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.redstone, this.rand, this.adjustProbability(0.4F));
- addEmeraldTrade(merchantrecipelist, Item.getItemFromBlock(Blocks.glowstone), this.rand,
- this.adjustProbability(0.3F));
- Item[] aitem = new Item[] { Items.iron_sword, Items.diamond_sword, Items.iron_chestplate,
- Items.diamond_chestplate, Items.iron_axe, Items.diamond_axe, Items.iron_pickaxe,
- Items.diamond_pickaxe };
- Item[] aitem1 = aitem;
- int j = aitem.length;
- k = 0;
-
- while (true) {
- if (k >= j) {
- break label50;
- }
-
- Item item = aitem1[k];
-
- if (this.rand.nextFloat() < this.adjustProbability(0.05F)) {
- merchantrecipelist.add(new MerchantRecipe(new ItemStack(item, 1, 0),
- new ItemStack(Items.emerald, 2 + this.rand.nextInt(3), 0),
- EnchantmentHelper.addRandomEnchantment(this.rand, new ItemStack(item, 1, 0),
- 5 + this.rand.nextInt(15))));
- }
-
- ++k;
- }
- case 3:
- addPurchaseRecipe(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F));
- addPurchaseRecipe(merchantrecipelist, Items.iron_ingot, this.rand, this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.gold_ingot, this.rand, this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.diamond, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.iron_sword, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_sword, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.iron_axe, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_axe, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.iron_pickaxe, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_pickaxe, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.iron_shovel, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_shovel, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_hoe, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_hoe, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_boots, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_boots, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_helmet, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_helmet, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_chestplate, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_chestplate, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.iron_leggings, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.diamond_leggings, this.rand, this.adjustProbability(0.2F));
- addEmeraldTrade(merchantrecipelist, Items.chainmail_boots, this.rand, this.adjustProbability(0.1F));
- addEmeraldTrade(merchantrecipelist, Items.chainmail_helmet, this.rand, this.adjustProbability(0.1F));
- addEmeraldTrade(merchantrecipelist, Items.chainmail_chestplate, this.rand, this.adjustProbability(0.1F));
- addEmeraldTrade(merchantrecipelist, Items.chainmail_leggings, this.rand, this.adjustProbability(0.1F));
- break;
- case 4:
- addPurchaseRecipe(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F));
- addPurchaseRecipe(merchantrecipelist, Items.porkchop, this.rand, this.adjustProbability(0.5F));
- addPurchaseRecipe(merchantrecipelist, Items.beef, this.rand, this.adjustProbability(0.5F));
- addEmeraldTrade(merchantrecipelist, Items.saddle, this.rand, this.adjustProbability(0.1F));
- addEmeraldTrade(merchantrecipelist, Items.leather_chestplate, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.leather_boots, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.leather_helmet, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.leather_leggings, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.cooked_porkchop, this.rand, this.adjustProbability(0.3F));
- addEmeraldTrade(merchantrecipelist, Items.cooked_beef, this.rand, this.adjustProbability(0.3F));
- }
-
- if (merchantrecipelist.isEmpty()) {
- addPurchaseRecipe(merchantrecipelist, Items.gold_ingot, this.rand, 1.0F);
- }
-
- Collections.shuffle(merchantrecipelist);
-
- if (this.getBuyingList() == null) {
- this.setBuyingList(new MerchantRecipeList());
- }
-
- for (int l = 0; l < p_70950_1_ && l < merchantrecipelist.size(); ++l) {
- try {
- this.getBuyingList().addToListWithCheck((MerchantRecipe) merchantrecipelist.get(l));
- }
- catch (Throwable t) {
- Logger.INFO("Villager with ID "+this.entityUniqueID.toString()+" at | X: "+this.posX+" Y: "+this.posY+" Z: "+this.posZ+" may have corrupt trades, it is advised to remove/kill it.");
- }
- }
-
- try {
- if (this.getBuyingList() != null) {
- for (Object g : this.getBuyingList()) {
- if (g != null) {
- if (g instanceof MerchantRecipe) {
- MerchantRecipe m = (MerchantRecipe) g;
- ItemStack selling = m.getItemToSell();
- ItemStack[] buying = new ItemStack[] {m.getItemToBuy(), m.getSecondItemToBuy() != null ? m.getSecondItemToBuy() : null};
- if (selling == null) {
- Logger.WARNING("Villager is Selling an invalid item");
- }
- else if (buying[0] == null && buying[1] == null) {
- Logger.WARNING("Villager is buying two invalid items");
- }
- else {
- Logger.WARNING("Villager is Selling x"+selling.stackSize+selling.getDisplayName()+" for x"+buying[0].stackSize+" "+buying[0].getDisplayName()+buying[1] != null ? " and for x"+buying[1].stackSize+" "+buying[1].getDisplayName() : "");
- }
- }
- else
- Logger.WARNING("Found: "+g.getClass().getName());
- }
- }
- }
- else {
-
- }
- }
- catch (Throwable t) {
-
- }
-
- }
-
- /**
- * main AI tick function, replaces updateEntityActionState
- */
- @Override
- protected void updateAITick() {
- if (!this.isTrading()) {
- if (this.getNeedsInitilization()) {
- if (this.getBuyingList().size() > 1) {
- Iterator<MerchantRecipe> iterator = this.getBuyingList().iterator();
-
- while (iterator.hasNext()) {
- MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
-
- if (merchantrecipe.isRecipeDisabled()) {
- merchantrecipe.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
- }
- }
- }
-
- this.addDefaultEquipmentAndRecipies(1);
- this.setNeedsInitilization(false);
-
- if (this.getVillageObject() != null && this.getLastBuyingPlayer() != null) {
- this.worldObj.setEntityState(this, (byte) 14);
- this.getVillageObject().setReputationForPlayer(this.getLastBuyingPlayer(), 1);
- }
- }
- }
- super.updateAITick();
- }
-
- public static void addEmeraldTrade(MerchantRecipeList aRecipeList, Item aItem, Random aRand, float aChance) {
- if (aRand.nextFloat() < aChance) {
- int i = getLootAmount_BlacksmithSellingList(aItem, aRand);
- ItemStack itemstack;
- ItemStack itemstack1;
-
- if (i < 0) {
- itemstack = new ItemStack(Items.emerald, 1, 0);
- itemstack1 = new ItemStack(aItem, -i, 0);
- } else {
- itemstack = new ItemStack(Items.emerald, i, 0);
- itemstack1 = new ItemStack(aItem, 1, 0);
- }
-
- aRecipeList.add(new MerchantRecipe(itemstack, itemstack1));
- }
- }
-
- public static void addCustomTrade(MerchantRecipeList aRecipeList, ItemStack aItem1, ItemStack aItem2, ItemStack aItem3, Random aRand, float aChance) {
- if (aRand.nextFloat() < aChance) {
- aRecipeList.add(new MerchantRecipe(aItem1, aItem2, aItem3));
- }
- }
-
- private static int getLootAmount_BlacksmithSellingList(Item aItem, Random aRand) {
- Tuple tuple = (Tuple) blacksmithSellingList.get(aItem);
- return tuple == null ? 1
- : (((Integer) tuple.getFirst()).intValue() >= ((Integer) tuple.getSecond()).intValue()
- ? ((Integer) tuple.getFirst()).intValue()
- : ((Integer) tuple.getFirst()).intValue() + aRand.nextInt(
- ((Integer) tuple.getSecond()).intValue() - ((Integer) tuple.getFirst()).intValue()));
- }
-
- public static void addPurchaseRecipe(MerchantRecipeList aTradeList, Item aItem, Random aRand, float aChance) {
- if (aRand.nextFloat() < aChance) {
- aTradeList.add(new MerchantRecipe(getSimpleLootStack(aItem, aRand), Items.emerald));
- }
- }
-
- private static ItemStack getSimpleLootStack(Item aItem, Random aRand) {
- return new ItemStack(aItem, getLootAmount_VillagerSellingList(aItem, aRand), 0);
- }
-
- public static void addPurchaseRecipe(MerchantRecipeList aTradeList, Item aItem, int aMeta, Random aRand, float aChance) {
- if (aRand.nextFloat() < aChance) {
- aTradeList.add(new MerchantRecipe(getComplexLootStack(aItem, aMeta, aRand), Items.emerald));
- }
- }
-
- private static ItemStack getComplexLootStack(Item aItem, int aMeta, Random aRand) {
- return new ItemStack(aItem, getLootAmount_VillagerSellingList(aItem, aRand), aMeta);
- }
-
- private static int getLootAmount_VillagerSellingList(Item aItem, Random aRand) {
- Tuple tuple = (Tuple) villagersSellingList.get(aItem);
- return tuple == null ? 1
- : (((Integer) tuple.getFirst()).intValue() >= ((Integer) tuple.getSecond()).intValue()
- ? ((Integer) tuple.getFirst()).intValue()
- : ((Integer) tuple.getFirst()).intValue() + aRand.nextInt(
- ((Integer) tuple.getSecond()).intValue() - ((Integer) tuple.getFirst()).intValue()));
- }
-
+ // public static final VillagerProfession mProfession;
+
+ /*
+ *
+ * Your problem is that you are extending EntityVillager, but buyingList and
+ * addDefaultEquipment are both PRIVATE members of EntityVillager - you cannot
+ * use or override them without Reflection or ASM.
+ *
+ * What you can do, however, is override getRecipes to return your own list, but
+ * because you override EntityVillager, your mob is still using the villager's
+ * buyingList (which is NULL) when useRecipe or any other villager method is
+ * called. You either have to override every method from EntityVillager which
+ * interacts with buyingList and make it use your own list, or you need to not
+ * extend EntityVillager and just implement IMerchant instead.
+ */
+
+ private final int mRoleID;
+
+ public EntityNativeAustralian(World aWorld) {
+ super(aWorld, 7738);
+ mRoleID = 7738;
+ }
+
+ public EntityVillager createChild(EntityAgeable p_90011_1_) {
+ EntityNativeAustralian entityvillager = new EntityNativeAustralian(this.worldObj);
+ entityvillager.onSpawnWithEgg((IEntityLivingData) null);
+ return entityvillager;
+ }
+
+ public boolean allowLeashing() {
+ return true;
+ }
+
+ @Override
+ public void writeEntityToNBT(NBTTagCompound aNBT) {
+ if (this.hasCustomNameTag()) {
+ if (!aNBT.hasKey("aCustomName")) {
+ aNBT.setString("aCustomName", this.getCommandSenderName());
+ }
+ }
+ super.writeEntityToNBT(aNBT);
+ }
+
+ @Override
+ public void readEntityFromNBT(NBTTagCompound aNBT) {
+ if (aNBT.hasKey("aCustomName")) {
+ if (!this.getCustomNameTag().equals(aNBT.getString("aCustomName"))) {
+ this.setCustomNameTag(aNBT.getString("aCustomName"));
+ }
+ }
+ super.readEntityFromNBT(aNBT);
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ // TODO Auto-generated method stub
+ super.writeToNBT(aNBT);
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ // TODO Auto-generated method stub
+ super.readFromNBT(aNBT);
+ }
+
+ @Override
+ protected boolean canDespawn() {
+ return !false;
+ }
+
+ @Override
+ public void setProfession(int p_70938_1_) {
+ super.setProfession(7738);
+ }
+
+ @Override
+ public int getProfession() {
+ return mRoleID;
+ }
+
+ @Override
+ public void useRecipe(MerchantRecipe p_70933_1_) {
+ super.useRecipe(p_70933_1_);
+ }
+
+ @Override
+ public void setRecipes(MerchantRecipeList p_70930_1_) {
+ super.setRecipes(p_70930_1_);
+ }
+
+ public boolean shouldAlwaysSprint() {
+ return false;
+ }
+ ;
+
+ @Override
+ public void onLivingUpdate() {
+ super.onLivingUpdate();
+ }
+
+ @Override
+ public Entity getEntityToAttack() {
+ return super.getEntityToAttack();
+ }
+
+ @Override
+ public boolean getAlwaysRenderNameTag() {
+ return hasCustomNameTag();
+ }
+
+ @Override
+ public Random getRNG() {
+ return CORE.RANDOM;
+ }
+
+ @Override
+ public void setSprinting(boolean bool) {
+ super.setSprinting(bool);
+ }
+
+ /**
+ * Custom Shit
+ */
+ protected float getField_82191_bN() {
+ Field v82191 = ReflectionUtils.getField(getClass(), "field_82191_bN");
+ try {
+ return v82191 != null ? v82191.getFloat(this) : 0f;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return 0f;
+ }
+ }
+
+ protected void setField_82191_bN(float f) {
+ try {
+ ReflectionUtils.setField(this, "field_82191_bN", f);
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ protected boolean getNeedsInitilization() {
+ Field v82191 = ReflectionUtils.getField(EntityVillager.class, "needsInitilization");
+ try {
+ return v82191 != null ? v82191.getBoolean(this) : false;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return false;
+ }
+ }
+
+ protected void setNeedsInitilization(boolean f) {
+ try {
+ ReflectionUtils.setField(this, "needsInitilization", f);
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ protected MerchantRecipeList getBuyingList() {
+ Field v82191;
+ MerchantRecipeList o = null;
+ v82191 = ReflectionUtils.getField(getClass(), "buyingList");
+ try {
+ if (v82191 != null) o = (MerchantRecipeList) v82191.get(this);
+ Logger.WARNING("Is BuyingList Valid? " + (v82191 != null));
+ return v82191 != null ? o : null;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ protected void setBuyingList(MerchantRecipeList f) {
+ try {
+ Logger.WARNING("set BuyingList? " + (ReflectionUtils.setField(this, "buyingList", f)));
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ }
+ }
+
+ protected Village getVillageObject() {
+ Field v82191 = ReflectionUtils.getField(getClass(), "villageObj");
+ try {
+ return v82191 != null ? (Village) v82191.get(this) : null;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return null;
+ }
+ }
+
+ protected String getLastBuyingPlayer() {
+ Field v82191 = ReflectionUtils.getField(getClass(), "lastBuyingPlayer");
+ try {
+ return v82191 != null ? (String) v82191.get(this) : "";
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return "";
+ }
+ }
+
+ public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) {
+ if (getBuyingList() == null) {
+ this.addDefaultEquipmentAndRecipies(1);
+ }
+ return getBuyingList();
+ }
+
+ /**
+ * Adjusts the probability of obtaining a given recipe being offered by a
+ * villager
+ */
+ private float adjustProbability(float p_82188_1_) {
+ float f1 = p_82188_1_ + getField_82191_bN();
+ return f1 > 0.9F ? 0.9F - (f1 - 0.9F) : f1;
+ }
+
+ /**
+ * based on the villagers profession add items, equipment, and recipies adds
+ * par1 random items to the list of things that the villager wants to buy. (at
+ * most 1 of each wanted type is added)
+ */
+ private void addDefaultEquipmentAndRecipies(int p_70950_1_) {
+ if (this.getBuyingList() != null) {
+ setField_82191_bN(MathHelper.sqrt_float((float) this.getBuyingList().size()) * 0.2F);
+ } else {
+ setField_82191_bN(0.0F);
+ }
+
+ MerchantRecipeList merchantrecipelist;
+ merchantrecipelist = new MerchantRecipeList();
+ VillagerRegistry.manageVillagerTrades(merchantrecipelist, this, this.getProfession(), this.rand);
+ int k;
+ label50:
+ switch (this.getProfession()) {
+ case 0:
+ addPurchaseRecipe(merchantrecipelist, Items.wheat, this.rand, this.adjustProbability(0.9F));
+ addPurchaseRecipe(
+ merchantrecipelist,
+ Item.getItemFromBlock(Blocks.wool),
+ this.rand,
+ this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.chicken, this.rand, this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.cooked_fished, this.rand, this.adjustProbability(0.4F));
+ addEmeraldTrade(merchantrecipelist, Items.bread, this.rand, this.adjustProbability(0.9F));
+ addEmeraldTrade(merchantrecipelist, Items.melon, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.apple, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.cookie, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.shears, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.flint_and_steel, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.cooked_chicken, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.arrow, this.rand, this.adjustProbability(0.5F));
+
+ if (this.rand.nextFloat() < this.adjustProbability(0.5F)) {
+ merchantrecipelist.add(new MerchantRecipe(
+ new ItemStack(Blocks.gravel, 10),
+ new ItemStack(Items.emerald),
+ new ItemStack(Items.flint, 4 + this.rand.nextInt(2), 0)));
+ }
+
+ break;
+ case 1:
+ addPurchaseRecipe(merchantrecipelist, Items.paper, this.rand, this.adjustProbability(0.8F));
+ addPurchaseRecipe(merchantrecipelist, Items.book, this.rand, this.adjustProbability(0.8F));
+ addPurchaseRecipe(merchantrecipelist, Items.written_book, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(
+ merchantrecipelist,
+ Item.getItemFromBlock(Blocks.bookshelf),
+ this.rand,
+ this.adjustProbability(0.8F));
+ addEmeraldTrade(
+ merchantrecipelist,
+ Item.getItemFromBlock(Blocks.glass),
+ this.rand,
+ this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.compass, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.clock, this.rand, this.adjustProbability(0.2F));
+
+ if (this.rand.nextFloat() < this.adjustProbability(0.07F)) {
+ Enchantment enchantment = Enchantment.enchantmentsBookList[
+ this.rand.nextInt(Enchantment.enchantmentsBookList.length)];
+ int i1 = MathHelper.getRandomIntegerInRange(
+ this.rand, enchantment.getMinLevel(), enchantment.getMaxLevel());
+ ItemStack itemstack =
+ Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, i1));
+ k = 2 + this.rand.nextInt(5 + i1 * 10) + 3 * i1;
+ merchantrecipelist.add(
+ new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, k), itemstack));
+ }
+
+ break;
+ case 2:
+ addEmeraldTrade(merchantrecipelist, Items.ender_eye, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.experience_bottle, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.redstone, this.rand, this.adjustProbability(0.4F));
+ addEmeraldTrade(
+ merchantrecipelist,
+ Item.getItemFromBlock(Blocks.glowstone),
+ this.rand,
+ this.adjustProbability(0.3F));
+ Item[] aitem = new Item[] {
+ Items.iron_sword,
+ Items.diamond_sword,
+ Items.iron_chestplate,
+ Items.diamond_chestplate,
+ Items.iron_axe,
+ Items.diamond_axe,
+ Items.iron_pickaxe,
+ Items.diamond_pickaxe
+ };
+ Item[] aitem1 = aitem;
+ int j = aitem.length;
+ k = 0;
+
+ while (true) {
+ if (k >= j) {
+ break label50;
+ }
+
+ Item item = aitem1[k];
+
+ if (this.rand.nextFloat() < this.adjustProbability(0.05F)) {
+ merchantrecipelist.add(new MerchantRecipe(
+ new ItemStack(item, 1, 0),
+ new ItemStack(Items.emerald, 2 + this.rand.nextInt(3), 0),
+ EnchantmentHelper.addRandomEnchantment(
+ this.rand, new ItemStack(item, 1, 0), 5 + this.rand.nextInt(15))));
+ }
+
+ ++k;
+ }
+ case 3:
+ addPurchaseRecipe(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F));
+ addPurchaseRecipe(merchantrecipelist, Items.iron_ingot, this.rand, this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.gold_ingot, this.rand, this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.diamond, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_sword, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_sword, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_axe, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_axe, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_pickaxe, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_pickaxe, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_shovel, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_shovel, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_hoe, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_hoe, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_boots, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_boots, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_helmet, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_helmet, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_chestplate, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_chestplate, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.iron_leggings, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.diamond_leggings, this.rand, this.adjustProbability(0.2F));
+ addEmeraldTrade(merchantrecipelist, Items.chainmail_boots, this.rand, this.adjustProbability(0.1F));
+ addEmeraldTrade(merchantrecipelist, Items.chainmail_helmet, this.rand, this.adjustProbability(0.1F));
+ addEmeraldTrade(
+ merchantrecipelist, Items.chainmail_chestplate, this.rand, this.adjustProbability(0.1F));
+ addEmeraldTrade(merchantrecipelist, Items.chainmail_leggings, this.rand, this.adjustProbability(0.1F));
+ break;
+ case 4:
+ addPurchaseRecipe(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F));
+ addPurchaseRecipe(merchantrecipelist, Items.porkchop, this.rand, this.adjustProbability(0.5F));
+ addPurchaseRecipe(merchantrecipelist, Items.beef, this.rand, this.adjustProbability(0.5F));
+ addEmeraldTrade(merchantrecipelist, Items.saddle, this.rand, this.adjustProbability(0.1F));
+ addEmeraldTrade(merchantrecipelist, Items.leather_chestplate, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.leather_boots, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.leather_helmet, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.leather_leggings, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.cooked_porkchop, this.rand, this.adjustProbability(0.3F));
+ addEmeraldTrade(merchantrecipelist, Items.cooked_beef, this.rand, this.adjustProbability(0.3F));
+ }
+
+ if (merchantrecipelist.isEmpty()) {
+ addPurchaseRecipe(merchantrecipelist, Items.gold_ingot, this.rand, 1.0F);
+ }
+
+ Collections.shuffle(merchantrecipelist);
+
+ if (this.getBuyingList() == null) {
+ this.setBuyingList(new MerchantRecipeList());
+ }
+
+ for (int l = 0; l < p_70950_1_ && l < merchantrecipelist.size(); ++l) {
+ try {
+ this.getBuyingList().addToListWithCheck((MerchantRecipe) merchantrecipelist.get(l));
+ } catch (Throwable t) {
+ Logger.INFO("Villager with ID " + this.entityUniqueID.toString() + " at | X: " + this.posX + " Y: "
+ + this.posY + " Z: " + this.posZ
+ + " may have corrupt trades, it is advised to remove/kill it.");
+ }
+ }
+
+ try {
+ if (this.getBuyingList() != null) {
+ for (Object g : this.getBuyingList()) {
+ if (g != null) {
+ if (g instanceof MerchantRecipe) {
+ MerchantRecipe m = (MerchantRecipe) g;
+ ItemStack selling = m.getItemToSell();
+ ItemStack[] buying = new ItemStack[] {
+ m.getItemToBuy(), m.getSecondItemToBuy() != null ? m.getSecondItemToBuy() : null
+ };
+ if (selling == null) {
+ Logger.WARNING("Villager is Selling an invalid item");
+ } else if (buying[0] == null && buying[1] == null) {
+ Logger.WARNING("Villager is buying two invalid items");
+ } else {
+ Logger.WARNING(
+ "Villager is Selling x" + selling.stackSize + selling.getDisplayName()
+ + " for x" + buying[0].stackSize + " "
+ + buying[0].getDisplayName() + buying[1]
+ != null
+ ? " and for x" + buying[1].stackSize + " " + buying[1].getDisplayName()
+ : "");
+ }
+ } else Logger.WARNING("Found: " + g.getClass().getName());
+ }
+ }
+ } else {
+
+ }
+ } catch (Throwable t) {
+
+ }
+ }
+
+ /**
+ * main AI tick function, replaces updateEntityActionState
+ */
+ @Override
+ protected void updateAITick() {
+ if (!this.isTrading()) {
+ if (this.getNeedsInitilization()) {
+ if (this.getBuyingList().size() > 1) {
+ Iterator<MerchantRecipe> iterator = this.getBuyingList().iterator();
+
+ while (iterator.hasNext()) {
+ MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
+
+ if (merchantrecipe.isRecipeDisabled()) {
+ merchantrecipe.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
+ }
+ }
+ }
+
+ this.addDefaultEquipmentAndRecipies(1);
+ this.setNeedsInitilization(false);
+
+ if (this.getVillageObject() != null && this.getLastBuyingPlayer() != null) {
+ this.worldObj.setEntityState(this, (byte) 14);
+ this.getVillageObject().setReputationForPlayer(this.getLastBuyingPlayer(), 1);
+ }
+ }
+ }
+ super.updateAITick();
+ }
+
+ public static void addEmeraldTrade(MerchantRecipeList aRecipeList, Item aItem, Random aRand, float aChance) {
+ if (aRand.nextFloat() < aChance) {
+ int i = getLootAmount_BlacksmithSellingList(aItem, aRand);
+ ItemStack itemstack;
+ ItemStack itemstack1;
+
+ if (i < 0) {
+ itemstack = new ItemStack(Items.emerald, 1, 0);
+ itemstack1 = new ItemStack(aItem, -i, 0);
+ } else {
+ itemstack = new ItemStack(Items.emerald, i, 0);
+ itemstack1 = new ItemStack(aItem, 1, 0);
+ }
+
+ aRecipeList.add(new MerchantRecipe(itemstack, itemstack1));
+ }
+ }
+
+ public static void addCustomTrade(
+ MerchantRecipeList aRecipeList,
+ ItemStack aItem1,
+ ItemStack aItem2,
+ ItemStack aItem3,
+ Random aRand,
+ float aChance) {
+ if (aRand.nextFloat() < aChance) {
+ aRecipeList.add(new MerchantRecipe(aItem1, aItem2, aItem3));
+ }
+ }
+
+ private static int getLootAmount_BlacksmithSellingList(Item aItem, Random aRand) {
+ Tuple tuple = (Tuple) blacksmithSellingList.get(aItem);
+ return tuple == null
+ ? 1
+ : (((Integer) tuple.getFirst()).intValue() >= ((Integer) tuple.getSecond()).intValue()
+ ? ((Integer) tuple.getFirst()).intValue()
+ : ((Integer) tuple.getFirst()).intValue()
+ + aRand.nextInt(((Integer) tuple.getSecond()).intValue()
+ - ((Integer) tuple.getFirst()).intValue()));
+ }
+
+ public static void addPurchaseRecipe(MerchantRecipeList aTradeList, Item aItem, Random aRand, float aChance) {
+ if (aRand.nextFloat() < aChance) {
+ aTradeList.add(new MerchantRecipe(getSimpleLootStack(aItem, aRand), Items.emerald));
+ }
+ }
+
+ private static ItemStack getSimpleLootStack(Item aItem, Random aRand) {
+ return new ItemStack(aItem, getLootAmount_VillagerSellingList(aItem, aRand), 0);
+ }
+
+ public static void addPurchaseRecipe(
+ MerchantRecipeList aTradeList, Item aItem, int aMeta, Random aRand, float aChance) {
+ if (aRand.nextFloat() < aChance) {
+ aTradeList.add(new MerchantRecipe(getComplexLootStack(aItem, aMeta, aRand), Items.emerald));
+ }
+ }
+
+ private static ItemStack getComplexLootStack(Item aItem, int aMeta, Random aRand) {
+ return new ItemStack(aItem, getLootAmount_VillagerSellingList(aItem, aRand), aMeta);
+ }
+
+ private static int getLootAmount_VillagerSellingList(Item aItem, Random aRand) {
+ Tuple tuple = (Tuple) villagersSellingList.get(aItem);
+ return tuple == null
+ ? 1
+ : (((Integer) tuple.getFirst()).intValue() >= ((Integer) tuple.getSecond()).intValue()
+ ? ((Integer) tuple.getFirst()).intValue()
+ : ((Integer) tuple.getFirst()).intValue()
+ + aRand.nextInt(((Integer) tuple.getSecond()).intValue()
+ - ((Integer) tuple.getFirst()).intValue()));
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/entity/trade/BaseVillagerTrade.java b/src/main/java/gtPlusPlus/plugin/villagers/entity/trade/BaseVillagerTrade.java
index 61db98e803..6ff46380b8 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/entity/trade/BaseVillagerTrade.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/entity/trade/BaseVillagerTrade.java
@@ -1,32 +1,30 @@
package gtPlusPlus.plugin.villagers.entity.trade;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
+import java.util.Random;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.village.MerchantRecipeList;
public abstract class BaseVillagerTrade implements IVillageTradeHandler {
+ /*
+ Recently in my mod I started working on a new villager and after doing so I could not figure out to assign new trades to this villager.
+ Registering the villager
+ VillagerRegistry.instance().registerVillageTradeHandler(i, new TradeHandler());}
+ VillagerRegistry.instance().registerVillagerId(8);
+ VillagerRegistry.instance().registerVillagerSkin(8, new ResourceLocation("chow", "textures/dealer.png"));
+ VillagerRegistry.instance().getRegisteredVillagers();
+ In my trade handler for vanilla villagers it goes off case 0 for instance being the farmer. I thought that it being case 8 would represent the id 8 for the custom villager but it still doesn't work. Could anyone help me out with this please?
+ *
+ *
+ First, you'll need to make a new class that extends IVillageTradeHandler.
+ In the constructor, add ItemStacks of the items you want it to trade to an ArrayList,
+ then in the manipulateTradesForVillager method, have it make sure the villager is yours by using villager.getProfession()
+ and your villager ID, then in a for loop use recipeList.addToListWithCheck to add new instances of MerchantRecipe to your villager's trade list.
+ Then, in your mod's main class, register the trade handler with VillageRegistry.instance().registerVillagerTradeHandler(villagerId, instanceOfTradeHandler);
+ */
- /*
- Recently in my mod I started working on a new villager and after doing so I could not figure out to assign new trades to this villager.
- Registering the villager
- VillagerRegistry.instance().registerVillageTradeHandler(i, new TradeHandler());}
- VillagerRegistry.instance().registerVillagerId(8);
- VillagerRegistry.instance().registerVillagerSkin(8, new ResourceLocation("chow", "textures/dealer.png"));
- VillagerRegistry.instance().getRegisteredVillagers();
- In my trade handler for vanilla villagers it goes off case 0 for instance being the farmer. I thought that it being case 8 would represent the id 8 for the custom villager but it still doesn't work. Could anyone help me out with this please?
- *
- *
- First, you'll need to make a new class that extends IVillageTradeHandler.
- In the constructor, add ItemStacks of the items you want it to trade to an ArrayList,
- then in the manipulateTradesForVillager method, have it make sure the villager is yours by using villager.getProfession()
- and your villager ID, then in a for loop use recipeList.addToListWithCheck to add new instances of MerchantRecipe to your villager's trade list.
- Then, in your mod's main class, register the trade handler with VillageRegistry.instance().registerVillagerTradeHandler(villagerId, instanceOfTradeHandler);
- */
-
- @Override
- public abstract void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random);
-
+ @Override
+ public abstract void manipulateTradesForVillager(
+ EntityVillager villager, MerchantRecipeList recipeList, Random random);
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/tile/MobSpawnerCustomLogic.java b/src/main/java/gtPlusPlus/plugin/villagers/tile/MobSpawnerCustomLogic.java
index 28416793f5..a1ada6c7d5 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/tile/MobSpawnerCustomLogic.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/tile/MobSpawnerCustomLogic.java
@@ -5,65 +5,65 @@ import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration;
import gtPlusPlus.core.block.ModBlocks;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.MobSpawnerBaseLogic;
-import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class MobSpawnerCustomLogic extends MobSpawnerBaseLogic {
- private TileEntityGenericSpawner mTile;
+ private TileEntityGenericSpawner mTile;
- public MobSpawnerCustomLogic(TileEntityGenericSpawner tile) {
- if (tile != null) {
- mTile = tile;
- }
-
- if (TileEntityGenericSpawner.mSpawners.get(mTile.getID()) != null) {
- Class<Entity> c = TileEntityGenericSpawner.mSpawners.get(mTile.getID());
- EntityRegistration x = EntityRegistry.instance().lookupModSpawn(c, false);
- if (x != null) {
- this.setEntityName(x.getEntityName());
- }
- }
-
- }
+ public MobSpawnerCustomLogic(TileEntityGenericSpawner tile) {
+ if (tile != null) {
+ mTile = tile;
+ }
- @Override
- public void func_98267_a(int eventID) {
- if (mTile != null) mTile.getWorldObj().addBlockEvent(mTile.xCoord, mTile.yCoord, mTile.zCoord, ModBlocks.blockCustomMobSpawner, eventID, 0);
- }
+ if (TileEntityGenericSpawner.mSpawners.get(mTile.getID()) != null) {
+ Class<Entity> c = TileEntityGenericSpawner.mSpawners.get(mTile.getID());
+ EntityRegistration x = EntityRegistry.instance().lookupModSpawn(c, false);
+ if (x != null) {
+ this.setEntityName(x.getEntityName());
+ }
+ }
+ }
- @Override
- public World getSpawnerWorld() {
- if (mTile != null) return mTile.getWorldObj();
- return null;
- }
+ @Override
+ public void func_98267_a(int eventID) {
+ if (mTile != null)
+ mTile.getWorldObj()
+ .addBlockEvent(
+ mTile.xCoord, mTile.yCoord, mTile.zCoord, ModBlocks.blockCustomMobSpawner, eventID, 0);
+ }
- @Override
- public int getSpawnerX() {
- if (mTile != null) return mTile.xCoord;
- return 0;
- }
+ @Override
+ public World getSpawnerWorld() {
+ if (mTile != null) return mTile.getWorldObj();
+ return null;
+ }
- @Override
- public int getSpawnerY() {
- if (mTile != null) return mTile.yCoord;
- return 0;
- }
+ @Override
+ public int getSpawnerX() {
+ if (mTile != null) return mTile.xCoord;
+ return 0;
+ }
- @Override
- public int getSpawnerZ() {
- if (mTile != null) return mTile.zCoord;
- return 0;
- }
+ @Override
+ public int getSpawnerY() {
+ if (mTile != null) return mTile.yCoord;
+ return 0;
+ }
- @Override
- public void setRandomEntity(MobSpawnerBaseLogic.WeightedRandomMinecart p_98277_1_) {
- super.setRandomEntity(p_98277_1_);
- if (mTile != null) {
- if (this.getSpawnerWorld() != null) {
- this.getSpawnerWorld().markBlockForUpdate(mTile.xCoord, mTile.yCoord, mTile.zCoord);
- }
- }
- }
+ @Override
+ public int getSpawnerZ() {
+ if (mTile != null) return mTile.zCoord;
+ return 0;
+ }
+ @Override
+ public void setRandomEntity(MobSpawnerBaseLogic.WeightedRandomMinecart p_98277_1_) {
+ super.setRandomEntity(p_98277_1_);
+ if (mTile != null) {
+ if (this.getSpawnerWorld() != null) {
+ this.getSpawnerWorld().markBlockForUpdate(mTile.xCoord, mTile.yCoord, mTile.zCoord);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/tile/TileEntityGenericSpawner.java b/src/main/java/gtPlusPlus/plugin/villagers/tile/TileEntityGenericSpawner.java
index 45b8c9941b..df4e58124a 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/tile/TileEntityGenericSpawner.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/tile/TileEntityGenericSpawner.java
@@ -1,11 +1,10 @@
package gtPlusPlus.plugin.villagers.tile;
-import java.util.HashMap;
-import java.util.Map;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.HashMap;
+import java.util.Map;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.MobSpawnerBaseLogic;
@@ -14,232 +13,233 @@ import net.minecraft.tileentity.TileEntityMobSpawner;
public class TileEntityGenericSpawner extends TileEntityMobSpawner {
- /*
- * Static Variables
- */
-
- /** A HashMap storing string names of classes mapping to the actual java.lang.Class type. */
- private static Map<?, ?> nameToClassMap_Ex = new HashMap<Object, Object>();
- /** A HashMap storing the classes and mapping to the string names (reverse of nameToClassMap). */
- private static Map<?, ?> classToNameMap_Ex = new HashMap<Object, Object>();
-
- /**
- * The Mob Spawner Map
- */
- public static HashMap<Integer, Class<Entity>> mSpawners = new HashMap<Integer, Class<Entity>>();
-
- /**
- * Registers a New Mob Spawner Type
- *
- * @param aID
- * - the Spawner type ID
- * @param aEntity
- * - the Entity which you'd like to spawn
- */
- public static boolean registerNewMobSpawner(int aID, Class<Entity> aEntity) {
- int registered = mSpawners.size();
- Logger.INFO("Currently "+registered+" spawners are registered.");
- if (!mSpawners.containsKey(aID) && !mSpawners.containsValue(aEntity)) {
- mSpawners.put(aID, aEntity);
- }
- return mSpawners.size() > registered;
- }
-
- /*
- * Instance Variables
- */
-
- /**
- * The {@link Entity} type which spawns.
- */
- protected int mID;
- private final Class mSpawnType;
- private MobSpawnerCustomLogic spawnerLogic;
-
- /*
- * Constructors
- */
-
- /**
- * Constructs a new Spawner, based on an existing type registered.
- *
- * @param aID
- * - The ID in the {@link mSpawners} map.
- */
- public TileEntityGenericSpawner(int aID) {
- mID = aID;
- if (mSpawners.get(aID) != null) {
- mSpawnType = mSpawners.get(aID);
- } else {
- mSpawnType = null;
- }
-
- // Last thing to Init
- generateLogicObject();
- }
-
- /**
- * Constructs a new Spawner, then registers it.
- *
- * @param aID
- * - The ID to be used in the {@link mSpawners} map.
- * @param aEntity
- * - The {@link Entity} type which will be spawned.
- */
- public TileEntityGenericSpawner(int aID, Entity aEntity) {
- mID = aID;
- if (aEntity != null) {
- mSpawnType = aEntity.getClass();
- if (mSpawners.containsKey(aID)) {
- registerNewMobSpawner(aID, mSpawnType);
- }
- } else {
- mSpawnType = null;
- }
-
- // Last thing to Init
- generateLogicObject();
- }
-
- public final MobSpawnerCustomLogic getLogic() {
- if (spawnerLogic == null || spawnerLogic.getSpawnerWorld() == null) {
- generateLogicObject();
- }
- return spawnerLogic;
- }
-
- private final void generateLogicObject() {
- spawnerLogic = new MobSpawnerCustomLogic(this);
- }
-
- public int getID() {
- return this.mID;
- }
-
- @Override
- public void readFromNBT(NBTTagCompound p_145839_1_) {
- if (hasInternalFieldBeenSet()) {
- this.getLogic().readFromNBT(p_145839_1_);
- this.xCoord = p_145839_1_.getInteger("x");
- this.yCoord = p_145839_1_.getInteger("y");
- this.zCoord = p_145839_1_.getInteger("z");
- this.mID = p_145839_1_.getInteger("mID");
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound p_145841_1_) {
- if (hasInternalFieldBeenSet()) {
- String s = (String) classToNameMap_Ex.get(this.getClass());
- if (s == null){
- for (Object g : classToNameMap_Ex.values()) {
- if (g instanceof String) {
- Logger.INFO("Found Translation for "+((Class) nameToClassMap_Ex.get(g)).getName()+": "+g);
- }
- }
-
- //throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!");
- s = mSpawners.containsKey(this.mID) ? mSpawners.get(this.mID).getSimpleName() : "bad.class.name";
- p_145841_1_.setString("id", s);
- Logger.WARNING(this.getClass() + " is missing a mapping! This is a bug! Used key: "+s);
- p_145841_1_.setInteger("x", this.xCoord);
- p_145841_1_.setInteger("y", this.yCoord);
- p_145841_1_.setInteger("z", this.zCoord);
- p_145841_1_.setInteger("mID", this.mID);
- }
- else {
- Logger.INFO(this.getClass() + " is not missing a mapping! Used key: "+s);
- p_145841_1_.setString("id", s);
- p_145841_1_.setInteger("x", this.xCoord);
- p_145841_1_.setInteger("y", this.yCoord);
- p_145841_1_.setInteger("z", this.zCoord);
- p_145841_1_.setInteger("mID", this.mID);
- }
- this.getLogic().writeToNBT(p_145841_1_);
- }
- }
-
- @Override
- public void updateEntity() {
- if (Utils.isServer()) {
- mTicks++;
- if (hasInternalFieldBeenSet()) {
- this.getLogic().updateSpawner();
- }
- }
- }
-
- private boolean isReady = false;
- private long mTicks = 0;
-
- private boolean hasInternalFieldBeenSet() {
- if (isReady && mTicks % 200 != 0) {
- return true;
- } else {
-
- if (Utils.isServer()) {
- try {
- Map<?, ?> a1 = (Map<?, ?>) ReflectionUtils.getField(TileEntity.class, "nameToClassMap").get(this);
- Map<?, ?> a2 = (Map<?, ?>) ReflectionUtils.getField(TileEntity.class, "classToNameMap").get(this);
- if (a1 != null) {
- if (nameToClassMap_Ex == null) {
- nameToClassMap_Ex = a1;
- }
- if (nameToClassMap_Ex != null) {
- if (nameToClassMap_Ex.size() != a1.size()) {
- nameToClassMap_Ex = a1;
- }
- }
- }
- if (a2 != null) {
- if (classToNameMap_Ex == null) {
- classToNameMap_Ex = a2;
- }
- if (classToNameMap_Ex != null) {
- if (classToNameMap_Ex.size() != a2.size()) {
- classToNameMap_Ex = a2;
- }
- }
- if (nameToClassMap_Ex != null && classToNameMap_Ex != null) {
- //Logger.INFO("nameToClassMap_Ex has a size of "+nameToClassMap_Ex.size()+".");
- //Logger.INFO("a1 has a size of "+a1.size()+".");
- //Logger.INFO("classToNameMap_Ex has a size of "+classToNameMap_Ex.size()+".");
- //Logger.INFO("a2 has a size of "+a2.size()+".");
- isReady = true;
- return true;
- }
- }
-
- /*Field mInternalLogicField = ReflectionUtils.getField(getClass(), "field_145882_a");
- if (mInternalLogicField != null) {
- MobSpawnerBaseLogic a = (MobSpawnerBaseLogic) mInternalLogicField.get(this);
- if (a != null) {
- ReflectionUtils.setField(this, "field_145882_a", getLogic());
- if (a.equals(getLogic())) {
- isReady = true;
- return true;
- }
- }
- }*/
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- return false;
- }
- }
-
- /**
- * Called when a client event is received with the event number and argument,
- * see World.sendClientEvent
- */
- @Override
- public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) {
- return this.spawnerLogic.setDelayToMin(p_145842_1_) ? true : super.receiveClientEvent(p_145842_1_, p_145842_2_);
- }
-
- @Override
- public MobSpawnerBaseLogic func_145881_a() {
- return this.spawnerLogic;
- }
-
+ /*
+ * Static Variables
+ */
+
+ /** A HashMap storing string names of classes mapping to the actual java.lang.Class type. */
+ private static Map<?, ?> nameToClassMap_Ex = new HashMap<Object, Object>();
+ /** A HashMap storing the classes and mapping to the string names (reverse of nameToClassMap). */
+ private static Map<?, ?> classToNameMap_Ex = new HashMap<Object, Object>();
+
+ /**
+ * The Mob Spawner Map
+ */
+ public static HashMap<Integer, Class<Entity>> mSpawners = new HashMap<Integer, Class<Entity>>();
+
+ /**
+ * Registers a New Mob Spawner Type
+ *
+ * @param aID
+ * - the Spawner type ID
+ * @param aEntity
+ * - the Entity which you'd like to spawn
+ */
+ public static boolean registerNewMobSpawner(int aID, Class<Entity> aEntity) {
+ int registered = mSpawners.size();
+ Logger.INFO("Currently " + registered + " spawners are registered.");
+ if (!mSpawners.containsKey(aID) && !mSpawners.containsValue(aEntity)) {
+ mSpawners.put(aID, aEntity);
+ }
+ return mSpawners.size() > registered;
+ }
+
+ /*
+ * Instance Variables
+ */
+
+ /**
+ * The {@link Entity} type which spawns.
+ */
+ protected int mID;
+
+ private final Class mSpawnType;
+ private MobSpawnerCustomLogic spawnerLogic;
+
+ /*
+ * Constructors
+ */
+
+ /**
+ * Constructs a new Spawner, based on an existing type registered.
+ *
+ * @param aID
+ * - The ID in the {@link mSpawners} map.
+ */
+ public TileEntityGenericSpawner(int aID) {
+ mID = aID;
+ if (mSpawners.get(aID) != null) {
+ mSpawnType = mSpawners.get(aID);
+ } else {
+ mSpawnType = null;
+ }
+
+ // Last thing to Init
+ generateLogicObject();
+ }
+
+ /**
+ * Constructs a new Spawner, then registers it.
+ *
+ * @param aID
+ * - The ID to be used in the {@link mSpawners} map.
+ * @param aEntity
+ * - The {@link Entity} type which will be spawned.
+ */
+ public TileEntityGenericSpawner(int aID, Entity aEntity) {
+ mID = aID;
+ if (aEntity != null) {
+ mSpawnType = aEntity.getClass();
+ if (mSpawners.containsKey(aID)) {
+ registerNewMobSpawner(aID, mSpawnType);
+ }
+ } else {
+ mSpawnType = null;
+ }
+
+ // Last thing to Init
+ generateLogicObject();
+ }
+
+ public final MobSpawnerCustomLogic getLogic() {
+ if (spawnerLogic == null || spawnerLogic.getSpawnerWorld() == null) {
+ generateLogicObject();
+ }
+ return spawnerLogic;
+ }
+
+ private final void generateLogicObject() {
+ spawnerLogic = new MobSpawnerCustomLogic(this);
+ }
+
+ public int getID() {
+ return this.mID;
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound p_145839_1_) {
+ if (hasInternalFieldBeenSet()) {
+ this.getLogic().readFromNBT(p_145839_1_);
+ this.xCoord = p_145839_1_.getInteger("x");
+ this.yCoord = p_145839_1_.getInteger("y");
+ this.zCoord = p_145839_1_.getInteger("z");
+ this.mID = p_145839_1_.getInteger("mID");
+ }
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound p_145841_1_) {
+ if (hasInternalFieldBeenSet()) {
+ String s = (String) classToNameMap_Ex.get(this.getClass());
+ if (s == null) {
+ for (Object g : classToNameMap_Ex.values()) {
+ if (g instanceof String) {
+ Logger.INFO("Found Translation for " + ((Class) nameToClassMap_Ex.get(g)).getName() + ": " + g);
+ }
+ }
+
+ // throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!");
+ s = mSpawners.containsKey(this.mID) ? mSpawners.get(this.mID).getSimpleName() : "bad.class.name";
+ p_145841_1_.setString("id", s);
+ Logger.WARNING(this.getClass() + " is missing a mapping! This is a bug! Used key: " + s);
+ p_145841_1_.setInteger("x", this.xCoord);
+ p_145841_1_.setInteger("y", this.yCoord);
+ p_145841_1_.setInteger("z", this.zCoord);
+ p_145841_1_.setInteger("mID", this.mID);
+ } else {
+ Logger.INFO(this.getClass() + " is not missing a mapping! Used key: " + s);
+ p_145841_1_.setString("id", s);
+ p_145841_1_.setInteger("x", this.xCoord);
+ p_145841_1_.setInteger("y", this.yCoord);
+ p_145841_1_.setInteger("z", this.zCoord);
+ p_145841_1_.setInteger("mID", this.mID);
+ }
+ this.getLogic().writeToNBT(p_145841_1_);
+ }
+ }
+
+ @Override
+ public void updateEntity() {
+ if (Utils.isServer()) {
+ mTicks++;
+ if (hasInternalFieldBeenSet()) {
+ this.getLogic().updateSpawner();
+ }
+ }
+ }
+
+ private boolean isReady = false;
+ private long mTicks = 0;
+
+ private boolean hasInternalFieldBeenSet() {
+ if (isReady && mTicks % 200 != 0) {
+ return true;
+ } else {
+
+ if (Utils.isServer()) {
+ try {
+ Map<?, ?> a1 = (Map<?, ?>) ReflectionUtils.getField(TileEntity.class, "nameToClassMap")
+ .get(this);
+ Map<?, ?> a2 = (Map<?, ?>) ReflectionUtils.getField(TileEntity.class, "classToNameMap")
+ .get(this);
+ if (a1 != null) {
+ if (nameToClassMap_Ex == null) {
+ nameToClassMap_Ex = a1;
+ }
+ if (nameToClassMap_Ex != null) {
+ if (nameToClassMap_Ex.size() != a1.size()) {
+ nameToClassMap_Ex = a1;
+ }
+ }
+ }
+ if (a2 != null) {
+ if (classToNameMap_Ex == null) {
+ classToNameMap_Ex = a2;
+ }
+ if (classToNameMap_Ex != null) {
+ if (classToNameMap_Ex.size() != a2.size()) {
+ classToNameMap_Ex = a2;
+ }
+ }
+ if (nameToClassMap_Ex != null && classToNameMap_Ex != null) {
+ // Logger.INFO("nameToClassMap_Ex has a size of "+nameToClassMap_Ex.size()+".");
+ // Logger.INFO("a1 has a size of "+a1.size()+".");
+ // Logger.INFO("classToNameMap_Ex has a size of "+classToNameMap_Ex.size()+".");
+ // Logger.INFO("a2 has a size of "+a2.size()+".");
+ isReady = true;
+ return true;
+ }
+ }
+
+ /*Field mInternalLogicField = ReflectionUtils.getField(getClass(), "field_145882_a");
+ if (mInternalLogicField != null) {
+ MobSpawnerBaseLogic a = (MobSpawnerBaseLogic) mInternalLogicField.get(this);
+ if (a != null) {
+ ReflectionUtils.setField(this, "field_145882_a", getLogic());
+ if (a.equals(getLogic())) {
+ isReady = true;
+ return true;
+ }
+ }
+ }*/
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Called when a client event is received with the event number and argument,
+ * see World.sendClientEvent
+ */
+ @Override
+ public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) {
+ return this.spawnerLogic.setDelayToMin(p_145842_1_) ? true : super.receiveClientEvent(p_145842_1_, p_145842_2_);
+ }
+
+ @Override
+ public MobSpawnerBaseLogic func_145881_a() {
+ return this.spawnerLogic;
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerAboriginal.java b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerAboriginal.java
index 3baca10792..3d087ea053 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerAboriginal.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerAboriginal.java
@@ -2,14 +2,11 @@ package gtPlusPlus.plugin.villagers.trade;
import static java.util.Collections.shuffle;
-import java.util.Collections;
-import java.util.Random;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.Random;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -19,143 +16,148 @@ import net.minecraft.village.MerchantRecipeList;
public class TradeHandlerAboriginal extends TradeHandlerBase {
- private final static AutoMap<ItemStack> mInputs = new AutoMap<ItemStack>();
- private final static AutoMap<ItemStack> mOutputs = new AutoMap<ItemStack>();
- private static boolean initialised = false;
+ private static final AutoMap<ItemStack> mInputs = new AutoMap<ItemStack>();
+ private static final AutoMap<ItemStack> mOutputs = new AutoMap<ItemStack>();
+ private static boolean initialised = false;
- public static void init() {
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.anvil, 1));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.bookshelf, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.cactus, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.dirt, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.cobblestone, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.mossy_cobblestone, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.pumpkin, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.hardened_clay, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.log, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.obsidian, 8));
- mOutputs.put(ItemUtils.getSimpleStack(Items.wheat, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.gravel, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Blocks.sand, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.apple, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.emerald, 1));
- mOutputs.put(ItemUtils.getSimpleStack(Items.diamond, 1));
- mOutputs.put(ItemUtils.getSimpleStack(Items.baked_potato, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.beef, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.bone, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.bread, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.carrot, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.potato, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.poisonous_potato, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.chicken, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.porkchop, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.cooked_beef, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.cooked_chicken, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.cooked_porkchop, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.fish, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.cooked_fished, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.feather, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.egg, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.gold_nugget, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.leather, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.melon_seeds, 0));
- mOutputs.put(ItemUtils.getSimpleStack(Items.reeds, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.wooden_door));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.log));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.log2));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.planks));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.sapling));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.sandstone));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.nether_brick));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.bookshelf));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.crafting_table));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.gravel));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.hardened_clay));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.cactus));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.quartz_block));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.stone));
- mInputs.put(ItemUtils.getSimpleStack(Blocks.mossy_cobblestone));
- mInputs.put(ItemUtils.getSimpleStack(Items.apple, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.emerald, 1));
- mInputs.put(ItemUtils.getSimpleStack(Items.diamond, 1));
- mInputs.put(ItemUtils.getSimpleStack(Items.baked_potato, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.beef, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.bone, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.bread, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.carrot, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.potato, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.poisonous_potato, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.chicken, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.porkchop, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.cooked_beef, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.cooked_chicken, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.cooked_porkchop, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.fish, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.cooked_fished, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.feather, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.egg, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.gold_nugget, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.leather, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.melon_seeds, 0));
- mInputs.put(ItemUtils.getSimpleStack(Items.reeds, 0));
- initialised = true;
- }
+ public static void init() {
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.anvil, 1));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.bookshelf, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.cactus, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.dirt, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.cobblestone, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.mossy_cobblestone, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.pumpkin, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.hardened_clay, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.log, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.obsidian, 8));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.wheat, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.gravel, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Blocks.sand, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.apple, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.emerald, 1));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.diamond, 1));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.baked_potato, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.beef, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.bone, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.bread, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.carrot, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.potato, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.poisonous_potato, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.chicken, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.porkchop, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.cooked_beef, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.cooked_chicken, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.cooked_porkchop, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.fish, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.cooked_fished, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.feather, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.egg, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.gold_nugget, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.leather, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.melon_seeds, 0));
+ mOutputs.put(ItemUtils.getSimpleStack(Items.reeds, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.wooden_door));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.log));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.log2));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.planks));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.sapling));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.sandstone));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.nether_brick));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.bookshelf));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.crafting_table));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.gravel));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.hardened_clay));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.cactus));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.quartz_block));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.stone));
+ mInputs.put(ItemUtils.getSimpleStack(Blocks.mossy_cobblestone));
+ mInputs.put(ItemUtils.getSimpleStack(Items.apple, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.emerald, 1));
+ mInputs.put(ItemUtils.getSimpleStack(Items.diamond, 1));
+ mInputs.put(ItemUtils.getSimpleStack(Items.baked_potato, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.beef, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.bone, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.bread, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.carrot, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.potato, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.poisonous_potato, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.chicken, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.porkchop, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.cooked_beef, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.cooked_chicken, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.cooked_porkchop, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.fish, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.cooked_fished, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.feather, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.egg, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.gold_nugget, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.leather, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.melon_seeds, 0));
+ mInputs.put(ItemUtils.getSimpleStack(Items.reeds, 0));
+ initialised = true;
+ }
+ public TradeHandlerAboriginal() {
+ Logger.INFO("Created Trade Manager for 'Trader' villager profession type.");
+ }
- public TradeHandlerAboriginal() {
- Logger.INFO("Created Trade Manager for 'Trader' villager profession type.");
- }
+ @SuppressWarnings("unchecked")
+ @Override
+ public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
+ if (!initialised) {
+ init();
+ }
+ if (initialised) {
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
+ shuffle(recipeList);
+ }
+ }
- @SuppressWarnings("unchecked")
- @Override
- public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
- if (!initialised) {
- init();
- }
- if (initialised) {
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- recipeList.add(new MerchantRecipe(getInput(), getInput(), getOutput()));
- shuffle(recipeList);
- }
- }
+ private ItemStack getInput() {
+ ItemStack input = mInputs.get(MathUtils.randInt(0, mInputs.size() - 1));
+ int outputSize = (input.stackSize == 0
+ ? (Math.max(MathUtils.randInt(1, 64), MathUtils.randInt(1, 32)))
+ : input.stackSize);
+ return ItemUtils.getSimpleStack(input, outputSize);
+ }
- private ItemStack getInput() {
- ItemStack input = mInputs.get(MathUtils.randInt(0, mInputs.size()-1));
- int outputSize = (input.stackSize == 0 ? (Math.max(MathUtils.randInt(1, 64), MathUtils.randInt(1, 32))) : input.stackSize);
- return ItemUtils.getSimpleStack(input, outputSize);
- }
-
- final static int MID_BOUND = 24;
- private ItemStack getOutput() {
- ItemStack output = mOutputs.get(MathUtils.randInt(0, mOutputs.size()-1));
- int outputSize = (output.stackSize == 0 ? (Math.min(MathUtils.randInt(MathUtils.randInt(1, MID_BOUND), MathUtils.randInt(MID_BOUND, 32)), MathUtils.randInt(MathUtils.randInt(12, MID_BOUND), MathUtils.randInt(MID_BOUND, 48)))) : output.stackSize);
- return ItemUtils.getSimpleStack(output, outputSize);
- }
+ static final int MID_BOUND = 24;
+ private ItemStack getOutput() {
+ ItemStack output = mOutputs.get(MathUtils.randInt(0, mOutputs.size() - 1));
+ int outputSize = (output.stackSize == 0
+ ? (Math.min(
+ MathUtils.randInt(MathUtils.randInt(1, MID_BOUND), MathUtils.randInt(MID_BOUND, 32)),
+ MathUtils.randInt(MathUtils.randInt(12, MID_BOUND), MathUtils.randInt(MID_BOUND, 48))))
+ : output.stackSize);
+ return ItemUtils.getSimpleStack(output, outputSize);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBanker.java b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBanker.java
index 215dc0683b..c42da6895f 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBanker.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBanker.java
@@ -1,27 +1,23 @@
package gtPlusPlus.plugin.villagers.trade;
-import java.util.Collections;
-import java.util.Random;
-
import gtPlusPlus.core.recipe.common.CI;
+import java.util.Random;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.village.MerchantRecipe;
import net.minecraft.village.MerchantRecipeList;
public class TradeHandlerBanker extends TradeHandlerBase {
-
- @SuppressWarnings("unchecked")
- @Override
- public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
- //if (villager.getProfession() == 7735) {
- recipeList.add(new MerchantRecipe(CI.electricMotor_LV, CI.electricPiston_LV, CI.robotArm_LV));
- recipeList.add(new MerchantRecipe(CI.electricMotor_MV, CI.electricPiston_MV, CI.robotArm_MV));
- recipeList.add(new MerchantRecipe(CI.electricMotor_HV, CI.electricPiston_HV, CI.robotArm_HV));
- recipeList.add(new MerchantRecipe(CI.electricMotor_EV, CI.electricPiston_EV, CI.robotArm_EV));
- recipeList.add(new MerchantRecipe(CI.electricMotor_IV, CI.electricPiston_IV, CI.robotArm_IV));
- //Collections.shuffle(recipeList);
- //}
- }
-
+ @SuppressWarnings("unchecked")
+ @Override
+ public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
+ // if (villager.getProfession() == 7735) {
+ recipeList.add(new MerchantRecipe(CI.electricMotor_LV, CI.electricPiston_LV, CI.robotArm_LV));
+ recipeList.add(new MerchantRecipe(CI.electricMotor_MV, CI.electricPiston_MV, CI.robotArm_MV));
+ recipeList.add(new MerchantRecipe(CI.electricMotor_HV, CI.electricPiston_HV, CI.robotArm_HV));
+ recipeList.add(new MerchantRecipe(CI.electricMotor_EV, CI.electricPiston_EV, CI.robotArm_EV));
+ recipeList.add(new MerchantRecipe(CI.electricMotor_IV, CI.electricPiston_IV, CI.robotArm_IV));
+ // Collections.shuffle(recipeList);
+ // }
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBase.java b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBase.java
index b726ebefff..1e1e326201 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBase.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBase.java
@@ -10,16 +10,15 @@
******************************************************************************/
package gtPlusPlus.plugin.villagers.trade;
+import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
import java.util.Random;
-
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.village.MerchantRecipeList;
-import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
public abstract class TradeHandlerBase implements IVillageTradeHandler {
- @SuppressWarnings("unchecked")
- @Override
- public abstract void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random);
-
+ @SuppressWarnings("unchecked")
+ @Override
+ public abstract void manipulateTradesForVillager(
+ EntityVillager villager, MerchantRecipeList recipeList, Random random);
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTechnician.java b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTechnician.java
index 922316b136..bd2acc9bfe 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTechnician.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTechnician.java
@@ -1,27 +1,23 @@
package gtPlusPlus.plugin.villagers.trade;
-import java.util.Collections;
-import java.util.Random;
-
import gtPlusPlus.core.recipe.common.CI;
+import java.util.Random;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.village.MerchantRecipe;
import net.minecraft.village.MerchantRecipeList;
public class TradeHandlerTechnician extends TradeHandlerBase {
-
- @SuppressWarnings("unchecked")
- @Override
- public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
- //if (villager.getProfession() == 7737) {
- recipeList.add(new MerchantRecipe(CI.machineHull_LV, CI.electricMotor_LV, CI.machineHull_LV));
- recipeList.add(new MerchantRecipe(CI.machineHull_MV, CI.electricMotor_MV, CI.machineHull_MV));
- recipeList.add(new MerchantRecipe(CI.machineHull_HV, CI.electricMotor_HV, CI.machineHull_HV));
- recipeList.add(new MerchantRecipe(CI.machineHull_EV, CI.electricMotor_EV, CI.machineHull_EV));
- recipeList.add(new MerchantRecipe(CI.machineHull_IV, CI.electricMotor_IV, CI.machineHull_IV));
- //Collections.shuffle(recipeList);
- //}
- }
-
+ @SuppressWarnings("unchecked")
+ @Override
+ public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
+ // if (villager.getProfession() == 7737) {
+ recipeList.add(new MerchantRecipe(CI.machineHull_LV, CI.electricMotor_LV, CI.machineHull_LV));
+ recipeList.add(new MerchantRecipe(CI.machineHull_MV, CI.electricMotor_MV, CI.machineHull_MV));
+ recipeList.add(new MerchantRecipe(CI.machineHull_HV, CI.electricMotor_HV, CI.machineHull_HV));
+ recipeList.add(new MerchantRecipe(CI.machineHull_EV, CI.electricMotor_EV, CI.machineHull_EV));
+ recipeList.add(new MerchantRecipe(CI.machineHull_IV, CI.electricMotor_IV, CI.machineHull_IV));
+ // Collections.shuffle(recipeList);
+ // }
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java
index 0025c054bd..f866bd7aa6 100644
--- a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java
+++ b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java
@@ -1,11 +1,10 @@
package gtPlusPlus.plugin.villagers.trade;
-import java.util.Collections;
-import java.util.Random;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.Collections;
+import java.util.Random;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -14,32 +13,37 @@ import net.minecraft.village.MerchantRecipeList;
public class TradeHandlerTrader extends TradeHandlerBase {
- public TradeHandlerTrader() {
- Logger.INFO("Created Trade Manager for 'Trader' villager profession type.");
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
- ItemStack Ore1 = null, Ore2 = null;
- if (Ore1 == null) {
- Ore1 = ELEMENT.getInstance().SILICON.getOre(1);
- }
- if (Ore2 == null) {
- Ore2 = ELEMENT.getInstance().ALUMINIUM.getOre(1);
- }
- if (Ore1 == null) {
- Ore1 = ELEMENT.getInstance().GOLD.getOre(1);
- }
- if (Ore2 == null) {
- Ore2 = ELEMENT.getInstance().LEAD.getOre(1);
- }
- recipeList.add(new MerchantRecipe(ItemUtils.getItemStackOfAmountFromOreDict("logWood", 32), ELEMENT.getInstance().IRON.getOre(1)));
- recipeList.add(new MerchantRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 32), ELEMENT.getInstance().COPPER.getOre(1)));
- recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.obsidian, 6), ELEMENT.getInstance().TIN.getOre(1)));
- recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.glowstone, 32), Ore1));
- recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.piston, 32), Ore2));
- Collections.shuffle(recipeList);
- }
+ public TradeHandlerTrader() {
+ Logger.INFO("Created Trade Manager for 'Trader' villager profession type.");
+ }
+ @SuppressWarnings("unchecked")
+ @Override
+ public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
+ ItemStack Ore1 = null, Ore2 = null;
+ if (Ore1 == null) {
+ Ore1 = ELEMENT.getInstance().SILICON.getOre(1);
+ }
+ if (Ore2 == null) {
+ Ore2 = ELEMENT.getInstance().ALUMINIUM.getOre(1);
+ }
+ if (Ore1 == null) {
+ Ore1 = ELEMENT.getInstance().GOLD.getOre(1);
+ }
+ if (Ore2 == null) {
+ Ore2 = ELEMENT.getInstance().LEAD.getOre(1);
+ }
+ recipeList.add(new MerchantRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("logWood", 32),
+ ELEMENT.getInstance().IRON.getOre(1)));
+ recipeList.add(new MerchantRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 32),
+ ELEMENT.getInstance().COPPER.getOre(1)));
+ recipeList.add(new MerchantRecipe(
+ ItemUtils.getSimpleStack(Blocks.obsidian, 6),
+ ELEMENT.getInstance().TIN.getOre(1)));
+ recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.glowstone, 32), Ore1));
+ recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.piston, 32), Ore2));
+ Collections.shuffle(recipeList);
+ }
}
diff --git a/src/main/java/gtPlusPlus/plugin/waila/Core_WailaPlugin.java b/src/main/java/gtPlusPlus/plugin/waila/Core_WailaPlugin.java
index 3317ef6a11..af63ab1307 100644
--- a/src/main/java/gtPlusPlus/plugin/waila/Core_WailaPlugin.java
+++ b/src/main/java/gtPlusPlus/plugin/waila/Core_WailaPlugin.java
@@ -6,54 +6,53 @@ import gtPlusPlus.plugin.manager.Core_Manager;
public class Core_WailaPlugin implements IPlugin {
- final static Core_WailaPlugin mInstance;
- static boolean mActive = false;
-
- static {
- mInstance = new Core_WailaPlugin();
- mInstance.log("Preparing "+mInstance.getPluginName()+" for use.");
- }
-
- Core_WailaPlugin() {
- Core_Manager.registerPlugin(this);
- }
-
- @Override
- public boolean preInit() {
- if (LoadedMods.Waila) {
- mActive = true;
- }
- return mActive;
- }
-
- @Override
- public boolean init() {
- return mActive;
- }
-
- @Override
- public boolean postInit() {
- return mActive;
- }
-
- @Override
- public boolean serverStart() {
- return mActive;
- }
-
- @Override
- public boolean serverStop() {
- return mActive;
- }
-
- @Override
- public String getPluginName() {
- return "GT++ WAILA module";
- }
-
- @Override
- public String getPluginAbbreviation() {
- return "Look";
- }
-
+ static final Core_WailaPlugin mInstance;
+ static boolean mActive = false;
+
+ static {
+ mInstance = new Core_WailaPlugin();
+ mInstance.log("Preparing " + mInstance.getPluginName() + " for use.");
+ }
+
+ Core_WailaPlugin() {
+ Core_Manager.registerPlugin(this);
+ }
+
+ @Override
+ public boolean preInit() {
+ if (LoadedMods.Waila) {
+ mActive = true;
+ }
+ return mActive;
+ }
+
+ @Override
+ public boolean init() {
+ return mActive;
+ }
+
+ @Override
+ public boolean postInit() {
+ return mActive;
+ }
+
+ @Override
+ public boolean serverStart() {
+ return mActive;
+ }
+
+ @Override
+ public boolean serverStop() {
+ return mActive;
+ }
+
+ @Override
+ public String getPluginName() {
+ return "GT++ WAILA module";
+ }
+
+ @Override
+ public String getPluginAbbreviation() {
+ return "Look";
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/CORE_Preloader.java b/src/main/java/gtPlusPlus/preloader/CORE_Preloader.java
index 49209307f7..303868e6d8 100644
--- a/src/main/java/gtPlusPlus/preloader/CORE_Preloader.java
+++ b/src/main/java/gtPlusPlus/preloader/CORE_Preloader.java
@@ -1,33 +1,32 @@
package gtPlusPlus.preloader;
+import cpw.mods.fml.common.versioning.ArtifactVersion;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import cpw.mods.fml.common.versioning.ArtifactVersion;
-
public class CORE_Preloader {
-
- public static final String NAME = "GT++ Preloader";
- public static final String MODID = "GT++_Preloader";
- public static final String VERSION = "0.5-Beta";
- public static final List<ArtifactVersion> DEPENDENCIES;
- public static final String JAVA_VERSION = System.getProperty("java.version");
-
- public static File MC_DIR;
- public static boolean DEV_ENVIRONMENT = false;
- public static boolean DEBUG_MODE = false;
- public static boolean enableOldGTcircuits = false;
- public static int enableWatchdogBGM = 0;
-
- public static void setMinecraftDirectory(File aDir) {
- MC_DIR = aDir;
- }
-
- static {
- ArrayList<ArtifactVersion> deps = new ArrayList<ArtifactVersion>();
- //deps.add("required-before:gregtech;");
- DEPENDENCIES = Collections.unmodifiableList(deps);
- }
+
+ public static final String NAME = "GT++ Preloader";
+ public static final String MODID = "GT++_Preloader";
+ public static final String VERSION = "0.5-Beta";
+ public static final List<ArtifactVersion> DEPENDENCIES;
+ public static final String JAVA_VERSION = System.getProperty("java.version");
+
+ public static File MC_DIR;
+ public static boolean DEV_ENVIRONMENT = false;
+ public static boolean DEBUG_MODE = false;
+ public static boolean enableOldGTcircuits = false;
+ public static int enableWatchdogBGM = 0;
+
+ public static void setMinecraftDirectory(File aDir) {
+ MC_DIR = aDir;
+ }
+
+ static {
+ ArrayList<ArtifactVersion> deps = new ArrayList<ArtifactVersion>();
+ // deps.add("required-before:gregtech;");
+ DEPENDENCIES = Collections.unmodifiableList(deps);
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/ChunkDebugger.java b/src/main/java/gtPlusPlus/preloader/ChunkDebugger.java
index 06964d31fa..091188995d 100644
--- a/src/main/java/gtPlusPlus/preloader/ChunkDebugger.java
+++ b/src/main/java/gtPlusPlus/preloader/ChunkDebugger.java
@@ -1,54 +1,57 @@
package gtPlusPlus.preloader;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
+import java.util.LinkedHashMap;
+import java.util.Map;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
public class ChunkDebugger {
-
- public static final Map<Integer, Pair<String, String>> mChunkTicketsMap = new LinkedHashMap<Integer, Pair<String, String>>();
- public static final Map<String, Pair<String, String>> mChunksLoadedByModsMap = new LinkedHashMap<String, Pair<String, String>>();
-
- public static void storeTicketToCache(Ticket aTicket, World aWorld) {
- mChunkTicketsMap.put(aTicket.hashCode(), new Pair<String, String>(aTicket.getModId(), ""+aTicket.world.provider.dimensionId));
- Logger.REFLECTION("Ticket created by "+aTicket.getModId()+" for dimension "+aTicket.world.provider.dimensionId);
- }
-
- public static void storeLoadChunkToCache(Ticket aTicket, ChunkCoordIntPair aChunk) {
- mChunksLoadedByModsMap.put(aChunk.toString(), new Pair<String, String>(aTicket.getModId(), aChunk.toString()));
- Logger.REFLECTION("Chunk Loaded by "+aTicket.getModId()+" at position "+aChunk.toString()+" for dimension "+aTicket.world.provider.dimensionId);
- }
-
- public static void removeTicketFromCache(Ticket aTicket) {
- Pair<String, String> aPair = mChunkTicketsMap.get(aTicket.hashCode());
- String aKey = aPair.getKey();
- if (aKey == null) {
- aKey = "Invalid ModId";
- }
- Logger.REFLECTION("Ticket released by "+aKey+" for dimension "+aTicket.world.provider.dimensionId);
- mChunkTicketsMap.remove(aTicket.hashCode());
- }
-
- public static void removeLoadedChunkFromCache(ChunkCoordIntPair aChunk) {
- if (aChunk == null || aChunk.toString() == null) {
- return;
- }
- Pair<String, String> aPair = mChunksLoadedByModsMap.get(aChunk.toString());
- if (aPair == null) {
- return;
- }
- String aKey = aPair.getKey();
- String aValue = aPair.getValue();
- if (aKey != null && aValue != null) {
- Logger.REFLECTION("Chunk Unloaded by "+aKey+" at position "+aChunk.toString()+"");
- }
- mChunksLoadedByModsMap.remove(aChunk.toString());
- }
-
+ public static final Map<Integer, Pair<String, String>> mChunkTicketsMap =
+ new LinkedHashMap<Integer, Pair<String, String>>();
+ public static final Map<String, Pair<String, String>> mChunksLoadedByModsMap =
+ new LinkedHashMap<String, Pair<String, String>>();
+
+ public static void storeTicketToCache(Ticket aTicket, World aWorld) {
+ mChunkTicketsMap.put(
+ aTicket.hashCode(),
+ new Pair<String, String>(aTicket.getModId(), "" + aTicket.world.provider.dimensionId));
+ Logger.REFLECTION(
+ "Ticket created by " + aTicket.getModId() + " for dimension " + aTicket.world.provider.dimensionId);
+ }
+
+ public static void storeLoadChunkToCache(Ticket aTicket, ChunkCoordIntPair aChunk) {
+ mChunksLoadedByModsMap.put(aChunk.toString(), new Pair<String, String>(aTicket.getModId(), aChunk.toString()));
+ Logger.REFLECTION("Chunk Loaded by " + aTicket.getModId() + " at position " + aChunk.toString()
+ + " for dimension " + aTicket.world.provider.dimensionId);
+ }
+
+ public static void removeTicketFromCache(Ticket aTicket) {
+ Pair<String, String> aPair = mChunkTicketsMap.get(aTicket.hashCode());
+ String aKey = aPair.getKey();
+ if (aKey == null) {
+ aKey = "Invalid ModId";
+ }
+ Logger.REFLECTION("Ticket released by " + aKey + " for dimension " + aTicket.world.provider.dimensionId);
+ mChunkTicketsMap.remove(aTicket.hashCode());
+ }
+
+ public static void removeLoadedChunkFromCache(ChunkCoordIntPair aChunk) {
+ if (aChunk == null || aChunk.toString() == null) {
+ return;
+ }
+ Pair<String, String> aPair = mChunksLoadedByModsMap.get(aChunk.toString());
+ if (aPair == null) {
+ return;
+ }
+ String aKey = aPair.getKey();
+ String aValue = aPair.getValue();
+ if (aKey != null && aValue != null) {
+ Logger.REFLECTION("Chunk Unloaded by " + aKey + " at position " + aChunk.toString() + "");
+ }
+ mChunksLoadedByModsMap.remove(aChunk.toString());
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/CustomClassLoader.java b/src/main/java/gtPlusPlus/preloader/CustomClassLoader.java
index 56394c11f0..388b5fa2a6 100644
--- a/src/main/java/gtPlusPlus/preloader/CustomClassLoader.java
+++ b/src/main/java/gtPlusPlus/preloader/CustomClassLoader.java
@@ -6,52 +6,45 @@ import java.security.Permissions;
import java.security.ProtectionDomain;
import java.security.cert.Certificate;
import java.util.HashMap;
-
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.tree.ClassNode;
public class CustomClassLoader extends ClassLoader {
- private HashMap<String, ClassNode> classes = new HashMap<String, ClassNode>();
-
- @Override
-
- public Class<?> loadClass(String name) throws ClassNotFoundException {
- return findClass(name);
- }
-
- @Override
-
- protected Class<?> findClass(String name) throws ClassNotFoundException {
- ClassNode node = classes.get(name.replace('.', '/'));
- if (node != null)
- return nodeToClass(node);
- else
- return super.findClass(name);
- }
-
- public final void addNode(ClassNode node) {
- classes.put(node.name, node);
- }
-
- private final Class<?> nodeToClass(ClassNode node) {
- if (super.findLoadedClass(node.name) != null)
- return findLoadedClass(node.name);
- ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
- node.accept(cw);
- byte[] b = cw.toByteArray();
- return defineClass(node.name.replace('/', '.'), b, 0, b.length, getDomain());
- }
-
- private final ProtectionDomain getDomain() {
- CodeSource code = new CodeSource(null, (Certificate[]) null);
- return new ProtectionDomain(code, getPermissions());
- }
-
- private final Permissions getPermissions() {
- Permissions permissions = new Permissions();
- permissions.add(new AllPermission());
- return permissions;
- }
-
-} \ No newline at end of file
+ private HashMap<String, ClassNode> classes = new HashMap<String, ClassNode>();
+
+ @Override
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
+ return findClass(name);
+ }
+
+ @Override
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
+ ClassNode node = classes.get(name.replace('.', '/'));
+ if (node != null) return nodeToClass(node);
+ else return super.findClass(name);
+ }
+
+ public final void addNode(ClassNode node) {
+ classes.put(node.name, node);
+ }
+
+ private final Class<?> nodeToClass(ClassNode node) {
+ if (super.findLoadedClass(node.name) != null) return findLoadedClass(node.name);
+ ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
+ node.accept(cw);
+ byte[] b = cw.toByteArray();
+ return defineClass(node.name.replace('/', '.'), b, 0, b.length, getDomain());
+ }
+
+ private final ProtectionDomain getDomain() {
+ CodeSource code = new CodeSource(null, (Certificate[]) null);
+ return new ProtectionDomain(code, getPermissions());
+ }
+
+ private final Permissions getPermissions() {
+ Permissions permissions = new Permissions();
+ permissions.add(new AllPermission());
+ return permissions;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/preloader/DevHelper.java b/src/main/java/gtPlusPlus/preloader/DevHelper.java
index 70a3c53073..10d81d1ce3 100644
--- a/src/main/java/gtPlusPlus/preloader/DevHelper.java
+++ b/src/main/java/gtPlusPlus/preloader/DevHelper.java
@@ -1,7139 +1,7100 @@
package gtPlusPlus.preloader;
+import gtPlusPlus.api.objects.data.Pair;
+import gtPlusPlus.api.objects.data.weakref.WeakAutoMap;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
-
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.api.objects.data.weakref.WeakAutoMap;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.launchwrapper.Launch;
public class DevHelper {
- private static final DevHelper mInstance;
- public static final boolean mIsValidHelper;
-
- static {
- mInstance = new DevHelper();
- if (DevHelperInternals.init()) {
- mIsValidHelper = true;
- }
- else {
- mIsValidHelper = false;
- }
- }
-
- public DevHelper() {
-
- }
-
-
-
- public static boolean isObfuscatedEnvironment() {
- // Are we in a 'decompiled' environment?
- boolean deobfuscatedEnvironment = false;
- byte[] bs;
- try {
- bs = Launch.classLoader.getClassBytes("net.minecraft.world.World");
- if (bs != null) {
- deobfuscatedEnvironment = true;
- } else {
- deobfuscatedEnvironment = false;
- }
- } catch (IOException e) {
- }
- return !deobfuscatedEnvironment;
- }
-
- @SuppressWarnings("rawtypes")
- public static Method getForgeMethod(Class c, String s, Class... varags) {
- String s1, s2;
- Method a, b;
- s1 = s;
- s2 = getSRG(s);
- try {
- a = ReflectionUtils.getMethod(c, s1, varags);
- if (a != null) {
- return a;
- }
- else {
- b = ReflectionUtils.getMethod(c, s2, varags);
- if (b != null) {
- return b;
- }
- }
- }
- catch (Exception e) {}
- return null;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ private static final DevHelper mInstance;
+ public static final boolean mIsValidHelper;
+ static {
+ mInstance = new DevHelper();
+ if (DevHelperInternals.init()) {
+ mIsValidHelper = true;
+ } else {
+ mIsValidHelper = false;
+ }
+ }
+ public DevHelper() {}
- private static synchronized final DevHelper getInstance() {
- return mInstance;
- }
+ public static boolean isObfuscatedEnvironment() {
+ // Are we in a 'decompiled' environment?
+ boolean deobfuscatedEnvironment = false;
+ byte[] bs;
+ try {
+ bs = Launch.classLoader.getClassBytes("net.minecraft.world.World");
+ if (bs != null) {
+ deobfuscatedEnvironment = true;
+ } else {
+ deobfuscatedEnvironment = false;
+ }
+ } catch (IOException e) {
+ }
+ return !deobfuscatedEnvironment;
+ }
- public static synchronized final boolean isValidHelperObject() {
- return mIsValidHelper;
- }
+ @SuppressWarnings("rawtypes")
+ public static Method getForgeMethod(Class c, String s, Class... varags) {
+ String s1, s2;
+ Method a, b;
+ s1 = s;
+ s2 = getSRG(s);
+ try {
+ a = ReflectionUtils.getMethod(c, s1, varags);
+ if (a != null) {
+ return a;
+ } else {
+ b = ReflectionUtils.getMethod(c, s2, varags);
+ if (b != null) {
+ return b;
+ }
+ }
+ } catch (Exception e) {
+ }
+ return null;
+ }
- public static String getSRG(String mForgeName) {
- String aSRG = DevHelperInternals.forgeToSrg.get(mForgeName);
- return aSRG != null ? aSRG : "BAD_SRG_NAME";
- }
+ private static final synchronized DevHelper getInstance() {
+ return mInstance;
+ }
- public static String getForge(String mSrgName) {
- String aForgeName = DevHelperInternals.srgToForge.get(mSrgName);
- return aForgeName != null ? aForgeName : "BAD_FORGE_NAME";
- }
+ public static final synchronized boolean isValidHelperObject() {
+ return mIsValidHelper;
+ }
- public static String getMinecraftClassName(String adeObName, boolean obfuscated) {
- if (obfuscated) {
- return getObfuscated(adeObName);
- }
- return adeObName;
- }
+ public static String getSRG(String mForgeName) {
+ String aSRG = DevHelperInternals.forgeToSrg.get(mForgeName);
+ return aSRG != null ? aSRG : "BAD_SRG_NAME";
+ }
- public static String getObfuscated(String mDeob) {
- String obfuscatedClassname = DevHelperInternals.deObToOb.get(mDeob);
- obfuscatedClassname = obfuscatedClassname != null ? obfuscatedClassname : "BAD_OBFUSCATED_CLASS_NAME";
- if (obfuscatedClassname.equals("BAD_OBFUSCATED_CLASS_NAME")) {
- Preloader_Logger.INFO("[Fix] Failed to Get Deobfuscated name for "+mDeob);
- }
- return obfuscatedClassname;
- }
+ public static String getForge(String mSrgName) {
+ String aForgeName = DevHelperInternals.srgToForge.get(mSrgName);
+ return aForgeName != null ? aForgeName : "BAD_FORGE_NAME";
+ }
- public static String getDeobfuscated(String mOb) {
- String deobfuscatedClassname = DevHelperInternals.obToDeOb.get(mOb);
- return deobfuscatedClassname != null ? deobfuscatedClassname : "BAD_DEOBFUSCATED_CLASS_NAME";
- }
+ public static String getMinecraftClassName(String adeObName, boolean obfuscated) {
+ if (obfuscated) {
+ return getObfuscated(adeObName);
+ }
+ return adeObName;
+ }
- public static class DevHelperInternals {
- public static final Map<String, String> srgToForge = new HashMap<String, String>();
- public static final Map<String, String> forgeToSrg = new HashMap<String, String>();
- private static WeakAutoMap<Pair<String, String>> mInitMap = new WeakAutoMap<Pair<String, String>>();
+ public static String getObfuscated(String mDeob) {
+ String obfuscatedClassname = DevHelperInternals.deObToOb.get(mDeob);
+ obfuscatedClassname = obfuscatedClassname != null ? obfuscatedClassname : "BAD_OBFUSCATED_CLASS_NAME";
+ if (obfuscatedClassname.equals("BAD_OBFUSCATED_CLASS_NAME")) {
+ Preloader_Logger.INFO("[Fix] Failed to Get Deobfuscated name for " + mDeob);
+ }
+ return obfuscatedClassname;
+ }
- //Obfuscation
- public static final Map<String, String> obToDeOb = new HashMap<String, String>();
- public static final Map<String, String> deObToOb = new HashMap<String, String>();
- private static WeakAutoMap<Pair<String, String>> mObInitMap = new WeakAutoMap<Pair<String, String>>();
+ public static String getDeobfuscated(String mOb) {
+ String deobfuscatedClassname = DevHelperInternals.obToDeOb.get(mOb);
+ return deobfuscatedClassname != null ? deobfuscatedClassname : "BAD_DEOBFUSCATED_CLASS_NAME";
+ }
- private static boolean init() {
- init1();
- init2();
- init3();
- init4();
- if (mInitMap.size() > 0) {
- for (Pair<String, String> p : mInitMap) {
- if (p != null) {
- String srg = p.getKey();
- String forge = p.getValue();
- srgToForge.put(srg, forge);
- forgeToSrg.put(forge, srg);
- }
- }
- }
+ public static class DevHelperInternals {
+ public static final Map<String, String> srgToForge = new HashMap<String, String>();
+ public static final Map<String, String> forgeToSrg = new HashMap<String, String>();
+ private static WeakAutoMap<Pair<String, String>> mInitMap = new WeakAutoMap<Pair<String, String>>();
- if (mObInitMap.size() > 0) {
- for (Pair<String, String> p : mObInitMap) {
- if (p != null) {
- String ob = p.getKey();
- String deOb = p.getValue();
- obToDeOb.put(ob, deOb);
- deObToOb.put(deOb, ob);
- }
- }
- }
- Preloader_Logger.INFO("[DevHelper] mInitMap size: "+mInitMap.size());
- Preloader_Logger.INFO("[DevHelper] mObInitMap size: "+mObInitMap.size());
+ // Obfuscation
+ public static final Map<String, String> obToDeOb = new HashMap<String, String>();
+ public static final Map<String, String> deObToOb = new HashMap<String, String>();
+ private static WeakAutoMap<Pair<String, String>> mObInitMap = new WeakAutoMap<Pair<String, String>>();
- Preloader_Logger.INFO("[DevHelper] srgToForge size: "+srgToForge.size());
- Preloader_Logger.INFO("[DevHelper] forgeToSrg size: "+forgeToSrg.size());
- Preloader_Logger.INFO("[DevHelper] obToDeOb size: "+obToDeOb.size());
- Preloader_Logger.INFO("[DevHelper] deObToOb size: "+deObToOb.size());
+ private static boolean init() {
+ init1();
+ init2();
+ init3();
+ init4();
+ if (mInitMap.size() > 0) {
+ for (Pair<String, String> p : mInitMap) {
+ if (p != null) {
+ String srg = p.getKey();
+ String forge = p.getValue();
+ srgToForge.put(srg, forge);
+ forgeToSrg.put(forge, srg);
+ }
+ }
+ }
- if (srgToForge.size() > 0 && forgeToSrg.size() > 0 && obToDeOb.size() > 0 && deObToOb.size() > 0) {
- if (srgToForge.size() == forgeToSrg.size() && obToDeOb.size() == deObToOb.size()) {
- return true;
- }
- else {
- if (srgToForge.size() != forgeToSrg.size()) {
- int aKey1 = 0;
- int aKey2 = 0;
- HashMap<Integer, String> aMissingForgeNames = new HashMap<Integer, String>();
- HashMap<Integer, String> aMissingSrgNames = new HashMap<Integer, String>();
- Preloader_Logger.INFO("Mismatch between mapped Forge and Srg names, finding missing values.");
- if (srgToForge.size() > forgeToSrg.size()) {
- Preloader_Logger.INFO("More SRG Keys detected.");
- for (String aKey : srgToForge.keySet()) {
- if (!forgeToSrg.containsValue(aKey)) {
- aMissingSrgNames.put(aKey1++, aKey);
- }
- }
- }
- else if (srgToForge.size() < forgeToSrg.size()) {
- Preloader_Logger.INFO("More Forge Keys detected.");
- for (String aKey : forgeToSrg.keySet()) {
- if (!srgToForge.containsValue(aKey)) {
- aMissingForgeNames.put(aKey2++, aKey);
- }
- }
- }
- if (!aMissingForgeNames.isEmpty()) {
- for (String missingVal : aMissingForgeNames.values()) {
- //Preloader_Logger.WARNING("Missing Forge value: "+missingVal);
- }
- }
- if (!aMissingSrgNames.isEmpty()) {
- for (String missingVal : aMissingSrgNames.values()) {
- //Preloader_Logger.WARNING("Missing SRG value: "+missingVal);
- }
- }
- }
- if (obToDeOb.size() != deObToOb.size()) {
- int aKey1 = 0;
- int aKey2 = 0;
- HashMap<Integer, String> aMissingObfNames = new HashMap<Integer, String>();
- HashMap<Integer, String> aMissingDeObfNames = new HashMap<Integer, String>();
- Preloader_Logger.INFO("Mismatch between mapped Obfuscated and Deobfuscated names, finding missing values.");
- if (obToDeOb.size() > deObToOb.size()) {
- Preloader_Logger.INFO("More Obfuscated Keys detected.");
- for (String aKey : obToDeOb.keySet()) {
- if (!deObToOb.containsValue(aKey)) {
- aMissingObfNames.put(aKey1++, aKey);
- }
- }
- }
- else if (obToDeOb.size() < deObToOb.size()) {
- Preloader_Logger.INFO("More Deobfuscated Keys detected.");
- for (String aKey : deObToOb.keySet()) {
- if (!obToDeOb.containsValue(aKey)) {
- aMissingDeObfNames.put(aKey2++, aKey);
- }
- }
- }
- if (!aMissingObfNames.isEmpty()) {
- for (String missingVal : aMissingObfNames.values()) {
- Preloader_Logger.WARNING("Missing Obfuscated value: "+missingVal);
- }
- }
- if (!aMissingDeObfNames.isEmpty()) {
- for (String missingVal : aMissingDeObfNames.values()) {
- Preloader_Logger.WARNING("Missing Deobfuscated value: "+missingVal);
- }
- }
- }
- }
- }
-
- // return true anyway as some keys will mismatch.
- return true;
- }
+ if (mObInitMap.size() > 0) {
+ for (Pair<String, String> p : mObInitMap) {
+ if (p != null) {
+ String ob = p.getKey();
+ String deOb = p.getValue();
+ obToDeOb.put(ob, deOb);
+ deObToOb.put(deOb, ob);
+ }
+ }
+ }
+ Preloader_Logger.INFO("[DevHelper] mInitMap size: " + mInitMap.size());
+ Preloader_Logger.INFO("[DevHelper] mObInitMap size: " + mObInitMap.size());
- private static void init1() {
- mInitMap.put(new Pair<String, String>("func_100011_g", "getIsPotionDurationMax"));
- mInitMap.put(new Pair<String, String>("func_100012_b", "setPotionDurationMax"));
- mInitMap.put(new Pair<String, String>("func_100015_a", "isKeyDown"));
- mInitMap.put(new Pair<String, String>("func_102007_a", "canInsertItem"));
- mInitMap.put(new Pair<String, String>("func_102008_b", "canExtractItem"));
- mInitMap.put(new Pair<String, String>("func_104002_bU", "isNoDespawnRequired"));
- mInitMap.put(new Pair<String, String>("func_104055_i", "setForceGamemode"));
- mInitMap.put(new Pair<String, String>("func_104056_am", "getForceGamemode"));
- mInitMap.put(new Pair<String, String>("func_104112_b", "saveExtraData"));
- mInitMap.put(new Pair<String, String>("func_104140_m", "saveChunkData"));
- mInitMap.put(new Pair<String, String>("func_110123_P", "onChunkLoad"));
- mInitMap.put(new Pair<String, String>("func_110124_au", "getUniqueID"));
- mInitMap.put(new Pair<String, String>("func_110125_a", "setParticleIcon"));
- mInitMap.put(new Pair<String, String>("func_110128_b", "onBroken"));
- mInitMap.put(new Pair<String, String>("func_110130_b", "getKnotForBlock"));
- mInitMap.put(new Pair<String, String>("func_110131_b", "removeFrameFromMap"));
- mInitMap.put(new Pair<String, String>("func_110138_aP", "getMaxHealth"));
- mInitMap.put(new Pair<String, String>("func_110139_bj", "getAbsorptionAmount"));
- mInitMap.put(new Pair<String, String>("func_110140_aT", "getAttributeMap"));
- mInitMap.put(new Pair<String, String>("func_110142_aN", "getCombatTracker"));
- mInitMap.put(new Pair<String, String>("func_110143_aJ", "getHealth"));
- mInitMap.put(new Pair<String, String>("func_110144_aD", "getLastAttacker"));
- mInitMap.put(new Pair<String, String>("func_110145_l", "dismountEntity"));
- mInitMap.put(new Pair<String, String>("func_110147_ax", "applyEntityAttributes"));
- mInitMap.put(new Pair<String, String>("func_110148_a", "getEntityAttribute"));
- mInitMap.put(new Pair<String, String>("func_110149_m", "setAbsorptionAmount"));
- mInitMap.put(new Pair<String, String>("func_110159_bB", "updateLeashedState"));
- mInitMap.put(new Pair<String, String>("func_110160_i", "clearLeashed"));
- mInitMap.put(new Pair<String, String>("func_110161_a", "onSpawnWithEgg"));
- mInitMap.put(new Pair<String, String>("func_110162_b", "setLeashedToEntity"));
- mInitMap.put(new Pair<String, String>("func_110163_bv", "enablePersistence"));
- mInitMap.put(new Pair<String, String>("func_110164_bC", "allowLeashing"));
- mInitMap.put(new Pair<String, String>("func_110165_bF", "recreateLeash"));
- mInitMap.put(new Pair<String, String>("func_110166_bE", "getLeashedToEntity"));
- mInitMap.put(new Pair<String, String>("func_110167_bD", "getLeashed"));
- mInitMap.put(new Pair<String, String>("func_110171_b", "setHomeArea"));
- mInitMap.put(new Pair<String, String>("func_110172_bL", "getHomePosition"));
- mInitMap.put(new Pair<String, String>("func_110173_bK", "isWithinHomeDistanceCurrentPosition"));
- mInitMap.put(new Pair<String, String>("func_110174_bM", "getMaximumHomeDistance"));
- mInitMap.put(new Pair<String, String>("func_110175_bO", "hasHome"));
- mInitMap.put(new Pair<String, String>("func_110176_b", "isWithinHomeDistance"));
- mInitMap.put(new Pair<String, String>("func_110177_bN", "detachHome"));
- mInitMap.put(new Pair<String, String>("func_110195_a", "addGrowth"));
- mInitMap.put(new Pair<String, String>("func_110198_t", "increaseTemper"));
- mInitMap.put(new Pair<String, String>("func_110199_f", "openGUI"));
- mInitMap.put(new Pair<String, String>("func_110200_cJ", "canMate"));
- mInitMap.put(new Pair<String, String>("func_110202_bQ", "getHorseVariant"));
- mInitMap.put(new Pair<String, String>("func_110204_cc", "isEatingHaystack"));
- mInitMap.put(new Pair<String, String>("func_110206_u", "setJumpPower"));
- mInitMap.put(new Pair<String, String>("func_110207_m", "setChested"));
- mInitMap.put(new Pair<String, String>("func_110208_b", "setHorseWatchableBoolean"));
- mInitMap.put(new Pair<String, String>("func_110209_cd", "isRearing"));
- mInitMap.put(new Pair<String, String>("func_110212_cp", "getVariantTexturePaths"));
- mInitMap.put(new Pair<String, String>("func_110214_p", "setHorseType"));
- mInitMap.put(new Pair<String, String>("func_110215_cj", "getHorseJumpStrength"));
- mInitMap.put(new Pair<String, String>("func_110216_r", "spawnHorseParticles"));
- mInitMap.put(new Pair<String, String>("func_110217_cl", "getAngrySoundName"));
- mInitMap.put(new Pair<String, String>("func_110218_cm", "getMaxTemper"));
- mInitMap.put(new Pair<String, String>("func_110219_q", "setRearing"));
- mInitMap.put(new Pair<String, String>("func_110220_cK", "makeHorseRear"));
- mInitMap.put(new Pair<String, String>("func_110221_n", "setHasReproduced"));
- mInitMap.put(new Pair<String, String>("func_110222_cv", "isSterile"));
- mInitMap.put(new Pair<String, String>("func_110223_p", "getRearingAmount"));
- mInitMap.put(new Pair<String, String>("func_110224_ci", "dropChests"));
- mInitMap.put(new Pair<String, String>("func_110227_p", "setEatingHaystack"));
- mInitMap.put(new Pair<String, String>("func_110228_bR", "isAdultHorse"));
- mInitMap.put(new Pair<String, String>("func_110229_cs", "canCarryChest"));
- mInitMap.put(new Pair<String, String>("func_110231_cz", "makeHorseRearWithSound"));
- mInitMap.put(new Pair<String, String>("func_110233_w", "getHorseWatchableBoolean"));
- mInitMap.put(new Pair<String, String>("func_110234_j", "setHorseTamed"));
- mInitMap.put(new Pair<String, String>("func_110235_q", "setHorseVariant"));
- mInitMap.put(new Pair<String, String>("func_110238_s", "setTemper"));
- mInitMap.put(new Pair<String, String>("func_110240_a", "dropItemsInChest"));
- mInitMap.put(new Pair<String, String>("func_110243_cf", "getHasReproduced"));
- mInitMap.put(new Pair<String, String>("func_110244_cA", "dropChestItems"));
- mInitMap.put(new Pair<String, String>("func_110246_bZ", "isHorseJumping"));
- mInitMap.put(new Pair<String, String>("func_110247_cG", "setHorseTexturePaths"));
- mInitMap.put(new Pair<String, String>("func_110248_bS", "isTame"));
- mInitMap.put(new Pair<String, String>("func_110249_cI", "openHorseMouth"));
- mInitMap.put(new Pair<String, String>("func_110250_a", "getClosestHorse"));
- mInitMap.put(new Pair<String, String>("func_110251_o", "setHorseSaddled"));
- mInitMap.put(new Pair<String, String>("func_110252_cg", "getTemper"));
- mInitMap.put(new Pair<String, String>("func_110254_bY", "getHorseSize"));
- mInitMap.put(new Pair<String, String>("func_110255_k", "setHorseJumping"));
- mInitMap.put(new Pair<String, String>("func_110256_cu", "isUndead"));
- mInitMap.put(new Pair<String, String>("func_110257_ck", "isHorseSaddled"));
- mInitMap.put(new Pair<String, String>("func_110258_o", "getGrassEatingAmount"));
- mInitMap.put(new Pair<String, String>("func_110259_cr", "canWearArmor"));
- mInitMap.put(new Pair<String, String>("func_110260_d", "getHorseArmorIndex"));
- mInitMap.put(new Pair<String, String>("func_110261_ca", "isChested"));
- mInitMap.put(new Pair<String, String>("func_110262_ch", "prepareChunkForSpawn"));
- mInitMap.put(new Pair<String, String>("func_110263_g", "setTamedBy"));
- mInitMap.put(new Pair<String, String>("func_110264_co", "getHorseTexture"));
- mInitMap.put(new Pair<String, String>("func_110265_bP", "getHorseType"));
- mInitMap.put(new Pair<String, String>("func_110297_a_", "verifySellingItem"));
- mInitMap.put(new Pair<String, String>("func_110298_a", "displayGUIHorse"));
- mInitMap.put(new Pair<String, String>("func_110303_q", "getLocationCape"));
- mInitMap.put(new Pair<String, String>("func_110304_a", "getDownloadImageSkin"));
- mInitMap.put(new Pair<String, String>("func_110306_p", "getLocationSkin"));
- mInitMap.put(new Pair<String, String>("func_110311_f", "getLocationSkin"));
- mInitMap.put(new Pair<String, String>("func_110317_t", "isRidingHorse"));
- mInitMap.put(new Pair<String, String>("func_110318_g", "sendHorseJump"));
- mInitMap.put(new Pair<String, String>("func_110319_bJ", "getHorseJumpPower"));
- mInitMap.put(new Pair<String, String>("func_110322_i", "sendHorseInteraction"));
- mInitMap.put(new Pair<String, String>("func_110326_a", "setRecordPlaying"));
- mInitMap.put(new Pair<String, String>("func_110327_a", "renderIcons"));
- mInitMap.put(new Pair<String, String>("func_110430_a", "setEntityActionState"));
- mInitMap.put(new Pair<String, String>("func_110432_I", "getSession"));
- mInitMap.put(new Pair<String, String>("func_110434_K", "getTextureManager"));
- mInitMap.put(new Pair<String, String>("func_110435_P", "addDefaultResourcePack"));
- mInitMap.put(new Pair<String, String>("func_110436_a", "refreshResources"));
- mInitMap.put(new Pair<String, String>("func_110437_J", "getProxy"));
- mInitMap.put(new Pair<String, String>("func_110438_M", "getResourcePackRepository"));
- mInitMap.put(new Pair<String, String>("func_110441_Q", "updateDisplayMode"));
- mInitMap.put(new Pair<String, String>("func_110442_L", "getResourceManager"));
- mInitMap.put(new Pair<String, String>("func_110454_ao", "getServerProxy"));
- mInitMap.put(new Pair<String, String>("func_110455_j", "getOpPermissionLevel"));
- mInitMap.put(new Pair<String, String>("func_110462_b", "getPackFormat"));
- mInitMap.put(new Pair<String, String>("func_110468_c", "getFrameIndex"));
- mInitMap.put(new Pair<String, String>("func_110469_d", "getFrameTime"));
- mInitMap.put(new Pair<String, String>("func_110470_b", "frameHasTime"));
- mInitMap.put(new Pair<String, String>("func_110471_a", "getFrameHeight"));
- mInitMap.put(new Pair<String, String>("func_110472_a", "getFrameTimeSingle"));
- mInitMap.put(new Pair<String, String>("func_110473_c", "getFrameCount"));
- mInitMap.put(new Pair<String, String>("func_110474_b", "getFrameWidth"));
- mInitMap.put(new Pair<String, String>("func_110479_a", "getTextureBlur"));
- mInitMap.put(new Pair<String, String>("func_110480_b", "getTextureClamp"));
- mInitMap.put(new Pair<String, String>("func_110483_a", "getSectionName"));
- mInitMap.put(new Pair<String, String>("func_110492_a", "parseAnimationFrame"));
- mInitMap.put(new Pair<String, String>("func_110495_a", "hasNoTime"));
- mInitMap.put(new Pair<String, String>("func_110496_c", "getFrameIndex"));
- mInitMap.put(new Pair<String, String>("func_110497_b", "getFrameTime"));
- mInitMap.put(new Pair<String, String>("func_110503_a", "parseMetadataSection"));
- mInitMap.put(new Pair<String, String>("func_110504_a", "registerMetadataSectionType"));
- mInitMap.put(new Pair<String, String>("func_110505_a", "getGson"));
- mInitMap.put(new Pair<String, String>("func_110514_c", "getResourcePack"));
- mInitMap.put(new Pair<String, String>("func_110515_d", "getResourcePackName"));
- mInitMap.put(new Pair<String, String>("func_110516_a", "updateResourcePack"));
- mInitMap.put(new Pair<String, String>("func_110517_b", "closeResourcePack"));
- mInitMap.put(new Pair<String, String>("func_110518_a", "bindTexturePackIcon"));
- mInitMap.put(new Pair<String, String>("func_110519_e", "getTexturePackDescription"));
- mInitMap.put(new Pair<String, String>("func_110526_a", "getMetadata"));
- mInitMap.put(new Pair<String, String>("func_110527_b", "getInputStream"));
- mInitMap.put(new Pair<String, String>("func_110528_c", "hasMetadata"));
- mInitMap.put(new Pair<String, String>("func_110536_a", "getResource"));
- mInitMap.put(new Pair<String, String>("func_110537_b", "getLocationMcmeta"));
- mInitMap.put(new Pair<String, String>("func_110538_a", "addResourcePack"));
- mInitMap.put(new Pair<String, String>("func_110541_a", "reloadResources"));
- mInitMap.put(new Pair<String, String>("func_110542_a", "registerReloadListener"));
- mInitMap.put(new Pair<String, String>("func_110543_a", "clearResources"));
- mInitMap.put(new Pair<String, String>("func_110544_b", "notifyReloadListeners"));
- mInitMap.put(new Pair<String, String>("func_110545_a", "reloadResourcePack"));
- mInitMap.put(new Pair<String, String>("func_110549_a", "onResourceManagerReload"));
- mInitMap.put(new Pair<String, String>("func_110550_d", "tick"));
- mInitMap.put(new Pair<String, String>("func_110551_a", "loadTexture"));
- mInitMap.put(new Pair<String, String>("func_110552_b", "getGlTextureId"));
- mInitMap.put(new Pair<String, String>("func_110564_a", "updateDynamicTexture"));
- mInitMap.put(new Pair<String, String>("func_110565_c", "getTextureData"));
- mInitMap.put(new Pair<String, String>("func_110569_e", "initMissingImage"));
- mInitMap.put(new Pair<String, String>("func_110571_b", "loadTextureAtlas"));
- mInitMap.put(new Pair<String, String>("func_110572_b", "getAtlasSprite"));
- mInitMap.put(new Pair<String, String>("func_110573_f", "registerIcons"));
- mInitMap.put(new Pair<String, String>("func_110577_a", "bindTexture"));
- mInitMap.put(new Pair<String, String>("func_110578_a", "getDynamicTextureLocation"));
- mInitMap.put(new Pair<String, String>("func_110579_a", "loadTexture"));
- mInitMap.put(new Pair<String, String>("func_110580_a", "loadTickableTexture"));
- mInitMap.put(new Pair<String, String>("func_110581_b", "getTexture"));
- mInitMap.put(new Pair<String, String>("func_110586_a", "getPackImage"));
- mInitMap.put(new Pair<String, String>("func_110587_b", "getResourceDomains"));
- mInitMap.put(new Pair<String, String>("func_110589_b", "resourceExists"));
- mInitMap.put(new Pair<String, String>("func_110590_a", "getInputStream"));
- mInitMap.put(new Pair<String, String>("func_110591_a", "getInputStreamByName"));
- mInitMap.put(new Pair<String, String>("func_110592_c", "locationToName"));
- mInitMap.put(new Pair<String, String>("func_110593_b", "hasResourceName"));
- mInitMap.put(new Pair<String, String>("func_110594_c", "logNameNotLowercase"));
- mInitMap.put(new Pair<String, String>("func_110595_a", "getRelativeName"));
- mInitMap.put(new Pair<String, String>("func_110596_a", "readMetadata"));
- mInitMap.put(new Pair<String, String>("func_110599_c", "getResourcePackZipFile"));
- mInitMap.put(new Pair<String, String>("func_110605_c", "getResourceStream"));
- mInitMap.put(new Pair<String, String>("func_110609_b", "getRepositoryEntriesAll"));
- mInitMap.put(new Pair<String, String>("func_110611_a", "updateRepositoryEntriesAll"));
- mInitMap.put(new Pair<String, String>("func_110612_e", "getDirResourcepacks"));
- mInitMap.put(new Pair<String, String>("func_110613_c", "getRepositoryEntries"));
- mInitMap.put(new Pair<String, String>("func_110614_g", "getResourcePackFiles"));
- mInitMap.put(new Pair<String, String>("func_110616_f", "fixDirResourcepacks"));
- mInitMap.put(new Pair<String, String>("func_110623_a", "getResourcePath"));
- mInitMap.put(new Pair<String, String>("func_110624_b", "getResourceDomain"));
- mInitMap.put(new Pair<String, String>("func_110646_a", "getTextWithoutFormattingCodes"));
- mInitMap.put(new Pair<String, String>("func_110647_a", "getOSType"));
- mInitMap.put(new Pair<String, String>("func_110661_a", "parseDouble"));
- mInitMap.put(new Pair<String, String>("func_110662_c", "parseBoolean"));
- mInitMap.put(new Pair<String, String>("func_110664_a", "parseDouble"));
- mInitMap.put(new Pair<String, String>("func_110665_a", "clamp_double"));
- mInitMap.put(new Pair<String, String>("func_110666_a", "clamp_coord"));
- mInitMap.put(new Pair<String, String>("func_110682_a", "setBoxRotation"));
- mInitMap.put(new Pair<String, String>("func_110683_a", "updateHorseRotation"));
- mInitMap.put(new Pair<String, String>("func_110738_j", "isRidingHorse"));
- mInitMap.put(new Pair<String, String>("func_110775_a", "getEntityTexture"));
- mInitMap.put(new Pair<String, String>("func_110776_a", "bindTexture"));
- mInitMap.put(new Pair<String, String>("func_110777_b", "bindEntityTexture"));
- mInitMap.put(new Pair<String, String>("func_110813_b", "canRenderName"));
- mInitMap.put(new Pair<String, String>("func_110934_a", "addSprite"));
- mInitMap.put(new Pair<String, String>("func_110935_a", "getCurrentWidth"));
- mInitMap.put(new Pair<String, String>("func_110936_b", "getCurrentHeight"));
- mInitMap.put(new Pair<String, String>("func_110966_b", "setIconWidth"));
- mInitMap.put(new Pair<String, String>("func_110967_i", "getOriginY"));
- mInitMap.put(new Pair<String, String>("func_110968_a", "setFramesTextureData"));
- mInitMap.put(new Pair<String, String>("func_110969_c", "setIconHeight"));
- mInitMap.put(new Pair<String, String>("func_110970_k", "getFrameCount"));
- mInitMap.put(new Pair<String, String>("func_110971_a", "initSprite"));
- mInitMap.put(new Pair<String, String>("func_110985_a", "updateAnaglyph"));
- mInitMap.put(new Pair<String, String>("func_110986_a", "readImageData"));
- mInitMap.put(new Pair<String, String>("func_110987_a", "uploadTextureImage"));
- mInitMap.put(new Pair<String, String>("func_110988_a", "uploadTexture"));
- mInitMap.put(new Pair<String, String>("func_110989_a", "uploadTextureImageAllocate"));
- mInitMap.put(new Pair<String, String>("func_110990_a", "copyToBuffer"));
- mInitMap.put(new Pair<String, String>("func_110991_a", "allocateTexture"));
- mInitMap.put(new Pair<String, String>("func_110993_a", "uploadTextureImageSubImpl"));
- mInitMap.put(new Pair<String, String>("func_110994_a", "copyToBufferPos"));
- mInitMap.put(new Pair<String, String>("func_110995_a", "uploadTextureImageSub"));
- mInitMap.put(new Pair<String, String>("func_110996_a", "glGenTextures"));
- mInitMap.put(new Pair<String, String>("func_110997_a", "setTextureClamped"));
- mInitMap.put(new Pair<String, String>("func_111108_a", "getAttributeUnlocalizedName"));
- mInitMap.put(new Pair<String, String>("func_111109_a", "clampValue"));
- mInitMap.put(new Pair<String, String>("func_111110_b", "getDefaultValue"));
- mInitMap.put(new Pair<String, String>("func_111111_c", "getShouldWatch"));
- mInitMap.put(new Pair<String, String>("func_111112_a", "setShouldWatch"));
- mInitMap.put(new Pair<String, String>("func_111116_f", "getDescription"));
- mInitMap.put(new Pair<String, String>("func_111117_a", "setDescription"));
- mInitMap.put(new Pair<String, String>("func_111121_a", "applyModifier"));
- mInitMap.put(new Pair<String, String>("func_111123_a", "getAttribute"));
- mInitMap.put(new Pair<String, String>("func_111124_b", "removeModifier"));
- mInitMap.put(new Pair<String, String>("func_111125_b", "getBaseValue"));
- mInitMap.put(new Pair<String, String>("func_111126_e", "getAttributeValue"));
- mInitMap.put(new Pair<String, String>("func_111127_a", "getModifier"));
- mInitMap.put(new Pair<String, String>("func_111128_a", "setBaseValue"));
- mInitMap.put(new Pair<String, String>("func_111129_g", "computeValue"));
- mInitMap.put(new Pair<String, String>("func_111130_a", "getModifiersByOperation"));
- mInitMap.put(new Pair<String, String>("func_111131_f", "flagForUpdate"));
- mInitMap.put(new Pair<String, String>("func_111145_d", "getWatchableObjectFloat"));
- mInitMap.put(new Pair<String, String>("func_111146_a", "getAllAttributes"));
- mInitMap.put(new Pair<String, String>("func_111147_b", "applyAttributeModifiers"));
- mInitMap.put(new Pair<String, String>("func_111148_a", "removeAttributeModifiers"));
- mInitMap.put(new Pair<String, String>("func_111149_a", "addAttributeInstance"));
- mInitMap.put(new Pair<String, String>("func_111150_b", "registerAttribute"));
- mInitMap.put(new Pair<String, String>("func_111151_a", "getAttributeInstance"));
- mInitMap.put(new Pair<String, String>("func_111152_a", "getAttributeInstanceByName"));
- mInitMap.put(new Pair<String, String>("func_111160_c", "getWatchedAttributes"));
- mInitMap.put(new Pair<String, String>("func_111161_b", "getAttributeInstanceSet"));
- mInitMap.put(new Pair<String, String>("func_111164_d", "getAmount"));
- mInitMap.put(new Pair<String, String>("func_111165_e", "isSaved"));
- mInitMap.put(new Pair<String, String>("func_111166_b", "getName"));
- mInitMap.put(new Pair<String, String>("func_111167_a", "getID"));
- mInitMap.put(new Pair<String, String>("func_111168_a", "setSaved"));
- mInitMap.put(new Pair<String, String>("func_111169_c", "getOperation"));
- mInitMap.put(new Pair<String, String>("func_111175_f", "getTargetDistance"));
- mInitMap.put(new Pair<String, String>("func_111184_a", "registerPotionAttributeModifier"));
- mInitMap.put(new Pair<String, String>("func_111185_a", "applyAttributesModifiersToEntity"));
- mInitMap.put(new Pair<String, String>("func_111187_a", "removeAttributesModifiersFromEntity"));
- mInitMap.put(new Pair<String, String>("func_111190_b", "sendMetadataToAllAssociatedPlayers"));
- mInitMap.put(new Pair<String, String>("func_111194_a", "processChunk"));
- mInitMap.put(new Pair<String, String>("func_111196_a", "increaseInhabitedTime"));
- mInitMap.put(new Pair<String, String>("func_111205_h", "getItemAttributeModifiers"));
- mInitMap.put(new Pair<String, String>("func_111206_d", "setTextureName"));
- mInitMap.put(new Pair<String, String>("func_111207_a", "itemInteractionForEntity"));
- mInitMap.put(new Pair<String, String>("func_111208_A", "getIconString"));
- mInitMap.put(new Pair<String, String>("func_111225_m", "getRelevantEnchantmentTypes"));
- mInitMap.put(new Pair<String, String>("func_111229_a", "setRelevantEnchantmentTypes"));
- mInitMap.put(new Pair<String, String>("func_111238_b", "canBeHovered"));
- mInitMap.put(new Pair<String, String>("func_111257_a", "writeBaseAttributeMapToNBT"));
- mInitMap.put(new Pair<String, String>("func_111258_a", "applyModifiersToAttributeInstance"));
- mInitMap.put(new Pair<String, String>("func_111259_a", "readAttributeModifierFromNBT"));
- mInitMap.put(new Pair<String, String>("func_111261_a", "writeAttributeInstanceToNBT"));
- mInitMap.put(new Pair<String, String>("func_111262_a", "writeAttributeModifierToNBT"));
- mInitMap.put(new Pair<String, String>("func_111269_d", "getPathSearchRange"));
- mInitMap.put(new Pair<String, String>("func_111270_a", "union"));
- mInitMap.put(new Pair<String, String>("func_111271_a", "getUnicodePageLocation"));
- mInitMap.put(new Pair<String, String>("func_111272_d", "readFontTexture"));
- mInitMap.put(new Pair<String, String>("func_111282_a", "interactWithEntity"));
- mInitMap.put(new Pair<String, String>("func_111283_C", "getAttributeModifiers"));
- mInitMap.put(new Pair<String, String>("func_111285_a", "getUsername"));
- mInitMap.put(new Pair<String, String>("func_111286_b", "getSessionID"));
- mInitMap.put(new Pair<String, String>("func_120011_ar", "setGuiEnabled"));
- mInitMap.put(new Pair<String, String>("func_120016_a", "createServerGui"));
- mInitMap.put(new Pair<String, String>("func_120018_d", "getLogComponent"));
- mInitMap.put(new Pair<String, String>("func_120019_b", "getStatsComponent"));
- mInitMap.put(new Pair<String, String>("func_120020_c", "getPlayerListComponent"));
- mInitMap.put(new Pair<String, String>("func_130001_d", "getCurrentMoonPhaseFactor"));
- mInitMap.put(new Pair<String, String>("func_130002_c", "interactFirst"));
- mInitMap.put(new Pair<String, String>("func_130010_a", "getOriginX"));
- mInitMap.put(new Pair<String, String>("func_130011_c", "setLastAttacker"));
- mInitMap.put(new Pair<String, String>("func_130014_f_", "getEntityWorld"));
- mInitMap.put(new Pair<String, String>("func_130071_aq", "getCurrentTimeMillis"));
- mInitMap.put(new Pair<String, String>("func_130072_d", "getAnimationFrame"));
- mInitMap.put(new Pair<String, String>("func_130073_e", "getFrameIndexSet"));
- mInitMap.put(new Pair<String, String>("func_130077_b", "getPackName"));
- mInitMap.put(new Pair<String, String>("func_130086_a", "getTextureType"));
- mInitMap.put(new Pair<String, String>("func_130087_a", "getResourceLocation"));
- mInitMap.put(new Pair<String, String>("func_130088_a", "loadTextureMap"));
- mInitMap.put(new Pair<String, String>("func_130098_m", "hasAnimationMetadata"));
- mInitMap.put(new Pair<String, String>("func_130099_d", "allocateFrameTextureData"));
- mInitMap.put(new Pair<String, String>("func_130102_n", "resetSprite"));
- mInitMap.put(new Pair<String, String>("func_130103_l", "clearFramesTextureData"));
- mInitMap.put(new Pair<String, String>("func_130105_g", "getMinecraftStartTimeMillis"));
- mInitMap.put(new Pair<String, String>("func_135016_M", "getLanguageManager"));
- mInitMap.put(new Pair<String, String>("func_135018_a", "getLanguages"));
- mInitMap.put(new Pair<String, String>("func_135021_a", "loadLocaleData"));
- mInitMap.put(new Pair<String, String>("func_135022_a", "loadLocaleDataFiles"));
- mInitMap.put(new Pair<String, String>("func_135023_a", "formatMessage"));
- mInitMap.put(new Pair<String, String>("func_135024_b", "checkUnicode"));
- mInitMap.put(new Pair<String, String>("func_135025_a", "isUnicode"));
- mInitMap.put(new Pair<String, String>("func_135026_c", "translateKeyPrivate"));
- mInitMap.put(new Pair<String, String>("func_135028_a", "loadLocaleData"));
- mInitMap.put(new Pair<String, String>("func_135034_a", "getLanguageCode"));
- mInitMap.put(new Pair<String, String>("func_135035_b", "isBidirectional"));
- mInitMap.put(new Pair<String, String>("func_135040_d", "getLanguages"));
- mInitMap.put(new Pair<String, String>("func_135041_c", "getCurrentLanguage"));
- mInitMap.put(new Pair<String, String>("func_135042_a", "isCurrentLocaleUnicode"));
- mInitMap.put(new Pair<String, String>("func_135043_a", "parseLanguageMetadata"));
- mInitMap.put(new Pair<String, String>("func_135044_b", "isCurrentLanguageBidirectional"));
- mInitMap.put(new Pair<String, String>("func_135045_a", "setCurrentLanguage"));
- mInitMap.put(new Pair<String, String>("func_135051_a", "setLocale"));
- mInitMap.put(new Pair<String, String>("func_135052_a", "format"));
- mInitMap.put(new Pair<String, String>("func_135055_a", "getResourceDomains"));
- mInitMap.put(new Pair<String, String>("func_135056_b", "getAllResources"));
- mInitMap.put(new Pair<String, String>("func_135058_a", "getPackMetadata"));
- mInitMap.put(new Pair<String, String>("func_135063_a", "replaceWith"));
- mInitMap.put(new Pair<String, String>("func_135064_c", "tryTranslateKey"));
- mInitMap.put(new Pair<String, String>("func_140005_i", "switchToRealms"));
- mInitMap.put(new Pair<String, String>("func_142008_O", "shouldSetPosAfterLoading"));
- mInitMap.put(new Pair<String, String>("func_142012_a", "isOnTeam"));
- mInitMap.put(new Pair<String, String>("func_142013_aG", "getLastAttackerTime"));
- mInitMap.put(new Pair<String, String>("func_142014_c", "isOnSameTeam"));
- mInitMap.put(new Pair<String, String>("func_142015_aE", "getRevengeTimer"));
- mInitMap.put(new Pair<String, String>("func_142020_c", "setClientBrand"));
- mInitMap.put(new Pair<String, String>("func_142021_k", "getClientBrand"));
- mInitMap.put(new Pair<String, String>("func_142049_d", "removeAllModifiers"));
- mInitMap.put(new Pair<String, String>("func_142053_d", "formatString"));
- mInitMap.put(new Pair<String, String>("func_142054_a", "isSameTeam"));
- mInitMap.put(new Pair<String, String>("func_143004_u", "markPlayerActive"));
- mInitMap.put(new Pair<String, String>("func_143006_e", "setPlayerIdleTimeout"));
- mInitMap.put(new Pair<String, String>("func_143007_ar", "getMaxPlayerIdleMinutes"));
- mInitMap.put(new Pair<String, String>("func_143011_b", "readStructureFromNBT"));
- mInitMap.put(new Pair<String, String>("func_143012_a", "writeStructureToNBT"));
- mInitMap.put(new Pair<String, String>("func_143016_a", "registerVillagePieces"));
- mInitMap.put(new Pair<String, String>("func_143025_a", "getStructureName"));
- mInitMap.put(new Pair<String, String>("func_143031_a", "registerStructureComponent"));
- mInitMap.put(new Pair<String, String>("func_143034_b", "registerStructure"));
- mInitMap.put(new Pair<String, String>("func_143045_a", "registerScatteredFeaturePieces"));
- mInitMap.put(new Pair<String, String>("func_143046_a", "registerStrongholdPieces"));
- mInitMap.put(new Pair<String, String>("func_143048_a", "registerStructurePieces"));
- mInitMap.put(new Pair<String, String>("func_143049_a", "registerNetherFortressPieces"));
- mInitMap.put(new Pair<String, String>("func_145747_a", "addChatMessage"));
- mInitMap.put(new Pair<String, String>("func_145748_c_", "getFormattedCommandSenderName"));
- mInitMap.put(new Pair<String, String>("func_145749_h", "getLastOutput"));
- mInitMap.put(new Pair<String, String>("func_145752_a", "setCommand"));
- mInitMap.put(new Pair<String, String>("func_145753_i", "getCustomName"));
- mInitMap.put(new Pair<String, String>("func_145758_a", "writeDataToNBT"));
- mInitMap.put(new Pair<String, String>("func_145759_b", "readDataFromNBT"));
- mInitMap.put(new Pair<String, String>("func_145760_g", "getSuccessCount"));
- mInitMap.put(new Pair<String, String>("func_145769_d", "setEntityId"));
- mInitMap.put(new Pair<String, String>("func_145770_h", "isInRangeToRender3d"));
- mInitMap.put(new Pair<String, String>("func_145771_j", "pushOutOfBlocks"));
- mInitMap.put(new Pair<String, String>("func_145772_a", "getExplosionResistance"));
- mInitMap.put(new Pair<String, String>("func_145773_az", "doesEntityNotTriggerPressurePlate"));
- mInitMap.put(new Pair<String, String>("func_145775_I", "doBlockCollisions"));
- mInitMap.put(new Pair<String, String>("func_145776_H", "getSwimSound"));
- mInitMap.put(new Pair<String, String>("func_145777_O", "getSplashSound"));
- mInitMap.put(new Pair<String, String>("func_145778_a", "dropItemWithOffset"));
- mInitMap.put(new Pair<String, String>("func_145779_a", "dropItem"));
- mInitMap.put(new Pair<String, String>("func_145780_a", "playStepSound"));
- mInitMap.put(new Pair<String, String>("func_145782_y", "getEntityId"));
- mInitMap.put(new Pair<String, String>("func_145797_a", "setOwner"));
- mInitMap.put(new Pair<String, String>("func_145798_i", "getOwner"));
- mInitMap.put(new Pair<String, String>("func_145799_b", "setThrower"));
- mInitMap.put(new Pair<String, String>("func_145800_j", "getThrower"));
- mInitMap.put(new Pair<String, String>("func_145805_f", "getBlock"));
- mInitMap.put(new Pair<String, String>("func_145806_a", "setHurtEntities"));
- mInitMap.put(new Pair<String, String>("func_145807_e", "getWorldObj"));
- mInitMap.put(new Pair<String, String>("func_145817_o", "getDefaultDisplayTile"));
- mInitMap.put(new Pair<String, String>("func_145818_k_", "isCustomInventoryName"));
- mInitMap.put(new Pair<String, String>("func_145820_n", "getDisplayTile"));
- mInitMap.put(new Pair<String, String>("func_145825_b", "getInventoryName"));
- mInitMap.put(new Pair<String, String>("func_145826_a", "addMapping"));
- mInitMap.put(new Pair<String, String>("func_145827_c", "createAndLoadEntity"));
- mInitMap.put(new Pair<String, String>("func_145828_a", "addInfoToCrashReport"));
- mInitMap.put(new Pair<String, String>("func_145829_t", "validate"));
- mInitMap.put(new Pair<String, String>("func_145830_o", "hasWorldObj"));
- mInitMap.put(new Pair<String, String>("func_145831_w", "getWorld"));
- mInitMap.put(new Pair<String, String>("func_145832_p", "getBlockMetadata"));
- mInitMap.put(new Pair<String, String>("func_145833_n", "getMaxRenderDistanceSquared"));
- mInitMap.put(new Pair<String, String>("func_145834_a", "setWorldObj"));
- mInitMap.put(new Pair<String, String>("func_145835_a", "getDistanceSq"));
- mInitMap.put(new Pair<String, String>("func_145836_u", "updateContainingBlockInfo"));
- mInitMap.put(new Pair<String, String>("func_145837_r", "isInvalid"));
- mInitMap.put(new Pair<String, String>("func_145838_q", "getBlockType"));
- mInitMap.put(new Pair<String, String>("func_145839_a", "readFromNBT"));
- mInitMap.put(new Pair<String, String>("func_145841_b", "writeToNBT"));
- mInitMap.put(new Pair<String, String>("func_145842_c", "receiveClientEvent"));
- mInitMap.put(new Pair<String, String>("func_145843_s", "invalidate"));
- mInitMap.put(new Pair<String, String>("func_145844_m", "getDescriptionPacket"));
- mInitMap.put(new Pair<String, String>("func_145845_h", "updateEntity"));
- mInitMap.put(new Pair<String, String>("func_145861_a", "getStoredBlockID"));
- mInitMap.put(new Pair<String, String>("func_145864_c", "getPistonOrientation"));
- mInitMap.put(new Pair<String, String>("func_145866_f", "clearPistonTileEntity"));
- mInitMap.put(new Pair<String, String>("func_145867_d", "shouldPistonHeadBeRendered"));
- mInitMap.put(new Pair<String, String>("func_145868_b", "isExtending"));
- mInitMap.put(new Pair<String, String>("func_145877_a", "changePitch"));
- mInitMap.put(new Pair<String, String>("func_145878_a", "triggerNote"));
- mInitMap.put(new Pair<String, String>("func_145888_j", "isOnTransferCooldown"));
- mInitMap.put(new Pair<String, String>("func_145896_c", "setTransferCooldown"));
- mInitMap.put(new Pair<String, String>("func_145903_a", "setSkullRotation"));
- mInitMap.put(new Pair<String, String>("func_145904_a", "getSkullType"));
- mInitMap.put(new Pair<String, String>("func_145906_b", "getSkullRotation"));
- mInitMap.put(new Pair<String, String>("func_145913_a", "setEditable"));
- mInitMap.put(new Pair<String, String>("func_145914_a", "getIsEditable"));
- mInitMap.put(new Pair<String, String>("func_145934_k", "canBrew"));
- mInitMap.put(new Pair<String, String>("func_145935_i", "getBrewTime"));
- mInitMap.put(new Pair<String, String>("func_145938_d", "setBrewTime"));
- mInitMap.put(new Pair<String, String>("func_145939_j", "getFilledSlots"));
- mInitMap.put(new Pair<String, String>("func_145940_l", "brewPotions"));
- mInitMap.put(new Pair<String, String>("func_145948_k", "canSmelt"));
- mInitMap.put(new Pair<String, String>("func_145949_j", "smeltItem"));
- mInitMap.put(new Pair<String, String>("func_145950_i", "isBurning"));
- mInitMap.put(new Pair<String, String>("func_145951_a", "setCustomInventoryName"));
- mInitMap.put(new Pair<String, String>("func_145952_a", "getItemBurnTime"));
- mInitMap.put(new Pair<String, String>("func_145953_d", "getCookProgressScaled"));
- mInitMap.put(new Pair<String, String>("func_145954_b", "isItemFuel"));
- mInitMap.put(new Pair<String, String>("func_145955_e", "getBurnTimeRemainingScaled"));
- mInitMap.put(new Pair<String, String>("func_145965_a", "getFlowerPotItem"));
- mInitMap.put(new Pair<String, String>("func_145966_b", "getFlowerPotData"));
- mInitMap.put(new Pair<String, String>("func_145976_a", "setCustomName"));
- mInitMap.put(new Pair<String, String>("func_145977_a", "isSameTypeChestAt"));
- mInitMap.put(new Pair<String, String>("func_145979_i", "checkForAdjacentChests"));
- mInitMap.put(new Pair<String, String>("func_145980_j", "getChestType"));
- mInitMap.put(new Pair<String, String>("func_145995_a", "setOutputSignal"));
- mInitMap.put(new Pair<String, String>("func_145996_a", "getOutputSignal"));
- mInitMap.put(new Pair<String, String>("func_145998_l", "getLevels"));
- mInitMap.put(new Pair<String, String>("func_146001_d", "setPrimaryEffect"));
- mInitMap.put(new Pair<String, String>("func_146002_i", "shouldBeamRender"));
- mInitMap.put(new Pair<String, String>("func_146004_e", "setSecondaryEffect"));
- mInitMap.put(new Pair<String, String>("func_146006_k", "getSecondaryEffect"));
- mInitMap.put(new Pair<String, String>("func_146007_j", "getPrimaryEffect"));
- mInitMap.put(new Pair<String, String>("func_146023_a", "getStrVsBlock"));
- mInitMap.put(new Pair<String, String>("func_146024_c", "getInventorySlotContainItemAndDamage"));
- mInitMap.put(new Pair<String, String>("func_146026_a", "consumeInventoryItem"));
- mInitMap.put(new Pair<String, String>("func_146027_a", "clearInventory"));
- mInitMap.put(new Pair<String, String>("func_146028_b", "hasItem"));
- mInitMap.put(new Pair<String, String>("func_146029_c", "getInventorySlotContainItem"));
- mInitMap.put(new Pair<String, String>("func_146030_a", "setCurrentItem"));
- mInitMap.put(new Pair<String, String>("func_146031_a", "setChestTileEntity"));
- mInitMap.put(new Pair<String, String>("func_146034_e", "handleHookRetraction"));
- mInitMap.put(new Pair<String, String>("func_146035_c", "handleHookCasting"));
- mInitMap.put(new Pair<String, String>("func_146068_u", "getDropItem"));
- mInitMap.put(new Pair<String, String>("func_146080_bZ", "getCarriedBlock"));
- mInitMap.put(new Pair<String, String>("func_146081_a", "setCarriedBlock"));
- mInitMap.put(new Pair<String, String>("func_146082_f", "setInLove"));
- mInitMap.put(new Pair<String, String>("func_146086_d", "setHorseArmorStack"));
- mInitMap.put(new Pair<String, String>("func_146094_a", "getUUID"));
- mInitMap.put(new Pair<String, String>("func_146096_a", "getBreakSpeed"));
- mInitMap.put(new Pair<String, String>("func_146099_a", "canHarvestBlock"));
- mInitMap.put(new Pair<String, String>("func_146100_a", "displayGUIEditSign"));
- mInitMap.put(new Pair<String, String>("func_146103_bH", "getGameProfile"));
- mInitMap.put(new Pair<String, String>("func_146105_b", "addChatComponentMessage"));
- mInitMap.put(new Pair<String, String>("func_146107_m", "getStatFileWriter"));
- mInitMap.put(new Pair<String, String>("func_146110_a", "drawModalRectWithCustomSizedTexture"));
- mInitMap.put(new Pair<String, String>("func_146111_b", "drawButtonForegroundLayer"));
- mInitMap.put(new Pair<String, String>("func_146112_a", "drawButton"));
- mInitMap.put(new Pair<String, String>("func_146113_a", "playPressSound"));
- mInitMap.put(new Pair<String, String>("func_146114_a", "getHoverState"));
- mInitMap.put(new Pair<String, String>("func_146115_a", "isMouseOver"));
- mInitMap.put(new Pair<String, String>("func_146116_c", "mousePressed"));
- mInitMap.put(new Pair<String, String>("func_146117_b", "getButtonWidth"));
- mInitMap.put(new Pair<String, String>("func_146118_a", "mouseReleased"));
- mInitMap.put(new Pair<String, String>("func_146119_b", "mouseDragged"));
- mInitMap.put(new Pair<String, String>("func_146136_c", "returnEnumOptions"));
- mInitMap.put(new Pair<String, String>("func_146158_b", "getChatGUI"));
- mInitMap.put(new Pair<String, String>("func_146159_a", "drawLabel"));
- mInitMap.put(new Pair<String, String>("func_146160_b", "drawLabelBackground"));
- mInitMap.put(new Pair<String, String>("func_146175_b", "deleteFromCursor"));
- mInitMap.put(new Pair<String, String>("func_146176_q", "getVisible"));
- mInitMap.put(new Pair<String, String>("func_146177_a", "deleteWords"));
- mInitMap.put(new Pair<String, String>("func_146178_a", "updateCursorCounter"));
- mInitMap.put(new Pair<String, String>("func_146179_b", "getText"));
- mInitMap.put(new Pair<String, String>("func_146180_a", "setText"));
- mInitMap.put(new Pair<String, String>("func_146181_i", "getEnableBackgroundDrawing"));
- mInitMap.put(new Pair<String, String>("func_146182_d", "moveCursorBy"));
- mInitMap.put(new Pair<String, String>("func_146183_a", "getNthWordFromPos"));
- mInitMap.put(new Pair<String, String>("func_146184_c", "setEnabled"));
- mInitMap.put(new Pair<String, String>("func_146185_a", "setEnableBackgroundDrawing"));
- mInitMap.put(new Pair<String, String>("func_146186_n", "getSelectionEnd"));
- mInitMap.put(new Pair<String, String>("func_146187_c", "getNthWordFromCursor"));
- mInitMap.put(new Pair<String, String>("func_146188_c", "drawCursorVertical"));
- mInitMap.put(new Pair<String, String>("func_146189_e", "setVisible"));
- mInitMap.put(new Pair<String, String>("func_146190_e", "setCursorPosition"));
- mInitMap.put(new Pair<String, String>("func_146191_b", "writeText"));
- mInitMap.put(new Pair<String, String>("func_146192_a", "mouseClicked"));
- mInitMap.put(new Pair<String, String>("func_146193_g", "setTextColor"));
- mInitMap.put(new Pair<String, String>("func_146194_f", "drawTextBox"));
- mInitMap.put(new Pair<String, String>("func_146195_b", "setFocused"));
- mInitMap.put(new Pair<String, String>("func_146196_d", "setCursorPositionZero"));
- mInitMap.put(new Pair<String, String>("func_146198_h", "getCursorPosition"));
- mInitMap.put(new Pair<String, String>("func_146199_i", "setSelectionPos"));
- mInitMap.put(new Pair<String, String>("func_146200_o", "getWidth"));
- mInitMap.put(new Pair<String, String>("func_146201_a", "textboxKeyTyped"));
- mInitMap.put(new Pair<String, String>("func_146202_e", "setCursorPositionEnd"));
- mInitMap.put(new Pair<String, String>("func_146203_f", "setMaxStringLength"));
- mInitMap.put(new Pair<String, String>("func_146204_h", "setDisabledTextColour"));
- mInitMap.put(new Pair<String, String>("func_146205_d", "setCanLoseFocus"));
- mInitMap.put(new Pair<String, String>("func_146206_l", "isFocused"));
- mInitMap.put(new Pair<String, String>("func_146207_c", "getSelectedText"));
- mInitMap.put(new Pair<String, String>("func_146208_g", "getMaxStringLength"));
- mInitMap.put(new Pair<String, String>("func_146227_a", "printChatMessage"));
- mInitMap.put(new Pair<String, String>("func_146228_f", "getChatWidth"));
- mInitMap.put(new Pair<String, String>("func_146229_b", "scroll"));
- mInitMap.put(new Pair<String, String>("func_146230_a", "drawChat"));
- mInitMap.put(new Pair<String, String>("func_146231_a", "clearChatMessages"));
- mInitMap.put(new Pair<String, String>("func_146232_i", "getLineCount"));
- mInitMap.put(new Pair<String, String>("func_146233_a", "calculateChatboxWidth"));
- mInitMap.put(new Pair<String, String>("func_146234_a", "printChatMessageWithOptionalDeletion"));
- mInitMap.put(new Pair<String, String>("func_146235_b", "formatColors"));
- mInitMap.put(new Pair<String, String>("func_146236_a", "getChatComponent"));
- mInitMap.put(new Pair<String, String>("func_146237_a", "setChatLine"));
- mInitMap.put(new Pair<String, String>("func_146238_c", "getSentMessages"));
- mInitMap.put(new Pair<String, String>("func_146239_a", "addToSentMessages"));
- mInitMap.put(new Pair<String, String>("func_146240_d", "resetScroll"));
- mInitMap.put(new Pair<String, String>("func_146241_e", "getChatOpen"));
- mInitMap.put(new Pair<String, String>("func_146242_c", "deleteChatLine"));
- mInitMap.put(new Pair<String, String>("func_146243_b", "calculateChatboxHeight"));
- mInitMap.put(new Pair<String, String>("func_146244_h", "getChatScale"));
- mInitMap.put(new Pair<String, String>("func_146245_b", "refreshChat"));
- mInitMap.put(new Pair<String, String>("func_146246_g", "getChatHeight"));
- mInitMap.put(new Pair<String, String>("func_146254_a", "updateAchievementWindow"));
- mInitMap.put(new Pair<String, String>("func_146255_b", "displayUnformattedAchievement"));
- mInitMap.put(new Pair<String, String>("func_146256_a", "displayAchievement"));
- mInitMap.put(new Pair<String, String>("func_146257_b", "clearAchievements"));
- mInitMap.put(new Pair<String, String>("func_146258_c", "updateAchievementWindowScale"));
- mInitMap.put(new Pair<String, String>("func_146269_k", "handleInput"));
- mInitMap.put(new Pair<String, String>("func_146270_b", "drawWorldBackground"));
- mInitMap.put(new Pair<String, String>("func_146271_m", "isCtrlKeyDown"));
- mInitMap.put(new Pair<String, String>("func_146272_n", "isShiftKeyDown"));
- mInitMap.put(new Pair<String, String>("func_146273_a", "mouseClickMove"));
- mInitMap.put(new Pair<String, String>("func_146274_d", "handleMouseInput"));
- mInitMap.put(new Pair<String, String>("func_146275_d", "setClipboardString"));
- mInitMap.put(new Pair<String, String>("func_146276_q_", "drawDefaultBackground"));
- mInitMap.put(new Pair<String, String>("func_146277_j", "getClipboardString"));
- mInitMap.put(new Pair<String, String>("func_146278_c", "drawBackground"));
- mInitMap.put(new Pair<String, String>("func_146279_a", "drawCreativeTabHoveringText"));
- mInitMap.put(new Pair<String, String>("func_146280_a", "setWorldAndResolution"));
- mInitMap.put(new Pair<String, String>("func_146281_b", "onGuiClosed"));
- mInitMap.put(new Pair<String, String>("func_146282_l", "handleKeyboardInput"));
- mInitMap.put(new Pair<String, String>("func_146283_a", "drawHoveringText"));
- mInitMap.put(new Pair<String, String>("func_146284_a", "actionPerformed"));
- mInitMap.put(new Pair<String, String>("func_146285_a", "renderToolTip"));
- mInitMap.put(new Pair<String, String>("func_146286_b", "mouseReleased"));
- mInitMap.put(new Pair<String, String>("func_146350_a", "setButtonDelay"));
- mInitMap.put(new Pair<String, String>("func_146358_g", "disableSecurityWarning"));
- mInitMap.put(new Pair<String, String>("func_146359_e", "copyLinkToClipboard"));
- mInitMap.put(new Pair<String, String>("func_146367_a", "connect"));
- mInitMap.put(new Pair<String, String>("func_146402_a", "getSentHistory"));
- mInitMap.put(new Pair<String, String>("func_146403_a", "submitChatMessage"));
- mInitMap.put(new Pair<String, String>("func_146404_p_", "autocompletePlayerNames"));
- mInitMap.put(new Pair<String, String>("func_146405_a", "sendAutocompleteRequest"));
- mInitMap.put(new Pair<String, String>("func_146406_a", "onAutocompleteResponse"));
- mInitMap.put(new Pair<String, String>("func_146407_a", "openLink"));
- mInitMap.put(new Pair<String, String>("func_146418_g", "wakeFromSleep"));
- mInitMap.put(new Pair<String, String>("func_146456_p", "pageGetCurrent"));
- mInitMap.put(new Pair<String, String>("func_146457_a", "pageSetCurrent"));
- mInitMap.put(new Pair<String, String>("func_146459_b", "pageInsertIntoCurrent"));
- mInitMap.put(new Pair<String, String>("func_146460_c", "keyTypedInTitle"));
- mInitMap.put(new Pair<String, String>("func_146461_i", "addmInitMap.put(newPage"));
- mInitMap.put(new Pair<String, String>("func_146462_a", "sendBookToServer"));
- mInitMap.put(new Pair<String, String>("func_146463_b", "keyTypedInBook"));
- mInitMap.put(new Pair<String, String>("func_146464_h", "updateButtons"));
- mInitMap.put(new Pair<String, String>("func_146504_a", "getSoundVolume"));
- mInitMap.put(new Pair<String, String>("func_146509_g", "doneLoading"));
- mInitMap.put(new Pair<String, String>("func_146521_a", "drawStatsScreen"));
- mInitMap.put(new Pair<String, String>("func_146527_c", "drawSprite"));
- mInitMap.put(new Pair<String, String>("func_146531_b", "drawButtonBackground"));
- mInitMap.put(new Pair<String, String>("func_146541_h", "createButtons"));
- mInitMap.put(new Pair<String, String>("func_146552_b", "drawAchievementScreen"));
- mInitMap.put(new Pair<String, String>("func_146553_h", "drawTitle"));
- mInitMap.put(new Pair<String, String>("func_146574_g", "sendRespawnPacket"));
- mInitMap.put(new Pair<String, String>("func_146575_b", "drawWinGameScreen"));
- mInitMap.put(new Pair<String, String>("func_146586_a", "setDomInitMap.put(neworking"));
- mInitMap.put(new Pair<String, String>("func_146789_i", "getOldServerPinger"));
- mInitMap.put(new Pair<String, String>("func_146790_a", "selectServer"));
- mInitMap.put(new Pair<String, String>("func_146791_a", "connectToServer"));
- mInitMap.put(new Pair<String, String>("func_146792_q", "refreshServerList"));
- mInitMap.put(new Pair<String, String>("func_146794_g", "createButtons"));
- mInitMap.put(new Pair<String, String>("func_146795_p", "getServerList"));
- mInitMap.put(new Pair<String, String>("func_146796_h", "connectToSelected"));
- mInitMap.put(new Pair<String, String>("func_146961_a", "hasResourcePackEntry"));
- mInitMap.put(new Pair<String, String>("func_146975_c", "getSlotAtPosition"));
- mInitMap.put(new Pair<String, String>("func_146976_a", "drawGuiContainerBackgroundLayer"));
- mInitMap.put(new Pair<String, String>("func_146977_a", "drawSlot"));
- mInitMap.put(new Pair<String, String>("func_146978_c", "isPointInRegion"));
- mInitMap.put(new Pair<String, String>("func_146979_b", "drawGuiContainerForegroundLayer"));
- mInitMap.put(new Pair<String, String>("func_146980_g", "updateDragSplitting"));
- mInitMap.put(new Pair<String, String>("func_146981_a", "isMouseOverSlot"));
- mInitMap.put(new Pair<String, String>("func_146982_a", "drawItemStack"));
- mInitMap.put(new Pair<String, String>("func_146983_a", "checkHotbarKeys"));
- mInitMap.put(new Pair<String, String>("func_146984_a", "handleMouseClick"));
- mInitMap.put(new Pair<String, String>("func_147035_g", "getMerchant"));
- mInitMap.put(new Pair<String, String>("func_147044_g", "drawActivePotionEffects"));
- mInitMap.put(new Pair<String, String>("func_147046_a", "drawEntityOnScreen"));
- mInitMap.put(new Pair<String, String>("func_147050_b", "setCurrentCreativeTab"));
- mInitMap.put(new Pair<String, String>("func_147052_b", "renderCreativeInventoryHoveringText"));
- mInitMap.put(new Pair<String, String>("func_147053_i", "updateCreativeSearch"));
- mInitMap.put(new Pair<String, String>("func_147055_p", "needsScrollBars"));
- mInitMap.put(new Pair<String, String>("func_147090_g", "renameItem"));
- mInitMap.put(new Pair<String, String>("func_147095_a", "requestTexturePackLoad"));
- mInitMap.put(new Pair<String, String>("func_147099_x", "getStatFile"));
- mInitMap.put(new Pair<String, String>("func_147104_D", "getCurrentServerData"));
- mInitMap.put(new Pair<String, String>("func_147106_B", "scheduleResourcesRefresh"));
- mInitMap.put(new Pair<String, String>("func_147107_h", "isFramerateLimitBelowMax"));
- mInitMap.put(new Pair<String, String>("func_147108_a", "displayGuiScreen"));
- mInitMap.put(new Pair<String, String>("func_147109_W", "getAmbientMusicType"));
- mInitMap.put(new Pair<String, String>("func_147110_a", "getFramebuffer"));
- mInitMap.put(new Pair<String, String>("func_147111_S", "isJava64bit"));
- mInitMap.put(new Pair<String, String>("func_147112_ai", "middleClickMouse"));
- mInitMap.put(new Pair<String, String>("func_147113_T", "isGamePaused"));
- mInitMap.put(new Pair<String, String>("func_147114_u", "getNetHandler"));
- mInitMap.put(new Pair<String, String>("func_147115_a", "sendClickBlockToController"));
- mInitMap.put(new Pair<String, String>("func_147116_af", "clickMouse"));
- mInitMap.put(new Pair<String, String>("func_147117_R", "getTextureMapBlocks"));
- mInitMap.put(new Pair<String, String>("func_147118_V", "getSoundHandler"));
- mInitMap.put(new Pair<String, String>("func_147119_ah", "updateFramebufferSize"));
- mInitMap.put(new Pair<String, String>("func_147120_f", "resetSize"));
- mInitMap.put(new Pair<String, String>("func_147121_ag", "rightClickMouse"));
- mInitMap.put(new Pair<String, String>("func_147122_X", "isJvm64bit"));
- mInitMap.put(new Pair<String, String>("func_147130_as", "getMinecraftSessionService"));
- mInitMap.put(new Pair<String, String>("func_147132_au", "refreshStatusNextTick"));
- mInitMap.put(new Pair<String, String>("func_147133_T", "getTexturePack"));
- mInitMap.put(new Pair<String, String>("func_147134_at", "getServerStatusResponse"));
- mInitMap.put(new Pair<String, String>("func_147135_j", "getDifficulty"));
- mInitMap.put(new Pair<String, String>("func_147136_ar", "isAnnouncingPlayerAchievements"));
- mInitMap.put(new Pair<String, String>("func_147137_ag", "getNetworkSystem"));
- mInitMap.put(new Pair<String, String>("func_147138_a", "addFaviconToStatusResponse"));
- mInitMap.put(new Pair<String, String>("func_147139_a", "setDifficultyForAllWorlds"));
- mInitMap.put(new Pair<String, String>("func_147149_a", "saveToFile"));
- mInitMap.put(new Pair<String, String>("func_147153_a", "addBlockInfo"));
- mInitMap.put(new Pair<String, String>("func_147155_a", "getCategoryName"));
- mInitMap.put(new Pair<String, String>("func_147156_b", "getCategoryId"));
- mInitMap.put(new Pair<String, String>("func_147176_a", "getChatComponentFromNthArg"));
- mInitMap.put(new Pair<String, String>("func_147177_a", "joinNiceString"));
- mInitMap.put(new Pair<String, String>("func_147178_a", "getChatComponentFromNthArg"));
- mInitMap.put(new Pair<String, String>("func_147179_f", "getItemByText"));
- mInitMap.put(new Pair<String, String>("func_147180_g", "getBlockByText"));
- mInitMap.put(new Pair<String, String>("func_147185_d", "addTeam"));
- mInitMap.put(new Pair<String, String>("func_147186_g", "listTeams"));
- mInitMap.put(new Pair<String, String>("func_147187_n", "resetPlayers"));
- mInitMap.put(new Pair<String, String>("func_147188_j", "emptyTeam"));
- mInitMap.put(new Pair<String, String>("func_147190_h", "joinTeam"));
- mInitMap.put(new Pair<String, String>("func_147191_h", "removeObjective"));
- mInitMap.put(new Pair<String, String>("func_147192_d", "getScoreboard"));
- mInitMap.put(new Pair<String, String>("func_147193_c", "addObjective"));
- mInitMap.put(new Pair<String, String>("func_147194_f", "removeTeam"));
- mInitMap.put(new Pair<String, String>("func_147195_l", "listPlayers"));
- mInitMap.put(new Pair<String, String>("func_147196_d", "listObjectives"));
- mInitMap.put(new Pair<String, String>("func_147197_m", "setPlayer"));
- mInitMap.put(new Pair<String, String>("func_147198_k", "setObjectiveDisplay"));
- mInitMap.put(new Pair<String, String>("func_147199_i", "leaveTeam"));
- mInitMap.put(new Pair<String, String>("func_147200_e", "setTeamOption"));
- mInitMap.put(new Pair<String, String>("func_147215_a", "addBlockDestroyEffects"));
- mInitMap.put(new Pair<String, String>("func_147223_a", "pingPendingNetworks"));
- mInitMap.put(new Pair<String, String>("func_147224_a", "ping"));
- mInitMap.put(new Pair<String, String>("func_147225_b", "tryCompatibilityPing"));
- mInitMap.put(new Pair<String, String>("func_147226_b", "clearPendingNetworks"));
- mInitMap.put(new Pair<String, String>("func_147231_a", "onDisconnect"));
- mInitMap.put(new Pair<String, String>("func_147232_a", "onConnectionStateTransition"));
- mInitMap.put(new Pair<String, String>("func_147233_a", "onNetworkTick"));
- mInitMap.put(new Pair<String, String>("func_147234_a", "handleBlockChange"));
- mInitMap.put(new Pair<String, String>("func_147235_a", "handleSpawnObject"));
- mInitMap.put(new Pair<String, String>("func_147236_a", "handleEntityStatus"));
- mInitMap.put(new Pair<String, String>("func_147237_a", "handleSpawnPlayer"));
- mInitMap.put(new Pair<String, String>("func_147238_a", "handleDestroyEntities"));
- mInitMap.put(new Pair<String, String>("func_147239_a", "handleConfirmTransaction"));
- mInitMap.put(new Pair<String, String>("func_147240_a", "handleCustomPayload"));
- mInitMap.put(new Pair<String, String>("func_147241_a", "handleWindowItems"));
- mInitMap.put(new Pair<String, String>("func_147242_a", "handleEntityEquipment"));
- mInitMap.put(new Pair<String, String>("func_147243_a", "handleEntityAttach"));
- mInitMap.put(new Pair<String, String>("func_147244_a", "handleEntityVelocity"));
- mInitMap.put(new Pair<String, String>("func_147245_a", "handleWindowProperty"));
- mInitMap.put(new Pair<String, String>("func_147246_a", "handleCollectItem"));
- mInitMap.put(new Pair<String, String>("func_147247_a", "handleTeams"));
- mInitMap.put(new Pair<String, String>("func_147248_a", "handleUpdateSign"));
- mInitMap.put(new Pair<String, String>("func_147249_a", "handleUpdateHealth"));
- mInitMap.put(new Pair<String, String>("func_147250_a", "handleUpdateScore"));
- mInitMap.put(new Pair<String, String>("func_147251_a", "handleChat"));
- mInitMap.put(new Pair<String, String>("func_147252_a", "handleChangeGameState"));
- mInitMap.put(new Pair<String, String>("func_147253_a", "handleDisconnect"));
- mInitMap.put(new Pair<String, String>("func_147254_a", "handleDisplayScoreboard"));
- mInitMap.put(new Pair<String, String>("func_147255_a", "handleSoundEffect"));
- mInitMap.put(new Pair<String, String>("func_147256_a", "handlePlayerListItem"));
- mInitMap.put(new Pair<String, String>("func_147257_a", "handleHeldItemChange"));
- mInitMap.put(new Pair<String, String>("func_147258_a", "handlePlayerPosLook"));
- mInitMap.put(new Pair<String, String>("func_147259_a", "handleEntityMovement"));
- mInitMap.put(new Pair<String, String>("func_147260_a", "handleEntityEffect"));
- mInitMap.put(new Pair<String, String>("func_147261_a", "handleBlockAction"));
- mInitMap.put(new Pair<String, String>("func_147262_a", "handleRemoveEntityEffect"));
- mInitMap.put(new Pair<String, String>("func_147263_a", "handleChunkData"));
- mInitMap.put(new Pair<String, String>("func_147264_a", "handleMaps"));
- mInitMap.put(new Pair<String, String>("func_147265_a", "handleOpenWindow"));
- mInitMap.put(new Pair<String, String>("func_147266_a", "handleSetSlot"));
- mInitMap.put(new Pair<String, String>("func_147267_a", "handleEntityHeadLook"));
- mInitMap.put(new Pair<String, String>("func_147268_a", "handleSignEditorOpen"));
- mInitMap.put(new Pair<String, String>("func_147269_a", "handleMapChunkBulk"));
- mInitMap.put(new Pair<String, String>("func_147270_a", "handlePlayerAbilities"));
- mInitMap.put(new Pair<String, String>("func_147271_a", "handleSpawnPosition"));
- mInitMap.put(new Pair<String, String>("func_147272_a", "handleKeepAlive"));
- mInitMap.put(new Pair<String, String>("func_147273_a", "handleUpdateTileEntity"));
- mInitMap.put(new Pair<String, String>("func_147274_a", "handleTabComplete"));
- mInitMap.put(new Pair<String, String>("func_147275_a", "handleEntityTeleport"));
- mInitMap.put(new Pair<String, String>("func_147276_a", "handleCloseWindow"));
- mInitMap.put(new Pair<String, String>("func_147277_a", "handleEffect"));
- mInitMap.put(new Pair<String, String>("func_147278_a", "handleUseBed"));
- mInitMap.put(new Pair<String, String>("func_147279_a", "handleAnimation"));
- mInitMap.put(new Pair<String, String>("func_147280_a", "handleRespawn"));
- mInitMap.put(new Pair<String, String>("func_147281_a", "handleSpawnMob"));
- mInitMap.put(new Pair<String, String>("func_147282_a", "handleJoinGame"));
- mInitMap.put(new Pair<String, String>("func_147283_a", "handleExplosion"));
- mInitMap.put(new Pair<String, String>("func_147284_a", "handleEntityMetadata"));
- mInitMap.put(new Pair<String, String>("func_147285_a", "handleTimeUpdate"));
- mInitMap.put(new Pair<String, String>("func_147286_a", "handleSpawnExperienceOrb"));
- mInitMap.put(new Pair<String, String>("func_147287_a", "handleMultiBlockChange"));
- mInitMap.put(new Pair<String, String>("func_147288_a", "handleSpawnPainting"));
- mInitMap.put(new Pair<String, String>("func_147289_a", "handleParticles"));
- mInitMap.put(new Pair<String, String>("func_147290_a", "handleEntityProperties"));
- mInitMap.put(new Pair<String, String>("func_147291_a", "handleScoreboardObjective"));
- mInitMap.put(new Pair<String, String>("func_147292_a", "handleSpawnGlobalEntity"));
- mInitMap.put(new Pair<String, String>("func_147293_a", "handleStatistics"));
- mInitMap.put(new Pair<String, String>("func_147294_a", "handleBlockBreakAnim"));
- mInitMap.put(new Pair<String, String>("func_147295_a", "handleSetExperience"));
- mInitMap.put(new Pair<String, String>("func_147296_c", "cleanup"));
- mInitMap.put(new Pair<String, String>("func_147297_a", "addToSendQueue"));
- mInitMap.put(new Pair<String, String>("func_147298_b", "getNetworkManager"));
- mInitMap.put(new Pair<String, String>("func_147311_a", "processPing"));
- mInitMap.put(new Pair<String, String>("func_147312_a", "processServerQuery"));
- mInitMap.put(new Pair<String, String>("func_147315_a", "processEncryptionResponse"));
- mInitMap.put(new Pair<String, String>("func_147316_a", "processLoginStart"));
- mInitMap.put(new Pair<String, String>("func_147322_a", "closeConnection"));
- mInitMap.put(new Pair<String, String>("func_147338_a", "processEnchantItem"));
- mInitMap.put(new Pair<String, String>("func_147339_a", "processConfirmTransaction"));
- mInitMap.put(new Pair<String, String>("func_147340_a", "processUseEntity"));
- mInitMap.put(new Pair<String, String>("func_147341_a", "processTabComplete"));
- mInitMap.put(new Pair<String, String>("func_147342_a", "processClientStatus"));
- mInitMap.put(new Pair<String, String>("func_147343_a", "processUpdateSign"));
- mInitMap.put(new Pair<String, String>("func_147344_a", "processCreativeInventoryAction"));
- mInitMap.put(new Pair<String, String>("func_147345_a", "processPlayerDigging"));
- mInitMap.put(new Pair<String, String>("func_147346_a", "processPlayerBlockPlacement"));
- mInitMap.put(new Pair<String, String>("func_147347_a", "processPlayer"));
- mInitMap.put(new Pair<String, String>("func_147348_a", "processPlayerAbilities"));
- mInitMap.put(new Pair<String, String>("func_147349_a", "processVanilla250Packet"));
- mInitMap.put(new Pair<String, String>("func_147350_a", "processAnimation"));
- mInitMap.put(new Pair<String, String>("func_147351_a", "processClickWindow"));
- mInitMap.put(new Pair<String, String>("func_147352_a", "processClientSettings"));
- mInitMap.put(new Pair<String, String>("func_147353_a", "processKeepAlive"));
- mInitMap.put(new Pair<String, String>("func_147354_a", "processChatMessage"));
- mInitMap.put(new Pair<String, String>("func_147355_a", "processHeldItemChange"));
- mInitMap.put(new Pair<String, String>("func_147356_a", "processCloseWindow"));
- mInitMap.put(new Pair<String, String>("func_147357_a", "processEntityAction"));
- mInitMap.put(new Pair<String, String>("func_147358_a", "processInput"));
- mInitMap.put(new Pair<String, String>("func_147359_a", "sendPacket"));
- mInitMap.put(new Pair<String, String>("func_147360_c", "kickPlayerFromServer"));
- mInitMap.put(new Pair<String, String>("func_147361_d", "handleSlashCommand"));
- mInitMap.put(new Pair<String, String>("func_147362_b", "getNetworkManager"));
- mInitMap.put(new Pair<String, String>("func_147363_d", "currentTimeMillis"));
- mInitMap.put(new Pair<String, String>("func_147364_a", "setPlayerLocation"));
- mInitMap.put(new Pair<String, String>("func_147383_a", "processHandshake"));
- mInitMap.put(new Pair<String, String>("func_147388_a", "handleDisconnect"));
- mInitMap.put(new Pair<String, String>("func_147389_a", "handleEncryptionRequest"));
- mInitMap.put(new Pair<String, String>("func_147390_a", "handleLoginSuccess"));
- mInitMap.put(new Pair<String, String>("func_147397_a", "handleServerInfo"));
- mInitMap.put(new Pair<String, String>("func_147398_a", "handlePong"));
- mInitMap.put(new Pair<String, String>("func_147407_a", "setBase64EncodedIconData"));
- mInitMap.put(new Pair<String, String>("func_147409_e", "getBase64EncodedIconData"));
- mInitMap.put(new Pair<String, String>("func_147416_a", "findClosestStructure"));
- mInitMap.put(new Pair<String, String>("func_147422_a", "replaceBlocksForBiome"));
- mInitMap.put(new Pair<String, String>("func_147437_c", "isAirBlock"));
- mInitMap.put(new Pair<String, String>("func_147438_o", "getTileEntity"));
- mInitMap.put(new Pair<String, String>("func_147439_a", "getBlock"));
- mInitMap.put(new Pair<String, String>("func_147440_b", "findClosestStructure"));
- mInitMap.put(new Pair<String, String>("func_147441_b", "notifyBlocksOfNeighborChange"));
- mInitMap.put(new Pair<String, String>("func_147442_i", "setThunderStrength"));
- mInitMap.put(new Pair<String, String>("func_147443_d", "destroyBlockInWorldPartially"));
- mInitMap.put(new Pair<String, String>("func_147444_c", "notifyBlockChange"));
- mInitMap.put(new Pair<String, String>("func_147445_c", "isBlockNormalCubeDefault"));
- mInitMap.put(new Pair<String, String>("func_147447_a", "rayTraceBlocks"));
- mInitMap.put(new Pair<String, String>("func_147449_b", "setBlock"));
- mInitMap.put(new Pair<String, String>("func_147451_t", "updateAllLightTypes"));
- mInitMap.put(new Pair<String, String>("func_147452_c", "addBlockEvent"));
- mInitMap.put(new Pair<String, String>("func_147453_f", "updateNeighborsAboutBlockChange"));
- mInitMap.put(new Pair<String, String>("func_147454_a", "scheduleBlockUpdateWithPriority"));
- mInitMap.put(new Pair<String, String>("func_147455_a", "setTileEntity"));
- mInitMap.put(new Pair<String, String>("func_147457_a", "markTileEntityForRemoval"));
- mInitMap.put(new Pair<String, String>("func_147458_c", "markBlockRangeForRenderUpdate"));
- mInitMap.put(new Pair<String, String>("func_147459_d", "notifyBlocksOfNeighborChange"));
- mInitMap.put(new Pair<String, String>("func_147460_e", "notifyBlockOfNeighborChange"));
- mInitMap.put(new Pair<String, String>("func_147462_b", "getTensionFactorForBlock"));
- mInitMap.put(new Pair<String, String>("func_147463_c", "updateLightByType"));
- mInitMap.put(new Pair<String, String>("func_147464_a", "scheduleBlockUpdate"));
- mInitMap.put(new Pair<String, String>("func_147465_d", "setBlock"));
- mInitMap.put(new Pair<String, String>("func_147466_a", "doesBlockHaveSolidTopSurface"));
- mInitMap.put(new Pair<String, String>("func_147468_f", "setBlockToAir"));
- mInitMap.put(new Pair<String, String>("func_147469_q", "isBlockFullCube"));
- mInitMap.put(new Pair<String, String>("func_147471_g", "markBlockForUpdate"));
- mInitMap.put(new Pair<String, String>("func_147472_a", "canPlaceEntityOnSide"));
- mInitMap.put(new Pair<String, String>("func_147474_b", "getTopBlock"));
- mInitMap.put(new Pair<String, String>("func_147475_p", "removeTileEntity"));
- mInitMap.put(new Pair<String, String>("func_147476_b", "markTileEntityChunkModified"));
- mInitMap.put(new Pair<String, String>("func_147477_a", "isBlockTickScheduledThisTick"));
- mInitMap.put(new Pair<String, String>("func_147478_e", "canSnowAt"));
- mInitMap.put(new Pair<String, String>("func_147479_m", "markBlockForRenderUpdate"));
- mInitMap.put(new Pair<String, String>("func_147480_a", "breakBlock"));
- mInitMap.put(new Pair<String, String>("func_147493_a", "createPlayer"));
- mInitMap.put(new Pair<String, String>("func_147496_a", "onWorldChange"));
- mInitMap.put(new Pair<String, String>("func_147499_a", "bindTexture"));
- mInitMap.put(new Pair<String, String>("func_147500_a", "renderTileEntityAt"));
- mInitMap.put(new Pair<String, String>("func_147542_a", "cacheActiveRenderInfo"));
- mInitMap.put(new Pair<String, String>("func_147544_a", "renderTileEntity"));
- mInitMap.put(new Pair<String, String>("func_147545_a", "hasSpecialRenderer"));
- mInitMap.put(new Pair<String, String>("func_147546_a", "getSpecialRendererByClass"));
- mInitMap.put(new Pair<String, String>("func_147547_b", "getSpecialRenderer"));
- mInitMap.put(new Pair<String, String>("func_147548_a", "getFontRenderer"));
- mInitMap.put(new Pair<String, String>("func_147549_a", "renderTileEntityAt"));
- mInitMap.put(new Pair<String, String>("func_147564_a", "getVertexState"));
- mInitMap.put(new Pair<String, String>("func_147565_a", "setVertexState"));
- mInitMap.put(new Pair<String, String>("func_147570_f", "getHasNormals"));
- mInitMap.put(new Pair<String, String>("func_147571_e", "getHasBrightness"));
- mInitMap.put(new Pair<String, String>("func_147572_a", "getRawBuffer"));
- mInitMap.put(new Pair<String, String>("func_147573_d", "getHasTexture"));
- mInitMap.put(new Pair<String, String>("func_147574_g", "getHasColor"));
- mInitMap.put(new Pair<String, String>("func_147575_c", "getVertexCount"));
- mInitMap.put(new Pair<String, String>("func_147576_b", "getRawBufferIndex"));
- mInitMap.put(new Pair<String, String>("func_147584_b", "onStaticEntitiesChanged"));
- mInitMap.put(new Pair<String, String>("func_147585_a", "markBlockRangeForRenderUpdate"));
- mInitMap.put(new Pair<String, String>("func_147586_a", "markBlockForUpdate"));
- mInitMap.put(new Pair<String, String>("func_147587_b", "destroyBlockPartially"));
- mInitMap.put(new Pair<String, String>("func_147588_b", "markBlockForRenderUpdate"));
- mInitMap.put(new Pair<String, String>("func_147589_a", "renderEntities"));
- mInitMap.put(new Pair<String, String>("func_147590_a", "drawOutlinedBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_147591_f", "rebuildDisplayListEntities"));
- mInitMap.put(new Pair<String, String>("func_147604_a", "setFramebufferColor"));
- mInitMap.put(new Pair<String, String>("func_147605_b", "createFramebuffer"));
- mInitMap.put(new Pair<String, String>("func_147606_d", "unbindFramebufferTexture"));
- mInitMap.put(new Pair<String, String>("func_147607_a", "setFramebufferFilter"));
- mInitMap.put(new Pair<String, String>("func_147608_a", "deleteFramebuffer"));
- mInitMap.put(new Pair<String, String>("func_147609_e", "unbindFramebuffer"));
- mInitMap.put(new Pair<String, String>("func_147610_a", "bindFramebuffer"));
- mInitMap.put(new Pair<String, String>("func_147611_b", "checkFramebufferComplete"));
- mInitMap.put(new Pair<String, String>("func_147612_c", "bindFramebufferTexture"));
- mInitMap.put(new Pair<String, String>("func_147613_a", "createBindFramebuffer"));
- mInitMap.put(new Pair<String, String>("func_147614_f", "framebufferClear"));
- mInitMap.put(new Pair<String, String>("func_147615_c", "framebufferRender"));
- mInitMap.put(new Pair<String, String>("func_147631_c", "deleteGlTexture"));
- mInitMap.put(new Pair<String, String>("func_147632_b", "setAnisotropicFiltering"));
- mInitMap.put(new Pair<String, String>("func_147633_a", "setMipmapLevels"));
- mInitMap.put(new Pair<String, String>("func_147634_a", "completeResourceLocation"));
- mInitMap.put(new Pair<String, String>("func_147640_e", "checkTextureUploaded"));
- mInitMap.put(new Pair<String, String>("func_147641_a", "setBufferedImage"));
- mInitMap.put(new Pair<String, String>("func_147645_c", "deleteTexture"));
- mInitMap.put(new Pair<String, String>("func_147647_b", "bidiReorder"));
- mInitMap.put(new Pair<String, String>("func_147649_g", "getXPosF"));
- mInitMap.put(new Pair<String, String>("func_147650_b", "getSoundLocation"));
- mInitMap.put(new Pair<String, String>("func_147651_i", "getZPosF"));
- mInitMap.put(new Pair<String, String>("func_147652_d", "getRepeatDelay"));
- mInitMap.put(new Pair<String, String>("func_147653_e", "getVolume"));
- mInitMap.put(new Pair<String, String>("func_147654_h", "getYPosF"));
- mInitMap.put(new Pair<String, String>("func_147655_f", "getPitch"));
- mInitMap.put(new Pair<String, String>("func_147656_j", "getAttenuationType"));
- mInitMap.put(new Pair<String, String>("func_147657_c", "canRepeat"));
- mInitMap.put(new Pair<String, String>("func_147667_k", "isDonePlaying"));
- mInitMap.put(new Pair<String, String>("func_147673_a", "createPositionedSoundRecord"));
- mInitMap.put(new Pair<String, String>("func_147674_a", "createPositionedSoundRecord"));
- mInitMap.put(new Pair<String, String>("func_147675_a", "createRecordSoundAtPosition"));
- mInitMap.put(new Pair<String, String>("func_147680_a", "getSound"));
- mInitMap.put(new Pair<String, String>("func_147681_a", "playDelayedSound"));
- mInitMap.put(new Pair<String, String>("func_147682_a", "playSound"));
- mInitMap.put(new Pair<String, String>("func_147683_b", "stopSound"));
- mInitMap.put(new Pair<String, String>("func_147684_a", "setSoundLevel"));
- mInitMap.put(new Pair<String, String>("func_147685_d", "unloadSounds"));
- mInitMap.put(new Pair<String, String>("func_147686_a", "getRandomSoundFromCategories"));
- mInitMap.put(new Pair<String, String>("func_147687_e", "resumeSounds"));
- mInitMap.put(new Pair<String, String>("func_147689_b", "pauseSounds"));
- mInitMap.put(new Pair<String, String>("func_147690_c", "stopSounds"));
- mInitMap.put(new Pair<String, String>("func_147691_a", "setListener"));
- mInitMap.put(new Pair<String, String>("func_147692_c", "isSoundPlaying"));
- mInitMap.put(new Pair<String, String>("func_147693_a", "loadSoundResource"));
- mInitMap.put(new Pair<String, String>("func_147701_i", "getMapItemRenderer"));
- mInitMap.put(new Pair<String, String>("func_147702_a", "isShaderActive"));
- mInitMap.put(new Pair<String, String>("func_147703_b", "deactivateShader"));
- mInitMap.put(new Pair<String, String>("func_147704_a", "updateShaderGroupSize"));
- mInitMap.put(new Pair<String, String>("func_147705_c", "activateNextShader"));
- mInitMap.put(new Pair<String, String>("func_147706_e", "getShaderGroup"));
- mInitMap.put(new Pair<String, String>("func_147715_a", "renderChest"));
- mInitMap.put(new Pair<String, String>("func_147721_p", "renderBlockLiquid"));
- mInitMap.put(new Pair<String, String>("func_147722_a", "renderBlockStairs"));
- mInitMap.put(new Pair<String, String>("func_147723_f", "renderBlockTripWireSource"));
- mInitMap.put(new Pair<String, String>("func_147724_m", "renderBlockStem"));
- mInitMap.put(new Pair<String, String>("func_147725_a", "renderBlockAnvil"));
- mInitMap.put(new Pair<String, String>("func_147726_j", "renderBlockVine"));
- mInitMap.put(new Pair<String, String>("func_147727_a", "mixAoBrightness"));
- mInitMap.put(new Pair<String, String>("func_147728_a", "renderBlockAnvilOrient"));
- mInitMap.put(new Pair<String, String>("func_147729_a", "getLiquidHeight"));
- mInitMap.put(new Pair<String, String>("func_147730_a", "renderBlockStemSmall"));
- mInitMap.put(new Pair<String, String>("func_147731_b", "renderPistonBase"));
- mInitMap.put(new Pair<String, String>("func_147732_a", "renderBlockRedstoneDiodeMetadata"));
- mInitMap.put(new Pair<String, String>("func_147733_k", "renderBlockStainedGlassPane"));
- mInitMap.put(new Pair<String, String>("func_147734_d", "renderFaceZPos"));
- mInitMap.put(new Pair<String, String>("func_147735_a", "renderBlockFence"));
- mInitMap.put(new Pair<String, String>("func_147736_d", "renderStandardBlockWithColorMultiplier"));
- mInitMap.put(new Pair<String, String>("func_147737_a", "renderBlockAnvilRotate"));
- mInitMap.put(new Pair<String, String>("func_147738_c", "renderPistonRodEW"));
- mInitMap.put(new Pair<String, String>("func_147739_a", "renderItemIn3d"));
- mInitMap.put(new Pair<String, String>("func_147740_a", "renderBlockStemBig"));
- mInitMap.put(new Pair<String, String>("func_147741_a", "renderBlockBrewingStand"));
- mInitMap.put(new Pair<String, String>("func_147742_r", "renderBlockLog"));
- mInitMap.put(new Pair<String, String>("func_147743_a", "renderBlockEndPortalFrame"));
- mInitMap.put(new Pair<String, String>("func_147744_b", "hasOverrideBlockTexture"));
- mInitMap.put(new Pair<String, String>("func_147745_b", "getBlockIcon"));
- mInitMap.put(new Pair<String, String>("func_147746_l", "renderCrossedSquares"));
- mInitMap.put(new Pair<String, String>("func_147747_a", "renderTorchAtAngle"));
- mInitMap.put(new Pair<String, String>("func_147748_a", "renderBlockRedstoneDiode"));
- mInitMap.put(new Pair<String, String>("func_147749_a", "renderBlockSandFalling"));
- mInitMap.put(new Pair<String, String>("func_147750_a", "renderPistonExtensionAllFaces"));
- mInitMap.put(new Pair<String, String>("func_147751_a", "renderStandardBlockWithAmbientOcclusion"));
- mInitMap.put(new Pair<String, String>("func_147752_a", "renderBlockFlowerpot"));
- mInitMap.put(new Pair<String, String>("func_147753_b", "setRenderAllFaces"));
- mInitMap.put(new Pair<String, String>("func_147754_e", "renderBlockCactusImpl"));
- mInitMap.put(new Pair<String, String>("func_147755_t", "renderBlockCactus"));
- mInitMap.put(new Pair<String, String>("func_147756_g", "renderBlockTripWire"));
- mInitMap.put(new Pair<String, String>("func_147757_a", "setOverrideBlockTexture"));
- mInitMap.put(new Pair<String, String>("func_147758_b", "getIconSafe"));
- mInitMap.put(new Pair<String, String>("func_147759_a", "renderBlockRepeater"));
- mInitMap.put(new Pair<String, String>("func_147760_u", "renderBlockDoor"));
- mInitMap.put(new Pair<String, String>("func_147761_c", "renderFaceZNeg"));
- mInitMap.put(new Pair<String, String>("func_147762_c", "unlockBlockBounds"));
- mInitMap.put(new Pair<String, String>("func_147763_a", "renderPistonRodUD"));
- mInitMap.put(new Pair<String, String>("func_147764_f", "renderFaceXPos"));
- mInitMap.put(new Pair<String, String>("func_147765_a", "drawCrossedSquares"));
- mInitMap.put(new Pair<String, String>("func_147766_a", "renderBlockMinecartTrack"));
- mInitMap.put(new Pair<String, String>("func_147767_a", "renderBlockPane"));
- mInitMap.put(new Pair<String, String>("func_147768_a", "renderFaceYNeg"));
- mInitMap.put(new Pair<String, String>("func_147769_a", "renderBlockAllFaces"));
- mInitMap.put(new Pair<String, String>("func_147770_b", "overrideBlockBounds"));
- mInitMap.put(new Pair<String, String>("func_147771_a", "clearOverrideBlockTexture"));
- mInitMap.put(new Pair<String, String>("func_147772_a", "renderBlockCocoa"));
- mInitMap.put(new Pair<String, String>("func_147773_v", "renderBlockBed"));
- mInitMap.put(new Pair<String, String>("func_147774_a", "renderBlockDoublePlant"));
- mInitMap.put(new Pair<String, String>("func_147775_a", "setRenderBoundsFromBlock"));
- mInitMap.put(new Pair<String, String>("func_147776_a", "renderBlockFenceGate"));
- mInitMap.put(new Pair<String, String>("func_147777_a", "getBlockIconFromSide"));
- mInitMap.put(new Pair<String, String>("func_147778_a", "getAoBrightness"));
- mInitMap.put(new Pair<String, String>("func_147779_s", "renderBlockQuartz"));
- mInitMap.put(new Pair<String, String>("func_147780_a", "renderBlockAnvilMetadata"));
- mInitMap.put(new Pair<String, String>("func_147781_a", "renderBlockRedstoneComparator"));
- mInitMap.put(new Pair<String, String>("func_147782_a", "setRenderBounds"));
- mInitMap.put(new Pair<String, String>("func_147783_o", "renderBlockLilyPad"));
- mInitMap.put(new Pair<String, String>("func_147784_q", "renderStandardBlock"));
- mInitMap.put(new Pair<String, String>("func_147785_a", "renderBlockCauldron"));
- mInitMap.put(new Pair<String, String>("func_147786_a", "setRenderFromInside"));
- mInitMap.put(new Pair<String, String>("func_147787_a", "getBlockIconFromSideAndMetadata"));
- mInitMap.put(new Pair<String, String>("func_147788_h", "renderBlockRedstomInitMap.put(newire"));
- mInitMap.put(new Pair<String, String>("func_147789_b", "renderPistonRodSN"));
- mInitMap.put(new Pair<String, String>("func_147790_e", "renderBlockLever"));
- mInitMap.put(new Pair<String, String>("func_147791_c", "renderBlockTorch"));
- mInitMap.put(new Pair<String, String>("func_147792_a", "renderBlockUsingTexture"));
- mInitMap.put(new Pair<String, String>("func_147793_a", "getBlockIcon"));
- mInitMap.put(new Pair<String, String>("func_147794_i", "renderBlockLadder"));
- mInitMap.put(new Pair<String, String>("func_147795_a", "renderBlockCropsImpl"));
- mInitMap.put(new Pair<String, String>("func_147796_n", "renderBlockCrops"));
- mInitMap.put(new Pair<String, String>("func_147797_a", "renderBlockBeacon"));
- mInitMap.put(new Pair<String, String>("func_147798_e", "renderFaceXNeg"));
- mInitMap.put(new Pair<String, String>("func_147799_a", "renderBlockHopperMetadata"));
- mInitMap.put(new Pair<String, String>("func_147800_a", "renderBlockAsItem"));
- mInitMap.put(new Pair<String, String>("func_147801_a", "renderBlockFire"));
- mInitMap.put(new Pair<String, String>("func_147802_a", "renderBlockDragonEgg"));
- mInitMap.put(new Pair<String, String>("func_147803_a", "renderBlockHopper"));
- mInitMap.put(new Pair<String, String>("func_147804_d", "renderPistonBaseAllFaces"));
- mInitMap.put(new Pair<String, String>("func_147805_b", "renderBlockByRenderType"));
- mInitMap.put(new Pair<String, String>("func_147806_b", "renderFaceYPos"));
- mInitMap.put(new Pair<String, String>("func_147807_a", "renderBlockWall"));
- mInitMap.put(new Pair<String, String>("func_147808_b", "renderStandardBlockWithAmbientOcclusionPartial"));
- mInitMap.put(new Pair<String, String>("func_147809_c", "renderPistonExtension"));
- mInitMap.put(new Pair<String, String>("func_147889_b", "updateRendererSort"));
- mInitMap.put(new Pair<String, String>("func_147890_b", "preRenderBlocks"));
- mInitMap.put(new Pair<String, String>("func_147891_a", "postRenderBlocks"));
- mInitMap.put(new Pair<String, String>("func_147892_a", "updateRenderer"));
- mInitMap.put(new Pair<String, String>("func_147905_a", "isStaticEntity"));
- mInitMap.put(new Pair<String, String>("func_147906_a", "renderLivingLabel"));
- mInitMap.put(new Pair<String, String>("func_147936_a", "renderEntityStatic"));
- mInitMap.put(new Pair<String, String>("func_147937_a", "renderEntitySimple"));
- mInitMap.put(new Pair<String, String>("func_147938_a", "cacheActiveRenderInfo"));
- mInitMap.put(new Pair<String, String>("func_147939_a", "doRenderEntity"));
- mInitMap.put(new Pair<String, String>("func_147940_a", "renderEntityWithPosYaw"));
- mInitMap.put(new Pair<String, String>("func_147942_a", "deleteTexture"));
- mInitMap.put(new Pair<String, String>("func_147946_a", "allocateTextureImpl"));
- mInitMap.put(new Pair<String, String>("func_147947_a", "uploadTextureSub"));
- mInitMap.put(new Pair<String, String>("func_147948_a", "prepareAnisotropicData"));
- mInitMap.put(new Pair<String, String>("func_147949_a", "generateMipmapData"));
- }
+ Preloader_Logger.INFO("[DevHelper] srgToForge size: " + srgToForge.size());
+ Preloader_Logger.INFO("[DevHelper] forgeToSrg size: " + forgeToSrg.size());
+ Preloader_Logger.INFO("[DevHelper] obToDeOb size: " + obToDeOb.size());
+ Preloader_Logger.INFO("[DevHelper] deObToOb size: " + deObToOb.size());
- private static void init2() {
- mInitMap.put(new Pair<String, String>("func_147951_b", "setTextureBlurred"));
- mInitMap.put(new Pair<String, String>("func_147955_a", "uploadTextureMipmap"));
- mInitMap.put(new Pair<String, String>("func_147960_a", "prepareAnisotropicFiltering"));
- mInitMap.put(new Pair<String, String>("func_147961_a", "fixTransparentPixels"));
- mInitMap.put(new Pair<String, String>("func_147962_a", "getFrameTextureData"));
- mInitMap.put(new Pair<String, String>("func_147963_d", "generateMipmaps"));
- mInitMap.put(new Pair<String, String>("func_147964_a", "loadSprite"));
- mInitMap.put(new Pair<String, String>("func_147965_a", "getFrameTextureData"));
- mInitMap.put(new Pair<String, String>("func_147969_b", "getMipmapDimension"));
- mInitMap.put(new Pair<String, String>("func_147984_b", "getShaderUniformOrDefault"));
- mInitMap.put(new Pair<String, String>("func_147985_d", "markDirty"));
- mInitMap.put(new Pair<String, String>("func_147986_h", "getProgram"));
- mInitMap.put(new Pair<String, String>("func_147987_b", "parseUniform"));
- mInitMap.put(new Pair<String, String>("func_147988_a", "deleteShader"));
- mInitMap.put(new Pair<String, String>("func_147989_e", "getVertexShaderLoader"));
- mInitMap.put(new Pair<String, String>("func_147990_i", "setupUniforms"));
- mInitMap.put(new Pair<String, String>("func_147991_a", "getShaderUniform"));
- mInitMap.put(new Pair<String, String>("func_147992_a", "addSamplerTexture"));
- mInitMap.put(new Pair<String, String>("func_147993_b", "endShader"));
- mInitMap.put(new Pair<String, String>("func_147994_f", "getFragmentShaderLoader"));
- mInitMap.put(new Pair<String, String>("func_147995_c", "useShader"));
- mInitMap.put(new Pair<String, String>("func_147996_a", "parseSampler"));
- mInitMap.put(new Pair<String, String>("func_148017_a", "getFramebuffer"));
- mInitMap.put(new Pair<String, String>("func_148018_a", "loadShaderGroup"));
- mInitMap.put(new Pair<String, String>("func_148020_a", "addFramebuffer"));
- mInitMap.put(new Pair<String, String>("func_148021_a", "deleteShaderGroup"));
- mInitMap.put(new Pair<String, String>("func_148022_b", "getShaderGroupName"));
- mInitMap.put(new Pair<String, String>("func_148023_a", "addShader"));
- mInitMap.put(new Pair<String, String>("func_148024_c", "resetProjectionMatrix"));
- mInitMap.put(new Pair<String, String>("func_148026_a", "createBindFramebuffers"));
- mInitMap.put(new Pair<String, String>("func_148027_a", "initTarget"));
- mInitMap.put(new Pair<String, String>("func_148028_c", "initUniform"));
- mInitMap.put(new Pair<String, String>("func_148040_d", "preLoadShader"));
- mInitMap.put(new Pair<String, String>("func_148041_a", "addAuxFramebuffer"));
- mInitMap.put(new Pair<String, String>("func_148042_a", "loadShader"));
- mInitMap.put(new Pair<String, String>("func_148043_c", "getShaderManager"));
- mInitMap.put(new Pair<String, String>("func_148044_b", "deleteShader"));
- mInitMap.put(new Pair<String, String>("func_148045_a", "setProjectionMatrix"));
- mInitMap.put(new Pair<String, String>("func_148054_b", "deleteShader"));
- mInitMap.put(new Pair<String, String>("func_148055_a", "getShaderFilename"));
- mInitMap.put(new Pair<String, String>("func_148056_a", "attachShader"));
- mInitMap.put(new Pair<String, String>("func_148057_a", "loadShader"));
- mInitMap.put(new Pair<String, String>("func_148062_a", "getShaderName"));
- mInitMap.put(new Pair<String, String>("func_148063_b", "getShaderExtension"));
- mInitMap.put(new Pair<String, String>("func_148064_d", "getLoadedShaders"));
- mInitMap.put(new Pair<String, String>("func_148065_c", "getShaderMode"));
- mInitMap.put(new Pair<String, String>("func_148074_b", "getStaticShaderLinkHelper"));
- mInitMap.put(new Pair<String, String>("func_148075_b", "linkProgram"));
- mInitMap.put(new Pair<String, String>("func_148076_a", "setmInitMap.put(newStaticShaderLinkHelper"));
- mInitMap.put(new Pair<String, String>("func_148077_a", "deleteShader"));
- mInitMap.put(new Pair<String, String>("func_148078_c", "createProgram"));
- mInitMap.put(new Pair<String, String>("func_148081_a", "set"));
- mInitMap.put(new Pair<String, String>("func_148082_k", "uploadFloatMatrix"));
- mInitMap.put(new Pair<String, String>("func_148083_a", "set"));
- mInitMap.put(new Pair<String, String>("func_148084_b", "setUniformLocation"));
- mInitMap.put(new Pair<String, String>("func_148085_a", "parseType"));
- mInitMap.put(new Pair<String, String>("func_148086_a", "getShaderName"));
- mInitMap.put(new Pair<String, String>("func_148087_a", "set"));
- mInitMap.put(new Pair<String, String>("func_148088_a", "set"));
- mInitMap.put(new Pair<String, String>("func_148089_j", "uploadFloat"));
- mInitMap.put(new Pair<String, String>("func_148090_a", "set"));
- mInitMap.put(new Pair<String, String>("func_148091_i", "uploadInt"));
- mInitMap.put(new Pair<String, String>("func_148093_b", "upload"));
- mInitMap.put(new Pair<String, String>("func_148094_a", "set"));
- mInitMap.put(new Pair<String, String>("func_148095_a", "set"));
- mInitMap.put(new Pair<String, String>("func_148096_h", "markDirty"));
- mInitMap.put(new Pair<String, String>("func_148097_a", "set"));
- mInitMap.put(new Pair<String, String>("func_148120_b", "drawSelectionBox"));
- mInitMap.put(new Pair<String, String>("func_148121_k", "bindAmountScrolled"));
- mInitMap.put(new Pair<String, String>("func_148122_a", "setDimensions"));
- mInitMap.put(new Pair<String, String>("func_148123_a", "drawBackground"));
- mInitMap.put(new Pair<String, String>("func_148124_c", "getSlotIndexFromScreenCoords"));
- mInitMap.put(new Pair<String, String>("func_148125_i", "getEnabled"));
- mInitMap.put(new Pair<String, String>("func_148126_a", "drawSlot"));
- mInitMap.put(new Pair<String, String>("func_148127_b", "getSize"));
- mInitMap.put(new Pair<String, String>("func_148128_a", "drawScreen"));
- mInitMap.put(new Pair<String, String>("func_148129_a", "drawListHeader"));
- mInitMap.put(new Pair<String, String>("func_148130_a", "setShowSelectionBox"));
- mInitMap.put(new Pair<String, String>("func_148131_a", "isSelected"));
- mInitMap.put(new Pair<String, String>("func_148133_a", "setHasListHeader"));
- mInitMap.put(new Pair<String, String>("func_148134_d", "registerScrollButtons"));
- mInitMap.put(new Pair<String, String>("func_148136_c", "overlayBackground"));
- mInitMap.put(new Pair<String, String>("func_148137_d", "getScrollBarX"));
- mInitMap.put(new Pair<String, String>("func_148138_e", "getContentHeight"));
- mInitMap.put(new Pair<String, String>("func_148139_c", "getListWidth"));
- mInitMap.put(new Pair<String, String>("func_148140_g", "setSlotXBoundsFromLeft"));
- mInitMap.put(new Pair<String, String>("func_148141_e", "isMouseYWithinSlotBounds"));
- mInitMap.put(new Pair<String, String>("func_148143_b", "setEnabled"));
- mInitMap.put(new Pair<String, String>("func_148144_a", "elementClicked"));
- mInitMap.put(new Pair<String, String>("func_148145_f", "scrollBy"));
- mInitMap.put(new Pair<String, String>("func_148146_j", "getSlotHeight"));
- mInitMap.put(new Pair<String, String>("func_148147_a", "actionPerformed"));
- mInitMap.put(new Pair<String, String>("func_148148_g", "getAmountScrolled"));
- mInitMap.put(new Pair<String, String>("func_148180_b", "getListEntry"));
- mInitMap.put(new Pair<String, String>("func_148201_l", "getList"));
- mInitMap.put(new Pair<String, String>("func_148202_k", "getListHeader"));
- mInitMap.put(new Pair<String, String>("func_148254_d", "getToken"));
- mInitMap.put(new Pair<String, String>("func_148255_b", "getPlayerID"));
- mInitMap.put(new Pair<String, String>("func_148256_e", "getProfile"));
- mInitMap.put(new Pair<String, String>("func_148259_a", "saveScreenshot"));
- mInitMap.put(new Pair<String, String>("func_148260_a", "saveScreenshot"));
- mInitMap.put(new Pair<String, String>("func_148262_d", "denormalizeValue"));
- mInitMap.put(new Pair<String, String>("func_148263_a", "setValueMax"));
- mInitMap.put(new Pair<String, String>("func_148264_f", "snapToStep"));
- mInitMap.put(new Pair<String, String>("func_148266_c", "normalizeValue"));
- mInitMap.put(new Pair<String, String>("func_148267_f", "getValueMax"));
- mInitMap.put(new Pair<String, String>("func_148268_e", "snapToStepClamp"));
- mInitMap.put(new Pair<String, String>("func_148277_b", "mouseReleased"));
- mInitMap.put(new Pair<String, String>("func_148278_a", "mousePressed"));
- mInitMap.put(new Pair<String, String>("func_148279_a", "drawEntry"));
- mInitMap.put(new Pair<String, String>("func_148289_a", "getLanServer"));
- mInitMap.put(new Pair<String, String>("func_148296_a", "getServerData"));
- mInitMap.put(new Pair<String, String>("func_148297_b", "prepareServerIcon"));
- mInitMap.put(new Pair<String, String>("func_148329_a", "scrollTo"));
- mInitMap.put(new Pair<String, String>("func_148334_a", "generatemInitMap.put(newRandomName"));
- mInitMap.put(new Pair<String, String>("func_148335_a", "reseedRandomGenerator"));
- mInitMap.put(new Pair<String, String>("func_148522_a", "onDownloadComplete"));
- mInitMap.put(new Pair<String, String>("func_148526_a", "obtainResourcePack"));
- mInitMap.put(new Pair<String, String>("func_148530_e", "getResourcePackInstance"));
- mInitMap.put(new Pair<String, String>("func_148535_c", "getListMipmaps"));
- mInitMap.put(new Pair<String, String>("func_148537_a", "sendPacketToAllPlayersInDimension"));
- mInitMap.put(new Pair<String, String>("func_148539_a", "sendChatMsg"));
- mInitMap.put(new Pair<String, String>("func_148540_a", "sendPacketToAllPlayers"));
- mInitMap.put(new Pair<String, String>("func_148541_a", "sendToAllNear"));
- mInitMap.put(new Pair<String, String>("func_148542_a", "allowUserToConnect"));
- mInitMap.put(new Pair<String, String>("func_148543_a", "sendToAllNearExcept"));
- mInitMap.put(new Pair<String, String>("func_148544_a", "sendChatMsgImpl"));
- mInitMap.put(new Pair<String, String>("func_148545_a", "createPlayerForUser"));
- mInitMap.put(new Pair<String, String>("func_148552_f", "isStreaming"));
- mInitMap.put(new Pair<String, String>("func_148553_a", "setSoundEntryVolume"));
- mInitMap.put(new Pair<String, String>("func_148554_a", "setSoundEntryWeight"));
- mInitMap.put(new Pair<String, String>("func_148555_d", "getSoundEntryWeight"));
- mInitMap.put(new Pair<String, String>("func_148556_a", "getSoundEntryName"));
- mInitMap.put(new Pair<String, String>("func_148557_a", "setStreaming"));
- mInitMap.put(new Pair<String, String>("func_148558_b", "getSoundEntryVolume"));
- mInitMap.put(new Pair<String, String>("func_148559_b", "setSoundEntryPitch"));
- mInitMap.put(new Pair<String, String>("func_148560_c", "getSoundEntryPitch"));
- mInitMap.put(new Pair<String, String>("func_148561_a", "setSoundEntryName"));
- mInitMap.put(new Pair<String, String>("func_148562_a", "setSoundEntryType"));
- mInitMap.put(new Pair<String, String>("func_148563_e", "getSoundEntryType"));
- mInitMap.put(new Pair<String, String>("func_148570_a", "getSoundList"));
- mInitMap.put(new Pair<String, String>("func_148571_a", "setSoundCategory"));
- mInitMap.put(new Pair<String, String>("func_148572_a", "setReplaceExisting"));
- mInitMap.put(new Pair<String, String>("func_148573_c", "getSoundCategory"));
- mInitMap.put(new Pair<String, String>("func_148574_b", "canReplaceExisting"));
- mInitMap.put(new Pair<String, String>("func_148580_a", "getType"));
- mInitMap.put(new Pair<String, String>("func_148586_a", "getTypeInt"));
- mInitMap.put(new Pair<String, String>("func_148594_a", "getNormalizedVolume"));
- mInitMap.put(new Pair<String, String>("func_148595_a", "getSoundCategoryVolume"));
- mInitMap.put(new Pair<String, String>("func_148596_a", "reloadSoundSystem"));
- mInitMap.put(new Pair<String, String>("func_148597_a", "isSoundPlaying"));
- mInitMap.put(new Pair<String, String>("func_148599_a", "playDelayedSound"));
- mInitMap.put(new Pair<String, String>("func_148601_a", "setSoundCategoryVolume"));
- mInitMap.put(new Pair<String, String>("func_148602_b", "stopSound"));
- mInitMap.put(new Pair<String, String>("func_148604_f", "resumeAllSounds"));
- mInitMap.put(new Pair<String, String>("func_148605_d", "updateAllSounds"));
- mInitMap.put(new Pair<String, String>("func_148606_a", "getNormalizedPitch"));
- mInitMap.put(new Pair<String, String>("func_148608_i", "loadSoundSystem"));
- mInitMap.put(new Pair<String, String>("func_148610_e", "pauseAllSounds"));
- mInitMap.put(new Pair<String, String>("func_148611_c", "playSound"));
- mInitMap.put(new Pair<String, String>("func_148612_a", "getURLForSoundResource"));
- mInitMap.put(new Pair<String, String>("func_148613_b", "unloadSoundSystem"));
- mInitMap.put(new Pair<String, String>("func_148614_c", "stopAllSounds"));
- mInitMap.put(new Pair<String, String>("func_148615_a", "setListener"));
- mInitMap.put(new Pair<String, String>("func_148633_c", "getMaxDelay"));
- mInitMap.put(new Pair<String, String>("func_148634_b", "getMinDelay"));
- mInitMap.put(new Pair<String, String>("func_148635_a", "getMusicTickerLocation"));
- mInitMap.put(new Pair<String, String>("func_148647_b", "setVolume"));
- mInitMap.put(new Pair<String, String>("func_148648_d", "isStreamingSound"));
- mInitMap.put(new Pair<String, String>("func_148649_c", "getVolume"));
- mInitMap.put(new Pair<String, String>("func_148650_b", "getPitch"));
- mInitMap.put(new Pair<String, String>("func_148651_a", "setPitch"));
- mInitMap.put(new Pair<String, String>("func_148652_a", "getSoundPoolEntryLocation"));
- mInitMap.put(new Pair<String, String>("func_148727_a", "addSoundToEventPool"));
- mInitMap.put(new Pair<String, String>("func_148728_d", "getSoundCategory"));
- mInitMap.put(new Pair<String, String>("func_148729_c", "getSoundEventLocation"));
- mInitMap.put(new Pair<String, String>("func_148740_a", "createUnderlyingMap"));
- mInitMap.put(new Pair<String, String>("func_148741_d", "containsKey"));
- mInitMap.put(new Pair<String, String>("func_148742_b", "getKeys"));
- mInitMap.put(new Pair<String, String>("func_148750_c", "getNameForObject"));
- mInitMap.put(new Pair<String, String>("func_148753_b", "containsId"));
- mInitMap.put(new Pair<String, String>("func_148754_a", "getObjectById"));
- mInitMap.put(new Pair<String, String>("func_148755_c", "ensureNamespaced"));
- mInitMap.put(new Pair<String, String>("func_148756_a", "addObject"));
- mInitMap.put(new Pair<String, String>("func_148757_b", "getIDForObject"));
- mInitMap.put(new Pair<String, String>("func_148762_a", "registerSound"));
- mInitMap.put(new Pair<String, String>("func_148763_c", "clearMap"));
- mInitMap.put(new Pair<String, String>("func_148821_a", "glBlendFunc"));
- mInitMap.put(new Pair<String, String>("func_148822_b", "isFramebufferEnabled"));
- mInitMap.put(new Pair<String, String>("func_148833_a", "processPacket"));
- mInitMap.put(new Pair<String, String>("func_148834_a", "readBlob"));
- mInitMap.put(new Pair<String, String>("func_148835_b", "serialize"));
- mInitMap.put(new Pair<String, String>("func_148836_a", "hasPriority"));
- mInitMap.put(new Pair<String, String>("func_148837_a", "readPacketData"));
- mInitMap.put(new Pair<String, String>("func_148838_a", "writeBlob"));
- mInitMap.put(new Pair<String, String>("func_148839_a", "generatePacket"));
- mInitMap.put(new Pair<String, String>("func_148840_b", "writePacketData"));
- mInitMap.put(new Pair<String, String>("func_148853_f", "getTileEntityType"));
- mInitMap.put(new Pair<String, String>("func_148854_e", "getZ"));
- mInitMap.put(new Pair<String, String>("func_148855_d", "getY"));
- mInitMap.put(new Pair<String, String>("func_148856_c", "getX"));
- mInitMap.put(new Pair<String, String>("func_148857_g", "getNbtCompound"));
- mInitMap.put(new Pair<String, String>("func_148864_h", "getData2"));
- mInitMap.put(new Pair<String, String>("func_148865_f", "getZ"));
- mInitMap.put(new Pair<String, String>("func_148866_e", "getY"));
- mInitMap.put(new Pair<String, String>("func_148867_d", "getX"));
- mInitMap.put(new Pair<String, String>("func_148868_c", "getBlockType"));
- mInitMap.put(new Pair<String, String>("func_148869_g", "getData1"));
- mInitMap.put(new Pair<String, String>("func_148916_d", "isChat"));
- mInitMap.put(new Pair<String, String>("func_149089_e", "getZ"));
- mInitMap.put(new Pair<String, String>("func_149090_d", "getY"));
- mInitMap.put(new Pair<String, String>("func_149091_a", "getPlayer"));
- mInitMap.put(new Pair<String, String>("func_149092_c", "getX"));
- mInitMap.put(new Pair<String, String>("func_149101_g", "getFlySpeed"));
- mInitMap.put(new Pair<String, String>("func_149102_b", "setFlying"));
- mInitMap.put(new Pair<String, String>("func_149103_f", "isCreativeMode"));
- mInitMap.put(new Pair<String, String>("func_149104_a", "setFlySpeed"));
- mInitMap.put(new Pair<String, String>("func_149105_e", "isAllowFlying"));
- mInitMap.put(new Pair<String, String>("func_149106_d", "isFlying"));
- mInitMap.put(new Pair<String, String>("func_149107_h", "getWalkSpeed"));
- mInitMap.put(new Pair<String, String>("func_149108_a", "setInvulnerable"));
- mInitMap.put(new Pair<String, String>("func_149109_c", "setAllowFlying"));
- mInitMap.put(new Pair<String, String>("func_149110_b", "setWalkSpeed"));
- mInitMap.put(new Pair<String, String>("func_149111_d", "setCreativeMode"));
- mInitMap.put(new Pair<String, String>("func_149112_c", "isInvulnerable"));
- mInitMap.put(new Pair<String, String>("func_149187_d", "getData"));
- mInitMap.put(new Pair<String, String>("func_149188_c", "getMapId"));
- mInitMap.put(new Pair<String, String>("func_149239_h", "getPosZ"));
- mInitMap.put(new Pair<String, String>("func_149240_f", "getPosX"));
- mInitMap.put(new Pair<String, String>("func_149241_e", "getSoundData"));
- mInitMap.put(new Pair<String, String>("func_149242_d", "getSoundType"));
- mInitMap.put(new Pair<String, String>("func_149243_g", "getPosY"));
- mInitMap.put(new Pair<String, String>("func_149244_c", "isSoundServerwide"));
- mInitMap.put(new Pair<String, String>("func_149289_c", "getClientTime"));
- mInitMap.put(new Pair<String, String>("func_149304_c", "getProfile"));
- mInitMap.put(new Pair<String, String>("func_149330_d", "getFoodLevel"));
- mInitMap.put(new Pair<String, String>("func_149331_e", "getSaturationLevel"));
- mInitMap.put(new Pair<String, String>("func_149332_c", "getHealth"));
- mInitMap.put(new Pair<String, String>("func_149419_c", "getMessage"));
- mInitMap.put(new Pair<String, String>("func_149421_d", "getType"));
- mInitMap.put(new Pair<String, String>("func_149435_c", "getStatus"));
- mInitMap.put(new Pair<String, String>("func_149439_c", "getMessage"));
- mInitMap.put(new Pair<String, String>("func_149460_c", "getKey"));
- mInitMap.put(new Pair<String, String>("func_149462_g", "getYaw"));
- mInitMap.put(new Pair<String, String>("func_149463_k", "getRotating"));
- mInitMap.put(new Pair<String, String>("func_149464_c", "getPositionX"));
- mInitMap.put(new Pair<String, String>("func_149467_d", "getPositionY"));
- mInitMap.put(new Pair<String, String>("func_149470_h", "getPitch"));
- mInitMap.put(new Pair<String, String>("func_149471_f", "getStance"));
- mInitMap.put(new Pair<String, String>("func_149472_e", "getPositionZ"));
- mInitMap.put(new Pair<String, String>("func_149482_g", "getFlySpeed"));
- mInitMap.put(new Pair<String, String>("func_149483_b", "setFlying"));
- mInitMap.put(new Pair<String, String>("func_149484_f", "isCreativeMode"));
- mInitMap.put(new Pair<String, String>("func_149485_a", "setFlySpeed"));
- mInitMap.put(new Pair<String, String>("func_149486_e", "isAllowFlying"));
- mInitMap.put(new Pair<String, String>("func_149488_d", "isFlying"));
- mInitMap.put(new Pair<String, String>("func_149489_h", "getWalkSpeed"));
- mInitMap.put(new Pair<String, String>("func_149490_a", "setInvulnerable"));
- mInitMap.put(new Pair<String, String>("func_149491_c", "setAllowFlying"));
- mInitMap.put(new Pair<String, String>("func_149492_b", "setWalkSpeed"));
- mInitMap.put(new Pair<String, String>("func_149493_d", "setCreativeMode"));
- mInitMap.put(new Pair<String, String>("func_149494_c", "isInvulnerable"));
- mInitMap.put(new Pair<String, String>("func_149501_f", "getDiggingBlockFace"));
- mInitMap.put(new Pair<String, String>("func_149502_e", "getDiggedBlockZ"));
- mInitMap.put(new Pair<String, String>("func_149503_d", "getDiggedBlockY"));
- mInitMap.put(new Pair<String, String>("func_149505_c", "getDiggedBlockX"));
- mInitMap.put(new Pair<String, String>("func_149506_g", "getDiggedBlockStatus"));
- mInitMap.put(new Pair<String, String>("func_149518_g", "getDifficulty"));
- mInitMap.put(new Pair<String, String>("func_149519_h", "isShowCape"));
- mInitMap.put(new Pair<String, String>("func_149520_f", "isColorsEnabled"));
- mInitMap.put(new Pair<String, String>("func_149521_d", "getView"));
- mInitMap.put(new Pair<String, String>("func_149523_e", "getChatVisibility"));
- mInitMap.put(new Pair<String, String>("func_149524_c", "getLang"));
- mInitMap.put(new Pair<String, String>("func_149532_c", "getId"));
- mInitMap.put(new Pair<String, String>("func_149533_d", "getUid"));
- mInitMap.put(new Pair<String, String>("func_149537_d", "getButton"));
- mInitMap.put(new Pair<String, String>("func_149539_c", "getId"));
- mInitMap.put(new Pair<String, String>("func_149542_h", "getMode"));
- mInitMap.put(new Pair<String, String>("func_149543_e", "getUsedButton"));
- mInitMap.put(new Pair<String, String>("func_149544_d", "getSlotId"));
- mInitMap.put(new Pair<String, String>("func_149546_g", "getClickedItem"));
- mInitMap.put(new Pair<String, String>("func_149547_f", "getActionNumber"));
- mInitMap.put(new Pair<String, String>("func_149548_c", "getWindowId"));
- mInitMap.put(new Pair<String, String>("func_149558_e", "getData"));
- mInitMap.put(new Pair<String, String>("func_149559_c", "getChannel"));
- mInitMap.put(new Pair<String, String>("func_149564_a", "getEntityFromWorld"));
- mInitMap.put(new Pair<String, String>("func_149565_c", "getAction"));
- mInitMap.put(new Pair<String, String>("func_149568_f", "getPlacedBlockDirection"));
- mInitMap.put(new Pair<String, String>("func_149569_i", "getPlacedBlockOffsetY"));
- mInitMap.put(new Pair<String, String>("func_149570_e", "getPlacedBlockZ"));
- mInitMap.put(new Pair<String, String>("func_149571_d", "getPlacedBlockY"));
- mInitMap.put(new Pair<String, String>("func_149573_h", "getPlacedBlockOffsetX"));
- mInitMap.put(new Pair<String, String>("func_149574_g", "getStack"));
- mInitMap.put(new Pair<String, String>("func_149575_j", "getPlacedBlockOffsetZ"));
- mInitMap.put(new Pair<String, String>("func_149576_c", "getPlacedBlockX"));
- mInitMap.put(new Pair<String, String>("func_149585_e", "getZ"));
- mInitMap.put(new Pair<String, String>("func_149586_d", "getY"));
- mInitMap.put(new Pair<String, String>("func_149588_c", "getX"));
- mInitMap.put(new Pair<String, String>("func_149589_f", "getLines"));
- mInitMap.put(new Pair<String, String>("func_149594_c", "getRequestedState"));
- mInitMap.put(new Pair<String, String>("func_149595_d", "getProtocolVersion"));
- mInitMap.put(new Pair<String, String>("func_149614_c", "getSlotId"));
- mInitMap.put(new Pair<String, String>("func_149616_d", "getForwardSpeed"));
- mInitMap.put(new Pair<String, String>("func_149617_f", "isSneaking"));
- mInitMap.put(new Pair<String, String>("func_149618_e", "isJumping"));
- mInitMap.put(new Pair<String, String>("func_149620_c", "getStrafeSpeed"));
- mInitMap.put(new Pair<String, String>("func_149625_d", "getStack"));
- mInitMap.put(new Pair<String, String>("func_149627_c", "getSlotId"));
- mInitMap.put(new Pair<String, String>("func_149633_g", "getSelectedBoundingBoxFromPool"));
- mInitMap.put(new Pair<String, String>("func_149634_a", "getBlockFromItem"));
- mInitMap.put(new Pair<String, String>("func_149635_D", "getBlockColor"));
- mInitMap.put(new Pair<String, String>("func_149636_a", "harvestBlock"));
- mInitMap.put(new Pair<String, String>("func_149637_q", "isBlockNormalCube"));
- mInitMap.put(new Pair<String, String>("func_149638_a", "getExplosionResistance"));
- mInitMap.put(new Pair<String, String>("func_149639_l", "fillWithRain"));
- mInitMap.put(new Pair<String, String>("func_149640_a", "modifyEntityVelocity"));
- mInitMap.put(new Pair<String, String>("func_149641_N", "getTextureName"));
- mInitMap.put(new Pair<String, String>("func_149642_a", "dropBlockAsItem"));
- mInitMap.put(new Pair<String, String>("func_149643_k", "getDamageValue"));
- mInitMap.put(new Pair<String, String>("func_149644_j", "createStackedBlock"));
- mInitMap.put(new Pair<String, String>("func_149645_b", "getRenderType"));
- mInitMap.put(new Pair<String, String>("func_149646_a", "shouldSideBeRendered"));
- mInitMap.put(new Pair<String, String>("func_149647_a", "setCreativeTab"));
- mInitMap.put(new Pair<String, String>("func_149648_K", "isFlowerPot"));
- mInitMap.put(new Pair<String, String>("func_149649_H", "disableStats"));
- mInitMap.put(new Pair<String, String>("func_149650_a", "getItemDropped"));
- mInitMap.put(new Pair<String, String>("func_149651_a", "registerIcons"));
- mInitMap.put(new Pair<String, String>("func_149652_G", "getEnableStats"));
- mInitMap.put(new Pair<String, String>("func_149653_t", "getTickRandomly"));
- mInitMap.put(new Pair<String, String>("func_149654_a", "isVecInsideYZBounds"));
- mInitMap.put(new Pair<String, String>("func_149655_b", "isPassable"));
- mInitMap.put(new Pair<String, String>("func_149656_h", "getMobilityFlag"));
- mInitMap.put(new Pair<String, String>("func_149657_c", "dropXpOnBlockBreak"));
- mInitMap.put(new Pair<String, String>("func_149658_d", "setTextureName"));
- mInitMap.put(new Pair<String, String>("func_149659_a", "canDropFromExplosion"));
- mInitMap.put(new Pair<String, String>("func_149660_a", "onBlockPlaced"));
- mInitMap.put(new Pair<String, String>("func_149661_c", "isVecInsideXYBounds"));
- mInitMap.put(new Pair<String, String>("func_149662_c", "isOpaqueCube"));
- mInitMap.put(new Pair<String, String>("func_149663_c", "setUnlocalizedName"));
- mInitMap.put(new Pair<String, String>("func_149664_b", "onBlockDestroyedByPlayer"));
- mInitMap.put(new Pair<String, String>("func_149665_z", "getBlockBoundsMinY"));
- mInitMap.put(new Pair<String, String>("func_149666_a", "getSubBlocks"));
- mInitMap.put(new Pair<String, String>("func_149667_c", "isAssociatedBlock"));
- mInitMap.put(new Pair<String, String>("func_149668_a", "getCollisionBoundingBoxFromPool"));
- mInitMap.put(new Pair<String, String>("func_149669_A", "getBlockBoundsMaxY"));
- mInitMap.put(new Pair<String, String>("func_149670_a", "onEntityCollidedWithBlock"));
- mInitMap.put(new Pair<String, String>("func_149671_p", "registerBlocks"));
- mInitMap.put(new Pair<String, String>("func_149672_a", "setStepSound"));
- mInitMap.put(new Pair<String, String>("func_149673_e", "getIcon"));
- mInitMap.put(new Pair<String, String>("func_149674_a", "updateTick"));
- mInitMap.put(new Pair<String, String>("func_149675_a", "setTickRandomly"));
- mInitMap.put(new Pair<String, String>("func_149676_a", "setBlockBounds"));
- mInitMap.put(new Pair<String, String>("func_149677_c", "getMixedBrightnessForBlock"));
- mInitMap.put(new Pair<String, String>("func_149678_a", "canStopRayTrace"));
- mInitMap.put(new Pair<String, String>("func_149679_a", "quantityDroppedWithBonus"));
- mInitMap.put(new Pair<String, String>("func_149680_a", "isEqualTo"));
- mInitMap.put(new Pair<String, String>("func_149681_a", "onBlockHarvested"));
- mInitMap.put(new Pair<String, String>("func_149682_b", "getIdFromBlock"));
- mInitMap.put(new Pair<String, String>("func_149683_g", "setBlockBoundsForItemRender"));
- mInitMap.put(new Pair<String, String>("func_149684_b", "getBlockFromName"));
- mInitMap.put(new Pair<String, String>("func_149685_I", "getAmbientOcclusionLightValue"));
- mInitMap.put(new Pair<String, String>("func_149686_d", "renderAsNormalBlock"));
- mInitMap.put(new Pair<String, String>("func_149687_b", "isVecInsideXZBounds"));
- mInitMap.put(new Pair<String, String>("func_149688_o", "getMaterial"));
- mInitMap.put(new Pair<String, String>("func_149689_a", "onBlockPlacedBy"));
- mInitMap.put(new Pair<String, String>("func_149690_a", "dropBlockAsItemWithChance"));
- mInitMap.put(new Pair<String, String>("func_149691_a", "getIcon"));
- mInitMap.put(new Pair<String, String>("func_149692_a", "damageDropped"));
- mInitMap.put(new Pair<String, String>("func_149693_C", "getBlockBoundsMaxZ"));
- mInitMap.put(new Pair<String, String>("func_149694_d", "getItem"));
- mInitMap.put(new Pair<String, String>("func_149695_a", "onNeighborBlockChange"));
- mInitMap.put(new Pair<String, String>("func_149696_a", "onBlockEventReceived"));
- mInitMap.put(new Pair<String, String>("func_149697_b", "dropBlockAsItem"));
- mInitMap.put(new Pair<String, String>("func_149698_L", "requiresUpdates"));
- mInitMap.put(new Pair<String, String>("func_149699_a", "onBlockClicked"));
- mInitMap.put(new Pair<String, String>("func_149700_E", "canSilkHarvest"));
- mInitMap.put(new Pair<String, String>("func_149701_w", "getRenderBlockPass"));
- mInitMap.put(new Pair<String, String>("func_149702_O", "getItemIconName"));
- mInitMap.put(new Pair<String, String>("func_149703_v", "isCollidable"));
- mInitMap.put(new Pair<String, String>("func_149704_x", "getBlockBoundsMinX"));
- mInitMap.put(new Pair<String, String>("func_149705_a", "canReplace"));
- mInitMap.put(new Pair<String, String>("func_149706_B", "getBlockBoundsMinZ"));
- mInitMap.put(new Pair<String, String>("func_149707_d", "canPlaceBlockOnSide"));
- mInitMap.put(new Pair<String, String>("func_149708_J", "getCreativeTabToDisplayOn"));
- mInitMap.put(new Pair<String, String>("func_149709_b", "isProvidingWeakPower"));
- mInitMap.put(new Pair<String, String>("func_149710_n", "getUseNeighborBrightness"));
- mInitMap.put(new Pair<String, String>("func_149711_c", "setHardness"));
- mInitMap.put(new Pair<String, String>("func_149712_f", "getBlockHardness"));
- mInitMap.put(new Pair<String, String>("func_149713_g", "setLightOpacity"));
- mInitMap.put(new Pair<String, String>("func_149714_e", "onPostBlockPlaced"));
- mInitMap.put(new Pair<String, String>("func_149715_a", "setLightLevel"));
- mInitMap.put(new Pair<String, String>("func_149716_u", "hasTileEntity"));
- mInitMap.put(new Pair<String, String>("func_149717_k", "getLightOpacity"));
- mInitMap.put(new Pair<String, String>("func_149718_j", "canBlockStay"));
- mInitMap.put(new Pair<String, String>("func_149719_a", "setBlockBoundsBasedOnState"));
- mInitMap.put(new Pair<String, String>("func_149720_d", "colorMultiplier"));
- mInitMap.put(new Pair<String, String>("func_149721_r", "isNormalCube"));
- mInitMap.put(new Pair<String, String>("func_149722_s", "setBlockUnbreakable"));
- mInitMap.put(new Pair<String, String>("func_149723_a", "onBlockDestroyedByExplosion"));
- mInitMap.put(new Pair<String, String>("func_149724_b", "onEntityWalking"));
- mInitMap.put(new Pair<String, String>("func_149725_f", "onBlockPreDestroy"));
- mInitMap.put(new Pair<String, String>("func_149726_b", "onBlockAdded"));
- mInitMap.put(new Pair<String, String>("func_149727_a", "onBlockActivated"));
- mInitMap.put(new Pair<String, String>("func_149728_f", "getMapColor"));
- mInitMap.put(new Pair<String, String>("func_149729_e", "getBlockById"));
- mInitMap.put(new Pair<String, String>("func_149730_j", "isFullBlock"));
- mInitMap.put(new Pair<String, String>("func_149731_a", "collisionRayTrace"));
- mInitMap.put(new Pair<String, String>("func_149732_F", "getLocalizedName"));
- mInitMap.put(new Pair<String, String>("func_149733_h", "getBlockTextureFromSide"));
- mInitMap.put(new Pair<String, String>("func_149734_b", "randomDisplayTick"));
- mInitMap.put(new Pair<String, String>("func_149735_b", "getItemIcon"));
- mInitMap.put(new Pair<String, String>("func_149736_g", "getComparatorInputOverride"));
- mInitMap.put(new Pair<String, String>("func_149737_a", "getPlayerRelativeBlockHardness"));
- mInitMap.put(new Pair<String, String>("func_149738_a", "tickRate"));
- mInitMap.put(new Pair<String, String>("func_149739_a", "getUnlocalizedName"));
- mInitMap.put(new Pair<String, String>("func_149740_M", "hasComparatorInputOverride"));
- mInitMap.put(new Pair<String, String>("func_149741_i", "getRenderColor"));
- mInitMap.put(new Pair<String, String>("func_149742_c", "canPlaceBlockAt"));
- mInitMap.put(new Pair<String, String>("func_149743_a", "addCollisionBoxesToList"));
- mInitMap.put(new Pair<String, String>("func_149744_f", "canProvidePower"));
- mInitMap.put(new Pair<String, String>("func_149745_a", "quantityDropped"));
- mInitMap.put(new Pair<String, String>("func_149746_a", "onFallenUpon"));
- mInitMap.put(new Pair<String, String>("func_149747_d", "isBlockSolid"));
- mInitMap.put(new Pair<String, String>("func_149748_c", "isProvidingStrongPower"));
- mInitMap.put(new Pair<String, String>("func_149749_a", "breakBlock"));
- mInitMap.put(new Pair<String, String>("func_149750_m", "getLightValue"));
- mInitMap.put(new Pair<String, String>("func_149751_l", "isTranslucent"));
- mInitMap.put(new Pair<String, String>("func_149752_b", "setResistance"));
- mInitMap.put(new Pair<String, String>("func_149753_y", "getBlockBoundsMaxX"));
- mInitMap.put(new Pair<String, String>("func_149798_e", "getEffectiveFlowDecay"));
- mInitMap.put(new Pair<String, String>("func_149800_f", "getFlowVector"));
- mInitMap.put(new Pair<String, String>("func_149801_b", "getLiquidHeightPercent"));
- mInitMap.put(new Pair<String, String>("func_149802_a", "getFlowDirection"));
- mInitMap.put(new Pair<String, String>("func_149803_e", "getLiquidIcon"));
- mInitMap.put(new Pair<String, String>("func_149817_o", "isFlammable"));
- mInitMap.put(new Pair<String, String>("func_149818_n", "setNotStationary"));
- mInitMap.put(new Pair<String, String>("func_149819_b", "invertMetadata"));
- mInitMap.put(new Pair<String, String>("func_149825_a", "isFence"));
- mInitMap.put(new Pair<String, String>("func_149826_e", "canConnectFenceTo"));
- mInitMap.put(new Pair<String, String>("func_149828_a", "playSoundWhenFallen"));
- mInitMap.put(new Pair<String, String>("func_149829_a", "onStartFalling"));
- mInitMap.put(new Pair<String, String>("func_149831_e", "canFallBelow"));
- mInitMap.put(new Pair<String, String>("func_149840_c", "getFireIcon"));
- mInitMap.put(new Pair<String, String>("func_149841_a", "tryCatchFire"));
- mInitMap.put(new Pair<String, String>("func_149844_e", "canBlockCatchFire"));
- mInitMap.put(new Pair<String, String>("func_149845_m", "getChanceOfNeighborsEncouragingFire"));
- mInitMap.put(new Pair<String, String>("func_149847_e", "canNeighborBurn"));
- mInitMap.put(new Pair<String, String>("func_149851_a", "canFertilize"));
- mInitMap.put(new Pair<String, String>("func_149852_a", "shouldFertilize"));
- mInitMap.put(new Pair<String, String>("func_149853_b", "fertilize"));
- mInitMap.put(new Pair<String, String>("func_149854_a", "canPlaceBlockOn"));
- mInitMap.put(new Pair<String, String>("func_149855_e", "checkAndDropBlock"));
- mInitMap.put(new Pair<String, String>("func_149863_m", "fertilize"));
- mInitMap.put(new Pair<String, String>("func_149865_P", "getCrop"));
- mInitMap.put(new Pair<String, String>("func_149866_i", "getSeed"));
- mInitMap.put(new Pair<String, String>("func_149872_i", "getStemIcon"));
- mInitMap.put(new Pair<String, String>("func_149873_e", "getState"));
- mInitMap.put(new Pair<String, String>("func_149874_m", "fertilizeStem"));
- mInitMap.put(new Pair<String, String>("func_149878_d", "growTree"));
- mInitMap.put(new Pair<String, String>("func_149879_c", "markOrGrowMarked"));
- mInitMap.put(new Pair<String, String>("func_149884_c", "fertilizeMushroom"));
- mInitMap.put(new Pair<String, String>("func_149895_l", "getDirection"));
- mInitMap.put(new Pair<String, String>("func_149896_b", "isFenceGateOpen"));
- mInitMap.put(new Pair<String, String>("func_149898_i", "getBlockUnpowered"));
- mInitMap.put(new Pair<String, String>("func_149900_a", "isGettingInput"));
- mInitMap.put(new Pair<String, String>("func_149903_h", "getInputStrength"));
- mInitMap.put(new Pair<String, String>("func_149906_e", "getBlockPowered"));
- mInitMap.put(new Pair<String, String>("func_149909_d", "isRedstoneRepeaterBlockID"));
- mInitMap.put(new Pair<String, String>("func_149915_a", "createmInitMap.put(newTileEntity"));
- mInitMap.put(new Pair<String, String>("func_149916_e", "getHopperIcon"));
- mInitMap.put(new Pair<String, String>("func_149917_c", "getActiveStateFromMetadata"));
- mInitMap.put(new Pair<String, String>("func_149918_b", "getDirectionFromMetadata"));
- mInitMap.put(new Pair<String, String>("func_149919_e", "updateBlockData"));
- mInitMap.put(new Pair<String, String>("func_149931_a", "updateFurnaceBlockState"));
- mInitMap.put(new Pair<String, String>("func_149937_b", "getFacingDirection"));
- mInitMap.put(new Pair<String, String>("func_149939_a", "getIPositionFromBlockSource"));
- mInitMap.put(new Pair<String, String>("func_149951_m", "getInventory"));
- mInitMap.put(new Pair<String, String>("func_149952_n", "isDoubleChest"));
- mInitMap.put(new Pair<String, String>("func_149953_o", "isOcelotSittingOnTop"));
- mInitMap.put(new Pair<String, String>("func_149954_e", "initMetadata"));
- mInitMap.put(new Pair<String, String>("func_149959_e", "getIconBrewingStandBase"));
- mInitMap.put(new Pair<String, String>("func_149962_a", "getTileEntity"));
- mInitMap.put(new Pair<String, String>("func_149965_a", "makeWither"));
- mInitMap.put(new Pair<String, String>("func_149970_j", "getOutputStrength"));
- mInitMap.put(new Pair<String, String>("func_149971_e", "getTileEntityComparator"));
- mInitMap.put(new Pair<String, String>("func_149975_b", "isBlockHeadOfBed"));
- mInitMap.put(new Pair<String, String>("func_149976_c", "isBedOccupied"));
- mInitMap.put(new Pair<String, String>("func_149977_a", "getSafeExitLocation"));
- mInitMap.put(new Pair<String, String>("func_149978_e", "setBedBounds"));
- mInitMap.put(new Pair<String, String>("func_149979_a", "setBedOccupied"));
- mInitMap.put(new Pair<String, String>("func_149988_b", "getCocoaIcon"));
- mInitMap.put(new Pair<String, String>("func_149990_e", "getIconSideOverlay"));
- mInitMap.put(new Pair<String, String>("func_150000_e", "tryToCreatePortal"));
- mInitMap.put(new Pair<String, String>("func_150002_b", "getFullSlabName"));
- mInitMap.put(new Pair<String, String>("func_150012_g", "getFullMetadata"));
- mInitMap.put(new Pair<String, String>("func_150020_b", "isEnderEyeInserted"));
- mInitMap.put(new Pair<String, String>("func_150021_e", "getIconEndPortalFrameEye"));
- mInitMap.put(new Pair<String, String>("func_150024_a", "setWaterLevel"));
- mInitMap.put(new Pair<String, String>("func_150025_c", "getRenderLiquidLevel"));
- mInitMap.put(new Pair<String, String>("func_150026_e", "getCauldronIcon"));
- mInitMap.put(new Pair<String, String>("func_150027_b", "getPowerFromMeta"));
- mInitMap.put(new Pair<String, String>("func_150042_a", "updateNeighbor"));
- mInitMap.put(new Pair<String, String>("func_150043_b", "setBlockBoundsFromMeta"));
- mInitMap.put(new Pair<String, String>("func_150044_m", "canStay"));
- mInitMap.put(new Pair<String, String>("func_150045_e", "findSolidSide"));
- mInitMap.put(new Pair<String, String>("func_150046_n", "activateButton"));
- mInitMap.put(new Pair<String, String>("func_150048_a", "onRedstoneSignal"));
- mInitMap.put(new Pair<String, String>("func_150049_b_", "isRailBlockAt"));
- mInitMap.put(new Pair<String, String>("func_150050_e", "isPowered"));
- mInitMap.put(new Pair<String, String>("func_150051_a", "isRailBlock"));
- mInitMap.put(new Pair<String, String>("func_150052_a", "refreshTrackShape"));
- mInitMap.put(new Pair<String, String>("func_150060_c", "getPowerFromMeta"));
- mInitMap.put(new Pair<String, String>("func_150061_a", "getSensitiveAABB"));
- mInitMap.put(new Pair<String, String>("func_150062_a", "setStateIfMobInteractsWithPlate"));
- mInitMap.put(new Pair<String, String>("func_150063_b", "setBlockBoundsFromMeta"));
- mInitMap.put(new Pair<String, String>("func_150064_a_", "updateNeighbors"));
- mInitMap.put(new Pair<String, String>("func_150065_e", "getPlateState"));
- mInitMap.put(new Pair<String, String>("func_150066_d", "getMetaFromPower"));
- mInitMap.put(new Pair<String, String>("func_150071_a", "determineOrientation"));
- mInitMap.put(new Pair<String, String>("func_150072_a", "isIndirectlyPowered"));
- mInitMap.put(new Pair<String, String>("func_150073_e", "getPistonExtensionTexture"));
- mInitMap.put(new Pair<String, String>("func_150074_e", "getPistonBaseIcon"));
- mInitMap.put(new Pair<String, String>("func_150075_c", "isExtended"));
- mInitMap.put(new Pair<String, String>("func_150076_b", "getPistonOrientation"));
- mInitMap.put(new Pair<String, String>("func_150077_h", "canExtend"));
- mInitMap.put(new Pair<String, String>("func_150078_e", "updatePistonState"));
- mInitMap.put(new Pair<String, String>("func_150079_i", "tryExtend"));
- mInitMap.put(new Pair<String, String>("func_150080_a", "canPushBlock"));
- mInitMap.put(new Pair<String, String>("func_150085_b", "getDirectionMeta"));
- mInitMap.put(new Pair<String, String>("func_150089_b", "setBlockBoundsFromMeta"));
- mInitMap.put(new Pair<String, String>("func_150091_e", "canConnectWallTo"));
- mInitMap.put(new Pair<String, String>("func_150098_a", "canPaneConnectToBlock"));
- mInitMap.put(new Pair<String, String>("func_150107_m", "canPlaceTorchOn"));
- mInitMap.put(new Pair<String, String>("func_150109_e", "dropTorchIfCantStay"));
- mInitMap.put(new Pair<String, String>("func_150118_d", "isTrapdoorOpen"));
- mInitMap.put(new Pair<String, String>("func_150119_a", "isValidSupportBlock"));
- mInitMap.put(new Pair<String, String>("func_150122_b", "setGraphicsLevel"));
- mInitMap.put(new Pair<String, String>("func_150126_e", "removeLeaves"));
- mInitMap.put(new Pair<String, String>("func_150147_e", "setBaseBounds"));
- mInitMap.put(new Pair<String, String>("func_150148_a", "isBlockStairs"));
- mInitMap.put(new Pair<String, String>("func_150161_d", "getTopIcon"));
- mInitMap.put(new Pair<String, String>("func_150163_b", "getSideIcon"));
- mInitMap.put(new Pair<String, String>("func_150173_e", "getRedstomInitMap.put(newireIcon"));
- mInitMap.put(new Pair<String, String>("func_150174_f", "isPowerProviderOrWire"));
- mInitMap.put(new Pair<String, String>("func_150206_m", "createDeepCopy"));
- mInitMap.put(new Pair<String, String>("func_150209_a", "setChatHoverEvent"));
- mInitMap.put(new Pair<String, String>("func_150210_i", "getChatHoverEvent"));
- mInitMap.put(new Pair<String, String>("func_150215_a", "getColor"));
- mInitMap.put(new Pair<String, String>("func_150217_b", "setItalic"));
- mInitMap.put(new Pair<String, String>("func_150218_j", "getFormattingCode"));
- mInitMap.put(new Pair<String, String>("func_150221_a", "setParentStyle"));
- mInitMap.put(new Pair<String, String>("func_150223_b", "getBold"));
- mInitMap.put(new Pair<String, String>("func_150224_n", "getParent"));
- mInitMap.put(new Pair<String, String>("func_150225_c", "setStrikethrough"));
- mInitMap.put(new Pair<String, String>("func_150227_a", "setBold"));
- mInitMap.put(new Pair<String, String>("func_150228_d", "setUnderlined"));
- mInitMap.put(new Pair<String, String>("func_150229_g", "isEmpty"));
- mInitMap.put(new Pair<String, String>("func_150232_l", "createShallowCopy"));
- mInitMap.put(new Pair<String, String>("func_150233_f", "getObfuscated"));
- mInitMap.put(new Pair<String, String>("func_150234_e", "getUnderlined"));
- mInitMap.put(new Pair<String, String>("func_150235_h", "getChatClickEvent"));
- mInitMap.put(new Pair<String, String>("func_150236_d", "getStrikethrough"));
- mInitMap.put(new Pair<String, String>("func_150237_e", "setObfuscated"));
- mInitMap.put(new Pair<String, String>("func_150238_a", "setColor"));
- mInitMap.put(new Pair<String, String>("func_150241_a", "setChatClickEvent"));
- mInitMap.put(new Pair<String, String>("func_150242_c", "getItalic"));
- mInitMap.put(new Pair<String, String>("func_150253_a", "getSiblings"));
- mInitMap.put(new Pair<String, String>("func_150254_d", "getFormattedText"));
- mInitMap.put(new Pair<String, String>("func_150255_a", "setChatStyle"));
- mInitMap.put(new Pair<String, String>("func_150256_b", "getChatStyle"));
- mInitMap.put(new Pair<String, String>("func_150257_a", "appendSibling"));
- mInitMap.put(new Pair<String, String>("func_150258_a", "appendText"));
- mInitMap.put(new Pair<String, String>("func_150259_f", "createCopy"));
- mInitMap.put(new Pair<String, String>("func_150260_c", "getUnformattedText"));
- mInitMap.put(new Pair<String, String>("func_150261_e", "getUnformattedTextForChat"));
- mInitMap.put(new Pair<String, String>("func_150262_a", "createDeepCopyIterator"));
- mInitMap.put(new Pair<String, String>("func_150265_g", "getChatComponentText_TextValue"));
- mInitMap.put(new Pair<String, String>("func_150268_i", "getKey"));
- mInitMap.put(new Pair<String, String>("func_150269_b", "initializeFromFormat"));
- mInitMap.put(new Pair<String, String>("func_150270_g", "ensureInitialized"));
- mInitMap.put(new Pair<String, String>("func_150271_j", "getFormatArgs"));
- mInitMap.put(new Pair<String, String>("func_150272_a", "getFormatArgumentAsComponent"));
- mInitMap.put(new Pair<String, String>("func_150284_a", "createmInitMap.put(newByType"));
- mInitMap.put(new Pair<String, String>("func_150285_a_", "getString"));
- mInitMap.put(new Pair<String, String>("func_150286_g", "getDouble"));
- mInitMap.put(new Pair<String, String>("func_150287_d", "getInt"));
- mInitMap.put(new Pair<String, String>("func_150288_h", "getFloat"));
- mInitMap.put(new Pair<String, String>("func_150289_e", "getShort"));
- mInitMap.put(new Pair<String, String>("func_150290_f", "getByte"));
- mInitMap.put(new Pair<String, String>("func_150291_c", "getLong"));
- mInitMap.put(new Pair<String, String>("func_150292_c", "getByteArray"));
- mInitMap.put(new Pair<String, String>("func_150295_c", "getTagList"));
- mInitMap.put(new Pair<String, String>("func_150296_c", "getKeySet"));
- mInitMap.put(new Pair<String, String>("func_150297_b", "hasKey"));
- mInitMap.put(new Pair<String, String>("func_150298_a", "writeEntry"));
- mInitMap.put(new Pair<String, String>("func_150299_b", "getTagId"));
- mInitMap.put(new Pair<String, String>("func_150302_c", "getIntArray"));
- mInitMap.put(new Pair<String, String>("func_150303_d", "getTagType"));
- mInitMap.put(new Pair<String, String>("func_150304_a", "setTag"));
- mInitMap.put(new Pair<String, String>("func_150305_b", "getCompoundTagAt"));
- mInitMap.put(new Pair<String, String>("func_150306_c", "getIntArrayAt"));
- mInitMap.put(new Pair<String, String>("func_150307_f", "getStringTagAt"));
- mInitMap.put(new Pair<String, String>("func_150308_e", "getFloatAt"));
- mInitMap.put(new Pair<String, String>("func_150309_d", "getDoubleAt"));
- mInitMap.put(new Pair<String, String>("func_150494_d", "getFrequency"));
- mInitMap.put(new Pair<String, String>("func_150495_a", "getDigResourcePath"));
- mInitMap.put(new Pair<String, String>("func_150496_b", "getPlaceSound"));
- mInitMap.put(new Pair<String, String>("func_150497_c", "getVolume"));
- mInitMap.put(new Pair<String, String>("func_150498_e", "getStepSound"));
- mInitMap.put(new Pair<String, String>("func_150503_a", "decipher"));
- mInitMap.put(new Pair<String, String>("func_150504_a", "cipher"));
- mInitMap.put(new Pair<String, String>("func_150510_c", "getLastUpdateTimeInMilliseconds"));
- mInitMap.put(new Pair<String, String>("func_150512_a", "decorateChunk"));
- mInitMap.put(new Pair<String, String>("func_150513_a", "genDecorations"));
- mInitMap.put(new Pair<String, String>("func_150516_a", "setBlockAndNotifyAdequately"));
- mInitMap.put(new Pair<String, String>("func_150558_b", "getBiomeGrassColor"));
- mInitMap.put(new Pair<String, String>("func_150560_b", "genBiomeTerrain"));
- mInitMap.put(new Pair<String, String>("func_150561_m", "getTempCategory"));
- mInitMap.put(new Pair<String, String>("func_150562_l", "getBiomeClass"));
- mInitMap.put(new Pair<String, String>("func_150564_a", "getFloatTemperature"));
- mInitMap.put(new Pair<String, String>("func_150565_n", "getBiomeGenArray"));
- mInitMap.put(new Pair<String, String>("func_150566_k", "createMutation"));
- mInitMap.put(new Pair<String, String>("func_150568_d", "getBiome"));
- mInitMap.put(new Pair<String, String>("func_150569_a", "isEqualTo"));
- mInitMap.put(new Pair<String, String>("func_150570_a", "setHeight"));
- mInitMap.put(new Pair<String, String>("func_150571_c", "getBiomeFoliageColor"));
- mInitMap.put(new Pair<String, String>("func_150573_a", "genTerrainBlocks"));
- mInitMap.put(new Pair<String, String>("func_150633_b", "mutateHills"));
- mInitMap.put(new Pair<String, String>("func_150646_a", "isRailBlockAt"));
- mInitMap.put(new Pair<String, String>("func_150650_a", "countAdjacentRails"));
- mInitMap.put(new Pair<String, String>("func_150663_a", "writeTag"));
- mInitMap.put(new Pair<String, String>("func_150668_b", "getValue"));
- mInitMap.put(new Pair<String, String>("func_150669_a", "getAction"));
- mInitMap.put(new Pair<String, String>("func_150672_a", "getValueByCanonicalName"));
- mInitMap.put(new Pair<String, String>("func_150673_b", "getCanonicalName"));
- mInitMap.put(new Pair<String, String>("func_150674_a", "shouldAllowInChat"));
- mInitMap.put(new Pair<String, String>("func_150684_a", "getValueByCanonicalName"));
- mInitMap.put(new Pair<String, String>("func_150685_b", "getCanonicalName"));
- mInitMap.put(new Pair<String, String>("func_150686_a", "shouldAllowInChat"));
- mInitMap.put(new Pair<String, String>("func_150695_a", "serializeChatStyle"));
- mInitMap.put(new Pair<String, String>("func_150696_a", "componentToJson"));
- mInitMap.put(new Pair<String, String>("func_150699_a", "jsonToComponent"));
- mInitMap.put(new Pair<String, String>("func_150701_a", "getAction"));
- mInitMap.put(new Pair<String, String>("func_150702_b", "getValue"));
- mInitMap.put(new Pair<String, String>("func_150706_a", "generateDispenserContents"));
- mInitMap.put(new Pair<String, String>("func_150707_a", "setEnchantable"));
- mInitMap.put(new Pair<String, String>("func_150708_a", "getItemStack"));
- mInitMap.put(new Pair<String, String>("func_150709_a", "setMaxDamagePercent"));
- mInitMap.put(new Pair<String, String>("func_150718_a", "closeChannel"));
- mInitMap.put(new Pair<String, String>("func_150719_a", "setNetHandler"));
- mInitMap.put(new Pair<String, String>("func_150721_g", "disableAutoRead"));
- mInitMap.put(new Pair<String, String>("func_150722_a", "provideLocalClient"));
- mInitMap.put(new Pair<String, String>("func_150723_a", "setConnectionState"));
- mInitMap.put(new Pair<String, String>("func_150724_d", "isChannelOpen"));
- mInitMap.put(new Pair<String, String>("func_150725_a", "scheduleOutboundPacket"));
- mInitMap.put(new Pair<String, String>("func_150726_a", "provideLanClient"));
- mInitMap.put(new Pair<String, String>("func_150727_a", "enableEncryption"));
- mInitMap.put(new Pair<String, String>("func_150729_e", "getNetHandler"));
- mInitMap.put(new Pair<String, String>("func_150730_f", "getExitMessage"));
- mInitMap.put(new Pair<String, String>("func_150731_c", "isLocalChannel"));
- mInitMap.put(new Pair<String, String>("func_150732_b", "dispatchPacket"));
- mInitMap.put(new Pair<String, String>("func_150733_h", "flushOutboundQueue"));
- mInitMap.put(new Pair<String, String>("func_150752_a", "getFromPacket"));
- mInitMap.put(new Pair<String, String>("func_150759_c", "getId"));
- mInitMap.put(new Pair<String, String>("func_150760_a", "getById"));
- mInitMap.put(new Pair<String, String>("func_150775_a", "attenuate"));
- mInitMap.put(new Pair<String, String>("func_150785_a", "writeStringToBuffer"));
- mInitMap.put(new Pair<String, String>("func_150786_a", "writeNBTTagCompoundToBuffer"));
- mInitMap.put(new Pair<String, String>("func_150787_b", "writeVarIntToBuffer"));
- mInitMap.put(new Pair<String, String>("func_150788_a", "writeItemStackToBuffer"));
- mInitMap.put(new Pair<String, String>("func_150789_c", "readStringFromBuffer"));
- mInitMap.put(new Pair<String, String>("func_150790_a", "getVarIntSize"));
- mInitMap.put(new Pair<String, String>("func_150791_c", "readItemStackFromBuffer"));
- mInitMap.put(new Pair<String, String>("func_150792_a", "readVarIntFromBuffer"));
- mInitMap.put(new Pair<String, String>("func_150793_b", "readNBTTagCompoundFromBuffer"));
- mInitMap.put(new Pair<String, String>("func_150795_a", "findBiomePosition"));
- mInitMap.put(new Pair<String, String>("func_150803_c", "recheckGaps"));
- mInitMap.put(new Pair<String, String>("func_150805_f", "removeTileEntity"));
- mInitMap.put(new Pair<String, String>("func_150806_e", "getBlockTileEntityInChunk"));
- mInitMap.put(new Pair<String, String>("func_150807_a", "setBlockIDWithMetadata"));
- mInitMap.put(new Pair<String, String>("func_150808_b", "getBlockLightOpacity"));
- mInitMap.put(new Pair<String, String>("func_150810_a", "getBlock"));
- mInitMap.put(new Pair<String, String>("func_150812_a", "setBlockTileEntityInChunk"));
- mInitMap.put(new Pair<String, String>("func_150813_a", "addTileEntity"));
- mInitMap.put(new Pair<String, String>("func_150818_a", "setExtBlockID"));
- mInitMap.put(new Pair<String, String>("func_150819_a", "getBlockByExtId"));
- mInitMap.put(new Pair<String, String>("func_150826_b", "translateToFallback"));
- mInitMap.put(new Pair<String, String>("func_150827_a", "getLastTranslationUpdateTimeInMilliseconds"));
- mInitMap.put(new Pair<String, String>("func_150835_j", "getBlockTileEntity"));
- mInitMap.put(new Pair<String, String>("func_150891_b", "getIdFromItem"));
- mInitMap.put(new Pair<String, String>("func_150892_m", "isPotionIngredient"));
- mInitMap.put(new Pair<String, String>("func_150893_a", "getStrVsBlock"));
- mInitMap.put(new Pair<String, String>("func_150894_a", "onBlockDestroyed"));
- mInitMap.put(new Pair<String, String>("func_150895_a", "getSubItems"));
- mInitMap.put(new Pair<String, String>("func_150896_i", "getPotionEffect"));
- mInitMap.put(new Pair<String, String>("func_150897_b", "canItemHarvestBlock"));
- mInitMap.put(new Pair<String, String>("func_150898_a", "getItemFromBlock"));
- mInitMap.put(new Pair<String, String>("func_150899_d", "getItemById"));
- mInitMap.put(new Pair<String, String>("func_150900_l", "registerItems"));
- mInitMap.put(new Pair<String, String>("func_150905_g", "getHealAmount"));
- mInitMap.put(new Pair<String, String>("func_150906_h", "getSaturationModifier"));
- mInitMap.put(new Pair<String, String>("func_150911_c", "createMapDataPacket"));
- mInitMap.put(new Pair<String, String>("func_150912_a", "loadMapData"));
- mInitMap.put(new Pair<String, String>("func_150913_i", "getToolMaterial"));
- mInitMap.put(new Pair<String, String>("func_150924_a", "placeDoorBlock"));
- mInitMap.put(new Pair<String, String>("func_150926_b", "getRecord"));
- mInitMap.put(new Pair<String, String>("func_150927_i", "getRecordNameLocal"));
- mInitMap.put(new Pair<String, String>("func_150930_a", "validBookPageTagContents"));
- mInitMap.put(new Pair<String, String>("func_150932_j", "getToolMaterialName"));
- mInitMap.put(new Pair<String, String>("func_150951_e", "getStatName"));
- mInitMap.put(new Pair<String, String>("func_150967_d", "getUncookedSaturationModifier"));
- mInitMap.put(new Pair<String, String>("func_150968_a", "registerIcon"));
- mInitMap.put(new Pair<String, String>("func_150970_e", "getCookedHealAmount"));
- mInitMap.put(new Pair<String, String>("func_150971_g", "getUncookedIcon"));
- mInitMap.put(new Pair<String, String>("func_150972_b", "getUnlocalizedNamePart"));
- mInitMap.put(new Pair<String, String>("func_150973_i", "getCookable"));
- mInitMap.put(new Pair<String, String>("func_150974_a", "getFishTypeForItemDamage"));
- mInitMap.put(new Pair<String, String>("func_150975_c", "getUncookedHealAmount"));
- mInitMap.put(new Pair<String, String>("func_150976_a", "getItemDamage"));
- mInitMap.put(new Pair<String, String>("func_150977_f", "getCookedSaturationModifier"));
- mInitMap.put(new Pair<String, String>("func_150978_a", "getFishTypeForItemStack"));
- mInitMap.put(new Pair<String, String>("func_150979_h", "getCookedIcon"));
- mInitMap.put(new Pair<String, String>("func_150995_f", "getBaseItemForRepair"));
- mInitMap.put(new Pair<String, String>("func_150996_a", "setItem"));
- mInitMap.put(new Pair<String, String>("func_150997_a", "getStrVsBlock"));
- mInitMap.put(new Pair<String, String>("func_150998_b", "canItemHarvestBlock"));
- mInitMap.put(new Pair<String, String>("func_150999_a", "onBlockDestroyed"));
- mInitMap.put(new Pair<String, String>("func_151001_c", "setStackDisplayName"));
- mInitMap.put(new Pair<String, String>("func_151003_a", "getSerializableElement"));
- mInitMap.put(new Pair<String, String>("func_151177_a", "getOneShotStat"));
- mInitMap.put(new Pair<String, String>("func_151187_b", "getJsonSerializableValue"));
- mInitMap.put(new Pair<String, String>("func_151188_a", "setIntegerValue"));
- mInitMap.put(new Pair<String, String>("func_151189_a", "getIntegerValue"));
- mInitMap.put(new Pair<String, String>("func_151190_a", "setJsonSerializableValue"));
- mInitMap.put(new Pair<String, String>("func_151200_h", "getJsonObjectStringFieldValue"));
- mInitMap.put(new Pair<String, String>("func_151201_f", "jsonObjectFieldTypeIsPrimitive"));
- mInitMap.put(new Pair<String, String>("func_151202_d", "jsonObjectFieldTypeIsArray"));
- mInitMap.put(new Pair<String, String>("func_151203_m", "getJsonObjectIntegerFieldValue"));
- mInitMap.put(new Pair<String, String>("func_151204_g", "jsonObjectHasNamedField"));
- mInitMap.put(new Pair<String, String>("func_151205_a", "jsonObjectFieldTypeIsString"));
- mInitMap.put(new Pair<String, String>("func_151206_a", "getJsonElementStringValue"));
- mInitMap.put(new Pair<String, String>("func_151207_m", "getJsonElementAsJsonArray"));
- mInitMap.put(new Pair<String, String>("func_151208_a", "getJsonObjectIntegerFieldValueOrDefault"));
- mInitMap.put(new Pair<String, String>("func_151209_a", "getJsonObjectBooleanFieldValueOrDefault"));
- mInitMap.put(new Pair<String, String>("func_151210_l", "getElementAsJsonObject"));
- mInitMap.put(new Pair<String, String>("func_151211_a", "jsonElementTypeIsString"));
- mInitMap.put(new Pair<String, String>("func_151212_i", "getJsonObjectBooleanFieldValue"));
- mInitMap.put(new Pair<String, String>("func_151213_a", "getJsonObjectJsonArrayFieldOrDefault"));
- mInitMap.put(new Pair<String, String>("func_151214_t", "getJsonObjectJsonArrayField"));
- mInitMap.put(new Pair<String, String>("func_151215_f", "getJsonElementIntegerValue"));
- mInitMap.put(new Pair<String, String>("func_151216_b", "getJsonElementBooleanValue"));
- mInitMap.put(new Pair<String, String>("func_151217_k", "getJsonObjectFloatFieldValue"));
- mInitMap.put(new Pair<String, String>("func_151218_a", "getJsonObjectFieldOrDefault"));
- mInitMap.put(new Pair<String, String>("func_151219_a", "getJsonObjectStringFieldValueOrDefault"));
- mInitMap.put(new Pair<String, String>("func_151220_d", "getJsonElementFloatValue"));
- mInitMap.put(new Pair<String, String>("func_151221_a", "getJsonObjectFloatFieldValueOrDefault"));
- mInitMap.put(new Pair<String, String>("func_151222_d", "getJsonElementTypeDescription"));
- mInitMap.put(new Pair<String, String>("func_151223_a", "downloadResourcePack"));
- mInitMap.put(new Pair<String, String>("func_151225_a", "post"));
- mInitMap.put(new Pair<String, String>("func_151226_a", "postMap"));
- mInitMap.put(new Pair<String, String>("func_151235_d", "isPowerOfTwo"));
- mInitMap.put(new Pair<String, String>("func_151236_b", "roundUpToPowerOfTwo"));
- mInitMap.put(new Pair<String, String>("func_151237_a", "clamp_double"));
- mInitMap.put(new Pair<String, String>("func_151238_b", "denormalizeClamp"));
- mInitMap.put(new Pair<String, String>("func_151239_c", "calculateLogBaseTwo"));
- mInitMap.put(new Pair<String, String>("func_151240_a", "randomFloatClamp"));
- mInitMap.put(new Pair<String, String>("func_151241_e", "calculateLogBaseTwoDeBruijn"));
- mInitMap.put(new Pair<String, String>("func_151243_f", "getIconItemDamage"));
- mInitMap.put(new Pair<String, String>("func_151244_d", "getIconItemStack"));
- mInitMap.put(new Pair<String, String>("func_151246_b", "isNullOrEmpty"));
- mInitMap.put(new Pair<String, String>("func_151247_a", "sendToAllTrackingEntity"));
- mInitMap.put(new Pair<String, String>("func_151250_a", "markBlockForUpdate"));
- mInitMap.put(new Pair<String, String>("func_151251_a", "sendToAllPlayersWatchingChunk"));
- mInitMap.put(new Pair<String, String>("func_151252_a", "sendTileToAllPlayersWatchingChunk"));
- mInitMap.put(new Pair<String, String>("func_151253_a", "flagChunkForUpdate"));
- mInitMap.put(new Pair<String, String>("func_151255_a", "getStringBuffer"));
- mInitMap.put(new Pair<String, String>("func_151256_a", "writeAndFlush"));
- mInitMap.put(new Pair<String, String>("func_151265_a", "addLanEndpoint"));
- mInitMap.put(new Pair<String, String>("func_151267_d", "getServer"));
- mInitMap.put(new Pair<String, String>("func_151268_b", "terminateEndpoints"));
- mInitMap.put(new Pair<String, String>("func_151269_c", "networkTick"));
- mInitMap.put(new Pair<String, String>("func_151270_a", "addLocalEndpoint"));
- mInitMap.put(new Pair<String, String>("func_151303_a", "getName"));
- mInitMap.put(new Pair<String, String>("func_151304_b", "getProtocol"));
- mInitMap.put(new Pair<String, String>("func_151315_a", "setServerDescription"));
- mInitMap.put(new Pair<String, String>("func_151316_d", "getFavicon"));
- mInitMap.put(new Pair<String, String>("func_151317_a", "getServerDescription"));
- mInitMap.put(new Pair<String, String>("func_151318_b", "getPlayerCountData"));
- mInitMap.put(new Pair<String, String>("func_151319_a", "setPlayerCountData"));
- mInitMap.put(new Pair<String, String>("func_151320_a", "setFavicon"));
- mInitMap.put(new Pair<String, String>("func_151321_a", "setProtocolVersionInfo"));
- mInitMap.put(new Pair<String, String>("func_151322_c", "getProtocolVersionInfo"));
- mInitMap.put(new Pair<String, String>("func_151330_a", "setPlayers"));
- mInitMap.put(new Pair<String, String>("func_151331_c", "getPlayers"));
- mInitMap.put(new Pair<String, String>("func_151332_a", "getMaxPlayers"));
- mInitMap.put(new Pair<String, String>("func_151333_b", "getOnlinePlayerCount"));
- mInitMap.put(new Pair<String, String>("func_151337_f", "getBlock"));
- mInitMap.put(new Pair<String, String>("func_151338_e", "getEventParameter"));
- mInitMap.put(new Pair<String, String>("func_151339_d", "getEventID"));
- mInitMap.put(new Pair<String, String>("func_151353_a", "registerDispenserBehaviors"));
- mInitMap.put(new Pair<String, String>("func_151354_b", "register"));
- mInitMap.put(new Pair<String, String>("func_151357_h", "showWorldInfoNotice"));
- mInitMap.put(new Pair<String, String>("func_151358_j", "setNotificationData"));
- mInitMap.put(new Pair<String, String>("func_151393_a", "addSmeltingRecipeForBlock"));
- mInitMap.put(new Pair<String, String>("func_151394_a", "addSmeltingRecipe"));
- mInitMap.put(new Pair<String, String>("func_151395_a", "getSmeltingResult"));
- mInitMap.put(new Pair<String, String>("func_151396_a", "addSmelting"));
- mInitMap.put(new Pair<String, String>("func_151398_b", "getSmeltingExperience"));
- mInitMap.put(new Pair<String, String>("func_151426_a", "getEnumChatVisibility"));
- mInitMap.put(new Pair<String, String>("func_151428_a", "getChatVisibility"));
- mInitMap.put(new Pair<String, String>("func_151429_b", "getResourceKey"));
- mInitMap.put(new Pair<String, String>("func_151438_a", "getSoundLevel"));
- mInitMap.put(new Pair<String, String>("func_151439_a", "setSoundLevel"));
- mInitMap.put(new Pair<String, String>("func_151440_a", "setOptionKeyBinding"));
- mInitMap.put(new Pair<String, String>("func_151460_a", "getBlockAtEntityViewpoint"));
- mInitMap.put(new Pair<String, String>("func_151461_a", "getChatComponent"));
- mInitMap.put(new Pair<String, String>("func_151462_b", "setKeyCode"));
- mInitMap.put(new Pair<String, String>("func_151463_i", "getKeyCode"));
- mInitMap.put(new Pair<String, String>("func_151464_g", "getKeyDescription"));
- mInitMap.put(new Pair<String, String>("func_151466_e", "getKeyCategory"));
- mInitMap.put(new Pair<String, String>("func_151467_c", "getKeybinds"));
- mInitMap.put(new Pair<String, String>("func_151468_f", "isPressed"));
- mInitMap.put(new Pair<String, String>("func_151469_h", "getKeyCodeDefault"));
- mInitMap.put(new Pair<String, String>("func_151470_d", "getIsKeyPressed"));
- mInitMap.put(new Pair<String, String>("func_151498_a", "isStairOrSlab"));
- mInitMap.put(new Pair<String, String>("func_151499_f", "getEatingGrassTimer"));
- mInitMap.put(new Pair<String, String>("func_151503_a", "getWoodenDoorBlock"));
- mInitMap.put(new Pair<String, String>("func_151507_a", "writeWatchedListToPacketBuffer"));
- mInitMap.put(new Pair<String, String>("func_151508_b", "readWatchedListFromPacketBuffer"));
- mInitMap.put(new Pair<String, String>("func_151510_a", "writeWatchableObjectToPacketBuffer"));
- mInitMap.put(new Pair<String, String>("func_151517_h", "isDamageAbsolute"));
- mInitMap.put(new Pair<String, String>("func_151518_m", "setDamageIsAbsolute"));
- mInitMap.put(new Pair<String, String>("func_151519_b", "getDeathMessage"));
- mInitMap.put(new Pair<String, String>("func_151523_a", "getDifficultyEnum"));
- mInitMap.put(new Pair<String, String>("func_151525_a", "getDifficultyId"));
- mInitMap.put(new Pair<String, String>("func_151526_b", "getDifficultyResourceKey"));
- mInitMap.put(new Pair<String, String>("func_151539_a", "generate"));
- mInitMap.put(new Pair<String, String>("func_151545_a", "getNearestInstance"));
- mInitMap.put(new Pair<String, String>("func_151548_a", "getBlockAtCurrentPosition"));
- mInitMap.put(new Pair<String, String>("func_151549_a", "fillWithBlocks"));
- mInitMap.put(new Pair<String, String>("func_151550_a", "placeBlockAtCurrentPosition"));
- mInitMap.put(new Pair<String, String>("func_151551_a", "randomlyFillWithBlocks"));
- mInitMap.put(new Pair<String, String>("func_151555_a", "getMetadataWithOffset"));
- mInitMap.put(new Pair<String, String>("func_151556_a", "fillWithMetadataBlocks"));
- mInitMap.put(new Pair<String, String>("func_151565_r", "getMaterialMapColor"));
- mInitMap.put(new Pair<String, String>("func_151616_a", "biomesEqualOrMesaPlateau"));
- mInitMap.put(new Pair<String, String>("func_151617_b", "selectModeOrRandom"));
- mInitMap.put(new Pair<String, String>("func_151618_b", "isBiomeOceanic"));
- mInitMap.put(new Pair<String, String>("func_151619_a", "selectRandom"));
- mInitMap.put(new Pair<String, String>("func_151624_d", "getIntsHeatIce"));
- mInitMap.put(new Pair<String, String>("func_151625_e", "getIntsSpecial"));
- mInitMap.put(new Pair<String, String>("func_151626_c", "getIntsCoolWarm"));
- mInitMap.put(new Pair<String, String>("func_151634_b", "canBiomesBeNeighbors"));
- mInitMap.put(new Pair<String, String>("func_151635_b", "replaceBiomeEdge"));
- mInitMap.put(new Pair<String, String>("func_151636_a", "replaceBiomeEdgeIfNecessary"));
- mInitMap.put(new Pair<String, String>("func_151644_a", "getMapColorForBlockColored"));
- mInitMap.put(new Pair<String, String>("func_151685_b", "getBaseItemForRepair"));
- mInitMap.put(new Pair<String, String>("func_151686_a", "addStats"));
- mInitMap.put(new Pair<String, String>("func_152121_a", "onSkinAvailable"));
- mInitMap.put(new Pair<String, String>("func_152122_n", "hasCape"));
- mInitMap.put(new Pair<String, String>("func_152123_o", "hasSkin"));
- mInitMap.put(new Pair<String, String>("func_152125_a", "drawScaledCustomSizeModalRect"));
- mInitMap.put(new Pair<String, String>("func_152126_a", "renderStreamIndicator"));
- mInitMap.put(new Pair<String, String>("func_152340_a", "readImageToBuffer"));
- mInitMap.put(new Pair<String, String>("func_152341_N", "getTwitchDetails"));
- mInitMap.put(new Pair<String, String>("func_152342_ad", "getSkinManager"));
- mInitMap.put(new Pair<String, String>("func_152343_a", "addScheduledTask"));
- mInitMap.put(new Pair<String, String>("func_152344_a", "addScheduledTask"));
- mInitMap.put(new Pair<String, String>("func_152345_ab", "isCallingFromMinecraftThread"));
- mInitMap.put(new Pair<String, String>("func_152346_Z", "getTwitchStream"));
- mInitMap.put(new Pair<String, String>("func_152347_ac", "getSessionService"));
- mInitMap.put(new Pair<String, String>("func_152348_aa", "dispatchKeypresses"));
- mInitMap.put(new Pair<String, String>("func_152349_b", "isUnicode"));
- mInitMap.put(new Pair<String, String>("func_152357_F", "getGameProfiles"));
- mInitMap.put(new Pair<String, String>("func_152358_ax", "getPlayerProfileCache"));
- mInitMap.put(new Pair<String, String>("func_152359_aw", "getGameProfileRepository"));
- mInitMap.put(new Pair<String, String>("func_152361_a", "setConfigManager"));
- mInitMap.put(new Pair<String, String>("func_152368_aE", "convertFiles"));
- mInitMap.put(new Pair<String, String>("func_152369_aG", "sleepFiveSeconds"));
- mInitMap.put(new Pair<String, String>("func_152372_a", "notifyOperators"));
- mInitMap.put(new Pair<String, String>("func_152373_a", "notifyOperators"));
- mInitMap.put(new Pair<String, String>("func_152374_a", "notifyOperators"));
- mInitMap.put(new Pair<String, String>("func_152378_a", "getPlayerEntityByUUID"));
- mInitMap.put(new Pair<String, String>("func_152379_p", "getRenderDistanceChunks"));
- mInitMap.put(new Pair<String, String>("func_152421_a", "setSessionType"));
- mInitMap.put(new Pair<String, String>("func_152428_f", "getSessionType"));
- mInitMap.put(new Pair<String, String>("func_152436_a", "render"));
- mInitMap.put(new Pair<String, String>("func_152437_a", "render"));
- mInitMap.put(new Pair<String, String>("func_152446_a", "read"));
- mInitMap.put(new Pair<String, String>("func_152447_a", "readType"));
- mInitMap.put(new Pair<String, String>("func_152448_b", "readKey"));
- mInitMap.put(new Pair<String, String>("func_152449_a", "readNBT"));
- mInitMap.put(new Pair<String, String>("func_152450_a", "addSpaceRead"));
- mInitMap.put(new Pair<String, String>("func_152457_a", "decompress"));
- mInitMap.put(new Pair<String, String>("func_152458_a", "readFromFile"));
- mInitMap.put(new Pair<String, String>("func_152459_a", "readGameProfileFromNBT"));
- mInitMap.put(new Pair<String, String>("func_152460_a", "writeGameProfileToNBT"));
- mInitMap.put(new Pair<String, String>("func_152493_a", "getTotalBytes"));
- mInitMap.put(new Pair<String, String>("func_152495_b", "getCount"));
- mInitMap.put(new Pair<String, String>("func_152506_a", "getOfflineProfile"));
- mInitMap.put(new Pair<String, String>("func_152583_a", "copyFrom"));
- mInitMap.put(new Pair<String, String>("func_152584_a", "setResourceMode"));
- mInitMap.put(new Pair<String, String>("func_152585_d", "isLanServer"));
- mInitMap.put(new Pair<String, String>("func_152586_b", "getResourceMode"));
- mInitMap.put(new Pair<String, String>("func_152589_a", "getMotd"));
- mInitMap.put(new Pair<String, String>("func_152596_g", "canSendCommands"));
- mInitMap.put(new Pair<String, String>("func_152597_c", "removePlayerFromWhitelist"));
- mInitMap.put(new Pair<String, String>("func_152598_l", "getWhitelistedPlayerNames"));
- mInitMap.put(new Pair<String, String>("func_152599_k", "getWhitelistedPlayers"));
- mInitMap.put(new Pair<String, String>("func_152600_g", "getAllProfiles"));
- mInitMap.put(new Pair<String, String>("func_152601_d", "addWhitelistedPlayer"));
- mInitMap.put(new Pair<String, String>("func_152602_a", "getPlayerStatsFile"));
- mInitMap.put(new Pair<String, String>("func_152603_m", "getOppedPlayers"));
- mInitMap.put(new Pair<String, String>("func_152605_a", "addOp"));
- mInitMap.put(new Pair<String, String>("func_152606_n", "getOppedPlayerNames"));
- mInitMap.put(new Pair<String, String>("func_152607_e", "canJoin"));
- mInitMap.put(new Pair<String, String>("func_152608_h", "getBannedPlayers"));
- mInitMap.put(new Pair<String, String>("func_152609_b", "getPlayerNamesString"));
- mInitMap.put(new Pair<String, String>("func_152610_b", "removeOp"));
- mInitMap.put(new Pair<String, String>("func_152611_a", "setViewDistance"));
- mInitMap.put(new Pair<String, String>("func_152612_a", "getPlayerByUsername"));
- mInitMap.put(new Pair<String, String>("func_152617_w", "saveUserBanList"));
- mInitMap.put(new Pair<String, String>("func_152618_v", "saveIpBanList"));
- mInitMap.put(new Pair<String, String>("func_152619_x", "loadIpBanList"));
- mInitMap.put(new Pair<String, String>("func_152620_y", "loadUserBansList"));
- mInitMap.put(new Pair<String, String>("func_152640_f", "getValue"));
- mInitMap.put(new Pair<String, String>("func_152641_a", "onSerialization"));
- mInitMap.put(new Pair<String, String>("func_152655_a", "getGameProfileForUsername"));
- mInitMap.put(new Pair<String, String>("func_152678_f", "writeChanges"));
- mInitMap.put(new Pair<String, String>("func_152679_g", "readSavedFile"));
- mInitMap.put(new Pair<String, String>("func_152680_h", "removeExpired"));
- mInitMap.put(new Pair<String, String>("func_152681_a", "getObjectKey"));
- mInitMap.put(new Pair<String, String>("func_152682_a", "createEntry"));
- mInitMap.put(new Pair<String, String>("func_152683_b", "getEntry"));
- mInitMap.put(new Pair<String, String>("func_152684_c", "removeEntry"));
- mInitMap.put(new Pair<String, String>("func_152685_a", "getKeys"));
- mInitMap.put(new Pair<String, String>("func_152686_a", "setLanServer"));
- mInitMap.put(new Pair<String, String>("func_152687_a", "addEntry"));
- mInitMap.put(new Pair<String, String>("func_152688_e", "getValues"));
- mInitMap.put(new Pair<String, String>("func_152689_b", "isLanServer"));
- mInitMap.put(new Pair<String, String>("func_152690_d", "hasEntries"));
- mInitMap.put(new Pair<String, String>("func_152691_c", "getSaveFile"));
- mInitMap.put(new Pair<String, String>("func_152692_d", "hasEntry"));
- mInitMap.put(new Pair<String, String>("func_152700_a", "getGameProfileFromName"));
- mInitMap.put(new Pair<String, String>("func_152701_b", "getProfileId"));
- mInitMap.put(new Pair<String, String>("func_152702_a", "isBanned"));
- mInitMap.put(new Pair<String, String>("func_152703_a", "isUsernameBanned"));
- mInitMap.put(new Pair<String, String>("func_152707_c", "addressToString"));
- mInitMap.put(new Pair<String, String>("func_152708_a", "isBanned"));
- mInitMap.put(new Pair<String, String>("func_152709_b", "getBanEntry"));
- mInitMap.put(new Pair<String, String>("func_152710_d", "convertWhitelist"));
- mInitMap.put(new Pair<String, String>("func_152711_b", "mkdir"));
- mInitMap.put(new Pair<String, String>("func_152712_b", "hasUnconvertableFiles"));
- mInitMap.put(new Pair<String, String>("func_152713_b", "parseDate"));
- mInitMap.put(new Pair<String, String>("func_152714_a", "tryConvert"));
- mInitMap.put(new Pair<String, String>("func_152715_c", "hasUnconvertablePlayerFiles"));
- mInitMap.put(new Pair<String, String>("func_152717_a", "lookupNames"));
- mInitMap.put(new Pair<String, String>("func_152718_c", "convertOplist"));
- mInitMap.put(new Pair<String, String>("func_152721_a", "readFile"));
- mInitMap.put(new Pair<String, String>("func_152722_b", "convertIpBanlist"));
- mInitMap.put(new Pair<String, String>("func_152723_a", "convertSaveFiles"));
- mInitMap.put(new Pair<String, String>("func_152724_a", "convertUserBanlist"));
- mInitMap.put(new Pair<String, String>("func_152725_d", "getPlayersDirectory"));
- mInitMap.put(new Pair<String, String>("func_152727_c", "backupConverted"));
- mInitMap.put(new Pair<String, String>("func_152750_a", "deserializeEntry"));
- mInitMap.put(new Pair<String, String>("func_152751_a", "serializeEntry"));
- mInitMap.put(new Pair<String, String>("func_152754_s", "getJsonObject"));
- mInitMap.put(new Pair<String, String>("func_152755_a", "get"));
- mInitMap.put(new Pair<String, String>("func_152764_a", "parsePass"));
- mInitMap.put(new Pair<String, String>("func_152765_a", "parseGroup"));
- mInitMap.put(new Pair<String, String>("func_152767_b", "addStatToSnooper"));
- mInitMap.put(new Pair<String, String>("func_152768_a", "addClientStat"));
- mInitMap.put(new Pair<String, String>("func_152788_a", "loadSkinFromCache"));
- mInitMap.put(new Pair<String, String>("func_152789_a", "loadSkin"));
- mInitMap.put(new Pair<String, String>("func_152792_a", "loadSkin"));
- mInitMap.put(new Pair<String, String>("func_152825_o", "isIngestTesting"));
- mInitMap.put(new Pair<String, String>("func_152839_p", "isBroadcastPaused"));
- mInitMap.put(new Pair<String, String>("func_152850_m", "isBroadcasting"));
- mInitMap.put(new Pair<String, String>("func_152856_w", "isReady"));
- mInitMap.put(new Pair<String, String>("func_152919_o", "isPaused"));
- mInitMap.put(new Pair<String, String>("func_152923_i", "shutdownStream"));
- mInitMap.put(new Pair<String, String>("func_153157_c", "glGetShaderi"));
- mInitMap.put(new Pair<String, String>("func_153158_d", "glGetShaderInfoLog"));
- mInitMap.put(new Pair<String, String>("func_153159_d", "glUniform4"));
- mInitMap.put(new Pair<String, String>("func_153160_c", "glUniformMatrix4"));
- mInitMap.put(new Pair<String, String>("func_153161_d", "glUseProgram"));
- mInitMap.put(new Pair<String, String>("func_153162_d", "glUniform4"));
- mInitMap.put(new Pair<String, String>("func_153163_f", "glUniform1i"));
- mInitMap.put(new Pair<String, String>("func_153164_b", "glGetAttribLocation"));
- mInitMap.put(new Pair<String, String>("func_153166_e", "glGetProgramInfoLog"));
- mInitMap.put(new Pair<String, String>("func_153168_a", "glUniform1"));
- mInitMap.put(new Pair<String, String>("func_153169_a", "glShaderSource"));
- mInitMap.put(new Pair<String, String>("func_153170_c", "glCompileShader"));
- mInitMap.put(new Pair<String, String>("func_153173_a", "glUniformMatrix2"));
- mInitMap.put(new Pair<String, String>("func_153175_a", "glGetProgrami"));
- mInitMap.put(new Pair<String, String>("func_153177_b", "glUniform2"));
- mInitMap.put(new Pair<String, String>("func_153178_b", "glAttachShader"));
- mInitMap.put(new Pair<String, String>("func_153179_f", "glLinkProgram"));
- mInitMap.put(new Pair<String, String>("func_153180_a", "glDeleteShader"));
- mInitMap.put(new Pair<String, String>("func_153181_a", "glUniform1"));
- mInitMap.put(new Pair<String, String>("func_153182_b", "glUniform2"));
- }
+ if (srgToForge.size() > 0 && forgeToSrg.size() > 0 && obToDeOb.size() > 0 && deObToOb.size() > 0) {
+ if (srgToForge.size() == forgeToSrg.size() && obToDeOb.size() == deObToOb.size()) {
+ return true;
+ } else {
+ if (srgToForge.size() != forgeToSrg.size()) {
+ int aKey1 = 0;
+ int aKey2 = 0;
+ HashMap<Integer, String> aMissingForgeNames = new HashMap<Integer, String>();
+ HashMap<Integer, String> aMissingSrgNames = new HashMap<Integer, String>();
+ Preloader_Logger.INFO("Mismatch between mapped Forge and Srg names, finding missing values.");
+ if (srgToForge.size() > forgeToSrg.size()) {
+ Preloader_Logger.INFO("More SRG Keys detected.");
+ for (String aKey : srgToForge.keySet()) {
+ if (!forgeToSrg.containsValue(aKey)) {
+ aMissingSrgNames.put(aKey1++, aKey);
+ }
+ }
+ } else if (srgToForge.size() < forgeToSrg.size()) {
+ Preloader_Logger.INFO("More Forge Keys detected.");
+ for (String aKey : forgeToSrg.keySet()) {
+ if (!srgToForge.containsValue(aKey)) {
+ aMissingForgeNames.put(aKey2++, aKey);
+ }
+ }
+ }
+ if (!aMissingForgeNames.isEmpty()) {
+ for (String missingVal : aMissingForgeNames.values()) {
+ // Preloader_Logger.WARNING("Missing Forge value: "+missingVal);
+ }
+ }
+ if (!aMissingSrgNames.isEmpty()) {
+ for (String missingVal : aMissingSrgNames.values()) {
+ // Preloader_Logger.WARNING("Missing SRG value: "+missingVal);
+ }
+ }
+ }
+ if (obToDeOb.size() != deObToOb.size()) {
+ int aKey1 = 0;
+ int aKey2 = 0;
+ HashMap<Integer, String> aMissingObfNames = new HashMap<Integer, String>();
+ HashMap<Integer, String> aMissingDeObfNames = new HashMap<Integer, String>();
+ Preloader_Logger.INFO(
+ "Mismatch between mapped Obfuscated and Deobfuscated names, finding missing values.");
+ if (obToDeOb.size() > deObToOb.size()) {
+ Preloader_Logger.INFO("More Obfuscated Keys detected.");
+ for (String aKey : obToDeOb.keySet()) {
+ if (!deObToOb.containsValue(aKey)) {
+ aMissingObfNames.put(aKey1++, aKey);
+ }
+ }
+ } else if (obToDeOb.size() < deObToOb.size()) {
+ Preloader_Logger.INFO("More Deobfuscated Keys detected.");
+ for (String aKey : deObToOb.keySet()) {
+ if (!obToDeOb.containsValue(aKey)) {
+ aMissingDeObfNames.put(aKey2++, aKey);
+ }
+ }
+ }
+ if (!aMissingObfNames.isEmpty()) {
+ for (String missingVal : aMissingObfNames.values()) {
+ Preloader_Logger.WARNING("Missing Obfuscated value: " + missingVal);
+ }
+ }
+ if (!aMissingDeObfNames.isEmpty()) {
+ for (String missingVal : aMissingDeObfNames.values()) {
+ Preloader_Logger.WARNING("Missing Deobfuscated value: " + missingVal);
+ }
+ }
+ }
+ }
+ }
+ // return true anyway as some keys will mismatch.
+ return true;
+ }
- private static void init3() {
- mInitMap.put(new Pair<String, String>("func_153183_d", "glCreateProgram"));
- mInitMap.put(new Pair<String, String>("func_153187_e", "glDeleteProgram"));
- mInitMap.put(new Pair<String, String>("func_153189_b", "glUniformMatrix3"));
- mInitMap.put(new Pair<String, String>("func_153191_c", "glUniform3"));
- mInitMap.put(new Pair<String, String>("func_153192_c", "glUniform3"));
- mInitMap.put(new Pair<String, String>("func_153194_a", "glGetUniformLocation"));
- mInitMap.put(new Pair<String, String>("func_153195_b", "glCreateShader"));
- mInitMap.put(new Pair<String, String>("func_154310_c", "getButtonHeight"));
- mInitMap.put(new Pair<String, String>("func_154311_a", "setText"));
- mInitMap.put(new Pair<String, String>("func_154313_b", "setEnabled"));
- mInitMap.put(new Pair<String, String>("func_154314_d", "getId"));
- mInitMap.put(new Pair<String, String>("func_154315_e", "getEnabled"));
- mInitMap.put(new Pair<String, String>("func_154316_f", "getPositionY"));
- mInitMap.put(new Pair<String, String>("func_154317_g", "getRealmsButton"));
- mInitMap.put(new Pair<String, String>("func_154331_x", "getLastActiveTime"));
- mInitMap.put(new Pair<String, String>("func_154346_a", "hasAcceptedEULA"));
- mInitMap.put(new Pair<String, String>("func_154347_a", "loadEULAFile"));
- mInitMap.put(new Pair<String, String>("func_154348_b", "createEULAFile"));
- mInitMap.put(new Pair<String, String>("func_155759_m", "setServerResourcePack"));
- mInitMap.put(new Pair<String, String>("func_70000_a", "addServerStatsToSnooper"));
- mInitMap.put(new Pair<String, String>("func_70001_b", "addServerTypeToSnooper"));
- mInitMap.put(new Pair<String, String>("func_70002_Q", "isSnooperEnabled"));
- mInitMap.put(new Pair<String, String>("func_70003_b", "canCommandSenderUseCommand"));
- mInitMap.put(new Pair<String, String>("func_70005_c_", "getCommandSenderName"));
- mInitMap.put(new Pair<String, String>("func_70007_b", "resetLog"));
- mInitMap.put(new Pair<String, String>("func_70008_c", "getLogContents"));
- mInitMap.put(new Pair<String, String>("func_70011_f", "getDistance"));
- mInitMap.put(new Pair<String, String>("func_70012_b", "setLocationAndAngles"));
- mInitMap.put(new Pair<String, String>("func_70013_c", "getBrightness"));
- mInitMap.put(new Pair<String, String>("func_70014_b", "writeEntityToNBT"));
- mInitMap.put(new Pair<String, String>("func_70015_d", "setFire"));
- mInitMap.put(new Pair<String, String>("func_70016_h", "setVelocity"));
- mInitMap.put(new Pair<String, String>("func_70018_K", "setBeenAttacked"));
- mInitMap.put(new Pair<String, String>("func_70019_c", "setEating"));
- mInitMap.put(new Pair<String, String>("func_70020_e", "readFromNBT"));
- mInitMap.put(new Pair<String, String>("func_70021_al", "getParts"));
- mInitMap.put(new Pair<String, String>("func_70022_Q", "getEntityString"));
- mInitMap.put(new Pair<String, String>("func_70024_g", "addVelocity"));
- mInitMap.put(new Pair<String, String>("func_70026_G", "isWet"));
- mInitMap.put(new Pair<String, String>("func_70027_ad", "isBurning"));
- mInitMap.put(new Pair<String, String>("func_70028_i", "isEntityEqual"));
- mInitMap.put(new Pair<String, String>("func_70029_a", "setWorld"));
- mInitMap.put(new Pair<String, String>("func_70030_z", "onEntityUpdate"));
- mInitMap.put(new Pair<String, String>("func_70031_b", "setSprinting"));
- mInitMap.put(new Pair<String, String>("func_70032_d", "getDistanceToEntity"));
- mInitMap.put(new Pair<String, String>("func_70033_W", "getYOffset"));
- mInitMap.put(new Pair<String, String>("func_70034_d", "setRotationYawHead"));
- mInitMap.put(new Pair<String, String>("func_70035_c", "getInventory"));
- mInitMap.put(new Pair<String, String>("func_70037_a", "readEntityFromNBT"));
- mInitMap.put(new Pair<String, String>("func_70038_c", "isOffsetPositionInLiquid"));
- mInitMap.put(new Pair<String, String>("func_70039_c", "writeToNBTOptional"));
- mInitMap.put(new Pair<String, String>("func_70040_Z", "getLookVec"));
- mInitMap.put(new Pair<String, String>("func_70041_e_", "canTriggerWalking"));
- mInitMap.put(new Pair<String, String>("func_70042_X", "getMountedYOffset"));
- mInitMap.put(new Pair<String, String>("func_70043_V", "updateRiderPosition"));
- mInitMap.put(new Pair<String, String>("func_70044_A", "setOnFireFromLava"));
- mInitMap.put(new Pair<String, String>("func_70045_F", "isImmuneToFire"));
- mInitMap.put(new Pair<String, String>("func_70046_E", "getBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_70047_e", "getEyeHeight"));
- mInitMap.put(new Pair<String, String>("func_70049_a", "mInitMap.put(newFloatNBTList"));
- mInitMap.put(new Pair<String, String>("func_70050_g", "setAir"));
- mInitMap.put(new Pair<String, String>("func_70051_ag", "isSprinting"));
- mInitMap.put(new Pair<String, String>("func_70052_a", "setFlag"));
- mInitMap.put(new Pair<String, String>("func_70053_R", "getShadowSize"));
- mInitMap.put(new Pair<String, String>("func_70055_a", "isInsideOfMaterial"));
- mInitMap.put(new Pair<String, String>("func_70056_a", "setPositionAndRotation2"));
- mInitMap.put(new Pair<String, String>("func_70057_ab", "performHurtAnimation"));
- mInitMap.put(new Pair<String, String>("func_70058_J", "handleLavaMovement"));
- mInitMap.put(new Pair<String, String>("func_70060_a", "moveFlying"));
- mInitMap.put(new Pair<String, String>("func_70062_b", "setCurrentItemOrArmor"));
- mInitMap.put(new Pair<String, String>("func_70063_aa", "setInPortal"));
- mInitMap.put(new Pair<String, String>("func_70064_a", "updateFallState"));
- mInitMap.put(new Pair<String, String>("func_70065_x", "preparePlayerToSpawn"));
- mInitMap.put(new Pair<String, String>("func_70066_B", "extinguish"));
- mInitMap.put(new Pair<String, String>("func_70067_L", "canBeCollidedWith"));
- mInitMap.put(new Pair<String, String>("func_70068_e", "getDistanceSqToEntity"));
- mInitMap.put(new Pair<String, String>("func_70069_a", "fall"));
- mInitMap.put(new Pair<String, String>("func_70070_b", "getBrightnessForRender"));
- mInitMap.put(new Pair<String, String>("func_70071_h_", "onUpdate"));
- mInitMap.put(new Pair<String, String>("func_70072_I", "handleWaterMovement"));
- mInitMap.put(new Pair<String, String>("func_70074_a", "onKillEntity"));
- mInitMap.put(new Pair<String, String>("func_70075_an", "canAttackWithItem"));
- mInitMap.put(new Pair<String, String>("func_70076_C", "kill"));
- mInitMap.put(new Pair<String, String>("func_70077_a", "onStruckByLightning"));
- mInitMap.put(new Pair<String, String>("func_70078_a", "mountEntity"));
- mInitMap.put(new Pair<String, String>("func_70079_am", "getRotationYawHead"));
- mInitMap.put(new Pair<String, String>("func_70080_a", "setPositionAndRotation"));
- mInitMap.put(new Pair<String, String>("func_70081_e", "dealFireDamage"));
- mInitMap.put(new Pair<String, String>("func_70082_c", "setAngles"));
- mInitMap.put(new Pair<String, String>("func_70083_f", "getFlag"));
- mInitMap.put(new Pair<String, String>("func_70084_c", "addToPlayerScore"));
- mInitMap.put(new Pair<String, String>("func_70085_c", "interact"));
- mInitMap.put(new Pair<String, String>("func_70086_ai", "getAir"));
- mInitMap.put(new Pair<String, String>("func_70087_a", "mInitMap.put(newDoubleNBTList"));
- mInitMap.put(new Pair<String, String>("func_70088_a", "entityInit"));
- mInitMap.put(new Pair<String, String>("func_70089_S", "isEntityAlive"));
- mInitMap.put(new Pair<String, String>("func_70090_H", "isInWater"));
- mInitMap.put(new Pair<String, String>("func_70091_d", "moveEntity"));
- mInitMap.put(new Pair<String, String>("func_70092_e", "getDistanceSq"));
- mInitMap.put(new Pair<String, String>("func_70093_af", "isSneaking"));
- mInitMap.put(new Pair<String, String>("func_70094_T", "isEntityInsideOpaqueBlock"));
- mInitMap.put(new Pair<String, String>("func_70095_a", "setSneaking"));
- mInitMap.put(new Pair<String, String>("func_70096_w", "getDataWatcher"));
- mInitMap.put(new Pair<String, String>("func_70097_a", "attackEntityFrom"));
- mInitMap.put(new Pair<String, String>("func_70098_U", "updateRidden"));
- mInitMap.put(new Pair<String, String>("func_70099_a", "entityDropItem"));
- mInitMap.put(new Pair<String, String>("func_70100_b_", "onCollideWithPlayer"));
- mInitMap.put(new Pair<String, String>("func_70101_b", "setRotation"));
- mInitMap.put(new Pair<String, String>("func_70103_a", "handleHealthUpdate"));
- mInitMap.put(new Pair<String, String>("func_70104_M", "canBePushed"));
- mInitMap.put(new Pair<String, String>("func_70105_a", "setSize"));
- mInitMap.put(new Pair<String, String>("func_70106_y", "setDead"));
- mInitMap.put(new Pair<String, String>("func_70107_b", "setPosition"));
- mInitMap.put(new Pair<String, String>("func_70108_f", "applyEntityCollision"));
- mInitMap.put(new Pair<String, String>("func_70109_d", "writeToNBT"));
- mInitMap.put(new Pair<String, String>("func_70110_aj", "setInWeb"));
- mInitMap.put(new Pair<String, String>("func_70111_Y", "getCollisionBorderSize"));
- mInitMap.put(new Pair<String, String>("func_70112_a", "isInRangeToRenderDist"));
- mInitMap.put(new Pair<String, String>("func_70113_ah", "isEating"));
- mInitMap.put(new Pair<String, String>("func_70114_g", "getCollisionBox"));
- mInitMap.put(new Pair<String, String>("func_70115_ae", "isRiding"));
- mInitMap.put(new Pair<String, String>("func_70184_a", "onImpact"));
- mInitMap.put(new Pair<String, String>("func_70185_h", "getGravityVelocity"));
- mInitMap.put(new Pair<String, String>("func_70186_c", "setThrowableHeading"));
- mInitMap.put(new Pair<String, String>("func_70196_i", "getPotionDamage"));
- mInitMap.put(new Pair<String, String>("func_70220_a", "moveTowards"));
- mInitMap.put(new Pair<String, String>("func_70227_a", "onImpact"));
- mInitMap.put(new Pair<String, String>("func_70239_b", "setDamage"));
- mInitMap.put(new Pair<String, String>("func_70240_a", "setKnockbackStrength"));
- mInitMap.put(new Pair<String, String>("func_70241_g", "getIsCritical"));
- mInitMap.put(new Pair<String, String>("func_70242_d", "getDamage"));
- mInitMap.put(new Pair<String, String>("func_70243_d", "setIsCritical"));
- mInitMap.put(new Pair<String, String>("func_70265_b", "setTimeSinceHit"));
- mInitMap.put(new Pair<String, String>("func_70266_a", "setDamageTaken"));
- mInitMap.put(new Pair<String, String>("func_70267_i", "getForwardDirection"));
- mInitMap.put(new Pair<String, String>("func_70268_h", "getTimeSinceHit"));
- mInitMap.put(new Pair<String, String>("func_70269_c", "setForwardDirection"));
- mInitMap.put(new Pair<String, String>("func_70270_d", "setIsBoatEmpty"));
- mInitMap.put(new Pair<String, String>("func_70271_g", "getDamageTaken"));
- mInitMap.put(new Pair<String, String>("func_70288_d", "setAgeToCreativeDespawnTime"));
- mInitMap.put(new Pair<String, String>("func_70289_a", "combineItems"));
- mInitMap.put(new Pair<String, String>("func_70295_k_", "openChest"));
- mInitMap.put(new Pair<String, String>("func_70296_d", "markDirty"));
- mInitMap.put(new Pair<String, String>("func_70297_j_", "getInventoryStackLimit"));
- mInitMap.put(new Pair<String, String>("func_70298_a", "decrStackSize"));
- mInitMap.put(new Pair<String, String>("func_70299_a", "setInventorySlotContents"));
- mInitMap.put(new Pair<String, String>("func_70300_a", "isUseableByPlayer"));
- mInitMap.put(new Pair<String, String>("func_70301_a", "getStackInSlot"));
- mInitMap.put(new Pair<String, String>("func_70302_i_", "getSizeInventory"));
- mInitMap.put(new Pair<String, String>("func_70304_b", "getStackInSlotOnClosing"));
- mInitMap.put(new Pair<String, String>("func_70305_f", "closeChest"));
- mInitMap.put(new Pair<String, String>("func_70429_k", "decrementAnimations"));
- mInitMap.put(new Pair<String, String>("func_70430_l", "getTotalArmorValue"));
- mInitMap.put(new Pair<String, String>("func_70431_c", "hasItemStack"));
- mInitMap.put(new Pair<String, String>("func_70432_d", "storeItemStack"));
- mInitMap.put(new Pair<String, String>("func_70436_m", "dropAllItems"));
- mInitMap.put(new Pair<String, String>("func_70437_b", "setItemStack"));
- mInitMap.put(new Pair<String, String>("func_70440_f", "armorItemInSlot"));
- mInitMap.put(new Pair<String, String>("func_70441_a", "addItemStackToInventory"));
- mInitMap.put(new Pair<String, String>("func_70442_a", "writeToNBT"));
- mInitMap.put(new Pair<String, String>("func_70443_b", "readFromNBT"));
- mInitMap.put(new Pair<String, String>("func_70445_o", "getItemStack"));
- mInitMap.put(new Pair<String, String>("func_70447_i", "getFirstEmptyStack"));
- mInitMap.put(new Pair<String, String>("func_70448_g", "getCurrentItem"));
- mInitMap.put(new Pair<String, String>("func_70449_g", "damageArmor"));
- mInitMap.put(new Pair<String, String>("func_70451_h", "getHotbarSize"));
- mInitMap.put(new Pair<String, String>("func_70452_e", "storePartialItemStack"));
- mInitMap.put(new Pair<String, String>("func_70453_c", "changeCurrentItem"));
- mInitMap.put(new Pair<String, String>("func_70455_b", "copyInventory"));
- mInitMap.put(new Pair<String, String>("func_70463_b", "getStackInRowAndColumn"));
- mInitMap.put(new Pair<String, String>("func_70468_h", "getCurrentRecipe"));
- mInitMap.put(new Pair<String, String>("func_70469_d", "inventoryResetNeededOnSlotChange"));
- mInitMap.put(new Pair<String, String>("func_70470_g", "resetRecipeAndSlots"));
- mInitMap.put(new Pair<String, String>("func_70471_c", "setCurrentRecipeIndex"));
- mInitMap.put(new Pair<String, String>("func_70486_a", "loadInventoryFromNBT"));
- mInitMap.put(new Pair<String, String>("func_70487_g", "saveInventoryToNBT"));
- mInitMap.put(new Pair<String, String>("func_70491_i", "getDamage"));
- mInitMap.put(new Pair<String, String>("func_70492_c", "setDamage"));
- mInitMap.put(new Pair<String, String>("func_70493_k", "getRollingDirection"));
- mInitMap.put(new Pair<String, String>("func_70494_i", "setRollingDirection"));
- mInitMap.put(new Pair<String, String>("func_70496_j", "getRollingAmplitude"));
- mInitMap.put(new Pair<String, String>("func_70497_h", "setRollingAmplitude"));
- mInitMap.put(new Pair<String, String>("func_70515_d", "explode"));
- mInitMap.put(new Pair<String, String>("func_70518_d", "onValidSurface"));
- mInitMap.put(new Pair<String, String>("func_70526_d", "getXpValue"));
- mInitMap.put(new Pair<String, String>("func_70527_a", "getXPSplit"));
- mInitMap.put(new Pair<String, String>("func_70528_g", "getTextureByXP"));
- mInitMap.put(new Pair<String, String>("func_70534_d", "getRedColorF"));
- mInitMap.put(new Pair<String, String>("func_70535_g", "getBlueColorF"));
- mInitMap.put(new Pair<String, String>("func_70536_a", "setParticleTextureIndex"));
- mInitMap.put(new Pair<String, String>("func_70537_b", "getFXLayer"));
- mInitMap.put(new Pair<String, String>("func_70538_b", "setRBGColorF"));
- mInitMap.put(new Pair<String, String>("func_70539_a", "renderParticle"));
- mInitMap.put(new Pair<String, String>("func_70541_f", "multipleParticleScaleBy"));
- mInitMap.put(new Pair<String, String>("func_70542_f", "getGreenColorF"));
- mInitMap.put(new Pair<String, String>("func_70543_e", "multiplyVelocity"));
- mInitMap.put(new Pair<String, String>("func_70589_b", "setBaseSpellTextureIndex"));
- mInitMap.put(new Pair<String, String>("func_70596_a", "applyColourMultiplier"));
- mInitMap.put(new Pair<String, String>("func_70599_aP", "getSoundVolume"));
- mInitMap.put(new Pair<String, String>("func_70600_l", "dropRareDrop"));
- mInitMap.put(new Pair<String, String>("func_70601_bi", "getCanSpawnHere"));
- mInitMap.put(new Pair<String, String>("func_70603_bj", "getRenderSizeModifier"));
- mInitMap.put(new Pair<String, String>("func_70604_c", "setRevengeTarget"));
- mInitMap.put(new Pair<String, String>("func_70605_aq", "getMoveHelper"));
- mInitMap.put(new Pair<String, String>("func_70606_j", "setHealth"));
- mInitMap.put(new Pair<String, String>("func_70608_bn", "isPlayerSleeping"));
- mInitMap.put(new Pair<String, String>("func_70609_aI", "onDeathUpdate"));
- mInitMap.put(new Pair<String, String>("func_70610_aX", "isMovementBlocked"));
- mInitMap.put(new Pair<String, String>("func_70612_e", "moveEntityWithHeading"));
- mInitMap.put(new Pair<String, String>("func_70613_aW", "isServerWorld"));
- mInitMap.put(new Pair<String, String>("func_70614_a", "rayTrace"));
- mInitMap.put(new Pair<String, String>("func_70615_aA", "eatGrassBonus"));
- mInitMap.put(new Pair<String, String>("func_70617_f_", "isOnLadder"));
- mInitMap.put(new Pair<String, String>("func_70618_n", "removePotionEffectClient"));
- mInitMap.put(new Pair<String, String>("func_70619_bc", "updateAITasks"));
- mInitMap.put(new Pair<String, String>("func_70620_b", "getItemIcon"));
- mInitMap.put(new Pair<String, String>("func_70621_aR", "getHurtSound"));
- mInitMap.put(new Pair<String, String>("func_70623_bb", "despawnEntity"));
- mInitMap.put(new Pair<String, String>("func_70624_b", "setAttackTarget"));
- mInitMap.put(new Pair<String, String>("func_70625_a", "faceEntity"));
- mInitMap.put(new Pair<String, String>("func_70626_be", "updateEntityActionState"));
- mInitMap.put(new Pair<String, String>("func_70627_aG", "getTalkInterval"));
- mInitMap.put(new Pair<String, String>("func_70628_a", "dropFewItems"));
- mInitMap.put(new Pair<String, String>("func_70629_bd", "updateAITick"));
- mInitMap.put(new Pair<String, String>("func_70631_g_", "isChild"));
- mInitMap.put(new Pair<String, String>("func_70632_aY", "isBlocking"));
- mInitMap.put(new Pair<String, String>("func_70634_a", "setPositionAndUpdate"));
- mInitMap.put(new Pair<String, String>("func_70635_at", "getEntitySenses"));
- mInitMap.put(new Pair<String, String>("func_70636_d", "onLivingUpdate"));
- mInitMap.put(new Pair<String, String>("func_70637_d", "setJumping"));
- mInitMap.put(new Pair<String, String>("func_70638_az", "getAttackTarget"));
- mInitMap.put(new Pair<String, String>("func_70639_aQ", "getLivingSound"));
- mInitMap.put(new Pair<String, String>("func_70641_bl", "getMaxSpawnedInChunk"));
- mInitMap.put(new Pair<String, String>("func_70642_aH", "playLivingSound"));
- mInitMap.put(new Pair<String, String>("func_70643_av", "getAITarget"));
- mInitMap.put(new Pair<String, String>("func_70644_a", "isPotionActive"));
- mInitMap.put(new Pair<String, String>("func_70645_a", "onDeath"));
- mInitMap.put(new Pair<String, String>("func_70646_bf", "getVerticalFaceSpeed"));
- mInitMap.put(new Pair<String, String>("func_70647_i", "getSoundPitch"));
- mInitMap.put(new Pair<String, String>("func_70648_aU", "canBreatheUnderwater"));
- mInitMap.put(new Pair<String, String>("func_70650_aV", "isAIEnabled"));
- mInitMap.put(new Pair<String, String>("func_70651_bq", "getActivePotionEffects"));
- mInitMap.put(new Pair<String, String>("func_70652_k", "attackEntityAsMob"));
- mInitMap.put(new Pair<String, String>("func_70653_a", "knockBack"));
- mInitMap.put(new Pair<String, String>("func_70654_ax", "getAge"));
- mInitMap.put(new Pair<String, String>("func_70655_b", "applyArmorCalculations"));
- mInitMap.put(new Pair<String, String>("func_70656_aK", "spawnExplosionParticle"));
- mInitMap.put(new Pair<String, String>("func_70657_f", "setMoveForward"));
- mInitMap.put(new Pair<String, String>("func_70658_aO", "getTotalArmorValue"));
- mInitMap.put(new Pair<String, String>("func_70659_e", "setAIMoveSpeed"));
- mInitMap.put(new Pair<String, String>("func_70660_b", "getActivePotionEffect"));
- mInitMap.put(new Pair<String, String>("func_70661_as", "getNavigator"));
- mInitMap.put(new Pair<String, String>("func_70662_br", "isEntityUndead"));
- mInitMap.put(new Pair<String, String>("func_70663_b", "updateRotation"));
- mInitMap.put(new Pair<String, String>("func_70664_aZ", "jump"));
- mInitMap.put(new Pair<String, String>("func_70665_d", "damageEntity"));
- mInitMap.put(new Pair<String, String>("func_70666_h", "getPosition"));
- mInitMap.put(new Pair<String, String>("func_70668_bt", "getCreatureAttribute"));
- mInitMap.put(new Pair<String, String>("func_70669_a", "renderBrokenItemStack"));
- mInitMap.put(new Pair<String, String>("func_70670_a", "onmInitMap.put(newPotionEffect"));
- mInitMap.put(new Pair<String, String>("func_70671_ap", "getLookHelper"));
- mInitMap.put(new Pair<String, String>("func_70672_c", "applyPotionDamageCalculations"));
- mInitMap.put(new Pair<String, String>("func_70673_aS", "getDeathSound"));
- mInitMap.put(new Pair<String, String>("func_70674_bp", "clearActivePotions"));
- mInitMap.put(new Pair<String, String>("func_70675_k", "damageArmor"));
- mInitMap.put(new Pair<String, String>("func_70676_i", "getLook"));
- mInitMap.put(new Pair<String, String>("func_70678_g", "getSwingProgress"));
- mInitMap.put(new Pair<String, String>("func_70679_bo", "updatePotionEffects"));
- mInitMap.put(new Pair<String, String>("func_70681_au", "getRNG"));
- mInitMap.put(new Pair<String, String>("func_70682_h", "decreaseAirSupply"));
- mInitMap.put(new Pair<String, String>("func_70683_ar", "getJumpHelper"));
- mInitMap.put(new Pair<String, String>("func_70684_aJ", "isPlayer"));
- mInitMap.put(new Pair<String, String>("func_70685_l", "canEntityBeSeen"));
- mInitMap.put(new Pair<String, String>("func_70686_a", "canAttackClass"));
- mInitMap.put(new Pair<String, String>("func_70687_e", "isPotionApplicable"));
- mInitMap.put(new Pair<String, String>("func_70688_c", "onFinishedPotionEffect"));
- mInitMap.put(new Pair<String, String>("func_70689_ay", "getAIMoveSpeed"));
- mInitMap.put(new Pair<String, String>("func_70690_d", "addPotionEffect"));
- mInitMap.put(new Pair<String, String>("func_70691_i", "heal"));
- mInitMap.put(new Pair<String, String>("func_70692_ba", "canDespawn"));
- mInitMap.put(new Pair<String, String>("func_70693_a", "getExperiencePoints"));
- mInitMap.put(new Pair<String, String>("func_70694_bm", "getHeldItem"));
- mInitMap.put(new Pair<String, String>("func_70695_b", "onChangedPotionEffect"));
- mInitMap.put(new Pair<String, String>("func_70777_m", "getEntityToAttack"));
- mInitMap.put(new Pair<String, String>("func_70778_a", "setPathToEntity"));
- mInitMap.put(new Pair<String, String>("func_70779_j", "updateWanderPath"));
- mInitMap.put(new Pair<String, String>("func_70780_i", "isMovementCeased"));
- mInitMap.put(new Pair<String, String>("func_70781_l", "hasPath"));
- mInitMap.put(new Pair<String, String>("func_70782_k", "findPlayerToAttack"));
- mInitMap.put(new Pair<String, String>("func_70783_a", "getBlockPathWeight"));
- mInitMap.put(new Pair<String, String>("func_70784_b", "setTarget"));
- mInitMap.put(new Pair<String, String>("func_70785_a", "attackEntity"));
- mInitMap.put(new Pair<String, String>("func_70790_a", "isCourseTraversable"));
- mInitMap.put(new Pair<String, String>("func_70799_a", "setSlimeSize"));
- mInitMap.put(new Pair<String, String>("func_70800_m", "canDamagePlayer"));
- mInitMap.put(new Pair<String, String>("func_70801_i", "getSlimeParticle"));
- mInitMap.put(new Pair<String, String>("func_70802_j", "createInstance"));
- mInitMap.put(new Pair<String, String>("func_70803_o", "getJumpSound"));
- mInitMap.put(new Pair<String, String>("func_70804_p", "makesSoundOnLand"));
- mInitMap.put(new Pair<String, String>("func_70805_n", "getAttackStrength"));
- mInitMap.put(new Pair<String, String>("func_70806_k", "getJumpDelay"));
- mInitMap.put(new Pair<String, String>("func_70807_r", "makesSoundOnJump"));
- mInitMap.put(new Pair<String, String>("func_70808_l", "alterSquishAmount"));
- mInitMap.put(new Pair<String, String>("func_70809_q", "getSlimeSize"));
- mInitMap.put(new Pair<String, String>("func_70814_o", "isValidLightLevel"));
- mInitMap.put(new Pair<String, String>("func_70816_c", "teleportToEntity"));
- mInitMap.put(new Pair<String, String>("func_70817_b", "setCarryingData"));
- mInitMap.put(new Pair<String, String>("func_70819_e", "setScreaming"));
- mInitMap.put(new Pair<String, String>("func_70820_n", "teleportRandomly"));
- mInitMap.put(new Pair<String, String>("func_70821_d", "shouldAttackPlayer"));
- mInitMap.put(new Pair<String, String>("func_70823_r", "isScreaming"));
- mInitMap.put(new Pair<String, String>("func_70824_q", "getCarryingData"));
- mInitMap.put(new Pair<String, String>("func_70825_j", "teleportTo"));
- mInitMap.put(new Pair<String, String>("func_70829_a", "setCreeperState"));
- mInitMap.put(new Pair<String, String>("func_70830_n", "getPowered"));
- mInitMap.put(new Pair<String, String>("func_70831_j", "getCreeperFlashIntensity"));
- mInitMap.put(new Pair<String, String>("func_70832_p", "getCreeperState"));
- mInitMap.put(new Pair<String, String>("func_70835_c", "becomeAngryAt"));
- mInitMap.put(new Pair<String, String>("func_70839_e", "setBesideClimbableBlock"));
- mInitMap.put(new Pair<String, String>("func_70841_p", "isBesideClimbableBlock"));
- mInitMap.put(new Pair<String, String>("func_70849_f", "setPlayerCreated"));
- mInitMap.put(new Pair<String, String>("func_70850_q", "isPlayerCreated"));
- mInitMap.put(new Pair<String, String>("func_70851_e", "setHoldingRose"));
- mInitMap.put(new Pair<String, String>("func_70852_n", "getVillage"));
- mInitMap.put(new Pair<String, String>("func_70853_p", "getHoldRoseTick"));
- mInitMap.put(new Pair<String, String>("func_70854_o", "getAttackTimer"));
- mInitMap.put(new Pair<String, String>("func_70873_a", "setGrowingAge"));
- mInitMap.put(new Pair<String, String>("func_70874_b", "getGrowingAge"));
- mInitMap.put(new Pair<String, String>("func_70875_t", "resetInLove"));
- mInitMap.put(new Pair<String, String>("func_70876_c", "procreate"));
- mInitMap.put(new Pair<String, String>("func_70877_b", "isBreedingItem"));
- mInitMap.put(new Pair<String, String>("func_70878_b", "canMateWith"));
- mInitMap.put(new Pair<String, String>("func_70880_s", "isInLove"));
- mInitMap.put(new Pair<String, String>("func_70890_k", "getHeadRotationAngleX"));
- mInitMap.put(new Pair<String, String>("func_70891_b", "setFleeceColor"));
- mInitMap.put(new Pair<String, String>("func_70892_o", "getSheared"));
- mInitMap.put(new Pair<String, String>("func_70893_e", "setSheared"));
- mInitMap.put(new Pair<String, String>("func_70894_j", "getHeadRotationPointY"));
- mInitMap.put(new Pair<String, String>("func_70895_a", "getRandomFleeceColor"));
- mInitMap.put(new Pair<String, String>("func_70896_n", "getFleeceColor"));
- mInitMap.put(new Pair<String, String>("func_70900_e", "setSaddled"));
- mInitMap.put(new Pair<String, String>("func_70901_n", "getSaddled"));
- mInitMap.put(new Pair<String, String>("func_70902_q", "getOwner"));
- mInitMap.put(new Pair<String, String>("func_70903_f", "setTamed"));
- mInitMap.put(new Pair<String, String>("func_70904_g", "setSitting"));
- mInitMap.put(new Pair<String, String>("func_70906_o", "isSitting"));
- mInitMap.put(new Pair<String, String>("func_70907_r", "getAISit"));
- mInitMap.put(new Pair<String, String>("func_70908_e", "playTameEffect"));
- mInitMap.put(new Pair<String, String>("func_70909_n", "isTamed"));
- mInitMap.put(new Pair<String, String>("func_70912_b", "setTameSkin"));
- mInitMap.put(new Pair<String, String>("func_70913_u", "getTameSkin"));
- mInitMap.put(new Pair<String, String>("func_70915_j", "getShadingWhileWet"));
- mInitMap.put(new Pair<String, String>("func_70916_h", "setAngry"));
- mInitMap.put(new Pair<String, String>("func_70917_k", "getInterestedAngle"));
- mInitMap.put(new Pair<String, String>("func_70919_bu", "isAngry"));
- mInitMap.put(new Pair<String, String>("func_70920_v", "getTailRotation"));
- mInitMap.put(new Pair<String, String>("func_70921_u", "isWolfWet"));
- mInitMap.put(new Pair<String, String>("func_70923_f", "getShakeAngle"));
- mInitMap.put(new Pair<String, String>("func_70930_a", "setRecipes"));
- mInitMap.put(new Pair<String, String>("func_70931_l_", "getCustomer"));
- mInitMap.put(new Pair<String, String>("func_70932_a_", "setCustomer"));
- mInitMap.put(new Pair<String, String>("func_70933_a", "useRecipe"));
- mInitMap.put(new Pair<String, String>("func_70934_b", "getRecipes"));
- mInitMap.put(new Pair<String, String>("func_70938_b", "setProfession"));
- mInitMap.put(new Pair<String, String>("func_70939_f", "setPlaying"));
- mInitMap.put(new Pair<String, String>("func_70940_q", "isTrading"));
- mInitMap.put(new Pair<String, String>("func_70941_o", "isMating"));
- mInitMap.put(new Pair<String, String>("func_70942_a", "generateRandomParticles"));
- mInitMap.put(new Pair<String, String>("func_70945_p", "isPlaying"));
- mInitMap.put(new Pair<String, String>("func_70946_n", "getProfession"));
- mInitMap.put(new Pair<String, String>("func_70947_e", "setMating"));
- mInitMap.put(new Pair<String, String>("func_70950_c", "addDefaultEquipmentAndRecipies"));
- mInitMap.put(new Pair<String, String>("func_70965_a", "attackEntityFromPart"));
- mInitMap.put(new Pair<String, String>("func_70967_k", "setmInitMap.put(newTarget"));
- mInitMap.put(new Pair<String, String>("func_70969_j", "updateDragonEnderCrystal"));
- mInitMap.put(new Pair<String, String>("func_70970_a", "collideWithEntities"));
- mInitMap.put(new Pair<String, String>("func_70971_b", "attackEntitiesInList"));
- mInitMap.put(new Pair<String, String>("func_70972_a", "destroyBlocksInAABB"));
- mInitMap.put(new Pair<String, String>("func_70973_b", "simplifyAngle"));
- mInitMap.put(new Pair<String, String>("func_70974_a", "getMovementOffsets"));
- mInitMap.put(new Pair<String, String>("func_70975_a", "createEnderPortal"));
- mInitMap.put(new Pair<String, String>("func_70996_bM", "shouldHeal"));
- mInitMap.put(new Pair<String, String>("func_70997_bJ", "getBedLocation"));
- mInitMap.put(new Pair<String, String>("func_70998_m", "interactWith"));
- mInitMap.put(new Pair<String, String>("func_70999_a", "wakeUpPlayer"));
- mInitMap.put(new Pair<String, String>("func_71000_j", "addMovementStat"));
- mInitMap.put(new Pair<String, String>("func_71001_a", "onItemPickup"));
- mInitMap.put(new Pair<String, String>("func_71002_c", "displayGUIEnchantment"));
- mInitMap.put(new Pair<String, String>("func_71004_bE", "respawnPlayer"));
- mInitMap.put(new Pair<String, String>("func_71005_bN", "getInventoryEnderChest"));
- mInitMap.put(new Pair<String, String>("func_71007_a", "displayGUIChest"));
- mInitMap.put(new Pair<String, String>("func_71008_a", "setItemInUse"));
- mInitMap.put(new Pair<String, String>("func_71009_b", "onCriticalHit"));
- mInitMap.put(new Pair<String, String>("func_71010_c", "updateItemUse"));
- mInitMap.put(new Pair<String, String>("func_71011_bu", "getItemInUse"));
- mInitMap.put(new Pair<String, String>("func_71012_a", "joinEntityItemWithWorld"));
- mInitMap.put(new Pair<String, String>("func_71015_k", "addMountedMovementStat"));
- mInitMap.put(new Pair<String, String>("func_71016_p", "sendPlayerAbilities"));
- mInitMap.put(new Pair<String, String>("func_71018_a", "sleepInBedAt"));
- mInitMap.put(new Pair<String, String>("func_71019_a", "dropPlayerItemWithRandomChoice"));
- mInitMap.put(new Pair<String, String>("func_71020_j", "addExhaustion"));
- mInitMap.put(new Pair<String, String>("func_71023_q", "addExperience"));
- mInitMap.put(new Pair<String, String>("func_71024_bL", "getFoodStats"));
- mInitMap.put(new Pair<String, String>("func_71026_bH", "isPlayerFullyAsleep"));
- mInitMap.put(new Pair<String, String>("func_71027_c", "travelToDimension"));
- mInitMap.put(new Pair<String, String>("func_71028_bD", "destroyCurrentEquippedItem"));
- mInitMap.put(new Pair<String, String>("func_71029_a", "triggerAchievement"));
- mInitMap.put(new Pair<String, String>("func_71030_a", "displayGUIMerchant"));
- mInitMap.put(new Pair<String, String>("func_71033_a", "setGameType"));
- mInitMap.put(new Pair<String, String>("func_71034_by", "stopUsingItem"));
- mInitMap.put(new Pair<String, String>("func_71036_o", "onItemUseFinish"));
- mInitMap.put(new Pair<String, String>("func_71037_bA", "getScore"));
- mInitMap.put(new Pair<String, String>("func_71038_i", "swingItem"));
- mInitMap.put(new Pair<String, String>("func_71039_bw", "isUsingItem"));
- mInitMap.put(new Pair<String, String>("func_71040_bB", "dropOneItem"));
- mInitMap.put(new Pair<String, String>("func_71041_bz", "clearItemInUse"));
- mInitMap.put(new Pair<String, String>("func_71043_e", "canEat"));
- mInitMap.put(new Pair<String, String>("func_71044_o", "collideWithPlayer"));
- mInitMap.put(new Pair<String, String>("func_71045_bC", "getCurrentEquippedItem"));
- mInitMap.put(new Pair<String, String>("func_71047_c", "onEnchantmentCritical"));
- mInitMap.put(new Pair<String, String>("func_71048_c", "displayGUIBook"));
- mInitMap.put(new Pair<String, String>("func_71049_a", "clonePlayer"));
- mInitMap.put(new Pair<String, String>("func_71050_bK", "xpBarCap"));
- mInitMap.put(new Pair<String, String>("func_71051_bG", "getBedOrientationInDegrees"));
- mInitMap.put(new Pair<String, String>("func_71052_bv", "getItemInUseCount"));
- mInitMap.put(new Pair<String, String>("func_71053_j", "closeScreen"));
- mInitMap.put(new Pair<String, String>("func_71056_a", "verifyRespawnCoordinates"));
- mInitMap.put(new Pair<String, String>("func_71057_bx", "getItemInUseDuration"));
- mInitMap.put(new Pair<String, String>("func_71058_b", "displayGUIWorkbench"));
- mInitMap.put(new Pair<String, String>("func_71059_n", "attackTargetEntityWithCurrentItem"));
- mInitMap.put(new Pair<String, String>("func_71060_bI", "getSleepTimer"));
- mInitMap.put(new Pair<String, String>("func_71061_d_", "resetHeight"));
- mInitMap.put(new Pair<String, String>("func_71063_a", "setSpawnChunk"));
- mInitMap.put(new Pair<String, String>("func_71064_a", "addStat"));
- mInitMap.put(new Pair<String, String>("func_71065_l", "isInBed"));
- mInitMap.put(new Pair<String, String>("func_71110_a", "updateCraftingInventory"));
- mInitMap.put(new Pair<String, String>("func_71111_a", "sendSlotContents"));
- mInitMap.put(new Pair<String, String>("func_71112_a", "sendProgressBarUpdate"));
- mInitMap.put(new Pair<String, String>("func_71113_k", "updateHeldItem"));
- mInitMap.put(new Pair<String, String>("func_71114_r", "getPlayerIP"));
- mInitMap.put(new Pair<String, String>("func_71116_b", "addSelfToInternalCraftingInventory"));
- mInitMap.put(new Pair<String, String>("func_71117_bO", "getNextWindowId"));
- mInitMap.put(new Pair<String, String>("func_71118_n", "setPlayerHealthUpdated"));
- mInitMap.put(new Pair<String, String>("func_71120_a", "sendContainerToPlayer"));
- mInitMap.put(new Pair<String, String>("func_71121_q", "getServerForPlayer"));
- mInitMap.put(new Pair<String, String>("func_71122_b", "handleFalling"));
- mInitMap.put(new Pair<String, String>("func_71123_m", "mountEntityAndWakeUp"));
- mInitMap.put(new Pair<String, String>("func_71124_b", "getEquipmentInSlot"));
- mInitMap.put(new Pair<String, String>("func_71127_g", "onUpdateEntity"));
- mInitMap.put(new Pair<String, String>("func_71128_l", "closeContainer"));
- mInitMap.put(new Pair<String, String>("func_71150_b", "setPlayerSPHealth"));
- mInitMap.put(new Pair<String, String>("func_71151_f", "getFOVMultiplier"));
- mInitMap.put(new Pair<String, String>("func_71152_a", "setXPStats"));
- mInitMap.put(new Pair<String, String>("func_71153_f", "isBlockNormal"));
- mInitMap.put(new Pair<String, String>("func_71165_d", "sendChatMessage"));
- mInitMap.put(new Pair<String, String>("func_71166_b", "sendMotionUpdates"));
- mInitMap.put(new Pair<String, String>("func_71187_D", "getCommandManager"));
- mInitMap.put(new Pair<String, String>("func_71188_g", "setAllowPvp"));
- mInitMap.put(new Pair<String, String>("func_71189_e", "setHostname"));
- mInitMap.put(new Pair<String, String>("func_71190_q", "updateTimeLightAndEntities"));
- mInitMap.put(new Pair<String, String>("func_71191_d", "setBuildLimit"));
- mInitMap.put(new Pair<String, String>("func_71192_d", "setUserMessage"));
- mInitMap.put(new Pair<String, String>("func_71193_K", "allowSpawnMonsters"));
- mInitMap.put(new Pair<String, String>("func_71194_c", "canCreateBonusChest"));
- mInitMap.put(new Pair<String, String>("func_71195_b_", "getUserMessage"));
- mInitMap.put(new Pair<String, String>("func_71197_b", "startServer"));
- mInitMap.put(new Pair<String, String>("func_71198_k", "logDebug"));
- mInitMap.put(new Pair<String, String>("func_71199_h", "isHardcore"));
- mInitMap.put(new Pair<String, String>("func_71200_ad", "serverIsInRunLoop"));
- mInitMap.put(new Pair<String, String>("func_71201_j", "logSevere"));
- mInitMap.put(new Pair<String, String>("func_71203_ab", "getConfigurationManager"));
- mInitMap.put(new Pair<String, String>("func_71204_b", "setDemo"));
- mInitMap.put(new Pair<String, String>("func_71205_p", "setMOTD"));
- mInitMap.put(new Pair<String, String>("func_71206_a", "shareToLAN"));
- mInitMap.put(new Pair<String, String>("func_71207_Z", "getBuildLimit"));
- mInitMap.put(new Pair<String, String>("func_71208_b", "setServerPort"));
- mInitMap.put(new Pair<String, String>("func_71209_f", "getFile"));
- mInitMap.put(new Pair<String, String>("func_71211_k", "getServerHostname"));
- mInitMap.put(new Pair<String, String>("func_71213_z", "getAllUsernames"));
- mInitMap.put(new Pair<String, String>("func_71214_G", "getServerOwner"));
- mInitMap.put(new Pair<String, String>("func_71215_F", "getServerPort"));
- mInitMap.put(new Pair<String, String>("func_71216_a_", "outputPercentRemaining"));
- mInitMap.put(new Pair<String, String>("func_71217_p", "tick"));
- mInitMap.put(new Pair<String, String>("func_71218_a", "worldServerForDimension"));
- mInitMap.put(new Pair<String, String>("func_71219_W", "isPVPEnabled"));
- mInitMap.put(new Pair<String, String>("func_71220_V", "getCanSpawnNPCs"));
- mInitMap.put(new Pair<String, String>("func_71221_J", "getWorldName"));
- mInitMap.put(new Pair<String, String>("func_71222_d", "initialWorldChunkLoad"));
- mInitMap.put(new Pair<String, String>("func_71223_ag", "enableProfiling"));
- mInitMap.put(new Pair<String, String>("func_71224_l", "setServerOwner"));
- mInitMap.put(new Pair<String, String>("func_71225_e", "canStructuresSpawn"));
- mInitMap.put(new Pair<String, String>("func_71228_a", "finalTick"));
- mInitMap.put(new Pair<String, String>("func_71229_d", "setOnlineMode"));
- mInitMap.put(new Pair<String, String>("func_71230_b", "addServerInfoToCrashReport"));
- mInitMap.put(new Pair<String, String>("func_71231_X", "isFlightAllowed"));
- mInitMap.put(new Pair<String, String>("func_71233_x", "getCurrentPlayerCount"));
- mInitMap.put(new Pair<String, String>("func_71234_u", "getPort"));
- mInitMap.put(new Pair<String, String>("func_71235_a", "setGameType"));
- mInitMap.put(new Pair<String, String>("func_71236_h", "logWarning"));
- mInitMap.put(new Pair<String, String>("func_71237_c", "convertMapIfNeeded"));
- mInitMap.put(new Pair<String, String>("func_71238_n", "getDataDirectory"));
- mInitMap.put(new Pair<String, String>("func_71239_B", "isDebuggingEnabled"));
- mInitMap.put(new Pair<String, String>("func_71240_o", "systemExitNow"));
- mInitMap.put(new Pair<String, String>("func_71241_aa", "isServerStopped"));
- mInitMap.put(new Pair<String, String>("func_71242_L", "isDemo"));
- mInitMap.put(new Pair<String, String>("func_71243_i", "clearCurrentTask"));
- mInitMap.put(new Pair<String, String>("func_71244_g", "logInfo"));
- mInitMap.put(new Pair<String, String>("func_71245_h", "setAllowFlight"));
- mInitMap.put(new Pair<String, String>("func_71246_n", "setWorldName"));
- mInitMap.put(new Pair<String, String>("func_71247_a", "loadAllWorlds"));
- mInitMap.put(new Pair<String, String>("func_71248_a", "getPossibleCompletions"));
- mInitMap.put(new Pair<String, String>("func_71249_w", "getMinecraftVersion"));
- mInitMap.put(new Pair<String, String>("func_71250_E", "getKeyPair"));
- mInitMap.put(new Pair<String, String>("func_71251_e", "setCanSpawnAnimals"));
- mInitMap.put(new Pair<String, String>("func_71252_i", "handleRConCommand"));
- mInitMap.put(new Pair<String, String>("func_71253_a", "setKeyPair"));
- mInitMap.put(new Pair<String, String>("func_71254_M", "getActiveAnvilConverter"));
- mInitMap.put(new Pair<String, String>("func_71255_r", "getAllowNether"));
- mInitMap.put(new Pair<String, String>("func_71256_s", "startServerThread"));
- mInitMap.put(new Pair<String, String>("func_71257_f", "setCanSpawnNPCs"));
- mInitMap.put(new Pair<String, String>("func_71258_A", "getPlugins"));
- mInitMap.put(new Pair<String, String>("func_71259_af", "getTickCounter"));
- mInitMap.put(new Pair<String, String>("func_71260_j", "stopServer"));
- mInitMap.put(new Pair<String, String>("func_71261_m", "setFolderName"));
- mInitMap.put(new Pair<String, String>("func_71262_S", "isDedicatedServer"));
- mInitMap.put(new Pair<String, String>("func_71263_m", "initiateShutdown"));
- mInitMap.put(new Pair<String, String>("func_71264_H", "isSinglePlayer"));
- mInitMap.put(new Pair<String, String>("func_71265_f", "getGameType"));
- mInitMap.put(new Pair<String, String>("func_71266_T", "isServerInOnlineMode"));
- mInitMap.put(new Pair<String, String>("func_71267_a", "saveAllWorlds"));
- mInitMap.put(new Pair<String, String>("func_71268_U", "getCanSpawnAnimals"));
- mInitMap.put(new Pair<String, String>("func_71270_I", "getFolderName"));
- mInitMap.put(new Pair<String, String>("func_71272_O", "deleteWorldAndStopServer"));
- mInitMap.put(new Pair<String, String>("func_71273_Y", "getMOTD"));
- mInitMap.put(new Pair<String, String>("func_71274_v", "getMotd"));
- mInitMap.put(new Pair<String, String>("func_71275_y", "getMaxPlayers"));
- mInitMap.put(new Pair<String, String>("func_71276_C", "getServer"));
- mInitMap.put(new Pair<String, String>("func_71277_t", "getHostname"));
- mInitMap.put(new Pair<String, String>("func_71278_l", "isServerRunning"));
- mInitMap.put(new Pair<String, String>("func_71279_ae", "getGuiEnabled"));
- mInitMap.put(new Pair<String, String>("func_71326_a", "saveProperties"));
- mInitMap.put(new Pair<String, String>("func_71327_a", "getIntProperty"));
- mInitMap.put(new Pair<String, String>("func_71328_a", "setProperty"));
- mInitMap.put(new Pair<String, String>("func_71329_c", "getSettingsFilename"));
- mInitMap.put(new Pair<String, String>("func_71330_a", "getStringProperty"));
- mInitMap.put(new Pair<String, String>("func_71331_a", "addPendingCommand"));
- mInitMap.put(new Pair<String, String>("func_71332_a", "getBooleanProperty"));
- mInitMap.put(new Pair<String, String>("func_71333_ah", "executePendingCommands"));
- mInitMap.put(new Pair<String, String>("func_71344_c", "getPublic"));
- mInitMap.put(new Pair<String, String>("func_71351_a", "setServerData"));
- mInitMap.put(new Pair<String, String>("func_71352_k", "toggleFullscreen"));
- mInitMap.put(new Pair<String, String>("func_71353_a", "loadWorld"));
- mInitMap.put(new Pair<String, String>("func_71354_a", "setDimensionAndSpawnPlayer"));
- mInitMap.put(new Pair<String, String>("func_71355_q", "isDemo"));
- mInitMap.put(new Pair<String, String>("func_71356_B", "isSingleplayer"));
- mInitMap.put(new Pair<String, String>("func_71357_I", "loadScreen"));
- mInitMap.put(new Pair<String, String>("func_71359_d", "getSaveLoader"));
- mInitMap.put(new Pair<String, String>("func_71361_d", "checkGLError"));
- mInitMap.put(new Pair<String, String>("func_71363_D", "stopIntegratedServer"));
- mInitMap.put(new Pair<String, String>("func_71364_i", "setIngameNotInFocus"));
- mInitMap.put(new Pair<String, String>("func_71366_a", "displayDebugInfo"));
- mInitMap.put(new Pair<String, String>("func_71367_a", "setServer"));
- mInitMap.put(new Pair<String, String>("func_71369_N", "getGLMaximumTextureSize"));
- mInitMap.put(new Pair<String, String>("func_71370_a", "resize"));
- mInitMap.put(new Pair<String, String>("func_71371_a", "launchIntegratedServer"));
- mInitMap.put(new Pair<String, String>("func_71372_G", "isFullScreen"));
- mInitMap.put(new Pair<String, String>("func_71374_p", "debugInfoEntities"));
- mInitMap.put(new Pair<String, String>("func_71375_t", "isFancyGraphicsEnabled"));
- mInitMap.put(new Pair<String, String>("func_71377_b", "displayCrashReport"));
- mInitMap.put(new Pair<String, String>("func_71378_E", "getPlayerUsageSnooper"));
- mInitMap.put(new Pair<String, String>("func_71379_u", "isAmbientOcclusionEnabled"));
- mInitMap.put(new Pair<String, String>("func_71381_h", "setIngameFocus"));
- mInitMap.put(new Pair<String, String>("func_71382_s", "isGuiEnabled"));
- mInitMap.put(new Pair<String, String>("func_71383_b", "updateDebugProfilerName"));
- mInitMap.put(new Pair<String, String>("func_71384_a", "startGame"));
- mInitMap.put(new Pair<String, String>("func_71385_j", "displayInGameMenu"));
- mInitMap.put(new Pair<String, String>("func_71386_F", "getSystemTime"));
- mInitMap.put(new Pair<String, String>("func_71387_A", "isIntegratedServerRunning"));
- mInitMap.put(new Pair<String, String>("func_71388_o", "getWorldProviderName"));
- mInitMap.put(new Pair<String, String>("func_71389_H", "startTimerHackThread"));
- mInitMap.put(new Pair<String, String>("func_71392_a", "scaledTessellator"));
- mInitMap.put(new Pair<String, String>("func_71393_m", "debugInfoRenders"));
- mInitMap.put(new Pair<String, String>("func_71396_d", "addGraphicsAndWorldToCrashReport"));
- mInitMap.put(new Pair<String, String>("func_71398_f", "freeMemory"));
- mInitMap.put(new Pair<String, String>("func_71400_g", "shutdown"));
- mInitMap.put(new Pair<String, String>("func_71401_C", "getIntegratedServer"));
- mInitMap.put(new Pair<String, String>("func_71403_a", "loadWorld"));
- mInitMap.put(new Pair<String, String>("func_71404_a", "crashed"));
- mInitMap.put(new Pair<String, String>("func_71405_e", "shutdownMinecraftApplet"));
- mInitMap.put(new Pair<String, String>("func_71407_l", "runTick"));
- mInitMap.put(new Pair<String, String>("func_71408_n", "getEntityDebug"));
- mInitMap.put(new Pair<String, String>("func_71410_x", "getMinecraft"));
- mInitMap.put(new Pair<String, String>("func_71411_J", "runGameLoop"));
- mInitMap.put(new Pair<String, String>("func_71497_f", "getFile"));
- mInitMap.put(new Pair<String, String>("func_71498_d", "getCauseStackTraceOrString"));
- mInitMap.put(new Pair<String, String>("func_71499_a", "addCrashSectionThrowable"));
- mInitMap.put(new Pair<String, String>("func_71500_a", "addCrashSectionCallable"));
- mInitMap.put(new Pair<String, String>("func_71501_a", "getDescription"));
- mInitMap.put(new Pair<String, String>("func_71502_e", "getCompleteReport"));
- mInitMap.put(new Pair<String, String>("func_71503_h", "getWittyComment"));
- mInitMap.put(new Pair<String, String>("func_71504_g", "populateEnvironment"));
- mInitMap.put(new Pair<String, String>("func_71505_b", "getCrashCause"));
- mInitMap.put(new Pair<String, String>("func_71506_a", "getSectionsInStringBuilder"));
- mInitMap.put(new Pair<String, String>("func_71507_a", "addCrashSection"));
- mInitMap.put(new Pair<String, String>("func_71514_a", "getCommandAliases"));
- mInitMap.put(new Pair<String, String>("func_71515_b", "processCommand"));
- mInitMap.put(new Pair<String, String>("func_71516_a", "addTabCompletionOptions"));
- mInitMap.put(new Pair<String, String>("func_71517_b", "getCommandName"));
- mInitMap.put(new Pair<String, String>("func_71518_a", "getCommandUsage"));
- mInitMap.put(new Pair<String, String>("func_71519_b", "canCommandSenderUseCommand"));
- mInitMap.put(new Pair<String, String>("func_71521_c", "getCommandSenderAsPlayer"));
- mInitMap.put(new Pair<String, String>("func_71523_a", "doesStringStartWith"));
- mInitMap.put(new Pair<String, String>("func_71526_a", "parseInt"));
- mInitMap.put(new Pair<String, String>("func_71527_a", "joinNiceString"));
- mInitMap.put(new Pair<String, String>("func_71528_a", "parseIntWithMin"));
- mInitMap.put(new Pair<String, String>("func_71529_a", "setAdminCommander"));
- mInitMap.put(new Pair<String, String>("func_71530_a", "getListOfStringsMatchingLastWord"));
- mInitMap.put(new Pair<String, String>("func_71531_a", "getListOfStringsFromIterableMatchingLastWord"));
- mInitMap.put(new Pair<String, String>("func_71532_a", "parseIntBounded"));
- mInitMap.put(new Pair<String, String>("func_71534_d", "getSortedPossibleCommands"));
- mInitMap.put(new Pair<String, String>("func_71535_c", "getCommands"));
- mInitMap.put(new Pair<String, String>("func_71536_c", "getPlayers"));
- mInitMap.put(new Pair<String, String>("func_71538_c", "getListOfPlayerUsernames"));
- mInitMap.put(new Pair<String, String>("func_71539_b", "getGameModeFromCommand"));
- mInitMap.put(new Pair<String, String>("func_71541_a", "setGameType"));
- mInitMap.put(new Pair<String, String>("func_71542_c", "getAllUsernames"));
- mInitMap.put(new Pair<String, String>("func_71552_a", "setTime"));
- mInitMap.put(new Pair<String, String>("func_71553_b", "addTime"));
- mInitMap.put(new Pair<String, String>("func_71554_c", "toggleDownfall"));
- mInitMap.put(new Pair<String, String>("func_71555_a", "getCommands"));
- mInitMap.put(new Pair<String, String>("func_71556_a", "executeCommand"));
- mInitMap.put(new Pair<String, String>("func_71557_a", "getPossibleCommands"));
- mInitMap.put(new Pair<String, String>("func_71558_b", "getPossibleCommands"));
- mInitMap.put(new Pair<String, String>("func_71559_a", "dropFirstString"));
- mInitMap.put(new Pair<String, String>("func_71560_a", "registerCommand"));
- mInitMap.put(new Pair<String, String>("func_71565_a", "filterAllowedCharacters"));
- mInitMap.put(new Pair<String, String>("func_71566_a", "isAllowedCharacter"));
- mInitMap.put(new Pair<String, String>("func_71569_e", "getDistanceSquared"));
- mInitMap.put(new Pair<String, String>("func_71571_b", "set"));
- mInitMap.put(new Pair<String, String>("func_71575_a", "getCrashReport"));
- mInitMap.put(new Pair<String, String>("func_72314_b", "expand"));
- mInitMap.put(new Pair<String, String>("func_72315_c", "isVecInXZ"));
- mInitMap.put(new Pair<String, String>("func_72316_a", "calculateXOffset"));
- mInitMap.put(new Pair<String, String>("func_72317_d", "offset"));
- mInitMap.put(new Pair<String, String>("func_72318_a", "isVecInside"));
- mInitMap.put(new Pair<String, String>("func_72319_d", "isVecInXY"));
- mInitMap.put(new Pair<String, String>("func_72320_b", "getAverageEdgeLength"));
- mInitMap.put(new Pair<String, String>("func_72321_a", "addCoord"));
- mInitMap.put(new Pair<String, String>("func_72322_c", "calculateZOffset"));
- mInitMap.put(new Pair<String, String>("func_72323_b", "calculateYOffset"));
- mInitMap.put(new Pair<String, String>("func_72324_b", "setBounds"));
- mInitMap.put(new Pair<String, String>("func_72325_c", "getOffsetBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_72326_a", "intersectsWith"));
- mInitMap.put(new Pair<String, String>("func_72327_a", "calculateIntercept"));
- mInitMap.put(new Pair<String, String>("func_72328_c", "setBB"));
- mInitMap.put(new Pair<String, String>("func_72329_c", "copy"));
- mInitMap.put(new Pair<String, String>("func_72330_a", "getBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_72331_e", "contract"));
- mInitMap.put(new Pair<String, String>("func_72333_b", "isVecInYZ"));
- mInitMap.put(new Pair<String, String>("func_72352_l", "getMaxPlayers"));
- mInitMap.put(new Pair<String, String>("func_72354_b", "updateTimeAndWeatherForPlayer"));
- mInitMap.put(new Pair<String, String>("func_72355_a", "initializeConnectionToPlayer"));
- mInitMap.put(new Pair<String, String>("func_72356_a", "transferPlayerToDimension"));
- mInitMap.put(new Pair<String, String>("func_72358_d", "serverUpdateMountedMovingPlayer"));
- mInitMap.put(new Pair<String, String>("func_72362_j", "loadWhiteList"));
- mInitMap.put(new Pair<String, String>("func_72363_f", "getBannedIPs"));
- mInitMap.put(new Pair<String, String>("func_72364_a", "setPlayerManager"));
- mInitMap.put(new Pair<String, String>("func_72365_p", "getServerInstance"));
- mInitMap.put(new Pair<String, String>("func_72367_e", "playerLoggedOut"));
- mInitMap.put(new Pair<String, String>("func_72368_a", "recreatePlayerEntity"));
- mInitMap.put(new Pair<String, String>("func_72369_d", "getAllUsernames"));
- mInitMap.put(new Pair<String, String>("func_72371_a", "setWhiteListEnabled"));
- mInitMap.put(new Pair<String, String>("func_72372_a", "getEntityViewDistance"));
- mInitMap.put(new Pair<String, String>("func_72373_m", "getAvailablePlayerDat"));
- mInitMap.put(new Pair<String, String>("func_72374_b", "onTick"));
- mInitMap.put(new Pair<String, String>("func_72377_c", "playerLoggedIn"));
- mInitMap.put(new Pair<String, String>("func_72378_q", "getHostPlayerData"));
- mInitMap.put(new Pair<String, String>("func_72380_a", "readPlayerDataFromFile"));
- mInitMap.put(new Pair<String, String>("func_72382_j", "getPlayersMatchingAddress"));
- mInitMap.put(new Pair<String, String>("func_72383_n", "isWhiteListEnabled"));
- mInitMap.put(new Pair<String, String>("func_72385_f", "syncPlayerInventory"));
- mInitMap.put(new Pair<String, String>("func_72387_b", "setCommandsAllowedForAll"));
- mInitMap.put(new Pair<String, String>("func_72389_g", "saveAllPlayerData"));
- mInitMap.put(new Pair<String, String>("func_72391_b", "writePlayerData"));
- mInitMap.put(new Pair<String, String>("func_72392_r", "removeAllPlayers"));
- mInitMap.put(new Pair<String, String>("func_72394_k", "getCurrentPlayerCount"));
- mInitMap.put(new Pair<String, String>("func_72395_o", "getViewDistance"));
- mInitMap.put(new Pair<String, String>("func_72417_t", "loadOpsList"));
- mInitMap.put(new Pair<String, String>("func_72418_v", "readWhiteList"));
- mInitMap.put(new Pair<String, String>("func_72419_u", "saveOpsList"));
- mInitMap.put(new Pair<String, String>("func_72421_w", "saveWhiteList"));
- mInitMap.put(new Pair<String, String>("func_72429_b", "getIntermediateWithXValue"));
- mInitMap.put(new Pair<String, String>("func_72430_b", "dotProduct"));
- mInitMap.put(new Pair<String, String>("func_72431_c", "crossProduct"));
- mInitMap.put(new Pair<String, String>("func_72432_b", "normalize"));
- mInitMap.put(new Pair<String, String>("func_72433_c", "lengthVector"));
- mInitMap.put(new Pair<String, String>("func_72434_d", "getIntermediateWithZValue"));
- mInitMap.put(new Pair<String, String>("func_72435_c", "getIntermediateWithYValue"));
- mInitMap.put(new Pair<String, String>("func_72436_e", "squareDistanceTo"));
- mInitMap.put(new Pair<String, String>("func_72438_d", "distanceTo"));
- mInitMap.put(new Pair<String, String>("func_72439_b", "setComponents"));
- mInitMap.put(new Pair<String, String>("func_72440_a", "rotateAroundX"));
- mInitMap.put(new Pair<String, String>("func_72441_c", "addVector"));
- mInitMap.put(new Pair<String, String>("func_72442_b", "rotateAroundY"));
- mInitMap.put(new Pair<String, String>("func_72443_a", "createVectorHelper"));
- mInitMap.put(new Pair<String, String>("func_72444_a", "subtract"));
- mInitMap.put(new Pair<String, String>("func_72445_d", "squareDistanceTo"));
- mInitMap.put(new Pair<String, String>("func_72446_c", "rotateAroundZ"));
- mInitMap.put(new Pair<String, String>("func_72591_c", "getRequestId"));
- mInitMap.put(new Pair<String, String>("func_72592_a", "getRandomChallenge"));
- mInitMap.put(new Pair<String, String>("func_72593_a", "hasExpired"));
- mInitMap.put(new Pair<String, String>("func_72594_b", "getChallengeValue"));
- mInitMap.put(new Pair<String, String>("func_72601_a", "registerSocket"));
- mInitMap.put(new Pair<String, String>("func_72602_a", "startThread"));
- mInitMap.put(new Pair<String, String>("func_72603_d", "getNumberOfPlayers"));
- mInitMap.put(new Pair<String, String>("func_72604_a", "closeSocket"));
- mInitMap.put(new Pair<String, String>("func_72605_a", "closeServerSocket_do"));
- mInitMap.put(new Pair<String, String>("func_72606_c", "logWarning"));
- mInitMap.put(new Pair<String, String>("func_72607_a", "logDebug"));
- mInitMap.put(new Pair<String, String>("func_72608_b", "closeServerSocket"));
- mInitMap.put(new Pair<String, String>("func_72609_b", "logInfo"));
- mInitMap.put(new Pair<String, String>("func_72610_d", "logSevere"));
- mInitMap.put(new Pair<String, String>("func_72611_e", "closeAllSockets"));
- mInitMap.put(new Pair<String, String>("func_72612_a", "closeAllSockets_do"));
- mInitMap.put(new Pair<String, String>("func_72613_c", "isRunning"));
- mInitMap.put(new Pair<String, String>("func_72620_a", "sendResponsePacket"));
- mInitMap.put(new Pair<String, String>("func_72621_a", "parseIncomingPacket"));
- mInitMap.put(new Pair<String, String>("func_72622_d", "sendAuthChallenge"));
- mInitMap.put(new Pair<String, String>("func_72623_a", "stopWithException"));
- mInitMap.put(new Pair<String, String>("func_72624_b", "createQueryResponse"));
- mInitMap.put(new Pair<String, String>("func_72625_a", "getRequestID"));
- mInitMap.put(new Pair<String, String>("func_72626_g", "initQuerySystem"));
- mInitMap.put(new Pair<String, String>("func_72627_c", "verifyClientAuth"));
- mInitMap.put(new Pair<String, String>("func_72628_f", "cleanQueryClientsMap"));
- mInitMap.put(new Pair<String, String>("func_72645_g", "cleanClientThreadsMap"));
- mInitMap.put(new Pair<String, String>("func_72646_f", "initClientThreadList"));
- mInitMap.put(new Pair<String, String>("func_72653_g", "closeSocket"));
- mInitMap.put(new Pair<String, String>("func_72654_a", "sendResponse"));
- mInitMap.put(new Pair<String, String>("func_72655_a", "sendMultipacketResponse"));
- mInitMap.put(new Pair<String, String>("func_72656_f", "sendLoginFailedResponse"));
- mInitMap.put(new Pair<String, String>("func_72661_a", "getBytesAsString"));
- mInitMap.put(new Pair<String, String>("func_72662_b", "getRemainingBytesAsLEInt"));
- mInitMap.put(new Pair<String, String>("func_72663_a", "getByteAsHexString"));
- mInitMap.put(new Pair<String, String>("func_72664_c", "getBytesAsBEint"));
- mInitMap.put(new Pair<String, String>("func_72665_b", "getBytesAsLEInt"));
- mInitMap.put(new Pair<String, String>("func_72667_a", "writeInt"));
- mInitMap.put(new Pair<String, String>("func_72668_a", "writeShort"));
- mInitMap.put(new Pair<String, String>("func_72669_b", "reset"));
- mInitMap.put(new Pair<String, String>("func_72670_a", "writeByteArray"));
- mInitMap.put(new Pair<String, String>("func_72671_a", "writeString"));
- mInitMap.put(new Pair<String, String>("func_72672_a", "toByteArray"));
- mInitMap.put(new Pair<String, String>("func_72683_a", "addPlayer"));
- mInitMap.put(new Pair<String, String>("func_72684_a", "overlaps"));
- mInitMap.put(new Pair<String, String>("func_72685_d", "updateMountedMovingPlayer"));
- mInitMap.put(new Pair<String, String>("func_72686_a", "getFurthestViewableBlock"));
- mInitMap.put(new Pair<String, String>("func_72688_a", "getMinecraftServer"));
- mInitMap.put(new Pair<String, String>("func_72690_a", "getPlayerInstance"));
- mInitMap.put(new Pair<String, String>("func_72691_b", "filterChunkLoadQueue"));
- mInitMap.put(new Pair<String, String>("func_72693_b", "updatePlayerInstances"));
- mInitMap.put(new Pair<String, String>("func_72694_a", "isPlayerWatchingChunk"));
- mInitMap.put(new Pair<String, String>("func_72695_c", "removePlayer"));
- mInitMap.put(new Pair<String, String>("func_72702_a", "playRecord"));
- mInitMap.put(new Pair<String, String>("func_72703_a", "onEntityCreate"));
- mInitMap.put(new Pair<String, String>("func_72704_a", "playSound"));
- mInitMap.put(new Pair<String, String>("func_72706_a", "playAuxSFX"));
- mInitMap.put(new Pair<String, String>("func_72708_a", "spawnParticle"));
- mInitMap.put(new Pair<String, String>("func_72709_b", "onEntityDestroy"));
- mInitMap.put(new Pair<String, String>("func_72712_a", "loadRenderers"));
- mInitMap.put(new Pair<String, String>("func_72714_a", "renderSky"));
- mInitMap.put(new Pair<String, String>("func_72716_a", "updateRenderers"));
- mInitMap.put(new Pair<String, String>("func_72717_a", "drawBlockDamageTexture"));
- mInitMap.put(new Pair<String, String>("func_72718_b", "renderClouds"));
- mInitMap.put(new Pair<String, String>("func_72719_a", "sortAndRender"));
- mInitMap.put(new Pair<String, String>("func_72720_a", "checkOcclusionQueryResult"));
- mInitMap.put(new Pair<String, String>("func_72721_a", "hasCloudFog"));
- mInitMap.put(new Pair<String, String>("func_72722_c", "markRenderersFormInitMap.put(newPosition"));
- mInitMap.put(new Pair<String, String>("func_72723_d", "getDebugInfoEntities"));
- mInitMap.put(new Pair<String, String>("func_72724_a", "renderSortedRenderers"));
- mInitMap.put(new Pair<String, String>("func_72725_b", "markBlocksForUpdate"));
- mInitMap.put(new Pair<String, String>("func_72726_b", "doSpawnParticle"));
- mInitMap.put(new Pair<String, String>("func_72728_f", "deleteAllDisplayLists"));
- mInitMap.put(new Pair<String, String>("func_72729_a", "clipRenderersByFrustum"));
- mInitMap.put(new Pair<String, String>("func_72730_g", "renderStars"));
- mInitMap.put(new Pair<String, String>("func_72731_b", "drawSelectionBox"));
- mInitMap.put(new Pair<String, String>("func_72732_a", "setWorldAndLoadRenderers"));
- mInitMap.put(new Pair<String, String>("func_72733_a", "renderAllRenderLists"));
- mInitMap.put(new Pair<String, String>("func_72734_e", "updateClouds"));
- mInitMap.put(new Pair<String, String>("func_72735_c", "getDebugInfoRenders"));
- mInitMap.put(new Pair<String, String>("func_72736_c", "renderCloudsFancy"));
- mInitMap.put(new Pair<String, String>("func_72785_a", "addEntityToTracker"));
- mInitMap.put(new Pair<String, String>("func_72786_a", "trackEntity"));
- mInitMap.put(new Pair<String, String>("func_72787_a", "removePlayerFromTrackers"));
- mInitMap.put(new Pair<String, String>("func_72788_a", "updateTrackedEntities"));
- mInitMap.put(new Pair<String, String>("func_72790_b", "untrackEntity"));
- mInitMap.put(new Pair<String, String>("func_72791_a", "trackEntity"));
- mInitMap.put(new Pair<String, String>("func_72800_K", "getHeight"));
- mInitMap.put(new Pair<String, String>("func_72801_o", "getLightBrightness"));
- mInitMap.put(new Pair<String, String>("func_72802_i", "getLightBrightnessForSkyBlocks"));
- mInitMap.put(new Pair<String, String>("func_72805_g", "getBlockMetadata"));
- mInitMap.put(new Pair<String, String>("func_72806_N", "extendedLevelsInChunkCache"));
- mInitMap.put(new Pair<String, String>("func_72807_a", "getBiomeGenForCoords"));
- mInitMap.put(new Pair<String, String>("func_72810_a", "getSkyBlockTypeBrightness"));
- mInitMap.put(new Pair<String, String>("func_72812_b", "getSpecialBlockBrightness"));
- mInitMap.put(new Pair<String, String>("func_72819_i", "getWeightedThunderStrength"));
- mInitMap.put(new Pair<String, String>("func_72820_D", "getWorldTime"));
- mInitMap.put(new Pair<String, String>("func_72823_a", "setItemData"));
- mInitMap.put(new Pair<String, String>("func_72824_f", "getCloudColour"));
- mInitMap.put(new Pair<String, String>("func_72825_h", "getTopSolidOrLiquidBlock"));
- mInitMap.put(new Pair<String, String>("func_72826_c", "getCelestialAngle"));
- mInitMap.put(new Pair<String, String>("func_72827_u", "getProviderName"));
- mInitMap.put(new Pair<String, String>("func_72828_b", "unloadEntities"));
- mInitMap.put(new Pair<String, String>("func_72829_c", "checkBlockCollision"));
- mInitMap.put(new Pair<String, String>("func_72830_b", "isAABBInMaterial"));
- mInitMap.put(new Pair<String, String>("func_72833_a", "getSkyColor"));
- mInitMap.put(new Pair<String, String>("func_72834_c", "canBlockFreeze"));
- mInitMap.put(new Pair<String, String>("func_72835_b", "tick"));
- mInitMap.put(new Pair<String, String>("func_72838_d", "spawnEntityInWorld"));
- mInitMap.put(new Pair<String, String>("func_72839_b", "getEntitiesWithinAABBExcludingEntity"));
- mInitMap.put(new Pair<String, String>("func_72841_b", "getUniqueDataId"));
- mInitMap.put(new Pair<String, String>("func_72842_a", "getBlockDensity"));
- mInitMap.put(new Pair<String, String>("func_72843_D", "setRandomSeed"));
- mInitMap.put(new Pair<String, String>("func_72844_a", "getEntityPathToXYZ"));
- mInitMap.put(new Pair<String, String>("func_72846_b", "getClosestVulnerablePlayer"));
- mInitMap.put(new Pair<String, String>("func_72847_b", "onEntityRemoved"));
- mInitMap.put(new Pair<String, String>("func_72848_b", "removeWorldAccess"));
- mInitMap.put(new Pair<String, String>("func_72849_a", "getBlockLightValue_do"));
- mInitMap.put(new Pair<String, String>("func_72850_v", "isBlockFreezableNaturally"));
- mInitMap.put(new Pair<String, String>("func_72853_d", "getMoonPhase"));
- mInitMap.put(new Pair<String, String>("func_72854_c", "updateAllPlayersSleepingFlag"));
- mInitMap.put(new Pair<String, String>("func_72855_b", "checkNoEntityCollision"));
- mInitMap.put(new Pair<String, String>("func_72856_b", "getClosestVulnerablePlayerToEntity"));
- mInitMap.put(new Pair<String, String>("func_72857_a", "findNearestEntityWithinAABB"));
- mInitMap.put(new Pair<String, String>("func_72860_G", "getSaveHandler"));
- mInitMap.put(new Pair<String, String>("func_72861_E", "getSpawnPoint"));
- mInitMap.put(new Pair<String, String>("func_72863_F", "getChunkProvider"));
- mInitMap.put(new Pair<String, String>("func_72864_z", "isBlockIndirectlyGettingPowered"));
- mInitMap.put(new Pair<String, String>("func_72865_a", "getPathEntityToEntity"));
- mInitMap.put(new Pair<String, String>("func_72866_a", "updateEntityWithOptionalForce"));
- mInitMap.put(new Pair<String, String>("func_72867_j", "getRainStrength"));
- mInitMap.put(new Pair<String, String>("func_72868_a", "addLoadedEntities"));
- mInitMap.put(new Pair<String, String>("func_72869_a", "spawnParticle"));
- mInitMap.put(new Pair<String, String>("func_72870_g", "updateEntity"));
- mInitMap.put(new Pair<String, String>("func_72872_a", "getEntitiesWithinAABB"));
- mInitMap.put(new Pair<String, String>("func_72873_a", "doChunksNearChunkExist"));
- mInitMap.put(new Pair<String, String>("func_72874_g", "getPrecipitationHeight"));
- mInitMap.put(new Pair<String, String>("func_72875_a", "isMaterialInBB"));
- mInitMap.put(new Pair<String, String>("func_72876_a", "createExplosion"));
- mInitMap.put(new Pair<String, String>("func_72877_b", "setWorldTime"));
- mInitMap.put(new Pair<String, String>("func_72878_l", "getIndirectPowerLevelTo"));
- mInitMap.put(new Pair<String, String>("func_72879_k", "isBlockProvidingPowerTo"));
- mInitMap.put(new Pair<String, String>("func_72880_h", "getStarBrightness"));
- mInitMap.put(new Pair<String, String>("func_72882_A", "sendQuittingDisconnectingPacket"));
- mInitMap.put(new Pair<String, String>("func_72883_k", "getFullBlockLightValue"));
- mInitMap.put(new Pair<String, String>("func_72884_u", "isBlockFreezable"));
- mInitMap.put(new Pair<String, String>("func_72885_a", "mInitMap.put(newExplosion"));
- mInitMap.put(new Pair<String, String>("func_72886_a", "extinguishFire"));
- mInitMap.put(new Pair<String, String>("func_72889_a", "playAuxSFXAtEntity"));
- mInitMap.put(new Pair<String, String>("func_72890_a", "getClosestPlayerToEntity"));
- mInitMap.put(new Pair<String, String>("func_72891_a", "setAllowedSpawnTypes"));
- mInitMap.put(new Pair<String, String>("func_72894_k", "setRainStrength"));
- mInitMap.put(new Pair<String, String>("func_72896_J", "isRaining"));
- mInitMap.put(new Pair<String, String>("func_72897_h", "joinEntityInSurroundings"));
- mInitMap.put(new Pair<String, String>("func_72899_e", "blockExists"));
- mInitMap.put(new Pair<String, String>("func_72900_e", "removeEntity"));
- mInitMap.put(new Pair<String, String>("func_72901_a", "rayTraceBlocks"));
- mInitMap.put(new Pair<String, String>("func_72903_x", "setActivePlayerChunksAndCheckLight"));
- mInitMap.put(new Pair<String, String>("func_72904_c", "checkChunksExist"));
- mInitMap.put(new Pair<String, String>("func_72905_C", "getSeed"));
- mInitMap.put(new Pair<String, String>("func_72906_B", "checkSessionLock"));
- mInitMap.put(new Pair<String, String>("func_72907_a", "countEntities"));
- mInitMap.put(new Pair<String, String>("func_72908_a", "playSoundEffect"));
- mInitMap.put(new Pair<String, String>("func_72910_y", "getLoadedEntityList"));
- mInitMap.put(new Pair<String, String>("func_72911_I", "isThundering"));
- mInitMap.put(new Pair<String, String>("func_72912_H", "getWorldInfo"));
- mInitMap.put(new Pair<String, String>("func_72914_a", "addWorldInfoToCrashReport"));
- mInitMap.put(new Pair<String, String>("func_72915_b", "setLightValue"));
- mInitMap.put(new Pair<String, String>("func_72916_c", "chunkExists"));
- mInitMap.put(new Pair<String, String>("func_72917_a", "checkNoEntityCollision"));
- mInitMap.put(new Pair<String, String>("func_72918_a", "handleMaterialAcceleration"));
- mInitMap.put(new Pair<String, String>("func_72919_O", "getHorizon"));
- mInitMap.put(new Pair<String, String>("func_72920_a", "getPendingBlockUpdates"));
- mInitMap.put(new Pair<String, String>("func_72921_c", "setBlockMetadataWithNotify"));
- mInitMap.put(new Pair<String, String>("func_72923_a", "onEntityAdded"));
- mInitMap.put(new Pair<String, String>("func_72924_a", "getPlayerEntityByName"));
- mInitMap.put(new Pair<String, String>("func_72925_a", "getSkyBlockTypeBrightness"));
- mInitMap.put(new Pair<String, String>("func_72926_e", "playAuxSFX"));
- mInitMap.put(new Pair<String, String>("func_72929_e", "getCelestialAngleRadians"));
- mInitMap.put(new Pair<String, String>("func_72933_a", "rayTraceBlocks"));
- mInitMap.put(new Pair<String, String>("func_72934_a", "playRecord"));
- mInitMap.put(new Pair<String, String>("func_72935_r", "isDaytime"));
- mInitMap.put(new Pair<String, String>("func_72937_j", "canBlockSeeTheSky"));
- mInitMap.put(new Pair<String, String>("func_72938_d", "getChunkFromBlockCoords"));
- mInitMap.put(new Pair<String, String>("func_72939_s", "updateEntities"));
- mInitMap.put(new Pair<String, String>("func_72940_L", "getActualHeight"));
- mInitMap.put(new Pair<String, String>("func_72942_c", "addWeatherEffect"));
- mInitMap.put(new Pair<String, String>("func_72943_a", "loadItemData"));
- mInitMap.put(new Pair<String, String>("func_72945_a", "getCollidingBoundingBoxes"));
- mInitMap.put(new Pair<String, String>("func_72947_a", "calculateInitialWeather"));
- mInitMap.put(new Pair<String, String>("func_72948_g", "getFogColor"));
- mInitMap.put(new Pair<String, String>("func_72950_A", "setSpawnLocation"));
- mInitMap.put(new Pair<String, String>("func_72951_B", "isRainingAt"));
- mInitMap.put(new Pair<String, String>("func_72953_d", "isAnyLiquid"));
- mInitMap.put(new Pair<String, String>("func_72954_a", "addWorldAccess"));
- mInitMap.put(new Pair<String, String>("func_72955_a", "tickUpdates"));
- mInitMap.put(new Pair<String, String>("func_72956_a", "playSoundAtEntity"));
- mInitMap.put(new Pair<String, String>("func_72957_l", "getBlockLightValue"));
- mInitMap.put(new Pair<String, String>("func_72958_C", "isBlockHighHumidity"));
- mInitMap.put(new Pair<String, String>("func_72959_q", "getWorldChunkManager"));
- mInitMap.put(new Pair<String, String>("func_72960_a", "setEntityState"));
- mInitMap.put(new Pair<String, String>("func_72962_a", "canMineBlock"));
- mInitMap.put(new Pair<String, String>("func_72963_a", "initialize"));
- mInitMap.put(new Pair<String, String>("func_72964_e", "getChunkFromChunkCoords"));
- mInitMap.put(new Pair<String, String>("func_72966_v", "calculateInitialSkylight"));
- mInitMap.put(new Pair<String, String>("func_72967_a", "calculateSkylightSubtracted"));
- mInitMap.put(new Pair<String, String>("func_72970_h", "createChunkProvider"));
- mInitMap.put(new Pair<String, String>("func_72971_b", "getSunBrightness"));
- mInitMap.put(new Pair<String, String>("func_72972_b", "getSavedLightValue"));
- mInitMap.put(new Pair<String, String>("func_72973_f", "removePlayerEntityDangerously"));
- mInitMap.put(new Pair<String, String>("func_72974_f", "setSpawnLocation"));
- mInitMap.put(new Pair<String, String>("func_72975_g", "markBlocksDirtyVertical"));
- mInitMap.put(new Pair<String, String>("func_72976_f", "getHeightValue"));
- mInitMap.put(new Pair<String, String>("func_72977_a", "getClosestPlayer"));
- mInitMap.put(new Pair<String, String>("func_72979_l", "updateWeather"));
- mInitMap.put(new Pair<String, String>("func_72980_b", "playSound"));
- mInitMap.put(new Pair<String, String>("func_72981_t", "getDebugLoadedEntities"));
- mInitMap.put(new Pair<String, String>("func_73022_a", "removeAllEntities"));
- mInitMap.put(new Pair<String, String>("func_73025_a", "doPreChunk"));
- mInitMap.put(new Pair<String, String>("func_73027_a", "addEntityToWorld"));
- mInitMap.put(new Pair<String, String>("func_73028_b", "removeEntityFromWorld"));
- mInitMap.put(new Pair<String, String>("func_73029_E", "doVoidFogParticles"));
- mInitMap.put(new Pair<String, String>("func_73031_a", "invalidateBlockReceiveRegion"));
- mInitMap.put(new Pair<String, String>("func_73039_n", "getEntityTracker"));
- mInitMap.put(new Pair<String, String>("func_73040_p", "getPlayerManager"));
- mInitMap.put(new Pair<String, String>("func_73041_k", "flush"));
- mInitMap.put(new Pair<String, String>("func_73042_a", "saveLevel"));
- mInitMap.put(new Pair<String, String>("func_73044_a", "saveAllChunks"));
- mInitMap.put(new Pair<String, String>("func_73045_a", "getEntityByID"));
- mInitMap.put(new Pair<String, String>("func_73047_i", "createBonusChest"));
- mInitMap.put(new Pair<String, String>("func_73051_P", "resetRainAndThunder"));
- mInitMap.put(new Pair<String, String>("func_73052_b", "createSpawnPosition"));
- mInitMap.put(new Pair<String, String>("func_73053_d", "wakeAllPlayers"));
- mInitMap.put(new Pair<String, String>("func_73054_j", "getEntrancePortalLocation"));
- mInitMap.put(new Pair<String, String>("func_73056_e", "areAllPlayersAsleep"));
- mInitMap.put(new Pair<String, String>("func_73057_a", "spawnRandomCreature"));
- mInitMap.put(new Pair<String, String>("func_73073_c", "cancelDestroyingBlock"));
- mInitMap.put(new Pair<String, String>("func_73074_a", "onBlockClicked"));
- mInitMap.put(new Pair<String, String>("func_73075_a", "updateBlockRemoving"));
- mInitMap.put(new Pair<String, String>("func_73076_a", "setGameType"));
- mInitMap.put(new Pair<String, String>("func_73077_b", "initializeGameType"));
- mInitMap.put(new Pair<String, String>("func_73078_a", "activateBlockOrUseItem"));
- mInitMap.put(new Pair<String, String>("func_73079_d", "removeBlock"));
- mInitMap.put(new Pair<String, String>("func_73080_a", "setWorld"));
- mInitMap.put(new Pair<String, String>("func_73081_b", "getGameType"));
- mInitMap.put(new Pair<String, String>("func_73082_a", "blockRemoving"));
- mInitMap.put(new Pair<String, String>("func_73083_d", "isCreative"));
- mInitMap.put(new Pair<String, String>("func_73084_b", "tryHarvestBlock"));
- mInitMap.put(new Pair<String, String>("func_73085_a", "tryUseItem"));
- mInitMap.put(new Pair<String, String>("func_73101_e", "sendDemoReminder"));
- mInitMap.put(new Pair<String, String>("func_73106_e", "getPartialBlockDamage"));
- mInitMap.put(new Pair<String, String>("func_73107_a", "setPartialBlockDamage"));
- mInitMap.put(new Pair<String, String>("func_73108_d", "getPartialBlockZ"));
- mInitMap.put(new Pair<String, String>("func_73109_c", "getPartialBlockY"));
- mInitMap.put(new Pair<String, String>("func_73110_b", "getPartialBlockX"));
- mInitMap.put(new Pair<String, String>("func_73117_b", "updatePlayerEntity"));
- mInitMap.put(new Pair<String, String>("func_73118_a", "removeFromTrackedPlayers"));
- mInitMap.put(new Pair<String, String>("func_73119_a", "sendDestroyEntityPacketToTrackedPlayers"));
- mInitMap.put(new Pair<String, String>("func_73121_d", "isPlayerWatchingThisChunk"));
- mInitMap.put(new Pair<String, String>("func_73122_a", "updatePlayerList"));
- mInitMap.put(new Pair<String, String>("func_73123_c", "removeTrackedPlayerSymmetric"));
- mInitMap.put(new Pair<String, String>("func_73125_b", "updatePlayerEntities"));
- mInitMap.put(new Pair<String, String>("func_73148_d", "makeString"));
- mInitMap.put(new Pair<String, String>("func_73149_a", "chunkExists"));
- mInitMap.put(new Pair<String, String>("func_73151_a", "saveChunks"));
- mInitMap.put(new Pair<String, String>("func_73152_e", "getLoadedChunkCount"));
- mInitMap.put(new Pair<String, String>("func_73153_a", "populate"));
- mInitMap.put(new Pair<String, String>("func_73154_d", "provideChunk"));
- mInitMap.put(new Pair<String, String>("func_73155_a", "getPossibleCreatures"));
- mInitMap.put(new Pair<String, String>("func_73156_b", "unloadQueuedChunks"));
- mInitMap.put(new Pair<String, String>("func_73157_c", "canSave"));
- mInitMap.put(new Pair<String, String>("func_73158_c", "loadChunk"));
- mInitMap.put(new Pair<String, String>("func_73164_a", "initializeNoiseField"));
- mInitMap.put(new Pair<String, String>("func_73187_a", "initializeNoiseField"));
- mInitMap.put(new Pair<String, String>("func_73234_b", "unloadChunk"));
- mInitMap.put(new Pair<String, String>("func_73239_e", "loadChunkFromFile"));
- mInitMap.put(new Pair<String, String>("func_73240_a", "unloadAllChunks"));
- mInitMap.put(new Pair<String, String>("func_73241_b", "dropChunk"));
- mInitMap.put(new Pair<String, String>("func_73242_b", "saveChunkData"));
- mInitMap.put(new Pair<String, String>("func_73243_a", "saveChunkExtraData"));
- mInitMap.put(new Pair<String, String>("func_73252_b", "removePlayer"));
- mInitMap.put(new Pair<String, String>("func_73254_a", "onUpdate"));
- mInitMap.put(new Pair<String, String>("func_73255_a", "addPlayer"));
- mInitMap.put(new Pair<String, String>("func_73660_a", "update"));
- mInitMap.put(new Pair<String, String>("func_73665_c", "getPropertiesFile"));
- mInitMap.put(new Pair<String, String>("func_73666_a", "generatemInitMap.put(newProperties"));
- mInitMap.put(new Pair<String, String>("func_73667_a", "setProperty"));
- mInitMap.put(new Pair<String, String>("func_73668_b", "saveProperties"));
- mInitMap.put(new Pair<String, String>("func_73669_a", "getIntProperty"));
- mInitMap.put(new Pair<String, String>("func_73670_a", "getBooleanProperty"));
- mInitMap.put(new Pair<String, String>("func_73671_a", "getStringProperty"));
- mInitMap.put(new Pair<String, String>("func_73680_d", "getBanEndDate"));
- mInitMap.put(new Pair<String, String>("func_73682_e", "hasBanExpired"));
- mInitMap.put(new Pair<String, String>("func_73686_f", "getBanReason"));
- mInitMap.put(new Pair<String, String>("func_73718_a", "setLoadingProgress"));
- mInitMap.put(new Pair<String, String>("func_73719_c", "displayLoadingString"));
- mInitMap.put(new Pair<String, String>("func_73720_a", "displaySavingString"));
- mInitMap.put(new Pair<String, String>("func_73721_b", "resetProgressAndMessage"));
- mInitMap.put(new Pair<String, String>("func_73728_b", "drawVerticalLine"));
- mInitMap.put(new Pair<String, String>("func_73729_b", "drawTexturedModalRect"));
- mInitMap.put(new Pair<String, String>("func_73730_a", "drawHorizontalLine"));
- mInitMap.put(new Pair<String, String>("func_73731_b", "drawString"));
- mInitMap.put(new Pair<String, String>("func_73732_a", "drawCenteredString"));
- mInitMap.put(new Pair<String, String>("func_73733_a", "drawGradientRect"));
- mInitMap.put(new Pair<String, String>("func_73734_a", "drawRect"));
- mInitMap.put(new Pair<String, String>("func_73828_d", "renderBossHealth"));
- mInitMap.put(new Pair<String, String>("func_73829_a", "renderVignette"));
- mInitMap.put(new Pair<String, String>("func_73830_a", "renderGameOverlay"));
- mInitMap.put(new Pair<String, String>("func_73831_a", "updateTick"));
- mInitMap.put(new Pair<String, String>("func_73832_a", "renderInventorySlot"));
- mInitMap.put(new Pair<String, String>("func_73833_a", "setRecordPlayingMessage"));
- mInitMap.put(new Pair<String, String>("func_73834_c", "getUpdateCounter"));
- mInitMap.put(new Pair<String, String>("func_73836_a", "renderPumpkinBlur"));
- mInitMap.put(new Pair<String, String>("func_73863_a", "drawScreen"));
- mInitMap.put(new Pair<String, String>("func_73864_a", "mouseClicked"));
- mInitMap.put(new Pair<String, String>("func_73866_w_", "initGui"));
- mInitMap.put(new Pair<String, String>("func_73868_f", "doesGuiPauseGame"));
- mInitMap.put(new Pair<String, String>("func_73869_a", "keyTyped"));
- mInitMap.put(new Pair<String, String>("func_73876_c", "updateScreen"));
- mInitMap.put(new Pair<String, String>("func_73878_a", "confirmClicked"));
- mInitMap.put(new Pair<String, String>("func_73968_a", "rotateAndBlurSkybox"));
- mInitMap.put(new Pair<String, String>("func_73969_a", "addSingleplayerMultiplayerButtons"));
- mInitMap.put(new Pair<String, String>("func_73970_b", "drawPanorama"));
- mInitMap.put(new Pair<String, String>("func_73971_c", "renderSkybox"));
- mInitMap.put(new Pair<String, String>("func_73972_b", "addDemoButtons"));
- mInitMap.put(new Pair<String, String>("func_74275_a", "updateTimer"));
- mInitMap.put(new Pair<String, String>("func_74290_a", "getTimestampedPNGFileForDirectory"));
- mInitMap.put(new Pair<String, String>("func_74296_a", "getOptionFloatValue"));
- mInitMap.put(new Pair<String, String>("func_74297_c", "getKeyBinding"));
- mInitMap.put(new Pair<String, String>("func_74298_c", "getKeyDisplayString"));
- mInitMap.put(new Pair<String, String>("func_74299_a", "getTranslation"));
- mInitMap.put(new Pair<String, String>("func_74300_a", "loadOptions"));
- mInitMap.put(new Pair<String, String>("func_74303_b", "saveOptions"));
- mInitMap.put(new Pair<String, String>("func_74304_a", "setOptionFloatValue"));
- mInitMap.put(new Pair<String, String>("func_74305_a", "parseFloat"));
- mInitMap.put(new Pair<String, String>("func_74306_a", "setOptionValue"));
- mInitMap.put(new Pair<String, String>("func_74308_b", "getOptionOrdinalValue"));
- mInitMap.put(new Pair<String, String>("func_74309_c", "shouldRenderClouds"));
- mInitMap.put(new Pair<String, String>("func_74371_a", "checkARBOcclusion"));
- mInitMap.put(new Pair<String, String>("func_74372_a", "grabMouseCursor"));
- mInitMap.put(new Pair<String, String>("func_74373_b", "ungrabMouseCursor"));
- mInitMap.put(new Pair<String, String>("func_74374_c", "mouseXYChange"));
- mInitMap.put(new Pair<String, String>("func_74378_d", "getEnumString"));
- mInitMap.put(new Pair<String, String>("func_74379_a", "getEnumOptions"));
- mInitMap.put(new Pair<String, String>("func_74380_a", "getEnumFloat"));
- mInitMap.put(new Pair<String, String>("func_74381_c", "returnEnumOrdinal"));
- mInitMap.put(new Pair<String, String>("func_74382_b", "getEnumBoolean"));
- mInitMap.put(new Pair<String, String>("func_74428_b", "processReceivedPackets"));
- mInitMap.put(new Pair<String, String>("func_74430_c", "getRemoteAddress"));
- mInitMap.put(new Pair<String, String>("func_74505_d", "unpressKey"));
- mInitMap.put(new Pair<String, String>("func_74506_a", "unPressAllKeys"));
- mInitMap.put(new Pair<String, String>("func_74507_a", "onTick"));
- mInitMap.put(new Pair<String, String>("func_74508_b", "resetKeyBindingArrayAndHash"));
- mInitMap.put(new Pair<String, String>("func_74510_a", "setKeyBindState"));
- mInitMap.put(new Pair<String, String>("func_74517_a", "setColorBuffer"));
- mInitMap.put(new Pair<String, String>("func_74518_a", "disableStandardItemLighting"));
- mInitMap.put(new Pair<String, String>("func_74519_b", "enableStandardItemLighting"));
- mInitMap.put(new Pair<String, String>("func_74520_c", "enableGUIStandardItemLighting"));
- mInitMap.put(new Pair<String, String>("func_74521_a", "setColorBuffer"));
- mInitMap.put(new Pair<String, String>("func_74523_b", "deleteDisplayLists"));
- mInitMap.put(new Pair<String, String>("func_74524_c", "createDirectByteBuffer"));
- mInitMap.put(new Pair<String, String>("func_74525_a", "deleteTexturesAndDisplayLists"));
- mInitMap.put(new Pair<String, String>("func_74526_a", "generateDisplayLists"));
- mInitMap.put(new Pair<String, String>("func_74527_f", "createDirectIntBuffer"));
- mInitMap.put(new Pair<String, String>("func_74529_h", "createDirectFloatBuffer"));
- mInitMap.put(new Pair<String, String>("func_74535_a", "formatString"));
- mInitMap.put(new Pair<String, String>("func_74539_c", "getChatLineID"));
- mInitMap.put(new Pair<String, String>("func_74540_b", "getUpdatedCounter"));
- mInitMap.put(new Pair<String, String>("func_74583_a", "updateRenderInfo"));
- mInitMap.put(new Pair<String, String>("func_74585_b", "projectViewFromEntity"));
- mInitMap.put(new Pair<String, String>("func_74732_a", "getId"));
- mInitMap.put(new Pair<String, String>("func_74734_a", "write"));
- mInitMap.put(new Pair<String, String>("func_74737_b", "copy"));
- mInitMap.put(new Pair<String, String>("func_74742_a", "appendTag"));
- mInitMap.put(new Pair<String, String>("func_74744_a", "removeTag"));
- mInitMap.put(new Pair<String, String>("func_74745_c", "tagCount"));
- mInitMap.put(new Pair<String, String>("func_74757_a", "setBoolean"));
- mInitMap.put(new Pair<String, String>("func_74759_k", "getIntArray"));
- mInitMap.put(new Pair<String, String>("func_74760_g", "getFloat"));
- mInitMap.put(new Pair<String, String>("func_74762_e", "getInteger"));
- mInitMap.put(new Pair<String, String>("func_74763_f", "getLong"));
- mInitMap.put(new Pair<String, String>("func_74764_b", "hasKey"));
- mInitMap.put(new Pair<String, String>("func_74765_d", "getShort"));
- mInitMap.put(new Pair<String, String>("func_74767_n", "getBoolean"));
- mInitMap.put(new Pair<String, String>("func_74768_a", "setInteger"));
- mInitMap.put(new Pair<String, String>("func_74769_h", "getDouble"));
- mInitMap.put(new Pair<String, String>("func_74770_j", "getByteArray"));
- mInitMap.put(new Pair<String, String>("func_74771_c", "getByte"));
- mInitMap.put(new Pair<String, String>("func_74772_a", "setLong"));
- mInitMap.put(new Pair<String, String>("func_74773_a", "setByteArray"));
- mInitMap.put(new Pair<String, String>("func_74774_a", "setByte"));
- mInitMap.put(new Pair<String, String>("func_74775_l", "getCompoundTag"));
- mInitMap.put(new Pair<String, String>("func_74776_a", "setFloat"));
- mInitMap.put(new Pair<String, String>("func_74777_a", "setShort"));
- mInitMap.put(new Pair<String, String>("func_74778_a", "setString"));
- mInitMap.put(new Pair<String, String>("func_74779_i", "getString"));
- mInitMap.put(new Pair<String, String>("func_74780_a", "setDouble"));
- mInitMap.put(new Pair<String, String>("func_74781_a", "getTag"));
- mInitMap.put(new Pair<String, String>("func_74782_a", "setTag"));
- mInitMap.put(new Pair<String, String>("func_74783_a", "setIntArray"));
- mInitMap.put(new Pair<String, String>("func_74793_a", "safeWrite"));
- mInitMap.put(new Pair<String, String>("func_74794_a", "read"));
- mInitMap.put(new Pair<String, String>("func_74795_b", "write"));
- mInitMap.put(new Pair<String, String>("func_74796_a", "readCompressed"));
- mInitMap.put(new Pair<String, String>("func_74797_a", "read"));
- mInitMap.put(new Pair<String, String>("func_74798_a", "compress"));
- mInitMap.put(new Pair<String, String>("func_74799_a", "writeCompressed"));
- mInitMap.put(new Pair<String, String>("func_74800_a", "write"));
- mInitMap.put(new Pair<String, String>("func_74803_a", "translateKeyFormat"));
- mInitMap.put(new Pair<String, String>("func_74805_b", "translateKey"));
- mInitMap.put(new Pair<String, String>("func_74808_a", "getInstance"));
- mInitMap.put(new Pair<String, String>("func_74837_a", "translateToLocalFormatted"));
- mInitMap.put(new Pair<String, String>("func_74838_a", "translateToLocal"));
- mInitMap.put(new Pair<String, String>("func_74844_a", "getErrorOjbects"));
- mInitMap.put(new Pair<String, String>("func_74860_a", "isLiquidInStructureBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_74861_a", "buildComponent"));
- mInitMap.put(new Pair<String, String>("func_74862_a", "getYWithOffset"));
- mInitMap.put(new Pair<String, String>("func_74865_a", "getXWithOffset"));
- mInitMap.put(new Pair<String, String>("func_74869_a", "generateStructureDispenserContents"));
- mInitMap.put(new Pair<String, String>("func_74871_b", "clearCurrentPositionBlocksUpwards"));
- mInitMap.put(new Pair<String, String>("func_74873_b", "getZWithOffset"));
- mInitMap.put(new Pair<String, String>("func_74874_b", "getBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_74875_a", "addComponentParts"));
- mInitMap.put(new Pair<String, String>("func_74877_c", "getComponentType"));
- mInitMap.put(new Pair<String, String>("func_74878_a", "fillWithAir"));
- mInitMap.put(new Pair<String, String>("func_74879_a", "generateStructureChestContents"));
- mInitMap.put(new Pair<String, String>("func_74881_a", "placeDoorAtCurrentPosition"));
- mInitMap.put(new Pair<String, String>("func_74882_a", "fillWithRandomizedBlocks"));
- mInitMap.put(new Pair<String, String>("func_74883_a", "findIntersecting"));
- mInitMap.put(new Pair<String, String>("func_74888_b", "getVillagerType"));
- mInitMap.put(new Pair<String, String>("func_74889_b", "getAverageGroundLevel"));
- mInitMap.put(new Pair<String, String>("func_74891_a", "getNextComponentNN"));
- mInitMap.put(new Pair<String, String>("func_74893_a", "spawnVillagers"));
- mInitMap.put(new Pair<String, String>("func_74894_b", "getNextComponentPP"));
- mInitMap.put(new Pair<String, String>("func_74895_a", "canVillageGoDeeper"));
- mInitMap.put(new Pair<String, String>("func_74925_d", "getWorldChunkManager"));
- mInitMap.put(new Pair<String, String>("func_74950_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_74951_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_74954_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_74959_a", "getNextComponent"));
- mInitMap.put(new Pair<String, String>("func_74960_a", "getTotalWeight"));
- mInitMap.put(new Pair<String, String>("func_74961_b", "getNextComponentX"));
- mInitMap.put(new Pair<String, String>("func_74962_a", "getNextComponent"));
- mInitMap.put(new Pair<String, String>("func_74963_a", "getNextComponentNormal"));
- mInitMap.put(new Pair<String, String>("func_74964_a", "isAboveGround"));
- mInitMap.put(new Pair<String, String>("func_74965_c", "getNextComponentZ"));
- mInitMap.put(new Pair<String, String>("func_74966_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74973_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74974_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74975_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74977_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74978_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74979_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74980_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74981_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74982_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74983_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74984_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74985_a", "createValidComponent"));
- mInitMap.put(new Pair<String, String>("func_74986_a", "getNextComponentNormal"));
- mInitMap.put(new Pair<String, String>("func_74987_c", "getNextComponentZ"));
- mInitMap.put(new Pair<String, String>("func_74988_a", "getRandomDoor"));
- mInitMap.put(new Pair<String, String>("func_74989_b", "getNextComponentX"));
- mInitMap.put(new Pair<String, String>("func_74990_a", "placeDoor"));
- mInitMap.put(new Pair<String, String>("func_74991_a", "canStrongholdGoDeeper"));
- mInitMap.put(new Pair<String, String>("func_74994_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_75000_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_75004_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_75006_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_75010_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_75012_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_75016_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_75018_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_75022_a", "getStrongholdStairsComponent"));
- mInitMap.put(new Pair<String, String>("func_75028_a", "findValidPlacement"));
- mInitMap.put(new Pair<String, String>("func_75047_a", "canSpawnStructureAtCoords"));
- mInitMap.put(new Pair<String, String>("func_75048_a", "hasStructureAt"));
- mInitMap.put(new Pair<String, String>("func_75049_b", "getStructureStart"));
- mInitMap.put(new Pair<String, String>("func_75051_a", "generateStructuresInChunk"));
- mInitMap.put(new Pair<String, String>("func_75052_o_", "getCoordList"));
- mInitMap.put(new Pair<String, String>("func_75059_a", "getSpawnList"));
- mInitMap.put(new Pair<String, String>("func_75062_a", "selectBlocks"));
- mInitMap.put(new Pair<String, String>("func_75064_b", "getSelectedBlockMetaData"));
- mInitMap.put(new Pair<String, String>("func_75067_a", "markAvailableHeight"));
- mInitMap.put(new Pair<String, String>("func_75068_a", "generateStructure"));
- mInitMap.put(new Pair<String, String>("func_75069_d", "isSizeableStructure"));
- mInitMap.put(new Pair<String, String>("func_75070_a", "setRandomHeight"));
- mInitMap.put(new Pair<String, String>("func_75071_a", "getBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_75072_c", "updateBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_75073_b", "getComponents"));
- mInitMap.put(new Pair<String, String>("func_75077_d", "getNextVillageStructureComponent"));
- mInitMap.put(new Pair<String, String>("func_75080_e", "getNextComponentVillagePath"));
- mInitMap.put(new Pair<String, String>("func_75081_c", "getNextVillageComponent"));
- mInitMap.put(new Pair<String, String>("func_75084_a", "getStructureVillageWeightedPieceList"));
- mInitMap.put(new Pair<String, String>("func_75085_a", "canSpawnMoreVillagePiecesOfType"));
- mInitMap.put(new Pair<String, String>("func_75086_a", "canSpawnMoreVillagePieces"));
- mInitMap.put(new Pair<String, String>("func_75091_a", "writeCapabilitiesToNBT"));
- mInitMap.put(new Pair<String, String>("func_75092_a", "setFlySpeed"));
- mInitMap.put(new Pair<String, String>("func_75093_a", "getFlySpeed"));
- mInitMap.put(new Pair<String, String>("func_75094_b", "getWalkSpeed"));
- mInitMap.put(new Pair<String, String>("func_75095_b", "readCapabilitiesFromNBT"));
- mInitMap.put(new Pair<String, String>("func_75112_a", "readNBT"));
- mInitMap.put(new Pair<String, String>("func_75113_a", "addExhaustion"));
- mInitMap.put(new Pair<String, String>("func_75114_a", "setFoodLevel"));
- mInitMap.put(new Pair<String, String>("func_75115_e", "getSaturationLevel"));
- mInitMap.put(new Pair<String, String>("func_75116_a", "getFoodLevel"));
- mInitMap.put(new Pair<String, String>("func_75117_b", "writeNBT"));
- mInitMap.put(new Pair<String, String>("func_75118_a", "onUpdate"));
- mInitMap.put(new Pair<String, String>("func_75119_b", "setFoodSaturationLevel"));
- mInitMap.put(new Pair<String, String>("func_75120_b", "getPrevFoodLevel"));
- mInitMap.put(new Pair<String, String>("func_75121_c", "needFood"));
- mInitMap.put(new Pair<String, String>("func_75122_a", "addStats"));
- mInitMap.put(new Pair<String, String>("func_75128_a", "setCanCraft"));
- mInitMap.put(new Pair<String, String>("func_75129_b", "getCanCraft"));
- mInitMap.put(new Pair<String, String>("func_75130_a", "onCraftMatrixChanged"));
- mInitMap.put(new Pair<String, String>("func_75131_a", "putStacksInSlots"));
- mInitMap.put(new Pair<String, String>("func_75132_a", "onCraftGuiOpened"));
- mInitMap.put(new Pair<String, String>("func_75133_b", "retrySlotClick"));
- mInitMap.put(new Pair<String, String>("func_75134_a", "onContainerClosed"));
- mInitMap.put(new Pair<String, String>("func_75135_a", "mergeItemStack"));
- mInitMap.put(new Pair<String, String>("func_75136_a", "getNextTransactionID"));
- mInitMap.put(new Pair<String, String>("func_75137_b", "updateProgressBar"));
- mInitMap.put(new Pair<String, String>("func_75138_a", "getInventory"));
- mInitMap.put(new Pair<String, String>("func_75139_a", "getSlot"));
- mInitMap.put(new Pair<String, String>("func_75140_a", "enchantItem"));
- mInitMap.put(new Pair<String, String>("func_75141_a", "putStackInSlot"));
- mInitMap.put(new Pair<String, String>("func_75142_b", "detectAndSendChanges"));
- mInitMap.put(new Pair<String, String>("func_75144_a", "slotClick"));
- mInitMap.put(new Pair<String, String>("func_75145_c", "canInteractWith"));
- mInitMap.put(new Pair<String, String>("func_75146_a", "addSlotToContainer"));
- mInitMap.put(new Pair<String, String>("func_75147_a", "getSlotFromInventory"));
- mInitMap.put(new Pair<String, String>("func_75174_d", "getMerchantInventory"));
- mInitMap.put(new Pair<String, String>("func_75175_c", "setCurrentRecipeIndex"));
- mInitMap.put(new Pair<String, String>("func_75189_a", "canSpawnMoreStructuresOfType"));
- mInitMap.put(new Pair<String, String>("func_75190_a", "canSpawnMoreStructures"));
- mInitMap.put(new Pair<String, String>("func_75196_c", "getNextValidComponent"));
- mInitMap.put(new Pair<String, String>("func_75198_a", "prepareStructurePieces"));
- mInitMap.put(new Pair<String, String>("func_75200_a", "getStrongholdComponentFromWeightedPiece"));
- mInitMap.put(new Pair<String, String>("func_75201_b", "getNextComponent"));
- mInitMap.put(new Pair<String, String>("func_75202_c", "canAddStructurePieces"));
- mInitMap.put(new Pair<String, String>("func_75208_c", "onCrafting"));
- mInitMap.put(new Pair<String, String>("func_75209_a", "decrStackSize"));
- mInitMap.put(new Pair<String, String>("func_75210_a", "onCrafting"));
- mInitMap.put(new Pair<String, String>("func_75211_c", "getStack"));
- mInitMap.put(new Pair<String, String>("func_75212_b", "getBackgroundIconIndex"));
- mInitMap.put(new Pair<String, String>("func_75214_a", "isItemValid"));
- mInitMap.put(new Pair<String, String>("func_75215_d", "putStack"));
- mInitMap.put(new Pair<String, String>("func_75216_d", "getHasStack"));
- mInitMap.put(new Pair<String, String>("func_75217_a", "isHere"));
- mInitMap.put(new Pair<String, String>("func_75218_e", "onSlotChanged"));
- mInitMap.put(new Pair<String, String>("func_75219_a", "getSlotStackLimit"));
- mInitMap.put(new Pair<String, String>("func_75220_a", "onSlotChange"));
- mInitMap.put(new Pair<String, String>("func_75230_a", "doTrade"));
- mInitMap.put(new Pair<String, String>("func_75243_a_", "canHoldPotion"));
- mInitMap.put(new Pair<String, String>("func_75246_d", "updateTask"));
- mInitMap.put(new Pair<String, String>("func_75247_h", "getMutexBits"));
- mInitMap.put(new Pair<String, String>("func_75248_a", "setMutexBits"));
- mInitMap.put(new Pair<String, String>("func_75249_e", "startExecuting"));
- mInitMap.put(new Pair<String, String>("func_75250_a", "shouldExecute"));
- mInitMap.put(new Pair<String, String>("func_75251_c", "resetTask"));
- mInitMap.put(new Pair<String, String>("func_75252_g", "isInterruptible"));
- mInitMap.put(new Pair<String, String>("func_75253_b", "continueExecuting"));
- mInitMap.put(new Pair<String, String>("func_75270_a", "setSitting"));
- mInitMap.put(new Pair<String, String>("func_75277_f", "isRunning"));
- mInitMap.put(new Pair<String, String>("func_75295_a", "canEasilyReach"));
- mInitMap.put(new Pair<String, String>("func_75296_a", "isSuitableTarget"));
- mInitMap.put(new Pair<String, String>("func_75366_f", "findPossibleShelter"));
- mInitMap.put(new Pair<String, String>("func_75382_a", "hasPlayerGotBoneInHand"));
- mInitMap.put(new Pair<String, String>("func_75388_i", "spawnBaby"));
- mInitMap.put(new Pair<String, String>("func_75389_f", "getNearbyMate"));
- mInitMap.put(new Pair<String, String>("func_75446_f", "checkSufficientDoorsPresentFormInitMap.put(newVillager"));
- mInitMap.put(new Pair<String, String>("func_75447_i", "giveBirth"));
- mInitMap.put(new Pair<String, String>("func_75461_b", "findRandomTargetBlockAwayFrom"));
- mInitMap.put(new Pair<String, String>("func_75462_c", "findRandomTargetBlock"));
- mInitMap.put(new Pair<String, String>("func_75463_a", "findRandomTarget"));
- mInitMap.put(new Pair<String, String>("func_75464_a", "findRandomTargetBlockTowards"));
- mInitMap.put(new Pair<String, String>("func_75466_d", "resetDoorOpeningRestrictionCounter"));
- mInitMap.put(new Pair<String, String>("func_75467_a", "isInside"));
- mInitMap.put(new Pair<String, String>("func_75468_f", "getDoorOpeningRestrictionCounter"));
- mInitMap.put(new Pair<String, String>("func_75469_c", "getInsideDistanceSquare"));
- mInitMap.put(new Pair<String, String>("func_75470_e", "incrementDoorOpeningRestrictionCounter"));
- mInitMap.put(new Pair<String, String>("func_75471_a", "getInsidePosX"));
- mInitMap.put(new Pair<String, String>("func_75472_c", "getInsidePosZ"));
- mInitMap.put(new Pair<String, String>("func_75473_b", "getInsidePosY"));
- mInitMap.put(new Pair<String, String>("func_75474_b", "getDistanceSquared"));
- mInitMap.put(new Pair<String, String>("func_75483_a", "isSafeToStandAt"));
- mInitMap.put(new Pair<String, String>("func_75484_a", "setPath"));
- mInitMap.put(new Pair<String, String>("func_75485_k", "canNavigate"));
- mInitMap.put(new Pair<String, String>("func_75486_a", "getAvoidsWater"));
- mInitMap.put(new Pair<String, String>("func_75487_m", "removeSunnyPath"));
- mInitMap.put(new Pair<String, String>("func_75488_a", "getPathToXYZ"));
- mInitMap.put(new Pair<String, String>("func_75489_a", "setSpeed"));
- mInitMap.put(new Pair<String, String>("func_75490_c", "setEnterDoors"));
- mInitMap.put(new Pair<String, String>("func_75491_a", "setAvoidsWater"));
- mInitMap.put(new Pair<String, String>("func_75492_a", "tryMoveToXYZ"));
- mInitMap.put(new Pair<String, String>("func_75493_a", "isDirectPathBetweenPoints"));
- mInitMap.put(new Pair<String, String>("func_75494_a", "getPathToEntityLiving"));
- mInitMap.put(new Pair<String, String>("func_75495_e", "setCanSwim"));
- mInitMap.put(new Pair<String, String>("func_75496_b", "isPositionClear"));
- mInitMap.put(new Pair<String, String>("func_75497_a", "tryMoveToEntityLiving"));
- mInitMap.put(new Pair<String, String>("func_75498_b", "setBreakDoors"));
- mInitMap.put(new Pair<String, String>("func_75499_g", "clearPathEntity"));
- mInitMap.put(new Pair<String, String>("func_75500_f", "noPath"));
- mInitMap.put(new Pair<String, String>("func_75501_e", "onUpdateNavigation"));
- mInitMap.put(new Pair<String, String>("func_75502_i", "getEntityPosition"));
- mInitMap.put(new Pair<String, String>("func_75503_j", "getPathableYPos"));
- mInitMap.put(new Pair<String, String>("func_75504_d", "setAvoidSun"));
- mInitMap.put(new Pair<String, String>("func_75505_d", "getPath"));
- mInitMap.put(new Pair<String, String>("func_75506_l", "isInLiquid"));
- mInitMap.put(new Pair<String, String>("func_75507_c", "getCanBreakDoors"));
- mInitMap.put(new Pair<String, String>("func_75508_h", "pathFollow"));
- mInitMap.put(new Pair<String, String>("func_75522_a", "canSee"));
- mInitMap.put(new Pair<String, String>("func_75523_a", "clearSensingCache"));
- mInitMap.put(new Pair<String, String>("func_75528_a", "tick"));
- mInitMap.put(new Pair<String, String>("func_75530_c", "spawnZombie"));
- mInitMap.put(new Pair<String, String>("func_75540_b", "getVillageList"));
- mInitMap.put(new Pair<String, String>("func_75541_e", "isWoodenDoorAt"));
- mInitMap.put(new Pair<String, String>("func_75542_c", "addDoorTomInitMap.put(newListIfAppropriate"));
- mInitMap.put(new Pair<String, String>("func_75543_d", "dropOldestVillagerPosition"));
- mInitMap.put(new Pair<String, String>("func_75544_a", "tick"));
- mInitMap.put(new Pair<String, String>("func_75545_e", "addmInitMap.put(newDoorsToVillageOrCreateVillage"));
- mInitMap.put(new Pair<String, String>("func_75546_a", "addUnassignedWoodenDoorsAroundTomInitMap.put(newDoorsList"));
- mInitMap.put(new Pair<String, String>("func_75547_b", "getVillageDoorAt"));
- mInitMap.put(new Pair<String, String>("func_75548_d", "isVillagerPositionPresent"));
- mInitMap.put(new Pair<String, String>("func_75549_c", "removeAnnihilatedVillages"));
- mInitMap.put(new Pair<String, String>("func_75550_a", "findNearestVillage"));
- mInitMap.put(new Pair<String, String>("func_75551_a", "addVillagerPosition"));
- mInitMap.put(new Pair<String, String>("func_75557_k", "removeDeadAndOutOfRangeDoors"));
- mInitMap.put(new Pair<String, String>("func_75558_f", "getVillageDoorInfoList"));
- mInitMap.put(new Pair<String, String>("func_75559_a", "tryGetIronGolemSpawningLocation"));
- mInitMap.put(new Pair<String, String>("func_75560_a", "tick"));
- mInitMap.put(new Pair<String, String>("func_75561_d", "getTicksSinceLastDoorAdding"));
- mInitMap.put(new Pair<String, String>("func_75562_e", "getNumVillagers"));
- mInitMap.put(new Pair<String, String>("func_75563_b", "isValidIronGolemSpawningLocation"));
- mInitMap.put(new Pair<String, String>("func_75564_b", "findNearestDoor"));
- mInitMap.put(new Pair<String, String>("func_75565_j", "removeDeadAndOldAgressors"));
- mInitMap.put(new Pair<String, String>("func_75566_g", "isAnnihilated"));
- mInitMap.put(new Pair<String, String>("func_75567_c", "getNumVillageDoors"));
- mInitMap.put(new Pair<String, String>("func_75568_b", "getVillageRadius"));
- mInitMap.put(new Pair<String, String>("func_75569_c", "findNearestDoorUnrestricted"));
- mInitMap.put(new Pair<String, String>("func_75570_a", "isInRange"));
- mInitMap.put(new Pair<String, String>("func_75571_b", "findNearestVillageAggressor"));
- mInitMap.put(new Pair<String, String>("func_75572_i", "updateNumVillagers"));
- mInitMap.put(new Pair<String, String>("func_75573_l", "updateVillageRadiusAndCenter"));
- mInitMap.put(new Pair<String, String>("func_75574_f", "isBlockDoor"));
- mInitMap.put(new Pair<String, String>("func_75575_a", "addOrRemInitMap.put(newAgressor"));
- mInitMap.put(new Pair<String, String>("func_75576_a", "addVillageDoorInfo"));
- mInitMap.put(new Pair<String, String>("func_75577_a", "getCenter"));
- mInitMap.put(new Pair<String, String>("func_75578_e", "getVillageDoorAt"));
- mInitMap.put(new Pair<String, String>("func_75579_h", "updateNumIronGolems"));
- mInitMap.put(new Pair<String, String>("func_75598_a", "getCreatureClass"));
- mInitMap.put(new Pair<String, String>("func_75599_d", "getPeacefulCreature"));
- mInitMap.put(new Pair<String, String>("func_75600_c", "getCreatureMaterial"));
- mInitMap.put(new Pair<String, String>("func_75601_b", "getMaxNumberOfCreature"));
- mInitMap.put(new Pair<String, String>("func_75614_a", "addMapping"));
- mInitMap.put(new Pair<String, String>("func_75615_a", "createEntityFromNBT"));
- mInitMap.put(new Pair<String, String>("func_75616_a", "createEntityByID"));
- mInitMap.put(new Pair<String, String>("func_75617_a", "getStringFromID"));
- mInitMap.put(new Pair<String, String>("func_75618_a", "addMapping"));
- mInitMap.put(new Pair<String, String>("func_75619_a", "getEntityID"));
- mInitMap.put(new Pair<String, String>("func_75620_a", "createEntityByName"));
- mInitMap.put(new Pair<String, String>("func_75621_b", "getEntityString"));
- mInitMap.put(new Pair<String, String>("func_75630_a", "multiplyBy32AndRound"));
- mInitMap.put(new Pair<String, String>("func_75638_b", "getSpeed"));
- mInitMap.put(new Pair<String, String>("func_75639_a", "limitAngle"));
- mInitMap.put(new Pair<String, String>("func_75640_a", "isUpdating"));
- mInitMap.put(new Pair<String, String>("func_75641_c", "onUpdateMoveHelper"));
- mInitMap.put(new Pair<String, String>("func_75642_a", "setMoveTo"));
- mInitMap.put(new Pair<String, String>("func_75649_a", "onUpdateLook"));
- mInitMap.put(new Pair<String, String>("func_75650_a", "setLookPosition"));
- mInitMap.put(new Pair<String, String>("func_75651_a", "setLookPositionWithEntity"));
- mInitMap.put(new Pair<String, String>("func_75652_a", "updateRotation"));
- mInitMap.put(new Pair<String, String>("func_75660_a", "setJumping"));
- mInitMap.put(new Pair<String, String>("func_75661_b", "doJump"));
- mInitMap.put(new Pair<String, String>("func_75664_a", "updateRenderAngles"));
- mInitMap.put(new Pair<String, String>("func_75665_a", "computeAngleWithBound"));
- mInitMap.put(new Pair<String, String>("func_75669_b", "getObject"));
- mInitMap.put(new Pair<String, String>("func_75670_d", "isWatched"));
- mInitMap.put(new Pair<String, String>("func_75671_a", "setWatched"));
- mInitMap.put(new Pair<String, String>("func_75672_a", "getDataValueId"));
- mInitMap.put(new Pair<String, String>("func_75673_a", "setObject"));
- mInitMap.put(new Pair<String, String>("func_75674_c", "getObjectType"));
- mInitMap.put(new Pair<String, String>("func_75679_c", "getWatchableObjectInt"));
- mInitMap.put(new Pair<String, String>("func_75681_e", "getWatchableObjectString"));
- mInitMap.put(new Pair<String, String>("func_75682_a", "addObject"));
- mInitMap.put(new Pair<String, String>("func_75683_a", "getWatchableObjectByte"));
- mInitMap.put(new Pair<String, String>("func_75684_a", "hasObjectChanged"));
- mInitMap.put(new Pair<String, String>("func_75685_c", "getAllWatched"));
- mInitMap.put(new Pair<String, String>("func_75687_a", "updateWatchedObjectsFromList"));
- mInitMap.put(new Pair<String, String>("func_75688_b", "getChanged"));
- mInitMap.put(new Pair<String, String>("func_75691_i", "getWatchedObject"));
- mInitMap.put(new Pair<String, String>("func_75692_b", "updateObject"));
- mInitMap.put(new Pair<String, String>("func_75693_b", "getWatchableObjectShort"));
- mInitMap.put(new Pair<String, String>("func_75734_a", "waitForFinish"));
- mInitMap.put(new Pair<String, String>("func_75735_a", "queueIO"));
- mInitMap.put(new Pair<String, String>("func_75736_b", "processQueue"));
- mInitMap.put(new Pair<String, String>("func_75742_a", "loadData"));
- mInitMap.put(new Pair<String, String>("func_75743_a", "getUniqueDataId"));
- mInitMap.put(new Pair<String, String>("func_75744_a", "saveAllData"));
- mInitMap.put(new Pair<String, String>("func_75745_a", "setData"));
- mInitMap.put(new Pair<String, String>("func_75746_b", "loadIdCounts"));
- mInitMap.put(new Pair<String, String>("func_75747_a", "saveData"));
- mInitMap.put(new Pair<String, String>("func_75752_b", "readPlayerData"));
- mInitMap.put(new Pair<String, String>("func_75753_a", "writePlayerData"));
- mInitMap.put(new Pair<String, String>("func_75754_f", "getAvailablePlayerDat"));
- mInitMap.put(new Pair<String, String>("func_75755_a", "saveWorldInfoWithPlayer"));
- mInitMap.put(new Pair<String, String>("func_75756_e", "getPlayerNBTManager"));
- mInitMap.put(new Pair<String, String>("func_75757_d", "loadWorldInfo"));
- mInitMap.put(new Pair<String, String>("func_75758_b", "getMapFileFromName"));
- mInitMap.put(new Pair<String, String>("func_75759_a", "flush"));
- mInitMap.put(new Pair<String, String>("func_75760_g", "getWorldDirectoryName"));
- mInitMap.put(new Pair<String, String>("func_75761_a", "saveWorldInfo"));
- mInitMap.put(new Pair<String, String>("func_75762_c", "checkSessionLock"));
- mInitMap.put(new Pair<String, String>("func_75763_a", "getChunkLoader"));
- mInitMap.put(new Pair<String, String>("func_75765_b", "getWorldDirectory"));
- mInitMap.put(new Pair<String, String>("func_75766_h", "setSessionLock"));
- mInitMap.put(new Pair<String, String>("func_75773_a", "canContinue"));
- mInitMap.put(new Pair<String, String>("func_75774_a", "onUpdateTasks"));
- mInitMap.put(new Pair<String, String>("func_75775_b", "canUse"));
- mInitMap.put(new Pair<String, String>("func_75776_a", "addTask"));
- mInitMap.put(new Pair<String, String>("func_75777_a", "areTasksCompatible"));
- mInitMap.put(new Pair<String, String>("func_75783_h", "getCheatsEnabled"));
- mInitMap.put(new Pair<String, String>("func_75784_e", "getLastTimePlayed"));
- mInitMap.put(new Pair<String, String>("func_75785_d", "requiresConversion"));
- mInitMap.put(new Pair<String, String>("func_75786_a", "getFileName"));
- mInitMap.put(new Pair<String, String>("func_75788_b", "getDisplayName"));
- mInitMap.put(new Pair<String, String>("func_75789_g", "isHardcoreModeEnabled"));
- mInitMap.put(new Pair<String, String>("func_75790_f", "getEnumGameType"));
- mInitMap.put(new Pair<String, String>("func_75799_b", "getSaveList"));
- mInitMap.put(new Pair<String, String>("func_75800_d", "flushCache"));
- mInitMap.put(new Pair<String, String>("func_75801_b", "isOldMapFormat"));
- mInitMap.put(new Pair<String, String>("func_75802_e", "deleteWorldDirectory"));
- mInitMap.put(new Pair<String, String>("func_75803_c", "getWorldInfo"));
- mInitMap.put(new Pair<String, String>("func_75804_a", "getSaveLoader"));
- mInitMap.put(new Pair<String, String>("func_75805_a", "convertMapFormat"));
- mInitMap.put(new Pair<String, String>("func_75806_a", "renameWorld"));
- mInitMap.put(new Pair<String, String>("func_75807_a", "deleteFiles"));
- mInitMap.put(new Pair<String, String>("func_75809_f", "createFile"));
- mInitMap.put(new Pair<String, String>("func_75810_a", "addRegionFilesToCollection"));
- mInitMap.put(new Pair<String, String>("func_75811_a", "convertChunks"));
- mInitMap.put(new Pair<String, String>("func_75812_c", "getSaveVersion"));
- mInitMap.put(new Pair<String, String>("func_75813_a", "convertFile"));
- mInitMap.put(new Pair<String, String>("func_75814_c", "writeNextIO"));
- mInitMap.put(new Pair<String, String>("func_75815_a", "loadChunk"));
- mInitMap.put(new Pair<String, String>("func_75816_a", "saveChunk"));
- mInitMap.put(new Pair<String, String>("func_75817_a", "chunkTick"));
- mInitMap.put(new Pair<String, String>("func_75818_b", "saveExtraData"));
- mInitMap.put(new Pair<String, String>("func_75819_b", "saveExtraChunkData"));
- mInitMap.put(new Pair<String, String>("func_75820_a", "writeChunkToNBT"));
- mInitMap.put(new Pair<String, String>("func_75821_a", "writeChunkNBTTags"));
- mInitMap.put(new Pair<String, String>("func_75822_a", "checkedReadChunkFromNBT"));
- mInitMap.put(new Pair<String, String>("func_75823_a", "readChunkFromNBT"));
- mInitMap.put(new Pair<String, String>("func_75824_a", "addChunkToPending"));
- mInitMap.put(new Pair<String, String>("func_75829_a", "distanceTo"));
- mInitMap.put(new Pair<String, String>("func_75830_a", "makeHash"));
- mInitMap.put(new Pair<String, String>("func_75831_a", "isAssigned"));
- mInitMap.put(new Pair<String, String>("func_75832_b", "distanceToSquared"));
- mInitMap.put(new Pair<String, String>("func_75843_a", "format"));
- mInitMap.put(new Pair<String, String>("func_75844_c", "dequeue"));
- mInitMap.put(new Pair<String, String>("func_75845_e", "isPathEmpty"));
- mInitMap.put(new Pair<String, String>("func_75846_b", "sortForward"));
- mInitMap.put(new Pair<String, String>("func_75847_a", "sortBack"));
- mInitMap.put(new Pair<String, String>("func_75848_a", "clearPath"));
- mInitMap.put(new Pair<String, String>("func_75849_a", "addPoint"));
- mInitMap.put(new Pair<String, String>("func_75850_a", "changeDistance"));
- mInitMap.put(new Pair<String, String>("func_75853_a", "createEntityPath"));
- mInitMap.put(new Pair<String, String>("func_75854_a", "openPoint"));
- mInitMap.put(new Pair<String, String>("func_75855_a", "canEntityStandAt"));
- mInitMap.put(new Pair<String, String>("func_75856_a", "createEntityPathTo"));
- mInitMap.put(new Pair<String, String>("func_75857_a", "createEntityPathTo"));
- mInitMap.put(new Pair<String, String>("func_75858_a", "getSafePoint"));
- mInitMap.put(new Pair<String, String>("func_75859_a", "createEntityPathTo"));
- mInitMap.put(new Pair<String, String>("func_75860_b", "findPathOptions"));
- mInitMap.put(new Pair<String, String>("func_75861_a", "addToPath"));
- mInitMap.put(new Pair<String, String>("func_75870_c", "getFinalPathPoint"));
- mInitMap.put(new Pair<String, String>("func_75871_b", "setCurrentPathLength"));
- mInitMap.put(new Pair<String, String>("func_75872_c", "setCurrentPathIndex"));
- mInitMap.put(new Pair<String, String>("func_75873_e", "getCurrentPathIndex"));
- mInitMap.put(new Pair<String, String>("func_75874_d", "getCurrentPathLength"));
- mInitMap.put(new Pair<String, String>("func_75875_a", "incrementPathIndex"));
- mInitMap.put(new Pair<String, String>("func_75876_a", "isSamePath"));
- mInitMap.put(new Pair<String, String>("func_75877_a", "getPathPointFromIndex"));
- mInitMap.put(new Pair<String, String>("func_75878_a", "getPosition"));
- mInitMap.put(new Pair<String, String>("func_75879_b", "isFinished"));
- mInitMap.put(new Pair<String, String>("func_75880_b", "isDestinationSame"));
- mInitMap.put(new Pair<String, String>("func_75881_a", "getVectorFromIndex"));
- mInitMap.put(new Pair<String, String>("func_75885_a", "cipherOperation"));
- mInitMap.put(new Pair<String, String>("func_75886_a", "createTheCipherInstance"));
- mInitMap.put(new Pair<String, String>("func_75887_a", "decryptSharedKey"));
- mInitMap.put(new Pair<String, String>("func_75889_b", "decryptData"));
- mInitMap.put(new Pair<String, String>("func_75890_a", "createmInitMap.put(newSharedKey"));
- mInitMap.put(new Pair<String, String>("func_75891_b", "generateKeyPair"));
- mInitMap.put(new Pair<String, String>("func_75893_a", "digestOperation"));
- mInitMap.put(new Pair<String, String>("func_75894_a", "encryptData"));
- mInitMap.put(new Pair<String, String>("func_75895_a", "getServerIdHash"));
- mInitMap.put(new Pair<String, String>("func_75896_a", "decodePublicKey"));
- mInitMap.put(new Pair<String, String>("func_75901_a", "initializeAllBiomeGenerators"));
- mInitMap.put(new Pair<String, String>("func_75902_a", "nextInt"));
- mInitMap.put(new Pair<String, String>("func_75903_a", "initChunkSeed"));
- mInitMap.put(new Pair<String, String>("func_75904_a", "getInts"));
- mInitMap.put(new Pair<String, String>("func_75905_a", "initWorldGenSeed"));
- mInitMap.put(new Pair<String, String>("func_75915_a", "magnify"));
- mInitMap.put(new Pair<String, String>("func_75918_d", "initCraftableStats"));
- mInitMap.put(new Pair<String, String>("func_75924_a", "replaceAllSimilarBlocks"));
- mInitMap.put(new Pair<String, String>("func_75925_c", "initStats"));
- mInitMap.put(new Pair<String, String>("func_75966_h", "initIndependentStat"));
- mInitMap.put(new Pair<String, String>("func_75967_d", "isAchievement"));
- mInitMap.put(new Pair<String, String>("func_75971_g", "registerStat"));
- mInitMap.put(new Pair<String, String>("func_75984_f", "getSpecial"));
- mInitMap.put(new Pair<String, String>("func_75987_b", "setSpecial"));
- mInitMap.put(new Pair<String, String>("func_75988_a", "setStatStringFormatter"));
- mInitMap.put(new Pair<String, String>("func_75989_e", "getDescription"));
- mInitMap.put(new Pair<String, String>("func_75997_a", "init"));
- mInitMap.put(new Pair<String, String>("func_76030_b", "getValue"));
- mInitMap.put(new Pair<String, String>("func_76031_a", "getHash"));
- mInitMap.put(new Pair<String, String>("func_76036_e", "removeEntry"));
- mInitMap.put(new Pair<String, String>("func_76037_b", "containsItem"));
- mInitMap.put(new Pair<String, String>("func_76038_a", "addKey"));
- mInitMap.put(new Pair<String, String>("func_76040_a", "insert"));
- mInitMap.put(new Pair<String, String>("func_76041_a", "lookup"));
- mInitMap.put(new Pair<String, String>("func_76043_a", "getSlotIndex"));
- mInitMap.put(new Pair<String, String>("func_76044_g", "computeHash"));
- mInitMap.put(new Pair<String, String>("func_76045_c", "lookupEntry"));
- mInitMap.put(new Pair<String, String>("func_76046_c", "clearMap"));
- mInitMap.put(new Pair<String, String>("func_76047_h", "grow"));
- mInitMap.put(new Pair<String, String>("func_76048_a", "copyTo"));
- mInitMap.put(new Pair<String, String>("func_76049_d", "removeObject"));
- mInitMap.put(new Pair<String, String>("func_76056_b", "setSpawnY"));
- mInitMap.put(new Pair<String, String>("func_76057_l", "getLastTimePlayed"));
- mInitMap.put(new Pair<String, String>("func_76058_a", "setSpawnX"));
- mInitMap.put(new Pair<String, String>("func_76059_o", "isRaining"));
- mInitMap.put(new Pair<String, String>("func_76060_a", "setGameType"));
- mInitMap.put(new Pair<String, String>("func_76061_m", "isThundering"));
- mInitMap.put(new Pair<String, String>("func_76062_a", "setWorldName"));
- mInitMap.put(new Pair<String, String>("func_76063_b", "getSeed"));
- mInitMap.put(new Pair<String, String>("func_76064_a", "updateTagCompound"));
- mInitMap.put(new Pair<String, String>("func_76065_j", "getWorldName"));
- mInitMap.put(new Pair<String, String>("func_76066_a", "getNBTTagCompound"));
- mInitMap.put(new Pair<String, String>("func_76067_t", "getTerrainType"));
- mInitMap.put(new Pair<String, String>("func_76068_b", "setWorldTime"));
- mInitMap.put(new Pair<String, String>("func_76069_a", "setThundering"));
- mInitMap.put(new Pair<String, String>("func_76070_v", "isInitialized"));
- mInitMap.put(new Pair<String, String>("func_76071_n", "getThunderTime"));
- mInitMap.put(new Pair<String, String>("func_76072_h", "getPlayerNBTTagCompound"));
- mInitMap.put(new Pair<String, String>("func_76073_f", "getWorldTime"));
- mInitMap.put(new Pair<String, String>("func_76074_e", "getSpawnZ"));
- mInitMap.put(new Pair<String, String>("func_76075_d", "getSpawnY"));
- mInitMap.put(new Pair<String, String>("func_76076_i", "getDimension"));
- mInitMap.put(new Pair<String, String>("func_76077_q", "getGameType"));
- mInitMap.put(new Pair<String, String>("func_76078_e", "setSaveVersion"));
- mInitMap.put(new Pair<String, String>("func_76079_c", "getSpawnX"));
- mInitMap.put(new Pair<String, String>("func_76080_g", "setRainTime"));
- mInitMap.put(new Pair<String, String>("func_76081_a", "setSpawnPosition"));
- mInitMap.put(new Pair<String, String>("func_76082_a", "cloneNBTCompound"));
- mInitMap.put(new Pair<String, String>("func_76083_p", "getRainTime"));
- mInitMap.put(new Pair<String, String>("func_76084_b", "setRaining"));
- mInitMap.put(new Pair<String, String>("func_76085_a", "setTerrainType"));
- mInitMap.put(new Pair<String, String>("func_76086_u", "areCommandsAllowed"));
- mInitMap.put(new Pair<String, String>("func_76087_c", "setSpawnZ"));
- mInitMap.put(new Pair<String, String>("func_76088_k", "getSaveVersion"));
- mInitMap.put(new Pair<String, String>("func_76089_r", "isMapFeaturesEnabled"));
- mInitMap.put(new Pair<String, String>("func_76090_f", "setThunderTime"));
- mInitMap.put(new Pair<String, String>("func_76091_d", "setServerInitialized"));
- mInitMap.put(new Pair<String, String>("func_76092_g", "getSizeOnDisk"));
- mInitMap.put(new Pair<String, String>("func_76093_s", "isHardcoreModeEnabled"));
- mInitMap.put(new Pair<String, String>("func_76123_f", "ceiling_float_int"));
- mInitMap.put(new Pair<String, String>("func_76124_d", "floor_double_long"));
- mInitMap.put(new Pair<String, String>("func_76125_a", "clamp_int"));
- mInitMap.put(new Pair<String, String>("func_76126_a", "sin"));
- mInitMap.put(new Pair<String, String>("func_76127_a", "average"));
- mInitMap.put(new Pair<String, String>("func_76128_c", "floor_double"));
- mInitMap.put(new Pair<String, String>("func_76129_c", "sqrt_float"));
- mInitMap.put(new Pair<String, String>("func_76130_a", "abs_int"));
- mInitMap.put(new Pair<String, String>("func_76131_a", "clamp_float"));
- mInitMap.put(new Pair<String, String>("func_76132_a", "abs_max"));
- mInitMap.put(new Pair<String, String>("func_76133_a", "sqrt_double"));
- mInitMap.put(new Pair<String, String>("func_76134_b", "cos"));
- mInitMap.put(new Pair<String, String>("func_76135_e", "abs"));
- mInitMap.put(new Pair<String, String>("func_76136_a", "getRandomIntegerInRange"));
- mInitMap.put(new Pair<String, String>("func_76137_a", "bucketInt"));
- mInitMap.put(new Pair<String, String>("func_76138_g", "wrapAngleTo180_double"));
- mInitMap.put(new Pair<String, String>("func_76139_a", "stringNullOrLengthZero"));
- mInitMap.put(new Pair<String, String>("func_76140_b", "truncateDoubleToInt"));
- mInitMap.put(new Pair<String, String>("func_76141_d", "floor_float"));
- mInitMap.put(new Pair<String, String>("func_76142_g", "wrapAngleTo180_float"));
- mInitMap.put(new Pair<String, String>("func_76143_f", "ceiling_double_int"));
- mInitMap.put(new Pair<String, String>("func_76145_b", "getValue"));
- mInitMap.put(new Pair<String, String>("func_76146_a", "getKey"));
- mInitMap.put(new Pair<String, String>("func_76152_e", "removeKey"));
- mInitMap.put(new Pair<String, String>("func_76153_b", "resizeTable"));
- mInitMap.put(new Pair<String, String>("func_76154_a", "copyHashTableTo"));
- mInitMap.put(new Pair<String, String>("func_76155_g", "getHashedKey"));
- mInitMap.put(new Pair<String, String>("func_76156_a", "createKey"));
- mInitMap.put(new Pair<String, String>("func_76157_a", "hash"));
- mInitMap.put(new Pair<String, String>("func_76158_a", "getHashIndex"));
- mInitMap.put(new Pair<String, String>("func_76159_d", "remove"));
- mInitMap.put(new Pair<String, String>("func_76160_c", "getEntry"));
- mInitMap.put(new Pair<String, String>("func_76161_b", "containsItem"));
- mInitMap.put(new Pair<String, String>("func_76162_a", "getNumHashElements"));
- mInitMap.put(new Pair<String, String>("func_76163_a", "add"));
- mInitMap.put(new Pair<String, String>("func_76164_a", "getValueByKey"));
- mInitMap.put(new Pair<String, String>("func_76179_a", "buildPostString"));
- mInitMap.put(new Pair<String, String>("func_76181_a", "getSuitableLanPort"));
- mInitMap.put(new Pair<String, String>("func_76184_a", "readFromNBT"));
- mInitMap.put(new Pair<String, String>("func_76185_a", "markDirty"));
- mInitMap.put(new Pair<String, String>("func_76186_a", "setDirty"));
- mInitMap.put(new Pair<String, String>("func_76187_b", "writeToNBT"));
- mInitMap.put(new Pair<String, String>("func_76188_b", "isDirty"));
- mInitMap.put(new Pair<String, String>("func_76191_a", "updateVisiblePlayers"));
- mInitMap.put(new Pair<String, String>("func_76192_a", "updateMPMapData"));
- mInitMap.put(new Pair<String, String>("func_76193_a", "getUpdatePacketData"));
- mInitMap.put(new Pair<String, String>("func_76194_a", "setColumnDirty"));
- mInitMap.put(new Pair<String, String>("func_76204_a", "getPlayersOnMap"));
- mInitMap.put(new Pair<String, String>("func_76217_h", "getCanBurn"));
- mInitMap.put(new Pair<String, String>("func_76218_k", "isOpaque"));
- mInitMap.put(new Pair<String, String>("func_76219_n", "setNoPushMobility"));
- mInitMap.put(new Pair<String, String>("func_76220_a", "isSolid"));
- mInitMap.put(new Pair<String, String>("func_76221_f", "setRequiresTool"));
- mInitMap.put(new Pair<String, String>("func_76222_j", "isReplaceable"));
- mInitMap.put(new Pair<String, String>("func_76223_p", "setTranslucent"));
- mInitMap.put(new Pair<String, String>("func_76224_d", "isLiquid"));
- mInitMap.put(new Pair<String, String>("func_76225_o", "setImmovableMobility"));
- mInitMap.put(new Pair<String, String>("func_76226_g", "setBurning"));
- mInitMap.put(new Pair<String, String>("func_76227_m", "getMaterialMobility"));
- mInitMap.put(new Pair<String, String>("func_76228_b", "blocksLight"));
- mInitMap.put(new Pair<String, String>("func_76229_l", "isToolNotRequired"));
- mInitMap.put(new Pair<String, String>("func_76230_c", "blocksMovement"));
- mInitMap.put(new Pair<String, String>("func_76231_i", "setReplaceable"));
- mInitMap.put(new Pair<String, String>("func_76269_a", "getRandomItem"));
- mInitMap.put(new Pair<String, String>("func_76270_a", "getTotalWeight"));
- mInitMap.put(new Pair<String, String>("func_76271_a", "getRandomItem"));
- mInitMap.put(new Pair<String, String>("func_76272_a", "getTotalWeight"));
- mInitMap.put(new Pair<String, String>("func_76273_a", "getRandomItem"));
- mInitMap.put(new Pair<String, String>("func_76274_a", "getRandomItem"));
- mInitMap.put(new Pair<String, String>("func_76293_a", "generateChestContents"));
- mInitMap.put(new Pair<String, String>("func_76304_a", "generateNoiseOctaves"));
- mInitMap.put(new Pair<String, String>("func_76305_a", "generateNoiseOctaves"));
- mInitMap.put(new Pair<String, String>("func_76308_a", "populateNoiseArray"));
- mInitMap.put(new Pair<String, String>("func_76310_a", "grad"));
- mInitMap.put(new Pair<String, String>("func_76311_b", "lerp"));
- mInitMap.put(new Pair<String, String>("func_76316_a", "onInventoryChanged"));
- mInitMap.put(new Pair<String, String>("func_76317_a", "clearProfiling"));
- mInitMap.put(new Pair<String, String>("func_76318_c", "endStartSection"));
- mInitMap.put(new Pair<String, String>("func_76319_b", "endSection"));
- mInitMap.put(new Pair<String, String>("func_76320_a", "startSection"));
- mInitMap.put(new Pair<String, String>("func_76321_b", "getProfilingData"));
- mInitMap.put(new Pair<String, String>("func_76322_c", "getNameOfLastSection"));
- mInitMap.put(new Pair<String, String>("func_76333_a", "smooth"));
- mInitMap.put(new Pair<String, String>("func_76337_a", "ticksToElapsedTime"));
- mInitMap.put(new Pair<String, String>("func_76338_a", "stripControlCodes"));
- mInitMap.put(new Pair<String, String>("func_76340_b", "getSecond"));
- mInitMap.put(new Pair<String, String>("func_76341_a", "getFirst"));
- mInitMap.put(new Pair<String, String>("func_76345_d", "getHungerDamage"));
- mInitMap.put(new Pair<String, String>("func_76346_g", "getEntity"));
- mInitMap.put(new Pair<String, String>("func_76347_k", "isFireDamage"));
- mInitMap.put(new Pair<String, String>("func_76348_h", "setDamageBypassesArmor"));
- mInitMap.put(new Pair<String, String>("func_76349_b", "setProjectile"));
- mInitMap.put(new Pair<String, String>("func_76350_n", "isDifficultyScaled"));
- mInitMap.put(new Pair<String, String>("func_76351_m", "setDifficultyScaled"));
- mInitMap.put(new Pair<String, String>("func_76352_a", "isProjectile"));
- mInitMap.put(new Pair<String, String>("func_76353_a", "causeArrowDamage"));
- mInitMap.put(new Pair<String, String>("func_76354_b", "causeIndirectMagicDamage"));
- mInitMap.put(new Pair<String, String>("func_76355_l", "getDamageType"));
- mInitMap.put(new Pair<String, String>("func_76356_a", "causeThrownDamage"));
- mInitMap.put(new Pair<String, String>("func_76357_e", "canHarmInCreative"));
- mInitMap.put(new Pair<String, String>("func_76358_a", "causeMobDamage"));
- mInitMap.put(new Pair<String, String>("func_76359_i", "setDamageAllowedInCreativeMode"));
- mInitMap.put(new Pair<String, String>("func_76361_j", "setFireDamage"));
- mInitMap.put(new Pair<String, String>("func_76362_a", "causeFireballDamage"));
- mInitMap.put(new Pair<String, String>("func_76363_c", "isUnblockable"));
- mInitMap.put(new Pair<String, String>("func_76364_f", "getSourceOfDamage"));
- mInitMap.put(new Pair<String, String>("func_76365_a", "causePlayerDamage"));
- mInitMap.put(new Pair<String, String>("func_76388_g", "getEffectiveness"));
- mInitMap.put(new Pair<String, String>("func_76389_a", "getDurationString"));
- mInitMap.put(new Pair<String, String>("func_76390_b", "setPotionName"));
- mInitMap.put(new Pair<String, String>("func_76392_e", "getStatusIconIndex"));
- mInitMap.put(new Pair<String, String>("func_76393_a", "getName"));
- mInitMap.put(new Pair<String, String>("func_76394_a", "performEffect"));
- mInitMap.put(new Pair<String, String>("func_76395_i", "isUsable"));
- mInitMap.put(new Pair<String, String>("func_76396_c", "getId"));
- mInitMap.put(new Pair<String, String>("func_76397_a", "isReady"));
- mInitMap.put(new Pair<String, String>("func_76398_f", "isBadEffect"));
- mInitMap.put(new Pair<String, String>("func_76399_b", "setIconIndex"));
- mInitMap.put(new Pair<String, String>("func_76400_d", "hasStatusIcon"));
- mInitMap.put(new Pair<String, String>("func_76401_j", "getLiquidColor"));
- mInitMap.put(new Pair<String, String>("func_76402_a", "affectEntity"));
- mInitMap.put(new Pair<String, String>("func_76403_b", "isInstant"));
- mInitMap.put(new Pair<String, String>("func_76404_a", "setEffectiveness"));
- mInitMap.put(new Pair<String, String>("func_76445_a", "getIntCache"));
- mInitMap.put(new Pair<String, String>("func_76446_a", "resetIntCache"));
- mInitMap.put(new Pair<String, String>("func_76452_a", "combine"));
- mInitMap.put(new Pair<String, String>("func_76453_d", "getEffectName"));
- mInitMap.put(new Pair<String, String>("func_76454_e", "deincrementDuration"));
- mInitMap.put(new Pair<String, String>("func_76455_a", "onUpdate"));
- mInitMap.put(new Pair<String, String>("func_76456_a", "getPotionID"));
- mInitMap.put(new Pair<String, String>("func_76457_b", "performEffect"));
- mInitMap.put(new Pair<String, String>("func_76458_c", "getAmplifier"));
- mInitMap.put(new Pair<String, String>("func_76459_b", "getDuration"));
- mInitMap.put(new Pair<String, String>("func_76463_a", "startSnooper"));
- mInitMap.put(new Pair<String, String>("func_76465_c", "getCurrentStats"));
- mInitMap.put(new Pair<String, String>("func_76467_g", "addJvmArgsToSnooper"));
- mInitMap.put(new Pair<String, String>("func_76468_d", "isSnooperRunning"));
- mInitMap.put(new Pair<String, String>("func_76470_e", "stopSnooper"));
- mInitMap.put(new Pair<String, String>("func_76471_b", "addMemoryStatsToSnooper"));
- mInitMap.put(new Pair<String, String>("func_76484_a", "generate"));
- mInitMap.put(new Pair<String, String>("func_76487_a", "setScale"));
- mInitMap.put(new Pair<String, String>("func_76489_a", "generateLeafNodeList"));
- mInitMap.put(new Pair<String, String>("func_76490_a", "layerSize"));
- mInitMap.put(new Pair<String, String>("func_76491_a", "generateLeafNode"));
- mInitMap.put(new Pair<String, String>("func_76493_c", "leafNodeNeedsBase"));
- mInitMap.put(new Pair<String, String>("func_76494_d", "generateLeafNodeBases"));
- mInitMap.put(new Pair<String, String>("func_76495_b", "leafSize"));
- mInitMap.put(new Pair<String, String>("func_76496_a", "checkBlockLine"));
- mInitMap.put(new Pair<String, String>("func_76497_e", "validTreeLocation"));
- mInitMap.put(new Pair<String, String>("func_76498_b", "generateLeaves"));
- mInitMap.put(new Pair<String, String>("func_76499_c", "generateTrunk"));
- mInitMap.put(new Pair<String, String>("func_76529_b", "growVines"));
- mInitMap.put(new Pair<String, String>("func_76536_b", "generateVines"));
- mInitMap.put(new Pair<String, String>("func_76543_b", "pickMobSpawner"));
- mInitMap.put(new Pair<String, String>("func_76549_c", "getChunkInputStream"));
- mInitMap.put(new Pair<String, String>("func_76550_a", "createOrLoadRegionFile"));
- mInitMap.put(new Pair<String, String>("func_76551_a", "clearRegionFileReferences"));
- mInitMap.put(new Pair<String, String>("func_76552_d", "getChunkOutputStream"));
- mInitMap.put(new Pair<String, String>("func_76554_h", "getEntrancePortalLocation"));
- mInitMap.put(new Pair<String, String>("func_76555_c", "createChunkGenerator"));
- mInitMap.put(new Pair<String, String>("func_76556_a", "generateLightBrightnessTable"));
- mInitMap.put(new Pair<String, String>("func_76557_i", "getAverageGroundLevel"));
- mInitMap.put(new Pair<String, String>("func_76558_a", "registerWorld"));
- mInitMap.put(new Pair<String, String>("func_76559_b", "getMoonPhase"));
- mInitMap.put(new Pair<String, String>("func_76560_a", "calcSunriseSunsetColors"));
- mInitMap.put(new Pair<String, String>("func_76561_g", "isSkyColored"));
- mInitMap.put(new Pair<String, String>("func_76562_b", "getFogColor"));
- mInitMap.put(new Pair<String, String>("func_76563_a", "calculateCelestialAngle"));
- mInitMap.put(new Pair<String, String>("func_76564_j", "getWorldHasVoidParticles"));
- mInitMap.put(new Pair<String, String>("func_76565_k", "getVoidFogYFactor"));
- mInitMap.put(new Pair<String, String>("func_76566_a", "canCoordinateBeSpawn"));
- mInitMap.put(new Pair<String, String>("func_76567_e", "canRespawnHere"));
- mInitMap.put(new Pair<String, String>("func_76568_b", "doesXZShowFog"));
- mInitMap.put(new Pair<String, String>("func_76569_d", "isSurfaceWorld"));
- mInitMap.put(new Pair<String, String>("func_76570_a", "getProviderForDimension"));
- mInitMap.put(new Pair<String, String>("func_76571_f", "getCloudHeight"));
- mInitMap.put(new Pair<String, String>("func_76572_b", "registerWorldChunkManager"));
- mInitMap.put(new Pair<String, String>("func_76581_a", "set"));
- mInitMap.put(new Pair<String, String>("func_76582_a", "get"));
- mInitMap.put(new Pair<String, String>("func_76587_i", "getBlockStorageArray"));
- mInitMap.put(new Pair<String, String>("func_76588_a", "getEntitiesWithinAABBForEntity"));
- mInitMap.put(new Pair<String, String>("func_76589_b", "setBlockMetadata"));
- mInitMap.put(new Pair<String, String>("func_76590_a", "generateHeightMap"));
- mInitMap.put(new Pair<String, String>("func_76591_a", "getBiomeGenForWorldCoords"));
- mInitMap.put(new Pair<String, String>("func_76594_o", "enqueueRelightChecks"));
- mInitMap.put(new Pair<String, String>("func_76595_e", "propagateSkylightOcclusion"));
- mInitMap.put(new Pair<String, String>("func_76599_g", "checkSkylightNeighborHeight"));
- mInitMap.put(new Pair<String, String>("func_76600_a", "isAtLocation"));
- mInitMap.put(new Pair<String, String>("func_76601_a", "needsSaving"));
- mInitMap.put(new Pair<String, String>("func_76602_a", "setStorageArrays"));
- mInitMap.put(new Pair<String, String>("func_76603_b", "generateSkylightMap"));
- mInitMap.put(new Pair<String, String>("func_76605_m", "getBiomeArray"));
- mInitMap.put(new Pair<String, String>("func_76606_c", "getAreLevelsEmpty"));
- mInitMap.put(new Pair<String, String>("func_76607_a", "fillChunk"));
- mInitMap.put(new Pair<String, String>("func_76608_a", "removeEntityAtIndex"));
- mInitMap.put(new Pair<String, String>("func_76609_d", "updateSkylightNeighborHeight"));
- mInitMap.put(new Pair<String, String>("func_76611_b", "getHeightValue"));
- mInitMap.put(new Pair<String, String>("func_76612_a", "addEntity"));
- mInitMap.put(new Pair<String, String>("func_76613_n", "resetRelightChecks"));
- mInitMap.put(new Pair<String, String>("func_76614_a", "getSavedLightValue"));
- mInitMap.put(new Pair<String, String>("func_76615_h", "relightBlock"));
- mInitMap.put(new Pair<String, String>("func_76616_a", "setBiomeArray"));
- mInitMap.put(new Pair<String, String>("func_76617_a", "getRandomWithSeed"));
- mInitMap.put(new Pair<String, String>("func_76618_a", "getEntitiesOfTypeWithinAAAB"));
- mInitMap.put(new Pair<String, String>("func_76619_d", "canBlockSeeTheSky"));
- mInitMap.put(new Pair<String, String>("func_76621_g", "isEmpty"));
- mInitMap.put(new Pair<String, String>("func_76622_b", "removeEntity"));
- mInitMap.put(new Pair<String, String>("func_76623_d", "onChunkUnload"));
- mInitMap.put(new Pair<String, String>("func_76624_a", "populateChunk"));
- mInitMap.put(new Pair<String, String>("func_76625_h", "getTopFilledSegment"));
- mInitMap.put(new Pair<String, String>("func_76626_d", "getPrecipitationHeight"));
- mInitMap.put(new Pair<String, String>("func_76628_c", "getBlockMetadata"));
- mInitMap.put(new Pair<String, String>("func_76629_c", "getBlockLightValue"));
- mInitMap.put(new Pair<String, String>("func_76630_e", "setChunkModified"));
- mInitMap.put(new Pair<String, String>("func_76631_c", "onChunkLoad"));
- mInitMap.put(new Pair<String, String>("func_76632_l", "getChunkCoordIntPair"));
- mInitMap.put(new Pair<String, String>("func_76633_a", "setLightValue"));
- mInitMap.put(new Pair<String, String>("func_76654_b", "setExtBlockMetadata"));
- mInitMap.put(new Pair<String, String>("func_76657_c", "setExtSkylightValue"));
- mInitMap.put(new Pair<String, String>("func_76658_g", "getBlockLSBArray"));
- mInitMap.put(new Pair<String, String>("func_76659_c", "setBlocklightArray"));
- mInitMap.put(new Pair<String, String>("func_76660_i", "getBlockMSBArray"));
- mInitMap.put(new Pair<String, String>("func_76661_k", "getBlocklightArray"));
- mInitMap.put(new Pair<String, String>("func_76662_d", "getYLocation"));
- mInitMap.put(new Pair<String, String>("func_76663_a", "isEmpty"));
- mInitMap.put(new Pair<String, String>("func_76664_a", "setBlockLSBArray"));
- mInitMap.put(new Pair<String, String>("func_76665_b", "getExtBlockMetadata"));
- mInitMap.put(new Pair<String, String>("func_76666_d", "setSkylightArray"));
- mInitMap.put(new Pair<String, String>("func_76667_m", "createBlockMSBArray"));
- mInitMap.put(new Pair<String, String>("func_76668_b", "setBlockMetadataArray"));
- mInitMap.put(new Pair<String, String>("func_76669_j", "getMetadataArray"));
- mInitMap.put(new Pair<String, String>("func_76670_c", "getExtSkylightValue"));
- mInitMap.put(new Pair<String, String>("func_76671_l", "getSkylightArray"));
- mInitMap.put(new Pair<String, String>("func_76672_e", "removeInvalidBlocks"));
- mInitMap.put(new Pair<String, String>("func_76673_a", "setBlockMSBArray"));
- mInitMap.put(new Pair<String, String>("func_76674_d", "getExtBlocklightValue"));
- mInitMap.put(new Pair<String, String>("func_76675_b", "getNeedsRandomTick"));
- mInitMap.put(new Pair<String, String>("func_76676_h", "clearMSBArray"));
- mInitMap.put(new Pair<String, String>("func_76677_d", "setExtBlocklightValue"));
- mInitMap.put(new Pair<String, String>("func_76686_a", "get"));
- mInitMap.put(new Pair<String, String>("func_76690_a", "convertToAnvilFormat"));
- mInitMap.put(new Pair<String, String>("func_76691_a", "load"));
- mInitMap.put(new Pair<String, String>("func_76704_a", "getChunkDataInputStream"));
- mInitMap.put(new Pair<String, String>("func_76705_d", "outOfBounds"));
- mInitMap.put(new Pair<String, String>("func_76706_a", "write"));
- mInitMap.put(new Pair<String, String>("func_76707_e", "getOffset"));
- mInitMap.put(new Pair<String, String>("func_76708_c", "close"));
- mInitMap.put(new Pair<String, String>("func_76709_c", "isChunkSaved"));
- mInitMap.put(new Pair<String, String>("func_76710_b", "getChunkDataOutputStream"));
- mInitMap.put(new Pair<String, String>("func_76711_a", "setOffset"));
- mInitMap.put(new Pair<String, String>("func_76712_a", "write"));
- mInitMap.put(new Pair<String, String>("func_76713_b", "setChunkTimestamp"));
- mInitMap.put(new Pair<String, String>("func_76727_i", "getFloatRainfall"));
- mInitMap.put(new Pair<String, String>("func_76728_a", "decorate"));
- mInitMap.put(new Pair<String, String>("func_76729_a", "createBiomeDecorator"));
- mInitMap.put(new Pair<String, String>("func_76730_b", "getRandomWorldGenForGrass"));
- mInitMap.put(new Pair<String, String>("func_76731_a", "getSkyColorByTemp"));
- mInitMap.put(new Pair<String, String>("func_76732_a", "setTemperatureRainfall"));
- mInitMap.put(new Pair<String, String>("func_76735_a", "setBiomeName"));
- mInitMap.put(new Pair<String, String>("func_76736_e", "isHighHumidity"));
- mInitMap.put(new Pair<String, String>("func_76738_d", "canSpawnLightningBolt"));
- mInitMap.put(new Pair<String, String>("func_76739_b", "setColor"));
- mInitMap.put(new Pair<String, String>("func_76741_f", "getSpawningChance"));
- mInitMap.put(new Pair<String, String>("func_76742_b", "setEnableSnow"));
- mInitMap.put(new Pair<String, String>("func_76744_g", "getIntRainfall"));
- mInitMap.put(new Pair<String, String>("func_76745_m", "setDisableRain"));
- mInitMap.put(new Pair<String, String>("func_76746_c", "getEnableSnow"));
- mInitMap.put(new Pair<String, String>("func_76747_a", "getSpawnableList"));
- mInitMap.put(new Pair<String, String>("func_76793_b", "genStandardOre2"));
- mInitMap.put(new Pair<String, String>("func_76795_a", "genStandardOre1"));
- mInitMap.put(new Pair<String, String>("func_76797_b", "generateOres"));
- mInitMap.put(new Pair<String, String>("func_76837_b", "getBiomeGenAt"));
- mInitMap.put(new Pair<String, String>("func_76838_a", "cleanupCache"));
- mInitMap.put(new Pair<String, String>("func_76839_e", "getCachedBiomes"));
- mInitMap.put(new Pair<String, String>("func_76840_a", "getBiomeCacheBlock"));
- mInitMap.put(new Pair<String, String>("func_76885_a", "getBiomeGenAt"));
- mInitMap.put(new Pair<String, String>("func_76931_a", "getBiomeGenAt"));
- mInitMap.put(new Pair<String, String>("func_76932_a", "getBiomesToSpawnIn"));
- mInitMap.put(new Pair<String, String>("func_76933_b", "loadBlockGeneratorData"));
- mInitMap.put(new Pair<String, String>("func_76935_a", "getBiomeGenAt"));
- mInitMap.put(new Pair<String, String>("func_76936_a", "getRainfall"));
- mInitMap.put(new Pair<String, String>("func_76937_a", "getBiomesForGeneration"));
- mInitMap.put(new Pair<String, String>("func_76938_b", "cleanupCache"));
- mInitMap.put(new Pair<String, String>("func_76939_a", "getTemperatureAtHeight"));
- mInitMap.put(new Pair<String, String>("func_76940_a", "areBiomesViable"));
- mInitMap.put(new Pair<String, String>("func_76975_c", "renderShadow"));
- mInitMap.put(new Pair<String, String>("func_76976_a", "setRenderManager"));
- mInitMap.put(new Pair<String, String>("func_76977_a", "renderEntityOnFire"));
- mInitMap.put(new Pair<String, String>("func_76978_a", "renderOffsetAABB"));
- mInitMap.put(new Pair<String, String>("func_76979_b", "doRenderShadowAndFire"));
- mInitMap.put(new Pair<String, String>("func_76980_a", "renderAABB"));
- mInitMap.put(new Pair<String, String>("func_76982_b", "getWorldFromRenderManager"));
- mInitMap.put(new Pair<String, String>("func_76983_a", "getFontRendererFromRenderManager"));
- mInitMap.put(new Pair<String, String>("func_76986_a", "doRender"));
- mInitMap.put(new Pair<String, String>("func_77015_a", "renderItemIntoGUI"));
- mInitMap.put(new Pair<String, String>("func_77017_a", "renderQuad"));
- mInitMap.put(new Pair<String, String>("func_77018_a", "renderGlint"));
- mInitMap.put(new Pair<String, String>("func_77020_a", "renderDroppedItem"));
- mInitMap.put(new Pair<String, String>("func_77021_b", "renderItemOverlayIntoGUI"));
- mInitMap.put(new Pair<String, String>("func_77026_a", "renderEntity"));
- mInitMap.put(new Pair<String, String>("func_77029_c", "renderEquippedItems"));
- mInitMap.put(new Pair<String, String>("func_77030_a", "getColorMultiplier"));
- mInitMap.put(new Pair<String, String>("func_77032_a", "shouldRenderPass"));
- mInitMap.put(new Pair<String, String>("func_77033_b", "passSpecialRender"));
- mInitMap.put(new Pair<String, String>("func_77034_a", "interpolateRotation"));
- mInitMap.put(new Pair<String, String>("func_77035_b", "inheritRenderPass"));
- mInitMap.put(new Pair<String, String>("func_77036_a", "renderModel"));
- mInitMap.put(new Pair<String, String>("func_77037_a", "getDeathMaxRotation"));
- mInitMap.put(new Pair<String, String>("func_77039_a", "renderLivingAt"));
- mInitMap.put(new Pair<String, String>("func_77040_d", "getSwingProgress"));
- mInitMap.put(new Pair<String, String>("func_77041_b", "preRenderCallback"));
- mInitMap.put(new Pair<String, String>("func_77042_a", "setRenderPassModel"));
- mInitMap.put(new Pair<String, String>("func_77043_a", "rotateCorpse"));
- mInitMap.put(new Pair<String, String>("func_77044_a", "handleRotationFloat"));
- mInitMap.put(new Pair<String, String>("func_77124_a", "setCanBeCreated"));
- mInitMap.put(new Pair<String, String>("func_77125_e", "isVersioned"));
- mInitMap.put(new Pair<String, String>("func_77126_d", "getCanBeCreated"));
- mInitMap.put(new Pair<String, String>("func_77127_a", "getWorldTypeName"));
- mInitMap.put(new Pair<String, String>("func_77128_b", "getTranslateName"));
- mInitMap.put(new Pair<String, String>("func_77129_f", "setVersioned"));
- mInitMap.put(new Pair<String, String>("func_77130_a", "parseWorldType"));
- mInitMap.put(new Pair<String, String>("func_77131_c", "getGeneratorVersion"));
- mInitMap.put(new Pair<String, String>("func_77132_a", "getWorldTypeForGeneratorVersion"));
- mInitMap.put(new Pair<String, String>("func_77142_a", "getByName"));
- mInitMap.put(new Pair<String, String>("func_77144_e", "isSurvivalOrAdventure"));
- mInitMap.put(new Pair<String, String>("func_77145_d", "isCreative"));
- mInitMap.put(new Pair<String, String>("func_77146_a", "getByID"));
- mInitMap.put(new Pair<String, String>("func_77147_a", "configurePlayerCapabilities"));
- mInitMap.put(new Pair<String, String>("func_77148_a", "getID"));
- mInitMap.put(new Pair<String, String>("func_77149_b", "getName"));
- mInitMap.put(new Pair<String, String>("func_77158_f", "getHardcoreEnabled"));
- mInitMap.put(new Pair<String, String>("func_77159_a", "enableBonusChest"));
- mInitMap.put(new Pair<String, String>("func_77160_d", "getSeed"));
- mInitMap.put(new Pair<String, String>("func_77161_a", "getGameTypeById"));
- mInitMap.put(new Pair<String, String>("func_77162_e", "getGameType"));
- mInitMap.put(new Pair<String, String>("func_77163_i", "areCommandsAllowed"));
- mInitMap.put(new Pair<String, String>("func_77164_g", "isMapFeaturesEnabled"));
- mInitMap.put(new Pair<String, String>("func_77165_h", "getTerrainType"));
- mInitMap.put(new Pair<String, String>("func_77166_b", "enableCommands"));
- mInitMap.put(new Pair<String, String>("func_77167_c", "isBonusChestEnabled"));
- mInitMap.put(new Pair<String, String>("func_77176_a", "setScheduledTime"));
- mInitMap.put(new Pair<String, String>("func_77184_b", "placeInExistingPortal"));
- mInitMap.put(new Pair<String, String>("func_77185_a", "placeInPortal"));
- mInitMap.put(new Pair<String, String>("func_77190_a", "canCreatureTypeSpawnAtLocation"));
- mInitMap.put(new Pair<String, String>("func_77191_a", "performWorldGenSpawning"));
- mInitMap.put(new Pair<String, String>("func_77192_a", "findChunksForSpawning"));
- mInitMap.put(new Pair<String, String>("func_77201_a", "readRecipiesFromTags"));
- mInitMap.put(new Pair<String, String>("func_77202_a", "getRecipiesAsTags"));
- mInitMap.put(new Pair<String, String>("func_77203_a", "canRecipeBeUsed"));
- mInitMap.put(new Pair<String, String>("func_77205_a", "addToListWithCheck"));
- mInitMap.put(new Pair<String, String>("func_77272_a", "chunkXZ2Int"));
- mInitMap.put(new Pair<String, String>("func_77273_a", "getCenterXPos"));
- mInitMap.put(new Pair<String, String>("func_77274_b", "getCenterZPosition"));
- mInitMap.put(new Pair<String, String>("func_77278_a", "doExplosionA"));
- mInitMap.put(new Pair<String, String>("func_77279_a", "doExplosionB"));
- mInitMap.put(new Pair<String, String>("func_77316_c", "getTranslatedName"));
- mInitMap.put(new Pair<String, String>("func_77317_b", "getMaxEnchantability"));
- mInitMap.put(new Pair<String, String>("func_77318_a", "calcModifierDamage"));
- mInitMap.put(new Pair<String, String>("func_77319_d", "getMinLevel"));
- mInitMap.put(new Pair<String, String>("func_77320_a", "getName"));
- mInitMap.put(new Pair<String, String>("func_77321_a", "getMinEnchantability"));
- mInitMap.put(new Pair<String, String>("func_77322_b", "setName"));
- mInitMap.put(new Pair<String, String>("func_77324_c", "getWeight"));
- mInitMap.put(new Pair<String, String>("func_77325_b", "getMaxLevel"));
- mInitMap.put(new Pair<String, String>("func_77326_a", "canApplyTogether"));
- mInitMap.put(new Pair<String, String>("func_77390_a", "readFromTags"));
- mInitMap.put(new Pair<String, String>("func_77391_b", "hasSameItemsAs"));
- mInitMap.put(new Pair<String, String>("func_77393_a", "hasSameIDsAs"));
- mInitMap.put(new Pair<String, String>("func_77394_a", "getItemToBuy"));
- mInitMap.put(new Pair<String, String>("func_77395_g", "writeToTags"));
- mInitMap.put(new Pair<String, String>("func_77396_b", "getSecondItemToBuy"));
- mInitMap.put(new Pair<String, String>("func_77397_d", "getItemToSell"));
- mInitMap.put(new Pair<String, String>("func_77398_c", "hasSecondItemToBuy"));
- mInitMap.put(new Pair<String, String>("func_77399_f", "incrementToolUses"));
- mInitMap.put(new Pair<String, String>("func_77442_b", "canUnlockAchievement"));
- mInitMap.put(new Pair<String, String>("func_77443_a", "hasAchievementUnlocked"));
- mInitMap.put(new Pair<String, String>("func_77444_a", "writeStat"));
- mInitMap.put(new Pair<String, String>("func_77466_a", "getFoliageColorPine"));
- mInitMap.put(new Pair<String, String>("func_77467_a", "setFoliageBiomeColorizer"));
- mInitMap.put(new Pair<String, String>("func_77468_c", "getFoliageColorBasic"));
- mInitMap.put(new Pair<String, String>("func_77469_b", "getFoliageColorBirch"));
- mInitMap.put(new Pair<String, String>("func_77470_a", "getFoliageColor"));
- mInitMap.put(new Pair<String, String>("func_77472_b", "setClientActiveTexture"));
- mInitMap.put(new Pair<String, String>("func_77473_a", "setActiveTexture"));
- mInitMap.put(new Pair<String, String>("func_77474_a", "initializeTextures"));
- mInitMap.put(new Pair<String, String>("func_77475_a", "setLightmapTextureCoords"));
- mInitMap.put(new Pair<String, String>("func_77479_a", "setGrassBiomeColorizer"));
- mInitMap.put(new Pair<String, String>("func_77480_a", "getGrassColor"));
- mInitMap.put(new Pair<String, String>("func_77487_a", "getServerMotd"));
- mInitMap.put(new Pair<String, String>("func_77488_b", "getServerIpPort"));
- mInitMap.put(new Pair<String, String>("func_77489_c", "updateLastSeen"));
- mInitMap.put(new Pair<String, String>("func_77493_a", "calculateModifier"));
- mInitMap.put(new Pair<String, String>("func_77501_a", "getRespiration"));
- mInitMap.put(new Pair<String, String>("func_77502_d", "getSilkTouchModifier"));
- mInitMap.put(new Pair<String, String>("func_77504_a", "addRandomEnchantment"));
- mInitMap.put(new Pair<String, String>("func_77505_b", "mapEnchantmentData"));
- mInitMap.put(new Pair<String, String>("func_77506_a", "getEnchantmentLevel"));
- mInitMap.put(new Pair<String, String>("func_77507_b", "getKnockbackModifier"));
- mInitMap.put(new Pair<String, String>("func_77508_a", "getEnchantmentModifierDamage"));
- mInitMap.put(new Pair<String, String>("func_77509_b", "getEfficiencyModifier"));
- mInitMap.put(new Pair<String, String>("func_77510_g", "getAquaAffinityModifier"));
- mInitMap.put(new Pair<String, String>("func_77511_a", "getMaxEnchantmentLevel"));
- mInitMap.put(new Pair<String, String>("func_77512_a", "getEnchantmentModifierLiving"));
- mInitMap.put(new Pair<String, String>("func_77513_b", "buildEnchantmentList"));
- mInitMap.put(new Pair<String, String>("func_77514_a", "calcItemStackEnchantability"));
- mInitMap.put(new Pair<String, String>("func_77516_a", "applyEnchantmentModifierArray"));
- mInitMap.put(new Pair<String, String>("func_77517_e", "getFortuneModifier"));
- mInitMap.put(new Pair<String, String>("func_77518_a", "applyEnchantmentModifier"));
- mInitMap.put(new Pair<String, String>("func_77519_f", "getLootingModifier"));
- mInitMap.put(new Pair<String, String>("func_77523_b", "getAdFromPingResponse"));
- mInitMap.put(new Pair<String, String>("func_77524_a", "getMotdFromPingResponse"));
- mInitMap.put(new Pair<String, String>("func_77525_a", "getPingResponse"));
- mInitMap.put(new Pair<String, String>("func_77552_b", "setWasNotUpdated"));
- mInitMap.put(new Pair<String, String>("func_77553_a", "getWasUpdated"));
- mInitMap.put(new Pair<String, String>("func_77554_c", "getLanServers"));
- mInitMap.put(new Pair<String, String>("func_77557_a", "canEnchantItem"));
- mInitMap.put(new Pair<String, String>("func_77569_a", "matches"));
- mInitMap.put(new Pair<String, String>("func_77570_a", "getRecipeSize"));
- mInitMap.put(new Pair<String, String>("func_77571_b", "getRecipeOutput"));
- mInitMap.put(new Pair<String, String>("func_77572_b", "getCraftingResult"));
- mInitMap.put(new Pair<String, String>("func_77573_a", "checkMatch"));
- mInitMap.put(new Pair<String, String>("func_77583_a", "addRecipes"));
- mInitMap.put(new Pair<String, String>("func_77586_a", "addRecipes"));
- mInitMap.put(new Pair<String, String>("func_77589_a", "addRecipes"));
- mInitMap.put(new Pair<String, String>("func_77590_a", "addRecipes"));
- mInitMap.put(new Pair<String, String>("func_77592_b", "getRecipeList"));
- mInitMap.put(new Pair<String, String>("func_77594_a", "getInstance"));
- mInitMap.put(new Pair<String, String>("func_77596_b", "addShapelessRecipe"));
- mInitMap.put(new Pair<String, String>("func_77599_b", "getSmeltingList"));
- mInitMap.put(new Pair<String, String>("func_77602_a", "instance"));
- mInitMap.put(new Pair<String, String>("func_77607_a", "addRecipes"));
- mInitMap.put(new Pair<String, String>("func_77608_a", "addRecipes"));
- mInitMap.put(new Pair<String, String>("func_77609_a", "addRecipes"));
- mInitMap.put(new Pair<String, String>("func_77612_l", "getMaxDurability"));
- mInitMap.put(new Pair<String, String>("func_77613_e", "getRarity"));
- mInitMap.put(new Pair<String, String>("func_77614_k", "getHasSubtypes"));
- mInitMap.put(new Pair<String, String>("func_77615_a", "onPlayerStoppedUsing"));
- mInitMap.put(new Pair<String, String>("func_77616_k", "isItemTool"));
- mInitMap.put(new Pair<String, String>("func_77617_a", "getIconFromDamage"));
- mInitMap.put(new Pair<String, String>("func_77618_c", "getIconFromDamageForRenderPass"));
- mInitMap.put(new Pair<String, String>("func_77619_b", "getItemEnchantability"));
- mInitMap.put(new Pair<String, String>("func_77620_a", "getColorFromDamage"));
- mInitMap.put(new Pair<String, String>("func_77621_a", "getMovingObjectPositionFromPlayer"));
- mInitMap.put(new Pair<String, String>("func_77622_d", "onCreated"));
- mInitMap.put(new Pair<String, String>("func_77623_v", "requiresMultipleRenderPasses"));
- mInitMap.put(new Pair<String, String>("func_77624_a", "addInformation"));
- mInitMap.put(new Pair<String, String>("func_77625_d", "setMaxStackSize"));
- mInitMap.put(new Pair<String, String>("func_77626_a", "getMaxItemUseDuration"));
- mInitMap.put(new Pair<String, String>("func_77627_a", "setHasSubtypes"));
- mInitMap.put(new Pair<String, String>("func_77629_n_", "shouldRotateAroundWhenRendering"));
- mInitMap.put(new Pair<String, String>("func_77630_h", "doesContainerItemLeaveCraftingGrid"));
- mInitMap.put(new Pair<String, String>("func_77631_c", "setPotionEffect"));
- mInitMap.put(new Pair<String, String>("func_77634_r", "hasContainerItem"));
- mInitMap.put(new Pair<String, String>("func_77636_d", "hasEffect"));
- mInitMap.put(new Pair<String, String>("func_77637_a", "setCreativeTab"));
- mInitMap.put(new Pair<String, String>("func_77639_j", "getItemStackLimit"));
- mInitMap.put(new Pair<String, String>("func_77640_w", "getCreativeTab"));
- mInitMap.put(new Pair<String, String>("func_77642_a", "setContainerItem"));
- mInitMap.put(new Pair<String, String>("func_77643_m_", "isMap"));
- mInitMap.put(new Pair<String, String>("func_77644_a", "hitEntity"));
- mInitMap.put(new Pair<String, String>("func_77645_m", "isDamageable"));
- mInitMap.put(new Pair<String, String>("func_77647_b", "getMetadata"));
- mInitMap.put(new Pair<String, String>("func_77648_a", "onItemUse"));
- mInitMap.put(new Pair<String, String>("func_77650_f", "getIconIndex"));
- mInitMap.put(new Pair<String, String>("func_77651_p", "getShareTag"));
- mInitMap.put(new Pair<String, String>("func_77653_i", "getItemStackDisplayName"));
- mInitMap.put(new Pair<String, String>("func_77654_b", "onItemUseFinish"));
- mInitMap.put(new Pair<String, String>("func_77655_b", "setUnlocalizedName"));
- mInitMap.put(new Pair<String, String>("func_77656_e", "setMaxDurability"));
- mInitMap.put(new Pair<String, String>("func_77657_g", "getUnlocalizedNameInefficiently"));
- mInitMap.put(new Pair<String, String>("func_77658_a", "getUnlocalizedName"));
- mInitMap.put(new Pair<String, String>("func_77659_a", "onItemRightClick"));
- mInitMap.put(new Pair<String, String>("func_77661_b", "getItemUseAction"));
- mInitMap.put(new Pair<String, String>("func_77662_d", "isFull3D"));
- mInitMap.put(new Pair<String, String>("func_77663_a", "onUpdate"));
- mInitMap.put(new Pair<String, String>("func_77664_n", "setFull3D"));
- mInitMap.put(new Pair<String, String>("func_77667_c", "getUnlocalizedName"));
- mInitMap.put(new Pair<String, String>("func_77668_q", "getContainerItem"));
- mInitMap.put(new Pair<String, String>("func_77828_a", "validBookTagContents"));
- mInitMap.put(new Pair<String, String>("func_77831_g", "isSplash"));
- mInitMap.put(new Pair<String, String>("func_77832_l", "getEffects"));
- mInitMap.put(new Pair<String, String>("func_77833_h", "isEffectInstant"));
- mInitMap.put(new Pair<String, String>("func_77834_f", "getEffects"));
- mInitMap.put(new Pair<String, String>("func_77840_a", "spawnCreature"));
- mInitMap.put(new Pair<String, String>("func_77842_f", "getMaterialName"));
- mInitMap.put(new Pair<String, String>("func_77844_a", "setPotionEffect"));
- mInitMap.put(new Pair<String, String>("func_77845_h", "isWolfsFavoriteMeat"));
- mInitMap.put(new Pair<String, String>("func_77848_i", "setAlwaysEdible"));
- mInitMap.put(new Pair<String, String>("func_77849_c", "onFoodEaten"));
- mInitMap.put(new Pair<String, String>("func_77861_e", "getToolMaterialName"));
- mInitMap.put(new Pair<String, String>("func_77872_a", "updateMapData"));
- mInitMap.put(new Pair<String, String>("func_77873_a", "getMapData"));
- mInitMap.put(new Pair<String, String>("func_77875_a", "tryPlaceContainedLiquid"));
- mInitMap.put(new Pair<String, String>("func_77906_a", "brewBitOperations"));
- mInitMap.put(new Pair<String, String>("func_77907_h", "countSetFlags"));
- mInitMap.put(new Pair<String, String>("func_77910_c", "isFlagSet"));
- mInitMap.put(new Pair<String, String>("func_77911_a", "calcPotionLiquidColor"));
- mInitMap.put(new Pair<String, String>("func_77912_a", "parsePotionEffects"));
- mInitMap.put(new Pair<String, String>("func_77913_a", "applyIngredient"));
- mInitMap.put(new Pair<String, String>("func_77914_a", "checkFlag"));
- mInitMap.put(new Pair<String, String>("func_77916_d", "isFlagUnset"));
- mInitMap.put(new Pair<String, String>("func_77917_b", "getPotionEffects"));
- mInitMap.put(new Pair<String, String>("func_77942_o", "hasTagCompound"));
- mInitMap.put(new Pair<String, String>("func_77943_a", "tryPlaceItemIntoWorld"));
- mInitMap.put(new Pair<String, String>("func_77944_b", "copyItemStack"));
- mInitMap.put(new Pair<String, String>("func_77945_a", "updateAnimation"));
- mInitMap.put(new Pair<String, String>("func_77946_l", "copy"));
- mInitMap.put(new Pair<String, String>("func_77948_v", "isItemEnchanted"));
- mInitMap.put(new Pair<String, String>("func_77949_a", "loadItemStackFromNBT"));
- mInitMap.put(new Pair<String, String>("func_77950_b", "onItemUseFinish"));
- mInitMap.put(new Pair<String, String>("func_77951_h", "isItemDamaged"));
- mInitMap.put(new Pair<String, String>("func_77952_i", "getCurrentDurability"));
- mInitMap.put(new Pair<String, String>("func_77953_t", "getRarity"));
- mInitMap.put(new Pair<String, String>("func_77954_c", "getIconIndex"));
- mInitMap.put(new Pair<String, String>("func_77955_b", "writeToNBT"));
- mInitMap.put(new Pair<String, String>("func_77956_u", "isItemEnchantable"));
- mInitMap.put(new Pair<String, String>("func_77957_a", "useItemRightClick"));
- mInitMap.put(new Pair<String, String>("func_77958_k", "getMaxDurability"));
- mInitMap.put(new Pair<String, String>("func_77959_d", "isItemStackEqual"));
- mInitMap.put(new Pair<String, String>("func_77960_j", "getMetadata"));
- mInitMap.put(new Pair<String, String>("func_77961_a", "hitEntity"));
- mInitMap.put(new Pair<String, String>("func_77962_s", "hasEffect"));
- mInitMap.put(new Pair<String, String>("func_77963_c", "readFromNBT"));
- mInitMap.put(new Pair<String, String>("func_77964_b", "setMetadata"));
- mInitMap.put(new Pair<String, String>("func_77966_a", "addEnchantment"));
- mInitMap.put(new Pair<String, String>("func_77969_a", "isItemEqual"));
- mInitMap.put(new Pair<String, String>("func_77970_a", "areItemStackTagsEqual"));
- mInitMap.put(new Pair<String, String>("func_77972_a", "damageItem"));
- mInitMap.put(new Pair<String, String>("func_77973_b", "getItem"));
- mInitMap.put(new Pair<String, String>("func_77974_b", "onPlayerStoppedUsing"));
- mInitMap.put(new Pair<String, String>("func_77975_n", "getItemUseAction"));
- mInitMap.put(new Pair<String, String>("func_77976_d", "getMaxStackSize"));
- mInitMap.put(new Pair<String, String>("func_77977_a", "getUnlocalizedName"));
- mInitMap.put(new Pair<String, String>("func_77978_p", "getTagCompound"));
- mInitMap.put(new Pair<String, String>("func_77979_a", "splitStack"));
- mInitMap.put(new Pair<String, String>("func_77980_a", "onCrafting"));
- mInitMap.put(new Pair<String, String>("func_77981_g", "getHasSubtypes"));
- mInitMap.put(new Pair<String, String>("func_77982_d", "setTagCompound"));
- mInitMap.put(new Pair<String, String>("func_77983_a", "setTagInfo"));
- mInitMap.put(new Pair<String, String>("func_77984_f", "isItemStackDamageable"));
- mInitMap.put(new Pair<String, String>("func_77985_e", "isStackable"));
- mInitMap.put(new Pair<String, String>("func_77986_q", "getEnchantmentTagList"));
- mInitMap.put(new Pair<String, String>("func_77988_m", "getMaxItemUseDuration"));
- mInitMap.put(new Pair<String, String>("func_77989_b", "areItemStacksEqual"));
- mInitMap.put(new Pair<String, String>("func_77995_e", "getEnchantability"));
- mInitMap.put(new Pair<String, String>("func_77996_d", "getHarvestLevel"));
- mInitMap.put(new Pair<String, String>("func_77997_a", "getMaxUses"));
- mInitMap.put(new Pair<String, String>("func_77998_b", "getEfficiencyOnProperMaterial"));
- mInitMap.put(new Pair<String, String>("func_78000_c", "getDamageVsEntity"));
- mInitMap.put(new Pair<String, String>("func_78013_b", "getTabLabel"));
- mInitMap.put(new Pair<String, String>("func_78014_h", "setNoTitle"));
- mInitMap.put(new Pair<String, String>("func_78015_f", "getBackgroundImageName"));
- mInitMap.put(new Pair<String, String>("func_78016_d", "getTabIconItem"));
- mInitMap.put(new Pair<String, String>("func_78017_i", "shouldHidePlayerInventory"));
- mInitMap.put(new Pair<String, String>("func_78018_a", "displayAllReleventItems"));
- mInitMap.put(new Pair<String, String>("func_78019_g", "drawInForegroundOfTab"));
- mInitMap.put(new Pair<String, String>("func_78020_k", "getTabColumn"));
- mInitMap.put(new Pair<String, String>("func_78021_a", "getTabIndex"));
- mInitMap.put(new Pair<String, String>("func_78022_j", "setNoScrollbar"));
- mInitMap.put(new Pair<String, String>("func_78023_l", "isTabInFirstRow"));
- mInitMap.put(new Pair<String, String>("func_78024_c", "getTranslatedTabLabel"));
- mInitMap.put(new Pair<String, String>("func_78025_a", "setBackgroundImageName"));
- mInitMap.put(new Pair<String, String>("func_78044_b", "getDamageReductionAmount"));
- mInitMap.put(new Pair<String, String>("func_78045_a", "getEnchantability"));
- mInitMap.put(new Pair<String, String>("func_78046_a", "getDurability"));
- mInitMap.put(new Pair<String, String>("func_78084_a", "getTextureOffset"));
- mInitMap.put(new Pair<String, String>("func_78085_a", "setTextureOffset"));
- mInitMap.put(new Pair<String, String>("func_78086_a", "setLivingAnimations"));
- mInitMap.put(new Pair<String, String>("func_78087_a", "setRotationAngles"));
- mInitMap.put(new Pair<String, String>("func_78088_a", "render"));
- mInitMap.put(new Pair<String, String>("func_78110_b", "renderEars"));
- mInitMap.put(new Pair<String, String>("func_78111_c", "renderCloak"));
- mInitMap.put(new Pair<String, String>("func_78164_a", "renderSign"));
- mInitMap.put(new Pair<String, String>("func_78214_a", "updateRotations"));
- mInitMap.put(new Pair<String, String>("func_78231_a", "renderAll"));
- mInitMap.put(new Pair<String, String>("func_78235_a", "flipFace"));
- mInitMap.put(new Pair<String, String>("func_78236_a", "draw"));
- mInitMap.put(new Pair<String, String>("func_78240_a", "setTexturePosition"));
- mInitMap.put(new Pair<String, String>("func_78245_a", "render"));
- mInitMap.put(new Pair<String, String>("func_78255_a", "renderStringAtPos"));
- mInitMap.put(new Pair<String, String>("func_78256_a", "getStringWidth"));
- mInitMap.put(new Pair<String, String>("func_78257_a", "loadGlyphTexture"));
- mInitMap.put(new Pair<String, String>("func_78258_a", "renderString"));
- mInitMap.put(new Pair<String, String>("func_78259_e", "sizeStringToWidth"));
- mInitMap.put(new Pair<String, String>("func_78260_a", "getBidiFlag"));
- mInitMap.put(new Pair<String, String>("func_78261_a", "drawStringWithShadow"));
- mInitMap.put(new Pair<String, String>("func_78262_a", "trimStringToWidth"));
- mInitMap.put(new Pair<String, String>("func_78263_a", "getCharWidth"));
- mInitMap.put(new Pair<String, String>("func_78264_a", "setUnicodeFlag"));
- mInitMap.put(new Pair<String, String>("func_78265_b", "resetStyles"));
- mInitMap.put(new Pair<String, String>("func_78266_a", "renderDefaultChar"));
- mInitMap.put(new Pair<String, String>("func_78267_b", "splitStringWidth"));
- mInitMap.put(new Pair<String, String>("func_78268_b", "renderSplitString"));
- mInitMap.put(new Pair<String, String>("func_78269_a", "trimStringToWidth"));
- mInitMap.put(new Pair<String, String>("func_78270_c", "isFormatSpecial"));
- mInitMap.put(new Pair<String, String>("func_78271_c", "listFormattedStringToWidth"));
- mInitMap.put(new Pair<String, String>("func_78272_b", "isFormatColor"));
- mInitMap.put(new Pair<String, String>("func_78273_d", "trimStringmInitMap.put(newline"));
- mInitMap.put(new Pair<String, String>("func_78274_b", "renderStringAligned"));
- mInitMap.put(new Pair<String, String>("func_78275_b", "setBidiFlag"));
- mInitMap.put(new Pair<String, String>("func_78276_b", "drawString"));
- mInitMap.put(new Pair<String, String>("func_78277_a", "renderUnicodeChar"));
- mInitMap.put(new Pair<String, String>("func_78278_a", "renderCharAtPos"));
- mInitMap.put(new Pair<String, String>("func_78279_b", "drawSplitString"));
- mInitMap.put(new Pair<String, String>("func_78280_d", "wrapFormattedStringToWidth"));
- mInitMap.put(new Pair<String, String>("func_78282_e", "getFormatFromString"));
- mInitMap.put(new Pair<String, String>("func_78324_d", "getScaledHeight_double"));
- mInitMap.put(new Pair<String, String>("func_78325_e", "getScaleFactor"));
- mInitMap.put(new Pair<String, String>("func_78326_a", "getScaledWidth"));
- mInitMap.put(new Pair<String, String>("func_78327_c", "getScaledWidth_double"));
- mInitMap.put(new Pair<String, String>("func_78328_b", "getScaledHeight"));
- mInitMap.put(new Pair<String, String>("func_78369_a", "setColorRGBA_F"));
- mInitMap.put(new Pair<String, String>("func_78370_a", "setColorRGBA"));
- mInitMap.put(new Pair<String, String>("func_78371_b", "startDrawing"));
- mInitMap.put(new Pair<String, String>("func_78372_c", "addTranslation"));
- mInitMap.put(new Pair<String, String>("func_78373_b", "setTranslation"));
- mInitMap.put(new Pair<String, String>("func_78374_a", "addVertexWithUV"));
- mInitMap.put(new Pair<String, String>("func_78375_b", "setNormal"));
- mInitMap.put(new Pair<String, String>("func_78376_a", "setColorOpaque"));
- mInitMap.put(new Pair<String, String>("func_78377_a", "addVertex"));
- mInitMap.put(new Pair<String, String>("func_78378_d", "setColorOpaque_I"));
- mInitMap.put(new Pair<String, String>("func_78379_d", "reset"));
- mInitMap.put(new Pair<String, String>("func_78380_c", "setBrightness"));
- mInitMap.put(new Pair<String, String>("func_78381_a", "draw"));
- mInitMap.put(new Pair<String, String>("func_78382_b", "startDrawingQuads"));
- mInitMap.put(new Pair<String, String>("func_78383_c", "disableColor"));
- mInitMap.put(new Pair<String, String>("func_78384_a", "setColorRGBA_I"));
- mInitMap.put(new Pair<String, String>("func_78385_a", "setTextureUV"));
- mInitMap.put(new Pair<String, String>("func_78386_a", "setColorOpaque_F"));
- mInitMap.put(new Pair<String, String>("func_78418_a", "rendersChunk"));
- mInitMap.put(new Pair<String, String>("func_78419_a", "callLists"));
- mInitMap.put(new Pair<String, String>("func_78420_a", "addGLRenderList"));
- mInitMap.put(new Pair<String, String>("func_78421_b", "resetList"));
- mInitMap.put(new Pair<String, String>("func_78422_a", "setupRenderList"));
- mInitMap.put(new Pair<String, String>("func_78432_a", "parseUserSkin"));
- mInitMap.put(new Pair<String, String>("func_78433_b", "setAreaOpaque"));
- mInitMap.put(new Pair<String, String>("func_78434_a", "setAreaTransparent"));
- mInitMap.put(new Pair<String, String>("func_78435_c", "hasTransparency"));
- mInitMap.put(new Pair<String, String>("func_78439_a", "renderItemIn2D"));
- mInitMap.put(new Pair<String, String>("func_78440_a", "renderItemInFirstPerson"));
- mInitMap.put(new Pair<String, String>("func_78441_a", "updateEquippedItem"));
- mInitMap.put(new Pair<String, String>("func_78442_d", "renderFireInFirstPerson"));
- mInitMap.put(new Pair<String, String>("func_78443_a", "renderItem"));
- mInitMap.put(new Pair<String, String>("func_78444_b", "resetEquippedProgress"));
- mInitMap.put(new Pair<String, String>("func_78445_c", "resetEquippedProgress2"));
- mInitMap.put(new Pair<String, String>("func_78446_a", "renderInsideOfBlock"));
- mInitMap.put(new Pair<String, String>("func_78447_b", "renderOverlays"));
- mInitMap.put(new Pair<String, String>("func_78448_c", "renderWaterOverlayTexture"));
- mInitMap.put(new Pair<String, String>("func_78463_b", "enableLightmap"));
- mInitMap.put(new Pair<String, String>("func_78464_a", "updateRenderer"));
- mInitMap.put(new Pair<String, String>("func_78466_h", "updateFogColor"));
- mInitMap.put(new Pair<String, String>("func_78467_g", "orientCamera"));
- mInitMap.put(new Pair<String, String>("func_78468_a", "setupFog"));
- mInitMap.put(new Pair<String, String>("func_78469_a", "setFogColorBuffer"));
- mInitMap.put(new Pair<String, String>("func_78470_f", "updateTorchFlicker"));
- mInitMap.put(new Pair<String, String>("func_78471_a", "renderWorld"));
- mInitMap.put(new Pair<String, String>("func_78472_g", "updateLightmap"));
- mInitMap.put(new Pair<String, String>("func_78473_a", "getMouseOver"));
- mInitMap.put(new Pair<String, String>("func_78474_d", "renderRainSnow"));
- mInitMap.put(new Pair<String, String>("func_78475_f", "setupViewBobbing"));
- mInitMap.put(new Pair<String, String>("func_78476_b", "renderHand"));
- mInitMap.put(new Pair<String, String>("func_78477_e", "updateFovModifierHand"));
- mInitMap.put(new Pair<String, String>("func_78478_c", "setupOverlayRendering"));
- mInitMap.put(new Pair<String, String>("func_78479_a", "setupCameraTransform"));
- mInitMap.put(new Pair<String, String>("func_78480_b", "updateCameraAndRender"));
- mInitMap.put(new Pair<String, String>("func_78481_a", "getFOVModifier"));
- mInitMap.put(new Pair<String, String>("func_78482_e", "hurtCameraEffect"));
- mInitMap.put(new Pair<String, String>("func_78483_a", "disableLightmap"));
- mInitMap.put(new Pair<String, String>("func_78484_h", "addRainParticles"));
- mInitMap.put(new Pair<String, String>("func_78546_a", "isBoundingBoxInFrustum"));
- mInitMap.put(new Pair<String, String>("func_78547_a", "setPosition"));
- mInitMap.put(new Pair<String, String>("func_78548_b", "isBoxInFrustum"));
- mInitMap.put(new Pair<String, String>("func_78553_b", "isBoxInFrustum"));
- mInitMap.put(new Pair<String, String>("func_78558_a", "getInstance"));
- mInitMap.put(new Pair<String, String>("func_78559_a", "normalize"));
- mInitMap.put(new Pair<String, String>("func_78560_b", "init"));
- mInitMap.put(new Pair<String, String>("func_78713_a", "getEntityRenderObject"));
- mInitMap.put(new Pair<String, String>("func_78714_a", "getDistanceToCamera"));
- mInitMap.put(new Pair<String, String>("func_78715_a", "getEntityClassRenderObject"));
- mInitMap.put(new Pair<String, String>("func_78716_a", "getFontRenderer"));
- mInitMap.put(new Pair<String, String>("func_78717_a", "set"));
- mInitMap.put(new Pair<String, String>("func_78738_b", "createNextComponentRandom"));
- mInitMap.put(new Pair<String, String>("func_78743_b", "clickBlock"));
- mInitMap.put(new Pair<String, String>("func_78744_a", "clickBlockCreative"));
- mInitMap.put(new Pair<String, String>("func_78745_b", "flipPlayer"));
- mInitMap.put(new Pair<String, String>("func_78746_a", "setGameType"));
- mInitMap.put(new Pair<String, String>("func_78747_a", "enableEverythingIsScrewedUpMode"));
- mInitMap.put(new Pair<String, String>("func_78748_a", "setPlayerCapabilities"));
- mInitMap.put(new Pair<String, String>("func_78749_i", "extendedReach"));
- mInitMap.put(new Pair<String, String>("func_78750_j", "syncCurrentPlayItem"));
- mInitMap.put(new Pair<String, String>("func_78751_a", "onPlayerDestroyBlock"));
- mInitMap.put(new Pair<String, String>("func_78752_a", "sendPacketDropItem"));
- mInitMap.put(new Pair<String, String>("func_78753_a", "windowClick"));
- mInitMap.put(new Pair<String, String>("func_78755_b", "shouldDrawHUD"));
- mInitMap.put(new Pair<String, String>("func_78756_a", "sendEnchantPacket"));
- mInitMap.put(new Pair<String, String>("func_78757_d", "getBlockReachDistance"));
- mInitMap.put(new Pair<String, String>("func_78758_h", "isInCreativeMode"));
- mInitMap.put(new Pair<String, String>("func_78759_c", "onPlayerDamageBlock"));
- mInitMap.put(new Pair<String, String>("func_78760_a", "onPlayerRightClick"));
- mInitMap.put(new Pair<String, String>("func_78761_a", "sendSlotPacket"));
- mInitMap.put(new Pair<String, String>("func_78762_g", "isNotCreative"));
- mInitMap.put(new Pair<String, String>("func_78763_f", "gameIsSurvivalOrAdventure"));
- mInitMap.put(new Pair<String, String>("func_78764_a", "attackEntity"));
- mInitMap.put(new Pair<String, String>("func_78765_e", "updateController"));
- mInitMap.put(new Pair<String, String>("func_78766_c", "onStoppedUsingItem"));
- mInitMap.put(new Pair<String, String>("func_78767_c", "resetBlockRemoving"));
- mInitMap.put(new Pair<String, String>("func_78768_b", "interactWithEntitySendPacket"));
- mInitMap.put(new Pair<String, String>("func_78769_a", "sendUseItem"));
- mInitMap.put(new Pair<String, String>("func_78784_a", "setTextureOffset"));
- mInitMap.put(new Pair<String, String>("func_78785_a", "render"));
- mInitMap.put(new Pair<String, String>("func_78786_a", "addBox"));
- mInitMap.put(new Pair<String, String>("func_78787_b", "setTextureSize"));
- mInitMap.put(new Pair<String, String>("func_78788_d", "compileDisplayList"));
- mInitMap.put(new Pair<String, String>("func_78789_a", "addBox"));
- mInitMap.put(new Pair<String, String>("func_78790_a", "addBox"));
- mInitMap.put(new Pair<String, String>("func_78791_b", "renderWithRotation"));
- mInitMap.put(new Pair<String, String>("func_78792_a", "addChild"));
- mInitMap.put(new Pair<String, String>("func_78793_a", "setRotationPoint"));
- mInitMap.put(new Pair<String, String>("func_78794_c", "postRender"));
- mInitMap.put(new Pair<String, String>("func_78815_a", "getRandomComponent"));
- mInitMap.put(new Pair<String, String>("func_78817_b", "getNextMineShaftComponent"));
- mInitMap.put(new Pair<String, String>("func_78836_a", "getNBTCompound"));
- mInitMap.put(new Pair<String, String>("func_78837_a", "getServerDataFromNBTCompound"));
- mInitMap.put(new Pair<String, String>("func_78849_a", "addServerData"));
- mInitMap.put(new Pair<String, String>("func_78850_a", "getServerData"));
- mInitMap.put(new Pair<String, String>("func_78851_b", "removeServerData"));
- mInitMap.put(new Pair<String, String>("func_78853_a", "loadServerList"));
- mInitMap.put(new Pair<String, String>("func_78855_b", "saveServerList"));
- mInitMap.put(new Pair<String, String>("func_78856_c", "countServers"));
- mInitMap.put(new Pair<String, String>("func_78857_a", "swapServers"));
- mInitMap.put(new Pair<String, String>("func_78861_a", "getIP"));
- mInitMap.put(new Pair<String, String>("func_78862_a", "parseIntWithDefault"));
- mInitMap.put(new Pair<String, String>("func_78863_b", "getServerAddress"));
- mInitMap.put(new Pair<String, String>("func_78864_b", "getPort"));
- mInitMap.put(new Pair<String, String>("func_78867_a", "addBlockHitEffects"));
- mInitMap.put(new Pair<String, String>("func_78868_a", "updateEffects"));
- mInitMap.put(new Pair<String, String>("func_78869_b", "getStatistics"));
- mInitMap.put(new Pair<String, String>("func_78870_a", "clearEffects"));
- mInitMap.put(new Pair<String, String>("func_78872_b", "renderLitParticles"));
- mInitMap.put(new Pair<String, String>("func_78873_a", "addEffect"));
- mInitMap.put(new Pair<String, String>("func_78874_a", "renderParticles"));
- mInitMap.put(new Pair<String, String>("func_78879_f", "getCenterY"));
- mInitMap.put(new Pair<String, String>("func_78880_d", "getZSize"));
- mInitMap.put(new Pair<String, String>("func_78881_e", "getCenterX"));
- mInitMap.put(new Pair<String, String>("func_78882_c", "getYSize"));
- mInitMap.put(new Pair<String, String>("func_78883_b", "getXSize"));
- mInitMap.put(new Pair<String, String>("func_78884_a", "intersectsWith"));
- mInitMap.put(new Pair<String, String>("func_78885_a", "intersectsWith"));
- mInitMap.put(new Pair<String, String>("func_78886_a", "offset"));
- mInitMap.put(new Pair<String, String>("func_78887_a", "getmInitMap.put(newBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_78888_b", "expandTo"));
- mInitMap.put(new Pair<String, String>("func_78889_a", "getComponentToAddBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_78890_b", "isVecInside"));
- mInitMap.put(new Pair<String, String>("func_78891_g", "getCenterZ"));
- mInitMap.put(new Pair<String, String>("func_78898_a", "updatePlayerMoveState"));
- mInitMap.put(new Pair<String, String>("func_78904_d", "callOcclusionQueryList"));
- mInitMap.put(new Pair<String, String>("func_78905_g", "setupGLTranslation"));
- mInitMap.put(new Pair<String, String>("func_78906_e", "skipAllRenderPasses"));
- mInitMap.put(new Pair<String, String>("func_78908_a", "updateInFrustum"));
- mInitMap.put(new Pair<String, String>("func_78909_a", "getGLCallListForPass"));
- mInitMap.put(new Pair<String, String>("func_78910_b", "setDontDraw"));
- mInitMap.put(new Pair<String, String>("func_78911_c", "stopRendering"));
- mInitMap.put(new Pair<String, String>("func_78912_a", "distanceToEntitySquared"));
- mInitMap.put(new Pair<String, String>("func_78913_a", "setPosition"));
- mInitMap.put(new Pair<String, String>("func_78914_f", "markDirty"));
- mInitMap.put(new Pair<String, String>("func_80003_ah", "getPlayerUsageSnooper"));
- mInitMap.put(new Pair<String, String>("func_80006_f", "getUniqueID"));
- mInitMap.put(new Pair<String, String>("func_80007_l", "getDimensionName"));
- mInitMap.put(new Pair<String, String>("func_82114_b", "getCommandSenderPosition"));
- mInitMap.put(new Pair<String, String>("func_82141_a", "copyDataFrom"));
- mInitMap.put(new Pair<String, String>("func_82142_c", "setInvisible"));
- mInitMap.put(new Pair<String, String>("func_82143_as", "getMaxFallHeight"));
- mInitMap.put(new Pair<String, String>("func_82145_z", "getMaxInPortalTime"));
- mInitMap.put(new Pair<String, String>("func_82147_ab", "getPortalCooldown"));
- mInitMap.put(new Pair<String, String>("func_82148_at", "getTeleportDirection"));
- mInitMap.put(new Pair<String, String>("func_82149_j", "copyLocationAndAnglesFrom"));
- mInitMap.put(new Pair<String, String>("func_82150_aj", "isInvisible"));
- mInitMap.put(new Pair<String, String>("func_82159_b", "getArmorPosition"));
- mInitMap.put(new Pair<String, String>("func_82160_b", "dropEquipment"));
- mInitMap.put(new Pair<String, String>("func_82161_a", "getArmorItemForSlot"));
- mInitMap.put(new Pair<String, String>("func_82162_bC", "enchantEquipment"));
- mInitMap.put(new Pair<String, String>("func_82164_bB", "addRandomArmor"));
- mInitMap.put(new Pair<String, String>("func_82165_m", "isPotionActive"));
- mInitMap.put(new Pair<String, String>("func_82166_i", "getArmSwingAnimationEnd"));
- mInitMap.put(new Pair<String, String>("func_82167_n", "collideWithEntity"));
- mInitMap.put(new Pair<String, String>("func_82168_bl", "updateArmSwingProgress"));
- mInitMap.put(new Pair<String, String>("func_82169_q", "getCurrentArmor"));
- mInitMap.put(new Pair<String, String>("func_82170_o", "removePotionEffect"));
- mInitMap.put(new Pair<String, String>("func_82171_bF", "canBeSteered"));
- mInitMap.put(new Pair<String, String>("func_82183_n", "getAIControlledByPlayer"));
- mInitMap.put(new Pair<String, String>("func_82185_r", "setCollarColor"));
- mInitMap.put(new Pair<String, String>("func_82186_bH", "getCollarColor"));
- mInitMap.put(new Pair<String, String>("func_82187_q", "setLookingForHome"));
- mInitMap.put(new Pair<String, String>("func_82188_j", "adjustProbability"));
- mInitMap.put(new Pair<String, String>("func_82196_d", "attackEntityWithRangedAttack"));
- mInitMap.put(new Pair<String, String>("func_82197_f", "setAggressive"));
- mInitMap.put(new Pair<String, String>("func_82198_m", "getAggressive"));
- mInitMap.put(new Pair<String, String>("func_82201_a", "setSkeletonType"));
- mInitMap.put(new Pair<String, String>("func_82202_m", "getSkeletonType"));
- mInitMap.put(new Pair<String, String>("func_82203_t", "getWatchedTargetId"));
- mInitMap.put(new Pair<String, String>("func_82205_o", "isArmored"));
- mInitMap.put(new Pair<String, String>("func_82209_a", "launchWitherSkullToCoords"));
- mInitMap.put(new Pair<String, String>("func_82212_n", "getInvulTime"));
- mInitMap.put(new Pair<String, String>("func_82215_s", "setInvulTime"));
- mInitMap.put(new Pair<String, String>("func_82216_a", "launchWitherSkullToEntity"));
- mInitMap.put(new Pair<String, String>("func_82227_f", "setChild"));
- mInitMap.put(new Pair<String, String>("func_82228_a", "startConversion"));
- mInitMap.put(new Pair<String, String>("func_82229_g", "setVillager"));
- mInitMap.put(new Pair<String, String>("func_82230_o", "isConverting"));
- mInitMap.put(new Pair<String, String>("func_82231_m", "isVillager"));
- mInitMap.put(new Pair<String, String>("func_82232_p", "convertToVillager"));
- mInitMap.put(new Pair<String, String>("func_82233_q", "getConversionTimeBoost"));
- mInitMap.put(new Pair<String, String>("func_82235_h", "getIsBatHanging"));
- mInitMap.put(new Pair<String, String>("func_82236_f", "setIsBatHanging"));
- mInitMap.put(new Pair<String, String>("func_82238_cc", "getHideCape"));
- mInitMap.put(new Pair<String, String>("func_82239_b", "setHideCape"));
- mInitMap.put(new Pair<String, String>("func_82241_s", "getHideCape"));
- mInitMap.put(new Pair<String, String>("func_82242_a", "addExperienceLevel"));
- mInitMap.put(new Pair<String, String>("func_82243_bO", "getArmorVisibility"));
- mInitMap.put(new Pair<String, String>("func_82244_d", "displayGUIAnvil"));
- mInitMap.put(new Pair<String, String>("func_82245_bX", "isSpawnForced"));
- mInitMap.put(new Pair<String, String>("func_82246_f", "isCurrentToolAdventureModeExempt"));
- mInitMap.put(new Pair<String, String>("func_82247_a", "canPlayerEdit"));
- mInitMap.put(new Pair<String, String>("func_82328_a", "setDirection"));
- mInitMap.put(new Pair<String, String>("func_82329_d", "getWidthPixels"));
- mInitMap.put(new Pair<String, String>("func_82330_g", "getHeightPixels"));
- mInitMap.put(new Pair<String, String>("func_82333_j", "getRotation"));
- mInitMap.put(new Pair<String, String>("func_82334_a", "setDisplayedItem"));
- mInitMap.put(new Pair<String, String>("func_82335_i", "getDisplayedItem"));
- mInitMap.put(new Pair<String, String>("func_82336_g", "setItemRotation"));
- mInitMap.put(new Pair<String, String>("func_82338_g", "setAlphaF"));
- mInitMap.put(new Pair<String, String>("func_82340_a", "setPotionDamage"));
- mInitMap.put(new Pair<String, String>("func_82341_c", "getMotionFactor"));
- mInitMap.put(new Pair<String, String>("func_82342_d", "isInvulnerable"));
- mInitMap.put(new Pair<String, String>("func_82343_e", "setInvulnerable"));
- mInitMap.put(new Pair<String, String>("func_82356_Z", "isCommandBlockEnabled"));
- mInitMap.put(new Pair<String, String>("func_82357_ak", "getSpawnProtectionSize"));
- mInitMap.put(new Pair<String, String>("func_82358_a", "isUsernameIndex"));
- mInitMap.put(new Pair<String, String>("func_82359_c", "getPlayer"));
- mInitMap.put(new Pair<String, String>("func_82360_a", "getStringFromNthArg"));
- mInitMap.put(new Pair<String, String>("func_82362_a", "getRequiredPermissionLevel"));
- mInitMap.put(new Pair<String, String>("func_82363_b", "parseDouble"));
- mInitMap.put(new Pair<String, String>("func_82366_d", "getGameRules"));
- mInitMap.put(new Pair<String, String>("func_82370_a", "getUsernameIndex"));
- mInitMap.put(new Pair<String, String>("func_82371_e", "getDistanceSquaredToChunkCoordinates"));
- mInitMap.put(new Pair<String, String>("func_82372_a", "getMovementDirection"));
- mInitMap.put(new Pair<String, String>("func_82375_f", "getDefaultMinimumLevel"));
- mInitMap.put(new Pair<String, String>("func_82376_e", "getDefaultMaximumLevel"));
- mInitMap.put(new Pair<String, String>("func_82377_a", "matchesMultiplePlayers"));
- mInitMap.put(new Pair<String, String>("func_82378_b", "hasArguments"));
- mInitMap.put(new Pair<String, String>("func_82379_d", "getDefaultMaximumRange"));
- mInitMap.put(new Pair<String, String>("func_82380_c", "matchPlayers"));
- mInitMap.put(new Pair<String, String>("func_82381_h", "getArgumentMap"));
- mInitMap.put(new Pair<String, String>("func_82382_g", "getDefaultCount"));
- mInitMap.put(new Pair<String, String>("func_82383_a", "hasTheseArguments"));
- mInitMap.put(new Pair<String, String>("func_82384_c", "getDefaultMinimumRange"));
- mInitMap.put(new Pair<String, String>("func_82386_a", "matchOnePlayer"));
- mInitMap.put(new Pair<String, String>("func_82403_a", "renderFrameItemAsBlock"));
- mInitMap.put(new Pair<String, String>("func_82406_b", "renderItemAndEffectIntoGUI"));
- mInitMap.put(new Pair<String, String>("func_82441_a", "renderFirstPersonArm"));
- mInitMap.put(new Pair<String, String>("func_82448_a", "transferEntityToWorld"));
- mInitMap.put(new Pair<String, String>("func_82449_a", "findPlayers"));
- mInitMap.put(new Pair<String, String>("func_82482_a", "dispense"));
- mInitMap.put(new Pair<String, String>("func_82485_a", "playDispenseSound"));
- mInitMap.put(new Pair<String, String>("func_82486_a", "doDispense"));
- mInitMap.put(new Pair<String, String>("func_82487_b", "dispenseStack"));
- mInitMap.put(new Pair<String, String>("func_82489_a", "spawnDispenseParticles"));
- mInitMap.put(new Pair<String, String>("func_82499_a", "getProjectileEntity"));
- mInitMap.put(new Pair<String, String>("func_82565_a", "canEntityStandAt"));
- mInitMap.put(new Pair<String, String>("func_82571_y", "getGeneratorOptions"));
- mInitMap.put(new Pair<String, String>("func_82572_b", "incrementTotalWorldTime"));
- mInitMap.put(new Pair<String, String>("func_82573_f", "getWorldTotalTime"));
- mInitMap.put(new Pair<String, String>("func_82574_x", "getGameRulesInstance"));
- mInitMap.put(new Pair<String, String>("func_82580_o", "removeTag"));
- mInitMap.put(new Pair<String, String>("func_82581_a", "createCrashReport"));
- mInitMap.put(new Pair<String, String>("func_82582_d", "hasNoTags"));
- mInitMap.put(new Pair<String, String>("func_82594_a", "getObject"));
- mInitMap.put(new Pair<String, String>("func_82595_a", "putObject"));
- mInitMap.put(new Pair<String, String>("func_82599_e", "getFrontOffsetZ"));
- mInitMap.put(new Pair<String, String>("func_82600_a", "getFront"));
- mInitMap.put(new Pair<String, String>("func_82601_c", "getFrontOffsetX"));
- mInitMap.put(new Pair<String, String>("func_82615_a", "getX"));
- mInitMap.put(new Pair<String, String>("func_82616_c", "getZ"));
- mInitMap.put(new Pair<String, String>("func_82617_b", "getY"));
- mInitMap.put(new Pair<String, String>("func_82618_k", "getWorld"));
- mInitMap.put(new Pair<String, String>("func_82620_h", "getBlockMetadata"));
- mInitMap.put(new Pair<String, String>("func_82621_f", "getZInt"));
- mInitMap.put(new Pair<String, String>("func_82622_e", "getYInt"));
- mInitMap.put(new Pair<String, String>("func_82623_d", "getXInt"));
- mInitMap.put(new Pair<String, String>("func_82632_g", "boostSpeed"));
- mInitMap.put(new Pair<String, String>("func_82633_h", "isControlledByPlayer"));
- mInitMap.put(new Pair<String, String>("func_82634_f", "isSpeedBoosted"));
- mInitMap.put(new Pair<String, String>("func_82644_b", "getWorldFeatures"));
- mInitMap.put(new Pair<String, String>("func_82647_a", "setBiome"));
- mInitMap.put(new Pair<String, String>("func_82648_a", "getBiome"));
- mInitMap.put(new Pair<String, String>("func_82649_e", "getDefaultFlatGenerator"));
- mInitMap.put(new Pair<String, String>("func_82650_c", "getFlatLayers"));
- mInitMap.put(new Pair<String, String>("func_82651_a", "createFlatGeneratorFromString"));
- mInitMap.put(new Pair<String, String>("func_82656_d", "getMinY"));
- mInitMap.put(new Pair<String, String>("func_82657_a", "getLayerCount"));
- mInitMap.put(new Pair<String, String>("func_82658_c", "getFillBlockMeta"));
- mInitMap.put(new Pair<String, String>("func_82660_d", "setMinY"));
- mInitMap.put(new Pair<String, String>("func_82667_a", "getScatteredFeatureSpawnList"));
- mInitMap.put(new Pair<String, String>("func_82683_b", "setDefaultPlayerReputation"));
- mInitMap.put(new Pair<String, String>("func_82684_a", "getReputationForPlayer"));
- mInitMap.put(new Pair<String, String>("func_82686_i", "isMatingSeason"));
- mInitMap.put(new Pair<String, String>("func_82687_d", "isPlayerReputationTooLow"));
- mInitMap.put(new Pair<String, String>("func_82688_a", "setReputationForPlayer"));
- mInitMap.put(new Pair<String, String>("func_82689_b", "writeVillageDataToNBT"));
- mInitMap.put(new Pair<String, String>("func_82690_a", "readVillageDataFromNBT"));
- mInitMap.put(new Pair<String, String>("func_82692_h", "endMatingSeason"));
- mInitMap.put(new Pair<String, String>("func_82695_e", "recreateStructures"));
- mInitMap.put(new Pair<String, String>("func_82704_a", "isEntityApplicable"));
- mInitMap.put(new Pair<String, String>("func_82705_e", "getAnimal"));
- mInitMap.put(new Pair<String, String>("func_82708_h", "setObjectWatched"));
- mInitMap.put(new Pair<String, String>("func_82709_a", "addObjectByDataType"));
- mInitMap.put(new Pair<String, String>("func_82710_f", "getWatchableObjectItemStack"));
- mInitMap.put(new Pair<String, String>("func_82712_a", "parseDoubleWithDefault"));
- mInitMap.put(new Pair<String, String>("func_82713_a", "parseDoubleWithDefaultAndMax"));
- mInitMap.put(new Pair<String, String>("func_82714_a", "parseIntWithDefaultAndMax"));
- mInitMap.put(new Pair<String, String>("func_82715_a", "parseIntWithDefault"));
- mInitMap.put(new Pair<String, String>("func_82716_a", "getRandomDoubleInRange"));
- mInitMap.put(new Pair<String, String>("func_82719_a", "writeCustomPotionEffectToNBT"));
- mInitMap.put(new Pair<String, String>("func_82720_e", "getIsAmbient"));
- mInitMap.put(new Pair<String, String>("func_82721_a", "setSplashPotion"));
- mInitMap.put(new Pair<String, String>("func_82722_b", "readCustomPotionEffectFromNBT"));
- mInitMap.put(new Pair<String, String>("func_82725_o", "isMagicDamage"));
- mInitMap.put(new Pair<String, String>("func_82726_p", "setMagicDamage"));
- mInitMap.put(new Pair<String, String>("func_82733_a", "selectEntitiesWithinAABB"));
- mInitMap.put(new Pair<String, String>("func_82734_g", "getChunkHeightMapMinimum"));
- mInitMap.put(new Pair<String, String>("func_82736_K", "getGameRules"));
- mInitMap.put(new Pair<String, String>("func_82737_E", "getTotalWorldTime"));
- mInitMap.put(new Pair<String, String>("func_82739_e", "playBroadcastSound"));
- mInitMap.put(new Pair<String, String>("func_82742_i", "resetUpdateEntityTick"));
- mInitMap.put(new Pair<String, String>("func_82743_f", "getCreationCloudUpdateTick"));
- mInitMap.put(new Pair<String, String>("func_82744_b", "setCloudUpdateTick"));
- mInitMap.put(new Pair<String, String>("func_82746_a", "broadcastSound"));
- mInitMap.put(new Pair<String, String>("func_82747_f", "getWorldTypeID"));
- mInitMap.put(new Pair<String, String>("func_82750_a", "setWorldName"));
- mInitMap.put(new Pair<String, String>("func_82752_c", "isAdventure"));
- mInitMap.put(new Pair<String, String>("func_82753_a", "setPriority"));
- mInitMap.put(new Pair<String, String>("func_82756_a", "getGameRuleStringValue"));
- mInitMap.put(new Pair<String, String>("func_82757_a", "setValue"));
- mInitMap.put(new Pair<String, String>("func_82758_b", "getGameRuleBooleanValue"));
- mInitMap.put(new Pair<String, String>("func_82763_b", "getRules"));
- mInitMap.put(new Pair<String, String>("func_82764_b", "setOrCreateGameRule"));
- mInitMap.put(new Pair<String, String>("func_82765_e", "hasRule"));
- mInitMap.put(new Pair<String, String>("func_82766_b", "getGameRuleBooleanValue"));
- mInitMap.put(new Pair<String, String>("func_82767_a", "getGameRuleStringValue"));
- mInitMap.put(new Pair<String, String>("func_82768_a", "readGameRulesFromNBT"));
- mInitMap.put(new Pair<String, String>("func_82769_a", "addGameRule"));
- mInitMap.put(new Pair<String, String>("func_82770_a", "writeGameRulesToNBT"));
- mInitMap.put(new Pair<String, String>("func_82781_a", "getEnchantments"));
- mInitMap.put(new Pair<String, String>("func_82782_a", "setEnchantments"));
- mInitMap.put(new Pair<String, String>("func_82784_g", "isRecipeDisabled"));
- mInitMap.put(new Pair<String, String>("func_82787_a", "findMatchingRecipe"));
- mInitMap.put(new Pair<String, String>("func_82788_x", "canItemEditBlocks"));
- mInitMap.put(new Pair<String, String>("func_82789_a", "getIsRepairable"));
- mInitMap.put(new Pair<String, String>("func_82790_a", "getColorFromItemStack"));
- mInitMap.put(new Pair<String, String>("func_82810_a", "createHangingEntity"));
- mInitMap.put(new Pair<String, String>("func_82812_d", "getArmorMaterial"));
- mInitMap.put(new Pair<String, String>("func_82814_b", "getColor"));
- mInitMap.put(new Pair<String, String>("func_82815_c", "removeColor"));
- mInitMap.put(new Pair<String, String>("func_82816_b_", "hasColor"));
- mInitMap.put(new Pair<String, String>("func_82824_a", "setBossStatus"));
- mInitMap.put(new Pair<String, String>("func_82829_a", "renderCloudsCheck"));
- mInitMap.put(new Pair<String, String>("func_82830_a", "getNightVisionBrightness"));
- mInitMap.put(new Pair<String, String>("func_82833_r", "getDisplayName"));
- mInitMap.put(new Pair<String, String>("func_82835_x", "canEditBlocks"));
- mInitMap.put(new Pair<String, String>("func_82836_z", "getItemFrame"));
- mInitMap.put(new Pair<String, String>("func_82837_s", "hasDisplayName"));
- mInitMap.put(new Pair<String, String>("func_82838_A", "getRepairCost"));
- mInitMap.put(new Pair<String, String>("func_82839_y", "isOnItemFrame"));
- mInitMap.put(new Pair<String, String>("func_82840_a", "getTooltip"));
- mInitMap.put(new Pair<String, String>("func_82841_c", "setRepairCost"));
- mInitMap.put(new Pair<String, String>("func_82842_a", "setItemFrame"));
- mInitMap.put(new Pair<String, String>("func_82846_b", "transferStackInSlot"));
- mInitMap.put(new Pair<String, String>("func_82847_b", "removeCraftingFromCrafters"));
- mInitMap.put(new Pair<String, String>("func_82848_d", "updateRepairOutput"));
- mInitMap.put(new Pair<String, String>("func_82850_a", "updateItemName"));
- mInitMap.put(new Pair<String, String>("func_82869_a", "canTakeStack"));
- mInitMap.put(new Pair<String, String>("func_82870_a", "onPickupFromSlot"));
- mInitMap.put(new Pair<String, String>("func_82877_b", "setPlayerWalkSpeed"));
- mInitMap.put(new Pair<String, String>("func_82879_c", "sendSettingsToServer"));
- mInitMap.put(new Pair<String, String>("func_82883_a", "getUnicodeFlag"));
- mInitMap.put(new Pair<String, String>("func_82889_a", "getBatSize"));
- mInitMap.put(new Pair<String, String>("func_83015_S", "getCurrentDate"));
- mInitMap.put(new Pair<String, String>("func_85029_a", "addEntityCrashInfo"));
- mInitMap.put(new Pair<String, String>("func_85030_a", "playSound"));
- mInitMap.put(new Pair<String, String>("func_85031_j", "hitByEntity"));
- mInitMap.put(new Pair<String, String>("func_85032_ar", "isEntityInvulnerable"));
- mInitMap.put(new Pair<String, String>("func_85033_bc", "collideWithNearbyEntities"));
- mInitMap.put(new Pair<String, String>("func_85034_r", "setArrowCountInEntity"));
- mInitMap.put(new Pair<String, String>("func_85035_bI", "getArrowCountInEntity"));
- mInitMap.put(new Pair<String, String>("func_85036_m", "setCombatTask"));
- mInitMap.put(new Pair<String, String>("func_85039_t", "addScore"));
- mInitMap.put(new Pair<String, String>("func_85040_s", "setScore"));
- mInitMap.put(new Pair<String, String>("func_85052_h", "getThrower"));
- mInitMap.put(new Pair<String, String>("func_85054_d", "searchForOtherItemsNearby"));
- mInitMap.put(new Pair<String, String>("func_85055_a", "makeCrashReport"));
- mInitMap.put(new Pair<String, String>("func_85056_g", "getCategory"));
- mInitMap.put(new Pair<String, String>("func_85057_a", "makeCategoryDepth"));
- mInitMap.put(new Pair<String, String>("func_85058_a", "makeCategory"));
- mInitMap.put(new Pair<String, String>("func_85069_a", "firstTwoElementsOfStackTraceMatch"));
- mInitMap.put(new Pair<String, String>("func_85070_b", "trimStackTraceEntriesFromBottom"));
- mInitMap.put(new Pair<String, String>("func_85071_a", "getLocationInfo"));
- mInitMap.put(new Pair<String, String>("func_85072_a", "appendToStringBuilder"));
- mInitMap.put(new Pair<String, String>("func_85073_a", "getPrunedStackTrace"));
- mInitMap.put(new Pair<String, String>("func_85093_e", "renderArrowsStuckInEntity"));
- mInitMap.put(new Pair<String, String>("func_85094_b", "renderDebugBoundingBox"));
- mInitMap.put(new Pair<String, String>("func_85102_a", "playSoundToNearExcept"));
- mInitMap.put(new Pair<String, String>("func_85118_a", "addToCrashReport"));
- mInitMap.put(new Pair<String, String>("func_85144_b", "getCacheSizes"));
- mInitMap.put(new Pair<String, String>("func_85151_d", "getLowerChestInventory"));
- mInitMap.put(new Pair<String, String>("func_85156_a", "removeTask"));
- mInitMap.put(new Pair<String, String>("func_85157_q", "isAdventureModeExempt"));
- mInitMap.put(new Pair<String, String>("func_85158_p", "setAdventureModeExempt"));
- mInitMap.put(new Pair<String, String>("func_85173_a", "playSoundToNearExcept"));
- mInitMap.put(new Pair<String, String>("func_85176_s", "getDefaultTeleporter"));
- mInitMap.put(new Pair<String, String>("func_85181_a", "getRandomModelBox"));
- mInitMap.put(new Pair<String, String>("func_85182_a", "sameToolAndBlock"));
- mInitMap.put(new Pair<String, String>("func_85187_a", "drawString"));
- mInitMap.put(new Pair<String, String>("func_85188_a", "makePortal"));
- mInitMap.put(new Pair<String, String>("func_85189_a", "removeStalePortalLocations"));
- mInitMap.put(new Pair<String, String>("func_90010_a", "isPartOfLargeChest"));
- mInitMap.put(new Pair<String, String>("func_90011_a", "createChild"));
- mInitMap.put(new Pair<String, String>("func_90013_b", "getDyeFromFleeceColor"));
- mInitMap.put(new Pair<String, String>("func_90014_a", "getDyeBasedOnParents"));
- mInitMap.put(new Pair<String, String>("func_90019_g", "applyRenderColor"));
- mInitMap.put(new Pair<String, String>("func_90020_K", "getLimitFramerate"));
- mInitMap.put(new Pair<String, String>("func_90022_d", "getListOfPlayers"));
- mInitMap.put(new Pair<String, String>("func_90033_f", "canLoadWorld"));
- mInitMap.put(new Pair<String, String>("func_90035_a", "getClassFromID"));
- mInitMap.put(new Pair<String, String>("func_90036_a", "getFireAspectModifier"));
- mInitMap.put(new Pair<String, String>("func_90999_ad", "canRenderOnFire"));
- mInitMap.put(new Pair<String, String>("func_92015_f", "closeScreenNoPacket"));
- mInitMap.put(new Pair<String, String>("func_92034_a", "createParticle"));
- mInitMap.put(new Pair<String, String>("func_92035_a", "createBall"));
- mInitMap.put(new Pair<String, String>("func_92036_a", "createBurst"));
- mInitMap.put(new Pair<String, String>("func_92038_a", "createShaped"));
- mInitMap.put(new Pair<String, String>("func_92043_f", "setTwinkle"));
- mInitMap.put(new Pair<String, String>("func_92044_a", "setColour"));
- mInitMap.put(new Pair<String, String>("func_92045_e", "setTrail"));
- mInitMap.put(new Pair<String, String>("func_92046_g", "setFadeColour"));
- mInitMap.put(new Pair<String, String>("func_92058_a", "setEntityItemStack"));
- mInitMap.put(new Pair<String, String>("func_92059_d", "getEntityItem"));
- mInitMap.put(new Pair<String, String>("func_92085_d", "getIsBlank"));
- mInitMap.put(new Pair<String, String>("func_92087_a", "causeThornsDamage"));
- mInitMap.put(new Pair<String, String>("func_92088_a", "makeFireworks"));
- mInitMap.put(new Pair<String, String>("func_92089_a", "canApply"));
- mInitMap.put(new Pair<String, String>("func_92093_a", "getFireTimeForEntity"));
- mInitMap.put(new Pair<String, String>("func_92097_a", "negateDamage"));
- mInitMap.put(new Pair<String, String>("func_92103_a", "addRecipe"));
- mInitMap.put(new Pair<String, String>("func_92111_a", "getEnchantedItemStack"));
- mInitMap.put(new Pair<String, String>("func_92115_a", "addEnchantment"));
- mInitMap.put(new Pair<String, String>("func_92116_a", "addEnchantmentBooksToList"));
- mInitMap.put(new Pair<String, String>("func_94041_b", "isItemValidForSlot"));
- mInitMap.put(new Pair<String, String>("func_94053_h", "nextTextureIndexX"));
- mInitMap.put(new Pair<String, String>("func_94056_bM", "hasCustomNameTag"));
- mInitMap.put(new Pair<String, String>("func_94057_bL", "getCustomNameTag"));
- mInitMap.put(new Pair<String, String>("func_94058_c", "setCustomNameTag"));
- mInitMap.put(new Pair<String, String>("func_94059_bO", "getAlwaysRenderNameTagForRender"));
- mInitMap.put(new Pair<String, String>("func_94061_f", "setAlwaysRenderNameTag"));
- mInitMap.put(new Pair<String, String>("func_94062_bN", "getAlwaysRenderNameTag"));
- mInitMap.put(new Pair<String, String>("func_94065_a", "drawTexturedModelRectFromIcon"));
- mInitMap.put(new Pair<String, String>("func_94083_c", "getTntPlacedBy"));
- mInitMap.put(new Pair<String, String>("func_94085_r", "getDefaultDisplayTileOffset"));
- mInitMap.put(new Pair<String, String>("func_94086_l", "setDisplayTileOffset"));
- mInitMap.put(new Pair<String, String>("func_94087_l", "getMinecartType"));
- mInitMap.put(new Pair<String, String>("func_94090_a", "createMinecart"));
- mInitMap.put(new Pair<String, String>("func_94092_k", "setDisplayTileData"));
- mInitMap.put(new Pair<String, String>("func_94095_a", "killMinecart"));
- mInitMap.put(new Pair<String, String>("func_94096_e", "setHasDisplayTile"));
- mInitMap.put(new Pair<String, String>("func_94097_p", "getDefaultDisplayTileData"));
- mInitMap.put(new Pair<String, String>("func_94098_o", "getDisplayTileData"));
- mInitMap.put(new Pair<String, String>("func_94099_q", "getDisplayTileOffset"));
- mInitMap.put(new Pair<String, String>("func_94100_s", "hasDisplayTile"));
- mInitMap.put(new Pair<String, String>("func_94101_h", "applyDrag"));
- mInitMap.put(new Pair<String, String>("func_94103_c", "explodeCart"));
- mInitMap.put(new Pair<String, String>("func_94105_c", "ignite"));
- mInitMap.put(new Pair<String, String>("func_94107_f", "setMinecartPowered"));
- mInitMap.put(new Pair<String, String>("func_94108_c", "isMinecartPowered"));
- mInitMap.put(new Pair<String, String>("func_94128_d", "getSlotsForFace"));
- mInitMap.put(new Pair<String, String>("func_94140_a", "registerDestroyBlockIcons"));
- mInitMap.put(new Pair<String, String>("func_94143_a", "updateIcons"));
- mInitMap.put(new Pair<String, String>("func_94148_a", "renderItemOverlayIntoGUI"));
- mInitMap.put(new Pair<String, String>("func_94149_a", "renderIcon"));
- mInitMap.put(new Pair<String, String>("func_94178_a", "updateIcons"));
- mInitMap.put(new Pair<String, String>("func_94182_a", "addSlot"));
- mInitMap.put(new Pair<String, String>("func_94183_a", "getStitchHolder"));
- mInitMap.put(new Pair<String, String>("func_94184_a", "getAllStitchSlots"));
- mInitMap.put(new Pair<String, String>("func_94185_c", "getOriginY"));
- mInitMap.put(new Pair<String, String>("func_94186_b", "getOriginX"));
- mInitMap.put(new Pair<String, String>("func_94194_d", "rotate"));
- mInitMap.put(new Pair<String, String>("func_94195_e", "isRotated"));
- mInitMap.put(new Pair<String, String>("func_94196_a", "setmInitMap.put(newDimension"));
- mInitMap.put(new Pair<String, String>("func_94197_a", "getWidth"));
- mInitMap.put(new Pair<String, String>("func_94199_b", "getHeight"));
- mInitMap.put(new Pair<String, String>("func_94206_g", "getMinV"));
- mInitMap.put(new Pair<String, String>("func_94207_b", "getInterpolatedV"));
- mInitMap.put(new Pair<String, String>("func_94209_e", "getMinU"));
- mInitMap.put(new Pair<String, String>("func_94210_h", "getMaxV"));
- mInitMap.put(new Pair<String, String>("func_94211_a", "getIconWidth"));
- mInitMap.put(new Pair<String, String>("func_94212_f", "getMaxU"));
- mInitMap.put(new Pair<String, String>("func_94214_a", "getInterpolatedU"));
- mInitMap.put(new Pair<String, String>("func_94215_i", "getIconName"));
- mInitMap.put(new Pair<String, String>("func_94216_b", "getIconHeight"));
- mInitMap.put(new Pair<String, String>("func_94217_a", "copyFrom"));
- mInitMap.put(new Pair<String, String>("func_94219_l", "updateAnimation"));
- mInitMap.put(new Pair<String, String>("func_94241_a", "updateCompass"));
- mInitMap.put(new Pair<String, String>("func_94245_a", "registerIcon"));
- mInitMap.put(new Pair<String, String>("func_94248_c", "updateAnimations"));
- mInitMap.put(new Pair<String, String>("func_94277_a", "bindTexture"));
- mInitMap.put(new Pair<String, String>("func_94305_f", "doStitch"));
- mInitMap.put(new Pair<String, String>("func_94309_g", "getStichSlots"));
- mInitMap.put(new Pair<String, String>("func_94310_b", "allocateSlot"));
- mInitMap.put(new Pair<String, String>("func_94311_c", "expandAndAllocateSlot"));
- mInitMap.put(new Pair<String, String>("func_94520_b", "isKeyTranslated"));
- mInitMap.put(new Pair<String, String>("func_94522_b", "canTranslate"));
- mInitMap.put(new Pair<String, String>("func_94525_a", "computeStackSize"));
- mInitMap.put(new Pair<String, String>("func_94526_b", "calcRedstoneFromInventory"));
- mInitMap.put(new Pair<String, String>("func_94527_a", "canAddItemToSlot"));
- mInitMap.put(new Pair<String, String>("func_94528_d", "isValidDragMode"));
- mInitMap.put(new Pair<String, String>("func_94529_b", "extractDragMode"));
- mInitMap.put(new Pair<String, String>("func_94531_b", "canDragIntoSlot"));
- mInitMap.put(new Pair<String, String>("func_94532_c", "getDragEvent"));
- mInitMap.put(new Pair<String, String>("func_94533_d", "resetDrag"));
- mInitMap.put(new Pair<String, String>("func_94539_a", "setExplosionSource"));
- mInitMap.put(new Pair<String, String>("func_94540_d", "setExplosion"));
- mInitMap.put(new Pair<String, String>("func_94541_c", "isExplosion"));
- mInitMap.put(new Pair<String, String>("func_94560_a", "getDamageSrc"));
- mInitMap.put(new Pair<String, String>("func_94572_D", "getStrongestIndirectPower"));
- mInitMap.put(new Pair<String, String>("func_94574_k", "getIndirectPowerOutput"));
- mInitMap.put(new Pair<String, String>("func_94576_a", "getEntitiesWithinAABBExcludingEntity"));
- mInitMap.put(new Pair<String, String>("func_94577_B", "getBlockPowerInput"));
- mInitMap.put(new Pair<String, String>("func_94581_a", "registerIcons"));
- mInitMap.put(new Pair<String, String>("func_94599_c", "getItemIconForUseDuration"));
- mInitMap.put(new Pair<String, String>("func_94602_b", "getBackgroundIcon"));
- mInitMap.put(new Pair<String, String>("func_94608_d", "getItemSpriteNumber"));
- mInitMap.put(new Pair<String, String>("func_94613_c", "getExplosivePlacedBy"));
- mInitMap.put(new Pair<String, String>("func_94901_k", "getSpriteNumber"));
- mInitMap.put(new Pair<String, String>("func_96092_aw", "isPushedByWater"));
- mInitMap.put(new Pair<String, String>("func_96094_a", "setMinecartName"));
- mInitMap.put(new Pair<String, String>("func_96095_a", "onActivatorRailPass"));
- mInitMap.put(new Pair<String, String>("func_96096_ay", "isIgnited"));
- mInitMap.put(new Pair<String, String>("func_96107_aA", "getXPos"));
- mInitMap.put(new Pair<String, String>("func_96108_aC", "getZPos"));
- mInitMap.put(new Pair<String, String>("func_96109_aB", "getYPos"));
- mInitMap.put(new Pair<String, String>("func_96110_f", "setBlocked"));
- mInitMap.put(new Pair<String, String>("func_96111_ay", "getBlocked"));
- mInitMap.put(new Pair<String, String>("func_96120_a", "setEquipmentDropChance"));
- mInitMap.put(new Pair<String, String>("func_96122_a", "canAttackPlayer"));
- mInitMap.put(new Pair<String, String>("func_96123_co", "getWorldScoreboard"));
- mInitMap.put(new Pair<String, String>("func_96124_cp", "getTeam"));
- mInitMap.put(new Pair<String, String>("func_96125_a", "displayGUIHopperMinecart"));
- mInitMap.put(new Pair<String, String>("func_96136_a", "renderScoreboard"));
- mInitMap.put(new Pair<String, String>("func_96290_a", "isBlockProtected"));
- mInitMap.put(new Pair<String, String>("func_96296_a", "getValidValues"));
- mInitMap.put(new Pair<String, String>("func_96297_d", "getFriendlyName"));
- mInitMap.put(new Pair<String, String>("func_96298_a", "getFormattingCode"));
- mInitMap.put(new Pair<String, String>("func_96300_b", "getValueByName"));
- mInitMap.put(new Pair<String, String>("func_96301_b", "isFancyStyling"));
- mInitMap.put(new Pair<String, String>("func_96302_c", "isColor"));
- mInitMap.put(new Pair<String, String>("func_96332_d", "getPlayerName"));
- mInitMap.put(new Pair<String, String>("func_96333_a", "joinNiceStringFromCollection"));
- mInitMap.put(new Pair<String, String>("func_96441_U", "getScoreboard"));
- mInitMap.put(new Pair<String, String>("func_96443_a", "setWorldScoreboard"));
- mInitMap.put(new Pair<String, String>("func_96449_a", "renderOffsetLivingLabel"));
- mInitMap.put(new Pair<String, String>("func_96457_a", "matchesScoreboardCriteria"));
- mInitMap.put(new Pair<String, String>("func_96508_e", "getTeam"));
- mInitMap.put(new Pair<String, String>("func_96509_i", "getPlayersTeam"));
- mInitMap.put(new Pair<String, String>("func_96511_d", "removeTeam"));
- mInitMap.put(new Pair<String, String>("func_96512_b", "removePlayerFromTeam"));
- mInitMap.put(new Pair<String, String>("func_96514_c", "getScoreObjectives"));
- mInitMap.put(new Pair<String, String>("func_96517_b", "getObjectiveDisplaySlot"));
- mInitMap.put(new Pair<String, String>("func_96518_b", "getObjective"));
- mInitMap.put(new Pair<String, String>("func_96523_a", "broadcastTeamCreated"));
- mInitMap.put(new Pair<String, String>("func_96524_g", "removePlayerFromTeams"));
- mInitMap.put(new Pair<String, String>("func_96525_g", "getTeams"));
- mInitMap.put(new Pair<String, String>("func_96526_d", "getObjectiveNames"));
- mInitMap.put(new Pair<String, String>("func_96527_f", "createTeam"));
- mInitMap.put(new Pair<String, String>("func_96529_a", "getValueFromObjective"));
- mInitMap.put(new Pair<String, String>("func_96530_a", "setObjectiveInDisplaySlot"));
- mInitMap.put(new Pair<String, String>("func_96531_f", "getTeamNames"));
- mInitMap.put(new Pair<String, String>("func_96534_i", "getSortedScores"));
- mInitMap.put(new Pair<String, String>("func_96535_a", "addScoreObjective"));
- mInitMap.put(new Pair<String, String>("func_96537_j", "getObjectiveDisplaySlotNumber"));
- mInitMap.put(new Pair<String, String>("func_96538_b", "broadcastTeamRemoved"));
- mInitMap.put(new Pair<String, String>("func_96539_a", "getObjectiveInDisplaySlot"));
- mInitMap.put(new Pair<String, String>("func_96559_d", "getFrontOffsetY"));
- mInitMap.put(new Pair<String, String>("func_96631_a", "attemptDamageItem"));
- mInitMap.put(new Pair<String, String>("func_96636_a", "getName"));
- mInitMap.put(new Pair<String, String>("func_96637_b", "isReadOnly"));
- mInitMap.put(new Pair<String, String>("func_96646_b", "decreaseScore"));
- mInitMap.put(new Pair<String, String>("func_96647_c", "setScorePoints"));
- mInitMap.put(new Pair<String, String>("func_96649_a", "increseScore"));
- mInitMap.put(new Pair<String, String>("func_96650_f", "getScoreScoreboard"));
- mInitMap.put(new Pair<String, String>("func_96652_c", "getScorePoints"));
- mInitMap.put(new Pair<String, String>("func_96653_e", "getPlayerName"));
- mInitMap.put(new Pair<String, String>("func_96660_a", "setAllowFriendlyFire"));
- mInitMap.put(new Pair<String, String>("func_96661_b", "getRegisteredName"));
- mInitMap.put(new Pair<String, String>("func_96662_c", "setNameSuffix"));
- mInitMap.put(new Pair<String, String>("func_96663_f", "getColorSuffix"));
- mInitMap.put(new Pair<String, String>("func_96664_a", "setTeamName"));
- mInitMap.put(new Pair<String, String>("func_96665_g", "getAllowFriendlyFire"));
- mInitMap.put(new Pair<String, String>("func_96666_b", "setNamePrefix"));
- mInitMap.put(new Pair<String, String>("func_96667_a", "formatPlayerName"));
- mInitMap.put(new Pair<String, String>("func_96668_e", "getColorPrefix"));
- mInitMap.put(new Pair<String, String>("func_96670_d", "getMembershipCollection"));
- mInitMap.put(new Pair<String, String>("func_96678_d", "getDisplayName"));
- mInitMap.put(new Pair<String, String>("func_96679_b", "getName"));
- mInitMap.put(new Pair<String, String>("func_96680_c", "getCriteria"));
- mInitMap.put(new Pair<String, String>("func_96681_a", "setDisplayName"));
- mInitMap.put(new Pair<String, String>("func_96682_a", "getScoreboard"));
- mInitMap.put(new Pair<String, String>("func_98034_c", "isInvisibleToPlayer"));
- mInitMap.put(new Pair<String, String>("func_98035_c", "writeMountToNBT"));
- mInitMap.put(new Pair<String, String>("func_98042_n", "setTransferTicker"));
- mInitMap.put(new Pair<String, String>("func_98043_aE", "canTransfer"));
- mInitMap.put(new Pair<String, String>("func_98052_bS", "canPickUpLoot"));
- mInitMap.put(new Pair<String, String>("func_98053_h", "setCanPickUpLoot"));
- mInitMap.put(new Pair<String, String>("func_98054_a", "setScaleForAge"));
- mInitMap.put(new Pair<String, String>("func_98055_j", "setScale"));
- mInitMap.put(new Pair<String, String>("func_98150_a", "getAtlasSprite"));
- mInitMap.put(new Pair<String, String>("func_98152_d", "getAllUsernames"));
- mInitMap.put(new Pair<String, String>("func_98179_a", "computeLightValue"));
- mInitMap.put(new Pair<String, String>("func_98265_a", "spawnEntity"));
- mInitMap.put(new Pair<String, String>("func_98266_d", "getSpawnerZ"));
- mInitMap.put(new Pair<String, String>("func_98268_b", "setDelayToMin"));
- mInitMap.put(new Pair<String, String>("func_98269_i", "getRandomEntity"));
- mInitMap.put(new Pair<String, String>("func_98270_a", "readFromNBT"));
- mInitMap.put(new Pair<String, String>("func_98271_a", "getSpawnerWorld"));
- mInitMap.put(new Pair<String, String>("func_98272_a", "setEntityName"));
- mInitMap.put(new Pair<String, String>("func_98273_j", "resetTimer"));
- mInitMap.put(new Pair<String, String>("func_98274_c", "getSpawnerY"));
- mInitMap.put(new Pair<String, String>("func_98275_b", "getSpawnerX"));
- mInitMap.put(new Pair<String, String>("func_98276_e", "getEntityNameToSpawn"));
- mInitMap.put(new Pair<String, String>("func_98277_a", "setRandomEntity"));
- mInitMap.put(new Pair<String, String>("func_98278_g", "updateSpawner"));
- mInitMap.put(new Pair<String, String>("func_98279_f", "isActivated"));
- mInitMap.put(new Pair<String, String>("func_98280_b", "writeToNBT"));
- mInitMap.put(new Pair<String, String>("func_98281_h", "getEntityToRender"));
- mInitMap.put(new Pair<String, String>("func_98300_b", "setSeeFriendlyInvisiblesEnabled"));
- mInitMap.put(new Pair<String, String>("func_98306_d", "readGlyphSizes"));
- mInitMap.put(new Pair<String, String>("func_99999_d", "run"));
- }
+ private static void init1() {
+ mInitMap.put(new Pair<String, String>("func_100011_g", "getIsPotionDurationMax"));
+ mInitMap.put(new Pair<String, String>("func_100012_b", "setPotionDurationMax"));
+ mInitMap.put(new Pair<String, String>("func_100015_a", "isKeyDown"));
+ mInitMap.put(new Pair<String, String>("func_102007_a", "canInsertItem"));
+ mInitMap.put(new Pair<String, String>("func_102008_b", "canExtractItem"));
+ mInitMap.put(new Pair<String, String>("func_104002_bU", "isNoDespawnRequired"));
+ mInitMap.put(new Pair<String, String>("func_104055_i", "setForceGamemode"));
+ mInitMap.put(new Pair<String, String>("func_104056_am", "getForceGamemode"));
+ mInitMap.put(new Pair<String, String>("func_104112_b", "saveExtraData"));
+ mInitMap.put(new Pair<String, String>("func_104140_m", "saveChunkData"));
+ mInitMap.put(new Pair<String, String>("func_110123_P", "onChunkLoad"));
+ mInitMap.put(new Pair<String, String>("func_110124_au", "getUniqueID"));
+ mInitMap.put(new Pair<String, String>("func_110125_a", "setParticleIcon"));
+ mInitMap.put(new Pair<String, String>("func_110128_b", "onBroken"));
+ mInitMap.put(new Pair<String, String>("func_110130_b", "getKnotForBlock"));
+ mInitMap.put(new Pair<String, String>("func_110131_b", "removeFrameFromMap"));
+ mInitMap.put(new Pair<String, String>("func_110138_aP", "getMaxHealth"));
+ mInitMap.put(new Pair<String, String>("func_110139_bj", "getAbsorptionAmount"));
+ mInitMap.put(new Pair<String, String>("func_110140_aT", "getAttributeMap"));
+ mInitMap.put(new Pair<String, String>("func_110142_aN", "getCombatTracker"));
+ mInitMap.put(new Pair<String, String>("func_110143_aJ", "getHealth"));
+ mInitMap.put(new Pair<String, String>("func_110144_aD", "getLastAttacker"));
+ mInitMap.put(new Pair<String, String>("func_110145_l", "dismountEntity"));
+ mInitMap.put(new Pair<String, String>("func_110147_ax", "applyEntityAttributes"));
+ mInitMap.put(new Pair<String, String>("func_110148_a", "getEntityAttribute"));
+ mInitMap.put(new Pair<String, String>("func_110149_m", "setAbsorptionAmount"));
+ mInitMap.put(new Pair<String, String>("func_110159_bB", "updateLeashedState"));
+ mInitMap.put(new Pair<String, String>("func_110160_i", "clearLeashed"));
+ mInitMap.put(new Pair<String, String>("func_110161_a", "onSpawnWithEgg"));
+ mInitMap.put(new Pair<String, String>("func_110162_b", "setLeashedToEntity"));
+ mInitMap.put(new Pair<String, String>("func_110163_bv", "enablePersistence"));
+ mInitMap.put(new Pair<String, String>("func_110164_bC", "allowLeashing"));
+ mInitMap.put(new Pair<String, String>("func_110165_bF", "recreateLeash"));
+ mInitMap.put(new Pair<String, String>("func_110166_bE", "getLeashedToEntity"));
+ mInitMap.put(new Pair<String, String>("func_110167_bD", "getLeashed"));
+ mInitMap.put(new Pair<String, String>("func_110171_b", "setHomeArea"));
+ mInitMap.put(new Pair<String, String>("func_110172_bL", "getHomePosition"));
+ mInitMap.put(new Pair<String, String>("func_110173_bK", "isWithinHomeDistanceCurrentPosition"));
+ mInitMap.put(new Pair<String, String>("func_110174_bM", "getMaximumHomeDistance"));
+ mInitMap.put(new Pair<String, String>("func_110175_bO", "hasHome"));
+ mInitMap.put(new Pair<String, String>("func_110176_b", "isWithinHomeDistance"));
+ mInitMap.put(new Pair<String, String>("func_110177_bN", "detachHome"));
+ mInitMap.put(new Pair<String, String>("func_110195_a", "addGrowth"));
+ mInitMap.put(new Pair<String, String>("func_110198_t", "increaseTemper"));
+ mInitMap.put(new Pair<String, String>("func_110199_f", "openGUI"));
+ mInitMap.put(new Pair<String, String>("func_110200_cJ", "canMate"));
+ mInitMap.put(new Pair<String, String>("func_110202_bQ", "getHorseVariant"));
+ mInitMap.put(new Pair<String, String>("func_110204_cc", "isEatingHaystack"));
+ mInitMap.put(new Pair<String, String>("func_110206_u", "setJumpPower"));
+ mInitMap.put(new Pair<String, String>("func_110207_m", "setChested"));
+ mInitMap.put(new Pair<String, String>("func_110208_b", "setHorseWatchableBoolean"));
+ mInitMap.put(new Pair<String, String>("func_110209_cd", "isRearing"));
+ mInitMap.put(new Pair<String, String>("func_110212_cp", "getVariantTexturePaths"));
+ mInitMap.put(new Pair<String, String>("func_110214_p", "setHorseType"));
+ mInitMap.put(new Pair<String, String>("func_110215_cj", "getHorseJumpStrength"));
+ mInitMap.put(new Pair<String, String>("func_110216_r", "spawnHorseParticles"));
+ mInitMap.put(new Pair<String, String>("func_110217_cl", "getAngrySoundName"));
+ mInitMap.put(new Pair<String, String>("func_110218_cm", "getMaxTemper"));
+ mInitMap.put(new Pair<String, String>("func_110219_q", "setRearing"));
+ mInitMap.put(new Pair<String, String>("func_110220_cK", "makeHorseRear"));
+ mInitMap.put(new Pair<String, String>("func_110221_n", "setHasReproduced"));
+ mInitMap.put(new Pair<String, String>("func_110222_cv", "isSterile"));
+ mInitMap.put(new Pair<String, String>("func_110223_p", "getRearingAmount"));
+ mInitMap.put(new Pair<String, String>("func_110224_ci", "dropChests"));
+ mInitMap.put(new Pair<String, String>("func_110227_p", "setEatingHaystack"));
+ mInitMap.put(new Pair<String, String>("func_110228_bR", "isAdultHorse"));
+ mInitMap.put(new Pair<String, String>("func_110229_cs", "canCarryChest"));
+ mInitMap.put(new Pair<String, String>("func_110231_cz", "makeHorseRearWithSound"));
+ mInitMap.put(new Pair<String, String>("func_110233_w", "getHorseWatchableBoolean"));
+ mInitMap.put(new Pair<String, String>("func_110234_j", "setHorseTamed"));
+ mInitMap.put(new Pair<String, String>("func_110235_q", "setHorseVariant"));
+ mInitMap.put(new Pair<String, String>("func_110238_s", "setTemper"));
+ mInitMap.put(new Pair<String, String>("func_110240_a", "dropItemsInChest"));
+ mInitMap.put(new Pair<String, String>("func_110243_cf", "getHasReproduced"));
+ mInitMap.put(new Pair<String, String>("func_110244_cA", "dropChestItems"));
+ mInitMap.put(new Pair<String, String>("func_110246_bZ", "isHorseJumping"));
+ mInitMap.put(new Pair<String, String>("func_110247_cG", "setHorseTexturePaths"));
+ mInitMap.put(new Pair<String, String>("func_110248_bS", "isTame"));
+ mInitMap.put(new Pair<String, String>("func_110249_cI", "openHorseMouth"));
+ mInitMap.put(new Pair<String, String>("func_110250_a", "getClosestHorse"));
+ mInitMap.put(new Pair<String, String>("func_110251_o", "setHorseSaddled"));
+ mInitMap.put(new Pair<String, String>("func_110252_cg", "getTemper"));
+ mInitMap.put(new Pair<String, String>("func_110254_bY", "getHorseSize"));
+ mInitMap.put(new Pair<String, String>("func_110255_k", "setHorseJumping"));
+ mInitMap.put(new Pair<String, String>("func_110256_cu", "isUndead"));
+ mInitMap.put(new Pair<String, String>("func_110257_ck", "isHorseSaddled"));
+ mInitMap.put(new Pair<String, String>("func_110258_o", "getGrassEatingAmount"));
+ mInitMap.put(new Pair<String, String>("func_110259_cr", "canWearArmor"));
+ mInitMap.put(new Pair<String, String>("func_110260_d", "getHorseArmorIndex"));
+ mInitMap.put(new Pair<String, String>("func_110261_ca", "isChested"));
+ mInitMap.put(new Pair<String, String>("func_110262_ch", "prepareChunkForSpawn"));
+ mInitMap.put(new Pair<String, String>("func_110263_g", "setTamedBy"));
+ mInitMap.put(new Pair<String, String>("func_110264_co", "getHorseTexture"));
+ mInitMap.put(new Pair<String, String>("func_110265_bP", "getHorseType"));
+ mInitMap.put(new Pair<String, String>("func_110297_a_", "verifySellingItem"));
+ mInitMap.put(new Pair<String, String>("func_110298_a", "displayGUIHorse"));
+ mInitMap.put(new Pair<String, String>("func_110303_q", "getLocationCape"));
+ mInitMap.put(new Pair<String, String>("func_110304_a", "getDownloadImageSkin"));
+ mInitMap.put(new Pair<String, String>("func_110306_p", "getLocationSkin"));
+ mInitMap.put(new Pair<String, String>("func_110311_f", "getLocationSkin"));
+ mInitMap.put(new Pair<String, String>("func_110317_t", "isRidingHorse"));
+ mInitMap.put(new Pair<String, String>("func_110318_g", "sendHorseJump"));
+ mInitMap.put(new Pair<String, String>("func_110319_bJ", "getHorseJumpPower"));
+ mInitMap.put(new Pair<String, String>("func_110322_i", "sendHorseInteraction"));
+ mInitMap.put(new Pair<String, String>("func_110326_a", "setRecordPlaying"));
+ mInitMap.put(new Pair<String, String>("func_110327_a", "renderIcons"));
+ mInitMap.put(new Pair<String, String>("func_110430_a", "setEntityActionState"));
+ mInitMap.put(new Pair<String, String>("func_110432_I", "getSession"));
+ mInitMap.put(new Pair<String, String>("func_110434_K", "getTextureManager"));
+ mInitMap.put(new Pair<String, String>("func_110435_P", "addDefaultResourcePack"));
+ mInitMap.put(new Pair<String, String>("func_110436_a", "refreshResources"));
+ mInitMap.put(new Pair<String, String>("func_110437_J", "getProxy"));
+ mInitMap.put(new Pair<String, String>("func_110438_M", "getResourcePackRepository"));
+ mInitMap.put(new Pair<String, String>("func_110441_Q", "updateDisplayMode"));
+ mInitMap.put(new Pair<String, String>("func_110442_L", "getResourceManager"));
+ mInitMap.put(new Pair<String, String>("func_110454_ao", "getServerProxy"));
+ mInitMap.put(new Pair<String, String>("func_110455_j", "getOpPermissionLevel"));
+ mInitMap.put(new Pair<String, String>("func_110462_b", "getPackFormat"));
+ mInitMap.put(new Pair<String, String>("func_110468_c", "getFrameIndex"));
+ mInitMap.put(new Pair<String, String>("func_110469_d", "getFrameTime"));
+ mInitMap.put(new Pair<String, String>("func_110470_b", "frameHasTime"));
+ mInitMap.put(new Pair<String, String>("func_110471_a", "getFrameHeight"));
+ mInitMap.put(new Pair<String, String>("func_110472_a", "getFrameTimeSingle"));
+ mInitMap.put(new Pair<String, String>("func_110473_c", "getFrameCount"));
+ mInitMap.put(new Pair<String, String>("func_110474_b", "getFrameWidth"));
+ mInitMap.put(new Pair<String, String>("func_110479_a", "getTextureBlur"));
+ mInitMap.put(new Pair<String, String>("func_110480_b", "getTextureClamp"));
+ mInitMap.put(new Pair<String, String>("func_110483_a", "getSectionName"));
+ mInitMap.put(new Pair<String, String>("func_110492_a", "parseAnimationFrame"));
+ mInitMap.put(new Pair<String, String>("func_110495_a", "hasNoTime"));
+ mInitMap.put(new Pair<String, String>("func_110496_c", "getFrameIndex"));
+ mInitMap.put(new Pair<String, String>("func_110497_b", "getFrameTime"));
+ mInitMap.put(new Pair<String, String>("func_110503_a", "parseMetadataSection"));
+ mInitMap.put(new Pair<String, String>("func_110504_a", "registerMetadataSectionType"));
+ mInitMap.put(new Pair<String, String>("func_110505_a", "getGson"));
+ mInitMap.put(new Pair<String, String>("func_110514_c", "getResourcePack"));
+ mInitMap.put(new Pair<String, String>("func_110515_d", "getResourcePackName"));
+ mInitMap.put(new Pair<String, String>("func_110516_a", "updateResourcePack"));
+ mInitMap.put(new Pair<String, String>("func_110517_b", "closeResourcePack"));
+ mInitMap.put(new Pair<String, String>("func_110518_a", "bindTexturePackIcon"));
+ mInitMap.put(new Pair<String, String>("func_110519_e", "getTexturePackDescription"));
+ mInitMap.put(new Pair<String, String>("func_110526_a", "getMetadata"));
+ mInitMap.put(new Pair<String, String>("func_110527_b", "getInputStream"));
+ mInitMap.put(new Pair<String, String>("func_110528_c", "hasMetadata"));
+ mInitMap.put(new Pair<String, String>("func_110536_a", "getResource"));
+ mInitMap.put(new Pair<String, String>("func_110537_b", "getLocationMcmeta"));
+ mInitMap.put(new Pair<String, String>("func_110538_a", "addResourcePack"));
+ mInitMap.put(new Pair<String, String>("func_110541_a", "reloadResources"));
+ mInitMap.put(new Pair<String, String>("func_110542_a", "registerReloadListener"));
+ mInitMap.put(new Pair<String, String>("func_110543_a", "clearResources"));
+ mInitMap.put(new Pair<String, String>("func_110544_b", "notifyReloadListeners"));
+ mInitMap.put(new Pair<String, String>("func_110545_a", "reloadResourcePack"));
+ mInitMap.put(new Pair<String, String>("func_110549_a", "onResourceManagerReload"));
+ mInitMap.put(new Pair<String, String>("func_110550_d", "tick"));
+ mInitMap.put(new Pair<String, String>("func_110551_a", "loadTexture"));
+ mInitMap.put(new Pair<String, String>("func_110552_b", "getGlTextureId"));
+ mInitMap.put(new Pair<String, String>("func_110564_a", "updateDynamicTexture"));
+ mInitMap.put(new Pair<String, String>("func_110565_c", "getTextureData"));
+ mInitMap.put(new Pair<String, String>("func_110569_e", "initMissingImage"));
+ mInitMap.put(new Pair<String, String>("func_110571_b", "loadTextureAtlas"));
+ mInitMap.put(new Pair<String, String>("func_110572_b", "getAtlasSprite"));
+ mInitMap.put(new Pair<String, String>("func_110573_f", "registerIcons"));
+ mInitMap.put(new Pair<String, String>("func_110577_a", "bindTexture"));
+ mInitMap.put(new Pair<String, String>("func_110578_a", "getDynamicTextureLocation"));
+ mInitMap.put(new Pair<String, String>("func_110579_a", "loadTexture"));
+ mInitMap.put(new Pair<String, String>("func_110580_a", "loadTickableTexture"));
+ mInitMap.put(new Pair<String, String>("func_110581_b", "getTexture"));
+ mInitMap.put(new Pair<String, String>("func_110586_a", "getPackImage"));
+ mInitMap.put(new Pair<String, String>("func_110587_b", "getResourceDomains"));
+ mInitMap.put(new Pair<String, String>("func_110589_b", "resourceExists"));
+ mInitMap.put(new Pair<String, String>("func_110590_a", "getInputStream"));
+ mInitMap.put(new Pair<String, String>("func_110591_a", "getInputStreamByName"));
+ mInitMap.put(new Pair<String, String>("func_110592_c", "locationToName"));
+ mInitMap.put(new Pair<String, String>("func_110593_b", "hasResourceName"));
+ mInitMap.put(new Pair<String, String>("func_110594_c", "logNameNotLowercase"));
+ mInitMap.put(new Pair<String, String>("func_110595_a", "getRelativeName"));
+ mInitMap.put(new Pair<String, String>("func_110596_a", "readMetadata"));
+ mInitMap.put(new Pair<String, String>("func_110599_c", "getResourcePackZipFile"));
+ mInitMap.put(new Pair<String, String>("func_110605_c", "getResourceStream"));
+ mInitMap.put(new Pair<String, String>("func_110609_b", "getRepositoryEntriesAll"));
+ mInitMap.put(new Pair<String, String>("func_110611_a", "updateRepositoryEntriesAll"));
+ mInitMap.put(new Pair<String, String>("func_110612_e", "getDirResourcepacks"));
+ mInitMap.put(new Pair<String, String>("func_110613_c", "getRepositoryEntries"));
+ mInitMap.put(new Pair<String, String>("func_110614_g", "getResourcePackFiles"));
+ mInitMap.put(new Pair<String, String>("func_110616_f", "fixDirResourcepacks"));
+ mInitMap.put(new Pair<String, String>("func_110623_a", "getResourcePath"));
+ mInitMap.put(new Pair<String, String>("func_110624_b", "getResourceDomain"));
+ mInitMap.put(new Pair<String, String>("func_110646_a", "getTextWithoutFormattingCodes"));
+ mInitMap.put(new Pair<String, String>("func_110647_a", "getOSType"));
+ mInitMap.put(new Pair<String, String>("func_110661_a", "parseDouble"));
+ mInitMap.put(new Pair<String, String>("func_110662_c", "parseBoolean"));
+ mInitMap.put(new Pair<String, String>("func_110664_a", "parseDouble"));
+ mInitMap.put(new Pair<String, String>("func_110665_a", "clamp_double"));
+ mInitMap.put(new Pair<String, String>("func_110666_a", "clamp_coord"));
+ mInitMap.put(new Pair<String, String>("func_110682_a", "setBoxRotation"));
+ mInitMap.put(new Pair<String, String>("func_110683_a", "updateHorseRotation"));
+ mInitMap.put(new Pair<String, String>("func_110738_j", "isRidingHorse"));
+ mInitMap.put(new Pair<String, String>("func_110775_a", "getEntityTexture"));
+ mInitMap.put(new Pair<String, String>("func_110776_a", "bindTexture"));
+ mInitMap.put(new Pair<String, String>("func_110777_b", "bindEntityTexture"));
+ mInitMap.put(new Pair<String, String>("func_110813_b", "canRenderName"));
+ mInitMap.put(new Pair<String, String>("func_110934_a", "addSprite"));
+ mInitMap.put(new Pair<String, String>("func_110935_a", "getCurrentWidth"));
+ mInitMap.put(new Pair<String, String>("func_110936_b", "getCurrentHeight"));
+ mInitMap.put(new Pair<String, String>("func_110966_b", "setIconWidth"));
+ mInitMap.put(new Pair<String, String>("func_110967_i", "getOriginY"));
+ mInitMap.put(new Pair<String, String>("func_110968_a", "setFramesTextureData"));
+ mInitMap.put(new Pair<String, String>("func_110969_c", "setIconHeight"));
+ mInitMap.put(new Pair<String, String>("func_110970_k", "getFrameCount"));
+ mInitMap.put(new Pair<String, String>("func_110971_a", "initSprite"));
+ mInitMap.put(new Pair<String, String>("func_110985_a", "updateAnaglyph"));
+ mInitMap.put(new Pair<String, String>("func_110986_a", "readImageData"));
+ mInitMap.put(new Pair<String, String>("func_110987_a", "uploadTextureImage"));
+ mInitMap.put(new Pair<String, String>("func_110988_a", "uploadTexture"));
+ mInitMap.put(new Pair<String, String>("func_110989_a", "uploadTextureImageAllocate"));
+ mInitMap.put(new Pair<String, String>("func_110990_a", "copyToBuffer"));
+ mInitMap.put(new Pair<String, String>("func_110991_a", "allocateTexture"));
+ mInitMap.put(new Pair<String, String>("func_110993_a", "uploadTextureImageSubImpl"));
+ mInitMap.put(new Pair<String, String>("func_110994_a", "copyToBufferPos"));
+ mInitMap.put(new Pair<String, String>("func_110995_a", "uploadTextureImageSub"));
+ mInitMap.put(new Pair<String, String>("func_110996_a", "glGenTextures"));
+ mInitMap.put(new Pair<String, String>("func_110997_a", "setTextureClamped"));
+ mInitMap.put(new Pair<String, String>("func_111108_a", "getAttributeUnlocalizedName"));
+ mInitMap.put(new Pair<String, String>("func_111109_a", "clampValue"));
+ mInitMap.put(new Pair<String, String>("func_111110_b", "getDefaultValue"));
+ mInitMap.put(new Pair<String, String>("func_111111_c", "getShouldWatch"));
+ mInitMap.put(new Pair<String, String>("func_111112_a", "setShouldWatch"));
+ mInitMap.put(new Pair<String, String>("func_111116_f", "getDescription"));
+ mInitMap.put(new Pair<String, String>("func_111117_a", "setDescription"));
+ mInitMap.put(new Pair<String, String>("func_111121_a", "applyModifier"));
+ mInitMap.put(new Pair<String, String>("func_111123_a", "getAttribute"));
+ mInitMap.put(new Pair<String, String>("func_111124_b", "removeModifier"));
+ mInitMap.put(new Pair<String, String>("func_111125_b", "getBaseValue"));
+ mInitMap.put(new Pair<String, String>("func_111126_e", "getAttributeValue"));
+ mInitMap.put(new Pair<String, String>("func_111127_a", "getModifier"));
+ mInitMap.put(new Pair<String, String>("func_111128_a", "setBaseValue"));
+ mInitMap.put(new Pair<String, String>("func_111129_g", "computeValue"));
+ mInitMap.put(new Pair<String, String>("func_111130_a", "getModifiersByOperation"));
+ mInitMap.put(new Pair<String, String>("func_111131_f", "flagForUpdate"));
+ mInitMap.put(new Pair<String, String>("func_111145_d", "getWatchableObjectFloat"));
+ mInitMap.put(new Pair<String, String>("func_111146_a", "getAllAttributes"));
+ mInitMap.put(new Pair<String, String>("func_111147_b", "applyAttributeModifiers"));
+ mInitMap.put(new Pair<String, String>("func_111148_a", "removeAttributeModifiers"));
+ mInitMap.put(new Pair<String, String>("func_111149_a", "addAttributeInstance"));
+ mInitMap.put(new Pair<String, String>("func_111150_b", "registerAttribute"));
+ mInitMap.put(new Pair<String, String>("func_111151_a", "getAttributeInstance"));
+ mInitMap.put(new Pair<String, String>("func_111152_a", "getAttributeInstanceByName"));
+ mInitMap.put(new Pair<String, String>("func_111160_c", "getWatchedAttributes"));
+ mInitMap.put(new Pair<String, String>("func_111161_b", "getAttributeInstanceSet"));
+ mInitMap.put(new Pair<String, String>("func_111164_d", "getAmount"));
+ mInitMap.put(new Pair<String, String>("func_111165_e", "isSaved"));
+ mInitMap.put(new Pair<String, String>("func_111166_b", "getName"));
+ mInitMap.put(new Pair<String, String>("func_111167_a", "getID"));
+ mInitMap.put(new Pair<String, String>("func_111168_a", "setSaved"));
+ mInitMap.put(new Pair<String, String>("func_111169_c", "getOperation"));
+ mInitMap.put(new Pair<String, String>("func_111175_f", "getTargetDistance"));
+ mInitMap.put(new Pair<String, String>("func_111184_a", "registerPotionAttributeModifier"));
+ mInitMap.put(new Pair<String, String>("func_111185_a", "applyAttributesModifiersToEntity"));
+ mInitMap.put(new Pair<String, String>("func_111187_a", "removeAttributesModifiersFromEntity"));
+ mInitMap.put(new Pair<String, String>("func_111190_b", "sendMetadataToAllAssociatedPlayers"));
+ mInitMap.put(new Pair<String, String>("func_111194_a", "processChunk"));
+ mInitMap.put(new Pair<String, String>("func_111196_a", "increaseInhabitedTime"));
+ mInitMap.put(new Pair<String, String>("func_111205_h", "getItemAttributeModifiers"));
+ mInitMap.put(new Pair<String, String>("func_111206_d", "setTextureName"));
+ mInitMap.put(new Pair<String, String>("func_111207_a", "itemInteractionForEntity"));
+ mInitMap.put(new Pair<String, String>("func_111208_A", "getIconString"));
+ mInitMap.put(new Pair<String, String>("func_111225_m", "getRelevantEnchantmentTypes"));
+ mInitMap.put(new Pair<String, String>("func_111229_a", "setRelevantEnchantmentTypes"));
+ mInitMap.put(new Pair<String, String>("func_111238_b", "canBeHovered"));
+ mInitMap.put(new Pair<String, String>("func_111257_a", "writeBaseAttributeMapToNBT"));
+ mInitMap.put(new Pair<String, String>("func_111258_a", "applyModifiersToAttributeInstance"));
+ mInitMap.put(new Pair<String, String>("func_111259_a", "readAttributeModifierFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_111261_a", "writeAttributeInstanceToNBT"));
+ mInitMap.put(new Pair<String, String>("func_111262_a", "writeAttributeModifierToNBT"));
+ mInitMap.put(new Pair<String, String>("func_111269_d", "getPathSearchRange"));
+ mInitMap.put(new Pair<String, String>("func_111270_a", "union"));
+ mInitMap.put(new Pair<String, String>("func_111271_a", "getUnicodePageLocation"));
+ mInitMap.put(new Pair<String, String>("func_111272_d", "readFontTexture"));
+ mInitMap.put(new Pair<String, String>("func_111282_a", "interactWithEntity"));
+ mInitMap.put(new Pair<String, String>("func_111283_C", "getAttributeModifiers"));
+ mInitMap.put(new Pair<String, String>("func_111285_a", "getUsername"));
+ mInitMap.put(new Pair<String, String>("func_111286_b", "getSessionID"));
+ mInitMap.put(new Pair<String, String>("func_120011_ar", "setGuiEnabled"));
+ mInitMap.put(new Pair<String, String>("func_120016_a", "createServerGui"));
+ mInitMap.put(new Pair<String, String>("func_120018_d", "getLogComponent"));
+ mInitMap.put(new Pair<String, String>("func_120019_b", "getStatsComponent"));
+ mInitMap.put(new Pair<String, String>("func_120020_c", "getPlayerListComponent"));
+ mInitMap.put(new Pair<String, String>("func_130001_d", "getCurrentMoonPhaseFactor"));
+ mInitMap.put(new Pair<String, String>("func_130002_c", "interactFirst"));
+ mInitMap.put(new Pair<String, String>("func_130010_a", "getOriginX"));
+ mInitMap.put(new Pair<String, String>("func_130011_c", "setLastAttacker"));
+ mInitMap.put(new Pair<String, String>("func_130014_f_", "getEntityWorld"));
+ mInitMap.put(new Pair<String, String>("func_130071_aq", "getCurrentTimeMillis"));
+ mInitMap.put(new Pair<String, String>("func_130072_d", "getAnimationFrame"));
+ mInitMap.put(new Pair<String, String>("func_130073_e", "getFrameIndexSet"));
+ mInitMap.put(new Pair<String, String>("func_130077_b", "getPackName"));
+ mInitMap.put(new Pair<String, String>("func_130086_a", "getTextureType"));
+ mInitMap.put(new Pair<String, String>("func_130087_a", "getResourceLocation"));
+ mInitMap.put(new Pair<String, String>("func_130088_a", "loadTextureMap"));
+ mInitMap.put(new Pair<String, String>("func_130098_m", "hasAnimationMetadata"));
+ mInitMap.put(new Pair<String, String>("func_130099_d", "allocateFrameTextureData"));
+ mInitMap.put(new Pair<String, String>("func_130102_n", "resetSprite"));
+ mInitMap.put(new Pair<String, String>("func_130103_l", "clearFramesTextureData"));
+ mInitMap.put(new Pair<String, String>("func_130105_g", "getMinecraftStartTimeMillis"));
+ mInitMap.put(new Pair<String, String>("func_135016_M", "getLanguageManager"));
+ mInitMap.put(new Pair<String, String>("func_135018_a", "getLanguages"));
+ mInitMap.put(new Pair<String, String>("func_135021_a", "loadLocaleData"));
+ mInitMap.put(new Pair<String, String>("func_135022_a", "loadLocaleDataFiles"));
+ mInitMap.put(new Pair<String, String>("func_135023_a", "formatMessage"));
+ mInitMap.put(new Pair<String, String>("func_135024_b", "checkUnicode"));
+ mInitMap.put(new Pair<String, String>("func_135025_a", "isUnicode"));
+ mInitMap.put(new Pair<String, String>("func_135026_c", "translateKeyPrivate"));
+ mInitMap.put(new Pair<String, String>("func_135028_a", "loadLocaleData"));
+ mInitMap.put(new Pair<String, String>("func_135034_a", "getLanguageCode"));
+ mInitMap.put(new Pair<String, String>("func_135035_b", "isBidirectional"));
+ mInitMap.put(new Pair<String, String>("func_135040_d", "getLanguages"));
+ mInitMap.put(new Pair<String, String>("func_135041_c", "getCurrentLanguage"));
+ mInitMap.put(new Pair<String, String>("func_135042_a", "isCurrentLocaleUnicode"));
+ mInitMap.put(new Pair<String, String>("func_135043_a", "parseLanguageMetadata"));
+ mInitMap.put(new Pair<String, String>("func_135044_b", "isCurrentLanguageBidirectional"));
+ mInitMap.put(new Pair<String, String>("func_135045_a", "setCurrentLanguage"));
+ mInitMap.put(new Pair<String, String>("func_135051_a", "setLocale"));
+ mInitMap.put(new Pair<String, String>("func_135052_a", "format"));
+ mInitMap.put(new Pair<String, String>("func_135055_a", "getResourceDomains"));
+ mInitMap.put(new Pair<String, String>("func_135056_b", "getAllResources"));
+ mInitMap.put(new Pair<String, String>("func_135058_a", "getPackMetadata"));
+ mInitMap.put(new Pair<String, String>("func_135063_a", "replaceWith"));
+ mInitMap.put(new Pair<String, String>("func_135064_c", "tryTranslateKey"));
+ mInitMap.put(new Pair<String, String>("func_140005_i", "switchToRealms"));
+ mInitMap.put(new Pair<String, String>("func_142008_O", "shouldSetPosAfterLoading"));
+ mInitMap.put(new Pair<String, String>("func_142012_a", "isOnTeam"));
+ mInitMap.put(new Pair<String, String>("func_142013_aG", "getLastAttackerTime"));
+ mInitMap.put(new Pair<String, String>("func_142014_c", "isOnSameTeam"));
+ mInitMap.put(new Pair<String, String>("func_142015_aE", "getRevengeTimer"));
+ mInitMap.put(new Pair<String, String>("func_142020_c", "setClientBrand"));
+ mInitMap.put(new Pair<String, String>("func_142021_k", "getClientBrand"));
+ mInitMap.put(new Pair<String, String>("func_142049_d", "removeAllModifiers"));
+ mInitMap.put(new Pair<String, String>("func_142053_d", "formatString"));
+ mInitMap.put(new Pair<String, String>("func_142054_a", "isSameTeam"));
+ mInitMap.put(new Pair<String, String>("func_143004_u", "markPlayerActive"));
+ mInitMap.put(new Pair<String, String>("func_143006_e", "setPlayerIdleTimeout"));
+ mInitMap.put(new Pair<String, String>("func_143007_ar", "getMaxPlayerIdleMinutes"));
+ mInitMap.put(new Pair<String, String>("func_143011_b", "readStructureFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_143012_a", "writeStructureToNBT"));
+ mInitMap.put(new Pair<String, String>("func_143016_a", "registerVillagePieces"));
+ mInitMap.put(new Pair<String, String>("func_143025_a", "getStructureName"));
+ mInitMap.put(new Pair<String, String>("func_143031_a", "registerStructureComponent"));
+ mInitMap.put(new Pair<String, String>("func_143034_b", "registerStructure"));
+ mInitMap.put(new Pair<String, String>("func_143045_a", "registerScatteredFeaturePieces"));
+ mInitMap.put(new Pair<String, String>("func_143046_a", "registerStrongholdPieces"));
+ mInitMap.put(new Pair<String, String>("func_143048_a", "registerStructurePieces"));
+ mInitMap.put(new Pair<String, String>("func_143049_a", "registerNetherFortressPieces"));
+ mInitMap.put(new Pair<String, String>("func_145747_a", "addChatMessage"));
+ mInitMap.put(new Pair<String, String>("func_145748_c_", "getFormattedCommandSenderName"));
+ mInitMap.put(new Pair<String, String>("func_145749_h", "getLastOutput"));
+ mInitMap.put(new Pair<String, String>("func_145752_a", "setCommand"));
+ mInitMap.put(new Pair<String, String>("func_145753_i", "getCustomName"));
+ mInitMap.put(new Pair<String, String>("func_145758_a", "writeDataToNBT"));
+ mInitMap.put(new Pair<String, String>("func_145759_b", "readDataFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_145760_g", "getSuccessCount"));
+ mInitMap.put(new Pair<String, String>("func_145769_d", "setEntityId"));
+ mInitMap.put(new Pair<String, String>("func_145770_h", "isInRangeToRender3d"));
+ mInitMap.put(new Pair<String, String>("func_145771_j", "pushOutOfBlocks"));
+ mInitMap.put(new Pair<String, String>("func_145772_a", "getExplosionResistance"));
+ mInitMap.put(new Pair<String, String>("func_145773_az", "doesEntityNotTriggerPressurePlate"));
+ mInitMap.put(new Pair<String, String>("func_145775_I", "doBlockCollisions"));
+ mInitMap.put(new Pair<String, String>("func_145776_H", "getSwimSound"));
+ mInitMap.put(new Pair<String, String>("func_145777_O", "getSplashSound"));
+ mInitMap.put(new Pair<String, String>("func_145778_a", "dropItemWithOffset"));
+ mInitMap.put(new Pair<String, String>("func_145779_a", "dropItem"));
+ mInitMap.put(new Pair<String, String>("func_145780_a", "playStepSound"));
+ mInitMap.put(new Pair<String, String>("func_145782_y", "getEntityId"));
+ mInitMap.put(new Pair<String, String>("func_145797_a", "setOwner"));
+ mInitMap.put(new Pair<String, String>("func_145798_i", "getOwner"));
+ mInitMap.put(new Pair<String, String>("func_145799_b", "setThrower"));
+ mInitMap.put(new Pair<String, String>("func_145800_j", "getThrower"));
+ mInitMap.put(new Pair<String, String>("func_145805_f", "getBlock"));
+ mInitMap.put(new Pair<String, String>("func_145806_a", "setHurtEntities"));
+ mInitMap.put(new Pair<String, String>("func_145807_e", "getWorldObj"));
+ mInitMap.put(new Pair<String, String>("func_145817_o", "getDefaultDisplayTile"));
+ mInitMap.put(new Pair<String, String>("func_145818_k_", "isCustomInventoryName"));
+ mInitMap.put(new Pair<String, String>("func_145820_n", "getDisplayTile"));
+ mInitMap.put(new Pair<String, String>("func_145825_b", "getInventoryName"));
+ mInitMap.put(new Pair<String, String>("func_145826_a", "addMapping"));
+ mInitMap.put(new Pair<String, String>("func_145827_c", "createAndLoadEntity"));
+ mInitMap.put(new Pair<String, String>("func_145828_a", "addInfoToCrashReport"));
+ mInitMap.put(new Pair<String, String>("func_145829_t", "validate"));
+ mInitMap.put(new Pair<String, String>("func_145830_o", "hasWorldObj"));
+ mInitMap.put(new Pair<String, String>("func_145831_w", "getWorld"));
+ mInitMap.put(new Pair<String, String>("func_145832_p", "getBlockMetadata"));
+ mInitMap.put(new Pair<String, String>("func_145833_n", "getMaxRenderDistanceSquared"));
+ mInitMap.put(new Pair<String, String>("func_145834_a", "setWorldObj"));
+ mInitMap.put(new Pair<String, String>("func_145835_a", "getDistanceSq"));
+ mInitMap.put(new Pair<String, String>("func_145836_u", "updateContainingBlockInfo"));
+ mInitMap.put(new Pair<String, String>("func_145837_r", "isInvalid"));
+ mInitMap.put(new Pair<String, String>("func_145838_q", "getBlockType"));
+ mInitMap.put(new Pair<String, String>("func_145839_a", "readFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_145841_b", "writeToNBT"));
+ mInitMap.put(new Pair<String, String>("func_145842_c", "receiveClientEvent"));
+ mInitMap.put(new Pair<String, String>("func_145843_s", "invalidate"));
+ mInitMap.put(new Pair<String, String>("func_145844_m", "getDescriptionPacket"));
+ mInitMap.put(new Pair<String, String>("func_145845_h", "updateEntity"));
+ mInitMap.put(new Pair<String, String>("func_145861_a", "getStoredBlockID"));
+ mInitMap.put(new Pair<String, String>("func_145864_c", "getPistonOrientation"));
+ mInitMap.put(new Pair<String, String>("func_145866_f", "clearPistonTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_145867_d", "shouldPistonHeadBeRendered"));
+ mInitMap.put(new Pair<String, String>("func_145868_b", "isExtending"));
+ mInitMap.put(new Pair<String, String>("func_145877_a", "changePitch"));
+ mInitMap.put(new Pair<String, String>("func_145878_a", "triggerNote"));
+ mInitMap.put(new Pair<String, String>("func_145888_j", "isOnTransferCooldown"));
+ mInitMap.put(new Pair<String, String>("func_145896_c", "setTransferCooldown"));
+ mInitMap.put(new Pair<String, String>("func_145903_a", "setSkullRotation"));
+ mInitMap.put(new Pair<String, String>("func_145904_a", "getSkullType"));
+ mInitMap.put(new Pair<String, String>("func_145906_b", "getSkullRotation"));
+ mInitMap.put(new Pair<String, String>("func_145913_a", "setEditable"));
+ mInitMap.put(new Pair<String, String>("func_145914_a", "getIsEditable"));
+ mInitMap.put(new Pair<String, String>("func_145934_k", "canBrew"));
+ mInitMap.put(new Pair<String, String>("func_145935_i", "getBrewTime"));
+ mInitMap.put(new Pair<String, String>("func_145938_d", "setBrewTime"));
+ mInitMap.put(new Pair<String, String>("func_145939_j", "getFilledSlots"));
+ mInitMap.put(new Pair<String, String>("func_145940_l", "brewPotions"));
+ mInitMap.put(new Pair<String, String>("func_145948_k", "canSmelt"));
+ mInitMap.put(new Pair<String, String>("func_145949_j", "smeltItem"));
+ mInitMap.put(new Pair<String, String>("func_145950_i", "isBurning"));
+ mInitMap.put(new Pair<String, String>("func_145951_a", "setCustomInventoryName"));
+ mInitMap.put(new Pair<String, String>("func_145952_a", "getItemBurnTime"));
+ mInitMap.put(new Pair<String, String>("func_145953_d", "getCookProgressScaled"));
+ mInitMap.put(new Pair<String, String>("func_145954_b", "isItemFuel"));
+ mInitMap.put(new Pair<String, String>("func_145955_e", "getBurnTimeRemainingScaled"));
+ mInitMap.put(new Pair<String, String>("func_145965_a", "getFlowerPotItem"));
+ mInitMap.put(new Pair<String, String>("func_145966_b", "getFlowerPotData"));
+ mInitMap.put(new Pair<String, String>("func_145976_a", "setCustomName"));
+ mInitMap.put(new Pair<String, String>("func_145977_a", "isSameTypeChestAt"));
+ mInitMap.put(new Pair<String, String>("func_145979_i", "checkForAdjacentChests"));
+ mInitMap.put(new Pair<String, String>("func_145980_j", "getChestType"));
+ mInitMap.put(new Pair<String, String>("func_145995_a", "setOutputSignal"));
+ mInitMap.put(new Pair<String, String>("func_145996_a", "getOutputSignal"));
+ mInitMap.put(new Pair<String, String>("func_145998_l", "getLevels"));
+ mInitMap.put(new Pair<String, String>("func_146001_d", "setPrimaryEffect"));
+ mInitMap.put(new Pair<String, String>("func_146002_i", "shouldBeamRender"));
+ mInitMap.put(new Pair<String, String>("func_146004_e", "setSecondaryEffect"));
+ mInitMap.put(new Pair<String, String>("func_146006_k", "getSecondaryEffect"));
+ mInitMap.put(new Pair<String, String>("func_146007_j", "getPrimaryEffect"));
+ mInitMap.put(new Pair<String, String>("func_146023_a", "getStrVsBlock"));
+ mInitMap.put(new Pair<String, String>("func_146024_c", "getInventorySlotContainItemAndDamage"));
+ mInitMap.put(new Pair<String, String>("func_146026_a", "consumeInventoryItem"));
+ mInitMap.put(new Pair<String, String>("func_146027_a", "clearInventory"));
+ mInitMap.put(new Pair<String, String>("func_146028_b", "hasItem"));
+ mInitMap.put(new Pair<String, String>("func_146029_c", "getInventorySlotContainItem"));
+ mInitMap.put(new Pair<String, String>("func_146030_a", "setCurrentItem"));
+ mInitMap.put(new Pair<String, String>("func_146031_a", "setChestTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_146034_e", "handleHookRetraction"));
+ mInitMap.put(new Pair<String, String>("func_146035_c", "handleHookCasting"));
+ mInitMap.put(new Pair<String, String>("func_146068_u", "getDropItem"));
+ mInitMap.put(new Pair<String, String>("func_146080_bZ", "getCarriedBlock"));
+ mInitMap.put(new Pair<String, String>("func_146081_a", "setCarriedBlock"));
+ mInitMap.put(new Pair<String, String>("func_146082_f", "setInLove"));
+ mInitMap.put(new Pair<String, String>("func_146086_d", "setHorseArmorStack"));
+ mInitMap.put(new Pair<String, String>("func_146094_a", "getUUID"));
+ mInitMap.put(new Pair<String, String>("func_146096_a", "getBreakSpeed"));
+ mInitMap.put(new Pair<String, String>("func_146099_a", "canHarvestBlock"));
+ mInitMap.put(new Pair<String, String>("func_146100_a", "displayGUIEditSign"));
+ mInitMap.put(new Pair<String, String>("func_146103_bH", "getGameProfile"));
+ mInitMap.put(new Pair<String, String>("func_146105_b", "addChatComponentMessage"));
+ mInitMap.put(new Pair<String, String>("func_146107_m", "getStatFileWriter"));
+ mInitMap.put(new Pair<String, String>("func_146110_a", "drawModalRectWithCustomSizedTexture"));
+ mInitMap.put(new Pair<String, String>("func_146111_b", "drawButtonForegroundLayer"));
+ mInitMap.put(new Pair<String, String>("func_146112_a", "drawButton"));
+ mInitMap.put(new Pair<String, String>("func_146113_a", "playPressSound"));
+ mInitMap.put(new Pair<String, String>("func_146114_a", "getHoverState"));
+ mInitMap.put(new Pair<String, String>("func_146115_a", "isMouseOver"));
+ mInitMap.put(new Pair<String, String>("func_146116_c", "mousePressed"));
+ mInitMap.put(new Pair<String, String>("func_146117_b", "getButtonWidth"));
+ mInitMap.put(new Pair<String, String>("func_146118_a", "mouseReleased"));
+ mInitMap.put(new Pair<String, String>("func_146119_b", "mouseDragged"));
+ mInitMap.put(new Pair<String, String>("func_146136_c", "returnEnumOptions"));
+ mInitMap.put(new Pair<String, String>("func_146158_b", "getChatGUI"));
+ mInitMap.put(new Pair<String, String>("func_146159_a", "drawLabel"));
+ mInitMap.put(new Pair<String, String>("func_146160_b", "drawLabelBackground"));
+ mInitMap.put(new Pair<String, String>("func_146175_b", "deleteFromCursor"));
+ mInitMap.put(new Pair<String, String>("func_146176_q", "getVisible"));
+ mInitMap.put(new Pair<String, String>("func_146177_a", "deleteWords"));
+ mInitMap.put(new Pair<String, String>("func_146178_a", "updateCursorCounter"));
+ mInitMap.put(new Pair<String, String>("func_146179_b", "getText"));
+ mInitMap.put(new Pair<String, String>("func_146180_a", "setText"));
+ mInitMap.put(new Pair<String, String>("func_146181_i", "getEnableBackgroundDrawing"));
+ mInitMap.put(new Pair<String, String>("func_146182_d", "moveCursorBy"));
+ mInitMap.put(new Pair<String, String>("func_146183_a", "getNthWordFromPos"));
+ mInitMap.put(new Pair<String, String>("func_146184_c", "setEnabled"));
+ mInitMap.put(new Pair<String, String>("func_146185_a", "setEnableBackgroundDrawing"));
+ mInitMap.put(new Pair<String, String>("func_146186_n", "getSelectionEnd"));
+ mInitMap.put(new Pair<String, String>("func_146187_c", "getNthWordFromCursor"));
+ mInitMap.put(new Pair<String, String>("func_146188_c", "drawCursorVertical"));
+ mInitMap.put(new Pair<String, String>("func_146189_e", "setVisible"));
+ mInitMap.put(new Pair<String, String>("func_146190_e", "setCursorPosition"));
+ mInitMap.put(new Pair<String, String>("func_146191_b", "writeText"));
+ mInitMap.put(new Pair<String, String>("func_146192_a", "mouseClicked"));
+ mInitMap.put(new Pair<String, String>("func_146193_g", "setTextColor"));
+ mInitMap.put(new Pair<String, String>("func_146194_f", "drawTextBox"));
+ mInitMap.put(new Pair<String, String>("func_146195_b", "setFocused"));
+ mInitMap.put(new Pair<String, String>("func_146196_d", "setCursorPositionZero"));
+ mInitMap.put(new Pair<String, String>("func_146198_h", "getCursorPosition"));
+ mInitMap.put(new Pair<String, String>("func_146199_i", "setSelectionPos"));
+ mInitMap.put(new Pair<String, String>("func_146200_o", "getWidth"));
+ mInitMap.put(new Pair<String, String>("func_146201_a", "textboxKeyTyped"));
+ mInitMap.put(new Pair<String, String>("func_146202_e", "setCursorPositionEnd"));
+ mInitMap.put(new Pair<String, String>("func_146203_f", "setMaxStringLength"));
+ mInitMap.put(new Pair<String, String>("func_146204_h", "setDisabledTextColour"));
+ mInitMap.put(new Pair<String, String>("func_146205_d", "setCanLoseFocus"));
+ mInitMap.put(new Pair<String, String>("func_146206_l", "isFocused"));
+ mInitMap.put(new Pair<String, String>("func_146207_c", "getSelectedText"));
+ mInitMap.put(new Pair<String, String>("func_146208_g", "getMaxStringLength"));
+ mInitMap.put(new Pair<String, String>("func_146227_a", "printChatMessage"));
+ mInitMap.put(new Pair<String, String>("func_146228_f", "getChatWidth"));
+ mInitMap.put(new Pair<String, String>("func_146229_b", "scroll"));
+ mInitMap.put(new Pair<String, String>("func_146230_a", "drawChat"));
+ mInitMap.put(new Pair<String, String>("func_146231_a", "clearChatMessages"));
+ mInitMap.put(new Pair<String, String>("func_146232_i", "getLineCount"));
+ mInitMap.put(new Pair<String, String>("func_146233_a", "calculateChatboxWidth"));
+ mInitMap.put(new Pair<String, String>("func_146234_a", "printChatMessageWithOptionalDeletion"));
+ mInitMap.put(new Pair<String, String>("func_146235_b", "formatColors"));
+ mInitMap.put(new Pair<String, String>("func_146236_a", "getChatComponent"));
+ mInitMap.put(new Pair<String, String>("func_146237_a", "setChatLine"));
+ mInitMap.put(new Pair<String, String>("func_146238_c", "getSentMessages"));
+ mInitMap.put(new Pair<String, String>("func_146239_a", "addToSentMessages"));
+ mInitMap.put(new Pair<String, String>("func_146240_d", "resetScroll"));
+ mInitMap.put(new Pair<String, String>("func_146241_e", "getChatOpen"));
+ mInitMap.put(new Pair<String, String>("func_146242_c", "deleteChatLine"));
+ mInitMap.put(new Pair<String, String>("func_146243_b", "calculateChatboxHeight"));
+ mInitMap.put(new Pair<String, String>("func_146244_h", "getChatScale"));
+ mInitMap.put(new Pair<String, String>("func_146245_b", "refreshChat"));
+ mInitMap.put(new Pair<String, String>("func_146246_g", "getChatHeight"));
+ mInitMap.put(new Pair<String, String>("func_146254_a", "updateAchievementWindow"));
+ mInitMap.put(new Pair<String, String>("func_146255_b", "displayUnformattedAchievement"));
+ mInitMap.put(new Pair<String, String>("func_146256_a", "displayAchievement"));
+ mInitMap.put(new Pair<String, String>("func_146257_b", "clearAchievements"));
+ mInitMap.put(new Pair<String, String>("func_146258_c", "updateAchievementWindowScale"));
+ mInitMap.put(new Pair<String, String>("func_146269_k", "handleInput"));
+ mInitMap.put(new Pair<String, String>("func_146270_b", "drawWorldBackground"));
+ mInitMap.put(new Pair<String, String>("func_146271_m", "isCtrlKeyDown"));
+ mInitMap.put(new Pair<String, String>("func_146272_n", "isShiftKeyDown"));
+ mInitMap.put(new Pair<String, String>("func_146273_a", "mouseClickMove"));
+ mInitMap.put(new Pair<String, String>("func_146274_d", "handleMouseInput"));
+ mInitMap.put(new Pair<String, String>("func_146275_d", "setClipboardString"));
+ mInitMap.put(new Pair<String, String>("func_146276_q_", "drawDefaultBackground"));
+ mInitMap.put(new Pair<String, String>("func_146277_j", "getClipboardString"));
+ mInitMap.put(new Pair<String, String>("func_146278_c", "drawBackground"));
+ mInitMap.put(new Pair<String, String>("func_146279_a", "drawCreativeTabHoveringText"));
+ mInitMap.put(new Pair<String, String>("func_146280_a", "setWorldAndResolution"));
+ mInitMap.put(new Pair<String, String>("func_146281_b", "onGuiClosed"));
+ mInitMap.put(new Pair<String, String>("func_146282_l", "handleKeyboardInput"));
+ mInitMap.put(new Pair<String, String>("func_146283_a", "drawHoveringText"));
+ mInitMap.put(new Pair<String, String>("func_146284_a", "actionPerformed"));
+ mInitMap.put(new Pair<String, String>("func_146285_a", "renderToolTip"));
+ mInitMap.put(new Pair<String, String>("func_146286_b", "mouseReleased"));
+ mInitMap.put(new Pair<String, String>("func_146350_a", "setButtonDelay"));
+ mInitMap.put(new Pair<String, String>("func_146358_g", "disableSecurityWarning"));
+ mInitMap.put(new Pair<String, String>("func_146359_e", "copyLinkToClipboard"));
+ mInitMap.put(new Pair<String, String>("func_146367_a", "connect"));
+ mInitMap.put(new Pair<String, String>("func_146402_a", "getSentHistory"));
+ mInitMap.put(new Pair<String, String>("func_146403_a", "submitChatMessage"));
+ mInitMap.put(new Pair<String, String>("func_146404_p_", "autocompletePlayerNames"));
+ mInitMap.put(new Pair<String, String>("func_146405_a", "sendAutocompleteRequest"));
+ mInitMap.put(new Pair<String, String>("func_146406_a", "onAutocompleteResponse"));
+ mInitMap.put(new Pair<String, String>("func_146407_a", "openLink"));
+ mInitMap.put(new Pair<String, String>("func_146418_g", "wakeFromSleep"));
+ mInitMap.put(new Pair<String, String>("func_146456_p", "pageGetCurrent"));
+ mInitMap.put(new Pair<String, String>("func_146457_a", "pageSetCurrent"));
+ mInitMap.put(new Pair<String, String>("func_146459_b", "pageInsertIntoCurrent"));
+ mInitMap.put(new Pair<String, String>("func_146460_c", "keyTypedInTitle"));
+ mInitMap.put(new Pair<String, String>("func_146461_i", "addmInitMap.put(newPage"));
+ mInitMap.put(new Pair<String, String>("func_146462_a", "sendBookToServer"));
+ mInitMap.put(new Pair<String, String>("func_146463_b", "keyTypedInBook"));
+ mInitMap.put(new Pair<String, String>("func_146464_h", "updateButtons"));
+ mInitMap.put(new Pair<String, String>("func_146504_a", "getSoundVolume"));
+ mInitMap.put(new Pair<String, String>("func_146509_g", "doneLoading"));
+ mInitMap.put(new Pair<String, String>("func_146521_a", "drawStatsScreen"));
+ mInitMap.put(new Pair<String, String>("func_146527_c", "drawSprite"));
+ mInitMap.put(new Pair<String, String>("func_146531_b", "drawButtonBackground"));
+ mInitMap.put(new Pair<String, String>("func_146541_h", "createButtons"));
+ mInitMap.put(new Pair<String, String>("func_146552_b", "drawAchievementScreen"));
+ mInitMap.put(new Pair<String, String>("func_146553_h", "drawTitle"));
+ mInitMap.put(new Pair<String, String>("func_146574_g", "sendRespawnPacket"));
+ mInitMap.put(new Pair<String, String>("func_146575_b", "drawWinGameScreen"));
+ mInitMap.put(new Pair<String, String>("func_146586_a", "setDomInitMap.put(neworking"));
+ mInitMap.put(new Pair<String, String>("func_146789_i", "getOldServerPinger"));
+ mInitMap.put(new Pair<String, String>("func_146790_a", "selectServer"));
+ mInitMap.put(new Pair<String, String>("func_146791_a", "connectToServer"));
+ mInitMap.put(new Pair<String, String>("func_146792_q", "refreshServerList"));
+ mInitMap.put(new Pair<String, String>("func_146794_g", "createButtons"));
+ mInitMap.put(new Pair<String, String>("func_146795_p", "getServerList"));
+ mInitMap.put(new Pair<String, String>("func_146796_h", "connectToSelected"));
+ mInitMap.put(new Pair<String, String>("func_146961_a", "hasResourcePackEntry"));
+ mInitMap.put(new Pair<String, String>("func_146975_c", "getSlotAtPosition"));
+ mInitMap.put(new Pair<String, String>("func_146976_a", "drawGuiContainerBackgroundLayer"));
+ mInitMap.put(new Pair<String, String>("func_146977_a", "drawSlot"));
+ mInitMap.put(new Pair<String, String>("func_146978_c", "isPointInRegion"));
+ mInitMap.put(new Pair<String, String>("func_146979_b", "drawGuiContainerForegroundLayer"));
+ mInitMap.put(new Pair<String, String>("func_146980_g", "updateDragSplitting"));
+ mInitMap.put(new Pair<String, String>("func_146981_a", "isMouseOverSlot"));
+ mInitMap.put(new Pair<String, String>("func_146982_a", "drawItemStack"));
+ mInitMap.put(new Pair<String, String>("func_146983_a", "checkHotbarKeys"));
+ mInitMap.put(new Pair<String, String>("func_146984_a", "handleMouseClick"));
+ mInitMap.put(new Pair<String, String>("func_147035_g", "getMerchant"));
+ mInitMap.put(new Pair<String, String>("func_147044_g", "drawActivePotionEffects"));
+ mInitMap.put(new Pair<String, String>("func_147046_a", "drawEntityOnScreen"));
+ mInitMap.put(new Pair<String, String>("func_147050_b", "setCurrentCreativeTab"));
+ mInitMap.put(new Pair<String, String>("func_147052_b", "renderCreativeInventoryHoveringText"));
+ mInitMap.put(new Pair<String, String>("func_147053_i", "updateCreativeSearch"));
+ mInitMap.put(new Pair<String, String>("func_147055_p", "needsScrollBars"));
+ mInitMap.put(new Pair<String, String>("func_147090_g", "renameItem"));
+ mInitMap.put(new Pair<String, String>("func_147095_a", "requestTexturePackLoad"));
+ mInitMap.put(new Pair<String, String>("func_147099_x", "getStatFile"));
+ mInitMap.put(new Pair<String, String>("func_147104_D", "getCurrentServerData"));
+ mInitMap.put(new Pair<String, String>("func_147106_B", "scheduleResourcesRefresh"));
+ mInitMap.put(new Pair<String, String>("func_147107_h", "isFramerateLimitBelowMax"));
+ mInitMap.put(new Pair<String, String>("func_147108_a", "displayGuiScreen"));
+ mInitMap.put(new Pair<String, String>("func_147109_W", "getAmbientMusicType"));
+ mInitMap.put(new Pair<String, String>("func_147110_a", "getFramebuffer"));
+ mInitMap.put(new Pair<String, String>("func_147111_S", "isJava64bit"));
+ mInitMap.put(new Pair<String, String>("func_147112_ai", "middleClickMouse"));
+ mInitMap.put(new Pair<String, String>("func_147113_T", "isGamePaused"));
+ mInitMap.put(new Pair<String, String>("func_147114_u", "getNetHandler"));
+ mInitMap.put(new Pair<String, String>("func_147115_a", "sendClickBlockToController"));
+ mInitMap.put(new Pair<String, String>("func_147116_af", "clickMouse"));
+ mInitMap.put(new Pair<String, String>("func_147117_R", "getTextureMapBlocks"));
+ mInitMap.put(new Pair<String, String>("func_147118_V", "getSoundHandler"));
+ mInitMap.put(new Pair<String, String>("func_147119_ah", "updateFramebufferSize"));
+ mInitMap.put(new Pair<String, String>("func_147120_f", "resetSize"));
+ mInitMap.put(new Pair<String, String>("func_147121_ag", "rightClickMouse"));
+ mInitMap.put(new Pair<String, String>("func_147122_X", "isJvm64bit"));
+ mInitMap.put(new Pair<String, String>("func_147130_as", "getMinecraftSessionService"));
+ mInitMap.put(new Pair<String, String>("func_147132_au", "refreshStatusNextTick"));
+ mInitMap.put(new Pair<String, String>("func_147133_T", "getTexturePack"));
+ mInitMap.put(new Pair<String, String>("func_147134_at", "getServerStatusResponse"));
+ mInitMap.put(new Pair<String, String>("func_147135_j", "getDifficulty"));
+ mInitMap.put(new Pair<String, String>("func_147136_ar", "isAnnouncingPlayerAchievements"));
+ mInitMap.put(new Pair<String, String>("func_147137_ag", "getNetworkSystem"));
+ mInitMap.put(new Pair<String, String>("func_147138_a", "addFaviconToStatusResponse"));
+ mInitMap.put(new Pair<String, String>("func_147139_a", "setDifficultyForAllWorlds"));
+ mInitMap.put(new Pair<String, String>("func_147149_a", "saveToFile"));
+ mInitMap.put(new Pair<String, String>("func_147153_a", "addBlockInfo"));
+ mInitMap.put(new Pair<String, String>("func_147155_a", "getCategoryName"));
+ mInitMap.put(new Pair<String, String>("func_147156_b", "getCategoryId"));
+ mInitMap.put(new Pair<String, String>("func_147176_a", "getChatComponentFromNthArg"));
+ mInitMap.put(new Pair<String, String>("func_147177_a", "joinNiceString"));
+ mInitMap.put(new Pair<String, String>("func_147178_a", "getChatComponentFromNthArg"));
+ mInitMap.put(new Pair<String, String>("func_147179_f", "getItemByText"));
+ mInitMap.put(new Pair<String, String>("func_147180_g", "getBlockByText"));
+ mInitMap.put(new Pair<String, String>("func_147185_d", "addTeam"));
+ mInitMap.put(new Pair<String, String>("func_147186_g", "listTeams"));
+ mInitMap.put(new Pair<String, String>("func_147187_n", "resetPlayers"));
+ mInitMap.put(new Pair<String, String>("func_147188_j", "emptyTeam"));
+ mInitMap.put(new Pair<String, String>("func_147190_h", "joinTeam"));
+ mInitMap.put(new Pair<String, String>("func_147191_h", "removeObjective"));
+ mInitMap.put(new Pair<String, String>("func_147192_d", "getScoreboard"));
+ mInitMap.put(new Pair<String, String>("func_147193_c", "addObjective"));
+ mInitMap.put(new Pair<String, String>("func_147194_f", "removeTeam"));
+ mInitMap.put(new Pair<String, String>("func_147195_l", "listPlayers"));
+ mInitMap.put(new Pair<String, String>("func_147196_d", "listObjectives"));
+ mInitMap.put(new Pair<String, String>("func_147197_m", "setPlayer"));
+ mInitMap.put(new Pair<String, String>("func_147198_k", "setObjectiveDisplay"));
+ mInitMap.put(new Pair<String, String>("func_147199_i", "leaveTeam"));
+ mInitMap.put(new Pair<String, String>("func_147200_e", "setTeamOption"));
+ mInitMap.put(new Pair<String, String>("func_147215_a", "addBlockDestroyEffects"));
+ mInitMap.put(new Pair<String, String>("func_147223_a", "pingPendingNetworks"));
+ mInitMap.put(new Pair<String, String>("func_147224_a", "ping"));
+ mInitMap.put(new Pair<String, String>("func_147225_b", "tryCompatibilityPing"));
+ mInitMap.put(new Pair<String, String>("func_147226_b", "clearPendingNetworks"));
+ mInitMap.put(new Pair<String, String>("func_147231_a", "onDisconnect"));
+ mInitMap.put(new Pair<String, String>("func_147232_a", "onConnectionStateTransition"));
+ mInitMap.put(new Pair<String, String>("func_147233_a", "onNetworkTick"));
+ mInitMap.put(new Pair<String, String>("func_147234_a", "handleBlockChange"));
+ mInitMap.put(new Pair<String, String>("func_147235_a", "handleSpawnObject"));
+ mInitMap.put(new Pair<String, String>("func_147236_a", "handleEntityStatus"));
+ mInitMap.put(new Pair<String, String>("func_147237_a", "handleSpawnPlayer"));
+ mInitMap.put(new Pair<String, String>("func_147238_a", "handleDestroyEntities"));
+ mInitMap.put(new Pair<String, String>("func_147239_a", "handleConfirmTransaction"));
+ mInitMap.put(new Pair<String, String>("func_147240_a", "handleCustomPayload"));
+ mInitMap.put(new Pair<String, String>("func_147241_a", "handleWindowItems"));
+ mInitMap.put(new Pair<String, String>("func_147242_a", "handleEntityEquipment"));
+ mInitMap.put(new Pair<String, String>("func_147243_a", "handleEntityAttach"));
+ mInitMap.put(new Pair<String, String>("func_147244_a", "handleEntityVelocity"));
+ mInitMap.put(new Pair<String, String>("func_147245_a", "handleWindowProperty"));
+ mInitMap.put(new Pair<String, String>("func_147246_a", "handleCollectItem"));
+ mInitMap.put(new Pair<String, String>("func_147247_a", "handleTeams"));
+ mInitMap.put(new Pair<String, String>("func_147248_a", "handleUpdateSign"));
+ mInitMap.put(new Pair<String, String>("func_147249_a", "handleUpdateHealth"));
+ mInitMap.put(new Pair<String, String>("func_147250_a", "handleUpdateScore"));
+ mInitMap.put(new Pair<String, String>("func_147251_a", "handleChat"));
+ mInitMap.put(new Pair<String, String>("func_147252_a", "handleChangeGameState"));
+ mInitMap.put(new Pair<String, String>("func_147253_a", "handleDisconnect"));
+ mInitMap.put(new Pair<String, String>("func_147254_a", "handleDisplayScoreboard"));
+ mInitMap.put(new Pair<String, String>("func_147255_a", "handleSoundEffect"));
+ mInitMap.put(new Pair<String, String>("func_147256_a", "handlePlayerListItem"));
+ mInitMap.put(new Pair<String, String>("func_147257_a", "handleHeldItemChange"));
+ mInitMap.put(new Pair<String, String>("func_147258_a", "handlePlayerPosLook"));
+ mInitMap.put(new Pair<String, String>("func_147259_a", "handleEntityMovement"));
+ mInitMap.put(new Pair<String, String>("func_147260_a", "handleEntityEffect"));
+ mInitMap.put(new Pair<String, String>("func_147261_a", "handleBlockAction"));
+ mInitMap.put(new Pair<String, String>("func_147262_a", "handleRemoveEntityEffect"));
+ mInitMap.put(new Pair<String, String>("func_147263_a", "handleChunkData"));
+ mInitMap.put(new Pair<String, String>("func_147264_a", "handleMaps"));
+ mInitMap.put(new Pair<String, String>("func_147265_a", "handleOpenWindow"));
+ mInitMap.put(new Pair<String, String>("func_147266_a", "handleSetSlot"));
+ mInitMap.put(new Pair<String, String>("func_147267_a", "handleEntityHeadLook"));
+ mInitMap.put(new Pair<String, String>("func_147268_a", "handleSignEditorOpen"));
+ mInitMap.put(new Pair<String, String>("func_147269_a", "handleMapChunkBulk"));
+ mInitMap.put(new Pair<String, String>("func_147270_a", "handlePlayerAbilities"));
+ mInitMap.put(new Pair<String, String>("func_147271_a", "handleSpawnPosition"));
+ mInitMap.put(new Pair<String, String>("func_147272_a", "handleKeepAlive"));
+ mInitMap.put(new Pair<String, String>("func_147273_a", "handleUpdateTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_147274_a", "handleTabComplete"));
+ mInitMap.put(new Pair<String, String>("func_147275_a", "handleEntityTeleport"));
+ mInitMap.put(new Pair<String, String>("func_147276_a", "handleCloseWindow"));
+ mInitMap.put(new Pair<String, String>("func_147277_a", "handleEffect"));
+ mInitMap.put(new Pair<String, String>("func_147278_a", "handleUseBed"));
+ mInitMap.put(new Pair<String, String>("func_147279_a", "handleAnimation"));
+ mInitMap.put(new Pair<String, String>("func_147280_a", "handleRespawn"));
+ mInitMap.put(new Pair<String, String>("func_147281_a", "handleSpawnMob"));
+ mInitMap.put(new Pair<String, String>("func_147282_a", "handleJoinGame"));
+ mInitMap.put(new Pair<String, String>("func_147283_a", "handleExplosion"));
+ mInitMap.put(new Pair<String, String>("func_147284_a", "handleEntityMetadata"));
+ mInitMap.put(new Pair<String, String>("func_147285_a", "handleTimeUpdate"));
+ mInitMap.put(new Pair<String, String>("func_147286_a", "handleSpawnExperienceOrb"));
+ mInitMap.put(new Pair<String, String>("func_147287_a", "handleMultiBlockChange"));
+ mInitMap.put(new Pair<String, String>("func_147288_a", "handleSpawnPainting"));
+ mInitMap.put(new Pair<String, String>("func_147289_a", "handleParticles"));
+ mInitMap.put(new Pair<String, String>("func_147290_a", "handleEntityProperties"));
+ mInitMap.put(new Pair<String, String>("func_147291_a", "handleScoreboardObjective"));
+ mInitMap.put(new Pair<String, String>("func_147292_a", "handleSpawnGlobalEntity"));
+ mInitMap.put(new Pair<String, String>("func_147293_a", "handleStatistics"));
+ mInitMap.put(new Pair<String, String>("func_147294_a", "handleBlockBreakAnim"));
+ mInitMap.put(new Pair<String, String>("func_147295_a", "handleSetExperience"));
+ mInitMap.put(new Pair<String, String>("func_147296_c", "cleanup"));
+ mInitMap.put(new Pair<String, String>("func_147297_a", "addToSendQueue"));
+ mInitMap.put(new Pair<String, String>("func_147298_b", "getNetworkManager"));
+ mInitMap.put(new Pair<String, String>("func_147311_a", "processPing"));
+ mInitMap.put(new Pair<String, String>("func_147312_a", "processServerQuery"));
+ mInitMap.put(new Pair<String, String>("func_147315_a", "processEncryptionResponse"));
+ mInitMap.put(new Pair<String, String>("func_147316_a", "processLoginStart"));
+ mInitMap.put(new Pair<String, String>("func_147322_a", "closeConnection"));
+ mInitMap.put(new Pair<String, String>("func_147338_a", "processEnchantItem"));
+ mInitMap.put(new Pair<String, String>("func_147339_a", "processConfirmTransaction"));
+ mInitMap.put(new Pair<String, String>("func_147340_a", "processUseEntity"));
+ mInitMap.put(new Pair<String, String>("func_147341_a", "processTabComplete"));
+ mInitMap.put(new Pair<String, String>("func_147342_a", "processClientStatus"));
+ mInitMap.put(new Pair<String, String>("func_147343_a", "processUpdateSign"));
+ mInitMap.put(new Pair<String, String>("func_147344_a", "processCreativeInventoryAction"));
+ mInitMap.put(new Pair<String, String>("func_147345_a", "processPlayerDigging"));
+ mInitMap.put(new Pair<String, String>("func_147346_a", "processPlayerBlockPlacement"));
+ mInitMap.put(new Pair<String, String>("func_147347_a", "processPlayer"));
+ mInitMap.put(new Pair<String, String>("func_147348_a", "processPlayerAbilities"));
+ mInitMap.put(new Pair<String, String>("func_147349_a", "processVanilla250Packet"));
+ mInitMap.put(new Pair<String, String>("func_147350_a", "processAnimation"));
+ mInitMap.put(new Pair<String, String>("func_147351_a", "processClickWindow"));
+ mInitMap.put(new Pair<String, String>("func_147352_a", "processClientSettings"));
+ mInitMap.put(new Pair<String, String>("func_147353_a", "processKeepAlive"));
+ mInitMap.put(new Pair<String, String>("func_147354_a", "processChatMessage"));
+ mInitMap.put(new Pair<String, String>("func_147355_a", "processHeldItemChange"));
+ mInitMap.put(new Pair<String, String>("func_147356_a", "processCloseWindow"));
+ mInitMap.put(new Pair<String, String>("func_147357_a", "processEntityAction"));
+ mInitMap.put(new Pair<String, String>("func_147358_a", "processInput"));
+ mInitMap.put(new Pair<String, String>("func_147359_a", "sendPacket"));
+ mInitMap.put(new Pair<String, String>("func_147360_c", "kickPlayerFromServer"));
+ mInitMap.put(new Pair<String, String>("func_147361_d", "handleSlashCommand"));
+ mInitMap.put(new Pair<String, String>("func_147362_b", "getNetworkManager"));
+ mInitMap.put(new Pair<String, String>("func_147363_d", "currentTimeMillis"));
+ mInitMap.put(new Pair<String, String>("func_147364_a", "setPlayerLocation"));
+ mInitMap.put(new Pair<String, String>("func_147383_a", "processHandshake"));
+ mInitMap.put(new Pair<String, String>("func_147388_a", "handleDisconnect"));
+ mInitMap.put(new Pair<String, String>("func_147389_a", "handleEncryptionRequest"));
+ mInitMap.put(new Pair<String, String>("func_147390_a", "handleLoginSuccess"));
+ mInitMap.put(new Pair<String, String>("func_147397_a", "handleServerInfo"));
+ mInitMap.put(new Pair<String, String>("func_147398_a", "handlePong"));
+ mInitMap.put(new Pair<String, String>("func_147407_a", "setBase64EncodedIconData"));
+ mInitMap.put(new Pair<String, String>("func_147409_e", "getBase64EncodedIconData"));
+ mInitMap.put(new Pair<String, String>("func_147416_a", "findClosestStructure"));
+ mInitMap.put(new Pair<String, String>("func_147422_a", "replaceBlocksForBiome"));
+ mInitMap.put(new Pair<String, String>("func_147437_c", "isAirBlock"));
+ mInitMap.put(new Pair<String, String>("func_147438_o", "getTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_147439_a", "getBlock"));
+ mInitMap.put(new Pair<String, String>("func_147440_b", "findClosestStructure"));
+ mInitMap.put(new Pair<String, String>("func_147441_b", "notifyBlocksOfNeighborChange"));
+ mInitMap.put(new Pair<String, String>("func_147442_i", "setThunderStrength"));
+ mInitMap.put(new Pair<String, String>("func_147443_d", "destroyBlockInWorldPartially"));
+ mInitMap.put(new Pair<String, String>("func_147444_c", "notifyBlockChange"));
+ mInitMap.put(new Pair<String, String>("func_147445_c", "isBlockNormalCubeDefault"));
+ mInitMap.put(new Pair<String, String>("func_147447_a", "rayTraceBlocks"));
+ mInitMap.put(new Pair<String, String>("func_147449_b", "setBlock"));
+ mInitMap.put(new Pair<String, String>("func_147451_t", "updateAllLightTypes"));
+ mInitMap.put(new Pair<String, String>("func_147452_c", "addBlockEvent"));
+ mInitMap.put(new Pair<String, String>("func_147453_f", "updateNeighborsAboutBlockChange"));
+ mInitMap.put(new Pair<String, String>("func_147454_a", "scheduleBlockUpdateWithPriority"));
+ mInitMap.put(new Pair<String, String>("func_147455_a", "setTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_147457_a", "markTileEntityForRemoval"));
+ mInitMap.put(new Pair<String, String>("func_147458_c", "markBlockRangeForRenderUpdate"));
+ mInitMap.put(new Pair<String, String>("func_147459_d", "notifyBlocksOfNeighborChange"));
+ mInitMap.put(new Pair<String, String>("func_147460_e", "notifyBlockOfNeighborChange"));
+ mInitMap.put(new Pair<String, String>("func_147462_b", "getTensionFactorForBlock"));
+ mInitMap.put(new Pair<String, String>("func_147463_c", "updateLightByType"));
+ mInitMap.put(new Pair<String, String>("func_147464_a", "scheduleBlockUpdate"));
+ mInitMap.put(new Pair<String, String>("func_147465_d", "setBlock"));
+ mInitMap.put(new Pair<String, String>("func_147466_a", "doesBlockHaveSolidTopSurface"));
+ mInitMap.put(new Pair<String, String>("func_147468_f", "setBlockToAir"));
+ mInitMap.put(new Pair<String, String>("func_147469_q", "isBlockFullCube"));
+ mInitMap.put(new Pair<String, String>("func_147471_g", "markBlockForUpdate"));
+ mInitMap.put(new Pair<String, String>("func_147472_a", "canPlaceEntityOnSide"));
+ mInitMap.put(new Pair<String, String>("func_147474_b", "getTopBlock"));
+ mInitMap.put(new Pair<String, String>("func_147475_p", "removeTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_147476_b", "markTileEntityChunkModified"));
+ mInitMap.put(new Pair<String, String>("func_147477_a", "isBlockTickScheduledThisTick"));
+ mInitMap.put(new Pair<String, String>("func_147478_e", "canSnowAt"));
+ mInitMap.put(new Pair<String, String>("func_147479_m", "markBlockForRenderUpdate"));
+ mInitMap.put(new Pair<String, String>("func_147480_a", "breakBlock"));
+ mInitMap.put(new Pair<String, String>("func_147493_a", "createPlayer"));
+ mInitMap.put(new Pair<String, String>("func_147496_a", "onWorldChange"));
+ mInitMap.put(new Pair<String, String>("func_147499_a", "bindTexture"));
+ mInitMap.put(new Pair<String, String>("func_147500_a", "renderTileEntityAt"));
+ mInitMap.put(new Pair<String, String>("func_147542_a", "cacheActiveRenderInfo"));
+ mInitMap.put(new Pair<String, String>("func_147544_a", "renderTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_147545_a", "hasSpecialRenderer"));
+ mInitMap.put(new Pair<String, String>("func_147546_a", "getSpecialRendererByClass"));
+ mInitMap.put(new Pair<String, String>("func_147547_b", "getSpecialRenderer"));
+ mInitMap.put(new Pair<String, String>("func_147548_a", "getFontRenderer"));
+ mInitMap.put(new Pair<String, String>("func_147549_a", "renderTileEntityAt"));
+ mInitMap.put(new Pair<String, String>("func_147564_a", "getVertexState"));
+ mInitMap.put(new Pair<String, String>("func_147565_a", "setVertexState"));
+ mInitMap.put(new Pair<String, String>("func_147570_f", "getHasNormals"));
+ mInitMap.put(new Pair<String, String>("func_147571_e", "getHasBrightness"));
+ mInitMap.put(new Pair<String, String>("func_147572_a", "getRawBuffer"));
+ mInitMap.put(new Pair<String, String>("func_147573_d", "getHasTexture"));
+ mInitMap.put(new Pair<String, String>("func_147574_g", "getHasColor"));
+ mInitMap.put(new Pair<String, String>("func_147575_c", "getVertexCount"));
+ mInitMap.put(new Pair<String, String>("func_147576_b", "getRawBufferIndex"));
+ mInitMap.put(new Pair<String, String>("func_147584_b", "onStaticEntitiesChanged"));
+ mInitMap.put(new Pair<String, String>("func_147585_a", "markBlockRangeForRenderUpdate"));
+ mInitMap.put(new Pair<String, String>("func_147586_a", "markBlockForUpdate"));
+ mInitMap.put(new Pair<String, String>("func_147587_b", "destroyBlockPartially"));
+ mInitMap.put(new Pair<String, String>("func_147588_b", "markBlockForRenderUpdate"));
+ mInitMap.put(new Pair<String, String>("func_147589_a", "renderEntities"));
+ mInitMap.put(new Pair<String, String>("func_147590_a", "drawOutlinedBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_147591_f", "rebuildDisplayListEntities"));
+ mInitMap.put(new Pair<String, String>("func_147604_a", "setFramebufferColor"));
+ mInitMap.put(new Pair<String, String>("func_147605_b", "createFramebuffer"));
+ mInitMap.put(new Pair<String, String>("func_147606_d", "unbindFramebufferTexture"));
+ mInitMap.put(new Pair<String, String>("func_147607_a", "setFramebufferFilter"));
+ mInitMap.put(new Pair<String, String>("func_147608_a", "deleteFramebuffer"));
+ mInitMap.put(new Pair<String, String>("func_147609_e", "unbindFramebuffer"));
+ mInitMap.put(new Pair<String, String>("func_147610_a", "bindFramebuffer"));
+ mInitMap.put(new Pair<String, String>("func_147611_b", "checkFramebufferComplete"));
+ mInitMap.put(new Pair<String, String>("func_147612_c", "bindFramebufferTexture"));
+ mInitMap.put(new Pair<String, String>("func_147613_a", "createBindFramebuffer"));
+ mInitMap.put(new Pair<String, String>("func_147614_f", "framebufferClear"));
+ mInitMap.put(new Pair<String, String>("func_147615_c", "framebufferRender"));
+ mInitMap.put(new Pair<String, String>("func_147631_c", "deleteGlTexture"));
+ mInitMap.put(new Pair<String, String>("func_147632_b", "setAnisotropicFiltering"));
+ mInitMap.put(new Pair<String, String>("func_147633_a", "setMipmapLevels"));
+ mInitMap.put(new Pair<String, String>("func_147634_a", "completeResourceLocation"));
+ mInitMap.put(new Pair<String, String>("func_147640_e", "checkTextureUploaded"));
+ mInitMap.put(new Pair<String, String>("func_147641_a", "setBufferedImage"));
+ mInitMap.put(new Pair<String, String>("func_147645_c", "deleteTexture"));
+ mInitMap.put(new Pair<String, String>("func_147647_b", "bidiReorder"));
+ mInitMap.put(new Pair<String, String>("func_147649_g", "getXPosF"));
+ mInitMap.put(new Pair<String, String>("func_147650_b", "getSoundLocation"));
+ mInitMap.put(new Pair<String, String>("func_147651_i", "getZPosF"));
+ mInitMap.put(new Pair<String, String>("func_147652_d", "getRepeatDelay"));
+ mInitMap.put(new Pair<String, String>("func_147653_e", "getVolume"));
+ mInitMap.put(new Pair<String, String>("func_147654_h", "getYPosF"));
+ mInitMap.put(new Pair<String, String>("func_147655_f", "getPitch"));
+ mInitMap.put(new Pair<String, String>("func_147656_j", "getAttenuationType"));
+ mInitMap.put(new Pair<String, String>("func_147657_c", "canRepeat"));
+ mInitMap.put(new Pair<String, String>("func_147667_k", "isDonePlaying"));
+ mInitMap.put(new Pair<String, String>("func_147673_a", "createPositionedSoundRecord"));
+ mInitMap.put(new Pair<String, String>("func_147674_a", "createPositionedSoundRecord"));
+ mInitMap.put(new Pair<String, String>("func_147675_a", "createRecordSoundAtPosition"));
+ mInitMap.put(new Pair<String, String>("func_147680_a", "getSound"));
+ mInitMap.put(new Pair<String, String>("func_147681_a", "playDelayedSound"));
+ mInitMap.put(new Pair<String, String>("func_147682_a", "playSound"));
+ mInitMap.put(new Pair<String, String>("func_147683_b", "stopSound"));
+ mInitMap.put(new Pair<String, String>("func_147684_a", "setSoundLevel"));
+ mInitMap.put(new Pair<String, String>("func_147685_d", "unloadSounds"));
+ mInitMap.put(new Pair<String, String>("func_147686_a", "getRandomSoundFromCategories"));
+ mInitMap.put(new Pair<String, String>("func_147687_e", "resumeSounds"));
+ mInitMap.put(new Pair<String, String>("func_147689_b", "pauseSounds"));
+ mInitMap.put(new Pair<String, String>("func_147690_c", "stopSounds"));
+ mInitMap.put(new Pair<String, String>("func_147691_a", "setListener"));
+ mInitMap.put(new Pair<String, String>("func_147692_c", "isSoundPlaying"));
+ mInitMap.put(new Pair<String, String>("func_147693_a", "loadSoundResource"));
+ mInitMap.put(new Pair<String, String>("func_147701_i", "getMapItemRenderer"));
+ mInitMap.put(new Pair<String, String>("func_147702_a", "isShaderActive"));
+ mInitMap.put(new Pair<String, String>("func_147703_b", "deactivateShader"));
+ mInitMap.put(new Pair<String, String>("func_147704_a", "updateShaderGroupSize"));
+ mInitMap.put(new Pair<String, String>("func_147705_c", "activateNextShader"));
+ mInitMap.put(new Pair<String, String>("func_147706_e", "getShaderGroup"));
+ mInitMap.put(new Pair<String, String>("func_147715_a", "renderChest"));
+ mInitMap.put(new Pair<String, String>("func_147721_p", "renderBlockLiquid"));
+ mInitMap.put(new Pair<String, String>("func_147722_a", "renderBlockStairs"));
+ mInitMap.put(new Pair<String, String>("func_147723_f", "renderBlockTripWireSource"));
+ mInitMap.put(new Pair<String, String>("func_147724_m", "renderBlockStem"));
+ mInitMap.put(new Pair<String, String>("func_147725_a", "renderBlockAnvil"));
+ mInitMap.put(new Pair<String, String>("func_147726_j", "renderBlockVine"));
+ mInitMap.put(new Pair<String, String>("func_147727_a", "mixAoBrightness"));
+ mInitMap.put(new Pair<String, String>("func_147728_a", "renderBlockAnvilOrient"));
+ mInitMap.put(new Pair<String, String>("func_147729_a", "getLiquidHeight"));
+ mInitMap.put(new Pair<String, String>("func_147730_a", "renderBlockStemSmall"));
+ mInitMap.put(new Pair<String, String>("func_147731_b", "renderPistonBase"));
+ mInitMap.put(new Pair<String, String>("func_147732_a", "renderBlockRedstoneDiodeMetadata"));
+ mInitMap.put(new Pair<String, String>("func_147733_k", "renderBlockStainedGlassPane"));
+ mInitMap.put(new Pair<String, String>("func_147734_d", "renderFaceZPos"));
+ mInitMap.put(new Pair<String, String>("func_147735_a", "renderBlockFence"));
+ mInitMap.put(new Pair<String, String>("func_147736_d", "renderStandardBlockWithColorMultiplier"));
+ mInitMap.put(new Pair<String, String>("func_147737_a", "renderBlockAnvilRotate"));
+ mInitMap.put(new Pair<String, String>("func_147738_c", "renderPistonRodEW"));
+ mInitMap.put(new Pair<String, String>("func_147739_a", "renderItemIn3d"));
+ mInitMap.put(new Pair<String, String>("func_147740_a", "renderBlockStemBig"));
+ mInitMap.put(new Pair<String, String>("func_147741_a", "renderBlockBrewingStand"));
+ mInitMap.put(new Pair<String, String>("func_147742_r", "renderBlockLog"));
+ mInitMap.put(new Pair<String, String>("func_147743_a", "renderBlockEndPortalFrame"));
+ mInitMap.put(new Pair<String, String>("func_147744_b", "hasOverrideBlockTexture"));
+ mInitMap.put(new Pair<String, String>("func_147745_b", "getBlockIcon"));
+ mInitMap.put(new Pair<String, String>("func_147746_l", "renderCrossedSquares"));
+ mInitMap.put(new Pair<String, String>("func_147747_a", "renderTorchAtAngle"));
+ mInitMap.put(new Pair<String, String>("func_147748_a", "renderBlockRedstoneDiode"));
+ mInitMap.put(new Pair<String, String>("func_147749_a", "renderBlockSandFalling"));
+ mInitMap.put(new Pair<String, String>("func_147750_a", "renderPistonExtensionAllFaces"));
+ mInitMap.put(new Pair<String, String>("func_147751_a", "renderStandardBlockWithAmbientOcclusion"));
+ mInitMap.put(new Pair<String, String>("func_147752_a", "renderBlockFlowerpot"));
+ mInitMap.put(new Pair<String, String>("func_147753_b", "setRenderAllFaces"));
+ mInitMap.put(new Pair<String, String>("func_147754_e", "renderBlockCactusImpl"));
+ mInitMap.put(new Pair<String, String>("func_147755_t", "renderBlockCactus"));
+ mInitMap.put(new Pair<String, String>("func_147756_g", "renderBlockTripWire"));
+ mInitMap.put(new Pair<String, String>("func_147757_a", "setOverrideBlockTexture"));
+ mInitMap.put(new Pair<String, String>("func_147758_b", "getIconSafe"));
+ mInitMap.put(new Pair<String, String>("func_147759_a", "renderBlockRepeater"));
+ mInitMap.put(new Pair<String, String>("func_147760_u", "renderBlockDoor"));
+ mInitMap.put(new Pair<String, String>("func_147761_c", "renderFaceZNeg"));
+ mInitMap.put(new Pair<String, String>("func_147762_c", "unlockBlockBounds"));
+ mInitMap.put(new Pair<String, String>("func_147763_a", "renderPistonRodUD"));
+ mInitMap.put(new Pair<String, String>("func_147764_f", "renderFaceXPos"));
+ mInitMap.put(new Pair<String, String>("func_147765_a", "drawCrossedSquares"));
+ mInitMap.put(new Pair<String, String>("func_147766_a", "renderBlockMinecartTrack"));
+ mInitMap.put(new Pair<String, String>("func_147767_a", "renderBlockPane"));
+ mInitMap.put(new Pair<String, String>("func_147768_a", "renderFaceYNeg"));
+ mInitMap.put(new Pair<String, String>("func_147769_a", "renderBlockAllFaces"));
+ mInitMap.put(new Pair<String, String>("func_147770_b", "overrideBlockBounds"));
+ mInitMap.put(new Pair<String, String>("func_147771_a", "clearOverrideBlockTexture"));
+ mInitMap.put(new Pair<String, String>("func_147772_a", "renderBlockCocoa"));
+ mInitMap.put(new Pair<String, String>("func_147773_v", "renderBlockBed"));
+ mInitMap.put(new Pair<String, String>("func_147774_a", "renderBlockDoublePlant"));
+ mInitMap.put(new Pair<String, String>("func_147775_a", "setRenderBoundsFromBlock"));
+ mInitMap.put(new Pair<String, String>("func_147776_a", "renderBlockFenceGate"));
+ mInitMap.put(new Pair<String, String>("func_147777_a", "getBlockIconFromSide"));
+ mInitMap.put(new Pair<String, String>("func_147778_a", "getAoBrightness"));
+ mInitMap.put(new Pair<String, String>("func_147779_s", "renderBlockQuartz"));
+ mInitMap.put(new Pair<String, String>("func_147780_a", "renderBlockAnvilMetadata"));
+ mInitMap.put(new Pair<String, String>("func_147781_a", "renderBlockRedstoneComparator"));
+ mInitMap.put(new Pair<String, String>("func_147782_a", "setRenderBounds"));
+ mInitMap.put(new Pair<String, String>("func_147783_o", "renderBlockLilyPad"));
+ mInitMap.put(new Pair<String, String>("func_147784_q", "renderStandardBlock"));
+ mInitMap.put(new Pair<String, String>("func_147785_a", "renderBlockCauldron"));
+ mInitMap.put(new Pair<String, String>("func_147786_a", "setRenderFromInside"));
+ mInitMap.put(new Pair<String, String>("func_147787_a", "getBlockIconFromSideAndMetadata"));
+ mInitMap.put(new Pair<String, String>("func_147788_h", "renderBlockRedstomInitMap.put(newire"));
+ mInitMap.put(new Pair<String, String>("func_147789_b", "renderPistonRodSN"));
+ mInitMap.put(new Pair<String, String>("func_147790_e", "renderBlockLever"));
+ mInitMap.put(new Pair<String, String>("func_147791_c", "renderBlockTorch"));
+ mInitMap.put(new Pair<String, String>("func_147792_a", "renderBlockUsingTexture"));
+ mInitMap.put(new Pair<String, String>("func_147793_a", "getBlockIcon"));
+ mInitMap.put(new Pair<String, String>("func_147794_i", "renderBlockLadder"));
+ mInitMap.put(new Pair<String, String>("func_147795_a", "renderBlockCropsImpl"));
+ mInitMap.put(new Pair<String, String>("func_147796_n", "renderBlockCrops"));
+ mInitMap.put(new Pair<String, String>("func_147797_a", "renderBlockBeacon"));
+ mInitMap.put(new Pair<String, String>("func_147798_e", "renderFaceXNeg"));
+ mInitMap.put(new Pair<String, String>("func_147799_a", "renderBlockHopperMetadata"));
+ mInitMap.put(new Pair<String, String>("func_147800_a", "renderBlockAsItem"));
+ mInitMap.put(new Pair<String, String>("func_147801_a", "renderBlockFire"));
+ mInitMap.put(new Pair<String, String>("func_147802_a", "renderBlockDragonEgg"));
+ mInitMap.put(new Pair<String, String>("func_147803_a", "renderBlockHopper"));
+ mInitMap.put(new Pair<String, String>("func_147804_d", "renderPistonBaseAllFaces"));
+ mInitMap.put(new Pair<String, String>("func_147805_b", "renderBlockByRenderType"));
+ mInitMap.put(new Pair<String, String>("func_147806_b", "renderFaceYPos"));
+ mInitMap.put(new Pair<String, String>("func_147807_a", "renderBlockWall"));
+ mInitMap.put(new Pair<String, String>("func_147808_b", "renderStandardBlockWithAmbientOcclusionPartial"));
+ mInitMap.put(new Pair<String, String>("func_147809_c", "renderPistonExtension"));
+ mInitMap.put(new Pair<String, String>("func_147889_b", "updateRendererSort"));
+ mInitMap.put(new Pair<String, String>("func_147890_b", "preRenderBlocks"));
+ mInitMap.put(new Pair<String, String>("func_147891_a", "postRenderBlocks"));
+ mInitMap.put(new Pair<String, String>("func_147892_a", "updateRenderer"));
+ mInitMap.put(new Pair<String, String>("func_147905_a", "isStaticEntity"));
+ mInitMap.put(new Pair<String, String>("func_147906_a", "renderLivingLabel"));
+ mInitMap.put(new Pair<String, String>("func_147936_a", "renderEntityStatic"));
+ mInitMap.put(new Pair<String, String>("func_147937_a", "renderEntitySimple"));
+ mInitMap.put(new Pair<String, String>("func_147938_a", "cacheActiveRenderInfo"));
+ mInitMap.put(new Pair<String, String>("func_147939_a", "doRenderEntity"));
+ mInitMap.put(new Pair<String, String>("func_147940_a", "renderEntityWithPosYaw"));
+ mInitMap.put(new Pair<String, String>("func_147942_a", "deleteTexture"));
+ mInitMap.put(new Pair<String, String>("func_147946_a", "allocateTextureImpl"));
+ mInitMap.put(new Pair<String, String>("func_147947_a", "uploadTextureSub"));
+ mInitMap.put(new Pair<String, String>("func_147948_a", "prepareAnisotropicData"));
+ mInitMap.put(new Pair<String, String>("func_147949_a", "generateMipmapData"));
+ }
- public static void init4() {
- mObInitMap.put(new Pair<String, String>("aqc", "net/minecraft/world/chunk/storage/IChunkLoader"));
- mObInitMap.put(new Pair<String, String>("amd", "net/minecraft/block/BlockMycelium"));
- mObInitMap.put(new Pair<String, String>("aag", "net/minecraft/inventory/ContainerEnchantment"));
- mObInitMap.put(new Pair<String, String>("aie", "net/minecraft/world/biome/WorldChunkManagerHell"));
- mObInitMap.put(new Pair<String, String>("aub",
- "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$DesertPyramid"));
- mObInitMap.put(new Pair<String, String>("bue", "net/minecraft/client/stream/ChatController"));
- mObInitMap.put(new Pair<String, String>("bqf", "net/minecraft/client/renderer/texture/TextureManager"));
- mObInitMap.put(new Pair<String, String>("bei", "net/minecraft/client/gui/achievement/GuiAchievements"));
- mObInitMap.put(new Pair<String, String>("bih", "net/minecraft/client/model/ModelSquid"));
- mObInitMap.put(new Pair<String, String>("bmg", "net/minecraft/client/shader/Framebuffer"));
- mObInitMap.put(new Pair<String, String>("na", "net/minecraft/client/network/NetHandlerHandshakeMemory"));
- mObInitMap
- .put(new Pair<String, String>("jb", "net/minecraft/network/play/client/C02PacketUseEntity$Action"));
- mObInitMap.put(new Pair<String, String>("fc", "net/minecraft/util/MessageDeserializer2"));
- mObInitMap.put(new Pair<String, String>("bd", "net/minecraft/command/server/CommandPardonIp"));
- mObInitMap.put(new Pair<String, String>("amw", "net/minecraft/block/BlockPumpkin"));
- mObInitMap.put(new Pair<String, String>("aey", "net/minecraft/item/crafting/RecipeFireworks"));
- mObInitMap.put(new Pair<String, String>("aaz", "net/minecraft/inventory/ContainerDispenser"));
- mObInitMap.put(new Pair<String, String>("aix", "net/minecraft/world/biome/BiomeGenEnd"));
- mObInitMap.put(new Pair<String, String>("z", "net/minecraft/command/CommandHandler"));
- mObInitMap.put(new Pair<String, String>("bqy", "net/minecraft/client/resources/IResourceManager"));
- mObInitMap.put(new Pair<String, String>("nt", "net/minecraft/server/management/PlayerProfileCache$1"));
- mObInitMap.put(new Pair<String, String>("ju", "net/minecraft/network/login/server/S00PacketDisconnect"));
- mObInitMap.put(new Pair<String, String>("fv", "net/minecraft/network/play/INetHandlerPlayClient"));
- mObInitMap.put(new Pair<String, String>("abn", "net/minecraft/item/ItemSoup"));
- mObInitMap.put(new Pair<String, String>("afm", "net/minecraft/enchantment/EnchantmentArrowDamage"));
- mObInitMap.put(new Pair<String, String>("brm", "net/minecraft/client/resources/SkinManager$3"));
- mObInitMap.put(new Pair<String, String>("aqu", "net/minecraft/world/gen/ChunkProviderFlat"));
- mObInitMap.put(new Pair<String, String>("aut",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Prison"));
- mObInitMap.put(new Pair<String, String>("ays", "net/minecraft/world/storage/WorldInfo"));
- mObInitMap.put(new Pair<String, String>("bbq", "net/minecraft/util/MinecraftError"));
- mObInitMap.put(new Pair<String, String>("bfp", "net/minecraft/util/EnchantmentNameParts"));
- mObInitMap.put(
- new Pair<String, String>("bjo", "net/minecraft/client/multiplayer/ServerData$ServerResourceMode"));
- mObInitMap.put(new Pair<String, String>("bnn", "net/minecraft/client/renderer/entity/RenderManager"));
- mObInitMap.put(new Pair<String, String>("ck", "net/minecraft/dispenser/IBlockSource"));
- mObInitMap.put(new Pair<String, String>("zp", "net/minecraft/entity/projectile/EntityWitherSkull"));
- mObInitMap.put(
- new Pair<String, String>("vq", "net/minecraft/entity/ai/EntityAINearestAttackableTarget$Sorter"));
- mObInitMap.put(new Pair<String, String>("rr", "net/minecraft/potion/PotionAbsoption"));
- mObInitMap.put(new Pair<String, String>("ns", "net/minecraft/server/management/PlayerProfileCache"));
- mObInitMap.put(new Pair<String, String>("anj", "net/minecraft/block/BlockSapling"));
- mObInitMap.put(new Pair<String, String>("afl", "net/minecraft/item/crafting/RecipesWeapons"));
- mObInitMap.put(new Pair<String, String>("ajk", "net/minecraft/block/Block$2"));
- mObInitMap.put(new Pair<String, String>("avh", "net/minecraft/world/gen/structure/MapGenStructure$3"));
- mObInitMap.put(new Pair<String, String>("bce", "net/minecraft/client/gui/GuiLabel"));
- mObInitMap.put(new Pair<String, String>("bgd", "net/minecraft/client/gui/ServerListEntryNormal$1"));
- mObInitMap.put(new Pair<String, String>("brl", "net/minecraft/client/resources/SkinManager$2"));
- mObInitMap.put(new Pair<String, String>("we", "net/minecraft/entity/passive/EntityBat"));
- mObInitMap.put(new Pair<String, String>("og", "net/minecraft/server/management/PreYggdrasilConverter$7"));
- mObInitMap.put(new Pair<String, String>("kh", "net/minecraft/network/status/INetHandlerStatusServer"));
- mObInitMap.put(new Pair<String, String>("gi", "net/minecraft/network/play/server/S3APacketTabComplete"));
- mObInitMap.put(new Pair<String, String>("aca", "net/minecraft/creativetab/CreativeTabs$4"));
- mObInitMap.put(new Pair<String, String>("azz", "net/minecraft/scoreboard/Score"));
- mObInitMap.put(new Pair<String, String>("bgc", "net/minecraft/client/gui/ServerListEntryNormal"));
- mObInitMap.put(new Pair<String, String>("boa", "net/minecraft/client/renderer/entity/RenderItem$2"));
- mObInitMap.put(new Pair<String, String>("wx", "net/minecraft/entity/IEntityMultiPart"));
- mObInitMap.put(new Pair<String, String>("sy", "net/minecraft/entity/IEntityLivingData"));
- mObInitMap.put(new Pair<String, String>("oz", "net/minecraft/network/rcon/RConThreadClient"));
- mObInitMap.put(new Pair<String, String>("aoq", "net/minecraft/tileentity/TileEntityBeacon"));
- mObInitMap.put(new Pair<String, String>("akr", "net/minecraft/block/BlockDynamicLiquid"));
- mObInitMap.put(new Pair<String, String>("act", "net/minecraft/item/ItemFishFood"));
- mObInitMap.put(new Pair<String, String>("ags", "net/minecraft/block/BlockEventData"));
- mObInitMap.put(new Pair<String, String>("bss", "net/minecraft/client/audio/SoundListSerializer"));
- mObInitMap.put(new Pair<String, String>("bot", "net/minecraft/client/renderer/entity/RenderSlime"));
- mObInitMap.put(new Pair<String, String>("azy", "net/minecraft/scoreboard/ScorePlayerTeam"));
- mObInitMap.put(new Pair<String, String>("bcw", "net/minecraft/client/gui/GuiYesNo"));
- mObInitMap.put(new Pair<String, String>("bgv", "net/minecraft/client/main/Main$2"));
- mObInitMap.put(new Pair<String, String>("bku", "net/minecraft/client/particle/EntityReddustFX"));
- mObInitMap.put(new Pair<String, String>("pn", "net/minecraft/util/TupleIntJsonSerializable"));
- mObInitMap.put(new Pair<String, String>("lo", "net/minecraft/network/rcon/IServer"));
- mObInitMap.put(new Pair<String, String>("hp", "net/minecraft/network/play/server/S0APacketUseBed"));
- mObInitMap.put(new Pair<String, String>("dq", "net/minecraft/nbt/NBTTagList"));
- mObInitMap.put(new Pair<String, String>("adh", "net/minecraft/item/ItemMap"));
- mObInitMap.put(new Pair<String, String>("bph", "net/minecraft/client/shader/ShaderDefault"));
- mObInitMap.put(new Pair<String, String>("aso", "net/minecraft/world/gen/feature/WorldGenSwamp"));
- mObInitMap.put(new Pair<String, String>("aop", "net/minecraft/block/BlockCarpet"));
- mObInitMap.put(new Pair<String, String>("bdk", "net/minecraft/client/gui/GuiLanguage$List"));
- mObInitMap.put(new Pair<String, String>("bhj", "net/minecraft/client/model/ModelCreeper"));
- mObInitMap.put(new Pair<String, String>("bli", "net/minecraft/util/MovementInput"));
- mObInitMap.put(new Pair<String, String>("ee", "net/minecraft/nbt/JsonToNBT$List"));
- mObInitMap.put(new Pair<String, String>("af", "net/minecraft/command/server/CommandBanIp"));
- mObInitMap.put(new Pair<String, String>("xk", "net/minecraft/entity/item/EntityItem"));
- mObInitMap.put(new Pair<String, String>("tl", "net/minecraft/entity/ai/attributes/BaseAttributeMap"));
- mObInitMap.put(new Pair<String, String>("pm", "net/minecraft/stats/IStatType"));
- mObInitMap
- .put(new Pair<String, String>("atc", "net/minecraft/world/gen/structure/StructureMineshaftStart"));
- mObInitMap.put(new Pair<String, String>("apd", "net/minecraft/tileentity/TileEntityEnchantmentTable"));
- mObInitMap.put(new Pair<String, String>("ale", "net/minecraft/block/BlockFurnace"));
- mObInitMap.put(new Pair<String, String>("adg", "net/minecraft/item/ItemLeaves"));
- mObInitMap.put(new Pair<String, String>("ahf", "net/minecraft/world/World$4"));
- mObInitMap.put(new Pair<String, String>("axb", "net/minecraft/world/gen/layer/GenLayerAddIsland"));
- mObInitMap.put(new Pair<String, String>("bpg", "net/minecraft/client/util/JsonBlendingMode"));
- mObInitMap
- .put(new Pair<String, String>("net/minecraft/realms/RealmsMth", "net/minecraft/realms/RealmsMth"));
- mObInitMap.put(new Pair<String, String>("qa", "net/minecraft/util/IntHashMap$Entry"));
- mObInitMap.put(new Pair<String, String>("mb", "net/minecraft/server/gui/MinecraftServerGui$3"));
- mObInitMap.put(
- new Pair<String, String>("ic", "net/minecraft/network/play/server/S3BPacketScoreboardObjective"));
- mObInitMap.put(new Pair<String, String>("ed", "net/minecraft/nbt/JsonToNBT$Compound"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RendererUtility",
- "net/minecraft/realms/RendererUtility"));
- mObInitMap.put(new Pair<String, String>("atv",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Stairs"));
- mObInitMap.put(new Pair<String, String>("apw", "net/minecraft/world/chunk/EmptyChunk"));
- mObInitMap.put(new Pair<String, String>("alx", "net/minecraft/block/BlockLog"));
- mObInitMap.put(new Pair<String, String>("adz", "net/minecraft/item/ItemSign"));
- mObInitMap.put(new Pair<String, String>("ahy", "net/minecraft/world/biome/BiomeCache"));
- mObInitMap.put(new Pair<String, String>("axu", "net/minecraft/world/gen/layer/GenLayerRiver"));
- mObInitMap.put(new Pair<String, String>("bpz", "net/minecraft/client/renderer/texture/TextureMap"));
- mObInitMap.put(new Pair<String, String>("yr", "net/minecraft/entity/monster/EntityZombie$1"));
- mObInitMap.put(new Pair<String, String>("us", "net/minecraft/entity/ai/EntityAIMoveThroughVillage"));
- mObInitMap.put(new Pair<String, String>("mu", "net/minecraft/world/WorldServer$1"));
- mObInitMap.put(
- new Pair<String, String>("iv", "net/minecraft/network/play/client/C0FPacketConfirmTransaction"));
- mObInitMap.put(new Pair<String, String>("ew", "net/minecraft/network/NetworkStatistics$PacketStat"));
- mObInitMap.put(new Pair<String, String>("ax", "net/minecraft/command/server/CommandListBans"));
- mObInitMap.put(
- new Pair<String, String>("net/minecraft/realms/ServerPing", "net/minecraft/realms/ServerPing"));
- mObInitMap.put(new Pair<String, String>("aqk", "net/minecraft/world/chunk/storage/AnvilChunkLoader"));
- mObInitMap.put(new Pair<String, String>("aml", "net/minecraft/block/BlockOldLeaf"));
- mObInitMap.put(new Pair<String, String>("aen", "net/minecraft/potion/PotionHelper"));
- mObInitMap.put(new Pair<String, String>("aao", "net/minecraft/inventory/ContainerHorseInventory$2"));
- mObInitMap.put(new Pair<String, String>("aim", "net/minecraft/world/biome/BiomeGenMushroomIsland"));
- mObInitMap.put(new Pair<String, String>("o", "net/minecraft/crash/CrashReportCategory$Entry"));
- mObInitMap.put(new Pair<String, String>("bum", "net/minecraft/client/stream/IStream"));
- mObInitMap.put(new Pair<String, String>("bqn", "net/minecraft/client/resources/AbstractResourcePack"));
- mObInitMap.put(new Pair<String, String>("bar", "net/minecraft/client/Minecraft$11"));
- mObInitMap.put(new Pair<String, String>("beq", "net/minecraft/client/gui/achievement/GuiStats$Stats"));
- mObInitMap.put(new Pair<String, String>("bip", "net/minecraft/client/model/ModelZombie"));
- mObInitMap.put(new Pair<String, String>("bmo",
- "net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer"));
- mObInitMap.put(new Pair<String, String>("ni", "net/minecraft/network/NetHandlerPlayServer$1"));
- mObInitMap.put(new Pair<String, String>("jj", "net/minecraft/network/play/client/C0BPacketEntityAction"));
- mObInitMap.put(new Pair<String, String>("fk", "net/minecraft/util/IChatComponent$Serializer"));
- mObInitMap.put(new Pair<String, String>("bl", "net/minecraft/command/ServerCommandManager"));
- mObInitMap.put(new Pair<String, String>("yq", "net/minecraft/entity/monster/EntityZombie"));
- mObInitMap.put(new Pair<String, String>("abc", "net/minecraft/item/ItemArmor$1"));
- mObInitMap.put(new Pair<String, String>("afb", "net/minecraft/item/crafting/RecipesMapCloning"));
- mObInitMap.put(new Pair<String, String>("brb",
- "net/minecraft/client/resources/ResourcePackFileNotFoundException"));
- mObInitMap.put(new Pair<String, String>("aqj", "net/minecraft/world/chunk/storage/RegionFileCache"));
- mObInitMap.put(
- new Pair<String, String>("aui", "net/minecraft/world/gen/structure/StructureStrongholdPieces"));
- mObInitMap.put(new Pair<String, String>("bbf", "net/minecraft/client/Minecraft$9"));
- mObInitMap.put(new Pair<String, String>("bfe", "net/minecraft/client/gui/GuiScreenBook"));
- mObInitMap.put(new Pair<String, String>("bjd", "net/minecraft/client/multiplayer/ChunkProviderClient"));
- mObInitMap.put(new Pair<String, String>("bnc", "net/minecraft/client/renderer/entity/RenderBat"));
- mObInitMap.put(new Pair<String, String>("ze", "net/minecraft/entity/projectile/EntityFireball"));
- mObInitMap.put(new Pair<String, String>("vf", "net/minecraft/entity/ai/EntityAIRestrictSun"));
- mObInitMap.put(new Pair<String, String>("rg", "net/minecraft/client/renderer/texture/IIconRegister"));
- mObInitMap.put(new Pair<String, String>("afa", "net/minecraft/item/crafting/FurnaceRecipes"));
- mObInitMap.put(new Pair<String, String>("bby", "net/minecraft/client/gui/MapItemRenderer$1"));
- mObInitMap.put(new Pair<String, String>("bfx", "net/minecraft/client/gui/inventory/GuiEditSign"));
- mObInitMap.put(new Pair<String, String>("bra", "net/minecraft/client/resources/IResourcePack"));
- mObInitMap.put(new Pair<String, String>("zx", "net/minecraft/inventory/ContainerBeacon"));
- mObInitMap.put(new Pair<String, String>("vy", "net/minecraft/village/VillageDoorInfo"));
- mObInitMap.put(new Pair<String, String>("arq", "net/minecraft/world/gen/feature/WorldGenFire"));
- mObInitMap.put(new Pair<String, String>("anr", "net/minecraft/block/BlockStainedGlassPane"));
- mObInitMap.put(new Pair<String, String>("abu", "net/minecraft/creativetab/CreativeTabs$1"));
- mObInitMap.put(new Pair<String, String>("aft", "net/minecraft/enchantment/Enchantment"));
- mObInitMap.put(new Pair<String, String>("ajs", "net/minecraft/block/BlockButton"));
- mObInitMap.put(new Pair<String, String>("avp", "net/minecraft/world/gen/structure/StructureVillagePieces"));
- mObInitMap.put(new Pair<String, String>("azo", "net/minecraft/world/storage/SaveHandlerMP"));
- mObInitMap.put(new Pair<String, String>("brt",
- "net/minecraft/client/resources/data/BaseMetadataSectionSerializer"));
- mObInitMap.put(new Pair<String, String>("bfw", "net/minecraft/client/gui/GuiMerchant$MerchantButton"));
- mObInitMap.put(new Pair<String, String>("bjv", "net/minecraft/client/particle/EntityBubbleFX"));
- mObInitMap.put(new Pair<String, String>("bnu", "net/minecraft/client/renderer/entity/RenderGiantZombie"));
- mObInitMap.put(new Pair<String, String>("wm", "net/minecraft/entity/passive/EntityMooshroom"));
- mObInitMap.put(new Pair<String, String>("oo", "net/minecraft/server/management/UserList$Serializer"));
- mObInitMap.put(new Pair<String, String>("kp", "net/minecraft/init/Bootstrap$12"));
- mObInitMap.put(new Pair<String, String>("gq", "net/minecraft/network/play/server/S2FPacketSetSlot"));
- mObInitMap.put(new Pair<String, String>("cr", "net/minecraft/util/EnumFacing"));
- mObInitMap.put(new Pair<String, String>("aof", "net/minecraft/block/BlockTripWire"));
- mObInitMap.put(new Pair<String, String>("akg", "net/minecraft/block/BlockDaylightDetector"));
- mObInitMap.put(new Pair<String, String>("aci", "net/minecraft/item/ItemDoublePlant"));
- mObInitMap.put(new Pair<String, String>("agh", "net/minecraft/enchantment/EnchantmentOxygen"));
- mObInitMap.put(new Pair<String, String>("bsh",
- "net/minecraft/client/resources/data/PackMetadataSectionSerializer"));
- mObInitMap.put(new Pair<String, String>("bcl", "net/minecraft/client/gui/GuiOptionsRowList$Row"));
- mObInitMap.put(new Pair<String, String>("bgk", "net/minecraft/client/gui/GuiResourcePackList"));
- mObInitMap.put(new Pair<String, String>("bkj", "net/minecraft/client/particle/EntityHugeExplodeFX"));
- mObInitMap.put(new Pair<String, String>("boi", "net/minecraft/client/renderer/entity/RenderMinecart"));
- mObInitMap.put(new Pair<String, String>("pc", "net/minecraft/stats/AchievementList"));
- mObInitMap.put(new Pair<String, String>("ld", "net/minecraft/client/util/JsonException$Entry"));
- mObInitMap.put(new Pair<String, String>("he", "net/minecraft/network/play/server/S34PacketMaps"));
- mObInitMap.put(new Pair<String, String>("df", "net/minecraft/nbt/NBTTagByteArray"));
- mObInitMap.put(new Pair<String, String>("asd", "net/minecraft/world/gen/feature/WorldGenDungeons"));
- mObInitMap.put(
- new Pair<String, String>("awc", "net/minecraft/world/gen/structure/StructureVillagePieces$House3"));
- mObInitMap.put(new Pair<String, String>("dy", "net/minecraft/nbt/NBTBase"));
- mObInitMap.put(new Pair<String, String>("ta", "net/minecraft/entity/IEntityOwnable"));
- mObInitMap.put(new Pair<String, String>("pb", "net/minecraft/stats/Achievement"));
- mObInitMap.put(new Pair<String, String>("asw", "net/minecraft/world/gen/structure/MapGenMineshaft"));
- mObInitMap.put(new Pair<String, String>("aox", "net/minecraft/tileentity/TileEntityCommandBlock"));
- mObInitMap.put(new Pair<String, String>("aky", "net/minecraft/block/BlockFarmland"));
- mObInitMap.put(new Pair<String, String>("agz", "net/minecraft/world/GameRules$Value"));
- mObInitMap.put(new Pair<String, String>("awv", "net/minecraft/block/material/MapColor"));
- mObInitMap.put(new Pair<String, String>("bds", "net/minecraft/client/gui/GuiFlatPresets$ListSlot"));
- mObInitMap.put(new Pair<String, String>("bhr", "net/minecraft/client/model/ModelBase"));
- mObInitMap.put(new Pair<String, String>("bsz", "net/minecraft/server/integrated/IntegratedServer$2"));
- mObInitMap.put(new Pair<String, String>("xs", "net/minecraft/entity/item/EntityMinecartEmpty"));
- mObInitMap.put(new Pair<String, String>("tt", "net/minecraft/entity/ai/EntityJumpHelper"));
- mObInitMap.put(new Pair<String, String>("pu", "net/minecraft/util/JsonUtils"));
- mObInitMap.put(new Pair<String, String>("lv", "net/minecraft/server/dedicated/DedicatedServer$2"));
- mObInitMap.put(new Pair<String, String>("hw", "net/minecraft/network/play/server/S1CPacketEntityMetadata"));
- mObInitMap.put(new Pair<String, String>("dx", "net/minecraft/nbt/NBTTagString"));
- mObInitMap.put(new Pair<String, String>("atk",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor4"));
- mObInitMap.put(new Pair<String, String>("apl", "net/minecraft/tileentity/TileEntityNote"));
- mObInitMap.put(new Pair<String, String>("alm", "net/minecraft/block/BlockHay"));
- mObInitMap.put(new Pair<String, String>("ado", "net/minecraft/item/ItemPiston"));
- mObInitMap.put(new Pair<String, String>("ahn", "net/minecraft/world/EnumSkyBlock"));
- mObInitMap.put(new Pair<String, String>("axj", "net/minecraft/world/gen/layer/GenLayerFuzzyZoom"));
- mObInitMap.put(new Pair<String, String>("btn",
- "net/minecraft/client/audio/SoundManager$SoundSystemStarterThread"));
- mObInitMap.put(new Pair<String, String>("bpo", "net/minecraft/client/shader/ShaderUniform"));
- mObInitMap.put(new Pair<String, String>("bhq", "net/minecraft/client/model/ModelMinecart"));
- mObInitMap.put(new Pair<String, String>("blp", "net/minecraft/client/renderer/RenderSorter"));
- mObInitMap.put(new Pair<String, String>("yg", "net/minecraft/entity/monster/EntityMob"));
- mObInitMap.put(new Pair<String, String>("uh", "net/minecraft/entity/ai/EntityAIFollowParent"));
- mObInitMap.put(new Pair<String, String>("qi", "net/minecraft/profiler/Profiler"));
- mObInitMap.put(new Pair<String, String>("mj", "net/minecraft/client/renderer/DestroyBlockProgress"));
- mObInitMap.put(new Pair<String, String>("ik", "net/minecraft/network/play/server/S18PacketEntityTeleport"));
- mObInitMap.put(new Pair<String, String>("el", "net/minecraft/network/NetworkManager$2"));
- mObInitMap.put(new Pair<String, String>("am", "net/minecraft/command/CommandEffect"));
- mObInitMap.put(new Pair<String, String>("ama", "net/minecraft/block/BlockMobSpawner"));
- mObInitMap.put(new Pair<String, String>("aec", "net/minecraft/item/ItemSnow"));
- mObInitMap.put(new Pair<String, String>("aad", "net/minecraft/inventory/ContainerChest"));
- mObInitMap.put(new Pair<String, String>("aib", "net/minecraft/world/biome/WorldChunkManager"));
- mObInitMap.put(new Pair<String, String>("d", "net/minecraft/crash/CrashReport$2"));
- mObInitMap.put(new Pair<String, String>("bub",
- "net/minecraft/client/stream/BroadcastController$SwitchBroadcastState"));
- mObInitMap.put(new Pair<String, String>("bqc", "net/minecraft/client/renderer/texture/TextureMap$3"));
- mObInitMap.put(new Pair<String, String>("bag", "net/minecraft/scoreboard/ScoreHealthCriteria"));
- mObInitMap.put(new Pair<String, String>("bef", "net/minecraft/client/gui/GuiVideoSettings"));
- mObInitMap.put(new Pair<String, String>("bie", "net/minecraft/client/model/ModelSlime"));
- mObInitMap.put(new Pair<String, String>("bmd", "net/minecraft/client/renderer/RenderList"));
- mObInitMap.put(new Pair<String, String>("ba", "net/minecraft/command/server/CommandMessageRaw"));
- mObInitMap.put(new Pair<String, String>("aev", "net/minecraft/item/crafting/RecipesArmor"));
- mObInitMap.put(new Pair<String, String>("aaw", "net/minecraft/inventory/InventoryCraftResult"));
- mObInitMap.put(new Pair<String, String>("w", "net/minecraft/client/audio/SoundCategory"));
- mObInitMap
- .put(new Pair<String, String>("bqv", "net/minecraft/client/resources/IReloadableResourceManager"));
- mObInitMap.put(new Pair<String, String>("baz", "net/minecraft/client/Minecraft$3"));
- mObInitMap.put(new Pair<String, String>("bey", "net/minecraft/client/gui/GuiRepair"));
- mObInitMap.put(new Pair<String, String>("bix", "net/minecraft/client/model/ModelRenderer"));
- mObInitMap.put(new Pair<String, String>("bmw", "net/minecraft/client/renderer/culling/ClippingHelperImpl"));
- mObInitMap
- .put(new Pair<String, String>("fs", "net/minecraft/util/ChatComponentTranslationFormatException"));
- mObInitMap.put(new Pair<String, String>("bt", "net/minecraft/command/server/CommandStop"));
- mObInitMap.put(new Pair<String, String>("yy", "net/minecraft/entity/player/InventoryPlayer$1"));
- mObInitMap.put(new Pair<String, String>("uz", "net/minecraft/entity/ai/EntityAIPanic"));
- mObInitMap.put(new Pair<String, String>("aqr", "net/minecraft/world/WorldProviderEnd"));
- mObInitMap.put(new Pair<String, String>("ams", "net/minecraft/block/BlockCompressedPowered"));
- mObInitMap.put(new Pair<String, String>("aeu", "net/minecraft/item/crafting/RecipesArmorDyes"));
- mObInitMap.put(new Pair<String, String>("ait", "net/minecraft/world/biome/BiomeGenSavanna$Mutated"));
- mObInitMap.put(new Pair<String, String>("auq",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Library"));
- mObInitMap.put(new Pair<String, String>("ayp", "net/minecraft/world/storage/DerivedWorldInfo"));
- mObInitMap.put(new Pair<String, String>("bbn", "net/minecraft/client/settings/GameSettings$Options$1"));
- mObInitMap.put(new Pair<String, String>("bfm",
- "net/minecraft/client/gui/inventory/GuiContainerCreative$ContainerCreative"));
- mObInitMap.put(new Pair<String, String>("but", "net/minecraft/realms/RealmsServerStatusPinger$1"));
- mObInitMap.put(new Pair<String, String>("bqu", "net/minecraft/client/resources/GrassColorReloadListener"));
- mObInitMap.put(new Pair<String, String>("zm", "net/minecraft/entity/item/EntityEnderPearl"));
- mObInitMap.put(new Pair<String, String>("vn", "net/minecraft/entity/ai/EntityAIHurtByTarget"));
- mObInitMap.put(new Pair<String, String>("ro", "net/minecraft/util/DamageSource"));
- mObInitMap.put(
- new Pair<String, String>("np", "net/minecraft/server/network/NetHandlerLoginServer$LoginState"));
- mObInitMap
- .put(new Pair<String, String>("jq", "net/minecraft/network/handshake/INetHandlerHandshakeServer"));
- mObInitMap.put(new Pair<String, String>("fr", "net/minecraft/util/ChatComponentTranslation"));
- mObInitMap.put(new Pair<String, String>("arf", "net/minecraft/world/gen/feature/WorldGenBlockBlob"));
- mObInitMap.put(new Pair<String, String>("ang", "net/minecraft/block/BlockRotatedPillar"));
- mObInitMap.put(new Pair<String, String>("abj", "net/minecraft/item/ItemBoat"));
- mObInitMap.put(new Pair<String, String>("afi", "net/minecraft/item/crafting/ShapelessRecipes"));
- mObInitMap.put(new Pair<String, String>("ajh", "net/minecraft/block/BlockBed"));
- mObInitMap.put(new Pair<String, String>("ave", "net/minecraft/world/gen/structure/MapGenStructure"));
- mObInitMap.put(new Pair<String, String>("azd", "net/minecraft/client/AnvilConverterException"));
- mObInitMap
- .put(new Pair<String, String>("net/minecraft/client/main/Main", "net/minecraft/client/main/Main"));
- mObInitMap.put(new Pair<String, String>("bri", "net/minecraft/client/resources/SimpleResource"));
- mObInitMap.put(new Pair<String, String>("bfl", "net/minecraft/client/gui/inventory/GuiContainerCreative"));
- mObInitMap.put(new Pair<String, String>("bjk", "net/minecraft/client/entity/EntityClientPlayerMP"));
- mObInitMap.put(new Pair<String, String>("bnj", "net/minecraft/client/renderer/entity/RenderEntity"));
- mObInitMap.put(new Pair<String, String>("wb", "net/minecraft/village/VillageSiege"));
- mObInitMap.put(new Pair<String, String>("sc", "net/minecraft/entity/Entity$2"));
- mObInitMap.put(new Pair<String, String>("od", "net/minecraft/server/management/PreYggdrasilConverter$4"));
- mObInitMap.put(new Pair<String, String>("ke", "net/minecraft/network/ServerStatusResponse$Serializer"));
- mObInitMap
- .put(new Pair<String, String>("gf", "net/minecraft/network/play/server/S35PacketUpdateTileEntity"));
- mObInitMap.put(new Pair<String, String>("cg", "net/minecraft/command/PlayerNotFoundException"));
- mObInitMap.put(new Pair<String, String>("ary", "net/minecraft/world/gen/feature/WorldGenGlowStone1"));
- mObInitMap.put(new Pair<String, String>("anz", "net/minecraft/block/BlockTallGrass"));
- mObInitMap.put(new Pair<String, String>("bca", "net/minecraft/client/gui/ScaledResolution"));
- mObInitMap.put(new Pair<String, String>("ow", "net/minecraft/network/rcon/RConThreadBase"));
- mObInitMap.put(new Pair<String, String>("kx", "net/minecraft/init/Bootstrap$6"));
- mObInitMap.put(
- new Pair<String, String>("gy", "net/minecraft/network/play/server/S21PacketChunkData$Extracted"));
- mObInitMap.put(new Pair<String, String>("cz", "net/minecraft/util/IRegistry"));
- mObInitMap.put(new Pair<String, String>("acq", "net/minecraft/item/ItemFireball"));
- mObInitMap.put(new Pair<String, String>("agp", "net/minecraft/command/server/CommandBlockLogic"));
- mObInitMap.put(new Pair<String, String>("bsp", "net/minecraft/client/audio/SoundList"));
- mObInitMap.put(new Pair<String, String>("boq", "net/minecraft/client/renderer/entity/RenderSheep"));
- mObInitMap.put(new Pair<String, String>("arx", "net/minecraft/world/gen/feature/WorldGenLakes"));
- mObInitMap.put(new Pair<String, String>("avw",
- "net/minecraft/world/gen/structure/StructureVillagePieces$House4Garden"));
- mObInitMap.put(new Pair<String, String>("azv", "net/minecraft/util/MovingObjectPosition$MovingObjectType"));
- mObInitMap.put(new Pair<String, String>("bct", "net/minecraft/client/gui/GuiChat"));
- mObInitMap.put(new Pair<String, String>("bgs", "net/minecraft/client/gui/stream/GuiTwitchUserMode"));
- mObInitMap.put(new Pair<String, String>("bkr", "net/minecraft/client/particle/EffectRenderer$4"));
- mObInitMap.put(new Pair<String, String>("dn", "net/minecraft/nbt/NBTTagIntArray"));
- mObInitMap.put(new Pair<String, String>("wt", "net/minecraft/entity/monster/EntityIronGolem"));
- mObInitMap.put(new Pair<String, String>("su", "net/minecraft/entity/EntityLeashKnot"));
- mObInitMap.put(new Pair<String, String>("asl", "net/minecraft/world/gen/feature/WorldGenSpikes"));
- mObInitMap.put(new Pair<String, String>("aom", "net/minecraft/block/BlockWood"));
- mObInitMap.put(new Pair<String, String>("akn", "net/minecraft/block/BlockDoor"));
- mObInitMap.put(new Pair<String, String>("ago", "net/minecraft/village/MerchantRecipeList"));
- mObInitMap.put(new Pair<String, String>("awk", "net/minecraft/world/gen/NoiseGeneratorOctaves"));
- mObInitMap.put(new Pair<String, String>("bdh", "net/minecraft/client/gui/GuiErrorScreen"));
- mObInitMap.put(new Pair<String, String>("bhg", "net/minecraft/client/model/ModelChest"));
- mObInitMap.put(new Pair<String, String>("bso", "net/minecraft/client/audio/PositionedSoundRecord"));
- mObInitMap.put(new Pair<String, String>("xh", "net/minecraft/entity/effect/EntityLightningBolt"));
- mObInitMap.put(new Pair<String, String>("ti", "net/minecraft/entity/ai/attributes/IAttributeInstance"));
- mObInitMap.put(new Pair<String, String>("pj", "net/minecraft/stats/StatBase$2"));
- mObInitMap.put(new Pair<String, String>("lk", "net/minecraft/server/MinecraftServer$4"));
- mObInitMap.put(new Pair<String, String>("apa", "net/minecraft/tileentity/TileEntityDaylightDetector"));
- mObInitMap.put(new Pair<String, String>("alb", "net/minecraft/block/BlockFire"));
- mObInitMap.put(new Pair<String, String>("add", "net/minecraft/item/ItemStack"));
- mObInitMap.put(new Pair<String, String>("ahc", "net/minecraft/world/World$1"));
- mObInitMap.put(new Pair<String, String>("btc",
- "net/minecraft/client/network/LanServerDetector$ThreadLanServerFind"));
- mObInitMap
- .put(new Pair<String, String>("bpd", "net/minecraft/client/renderer/tileentity/RenderWitherSkull"));
- mObInitMap.put(new Pair<String, String>("bhf", "net/minecraft/client/model/ModelBook"));
- mObInitMap.put(new Pair<String, String>("ble", "net/minecraft/client/particle/EntityFishWakeFX"));
- mObInitMap.put(new Pair<String, String>("ea", "net/minecraft/nbt/NBTException"));
- mObInitMap.put(new Pair<String, String>("ab", "net/minecraft/command/ICommandManager"));
- mObInitMap.put(new Pair<String, String>("adw", "net/minecraft/item/ItemSeeds"));
- mObInitMap.put(new Pair<String, String>("ahv", "net/minecraft/world/biome/BiomeGenBase$Height"));
- mObInitMap.put(new Pair<String, String>("btv", "net/minecraft/client/audio/SoundEventAccessor"));
- mObInitMap.put(new Pair<String, String>("bpw", "net/minecraft/client/renderer/texture/Stitcher$Holder"));
- mObInitMap.put(new Pair<String, String>("bdz", "net/minecraft/client/gui/GuiShareToLan"));
- mObInitMap.put(new Pair<String, String>("bhy", "net/minecraft/client/model/ModelSheep2"));
- mObInitMap.put(new Pair<String, String>("blx", "net/minecraft/client/renderer/IImageBuffer"));
- mObInitMap.put(
- new Pair<String, String>("mr", "net/minecraft/server/management/PlayerManager$PlayerInstance"));
- mObInitMap.put(new Pair<String, String>("is", "net/minecraft/network/play/client/C16PacketClientStatus"));
- mObInitMap.put(new Pair<String, String>("et", "net/minecraft/network/PacketBuffer"));
- mObInitMap.put(new Pair<String, String>("au", "net/minecraft/command/CommandHelp"));
- mObInitMap.put(new Pair<String, String>("aek", "net/minecraft/item/ItemCloth"));
- mObInitMap.put(new Pair<String, String>("aal", "net/minecraft/inventory/ContainerHopper"));
- mObInitMap.put(new Pair<String, String>("l", "net/minecraft/crash/CrashReportCategory$1"));
- mObInitMap.put(
- new Pair<String, String>("bqk", "net/minecraft/client/renderer/texture/ITickableTextureObject"));
- mObInitMap.put(new Pair<String, String>("atr",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Throne"));
- mObInitMap.put(new Pair<String, String>("aps", "net/minecraft/tileentity/TileEntityPiston"));
- mObInitMap.put(new Pair<String, String>("axq", "net/minecraft/world/gen/layer/GenLayerRareBiome"));
- mObInitMap.put(new Pair<String, String>("bao", "net/minecraft/client/Minecraft"));
- mObInitMap.put(new Pair<String, String>("ben", "net/minecraft/client/gui/achievement/GuiStats$StatsItem"));
- mObInitMap.put(new Pair<String, String>("bim", "net/minecraft/client/model/ModelWitch"));
- mObInitMap.put(new Pair<String, String>("bml",
- "net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer"));
- mObInitMap.put(new Pair<String, String>("fh", "net/minecraft/event/ClickEvent"));
- mObInitMap.put(new Pair<String, String>("bi", "net/minecraft/command/server/CommandSaveOff"));
- mObInitMap.put(new Pair<String, String>("yn", "net/minecraft/entity/monster/EntitySpider"));
- mObInitMap.put(new Pair<String, String>("uo", "net/minecraft/entity/ai/EntityAILookAtTradePlayer"));
- mObInitMap.put(new Pair<String, String>("aqg",
- "net/minecraft/world/chunk/storage/ChunkLoader$AnvilConverterData"));
- mObInitMap.put(new Pair<String, String>("amh", "net/minecraft/block/BlockNewLeaf"));
- mObInitMap.put(new Pair<String, String>("aii", "net/minecraft/world/biome/BiomeGenHell"));
- mObInitMap.put(new Pair<String, String>("auf",
- "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$SwampHut"));
- mObInitMap.put(new Pair<String, String>("aye", "net/minecraft/pathfinding/PathPoint"));
- mObInitMap.put(new Pair<String, String>("bbc", "net/minecraft/client/Minecraft$6"));
- mObInitMap
- .put(new Pair<String, String>("bfb", "net/minecraft/client/gui/inventory/GuiBeacon$ConfirmButton"));
- mObInitMap.put(new Pair<String, String>("bui", "net/minecraft/client/stream/IngestServerTester"));
- mObInitMap.put(new Pair<String, String>("bqj", "net/minecraft/client/renderer/texture/ITickable"));
- mObInitMap
- .put(new Pair<String, String>("zb", "net/minecraft/entity/player/EntityPlayer$EnumChatVisibility"));
- mObInitMap.put(new Pair<String, String>("vc", "net/minecraft/entity/ai/EntityAIWander"));
- mObInitMap.put(new Pair<String, String>("rd", "net/minecraft/world/EnumDifficulty"));
- mObInitMap.put(new Pair<String, String>("ne", "net/minecraft/network/NetworkSystem$2"));
- mObInitMap.put(new Pair<String, String>("jf",
- "net/minecraft/network/play/client/C03PacketPlayer$C06PacketPlayerPosLook"));
- mObInitMap.put(new Pair<String, String>("fg", "net/minecraft/util/ChatComponentStyle$2"));
- mObInitMap.put(new Pair<String, String>("aqz", "net/minecraft/world/gen/ChunkProviderGenerate"));
- mObInitMap.put(new Pair<String, String>("auy",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs"));
- mObInitMap.put(new Pair<String, String>("ayx", "net/minecraft/world/storage/WorldInfo$5"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RealmsSliderButton",
- "net/minecraft/realms/RealmsSliderButton"));
- mObInitMap.put(new Pair<String, String>("zu", "net/minecraft/inventory/ContainerRepair"));
- mObInitMap.put(new Pair<String, String>("vv", "net/minecraft/pathfinding/PathNavigate"));
- mObInitMap.put(new Pair<String, String>("rw", "net/minecraft/potion/PotionEffect"));
- mObInitMap.put(new Pair<String, String>("nx", "net/minecraft/server/management/BanList"));
- mObInitMap.put(new Pair<String, String>("jy", "net/minecraft/network/status/INetHandlerStatusClient"));
- mObInitMap.put(new Pair<String, String>("fz", "net/minecraft/network/play/server/S0FPacketSpawnMob"));
- mObInitMap.put(new Pair<String, String>("arn", "net/minecraft/world/gen/feature/WorldGenerator"));
- mObInitMap.put(new Pair<String, String>("ano", "net/minecraft/block/BlockSoulSand"));
- mObInitMap.put(new Pair<String, String>("abr", "net/minecraft/item/ItemColored"));
- mObInitMap.put(new Pair<String, String>("afq", "net/minecraft/enchantment/EnchantmentDamage"));
- mObInitMap.put(new Pair<String, String>("ajp", "net/minecraft/block/BlockBookshelf"));
- mObInitMap.put(new Pair<String, String>("brq", "net/minecraft/client/resources/Language"));
- mObInitMap.put(new Pair<String, String>("bbu", "net/minecraft/client/gui/FontRenderer"));
- mObInitMap
- .put(new Pair<String, String>("bft", "net/minecraft/client/gui/inventory/GuiScreenHorseInventory"));
- mObInitMap.put(new Pair<String, String>("bjs", "net/minecraft/client/network/OldServerPinger$2"));
- mObInitMap.put(new Pair<String, String>("bnr", "net/minecraft/client/renderer/entity/RenderFireball"));
- mObInitMap.put(new Pair<String, String>("sk", "net/minecraft/command/IEntitySelector$1"));
- mObInitMap.put(new Pair<String, String>("ol", "net/minecraft/server/management/UserListEntry"));
- mObInitMap.put(new Pair<String, String>("km", "net/minecraft/init/Bootstrap$1"));
- mObInitMap.put(new Pair<String, String>("gn", "net/minecraft/network/play/server/S2DPacketOpenWindow"));
- mObInitMap.put(new Pair<String, String>("co", "net/minecraft/util/RegistryDefaulted"));
- mObInitMap.put(new Pair<String, String>("acf", "net/minecraft/creativetab/CreativeTabs$9"));
- mObInitMap.put(new Pair<String, String>("age", "net/minecraft/enchantment/EnchantmentFishingSpeed"));
- mObInitMap.put(
- new Pair<String, String>("bse", "net/minecraft/client/resources/data/LanguageMetadataSection"));
- mObInitMap.put(new Pair<String, String>("arm", "net/minecraft/world/gen/feature/WorldGenDoublePlant"));
- mObInitMap.put(new Pair<String, String>("avl",
- "net/minecraft/world/gen/structure/StructureComponent$BlockSelector"));
- mObInitMap.put(new Pair<String, String>("bci", "net/minecraft/client/gui/GuiListExtended$IGuiListEntry"));
- mObInitMap.put(
- new Pair<String, String>("bgh", "net/minecraft/client/resources/ResourcePackListEntryDefault"));
- mObInitMap.put(new Pair<String, String>("bkg", "net/minecraft/client/particle/EntityFootStepFX"));
- mObInitMap.put(new Pair<String, String>("bof", "net/minecraft/client/renderer/entity/RenderLeashKnot"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/server/MinecraftServer",
- "net/minecraft/server/MinecraftServer"));
- mObInitMap.put(new Pair<String, String>("hb", "net/minecraft/network/play/server/S2APacketParticles"));
- mObInitMap.put(new Pair<String, String>("wi", "net/minecraft/entity/passive/EntityHorse"));
- mObInitMap.put(new Pair<String, String>("sj", "net/minecraft/command/IEntitySelector"));
- mObInitMap.put(new Pair<String, String>("asa", "net/minecraft/world/gen/feature/WorldGenMegaPineTree"));
- mObInitMap.put(new Pair<String, String>("aob", "net/minecraft/block/BlockTNT"));
- mObInitMap.put(new Pair<String, String>("akc", "net/minecraft/block/BlockRedstoneComparator"));
- mObInitMap.put(new Pair<String, String>("agd", "net/minecraft/enchantment/EnchantmentFireAspect"));
- mObInitMap.put(new Pair<String, String>("bsd",
- "net/minecraft/client/resources/data/FontMetadataSectionSerializer"));
- mObInitMap.put(new Pair<String, String>("ha", "net/minecraft/network/play/server/S28PacketEffect"));
- mObInitMap.put(new Pair<String, String>("ast", "net/minecraft/world/gen/FlatLayerInfo"));
- mObInitMap.put(new Pair<String, String>("aou", "net/minecraft/tileentity/TileEntity$3"));
- mObInitMap.put(new Pair<String, String>("akv", "net/minecraft/block/BlockEnderChest"));
- mObInitMap.put(new Pair<String, String>("acx", "net/minecraft/item/ItemFood"));
- mObInitMap.put(new Pair<String, String>("agw", "net/minecraft/world/Explosion"));
- mObInitMap.put(new Pair<String, String>("aws", "net/minecraft/block/material/MaterialLiquid"));
- mObInitMap.put(new Pair<String, String>("bsw", "net/minecraft/server/integrated/IntegratedPlayerList"));
- mObInitMap.put(new Pair<String, String>("box", "net/minecraft/client/renderer/entity/RenderTntMinecart"));
- mObInitMap.put(new Pair<String, String>("bky", "net/minecraft/client/particle/EntitySplashFX"));
- mObInitMap.put(new Pair<String, String>("xp", "net/minecraft/entity/item/EntityMinecartContainer"));
- mObInitMap.put(new Pair<String, String>("tq", "net/minecraft/entity/ai/attributes/ServersideAttributeMap"));
- mObInitMap.put(new Pair<String, String>("pr", "net/minecraft/util/JsonSerializableSet"));
- mObInitMap.put(new Pair<String, String>("ls", "net/minecraft/server/dedicated/DedicatedPlayerList"));
- mObInitMap.put(new Pair<String, String>("ht", "net/minecraft/network/play/server/S19PacketEntityHeadLook"));
- mObInitMap.put(new Pair<String, String>("du", "net/minecraft/nbt/CompressedStreamTools"));
- mObInitMap.put(new Pair<String, String>("api", "net/minecraft/tileentity/TileEntityHopper"));
- mObInitMap.put(new Pair<String, String>("alj", "net/minecraft/block/BlockSlab"));
- mObInitMap.put(new Pair<String, String>("adl", "net/minecraft/item/ItemMultiTexture"));
- mObInitMap.put(new Pair<String, String>("ahk", "net/minecraft/world/WorldSettings$GameType"));
- mObInitMap.put(new Pair<String, String>("btk", "net/minecraft/client/audio/SoundManager$1"));
- mObInitMap.put(new Pair<String, String>("bpl", "net/minecraft/client/shader/ShaderLoader"));
- mObInitMap.put(new Pair<String, String>("bdo", "net/minecraft/client/gui/GuiMemoryErrorScreen"));
- mObInitMap.put(new Pair<String, String>("bhn", "net/minecraft/client/model/ModelLargeChest"));
- mObInitMap.put(new Pair<String, String>("blm", "net/minecraft/client/renderer/RenderBlocks"));
- mObInitMap.put(new Pair<String, String>("qf", "net/minecraft/util/EnumTypeAdapterFactory"));
- mObInitMap.put(new Pair<String, String>("mg", "net/minecraft/server/gui/StatsComponent$1"));
- mObInitMap.put(new Pair<String, String>("ih", "net/minecraft/network/play/server/S03PacketTimeUpdate"));
- mObInitMap.put(new Pair<String, String>("ei", "net/minecraft/network/NettyEncryptingEncoder"));
- mObInitMap.put(new Pair<String, String>("aj", "net/minecraft/command/server/CommandDeOp"));
- mObInitMap.put(new Pair<String, String>("aaa", "net/minecraft/inventory/ContainerBrewingStand$Ingredient"));
- mObInitMap.put(new Pair<String, String>("a", "net/minecraft/util/EnumChatFormatting"));
- mObInitMap.put(new Pair<String, String>("atg",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing3"));
- mObInitMap.put(new Pair<String, String>("axf", "net/minecraft/world/gen/layer/GenLayerBiome"));
- mObInitMap.put(new Pair<String, String>("bad", "net/minecraft/scoreboard/ScoreboardSaveData"));
- mObInitMap.put(new Pair<String, String>("bec", "net/minecraft/client/gui/GuiScreenOptionsSounds"));
- mObInitMap.put(new Pair<String, String>("bib", "net/minecraft/client/model/ModelSkeletonHead"));
- mObInitMap.put(new Pair<String, String>("bma", "net/minecraft/client/renderer/RenderGlobal"));
- mObInitMap.put(new Pair<String, String>("yc", "net/minecraft/entity/monster/IMob$1"));
- mObInitMap.put(new Pair<String, String>("ud", "net/minecraft/entity/ai/EntityAIEatGrass"));
- mObInitMap.put(new Pair<String, String>("qe", "net/minecraft/util/LongHashMap$Entry"));
- mObInitMap.put(new Pair<String, String>("t", "net/minecraft/util/ChatAllowedCharacters"));
- mObInitMap.put(new Pair<String, String>("atz",
- "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces"));
- mObInitMap.put(new Pair<String, String>("baw", "net/minecraft/client/Minecraft$16"));
- mObInitMap.put(new Pair<String, String>("bev", "net/minecraft/client/gui/GuiKeyBindingList$KeyEntry"));
- mObInitMap.put(new Pair<String, String>("yv", "net/minecraft/entity/passive/EntityVillager"));
- mObInitMap.put(new Pair<String, String>("uw", "net/minecraft/entity/ai/EntityAIOcelotSit"));
- mObInitMap.put(new Pair<String, String>("qx", "net/minecraft/util/WeightedRandomChestContent"));
- mObInitMap.put(new Pair<String, String>("my", "net/minecraft/entity/EntityTrackerEntry"));
- mObInitMap.put(new Pair<String, String>("iz", "net/minecraft/network/play/client/C17PacketCustomPayload"));
- mObInitMap.put(new Pair<String, String>("aqo", "net/minecraft/world/WorldProvider"));
- mObInitMap.put(new Pair<String, String>("amp", "net/minecraft/block/BlockPortal"));
- mObInitMap.put(new Pair<String, String>("aas", "net/minecraft/inventory/InventoryMerchant"));
- mObInitMap.put(new Pair<String, String>("aun",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Corridor"));
- mObInitMap.put(new Pair<String, String>("aym", "net/minecraft/world/chunk/storage/AnvilSaveHandler"));
- mObInitMap.put(new Pair<String, String>("buq", "net/minecraft/client/stream/TwitchStream$1$1"));
- mObInitMap.put(new Pair<String, String>("bqr", "net/minecraft/client/resources/FileResourcePack"));
- mObInitMap.put(new Pair<String, String>("bms",
- "net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer"));
- mObInitMap.put(new Pair<String, String>("zj", "net/minecraft/entity/projectile/EntitySnowball"));
- mObInitMap.put(new Pair<String, String>("vk", "net/minecraft/entity/ai/EntityAITempt"));
- mObInitMap.put(new Pair<String, String>("rl", "net/minecraft/inventory/ISidedInventory"));
- mObInitMap.put(new Pair<String, String>("nm",
- "net/minecraft/server/network/NetHandlerHandshakeTCP$SwitchEnumConnectionState"));
- mObInitMap.put(new Pair<String, String>("jn", "net/minecraft/network/play/client/C12PacketUpdateSign"));
- mObInitMap.put(new Pair<String, String>("fo", "net/minecraft/util/ChatStyle$1"));
- mObInitMap.put(new Pair<String, String>("bp", "net/minecraft/command/CommandSetSpawnpoint"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RealmsServerAddress",
- "net/minecraft/realms/RealmsServerAddress"));
- mObInitMap.put(new Pair<String, String>("arc", "net/minecraft/world/gen/feature/WorldGenAbstractTree"));
- mObInitMap.put(new Pair<String, String>("and", "net/minecraft/block/BlockRedstoneTorch$Toggle"));
- mObInitMap.put(new Pair<String, String>("abg", "net/minecraft/item/ItemBed"));
- mObInitMap.put(new Pair<String, String>("aff", "net/minecraft/item/crafting/CraftingManager$1"));
- mObInitMap.put(new Pair<String, String>("aje", "net/minecraft/block/BlockRailBase"));
- mObInitMap.put(
- new Pair<String, String>("brf", "net/minecraft/client/resources/ResourcePackRepository$Entry"));
- mObInitMap.put(new Pair<String, String>("bbj", "net/minecraft/client/settings/GameSettings"));
- mObInitMap.put(new Pair<String, String>("bfi", "net/minecraft/client/gui/inventory/GuiChest"));
- mObInitMap.put(new Pair<String, String>("bjh", "net/minecraft/client/multiplayer/WorldClient$2"));
- mObInitMap.put(new Pair<String, String>("bng", "net/minecraft/client/renderer/entity/RenderChicken"));
- mObInitMap.put(new Pair<String, String>("oa", "net/minecraft/server/management/PreYggdrasilConverter$1"));
- mObInitMap.put(new Pair<String, String>("kb", "net/minecraft/network/ServerStatusResponse"));
- mObInitMap.put(new Pair<String, String>("gc", "net/minecraft/network/play/server/S0BPacketAnimation"));
- mObInitMap.put(new Pair<String, String>("cd", "net/minecraft/command/CommandException"));
- mObInitMap.put(new Pair<String, String>("abz", "net/minecraft/creativetab/CreativeTabs$3"));
- mObInitMap.put(new Pair<String, String>("afy", "net/minecraft/enchantment/EnchantmentHelper$HurtIterator"));
- mObInitMap.put(new Pair<String, String>("bry",
- "net/minecraft/client/resources/data/IMetadataSerializer$Registration"));
- mObInitMap.put(new Pair<String, String>("ava",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Straight"));
- mObInitMap.put(new Pair<String, String>("bnz", "net/minecraft/client/renderer/entity/RenderItem$1"));
- mObInitMap
- .put(new Pair<String, String>("gv", "net/minecraft/network/play/server/S2BPacketChangeGameState"));
- mObInitMap.put(new Pair<String, String>("cw", "net/minecraft/util/RegistryNamespaced"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RealmsScrolledSelectionList",
- "net/minecraft/realms/RealmsScrolledSelectionList"));
- mObInitMap.put(new Pair<String, String>("aru", "net/minecraft/world/gen/feature/WorldGenBigMushroom"));
- mObInitMap.put(new Pair<String, String>("anv", "net/minecraft/block/BlockStone"));
- mObInitMap
- .put(new Pair<String, String>("afx", "net/minecraft/enchantment/EnchantmentHelper$DamageIterator"));
- mObInitMap.put(new Pair<String, String>("ajw", "net/minecraft/block/BlockCauldron"));
- mObInitMap.put(
- new Pair<String, String>("avt", "net/minecraft/world/gen/structure/StructureVillagePieces$Torch"));
- mObInitMap.put(new Pair<String, String>("azs", "net/minecraft/world/storage/IThreadedFileIO"));
- mObInitMap.put(new Pair<String, String>("bcq", "net/minecraft/client/gui/GuiScreenRealmsProxy"));
- mObInitMap.put(new Pair<String, String>("bgp", "net/minecraft/client/gui/stream/GuiStreamUnavailable"));
- mObInitMap
- .put(new Pair<String, String>("brx", "net/minecraft/client/resources/data/IMetadataSerializer$1"));
- mObInitMap.put(new Pair<String, String>("wq", "net/minecraft/entity/passive/EntitySheep$1"));
- mObInitMap.put(new Pair<String, String>("sr", "net/minecraft/entity/EntityFlying"));
- mObInitMap.put(new Pair<String, String>("os", "net/minecraft/server/management/UserListWhitelistEntry"));
- mObInitMap.put(new Pair<String, String>("kt", "net/minecraft/init/Bootstrap$3"));
- mObInitMap.put(new Pair<String, String>("gu", "net/minecraft/network/play/server/S27PacketExplosion"));
- mObInitMap.put(new Pair<String, String>("asi", "net/minecraft/world/gen/feature/WorldGenCanopyTree"));
- mObInitMap.put(new Pair<String, String>("aoj", "net/minecraft/block/BlockLilyPad"));
- mObInitMap.put(new Pair<String, String>("akk", "net/minecraft/block/BlockDirectional"));
- mObInitMap.put(new Pair<String, String>("acm", "net/minecraft/item/ItemEnchantedBook"));
- mObInitMap.put(new Pair<String, String>("agl", "net/minecraft/enchantment/EnchantmentWaterWorker"));
- mObInitMap.put(new Pair<String, String>("bsl", "net/minecraft/client/audio/MovingSound"));
- mObInitMap.put(new Pair<String, String>("bom", "net/minecraft/client/renderer/entity/RenderOcelot"));
- mObInitMap.put(new Pair<String, String>("bgo", "net/minecraft/client/gui/stream/GuiStreamOptions"));
- mObInitMap.put(new Pair<String, String>("bkn", "net/minecraft/client/particle/EffectRenderer"));
- mObInitMap.put(
- new Pair<String, String>("net/minecraft/realms/RealmsScreen", "net/minecraft/realms/RealmsScreen"));
- mObInitMap.put(new Pair<String, String>("xe", "net/minecraft/entity/projectile/EntityFishHook"));
- mObInitMap.put(new Pair<String, String>("tf", "net/minecraft/entity/DataWatcher$WatchableObject"));
- mObInitMap.put(new Pair<String, String>("pg", "net/minecraft/stats/StatisticsFile"));
- mObInitMap.put(new Pair<String, String>("lh", "net/minecraft/server/MinecraftServer$1"));
- mObInitMap.put(new Pair<String, String>("hi",
- "net/minecraft/network/play/server/S14PacketEntity$S16PacketEntityLook"));
- mObInitMap.put(new Pair<String, String>("dj", "net/minecraft/nbt/NBTTagCompound$2"));
- mObInitMap.put(new Pair<String, String>("ada", "net/minecraft/item/ItemHoe"));
- mObInitMap.put(new Pair<String, String>("bpa", "net/minecraft/client/renderer/entity/RenderVillager"));
- mObInitMap.put(new Pair<String, String>("bdd", "net/minecraft/client/gui/GuiScreenDemo"));
- mObInitMap.put(new Pair<String, String>("bhc", "net/minecraft/client/model/ModelBat"));
- mObInitMap.put(new Pair<String, String>("blb", "net/minecraft/client/particle/EntityPickupFX"));
- mObInitMap.put(new Pair<String, String>("pz", "net/minecraft/util/IntHashMap"));
- mObInitMap.put(new Pair<String, String>("adt", "net/minecraft/item/ItemSaddle"));
- mObInitMap.put(new Pair<String, String>("ahs", "net/minecraft/world/NextTickListEntry"));
- mObInitMap.put(new Pair<String, String>("bts", "net/minecraft/client/audio/SoundHandler$SwitchType"));
- mObInitMap.put(new Pair<String, String>("bpt", "net/minecraft/client/renderer/texture/LayeredTexture"));
- mObInitMap.put(new Pair<String, String>("awz", "net/minecraft/world/gen/layer/GenLayerEdge$SwitchMode"));
- mObInitMap.put(new Pair<String, String>("bdw", "net/minecraft/client/gui/GuiScreen"));
- mObInitMap.put(new Pair<String, String>("bhv", "net/minecraft/client/model/TexturedQuad"));
- mObInitMap.put(new Pair<String, String>("blu", "net/minecraft/client/renderer/EntityRenderer$1"));
- mObInitMap.put(new Pair<String, String>("ip", "net/minecraft/network/play/client/C0APacketAnimation"));
- mObInitMap.put(new Pair<String, String>("eq", "net/minecraft/network/EnumConnectionState$4"));
- mObInitMap.put(new Pair<String, String>("ar", "net/minecraft/command/CommandGameMode"));
- mObInitMap.put(new Pair<String, String>("xw", "net/minecraft/entity/item/EntityTNTPrimed"));
- mObInitMap.put(new Pair<String, String>("tx", "net/minecraft/entity/ai/EntityAIAvoidEntity$1"));
- mObInitMap.put(new Pair<String, String>("i", "net/minecraft/crash/CrashReport$7"));
- mObInitMap.put(new Pair<String, String>("ato",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor5"));
- mObInitMap.put(new Pair<String, String>("app", "net/minecraft/block/BlockPistonBase"));
- mObInitMap.put(new Pair<String, String>("alq", "net/minecraft/block/BlockJukebox"));
- mObInitMap.put(new Pair<String, String>("ahr", "net/minecraft/world/ChunkCache"));
- mObInitMap.put(new Pair<String, String>("axn", "net/minecraft/world/gen/layer/GenLayer"));
- mObInitMap.put(new Pair<String, String>("bal", "net/minecraft/client/settings/KeyBinding"));
- mObInitMap.put(new Pair<String, String>("bek", "net/minecraft/client/gui/achievement/GuiStats$StatsBlock"));
- mObInitMap.put(new Pair<String, String>("bij", "net/minecraft/client/model/ModelIronGolem"));
- mObInitMap.put(new Pair<String, String>("btr", "net/minecraft/client/audio/SoundHandler$2"));
- mObInitMap.put(new Pair<String, String>("yk", "net/minecraft/entity/monster/EntitySilverfish"));
- mObInitMap.put(new Pair<String, String>("ul", "net/minecraft/entity/ai/EntityAIWatchClosest2"));
- mObInitMap.put(new Pair<String, String>("qm", "net/minecraft/util/MouseFilter"));
- mObInitMap.put(new Pair<String, String>("mn", "net/minecraft/entity/EntityTracker"));
- mObInitMap.put(new Pair<String, String>("io", "net/minecraft/network/play/INetHandlerPlayServer"));
- mObInitMap.put(new Pair<String, String>("aeg", "net/minecraft/item/ItemSlab"));
- mObInitMap.put(new Pair<String, String>("aah", "net/minecraft/inventory/ContainerEnchantment$1"));
- mObInitMap.put(new Pair<String, String>("aif", "net/minecraft/world/biome/BiomeGenForest"));
- mObInitMap.put(new Pair<String, String>("auc",
- "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid"));
- mObInitMap.put(new Pair<String, String>("ayb", "net/minecraft/world/gen/layer/GenLayerVoronoiZoom"));
- mObInitMap
- .put(new Pair<String, String>("buf", "net/minecraft/client/stream/ChatController$SwitchChatState"));
- mObInitMap.put(new Pair<String, String>("bqg", "net/minecraft/client/renderer/texture/TextureManager$1"));
- mObInitMap.put(new Pair<String, String>("bii", "net/minecraft/client/model/PositionTextureVertex"));
- mObInitMap.put(new Pair<String, String>("bmh", "net/minecraft/client/renderer/Tessellator"));
- mObInitMap.put(new Pair<String, String>("ra", "net/minecraft/inventory/InventoryLargeChest"));
- mObInitMap.put(new Pair<String, String>("nb",
- "net/minecraft/client/network/NetHandlerHandshakeMemory$SwitchEnumConnectionState"));
- mObInitMap.put(new Pair<String, String>("jc", "net/minecraft/network/play/client/C00PacketKeepAlive"));
- mObInitMap.put(new Pair<String, String>("fd", "net/minecraft/util/MessageSerializer2"));
- mObInitMap.put(new Pair<String, String>("be", "net/minecraft/command/server/CommandPardonPlayer"));
- mObInitMap.put(new Pair<String, String>("aqw", "net/minecraft/world/gen/MapGenCaves"));
- mObInitMap.put(new Pair<String, String>("amx", "net/minecraft/block/BlockQuartz"));
- mObInitMap.put(new Pair<String, String>("aez", "net/minecraft/item/crafting/RecipesFood"));
- mObInitMap.put(new Pair<String, String>("aiy", "net/minecraft/world/biome/BiomeEndDecorator"));
- mObInitMap.put(
- new Pair<String, String>("bqz", "net/minecraft/client/resources/IResourceManagerReloadListener"));
- mObInitMap.put(new Pair<String, String>("rt", "net/minecraft/potion/PotionHealthBoost"));
- mObInitMap.put(new Pair<String, String>("nu", "net/minecraft/server/management/PlayerProfileCache$2"));
- mObInitMap.put(new Pair<String, String>("jv", "net/minecraft/network/login/INetHandlerLoginServer"));
- mObInitMap.put(new Pair<String, String>("fw", "net/minecraft/network/play/server/S0EPacketSpawnObject"));
- mObInitMap.put(new Pair<String, String>("bx", "net/minecraft/command/server/CommandTestForBlock"));
- mObInitMap.put(new Pair<String, String>("abo", "net/minecraft/item/ItemBucket"));
- mObInitMap.put(new Pair<String, String>("afn", "net/minecraft/enchantment/EnchantmentArrowFire"));
- mObInitMap.put(new Pair<String, String>("brn", "net/minecraft/client/resources/SkinManager$3$1"));
- mObInitMap.put(new Pair<String, String>("aqv", "net/minecraft/world/gen/ChunkProviderHell"));
- mObInitMap.put(new Pair<String, String>("auu",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$RightTurn"));
- mObInitMap.put(new Pair<String, String>("ayt", "net/minecraft/world/storage/WorldInfo$1"));
- mObInitMap.put(new Pair<String, String>("bbr", "net/minecraft/util/Timer"));
- mObInitMap.put(new Pair<String, String>("bfq", "net/minecraft/client/gui/GuiEnchantment"));
- mObInitMap.put(new Pair<String, String>("bjp", "net/minecraft/client/multiplayer/ServerList"));
- mObInitMap.put(new Pair<String, String>("bno", "net/minecraft/client/renderer/entity/Render"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RealmsLevelSummary",
- "net/minecraft/realms/RealmsLevelSummary"));
- mObInitMap
- .put(new Pair<String, String>("gk", "net/minecraft/network/play/server/S22PacketMultiBlockChange"));
- mObInitMap.put(new Pair<String, String>("cl", "net/minecraft/block/BlockSourceImpl"));
- mObInitMap.put(new Pair<String, String>("vr", "net/minecraft/entity/ai/EntityAITargetNonTamed"));
- mObInitMap.put(new Pair<String, String>("rs", "net/minecraft/potion/PotionAttackDamage"));
- mObInitMap.put(new Pair<String, String>("arj", "net/minecraft/world/gen/feature/WorldGenClay"));
- mObInitMap.put(new Pair<String, String>("ank", "net/minecraft/block/BlockSign"));
- mObInitMap.put(new Pair<String, String>("ajl", "net/minecraft/block/Block$3"));
- mObInitMap.put(new Pair<String, String>("avi", "net/minecraft/world/gen/structure/MapGenStructureIO"));
- mObInitMap.put(new Pair<String, String>("bcf", "net/minecraft/client/gui/GuiButtonLanguage"));
- mObInitMap.put(new Pair<String, String>("bge", "net/minecraft/client/gui/ServerSelectionList"));
- mObInitMap.put(new Pair<String, String>("wf", "net/minecraft/entity/passive/EntityAnimal"));
- mObInitMap.put(new Pair<String, String>("sg", "net/minecraft/entity/EntityList"));
- mObInitMap.put(new Pair<String, String>("oh",
- "net/minecraft/server/management/PreYggdrasilConverter$ConversionError"));
- mObInitMap.put(new Pair<String, String>("ki", "net/minecraft/network/status/client/C01PacketPing"));
- mObInitMap.put(new Pair<String, String>("gj", "net/minecraft/network/play/server/S02PacketChat"));
- mObInitMap.put(new Pair<String, String>("acb", "net/minecraft/creativetab/CreativeTabs$5"));
- mObInitMap
- .put(new Pair<String, String>("aga", "net/minecraft/enchantment/EnchantmentHelper$ModifierLiving"));
- mObInitMap.put(
- new Pair<String, String>("bsa", "net/minecraft/client/resources/data/AnimationMetadataSection"));
- mObInitMap.put(new Pair<String, String>("bkc", "net/minecraft/client/particle/EntityFireworkOverlayFX"));
- mObInitMap.put(new Pair<String, String>("bob", "net/minecraft/client/renderer/entity/RenderItem$3"));
- mObInitMap.put(new Pair<String, String>("wy", "net/minecraft/entity/boss/EntityDragonPart"));
- mObInitMap.put(new Pair<String, String>("sz", "net/minecraft/entity/EnumCreatureAttribute"));
- mObInitMap.put(new Pair<String, String>("asq", "net/minecraft/world/gen/feature/WorldGenTrees"));
- mObInitMap.put(new Pair<String, String>("aor", "net/minecraft/tileentity/TileEntity"));
- mObInitMap.put(new Pair<String, String>("aks", "net/minecraft/block/BlockEnchantmentTable"));
- mObInitMap.put(new Pair<String, String>("acu", "net/minecraft/item/ItemFishFood$FishType"));
- mObInitMap.put(new Pair<String, String>("agt", "net/minecraft/world/ChunkPosition"));
- mObInitMap.put(new Pair<String, String>("bst", "net/minecraft/client/audio/ISound"));
- mObInitMap.put(new Pair<String, String>("bou", "net/minecraft/client/renderer/entity/RenderSnowMan"));
- mObInitMap.put(new Pair<String, String>("bcx", "net/minecraft/client/multiplayer/GuiConnecting"));
- mObInitMap.put(new Pair<String, String>("bgw", "net/minecraft/client/main/Main$3"));
- mObInitMap.put(new Pair<String, String>("bkv", "net/minecraft/client/particle/EntitySmokeFX"));
- mObInitMap.put(
- new Pair<String, String>("tn", "net/minecraft/entity/ai/attributes/ModifiableAttributeInstance"));
- mObInitMap.put(new Pair<String, String>("po", "net/minecraft/util/IJsonSerializable"));
- mObInitMap.put(new Pair<String, String>("lp", "net/minecraft/scoreboard/ServerScoreboard"));
- mObInitMap
- .put(new Pair<String, String>("hq", "net/minecraft/network/play/server/S13PacketDestroyEntities"));
- mObInitMap.put(new Pair<String, String>("dr", "net/minecraft/nbt/NBTTagLong"));
- mObInitMap.put(new Pair<String, String>("adi", "net/minecraft/item/ItemBucketMilk"));
- mObInitMap.put(new Pair<String, String>("ahh", "net/minecraft/world/IWorldAccess"));
- mObInitMap.put(new Pair<String, String>("bth", "net/minecraft/client/audio/MusicTicker$MusicType"));
- mObInitMap.put(new Pair<String, String>("bpi", "net/minecraft/client/shader/ShaderManager"));
- mObInitMap.put(new Pair<String, String>("asp", "net/minecraft/world/gen/feature/WorldGenTallGrass"));
- mObInitMap.put(new Pair<String, String>("awo", "net/minecraft/world/gen/NoiseGeneratorSimplex"));
- mObInitMap.put(new Pair<String, String>("bhk", "net/minecraft/client/model/ModelEnderman"));
- mObInitMap.put(new Pair<String, String>("blj", "net/minecraft/util/MovementInputFromOptions"));
- mObInitMap.put(new Pair<String, String>("ie", "net/minecraft/network/play/server/S3CPacketUpdateScore"));
- mObInitMap.put(new Pair<String, String>("ef", "net/minecraft/nbt/JsonToNBT$Primitive"));
- mObInitMap.put(new Pair<String, String>("ag", "net/minecraft/command/server/CommandBanPlayer"));
- mObInitMap.put(new Pair<String, String>("xl", "net/minecraft/entity/item/EntityMinecart"));
- mObInitMap.put(new Pair<String, String>("atd", "net/minecraft/world/gen/structure/MapGenNetherBridge"));
- mObInitMap.put(new Pair<String, String>("ape", "net/minecraft/tileentity/TileEntityEnderChest"));
- mObInitMap.put(new Pair<String, String>("alf", "net/minecraft/block/BlockGlass"));
- mObInitMap.put(new Pair<String, String>("ahg", "net/minecraft/world/MinecraftException"));
- mObInitMap.put(new Pair<String, String>("axc", "net/minecraft/world/gen/layer/GenLayerAddMushroomIsland"));
- mObInitMap.put(new Pair<String, String>("baa", "net/minecraft/scoreboard/Score$1"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/DisconnectedOnlineScreen",
- "net/minecraft/realms/DisconnectedOnlineScreen"));
- mObInitMap.put(new Pair<String, String>("btg", "net/minecraft/client/audio/MusicTicker"));
- mObInitMap.put(new Pair<String, String>("ua", "net/minecraft/entity/ai/EntityAIMate"));
- mObInitMap.put(new Pair<String, String>("mc", "net/minecraft/server/gui/MinecraftServerGui$4"));
- mObInitMap.put(new Pair<String, String>("id", "net/minecraft/network/play/server/S3EPacketTeams"));
- mObInitMap.put(new Pair<String, String>("q", "net/minecraft/util/Facing"));
- mObInitMap.put(new Pair<String, String>("atw",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Start"));
- mObInitMap.put(new Pair<String, String>("apx", "net/minecraft/world/chunk/Chunk"));
- mObInitMap.put(new Pair<String, String>("aly", "net/minecraft/block/BlockMelon"));
- mObInitMap.put(new Pair<String, String>("ahz", "net/minecraft/world/biome/BiomeCache$Block"));
- mObInitMap.put(new Pair<String, String>("axv", "net/minecraft/world/gen/layer/GenLayerRiverMix"));
- mObInitMap.put(new Pair<String, String>("btz", "net/minecraft/client/stream/Metadata"));
- mObInitMap.put(new Pair<String, String>("ys", "net/minecraft/entity/monster/EntityZombie$GroupData"));
- mObInitMap.put(new Pair<String, String>("ut", "net/minecraft/entity/ai/EntityAIMoveTowardsRestriction"));
- mObInitMap.put(new Pair<String, String>("qu", "net/minecraft/util/Tuple"));
- mObInitMap.put(new Pair<String, String>("mv", "net/minecraft/world/WorldServer$ServerBlockEventList"));
- mObInitMap.put(new Pair<String, String>("iw", "net/minecraft/network/play/client/C11PacketEnchantItem"));
- mObInitMap.put(new Pair<String, String>("ex", "net/minecraft/network/NetworkStatistics$Tracker"));
- mObInitMap.put(new Pair<String, String>("ay", "net/minecraft/command/server/CommandListPlayers"));
- mObInitMap.put(
- new Pair<String, String>("aql", "net/minecraft/world/chunk/storage/AnvilChunkLoader$PendingChunk"));
- mObInitMap.put(new Pair<String, String>("amm", "net/minecraft/block/BlockOldLog"));
- mObInitMap.put(new Pair<String, String>("aap", "net/minecraft/inventory/ContainerPlayer"));
- mObInitMap.put(new Pair<String, String>("ain", "net/minecraft/world/biome/BiomeGenMutated"));
- mObInitMap.put(new Pair<String, String>("p", "net/minecraft/util/Direction"));
- mObInitMap.put(new Pair<String, String>("bun", "net/minecraft/client/stream/IStream$AuthFailureReason"));
- mObInitMap.put(new Pair<String, String>("bqo", "net/minecraft/client/resources/ResourceIndex"));
- mObInitMap.put(new Pair<String, String>("bas", "net/minecraft/client/Minecraft$12"));
- mObInitMap.put(new Pair<String, String>("ber", "net/minecraft/client/gui/IProgressMeter"));
- mObInitMap.put(new Pair<String, String>("biq", "net/minecraft/client/model/ModelDragon"));
- mObInitMap.put(new Pair<String, String>("bmp",
- "net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer"));
- mObInitMap.put(new Pair<String, String>("ri", "net/minecraft/profiler/PlayerUsageSnooper"));
- mObInitMap.put(new Pair<String, String>("nj", "net/minecraft/network/NetHandlerPlayServer$2"));
- mObInitMap.put(new Pair<String, String>("jk", "net/minecraft/network/play/client/C0CPacketInput"));
- mObInitMap.put(new Pair<String, String>("fl", "net/minecraft/event/HoverEvent"));
- mObInitMap.put(new Pair<String, String>("bm", "net/minecraft/command/server/CommandSetBlock"));
- mObInitMap.put(new Pair<String, String>("abd", "net/minecraft/item/ItemArmor$ArmorMaterial"));
- mObInitMap.put(new Pair<String, String>("afc", "net/minecraft/item/crafting/RecipesMapExtending"));
- mObInitMap.put(new Pair<String, String>("ajb", "net/minecraft/block/BlockAnvil"));
- mObInitMap.put(new Pair<String, String>("brc", "net/minecraft/client/resources/ResourcePackRepository"));
- mObInitMap.put(
- new Pair<String, String>("auj", "net/minecraft/world/gen/structure/StructureStrongholdPieces$1"));
- mObInitMap.put(new Pair<String, String>("ayi", "net/minecraft/world/storage/MapData"));
- mObInitMap.put(new Pair<String, String>("bbg", "net/minecraft/util/MouseHelper"));
- mObInitMap.put(new Pair<String, String>("bff", "net/minecraft/client/gui/GuiScreenBook$NextPageButton"));
- mObInitMap.put(new Pair<String, String>("bje", "net/minecraft/client/multiplayer/PlayerControllerMP"));
- mObInitMap.put(new Pair<String, String>("bnd", "net/minecraft/client/renderer/entity/RenderBlaze"));
- mObInitMap.put(new Pair<String, String>("ca", "net/minecraft/command/CommandToggleDownfall"));
- mObInitMap.put(new Pair<String, String>("zf", "net/minecraft/entity/item/EntityFireworkRocket"));
- mObInitMap.put(new Pair<String, String>("vg", "net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy"));
- mObInitMap.put(new Pair<String, String>("rh", "net/minecraft/inventory/InventoryBasic"));
- mObInitMap.put(new Pair<String, String>("aja", "net/minecraft/block/BlockAir"));
- mObInitMap.put(new Pair<String, String>("bbz", "net/minecraft/client/gui/MapItemRenderer$Instance"));
- mObInitMap.put(new Pair<String, String>("bfy", "net/minecraft/client/gui/inventory/GuiDispenser"));
- mObInitMap.put(new Pair<String, String>("bjx", "net/minecraft/client/particle/EntityCritFX"));
- mObInitMap.put(new Pair<String, String>("zy", "net/minecraft/inventory/ContainerBeacon$BeaconSlot"));
- mObInitMap.put(new Pair<String, String>("vz", "net/minecraft/village/Village"));
- mObInitMap.put(new Pair<String, String>("arr", "net/minecraft/world/gen/feature/WorldGenGlowStone2"));
- mObInitMap.put(new Pair<String, String>("ans", "net/minecraft/block/BlockStairs"));
- mObInitMap.put(new Pair<String, String>("abv", "net/minecraft/creativetab/CreativeTabs$10"));
- mObInitMap.put(new Pair<String, String>("afu", "net/minecraft/enchantment/EnumEnchantmentType"));
- mObInitMap.put(new Pair<String, String>("ajt", "net/minecraft/block/BlockCactus"));
- mObInitMap.put(
- new Pair<String, String>("avq", "net/minecraft/world/gen/structure/StructureVillagePieces$House1"));
- mObInitMap.put(new Pair<String, String>("azp", "net/minecraft/world/storage/IPlayerFileData"));
- mObInitMap.put(new Pair<String, String>("bru", "net/minecraft/client/resources/data/IMetadataSection"));
- mObInitMap.put(new Pair<String, String>("bjw", "net/minecraft/client/particle/EntityCrit2FX"));
- mObInitMap.put(new Pair<String, String>("bnv", "net/minecraft/client/renderer/entity/RenderHorse"));
- mObInitMap.put(new Pair<String, String>("wn", "net/minecraft/entity/passive/EntityOcelot"));
- mObInitMap.put(new Pair<String, String>("op", "net/minecraft/server/management/UserListBans"));
- mObInitMap.put(new Pair<String, String>("kq", "net/minecraft/init/Bootstrap$13"));
- mObInitMap.put(new Pair<String, String>("gr", "net/minecraft/network/play/server/S3FPacketCustomPayload"));
- mObInitMap.put(new Pair<String, String>("cs", "net/minecraft/util/IObjectIntIterable"));
- mObInitMap.put(new Pair<String, String>("asf", "net/minecraft/world/gen/feature/WorldGenTaiga1"));
- mObInitMap.put(new Pair<String, String>("aog", "net/minecraft/block/BlockTripWireHook"));
- mObInitMap.put(new Pair<String, String>("akh", "net/minecraft/block/BlockDeadBush"));
- mObInitMap.put(new Pair<String, String>("acj", "net/minecraft/item/ItemDye"));
- mObInitMap.put(new Pair<String, String>("agi", "net/minecraft/enchantment/EnchantmentProtection"));
- mObInitMap
- .put(new Pair<String, String>("bsi", "net/minecraft/client/resources/data/TextureMetadataSection"));
- mObInitMap.put(new Pair<String, String>("bcm", "net/minecraft/client/gui/GuiSlot"));
- mObInitMap.put(new Pair<String, String>("bgl", "net/minecraft/client/gui/GuiResourcePackSelected"));
- mObInitMap.put(new Pair<String, String>("bkk", "net/minecraft/client/particle/EntityLavaFX"));
- mObInitMap.put(
- new Pair<String, String>("boj", "net/minecraft/client/renderer/entity/RenderMinecartMobSpawner"));
- mObInitMap.put(new Pair<String, String>("tc", "net/minecraft/entity/item/EntityPainting$EnumArt"));
- mObInitMap.put(new Pair<String, String>("pd", "net/minecraft/stats/IStatStringFormat"));
- mObInitMap.put(new Pair<String, String>("le", "net/minecraft/command/ServerCommand"));
- mObInitMap.put(new Pair<String, String>("hf", "net/minecraft/network/play/server/S14PacketEntity"));
- mObInitMap.put(new Pair<String, String>("dg", "net/minecraft/nbt/NBTTagByte"));
- mObInitMap.put(new Pair<String, String>("ase", "net/minecraft/world/gen/feature/WorldGenMinable"));
- mObInitMap.put(new Pair<String, String>("awd",
- "net/minecraft/world/gen/structure/StructureVillagePieces$Village"));
- mObInitMap.put(new Pair<String, String>("bda", "net/minecraft/client/gui/GuiCreateFlatWorld$Details"));
- mObInitMap.put(new Pair<String, String>("hy", "net/minecraft/network/play/server/S12PacketEntityVelocity"));
- mObInitMap.put(new Pair<String, String>("dz", "net/minecraft/nbt/NBTBase$NBTPrimitive"));
- mObInitMap.put(new Pair<String, String>("xa", "net/minecraft/entity/boss/EntityDragon"));
- mObInitMap.put(new Pair<String, String>("tb", "net/minecraft/entity/item/EntityPainting"));
- mObInitMap
- .put(new Pair<String, String>("asx", "net/minecraft/world/gen/structure/StructureMineshaftPieces"));
- mObInitMap.put(new Pair<String, String>("aoy", "net/minecraft/tileentity/TileEntityCommandBlock$1"));
- mObInitMap.put(new Pair<String, String>("akz", "net/minecraft/block/BlockFence"));
- mObInitMap.put(new Pair<String, String>("aww", "net/minecraft/block/material/MaterialPortal"));
- mObInitMap.put(new Pair<String, String>("bdt", "net/minecraft/client/gui/GuiScreenWorking"));
- mObInitMap.put(new Pair<String, String>("bhs", "net/minecraft/client/model/ModelHorse"));
- mObInitMap.put(new Pair<String, String>("xt", "net/minecraft/entity/ai/EntityMinecartMobSpawner"));
- mObInitMap.put(new Pair<String, String>("tu", "net/minecraft/entity/ai/EntityLookHelper"));
- mObInitMap.put(new Pair<String, String>("pv", "net/minecraft/util/HttpUtil"));
- mObInitMap.put(new Pair<String, String>("lw", "net/minecraft/server/dedicated/DedicatedServer$3"));
- mObInitMap.put(new Pair<String, String>("hx", "net/minecraft/network/play/server/S1BPacketEntityAttach"));
- mObInitMap.put(new Pair<String, String>("f", "net/minecraft/crash/CrashReport$4"));
- mObInitMap.put(new Pair<String, String>("atl",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Entrance"));
- mObInitMap.put(new Pair<String, String>("apm", "net/minecraft/tileentity/TileEntitySign"));
- mObInitMap.put(new Pair<String, String>("aln", "net/minecraft/block/BlockHopper"));
- mObInitMap.put(new Pair<String, String>("adp", "net/minecraft/item/ItemPotion"));
- mObInitMap.put(new Pair<String, String>("aho", "net/minecraft/world/SpawnerAnimals"));
- mObInitMap.put(new Pair<String, String>("bai", "net/minecraft/stats/ObjectiveStat"));
- mObInitMap.put(new Pair<String, String>("bto", "net/minecraft/client/audio/SoundEventAccessorComposite"));
- mObInitMap.put(new Pair<String, String>("bpp", "net/minecraft/client/renderer/texture/AbstractTexture"));
- mObInitMap.put(new Pair<String, String>("blq", "net/minecraft/client/renderer/EntitySorter"));
- mObInitMap.put(new Pair<String, String>("yh", "net/minecraft/entity/monster/EntityPigZombie"));
- mObInitMap.put(new Pair<String, String>("ui", "net/minecraft/entity/ai/EntityAIBase"));
- mObInitMap.put(new Pair<String, String>("qj", "net/minecraft/profiler/Profiler$Result"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RealmsServerStatusPinger",
- "net/minecraft/realms/RealmsServerStatusPinger"));
- mObInitMap.put(new Pair<String, String>("mk", "net/minecraft/world/demo/DemoWorldServer"));
- mObInitMap
- .put(new Pair<String, String>("il", "net/minecraft/network/play/server/S20PacketEntityProperties"));
- mObInitMap.put(new Pair<String, String>("em", "net/minecraft/network/NetworkManager$3"));
- mObInitMap.put(new Pair<String, String>("an", "net/minecraft/command/server/CommandEmote"));
- mObInitMap.put(new Pair<String, String>("aqa", "net/minecraft/world/chunk/storage/NibbleArrayReader"));
- mObInitMap.put(new Pair<String, String>("amb", "net/minecraft/block/BlockSilverfish"));
- mObInitMap.put(new Pair<String, String>("aed", "net/minecraft/item/ItemSnowball"));
- mObInitMap.put(new Pair<String, String>("aae", "net/minecraft/inventory/InventoryCrafting"));
- mObInitMap.put(new Pair<String, String>("aic", "net/minecraft/world/biome/BiomeGenDesert"));
- mObInitMap.put(new Pair<String, String>("e", "net/minecraft/crash/CrashReport$3"));
- mObInitMap.put(
- new Pair<String, String>("buc", "net/minecraft/client/stream/BroadcastController$BroadcastState"));
- mObInitMap.put(new Pair<String, String>("bqd", "net/minecraft/client/renderer/texture/TextureAtlasSprite"));
- mObInitMap.put(new Pair<String, String>("bah", "net/minecraft/scoreboard/IScoreObjectiveCriteria"));
- mObInitMap.put(new Pair<String, String>("beg", "net/minecraft/client/gui/GuiWinGame"));
- mObInitMap.put(new Pair<String, String>("bif", "net/minecraft/client/model/ModelSnowMan"));
- mObInitMap.put(new Pair<String, String>("bme", "net/minecraft/client/util/QuadComparator"));
- mObInitMap.put(new Pair<String, String>("fa", "net/minecraft/util/MessageSerializer"));
- mObInitMap.put(new Pair<String, String>("bb", "net/minecraft/command/server/CommandNetstat"));
- mObInitMap.put(new Pair<String, String>("aew", "net/minecraft/item/crafting/RecipeBookCloning"));
- mObInitMap.put(new Pair<String, String>("aax", "net/minecraft/inventory/SlotCrafting"));
- mObInitMap.put(new Pair<String, String>("aiv", "net/minecraft/world/biome/BiomeGenSwamp"));
- mObInitMap.put(new Pair<String, String>("x", "net/minecraft/command/IAdminCommand"));
- mObInitMap.put(new Pair<String, String>("bqw", "net/minecraft/client/resources/IResource"));
- mObInitMap.put(new Pair<String, String>("bez", "net/minecraft/client/gui/inventory/GuiBeacon"));
- mObInitMap.put(new Pair<String, String>("biy", "net/minecraft/client/model/TextureOffset"));
- mObInitMap.put(new Pair<String, String>("bmx", "net/minecraft/client/renderer/culling/Frustrum"));
- mObInitMap.put(new Pair<String, String>("js", "net/minecraft/network/login/server/S02PacketLoginSuccess"));
- mObInitMap.put(new Pair<String, String>("ft", "net/minecraft/network/Packet"));
- mObInitMap.put(new Pair<String, String>("bu", "net/minecraft/command/server/CommandSummon"));
- mObInitMap.put(new Pair<String, String>("yz", "net/minecraft/entity/player/EntityPlayer"));
- mObInitMap.put(new Pair<String, String>("aqs", "net/minecraft/world/gen/MapGenRavine"));
- mObInitMap.put(new Pair<String, String>("amt", "net/minecraft/block/BlockRailPowered"));
- mObInitMap.put(new Pair<String, String>("aiu", "net/minecraft/world/biome/BiomeGenStoneBeach"));
- mObInitMap.put(new Pair<String, String>("aur",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$PieceWeight"));
- mObInitMap.put(new Pair<String, String>("ayq", "net/minecraft/world/storage/SaveHandler"));
- mObInitMap.put(new Pair<String, String>("bbo", "net/minecraft/client/LoadingScreenRenderer"));
- mObInitMap.put(new Pair<String, String>("bfn",
- "net/minecraft/client/gui/inventory/GuiContainerCreative$CreativeSlot"));
- mObInitMap.put(new Pair<String, String>("bjm", "net/minecraft/client/multiplayer/ServerAddress"));
- mObInitMap.put(new Pair<String, String>("buu", "net/minecraft/client/renderer/OpenGlHelper"));
- mObInitMap.put(new Pair<String, String>("zn", "net/minecraft/entity/item/EntityExpBottle"));
- mObInitMap.put(new Pair<String, String>("vo", "net/minecraft/entity/ai/EntityAINearestAttackableTarget"));
- mObInitMap.put(new Pair<String, String>("rp", "net/minecraft/util/EntityDamageSource"));
- mObInitMap.put(new Pair<String, String>("nq", "net/minecraft/server/network/NetHandlerStatusServer"));
- mObInitMap.put(new Pair<String, String>("jr", "net/minecraft/network/login/INetHandlerLoginClient"));
- mObInitMap.put(new Pair<String, String>("arg", "net/minecraft/world/gen/feature/WorldGeneratorBonusChest"));
- mObInitMap.put(new Pair<String, String>("anh", "net/minecraft/block/BlockSand"));
- mObInitMap.put(new Pair<String, String>("abk", "net/minecraft/item/ItemBook"));
- mObInitMap.put(new Pair<String, String>("afj", "net/minecraft/item/crafting/RecipesCrafting"));
- mObInitMap.put(new Pair<String, String>("aji", "net/minecraft/block/Block"));
- mObInitMap.put(new Pair<String, String>("avf", "net/minecraft/world/gen/structure/MapGenStructure$1"));
- mObInitMap.put(new Pair<String, String>("aze", "net/minecraft/world/storage/ISaveFormat"));
- mObInitMap.put(new Pair<String, String>("brj", "net/minecraft/client/resources/SkinManager"));
- mObInitMap.put(new Pair<String, String>("bjl", "net/minecraft/client/gui/GuiPlayerInfo"));
- mObInitMap.put(
- new Pair<String, String>("bnk", "net/minecraft/client/renderer/tileentity/RenderEnderCrystal"));
- mObInitMap.put(new Pair<String, String>("wc", "net/minecraft/village/VillageCollection"));
- mObInitMap.put(new Pair<String, String>("sd", "net/minecraft/entity/Entity$SwitchEnumEntitySize"));
- mObInitMap.put(new Pair<String, String>("oe", "net/minecraft/server/management/PreYggdrasilConverter$5"));
- mObInitMap.put(new Pair<String, String>("kf",
- "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier"));
- mObInitMap.put(new Pair<String, String>("gg", "net/minecraft/network/play/server/S24PacketBlockAction"));
- mObInitMap.put(new Pair<String, String>("ch", "net/minecraft/command/CommandNotFoundException"));
- mObInitMap.put(new Pair<String, String>("arz", "net/minecraft/world/gen/feature/WorldGenMegaJungle"));
- mObInitMap.put(new Pair<String, String>("bcb", "net/minecraft/client/gui/GuiButton"));
- mObInitMap.put(new Pair<String, String>("bga", "net/minecraft/client/gui/ServerListEntryLanScan"));
- mObInitMap.put(new Pair<String, String>("sw", "net/minecraft/entity/EntityLiving"));
- mObInitMap.put(new Pair<String, String>("ox", "net/minecraft/network/rcon/RConThreadQuery"));
- mObInitMap.put(new Pair<String, String>("ky", "net/minecraft/init/Bootstrap$7"));
- mObInitMap.put(new Pair<String, String>("gz", "net/minecraft/network/play/server/S26PacketMapChunkBulk"));
- mObInitMap.put(new Pair<String, String>("akp", "net/minecraft/block/BlockDragonEgg"));
- mObInitMap.put(new Pair<String, String>("acr", "net/minecraft/item/ItemFireworkCharge"));
- mObInitMap.put(new Pair<String, String>("agq", "net/minecraft/tileentity/MobSpawnerBaseLogic"));
- mObInitMap.put(new Pair<String, String>("bsq", "net/minecraft/client/audio/SoundList$SoundEntry"));
- mObInitMap.put(new Pair<String, String>("bor", "net/minecraft/client/renderer/entity/RenderSilverfish"));
- mObInitMap.put(new Pair<String, String>("avx",
- "net/minecraft/world/gen/structure/StructureVillagePieces$WoodHut"));
- mObInitMap.put(new Pair<String, String>("azw", "net/minecraft/util/Vec3"));
- mObInitMap.put(new Pair<String, String>("bcu", "net/minecraft/client/gui/GuiConfirmOpenLink"));
- mObInitMap.put(new Pair<String, String>("bgt", "net/minecraft/client/main/Main$1"));
- mObInitMap.put(new Pair<String, String>("bks", "net/minecraft/client/particle/EntityCloudFX"));
- mObInitMap.put(new Pair<String, String>("wu", "net/minecraft/entity/passive/EntityWaterMob"));
- mObInitMap.put(new Pair<String, String>("sv", "net/minecraft/entity/EntityLivingBase"));
- mObInitMap.put(new Pair<String, String>("asm", "net/minecraft/world/gen/feature/WorldGenLiquids"));
- mObInitMap.put(new Pair<String, String>("aon", "net/minecraft/block/BlockButtonWood"));
- mObInitMap.put(new Pair<String, String>("ako", "net/minecraft/block/BlockDoublePlant"));
- mObInitMap.put(new Pair<String, String>("awl", "net/minecraft/world/gen/NoiseGeneratorPerlin"));
- mObInitMap.put(new Pair<String, String>("bdi", "net/minecraft/client/gui/GuiSleepMP"));
- mObInitMap.put(new Pair<String, String>("bhh", "net/minecraft/client/model/ModelChicken"));
- mObInitMap.put(new Pair<String, String>("blg", "net/minecraft/client/entity/AbstractClientPlayer"));
- mObInitMap.put(new Pair<String, String>("xi", "net/minecraft/entity/item/EntityBoat"));
- mObInitMap.put(new Pair<String, String>("tj", "net/minecraft/entity/ai/attributes/AttributeModifier"));
- mObInitMap.put(new Pair<String, String>("pk", "net/minecraft/stats/StatBase$3"));
- mObInitMap.put(new Pair<String, String>("ll", "net/minecraft/server/MinecraftServer$5"));
- mObInitMap.put(
- new Pair<String, String>("ata", "net/minecraft/world/gen/structure/StructureMineshaftPieces$Room"));
- mObInitMap.put(new Pair<String, String>("apb", "net/minecraft/tileentity/TileEntityDispenser"));
- mObInitMap.put(new Pair<String, String>("alc", "net/minecraft/block/BlockFlower"));
- mObInitMap.put(new Pair<String, String>("ade", "net/minecraft/init/Items"));
- mObInitMap.put(new Pair<String, String>("ahd", "net/minecraft/world/World$2"));
- mObInitMap.put(
- new Pair<String, String>("btd", "net/minecraft/client/network/LanServerDetector$LanServerList"));
- mObInitMap.put(new Pair<String, String>("bpe", "net/minecraft/client/renderer/entity/RenderWolf"));
- mObInitMap.put(new Pair<String, String>("blf", "net/minecraft/client/particle/EntityRainFX"));
- mObInitMap.put(new Pair<String, String>("ia", "net/minecraft/network/play/server/S1FPacketSetExperience"));
- mObInitMap.put(new Pair<String, String>("eb", "net/minecraft/nbt/JsonToNBT"));
- mObInitMap.put(new Pair<String, String>("ac", "net/minecraft/command/ICommandSender"));
- mObInitMap.put(new Pair<String, String>("att",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$PieceWeight"));
- mObInitMap.put(new Pair<String, String>("apu", "net/minecraft/world/chunk/IChunkProvider"));
- mObInitMap.put(new Pair<String, String>("alv", "net/minecraft/block/BlockLever"));
- mObInitMap.put(new Pair<String, String>("adx", "net/minecraft/item/ItemShears"));
- mObInitMap.put(new Pair<String, String>("ahw", "net/minecraft/world/biome/BiomeGenBase$TempCategory"));
- mObInitMap.put(new Pair<String, String>("btw", "net/minecraft/client/stream/MetadataAchievement"));
- mObInitMap.put(new Pair<String, String>("bpx", "net/minecraft/client/renderer/texture/Stitcher$Slot"));
- mObInitMap.put(new Pair<String, String>("bhz", "net/minecraft/client/model/ModelSign"));
- mObInitMap.put(new Pair<String, String>("bly", "net/minecraft/client/renderer/ItemRenderer"));
- mObInitMap.put(new Pair<String, String>("uq", "net/minecraft/entity/ai/EntityAIAttackOnCollide"));
- mObInitMap.put(new Pair<String, String>("ms", "net/minecraft/world/gen/ChunkProviderServer"));
- mObInitMap.put(new Pair<String, String>("it",
- "net/minecraft/network/play/client/C16PacketClientStatus$EnumState"));
- mObInitMap.put(new Pair<String, String>("eu", "net/minecraft/network/NetworkStatistics"));
- mObInitMap.put(new Pair<String, String>("av", "net/minecraft/command/CommandServerKick"));
- mObInitMap.put(new Pair<String, String>("ael", "net/minecraft/item/ItemWritableBook"));
- mObInitMap.put(new Pair<String, String>("aam", "net/minecraft/inventory/ContainerHorseInventory"));
- mObInitMap.put(new Pair<String, String>("aik", "net/minecraft/world/biome/BiomeGenJungle"));
- mObInitMap.put(new Pair<String, String>("m", "net/minecraft/crash/CrashReportCategory$2"));
- mObInitMap.put(new Pair<String, String>("buk",
- "net/minecraft/client/stream/IngestServerTester$IngestTestListener"));
- mObInitMap.put(new Pair<String, String>("bql", "net/minecraft/client/renderer/texture/TextureClock"));
- mObInitMap.put(new Pair<String, String>("ats",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Piece"));
- mObInitMap.put(new Pair<String, String>("axr", "net/minecraft/world/gen/layer/GenLayerHills"));
- mObInitMap.put(new Pair<String, String>("bap", "net/minecraft/client/Minecraft$1"));
- mObInitMap
- .put(new Pair<String, String>("beo", "net/minecraft/client/gui/achievement/GuiStats$StatsItem$1"));
- mObInitMap.put(new Pair<String, String>("bin", "net/minecraft/client/model/ModelWither"));
- mObInitMap.put(new Pair<String, String>("bmm",
- "net/minecraft/client/renderer/tileentity/TileEntityChestRenderer"));
- mObInitMap
- .put(new Pair<String, String>("jh", "net/minecraft/network/play/client/C13PacketPlayerAbilities"));
- mObInitMap.put(new Pair<String, String>("fi", "net/minecraft/event/ClickEvent$Action"));
- mObInitMap.put(new Pair<String, String>("bj", "net/minecraft/command/server/CommandSaveOn"));
- mObInitMap.put(new Pair<String, String>("yo", "net/minecraft/entity/monster/EntitySpider$GroupData"));
- mObInitMap.put(new Pair<String, String>("up", "net/minecraft/entity/ai/EntityAIVillagerMate"));
- mObInitMap.put(new Pair<String, String>("aqh", "net/minecraft/world/chunk/storage/RegionFile"));
- mObInitMap.put(new Pair<String, String>("ami", "net/minecraft/block/BlockNewLog"));
- mObInitMap.put(new Pair<String, String>("aij", "net/minecraft/world/biome/BiomeGenSnow"));
- mObInitMap.put(new Pair<String, String>("aug", "net/minecraft/world/gen/structure/MapGenStronghold"));
- mObInitMap.put(new Pair<String, String>("ayf", "net/minecraft/pathfinding/PathEntity"));
- mObInitMap.put(new Pair<String, String>("bbd", "net/minecraft/client/Minecraft$7"));
- mObInitMap.put(new Pair<String, String>("bfc", "net/minecraft/client/gui/inventory/GuiBeacon$PowerButton"));
- mObInitMap.put(new Pair<String, String>("bjb", "net/minecraft/client/network/NetHandlerPlayClient"));
- mObInitMap.put(
- new Pair<String, String>("buj", "net/minecraft/client/stream/IngestServerTester$SwitchStatType"));
- mObInitMap.put(new Pair<String, String>("zc", "net/minecraft/entity/projectile/EntityArrow"));
- mObInitMap.put(new Pair<String, String>("vd", "net/minecraft/entity/ai/EntityAIArrowAttack"));
- mObInitMap.put(new Pair<String, String>("re", "net/minecraft/client/renderer/IconFlipped"));
- mObInitMap.put(new Pair<String, String>("nf", "net/minecraft/network/NetworkSystem$3"));
- mObInitMap.put(new Pair<String, String>("jg",
- "net/minecraft/network/play/client/C03PacketPlayer$C05PacketPlayerLook"));
- mObInitMap.put(new Pair<String, String>("auz",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs2"));
- mObInitMap.put(new Pair<String, String>("ayy", "net/minecraft/world/storage/WorldInfo$6"));
- mObInitMap.put(new Pair<String, String>("bja", "net/minecraft/client/network/NetHandlerLoginClient$1"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RealmsSharedConstants",
- "net/minecraft/realms/RealmsSharedConstants"));
- mObInitMap.put(new Pair<String, String>("zv", "net/minecraft/inventory/ContainerRepair$1"));
- mObInitMap.put(new Pair<String, String>("vw", "net/minecraft/entity/ai/EntitySenses"));
- mObInitMap.put(new Pair<String, String>("rx", "net/minecraft/entity/EntityAgeable"));
- mObInitMap.put(new Pair<String, String>("ny", "net/minecraft/server/management/IPBanEntry"));
- mObInitMap.put(new Pair<String, String>("jz", "net/minecraft/network/status/server/S01PacketPong"));
- mObInitMap.put(new Pair<String, String>("aro", "net/minecraft/world/gen/feature/WorldGenFlowers"));
- mObInitMap.put(new Pair<String, String>("anp", "net/minecraft/block/BlockSponge"));
- mObInitMap.put(new Pair<String, String>("abs", "net/minecraft/item/ItemMapBase"));
- mObInitMap.put(new Pair<String, String>("afr", "net/minecraft/enchantment/EnchantmentDurability"));
- mObInitMap.put(new Pair<String, String>("ajq", "net/minecraft/block/BlockBrewingStand"));
- mObInitMap.put(new Pair<String, String>("avn", "net/minecraft/world/gen/structure/MapGenVillage"));
- mObInitMap.put(new Pair<String, String>("brr", "net/minecraft/client/resources/LanguageManager"));
- mObInitMap.put(new Pair<String, String>("bbv", "net/minecraft/client/gui/GuiIngame"));
- mObInitMap.put(new Pair<String, String>("bfu", "net/minecraft/client/gui/inventory/GuiInventory"));
- mObInitMap.put(new Pair<String, String>("bjt", "net/minecraft/client/network/OldServerPinger$2$1"));
- mObInitMap.put(new Pair<String, String>("bns", "net/minecraft/client/renderer/entity/RenderFish"));
- mObInitMap.put(new Pair<String, String>("sl", "net/minecraft/command/IEntitySelector$2"));
- mObInitMap.put(new Pair<String, String>("om", "net/minecraft/server/management/UserList"));
- mObInitMap.put(new Pair<String, String>("kn", "net/minecraft/init/Bootstrap$10"));
- mObInitMap.put(new Pair<String, String>("go", "net/minecraft/network/play/server/S30PacketWindowItems"));
- mObInitMap.put(new Pair<String, String>("cp", "net/minecraft/dispenser/IBehaviorDispenseItem"));
- mObInitMap.put(new Pair<String, String>("ake", "net/minecraft/block/BlockWorkbench"));
- mObInitMap.put(new Pair<String, String>("acg", "net/minecraft/item/ItemTool"));
- mObInitMap.put(new Pair<String, String>("agf", "net/minecraft/enchantment/EnchantmentKnockback"));
- mObInitMap.put(new Pair<String, String>("bsf",
- "net/minecraft/client/resources/data/LanguageMetadataSectionSerializer"));
- mObInitMap.put(new Pair<String, String>("avm", "net/minecraft/world/gen/structure/StructureStart"));
- mObInitMap.put(new Pair<String, String>("bcj", "net/minecraft/client/gui/GuiOptionButton"));
- mObInitMap
- .put(new Pair<String, String>("bgi", "net/minecraft/client/resources/ResourcePackListEntryFound"));
- mObInitMap.put(new Pair<String, String>("bkh", "net/minecraft/client/particle/EntityHeartFX"));
- mObInitMap.put(new Pair<String, String>("bog", "net/minecraft/client/renderer/entity/RenderLightningBolt"));
- mObInitMap.put(new Pair<String, String>("lb", "net/minecraft/client/util/JsonException"));
- mObInitMap.put(new Pair<String, String>("hc", "net/minecraft/network/play/server/S29PacketSoundEffect"));
- mObInitMap.put(new Pair<String, String>("dd", "net/minecraft/util/StatCollector"));
- mObInitMap.put(new Pair<String, String>("wj", "net/minecraft/entity/passive/EntityHorse$1"));
- mObInitMap.put(new Pair<String, String>("asb", "net/minecraft/world/gen/feature/WorldGenHugeTrees"));
- mObInitMap.put(new Pair<String, String>("aoc", "net/minecraft/block/BlockTorch"));
- mObInitMap.put(
- new Pair<String, String>("awa", "net/minecraft/world/gen/structure/StructureVillagePieces$Start"));
- mObInitMap.put(new Pair<String, String>("la", "net/minecraft/init/Bootstrap$9"));
- mObInitMap.put(new Pair<String, String>("aov", "net/minecraft/tileentity/TileEntityBrewingStand"));
- mObInitMap.put(new Pair<String, String>("akw", "net/minecraft/block/ITileEntityProvider"));
- mObInitMap.put(new Pair<String, String>("acy", "net/minecraft/item/ItemAppleGold"));
- mObInitMap.put(new Pair<String, String>("agx", "net/minecraft/world/ColorizerFoliage"));
- mObInitMap.put(new Pair<String, String>("awt", "net/minecraft/block/material/Material"));
- mObInitMap.put(new Pair<String, String>("bsx", "net/minecraft/server/integrated/IntegratedServer"));
- mObInitMap.put(new Pair<String, String>("boy", "net/minecraft/client/renderer/entity/RenderTNTPrimed"));
- mObInitMap.put(new Pair<String, String>("bkz", "net/minecraft/client/particle/EntitySuspendFX"));
- mObInitMap.put(new Pair<String, String>("xq", "net/minecraft/entity/item/EntityMinecartFurnace"));
- mObInitMap.put(new Pair<String, String>("tr", "net/minecraft/entity/EntityBodyHelper"));
- mObInitMap.put(new Pair<String, String>("lt", "net/minecraft/server/dedicated/DedicatedServer"));
- mObInitMap.put(new Pair<String, String>("hu", "net/minecraft/network/play/server/S09PacketHeldItemChange"));
- mObInitMap.put(new Pair<String, String>("dv", "net/minecraft/nbt/NBTUtil"));
- mObInitMap.put(new Pair<String, String>("ati",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Straight"));
- mObInitMap.put(new Pair<String, String>("apj", "net/minecraft/tileentity/TileEntityMobSpawner"));
- mObInitMap.put(new Pair<String, String>("alk", "net/minecraft/block/BlockBreakable"));
- mObInitMap.put(new Pair<String, String>("adm", "net/minecraft/item/ItemNameTag"));
- mObInitMap.put(new Pair<String, String>("ahl", "net/minecraft/world/IBlockAccess"));
- mObInitMap.put(new Pair<String, String>("btl", "net/minecraft/client/audio/SoundManager$2"));
- mObInitMap.put(new Pair<String, String>("bpm", "net/minecraft/client/shader/ShaderLoader$ShaderType"));
- mObInitMap.put(new Pair<String, String>("bdp", "net/minecraft/client/gui/GuiIngameMenu"));
- mObInitMap.put(new Pair<String, String>("bho", "net/minecraft/client/model/ModelMagmaCube"));
- mObInitMap.put(new Pair<String, String>("bln", "net/minecraft/entity/boss/BossStatus"));
- mObInitMap.put(new Pair<String, String>("uf", "net/minecraft/entity/ai/EntityAISwimming"));
- mObInitMap.put(new Pair<String, String>("qg", "net/minecraft/util/EnumTypeAdapterFactory$1"));
- mObInitMap.put(new Pair<String, String>("ii", "net/minecraft/network/play/server/S33PacketUpdateSign"));
- mObInitMap.put(new Pair<String, String>("ej", "net/minecraft/network/NetworkManager"));
- mObInitMap.put(new Pair<String, String>("ak", "net/minecraft/command/CommandDebug"));
- mObInitMap.put(new Pair<String, String>("aea", "net/minecraft/item/ItemSimpleFoiled"));
- mObInitMap.put(new Pair<String, String>("aab", "net/minecraft/inventory/ContainerBrewingStand$Potion"));
- mObInitMap.put(new Pair<String, String>("b", "net/minecraft/crash/CrashReport"));
- mObInitMap.put(new Pair<String, String>("bqa", "net/minecraft/client/renderer/texture/TextureMap$1"));
- mObInitMap.put(new Pair<String, String>("ath",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$End"));
- mObInitMap.put(new Pair<String, String>("bae", "net/minecraft/scoreboard/Team"));
- mObInitMap.put(new Pair<String, String>("bed", "net/minecraft/client/gui/GuiScreenOptionsSounds$Button"));
- mObInitMap.put(new Pair<String, String>("bic", "net/minecraft/client/model/ModelSkeleton"));
- mObInitMap.put(new Pair<String, String>("bmb", "net/minecraft/client/renderer/RenderGlobal$1"));
- mObInitMap.put(new Pair<String, String>("yd", "net/minecraft/entity/monster/EntityGhast"));
- mObInitMap.put(new Pair<String, String>("ue", "net/minecraft/entity/ai/EntityAIFleeSun"));
- mObInitMap.put(new Pair<String, String>("aau", "net/minecraft/inventory/SlotMerchantResult"));
- mObInitMap.put(new Pair<String, String>("u", "net/minecraft/util/Util"));
- mObInitMap.put(new Pair<String, String>("bax", "net/minecraft/client/Minecraft$SwitchMovingObjectType"));
- mObInitMap.put(new Pair<String, String>("bew", "net/minecraft/client/gui/GuiControls"));
- mObInitMap.put(new Pair<String, String>("yw", "net/minecraft/entity/player/PlayerCapabilities"));
- mObInitMap.put(new Pair<String, String>("ux", "net/minecraft/entity/ai/EntityAILookAtVillager"));
- mObInitMap.put(new Pair<String, String>("mz", "net/minecraft/network/PingResponseHandler"));
- mObInitMap.put(new Pair<String, String>("aqp", "net/minecraft/world/WorldProviderHell"));
- mObInitMap.put(new Pair<String, String>("amq", "net/minecraft/block/BlockPortal$Size"));
- mObInitMap.put(new Pair<String, String>("aat", "net/minecraft/inventory/ContainerMerchant"));
- mObInitMap.put(new Pair<String, String>("air", "net/minecraft/world/biome/BiomeGenRiver"));
- mObInitMap.put(new Pair<String, String>("auo",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Crossing"));
- mObInitMap.put(new Pair<String, String>("ayn", "net/minecraft/world/chunk/storage/AnvilSaveConverter"));
- mObInitMap.put(new Pair<String, String>("bbl", "net/minecraft/client/settings/GameSettings$SwitchOptions"));
- mObInitMap.put(new Pair<String, String>("bur", "net/minecraft/client/stream/NullStream"));
- mObInitMap.put(new Pair<String, String>("bqs", "net/minecraft/client/resources/FolderResourcePack"));
- mObInitMap.put(new Pair<String, String>("bmt", "net/minecraft/client/renderer/tileentity/RenderEndPortal"));
- mObInitMap.put(new Pair<String, String>("zk", "net/minecraft/entity/projectile/EntityThrowable"));
- mObInitMap.put(new Pair<String, String>("vl", "net/minecraft/entity/ai/EntityAITradePlayer"));
- mObInitMap.put(new Pair<String, String>("rm", "net/minecraft/util/CombatEntry"));
- mObInitMap.put(new Pair<String, String>("nn", "net/minecraft/server/network/NetHandlerLoginServer"));
- mObInitMap.put(
- new Pair<String, String>("jo", "net/minecraft/network/play/client/C08PacketPlayerBlockPlacement"));
- mObInitMap.put(new Pair<String, String>("fp", "net/minecraft/util/ChatStyle$Serializer"));
- mObInitMap.put(new Pair<String, String>("bq", "net/minecraft/command/CommandShowSeed"));
- mObInitMap.put(new Pair<String, String>("ard", "net/minecraft/world/gen/feature/WorldGenBigTree"));
- mObInitMap.put(new Pair<String, String>("ane", "net/minecraft/block/BlockReed"));
- mObInitMap.put(new Pair<String, String>("abh", "net/minecraft/item/ItemBlock"));
- mObInitMap.put(new Pair<String, String>("afg", "net/minecraft/item/crafting/IRecipe"));
- mObInitMap.put(new Pair<String, String>("ajf", "net/minecraft/block/BlockRailBase$Rail"));
- mObInitMap.put(new Pair<String, String>("avc",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold"));
- mObInitMap.put(
- new Pair<String, String>("brg", "net/minecraft/client/resources/SimpleReloadableResourceManager"));
- mObInitMap.put(new Pair<String, String>("bbk", "net/minecraft/client/settings/GameSettings$1"));
- mObInitMap.put(new Pair<String, String>("bfj", "net/minecraft/client/gui/inventory/GuiCrafting"));
- mObInitMap.put(new Pair<String, String>("bji", "net/minecraft/client/multiplayer/WorldClient$3"));
- mObInitMap.put(new Pair<String, String>("bnh", "net/minecraft/client/renderer/entity/RenderCow"));
- mObInitMap.put(new Pair<String, String>("sa", "net/minecraft/entity/Entity"));
- mObInitMap.put(new Pair<String, String>("ob", "net/minecraft/server/management/PreYggdrasilConverter$2"));
- mObInitMap
- .put(new Pair<String, String>("kc", "net/minecraft/network/ServerStatusResponse$PlayerCountData"));
- mObInitMap.put(new Pair<String, String>("gd", "net/minecraft/network/play/server/S37PacketStatistics"));
- mObInitMap.put(new Pair<String, String>("ce", "net/minecraft/command/NumberInvalidException"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/Realms", "net/minecraft/realms/Realms"));
- mObInitMap.put(new Pair<String, String>("ajy", "net/minecraft/block/BlockClay"));
- mObInitMap.put(new Pair<String, String>("afz", "net/minecraft/enchantment/EnchantmentHelper$IModifier"));
- mObInitMap.put(new Pair<String, String>("brz", "net/minecraft/client/resources/data/AnimationFrame"));
- mObInitMap.put(new Pair<String, String>("avb",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$StairsStraight"));
- mObInitMap.put(new Pair<String, String>("aza", "net/minecraft/world/storage/WorldInfo$8"));
- mObInitMap.put(new Pair<String, String>("kv", "net/minecraft/init/Bootstrap$5"));
- mObInitMap.put(new Pair<String, String>("gw", "net/minecraft/network/play/server/S00PacketKeepAlive"));
- mObInitMap.put(new Pair<String, String>("cx", "net/minecraft/dispenser/IPosition"));
- mObInitMap.put(new Pair<String, String>("arv", "net/minecraft/world/gen/feature/WorldGenIcePath"));
- mObInitMap.put(new Pair<String, String>("anw", "net/minecraft/block/BlockStoneBrick"));
- mObInitMap.put(new Pair<String, String>("ajx", "net/minecraft/block/BlockChest"));
- mObInitMap.put(new Pair<String, String>("avu",
- "net/minecraft/world/gen/structure/StructureVillagePieces$PieceWeight"));
- mObInitMap.put(new Pair<String, String>("azt", "net/minecraft/util/AxisAlignedBB"));
- mObInitMap.put(new Pair<String, String>("bcr", "net/minecraft/client/gui/GuiSlotRealmsProxy"));
- mObInitMap.put(new Pair<String, String>("bgq",
- "net/minecraft/client/gui/stream/GuiStreamUnavailable$SwitchReason"));
- mObInitMap.put(new Pair<String, String>("bkp", "net/minecraft/client/particle/EffectRenderer$2"));
- mObInitMap.put(new Pair<String, String>("wr", "net/minecraft/entity/monster/EntitySnowman"));
- mObInitMap.put(new Pair<String, String>("ss", "net/minecraft/entity/EntityHanging"));
- mObInitMap.put(new Pair<String, String>("ot", "net/minecraft/network/rcon/RConOutputStream"));
- mObInitMap.put(new Pair<String, String>("ku", "net/minecraft/init/Bootstrap$4"));
- mObInitMap.put(new Pair<String, String>("asj", "net/minecraft/world/gen/feature/WorldGenSand"));
- mObInitMap.put(new Pair<String, String>("aok", "net/minecraft/block/BlockWeb"));
- mObInitMap.put(new Pair<String, String>("akl", "net/minecraft/block/BlockDirt"));
- mObInitMap.put(new Pair<String, String>("acn", "net/minecraft/item/ItemEnderEye"));
- mObInitMap.put(new Pair<String, String>("agm", "net/minecraft/entity/IMerchant"));
- mObInitMap.put(new Pair<String, String>("bsm", "net/minecraft/client/audio/MovingSoundMinecart"));
- mObInitMap.put(new Pair<String, String>("bon", "net/minecraft/client/renderer/entity/RenderPainting"));
- mObInitMap.put(new Pair<String, String>("bko", "net/minecraft/client/particle/EffectRenderer$1"));
- mObInitMap.put(new Pair<String, String>("xf", "net/minecraft/util/WeightedRandomFishable"));
- mObInitMap.put(new Pair<String, String>("tg", "net/minecraft/entity/passive/EntityTameable"));
- mObInitMap.put(new Pair<String, String>("ph", "net/minecraft/stats/StatBase"));
- mObInitMap.put(new Pair<String, String>("li", "net/minecraft/server/MinecraftServer$2"));
- mObInitMap.put(new Pair<String, String>("hj", "net/minecraft/network/play/server/S36PacketSignEditorOpen"));
- mObInitMap.put(new Pair<String, String>("dk", "net/minecraft/nbt/NBTTagDouble"));
- mObInitMap.put(new Pair<String, String>("adb", "net/minecraft/item/Item"));
- mObInitMap.put(new Pair<String, String>("aha", "net/minecraft/world/ColorizerGrass"));
- mObInitMap.put(new Pair<String, String>("bta", "net/minecraft/client/network/LanServerDetector"));
- mObInitMap.put(new Pair<String, String>("bpb", "net/minecraft/client/renderer/entity/RenderWitch"));
- mObInitMap.put(new Pair<String, String>("bde", "net/minecraft/client/gui/GuiScreenServerList"));
- mObInitMap.put(new Pair<String, String>("bhd", "net/minecraft/client/model/ModelBlaze"));
- mObInitMap.put(new Pair<String, String>("blc", "net/minecraft/client/particle/EntityBlockDustFX"));
- mObInitMap.put(new Pair<String, String>("tz", "net/minecraft/entity/ai/EntityAIBreakDoor"));
- mObInitMap.put(new Pair<String, String>("als", "net/minecraft/block/BlockLadder"));
- mObInitMap.put(new Pair<String, String>("aht", "net/minecraft/world/biome/BiomeGenBeach"));
- mObInitMap.put(new Pair<String, String>("btt", "net/minecraft/client/audio/SoundRegistry"));
- mObInitMap.put(new Pair<String, String>("bpu", "net/minecraft/client/renderer/texture/SimpleTexture"));
- mObInitMap.put(new Pair<String, String>("bdx", "net/minecraft/client/gui/GuiSelectWorld"));
- mObInitMap.put(new Pair<String, String>("bhw", "net/minecraft/client/model/ModelQuadruped"));
- mObInitMap.put(new Pair<String, String>("blv", "net/minecraft/client/renderer/EntityRenderer$2"));
- mObInitMap.put(new Pair<String, String>("iq", "net/minecraft/network/play/client/C14PacketTabComplete"));
- mObInitMap.put(new Pair<String, String>("er", "net/minecraft/network/EnumConnectionState$3"));
- mObInitMap.put(new Pair<String, String>("as", "net/minecraft/command/CommandGameRule"));
- mObInitMap.put(new Pair<String, String>("xx", "net/minecraft/entity/monster/EntityBlaze"));
- mObInitMap.put(new Pair<String, String>("ty", "net/minecraft/entity/ai/EntityAIBeg"));
- mObInitMap.put(new Pair<String, String>("aaj", "net/minecraft/inventory/ContainerFurnace"));
- mObInitMap.put(new Pair<String, String>("j", "net/minecraft/crash/CrashReport$8"));
- mObInitMap.put(new Pair<String, String>("atp",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor2"));
- mObInitMap.put(new Pair<String, String>("apq", "net/minecraft/block/BlockPistonExtension"));
- mObInitMap.put(new Pair<String, String>("alr", "net/minecraft/block/BlockJukebox$TileEntityJukebox"));
- mObInitMap.put(new Pair<String, String>("axo", "net/minecraft/world/gen/layer/GenLayer$1"));
- mObInitMap.put(new Pair<String, String>("bam", "net/minecraft/client/renderer/RenderHelper"));
- mObInitMap
- .put(new Pair<String, String>("bel", "net/minecraft/client/gui/achievement/GuiStats$StatsBlock$1"));
- mObInitMap.put(new Pair<String, String>("bik", "net/minecraft/client/model/ModelVillager"));
- mObInitMap.put(new Pair<String, String>("bmj",
- "net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer"));
- mObInitMap.put(new Pair<String, String>("bg", "net/minecraft/command/server/CommandPublishLocalServer"));
- mObInitMap.put(new Pair<String, String>("yl", "net/minecraft/entity/monster/EntitySkeleton"));
- mObInitMap.put(new Pair<String, String>("um", "net/minecraft/entity/ai/EntityAILeapAtTarget"));
- mObInitMap.put(new Pair<String, String>("qn", "net/minecraft/util/StringUtils"));
- mObInitMap.put(new Pair<String, String>("mo", "net/minecraft/entity/EntityTracker$1"));
- mObInitMap.put(new Pair<String, String>("amf", "net/minecraft/block/BlockNetherWart"));
- mObInitMap.put(new Pair<String, String>("aeh", "net/minecraft/item/ItemSword"));
- mObInitMap.put(new Pair<String, String>("aai", "net/minecraft/inventory/ContainerEnchantment$2"));
- mObInitMap.put(new Pair<String, String>("aig", "net/minecraft/world/biome/BiomeGenForest$1"));
- mObInitMap.put(new Pair<String, String>("aud",
- "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid$Stones"));
- mObInitMap.put(new Pair<String, String>("ayc", "net/minecraft/world/gen/layer/GenLayerZoom"));
- mObInitMap.put(new Pair<String, String>("bba", "net/minecraft/client/Minecraft$4"));
- mObInitMap.put(new Pair<String, String>("bug", "net/minecraft/client/stream/ChatController$ChatState"));
- mObInitMap.put(new Pair<String, String>("bqh", "net/minecraft/client/renderer/texture/ITextureObject"));
- mObInitMap.put(new Pair<String, String>("bmi", "net/minecraft/client/shader/TesselatorVertexState"));
- mObInitMap.put(new Pair<String, String>("va", "net/minecraft/entity/ai/EntityAIPlay"));
- mObInitMap.put(new Pair<String, String>("rb", "net/minecraft/inventory/IInventory"));
- mObInitMap.put(new Pair<String, String>("nc", "net/minecraft/network/NetworkSystem"));
- mObInitMap.put(new Pair<String, String>("jd", "net/minecraft/network/play/client/C03PacketPlayer"));
- mObInitMap.put(new Pair<String, String>("fe", "net/minecraft/util/ChatComponentStyle"));
- mObInitMap.put(new Pair<String, String>("bf", "net/minecraft/command/CommandPlaySound"));
- mObInitMap.put(new Pair<String, String>("aqx", "net/minecraft/world/gen/MapGenBase"));
- mObInitMap.put(new Pair<String, String>("amy", "net/minecraft/block/BlockRail"));
- mObInitMap.put(new Pair<String, String>("aiz", "net/minecraft/world/gen/feature/WorldGenWaterlily"));
- mObInitMap.put(new Pair<String, String>("auw",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stones"));
- mObInitMap.put(new Pair<String, String>("vt", "net/minecraft/entity/ai/EntityAIOwnerHurtTarget"));
- mObInitMap.put(new Pair<String, String>("ru", "net/minecraft/potion/PotionHealth"));
- mObInitMap.put(
- new Pair<String, String>("nv", "net/minecraft/server/management/PlayerProfileCache$ProfileEntry"));
- mObInitMap.put(new Pair<String, String>("jw", "net/minecraft/network/login/client/C00PacketLoginStart"));
- mObInitMap.put(
- new Pair<String, String>("fx", "net/minecraft/network/play/server/S11PacketSpawnExperienceOrb"));
- mObInitMap.put(new Pair<String, String>("by", "net/minecraft/command/server/CommandTestFor"));
- mObInitMap.put(new Pair<String, String>("abp", "net/minecraft/item/ItemCarrotOnAStick"));
- mObInitMap.put(new Pair<String, String>("afo", "net/minecraft/enchantment/EnchantmentArrowInfinite"));
- mObInitMap.put(new Pair<String, String>("ajn", "net/minecraft/init/Blocks"));
- mObInitMap.put(new Pair<String, String>("bro",
- "net/minecraft/client/resources/SkinManager$SkinAvailableCallback"));
- mObInitMap.put(new Pair<String, String>("auv",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$RoomCrossing"));
- mObInitMap.put(new Pair<String, String>("ayu", "net/minecraft/world/storage/WorldInfo$2"));
- mObInitMap.put(new Pair<String, String>("bbs", "net/minecraft/util/Session"));
- mObInitMap.put(new Pair<String, String>("bfr", "net/minecraft/client/gui/inventory/GuiFurnace"));
- mObInitMap.put(new Pair<String, String>("bjq", "net/minecraft/client/network/OldServerPinger"));
- mObInitMap.put(new Pair<String, String>("bnp", "net/minecraft/client/renderer/entity/RenderXPOrb"));
- mObInitMap.put(new Pair<String, String>("kk", "net/minecraft/dispenser/BehaviorProjectileDispense"));
- mObInitMap.put(
- new Pair<String, String>("gl", "net/minecraft/network/play/server/S32PacketConfirmTransaction"));
- mObInitMap.put(new Pair<String, String>("cm", "net/minecraft/dispenser/BehaviorDefaultDispenseItem"));
- mObInitMap.put(new Pair<String, String>("zr", "net/minecraft/util/FoodStats"));
- mObInitMap.put(new Pair<String, String>("vs", "net/minecraft/entity/ai/EntityAIOwnerHurtByTarget"));
- mObInitMap.put(new Pair<String, String>("ark", "net/minecraft/world/gen/feature/WorldGenDeadBush"));
- mObInitMap.put(new Pair<String, String>("anl", "net/minecraft/block/BlockSkull"));
- mObInitMap.put(new Pair<String, String>("ajm", "net/minecraft/block/Block$SoundType"));
- mObInitMap.put(new Pair<String, String>("avj", "net/minecraft/world/gen/structure/MapGenStructureData"));
- mObInitMap.put(new Pair<String, String>("bgf", "net/minecraft/client/gui/GuiScreenResourcePacks"));
- mObInitMap.put(new Pair<String, String>("bke", "net/minecraft/client/particle/EntityFireworkStarterFX"));
- mObInitMap.put(new Pair<String, String>("wg", "net/minecraft/entity/passive/EntityChicken"));
- mObInitMap.put(new Pair<String, String>("sh", "net/minecraft/entity/EntityList$EntityEggInfo"));
- mObInitMap
- .put(new Pair<String, String>("oi", "net/minecraft/server/management/ServerConfigurationManager"));
- mObInitMap.put(new Pair<String, String>("kj", "net/minecraft/network/status/client/C00PacketServerQuery"));
- mObInitMap.put(new Pair<String, String>("aka", "net/minecraft/block/BlockColored"));
- mObInitMap.put(new Pair<String, String>("acc", "net/minecraft/creativetab/CreativeTabs$6"));
- mObInitMap
- .put(new Pair<String, String>("agb", "net/minecraft/enchantment/EnchantmentHelper$ModifierDamage"));
- mObInitMap.put(new Pair<String, String>("bsb",
- "net/minecraft/client/resources/data/AnimationMetadataSectionSerializer"));
- mObInitMap.put(new Pair<String, String>("bkd", "net/minecraft/client/particle/EntityFireworkSparkFX"));
- mObInitMap.put(new Pair<String, String>("boc", "net/minecraft/client/renderer/entity/RenderItem$4"));
- mObInitMap.put(new Pair<String, String>("wz", "net/minecraft/entity/item/EntityEnderCrystal"));
- mObInitMap.put(new Pair<String, String>("asr", "net/minecraft/world/gen/feature/WorldGenVines"));
- mObInitMap.put(new Pair<String, String>("aos", "net/minecraft/tileentity/TileEntity$1"));
- mObInitMap.put(new Pair<String, String>("akt", "net/minecraft/block/BlockEndPortal"));
- mObInitMap.put(new Pair<String, String>("acv", "net/minecraft/item/ItemFishingRod"));
- mObInitMap.put(new Pair<String, String>("agu", "net/minecraft/world/ChunkCoordIntPair"));
- mObInitMap.put(new Pair<String, String>("awq", "net/minecraft/block/material/MaterialLogic"));
- mObInitMap.put(new Pair<String, String>("bsu", "net/minecraft/client/audio/ISound$AttenuationType"));
- mObInitMap.put(new Pair<String, String>("bov", "net/minecraft/client/renderer/entity/RenderSpider"));
- mObInitMap.put(new Pair<String, String>("bcy", "net/minecraft/client/multiplayer/GuiConnecting$1"));
- mObInitMap.put(new Pair<String, String>("bkw", "net/minecraft/client/particle/EntitySnowShovelFX"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RealmsAnvilLevelStorageSource",
- "net/minecraft/realms/RealmsAnvilLevelStorageSource"));
- mObInitMap.put(new Pair<String, String>("to", "net/minecraft/entity/ai/attributes/RangedAttribute"));
- mObInitMap.put(new Pair<String, String>("pp", "net/minecraft/stats/StatList"));
- mObInitMap.put(new Pair<String, String>("lq", "net/minecraft/server/dedicated/PropertyManager"));
- mObInitMap.put(
- new Pair<String, String>("hr", "net/minecraft/network/play/server/S1EPacketRemoveEntityEffect"));
- mObInitMap.put(new Pair<String, String>("ds", "net/minecraft/nbt/NBTSizeTracker"));
- mObInitMap.put(new Pair<String, String>("alh", "net/minecraft/block/BlockGrass"));
- mObInitMap.put(new Pair<String, String>("adj", "net/minecraft/item/ItemMinecart"));
- mObInitMap.put(new Pair<String, String>("bti", "net/minecraft/client/audio/SoundPoolEntry"));
- mObInitMap.put(new Pair<String, String>("bpj", "net/minecraft/client/shader/ShaderGroup"));
- mObInitMap.put(new Pair<String, String>("awp", "net/minecraft/world/gen/NoiseGenerator"));
- mObInitMap.put(new Pair<String, String>("bdm", "net/minecraft/client/gui/GuiOptions"));
- mObInitMap.put(new Pair<String, String>("bhl", "net/minecraft/client/model/ModelGhast"));
- mObInitMap.put(new Pair<String, String>("blk", "net/minecraft/client/entity/EntityPlayerSP"));
- mObInitMap.put(new Pair<String, String>("me", "net/minecraft/server/gui/PlayerListComponent"));
- mObInitMap.put(new Pair<String, String>("eg", "net/minecraft/network/NettyEncryptionTranslator"));
- mObInitMap.put(new Pair<String, String>("ah", "net/minecraft/command/server/CommandBroadcast"));
- mObInitMap.put(new Pair<String, String>("xm", "net/minecraft/entity/item/EntityMinecartChest"));
- mObInitMap.put(
- new Pair<String, String>("net/minecraft/realms/Tezzelator", "net/minecraft/realms/Tezzelator"));
- mObInitMap
- .put(new Pair<String, String>("ate", "net/minecraft/world/gen/structure/MapGenNetherBridge$Start"));
- mObInitMap.put(new Pair<String, String>("apf", "net/minecraft/tileentity/TileEntityFlowerPot"));
- mObInitMap.put(new Pair<String, String>("alg", "net/minecraft/block/BlockGlowstone"));
- mObInitMap.put(new Pair<String, String>("axd", "net/minecraft/world/gen/layer/GenLayerAddSnow"));
- mObInitMap.put(new Pair<String, String>("bea", "net/minecraft/client/gui/GuiSnooper"));
- mObInitMap.put(new Pair<String, String>("ya", "net/minecraft/entity/monster/EntityEnderman"));
- mObInitMap.put(new Pair<String, String>("ub", "net/minecraft/entity/ai/EntityAIControlledByPlayer"));
- mObInitMap.put(new Pair<String, String>("qc", "net/minecraft/util/ThreadSafeBoundList"));
- mObInitMap.put(new Pair<String, String>("md", "net/minecraft/server/gui/MinecraftServerGui$5"));
- mObInitMap.put(new Pair<String, String>("r", "net/minecraft/util/ChunkCoordinates"));
- mObInitMap.put(new Pair<String, String>("atx", "net/minecraft/world/gen/structure/MapGenScatteredFeature"));
- mObInitMap.put(new Pair<String, String>("apy", "net/minecraft/world/chunk/Chunk$1"));
- mObInitMap.put(new Pair<String, String>("alz", "net/minecraft/block/BlockCompressed"));
- mObInitMap.put(new Pair<String, String>("axw", "net/minecraft/world/gen/layer/GenLayerShore"));
- mObInitMap.put(new Pair<String, String>("bau", "net/minecraft/client/Minecraft$14"));
- mObInitMap.put(new Pair<String, String>("yt", "net/minecraft/entity/NpcMerchant"));
- mObInitMap.put(new Pair<String, String>("uu", "net/minecraft/entity/ai/EntityAIMoveTowardsTarget"));
- mObInitMap.put(new Pair<String, String>("qv", "net/minecraft/util/WeightedRandom"));
- mObInitMap.put(new Pair<String, String>("mw", "net/minecraft/entity/player/EntityPlayerMP"));
- mObInitMap.put(new Pair<String, String>("ix", "net/minecraft/network/play/client/C0EPacketClickWindow"));
- mObInitMap.put(new Pair<String, String>("ey", "net/minecraft/network/NetworkStatistics$PacketStatData"));
- mObInitMap.put(new Pair<String, String>("az", "net/minecraft/command/server/CommandMessage"));
- mObInitMap.put(new Pair<String, String>("amn", "net/minecraft/block/BlockOre"));
- mObInitMap.put(new Pair<String, String>("aaq", "net/minecraft/inventory/ContainerPlayer$1"));
- mObInitMap.put(new Pair<String, String>("aio", "net/minecraft/world/biome/BiomeGenOcean"));
- mObInitMap.put(new Pair<String, String>("aul",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$SwitchDoor"));
- mObInitMap.put(new Pair<String, String>("buo", "net/minecraft/client/stream/TwitchStream"));
- mObInitMap.put(new Pair<String, String>("bqp", "net/minecraft/client/resources/DefaultResourcePack"));
- mObInitMap.put(new Pair<String, String>("bat", "net/minecraft/client/Minecraft$13"));
- mObInitMap.put(new Pair<String, String>("bes", "net/minecraft/client/gui/GuiKeyBindingList"));
- mObInitMap.put(new Pair<String, String>("bir", "net/minecraft/client/model/ModelEnderCrystal"));
- mObInitMap.put(new Pair<String, String>("bmq",
- "net/minecraft/client/renderer/tileentity/TileEntityRendererPiston"));
- mObInitMap.put(new Pair<String, String>("vi", "net/minecraft/entity/ai/EntityAICreeperSwell"));
- mObInitMap.put(new Pair<String, String>("rj", "net/minecraft/profiler/PlayerUsageSnooper$1"));
- mObInitMap
- .put(new Pair<String, String>("nk", "net/minecraft/network/NetHandlerPlayServer$SwitchEnumState"));
- mObInitMap.put(new Pair<String, String>("jl", "net/minecraft/network/play/client/C09PacketHeldItemChange"));
- mObInitMap.put(new Pair<String, String>("fm", "net/minecraft/event/HoverEvent$Action"));
- mObInitMap.put(new Pair<String, String>("bn", "net/minecraft/command/server/CommandSetDefaultSpawnpoint"));
- mObInitMap.put(new Pair<String, String>("abe", "net/minecraft/item/ItemBlockWithMetadata"));
- mObInitMap.put(new Pair<String, String>("afd", "net/minecraft/item/crafting/RecipesIngots"));
- mObInitMap.put(new Pair<String, String>("ajc", "net/minecraft/block/BlockContainer"));
- mObInitMap.put(new Pair<String, String>("brd", "net/minecraft/client/resources/ResourcePackRepository$1"));
- mObInitMap.put(
- new Pair<String, String>("auk", "net/minecraft/world/gen/structure/StructureStrongholdPieces$2"));
- mObInitMap.put(new Pair<String, String>("ayj", "net/minecraft/world/storage/MapData$MapInfo"));
- mObInitMap.put(new Pair<String, String>("bbh", "net/minecraft/client/renderer/OpenGlCapsChecker"));
- mObInitMap.put(new Pair<String, String>("bfg", "net/minecraft/client/gui/inventory/GuiBrewingStand"));
- mObInitMap.put(new Pair<String, String>("bjf", "net/minecraft/client/multiplayer/WorldClient"));
- mObInitMap.put(new Pair<String, String>("bne", "net/minecraft/client/renderer/entity/RenderBoat"));
- mObInitMap.put(new Pair<String, String>("ga", "net/minecraft/network/play/server/S10PacketSpawnPainting"));
- mObInitMap.put(new Pair<String, String>("cb", "net/minecraft/command/CommandWeather"));
- mObInitMap.put(new Pair<String, String>("zg", "net/minecraft/entity/projectile/EntityLargeFireball"));
- mObInitMap.put(new Pair<String, String>("vh", "net/minecraft/entity/ai/EntityAISit"));
- mObInitMap.put(new Pair<String, String>("abx", "net/minecraft/creativetab/CreativeTabs$12"));
- mObInitMap.put(new Pair<String, String>("ana", "net/minecraft/block/BlockRedstoneWire"));
- mObInitMap.put(new Pair<String, String>("bfz", "net/minecraft/client/gui/GuiMultiplayer"));
- mObInitMap.put(new Pair<String, String>("bjy", "net/minecraft/client/particle/EntityDropParticleFX"));
- mObInitMap.put(new Pair<String, String>("zz", "net/minecraft/inventory/ContainerBrewingStand"));
- mObInitMap.put(new Pair<String, String>("ars", "net/minecraft/world/gen/feature/WorldGenHellLava"));
- mObInitMap.put(new Pair<String, String>("ant", "net/minecraft/block/BlockStaticLiquid"));
- mObInitMap.put(new Pair<String, String>("abw", "net/minecraft/creativetab/CreativeTabs$11"));
- mObInitMap.put(new Pair<String, String>("afv", "net/minecraft/enchantment/EnchantmentHelper"));
- mObInitMap.put(new Pair<String, String>("aju", "net/minecraft/block/BlockCake"));
- mObInitMap.put(
- new Pair<String, String>("avr", "net/minecraft/world/gen/structure/StructureVillagePieces$Field1"));
- mObInitMap.put(new Pair<String, String>("azq", "net/minecraft/world/storage/MapStorage"));
- mObInitMap.put(new Pair<String, String>("bco", "net/minecraft/client/gui/GuiStreamIndicator"));
- mObInitMap.put(
- new Pair<String, String>("brv", "net/minecraft/client/resources/data/IMetadataSectionSerializer"));
- mObInitMap.put(new Pair<String, String>("bnw", "net/minecraft/client/renderer/entity/RenderBiped"));
- mObInitMap.put(new Pair<String, String>("wo", "net/minecraft/entity/passive/EntityPig"));
- mObInitMap.put(new Pair<String, String>("sp", "net/minecraft/command/IEntitySelector$ArmoredMob"));
- mObInitMap.put(new Pair<String, String>("oq", "net/minecraft/server/management/UserListBansEntry"));
- mObInitMap.put(new Pair<String, String>("kr", "net/minecraft/init/Bootstrap$14"));
- mObInitMap.put(new Pair<String, String>("gs", "net/minecraft/network/play/server/S40PacketDisconnect"));
- mObInitMap.put(new Pair<String, String>("ct", "net/minecraft/util/ObjectIntIdentityMap"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RealmsEditBox",
- "net/minecraft/realms/RealmsEditBox"));
- mObInitMap.put(new Pair<String, String>("asg", "net/minecraft/world/gen/feature/WorldGenPumpkin"));
- mObInitMap.put(new Pair<String, String>("aoh", "net/minecraft/block/BlockVine"));
- mObInitMap.put(new Pair<String, String>("aki", "net/minecraft/block/BlockRailDetector"));
- mObInitMap.put(new Pair<String, String>("ack", "net/minecraft/item/ItemEgg"));
- mObInitMap.put(new Pair<String, String>("agj", "net/minecraft/enchantment/EnchantmentThorns"));
- mObInitMap.put(
- new Pair<String, String>("awf", "net/minecraft/world/gen/structure/StructureVillagePieces$Well"));
- mObInitMap.put(new Pair<String, String>("bsj",
- "net/minecraft/client/resources/data/TextureMetadataSectionSerializer"));
- mObInitMap.put(new Pair<String, String>("bok", "net/minecraft/client/renderer/entity/RenderLiving"));
- mObInitMap.put(new Pair<String, String>("bcn", "net/minecraft/client/gui/GuiOptionSlider"));
- mObInitMap.put(new Pair<String, String>("bgm", "net/minecraft/client/gui/stream/GuiIngestServers"));
- mObInitMap.put(new Pair<String, String>("bkl", "net/minecraft/client/particle/EntityNoteFX"));
- mObInitMap.put(new Pair<String, String>("xc", "net/minecraft/entity/boss/EntityWither"));
- mObInitMap.put(new Pair<String, String>("td", "net/minecraft/entity/EntityCreature"));
- mObInitMap.put(new Pair<String, String>("pe", "net/minecraft/stats/StatBasic"));
- mObInitMap.put(new Pair<String, String>("hg",
- "net/minecraft/network/play/server/S14PacketEntity$S15PacketEntityRelMove"));
- mObInitMap.put(new Pair<String, String>("dh", "net/minecraft/nbt/NBTTagCompound"));
- mObInitMap.put(
- new Pair<String, String>("awe", "net/minecraft/world/gen/structure/StructureVillagePieces$Road"));
- mObInitMap.put(new Pair<String, String>("bdb", "net/minecraft/client/gui/GuiCreateWorld"));
- mObInitMap.put(new Pair<String, String>("ly", "net/minecraft/server/gui/MinecraftServerGui"));
- mObInitMap
- .put(new Pair<String, String>("hz", "net/minecraft/network/play/server/S04PacketEntityEquipment"));
- mObInitMap.put(new Pair<String, String>("asy",
- "net/minecraft/world/gen/structure/StructureMineshaftPieces$Corridor"));
- mObInitMap.put(new Pair<String, String>("aoz", "net/minecraft/tileentity/TileEntityComparator"));
- mObInitMap.put(new Pair<String, String>("awx", "net/minecraft/world/gen/layer/GenLayerDeepOcean"));
- mObInitMap.put(new Pair<String, String>("bdu", "net/minecraft/client/gui/GuiDownloadTerrain"));
- mObInitMap.put(new Pair<String, String>("bht", "net/minecraft/client/model/ModelOcelot"));
- mObInitMap.put(new Pair<String, String>("bls",
- "net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper"));
- mObInitMap.put(new Pair<String, String>("ap", "net/minecraft/command/CommandXP"));
- mObInitMap.put(new Pair<String, String>("xu", "net/minecraft/entity/ai/EntityMinecartMobSpawner$1"));
- mObInitMap.put(new Pair<String, String>("tv", "net/minecraft/entity/ai/EntityMoveHelper"));
- mObInitMap.put(new Pair<String, String>("pw", "net/minecraft/util/HttpUtil$1"));
- mObInitMap.put(new Pair<String, String>("lx", "net/minecraft/server/dedicated/DedicatedServer$4"));
- mObInitMap.put(new Pair<String, String>("g", "net/minecraft/crash/CrashReport$5"));
- mObInitMap.put(new Pair<String, String>("atm",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing2"));
- mObInitMap.put(new Pair<String, String>("apn", "net/minecraft/tileentity/TileEntitySkull"));
- mObInitMap.put(new Pair<String, String>("alo", "net/minecraft/block/BlockHugeMushroom"));
- mObInitMap.put(new Pair<String, String>("adq", "net/minecraft/item/EnumRarity"));
- mObInitMap.put(new Pair<String, String>("ahp", "net/minecraft/world/Teleporter"));
- mObInitMap.put(new Pair<String, String>("axl", "net/minecraft/world/gen/layer/IntCache"));
- mObInitMap.put(new Pair<String, String>("baj", "net/minecraft/client/renderer/ActiveRenderInfo"));
- mObInitMap.put(new Pair<String, String>("btp", "net/minecraft/client/audio/SoundHandler"));
- mObInitMap.put(new Pair<String, String>("bpq", "net/minecraft/client/renderer/texture/DynamicTexture"));
- mObInitMap.put(new Pair<String, String>("blr", "net/minecraft/client/util/RenderDistanceSorter"));
- mObInitMap.put(new Pair<String, String>("yi", "net/minecraft/entity/IRangedAttackMob"));
- mObInitMap.put(new Pair<String, String>("uj", "net/minecraft/entity/ai/EntityAITasks"));
- mObInitMap.put(new Pair<String, String>("qk", "net/minecraft/util/IProgressUpdate"));
- mObInitMap.put(new Pair<String, String>("ml", "net/minecraft/world/demo/DemoWorldManager"));
- mObInitMap.put(new Pair<String, String>("im",
- "net/minecraft/network/play/server/S20PacketEntityProperties$Snapshot"));
- mObInitMap.put(new Pair<String, String>("en",
- "net/minecraft/network/NetworkManager$InboundHandlerTuplePacketListener"));
- mObInitMap.put(new Pair<String, String>("ao", "net/minecraft/command/CommandEnchant"));
- mObInitMap.put(new Pair<String, String>("amc", "net/minecraft/block/BlockMushroom"));
- mObInitMap.put(new Pair<String, String>("aee", "net/minecraft/item/ItemMonsterPlacer"));
- mObInitMap.put(new Pair<String, String>("aaf", "net/minecraft/inventory/ContainerWorkbench"));
- mObInitMap.put(new Pair<String, String>("aid", "net/minecraft/world/biome/BiomeGenHills"));
- mObInitMap.put(new Pair<String, String>("aua",
- "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$1"));
- mObInitMap.put(new Pair<String, String>("bud",
- "net/minecraft/client/stream/BroadcastController$BroadcastListener"));
- mObInitMap
- .put(new Pair<String, String>("bqe", "net/minecraft/client/renderer/texture/TextureAtlasSprite$1"));
- mObInitMap.put(new Pair<String, String>("beh", "net/minecraft/client/gui/achievement/GuiAchievement"));
- mObInitMap.put(new Pair<String, String>("big", "net/minecraft/client/model/ModelSpider"));
- mObInitMap.put(new Pair<String, String>("ja", "net/minecraft/network/play/client/C02PacketUseEntity"));
- mObInitMap.put(new Pair<String, String>("fb", "net/minecraft/network/INetHandler"));
- mObInitMap.put(new Pair<String, String>("bc", "net/minecraft/command/server/CommandOp"));
- mObInitMap.put(new Pair<String, String>("amv", "net/minecraft/block/BlockPressurePlate$Sensitivity"));
- mObInitMap.put(new Pair<String, String>("aex", "net/minecraft/item/crafting/RecipesDyes"));
- mObInitMap.put(new Pair<String, String>("aay", "net/minecraft/inventory/Slot"));
- mObInitMap.put(new Pair<String, String>("aiw", "net/minecraft/world/biome/BiomeGenTaiga"));
- mObInitMap.put(new Pair<String, String>("y", "net/minecraft/command/CommandBase"));
- mObInitMap.put(new Pair<String, String>("bqx", "net/minecraft/util/ResourceLocation"));
- mObInitMap.put(new Pair<String, String>("biz", "net/minecraft/client/network/NetHandlerLoginClient"));
- mObInitMap.put(new Pair<String, String>("bmy", "net/minecraft/client/renderer/culling/ClippingHelper"));
- mObInitMap.put(
- new Pair<String, String>("jt", "net/minecraft/network/login/server/S01PacketEncryptionRequest"));
- mObInitMap.put(new Pair<String, String>("fu", "net/minecraft/network/play/server/S08PacketPlayerPosLook"));
- mObInitMap.put(new Pair<String, String>("bv", "net/minecraft/command/server/CommandTeleport"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/realms/RealmsConnect",
- "net/minecraft/realms/RealmsConnect"));
- mObInitMap.put(new Pair<String, String>("abm", "net/minecraft/item/ItemBow"));
- mObInitMap.put(new Pair<String, String>("amu", "net/minecraft/block/BlockPressurePlate"));
- mObInitMap.put(new Pair<String, String>("aus",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$PortalRoom"));
- mObInitMap.put(new Pair<String, String>("ayr", "net/minecraft/world/storage/SaveFormatOld"));
- mObInitMap.put(new Pair<String, String>("bbp", "net/minecraft/util/ScreenShotHelper"));
- mObInitMap.put(new Pair<String, String>("bfo", "net/minecraft/client/renderer/InventoryEffectRenderer"));
- mObInitMap.put(new Pair<String, String>("bjn", "net/minecraft/client/multiplayer/ServerData"));
- mObInitMap.put(new Pair<String, String>("bnm", "net/minecraft/client/renderer/entity/RenderEnderman"));
- mObInitMap.put(new Pair<String, String>("zo", "net/minecraft/entity/projectile/EntityPotion"));
- mObInitMap.put(new Pair<String, String>("vp", "net/minecraft/entity/ai/EntityAINearestAttackableTarget$1"));
- mObInitMap.put(new Pair<String, String>("rq", "net/minecraft/util/EntityDamageSourceIndirect"));
- mObInitMap.put(new Pair<String, String>("nr", "net/minecraft/server/management/BanEntry"));
- mObInitMap.put(new Pair<String, String>("arh", "net/minecraft/world/gen/feature/WorldGenCactus"));
- mObInitMap.put(new Pair<String, String>("ani", "net/minecraft/block/BlockSandStone"));
- mObInitMap.put(new Pair<String, String>("abl", "net/minecraft/item/ItemGlassBottle"));
- mObInitMap.put(new Pair<String, String>("afk", "net/minecraft/item/crafting/RecipesTools"));
- mObInitMap.put(new Pair<String, String>("ajj", "net/minecraft/block/Block$1"));
- mObInitMap.put(new Pair<String, String>("avg", "net/minecraft/world/gen/structure/MapGenStructure$2"));
- mObInitMap.put(new Pair<String, String>("azf", "net/minecraft/world/storage/SaveFormatComparator"));
- mObInitMap.put(new Pair<String, String>("bcd", "net/minecraft/client/gui/GuiTextField"));
- mObInitMap.put(new Pair<String, String>("brk", "net/minecraft/client/resources/SkinManager$1"));
- mObInitMap.put(new Pair<String, String>("bnl", "net/minecraft/client/renderer/entity/RenderDragon"));
- mObInitMap.put(new Pair<String, String>("wd", "net/minecraft/entity/passive/EntityAmbientCreature"));
- mObInitMap.put(new Pair<String, String>("se", "net/minecraft/entity/Entity$EnumEntitySize"));
- mObInitMap.put(new Pair<String, String>("of", "net/minecraft/server/management/PreYggdrasilConverter$6"));
- mObInitMap.put(new Pair<String, String>("kg",
- "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier$Serializer"));
- mObInitMap.put(new Pair<String, String>("gh", "net/minecraft/network/play/server/S23PacketBlockChange"));
- mObInitMap.put(new Pair<String, String>("ci", "net/minecraft/command/WrongUsageException"));
- mObInitMap.put(
- new Pair<String, String>("avz", "net/minecraft/world/gen/structure/StructureVillagePieces$House2"));
- mObInitMap.put(
- new Pair<String, String>("net/minecraft/realms/RealmsButton", "net/minecraft/realms/RealmsButton"));
- mObInitMap.put(new Pair<String, String>("bcc", "net/minecraft/client/gui/GuiNewChat"));
- mObInitMap.put(new Pair<String, String>("bgb", "net/minecraft/client/gui/ServerListEntryLanDetected"));
- mObInitMap.put(new Pair<String, String>("bka", "net/minecraft/client/particle/EntityExplodeFX"));
- mObInitMap.put(new Pair<String, String>("ww", "net/minecraft/entity/boss/IBossDisplayData"));
- mObInitMap.put(new Pair<String, String>("sx", "net/minecraft/entity/EnumCreatureType"));
- mObInitMap.put(new Pair<String, String>("oy", "net/minecraft/network/rcon/RConThreadQuery$Auth"));
- mObInitMap.put(new Pair<String, String>("kz", "net/minecraft/init/Bootstrap$8"));
- mObInitMap.put(new Pair<String, String>("akq", "net/minecraft/block/BlockDropper"));
- mObInitMap.put(new Pair<String, String>("acs", "net/minecraft/item/ItemFirework"));
- mObInitMap.put(new Pair<String, String>("agr",
- "net/minecraft/tileentity/MobSpawnerBaseLogic$WeightedRandomMinecart"));
- mObInitMap.put(new Pair<String, String>("bsr", "net/minecraft/client/audio/SoundList$SoundEntry$Type"));
- mObInitMap.put(new Pair<String, String>("bos", "net/minecraft/client/renderer/entity/RenderSkeleton"));
- mObInitMap.put(
- new Pair<String, String>("avy", "net/minecraft/world/gen/structure/StructureVillagePieces$Church"));
- mObInitMap.put(new Pair<String, String>("azx", "net/minecraft/scoreboard/ScoreObjective"));
- mObInitMap.put(new Pair<String, String>("bcv", "net/minecraft/client/gui/GuiYesNoCallback"));
- mObInitMap.put(new Pair<String, String>("bgu", "net/minecraft/client/main/Main$1$1"));
- mObInitMap.put(new Pair<String, String>("bkt", "net/minecraft/client/particle/EntityPortalFX"));
- mObInitMap.put(new Pair<String, String>("ln", "net/minecraft/server/management/PlayerPositionComparator"));
- mObInitMap.put(new Pair<String, String>("ho", "net/minecraft/network/play/server/S38PacketPlayerListItem"));
- mObInitMap.put(new Pair<String, String>("dp", "net/minecraft/nbt/NBTTagInt"));
- mObInitMap.put(new Pair<String, String>("wv", "net/minecraft/entity/passive/EntityWolf"));
- mObInitMap.put(new Pair<String, String>("asn", "net/minecraft/world/gen/feature/WorldGenTaiga2"));
- mObInitMap.put(new Pair<String, String>("aoo", "net/minecraft/block/BlockWoodSlab"));
- mObInitMap.put(new Pair<String, String>("bdj", "net/minecraft/client/gui/GuiLanguage"));
- mObInitMap.put(new Pair<String, String>("bhi", "net/minecraft/client/model/ModelCow"));
- mObInitMap.put(
- new Pair<String, String>("blh", "net/minecraft/client/entity/AbstractClientPlayer$SwitchType"));
- mObInitMap.put(new Pair<String, String>("ae", "net/minecraft/command/server/CommandAchievement"));
- mObInitMap.put(new Pair<String, String>("xj", "net/minecraft/entity/item/EntityFallingBlock"));
- mObInitMap.put(new Pair<String, String>("tk", "net/minecraft/entity/ai/attributes/BaseAttribute"));
- mObInitMap.put(new Pair<String, String>("pl", "net/minecraft/stats/StatBase$4"));
- mObInitMap.put(new Pair<String, String>("lm", "net/minecraft/server/MinecraftServer$6"));
- mObInitMap.put(new Pair<String, String>("atb",
- "net/minecraft/world/gen/structure/StructureMineshaftPieces$Stairs"));
- mObInitMap.put(new Pair<String, String>("apc", "net/minecraft/tileentity/TileEntityDropper"));
- mObInitMap.put(new Pair<String, String>("ald", "net/minecraft/block/BlockFlowerPot"));
- mObInitMap.put(new Pair<String, String>("adf", "net/minecraft/item/ItemLead"));
- mObInitMap.put(new Pair<String, String>("ahe", "net/minecraft/world/World$3"));
- mObInitMap.put(new Pair<String, String>("axa", "net/minecraft/world/gen/layer/GenLayerEdge$Mode"));
- mObInitMap.put(new Pair<String, String>("bte", "net/minecraft/client/multiplayer/ThreadLanServerPing"));
- mObInitMap.put(new Pair<String, String>("bpf", "net/minecraft/client/renderer/entity/RenderZombie"));
- mObInitMap.put(new Pair<String, String>("ma", "net/minecraft/server/gui/MinecraftServerGui$2"));
- mObInitMap.put(new Pair<String, String>("ib", "net/minecraft/network/play/server/S06PacketUpdateHealth"));
- mObInitMap.put(new Pair<String, String>("ec", "net/minecraft/nbt/JsonToNBT$Any"));
- mObInitMap.put(new Pair<String, String>("ad", "net/minecraft/command/PlayerSelector"));
- mObInitMap.put(new Pair<String, String>("atu",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing"));
- mObInitMap.put(new Pair<String, String>("apv", "net/minecraft/world/chunk/NibbleArray"));
- mObInitMap.put(new Pair<String, String>("alw", "net/minecraft/block/BlockLiquid"));
- mObInitMap.put(new Pair<String, String>("ady", "net/minecraft/item/ItemSpade"));
- mObInitMap.put(new Pair<String, String>("ahx", "net/minecraft/world/biome/BiomeGenBase$SpawnListEntry"));
- mObInitMap.put(new Pair<String, String>("axt", "net/minecraft/world/gen/layer/GenLayerRiverInit"));
- mObInitMap.put(new Pair<String, String>("bpy", "net/minecraft/client/renderer/StitcherException"));
- mObInitMap.put(new Pair<String, String>("ur", "net/minecraft/entity/ai/EntityAIMoveIndoors"));
- mObInitMap.put(new Pair<String, String>("mt", "net/minecraft/world/WorldServer"));
- mObInitMap.put(new Pair<String, String>("iu", "net/minecraft/network/play/client/C15PacketClientSettings"));
- mObInitMap.put(new Pair<String, String>("ev", "net/minecraft/network/NetworkStatistics$1"));
- mObInitMap.put(new Pair<String, String>("aw", "net/minecraft/command/CommandKill"));
- mObInitMap.put(new Pair<String, String>("amk", "net/minecraft/block/BlockObsidian"));
- mObInitMap.put(new Pair<String, String>("aem", "net/minecraft/item/ItemEditableBook"));
- mObInitMap.put(new Pair<String, String>("aan", "net/minecraft/inventory/ContainerHorseInventory$1"));
- mObInitMap.put(new Pair<String, String>("ail", "net/minecraft/world/biome/BiomeGenMesa"));
- mObInitMap.put(new Pair<String, String>("n", "net/minecraft/crash/CrashReportCategory$3"));
- mObInitMap.put(
- new Pair<String, String>("bul", "net/minecraft/client/stream/IngestServerTester$IngestTestState"));
- mObInitMap.put(new Pair<String, String>("bqm", "net/minecraft/client/renderer/texture/TextureCompass"));
- mObInitMap.put(new Pair<String, String>("axs", "net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean"));
- mObInitMap.put(new Pair<String, String>("baq", "net/minecraft/client/Minecraft$10"));
- mObInitMap.put(
- new Pair<String, String>("bep", "net/minecraft/client/gui/achievement/GuiStats$StatsMobsList"));
- mObInitMap.put(new Pair<String, String>("bio", "net/minecraft/client/model/ModelWolf"));
- mObInitMap.put(
- new Pair<String, String>("bmn", "net/minecraft/client/renderer/entity/RenderEnchantmentTable"));
- mObInitMap.put(new Pair<String, String>("nh", "net/minecraft/network/NetHandlerPlayServer"));
- mObInitMap.put(new Pair<String, String>("ji", "net/minecraft/network/play/client/C07PacketPlayerDigging"));
- mObInitMap.put(new Pair<String, String>("fj", "net/minecraft/util/IChatComponent"));
- mObInitMap.put(new Pair<String, String>("bk", "net/minecraft/command/server/CommandScoreboard"));
- mObInitMap.put(new Pair<String, String>("yp", "net/minecraft/entity/monster/EntityWitch"));
- mObInitMap.put(new Pair<String, String>("abb", "net/minecraft/item/ItemArmor"));
- mObInitMap.put(new Pair<String, String>("aqi", "net/minecraft/world/chunk/storage/RegionFile$ChunkBuffer"));
- mObInitMap.put(new Pair<String, String>("amj", "net/minecraft/block/BlockNote"));
- mObInitMap.put(new Pair<String, String>("auh", "net/minecraft/world/gen/structure/MapGenStronghold$Start"));
- mObInitMap.put(new Pair<String, String>("ayg", "net/minecraft/pathfinding/PathFinder"));
- mObInitMap.put(new Pair<String, String>("bbe", "net/minecraft/client/Minecraft$8"));
- mObInitMap.put(new Pair<String, String>("bfd", "net/minecraft/client/gui/inventory/GuiBeacon$Button"));
- mObInitMap.put(new Pair<String, String>("bjc", "net/minecraft/client/network/NetHandlerPlayClient$1"));
- mObInitMap.put(new Pair<String, String>("bnb", "net/minecraft/client/renderer/entity/RenderArrow"));
- mObInitMap.put(new Pair<String, String>("zd", "net/minecraft/entity/item/EntityEnderEye"));
- mObInitMap.put(new Pair<String, String>("ve", "net/minecraft/entity/ai/EntityAIRestrictOpenDoor"));
- mObInitMap.put(new Pair<String, String>("rf", "net/minecraft/util/IIcon"));
- mObInitMap.put(new Pair<String, String>("ng", "net/minecraft/network/NetworkSystem$4"));
- mObInitMap.put(new Pair<String, String>("aba", "net/minecraft/item/ItemAnvilBlock"));
- mObInitMap.put(new Pair<String, String>("ayz", "net/minecraft/world/storage/WorldInfo$7"));
- mObInitMap.put(new Pair<String, String>("bbx", "net/minecraft/client/gui/MapItemRenderer"));
- mObInitMap.put(new Pair<String, String>("zw", "net/minecraft/inventory/ContainerRepair$2"));
- mObInitMap.put(new Pair<String, String>("vx", "net/minecraft/entity/ai/RandomPositionGenerator"));
- mObInitMap.put(new Pair<String, String>("ry", "net/minecraft/entity/passive/IAnimals"));
- mObInitMap.put(new Pair<String, String>("nz", "net/minecraft/server/management/PreYggdrasilConverter"));
- mObInitMap.put(new Pair<String, String>("arp", "net/minecraft/world/gen/feature/WorldGenShrub"));
- mObInitMap.put(new Pair<String, String>("anq", "net/minecraft/block/BlockStainedGlass"));
- mObInitMap.put(new Pair<String, String>("abt", "net/minecraft/creativetab/CreativeTabs"));
- mObInitMap.put(new Pair<String, String>("afs", "net/minecraft/enchantment/EnchantmentDigging"));
- mObInitMap.put(new Pair<String, String>("ajr", "net/minecraft/block/BlockBush"));
- mObInitMap.put(new Pair<String, String>("avo", "net/minecraft/world/gen/structure/MapGenVillage$Start"));
- mObInitMap.put(new Pair<String, String>("brs", "net/minecraft/client/resources/Locale"));
- mObInitMap.put(new Pair<String, String>("bbw", "net/minecraft/client/gui/Gui"));
- mObInitMap.put(new Pair<String, String>("bfv", "net/minecraft/client/gui/GuiMerchant"));
- mObInitMap.put(new Pair<String, String>("bju", "net/minecraft/client/particle/EntityBreakingFX"));
- mObInitMap.put(new Pair<String, String>("bnt", "net/minecraft/client/renderer/entity/RenderGhast"));
- mObInitMap.put(new Pair<String, String>("wl", "net/minecraft/entity/monster/EntityGolem"));
- mObInitMap.put(new Pair<String, String>("sm", "net/minecraft/command/IEntitySelector$3"));
- mObInitMap.put(new Pair<String, String>("on", "net/minecraft/server/management/UserList$1"));
- mObInitMap.put(new Pair<String, String>("ko", "net/minecraft/init/Bootstrap$11"));
- mObInitMap.put(new Pair<String, String>("gp", "net/minecraft/network/play/server/S31PacketWindowProperty"));
- mObInitMap.put(new Pair<String, String>("cq", "net/minecraft/dispenser/IBehaviorDispenseItem$1"));
- mObInitMap.put(new Pair<String, String>("aoe", "net/minecraft/block/BlockTrapDoor"));
- mObInitMap.put(new Pair<String, String>("akf", "net/minecraft/block/BlockCrops"));
- mObInitMap.put(new Pair<String, String>("ach", "net/minecraft/item/ItemDoor"));
- mObInitMap.put(new Pair<String, String>("agg", "net/minecraft/enchantment/EnchantmentLootBonus"));
- mObInitMap.put(new Pair<String, String>("bsg", "net/minecraft/client/resources/data/PackMetadataSection"));
- mObInitMap.put(new Pair<String, String>("bck", "net/minecraft/client/gui/GuiOptionsRowList"));
- mObInitMap.put(new Pair<String, String>("bgj", "net/minecraft/client/gui/GuiResourcePackAvailable"));
- mObInitMap.put(new Pair<String, String>("bki", "net/minecraft/client/particle/EntityLargeExplodeFX"));
- mObInitMap
- .put(new Pair<String, String>("boh", "net/minecraft/client/renderer/entity/RendererLivingEntity"));
- mObInitMap.put(new Pair<String, String>("lc", "net/minecraft/client/util/JsonException$1"));
- mObInitMap.put(new Pair<String, String>("hd", "net/minecraft/network/play/server/S01PacketJoinGame"));
- mObInitMap.put(new Pair<String, String>("de", "net/minecraft/util/StringTranslate"));
- mObInitMap.put(new Pair<String, String>("wk", "net/minecraft/entity/passive/EntityHorse$GroupData"));
- mObInitMap.put(new Pair<String, String>("asc", "net/minecraft/world/gen/feature/WorldGenMelon"));
- mObInitMap.put(new Pair<String, String>("aod", "net/minecraft/block/BlockLeavesBase"));
- mObInitMap.put(
- new Pair<String, String>("awb", "net/minecraft/world/gen/structure/StructureVillagePieces$Path"));
- mObInitMap.put(new Pair<String, String>("pa", "net/minecraft/network/rcon/RConThreadMain"));
- mObInitMap.put(new Pair<String, String>("asv", "net/minecraft/world/gen/structure/StructureBoundingBox"));
- mObInitMap.put(new Pair<String, String>("aow", "net/minecraft/tileentity/TileEntityChest"));
- mObInitMap.put(new Pair<String, String>("akx", "net/minecraft/block/BlockFalling"));
- mObInitMap.put(new Pair<String, String>("acz", "net/minecraft/item/ItemHangingEntity"));
- mObInitMap.put(new Pair<String, String>("agy", "net/minecraft/world/GameRules"));
- mObInitMap.put(new Pair<String, String>("awu", "net/minecraft/block/material/Material$1"));
- mObInitMap.put(new Pair<String, String>("bdr", "net/minecraft/client/gui/GuiFlatPresets$LayerItem"));
- mObInitMap.put(new Pair<String, String>("bsy", "net/minecraft/server/integrated/IntegratedServer$1"));
- mObInitMap.put(new Pair<String, String>("boz", "net/minecraft/client/renderer/entity/RenderIronGolem"));
- mObInitMap.put(new Pair<String, String>("xr", "net/minecraft/entity/item/EntityMinecartHopper"));
- mObInitMap.put(new Pair<String, String>("pt", "net/minecraft/util/CryptManager"));
- mObInitMap.put(new Pair<String, String>("lu", "net/minecraft/server/dedicated/DedicatedServer$1"));
- mObInitMap.put(
- new Pair<String, String>("hv", "net/minecraft/network/play/server/S3DPacketDisplayScoreboard"));
- mObInitMap.put(new Pair<String, String>("dw", "net/minecraft/nbt/NBTTagShort"));
- mObInitMap.put(new Pair<String, String>("atj",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor3"));
- mObInitMap.put(new Pair<String, String>("apk", "net/minecraft/tileentity/TileEntityMobSpawner$1"));
- mObInitMap.put(new Pair<String, String>("all", "net/minecraft/block/BlockHardenedClay"));
- mObInitMap.put(new Pair<String, String>("adn", "net/minecraft/item/ItemPickaxe"));
- mObInitMap.put(new Pair<String, String>("ahm", "net/minecraft/world/WorldType"));
- mObInitMap.put(new Pair<String, String>("btm", "net/minecraft/client/audio/SoundManager$2$1"));
- mObInitMap.put(new Pair<String, String>("bpn", "net/minecraft/client/shader/ShaderLinkHelper"));
- mObInitMap.put(new Pair<String, String>("bdq", "net/minecraft/client/gui/GuiFlatPresets"));
- mObInitMap.put(new Pair<String, String>("bhp", "net/minecraft/client/model/ModelLeashKnot"));
- mObInitMap.put(new Pair<String, String>("blo", "net/minecraft/client/renderer/WorldRenderer"));
- mObInitMap.put(new Pair<String, String>("yf", "net/minecraft/entity/monster/EntityMagmaCube"));
- mObInitMap.put(new Pair<String, String>("ug", "net/minecraft/entity/ai/EntityAIFollowOwner"));
- mObInitMap.put(new Pair<String, String>("qh", "net/minecraft/util/MathHelper"));
- mObInitMap.put(new Pair<String, String>("ij", "net/minecraft/network/play/server/S0DPacketCollectItem"));
- mObInitMap.put(new Pair<String, String>("ek", "net/minecraft/network/NetworkManager$1"));
- mObInitMap.put(new Pair<String, String>("al", "net/minecraft/command/CommandDefaultGameMode"));
- mObInitMap.put(new Pair<String, String>("aeb", "net/minecraft/item/ItemSkull"));
- mObInitMap.put(new Pair<String, String>("aac", "net/minecraft/inventory/ICrafting"));
- mObInitMap.put(new Pair<String, String>("aia", "net/minecraft/world/biome/BiomeDecorator"));
- mObInitMap.put(new Pair<String, String>("c", "net/minecraft/crash/CrashReport$1"));
- mObInitMap.put(new Pair<String, String>("bua", "net/minecraft/client/stream/BroadcastController"));
- mObInitMap.put(new Pair<String, String>("bqb", "net/minecraft/client/renderer/texture/TextureMap$2"));
- mObInitMap.put(new Pair<String, String>("baf", "net/minecraft/scoreboard/ScoreDummyCriteria"));
- mObInitMap.put(new Pair<String, String>("bee", "net/minecraft/client/gui/GuiMainMenu"));
- mObInitMap.put(new Pair<String, String>("bmc", "net/minecraft/client/renderer/ImageBufferDownload"));
- mObInitMap.put(new Pair<String, String>("ye", "net/minecraft/entity/monster/EntityGiantZombie"));
- mObInitMap.put(new Pair<String, String>("aav", "net/minecraft/inventory/InventoryEnderChest"));
- mObInitMap.put(new Pair<String, String>("v", "net/minecraft/util/Util$EnumOS"));
- mObInitMap.put(new Pair<String, String>("bay", "net/minecraft/client/Minecraft$2"));
- mObInitMap.put(new Pair<String, String>("bex", "net/minecraft/client/gui/inventory/GuiContainer"));
- mObInitMap.put(new Pair<String, String>("bmv", "net/minecraft/client/renderer/culling/ICamera"));
- mObInitMap.put(new Pair<String, String>("bs", "net/minecraft/command/CommandSpreadPlayers$Position"));
- mObInitMap.put(new Pair<String, String>("yx", "net/minecraft/entity/player/InventoryPlayer"));
- mObInitMap.put(new Pair<String, String>("uy", "net/minecraft/entity/ai/EntityAIOpenDoor"));
- mObInitMap.put(new Pair<String, String>("aqq", "net/minecraft/world/WorldProviderSurface"));
- mObInitMap.put(new Pair<String, String>("amr", "net/minecraft/block/BlockPotato"));
- mObInitMap.put(new Pair<String, String>("ais", "net/minecraft/world/biome/BiomeGenSavanna"));
- mObInitMap.put(new Pair<String, String>("aup",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$LeftTurn"));
- mObInitMap.put(new Pair<String, String>("ayo", "net/minecraft/world/chunk/storage/AnvilSaveConverter$1"));
- mObInitMap.put(new Pair<String, String>("bbm", "net/minecraft/client/settings/GameSettings$Options"));
- mObInitMap.put(new Pair<String, String>("bus", "net/minecraft/realms/RealmsConnect$1"));
- mObInitMap
- .put(new Pair<String, String>("bqt", "net/minecraft/client/resources/FoliageColorReloadListener"));
- mObInitMap.put(new Pair<String, String>("zl", "net/minecraft/entity/projectile/EntityEgg"));
- mObInitMap.put(new Pair<String, String>("vm", "net/minecraft/entity/ai/EntityAIDefendVillage"));
- mObInitMap.put(new Pair<String, String>("rn", "net/minecraft/util/CombatTracker"));
- mObInitMap.put(new Pair<String, String>("no", "net/minecraft/server/network/NetHandlerLoginServer$1"));
- mObInitMap.put(new Pair<String, String>("jp", "net/minecraft/network/handshake/client/C00Handshake"));
- mObInitMap.put(new Pair<String, String>("fq", "net/minecraft/util/ChatComponentText"));
- mObInitMap.put(new Pair<String, String>("br", "net/minecraft/command/CommandSpreadPlayers"));
- mObInitMap.put(new Pair<String, String>("are", "net/minecraft/world/gen/feature/WorldGenForest"));
- mObInitMap.put(new Pair<String, String>("anf", "net/minecraft/block/BlockRedstoneRepeater"));
- mObInitMap.put(new Pair<String, String>("abi", "net/minecraft/item/ItemReed"));
- mObInitMap.put(new Pair<String, String>("afh", "net/minecraft/item/crafting/ShapedRecipes"));
- mObInitMap.put(new Pair<String, String>("ajg", "net/minecraft/block/BlockBeacon"));
- mObInitMap.put(new Pair<String, String>("avd",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold$Door"));
- mObInitMap.put(new Pair<String, String>("azc", "net/minecraft/world/storage/ISaveHandler"));
- mObInitMap.put(new Pair<String, String>("brh",
- "net/minecraft/client/resources/SimpleReloadableResourceManager$1"));
- mObInitMap.put(new Pair<String, String>("bfk", "net/minecraft/client/gui/inventory/CreativeCrafting"));
- mObInitMap.put(new Pair<String, String>("bjj", "net/minecraft/client/multiplayer/WorldClient$4"));
- mObInitMap.put(new Pair<String, String>("bni", "net/minecraft/client/renderer/entity/RenderCreeper"));
- mObInitMap.put(new Pair<String, String>("wa", "net/minecraft/village/Village$VillageAgressor"));
- mObInitMap.put(new Pair<String, String>("sb", "net/minecraft/entity/Entity$1"));
- mObInitMap.put(new Pair<String, String>("oc", "net/minecraft/server/management/PreYggdrasilConverter$3"));
- mObInitMap.put(new Pair<String, String>("kd",
- "net/minecraft/network/ServerStatusResponse$PlayerCountData$Serializer"));
- mObInitMap.put(new Pair<String, String>("ge", "net/minecraft/network/play/server/S25PacketBlockBreakAnim"));
- mObInitMap.put(new Pair<String, String>("cf", "net/minecraft/command/SyntaxErrorException"));
- mObInitMap.put(new Pair<String, String>("any", "net/minecraft/block/BlockStoneSlab"));
- mObInitMap.put(new Pair<String, String>("ajz", "net/minecraft/block/BlockCocoa"));
- mObInitMap.put(new Pair<String, String>("azb", "net/minecraft/world/storage/WorldInfo$9"));
- mObInitMap.put(new Pair<String, String>("ov", "net/minecraft/network/rcon/RConConsoleSource"));
- mObInitMap.put(new Pair<String, String>("kw", "net/minecraft/init/Bootstrap$5$1"));
- mObInitMap.put(new Pair<String, String>("gx", "net/minecraft/network/play/server/S21PacketChunkData"));
- mObInitMap.put(new Pair<String, String>("cy", "net/minecraft/dispenser/PositionImpl"));
- mObInitMap.put(new Pair<String, String>("acp", "net/minecraft/item/ItemExpBottle"));
- mObInitMap.put(new Pair<String, String>("bop", "net/minecraft/client/renderer/entity/RenderPlayer"));
- mObInitMap.put(new Pair<String, String>("arw", "net/minecraft/world/gen/feature/WorldGenIceSpike"));
- mObInitMap.put(new Pair<String, String>("anx", "net/minecraft/block/BlockButtonStone"));
- mObInitMap.put(
- new Pair<String, String>("avv", "net/minecraft/world/gen/structure/StructureVillagePieces$Hall"));
- mObInitMap.put(new Pair<String, String>("azu", "net/minecraft/util/MovingObjectPosition"));
- mObInitMap.put(new Pair<String, String>("bcs", "net/minecraft/client/gui/ScreenChatOptions"));
- mObInitMap.put(
- new Pair<String, String>("bgr", "net/minecraft/client/gui/stream/GuiStreamUnavailable$Reason"));
- mObInitMap.put(new Pair<String, String>("bkq", "net/minecraft/client/particle/EffectRenderer$3"));
- mObInitMap.put(new Pair<String, String>("dm", "net/minecraft/nbt/NBTTagFloat"));
- mObInitMap.put(new Pair<String, String>("ws", "net/minecraft/entity/passive/EntitySquid"));
- mObInitMap.put(new Pair<String, String>("st", "net/minecraft/entity/item/EntityItemFrame"));
- mObInitMap.put(new Pair<String, String>("ou", "net/minecraft/network/rcon/RConUtils"));
- mObInitMap.put(new Pair<String, String>("ask", "net/minecraft/world/gen/feature/WorldGenSavannaTree"));
- mObInitMap.put(new Pair<String, String>("aol", "net/minecraft/block/BlockPressurePlateWeighted"));
- mObInitMap.put(new Pair<String, String>("akm", "net/minecraft/block/BlockDispenser"));
- mObInitMap.put(new Pair<String, String>("aco", "net/minecraft/item/ItemEnderPearl"));
- mObInitMap.put(new Pair<String, String>("agn", "net/minecraft/village/MerchantRecipe"));
- mObInitMap.put(new Pair<String, String>("awj", "net/minecraft/world/gen/NoiseGeneratorImproved"));
- mObInitMap.put(new Pair<String, String>("bdg", "net/minecraft/client/gui/GuiScreenAddServer"));
- mObInitMap.put(new Pair<String, String>("bsn", "net/minecraft/client/audio/MovingSoundMinecartRiding"));
- mObInitMap.put(new Pair<String, String>("boo", "net/minecraft/client/renderer/entity/RenderPig"));
- mObInitMap.put(new Pair<String, String>("xg", "net/minecraft/entity/effect/EntityWeatherEffect"));
- mObInitMap.put(new Pair<String, String>("th", "net/minecraft/entity/ai/attributes/IAttribute"));
- mObInitMap.put(new Pair<String, String>("pi", "net/minecraft/stats/StatBase$1"));
- mObInitMap.put(new Pair<String, String>("lj", "net/minecraft/server/MinecraftServer$3"));
- mObInitMap
- .put(new Pair<String, String>("hk", "net/minecraft/network/play/server/S39PacketPlayerAbilities"));
- mObInitMap.put(new Pair<String, String>("dl", "net/minecraft/nbt/NBTTagEnd"));
- mObInitMap.put(new Pair<String, String>("ala", "net/minecraft/block/BlockFenceGate"));
- mObInitMap.put(new Pair<String, String>("adc", "net/minecraft/item/Item$ToolMaterial"));
- mObInitMap.put(new Pair<String, String>("ahb", "net/minecraft/world/World"));
- mObInitMap.put(new Pair<String, String>("btb", "net/minecraft/client/network/LanServerDetector$LanServer"));
- mObInitMap.put(new Pair<String, String>("bpc", "net/minecraft/client/renderer/entity/RenderWither"));
- mObInitMap.put(new Pair<String, String>("bdf", "net/minecraft/client/gui/GuiDisconnected"));
- mObInitMap.put(new Pair<String, String>("bhe", "net/minecraft/client/model/ModelBoat"));
- mObInitMap.put(new Pair<String, String>("bld", "net/minecraft/client/particle/EntityDiggingFX"));
- mObInitMap.put(new Pair<String, String>("xz", "net/minecraft/entity/monster/EntityCreeper"));
- mObInitMap.put(new Pair<String, String>("aa", "net/minecraft/command/ICommand"));
- mObInitMap.put(new Pair<String, String>("alt", "net/minecraft/block/BlockLeaves"));
- mObInitMap.put(new Pair<String, String>("adv", "net/minecraft/item/ItemSeedFood"));
- mObInitMap.put(new Pair<String, String>("ahu", "net/minecraft/world/biome/BiomeGenBase"));
- mObInitMap.put(new Pair<String, String>("btu", "net/minecraft/client/audio/ISoundEventAccessor"));
- mObInitMap.put(new Pair<String, String>("bpv", "net/minecraft/client/renderer/texture/Stitcher"));
- mObInitMap.put(new Pair<String, String>("bdy", "net/minecraft/client/gui/GuiSelectWorld$List"));
- mObInitMap.put(new Pair<String, String>("bhx", "net/minecraft/client/model/ModelSheep1"));
- mObInitMap.put(new Pair<String, String>("blw", "net/minecraft/client/renderer/EntityRenderer$3"));
- mObInitMap.put(new Pair<String, String>("mq", "net/minecraft/server/management/PlayerManager"));
- mObInitMap.put(new Pair<String, String>("ir", "net/minecraft/network/play/client/C01PacketChatMessage"));
- mObInitMap.put(new Pair<String, String>("es", "net/minecraft/network/EnumConnectionState$1"));
- mObInitMap.put(new Pair<String, String>("at", "net/minecraft/command/CommandGive"));
- mObInitMap.put(new Pair<String, String>("xy", "net/minecraft/entity/monster/EntityCaveSpider"));
- mObInitMap.put(new Pair<String, String>("aej", "net/minecraft/item/ItemLilyPad"));
- mObInitMap.put(new Pair<String, String>("aak", "net/minecraft/inventory/SlotFurnace"));
- mObInitMap.put(new Pair<String, String>("k", "net/minecraft/crash/CrashReportCategory"));
- mObInitMap.put(new Pair<String, String>("atq",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$NetherStalkRoom"));
- mObInitMap.put(new Pair<String, String>("apr", "net/minecraft/block/BlockPistonMoving"));
- mObInitMap.put(new Pair<String, String>("axp", "net/minecraft/world/gen/layer/GenLayer$2"));
- mObInitMap.put(new Pair<String, String>("ban", "net/minecraft/client/renderer/GLAllocation"));
- mObInitMap
- .put(new Pair<String, String>("bem", "net/minecraft/client/gui/achievement/GuiStats$StatsGeneral"));
- mObInitMap.put(new Pair<String, String>("bil", "net/minecraft/client/model/ModelZombieVillager"));
- mObInitMap.put(new Pair<String, String>("bmk",
- "net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher"));
- mObInitMap.put(new Pair<String, String>("bh", "net/minecraft/command/server/CommandSaveAll"));
- mObInitMap.put(new Pair<String, String>("ym", "net/minecraft/entity/monster/EntitySlime"));
- mObInitMap.put(new Pair<String, String>("un", "net/minecraft/entity/ai/EntityAIWatchClosest"));
- mObInitMap.put(new Pair<String, String>("mp", "net/minecraft/world/WorldManager"));
- mObInitMap.put(new Pair<String, String>("aqf", "net/minecraft/world/chunk/storage/ChunkLoader"));
- mObInitMap.put(new Pair<String, String>("amg", "net/minecraft/block/BlockNetherrack"));
- mObInitMap.put(new Pair<String, String>("aei", "net/minecraft/item/EnumAction"));
- mObInitMap.put(new Pair<String, String>("aih", "net/minecraft/world/biome/BiomeGenForest$2"));
- mObInitMap.put(new Pair<String, String>("aue",
- "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$Feature"));
- mObInitMap.put(new Pair<String, String>("ayd", "net/minecraft/pathfinding/Path"));
- mObInitMap.put(new Pair<String, String>("bbb", "net/minecraft/client/Minecraft$5"));
- mObInitMap
- .put(new Pair<String, String>("bfa", "net/minecraft/client/gui/inventory/GuiBeacon$CancelButton"));
- mObInitMap.put(new Pair<String, String>("buh", "net/minecraft/client/stream/ChatController$ChatListener"));
- mObInitMap.put(new Pair<String, String>("bqi", "net/minecraft/client/renderer/texture/TextureUtil"));
- mObInitMap.put(new Pair<String, String>("za", "net/minecraft/entity/player/EntityPlayer$EnumStatus"));
- mObInitMap.put(new Pair<String, String>("vb", "net/minecraft/entity/ai/EntityAILookIdle"));
- mObInitMap.put(new Pair<String, String>("rc", "net/minecraft/inventory/IInvBasic"));
- mObInitMap.put(new Pair<String, String>("nd", "net/minecraft/network/NetworkSystem$1"));
- mObInitMap.put(new Pair<String, String>("je",
- "net/minecraft/network/play/client/C03PacketPlayer$C04PacketPlayerPosition"));
- mObInitMap.put(new Pair<String, String>("ff", "net/minecraft/util/ChatComponentStyle$1"));
- mObInitMap.put(new Pair<String, String>("aqy", "net/minecraft/world/gen/MapGenCavesHell"));
- mObInitMap.put(new Pair<String, String>("amz", "net/minecraft/block/BlockRedstoneOre"));
- mObInitMap.put(new Pair<String, String>("ayw", "net/minecraft/world/storage/WorldInfo$4"));
- mObInitMap.put(new Pair<String, String>("zt", "net/minecraft/inventory/AnimalChest"));
- mObInitMap.put(new Pair<String, String>("vu", "net/minecraft/entity/ai/EntityAITarget"));
- mObInitMap.put(new Pair<String, String>("rv", "net/minecraft/potion/Potion"));
- mObInitMap.put(
- new Pair<String, String>("nw", "net/minecraft/server/management/PlayerProfileCache$Serializer"));
- mObInitMap.put(
- new Pair<String, String>("jx", "net/minecraft/network/login/client/C01PacketEncryptionResponse"));
- mObInitMap.put(
- new Pair<String, String>("fy", "net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity"));
- mObInitMap.put(new Pair<String, String>("bz", "net/minecraft/command/CommandTime"));
- mObInitMap.put(new Pair<String, String>("ann", "net/minecraft/block/BlockSnow"));
- mObInitMap.put(new Pair<String, String>("abq", "net/minecraft/item/ItemCoal"));
- mObInitMap.put(new Pair<String, String>("afp", "net/minecraft/enchantment/EnchantmentArrowKnockback"));
- mObInitMap.put(new Pair<String, String>("ajo", "net/minecraft/block/IGrowable"));
- mObInitMap.put(new Pair<String, String>("brp", "net/minecraft/client/resources/I18n"));
- mObInitMap.put(new Pair<String, String>("ayv", "net/minecraft/world/storage/WorldInfo$3"));
- mObInitMap.put(new Pair<String, String>("bbt", "net/minecraft/util/Session$Type"));
- mObInitMap.put(new Pair<String, String>("bfs", "net/minecraft/client/gui/GuiHopper"));
- mObInitMap.put(new Pair<String, String>("bjr", "net/minecraft/client/network/OldServerPinger$1"));
- mObInitMap.put(new Pair<String, String>("bnq", "net/minecraft/client/renderer/entity/RenderFallingBlock"));
- mObInitMap.put(new Pair<String, String>("ok", "net/minecraft/server/management/UserListOpsEntry"));
- mObInitMap.put(new Pair<String, String>("kl", "net/minecraft/init/Bootstrap"));
- mObInitMap.put(new Pair<String, String>("gm", "net/minecraft/network/play/server/S2EPacketCloseWindow"));
- mObInitMap.put(new Pair<String, String>("cn", "net/minecraft/util/RegistryNamespacedDefaultedByKey"));
- mObInitMap.put(new Pair<String, String>("zs", "net/minecraft/inventory/Container"));
- mObInitMap.put(new Pair<String, String>("ace", "net/minecraft/creativetab/CreativeTabs$8"));
- mObInitMap.put(new Pair<String, String>("arl", "net/minecraft/world/gen/feature/WorldGenDesertWells"));
- mObInitMap.put(new Pair<String, String>("anm", "net/minecraft/block/BlockSnowBlock"));
- mObInitMap.put(new Pair<String, String>("avk", "net/minecraft/world/gen/structure/StructureComponent"));
- mObInitMap.put(new Pair<String, String>("bch", "net/minecraft/client/gui/GuiListExtended"));
- mObInitMap.put(new Pair<String, String>("bgg", "net/minecraft/client/resources/ResourcePackListEntry"));
- mObInitMap.put(new Pair<String, String>("bkf", "net/minecraft/client/particle/EntityFlameFX"));
- mObInitMap.put(new Pair<String, String>("boe", "net/minecraft/client/renderer/entity/RenderMagmaCube"));
- mObInitMap.put(new Pair<String, String>("wh", "net/minecraft/entity/passive/EntityCow"));
- mObInitMap.put(new Pair<String, String>("oj", "net/minecraft/server/management/UserListOps"));
- mObInitMap.put(new Pair<String, String>("aoa", "net/minecraft/block/BlockPane"));
- mObInitMap.put(new Pair<String, String>("akb", "net/minecraft/block/BlockCommandBlock"));
- mObInitMap.put(new Pair<String, String>("acd", "net/minecraft/creativetab/CreativeTabs$7"));
- mObInitMap.put(new Pair<String, String>("agc", "net/minecraft/enchantment/EnchantmentData"));
- mObInitMap.put(new Pair<String, String>("bsc", "net/minecraft/client/resources/data/FontMetadataSection"));
- mObInitMap.put(new Pair<String, String>("bod", "net/minecraft/client/renderer/entity/RenderSnowball"));
- mObInitMap.put(
- new Pair<String, String>("net/minecraft/realms/RealmsBridge", "net/minecraft/realms/RealmsBridge"));
- mObInitMap.put(new Pair<String, String>("da", "net/minecraft/util/RegistrySimple"));
- mObInitMap.put(new Pair<String, String>("ass", "net/minecraft/world/gen/FlatGeneratorInfo"));
- mObInitMap.put(new Pair<String, String>("aot", "net/minecraft/tileentity/TileEntity$2"));
- mObInitMap.put(new Pair<String, String>("aku", "net/minecraft/block/BlockEndPortalFrame"));
- mObInitMap.put(new Pair<String, String>("acw", "net/minecraft/item/ItemFlintAndSteel"));
- mObInitMap.put(new Pair<String, String>("awr", "net/minecraft/block/material/MaterialTransparent"));
- mObInitMap.put(new Pair<String, String>("bsv", "net/minecraft/client/audio/ITickableSound"));
- mObInitMap.put(new Pair<String, String>("bow", "net/minecraft/client/renderer/entity/RenderSquid"));
- mObInitMap.put(new Pair<String, String>("bcz", "net/minecraft/client/gui/GuiCreateFlatWorld"));
- mObInitMap.put(new Pair<String, String>("bkx", "net/minecraft/client/particle/EntitySpellParticleFX"));
- mObInitMap.put(new Pair<String, String>("xo", "net/minecraft/entity/EntityMinecartCommandBlock$1"));
- mObInitMap.put(new Pair<String, String>("pq", "net/minecraft/stats/StatFileWriter"));
- mObInitMap.put(new Pair<String, String>("lr", "net/minecraft/server/gui/IUpdatePlayerListBox"));
- mObInitMap.put(new Pair<String, String>("hs", "net/minecraft/network/play/server/S07PacketRespawn"));
- mObInitMap.put(new Pair<String, String>("dt", "net/minecraft/nbt/NBTSizeTracker$1"));
- mObInitMap.put(new Pair<String, String>("aph", "net/minecraft/tileentity/IHopper"));
- mObInitMap.put(new Pair<String, String>("ali", "net/minecraft/block/BlockGravel"));
- mObInitMap.put(new Pair<String, String>("adk", "net/minecraft/item/ItemMinecart$1"));
- mObInitMap.put(new Pair<String, String>("ahj", "net/minecraft/world/WorldSettings"));
- mObInitMap.put(new Pair<String, String>("btj", "net/minecraft/client/audio/SoundManager"));
- mObInitMap.put(new Pair<String, String>("bpk", "net/minecraft/client/shader/Shader"));
- mObInitMap.put(new Pair<String, String>("bdn", "net/minecraft/client/gui/GuiOptions$1"));
- mObInitMap.put(new Pair<String, String>("bhm", "net/minecraft/client/model/ModelBiped"));
- mObInitMap.put(new Pair<String, String>("bll", "net/minecraft/client/entity/EntityOtherPlayerMP"));
- mObInitMap.put(new Pair<String, String>("mf", "net/minecraft/server/gui/StatsComponent"));
- mObInitMap.put(new Pair<String, String>("ig", "net/minecraft/network/play/server/S05PacketSpawnPosition"));
- mObInitMap.put(new Pair<String, String>("eh", "net/minecraft/network/NettyEncryptingDecoder"));
- mObInitMap.put(new Pair<String, String>("ai", "net/minecraft/command/CommandClearInventory"));
- mObInitMap.put(new Pair<String, String>("xn", "net/minecraft/entity/EntityMinecartCommandBlock"));
- mObInitMap.put(
- new Pair<String, String>("atf", "net/minecraft/world/gen/structure/StructureNetherBridgePieces"));
- mObInitMap.put(new Pair<String, String>("apg", "net/minecraft/tileentity/TileEntityFurnace"));
- mObInitMap.put(new Pair<String, String>("axe", "net/minecraft/world/gen/layer/GenLayerBiomeEdge"));
- mObInitMap.put(new Pair<String, String>("bac", "net/minecraft/scoreboard/Scoreboard"));
- mObInitMap.put(new Pair<String, String>("beb", "net/minecraft/client/gui/GuiSnooper$List"));
- mObInitMap.put(new Pair<String, String>("bia", "net/minecraft/client/model/ModelSilverfish"));
- mObInitMap.put(new Pair<String, String>("yb", "net/minecraft/entity/monster/IMob"));
- mObInitMap.put(new Pair<String, String>("uc", "net/minecraft/entity/ai/EntityAIDoorInteract"));
- mObInitMap.put(new Pair<String, String>("qd", "net/minecraft/util/LongHashMap"));
- mObInitMap.put(new Pair<String, String>("s", "net/minecraft/util/ReportedException"));
- mObInitMap.put(new Pair<String, String>("net/minecraft/client/ClientBrandRetriever",
- "net/minecraft/client/ClientBrandRetriever"));
- mObInitMap.put(new Pair<String, String>("apz", "net/minecraft/world/chunk/storage/ExtendedBlockStorage"));
- mObInitMap.put(
- new Pair<String, String>("aty", "net/minecraft/world/gen/structure/MapGenScatteredFeature$Start"));
- mObInitMap.put(new Pair<String, String>("axx", "net/minecraft/world/gen/layer/GenLayerSmooth"));
- mObInitMap.put(new Pair<String, String>("bav", "net/minecraft/client/Minecraft$15"));
- mObInitMap.put(new Pair<String, String>("beu", "net/minecraft/client/gui/GuiKeyBindingList$CategoryEntry"));
- mObInitMap.put(new Pair<String, String>("yu", "net/minecraft/entity/INpc"));
- mObInitMap.put(new Pair<String, String>("uv", "net/minecraft/entity/ai/EntityAIOcelotAttack"));
- mObInitMap.put(new Pair<String, String>("qw", "net/minecraft/util/WeightedRandom$Item"));
- mObInitMap.put(new Pair<String, String>("mx", "net/minecraft/server/management/ItemInWorldManager"));
- mObInitMap.put(new Pair<String, String>("iy", "net/minecraft/network/play/client/C0DPacketCloseWindow"));
- mObInitMap.put(new Pair<String, String>("ez", "net/minecraft/util/MessageDeserializer"));
- mObInitMap.put(new Pair<String, String>("amo", "net/minecraft/block/BlockPackedIce"));
- mObInitMap.put(new Pair<String, String>("aip", "net/minecraft/world/biome/BiomeGenPlains"));
- mObInitMap.put(new Pair<String, String>("aum",
- "net/minecraft/world/gen/structure/StructureStrongholdPieces$ChestCorridor"));
- mObInitMap.put(new Pair<String, String>("ayl", "net/minecraft/world/WorldSavedData"));
- mObInitMap.put(new Pair<String, String>("bup", "net/minecraft/client/stream/TwitchStream$1"));
- mObInitMap.put(new Pair<String, String>("bqq", "net/minecraft/client/resources/FallbackResourceManager"));
- mObInitMap.put(new Pair<String, String>("bet", "net/minecraft/client/gui/GuiKeyBindingList$1"));
- mObInitMap.put(new Pair<String, String>("bis", "net/minecraft/client/model/ModelBox"));
- mObInitMap.put(
- new Pair<String, String>("bmr", "net/minecraft/client/renderer/tileentity/TileEntitySignRenderer"));
- mObInitMap.put(new Pair<String, String>("zi", "net/minecraft/entity/projectile/EntitySmallFireball"));
- mObInitMap.put(new Pair<String, String>("vj", "net/minecraft/entity/ai/EntityAIFollowGolem"));
- mObInitMap.put(new Pair<String, String>("rk", "net/minecraft/profiler/IPlayerUsage"));
- mObInitMap.put(new Pair<String, String>("nl", "net/minecraft/server/network/NetHandlerHandshakeTCP"));
- mObInitMap.put(new Pair<String, String>("jm",
- "net/minecraft/network/play/client/C10PacketCreativeInventoryAction"));
- mObInitMap.put(new Pair<String, String>("fn", "net/minecraft/util/ChatStyle"));
- mObInitMap.put(new Pair<String, String>("bo", "net/minecraft/command/CommandSetPlayerTimeout"));
- mObInitMap.put(new Pair<String, String>("anc", "net/minecraft/block/BlockRedstoneTorch"));
- mObInitMap.put(new Pair<String, String>("abf", "net/minecraft/item/ItemAxe"));
- mObInitMap.put(new Pair<String, String>("afe", "net/minecraft/item/crafting/CraftingManager"));
- mObInitMap.put(new Pair<String, String>("ajd", "net/minecraft/block/BlockBasePressurePlate"));
- mObInitMap.put(new Pair<String, String>("bre", "net/minecraft/client/resources/ResourcePackRepository$2"));
- mObInitMap.put(new Pair<String, String>("ayk", "net/minecraft/world/storage/MapData$MapCoord"));
- mObInitMap.put(new Pair<String, String>("bfh", "net/minecraft/client/gui/GuiCommandBlock"));
- mObInitMap.put(new Pair<String, String>("bjg", "net/minecraft/client/multiplayer/WorldClient$1"));
- mObInitMap.put(new Pair<String, String>("bnf", "net/minecraft/client/renderer/entity/RenderCaveSpider"));
- mObInitMap.put(new Pair<String, String>("ka", "net/minecraft/network/status/server/S00PacketServerInfo"));
- mObInitMap.put(new Pair<String, String>("gb", "net/minecraft/network/play/server/S0CPacketSpawnPlayer"));
- mObInitMap.put(new Pair<String, String>("cc", "net/minecraft/command/server/CommandWhitelist"));
- mObInitMap.put(new Pair<String, String>("zh", "net/minecraft/entity/IProjectile"));
- mObInitMap.put(new Pair<String, String>("aby", "net/minecraft/creativetab/CreativeTabs$2"));
- mObInitMap.put(new Pair<String, String>("ara", "net/minecraft/world/gen/ChunkProviderEnd"));
- mObInitMap.put(new Pair<String, String>("anb", "net/minecraft/block/BlockRedstoneLight"));
- mObInitMap.put(
- new Pair<String, String>("bjz", "net/minecraft/client/particle/EntityEnchantmentTableParticleFX"));
- mObInitMap.put(new Pair<String, String>("bny", "net/minecraft/client/renderer/entity/RenderItem"));
- mObInitMap.put(new Pair<String, String>("cv", "net/minecraft/dispenser/ILocation"));
- mObInitMap.put(new Pair<String, String>("anu", "net/minecraft/block/BlockStem"));
- mObInitMap.put(new Pair<String, String>("afw", "net/minecraft/enchantment/EnchantmentHelper$1"));
- mObInitMap.put(new Pair<String, String>("ajv", "net/minecraft/block/BlockCarrot"));
- mObInitMap.put(
- new Pair<String, String>("avs", "net/minecraft/world/gen/structure/StructureVillagePieces$Field2"));
- mObInitMap.put(new Pair<String, String>("azr", "net/minecraft/world/storage/ThreadedFileIOBase"));
- mObInitMap.put(new Pair<String, String>("bcp", "net/minecraft/client/gui/GuiButtonRealmsProxy"));
- mObInitMap.put(new Pair<String, String>("brw", "net/minecraft/client/resources/data/IMetadataSerializer"));
- mObInitMap.put(new Pair<String, String>("bnx", "net/minecraft/client/renderer/tileentity/RenderItemFrame"));
- mObInitMap.put(new Pair<String, String>("wp", "net/minecraft/entity/passive/EntitySheep"));
- mObInitMap.put(new Pair<String, String>("sq", "net/minecraft/entity/item/EntityXPOrb"));
- mObInitMap.put(new Pair<String, String>("or", "net/minecraft/server/management/UserListWhitelist"));
- mObInitMap.put(new Pair<String, String>("ks", "net/minecraft/init/Bootstrap$2"));
- mObInitMap.put(new Pair<String, String>("gt", "net/minecraft/network/play/server/S19PacketEntityStatus"));
- mObInitMap.put(new Pair<String, String>("cu", "net/minecraft/dispenser/ILocatableSource"));
- mObInitMap.put(new Pair<String, String>("ash", "net/minecraft/world/gen/feature/WorldGenReed"));
- mObInitMap.put(new Pair<String, String>("aoi", "net/minecraft/block/BlockWall"));
- mObInitMap.put(new Pair<String, String>("akj", "net/minecraft/block/BlockRedstoneDiode"));
- mObInitMap.put(new Pair<String, String>("acl", "net/minecraft/item/ItemEmptyMap"));
- mObInitMap.put(new Pair<String, String>("agk", "net/minecraft/enchantment/EnchantmentUntouching"));
- mObInitMap.put(new Pair<String, String>("bsk", "net/minecraft/client/audio/PositionedSound"));
- mObInitMap.put(new Pair<String, String>("bol", "net/minecraft/client/renderer/entity/RenderMooshroom"));
- mObInitMap.put(
- new Pair<String, String>("bgn", "net/minecraft/client/gui/stream/GuiIngestServers$ServerList"));
- mObInitMap.put(new Pair<String, String>("bkm", "net/minecraft/client/particle/EntityFX"));
- mObInitMap.put(new Pair<String, String>("xd", "net/minecraft/entity/boss/EntityWither$1"));
- mObInitMap.put(new Pair<String, String>("te", "net/minecraft/entity/DataWatcher"));
- mObInitMap.put(new Pair<String, String>("pf", "net/minecraft/stats/StatCrafting"));
- mObInitMap.put(new Pair<String, String>("lg", "net/minecraft/server/ServerEula"));
- mObInitMap.put(new Pair<String, String>("hh",
- "net/minecraft/network/play/server/S14PacketEntity$S17PacketEntityLookMove"));
- mObInitMap.put(new Pair<String, String>("di", "net/minecraft/nbt/NBTTagCompound$1"));
- mObInitMap.put(new Pair<String, String>("bdc", "net/minecraft/client/gui/GuiGameOver"));
- mObInitMap.put(new Pair<String, String>("bla", "net/minecraft/client/particle/EntityAuraFX"));
- mObInitMap.put(new Pair<String, String>("py", "net/minecraft/server/management/LowerStringMap"));
- mObInitMap.put(new Pair<String, String>("lz", "net/minecraft/server/gui/MinecraftServerGui$1"));
- mObInitMap.put(new Pair<String, String>("ads", "net/minecraft/item/ItemRedstone"));
- mObInitMap.put(new Pair<String, String>("bps", "net/minecraft/client/renderer/ThreadDownloadImageData$1"));
- mObInitMap.put(new Pair<String, String>("asz",
- "net/minecraft/world/gen/structure/StructureMineshaftPieces$Cross"));
- mObInitMap.put(new Pair<String, String>("awy", "net/minecraft/world/gen/layer/GenLayerEdge"));
- mObInitMap.put(new Pair<String, String>("bdv", "net/minecraft/client/gui/GuiRenameWorld"));
- mObInitMap.put(new Pair<String, String>("bhu", "net/minecraft/client/model/ModelPig"));
- mObInitMap.put(new Pair<String, String>("blt", "net/minecraft/client/renderer/EntityRenderer"));
- mObInitMap.put(new Pair<String, String>("ep", "net/minecraft/network/EnumConnectionState$2"));
- mObInitMap.put(new Pair<String, String>("aq", "net/minecraft/command/CommandDifficulty"));
- mObInitMap.put(new Pair<String, String>("xv", "net/minecraft/entity/item/EntityMinecartTNT"));
- mObInitMap.put(new Pair<String, String>("tw", "net/minecraft/entity/ai/EntityAIAvoidEntity"));
- mObInitMap.put(new Pair<String, String>("px", "net/minecraft/util/HttpUtil$DownloadListener"));
- mObInitMap.put(new Pair<String, String>("h", "net/minecraft/crash/CrashReport$6"));
- mObInitMap.put(new Pair<String, String>("atn",
- "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor"));
- mObInitMap.put(new Pair<String, String>("apo", "net/minecraft/tileentity/TileEntityEndPortal"));
- mObInitMap.put(new Pair<String, String>("alp", "net/minecraft/block/BlockIce"));
- mObInitMap.put(new Pair<String, String>("adr", "net/minecraft/item/ItemRecord"));
- mObInitMap.put(new Pair<String, String>("ahq", "net/minecraft/world/Teleporter$PortalPosition"));
- mObInitMap.put(new Pair<String, String>("axm", "net/minecraft/world/gen/layer/GenLayerIsland"));
- mObInitMap.put(new Pair<String, String>("bak", "net/minecraft/client/gui/ChatLine"));
- mObInitMap.put(new Pair<String, String>("bej", "net/minecraft/client/gui/achievement/GuiStats"));
- mObInitMap.put(new Pair<String, String>("btq", "net/minecraft/client/audio/SoundHandler$1"));
- mObInitMap.put(new Pair<String, String>("bpr", "net/minecraft/client/renderer/ThreadDownloadImageData"));
- mObInitMap.put(new Pair<String, String>("yj", "net/minecraft/entity/SharedMonsterAttributes"));
- }
+ private static void init2() {
+ mInitMap.put(new Pair<String, String>("func_147951_b", "setTextureBlurred"));
+ mInitMap.put(new Pair<String, String>("func_147955_a", "uploadTextureMipmap"));
+ mInitMap.put(new Pair<String, String>("func_147960_a", "prepareAnisotropicFiltering"));
+ mInitMap.put(new Pair<String, String>("func_147961_a", "fixTransparentPixels"));
+ mInitMap.put(new Pair<String, String>("func_147962_a", "getFrameTextureData"));
+ mInitMap.put(new Pair<String, String>("func_147963_d", "generateMipmaps"));
+ mInitMap.put(new Pair<String, String>("func_147964_a", "loadSprite"));
+ mInitMap.put(new Pair<String, String>("func_147965_a", "getFrameTextureData"));
+ mInitMap.put(new Pair<String, String>("func_147969_b", "getMipmapDimension"));
+ mInitMap.put(new Pair<String, String>("func_147984_b", "getShaderUniformOrDefault"));
+ mInitMap.put(new Pair<String, String>("func_147985_d", "markDirty"));
+ mInitMap.put(new Pair<String, String>("func_147986_h", "getProgram"));
+ mInitMap.put(new Pair<String, String>("func_147987_b", "parseUniform"));
+ mInitMap.put(new Pair<String, String>("func_147988_a", "deleteShader"));
+ mInitMap.put(new Pair<String, String>("func_147989_e", "getVertexShaderLoader"));
+ mInitMap.put(new Pair<String, String>("func_147990_i", "setupUniforms"));
+ mInitMap.put(new Pair<String, String>("func_147991_a", "getShaderUniform"));
+ mInitMap.put(new Pair<String, String>("func_147992_a", "addSamplerTexture"));
+ mInitMap.put(new Pair<String, String>("func_147993_b", "endShader"));
+ mInitMap.put(new Pair<String, String>("func_147994_f", "getFragmentShaderLoader"));
+ mInitMap.put(new Pair<String, String>("func_147995_c", "useShader"));
+ mInitMap.put(new Pair<String, String>("func_147996_a", "parseSampler"));
+ mInitMap.put(new Pair<String, String>("func_148017_a", "getFramebuffer"));
+ mInitMap.put(new Pair<String, String>("func_148018_a", "loadShaderGroup"));
+ mInitMap.put(new Pair<String, String>("func_148020_a", "addFramebuffer"));
+ mInitMap.put(new Pair<String, String>("func_148021_a", "deleteShaderGroup"));
+ mInitMap.put(new Pair<String, String>("func_148022_b", "getShaderGroupName"));
+ mInitMap.put(new Pair<String, String>("func_148023_a", "addShader"));
+ mInitMap.put(new Pair<String, String>("func_148024_c", "resetProjectionMatrix"));
+ mInitMap.put(new Pair<String, String>("func_148026_a", "createBindFramebuffers"));
+ mInitMap.put(new Pair<String, String>("func_148027_a", "initTarget"));
+ mInitMap.put(new Pair<String, String>("func_148028_c", "initUniform"));
+ mInitMap.put(new Pair<String, String>("func_148040_d", "preLoadShader"));
+ mInitMap.put(new Pair<String, String>("func_148041_a", "addAuxFramebuffer"));
+ mInitMap.put(new Pair<String, String>("func_148042_a", "loadShader"));
+ mInitMap.put(new Pair<String, String>("func_148043_c", "getShaderManager"));
+ mInitMap.put(new Pair<String, String>("func_148044_b", "deleteShader"));
+ mInitMap.put(new Pair<String, String>("func_148045_a", "setProjectionMatrix"));
+ mInitMap.put(new Pair<String, String>("func_148054_b", "deleteShader"));
+ mInitMap.put(new Pair<String, String>("func_148055_a", "getShaderFilename"));
+ mInitMap.put(new Pair<String, String>("func_148056_a", "attachShader"));
+ mInitMap.put(new Pair<String, String>("func_148057_a", "loadShader"));
+ mInitMap.put(new Pair<String, String>("func_148062_a", "getShaderName"));
+ mInitMap.put(new Pair<String, String>("func_148063_b", "getShaderExtension"));
+ mInitMap.put(new Pair<String, String>("func_148064_d", "getLoadedShaders"));
+ mInitMap.put(new Pair<String, String>("func_148065_c", "getShaderMode"));
+ mInitMap.put(new Pair<String, String>("func_148074_b", "getStaticShaderLinkHelper"));
+ mInitMap.put(new Pair<String, String>("func_148075_b", "linkProgram"));
+ mInitMap.put(new Pair<String, String>("func_148076_a", "setmInitMap.put(newStaticShaderLinkHelper"));
+ mInitMap.put(new Pair<String, String>("func_148077_a", "deleteShader"));
+ mInitMap.put(new Pair<String, String>("func_148078_c", "createProgram"));
+ mInitMap.put(new Pair<String, String>("func_148081_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_148082_k", "uploadFloatMatrix"));
+ mInitMap.put(new Pair<String, String>("func_148083_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_148084_b", "setUniformLocation"));
+ mInitMap.put(new Pair<String, String>("func_148085_a", "parseType"));
+ mInitMap.put(new Pair<String, String>("func_148086_a", "getShaderName"));
+ mInitMap.put(new Pair<String, String>("func_148087_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_148088_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_148089_j", "uploadFloat"));
+ mInitMap.put(new Pair<String, String>("func_148090_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_148091_i", "uploadInt"));
+ mInitMap.put(new Pair<String, String>("func_148093_b", "upload"));
+ mInitMap.put(new Pair<String, String>("func_148094_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_148095_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_148096_h", "markDirty"));
+ mInitMap.put(new Pair<String, String>("func_148097_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_148120_b", "drawSelectionBox"));
+ mInitMap.put(new Pair<String, String>("func_148121_k", "bindAmountScrolled"));
+ mInitMap.put(new Pair<String, String>("func_148122_a", "setDimensions"));
+ mInitMap.put(new Pair<String, String>("func_148123_a", "drawBackground"));
+ mInitMap.put(new Pair<String, String>("func_148124_c", "getSlotIndexFromScreenCoords"));
+ mInitMap.put(new Pair<String, String>("func_148125_i", "getEnabled"));
+ mInitMap.put(new Pair<String, String>("func_148126_a", "drawSlot"));
+ mInitMap.put(new Pair<String, String>("func_148127_b", "getSize"));
+ mInitMap.put(new Pair<String, String>("func_148128_a", "drawScreen"));
+ mInitMap.put(new Pair<String, String>("func_148129_a", "drawListHeader"));
+ mInitMap.put(new Pair<String, String>("func_148130_a", "setShowSelectionBox"));
+ mInitMap.put(new Pair<String, String>("func_148131_a", "isSelected"));
+ mInitMap.put(new Pair<String, String>("func_148133_a", "setHasListHeader"));
+ mInitMap.put(new Pair<String, String>("func_148134_d", "registerScrollButtons"));
+ mInitMap.put(new Pair<String, String>("func_148136_c", "overlayBackground"));
+ mInitMap.put(new Pair<String, String>("func_148137_d", "getScrollBarX"));
+ mInitMap.put(new Pair<String, String>("func_148138_e", "getContentHeight"));
+ mInitMap.put(new Pair<String, String>("func_148139_c", "getListWidth"));
+ mInitMap.put(new Pair<String, String>("func_148140_g", "setSlotXBoundsFromLeft"));
+ mInitMap.put(new Pair<String, String>("func_148141_e", "isMouseYWithinSlotBounds"));
+ mInitMap.put(new Pair<String, String>("func_148143_b", "setEnabled"));
+ mInitMap.put(new Pair<String, String>("func_148144_a", "elementClicked"));
+ mInitMap.put(new Pair<String, String>("func_148145_f", "scrollBy"));
+ mInitMap.put(new Pair<String, String>("func_148146_j", "getSlotHeight"));
+ mInitMap.put(new Pair<String, String>("func_148147_a", "actionPerformed"));
+ mInitMap.put(new Pair<String, String>("func_148148_g", "getAmountScrolled"));
+ mInitMap.put(new Pair<String, String>("func_148180_b", "getListEntry"));
+ mInitMap.put(new Pair<String, String>("func_148201_l", "getList"));
+ mInitMap.put(new Pair<String, String>("func_148202_k", "getListHeader"));
+ mInitMap.put(new Pair<String, String>("func_148254_d", "getToken"));
+ mInitMap.put(new Pair<String, String>("func_148255_b", "getPlayerID"));
+ mInitMap.put(new Pair<String, String>("func_148256_e", "getProfile"));
+ mInitMap.put(new Pair<String, String>("func_148259_a", "saveScreenshot"));
+ mInitMap.put(new Pair<String, String>("func_148260_a", "saveScreenshot"));
+ mInitMap.put(new Pair<String, String>("func_148262_d", "denormalizeValue"));
+ mInitMap.put(new Pair<String, String>("func_148263_a", "setValueMax"));
+ mInitMap.put(new Pair<String, String>("func_148264_f", "snapToStep"));
+ mInitMap.put(new Pair<String, String>("func_148266_c", "normalizeValue"));
+ mInitMap.put(new Pair<String, String>("func_148267_f", "getValueMax"));
+ mInitMap.put(new Pair<String, String>("func_148268_e", "snapToStepClamp"));
+ mInitMap.put(new Pair<String, String>("func_148277_b", "mouseReleased"));
+ mInitMap.put(new Pair<String, String>("func_148278_a", "mousePressed"));
+ mInitMap.put(new Pair<String, String>("func_148279_a", "drawEntry"));
+ mInitMap.put(new Pair<String, String>("func_148289_a", "getLanServer"));
+ mInitMap.put(new Pair<String, String>("func_148296_a", "getServerData"));
+ mInitMap.put(new Pair<String, String>("func_148297_b", "prepareServerIcon"));
+ mInitMap.put(new Pair<String, String>("func_148329_a", "scrollTo"));
+ mInitMap.put(new Pair<String, String>("func_148334_a", "generatemInitMap.put(newRandomName"));
+ mInitMap.put(new Pair<String, String>("func_148335_a", "reseedRandomGenerator"));
+ mInitMap.put(new Pair<String, String>("func_148522_a", "onDownloadComplete"));
+ mInitMap.put(new Pair<String, String>("func_148526_a", "obtainResourcePack"));
+ mInitMap.put(new Pair<String, String>("func_148530_e", "getResourcePackInstance"));
+ mInitMap.put(new Pair<String, String>("func_148535_c", "getListMipmaps"));
+ mInitMap.put(new Pair<String, String>("func_148537_a", "sendPacketToAllPlayersInDimension"));
+ mInitMap.put(new Pair<String, String>("func_148539_a", "sendChatMsg"));
+ mInitMap.put(new Pair<String, String>("func_148540_a", "sendPacketToAllPlayers"));
+ mInitMap.put(new Pair<String, String>("func_148541_a", "sendToAllNear"));
+ mInitMap.put(new Pair<String, String>("func_148542_a", "allowUserToConnect"));
+ mInitMap.put(new Pair<String, String>("func_148543_a", "sendToAllNearExcept"));
+ mInitMap.put(new Pair<String, String>("func_148544_a", "sendChatMsgImpl"));
+ mInitMap.put(new Pair<String, String>("func_148545_a", "createPlayerForUser"));
+ mInitMap.put(new Pair<String, String>("func_148552_f", "isStreaming"));
+ mInitMap.put(new Pair<String, String>("func_148553_a", "setSoundEntryVolume"));
+ mInitMap.put(new Pair<String, String>("func_148554_a", "setSoundEntryWeight"));
+ mInitMap.put(new Pair<String, String>("func_148555_d", "getSoundEntryWeight"));
+ mInitMap.put(new Pair<String, String>("func_148556_a", "getSoundEntryName"));
+ mInitMap.put(new Pair<String, String>("func_148557_a", "setStreaming"));
+ mInitMap.put(new Pair<String, String>("func_148558_b", "getSoundEntryVolume"));
+ mInitMap.put(new Pair<String, String>("func_148559_b", "setSoundEntryPitch"));
+ mInitMap.put(new Pair<String, String>("func_148560_c", "getSoundEntryPitch"));
+ mInitMap.put(new Pair<String, String>("func_148561_a", "setSoundEntryName"));
+ mInitMap.put(new Pair<String, String>("func_148562_a", "setSoundEntryType"));
+ mInitMap.put(new Pair<String, String>("func_148563_e", "getSoundEntryType"));
+ mInitMap.put(new Pair<String, String>("func_148570_a", "getSoundList"));
+ mInitMap.put(new Pair<String, String>("func_148571_a", "setSoundCategory"));
+ mInitMap.put(new Pair<String, String>("func_148572_a", "setReplaceExisting"));
+ mInitMap.put(new Pair<String, String>("func_148573_c", "getSoundCategory"));
+ mInitMap.put(new Pair<String, String>("func_148574_b", "canReplaceExisting"));
+ mInitMap.put(new Pair<String, String>("func_148580_a", "getType"));
+ mInitMap.put(new Pair<String, String>("func_148586_a", "getTypeInt"));
+ mInitMap.put(new Pair<String, String>("func_148594_a", "getNormalizedVolume"));
+ mInitMap.put(new Pair<String, String>("func_148595_a", "getSoundCategoryVolume"));
+ mInitMap.put(new Pair<String, String>("func_148596_a", "reloadSoundSystem"));
+ mInitMap.put(new Pair<String, String>("func_148597_a", "isSoundPlaying"));
+ mInitMap.put(new Pair<String, String>("func_148599_a", "playDelayedSound"));
+ mInitMap.put(new Pair<String, String>("func_148601_a", "setSoundCategoryVolume"));
+ mInitMap.put(new Pair<String, String>("func_148602_b", "stopSound"));
+ mInitMap.put(new Pair<String, String>("func_148604_f", "resumeAllSounds"));
+ mInitMap.put(new Pair<String, String>("func_148605_d", "updateAllSounds"));
+ mInitMap.put(new Pair<String, String>("func_148606_a", "getNormalizedPitch"));
+ mInitMap.put(new Pair<String, String>("func_148608_i", "loadSoundSystem"));
+ mInitMap.put(new Pair<String, String>("func_148610_e", "pauseAllSounds"));
+ mInitMap.put(new Pair<String, String>("func_148611_c", "playSound"));
+ mInitMap.put(new Pair<String, String>("func_148612_a", "getURLForSoundResource"));
+ mInitMap.put(new Pair<String, String>("func_148613_b", "unloadSoundSystem"));
+ mInitMap.put(new Pair<String, String>("func_148614_c", "stopAllSounds"));
+ mInitMap.put(new Pair<String, String>("func_148615_a", "setListener"));
+ mInitMap.put(new Pair<String, String>("func_148633_c", "getMaxDelay"));
+ mInitMap.put(new Pair<String, String>("func_148634_b", "getMinDelay"));
+ mInitMap.put(new Pair<String, String>("func_148635_a", "getMusicTickerLocation"));
+ mInitMap.put(new Pair<String, String>("func_148647_b", "setVolume"));
+ mInitMap.put(new Pair<String, String>("func_148648_d", "isStreamingSound"));
+ mInitMap.put(new Pair<String, String>("func_148649_c", "getVolume"));
+ mInitMap.put(new Pair<String, String>("func_148650_b", "getPitch"));
+ mInitMap.put(new Pair<String, String>("func_148651_a", "setPitch"));
+ mInitMap.put(new Pair<String, String>("func_148652_a", "getSoundPoolEntryLocation"));
+ mInitMap.put(new Pair<String, String>("func_148727_a", "addSoundToEventPool"));
+ mInitMap.put(new Pair<String, String>("func_148728_d", "getSoundCategory"));
+ mInitMap.put(new Pair<String, String>("func_148729_c", "getSoundEventLocation"));
+ mInitMap.put(new Pair<String, String>("func_148740_a", "createUnderlyingMap"));
+ mInitMap.put(new Pair<String, String>("func_148741_d", "containsKey"));
+ mInitMap.put(new Pair<String, String>("func_148742_b", "getKeys"));
+ mInitMap.put(new Pair<String, String>("func_148750_c", "getNameForObject"));
+ mInitMap.put(new Pair<String, String>("func_148753_b", "containsId"));
+ mInitMap.put(new Pair<String, String>("func_148754_a", "getObjectById"));
+ mInitMap.put(new Pair<String, String>("func_148755_c", "ensureNamespaced"));
+ mInitMap.put(new Pair<String, String>("func_148756_a", "addObject"));
+ mInitMap.put(new Pair<String, String>("func_148757_b", "getIDForObject"));
+ mInitMap.put(new Pair<String, String>("func_148762_a", "registerSound"));
+ mInitMap.put(new Pair<String, String>("func_148763_c", "clearMap"));
+ mInitMap.put(new Pair<String, String>("func_148821_a", "glBlendFunc"));
+ mInitMap.put(new Pair<String, String>("func_148822_b", "isFramebufferEnabled"));
+ mInitMap.put(new Pair<String, String>("func_148833_a", "processPacket"));
+ mInitMap.put(new Pair<String, String>("func_148834_a", "readBlob"));
+ mInitMap.put(new Pair<String, String>("func_148835_b", "serialize"));
+ mInitMap.put(new Pair<String, String>("func_148836_a", "hasPriority"));
+ mInitMap.put(new Pair<String, String>("func_148837_a", "readPacketData"));
+ mInitMap.put(new Pair<String, String>("func_148838_a", "writeBlob"));
+ mInitMap.put(new Pair<String, String>("func_148839_a", "generatePacket"));
+ mInitMap.put(new Pair<String, String>("func_148840_b", "writePacketData"));
+ mInitMap.put(new Pair<String, String>("func_148853_f", "getTileEntityType"));
+ mInitMap.put(new Pair<String, String>("func_148854_e", "getZ"));
+ mInitMap.put(new Pair<String, String>("func_148855_d", "getY"));
+ mInitMap.put(new Pair<String, String>("func_148856_c", "getX"));
+ mInitMap.put(new Pair<String, String>("func_148857_g", "getNbtCompound"));
+ mInitMap.put(new Pair<String, String>("func_148864_h", "getData2"));
+ mInitMap.put(new Pair<String, String>("func_148865_f", "getZ"));
+ mInitMap.put(new Pair<String, String>("func_148866_e", "getY"));
+ mInitMap.put(new Pair<String, String>("func_148867_d", "getX"));
+ mInitMap.put(new Pair<String, String>("func_148868_c", "getBlockType"));
+ mInitMap.put(new Pair<String, String>("func_148869_g", "getData1"));
+ mInitMap.put(new Pair<String, String>("func_148916_d", "isChat"));
+ mInitMap.put(new Pair<String, String>("func_149089_e", "getZ"));
+ mInitMap.put(new Pair<String, String>("func_149090_d", "getY"));
+ mInitMap.put(new Pair<String, String>("func_149091_a", "getPlayer"));
+ mInitMap.put(new Pair<String, String>("func_149092_c", "getX"));
+ mInitMap.put(new Pair<String, String>("func_149101_g", "getFlySpeed"));
+ mInitMap.put(new Pair<String, String>("func_149102_b", "setFlying"));
+ mInitMap.put(new Pair<String, String>("func_149103_f", "isCreativeMode"));
+ mInitMap.put(new Pair<String, String>("func_149104_a", "setFlySpeed"));
+ mInitMap.put(new Pair<String, String>("func_149105_e", "isAllowFlying"));
+ mInitMap.put(new Pair<String, String>("func_149106_d", "isFlying"));
+ mInitMap.put(new Pair<String, String>("func_149107_h", "getWalkSpeed"));
+ mInitMap.put(new Pair<String, String>("func_149108_a", "setInvulnerable"));
+ mInitMap.put(new Pair<String, String>("func_149109_c", "setAllowFlying"));
+ mInitMap.put(new Pair<String, String>("func_149110_b", "setWalkSpeed"));
+ mInitMap.put(new Pair<String, String>("func_149111_d", "setCreativeMode"));
+ mInitMap.put(new Pair<String, String>("func_149112_c", "isInvulnerable"));
+ mInitMap.put(new Pair<String, String>("func_149187_d", "getData"));
+ mInitMap.put(new Pair<String, String>("func_149188_c", "getMapId"));
+ mInitMap.put(new Pair<String, String>("func_149239_h", "getPosZ"));
+ mInitMap.put(new Pair<String, String>("func_149240_f", "getPosX"));
+ mInitMap.put(new Pair<String, String>("func_149241_e", "getSoundData"));
+ mInitMap.put(new Pair<String, String>("func_149242_d", "getSoundType"));
+ mInitMap.put(new Pair<String, String>("func_149243_g", "getPosY"));
+ mInitMap.put(new Pair<String, String>("func_149244_c", "isSoundServerwide"));
+ mInitMap.put(new Pair<String, String>("func_149289_c", "getClientTime"));
+ mInitMap.put(new Pair<String, String>("func_149304_c", "getProfile"));
+ mInitMap.put(new Pair<String, String>("func_149330_d", "getFoodLevel"));
+ mInitMap.put(new Pair<String, String>("func_149331_e", "getSaturationLevel"));
+ mInitMap.put(new Pair<String, String>("func_149332_c", "getHealth"));
+ mInitMap.put(new Pair<String, String>("func_149419_c", "getMessage"));
+ mInitMap.put(new Pair<String, String>("func_149421_d", "getType"));
+ mInitMap.put(new Pair<String, String>("func_149435_c", "getStatus"));
+ mInitMap.put(new Pair<String, String>("func_149439_c", "getMessage"));
+ mInitMap.put(new Pair<String, String>("func_149460_c", "getKey"));
+ mInitMap.put(new Pair<String, String>("func_149462_g", "getYaw"));
+ mInitMap.put(new Pair<String, String>("func_149463_k", "getRotating"));
+ mInitMap.put(new Pair<String, String>("func_149464_c", "getPositionX"));
+ mInitMap.put(new Pair<String, String>("func_149467_d", "getPositionY"));
+ mInitMap.put(new Pair<String, String>("func_149470_h", "getPitch"));
+ mInitMap.put(new Pair<String, String>("func_149471_f", "getStance"));
+ mInitMap.put(new Pair<String, String>("func_149472_e", "getPositionZ"));
+ mInitMap.put(new Pair<String, String>("func_149482_g", "getFlySpeed"));
+ mInitMap.put(new Pair<String, String>("func_149483_b", "setFlying"));
+ mInitMap.put(new Pair<String, String>("func_149484_f", "isCreativeMode"));
+ mInitMap.put(new Pair<String, String>("func_149485_a", "setFlySpeed"));
+ mInitMap.put(new Pair<String, String>("func_149486_e", "isAllowFlying"));
+ mInitMap.put(new Pair<String, String>("func_149488_d", "isFlying"));
+ mInitMap.put(new Pair<String, String>("func_149489_h", "getWalkSpeed"));
+ mInitMap.put(new Pair<String, String>("func_149490_a", "setInvulnerable"));
+ mInitMap.put(new Pair<String, String>("func_149491_c", "setAllowFlying"));
+ mInitMap.put(new Pair<String, String>("func_149492_b", "setWalkSpeed"));
+ mInitMap.put(new Pair<String, String>("func_149493_d", "setCreativeMode"));
+ mInitMap.put(new Pair<String, String>("func_149494_c", "isInvulnerable"));
+ mInitMap.put(new Pair<String, String>("func_149501_f", "getDiggingBlockFace"));
+ mInitMap.put(new Pair<String, String>("func_149502_e", "getDiggedBlockZ"));
+ mInitMap.put(new Pair<String, String>("func_149503_d", "getDiggedBlockY"));
+ mInitMap.put(new Pair<String, String>("func_149505_c", "getDiggedBlockX"));
+ mInitMap.put(new Pair<String, String>("func_149506_g", "getDiggedBlockStatus"));
+ mInitMap.put(new Pair<String, String>("func_149518_g", "getDifficulty"));
+ mInitMap.put(new Pair<String, String>("func_149519_h", "isShowCape"));
+ mInitMap.put(new Pair<String, String>("func_149520_f", "isColorsEnabled"));
+ mInitMap.put(new Pair<String, String>("func_149521_d", "getView"));
+ mInitMap.put(new Pair<String, String>("func_149523_e", "getChatVisibility"));
+ mInitMap.put(new Pair<String, String>("func_149524_c", "getLang"));
+ mInitMap.put(new Pair<String, String>("func_149532_c", "getId"));
+ mInitMap.put(new Pair<String, String>("func_149533_d", "getUid"));
+ mInitMap.put(new Pair<String, String>("func_149537_d", "getButton"));
+ mInitMap.put(new Pair<String, String>("func_149539_c", "getId"));
+ mInitMap.put(new Pair<String, String>("func_149542_h", "getMode"));
+ mInitMap.put(new Pair<String, String>("func_149543_e", "getUsedButton"));
+ mInitMap.put(new Pair<String, String>("func_149544_d", "getSlotId"));
+ mInitMap.put(new Pair<String, String>("func_149546_g", "getClickedItem"));
+ mInitMap.put(new Pair<String, String>("func_149547_f", "getActionNumber"));
+ mInitMap.put(new Pair<String, String>("func_149548_c", "getWindowId"));
+ mInitMap.put(new Pair<String, String>("func_149558_e", "getData"));
+ mInitMap.put(new Pair<String, String>("func_149559_c", "getChannel"));
+ mInitMap.put(new Pair<String, String>("func_149564_a", "getEntityFromWorld"));
+ mInitMap.put(new Pair<String, String>("func_149565_c", "getAction"));
+ mInitMap.put(new Pair<String, String>("func_149568_f", "getPlacedBlockDirection"));
+ mInitMap.put(new Pair<String, String>("func_149569_i", "getPlacedBlockOffsetY"));
+ mInitMap.put(new Pair<String, String>("func_149570_e", "getPlacedBlockZ"));
+ mInitMap.put(new Pair<String, String>("func_149571_d", "getPlacedBlockY"));
+ mInitMap.put(new Pair<String, String>("func_149573_h", "getPlacedBlockOffsetX"));
+ mInitMap.put(new Pair<String, String>("func_149574_g", "getStack"));
+ mInitMap.put(new Pair<String, String>("func_149575_j", "getPlacedBlockOffsetZ"));
+ mInitMap.put(new Pair<String, String>("func_149576_c", "getPlacedBlockX"));
+ mInitMap.put(new Pair<String, String>("func_149585_e", "getZ"));
+ mInitMap.put(new Pair<String, String>("func_149586_d", "getY"));
+ mInitMap.put(new Pair<String, String>("func_149588_c", "getX"));
+ mInitMap.put(new Pair<String, String>("func_149589_f", "getLines"));
+ mInitMap.put(new Pair<String, String>("func_149594_c", "getRequestedState"));
+ mInitMap.put(new Pair<String, String>("func_149595_d", "getProtocolVersion"));
+ mInitMap.put(new Pair<String, String>("func_149614_c", "getSlotId"));
+ mInitMap.put(new Pair<String, String>("func_149616_d", "getForwardSpeed"));
+ mInitMap.put(new Pair<String, String>("func_149617_f", "isSneaking"));
+ mInitMap.put(new Pair<String, String>("func_149618_e", "isJumping"));
+ mInitMap.put(new Pair<String, String>("func_149620_c", "getStrafeSpeed"));
+ mInitMap.put(new Pair<String, String>("func_149625_d", "getStack"));
+ mInitMap.put(new Pair<String, String>("func_149627_c", "getSlotId"));
+ mInitMap.put(new Pair<String, String>("func_149633_g", "getSelectedBoundingBoxFromPool"));
+ mInitMap.put(new Pair<String, String>("func_149634_a", "getBlockFromItem"));
+ mInitMap.put(new Pair<String, String>("func_149635_D", "getBlockColor"));
+ mInitMap.put(new Pair<String, String>("func_149636_a", "harvestBlock"));
+ mInitMap.put(new Pair<String, String>("func_149637_q", "isBlockNormalCube"));
+ mInitMap.put(new Pair<String, String>("func_149638_a", "getExplosionResistance"));
+ mInitMap.put(new Pair<String, String>("func_149639_l", "fillWithRain"));
+ mInitMap.put(new Pair<String, String>("func_149640_a", "modifyEntityVelocity"));
+ mInitMap.put(new Pair<String, String>("func_149641_N", "getTextureName"));
+ mInitMap.put(new Pair<String, String>("func_149642_a", "dropBlockAsItem"));
+ mInitMap.put(new Pair<String, String>("func_149643_k", "getDamageValue"));
+ mInitMap.put(new Pair<String, String>("func_149644_j", "createStackedBlock"));
+ mInitMap.put(new Pair<String, String>("func_149645_b", "getRenderType"));
+ mInitMap.put(new Pair<String, String>("func_149646_a", "shouldSideBeRendered"));
+ mInitMap.put(new Pair<String, String>("func_149647_a", "setCreativeTab"));
+ mInitMap.put(new Pair<String, String>("func_149648_K", "isFlowerPot"));
+ mInitMap.put(new Pair<String, String>("func_149649_H", "disableStats"));
+ mInitMap.put(new Pair<String, String>("func_149650_a", "getItemDropped"));
+ mInitMap.put(new Pair<String, String>("func_149651_a", "registerIcons"));
+ mInitMap.put(new Pair<String, String>("func_149652_G", "getEnableStats"));
+ mInitMap.put(new Pair<String, String>("func_149653_t", "getTickRandomly"));
+ mInitMap.put(new Pair<String, String>("func_149654_a", "isVecInsideYZBounds"));
+ mInitMap.put(new Pair<String, String>("func_149655_b", "isPassable"));
+ mInitMap.put(new Pair<String, String>("func_149656_h", "getMobilityFlag"));
+ mInitMap.put(new Pair<String, String>("func_149657_c", "dropXpOnBlockBreak"));
+ mInitMap.put(new Pair<String, String>("func_149658_d", "setTextureName"));
+ mInitMap.put(new Pair<String, String>("func_149659_a", "canDropFromExplosion"));
+ mInitMap.put(new Pair<String, String>("func_149660_a", "onBlockPlaced"));
+ mInitMap.put(new Pair<String, String>("func_149661_c", "isVecInsideXYBounds"));
+ mInitMap.put(new Pair<String, String>("func_149662_c", "isOpaqueCube"));
+ mInitMap.put(new Pair<String, String>("func_149663_c", "setUnlocalizedName"));
+ mInitMap.put(new Pair<String, String>("func_149664_b", "onBlockDestroyedByPlayer"));
+ mInitMap.put(new Pair<String, String>("func_149665_z", "getBlockBoundsMinY"));
+ mInitMap.put(new Pair<String, String>("func_149666_a", "getSubBlocks"));
+ mInitMap.put(new Pair<String, String>("func_149667_c", "isAssociatedBlock"));
+ mInitMap.put(new Pair<String, String>("func_149668_a", "getCollisionBoundingBoxFromPool"));
+ mInitMap.put(new Pair<String, String>("func_149669_A", "getBlockBoundsMaxY"));
+ mInitMap.put(new Pair<String, String>("func_149670_a", "onEntityCollidedWithBlock"));
+ mInitMap.put(new Pair<String, String>("func_149671_p", "registerBlocks"));
+ mInitMap.put(new Pair<String, String>("func_149672_a", "setStepSound"));
+ mInitMap.put(new Pair<String, String>("func_149673_e", "getIcon"));
+ mInitMap.put(new Pair<String, String>("func_149674_a", "updateTick"));
+ mInitMap.put(new Pair<String, String>("func_149675_a", "setTickRandomly"));
+ mInitMap.put(new Pair<String, String>("func_149676_a", "setBlockBounds"));
+ mInitMap.put(new Pair<String, String>("func_149677_c", "getMixedBrightnessForBlock"));
+ mInitMap.put(new Pair<String, String>("func_149678_a", "canStopRayTrace"));
+ mInitMap.put(new Pair<String, String>("func_149679_a", "quantityDroppedWithBonus"));
+ mInitMap.put(new Pair<String, String>("func_149680_a", "isEqualTo"));
+ mInitMap.put(new Pair<String, String>("func_149681_a", "onBlockHarvested"));
+ mInitMap.put(new Pair<String, String>("func_149682_b", "getIdFromBlock"));
+ mInitMap.put(new Pair<String, String>("func_149683_g", "setBlockBoundsForItemRender"));
+ mInitMap.put(new Pair<String, String>("func_149684_b", "getBlockFromName"));
+ mInitMap.put(new Pair<String, String>("func_149685_I", "getAmbientOcclusionLightValue"));
+ mInitMap.put(new Pair<String, String>("func_149686_d", "renderAsNormalBlock"));
+ mInitMap.put(new Pair<String, String>("func_149687_b", "isVecInsideXZBounds"));
+ mInitMap.put(new Pair<String, String>("func_149688_o", "getMaterial"));
+ mInitMap.put(new Pair<String, String>("func_149689_a", "onBlockPlacedBy"));
+ mInitMap.put(new Pair<String, String>("func_149690_a", "dropBlockAsItemWithChance"));
+ mInitMap.put(new Pair<String, String>("func_149691_a", "getIcon"));
+ mInitMap.put(new Pair<String, String>("func_149692_a", "damageDropped"));
+ mInitMap.put(new Pair<String, String>("func_149693_C", "getBlockBoundsMaxZ"));
+ mInitMap.put(new Pair<String, String>("func_149694_d", "getItem"));
+ mInitMap.put(new Pair<String, String>("func_149695_a", "onNeighborBlockChange"));
+ mInitMap.put(new Pair<String, String>("func_149696_a", "onBlockEventReceived"));
+ mInitMap.put(new Pair<String, String>("func_149697_b", "dropBlockAsItem"));
+ mInitMap.put(new Pair<String, String>("func_149698_L", "requiresUpdates"));
+ mInitMap.put(new Pair<String, String>("func_149699_a", "onBlockClicked"));
+ mInitMap.put(new Pair<String, String>("func_149700_E", "canSilkHarvest"));
+ mInitMap.put(new Pair<String, String>("func_149701_w", "getRenderBlockPass"));
+ mInitMap.put(new Pair<String, String>("func_149702_O", "getItemIconName"));
+ mInitMap.put(new Pair<String, String>("func_149703_v", "isCollidable"));
+ mInitMap.put(new Pair<String, String>("func_149704_x", "getBlockBoundsMinX"));
+ mInitMap.put(new Pair<String, String>("func_149705_a", "canReplace"));
+ mInitMap.put(new Pair<String, String>("func_149706_B", "getBlockBoundsMinZ"));
+ mInitMap.put(new Pair<String, String>("func_149707_d", "canPlaceBlockOnSide"));
+ mInitMap.put(new Pair<String, String>("func_149708_J", "getCreativeTabToDisplayOn"));
+ mInitMap.put(new Pair<String, String>("func_149709_b", "isProvidingWeakPower"));
+ mInitMap.put(new Pair<String, String>("func_149710_n", "getUseNeighborBrightness"));
+ mInitMap.put(new Pair<String, String>("func_149711_c", "setHardness"));
+ mInitMap.put(new Pair<String, String>("func_149712_f", "getBlockHardness"));
+ mInitMap.put(new Pair<String, String>("func_149713_g", "setLightOpacity"));
+ mInitMap.put(new Pair<String, String>("func_149714_e", "onPostBlockPlaced"));
+ mInitMap.put(new Pair<String, String>("func_149715_a", "setLightLevel"));
+ mInitMap.put(new Pair<String, String>("func_149716_u", "hasTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_149717_k", "getLightOpacity"));
+ mInitMap.put(new Pair<String, String>("func_149718_j", "canBlockStay"));
+ mInitMap.put(new Pair<String, String>("func_149719_a", "setBlockBoundsBasedOnState"));
+ mInitMap.put(new Pair<String, String>("func_149720_d", "colorMultiplier"));
+ mInitMap.put(new Pair<String, String>("func_149721_r", "isNormalCube"));
+ mInitMap.put(new Pair<String, String>("func_149722_s", "setBlockUnbreakable"));
+ mInitMap.put(new Pair<String, String>("func_149723_a", "onBlockDestroyedByExplosion"));
+ mInitMap.put(new Pair<String, String>("func_149724_b", "onEntityWalking"));
+ mInitMap.put(new Pair<String, String>("func_149725_f", "onBlockPreDestroy"));
+ mInitMap.put(new Pair<String, String>("func_149726_b", "onBlockAdded"));
+ mInitMap.put(new Pair<String, String>("func_149727_a", "onBlockActivated"));
+ mInitMap.put(new Pair<String, String>("func_149728_f", "getMapColor"));
+ mInitMap.put(new Pair<String, String>("func_149729_e", "getBlockById"));
+ mInitMap.put(new Pair<String, String>("func_149730_j", "isFullBlock"));
+ mInitMap.put(new Pair<String, String>("func_149731_a", "collisionRayTrace"));
+ mInitMap.put(new Pair<String, String>("func_149732_F", "getLocalizedName"));
+ mInitMap.put(new Pair<String, String>("func_149733_h", "getBlockTextureFromSide"));
+ mInitMap.put(new Pair<String, String>("func_149734_b", "randomDisplayTick"));
+ mInitMap.put(new Pair<String, String>("func_149735_b", "getItemIcon"));
+ mInitMap.put(new Pair<String, String>("func_149736_g", "getComparatorInputOverride"));
+ mInitMap.put(new Pair<String, String>("func_149737_a", "getPlayerRelativeBlockHardness"));
+ mInitMap.put(new Pair<String, String>("func_149738_a", "tickRate"));
+ mInitMap.put(new Pair<String, String>("func_149739_a", "getUnlocalizedName"));
+ mInitMap.put(new Pair<String, String>("func_149740_M", "hasComparatorInputOverride"));
+ mInitMap.put(new Pair<String, String>("func_149741_i", "getRenderColor"));
+ mInitMap.put(new Pair<String, String>("func_149742_c", "canPlaceBlockAt"));
+ mInitMap.put(new Pair<String, String>("func_149743_a", "addCollisionBoxesToList"));
+ mInitMap.put(new Pair<String, String>("func_149744_f", "canProvidePower"));
+ mInitMap.put(new Pair<String, String>("func_149745_a", "quantityDropped"));
+ mInitMap.put(new Pair<String, String>("func_149746_a", "onFallenUpon"));
+ mInitMap.put(new Pair<String, String>("func_149747_d", "isBlockSolid"));
+ mInitMap.put(new Pair<String, String>("func_149748_c", "isProvidingStrongPower"));
+ mInitMap.put(new Pair<String, String>("func_149749_a", "breakBlock"));
+ mInitMap.put(new Pair<String, String>("func_149750_m", "getLightValue"));
+ mInitMap.put(new Pair<String, String>("func_149751_l", "isTranslucent"));
+ mInitMap.put(new Pair<String, String>("func_149752_b", "setResistance"));
+ mInitMap.put(new Pair<String, String>("func_149753_y", "getBlockBoundsMaxX"));
+ mInitMap.put(new Pair<String, String>("func_149798_e", "getEffectiveFlowDecay"));
+ mInitMap.put(new Pair<String, String>("func_149800_f", "getFlowVector"));
+ mInitMap.put(new Pair<String, String>("func_149801_b", "getLiquidHeightPercent"));
+ mInitMap.put(new Pair<String, String>("func_149802_a", "getFlowDirection"));
+ mInitMap.put(new Pair<String, String>("func_149803_e", "getLiquidIcon"));
+ mInitMap.put(new Pair<String, String>("func_149817_o", "isFlammable"));
+ mInitMap.put(new Pair<String, String>("func_149818_n", "setNotStationary"));
+ mInitMap.put(new Pair<String, String>("func_149819_b", "invertMetadata"));
+ mInitMap.put(new Pair<String, String>("func_149825_a", "isFence"));
+ mInitMap.put(new Pair<String, String>("func_149826_e", "canConnectFenceTo"));
+ mInitMap.put(new Pair<String, String>("func_149828_a", "playSoundWhenFallen"));
+ mInitMap.put(new Pair<String, String>("func_149829_a", "onStartFalling"));
+ mInitMap.put(new Pair<String, String>("func_149831_e", "canFallBelow"));
+ mInitMap.put(new Pair<String, String>("func_149840_c", "getFireIcon"));
+ mInitMap.put(new Pair<String, String>("func_149841_a", "tryCatchFire"));
+ mInitMap.put(new Pair<String, String>("func_149844_e", "canBlockCatchFire"));
+ mInitMap.put(new Pair<String, String>("func_149845_m", "getChanceOfNeighborsEncouragingFire"));
+ mInitMap.put(new Pair<String, String>("func_149847_e", "canNeighborBurn"));
+ mInitMap.put(new Pair<String, String>("func_149851_a", "canFertilize"));
+ mInitMap.put(new Pair<String, String>("func_149852_a", "shouldFertilize"));
+ mInitMap.put(new Pair<String, String>("func_149853_b", "fertilize"));
+ mInitMap.put(new Pair<String, String>("func_149854_a", "canPlaceBlockOn"));
+ mInitMap.put(new Pair<String, String>("func_149855_e", "checkAndDropBlock"));
+ mInitMap.put(new Pair<String, String>("func_149863_m", "fertilize"));
+ mInitMap.put(new Pair<String, String>("func_149865_P", "getCrop"));
+ mInitMap.put(new Pair<String, String>("func_149866_i", "getSeed"));
+ mInitMap.put(new Pair<String, String>("func_149872_i", "getStemIcon"));
+ mInitMap.put(new Pair<String, String>("func_149873_e", "getState"));
+ mInitMap.put(new Pair<String, String>("func_149874_m", "fertilizeStem"));
+ mInitMap.put(new Pair<String, String>("func_149878_d", "growTree"));
+ mInitMap.put(new Pair<String, String>("func_149879_c", "markOrGrowMarked"));
+ mInitMap.put(new Pair<String, String>("func_149884_c", "fertilizeMushroom"));
+ mInitMap.put(new Pair<String, String>("func_149895_l", "getDirection"));
+ mInitMap.put(new Pair<String, String>("func_149896_b", "isFenceGateOpen"));
+ mInitMap.put(new Pair<String, String>("func_149898_i", "getBlockUnpowered"));
+ mInitMap.put(new Pair<String, String>("func_149900_a", "isGettingInput"));
+ mInitMap.put(new Pair<String, String>("func_149903_h", "getInputStrength"));
+ mInitMap.put(new Pair<String, String>("func_149906_e", "getBlockPowered"));
+ mInitMap.put(new Pair<String, String>("func_149909_d", "isRedstoneRepeaterBlockID"));
+ mInitMap.put(new Pair<String, String>("func_149915_a", "createmInitMap.put(newTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_149916_e", "getHopperIcon"));
+ mInitMap.put(new Pair<String, String>("func_149917_c", "getActiveStateFromMetadata"));
+ mInitMap.put(new Pair<String, String>("func_149918_b", "getDirectionFromMetadata"));
+ mInitMap.put(new Pair<String, String>("func_149919_e", "updateBlockData"));
+ mInitMap.put(new Pair<String, String>("func_149931_a", "updateFurnaceBlockState"));
+ mInitMap.put(new Pair<String, String>("func_149937_b", "getFacingDirection"));
+ mInitMap.put(new Pair<String, String>("func_149939_a", "getIPositionFromBlockSource"));
+ mInitMap.put(new Pair<String, String>("func_149951_m", "getInventory"));
+ mInitMap.put(new Pair<String, String>("func_149952_n", "isDoubleChest"));
+ mInitMap.put(new Pair<String, String>("func_149953_o", "isOcelotSittingOnTop"));
+ mInitMap.put(new Pair<String, String>("func_149954_e", "initMetadata"));
+ mInitMap.put(new Pair<String, String>("func_149959_e", "getIconBrewingStandBase"));
+ mInitMap.put(new Pair<String, String>("func_149962_a", "getTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_149965_a", "makeWither"));
+ mInitMap.put(new Pair<String, String>("func_149970_j", "getOutputStrength"));
+ mInitMap.put(new Pair<String, String>("func_149971_e", "getTileEntityComparator"));
+ mInitMap.put(new Pair<String, String>("func_149975_b", "isBlockHeadOfBed"));
+ mInitMap.put(new Pair<String, String>("func_149976_c", "isBedOccupied"));
+ mInitMap.put(new Pair<String, String>("func_149977_a", "getSafeExitLocation"));
+ mInitMap.put(new Pair<String, String>("func_149978_e", "setBedBounds"));
+ mInitMap.put(new Pair<String, String>("func_149979_a", "setBedOccupied"));
+ mInitMap.put(new Pair<String, String>("func_149988_b", "getCocoaIcon"));
+ mInitMap.put(new Pair<String, String>("func_149990_e", "getIconSideOverlay"));
+ mInitMap.put(new Pair<String, String>("func_150000_e", "tryToCreatePortal"));
+ mInitMap.put(new Pair<String, String>("func_150002_b", "getFullSlabName"));
+ mInitMap.put(new Pair<String, String>("func_150012_g", "getFullMetadata"));
+ mInitMap.put(new Pair<String, String>("func_150020_b", "isEnderEyeInserted"));
+ mInitMap.put(new Pair<String, String>("func_150021_e", "getIconEndPortalFrameEye"));
+ mInitMap.put(new Pair<String, String>("func_150024_a", "setWaterLevel"));
+ mInitMap.put(new Pair<String, String>("func_150025_c", "getRenderLiquidLevel"));
+ mInitMap.put(new Pair<String, String>("func_150026_e", "getCauldronIcon"));
+ mInitMap.put(new Pair<String, String>("func_150027_b", "getPowerFromMeta"));
+ mInitMap.put(new Pair<String, String>("func_150042_a", "updateNeighbor"));
+ mInitMap.put(new Pair<String, String>("func_150043_b", "setBlockBoundsFromMeta"));
+ mInitMap.put(new Pair<String, String>("func_150044_m", "canStay"));
+ mInitMap.put(new Pair<String, String>("func_150045_e", "findSolidSide"));
+ mInitMap.put(new Pair<String, String>("func_150046_n", "activateButton"));
+ mInitMap.put(new Pair<String, String>("func_150048_a", "onRedstoneSignal"));
+ mInitMap.put(new Pair<String, String>("func_150049_b_", "isRailBlockAt"));
+ mInitMap.put(new Pair<String, String>("func_150050_e", "isPowered"));
+ mInitMap.put(new Pair<String, String>("func_150051_a", "isRailBlock"));
+ mInitMap.put(new Pair<String, String>("func_150052_a", "refreshTrackShape"));
+ mInitMap.put(new Pair<String, String>("func_150060_c", "getPowerFromMeta"));
+ mInitMap.put(new Pair<String, String>("func_150061_a", "getSensitiveAABB"));
+ mInitMap.put(new Pair<String, String>("func_150062_a", "setStateIfMobInteractsWithPlate"));
+ mInitMap.put(new Pair<String, String>("func_150063_b", "setBlockBoundsFromMeta"));
+ mInitMap.put(new Pair<String, String>("func_150064_a_", "updateNeighbors"));
+ mInitMap.put(new Pair<String, String>("func_150065_e", "getPlateState"));
+ mInitMap.put(new Pair<String, String>("func_150066_d", "getMetaFromPower"));
+ mInitMap.put(new Pair<String, String>("func_150071_a", "determineOrientation"));
+ mInitMap.put(new Pair<String, String>("func_150072_a", "isIndirectlyPowered"));
+ mInitMap.put(new Pair<String, String>("func_150073_e", "getPistonExtensionTexture"));
+ mInitMap.put(new Pair<String, String>("func_150074_e", "getPistonBaseIcon"));
+ mInitMap.put(new Pair<String, String>("func_150075_c", "isExtended"));
+ mInitMap.put(new Pair<String, String>("func_150076_b", "getPistonOrientation"));
+ mInitMap.put(new Pair<String, String>("func_150077_h", "canExtend"));
+ mInitMap.put(new Pair<String, String>("func_150078_e", "updatePistonState"));
+ mInitMap.put(new Pair<String, String>("func_150079_i", "tryExtend"));
+ mInitMap.put(new Pair<String, String>("func_150080_a", "canPushBlock"));
+ mInitMap.put(new Pair<String, String>("func_150085_b", "getDirectionMeta"));
+ mInitMap.put(new Pair<String, String>("func_150089_b", "setBlockBoundsFromMeta"));
+ mInitMap.put(new Pair<String, String>("func_150091_e", "canConnectWallTo"));
+ mInitMap.put(new Pair<String, String>("func_150098_a", "canPaneConnectToBlock"));
+ mInitMap.put(new Pair<String, String>("func_150107_m", "canPlaceTorchOn"));
+ mInitMap.put(new Pair<String, String>("func_150109_e", "dropTorchIfCantStay"));
+ mInitMap.put(new Pair<String, String>("func_150118_d", "isTrapdoorOpen"));
+ mInitMap.put(new Pair<String, String>("func_150119_a", "isValidSupportBlock"));
+ mInitMap.put(new Pair<String, String>("func_150122_b", "setGraphicsLevel"));
+ mInitMap.put(new Pair<String, String>("func_150126_e", "removeLeaves"));
+ mInitMap.put(new Pair<String, String>("func_150147_e", "setBaseBounds"));
+ mInitMap.put(new Pair<String, String>("func_150148_a", "isBlockStairs"));
+ mInitMap.put(new Pair<String, String>("func_150161_d", "getTopIcon"));
+ mInitMap.put(new Pair<String, String>("func_150163_b", "getSideIcon"));
+ mInitMap.put(new Pair<String, String>("func_150173_e", "getRedstomInitMap.put(newireIcon"));
+ mInitMap.put(new Pair<String, String>("func_150174_f", "isPowerProviderOrWire"));
+ mInitMap.put(new Pair<String, String>("func_150206_m", "createDeepCopy"));
+ mInitMap.put(new Pair<String, String>("func_150209_a", "setChatHoverEvent"));
+ mInitMap.put(new Pair<String, String>("func_150210_i", "getChatHoverEvent"));
+ mInitMap.put(new Pair<String, String>("func_150215_a", "getColor"));
+ mInitMap.put(new Pair<String, String>("func_150217_b", "setItalic"));
+ mInitMap.put(new Pair<String, String>("func_150218_j", "getFormattingCode"));
+ mInitMap.put(new Pair<String, String>("func_150221_a", "setParentStyle"));
+ mInitMap.put(new Pair<String, String>("func_150223_b", "getBold"));
+ mInitMap.put(new Pair<String, String>("func_150224_n", "getParent"));
+ mInitMap.put(new Pair<String, String>("func_150225_c", "setStrikethrough"));
+ mInitMap.put(new Pair<String, String>("func_150227_a", "setBold"));
+ mInitMap.put(new Pair<String, String>("func_150228_d", "setUnderlined"));
+ mInitMap.put(new Pair<String, String>("func_150229_g", "isEmpty"));
+ mInitMap.put(new Pair<String, String>("func_150232_l", "createShallowCopy"));
+ mInitMap.put(new Pair<String, String>("func_150233_f", "getObfuscated"));
+ mInitMap.put(new Pair<String, String>("func_150234_e", "getUnderlined"));
+ mInitMap.put(new Pair<String, String>("func_150235_h", "getChatClickEvent"));
+ mInitMap.put(new Pair<String, String>("func_150236_d", "getStrikethrough"));
+ mInitMap.put(new Pair<String, String>("func_150237_e", "setObfuscated"));
+ mInitMap.put(new Pair<String, String>("func_150238_a", "setColor"));
+ mInitMap.put(new Pair<String, String>("func_150241_a", "setChatClickEvent"));
+ mInitMap.put(new Pair<String, String>("func_150242_c", "getItalic"));
+ mInitMap.put(new Pair<String, String>("func_150253_a", "getSiblings"));
+ mInitMap.put(new Pair<String, String>("func_150254_d", "getFormattedText"));
+ mInitMap.put(new Pair<String, String>("func_150255_a", "setChatStyle"));
+ mInitMap.put(new Pair<String, String>("func_150256_b", "getChatStyle"));
+ mInitMap.put(new Pair<String, String>("func_150257_a", "appendSibling"));
+ mInitMap.put(new Pair<String, String>("func_150258_a", "appendText"));
+ mInitMap.put(new Pair<String, String>("func_150259_f", "createCopy"));
+ mInitMap.put(new Pair<String, String>("func_150260_c", "getUnformattedText"));
+ mInitMap.put(new Pair<String, String>("func_150261_e", "getUnformattedTextForChat"));
+ mInitMap.put(new Pair<String, String>("func_150262_a", "createDeepCopyIterator"));
+ mInitMap.put(new Pair<String, String>("func_150265_g", "getChatComponentText_TextValue"));
+ mInitMap.put(new Pair<String, String>("func_150268_i", "getKey"));
+ mInitMap.put(new Pair<String, String>("func_150269_b", "initializeFromFormat"));
+ mInitMap.put(new Pair<String, String>("func_150270_g", "ensureInitialized"));
+ mInitMap.put(new Pair<String, String>("func_150271_j", "getFormatArgs"));
+ mInitMap.put(new Pair<String, String>("func_150272_a", "getFormatArgumentAsComponent"));
+ mInitMap.put(new Pair<String, String>("func_150284_a", "createmInitMap.put(newByType"));
+ mInitMap.put(new Pair<String, String>("func_150285_a_", "getString"));
+ mInitMap.put(new Pair<String, String>("func_150286_g", "getDouble"));
+ mInitMap.put(new Pair<String, String>("func_150287_d", "getInt"));
+ mInitMap.put(new Pair<String, String>("func_150288_h", "getFloat"));
+ mInitMap.put(new Pair<String, String>("func_150289_e", "getShort"));
+ mInitMap.put(new Pair<String, String>("func_150290_f", "getByte"));
+ mInitMap.put(new Pair<String, String>("func_150291_c", "getLong"));
+ mInitMap.put(new Pair<String, String>("func_150292_c", "getByteArray"));
+ mInitMap.put(new Pair<String, String>("func_150295_c", "getTagList"));
+ mInitMap.put(new Pair<String, String>("func_150296_c", "getKeySet"));
+ mInitMap.put(new Pair<String, String>("func_150297_b", "hasKey"));
+ mInitMap.put(new Pair<String, String>("func_150298_a", "writeEntry"));
+ mInitMap.put(new Pair<String, String>("func_150299_b", "getTagId"));
+ mInitMap.put(new Pair<String, String>("func_150302_c", "getIntArray"));
+ mInitMap.put(new Pair<String, String>("func_150303_d", "getTagType"));
+ mInitMap.put(new Pair<String, String>("func_150304_a", "setTag"));
+ mInitMap.put(new Pair<String, String>("func_150305_b", "getCompoundTagAt"));
+ mInitMap.put(new Pair<String, String>("func_150306_c", "getIntArrayAt"));
+ mInitMap.put(new Pair<String, String>("func_150307_f", "getStringTagAt"));
+ mInitMap.put(new Pair<String, String>("func_150308_e", "getFloatAt"));
+ mInitMap.put(new Pair<String, String>("func_150309_d", "getDoubleAt"));
+ mInitMap.put(new Pair<String, String>("func_150494_d", "getFrequency"));
+ mInitMap.put(new Pair<String, String>("func_150495_a", "getDigResourcePath"));
+ mInitMap.put(new Pair<String, String>("func_150496_b", "getPlaceSound"));
+ mInitMap.put(new Pair<String, String>("func_150497_c", "getVolume"));
+ mInitMap.put(new Pair<String, String>("func_150498_e", "getStepSound"));
+ mInitMap.put(new Pair<String, String>("func_150503_a", "decipher"));
+ mInitMap.put(new Pair<String, String>("func_150504_a", "cipher"));
+ mInitMap.put(new Pair<String, String>("func_150510_c", "getLastUpdateTimeInMilliseconds"));
+ mInitMap.put(new Pair<String, String>("func_150512_a", "decorateChunk"));
+ mInitMap.put(new Pair<String, String>("func_150513_a", "genDecorations"));
+ mInitMap.put(new Pair<String, String>("func_150516_a", "setBlockAndNotifyAdequately"));
+ mInitMap.put(new Pair<String, String>("func_150558_b", "getBiomeGrassColor"));
+ mInitMap.put(new Pair<String, String>("func_150560_b", "genBiomeTerrain"));
+ mInitMap.put(new Pair<String, String>("func_150561_m", "getTempCategory"));
+ mInitMap.put(new Pair<String, String>("func_150562_l", "getBiomeClass"));
+ mInitMap.put(new Pair<String, String>("func_150564_a", "getFloatTemperature"));
+ mInitMap.put(new Pair<String, String>("func_150565_n", "getBiomeGenArray"));
+ mInitMap.put(new Pair<String, String>("func_150566_k", "createMutation"));
+ mInitMap.put(new Pair<String, String>("func_150568_d", "getBiome"));
+ mInitMap.put(new Pair<String, String>("func_150569_a", "isEqualTo"));
+ mInitMap.put(new Pair<String, String>("func_150570_a", "setHeight"));
+ mInitMap.put(new Pair<String, String>("func_150571_c", "getBiomeFoliageColor"));
+ mInitMap.put(new Pair<String, String>("func_150573_a", "genTerrainBlocks"));
+ mInitMap.put(new Pair<String, String>("func_150633_b", "mutateHills"));
+ mInitMap.put(new Pair<String, String>("func_150646_a", "isRailBlockAt"));
+ mInitMap.put(new Pair<String, String>("func_150650_a", "countAdjacentRails"));
+ mInitMap.put(new Pair<String, String>("func_150663_a", "writeTag"));
+ mInitMap.put(new Pair<String, String>("func_150668_b", "getValue"));
+ mInitMap.put(new Pair<String, String>("func_150669_a", "getAction"));
+ mInitMap.put(new Pair<String, String>("func_150672_a", "getValueByCanonicalName"));
+ mInitMap.put(new Pair<String, String>("func_150673_b", "getCanonicalName"));
+ mInitMap.put(new Pair<String, String>("func_150674_a", "shouldAllowInChat"));
+ mInitMap.put(new Pair<String, String>("func_150684_a", "getValueByCanonicalName"));
+ mInitMap.put(new Pair<String, String>("func_150685_b", "getCanonicalName"));
+ mInitMap.put(new Pair<String, String>("func_150686_a", "shouldAllowInChat"));
+ mInitMap.put(new Pair<String, String>("func_150695_a", "serializeChatStyle"));
+ mInitMap.put(new Pair<String, String>("func_150696_a", "componentToJson"));
+ mInitMap.put(new Pair<String, String>("func_150699_a", "jsonToComponent"));
+ mInitMap.put(new Pair<String, String>("func_150701_a", "getAction"));
+ mInitMap.put(new Pair<String, String>("func_150702_b", "getValue"));
+ mInitMap.put(new Pair<String, String>("func_150706_a", "generateDispenserContents"));
+ mInitMap.put(new Pair<String, String>("func_150707_a", "setEnchantable"));
+ mInitMap.put(new Pair<String, String>("func_150708_a", "getItemStack"));
+ mInitMap.put(new Pair<String, String>("func_150709_a", "setMaxDamagePercent"));
+ mInitMap.put(new Pair<String, String>("func_150718_a", "closeChannel"));
+ mInitMap.put(new Pair<String, String>("func_150719_a", "setNetHandler"));
+ mInitMap.put(new Pair<String, String>("func_150721_g", "disableAutoRead"));
+ mInitMap.put(new Pair<String, String>("func_150722_a", "provideLocalClient"));
+ mInitMap.put(new Pair<String, String>("func_150723_a", "setConnectionState"));
+ mInitMap.put(new Pair<String, String>("func_150724_d", "isChannelOpen"));
+ mInitMap.put(new Pair<String, String>("func_150725_a", "scheduleOutboundPacket"));
+ mInitMap.put(new Pair<String, String>("func_150726_a", "provideLanClient"));
+ mInitMap.put(new Pair<String, String>("func_150727_a", "enableEncryption"));
+ mInitMap.put(new Pair<String, String>("func_150729_e", "getNetHandler"));
+ mInitMap.put(new Pair<String, String>("func_150730_f", "getExitMessage"));
+ mInitMap.put(new Pair<String, String>("func_150731_c", "isLocalChannel"));
+ mInitMap.put(new Pair<String, String>("func_150732_b", "dispatchPacket"));
+ mInitMap.put(new Pair<String, String>("func_150733_h", "flushOutboundQueue"));
+ mInitMap.put(new Pair<String, String>("func_150752_a", "getFromPacket"));
+ mInitMap.put(new Pair<String, String>("func_150759_c", "getId"));
+ mInitMap.put(new Pair<String, String>("func_150760_a", "getById"));
+ mInitMap.put(new Pair<String, String>("func_150775_a", "attenuate"));
+ mInitMap.put(new Pair<String, String>("func_150785_a", "writeStringToBuffer"));
+ mInitMap.put(new Pair<String, String>("func_150786_a", "writeNBTTagCompoundToBuffer"));
+ mInitMap.put(new Pair<String, String>("func_150787_b", "writeVarIntToBuffer"));
+ mInitMap.put(new Pair<String, String>("func_150788_a", "writeItemStackToBuffer"));
+ mInitMap.put(new Pair<String, String>("func_150789_c", "readStringFromBuffer"));
+ mInitMap.put(new Pair<String, String>("func_150790_a", "getVarIntSize"));
+ mInitMap.put(new Pair<String, String>("func_150791_c", "readItemStackFromBuffer"));
+ mInitMap.put(new Pair<String, String>("func_150792_a", "readVarIntFromBuffer"));
+ mInitMap.put(new Pair<String, String>("func_150793_b", "readNBTTagCompoundFromBuffer"));
+ mInitMap.put(new Pair<String, String>("func_150795_a", "findBiomePosition"));
+ mInitMap.put(new Pair<String, String>("func_150803_c", "recheckGaps"));
+ mInitMap.put(new Pair<String, String>("func_150805_f", "removeTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_150806_e", "getBlockTileEntityInChunk"));
+ mInitMap.put(new Pair<String, String>("func_150807_a", "setBlockIDWithMetadata"));
+ mInitMap.put(new Pair<String, String>("func_150808_b", "getBlockLightOpacity"));
+ mInitMap.put(new Pair<String, String>("func_150810_a", "getBlock"));
+ mInitMap.put(new Pair<String, String>("func_150812_a", "setBlockTileEntityInChunk"));
+ mInitMap.put(new Pair<String, String>("func_150813_a", "addTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_150818_a", "setExtBlockID"));
+ mInitMap.put(new Pair<String, String>("func_150819_a", "getBlockByExtId"));
+ mInitMap.put(new Pair<String, String>("func_150826_b", "translateToFallback"));
+ mInitMap.put(new Pair<String, String>("func_150827_a", "getLastTranslationUpdateTimeInMilliseconds"));
+ mInitMap.put(new Pair<String, String>("func_150835_j", "getBlockTileEntity"));
+ mInitMap.put(new Pair<String, String>("func_150891_b", "getIdFromItem"));
+ mInitMap.put(new Pair<String, String>("func_150892_m", "isPotionIngredient"));
+ mInitMap.put(new Pair<String, String>("func_150893_a", "getStrVsBlock"));
+ mInitMap.put(new Pair<String, String>("func_150894_a", "onBlockDestroyed"));
+ mInitMap.put(new Pair<String, String>("func_150895_a", "getSubItems"));
+ mInitMap.put(new Pair<String, String>("func_150896_i", "getPotionEffect"));
+ mInitMap.put(new Pair<String, String>("func_150897_b", "canItemHarvestBlock"));
+ mInitMap.put(new Pair<String, String>("func_150898_a", "getItemFromBlock"));
+ mInitMap.put(new Pair<String, String>("func_150899_d", "getItemById"));
+ mInitMap.put(new Pair<String, String>("func_150900_l", "registerItems"));
+ mInitMap.put(new Pair<String, String>("func_150905_g", "getHealAmount"));
+ mInitMap.put(new Pair<String, String>("func_150906_h", "getSaturationModifier"));
+ mInitMap.put(new Pair<String, String>("func_150911_c", "createMapDataPacket"));
+ mInitMap.put(new Pair<String, String>("func_150912_a", "loadMapData"));
+ mInitMap.put(new Pair<String, String>("func_150913_i", "getToolMaterial"));
+ mInitMap.put(new Pair<String, String>("func_150924_a", "placeDoorBlock"));
+ mInitMap.put(new Pair<String, String>("func_150926_b", "getRecord"));
+ mInitMap.put(new Pair<String, String>("func_150927_i", "getRecordNameLocal"));
+ mInitMap.put(new Pair<String, String>("func_150930_a", "validBookPageTagContents"));
+ mInitMap.put(new Pair<String, String>("func_150932_j", "getToolMaterialName"));
+ mInitMap.put(new Pair<String, String>("func_150951_e", "getStatName"));
+ mInitMap.put(new Pair<String, String>("func_150967_d", "getUncookedSaturationModifier"));
+ mInitMap.put(new Pair<String, String>("func_150968_a", "registerIcon"));
+ mInitMap.put(new Pair<String, String>("func_150970_e", "getCookedHealAmount"));
+ mInitMap.put(new Pair<String, String>("func_150971_g", "getUncookedIcon"));
+ mInitMap.put(new Pair<String, String>("func_150972_b", "getUnlocalizedNamePart"));
+ mInitMap.put(new Pair<String, String>("func_150973_i", "getCookable"));
+ mInitMap.put(new Pair<String, String>("func_150974_a", "getFishTypeForItemDamage"));
+ mInitMap.put(new Pair<String, String>("func_150975_c", "getUncookedHealAmount"));
+ mInitMap.put(new Pair<String, String>("func_150976_a", "getItemDamage"));
+ mInitMap.put(new Pair<String, String>("func_150977_f", "getCookedSaturationModifier"));
+ mInitMap.put(new Pair<String, String>("func_150978_a", "getFishTypeForItemStack"));
+ mInitMap.put(new Pair<String, String>("func_150979_h", "getCookedIcon"));
+ mInitMap.put(new Pair<String, String>("func_150995_f", "getBaseItemForRepair"));
+ mInitMap.put(new Pair<String, String>("func_150996_a", "setItem"));
+ mInitMap.put(new Pair<String, String>("func_150997_a", "getStrVsBlock"));
+ mInitMap.put(new Pair<String, String>("func_150998_b", "canItemHarvestBlock"));
+ mInitMap.put(new Pair<String, String>("func_150999_a", "onBlockDestroyed"));
+ mInitMap.put(new Pair<String, String>("func_151001_c", "setStackDisplayName"));
+ mInitMap.put(new Pair<String, String>("func_151003_a", "getSerializableElement"));
+ mInitMap.put(new Pair<String, String>("func_151177_a", "getOneShotStat"));
+ mInitMap.put(new Pair<String, String>("func_151187_b", "getJsonSerializableValue"));
+ mInitMap.put(new Pair<String, String>("func_151188_a", "setIntegerValue"));
+ mInitMap.put(new Pair<String, String>("func_151189_a", "getIntegerValue"));
+ mInitMap.put(new Pair<String, String>("func_151190_a", "setJsonSerializableValue"));
+ mInitMap.put(new Pair<String, String>("func_151200_h", "getJsonObjectStringFieldValue"));
+ mInitMap.put(new Pair<String, String>("func_151201_f", "jsonObjectFieldTypeIsPrimitive"));
+ mInitMap.put(new Pair<String, String>("func_151202_d", "jsonObjectFieldTypeIsArray"));
+ mInitMap.put(new Pair<String, String>("func_151203_m", "getJsonObjectIntegerFieldValue"));
+ mInitMap.put(new Pair<String, String>("func_151204_g", "jsonObjectHasNamedField"));
+ mInitMap.put(new Pair<String, String>("func_151205_a", "jsonObjectFieldTypeIsString"));
+ mInitMap.put(new Pair<String, String>("func_151206_a", "getJsonElementStringValue"));
+ mInitMap.put(new Pair<String, String>("func_151207_m", "getJsonElementAsJsonArray"));
+ mInitMap.put(new Pair<String, String>("func_151208_a", "getJsonObjectIntegerFieldValueOrDefault"));
+ mInitMap.put(new Pair<String, String>("func_151209_a", "getJsonObjectBooleanFieldValueOrDefault"));
+ mInitMap.put(new Pair<String, String>("func_151210_l", "getElementAsJsonObject"));
+ mInitMap.put(new Pair<String, String>("func_151211_a", "jsonElementTypeIsString"));
+ mInitMap.put(new Pair<String, String>("func_151212_i", "getJsonObjectBooleanFieldValue"));
+ mInitMap.put(new Pair<String, String>("func_151213_a", "getJsonObjectJsonArrayFieldOrDefault"));
+ mInitMap.put(new Pair<String, String>("func_151214_t", "getJsonObjectJsonArrayField"));
+ mInitMap.put(new Pair<String, String>("func_151215_f", "getJsonElementIntegerValue"));
+ mInitMap.put(new Pair<String, String>("func_151216_b", "getJsonElementBooleanValue"));
+ mInitMap.put(new Pair<String, String>("func_151217_k", "getJsonObjectFloatFieldValue"));
+ mInitMap.put(new Pair<String, String>("func_151218_a", "getJsonObjectFieldOrDefault"));
+ mInitMap.put(new Pair<String, String>("func_151219_a", "getJsonObjectStringFieldValueOrDefault"));
+ mInitMap.put(new Pair<String, String>("func_151220_d", "getJsonElementFloatValue"));
+ mInitMap.put(new Pair<String, String>("func_151221_a", "getJsonObjectFloatFieldValueOrDefault"));
+ mInitMap.put(new Pair<String, String>("func_151222_d", "getJsonElementTypeDescription"));
+ mInitMap.put(new Pair<String, String>("func_151223_a", "downloadResourcePack"));
+ mInitMap.put(new Pair<String, String>("func_151225_a", "post"));
+ mInitMap.put(new Pair<String, String>("func_151226_a", "postMap"));
+ mInitMap.put(new Pair<String, String>("func_151235_d", "isPowerOfTwo"));
+ mInitMap.put(new Pair<String, String>("func_151236_b", "roundUpToPowerOfTwo"));
+ mInitMap.put(new Pair<String, String>("func_151237_a", "clamp_double"));
+ mInitMap.put(new Pair<String, String>("func_151238_b", "denormalizeClamp"));
+ mInitMap.put(new Pair<String, String>("func_151239_c", "calculateLogBaseTwo"));
+ mInitMap.put(new Pair<String, String>("func_151240_a", "randomFloatClamp"));
+ mInitMap.put(new Pair<String, String>("func_151241_e", "calculateLogBaseTwoDeBruijn"));
+ mInitMap.put(new Pair<String, String>("func_151243_f", "getIconItemDamage"));
+ mInitMap.put(new Pair<String, String>("func_151244_d", "getIconItemStack"));
+ mInitMap.put(new Pair<String, String>("func_151246_b", "isNullOrEmpty"));
+ mInitMap.put(new Pair<String, String>("func_151247_a", "sendToAllTrackingEntity"));
+ mInitMap.put(new Pair<String, String>("func_151250_a", "markBlockForUpdate"));
+ mInitMap.put(new Pair<String, String>("func_151251_a", "sendToAllPlayersWatchingChunk"));
+ mInitMap.put(new Pair<String, String>("func_151252_a", "sendTileToAllPlayersWatchingChunk"));
+ mInitMap.put(new Pair<String, String>("func_151253_a", "flagChunkForUpdate"));
+ mInitMap.put(new Pair<String, String>("func_151255_a", "getStringBuffer"));
+ mInitMap.put(new Pair<String, String>("func_151256_a", "writeAndFlush"));
+ mInitMap.put(new Pair<String, String>("func_151265_a", "addLanEndpoint"));
+ mInitMap.put(new Pair<String, String>("func_151267_d", "getServer"));
+ mInitMap.put(new Pair<String, String>("func_151268_b", "terminateEndpoints"));
+ mInitMap.put(new Pair<String, String>("func_151269_c", "networkTick"));
+ mInitMap.put(new Pair<String, String>("func_151270_a", "addLocalEndpoint"));
+ mInitMap.put(new Pair<String, String>("func_151303_a", "getName"));
+ mInitMap.put(new Pair<String, String>("func_151304_b", "getProtocol"));
+ mInitMap.put(new Pair<String, String>("func_151315_a", "setServerDescription"));
+ mInitMap.put(new Pair<String, String>("func_151316_d", "getFavicon"));
+ mInitMap.put(new Pair<String, String>("func_151317_a", "getServerDescription"));
+ mInitMap.put(new Pair<String, String>("func_151318_b", "getPlayerCountData"));
+ mInitMap.put(new Pair<String, String>("func_151319_a", "setPlayerCountData"));
+ mInitMap.put(new Pair<String, String>("func_151320_a", "setFavicon"));
+ mInitMap.put(new Pair<String, String>("func_151321_a", "setProtocolVersionInfo"));
+ mInitMap.put(new Pair<String, String>("func_151322_c", "getProtocolVersionInfo"));
+ mInitMap.put(new Pair<String, String>("func_151330_a", "setPlayers"));
+ mInitMap.put(new Pair<String, String>("func_151331_c", "getPlayers"));
+ mInitMap.put(new Pair<String, String>("func_151332_a", "getMaxPlayers"));
+ mInitMap.put(new Pair<String, String>("func_151333_b", "getOnlinePlayerCount"));
+ mInitMap.put(new Pair<String, String>("func_151337_f", "getBlock"));
+ mInitMap.put(new Pair<String, String>("func_151338_e", "getEventParameter"));
+ mInitMap.put(new Pair<String, String>("func_151339_d", "getEventID"));
+ mInitMap.put(new Pair<String, String>("func_151353_a", "registerDispenserBehaviors"));
+ mInitMap.put(new Pair<String, String>("func_151354_b", "register"));
+ mInitMap.put(new Pair<String, String>("func_151357_h", "showWorldInfoNotice"));
+ mInitMap.put(new Pair<String, String>("func_151358_j", "setNotificationData"));
+ mInitMap.put(new Pair<String, String>("func_151393_a", "addSmeltingRecipeForBlock"));
+ mInitMap.put(new Pair<String, String>("func_151394_a", "addSmeltingRecipe"));
+ mInitMap.put(new Pair<String, String>("func_151395_a", "getSmeltingResult"));
+ mInitMap.put(new Pair<String, String>("func_151396_a", "addSmelting"));
+ mInitMap.put(new Pair<String, String>("func_151398_b", "getSmeltingExperience"));
+ mInitMap.put(new Pair<String, String>("func_151426_a", "getEnumChatVisibility"));
+ mInitMap.put(new Pair<String, String>("func_151428_a", "getChatVisibility"));
+ mInitMap.put(new Pair<String, String>("func_151429_b", "getResourceKey"));
+ mInitMap.put(new Pair<String, String>("func_151438_a", "getSoundLevel"));
+ mInitMap.put(new Pair<String, String>("func_151439_a", "setSoundLevel"));
+ mInitMap.put(new Pair<String, String>("func_151440_a", "setOptionKeyBinding"));
+ mInitMap.put(new Pair<String, String>("func_151460_a", "getBlockAtEntityViewpoint"));
+ mInitMap.put(new Pair<String, String>("func_151461_a", "getChatComponent"));
+ mInitMap.put(new Pair<String, String>("func_151462_b", "setKeyCode"));
+ mInitMap.put(new Pair<String, String>("func_151463_i", "getKeyCode"));
+ mInitMap.put(new Pair<String, String>("func_151464_g", "getKeyDescription"));
+ mInitMap.put(new Pair<String, String>("func_151466_e", "getKeyCategory"));
+ mInitMap.put(new Pair<String, String>("func_151467_c", "getKeybinds"));
+ mInitMap.put(new Pair<String, String>("func_151468_f", "isPressed"));
+ mInitMap.put(new Pair<String, String>("func_151469_h", "getKeyCodeDefault"));
+ mInitMap.put(new Pair<String, String>("func_151470_d", "getIsKeyPressed"));
+ mInitMap.put(new Pair<String, String>("func_151498_a", "isStairOrSlab"));
+ mInitMap.put(new Pair<String, String>("func_151499_f", "getEatingGrassTimer"));
+ mInitMap.put(new Pair<String, String>("func_151503_a", "getWoodenDoorBlock"));
+ mInitMap.put(new Pair<String, String>("func_151507_a", "writeWatchedListToPacketBuffer"));
+ mInitMap.put(new Pair<String, String>("func_151508_b", "readWatchedListFromPacketBuffer"));
+ mInitMap.put(new Pair<String, String>("func_151510_a", "writeWatchableObjectToPacketBuffer"));
+ mInitMap.put(new Pair<String, String>("func_151517_h", "isDamageAbsolute"));
+ mInitMap.put(new Pair<String, String>("func_151518_m", "setDamageIsAbsolute"));
+ mInitMap.put(new Pair<String, String>("func_151519_b", "getDeathMessage"));
+ mInitMap.put(new Pair<String, String>("func_151523_a", "getDifficultyEnum"));
+ mInitMap.put(new Pair<String, String>("func_151525_a", "getDifficultyId"));
+ mInitMap.put(new Pair<String, String>("func_151526_b", "getDifficultyResourceKey"));
+ mInitMap.put(new Pair<String, String>("func_151539_a", "generate"));
+ mInitMap.put(new Pair<String, String>("func_151545_a", "getNearestInstance"));
+ mInitMap.put(new Pair<String, String>("func_151548_a", "getBlockAtCurrentPosition"));
+ mInitMap.put(new Pair<String, String>("func_151549_a", "fillWithBlocks"));
+ mInitMap.put(new Pair<String, String>("func_151550_a", "placeBlockAtCurrentPosition"));
+ mInitMap.put(new Pair<String, String>("func_151551_a", "randomlyFillWithBlocks"));
+ mInitMap.put(new Pair<String, String>("func_151555_a", "getMetadataWithOffset"));
+ mInitMap.put(new Pair<String, String>("func_151556_a", "fillWithMetadataBlocks"));
+ mInitMap.put(new Pair<String, String>("func_151565_r", "getMaterialMapColor"));
+ mInitMap.put(new Pair<String, String>("func_151616_a", "biomesEqualOrMesaPlateau"));
+ mInitMap.put(new Pair<String, String>("func_151617_b", "selectModeOrRandom"));
+ mInitMap.put(new Pair<String, String>("func_151618_b", "isBiomeOceanic"));
+ mInitMap.put(new Pair<String, String>("func_151619_a", "selectRandom"));
+ mInitMap.put(new Pair<String, String>("func_151624_d", "getIntsHeatIce"));
+ mInitMap.put(new Pair<String, String>("func_151625_e", "getIntsSpecial"));
+ mInitMap.put(new Pair<String, String>("func_151626_c", "getIntsCoolWarm"));
+ mInitMap.put(new Pair<String, String>("func_151634_b", "canBiomesBeNeighbors"));
+ mInitMap.put(new Pair<String, String>("func_151635_b", "replaceBiomeEdge"));
+ mInitMap.put(new Pair<String, String>("func_151636_a", "replaceBiomeEdgeIfNecessary"));
+ mInitMap.put(new Pair<String, String>("func_151644_a", "getMapColorForBlockColored"));
+ mInitMap.put(new Pair<String, String>("func_151685_b", "getBaseItemForRepair"));
+ mInitMap.put(new Pair<String, String>("func_151686_a", "addStats"));
+ mInitMap.put(new Pair<String, String>("func_152121_a", "onSkinAvailable"));
+ mInitMap.put(new Pair<String, String>("func_152122_n", "hasCape"));
+ mInitMap.put(new Pair<String, String>("func_152123_o", "hasSkin"));
+ mInitMap.put(new Pair<String, String>("func_152125_a", "drawScaledCustomSizeModalRect"));
+ mInitMap.put(new Pair<String, String>("func_152126_a", "renderStreamIndicator"));
+ mInitMap.put(new Pair<String, String>("func_152340_a", "readImageToBuffer"));
+ mInitMap.put(new Pair<String, String>("func_152341_N", "getTwitchDetails"));
+ mInitMap.put(new Pair<String, String>("func_152342_ad", "getSkinManager"));
+ mInitMap.put(new Pair<String, String>("func_152343_a", "addScheduledTask"));
+ mInitMap.put(new Pair<String, String>("func_152344_a", "addScheduledTask"));
+ mInitMap.put(new Pair<String, String>("func_152345_ab", "isCallingFromMinecraftThread"));
+ mInitMap.put(new Pair<String, String>("func_152346_Z", "getTwitchStream"));
+ mInitMap.put(new Pair<String, String>("func_152347_ac", "getSessionService"));
+ mInitMap.put(new Pair<String, String>("func_152348_aa", "dispatchKeypresses"));
+ mInitMap.put(new Pair<String, String>("func_152349_b", "isUnicode"));
+ mInitMap.put(new Pair<String, String>("func_152357_F", "getGameProfiles"));
+ mInitMap.put(new Pair<String, String>("func_152358_ax", "getPlayerProfileCache"));
+ mInitMap.put(new Pair<String, String>("func_152359_aw", "getGameProfileRepository"));
+ mInitMap.put(new Pair<String, String>("func_152361_a", "setConfigManager"));
+ mInitMap.put(new Pair<String, String>("func_152368_aE", "convertFiles"));
+ mInitMap.put(new Pair<String, String>("func_152369_aG", "sleepFiveSeconds"));
+ mInitMap.put(new Pair<String, String>("func_152372_a", "notifyOperators"));
+ mInitMap.put(new Pair<String, String>("func_152373_a", "notifyOperators"));
+ mInitMap.put(new Pair<String, String>("func_152374_a", "notifyOperators"));
+ mInitMap.put(new Pair<String, String>("func_152378_a", "getPlayerEntityByUUID"));
+ mInitMap.put(new Pair<String, String>("func_152379_p", "getRenderDistanceChunks"));
+ mInitMap.put(new Pair<String, String>("func_152421_a", "setSessionType"));
+ mInitMap.put(new Pair<String, String>("func_152428_f", "getSessionType"));
+ mInitMap.put(new Pair<String, String>("func_152436_a", "render"));
+ mInitMap.put(new Pair<String, String>("func_152437_a", "render"));
+ mInitMap.put(new Pair<String, String>("func_152446_a", "read"));
+ mInitMap.put(new Pair<String, String>("func_152447_a", "readType"));
+ mInitMap.put(new Pair<String, String>("func_152448_b", "readKey"));
+ mInitMap.put(new Pair<String, String>("func_152449_a", "readNBT"));
+ mInitMap.put(new Pair<String, String>("func_152450_a", "addSpaceRead"));
+ mInitMap.put(new Pair<String, String>("func_152457_a", "decompress"));
+ mInitMap.put(new Pair<String, String>("func_152458_a", "readFromFile"));
+ mInitMap.put(new Pair<String, String>("func_152459_a", "readGameProfileFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_152460_a", "writeGameProfileToNBT"));
+ mInitMap.put(new Pair<String, String>("func_152493_a", "getTotalBytes"));
+ mInitMap.put(new Pair<String, String>("func_152495_b", "getCount"));
+ mInitMap.put(new Pair<String, String>("func_152506_a", "getOfflineProfile"));
+ mInitMap.put(new Pair<String, String>("func_152583_a", "copyFrom"));
+ mInitMap.put(new Pair<String, String>("func_152584_a", "setResourceMode"));
+ mInitMap.put(new Pair<String, String>("func_152585_d", "isLanServer"));
+ mInitMap.put(new Pair<String, String>("func_152586_b", "getResourceMode"));
+ mInitMap.put(new Pair<String, String>("func_152589_a", "getMotd"));
+ mInitMap.put(new Pair<String, String>("func_152596_g", "canSendCommands"));
+ mInitMap.put(new Pair<String, String>("func_152597_c", "removePlayerFromWhitelist"));
+ mInitMap.put(new Pair<String, String>("func_152598_l", "getWhitelistedPlayerNames"));
+ mInitMap.put(new Pair<String, String>("func_152599_k", "getWhitelistedPlayers"));
+ mInitMap.put(new Pair<String, String>("func_152600_g", "getAllProfiles"));
+ mInitMap.put(new Pair<String, String>("func_152601_d", "addWhitelistedPlayer"));
+ mInitMap.put(new Pair<String, String>("func_152602_a", "getPlayerStatsFile"));
+ mInitMap.put(new Pair<String, String>("func_152603_m", "getOppedPlayers"));
+ mInitMap.put(new Pair<String, String>("func_152605_a", "addOp"));
+ mInitMap.put(new Pair<String, String>("func_152606_n", "getOppedPlayerNames"));
+ mInitMap.put(new Pair<String, String>("func_152607_e", "canJoin"));
+ mInitMap.put(new Pair<String, String>("func_152608_h", "getBannedPlayers"));
+ mInitMap.put(new Pair<String, String>("func_152609_b", "getPlayerNamesString"));
+ mInitMap.put(new Pair<String, String>("func_152610_b", "removeOp"));
+ mInitMap.put(new Pair<String, String>("func_152611_a", "setViewDistance"));
+ mInitMap.put(new Pair<String, String>("func_152612_a", "getPlayerByUsername"));
+ mInitMap.put(new Pair<String, String>("func_152617_w", "saveUserBanList"));
+ mInitMap.put(new Pair<String, String>("func_152618_v", "saveIpBanList"));
+ mInitMap.put(new Pair<String, String>("func_152619_x", "loadIpBanList"));
+ mInitMap.put(new Pair<String, String>("func_152620_y", "loadUserBansList"));
+ mInitMap.put(new Pair<String, String>("func_152640_f", "getValue"));
+ mInitMap.put(new Pair<String, String>("func_152641_a", "onSerialization"));
+ mInitMap.put(new Pair<String, String>("func_152655_a", "getGameProfileForUsername"));
+ mInitMap.put(new Pair<String, String>("func_152678_f", "writeChanges"));
+ mInitMap.put(new Pair<String, String>("func_152679_g", "readSavedFile"));
+ mInitMap.put(new Pair<String, String>("func_152680_h", "removeExpired"));
+ mInitMap.put(new Pair<String, String>("func_152681_a", "getObjectKey"));
+ mInitMap.put(new Pair<String, String>("func_152682_a", "createEntry"));
+ mInitMap.put(new Pair<String, String>("func_152683_b", "getEntry"));
+ mInitMap.put(new Pair<String, String>("func_152684_c", "removeEntry"));
+ mInitMap.put(new Pair<String, String>("func_152685_a", "getKeys"));
+ mInitMap.put(new Pair<String, String>("func_152686_a", "setLanServer"));
+ mInitMap.put(new Pair<String, String>("func_152687_a", "addEntry"));
+ mInitMap.put(new Pair<String, String>("func_152688_e", "getValues"));
+ mInitMap.put(new Pair<String, String>("func_152689_b", "isLanServer"));
+ mInitMap.put(new Pair<String, String>("func_152690_d", "hasEntries"));
+ mInitMap.put(new Pair<String, String>("func_152691_c", "getSaveFile"));
+ mInitMap.put(new Pair<String, String>("func_152692_d", "hasEntry"));
+ mInitMap.put(new Pair<String, String>("func_152700_a", "getGameProfileFromName"));
+ mInitMap.put(new Pair<String, String>("func_152701_b", "getProfileId"));
+ mInitMap.put(new Pair<String, String>("func_152702_a", "isBanned"));
+ mInitMap.put(new Pair<String, String>("func_152703_a", "isUsernameBanned"));
+ mInitMap.put(new Pair<String, String>("func_152707_c", "addressToString"));
+ mInitMap.put(new Pair<String, String>("func_152708_a", "isBanned"));
+ mInitMap.put(new Pair<String, String>("func_152709_b", "getBanEntry"));
+ mInitMap.put(new Pair<String, String>("func_152710_d", "convertWhitelist"));
+ mInitMap.put(new Pair<String, String>("func_152711_b", "mkdir"));
+ mInitMap.put(new Pair<String, String>("func_152712_b", "hasUnconvertableFiles"));
+ mInitMap.put(new Pair<String, String>("func_152713_b", "parseDate"));
+ mInitMap.put(new Pair<String, String>("func_152714_a", "tryConvert"));
+ mInitMap.put(new Pair<String, String>("func_152715_c", "hasUnconvertablePlayerFiles"));
+ mInitMap.put(new Pair<String, String>("func_152717_a", "lookupNames"));
+ mInitMap.put(new Pair<String, String>("func_152718_c", "convertOplist"));
+ mInitMap.put(new Pair<String, String>("func_152721_a", "readFile"));
+ mInitMap.put(new Pair<String, String>("func_152722_b", "convertIpBanlist"));
+ mInitMap.put(new Pair<String, String>("func_152723_a", "convertSaveFiles"));
+ mInitMap.put(new Pair<String, String>("func_152724_a", "convertUserBanlist"));
+ mInitMap.put(new Pair<String, String>("func_152725_d", "getPlayersDirectory"));
+ mInitMap.put(new Pair<String, String>("func_152727_c", "backupConverted"));
+ mInitMap.put(new Pair<String, String>("func_152750_a", "deserializeEntry"));
+ mInitMap.put(new Pair<String, String>("func_152751_a", "serializeEntry"));
+ mInitMap.put(new Pair<String, String>("func_152754_s", "getJsonObject"));
+ mInitMap.put(new Pair<String, String>("func_152755_a", "get"));
+ mInitMap.put(new Pair<String, String>("func_152764_a", "parsePass"));
+ mInitMap.put(new Pair<String, String>("func_152765_a", "parseGroup"));
+ mInitMap.put(new Pair<String, String>("func_152767_b", "addStatToSnooper"));
+ mInitMap.put(new Pair<String, String>("func_152768_a", "addClientStat"));
+ mInitMap.put(new Pair<String, String>("func_152788_a", "loadSkinFromCache"));
+ mInitMap.put(new Pair<String, String>("func_152789_a", "loadSkin"));
+ mInitMap.put(new Pair<String, String>("func_152792_a", "loadSkin"));
+ mInitMap.put(new Pair<String, String>("func_152825_o", "isIngestTesting"));
+ mInitMap.put(new Pair<String, String>("func_152839_p", "isBroadcastPaused"));
+ mInitMap.put(new Pair<String, String>("func_152850_m", "isBroadcasting"));
+ mInitMap.put(new Pair<String, String>("func_152856_w", "isReady"));
+ mInitMap.put(new Pair<String, String>("func_152919_o", "isPaused"));
+ mInitMap.put(new Pair<String, String>("func_152923_i", "shutdownStream"));
+ mInitMap.put(new Pair<String, String>("func_153157_c", "glGetShaderi"));
+ mInitMap.put(new Pair<String, String>("func_153158_d", "glGetShaderInfoLog"));
+ mInitMap.put(new Pair<String, String>("func_153159_d", "glUniform4"));
+ mInitMap.put(new Pair<String, String>("func_153160_c", "glUniformMatrix4"));
+ mInitMap.put(new Pair<String, String>("func_153161_d", "glUseProgram"));
+ mInitMap.put(new Pair<String, String>("func_153162_d", "glUniform4"));
+ mInitMap.put(new Pair<String, String>("func_153163_f", "glUniform1i"));
+ mInitMap.put(new Pair<String, String>("func_153164_b", "glGetAttribLocation"));
+ mInitMap.put(new Pair<String, String>("func_153166_e", "glGetProgramInfoLog"));
+ mInitMap.put(new Pair<String, String>("func_153168_a", "glUniform1"));
+ mInitMap.put(new Pair<String, String>("func_153169_a", "glShaderSource"));
+ mInitMap.put(new Pair<String, String>("func_153170_c", "glCompileShader"));
+ mInitMap.put(new Pair<String, String>("func_153173_a", "glUniformMatrix2"));
+ mInitMap.put(new Pair<String, String>("func_153175_a", "glGetProgrami"));
+ mInitMap.put(new Pair<String, String>("func_153177_b", "glUniform2"));
+ mInitMap.put(new Pair<String, String>("func_153178_b", "glAttachShader"));
+ mInitMap.put(new Pair<String, String>("func_153179_f", "glLinkProgram"));
+ mInitMap.put(new Pair<String, String>("func_153180_a", "glDeleteShader"));
+ mInitMap.put(new Pair<String, String>("func_153181_a", "glUniform1"));
+ mInitMap.put(new Pair<String, String>("func_153182_b", "glUniform2"));
+ }
- }
+ private static void init3() {
+ mInitMap.put(new Pair<String, String>("func_153183_d", "glCreateProgram"));
+ mInitMap.put(new Pair<String, String>("func_153187_e", "glDeleteProgram"));
+ mInitMap.put(new Pair<String, String>("func_153189_b", "glUniformMatrix3"));
+ mInitMap.put(new Pair<String, String>("func_153191_c", "glUniform3"));
+ mInitMap.put(new Pair<String, String>("func_153192_c", "glUniform3"));
+ mInitMap.put(new Pair<String, String>("func_153194_a", "glGetUniformLocation"));
+ mInitMap.put(new Pair<String, String>("func_153195_b", "glCreateShader"));
+ mInitMap.put(new Pair<String, String>("func_154310_c", "getButtonHeight"));
+ mInitMap.put(new Pair<String, String>("func_154311_a", "setText"));
+ mInitMap.put(new Pair<String, String>("func_154313_b", "setEnabled"));
+ mInitMap.put(new Pair<String, String>("func_154314_d", "getId"));
+ mInitMap.put(new Pair<String, String>("func_154315_e", "getEnabled"));
+ mInitMap.put(new Pair<String, String>("func_154316_f", "getPositionY"));
+ mInitMap.put(new Pair<String, String>("func_154317_g", "getRealmsButton"));
+ mInitMap.put(new Pair<String, String>("func_154331_x", "getLastActiveTime"));
+ mInitMap.put(new Pair<String, String>("func_154346_a", "hasAcceptedEULA"));
+ mInitMap.put(new Pair<String, String>("func_154347_a", "loadEULAFile"));
+ mInitMap.put(new Pair<String, String>("func_154348_b", "createEULAFile"));
+ mInitMap.put(new Pair<String, String>("func_155759_m", "setServerResourcePack"));
+ mInitMap.put(new Pair<String, String>("func_70000_a", "addServerStatsToSnooper"));
+ mInitMap.put(new Pair<String, String>("func_70001_b", "addServerTypeToSnooper"));
+ mInitMap.put(new Pair<String, String>("func_70002_Q", "isSnooperEnabled"));
+ mInitMap.put(new Pair<String, String>("func_70003_b", "canCommandSenderUseCommand"));
+ mInitMap.put(new Pair<String, String>("func_70005_c_", "getCommandSenderName"));
+ mInitMap.put(new Pair<String, String>("func_70007_b", "resetLog"));
+ mInitMap.put(new Pair<String, String>("func_70008_c", "getLogContents"));
+ mInitMap.put(new Pair<String, String>("func_70011_f", "getDistance"));
+ mInitMap.put(new Pair<String, String>("func_70012_b", "setLocationAndAngles"));
+ mInitMap.put(new Pair<String, String>("func_70013_c", "getBrightness"));
+ mInitMap.put(new Pair<String, String>("func_70014_b", "writeEntityToNBT"));
+ mInitMap.put(new Pair<String, String>("func_70015_d", "setFire"));
+ mInitMap.put(new Pair<String, String>("func_70016_h", "setVelocity"));
+ mInitMap.put(new Pair<String, String>("func_70018_K", "setBeenAttacked"));
+ mInitMap.put(new Pair<String, String>("func_70019_c", "setEating"));
+ mInitMap.put(new Pair<String, String>("func_70020_e", "readFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_70021_al", "getParts"));
+ mInitMap.put(new Pair<String, String>("func_70022_Q", "getEntityString"));
+ mInitMap.put(new Pair<String, String>("func_70024_g", "addVelocity"));
+ mInitMap.put(new Pair<String, String>("func_70026_G", "isWet"));
+ mInitMap.put(new Pair<String, String>("func_70027_ad", "isBurning"));
+ mInitMap.put(new Pair<String, String>("func_70028_i", "isEntityEqual"));
+ mInitMap.put(new Pair<String, String>("func_70029_a", "setWorld"));
+ mInitMap.put(new Pair<String, String>("func_70030_z", "onEntityUpdate"));
+ mInitMap.put(new Pair<String, String>("func_70031_b", "setSprinting"));
+ mInitMap.put(new Pair<String, String>("func_70032_d", "getDistanceToEntity"));
+ mInitMap.put(new Pair<String, String>("func_70033_W", "getYOffset"));
+ mInitMap.put(new Pair<String, String>("func_70034_d", "setRotationYawHead"));
+ mInitMap.put(new Pair<String, String>("func_70035_c", "getInventory"));
+ mInitMap.put(new Pair<String, String>("func_70037_a", "readEntityFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_70038_c", "isOffsetPositionInLiquid"));
+ mInitMap.put(new Pair<String, String>("func_70039_c", "writeToNBTOptional"));
+ mInitMap.put(new Pair<String, String>("func_70040_Z", "getLookVec"));
+ mInitMap.put(new Pair<String, String>("func_70041_e_", "canTriggerWalking"));
+ mInitMap.put(new Pair<String, String>("func_70042_X", "getMountedYOffset"));
+ mInitMap.put(new Pair<String, String>("func_70043_V", "updateRiderPosition"));
+ mInitMap.put(new Pair<String, String>("func_70044_A", "setOnFireFromLava"));
+ mInitMap.put(new Pair<String, String>("func_70045_F", "isImmuneToFire"));
+ mInitMap.put(new Pair<String, String>("func_70046_E", "getBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_70047_e", "getEyeHeight"));
+ mInitMap.put(new Pair<String, String>("func_70049_a", "mInitMap.put(newFloatNBTList"));
+ mInitMap.put(new Pair<String, String>("func_70050_g", "setAir"));
+ mInitMap.put(new Pair<String, String>("func_70051_ag", "isSprinting"));
+ mInitMap.put(new Pair<String, String>("func_70052_a", "setFlag"));
+ mInitMap.put(new Pair<String, String>("func_70053_R", "getShadowSize"));
+ mInitMap.put(new Pair<String, String>("func_70055_a", "isInsideOfMaterial"));
+ mInitMap.put(new Pair<String, String>("func_70056_a", "setPositionAndRotation2"));
+ mInitMap.put(new Pair<String, String>("func_70057_ab", "performHurtAnimation"));
+ mInitMap.put(new Pair<String, String>("func_70058_J", "handleLavaMovement"));
+ mInitMap.put(new Pair<String, String>("func_70060_a", "moveFlying"));
+ mInitMap.put(new Pair<String, String>("func_70062_b", "setCurrentItemOrArmor"));
+ mInitMap.put(new Pair<String, String>("func_70063_aa", "setInPortal"));
+ mInitMap.put(new Pair<String, String>("func_70064_a", "updateFallState"));
+ mInitMap.put(new Pair<String, String>("func_70065_x", "preparePlayerToSpawn"));
+ mInitMap.put(new Pair<String, String>("func_70066_B", "extinguish"));
+ mInitMap.put(new Pair<String, String>("func_70067_L", "canBeCollidedWith"));
+ mInitMap.put(new Pair<String, String>("func_70068_e", "getDistanceSqToEntity"));
+ mInitMap.put(new Pair<String, String>("func_70069_a", "fall"));
+ mInitMap.put(new Pair<String, String>("func_70070_b", "getBrightnessForRender"));
+ mInitMap.put(new Pair<String, String>("func_70071_h_", "onUpdate"));
+ mInitMap.put(new Pair<String, String>("func_70072_I", "handleWaterMovement"));
+ mInitMap.put(new Pair<String, String>("func_70074_a", "onKillEntity"));
+ mInitMap.put(new Pair<String, String>("func_70075_an", "canAttackWithItem"));
+ mInitMap.put(new Pair<String, String>("func_70076_C", "kill"));
+ mInitMap.put(new Pair<String, String>("func_70077_a", "onStruckByLightning"));
+ mInitMap.put(new Pair<String, String>("func_70078_a", "mountEntity"));
+ mInitMap.put(new Pair<String, String>("func_70079_am", "getRotationYawHead"));
+ mInitMap.put(new Pair<String, String>("func_70080_a", "setPositionAndRotation"));
+ mInitMap.put(new Pair<String, String>("func_70081_e", "dealFireDamage"));
+ mInitMap.put(new Pair<String, String>("func_70082_c", "setAngles"));
+ mInitMap.put(new Pair<String, String>("func_70083_f", "getFlag"));
+ mInitMap.put(new Pair<String, String>("func_70084_c", "addToPlayerScore"));
+ mInitMap.put(new Pair<String, String>("func_70085_c", "interact"));
+ mInitMap.put(new Pair<String, String>("func_70086_ai", "getAir"));
+ mInitMap.put(new Pair<String, String>("func_70087_a", "mInitMap.put(newDoubleNBTList"));
+ mInitMap.put(new Pair<String, String>("func_70088_a", "entityInit"));
+ mInitMap.put(new Pair<String, String>("func_70089_S", "isEntityAlive"));
+ mInitMap.put(new Pair<String, String>("func_70090_H", "isInWater"));
+ mInitMap.put(new Pair<String, String>("func_70091_d", "moveEntity"));
+ mInitMap.put(new Pair<String, String>("func_70092_e", "getDistanceSq"));
+ mInitMap.put(new Pair<String, String>("func_70093_af", "isSneaking"));
+ mInitMap.put(new Pair<String, String>("func_70094_T", "isEntityInsideOpaqueBlock"));
+ mInitMap.put(new Pair<String, String>("func_70095_a", "setSneaking"));
+ mInitMap.put(new Pair<String, String>("func_70096_w", "getDataWatcher"));
+ mInitMap.put(new Pair<String, String>("func_70097_a", "attackEntityFrom"));
+ mInitMap.put(new Pair<String, String>("func_70098_U", "updateRidden"));
+ mInitMap.put(new Pair<String, String>("func_70099_a", "entityDropItem"));
+ mInitMap.put(new Pair<String, String>("func_70100_b_", "onCollideWithPlayer"));
+ mInitMap.put(new Pair<String, String>("func_70101_b", "setRotation"));
+ mInitMap.put(new Pair<String, String>("func_70103_a", "handleHealthUpdate"));
+ mInitMap.put(new Pair<String, String>("func_70104_M", "canBePushed"));
+ mInitMap.put(new Pair<String, String>("func_70105_a", "setSize"));
+ mInitMap.put(new Pair<String, String>("func_70106_y", "setDead"));
+ mInitMap.put(new Pair<String, String>("func_70107_b", "setPosition"));
+ mInitMap.put(new Pair<String, String>("func_70108_f", "applyEntityCollision"));
+ mInitMap.put(new Pair<String, String>("func_70109_d", "writeToNBT"));
+ mInitMap.put(new Pair<String, String>("func_70110_aj", "setInWeb"));
+ mInitMap.put(new Pair<String, String>("func_70111_Y", "getCollisionBorderSize"));
+ mInitMap.put(new Pair<String, String>("func_70112_a", "isInRangeToRenderDist"));
+ mInitMap.put(new Pair<String, String>("func_70113_ah", "isEating"));
+ mInitMap.put(new Pair<String, String>("func_70114_g", "getCollisionBox"));
+ mInitMap.put(new Pair<String, String>("func_70115_ae", "isRiding"));
+ mInitMap.put(new Pair<String, String>("func_70184_a", "onImpact"));
+ mInitMap.put(new Pair<String, String>("func_70185_h", "getGravityVelocity"));
+ mInitMap.put(new Pair<String, String>("func_70186_c", "setThrowableHeading"));
+ mInitMap.put(new Pair<String, String>("func_70196_i", "getPotionDamage"));
+ mInitMap.put(new Pair<String, String>("func_70220_a", "moveTowards"));
+ mInitMap.put(new Pair<String, String>("func_70227_a", "onImpact"));
+ mInitMap.put(new Pair<String, String>("func_70239_b", "setDamage"));
+ mInitMap.put(new Pair<String, String>("func_70240_a", "setKnockbackStrength"));
+ mInitMap.put(new Pair<String, String>("func_70241_g", "getIsCritical"));
+ mInitMap.put(new Pair<String, String>("func_70242_d", "getDamage"));
+ mInitMap.put(new Pair<String, String>("func_70243_d", "setIsCritical"));
+ mInitMap.put(new Pair<String, String>("func_70265_b", "setTimeSinceHit"));
+ mInitMap.put(new Pair<String, String>("func_70266_a", "setDamageTaken"));
+ mInitMap.put(new Pair<String, String>("func_70267_i", "getForwardDirection"));
+ mInitMap.put(new Pair<String, String>("func_70268_h", "getTimeSinceHit"));
+ mInitMap.put(new Pair<String, String>("func_70269_c", "setForwardDirection"));
+ mInitMap.put(new Pair<String, String>("func_70270_d", "setIsBoatEmpty"));
+ mInitMap.put(new Pair<String, String>("func_70271_g", "getDamageTaken"));
+ mInitMap.put(new Pair<String, String>("func_70288_d", "setAgeToCreativeDespawnTime"));
+ mInitMap.put(new Pair<String, String>("func_70289_a", "combineItems"));
+ mInitMap.put(new Pair<String, String>("func_70295_k_", "openChest"));
+ mInitMap.put(new Pair<String, String>("func_70296_d", "markDirty"));
+ mInitMap.put(new Pair<String, String>("func_70297_j_", "getInventoryStackLimit"));
+ mInitMap.put(new Pair<String, String>("func_70298_a", "decrStackSize"));
+ mInitMap.put(new Pair<String, String>("func_70299_a", "setInventorySlotContents"));
+ mInitMap.put(new Pair<String, String>("func_70300_a", "isUseableByPlayer"));
+ mInitMap.put(new Pair<String, String>("func_70301_a", "getStackInSlot"));
+ mInitMap.put(new Pair<String, String>("func_70302_i_", "getSizeInventory"));
+ mInitMap.put(new Pair<String, String>("func_70304_b", "getStackInSlotOnClosing"));
+ mInitMap.put(new Pair<String, String>("func_70305_f", "closeChest"));
+ mInitMap.put(new Pair<String, String>("func_70429_k", "decrementAnimations"));
+ mInitMap.put(new Pair<String, String>("func_70430_l", "getTotalArmorValue"));
+ mInitMap.put(new Pair<String, String>("func_70431_c", "hasItemStack"));
+ mInitMap.put(new Pair<String, String>("func_70432_d", "storeItemStack"));
+ mInitMap.put(new Pair<String, String>("func_70436_m", "dropAllItems"));
+ mInitMap.put(new Pair<String, String>("func_70437_b", "setItemStack"));
+ mInitMap.put(new Pair<String, String>("func_70440_f", "armorItemInSlot"));
+ mInitMap.put(new Pair<String, String>("func_70441_a", "addItemStackToInventory"));
+ mInitMap.put(new Pair<String, String>("func_70442_a", "writeToNBT"));
+ mInitMap.put(new Pair<String, String>("func_70443_b", "readFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_70445_o", "getItemStack"));
+ mInitMap.put(new Pair<String, String>("func_70447_i", "getFirstEmptyStack"));
+ mInitMap.put(new Pair<String, String>("func_70448_g", "getCurrentItem"));
+ mInitMap.put(new Pair<String, String>("func_70449_g", "damageArmor"));
+ mInitMap.put(new Pair<String, String>("func_70451_h", "getHotbarSize"));
+ mInitMap.put(new Pair<String, String>("func_70452_e", "storePartialItemStack"));
+ mInitMap.put(new Pair<String, String>("func_70453_c", "changeCurrentItem"));
+ mInitMap.put(new Pair<String, String>("func_70455_b", "copyInventory"));
+ mInitMap.put(new Pair<String, String>("func_70463_b", "getStackInRowAndColumn"));
+ mInitMap.put(new Pair<String, String>("func_70468_h", "getCurrentRecipe"));
+ mInitMap.put(new Pair<String, String>("func_70469_d", "inventoryResetNeededOnSlotChange"));
+ mInitMap.put(new Pair<String, String>("func_70470_g", "resetRecipeAndSlots"));
+ mInitMap.put(new Pair<String, String>("func_70471_c", "setCurrentRecipeIndex"));
+ mInitMap.put(new Pair<String, String>("func_70486_a", "loadInventoryFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_70487_g", "saveInventoryToNBT"));
+ mInitMap.put(new Pair<String, String>("func_70491_i", "getDamage"));
+ mInitMap.put(new Pair<String, String>("func_70492_c", "setDamage"));
+ mInitMap.put(new Pair<String, String>("func_70493_k", "getRollingDirection"));
+ mInitMap.put(new Pair<String, String>("func_70494_i", "setRollingDirection"));
+ mInitMap.put(new Pair<String, String>("func_70496_j", "getRollingAmplitude"));
+ mInitMap.put(new Pair<String, String>("func_70497_h", "setRollingAmplitude"));
+ mInitMap.put(new Pair<String, String>("func_70515_d", "explode"));
+ mInitMap.put(new Pair<String, String>("func_70518_d", "onValidSurface"));
+ mInitMap.put(new Pair<String, String>("func_70526_d", "getXpValue"));
+ mInitMap.put(new Pair<String, String>("func_70527_a", "getXPSplit"));
+ mInitMap.put(new Pair<String, String>("func_70528_g", "getTextureByXP"));
+ mInitMap.put(new Pair<String, String>("func_70534_d", "getRedColorF"));
+ mInitMap.put(new Pair<String, String>("func_70535_g", "getBlueColorF"));
+ mInitMap.put(new Pair<String, String>("func_70536_a", "setParticleTextureIndex"));
+ mInitMap.put(new Pair<String, String>("func_70537_b", "getFXLayer"));
+ mInitMap.put(new Pair<String, String>("func_70538_b", "setRBGColorF"));
+ mInitMap.put(new Pair<String, String>("func_70539_a", "renderParticle"));
+ mInitMap.put(new Pair<String, String>("func_70541_f", "multipleParticleScaleBy"));
+ mInitMap.put(new Pair<String, String>("func_70542_f", "getGreenColorF"));
+ mInitMap.put(new Pair<String, String>("func_70543_e", "multiplyVelocity"));
+ mInitMap.put(new Pair<String, String>("func_70589_b", "setBaseSpellTextureIndex"));
+ mInitMap.put(new Pair<String, String>("func_70596_a", "applyColourMultiplier"));
+ mInitMap.put(new Pair<String, String>("func_70599_aP", "getSoundVolume"));
+ mInitMap.put(new Pair<String, String>("func_70600_l", "dropRareDrop"));
+ mInitMap.put(new Pair<String, String>("func_70601_bi", "getCanSpawnHere"));
+ mInitMap.put(new Pair<String, String>("func_70603_bj", "getRenderSizeModifier"));
+ mInitMap.put(new Pair<String, String>("func_70604_c", "setRevengeTarget"));
+ mInitMap.put(new Pair<String, String>("func_70605_aq", "getMoveHelper"));
+ mInitMap.put(new Pair<String, String>("func_70606_j", "setHealth"));
+ mInitMap.put(new Pair<String, String>("func_70608_bn", "isPlayerSleeping"));
+ mInitMap.put(new Pair<String, String>("func_70609_aI", "onDeathUpdate"));
+ mInitMap.put(new Pair<String, String>("func_70610_aX", "isMovementBlocked"));
+ mInitMap.put(new Pair<String, String>("func_70612_e", "moveEntityWithHeading"));
+ mInitMap.put(new Pair<String, String>("func_70613_aW", "isServerWorld"));
+ mInitMap.put(new Pair<String, String>("func_70614_a", "rayTrace"));
+ mInitMap.put(new Pair<String, String>("func_70615_aA", "eatGrassBonus"));
+ mInitMap.put(new Pair<String, String>("func_70617_f_", "isOnLadder"));
+ mInitMap.put(new Pair<String, String>("func_70618_n", "removePotionEffectClient"));
+ mInitMap.put(new Pair<String, String>("func_70619_bc", "updateAITasks"));
+ mInitMap.put(new Pair<String, String>("func_70620_b", "getItemIcon"));
+ mInitMap.put(new Pair<String, String>("func_70621_aR", "getHurtSound"));
+ mInitMap.put(new Pair<String, String>("func_70623_bb", "despawnEntity"));
+ mInitMap.put(new Pair<String, String>("func_70624_b", "setAttackTarget"));
+ mInitMap.put(new Pair<String, String>("func_70625_a", "faceEntity"));
+ mInitMap.put(new Pair<String, String>("func_70626_be", "updateEntityActionState"));
+ mInitMap.put(new Pair<String, String>("func_70627_aG", "getTalkInterval"));
+ mInitMap.put(new Pair<String, String>("func_70628_a", "dropFewItems"));
+ mInitMap.put(new Pair<String, String>("func_70629_bd", "updateAITick"));
+ mInitMap.put(new Pair<String, String>("func_70631_g_", "isChild"));
+ mInitMap.put(new Pair<String, String>("func_70632_aY", "isBlocking"));
+ mInitMap.put(new Pair<String, String>("func_70634_a", "setPositionAndUpdate"));
+ mInitMap.put(new Pair<String, String>("func_70635_at", "getEntitySenses"));
+ mInitMap.put(new Pair<String, String>("func_70636_d", "onLivingUpdate"));
+ mInitMap.put(new Pair<String, String>("func_70637_d", "setJumping"));
+ mInitMap.put(new Pair<String, String>("func_70638_az", "getAttackTarget"));
+ mInitMap.put(new Pair<String, String>("func_70639_aQ", "getLivingSound"));
+ mInitMap.put(new Pair<String, String>("func_70641_bl", "getMaxSpawnedInChunk"));
+ mInitMap.put(new Pair<String, String>("func_70642_aH", "playLivingSound"));
+ mInitMap.put(new Pair<String, String>("func_70643_av", "getAITarget"));
+ mInitMap.put(new Pair<String, String>("func_70644_a", "isPotionActive"));
+ mInitMap.put(new Pair<String, String>("func_70645_a", "onDeath"));
+ mInitMap.put(new Pair<String, String>("func_70646_bf", "getVerticalFaceSpeed"));
+ mInitMap.put(new Pair<String, String>("func_70647_i", "getSoundPitch"));
+ mInitMap.put(new Pair<String, String>("func_70648_aU", "canBreatheUnderwater"));
+ mInitMap.put(new Pair<String, String>("func_70650_aV", "isAIEnabled"));
+ mInitMap.put(new Pair<String, String>("func_70651_bq", "getActivePotionEffects"));
+ mInitMap.put(new Pair<String, String>("func_70652_k", "attackEntityAsMob"));
+ mInitMap.put(new Pair<String, String>("func_70653_a", "knockBack"));
+ mInitMap.put(new Pair<String, String>("func_70654_ax", "getAge"));
+ mInitMap.put(new Pair<String, String>("func_70655_b", "applyArmorCalculations"));
+ mInitMap.put(new Pair<String, String>("func_70656_aK", "spawnExplosionParticle"));
+ mInitMap.put(new Pair<String, String>("func_70657_f", "setMoveForward"));
+ mInitMap.put(new Pair<String, String>("func_70658_aO", "getTotalArmorValue"));
+ mInitMap.put(new Pair<String, String>("func_70659_e", "setAIMoveSpeed"));
+ mInitMap.put(new Pair<String, String>("func_70660_b", "getActivePotionEffect"));
+ mInitMap.put(new Pair<String, String>("func_70661_as", "getNavigator"));
+ mInitMap.put(new Pair<String, String>("func_70662_br", "isEntityUndead"));
+ mInitMap.put(new Pair<String, String>("func_70663_b", "updateRotation"));
+ mInitMap.put(new Pair<String, String>("func_70664_aZ", "jump"));
+ mInitMap.put(new Pair<String, String>("func_70665_d", "damageEntity"));
+ mInitMap.put(new Pair<String, String>("func_70666_h", "getPosition"));
+ mInitMap.put(new Pair<String, String>("func_70668_bt", "getCreatureAttribute"));
+ mInitMap.put(new Pair<String, String>("func_70669_a", "renderBrokenItemStack"));
+ mInitMap.put(new Pair<String, String>("func_70670_a", "onmInitMap.put(newPotionEffect"));
+ mInitMap.put(new Pair<String, String>("func_70671_ap", "getLookHelper"));
+ mInitMap.put(new Pair<String, String>("func_70672_c", "applyPotionDamageCalculations"));
+ mInitMap.put(new Pair<String, String>("func_70673_aS", "getDeathSound"));
+ mInitMap.put(new Pair<String, String>("func_70674_bp", "clearActivePotions"));
+ mInitMap.put(new Pair<String, String>("func_70675_k", "damageArmor"));
+ mInitMap.put(new Pair<String, String>("func_70676_i", "getLook"));
+ mInitMap.put(new Pair<String, String>("func_70678_g", "getSwingProgress"));
+ mInitMap.put(new Pair<String, String>("func_70679_bo", "updatePotionEffects"));
+ mInitMap.put(new Pair<String, String>("func_70681_au", "getRNG"));
+ mInitMap.put(new Pair<String, String>("func_70682_h", "decreaseAirSupply"));
+ mInitMap.put(new Pair<String, String>("func_70683_ar", "getJumpHelper"));
+ mInitMap.put(new Pair<String, String>("func_70684_aJ", "isPlayer"));
+ mInitMap.put(new Pair<String, String>("func_70685_l", "canEntityBeSeen"));
+ mInitMap.put(new Pair<String, String>("func_70686_a", "canAttackClass"));
+ mInitMap.put(new Pair<String, String>("func_70687_e", "isPotionApplicable"));
+ mInitMap.put(new Pair<String, String>("func_70688_c", "onFinishedPotionEffect"));
+ mInitMap.put(new Pair<String, String>("func_70689_ay", "getAIMoveSpeed"));
+ mInitMap.put(new Pair<String, String>("func_70690_d", "addPotionEffect"));
+ mInitMap.put(new Pair<String, String>("func_70691_i", "heal"));
+ mInitMap.put(new Pair<String, String>("func_70692_ba", "canDespawn"));
+ mInitMap.put(new Pair<String, String>("func_70693_a", "getExperiencePoints"));
+ mInitMap.put(new Pair<String, String>("func_70694_bm", "getHeldItem"));
+ mInitMap.put(new Pair<String, String>("func_70695_b", "onChangedPotionEffect"));
+ mInitMap.put(new Pair<String, String>("func_70777_m", "getEntityToAttack"));
+ mInitMap.put(new Pair<String, String>("func_70778_a", "setPathToEntity"));
+ mInitMap.put(new Pair<String, String>("func_70779_j", "updateWanderPath"));
+ mInitMap.put(new Pair<String, String>("func_70780_i", "isMovementCeased"));
+ mInitMap.put(new Pair<String, String>("func_70781_l", "hasPath"));
+ mInitMap.put(new Pair<String, String>("func_70782_k", "findPlayerToAttack"));
+ mInitMap.put(new Pair<String, String>("func_70783_a", "getBlockPathWeight"));
+ mInitMap.put(new Pair<String, String>("func_70784_b", "setTarget"));
+ mInitMap.put(new Pair<String, String>("func_70785_a", "attackEntity"));
+ mInitMap.put(new Pair<String, String>("func_70790_a", "isCourseTraversable"));
+ mInitMap.put(new Pair<String, String>("func_70799_a", "setSlimeSize"));
+ mInitMap.put(new Pair<String, String>("func_70800_m", "canDamagePlayer"));
+ mInitMap.put(new Pair<String, String>("func_70801_i", "getSlimeParticle"));
+ mInitMap.put(new Pair<String, String>("func_70802_j", "createInstance"));
+ mInitMap.put(new Pair<String, String>("func_70803_o", "getJumpSound"));
+ mInitMap.put(new Pair<String, String>("func_70804_p", "makesSoundOnLand"));
+ mInitMap.put(new Pair<String, String>("func_70805_n", "getAttackStrength"));
+ mInitMap.put(new Pair<String, String>("func_70806_k", "getJumpDelay"));
+ mInitMap.put(new Pair<String, String>("func_70807_r", "makesSoundOnJump"));
+ mInitMap.put(new Pair<String, String>("func_70808_l", "alterSquishAmount"));
+ mInitMap.put(new Pair<String, String>("func_70809_q", "getSlimeSize"));
+ mInitMap.put(new Pair<String, String>("func_70814_o", "isValidLightLevel"));
+ mInitMap.put(new Pair<String, String>("func_70816_c", "teleportToEntity"));
+ mInitMap.put(new Pair<String, String>("func_70817_b", "setCarryingData"));
+ mInitMap.put(new Pair<String, String>("func_70819_e", "setScreaming"));
+ mInitMap.put(new Pair<String, String>("func_70820_n", "teleportRandomly"));
+ mInitMap.put(new Pair<String, String>("func_70821_d", "shouldAttackPlayer"));
+ mInitMap.put(new Pair<String, String>("func_70823_r", "isScreaming"));
+ mInitMap.put(new Pair<String, String>("func_70824_q", "getCarryingData"));
+ mInitMap.put(new Pair<String, String>("func_70825_j", "teleportTo"));
+ mInitMap.put(new Pair<String, String>("func_70829_a", "setCreeperState"));
+ mInitMap.put(new Pair<String, String>("func_70830_n", "getPowered"));
+ mInitMap.put(new Pair<String, String>("func_70831_j", "getCreeperFlashIntensity"));
+ mInitMap.put(new Pair<String, String>("func_70832_p", "getCreeperState"));
+ mInitMap.put(new Pair<String, String>("func_70835_c", "becomeAngryAt"));
+ mInitMap.put(new Pair<String, String>("func_70839_e", "setBesideClimbableBlock"));
+ mInitMap.put(new Pair<String, String>("func_70841_p", "isBesideClimbableBlock"));
+ mInitMap.put(new Pair<String, String>("func_70849_f", "setPlayerCreated"));
+ mInitMap.put(new Pair<String, String>("func_70850_q", "isPlayerCreated"));
+ mInitMap.put(new Pair<String, String>("func_70851_e", "setHoldingRose"));
+ mInitMap.put(new Pair<String, String>("func_70852_n", "getVillage"));
+ mInitMap.put(new Pair<String, String>("func_70853_p", "getHoldRoseTick"));
+ mInitMap.put(new Pair<String, String>("func_70854_o", "getAttackTimer"));
+ mInitMap.put(new Pair<String, String>("func_70873_a", "setGrowingAge"));
+ mInitMap.put(new Pair<String, String>("func_70874_b", "getGrowingAge"));
+ mInitMap.put(new Pair<String, String>("func_70875_t", "resetInLove"));
+ mInitMap.put(new Pair<String, String>("func_70876_c", "procreate"));
+ mInitMap.put(new Pair<String, String>("func_70877_b", "isBreedingItem"));
+ mInitMap.put(new Pair<String, String>("func_70878_b", "canMateWith"));
+ mInitMap.put(new Pair<String, String>("func_70880_s", "isInLove"));
+ mInitMap.put(new Pair<String, String>("func_70890_k", "getHeadRotationAngleX"));
+ mInitMap.put(new Pair<String, String>("func_70891_b", "setFleeceColor"));
+ mInitMap.put(new Pair<String, String>("func_70892_o", "getSheared"));
+ mInitMap.put(new Pair<String, String>("func_70893_e", "setSheared"));
+ mInitMap.put(new Pair<String, String>("func_70894_j", "getHeadRotationPointY"));
+ mInitMap.put(new Pair<String, String>("func_70895_a", "getRandomFleeceColor"));
+ mInitMap.put(new Pair<String, String>("func_70896_n", "getFleeceColor"));
+ mInitMap.put(new Pair<String, String>("func_70900_e", "setSaddled"));
+ mInitMap.put(new Pair<String, String>("func_70901_n", "getSaddled"));
+ mInitMap.put(new Pair<String, String>("func_70902_q", "getOwner"));
+ mInitMap.put(new Pair<String, String>("func_70903_f", "setTamed"));
+ mInitMap.put(new Pair<String, String>("func_70904_g", "setSitting"));
+ mInitMap.put(new Pair<String, String>("func_70906_o", "isSitting"));
+ mInitMap.put(new Pair<String, String>("func_70907_r", "getAISit"));
+ mInitMap.put(new Pair<String, String>("func_70908_e", "playTameEffect"));
+ mInitMap.put(new Pair<String, String>("func_70909_n", "isTamed"));
+ mInitMap.put(new Pair<String, String>("func_70912_b", "setTameSkin"));
+ mInitMap.put(new Pair<String, String>("func_70913_u", "getTameSkin"));
+ mInitMap.put(new Pair<String, String>("func_70915_j", "getShadingWhileWet"));
+ mInitMap.put(new Pair<String, String>("func_70916_h", "setAngry"));
+ mInitMap.put(new Pair<String, String>("func_70917_k", "getInterestedAngle"));
+ mInitMap.put(new Pair<String, String>("func_70919_bu", "isAngry"));
+ mInitMap.put(new Pair<String, String>("func_70920_v", "getTailRotation"));
+ mInitMap.put(new Pair<String, String>("func_70921_u", "isWolfWet"));
+ mInitMap.put(new Pair<String, String>("func_70923_f", "getShakeAngle"));
+ mInitMap.put(new Pair<String, String>("func_70930_a", "setRecipes"));
+ mInitMap.put(new Pair<String, String>("func_70931_l_", "getCustomer"));
+ mInitMap.put(new Pair<String, String>("func_70932_a_", "setCustomer"));
+ mInitMap.put(new Pair<String, String>("func_70933_a", "useRecipe"));
+ mInitMap.put(new Pair<String, String>("func_70934_b", "getRecipes"));
+ mInitMap.put(new Pair<String, String>("func_70938_b", "setProfession"));
+ mInitMap.put(new Pair<String, String>("func_70939_f", "setPlaying"));
+ mInitMap.put(new Pair<String, String>("func_70940_q", "isTrading"));
+ mInitMap.put(new Pair<String, String>("func_70941_o", "isMating"));
+ mInitMap.put(new Pair<String, String>("func_70942_a", "generateRandomParticles"));
+ mInitMap.put(new Pair<String, String>("func_70945_p", "isPlaying"));
+ mInitMap.put(new Pair<String, String>("func_70946_n", "getProfession"));
+ mInitMap.put(new Pair<String, String>("func_70947_e", "setMating"));
+ mInitMap.put(new Pair<String, String>("func_70950_c", "addDefaultEquipmentAndRecipies"));
+ mInitMap.put(new Pair<String, String>("func_70965_a", "attackEntityFromPart"));
+ mInitMap.put(new Pair<String, String>("func_70967_k", "setmInitMap.put(newTarget"));
+ mInitMap.put(new Pair<String, String>("func_70969_j", "updateDragonEnderCrystal"));
+ mInitMap.put(new Pair<String, String>("func_70970_a", "collideWithEntities"));
+ mInitMap.put(new Pair<String, String>("func_70971_b", "attackEntitiesInList"));
+ mInitMap.put(new Pair<String, String>("func_70972_a", "destroyBlocksInAABB"));
+ mInitMap.put(new Pair<String, String>("func_70973_b", "simplifyAngle"));
+ mInitMap.put(new Pair<String, String>("func_70974_a", "getMovementOffsets"));
+ mInitMap.put(new Pair<String, String>("func_70975_a", "createEnderPortal"));
+ mInitMap.put(new Pair<String, String>("func_70996_bM", "shouldHeal"));
+ mInitMap.put(new Pair<String, String>("func_70997_bJ", "getBedLocation"));
+ mInitMap.put(new Pair<String, String>("func_70998_m", "interactWith"));
+ mInitMap.put(new Pair<String, String>("func_70999_a", "wakeUpPlayer"));
+ mInitMap.put(new Pair<String, String>("func_71000_j", "addMovementStat"));
+ mInitMap.put(new Pair<String, String>("func_71001_a", "onItemPickup"));
+ mInitMap.put(new Pair<String, String>("func_71002_c", "displayGUIEnchantment"));
+ mInitMap.put(new Pair<String, String>("func_71004_bE", "respawnPlayer"));
+ mInitMap.put(new Pair<String, String>("func_71005_bN", "getInventoryEnderChest"));
+ mInitMap.put(new Pair<String, String>("func_71007_a", "displayGUIChest"));
+ mInitMap.put(new Pair<String, String>("func_71008_a", "setItemInUse"));
+ mInitMap.put(new Pair<String, String>("func_71009_b", "onCriticalHit"));
+ mInitMap.put(new Pair<String, String>("func_71010_c", "updateItemUse"));
+ mInitMap.put(new Pair<String, String>("func_71011_bu", "getItemInUse"));
+ mInitMap.put(new Pair<String, String>("func_71012_a", "joinEntityItemWithWorld"));
+ mInitMap.put(new Pair<String, String>("func_71015_k", "addMountedMovementStat"));
+ mInitMap.put(new Pair<String, String>("func_71016_p", "sendPlayerAbilities"));
+ mInitMap.put(new Pair<String, String>("func_71018_a", "sleepInBedAt"));
+ mInitMap.put(new Pair<String, String>("func_71019_a", "dropPlayerItemWithRandomChoice"));
+ mInitMap.put(new Pair<String, String>("func_71020_j", "addExhaustion"));
+ mInitMap.put(new Pair<String, String>("func_71023_q", "addExperience"));
+ mInitMap.put(new Pair<String, String>("func_71024_bL", "getFoodStats"));
+ mInitMap.put(new Pair<String, String>("func_71026_bH", "isPlayerFullyAsleep"));
+ mInitMap.put(new Pair<String, String>("func_71027_c", "travelToDimension"));
+ mInitMap.put(new Pair<String, String>("func_71028_bD", "destroyCurrentEquippedItem"));
+ mInitMap.put(new Pair<String, String>("func_71029_a", "triggerAchievement"));
+ mInitMap.put(new Pair<String, String>("func_71030_a", "displayGUIMerchant"));
+ mInitMap.put(new Pair<String, String>("func_71033_a", "setGameType"));
+ mInitMap.put(new Pair<String, String>("func_71034_by", "stopUsingItem"));
+ mInitMap.put(new Pair<String, String>("func_71036_o", "onItemUseFinish"));
+ mInitMap.put(new Pair<String, String>("func_71037_bA", "getScore"));
+ mInitMap.put(new Pair<String, String>("func_71038_i", "swingItem"));
+ mInitMap.put(new Pair<String, String>("func_71039_bw", "isUsingItem"));
+ mInitMap.put(new Pair<String, String>("func_71040_bB", "dropOneItem"));
+ mInitMap.put(new Pair<String, String>("func_71041_bz", "clearItemInUse"));
+ mInitMap.put(new Pair<String, String>("func_71043_e", "canEat"));
+ mInitMap.put(new Pair<String, String>("func_71044_o", "collideWithPlayer"));
+ mInitMap.put(new Pair<String, String>("func_71045_bC", "getCurrentEquippedItem"));
+ mInitMap.put(new Pair<String, String>("func_71047_c", "onEnchantmentCritical"));
+ mInitMap.put(new Pair<String, String>("func_71048_c", "displayGUIBook"));
+ mInitMap.put(new Pair<String, String>("func_71049_a", "clonePlayer"));
+ mInitMap.put(new Pair<String, String>("func_71050_bK", "xpBarCap"));
+ mInitMap.put(new Pair<String, String>("func_71051_bG", "getBedOrientationInDegrees"));
+ mInitMap.put(new Pair<String, String>("func_71052_bv", "getItemInUseCount"));
+ mInitMap.put(new Pair<String, String>("func_71053_j", "closeScreen"));
+ mInitMap.put(new Pair<String, String>("func_71056_a", "verifyRespawnCoordinates"));
+ mInitMap.put(new Pair<String, String>("func_71057_bx", "getItemInUseDuration"));
+ mInitMap.put(new Pair<String, String>("func_71058_b", "displayGUIWorkbench"));
+ mInitMap.put(new Pair<String, String>("func_71059_n", "attackTargetEntityWithCurrentItem"));
+ mInitMap.put(new Pair<String, String>("func_71060_bI", "getSleepTimer"));
+ mInitMap.put(new Pair<String, String>("func_71061_d_", "resetHeight"));
+ mInitMap.put(new Pair<String, String>("func_71063_a", "setSpawnChunk"));
+ mInitMap.put(new Pair<String, String>("func_71064_a", "addStat"));
+ mInitMap.put(new Pair<String, String>("func_71065_l", "isInBed"));
+ mInitMap.put(new Pair<String, String>("func_71110_a", "updateCraftingInventory"));
+ mInitMap.put(new Pair<String, String>("func_71111_a", "sendSlotContents"));
+ mInitMap.put(new Pair<String, String>("func_71112_a", "sendProgressBarUpdate"));
+ mInitMap.put(new Pair<String, String>("func_71113_k", "updateHeldItem"));
+ mInitMap.put(new Pair<String, String>("func_71114_r", "getPlayerIP"));
+ mInitMap.put(new Pair<String, String>("func_71116_b", "addSelfToInternalCraftingInventory"));
+ mInitMap.put(new Pair<String, String>("func_71117_bO", "getNextWindowId"));
+ mInitMap.put(new Pair<String, String>("func_71118_n", "setPlayerHealthUpdated"));
+ mInitMap.put(new Pair<String, String>("func_71120_a", "sendContainerToPlayer"));
+ mInitMap.put(new Pair<String, String>("func_71121_q", "getServerForPlayer"));
+ mInitMap.put(new Pair<String, String>("func_71122_b", "handleFalling"));
+ mInitMap.put(new Pair<String, String>("func_71123_m", "mountEntityAndWakeUp"));
+ mInitMap.put(new Pair<String, String>("func_71124_b", "getEquipmentInSlot"));
+ mInitMap.put(new Pair<String, String>("func_71127_g", "onUpdateEntity"));
+ mInitMap.put(new Pair<String, String>("func_71128_l", "closeContainer"));
+ mInitMap.put(new Pair<String, String>("func_71150_b", "setPlayerSPHealth"));
+ mInitMap.put(new Pair<String, String>("func_71151_f", "getFOVMultiplier"));
+ mInitMap.put(new Pair<String, String>("func_71152_a", "setXPStats"));
+ mInitMap.put(new Pair<String, String>("func_71153_f", "isBlockNormal"));
+ mInitMap.put(new Pair<String, String>("func_71165_d", "sendChatMessage"));
+ mInitMap.put(new Pair<String, String>("func_71166_b", "sendMotionUpdates"));
+ mInitMap.put(new Pair<String, String>("func_71187_D", "getCommandManager"));
+ mInitMap.put(new Pair<String, String>("func_71188_g", "setAllowPvp"));
+ mInitMap.put(new Pair<String, String>("func_71189_e", "setHostname"));
+ mInitMap.put(new Pair<String, String>("func_71190_q", "updateTimeLightAndEntities"));
+ mInitMap.put(new Pair<String, String>("func_71191_d", "setBuildLimit"));
+ mInitMap.put(new Pair<String, String>("func_71192_d", "setUserMessage"));
+ mInitMap.put(new Pair<String, String>("func_71193_K", "allowSpawnMonsters"));
+ mInitMap.put(new Pair<String, String>("func_71194_c", "canCreateBonusChest"));
+ mInitMap.put(new Pair<String, String>("func_71195_b_", "getUserMessage"));
+ mInitMap.put(new Pair<String, String>("func_71197_b", "startServer"));
+ mInitMap.put(new Pair<String, String>("func_71198_k", "logDebug"));
+ mInitMap.put(new Pair<String, String>("func_71199_h", "isHardcore"));
+ mInitMap.put(new Pair<String, String>("func_71200_ad", "serverIsInRunLoop"));
+ mInitMap.put(new Pair<String, String>("func_71201_j", "logSevere"));
+ mInitMap.put(new Pair<String, String>("func_71203_ab", "getConfigurationManager"));
+ mInitMap.put(new Pair<String, String>("func_71204_b", "setDemo"));
+ mInitMap.put(new Pair<String, String>("func_71205_p", "setMOTD"));
+ mInitMap.put(new Pair<String, String>("func_71206_a", "shareToLAN"));
+ mInitMap.put(new Pair<String, String>("func_71207_Z", "getBuildLimit"));
+ mInitMap.put(new Pair<String, String>("func_71208_b", "setServerPort"));
+ mInitMap.put(new Pair<String, String>("func_71209_f", "getFile"));
+ mInitMap.put(new Pair<String, String>("func_71211_k", "getServerHostname"));
+ mInitMap.put(new Pair<String, String>("func_71213_z", "getAllUsernames"));
+ mInitMap.put(new Pair<String, String>("func_71214_G", "getServerOwner"));
+ mInitMap.put(new Pair<String, String>("func_71215_F", "getServerPort"));
+ mInitMap.put(new Pair<String, String>("func_71216_a_", "outputPercentRemaining"));
+ mInitMap.put(new Pair<String, String>("func_71217_p", "tick"));
+ mInitMap.put(new Pair<String, String>("func_71218_a", "worldServerForDimension"));
+ mInitMap.put(new Pair<String, String>("func_71219_W", "isPVPEnabled"));
+ mInitMap.put(new Pair<String, String>("func_71220_V", "getCanSpawnNPCs"));
+ mInitMap.put(new Pair<String, String>("func_71221_J", "getWorldName"));
+ mInitMap.put(new Pair<String, String>("func_71222_d", "initialWorldChunkLoad"));
+ mInitMap.put(new Pair<String, String>("func_71223_ag", "enableProfiling"));
+ mInitMap.put(new Pair<String, String>("func_71224_l", "setServerOwner"));
+ mInitMap.put(new Pair<String, String>("func_71225_e", "canStructuresSpawn"));
+ mInitMap.put(new Pair<String, String>("func_71228_a", "finalTick"));
+ mInitMap.put(new Pair<String, String>("func_71229_d", "setOnlineMode"));
+ mInitMap.put(new Pair<String, String>("func_71230_b", "addServerInfoToCrashReport"));
+ mInitMap.put(new Pair<String, String>("func_71231_X", "isFlightAllowed"));
+ mInitMap.put(new Pair<String, String>("func_71233_x", "getCurrentPlayerCount"));
+ mInitMap.put(new Pair<String, String>("func_71234_u", "getPort"));
+ mInitMap.put(new Pair<String, String>("func_71235_a", "setGameType"));
+ mInitMap.put(new Pair<String, String>("func_71236_h", "logWarning"));
+ mInitMap.put(new Pair<String, String>("func_71237_c", "convertMapIfNeeded"));
+ mInitMap.put(new Pair<String, String>("func_71238_n", "getDataDirectory"));
+ mInitMap.put(new Pair<String, String>("func_71239_B", "isDebuggingEnabled"));
+ mInitMap.put(new Pair<String, String>("func_71240_o", "systemExitNow"));
+ mInitMap.put(new Pair<String, String>("func_71241_aa", "isServerStopped"));
+ mInitMap.put(new Pair<String, String>("func_71242_L", "isDemo"));
+ mInitMap.put(new Pair<String, String>("func_71243_i", "clearCurrentTask"));
+ mInitMap.put(new Pair<String, String>("func_71244_g", "logInfo"));
+ mInitMap.put(new Pair<String, String>("func_71245_h", "setAllowFlight"));
+ mInitMap.put(new Pair<String, String>("func_71246_n", "setWorldName"));
+ mInitMap.put(new Pair<String, String>("func_71247_a", "loadAllWorlds"));
+ mInitMap.put(new Pair<String, String>("func_71248_a", "getPossibleCompletions"));
+ mInitMap.put(new Pair<String, String>("func_71249_w", "getMinecraftVersion"));
+ mInitMap.put(new Pair<String, String>("func_71250_E", "getKeyPair"));
+ mInitMap.put(new Pair<String, String>("func_71251_e", "setCanSpawnAnimals"));
+ mInitMap.put(new Pair<String, String>("func_71252_i", "handleRConCommand"));
+ mInitMap.put(new Pair<String, String>("func_71253_a", "setKeyPair"));
+ mInitMap.put(new Pair<String, String>("func_71254_M", "getActiveAnvilConverter"));
+ mInitMap.put(new Pair<String, String>("func_71255_r", "getAllowNether"));
+ mInitMap.put(new Pair<String, String>("func_71256_s", "startServerThread"));
+ mInitMap.put(new Pair<String, String>("func_71257_f", "setCanSpawnNPCs"));
+ mInitMap.put(new Pair<String, String>("func_71258_A", "getPlugins"));
+ mInitMap.put(new Pair<String, String>("func_71259_af", "getTickCounter"));
+ mInitMap.put(new Pair<String, String>("func_71260_j", "stopServer"));
+ mInitMap.put(new Pair<String, String>("func_71261_m", "setFolderName"));
+ mInitMap.put(new Pair<String, String>("func_71262_S", "isDedicatedServer"));
+ mInitMap.put(new Pair<String, String>("func_71263_m", "initiateShutdown"));
+ mInitMap.put(new Pair<String, String>("func_71264_H", "isSinglePlayer"));
+ mInitMap.put(new Pair<String, String>("func_71265_f", "getGameType"));
+ mInitMap.put(new Pair<String, String>("func_71266_T", "isServerInOnlineMode"));
+ mInitMap.put(new Pair<String, String>("func_71267_a", "saveAllWorlds"));
+ mInitMap.put(new Pair<String, String>("func_71268_U", "getCanSpawnAnimals"));
+ mInitMap.put(new Pair<String, String>("func_71270_I", "getFolderName"));
+ mInitMap.put(new Pair<String, String>("func_71272_O", "deleteWorldAndStopServer"));
+ mInitMap.put(new Pair<String, String>("func_71273_Y", "getMOTD"));
+ mInitMap.put(new Pair<String, String>("func_71274_v", "getMotd"));
+ mInitMap.put(new Pair<String, String>("func_71275_y", "getMaxPlayers"));
+ mInitMap.put(new Pair<String, String>("func_71276_C", "getServer"));
+ mInitMap.put(new Pair<String, String>("func_71277_t", "getHostname"));
+ mInitMap.put(new Pair<String, String>("func_71278_l", "isServerRunning"));
+ mInitMap.put(new Pair<String, String>("func_71279_ae", "getGuiEnabled"));
+ mInitMap.put(new Pair<String, String>("func_71326_a", "saveProperties"));
+ mInitMap.put(new Pair<String, String>("func_71327_a", "getIntProperty"));
+ mInitMap.put(new Pair<String, String>("func_71328_a", "setProperty"));
+ mInitMap.put(new Pair<String, String>("func_71329_c", "getSettingsFilename"));
+ mInitMap.put(new Pair<String, String>("func_71330_a", "getStringProperty"));
+ mInitMap.put(new Pair<String, String>("func_71331_a", "addPendingCommand"));
+ mInitMap.put(new Pair<String, String>("func_71332_a", "getBooleanProperty"));
+ mInitMap.put(new Pair<String, String>("func_71333_ah", "executePendingCommands"));
+ mInitMap.put(new Pair<String, String>("func_71344_c", "getPublic"));
+ mInitMap.put(new Pair<String, String>("func_71351_a", "setServerData"));
+ mInitMap.put(new Pair<String, String>("func_71352_k", "toggleFullscreen"));
+ mInitMap.put(new Pair<String, String>("func_71353_a", "loadWorld"));
+ mInitMap.put(new Pair<String, String>("func_71354_a", "setDimensionAndSpawnPlayer"));
+ mInitMap.put(new Pair<String, String>("func_71355_q", "isDemo"));
+ mInitMap.put(new Pair<String, String>("func_71356_B", "isSingleplayer"));
+ mInitMap.put(new Pair<String, String>("func_71357_I", "loadScreen"));
+ mInitMap.put(new Pair<String, String>("func_71359_d", "getSaveLoader"));
+ mInitMap.put(new Pair<String, String>("func_71361_d", "checkGLError"));
+ mInitMap.put(new Pair<String, String>("func_71363_D", "stopIntegratedServer"));
+ mInitMap.put(new Pair<String, String>("func_71364_i", "setIngameNotInFocus"));
+ mInitMap.put(new Pair<String, String>("func_71366_a", "displayDebugInfo"));
+ mInitMap.put(new Pair<String, String>("func_71367_a", "setServer"));
+ mInitMap.put(new Pair<String, String>("func_71369_N", "getGLMaximumTextureSize"));
+ mInitMap.put(new Pair<String, String>("func_71370_a", "resize"));
+ mInitMap.put(new Pair<String, String>("func_71371_a", "launchIntegratedServer"));
+ mInitMap.put(new Pair<String, String>("func_71372_G", "isFullScreen"));
+ mInitMap.put(new Pair<String, String>("func_71374_p", "debugInfoEntities"));
+ mInitMap.put(new Pair<String, String>("func_71375_t", "isFancyGraphicsEnabled"));
+ mInitMap.put(new Pair<String, String>("func_71377_b", "displayCrashReport"));
+ mInitMap.put(new Pair<String, String>("func_71378_E", "getPlayerUsageSnooper"));
+ mInitMap.put(new Pair<String, String>("func_71379_u", "isAmbientOcclusionEnabled"));
+ mInitMap.put(new Pair<String, String>("func_71381_h", "setIngameFocus"));
+ mInitMap.put(new Pair<String, String>("func_71382_s", "isGuiEnabled"));
+ mInitMap.put(new Pair<String, String>("func_71383_b", "updateDebugProfilerName"));
+ mInitMap.put(new Pair<String, String>("func_71384_a", "startGame"));
+ mInitMap.put(new Pair<String, String>("func_71385_j", "displayInGameMenu"));
+ mInitMap.put(new Pair<String, String>("func_71386_F", "getSystemTime"));
+ mInitMap.put(new Pair<String, String>("func_71387_A", "isIntegratedServerRunning"));
+ mInitMap.put(new Pair<String, String>("func_71388_o", "getWorldProviderName"));
+ mInitMap.put(new Pair<String, String>("func_71389_H", "startTimerHackThread"));
+ mInitMap.put(new Pair<String, String>("func_71392_a", "scaledTessellator"));
+ mInitMap.put(new Pair<String, String>("func_71393_m", "debugInfoRenders"));
+ mInitMap.put(new Pair<String, String>("func_71396_d", "addGraphicsAndWorldToCrashReport"));
+ mInitMap.put(new Pair<String, String>("func_71398_f", "freeMemory"));
+ mInitMap.put(new Pair<String, String>("func_71400_g", "shutdown"));
+ mInitMap.put(new Pair<String, String>("func_71401_C", "getIntegratedServer"));
+ mInitMap.put(new Pair<String, String>("func_71403_a", "loadWorld"));
+ mInitMap.put(new Pair<String, String>("func_71404_a", "crashed"));
+ mInitMap.put(new Pair<String, String>("func_71405_e", "shutdownMinecraftApplet"));
+ mInitMap.put(new Pair<String, String>("func_71407_l", "runTick"));
+ mInitMap.put(new Pair<String, String>("func_71408_n", "getEntityDebug"));
+ mInitMap.put(new Pair<String, String>("func_71410_x", "getMinecraft"));
+ mInitMap.put(new Pair<String, String>("func_71411_J", "runGameLoop"));
+ mInitMap.put(new Pair<String, String>("func_71497_f", "getFile"));
+ mInitMap.put(new Pair<String, String>("func_71498_d", "getCauseStackTraceOrString"));
+ mInitMap.put(new Pair<String, String>("func_71499_a", "addCrashSectionThrowable"));
+ mInitMap.put(new Pair<String, String>("func_71500_a", "addCrashSectionCallable"));
+ mInitMap.put(new Pair<String, String>("func_71501_a", "getDescription"));
+ mInitMap.put(new Pair<String, String>("func_71502_e", "getCompleteReport"));
+ mInitMap.put(new Pair<String, String>("func_71503_h", "getWittyComment"));
+ mInitMap.put(new Pair<String, String>("func_71504_g", "populateEnvironment"));
+ mInitMap.put(new Pair<String, String>("func_71505_b", "getCrashCause"));
+ mInitMap.put(new Pair<String, String>("func_71506_a", "getSectionsInStringBuilder"));
+ mInitMap.put(new Pair<String, String>("func_71507_a", "addCrashSection"));
+ mInitMap.put(new Pair<String, String>("func_71514_a", "getCommandAliases"));
+ mInitMap.put(new Pair<String, String>("func_71515_b", "processCommand"));
+ mInitMap.put(new Pair<String, String>("func_71516_a", "addTabCompletionOptions"));
+ mInitMap.put(new Pair<String, String>("func_71517_b", "getCommandName"));
+ mInitMap.put(new Pair<String, String>("func_71518_a", "getCommandUsage"));
+ mInitMap.put(new Pair<String, String>("func_71519_b", "canCommandSenderUseCommand"));
+ mInitMap.put(new Pair<String, String>("func_71521_c", "getCommandSenderAsPlayer"));
+ mInitMap.put(new Pair<String, String>("func_71523_a", "doesStringStartWith"));
+ mInitMap.put(new Pair<String, String>("func_71526_a", "parseInt"));
+ mInitMap.put(new Pair<String, String>("func_71527_a", "joinNiceString"));
+ mInitMap.put(new Pair<String, String>("func_71528_a", "parseIntWithMin"));
+ mInitMap.put(new Pair<String, String>("func_71529_a", "setAdminCommander"));
+ mInitMap.put(new Pair<String, String>("func_71530_a", "getListOfStringsMatchingLastWord"));
+ mInitMap.put(new Pair<String, String>("func_71531_a", "getListOfStringsFromIterableMatchingLastWord"));
+ mInitMap.put(new Pair<String, String>("func_71532_a", "parseIntBounded"));
+ mInitMap.put(new Pair<String, String>("func_71534_d", "getSortedPossibleCommands"));
+ mInitMap.put(new Pair<String, String>("func_71535_c", "getCommands"));
+ mInitMap.put(new Pair<String, String>("func_71536_c", "getPlayers"));
+ mInitMap.put(new Pair<String, String>("func_71538_c", "getListOfPlayerUsernames"));
+ mInitMap.put(new Pair<String, String>("func_71539_b", "getGameModeFromCommand"));
+ mInitMap.put(new Pair<String, String>("func_71541_a", "setGameType"));
+ mInitMap.put(new Pair<String, String>("func_71542_c", "getAllUsernames"));
+ mInitMap.put(new Pair<String, String>("func_71552_a", "setTime"));
+ mInitMap.put(new Pair<String, String>("func_71553_b", "addTime"));
+ mInitMap.put(new Pair<String, String>("func_71554_c", "toggleDownfall"));
+ mInitMap.put(new Pair<String, String>("func_71555_a", "getCommands"));
+ mInitMap.put(new Pair<String, String>("func_71556_a", "executeCommand"));
+ mInitMap.put(new Pair<String, String>("func_71557_a", "getPossibleCommands"));
+ mInitMap.put(new Pair<String, String>("func_71558_b", "getPossibleCommands"));
+ mInitMap.put(new Pair<String, String>("func_71559_a", "dropFirstString"));
+ mInitMap.put(new Pair<String, String>("func_71560_a", "registerCommand"));
+ mInitMap.put(new Pair<String, String>("func_71565_a", "filterAllowedCharacters"));
+ mInitMap.put(new Pair<String, String>("func_71566_a", "isAllowedCharacter"));
+ mInitMap.put(new Pair<String, String>("func_71569_e", "getDistanceSquared"));
+ mInitMap.put(new Pair<String, String>("func_71571_b", "set"));
+ mInitMap.put(new Pair<String, String>("func_71575_a", "getCrashReport"));
+ mInitMap.put(new Pair<String, String>("func_72314_b", "expand"));
+ mInitMap.put(new Pair<String, String>("func_72315_c", "isVecInXZ"));
+ mInitMap.put(new Pair<String, String>("func_72316_a", "calculateXOffset"));
+ mInitMap.put(new Pair<String, String>("func_72317_d", "offset"));
+ mInitMap.put(new Pair<String, String>("func_72318_a", "isVecInside"));
+ mInitMap.put(new Pair<String, String>("func_72319_d", "isVecInXY"));
+ mInitMap.put(new Pair<String, String>("func_72320_b", "getAverageEdgeLength"));
+ mInitMap.put(new Pair<String, String>("func_72321_a", "addCoord"));
+ mInitMap.put(new Pair<String, String>("func_72322_c", "calculateZOffset"));
+ mInitMap.put(new Pair<String, String>("func_72323_b", "calculateYOffset"));
+ mInitMap.put(new Pair<String, String>("func_72324_b", "setBounds"));
+ mInitMap.put(new Pair<String, String>("func_72325_c", "getOffsetBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_72326_a", "intersectsWith"));
+ mInitMap.put(new Pair<String, String>("func_72327_a", "calculateIntercept"));
+ mInitMap.put(new Pair<String, String>("func_72328_c", "setBB"));
+ mInitMap.put(new Pair<String, String>("func_72329_c", "copy"));
+ mInitMap.put(new Pair<String, String>("func_72330_a", "getBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_72331_e", "contract"));
+ mInitMap.put(new Pair<String, String>("func_72333_b", "isVecInYZ"));
+ mInitMap.put(new Pair<String, String>("func_72352_l", "getMaxPlayers"));
+ mInitMap.put(new Pair<String, String>("func_72354_b", "updateTimeAndWeatherForPlayer"));
+ mInitMap.put(new Pair<String, String>("func_72355_a", "initializeConnectionToPlayer"));
+ mInitMap.put(new Pair<String, String>("func_72356_a", "transferPlayerToDimension"));
+ mInitMap.put(new Pair<String, String>("func_72358_d", "serverUpdateMountedMovingPlayer"));
+ mInitMap.put(new Pair<String, String>("func_72362_j", "loadWhiteList"));
+ mInitMap.put(new Pair<String, String>("func_72363_f", "getBannedIPs"));
+ mInitMap.put(new Pair<String, String>("func_72364_a", "setPlayerManager"));
+ mInitMap.put(new Pair<String, String>("func_72365_p", "getServerInstance"));
+ mInitMap.put(new Pair<String, String>("func_72367_e", "playerLoggedOut"));
+ mInitMap.put(new Pair<String, String>("func_72368_a", "recreatePlayerEntity"));
+ mInitMap.put(new Pair<String, String>("func_72369_d", "getAllUsernames"));
+ mInitMap.put(new Pair<String, String>("func_72371_a", "setWhiteListEnabled"));
+ mInitMap.put(new Pair<String, String>("func_72372_a", "getEntityViewDistance"));
+ mInitMap.put(new Pair<String, String>("func_72373_m", "getAvailablePlayerDat"));
+ mInitMap.put(new Pair<String, String>("func_72374_b", "onTick"));
+ mInitMap.put(new Pair<String, String>("func_72377_c", "playerLoggedIn"));
+ mInitMap.put(new Pair<String, String>("func_72378_q", "getHostPlayerData"));
+ mInitMap.put(new Pair<String, String>("func_72380_a", "readPlayerDataFromFile"));
+ mInitMap.put(new Pair<String, String>("func_72382_j", "getPlayersMatchingAddress"));
+ mInitMap.put(new Pair<String, String>("func_72383_n", "isWhiteListEnabled"));
+ mInitMap.put(new Pair<String, String>("func_72385_f", "syncPlayerInventory"));
+ mInitMap.put(new Pair<String, String>("func_72387_b", "setCommandsAllowedForAll"));
+ mInitMap.put(new Pair<String, String>("func_72389_g", "saveAllPlayerData"));
+ mInitMap.put(new Pair<String, String>("func_72391_b", "writePlayerData"));
+ mInitMap.put(new Pair<String, String>("func_72392_r", "removeAllPlayers"));
+ mInitMap.put(new Pair<String, String>("func_72394_k", "getCurrentPlayerCount"));
+ mInitMap.put(new Pair<String, String>("func_72395_o", "getViewDistance"));
+ mInitMap.put(new Pair<String, String>("func_72417_t", "loadOpsList"));
+ mInitMap.put(new Pair<String, String>("func_72418_v", "readWhiteList"));
+ mInitMap.put(new Pair<String, String>("func_72419_u", "saveOpsList"));
+ mInitMap.put(new Pair<String, String>("func_72421_w", "saveWhiteList"));
+ mInitMap.put(new Pair<String, String>("func_72429_b", "getIntermediateWithXValue"));
+ mInitMap.put(new Pair<String, String>("func_72430_b", "dotProduct"));
+ mInitMap.put(new Pair<String, String>("func_72431_c", "crossProduct"));
+ mInitMap.put(new Pair<String, String>("func_72432_b", "normalize"));
+ mInitMap.put(new Pair<String, String>("func_72433_c", "lengthVector"));
+ mInitMap.put(new Pair<String, String>("func_72434_d", "getIntermediateWithZValue"));
+ mInitMap.put(new Pair<String, String>("func_72435_c", "getIntermediateWithYValue"));
+ mInitMap.put(new Pair<String, String>("func_72436_e", "squareDistanceTo"));
+ mInitMap.put(new Pair<String, String>("func_72438_d", "distanceTo"));
+ mInitMap.put(new Pair<String, String>("func_72439_b", "setComponents"));
+ mInitMap.put(new Pair<String, String>("func_72440_a", "rotateAroundX"));
+ mInitMap.put(new Pair<String, String>("func_72441_c", "addVector"));
+ mInitMap.put(new Pair<String, String>("func_72442_b", "rotateAroundY"));
+ mInitMap.put(new Pair<String, String>("func_72443_a", "createVectorHelper"));
+ mInitMap.put(new Pair<String, String>("func_72444_a", "subtract"));
+ mInitMap.put(new Pair<String, String>("func_72445_d", "squareDistanceTo"));
+ mInitMap.put(new Pair<String, String>("func_72446_c", "rotateAroundZ"));
+ mInitMap.put(new Pair<String, String>("func_72591_c", "getRequestId"));
+ mInitMap.put(new Pair<String, String>("func_72592_a", "getRandomChallenge"));
+ mInitMap.put(new Pair<String, String>("func_72593_a", "hasExpired"));
+ mInitMap.put(new Pair<String, String>("func_72594_b", "getChallengeValue"));
+ mInitMap.put(new Pair<String, String>("func_72601_a", "registerSocket"));
+ mInitMap.put(new Pair<String, String>("func_72602_a", "startThread"));
+ mInitMap.put(new Pair<String, String>("func_72603_d", "getNumberOfPlayers"));
+ mInitMap.put(new Pair<String, String>("func_72604_a", "closeSocket"));
+ mInitMap.put(new Pair<String, String>("func_72605_a", "closeServerSocket_do"));
+ mInitMap.put(new Pair<String, String>("func_72606_c", "logWarning"));
+ mInitMap.put(new Pair<String, String>("func_72607_a", "logDebug"));
+ mInitMap.put(new Pair<String, String>("func_72608_b", "closeServerSocket"));
+ mInitMap.put(new Pair<String, String>("func_72609_b", "logInfo"));
+ mInitMap.put(new Pair<String, String>("func_72610_d", "logSevere"));
+ mInitMap.put(new Pair<String, String>("func_72611_e", "closeAllSockets"));
+ mInitMap.put(new Pair<String, String>("func_72612_a", "closeAllSockets_do"));
+ mInitMap.put(new Pair<String, String>("func_72613_c", "isRunning"));
+ mInitMap.put(new Pair<String, String>("func_72620_a", "sendResponsePacket"));
+ mInitMap.put(new Pair<String, String>("func_72621_a", "parseIncomingPacket"));
+ mInitMap.put(new Pair<String, String>("func_72622_d", "sendAuthChallenge"));
+ mInitMap.put(new Pair<String, String>("func_72623_a", "stopWithException"));
+ mInitMap.put(new Pair<String, String>("func_72624_b", "createQueryResponse"));
+ mInitMap.put(new Pair<String, String>("func_72625_a", "getRequestID"));
+ mInitMap.put(new Pair<String, String>("func_72626_g", "initQuerySystem"));
+ mInitMap.put(new Pair<String, String>("func_72627_c", "verifyClientAuth"));
+ mInitMap.put(new Pair<String, String>("func_72628_f", "cleanQueryClientsMap"));
+ mInitMap.put(new Pair<String, String>("func_72645_g", "cleanClientThreadsMap"));
+ mInitMap.put(new Pair<String, String>("func_72646_f", "initClientThreadList"));
+ mInitMap.put(new Pair<String, String>("func_72653_g", "closeSocket"));
+ mInitMap.put(new Pair<String, String>("func_72654_a", "sendResponse"));
+ mInitMap.put(new Pair<String, String>("func_72655_a", "sendMultipacketResponse"));
+ mInitMap.put(new Pair<String, String>("func_72656_f", "sendLoginFailedResponse"));
+ mInitMap.put(new Pair<String, String>("func_72661_a", "getBytesAsString"));
+ mInitMap.put(new Pair<String, String>("func_72662_b", "getRemainingBytesAsLEInt"));
+ mInitMap.put(new Pair<String, String>("func_72663_a", "getByteAsHexString"));
+ mInitMap.put(new Pair<String, String>("func_72664_c", "getBytesAsBEint"));
+ mInitMap.put(new Pair<String, String>("func_72665_b", "getBytesAsLEInt"));
+ mInitMap.put(new Pair<String, String>("func_72667_a", "writeInt"));
+ mInitMap.put(new Pair<String, String>("func_72668_a", "writeShort"));
+ mInitMap.put(new Pair<String, String>("func_72669_b", "reset"));
+ mInitMap.put(new Pair<String, String>("func_72670_a", "writeByteArray"));
+ mInitMap.put(new Pair<String, String>("func_72671_a", "writeString"));
+ mInitMap.put(new Pair<String, String>("func_72672_a", "toByteArray"));
+ mInitMap.put(new Pair<String, String>("func_72683_a", "addPlayer"));
+ mInitMap.put(new Pair<String, String>("func_72684_a", "overlaps"));
+ mInitMap.put(new Pair<String, String>("func_72685_d", "updateMountedMovingPlayer"));
+ mInitMap.put(new Pair<String, String>("func_72686_a", "getFurthestViewableBlock"));
+ mInitMap.put(new Pair<String, String>("func_72688_a", "getMinecraftServer"));
+ mInitMap.put(new Pair<String, String>("func_72690_a", "getPlayerInstance"));
+ mInitMap.put(new Pair<String, String>("func_72691_b", "filterChunkLoadQueue"));
+ mInitMap.put(new Pair<String, String>("func_72693_b", "updatePlayerInstances"));
+ mInitMap.put(new Pair<String, String>("func_72694_a", "isPlayerWatchingChunk"));
+ mInitMap.put(new Pair<String, String>("func_72695_c", "removePlayer"));
+ mInitMap.put(new Pair<String, String>("func_72702_a", "playRecord"));
+ mInitMap.put(new Pair<String, String>("func_72703_a", "onEntityCreate"));
+ mInitMap.put(new Pair<String, String>("func_72704_a", "playSound"));
+ mInitMap.put(new Pair<String, String>("func_72706_a", "playAuxSFX"));
+ mInitMap.put(new Pair<String, String>("func_72708_a", "spawnParticle"));
+ mInitMap.put(new Pair<String, String>("func_72709_b", "onEntityDestroy"));
+ mInitMap.put(new Pair<String, String>("func_72712_a", "loadRenderers"));
+ mInitMap.put(new Pair<String, String>("func_72714_a", "renderSky"));
+ mInitMap.put(new Pair<String, String>("func_72716_a", "updateRenderers"));
+ mInitMap.put(new Pair<String, String>("func_72717_a", "drawBlockDamageTexture"));
+ mInitMap.put(new Pair<String, String>("func_72718_b", "renderClouds"));
+ mInitMap.put(new Pair<String, String>("func_72719_a", "sortAndRender"));
+ mInitMap.put(new Pair<String, String>("func_72720_a", "checkOcclusionQueryResult"));
+ mInitMap.put(new Pair<String, String>("func_72721_a", "hasCloudFog"));
+ mInitMap.put(new Pair<String, String>("func_72722_c", "markRenderersFormInitMap.put(newPosition"));
+ mInitMap.put(new Pair<String, String>("func_72723_d", "getDebugInfoEntities"));
+ mInitMap.put(new Pair<String, String>("func_72724_a", "renderSortedRenderers"));
+ mInitMap.put(new Pair<String, String>("func_72725_b", "markBlocksForUpdate"));
+ mInitMap.put(new Pair<String, String>("func_72726_b", "doSpawnParticle"));
+ mInitMap.put(new Pair<String, String>("func_72728_f", "deleteAllDisplayLists"));
+ mInitMap.put(new Pair<String, String>("func_72729_a", "clipRenderersByFrustum"));
+ mInitMap.put(new Pair<String, String>("func_72730_g", "renderStars"));
+ mInitMap.put(new Pair<String, String>("func_72731_b", "drawSelectionBox"));
+ mInitMap.put(new Pair<String, String>("func_72732_a", "setWorldAndLoadRenderers"));
+ mInitMap.put(new Pair<String, String>("func_72733_a", "renderAllRenderLists"));
+ mInitMap.put(new Pair<String, String>("func_72734_e", "updateClouds"));
+ mInitMap.put(new Pair<String, String>("func_72735_c", "getDebugInfoRenders"));
+ mInitMap.put(new Pair<String, String>("func_72736_c", "renderCloudsFancy"));
+ mInitMap.put(new Pair<String, String>("func_72785_a", "addEntityToTracker"));
+ mInitMap.put(new Pair<String, String>("func_72786_a", "trackEntity"));
+ mInitMap.put(new Pair<String, String>("func_72787_a", "removePlayerFromTrackers"));
+ mInitMap.put(new Pair<String, String>("func_72788_a", "updateTrackedEntities"));
+ mInitMap.put(new Pair<String, String>("func_72790_b", "untrackEntity"));
+ mInitMap.put(new Pair<String, String>("func_72791_a", "trackEntity"));
+ mInitMap.put(new Pair<String, String>("func_72800_K", "getHeight"));
+ mInitMap.put(new Pair<String, String>("func_72801_o", "getLightBrightness"));
+ mInitMap.put(new Pair<String, String>("func_72802_i", "getLightBrightnessForSkyBlocks"));
+ mInitMap.put(new Pair<String, String>("func_72805_g", "getBlockMetadata"));
+ mInitMap.put(new Pair<String, String>("func_72806_N", "extendedLevelsInChunkCache"));
+ mInitMap.put(new Pair<String, String>("func_72807_a", "getBiomeGenForCoords"));
+ mInitMap.put(new Pair<String, String>("func_72810_a", "getSkyBlockTypeBrightness"));
+ mInitMap.put(new Pair<String, String>("func_72812_b", "getSpecialBlockBrightness"));
+ mInitMap.put(new Pair<String, String>("func_72819_i", "getWeightedThunderStrength"));
+ mInitMap.put(new Pair<String, String>("func_72820_D", "getWorldTime"));
+ mInitMap.put(new Pair<String, String>("func_72823_a", "setItemData"));
+ mInitMap.put(new Pair<String, String>("func_72824_f", "getCloudColour"));
+ mInitMap.put(new Pair<String, String>("func_72825_h", "getTopSolidOrLiquidBlock"));
+ mInitMap.put(new Pair<String, String>("func_72826_c", "getCelestialAngle"));
+ mInitMap.put(new Pair<String, String>("func_72827_u", "getProviderName"));
+ mInitMap.put(new Pair<String, String>("func_72828_b", "unloadEntities"));
+ mInitMap.put(new Pair<String, String>("func_72829_c", "checkBlockCollision"));
+ mInitMap.put(new Pair<String, String>("func_72830_b", "isAABBInMaterial"));
+ mInitMap.put(new Pair<String, String>("func_72833_a", "getSkyColor"));
+ mInitMap.put(new Pair<String, String>("func_72834_c", "canBlockFreeze"));
+ mInitMap.put(new Pair<String, String>("func_72835_b", "tick"));
+ mInitMap.put(new Pair<String, String>("func_72838_d", "spawnEntityInWorld"));
+ mInitMap.put(new Pair<String, String>("func_72839_b", "getEntitiesWithinAABBExcludingEntity"));
+ mInitMap.put(new Pair<String, String>("func_72841_b", "getUniqueDataId"));
+ mInitMap.put(new Pair<String, String>("func_72842_a", "getBlockDensity"));
+ mInitMap.put(new Pair<String, String>("func_72843_D", "setRandomSeed"));
+ mInitMap.put(new Pair<String, String>("func_72844_a", "getEntityPathToXYZ"));
+ mInitMap.put(new Pair<String, String>("func_72846_b", "getClosestVulnerablePlayer"));
+ mInitMap.put(new Pair<String, String>("func_72847_b", "onEntityRemoved"));
+ mInitMap.put(new Pair<String, String>("func_72848_b", "removeWorldAccess"));
+ mInitMap.put(new Pair<String, String>("func_72849_a", "getBlockLightValue_do"));
+ mInitMap.put(new Pair<String, String>("func_72850_v", "isBlockFreezableNaturally"));
+ mInitMap.put(new Pair<String, String>("func_72853_d", "getMoonPhase"));
+ mInitMap.put(new Pair<String, String>("func_72854_c", "updateAllPlayersSleepingFlag"));
+ mInitMap.put(new Pair<String, String>("func_72855_b", "checkNoEntityCollision"));
+ mInitMap.put(new Pair<String, String>("func_72856_b", "getClosestVulnerablePlayerToEntity"));
+ mInitMap.put(new Pair<String, String>("func_72857_a", "findNearestEntityWithinAABB"));
+ mInitMap.put(new Pair<String, String>("func_72860_G", "getSaveHandler"));
+ mInitMap.put(new Pair<String, String>("func_72861_E", "getSpawnPoint"));
+ mInitMap.put(new Pair<String, String>("func_72863_F", "getChunkProvider"));
+ mInitMap.put(new Pair<String, String>("func_72864_z", "isBlockIndirectlyGettingPowered"));
+ mInitMap.put(new Pair<String, String>("func_72865_a", "getPathEntityToEntity"));
+ mInitMap.put(new Pair<String, String>("func_72866_a", "updateEntityWithOptionalForce"));
+ mInitMap.put(new Pair<String, String>("func_72867_j", "getRainStrength"));
+ mInitMap.put(new Pair<String, String>("func_72868_a", "addLoadedEntities"));
+ mInitMap.put(new Pair<String, String>("func_72869_a", "spawnParticle"));
+ mInitMap.put(new Pair<String, String>("func_72870_g", "updateEntity"));
+ mInitMap.put(new Pair<String, String>("func_72872_a", "getEntitiesWithinAABB"));
+ mInitMap.put(new Pair<String, String>("func_72873_a", "doChunksNearChunkExist"));
+ mInitMap.put(new Pair<String, String>("func_72874_g", "getPrecipitationHeight"));
+ mInitMap.put(new Pair<String, String>("func_72875_a", "isMaterialInBB"));
+ mInitMap.put(new Pair<String, String>("func_72876_a", "createExplosion"));
+ mInitMap.put(new Pair<String, String>("func_72877_b", "setWorldTime"));
+ mInitMap.put(new Pair<String, String>("func_72878_l", "getIndirectPowerLevelTo"));
+ mInitMap.put(new Pair<String, String>("func_72879_k", "isBlockProvidingPowerTo"));
+ mInitMap.put(new Pair<String, String>("func_72880_h", "getStarBrightness"));
+ mInitMap.put(new Pair<String, String>("func_72882_A", "sendQuittingDisconnectingPacket"));
+ mInitMap.put(new Pair<String, String>("func_72883_k", "getFullBlockLightValue"));
+ mInitMap.put(new Pair<String, String>("func_72884_u", "isBlockFreezable"));
+ mInitMap.put(new Pair<String, String>("func_72885_a", "mInitMap.put(newExplosion"));
+ mInitMap.put(new Pair<String, String>("func_72886_a", "extinguishFire"));
+ mInitMap.put(new Pair<String, String>("func_72889_a", "playAuxSFXAtEntity"));
+ mInitMap.put(new Pair<String, String>("func_72890_a", "getClosestPlayerToEntity"));
+ mInitMap.put(new Pair<String, String>("func_72891_a", "setAllowedSpawnTypes"));
+ mInitMap.put(new Pair<String, String>("func_72894_k", "setRainStrength"));
+ mInitMap.put(new Pair<String, String>("func_72896_J", "isRaining"));
+ mInitMap.put(new Pair<String, String>("func_72897_h", "joinEntityInSurroundings"));
+ mInitMap.put(new Pair<String, String>("func_72899_e", "blockExists"));
+ mInitMap.put(new Pair<String, String>("func_72900_e", "removeEntity"));
+ mInitMap.put(new Pair<String, String>("func_72901_a", "rayTraceBlocks"));
+ mInitMap.put(new Pair<String, String>("func_72903_x", "setActivePlayerChunksAndCheckLight"));
+ mInitMap.put(new Pair<String, String>("func_72904_c", "checkChunksExist"));
+ mInitMap.put(new Pair<String, String>("func_72905_C", "getSeed"));
+ mInitMap.put(new Pair<String, String>("func_72906_B", "checkSessionLock"));
+ mInitMap.put(new Pair<String, String>("func_72907_a", "countEntities"));
+ mInitMap.put(new Pair<String, String>("func_72908_a", "playSoundEffect"));
+ mInitMap.put(new Pair<String, String>("func_72910_y", "getLoadedEntityList"));
+ mInitMap.put(new Pair<String, String>("func_72911_I", "isThundering"));
+ mInitMap.put(new Pair<String, String>("func_72912_H", "getWorldInfo"));
+ mInitMap.put(new Pair<String, String>("func_72914_a", "addWorldInfoToCrashReport"));
+ mInitMap.put(new Pair<String, String>("func_72915_b", "setLightValue"));
+ mInitMap.put(new Pair<String, String>("func_72916_c", "chunkExists"));
+ mInitMap.put(new Pair<String, String>("func_72917_a", "checkNoEntityCollision"));
+ mInitMap.put(new Pair<String, String>("func_72918_a", "handleMaterialAcceleration"));
+ mInitMap.put(new Pair<String, String>("func_72919_O", "getHorizon"));
+ mInitMap.put(new Pair<String, String>("func_72920_a", "getPendingBlockUpdates"));
+ mInitMap.put(new Pair<String, String>("func_72921_c", "setBlockMetadataWithNotify"));
+ mInitMap.put(new Pair<String, String>("func_72923_a", "onEntityAdded"));
+ mInitMap.put(new Pair<String, String>("func_72924_a", "getPlayerEntityByName"));
+ mInitMap.put(new Pair<String, String>("func_72925_a", "getSkyBlockTypeBrightness"));
+ mInitMap.put(new Pair<String, String>("func_72926_e", "playAuxSFX"));
+ mInitMap.put(new Pair<String, String>("func_72929_e", "getCelestialAngleRadians"));
+ mInitMap.put(new Pair<String, String>("func_72933_a", "rayTraceBlocks"));
+ mInitMap.put(new Pair<String, String>("func_72934_a", "playRecord"));
+ mInitMap.put(new Pair<String, String>("func_72935_r", "isDaytime"));
+ mInitMap.put(new Pair<String, String>("func_72937_j", "canBlockSeeTheSky"));
+ mInitMap.put(new Pair<String, String>("func_72938_d", "getChunkFromBlockCoords"));
+ mInitMap.put(new Pair<String, String>("func_72939_s", "updateEntities"));
+ mInitMap.put(new Pair<String, String>("func_72940_L", "getActualHeight"));
+ mInitMap.put(new Pair<String, String>("func_72942_c", "addWeatherEffect"));
+ mInitMap.put(new Pair<String, String>("func_72943_a", "loadItemData"));
+ mInitMap.put(new Pair<String, String>("func_72945_a", "getCollidingBoundingBoxes"));
+ mInitMap.put(new Pair<String, String>("func_72947_a", "calculateInitialWeather"));
+ mInitMap.put(new Pair<String, String>("func_72948_g", "getFogColor"));
+ mInitMap.put(new Pair<String, String>("func_72950_A", "setSpawnLocation"));
+ mInitMap.put(new Pair<String, String>("func_72951_B", "isRainingAt"));
+ mInitMap.put(new Pair<String, String>("func_72953_d", "isAnyLiquid"));
+ mInitMap.put(new Pair<String, String>("func_72954_a", "addWorldAccess"));
+ mInitMap.put(new Pair<String, String>("func_72955_a", "tickUpdates"));
+ mInitMap.put(new Pair<String, String>("func_72956_a", "playSoundAtEntity"));
+ mInitMap.put(new Pair<String, String>("func_72957_l", "getBlockLightValue"));
+ mInitMap.put(new Pair<String, String>("func_72958_C", "isBlockHighHumidity"));
+ mInitMap.put(new Pair<String, String>("func_72959_q", "getWorldChunkManager"));
+ mInitMap.put(new Pair<String, String>("func_72960_a", "setEntityState"));
+ mInitMap.put(new Pair<String, String>("func_72962_a", "canMineBlock"));
+ mInitMap.put(new Pair<String, String>("func_72963_a", "initialize"));
+ mInitMap.put(new Pair<String, String>("func_72964_e", "getChunkFromChunkCoords"));
+ mInitMap.put(new Pair<String, String>("func_72966_v", "calculateInitialSkylight"));
+ mInitMap.put(new Pair<String, String>("func_72967_a", "calculateSkylightSubtracted"));
+ mInitMap.put(new Pair<String, String>("func_72970_h", "createChunkProvider"));
+ mInitMap.put(new Pair<String, String>("func_72971_b", "getSunBrightness"));
+ mInitMap.put(new Pair<String, String>("func_72972_b", "getSavedLightValue"));
+ mInitMap.put(new Pair<String, String>("func_72973_f", "removePlayerEntityDangerously"));
+ mInitMap.put(new Pair<String, String>("func_72974_f", "setSpawnLocation"));
+ mInitMap.put(new Pair<String, String>("func_72975_g", "markBlocksDirtyVertical"));
+ mInitMap.put(new Pair<String, String>("func_72976_f", "getHeightValue"));
+ mInitMap.put(new Pair<String, String>("func_72977_a", "getClosestPlayer"));
+ mInitMap.put(new Pair<String, String>("func_72979_l", "updateWeather"));
+ mInitMap.put(new Pair<String, String>("func_72980_b", "playSound"));
+ mInitMap.put(new Pair<String, String>("func_72981_t", "getDebugLoadedEntities"));
+ mInitMap.put(new Pair<String, String>("func_73022_a", "removeAllEntities"));
+ mInitMap.put(new Pair<String, String>("func_73025_a", "doPreChunk"));
+ mInitMap.put(new Pair<String, String>("func_73027_a", "addEntityToWorld"));
+ mInitMap.put(new Pair<String, String>("func_73028_b", "removeEntityFromWorld"));
+ mInitMap.put(new Pair<String, String>("func_73029_E", "doVoidFogParticles"));
+ mInitMap.put(new Pair<String, String>("func_73031_a", "invalidateBlockReceiveRegion"));
+ mInitMap.put(new Pair<String, String>("func_73039_n", "getEntityTracker"));
+ mInitMap.put(new Pair<String, String>("func_73040_p", "getPlayerManager"));
+ mInitMap.put(new Pair<String, String>("func_73041_k", "flush"));
+ mInitMap.put(new Pair<String, String>("func_73042_a", "saveLevel"));
+ mInitMap.put(new Pair<String, String>("func_73044_a", "saveAllChunks"));
+ mInitMap.put(new Pair<String, String>("func_73045_a", "getEntityByID"));
+ mInitMap.put(new Pair<String, String>("func_73047_i", "createBonusChest"));
+ mInitMap.put(new Pair<String, String>("func_73051_P", "resetRainAndThunder"));
+ mInitMap.put(new Pair<String, String>("func_73052_b", "createSpawnPosition"));
+ mInitMap.put(new Pair<String, String>("func_73053_d", "wakeAllPlayers"));
+ mInitMap.put(new Pair<String, String>("func_73054_j", "getEntrancePortalLocation"));
+ mInitMap.put(new Pair<String, String>("func_73056_e", "areAllPlayersAsleep"));
+ mInitMap.put(new Pair<String, String>("func_73057_a", "spawnRandomCreature"));
+ mInitMap.put(new Pair<String, String>("func_73073_c", "cancelDestroyingBlock"));
+ mInitMap.put(new Pair<String, String>("func_73074_a", "onBlockClicked"));
+ mInitMap.put(new Pair<String, String>("func_73075_a", "updateBlockRemoving"));
+ mInitMap.put(new Pair<String, String>("func_73076_a", "setGameType"));
+ mInitMap.put(new Pair<String, String>("func_73077_b", "initializeGameType"));
+ mInitMap.put(new Pair<String, String>("func_73078_a", "activateBlockOrUseItem"));
+ mInitMap.put(new Pair<String, String>("func_73079_d", "removeBlock"));
+ mInitMap.put(new Pair<String, String>("func_73080_a", "setWorld"));
+ mInitMap.put(new Pair<String, String>("func_73081_b", "getGameType"));
+ mInitMap.put(new Pair<String, String>("func_73082_a", "blockRemoving"));
+ mInitMap.put(new Pair<String, String>("func_73083_d", "isCreative"));
+ mInitMap.put(new Pair<String, String>("func_73084_b", "tryHarvestBlock"));
+ mInitMap.put(new Pair<String, String>("func_73085_a", "tryUseItem"));
+ mInitMap.put(new Pair<String, String>("func_73101_e", "sendDemoReminder"));
+ mInitMap.put(new Pair<String, String>("func_73106_e", "getPartialBlockDamage"));
+ mInitMap.put(new Pair<String, String>("func_73107_a", "setPartialBlockDamage"));
+ mInitMap.put(new Pair<String, String>("func_73108_d", "getPartialBlockZ"));
+ mInitMap.put(new Pair<String, String>("func_73109_c", "getPartialBlockY"));
+ mInitMap.put(new Pair<String, String>("func_73110_b", "getPartialBlockX"));
+ mInitMap.put(new Pair<String, String>("func_73117_b", "updatePlayerEntity"));
+ mInitMap.put(new Pair<String, String>("func_73118_a", "removeFromTrackedPlayers"));
+ mInitMap.put(new Pair<String, String>("func_73119_a", "sendDestroyEntityPacketToTrackedPlayers"));
+ mInitMap.put(new Pair<String, String>("func_73121_d", "isPlayerWatchingThisChunk"));
+ mInitMap.put(new Pair<String, String>("func_73122_a", "updatePlayerList"));
+ mInitMap.put(new Pair<String, String>("func_73123_c", "removeTrackedPlayerSymmetric"));
+ mInitMap.put(new Pair<String, String>("func_73125_b", "updatePlayerEntities"));
+ mInitMap.put(new Pair<String, String>("func_73148_d", "makeString"));
+ mInitMap.put(new Pair<String, String>("func_73149_a", "chunkExists"));
+ mInitMap.put(new Pair<String, String>("func_73151_a", "saveChunks"));
+ mInitMap.put(new Pair<String, String>("func_73152_e", "getLoadedChunkCount"));
+ mInitMap.put(new Pair<String, String>("func_73153_a", "populate"));
+ mInitMap.put(new Pair<String, String>("func_73154_d", "provideChunk"));
+ mInitMap.put(new Pair<String, String>("func_73155_a", "getPossibleCreatures"));
+ mInitMap.put(new Pair<String, String>("func_73156_b", "unloadQueuedChunks"));
+ mInitMap.put(new Pair<String, String>("func_73157_c", "canSave"));
+ mInitMap.put(new Pair<String, String>("func_73158_c", "loadChunk"));
+ mInitMap.put(new Pair<String, String>("func_73164_a", "initializeNoiseField"));
+ mInitMap.put(new Pair<String, String>("func_73187_a", "initializeNoiseField"));
+ mInitMap.put(new Pair<String, String>("func_73234_b", "unloadChunk"));
+ mInitMap.put(new Pair<String, String>("func_73239_e", "loadChunkFromFile"));
+ mInitMap.put(new Pair<String, String>("func_73240_a", "unloadAllChunks"));
+ mInitMap.put(new Pair<String, String>("func_73241_b", "dropChunk"));
+ mInitMap.put(new Pair<String, String>("func_73242_b", "saveChunkData"));
+ mInitMap.put(new Pair<String, String>("func_73243_a", "saveChunkExtraData"));
+ mInitMap.put(new Pair<String, String>("func_73252_b", "removePlayer"));
+ mInitMap.put(new Pair<String, String>("func_73254_a", "onUpdate"));
+ mInitMap.put(new Pair<String, String>("func_73255_a", "addPlayer"));
+ mInitMap.put(new Pair<String, String>("func_73660_a", "update"));
+ mInitMap.put(new Pair<String, String>("func_73665_c", "getPropertiesFile"));
+ mInitMap.put(new Pair<String, String>("func_73666_a", "generatemInitMap.put(newProperties"));
+ mInitMap.put(new Pair<String, String>("func_73667_a", "setProperty"));
+ mInitMap.put(new Pair<String, String>("func_73668_b", "saveProperties"));
+ mInitMap.put(new Pair<String, String>("func_73669_a", "getIntProperty"));
+ mInitMap.put(new Pair<String, String>("func_73670_a", "getBooleanProperty"));
+ mInitMap.put(new Pair<String, String>("func_73671_a", "getStringProperty"));
+ mInitMap.put(new Pair<String, String>("func_73680_d", "getBanEndDate"));
+ mInitMap.put(new Pair<String, String>("func_73682_e", "hasBanExpired"));
+ mInitMap.put(new Pair<String, String>("func_73686_f", "getBanReason"));
+ mInitMap.put(new Pair<String, String>("func_73718_a", "setLoadingProgress"));
+ mInitMap.put(new Pair<String, String>("func_73719_c", "displayLoadingString"));
+ mInitMap.put(new Pair<String, String>("func_73720_a", "displaySavingString"));
+ mInitMap.put(new Pair<String, String>("func_73721_b", "resetProgressAndMessage"));
+ mInitMap.put(new Pair<String, String>("func_73728_b", "drawVerticalLine"));
+ mInitMap.put(new Pair<String, String>("func_73729_b", "drawTexturedModalRect"));
+ mInitMap.put(new Pair<String, String>("func_73730_a", "drawHorizontalLine"));
+ mInitMap.put(new Pair<String, String>("func_73731_b", "drawString"));
+ mInitMap.put(new Pair<String, String>("func_73732_a", "drawCenteredString"));
+ mInitMap.put(new Pair<String, String>("func_73733_a", "drawGradientRect"));
+ mInitMap.put(new Pair<String, String>("func_73734_a", "drawRect"));
+ mInitMap.put(new Pair<String, String>("func_73828_d", "renderBossHealth"));
+ mInitMap.put(new Pair<String, String>("func_73829_a", "renderVignette"));
+ mInitMap.put(new Pair<String, String>("func_73830_a", "renderGameOverlay"));
+ mInitMap.put(new Pair<String, String>("func_73831_a", "updateTick"));
+ mInitMap.put(new Pair<String, String>("func_73832_a", "renderInventorySlot"));
+ mInitMap.put(new Pair<String, String>("func_73833_a", "setRecordPlayingMessage"));
+ mInitMap.put(new Pair<String, String>("func_73834_c", "getUpdateCounter"));
+ mInitMap.put(new Pair<String, String>("func_73836_a", "renderPumpkinBlur"));
+ mInitMap.put(new Pair<String, String>("func_73863_a", "drawScreen"));
+ mInitMap.put(new Pair<String, String>("func_73864_a", "mouseClicked"));
+ mInitMap.put(new Pair<String, String>("func_73866_w_", "initGui"));
+ mInitMap.put(new Pair<String, String>("func_73868_f", "doesGuiPauseGame"));
+ mInitMap.put(new Pair<String, String>("func_73869_a", "keyTyped"));
+ mInitMap.put(new Pair<String, String>("func_73876_c", "updateScreen"));
+ mInitMap.put(new Pair<String, String>("func_73878_a", "confirmClicked"));
+ mInitMap.put(new Pair<String, String>("func_73968_a", "rotateAndBlurSkybox"));
+ mInitMap.put(new Pair<String, String>("func_73969_a", "addSingleplayerMultiplayerButtons"));
+ mInitMap.put(new Pair<String, String>("func_73970_b", "drawPanorama"));
+ mInitMap.put(new Pair<String, String>("func_73971_c", "renderSkybox"));
+ mInitMap.put(new Pair<String, String>("func_73972_b", "addDemoButtons"));
+ mInitMap.put(new Pair<String, String>("func_74275_a", "updateTimer"));
+ mInitMap.put(new Pair<String, String>("func_74290_a", "getTimestampedPNGFileForDirectory"));
+ mInitMap.put(new Pair<String, String>("func_74296_a", "getOptionFloatValue"));
+ mInitMap.put(new Pair<String, String>("func_74297_c", "getKeyBinding"));
+ mInitMap.put(new Pair<String, String>("func_74298_c", "getKeyDisplayString"));
+ mInitMap.put(new Pair<String, String>("func_74299_a", "getTranslation"));
+ mInitMap.put(new Pair<String, String>("func_74300_a", "loadOptions"));
+ mInitMap.put(new Pair<String, String>("func_74303_b", "saveOptions"));
+ mInitMap.put(new Pair<String, String>("func_74304_a", "setOptionFloatValue"));
+ mInitMap.put(new Pair<String, String>("func_74305_a", "parseFloat"));
+ mInitMap.put(new Pair<String, String>("func_74306_a", "setOptionValue"));
+ mInitMap.put(new Pair<String, String>("func_74308_b", "getOptionOrdinalValue"));
+ mInitMap.put(new Pair<String, String>("func_74309_c", "shouldRenderClouds"));
+ mInitMap.put(new Pair<String, String>("func_74371_a", "checkARBOcclusion"));
+ mInitMap.put(new Pair<String, String>("func_74372_a", "grabMouseCursor"));
+ mInitMap.put(new Pair<String, String>("func_74373_b", "ungrabMouseCursor"));
+ mInitMap.put(new Pair<String, String>("func_74374_c", "mouseXYChange"));
+ mInitMap.put(new Pair<String, String>("func_74378_d", "getEnumString"));
+ mInitMap.put(new Pair<String, String>("func_74379_a", "getEnumOptions"));
+ mInitMap.put(new Pair<String, String>("func_74380_a", "getEnumFloat"));
+ mInitMap.put(new Pair<String, String>("func_74381_c", "returnEnumOrdinal"));
+ mInitMap.put(new Pair<String, String>("func_74382_b", "getEnumBoolean"));
+ mInitMap.put(new Pair<String, String>("func_74428_b", "processReceivedPackets"));
+ mInitMap.put(new Pair<String, String>("func_74430_c", "getRemoteAddress"));
+ mInitMap.put(new Pair<String, String>("func_74505_d", "unpressKey"));
+ mInitMap.put(new Pair<String, String>("func_74506_a", "unPressAllKeys"));
+ mInitMap.put(new Pair<String, String>("func_74507_a", "onTick"));
+ mInitMap.put(new Pair<String, String>("func_74508_b", "resetKeyBindingArrayAndHash"));
+ mInitMap.put(new Pair<String, String>("func_74510_a", "setKeyBindState"));
+ mInitMap.put(new Pair<String, String>("func_74517_a", "setColorBuffer"));
+ mInitMap.put(new Pair<String, String>("func_74518_a", "disableStandardItemLighting"));
+ mInitMap.put(new Pair<String, String>("func_74519_b", "enableStandardItemLighting"));
+ mInitMap.put(new Pair<String, String>("func_74520_c", "enableGUIStandardItemLighting"));
+ mInitMap.put(new Pair<String, String>("func_74521_a", "setColorBuffer"));
+ mInitMap.put(new Pair<String, String>("func_74523_b", "deleteDisplayLists"));
+ mInitMap.put(new Pair<String, String>("func_74524_c", "createDirectByteBuffer"));
+ mInitMap.put(new Pair<String, String>("func_74525_a", "deleteTexturesAndDisplayLists"));
+ mInitMap.put(new Pair<String, String>("func_74526_a", "generateDisplayLists"));
+ mInitMap.put(new Pair<String, String>("func_74527_f", "createDirectIntBuffer"));
+ mInitMap.put(new Pair<String, String>("func_74529_h", "createDirectFloatBuffer"));
+ mInitMap.put(new Pair<String, String>("func_74535_a", "formatString"));
+ mInitMap.put(new Pair<String, String>("func_74539_c", "getChatLineID"));
+ mInitMap.put(new Pair<String, String>("func_74540_b", "getUpdatedCounter"));
+ mInitMap.put(new Pair<String, String>("func_74583_a", "updateRenderInfo"));
+ mInitMap.put(new Pair<String, String>("func_74585_b", "projectViewFromEntity"));
+ mInitMap.put(new Pair<String, String>("func_74732_a", "getId"));
+ mInitMap.put(new Pair<String, String>("func_74734_a", "write"));
+ mInitMap.put(new Pair<String, String>("func_74737_b", "copy"));
+ mInitMap.put(new Pair<String, String>("func_74742_a", "appendTag"));
+ mInitMap.put(new Pair<String, String>("func_74744_a", "removeTag"));
+ mInitMap.put(new Pair<String, String>("func_74745_c", "tagCount"));
+ mInitMap.put(new Pair<String, String>("func_74757_a", "setBoolean"));
+ mInitMap.put(new Pair<String, String>("func_74759_k", "getIntArray"));
+ mInitMap.put(new Pair<String, String>("func_74760_g", "getFloat"));
+ mInitMap.put(new Pair<String, String>("func_74762_e", "getInteger"));
+ mInitMap.put(new Pair<String, String>("func_74763_f", "getLong"));
+ mInitMap.put(new Pair<String, String>("func_74764_b", "hasKey"));
+ mInitMap.put(new Pair<String, String>("func_74765_d", "getShort"));
+ mInitMap.put(new Pair<String, String>("func_74767_n", "getBoolean"));
+ mInitMap.put(new Pair<String, String>("func_74768_a", "setInteger"));
+ mInitMap.put(new Pair<String, String>("func_74769_h", "getDouble"));
+ mInitMap.put(new Pair<String, String>("func_74770_j", "getByteArray"));
+ mInitMap.put(new Pair<String, String>("func_74771_c", "getByte"));
+ mInitMap.put(new Pair<String, String>("func_74772_a", "setLong"));
+ mInitMap.put(new Pair<String, String>("func_74773_a", "setByteArray"));
+ mInitMap.put(new Pair<String, String>("func_74774_a", "setByte"));
+ mInitMap.put(new Pair<String, String>("func_74775_l", "getCompoundTag"));
+ mInitMap.put(new Pair<String, String>("func_74776_a", "setFloat"));
+ mInitMap.put(new Pair<String, String>("func_74777_a", "setShort"));
+ mInitMap.put(new Pair<String, String>("func_74778_a", "setString"));
+ mInitMap.put(new Pair<String, String>("func_74779_i", "getString"));
+ mInitMap.put(new Pair<String, String>("func_74780_a", "setDouble"));
+ mInitMap.put(new Pair<String, String>("func_74781_a", "getTag"));
+ mInitMap.put(new Pair<String, String>("func_74782_a", "setTag"));
+ mInitMap.put(new Pair<String, String>("func_74783_a", "setIntArray"));
+ mInitMap.put(new Pair<String, String>("func_74793_a", "safeWrite"));
+ mInitMap.put(new Pair<String, String>("func_74794_a", "read"));
+ mInitMap.put(new Pair<String, String>("func_74795_b", "write"));
+ mInitMap.put(new Pair<String, String>("func_74796_a", "readCompressed"));
+ mInitMap.put(new Pair<String, String>("func_74797_a", "read"));
+ mInitMap.put(new Pair<String, String>("func_74798_a", "compress"));
+ mInitMap.put(new Pair<String, String>("func_74799_a", "writeCompressed"));
+ mInitMap.put(new Pair<String, String>("func_74800_a", "write"));
+ mInitMap.put(new Pair<String, String>("func_74803_a", "translateKeyFormat"));
+ mInitMap.put(new Pair<String, String>("func_74805_b", "translateKey"));
+ mInitMap.put(new Pair<String, String>("func_74808_a", "getInstance"));
+ mInitMap.put(new Pair<String, String>("func_74837_a", "translateToLocalFormatted"));
+ mInitMap.put(new Pair<String, String>("func_74838_a", "translateToLocal"));
+ mInitMap.put(new Pair<String, String>("func_74844_a", "getErrorOjbects"));
+ mInitMap.put(new Pair<String, String>("func_74860_a", "isLiquidInStructureBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_74861_a", "buildComponent"));
+ mInitMap.put(new Pair<String, String>("func_74862_a", "getYWithOffset"));
+ mInitMap.put(new Pair<String, String>("func_74865_a", "getXWithOffset"));
+ mInitMap.put(new Pair<String, String>("func_74869_a", "generateStructureDispenserContents"));
+ mInitMap.put(new Pair<String, String>("func_74871_b", "clearCurrentPositionBlocksUpwards"));
+ mInitMap.put(new Pair<String, String>("func_74873_b", "getZWithOffset"));
+ mInitMap.put(new Pair<String, String>("func_74874_b", "getBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_74875_a", "addComponentParts"));
+ mInitMap.put(new Pair<String, String>("func_74877_c", "getComponentType"));
+ mInitMap.put(new Pair<String, String>("func_74878_a", "fillWithAir"));
+ mInitMap.put(new Pair<String, String>("func_74879_a", "generateStructureChestContents"));
+ mInitMap.put(new Pair<String, String>("func_74881_a", "placeDoorAtCurrentPosition"));
+ mInitMap.put(new Pair<String, String>("func_74882_a", "fillWithRandomizedBlocks"));
+ mInitMap.put(new Pair<String, String>("func_74883_a", "findIntersecting"));
+ mInitMap.put(new Pair<String, String>("func_74888_b", "getVillagerType"));
+ mInitMap.put(new Pair<String, String>("func_74889_b", "getAverageGroundLevel"));
+ mInitMap.put(new Pair<String, String>("func_74891_a", "getNextComponentNN"));
+ mInitMap.put(new Pair<String, String>("func_74893_a", "spawnVillagers"));
+ mInitMap.put(new Pair<String, String>("func_74894_b", "getNextComponentPP"));
+ mInitMap.put(new Pair<String, String>("func_74895_a", "canVillageGoDeeper"));
+ mInitMap.put(new Pair<String, String>("func_74925_d", "getWorldChunkManager"));
+ mInitMap.put(new Pair<String, String>("func_74950_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_74951_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_74954_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_74959_a", "getNextComponent"));
+ mInitMap.put(new Pair<String, String>("func_74960_a", "getTotalWeight"));
+ mInitMap.put(new Pair<String, String>("func_74961_b", "getNextComponentX"));
+ mInitMap.put(new Pair<String, String>("func_74962_a", "getNextComponent"));
+ mInitMap.put(new Pair<String, String>("func_74963_a", "getNextComponentNormal"));
+ mInitMap.put(new Pair<String, String>("func_74964_a", "isAboveGround"));
+ mInitMap.put(new Pair<String, String>("func_74965_c", "getNextComponentZ"));
+ mInitMap.put(new Pair<String, String>("func_74966_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74973_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74974_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74975_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74977_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74978_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74979_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74980_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74981_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74982_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74983_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74984_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74985_a", "createValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_74986_a", "getNextComponentNormal"));
+ mInitMap.put(new Pair<String, String>("func_74987_c", "getNextComponentZ"));
+ mInitMap.put(new Pair<String, String>("func_74988_a", "getRandomDoor"));
+ mInitMap.put(new Pair<String, String>("func_74989_b", "getNextComponentX"));
+ mInitMap.put(new Pair<String, String>("func_74990_a", "placeDoor"));
+ mInitMap.put(new Pair<String, String>("func_74991_a", "canStrongholdGoDeeper"));
+ mInitMap.put(new Pair<String, String>("func_74994_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_75000_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_75004_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_75006_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_75010_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_75012_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_75016_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_75018_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_75022_a", "getStrongholdStairsComponent"));
+ mInitMap.put(new Pair<String, String>("func_75028_a", "findValidPlacement"));
+ mInitMap.put(new Pair<String, String>("func_75047_a", "canSpawnStructureAtCoords"));
+ mInitMap.put(new Pair<String, String>("func_75048_a", "hasStructureAt"));
+ mInitMap.put(new Pair<String, String>("func_75049_b", "getStructureStart"));
+ mInitMap.put(new Pair<String, String>("func_75051_a", "generateStructuresInChunk"));
+ mInitMap.put(new Pair<String, String>("func_75052_o_", "getCoordList"));
+ mInitMap.put(new Pair<String, String>("func_75059_a", "getSpawnList"));
+ mInitMap.put(new Pair<String, String>("func_75062_a", "selectBlocks"));
+ mInitMap.put(new Pair<String, String>("func_75064_b", "getSelectedBlockMetaData"));
+ mInitMap.put(new Pair<String, String>("func_75067_a", "markAvailableHeight"));
+ mInitMap.put(new Pair<String, String>("func_75068_a", "generateStructure"));
+ mInitMap.put(new Pair<String, String>("func_75069_d", "isSizeableStructure"));
+ mInitMap.put(new Pair<String, String>("func_75070_a", "setRandomHeight"));
+ mInitMap.put(new Pair<String, String>("func_75071_a", "getBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_75072_c", "updateBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_75073_b", "getComponents"));
+ mInitMap.put(new Pair<String, String>("func_75077_d", "getNextVillageStructureComponent"));
+ mInitMap.put(new Pair<String, String>("func_75080_e", "getNextComponentVillagePath"));
+ mInitMap.put(new Pair<String, String>("func_75081_c", "getNextVillageComponent"));
+ mInitMap.put(new Pair<String, String>("func_75084_a", "getStructureVillageWeightedPieceList"));
+ mInitMap.put(new Pair<String, String>("func_75085_a", "canSpawnMoreVillagePiecesOfType"));
+ mInitMap.put(new Pair<String, String>("func_75086_a", "canSpawnMoreVillagePieces"));
+ mInitMap.put(new Pair<String, String>("func_75091_a", "writeCapabilitiesToNBT"));
+ mInitMap.put(new Pair<String, String>("func_75092_a", "setFlySpeed"));
+ mInitMap.put(new Pair<String, String>("func_75093_a", "getFlySpeed"));
+ mInitMap.put(new Pair<String, String>("func_75094_b", "getWalkSpeed"));
+ mInitMap.put(new Pair<String, String>("func_75095_b", "readCapabilitiesFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_75112_a", "readNBT"));
+ mInitMap.put(new Pair<String, String>("func_75113_a", "addExhaustion"));
+ mInitMap.put(new Pair<String, String>("func_75114_a", "setFoodLevel"));
+ mInitMap.put(new Pair<String, String>("func_75115_e", "getSaturationLevel"));
+ mInitMap.put(new Pair<String, String>("func_75116_a", "getFoodLevel"));
+ mInitMap.put(new Pair<String, String>("func_75117_b", "writeNBT"));
+ mInitMap.put(new Pair<String, String>("func_75118_a", "onUpdate"));
+ mInitMap.put(new Pair<String, String>("func_75119_b", "setFoodSaturationLevel"));
+ mInitMap.put(new Pair<String, String>("func_75120_b", "getPrevFoodLevel"));
+ mInitMap.put(new Pair<String, String>("func_75121_c", "needFood"));
+ mInitMap.put(new Pair<String, String>("func_75122_a", "addStats"));
+ mInitMap.put(new Pair<String, String>("func_75128_a", "setCanCraft"));
+ mInitMap.put(new Pair<String, String>("func_75129_b", "getCanCraft"));
+ mInitMap.put(new Pair<String, String>("func_75130_a", "onCraftMatrixChanged"));
+ mInitMap.put(new Pair<String, String>("func_75131_a", "putStacksInSlots"));
+ mInitMap.put(new Pair<String, String>("func_75132_a", "onCraftGuiOpened"));
+ mInitMap.put(new Pair<String, String>("func_75133_b", "retrySlotClick"));
+ mInitMap.put(new Pair<String, String>("func_75134_a", "onContainerClosed"));
+ mInitMap.put(new Pair<String, String>("func_75135_a", "mergeItemStack"));
+ mInitMap.put(new Pair<String, String>("func_75136_a", "getNextTransactionID"));
+ mInitMap.put(new Pair<String, String>("func_75137_b", "updateProgressBar"));
+ mInitMap.put(new Pair<String, String>("func_75138_a", "getInventory"));
+ mInitMap.put(new Pair<String, String>("func_75139_a", "getSlot"));
+ mInitMap.put(new Pair<String, String>("func_75140_a", "enchantItem"));
+ mInitMap.put(new Pair<String, String>("func_75141_a", "putStackInSlot"));
+ mInitMap.put(new Pair<String, String>("func_75142_b", "detectAndSendChanges"));
+ mInitMap.put(new Pair<String, String>("func_75144_a", "slotClick"));
+ mInitMap.put(new Pair<String, String>("func_75145_c", "canInteractWith"));
+ mInitMap.put(new Pair<String, String>("func_75146_a", "addSlotToContainer"));
+ mInitMap.put(new Pair<String, String>("func_75147_a", "getSlotFromInventory"));
+ mInitMap.put(new Pair<String, String>("func_75174_d", "getMerchantInventory"));
+ mInitMap.put(new Pair<String, String>("func_75175_c", "setCurrentRecipeIndex"));
+ mInitMap.put(new Pair<String, String>("func_75189_a", "canSpawnMoreStructuresOfType"));
+ mInitMap.put(new Pair<String, String>("func_75190_a", "canSpawnMoreStructures"));
+ mInitMap.put(new Pair<String, String>("func_75196_c", "getNextValidComponent"));
+ mInitMap.put(new Pair<String, String>("func_75198_a", "prepareStructurePieces"));
+ mInitMap.put(new Pair<String, String>("func_75200_a", "getStrongholdComponentFromWeightedPiece"));
+ mInitMap.put(new Pair<String, String>("func_75201_b", "getNextComponent"));
+ mInitMap.put(new Pair<String, String>("func_75202_c", "canAddStructurePieces"));
+ mInitMap.put(new Pair<String, String>("func_75208_c", "onCrafting"));
+ mInitMap.put(new Pair<String, String>("func_75209_a", "decrStackSize"));
+ mInitMap.put(new Pair<String, String>("func_75210_a", "onCrafting"));
+ mInitMap.put(new Pair<String, String>("func_75211_c", "getStack"));
+ mInitMap.put(new Pair<String, String>("func_75212_b", "getBackgroundIconIndex"));
+ mInitMap.put(new Pair<String, String>("func_75214_a", "isItemValid"));
+ mInitMap.put(new Pair<String, String>("func_75215_d", "putStack"));
+ mInitMap.put(new Pair<String, String>("func_75216_d", "getHasStack"));
+ mInitMap.put(new Pair<String, String>("func_75217_a", "isHere"));
+ mInitMap.put(new Pair<String, String>("func_75218_e", "onSlotChanged"));
+ mInitMap.put(new Pair<String, String>("func_75219_a", "getSlotStackLimit"));
+ mInitMap.put(new Pair<String, String>("func_75220_a", "onSlotChange"));
+ mInitMap.put(new Pair<String, String>("func_75230_a", "doTrade"));
+ mInitMap.put(new Pair<String, String>("func_75243_a_", "canHoldPotion"));
+ mInitMap.put(new Pair<String, String>("func_75246_d", "updateTask"));
+ mInitMap.put(new Pair<String, String>("func_75247_h", "getMutexBits"));
+ mInitMap.put(new Pair<String, String>("func_75248_a", "setMutexBits"));
+ mInitMap.put(new Pair<String, String>("func_75249_e", "startExecuting"));
+ mInitMap.put(new Pair<String, String>("func_75250_a", "shouldExecute"));
+ mInitMap.put(new Pair<String, String>("func_75251_c", "resetTask"));
+ mInitMap.put(new Pair<String, String>("func_75252_g", "isInterruptible"));
+ mInitMap.put(new Pair<String, String>("func_75253_b", "continueExecuting"));
+ mInitMap.put(new Pair<String, String>("func_75270_a", "setSitting"));
+ mInitMap.put(new Pair<String, String>("func_75277_f", "isRunning"));
+ mInitMap.put(new Pair<String, String>("func_75295_a", "canEasilyReach"));
+ mInitMap.put(new Pair<String, String>("func_75296_a", "isSuitableTarget"));
+ mInitMap.put(new Pair<String, String>("func_75366_f", "findPossibleShelter"));
+ mInitMap.put(new Pair<String, String>("func_75382_a", "hasPlayerGotBoneInHand"));
+ mInitMap.put(new Pair<String, String>("func_75388_i", "spawnBaby"));
+ mInitMap.put(new Pair<String, String>("func_75389_f", "getNearbyMate"));
+ mInitMap.put(
+ new Pair<String, String>("func_75446_f", "checkSufficientDoorsPresentFormInitMap.put(newVillager"));
+ mInitMap.put(new Pair<String, String>("func_75447_i", "giveBirth"));
+ mInitMap.put(new Pair<String, String>("func_75461_b", "findRandomTargetBlockAwayFrom"));
+ mInitMap.put(new Pair<String, String>("func_75462_c", "findRandomTargetBlock"));
+ mInitMap.put(new Pair<String, String>("func_75463_a", "findRandomTarget"));
+ mInitMap.put(new Pair<String, String>("func_75464_a", "findRandomTargetBlockTowards"));
+ mInitMap.put(new Pair<String, String>("func_75466_d", "resetDoorOpeningRestrictionCounter"));
+ mInitMap.put(new Pair<String, String>("func_75467_a", "isInside"));
+ mInitMap.put(new Pair<String, String>("func_75468_f", "getDoorOpeningRestrictionCounter"));
+ mInitMap.put(new Pair<String, String>("func_75469_c", "getInsideDistanceSquare"));
+ mInitMap.put(new Pair<String, String>("func_75470_e", "incrementDoorOpeningRestrictionCounter"));
+ mInitMap.put(new Pair<String, String>("func_75471_a", "getInsidePosX"));
+ mInitMap.put(new Pair<String, String>("func_75472_c", "getInsidePosZ"));
+ mInitMap.put(new Pair<String, String>("func_75473_b", "getInsidePosY"));
+ mInitMap.put(new Pair<String, String>("func_75474_b", "getDistanceSquared"));
+ mInitMap.put(new Pair<String, String>("func_75483_a", "isSafeToStandAt"));
+ mInitMap.put(new Pair<String, String>("func_75484_a", "setPath"));
+ mInitMap.put(new Pair<String, String>("func_75485_k", "canNavigate"));
+ mInitMap.put(new Pair<String, String>("func_75486_a", "getAvoidsWater"));
+ mInitMap.put(new Pair<String, String>("func_75487_m", "removeSunnyPath"));
+ mInitMap.put(new Pair<String, String>("func_75488_a", "getPathToXYZ"));
+ mInitMap.put(new Pair<String, String>("func_75489_a", "setSpeed"));
+ mInitMap.put(new Pair<String, String>("func_75490_c", "setEnterDoors"));
+ mInitMap.put(new Pair<String, String>("func_75491_a", "setAvoidsWater"));
+ mInitMap.put(new Pair<String, String>("func_75492_a", "tryMoveToXYZ"));
+ mInitMap.put(new Pair<String, String>("func_75493_a", "isDirectPathBetweenPoints"));
+ mInitMap.put(new Pair<String, String>("func_75494_a", "getPathToEntityLiving"));
+ mInitMap.put(new Pair<String, String>("func_75495_e", "setCanSwim"));
+ mInitMap.put(new Pair<String, String>("func_75496_b", "isPositionClear"));
+ mInitMap.put(new Pair<String, String>("func_75497_a", "tryMoveToEntityLiving"));
+ mInitMap.put(new Pair<String, String>("func_75498_b", "setBreakDoors"));
+ mInitMap.put(new Pair<String, String>("func_75499_g", "clearPathEntity"));
+ mInitMap.put(new Pair<String, String>("func_75500_f", "noPath"));
+ mInitMap.put(new Pair<String, String>("func_75501_e", "onUpdateNavigation"));
+ mInitMap.put(new Pair<String, String>("func_75502_i", "getEntityPosition"));
+ mInitMap.put(new Pair<String, String>("func_75503_j", "getPathableYPos"));
+ mInitMap.put(new Pair<String, String>("func_75504_d", "setAvoidSun"));
+ mInitMap.put(new Pair<String, String>("func_75505_d", "getPath"));
+ mInitMap.put(new Pair<String, String>("func_75506_l", "isInLiquid"));
+ mInitMap.put(new Pair<String, String>("func_75507_c", "getCanBreakDoors"));
+ mInitMap.put(new Pair<String, String>("func_75508_h", "pathFollow"));
+ mInitMap.put(new Pair<String, String>("func_75522_a", "canSee"));
+ mInitMap.put(new Pair<String, String>("func_75523_a", "clearSensingCache"));
+ mInitMap.put(new Pair<String, String>("func_75528_a", "tick"));
+ mInitMap.put(new Pair<String, String>("func_75530_c", "spawnZombie"));
+ mInitMap.put(new Pair<String, String>("func_75540_b", "getVillageList"));
+ mInitMap.put(new Pair<String, String>("func_75541_e", "isWoodenDoorAt"));
+ mInitMap.put(new Pair<String, String>("func_75542_c", "addDoorTomInitMap.put(newListIfAppropriate"));
+ mInitMap.put(new Pair<String, String>("func_75543_d", "dropOldestVillagerPosition"));
+ mInitMap.put(new Pair<String, String>("func_75544_a", "tick"));
+ mInitMap.put(new Pair<String, String>("func_75545_e", "addmInitMap.put(newDoorsToVillageOrCreateVillage"));
+ mInitMap.put(new Pair<String, String>(
+ "func_75546_a", "addUnassignedWoodenDoorsAroundTomInitMap.put(newDoorsList"));
+ mInitMap.put(new Pair<String, String>("func_75547_b", "getVillageDoorAt"));
+ mInitMap.put(new Pair<String, String>("func_75548_d", "isVillagerPositionPresent"));
+ mInitMap.put(new Pair<String, String>("func_75549_c", "removeAnnihilatedVillages"));
+ mInitMap.put(new Pair<String, String>("func_75550_a", "findNearestVillage"));
+ mInitMap.put(new Pair<String, String>("func_75551_a", "addVillagerPosition"));
+ mInitMap.put(new Pair<String, String>("func_75557_k", "removeDeadAndOutOfRangeDoors"));
+ mInitMap.put(new Pair<String, String>("func_75558_f", "getVillageDoorInfoList"));
+ mInitMap.put(new Pair<String, String>("func_75559_a", "tryGetIronGolemSpawningLocation"));
+ mInitMap.put(new Pair<String, String>("func_75560_a", "tick"));
+ mInitMap.put(new Pair<String, String>("func_75561_d", "getTicksSinceLastDoorAdding"));
+ mInitMap.put(new Pair<String, String>("func_75562_e", "getNumVillagers"));
+ mInitMap.put(new Pair<String, String>("func_75563_b", "isValidIronGolemSpawningLocation"));
+ mInitMap.put(new Pair<String, String>("func_75564_b", "findNearestDoor"));
+ mInitMap.put(new Pair<String, String>("func_75565_j", "removeDeadAndOldAgressors"));
+ mInitMap.put(new Pair<String, String>("func_75566_g", "isAnnihilated"));
+ mInitMap.put(new Pair<String, String>("func_75567_c", "getNumVillageDoors"));
+ mInitMap.put(new Pair<String, String>("func_75568_b", "getVillageRadius"));
+ mInitMap.put(new Pair<String, String>("func_75569_c", "findNearestDoorUnrestricted"));
+ mInitMap.put(new Pair<String, String>("func_75570_a", "isInRange"));
+ mInitMap.put(new Pair<String, String>("func_75571_b", "findNearestVillageAggressor"));
+ mInitMap.put(new Pair<String, String>("func_75572_i", "updateNumVillagers"));
+ mInitMap.put(new Pair<String, String>("func_75573_l", "updateVillageRadiusAndCenter"));
+ mInitMap.put(new Pair<String, String>("func_75574_f", "isBlockDoor"));
+ mInitMap.put(new Pair<String, String>("func_75575_a", "addOrRemInitMap.put(newAgressor"));
+ mInitMap.put(new Pair<String, String>("func_75576_a", "addVillageDoorInfo"));
+ mInitMap.put(new Pair<String, String>("func_75577_a", "getCenter"));
+ mInitMap.put(new Pair<String, String>("func_75578_e", "getVillageDoorAt"));
+ mInitMap.put(new Pair<String, String>("func_75579_h", "updateNumIronGolems"));
+ mInitMap.put(new Pair<String, String>("func_75598_a", "getCreatureClass"));
+ mInitMap.put(new Pair<String, String>("func_75599_d", "getPeacefulCreature"));
+ mInitMap.put(new Pair<String, String>("func_75600_c", "getCreatureMaterial"));
+ mInitMap.put(new Pair<String, String>("func_75601_b", "getMaxNumberOfCreature"));
+ mInitMap.put(new Pair<String, String>("func_75614_a", "addMapping"));
+ mInitMap.put(new Pair<String, String>("func_75615_a", "createEntityFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_75616_a", "createEntityByID"));
+ mInitMap.put(new Pair<String, String>("func_75617_a", "getStringFromID"));
+ mInitMap.put(new Pair<String, String>("func_75618_a", "addMapping"));
+ mInitMap.put(new Pair<String, String>("func_75619_a", "getEntityID"));
+ mInitMap.put(new Pair<String, String>("func_75620_a", "createEntityByName"));
+ mInitMap.put(new Pair<String, String>("func_75621_b", "getEntityString"));
+ mInitMap.put(new Pair<String, String>("func_75630_a", "multiplyBy32AndRound"));
+ mInitMap.put(new Pair<String, String>("func_75638_b", "getSpeed"));
+ mInitMap.put(new Pair<String, String>("func_75639_a", "limitAngle"));
+ mInitMap.put(new Pair<String, String>("func_75640_a", "isUpdating"));
+ mInitMap.put(new Pair<String, String>("func_75641_c", "onUpdateMoveHelper"));
+ mInitMap.put(new Pair<String, String>("func_75642_a", "setMoveTo"));
+ mInitMap.put(new Pair<String, String>("func_75649_a", "onUpdateLook"));
+ mInitMap.put(new Pair<String, String>("func_75650_a", "setLookPosition"));
+ mInitMap.put(new Pair<String, String>("func_75651_a", "setLookPositionWithEntity"));
+ mInitMap.put(new Pair<String, String>("func_75652_a", "updateRotation"));
+ mInitMap.put(new Pair<String, String>("func_75660_a", "setJumping"));
+ mInitMap.put(new Pair<String, String>("func_75661_b", "doJump"));
+ mInitMap.put(new Pair<String, String>("func_75664_a", "updateRenderAngles"));
+ mInitMap.put(new Pair<String, String>("func_75665_a", "computeAngleWithBound"));
+ mInitMap.put(new Pair<String, String>("func_75669_b", "getObject"));
+ mInitMap.put(new Pair<String, String>("func_75670_d", "isWatched"));
+ mInitMap.put(new Pair<String, String>("func_75671_a", "setWatched"));
+ mInitMap.put(new Pair<String, String>("func_75672_a", "getDataValueId"));
+ mInitMap.put(new Pair<String, String>("func_75673_a", "setObject"));
+ mInitMap.put(new Pair<String, String>("func_75674_c", "getObjectType"));
+ mInitMap.put(new Pair<String, String>("func_75679_c", "getWatchableObjectInt"));
+ mInitMap.put(new Pair<String, String>("func_75681_e", "getWatchableObjectString"));
+ mInitMap.put(new Pair<String, String>("func_75682_a", "addObject"));
+ mInitMap.put(new Pair<String, String>("func_75683_a", "getWatchableObjectByte"));
+ mInitMap.put(new Pair<String, String>("func_75684_a", "hasObjectChanged"));
+ mInitMap.put(new Pair<String, String>("func_75685_c", "getAllWatched"));
+ mInitMap.put(new Pair<String, String>("func_75687_a", "updateWatchedObjectsFromList"));
+ mInitMap.put(new Pair<String, String>("func_75688_b", "getChanged"));
+ mInitMap.put(new Pair<String, String>("func_75691_i", "getWatchedObject"));
+ mInitMap.put(new Pair<String, String>("func_75692_b", "updateObject"));
+ mInitMap.put(new Pair<String, String>("func_75693_b", "getWatchableObjectShort"));
+ mInitMap.put(new Pair<String, String>("func_75734_a", "waitForFinish"));
+ mInitMap.put(new Pair<String, String>("func_75735_a", "queueIO"));
+ mInitMap.put(new Pair<String, String>("func_75736_b", "processQueue"));
+ mInitMap.put(new Pair<String, String>("func_75742_a", "loadData"));
+ mInitMap.put(new Pair<String, String>("func_75743_a", "getUniqueDataId"));
+ mInitMap.put(new Pair<String, String>("func_75744_a", "saveAllData"));
+ mInitMap.put(new Pair<String, String>("func_75745_a", "setData"));
+ mInitMap.put(new Pair<String, String>("func_75746_b", "loadIdCounts"));
+ mInitMap.put(new Pair<String, String>("func_75747_a", "saveData"));
+ mInitMap.put(new Pair<String, String>("func_75752_b", "readPlayerData"));
+ mInitMap.put(new Pair<String, String>("func_75753_a", "writePlayerData"));
+ mInitMap.put(new Pair<String, String>("func_75754_f", "getAvailablePlayerDat"));
+ mInitMap.put(new Pair<String, String>("func_75755_a", "saveWorldInfoWithPlayer"));
+ mInitMap.put(new Pair<String, String>("func_75756_e", "getPlayerNBTManager"));
+ mInitMap.put(new Pair<String, String>("func_75757_d", "loadWorldInfo"));
+ mInitMap.put(new Pair<String, String>("func_75758_b", "getMapFileFromName"));
+ mInitMap.put(new Pair<String, String>("func_75759_a", "flush"));
+ mInitMap.put(new Pair<String, String>("func_75760_g", "getWorldDirectoryName"));
+ mInitMap.put(new Pair<String, String>("func_75761_a", "saveWorldInfo"));
+ mInitMap.put(new Pair<String, String>("func_75762_c", "checkSessionLock"));
+ mInitMap.put(new Pair<String, String>("func_75763_a", "getChunkLoader"));
+ mInitMap.put(new Pair<String, String>("func_75765_b", "getWorldDirectory"));
+ mInitMap.put(new Pair<String, String>("func_75766_h", "setSessionLock"));
+ mInitMap.put(new Pair<String, String>("func_75773_a", "canContinue"));
+ mInitMap.put(new Pair<String, String>("func_75774_a", "onUpdateTasks"));
+ mInitMap.put(new Pair<String, String>("func_75775_b", "canUse"));
+ mInitMap.put(new Pair<String, String>("func_75776_a", "addTask"));
+ mInitMap.put(new Pair<String, String>("func_75777_a", "areTasksCompatible"));
+ mInitMap.put(new Pair<String, String>("func_75783_h", "getCheatsEnabled"));
+ mInitMap.put(new Pair<String, String>("func_75784_e", "getLastTimePlayed"));
+ mInitMap.put(new Pair<String, String>("func_75785_d", "requiresConversion"));
+ mInitMap.put(new Pair<String, String>("func_75786_a", "getFileName"));
+ mInitMap.put(new Pair<String, String>("func_75788_b", "getDisplayName"));
+ mInitMap.put(new Pair<String, String>("func_75789_g", "isHardcoreModeEnabled"));
+ mInitMap.put(new Pair<String, String>("func_75790_f", "getEnumGameType"));
+ mInitMap.put(new Pair<String, String>("func_75799_b", "getSaveList"));
+ mInitMap.put(new Pair<String, String>("func_75800_d", "flushCache"));
+ mInitMap.put(new Pair<String, String>("func_75801_b", "isOldMapFormat"));
+ mInitMap.put(new Pair<String, String>("func_75802_e", "deleteWorldDirectory"));
+ mInitMap.put(new Pair<String, String>("func_75803_c", "getWorldInfo"));
+ mInitMap.put(new Pair<String, String>("func_75804_a", "getSaveLoader"));
+ mInitMap.put(new Pair<String, String>("func_75805_a", "convertMapFormat"));
+ mInitMap.put(new Pair<String, String>("func_75806_a", "renameWorld"));
+ mInitMap.put(new Pair<String, String>("func_75807_a", "deleteFiles"));
+ mInitMap.put(new Pair<String, String>("func_75809_f", "createFile"));
+ mInitMap.put(new Pair<String, String>("func_75810_a", "addRegionFilesToCollection"));
+ mInitMap.put(new Pair<String, String>("func_75811_a", "convertChunks"));
+ mInitMap.put(new Pair<String, String>("func_75812_c", "getSaveVersion"));
+ mInitMap.put(new Pair<String, String>("func_75813_a", "convertFile"));
+ mInitMap.put(new Pair<String, String>("func_75814_c", "writeNextIO"));
+ mInitMap.put(new Pair<String, String>("func_75815_a", "loadChunk"));
+ mInitMap.put(new Pair<String, String>("func_75816_a", "saveChunk"));
+ mInitMap.put(new Pair<String, String>("func_75817_a", "chunkTick"));
+ mInitMap.put(new Pair<String, String>("func_75818_b", "saveExtraData"));
+ mInitMap.put(new Pair<String, String>("func_75819_b", "saveExtraChunkData"));
+ mInitMap.put(new Pair<String, String>("func_75820_a", "writeChunkToNBT"));
+ mInitMap.put(new Pair<String, String>("func_75821_a", "writeChunkNBTTags"));
+ mInitMap.put(new Pair<String, String>("func_75822_a", "checkedReadChunkFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_75823_a", "readChunkFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_75824_a", "addChunkToPending"));
+ mInitMap.put(new Pair<String, String>("func_75829_a", "distanceTo"));
+ mInitMap.put(new Pair<String, String>("func_75830_a", "makeHash"));
+ mInitMap.put(new Pair<String, String>("func_75831_a", "isAssigned"));
+ mInitMap.put(new Pair<String, String>("func_75832_b", "distanceToSquared"));
+ mInitMap.put(new Pair<String, String>("func_75843_a", "format"));
+ mInitMap.put(new Pair<String, String>("func_75844_c", "dequeue"));
+ mInitMap.put(new Pair<String, String>("func_75845_e", "isPathEmpty"));
+ mInitMap.put(new Pair<String, String>("func_75846_b", "sortForward"));
+ mInitMap.put(new Pair<String, String>("func_75847_a", "sortBack"));
+ mInitMap.put(new Pair<String, String>("func_75848_a", "clearPath"));
+ mInitMap.put(new Pair<String, String>("func_75849_a", "addPoint"));
+ mInitMap.put(new Pair<String, String>("func_75850_a", "changeDistance"));
+ mInitMap.put(new Pair<String, String>("func_75853_a", "createEntityPath"));
+ mInitMap.put(new Pair<String, String>("func_75854_a", "openPoint"));
+ mInitMap.put(new Pair<String, String>("func_75855_a", "canEntityStandAt"));
+ mInitMap.put(new Pair<String, String>("func_75856_a", "createEntityPathTo"));
+ mInitMap.put(new Pair<String, String>("func_75857_a", "createEntityPathTo"));
+ mInitMap.put(new Pair<String, String>("func_75858_a", "getSafePoint"));
+ mInitMap.put(new Pair<String, String>("func_75859_a", "createEntityPathTo"));
+ mInitMap.put(new Pair<String, String>("func_75860_b", "findPathOptions"));
+ mInitMap.put(new Pair<String, String>("func_75861_a", "addToPath"));
+ mInitMap.put(new Pair<String, String>("func_75870_c", "getFinalPathPoint"));
+ mInitMap.put(new Pair<String, String>("func_75871_b", "setCurrentPathLength"));
+ mInitMap.put(new Pair<String, String>("func_75872_c", "setCurrentPathIndex"));
+ mInitMap.put(new Pair<String, String>("func_75873_e", "getCurrentPathIndex"));
+ mInitMap.put(new Pair<String, String>("func_75874_d", "getCurrentPathLength"));
+ mInitMap.put(new Pair<String, String>("func_75875_a", "incrementPathIndex"));
+ mInitMap.put(new Pair<String, String>("func_75876_a", "isSamePath"));
+ mInitMap.put(new Pair<String, String>("func_75877_a", "getPathPointFromIndex"));
+ mInitMap.put(new Pair<String, String>("func_75878_a", "getPosition"));
+ mInitMap.put(new Pair<String, String>("func_75879_b", "isFinished"));
+ mInitMap.put(new Pair<String, String>("func_75880_b", "isDestinationSame"));
+ mInitMap.put(new Pair<String, String>("func_75881_a", "getVectorFromIndex"));
+ mInitMap.put(new Pair<String, String>("func_75885_a", "cipherOperation"));
+ mInitMap.put(new Pair<String, String>("func_75886_a", "createTheCipherInstance"));
+ mInitMap.put(new Pair<String, String>("func_75887_a", "decryptSharedKey"));
+ mInitMap.put(new Pair<String, String>("func_75889_b", "decryptData"));
+ mInitMap.put(new Pair<String, String>("func_75890_a", "createmInitMap.put(newSharedKey"));
+ mInitMap.put(new Pair<String, String>("func_75891_b", "generateKeyPair"));
+ mInitMap.put(new Pair<String, String>("func_75893_a", "digestOperation"));
+ mInitMap.put(new Pair<String, String>("func_75894_a", "encryptData"));
+ mInitMap.put(new Pair<String, String>("func_75895_a", "getServerIdHash"));
+ mInitMap.put(new Pair<String, String>("func_75896_a", "decodePublicKey"));
+ mInitMap.put(new Pair<String, String>("func_75901_a", "initializeAllBiomeGenerators"));
+ mInitMap.put(new Pair<String, String>("func_75902_a", "nextInt"));
+ mInitMap.put(new Pair<String, String>("func_75903_a", "initChunkSeed"));
+ mInitMap.put(new Pair<String, String>("func_75904_a", "getInts"));
+ mInitMap.put(new Pair<String, String>("func_75905_a", "initWorldGenSeed"));
+ mInitMap.put(new Pair<String, String>("func_75915_a", "magnify"));
+ mInitMap.put(new Pair<String, String>("func_75918_d", "initCraftableStats"));
+ mInitMap.put(new Pair<String, String>("func_75924_a", "replaceAllSimilarBlocks"));
+ mInitMap.put(new Pair<String, String>("func_75925_c", "initStats"));
+ mInitMap.put(new Pair<String, String>("func_75966_h", "initIndependentStat"));
+ mInitMap.put(new Pair<String, String>("func_75967_d", "isAchievement"));
+ mInitMap.put(new Pair<String, String>("func_75971_g", "registerStat"));
+ mInitMap.put(new Pair<String, String>("func_75984_f", "getSpecial"));
+ mInitMap.put(new Pair<String, String>("func_75987_b", "setSpecial"));
+ mInitMap.put(new Pair<String, String>("func_75988_a", "setStatStringFormatter"));
+ mInitMap.put(new Pair<String, String>("func_75989_e", "getDescription"));
+ mInitMap.put(new Pair<String, String>("func_75997_a", "init"));
+ mInitMap.put(new Pair<String, String>("func_76030_b", "getValue"));
+ mInitMap.put(new Pair<String, String>("func_76031_a", "getHash"));
+ mInitMap.put(new Pair<String, String>("func_76036_e", "removeEntry"));
+ mInitMap.put(new Pair<String, String>("func_76037_b", "containsItem"));
+ mInitMap.put(new Pair<String, String>("func_76038_a", "addKey"));
+ mInitMap.put(new Pair<String, String>("func_76040_a", "insert"));
+ mInitMap.put(new Pair<String, String>("func_76041_a", "lookup"));
+ mInitMap.put(new Pair<String, String>("func_76043_a", "getSlotIndex"));
+ mInitMap.put(new Pair<String, String>("func_76044_g", "computeHash"));
+ mInitMap.put(new Pair<String, String>("func_76045_c", "lookupEntry"));
+ mInitMap.put(new Pair<String, String>("func_76046_c", "clearMap"));
+ mInitMap.put(new Pair<String, String>("func_76047_h", "grow"));
+ mInitMap.put(new Pair<String, String>("func_76048_a", "copyTo"));
+ mInitMap.put(new Pair<String, String>("func_76049_d", "removeObject"));
+ mInitMap.put(new Pair<String, String>("func_76056_b", "setSpawnY"));
+ mInitMap.put(new Pair<String, String>("func_76057_l", "getLastTimePlayed"));
+ mInitMap.put(new Pair<String, String>("func_76058_a", "setSpawnX"));
+ mInitMap.put(new Pair<String, String>("func_76059_o", "isRaining"));
+ mInitMap.put(new Pair<String, String>("func_76060_a", "setGameType"));
+ mInitMap.put(new Pair<String, String>("func_76061_m", "isThundering"));
+ mInitMap.put(new Pair<String, String>("func_76062_a", "setWorldName"));
+ mInitMap.put(new Pair<String, String>("func_76063_b", "getSeed"));
+ mInitMap.put(new Pair<String, String>("func_76064_a", "updateTagCompound"));
+ mInitMap.put(new Pair<String, String>("func_76065_j", "getWorldName"));
+ mInitMap.put(new Pair<String, String>("func_76066_a", "getNBTTagCompound"));
+ mInitMap.put(new Pair<String, String>("func_76067_t", "getTerrainType"));
+ mInitMap.put(new Pair<String, String>("func_76068_b", "setWorldTime"));
+ mInitMap.put(new Pair<String, String>("func_76069_a", "setThundering"));
+ mInitMap.put(new Pair<String, String>("func_76070_v", "isInitialized"));
+ mInitMap.put(new Pair<String, String>("func_76071_n", "getThunderTime"));
+ mInitMap.put(new Pair<String, String>("func_76072_h", "getPlayerNBTTagCompound"));
+ mInitMap.put(new Pair<String, String>("func_76073_f", "getWorldTime"));
+ mInitMap.put(new Pair<String, String>("func_76074_e", "getSpawnZ"));
+ mInitMap.put(new Pair<String, String>("func_76075_d", "getSpawnY"));
+ mInitMap.put(new Pair<String, String>("func_76076_i", "getDimension"));
+ mInitMap.put(new Pair<String, String>("func_76077_q", "getGameType"));
+ mInitMap.put(new Pair<String, String>("func_76078_e", "setSaveVersion"));
+ mInitMap.put(new Pair<String, String>("func_76079_c", "getSpawnX"));
+ mInitMap.put(new Pair<String, String>("func_76080_g", "setRainTime"));
+ mInitMap.put(new Pair<String, String>("func_76081_a", "setSpawnPosition"));
+ mInitMap.put(new Pair<String, String>("func_76082_a", "cloneNBTCompound"));
+ mInitMap.put(new Pair<String, String>("func_76083_p", "getRainTime"));
+ mInitMap.put(new Pair<String, String>("func_76084_b", "setRaining"));
+ mInitMap.put(new Pair<String, String>("func_76085_a", "setTerrainType"));
+ mInitMap.put(new Pair<String, String>("func_76086_u", "areCommandsAllowed"));
+ mInitMap.put(new Pair<String, String>("func_76087_c", "setSpawnZ"));
+ mInitMap.put(new Pair<String, String>("func_76088_k", "getSaveVersion"));
+ mInitMap.put(new Pair<String, String>("func_76089_r", "isMapFeaturesEnabled"));
+ mInitMap.put(new Pair<String, String>("func_76090_f", "setThunderTime"));
+ mInitMap.put(new Pair<String, String>("func_76091_d", "setServerInitialized"));
+ mInitMap.put(new Pair<String, String>("func_76092_g", "getSizeOnDisk"));
+ mInitMap.put(new Pair<String, String>("func_76093_s", "isHardcoreModeEnabled"));
+ mInitMap.put(new Pair<String, String>("func_76123_f", "ceiling_float_int"));
+ mInitMap.put(new Pair<String, String>("func_76124_d", "floor_double_long"));
+ mInitMap.put(new Pair<String, String>("func_76125_a", "clamp_int"));
+ mInitMap.put(new Pair<String, String>("func_76126_a", "sin"));
+ mInitMap.put(new Pair<String, String>("func_76127_a", "average"));
+ mInitMap.put(new Pair<String, String>("func_76128_c", "floor_double"));
+ mInitMap.put(new Pair<String, String>("func_76129_c", "sqrt_float"));
+ mInitMap.put(new Pair<String, String>("func_76130_a", "abs_int"));
+ mInitMap.put(new Pair<String, String>("func_76131_a", "clamp_float"));
+ mInitMap.put(new Pair<String, String>("func_76132_a", "abs_max"));
+ mInitMap.put(new Pair<String, String>("func_76133_a", "sqrt_double"));
+ mInitMap.put(new Pair<String, String>("func_76134_b", "cos"));
+ mInitMap.put(new Pair<String, String>("func_76135_e", "abs"));
+ mInitMap.put(new Pair<String, String>("func_76136_a", "getRandomIntegerInRange"));
+ mInitMap.put(new Pair<String, String>("func_76137_a", "bucketInt"));
+ mInitMap.put(new Pair<String, String>("func_76138_g", "wrapAngleTo180_double"));
+ mInitMap.put(new Pair<String, String>("func_76139_a", "stringNullOrLengthZero"));
+ mInitMap.put(new Pair<String, String>("func_76140_b", "truncateDoubleToInt"));
+ mInitMap.put(new Pair<String, String>("func_76141_d", "floor_float"));
+ mInitMap.put(new Pair<String, String>("func_76142_g", "wrapAngleTo180_float"));
+ mInitMap.put(new Pair<String, String>("func_76143_f", "ceiling_double_int"));
+ mInitMap.put(new Pair<String, String>("func_76145_b", "getValue"));
+ mInitMap.put(new Pair<String, String>("func_76146_a", "getKey"));
+ mInitMap.put(new Pair<String, String>("func_76152_e", "removeKey"));
+ mInitMap.put(new Pair<String, String>("func_76153_b", "resizeTable"));
+ mInitMap.put(new Pair<String, String>("func_76154_a", "copyHashTableTo"));
+ mInitMap.put(new Pair<String, String>("func_76155_g", "getHashedKey"));
+ mInitMap.put(new Pair<String, String>("func_76156_a", "createKey"));
+ mInitMap.put(new Pair<String, String>("func_76157_a", "hash"));
+ mInitMap.put(new Pair<String, String>("func_76158_a", "getHashIndex"));
+ mInitMap.put(new Pair<String, String>("func_76159_d", "remove"));
+ mInitMap.put(new Pair<String, String>("func_76160_c", "getEntry"));
+ mInitMap.put(new Pair<String, String>("func_76161_b", "containsItem"));
+ mInitMap.put(new Pair<String, String>("func_76162_a", "getNumHashElements"));
+ mInitMap.put(new Pair<String, String>("func_76163_a", "add"));
+ mInitMap.put(new Pair<String, String>("func_76164_a", "getValueByKey"));
+ mInitMap.put(new Pair<String, String>("func_76179_a", "buildPostString"));
+ mInitMap.put(new Pair<String, String>("func_76181_a", "getSuitableLanPort"));
+ mInitMap.put(new Pair<String, String>("func_76184_a", "readFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_76185_a", "markDirty"));
+ mInitMap.put(new Pair<String, String>("func_76186_a", "setDirty"));
+ mInitMap.put(new Pair<String, String>("func_76187_b", "writeToNBT"));
+ mInitMap.put(new Pair<String, String>("func_76188_b", "isDirty"));
+ mInitMap.put(new Pair<String, String>("func_76191_a", "updateVisiblePlayers"));
+ mInitMap.put(new Pair<String, String>("func_76192_a", "updateMPMapData"));
+ mInitMap.put(new Pair<String, String>("func_76193_a", "getUpdatePacketData"));
+ mInitMap.put(new Pair<String, String>("func_76194_a", "setColumnDirty"));
+ mInitMap.put(new Pair<String, String>("func_76204_a", "getPlayersOnMap"));
+ mInitMap.put(new Pair<String, String>("func_76217_h", "getCanBurn"));
+ mInitMap.put(new Pair<String, String>("func_76218_k", "isOpaque"));
+ mInitMap.put(new Pair<String, String>("func_76219_n", "setNoPushMobility"));
+ mInitMap.put(new Pair<String, String>("func_76220_a", "isSolid"));
+ mInitMap.put(new Pair<String, String>("func_76221_f", "setRequiresTool"));
+ mInitMap.put(new Pair<String, String>("func_76222_j", "isReplaceable"));
+ mInitMap.put(new Pair<String, String>("func_76223_p", "setTranslucent"));
+ mInitMap.put(new Pair<String, String>("func_76224_d", "isLiquid"));
+ mInitMap.put(new Pair<String, String>("func_76225_o", "setImmovableMobility"));
+ mInitMap.put(new Pair<String, String>("func_76226_g", "setBurning"));
+ mInitMap.put(new Pair<String, String>("func_76227_m", "getMaterialMobility"));
+ mInitMap.put(new Pair<String, String>("func_76228_b", "blocksLight"));
+ mInitMap.put(new Pair<String, String>("func_76229_l", "isToolNotRequired"));
+ mInitMap.put(new Pair<String, String>("func_76230_c", "blocksMovement"));
+ mInitMap.put(new Pair<String, String>("func_76231_i", "setReplaceable"));
+ mInitMap.put(new Pair<String, String>("func_76269_a", "getRandomItem"));
+ mInitMap.put(new Pair<String, String>("func_76270_a", "getTotalWeight"));
+ mInitMap.put(new Pair<String, String>("func_76271_a", "getRandomItem"));
+ mInitMap.put(new Pair<String, String>("func_76272_a", "getTotalWeight"));
+ mInitMap.put(new Pair<String, String>("func_76273_a", "getRandomItem"));
+ mInitMap.put(new Pair<String, String>("func_76274_a", "getRandomItem"));
+ mInitMap.put(new Pair<String, String>("func_76293_a", "generateChestContents"));
+ mInitMap.put(new Pair<String, String>("func_76304_a", "generateNoiseOctaves"));
+ mInitMap.put(new Pair<String, String>("func_76305_a", "generateNoiseOctaves"));
+ mInitMap.put(new Pair<String, String>("func_76308_a", "populateNoiseArray"));
+ mInitMap.put(new Pair<String, String>("func_76310_a", "grad"));
+ mInitMap.put(new Pair<String, String>("func_76311_b", "lerp"));
+ mInitMap.put(new Pair<String, String>("func_76316_a", "onInventoryChanged"));
+ mInitMap.put(new Pair<String, String>("func_76317_a", "clearProfiling"));
+ mInitMap.put(new Pair<String, String>("func_76318_c", "endStartSection"));
+ mInitMap.put(new Pair<String, String>("func_76319_b", "endSection"));
+ mInitMap.put(new Pair<String, String>("func_76320_a", "startSection"));
+ mInitMap.put(new Pair<String, String>("func_76321_b", "getProfilingData"));
+ mInitMap.put(new Pair<String, String>("func_76322_c", "getNameOfLastSection"));
+ mInitMap.put(new Pair<String, String>("func_76333_a", "smooth"));
+ mInitMap.put(new Pair<String, String>("func_76337_a", "ticksToElapsedTime"));
+ mInitMap.put(new Pair<String, String>("func_76338_a", "stripControlCodes"));
+ mInitMap.put(new Pair<String, String>("func_76340_b", "getSecond"));
+ mInitMap.put(new Pair<String, String>("func_76341_a", "getFirst"));
+ mInitMap.put(new Pair<String, String>("func_76345_d", "getHungerDamage"));
+ mInitMap.put(new Pair<String, String>("func_76346_g", "getEntity"));
+ mInitMap.put(new Pair<String, String>("func_76347_k", "isFireDamage"));
+ mInitMap.put(new Pair<String, String>("func_76348_h", "setDamageBypassesArmor"));
+ mInitMap.put(new Pair<String, String>("func_76349_b", "setProjectile"));
+ mInitMap.put(new Pair<String, String>("func_76350_n", "isDifficultyScaled"));
+ mInitMap.put(new Pair<String, String>("func_76351_m", "setDifficultyScaled"));
+ mInitMap.put(new Pair<String, String>("func_76352_a", "isProjectile"));
+ mInitMap.put(new Pair<String, String>("func_76353_a", "causeArrowDamage"));
+ mInitMap.put(new Pair<String, String>("func_76354_b", "causeIndirectMagicDamage"));
+ mInitMap.put(new Pair<String, String>("func_76355_l", "getDamageType"));
+ mInitMap.put(new Pair<String, String>("func_76356_a", "causeThrownDamage"));
+ mInitMap.put(new Pair<String, String>("func_76357_e", "canHarmInCreative"));
+ mInitMap.put(new Pair<String, String>("func_76358_a", "causeMobDamage"));
+ mInitMap.put(new Pair<String, String>("func_76359_i", "setDamageAllowedInCreativeMode"));
+ mInitMap.put(new Pair<String, String>("func_76361_j", "setFireDamage"));
+ mInitMap.put(new Pair<String, String>("func_76362_a", "causeFireballDamage"));
+ mInitMap.put(new Pair<String, String>("func_76363_c", "isUnblockable"));
+ mInitMap.put(new Pair<String, String>("func_76364_f", "getSourceOfDamage"));
+ mInitMap.put(new Pair<String, String>("func_76365_a", "causePlayerDamage"));
+ mInitMap.put(new Pair<String, String>("func_76388_g", "getEffectiveness"));
+ mInitMap.put(new Pair<String, String>("func_76389_a", "getDurationString"));
+ mInitMap.put(new Pair<String, String>("func_76390_b", "setPotionName"));
+ mInitMap.put(new Pair<String, String>("func_76392_e", "getStatusIconIndex"));
+ mInitMap.put(new Pair<String, String>("func_76393_a", "getName"));
+ mInitMap.put(new Pair<String, String>("func_76394_a", "performEffect"));
+ mInitMap.put(new Pair<String, String>("func_76395_i", "isUsable"));
+ mInitMap.put(new Pair<String, String>("func_76396_c", "getId"));
+ mInitMap.put(new Pair<String, String>("func_76397_a", "isReady"));
+ mInitMap.put(new Pair<String, String>("func_76398_f", "isBadEffect"));
+ mInitMap.put(new Pair<String, String>("func_76399_b", "setIconIndex"));
+ mInitMap.put(new Pair<String, String>("func_76400_d", "hasStatusIcon"));
+ mInitMap.put(new Pair<String, String>("func_76401_j", "getLiquidColor"));
+ mInitMap.put(new Pair<String, String>("func_76402_a", "affectEntity"));
+ mInitMap.put(new Pair<String, String>("func_76403_b", "isInstant"));
+ mInitMap.put(new Pair<String, String>("func_76404_a", "setEffectiveness"));
+ mInitMap.put(new Pair<String, String>("func_76445_a", "getIntCache"));
+ mInitMap.put(new Pair<String, String>("func_76446_a", "resetIntCache"));
+ mInitMap.put(new Pair<String, String>("func_76452_a", "combine"));
+ mInitMap.put(new Pair<String, String>("func_76453_d", "getEffectName"));
+ mInitMap.put(new Pair<String, String>("func_76454_e", "deincrementDuration"));
+ mInitMap.put(new Pair<String, String>("func_76455_a", "onUpdate"));
+ mInitMap.put(new Pair<String, String>("func_76456_a", "getPotionID"));
+ mInitMap.put(new Pair<String, String>("func_76457_b", "performEffect"));
+ mInitMap.put(new Pair<String, String>("func_76458_c", "getAmplifier"));
+ mInitMap.put(new Pair<String, String>("func_76459_b", "getDuration"));
+ mInitMap.put(new Pair<String, String>("func_76463_a", "startSnooper"));
+ mInitMap.put(new Pair<String, String>("func_76465_c", "getCurrentStats"));
+ mInitMap.put(new Pair<String, String>("func_76467_g", "addJvmArgsToSnooper"));
+ mInitMap.put(new Pair<String, String>("func_76468_d", "isSnooperRunning"));
+ mInitMap.put(new Pair<String, String>("func_76470_e", "stopSnooper"));
+ mInitMap.put(new Pair<String, String>("func_76471_b", "addMemoryStatsToSnooper"));
+ mInitMap.put(new Pair<String, String>("func_76484_a", "generate"));
+ mInitMap.put(new Pair<String, String>("func_76487_a", "setScale"));
+ mInitMap.put(new Pair<String, String>("func_76489_a", "generateLeafNodeList"));
+ mInitMap.put(new Pair<String, String>("func_76490_a", "layerSize"));
+ mInitMap.put(new Pair<String, String>("func_76491_a", "generateLeafNode"));
+ mInitMap.put(new Pair<String, String>("func_76493_c", "leafNodeNeedsBase"));
+ mInitMap.put(new Pair<String, String>("func_76494_d", "generateLeafNodeBases"));
+ mInitMap.put(new Pair<String, String>("func_76495_b", "leafSize"));
+ mInitMap.put(new Pair<String, String>("func_76496_a", "checkBlockLine"));
+ mInitMap.put(new Pair<String, String>("func_76497_e", "validTreeLocation"));
+ mInitMap.put(new Pair<String, String>("func_76498_b", "generateLeaves"));
+ mInitMap.put(new Pair<String, String>("func_76499_c", "generateTrunk"));
+ mInitMap.put(new Pair<String, String>("func_76529_b", "growVines"));
+ mInitMap.put(new Pair<String, String>("func_76536_b", "generateVines"));
+ mInitMap.put(new Pair<String, String>("func_76543_b", "pickMobSpawner"));
+ mInitMap.put(new Pair<String, String>("func_76549_c", "getChunkInputStream"));
+ mInitMap.put(new Pair<String, String>("func_76550_a", "createOrLoadRegionFile"));
+ mInitMap.put(new Pair<String, String>("func_76551_a", "clearRegionFileReferences"));
+ mInitMap.put(new Pair<String, String>("func_76552_d", "getChunkOutputStream"));
+ mInitMap.put(new Pair<String, String>("func_76554_h", "getEntrancePortalLocation"));
+ mInitMap.put(new Pair<String, String>("func_76555_c", "createChunkGenerator"));
+ mInitMap.put(new Pair<String, String>("func_76556_a", "generateLightBrightnessTable"));
+ mInitMap.put(new Pair<String, String>("func_76557_i", "getAverageGroundLevel"));
+ mInitMap.put(new Pair<String, String>("func_76558_a", "registerWorld"));
+ mInitMap.put(new Pair<String, String>("func_76559_b", "getMoonPhase"));
+ mInitMap.put(new Pair<String, String>("func_76560_a", "calcSunriseSunsetColors"));
+ mInitMap.put(new Pair<String, String>("func_76561_g", "isSkyColored"));
+ mInitMap.put(new Pair<String, String>("func_76562_b", "getFogColor"));
+ mInitMap.put(new Pair<String, String>("func_76563_a", "calculateCelestialAngle"));
+ mInitMap.put(new Pair<String, String>("func_76564_j", "getWorldHasVoidParticles"));
+ mInitMap.put(new Pair<String, String>("func_76565_k", "getVoidFogYFactor"));
+ mInitMap.put(new Pair<String, String>("func_76566_a", "canCoordinateBeSpawn"));
+ mInitMap.put(new Pair<String, String>("func_76567_e", "canRespawnHere"));
+ mInitMap.put(new Pair<String, String>("func_76568_b", "doesXZShowFog"));
+ mInitMap.put(new Pair<String, String>("func_76569_d", "isSurfaceWorld"));
+ mInitMap.put(new Pair<String, String>("func_76570_a", "getProviderForDimension"));
+ mInitMap.put(new Pair<String, String>("func_76571_f", "getCloudHeight"));
+ mInitMap.put(new Pair<String, String>("func_76572_b", "registerWorldChunkManager"));
+ mInitMap.put(new Pair<String, String>("func_76581_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_76582_a", "get"));
+ mInitMap.put(new Pair<String, String>("func_76587_i", "getBlockStorageArray"));
+ mInitMap.put(new Pair<String, String>("func_76588_a", "getEntitiesWithinAABBForEntity"));
+ mInitMap.put(new Pair<String, String>("func_76589_b", "setBlockMetadata"));
+ mInitMap.put(new Pair<String, String>("func_76590_a", "generateHeightMap"));
+ mInitMap.put(new Pair<String, String>("func_76591_a", "getBiomeGenForWorldCoords"));
+ mInitMap.put(new Pair<String, String>("func_76594_o", "enqueueRelightChecks"));
+ mInitMap.put(new Pair<String, String>("func_76595_e", "propagateSkylightOcclusion"));
+ mInitMap.put(new Pair<String, String>("func_76599_g", "checkSkylightNeighborHeight"));
+ mInitMap.put(new Pair<String, String>("func_76600_a", "isAtLocation"));
+ mInitMap.put(new Pair<String, String>("func_76601_a", "needsSaving"));
+ mInitMap.put(new Pair<String, String>("func_76602_a", "setStorageArrays"));
+ mInitMap.put(new Pair<String, String>("func_76603_b", "generateSkylightMap"));
+ mInitMap.put(new Pair<String, String>("func_76605_m", "getBiomeArray"));
+ mInitMap.put(new Pair<String, String>("func_76606_c", "getAreLevelsEmpty"));
+ mInitMap.put(new Pair<String, String>("func_76607_a", "fillChunk"));
+ mInitMap.put(new Pair<String, String>("func_76608_a", "removeEntityAtIndex"));
+ mInitMap.put(new Pair<String, String>("func_76609_d", "updateSkylightNeighborHeight"));
+ mInitMap.put(new Pair<String, String>("func_76611_b", "getHeightValue"));
+ mInitMap.put(new Pair<String, String>("func_76612_a", "addEntity"));
+ mInitMap.put(new Pair<String, String>("func_76613_n", "resetRelightChecks"));
+ mInitMap.put(new Pair<String, String>("func_76614_a", "getSavedLightValue"));
+ mInitMap.put(new Pair<String, String>("func_76615_h", "relightBlock"));
+ mInitMap.put(new Pair<String, String>("func_76616_a", "setBiomeArray"));
+ mInitMap.put(new Pair<String, String>("func_76617_a", "getRandomWithSeed"));
+ mInitMap.put(new Pair<String, String>("func_76618_a", "getEntitiesOfTypeWithinAAAB"));
+ mInitMap.put(new Pair<String, String>("func_76619_d", "canBlockSeeTheSky"));
+ mInitMap.put(new Pair<String, String>("func_76621_g", "isEmpty"));
+ mInitMap.put(new Pair<String, String>("func_76622_b", "removeEntity"));
+ mInitMap.put(new Pair<String, String>("func_76623_d", "onChunkUnload"));
+ mInitMap.put(new Pair<String, String>("func_76624_a", "populateChunk"));
+ mInitMap.put(new Pair<String, String>("func_76625_h", "getTopFilledSegment"));
+ mInitMap.put(new Pair<String, String>("func_76626_d", "getPrecipitationHeight"));
+ mInitMap.put(new Pair<String, String>("func_76628_c", "getBlockMetadata"));
+ mInitMap.put(new Pair<String, String>("func_76629_c", "getBlockLightValue"));
+ mInitMap.put(new Pair<String, String>("func_76630_e", "setChunkModified"));
+ mInitMap.put(new Pair<String, String>("func_76631_c", "onChunkLoad"));
+ mInitMap.put(new Pair<String, String>("func_76632_l", "getChunkCoordIntPair"));
+ mInitMap.put(new Pair<String, String>("func_76633_a", "setLightValue"));
+ mInitMap.put(new Pair<String, String>("func_76654_b", "setExtBlockMetadata"));
+ mInitMap.put(new Pair<String, String>("func_76657_c", "setExtSkylightValue"));
+ mInitMap.put(new Pair<String, String>("func_76658_g", "getBlockLSBArray"));
+ mInitMap.put(new Pair<String, String>("func_76659_c", "setBlocklightArray"));
+ mInitMap.put(new Pair<String, String>("func_76660_i", "getBlockMSBArray"));
+ mInitMap.put(new Pair<String, String>("func_76661_k", "getBlocklightArray"));
+ mInitMap.put(new Pair<String, String>("func_76662_d", "getYLocation"));
+ mInitMap.put(new Pair<String, String>("func_76663_a", "isEmpty"));
+ mInitMap.put(new Pair<String, String>("func_76664_a", "setBlockLSBArray"));
+ mInitMap.put(new Pair<String, String>("func_76665_b", "getExtBlockMetadata"));
+ mInitMap.put(new Pair<String, String>("func_76666_d", "setSkylightArray"));
+ mInitMap.put(new Pair<String, String>("func_76667_m", "createBlockMSBArray"));
+ mInitMap.put(new Pair<String, String>("func_76668_b", "setBlockMetadataArray"));
+ mInitMap.put(new Pair<String, String>("func_76669_j", "getMetadataArray"));
+ mInitMap.put(new Pair<String, String>("func_76670_c", "getExtSkylightValue"));
+ mInitMap.put(new Pair<String, String>("func_76671_l", "getSkylightArray"));
+ mInitMap.put(new Pair<String, String>("func_76672_e", "removeInvalidBlocks"));
+ mInitMap.put(new Pair<String, String>("func_76673_a", "setBlockMSBArray"));
+ mInitMap.put(new Pair<String, String>("func_76674_d", "getExtBlocklightValue"));
+ mInitMap.put(new Pair<String, String>("func_76675_b", "getNeedsRandomTick"));
+ mInitMap.put(new Pair<String, String>("func_76676_h", "clearMSBArray"));
+ mInitMap.put(new Pair<String, String>("func_76677_d", "setExtBlocklightValue"));
+ mInitMap.put(new Pair<String, String>("func_76686_a", "get"));
+ mInitMap.put(new Pair<String, String>("func_76690_a", "convertToAnvilFormat"));
+ mInitMap.put(new Pair<String, String>("func_76691_a", "load"));
+ mInitMap.put(new Pair<String, String>("func_76704_a", "getChunkDataInputStream"));
+ mInitMap.put(new Pair<String, String>("func_76705_d", "outOfBounds"));
+ mInitMap.put(new Pair<String, String>("func_76706_a", "write"));
+ mInitMap.put(new Pair<String, String>("func_76707_e", "getOffset"));
+ mInitMap.put(new Pair<String, String>("func_76708_c", "close"));
+ mInitMap.put(new Pair<String, String>("func_76709_c", "isChunkSaved"));
+ mInitMap.put(new Pair<String, String>("func_76710_b", "getChunkDataOutputStream"));
+ mInitMap.put(new Pair<String, String>("func_76711_a", "setOffset"));
+ mInitMap.put(new Pair<String, String>("func_76712_a", "write"));
+ mInitMap.put(new Pair<String, String>("func_76713_b", "setChunkTimestamp"));
+ mInitMap.put(new Pair<String, String>("func_76727_i", "getFloatRainfall"));
+ mInitMap.put(new Pair<String, String>("func_76728_a", "decorate"));
+ mInitMap.put(new Pair<String, String>("func_76729_a", "createBiomeDecorator"));
+ mInitMap.put(new Pair<String, String>("func_76730_b", "getRandomWorldGenForGrass"));
+ mInitMap.put(new Pair<String, String>("func_76731_a", "getSkyColorByTemp"));
+ mInitMap.put(new Pair<String, String>("func_76732_a", "setTemperatureRainfall"));
+ mInitMap.put(new Pair<String, String>("func_76735_a", "setBiomeName"));
+ mInitMap.put(new Pair<String, String>("func_76736_e", "isHighHumidity"));
+ mInitMap.put(new Pair<String, String>("func_76738_d", "canSpawnLightningBolt"));
+ mInitMap.put(new Pair<String, String>("func_76739_b", "setColor"));
+ mInitMap.put(new Pair<String, String>("func_76741_f", "getSpawningChance"));
+ mInitMap.put(new Pair<String, String>("func_76742_b", "setEnableSnow"));
+ mInitMap.put(new Pair<String, String>("func_76744_g", "getIntRainfall"));
+ mInitMap.put(new Pair<String, String>("func_76745_m", "setDisableRain"));
+ mInitMap.put(new Pair<String, String>("func_76746_c", "getEnableSnow"));
+ mInitMap.put(new Pair<String, String>("func_76747_a", "getSpawnableList"));
+ mInitMap.put(new Pair<String, String>("func_76793_b", "genStandardOre2"));
+ mInitMap.put(new Pair<String, String>("func_76795_a", "genStandardOre1"));
+ mInitMap.put(new Pair<String, String>("func_76797_b", "generateOres"));
+ mInitMap.put(new Pair<String, String>("func_76837_b", "getBiomeGenAt"));
+ mInitMap.put(new Pair<String, String>("func_76838_a", "cleanupCache"));
+ mInitMap.put(new Pair<String, String>("func_76839_e", "getCachedBiomes"));
+ mInitMap.put(new Pair<String, String>("func_76840_a", "getBiomeCacheBlock"));
+ mInitMap.put(new Pair<String, String>("func_76885_a", "getBiomeGenAt"));
+ mInitMap.put(new Pair<String, String>("func_76931_a", "getBiomeGenAt"));
+ mInitMap.put(new Pair<String, String>("func_76932_a", "getBiomesToSpawnIn"));
+ mInitMap.put(new Pair<String, String>("func_76933_b", "loadBlockGeneratorData"));
+ mInitMap.put(new Pair<String, String>("func_76935_a", "getBiomeGenAt"));
+ mInitMap.put(new Pair<String, String>("func_76936_a", "getRainfall"));
+ mInitMap.put(new Pair<String, String>("func_76937_a", "getBiomesForGeneration"));
+ mInitMap.put(new Pair<String, String>("func_76938_b", "cleanupCache"));
+ mInitMap.put(new Pair<String, String>("func_76939_a", "getTemperatureAtHeight"));
+ mInitMap.put(new Pair<String, String>("func_76940_a", "areBiomesViable"));
+ mInitMap.put(new Pair<String, String>("func_76975_c", "renderShadow"));
+ mInitMap.put(new Pair<String, String>("func_76976_a", "setRenderManager"));
+ mInitMap.put(new Pair<String, String>("func_76977_a", "renderEntityOnFire"));
+ mInitMap.put(new Pair<String, String>("func_76978_a", "renderOffsetAABB"));
+ mInitMap.put(new Pair<String, String>("func_76979_b", "doRenderShadowAndFire"));
+ mInitMap.put(new Pair<String, String>("func_76980_a", "renderAABB"));
+ mInitMap.put(new Pair<String, String>("func_76982_b", "getWorldFromRenderManager"));
+ mInitMap.put(new Pair<String, String>("func_76983_a", "getFontRendererFromRenderManager"));
+ mInitMap.put(new Pair<String, String>("func_76986_a", "doRender"));
+ mInitMap.put(new Pair<String, String>("func_77015_a", "renderItemIntoGUI"));
+ mInitMap.put(new Pair<String, String>("func_77017_a", "renderQuad"));
+ mInitMap.put(new Pair<String, String>("func_77018_a", "renderGlint"));
+ mInitMap.put(new Pair<String, String>("func_77020_a", "renderDroppedItem"));
+ mInitMap.put(new Pair<String, String>("func_77021_b", "renderItemOverlayIntoGUI"));
+ mInitMap.put(new Pair<String, String>("func_77026_a", "renderEntity"));
+ mInitMap.put(new Pair<String, String>("func_77029_c", "renderEquippedItems"));
+ mInitMap.put(new Pair<String, String>("func_77030_a", "getColorMultiplier"));
+ mInitMap.put(new Pair<String, String>("func_77032_a", "shouldRenderPass"));
+ mInitMap.put(new Pair<String, String>("func_77033_b", "passSpecialRender"));
+ mInitMap.put(new Pair<String, String>("func_77034_a", "interpolateRotation"));
+ mInitMap.put(new Pair<String, String>("func_77035_b", "inheritRenderPass"));
+ mInitMap.put(new Pair<String, String>("func_77036_a", "renderModel"));
+ mInitMap.put(new Pair<String, String>("func_77037_a", "getDeathMaxRotation"));
+ mInitMap.put(new Pair<String, String>("func_77039_a", "renderLivingAt"));
+ mInitMap.put(new Pair<String, String>("func_77040_d", "getSwingProgress"));
+ mInitMap.put(new Pair<String, String>("func_77041_b", "preRenderCallback"));
+ mInitMap.put(new Pair<String, String>("func_77042_a", "setRenderPassModel"));
+ mInitMap.put(new Pair<String, String>("func_77043_a", "rotateCorpse"));
+ mInitMap.put(new Pair<String, String>("func_77044_a", "handleRotationFloat"));
+ mInitMap.put(new Pair<String, String>("func_77124_a", "setCanBeCreated"));
+ mInitMap.put(new Pair<String, String>("func_77125_e", "isVersioned"));
+ mInitMap.put(new Pair<String, String>("func_77126_d", "getCanBeCreated"));
+ mInitMap.put(new Pair<String, String>("func_77127_a", "getWorldTypeName"));
+ mInitMap.put(new Pair<String, String>("func_77128_b", "getTranslateName"));
+ mInitMap.put(new Pair<String, String>("func_77129_f", "setVersioned"));
+ mInitMap.put(new Pair<String, String>("func_77130_a", "parseWorldType"));
+ mInitMap.put(new Pair<String, String>("func_77131_c", "getGeneratorVersion"));
+ mInitMap.put(new Pair<String, String>("func_77132_a", "getWorldTypeForGeneratorVersion"));
+ mInitMap.put(new Pair<String, String>("func_77142_a", "getByName"));
+ mInitMap.put(new Pair<String, String>("func_77144_e", "isSurvivalOrAdventure"));
+ mInitMap.put(new Pair<String, String>("func_77145_d", "isCreative"));
+ mInitMap.put(new Pair<String, String>("func_77146_a", "getByID"));
+ mInitMap.put(new Pair<String, String>("func_77147_a", "configurePlayerCapabilities"));
+ mInitMap.put(new Pair<String, String>("func_77148_a", "getID"));
+ mInitMap.put(new Pair<String, String>("func_77149_b", "getName"));
+ mInitMap.put(new Pair<String, String>("func_77158_f", "getHardcoreEnabled"));
+ mInitMap.put(new Pair<String, String>("func_77159_a", "enableBonusChest"));
+ mInitMap.put(new Pair<String, String>("func_77160_d", "getSeed"));
+ mInitMap.put(new Pair<String, String>("func_77161_a", "getGameTypeById"));
+ mInitMap.put(new Pair<String, String>("func_77162_e", "getGameType"));
+ mInitMap.put(new Pair<String, String>("func_77163_i", "areCommandsAllowed"));
+ mInitMap.put(new Pair<String, String>("func_77164_g", "isMapFeaturesEnabled"));
+ mInitMap.put(new Pair<String, String>("func_77165_h", "getTerrainType"));
+ mInitMap.put(new Pair<String, String>("func_77166_b", "enableCommands"));
+ mInitMap.put(new Pair<String, String>("func_77167_c", "isBonusChestEnabled"));
+ mInitMap.put(new Pair<String, String>("func_77176_a", "setScheduledTime"));
+ mInitMap.put(new Pair<String, String>("func_77184_b", "placeInExistingPortal"));
+ mInitMap.put(new Pair<String, String>("func_77185_a", "placeInPortal"));
+ mInitMap.put(new Pair<String, String>("func_77190_a", "canCreatureTypeSpawnAtLocation"));
+ mInitMap.put(new Pair<String, String>("func_77191_a", "performWorldGenSpawning"));
+ mInitMap.put(new Pair<String, String>("func_77192_a", "findChunksForSpawning"));
+ mInitMap.put(new Pair<String, String>("func_77201_a", "readRecipiesFromTags"));
+ mInitMap.put(new Pair<String, String>("func_77202_a", "getRecipiesAsTags"));
+ mInitMap.put(new Pair<String, String>("func_77203_a", "canRecipeBeUsed"));
+ mInitMap.put(new Pair<String, String>("func_77205_a", "addToListWithCheck"));
+ mInitMap.put(new Pair<String, String>("func_77272_a", "chunkXZ2Int"));
+ mInitMap.put(new Pair<String, String>("func_77273_a", "getCenterXPos"));
+ mInitMap.put(new Pair<String, String>("func_77274_b", "getCenterZPosition"));
+ mInitMap.put(new Pair<String, String>("func_77278_a", "doExplosionA"));
+ mInitMap.put(new Pair<String, String>("func_77279_a", "doExplosionB"));
+ mInitMap.put(new Pair<String, String>("func_77316_c", "getTranslatedName"));
+ mInitMap.put(new Pair<String, String>("func_77317_b", "getMaxEnchantability"));
+ mInitMap.put(new Pair<String, String>("func_77318_a", "calcModifierDamage"));
+ mInitMap.put(new Pair<String, String>("func_77319_d", "getMinLevel"));
+ mInitMap.put(new Pair<String, String>("func_77320_a", "getName"));
+ mInitMap.put(new Pair<String, String>("func_77321_a", "getMinEnchantability"));
+ mInitMap.put(new Pair<String, String>("func_77322_b", "setName"));
+ mInitMap.put(new Pair<String, String>("func_77324_c", "getWeight"));
+ mInitMap.put(new Pair<String, String>("func_77325_b", "getMaxLevel"));
+ mInitMap.put(new Pair<String, String>("func_77326_a", "canApplyTogether"));
+ mInitMap.put(new Pair<String, String>("func_77390_a", "readFromTags"));
+ mInitMap.put(new Pair<String, String>("func_77391_b", "hasSameItemsAs"));
+ mInitMap.put(new Pair<String, String>("func_77393_a", "hasSameIDsAs"));
+ mInitMap.put(new Pair<String, String>("func_77394_a", "getItemToBuy"));
+ mInitMap.put(new Pair<String, String>("func_77395_g", "writeToTags"));
+ mInitMap.put(new Pair<String, String>("func_77396_b", "getSecondItemToBuy"));
+ mInitMap.put(new Pair<String, String>("func_77397_d", "getItemToSell"));
+ mInitMap.put(new Pair<String, String>("func_77398_c", "hasSecondItemToBuy"));
+ mInitMap.put(new Pair<String, String>("func_77399_f", "incrementToolUses"));
+ mInitMap.put(new Pair<String, String>("func_77442_b", "canUnlockAchievement"));
+ mInitMap.put(new Pair<String, String>("func_77443_a", "hasAchievementUnlocked"));
+ mInitMap.put(new Pair<String, String>("func_77444_a", "writeStat"));
+ mInitMap.put(new Pair<String, String>("func_77466_a", "getFoliageColorPine"));
+ mInitMap.put(new Pair<String, String>("func_77467_a", "setFoliageBiomeColorizer"));
+ mInitMap.put(new Pair<String, String>("func_77468_c", "getFoliageColorBasic"));
+ mInitMap.put(new Pair<String, String>("func_77469_b", "getFoliageColorBirch"));
+ mInitMap.put(new Pair<String, String>("func_77470_a", "getFoliageColor"));
+ mInitMap.put(new Pair<String, String>("func_77472_b", "setClientActiveTexture"));
+ mInitMap.put(new Pair<String, String>("func_77473_a", "setActiveTexture"));
+ mInitMap.put(new Pair<String, String>("func_77474_a", "initializeTextures"));
+ mInitMap.put(new Pair<String, String>("func_77475_a", "setLightmapTextureCoords"));
+ mInitMap.put(new Pair<String, String>("func_77479_a", "setGrassBiomeColorizer"));
+ mInitMap.put(new Pair<String, String>("func_77480_a", "getGrassColor"));
+ mInitMap.put(new Pair<String, String>("func_77487_a", "getServerMotd"));
+ mInitMap.put(new Pair<String, String>("func_77488_b", "getServerIpPort"));
+ mInitMap.put(new Pair<String, String>("func_77489_c", "updateLastSeen"));
+ mInitMap.put(new Pair<String, String>("func_77493_a", "calculateModifier"));
+ mInitMap.put(new Pair<String, String>("func_77501_a", "getRespiration"));
+ mInitMap.put(new Pair<String, String>("func_77502_d", "getSilkTouchModifier"));
+ mInitMap.put(new Pair<String, String>("func_77504_a", "addRandomEnchantment"));
+ mInitMap.put(new Pair<String, String>("func_77505_b", "mapEnchantmentData"));
+ mInitMap.put(new Pair<String, String>("func_77506_a", "getEnchantmentLevel"));
+ mInitMap.put(new Pair<String, String>("func_77507_b", "getKnockbackModifier"));
+ mInitMap.put(new Pair<String, String>("func_77508_a", "getEnchantmentModifierDamage"));
+ mInitMap.put(new Pair<String, String>("func_77509_b", "getEfficiencyModifier"));
+ mInitMap.put(new Pair<String, String>("func_77510_g", "getAquaAffinityModifier"));
+ mInitMap.put(new Pair<String, String>("func_77511_a", "getMaxEnchantmentLevel"));
+ mInitMap.put(new Pair<String, String>("func_77512_a", "getEnchantmentModifierLiving"));
+ mInitMap.put(new Pair<String, String>("func_77513_b", "buildEnchantmentList"));
+ mInitMap.put(new Pair<String, String>("func_77514_a", "calcItemStackEnchantability"));
+ mInitMap.put(new Pair<String, String>("func_77516_a", "applyEnchantmentModifierArray"));
+ mInitMap.put(new Pair<String, String>("func_77517_e", "getFortuneModifier"));
+ mInitMap.put(new Pair<String, String>("func_77518_a", "applyEnchantmentModifier"));
+ mInitMap.put(new Pair<String, String>("func_77519_f", "getLootingModifier"));
+ mInitMap.put(new Pair<String, String>("func_77523_b", "getAdFromPingResponse"));
+ mInitMap.put(new Pair<String, String>("func_77524_a", "getMotdFromPingResponse"));
+ mInitMap.put(new Pair<String, String>("func_77525_a", "getPingResponse"));
+ mInitMap.put(new Pair<String, String>("func_77552_b", "setWasNotUpdated"));
+ mInitMap.put(new Pair<String, String>("func_77553_a", "getWasUpdated"));
+ mInitMap.put(new Pair<String, String>("func_77554_c", "getLanServers"));
+ mInitMap.put(new Pair<String, String>("func_77557_a", "canEnchantItem"));
+ mInitMap.put(new Pair<String, String>("func_77569_a", "matches"));
+ mInitMap.put(new Pair<String, String>("func_77570_a", "getRecipeSize"));
+ mInitMap.put(new Pair<String, String>("func_77571_b", "getRecipeOutput"));
+ mInitMap.put(new Pair<String, String>("func_77572_b", "getCraftingResult"));
+ mInitMap.put(new Pair<String, String>("func_77573_a", "checkMatch"));
+ mInitMap.put(new Pair<String, String>("func_77583_a", "addRecipes"));
+ mInitMap.put(new Pair<String, String>("func_77586_a", "addRecipes"));
+ mInitMap.put(new Pair<String, String>("func_77589_a", "addRecipes"));
+ mInitMap.put(new Pair<String, String>("func_77590_a", "addRecipes"));
+ mInitMap.put(new Pair<String, String>("func_77592_b", "getRecipeList"));
+ mInitMap.put(new Pair<String, String>("func_77594_a", "getInstance"));
+ mInitMap.put(new Pair<String, String>("func_77596_b", "addShapelessRecipe"));
+ mInitMap.put(new Pair<String, String>("func_77599_b", "getSmeltingList"));
+ mInitMap.put(new Pair<String, String>("func_77602_a", "instance"));
+ mInitMap.put(new Pair<String, String>("func_77607_a", "addRecipes"));
+ mInitMap.put(new Pair<String, String>("func_77608_a", "addRecipes"));
+ mInitMap.put(new Pair<String, String>("func_77609_a", "addRecipes"));
+ mInitMap.put(new Pair<String, String>("func_77612_l", "getMaxDurability"));
+ mInitMap.put(new Pair<String, String>("func_77613_e", "getRarity"));
+ mInitMap.put(new Pair<String, String>("func_77614_k", "getHasSubtypes"));
+ mInitMap.put(new Pair<String, String>("func_77615_a", "onPlayerStoppedUsing"));
+ mInitMap.put(new Pair<String, String>("func_77616_k", "isItemTool"));
+ mInitMap.put(new Pair<String, String>("func_77617_a", "getIconFromDamage"));
+ mInitMap.put(new Pair<String, String>("func_77618_c", "getIconFromDamageForRenderPass"));
+ mInitMap.put(new Pair<String, String>("func_77619_b", "getItemEnchantability"));
+ mInitMap.put(new Pair<String, String>("func_77620_a", "getColorFromDamage"));
+ mInitMap.put(new Pair<String, String>("func_77621_a", "getMovingObjectPositionFromPlayer"));
+ mInitMap.put(new Pair<String, String>("func_77622_d", "onCreated"));
+ mInitMap.put(new Pair<String, String>("func_77623_v", "requiresMultipleRenderPasses"));
+ mInitMap.put(new Pair<String, String>("func_77624_a", "addInformation"));
+ mInitMap.put(new Pair<String, String>("func_77625_d", "setMaxStackSize"));
+ mInitMap.put(new Pair<String, String>("func_77626_a", "getMaxItemUseDuration"));
+ mInitMap.put(new Pair<String, String>("func_77627_a", "setHasSubtypes"));
+ mInitMap.put(new Pair<String, String>("func_77629_n_", "shouldRotateAroundWhenRendering"));
+ mInitMap.put(new Pair<String, String>("func_77630_h", "doesContainerItemLeaveCraftingGrid"));
+ mInitMap.put(new Pair<String, String>("func_77631_c", "setPotionEffect"));
+ mInitMap.put(new Pair<String, String>("func_77634_r", "hasContainerItem"));
+ mInitMap.put(new Pair<String, String>("func_77636_d", "hasEffect"));
+ mInitMap.put(new Pair<String, String>("func_77637_a", "setCreativeTab"));
+ mInitMap.put(new Pair<String, String>("func_77639_j", "getItemStackLimit"));
+ mInitMap.put(new Pair<String, String>("func_77640_w", "getCreativeTab"));
+ mInitMap.put(new Pair<String, String>("func_77642_a", "setContainerItem"));
+ mInitMap.put(new Pair<String, String>("func_77643_m_", "isMap"));
+ mInitMap.put(new Pair<String, String>("func_77644_a", "hitEntity"));
+ mInitMap.put(new Pair<String, String>("func_77645_m", "isDamageable"));
+ mInitMap.put(new Pair<String, String>("func_77647_b", "getMetadata"));
+ mInitMap.put(new Pair<String, String>("func_77648_a", "onItemUse"));
+ mInitMap.put(new Pair<String, String>("func_77650_f", "getIconIndex"));
+ mInitMap.put(new Pair<String, String>("func_77651_p", "getShareTag"));
+ mInitMap.put(new Pair<String, String>("func_77653_i", "getItemStackDisplayName"));
+ mInitMap.put(new Pair<String, String>("func_77654_b", "onItemUseFinish"));
+ mInitMap.put(new Pair<String, String>("func_77655_b", "setUnlocalizedName"));
+ mInitMap.put(new Pair<String, String>("func_77656_e", "setMaxDurability"));
+ mInitMap.put(new Pair<String, String>("func_77657_g", "getUnlocalizedNameInefficiently"));
+ mInitMap.put(new Pair<String, String>("func_77658_a", "getUnlocalizedName"));
+ mInitMap.put(new Pair<String, String>("func_77659_a", "onItemRightClick"));
+ mInitMap.put(new Pair<String, String>("func_77661_b", "getItemUseAction"));
+ mInitMap.put(new Pair<String, String>("func_77662_d", "isFull3D"));
+ mInitMap.put(new Pair<String, String>("func_77663_a", "onUpdate"));
+ mInitMap.put(new Pair<String, String>("func_77664_n", "setFull3D"));
+ mInitMap.put(new Pair<String, String>("func_77667_c", "getUnlocalizedName"));
+ mInitMap.put(new Pair<String, String>("func_77668_q", "getContainerItem"));
+ mInitMap.put(new Pair<String, String>("func_77828_a", "validBookTagContents"));
+ mInitMap.put(new Pair<String, String>("func_77831_g", "isSplash"));
+ mInitMap.put(new Pair<String, String>("func_77832_l", "getEffects"));
+ mInitMap.put(new Pair<String, String>("func_77833_h", "isEffectInstant"));
+ mInitMap.put(new Pair<String, String>("func_77834_f", "getEffects"));
+ mInitMap.put(new Pair<String, String>("func_77840_a", "spawnCreature"));
+ mInitMap.put(new Pair<String, String>("func_77842_f", "getMaterialName"));
+ mInitMap.put(new Pair<String, String>("func_77844_a", "setPotionEffect"));
+ mInitMap.put(new Pair<String, String>("func_77845_h", "isWolfsFavoriteMeat"));
+ mInitMap.put(new Pair<String, String>("func_77848_i", "setAlwaysEdible"));
+ mInitMap.put(new Pair<String, String>("func_77849_c", "onFoodEaten"));
+ mInitMap.put(new Pair<String, String>("func_77861_e", "getToolMaterialName"));
+ mInitMap.put(new Pair<String, String>("func_77872_a", "updateMapData"));
+ mInitMap.put(new Pair<String, String>("func_77873_a", "getMapData"));
+ mInitMap.put(new Pair<String, String>("func_77875_a", "tryPlaceContainedLiquid"));
+ mInitMap.put(new Pair<String, String>("func_77906_a", "brewBitOperations"));
+ mInitMap.put(new Pair<String, String>("func_77907_h", "countSetFlags"));
+ mInitMap.put(new Pair<String, String>("func_77910_c", "isFlagSet"));
+ mInitMap.put(new Pair<String, String>("func_77911_a", "calcPotionLiquidColor"));
+ mInitMap.put(new Pair<String, String>("func_77912_a", "parsePotionEffects"));
+ mInitMap.put(new Pair<String, String>("func_77913_a", "applyIngredient"));
+ mInitMap.put(new Pair<String, String>("func_77914_a", "checkFlag"));
+ mInitMap.put(new Pair<String, String>("func_77916_d", "isFlagUnset"));
+ mInitMap.put(new Pair<String, String>("func_77917_b", "getPotionEffects"));
+ mInitMap.put(new Pair<String, String>("func_77942_o", "hasTagCompound"));
+ mInitMap.put(new Pair<String, String>("func_77943_a", "tryPlaceItemIntoWorld"));
+ mInitMap.put(new Pair<String, String>("func_77944_b", "copyItemStack"));
+ mInitMap.put(new Pair<String, String>("func_77945_a", "updateAnimation"));
+ mInitMap.put(new Pair<String, String>("func_77946_l", "copy"));
+ mInitMap.put(new Pair<String, String>("func_77948_v", "isItemEnchanted"));
+ mInitMap.put(new Pair<String, String>("func_77949_a", "loadItemStackFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_77950_b", "onItemUseFinish"));
+ mInitMap.put(new Pair<String, String>("func_77951_h", "isItemDamaged"));
+ mInitMap.put(new Pair<String, String>("func_77952_i", "getCurrentDurability"));
+ mInitMap.put(new Pair<String, String>("func_77953_t", "getRarity"));
+ mInitMap.put(new Pair<String, String>("func_77954_c", "getIconIndex"));
+ mInitMap.put(new Pair<String, String>("func_77955_b", "writeToNBT"));
+ mInitMap.put(new Pair<String, String>("func_77956_u", "isItemEnchantable"));
+ mInitMap.put(new Pair<String, String>("func_77957_a", "useItemRightClick"));
+ mInitMap.put(new Pair<String, String>("func_77958_k", "getMaxDurability"));
+ mInitMap.put(new Pair<String, String>("func_77959_d", "isItemStackEqual"));
+ mInitMap.put(new Pair<String, String>("func_77960_j", "getMetadata"));
+ mInitMap.put(new Pair<String, String>("func_77961_a", "hitEntity"));
+ mInitMap.put(new Pair<String, String>("func_77962_s", "hasEffect"));
+ mInitMap.put(new Pair<String, String>("func_77963_c", "readFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_77964_b", "setMetadata"));
+ mInitMap.put(new Pair<String, String>("func_77966_a", "addEnchantment"));
+ mInitMap.put(new Pair<String, String>("func_77969_a", "isItemEqual"));
+ mInitMap.put(new Pair<String, String>("func_77970_a", "areItemStackTagsEqual"));
+ mInitMap.put(new Pair<String, String>("func_77972_a", "damageItem"));
+ mInitMap.put(new Pair<String, String>("func_77973_b", "getItem"));
+ mInitMap.put(new Pair<String, String>("func_77974_b", "onPlayerStoppedUsing"));
+ mInitMap.put(new Pair<String, String>("func_77975_n", "getItemUseAction"));
+ mInitMap.put(new Pair<String, String>("func_77976_d", "getMaxStackSize"));
+ mInitMap.put(new Pair<String, String>("func_77977_a", "getUnlocalizedName"));
+ mInitMap.put(new Pair<String, String>("func_77978_p", "getTagCompound"));
+ mInitMap.put(new Pair<String, String>("func_77979_a", "splitStack"));
+ mInitMap.put(new Pair<String, String>("func_77980_a", "onCrafting"));
+ mInitMap.put(new Pair<String, String>("func_77981_g", "getHasSubtypes"));
+ mInitMap.put(new Pair<String, String>("func_77982_d", "setTagCompound"));
+ mInitMap.put(new Pair<String, String>("func_77983_a", "setTagInfo"));
+ mInitMap.put(new Pair<String, String>("func_77984_f", "isItemStackDamageable"));
+ mInitMap.put(new Pair<String, String>("func_77985_e", "isStackable"));
+ mInitMap.put(new Pair<String, String>("func_77986_q", "getEnchantmentTagList"));
+ mInitMap.put(new Pair<String, String>("func_77988_m", "getMaxItemUseDuration"));
+ mInitMap.put(new Pair<String, String>("func_77989_b", "areItemStacksEqual"));
+ mInitMap.put(new Pair<String, String>("func_77995_e", "getEnchantability"));
+ mInitMap.put(new Pair<String, String>("func_77996_d", "getHarvestLevel"));
+ mInitMap.put(new Pair<String, String>("func_77997_a", "getMaxUses"));
+ mInitMap.put(new Pair<String, String>("func_77998_b", "getEfficiencyOnProperMaterial"));
+ mInitMap.put(new Pair<String, String>("func_78000_c", "getDamageVsEntity"));
+ mInitMap.put(new Pair<String, String>("func_78013_b", "getTabLabel"));
+ mInitMap.put(new Pair<String, String>("func_78014_h", "setNoTitle"));
+ mInitMap.put(new Pair<String, String>("func_78015_f", "getBackgroundImageName"));
+ mInitMap.put(new Pair<String, String>("func_78016_d", "getTabIconItem"));
+ mInitMap.put(new Pair<String, String>("func_78017_i", "shouldHidePlayerInventory"));
+ mInitMap.put(new Pair<String, String>("func_78018_a", "displayAllReleventItems"));
+ mInitMap.put(new Pair<String, String>("func_78019_g", "drawInForegroundOfTab"));
+ mInitMap.put(new Pair<String, String>("func_78020_k", "getTabColumn"));
+ mInitMap.put(new Pair<String, String>("func_78021_a", "getTabIndex"));
+ mInitMap.put(new Pair<String, String>("func_78022_j", "setNoScrollbar"));
+ mInitMap.put(new Pair<String, String>("func_78023_l", "isTabInFirstRow"));
+ mInitMap.put(new Pair<String, String>("func_78024_c", "getTranslatedTabLabel"));
+ mInitMap.put(new Pair<String, String>("func_78025_a", "setBackgroundImageName"));
+ mInitMap.put(new Pair<String, String>("func_78044_b", "getDamageReductionAmount"));
+ mInitMap.put(new Pair<String, String>("func_78045_a", "getEnchantability"));
+ mInitMap.put(new Pair<String, String>("func_78046_a", "getDurability"));
+ mInitMap.put(new Pair<String, String>("func_78084_a", "getTextureOffset"));
+ mInitMap.put(new Pair<String, String>("func_78085_a", "setTextureOffset"));
+ mInitMap.put(new Pair<String, String>("func_78086_a", "setLivingAnimations"));
+ mInitMap.put(new Pair<String, String>("func_78087_a", "setRotationAngles"));
+ mInitMap.put(new Pair<String, String>("func_78088_a", "render"));
+ mInitMap.put(new Pair<String, String>("func_78110_b", "renderEars"));
+ mInitMap.put(new Pair<String, String>("func_78111_c", "renderCloak"));
+ mInitMap.put(new Pair<String, String>("func_78164_a", "renderSign"));
+ mInitMap.put(new Pair<String, String>("func_78214_a", "updateRotations"));
+ mInitMap.put(new Pair<String, String>("func_78231_a", "renderAll"));
+ mInitMap.put(new Pair<String, String>("func_78235_a", "flipFace"));
+ mInitMap.put(new Pair<String, String>("func_78236_a", "draw"));
+ mInitMap.put(new Pair<String, String>("func_78240_a", "setTexturePosition"));
+ mInitMap.put(new Pair<String, String>("func_78245_a", "render"));
+ mInitMap.put(new Pair<String, String>("func_78255_a", "renderStringAtPos"));
+ mInitMap.put(new Pair<String, String>("func_78256_a", "getStringWidth"));
+ mInitMap.put(new Pair<String, String>("func_78257_a", "loadGlyphTexture"));
+ mInitMap.put(new Pair<String, String>("func_78258_a", "renderString"));
+ mInitMap.put(new Pair<String, String>("func_78259_e", "sizeStringToWidth"));
+ mInitMap.put(new Pair<String, String>("func_78260_a", "getBidiFlag"));
+ mInitMap.put(new Pair<String, String>("func_78261_a", "drawStringWithShadow"));
+ mInitMap.put(new Pair<String, String>("func_78262_a", "trimStringToWidth"));
+ mInitMap.put(new Pair<String, String>("func_78263_a", "getCharWidth"));
+ mInitMap.put(new Pair<String, String>("func_78264_a", "setUnicodeFlag"));
+ mInitMap.put(new Pair<String, String>("func_78265_b", "resetStyles"));
+ mInitMap.put(new Pair<String, String>("func_78266_a", "renderDefaultChar"));
+ mInitMap.put(new Pair<String, String>("func_78267_b", "splitStringWidth"));
+ mInitMap.put(new Pair<String, String>("func_78268_b", "renderSplitString"));
+ mInitMap.put(new Pair<String, String>("func_78269_a", "trimStringToWidth"));
+ mInitMap.put(new Pair<String, String>("func_78270_c", "isFormatSpecial"));
+ mInitMap.put(new Pair<String, String>("func_78271_c", "listFormattedStringToWidth"));
+ mInitMap.put(new Pair<String, String>("func_78272_b", "isFormatColor"));
+ mInitMap.put(new Pair<String, String>("func_78273_d", "trimStringmInitMap.put(newline"));
+ mInitMap.put(new Pair<String, String>("func_78274_b", "renderStringAligned"));
+ mInitMap.put(new Pair<String, String>("func_78275_b", "setBidiFlag"));
+ mInitMap.put(new Pair<String, String>("func_78276_b", "drawString"));
+ mInitMap.put(new Pair<String, String>("func_78277_a", "renderUnicodeChar"));
+ mInitMap.put(new Pair<String, String>("func_78278_a", "renderCharAtPos"));
+ mInitMap.put(new Pair<String, String>("func_78279_b", "drawSplitString"));
+ mInitMap.put(new Pair<String, String>("func_78280_d", "wrapFormattedStringToWidth"));
+ mInitMap.put(new Pair<String, String>("func_78282_e", "getFormatFromString"));
+ mInitMap.put(new Pair<String, String>("func_78324_d", "getScaledHeight_double"));
+ mInitMap.put(new Pair<String, String>("func_78325_e", "getScaleFactor"));
+ mInitMap.put(new Pair<String, String>("func_78326_a", "getScaledWidth"));
+ mInitMap.put(new Pair<String, String>("func_78327_c", "getScaledWidth_double"));
+ mInitMap.put(new Pair<String, String>("func_78328_b", "getScaledHeight"));
+ mInitMap.put(new Pair<String, String>("func_78369_a", "setColorRGBA_F"));
+ mInitMap.put(new Pair<String, String>("func_78370_a", "setColorRGBA"));
+ mInitMap.put(new Pair<String, String>("func_78371_b", "startDrawing"));
+ mInitMap.put(new Pair<String, String>("func_78372_c", "addTranslation"));
+ mInitMap.put(new Pair<String, String>("func_78373_b", "setTranslation"));
+ mInitMap.put(new Pair<String, String>("func_78374_a", "addVertexWithUV"));
+ mInitMap.put(new Pair<String, String>("func_78375_b", "setNormal"));
+ mInitMap.put(new Pair<String, String>("func_78376_a", "setColorOpaque"));
+ mInitMap.put(new Pair<String, String>("func_78377_a", "addVertex"));
+ mInitMap.put(new Pair<String, String>("func_78378_d", "setColorOpaque_I"));
+ mInitMap.put(new Pair<String, String>("func_78379_d", "reset"));
+ mInitMap.put(new Pair<String, String>("func_78380_c", "setBrightness"));
+ mInitMap.put(new Pair<String, String>("func_78381_a", "draw"));
+ mInitMap.put(new Pair<String, String>("func_78382_b", "startDrawingQuads"));
+ mInitMap.put(new Pair<String, String>("func_78383_c", "disableColor"));
+ mInitMap.put(new Pair<String, String>("func_78384_a", "setColorRGBA_I"));
+ mInitMap.put(new Pair<String, String>("func_78385_a", "setTextureUV"));
+ mInitMap.put(new Pair<String, String>("func_78386_a", "setColorOpaque_F"));
+ mInitMap.put(new Pair<String, String>("func_78418_a", "rendersChunk"));
+ mInitMap.put(new Pair<String, String>("func_78419_a", "callLists"));
+ mInitMap.put(new Pair<String, String>("func_78420_a", "addGLRenderList"));
+ mInitMap.put(new Pair<String, String>("func_78421_b", "resetList"));
+ mInitMap.put(new Pair<String, String>("func_78422_a", "setupRenderList"));
+ mInitMap.put(new Pair<String, String>("func_78432_a", "parseUserSkin"));
+ mInitMap.put(new Pair<String, String>("func_78433_b", "setAreaOpaque"));
+ mInitMap.put(new Pair<String, String>("func_78434_a", "setAreaTransparent"));
+ mInitMap.put(new Pair<String, String>("func_78435_c", "hasTransparency"));
+ mInitMap.put(new Pair<String, String>("func_78439_a", "renderItemIn2D"));
+ mInitMap.put(new Pair<String, String>("func_78440_a", "renderItemInFirstPerson"));
+ mInitMap.put(new Pair<String, String>("func_78441_a", "updateEquippedItem"));
+ mInitMap.put(new Pair<String, String>("func_78442_d", "renderFireInFirstPerson"));
+ mInitMap.put(new Pair<String, String>("func_78443_a", "renderItem"));
+ mInitMap.put(new Pair<String, String>("func_78444_b", "resetEquippedProgress"));
+ mInitMap.put(new Pair<String, String>("func_78445_c", "resetEquippedProgress2"));
+ mInitMap.put(new Pair<String, String>("func_78446_a", "renderInsideOfBlock"));
+ mInitMap.put(new Pair<String, String>("func_78447_b", "renderOverlays"));
+ mInitMap.put(new Pair<String, String>("func_78448_c", "renderWaterOverlayTexture"));
+ mInitMap.put(new Pair<String, String>("func_78463_b", "enableLightmap"));
+ mInitMap.put(new Pair<String, String>("func_78464_a", "updateRenderer"));
+ mInitMap.put(new Pair<String, String>("func_78466_h", "updateFogColor"));
+ mInitMap.put(new Pair<String, String>("func_78467_g", "orientCamera"));
+ mInitMap.put(new Pair<String, String>("func_78468_a", "setupFog"));
+ mInitMap.put(new Pair<String, String>("func_78469_a", "setFogColorBuffer"));
+ mInitMap.put(new Pair<String, String>("func_78470_f", "updateTorchFlicker"));
+ mInitMap.put(new Pair<String, String>("func_78471_a", "renderWorld"));
+ mInitMap.put(new Pair<String, String>("func_78472_g", "updateLightmap"));
+ mInitMap.put(new Pair<String, String>("func_78473_a", "getMouseOver"));
+ mInitMap.put(new Pair<String, String>("func_78474_d", "renderRainSnow"));
+ mInitMap.put(new Pair<String, String>("func_78475_f", "setupViewBobbing"));
+ mInitMap.put(new Pair<String, String>("func_78476_b", "renderHand"));
+ mInitMap.put(new Pair<String, String>("func_78477_e", "updateFovModifierHand"));
+ mInitMap.put(new Pair<String, String>("func_78478_c", "setupOverlayRendering"));
+ mInitMap.put(new Pair<String, String>("func_78479_a", "setupCameraTransform"));
+ mInitMap.put(new Pair<String, String>("func_78480_b", "updateCameraAndRender"));
+ mInitMap.put(new Pair<String, String>("func_78481_a", "getFOVModifier"));
+ mInitMap.put(new Pair<String, String>("func_78482_e", "hurtCameraEffect"));
+ mInitMap.put(new Pair<String, String>("func_78483_a", "disableLightmap"));
+ mInitMap.put(new Pair<String, String>("func_78484_h", "addRainParticles"));
+ mInitMap.put(new Pair<String, String>("func_78546_a", "isBoundingBoxInFrustum"));
+ mInitMap.put(new Pair<String, String>("func_78547_a", "setPosition"));
+ mInitMap.put(new Pair<String, String>("func_78548_b", "isBoxInFrustum"));
+ mInitMap.put(new Pair<String, String>("func_78553_b", "isBoxInFrustum"));
+ mInitMap.put(new Pair<String, String>("func_78558_a", "getInstance"));
+ mInitMap.put(new Pair<String, String>("func_78559_a", "normalize"));
+ mInitMap.put(new Pair<String, String>("func_78560_b", "init"));
+ mInitMap.put(new Pair<String, String>("func_78713_a", "getEntityRenderObject"));
+ mInitMap.put(new Pair<String, String>("func_78714_a", "getDistanceToCamera"));
+ mInitMap.put(new Pair<String, String>("func_78715_a", "getEntityClassRenderObject"));
+ mInitMap.put(new Pair<String, String>("func_78716_a", "getFontRenderer"));
+ mInitMap.put(new Pair<String, String>("func_78717_a", "set"));
+ mInitMap.put(new Pair<String, String>("func_78738_b", "createNextComponentRandom"));
+ mInitMap.put(new Pair<String, String>("func_78743_b", "clickBlock"));
+ mInitMap.put(new Pair<String, String>("func_78744_a", "clickBlockCreative"));
+ mInitMap.put(new Pair<String, String>("func_78745_b", "flipPlayer"));
+ mInitMap.put(new Pair<String, String>("func_78746_a", "setGameType"));
+ mInitMap.put(new Pair<String, String>("func_78747_a", "enableEverythingIsScrewedUpMode"));
+ mInitMap.put(new Pair<String, String>("func_78748_a", "setPlayerCapabilities"));
+ mInitMap.put(new Pair<String, String>("func_78749_i", "extendedReach"));
+ mInitMap.put(new Pair<String, String>("func_78750_j", "syncCurrentPlayItem"));
+ mInitMap.put(new Pair<String, String>("func_78751_a", "onPlayerDestroyBlock"));
+ mInitMap.put(new Pair<String, String>("func_78752_a", "sendPacketDropItem"));
+ mInitMap.put(new Pair<String, String>("func_78753_a", "windowClick"));
+ mInitMap.put(new Pair<String, String>("func_78755_b", "shouldDrawHUD"));
+ mInitMap.put(new Pair<String, String>("func_78756_a", "sendEnchantPacket"));
+ mInitMap.put(new Pair<String, String>("func_78757_d", "getBlockReachDistance"));
+ mInitMap.put(new Pair<String, String>("func_78758_h", "isInCreativeMode"));
+ mInitMap.put(new Pair<String, String>("func_78759_c", "onPlayerDamageBlock"));
+ mInitMap.put(new Pair<String, String>("func_78760_a", "onPlayerRightClick"));
+ mInitMap.put(new Pair<String, String>("func_78761_a", "sendSlotPacket"));
+ mInitMap.put(new Pair<String, String>("func_78762_g", "isNotCreative"));
+ mInitMap.put(new Pair<String, String>("func_78763_f", "gameIsSurvivalOrAdventure"));
+ mInitMap.put(new Pair<String, String>("func_78764_a", "attackEntity"));
+ mInitMap.put(new Pair<String, String>("func_78765_e", "updateController"));
+ mInitMap.put(new Pair<String, String>("func_78766_c", "onStoppedUsingItem"));
+ mInitMap.put(new Pair<String, String>("func_78767_c", "resetBlockRemoving"));
+ mInitMap.put(new Pair<String, String>("func_78768_b", "interactWithEntitySendPacket"));
+ mInitMap.put(new Pair<String, String>("func_78769_a", "sendUseItem"));
+ mInitMap.put(new Pair<String, String>("func_78784_a", "setTextureOffset"));
+ mInitMap.put(new Pair<String, String>("func_78785_a", "render"));
+ mInitMap.put(new Pair<String, String>("func_78786_a", "addBox"));
+ mInitMap.put(new Pair<String, String>("func_78787_b", "setTextureSize"));
+ mInitMap.put(new Pair<String, String>("func_78788_d", "compileDisplayList"));
+ mInitMap.put(new Pair<String, String>("func_78789_a", "addBox"));
+ mInitMap.put(new Pair<String, String>("func_78790_a", "addBox"));
+ mInitMap.put(new Pair<String, String>("func_78791_b", "renderWithRotation"));
+ mInitMap.put(new Pair<String, String>("func_78792_a", "addChild"));
+ mInitMap.put(new Pair<String, String>("func_78793_a", "setRotationPoint"));
+ mInitMap.put(new Pair<String, String>("func_78794_c", "postRender"));
+ mInitMap.put(new Pair<String, String>("func_78815_a", "getRandomComponent"));
+ mInitMap.put(new Pair<String, String>("func_78817_b", "getNextMineShaftComponent"));
+ mInitMap.put(new Pair<String, String>("func_78836_a", "getNBTCompound"));
+ mInitMap.put(new Pair<String, String>("func_78837_a", "getServerDataFromNBTCompound"));
+ mInitMap.put(new Pair<String, String>("func_78849_a", "addServerData"));
+ mInitMap.put(new Pair<String, String>("func_78850_a", "getServerData"));
+ mInitMap.put(new Pair<String, String>("func_78851_b", "removeServerData"));
+ mInitMap.put(new Pair<String, String>("func_78853_a", "loadServerList"));
+ mInitMap.put(new Pair<String, String>("func_78855_b", "saveServerList"));
+ mInitMap.put(new Pair<String, String>("func_78856_c", "countServers"));
+ mInitMap.put(new Pair<String, String>("func_78857_a", "swapServers"));
+ mInitMap.put(new Pair<String, String>("func_78861_a", "getIP"));
+ mInitMap.put(new Pair<String, String>("func_78862_a", "parseIntWithDefault"));
+ mInitMap.put(new Pair<String, String>("func_78863_b", "getServerAddress"));
+ mInitMap.put(new Pair<String, String>("func_78864_b", "getPort"));
+ mInitMap.put(new Pair<String, String>("func_78867_a", "addBlockHitEffects"));
+ mInitMap.put(new Pair<String, String>("func_78868_a", "updateEffects"));
+ mInitMap.put(new Pair<String, String>("func_78869_b", "getStatistics"));
+ mInitMap.put(new Pair<String, String>("func_78870_a", "clearEffects"));
+ mInitMap.put(new Pair<String, String>("func_78872_b", "renderLitParticles"));
+ mInitMap.put(new Pair<String, String>("func_78873_a", "addEffect"));
+ mInitMap.put(new Pair<String, String>("func_78874_a", "renderParticles"));
+ mInitMap.put(new Pair<String, String>("func_78879_f", "getCenterY"));
+ mInitMap.put(new Pair<String, String>("func_78880_d", "getZSize"));
+ mInitMap.put(new Pair<String, String>("func_78881_e", "getCenterX"));
+ mInitMap.put(new Pair<String, String>("func_78882_c", "getYSize"));
+ mInitMap.put(new Pair<String, String>("func_78883_b", "getXSize"));
+ mInitMap.put(new Pair<String, String>("func_78884_a", "intersectsWith"));
+ mInitMap.put(new Pair<String, String>("func_78885_a", "intersectsWith"));
+ mInitMap.put(new Pair<String, String>("func_78886_a", "offset"));
+ mInitMap.put(new Pair<String, String>("func_78887_a", "getmInitMap.put(newBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_78888_b", "expandTo"));
+ mInitMap.put(new Pair<String, String>("func_78889_a", "getComponentToAddBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_78890_b", "isVecInside"));
+ mInitMap.put(new Pair<String, String>("func_78891_g", "getCenterZ"));
+ mInitMap.put(new Pair<String, String>("func_78898_a", "updatePlayerMoveState"));
+ mInitMap.put(new Pair<String, String>("func_78904_d", "callOcclusionQueryList"));
+ mInitMap.put(new Pair<String, String>("func_78905_g", "setupGLTranslation"));
+ mInitMap.put(new Pair<String, String>("func_78906_e", "skipAllRenderPasses"));
+ mInitMap.put(new Pair<String, String>("func_78908_a", "updateInFrustum"));
+ mInitMap.put(new Pair<String, String>("func_78909_a", "getGLCallListForPass"));
+ mInitMap.put(new Pair<String, String>("func_78910_b", "setDontDraw"));
+ mInitMap.put(new Pair<String, String>("func_78911_c", "stopRendering"));
+ mInitMap.put(new Pair<String, String>("func_78912_a", "distanceToEntitySquared"));
+ mInitMap.put(new Pair<String, String>("func_78913_a", "setPosition"));
+ mInitMap.put(new Pair<String, String>("func_78914_f", "markDirty"));
+ mInitMap.put(new Pair<String, String>("func_80003_ah", "getPlayerUsageSnooper"));
+ mInitMap.put(new Pair<String, String>("func_80006_f", "getUniqueID"));
+ mInitMap.put(new Pair<String, String>("func_80007_l", "getDimensionName"));
+ mInitMap.put(new Pair<String, String>("func_82114_b", "getCommandSenderPosition"));
+ mInitMap.put(new Pair<String, String>("func_82141_a", "copyDataFrom"));
+ mInitMap.put(new Pair<String, String>("func_82142_c", "setInvisible"));
+ mInitMap.put(new Pair<String, String>("func_82143_as", "getMaxFallHeight"));
+ mInitMap.put(new Pair<String, String>("func_82145_z", "getMaxInPortalTime"));
+ mInitMap.put(new Pair<String, String>("func_82147_ab", "getPortalCooldown"));
+ mInitMap.put(new Pair<String, String>("func_82148_at", "getTeleportDirection"));
+ mInitMap.put(new Pair<String, String>("func_82149_j", "copyLocationAndAnglesFrom"));
+ mInitMap.put(new Pair<String, String>("func_82150_aj", "isInvisible"));
+ mInitMap.put(new Pair<String, String>("func_82159_b", "getArmorPosition"));
+ mInitMap.put(new Pair<String, String>("func_82160_b", "dropEquipment"));
+ mInitMap.put(new Pair<String, String>("func_82161_a", "getArmorItemForSlot"));
+ mInitMap.put(new Pair<String, String>("func_82162_bC", "enchantEquipment"));
+ mInitMap.put(new Pair<String, String>("func_82164_bB", "addRandomArmor"));
+ mInitMap.put(new Pair<String, String>("func_82165_m", "isPotionActive"));
+ mInitMap.put(new Pair<String, String>("func_82166_i", "getArmSwingAnimationEnd"));
+ mInitMap.put(new Pair<String, String>("func_82167_n", "collideWithEntity"));
+ mInitMap.put(new Pair<String, String>("func_82168_bl", "updateArmSwingProgress"));
+ mInitMap.put(new Pair<String, String>("func_82169_q", "getCurrentArmor"));
+ mInitMap.put(new Pair<String, String>("func_82170_o", "removePotionEffect"));
+ mInitMap.put(new Pair<String, String>("func_82171_bF", "canBeSteered"));
+ mInitMap.put(new Pair<String, String>("func_82183_n", "getAIControlledByPlayer"));
+ mInitMap.put(new Pair<String, String>("func_82185_r", "setCollarColor"));
+ mInitMap.put(new Pair<String, String>("func_82186_bH", "getCollarColor"));
+ mInitMap.put(new Pair<String, String>("func_82187_q", "setLookingForHome"));
+ mInitMap.put(new Pair<String, String>("func_82188_j", "adjustProbability"));
+ mInitMap.put(new Pair<String, String>("func_82196_d", "attackEntityWithRangedAttack"));
+ mInitMap.put(new Pair<String, String>("func_82197_f", "setAggressive"));
+ mInitMap.put(new Pair<String, String>("func_82198_m", "getAggressive"));
+ mInitMap.put(new Pair<String, String>("func_82201_a", "setSkeletonType"));
+ mInitMap.put(new Pair<String, String>("func_82202_m", "getSkeletonType"));
+ mInitMap.put(new Pair<String, String>("func_82203_t", "getWatchedTargetId"));
+ mInitMap.put(new Pair<String, String>("func_82205_o", "isArmored"));
+ mInitMap.put(new Pair<String, String>("func_82209_a", "launchWitherSkullToCoords"));
+ mInitMap.put(new Pair<String, String>("func_82212_n", "getInvulTime"));
+ mInitMap.put(new Pair<String, String>("func_82215_s", "setInvulTime"));
+ mInitMap.put(new Pair<String, String>("func_82216_a", "launchWitherSkullToEntity"));
+ mInitMap.put(new Pair<String, String>("func_82227_f", "setChild"));
+ mInitMap.put(new Pair<String, String>("func_82228_a", "startConversion"));
+ mInitMap.put(new Pair<String, String>("func_82229_g", "setVillager"));
+ mInitMap.put(new Pair<String, String>("func_82230_o", "isConverting"));
+ mInitMap.put(new Pair<String, String>("func_82231_m", "isVillager"));
+ mInitMap.put(new Pair<String, String>("func_82232_p", "convertToVillager"));
+ mInitMap.put(new Pair<String, String>("func_82233_q", "getConversionTimeBoost"));
+ mInitMap.put(new Pair<String, String>("func_82235_h", "getIsBatHanging"));
+ mInitMap.put(new Pair<String, String>("func_82236_f", "setIsBatHanging"));
+ mInitMap.put(new Pair<String, String>("func_82238_cc", "getHideCape"));
+ mInitMap.put(new Pair<String, String>("func_82239_b", "setHideCape"));
+ mInitMap.put(new Pair<String, String>("func_82241_s", "getHideCape"));
+ mInitMap.put(new Pair<String, String>("func_82242_a", "addExperienceLevel"));
+ mInitMap.put(new Pair<String, String>("func_82243_bO", "getArmorVisibility"));
+ mInitMap.put(new Pair<String, String>("func_82244_d", "displayGUIAnvil"));
+ mInitMap.put(new Pair<String, String>("func_82245_bX", "isSpawnForced"));
+ mInitMap.put(new Pair<String, String>("func_82246_f", "isCurrentToolAdventureModeExempt"));
+ mInitMap.put(new Pair<String, String>("func_82247_a", "canPlayerEdit"));
+ mInitMap.put(new Pair<String, String>("func_82328_a", "setDirection"));
+ mInitMap.put(new Pair<String, String>("func_82329_d", "getWidthPixels"));
+ mInitMap.put(new Pair<String, String>("func_82330_g", "getHeightPixels"));
+ mInitMap.put(new Pair<String, String>("func_82333_j", "getRotation"));
+ mInitMap.put(new Pair<String, String>("func_82334_a", "setDisplayedItem"));
+ mInitMap.put(new Pair<String, String>("func_82335_i", "getDisplayedItem"));
+ mInitMap.put(new Pair<String, String>("func_82336_g", "setItemRotation"));
+ mInitMap.put(new Pair<String, String>("func_82338_g", "setAlphaF"));
+ mInitMap.put(new Pair<String, String>("func_82340_a", "setPotionDamage"));
+ mInitMap.put(new Pair<String, String>("func_82341_c", "getMotionFactor"));
+ mInitMap.put(new Pair<String, String>("func_82342_d", "isInvulnerable"));
+ mInitMap.put(new Pair<String, String>("func_82343_e", "setInvulnerable"));
+ mInitMap.put(new Pair<String, String>("func_82356_Z", "isCommandBlockEnabled"));
+ mInitMap.put(new Pair<String, String>("func_82357_ak", "getSpawnProtectionSize"));
+ mInitMap.put(new Pair<String, String>("func_82358_a", "isUsernameIndex"));
+ mInitMap.put(new Pair<String, String>("func_82359_c", "getPlayer"));
+ mInitMap.put(new Pair<String, String>("func_82360_a", "getStringFromNthArg"));
+ mInitMap.put(new Pair<String, String>("func_82362_a", "getRequiredPermissionLevel"));
+ mInitMap.put(new Pair<String, String>("func_82363_b", "parseDouble"));
+ mInitMap.put(new Pair<String, String>("func_82366_d", "getGameRules"));
+ mInitMap.put(new Pair<String, String>("func_82370_a", "getUsernameIndex"));
+ mInitMap.put(new Pair<String, String>("func_82371_e", "getDistanceSquaredToChunkCoordinates"));
+ mInitMap.put(new Pair<String, String>("func_82372_a", "getMovementDirection"));
+ mInitMap.put(new Pair<String, String>("func_82375_f", "getDefaultMinimumLevel"));
+ mInitMap.put(new Pair<String, String>("func_82376_e", "getDefaultMaximumLevel"));
+ mInitMap.put(new Pair<String, String>("func_82377_a", "matchesMultiplePlayers"));
+ mInitMap.put(new Pair<String, String>("func_82378_b", "hasArguments"));
+ mInitMap.put(new Pair<String, String>("func_82379_d", "getDefaultMaximumRange"));
+ mInitMap.put(new Pair<String, String>("func_82380_c", "matchPlayers"));
+ mInitMap.put(new Pair<String, String>("func_82381_h", "getArgumentMap"));
+ mInitMap.put(new Pair<String, String>("func_82382_g", "getDefaultCount"));
+ mInitMap.put(new Pair<String, String>("func_82383_a", "hasTheseArguments"));
+ mInitMap.put(new Pair<String, String>("func_82384_c", "getDefaultMinimumRange"));
+ mInitMap.put(new Pair<String, String>("func_82386_a", "matchOnePlayer"));
+ mInitMap.put(new Pair<String, String>("func_82403_a", "renderFrameItemAsBlock"));
+ mInitMap.put(new Pair<String, String>("func_82406_b", "renderItemAndEffectIntoGUI"));
+ mInitMap.put(new Pair<String, String>("func_82441_a", "renderFirstPersonArm"));
+ mInitMap.put(new Pair<String, String>("func_82448_a", "transferEntityToWorld"));
+ mInitMap.put(new Pair<String, String>("func_82449_a", "findPlayers"));
+ mInitMap.put(new Pair<String, String>("func_82482_a", "dispense"));
+ mInitMap.put(new Pair<String, String>("func_82485_a", "playDispenseSound"));
+ mInitMap.put(new Pair<String, String>("func_82486_a", "doDispense"));
+ mInitMap.put(new Pair<String, String>("func_82487_b", "dispenseStack"));
+ mInitMap.put(new Pair<String, String>("func_82489_a", "spawnDispenseParticles"));
+ mInitMap.put(new Pair<String, String>("func_82499_a", "getProjectileEntity"));
+ mInitMap.put(new Pair<String, String>("func_82565_a", "canEntityStandAt"));
+ mInitMap.put(new Pair<String, String>("func_82571_y", "getGeneratorOptions"));
+ mInitMap.put(new Pair<String, String>("func_82572_b", "incrementTotalWorldTime"));
+ mInitMap.put(new Pair<String, String>("func_82573_f", "getWorldTotalTime"));
+ mInitMap.put(new Pair<String, String>("func_82574_x", "getGameRulesInstance"));
+ mInitMap.put(new Pair<String, String>("func_82580_o", "removeTag"));
+ mInitMap.put(new Pair<String, String>("func_82581_a", "createCrashReport"));
+ mInitMap.put(new Pair<String, String>("func_82582_d", "hasNoTags"));
+ mInitMap.put(new Pair<String, String>("func_82594_a", "getObject"));
+ mInitMap.put(new Pair<String, String>("func_82595_a", "putObject"));
+ mInitMap.put(new Pair<String, String>("func_82599_e", "getFrontOffsetZ"));
+ mInitMap.put(new Pair<String, String>("func_82600_a", "getFront"));
+ mInitMap.put(new Pair<String, String>("func_82601_c", "getFrontOffsetX"));
+ mInitMap.put(new Pair<String, String>("func_82615_a", "getX"));
+ mInitMap.put(new Pair<String, String>("func_82616_c", "getZ"));
+ mInitMap.put(new Pair<String, String>("func_82617_b", "getY"));
+ mInitMap.put(new Pair<String, String>("func_82618_k", "getWorld"));
+ mInitMap.put(new Pair<String, String>("func_82620_h", "getBlockMetadata"));
+ mInitMap.put(new Pair<String, String>("func_82621_f", "getZInt"));
+ mInitMap.put(new Pair<String, String>("func_82622_e", "getYInt"));
+ mInitMap.put(new Pair<String, String>("func_82623_d", "getXInt"));
+ mInitMap.put(new Pair<String, String>("func_82632_g", "boostSpeed"));
+ mInitMap.put(new Pair<String, String>("func_82633_h", "isControlledByPlayer"));
+ mInitMap.put(new Pair<String, String>("func_82634_f", "isSpeedBoosted"));
+ mInitMap.put(new Pair<String, String>("func_82644_b", "getWorldFeatures"));
+ mInitMap.put(new Pair<String, String>("func_82647_a", "setBiome"));
+ mInitMap.put(new Pair<String, String>("func_82648_a", "getBiome"));
+ mInitMap.put(new Pair<String, String>("func_82649_e", "getDefaultFlatGenerator"));
+ mInitMap.put(new Pair<String, String>("func_82650_c", "getFlatLayers"));
+ mInitMap.put(new Pair<String, String>("func_82651_a", "createFlatGeneratorFromString"));
+ mInitMap.put(new Pair<String, String>("func_82656_d", "getMinY"));
+ mInitMap.put(new Pair<String, String>("func_82657_a", "getLayerCount"));
+ mInitMap.put(new Pair<String, String>("func_82658_c", "getFillBlockMeta"));
+ mInitMap.put(new Pair<String, String>("func_82660_d", "setMinY"));
+ mInitMap.put(new Pair<String, String>("func_82667_a", "getScatteredFeatureSpawnList"));
+ mInitMap.put(new Pair<String, String>("func_82683_b", "setDefaultPlayerReputation"));
+ mInitMap.put(new Pair<String, String>("func_82684_a", "getReputationForPlayer"));
+ mInitMap.put(new Pair<String, String>("func_82686_i", "isMatingSeason"));
+ mInitMap.put(new Pair<String, String>("func_82687_d", "isPlayerReputationTooLow"));
+ mInitMap.put(new Pair<String, String>("func_82688_a", "setReputationForPlayer"));
+ mInitMap.put(new Pair<String, String>("func_82689_b", "writeVillageDataToNBT"));
+ mInitMap.put(new Pair<String, String>("func_82690_a", "readVillageDataFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_82692_h", "endMatingSeason"));
+ mInitMap.put(new Pair<String, String>("func_82695_e", "recreateStructures"));
+ mInitMap.put(new Pair<String, String>("func_82704_a", "isEntityApplicable"));
+ mInitMap.put(new Pair<String, String>("func_82705_e", "getAnimal"));
+ mInitMap.put(new Pair<String, String>("func_82708_h", "setObjectWatched"));
+ mInitMap.put(new Pair<String, String>("func_82709_a", "addObjectByDataType"));
+ mInitMap.put(new Pair<String, String>("func_82710_f", "getWatchableObjectItemStack"));
+ mInitMap.put(new Pair<String, String>("func_82712_a", "parseDoubleWithDefault"));
+ mInitMap.put(new Pair<String, String>("func_82713_a", "parseDoubleWithDefaultAndMax"));
+ mInitMap.put(new Pair<String, String>("func_82714_a", "parseIntWithDefaultAndMax"));
+ mInitMap.put(new Pair<String, String>("func_82715_a", "parseIntWithDefault"));
+ mInitMap.put(new Pair<String, String>("func_82716_a", "getRandomDoubleInRange"));
+ mInitMap.put(new Pair<String, String>("func_82719_a", "writeCustomPotionEffectToNBT"));
+ mInitMap.put(new Pair<String, String>("func_82720_e", "getIsAmbient"));
+ mInitMap.put(new Pair<String, String>("func_82721_a", "setSplashPotion"));
+ mInitMap.put(new Pair<String, String>("func_82722_b", "readCustomPotionEffectFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_82725_o", "isMagicDamage"));
+ mInitMap.put(new Pair<String, String>("func_82726_p", "setMagicDamage"));
+ mInitMap.put(new Pair<String, String>("func_82733_a", "selectEntitiesWithinAABB"));
+ mInitMap.put(new Pair<String, String>("func_82734_g", "getChunkHeightMapMinimum"));
+ mInitMap.put(new Pair<String, String>("func_82736_K", "getGameRules"));
+ mInitMap.put(new Pair<String, String>("func_82737_E", "getTotalWorldTime"));
+ mInitMap.put(new Pair<String, String>("func_82739_e", "playBroadcastSound"));
+ mInitMap.put(new Pair<String, String>("func_82742_i", "resetUpdateEntityTick"));
+ mInitMap.put(new Pair<String, String>("func_82743_f", "getCreationCloudUpdateTick"));
+ mInitMap.put(new Pair<String, String>("func_82744_b", "setCloudUpdateTick"));
+ mInitMap.put(new Pair<String, String>("func_82746_a", "broadcastSound"));
+ mInitMap.put(new Pair<String, String>("func_82747_f", "getWorldTypeID"));
+ mInitMap.put(new Pair<String, String>("func_82750_a", "setWorldName"));
+ mInitMap.put(new Pair<String, String>("func_82752_c", "isAdventure"));
+ mInitMap.put(new Pair<String, String>("func_82753_a", "setPriority"));
+ mInitMap.put(new Pair<String, String>("func_82756_a", "getGameRuleStringValue"));
+ mInitMap.put(new Pair<String, String>("func_82757_a", "setValue"));
+ mInitMap.put(new Pair<String, String>("func_82758_b", "getGameRuleBooleanValue"));
+ mInitMap.put(new Pair<String, String>("func_82763_b", "getRules"));
+ mInitMap.put(new Pair<String, String>("func_82764_b", "setOrCreateGameRule"));
+ mInitMap.put(new Pair<String, String>("func_82765_e", "hasRule"));
+ mInitMap.put(new Pair<String, String>("func_82766_b", "getGameRuleBooleanValue"));
+ mInitMap.put(new Pair<String, String>("func_82767_a", "getGameRuleStringValue"));
+ mInitMap.put(new Pair<String, String>("func_82768_a", "readGameRulesFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_82769_a", "addGameRule"));
+ mInitMap.put(new Pair<String, String>("func_82770_a", "writeGameRulesToNBT"));
+ mInitMap.put(new Pair<String, String>("func_82781_a", "getEnchantments"));
+ mInitMap.put(new Pair<String, String>("func_82782_a", "setEnchantments"));
+ mInitMap.put(new Pair<String, String>("func_82784_g", "isRecipeDisabled"));
+ mInitMap.put(new Pair<String, String>("func_82787_a", "findMatchingRecipe"));
+ mInitMap.put(new Pair<String, String>("func_82788_x", "canItemEditBlocks"));
+ mInitMap.put(new Pair<String, String>("func_82789_a", "getIsRepairable"));
+ mInitMap.put(new Pair<String, String>("func_82790_a", "getColorFromItemStack"));
+ mInitMap.put(new Pair<String, String>("func_82810_a", "createHangingEntity"));
+ mInitMap.put(new Pair<String, String>("func_82812_d", "getArmorMaterial"));
+ mInitMap.put(new Pair<String, String>("func_82814_b", "getColor"));
+ mInitMap.put(new Pair<String, String>("func_82815_c", "removeColor"));
+ mInitMap.put(new Pair<String, String>("func_82816_b_", "hasColor"));
+ mInitMap.put(new Pair<String, String>("func_82824_a", "setBossStatus"));
+ mInitMap.put(new Pair<String, String>("func_82829_a", "renderCloudsCheck"));
+ mInitMap.put(new Pair<String, String>("func_82830_a", "getNightVisionBrightness"));
+ mInitMap.put(new Pair<String, String>("func_82833_r", "getDisplayName"));
+ mInitMap.put(new Pair<String, String>("func_82835_x", "canEditBlocks"));
+ mInitMap.put(new Pair<String, String>("func_82836_z", "getItemFrame"));
+ mInitMap.put(new Pair<String, String>("func_82837_s", "hasDisplayName"));
+ mInitMap.put(new Pair<String, String>("func_82838_A", "getRepairCost"));
+ mInitMap.put(new Pair<String, String>("func_82839_y", "isOnItemFrame"));
+ mInitMap.put(new Pair<String, String>("func_82840_a", "getTooltip"));
+ mInitMap.put(new Pair<String, String>("func_82841_c", "setRepairCost"));
+ mInitMap.put(new Pair<String, String>("func_82842_a", "setItemFrame"));
+ mInitMap.put(new Pair<String, String>("func_82846_b", "transferStackInSlot"));
+ mInitMap.put(new Pair<String, String>("func_82847_b", "removeCraftingFromCrafters"));
+ mInitMap.put(new Pair<String, String>("func_82848_d", "updateRepairOutput"));
+ mInitMap.put(new Pair<String, String>("func_82850_a", "updateItemName"));
+ mInitMap.put(new Pair<String, String>("func_82869_a", "canTakeStack"));
+ mInitMap.put(new Pair<String, String>("func_82870_a", "onPickupFromSlot"));
+ mInitMap.put(new Pair<String, String>("func_82877_b", "setPlayerWalkSpeed"));
+ mInitMap.put(new Pair<String, String>("func_82879_c", "sendSettingsToServer"));
+ mInitMap.put(new Pair<String, String>("func_82883_a", "getUnicodeFlag"));
+ mInitMap.put(new Pair<String, String>("func_82889_a", "getBatSize"));
+ mInitMap.put(new Pair<String, String>("func_83015_S", "getCurrentDate"));
+ mInitMap.put(new Pair<String, String>("func_85029_a", "addEntityCrashInfo"));
+ mInitMap.put(new Pair<String, String>("func_85030_a", "playSound"));
+ mInitMap.put(new Pair<String, String>("func_85031_j", "hitByEntity"));
+ mInitMap.put(new Pair<String, String>("func_85032_ar", "isEntityInvulnerable"));
+ mInitMap.put(new Pair<String, String>("func_85033_bc", "collideWithNearbyEntities"));
+ mInitMap.put(new Pair<String, String>("func_85034_r", "setArrowCountInEntity"));
+ mInitMap.put(new Pair<String, String>("func_85035_bI", "getArrowCountInEntity"));
+ mInitMap.put(new Pair<String, String>("func_85036_m", "setCombatTask"));
+ mInitMap.put(new Pair<String, String>("func_85039_t", "addScore"));
+ mInitMap.put(new Pair<String, String>("func_85040_s", "setScore"));
+ mInitMap.put(new Pair<String, String>("func_85052_h", "getThrower"));
+ mInitMap.put(new Pair<String, String>("func_85054_d", "searchForOtherItemsNearby"));
+ mInitMap.put(new Pair<String, String>("func_85055_a", "makeCrashReport"));
+ mInitMap.put(new Pair<String, String>("func_85056_g", "getCategory"));
+ mInitMap.put(new Pair<String, String>("func_85057_a", "makeCategoryDepth"));
+ mInitMap.put(new Pair<String, String>("func_85058_a", "makeCategory"));
+ mInitMap.put(new Pair<String, String>("func_85069_a", "firstTwoElementsOfStackTraceMatch"));
+ mInitMap.put(new Pair<String, String>("func_85070_b", "trimStackTraceEntriesFromBottom"));
+ mInitMap.put(new Pair<String, String>("func_85071_a", "getLocationInfo"));
+ mInitMap.put(new Pair<String, String>("func_85072_a", "appendToStringBuilder"));
+ mInitMap.put(new Pair<String, String>("func_85073_a", "getPrunedStackTrace"));
+ mInitMap.put(new Pair<String, String>("func_85093_e", "renderArrowsStuckInEntity"));
+ mInitMap.put(new Pair<String, String>("func_85094_b", "renderDebugBoundingBox"));
+ mInitMap.put(new Pair<String, String>("func_85102_a", "playSoundToNearExcept"));
+ mInitMap.put(new Pair<String, String>("func_85118_a", "addToCrashReport"));
+ mInitMap.put(new Pair<String, String>("func_85144_b", "getCacheSizes"));
+ mInitMap.put(new Pair<String, String>("func_85151_d", "getLowerChestInventory"));
+ mInitMap.put(new Pair<String, String>("func_85156_a", "removeTask"));
+ mInitMap.put(new Pair<String, String>("func_85157_q", "isAdventureModeExempt"));
+ mInitMap.put(new Pair<String, String>("func_85158_p", "setAdventureModeExempt"));
+ mInitMap.put(new Pair<String, String>("func_85173_a", "playSoundToNearExcept"));
+ mInitMap.put(new Pair<String, String>("func_85176_s", "getDefaultTeleporter"));
+ mInitMap.put(new Pair<String, String>("func_85181_a", "getRandomModelBox"));
+ mInitMap.put(new Pair<String, String>("func_85182_a", "sameToolAndBlock"));
+ mInitMap.put(new Pair<String, String>("func_85187_a", "drawString"));
+ mInitMap.put(new Pair<String, String>("func_85188_a", "makePortal"));
+ mInitMap.put(new Pair<String, String>("func_85189_a", "removeStalePortalLocations"));
+ mInitMap.put(new Pair<String, String>("func_90010_a", "isPartOfLargeChest"));
+ mInitMap.put(new Pair<String, String>("func_90011_a", "createChild"));
+ mInitMap.put(new Pair<String, String>("func_90013_b", "getDyeFromFleeceColor"));
+ mInitMap.put(new Pair<String, String>("func_90014_a", "getDyeBasedOnParents"));
+ mInitMap.put(new Pair<String, String>("func_90019_g", "applyRenderColor"));
+ mInitMap.put(new Pair<String, String>("func_90020_K", "getLimitFramerate"));
+ mInitMap.put(new Pair<String, String>("func_90022_d", "getListOfPlayers"));
+ mInitMap.put(new Pair<String, String>("func_90033_f", "canLoadWorld"));
+ mInitMap.put(new Pair<String, String>("func_90035_a", "getClassFromID"));
+ mInitMap.put(new Pair<String, String>("func_90036_a", "getFireAspectModifier"));
+ mInitMap.put(new Pair<String, String>("func_90999_ad", "canRenderOnFire"));
+ mInitMap.put(new Pair<String, String>("func_92015_f", "closeScreenNoPacket"));
+ mInitMap.put(new Pair<String, String>("func_92034_a", "createParticle"));
+ mInitMap.put(new Pair<String, String>("func_92035_a", "createBall"));
+ mInitMap.put(new Pair<String, String>("func_92036_a", "createBurst"));
+ mInitMap.put(new Pair<String, String>("func_92038_a", "createShaped"));
+ mInitMap.put(new Pair<String, String>("func_92043_f", "setTwinkle"));
+ mInitMap.put(new Pair<String, String>("func_92044_a", "setColour"));
+ mInitMap.put(new Pair<String, String>("func_92045_e", "setTrail"));
+ mInitMap.put(new Pair<String, String>("func_92046_g", "setFadeColour"));
+ mInitMap.put(new Pair<String, String>("func_92058_a", "setEntityItemStack"));
+ mInitMap.put(new Pair<String, String>("func_92059_d", "getEntityItem"));
+ mInitMap.put(new Pair<String, String>("func_92085_d", "getIsBlank"));
+ mInitMap.put(new Pair<String, String>("func_92087_a", "causeThornsDamage"));
+ mInitMap.put(new Pair<String, String>("func_92088_a", "makeFireworks"));
+ mInitMap.put(new Pair<String, String>("func_92089_a", "canApply"));
+ mInitMap.put(new Pair<String, String>("func_92093_a", "getFireTimeForEntity"));
+ mInitMap.put(new Pair<String, String>("func_92097_a", "negateDamage"));
+ mInitMap.put(new Pair<String, String>("func_92103_a", "addRecipe"));
+ mInitMap.put(new Pair<String, String>("func_92111_a", "getEnchantedItemStack"));
+ mInitMap.put(new Pair<String, String>("func_92115_a", "addEnchantment"));
+ mInitMap.put(new Pair<String, String>("func_92116_a", "addEnchantmentBooksToList"));
+ mInitMap.put(new Pair<String, String>("func_94041_b", "isItemValidForSlot"));
+ mInitMap.put(new Pair<String, String>("func_94053_h", "nextTextureIndexX"));
+ mInitMap.put(new Pair<String, String>("func_94056_bM", "hasCustomNameTag"));
+ mInitMap.put(new Pair<String, String>("func_94057_bL", "getCustomNameTag"));
+ mInitMap.put(new Pair<String, String>("func_94058_c", "setCustomNameTag"));
+ mInitMap.put(new Pair<String, String>("func_94059_bO", "getAlwaysRenderNameTagForRender"));
+ mInitMap.put(new Pair<String, String>("func_94061_f", "setAlwaysRenderNameTag"));
+ mInitMap.put(new Pair<String, String>("func_94062_bN", "getAlwaysRenderNameTag"));
+ mInitMap.put(new Pair<String, String>("func_94065_a", "drawTexturedModelRectFromIcon"));
+ mInitMap.put(new Pair<String, String>("func_94083_c", "getTntPlacedBy"));
+ mInitMap.put(new Pair<String, String>("func_94085_r", "getDefaultDisplayTileOffset"));
+ mInitMap.put(new Pair<String, String>("func_94086_l", "setDisplayTileOffset"));
+ mInitMap.put(new Pair<String, String>("func_94087_l", "getMinecartType"));
+ mInitMap.put(new Pair<String, String>("func_94090_a", "createMinecart"));
+ mInitMap.put(new Pair<String, String>("func_94092_k", "setDisplayTileData"));
+ mInitMap.put(new Pair<String, String>("func_94095_a", "killMinecart"));
+ mInitMap.put(new Pair<String, String>("func_94096_e", "setHasDisplayTile"));
+ mInitMap.put(new Pair<String, String>("func_94097_p", "getDefaultDisplayTileData"));
+ mInitMap.put(new Pair<String, String>("func_94098_o", "getDisplayTileData"));
+ mInitMap.put(new Pair<String, String>("func_94099_q", "getDisplayTileOffset"));
+ mInitMap.put(new Pair<String, String>("func_94100_s", "hasDisplayTile"));
+ mInitMap.put(new Pair<String, String>("func_94101_h", "applyDrag"));
+ mInitMap.put(new Pair<String, String>("func_94103_c", "explodeCart"));
+ mInitMap.put(new Pair<String, String>("func_94105_c", "ignite"));
+ mInitMap.put(new Pair<String, String>("func_94107_f", "setMinecartPowered"));
+ mInitMap.put(new Pair<String, String>("func_94108_c", "isMinecartPowered"));
+ mInitMap.put(new Pair<String, String>("func_94128_d", "getSlotsForFace"));
+ mInitMap.put(new Pair<String, String>("func_94140_a", "registerDestroyBlockIcons"));
+ mInitMap.put(new Pair<String, String>("func_94143_a", "updateIcons"));
+ mInitMap.put(new Pair<String, String>("func_94148_a", "renderItemOverlayIntoGUI"));
+ mInitMap.put(new Pair<String, String>("func_94149_a", "renderIcon"));
+ mInitMap.put(new Pair<String, String>("func_94178_a", "updateIcons"));
+ mInitMap.put(new Pair<String, String>("func_94182_a", "addSlot"));
+ mInitMap.put(new Pair<String, String>("func_94183_a", "getStitchHolder"));
+ mInitMap.put(new Pair<String, String>("func_94184_a", "getAllStitchSlots"));
+ mInitMap.put(new Pair<String, String>("func_94185_c", "getOriginY"));
+ mInitMap.put(new Pair<String, String>("func_94186_b", "getOriginX"));
+ mInitMap.put(new Pair<String, String>("func_94194_d", "rotate"));
+ mInitMap.put(new Pair<String, String>("func_94195_e", "isRotated"));
+ mInitMap.put(new Pair<String, String>("func_94196_a", "setmInitMap.put(newDimension"));
+ mInitMap.put(new Pair<String, String>("func_94197_a", "getWidth"));
+ mInitMap.put(new Pair<String, String>("func_94199_b", "getHeight"));
+ mInitMap.put(new Pair<String, String>("func_94206_g", "getMinV"));
+ mInitMap.put(new Pair<String, String>("func_94207_b", "getInterpolatedV"));
+ mInitMap.put(new Pair<String, String>("func_94209_e", "getMinU"));
+ mInitMap.put(new Pair<String, String>("func_94210_h", "getMaxV"));
+ mInitMap.put(new Pair<String, String>("func_94211_a", "getIconWidth"));
+ mInitMap.put(new Pair<String, String>("func_94212_f", "getMaxU"));
+ mInitMap.put(new Pair<String, String>("func_94214_a", "getInterpolatedU"));
+ mInitMap.put(new Pair<String, String>("func_94215_i", "getIconName"));
+ mInitMap.put(new Pair<String, String>("func_94216_b", "getIconHeight"));
+ mInitMap.put(new Pair<String, String>("func_94217_a", "copyFrom"));
+ mInitMap.put(new Pair<String, String>("func_94219_l", "updateAnimation"));
+ mInitMap.put(new Pair<String, String>("func_94241_a", "updateCompass"));
+ mInitMap.put(new Pair<String, String>("func_94245_a", "registerIcon"));
+ mInitMap.put(new Pair<String, String>("func_94248_c", "updateAnimations"));
+ mInitMap.put(new Pair<String, String>("func_94277_a", "bindTexture"));
+ mInitMap.put(new Pair<String, String>("func_94305_f", "doStitch"));
+ mInitMap.put(new Pair<String, String>("func_94309_g", "getStichSlots"));
+ mInitMap.put(new Pair<String, String>("func_94310_b", "allocateSlot"));
+ mInitMap.put(new Pair<String, String>("func_94311_c", "expandAndAllocateSlot"));
+ mInitMap.put(new Pair<String, String>("func_94520_b", "isKeyTranslated"));
+ mInitMap.put(new Pair<String, String>("func_94522_b", "canTranslate"));
+ mInitMap.put(new Pair<String, String>("func_94525_a", "computeStackSize"));
+ mInitMap.put(new Pair<String, String>("func_94526_b", "calcRedstoneFromInventory"));
+ mInitMap.put(new Pair<String, String>("func_94527_a", "canAddItemToSlot"));
+ mInitMap.put(new Pair<String, String>("func_94528_d", "isValidDragMode"));
+ mInitMap.put(new Pair<String, String>("func_94529_b", "extractDragMode"));
+ mInitMap.put(new Pair<String, String>("func_94531_b", "canDragIntoSlot"));
+ mInitMap.put(new Pair<String, String>("func_94532_c", "getDragEvent"));
+ mInitMap.put(new Pair<String, String>("func_94533_d", "resetDrag"));
+ mInitMap.put(new Pair<String, String>("func_94539_a", "setExplosionSource"));
+ mInitMap.put(new Pair<String, String>("func_94540_d", "setExplosion"));
+ mInitMap.put(new Pair<String, String>("func_94541_c", "isExplosion"));
+ mInitMap.put(new Pair<String, String>("func_94560_a", "getDamageSrc"));
+ mInitMap.put(new Pair<String, String>("func_94572_D", "getStrongestIndirectPower"));
+ mInitMap.put(new Pair<String, String>("func_94574_k", "getIndirectPowerOutput"));
+ mInitMap.put(new Pair<String, String>("func_94576_a", "getEntitiesWithinAABBExcludingEntity"));
+ mInitMap.put(new Pair<String, String>("func_94577_B", "getBlockPowerInput"));
+ mInitMap.put(new Pair<String, String>("func_94581_a", "registerIcons"));
+ mInitMap.put(new Pair<String, String>("func_94599_c", "getItemIconForUseDuration"));
+ mInitMap.put(new Pair<String, String>("func_94602_b", "getBackgroundIcon"));
+ mInitMap.put(new Pair<String, String>("func_94608_d", "getItemSpriteNumber"));
+ mInitMap.put(new Pair<String, String>("func_94613_c", "getExplosivePlacedBy"));
+ mInitMap.put(new Pair<String, String>("func_94901_k", "getSpriteNumber"));
+ mInitMap.put(new Pair<String, String>("func_96092_aw", "isPushedByWater"));
+ mInitMap.put(new Pair<String, String>("func_96094_a", "setMinecartName"));
+ mInitMap.put(new Pair<String, String>("func_96095_a", "onActivatorRailPass"));
+ mInitMap.put(new Pair<String, String>("func_96096_ay", "isIgnited"));
+ mInitMap.put(new Pair<String, String>("func_96107_aA", "getXPos"));
+ mInitMap.put(new Pair<String, String>("func_96108_aC", "getZPos"));
+ mInitMap.put(new Pair<String, String>("func_96109_aB", "getYPos"));
+ mInitMap.put(new Pair<String, String>("func_96110_f", "setBlocked"));
+ mInitMap.put(new Pair<String, String>("func_96111_ay", "getBlocked"));
+ mInitMap.put(new Pair<String, String>("func_96120_a", "setEquipmentDropChance"));
+ mInitMap.put(new Pair<String, String>("func_96122_a", "canAttackPlayer"));
+ mInitMap.put(new Pair<String, String>("func_96123_co", "getWorldScoreboard"));
+ mInitMap.put(new Pair<String, String>("func_96124_cp", "getTeam"));
+ mInitMap.put(new Pair<String, String>("func_96125_a", "displayGUIHopperMinecart"));
+ mInitMap.put(new Pair<String, String>("func_96136_a", "renderScoreboard"));
+ mInitMap.put(new Pair<String, String>("func_96290_a", "isBlockProtected"));
+ mInitMap.put(new Pair<String, String>("func_96296_a", "getValidValues"));
+ mInitMap.put(new Pair<String, String>("func_96297_d", "getFriendlyName"));
+ mInitMap.put(new Pair<String, String>("func_96298_a", "getFormattingCode"));
+ mInitMap.put(new Pair<String, String>("func_96300_b", "getValueByName"));
+ mInitMap.put(new Pair<String, String>("func_96301_b", "isFancyStyling"));
+ mInitMap.put(new Pair<String, String>("func_96302_c", "isColor"));
+ mInitMap.put(new Pair<String, String>("func_96332_d", "getPlayerName"));
+ mInitMap.put(new Pair<String, String>("func_96333_a", "joinNiceStringFromCollection"));
+ mInitMap.put(new Pair<String, String>("func_96441_U", "getScoreboard"));
+ mInitMap.put(new Pair<String, String>("func_96443_a", "setWorldScoreboard"));
+ mInitMap.put(new Pair<String, String>("func_96449_a", "renderOffsetLivingLabel"));
+ mInitMap.put(new Pair<String, String>("func_96457_a", "matchesScoreboardCriteria"));
+ mInitMap.put(new Pair<String, String>("func_96508_e", "getTeam"));
+ mInitMap.put(new Pair<String, String>("func_96509_i", "getPlayersTeam"));
+ mInitMap.put(new Pair<String, String>("func_96511_d", "removeTeam"));
+ mInitMap.put(new Pair<String, String>("func_96512_b", "removePlayerFromTeam"));
+ mInitMap.put(new Pair<String, String>("func_96514_c", "getScoreObjectives"));
+ mInitMap.put(new Pair<String, String>("func_96517_b", "getObjectiveDisplaySlot"));
+ mInitMap.put(new Pair<String, String>("func_96518_b", "getObjective"));
+ mInitMap.put(new Pair<String, String>("func_96523_a", "broadcastTeamCreated"));
+ mInitMap.put(new Pair<String, String>("func_96524_g", "removePlayerFromTeams"));
+ mInitMap.put(new Pair<String, String>("func_96525_g", "getTeams"));
+ mInitMap.put(new Pair<String, String>("func_96526_d", "getObjectiveNames"));
+ mInitMap.put(new Pair<String, String>("func_96527_f", "createTeam"));
+ mInitMap.put(new Pair<String, String>("func_96529_a", "getValueFromObjective"));
+ mInitMap.put(new Pair<String, String>("func_96530_a", "setObjectiveInDisplaySlot"));
+ mInitMap.put(new Pair<String, String>("func_96531_f", "getTeamNames"));
+ mInitMap.put(new Pair<String, String>("func_96534_i", "getSortedScores"));
+ mInitMap.put(new Pair<String, String>("func_96535_a", "addScoreObjective"));
+ mInitMap.put(new Pair<String, String>("func_96537_j", "getObjectiveDisplaySlotNumber"));
+ mInitMap.put(new Pair<String, String>("func_96538_b", "broadcastTeamRemoved"));
+ mInitMap.put(new Pair<String, String>("func_96539_a", "getObjectiveInDisplaySlot"));
+ mInitMap.put(new Pair<String, String>("func_96559_d", "getFrontOffsetY"));
+ mInitMap.put(new Pair<String, String>("func_96631_a", "attemptDamageItem"));
+ mInitMap.put(new Pair<String, String>("func_96636_a", "getName"));
+ mInitMap.put(new Pair<String, String>("func_96637_b", "isReadOnly"));
+ mInitMap.put(new Pair<String, String>("func_96646_b", "decreaseScore"));
+ mInitMap.put(new Pair<String, String>("func_96647_c", "setScorePoints"));
+ mInitMap.put(new Pair<String, String>("func_96649_a", "increseScore"));
+ mInitMap.put(new Pair<String, String>("func_96650_f", "getScoreScoreboard"));
+ mInitMap.put(new Pair<String, String>("func_96652_c", "getScorePoints"));
+ mInitMap.put(new Pair<String, String>("func_96653_e", "getPlayerName"));
+ mInitMap.put(new Pair<String, String>("func_96660_a", "setAllowFriendlyFire"));
+ mInitMap.put(new Pair<String, String>("func_96661_b", "getRegisteredName"));
+ mInitMap.put(new Pair<String, String>("func_96662_c", "setNameSuffix"));
+ mInitMap.put(new Pair<String, String>("func_96663_f", "getColorSuffix"));
+ mInitMap.put(new Pair<String, String>("func_96664_a", "setTeamName"));
+ mInitMap.put(new Pair<String, String>("func_96665_g", "getAllowFriendlyFire"));
+ mInitMap.put(new Pair<String, String>("func_96666_b", "setNamePrefix"));
+ mInitMap.put(new Pair<String, String>("func_96667_a", "formatPlayerName"));
+ mInitMap.put(new Pair<String, String>("func_96668_e", "getColorPrefix"));
+ mInitMap.put(new Pair<String, String>("func_96670_d", "getMembershipCollection"));
+ mInitMap.put(new Pair<String, String>("func_96678_d", "getDisplayName"));
+ mInitMap.put(new Pair<String, String>("func_96679_b", "getName"));
+ mInitMap.put(new Pair<String, String>("func_96680_c", "getCriteria"));
+ mInitMap.put(new Pair<String, String>("func_96681_a", "setDisplayName"));
+ mInitMap.put(new Pair<String, String>("func_96682_a", "getScoreboard"));
+ mInitMap.put(new Pair<String, String>("func_98034_c", "isInvisibleToPlayer"));
+ mInitMap.put(new Pair<String, String>("func_98035_c", "writeMountToNBT"));
+ mInitMap.put(new Pair<String, String>("func_98042_n", "setTransferTicker"));
+ mInitMap.put(new Pair<String, String>("func_98043_aE", "canTransfer"));
+ mInitMap.put(new Pair<String, String>("func_98052_bS", "canPickUpLoot"));
+ mInitMap.put(new Pair<String, String>("func_98053_h", "setCanPickUpLoot"));
+ mInitMap.put(new Pair<String, String>("func_98054_a", "setScaleForAge"));
+ mInitMap.put(new Pair<String, String>("func_98055_j", "setScale"));
+ mInitMap.put(new Pair<String, String>("func_98150_a", "getAtlasSprite"));
+ mInitMap.put(new Pair<String, String>("func_98152_d", "getAllUsernames"));
+ mInitMap.put(new Pair<String, String>("func_98179_a", "computeLightValue"));
+ mInitMap.put(new Pair<String, String>("func_98265_a", "spawnEntity"));
+ mInitMap.put(new Pair<String, String>("func_98266_d", "getSpawnerZ"));
+ mInitMap.put(new Pair<String, String>("func_98268_b", "setDelayToMin"));
+ mInitMap.put(new Pair<String, String>("func_98269_i", "getRandomEntity"));
+ mInitMap.put(new Pair<String, String>("func_98270_a", "readFromNBT"));
+ mInitMap.put(new Pair<String, String>("func_98271_a", "getSpawnerWorld"));
+ mInitMap.put(new Pair<String, String>("func_98272_a", "setEntityName"));
+ mInitMap.put(new Pair<String, String>("func_98273_j", "resetTimer"));
+ mInitMap.put(new Pair<String, String>("func_98274_c", "getSpawnerY"));
+ mInitMap.put(new Pair<String, String>("func_98275_b", "getSpawnerX"));
+ mInitMap.put(new Pair<String, String>("func_98276_e", "getEntityNameToSpawn"));
+ mInitMap.put(new Pair<String, String>("func_98277_a", "setRandomEntity"));
+ mInitMap.put(new Pair<String, String>("func_98278_g", "updateSpawner"));
+ mInitMap.put(new Pair<String, String>("func_98279_f", "isActivated"));
+ mInitMap.put(new Pair<String, String>("func_98280_b", "writeToNBT"));
+ mInitMap.put(new Pair<String, String>("func_98281_h", "getEntityToRender"));
+ mInitMap.put(new Pair<String, String>("func_98300_b", "setSeeFriendlyInvisiblesEnabled"));
+ mInitMap.put(new Pair<String, String>("func_98306_d", "readGlyphSizes"));
+ mInitMap.put(new Pair<String, String>("func_99999_d", "run"));
+ }
+ public static void init4() {
+ mObInitMap.put(new Pair<String, String>("aqc", "net/minecraft/world/chunk/storage/IChunkLoader"));
+ mObInitMap.put(new Pair<String, String>("amd", "net/minecraft/block/BlockMycelium"));
+ mObInitMap.put(new Pair<String, String>("aag", "net/minecraft/inventory/ContainerEnchantment"));
+ mObInitMap.put(new Pair<String, String>("aie", "net/minecraft/world/biome/WorldChunkManagerHell"));
+ mObInitMap.put(new Pair<String, String>(
+ "aub", "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$DesertPyramid"));
+ mObInitMap.put(new Pair<String, String>("bue", "net/minecraft/client/stream/ChatController"));
+ mObInitMap.put(new Pair<String, String>("bqf", "net/minecraft/client/renderer/texture/TextureManager"));
+ mObInitMap.put(new Pair<String, String>("bei", "net/minecraft/client/gui/achievement/GuiAchievements"));
+ mObInitMap.put(new Pair<String, String>("bih", "net/minecraft/client/model/ModelSquid"));
+ mObInitMap.put(new Pair<String, String>("bmg", "net/minecraft/client/shader/Framebuffer"));
+ mObInitMap.put(new Pair<String, String>("na", "net/minecraft/client/network/NetHandlerHandshakeMemory"));
+ mObInitMap.put(
+ new Pair<String, String>("jb", "net/minecraft/network/play/client/C02PacketUseEntity$Action"));
+ mObInitMap.put(new Pair<String, String>("fc", "net/minecraft/util/MessageDeserializer2"));
+ mObInitMap.put(new Pair<String, String>("bd", "net/minecraft/command/server/CommandPardonIp"));
+ mObInitMap.put(new Pair<String, String>("amw", "net/minecraft/block/BlockPumpkin"));
+ mObInitMap.put(new Pair<String, String>("aey", "net/minecraft/item/crafting/RecipeFireworks"));
+ mObInitMap.put(new Pair<String, String>("aaz", "net/minecraft/inventory/ContainerDispenser"));
+ mObInitMap.put(new Pair<String, String>("aix", "net/minecraft/world/biome/BiomeGenEnd"));
+ mObInitMap.put(new Pair<String, String>("z", "net/minecraft/command/CommandHandler"));
+ mObInitMap.put(new Pair<String, String>("bqy", "net/minecraft/client/resources/IResourceManager"));
+ mObInitMap.put(new Pair<String, String>("nt", "net/minecraft/server/management/PlayerProfileCache$1"));
+ mObInitMap.put(new Pair<String, String>("ju", "net/minecraft/network/login/server/S00PacketDisconnect"));
+ mObInitMap.put(new Pair<String, String>("fv", "net/minecraft/network/play/INetHandlerPlayClient"));
+ mObInitMap.put(new Pair<String, String>("abn", "net/minecraft/item/ItemSoup"));
+ mObInitMap.put(new Pair<String, String>("afm", "net/minecraft/enchantment/EnchantmentArrowDamage"));
+ mObInitMap.put(new Pair<String, String>("brm", "net/minecraft/client/resources/SkinManager$3"));
+ mObInitMap.put(new Pair<String, String>("aqu", "net/minecraft/world/gen/ChunkProviderFlat"));
+ mObInitMap.put(new Pair<String, String>(
+ "aut", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Prison"));
+ mObInitMap.put(new Pair<String, String>("ays", "net/minecraft/world/storage/WorldInfo"));
+ mObInitMap.put(new Pair<String, String>("bbq", "net/minecraft/util/MinecraftError"));
+ mObInitMap.put(new Pair<String, String>("bfp", "net/minecraft/util/EnchantmentNameParts"));
+ mObInitMap.put(
+ new Pair<String, String>("bjo", "net/minecraft/client/multiplayer/ServerData$ServerResourceMode"));
+ mObInitMap.put(new Pair<String, String>("bnn", "net/minecraft/client/renderer/entity/RenderManager"));
+ mObInitMap.put(new Pair<String, String>("ck", "net/minecraft/dispenser/IBlockSource"));
+ mObInitMap.put(new Pair<String, String>("zp", "net/minecraft/entity/projectile/EntityWitherSkull"));
+ mObInitMap.put(
+ new Pair<String, String>("vq", "net/minecraft/entity/ai/EntityAINearestAttackableTarget$Sorter"));
+ mObInitMap.put(new Pair<String, String>("rr", "net/minecraft/potion/PotionAbsoption"));
+ mObInitMap.put(new Pair<String, String>("ns", "net/minecraft/server/management/PlayerProfileCache"));
+ mObInitMap.put(new Pair<String, String>("anj", "net/minecraft/block/BlockSapling"));
+ mObInitMap.put(new Pair<String, String>("afl", "net/minecraft/item/crafting/RecipesWeapons"));
+ mObInitMap.put(new Pair<String, String>("ajk", "net/minecraft/block/Block$2"));
+ mObInitMap.put(new Pair<String, String>("avh", "net/minecraft/world/gen/structure/MapGenStructure$3"));
+ mObInitMap.put(new Pair<String, String>("bce", "net/minecraft/client/gui/GuiLabel"));
+ mObInitMap.put(new Pair<String, String>("bgd", "net/minecraft/client/gui/ServerListEntryNormal$1"));
+ mObInitMap.put(new Pair<String, String>("brl", "net/minecraft/client/resources/SkinManager$2"));
+ mObInitMap.put(new Pair<String, String>("we", "net/minecraft/entity/passive/EntityBat"));
+ mObInitMap.put(new Pair<String, String>("og", "net/minecraft/server/management/PreYggdrasilConverter$7"));
+ mObInitMap.put(new Pair<String, String>("kh", "net/minecraft/network/status/INetHandlerStatusServer"));
+ mObInitMap.put(new Pair<String, String>("gi", "net/minecraft/network/play/server/S3APacketTabComplete"));
+ mObInitMap.put(new Pair<String, String>("aca", "net/minecraft/creativetab/CreativeTabs$4"));
+ mObInitMap.put(new Pair<String, String>("azz", "net/minecraft/scoreboard/Score"));
+ mObInitMap.put(new Pair<String, String>("bgc", "net/minecraft/client/gui/ServerListEntryNormal"));
+ mObInitMap.put(new Pair<String, String>("boa", "net/minecraft/client/renderer/entity/RenderItem$2"));
+ mObInitMap.put(new Pair<String, String>("wx", "net/minecraft/entity/IEntityMultiPart"));
+ mObInitMap.put(new Pair<String, String>("sy", "net/minecraft/entity/IEntityLivingData"));
+ mObInitMap.put(new Pair<String, String>("oz", "net/minecraft/network/rcon/RConThreadClient"));
+ mObInitMap.put(new Pair<String, String>("aoq", "net/minecraft/tileentity/TileEntityBeacon"));
+ mObInitMap.put(new Pair<String, String>("akr", "net/minecraft/block/BlockDynamicLiquid"));
+ mObInitMap.put(new Pair<String, String>("act", "net/minecraft/item/ItemFishFood"));
+ mObInitMap.put(new Pair<String, String>("ags", "net/minecraft/block/BlockEventData"));
+ mObInitMap.put(new Pair<String, String>("bss", "net/minecraft/client/audio/SoundListSerializer"));
+ mObInitMap.put(new Pair<String, String>("bot", "net/minecraft/client/renderer/entity/RenderSlime"));
+ mObInitMap.put(new Pair<String, String>("azy", "net/minecraft/scoreboard/ScorePlayerTeam"));
+ mObInitMap.put(new Pair<String, String>("bcw", "net/minecraft/client/gui/GuiYesNo"));
+ mObInitMap.put(new Pair<String, String>("bgv", "net/minecraft/client/main/Main$2"));
+ mObInitMap.put(new Pair<String, String>("bku", "net/minecraft/client/particle/EntityReddustFX"));
+ mObInitMap.put(new Pair<String, String>("pn", "net/minecraft/util/TupleIntJsonSerializable"));
+ mObInitMap.put(new Pair<String, String>("lo", "net/minecraft/network/rcon/IServer"));
+ mObInitMap.put(new Pair<String, String>("hp", "net/minecraft/network/play/server/S0APacketUseBed"));
+ mObInitMap.put(new Pair<String, String>("dq", "net/minecraft/nbt/NBTTagList"));
+ mObInitMap.put(new Pair<String, String>("adh", "net/minecraft/item/ItemMap"));
+ mObInitMap.put(new Pair<String, String>("bph", "net/minecraft/client/shader/ShaderDefault"));
+ mObInitMap.put(new Pair<String, String>("aso", "net/minecraft/world/gen/feature/WorldGenSwamp"));
+ mObInitMap.put(new Pair<String, String>("aop", "net/minecraft/block/BlockCarpet"));
+ mObInitMap.put(new Pair<String, String>("bdk", "net/minecraft/client/gui/GuiLanguage$List"));
+ mObInitMap.put(new Pair<String, String>("bhj", "net/minecraft/client/model/ModelCreeper"));
+ mObInitMap.put(new Pair<String, String>("bli", "net/minecraft/util/MovementInput"));
+ mObInitMap.put(new Pair<String, String>("ee", "net/minecraft/nbt/JsonToNBT$List"));
+ mObInitMap.put(new Pair<String, String>("af", "net/minecraft/command/server/CommandBanIp"));
+ mObInitMap.put(new Pair<String, String>("xk", "net/minecraft/entity/item/EntityItem"));
+ mObInitMap.put(new Pair<String, String>("tl", "net/minecraft/entity/ai/attributes/BaseAttributeMap"));
+ mObInitMap.put(new Pair<String, String>("pm", "net/minecraft/stats/IStatType"));
+ mObInitMap.put(
+ new Pair<String, String>("atc", "net/minecraft/world/gen/structure/StructureMineshaftStart"));
+ mObInitMap.put(new Pair<String, String>("apd", "net/minecraft/tileentity/TileEntityEnchantmentTable"));
+ mObInitMap.put(new Pair<String, String>("ale", "net/minecraft/block/BlockFurnace"));
+ mObInitMap.put(new Pair<String, String>("adg", "net/minecraft/item/ItemLeaves"));
+ mObInitMap.put(new Pair<String, String>("ahf", "net/minecraft/world/World$4"));
+ mObInitMap.put(new Pair<String, String>("axb", "net/minecraft/world/gen/layer/GenLayerAddIsland"));
+ mObInitMap.put(new Pair<String, String>("bpg", "net/minecraft/client/util/JsonBlendingMode"));
+ mObInitMap.put(
+ new Pair<String, String>("net/minecraft/realms/RealmsMth", "net/minecraft/realms/RealmsMth"));
+ mObInitMap.put(new Pair<String, String>("qa", "net/minecraft/util/IntHashMap$Entry"));
+ mObInitMap.put(new Pair<String, String>("mb", "net/minecraft/server/gui/MinecraftServerGui$3"));
+ mObInitMap.put(
+ new Pair<String, String>("ic", "net/minecraft/network/play/server/S3BPacketScoreboardObjective"));
+ mObInitMap.put(new Pair<String, String>("ed", "net/minecraft/nbt/JsonToNBT$Compound"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RendererUtility", "net/minecraft/realms/RendererUtility"));
+ mObInitMap.put(new Pair<String, String>(
+ "atv", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Stairs"));
+ mObInitMap.put(new Pair<String, String>("apw", "net/minecraft/world/chunk/EmptyChunk"));
+ mObInitMap.put(new Pair<String, String>("alx", "net/minecraft/block/BlockLog"));
+ mObInitMap.put(new Pair<String, String>("adz", "net/minecraft/item/ItemSign"));
+ mObInitMap.put(new Pair<String, String>("ahy", "net/minecraft/world/biome/BiomeCache"));
+ mObInitMap.put(new Pair<String, String>("axu", "net/minecraft/world/gen/layer/GenLayerRiver"));
+ mObInitMap.put(new Pair<String, String>("bpz", "net/minecraft/client/renderer/texture/TextureMap"));
+ mObInitMap.put(new Pair<String, String>("yr", "net/minecraft/entity/monster/EntityZombie$1"));
+ mObInitMap.put(new Pair<String, String>("us", "net/minecraft/entity/ai/EntityAIMoveThroughVillage"));
+ mObInitMap.put(new Pair<String, String>("mu", "net/minecraft/world/WorldServer$1"));
+ mObInitMap.put(
+ new Pair<String, String>("iv", "net/minecraft/network/play/client/C0FPacketConfirmTransaction"));
+ mObInitMap.put(new Pair<String, String>("ew", "net/minecraft/network/NetworkStatistics$PacketStat"));
+ mObInitMap.put(new Pair<String, String>("ax", "net/minecraft/command/server/CommandListBans"));
+ mObInitMap.put(
+ new Pair<String, String>("net/minecraft/realms/ServerPing", "net/minecraft/realms/ServerPing"));
+ mObInitMap.put(new Pair<String, String>("aqk", "net/minecraft/world/chunk/storage/AnvilChunkLoader"));
+ mObInitMap.put(new Pair<String, String>("aml", "net/minecraft/block/BlockOldLeaf"));
+ mObInitMap.put(new Pair<String, String>("aen", "net/minecraft/potion/PotionHelper"));
+ mObInitMap.put(new Pair<String, String>("aao", "net/minecraft/inventory/ContainerHorseInventory$2"));
+ mObInitMap.put(new Pair<String, String>("aim", "net/minecraft/world/biome/BiomeGenMushroomIsland"));
+ mObInitMap.put(new Pair<String, String>("o", "net/minecraft/crash/CrashReportCategory$Entry"));
+ mObInitMap.put(new Pair<String, String>("bum", "net/minecraft/client/stream/IStream"));
+ mObInitMap.put(new Pair<String, String>("bqn", "net/minecraft/client/resources/AbstractResourcePack"));
+ mObInitMap.put(new Pair<String, String>("bar", "net/minecraft/client/Minecraft$11"));
+ mObInitMap.put(new Pair<String, String>("beq", "net/minecraft/client/gui/achievement/GuiStats$Stats"));
+ mObInitMap.put(new Pair<String, String>("bip", "net/minecraft/client/model/ModelZombie"));
+ mObInitMap.put(new Pair<String, String>(
+ "bmo", "net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer"));
+ mObInitMap.put(new Pair<String, String>("ni", "net/minecraft/network/NetHandlerPlayServer$1"));
+ mObInitMap.put(new Pair<String, String>("jj", "net/minecraft/network/play/client/C0BPacketEntityAction"));
+ mObInitMap.put(new Pair<String, String>("fk", "net/minecraft/util/IChatComponent$Serializer"));
+ mObInitMap.put(new Pair<String, String>("bl", "net/minecraft/command/ServerCommandManager"));
+ mObInitMap.put(new Pair<String, String>("yq", "net/minecraft/entity/monster/EntityZombie"));
+ mObInitMap.put(new Pair<String, String>("abc", "net/minecraft/item/ItemArmor$1"));
+ mObInitMap.put(new Pair<String, String>("afb", "net/minecraft/item/crafting/RecipesMapCloning"));
+ mObInitMap.put(new Pair<String, String>(
+ "brb", "net/minecraft/client/resources/ResourcePackFileNotFoundException"));
+ mObInitMap.put(new Pair<String, String>("aqj", "net/minecraft/world/chunk/storage/RegionFileCache"));
+ mObInitMap.put(
+ new Pair<String, String>("aui", "net/minecraft/world/gen/structure/StructureStrongholdPieces"));
+ mObInitMap.put(new Pair<String, String>("bbf", "net/minecraft/client/Minecraft$9"));
+ mObInitMap.put(new Pair<String, String>("bfe", "net/minecraft/client/gui/GuiScreenBook"));
+ mObInitMap.put(new Pair<String, String>("bjd", "net/minecraft/client/multiplayer/ChunkProviderClient"));
+ mObInitMap.put(new Pair<String, String>("bnc", "net/minecraft/client/renderer/entity/RenderBat"));
+ mObInitMap.put(new Pair<String, String>("ze", "net/minecraft/entity/projectile/EntityFireball"));
+ mObInitMap.put(new Pair<String, String>("vf", "net/minecraft/entity/ai/EntityAIRestrictSun"));
+ mObInitMap.put(new Pair<String, String>("rg", "net/minecraft/client/renderer/texture/IIconRegister"));
+ mObInitMap.put(new Pair<String, String>("afa", "net/minecraft/item/crafting/FurnaceRecipes"));
+ mObInitMap.put(new Pair<String, String>("bby", "net/minecraft/client/gui/MapItemRenderer$1"));
+ mObInitMap.put(new Pair<String, String>("bfx", "net/minecraft/client/gui/inventory/GuiEditSign"));
+ mObInitMap.put(new Pair<String, String>("bra", "net/minecraft/client/resources/IResourcePack"));
+ mObInitMap.put(new Pair<String, String>("zx", "net/minecraft/inventory/ContainerBeacon"));
+ mObInitMap.put(new Pair<String, String>("vy", "net/minecraft/village/VillageDoorInfo"));
+ mObInitMap.put(new Pair<String, String>("arq", "net/minecraft/world/gen/feature/WorldGenFire"));
+ mObInitMap.put(new Pair<String, String>("anr", "net/minecraft/block/BlockStainedGlassPane"));
+ mObInitMap.put(new Pair<String, String>("abu", "net/minecraft/creativetab/CreativeTabs$1"));
+ mObInitMap.put(new Pair<String, String>("aft", "net/minecraft/enchantment/Enchantment"));
+ mObInitMap.put(new Pair<String, String>("ajs", "net/minecraft/block/BlockButton"));
+ mObInitMap.put(new Pair<String, String>("avp", "net/minecraft/world/gen/structure/StructureVillagePieces"));
+ mObInitMap.put(new Pair<String, String>("azo", "net/minecraft/world/storage/SaveHandlerMP"));
+ mObInitMap.put(new Pair<String, String>(
+ "brt", "net/minecraft/client/resources/data/BaseMetadataSectionSerializer"));
+ mObInitMap.put(new Pair<String, String>("bfw", "net/minecraft/client/gui/GuiMerchant$MerchantButton"));
+ mObInitMap.put(new Pair<String, String>("bjv", "net/minecraft/client/particle/EntityBubbleFX"));
+ mObInitMap.put(new Pair<String, String>("bnu", "net/minecraft/client/renderer/entity/RenderGiantZombie"));
+ mObInitMap.put(new Pair<String, String>("wm", "net/minecraft/entity/passive/EntityMooshroom"));
+ mObInitMap.put(new Pair<String, String>("oo", "net/minecraft/server/management/UserList$Serializer"));
+ mObInitMap.put(new Pair<String, String>("kp", "net/minecraft/init/Bootstrap$12"));
+ mObInitMap.put(new Pair<String, String>("gq", "net/minecraft/network/play/server/S2FPacketSetSlot"));
+ mObInitMap.put(new Pair<String, String>("cr", "net/minecraft/util/EnumFacing"));
+ mObInitMap.put(new Pair<String, String>("aof", "net/minecraft/block/BlockTripWire"));
+ mObInitMap.put(new Pair<String, String>("akg", "net/minecraft/block/BlockDaylightDetector"));
+ mObInitMap.put(new Pair<String, String>("aci", "net/minecraft/item/ItemDoublePlant"));
+ mObInitMap.put(new Pair<String, String>("agh", "net/minecraft/enchantment/EnchantmentOxygen"));
+ mObInitMap.put(new Pair<String, String>(
+ "bsh", "net/minecraft/client/resources/data/PackMetadataSectionSerializer"));
+ mObInitMap.put(new Pair<String, String>("bcl", "net/minecraft/client/gui/GuiOptionsRowList$Row"));
+ mObInitMap.put(new Pair<String, String>("bgk", "net/minecraft/client/gui/GuiResourcePackList"));
+ mObInitMap.put(new Pair<String, String>("bkj", "net/minecraft/client/particle/EntityHugeExplodeFX"));
+ mObInitMap.put(new Pair<String, String>("boi", "net/minecraft/client/renderer/entity/RenderMinecart"));
+ mObInitMap.put(new Pair<String, String>("pc", "net/minecraft/stats/AchievementList"));
+ mObInitMap.put(new Pair<String, String>("ld", "net/minecraft/client/util/JsonException$Entry"));
+ mObInitMap.put(new Pair<String, String>("he", "net/minecraft/network/play/server/S34PacketMaps"));
+ mObInitMap.put(new Pair<String, String>("df", "net/minecraft/nbt/NBTTagByteArray"));
+ mObInitMap.put(new Pair<String, String>("asd", "net/minecraft/world/gen/feature/WorldGenDungeons"));
+ mObInitMap.put(
+ new Pair<String, String>("awc", "net/minecraft/world/gen/structure/StructureVillagePieces$House3"));
+ mObInitMap.put(new Pair<String, String>("dy", "net/minecraft/nbt/NBTBase"));
+ mObInitMap.put(new Pair<String, String>("ta", "net/minecraft/entity/IEntityOwnable"));
+ mObInitMap.put(new Pair<String, String>("pb", "net/minecraft/stats/Achievement"));
+ mObInitMap.put(new Pair<String, String>("asw", "net/minecraft/world/gen/structure/MapGenMineshaft"));
+ mObInitMap.put(new Pair<String, String>("aox", "net/minecraft/tileentity/TileEntityCommandBlock"));
+ mObInitMap.put(new Pair<String, String>("aky", "net/minecraft/block/BlockFarmland"));
+ mObInitMap.put(new Pair<String, String>("agz", "net/minecraft/world/GameRules$Value"));
+ mObInitMap.put(new Pair<String, String>("awv", "net/minecraft/block/material/MapColor"));
+ mObInitMap.put(new Pair<String, String>("bds", "net/minecraft/client/gui/GuiFlatPresets$ListSlot"));
+ mObInitMap.put(new Pair<String, String>("bhr", "net/minecraft/client/model/ModelBase"));
+ mObInitMap.put(new Pair<String, String>("bsz", "net/minecraft/server/integrated/IntegratedServer$2"));
+ mObInitMap.put(new Pair<String, String>("xs", "net/minecraft/entity/item/EntityMinecartEmpty"));
+ mObInitMap.put(new Pair<String, String>("tt", "net/minecraft/entity/ai/EntityJumpHelper"));
+ mObInitMap.put(new Pair<String, String>("pu", "net/minecraft/util/JsonUtils"));
+ mObInitMap.put(new Pair<String, String>("lv", "net/minecraft/server/dedicated/DedicatedServer$2"));
+ mObInitMap.put(new Pair<String, String>("hw", "net/minecraft/network/play/server/S1CPacketEntityMetadata"));
+ mObInitMap.put(new Pair<String, String>("dx", "net/minecraft/nbt/NBTTagString"));
+ mObInitMap.put(new Pair<String, String>(
+ "atk", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor4"));
+ mObInitMap.put(new Pair<String, String>("apl", "net/minecraft/tileentity/TileEntityNote"));
+ mObInitMap.put(new Pair<String, String>("alm", "net/minecraft/block/BlockHay"));
+ mObInitMap.put(new Pair<String, String>("ado", "net/minecraft/item/ItemPiston"));
+ mObInitMap.put(new Pair<String, String>("ahn", "net/minecraft/world/EnumSkyBlock"));
+ mObInitMap.put(new Pair<String, String>("axj", "net/minecraft/world/gen/layer/GenLayerFuzzyZoom"));
+ mObInitMap.put(new Pair<String, String>(
+ "btn", "net/minecraft/client/audio/SoundManager$SoundSystemStarterThread"));
+ mObInitMap.put(new Pair<String, String>("bpo", "net/minecraft/client/shader/ShaderUniform"));
+ mObInitMap.put(new Pair<String, String>("bhq", "net/minecraft/client/model/ModelMinecart"));
+ mObInitMap.put(new Pair<String, String>("blp", "net/minecraft/client/renderer/RenderSorter"));
+ mObInitMap.put(new Pair<String, String>("yg", "net/minecraft/entity/monster/EntityMob"));
+ mObInitMap.put(new Pair<String, String>("uh", "net/minecraft/entity/ai/EntityAIFollowParent"));
+ mObInitMap.put(new Pair<String, String>("qi", "net/minecraft/profiler/Profiler"));
+ mObInitMap.put(new Pair<String, String>("mj", "net/minecraft/client/renderer/DestroyBlockProgress"));
+ mObInitMap.put(new Pair<String, String>("ik", "net/minecraft/network/play/server/S18PacketEntityTeleport"));
+ mObInitMap.put(new Pair<String, String>("el", "net/minecraft/network/NetworkManager$2"));
+ mObInitMap.put(new Pair<String, String>("am", "net/minecraft/command/CommandEffect"));
+ mObInitMap.put(new Pair<String, String>("ama", "net/minecraft/block/BlockMobSpawner"));
+ mObInitMap.put(new Pair<String, String>("aec", "net/minecraft/item/ItemSnow"));
+ mObInitMap.put(new Pair<String, String>("aad", "net/minecraft/inventory/ContainerChest"));
+ mObInitMap.put(new Pair<String, String>("aib", "net/minecraft/world/biome/WorldChunkManager"));
+ mObInitMap.put(new Pair<String, String>("d", "net/minecraft/crash/CrashReport$2"));
+ mObInitMap.put(new Pair<String, String>(
+ "bub", "net/minecraft/client/stream/BroadcastController$SwitchBroadcastState"));
+ mObInitMap.put(new Pair<String, String>("bqc", "net/minecraft/client/renderer/texture/TextureMap$3"));
+ mObInitMap.put(new Pair<String, String>("bag", "net/minecraft/scoreboard/ScoreHealthCriteria"));
+ mObInitMap.put(new Pair<String, String>("bef", "net/minecraft/client/gui/GuiVideoSettings"));
+ mObInitMap.put(new Pair<String, String>("bie", "net/minecraft/client/model/ModelSlime"));
+ mObInitMap.put(new Pair<String, String>("bmd", "net/minecraft/client/renderer/RenderList"));
+ mObInitMap.put(new Pair<String, String>("ba", "net/minecraft/command/server/CommandMessageRaw"));
+ mObInitMap.put(new Pair<String, String>("aev", "net/minecraft/item/crafting/RecipesArmor"));
+ mObInitMap.put(new Pair<String, String>("aaw", "net/minecraft/inventory/InventoryCraftResult"));
+ mObInitMap.put(new Pair<String, String>("w", "net/minecraft/client/audio/SoundCategory"));
+ mObInitMap.put(
+ new Pair<String, String>("bqv", "net/minecraft/client/resources/IReloadableResourceManager"));
+ mObInitMap.put(new Pair<String, String>("baz", "net/minecraft/client/Minecraft$3"));
+ mObInitMap.put(new Pair<String, String>("bey", "net/minecraft/client/gui/GuiRepair"));
+ mObInitMap.put(new Pair<String, String>("bix", "net/minecraft/client/model/ModelRenderer"));
+ mObInitMap.put(new Pair<String, String>("bmw", "net/minecraft/client/renderer/culling/ClippingHelperImpl"));
+ mObInitMap.put(
+ new Pair<String, String>("fs", "net/minecraft/util/ChatComponentTranslationFormatException"));
+ mObInitMap.put(new Pair<String, String>("bt", "net/minecraft/command/server/CommandStop"));
+ mObInitMap.put(new Pair<String, String>("yy", "net/minecraft/entity/player/InventoryPlayer$1"));
+ mObInitMap.put(new Pair<String, String>("uz", "net/minecraft/entity/ai/EntityAIPanic"));
+ mObInitMap.put(new Pair<String, String>("aqr", "net/minecraft/world/WorldProviderEnd"));
+ mObInitMap.put(new Pair<String, String>("ams", "net/minecraft/block/BlockCompressedPowered"));
+ mObInitMap.put(new Pair<String, String>("aeu", "net/minecraft/item/crafting/RecipesArmorDyes"));
+ mObInitMap.put(new Pair<String, String>("ait", "net/minecraft/world/biome/BiomeGenSavanna$Mutated"));
+ mObInitMap.put(new Pair<String, String>(
+ "auq", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Library"));
+ mObInitMap.put(new Pair<String, String>("ayp", "net/minecraft/world/storage/DerivedWorldInfo"));
+ mObInitMap.put(new Pair<String, String>("bbn", "net/minecraft/client/settings/GameSettings$Options$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "bfm", "net/minecraft/client/gui/inventory/GuiContainerCreative$ContainerCreative"));
+ mObInitMap.put(new Pair<String, String>("but", "net/minecraft/realms/RealmsServerStatusPinger$1"));
+ mObInitMap.put(new Pair<String, String>("bqu", "net/minecraft/client/resources/GrassColorReloadListener"));
+ mObInitMap.put(new Pair<String, String>("zm", "net/minecraft/entity/item/EntityEnderPearl"));
+ mObInitMap.put(new Pair<String, String>("vn", "net/minecraft/entity/ai/EntityAIHurtByTarget"));
+ mObInitMap.put(new Pair<String, String>("ro", "net/minecraft/util/DamageSource"));
+ mObInitMap.put(
+ new Pair<String, String>("np", "net/minecraft/server/network/NetHandlerLoginServer$LoginState"));
+ mObInitMap.put(
+ new Pair<String, String>("jq", "net/minecraft/network/handshake/INetHandlerHandshakeServer"));
+ mObInitMap.put(new Pair<String, String>("fr", "net/minecraft/util/ChatComponentTranslation"));
+ mObInitMap.put(new Pair<String, String>("arf", "net/minecraft/world/gen/feature/WorldGenBlockBlob"));
+ mObInitMap.put(new Pair<String, String>("ang", "net/minecraft/block/BlockRotatedPillar"));
+ mObInitMap.put(new Pair<String, String>("abj", "net/minecraft/item/ItemBoat"));
+ mObInitMap.put(new Pair<String, String>("afi", "net/minecraft/item/crafting/ShapelessRecipes"));
+ mObInitMap.put(new Pair<String, String>("ajh", "net/minecraft/block/BlockBed"));
+ mObInitMap.put(new Pair<String, String>("ave", "net/minecraft/world/gen/structure/MapGenStructure"));
+ mObInitMap.put(new Pair<String, String>("azd", "net/minecraft/client/AnvilConverterException"));
+ mObInitMap.put(
+ new Pair<String, String>("net/minecraft/client/main/Main", "net/minecraft/client/main/Main"));
+ mObInitMap.put(new Pair<String, String>("bri", "net/minecraft/client/resources/SimpleResource"));
+ mObInitMap.put(new Pair<String, String>("bfl", "net/minecraft/client/gui/inventory/GuiContainerCreative"));
+ mObInitMap.put(new Pair<String, String>("bjk", "net/minecraft/client/entity/EntityClientPlayerMP"));
+ mObInitMap.put(new Pair<String, String>("bnj", "net/minecraft/client/renderer/entity/RenderEntity"));
+ mObInitMap.put(new Pair<String, String>("wb", "net/minecraft/village/VillageSiege"));
+ mObInitMap.put(new Pair<String, String>("sc", "net/minecraft/entity/Entity$2"));
+ mObInitMap.put(new Pair<String, String>("od", "net/minecraft/server/management/PreYggdrasilConverter$4"));
+ mObInitMap.put(new Pair<String, String>("ke", "net/minecraft/network/ServerStatusResponse$Serializer"));
+ mObInitMap.put(
+ new Pair<String, String>("gf", "net/minecraft/network/play/server/S35PacketUpdateTileEntity"));
+ mObInitMap.put(new Pair<String, String>("cg", "net/minecraft/command/PlayerNotFoundException"));
+ mObInitMap.put(new Pair<String, String>("ary", "net/minecraft/world/gen/feature/WorldGenGlowStone1"));
+ mObInitMap.put(new Pair<String, String>("anz", "net/minecraft/block/BlockTallGrass"));
+ mObInitMap.put(new Pair<String, String>("bca", "net/minecraft/client/gui/ScaledResolution"));
+ mObInitMap.put(new Pair<String, String>("ow", "net/minecraft/network/rcon/RConThreadBase"));
+ mObInitMap.put(new Pair<String, String>("kx", "net/minecraft/init/Bootstrap$6"));
+ mObInitMap.put(
+ new Pair<String, String>("gy", "net/minecraft/network/play/server/S21PacketChunkData$Extracted"));
+ mObInitMap.put(new Pair<String, String>("cz", "net/minecraft/util/IRegistry"));
+ mObInitMap.put(new Pair<String, String>("acq", "net/minecraft/item/ItemFireball"));
+ mObInitMap.put(new Pair<String, String>("agp", "net/minecraft/command/server/CommandBlockLogic"));
+ mObInitMap.put(new Pair<String, String>("bsp", "net/minecraft/client/audio/SoundList"));
+ mObInitMap.put(new Pair<String, String>("boq", "net/minecraft/client/renderer/entity/RenderSheep"));
+ mObInitMap.put(new Pair<String, String>("arx", "net/minecraft/world/gen/feature/WorldGenLakes"));
+ mObInitMap.put(new Pair<String, String>(
+ "avw", "net/minecraft/world/gen/structure/StructureVillagePieces$House4Garden"));
+ mObInitMap.put(new Pair<String, String>("azv", "net/minecraft/util/MovingObjectPosition$MovingObjectType"));
+ mObInitMap.put(new Pair<String, String>("bct", "net/minecraft/client/gui/GuiChat"));
+ mObInitMap.put(new Pair<String, String>("bgs", "net/minecraft/client/gui/stream/GuiTwitchUserMode"));
+ mObInitMap.put(new Pair<String, String>("bkr", "net/minecraft/client/particle/EffectRenderer$4"));
+ mObInitMap.put(new Pair<String, String>("dn", "net/minecraft/nbt/NBTTagIntArray"));
+ mObInitMap.put(new Pair<String, String>("wt", "net/minecraft/entity/monster/EntityIronGolem"));
+ mObInitMap.put(new Pair<String, String>("su", "net/minecraft/entity/EntityLeashKnot"));
+ mObInitMap.put(new Pair<String, String>("asl", "net/minecraft/world/gen/feature/WorldGenSpikes"));
+ mObInitMap.put(new Pair<String, String>("aom", "net/minecraft/block/BlockWood"));
+ mObInitMap.put(new Pair<String, String>("akn", "net/minecraft/block/BlockDoor"));
+ mObInitMap.put(new Pair<String, String>("ago", "net/minecraft/village/MerchantRecipeList"));
+ mObInitMap.put(new Pair<String, String>("awk", "net/minecraft/world/gen/NoiseGeneratorOctaves"));
+ mObInitMap.put(new Pair<String, String>("bdh", "net/minecraft/client/gui/GuiErrorScreen"));
+ mObInitMap.put(new Pair<String, String>("bhg", "net/minecraft/client/model/ModelChest"));
+ mObInitMap.put(new Pair<String, String>("bso", "net/minecraft/client/audio/PositionedSoundRecord"));
+ mObInitMap.put(new Pair<String, String>("xh", "net/minecraft/entity/effect/EntityLightningBolt"));
+ mObInitMap.put(new Pair<String, String>("ti", "net/minecraft/entity/ai/attributes/IAttributeInstance"));
+ mObInitMap.put(new Pair<String, String>("pj", "net/minecraft/stats/StatBase$2"));
+ mObInitMap.put(new Pair<String, String>("lk", "net/minecraft/server/MinecraftServer$4"));
+ mObInitMap.put(new Pair<String, String>("apa", "net/minecraft/tileentity/TileEntityDaylightDetector"));
+ mObInitMap.put(new Pair<String, String>("alb", "net/minecraft/block/BlockFire"));
+ mObInitMap.put(new Pair<String, String>("add", "net/minecraft/item/ItemStack"));
+ mObInitMap.put(new Pair<String, String>("ahc", "net/minecraft/world/World$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "btc", "net/minecraft/client/network/LanServerDetector$ThreadLanServerFind"));
+ mObInitMap.put(
+ new Pair<String, String>("bpd", "net/minecraft/client/renderer/tileentity/RenderWitherSkull"));
+ mObInitMap.put(new Pair<String, String>("bhf", "net/minecraft/client/model/ModelBook"));
+ mObInitMap.put(new Pair<String, String>("ble", "net/minecraft/client/particle/EntityFishWakeFX"));
+ mObInitMap.put(new Pair<String, String>("ea", "net/minecraft/nbt/NBTException"));
+ mObInitMap.put(new Pair<String, String>("ab", "net/minecraft/command/ICommandManager"));
+ mObInitMap.put(new Pair<String, String>("adw", "net/minecraft/item/ItemSeeds"));
+ mObInitMap.put(new Pair<String, String>("ahv", "net/minecraft/world/biome/BiomeGenBase$Height"));
+ mObInitMap.put(new Pair<String, String>("btv", "net/minecraft/client/audio/SoundEventAccessor"));
+ mObInitMap.put(new Pair<String, String>("bpw", "net/minecraft/client/renderer/texture/Stitcher$Holder"));
+ mObInitMap.put(new Pair<String, String>("bdz", "net/minecraft/client/gui/GuiShareToLan"));
+ mObInitMap.put(new Pair<String, String>("bhy", "net/minecraft/client/model/ModelSheep2"));
+ mObInitMap.put(new Pair<String, String>("blx", "net/minecraft/client/renderer/IImageBuffer"));
+ mObInitMap.put(
+ new Pair<String, String>("mr", "net/minecraft/server/management/PlayerManager$PlayerInstance"));
+ mObInitMap.put(new Pair<String, String>("is", "net/minecraft/network/play/client/C16PacketClientStatus"));
+ mObInitMap.put(new Pair<String, String>("et", "net/minecraft/network/PacketBuffer"));
+ mObInitMap.put(new Pair<String, String>("au", "net/minecraft/command/CommandHelp"));
+ mObInitMap.put(new Pair<String, String>("aek", "net/minecraft/item/ItemCloth"));
+ mObInitMap.put(new Pair<String, String>("aal", "net/minecraft/inventory/ContainerHopper"));
+ mObInitMap.put(new Pair<String, String>("l", "net/minecraft/crash/CrashReportCategory$1"));
+ mObInitMap.put(
+ new Pair<String, String>("bqk", "net/minecraft/client/renderer/texture/ITickableTextureObject"));
+ mObInitMap.put(new Pair<String, String>(
+ "atr", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Throne"));
+ mObInitMap.put(new Pair<String, String>("aps", "net/minecraft/tileentity/TileEntityPiston"));
+ mObInitMap.put(new Pair<String, String>("axq", "net/minecraft/world/gen/layer/GenLayerRareBiome"));
+ mObInitMap.put(new Pair<String, String>("bao", "net/minecraft/client/Minecraft"));
+ mObInitMap.put(new Pair<String, String>("ben", "net/minecraft/client/gui/achievement/GuiStats$StatsItem"));
+ mObInitMap.put(new Pair<String, String>("bim", "net/minecraft/client/model/ModelWitch"));
+ mObInitMap.put(new Pair<String, String>(
+ "bml", "net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer"));
+ mObInitMap.put(new Pair<String, String>("fh", "net/minecraft/event/ClickEvent"));
+ mObInitMap.put(new Pair<String, String>("bi", "net/minecraft/command/server/CommandSaveOff"));
+ mObInitMap.put(new Pair<String, String>("yn", "net/minecraft/entity/monster/EntitySpider"));
+ mObInitMap.put(new Pair<String, String>("uo", "net/minecraft/entity/ai/EntityAILookAtTradePlayer"));
+ mObInitMap.put(new Pair<String, String>(
+ "aqg", "net/minecraft/world/chunk/storage/ChunkLoader$AnvilConverterData"));
+ mObInitMap.put(new Pair<String, String>("amh", "net/minecraft/block/BlockNewLeaf"));
+ mObInitMap.put(new Pair<String, String>("aii", "net/minecraft/world/biome/BiomeGenHell"));
+ mObInitMap.put(new Pair<String, String>(
+ "auf", "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$SwampHut"));
+ mObInitMap.put(new Pair<String, String>("aye", "net/minecraft/pathfinding/PathPoint"));
+ mObInitMap.put(new Pair<String, String>("bbc", "net/minecraft/client/Minecraft$6"));
+ mObInitMap.put(
+ new Pair<String, String>("bfb", "net/minecraft/client/gui/inventory/GuiBeacon$ConfirmButton"));
+ mObInitMap.put(new Pair<String, String>("bui", "net/minecraft/client/stream/IngestServerTester"));
+ mObInitMap.put(new Pair<String, String>("bqj", "net/minecraft/client/renderer/texture/ITickable"));
+ mObInitMap.put(
+ new Pair<String, String>("zb", "net/minecraft/entity/player/EntityPlayer$EnumChatVisibility"));
+ mObInitMap.put(new Pair<String, String>("vc", "net/minecraft/entity/ai/EntityAIWander"));
+ mObInitMap.put(new Pair<String, String>("rd", "net/minecraft/world/EnumDifficulty"));
+ mObInitMap.put(new Pair<String, String>("ne", "net/minecraft/network/NetworkSystem$2"));
+ mObInitMap.put(new Pair<String, String>(
+ "jf", "net/minecraft/network/play/client/C03PacketPlayer$C06PacketPlayerPosLook"));
+ mObInitMap.put(new Pair<String, String>("fg", "net/minecraft/util/ChatComponentStyle$2"));
+ mObInitMap.put(new Pair<String, String>("aqz", "net/minecraft/world/gen/ChunkProviderGenerate"));
+ mObInitMap.put(new Pair<String, String>(
+ "auy", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs"));
+ mObInitMap.put(new Pair<String, String>("ayx", "net/minecraft/world/storage/WorldInfo$5"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RealmsSliderButton", "net/minecraft/realms/RealmsSliderButton"));
+ mObInitMap.put(new Pair<String, String>("zu", "net/minecraft/inventory/ContainerRepair"));
+ mObInitMap.put(new Pair<String, String>("vv", "net/minecraft/pathfinding/PathNavigate"));
+ mObInitMap.put(new Pair<String, String>("rw", "net/minecraft/potion/PotionEffect"));
+ mObInitMap.put(new Pair<String, String>("nx", "net/minecraft/server/management/BanList"));
+ mObInitMap.put(new Pair<String, String>("jy", "net/minecraft/network/status/INetHandlerStatusClient"));
+ mObInitMap.put(new Pair<String, String>("fz", "net/minecraft/network/play/server/S0FPacketSpawnMob"));
+ mObInitMap.put(new Pair<String, String>("arn", "net/minecraft/world/gen/feature/WorldGenerator"));
+ mObInitMap.put(new Pair<String, String>("ano", "net/minecraft/block/BlockSoulSand"));
+ mObInitMap.put(new Pair<String, String>("abr", "net/minecraft/item/ItemColored"));
+ mObInitMap.put(new Pair<String, String>("afq", "net/minecraft/enchantment/EnchantmentDamage"));
+ mObInitMap.put(new Pair<String, String>("ajp", "net/minecraft/block/BlockBookshelf"));
+ mObInitMap.put(new Pair<String, String>("brq", "net/minecraft/client/resources/Language"));
+ mObInitMap.put(new Pair<String, String>("bbu", "net/minecraft/client/gui/FontRenderer"));
+ mObInitMap.put(
+ new Pair<String, String>("bft", "net/minecraft/client/gui/inventory/GuiScreenHorseInventory"));
+ mObInitMap.put(new Pair<String, String>("bjs", "net/minecraft/client/network/OldServerPinger$2"));
+ mObInitMap.put(new Pair<String, String>("bnr", "net/minecraft/client/renderer/entity/RenderFireball"));
+ mObInitMap.put(new Pair<String, String>("sk", "net/minecraft/command/IEntitySelector$1"));
+ mObInitMap.put(new Pair<String, String>("ol", "net/minecraft/server/management/UserListEntry"));
+ mObInitMap.put(new Pair<String, String>("km", "net/minecraft/init/Bootstrap$1"));
+ mObInitMap.put(new Pair<String, String>("gn", "net/minecraft/network/play/server/S2DPacketOpenWindow"));
+ mObInitMap.put(new Pair<String, String>("co", "net/minecraft/util/RegistryDefaulted"));
+ mObInitMap.put(new Pair<String, String>("acf", "net/minecraft/creativetab/CreativeTabs$9"));
+ mObInitMap.put(new Pair<String, String>("age", "net/minecraft/enchantment/EnchantmentFishingSpeed"));
+ mObInitMap.put(
+ new Pair<String, String>("bse", "net/minecraft/client/resources/data/LanguageMetadataSection"));
+ mObInitMap.put(new Pair<String, String>("arm", "net/minecraft/world/gen/feature/WorldGenDoublePlant"));
+ mObInitMap.put(new Pair<String, String>(
+ "avl", "net/minecraft/world/gen/structure/StructureComponent$BlockSelector"));
+ mObInitMap.put(new Pair<String, String>("bci", "net/minecraft/client/gui/GuiListExtended$IGuiListEntry"));
+ mObInitMap.put(
+ new Pair<String, String>("bgh", "net/minecraft/client/resources/ResourcePackListEntryDefault"));
+ mObInitMap.put(new Pair<String, String>("bkg", "net/minecraft/client/particle/EntityFootStepFX"));
+ mObInitMap.put(new Pair<String, String>("bof", "net/minecraft/client/renderer/entity/RenderLeashKnot"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/server/MinecraftServer", "net/minecraft/server/MinecraftServer"));
+ mObInitMap.put(new Pair<String, String>("hb", "net/minecraft/network/play/server/S2APacketParticles"));
+ mObInitMap.put(new Pair<String, String>("wi", "net/minecraft/entity/passive/EntityHorse"));
+ mObInitMap.put(new Pair<String, String>("sj", "net/minecraft/command/IEntitySelector"));
+ mObInitMap.put(new Pair<String, String>("asa", "net/minecraft/world/gen/feature/WorldGenMegaPineTree"));
+ mObInitMap.put(new Pair<String, String>("aob", "net/minecraft/block/BlockTNT"));
+ mObInitMap.put(new Pair<String, String>("akc", "net/minecraft/block/BlockRedstoneComparator"));
+ mObInitMap.put(new Pair<String, String>("agd", "net/minecraft/enchantment/EnchantmentFireAspect"));
+ mObInitMap.put(new Pair<String, String>(
+ "bsd", "net/minecraft/client/resources/data/FontMetadataSectionSerializer"));
+ mObInitMap.put(new Pair<String, String>("ha", "net/minecraft/network/play/server/S28PacketEffect"));
+ mObInitMap.put(new Pair<String, String>("ast", "net/minecraft/world/gen/FlatLayerInfo"));
+ mObInitMap.put(new Pair<String, String>("aou", "net/minecraft/tileentity/TileEntity$3"));
+ mObInitMap.put(new Pair<String, String>("akv", "net/minecraft/block/BlockEnderChest"));
+ mObInitMap.put(new Pair<String, String>("acx", "net/minecraft/item/ItemFood"));
+ mObInitMap.put(new Pair<String, String>("agw", "net/minecraft/world/Explosion"));
+ mObInitMap.put(new Pair<String, String>("aws", "net/minecraft/block/material/MaterialLiquid"));
+ mObInitMap.put(new Pair<String, String>("bsw", "net/minecraft/server/integrated/IntegratedPlayerList"));
+ mObInitMap.put(new Pair<String, String>("box", "net/minecraft/client/renderer/entity/RenderTntMinecart"));
+ mObInitMap.put(new Pair<String, String>("bky", "net/minecraft/client/particle/EntitySplashFX"));
+ mObInitMap.put(new Pair<String, String>("xp", "net/minecraft/entity/item/EntityMinecartContainer"));
+ mObInitMap.put(new Pair<String, String>("tq", "net/minecraft/entity/ai/attributes/ServersideAttributeMap"));
+ mObInitMap.put(new Pair<String, String>("pr", "net/minecraft/util/JsonSerializableSet"));
+ mObInitMap.put(new Pair<String, String>("ls", "net/minecraft/server/dedicated/DedicatedPlayerList"));
+ mObInitMap.put(new Pair<String, String>("ht", "net/minecraft/network/play/server/S19PacketEntityHeadLook"));
+ mObInitMap.put(new Pair<String, String>("du", "net/minecraft/nbt/CompressedStreamTools"));
+ mObInitMap.put(new Pair<String, String>("api", "net/minecraft/tileentity/TileEntityHopper"));
+ mObInitMap.put(new Pair<String, String>("alj", "net/minecraft/block/BlockSlab"));
+ mObInitMap.put(new Pair<String, String>("adl", "net/minecraft/item/ItemMultiTexture"));
+ mObInitMap.put(new Pair<String, String>("ahk", "net/minecraft/world/WorldSettings$GameType"));
+ mObInitMap.put(new Pair<String, String>("btk", "net/minecraft/client/audio/SoundManager$1"));
+ mObInitMap.put(new Pair<String, String>("bpl", "net/minecraft/client/shader/ShaderLoader"));
+ mObInitMap.put(new Pair<String, String>("bdo", "net/minecraft/client/gui/GuiMemoryErrorScreen"));
+ mObInitMap.put(new Pair<String, String>("bhn", "net/minecraft/client/model/ModelLargeChest"));
+ mObInitMap.put(new Pair<String, String>("blm", "net/minecraft/client/renderer/RenderBlocks"));
+ mObInitMap.put(new Pair<String, String>("qf", "net/minecraft/util/EnumTypeAdapterFactory"));
+ mObInitMap.put(new Pair<String, String>("mg", "net/minecraft/server/gui/StatsComponent$1"));
+ mObInitMap.put(new Pair<String, String>("ih", "net/minecraft/network/play/server/S03PacketTimeUpdate"));
+ mObInitMap.put(new Pair<String, String>("ei", "net/minecraft/network/NettyEncryptingEncoder"));
+ mObInitMap.put(new Pair<String, String>("aj", "net/minecraft/command/server/CommandDeOp"));
+ mObInitMap.put(new Pair<String, String>("aaa", "net/minecraft/inventory/ContainerBrewingStand$Ingredient"));
+ mObInitMap.put(new Pair<String, String>("a", "net/minecraft/util/EnumChatFormatting"));
+ mObInitMap.put(new Pair<String, String>(
+ "atg", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing3"));
+ mObInitMap.put(new Pair<String, String>("axf", "net/minecraft/world/gen/layer/GenLayerBiome"));
+ mObInitMap.put(new Pair<String, String>("bad", "net/minecraft/scoreboard/ScoreboardSaveData"));
+ mObInitMap.put(new Pair<String, String>("bec", "net/minecraft/client/gui/GuiScreenOptionsSounds"));
+ mObInitMap.put(new Pair<String, String>("bib", "net/minecraft/client/model/ModelSkeletonHead"));
+ mObInitMap.put(new Pair<String, String>("bma", "net/minecraft/client/renderer/RenderGlobal"));
+ mObInitMap.put(new Pair<String, String>("yc", "net/minecraft/entity/monster/IMob$1"));
+ mObInitMap.put(new Pair<String, String>("ud", "net/minecraft/entity/ai/EntityAIEatGrass"));
+ mObInitMap.put(new Pair<String, String>("qe", "net/minecraft/util/LongHashMap$Entry"));
+ mObInitMap.put(new Pair<String, String>("t", "net/minecraft/util/ChatAllowedCharacters"));
+ mObInitMap.put(new Pair<String, String>(
+ "atz", "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces"));
+ mObInitMap.put(new Pair<String, String>("baw", "net/minecraft/client/Minecraft$16"));
+ mObInitMap.put(new Pair<String, String>("bev", "net/minecraft/client/gui/GuiKeyBindingList$KeyEntry"));
+ mObInitMap.put(new Pair<String, String>("yv", "net/minecraft/entity/passive/EntityVillager"));
+ mObInitMap.put(new Pair<String, String>("uw", "net/minecraft/entity/ai/EntityAIOcelotSit"));
+ mObInitMap.put(new Pair<String, String>("qx", "net/minecraft/util/WeightedRandomChestContent"));
+ mObInitMap.put(new Pair<String, String>("my", "net/minecraft/entity/EntityTrackerEntry"));
+ mObInitMap.put(new Pair<String, String>("iz", "net/minecraft/network/play/client/C17PacketCustomPayload"));
+ mObInitMap.put(new Pair<String, String>("aqo", "net/minecraft/world/WorldProvider"));
+ mObInitMap.put(new Pair<String, String>("amp", "net/minecraft/block/BlockPortal"));
+ mObInitMap.put(new Pair<String, String>("aas", "net/minecraft/inventory/InventoryMerchant"));
+ mObInitMap.put(new Pair<String, String>(
+ "aun", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Corridor"));
+ mObInitMap.put(new Pair<String, String>("aym", "net/minecraft/world/chunk/storage/AnvilSaveHandler"));
+ mObInitMap.put(new Pair<String, String>("buq", "net/minecraft/client/stream/TwitchStream$1$1"));
+ mObInitMap.put(new Pair<String, String>("bqr", "net/minecraft/client/resources/FileResourcePack"));
+ mObInitMap.put(new Pair<String, String>(
+ "bms", "net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer"));
+ mObInitMap.put(new Pair<String, String>("zj", "net/minecraft/entity/projectile/EntitySnowball"));
+ mObInitMap.put(new Pair<String, String>("vk", "net/minecraft/entity/ai/EntityAITempt"));
+ mObInitMap.put(new Pair<String, String>("rl", "net/minecraft/inventory/ISidedInventory"));
+ mObInitMap.put(new Pair<String, String>(
+ "nm", "net/minecraft/server/network/NetHandlerHandshakeTCP$SwitchEnumConnectionState"));
+ mObInitMap.put(new Pair<String, String>("jn", "net/minecraft/network/play/client/C12PacketUpdateSign"));
+ mObInitMap.put(new Pair<String, String>("fo", "net/minecraft/util/ChatStyle$1"));
+ mObInitMap.put(new Pair<String, String>("bp", "net/minecraft/command/CommandSetSpawnpoint"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RealmsServerAddress", "net/minecraft/realms/RealmsServerAddress"));
+ mObInitMap.put(new Pair<String, String>("arc", "net/minecraft/world/gen/feature/WorldGenAbstractTree"));
+ mObInitMap.put(new Pair<String, String>("and", "net/minecraft/block/BlockRedstoneTorch$Toggle"));
+ mObInitMap.put(new Pair<String, String>("abg", "net/minecraft/item/ItemBed"));
+ mObInitMap.put(new Pair<String, String>("aff", "net/minecraft/item/crafting/CraftingManager$1"));
+ mObInitMap.put(new Pair<String, String>("aje", "net/minecraft/block/BlockRailBase"));
+ mObInitMap.put(
+ new Pair<String, String>("brf", "net/minecraft/client/resources/ResourcePackRepository$Entry"));
+ mObInitMap.put(new Pair<String, String>("bbj", "net/minecraft/client/settings/GameSettings"));
+ mObInitMap.put(new Pair<String, String>("bfi", "net/minecraft/client/gui/inventory/GuiChest"));
+ mObInitMap.put(new Pair<String, String>("bjh", "net/minecraft/client/multiplayer/WorldClient$2"));
+ mObInitMap.put(new Pair<String, String>("bng", "net/minecraft/client/renderer/entity/RenderChicken"));
+ mObInitMap.put(new Pair<String, String>("oa", "net/minecraft/server/management/PreYggdrasilConverter$1"));
+ mObInitMap.put(new Pair<String, String>("kb", "net/minecraft/network/ServerStatusResponse"));
+ mObInitMap.put(new Pair<String, String>("gc", "net/minecraft/network/play/server/S0BPacketAnimation"));
+ mObInitMap.put(new Pair<String, String>("cd", "net/minecraft/command/CommandException"));
+ mObInitMap.put(new Pair<String, String>("abz", "net/minecraft/creativetab/CreativeTabs$3"));
+ mObInitMap.put(new Pair<String, String>("afy", "net/minecraft/enchantment/EnchantmentHelper$HurtIterator"));
+ mObInitMap.put(new Pair<String, String>(
+ "bry", "net/minecraft/client/resources/data/IMetadataSerializer$Registration"));
+ mObInitMap.put(new Pair<String, String>(
+ "ava", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Straight"));
+ mObInitMap.put(new Pair<String, String>("bnz", "net/minecraft/client/renderer/entity/RenderItem$1"));
+ mObInitMap.put(
+ new Pair<String, String>("gv", "net/minecraft/network/play/server/S2BPacketChangeGameState"));
+ mObInitMap.put(new Pair<String, String>("cw", "net/minecraft/util/RegistryNamespaced"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RealmsScrolledSelectionList",
+ "net/minecraft/realms/RealmsScrolledSelectionList"));
+ mObInitMap.put(new Pair<String, String>("aru", "net/minecraft/world/gen/feature/WorldGenBigMushroom"));
+ mObInitMap.put(new Pair<String, String>("anv", "net/minecraft/block/BlockStone"));
+ mObInitMap.put(
+ new Pair<String, String>("afx", "net/minecraft/enchantment/EnchantmentHelper$DamageIterator"));
+ mObInitMap.put(new Pair<String, String>("ajw", "net/minecraft/block/BlockCauldron"));
+ mObInitMap.put(
+ new Pair<String, String>("avt", "net/minecraft/world/gen/structure/StructureVillagePieces$Torch"));
+ mObInitMap.put(new Pair<String, String>("azs", "net/minecraft/world/storage/IThreadedFileIO"));
+ mObInitMap.put(new Pair<String, String>("bcq", "net/minecraft/client/gui/GuiScreenRealmsProxy"));
+ mObInitMap.put(new Pair<String, String>("bgp", "net/minecraft/client/gui/stream/GuiStreamUnavailable"));
+ mObInitMap.put(
+ new Pair<String, String>("brx", "net/minecraft/client/resources/data/IMetadataSerializer$1"));
+ mObInitMap.put(new Pair<String, String>("wq", "net/minecraft/entity/passive/EntitySheep$1"));
+ mObInitMap.put(new Pair<String, String>("sr", "net/minecraft/entity/EntityFlying"));
+ mObInitMap.put(new Pair<String, String>("os", "net/minecraft/server/management/UserListWhitelistEntry"));
+ mObInitMap.put(new Pair<String, String>("kt", "net/minecraft/init/Bootstrap$3"));
+ mObInitMap.put(new Pair<String, String>("gu", "net/minecraft/network/play/server/S27PacketExplosion"));
+ mObInitMap.put(new Pair<String, String>("asi", "net/minecraft/world/gen/feature/WorldGenCanopyTree"));
+ mObInitMap.put(new Pair<String, String>("aoj", "net/minecraft/block/BlockLilyPad"));
+ mObInitMap.put(new Pair<String, String>("akk", "net/minecraft/block/BlockDirectional"));
+ mObInitMap.put(new Pair<String, String>("acm", "net/minecraft/item/ItemEnchantedBook"));
+ mObInitMap.put(new Pair<String, String>("agl", "net/minecraft/enchantment/EnchantmentWaterWorker"));
+ mObInitMap.put(new Pair<String, String>("bsl", "net/minecraft/client/audio/MovingSound"));
+ mObInitMap.put(new Pair<String, String>("bom", "net/minecraft/client/renderer/entity/RenderOcelot"));
+ mObInitMap.put(new Pair<String, String>("bgo", "net/minecraft/client/gui/stream/GuiStreamOptions"));
+ mObInitMap.put(new Pair<String, String>("bkn", "net/minecraft/client/particle/EffectRenderer"));
+ mObInitMap.put(
+ new Pair<String, String>("net/minecraft/realms/RealmsScreen", "net/minecraft/realms/RealmsScreen"));
+ mObInitMap.put(new Pair<String, String>("xe", "net/minecraft/entity/projectile/EntityFishHook"));
+ mObInitMap.put(new Pair<String, String>("tf", "net/minecraft/entity/DataWatcher$WatchableObject"));
+ mObInitMap.put(new Pair<String, String>("pg", "net/minecraft/stats/StatisticsFile"));
+ mObInitMap.put(new Pair<String, String>("lh", "net/minecraft/server/MinecraftServer$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "hi", "net/minecraft/network/play/server/S14PacketEntity$S16PacketEntityLook"));
+ mObInitMap.put(new Pair<String, String>("dj", "net/minecraft/nbt/NBTTagCompound$2"));
+ mObInitMap.put(new Pair<String, String>("ada", "net/minecraft/item/ItemHoe"));
+ mObInitMap.put(new Pair<String, String>("bpa", "net/minecraft/client/renderer/entity/RenderVillager"));
+ mObInitMap.put(new Pair<String, String>("bdd", "net/minecraft/client/gui/GuiScreenDemo"));
+ mObInitMap.put(new Pair<String, String>("bhc", "net/minecraft/client/model/ModelBat"));
+ mObInitMap.put(new Pair<String, String>("blb", "net/minecraft/client/particle/EntityPickupFX"));
+ mObInitMap.put(new Pair<String, String>("pz", "net/minecraft/util/IntHashMap"));
+ mObInitMap.put(new Pair<String, String>("adt", "net/minecraft/item/ItemSaddle"));
+ mObInitMap.put(new Pair<String, String>("ahs", "net/minecraft/world/NextTickListEntry"));
+ mObInitMap.put(new Pair<String, String>("bts", "net/minecraft/client/audio/SoundHandler$SwitchType"));
+ mObInitMap.put(new Pair<String, String>("bpt", "net/minecraft/client/renderer/texture/LayeredTexture"));
+ mObInitMap.put(new Pair<String, String>("awz", "net/minecraft/world/gen/layer/GenLayerEdge$SwitchMode"));
+ mObInitMap.put(new Pair<String, String>("bdw", "net/minecraft/client/gui/GuiScreen"));
+ mObInitMap.put(new Pair<String, String>("bhv", "net/minecraft/client/model/TexturedQuad"));
+ mObInitMap.put(new Pair<String, String>("blu", "net/minecraft/client/renderer/EntityRenderer$1"));
+ mObInitMap.put(new Pair<String, String>("ip", "net/minecraft/network/play/client/C0APacketAnimation"));
+ mObInitMap.put(new Pair<String, String>("eq", "net/minecraft/network/EnumConnectionState$4"));
+ mObInitMap.put(new Pair<String, String>("ar", "net/minecraft/command/CommandGameMode"));
+ mObInitMap.put(new Pair<String, String>("xw", "net/minecraft/entity/item/EntityTNTPrimed"));
+ mObInitMap.put(new Pair<String, String>("tx", "net/minecraft/entity/ai/EntityAIAvoidEntity$1"));
+ mObInitMap.put(new Pair<String, String>("i", "net/minecraft/crash/CrashReport$7"));
+ mObInitMap.put(new Pair<String, String>(
+ "ato", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor5"));
+ mObInitMap.put(new Pair<String, String>("app", "net/minecraft/block/BlockPistonBase"));
+ mObInitMap.put(new Pair<String, String>("alq", "net/minecraft/block/BlockJukebox"));
+ mObInitMap.put(new Pair<String, String>("ahr", "net/minecraft/world/ChunkCache"));
+ mObInitMap.put(new Pair<String, String>("axn", "net/minecraft/world/gen/layer/GenLayer"));
+ mObInitMap.put(new Pair<String, String>("bal", "net/minecraft/client/settings/KeyBinding"));
+ mObInitMap.put(new Pair<String, String>("bek", "net/minecraft/client/gui/achievement/GuiStats$StatsBlock"));
+ mObInitMap.put(new Pair<String, String>("bij", "net/minecraft/client/model/ModelIronGolem"));
+ mObInitMap.put(new Pair<String, String>("btr", "net/minecraft/client/audio/SoundHandler$2"));
+ mObInitMap.put(new Pair<String, String>("yk", "net/minecraft/entity/monster/EntitySilverfish"));
+ mObInitMap.put(new Pair<String, String>("ul", "net/minecraft/entity/ai/EntityAIWatchClosest2"));
+ mObInitMap.put(new Pair<String, String>("qm", "net/minecraft/util/MouseFilter"));
+ mObInitMap.put(new Pair<String, String>("mn", "net/minecraft/entity/EntityTracker"));
+ mObInitMap.put(new Pair<String, String>("io", "net/minecraft/network/play/INetHandlerPlayServer"));
+ mObInitMap.put(new Pair<String, String>("aeg", "net/minecraft/item/ItemSlab"));
+ mObInitMap.put(new Pair<String, String>("aah", "net/minecraft/inventory/ContainerEnchantment$1"));
+ mObInitMap.put(new Pair<String, String>("aif", "net/minecraft/world/biome/BiomeGenForest"));
+ mObInitMap.put(new Pair<String, String>(
+ "auc", "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid"));
+ mObInitMap.put(new Pair<String, String>("ayb", "net/minecraft/world/gen/layer/GenLayerVoronoiZoom"));
+ mObInitMap.put(
+ new Pair<String, String>("buf", "net/minecraft/client/stream/ChatController$SwitchChatState"));
+ mObInitMap.put(new Pair<String, String>("bqg", "net/minecraft/client/renderer/texture/TextureManager$1"));
+ mObInitMap.put(new Pair<String, String>("bii", "net/minecraft/client/model/PositionTextureVertex"));
+ mObInitMap.put(new Pair<String, String>("bmh", "net/minecraft/client/renderer/Tessellator"));
+ mObInitMap.put(new Pair<String, String>("ra", "net/minecraft/inventory/InventoryLargeChest"));
+ mObInitMap.put(new Pair<String, String>(
+ "nb", "net/minecraft/client/network/NetHandlerHandshakeMemory$SwitchEnumConnectionState"));
+ mObInitMap.put(new Pair<String, String>("jc", "net/minecraft/network/play/client/C00PacketKeepAlive"));
+ mObInitMap.put(new Pair<String, String>("fd", "net/minecraft/util/MessageSerializer2"));
+ mObInitMap.put(new Pair<String, String>("be", "net/minecraft/command/server/CommandPardonPlayer"));
+ mObInitMap.put(new Pair<String, String>("aqw", "net/minecraft/world/gen/MapGenCaves"));
+ mObInitMap.put(new Pair<String, String>("amx", "net/minecraft/block/BlockQuartz"));
+ mObInitMap.put(new Pair<String, String>("aez", "net/minecraft/item/crafting/RecipesFood"));
+ mObInitMap.put(new Pair<String, String>("aiy", "net/minecraft/world/biome/BiomeEndDecorator"));
+ mObInitMap.put(
+ new Pair<String, String>("bqz", "net/minecraft/client/resources/IResourceManagerReloadListener"));
+ mObInitMap.put(new Pair<String, String>("rt", "net/minecraft/potion/PotionHealthBoost"));
+ mObInitMap.put(new Pair<String, String>("nu", "net/minecraft/server/management/PlayerProfileCache$2"));
+ mObInitMap.put(new Pair<String, String>("jv", "net/minecraft/network/login/INetHandlerLoginServer"));
+ mObInitMap.put(new Pair<String, String>("fw", "net/minecraft/network/play/server/S0EPacketSpawnObject"));
+ mObInitMap.put(new Pair<String, String>("bx", "net/minecraft/command/server/CommandTestForBlock"));
+ mObInitMap.put(new Pair<String, String>("abo", "net/minecraft/item/ItemBucket"));
+ mObInitMap.put(new Pair<String, String>("afn", "net/minecraft/enchantment/EnchantmentArrowFire"));
+ mObInitMap.put(new Pair<String, String>("brn", "net/minecraft/client/resources/SkinManager$3$1"));
+ mObInitMap.put(new Pair<String, String>("aqv", "net/minecraft/world/gen/ChunkProviderHell"));
+ mObInitMap.put(new Pair<String, String>(
+ "auu", "net/minecraft/world/gen/structure/StructureStrongholdPieces$RightTurn"));
+ mObInitMap.put(new Pair<String, String>("ayt", "net/minecraft/world/storage/WorldInfo$1"));
+ mObInitMap.put(new Pair<String, String>("bbr", "net/minecraft/util/Timer"));
+ mObInitMap.put(new Pair<String, String>("bfq", "net/minecraft/client/gui/GuiEnchantment"));
+ mObInitMap.put(new Pair<String, String>("bjp", "net/minecraft/client/multiplayer/ServerList"));
+ mObInitMap.put(new Pair<String, String>("bno", "net/minecraft/client/renderer/entity/Render"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RealmsLevelSummary", "net/minecraft/realms/RealmsLevelSummary"));
+ mObInitMap.put(
+ new Pair<String, String>("gk", "net/minecraft/network/play/server/S22PacketMultiBlockChange"));
+ mObInitMap.put(new Pair<String, String>("cl", "net/minecraft/block/BlockSourceImpl"));
+ mObInitMap.put(new Pair<String, String>("vr", "net/minecraft/entity/ai/EntityAITargetNonTamed"));
+ mObInitMap.put(new Pair<String, String>("rs", "net/minecraft/potion/PotionAttackDamage"));
+ mObInitMap.put(new Pair<String, String>("arj", "net/minecraft/world/gen/feature/WorldGenClay"));
+ mObInitMap.put(new Pair<String, String>("ank", "net/minecraft/block/BlockSign"));
+ mObInitMap.put(new Pair<String, String>("ajl", "net/minecraft/block/Block$3"));
+ mObInitMap.put(new Pair<String, String>("avi", "net/minecraft/world/gen/structure/MapGenStructureIO"));
+ mObInitMap.put(new Pair<String, String>("bcf", "net/minecraft/client/gui/GuiButtonLanguage"));
+ mObInitMap.put(new Pair<String, String>("bge", "net/minecraft/client/gui/ServerSelectionList"));
+ mObInitMap.put(new Pair<String, String>("wf", "net/minecraft/entity/passive/EntityAnimal"));
+ mObInitMap.put(new Pair<String, String>("sg", "net/minecraft/entity/EntityList"));
+ mObInitMap.put(new Pair<String, String>(
+ "oh", "net/minecraft/server/management/PreYggdrasilConverter$ConversionError"));
+ mObInitMap.put(new Pair<String, String>("ki", "net/minecraft/network/status/client/C01PacketPing"));
+ mObInitMap.put(new Pair<String, String>("gj", "net/minecraft/network/play/server/S02PacketChat"));
+ mObInitMap.put(new Pair<String, String>("acb", "net/minecraft/creativetab/CreativeTabs$5"));
+ mObInitMap.put(
+ new Pair<String, String>("aga", "net/minecraft/enchantment/EnchantmentHelper$ModifierLiving"));
+ mObInitMap.put(
+ new Pair<String, String>("bsa", "net/minecraft/client/resources/data/AnimationMetadataSection"));
+ mObInitMap.put(new Pair<String, String>("bkc", "net/minecraft/client/particle/EntityFireworkOverlayFX"));
+ mObInitMap.put(new Pair<String, String>("bob", "net/minecraft/client/renderer/entity/RenderItem$3"));
+ mObInitMap.put(new Pair<String, String>("wy", "net/minecraft/entity/boss/EntityDragonPart"));
+ mObInitMap.put(new Pair<String, String>("sz", "net/minecraft/entity/EnumCreatureAttribute"));
+ mObInitMap.put(new Pair<String, String>("asq", "net/minecraft/world/gen/feature/WorldGenTrees"));
+ mObInitMap.put(new Pair<String, String>("aor", "net/minecraft/tileentity/TileEntity"));
+ mObInitMap.put(new Pair<String, String>("aks", "net/minecraft/block/BlockEnchantmentTable"));
+ mObInitMap.put(new Pair<String, String>("acu", "net/minecraft/item/ItemFishFood$FishType"));
+ mObInitMap.put(new Pair<String, String>("agt", "net/minecraft/world/ChunkPosition"));
+ mObInitMap.put(new Pair<String, String>("bst", "net/minecraft/client/audio/ISound"));
+ mObInitMap.put(new Pair<String, String>("bou", "net/minecraft/client/renderer/entity/RenderSnowMan"));
+ mObInitMap.put(new Pair<String, String>("bcx", "net/minecraft/client/multiplayer/GuiConnecting"));
+ mObInitMap.put(new Pair<String, String>("bgw", "net/minecraft/client/main/Main$3"));
+ mObInitMap.put(new Pair<String, String>("bkv", "net/minecraft/client/particle/EntitySmokeFX"));
+ mObInitMap.put(
+ new Pair<String, String>("tn", "net/minecraft/entity/ai/attributes/ModifiableAttributeInstance"));
+ mObInitMap.put(new Pair<String, String>("po", "net/minecraft/util/IJsonSerializable"));
+ mObInitMap.put(new Pair<String, String>("lp", "net/minecraft/scoreboard/ServerScoreboard"));
+ mObInitMap.put(
+ new Pair<String, String>("hq", "net/minecraft/network/play/server/S13PacketDestroyEntities"));
+ mObInitMap.put(new Pair<String, String>("dr", "net/minecraft/nbt/NBTTagLong"));
+ mObInitMap.put(new Pair<String, String>("adi", "net/minecraft/item/ItemBucketMilk"));
+ mObInitMap.put(new Pair<String, String>("ahh", "net/minecraft/world/IWorldAccess"));
+ mObInitMap.put(new Pair<String, String>("bth", "net/minecraft/client/audio/MusicTicker$MusicType"));
+ mObInitMap.put(new Pair<String, String>("bpi", "net/minecraft/client/shader/ShaderManager"));
+ mObInitMap.put(new Pair<String, String>("asp", "net/minecraft/world/gen/feature/WorldGenTallGrass"));
+ mObInitMap.put(new Pair<String, String>("awo", "net/minecraft/world/gen/NoiseGeneratorSimplex"));
+ mObInitMap.put(new Pair<String, String>("bhk", "net/minecraft/client/model/ModelEnderman"));
+ mObInitMap.put(new Pair<String, String>("blj", "net/minecraft/util/MovementInputFromOptions"));
+ mObInitMap.put(new Pair<String, String>("ie", "net/minecraft/network/play/server/S3CPacketUpdateScore"));
+ mObInitMap.put(new Pair<String, String>("ef", "net/minecraft/nbt/JsonToNBT$Primitive"));
+ mObInitMap.put(new Pair<String, String>("ag", "net/minecraft/command/server/CommandBanPlayer"));
+ mObInitMap.put(new Pair<String, String>("xl", "net/minecraft/entity/item/EntityMinecart"));
+ mObInitMap.put(new Pair<String, String>("atd", "net/minecraft/world/gen/structure/MapGenNetherBridge"));
+ mObInitMap.put(new Pair<String, String>("ape", "net/minecraft/tileentity/TileEntityEnderChest"));
+ mObInitMap.put(new Pair<String, String>("alf", "net/minecraft/block/BlockGlass"));
+ mObInitMap.put(new Pair<String, String>("ahg", "net/minecraft/world/MinecraftException"));
+ mObInitMap.put(new Pair<String, String>("axc", "net/minecraft/world/gen/layer/GenLayerAddMushroomIsland"));
+ mObInitMap.put(new Pair<String, String>("baa", "net/minecraft/scoreboard/Score$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/DisconnectedOnlineScreen", "net/minecraft/realms/DisconnectedOnlineScreen"));
+ mObInitMap.put(new Pair<String, String>("btg", "net/minecraft/client/audio/MusicTicker"));
+ mObInitMap.put(new Pair<String, String>("ua", "net/minecraft/entity/ai/EntityAIMate"));
+ mObInitMap.put(new Pair<String, String>("mc", "net/minecraft/server/gui/MinecraftServerGui$4"));
+ mObInitMap.put(new Pair<String, String>("id", "net/minecraft/network/play/server/S3EPacketTeams"));
+ mObInitMap.put(new Pair<String, String>("q", "net/minecraft/util/Facing"));
+ mObInitMap.put(new Pair<String, String>(
+ "atw", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Start"));
+ mObInitMap.put(new Pair<String, String>("apx", "net/minecraft/world/chunk/Chunk"));
+ mObInitMap.put(new Pair<String, String>("aly", "net/minecraft/block/BlockMelon"));
+ mObInitMap.put(new Pair<String, String>("ahz", "net/minecraft/world/biome/BiomeCache$Block"));
+ mObInitMap.put(new Pair<String, String>("axv", "net/minecraft/world/gen/layer/GenLayerRiverMix"));
+ mObInitMap.put(new Pair<String, String>("btz", "net/minecraft/client/stream/Metadata"));
+ mObInitMap.put(new Pair<String, String>("ys", "net/minecraft/entity/monster/EntityZombie$GroupData"));
+ mObInitMap.put(new Pair<String, String>("ut", "net/minecraft/entity/ai/EntityAIMoveTowardsRestriction"));
+ mObInitMap.put(new Pair<String, String>("qu", "net/minecraft/util/Tuple"));
+ mObInitMap.put(new Pair<String, String>("mv", "net/minecraft/world/WorldServer$ServerBlockEventList"));
+ mObInitMap.put(new Pair<String, String>("iw", "net/minecraft/network/play/client/C11PacketEnchantItem"));
+ mObInitMap.put(new Pair<String, String>("ex", "net/minecraft/network/NetworkStatistics$Tracker"));
+ mObInitMap.put(new Pair<String, String>("ay", "net/minecraft/command/server/CommandListPlayers"));
+ mObInitMap.put(
+ new Pair<String, String>("aql", "net/minecraft/world/chunk/storage/AnvilChunkLoader$PendingChunk"));
+ mObInitMap.put(new Pair<String, String>("amm", "net/minecraft/block/BlockOldLog"));
+ mObInitMap.put(new Pair<String, String>("aap", "net/minecraft/inventory/ContainerPlayer"));
+ mObInitMap.put(new Pair<String, String>("ain", "net/minecraft/world/biome/BiomeGenMutated"));
+ mObInitMap.put(new Pair<String, String>("p", "net/minecraft/util/Direction"));
+ mObInitMap.put(new Pair<String, String>("bun", "net/minecraft/client/stream/IStream$AuthFailureReason"));
+ mObInitMap.put(new Pair<String, String>("bqo", "net/minecraft/client/resources/ResourceIndex"));
+ mObInitMap.put(new Pair<String, String>("bas", "net/minecraft/client/Minecraft$12"));
+ mObInitMap.put(new Pair<String, String>("ber", "net/minecraft/client/gui/IProgressMeter"));
+ mObInitMap.put(new Pair<String, String>("biq", "net/minecraft/client/model/ModelDragon"));
+ mObInitMap.put(new Pair<String, String>(
+ "bmp", "net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer"));
+ mObInitMap.put(new Pair<String, String>("ri", "net/minecraft/profiler/PlayerUsageSnooper"));
+ mObInitMap.put(new Pair<String, String>("nj", "net/minecraft/network/NetHandlerPlayServer$2"));
+ mObInitMap.put(new Pair<String, String>("jk", "net/minecraft/network/play/client/C0CPacketInput"));
+ mObInitMap.put(new Pair<String, String>("fl", "net/minecraft/event/HoverEvent"));
+ mObInitMap.put(new Pair<String, String>("bm", "net/minecraft/command/server/CommandSetBlock"));
+ mObInitMap.put(new Pair<String, String>("abd", "net/minecraft/item/ItemArmor$ArmorMaterial"));
+ mObInitMap.put(new Pair<String, String>("afc", "net/minecraft/item/crafting/RecipesMapExtending"));
+ mObInitMap.put(new Pair<String, String>("ajb", "net/minecraft/block/BlockAnvil"));
+ mObInitMap.put(new Pair<String, String>("brc", "net/minecraft/client/resources/ResourcePackRepository"));
+ mObInitMap.put(
+ new Pair<String, String>("auj", "net/minecraft/world/gen/structure/StructureStrongholdPieces$1"));
+ mObInitMap.put(new Pair<String, String>("ayi", "net/minecraft/world/storage/MapData"));
+ mObInitMap.put(new Pair<String, String>("bbg", "net/minecraft/util/MouseHelper"));
+ mObInitMap.put(new Pair<String, String>("bff", "net/minecraft/client/gui/GuiScreenBook$NextPageButton"));
+ mObInitMap.put(new Pair<String, String>("bje", "net/minecraft/client/multiplayer/PlayerControllerMP"));
+ mObInitMap.put(new Pair<String, String>("bnd", "net/minecraft/client/renderer/entity/RenderBlaze"));
+ mObInitMap.put(new Pair<String, String>("ca", "net/minecraft/command/CommandToggleDownfall"));
+ mObInitMap.put(new Pair<String, String>("zf", "net/minecraft/entity/item/EntityFireworkRocket"));
+ mObInitMap.put(new Pair<String, String>("vg", "net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy"));
+ mObInitMap.put(new Pair<String, String>("rh", "net/minecraft/inventory/InventoryBasic"));
+ mObInitMap.put(new Pair<String, String>("aja", "net/minecraft/block/BlockAir"));
+ mObInitMap.put(new Pair<String, String>("bbz", "net/minecraft/client/gui/MapItemRenderer$Instance"));
+ mObInitMap.put(new Pair<String, String>("bfy", "net/minecraft/client/gui/inventory/GuiDispenser"));
+ mObInitMap.put(new Pair<String, String>("bjx", "net/minecraft/client/particle/EntityCritFX"));
+ mObInitMap.put(new Pair<String, String>("zy", "net/minecraft/inventory/ContainerBeacon$BeaconSlot"));
+ mObInitMap.put(new Pair<String, String>("vz", "net/minecraft/village/Village"));
+ mObInitMap.put(new Pair<String, String>("arr", "net/minecraft/world/gen/feature/WorldGenGlowStone2"));
+ mObInitMap.put(new Pair<String, String>("ans", "net/minecraft/block/BlockStairs"));
+ mObInitMap.put(new Pair<String, String>("abv", "net/minecraft/creativetab/CreativeTabs$10"));
+ mObInitMap.put(new Pair<String, String>("afu", "net/minecraft/enchantment/EnumEnchantmentType"));
+ mObInitMap.put(new Pair<String, String>("ajt", "net/minecraft/block/BlockCactus"));
+ mObInitMap.put(
+ new Pair<String, String>("avq", "net/minecraft/world/gen/structure/StructureVillagePieces$House1"));
+ mObInitMap.put(new Pair<String, String>("azp", "net/minecraft/world/storage/IPlayerFileData"));
+ mObInitMap.put(new Pair<String, String>("bru", "net/minecraft/client/resources/data/IMetadataSection"));
+ mObInitMap.put(new Pair<String, String>("bjw", "net/minecraft/client/particle/EntityCrit2FX"));
+ mObInitMap.put(new Pair<String, String>("bnv", "net/minecraft/client/renderer/entity/RenderHorse"));
+ mObInitMap.put(new Pair<String, String>("wn", "net/minecraft/entity/passive/EntityOcelot"));
+ mObInitMap.put(new Pair<String, String>("op", "net/minecraft/server/management/UserListBans"));
+ mObInitMap.put(new Pair<String, String>("kq", "net/minecraft/init/Bootstrap$13"));
+ mObInitMap.put(new Pair<String, String>("gr", "net/minecraft/network/play/server/S3FPacketCustomPayload"));
+ mObInitMap.put(new Pair<String, String>("cs", "net/minecraft/util/IObjectIntIterable"));
+ mObInitMap.put(new Pair<String, String>("asf", "net/minecraft/world/gen/feature/WorldGenTaiga1"));
+ mObInitMap.put(new Pair<String, String>("aog", "net/minecraft/block/BlockTripWireHook"));
+ mObInitMap.put(new Pair<String, String>("akh", "net/minecraft/block/BlockDeadBush"));
+ mObInitMap.put(new Pair<String, String>("acj", "net/minecraft/item/ItemDye"));
+ mObInitMap.put(new Pair<String, String>("agi", "net/minecraft/enchantment/EnchantmentProtection"));
+ mObInitMap.put(
+ new Pair<String, String>("bsi", "net/minecraft/client/resources/data/TextureMetadataSection"));
+ mObInitMap.put(new Pair<String, String>("bcm", "net/minecraft/client/gui/GuiSlot"));
+ mObInitMap.put(new Pair<String, String>("bgl", "net/minecraft/client/gui/GuiResourcePackSelected"));
+ mObInitMap.put(new Pair<String, String>("bkk", "net/minecraft/client/particle/EntityLavaFX"));
+ mObInitMap.put(
+ new Pair<String, String>("boj", "net/minecraft/client/renderer/entity/RenderMinecartMobSpawner"));
+ mObInitMap.put(new Pair<String, String>("tc", "net/minecraft/entity/item/EntityPainting$EnumArt"));
+ mObInitMap.put(new Pair<String, String>("pd", "net/minecraft/stats/IStatStringFormat"));
+ mObInitMap.put(new Pair<String, String>("le", "net/minecraft/command/ServerCommand"));
+ mObInitMap.put(new Pair<String, String>("hf", "net/minecraft/network/play/server/S14PacketEntity"));
+ mObInitMap.put(new Pair<String, String>("dg", "net/minecraft/nbt/NBTTagByte"));
+ mObInitMap.put(new Pair<String, String>("ase", "net/minecraft/world/gen/feature/WorldGenMinable"));
+ mObInitMap.put(new Pair<String, String>(
+ "awd", "net/minecraft/world/gen/structure/StructureVillagePieces$Village"));
+ mObInitMap.put(new Pair<String, String>("bda", "net/minecraft/client/gui/GuiCreateFlatWorld$Details"));
+ mObInitMap.put(new Pair<String, String>("hy", "net/minecraft/network/play/server/S12PacketEntityVelocity"));
+ mObInitMap.put(new Pair<String, String>("dz", "net/minecraft/nbt/NBTBase$NBTPrimitive"));
+ mObInitMap.put(new Pair<String, String>("xa", "net/minecraft/entity/boss/EntityDragon"));
+ mObInitMap.put(new Pair<String, String>("tb", "net/minecraft/entity/item/EntityPainting"));
+ mObInitMap.put(
+ new Pair<String, String>("asx", "net/minecraft/world/gen/structure/StructureMineshaftPieces"));
+ mObInitMap.put(new Pair<String, String>("aoy", "net/minecraft/tileentity/TileEntityCommandBlock$1"));
+ mObInitMap.put(new Pair<String, String>("akz", "net/minecraft/block/BlockFence"));
+ mObInitMap.put(new Pair<String, String>("aww", "net/minecraft/block/material/MaterialPortal"));
+ mObInitMap.put(new Pair<String, String>("bdt", "net/minecraft/client/gui/GuiScreenWorking"));
+ mObInitMap.put(new Pair<String, String>("bhs", "net/minecraft/client/model/ModelHorse"));
+ mObInitMap.put(new Pair<String, String>("xt", "net/minecraft/entity/ai/EntityMinecartMobSpawner"));
+ mObInitMap.put(new Pair<String, String>("tu", "net/minecraft/entity/ai/EntityLookHelper"));
+ mObInitMap.put(new Pair<String, String>("pv", "net/minecraft/util/HttpUtil"));
+ mObInitMap.put(new Pair<String, String>("lw", "net/minecraft/server/dedicated/DedicatedServer$3"));
+ mObInitMap.put(new Pair<String, String>("hx", "net/minecraft/network/play/server/S1BPacketEntityAttach"));
+ mObInitMap.put(new Pair<String, String>("f", "net/minecraft/crash/CrashReport$4"));
+ mObInitMap.put(new Pair<String, String>(
+ "atl", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Entrance"));
+ mObInitMap.put(new Pair<String, String>("apm", "net/minecraft/tileentity/TileEntitySign"));
+ mObInitMap.put(new Pair<String, String>("aln", "net/minecraft/block/BlockHopper"));
+ mObInitMap.put(new Pair<String, String>("adp", "net/minecraft/item/ItemPotion"));
+ mObInitMap.put(new Pair<String, String>("aho", "net/minecraft/world/SpawnerAnimals"));
+ mObInitMap.put(new Pair<String, String>("bai", "net/minecraft/stats/ObjectiveStat"));
+ mObInitMap.put(new Pair<String, String>("bto", "net/minecraft/client/audio/SoundEventAccessorComposite"));
+ mObInitMap.put(new Pair<String, String>("bpp", "net/minecraft/client/renderer/texture/AbstractTexture"));
+ mObInitMap.put(new Pair<String, String>("blq", "net/minecraft/client/renderer/EntitySorter"));
+ mObInitMap.put(new Pair<String, String>("yh", "net/minecraft/entity/monster/EntityPigZombie"));
+ mObInitMap.put(new Pair<String, String>("ui", "net/minecraft/entity/ai/EntityAIBase"));
+ mObInitMap.put(new Pair<String, String>("qj", "net/minecraft/profiler/Profiler$Result"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RealmsServerStatusPinger", "net/minecraft/realms/RealmsServerStatusPinger"));
+ mObInitMap.put(new Pair<String, String>("mk", "net/minecraft/world/demo/DemoWorldServer"));
+ mObInitMap.put(
+ new Pair<String, String>("il", "net/minecraft/network/play/server/S20PacketEntityProperties"));
+ mObInitMap.put(new Pair<String, String>("em", "net/minecraft/network/NetworkManager$3"));
+ mObInitMap.put(new Pair<String, String>("an", "net/minecraft/command/server/CommandEmote"));
+ mObInitMap.put(new Pair<String, String>("aqa", "net/minecraft/world/chunk/storage/NibbleArrayReader"));
+ mObInitMap.put(new Pair<String, String>("amb", "net/minecraft/block/BlockSilverfish"));
+ mObInitMap.put(new Pair<String, String>("aed", "net/minecraft/item/ItemSnowball"));
+ mObInitMap.put(new Pair<String, String>("aae", "net/minecraft/inventory/InventoryCrafting"));
+ mObInitMap.put(new Pair<String, String>("aic", "net/minecraft/world/biome/BiomeGenDesert"));
+ mObInitMap.put(new Pair<String, String>("e", "net/minecraft/crash/CrashReport$3"));
+ mObInitMap.put(
+ new Pair<String, String>("buc", "net/minecraft/client/stream/BroadcastController$BroadcastState"));
+ mObInitMap.put(new Pair<String, String>("bqd", "net/minecraft/client/renderer/texture/TextureAtlasSprite"));
+ mObInitMap.put(new Pair<String, String>("bah", "net/minecraft/scoreboard/IScoreObjectiveCriteria"));
+ mObInitMap.put(new Pair<String, String>("beg", "net/minecraft/client/gui/GuiWinGame"));
+ mObInitMap.put(new Pair<String, String>("bif", "net/minecraft/client/model/ModelSnowMan"));
+ mObInitMap.put(new Pair<String, String>("bme", "net/minecraft/client/util/QuadComparator"));
+ mObInitMap.put(new Pair<String, String>("fa", "net/minecraft/util/MessageSerializer"));
+ mObInitMap.put(new Pair<String, String>("bb", "net/minecraft/command/server/CommandNetstat"));
+ mObInitMap.put(new Pair<String, String>("aew", "net/minecraft/item/crafting/RecipeBookCloning"));
+ mObInitMap.put(new Pair<String, String>("aax", "net/minecraft/inventory/SlotCrafting"));
+ mObInitMap.put(new Pair<String, String>("aiv", "net/minecraft/world/biome/BiomeGenSwamp"));
+ mObInitMap.put(new Pair<String, String>("x", "net/minecraft/command/IAdminCommand"));
+ mObInitMap.put(new Pair<String, String>("bqw", "net/minecraft/client/resources/IResource"));
+ mObInitMap.put(new Pair<String, String>("bez", "net/minecraft/client/gui/inventory/GuiBeacon"));
+ mObInitMap.put(new Pair<String, String>("biy", "net/minecraft/client/model/TextureOffset"));
+ mObInitMap.put(new Pair<String, String>("bmx", "net/minecraft/client/renderer/culling/Frustrum"));
+ mObInitMap.put(new Pair<String, String>("js", "net/minecraft/network/login/server/S02PacketLoginSuccess"));
+ mObInitMap.put(new Pair<String, String>("ft", "net/minecraft/network/Packet"));
+ mObInitMap.put(new Pair<String, String>("bu", "net/minecraft/command/server/CommandSummon"));
+ mObInitMap.put(new Pair<String, String>("yz", "net/minecraft/entity/player/EntityPlayer"));
+ mObInitMap.put(new Pair<String, String>("aqs", "net/minecraft/world/gen/MapGenRavine"));
+ mObInitMap.put(new Pair<String, String>("amt", "net/minecraft/block/BlockRailPowered"));
+ mObInitMap.put(new Pair<String, String>("aiu", "net/minecraft/world/biome/BiomeGenStoneBeach"));
+ mObInitMap.put(new Pair<String, String>(
+ "aur", "net/minecraft/world/gen/structure/StructureStrongholdPieces$PieceWeight"));
+ mObInitMap.put(new Pair<String, String>("ayq", "net/minecraft/world/storage/SaveHandler"));
+ mObInitMap.put(new Pair<String, String>("bbo", "net/minecraft/client/LoadingScreenRenderer"));
+ mObInitMap.put(new Pair<String, String>(
+ "bfn", "net/minecraft/client/gui/inventory/GuiContainerCreative$CreativeSlot"));
+ mObInitMap.put(new Pair<String, String>("bjm", "net/minecraft/client/multiplayer/ServerAddress"));
+ mObInitMap.put(new Pair<String, String>("buu", "net/minecraft/client/renderer/OpenGlHelper"));
+ mObInitMap.put(new Pair<String, String>("zn", "net/minecraft/entity/item/EntityExpBottle"));
+ mObInitMap.put(new Pair<String, String>("vo", "net/minecraft/entity/ai/EntityAINearestAttackableTarget"));
+ mObInitMap.put(new Pair<String, String>("rp", "net/minecraft/util/EntityDamageSource"));
+ mObInitMap.put(new Pair<String, String>("nq", "net/minecraft/server/network/NetHandlerStatusServer"));
+ mObInitMap.put(new Pair<String, String>("jr", "net/minecraft/network/login/INetHandlerLoginClient"));
+ mObInitMap.put(new Pair<String, String>("arg", "net/minecraft/world/gen/feature/WorldGeneratorBonusChest"));
+ mObInitMap.put(new Pair<String, String>("anh", "net/minecraft/block/BlockSand"));
+ mObInitMap.put(new Pair<String, String>("abk", "net/minecraft/item/ItemBook"));
+ mObInitMap.put(new Pair<String, String>("afj", "net/minecraft/item/crafting/RecipesCrafting"));
+ mObInitMap.put(new Pair<String, String>("aji", "net/minecraft/block/Block"));
+ mObInitMap.put(new Pair<String, String>("avf", "net/minecraft/world/gen/structure/MapGenStructure$1"));
+ mObInitMap.put(new Pair<String, String>("aze", "net/minecraft/world/storage/ISaveFormat"));
+ mObInitMap.put(new Pair<String, String>("brj", "net/minecraft/client/resources/SkinManager"));
+ mObInitMap.put(new Pair<String, String>("bjl", "net/minecraft/client/gui/GuiPlayerInfo"));
+ mObInitMap.put(
+ new Pair<String, String>("bnk", "net/minecraft/client/renderer/tileentity/RenderEnderCrystal"));
+ mObInitMap.put(new Pair<String, String>("wc", "net/minecraft/village/VillageCollection"));
+ mObInitMap.put(new Pair<String, String>("sd", "net/minecraft/entity/Entity$SwitchEnumEntitySize"));
+ mObInitMap.put(new Pair<String, String>("oe", "net/minecraft/server/management/PreYggdrasilConverter$5"));
+ mObInitMap.put(new Pair<String, String>(
+ "kf", "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier"));
+ mObInitMap.put(new Pair<String, String>("gg", "net/minecraft/network/play/server/S24PacketBlockAction"));
+ mObInitMap.put(new Pair<String, String>("ch", "net/minecraft/command/CommandNotFoundException"));
+ mObInitMap.put(new Pair<String, String>("arz", "net/minecraft/world/gen/feature/WorldGenMegaJungle"));
+ mObInitMap.put(new Pair<String, String>("bcb", "net/minecraft/client/gui/GuiButton"));
+ mObInitMap.put(new Pair<String, String>("bga", "net/minecraft/client/gui/ServerListEntryLanScan"));
+ mObInitMap.put(new Pair<String, String>("sw", "net/minecraft/entity/EntityLiving"));
+ mObInitMap.put(new Pair<String, String>("ox", "net/minecraft/network/rcon/RConThreadQuery"));
+ mObInitMap.put(new Pair<String, String>("ky", "net/minecraft/init/Bootstrap$7"));
+ mObInitMap.put(new Pair<String, String>("gz", "net/minecraft/network/play/server/S26PacketMapChunkBulk"));
+ mObInitMap.put(new Pair<String, String>("akp", "net/minecraft/block/BlockDragonEgg"));
+ mObInitMap.put(new Pair<String, String>("acr", "net/minecraft/item/ItemFireworkCharge"));
+ mObInitMap.put(new Pair<String, String>("agq", "net/minecraft/tileentity/MobSpawnerBaseLogic"));
+ mObInitMap.put(new Pair<String, String>("bsq", "net/minecraft/client/audio/SoundList$SoundEntry"));
+ mObInitMap.put(new Pair<String, String>("bor", "net/minecraft/client/renderer/entity/RenderSilverfish"));
+ mObInitMap.put(new Pair<String, String>(
+ "avx", "net/minecraft/world/gen/structure/StructureVillagePieces$WoodHut"));
+ mObInitMap.put(new Pair<String, String>("azw", "net/minecraft/util/Vec3"));
+ mObInitMap.put(new Pair<String, String>("bcu", "net/minecraft/client/gui/GuiConfirmOpenLink"));
+ mObInitMap.put(new Pair<String, String>("bgt", "net/minecraft/client/main/Main$1"));
+ mObInitMap.put(new Pair<String, String>("bks", "net/minecraft/client/particle/EntityCloudFX"));
+ mObInitMap.put(new Pair<String, String>("wu", "net/minecraft/entity/passive/EntityWaterMob"));
+ mObInitMap.put(new Pair<String, String>("sv", "net/minecraft/entity/EntityLivingBase"));
+ mObInitMap.put(new Pair<String, String>("asm", "net/minecraft/world/gen/feature/WorldGenLiquids"));
+ mObInitMap.put(new Pair<String, String>("aon", "net/minecraft/block/BlockButtonWood"));
+ mObInitMap.put(new Pair<String, String>("ako", "net/minecraft/block/BlockDoublePlant"));
+ mObInitMap.put(new Pair<String, String>("awl", "net/minecraft/world/gen/NoiseGeneratorPerlin"));
+ mObInitMap.put(new Pair<String, String>("bdi", "net/minecraft/client/gui/GuiSleepMP"));
+ mObInitMap.put(new Pair<String, String>("bhh", "net/minecraft/client/model/ModelChicken"));
+ mObInitMap.put(new Pair<String, String>("blg", "net/minecraft/client/entity/AbstractClientPlayer"));
+ mObInitMap.put(new Pair<String, String>("xi", "net/minecraft/entity/item/EntityBoat"));
+ mObInitMap.put(new Pair<String, String>("tj", "net/minecraft/entity/ai/attributes/AttributeModifier"));
+ mObInitMap.put(new Pair<String, String>("pk", "net/minecraft/stats/StatBase$3"));
+ mObInitMap.put(new Pair<String, String>("ll", "net/minecraft/server/MinecraftServer$5"));
+ mObInitMap.put(
+ new Pair<String, String>("ata", "net/minecraft/world/gen/structure/StructureMineshaftPieces$Room"));
+ mObInitMap.put(new Pair<String, String>("apb", "net/minecraft/tileentity/TileEntityDispenser"));
+ mObInitMap.put(new Pair<String, String>("alc", "net/minecraft/block/BlockFlower"));
+ mObInitMap.put(new Pair<String, String>("ade", "net/minecraft/init/Items"));
+ mObInitMap.put(new Pair<String, String>("ahd", "net/minecraft/world/World$2"));
+ mObInitMap.put(
+ new Pair<String, String>("btd", "net/minecraft/client/network/LanServerDetector$LanServerList"));
+ mObInitMap.put(new Pair<String, String>("bpe", "net/minecraft/client/renderer/entity/RenderWolf"));
+ mObInitMap.put(new Pair<String, String>("blf", "net/minecraft/client/particle/EntityRainFX"));
+ mObInitMap.put(new Pair<String, String>("ia", "net/minecraft/network/play/server/S1FPacketSetExperience"));
+ mObInitMap.put(new Pair<String, String>("eb", "net/minecraft/nbt/JsonToNBT"));
+ mObInitMap.put(new Pair<String, String>("ac", "net/minecraft/command/ICommandSender"));
+ mObInitMap.put(new Pair<String, String>(
+ "att", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$PieceWeight"));
+ mObInitMap.put(new Pair<String, String>("apu", "net/minecraft/world/chunk/IChunkProvider"));
+ mObInitMap.put(new Pair<String, String>("alv", "net/minecraft/block/BlockLever"));
+ mObInitMap.put(new Pair<String, String>("adx", "net/minecraft/item/ItemShears"));
+ mObInitMap.put(new Pair<String, String>("ahw", "net/minecraft/world/biome/BiomeGenBase$TempCategory"));
+ mObInitMap.put(new Pair<String, String>("btw", "net/minecraft/client/stream/MetadataAchievement"));
+ mObInitMap.put(new Pair<String, String>("bpx", "net/minecraft/client/renderer/texture/Stitcher$Slot"));
+ mObInitMap.put(new Pair<String, String>("bhz", "net/minecraft/client/model/ModelSign"));
+ mObInitMap.put(new Pair<String, String>("bly", "net/minecraft/client/renderer/ItemRenderer"));
+ mObInitMap.put(new Pair<String, String>("uq", "net/minecraft/entity/ai/EntityAIAttackOnCollide"));
+ mObInitMap.put(new Pair<String, String>("ms", "net/minecraft/world/gen/ChunkProviderServer"));
+ mObInitMap.put(new Pair<String, String>(
+ "it", "net/minecraft/network/play/client/C16PacketClientStatus$EnumState"));
+ mObInitMap.put(new Pair<String, String>("eu", "net/minecraft/network/NetworkStatistics"));
+ mObInitMap.put(new Pair<String, String>("av", "net/minecraft/command/CommandServerKick"));
+ mObInitMap.put(new Pair<String, String>("ael", "net/minecraft/item/ItemWritableBook"));
+ mObInitMap.put(new Pair<String, String>("aam", "net/minecraft/inventory/ContainerHorseInventory"));
+ mObInitMap.put(new Pair<String, String>("aik", "net/minecraft/world/biome/BiomeGenJungle"));
+ mObInitMap.put(new Pair<String, String>("m", "net/minecraft/crash/CrashReportCategory$2"));
+ mObInitMap.put(new Pair<String, String>(
+ "buk", "net/minecraft/client/stream/IngestServerTester$IngestTestListener"));
+ mObInitMap.put(new Pair<String, String>("bql", "net/minecraft/client/renderer/texture/TextureClock"));
+ mObInitMap.put(new Pair<String, String>(
+ "ats", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Piece"));
+ mObInitMap.put(new Pair<String, String>("axr", "net/minecraft/world/gen/layer/GenLayerHills"));
+ mObInitMap.put(new Pair<String, String>("bap", "net/minecraft/client/Minecraft$1"));
+ mObInitMap.put(
+ new Pair<String, String>("beo", "net/minecraft/client/gui/achievement/GuiStats$StatsItem$1"));
+ mObInitMap.put(new Pair<String, String>("bin", "net/minecraft/client/model/ModelWither"));
+ mObInitMap.put(new Pair<String, String>(
+ "bmm", "net/minecraft/client/renderer/tileentity/TileEntityChestRenderer"));
+ mObInitMap.put(
+ new Pair<String, String>("jh", "net/minecraft/network/play/client/C13PacketPlayerAbilities"));
+ mObInitMap.put(new Pair<String, String>("fi", "net/minecraft/event/ClickEvent$Action"));
+ mObInitMap.put(new Pair<String, String>("bj", "net/minecraft/command/server/CommandSaveOn"));
+ mObInitMap.put(new Pair<String, String>("yo", "net/minecraft/entity/monster/EntitySpider$GroupData"));
+ mObInitMap.put(new Pair<String, String>("up", "net/minecraft/entity/ai/EntityAIVillagerMate"));
+ mObInitMap.put(new Pair<String, String>("aqh", "net/minecraft/world/chunk/storage/RegionFile"));
+ mObInitMap.put(new Pair<String, String>("ami", "net/minecraft/block/BlockNewLog"));
+ mObInitMap.put(new Pair<String, String>("aij", "net/minecraft/world/biome/BiomeGenSnow"));
+ mObInitMap.put(new Pair<String, String>("aug", "net/minecraft/world/gen/structure/MapGenStronghold"));
+ mObInitMap.put(new Pair<String, String>("ayf", "net/minecraft/pathfinding/PathEntity"));
+ mObInitMap.put(new Pair<String, String>("bbd", "net/minecraft/client/Minecraft$7"));
+ mObInitMap.put(new Pair<String, String>("bfc", "net/minecraft/client/gui/inventory/GuiBeacon$PowerButton"));
+ mObInitMap.put(new Pair<String, String>("bjb", "net/minecraft/client/network/NetHandlerPlayClient"));
+ mObInitMap.put(
+ new Pair<String, String>("buj", "net/minecraft/client/stream/IngestServerTester$SwitchStatType"));
+ mObInitMap.put(new Pair<String, String>("zc", "net/minecraft/entity/projectile/EntityArrow"));
+ mObInitMap.put(new Pair<String, String>("vd", "net/minecraft/entity/ai/EntityAIArrowAttack"));
+ mObInitMap.put(new Pair<String, String>("re", "net/minecraft/client/renderer/IconFlipped"));
+ mObInitMap.put(new Pair<String, String>("nf", "net/minecraft/network/NetworkSystem$3"));
+ mObInitMap.put(new Pair<String, String>(
+ "jg", "net/minecraft/network/play/client/C03PacketPlayer$C05PacketPlayerLook"));
+ mObInitMap.put(new Pair<String, String>(
+ "auz", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs2"));
+ mObInitMap.put(new Pair<String, String>("ayy", "net/minecraft/world/storage/WorldInfo$6"));
+ mObInitMap.put(new Pair<String, String>("bja", "net/minecraft/client/network/NetHandlerLoginClient$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RealmsSharedConstants", "net/minecraft/realms/RealmsSharedConstants"));
+ mObInitMap.put(new Pair<String, String>("zv", "net/minecraft/inventory/ContainerRepair$1"));
+ mObInitMap.put(new Pair<String, String>("vw", "net/minecraft/entity/ai/EntitySenses"));
+ mObInitMap.put(new Pair<String, String>("rx", "net/minecraft/entity/EntityAgeable"));
+ mObInitMap.put(new Pair<String, String>("ny", "net/minecraft/server/management/IPBanEntry"));
+ mObInitMap.put(new Pair<String, String>("jz", "net/minecraft/network/status/server/S01PacketPong"));
+ mObInitMap.put(new Pair<String, String>("aro", "net/minecraft/world/gen/feature/WorldGenFlowers"));
+ mObInitMap.put(new Pair<String, String>("anp", "net/minecraft/block/BlockSponge"));
+ mObInitMap.put(new Pair<String, String>("abs", "net/minecraft/item/ItemMapBase"));
+ mObInitMap.put(new Pair<String, String>("afr", "net/minecraft/enchantment/EnchantmentDurability"));
+ mObInitMap.put(new Pair<String, String>("ajq", "net/minecraft/block/BlockBrewingStand"));
+ mObInitMap.put(new Pair<String, String>("avn", "net/minecraft/world/gen/structure/MapGenVillage"));
+ mObInitMap.put(new Pair<String, String>("brr", "net/minecraft/client/resources/LanguageManager"));
+ mObInitMap.put(new Pair<String, String>("bbv", "net/minecraft/client/gui/GuiIngame"));
+ mObInitMap.put(new Pair<String, String>("bfu", "net/minecraft/client/gui/inventory/GuiInventory"));
+ mObInitMap.put(new Pair<String, String>("bjt", "net/minecraft/client/network/OldServerPinger$2$1"));
+ mObInitMap.put(new Pair<String, String>("bns", "net/minecraft/client/renderer/entity/RenderFish"));
+ mObInitMap.put(new Pair<String, String>("sl", "net/minecraft/command/IEntitySelector$2"));
+ mObInitMap.put(new Pair<String, String>("om", "net/minecraft/server/management/UserList"));
+ mObInitMap.put(new Pair<String, String>("kn", "net/minecraft/init/Bootstrap$10"));
+ mObInitMap.put(new Pair<String, String>("go", "net/minecraft/network/play/server/S30PacketWindowItems"));
+ mObInitMap.put(new Pair<String, String>("cp", "net/minecraft/dispenser/IBehaviorDispenseItem"));
+ mObInitMap.put(new Pair<String, String>("ake", "net/minecraft/block/BlockWorkbench"));
+ mObInitMap.put(new Pair<String, String>("acg", "net/minecraft/item/ItemTool"));
+ mObInitMap.put(new Pair<String, String>("agf", "net/minecraft/enchantment/EnchantmentKnockback"));
+ mObInitMap.put(new Pair<String, String>(
+ "bsf", "net/minecraft/client/resources/data/LanguageMetadataSectionSerializer"));
+ mObInitMap.put(new Pair<String, String>("avm", "net/minecraft/world/gen/structure/StructureStart"));
+ mObInitMap.put(new Pair<String, String>("bcj", "net/minecraft/client/gui/GuiOptionButton"));
+ mObInitMap.put(
+ new Pair<String, String>("bgi", "net/minecraft/client/resources/ResourcePackListEntryFound"));
+ mObInitMap.put(new Pair<String, String>("bkh", "net/minecraft/client/particle/EntityHeartFX"));
+ mObInitMap.put(new Pair<String, String>("bog", "net/minecraft/client/renderer/entity/RenderLightningBolt"));
+ mObInitMap.put(new Pair<String, String>("lb", "net/minecraft/client/util/JsonException"));
+ mObInitMap.put(new Pair<String, String>("hc", "net/minecraft/network/play/server/S29PacketSoundEffect"));
+ mObInitMap.put(new Pair<String, String>("dd", "net/minecraft/util/StatCollector"));
+ mObInitMap.put(new Pair<String, String>("wj", "net/minecraft/entity/passive/EntityHorse$1"));
+ mObInitMap.put(new Pair<String, String>("asb", "net/minecraft/world/gen/feature/WorldGenHugeTrees"));
+ mObInitMap.put(new Pair<String, String>("aoc", "net/minecraft/block/BlockTorch"));
+ mObInitMap.put(
+ new Pair<String, String>("awa", "net/minecraft/world/gen/structure/StructureVillagePieces$Start"));
+ mObInitMap.put(new Pair<String, String>("la", "net/minecraft/init/Bootstrap$9"));
+ mObInitMap.put(new Pair<String, String>("aov", "net/minecraft/tileentity/TileEntityBrewingStand"));
+ mObInitMap.put(new Pair<String, String>("akw", "net/minecraft/block/ITileEntityProvider"));
+ mObInitMap.put(new Pair<String, String>("acy", "net/minecraft/item/ItemAppleGold"));
+ mObInitMap.put(new Pair<String, String>("agx", "net/minecraft/world/ColorizerFoliage"));
+ mObInitMap.put(new Pair<String, String>("awt", "net/minecraft/block/material/Material"));
+ mObInitMap.put(new Pair<String, String>("bsx", "net/minecraft/server/integrated/IntegratedServer"));
+ mObInitMap.put(new Pair<String, String>("boy", "net/minecraft/client/renderer/entity/RenderTNTPrimed"));
+ mObInitMap.put(new Pair<String, String>("bkz", "net/minecraft/client/particle/EntitySuspendFX"));
+ mObInitMap.put(new Pair<String, String>("xq", "net/minecraft/entity/item/EntityMinecartFurnace"));
+ mObInitMap.put(new Pair<String, String>("tr", "net/minecraft/entity/EntityBodyHelper"));
+ mObInitMap.put(new Pair<String, String>("lt", "net/minecraft/server/dedicated/DedicatedServer"));
+ mObInitMap.put(new Pair<String, String>("hu", "net/minecraft/network/play/server/S09PacketHeldItemChange"));
+ mObInitMap.put(new Pair<String, String>("dv", "net/minecraft/nbt/NBTUtil"));
+ mObInitMap.put(new Pair<String, String>(
+ "ati", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Straight"));
+ mObInitMap.put(new Pair<String, String>("apj", "net/minecraft/tileentity/TileEntityMobSpawner"));
+ mObInitMap.put(new Pair<String, String>("alk", "net/minecraft/block/BlockBreakable"));
+ mObInitMap.put(new Pair<String, String>("adm", "net/minecraft/item/ItemNameTag"));
+ mObInitMap.put(new Pair<String, String>("ahl", "net/minecraft/world/IBlockAccess"));
+ mObInitMap.put(new Pair<String, String>("btl", "net/minecraft/client/audio/SoundManager$2"));
+ mObInitMap.put(new Pair<String, String>("bpm", "net/minecraft/client/shader/ShaderLoader$ShaderType"));
+ mObInitMap.put(new Pair<String, String>("bdp", "net/minecraft/client/gui/GuiIngameMenu"));
+ mObInitMap.put(new Pair<String, String>("bho", "net/minecraft/client/model/ModelMagmaCube"));
+ mObInitMap.put(new Pair<String, String>("bln", "net/minecraft/entity/boss/BossStatus"));
+ mObInitMap.put(new Pair<String, String>("uf", "net/minecraft/entity/ai/EntityAISwimming"));
+ mObInitMap.put(new Pair<String, String>("qg", "net/minecraft/util/EnumTypeAdapterFactory$1"));
+ mObInitMap.put(new Pair<String, String>("ii", "net/minecraft/network/play/server/S33PacketUpdateSign"));
+ mObInitMap.put(new Pair<String, String>("ej", "net/minecraft/network/NetworkManager"));
+ mObInitMap.put(new Pair<String, String>("ak", "net/minecraft/command/CommandDebug"));
+ mObInitMap.put(new Pair<String, String>("aea", "net/minecraft/item/ItemSimpleFoiled"));
+ mObInitMap.put(new Pair<String, String>("aab", "net/minecraft/inventory/ContainerBrewingStand$Potion"));
+ mObInitMap.put(new Pair<String, String>("b", "net/minecraft/crash/CrashReport"));
+ mObInitMap.put(new Pair<String, String>("bqa", "net/minecraft/client/renderer/texture/TextureMap$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "ath", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$End"));
+ mObInitMap.put(new Pair<String, String>("bae", "net/minecraft/scoreboard/Team"));
+ mObInitMap.put(new Pair<String, String>("bed", "net/minecraft/client/gui/GuiScreenOptionsSounds$Button"));
+ mObInitMap.put(new Pair<String, String>("bic", "net/minecraft/client/model/ModelSkeleton"));
+ mObInitMap.put(new Pair<String, String>("bmb", "net/minecraft/client/renderer/RenderGlobal$1"));
+ mObInitMap.put(new Pair<String, String>("yd", "net/minecraft/entity/monster/EntityGhast"));
+ mObInitMap.put(new Pair<String, String>("ue", "net/minecraft/entity/ai/EntityAIFleeSun"));
+ mObInitMap.put(new Pair<String, String>("aau", "net/minecraft/inventory/SlotMerchantResult"));
+ mObInitMap.put(new Pair<String, String>("u", "net/minecraft/util/Util"));
+ mObInitMap.put(new Pair<String, String>("bax", "net/minecraft/client/Minecraft$SwitchMovingObjectType"));
+ mObInitMap.put(new Pair<String, String>("bew", "net/minecraft/client/gui/GuiControls"));
+ mObInitMap.put(new Pair<String, String>("yw", "net/minecraft/entity/player/PlayerCapabilities"));
+ mObInitMap.put(new Pair<String, String>("ux", "net/minecraft/entity/ai/EntityAILookAtVillager"));
+ mObInitMap.put(new Pair<String, String>("mz", "net/minecraft/network/PingResponseHandler"));
+ mObInitMap.put(new Pair<String, String>("aqp", "net/minecraft/world/WorldProviderHell"));
+ mObInitMap.put(new Pair<String, String>("amq", "net/minecraft/block/BlockPortal$Size"));
+ mObInitMap.put(new Pair<String, String>("aat", "net/minecraft/inventory/ContainerMerchant"));
+ mObInitMap.put(new Pair<String, String>("air", "net/minecraft/world/biome/BiomeGenRiver"));
+ mObInitMap.put(new Pair<String, String>(
+ "auo", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Crossing"));
+ mObInitMap.put(new Pair<String, String>("ayn", "net/minecraft/world/chunk/storage/AnvilSaveConverter"));
+ mObInitMap.put(new Pair<String, String>("bbl", "net/minecraft/client/settings/GameSettings$SwitchOptions"));
+ mObInitMap.put(new Pair<String, String>("bur", "net/minecraft/client/stream/NullStream"));
+ mObInitMap.put(new Pair<String, String>("bqs", "net/minecraft/client/resources/FolderResourcePack"));
+ mObInitMap.put(new Pair<String, String>("bmt", "net/minecraft/client/renderer/tileentity/RenderEndPortal"));
+ mObInitMap.put(new Pair<String, String>("zk", "net/minecraft/entity/projectile/EntityThrowable"));
+ mObInitMap.put(new Pair<String, String>("vl", "net/minecraft/entity/ai/EntityAITradePlayer"));
+ mObInitMap.put(new Pair<String, String>("rm", "net/minecraft/util/CombatEntry"));
+ mObInitMap.put(new Pair<String, String>("nn", "net/minecraft/server/network/NetHandlerLoginServer"));
+ mObInitMap.put(
+ new Pair<String, String>("jo", "net/minecraft/network/play/client/C08PacketPlayerBlockPlacement"));
+ mObInitMap.put(new Pair<String, String>("fp", "net/minecraft/util/ChatStyle$Serializer"));
+ mObInitMap.put(new Pair<String, String>("bq", "net/minecraft/command/CommandShowSeed"));
+ mObInitMap.put(new Pair<String, String>("ard", "net/minecraft/world/gen/feature/WorldGenBigTree"));
+ mObInitMap.put(new Pair<String, String>("ane", "net/minecraft/block/BlockReed"));
+ mObInitMap.put(new Pair<String, String>("abh", "net/minecraft/item/ItemBlock"));
+ mObInitMap.put(new Pair<String, String>("afg", "net/minecraft/item/crafting/IRecipe"));
+ mObInitMap.put(new Pair<String, String>("ajf", "net/minecraft/block/BlockRailBase$Rail"));
+ mObInitMap.put(new Pair<String, String>(
+ "avc", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold"));
+ mObInitMap.put(
+ new Pair<String, String>("brg", "net/minecraft/client/resources/SimpleReloadableResourceManager"));
+ mObInitMap.put(new Pair<String, String>("bbk", "net/minecraft/client/settings/GameSettings$1"));
+ mObInitMap.put(new Pair<String, String>("bfj", "net/minecraft/client/gui/inventory/GuiCrafting"));
+ mObInitMap.put(new Pair<String, String>("bji", "net/minecraft/client/multiplayer/WorldClient$3"));
+ mObInitMap.put(new Pair<String, String>("bnh", "net/minecraft/client/renderer/entity/RenderCow"));
+ mObInitMap.put(new Pair<String, String>("sa", "net/minecraft/entity/Entity"));
+ mObInitMap.put(new Pair<String, String>("ob", "net/minecraft/server/management/PreYggdrasilConverter$2"));
+ mObInitMap.put(
+ new Pair<String, String>("kc", "net/minecraft/network/ServerStatusResponse$PlayerCountData"));
+ mObInitMap.put(new Pair<String, String>("gd", "net/minecraft/network/play/server/S37PacketStatistics"));
+ mObInitMap.put(new Pair<String, String>("ce", "net/minecraft/command/NumberInvalidException"));
+ mObInitMap.put(new Pair<String, String>("net/minecraft/realms/Realms", "net/minecraft/realms/Realms"));
+ mObInitMap.put(new Pair<String, String>("ajy", "net/minecraft/block/BlockClay"));
+ mObInitMap.put(new Pair<String, String>("afz", "net/minecraft/enchantment/EnchantmentHelper$IModifier"));
+ mObInitMap.put(new Pair<String, String>("brz", "net/minecraft/client/resources/data/AnimationFrame"));
+ mObInitMap.put(new Pair<String, String>(
+ "avb", "net/minecraft/world/gen/structure/StructureStrongholdPieces$StairsStraight"));
+ mObInitMap.put(new Pair<String, String>("aza", "net/minecraft/world/storage/WorldInfo$8"));
+ mObInitMap.put(new Pair<String, String>("kv", "net/minecraft/init/Bootstrap$5"));
+ mObInitMap.put(new Pair<String, String>("gw", "net/minecraft/network/play/server/S00PacketKeepAlive"));
+ mObInitMap.put(new Pair<String, String>("cx", "net/minecraft/dispenser/IPosition"));
+ mObInitMap.put(new Pair<String, String>("arv", "net/minecraft/world/gen/feature/WorldGenIcePath"));
+ mObInitMap.put(new Pair<String, String>("anw", "net/minecraft/block/BlockStoneBrick"));
+ mObInitMap.put(new Pair<String, String>("ajx", "net/minecraft/block/BlockChest"));
+ mObInitMap.put(new Pair<String, String>(
+ "avu", "net/minecraft/world/gen/structure/StructureVillagePieces$PieceWeight"));
+ mObInitMap.put(new Pair<String, String>("azt", "net/minecraft/util/AxisAlignedBB"));
+ mObInitMap.put(new Pair<String, String>("bcr", "net/minecraft/client/gui/GuiSlotRealmsProxy"));
+ mObInitMap.put(new Pair<String, String>(
+ "bgq", "net/minecraft/client/gui/stream/GuiStreamUnavailable$SwitchReason"));
+ mObInitMap.put(new Pair<String, String>("bkp", "net/minecraft/client/particle/EffectRenderer$2"));
+ mObInitMap.put(new Pair<String, String>("wr", "net/minecraft/entity/monster/EntitySnowman"));
+ mObInitMap.put(new Pair<String, String>("ss", "net/minecraft/entity/EntityHanging"));
+ mObInitMap.put(new Pair<String, String>("ot", "net/minecraft/network/rcon/RConOutputStream"));
+ mObInitMap.put(new Pair<String, String>("ku", "net/minecraft/init/Bootstrap$4"));
+ mObInitMap.put(new Pair<String, String>("asj", "net/minecraft/world/gen/feature/WorldGenSand"));
+ mObInitMap.put(new Pair<String, String>("aok", "net/minecraft/block/BlockWeb"));
+ mObInitMap.put(new Pair<String, String>("akl", "net/minecraft/block/BlockDirt"));
+ mObInitMap.put(new Pair<String, String>("acn", "net/minecraft/item/ItemEnderEye"));
+ mObInitMap.put(new Pair<String, String>("agm", "net/minecraft/entity/IMerchant"));
+ mObInitMap.put(new Pair<String, String>("bsm", "net/minecraft/client/audio/MovingSoundMinecart"));
+ mObInitMap.put(new Pair<String, String>("bon", "net/minecraft/client/renderer/entity/RenderPainting"));
+ mObInitMap.put(new Pair<String, String>("bko", "net/minecraft/client/particle/EffectRenderer$1"));
+ mObInitMap.put(new Pair<String, String>("xf", "net/minecraft/util/WeightedRandomFishable"));
+ mObInitMap.put(new Pair<String, String>("tg", "net/minecraft/entity/passive/EntityTameable"));
+ mObInitMap.put(new Pair<String, String>("ph", "net/minecraft/stats/StatBase"));
+ mObInitMap.put(new Pair<String, String>("li", "net/minecraft/server/MinecraftServer$2"));
+ mObInitMap.put(new Pair<String, String>("hj", "net/minecraft/network/play/server/S36PacketSignEditorOpen"));
+ mObInitMap.put(new Pair<String, String>("dk", "net/minecraft/nbt/NBTTagDouble"));
+ mObInitMap.put(new Pair<String, String>("adb", "net/minecraft/item/Item"));
+ mObInitMap.put(new Pair<String, String>("aha", "net/minecraft/world/ColorizerGrass"));
+ mObInitMap.put(new Pair<String, String>("bta", "net/minecraft/client/network/LanServerDetector"));
+ mObInitMap.put(new Pair<String, String>("bpb", "net/minecraft/client/renderer/entity/RenderWitch"));
+ mObInitMap.put(new Pair<String, String>("bde", "net/minecraft/client/gui/GuiScreenServerList"));
+ mObInitMap.put(new Pair<String, String>("bhd", "net/minecraft/client/model/ModelBlaze"));
+ mObInitMap.put(new Pair<String, String>("blc", "net/minecraft/client/particle/EntityBlockDustFX"));
+ mObInitMap.put(new Pair<String, String>("tz", "net/minecraft/entity/ai/EntityAIBreakDoor"));
+ mObInitMap.put(new Pair<String, String>("als", "net/minecraft/block/BlockLadder"));
+ mObInitMap.put(new Pair<String, String>("aht", "net/minecraft/world/biome/BiomeGenBeach"));
+ mObInitMap.put(new Pair<String, String>("btt", "net/minecraft/client/audio/SoundRegistry"));
+ mObInitMap.put(new Pair<String, String>("bpu", "net/minecraft/client/renderer/texture/SimpleTexture"));
+ mObInitMap.put(new Pair<String, String>("bdx", "net/minecraft/client/gui/GuiSelectWorld"));
+ mObInitMap.put(new Pair<String, String>("bhw", "net/minecraft/client/model/ModelQuadruped"));
+ mObInitMap.put(new Pair<String, String>("blv", "net/minecraft/client/renderer/EntityRenderer$2"));
+ mObInitMap.put(new Pair<String, String>("iq", "net/minecraft/network/play/client/C14PacketTabComplete"));
+ mObInitMap.put(new Pair<String, String>("er", "net/minecraft/network/EnumConnectionState$3"));
+ mObInitMap.put(new Pair<String, String>("as", "net/minecraft/command/CommandGameRule"));
+ mObInitMap.put(new Pair<String, String>("xx", "net/minecraft/entity/monster/EntityBlaze"));
+ mObInitMap.put(new Pair<String, String>("ty", "net/minecraft/entity/ai/EntityAIBeg"));
+ mObInitMap.put(new Pair<String, String>("aaj", "net/minecraft/inventory/ContainerFurnace"));
+ mObInitMap.put(new Pair<String, String>("j", "net/minecraft/crash/CrashReport$8"));
+ mObInitMap.put(new Pair<String, String>(
+ "atp", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor2"));
+ mObInitMap.put(new Pair<String, String>("apq", "net/minecraft/block/BlockPistonExtension"));
+ mObInitMap.put(new Pair<String, String>("alr", "net/minecraft/block/BlockJukebox$TileEntityJukebox"));
+ mObInitMap.put(new Pair<String, String>("axo", "net/minecraft/world/gen/layer/GenLayer$1"));
+ mObInitMap.put(new Pair<String, String>("bam", "net/minecraft/client/renderer/RenderHelper"));
+ mObInitMap.put(
+ new Pair<String, String>("bel", "net/minecraft/client/gui/achievement/GuiStats$StatsBlock$1"));
+ mObInitMap.put(new Pair<String, String>("bik", "net/minecraft/client/model/ModelVillager"));
+ mObInitMap.put(new Pair<String, String>(
+ "bmj", "net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer"));
+ mObInitMap.put(new Pair<String, String>("bg", "net/minecraft/command/server/CommandPublishLocalServer"));
+ mObInitMap.put(new Pair<String, String>("yl", "net/minecraft/entity/monster/EntitySkeleton"));
+ mObInitMap.put(new Pair<String, String>("um", "net/minecraft/entity/ai/EntityAILeapAtTarget"));
+ mObInitMap.put(new Pair<String, String>("qn", "net/minecraft/util/StringUtils"));
+ mObInitMap.put(new Pair<String, String>("mo", "net/minecraft/entity/EntityTracker$1"));
+ mObInitMap.put(new Pair<String, String>("amf", "net/minecraft/block/BlockNetherWart"));
+ mObInitMap.put(new Pair<String, String>("aeh", "net/minecraft/item/ItemSword"));
+ mObInitMap.put(new Pair<String, String>("aai", "net/minecraft/inventory/ContainerEnchantment$2"));
+ mObInitMap.put(new Pair<String, String>("aig", "net/minecraft/world/biome/BiomeGenForest$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "aud", "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid$Stones"));
+ mObInitMap.put(new Pair<String, String>("ayc", "net/minecraft/world/gen/layer/GenLayerZoom"));
+ mObInitMap.put(new Pair<String, String>("bba", "net/minecraft/client/Minecraft$4"));
+ mObInitMap.put(new Pair<String, String>("bug", "net/minecraft/client/stream/ChatController$ChatState"));
+ mObInitMap.put(new Pair<String, String>("bqh", "net/minecraft/client/renderer/texture/ITextureObject"));
+ mObInitMap.put(new Pair<String, String>("bmi", "net/minecraft/client/shader/TesselatorVertexState"));
+ mObInitMap.put(new Pair<String, String>("va", "net/minecraft/entity/ai/EntityAIPlay"));
+ mObInitMap.put(new Pair<String, String>("rb", "net/minecraft/inventory/IInventory"));
+ mObInitMap.put(new Pair<String, String>("nc", "net/minecraft/network/NetworkSystem"));
+ mObInitMap.put(new Pair<String, String>("jd", "net/minecraft/network/play/client/C03PacketPlayer"));
+ mObInitMap.put(new Pair<String, String>("fe", "net/minecraft/util/ChatComponentStyle"));
+ mObInitMap.put(new Pair<String, String>("bf", "net/minecraft/command/CommandPlaySound"));
+ mObInitMap.put(new Pair<String, String>("aqx", "net/minecraft/world/gen/MapGenBase"));
+ mObInitMap.put(new Pair<String, String>("amy", "net/minecraft/block/BlockRail"));
+ mObInitMap.put(new Pair<String, String>("aiz", "net/minecraft/world/gen/feature/WorldGenWaterlily"));
+ mObInitMap.put(new Pair<String, String>(
+ "auw", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stones"));
+ mObInitMap.put(new Pair<String, String>("vt", "net/minecraft/entity/ai/EntityAIOwnerHurtTarget"));
+ mObInitMap.put(new Pair<String, String>("ru", "net/minecraft/potion/PotionHealth"));
+ mObInitMap.put(
+ new Pair<String, String>("nv", "net/minecraft/server/management/PlayerProfileCache$ProfileEntry"));
+ mObInitMap.put(new Pair<String, String>("jw", "net/minecraft/network/login/client/C00PacketLoginStart"));
+ mObInitMap.put(
+ new Pair<String, String>("fx", "net/minecraft/network/play/server/S11PacketSpawnExperienceOrb"));
+ mObInitMap.put(new Pair<String, String>("by", "net/minecraft/command/server/CommandTestFor"));
+ mObInitMap.put(new Pair<String, String>("abp", "net/minecraft/item/ItemCarrotOnAStick"));
+ mObInitMap.put(new Pair<String, String>("afo", "net/minecraft/enchantment/EnchantmentArrowInfinite"));
+ mObInitMap.put(new Pair<String, String>("ajn", "net/minecraft/init/Blocks"));
+ mObInitMap.put(new Pair<String, String>(
+ "bro", "net/minecraft/client/resources/SkinManager$SkinAvailableCallback"));
+ mObInitMap.put(new Pair<String, String>(
+ "auv", "net/minecraft/world/gen/structure/StructureStrongholdPieces$RoomCrossing"));
+ mObInitMap.put(new Pair<String, String>("ayu", "net/minecraft/world/storage/WorldInfo$2"));
+ mObInitMap.put(new Pair<String, String>("bbs", "net/minecraft/util/Session"));
+ mObInitMap.put(new Pair<String, String>("bfr", "net/minecraft/client/gui/inventory/GuiFurnace"));
+ mObInitMap.put(new Pair<String, String>("bjq", "net/minecraft/client/network/OldServerPinger"));
+ mObInitMap.put(new Pair<String, String>("bnp", "net/minecraft/client/renderer/entity/RenderXPOrb"));
+ mObInitMap.put(new Pair<String, String>("kk", "net/minecraft/dispenser/BehaviorProjectileDispense"));
+ mObInitMap.put(
+ new Pair<String, String>("gl", "net/minecraft/network/play/server/S32PacketConfirmTransaction"));
+ mObInitMap.put(new Pair<String, String>("cm", "net/minecraft/dispenser/BehaviorDefaultDispenseItem"));
+ mObInitMap.put(new Pair<String, String>("zr", "net/minecraft/util/FoodStats"));
+ mObInitMap.put(new Pair<String, String>("vs", "net/minecraft/entity/ai/EntityAIOwnerHurtByTarget"));
+ mObInitMap.put(new Pair<String, String>("ark", "net/minecraft/world/gen/feature/WorldGenDeadBush"));
+ mObInitMap.put(new Pair<String, String>("anl", "net/minecraft/block/BlockSkull"));
+ mObInitMap.put(new Pair<String, String>("ajm", "net/minecraft/block/Block$SoundType"));
+ mObInitMap.put(new Pair<String, String>("avj", "net/minecraft/world/gen/structure/MapGenStructureData"));
+ mObInitMap.put(new Pair<String, String>("bgf", "net/minecraft/client/gui/GuiScreenResourcePacks"));
+ mObInitMap.put(new Pair<String, String>("bke", "net/minecraft/client/particle/EntityFireworkStarterFX"));
+ mObInitMap.put(new Pair<String, String>("wg", "net/minecraft/entity/passive/EntityChicken"));
+ mObInitMap.put(new Pair<String, String>("sh", "net/minecraft/entity/EntityList$EntityEggInfo"));
+ mObInitMap.put(
+ new Pair<String, String>("oi", "net/minecraft/server/management/ServerConfigurationManager"));
+ mObInitMap.put(new Pair<String, String>("kj", "net/minecraft/network/status/client/C00PacketServerQuery"));
+ mObInitMap.put(new Pair<String, String>("aka", "net/minecraft/block/BlockColored"));
+ mObInitMap.put(new Pair<String, String>("acc", "net/minecraft/creativetab/CreativeTabs$6"));
+ mObInitMap.put(
+ new Pair<String, String>("agb", "net/minecraft/enchantment/EnchantmentHelper$ModifierDamage"));
+ mObInitMap.put(new Pair<String, String>(
+ "bsb", "net/minecraft/client/resources/data/AnimationMetadataSectionSerializer"));
+ mObInitMap.put(new Pair<String, String>("bkd", "net/minecraft/client/particle/EntityFireworkSparkFX"));
+ mObInitMap.put(new Pair<String, String>("boc", "net/minecraft/client/renderer/entity/RenderItem$4"));
+ mObInitMap.put(new Pair<String, String>("wz", "net/minecraft/entity/item/EntityEnderCrystal"));
+ mObInitMap.put(new Pair<String, String>("asr", "net/minecraft/world/gen/feature/WorldGenVines"));
+ mObInitMap.put(new Pair<String, String>("aos", "net/minecraft/tileentity/TileEntity$1"));
+ mObInitMap.put(new Pair<String, String>("akt", "net/minecraft/block/BlockEndPortal"));
+ mObInitMap.put(new Pair<String, String>("acv", "net/minecraft/item/ItemFishingRod"));
+ mObInitMap.put(new Pair<String, String>("agu", "net/minecraft/world/ChunkCoordIntPair"));
+ mObInitMap.put(new Pair<String, String>("awq", "net/minecraft/block/material/MaterialLogic"));
+ mObInitMap.put(new Pair<String, String>("bsu", "net/minecraft/client/audio/ISound$AttenuationType"));
+ mObInitMap.put(new Pair<String, String>("bov", "net/minecraft/client/renderer/entity/RenderSpider"));
+ mObInitMap.put(new Pair<String, String>("bcy", "net/minecraft/client/multiplayer/GuiConnecting$1"));
+ mObInitMap.put(new Pair<String, String>("bkw", "net/minecraft/client/particle/EntitySnowShovelFX"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RealmsAnvilLevelStorageSource",
+ "net/minecraft/realms/RealmsAnvilLevelStorageSource"));
+ mObInitMap.put(new Pair<String, String>("to", "net/minecraft/entity/ai/attributes/RangedAttribute"));
+ mObInitMap.put(new Pair<String, String>("pp", "net/minecraft/stats/StatList"));
+ mObInitMap.put(new Pair<String, String>("lq", "net/minecraft/server/dedicated/PropertyManager"));
+ mObInitMap.put(
+ new Pair<String, String>("hr", "net/minecraft/network/play/server/S1EPacketRemoveEntityEffect"));
+ mObInitMap.put(new Pair<String, String>("ds", "net/minecraft/nbt/NBTSizeTracker"));
+ mObInitMap.put(new Pair<String, String>("alh", "net/minecraft/block/BlockGrass"));
+ mObInitMap.put(new Pair<String, String>("adj", "net/minecraft/item/ItemMinecart"));
+ mObInitMap.put(new Pair<String, String>("bti", "net/minecraft/client/audio/SoundPoolEntry"));
+ mObInitMap.put(new Pair<String, String>("bpj", "net/minecraft/client/shader/ShaderGroup"));
+ mObInitMap.put(new Pair<String, String>("awp", "net/minecraft/world/gen/NoiseGenerator"));
+ mObInitMap.put(new Pair<String, String>("bdm", "net/minecraft/client/gui/GuiOptions"));
+ mObInitMap.put(new Pair<String, String>("bhl", "net/minecraft/client/model/ModelGhast"));
+ mObInitMap.put(new Pair<String, String>("blk", "net/minecraft/client/entity/EntityPlayerSP"));
+ mObInitMap.put(new Pair<String, String>("me", "net/minecraft/server/gui/PlayerListComponent"));
+ mObInitMap.put(new Pair<String, String>("eg", "net/minecraft/network/NettyEncryptionTranslator"));
+ mObInitMap.put(new Pair<String, String>("ah", "net/minecraft/command/server/CommandBroadcast"));
+ mObInitMap.put(new Pair<String, String>("xm", "net/minecraft/entity/item/EntityMinecartChest"));
+ mObInitMap.put(
+ new Pair<String, String>("net/minecraft/realms/Tezzelator", "net/minecraft/realms/Tezzelator"));
+ mObInitMap.put(
+ new Pair<String, String>("ate", "net/minecraft/world/gen/structure/MapGenNetherBridge$Start"));
+ mObInitMap.put(new Pair<String, String>("apf", "net/minecraft/tileentity/TileEntityFlowerPot"));
+ mObInitMap.put(new Pair<String, String>("alg", "net/minecraft/block/BlockGlowstone"));
+ mObInitMap.put(new Pair<String, String>("axd", "net/minecraft/world/gen/layer/GenLayerAddSnow"));
+ mObInitMap.put(new Pair<String, String>("bea", "net/minecraft/client/gui/GuiSnooper"));
+ mObInitMap.put(new Pair<String, String>("ya", "net/minecraft/entity/monster/EntityEnderman"));
+ mObInitMap.put(new Pair<String, String>("ub", "net/minecraft/entity/ai/EntityAIControlledByPlayer"));
+ mObInitMap.put(new Pair<String, String>("qc", "net/minecraft/util/ThreadSafeBoundList"));
+ mObInitMap.put(new Pair<String, String>("md", "net/minecraft/server/gui/MinecraftServerGui$5"));
+ mObInitMap.put(new Pair<String, String>("r", "net/minecraft/util/ChunkCoordinates"));
+ mObInitMap.put(new Pair<String, String>("atx", "net/minecraft/world/gen/structure/MapGenScatteredFeature"));
+ mObInitMap.put(new Pair<String, String>("apy", "net/minecraft/world/chunk/Chunk$1"));
+ mObInitMap.put(new Pair<String, String>("alz", "net/minecraft/block/BlockCompressed"));
+ mObInitMap.put(new Pair<String, String>("axw", "net/minecraft/world/gen/layer/GenLayerShore"));
+ mObInitMap.put(new Pair<String, String>("bau", "net/minecraft/client/Minecraft$14"));
+ mObInitMap.put(new Pair<String, String>("yt", "net/minecraft/entity/NpcMerchant"));
+ mObInitMap.put(new Pair<String, String>("uu", "net/minecraft/entity/ai/EntityAIMoveTowardsTarget"));
+ mObInitMap.put(new Pair<String, String>("qv", "net/minecraft/util/WeightedRandom"));
+ mObInitMap.put(new Pair<String, String>("mw", "net/minecraft/entity/player/EntityPlayerMP"));
+ mObInitMap.put(new Pair<String, String>("ix", "net/minecraft/network/play/client/C0EPacketClickWindow"));
+ mObInitMap.put(new Pair<String, String>("ey", "net/minecraft/network/NetworkStatistics$PacketStatData"));
+ mObInitMap.put(new Pair<String, String>("az", "net/minecraft/command/server/CommandMessage"));
+ mObInitMap.put(new Pair<String, String>("amn", "net/minecraft/block/BlockOre"));
+ mObInitMap.put(new Pair<String, String>("aaq", "net/minecraft/inventory/ContainerPlayer$1"));
+ mObInitMap.put(new Pair<String, String>("aio", "net/minecraft/world/biome/BiomeGenOcean"));
+ mObInitMap.put(new Pair<String, String>(
+ "aul", "net/minecraft/world/gen/structure/StructureStrongholdPieces$SwitchDoor"));
+ mObInitMap.put(new Pair<String, String>("buo", "net/minecraft/client/stream/TwitchStream"));
+ mObInitMap.put(new Pair<String, String>("bqp", "net/minecraft/client/resources/DefaultResourcePack"));
+ mObInitMap.put(new Pair<String, String>("bat", "net/minecraft/client/Minecraft$13"));
+ mObInitMap.put(new Pair<String, String>("bes", "net/minecraft/client/gui/GuiKeyBindingList"));
+ mObInitMap.put(new Pair<String, String>("bir", "net/minecraft/client/model/ModelEnderCrystal"));
+ mObInitMap.put(new Pair<String, String>(
+ "bmq", "net/minecraft/client/renderer/tileentity/TileEntityRendererPiston"));
+ mObInitMap.put(new Pair<String, String>("vi", "net/minecraft/entity/ai/EntityAICreeperSwell"));
+ mObInitMap.put(new Pair<String, String>("rj", "net/minecraft/profiler/PlayerUsageSnooper$1"));
+ mObInitMap.put(
+ new Pair<String, String>("nk", "net/minecraft/network/NetHandlerPlayServer$SwitchEnumState"));
+ mObInitMap.put(new Pair<String, String>("jl", "net/minecraft/network/play/client/C09PacketHeldItemChange"));
+ mObInitMap.put(new Pair<String, String>("fm", "net/minecraft/event/HoverEvent$Action"));
+ mObInitMap.put(new Pair<String, String>("bn", "net/minecraft/command/server/CommandSetDefaultSpawnpoint"));
+ mObInitMap.put(new Pair<String, String>("abe", "net/minecraft/item/ItemBlockWithMetadata"));
+ mObInitMap.put(new Pair<String, String>("afd", "net/minecraft/item/crafting/RecipesIngots"));
+ mObInitMap.put(new Pair<String, String>("ajc", "net/minecraft/block/BlockContainer"));
+ mObInitMap.put(new Pair<String, String>("brd", "net/minecraft/client/resources/ResourcePackRepository$1"));
+ mObInitMap.put(
+ new Pair<String, String>("auk", "net/minecraft/world/gen/structure/StructureStrongholdPieces$2"));
+ mObInitMap.put(new Pair<String, String>("ayj", "net/minecraft/world/storage/MapData$MapInfo"));
+ mObInitMap.put(new Pair<String, String>("bbh", "net/minecraft/client/renderer/OpenGlCapsChecker"));
+ mObInitMap.put(new Pair<String, String>("bfg", "net/minecraft/client/gui/inventory/GuiBrewingStand"));
+ mObInitMap.put(new Pair<String, String>("bjf", "net/minecraft/client/multiplayer/WorldClient"));
+ mObInitMap.put(new Pair<String, String>("bne", "net/minecraft/client/renderer/entity/RenderBoat"));
+ mObInitMap.put(new Pair<String, String>("ga", "net/minecraft/network/play/server/S10PacketSpawnPainting"));
+ mObInitMap.put(new Pair<String, String>("cb", "net/minecraft/command/CommandWeather"));
+ mObInitMap.put(new Pair<String, String>("zg", "net/minecraft/entity/projectile/EntityLargeFireball"));
+ mObInitMap.put(new Pair<String, String>("vh", "net/minecraft/entity/ai/EntityAISit"));
+ mObInitMap.put(new Pair<String, String>("abx", "net/minecraft/creativetab/CreativeTabs$12"));
+ mObInitMap.put(new Pair<String, String>("ana", "net/minecraft/block/BlockRedstoneWire"));
+ mObInitMap.put(new Pair<String, String>("bfz", "net/minecraft/client/gui/GuiMultiplayer"));
+ mObInitMap.put(new Pair<String, String>("bjy", "net/minecraft/client/particle/EntityDropParticleFX"));
+ mObInitMap.put(new Pair<String, String>("zz", "net/minecraft/inventory/ContainerBrewingStand"));
+ mObInitMap.put(new Pair<String, String>("ars", "net/minecraft/world/gen/feature/WorldGenHellLava"));
+ mObInitMap.put(new Pair<String, String>("ant", "net/minecraft/block/BlockStaticLiquid"));
+ mObInitMap.put(new Pair<String, String>("abw", "net/minecraft/creativetab/CreativeTabs$11"));
+ mObInitMap.put(new Pair<String, String>("afv", "net/minecraft/enchantment/EnchantmentHelper"));
+ mObInitMap.put(new Pair<String, String>("aju", "net/minecraft/block/BlockCake"));
+ mObInitMap.put(
+ new Pair<String, String>("avr", "net/minecraft/world/gen/structure/StructureVillagePieces$Field1"));
+ mObInitMap.put(new Pair<String, String>("azq", "net/minecraft/world/storage/MapStorage"));
+ mObInitMap.put(new Pair<String, String>("bco", "net/minecraft/client/gui/GuiStreamIndicator"));
+ mObInitMap.put(
+ new Pair<String, String>("brv", "net/minecraft/client/resources/data/IMetadataSectionSerializer"));
+ mObInitMap.put(new Pair<String, String>("bnw", "net/minecraft/client/renderer/entity/RenderBiped"));
+ mObInitMap.put(new Pair<String, String>("wo", "net/minecraft/entity/passive/EntityPig"));
+ mObInitMap.put(new Pair<String, String>("sp", "net/minecraft/command/IEntitySelector$ArmoredMob"));
+ mObInitMap.put(new Pair<String, String>("oq", "net/minecraft/server/management/UserListBansEntry"));
+ mObInitMap.put(new Pair<String, String>("kr", "net/minecraft/init/Bootstrap$14"));
+ mObInitMap.put(new Pair<String, String>("gs", "net/minecraft/network/play/server/S40PacketDisconnect"));
+ mObInitMap.put(new Pair<String, String>("ct", "net/minecraft/util/ObjectIntIdentityMap"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RealmsEditBox", "net/minecraft/realms/RealmsEditBox"));
+ mObInitMap.put(new Pair<String, String>("asg", "net/minecraft/world/gen/feature/WorldGenPumpkin"));
+ mObInitMap.put(new Pair<String, String>("aoh", "net/minecraft/block/BlockVine"));
+ mObInitMap.put(new Pair<String, String>("aki", "net/minecraft/block/BlockRailDetector"));
+ mObInitMap.put(new Pair<String, String>("ack", "net/minecraft/item/ItemEgg"));
+ mObInitMap.put(new Pair<String, String>("agj", "net/minecraft/enchantment/EnchantmentThorns"));
+ mObInitMap.put(
+ new Pair<String, String>("awf", "net/minecraft/world/gen/structure/StructureVillagePieces$Well"));
+ mObInitMap.put(new Pair<String, String>(
+ "bsj", "net/minecraft/client/resources/data/TextureMetadataSectionSerializer"));
+ mObInitMap.put(new Pair<String, String>("bok", "net/minecraft/client/renderer/entity/RenderLiving"));
+ mObInitMap.put(new Pair<String, String>("bcn", "net/minecraft/client/gui/GuiOptionSlider"));
+ mObInitMap.put(new Pair<String, String>("bgm", "net/minecraft/client/gui/stream/GuiIngestServers"));
+ mObInitMap.put(new Pair<String, String>("bkl", "net/minecraft/client/particle/EntityNoteFX"));
+ mObInitMap.put(new Pair<String, String>("xc", "net/minecraft/entity/boss/EntityWither"));
+ mObInitMap.put(new Pair<String, String>("td", "net/minecraft/entity/EntityCreature"));
+ mObInitMap.put(new Pair<String, String>("pe", "net/minecraft/stats/StatBasic"));
+ mObInitMap.put(new Pair<String, String>(
+ "hg", "net/minecraft/network/play/server/S14PacketEntity$S15PacketEntityRelMove"));
+ mObInitMap.put(new Pair<String, String>("dh", "net/minecraft/nbt/NBTTagCompound"));
+ mObInitMap.put(
+ new Pair<String, String>("awe", "net/minecraft/world/gen/structure/StructureVillagePieces$Road"));
+ mObInitMap.put(new Pair<String, String>("bdb", "net/minecraft/client/gui/GuiCreateWorld"));
+ mObInitMap.put(new Pair<String, String>("ly", "net/minecraft/server/gui/MinecraftServerGui"));
+ mObInitMap.put(
+ new Pair<String, String>("hz", "net/minecraft/network/play/server/S04PacketEntityEquipment"));
+ mObInitMap.put(new Pair<String, String>(
+ "asy", "net/minecraft/world/gen/structure/StructureMineshaftPieces$Corridor"));
+ mObInitMap.put(new Pair<String, String>("aoz", "net/minecraft/tileentity/TileEntityComparator"));
+ mObInitMap.put(new Pair<String, String>("awx", "net/minecraft/world/gen/layer/GenLayerDeepOcean"));
+ mObInitMap.put(new Pair<String, String>("bdu", "net/minecraft/client/gui/GuiDownloadTerrain"));
+ mObInitMap.put(new Pair<String, String>("bht", "net/minecraft/client/model/ModelOcelot"));
+ mObInitMap.put(new Pair<String, String>(
+ "bls", "net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper"));
+ mObInitMap.put(new Pair<String, String>("ap", "net/minecraft/command/CommandXP"));
+ mObInitMap.put(new Pair<String, String>("xu", "net/minecraft/entity/ai/EntityMinecartMobSpawner$1"));
+ mObInitMap.put(new Pair<String, String>("tv", "net/minecraft/entity/ai/EntityMoveHelper"));
+ mObInitMap.put(new Pair<String, String>("pw", "net/minecraft/util/HttpUtil$1"));
+ mObInitMap.put(new Pair<String, String>("lx", "net/minecraft/server/dedicated/DedicatedServer$4"));
+ mObInitMap.put(new Pair<String, String>("g", "net/minecraft/crash/CrashReport$5"));
+ mObInitMap.put(new Pair<String, String>(
+ "atm", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing2"));
+ mObInitMap.put(new Pair<String, String>("apn", "net/minecraft/tileentity/TileEntitySkull"));
+ mObInitMap.put(new Pair<String, String>("alo", "net/minecraft/block/BlockHugeMushroom"));
+ mObInitMap.put(new Pair<String, String>("adq", "net/minecraft/item/EnumRarity"));
+ mObInitMap.put(new Pair<String, String>("ahp", "net/minecraft/world/Teleporter"));
+ mObInitMap.put(new Pair<String, String>("axl", "net/minecraft/world/gen/layer/IntCache"));
+ mObInitMap.put(new Pair<String, String>("baj", "net/minecraft/client/renderer/ActiveRenderInfo"));
+ mObInitMap.put(new Pair<String, String>("btp", "net/minecraft/client/audio/SoundHandler"));
+ mObInitMap.put(new Pair<String, String>("bpq", "net/minecraft/client/renderer/texture/DynamicTexture"));
+ mObInitMap.put(new Pair<String, String>("blr", "net/minecraft/client/util/RenderDistanceSorter"));
+ mObInitMap.put(new Pair<String, String>("yi", "net/minecraft/entity/IRangedAttackMob"));
+ mObInitMap.put(new Pair<String, String>("uj", "net/minecraft/entity/ai/EntityAITasks"));
+ mObInitMap.put(new Pair<String, String>("qk", "net/minecraft/util/IProgressUpdate"));
+ mObInitMap.put(new Pair<String, String>("ml", "net/minecraft/world/demo/DemoWorldManager"));
+ mObInitMap.put(new Pair<String, String>(
+ "im", "net/minecraft/network/play/server/S20PacketEntityProperties$Snapshot"));
+ mObInitMap.put(new Pair<String, String>(
+ "en", "net/minecraft/network/NetworkManager$InboundHandlerTuplePacketListener"));
+ mObInitMap.put(new Pair<String, String>("ao", "net/minecraft/command/CommandEnchant"));
+ mObInitMap.put(new Pair<String, String>("amc", "net/minecraft/block/BlockMushroom"));
+ mObInitMap.put(new Pair<String, String>("aee", "net/minecraft/item/ItemMonsterPlacer"));
+ mObInitMap.put(new Pair<String, String>("aaf", "net/minecraft/inventory/ContainerWorkbench"));
+ mObInitMap.put(new Pair<String, String>("aid", "net/minecraft/world/biome/BiomeGenHills"));
+ mObInitMap.put(new Pair<String, String>(
+ "aua", "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "bud", "net/minecraft/client/stream/BroadcastController$BroadcastListener"));
+ mObInitMap.put(
+ new Pair<String, String>("bqe", "net/minecraft/client/renderer/texture/TextureAtlasSprite$1"));
+ mObInitMap.put(new Pair<String, String>("beh", "net/minecraft/client/gui/achievement/GuiAchievement"));
+ mObInitMap.put(new Pair<String, String>("big", "net/minecraft/client/model/ModelSpider"));
+ mObInitMap.put(new Pair<String, String>("ja", "net/minecraft/network/play/client/C02PacketUseEntity"));
+ mObInitMap.put(new Pair<String, String>("fb", "net/minecraft/network/INetHandler"));
+ mObInitMap.put(new Pair<String, String>("bc", "net/minecraft/command/server/CommandOp"));
+ mObInitMap.put(new Pair<String, String>("amv", "net/minecraft/block/BlockPressurePlate$Sensitivity"));
+ mObInitMap.put(new Pair<String, String>("aex", "net/minecraft/item/crafting/RecipesDyes"));
+ mObInitMap.put(new Pair<String, String>("aay", "net/minecraft/inventory/Slot"));
+ mObInitMap.put(new Pair<String, String>("aiw", "net/minecraft/world/biome/BiomeGenTaiga"));
+ mObInitMap.put(new Pair<String, String>("y", "net/minecraft/command/CommandBase"));
+ mObInitMap.put(new Pair<String, String>("bqx", "net/minecraft/util/ResourceLocation"));
+ mObInitMap.put(new Pair<String, String>("biz", "net/minecraft/client/network/NetHandlerLoginClient"));
+ mObInitMap.put(new Pair<String, String>("bmy", "net/minecraft/client/renderer/culling/ClippingHelper"));
+ mObInitMap.put(
+ new Pair<String, String>("jt", "net/minecraft/network/login/server/S01PacketEncryptionRequest"));
+ mObInitMap.put(new Pair<String, String>("fu", "net/minecraft/network/play/server/S08PacketPlayerPosLook"));
+ mObInitMap.put(new Pair<String, String>("bv", "net/minecraft/command/server/CommandTeleport"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/realms/RealmsConnect", "net/minecraft/realms/RealmsConnect"));
+ mObInitMap.put(new Pair<String, String>("abm", "net/minecraft/item/ItemBow"));
+ mObInitMap.put(new Pair<String, String>("amu", "net/minecraft/block/BlockPressurePlate"));
+ mObInitMap.put(new Pair<String, String>(
+ "aus", "net/minecraft/world/gen/structure/StructureStrongholdPieces$PortalRoom"));
+ mObInitMap.put(new Pair<String, String>("ayr", "net/minecraft/world/storage/SaveFormatOld"));
+ mObInitMap.put(new Pair<String, String>("bbp", "net/minecraft/util/ScreenShotHelper"));
+ mObInitMap.put(new Pair<String, String>("bfo", "net/minecraft/client/renderer/InventoryEffectRenderer"));
+ mObInitMap.put(new Pair<String, String>("bjn", "net/minecraft/client/multiplayer/ServerData"));
+ mObInitMap.put(new Pair<String, String>("bnm", "net/minecraft/client/renderer/entity/RenderEnderman"));
+ mObInitMap.put(new Pair<String, String>("zo", "net/minecraft/entity/projectile/EntityPotion"));
+ mObInitMap.put(new Pair<String, String>("vp", "net/minecraft/entity/ai/EntityAINearestAttackableTarget$1"));
+ mObInitMap.put(new Pair<String, String>("rq", "net/minecraft/util/EntityDamageSourceIndirect"));
+ mObInitMap.put(new Pair<String, String>("nr", "net/minecraft/server/management/BanEntry"));
+ mObInitMap.put(new Pair<String, String>("arh", "net/minecraft/world/gen/feature/WorldGenCactus"));
+ mObInitMap.put(new Pair<String, String>("ani", "net/minecraft/block/BlockSandStone"));
+ mObInitMap.put(new Pair<String, String>("abl", "net/minecraft/item/ItemGlassBottle"));
+ mObInitMap.put(new Pair<String, String>("afk", "net/minecraft/item/crafting/RecipesTools"));
+ mObInitMap.put(new Pair<String, String>("ajj", "net/minecraft/block/Block$1"));
+ mObInitMap.put(new Pair<String, String>("avg", "net/minecraft/world/gen/structure/MapGenStructure$2"));
+ mObInitMap.put(new Pair<String, String>("azf", "net/minecraft/world/storage/SaveFormatComparator"));
+ mObInitMap.put(new Pair<String, String>("bcd", "net/minecraft/client/gui/GuiTextField"));
+ mObInitMap.put(new Pair<String, String>("brk", "net/minecraft/client/resources/SkinManager$1"));
+ mObInitMap.put(new Pair<String, String>("bnl", "net/minecraft/client/renderer/entity/RenderDragon"));
+ mObInitMap.put(new Pair<String, String>("wd", "net/minecraft/entity/passive/EntityAmbientCreature"));
+ mObInitMap.put(new Pair<String, String>("se", "net/minecraft/entity/Entity$EnumEntitySize"));
+ mObInitMap.put(new Pair<String, String>("of", "net/minecraft/server/management/PreYggdrasilConverter$6"));
+ mObInitMap.put(new Pair<String, String>(
+ "kg", "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier$Serializer"));
+ mObInitMap.put(new Pair<String, String>("gh", "net/minecraft/network/play/server/S23PacketBlockChange"));
+ mObInitMap.put(new Pair<String, String>("ci", "net/minecraft/command/WrongUsageException"));
+ mObInitMap.put(
+ new Pair<String, String>("avz", "net/minecraft/world/gen/structure/StructureVillagePieces$House2"));
+ mObInitMap.put(
+ new Pair<String, String>("net/minecraft/realms/RealmsButton", "net/minecraft/realms/RealmsButton"));
+ mObInitMap.put(new Pair<String, String>("bcc", "net/minecraft/client/gui/GuiNewChat"));
+ mObInitMap.put(new Pair<String, String>("bgb", "net/minecraft/client/gui/ServerListEntryLanDetected"));
+ mObInitMap.put(new Pair<String, String>("bka", "net/minecraft/client/particle/EntityExplodeFX"));
+ mObInitMap.put(new Pair<String, String>("ww", "net/minecraft/entity/boss/IBossDisplayData"));
+ mObInitMap.put(new Pair<String, String>("sx", "net/minecraft/entity/EnumCreatureType"));
+ mObInitMap.put(new Pair<String, String>("oy", "net/minecraft/network/rcon/RConThreadQuery$Auth"));
+ mObInitMap.put(new Pair<String, String>("kz", "net/minecraft/init/Bootstrap$8"));
+ mObInitMap.put(new Pair<String, String>("akq", "net/minecraft/block/BlockDropper"));
+ mObInitMap.put(new Pair<String, String>("acs", "net/minecraft/item/ItemFirework"));
+ mObInitMap.put(new Pair<String, String>(
+ "agr", "net/minecraft/tileentity/MobSpawnerBaseLogic$WeightedRandomMinecart"));
+ mObInitMap.put(new Pair<String, String>("bsr", "net/minecraft/client/audio/SoundList$SoundEntry$Type"));
+ mObInitMap.put(new Pair<String, String>("bos", "net/minecraft/client/renderer/entity/RenderSkeleton"));
+ mObInitMap.put(
+ new Pair<String, String>("avy", "net/minecraft/world/gen/structure/StructureVillagePieces$Church"));
+ mObInitMap.put(new Pair<String, String>("azx", "net/minecraft/scoreboard/ScoreObjective"));
+ mObInitMap.put(new Pair<String, String>("bcv", "net/minecraft/client/gui/GuiYesNoCallback"));
+ mObInitMap.put(new Pair<String, String>("bgu", "net/minecraft/client/main/Main$1$1"));
+ mObInitMap.put(new Pair<String, String>("bkt", "net/minecraft/client/particle/EntityPortalFX"));
+ mObInitMap.put(new Pair<String, String>("ln", "net/minecraft/server/management/PlayerPositionComparator"));
+ mObInitMap.put(new Pair<String, String>("ho", "net/minecraft/network/play/server/S38PacketPlayerListItem"));
+ mObInitMap.put(new Pair<String, String>("dp", "net/minecraft/nbt/NBTTagInt"));
+ mObInitMap.put(new Pair<String, String>("wv", "net/minecraft/entity/passive/EntityWolf"));
+ mObInitMap.put(new Pair<String, String>("asn", "net/minecraft/world/gen/feature/WorldGenTaiga2"));
+ mObInitMap.put(new Pair<String, String>("aoo", "net/minecraft/block/BlockWoodSlab"));
+ mObInitMap.put(new Pair<String, String>("bdj", "net/minecraft/client/gui/GuiLanguage"));
+ mObInitMap.put(new Pair<String, String>("bhi", "net/minecraft/client/model/ModelCow"));
+ mObInitMap.put(
+ new Pair<String, String>("blh", "net/minecraft/client/entity/AbstractClientPlayer$SwitchType"));
+ mObInitMap.put(new Pair<String, String>("ae", "net/minecraft/command/server/CommandAchievement"));
+ mObInitMap.put(new Pair<String, String>("xj", "net/minecraft/entity/item/EntityFallingBlock"));
+ mObInitMap.put(new Pair<String, String>("tk", "net/minecraft/entity/ai/attributes/BaseAttribute"));
+ mObInitMap.put(new Pair<String, String>("pl", "net/minecraft/stats/StatBase$4"));
+ mObInitMap.put(new Pair<String, String>("lm", "net/minecraft/server/MinecraftServer$6"));
+ mObInitMap.put(new Pair<String, String>(
+ "atb", "net/minecraft/world/gen/structure/StructureMineshaftPieces$Stairs"));
+ mObInitMap.put(new Pair<String, String>("apc", "net/minecraft/tileentity/TileEntityDropper"));
+ mObInitMap.put(new Pair<String, String>("ald", "net/minecraft/block/BlockFlowerPot"));
+ mObInitMap.put(new Pair<String, String>("adf", "net/minecraft/item/ItemLead"));
+ mObInitMap.put(new Pair<String, String>("ahe", "net/minecraft/world/World$3"));
+ mObInitMap.put(new Pair<String, String>("axa", "net/minecraft/world/gen/layer/GenLayerEdge$Mode"));
+ mObInitMap.put(new Pair<String, String>("bte", "net/minecraft/client/multiplayer/ThreadLanServerPing"));
+ mObInitMap.put(new Pair<String, String>("bpf", "net/minecraft/client/renderer/entity/RenderZombie"));
+ mObInitMap.put(new Pair<String, String>("ma", "net/minecraft/server/gui/MinecraftServerGui$2"));
+ mObInitMap.put(new Pair<String, String>("ib", "net/minecraft/network/play/server/S06PacketUpdateHealth"));
+ mObInitMap.put(new Pair<String, String>("ec", "net/minecraft/nbt/JsonToNBT$Any"));
+ mObInitMap.put(new Pair<String, String>("ad", "net/minecraft/command/PlayerSelector"));
+ mObInitMap.put(new Pair<String, String>(
+ "atu", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing"));
+ mObInitMap.put(new Pair<String, String>("apv", "net/minecraft/world/chunk/NibbleArray"));
+ mObInitMap.put(new Pair<String, String>("alw", "net/minecraft/block/BlockLiquid"));
+ mObInitMap.put(new Pair<String, String>("ady", "net/minecraft/item/ItemSpade"));
+ mObInitMap.put(new Pair<String, String>("ahx", "net/minecraft/world/biome/BiomeGenBase$SpawnListEntry"));
+ mObInitMap.put(new Pair<String, String>("axt", "net/minecraft/world/gen/layer/GenLayerRiverInit"));
+ mObInitMap.put(new Pair<String, String>("bpy", "net/minecraft/client/renderer/StitcherException"));
+ mObInitMap.put(new Pair<String, String>("ur", "net/minecraft/entity/ai/EntityAIMoveIndoors"));
+ mObInitMap.put(new Pair<String, String>("mt", "net/minecraft/world/WorldServer"));
+ mObInitMap.put(new Pair<String, String>("iu", "net/minecraft/network/play/client/C15PacketClientSettings"));
+ mObInitMap.put(new Pair<String, String>("ev", "net/minecraft/network/NetworkStatistics$1"));
+ mObInitMap.put(new Pair<String, String>("aw", "net/minecraft/command/CommandKill"));
+ mObInitMap.put(new Pair<String, String>("amk", "net/minecraft/block/BlockObsidian"));
+ mObInitMap.put(new Pair<String, String>("aem", "net/minecraft/item/ItemEditableBook"));
+ mObInitMap.put(new Pair<String, String>("aan", "net/minecraft/inventory/ContainerHorseInventory$1"));
+ mObInitMap.put(new Pair<String, String>("ail", "net/minecraft/world/biome/BiomeGenMesa"));
+ mObInitMap.put(new Pair<String, String>("n", "net/minecraft/crash/CrashReportCategory$3"));
+ mObInitMap.put(
+ new Pair<String, String>("bul", "net/minecraft/client/stream/IngestServerTester$IngestTestState"));
+ mObInitMap.put(new Pair<String, String>("bqm", "net/minecraft/client/renderer/texture/TextureCompass"));
+ mObInitMap.put(new Pair<String, String>("axs", "net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean"));
+ mObInitMap.put(new Pair<String, String>("baq", "net/minecraft/client/Minecraft$10"));
+ mObInitMap.put(
+ new Pair<String, String>("bep", "net/minecraft/client/gui/achievement/GuiStats$StatsMobsList"));
+ mObInitMap.put(new Pair<String, String>("bio", "net/minecraft/client/model/ModelWolf"));
+ mObInitMap.put(
+ new Pair<String, String>("bmn", "net/minecraft/client/renderer/entity/RenderEnchantmentTable"));
+ mObInitMap.put(new Pair<String, String>("nh", "net/minecraft/network/NetHandlerPlayServer"));
+ mObInitMap.put(new Pair<String, String>("ji", "net/minecraft/network/play/client/C07PacketPlayerDigging"));
+ mObInitMap.put(new Pair<String, String>("fj", "net/minecraft/util/IChatComponent"));
+ mObInitMap.put(new Pair<String, String>("bk", "net/minecraft/command/server/CommandScoreboard"));
+ mObInitMap.put(new Pair<String, String>("yp", "net/minecraft/entity/monster/EntityWitch"));
+ mObInitMap.put(new Pair<String, String>("abb", "net/minecraft/item/ItemArmor"));
+ mObInitMap.put(new Pair<String, String>("aqi", "net/minecraft/world/chunk/storage/RegionFile$ChunkBuffer"));
+ mObInitMap.put(new Pair<String, String>("amj", "net/minecraft/block/BlockNote"));
+ mObInitMap.put(new Pair<String, String>("auh", "net/minecraft/world/gen/structure/MapGenStronghold$Start"));
+ mObInitMap.put(new Pair<String, String>("ayg", "net/minecraft/pathfinding/PathFinder"));
+ mObInitMap.put(new Pair<String, String>("bbe", "net/minecraft/client/Minecraft$8"));
+ mObInitMap.put(new Pair<String, String>("bfd", "net/minecraft/client/gui/inventory/GuiBeacon$Button"));
+ mObInitMap.put(new Pair<String, String>("bjc", "net/minecraft/client/network/NetHandlerPlayClient$1"));
+ mObInitMap.put(new Pair<String, String>("bnb", "net/minecraft/client/renderer/entity/RenderArrow"));
+ mObInitMap.put(new Pair<String, String>("zd", "net/minecraft/entity/item/EntityEnderEye"));
+ mObInitMap.put(new Pair<String, String>("ve", "net/minecraft/entity/ai/EntityAIRestrictOpenDoor"));
+ mObInitMap.put(new Pair<String, String>("rf", "net/minecraft/util/IIcon"));
+ mObInitMap.put(new Pair<String, String>("ng", "net/minecraft/network/NetworkSystem$4"));
+ mObInitMap.put(new Pair<String, String>("aba", "net/minecraft/item/ItemAnvilBlock"));
+ mObInitMap.put(new Pair<String, String>("ayz", "net/minecraft/world/storage/WorldInfo$7"));
+ mObInitMap.put(new Pair<String, String>("bbx", "net/minecraft/client/gui/MapItemRenderer"));
+ mObInitMap.put(new Pair<String, String>("zw", "net/minecraft/inventory/ContainerRepair$2"));
+ mObInitMap.put(new Pair<String, String>("vx", "net/minecraft/entity/ai/RandomPositionGenerator"));
+ mObInitMap.put(new Pair<String, String>("ry", "net/minecraft/entity/passive/IAnimals"));
+ mObInitMap.put(new Pair<String, String>("nz", "net/minecraft/server/management/PreYggdrasilConverter"));
+ mObInitMap.put(new Pair<String, String>("arp", "net/minecraft/world/gen/feature/WorldGenShrub"));
+ mObInitMap.put(new Pair<String, String>("anq", "net/minecraft/block/BlockStainedGlass"));
+ mObInitMap.put(new Pair<String, String>("abt", "net/minecraft/creativetab/CreativeTabs"));
+ mObInitMap.put(new Pair<String, String>("afs", "net/minecraft/enchantment/EnchantmentDigging"));
+ mObInitMap.put(new Pair<String, String>("ajr", "net/minecraft/block/BlockBush"));
+ mObInitMap.put(new Pair<String, String>("avo", "net/minecraft/world/gen/structure/MapGenVillage$Start"));
+ mObInitMap.put(new Pair<String, String>("brs", "net/minecraft/client/resources/Locale"));
+ mObInitMap.put(new Pair<String, String>("bbw", "net/minecraft/client/gui/Gui"));
+ mObInitMap.put(new Pair<String, String>("bfv", "net/minecraft/client/gui/GuiMerchant"));
+ mObInitMap.put(new Pair<String, String>("bju", "net/minecraft/client/particle/EntityBreakingFX"));
+ mObInitMap.put(new Pair<String, String>("bnt", "net/minecraft/client/renderer/entity/RenderGhast"));
+ mObInitMap.put(new Pair<String, String>("wl", "net/minecraft/entity/monster/EntityGolem"));
+ mObInitMap.put(new Pair<String, String>("sm", "net/minecraft/command/IEntitySelector$3"));
+ mObInitMap.put(new Pair<String, String>("on", "net/minecraft/server/management/UserList$1"));
+ mObInitMap.put(new Pair<String, String>("ko", "net/minecraft/init/Bootstrap$11"));
+ mObInitMap.put(new Pair<String, String>("gp", "net/minecraft/network/play/server/S31PacketWindowProperty"));
+ mObInitMap.put(new Pair<String, String>("cq", "net/minecraft/dispenser/IBehaviorDispenseItem$1"));
+ mObInitMap.put(new Pair<String, String>("aoe", "net/minecraft/block/BlockTrapDoor"));
+ mObInitMap.put(new Pair<String, String>("akf", "net/minecraft/block/BlockCrops"));
+ mObInitMap.put(new Pair<String, String>("ach", "net/minecraft/item/ItemDoor"));
+ mObInitMap.put(new Pair<String, String>("agg", "net/minecraft/enchantment/EnchantmentLootBonus"));
+ mObInitMap.put(new Pair<String, String>("bsg", "net/minecraft/client/resources/data/PackMetadataSection"));
+ mObInitMap.put(new Pair<String, String>("bck", "net/minecraft/client/gui/GuiOptionsRowList"));
+ mObInitMap.put(new Pair<String, String>("bgj", "net/minecraft/client/gui/GuiResourcePackAvailable"));
+ mObInitMap.put(new Pair<String, String>("bki", "net/minecraft/client/particle/EntityLargeExplodeFX"));
+ mObInitMap.put(
+ new Pair<String, String>("boh", "net/minecraft/client/renderer/entity/RendererLivingEntity"));
+ mObInitMap.put(new Pair<String, String>("lc", "net/minecraft/client/util/JsonException$1"));
+ mObInitMap.put(new Pair<String, String>("hd", "net/minecraft/network/play/server/S01PacketJoinGame"));
+ mObInitMap.put(new Pair<String, String>("de", "net/minecraft/util/StringTranslate"));
+ mObInitMap.put(new Pair<String, String>("wk", "net/minecraft/entity/passive/EntityHorse$GroupData"));
+ mObInitMap.put(new Pair<String, String>("asc", "net/minecraft/world/gen/feature/WorldGenMelon"));
+ mObInitMap.put(new Pair<String, String>("aod", "net/minecraft/block/BlockLeavesBase"));
+ mObInitMap.put(
+ new Pair<String, String>("awb", "net/minecraft/world/gen/structure/StructureVillagePieces$Path"));
+ mObInitMap.put(new Pair<String, String>("pa", "net/minecraft/network/rcon/RConThreadMain"));
+ mObInitMap.put(new Pair<String, String>("asv", "net/minecraft/world/gen/structure/StructureBoundingBox"));
+ mObInitMap.put(new Pair<String, String>("aow", "net/minecraft/tileentity/TileEntityChest"));
+ mObInitMap.put(new Pair<String, String>("akx", "net/minecraft/block/BlockFalling"));
+ mObInitMap.put(new Pair<String, String>("acz", "net/minecraft/item/ItemHangingEntity"));
+ mObInitMap.put(new Pair<String, String>("agy", "net/minecraft/world/GameRules"));
+ mObInitMap.put(new Pair<String, String>("awu", "net/minecraft/block/material/Material$1"));
+ mObInitMap.put(new Pair<String, String>("bdr", "net/minecraft/client/gui/GuiFlatPresets$LayerItem"));
+ mObInitMap.put(new Pair<String, String>("bsy", "net/minecraft/server/integrated/IntegratedServer$1"));
+ mObInitMap.put(new Pair<String, String>("boz", "net/minecraft/client/renderer/entity/RenderIronGolem"));
+ mObInitMap.put(new Pair<String, String>("xr", "net/minecraft/entity/item/EntityMinecartHopper"));
+ mObInitMap.put(new Pair<String, String>("pt", "net/minecraft/util/CryptManager"));
+ mObInitMap.put(new Pair<String, String>("lu", "net/minecraft/server/dedicated/DedicatedServer$1"));
+ mObInitMap.put(
+ new Pair<String, String>("hv", "net/minecraft/network/play/server/S3DPacketDisplayScoreboard"));
+ mObInitMap.put(new Pair<String, String>("dw", "net/minecraft/nbt/NBTTagShort"));
+ mObInitMap.put(new Pair<String, String>(
+ "atj", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor3"));
+ mObInitMap.put(new Pair<String, String>("apk", "net/minecraft/tileentity/TileEntityMobSpawner$1"));
+ mObInitMap.put(new Pair<String, String>("all", "net/minecraft/block/BlockHardenedClay"));
+ mObInitMap.put(new Pair<String, String>("adn", "net/minecraft/item/ItemPickaxe"));
+ mObInitMap.put(new Pair<String, String>("ahm", "net/minecraft/world/WorldType"));
+ mObInitMap.put(new Pair<String, String>("btm", "net/minecraft/client/audio/SoundManager$2$1"));
+ mObInitMap.put(new Pair<String, String>("bpn", "net/minecraft/client/shader/ShaderLinkHelper"));
+ mObInitMap.put(new Pair<String, String>("bdq", "net/minecraft/client/gui/GuiFlatPresets"));
+ mObInitMap.put(new Pair<String, String>("bhp", "net/minecraft/client/model/ModelLeashKnot"));
+ mObInitMap.put(new Pair<String, String>("blo", "net/minecraft/client/renderer/WorldRenderer"));
+ mObInitMap.put(new Pair<String, String>("yf", "net/minecraft/entity/monster/EntityMagmaCube"));
+ mObInitMap.put(new Pair<String, String>("ug", "net/minecraft/entity/ai/EntityAIFollowOwner"));
+ mObInitMap.put(new Pair<String, String>("qh", "net/minecraft/util/MathHelper"));
+ mObInitMap.put(new Pair<String, String>("ij", "net/minecraft/network/play/server/S0DPacketCollectItem"));
+ mObInitMap.put(new Pair<String, String>("ek", "net/minecraft/network/NetworkManager$1"));
+ mObInitMap.put(new Pair<String, String>("al", "net/minecraft/command/CommandDefaultGameMode"));
+ mObInitMap.put(new Pair<String, String>("aeb", "net/minecraft/item/ItemSkull"));
+ mObInitMap.put(new Pair<String, String>("aac", "net/minecraft/inventory/ICrafting"));
+ mObInitMap.put(new Pair<String, String>("aia", "net/minecraft/world/biome/BiomeDecorator"));
+ mObInitMap.put(new Pair<String, String>("c", "net/minecraft/crash/CrashReport$1"));
+ mObInitMap.put(new Pair<String, String>("bua", "net/minecraft/client/stream/BroadcastController"));
+ mObInitMap.put(new Pair<String, String>("bqb", "net/minecraft/client/renderer/texture/TextureMap$2"));
+ mObInitMap.put(new Pair<String, String>("baf", "net/minecraft/scoreboard/ScoreDummyCriteria"));
+ mObInitMap.put(new Pair<String, String>("bee", "net/minecraft/client/gui/GuiMainMenu"));
+ mObInitMap.put(new Pair<String, String>("bmc", "net/minecraft/client/renderer/ImageBufferDownload"));
+ mObInitMap.put(new Pair<String, String>("ye", "net/minecraft/entity/monster/EntityGiantZombie"));
+ mObInitMap.put(new Pair<String, String>("aav", "net/minecraft/inventory/InventoryEnderChest"));
+ mObInitMap.put(new Pair<String, String>("v", "net/minecraft/util/Util$EnumOS"));
+ mObInitMap.put(new Pair<String, String>("bay", "net/minecraft/client/Minecraft$2"));
+ mObInitMap.put(new Pair<String, String>("bex", "net/minecraft/client/gui/inventory/GuiContainer"));
+ mObInitMap.put(new Pair<String, String>("bmv", "net/minecraft/client/renderer/culling/ICamera"));
+ mObInitMap.put(new Pair<String, String>("bs", "net/minecraft/command/CommandSpreadPlayers$Position"));
+ mObInitMap.put(new Pair<String, String>("yx", "net/minecraft/entity/player/InventoryPlayer"));
+ mObInitMap.put(new Pair<String, String>("uy", "net/minecraft/entity/ai/EntityAIOpenDoor"));
+ mObInitMap.put(new Pair<String, String>("aqq", "net/minecraft/world/WorldProviderSurface"));
+ mObInitMap.put(new Pair<String, String>("amr", "net/minecraft/block/BlockPotato"));
+ mObInitMap.put(new Pair<String, String>("ais", "net/minecraft/world/biome/BiomeGenSavanna"));
+ mObInitMap.put(new Pair<String, String>(
+ "aup", "net/minecraft/world/gen/structure/StructureStrongholdPieces$LeftTurn"));
+ mObInitMap.put(new Pair<String, String>("ayo", "net/minecraft/world/chunk/storage/AnvilSaveConverter$1"));
+ mObInitMap.put(new Pair<String, String>("bbm", "net/minecraft/client/settings/GameSettings$Options"));
+ mObInitMap.put(new Pair<String, String>("bus", "net/minecraft/realms/RealmsConnect$1"));
+ mObInitMap.put(
+ new Pair<String, String>("bqt", "net/minecraft/client/resources/FoliageColorReloadListener"));
+ mObInitMap.put(new Pair<String, String>("zl", "net/minecraft/entity/projectile/EntityEgg"));
+ mObInitMap.put(new Pair<String, String>("vm", "net/minecraft/entity/ai/EntityAIDefendVillage"));
+ mObInitMap.put(new Pair<String, String>("rn", "net/minecraft/util/CombatTracker"));
+ mObInitMap.put(new Pair<String, String>("no", "net/minecraft/server/network/NetHandlerLoginServer$1"));
+ mObInitMap.put(new Pair<String, String>("jp", "net/minecraft/network/handshake/client/C00Handshake"));
+ mObInitMap.put(new Pair<String, String>("fq", "net/minecraft/util/ChatComponentText"));
+ mObInitMap.put(new Pair<String, String>("br", "net/minecraft/command/CommandSpreadPlayers"));
+ mObInitMap.put(new Pair<String, String>("are", "net/minecraft/world/gen/feature/WorldGenForest"));
+ mObInitMap.put(new Pair<String, String>("anf", "net/minecraft/block/BlockRedstoneRepeater"));
+ mObInitMap.put(new Pair<String, String>("abi", "net/minecraft/item/ItemReed"));
+ mObInitMap.put(new Pair<String, String>("afh", "net/minecraft/item/crafting/ShapedRecipes"));
+ mObInitMap.put(new Pair<String, String>("ajg", "net/minecraft/block/BlockBeacon"));
+ mObInitMap.put(new Pair<String, String>(
+ "avd", "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold$Door"));
+ mObInitMap.put(new Pair<String, String>("azc", "net/minecraft/world/storage/ISaveHandler"));
+ mObInitMap.put(new Pair<String, String>(
+ "brh", "net/minecraft/client/resources/SimpleReloadableResourceManager$1"));
+ mObInitMap.put(new Pair<String, String>("bfk", "net/minecraft/client/gui/inventory/CreativeCrafting"));
+ mObInitMap.put(new Pair<String, String>("bjj", "net/minecraft/client/multiplayer/WorldClient$4"));
+ mObInitMap.put(new Pair<String, String>("bni", "net/minecraft/client/renderer/entity/RenderCreeper"));
+ mObInitMap.put(new Pair<String, String>("wa", "net/minecraft/village/Village$VillageAgressor"));
+ mObInitMap.put(new Pair<String, String>("sb", "net/minecraft/entity/Entity$1"));
+ mObInitMap.put(new Pair<String, String>("oc", "net/minecraft/server/management/PreYggdrasilConverter$3"));
+ mObInitMap.put(new Pair<String, String>(
+ "kd", "net/minecraft/network/ServerStatusResponse$PlayerCountData$Serializer"));
+ mObInitMap.put(new Pair<String, String>("ge", "net/minecraft/network/play/server/S25PacketBlockBreakAnim"));
+ mObInitMap.put(new Pair<String, String>("cf", "net/minecraft/command/SyntaxErrorException"));
+ mObInitMap.put(new Pair<String, String>("any", "net/minecraft/block/BlockStoneSlab"));
+ mObInitMap.put(new Pair<String, String>("ajz", "net/minecraft/block/BlockCocoa"));
+ mObInitMap.put(new Pair<String, String>("azb", "net/minecraft/world/storage/WorldInfo$9"));
+ mObInitMap.put(new Pair<String, String>("ov", "net/minecraft/network/rcon/RConConsoleSource"));
+ mObInitMap.put(new Pair<String, String>("kw", "net/minecraft/init/Bootstrap$5$1"));
+ mObInitMap.put(new Pair<String, String>("gx", "net/minecraft/network/play/server/S21PacketChunkData"));
+ mObInitMap.put(new Pair<String, String>("cy", "net/minecraft/dispenser/PositionImpl"));
+ mObInitMap.put(new Pair<String, String>("acp", "net/minecraft/item/ItemExpBottle"));
+ mObInitMap.put(new Pair<String, String>("bop", "net/minecraft/client/renderer/entity/RenderPlayer"));
+ mObInitMap.put(new Pair<String, String>("arw", "net/minecraft/world/gen/feature/WorldGenIceSpike"));
+ mObInitMap.put(new Pair<String, String>("anx", "net/minecraft/block/BlockButtonStone"));
+ mObInitMap.put(
+ new Pair<String, String>("avv", "net/minecraft/world/gen/structure/StructureVillagePieces$Hall"));
+ mObInitMap.put(new Pair<String, String>("azu", "net/minecraft/util/MovingObjectPosition"));
+ mObInitMap.put(new Pair<String, String>("bcs", "net/minecraft/client/gui/ScreenChatOptions"));
+ mObInitMap.put(
+ new Pair<String, String>("bgr", "net/minecraft/client/gui/stream/GuiStreamUnavailable$Reason"));
+ mObInitMap.put(new Pair<String, String>("bkq", "net/minecraft/client/particle/EffectRenderer$3"));
+ mObInitMap.put(new Pair<String, String>("dm", "net/minecraft/nbt/NBTTagFloat"));
+ mObInitMap.put(new Pair<String, String>("ws", "net/minecraft/entity/passive/EntitySquid"));
+ mObInitMap.put(new Pair<String, String>("st", "net/minecraft/entity/item/EntityItemFrame"));
+ mObInitMap.put(new Pair<String, String>("ou", "net/minecraft/network/rcon/RConUtils"));
+ mObInitMap.put(new Pair<String, String>("ask", "net/minecraft/world/gen/feature/WorldGenSavannaTree"));
+ mObInitMap.put(new Pair<String, String>("aol", "net/minecraft/block/BlockPressurePlateWeighted"));
+ mObInitMap.put(new Pair<String, String>("akm", "net/minecraft/block/BlockDispenser"));
+ mObInitMap.put(new Pair<String, String>("aco", "net/minecraft/item/ItemEnderPearl"));
+ mObInitMap.put(new Pair<String, String>("agn", "net/minecraft/village/MerchantRecipe"));
+ mObInitMap.put(new Pair<String, String>("awj", "net/minecraft/world/gen/NoiseGeneratorImproved"));
+ mObInitMap.put(new Pair<String, String>("bdg", "net/minecraft/client/gui/GuiScreenAddServer"));
+ mObInitMap.put(new Pair<String, String>("bsn", "net/minecraft/client/audio/MovingSoundMinecartRiding"));
+ mObInitMap.put(new Pair<String, String>("boo", "net/minecraft/client/renderer/entity/RenderPig"));
+ mObInitMap.put(new Pair<String, String>("xg", "net/minecraft/entity/effect/EntityWeatherEffect"));
+ mObInitMap.put(new Pair<String, String>("th", "net/minecraft/entity/ai/attributes/IAttribute"));
+ mObInitMap.put(new Pair<String, String>("pi", "net/minecraft/stats/StatBase$1"));
+ mObInitMap.put(new Pair<String, String>("lj", "net/minecraft/server/MinecraftServer$3"));
+ mObInitMap.put(
+ new Pair<String, String>("hk", "net/minecraft/network/play/server/S39PacketPlayerAbilities"));
+ mObInitMap.put(new Pair<String, String>("dl", "net/minecraft/nbt/NBTTagEnd"));
+ mObInitMap.put(new Pair<String, String>("ala", "net/minecraft/block/BlockFenceGate"));
+ mObInitMap.put(new Pair<String, String>("adc", "net/minecraft/item/Item$ToolMaterial"));
+ mObInitMap.put(new Pair<String, String>("ahb", "net/minecraft/world/World"));
+ mObInitMap.put(new Pair<String, String>("btb", "net/minecraft/client/network/LanServerDetector$LanServer"));
+ mObInitMap.put(new Pair<String, String>("bpc", "net/minecraft/client/renderer/entity/RenderWither"));
+ mObInitMap.put(new Pair<String, String>("bdf", "net/minecraft/client/gui/GuiDisconnected"));
+ mObInitMap.put(new Pair<String, String>("bhe", "net/minecraft/client/model/ModelBoat"));
+ mObInitMap.put(new Pair<String, String>("bld", "net/minecraft/client/particle/EntityDiggingFX"));
+ mObInitMap.put(new Pair<String, String>("xz", "net/minecraft/entity/monster/EntityCreeper"));
+ mObInitMap.put(new Pair<String, String>("aa", "net/minecraft/command/ICommand"));
+ mObInitMap.put(new Pair<String, String>("alt", "net/minecraft/block/BlockLeaves"));
+ mObInitMap.put(new Pair<String, String>("adv", "net/minecraft/item/ItemSeedFood"));
+ mObInitMap.put(new Pair<String, String>("ahu", "net/minecraft/world/biome/BiomeGenBase"));
+ mObInitMap.put(new Pair<String, String>("btu", "net/minecraft/client/audio/ISoundEventAccessor"));
+ mObInitMap.put(new Pair<String, String>("bpv", "net/minecraft/client/renderer/texture/Stitcher"));
+ mObInitMap.put(new Pair<String, String>("bdy", "net/minecraft/client/gui/GuiSelectWorld$List"));
+ mObInitMap.put(new Pair<String, String>("bhx", "net/minecraft/client/model/ModelSheep1"));
+ mObInitMap.put(new Pair<String, String>("blw", "net/minecraft/client/renderer/EntityRenderer$3"));
+ mObInitMap.put(new Pair<String, String>("mq", "net/minecraft/server/management/PlayerManager"));
+ mObInitMap.put(new Pair<String, String>("ir", "net/minecraft/network/play/client/C01PacketChatMessage"));
+ mObInitMap.put(new Pair<String, String>("es", "net/minecraft/network/EnumConnectionState$1"));
+ mObInitMap.put(new Pair<String, String>("at", "net/minecraft/command/CommandGive"));
+ mObInitMap.put(new Pair<String, String>("xy", "net/minecraft/entity/monster/EntityCaveSpider"));
+ mObInitMap.put(new Pair<String, String>("aej", "net/minecraft/item/ItemLilyPad"));
+ mObInitMap.put(new Pair<String, String>("aak", "net/minecraft/inventory/SlotFurnace"));
+ mObInitMap.put(new Pair<String, String>("k", "net/minecraft/crash/CrashReportCategory"));
+ mObInitMap.put(new Pair<String, String>(
+ "atq", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$NetherStalkRoom"));
+ mObInitMap.put(new Pair<String, String>("apr", "net/minecraft/block/BlockPistonMoving"));
+ mObInitMap.put(new Pair<String, String>("axp", "net/minecraft/world/gen/layer/GenLayer$2"));
+ mObInitMap.put(new Pair<String, String>("ban", "net/minecraft/client/renderer/GLAllocation"));
+ mObInitMap.put(
+ new Pair<String, String>("bem", "net/minecraft/client/gui/achievement/GuiStats$StatsGeneral"));
+ mObInitMap.put(new Pair<String, String>("bil", "net/minecraft/client/model/ModelZombieVillager"));
+ mObInitMap.put(new Pair<String, String>(
+ "bmk", "net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher"));
+ mObInitMap.put(new Pair<String, String>("bh", "net/minecraft/command/server/CommandSaveAll"));
+ mObInitMap.put(new Pair<String, String>("ym", "net/minecraft/entity/monster/EntitySlime"));
+ mObInitMap.put(new Pair<String, String>("un", "net/minecraft/entity/ai/EntityAIWatchClosest"));
+ mObInitMap.put(new Pair<String, String>("mp", "net/minecraft/world/WorldManager"));
+ mObInitMap.put(new Pair<String, String>("aqf", "net/minecraft/world/chunk/storage/ChunkLoader"));
+ mObInitMap.put(new Pair<String, String>("amg", "net/minecraft/block/BlockNetherrack"));
+ mObInitMap.put(new Pair<String, String>("aei", "net/minecraft/item/EnumAction"));
+ mObInitMap.put(new Pair<String, String>("aih", "net/minecraft/world/biome/BiomeGenForest$2"));
+ mObInitMap.put(new Pair<String, String>(
+ "aue", "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$Feature"));
+ mObInitMap.put(new Pair<String, String>("ayd", "net/minecraft/pathfinding/Path"));
+ mObInitMap.put(new Pair<String, String>("bbb", "net/minecraft/client/Minecraft$5"));
+ mObInitMap.put(
+ new Pair<String, String>("bfa", "net/minecraft/client/gui/inventory/GuiBeacon$CancelButton"));
+ mObInitMap.put(new Pair<String, String>("buh", "net/minecraft/client/stream/ChatController$ChatListener"));
+ mObInitMap.put(new Pair<String, String>("bqi", "net/minecraft/client/renderer/texture/TextureUtil"));
+ mObInitMap.put(new Pair<String, String>("za", "net/minecraft/entity/player/EntityPlayer$EnumStatus"));
+ mObInitMap.put(new Pair<String, String>("vb", "net/minecraft/entity/ai/EntityAILookIdle"));
+ mObInitMap.put(new Pair<String, String>("rc", "net/minecraft/inventory/IInvBasic"));
+ mObInitMap.put(new Pair<String, String>("nd", "net/minecraft/network/NetworkSystem$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "je", "net/minecraft/network/play/client/C03PacketPlayer$C04PacketPlayerPosition"));
+ mObInitMap.put(new Pair<String, String>("ff", "net/minecraft/util/ChatComponentStyle$1"));
+ mObInitMap.put(new Pair<String, String>("aqy", "net/minecraft/world/gen/MapGenCavesHell"));
+ mObInitMap.put(new Pair<String, String>("amz", "net/minecraft/block/BlockRedstoneOre"));
+ mObInitMap.put(new Pair<String, String>("ayw", "net/minecraft/world/storage/WorldInfo$4"));
+ mObInitMap.put(new Pair<String, String>("zt", "net/minecraft/inventory/AnimalChest"));
+ mObInitMap.put(new Pair<String, String>("vu", "net/minecraft/entity/ai/EntityAITarget"));
+ mObInitMap.put(new Pair<String, String>("rv", "net/minecraft/potion/Potion"));
+ mObInitMap.put(
+ new Pair<String, String>("nw", "net/minecraft/server/management/PlayerProfileCache$Serializer"));
+ mObInitMap.put(
+ new Pair<String, String>("jx", "net/minecraft/network/login/client/C01PacketEncryptionResponse"));
+ mObInitMap.put(
+ new Pair<String, String>("fy", "net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity"));
+ mObInitMap.put(new Pair<String, String>("bz", "net/minecraft/command/CommandTime"));
+ mObInitMap.put(new Pair<String, String>("ann", "net/minecraft/block/BlockSnow"));
+ mObInitMap.put(new Pair<String, String>("abq", "net/minecraft/item/ItemCoal"));
+ mObInitMap.put(new Pair<String, String>("afp", "net/minecraft/enchantment/EnchantmentArrowKnockback"));
+ mObInitMap.put(new Pair<String, String>("ajo", "net/minecraft/block/IGrowable"));
+ mObInitMap.put(new Pair<String, String>("brp", "net/minecraft/client/resources/I18n"));
+ mObInitMap.put(new Pair<String, String>("ayv", "net/minecraft/world/storage/WorldInfo$3"));
+ mObInitMap.put(new Pair<String, String>("bbt", "net/minecraft/util/Session$Type"));
+ mObInitMap.put(new Pair<String, String>("bfs", "net/minecraft/client/gui/GuiHopper"));
+ mObInitMap.put(new Pair<String, String>("bjr", "net/minecraft/client/network/OldServerPinger$1"));
+ mObInitMap.put(new Pair<String, String>("bnq", "net/minecraft/client/renderer/entity/RenderFallingBlock"));
+ mObInitMap.put(new Pair<String, String>("ok", "net/minecraft/server/management/UserListOpsEntry"));
+ mObInitMap.put(new Pair<String, String>("kl", "net/minecraft/init/Bootstrap"));
+ mObInitMap.put(new Pair<String, String>("gm", "net/minecraft/network/play/server/S2EPacketCloseWindow"));
+ mObInitMap.put(new Pair<String, String>("cn", "net/minecraft/util/RegistryNamespacedDefaultedByKey"));
+ mObInitMap.put(new Pair<String, String>("zs", "net/minecraft/inventory/Container"));
+ mObInitMap.put(new Pair<String, String>("ace", "net/minecraft/creativetab/CreativeTabs$8"));
+ mObInitMap.put(new Pair<String, String>("arl", "net/minecraft/world/gen/feature/WorldGenDesertWells"));
+ mObInitMap.put(new Pair<String, String>("anm", "net/minecraft/block/BlockSnowBlock"));
+ mObInitMap.put(new Pair<String, String>("avk", "net/minecraft/world/gen/structure/StructureComponent"));
+ mObInitMap.put(new Pair<String, String>("bch", "net/minecraft/client/gui/GuiListExtended"));
+ mObInitMap.put(new Pair<String, String>("bgg", "net/minecraft/client/resources/ResourcePackListEntry"));
+ mObInitMap.put(new Pair<String, String>("bkf", "net/minecraft/client/particle/EntityFlameFX"));
+ mObInitMap.put(new Pair<String, String>("boe", "net/minecraft/client/renderer/entity/RenderMagmaCube"));
+ mObInitMap.put(new Pair<String, String>("wh", "net/minecraft/entity/passive/EntityCow"));
+ mObInitMap.put(new Pair<String, String>("oj", "net/minecraft/server/management/UserListOps"));
+ mObInitMap.put(new Pair<String, String>("aoa", "net/minecraft/block/BlockPane"));
+ mObInitMap.put(new Pair<String, String>("akb", "net/minecraft/block/BlockCommandBlock"));
+ mObInitMap.put(new Pair<String, String>("acd", "net/minecraft/creativetab/CreativeTabs$7"));
+ mObInitMap.put(new Pair<String, String>("agc", "net/minecraft/enchantment/EnchantmentData"));
+ mObInitMap.put(new Pair<String, String>("bsc", "net/minecraft/client/resources/data/FontMetadataSection"));
+ mObInitMap.put(new Pair<String, String>("bod", "net/minecraft/client/renderer/entity/RenderSnowball"));
+ mObInitMap.put(
+ new Pair<String, String>("net/minecraft/realms/RealmsBridge", "net/minecraft/realms/RealmsBridge"));
+ mObInitMap.put(new Pair<String, String>("da", "net/minecraft/util/RegistrySimple"));
+ mObInitMap.put(new Pair<String, String>("ass", "net/minecraft/world/gen/FlatGeneratorInfo"));
+ mObInitMap.put(new Pair<String, String>("aot", "net/minecraft/tileentity/TileEntity$2"));
+ mObInitMap.put(new Pair<String, String>("aku", "net/minecraft/block/BlockEndPortalFrame"));
+ mObInitMap.put(new Pair<String, String>("acw", "net/minecraft/item/ItemFlintAndSteel"));
+ mObInitMap.put(new Pair<String, String>("awr", "net/minecraft/block/material/MaterialTransparent"));
+ mObInitMap.put(new Pair<String, String>("bsv", "net/minecraft/client/audio/ITickableSound"));
+ mObInitMap.put(new Pair<String, String>("bow", "net/minecraft/client/renderer/entity/RenderSquid"));
+ mObInitMap.put(new Pair<String, String>("bcz", "net/minecraft/client/gui/GuiCreateFlatWorld"));
+ mObInitMap.put(new Pair<String, String>("bkx", "net/minecraft/client/particle/EntitySpellParticleFX"));
+ mObInitMap.put(new Pair<String, String>("xo", "net/minecraft/entity/EntityMinecartCommandBlock$1"));
+ mObInitMap.put(new Pair<String, String>("pq", "net/minecraft/stats/StatFileWriter"));
+ mObInitMap.put(new Pair<String, String>("lr", "net/minecraft/server/gui/IUpdatePlayerListBox"));
+ mObInitMap.put(new Pair<String, String>("hs", "net/minecraft/network/play/server/S07PacketRespawn"));
+ mObInitMap.put(new Pair<String, String>("dt", "net/minecraft/nbt/NBTSizeTracker$1"));
+ mObInitMap.put(new Pair<String, String>("aph", "net/minecraft/tileentity/IHopper"));
+ mObInitMap.put(new Pair<String, String>("ali", "net/minecraft/block/BlockGravel"));
+ mObInitMap.put(new Pair<String, String>("adk", "net/minecraft/item/ItemMinecart$1"));
+ mObInitMap.put(new Pair<String, String>("ahj", "net/minecraft/world/WorldSettings"));
+ mObInitMap.put(new Pair<String, String>("btj", "net/minecraft/client/audio/SoundManager"));
+ mObInitMap.put(new Pair<String, String>("bpk", "net/minecraft/client/shader/Shader"));
+ mObInitMap.put(new Pair<String, String>("bdn", "net/minecraft/client/gui/GuiOptions$1"));
+ mObInitMap.put(new Pair<String, String>("bhm", "net/minecraft/client/model/ModelBiped"));
+ mObInitMap.put(new Pair<String, String>("bll", "net/minecraft/client/entity/EntityOtherPlayerMP"));
+ mObInitMap.put(new Pair<String, String>("mf", "net/minecraft/server/gui/StatsComponent"));
+ mObInitMap.put(new Pair<String, String>("ig", "net/minecraft/network/play/server/S05PacketSpawnPosition"));
+ mObInitMap.put(new Pair<String, String>("eh", "net/minecraft/network/NettyEncryptingDecoder"));
+ mObInitMap.put(new Pair<String, String>("ai", "net/minecraft/command/CommandClearInventory"));
+ mObInitMap.put(new Pair<String, String>("xn", "net/minecraft/entity/EntityMinecartCommandBlock"));
+ mObInitMap.put(
+ new Pair<String, String>("atf", "net/minecraft/world/gen/structure/StructureNetherBridgePieces"));
+ mObInitMap.put(new Pair<String, String>("apg", "net/minecraft/tileentity/TileEntityFurnace"));
+ mObInitMap.put(new Pair<String, String>("axe", "net/minecraft/world/gen/layer/GenLayerBiomeEdge"));
+ mObInitMap.put(new Pair<String, String>("bac", "net/minecraft/scoreboard/Scoreboard"));
+ mObInitMap.put(new Pair<String, String>("beb", "net/minecraft/client/gui/GuiSnooper$List"));
+ mObInitMap.put(new Pair<String, String>("bia", "net/minecraft/client/model/ModelSilverfish"));
+ mObInitMap.put(new Pair<String, String>("yb", "net/minecraft/entity/monster/IMob"));
+ mObInitMap.put(new Pair<String, String>("uc", "net/minecraft/entity/ai/EntityAIDoorInteract"));
+ mObInitMap.put(new Pair<String, String>("qd", "net/minecraft/util/LongHashMap"));
+ mObInitMap.put(new Pair<String, String>("s", "net/minecraft/util/ReportedException"));
+ mObInitMap.put(new Pair<String, String>(
+ "net/minecraft/client/ClientBrandRetriever", "net/minecraft/client/ClientBrandRetriever"));
+ mObInitMap.put(new Pair<String, String>("apz", "net/minecraft/world/chunk/storage/ExtendedBlockStorage"));
+ mObInitMap.put(
+ new Pair<String, String>("aty", "net/minecraft/world/gen/structure/MapGenScatteredFeature$Start"));
+ mObInitMap.put(new Pair<String, String>("axx", "net/minecraft/world/gen/layer/GenLayerSmooth"));
+ mObInitMap.put(new Pair<String, String>("bav", "net/minecraft/client/Minecraft$15"));
+ mObInitMap.put(new Pair<String, String>("beu", "net/minecraft/client/gui/GuiKeyBindingList$CategoryEntry"));
+ mObInitMap.put(new Pair<String, String>("yu", "net/minecraft/entity/INpc"));
+ mObInitMap.put(new Pair<String, String>("uv", "net/minecraft/entity/ai/EntityAIOcelotAttack"));
+ mObInitMap.put(new Pair<String, String>("qw", "net/minecraft/util/WeightedRandom$Item"));
+ mObInitMap.put(new Pair<String, String>("mx", "net/minecraft/server/management/ItemInWorldManager"));
+ mObInitMap.put(new Pair<String, String>("iy", "net/minecraft/network/play/client/C0DPacketCloseWindow"));
+ mObInitMap.put(new Pair<String, String>("ez", "net/minecraft/util/MessageDeserializer"));
+ mObInitMap.put(new Pair<String, String>("amo", "net/minecraft/block/BlockPackedIce"));
+ mObInitMap.put(new Pair<String, String>("aip", "net/minecraft/world/biome/BiomeGenPlains"));
+ mObInitMap.put(new Pair<String, String>(
+ "aum", "net/minecraft/world/gen/structure/StructureStrongholdPieces$ChestCorridor"));
+ mObInitMap.put(new Pair<String, String>("ayl", "net/minecraft/world/WorldSavedData"));
+ mObInitMap.put(new Pair<String, String>("bup", "net/minecraft/client/stream/TwitchStream$1"));
+ mObInitMap.put(new Pair<String, String>("bqq", "net/minecraft/client/resources/FallbackResourceManager"));
+ mObInitMap.put(new Pair<String, String>("bet", "net/minecraft/client/gui/GuiKeyBindingList$1"));
+ mObInitMap.put(new Pair<String, String>("bis", "net/minecraft/client/model/ModelBox"));
+ mObInitMap.put(
+ new Pair<String, String>("bmr", "net/minecraft/client/renderer/tileentity/TileEntitySignRenderer"));
+ mObInitMap.put(new Pair<String, String>("zi", "net/minecraft/entity/projectile/EntitySmallFireball"));
+ mObInitMap.put(new Pair<String, String>("vj", "net/minecraft/entity/ai/EntityAIFollowGolem"));
+ mObInitMap.put(new Pair<String, String>("rk", "net/minecraft/profiler/IPlayerUsage"));
+ mObInitMap.put(new Pair<String, String>("nl", "net/minecraft/server/network/NetHandlerHandshakeTCP"));
+ mObInitMap.put(new Pair<String, String>(
+ "jm", "net/minecraft/network/play/client/C10PacketCreativeInventoryAction"));
+ mObInitMap.put(new Pair<String, String>("fn", "net/minecraft/util/ChatStyle"));
+ mObInitMap.put(new Pair<String, String>("bo", "net/minecraft/command/CommandSetPlayerTimeout"));
+ mObInitMap.put(new Pair<String, String>("anc", "net/minecraft/block/BlockRedstoneTorch"));
+ mObInitMap.put(new Pair<String, String>("abf", "net/minecraft/item/ItemAxe"));
+ mObInitMap.put(new Pair<String, String>("afe", "net/minecraft/item/crafting/CraftingManager"));
+ mObInitMap.put(new Pair<String, String>("ajd", "net/minecraft/block/BlockBasePressurePlate"));
+ mObInitMap.put(new Pair<String, String>("bre", "net/minecraft/client/resources/ResourcePackRepository$2"));
+ mObInitMap.put(new Pair<String, String>("ayk", "net/minecraft/world/storage/MapData$MapCoord"));
+ mObInitMap.put(new Pair<String, String>("bfh", "net/minecraft/client/gui/GuiCommandBlock"));
+ mObInitMap.put(new Pair<String, String>("bjg", "net/minecraft/client/multiplayer/WorldClient$1"));
+ mObInitMap.put(new Pair<String, String>("bnf", "net/minecraft/client/renderer/entity/RenderCaveSpider"));
+ mObInitMap.put(new Pair<String, String>("ka", "net/minecraft/network/status/server/S00PacketServerInfo"));
+ mObInitMap.put(new Pair<String, String>("gb", "net/minecraft/network/play/server/S0CPacketSpawnPlayer"));
+ mObInitMap.put(new Pair<String, String>("cc", "net/minecraft/command/server/CommandWhitelist"));
+ mObInitMap.put(new Pair<String, String>("zh", "net/minecraft/entity/IProjectile"));
+ mObInitMap.put(new Pair<String, String>("aby", "net/minecraft/creativetab/CreativeTabs$2"));
+ mObInitMap.put(new Pair<String, String>("ara", "net/minecraft/world/gen/ChunkProviderEnd"));
+ mObInitMap.put(new Pair<String, String>("anb", "net/minecraft/block/BlockRedstoneLight"));
+ mObInitMap.put(
+ new Pair<String, String>("bjz", "net/minecraft/client/particle/EntityEnchantmentTableParticleFX"));
+ mObInitMap.put(new Pair<String, String>("bny", "net/minecraft/client/renderer/entity/RenderItem"));
+ mObInitMap.put(new Pair<String, String>("cv", "net/minecraft/dispenser/ILocation"));
+ mObInitMap.put(new Pair<String, String>("anu", "net/minecraft/block/BlockStem"));
+ mObInitMap.put(new Pair<String, String>("afw", "net/minecraft/enchantment/EnchantmentHelper$1"));
+ mObInitMap.put(new Pair<String, String>("ajv", "net/minecraft/block/BlockCarrot"));
+ mObInitMap.put(
+ new Pair<String, String>("avs", "net/minecraft/world/gen/structure/StructureVillagePieces$Field2"));
+ mObInitMap.put(new Pair<String, String>("azr", "net/minecraft/world/storage/ThreadedFileIOBase"));
+ mObInitMap.put(new Pair<String, String>("bcp", "net/minecraft/client/gui/GuiButtonRealmsProxy"));
+ mObInitMap.put(new Pair<String, String>("brw", "net/minecraft/client/resources/data/IMetadataSerializer"));
+ mObInitMap.put(new Pair<String, String>("bnx", "net/minecraft/client/renderer/tileentity/RenderItemFrame"));
+ mObInitMap.put(new Pair<String, String>("wp", "net/minecraft/entity/passive/EntitySheep"));
+ mObInitMap.put(new Pair<String, String>("sq", "net/minecraft/entity/item/EntityXPOrb"));
+ mObInitMap.put(new Pair<String, String>("or", "net/minecraft/server/management/UserListWhitelist"));
+ mObInitMap.put(new Pair<String, String>("ks", "net/minecraft/init/Bootstrap$2"));
+ mObInitMap.put(new Pair<String, String>("gt", "net/minecraft/network/play/server/S19PacketEntityStatus"));
+ mObInitMap.put(new Pair<String, String>("cu", "net/minecraft/dispenser/ILocatableSource"));
+ mObInitMap.put(new Pair<String, String>("ash", "net/minecraft/world/gen/feature/WorldGenReed"));
+ mObInitMap.put(new Pair<String, String>("aoi", "net/minecraft/block/BlockWall"));
+ mObInitMap.put(new Pair<String, String>("akj", "net/minecraft/block/BlockRedstoneDiode"));
+ mObInitMap.put(new Pair<String, String>("acl", "net/minecraft/item/ItemEmptyMap"));
+ mObInitMap.put(new Pair<String, String>("agk", "net/minecraft/enchantment/EnchantmentUntouching"));
+ mObInitMap.put(new Pair<String, String>("bsk", "net/minecraft/client/audio/PositionedSound"));
+ mObInitMap.put(new Pair<String, String>("bol", "net/minecraft/client/renderer/entity/RenderMooshroom"));
+ mObInitMap.put(
+ new Pair<String, String>("bgn", "net/minecraft/client/gui/stream/GuiIngestServers$ServerList"));
+ mObInitMap.put(new Pair<String, String>("bkm", "net/minecraft/client/particle/EntityFX"));
+ mObInitMap.put(new Pair<String, String>("xd", "net/minecraft/entity/boss/EntityWither$1"));
+ mObInitMap.put(new Pair<String, String>("te", "net/minecraft/entity/DataWatcher"));
+ mObInitMap.put(new Pair<String, String>("pf", "net/minecraft/stats/StatCrafting"));
+ mObInitMap.put(new Pair<String, String>("lg", "net/minecraft/server/ServerEula"));
+ mObInitMap.put(new Pair<String, String>(
+ "hh", "net/minecraft/network/play/server/S14PacketEntity$S17PacketEntityLookMove"));
+ mObInitMap.put(new Pair<String, String>("di", "net/minecraft/nbt/NBTTagCompound$1"));
+ mObInitMap.put(new Pair<String, String>("bdc", "net/minecraft/client/gui/GuiGameOver"));
+ mObInitMap.put(new Pair<String, String>("bla", "net/minecraft/client/particle/EntityAuraFX"));
+ mObInitMap.put(new Pair<String, String>("py", "net/minecraft/server/management/LowerStringMap"));
+ mObInitMap.put(new Pair<String, String>("lz", "net/minecraft/server/gui/MinecraftServerGui$1"));
+ mObInitMap.put(new Pair<String, String>("ads", "net/minecraft/item/ItemRedstone"));
+ mObInitMap.put(new Pair<String, String>("bps", "net/minecraft/client/renderer/ThreadDownloadImageData$1"));
+ mObInitMap.put(new Pair<String, String>(
+ "asz", "net/minecraft/world/gen/structure/StructureMineshaftPieces$Cross"));
+ mObInitMap.put(new Pair<String, String>("awy", "net/minecraft/world/gen/layer/GenLayerEdge"));
+ mObInitMap.put(new Pair<String, String>("bdv", "net/minecraft/client/gui/GuiRenameWorld"));
+ mObInitMap.put(new Pair<String, String>("bhu", "net/minecraft/client/model/ModelPig"));
+ mObInitMap.put(new Pair<String, String>("blt", "net/minecraft/client/renderer/EntityRenderer"));
+ mObInitMap.put(new Pair<String, String>("ep", "net/minecraft/network/EnumConnectionState$2"));
+ mObInitMap.put(new Pair<String, String>("aq", "net/minecraft/command/CommandDifficulty"));
+ mObInitMap.put(new Pair<String, String>("xv", "net/minecraft/entity/item/EntityMinecartTNT"));
+ mObInitMap.put(new Pair<String, String>("tw", "net/minecraft/entity/ai/EntityAIAvoidEntity"));
+ mObInitMap.put(new Pair<String, String>("px", "net/minecraft/util/HttpUtil$DownloadListener"));
+ mObInitMap.put(new Pair<String, String>("h", "net/minecraft/crash/CrashReport$6"));
+ mObInitMap.put(new Pair<String, String>(
+ "atn", "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor"));
+ mObInitMap.put(new Pair<String, String>("apo", "net/minecraft/tileentity/TileEntityEndPortal"));
+ mObInitMap.put(new Pair<String, String>("alp", "net/minecraft/block/BlockIce"));
+ mObInitMap.put(new Pair<String, String>("adr", "net/minecraft/item/ItemRecord"));
+ mObInitMap.put(new Pair<String, String>("ahq", "net/minecraft/world/Teleporter$PortalPosition"));
+ mObInitMap.put(new Pair<String, String>("axm", "net/minecraft/world/gen/layer/GenLayerIsland"));
+ mObInitMap.put(new Pair<String, String>("bak", "net/minecraft/client/gui/ChatLine"));
+ mObInitMap.put(new Pair<String, String>("bej", "net/minecraft/client/gui/achievement/GuiStats"));
+ mObInitMap.put(new Pair<String, String>("btq", "net/minecraft/client/audio/SoundHandler$1"));
+ mObInitMap.put(new Pair<String, String>("bpr", "net/minecraft/client/renderer/ThreadDownloadImageData"));
+ mObInitMap.put(new Pair<String, String>("yj", "net/minecraft/entity/SharedMonsterAttributes"));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/Preloader_GT_OreDict.java b/src/main/java/gtPlusPlus/preloader/Preloader_GT_OreDict.java
index 8e7001903d..bfd2cbae69 100644
--- a/src/main/java/gtPlusPlus/preloader/Preloader_GT_OreDict.java
+++ b/src/main/java/gtPlusPlus/preloader/Preloader_GT_OreDict.java
@@ -1,173 +1,227 @@
package gtPlusPlus.preloader;
-import org.apache.logging.log4j.Level;
-
import cpw.mods.fml.relauncher.FMLRelaunchLog;
-
-import net.minecraft.item.ItemStack;
-
import gregtech.common.items.GT_MetaGenerated_Item_01;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.item.ItemStack;
+import org.apache.logging.log4j.Level;
public class Preloader_GT_OreDict {
- public static boolean shouldPreventRegistration(final String string, final ItemStack bannedItem) {
-
- if (bannedItem == null) {
- return false;
- }
- else if (!CORE_Preloader.enableOldGTcircuits && !LoadedMods.Mekanism){
- return false;
- }
+ public static boolean shouldPreventRegistration(final String string, final ItemStack bannedItem) {
- try {
- if (CORE_Preloader.enableOldGTcircuits){
- if ((bannedItem != null) && ItemUtils.getModId(bannedItem).toLowerCase().equals("gregtech")){
- final int damageValue = bannedItem.getItemDamage() - 32000;
- if (bannedItem.getItem() instanceof GT_MetaGenerated_Item_01) { // 700-720
- if ((damageValue >= 700) && (damageValue <= 720)) {
- return true;
- }
- }
- else {
- if (ReflectionUtils.doesClassExist("gregtech.common.items.GT_MetaGenerated_Item_03")) { // 6/11/12/14/16/20/30-57/69-73/79-96
- final Class<?> MetaItem03 = ReflectionUtils.getClass("gregtech.common.items.GT_MetaGenerated_Item_03");
- if (isInstanceOf(MetaItem03, bannedItem.getItem())) {
- if ((damageValue == 6) || (damageValue == 7) || (damageValue == 11) || (damageValue == 12) || (damageValue == 14)
- || (damageValue == 16) || (damageValue == 20) || (damageValue == 21) || (damageValue == 22)) {
- return true;
- }
- else if ((damageValue >= 30) && (damageValue <= 57)) {
- return true;
- }
- else if ((damageValue >= 69) && (damageValue <= 73)) {
- return true;
- }
- else if ((damageValue >= 78) && (damageValue <= 96)) {
- return true;
- }
- }
- }
- }
- }
- }
+ if (bannedItem == null) {
+ return false;
+ } else if (!CORE_Preloader.enableOldGTcircuits && !LoadedMods.Mekanism) {
+ return false;
+ }
- //Mekanism Support - Let's not make Mek Osmium useful in GT anymore.
- if ((((bannedItem != null) && !LoadedMods.RedTech && (ItemUtils.getModId(bannedItem).toLowerCase().equals("mekanism"))) || (LoadedMods.Mekanism)) && !LoadedMods.RedTech){
- //Circuits
- if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemControlCircuit")) {
- final Class<?> MekCircuit = ReflectionUtils.getClass("mekanism.common.item.ItemControlCircuit");
- if (isInstanceOf(MekCircuit, bannedItem.getItem())) {
- for (int r=0;r<4;r++){
- if (bannedItem.getItemDamage() == r){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing %s from the OreDictionary to balance Mekanism.", bannedItem.getDisplayName());
- return true;
- }
- }
- }
- }
- //Ingots
- if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemIngot")) {
- final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemIngot");
- if (isInstanceOf(MekIngot, bannedItem.getItem())) {
- if (bannedItem.getItemDamage() == 1){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing %s from the OreDictionary to balance Mekanism.", bannedItem.getDisplayName());
- return true;
- }
- }
- }
- //Dirty Dust
- if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemDirtyDust")) {
- final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemDirtyDust");
- if (isInstanceOf(MekIngot, bannedItem.getItem())) {
- if (bannedItem.getItemDamage() == 2){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing %s from the OreDictionary to balance Mekanism.", bannedItem.getDisplayName());
- return true;
- }
- }
- }
- //Dust
- if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemDust")) {
- final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemDust");
- if (isInstanceOf(MekIngot, bannedItem.getItem())) {
- if (bannedItem.getItemDamage() == 2){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing %s from the OreDictionary to balance Mekanism.", bannedItem.getDisplayName());
- return true;
- }
- }
- }
- //Crystal
- if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemCrystal")) {
- final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemCrystal");
- if (isInstanceOf(MekIngot, bannedItem.getItem())) {
- if (bannedItem.getItemDamage() == 2){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing %s from the OreDictionary to balance Mekanism.", bannedItem.getDisplayName());
- return true;
- }
- }
- }
- //Shard
- if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemShard")) {
- final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemShard");
- if (isInstanceOf(MekIngot, bannedItem.getItem())) {
- if (bannedItem.getItemDamage() == 2){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing %s from the OreDictionary to balance Mekanism.", bannedItem.getDisplayName());
- return true;
- }
- }
- }
- //Clump
- if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemClump")) {
- final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemClump");
- if (isInstanceOf(MekIngot, bannedItem.getItem())) {
- if (bannedItem.getItemDamage() == 2){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing %s from the OreDictionary to balance Mekanism.", bannedItem.getDisplayName());
- return true;
- }
- }
- }
- //Ores
- if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemBlockOre")) {
- final Class<?> MekOre = ReflectionUtils.getClass("mekanism.common.item.ItemBlockOre");
- if (isInstanceOf(MekOre, bannedItem.getItem()) || (bannedItem == ItemUtils.simpleMetaStack("Mekanism:OreBlock", 0, 1))) {
- if (bannedItem.getItemDamage() == 0){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing %s from the OreDictionary to balance Mekanism.", bannedItem.getDisplayName());
- return true;
- }
- }
- }
- }
+ try {
+ if (CORE_Preloader.enableOldGTcircuits) {
+ if ((bannedItem != null)
+ && ItemUtils.getModId(bannedItem).toLowerCase().equals("gregtech")) {
+ final int damageValue = bannedItem.getItemDamage() - 32000;
+ if (bannedItem.getItem() instanceof GT_MetaGenerated_Item_01) { // 700-720
+ if ((damageValue >= 700) && (damageValue <= 720)) {
+ return true;
+ }
+ } else {
+ if (ReflectionUtils.doesClassExist(
+ "gregtech.common.items.GT_MetaGenerated_Item_03")) { // 6/11/12/14/16/20/30-57/69-73/79-96
+ final Class<?> MetaItem03 =
+ ReflectionUtils.getClass("gregtech.common.items.GT_MetaGenerated_Item_03");
+ if (isInstanceOf(MetaItem03, bannedItem.getItem())) {
+ if ((damageValue == 6)
+ || (damageValue == 7)
+ || (damageValue == 11)
+ || (damageValue == 12)
+ || (damageValue == 14)
+ || (damageValue == 16)
+ || (damageValue == 20)
+ || (damageValue == 21)
+ || (damageValue == 22)) {
+ return true;
+ } else if ((damageValue >= 30) && (damageValue <= 57)) {
+ return true;
+ } else if ((damageValue >= 69) && (damageValue <= 73)) {
+ return true;
+ } else if ((damageValue >= 78) && (damageValue <= 96)) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
- } catch (final Throwable e) {
- if (CORE.ConfigSwitches.showHiddenNEIItems) {
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "A mod tried to register an invalid item with the OreDictionary.");
- if (bannedItem != null){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Please report this issue to the authors of %s", ItemUtils.getModId(bannedItem));
- try {
- if (bannedItem.getItemDamage() <= Short.MAX_VALUE-1) {
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Item was not null, but still invalidly registering: %s", bannedItem.getDisplayName() != null ? bannedItem.getDisplayName() : "INVALID ITEM FOUND");
- }
- else {
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Item was not null, but still invalidly registering: %s", "Found Wildcard item that is being registered too early.");
- }
- }
- catch (Exception h) {
- h.printStackTrace();
- }
- }
- }
- //FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "%s", e.getMessage());
- }
- return false;
- }
+ // Mekanism Support - Let's not make Mek Osmium useful in GT anymore.
+ if ((((bannedItem != null)
+ && !LoadedMods.RedTech
+ && (ItemUtils.getModId(bannedItem)
+ .toLowerCase()
+ .equals("mekanism")))
+ || (LoadedMods.Mekanism))
+ && !LoadedMods.RedTech) {
+ // Circuits
+ if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemControlCircuit")) {
+ final Class<?> MekCircuit = ReflectionUtils.getClass("mekanism.common.item.ItemControlCircuit");
+ if (isInstanceOf(MekCircuit, bannedItem.getItem())) {
+ for (int r = 0; r < 4; r++) {
+ if (bannedItem.getItemDamage() == r) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Removing %s from the OreDictionary to balance Mekanism.",
+ bannedItem.getDisplayName());
+ return true;
+ }
+ }
+ }
+ }
+ // Ingots
+ if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemIngot")) {
+ final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemIngot");
+ if (isInstanceOf(MekIngot, bannedItem.getItem())) {
+ if (bannedItem.getItemDamage() == 1) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Removing %s from the OreDictionary to balance Mekanism.",
+ bannedItem.getDisplayName());
+ return true;
+ }
+ }
+ }
+ // Dirty Dust
+ if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemDirtyDust")) {
+ final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemDirtyDust");
+ if (isInstanceOf(MekIngot, bannedItem.getItem())) {
+ if (bannedItem.getItemDamage() == 2) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Removing %s from the OreDictionary to balance Mekanism.",
+ bannedItem.getDisplayName());
+ return true;
+ }
+ }
+ }
+ // Dust
+ if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemDust")) {
+ final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemDust");
+ if (isInstanceOf(MekIngot, bannedItem.getItem())) {
+ if (bannedItem.getItemDamage() == 2) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Removing %s from the OreDictionary to balance Mekanism.",
+ bannedItem.getDisplayName());
+ return true;
+ }
+ }
+ }
+ // Crystal
+ if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemCrystal")) {
+ final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemCrystal");
+ if (isInstanceOf(MekIngot, bannedItem.getItem())) {
+ if (bannedItem.getItemDamage() == 2) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Removing %s from the OreDictionary to balance Mekanism.",
+ bannedItem.getDisplayName());
+ return true;
+ }
+ }
+ }
+ // Shard
+ if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemShard")) {
+ final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemShard");
+ if (isInstanceOf(MekIngot, bannedItem.getItem())) {
+ if (bannedItem.getItemDamage() == 2) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Removing %s from the OreDictionary to balance Mekanism.",
+ bannedItem.getDisplayName());
+ return true;
+ }
+ }
+ }
+ // Clump
+ if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemClump")) {
+ final Class<?> MekIngot = ReflectionUtils.getClass("mekanism.common.item.ItemClump");
+ if (isInstanceOf(MekIngot, bannedItem.getItem())) {
+ if (bannedItem.getItemDamage() == 2) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Removing %s from the OreDictionary to balance Mekanism.",
+ bannedItem.getDisplayName());
+ return true;
+ }
+ }
+ }
+ // Ores
+ if (ReflectionUtils.doesClassExist("mekanism.common.item.ItemBlockOre")) {
+ final Class<?> MekOre = ReflectionUtils.getClass("mekanism.common.item.ItemBlockOre");
+ if (isInstanceOf(MekOre, bannedItem.getItem())
+ || (bannedItem == ItemUtils.simpleMetaStack("Mekanism:OreBlock", 0, 1))) {
+ if (bannedItem.getItemDamage() == 0) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Removing %s from the OreDictionary to balance Mekanism.",
+ bannedItem.getDisplayName());
+ return true;
+ }
+ }
+ }
+ }
- // Simplification of Life.
- private static boolean isInstanceOf(final Class<?> clazz, final Object obj) {
- return clazz.isInstance(obj);
- }
+ } catch (final Throwable e) {
+ if (CORE.ConfigSwitches.showHiddenNEIItems) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "A mod tried to register an invalid item with the OreDictionary.");
+ if (bannedItem != null) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Please report this issue to the authors of %s",
+ ItemUtils.getModId(bannedItem));
+ try {
+ if (bannedItem.getItemDamage() <= Short.MAX_VALUE - 1) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Item was not null, but still invalidly registering: %s",
+ bannedItem.getDisplayName() != null
+ ? bannedItem.getDisplayName()
+ : "INVALID ITEM FOUND");
+ } else {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer",
+ Level.INFO,
+ "Item was not null, but still invalidly registering: %s",
+ "Found Wildcard item that is being registered too early.");
+ }
+ } catch (Exception h) {
+ h.printStackTrace();
+ }
+ }
+ }
+ // FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "%s", e.getMessage());
+ }
+ return false;
+ }
+ // Simplification of Life.
+ private static boolean isInstanceOf(final Class<?> clazz, final Object obj) {
+ return clazz.isInstance(obj);
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/Preloader_Logger.java b/src/main/java/gtPlusPlus/preloader/Preloader_Logger.java
index 84f0fab012..471476be60 100644
--- a/src/main/java/gtPlusPlus/preloader/Preloader_Logger.java
+++ b/src/main/java/gtPlusPlus/preloader/Preloader_Logger.java
@@ -6,55 +6,51 @@ import org.apache.logging.log4j.Logger;
public class Preloader_Logger {
- private Preloader_Logger() {
-
- }
-
- // Logging Functions
- public static final Logger MODLOGGER = Preloader_Logger.makeLogger();
-
- // Generate GT++ Logger
- public static Logger makeLogger() {
- final Logger gtPlusPlusLogger = LogManager.getLogger("GT++ ASM");
- return gtPlusPlusLogger;
- }
-
- public static final org.apache.logging.log4j.Logger getLogger(){
- return MODLOGGER;
- }
-
- // Non-Dev Comments
-
- public static void INFO(final String s, final String s2) {
- INFO(s);
- INFO(s2);
- }
-
- public static void INFO(final String s) {
- MODLOGGER.info(s);
- }
-
- // Developer Comments
- public static void WARNING(final String s) {
- MODLOGGER.warn(s);
- }
-
- // Errors
- public static void ERROR(final String s) {
- MODLOGGER.fatal(s);
- }
-
- public static void LOG(String string, Level info, String string2) {
- if (info.equals(Level.INFO)) {
- INFO("["+string+"] "+string2);
- }
- if (info.equals(Level.WARN)) {
- WARNING("["+string+"] "+string2);
- }
- if (info.equals(Level.ERROR)) {
- ERROR("["+string+"] "+string2);
- }
-
- }
-
+ private Preloader_Logger() {}
+
+ // Logging Functions
+ public static final Logger MODLOGGER = Preloader_Logger.makeLogger();
+
+ // Generate GT++ Logger
+ public static Logger makeLogger() {
+ final Logger gtPlusPlusLogger = LogManager.getLogger("GT++ ASM");
+ return gtPlusPlusLogger;
+ }
+
+ public static final org.apache.logging.log4j.Logger getLogger() {
+ return MODLOGGER;
+ }
+
+ // Non-Dev Comments
+
+ public static void INFO(final String s, final String s2) {
+ INFO(s);
+ INFO(s2);
+ }
+
+ public static void INFO(final String s) {
+ MODLOGGER.info(s);
+ }
+
+ // Developer Comments
+ public static void WARNING(final String s) {
+ MODLOGGER.warn(s);
+ }
+
+ // Errors
+ public static void ERROR(final String s) {
+ MODLOGGER.fatal(s);
+ }
+
+ public static void LOG(String string, Level info, String string2) {
+ if (info.equals(Level.INFO)) {
+ INFO("[" + string + "] " + string2);
+ }
+ if (info.equals(Level.WARN)) {
+ WARNING("[" + string + "] " + string2);
+ }
+ if (info.equals(Level.ERROR)) {
+ ERROR("[" + string + "] " + string2);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java b/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java
index 4ae1d7658d..f1b2e908b4 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java
@@ -2,7 +2,6 @@ package gtPlusPlus.preloader.asm;
import cpw.mods.fml.common.FMLLog;
import gtPlusPlus.preloader.Preloader_Logger;
-
import java.io.File;
import java.util.ArrayList;
import net.minecraftforge.common.config.Configuration;
@@ -10,202 +9,192 @@ import net.minecraftforge.common.config.Property;
import org.apache.logging.log4j.Level;
public class AsmConfig {
-
- public static boolean loaded;
- public static Configuration config;
-
- public static boolean enableOreDictPatch;
- public static boolean enableTiConFluidLighting;
- public static boolean enableGtTooltipFix;
- public static boolean enableGtNbtFix;
- public static boolean enableGtCharcoalPitFix;
- public static boolean enableChunkDebugging;
- public static boolean enableCofhPatch;
- public static boolean enableGcFuelChanges;
- public static boolean enableRcFlowFix;
- public static int maxRailcraftTankProcessVolume;
- public static int maxRailcraftFluidLoaderFlow;
- public static int maxRailcraftFluidUnloaderFlow;
- public static boolean enableRcItemDupeFix;
- public static boolean enableTcAspectSafety;
- public static boolean enabledLwjglKeybindingFix;
- public static boolean enabledFixEntitySetHealth;
- public static boolean enableThaumicTinkererRepairFix;
-
- public static boolean disableAllLogging;
- public static boolean debugMode;
-
- public AsmConfig(File file) {
- if (!loaded) {
- config = new Configuration(file);
- syncConfig(true);
- }
-
- }
-
- public static void syncConfig(boolean load) {
- ArrayList<String> propOrder = new ArrayList<String>();
- ArrayList<String> propOrderDebug = new ArrayList<String>();
-
- try {
- if (!config.isChild && load) {
- config.load();
- }
-
- Property prop;
-
- //Debug
- prop = config.get("debug", "disableAllLogging", true);
- prop.comment = "Disables ALL logging from GT++.";
- prop.setLanguageKey("gtpp.disableAllLogging").setRequiresMcRestart(false);
- disableAllLogging = prop.getBoolean(true);
- propOrderDebug.add(prop.getName());
-
- prop = config.get("debug", "debugMode", false);
- prop.comment = "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)";
- prop.setLanguageKey("gtpp.debugMode").setRequiresMcRestart(false);
- debugMode = prop.getBoolean(false);
- propOrderDebug.add(prop.getName());
-
- prop = config.get("debug", "enabledFixEntitySetHealth", false);
- prop.comment = "Enable/Disable entity setHealth() fix.";
- prop.setLanguageKey("gtpp.enabledFixEntitySetHealth").setRequiresMcRestart(true);
- enabledFixEntitySetHealth = prop.getBoolean(false);
- propOrderDebug.add(prop.getName());
-
- prop = config.get("debug", "enableChunkDebugging", false);
- prop.comment = "Enable/Disable Chunk Debugging Features, Must Be enabled on Client and Server.";
- prop.setLanguageKey("gtpp.enableChunkDebugging").setRequiresMcRestart(true);
- enableChunkDebugging = prop.getBoolean(false);
- propOrderDebug.add(prop.getName());
-
- prop = config.get("debug", "enableGtNbtFix", true);
- prop.comment = "Enable/Disable GT NBT Persistency Fix";
- prop.setLanguageKey("gtpp.enableGtNbtFix").setRequiresMcRestart(true);
- enableGtNbtFix = prop.getBoolean(true);
- propOrderDebug.add(prop.getName());
-
- prop = config.get("debug", "enableCofhPatch", false);
- prop.comment = "Enable/Disable COFH OreDictionaryArbiter Patch (Useful for Development)";
- prop.setLanguageKey("gtpp.enableCofhPatch").setRequiresMcRestart(true);
- enableCofhPatch = prop.getBoolean(false);
- propOrderDebug.add(prop.getName());
-
- prop = config.get("debug", "enableOreDictPatch", false);
- prop.comment = "Enable/Disable Forge OreDictionary Patch (Useful for Development)";
- prop.setLanguageKey("gtpp.enableOreDictPatch").setRequiresMcRestart(true);
- enableOreDictPatch = prop.getBoolean(false);
- propOrderDebug.add(prop.getName());
-
- prop = config.get("debug", "enableThaumicTinkererRepairFix", false);
- prop.comment = "Enable/Disable Patch for Thaumic Repairer";
- prop.setLanguageKey("gtpp.enableThaumicTinkererRepairFix").setRequiresMcRestart(true);
- enableThaumicTinkererRepairFix = prop.getBoolean(false);
- propOrderDebug.add(prop.getName());
-
-
-
-
-
-
- //General Features
- prop = config.get("general", "enableTiConFluidLighting", true);
- prop.comment = "Enable/Disable Brightness Visuals for Tinkers Fluids, only required on the Client.";
- prop.setLanguageKey("gtpp.enableTiConFluidLighting").setRequiresMcRestart(true);
- enableTiConFluidLighting = prop.getBoolean(true);
- propOrder.add(prop.getName());
-
- prop = config.get("general", "enabledLwjglKeybindingFix", true);
- prop.comment = "Prevents the game crashing from having invalid keybinds. https://github.com/alkcorp/GTplusplus/issues/544";
- prop.setLanguageKey("gtpp.enabledLwjglKeybindingFix").setRequiresMcRestart(true);
- enabledLwjglKeybindingFix = prop.getBoolean(true);
- propOrder.add(prop.getName());
-
- prop = config.get("general", "enableGtTooltipFix", true);
- prop.comment = "Enable/Disable Custom GT Tooltips";
- prop.setLanguageKey("gtpp.enableGtTooltipFix").setRequiresMcRestart(true);
- enableGtTooltipFix = prop.getBoolean(true);
- propOrder.add(prop.getName());
-
-
-
- prop = config.get("general", "enableGtCharcoalPitFix", true);
- prop.comment = "Makes the Charcoal Pile Igniter work better.";
- prop.setLanguageKey("gtpp.enableGtCharcoalPitFix").setRequiresMcRestart(true);
- enableGtCharcoalPitFix = prop.getBoolean(true);
- propOrder.add(prop.getName());
-
- prop = config.get("general", "enableGcFuelChanges", true);
- prop.comment = "Enable/Disable changes to Galacticraft Rocket Fuels.";
- prop.setLanguageKey("gtpp.enableGcFuelChanges").setRequiresMcRestart(true);
- //Disabled because Broken
- //enableGcFuelChanges = prop.getBoolean(true);
- enableGcFuelChanges = false;
- propOrder.add(prop.getName());
-
-
- //Railcraft Tank fix
- prop = config.get("general", "enableRcFlowFix", true);
- prop.comment = "Allows Custom max IO rates on RC tanks";
- prop.setLanguageKey("gtpp.enableRcFlowFix").setRequiresMcRestart(true);
- enableRcFlowFix = prop.getBoolean(true);
- propOrder.add(prop.getName());
-
- prop = config.get("general", "maxRailcraftTankProcessVolume", 4000);
- prop.comment = "Max IO for RC fluid tanks (Not Carts). 'enableRcFlowFix' Must be enabled.";
- prop.setLanguageKey("gtpp.maxRailcraftTankProcessVolume").setRequiresMcRestart(true);
- maxRailcraftTankProcessVolume = prop.getInt(4000);
- propOrder.add(prop.getName());
-
- // Railcraft Loader Max flowrate
- prop = config.get("general", "maxRailcraftFluidLoaderFlow", 20);
- prop.comment = "Max Output rate for RC Fluid Loaders";
- prop.setLanguageKey("gtpp.maxRailcraftFluidLoaderFlow").setRequiresMcRestart(true);
- maxRailcraftFluidLoaderFlow = prop.getInt(20);
- propOrder.add(prop.getName());
-
- // Railcraft Unloader Max flowrate
- prop = config.get("general", "maxRailcraftFluidUnloaderFlow", 80);
- prop.comment = "Max Output rate for RC Fluid Unloaders";
- prop.setLanguageKey("gtpp.maxRailcraftFluidUnloaderFlow").setRequiresMcRestart(true);
- maxRailcraftFluidUnloaderFlow = prop.getInt(80);
- propOrder.add(prop.getName());
-
- //Railcraft Dupe Fix
- prop = config.get("general", "enableRcItemDupeFix", true);
- prop.comment = "Fixes possible negative itemstacks";
- prop.setLanguageKey("gtpp.enableRcItemDupeFix").setRequiresMcRestart(true);
- enableRcItemDupeFix = prop.getBoolean(true);
- propOrder.add(prop.getName());
-
-
- //TC Aspect Safety
- prop = config.get("general", "enableTcAspectSafety", true);
- prop.comment = "Fixes small oversights in Thaumcraft 4.";
- prop.setLanguageKey("gtpp.enableTcAspectSafety").setRequiresMcRestart(true);
- enableTcAspectSafety = prop.getBoolean(true);
- propOrder.add(prop.getName());
-
-
- config.setCategoryPropertyOrder("general", propOrder);
- config.setCategoryPropertyOrder("debug", propOrderDebug);
- if (config.hasChanged()) {
- config.save();
- }
-
- Preloader_Logger.INFO("Chunk Debugging - Enabled: "+enableChunkDebugging);
- Preloader_Logger.INFO("Gt Nbt Fix - Enabled: "+enableGtNbtFix);
- Preloader_Logger.INFO("TiCon Fluid Lighting - Enabled: "+enableTiConFluidLighting);
- Preloader_Logger.INFO("Gt Tooltip Fix - Enabled: "+enableGtTooltipFix);
- Preloader_Logger.INFO("COFH Patch - Enabled: "+enableCofhPatch);
- Preloader_Logger.INFO("Gc Fuel Changes Patch - Enabled: "+enableGcFuelChanges);
- Preloader_Logger.INFO("Railcraft Fluid Flow Patch - Enabled: "+enableRcFlowFix);
- Preloader_Logger.INFO("Thaumcraft Aspect Safety Patch - Enabled: "+enableTcAspectSafety);
- Preloader_Logger.INFO("Fix bad usage of EntityLivingBase.setHealth Patch - Enabled: "+enabledFixEntitySetHealth);
-
- } catch (Exception var3) {
- FMLLog.log(Level.ERROR, var3, "GT++ ASM had a problem loading it's config", new Object[0]);
- }
-
- }
-} \ No newline at end of file
+
+ public static boolean loaded;
+ public static Configuration config;
+
+ public static boolean enableOreDictPatch;
+ public static boolean enableTiConFluidLighting;
+ public static boolean enableGtTooltipFix;
+ public static boolean enableGtNbtFix;
+ public static boolean enableGtCharcoalPitFix;
+ public static boolean enableChunkDebugging;
+ public static boolean enableCofhPatch;
+ public static boolean enableGcFuelChanges;
+ public static boolean enableRcFlowFix;
+ public static int maxRailcraftTankProcessVolume;
+ public static int maxRailcraftFluidLoaderFlow;
+ public static int maxRailcraftFluidUnloaderFlow;
+ public static boolean enableRcItemDupeFix;
+ public static boolean enableTcAspectSafety;
+ public static boolean enabledLwjglKeybindingFix;
+ public static boolean enabledFixEntitySetHealth;
+ public static boolean enableThaumicTinkererRepairFix;
+
+ public static boolean disableAllLogging;
+ public static boolean debugMode;
+
+ public AsmConfig(File file) {
+ if (!loaded) {
+ config = new Configuration(file);
+ syncConfig(true);
+ }
+ }
+
+ public static void syncConfig(boolean load) {
+ ArrayList<String> propOrder = new ArrayList<String>();
+ ArrayList<String> propOrderDebug = new ArrayList<String>();
+
+ try {
+ if (!config.isChild && load) {
+ config.load();
+ }
+
+ Property prop;
+
+ // Debug
+ prop = config.get("debug", "disableAllLogging", true);
+ prop.comment = "Disables ALL logging from GT++.";
+ prop.setLanguageKey("gtpp.disableAllLogging").setRequiresMcRestart(false);
+ disableAllLogging = prop.getBoolean(true);
+ propOrderDebug.add(prop.getName());
+
+ prop = config.get("debug", "debugMode", false);
+ prop.comment = "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)";
+ prop.setLanguageKey("gtpp.debugMode").setRequiresMcRestart(false);
+ debugMode = prop.getBoolean(false);
+ propOrderDebug.add(prop.getName());
+
+ prop = config.get("debug", "enabledFixEntitySetHealth", false);
+ prop.comment = "Enable/Disable entity setHealth() fix.";
+ prop.setLanguageKey("gtpp.enabledFixEntitySetHealth").setRequiresMcRestart(true);
+ enabledFixEntitySetHealth = prop.getBoolean(false);
+ propOrderDebug.add(prop.getName());
+
+ prop = config.get("debug", "enableChunkDebugging", false);
+ prop.comment = "Enable/Disable Chunk Debugging Features, Must Be enabled on Client and Server.";
+ prop.setLanguageKey("gtpp.enableChunkDebugging").setRequiresMcRestart(true);
+ enableChunkDebugging = prop.getBoolean(false);
+ propOrderDebug.add(prop.getName());
+
+ prop = config.get("debug", "enableGtNbtFix", true);
+ prop.comment = "Enable/Disable GT NBT Persistency Fix";
+ prop.setLanguageKey("gtpp.enableGtNbtFix").setRequiresMcRestart(true);
+ enableGtNbtFix = prop.getBoolean(true);
+ propOrderDebug.add(prop.getName());
+
+ prop = config.get("debug", "enableCofhPatch", false);
+ prop.comment = "Enable/Disable COFH OreDictionaryArbiter Patch (Useful for Development)";
+ prop.setLanguageKey("gtpp.enableCofhPatch").setRequiresMcRestart(true);
+ enableCofhPatch = prop.getBoolean(false);
+ propOrderDebug.add(prop.getName());
+
+ prop = config.get("debug", "enableOreDictPatch", false);
+ prop.comment = "Enable/Disable Forge OreDictionary Patch (Useful for Development)";
+ prop.setLanguageKey("gtpp.enableOreDictPatch").setRequiresMcRestart(true);
+ enableOreDictPatch = prop.getBoolean(false);
+ propOrderDebug.add(prop.getName());
+
+ prop = config.get("debug", "enableThaumicTinkererRepairFix", false);
+ prop.comment = "Enable/Disable Patch for Thaumic Repairer";
+ prop.setLanguageKey("gtpp.enableThaumicTinkererRepairFix").setRequiresMcRestart(true);
+ enableThaumicTinkererRepairFix = prop.getBoolean(false);
+ propOrderDebug.add(prop.getName());
+
+ // General Features
+ prop = config.get("general", "enableTiConFluidLighting", true);
+ prop.comment = "Enable/Disable Brightness Visuals for Tinkers Fluids, only required on the Client.";
+ prop.setLanguageKey("gtpp.enableTiConFluidLighting").setRequiresMcRestart(true);
+ enableTiConFluidLighting = prop.getBoolean(true);
+ propOrder.add(prop.getName());
+
+ prop = config.get("general", "enabledLwjglKeybindingFix", true);
+ prop.comment =
+ "Prevents the game crashing from having invalid keybinds. https://github.com/alkcorp/GTplusplus/issues/544";
+ prop.setLanguageKey("gtpp.enabledLwjglKeybindingFix").setRequiresMcRestart(true);
+ enabledLwjglKeybindingFix = prop.getBoolean(true);
+ propOrder.add(prop.getName());
+
+ prop = config.get("general", "enableGtTooltipFix", true);
+ prop.comment = "Enable/Disable Custom GT Tooltips";
+ prop.setLanguageKey("gtpp.enableGtTooltipFix").setRequiresMcRestart(true);
+ enableGtTooltipFix = prop.getBoolean(true);
+ propOrder.add(prop.getName());
+
+ prop = config.get("general", "enableGtCharcoalPitFix", true);
+ prop.comment = "Makes the Charcoal Pile Igniter work better.";
+ prop.setLanguageKey("gtpp.enableGtCharcoalPitFix").setRequiresMcRestart(true);
+ enableGtCharcoalPitFix = prop.getBoolean(true);
+ propOrder.add(prop.getName());
+
+ prop = config.get("general", "enableGcFuelChanges", true);
+ prop.comment = "Enable/Disable changes to Galacticraft Rocket Fuels.";
+ prop.setLanguageKey("gtpp.enableGcFuelChanges").setRequiresMcRestart(true);
+ // Disabled because Broken
+ // enableGcFuelChanges = prop.getBoolean(true);
+ enableGcFuelChanges = false;
+ propOrder.add(prop.getName());
+
+ // Railcraft Tank fix
+ prop = config.get("general", "enableRcFlowFix", true);
+ prop.comment = "Allows Custom max IO rates on RC tanks";
+ prop.setLanguageKey("gtpp.enableRcFlowFix").setRequiresMcRestart(true);
+ enableRcFlowFix = prop.getBoolean(true);
+ propOrder.add(prop.getName());
+
+ prop = config.get("general", "maxRailcraftTankProcessVolume", 4000);
+ prop.comment = "Max IO for RC fluid tanks (Not Carts). 'enableRcFlowFix' Must be enabled.";
+ prop.setLanguageKey("gtpp.maxRailcraftTankProcessVolume").setRequiresMcRestart(true);
+ maxRailcraftTankProcessVolume = prop.getInt(4000);
+ propOrder.add(prop.getName());
+
+ // Railcraft Loader Max flowrate
+ prop = config.get("general", "maxRailcraftFluidLoaderFlow", 20);
+ prop.comment = "Max Output rate for RC Fluid Loaders";
+ prop.setLanguageKey("gtpp.maxRailcraftFluidLoaderFlow").setRequiresMcRestart(true);
+ maxRailcraftFluidLoaderFlow = prop.getInt(20);
+ propOrder.add(prop.getName());
+
+ // Railcraft Unloader Max flowrate
+ prop = config.get("general", "maxRailcraftFluidUnloaderFlow", 80);
+ prop.comment = "Max Output rate for RC Fluid Unloaders";
+ prop.setLanguageKey("gtpp.maxRailcraftFluidUnloaderFlow").setRequiresMcRestart(true);
+ maxRailcraftFluidUnloaderFlow = prop.getInt(80);
+ propOrder.add(prop.getName());
+
+ // Railcraft Dupe Fix
+ prop = config.get("general", "enableRcItemDupeFix", true);
+ prop.comment = "Fixes possible negative itemstacks";
+ prop.setLanguageKey("gtpp.enableRcItemDupeFix").setRequiresMcRestart(true);
+ enableRcItemDupeFix = prop.getBoolean(true);
+ propOrder.add(prop.getName());
+
+ // TC Aspect Safety
+ prop = config.get("general", "enableTcAspectSafety", true);
+ prop.comment = "Fixes small oversights in Thaumcraft 4.";
+ prop.setLanguageKey("gtpp.enableTcAspectSafety").setRequiresMcRestart(true);
+ enableTcAspectSafety = prop.getBoolean(true);
+ propOrder.add(prop.getName());
+
+ config.setCategoryPropertyOrder("general", propOrder);
+ config.setCategoryPropertyOrder("debug", propOrderDebug);
+ if (config.hasChanged()) {
+ config.save();
+ }
+
+ Preloader_Logger.INFO("Chunk Debugging - Enabled: " + enableChunkDebugging);
+ Preloader_Logger.INFO("Gt Nbt Fix - Enabled: " + enableGtNbtFix);
+ Preloader_Logger.INFO("TiCon Fluid Lighting - Enabled: " + enableTiConFluidLighting);
+ Preloader_Logger.INFO("Gt Tooltip Fix - Enabled: " + enableGtTooltipFix);
+ Preloader_Logger.INFO("COFH Patch - Enabled: " + enableCofhPatch);
+ Preloader_Logger.INFO("Gc Fuel Changes Patch - Enabled: " + enableGcFuelChanges);
+ Preloader_Logger.INFO("Railcraft Fluid Flow Patch - Enabled: " + enableRcFlowFix);
+ Preloader_Logger.INFO("Thaumcraft Aspect Safety Patch - Enabled: " + enableTcAspectSafety);
+ Preloader_Logger.INFO(
+ "Fix bad usage of EntityLivingBase.setHealth Patch - Enabled: " + enabledFixEntitySetHealth);
+
+ } catch (Exception var3) {
+ FMLLog.log(Level.ERROR, var3, "GT++ ASM had a problem loading it's config", new Object[0]);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/ClassesToTransform.java b/src/main/java/gtPlusPlus/preloader/asm/ClassesToTransform.java
index 1dcbff439f..c1cd281f09 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/ClassesToTransform.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/ClassesToTransform.java
@@ -2,73 +2,72 @@ package gtPlusPlus.preloader.asm;
public class ClassesToTransform {
-
- public static final String LWJGL_KEYBOARD = "org.lwjgl.input.Keyboard";
-
-
- public static final String MINECRAFT_GAMESETTINGS = "net.minecraft.client.settings.GameSettings";
- public static final String MINECRAFT_GAMESETTINGS_OBF = "bbj";
-
-
- public static final String FORGE_CHUNK_MANAGER = "net.minecraftforge.common.ForgeChunkManager";
- public static final String FORGE_ORE_DICTIONARY = "net.minecraftforge.oredict.OreDictionary";
-
-
- public static final String COFH_ORE_DICTIONARY_ARBITER = "cofh.core.util.oredict.OreDictionaryArbiter";
-
-
- public static final String TINKERS_FLUID_BLOCK = "tconstruct.smeltery.blocks.TConstructFluid";
-
-
- public static final String RAILCRAFT_FLUID_HELPER = "mods.railcraft.common.fluids.FluidHelper";
- public static final String RAILCRAFT_TILE_FLUID_LOADER = "mods.railcraft.common.blocks.machine.gamma.TileFluidLoader";
- public static final String RAILCRAFT_INVENTORY_TOOLS = "mods.railcraft.common.util.inventory.InvTools";
-
-
- public static final String GALACTICRAFT_FLUID_UTILS = "micdoodle8.mods.galacticraft.core.util.FluidUtil";
- public static final String GALACTICRAFT_TILE_ENTITY_FUEL_LOADER = "micdoodle8.mods.galacticraft.core.tile.TileEntityFuelLoader";
- public static final String GALACTICRAFT_ENTITY_AUTO_ROCKET = "micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket";
-
-
- public static final String GT_UTILITY = "gregtech.api.util.GT_Utility";
- public static final String GT_ACHIEVEMENTS = "gregtech.loaders.misc.GT_Achievements";
- public static final String GT_CLIENT_PROXY = "gregtech.common.GT_Client";
- public static final String GT_PACKET_TILE_ENTITY = "gregtech.api.net.GT_Packet_TileEntity";
- public static final String GT_BASE_META_TILE_ENTITY = "gregtech.api.metatileentity.BaseMetaTileEntity";
- public static final String GT_MTE_CHARCOAL_PIT = "gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Charcoal_Pit";
- public static final String GT_ITEM_MACHINES = "gregtech.common.blocks.GT_Item_Machines";
- public static final String GT_METAGENERATED_TOOL = "gregtech.api.items.GT_MetaGenerated_Tool";
- public static final String GT_BLOCK_MACHINES = "gregtech.common.blocks.GT_Block_Machines";
- public static final String GT_MTE_HATCH_ENERGY = "gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy";
- public static final String GT_METAPIPE_ITEM = "gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item";
- public static final String GT_METAPIPE_FLUID = "gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid";
- public static final String GT_METAPIPE_FRAME = "gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame";
-
-
- public static final String GTPP_MTE_HATCH_RTG = "gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG";
-
-
- public static final String THAUMCRAFT_ITEM_WISP_ESSENCE = "thaumcraft.common.items.ItemWispEssence";
- public static final String THAUMCRAFT_CRAFTING_MANAGER = "thaumcraft.common.lib.crafting.ThaumcraftCraftingManager";
- public static final String THAUMCRAFT_TILE_ALCHEMY_FURNACE = "thaumcraft.common.tiles.TileAlchemyFurnace";
- public static final String THAUMICTINKERER_TILE_REPAIRER = "thaumic.tinkerer.common.block.tile.TileRepairer";
-
- public static final String IC2_ITEM_ARMOUR_HAZMAT = "ic2.core.item.armor.ItemArmorHazmat";
- public static final String IC2_BLOCK_BASE_TILE_ENTITY = "ic2.core.block.BlockTileEntity";
- public static final String IC2_BLOCK_MACHINE1 = "ic2.core.block.machine.BlockMachine";
- public static final String IC2_BLOCK_MACHINE2 = "ic2.core.block.machine.BlockMachine2";
- public static final String IC2_BLOCK_MACHINE3 = "ic2.core.block.machine.BlockMachine3";
- public static final String IC2_BLOCK_KINETIC_GENERATOR = "ic2.core.block.kineticgenerator.block.BlockKineticGenerator";
- public static final String IC2_BLOCK_HEAT_GENERATOR = "ic2.core.block.heatgenerator.block.BlockHeatGenerator";
- public static final String IC2_BLOCK_GENERATOR = "ic2.core.block.generator.block.BlockGenerator";
- public static final String IC2_BLOCK_REACTOR_ACCESS_HATCH = "ic2.core.block.reactor.block.BlockReactorAccessHatch";
- public static final String IC2_BLOCK_REACTOR_CHAMBER = "ic2.core.block.reactor.block.BlockReactorChamber";
- public static final String IC2_BLOCK_REACTOR_FLUID_PORT = "ic2.core.block.reactor.block.BlockReactorFluidPort";
- public static final String IC2_BLOCK_REACTOR_REDSTONE_PORT = "ic2.core.block.reactor.block.BlockReactorRedstonePort";
- public static final String IC2_BLOCK_REACTOR_VESSEL = "ic2.core.block.reactor.block.BlockReactorVessel";
- public static final String IC2_BLOCK_PERSONAL = "ic2.core.block.personal.BlockPersonal.class";
- public static final String IC2_BLOCK_CHARGEPAD = "ic2.core.block.wiring.BlockChargepad.class";
- public static final String IC2_BLOCK_ELECTRIC = "ic2.core.block.wiring.BlockElectric.class";
- public static final String IC2_BLOCK_LUMINATOR = "ic2.core.block.wiring.BlockLuminator.class";
-
+ public static final String LWJGL_KEYBOARD = "org.lwjgl.input.Keyboard";
+
+ public static final String MINECRAFT_GAMESETTINGS = "net.minecraft.client.settings.GameSettings";
+ public static final String MINECRAFT_GAMESETTINGS_OBF = "bbj";
+
+ public static final String FORGE_CHUNK_MANAGER = "net.minecraftforge.common.ForgeChunkManager";
+ public static final String FORGE_ORE_DICTIONARY = "net.minecraftforge.oredict.OreDictionary";
+
+ public static final String COFH_ORE_DICTIONARY_ARBITER = "cofh.core.util.oredict.OreDictionaryArbiter";
+
+ public static final String TINKERS_FLUID_BLOCK = "tconstruct.smeltery.blocks.TConstructFluid";
+
+ public static final String RAILCRAFT_FLUID_HELPER = "mods.railcraft.common.fluids.FluidHelper";
+ public static final String RAILCRAFT_TILE_FLUID_LOADER =
+ "mods.railcraft.common.blocks.machine.gamma.TileFluidLoader";
+ public static final String RAILCRAFT_INVENTORY_TOOLS = "mods.railcraft.common.util.inventory.InvTools";
+
+ public static final String GALACTICRAFT_FLUID_UTILS = "micdoodle8.mods.galacticraft.core.util.FluidUtil";
+ public static final String GALACTICRAFT_TILE_ENTITY_FUEL_LOADER =
+ "micdoodle8.mods.galacticraft.core.tile.TileEntityFuelLoader";
+ public static final String GALACTICRAFT_ENTITY_AUTO_ROCKET =
+ "micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket";
+
+ public static final String GT_UTILITY = "gregtech.api.util.GT_Utility";
+ public static final String GT_ACHIEVEMENTS = "gregtech.loaders.misc.GT_Achievements";
+ public static final String GT_CLIENT_PROXY = "gregtech.common.GT_Client";
+ public static final String GT_PACKET_TILE_ENTITY = "gregtech.api.net.GT_Packet_TileEntity";
+ public static final String GT_BASE_META_TILE_ENTITY = "gregtech.api.metatileentity.BaseMetaTileEntity";
+ public static final String GT_MTE_CHARCOAL_PIT =
+ "gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Charcoal_Pit";
+ public static final String GT_ITEM_MACHINES = "gregtech.common.blocks.GT_Item_Machines";
+ public static final String GT_METAGENERATED_TOOL = "gregtech.api.items.GT_MetaGenerated_Tool";
+ public static final String GT_BLOCK_MACHINES = "gregtech.common.blocks.GT_Block_Machines";
+ public static final String GT_MTE_HATCH_ENERGY =
+ "gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy";
+ public static final String GT_METAPIPE_ITEM = "gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item";
+ public static final String GT_METAPIPE_FLUID =
+ "gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid";
+ public static final String GT_METAPIPE_FRAME =
+ "gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame";
+
+ public static final String GTPP_MTE_HATCH_RTG =
+ "gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG";
+
+ public static final String THAUMCRAFT_ITEM_WISP_ESSENCE = "thaumcraft.common.items.ItemWispEssence";
+ public static final String THAUMCRAFT_CRAFTING_MANAGER = "thaumcraft.common.lib.crafting.ThaumcraftCraftingManager";
+ public static final String THAUMCRAFT_TILE_ALCHEMY_FURNACE = "thaumcraft.common.tiles.TileAlchemyFurnace";
+ public static final String THAUMICTINKERER_TILE_REPAIRER = "thaumic.tinkerer.common.block.tile.TileRepairer";
+
+ public static final String IC2_ITEM_ARMOUR_HAZMAT = "ic2.core.item.armor.ItemArmorHazmat";
+ public static final String IC2_BLOCK_BASE_TILE_ENTITY = "ic2.core.block.BlockTileEntity";
+ public static final String IC2_BLOCK_MACHINE1 = "ic2.core.block.machine.BlockMachine";
+ public static final String IC2_BLOCK_MACHINE2 = "ic2.core.block.machine.BlockMachine2";
+ public static final String IC2_BLOCK_MACHINE3 = "ic2.core.block.machine.BlockMachine3";
+ public static final String IC2_BLOCK_KINETIC_GENERATOR =
+ "ic2.core.block.kineticgenerator.block.BlockKineticGenerator";
+ public static final String IC2_BLOCK_HEAT_GENERATOR = "ic2.core.block.heatgenerator.block.BlockHeatGenerator";
+ public static final String IC2_BLOCK_GENERATOR = "ic2.core.block.generator.block.BlockGenerator";
+ public static final String IC2_BLOCK_REACTOR_ACCESS_HATCH = "ic2.core.block.reactor.block.BlockReactorAccessHatch";
+ public static final String IC2_BLOCK_REACTOR_CHAMBER = "ic2.core.block.reactor.block.BlockReactorChamber";
+ public static final String IC2_BLOCK_REACTOR_FLUID_PORT = "ic2.core.block.reactor.block.BlockReactorFluidPort";
+ public static final String IC2_BLOCK_REACTOR_REDSTONE_PORT =
+ "ic2.core.block.reactor.block.BlockReactorRedstonePort";
+ public static final String IC2_BLOCK_REACTOR_VESSEL = "ic2.core.block.reactor.block.BlockReactorVessel";
+ public static final String IC2_BLOCK_PERSONAL = "ic2.core.block.personal.BlockPersonal.class";
+ public static final String IC2_BLOCK_CHARGEPAD = "ic2.core.block.wiring.BlockChargepad.class";
+ public static final String IC2_BLOCK_ELECTRIC = "ic2.core.block.wiring.BlockElectric.class";
+ public static final String IC2_BLOCK_LUMINATOR = "ic2.core.block.wiring.BlockLuminator.class";
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/Preloader_DummyContainer.java b/src/main/java/gtPlusPlus/preloader/asm/Preloader_DummyContainer.java
index 2a0082754a..0992949311 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/Preloader_DummyContainer.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/Preloader_DummyContainer.java
@@ -1,11 +1,7 @@
package gtPlusPlus.preloader.asm;
-import java.io.File;
-import java.util.Arrays;
-
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
-
import cpw.mods.fml.common.DummyModContainer;
import cpw.mods.fml.common.LoadController;
import cpw.mods.fml.common.ModMetadata;
@@ -15,81 +11,102 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.preloader.Preloader_Logger;
+import java.io.File;
+import java.util.Arrays;
import net.minecraftforge.common.config.Configuration;
public class Preloader_DummyContainer extends DummyModContainer {
- public Preloader_DummyContainer() {
- super(new ModMetadata());
- ModMetadata meta = getMetadata();
- meta.modId = CORE_Preloader.MODID;
- meta.name = CORE_Preloader.NAME;
- meta.version = CORE_Preloader.VERSION;
- meta.credits = "Roll Credits ...";
- meta.authorList = Arrays.asList("Alkalus");
- meta.description = "";
- meta.url = "";
- meta.updateUrl = "";
- meta.screenshots = new String[0];
- meta.logoFile = "";
- //meta.dependencies = (List<ArtifactVersion>) CORE_Preloader.DEPENDENCIES;
- Preloader_Logger.INFO("Initializing DummyModContainer");
+ public Preloader_DummyContainer() {
+ super(new ModMetadata());
+ ModMetadata meta = getMetadata();
+ meta.modId = CORE_Preloader.MODID;
+ meta.name = CORE_Preloader.NAME;
+ meta.version = CORE_Preloader.VERSION;
+ meta.credits = "Roll Credits ...";
+ meta.authorList = Arrays.asList("Alkalus");
+ meta.description = "";
+ meta.url = "";
+ meta.updateUrl = "";
+ meta.screenshots = new String[0];
+ meta.logoFile = "";
+ // meta.dependencies = (List<ArtifactVersion>) CORE_Preloader.DEPENDENCIES;
+ Preloader_Logger.INFO("Initializing DummyModContainer");
+ }
+
+ @Override
+ public boolean registerBus(EventBus bus, LoadController controller) {
+ bus.register(this);
+ return true;
+ }
+
+ @Subscribe
+ public void modConstruction(FMLConstructionEvent evt) {
+ Preloader_Logger.INFO("Constructing DummyModContainer");
+ }
+
+ @Subscribe
+ public void preInit(FMLPreInitializationEvent event) {
+ Preloader_Logger.INFO("Loading " + CORE_Preloader.MODID + " V" + CORE_Preloader.VERSION);
+ // Handle GT++ Config
+ handleConfigFile(event);
+ }
- }
-
- @Override
- public boolean registerBus(EventBus bus, LoadController controller) {
- bus.register(this);
- return true;
- }
+ @Subscribe
+ public void init(FMLInitializationEvent evt) {
+ Preloader_Logger.INFO("Begin resource allocation for " + CORE_Preloader.MODID + " V" + CORE_Preloader.VERSION);
+ }
- @Subscribe
- public void modConstruction(FMLConstructionEvent evt){
- Preloader_Logger.INFO("Constructing DummyModContainer");
+ @Subscribe
+ public void postInit(FMLPostInitializationEvent evt) {
+ Preloader_Logger.INFO("Finished loading.");
+ }
- }
-
- @Subscribe
- public void preInit(FMLPreInitializationEvent event) {
- Preloader_Logger.INFO("Loading " + CORE_Preloader.MODID + " V" + CORE_Preloader.VERSION);
- // Handle GT++ Config
- handleConfigFile(event);
- }
+ public static void handleConfigFile(final FMLPreInitializationEvent event) {
+ final Configuration config =
+ new Configuration(new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg"));
+ config.load();
- @Subscribe
- public void init(FMLInitializationEvent evt) {
- Preloader_Logger.INFO("Begin resource allocation for " + CORE_Preloader.MODID + " V" + CORE_Preloader.VERSION);
+ // BGM Watchdog
+ CORE_Preloader.enableWatchdogBGM = config.getInt(
+ "enableWatchdogBGM",
+ "features",
+ 0,
+ 0,
+ Short.MAX_VALUE,
+ "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s.");
- }
+ // Circuits
+ CORE_Preloader.enableOldGTcircuits = config.getBoolean(
+ "enableOldGTcircuits",
+ "gregtech",
+ false,
+ "Restores circuits and their recipes from Pre-5.09.28 times.");
+ }
- @Subscribe
- public void postInit(FMLPostInitializationEvent evt) {
- Preloader_Logger.INFO("Finished loading.");
- }
-
- public static void handleConfigFile(final FMLPreInitializationEvent event) {
- final Configuration config = new Configuration(new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg"));
- config.load();
+ public static boolean getConfig() {
+ final Configuration config = new Configuration(
+ new File(gtPlusPlus.preloader.CORE_Preloader.MC_DIR, "config/GTplusplus/GTplusplus.cfg"));
+ if (config != null) {
+ config.load();
+ // Circuits
+ CORE_Preloader.enableOldGTcircuits = config.getBoolean(
+ "enableOldGTcircuits",
+ "gregtech",
+ false,
+ "Restores circuits and their recipes from Pre-5.09.28 times.");
+ CORE_Preloader.enableWatchdogBGM = config.getInt(
+ "enableWatchdogBGM",
+ "features",
+ 0,
+ 0,
+ Short.MAX_VALUE,
+ "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s.");
- //BGM Watchdog
- CORE_Preloader.enableWatchdogBGM = config.getInt("enableWatchdogBGM", "features", 0, 0, Short.MAX_VALUE, "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s.");
-
- // Circuits
- CORE_Preloader.enableOldGTcircuits = config.getBoolean("enableOldGTcircuits", "gregtech", false, "Restores circuits and their recipes from Pre-5.09.28 times.");
- }
-
- public static boolean getConfig(){
- final Configuration config = new Configuration( new File(gtPlusPlus.preloader.CORE_Preloader.MC_DIR, "config/GTplusplus/GTplusplus.cfg"));
- if (config != null){
- config.load();
- // Circuits
- CORE_Preloader.enableOldGTcircuits = config.getBoolean("enableOldGTcircuits", "gregtech", false, "Restores circuits and their recipes from Pre-5.09.28 times.");
- CORE_Preloader.enableWatchdogBGM = config.getInt("enableWatchdogBGM", "features", 0, 0, Short.MAX_VALUE, "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s.");
-
- Preloader_Logger.INFO("Loaded the configuration file.");
- return true;
- }
- Preloader_Logger.INFO("Failed loading the configuration file.");
- return false;
- }
-} \ No newline at end of file
+ Preloader_Logger.INFO("Loaded the configuration file.");
+ return true;
+ }
+ Preloader_Logger.INFO("Failed loading the configuration file.");
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java b/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java
index fd07fd1bbe..90cf1b9e10 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java
@@ -1,87 +1,84 @@
package gtPlusPlus.preloader.asm;
-import java.io.File;
-import java.text.NumberFormat;
-import java.util.Locale;
-import java.util.Map;
-
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.SortingIndex;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.preloader.Preloader_Logger;
import gtPlusPlus.preloader.asm.transformers.Preloader_Transformer_Handler;
+import java.io.File;
+import java.text.NumberFormat;
+import java.util.Locale;
+import java.util.Map;
import net.minecraft.launchwrapper.Launch;
-@SortingIndex(10097)
+@SortingIndex(10097)
@MCVersion(value = "1.7.10")
@IFMLLoadingPlugin.TransformerExclusions("gtPlusPlus.preloader")
@IFMLLoadingPlugin.Name(CORE_Preloader.NAME)
-public class Preloader_FMLLoadingPlugin implements IFMLLoadingPlugin {
+public class Preloader_FMLLoadingPlugin implements IFMLLoadingPlugin {
+
+ // -Dfml.coreMods.load=gtPlusPlus.preloader.asm.Preloader_FMLLoadingPlugin
- //-Dfml.coreMods.load=gtPlusPlus.preloader.asm.Preloader_FMLLoadingPlugin
-
- static {
- Preloader_Logger.INFO("Initializing IFMLLoadingPlugin");
- }
-
- @Override
- public String getAccessTransformerClass() {
- return null;
- }
+ static {
+ Preloader_Logger.INFO("Initializing IFMLLoadingPlugin");
+ }
- @Override
- public String[] getASMTransformerClass() {
- //This will return the name of the class
- return new String[]{
- Preloader_Transformer_Handler.class.getName()
- };
- }
+ @Override
+ public String getAccessTransformerClass() {
+ return null;
+ }
- @Override
- public String getModContainerClass() {
- //This is the name of our dummy container
- return Preloader_DummyContainer.class.getName();
- }
+ @Override
+ public String[] getASMTransformerClass() {
+ // This will return the name of the class
+ return new String[] {Preloader_Transformer_Handler.class.getName()};
+ }
- @Override
- public String getSetupClass() {
- //return Preloader_SetupClass.class.getName();
- return null;
- }
+ @Override
+ public String getModContainerClass() {
+ // This is the name of our dummy container
+ return Preloader_DummyContainer.class.getName();
+ }
- @Override
- public void injectData(Map<String, Object> data) {
- boolean isDeObf = (boolean) data.get("runtimeDeobfuscationEnabled");
+ @Override
+ public String getSetupClass() {
+ // return Preloader_SetupClass.class.getName();
+ return null;
+ }
+
+ @Override
+ public void injectData(Map<String, Object> data) {
+ boolean isDeObf = (boolean) data.get("runtimeDeobfuscationEnabled");
File mcDir = (File) data.get("mcLocation");
- //LaunchClassLoader classLoader = (LaunchClassLoader) data.get("classLoader");
+ // LaunchClassLoader classLoader = (LaunchClassLoader) data.get("classLoader");
File coremodLocation = (File) data.get("coremodLocation");
String deobfuscationFileName = (String) data.get("deobfuscationFileName");
if (mcDir != null && mcDir.exists()) {
- CORE_Preloader.setMinecraftDirectory(mcDir);
- Preloader_Logger.INFO("Set McDir via Preloader_SetupClass");
+ CORE_Preloader.setMinecraftDirectory(mcDir);
+ Preloader_Logger.INFO("Set McDir via Preloader_SetupClass");
}
- Preloader_Logger.INFO("runtimeDeobfuscationEnabled: "+isDeObf);
- Preloader_Logger.INFO("deobfuscationFileName: "+deobfuscationFileName);
+ Preloader_Logger.INFO("runtimeDeobfuscationEnabled: " + isDeObf);
+ Preloader_Logger.INFO("deobfuscationFileName: " + deobfuscationFileName);
if (coremodLocation != null && coremodLocation.exists()) {
- Preloader_Logger.INFO("coremodLocation: "+coremodLocation.getPath());
- }
- else {
- Preloader_Logger.INFO("coremodLocation: null");
- Preloader_Logger.ERROR("Unable to determine CoreMod location");
+ Preloader_Logger.INFO("coremodLocation: " + coremodLocation.getPath());
+ } else {
+ Preloader_Logger.INFO("coremodLocation: null");
+ Preloader_Logger.ERROR("Unable to determine CoreMod location");
}
CORE_Preloader.DEV_ENVIRONMENT = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
CORE_Preloader.DEBUG_MODE = AsmConfig.debugMode;
- Preloader_Logger.INFO("Running on "+gtPlusPlus.preloader.CORE_Preloader.JAVA_VERSION+" | Development Environment: "+CORE_Preloader.DEV_ENVIRONMENT);
- //Preloader_Logger.INFO("Is Client? "+Utils.isClient()+" | Is Server? "+Utils.isServer());
+ Preloader_Logger.INFO("Running on " + gtPlusPlus.preloader.CORE_Preloader.JAVA_VERSION
+ + " | Development Environment: " + CORE_Preloader.DEV_ENVIRONMENT);
+ // Preloader_Logger.INFO("Is Client? "+Utils.isClient()+" | Is Server? "+Utils.isServer());
Locale aDefaultLocale = Locale.getDefault();
NumberFormat aFormat = NumberFormat.getInstance();
- Locale aDisplayLocale = ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultDisplayLocale"));
- Locale aFormatLocale = ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultFormatLocale"));
- Preloader_Logger.INFO("Locale: "+aDefaultLocale+" | Test: "+aFormat.format(1000000000)+" | Display: "+aDisplayLocale+" | Format: "+aFormatLocale);
- }
-
-} \ No newline at end of file
+ Locale aDisplayLocale =
+ ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultDisplayLocale"));
+ Locale aFormatLocale =
+ ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultFormatLocale"));
+ Preloader_Logger.INFO("Locale: " + aDefaultLocale + " | Test: " + aFormat.format(1000000000) + " | Display: "
+ + aDisplayLocale + " | Format: " + aFormatLocale);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/Preloader_SetupClass.java b/src/main/java/gtPlusPlus/preloader/asm/Preloader_SetupClass.java
index a6d2b6c863..d48e191054 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/Preloader_SetupClass.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/Preloader_SetupClass.java
@@ -1,23 +1,17 @@
package gtPlusPlus.preloader.asm;
-import java.io.File;
-import java.util.Map;
-
import cpw.mods.fml.relauncher.IFMLCallHook;
-import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.preloader.Preloader_Logger;
+import java.util.Map;
public class Preloader_SetupClass implements IFMLCallHook {
- @Override
- public Void call() throws Exception {
- Preloader_Logger.INFO("Executing IFMLCallHook");
- return null;
- }
-
- @Override
- public void injectData(Map<String, Object> data) {
-
- }
+ @Override
+ public Void call() throws Exception {
+ Preloader_Logger.INFO("Executing IFMLCallHook");
+ return null;
+ }
+ @Override
+ public void injectData(Map<String, Object> data) {}
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_CC.java b/src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_CC.java
index 664ffe7b2d..baffcd5e78 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_CC.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_CC.java
@@ -6,23 +6,23 @@ import net.minecraft.client.gui.inventory.GuiContainer;
public class MethodHelper_CC {
-
public void mouseUp2(int mousex, int mousey, int button) {
- MethodHelper_CC.mouseUp(mousex, mousey, button);
+ MethodHelper_CC.mouseUp(mousex, mousey, button);
}
-
+
public static void mouseUp(int mousex, int mousey, int button) {
- GuiContainerManager aManager = codechicken.nei.guihook.GuiContainerManager.getManager();
- if (aManager != null) {
- GuiContainer aWindow = aManager.window;
- for (IContainerInputHandler inputhander : GuiContainerManager.inputHandlers) {
- //Preloader_Logger.INFO("Found Handler: "+aWindow.getClass().getName() + " | "+inputhander.getClass().getName());
+ GuiContainerManager aManager = codechicken.nei.guihook.GuiContainerManager.getManager();
+ if (aManager != null) {
+ GuiContainer aWindow = aManager.window;
+ for (IContainerInputHandler inputhander : GuiContainerManager.inputHandlers) {
+ // Preloader_Logger.INFO("Found Handler: "+aWindow.getClass().getName() + " |
+ // "+inputhander.getClass().getName());
}
for (IContainerInputHandler inputhander : GuiContainerManager.inputHandlers) {
- //Preloader_Logger.INFO("Trying to handle events for "+aWindow.getClass().getName() + " | "+inputhander.getClass().getName());
- inputhander.onMouseUp(aWindow, mousex, mousey, button);
+ // Preloader_Logger.INFO("Trying to handle events for "+aWindow.getClass().getName() + " |
+ // "+inputhander.getClass().getName());
+ inputhander.onMouseUp(aWindow, mousex, mousey, button);
}
- }
+ }
}
-
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_GT.java b/src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_GT.java
index 8120df81fa..ab53e93ae7 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_GT.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/helpers/MethodHelper_GT.java
@@ -1,25 +1,24 @@
package gtPlusPlus.preloader.asm.helpers;
-import java.util.List;
-
import gregtech.api.enums.Materials;
import gregtech.api.items.GT_MetaGenerated_Tool;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class MethodHelper_GT {
- public static final void getSubItems(GT_MetaGenerated_Tool aTool, Item var1, CreativeTabs aCreativeTab, List aList) {
- for (int i = 0; i < 32766; i += 2) {
- if (aTool.getToolStats(new ItemStack(aTool, 1, i)) != null) {
- ItemStack tStack = new ItemStack(aTool, 1, i);
- aTool.isItemStackUsable(tStack);
- aList.add(tStack);
- aList.add(aTool.getToolWithStats(i,1,Materials.TungstenSteel,Materials.TungstenSteel,null));
- aList.add(aTool.getToolWithStats(i,1,Materials.Neutronium,Materials.Neutronium,null));
- }
- }
- }
-
+ public static final void getSubItems(
+ GT_MetaGenerated_Tool aTool, Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0; i < 32766; i += 2) {
+ if (aTool.getToolStats(new ItemStack(aTool, 1, i)) != null) {
+ ItemStack tStack = new ItemStack(aTool, 1, i);
+ aTool.isItemStackUsable(tStack);
+ aList.add(tStack);
+ aList.add(aTool.getToolWithStats(i, 1, Materials.TungstenSteel, Materials.TungstenSteel, null));
+ aList.add(aTool.getToolWithStats(i, 1, Materials.Neutronium, Materials.Neutronium, null));
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_CC_GuiContainerManager.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_CC_GuiContainerManager.java
index 8791d401c8..ee463d6cca 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_CC_GuiContainerManager.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_CC_GuiContainerManager.java
@@ -2,120 +2,121 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
+import gtPlusPlus.preloader.Preloader_Logger;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.*;
-import gtPlusPlus.preloader.Preloader_Logger;
-
public class ClassTransformer_CC_GuiContainerManager {
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- public ClassTransformer_CC_GuiContainerManager(byte[] basicClass) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- localClassVisitor aTempMethodRemover = new localClassVisitor(aTempWriter);
- aTempReader.accept(aTempMethodRemover, 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- } else {
- isValid = false;
- }
-
- Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Valid patch? " + isValid + ".");
- reader = aTempReader;
- writer = aTempWriter;
-
- if (reader != null && writer != null) {
- Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Attempting Method Injection.");
- injectMethod("mouseUp");
- }
-
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(String aMethodName) {
- MethodVisitor mv;
- boolean didInject = false;
- String aClassName = "codechicken/nei/guihook/GuiContainerManager";
- ClassWriter cw = getWriter();
- if (aMethodName.equals("mouseUp")) {
- Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Injecting " + aMethodName + ", static replacement call to "+aClassName+".");
- mv = cw.visitMethod(ACC_PUBLIC, "mouseUp", "(III)V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(12, l0);
- mv.visitVarInsn(ILOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/helpers/MethodHelper_CC", "mouseUp", "(III)V", false);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(13, l1);
- mv.visitInsn(RETURN);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLocalVariable("this", "L+aClassName+;", null, l0, l2, 0);
- mv.visitLocalVariable("mousex", "I", null, l0, l2, 1);
- mv.visitLocalVariable("mousey", "I", null, l0, l2, 2);
- mv.visitLocalVariable("button", "I", null, l0, l2, 3);
- mv.visitMaxs(3, 4);
- mv.visitEnd();
- didInject = true;
- }
-
- Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
-
- public final class localClassVisitor extends ClassVisitor {
-
- boolean obfuscated = false;
-
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
-
- public boolean getObfuscatedRemoval() {
- return obfuscated;
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
-
- if (name.equals("mouseUp")) {
- methodVisitor = null;
- }
- else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
-
- if (methodVisitor == null) {
- Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Found method " + name + ", removing.");
- Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Descriptor: "+desc);
- }
- return methodVisitor;
- }
- }
-
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ public ClassTransformer_CC_GuiContainerManager(byte[] basicClass) {
+
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ localClassVisitor aTempMethodRemover = new localClassVisitor(aTempWriter);
+ aTempReader.accept(aTempMethodRemover, 0);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+
+ Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Valid patch? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+
+ if (reader != null && writer != null) {
+ Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Attempting Method Injection.");
+ injectMethod("mouseUp");
+ }
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ String aClassName = "codechicken/nei/guihook/GuiContainerManager";
+ ClassWriter cw = getWriter();
+ if (aMethodName.equals("mouseUp")) {
+ Preloader_Logger.LOG(
+ "CodeChicken GuiContainerManager Patch",
+ Level.INFO,
+ "Injecting " + aMethodName + ", static replacement call to " + aClassName + ".");
+ mv = cw.visitMethod(ACC_PUBLIC, "mouseUp", "(III)V", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(12, l0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitMethodInsn(
+ INVOKESTATIC, "gtPlusPlus/preloader/asm/helpers/MethodHelper_CC", "mouseUp", "(III)V", false);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(13, l1);
+ mv.visitInsn(RETURN);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLocalVariable("this", "L+aClassName+;", null, l0, l2, 0);
+ mv.visitLocalVariable("mousex", "I", null, l0, l2, 1);
+ mv.visitLocalVariable("mousey", "I", null, l0, l2, 2);
+ mv.visitLocalVariable("button", "I", null, l0, l2, 3);
+ mv.visitMaxs(3, 4);
+ mv.visitEnd();
+ didInject = true;
+ }
+
+ Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public final class localClassVisitor extends ClassVisitor {
+
+ boolean obfuscated = false;
+
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
+
+ public boolean getObfuscatedRemoval() {
+ return obfuscated;
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+
+ if (name.equals("mouseUp")) {
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+
+ if (methodVisitor == null) {
+ Preloader_Logger.LOG(
+ "CodeChicken GuiContainerManager Patch", Level.INFO, "Found method " + name + ", removing.");
+ Preloader_Logger.LOG("CodeChicken GuiContainerManager Patch", Level.INFO, "Descriptor: " + desc);
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java
index 6f08dc4ff5..eea82c33e5 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java
@@ -7,179 +7,186 @@ import static org.objectweb.asm.Opcodes.ASM5;
import static org.objectweb.asm.Opcodes.INVOKESTATIC;
import static org.objectweb.asm.Opcodes.RETURN;
-import java.util.ArrayList;
-
-import org.apache.logging.log4j.Level;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.Label;
-import org.objectweb.asm.MethodVisitor;
-
+import cofh.core.util.oredict.OreDictionaryArbiter;
+import cofh.lib.util.ItemWrapper;
import com.google.common.base.Strings;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
-
-import cofh.core.util.oredict.OreDictionaryArbiter;
-import cofh.lib.util.ItemWrapper;
import cpw.mods.fml.relauncher.FMLRelaunchLog;
import gnu.trove.map.TMap;
import gnu.trove.map.hash.THashMap;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.DevHelper;
+import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
+import org.apache.logging.log4j.Level;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
public class ClassTransformer_COFH_OreDictionaryArbiter {
- //The qualified name of the class we plan to transform.
- private static final String className = "cofh.core.util.oredict.OreDictionaryArbiter";
- //cofh/core/util/oredict/OreDictionaryArbiter
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- public ClassTransformer_COFH_OreDictionaryArbiter(byte[] basicClass) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- reader = aTempReader;
- writer = aTempWriter;
-
- if (reader != null && writer != null) {
- injectMethod("registerOreDictionaryEntry");
- }
-
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public void injectMethod(String aMethodName) {
-
- boolean isObfuscated;
- try {
- isObfuscated = Class.forName("net.minecraft.item.ItemStack") != null ? false : true;
- } catch (ClassNotFoundException e) {
- isObfuscated = true;
- }
- String aItemStack = isObfuscated ? DevHelper.getObfuscated("net/minecraft/item/ItemStack") : "net/minecraft/item/ItemStack";
- MethodVisitor mv;
- if (aMethodName.equals("registerOreDictionaryEntry")) {
- FMLRelaunchLog.log("[GT++ ASM] COFH OreDictionaryArbiter Patch", Level.INFO, "Injecting "+aMethodName+" into "+className+". ItemStack: "+aItemStack);
- mv = getWriter().visitMethod(ACC_PUBLIC + ACC_STATIC, "registerOreDictionaryEntry", "(L"+aItemStack+";Ljava/lang/String;)V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(61, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter$FixCOFH", "registerOreDictionaryEntry", "(L"+aItemStack+";Ljava/lang/String;)V", false);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(62, l1);
- mv.visitInsn(RETURN);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLocalVariable("arg", "L"+aItemStack+";", null, l0, l2, 0);
- mv.visitLocalVariable("arg0", "Ljava/lang/String;", null, l0, l2, 1);
- mv.visitMaxs(2, 2);
- mv.visitEnd();
- }
- FMLRelaunchLog.log("[GT++ ASM] COFH OreDictionaryArbiter Patch", Level.INFO, "Method injection complete.");
-
- }
-
- public static final class localClassVisitor extends ClassVisitor {
-
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- if (name.equals("registerOreDictionaryEntry")) {
- FMLRelaunchLog.log("[GT++ ASM] COFH OreDictionaryArbiter Patch", Level.INFO, "Removing method "+name);
- return null;
- }
- MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- return methodVisitor;
- }
- }
-
-
-
-
- @SuppressWarnings("unchecked")
- public static class FixCOFH{
-
- private static BiMap<String, Integer> oreIDs;
- private static TMap<Integer, ArrayList<ItemStack>> oreStacks;
- private static TMap<ItemWrapper, ArrayList<Integer>> stackIDs;
- private static TMap<ItemWrapper, ArrayList<String>> stackNames;
-
- static {
- try {
- oreIDs = (BiMap<String, Integer>) ReflectionUtils.getField(OreDictionaryArbiter.class, "oreIDs").get(null);
- oreStacks = (TMap<Integer, ArrayList<ItemStack>>) ReflectionUtils.getField(OreDictionaryArbiter.class, "oreStacks").get(null);
- stackIDs = (TMap<ItemWrapper, ArrayList<Integer>>) ReflectionUtils.getField(OreDictionaryArbiter.class, "stackIDs").get(null);
- stackNames = (TMap<ItemWrapper, ArrayList<String>>) ReflectionUtils.getField(OreDictionaryArbiter.class, "stackNames").get(null);
- }
- catch (Throwable t) {
- oreIDs = HashBiMap.create();
- oreStacks = new THashMap<Integer, ArrayList<ItemStack>>();
- stackIDs = new THashMap<ItemWrapper, ArrayList<Integer>>();
- stackNames = new THashMap<ItemWrapper, ArrayList<String>>();
- }
- }
-
- public static void registerOreDictionaryEntry(ItemStack arg, String arg0) {
- try {
- if (arg == null) {
- return;
- }
- if (arg.getItem() != null && !Strings.isNullOrEmpty(arg0)) {
- int arg1 = OreDictionary.getOreID(arg0);
- oreIDs.put(arg0, Integer.valueOf(arg1));
- if (!oreStacks.containsKey(Integer.valueOf(arg1))) {
- oreStacks.put(Integer.valueOf(arg1), new ArrayList<ItemStack>());
- }
- ((ArrayList<ItemStack>) oreStacks.get(Integer.valueOf(arg1))).add(arg);
- ItemWrapper arg2 = ItemWrapper.fromItemStack(arg);
- if (!stackIDs.containsKey(arg2)) {
- stackIDs.put(arg2, new ArrayList<Integer>());
- stackNames.put(arg2, new ArrayList<String>());
- }
- ((ArrayList<Integer>) stackIDs.get(arg2)).add(Integer.valueOf(arg1));
- ((ArrayList<String>) stackNames.get(arg2)).add(arg0);
- }
- }
- catch (Throwable t) {
- return;
- }
- }
- }
-
-
-
-
+ // The qualified name of the class we plan to transform.
+ private static final String className = "cofh.core.util.oredict.OreDictionaryArbiter";
+ // cofh/core/util/oredict/OreDictionaryArbiter
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ public ClassTransformer_COFH_OreDictionaryArbiter(byte[] basicClass) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter), 0);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ reader = aTempReader;
+ writer = aTempWriter;
+
+ if (reader != null && writer != null) {
+ injectMethod("registerOreDictionaryEntry");
+ }
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public void injectMethod(String aMethodName) {
+
+ boolean isObfuscated;
+ try {
+ isObfuscated = Class.forName("net.minecraft.item.ItemStack") != null ? false : true;
+ } catch (ClassNotFoundException e) {
+ isObfuscated = true;
+ }
+ String aItemStack =
+ isObfuscated ? DevHelper.getObfuscated("net/minecraft/item/ItemStack") : "net/minecraft/item/ItemStack";
+ MethodVisitor mv;
+ if (aMethodName.equals("registerOreDictionaryEntry")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] COFH OreDictionaryArbiter Patch",
+ Level.INFO,
+ "Injecting " + aMethodName + " into " + className + ". ItemStack: " + aItemStack);
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "registerOreDictionaryEntry",
+ "(L" + aItemStack + ";Ljava/lang/String;)V",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(61, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter$FixCOFH",
+ "registerOreDictionaryEntry",
+ "(L" + aItemStack + ";Ljava/lang/String;)V",
+ false);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(62, l1);
+ mv.visitInsn(RETURN);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLocalVariable("arg", "L" + aItemStack + ";", null, l0, l2, 0);
+ mv.visitLocalVariable("arg0", "Ljava/lang/String;", null, l0, l2, 1);
+ mv.visitMaxs(2, 2);
+ mv.visitEnd();
+ }
+ FMLRelaunchLog.log("[GT++ ASM] COFH OreDictionaryArbiter Patch", Level.INFO, "Method injection complete.");
+ }
+
+ public static final class localClassVisitor extends ClassVisitor {
+
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ if (name.equals("registerOreDictionaryEntry")) {
+ FMLRelaunchLog.log("[GT++ ASM] COFH OreDictionaryArbiter Patch", Level.INFO, "Removing method " + name);
+ return null;
+ }
+ MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ return methodVisitor;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public static class FixCOFH {
+
+ private static BiMap<String, Integer> oreIDs;
+ private static TMap<Integer, ArrayList<ItemStack>> oreStacks;
+ private static TMap<ItemWrapper, ArrayList<Integer>> stackIDs;
+ private static TMap<ItemWrapper, ArrayList<String>> stackNames;
+
+ static {
+ try {
+ oreIDs = (BiMap<String, Integer>) ReflectionUtils.getField(OreDictionaryArbiter.class, "oreIDs")
+ .get(null);
+ oreStacks = (TMap<Integer, ArrayList<ItemStack>>)
+ ReflectionUtils.getField(OreDictionaryArbiter.class, "oreStacks")
+ .get(null);
+ stackIDs = (TMap<ItemWrapper, ArrayList<Integer>>)
+ ReflectionUtils.getField(OreDictionaryArbiter.class, "stackIDs")
+ .get(null);
+ stackNames = (TMap<ItemWrapper, ArrayList<String>>)
+ ReflectionUtils.getField(OreDictionaryArbiter.class, "stackNames")
+ .get(null);
+ } catch (Throwable t) {
+ oreIDs = HashBiMap.create();
+ oreStacks = new THashMap<Integer, ArrayList<ItemStack>>();
+ stackIDs = new THashMap<ItemWrapper, ArrayList<Integer>>();
+ stackNames = new THashMap<ItemWrapper, ArrayList<String>>();
+ }
+ }
+
+ public static void registerOreDictionaryEntry(ItemStack arg, String arg0) {
+ try {
+ if (arg == null) {
+ return;
+ }
+ if (arg.getItem() != null && !Strings.isNullOrEmpty(arg0)) {
+ int arg1 = OreDictionary.getOreID(arg0);
+ oreIDs.put(arg0, Integer.valueOf(arg1));
+ if (!oreStacks.containsKey(Integer.valueOf(arg1))) {
+ oreStacks.put(Integer.valueOf(arg1), new ArrayList<ItemStack>());
+ }
+ ((ArrayList<ItemStack>) oreStacks.get(Integer.valueOf(arg1))).add(arg);
+ ItemWrapper arg2 = ItemWrapper.fromItemStack(arg);
+ if (!stackIDs.containsKey(arg2)) {
+ stackIDs.put(arg2, new ArrayList<Integer>());
+ stackNames.put(arg2, new ArrayList<String>());
+ }
+ ((ArrayList<Integer>) stackIDs.get(arg2)).add(Integer.valueOf(arg1));
+ ((ArrayList<String>) stackNames.get(arg2)).add(arg0);
+ }
+ } catch (Throwable t) {
+ return;
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_ChunkLoading.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_ChunkLoading.java
index 19648ae60c..cfb4663734 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_ChunkLoading.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_ChunkLoading.java
@@ -2,7 +2,8 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import java.io.IOException;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.preloader.DevHelper;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -10,675 +11,1035 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.preloader.DevHelper;
-
-public class ClassTransformer_Forge_ChunkLoading {
-
- //The qualified name of the class we plan to transform.
- private static final String className = "net.minecraftforge.common.ForgeChunkManager";
- //net/minecraftforge/common/ForgeChunkManager
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- String aChunkCoordIntPair;
- String aItemStack;
- String aWorld;
- String aEntity;
+public class ClassTransformer_Forge_ChunkLoading {
- private static boolean doesMethodAlreadyExist = false;
+ // The qualified name of the class we plan to transform.
+ private static final String className = "net.minecraftforge.common.ForgeChunkManager";
+ // net/minecraftforge/common/ForgeChunkManager
- public ClassTransformer_Forge_ChunkLoading(byte[] basicClass, boolean obfuscated) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- reader = aTempReader;
- writer = aTempWriter;
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
- if (reader != null && writer != null && !doesMethodAlreadyExist) {
-
- aChunkCoordIntPair = obfuscated ? DevHelper.getObfuscated("net/minecraft/world/ChunkCoordIntPair") : "net/minecraft/world/ChunkCoordIntPair";
- aWorld = obfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
- aEntity = obfuscated ? DevHelper.getObfuscated("net/minecraft/entity/Entity") : "net/minecraft/entity/Entity";
-
- injectMethod("forceChunk");
- injectMethod("unforceChunk");
- injectMethod("requestTicket");
- injectMethod("releaseTicket");
- }
+ String aChunkCoordIntPair;
+ String aItemStack;
+ String aWorld;
+ String aEntity;
- }
+ private static boolean doesMethodAlreadyExist = false;
- public boolean isValidTransformer() {
- return isValid;
- }
+ public ClassTransformer_Forge_ChunkLoading(byte[] basicClass, boolean obfuscated) {
- public ClassReader getReader() {
- return reader;
- }
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
- public ClassWriter getWriter() {
- return writer;
- }
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter), 0);
- public void injectMethod(String aMethodName) {
- MethodVisitor mv;
- FMLRelaunchLog.log("[GT++ ASM] Chunkloading Patch", Level.INFO, "Injecting "+aMethodName+" into "+className+".");
- if (aMethodName.equals("forceChunk")) {
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ reader = aTempReader;
+ writer = aTempWriter;
- mv = getWriter().visitMethod(ACC_PUBLIC + ACC_STATIC, "forceChunk", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L"+aChunkCoordIntPair+";)V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(730, l0);
- mv.visitVarInsn(ALOAD, 0);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNULL, l1);
- mv.visitVarInsn(ALOAD, 1);
- Label l2 = new Label();
- mv.visitJumpInsn(IFNONNULL, l2);
- mv.visitLabel(l1);
- mv.visitLineNumber(732, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(RETURN);
- mv.visitLabel(l2);
- mv.visitLineNumber(734, l2);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$500", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Lnet/minecraftforge/common/ForgeChunkManager$Type;", false);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager$Type", "ENTITY", "Lnet/minecraftforge/common/ForgeChunkManager$Type;");
- Label l3 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l3);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$600", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)L"+aEntity+";", false);
- mv.visitJumpInsn(IFNONNULL, l3);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(736, l4);
- mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
- mv.visitInsn(DUP);
- mv.visitLdcInsn("Attempted to use an entity ticket to force a chunk, without an entity");
- mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>", "(Ljava/lang/String;)V", false);
- mv.visitInsn(ATHROW);
- mv.visitLabel(l3);
- mv.visitLineNumber(738, l3);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/common/ForgeChunkManager$Ticket", "isPlayerTicket", "()Z", false);
- Label l5 = new Label();
- mv.visitJumpInsn(IFEQ, l5);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "playerTickets", "Lcom/google/common/collect/SetMultimap;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEINTERFACE, "com/google/common/collect/SetMultimap", "containsValue", "(Ljava/lang/Object;)Z", true);
- Label l6 = new Label();
- mv.visitJumpInsn(IFNE, l6);
- Label l7 = new Label();
- mv.visitJumpInsn(GOTO, l7);
- mv.visitLabel(l5);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L"+aWorld+";");
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$200", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", false);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEINTERFACE, "com/google/common/collect/Multimap", "containsEntry", "(Ljava/lang/Object;Ljava/lang/Object;)Z", true);
- mv.visitJumpInsn(IFNE, l6);
- mv.visitLabel(l7);
- mv.visitLineNumber(740, l7);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitLdcInsn("The mod %s attempted to force load a chunk with an invalid ticket. This is not permitted.");
- mv.visitInsn(ICONST_1);
- mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
- mv.visitInsn(DUP);
- mv.visitInsn(ICONST_0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$200", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", false);
- mv.visitInsn(AASTORE);
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "severe", "(Ljava/lang/String;[Ljava/lang/Object;)V", false);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(741, l8);
- mv.visitInsn(RETURN);
- mv.visitLabel(l6);
- mv.visitLineNumber(743, l6);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$700", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", false);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "add", "(Ljava/lang/Object;)Z", false);
- mv.visitInsn(POP);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(744, l9);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/ChunkDebugger", "storeLoadChunkToCache", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L"+aChunkCoordIntPair+";)V", false);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(745, l10);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/MinecraftForge", "EVENT_BUS", "Lcpw/mods/fml/common/eventhandler/EventBus;");
- mv.visitTypeInsn(NEW, "net/minecraftforge/common/ForgeChunkManager$ForceChunkEvent");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/common/ForgeChunkManager$ForceChunkEvent", "<init>", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L"+aChunkCoordIntPair+";)V", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "cpw/mods/fml/common/eventhandler/EventBus", "post", "(Lcpw/mods/fml/common/eventhandler/Event;)Z", false);
- mv.visitInsn(POP);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(747, l11);
- mv.visitMethodInsn(INVOKESTATIC, "com/google/common/collect/ImmutableSetMultimap", "builder", "()Lcom/google/common/collect/ImmutableSetMultimap$Builder;", false);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "forcedChunks", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L"+aWorld+";");
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
- mv.visitMethodInsn(INVOKEVIRTUAL, "com/google/common/collect/ImmutableSetMultimap$Builder", "putAll", "(Lcom/google/common/collect/Multimap;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;", false);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "com/google/common/collect/ImmutableSetMultimap$Builder", "put", "(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "com/google/common/collect/ImmutableSetMultimap$Builder", "build", "()Lcom/google/common/collect/ImmutableSetMultimap;", false);
- mv.visitVarInsn(ASTORE, 2);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLineNumber(748, l12);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "forcedChunks", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L"+aWorld+";");
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitInsn(POP);
- Label l13 = new Label();
- mv.visitLabel(l13);
- mv.visitLineNumber(749, l13);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$800", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)I", false);
- Label l14 = new Label();
- mv.visitJumpInsn(IFLE, l14);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$700", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "size", "()I", false);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$800", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)I", false);
- mv.visitJumpInsn(IF_ICMPLE, l14);
- Label l15 = new Label();
- mv.visitLabel(l15);
- mv.visitLineNumber(751, l15);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$700", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "iterator", "()Ljava/util/Iterator;", false);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, ""+aChunkCoordIntPair+"");
- mv.visitVarInsn(ASTORE, 3);
- Label l16 = new Label();
- mv.visitLabel(l16);
- mv.visitLineNumber(752, l16);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager", "unforceChunk", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L"+aChunkCoordIntPair+";)V", false);
- mv.visitLabel(l14);
- mv.visitLineNumber(754, l14);
- mv.visitFrame(F_APPEND,1, new Object[] {"com/google/common/collect/ImmutableSetMultimap"}, 0, null);
- mv.visitInsn(RETURN);
- Label l17 = new Label();
- mv.visitLabel(l17);
- mv.visitLocalVariable("ticket", "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", null, l0, l17, 0);
- mv.visitLocalVariable("chunk", "L"+aChunkCoordIntPair+";", null, l0, l17, 1);
- mv.visitLocalVariable("newMap", "Lcom/google/common/collect/ImmutableSetMultimap;", "Lcom/google/common/collect/ImmutableSetMultimap<L"+aChunkCoordIntPair+";Lnet/minecraftforge/common/ForgeChunkManager$Ticket;>;", l12, l17, 2);
- mv.visitLocalVariable("removed", "L"+aChunkCoordIntPair+";", null, l16, l14, 3);
- mv.visitMaxs(5, 4);
- mv.visitEnd();
+ if (reader != null && writer != null && !doesMethodAlreadyExist) {
- }
- else if (aMethodName.equals("unforceChunk")) {
+ aChunkCoordIntPair = obfuscated
+ ? DevHelper.getObfuscated("net/minecraft/world/ChunkCoordIntPair")
+ : "net/minecraft/world/ChunkCoordIntPair";
+ aWorld = obfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
+ aEntity =
+ obfuscated ? DevHelper.getObfuscated("net/minecraft/entity/Entity") : "net/minecraft/entity/Entity";
- mv = getWriter().visitMethod(ACC_PUBLIC + ACC_STATIC, "unforceChunk", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L"+aChunkCoordIntPair+";)V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(781, l0);
- mv.visitVarInsn(ALOAD, 0);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNULL, l1);
- mv.visitVarInsn(ALOAD, 1);
- Label l2 = new Label();
- mv.visitJumpInsn(IFNONNULL, l2);
- mv.visitLabel(l1);
- mv.visitLineNumber(783, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(RETURN);
- mv.visitLabel(l2);
- mv.visitLineNumber(785, l2);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$700", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", false);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "remove", "(Ljava/lang/Object;)Z", false);
- mv.visitInsn(POP);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(786, l3);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/ChunkDebugger", "removeLoadedChunkFromCache", "(L"+aChunkCoordIntPair+";)V", false);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(787, l4);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/MinecraftForge", "EVENT_BUS", "Lcpw/mods/fml/common/eventhandler/EventBus;");
- mv.visitTypeInsn(NEW, "net/minecraftforge/common/ForgeChunkManager$UnforceChunkEvent");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/common/ForgeChunkManager$UnforceChunkEvent", "<init>", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L"+aChunkCoordIntPair+";)V", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "cpw/mods/fml/common/eventhandler/EventBus", "post", "(Lcpw/mods/fml/common/eventhandler/Event;)Z", false);
- mv.visitInsn(POP);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(788, l5);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "forcedChunks", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L"+aWorld+";");
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
- mv.visitMethodInsn(INVOKESTATIC, "com/google/common/collect/LinkedHashMultimap", "create", "(Lcom/google/common/collect/Multimap;)Lcom/google/common/collect/LinkedHashMultimap;", false);
- mv.visitVarInsn(ASTORE, 2);
- Label l6 = new Label();
- mv.visitLabel(l6);
- mv.visitLineNumber(789, l6);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "com/google/common/collect/LinkedHashMultimap", "remove", "(Ljava/lang/Object;Ljava/lang/Object;)Z", false);
- mv.visitInsn(POP);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(790, l7);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKESTATIC, "com/google/common/collect/ImmutableSetMultimap", "copyOf", "(Lcom/google/common/collect/Multimap;)Lcom/google/common/collect/ImmutableSetMultimap;", false);
- mv.visitVarInsn(ASTORE, 3);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(791, l8);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "forcedChunks", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L"+aWorld+";");
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitInsn(POP);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(792, l9);
- mv.visitInsn(RETURN);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLocalVariable("ticket", "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", null, l0, l10, 0);
- mv.visitLocalVariable("chunk", "L"+aChunkCoordIntPair+";", null, l0, l10, 1);
- mv.visitLocalVariable("copy", "Lcom/google/common/collect/LinkedHashMultimap;", "Lcom/google/common/collect/LinkedHashMultimap<L"+aChunkCoordIntPair+";Lnet/minecraftforge/common/ForgeChunkManager$Ticket;>;", l6, l10, 2);
- mv.visitLocalVariable("newMap", "Lcom/google/common/collect/ImmutableSetMultimap;", "Lcom/google/common/collect/ImmutableSetMultimap<L"+aChunkCoordIntPair+";Lnet/minecraftforge/common/ForgeChunkManager$Ticket;>;", l8, l10, 3);
- mv.visitMaxs(5, 4);
- mv.visitEnd();
+ injectMethod("forceChunk");
+ injectMethod("unforceChunk");
+ injectMethod("requestTicket");
+ injectMethod("releaseTicket");
+ }
+ }
- }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- else if (aMethodName.equals("requestTicket")) {
+ public ClassReader getReader() {
+ return reader;
+ }
- mv = getWriter().visitMethod(ACC_PUBLIC + ACC_STATIC, "requestTicket", "(Ljava/lang/Object;L"+aWorld+";Lnet/minecraftforge/common/ForgeChunkManager$Type;)Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(656, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager", "getContainer", "(Ljava/lang/Object;)Lcpw/mods/fml/common/ModContainer;", false);
- mv.visitVarInsn(ASTORE, 3);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(657, l1);
- mv.visitVarInsn(ALOAD, 3);
- Label l2 = new Label();
- mv.visitJumpInsn(IFNONNULL, l2);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(659, l3);
- mv.visitFieldInsn(GETSTATIC, "org/apache/logging/log4j/Level", "ERROR", "Lorg/apache/logging/log4j/Level;");
- mv.visitLdcInsn("Failed to locate the container for mod instance %s (%s : %x)");
- mv.visitInsn(ICONST_3);
- mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
- mv.visitInsn(DUP);
- mv.visitInsn(ICONST_0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(AASTORE);
- mv.visitInsn(DUP);
- mv.visitInsn(ICONST_1);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "getClass", "()Ljava/lang/Class;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Class", "getName", "()Ljava/lang/String;", false);
- mv.visitInsn(AASTORE);
- mv.visitInsn(DUP);
- mv.visitInsn(ICONST_2);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/System", "identityHashCode", "(Ljava/lang/Object;)I", false);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false);
- mv.visitInsn(AASTORE);
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "log", "(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V", false);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(660, l4);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(ARETURN);
- mv.visitLabel(l2);
- mv.visitLineNumber(662, l2);
- mv.visitFrame(F_APPEND,1, new Object[] {"cpw/mods/fml/common/ModContainer"}, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEINTERFACE, "cpw/mods/fml/common/ModContainer", "getModId", "()Ljava/lang/String;", true);
- mv.visitVarInsn(ASTORE, 4);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(663, l5);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "callbacks", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "containsKey", "(Ljava/lang/Object;)Z", true);
- Label l6 = new Label();
- mv.visitJumpInsn(IFNE, l6);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(665, l7);
- mv.visitLdcInsn("The mod %s has attempted to request a ticket without a listener in place");
- mv.visitInsn(ICONST_1);
- mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
- mv.visitInsn(DUP);
- mv.visitInsn(ICONST_0);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitInsn(AASTORE);
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "severe", "(Ljava/lang/String;[Ljava/lang/Object;)V", false);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(666, l8);
- mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
- mv.visitInsn(DUP);
- mv.visitLdcInsn("Invalid ticket request");
- mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>", "(Ljava/lang/String;)V", false);
- mv.visitInsn(ATHROW);
- mv.visitLabel(l6);
- mv.visitLineNumber(669, l6);
- mv.visitFrame(F_APPEND,1, new Object[] {"java/lang/String"}, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager", "getMaxTicketLengthFor", "(Ljava/lang/String;)I", false);
- mv.visitVarInsn(ISTORE, 5);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(671, l9);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEINTERFACE, "com/google/common/collect/Multimap", "get", "(Ljava/lang/Object;)Ljava/util/Collection;", true);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Collection", "size", "()I", true);
- mv.visitVarInsn(ILOAD, 5);
- Label l10 = new Label();
- mv.visitJumpInsn(IF_ICMPLT, l10);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(673, l11);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "warnedMods", "Ljava/util/Set;");
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Set", "contains", "(Ljava/lang/Object;)Z", true);
- Label l12 = new Label();
- mv.visitJumpInsn(IFNE, l12);
- Label l13 = new Label();
- mv.visitLabel(l13);
- mv.visitLineNumber(675, l13);
- mv.visitLdcInsn("The mod %s has attempted to allocate a chunkloading ticket beyond it's currently allocated maximum : %d");
- mv.visitInsn(ICONST_2);
- mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
- mv.visitInsn(DUP);
- mv.visitInsn(ICONST_0);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitInsn(AASTORE);
- mv.visitInsn(DUP);
- mv.visitInsn(ICONST_1);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false);
- mv.visitInsn(AASTORE);
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "info", "(Ljava/lang/String;[Ljava/lang/Object;)V", false);
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLineNumber(676, l14);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "warnedMods", "Ljava/util/Set;");
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Set", "add", "(Ljava/lang/Object;)Z", true);
- mv.visitInsn(POP);
- mv.visitLabel(l12);
- mv.visitLineNumber(678, l12);
- mv.visitFrame(F_APPEND,1, new Object[] {INTEGER}, 0, null);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(ARETURN);
- mv.visitLabel(l10);
- mv.visitLineNumber(680, l10);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitTypeInsn(NEW, "net/minecraftforge/common/ForgeChunkManager$Ticket");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/common/ForgeChunkManager$Ticket", "<init>", "(Ljava/lang/String;Lnet/minecraftforge/common/ForgeChunkManager$Type;L"+aWorld+";)V", false);
- mv.visitVarInsn(ASTORE, 6);
- Label l15 = new Label();
- mv.visitLabel(l15);
- mv.visitLineNumber(681, l15);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/ChunkDebugger", "storeTicketToCache", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L"+aWorld+";)V", false);
- Label l16 = new Label();
- mv.visitLabel(l16);
- mv.visitLineNumber(682, l16);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
- mv.visitVarInsn(ALOAD, 4);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitMethodInsn(INVOKEINTERFACE, "com/google/common/collect/Multimap", "put", "(Ljava/lang/Object;Ljava/lang/Object;)Z", true);
- mv.visitInsn(POP);
- Label l17 = new Label();
- mv.visitLabel(l17);
- mv.visitLineNumber(683, l17);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitInsn(ARETURN);
- Label l18 = new Label();
- mv.visitLabel(l18);
- mv.visitLocalVariable("mod", "Ljava/lang/Object;", null, l0, l18, 0);
- mv.visitLocalVariable("world", "L"+aWorld+";", null, l0, l18, 1);
- mv.visitLocalVariable("type", "Lnet/minecraftforge/common/ForgeChunkManager$Type;", null, l0, l18, 2);
- mv.visitLocalVariable("container", "Lcpw/mods/fml/common/ModContainer;", null, l1, l18, 3);
- mv.visitLocalVariable("modId", "Ljava/lang/String;", null, l5, l18, 4);
- mv.visitLocalVariable("allowedCount", "I", null, l9, l18, 5);
- mv.visitLocalVariable("ticket", "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", null, l15, l18, 6);
- mv.visitMaxs(6, 7);
- mv.visitEnd();
+ public ClassWriter getWriter() {
+ return writer;
+ }
- }
+ public void injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Chunkloading Patch", Level.INFO, "Injecting " + aMethodName + " into " + className + ".");
+ if (aMethodName.equals("forceChunk")) {
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "forceChunk",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(730, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNULL, l1);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l2 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l2);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(732, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(RETURN);
+ mv.visitLabel(l2);
+ mv.visitLineNumber(734, l2);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$500",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Lnet/minecraftforge/common/ForgeChunkManager$Type;",
+ false);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Type",
+ "ENTITY",
+ "Lnet/minecraftforge/common/ForgeChunkManager$Type;");
+ Label l3 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l3);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$600",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)L" + aEntity + ";",
+ false);
+ mv.visitJumpInsn(IFNONNULL, l3);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(736, l4);
+ mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
+ mv.visitInsn(DUP);
+ mv.visitLdcInsn("Attempted to use an entity ticket to force a chunk, without an entity");
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>", "(Ljava/lang/String;)V", false);
+ mv.visitInsn(ATHROW);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(738, l3);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "isPlayerTicket",
+ "()Z",
+ false);
+ Label l5 = new Label();
+ mv.visitJumpInsn(IFEQ, l5);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/ForgeChunkManager",
+ "playerTickets",
+ "Lcom/google/common/collect/SetMultimap;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "com/google/common/collect/SetMultimap",
+ "containsValue",
+ "(Ljava/lang/Object;)Z",
+ true);
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNE, l6);
+ Label l7 = new Label();
+ mv.visitJumpInsn(GOTO, l7);
+ mv.visitLabel(l5);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L" + aWorld + ";");
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$200",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;",
+ false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "com/google/common/collect/Multimap",
+ "containsEntry",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Z",
+ true);
+ mv.visitJumpInsn(IFNE, l6);
+ mv.visitLabel(l7);
+ mv.visitLineNumber(740, l7);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitLdcInsn(
+ "The mod %s attempted to force load a chunk with an invalid ticket. This is not permitted.");
+ mv.visitInsn(ICONST_1);
+ mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
+ mv.visitInsn(DUP);
+ mv.visitInsn(ICONST_0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$200",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;",
+ false);
+ mv.visitInsn(AASTORE);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "cpw/mods/fml/common/FMLLog",
+ "severe",
+ "(Ljava/lang/String;[Ljava/lang/Object;)V",
+ false);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(741, l8);
+ mv.visitInsn(RETURN);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(743, l6);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$700",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;",
+ false);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "add", "(Ljava/lang/Object;)Z", false);
+ mv.visitInsn(POP);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(744, l9);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/ChunkDebugger",
+ "storeLoadChunkToCache",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V",
+ false);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(745, l10);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/MinecraftForge",
+ "EVENT_BUS",
+ "Lcpw/mods/fml/common/eventhandler/EventBus;");
+ mv.visitTypeInsn(NEW, "net/minecraftforge/common/ForgeChunkManager$ForceChunkEvent");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/common/ForgeChunkManager$ForceChunkEvent",
+ "<init>",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V",
+ false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "cpw/mods/fml/common/eventhandler/EventBus",
+ "post",
+ "(Lcpw/mods/fml/common/eventhandler/Event;)Z",
+ false);
+ mv.visitInsn(POP);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(747, l11);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "com/google/common/collect/ImmutableSetMultimap",
+ "builder",
+ "()Lcom/google/common/collect/ImmutableSetMultimap$Builder;",
+ false);
+ mv.visitFieldInsn(
+ GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "forcedChunks", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L" + aWorld + ";");
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "com/google/common/collect/ImmutableSetMultimap$Builder",
+ "putAll",
+ "(Lcom/google/common/collect/Multimap;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;",
+ false);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "com/google/common/collect/ImmutableSetMultimap$Builder",
+ "put",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;",
+ false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "com/google/common/collect/ImmutableSetMultimap$Builder",
+ "build",
+ "()Lcom/google/common/collect/ImmutableSetMultimap;",
+ false);
+ mv.visitVarInsn(ASTORE, 2);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLineNumber(748, l12);
+ mv.visitFieldInsn(
+ GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "forcedChunks", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L" + aWorld + ";");
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "java/util/Map",
+ "put",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
+ true);
+ mv.visitInsn(POP);
+ Label l13 = new Label();
+ mv.visitLabel(l13);
+ mv.visitLineNumber(749, l13);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$800",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)I",
+ false);
+ Label l14 = new Label();
+ mv.visitJumpInsn(IFLE, l14);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$700",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;",
+ false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "size", "()I", false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$800",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)I",
+ false);
+ mv.visitJumpInsn(IF_ICMPLE, l14);
+ Label l15 = new Label();
+ mv.visitLabel(l15);
+ mv.visitLineNumber(751, l15);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$700",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;",
+ false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "iterator", "()Ljava/util/Iterator;", false);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "" + aChunkCoordIntPair + "");
+ mv.visitVarInsn(ASTORE, 3);
+ Label l16 = new Label();
+ mv.visitLabel(l16);
+ mv.visitLineNumber(752, l16);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager",
+ "unforceChunk",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V",
+ false);
+ mv.visitLabel(l14);
+ mv.visitLineNumber(754, l14);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"com/google/common/collect/ImmutableSetMultimap"}, 0, null);
+ mv.visitInsn(RETURN);
+ Label l17 = new Label();
+ mv.visitLabel(l17);
+ mv.visitLocalVariable("ticket", "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", null, l0, l17, 0);
+ mv.visitLocalVariable("chunk", "L" + aChunkCoordIntPair + ";", null, l0, l17, 1);
+ mv.visitLocalVariable(
+ "newMap",
+ "Lcom/google/common/collect/ImmutableSetMultimap;",
+ "Lcom/google/common/collect/ImmutableSetMultimap<L" + aChunkCoordIntPair
+ + ";Lnet/minecraftforge/common/ForgeChunkManager$Ticket;>;",
+ l12,
+ l17,
+ 2);
+ mv.visitLocalVariable("removed", "L" + aChunkCoordIntPair + ";", null, l16, l14, 3);
+ mv.visitMaxs(5, 4);
+ mv.visitEnd();
- else if (aMethodName.equals("releaseTicket")) {
+ } else if (aMethodName.equals("unforceChunk")) {
- mv = getWriter().visitMethod(ACC_PUBLIC + ACC_STATIC, "releaseTicket", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(693, l0);
- mv.visitVarInsn(ALOAD, 0);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNONNULL, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(695, l2);
- mv.visitInsn(RETURN);
- mv.visitLabel(l1);
- mv.visitLineNumber(697, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/common/ForgeChunkManager$Ticket", "isPlayerTicket", "()Z", false);
- Label l3 = new Label();
- mv.visitJumpInsn(IFEQ, l3);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "playerTickets", "Lcom/google/common/collect/SetMultimap;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEINTERFACE, "com/google/common/collect/SetMultimap", "containsValue", "(Ljava/lang/Object;)Z", true);
- Label l4 = new Label();
- mv.visitJumpInsn(IFNE, l4);
- Label l5 = new Label();
- mv.visitJumpInsn(GOTO, l5);
- mv.visitLabel(l3);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L"+aWorld+";");
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$200", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", false);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEINTERFACE, "com/google/common/collect/Multimap", "containsEntry", "(Ljava/lang/Object;Ljava/lang/Object;)Z", true);
- mv.visitJumpInsn(IFNE, l4);
- mv.visitLabel(l5);
- mv.visitLineNumber(699, l5);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(RETURN);
- mv.visitLabel(l4);
- mv.visitLineNumber(701, l4);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$700", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", false);
- Label l6 = new Label();
- mv.visitJumpInsn(IFNULL, l6);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(703, l7);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$700", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", false);
- mv.visitMethodInsn(INVOKESTATIC, "com/google/common/collect/ImmutableSet", "copyOf", "(Ljava/util/Collection;)Lcom/google/common/collect/ImmutableSet;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "com/google/common/collect/ImmutableSet", "iterator", "()Ljava/util/Iterator;", false);
- mv.visitVarInsn(ASTORE, 2);
- Label l8 = new Label();
- mv.visitJumpInsn(GOTO, l8);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitFrame(F_FULL, 3, new Object[] {"net/minecraftforge/common/ForgeChunkManager$Ticket", TOP, "java/util/Iterator"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, ""+aChunkCoordIntPair+"");
- mv.visitVarInsn(ASTORE, 1);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(705, l10);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager", "unforceChunk", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L"+aChunkCoordIntPair+";)V", false);
- mv.visitLabel(l8);
- mv.visitLineNumber(703, l8);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
- mv.visitJumpInsn(IFNE, l9);
- mv.visitLabel(l6);
- mv.visitLineNumber(708, l6);
- mv.visitFrame(F_FULL, 1, new Object[] {"net/minecraftforge/common/ForgeChunkManager$Ticket"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/ChunkDebugger", "removeTicketFromCache", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)V", false);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(709, l11);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/common/ForgeChunkManager$Ticket", "isPlayerTicket", "()Z", false);
- Label l12 = new Label();
- mv.visitJumpInsn(IFEQ, l12);
- Label l13 = new Label();
- mv.visitLabel(l13);
- mv.visitLineNumber(711, l13);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "playerTickets", "Lcom/google/common/collect/SetMultimap;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$100", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", false);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEINTERFACE, "com/google/common/collect/SetMultimap", "remove", "(Ljava/lang/Object;Ljava/lang/Object;)Z", true);
- mv.visitInsn(POP);
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLineNumber(712, l14);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L"+aWorld+";");
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
- mv.visitLdcInsn("Forge");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEINTERFACE, "com/google/common/collect/Multimap", "remove", "(Ljava/lang/Object;Ljava/lang/Object;)Z", true);
- mv.visitInsn(POP);
- Label l15 = new Label();
- mv.visitLabel(l15);
- mv.visitLineNumber(713, l15);
- Label l16 = new Label();
- mv.visitJumpInsn(GOTO, l16);
- mv.visitLabel(l12);
- mv.visitLineNumber(716, l12);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L"+aWorld+";");
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/common/ForgeChunkManager$Ticket", "access$200", "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", false);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEINTERFACE, "com/google/common/collect/Multimap", "remove", "(Ljava/lang/Object;Ljava/lang/Object;)Z", true);
- mv.visitInsn(POP);
- mv.visitLabel(l16);
- mv.visitLineNumber(718, l16);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(RETURN);
- Label l17 = new Label();
- mv.visitLabel(l17);
- mv.visitLocalVariable("ticket", "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", null, l0, l17, 0);
- mv.visitLocalVariable("chunk", "L"+aChunkCoordIntPair+";", null, l10, l8, 1);
- mv.visitMaxs(3, 3);
- mv.visitEnd();
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "unforceChunk",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(781, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNULL, l1);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l2 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l2);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(783, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(RETURN);
+ mv.visitLabel(l2);
+ mv.visitLineNumber(785, l2);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$700",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;",
+ false);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "remove", "(Ljava/lang/Object;)Z", false);
+ mv.visitInsn(POP);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(786, l3);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/ChunkDebugger",
+ "removeLoadedChunkFromCache",
+ "(L" + aChunkCoordIntPair + ";)V",
+ false);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(787, l4);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/MinecraftForge",
+ "EVENT_BUS",
+ "Lcpw/mods/fml/common/eventhandler/EventBus;");
+ mv.visitTypeInsn(NEW, "net/minecraftforge/common/ForgeChunkManager$UnforceChunkEvent");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/common/ForgeChunkManager$UnforceChunkEvent",
+ "<init>",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V",
+ false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "cpw/mods/fml/common/eventhandler/EventBus",
+ "post",
+ "(Lcpw/mods/fml/common/eventhandler/Event;)Z",
+ false);
+ mv.visitInsn(POP);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(788, l5);
+ mv.visitFieldInsn(
+ GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "forcedChunks", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L" + aWorld + ";");
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "com/google/common/collect/LinkedHashMultimap",
+ "create",
+ "(Lcom/google/common/collect/Multimap;)Lcom/google/common/collect/LinkedHashMultimap;",
+ false);
+ mv.visitVarInsn(ASTORE, 2);
+ Label l6 = new Label();
+ mv.visitLabel(l6);
+ mv.visitLineNumber(789, l6);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "com/google/common/collect/LinkedHashMultimap",
+ "remove",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Z",
+ false);
+ mv.visitInsn(POP);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(790, l7);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "com/google/common/collect/ImmutableSetMultimap",
+ "copyOf",
+ "(Lcom/google/common/collect/Multimap;)Lcom/google/common/collect/ImmutableSetMultimap;",
+ false);
+ mv.visitVarInsn(ASTORE, 3);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(791, l8);
+ mv.visitFieldInsn(
+ GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "forcedChunks", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L" + aWorld + ";");
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "java/util/Map",
+ "put",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
+ true);
+ mv.visitInsn(POP);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(792, l9);
+ mv.visitInsn(RETURN);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLocalVariable("ticket", "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", null, l0, l10, 0);
+ mv.visitLocalVariable("chunk", "L" + aChunkCoordIntPair + ";", null, l0, l10, 1);
+ mv.visitLocalVariable(
+ "copy",
+ "Lcom/google/common/collect/LinkedHashMultimap;",
+ "Lcom/google/common/collect/LinkedHashMultimap<L" + aChunkCoordIntPair
+ + ";Lnet/minecraftforge/common/ForgeChunkManager$Ticket;>;",
+ l6,
+ l10,
+ 2);
+ mv.visitLocalVariable(
+ "newMap",
+ "Lcom/google/common/collect/ImmutableSetMultimap;",
+ "Lcom/google/common/collect/ImmutableSetMultimap<L" + aChunkCoordIntPair
+ + ";Lnet/minecraftforge/common/ForgeChunkManager$Ticket;>;",
+ l8,
+ l10,
+ 3);
+ mv.visitMaxs(5, 4);
+ mv.visitEnd();
- }
+ } else if (aMethodName.equals("requestTicket")) {
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "requestTicket",
+ "(Ljava/lang/Object;L" + aWorld
+ + ";Lnet/minecraftforge/common/ForgeChunkManager$Type;)Lnet/minecraftforge/common/ForgeChunkManager$Ticket;",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(656, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager",
+ "getContainer",
+ "(Ljava/lang/Object;)Lcpw/mods/fml/common/ModContainer;",
+ false);
+ mv.visitVarInsn(ASTORE, 3);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(657, l1);
+ mv.visitVarInsn(ALOAD, 3);
+ Label l2 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l2);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(659, l3);
+ mv.visitFieldInsn(GETSTATIC, "org/apache/logging/log4j/Level", "ERROR", "Lorg/apache/logging/log4j/Level;");
+ mv.visitLdcInsn("Failed to locate the container for mod instance %s (%s : %x)");
+ mv.visitInsn(ICONST_3);
+ mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
+ mv.visitInsn(DUP);
+ mv.visitInsn(ICONST_0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(AASTORE);
+ mv.visitInsn(DUP);
+ mv.visitInsn(ICONST_1);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "getClass", "()Ljava/lang/Class;", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Class", "getName", "()Ljava/lang/String;", false);
+ mv.visitInsn(AASTORE);
+ mv.visitInsn(DUP);
+ mv.visitInsn(ICONST_2);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/System", "identityHashCode", "(Ljava/lang/Object;)I", false);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false);
+ mv.visitInsn(AASTORE);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "cpw/mods/fml/common/FMLLog",
+ "log",
+ "(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V",
+ false);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(660, l4);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l2);
+ mv.visitLineNumber(662, l2);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"cpw/mods/fml/common/ModContainer"}, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE, "cpw/mods/fml/common/ModContainer", "getModId", "()Ljava/lang/String;", true);
+ mv.visitVarInsn(ASTORE, 4);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(663, l5);
+ mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "callbacks", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "containsKey", "(Ljava/lang/Object;)Z", true);
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNE, l6);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(665, l7);
+ mv.visitLdcInsn("The mod %s has attempted to request a ticket without a listener in place");
+ mv.visitInsn(ICONST_1);
+ mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
+ mv.visitInsn(DUP);
+ mv.visitInsn(ICONST_0);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitInsn(AASTORE);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "cpw/mods/fml/common/FMLLog",
+ "severe",
+ "(Ljava/lang/String;[Ljava/lang/Object;)V",
+ false);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(666, l8);
+ mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
+ mv.visitInsn(DUP);
+ mv.visitLdcInsn("Invalid ticket request");
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>", "(Ljava/lang/String;)V", false);
+ mv.visitInsn(ATHROW);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(669, l6);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"java/lang/String"}, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager",
+ "getMaxTicketLengthFor",
+ "(Ljava/lang/String;)I",
+ false);
+ mv.visitVarInsn(ISTORE, 5);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(671, l9);
+ mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "com/google/common/collect/Multimap",
+ "get",
+ "(Ljava/lang/Object;)Ljava/util/Collection;",
+ true);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Collection", "size", "()I", true);
+ mv.visitVarInsn(ILOAD, 5);
+ Label l10 = new Label();
+ mv.visitJumpInsn(IF_ICMPLT, l10);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(673, l11);
+ mv.visitFieldInsn(
+ GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "warnedMods", "Ljava/util/Set;");
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Set", "contains", "(Ljava/lang/Object;)Z", true);
+ Label l12 = new Label();
+ mv.visitJumpInsn(IFNE, l12);
+ Label l13 = new Label();
+ mv.visitLabel(l13);
+ mv.visitLineNumber(675, l13);
+ mv.visitLdcInsn(
+ "The mod %s has attempted to allocate a chunkloading ticket beyond it's currently allocated maximum : %d");
+ mv.visitInsn(ICONST_2);
+ mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
+ mv.visitInsn(DUP);
+ mv.visitInsn(ICONST_0);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitInsn(AASTORE);
+ mv.visitInsn(DUP);
+ mv.visitInsn(ICONST_1);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false);
+ mv.visitInsn(AASTORE);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "cpw/mods/fml/common/FMLLog",
+ "info",
+ "(Ljava/lang/String;[Ljava/lang/Object;)V",
+ false);
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLineNumber(676, l14);
+ mv.visitFieldInsn(
+ GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "warnedMods", "Ljava/util/Set;");
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Set", "add", "(Ljava/lang/Object;)Z", true);
+ mv.visitInsn(POP);
+ mv.visitLabel(l12);
+ mv.visitLineNumber(678, l12);
+ mv.visitFrame(F_APPEND, 1, new Object[] {INTEGER}, 0, null);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l10);
+ mv.visitLineNumber(680, l10);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitTypeInsn(NEW, "net/minecraftforge/common/ForgeChunkManager$Ticket");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "<init>",
+ "(Ljava/lang/String;Lnet/minecraftforge/common/ForgeChunkManager$Type;L" + aWorld + ";)V",
+ false);
+ mv.visitVarInsn(ASTORE, 6);
+ Label l15 = new Label();
+ mv.visitLabel(l15);
+ mv.visitLineNumber(681, l15);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/ChunkDebugger",
+ "storeTicketToCache",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aWorld + ";)V",
+ false);
+ Label l16 = new Label();
+ mv.visitLabel(l16);
+ mv.visitLineNumber(682, l16);
+ mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "com/google/common/collect/Multimap",
+ "put",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Z",
+ true);
+ mv.visitInsn(POP);
+ Label l17 = new Label();
+ mv.visitLabel(l17);
+ mv.visitLineNumber(683, l17);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitInsn(ARETURN);
+ Label l18 = new Label();
+ mv.visitLabel(l18);
+ mv.visitLocalVariable("mod", "Ljava/lang/Object;", null, l0, l18, 0);
+ mv.visitLocalVariable("world", "L" + aWorld + ";", null, l0, l18, 1);
+ mv.visitLocalVariable("type", "Lnet/minecraftforge/common/ForgeChunkManager$Type;", null, l0, l18, 2);
+ mv.visitLocalVariable("container", "Lcpw/mods/fml/common/ModContainer;", null, l1, l18, 3);
+ mv.visitLocalVariable("modId", "Ljava/lang/String;", null, l5, l18, 4);
+ mv.visitLocalVariable("allowedCount", "I", null, l9, l18, 5);
+ mv.visitLocalVariable("ticket", "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", null, l15, l18, 6);
+ mv.visitMaxs(6, 7);
+ mv.visitEnd();
- FMLRelaunchLog.log("[GT++ ASM] Chunkloading Patch", Level.INFO, "Method injection complete.");
+ } else if (aMethodName.equals("releaseTicket")) {
- }
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "releaseTicket",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)V",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(693, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(695, l2);
+ mv.visitInsn(RETURN);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(697, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "isPlayerTicket",
+ "()Z",
+ false);
+ Label l3 = new Label();
+ mv.visitJumpInsn(IFEQ, l3);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/ForgeChunkManager",
+ "playerTickets",
+ "Lcom/google/common/collect/SetMultimap;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "com/google/common/collect/SetMultimap",
+ "containsValue",
+ "(Ljava/lang/Object;)Z",
+ true);
+ Label l4 = new Label();
+ mv.visitJumpInsn(IFNE, l4);
+ Label l5 = new Label();
+ mv.visitJumpInsn(GOTO, l5);
+ mv.visitLabel(l3);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L" + aWorld + ";");
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$200",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;",
+ false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "com/google/common/collect/Multimap",
+ "containsEntry",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Z",
+ true);
+ mv.visitJumpInsn(IFNE, l4);
+ mv.visitLabel(l5);
+ mv.visitLineNumber(699, l5);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(RETURN);
+ mv.visitLabel(l4);
+ mv.visitLineNumber(701, l4);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$700",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;",
+ false);
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNULL, l6);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(703, l7);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$700",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;",
+ false);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "com/google/common/collect/ImmutableSet",
+ "copyOf",
+ "(Ljava/util/Collection;)Lcom/google/common/collect/ImmutableSet;",
+ false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "com/google/common/collect/ImmutableSet",
+ "iterator",
+ "()Ljava/util/Iterator;",
+ false);
+ mv.visitVarInsn(ASTORE, 2);
+ Label l8 = new Label();
+ mv.visitJumpInsn(GOTO, l8);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitFrame(
+ F_FULL,
+ 3,
+ new Object[] {"net/minecraftforge/common/ForgeChunkManager$Ticket", TOP, "java/util/Iterator"},
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "" + aChunkCoordIntPair + "");
+ mv.visitVarInsn(ASTORE, 1);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(705, l10);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager",
+ "unforceChunk",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V",
+ false);
+ mv.visitLabel(l8);
+ mv.visitLineNumber(703, l8);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
+ mv.visitJumpInsn(IFNE, l9);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(708, l6);
+ mv.visitFrame(
+ F_FULL, 1, new Object[] {"net/minecraftforge/common/ForgeChunkManager$Ticket"}, 0, new Object[] {});
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/ChunkDebugger",
+ "removeTicketFromCache",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)V",
+ false);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(709, l11);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "isPlayerTicket",
+ "()Z",
+ false);
+ Label l12 = new Label();
+ mv.visitJumpInsn(IFEQ, l12);
+ Label l13 = new Label();
+ mv.visitLabel(l13);
+ mv.visitLineNumber(711, l13);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/ForgeChunkManager",
+ "playerTickets",
+ "Lcom/google/common/collect/SetMultimap;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$100",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;",
+ false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "com/google/common/collect/SetMultimap",
+ "remove",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Z",
+ true);
+ mv.visitInsn(POP);
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLineNumber(712, l14);
+ mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L" + aWorld + ";");
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
+ mv.visitLdcInsn("Forge");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "com/google/common/collect/Multimap",
+ "remove",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Z",
+ true);
+ mv.visitInsn(POP);
+ Label l15 = new Label();
+ mv.visitLabel(l15);
+ mv.visitLineNumber(713, l15);
+ Label l16 = new Label();
+ mv.visitJumpInsn(GOTO, l16);
+ mv.visitLabel(l12);
+ mv.visitLineNumber(716, l12);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/ForgeChunkManager", "tickets", "Ljava/util/Map;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "net/minecraftforge/common/ForgeChunkManager$Ticket", "world", "L" + aWorld + ";");
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/common/ForgeChunkManager$Ticket",
+ "access$200",
+ "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;",
+ false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "com/google/common/collect/Multimap",
+ "remove",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Z",
+ true);
+ mv.visitInsn(POP);
+ mv.visitLabel(l16);
+ mv.visitLineNumber(718, l16);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(RETURN);
+ Label l17 = new Label();
+ mv.visitLabel(l17);
+ mv.visitLocalVariable("ticket", "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", null, l0, l17, 0);
+ mv.visitLocalVariable("chunk", "L" + aChunkCoordIntPair + ";", null, l10, l8, 1);
+ mv.visitMaxs(3, 3);
+ mv.visitEnd();
+ }
- public static final class localClassVisitor extends ClassVisitor {
+ FMLRelaunchLog.log("[GT++ ASM] Chunkloading Patch", Level.INFO, "Method injection complete.");
+ }
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
+ public static final class localClassVisitor extends ClassVisitor {
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- if (name.equals("forceChunk") || name.equals("unforceChunk") || name.equals("requestTicket") || name.equals("releaseTicket")) {
- FMLRelaunchLog.log("[GT++ ASM] Chunkloading Patch", Level.INFO, "Found method "+name+", Patching.");
- return null;
- }
- MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- return methodVisitor;
- }
- }
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ if (name.equals("forceChunk")
+ || name.equals("unforceChunk")
+ || name.equals("requestTicket")
+ || name.equals("releaseTicket")) {
+ FMLRelaunchLog.log("[GT++ ASM] Chunkloading Patch", Level.INFO, "Found method " + name + ", Patching.");
+ return null;
+ }
+ MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_EntityLivingBase_SetHealth.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_EntityLivingBase_SetHealth.java
index d56b9de059..e3821e8865 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_EntityLivingBase_SetHealth.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_EntityLivingBase_SetHealth.java
@@ -1,130 +1,109 @@
package gtPlusPlus.preloader.asm.transformers;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.util.DamageSource;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.util.DamageSource;
-
-public class ClassTransformer_Forge_EntityLivingBase_SetHealth {
-
- private boolean isValid = false;
- private ClassReader mReader = null;
- private ClassWriter mWriter = null;
- private boolean didPatch = false;
-
- public ClassTransformer_Forge_EntityLivingBase_SetHealth(String aClassName, byte[] basicClass) {
- if (basicClass == null) {
- return;
- }
-
- ClassReader reader = new ClassReader(basicClass);
- ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_MAXS);
- ClassVisitor visitor = writer;
- SetHealthVisitor aVisitor = new SetHealthVisitor(visitor);
- visitor = aVisitor;
- reader.accept(visitor, 0);
- if (reader != null && writer != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- mReader = reader;
- mWriter = writer;
- didPatch = aVisitor.didPatchInternal;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return mReader;
- }
-
- public ClassWriter getWriter() {
- return mWriter;
- }
-
-
- public static class SetHealthVisitor extends ClassVisitor {
- private String clsName = null;
- private boolean didPatchInternal = false;
- private static final String callbackOwner = org.objectweb.asm.Type.getInternalName(SetHealthVisitor.class);
-
- private SetHealthVisitor(ClassVisitor cv) {
- super(Opcodes.ASM5, cv);
- }
-
- @Override
- public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
- super.visit(
- version, access, name, signature, superName, interfaces
- );
- this.clsName = name;
- }
-
- @Override
- public MethodVisitor visitMethod(
- int mAccess, final String mName, final String mDesc, String mSignature, String[] mExceptions) {
- final boolean warn = !(clsName.equals(
- "net/minecraft/entity/EntityLivingBase"
- ));
-
- return new MethodVisitor(Opcodes.ASM5, super.visitMethod(mAccess, mName, mDesc, mSignature, mExceptions)) {
- @Override
- public void visitMethodInsn(
- int opcode, String owner, String name, String desc, boolean isIntf
- ) {
- if (owner.equals(
- "net/minecraft/entity/EntityLivingBase"
- ) && name.equals("setHealth") && desc.equals("(F)V")) {
- if (warn) {
- FMLRelaunchLog.warning(
- "============================================================="
- );
- FMLRelaunchLog.warning(
- "MOD HAS DIRECT REFERENCE Entity.setHealth() THIS IS NOT ALLOWED!"
- );
- FMLRelaunchLog.warning(
- "Offendor: %s.%s%s", SetHealthVisitor.this.clsName, mName, mDesc
- );
- FMLRelaunchLog.warning(
- "Use EntityLiving.attackEntityFrom(DamageSource, damageDealt) instead"
- );
- FMLRelaunchLog.warning(
- "============================================================="
- );
- }
- didPatchInternal = true;
- //opcode = Opcodes.INVOKESTATIC; // Set it static
- //owner = SetHealthVisitor.callbackOwner;
- //name = "setHealthGeneric"; // Replace the method name
- //desc = "(Lnet/minecraft/entity/EntityLivingBase;F)V"; // Replace the method desc
-
- }
- super.visitMethodInsn(opcode, owner, name, desc, isIntf);
- }
- };
- }
-
-
- private final static DamageSource mGenericDamageSource = new DamageSource("gtpp.generic");
-
- public static void setHealthGeneric(EntityLivingBase aEntity, float aValue) {
- aEntity.attackEntityFrom(mGenericDamageSource, aValue);
- }
-
- }
-
-
- public boolean didPatchClass() {
- return didPatch;
- }
-
+public class ClassTransformer_Forge_EntityLivingBase_SetHealth {
+
+ private boolean isValid = false;
+ private ClassReader mReader = null;
+ private ClassWriter mWriter = null;
+ private boolean didPatch = false;
+
+ public ClassTransformer_Forge_EntityLivingBase_SetHealth(String aClassName, byte[] basicClass) {
+ if (basicClass == null) {
+ return;
+ }
+
+ ClassReader reader = new ClassReader(basicClass);
+ ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_MAXS);
+ ClassVisitor visitor = writer;
+ SetHealthVisitor aVisitor = new SetHealthVisitor(visitor);
+ visitor = aVisitor;
+ reader.accept(visitor, 0);
+ if (reader != null && writer != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ mReader = reader;
+ mWriter = writer;
+ didPatch = aVisitor.didPatchInternal;
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return mReader;
+ }
+
+ public ClassWriter getWriter() {
+ return mWriter;
+ }
+
+ public static class SetHealthVisitor extends ClassVisitor {
+ private String clsName = null;
+ private boolean didPatchInternal = false;
+ private static final String callbackOwner = org.objectweb.asm.Type.getInternalName(SetHealthVisitor.class);
+
+ private SetHealthVisitor(ClassVisitor cv) {
+ super(Opcodes.ASM5, cv);
+ }
+
+ @Override
+ public void visit(
+ int version, int access, String name, String signature, String superName, String[] interfaces) {
+ super.visit(version, access, name, signature, superName, interfaces);
+ this.clsName = name;
+ }
+
+ @Override
+ public MethodVisitor visitMethod(
+ int mAccess, final String mName, final String mDesc, String mSignature, String[] mExceptions) {
+ final boolean warn = !(clsName.equals("net/minecraft/entity/EntityLivingBase"));
+
+ return new MethodVisitor(Opcodes.ASM5, super.visitMethod(mAccess, mName, mDesc, mSignature, mExceptions)) {
+ @Override
+ public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean isIntf) {
+ if (owner.equals("net/minecraft/entity/EntityLivingBase")
+ && name.equals("setHealth")
+ && desc.equals("(F)V")) {
+ if (warn) {
+ FMLRelaunchLog.warning("=============================================================");
+ FMLRelaunchLog.warning("MOD HAS DIRECT REFERENCE Entity.setHealth() THIS IS NOT ALLOWED!");
+ FMLRelaunchLog.warning("Offendor: %s.%s%s", SetHealthVisitor.this.clsName, mName, mDesc);
+ FMLRelaunchLog.warning(
+ "Use EntityLiving.attackEntityFrom(DamageSource, damageDealt) instead");
+ FMLRelaunchLog.warning("=============================================================");
+ }
+ didPatchInternal = true;
+ // opcode = Opcodes.INVOKESTATIC; // Set it static
+ // owner = SetHealthVisitor.callbackOwner;
+ // name = "setHealthGeneric"; // Replace the method name
+ // desc = "(Lnet/minecraft/entity/EntityLivingBase;F)V"; // Replace the method desc
+
+ }
+ super.visitMethodInsn(opcode, owner, name, desc, isIntf);
+ }
+ };
+ }
+
+ private static final DamageSource mGenericDamageSource = new DamageSource("gtpp.generic");
+
+ public static void setHealthGeneric(EntityLivingBase aEntity, float aValue) {
+ aEntity.attackEntityFrom(mGenericDamageSource, aValue);
+ }
+ }
+
+ public boolean didPatchClass() {
+ return didPatch;
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_EntityAutoRocket.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_EntityAutoRocket.java
index 1e58cbbe9b..db3b9f3621 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_EntityAutoRocket.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_EntityAutoRocket.java
@@ -2,7 +2,8 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import java.io.IOException;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.preloader.DevHelper;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -10,518 +11,710 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.preloader.DevHelper;
+public class ClassTransformer_GC_EntityAutoRocket {
+ // The qualified name of the class we plan to transform.
+ private static final String className = "micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket";
+ // micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket
-public class ClassTransformer_GC_EntityAutoRocket {
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+ private final boolean isObfuscated;
- //The qualified name of the class we plan to transform.
- private static final String className = "micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket";
- //micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket
+ public ClassTransformer_GC_EntityAutoRocket(byte[] basicClass, boolean obfuscated) {
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
- private final boolean isObfuscated;
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
- public ClassTransformer_GC_EntityAutoRocket(byte[] basicClass, boolean obfuscated) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- isObfuscated = obfuscated;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- reader = aTempReader;
- writer = aTempWriter;
+ isObfuscated = obfuscated;
- if (reader != null && writer != null) {
- injectMethod();
- }
- else {
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft EntityAutoRocket Patch", Level.INFO, "Failed to Inject new code.");
- }
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter), 0);
- }
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ reader = aTempReader;
+ writer = aTempWriter;
- public boolean isValidTransformer() {
- return isValid;
- }
+ if (reader != null && writer != null) {
+ injectMethod();
+ } else {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Galacticraft EntityAutoRocket Patch", Level.INFO, "Failed to Inject new code.");
+ }
+ }
- public ClassReader getReader() {
- return reader;
- }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- public ClassWriter getWriter() {
- return writer;
- }
+ public ClassReader getReader() {
+ return reader;
+ }
- public void injectMethod() {
+ public ClassWriter getWriter() {
+ return writer;
+ }
- String aEntityPlayer = isObfuscated ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayer") : "net/minecraft/entity/player/EntityPlayer";
- String aEntityPlayerMP = isObfuscated ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayerMP") : "net/minecraft/entity/player/EntityPlayerMP";
- String aWorld = isObfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
- String aItemStack = isObfuscated ? DevHelper.getObfuscated("net/minecraft/item/ItemStack") : "net/minecraft/item/ItemStack";
- String aEntity = isObfuscated ? DevHelper.getObfuscated("net/minecraft/entity/Entity") : "net/minecraft/entity/Entity";
- String aWorldClient = isObfuscated ? DevHelper.getObfuscated("net/minecraft/client/multiplayer/WorldClient") : "net/minecraft/client/multiplayer/WorldClient";
- String aDifficultyEnum = isObfuscated ? DevHelper.getObfuscated("net/minecraft/world/EnumDifficulty") : "net/minecraft/world/EnumDifficulty";
- String aWorldInfo = isObfuscated ? DevHelper.getObfuscated("net/minecraft/world/storage/WorldInfo") : "net/minecraft/world/storage/WorldInfo";
- String aItemInWorldManager = isObfuscated ? DevHelper.getObfuscated("net/minecraft/server/management/ItemInWorldManager") : "net/minecraft/server/management/ItemInWorldManager";
- String aWorldType = isObfuscated ? DevHelper.getObfuscated("net/minecraft/world/WorldType") : "net/minecraft/world/WorldType";
- String aGameType = isObfuscated ? DevHelper.getObfuscated("net/minecraft/world/WorldSettings$GameType") : "net/minecraft/world/WorldSettings$GameType";
-
- if (isValidTransformer()) {
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft EntityAutoRocket Patch", Level.INFO, "Injecting decodePacketdata into "+className+".");
- MethodVisitor mv = getWriter().visitMethod(ACC_PUBLIC, "decodePacketdata", "(Lio/netty/buffer/ByteBuf;)V", null, null);
+ public void injectMethod() {
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(1027, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESPECIAL, "micdoodle8/mods/galacticraft/api/prefab/entity/EntitySpaceshipBase", "decodePacketdata", "(Lio/netty/buffer/ByteBuf;)V", false);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(1029, l1);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/xmod/galacticraft/util/GalacticUtils", "getValidFuelForTier", "(L"+aEntity+";)Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitVarInsn(ASTORE, 2);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(1030, l2);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
- mv.visitVarInsn(ISTORE, 3);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(1031, l3);
- mv.visitVarInsn(ALOAD, 2);
- Label l4 = new Label();
- mv.visitJumpInsn(IFNULL, l4);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(1032, l5);
- mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/FluidStack", "<init>", "(Lnet/minecraftforge/fluids/FluidStack;I)V", false);
- mv.visitVarInsn(ASTORE, 4);
- Label l6 = new Label();
- mv.visitLabel(l6);
- mv.visitLineNumber(1033, l6);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitJumpInsn(IFNULL, l4);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(1034, l7);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "setFluid", "(Lnet/minecraftforge/fluids/FluidStack;)V", false);
- mv.visitLabel(l4);
- mv.visitLineNumber(1038, l4);
- mv.visitFrame(F_APPEND,2, new Object[] {"net/minecraftforge/fluids/FluidStack", INTEGER}, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readBoolean", "()Z", false);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "landing", "Z");
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(1039, l8);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "destinationFrequency", "I");
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(1041, l9);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readBoolean", "()Z", false);
- Label l10 = new Label();
- mv.visitJumpInsn(IFEQ, l10);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(1043, l11);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitTypeInsn(NEW, "micdoodle8/mods/galacticraft/api/vector/BlockVec3");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
- mv.visitMethodInsn(INVOKESPECIAL, "micdoodle8/mods/galacticraft/api/vector/BlockVec3", "<init>", "(III)V", false);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "targetVec", "Lmicdoodle8/mods/galacticraft/api/vector/BlockVec3;");
- mv.visitLabel(l10);
- mv.visitLineNumber(1046, l10);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
- mv.visitLdcInsn(new Double("8000.0"));
- mv.visitInsn(DDIV);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "motionX", "D");
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLineNumber(1047, l12);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
- mv.visitLdcInsn(new Double("8000.0"));
- mv.visitInsn(DDIV);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "motionY", "D");
- Label l13 = new Label();
- mv.visitLabel(l13);
- mv.visitLineNumber(1048, l13);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
- mv.visitLdcInsn(new Double("8000.0"));
- mv.visitInsn(DDIV);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "motionZ", "D");
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLineNumber(1049, l14);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
- mv.visitLdcInsn(new Double("8000.0"));
- mv.visitInsn(DDIV);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "lastMotionY", "D");
- Label l15 = new Label();
- mv.visitLabel(l15);
- mv.visitLineNumber(1050, l15);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
- mv.visitLdcInsn(new Double("8000.0"));
- mv.visitInsn(DDIV);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "lastLastMotionY", "D");
- Label l16 = new Label();
- mv.visitLabel(l16);
- mv.visitLineNumber(1052, l16);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "cargoItems", "[L"+aItemStack+";");
- Label l17 = new Label();
- mv.visitJumpInsn(IFNONNULL, l17);
- Label l18 = new Label();
- mv.visitLabel(l18);
- mv.visitLineNumber(1054, l18);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "getSizeInventory", "()I", false);
- mv.visitTypeInsn(ANEWARRAY, aItemStack);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "cargoItems", "[L"+aItemStack+";");
- mv.visitLabel(l17);
- mv.visitLineNumber(1057, l17);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readBoolean", "()Z", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "setWaitForPlayer", "(Z)V", false);
- Label l19 = new Label();
- mv.visitLabel(l19);
- mv.visitLineNumber(1059, l19);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/network/ByteBufUtils", "readUTF8String", "(Lio/netty/buffer/ByteBuf;)Ljava/lang/String;", false);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusMessage", "Ljava/lang/String;");
- Label l20 = new Label();
- mv.visitLabel(l20);
- mv.visitLineNumber(1060, l20);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusMessage", "Ljava/lang/String;");
- mv.visitLdcInsn("");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l21 = new Label();
- mv.visitJumpInsn(IFEQ, l21);
- mv.visitInsn(ACONST_NULL);
- Label l22 = new Label();
- mv.visitJumpInsn(GOTO, l22);
- mv.visitLabel(l21);
- mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {"micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket"});
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusMessage", "Ljava/lang/String;");
- mv.visitLabel(l22);
- mv.visitFrame(F_FULL, 4, new Object[] {"micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "io/netty/buffer/ByteBuf", "net/minecraftforge/fluids/FluidStack", INTEGER}, 2, new Object[] {"micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "java/lang/String"});
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusMessage", "Ljava/lang/String;");
- Label l23 = new Label();
- mv.visitLabel(l23);
- mv.visitLineNumber(1061, l23);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusMessageCooldown", "I");
- Label l24 = new Label();
- mv.visitLabel(l24);
- mv.visitLineNumber(1062, l24);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "lastStatusMessageCooldown", "I");
- Label l25 = new Label();
- mv.visitLabel(l25);
- mv.visitLineNumber(1063, l25);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readBoolean", "()Z", false);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusValid", "Z");
- Label l26 = new Label();
- mv.visitLabel(l26);
- mv.visitLineNumber(1066, l26);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "worldObj", "L"+aWorld+";");
- mv.visitFieldInsn(GETFIELD, aWorld, "isRemote", "Z");
- Label l27 = new Label();
- mv.visitJumpInsn(IFEQ, l27);
- Label l28 = new Label();
- mv.visitLabel(l28);
- mv.visitLineNumber(1068, l28);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
- mv.visitVarInsn(ISTORE, 4);
- Label l29 = new Label();
- mv.visitLabel(l29);
- mv.visitLineNumber(1069, l29);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "riddenByEntity", "L"+aEntity+";");
- Label l30 = new Label();
- mv.visitJumpInsn(IFNONNULL, l30);
- Label l31 = new Label();
- mv.visitLabel(l31);
- mv.visitLineNumber(1071, l31);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitInsn(ICONST_M1);
- mv.visitJumpInsn(IF_ICMPLE, l27);
- Label l32 = new Label();
- mv.visitLabel(l32);
- mv.visitLineNumber(1073, l32);
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/client/FMLClientHandler", "instance", "()Lcpw/mods/fml/client/FMLClientHandler;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "cpw/mods/fml/client/FMLClientHandler", "getWorldClient", "()L"+aWorldClient+";", false);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aWorldClient+"", "getEntityByID", "(I)L"+aEntity+";", false);
- mv.visitVarInsn(ASTORE, 5);
- Label l33 = new Label();
- mv.visitLabel(l33);
- mv.visitLineNumber(1074, l33);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitJumpInsn(IFNULL, l27);
- Label l34 = new Label();
- mv.visitLabel(l34);
- mv.visitLineNumber(1076, l34);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitFieldInsn(GETFIELD, ""+aEntity+"", "dimension", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "dimension", "I");
- Label l35 = new Label();
- mv.visitJumpInsn(IF_ICMPEQ, l35);
- Label l36 = new Label();
- mv.visitLabel(l36);
- mv.visitLineNumber(1078, l36);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitTypeInsn(INSTANCEOF, ""+aEntityPlayer+"");
- mv.visitJumpInsn(IFEQ, l27);
- Label l37 = new Label();
- mv.visitLabel(l37);
- mv.visitLineNumber(1080, l37);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "dimension", "I");
- mv.visitVarInsn(ALOAD, 5);
- mv.visitFieldInsn(GETFIELD, ""+aEntity+"", "worldObj", "L"+aWorld+";");
- mv.visitFieldInsn(GETFIELD, aWorld, "difficultySetting", "L"+aDifficultyEnum+";");
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aDifficultyEnum+"", "getDifficultyId", "()I", false);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitFieldInsn(GETFIELD, ""+aEntity+"", "worldObj", "L"+aWorld+";");
- mv.visitMethodInsn(INVOKEVIRTUAL, aWorld, "getWorldInfo", "()L"+aWorldInfo+";", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aWorldInfo+"", "getTerrainType", "()L"+aWorldType+";", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, aWorldType, "getWorldTypeName", "()Ljava/lang/String;", false);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitTypeInsn(CHECKCAST, ""+aEntityPlayerMP+"");
- mv.visitFieldInsn(GETFIELD, ""+aEntityPlayerMP+"", "theItemInWorldManager", "L"+aItemInWorldManager+";");
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aItemInWorldManager+"", "getGameType", "()L"+aGameType+";", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aGameType+"", "getID", "()I", false);
- mv.visitMethodInsn(INVOKESTATIC, "micdoodle8/mods/galacticraft/core/util/WorldUtil", "forceRespawnClient", "(IILjava/lang/String;I)L"+aEntityPlayer+";", false);
- mv.visitVarInsn(ASTORE, 5);
- Label l38 = new Label();
- mv.visitLabel(l38);
- mv.visitLineNumber(1081, l38);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aEntity+"", "mountEntity", "(L"+aEntity+";)V", false);
- Label l39 = new Label();
- mv.visitLabel(l39);
- mv.visitLineNumber(1083, l39);
- mv.visitJumpInsn(GOTO, l27);
- mv.visitLabel(l35);
- mv.visitLineNumber(1085, l35);
- mv.visitFrame(F_APPEND,2, new Object[] {INTEGER, ""+aEntity+""}, 0, null);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aEntity+"", "mountEntity", "(L"+aEntity+";)V", false);
- Label l40 = new Label();
- mv.visitLabel(l40);
- mv.visitLineNumber(1088, l40);
- mv.visitJumpInsn(GOTO, l27);
- mv.visitLabel(l30);
- mv.visitLineNumber(1089, l30);
- mv.visitFrame(F_CHOP,1, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "riddenByEntity", "L"+aEntity+";");
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aEntity+"", "getEntityId", "()I", false);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitJumpInsn(IF_ICMPEQ, l27);
- Label l41 = new Label();
- mv.visitLabel(l41);
- mv.visitLineNumber(1091, l41);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitInsn(ICONST_M1);
- Label l42 = new Label();
- mv.visitJumpInsn(IF_ICMPNE, l42);
- Label l43 = new Label();
- mv.visitLabel(l43);
- mv.visitLineNumber(1093, l43);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "riddenByEntity", "L"+aEntity+";");
- mv.visitInsn(ACONST_NULL);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aEntity+"", "mountEntity", "(L"+aEntity+";)V", false);
- Label l44 = new Label();
- mv.visitLabel(l44);
- mv.visitLineNumber(1094, l44);
- mv.visitJumpInsn(GOTO, l27);
- mv.visitLabel(l42);
- mv.visitLineNumber(1097, l42);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/client/FMLClientHandler", "instance", "()Lcpw/mods/fml/client/FMLClientHandler;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "cpw/mods/fml/client/FMLClientHandler", "getWorldClient", "()L"+aWorldClient+";", false);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aWorldClient+"", "getEntityByID", "(I)L"+aEntity+";", false);
- mv.visitVarInsn(ASTORE, 5);
- Label l45 = new Label();
- mv.visitLabel(l45);
- mv.visitLineNumber(1098, l45);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitJumpInsn(IFNULL, l27);
- Label l46 = new Label();
- mv.visitLabel(l46);
- mv.visitLineNumber(1100, l46);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitFieldInsn(GETFIELD, ""+aEntity+"", "dimension", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "dimension", "I");
- Label l47 = new Label();
- mv.visitJumpInsn(IF_ICMPEQ, l47);
- Label l48 = new Label();
- mv.visitLabel(l48);
- mv.visitLineNumber(1102, l48);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitTypeInsn(INSTANCEOF, ""+aEntityPlayer+"");
- mv.visitJumpInsn(IFEQ, l27);
- Label l49 = new Label();
- mv.visitLabel(l49);
- mv.visitLineNumber(1104, l49);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "dimension", "I");
- mv.visitVarInsn(ALOAD, 5);
- mv.visitFieldInsn(GETFIELD, ""+aEntity+"", "worldObj", "L"+aWorld+";");
- mv.visitFieldInsn(GETFIELD, aWorld, "difficultySetting", "L"+aDifficultyEnum+";");
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aDifficultyEnum+"", "getDifficultyId", "()I", false);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitFieldInsn(GETFIELD, ""+aEntity+"", "worldObj", "L"+aWorld+";");
- mv.visitMethodInsn(INVOKEVIRTUAL, aWorld, "getWorldInfo", "()L"+aWorldInfo+";", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aWorldInfo+"", "getTerrainType", "()L"+aWorldType+";", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, aWorldType, "getWorldTypeName", "()Ljava/lang/String;", false);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitTypeInsn(CHECKCAST, ""+aEntityPlayerMP+"");
- mv.visitFieldInsn(GETFIELD, ""+aEntityPlayerMP+"", "theItemInWorldManager", "L"+aItemInWorldManager+";");
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aItemInWorldManager+"", "getGameType", "()L"+aGameType+";", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aGameType+"", "getID", "()I", false);
- mv.visitMethodInsn(INVOKESTATIC, "micdoodle8/mods/galacticraft/core/util/WorldUtil", "forceRespawnClient", "(IILjava/lang/String;I)L"+aEntityPlayer+";", false);
- mv.visitVarInsn(ASTORE, 5);
- Label l50 = new Label();
- mv.visitLabel(l50);
- mv.visitLineNumber(1105, l50);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aEntity+"", "mountEntity", "(L"+aEntity+";)V", false);
- Label l51 = new Label();
- mv.visitLabel(l51);
- mv.visitLineNumber(1107, l51);
- mv.visitJumpInsn(GOTO, l27);
- mv.visitLabel(l47);
- mv.visitLineNumber(1109, l47);
- mv.visitFrame(F_APPEND,1, new Object[] {""+aEntity+""}, 0, null);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aEntity+"", "mountEntity", "(L"+aEntity+";)V", false);
- mv.visitLabel(l27);
- mv.visitLineNumber(1114, l27);
- mv.visitFrame(F_CHOP,2, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/network/ByteBufUtils", "readUTF8String", "(Lio/netty/buffer/ByteBuf;)Ljava/lang/String;", false);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusColour", "Ljava/lang/String;");
- Label l52 = new Label();
- mv.visitLabel(l52);
- mv.visitLineNumber(1115, l52);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusColour", "Ljava/lang/String;");
- mv.visitLdcInsn("");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l53 = new Label();
- mv.visitJumpInsn(IFEQ, l53);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(ACONST_NULL);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusColour", "Ljava/lang/String;");
- mv.visitLabel(l53);
- mv.visitLineNumber(1116, l53);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(RETURN);
- Label l54 = new Label();
- mv.visitLabel(l54);
- mv.visitLocalVariable("this", "Lmicdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket;", null, l0, l54, 0);
- mv.visitLocalVariable("buffer", "Lio/netty/buffer/ByteBuf;", null, l0, l54, 1);
- mv.visitLocalVariable("g", "Lnet/minecraftforge/fluids/FluidStack;", null, l2, l54, 2);
- mv.visitLocalVariable("aBufferData", "I", null, l3, l54, 3);
- mv.visitLocalVariable("s", "Lnet/minecraftforge/fluids/FluidStack;", null, l6, l4, 4);
- mv.visitLocalVariable("shouldBeMountedId", "I", null, l29, l27, 4);
- mv.visitLocalVariable("e", "L"+aEntity+";", null, l33, l40, 5);
- mv.visitLocalVariable("e", "L"+aEntity+";", null, l45, l27, 5);
- mv.visitMaxs(6, 6);
- mv.visitEnd();
+ String aEntityPlayer = isObfuscated
+ ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayer")
+ : "net/minecraft/entity/player/EntityPlayer";
+ String aEntityPlayerMP = isObfuscated
+ ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayerMP")
+ : "net/minecraft/entity/player/EntityPlayerMP";
+ String aWorld =
+ isObfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
+ String aItemStack =
+ isObfuscated ? DevHelper.getObfuscated("net/minecraft/item/ItemStack") : "net/minecraft/item/ItemStack";
+ String aEntity =
+ isObfuscated ? DevHelper.getObfuscated("net/minecraft/entity/Entity") : "net/minecraft/entity/Entity";
+ String aWorldClient = isObfuscated
+ ? DevHelper.getObfuscated("net/minecraft/client/multiplayer/WorldClient")
+ : "net/minecraft/client/multiplayer/WorldClient";
+ String aDifficultyEnum = isObfuscated
+ ? DevHelper.getObfuscated("net/minecraft/world/EnumDifficulty")
+ : "net/minecraft/world/EnumDifficulty";
+ String aWorldInfo = isObfuscated
+ ? DevHelper.getObfuscated("net/minecraft/world/storage/WorldInfo")
+ : "net/minecraft/world/storage/WorldInfo";
+ String aItemInWorldManager = isObfuscated
+ ? DevHelper.getObfuscated("net/minecraft/server/management/ItemInWorldManager")
+ : "net/minecraft/server/management/ItemInWorldManager";
+ String aWorldType = isObfuscated
+ ? DevHelper.getObfuscated("net/minecraft/world/WorldType")
+ : "net/minecraft/world/WorldType";
+ String aGameType = isObfuscated
+ ? DevHelper.getObfuscated("net/minecraft/world/WorldSettings$GameType")
+ : "net/minecraft/world/WorldSettings$GameType";
- }
- }
+ if (isValidTransformer()) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Galacticraft EntityAutoRocket Patch",
+ Level.INFO,
+ "Injecting decodePacketdata into " + className + ".");
+ MethodVisitor mv =
+ getWriter().visitMethod(ACC_PUBLIC, "decodePacketdata", "(Lio/netty/buffer/ByteBuf;)V", null, null);
- public static final class localClassVisitor extends ClassVisitor {
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(1027, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntitySpaceshipBase",
+ "decodePacketdata",
+ "(Lio/netty/buffer/ByteBuf;)V",
+ false);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(1029, l1);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/xmod/galacticraft/util/GalacticUtils",
+ "getValidFuelForTier",
+ "(L" + aEntity + ";)Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitVarInsn(ASTORE, 2);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(1030, l2);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
+ mv.visitVarInsn(ISTORE, 3);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(1031, l3);
+ mv.visitVarInsn(ALOAD, 2);
+ Label l4 = new Label();
+ mv.visitJumpInsn(IFNULL, l4);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(1032, l5);
+ mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "<init>",
+ "(Lnet/minecraftforge/fluids/FluidStack;I)V",
+ false);
+ mv.visitVarInsn(ASTORE, 4);
+ Label l6 = new Label();
+ mv.visitLabel(l6);
+ mv.visitLineNumber(1033, l6);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitJumpInsn(IFNULL, l4);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(1034, l7);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "setFluid",
+ "(Lnet/minecraftforge/fluids/FluidStack;)V",
+ false);
+ mv.visitLabel(l4);
+ mv.visitLineNumber(1038, l4);
+ mv.visitFrame(F_APPEND, 2, new Object[] {"net/minecraftforge/fluids/FluidStack", INTEGER}, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readBoolean", "()Z", false);
+ mv.visitFieldInsn(
+ PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "landing", "Z");
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(1039, l8);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "destinationFrequency",
+ "I");
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(1041, l9);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readBoolean", "()Z", false);
+ Label l10 = new Label();
+ mv.visitJumpInsn(IFEQ, l10);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(1043, l11);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitTypeInsn(NEW, "micdoodle8/mods/galacticraft/api/vector/BlockVec3");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
+ mv.visitMethodInsn(
+ INVOKESPECIAL, "micdoodle8/mods/galacticraft/api/vector/BlockVec3", "<init>", "(III)V", false);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "targetVec",
+ "Lmicdoodle8/mods/galacticraft/api/vector/BlockVec3;");
+ mv.visitLabel(l10);
+ mv.visitLineNumber(1046, l10);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
+ mv.visitLdcInsn(new Double("8000.0"));
+ mv.visitInsn(DDIV);
+ mv.visitFieldInsn(
+ PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "motionX", "D");
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLineNumber(1047, l12);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
+ mv.visitLdcInsn(new Double("8000.0"));
+ mv.visitInsn(DDIV);
+ mv.visitFieldInsn(
+ PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "motionY", "D");
+ Label l13 = new Label();
+ mv.visitLabel(l13);
+ mv.visitLineNumber(1048, l13);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
+ mv.visitLdcInsn(new Double("8000.0"));
+ mv.visitInsn(DDIV);
+ mv.visitFieldInsn(
+ PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "motionZ", "D");
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLineNumber(1049, l14);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
+ mv.visitLdcInsn(new Double("8000.0"));
+ mv.visitInsn(DDIV);
+ mv.visitFieldInsn(
+ PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "lastMotionY", "D");
+ Label l15 = new Label();
+ mv.visitLabel(l15);
+ mv.visitLineNumber(1050, l15);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readDouble", "()D", false);
+ mv.visitLdcInsn(new Double("8000.0"));
+ mv.visitInsn(DDIV);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "lastLastMotionY",
+ "D");
+ Label l16 = new Label();
+ mv.visitLabel(l16);
+ mv.visitLineNumber(1052, l16);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "cargoItems",
+ "[L" + aItemStack + ";");
+ Label l17 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l17);
+ Label l18 = new Label();
+ mv.visitLabel(l18);
+ mv.visitLineNumber(1054, l18);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "getSizeInventory",
+ "()I",
+ false);
+ mv.visitTypeInsn(ANEWARRAY, aItemStack);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "cargoItems",
+ "[L" + aItemStack + ";");
+ mv.visitLabel(l17);
+ mv.visitLineNumber(1057, l17);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readBoolean", "()Z", false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "setWaitForPlayer",
+ "(Z)V",
+ false);
+ Label l19 = new Label();
+ mv.visitLabel(l19);
+ mv.visitLineNumber(1059, l19);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "cpw/mods/fml/common/network/ByteBufUtils",
+ "readUTF8String",
+ "(Lio/netty/buffer/ByteBuf;)Ljava/lang/String;",
+ false);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "statusMessage",
+ "Ljava/lang/String;");
+ Label l20 = new Label();
+ mv.visitLabel(l20);
+ mv.visitLineNumber(1060, l20);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "statusMessage",
+ "Ljava/lang/String;");
+ mv.visitLdcInsn("");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l21 = new Label();
+ mv.visitJumpInsn(IFEQ, l21);
+ mv.visitInsn(ACONST_NULL);
+ Label l22 = new Label();
+ mv.visitJumpInsn(GOTO, l22);
+ mv.visitLabel(l21);
+ mv.visitFrame(
+ F_SAME1, 0, null, 1, new Object[] {"micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket"
+ });
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "statusMessage",
+ "Ljava/lang/String;");
+ mv.visitLabel(l22);
+ mv.visitFrame(
+ F_FULL,
+ 4,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "io/netty/buffer/ByteBuf",
+ "net/minecraftforge/fluids/FluidStack",
+ INTEGER
+ },
+ 2,
+ new Object[] {"micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "java/lang/String"
+ });
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "statusMessage",
+ "Ljava/lang/String;");
+ Label l23 = new Label();
+ mv.visitLabel(l23);
+ mv.visitLineNumber(1061, l23);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "statusMessageCooldown",
+ "I");
+ Label l24 = new Label();
+ mv.visitLabel(l24);
+ mv.visitLineNumber(1062, l24);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "lastStatusMessageCooldown",
+ "I");
+ Label l25 = new Label();
+ mv.visitLabel(l25);
+ mv.visitLineNumber(1063, l25);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readBoolean", "()Z", false);
+ mv.visitFieldInsn(
+ PUTFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "statusValid", "Z");
+ Label l26 = new Label();
+ mv.visitLabel(l26);
+ mv.visitLineNumber(1066, l26);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "worldObj",
+ "L" + aWorld + ";");
+ mv.visitFieldInsn(GETFIELD, aWorld, "isRemote", "Z");
+ Label l27 = new Label();
+ mv.visitJumpInsn(IFEQ, l27);
+ Label l28 = new Label();
+ mv.visitLabel(l28);
+ mv.visitLineNumber(1068, l28);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "io/netty/buffer/ByteBuf", "readInt", "()I", false);
+ mv.visitVarInsn(ISTORE, 4);
+ Label l29 = new Label();
+ mv.visitLabel(l29);
+ mv.visitLineNumber(1069, l29);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "riddenByEntity",
+ "L" + aEntity + ";");
+ Label l30 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l30);
+ Label l31 = new Label();
+ mv.visitLabel(l31);
+ mv.visitLineNumber(1071, l31);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitInsn(ICONST_M1);
+ mv.visitJumpInsn(IF_ICMPLE, l27);
+ Label l32 = new Label();
+ mv.visitLabel(l32);
+ mv.visitLineNumber(1073, l32);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "cpw/mods/fml/client/FMLClientHandler",
+ "instance",
+ "()Lcpw/mods/fml/client/FMLClientHandler;",
+ false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "cpw/mods/fml/client/FMLClientHandler",
+ "getWorldClient",
+ "()L" + aWorldClient + ";",
+ false);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aWorldClient + "", "getEntityByID", "(I)L" + aEntity + ";", false);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l33 = new Label();
+ mv.visitLabel(l33);
+ mv.visitLineNumber(1074, l33);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitJumpInsn(IFNULL, l27);
+ Label l34 = new Label();
+ mv.visitLabel(l34);
+ mv.visitLineNumber(1076, l34);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitFieldInsn(GETFIELD, "" + aEntity + "", "dimension", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "dimension", "I");
+ Label l35 = new Label();
+ mv.visitJumpInsn(IF_ICMPEQ, l35);
+ Label l36 = new Label();
+ mv.visitLabel(l36);
+ mv.visitLineNumber(1078, l36);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitTypeInsn(INSTANCEOF, "" + aEntityPlayer + "");
+ mv.visitJumpInsn(IFEQ, l27);
+ Label l37 = new Label();
+ mv.visitLabel(l37);
+ mv.visitLineNumber(1080, l37);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "dimension", "I");
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitFieldInsn(GETFIELD, "" + aEntity + "", "worldObj", "L" + aWorld + ";");
+ mv.visitFieldInsn(GETFIELD, aWorld, "difficultySetting", "L" + aDifficultyEnum + ";");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aDifficultyEnum + "", "getDifficultyId", "()I", false);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitFieldInsn(GETFIELD, "" + aEntity + "", "worldObj", "L" + aWorld + ";");
+ mv.visitMethodInsn(INVOKEVIRTUAL, aWorld, "getWorldInfo", "()L" + aWorldInfo + ";", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aWorldInfo + "", "getTerrainType", "()L" + aWorldType + ";", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, aWorldType, "getWorldTypeName", "()Ljava/lang/String;", false);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitTypeInsn(CHECKCAST, "" + aEntityPlayerMP + "");
+ mv.visitFieldInsn(
+ GETFIELD, "" + aEntityPlayerMP + "", "theItemInWorldManager", "L" + aItemInWorldManager + ";");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "" + aItemInWorldManager + "", "getGameType", "()L" + aGameType + ";", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aGameType + "", "getID", "()I", false);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "micdoodle8/mods/galacticraft/core/util/WorldUtil",
+ "forceRespawnClient",
+ "(IILjava/lang/String;I)L" + aEntityPlayer + ";",
+ false);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l38 = new Label();
+ mv.visitLabel(l38);
+ mv.visitLineNumber(1081, l38);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aEntity + "", "mountEntity", "(L" + aEntity + ";)V", false);
+ Label l39 = new Label();
+ mv.visitLabel(l39);
+ mv.visitLineNumber(1083, l39);
+ mv.visitJumpInsn(GOTO, l27);
+ mv.visitLabel(l35);
+ mv.visitLineNumber(1085, l35);
+ mv.visitFrame(F_APPEND, 2, new Object[] {INTEGER, "" + aEntity + ""}, 0, null);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aEntity + "", "mountEntity", "(L" + aEntity + ";)V", false);
+ Label l40 = new Label();
+ mv.visitLabel(l40);
+ mv.visitLineNumber(1088, l40);
+ mv.visitJumpInsn(GOTO, l27);
+ mv.visitLabel(l30);
+ mv.visitLineNumber(1089, l30);
+ mv.visitFrame(F_CHOP, 1, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "riddenByEntity",
+ "L" + aEntity + ";");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aEntity + "", "getEntityId", "()I", false);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitJumpInsn(IF_ICMPEQ, l27);
+ Label l41 = new Label();
+ mv.visitLabel(l41);
+ mv.visitLineNumber(1091, l41);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitInsn(ICONST_M1);
+ Label l42 = new Label();
+ mv.visitJumpInsn(IF_ICMPNE, l42);
+ Label l43 = new Label();
+ mv.visitLabel(l43);
+ mv.visitLineNumber(1093, l43);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "riddenByEntity",
+ "L" + aEntity + ";");
+ mv.visitInsn(ACONST_NULL);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aEntity + "", "mountEntity", "(L" + aEntity + ";)V", false);
+ Label l44 = new Label();
+ mv.visitLabel(l44);
+ mv.visitLineNumber(1094, l44);
+ mv.visitJumpInsn(GOTO, l27);
+ mv.visitLabel(l42);
+ mv.visitLineNumber(1097, l42);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "cpw/mods/fml/client/FMLClientHandler",
+ "instance",
+ "()Lcpw/mods/fml/client/FMLClientHandler;",
+ false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "cpw/mods/fml/client/FMLClientHandler",
+ "getWorldClient",
+ "()L" + aWorldClient + ";",
+ false);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aWorldClient + "", "getEntityByID", "(I)L" + aEntity + ";", false);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l45 = new Label();
+ mv.visitLabel(l45);
+ mv.visitLineNumber(1098, l45);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitJumpInsn(IFNULL, l27);
+ Label l46 = new Label();
+ mv.visitLabel(l46);
+ mv.visitLineNumber(1100, l46);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitFieldInsn(GETFIELD, "" + aEntity + "", "dimension", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "dimension", "I");
+ Label l47 = new Label();
+ mv.visitJumpInsn(IF_ICMPEQ, l47);
+ Label l48 = new Label();
+ mv.visitLabel(l48);
+ mv.visitLineNumber(1102, l48);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitTypeInsn(INSTANCEOF, "" + aEntityPlayer + "");
+ mv.visitJumpInsn(IFEQ, l27);
+ Label l49 = new Label();
+ mv.visitLabel(l49);
+ mv.visitLineNumber(1104, l49);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket", "dimension", "I");
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitFieldInsn(GETFIELD, "" + aEntity + "", "worldObj", "L" + aWorld + ";");
+ mv.visitFieldInsn(GETFIELD, aWorld, "difficultySetting", "L" + aDifficultyEnum + ";");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aDifficultyEnum + "", "getDifficultyId", "()I", false);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitFieldInsn(GETFIELD, "" + aEntity + "", "worldObj", "L" + aWorld + ";");
+ mv.visitMethodInsn(INVOKEVIRTUAL, aWorld, "getWorldInfo", "()L" + aWorldInfo + ";", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aWorldInfo + "", "getTerrainType", "()L" + aWorldType + ";", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, aWorldType, "getWorldTypeName", "()Ljava/lang/String;", false);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitTypeInsn(CHECKCAST, "" + aEntityPlayerMP + "");
+ mv.visitFieldInsn(
+ GETFIELD, "" + aEntityPlayerMP + "", "theItemInWorldManager", "L" + aItemInWorldManager + ";");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "" + aItemInWorldManager + "", "getGameType", "()L" + aGameType + ";", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aGameType + "", "getID", "()I", false);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "micdoodle8/mods/galacticraft/core/util/WorldUtil",
+ "forceRespawnClient",
+ "(IILjava/lang/String;I)L" + aEntityPlayer + ";",
+ false);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l50 = new Label();
+ mv.visitLabel(l50);
+ mv.visitLineNumber(1105, l50);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aEntity + "", "mountEntity", "(L" + aEntity + ";)V", false);
+ Label l51 = new Label();
+ mv.visitLabel(l51);
+ mv.visitLineNumber(1107, l51);
+ mv.visitJumpInsn(GOTO, l27);
+ mv.visitLabel(l47);
+ mv.visitLineNumber(1109, l47);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"" + aEntity + ""}, 0, null);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aEntity + "", "mountEntity", "(L" + aEntity + ";)V", false);
+ mv.visitLabel(l27);
+ mv.visitLineNumber(1114, l27);
+ mv.visitFrame(F_CHOP, 2, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "cpw/mods/fml/common/network/ByteBufUtils",
+ "readUTF8String",
+ "(Lio/netty/buffer/ByteBuf;)Ljava/lang/String;",
+ false);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "statusColour",
+ "Ljava/lang/String;");
+ Label l52 = new Label();
+ mv.visitLabel(l52);
+ mv.visitLineNumber(1115, l52);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "statusColour",
+ "Ljava/lang/String;");
+ mv.visitLdcInsn("");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l53 = new Label();
+ mv.visitJumpInsn(IFEQ, l53);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket",
+ "statusColour",
+ "Ljava/lang/String;");
+ mv.visitLabel(l53);
+ mv.visitLineNumber(1116, l53);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(RETURN);
+ Label l54 = new Label();
+ mv.visitLabel(l54);
+ mv.visitLocalVariable(
+ "this", "Lmicdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket;", null, l0, l54, 0);
+ mv.visitLocalVariable("buffer", "Lio/netty/buffer/ByteBuf;", null, l0, l54, 1);
+ mv.visitLocalVariable("g", "Lnet/minecraftforge/fluids/FluidStack;", null, l2, l54, 2);
+ mv.visitLocalVariable("aBufferData", "I", null, l3, l54, 3);
+ mv.visitLocalVariable("s", "Lnet/minecraftforge/fluids/FluidStack;", null, l6, l4, 4);
+ mv.visitLocalVariable("shouldBeMountedId", "I", null, l29, l27, 4);
+ mv.visitLocalVariable("e", "L" + aEntity + ";", null, l33, l40, 5);
+ mv.visitLocalVariable("e", "L" + aEntity + ";", null, l45, l27, 5);
+ mv.visitMaxs(6, 6);
+ mv.visitEnd();
+ }
+ }
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft EntityAutoRocket Patch", Level.INFO, "Inspecting Class "+className);
- }
+ public static final class localClassVisitor extends ClassVisitor {
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- if (name.equals("decodePacketdata")) {
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft EntityAutoRocket Patch", Level.INFO, "Removing method "+name);
- return null;
- }
- MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- return methodVisitor;
- }
- }
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Galacticraft EntityAutoRocket Patch", Level.INFO, "Inspecting Class " + className);
+ }
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ if (name.equals("decodePacketdata")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Galacticraft EntityAutoRocket Patch", Level.INFO, "Removing method " + name);
+ return null;
+ }
+ MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FluidUtil.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FluidUtil.java
index 13681e7e3a..ec2a9cecbb 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FluidUtil.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FluidUtil.java
@@ -2,7 +2,7 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import java.io.IOException;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -10,233 +10,304 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
+public class ClassTransformer_GC_FluidUtil {
+
+ // The qualified name of the class we plan to transform.
+ private static final String className = "micdoodle8.mods.galacticraft.core.util.FluidUtil";
+ // "micdoodle8/mods/galacticraft/core/util/FluidUtil
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ public ClassTransformer_GC_FluidUtil(byte[] basicClass, boolean obfuscated) {
+
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter), 0);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ reader = aTempReader;
+ writer = aTempWriter;
+
+ if (reader != null && writer != null) {
+ injectMethod("testFuel");
+ injectMethod("fillWithGCFuel");
+ }
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public void injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ if (aMethodName.equals("testFuel")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Galacticraft FluidUtils Patch",
+ Level.INFO,
+ "Injecting " + aMethodName + " into " + className + ".");
+ mv = getWriter().visitMethod(ACC_PUBLIC + ACC_STATIC, "testFuel", "(Ljava/lang/String;)Z", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(37, l0);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "gtPlusPlus/core/item/chemistry/RocketFuels",
+ "mValidRocketFuelNames",
+ "Ljava/util/HashSet;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/HashSet", "iterator", "()Ljava/util/Iterator;", false);
+ mv.visitVarInsn(ASTORE, 2);
+ Label l1 = new Label();
+ mv.visitJumpInsn(GOTO, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitFrame(F_FULL, 3, new Object[] {"java/lang/String", TOP, "java/util/Iterator"}, 0, new Object[] {});
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "java/lang/String");
+ mv.visitVarInsn(ASTORE, 1);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(38, l3);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ mv.visitJumpInsn(IFEQ, l1);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(39, l4);
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(37, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
+ mv.visitJumpInsn(IFNE, l2);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(42, l5);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(IRETURN);
+ Label l6 = new Label();
+ mv.visitLabel(l6);
+ mv.visitLocalVariable("name", "Ljava/lang/String;", null, l0, l6, 0);
+ mv.visitLocalVariable("aFuelname", "Ljava/lang/String;", null, l3, l1, 1);
+ mv.visitMaxs(2, 3);
+ mv.visitEnd();
+ } else if (aMethodName.equals("fillWithGCFuel")) {
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "fillWithGCFuel",
+ "(Lnet/minecraftforge/fluids/FluidTank;Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(46, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNULL, l1);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/fluids/FluidRegistry",
+ "getFluidName",
+ "(Lnet/minecraftforge/fluids/FluidStack;)Ljava/lang/String;",
+ false);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "micdoodle8/mods/galacticraft/core/util/FluidUtil",
+ "testFuel",
+ "(Ljava/lang/String;)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(47, l2);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitVarInsn(ASTORE, 3);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(48, l3);
+ mv.visitVarInsn(ALOAD, 3);
+ Label l4 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l4);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(49, l5);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "gtPlusPlus/core/item/chemistry/RocketFuels",
+ "mValidRocketFuels",
+ "Ljava/util/HashMap;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/HashMap", "values", "()Ljava/util/Collection;", false);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Collection", "iterator", "()Ljava/util/Iterator;", true);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l6 = new Label();
+ mv.visitJumpInsn(GOTO, l6);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitFrame(
+ F_FULL,
+ 6,
+ new Object[] {
+ "net/minecraftforge/fluids/FluidTank",
+ "net/minecraftforge/fluids/FluidStack",
+ INTEGER,
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ "java/util/Iterator"
+ },
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "net/minecraftforge/fluids/Fluid");
+ mv.visitVarInsn(ASTORE, 4);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(50, l8);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/Fluid;",
+ false);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitJumpInsn(IF_ACMPNE, l6);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(51, l9);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "<init>",
+ "(Lnet/minecraftforge/fluids/Fluid;I)V",
+ false);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "fill",
+ "(Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ false);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(49, l6);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
+ mv.visitJumpInsn(IFNE, l7);
+ mv.visitLabel(l4);
+ mv.visitLineNumber(55, l4);
+ mv.visitFrame(
+ F_FULL,
+ 4,
+ new Object[] {
+ "net/minecraftforge/fluids/FluidTank",
+ "net/minecraftforge/fluids/FluidStack",
+ INTEGER,
+ "net/minecraftforge/fluids/FluidStack"
+ },
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getCapacity", "()I", false);
+ mv.visitJumpInsn(IF_ICMPGE, l1);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(56, l10);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "<init>",
+ "(Lnet/minecraftforge/fluids/FluidStack;I)V",
+ false);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "fill",
+ "(Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ false);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(59, l1);
+ mv.visitFrame(F_CHOP, 1, null, 0, null);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(IRETURN);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLocalVariable("tank", "Lnet/minecraftforge/fluids/FluidTank;", null, l0, l11, 0);
+ mv.visitLocalVariable("liquid", "Lnet/minecraftforge/fluids/FluidStack;", null, l0, l11, 1);
+ mv.visitLocalVariable("doFill", "Z", null, l0, l11, 2);
+ mv.visitLocalVariable("liquidInTank", "Lnet/minecraftforge/fluids/FluidStack;", null, l3, l1, 3);
+ mv.visitLocalVariable("aFuelType", "Lnet/minecraftforge/fluids/Fluid;", null, l8, l6, 4);
+ mv.visitMaxs(5, 6);
+ mv.visitEnd();
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Galacticraft FluidUtils Patch", Level.INFO, "Method injection complete.");
+ }
+ public static final class localClassVisitor extends ClassVisitor {
-public class ClassTransformer_GC_FluidUtil {
-
- //The qualified name of the class we plan to transform.
- private static final String className = "micdoodle8.mods.galacticraft.core.util.FluidUtil";
- //"micdoodle8/mods/galacticraft/core/util/FluidUtil
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- public ClassTransformer_GC_FluidUtil(byte[] basicClass, boolean obfuscated) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- reader = aTempReader;
- writer = aTempWriter;
-
- if (reader != null && writer != null) {
- injectMethod("testFuel");
- injectMethod("fillWithGCFuel");
- }
-
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public void injectMethod(String aMethodName) {
- MethodVisitor mv;
- if (aMethodName.equals("testFuel")) {
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft FluidUtils Patch", Level.INFO, "Injecting "+aMethodName+" into "+className+".");
- mv = getWriter().visitMethod(ACC_PUBLIC + ACC_STATIC, "testFuel", "(Ljava/lang/String;)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(37, l0);
- mv.visitFieldInsn(GETSTATIC, "gtPlusPlus/core/item/chemistry/RocketFuels", "mValidRocketFuelNames", "Ljava/util/HashSet;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/HashSet", "iterator", "()Ljava/util/Iterator;", false);
- mv.visitVarInsn(ASTORE, 2);
- Label l1 = new Label();
- mv.visitJumpInsn(GOTO, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitFrame(F_FULL, 3, new Object[] {"java/lang/String", TOP, "java/util/Iterator"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "java/lang/String");
- mv.visitVarInsn(ASTORE, 1);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(38, l3);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- mv.visitJumpInsn(IFEQ, l1);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(39, l4);
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l1);
- mv.visitLineNumber(37, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
- mv.visitJumpInsn(IFNE, l2);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(42, l5);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(IRETURN);
- Label l6 = new Label();
- mv.visitLabel(l6);
- mv.visitLocalVariable("name", "Ljava/lang/String;", null, l0, l6, 0);
- mv.visitLocalVariable("aFuelname", "Ljava/lang/String;", null, l3, l1, 1);
- mv.visitMaxs(2, 3);
- mv.visitEnd();
- }
- else if (aMethodName.equals("fillWithGCFuel")) {
- mv = getWriter().visitMethod(ACC_PUBLIC + ACC_STATIC, "fillWithGCFuel", "(Lnet/minecraftforge/fluids/FluidTank;Lnet/minecraftforge/fluids/FluidStack;Z)I", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(46, l0);
- mv.visitVarInsn(ALOAD, 1);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNULL, l1);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/fluids/FluidRegistry", "getFluidName", "(Lnet/minecraftforge/fluids/FluidStack;)Ljava/lang/String;", false);
- mv.visitMethodInsn(INVOKESTATIC, "micdoodle8/mods/galacticraft/core/util/FluidUtil", "testFuel", "(Ljava/lang/String;)Z", false);
- mv.visitJumpInsn(IFEQ, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(47, l2);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getFluid", "()Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitVarInsn(ASTORE, 3);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(48, l3);
- mv.visitVarInsn(ALOAD, 3);
- Label l4 = new Label();
- mv.visitJumpInsn(IFNONNULL, l4);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(49, l5);
- mv.visitFieldInsn(GETSTATIC, "gtPlusPlus/core/item/chemistry/RocketFuels", "mValidRocketFuels", "Ljava/util/HashMap;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/HashMap", "values", "()Ljava/util/Collection;", false);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Collection", "iterator", "()Ljava/util/Iterator;", true);
- mv.visitVarInsn(ASTORE, 5);
- Label l6 = new Label();
- mv.visitJumpInsn(GOTO, l6);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitFrame(F_FULL, 6, new Object[] {"net/minecraftforge/fluids/FluidTank", "net/minecraftforge/fluids/FluidStack", INTEGER, "net/minecraftforge/fluids/FluidStack", TOP, "java/util/Iterator"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 5);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "net/minecraftforge/fluids/Fluid");
- mv.visitVarInsn(ASTORE, 4);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(50, l8);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidStack", "getFluid", "()Lnet/minecraftforge/fluids/Fluid;", false);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitJumpInsn(IF_ACMPNE, l6);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(51, l9);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/FluidStack", "<init>", "(Lnet/minecraftforge/fluids/Fluid;I)V", false);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "fill", "(Lnet/minecraftforge/fluids/FluidStack;Z)I", false);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l6);
- mv.visitLineNumber(49, l6);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
- mv.visitJumpInsn(IFNE, l7);
- mv.visitLabel(l4);
- mv.visitLineNumber(55, l4);
- mv.visitFrame(F_FULL, 4, new Object[] {"net/minecraftforge/fluids/FluidTank", "net/minecraftforge/fluids/FluidStack", INTEGER, "net/minecraftforge/fluids/FluidStack"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 3);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getCapacity", "()I", false);
- mv.visitJumpInsn(IF_ICMPGE, l1);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(56, l10);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/FluidStack", "<init>", "(Lnet/minecraftforge/fluids/FluidStack;I)V", false);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "fill", "(Lnet/minecraftforge/fluids/FluidStack;Z)I", false);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l1);
- mv.visitLineNumber(59, l1);
- mv.visitFrame(F_CHOP,1, null, 0, null);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(IRETURN);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLocalVariable("tank", "Lnet/minecraftforge/fluids/FluidTank;", null, l0, l11, 0);
- mv.visitLocalVariable("liquid", "Lnet/minecraftforge/fluids/FluidStack;", null, l0, l11, 1);
- mv.visitLocalVariable("doFill", "Z", null, l0, l11, 2);
- mv.visitLocalVariable("liquidInTank", "Lnet/minecraftforge/fluids/FluidStack;", null, l3, l1, 3);
- mv.visitLocalVariable("aFuelType", "Lnet/minecraftforge/fluids/Fluid;", null, l8, l6, 4);
- mv.visitMaxs(5, 6);
- mv.visitEnd();
- }
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft FluidUtils Patch", Level.INFO, "Method injection complete.");
-
- }
-
- public static final class localClassVisitor extends ClassVisitor {
-
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- if (name.equals("testFuel")) {
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft FluidUtils Patch", Level.INFO, "Removing method "+name);
- return null;
- }
- if (name.equals("fillWithGCFuel")) {
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft FluidUtils Patch", Level.INFO, "Removing method "+name);
- return null;
- }
- MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- return methodVisitor;
- }
- }
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ if (name.equals("testFuel")) {
+ FMLRelaunchLog.log("[GT++ ASM] Galacticraft FluidUtils Patch", Level.INFO, "Removing method " + name);
+ return null;
+ }
+ if (name.equals("fillWithGCFuel")) {
+ FMLRelaunchLog.log("[GT++ ASM] Galacticraft FluidUtils Patch", Level.INFO, "Removing method " + name);
+ return null;
+ }
+ MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FuelLoader.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FuelLoader.java
index 5ef5b75505..13137824d8 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FuelLoader.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GC_FuelLoader.java
@@ -2,7 +2,8 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import java.io.IOException;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.preloader.DevHelper;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -10,613 +11,1015 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.preloader.DevHelper;
+public class ClassTransformer_GC_FuelLoader {
+
+ // The qualified name of the class we plan to transform.
+ private static final String className = "micdoodle8.mods.galacticraft.core.tile.TileEntityFuelLoader";
+ // micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+ private final boolean isObfuscated;
-public class ClassTransformer_GC_FuelLoader {
+ public ClassTransformer_GC_FuelLoader(byte[] basicClass, boolean obfuscated) {
- //The qualified name of the class we plan to transform.
- private static final String className = "micdoodle8.mods.galacticraft.core.tile.TileEntityFuelLoader";
- //micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
- private final boolean isObfuscated;
+ isObfuscated = obfuscated;
- public ClassTransformer_GC_FuelLoader(byte[] basicClass, boolean obfuscated) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- isObfuscated = obfuscated;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- reader = aTempReader;
- writer = aTempWriter;
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter), 0);
- if (reader != null && writer != null) {
- injectMethod();
- }
- else {
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft Fuel_Loader Patch", Level.INFO, "Failed to Inject new code.");
- }
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ reader = aTempReader;
+ writer = aTempWriter;
- }
+ if (reader != null && writer != null) {
+ injectMethod();
+ } else {
+ FMLRelaunchLog.log("[GT++ ASM] Galacticraft Fuel_Loader Patch", Level.INFO, "Failed to Inject new code.");
+ }
+ }
- public boolean isValidTransformer() {
- return isValid;
- }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- public ClassReader getReader() {
- return reader;
- }
+ public ClassReader getReader() {
+ return reader;
+ }
- public ClassWriter getWriter() {
- return writer;
- }
+ public ClassWriter getWriter() {
+ return writer;
+ }
- public void injectMethod() {
- String aWorld = isObfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
- String aItemStack = isObfuscated ? DevHelper.getObfuscated("net/minecraft/item/ItemStack") : "net/minecraft/item/ItemStack";
- String aTileEntity = isObfuscated ? DevHelper.getObfuscated("net/minecraft/tileentity/TileEntity") : "net/minecraft/tileentity/TileEntity";
-
- if (isValidTransformer()) {
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft Fuel_Loader Patch", Level.INFO, "Injecting updateEntity into "+className+".");
- MethodVisitor mv = getWriter().visitMethod(ACC_PUBLIC, "updateEntity", "()V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(60, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESPECIAL, "micdoodle8/mods/galacticraft/core/energy/tile/TileBaseElectricBlockWithInventory", "updateEntity", "()V", false);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(61, l1);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "worldObj", "L"+aWorld+";");
- mv.visitFieldInsn(GETFIELD, ""+aWorld+"", "isRemote", "Z");
- Label l2 = new Label();
- mv.visitJumpInsn(IFNE, l2);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(62, l3);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(ICONST_0);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "loadedFuelLastTick", "Z");
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(63, l4);
- mv.visitInsn(ACONST_NULL);
- mv.visitVarInsn(ASTORE, 1);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(66, l5);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "containingItems", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(AALOAD);
- Label l6 = new Label();
- mv.visitJumpInsn(IFNULL, l6);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(67, l7);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "containingItems", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/fluids/FluidContainerRegistry", "getFluidForFilledItem", "(L"+aItemStack+";)Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitVarInsn(ASTORE, 1);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(68, l8);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitJumpInsn(IFNULL, l6);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(69, l9);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "net/minecraftforge/fluids/FluidRegistry", "getFluidName", "(Lnet/minecraftforge/fluids/FluidStack;)Ljava/lang/String;", false);
- mv.visitMethodInsn(INVOKESTATIC, "micdoodle8/mods/galacticraft/core/util/FluidUtil", "testFuel", "(Ljava/lang/String;)Z", false);
- mv.visitVarInsn(ISTORE, 4);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(70, l10);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitJumpInsn(IFEQ, l6);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getFluid", "()Lnet/minecraftforge/fluids/FluidStack;", false);
- Label l11 = new Label();
- mv.visitJumpInsn(IFNULL, l11);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLineNumber(71, l12);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getFluid", "()Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitInsn(IADD);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getCapacity", "()I", false);
- mv.visitJumpInsn(IF_ICMPGT, l6);
- mv.visitLabel(l11);
- mv.visitLineNumber(73, l11);
- mv.visitFrame(F_FULL, 5, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack", TOP, TOP, INTEGER}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getFluid", "()Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitVarInsn(ASTORE, 5);
- Label l13 = new Label();
- mv.visitLabel(l13);
- mv.visitLineNumber(74, l13);
- mv.visitInsn(ICONST_0);
- mv.visitVarInsn(ISTORE, 6);
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLineNumber(75, l14);
- mv.visitVarInsn(ALOAD, 5);
- Label l15 = new Label();
- mv.visitJumpInsn(IFNONNULL, l15);
- Label l16 = new Label();
- mv.visitLabel(l16);
- mv.visitLineNumber(76, l16);
- mv.visitFieldInsn(GETSTATIC, "gtPlusPlus/core/item/chemistry/RocketFuels", "mValidRocketFuels", "Ljava/util/HashMap;");
- Label l17 = new Label();
- mv.visitLabel(l17);
- mv.visitLineNumber(77, l17);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/HashMap", "values", "()Ljava/util/Collection;", false);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Collection", "iterator", "()Ljava/util/Iterator;", true);
- mv.visitVarInsn(ASTORE, 8);
- Label l18 = new Label();
- mv.visitJumpInsn(GOTO, l18);
- Label l19 = new Label();
- mv.visitLabel(l19);
- mv.visitFrame(F_FULL, 9, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack", TOP, TOP, INTEGER, "net/minecraftforge/fluids/FluidStack", INTEGER, TOP, "java/util/Iterator"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 8);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "net/minecraftforge/fluids/Fluid");
- mv.visitVarInsn(ASTORE, 7);
- Label l20 = new Label();
- mv.visitLabel(l20);
- mv.visitLineNumber(78, l20);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidStack", "getFluid", "()Lnet/minecraftforge/fluids/Fluid;", false);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitJumpInsn(IF_ACMPNE, l18);
- Label l21 = new Label();
- mv.visitLabel(l21);
- mv.visitLineNumber(79, l21);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/FluidStack", "<init>", "(Lnet/minecraftforge/fluids/Fluid;I)V", false);
- mv.visitInsn(ICONST_1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "fill", "(Lnet/minecraftforge/fluids/FluidStack;Z)I", false);
- Label l22 = new Label();
- mv.visitJumpInsn(IFLE, l22);
- mv.visitInsn(ICONST_1);
- Label l23 = new Label();
- mv.visitJumpInsn(GOTO, l23);
- mv.visitLabel(l22);
- mv.visitFrame(F_FULL, 9, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack", TOP, TOP, INTEGER, "net/minecraftforge/fluids/FluidStack", INTEGER, "net/minecraftforge/fluids/Fluid", "java/util/Iterator"}, 0, new Object[] {});
- mv.visitInsn(ICONST_0);
- mv.visitLabel(l23);
- mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {INTEGER});
- mv.visitVarInsn(ISTORE, 6);
- mv.visitLabel(l18);
- mv.visitLineNumber(76, l18);
- mv.visitFrame(F_FULL, 9, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack", TOP, TOP, INTEGER, "net/minecraftforge/fluids/FluidStack", INTEGER, TOP, "java/util/Iterator"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 8);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
- mv.visitJumpInsn(IFNE, l19);
- Label l24 = new Label();
- mv.visitLabel(l24);
- mv.visitLineNumber(82, l24);
- Label l25 = new Label();
- mv.visitJumpInsn(GOTO, l25);
- mv.visitLabel(l15);
- mv.visitLineNumber(84, l15);
- mv.visitFrame(F_FULL, 7, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack", TOP, TOP, INTEGER, "net/minecraftforge/fluids/FluidStack", INTEGER}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 5);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getCapacity", "()I", false);
- mv.visitJumpInsn(IF_ICMPGE, l25);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidStack", "isFluidEqual", "(Lnet/minecraftforge/fluids/FluidStack;)Z", false);
- mv.visitJumpInsn(IFEQ, l25);
- Label l26 = new Label();
- mv.visitLabel(l26);
- mv.visitLineNumber(85, l26);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/FluidStack", "<init>", "(Lnet/minecraftforge/fluids/FluidStack;I)V", false);
- mv.visitInsn(ICONST_1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "fill", "(Lnet/minecraftforge/fluids/FluidStack;Z)I", false);
- Label l27 = new Label();
- mv.visitJumpInsn(IFLE, l27);
- mv.visitInsn(ICONST_1);
- Label l28 = new Label();
- mv.visitJumpInsn(GOTO, l28);
- mv.visitLabel(l27);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(ICONST_0);
- mv.visitLabel(l28);
- mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {INTEGER});
- mv.visitVarInsn(ISTORE, 6);
- mv.visitLabel(l25);
- mv.visitLineNumber(88, l25);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ILOAD, 6);
- mv.visitJumpInsn(IFEQ, l6);
- Label l29 = new Label();
- mv.visitLabel(l29);
- mv.visitLineNumber(89, l29);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "containingItems", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(AALOAD);
- mv.visitInsn(DUP);
- mv.visitFieldInsn(GETFIELD, ""+aItemStack+"", "stackSize", "I");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(ISUB);
- mv.visitFieldInsn(PUTFIELD, ""+aItemStack+"", "stackSize", "I");
- Label l30 = new Label();
- mv.visitLabel(l30);
- mv.visitLineNumber(90, l30);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "containingItems", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(AALOAD);
- mv.visitFieldInsn(GETFIELD, ""+aItemStack+"", "stackSize", "I");
- mv.visitJumpInsn(IFNE, l6);
- Label l31 = new Label();
- mv.visitLabel(l31);
- mv.visitLineNumber(91, l31);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "containingItems", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(AASTORE);
- mv.visitLabel(l6);
- mv.visitLineNumber(97, l6);
- mv.visitFrame(F_FULL, 2, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "ticks", "I");
- mv.visitIntInsn(BIPUSH, 100);
- mv.visitInsn(IREM);
- Label l32 = new Label();
- mv.visitJumpInsn(IFNE, l32);
- Label l33 = new Label();
- mv.visitLabel(l33);
- mv.visitLineNumber(98, l33);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(ACONST_NULL);
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "attachedFuelable", "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
- Label l34 = new Label();
- mv.visitLabel(l34);
- mv.visitLineNumber(99, l34);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/util/ForgeDirection", "VALID_DIRECTIONS", "[Lnet/minecraftforge/common/util/ForgeDirection;");
- mv.visitVarInsn(ASTORE, 4);
- Label l35 = new Label();
- mv.visitLabel(l35);
- mv.visitLineNumber(100, l35);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitInsn(ARRAYLENGTH);
- mv.visitVarInsn(ISTORE, 3);
- Label l36 = new Label();
- mv.visitLabel(l36);
- mv.visitLineNumber(102, l36);
- mv.visitInsn(ICONST_0);
- mv.visitVarInsn(ISTORE, 2);
- Label l37 = new Label();
- mv.visitLabel(l37);
- Label l38 = new Label();
- mv.visitJumpInsn(GOTO, l38);
- Label l39 = new Label();
- mv.visitLabel(l39);
- mv.visitLineNumber(103, l39);
- mv.visitFrame(F_APPEND,3, new Object[] {INTEGER, INTEGER, "[Lnet/minecraftforge/common/util/ForgeDirection;"}, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitInsn(AALOAD);
- mv.visitVarInsn(ASTORE, 5);
- Label l40 = new Label();
- mv.visitLabel(l40);
- mv.visitLineNumber(104, l40);
- mv.visitTypeInsn(NEW, "micdoodle8/mods/galacticraft/api/vector/BlockVec3");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESPECIAL, "micdoodle8/mods/galacticraft/api/vector/BlockVec3", "<init>", "(L"+aTileEntity+";)V", false);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "worldObj", "L"+aWorld+";");
- mv.visitVarInsn(ALOAD, 5);
- mv.visitMethodInsn(INVOKEVIRTUAL, "micdoodle8/mods/galacticraft/api/vector/BlockVec3", "getTileEntityOnSide", "(L"+aWorld+";Lnet/minecraftforge/common/util/ForgeDirection;)L"+aTileEntity+";", false);
- mv.visitVarInsn(ASTORE, 6);
- Label l41 = new Label();
- mv.visitLabel(l41);
- mv.visitLineNumber(105, l41);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitTypeInsn(INSTANCEOF, "micdoodle8/mods/galacticraft/core/tile/TileEntityMulti");
- Label l42 = new Label();
- mv.visitJumpInsn(IFEQ, l42);
- Label l43 = new Label();
- mv.visitLabel(l43);
- mv.visitLineNumber(106, l43);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitTypeInsn(CHECKCAST, "micdoodle8/mods/galacticraft/core/tile/TileEntityMulti");
- mv.visitMethodInsn(INVOKEVIRTUAL, "micdoodle8/mods/galacticraft/core/tile/TileEntityMulti", "getMainBlockTile", "()L"+aTileEntity+";", false);
- mv.visitVarInsn(ASTORE, 7);
- Label l44 = new Label();
- mv.visitLabel(l44);
- mv.visitLineNumber(107, l44);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitTypeInsn(INSTANCEOF, "micdoodle8/mods/galacticraft/api/entity/IFuelable");
- Label l45 = new Label();
- mv.visitJumpInsn(IFEQ, l45);
- Label l46 = new Label();
- mv.visitLabel(l46);
- mv.visitLineNumber(108, l46);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitTypeInsn(CHECKCAST, "micdoodle8/mods/galacticraft/api/entity/IFuelable");
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "attachedFuelable", "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
- Label l47 = new Label();
- mv.visitLabel(l47);
- mv.visitLineNumber(109, l47);
- mv.visitJumpInsn(GOTO, l32);
- mv.visitLabel(l42);
- mv.visitLineNumber(111, l42);
- mv.visitFrame(F_APPEND,2, new Object[] {"net/minecraftforge/common/util/ForgeDirection", ""+aTileEntity+""}, 0, null);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitTypeInsn(INSTANCEOF, "micdoodle8/mods/galacticraft/api/entity/IFuelable");
- mv.visitJumpInsn(IFEQ, l45);
- Label l48 = new Label();
- mv.visitLabel(l48);
- mv.visitLineNumber(112, l48);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitTypeInsn(CHECKCAST, "micdoodle8/mods/galacticraft/api/entity/IFuelable");
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "attachedFuelable", "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
- Label l49 = new Label();
- mv.visitLabel(l49);
- mv.visitLineNumber(113, l49);
- mv.visitJumpInsn(GOTO, l32);
- mv.visitLabel(l45);
- mv.visitLineNumber(102, l45);
- mv.visitFrame(F_CHOP,2, null, 0, null);
- mv.visitIincInsn(2, 1);
- mv.visitLabel(l38);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitJumpInsn(IF_ICMPLT, l39);
- mv.visitLabel(l32);
- mv.visitLineNumber(117, l32);
- mv.visitFrame(F_CHOP,3, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitJumpInsn(IFNULL, l2);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getFluid", "()Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitJumpInsn(IFNULL, l2);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getFluid", "()Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitJumpInsn(IFLE, l2);
- Label l50 = new Label();
- mv.visitLabel(l50);
- mv.visitLineNumber(118, l50);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getFluid", "()Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitVarInsn(ASTORE, 4);
- Label l51 = new Label();
- mv.visitLabel(l51);
- mv.visitLineNumber(119, l51);
- mv.visitVarInsn(ALOAD, 4);
- Label l52 = new Label();
- mv.visitJumpInsn(IFNONNULL, l52);
- Label l53 = new Label();
- mv.visitLabel(l53);
- mv.visitLineNumber(120, l53);
- mv.visitFieldInsn(GETSTATIC, "gtPlusPlus/core/item/chemistry/RocketFuels", "mValidRocketFuels", "Ljava/util/HashMap;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/HashMap", "values", "()Ljava/util/Collection;", false);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Collection", "iterator", "()Ljava/util/Iterator;", true);
- mv.visitVarInsn(ASTORE, 6);
- Label l54 = new Label();
- mv.visitJumpInsn(GOTO, l54);
- Label l55 = new Label();
- mv.visitLabel(l55);
- mv.visitFrame(F_FULL, 7, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack", TOP, TOP, "net/minecraftforge/fluids/FluidStack", TOP, "java/util/Iterator"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 6);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
- mv.visitTypeInsn(CHECKCAST, "net/minecraftforge/fluids/Fluid");
- mv.visitVarInsn(ASTORE, 5);
- Label l56 = new Label();
- mv.visitLabel(l56);
- mv.visitLineNumber(121, l56);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getFluid", "()Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidStack", "getFluid", "()Lnet/minecraftforge/fluids/Fluid;", false);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitJumpInsn(IF_ACMPNE, l54);
- Label l57 = new Label();
- mv.visitLabel(l57);
- mv.visitLineNumber(122, l57);
- mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitInsn(ICONST_2);
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/FluidStack", "<init>", "(Lnet/minecraftforge/fluids/Fluid;I)V", false);
- mv.visitVarInsn(ASTORE, 1);
- mv.visitLabel(l54);
- mv.visitLineNumber(120, l54);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
- mv.visitJumpInsn(IFNE, l55);
- mv.visitLabel(l52);
- mv.visitLineNumber(126, l52);
- mv.visitFrame(F_FULL, 5, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack", TOP, TOP, "net/minecraftforge/fluids/FluidStack"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getCapacity", "()I", false);
- Label l58 = new Label();
- mv.visitJumpInsn(IF_ICMPGE, l58);
- Label l59 = new Label();
- mv.visitLabel(l59);
- mv.visitLineNumber(127, l59);
- mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitInsn(ICONST_2);
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/FluidStack", "<init>", "(Lnet/minecraftforge/fluids/FluidStack;I)V", false);
- mv.visitVarInsn(ASTORE, 1);
- mv.visitLabel(l58);
- mv.visitLineNumber(130, l58);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitJumpInsn(IFNULL, l2);
- Label l60 = new Label();
- mv.visitLabel(l60);
- mv.visitLineNumber(131, l60);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "attachedFuelable", "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
- mv.visitJumpInsn(IFNULL, l2);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "hasEnoughEnergyToRun", "Z");
- mv.visitJumpInsn(IFEQ, l2);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "disabled", "Z");
- mv.visitJumpInsn(IFNE, l2);
- Label l61 = new Label();
- mv.visitLabel(l61);
- mv.visitLineNumber(132, l61);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "attachedFuelable", "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/xmod/galacticraft/util/GalacticUtils", "getRocketTier", "(Ljava/lang/Object;)I", false);
- mv.visitVarInsn(ISTORE, 5);
- Label l62 = new Label();
- mv.visitLabel(l62);
- mv.visitLineNumber(133, l62);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitJumpInsn(IFLE, l2);
- Label l63 = new Label();
- mv.visitLabel(l63);
- mv.visitLineNumber(134, l63);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/xmod/galacticraft/util/GalacticUtils", "isFuelValidForTier", "(ILnet/minecraftforge/fluids/FluidStack;)Z", false);
- mv.visitJumpInsn(IFEQ, l2);
- Label l64 = new Label();
- mv.visitLabel(l64);
- mv.visitLineNumber(135, l64);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "attachedFuelable", "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
- mv.visitVarInsn(ALOAD, 1);
- mv.visitInsn(ICONST_1);
- mv.visitMethodInsn(INVOKEINTERFACE, "micdoodle8/mods/galacticraft/api/entity/IFuelable", "addFuel", "(Lnet/minecraftforge/fluids/FluidStack;Z)I", true);
- mv.visitVarInsn(ISTORE, 3);
- Label l65 = new Label();
- mv.visitLabel(l65);
- mv.visitLineNumber(136, l65);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ILOAD, 3);
- Label l66 = new Label();
- mv.visitJumpInsn(IFLE, l66);
- mv.visitInsn(ICONST_1);
- Label l67 = new Label();
- mv.visitJumpInsn(GOTO, l67);
- mv.visitLabel(l66);
- mv.visitFrame(F_FULL, 6, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack", TOP, INTEGER, "net/minecraftforge/fluids/FluidStack", INTEGER}, 1, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader"});
- mv.visitInsn(ICONST_0);
- mv.visitLabel(l67);
- mv.visitFrame(F_FULL, 6, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "net/minecraftforge/fluids/FluidStack", TOP, INTEGER, "net/minecraftforge/fluids/FluidStack", INTEGER}, 2, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", INTEGER});
- mv.visitFieldInsn(PUTFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "loadedFuelLastTick", "Z");
- Label l68 = new Label();
- mv.visitLabel(l68);
- mv.visitLineNumber(137, l68);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "fuelTank", "Lnet/minecraftforge/fluids/FluidTank;");
- mv.visitVarInsn(ILOAD, 3);
- mv.visitInsn(ICONST_1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "drain", "(IZ)Lnet/minecraftforge/fluids/FluidStack;", false);
- mv.visitInsn(POP);
- mv.visitLabel(l2);
- mv.visitLineNumber(144, l2);
- mv.visitFrame(F_FULL, 1, new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader"}, 0, new Object[] {});
- mv.visitInsn(RETURN);
- Label l69 = new Label();
- mv.visitLabel(l69);
- mv.visitLocalVariable("this", "Lmicdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader;", null, l0, l69, 0);
- mv.visitLocalVariable("liquid", "Lnet/minecraftforge/fluids/FluidStack;", null, l5, l2, 1);
- mv.visitLocalVariable("amount", "I", null, l37, l32, 2);
- mv.visitLocalVariable("filled", "I", null, l36, l32, 3);
- mv.visitLocalVariable("filled", "I", null, l65, l2, 3);
- mv.visitLocalVariable("isFuel", "Z", null, l10, l6, 4);
- mv.visitLocalVariable("liquidInTank", "Lnet/minecraftforge/fluids/FluidStack;", null, l13, l6, 5);
- mv.visitLocalVariable("didFill", "Z", null, l14, l6, 6);
- mv.visitLocalVariable("aFuelType", "Lnet/minecraftforge/fluids/Fluid;", null, l20, l18, 7);
- mv.visitLocalVariable("var8", "[Lnet/minecraftforge/common/util/ForgeDirection;", null, l35, l32, 4);
- mv.visitLocalVariable("dir", "Lnet/minecraftforge/common/util/ForgeDirection;", null, l40, l45, 5);
- mv.visitLocalVariable("pad", "L"+aTileEntity+";", null, l41, l45, 6);
- mv.visitLocalVariable("mainTile", "L"+aTileEntity+";", null, l44, l42, 7);
- mv.visitLocalVariable("liquidInTank", "Lnet/minecraftforge/fluids/FluidStack;", null, l51, l2, 4);
- mv.visitLocalVariable("aFuelType", "Lnet/minecraftforge/fluids/Fluid;", null, l56, l54, 5);
- mv.visitLocalVariable("aTier", "I", null, l62, l2, 5);
- mv.visitMaxs(5, 9);
- mv.visitEnd();
- }
- }
+ public void injectMethod() {
+ String aWorld =
+ isObfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
+ String aItemStack =
+ isObfuscated ? DevHelper.getObfuscated("net/minecraft/item/ItemStack") : "net/minecraft/item/ItemStack";
+ String aTileEntity = isObfuscated
+ ? DevHelper.getObfuscated("net/minecraft/tileentity/TileEntity")
+ : "net/minecraft/tileentity/TileEntity";
- public static final class localClassVisitor extends ClassVisitor {
+ if (isValidTransformer()) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Galacticraft Fuel_Loader Patch",
+ Level.INFO,
+ "Injecting updateEntity into " + className + ".");
+ MethodVisitor mv = getWriter().visitMethod(ACC_PUBLIC, "updateEntity", "()V", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(60, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "micdoodle8/mods/galacticraft/core/energy/tile/TileBaseElectricBlockWithInventory",
+ "updateEntity",
+ "()V",
+ false);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(61, l1);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "worldObj",
+ "L" + aWorld + ";");
+ mv.visitFieldInsn(GETFIELD, "" + aWorld + "", "isRemote", "Z");
+ Label l2 = new Label();
+ mv.visitJumpInsn(IFNE, l2);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(62, l3);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(ICONST_0);
+ mv.visitFieldInsn(
+ PUTFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "loadedFuelLastTick", "Z");
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(63, l4);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitVarInsn(ASTORE, 1);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(66, l5);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "containingItems",
+ "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(AALOAD);
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNULL, l6);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(67, l7);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "containingItems",
+ "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/fluids/FluidContainerRegistry",
+ "getFluidForFilledItem",
+ "(L" + aItemStack + ";)Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitVarInsn(ASTORE, 1);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(68, l8);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitJumpInsn(IFNULL, l6);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(69, l9);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "net/minecraftforge/fluids/FluidRegistry",
+ "getFluidName",
+ "(Lnet/minecraftforge/fluids/FluidStack;)Ljava/lang/String;",
+ false);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "micdoodle8/mods/galacticraft/core/util/FluidUtil",
+ "testFuel",
+ "(Ljava/lang/String;)Z",
+ false);
+ mv.visitVarInsn(ISTORE, 4);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(70, l10);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitJumpInsn(IFEQ, l6);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ Label l11 = new Label();
+ mv.visitJumpInsn(IFNULL, l11);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLineNumber(71, l12);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitInsn(IADD);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getCapacity", "()I", false);
+ mv.visitJumpInsn(IF_ICMPGT, l6);
+ mv.visitLabel(l11);
+ mv.visitLineNumber(73, l11);
+ mv.visitFrame(
+ F_FULL,
+ 5,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ TOP,
+ INTEGER
+ },
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l13 = new Label();
+ mv.visitLabel(l13);
+ mv.visitLineNumber(74, l13);
+ mv.visitInsn(ICONST_0);
+ mv.visitVarInsn(ISTORE, 6);
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLineNumber(75, l14);
+ mv.visitVarInsn(ALOAD, 5);
+ Label l15 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l15);
+ Label l16 = new Label();
+ mv.visitLabel(l16);
+ mv.visitLineNumber(76, l16);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "gtPlusPlus/core/item/chemistry/RocketFuels",
+ "mValidRocketFuels",
+ "Ljava/util/HashMap;");
+ Label l17 = new Label();
+ mv.visitLabel(l17);
+ mv.visitLineNumber(77, l17);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/HashMap", "values", "()Ljava/util/Collection;", false);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Collection", "iterator", "()Ljava/util/Iterator;", true);
+ mv.visitVarInsn(ASTORE, 8);
+ Label l18 = new Label();
+ mv.visitJumpInsn(GOTO, l18);
+ Label l19 = new Label();
+ mv.visitLabel(l19);
+ mv.visitFrame(
+ F_FULL,
+ 9,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ TOP,
+ INTEGER,
+ "net/minecraftforge/fluids/FluidStack",
+ INTEGER,
+ TOP,
+ "java/util/Iterator"
+ },
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "net/minecraftforge/fluids/Fluid");
+ mv.visitVarInsn(ASTORE, 7);
+ Label l20 = new Label();
+ mv.visitLabel(l20);
+ mv.visitLineNumber(78, l20);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/Fluid;",
+ false);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitJumpInsn(IF_ACMPNE, l18);
+ Label l21 = new Label();
+ mv.visitLabel(l21);
+ mv.visitLineNumber(79, l21);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "<init>",
+ "(Lnet/minecraftforge/fluids/Fluid;I)V",
+ false);
+ mv.visitInsn(ICONST_1);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "fill",
+ "(Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ false);
+ Label l22 = new Label();
+ mv.visitJumpInsn(IFLE, l22);
+ mv.visitInsn(ICONST_1);
+ Label l23 = new Label();
+ mv.visitJumpInsn(GOTO, l23);
+ mv.visitLabel(l22);
+ mv.visitFrame(
+ F_FULL,
+ 9,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ TOP,
+ INTEGER,
+ "net/minecraftforge/fluids/FluidStack",
+ INTEGER,
+ "net/minecraftforge/fluids/Fluid",
+ "java/util/Iterator"
+ },
+ 0,
+ new Object[] {});
+ mv.visitInsn(ICONST_0);
+ mv.visitLabel(l23);
+ mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {INTEGER});
+ mv.visitVarInsn(ISTORE, 6);
+ mv.visitLabel(l18);
+ mv.visitLineNumber(76, l18);
+ mv.visitFrame(
+ F_FULL,
+ 9,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ TOP,
+ INTEGER,
+ "net/minecraftforge/fluids/FluidStack",
+ INTEGER,
+ TOP,
+ "java/util/Iterator"
+ },
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
+ mv.visitJumpInsn(IFNE, l19);
+ Label l24 = new Label();
+ mv.visitLabel(l24);
+ mv.visitLineNumber(82, l24);
+ Label l25 = new Label();
+ mv.visitJumpInsn(GOTO, l25);
+ mv.visitLabel(l15);
+ mv.visitLineNumber(84, l15);
+ mv.visitFrame(
+ F_FULL,
+ 7,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ TOP,
+ INTEGER,
+ "net/minecraftforge/fluids/FluidStack",
+ INTEGER
+ },
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getCapacity", "()I", false);
+ mv.visitJumpInsn(IF_ICMPGE, l25);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "isFluidEqual",
+ "(Lnet/minecraftforge/fluids/FluidStack;)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l25);
+ Label l26 = new Label();
+ mv.visitLabel(l26);
+ mv.visitLineNumber(85, l26);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "<init>",
+ "(Lnet/minecraftforge/fluids/FluidStack;I)V",
+ false);
+ mv.visitInsn(ICONST_1);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "fill",
+ "(Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ false);
+ Label l27 = new Label();
+ mv.visitJumpInsn(IFLE, l27);
+ mv.visitInsn(ICONST_1);
+ Label l28 = new Label();
+ mv.visitJumpInsn(GOTO, l28);
+ mv.visitLabel(l27);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(ICONST_0);
+ mv.visitLabel(l28);
+ mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {INTEGER});
+ mv.visitVarInsn(ISTORE, 6);
+ mv.visitLabel(l25);
+ mv.visitLineNumber(88, l25);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ILOAD, 6);
+ mv.visitJumpInsn(IFEQ, l6);
+ Label l29 = new Label();
+ mv.visitLabel(l29);
+ mv.visitLineNumber(89, l29);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "containingItems",
+ "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(AALOAD);
+ mv.visitInsn(DUP);
+ mv.visitFieldInsn(GETFIELD, "" + aItemStack + "", "stackSize", "I");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(ISUB);
+ mv.visitFieldInsn(PUTFIELD, "" + aItemStack + "", "stackSize", "I");
+ Label l30 = new Label();
+ mv.visitLabel(l30);
+ mv.visitLineNumber(90, l30);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "containingItems",
+ "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(AALOAD);
+ mv.visitFieldInsn(GETFIELD, "" + aItemStack + "", "stackSize", "I");
+ mv.visitJumpInsn(IFNE, l6);
+ Label l31 = new Label();
+ mv.visitLabel(l31);
+ mv.visitLineNumber(91, l31);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "containingItems",
+ "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(AASTORE);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(97, l6);
+ mv.visitFrame(
+ F_FULL,
+ 2,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack"
+ },
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "ticks", "I");
+ mv.visitIntInsn(BIPUSH, 100);
+ mv.visitInsn(IREM);
+ Label l32 = new Label();
+ mv.visitJumpInsn(IFNE, l32);
+ Label l33 = new Label();
+ mv.visitLabel(l33);
+ mv.visitLineNumber(98, l33);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "attachedFuelable",
+ "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
+ Label l34 = new Label();
+ mv.visitLabel(l34);
+ mv.visitLineNumber(99, l34);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/util/ForgeDirection",
+ "VALID_DIRECTIONS",
+ "[Lnet/minecraftforge/common/util/ForgeDirection;");
+ mv.visitVarInsn(ASTORE, 4);
+ Label l35 = new Label();
+ mv.visitLabel(l35);
+ mv.visitLineNumber(100, l35);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitInsn(ARRAYLENGTH);
+ mv.visitVarInsn(ISTORE, 3);
+ Label l36 = new Label();
+ mv.visitLabel(l36);
+ mv.visitLineNumber(102, l36);
+ mv.visitInsn(ICONST_0);
+ mv.visitVarInsn(ISTORE, 2);
+ Label l37 = new Label();
+ mv.visitLabel(l37);
+ Label l38 = new Label();
+ mv.visitJumpInsn(GOTO, l38);
+ Label l39 = new Label();
+ mv.visitLabel(l39);
+ mv.visitLineNumber(103, l39);
+ mv.visitFrame(
+ F_APPEND,
+ 3,
+ new Object[] {INTEGER, INTEGER, "[Lnet/minecraftforge/common/util/ForgeDirection;"},
+ 0,
+ null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitInsn(AALOAD);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l40 = new Label();
+ mv.visitLabel(l40);
+ mv.visitLineNumber(104, l40);
+ mv.visitTypeInsn(NEW, "micdoodle8/mods/galacticraft/api/vector/BlockVec3");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "micdoodle8/mods/galacticraft/api/vector/BlockVec3",
+ "<init>",
+ "(L" + aTileEntity + ";)V",
+ false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "worldObj",
+ "L" + aWorld + ";");
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "micdoodle8/mods/galacticraft/api/vector/BlockVec3",
+ "getTileEntityOnSide",
+ "(L" + aWorld + ";Lnet/minecraftforge/common/util/ForgeDirection;)L" + aTileEntity + ";",
+ false);
+ mv.visitVarInsn(ASTORE, 6);
+ Label l41 = new Label();
+ mv.visitLabel(l41);
+ mv.visitLineNumber(105, l41);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitTypeInsn(INSTANCEOF, "micdoodle8/mods/galacticraft/core/tile/TileEntityMulti");
+ Label l42 = new Label();
+ mv.visitJumpInsn(IFEQ, l42);
+ Label l43 = new Label();
+ mv.visitLabel(l43);
+ mv.visitLineNumber(106, l43);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitTypeInsn(CHECKCAST, "micdoodle8/mods/galacticraft/core/tile/TileEntityMulti");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityMulti",
+ "getMainBlockTile",
+ "()L" + aTileEntity + ";",
+ false);
+ mv.visitVarInsn(ASTORE, 7);
+ Label l44 = new Label();
+ mv.visitLabel(l44);
+ mv.visitLineNumber(107, l44);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitTypeInsn(INSTANCEOF, "micdoodle8/mods/galacticraft/api/entity/IFuelable");
+ Label l45 = new Label();
+ mv.visitJumpInsn(IFEQ, l45);
+ Label l46 = new Label();
+ mv.visitLabel(l46);
+ mv.visitLineNumber(108, l46);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitTypeInsn(CHECKCAST, "micdoodle8/mods/galacticraft/api/entity/IFuelable");
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "attachedFuelable",
+ "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
+ Label l47 = new Label();
+ mv.visitLabel(l47);
+ mv.visitLineNumber(109, l47);
+ mv.visitJumpInsn(GOTO, l32);
+ mv.visitLabel(l42);
+ mv.visitLineNumber(111, l42);
+ mv.visitFrame(
+ F_APPEND,
+ 2,
+ new Object[] {"net/minecraftforge/common/util/ForgeDirection", "" + aTileEntity + ""},
+ 0,
+ null);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitTypeInsn(INSTANCEOF, "micdoodle8/mods/galacticraft/api/entity/IFuelable");
+ mv.visitJumpInsn(IFEQ, l45);
+ Label l48 = new Label();
+ mv.visitLabel(l48);
+ mv.visitLineNumber(112, l48);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitTypeInsn(CHECKCAST, "micdoodle8/mods/galacticraft/api/entity/IFuelable");
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "attachedFuelable",
+ "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
+ Label l49 = new Label();
+ mv.visitLabel(l49);
+ mv.visitLineNumber(113, l49);
+ mv.visitJumpInsn(GOTO, l32);
+ mv.visitLabel(l45);
+ mv.visitLineNumber(102, l45);
+ mv.visitFrame(F_CHOP, 2, null, 0, null);
+ mv.visitIincInsn(2, 1);
+ mv.visitLabel(l38);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitJumpInsn(IF_ICMPLT, l39);
+ mv.visitLabel(l32);
+ mv.visitLineNumber(117, l32);
+ mv.visitFrame(F_CHOP, 3, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitJumpInsn(IFNULL, l2);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitJumpInsn(IFNULL, l2);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitJumpInsn(IFLE, l2);
+ Label l50 = new Label();
+ mv.visitLabel(l50);
+ mv.visitLineNumber(118, l50);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitVarInsn(ASTORE, 4);
+ Label l51 = new Label();
+ mv.visitLabel(l51);
+ mv.visitLineNumber(119, l51);
+ mv.visitVarInsn(ALOAD, 4);
+ Label l52 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l52);
+ Label l53 = new Label();
+ mv.visitLabel(l53);
+ mv.visitLineNumber(120, l53);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "gtPlusPlus/core/item/chemistry/RocketFuels",
+ "mValidRocketFuels",
+ "Ljava/util/HashMap;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/HashMap", "values", "()Ljava/util/Collection;", false);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Collection", "iterator", "()Ljava/util/Iterator;", true);
+ mv.visitVarInsn(ASTORE, 6);
+ Label l54 = new Label();
+ mv.visitJumpInsn(GOTO, l54);
+ Label l55 = new Label();
+ mv.visitLabel(l55);
+ mv.visitFrame(
+ F_FULL,
+ 7,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ TOP,
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ "java/util/Iterator"
+ },
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
+ mv.visitTypeInsn(CHECKCAST, "net/minecraftforge/fluids/Fluid");
+ mv.visitVarInsn(ASTORE, 5);
+ Label l56 = new Label();
+ mv.visitLabel(l56);
+ mv.visitLineNumber(121, l56);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "getFluid",
+ "()Lnet/minecraftforge/fluids/Fluid;",
+ false);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitJumpInsn(IF_ACMPNE, l54);
+ Label l57 = new Label();
+ mv.visitLabel(l57);
+ mv.visitLineNumber(122, l57);
+ mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitInsn(ICONST_2);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "<init>",
+ "(Lnet/minecraftforge/fluids/Fluid;I)V",
+ false);
+ mv.visitVarInsn(ASTORE, 1);
+ mv.visitLabel(l54);
+ mv.visitLineNumber(120, l54);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
+ mv.visitJumpInsn(IFNE, l55);
+ mv.visitLabel(l52);
+ mv.visitLineNumber(126, l52);
+ mv.visitFrame(
+ F_FULL,
+ 5,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ TOP,
+ "net/minecraftforge/fluids/FluidStack"
+ },
+ 0,
+ new Object[] {});
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraftforge/fluids/FluidTank", "getCapacity", "()I", false);
+ Label l58 = new Label();
+ mv.visitJumpInsn(IF_ICMPGE, l58);
+ Label l59 = new Label();
+ mv.visitLabel(l59);
+ mv.visitLineNumber(127, l59);
+ mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitInsn(ICONST_2);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "<init>",
+ "(Lnet/minecraftforge/fluids/FluidStack;I)V",
+ false);
+ mv.visitVarInsn(ASTORE, 1);
+ mv.visitLabel(l58);
+ mv.visitLineNumber(130, l58);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitJumpInsn(IFNULL, l2);
+ Label l60 = new Label();
+ mv.visitLabel(l60);
+ mv.visitLineNumber(131, l60);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "attachedFuelable",
+ "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
+ mv.visitJumpInsn(IFNULL, l2);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "hasEnoughEnergyToRun",
+ "Z");
+ mv.visitJumpInsn(IFEQ, l2);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "disabled", "Z");
+ mv.visitJumpInsn(IFNE, l2);
+ Label l61 = new Label();
+ mv.visitLabel(l61);
+ mv.visitLineNumber(132, l61);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "attachedFuelable",
+ "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/xmod/galacticraft/util/GalacticUtils",
+ "getRocketTier",
+ "(Ljava/lang/Object;)I",
+ false);
+ mv.visitVarInsn(ISTORE, 5);
+ Label l62 = new Label();
+ mv.visitLabel(l62);
+ mv.visitLineNumber(133, l62);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitJumpInsn(IFLE, l2);
+ Label l63 = new Label();
+ mv.visitLabel(l63);
+ mv.visitLineNumber(134, l63);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/xmod/galacticraft/util/GalacticUtils",
+ "isFuelValidForTier",
+ "(ILnet/minecraftforge/fluids/FluidStack;)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l2);
+ Label l64 = new Label();
+ mv.visitLabel(l64);
+ mv.visitLineNumber(135, l64);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "attachedFuelable",
+ "Lmicdoodle8/mods/galacticraft/api/entity/IFuelable;");
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitInsn(ICONST_1);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "micdoodle8/mods/galacticraft/api/entity/IFuelable",
+ "addFuel",
+ "(Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ true);
+ mv.visitVarInsn(ISTORE, 3);
+ Label l65 = new Label();
+ mv.visitLabel(l65);
+ mv.visitLineNumber(136, l65);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 3);
+ Label l66 = new Label();
+ mv.visitJumpInsn(IFLE, l66);
+ mv.visitInsn(ICONST_1);
+ Label l67 = new Label();
+ mv.visitJumpInsn(GOTO, l67);
+ mv.visitLabel(l66);
+ mv.visitFrame(
+ F_FULL,
+ 6,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ INTEGER,
+ "net/minecraftforge/fluids/FluidStack",
+ INTEGER
+ },
+ 1,
+ new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader"});
+ mv.visitInsn(ICONST_0);
+ mv.visitLabel(l67);
+ mv.visitFrame(
+ F_FULL,
+ 6,
+ new Object[] {
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "net/minecraftforge/fluids/FluidStack",
+ TOP,
+ INTEGER,
+ "net/minecraftforge/fluids/FluidStack",
+ INTEGER
+ },
+ 2,
+ new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", INTEGER});
+ mv.visitFieldInsn(
+ PUTFIELD, "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader", "loadedFuelLastTick", "Z");
+ Label l68 = new Label();
+ mv.visitLabel(l68);
+ mv.visitLineNumber(137, l68);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader",
+ "fuelTank",
+ "Lnet/minecraftforge/fluids/FluidTank;");
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitInsn(ICONST_1);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraftforge/fluids/FluidTank",
+ "drain",
+ "(IZ)Lnet/minecraftforge/fluids/FluidStack;",
+ false);
+ mv.visitInsn(POP);
+ mv.visitLabel(l2);
+ mv.visitLineNumber(144, l2);
+ mv.visitFrame(
+ F_FULL,
+ 1,
+ new Object[] {"micdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader"},
+ 0,
+ new Object[] {});
+ mv.visitInsn(RETURN);
+ Label l69 = new Label();
+ mv.visitLabel(l69);
+ mv.visitLocalVariable(
+ "this", "Lmicdoodle8/mods/galacticraft/core/tile/TileEntityFuelLoader;", null, l0, l69, 0);
+ mv.visitLocalVariable("liquid", "Lnet/minecraftforge/fluids/FluidStack;", null, l5, l2, 1);
+ mv.visitLocalVariable("amount", "I", null, l37, l32, 2);
+ mv.visitLocalVariable("filled", "I", null, l36, l32, 3);
+ mv.visitLocalVariable("filled", "I", null, l65, l2, 3);
+ mv.visitLocalVariable("isFuel", "Z", null, l10, l6, 4);
+ mv.visitLocalVariable("liquidInTank", "Lnet/minecraftforge/fluids/FluidStack;", null, l13, l6, 5);
+ mv.visitLocalVariable("didFill", "Z", null, l14, l6, 6);
+ mv.visitLocalVariable("aFuelType", "Lnet/minecraftforge/fluids/Fluid;", null, l20, l18, 7);
+ mv.visitLocalVariable("var8", "[Lnet/minecraftforge/common/util/ForgeDirection;", null, l35, l32, 4);
+ mv.visitLocalVariable("dir", "Lnet/minecraftforge/common/util/ForgeDirection;", null, l40, l45, 5);
+ mv.visitLocalVariable("pad", "L" + aTileEntity + ";", null, l41, l45, 6);
+ mv.visitLocalVariable("mainTile", "L" + aTileEntity + ";", null, l44, l42, 7);
+ mv.visitLocalVariable("liquidInTank", "Lnet/minecraftforge/fluids/FluidStack;", null, l51, l2, 4);
+ mv.visitLocalVariable("aFuelType", "Lnet/minecraftforge/fluids/Fluid;", null, l56, l54, 5);
+ mv.visitLocalVariable("aTier", "I", null, l62, l2, 5);
+ mv.visitMaxs(5, 9);
+ mv.visitEnd();
+ }
+ }
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft Fuel_Loader Patch", Level.INFO, "Inspecting Class "+className);
- }
+ public static final class localClassVisitor extends ClassVisitor {
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- if (name.equals("updateEntity")) {
- FMLRelaunchLog.log("[GT++ ASM] Galacticraft Fuel_Loader Patch", Level.INFO, "Removing method "+name);
- return null;
- }
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Galacticraft Fuel_Loader Patch", Level.INFO, "Inspecting Class " + className);
+ }
- MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- return methodVisitor;
- }
- }
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ if (name.equals("updateEntity")) {
+ FMLRelaunchLog.log("[GT++ ASM] Galacticraft Fuel_Loader Patch", Level.INFO, "Removing method " + name);
+ return null;
+ }
+ MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements.java
index 2b9729a8a3..0ee90e43a7 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements.java
@@ -2,6 +2,7 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.ClassReader;
@@ -10,1887 +11,2442 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import net.minecraftforge.common.MinecraftForge;
-
-public class ClassTransformer_GT_Achievements {
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
- private static boolean mDidRemoveAssLineRecipeAdder = false;
-
- public ClassTransformer_GT_Achievements(byte[] basicClass) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
-
- aTempReader.accept(new MethodAdaptor(aTempWriter), 0);
-
- if (mDidRemoveAssLineRecipeAdder) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Patching GT .09");
- injectMethod(aTempWriter);
- patchOnItemPickup09(aTempWriter);
- }
- else {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Patching GT .08");
- patchOnItemPickup08(aTempWriter);
- }
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
-
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Valid? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(ClassWriter cw) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Injecting " + "registerAssAchievement" + ".");
-
- /**
- * Inject new, safer code
- */
+public class ClassTransformer_GT_Achievements {
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+ private static boolean mDidRemoveAssLineRecipeAdder = false;
- /*mv = cw.visitMethod(ACC_PUBLIC, "registerAssAchievement", "(Lgregtech/api/util/GT_Recipe;)Lnet/minecraft/stats/Achievement;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- Label l1 = new Label();
- Label l2 = new Label();
- mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable");
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(291, l3);
- mv.visitVarInsn(ALOAD, 1);
- Label l4 = new Label();
- mv.visitJumpInsn(IFNONNULL, l4);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(292, l5);
- mv.visitLdcInsn("Someone tried to register an achievement for an invalid recipe. Please report this to Alkalus.");
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/api/objects/Logger", "INFO", "(Ljava/lang/String;)V", false);
- Label l6 = new Label();
- mv.visitLabel(l6);
- mv.visitLineNumber(293, l6);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(ARETURN);
- mv.visitLabel(l4);
- mv.visitLineNumber(295, l4);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
- Label l7 = new Label();
- mv.visitJumpInsn(IFNONNULL, l7);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(296, l8);
- mv.visitLdcInsn("Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/api/objects/Logger", "INFO", "(Ljava/lang/String;)V", false);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(297, l9);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(ARETURN);
- mv.visitLabel(l7);
- mv.visitLineNumber(299, l7);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
- mv.visitVarInsn(ASTORE, 3);
- mv.visitLabel(l0);
- mv.visitLineNumber(301, l0);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitVarInsn(ASTORE, 2);
- mv.visitLabel(l1);
- mv.visitLineNumber(302, l1);
- Label l10 = new Label();
- mv.visitJumpInsn(GOTO, l10);
- mv.visitLabel(l2);
- mv.visitLineNumber(303, l2);
- mv.visitFrame(F_FULL, 4, new Object[] {"gregtech/loaders/misc/GT_Achievements", "gregtech/api/util/GT_Recipe", TOP, "net/minecraft/item/ItemStack"}, 1, new Object[] {"java/lang/Throwable"});
- mv.visitVarInsn(ASTORE, 4);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(304, l11);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/ItemUtils", "getUnlocalizedItemName", "(Lnet/minecraft/item/ItemStack;)Ljava/lang/String;", false);
- mv.visitVarInsn(ASTORE, 2);
- mv.visitLabel(l10);
- mv.visitLineNumber(306, l10);
- mv.visitFrame(F_FULL, 4, new Object[] {"gregtech/loaders/misc/GT_Achievements", "gregtech/api/util/GT_Recipe", "java/lang/String", "net/minecraft/item/ItemStack"}, 0, new Object[] {});
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/loaders/misc/GT_Achievements", "achievementList", "Ljava/util/concurrent/ConcurrentHashMap;");
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/concurrent/ConcurrentHashMap", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", false);
- Label l12 = new Label();
- mv.visitJumpInsn(IFNONNULL, l12);
- Label l13 = new Label();
- mv.visitLabel(l13);
- mv.visitLineNumber(307, l13);
- mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IADD);
- mv.visitFieldInsn(PUTSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLineNumber(308, l14);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitIntInsn(BIPUSH, 11);
- mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
- mv.visitInsn(ICONST_5);
- mv.visitInsn(IREM);
- mv.visitInsn(IADD);
- mv.visitInsn(INEG);
- mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
- mv.visitInsn(ICONST_5);
- mv.visitInsn(IDIV);
- mv.visitIntInsn(BIPUSH, 8);
- mv.visitInsn(ISUB);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
- mv.visitFieldInsn(GETSTATIC, "net/minecraft/stats/AchievementList", "openInventory", "Lnet/minecraft/stats/Achievement;");
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "registerAchievement", "(Ljava/lang/String;IILnet/minecraft/item/ItemStack;Lnet/minecraft/stats/Achievement;Z)Lnet/minecraft/stats/Achievement;", false);
- mv.visitInsn(ARETURN);
- mv.visitLabel(l12);
- mv.visitLineNumber(310, l12);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(ARETURN);
- Label l15 = new Label();
- mv.visitLabel(l15);
- mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l3, l15, 0);
- mv.visitLocalVariable("recipe", "Lgregtech/api/util/GT_Recipe;", null, l3, l15, 1);
- mv.visitLocalVariable("aSafeUnlocalName", "Ljava/lang/String;", null, l1, l2, 2);
- mv.visitLocalVariable("aSafeUnlocalName", "Ljava/lang/String;", null, l10, l15, 2);
- mv.visitLocalVariable("aStack", "Lnet/minecraft/item/ItemStack;", null, l0, l15, 3);
- mv.visitLocalVariable("t", "Ljava/lang/Throwable;", null, l11, l10, 4);
- mv.visitMaxs(7, 5);
- mv.visitEnd();*/
+ public ClassTransformer_GT_Achievements(byte[] basicClass) {
- //Lets just static call my replacement function
- mv = cw.visitMethod(ACC_PUBLIC, "registerAssAchievement", "(Lgregtech/api/util/GT_Recipe;)Lnet/minecraft/stats/Achievement;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(291, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements", "registerAssAchievement", "(Lgregtech/api/util/GT_Recipe;)Lnet/minecraft/stats/Achievement;", false);
- mv.visitInsn(ARETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l0, l1, 0);
- mv.visitLocalVariable("recipe", "Lgregtech/api/util/GT_Recipe;", null, l0, l1, 1);
- mv.visitMaxs(1, 2);
- mv.visitEnd();
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
- didInject = true;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new MethodAdaptor(aTempWriter), 0);
+ if (mDidRemoveAssLineRecipeAdder) {
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Patching GT .09");
+ injectMethod(aTempWriter);
+ patchOnItemPickup09(aTempWriter);
+ } else {
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Patching GT .08");
+ patchOnItemPickup08(aTempWriter);
+ }
- public boolean patchOnItemPickup08(ClassWriter cw) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Injecting " + "onItemPickup" + ".");
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
- AnnotationVisitor av0;
- mv = cw.visitMethod(ACC_PUBLIC, "onItemPickup", "(Lnet/minecraftforge/event/entity/player/EntityItemPickupEvent;)V", null, null);
- av0 = mv.visitAnnotation("Lcpw/mods/fml/common/eventhandler/SubscribeEvent;", true);
- av0.visitEnd();
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(418, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/event/entity/player/EntityItemPickupEvent", "entityPlayer", "Lnet/minecraft/entity/player/EntityPlayer;");
- mv.visitVarInsn(ASTORE, 2);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(419, l1);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/event/entity/player/EntityItemPickupEvent", "item", "Lnet/minecraft/entity/item/EntityItem;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/entity/item/EntityItem", "getEntityItem", "()Lnet/minecraft/item/ItemStack;", false);
- mv.visitVarInsn(ASTORE, 3);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(420, l2);
- mv.visitVarInsn(ALOAD, 2);
- Label l3 = new Label();
- mv.visitJumpInsn(IFNULL, l3);
- mv.visitVarInsn(ALOAD, 3);
- Label l4 = new Label();
- mv.visitJumpInsn(IFNONNULL, l4);
- mv.visitLabel(l3);
- mv.visitLineNumber(421, l3);
- mv.visitFrame(F_APPEND,2, new Object[] {"net/minecraft/entity/player/EntityPlayer", "net/minecraft/item/ItemStack"}, 0, null);
- mv.visitInsn(RETURN);
- mv.visitLabel(l4);
- mv.visitLineNumber(424, l4);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKESTATIC, "gregtech/api/util/GT_OreDictUnificator", "getItemData", "(Lnet/minecraft/item/ItemStack;)Lgregtech/api/objects/ItemData;", false);
- mv.visitVarInsn(ASTORE, 4);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(425, l5);
- mv.visitVarInsn(ALOAD, 4);
- Label l6 = new Label();
- mv.visitJumpInsn(IFNULL, l6);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(426, l7);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "dust", "Lgregtech/api/enums/OrePrefixes;");
- Label l8 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l8);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(427, l9);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Lutetium", "Lgregtech/api/enums/Materials;");
- Label l10 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l10);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(428, l11);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("newmetal");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- mv.visitLabel(l10);
- mv.visitLineNumber(430, l10);
- mv.visitFrame(F_APPEND,1, new Object[] {"gregtech/api/objects/ItemData"}, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("cleandust");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLineNumber(431, l12);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l8);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "ore", "Lgregtech/api/enums/OrePrefixes;");
- Label l13 = new Label();
- mv.visitJumpInsn(IF_ACMPEQ, l13);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "oreBlackgranite", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitJumpInsn(IF_ACMPEQ, l13);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "oreEndstone", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitJumpInsn(IF_ACMPEQ, l13);
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLineNumber(432, l14);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "oreNetherrack", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitJumpInsn(IF_ACMPEQ, l13);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "oreRedgranite", "Lgregtech/api/enums/OrePrefixes;");
- Label l15 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l15);
- mv.visitLabel(l13);
- mv.visitLineNumber(433, l13);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(ICONST_0);
- mv.visitVarInsn(ISTORE, 5);
- Label l16 = new Label();
- mv.visitLabel(l16);
- Label l17 = new Label();
- mv.visitJumpInsn(GOTO, l17);
- Label l18 = new Label();
- mv.visitLabel(l18);
- mv.visitLineNumber(434, l18);
- mv.visitFrame(F_APPEND,1, new Object[] {INTEGER}, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/objects/ItemData", "getAllMaterialStacks", "()Ljava/util/ArrayList;", false);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
- mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/enums/Materials", "name", "()Ljava/lang/String;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l19 = new Label();
- mv.visitLabel(l19);
- mv.visitLineNumber(435, l19);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/objects/ItemData", "getAllMaterialStacks", "()Ljava/util/ArrayList;", false);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
- mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "AnyIron", "Lgregtech/api/enums/Materials;");
- Label l20 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l20);
- Label l21 = new Label();
- mv.visitLabel(l21);
- mv.visitLineNumber(436, l21);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("iron");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- mv.visitLabel(l20);
- mv.visitLineNumber(433, l20);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitIincInsn(5, 1);
- mv.visitLabel(l17);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/objects/ItemData", "getAllMaterialStacks", "()Ljava/util/ArrayList;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "size", "()I", false);
- mv.visitJumpInsn(IF_ICMPLT, l18);
- Label l22 = new Label();
- mv.visitLabel(l22);
- mv.visitLineNumber(439, l22);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l15);
- mv.visitFrame(F_CHOP,1, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushed", "Lgregtech/api/enums/OrePrefixes;");
- Label l23 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l23);
- Label l24 = new Label();
- mv.visitLabel(l24);
- mv.visitLineNumber(440, l24);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("crushed");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l25 = new Label();
- mv.visitLabel(l25);
- mv.visitLineNumber(441, l25);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l23);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushedPurified", "Lgregtech/api/enums/OrePrefixes;");
- Label l26 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l26);
- Label l27 = new Label();
- mv.visitLabel(l27);
- mv.visitLineNumber(442, l27);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("washing");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l28 = new Label();
- mv.visitLabel(l28);
- mv.visitLineNumber(443, l28);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l26);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushedCentrifuged", "Lgregtech/api/enums/OrePrefixes;");
- Label l29 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l29);
- Label l30 = new Label();
- mv.visitLabel(l30);
- mv.visitLineNumber(444, l30);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("spinit");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l31 = new Label();
- mv.visitLabel(l31);
- mv.visitLineNumber(445, l31);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l29);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Steel", "Lgregtech/api/enums/Materials;");
- Label l32 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l32);
- Label l33 = new Label();
- mv.visitLabel(l33);
- mv.visitLineNumber(446, l33);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "ingot", "Lgregtech/api/enums/OrePrefixes;");
- Label l34 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l34);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitFieldInsn(GETFIELD, "net/minecraft/item/ItemStack", "stackSize", "I");
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getMaxStackSize", "()I", false);
- mv.visitJumpInsn(IF_ICMPNE, l34);
- Label l35 = new Label();
- mv.visitLabel(l35);
- mv.visitLineNumber(447, l35);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("steel");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l36 = new Label();
- mv.visitLabel(l36);
- mv.visitLineNumber(448, l36);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l34);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "nugget", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitJumpInsn(IF_ACMPNE, l6);
- mv.visitLdcInsn("Thaumcraft");
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/Loader", "isModLoaded", "(Ljava/lang/String;)Z", false);
- mv.visitJumpInsn(IFEQ, l6);
- Label l37 = new Label();
- mv.visitLabel(l37);
- mv.visitLineNumber(449, l37);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/entity/player/EntityPlayer", "getDisplayName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("GT_IRON_TO_STEEL");
- mv.visitMethodInsn(INVOKESTATIC, "thaumcraft/api/ThaumcraftApiHelper", "isResearchComplete", "(Ljava/lang/String;Ljava/lang/String;)Z", false);
- mv.visitJumpInsn(IFEQ, l6);
- Label l38 = new Label();
- mv.visitLabel(l38);
- mv.visitLineNumber(450, l38);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("steel");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l39 = new Label();
- mv.visitLabel(l39);
- mv.visitLineNumber(453, l39);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l32);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "circuit", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitJumpInsn(IF_ACMPNE, l6);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Advanced", "Lgregtech/api/enums/Materials;");
- mv.visitJumpInsn(IF_ACMPNE, l6);
- Label l40 = new Label();
- mv.visitLabel(l40);
- mv.visitLineNumber(454, l40);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("stepforward");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- mv.visitLabel(l6);
- mv.visitLineNumber(457, l6);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "startsWith", "(Ljava/lang/String;)Z", false);
- Label l41 = new Label();
- mv.visitJumpInsn(IFEQ, l41);
- Label l42 = new Label();
- mv.visitLabel(l42);
- mv.visitLineNumber(458, l42);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32500");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l43 = new Label();
- mv.visitJumpInsn(IFEQ, l43);
- Label l44 = new Label();
- mv.visitLabel(l44);
- mv.visitLineNumber(459, l44);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestlead");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l45 = new Label();
- mv.visitLabel(l45);
- mv.visitLineNumber(460, l45);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l43);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32501");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l46 = new Label();
- mv.visitJumpInsn(IFEQ, l46);
- Label l47 = new Label();
- mv.visitLabel(l47);
- mv.visitLineNumber(461, l47);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestsilver");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l48 = new Label();
- mv.visitLabel(l48);
- mv.visitLineNumber(462, l48);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l46);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32503");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l49 = new Label();
- mv.visitJumpInsn(IFEQ, l49);
- Label l50 = new Label();
- mv.visitLabel(l50);
- mv.visitLineNumber(463, l50);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestiron");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l51 = new Label();
- mv.visitLabel(l51);
- mv.visitLineNumber(464, l51);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l49);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32504");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l52 = new Label();
- mv.visitJumpInsn(IFEQ, l52);
- Label l53 = new Label();
- mv.visitLabel(l53);
- mv.visitLineNumber(465, l53);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestgold");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l54 = new Label();
- mv.visitLabel(l54);
- mv.visitLineNumber(466, l54);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l52);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32530");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l55 = new Label();
- mv.visitJumpInsn(IFEQ, l55);
- Label l56 = new Label();
- mv.visitLabel(l56);
- mv.visitLineNumber(467, l56);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestcopper");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l57 = new Label();
- mv.visitLabel(l57);
- mv.visitLineNumber(468, l57);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l55);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32540");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l58 = new Label();
- mv.visitJumpInsn(IFEQ, l58);
- Label l59 = new Label();
- mv.visitLabel(l59);
- mv.visitLineNumber(469, l59);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havesttin");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l60 = new Label();
- mv.visitLabel(l60);
- mv.visitLineNumber(470, l60);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l58);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32510");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l61 = new Label();
- mv.visitJumpInsn(IFEQ, l61);
- Label l62 = new Label();
- mv.visitLabel(l62);
- mv.visitLineNumber(471, l62);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestoil");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l63 = new Label();
- mv.visitLabel(l63);
- mv.visitLineNumber(472, l63);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l61);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32511");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l64 = new Label();
- mv.visitJumpInsn(IFEQ, l64);
- Label l65 = new Label();
- mv.visitLabel(l65);
- mv.visitLineNumber(473, l65);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestemeralds");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l66 = new Label();
- mv.visitLabel(l66);
- mv.visitLineNumber(474, l66);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l64);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32706");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l67 = new Label();
- mv.visitJumpInsn(IFEQ, l67);
- Label l68 = new Label();
- mv.visitLabel(l68);
- mv.visitLineNumber(475, l68);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("energyflow");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l69 = new Label();
- mv.visitLabel(l69);
- mv.visitLineNumber(476, l69);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l67);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32702");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l70 = new Label();
- mv.visitJumpInsn(IFEQ, l70);
- Label l71 = new Label();
- mv.visitLabel(l71);
- mv.visitLineNumber(477, l71);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("bettercircuits");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l72 = new Label();
- mv.visitLabel(l72);
- mv.visitLineNumber(478, l72);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l70);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32707");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l73 = new Label();
- mv.visitJumpInsn(IFEQ, l73);
- Label l74 = new Label();
- mv.visitLabel(l74);
- mv.visitLineNumber(479, l74);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("datasaving");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l75 = new Label();
- mv.visitLabel(l75);
- mv.visitLineNumber(480, l75);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l73);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32597");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l76 = new Label();
- mv.visitJumpInsn(IFEQ, l76);
- Label l77 = new Label();
- mv.visitLabel(l77);
- mv.visitLineNumber(481, l77);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("orbs");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l78 = new Label();
- mv.visitLabel(l78);
- mv.visitLineNumber(482, l78);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l76);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32599");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l79 = new Label();
- mv.visitJumpInsn(IFEQ, l79);
- Label l80 = new Label();
- mv.visitLabel(l80);
- mv.visitLineNumber(483, l80);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("thatspower");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l81 = new Label();
- mv.visitLabel(l81);
- mv.visitLineNumber(484, l81);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l79);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32598");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l82 = new Label();
- mv.visitJumpInsn(IFEQ, l82);
- Label l83 = new Label();
- mv.visitLabel(l83);
- mv.visitLineNumber(485, l83);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("luck");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l84 = new Label();
- mv.visitLabel(l84);
- mv.visitLineNumber(486, l84);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l82);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32749");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l85 = new Label();
- mv.visitJumpInsn(IFEQ, l85);
- Label l86 = new Label();
- mv.visitLabel(l86);
- mv.visitLineNumber(487, l86);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("closeit");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l87 = new Label();
- mv.visitLabel(l87);
- mv.visitLineNumber(488, l87);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l85);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32730");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l88 = new Label();
- mv.visitJumpInsn(IFEQ, l88);
- Label l89 = new Label();
- mv.visitLabel(l89);
- mv.visitLineNumber(489, l89);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("manipulation");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l90 = new Label();
- mv.visitLabel(l90);
- mv.visitLineNumber(490, l90);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l88);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32729");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l91 = new Label();
- mv.visitJumpInsn(IFEQ, l91);
- Label l92 = new Label();
- mv.visitLabel(l92);
- mv.visitLineNumber(491, l92);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("filterregulate");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l93 = new Label();
- mv.visitLabel(l93);
- mv.visitLineNumber(492, l93);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l91);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32605");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l94 = new Label();
- mv.visitJumpInsn(IFEQ, l94);
- Label l95 = new Label();
- mv.visitLabel(l95);
- mv.visitLineNumber(493, l95);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("whatnow");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l96 = new Label();
- mv.visitLabel(l96);
- mv.visitLineNumber(494, l96);
- mv.visitJumpInsn(GOTO, l41);
- mv.visitLabel(l94);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.Thoriumcell");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- mv.visitJumpInsn(IFEQ, l41);
- Label l97 = new Label();
- mv.visitLabel(l97);
- mv.visitLineNumber(495, l97);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("newfuel");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- mv.visitLabel(l41);
- mv.visitLineNumber(498, l41);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(RETURN);
- Label l98 = new Label();
- mv.visitLabel(l98);
- mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l0, l98, 0);
- mv.visitLocalVariable("event", "Lnet/minecraftforge/event/entity/player/EntityItemPickupEvent;", null, l0, l98, 1);
- mv.visitLocalVariable("player", "Lnet/minecraft/entity/player/EntityPlayer;", null, l1, l98, 2);
- mv.visitLocalVariable("stack", "Lnet/minecraft/item/ItemStack;", null, l2, l98, 3);
- mv.visitLocalVariable("data", "Lgregtech/api/objects/ItemData;", null, l5, l98, 4);
- mv.visitLocalVariable("i", "I", null, l16, l22, 5);
- mv.visitMaxs(4, 6);
- mv.visitEnd();
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- didInject = true;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
+ public ClassReader getReader() {
+ return reader;
+ }
+ public ClassWriter getWriter() {
+ return writer;
+ }
- public boolean patchOnItemPickup09(ClassWriter cw) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Injecting " + "onItemPickup" + ".");
+ public boolean injectMethod(ClassWriter cw) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Injecting " + "registerAssAchievement" + ".");
- /**
- * Inject new, safer code
- */
- AnnotationVisitor av0;
- mv = cw.visitMethod(ACC_PUBLIC, "onItemPickup", "(Lnet/minecraftforge/event/entity/player/EntityItemPickupEvent;)V", null, null);
- av0 = mv.visitAnnotation("Lcpw/mods/fml/common/eventhandler/SubscribeEvent;", true);
- av0.visitEnd();
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(546, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/event/entity/player/EntityItemPickupEvent", "entityPlayer", "Lnet/minecraft/entity/player/EntityPlayer;");
- mv.visitVarInsn(ASTORE, 2);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(547, l1);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/event/entity/player/EntityItemPickupEvent", "item", "Lnet/minecraft/entity/item/EntityItem;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/entity/item/EntityItem", "getEntityItem", "()Lnet/minecraft/item/ItemStack;", false);
- mv.visitVarInsn(ASTORE, 3);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(548, l2);
- mv.visitVarInsn(ALOAD, 2);
- Label l3 = new Label();
- mv.visitJumpInsn(IFNULL, l3);
- mv.visitVarInsn(ALOAD, 3);
- Label l4 = new Label();
- mv.visitJumpInsn(IFNONNULL, l4);
- mv.visitLabel(l3);
- mv.visitLineNumber(549, l3);
- mv.visitFrame(F_APPEND,2, new Object[] {"net/minecraft/entity/player/EntityPlayer", "net/minecraft/item/ItemStack"}, 0, null);
- mv.visitInsn(RETURN);
- mv.visitLabel(l4);
- mv.visitLineNumber(551, l4);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKESTATIC, "gregtech/api/util/GT_OreDictUnificator", "getItemData", "(Lnet/minecraft/item/ItemStack;)Lgregtech/api/objects/ItemData;", false);
- mv.visitVarInsn(ASTORE, 4);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(552, l5);
- mv.visitVarInsn(ALOAD, 4);
- Label l6 = new Label();
- mv.visitJumpInsn(IFNULL, l6);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitJumpInsn(IFNULL, l6);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(553, l7);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "dust", "Lgregtech/api/enums/OrePrefixes;");
- Label l8 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l8);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(554, l9);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Lutetium", "Lgregtech/api/enums/Materials;");
- Label l10 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l10);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(555, l11);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("newmetal");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- mv.visitLabel(l10);
- mv.visitLineNumber(557, l10);
- mv.visitFrame(F_APPEND,1, new Object[] {"gregtech/api/objects/ItemData"}, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Gunpowder", "Lgregtech/api/enums/Materials;");
- mv.visitJumpInsn(IF_ACMPEQ, l6);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLineNumber(558, l12);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("cleandust");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l13 = new Label();
- mv.visitLabel(l13);
- mv.visitLineNumber(560, l13);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l8);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/enums/OrePrefixes", "name", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("ore");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "startsWith", "(Ljava/lang/String;)Z", false);
- Label l14 = new Label();
- mv.visitJumpInsn(IFEQ, l14);
- Label l15 = new Label();
- mv.visitLabel(l15);
- mv.visitLineNumber(561, l15);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/objects/ItemData", "getAllMaterialStacks", "()Ljava/util/ArrayList;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "size", "()I", false);
- mv.visitVarInsn(ISTORE, 5);
- Label l16 = new Label();
- mv.visitLabel(l16);
- mv.visitLineNumber(562, l16);
- mv.visitInsn(ICONST_0);
- mv.visitVarInsn(ISTORE, 6);
- Label l17 = new Label();
- mv.visitLabel(l17);
- Label l18 = new Label();
- mv.visitJumpInsn(GOTO, l18);
- Label l19 = new Label();
- mv.visitLabel(l19);
- mv.visitLineNumber(563, l19);
- mv.visitFrame(F_APPEND,2, new Object[] {INTEGER, INTEGER}, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/objects/ItemData", "getAllMaterialStacks", "()Ljava/util/ArrayList;", false);
- mv.visitVarInsn(ILOAD, 6);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
- mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/enums/Materials", "mName", "Ljava/lang/String;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l20 = new Label();
- mv.visitLabel(l20);
- mv.visitLineNumber(564, l20);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/objects/ItemData", "getAllMaterialStacks", "()Ljava/util/ArrayList;", false);
- mv.visitVarInsn(ILOAD, 6);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
- mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Iron", "Lgregtech/api/enums/Materials;");
- Label l21 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l21);
- Label l22 = new Label();
- mv.visitLabel(l22);
- mv.visitLineNumber(565, l22);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("iron");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- mv.visitLabel(l21);
- mv.visitLineNumber(567, l21);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/objects/ItemData", "getAllMaterialStacks", "()Ljava/util/ArrayList;", false);
- mv.visitVarInsn(ILOAD, 6);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
- mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Copper", "Lgregtech/api/enums/Materials;");
- Label l23 = new Label();
- mv.visitJumpInsn(IF_ACMPEQ, l23);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/objects/ItemData", "getAllMaterialStacks", "()Ljava/util/ArrayList;", false);
- mv.visitVarInsn(ILOAD, 6);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
- mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Tin", "Lgregtech/api/enums/Materials;");
- Label l24 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l24);
- mv.visitLabel(l23);
- mv.visitLineNumber(568, l23);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/event/entity/player/EntityItemPickupEvent", "entityPlayer", "Lnet/minecraft/entity/player/EntityPlayer;");
- mv.visitLdcInsn("mineOre");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- mv.visitLabel(l24);
- mv.visitLineNumber(562, l24);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitIincInsn(6, 1);
- mv.visitLabel(l18);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ILOAD, 6);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitJumpInsn(IF_ICMPLT, l19);
- Label l25 = new Label();
- mv.visitLabel(l25);
- mv.visitLineNumber(572, l25);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l14);
- mv.visitFrame(F_CHOP,2, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushed", "Lgregtech/api/enums/OrePrefixes;");
- Label l26 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l26);
- Label l27 = new Label();
- mv.visitLabel(l27);
- mv.visitLineNumber(573, l27);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("crushed");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l28 = new Label();
- mv.visitLabel(l28);
- mv.visitLineNumber(574, l28);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l26);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushedPurified", "Lgregtech/api/enums/OrePrefixes;");
- Label l29 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l29);
- Label l30 = new Label();
- mv.visitLabel(l30);
- mv.visitLineNumber(575, l30);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("washing");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l31 = new Label();
- mv.visitLabel(l31);
- mv.visitLineNumber(576, l31);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l29);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushedCentrifuged", "Lgregtech/api/enums/OrePrefixes;");
- Label l32 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l32);
- Label l33 = new Label();
- mv.visitLabel(l33);
- mv.visitLineNumber(577, l33);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("spinit");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l34 = new Label();
- mv.visitLabel(l34);
- mv.visitLineNumber(578, l34);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l32);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Steel", "Lgregtech/api/enums/Materials;");
- mv.visitJumpInsn(IF_ACMPNE, l6);
- Label l35 = new Label();
- mv.visitLabel(l35);
- mv.visitLineNumber(579, l35);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "ingot", "Lgregtech/api/enums/OrePrefixes;");
- Label l36 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l36);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitFieldInsn(GETFIELD, "net/minecraft/item/ItemStack", "stackSize", "I");
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getMaxStackSize", "()I", false);
- mv.visitJumpInsn(IF_ICMPNE, l36);
- Label l37 = new Label();
- mv.visitLabel(l37);
- mv.visitLineNumber(580, l37);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("steel");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l38 = new Label();
- mv.visitLabel(l38);
- mv.visitLineNumber(581, l38);
- mv.visitJumpInsn(GOTO, l6);
- mv.visitLabel(l36);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "nugget", "Lgregtech/api/enums/OrePrefixes;");
- mv.visitJumpInsn(IF_ACMPNE, l6);
- mv.visitLdcInsn("Thaumcraft");
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/Loader", "isModLoaded", "(Ljava/lang/String;)Z", false);
- mv.visitJumpInsn(IFEQ, l6);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/entity/player/EntityPlayer", "getDisplayName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("GT_IRON_TO_STEEL");
- mv.visitMethodInsn(INVOKESTATIC, "thaumcraft/api/ThaumcraftApiHelper", "isResearchComplete", "(Ljava/lang/String;Ljava/lang/String;)Z", false);
- mv.visitJumpInsn(IFEQ, l6);
- Label l39 = new Label();
- mv.visitLabel(l39);
- mv.visitLineNumber(582, l39);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("steel");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- mv.visitLabel(l6);
- mv.visitLineNumber(589, l6);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "startsWith", "(Ljava/lang/String;)Z", false);
- Label l40 = new Label();
- mv.visitJumpInsn(IFEQ, l40);
- Label l41 = new Label();
- mv.visitLabel(l41);
- mv.visitLineNumber(590, l41);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32500");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l42 = new Label();
- mv.visitJumpInsn(IFEQ, l42);
- Label l43 = new Label();
- mv.visitLabel(l43);
- mv.visitLineNumber(591, l43);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestlead");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l44 = new Label();
- mv.visitLabel(l44);
- mv.visitLineNumber(592, l44);
- Label l45 = new Label();
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l42);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32501");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l46 = new Label();
- mv.visitJumpInsn(IFEQ, l46);
- Label l47 = new Label();
- mv.visitLabel(l47);
- mv.visitLineNumber(593, l47);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestsilver");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l48 = new Label();
- mv.visitLabel(l48);
- mv.visitLineNumber(594, l48);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l46);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32503");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l49 = new Label();
- mv.visitJumpInsn(IFEQ, l49);
- Label l50 = new Label();
- mv.visitLabel(l50);
- mv.visitLineNumber(595, l50);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestiron");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l51 = new Label();
- mv.visitLabel(l51);
- mv.visitLineNumber(596, l51);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l49);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32504");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l52 = new Label();
- mv.visitJumpInsn(IFEQ, l52);
- Label l53 = new Label();
- mv.visitLabel(l53);
- mv.visitLineNumber(597, l53);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestgold");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l54 = new Label();
- mv.visitLabel(l54);
- mv.visitLineNumber(598, l54);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l52);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32530");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l55 = new Label();
- mv.visitJumpInsn(IFEQ, l55);
- Label l56 = new Label();
- mv.visitLabel(l56);
- mv.visitLineNumber(599, l56);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestcopper");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l57 = new Label();
- mv.visitLabel(l57);
- mv.visitLineNumber(600, l57);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l55);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32540");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l58 = new Label();
- mv.visitJumpInsn(IFEQ, l58);
- Label l59 = new Label();
- mv.visitLabel(l59);
- mv.visitLineNumber(601, l59);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havesttin");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l60 = new Label();
- mv.visitLabel(l60);
- mv.visitLineNumber(602, l60);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l58);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32510");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l61 = new Label();
- mv.visitJumpInsn(IFEQ, l61);
- Label l62 = new Label();
- mv.visitLabel(l62);
- mv.visitLineNumber(603, l62);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestoil");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l63 = new Label();
- mv.visitLabel(l63);
- mv.visitLineNumber(604, l63);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l61);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.02.32511");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l64 = new Label();
- mv.visitJumpInsn(IFEQ, l64);
- Label l65 = new Label();
- mv.visitLabel(l65);
- mv.visitLineNumber(605, l65);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("havestemeralds");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l66 = new Label();
- mv.visitLabel(l66);
- mv.visitLineNumber(606, l66);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l64);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.03.32082");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l67 = new Label();
- mv.visitJumpInsn(IFEQ, l67);
- Label l68 = new Label();
- mv.visitLabel(l68);
- mv.visitLineNumber(607, l68);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("energyflow");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l69 = new Label();
- mv.visitLabel(l69);
- mv.visitLineNumber(608, l69);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l67);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32702");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l70 = new Label();
- mv.visitJumpInsn(IFEQ, l70);
- Label l71 = new Label();
- mv.visitLabel(l71);
- mv.visitLineNumber(609, l71);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("bettercircuits");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l72 = new Label();
- mv.visitLabel(l72);
- mv.visitLineNumber(610, l72);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l70);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32707");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l73 = new Label();
- mv.visitJumpInsn(IFEQ, l73);
- Label l74 = new Label();
- mv.visitLabel(l74);
- mv.visitLineNumber(611, l74);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("datasaving");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l75 = new Label();
- mv.visitLabel(l75);
- mv.visitLineNumber(612, l75);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l73);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32597");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l76 = new Label();
- mv.visitJumpInsn(IFEQ, l76);
- Label l77 = new Label();
- mv.visitLabel(l77);
- mv.visitLineNumber(613, l77);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("orbs");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l78 = new Label();
- mv.visitLabel(l78);
- mv.visitLineNumber(614, l78);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l76);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32599");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l79 = new Label();
- mv.visitJumpInsn(IFEQ, l79);
- Label l80 = new Label();
- mv.visitLabel(l80);
- mv.visitLineNumber(615, l80);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("thatspower");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l81 = new Label();
- mv.visitLabel(l81);
- mv.visitLineNumber(616, l81);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l79);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32598");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l82 = new Label();
- mv.visitJumpInsn(IFEQ, l82);
- Label l83 = new Label();
- mv.visitLabel(l83);
- mv.visitLineNumber(617, l83);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("luck");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l84 = new Label();
- mv.visitLabel(l84);
- mv.visitLineNumber(618, l84);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l82);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32749");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l85 = new Label();
- mv.visitJumpInsn(IFEQ, l85);
- Label l86 = new Label();
- mv.visitLabel(l86);
- mv.visitLineNumber(619, l86);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("closeit");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l87 = new Label();
- mv.visitLabel(l87);
- mv.visitLineNumber(620, l87);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l85);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32730");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l88 = new Label();
- mv.visitJumpInsn(IFEQ, l88);
- Label l89 = new Label();
- mv.visitLabel(l89);
- mv.visitLineNumber(621, l89);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("manipulation");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l90 = new Label();
- mv.visitLabel(l90);
- mv.visitLineNumber(622, l90);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l88);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32729");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l91 = new Label();
- mv.visitJumpInsn(IFEQ, l91);
- Label l92 = new Label();
- mv.visitLabel(l92);
- mv.visitLineNumber(623, l92);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("filterregulate");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l93 = new Label();
- mv.visitLabel(l93);
- mv.visitLineNumber(624, l93);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l91);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32605");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l94 = new Label();
- mv.visitJumpInsn(IFEQ, l94);
- Label l95 = new Label();
- mv.visitLabel(l95);
- mv.visitLineNumber(625, l95);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("whatnow");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l96 = new Label();
- mv.visitLabel(l96);
- mv.visitLineNumber(626, l96);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l94);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32736");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l97 = new Label();
- mv.visitJumpInsn(IFEQ, l97);
- Label l98 = new Label();
- mv.visitLabel(l98);
- mv.visitLineNumber(627, l98);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("zpmage");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l99 = new Label();
- mv.visitLabel(l99);
- mv.visitLineNumber(628, l99);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l97);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32737");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l100 = new Label();
- mv.visitJumpInsn(IFEQ, l100);
- Label l101 = new Label();
- mv.visitLabel(l101);
- mv.visitLineNumber(629, l101);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("uvage");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l102 = new Label();
- mv.visitLabel(l102);
- mv.visitLineNumber(630, l102);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l100);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.03.32030");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l103 = new Label();
- mv.visitJumpInsn(IFEQ, l103);
- Label l104 = new Label();
- mv.visitLabel(l104);
- mv.visitLineNumber(631, l104);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("gtmonosilicon");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l105 = new Label();
- mv.visitLabel(l105);
- mv.visitLineNumber(632, l105);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l103);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.03.32036");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l106 = new Label();
- mv.visitJumpInsn(IFEQ, l106);
- Label l107 = new Label();
- mv.visitLabel(l107);
- mv.visitLineNumber(633, l107);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("gtlogicwafer");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l108 = new Label();
- mv.visitLabel(l108);
- mv.visitLineNumber(634, l108);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l106);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32701");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l109 = new Label();
- mv.visitJumpInsn(IFEQ, l109);
- Label l110 = new Label();
- mv.visitLabel(l110);
- mv.visitLineNumber(635, l110);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("gtlogiccircuit");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l111 = new Label();
- mv.visitLabel(l111);
- mv.visitLineNumber(636, l111);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l109);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.03.32085");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l112 = new Label();
- mv.visitJumpInsn(IFEQ, l112);
- Label l113 = new Label();
- mv.visitLabel(l113);
- mv.visitLineNumber(637, l113);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("gtquantumprocessor");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l114 = new Label();
- mv.visitLabel(l114);
- mv.visitLineNumber(638, l114);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l112);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.03.32089");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l115 = new Label();
- mv.visitJumpInsn(IFEQ, l115);
- Label l116 = new Label();
- mv.visitLabel(l116);
- mv.visitLineNumber(639, l116);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("gtcrystalprocessor");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l117 = new Label();
- mv.visitLabel(l117);
- mv.visitLineNumber(640, l117);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l115);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.03.32092");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l118 = new Label();
- mv.visitJumpInsn(IFEQ, l118);
- Label l119 = new Label();
- mv.visitLabel(l119);
- mv.visitLineNumber(641, l119);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("gtwetware");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l120 = new Label();
- mv.visitLabel(l120);
- mv.visitLineNumber(642, l120);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l118);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.03.32095");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l121 = new Label();
- mv.visitJumpInsn(IFEQ, l121);
- Label l122 = new Label();
- mv.visitLabel(l122);
- mv.visitLineNumber(643, l122);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("gtwetmain");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l123 = new Label();
- mv.visitLabel(l123);
- mv.visitLineNumber(644, l123);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l121);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32736");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l124 = new Label();
- mv.visitJumpInsn(IFEQ, l124);
- Label l125 = new Label();
- mv.visitLabel(l125);
- mv.visitLineNumber(645, l125);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("zpmage");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l126 = new Label();
- mv.visitLabel(l126);
- mv.visitLineNumber(646, l126);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l124);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.metaitem.01.32737");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- mv.visitJumpInsn(IFEQ, l45);
- Label l127 = new Label();
- mv.visitLabel(l127);
- mv.visitLineNumber(647, l127);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("uvage");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l128 = new Label();
- mv.visitLabel(l128);
- mv.visitLineNumber(649, l128);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l40);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("gt.Thoriumcell");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- Label l129 = new Label();
- mv.visitJumpInsn(IFEQ, l129);
- Label l130 = new Label();
- mv.visitLabel(l130);
- mv.visitLineNumber(650, l130);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("newfuel");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l131 = new Label();
- mv.visitLabel(l131);
- mv.visitLineNumber(651, l131);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l129);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
- mv.visitFieldInsn(GETSTATIC, "ic2/core/Ic2Items", "quantumBodyarmor", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
- Label l132 = new Label();
- mv.visitJumpInsn(IF_ACMPEQ, l132);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
- mv.visitFieldInsn(GETSTATIC, "ic2/core/Ic2Items", "quantumBoots", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
- mv.visitJumpInsn(IF_ACMPEQ, l132);
- Label l133 = new Label();
- mv.visitLabel(l133);
- mv.visitLineNumber(652, l133);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
- mv.visitFieldInsn(GETSTATIC, "ic2/core/Ic2Items", "quantumHelmet", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
- mv.visitJumpInsn(IF_ACMPEQ, l132);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
- mv.visitFieldInsn(GETSTATIC, "ic2/core/Ic2Items", "quantumLeggings", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
- Label l134 = new Label();
- mv.visitJumpInsn(IF_ACMPNE, l134);
- mv.visitLabel(l132);
- mv.visitLineNumber(653, l132);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("buildQArmor");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- Label l135 = new Label();
- mv.visitLabel(l135);
- mv.visitLineNumber(654, l135);
- mv.visitJumpInsn(GOTO, l45);
- mv.visitLabel(l134);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
- mv.visitLdcInsn("ic2.itemPartCircuitAdv");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
- mv.visitJumpInsn(IFEQ, l45);
- Label l136 = new Label();
- mv.visitLabel(l136);
- mv.visitLineNumber(655, l136);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitLdcInsn("stepforward");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "issueAchievement", "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V", false);
- mv.visitLabel(l45);
- mv.visitLineNumber(657, l45);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(RETURN);
- Label l137 = new Label();
- mv.visitLabel(l137);
- mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l0, l137, 0);
- mv.visitLocalVariable("event", "Lnet/minecraftforge/event/entity/player/EntityItemPickupEvent;", null, l0, l137, 1);
- mv.visitLocalVariable("player", "Lnet/minecraft/entity/player/EntityPlayer;", null, l1, l137, 2);
- mv.visitLocalVariable("stack", "Lnet/minecraft/item/ItemStack;", null, l2, l137, 3);
- mv.visitLocalVariable("data", "Lgregtech/api/objects/ItemData;", null, l5, l137, 4);
- mv.visitLocalVariable("data_getAllMaterialStacks_sS", "I", null, l16, l25, 5);
- mv.visitLocalVariable("i", "I", null, l17, l25, 6);
- mv.visitMaxs(4, 7);
- mv.visitEnd();
+ /**
+ * Inject new, safer code
+ */
- didInject = true;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
+ /*mv = cw.visitMethod(ACC_PUBLIC, "registerAssAchievement", "(Lgregtech/api/util/GT_Recipe;)Lnet/minecraft/stats/Achievement;", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ Label l1 = new Label();
+ Label l2 = new Label();
+ mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable");
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(291, l3);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l4 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l4);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(292, l5);
+ mv.visitLdcInsn("Someone tried to register an achievement for an invalid recipe. Please report this to Alkalus.");
+ mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/api/objects/Logger", "INFO", "(Ljava/lang/String;)V", false);
+ Label l6 = new Label();
+ mv.visitLabel(l6);
+ mv.visitLineNumber(293, l6);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l4);
+ mv.visitLineNumber(295, l4);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
+ Label l7 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l7);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(296, l8);
+ mv.visitLdcInsn("Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
+ mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/api/objects/Logger", "INFO", "(Ljava/lang/String;)V", false);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(297, l9);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l7);
+ mv.visitLineNumber(299, l7);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
+ mv.visitVarInsn(ASTORE, 3);
+ mv.visitLabel(l0);
+ mv.visitLineNumber(301, l0);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitVarInsn(ASTORE, 2);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(302, l1);
+ Label l10 = new Label();
+ mv.visitJumpInsn(GOTO, l10);
+ mv.visitLabel(l2);
+ mv.visitLineNumber(303, l2);
+ mv.visitFrame(F_FULL, 4, new Object[] {"gregtech/loaders/misc/GT_Achievements", "gregtech/api/util/GT_Recipe", TOP, "net/minecraft/item/ItemStack"}, 1, new Object[] {"java/lang/Throwable"});
+ mv.visitVarInsn(ASTORE, 4);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(304, l11);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/ItemUtils", "getUnlocalizedItemName", "(Lnet/minecraft/item/ItemStack;)Ljava/lang/String;", false);
+ mv.visitVarInsn(ASTORE, 2);
+ mv.visitLabel(l10);
+ mv.visitLineNumber(306, l10);
+ mv.visitFrame(F_FULL, 4, new Object[] {"gregtech/loaders/misc/GT_Achievements", "gregtech/api/util/GT_Recipe", "java/lang/String", "net/minecraft/item/ItemStack"}, 0, new Object[] {});
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/loaders/misc/GT_Achievements", "achievementList", "Ljava/util/concurrent/ConcurrentHashMap;");
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/concurrent/ConcurrentHashMap", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", false);
+ Label l12 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l12);
+ Label l13 = new Label();
+ mv.visitLabel(l13);
+ mv.visitLineNumber(307, l13);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IADD);
+ mv.visitFieldInsn(PUTSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLineNumber(308, l14);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitIntInsn(BIPUSH, 11);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
+ mv.visitInsn(ICONST_5);
+ mv.visitInsn(IREM);
+ mv.visitInsn(IADD);
+ mv.visitInsn(INEG);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
+ mv.visitInsn(ICONST_5);
+ mv.visitInsn(IDIV);
+ mv.visitIntInsn(BIPUSH, 8);
+ mv.visitInsn(ISUB);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
+ mv.visitFieldInsn(GETSTATIC, "net/minecraft/stats/AchievementList", "openInventory", "Lnet/minecraft/stats/Achievement;");
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "registerAchievement", "(Ljava/lang/String;IILnet/minecraft/item/ItemStack;Lnet/minecraft/stats/Achievement;Z)Lnet/minecraft/stats/Achievement;", false);
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l12);
+ mv.visitLineNumber(310, l12);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ Label l15 = new Label();
+ mv.visitLabel(l15);
+ mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l3, l15, 0);
+ mv.visitLocalVariable("recipe", "Lgregtech/api/util/GT_Recipe;", null, l3, l15, 1);
+ mv.visitLocalVariable("aSafeUnlocalName", "Ljava/lang/String;", null, l1, l2, 2);
+ mv.visitLocalVariable("aSafeUnlocalName", "Ljava/lang/String;", null, l10, l15, 2);
+ mv.visitLocalVariable("aStack", "Lnet/minecraft/item/ItemStack;", null, l0, l15, 3);
+ mv.visitLocalVariable("t", "Ljava/lang/Throwable;", null, l11, l10, 4);
+ mv.visitMaxs(7, 5);
+ mv.visitEnd();*/
+ // Lets just static call my replacement function
+ mv = cw.visitMethod(
+ ACC_PUBLIC,
+ "registerAssAchievement",
+ "(Lgregtech/api/util/GT_Recipe;)Lnet/minecraft/stats/Achievement;",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(291, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements",
+ "registerAssAchievement",
+ "(Lgregtech/api/util/GT_Recipe;)Lnet/minecraft/stats/Achievement;",
+ false);
+ mv.visitInsn(ARETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l0, l1, 0);
+ mv.visitLocalVariable("recipe", "Lgregtech/api/util/GT_Recipe;", null, l0, l1, 1);
+ mv.visitMaxs(1, 2);
+ mv.visitEnd();
+ didInject = true;
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+ public boolean patchOnItemPickup08(ClassWriter cw) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Injecting " + "onItemPickup" + ".");
+ AnnotationVisitor av0;
+ mv = cw.visitMethod(
+ ACC_PUBLIC,
+ "onItemPickup",
+ "(Lnet/minecraftforge/event/entity/player/EntityItemPickupEvent;)V",
+ null,
+ null);
+ av0 = mv.visitAnnotation("Lcpw/mods/fml/common/eventhandler/SubscribeEvent;", true);
+ av0.visitEnd();
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(418, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "net/minecraftforge/event/entity/player/EntityItemPickupEvent",
+ "entityPlayer",
+ "Lnet/minecraft/entity/player/EntityPlayer;");
+ mv.visitVarInsn(ASTORE, 2);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(419, l1);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "net/minecraftforge/event/entity/player/EntityItemPickupEvent",
+ "item",
+ "Lnet/minecraft/entity/item/EntityItem;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraft/entity/item/EntityItem",
+ "getEntityItem",
+ "()Lnet/minecraft/item/ItemStack;",
+ false);
+ mv.visitVarInsn(ASTORE, 3);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(420, l2);
+ mv.visitVarInsn(ALOAD, 2);
+ Label l3 = new Label();
+ mv.visitJumpInsn(IFNULL, l3);
+ mv.visitVarInsn(ALOAD, 3);
+ Label l4 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l4);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(421, l3);
+ mv.visitFrame(
+ F_APPEND,
+ 2,
+ new Object[] {"net/minecraft/entity/player/EntityPlayer", "net/minecraft/item/ItemStack"},
+ 0,
+ null);
+ mv.visitInsn(RETURN);
+ mv.visitLabel(l4);
+ mv.visitLineNumber(424, l4);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gregtech/api/util/GT_OreDictUnificator",
+ "getItemData",
+ "(Lnet/minecraft/item/ItemStack;)Lgregtech/api/objects/ItemData;",
+ false);
+ mv.visitVarInsn(ASTORE, 4);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(425, l5);
+ mv.visitVarInsn(ALOAD, 4);
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNULL, l6);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(426, l7);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "dust", "Lgregtech/api/enums/OrePrefixes;");
+ Label l8 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l8);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(427, l9);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Lutetium", "Lgregtech/api/enums/Materials;");
+ Label l10 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l10);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(428, l11);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("newmetal");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ mv.visitLabel(l10);
+ mv.visitLineNumber(430, l10);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"gregtech/api/objects/ItemData"}, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("cleandust");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLineNumber(431, l12);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l8);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "ore", "Lgregtech/api/enums/OrePrefixes;");
+ Label l13 = new Label();
+ mv.visitJumpInsn(IF_ACMPEQ, l13);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(
+ GETSTATIC, "gregtech/api/enums/OrePrefixes", "oreBlackgranite", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitJumpInsn(IF_ACMPEQ, l13);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(
+ GETSTATIC, "gregtech/api/enums/OrePrefixes", "oreEndstone", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitJumpInsn(IF_ACMPEQ, l13);
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLineNumber(432, l14);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(
+ GETSTATIC, "gregtech/api/enums/OrePrefixes", "oreNetherrack", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitJumpInsn(IF_ACMPEQ, l13);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(
+ GETSTATIC, "gregtech/api/enums/OrePrefixes", "oreRedgranite", "Lgregtech/api/enums/OrePrefixes;");
+ Label l15 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l15);
+ mv.visitLabel(l13);
+ mv.visitLineNumber(433, l13);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(ICONST_0);
+ mv.visitVarInsn(ISTORE, 5);
+ Label l16 = new Label();
+ mv.visitLabel(l16);
+ Label l17 = new Label();
+ mv.visitJumpInsn(GOTO, l17);
+ Label l18 = new Label();
+ mv.visitLabel(l18);
+ mv.visitLineNumber(434, l18);
+ mv.visitFrame(F_APPEND, 1, new Object[] {INTEGER}, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/objects/ItemData",
+ "getAllMaterialStacks",
+ "()Ljava/util/ArrayList;",
+ false);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
+ mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/enums/Materials", "name", "()Ljava/lang/String;", false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l19 = new Label();
+ mv.visitLabel(l19);
+ mv.visitLineNumber(435, l19);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/objects/ItemData",
+ "getAllMaterialStacks",
+ "()Ljava/util/ArrayList;",
+ false);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
+ mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "AnyIron", "Lgregtech/api/enums/Materials;");
+ Label l20 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l20);
+ Label l21 = new Label();
+ mv.visitLabel(l21);
+ mv.visitLineNumber(436, l21);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("iron");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ mv.visitLabel(l20);
+ mv.visitLineNumber(433, l20);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitIincInsn(5, 1);
+ mv.visitLabel(l17);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/objects/ItemData",
+ "getAllMaterialStacks",
+ "()Ljava/util/ArrayList;",
+ false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "size", "()I", false);
+ mv.visitJumpInsn(IF_ICMPLT, l18);
+ Label l22 = new Label();
+ mv.visitLabel(l22);
+ mv.visitLineNumber(439, l22);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l15);
+ mv.visitFrame(F_CHOP, 1, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushed", "Lgregtech/api/enums/OrePrefixes;");
+ Label l23 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l23);
+ Label l24 = new Label();
+ mv.visitLabel(l24);
+ mv.visitLineNumber(440, l24);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("crushed");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l25 = new Label();
+ mv.visitLabel(l25);
+ mv.visitLineNumber(441, l25);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l23);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(
+ GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushedPurified", "Lgregtech/api/enums/OrePrefixes;");
+ Label l26 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l26);
+ Label l27 = new Label();
+ mv.visitLabel(l27);
+ mv.visitLineNumber(442, l27);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("washing");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l28 = new Label();
+ mv.visitLabel(l28);
+ mv.visitLineNumber(443, l28);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l26);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(
+ GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushedCentrifuged", "Lgregtech/api/enums/OrePrefixes;");
+ Label l29 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l29);
+ Label l30 = new Label();
+ mv.visitLabel(l30);
+ mv.visitLineNumber(444, l30);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("spinit");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l31 = new Label();
+ mv.visitLabel(l31);
+ mv.visitLineNumber(445, l31);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l29);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Steel", "Lgregtech/api/enums/Materials;");
+ Label l32 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l32);
+ Label l33 = new Label();
+ mv.visitLabel(l33);
+ mv.visitLineNumber(446, l33);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "ingot", "Lgregtech/api/enums/OrePrefixes;");
+ Label l34 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l34);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitFieldInsn(GETFIELD, "net/minecraft/item/ItemStack", "stackSize", "I");
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getMaxStackSize", "()I", false);
+ mv.visitJumpInsn(IF_ICMPNE, l34);
+ Label l35 = new Label();
+ mv.visitLabel(l35);
+ mv.visitLineNumber(447, l35);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("steel");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l36 = new Label();
+ mv.visitLabel(l36);
+ mv.visitLineNumber(448, l36);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l34);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "nugget", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitJumpInsn(IF_ACMPNE, l6);
+ mv.visitLdcInsn("Thaumcraft");
+ mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/Loader", "isModLoaded", "(Ljava/lang/String;)Z", false);
+ mv.visitJumpInsn(IFEQ, l6);
+ Label l37 = new Label();
+ mv.visitLabel(l37);
+ mv.visitLineNumber(449, l37);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraft/entity/player/EntityPlayer",
+ "getDisplayName",
+ "()Ljava/lang/String;",
+ false);
+ mv.visitLdcInsn("GT_IRON_TO_STEEL");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "thaumcraft/api/ThaumcraftApiHelper",
+ "isResearchComplete",
+ "(Ljava/lang/String;Ljava/lang/String;)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l6);
+ Label l38 = new Label();
+ mv.visitLabel(l38);
+ mv.visitLineNumber(450, l38);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("steel");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l39 = new Label();
+ mv.visitLabel(l39);
+ mv.visitLineNumber(453, l39);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l32);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "circuit", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitJumpInsn(IF_ACMPNE, l6);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Advanced", "Lgregtech/api/enums/Materials;");
+ mv.visitJumpInsn(IF_ACMPNE, l6);
+ Label l40 = new Label();
+ mv.visitLabel(l40);
+ mv.visitLineNumber(454, l40);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("stepforward");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(457, l6);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "startsWith", "(Ljava/lang/String;)Z", false);
+ Label l41 = new Label();
+ mv.visitJumpInsn(IFEQ, l41);
+ Label l42 = new Label();
+ mv.visitLabel(l42);
+ mv.visitLineNumber(458, l42);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32500");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l43 = new Label();
+ mv.visitJumpInsn(IFEQ, l43);
+ Label l44 = new Label();
+ mv.visitLabel(l44);
+ mv.visitLineNumber(459, l44);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestlead");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l45 = new Label();
+ mv.visitLabel(l45);
+ mv.visitLineNumber(460, l45);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l43);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32501");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l46 = new Label();
+ mv.visitJumpInsn(IFEQ, l46);
+ Label l47 = new Label();
+ mv.visitLabel(l47);
+ mv.visitLineNumber(461, l47);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestsilver");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l48 = new Label();
+ mv.visitLabel(l48);
+ mv.visitLineNumber(462, l48);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l46);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32503");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l49 = new Label();
+ mv.visitJumpInsn(IFEQ, l49);
+ Label l50 = new Label();
+ mv.visitLabel(l50);
+ mv.visitLineNumber(463, l50);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestiron");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l51 = new Label();
+ mv.visitLabel(l51);
+ mv.visitLineNumber(464, l51);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l49);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32504");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l52 = new Label();
+ mv.visitJumpInsn(IFEQ, l52);
+ Label l53 = new Label();
+ mv.visitLabel(l53);
+ mv.visitLineNumber(465, l53);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestgold");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l54 = new Label();
+ mv.visitLabel(l54);
+ mv.visitLineNumber(466, l54);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l52);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32530");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l55 = new Label();
+ mv.visitJumpInsn(IFEQ, l55);
+ Label l56 = new Label();
+ mv.visitLabel(l56);
+ mv.visitLineNumber(467, l56);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestcopper");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l57 = new Label();
+ mv.visitLabel(l57);
+ mv.visitLineNumber(468, l57);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l55);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32540");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l58 = new Label();
+ mv.visitJumpInsn(IFEQ, l58);
+ Label l59 = new Label();
+ mv.visitLabel(l59);
+ mv.visitLineNumber(469, l59);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havesttin");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l60 = new Label();
+ mv.visitLabel(l60);
+ mv.visitLineNumber(470, l60);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l58);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32510");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l61 = new Label();
+ mv.visitJumpInsn(IFEQ, l61);
+ Label l62 = new Label();
+ mv.visitLabel(l62);
+ mv.visitLineNumber(471, l62);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestoil");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l63 = new Label();
+ mv.visitLabel(l63);
+ mv.visitLineNumber(472, l63);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l61);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32511");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l64 = new Label();
+ mv.visitJumpInsn(IFEQ, l64);
+ Label l65 = new Label();
+ mv.visitLabel(l65);
+ mv.visitLineNumber(473, l65);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestemeralds");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l66 = new Label();
+ mv.visitLabel(l66);
+ mv.visitLineNumber(474, l66);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l64);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32706");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l67 = new Label();
+ mv.visitJumpInsn(IFEQ, l67);
+ Label l68 = new Label();
+ mv.visitLabel(l68);
+ mv.visitLineNumber(475, l68);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("energyflow");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l69 = new Label();
+ mv.visitLabel(l69);
+ mv.visitLineNumber(476, l69);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l67);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32702");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l70 = new Label();
+ mv.visitJumpInsn(IFEQ, l70);
+ Label l71 = new Label();
+ mv.visitLabel(l71);
+ mv.visitLineNumber(477, l71);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("bettercircuits");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l72 = new Label();
+ mv.visitLabel(l72);
+ mv.visitLineNumber(478, l72);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l70);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32707");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l73 = new Label();
+ mv.visitJumpInsn(IFEQ, l73);
+ Label l74 = new Label();
+ mv.visitLabel(l74);
+ mv.visitLineNumber(479, l74);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("datasaving");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l75 = new Label();
+ mv.visitLabel(l75);
+ mv.visitLineNumber(480, l75);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l73);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32597");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l76 = new Label();
+ mv.visitJumpInsn(IFEQ, l76);
+ Label l77 = new Label();
+ mv.visitLabel(l77);
+ mv.visitLineNumber(481, l77);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("orbs");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l78 = new Label();
+ mv.visitLabel(l78);
+ mv.visitLineNumber(482, l78);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l76);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32599");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l79 = new Label();
+ mv.visitJumpInsn(IFEQ, l79);
+ Label l80 = new Label();
+ mv.visitLabel(l80);
+ mv.visitLineNumber(483, l80);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("thatspower");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l81 = new Label();
+ mv.visitLabel(l81);
+ mv.visitLineNumber(484, l81);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l79);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32598");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l82 = new Label();
+ mv.visitJumpInsn(IFEQ, l82);
+ Label l83 = new Label();
+ mv.visitLabel(l83);
+ mv.visitLineNumber(485, l83);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("luck");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l84 = new Label();
+ mv.visitLabel(l84);
+ mv.visitLineNumber(486, l84);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l82);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32749");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l85 = new Label();
+ mv.visitJumpInsn(IFEQ, l85);
+ Label l86 = new Label();
+ mv.visitLabel(l86);
+ mv.visitLineNumber(487, l86);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("closeit");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l87 = new Label();
+ mv.visitLabel(l87);
+ mv.visitLineNumber(488, l87);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l85);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32730");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l88 = new Label();
+ mv.visitJumpInsn(IFEQ, l88);
+ Label l89 = new Label();
+ mv.visitLabel(l89);
+ mv.visitLineNumber(489, l89);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("manipulation");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l90 = new Label();
+ mv.visitLabel(l90);
+ mv.visitLineNumber(490, l90);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l88);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32729");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l91 = new Label();
+ mv.visitJumpInsn(IFEQ, l91);
+ Label l92 = new Label();
+ mv.visitLabel(l92);
+ mv.visitLineNumber(491, l92);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("filterregulate");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l93 = new Label();
+ mv.visitLabel(l93);
+ mv.visitLineNumber(492, l93);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l91);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32605");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l94 = new Label();
+ mv.visitJumpInsn(IFEQ, l94);
+ Label l95 = new Label();
+ mv.visitLabel(l95);
+ mv.visitLineNumber(493, l95);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("whatnow");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l96 = new Label();
+ mv.visitLabel(l96);
+ mv.visitLineNumber(494, l96);
+ mv.visitJumpInsn(GOTO, l41);
+ mv.visitLabel(l94);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.Thoriumcell");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ mv.visitJumpInsn(IFEQ, l41);
+ Label l97 = new Label();
+ mv.visitLabel(l97);
+ mv.visitLineNumber(495, l97);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("newfuel");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ mv.visitLabel(l41);
+ mv.visitLineNumber(498, l41);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(RETURN);
+ Label l98 = new Label();
+ mv.visitLabel(l98);
+ mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l0, l98, 0);
+ mv.visitLocalVariable(
+ "event", "Lnet/minecraftforge/event/entity/player/EntityItemPickupEvent;", null, l0, l98, 1);
+ mv.visitLocalVariable("player", "Lnet/minecraft/entity/player/EntityPlayer;", null, l1, l98, 2);
+ mv.visitLocalVariable("stack", "Lnet/minecraft/item/ItemStack;", null, l2, l98, 3);
+ mv.visitLocalVariable("data", "Lgregtech/api/objects/ItemData;", null, l5, l98, 4);
+ mv.visitLocalVariable("i", "I", null, l16, l22, 5);
+ mv.visitMaxs(4, 6);
+ mv.visitEnd();
+ didInject = true;
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+ public boolean patchOnItemPickup09(ClassWriter cw) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Injecting " + "onItemPickup" + ".");
+ /**
+ * Inject new, safer code
+ */
+ AnnotationVisitor av0;
+ mv = cw.visitMethod(
+ ACC_PUBLIC,
+ "onItemPickup",
+ "(Lnet/minecraftforge/event/entity/player/EntityItemPickupEvent;)V",
+ null,
+ null);
+ av0 = mv.visitAnnotation("Lcpw/mods/fml/common/eventhandler/SubscribeEvent;", true);
+ av0.visitEnd();
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(546, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "net/minecraftforge/event/entity/player/EntityItemPickupEvent",
+ "entityPlayer",
+ "Lnet/minecraft/entity/player/EntityPlayer;");
+ mv.visitVarInsn(ASTORE, 2);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(547, l1);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "net/minecraftforge/event/entity/player/EntityItemPickupEvent",
+ "item",
+ "Lnet/minecraft/entity/item/EntityItem;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraft/entity/item/EntityItem",
+ "getEntityItem",
+ "()Lnet/minecraft/item/ItemStack;",
+ false);
+ mv.visitVarInsn(ASTORE, 3);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(548, l2);
+ mv.visitVarInsn(ALOAD, 2);
+ Label l3 = new Label();
+ mv.visitJumpInsn(IFNULL, l3);
+ mv.visitVarInsn(ALOAD, 3);
+ Label l4 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l4);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(549, l3);
+ mv.visitFrame(
+ F_APPEND,
+ 2,
+ new Object[] {"net/minecraft/entity/player/EntityPlayer", "net/minecraft/item/ItemStack"},
+ 0,
+ null);
+ mv.visitInsn(RETURN);
+ mv.visitLabel(l4);
+ mv.visitLineNumber(551, l4);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gregtech/api/util/GT_OreDictUnificator",
+ "getItemData",
+ "(Lnet/minecraft/item/ItemStack;)Lgregtech/api/objects/ItemData;",
+ false);
+ mv.visitVarInsn(ASTORE, 4);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(552, l5);
+ mv.visitVarInsn(ALOAD, 4);
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNULL, l6);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitJumpInsn(IFNULL, l6);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(553, l7);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "dust", "Lgregtech/api/enums/OrePrefixes;");
+ Label l8 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l8);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(554, l9);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Lutetium", "Lgregtech/api/enums/Materials;");
+ Label l10 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l10);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(555, l11);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("newmetal");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ mv.visitLabel(l10);
+ mv.visitLineNumber(557, l10);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"gregtech/api/objects/ItemData"}, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Gunpowder", "Lgregtech/api/enums/Materials;");
+ mv.visitJumpInsn(IF_ACMPEQ, l6);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLineNumber(558, l12);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("cleandust");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l13 = new Label();
+ mv.visitLabel(l13);
+ mv.visitLineNumber(560, l13);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l8);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/enums/OrePrefixes", "name", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("ore");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "startsWith", "(Ljava/lang/String;)Z", false);
+ Label l14 = new Label();
+ mv.visitJumpInsn(IFEQ, l14);
+ Label l15 = new Label();
+ mv.visitLabel(l15);
+ mv.visitLineNumber(561, l15);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/objects/ItemData",
+ "getAllMaterialStacks",
+ "()Ljava/util/ArrayList;",
+ false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "size", "()I", false);
+ mv.visitVarInsn(ISTORE, 5);
+ Label l16 = new Label();
+ mv.visitLabel(l16);
+ mv.visitLineNumber(562, l16);
+ mv.visitInsn(ICONST_0);
+ mv.visitVarInsn(ISTORE, 6);
+ Label l17 = new Label();
+ mv.visitLabel(l17);
+ Label l18 = new Label();
+ mv.visitJumpInsn(GOTO, l18);
+ Label l19 = new Label();
+ mv.visitLabel(l19);
+ mv.visitLineNumber(563, l19);
+ mv.visitFrame(F_APPEND, 2, new Object[] {INTEGER, INTEGER}, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/objects/ItemData",
+ "getAllMaterialStacks",
+ "()Ljava/util/ArrayList;",
+ false);
+ mv.visitVarInsn(ILOAD, 6);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
+ mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/enums/Materials", "mName", "Ljava/lang/String;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l20 = new Label();
+ mv.visitLabel(l20);
+ mv.visitLineNumber(564, l20);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/objects/ItemData",
+ "getAllMaterialStacks",
+ "()Ljava/util/ArrayList;",
+ false);
+ mv.visitVarInsn(ILOAD, 6);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
+ mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Iron", "Lgregtech/api/enums/Materials;");
+ Label l21 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l21);
+ Label l22 = new Label();
+ mv.visitLabel(l22);
+ mv.visitLineNumber(565, l22);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("iron");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ mv.visitLabel(l21);
+ mv.visitLineNumber(567, l21);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/objects/ItemData",
+ "getAllMaterialStacks",
+ "()Ljava/util/ArrayList;",
+ false);
+ mv.visitVarInsn(ILOAD, 6);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
+ mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Copper", "Lgregtech/api/enums/Materials;");
+ Label l23 = new Label();
+ mv.visitJumpInsn(IF_ACMPEQ, l23);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/objects/ItemData",
+ "getAllMaterialStacks",
+ "()Ljava/util/ArrayList;",
+ false);
+ mv.visitVarInsn(ILOAD, 6);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/ArrayList", "get", "(I)Ljava/lang/Object;", false);
+ mv.visitTypeInsn(CHECKCAST, "gregtech/api/objects/MaterialStack");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Tin", "Lgregtech/api/enums/Materials;");
+ Label l24 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l24);
+ mv.visitLabel(l23);
+ mv.visitLineNumber(568, l23);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "net/minecraftforge/event/entity/player/EntityItemPickupEvent",
+ "entityPlayer",
+ "Lnet/minecraft/entity/player/EntityPlayer;");
+ mv.visitLdcInsn("mineOre");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ mv.visitLabel(l24);
+ mv.visitLineNumber(562, l24);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitIincInsn(6, 1);
+ mv.visitLabel(l18);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ILOAD, 6);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitJumpInsn(IF_ICMPLT, l19);
+ Label l25 = new Label();
+ mv.visitLabel(l25);
+ mv.visitLineNumber(572, l25);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l14);
+ mv.visitFrame(F_CHOP, 2, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushed", "Lgregtech/api/enums/OrePrefixes;");
+ Label l26 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l26);
+ Label l27 = new Label();
+ mv.visitLabel(l27);
+ mv.visitLineNumber(573, l27);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("crushed");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l28 = new Label();
+ mv.visitLabel(l28);
+ mv.visitLineNumber(574, l28);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l26);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(
+ GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushedPurified", "Lgregtech/api/enums/OrePrefixes;");
+ Label l29 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l29);
+ Label l30 = new Label();
+ mv.visitLabel(l30);
+ mv.visitLineNumber(575, l30);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("washing");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l31 = new Label();
+ mv.visitLabel(l31);
+ mv.visitLineNumber(576, l31);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l29);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(
+ GETSTATIC, "gregtech/api/enums/OrePrefixes", "crushedCentrifuged", "Lgregtech/api/enums/OrePrefixes;");
+ Label l32 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l32);
+ Label l33 = new Label();
+ mv.visitLabel(l33);
+ mv.visitLineNumber(577, l33);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("spinit");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l34 = new Label();
+ mv.visitLabel(l34);
+ mv.visitLineNumber(578, l34);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l32);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/ItemData", "mMaterial", "Lgregtech/api/objects/MaterialStack;");
+ mv.visitFieldInsn(
+ GETFIELD, "gregtech/api/objects/MaterialStack", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/Materials", "Steel", "Lgregtech/api/enums/Materials;");
+ mv.visitJumpInsn(IF_ACMPNE, l6);
+ Label l35 = new Label();
+ mv.visitLabel(l35);
+ mv.visitLineNumber(579, l35);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "ingot", "Lgregtech/api/enums/OrePrefixes;");
+ Label l36 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l36);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitFieldInsn(GETFIELD, "net/minecraft/item/ItemStack", "stackSize", "I");
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getMaxStackSize", "()I", false);
+ mv.visitJumpInsn(IF_ICMPNE, l36);
+ Label l37 = new Label();
+ mv.visitLabel(l37);
+ mv.visitLineNumber(580, l37);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("steel");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l38 = new Label();
+ mv.visitLabel(l38);
+ mv.visitLineNumber(581, l38);
+ mv.visitJumpInsn(GOTO, l6);
+ mv.visitLabel(l36);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/objects/ItemData", "mPrefix", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/enums/OrePrefixes", "nugget", "Lgregtech/api/enums/OrePrefixes;");
+ mv.visitJumpInsn(IF_ACMPNE, l6);
+ mv.visitLdcInsn("Thaumcraft");
+ mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/Loader", "isModLoaded", "(Ljava/lang/String;)Z", false);
+ mv.visitJumpInsn(IFEQ, l6);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraft/entity/player/EntityPlayer",
+ "getDisplayName",
+ "()Ljava/lang/String;",
+ false);
+ mv.visitLdcInsn("GT_IRON_TO_STEEL");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "thaumcraft/api/ThaumcraftApiHelper",
+ "isResearchComplete",
+ "(Ljava/lang/String;Ljava/lang/String;)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l6);
+ Label l39 = new Label();
+ mv.visitLabel(l39);
+ mv.visitLineNumber(582, l39);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("steel");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(589, l6);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "startsWith", "(Ljava/lang/String;)Z", false);
+ Label l40 = new Label();
+ mv.visitJumpInsn(IFEQ, l40);
+ Label l41 = new Label();
+ mv.visitLabel(l41);
+ mv.visitLineNumber(590, l41);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32500");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l42 = new Label();
+ mv.visitJumpInsn(IFEQ, l42);
+ Label l43 = new Label();
+ mv.visitLabel(l43);
+ mv.visitLineNumber(591, l43);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestlead");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l44 = new Label();
+ mv.visitLabel(l44);
+ mv.visitLineNumber(592, l44);
+ Label l45 = new Label();
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l42);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32501");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l46 = new Label();
+ mv.visitJumpInsn(IFEQ, l46);
+ Label l47 = new Label();
+ mv.visitLabel(l47);
+ mv.visitLineNumber(593, l47);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestsilver");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l48 = new Label();
+ mv.visitLabel(l48);
+ mv.visitLineNumber(594, l48);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l46);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32503");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l49 = new Label();
+ mv.visitJumpInsn(IFEQ, l49);
+ Label l50 = new Label();
+ mv.visitLabel(l50);
+ mv.visitLineNumber(595, l50);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestiron");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l51 = new Label();
+ mv.visitLabel(l51);
+ mv.visitLineNumber(596, l51);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l49);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32504");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l52 = new Label();
+ mv.visitJumpInsn(IFEQ, l52);
+ Label l53 = new Label();
+ mv.visitLabel(l53);
+ mv.visitLineNumber(597, l53);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestgold");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l54 = new Label();
+ mv.visitLabel(l54);
+ mv.visitLineNumber(598, l54);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l52);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32530");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l55 = new Label();
+ mv.visitJumpInsn(IFEQ, l55);
+ Label l56 = new Label();
+ mv.visitLabel(l56);
+ mv.visitLineNumber(599, l56);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestcopper");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l57 = new Label();
+ mv.visitLabel(l57);
+ mv.visitLineNumber(600, l57);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l55);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32540");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l58 = new Label();
+ mv.visitJumpInsn(IFEQ, l58);
+ Label l59 = new Label();
+ mv.visitLabel(l59);
+ mv.visitLineNumber(601, l59);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havesttin");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l60 = new Label();
+ mv.visitLabel(l60);
+ mv.visitLineNumber(602, l60);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l58);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32510");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l61 = new Label();
+ mv.visitJumpInsn(IFEQ, l61);
+ Label l62 = new Label();
+ mv.visitLabel(l62);
+ mv.visitLineNumber(603, l62);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestoil");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l63 = new Label();
+ mv.visitLabel(l63);
+ mv.visitLineNumber(604, l63);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l61);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.02.32511");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l64 = new Label();
+ mv.visitJumpInsn(IFEQ, l64);
+ Label l65 = new Label();
+ mv.visitLabel(l65);
+ mv.visitLineNumber(605, l65);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("havestemeralds");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l66 = new Label();
+ mv.visitLabel(l66);
+ mv.visitLineNumber(606, l66);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l64);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.03.32082");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l67 = new Label();
+ mv.visitJumpInsn(IFEQ, l67);
+ Label l68 = new Label();
+ mv.visitLabel(l68);
+ mv.visitLineNumber(607, l68);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("energyflow");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l69 = new Label();
+ mv.visitLabel(l69);
+ mv.visitLineNumber(608, l69);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l67);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32702");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l70 = new Label();
+ mv.visitJumpInsn(IFEQ, l70);
+ Label l71 = new Label();
+ mv.visitLabel(l71);
+ mv.visitLineNumber(609, l71);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("bettercircuits");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l72 = new Label();
+ mv.visitLabel(l72);
+ mv.visitLineNumber(610, l72);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l70);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32707");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l73 = new Label();
+ mv.visitJumpInsn(IFEQ, l73);
+ Label l74 = new Label();
+ mv.visitLabel(l74);
+ mv.visitLineNumber(611, l74);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("datasaving");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l75 = new Label();
+ mv.visitLabel(l75);
+ mv.visitLineNumber(612, l75);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l73);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32597");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l76 = new Label();
+ mv.visitJumpInsn(IFEQ, l76);
+ Label l77 = new Label();
+ mv.visitLabel(l77);
+ mv.visitLineNumber(613, l77);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("orbs");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l78 = new Label();
+ mv.visitLabel(l78);
+ mv.visitLineNumber(614, l78);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l76);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32599");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l79 = new Label();
+ mv.visitJumpInsn(IFEQ, l79);
+ Label l80 = new Label();
+ mv.visitLabel(l80);
+ mv.visitLineNumber(615, l80);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("thatspower");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l81 = new Label();
+ mv.visitLabel(l81);
+ mv.visitLineNumber(616, l81);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l79);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32598");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l82 = new Label();
+ mv.visitJumpInsn(IFEQ, l82);
+ Label l83 = new Label();
+ mv.visitLabel(l83);
+ mv.visitLineNumber(617, l83);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("luck");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l84 = new Label();
+ mv.visitLabel(l84);
+ mv.visitLineNumber(618, l84);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l82);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32749");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l85 = new Label();
+ mv.visitJumpInsn(IFEQ, l85);
+ Label l86 = new Label();
+ mv.visitLabel(l86);
+ mv.visitLineNumber(619, l86);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("closeit");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l87 = new Label();
+ mv.visitLabel(l87);
+ mv.visitLineNumber(620, l87);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l85);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32730");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l88 = new Label();
+ mv.visitJumpInsn(IFEQ, l88);
+ Label l89 = new Label();
+ mv.visitLabel(l89);
+ mv.visitLineNumber(621, l89);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("manipulation");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l90 = new Label();
+ mv.visitLabel(l90);
+ mv.visitLineNumber(622, l90);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l88);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32729");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l91 = new Label();
+ mv.visitJumpInsn(IFEQ, l91);
+ Label l92 = new Label();
+ mv.visitLabel(l92);
+ mv.visitLineNumber(623, l92);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("filterregulate");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l93 = new Label();
+ mv.visitLabel(l93);
+ mv.visitLineNumber(624, l93);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l91);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32605");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l94 = new Label();
+ mv.visitJumpInsn(IFEQ, l94);
+ Label l95 = new Label();
+ mv.visitLabel(l95);
+ mv.visitLineNumber(625, l95);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("whatnow");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l96 = new Label();
+ mv.visitLabel(l96);
+ mv.visitLineNumber(626, l96);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l94);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32736");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l97 = new Label();
+ mv.visitJumpInsn(IFEQ, l97);
+ Label l98 = new Label();
+ mv.visitLabel(l98);
+ mv.visitLineNumber(627, l98);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("zpmage");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l99 = new Label();
+ mv.visitLabel(l99);
+ mv.visitLineNumber(628, l99);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l97);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32737");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l100 = new Label();
+ mv.visitJumpInsn(IFEQ, l100);
+ Label l101 = new Label();
+ mv.visitLabel(l101);
+ mv.visitLineNumber(629, l101);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("uvage");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l102 = new Label();
+ mv.visitLabel(l102);
+ mv.visitLineNumber(630, l102);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l100);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.03.32030");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l103 = new Label();
+ mv.visitJumpInsn(IFEQ, l103);
+ Label l104 = new Label();
+ mv.visitLabel(l104);
+ mv.visitLineNumber(631, l104);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("gtmonosilicon");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l105 = new Label();
+ mv.visitLabel(l105);
+ mv.visitLineNumber(632, l105);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l103);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.03.32036");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l106 = new Label();
+ mv.visitJumpInsn(IFEQ, l106);
+ Label l107 = new Label();
+ mv.visitLabel(l107);
+ mv.visitLineNumber(633, l107);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("gtlogicwafer");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l108 = new Label();
+ mv.visitLabel(l108);
+ mv.visitLineNumber(634, l108);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l106);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32701");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l109 = new Label();
+ mv.visitJumpInsn(IFEQ, l109);
+ Label l110 = new Label();
+ mv.visitLabel(l110);
+ mv.visitLineNumber(635, l110);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("gtlogiccircuit");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l111 = new Label();
+ mv.visitLabel(l111);
+ mv.visitLineNumber(636, l111);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l109);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.03.32085");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l112 = new Label();
+ mv.visitJumpInsn(IFEQ, l112);
+ Label l113 = new Label();
+ mv.visitLabel(l113);
+ mv.visitLineNumber(637, l113);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("gtquantumprocessor");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l114 = new Label();
+ mv.visitLabel(l114);
+ mv.visitLineNumber(638, l114);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l112);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.03.32089");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l115 = new Label();
+ mv.visitJumpInsn(IFEQ, l115);
+ Label l116 = new Label();
+ mv.visitLabel(l116);
+ mv.visitLineNumber(639, l116);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("gtcrystalprocessor");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l117 = new Label();
+ mv.visitLabel(l117);
+ mv.visitLineNumber(640, l117);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l115);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.03.32092");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l118 = new Label();
+ mv.visitJumpInsn(IFEQ, l118);
+ Label l119 = new Label();
+ mv.visitLabel(l119);
+ mv.visitLineNumber(641, l119);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("gtwetware");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l120 = new Label();
+ mv.visitLabel(l120);
+ mv.visitLineNumber(642, l120);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l118);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.03.32095");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l121 = new Label();
+ mv.visitJumpInsn(IFEQ, l121);
+ Label l122 = new Label();
+ mv.visitLabel(l122);
+ mv.visitLineNumber(643, l122);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("gtwetmain");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l123 = new Label();
+ mv.visitLabel(l123);
+ mv.visitLineNumber(644, l123);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l121);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32736");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l124 = new Label();
+ mv.visitJumpInsn(IFEQ, l124);
+ Label l125 = new Label();
+ mv.visitLabel(l125);
+ mv.visitLineNumber(645, l125);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("zpmage");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l126 = new Label();
+ mv.visitLabel(l126);
+ mv.visitLineNumber(646, l126);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l124);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.metaitem.01.32737");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ mv.visitJumpInsn(IFEQ, l45);
+ Label l127 = new Label();
+ mv.visitLabel(l127);
+ mv.visitLineNumber(647, l127);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("uvage");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l128 = new Label();
+ mv.visitLabel(l128);
+ mv.visitLineNumber(649, l128);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l40);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("gt.Thoriumcell");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ Label l129 = new Label();
+ mv.visitJumpInsn(IFEQ, l129);
+ Label l130 = new Label();
+ mv.visitLabel(l130);
+ mv.visitLineNumber(650, l130);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("newfuel");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l131 = new Label();
+ mv.visitLabel(l131);
+ mv.visitLineNumber(651, l131);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l129);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
+ mv.visitFieldInsn(GETSTATIC, "ic2/core/Ic2Items", "quantumBodyarmor", "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
+ Label l132 = new Label();
+ mv.visitJumpInsn(IF_ACMPEQ, l132);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
+ mv.visitFieldInsn(GETSTATIC, "ic2/core/Ic2Items", "quantumBoots", "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
+ mv.visitJumpInsn(IF_ACMPEQ, l132);
+ Label l133 = new Label();
+ mv.visitLabel(l133);
+ mv.visitLineNumber(652, l133);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
+ mv.visitFieldInsn(GETSTATIC, "ic2/core/Ic2Items", "quantumHelmet", "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
+ mv.visitJumpInsn(IF_ACMPEQ, l132);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
+ mv.visitFieldInsn(GETSTATIC, "ic2/core/Ic2Items", "quantumLeggings", "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false);
+ Label l134 = new Label();
+ mv.visitJumpInsn(IF_ACMPNE, l134);
+ mv.visitLabel(l132);
+ mv.visitLineNumber(653, l132);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("buildQArmor");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ Label l135 = new Label();
+ mv.visitLabel(l135);
+ mv.visitLineNumber(654, l135);
+ mv.visitJumpInsn(GOTO, l45);
+ mv.visitLabel(l134);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getUnlocalizedName", "()Ljava/lang/String;", false);
+ mv.visitLdcInsn("ic2.itemPartCircuitAdv");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);
+ mv.visitJumpInsn(IFEQ, l45);
+ Label l136 = new Label();
+ mv.visitLabel(l136);
+ mv.visitLineNumber(655, l136);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitLdcInsn("stepforward");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "issueAchievement",
+ "(Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)V",
+ false);
+ mv.visitLabel(l45);
+ mv.visitLineNumber(657, l45);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(RETURN);
+ Label l137 = new Label();
+ mv.visitLabel(l137);
+ mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l0, l137, 0);
+ mv.visitLocalVariable(
+ "event", "Lnet/minecraftforge/event/entity/player/EntityItemPickupEvent;", null, l0, l137, 1);
+ mv.visitLocalVariable("player", "Lnet/minecraft/entity/player/EntityPlayer;", null, l1, l137, 2);
+ mv.visitLocalVariable("stack", "Lnet/minecraft/item/ItemStack;", null, l2, l137, 3);
+ mv.visitLocalVariable("data", "Lgregtech/api/objects/ItemData;", null, l5, l137, 4);
+ mv.visitLocalVariable("data_getAllMaterialStacks_sS", "I", null, l16, l25, 5);
+ mv.visitLocalVariable("i", "I", null, l17, l25, 6);
+ mv.visitMaxs(4, 7);
+ mv.visitEnd();
- public class MethodAdaptor extends ClassVisitor {
+ didInject = true;
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
- public MethodAdaptor(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
+ public class MethodAdaptor extends ClassVisitor {
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- if (name.equals("registerAssAchievement") || name.equals("onItemPickup")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO,
- "Found method " + name + ", removing.");
- methodVisitor = null;
- if (name.equals("registerAssAchievement")) {
- mDidRemoveAssLineRecipeAdder = true;
- }
- } else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- return methodVisitor;
- }
- }
+ public MethodAdaptor(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ if (name.equals("registerAssAchievement") || name.equals("onItemPickup")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Found method " + name + ", removing.");
+ methodVisitor = null;
+ if (name.equals("registerAssAchievement")) {
+ mDidRemoveAssLineRecipeAdder = true;
+ }
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements_CrashFix.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements_CrashFix.java
index fb297ed76e..e373c319cf 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements_CrashFix.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Achievements_CrashFix.java
@@ -1,6 +1,8 @@
package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
+
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -8,211 +10,235 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.preloader.DevHelper;
-
-public class ClassTransformer_GT_Achievements_CrashFix {
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
- private final boolean mObfuscated;
- private static boolean mDidRemoveAssLineRecipeAdder = false;
-
- public ClassTransformer_GT_Achievements_CrashFix(byte[] basicClass, boolean obfuscated) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
- mObfuscated = obfuscated;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
-
- aTempReader.accept(new MethodAdaptor(aTempWriter), 0);
-
- if (mDidRemoveAssLineRecipeAdder) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Patching GT .09");
- injectMethod(aTempWriter);
- }
- else {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Patch not required, skipping.");
- }
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
-
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Valid? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(ClassWriter cw) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Injecting " + "registerAssAchievement" + ". Obfuscated? "+mObfuscated);
-
- /**
- * Inject new, safer code
- */
-
- mv = cw.visitMethod(ACC_PUBLIC, "registerAssAchievement", "(Lgregtech/api/util/GT_Recipe;)Lnet/minecraft/stats/Achievement;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(293, l0);
- mv.visitVarInsn(ALOAD, 1);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNONNULL, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(294, l2);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitLdcInsn("GTPP_MOD: Someone tried to register an achievement for an invalid recipe. Please report this to Alkalus.");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(295, l3);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(ARETURN);
- mv.visitLabel(l1);
- mv.visitLineNumber(297, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
- Label l4 = new Label();
- mv.visitJumpInsn(IFNONNULL, l4);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(298, l5);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitLdcInsn("GTPP_MOD: Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
- Label l6 = new Label();
- mv.visitLabel(l6);
- mv.visitLineNumber(299, l6);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(ARETURN);
- mv.visitLabel(l4);
- mv.visitLineNumber(301, l4);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
- mv.visitVarInsn(ASTORE, 3);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(302, l7);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/ItemUtils", "getUnlocalizedItemName", "(Lnet/minecraft/item/ItemStack;)Ljava/lang/String;", false);
- mv.visitVarInsn(ASTORE, 2);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(304, l8);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/loaders/misc/GT_Achievements", "achievementList", "Ljava/util/concurrent/ConcurrentHashMap;");
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/concurrent/ConcurrentHashMap", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", false);
- Label l9 = new Label();
- mv.visitJumpInsn(IFNONNULL, l9);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(305, l10);
- mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IADD);
- mv.visitFieldInsn(PUTSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(306, l11);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitIntInsn(BIPUSH, 11);
- mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
- mv.visitInsn(ICONST_5);
- mv.visitInsn(IREM);
- mv.visitInsn(IADD);
- mv.visitInsn(INEG);
- mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
- mv.visitInsn(ICONST_5);
- mv.visitInsn(IDIV);
- mv.visitIntInsn(BIPUSH, 8);
- mv.visitInsn(ISUB);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
- mv.visitLdcInsn("NO_REQUIREMENT");
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/loaders/misc/GT_Achievements", "registerAchievement", "(Ljava/lang/String;IILnet/minecraft/item/ItemStack;Ljava/lang/String;Z)Lnet/minecraft/stats/Achievement;", false);
- mv.visitVarInsn(ASTORE, 4);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLineNumber(307, l12);
- Label l13 = new Label();
- mv.visitJumpInsn(GOTO, l13);
- mv.visitLabel(l9);
- mv.visitLineNumber(309, l9);
- mv.visitFrame(F_APPEND,2, new Object[] {"java/lang/String", "net/minecraft/item/ItemStack"}, 0, null);
- mv.visitInsn(ACONST_NULL);
- mv.visitVarInsn(ASTORE, 4);
- mv.visitLabel(l13);
- mv.visitLineNumber(311, l13);
- mv.visitFrame(F_APPEND,1, new Object[] {"net/minecraft/stats/Achievement"}, 0, null);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitInsn(ARETURN);
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l0, l14, 0);
- mv.visitLocalVariable("recipe", "Lgregtech/api/util/GT_Recipe;", null, l0, l14, 1);
- mv.visitLocalVariable("aSafeUnlocalName", "Ljava/lang/String;", null, l8, l14, 2);
- mv.visitLocalVariable("aStack", "Lnet/minecraft/item/ItemStack;", null, l7, l14, 3);
- mv.visitLocalVariable("aYouDidSomethingInGT", "Lnet/minecraft/stats/Achievement;", null, l12, l9, 4);
- mv.visitLocalVariable("aYouDidSomethingInGT", "Lnet/minecraft/stats/Achievement;", null, l13, l14, 4);
- mv.visitMaxs(7, 5);
- mv.visitEnd();
-
- didInject = true;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
-
-
-
- public class MethodAdaptor extends ClassVisitor {
-
- public MethodAdaptor(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- if (name.equals("registerAssAchievement")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Found method " + name + ", removing.");
- methodVisitor = null;
- mDidRemoveAssLineRecipeAdder = true;
- } else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- return methodVisitor;
- }
- }
-
+public class ClassTransformer_GT_Achievements_CrashFix {
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+ private final boolean mObfuscated;
+ private static boolean mDidRemoveAssLineRecipeAdder = false;
+
+ public ClassTransformer_GT_Achievements_CrashFix(byte[] basicClass, boolean obfuscated) {
+
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ mObfuscated = obfuscated;
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+
+ aTempReader.accept(new MethodAdaptor(aTempWriter), 0);
+
+ if (mDidRemoveAssLineRecipeAdder) {
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Patching GT .09");
+ injectMethod(aTempWriter);
+ } else {
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Patch not required, skipping.");
+ }
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean injectMethod(ClassWriter cw) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Achievements Patch",
+ Level.INFO,
+ "Injecting " + "registerAssAchievement" + ". Obfuscated? " + mObfuscated);
+
+ /**
+ * Inject new, safer code
+ */
+ mv = cw.visitMethod(
+ ACC_PUBLIC,
+ "registerAssAchievement",
+ "(Lgregtech/api/util/GT_Recipe;)Lnet/minecraft/stats/Achievement;",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(293, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(294, l2);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn(
+ "GTPP_MOD: Someone tried to register an achievement for an invalid recipe. Please report this to Alkalus.");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(295, l3);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(297, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
+ Label l4 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l4);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(298, l5);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn(
+ "GTPP_MOD: Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
+ Label l6 = new Label();
+ mv.visitLabel(l6);
+ mv.visitLineNumber(299, l6);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l4);
+ mv.visitLineNumber(301, l4);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
+ mv.visitVarInsn(ASTORE, 3);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(302, l7);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/core/util/minecraft/ItemUtils",
+ "getUnlocalizedItemName",
+ "(Lnet/minecraft/item/ItemStack;)Ljava/lang/String;",
+ false);
+ mv.visitVarInsn(ASTORE, 2);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(304, l8);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "gregtech/loaders/misc/GT_Achievements",
+ "achievementList",
+ "Ljava/util/concurrent/ConcurrentHashMap;");
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "java/util/concurrent/ConcurrentHashMap",
+ "get",
+ "(Ljava/lang/Object;)Ljava/lang/Object;",
+ false);
+ Label l9 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l9);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(305, l10);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IADD);
+ mv.visitFieldInsn(PUTSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(306, l11);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitIntInsn(BIPUSH, 11);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
+ mv.visitInsn(ICONST_5);
+ mv.visitInsn(IREM);
+ mv.visitInsn(IADD);
+ mv.visitInsn(INEG);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/loaders/misc/GT_Achievements", "assReg", "I");
+ mv.visitInsn(ICONST_5);
+ mv.visitInsn(IDIV);
+ mv.visitIntInsn(BIPUSH, 8);
+ mv.visitInsn(ISUB);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "gregtech/api/util/GT_Recipe", "getOutput", "(I)Lnet/minecraft/item/ItemStack;", false);
+ mv.visitLdcInsn("NO_REQUIREMENT");
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/loaders/misc/GT_Achievements",
+ "registerAchievement",
+ "(Ljava/lang/String;IILnet/minecraft/item/ItemStack;Ljava/lang/String;Z)Lnet/minecraft/stats/Achievement;",
+ false);
+ mv.visitVarInsn(ASTORE, 4);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLineNumber(307, l12);
+ Label l13 = new Label();
+ mv.visitJumpInsn(GOTO, l13);
+ mv.visitLabel(l9);
+ mv.visitLineNumber(309, l9);
+ mv.visitFrame(F_APPEND, 2, new Object[] {"java/lang/String", "net/minecraft/item/ItemStack"}, 0, null);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitVarInsn(ASTORE, 4);
+ mv.visitLabel(l13);
+ mv.visitLineNumber(311, l13);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"net/minecraft/stats/Achievement"}, 0, null);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitInsn(ARETURN);
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLocalVariable("this", "Lgregtech/loaders/misc/GT_Achievements;", null, l0, l14, 0);
+ mv.visitLocalVariable("recipe", "Lgregtech/api/util/GT_Recipe;", null, l0, l14, 1);
+ mv.visitLocalVariable("aSafeUnlocalName", "Ljava/lang/String;", null, l8, l14, 2);
+ mv.visitLocalVariable("aStack", "Lnet/minecraft/item/ItemStack;", null, l7, l14, 3);
+ mv.visitLocalVariable("aYouDidSomethingInGT", "Lnet/minecraft/stats/Achievement;", null, l12, l9, 4);
+ mv.visitLocalVariable("aYouDidSomethingInGT", "Lnet/minecraft/stats/Achievement;", null, l13, l14, 4);
+ mv.visitMaxs(7, 5);
+ mv.visitEnd();
+
+ didInject = true;
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public class MethodAdaptor extends ClassVisitor {
+
+ public MethodAdaptor(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ if (name.equals("registerAssAchievement")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Found method " + name + ", removing.");
+ methodVisitor = null;
+ mDidRemoveAssLineRecipeAdder = true;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BaseMetaTileEntity.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BaseMetaTileEntity.java
index da5859eb55..61c7394b4a 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BaseMetaTileEntity.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BaseMetaTileEntity.java
@@ -2,6 +2,7 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -9,150 +10,170 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-
-public class ClassTransformer_GT_BaseMetaTileEntity {
-
- //The qualified name of the class we plan to transform.
- //gregtech/common/blocks/GT_Block_Machines
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
-
- public ClassTransformer_GT_BaseMetaTileEntity(byte[] basicClass) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Attempting to make setMetaTileEntity(IMetaTileEntity) safer.");
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Valid patch? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
-
-
- if (reader != null && writer != null) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Attempting Method Injection.");
- injectMethod("setMetaTileEntity");
- }
-
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(String aMethodName) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Injecting "+aMethodName+".");
- if (aMethodName.equals("setMetaTileEntity")) {
-
- mv = getWriter().visitMethod(ACC_PUBLIC, "setMetaTileEntity", "(Lgregtech/api/interfaces/metatileentity/IMetaTileEntity;)V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- Label l1 = new Label();
- Label l2 = new Label();
- mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable");
- mv.visitLabel(l0);
- mv.visitLineNumber(1568, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitTypeInsn(CHECKCAST, "gregtech/api/metatileentity/MetaTileEntity");
- mv.visitFieldInsn(PUTFIELD, "gregtech/api/metatileentity/BaseMetaTileEntity", "mMetaTileEntity", "Lgregtech/api/metatileentity/MetaTileEntity;");
- mv.visitLabel(l1);
- mv.visitLineNumber(1569, l1);
- Label l3 = new Label();
- mv.visitJumpInsn(GOTO, l3);
- mv.visitLabel(l2);
- mv.visitLineNumber(1570, l2);
- mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {"java/lang/Throwable"});
- mv.visitVarInsn(ASTORE, 2);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(1571, l4);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitLdcInsn("[BMTE] Bad Tile Entity set in world, your game would have crashed if not for me!");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(1572, l5);
- mv.visitVarInsn(ALOAD, 1);
- Label l6 = new Label();
- mv.visitJumpInsn(IFNULL, l6);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(1573, l7);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
- mv.visitInsn(DUP);
- mv.visitLdcInsn("Tile was of type: ");
- mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "<init>", "(Ljava/lang/String;)V", false);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEINTERFACE, "gregtech/api/interfaces/metatileentity/IMetaTileEntity", "getInventoryName", "()Ljava/lang/String;", true);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
- mv.visitLabel(l6);
- mv.visitLineNumber(1574, l6);
- mv.visitFrame(F_APPEND,1, new Object[] {"java/lang/Throwable"}, 0, null);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Throwable", "printStackTrace", "()V", false);
- mv.visitLabel(l3);
- mv.visitLineNumber(1576, l3);
- mv.visitFrame(F_CHOP,1, null, 0, null);
- mv.visitInsn(RETURN);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLocalVariable("this", "Lgregtech/api/metatileentity/BaseMetaTileEntity;", null, l0, l8, 0);
- mv.visitLocalVariable("aMetaTileEntity", "Lgregtech/api/interfaces/metatileentity/IMetaTileEntity;", null, l0, l8, 1);
- mv.visitLocalVariable("t", "Ljava/lang/Throwable;", null, l4, l3, 2);
- mv.visitMaxs(4, 3);
- mv.visitEnd();
-
- didInject = true;
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
-
- public final class localClassVisitor extends ClassVisitor {
-
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- if (name.equals("setMetaTileEntity")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Found method "+name+", removing.");
- methodVisitor = null;
- }
- else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- return methodVisitor;
- }
- }
-
+public class ClassTransformer_GT_BaseMetaTileEntity {
+
+ // The qualified name of the class we plan to transform.
+ // gregtech/common/blocks/GT_Block_Machines
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ public ClassTransformer_GT_BaseMetaTileEntity(byte[] basicClass) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech setMetaTileEntity Patch",
+ Level.INFO,
+ "Attempting to make setMetaTileEntity(IMetaTileEntity) safer.");
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter), 0);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Valid patch? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+
+ if (reader != null && writer != null) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Attempting Method Injection.");
+ injectMethod("setMetaTileEntity");
+ }
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ if (aMethodName.equals("setMetaTileEntity")) {
+
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC,
+ "setMetaTileEntity",
+ "(Lgregtech/api/interfaces/metatileentity/IMetaTileEntity;)V",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ Label l1 = new Label();
+ Label l2 = new Label();
+ mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable");
+ mv.visitLabel(l0);
+ mv.visitLineNumber(1568, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitTypeInsn(CHECKCAST, "gregtech/api/metatileentity/MetaTileEntity");
+ mv.visitFieldInsn(
+ PUTFIELD,
+ "gregtech/api/metatileentity/BaseMetaTileEntity",
+ "mMetaTileEntity",
+ "Lgregtech/api/metatileentity/MetaTileEntity;");
+ mv.visitLabel(l1);
+ mv.visitLineNumber(1569, l1);
+ Label l3 = new Label();
+ mv.visitJumpInsn(GOTO, l3);
+ mv.visitLabel(l2);
+ mv.visitLineNumber(1570, l2);
+ mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {"java/lang/Throwable"});
+ mv.visitVarInsn(ASTORE, 2);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(1571, l4);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn("[BMTE] Bad Tile Entity set in world, your game would have crashed if not for me!");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(1572, l5);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNULL, l6);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(1573, l7);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
+ mv.visitInsn(DUP);
+ mv.visitLdcInsn("Tile was of type: ");
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "<init>", "(Ljava/lang/String;)V", false);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "gregtech/api/interfaces/metatileentity/IMetaTileEntity",
+ "getInventoryName",
+ "()Ljava/lang/String;",
+ true);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "java/lang/StringBuilder",
+ "append",
+ "(Ljava/lang/String;)Ljava/lang/StringBuilder;",
+ false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(1574, l6);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"java/lang/Throwable"}, 0, null);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Throwable", "printStackTrace", "()V", false);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(1576, l3);
+ mv.visitFrame(F_CHOP, 1, null, 0, null);
+ mv.visitInsn(RETURN);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLocalVariable("this", "Lgregtech/api/metatileentity/BaseMetaTileEntity;", null, l0, l8, 0);
+ mv.visitLocalVariable(
+ "aMetaTileEntity", "Lgregtech/api/interfaces/metatileentity/IMetaTileEntity;", null, l0, l8, 1);
+ mv.visitLocalVariable("t", "Ljava/lang/Throwable;", null, l4, l3, 2);
+ mv.visitMaxs(4, 3);
+ mv.visitEnd();
+
+ didInject = true;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public final class localClassVisitor extends ClassVisitor {
+
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ if (name.equals("setMetaTileEntity")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech setMetaTileEntity Patch",
+ Level.INFO,
+ "Found method " + name + ", removing.");
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity.java
index dce1fa15d2..7e0306853d 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity.java
@@ -9,13 +9,6 @@ import static org.objectweb.asm.Opcodes.ILOAD;
import static org.objectweb.asm.Opcodes.INVOKESTATIC;
import static org.objectweb.asm.Opcodes.IRETURN;
-import org.apache.logging.log4j.Level;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.Label;
-import org.objectweb.asm.MethodVisitor;
-
import cpw.mods.fml.relauncher.FMLRelaunchLog;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -24,263 +17,296 @@ import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
+import org.apache.logging.log4j.Level;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
-public class ClassTransformer_GT_BlockMachines_MetaPipeEntity {
-
- //The qualified name of the class we plan to transform.
- //gregtech/common/blocks/GT_Block_Machines
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- /**
- * Utility Functions
- */
-
- public static String getHarvestTool(int aMeta) {
- //FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting to call getHarvestTool. Meta: "+aMeta);
- if (aMeta >= 8 && aMeta <= 11) {
- return "cutter";
- }
- return "wrench";
- }
-
- /*
- * Used to patch the method in Fluid pipes, Frame Boxes and Item Pipes
- */
- /**
- * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself.
- * <p/>
- * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantle
- * 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle
- * <p/>
- * 2 = BaseMetaTileEntity, Wrench lvl 2 to dismantle
- * 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle
- * <p/>
- * 4 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle
- * 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle
- * <p/>
- * 6 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle
- * 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle
- * <p/>
- * 8 = BaseMetaPipeEntity, Cutter lvl 0 to dismantle
- * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle
- * <p/>
- * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle
- * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle
- * <p/>
- * == Reserved For Alkalus (Was previously used to allow axes on wooden blocks, but that's fucking stupid.)
- * <p/>
- * 12 = BaseCustomPower_MTE, Wrench lvl 0 to dismantle
- * 13 = BaseCustomTileEntity, Wrench lvl 1 to dismantle
- * <p/>
- * 14 = BaseCustomTileEntity, Wrench lvl 2 to dismantle
- * 15 = BaseCustomTileEntity, Wrench lvl 3 to dismantle
- */
- public static byte getTileEntityBaseType(Materials mMaterial) {
- byte mMetaID;
- //Modified code that should never return 12-15 for Wooden items.
- //mMetaID = (byte) (mMaterial == null ? 4 : (byte) (4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
- //Original Code for debug purposes
- mMetaID = mMaterial == null ? 4 : (byte) ((mMaterial.contains(SubTag.WOOD) ? 4 : 4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
- //FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting to call getTileEntityBaseType. Using Meta: "+mMetaID);
- return mMetaID;
- }
+public class ClassTransformer_GT_BlockMachines_MetaPipeEntity {
+ // The qualified name of the class we plan to transform.
+ // gregtech/common/blocks/GT_Block_Machines
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
- /**
- * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself.
- * <p/>
- * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantle
- * 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle
- * <p/>
- * 2 = BaseMetaTileEntity, Wrench lvl 2 to dismantle
- * 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle
- * <p/>
- * 4 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle
- * 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle
- * <p/>
- * 6 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle
- * 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle
- * <p/>
- * 8 = BaseMetaPipeEntity, Cutter lvl 0 to dismantle
- * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle
- * <p/>
- * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle
- * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle
- * <p/>
- * == Reserved For Alkalus (Was previously used to allow axes on wooden blocks, but that's fucking stupid.)
- * <p/>
- * 12 = BaseCustomPower_MTE, Wrench lvl 2 to dismantle
- * 13 = BaseCustomTileEntity, Wrench lvl 2 to dismantle
- * <p/>
- * 14 = BaseCustomTileEntity, Wrench lvl 3 to dismantle
- * 15 = BaseCustomTileEntity, Wrench lvl 3 to dismantle
- */
- public static TileEntity createTileEntity(World aWorld, int aMeta) {
- //Logger.INFO("Creating Tile Entity with Meta of "+aMeta);
- if (aMeta < 4) {
- return GregTech_API.constructBaseMetaTileEntity();
- } else if (aMeta < 12) {
- return new BaseMetaPipeEntity();
- } else {
- //Because Wooden pipes/frames may exist in world, we try cast to the GT++ tile first, if tht fails, we cast a pipe..
- try {
- return Meta_GT_Proxy.constructCustomGregtechMetaTileEntityByMeta(aMeta);
- }
- catch (Throwable c) {
- //Returns a pipe entity, once this returns, it should correct itself and no longer error in future.
- return new BaseMetaPipeEntity();
- }
- }
- }
-
- public static TileEntity createTileEntity_Original(World aWorld, int aMeta) {
- // Logger.INFO("Creating Tile Entity with Meta of "+aMeta);
- if (aMeta < 4) {
- return GregTech_API.constructBaseMetaTileEntity();
- } else {
- return new BaseMetaPipeEntity();
- }
- }
+ /**
+ * Utility Functions
+ */
+ public static String getHarvestTool(int aMeta) {
+ // FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting to call
+ // getHarvestTool. Meta: "+aMeta);
+ if (aMeta >= 8 && aMeta <= 11) {
+ return "cutter";
+ }
+ return "wrench";
+ }
- int mMode;
+ /*
+ * Used to patch the method in Fluid pipes, Frame Boxes and Item Pipes
+ */
+ /**
+ * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself.
+ * <p/>
+ * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantle
+ * 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle
+ * <p/>
+ * 2 = BaseMetaTileEntity, Wrench lvl 2 to dismantle
+ * 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle
+ * <p/>
+ * 4 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle
+ * 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle
+ * <p/>
+ * 6 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle
+ * 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle
+ * <p/>
+ * 8 = BaseMetaPipeEntity, Cutter lvl 0 to dismantle
+ * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle
+ * <p/>
+ * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle
+ * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle
+ * <p/>
+ * == Reserved For Alkalus (Was previously used to allow axes on wooden blocks, but that's fucking stupid.)
+ * <p/>
+ * 12 = BaseCustomPower_MTE, Wrench lvl 0 to dismantle
+ * 13 = BaseCustomTileEntity, Wrench lvl 1 to dismantle
+ * <p/>
+ * 14 = BaseCustomTileEntity, Wrench lvl 2 to dismantle
+ * 15 = BaseCustomTileEntity, Wrench lvl 3 to dismantle
+ */
+ public static byte getTileEntityBaseType(Materials mMaterial) {
+ byte mMetaID;
+ // Modified code that should never return 12-15 for Wooden items.
+ // mMetaID = (byte) (mMaterial == null ? 4 : (byte) (4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
+ // Original Code for debug purposes
+ mMetaID = mMaterial == null
+ ? 4
+ : (byte) ((mMaterial.contains(SubTag.WOOD) ? 4 : 4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
+ // FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting to call
+ // getTileEntityBaseType. Using Meta: "+mMetaID);
+ return mMetaID;
+ }
- public ClassTransformer_GT_BlockMachines_MetaPipeEntity(byte[] basicClass, int aMode) {
- mMode = aMode;
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
+ /**
+ * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself.
+ * <p/>
+ * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantle
+ * 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle
+ * <p/>
+ * 2 = BaseMetaTileEntity, Wrench lvl 2 to dismantle
+ * 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle
+ * <p/>
+ * 4 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle
+ * 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle
+ * <p/>
+ * 6 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle
+ * 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle
+ * <p/>
+ * 8 = BaseMetaPipeEntity, Cutter lvl 0 to dismantle
+ * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle
+ * <p/>
+ * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle
+ * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle
+ * <p/>
+ * == Reserved For Alkalus (Was previously used to allow axes on wooden blocks, but that's fucking stupid.)
+ * <p/>
+ * 12 = BaseCustomPower_MTE, Wrench lvl 2 to dismantle
+ * 13 = BaseCustomTileEntity, Wrench lvl 2 to dismantle
+ * <p/>
+ * 14 = BaseCustomTileEntity, Wrench lvl 3 to dismantle
+ * 15 = BaseCustomTileEntity, Wrench lvl 3 to dismantle
+ */
+ public static TileEntity createTileEntity(World aWorld, int aMeta) {
+ // Logger.INFO("Creating Tile Entity with Meta of "+aMeta);
+ if (aMeta < 4) {
+ return GregTech_API.constructBaseMetaTileEntity();
+ } else if (aMeta < 12) {
+ return new BaseMetaPipeEntity();
+ } else {
+ // Because Wooden pipes/frames may exist in world, we try cast to the GT++ tile first, if tht fails, we cast
+ // a pipe..
+ try {
+ return Meta_GT_Proxy.constructCustomGregtechMetaTileEntityByMeta(aMeta);
+ } catch (Throwable c) {
+ // Returns a pipe entity, once this returns, it should correct itself and no longer error in future.
+ return new BaseMetaPipeEntity();
+ }
+ }
+ }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting to patch in mode "+aMode+".");
+ public static TileEntity createTileEntity_Original(World aWorld, int aMeta) {
+ // Logger.INFO("Creating Tile Entity with Meta of "+aMeta);
+ if (aMeta < 4) {
+ return GregTech_API.constructBaseMetaTileEntity();
+ } else {
+ return new BaseMetaPipeEntity();
+ }
+ }
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter, mMode), 0);
+ int mMode;
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Valid patch? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
+ public ClassTransformer_GT_BlockMachines_MetaPipeEntity(byte[] basicClass, int aMode) {
+ mMode = aMode;
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech getTileEntityBaseType Patch",
+ Level.INFO,
+ "Attempting to patch in mode " + aMode + ".");
- if (reader != null && writer != null) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting Method Injection.");
- if (aMode == 0) {
- injectMethod("getHarvestTool");
- injectMethod("createTileEntity");
- }
- else {
- injectMethod("getTileEntityBaseType");
- }
- }
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter, mMode), 0);
- }
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Valid patch? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
- public boolean isValidTransformer() {
- return isValid;
- }
+ if (reader != null && writer != null) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Attempting Method Injection.");
+ if (aMode == 0) {
+ injectMethod("getHarvestTool");
+ injectMethod("createTileEntity");
+ } else {
+ injectMethod("getTileEntityBaseType");
+ }
+ }
+ }
- public ClassReader getReader() {
- return reader;
- }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- public ClassWriter getWriter() {
- return writer;
- }
+ public ClassReader getReader() {
+ return reader;
+ }
- public boolean injectMethod(String aMethodName) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Injecting "+aMethodName+".");
- if (aMethodName.equals("getHarvestTool")) {
- mv = getWriter().visitMethod(ACC_PUBLIC, "getHarvestTool", "(I)Ljava/lang/String;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(63, l0);
- mv.visitVarInsn(ILOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity", "getHarvestTool", "(I)Ljava/lang/String;", false);
- mv.visitInsn(ARETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l1, 0);
- mv.visitLocalVariable("aMeta", "I", null, l0, l1, 1);
- mv.visitMaxs(1, 2);
- mv.visitEnd();
- didInject = true;
- }
- else if (aMethodName.equals("createTileEntity")) {
- mv = getWriter().visitMethod(ACC_PUBLIC, "createTileEntity", "(Lnet/minecraft/world/World;I)Lnet/minecraft/tileentity/TileEntity;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(442, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity", "createTileEntity", "(Lnet/minecraft/world/World;I)Lnet/minecraft/tileentity/TileEntity;", false);
- mv.visitInsn(ARETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l1, 0);
- mv.visitLocalVariable("aWorld", "Lnet/minecraft/world/World;", null, l0, l1, 1);
- mv.visitLocalVariable("aMeta", "I", null, l0, l1, 2);
- mv.visitMaxs(2, 3);
- mv.visitEnd();
- didInject = true;
+ public ClassWriter getWriter() {
+ return writer;
+ }
- }
- else if (aMethodName.equals("getTileEntityBaseType")) {
+ public boolean injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ if (aMethodName.equals("getHarvestTool")) {
+ mv = getWriter().visitMethod(ACC_PUBLIC, "getHarvestTool", "(I)Ljava/lang/String;", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(63, l0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity",
+ "getHarvestTool",
+ "(I)Ljava/lang/String;",
+ false);
+ mv.visitInsn(ARETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l1, 0);
+ mv.visitLocalVariable("aMeta", "I", null, l0, l1, 1);
+ mv.visitMaxs(1, 2);
+ mv.visitEnd();
+ didInject = true;
+ } else if (aMethodName.equals("createTileEntity")) {
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC,
+ "createTileEntity",
+ "(Lnet/minecraft/world/World;I)Lnet/minecraft/tileentity/TileEntity;",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(442, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity",
+ "createTileEntity",
+ "(Lnet/minecraft/world/World;I)Lnet/minecraft/tileentity/TileEntity;",
+ false);
+ mv.visitInsn(ARETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l1, 0);
+ mv.visitLocalVariable("aWorld", "Lnet/minecraft/world/World;", null, l0, l1, 1);
+ mv.visitLocalVariable("aMeta", "I", null, l0, l1, 2);
+ mv.visitMaxs(2, 3);
+ mv.visitEnd();
+ didInject = true;
- String aClassName = mMode == 1 ? "gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item" : mMode == 2 ? "gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame" : "gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid";
- mv = getWriter().visitMethod(ACC_PUBLIC, "getTileEntityBaseType", "()B", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(37, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, ""+aClassName+"", "mMaterial", "Lgregtech/api/enums/Materials;");
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity", "getTileEntityBaseType", "(Lgregtech/api/enums/Materials;)B", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", "L"+aClassName+";", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
+ } else if (aMethodName.equals("getTileEntityBaseType")) {
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
+ String aClassName = mMode == 1
+ ? "gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item"
+ : mMode == 2
+ ? "gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame"
+ : "gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid";
+ mv = getWriter().visitMethod(ACC_PUBLIC, "getTileEntityBaseType", "()B", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(37, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "" + aClassName + "", "mMaterial", "Lgregtech/api/enums/Materials;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_MetaPipeEntity",
+ "getTileEntityBaseType",
+ "(Lgregtech/api/enums/Materials;)B",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("this", "L" + aClassName + ";", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
- public final class localClassVisitor extends ClassVisitor {
+ public final class localClassVisitor extends ClassVisitor {
- private final int mMode;
-
- public localClassVisitor(ClassVisitor cv, int aMode) {
- super(ASM5, cv);
- mMode = aMode;
- }
+ private final int mMode;
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- if ((mMode == 0 && (name.equals("createTileEntity") || name.equals("getHarvestTool"))) || (mMode > 0 && name.equals("getTileEntityBaseType"))) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech getTileEntityBaseType Patch", Level.INFO, "Found method "+name+", removing.");
- methodVisitor = null;
- }
- else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- return methodVisitor;
- }
- }
+ public localClassVisitor(ClassVisitor cv, int aMode) {
+ super(ASM5, cv);
+ mMode = aMode;
+ }
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ if ((mMode == 0 && (name.equals("createTileEntity") || name.equals("getHarvestTool")))
+ || (mMode > 0 && name.equals("getTileEntityBaseType"))) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech getTileEntityBaseType Patch",
+ Level.INFO,
+ "Found method " + name + ", removing.");
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_NBT.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_NBT.java
index 349bdc3e88..744af6674a 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_NBT.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_BlockMachines_NBT.java
@@ -2,7 +2,10 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import java.io.IOException;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.preloader.DevHelper;
+import gtPlusPlus.preloader.asm.AsmConfig;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -10,184 +13,206 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.preloader.DevHelper;
-import gtPlusPlus.preloader.asm.AsmConfig;
-
-public class ClassTransformer_GT_BlockMachines_NBT {
-
- //The qualified name of the class we plan to transform.
- private static final String className = "gregtech.common.blocks.GT_Block_Machines";
- //gregtech/common/blocks/GT_Block_Machines
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- String aEntityPlayer;
- String aEntityPlayerMP;
- String aWorld;
-
- public static boolean isNbtPersistencyPatchAlreadyApplied = false;
-
- public ClassTransformer_GT_BlockMachines_NBT(byte[] basicClass, boolean obfuscated) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Attempting to patch "+className+".");
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Valid patch? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
-
- CORE.NBT_PERSISTENCY_PATCH_APPLIED = isNbtPersistencyPatchAlreadyApplied;
-
- if (reader != null && writer != null && !isNbtPersistencyPatchAlreadyApplied && AsmConfig.enableGtNbtFix) {
- aEntityPlayer = obfuscated ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayer") : "net/minecraft/entity/player/EntityPlayer";
- aEntityPlayerMP = obfuscated ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayerMP") : "net/minecraft/entity/player/EntityPlayerMP";
- aWorld = obfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
- FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Attempting Method Injection.");
- if (injectMethod("removedByPlayer") && injectMethod("harvestBlock")) {
- CORE.NBT_PERSISTENCY_PATCH_APPLIED = true;
- }
- }
-
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(String aMethodName) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Injecting "+aMethodName+" into "+className+".");
- if (aMethodName.equals("removedByPlayer")) {
-
- mv = getWriter().visitMethod(ACC_PUBLIC, "removedByPlayer", "(L"+aWorld+";L"+aEntityPlayer+";IIIZ)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(535, l0);
- mv.visitVarInsn(ILOAD, 6);
- Label l1 = new Label();
- mv.visitJumpInsn(IFEQ, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(536, l2);
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l1);
- mv.visitLineNumber(538, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKESPECIAL, "gregtech/api/items/GT_Generic_Block", "removedByPlayer", "(L"+aWorld+";L"+aEntityPlayer+";IIIZ)Z", false);
- mv.visitInsn(IRETURN);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l3, 0);
- mv.visitLocalVariable("aWorld", "L"+aWorld+";", null, l0, l3, 1);
- mv.visitLocalVariable("aPlayer", "L"+aEntityPlayer+";", null, l0, l3, 2);
- mv.visitLocalVariable("aX", "I", null, l0, l3, 3);
- mv.visitLocalVariable("aY", "I", null, l0, l3, 4);
- mv.visitLocalVariable("aZ", "I", null, l0, l3, 5);
- mv.visitLocalVariable("aWillHarvest", "Z", null, l0, l3, 6);
- mv.visitMaxs(7, 7);
- mv.visitEnd();
- didInject = true;
-
- }
- else if (aMethodName.equals("harvestBlock")) {
-
- mv = getWriter().visitMethod(ACC_PUBLIC, "harvestBlock", "(L"+aWorld+";L"+aEntityPlayer+";IIII)V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(544, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitVarInsn(ILOAD, 6);
- mv.visitMethodInsn(INVOKESPECIAL, "gregtech/api/items/GT_Generic_Block", "harvestBlock", "(L"+aWorld+";L"+aEntityPlayer+";IIII)V", false);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(545, l1);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aWorld+"", "setBlockToAir", "(III)Z", false);
- mv.visitInsn(POP);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(546, l2);
- mv.visitInsn(RETURN);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l3, 0);
- mv.visitLocalVariable("aWorld", "L"+aWorld+";", null, l0, l3, 1);
- mv.visitLocalVariable("aPlayer", "L"+aEntityPlayer+";", null, l0, l3, 2);
- mv.visitLocalVariable("aX", "I", null, l0, l3, 3);
- mv.visitLocalVariable("aY", "I", null, l0, l3, 4);
- mv.visitLocalVariable("aZ", "I", null, l0, l3, 5);
- mv.visitLocalVariable("aMeta", "I", null, l0, l3, 6);
- mv.visitMaxs(7, 7);
- mv.visitEnd();
- didInject = true;
-
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
-
- public static final class localClassVisitor extends ClassVisitor {
-
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- if (name.equals("removedByPlayer")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Found method "+name+", skipping patch.");
- isNbtPersistencyPatchAlreadyApplied = true;
- }
- if (name.equals("harvestBlock")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Found method "+name+", skipping patch.");
- isNbtPersistencyPatchAlreadyApplied = true;
- }
- MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- return methodVisitor;
- }
- }
-
+public class ClassTransformer_GT_BlockMachines_NBT {
+
+ // The qualified name of the class we plan to transform.
+ private static final String className = "gregtech.common.blocks.GT_Block_Machines";
+ // gregtech/common/blocks/GT_Block_Machines
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ String aEntityPlayer;
+ String aEntityPlayerMP;
+ String aWorld;
+
+ public static boolean isNbtPersistencyPatchAlreadyApplied = false;
+
+ public ClassTransformer_GT_BlockMachines_NBT(byte[] basicClass, boolean obfuscated) {
+
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Attempting to patch " + className + ".");
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter), 0);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Valid patch? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+
+ CORE.NBT_PERSISTENCY_PATCH_APPLIED = isNbtPersistencyPatchAlreadyApplied;
+
+ if (reader != null && writer != null && !isNbtPersistencyPatchAlreadyApplied && AsmConfig.enableGtNbtFix) {
+ aEntityPlayer = obfuscated
+ ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayer")
+ : "net/minecraft/entity/player/EntityPlayer";
+ aEntityPlayerMP = obfuscated
+ ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayerMP")
+ : "net/minecraft/entity/player/EntityPlayerMP";
+ aWorld = obfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Attempting Method Injection.");
+ if (injectMethod("removedByPlayer") && injectMethod("harvestBlock")) {
+ CORE.NBT_PERSISTENCY_PATCH_APPLIED = true;
+ }
+ }
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech NBT Persistency Patch",
+ Level.INFO,
+ "Injecting " + aMethodName + " into " + className + ".");
+ if (aMethodName.equals("removedByPlayer")) {
+
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC,
+ "removedByPlayer",
+ "(L" + aWorld + ";L" + aEntityPlayer + ";IIIZ)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(535, l0);
+ mv.visitVarInsn(ILOAD, 6);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFEQ, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(536, l2);
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(538, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "gregtech/api/items/GT_Generic_Block",
+ "removedByPlayer",
+ "(L" + aWorld + ";L" + aEntityPlayer + ";IIIZ)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l3, 0);
+ mv.visitLocalVariable("aWorld", "L" + aWorld + ";", null, l0, l3, 1);
+ mv.visitLocalVariable("aPlayer", "L" + aEntityPlayer + ";", null, l0, l3, 2);
+ mv.visitLocalVariable("aX", "I", null, l0, l3, 3);
+ mv.visitLocalVariable("aY", "I", null, l0, l3, 4);
+ mv.visitLocalVariable("aZ", "I", null, l0, l3, 5);
+ mv.visitLocalVariable("aWillHarvest", "Z", null, l0, l3, 6);
+ mv.visitMaxs(7, 7);
+ mv.visitEnd();
+ didInject = true;
+
+ } else if (aMethodName.equals("harvestBlock")) {
+
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC, "harvestBlock", "(L" + aWorld + ";L" + aEntityPlayer + ";IIII)V", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(544, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitVarInsn(ILOAD, 6);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "gregtech/api/items/GT_Generic_Block",
+ "harvestBlock",
+ "(L" + aWorld + ";L" + aEntityPlayer + ";IIII)V",
+ false);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(545, l1);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aWorld + "", "setBlockToAir", "(III)Z", false);
+ mv.visitInsn(POP);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(546, l2);
+ mv.visitInsn(RETURN);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Block_Machines;", null, l0, l3, 0);
+ mv.visitLocalVariable("aWorld", "L" + aWorld + ";", null, l0, l3, 1);
+ mv.visitLocalVariable("aPlayer", "L" + aEntityPlayer + ";", null, l0, l3, 2);
+ mv.visitLocalVariable("aX", "I", null, l0, l3, 3);
+ mv.visitLocalVariable("aY", "I", null, l0, l3, 4);
+ mv.visitLocalVariable("aZ", "I", null, l0, l3, 5);
+ mv.visitLocalVariable("aMeta", "I", null, l0, l3, 6);
+ mv.visitMaxs(7, 7);
+ mv.visitEnd();
+ didInject = true;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech NBT Persistency Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public static final class localClassVisitor extends ClassVisitor {
+
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ if (name.equals("removedByPlayer")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech NBT Persistency Patch",
+ Level.INFO,
+ "Found method " + name + ", skipping patch.");
+ isNbtPersistencyPatchAlreadyApplied = true;
+ }
+ if (name.equals("harvestBlock")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech NBT Persistency Patch",
+ Level.INFO,
+ "Found method " + name + ", skipping patch.");
+ isNbtPersistencyPatchAlreadyApplied = true;
+ }
+ MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java
index 1e54bd3632..7fb2347d1e 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java
@@ -2,183 +2,200 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import java.util.ArrayList;
-
-import org.apache.logging.log4j.Level;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.Label;
-import org.objectweb.asm.MethodVisitor;
-
import cpw.mods.fml.relauncher.FMLRelaunchLog;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
+import org.apache.logging.log4j.Level;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
public class ClassTransformer_GT_CharcoalPit {
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- public static boolean isWoodLog(Block log) {
- return isWoodLog(log, Short.MAX_VALUE);
- }
-
- public static boolean isWoodLog(Block log, int meta) {
- ItemStack aLogStack = ItemUtils.getSimpleStack(log, meta, 1);
- ArrayList<ItemStack> aData = OrePrefixes.log.mPrefixedItems;
- for (ItemStack aStack : aData) {
- if (GT_Utility.areStacksEqual(aStack, aLogStack)) {
- return true;
- }
- }
- aData.clear();
- aData = OreDictionary.getOres("logWood");
- for (ItemStack aStack : aData) {
- if (GT_Utility.areStacksEqual(aStack, aLogStack)) {
- return true;
- }
- }
- return false;
- }
-
- public ClassTransformer_GT_CharcoalPit(byte[] basicClass, boolean obfuscated) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
- boolean aBadTime = false;
- if (ReflectionUtils.doesClassExist("aji")) {
- obfuscated = true;
- }
- else {
- if (ReflectionUtils.doesClassExist("net.minecraft.block.Block")) {
- obfuscated = false;
- }
- else {
- // Bad... Like.. very bad..
- FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Unable to find Block.class/aji.class, this is BAD. Not Patching.");
- }
- }
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- if (!aBadTime) {
- aTempReader.accept(new CustomClassVisitor(aTempWriter), 0);
- injectMethod("isWoodLog", obfuscated, aTempWriter);
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- } else {
- isValid = false;
- }
- }
- else {
- isValid = false;
- }
- FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Valid? " + isValid + ".");
- reader = aTempReader;
- writer = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(String aMethodName, boolean obfuscated, ClassWriter cw) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Injecting " + aMethodName + ".");
-
- String aBlockClassName = "net/minecraft/block/Block";
- if (obfuscated) {
- aBlockClassName = "aji";
- }
- if (aMethodName.equals("isWoodLog")) {
-
- // Inject original Method with only block arg.
- mv = cw.visitMethod(ACC_PUBLIC, "isWoodLog", "(L"+aBlockClassName+";)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(197, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit", "isWoodLog", "(L"+aBlockClassName+";)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", "Lgregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit;", null, l0, l1, 0);
- mv.visitLocalVariable("log", "L"+aBlockClassName+";", null, l0, l1, 1);
- mv.visitMaxs(1, 2);
- mv.visitEnd();
-
-
- // Inject better Method with block & meta arg.
- mv = cw.visitMethod(ACC_PUBLIC, "isWoodLog", "(L"+aBlockClassName+";I)Z", null, null);
- mv.visitCode();
- Label label0 = new Label();
- mv.visitLabel(label0);
- mv.visitLineNumber(201, label0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit", "isWoodLog", "(L"+aBlockClassName+";I)Z", false);
- mv.visitInsn(IRETURN);
- Label label1 = new Label();
- mv.visitLabel(label1);
- mv.visitLocalVariable("this", "Lgregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit;", null, label0, label1, 0);
- mv.visitLocalVariable("log", "L"+aBlockClassName+";", null, label0, label1, 1);
- mv.visitLocalVariable("meta", "I", null, label0, label1, 2);
- mv.visitMaxs(2, 3);
- mv.visitEnd();
-
- didInject = true;
-
- }
- FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Method injection complete.");
- return didInject;
- }
-
- public class CustomClassVisitor extends ClassVisitor {
-
- public CustomClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
-
- private final String[] aMethodsToStrip = new String[] { "isWoodLog" };
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- boolean found = false;
-
- for (String s : aMethodsToStrip) {
- if (name.equals(s)) {
- found = true;
- break;
- }
- }
- if (!found) {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- } else {
- methodVisitor = null;
- }
- if (found) {
- FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Found method " + name + ", removing.");
- }
- return methodVisitor;
- }
-
- }
-
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ public static boolean isWoodLog(Block log) {
+ return isWoodLog(log, Short.MAX_VALUE);
+ }
+
+ public static boolean isWoodLog(Block log, int meta) {
+ ItemStack aLogStack = ItemUtils.getSimpleStack(log, meta, 1);
+ ArrayList<ItemStack> aData = OrePrefixes.log.mPrefixedItems;
+ for (ItemStack aStack : aData) {
+ if (GT_Utility.areStacksEqual(aStack, aLogStack)) {
+ return true;
+ }
+ }
+ aData.clear();
+ aData = OreDictionary.getOres("logWood");
+ for (ItemStack aStack : aData) {
+ if (GT_Utility.areStacksEqual(aStack, aLogStack)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public ClassTransformer_GT_CharcoalPit(byte[] basicClass, boolean obfuscated) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ boolean aBadTime = false;
+ if (ReflectionUtils.doesClassExist("aji")) {
+ obfuscated = true;
+ } else {
+ if (ReflectionUtils.doesClassExist("net.minecraft.block.Block")) {
+ obfuscated = false;
+ } else {
+ // Bad... Like.. very bad..
+ FMLRelaunchLog.log(
+ "[GT++ ASM] GT Charcoal Pit Fix",
+ Level.INFO,
+ "Unable to find Block.class/aji.class, this is BAD. Not Patching.");
+ }
+ }
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ if (!aBadTime) {
+ aTempReader.accept(new CustomClassVisitor(aTempWriter), 0);
+ injectMethod("isWoodLog", obfuscated, aTempWriter);
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ } else {
+ isValid = false;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean injectMethod(String aMethodName, boolean obfuscated, ClassWriter cw) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Injecting " + aMethodName + ".");
+
+ String aBlockClassName = "net/minecraft/block/Block";
+ if (obfuscated) {
+ aBlockClassName = "aji";
+ }
+ if (aMethodName.equals("isWoodLog")) {
+
+ // Inject original Method with only block arg.
+ mv = cw.visitMethod(ACC_PUBLIC, "isWoodLog", "(L" + aBlockClassName + ";)Z", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(197, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit",
+ "isWoodLog",
+ "(L" + aBlockClassName + ";)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable(
+ "this",
+ "Lgregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit;",
+ null,
+ l0,
+ l1,
+ 0);
+ mv.visitLocalVariable("log", "L" + aBlockClassName + ";", null, l0, l1, 1);
+ mv.visitMaxs(1, 2);
+ mv.visitEnd();
+
+ // Inject better Method with block & meta arg.
+ mv = cw.visitMethod(ACC_PUBLIC, "isWoodLog", "(L" + aBlockClassName + ";I)Z", null, null);
+ mv.visitCode();
+ Label label0 = new Label();
+ mv.visitLabel(label0);
+ mv.visitLineNumber(201, label0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit",
+ "isWoodLog",
+ "(L" + aBlockClassName + ";I)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label label1 = new Label();
+ mv.visitLabel(label1);
+ mv.visitLocalVariable(
+ "this",
+ "Lgregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit;",
+ null,
+ label0,
+ label1,
+ 0);
+ mv.visitLocalVariable("log", "L" + aBlockClassName + ";", null, label0, label1, 1);
+ mv.visitLocalVariable("meta", "I", null, label0, label1, 2);
+ mv.visitMaxs(2, 3);
+ mv.visitEnd();
+
+ didInject = true;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public class CustomClassVisitor extends ClassVisitor {
+
+ public CustomClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+
+ private final String[] aMethodsToStrip = new String[] {"isWoodLog"};
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ boolean found = false;
+
+ for (String s : aMethodsToStrip) {
+ if (name.equals(s)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ } else {
+ methodVisitor = null;
+ }
+ if (found) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client.java
index 25ec9a8338..69dfc61e9a 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client.java
@@ -7,6 +7,23 @@ import static org.objectweb.asm.Opcodes.INVOKESPECIAL;
import static org.objectweb.asm.Opcodes.INVOKESTATIC;
import static org.objectweb.asm.Opcodes.RETURN;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+import com.google.common.reflect.ClassPath;
+import com.google.common.reflect.ClassPath.ClassInfo;
+import cpw.mods.fml.common.gameevent.TickEvent.Phase;
+import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gregtech.api.GregTech_API;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_PlayedSound;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.gregtech.common.StaticFields59;
+import gtPlusPlus.xmod.gregtech.loaders.misc.AssLineAchievements;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -22,7 +39,10 @@ import java.util.Set;
import java.util.UUID;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
-
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.stats.StatFileWriter;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.ClassReader;
@@ -31,381 +51,367 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-import com.google.common.reflect.ClassPath;
-import com.google.common.reflect.ClassPath.ClassInfo;
-
-import cpw.mods.fml.common.gameevent.TickEvent.Phase;
-import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gregtech.api.GregTech_API;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_PlayedSound;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.xmod.gregtech.common.StaticFields59;
-import gtPlusPlus.xmod.gregtech.loaders.misc.AssLineAchievements;
-import net.minecraft.client.Minecraft;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.stats.StatFileWriter;
-
-public class ClassTransformer_GT_Client {
-
- private final boolean valid;
- private final ClassReader read;
- private final ClassWriter write;
- private boolean mModern = true;
- private boolean mObfuscated = true;
- private byte[] mTooledClass;
-
- public ClassTransformer_GT_Client(byte[] basicClass, boolean obfuscated) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- mObfuscated = obfuscated;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
-
- /**
- * Let's just read the GT archive for some info
- */
- //mModern = findAssemblyLineClass();
- //FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Found Assembly Line? "+mModern+".");
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Fixing Issues in vanilla GT.");
- if (mModern) {
- aTempReader.accept(new MethodAdaptor2(aTempWriter), 0);
- //FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Patching Client handling of Assembly Line recipe visibility for GT 5.09");
- //injectMethod(aTempWriter, "onPlayerTickEventClient");
- injectMethod(aTempWriter, "onPostLoad");
- if (aTempReader != null && aTempWriter != null) {
- valid = true;
- mTooledClass = aTempWriter.toByteArray();
- }
- else {
- valid = false;
- }
- }
- else {
- mTooledClass = basicClass;
- valid = true;
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Valid? "+valid+".");
- read = aTempReader;
- write = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return valid;
- }
-
- public ClassReader getReader() {
- return read;
- }
-
- public ClassWriter getWriter() {
- return write;
- }
-
- public boolean findAssemblyLineClass() {
- ClassLoader cl = getClass().getClassLoader();
- try {
- Set<ClassPath.ClassInfo> classesInPackage = ClassPath.from(cl).getTopLevelClassesRecursive("gregtech");
- if (classesInPackage != null && classesInPackage.size() > 0) {
- for (ClassInfo x : classesInPackage) {
- if (x.getResourceName().contains("GT_MetaTileEntity_AssemblyLine")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO,
- "Patchable class | " + x.getResourceName());
- return true;
- }
- }
- }
- } catch (IOException e) {
- }
-
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Failed to find Gregtech classes using prefered method, using backup.");
-
- cl = ClassLoader.getSystemClassLoader();
- ImmutableMap<File, ClassLoader> g = getClassPathEntries(cl);
- File aGregtech = null;
- if (g.size() > 0) {
- for (int i = 0; i < g.size(); i++) {
- String aName;
- try {
- File aF = g.keySet().asList().get(i);
- aName = aF.getName();
- if (aName != null && aName.length() > 0) {
- if (aName.toLowerCase().contains("gregtech")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Patchable class | "+aName);
- aGregtech = aF;
- }
- }
- }
- catch (Throwable t) {}
- }
- }
-
- if (aGregtech != null) {
- File file = aGregtech;
- FileInputStream fis;
- JarInputStream jis;
- try {
- fis = new FileInputStream(file);
- jis = new JarInputStream(fis);
- System.out.println(jis.markSupported());
- JarEntry je;
- while((je=jis.getNextJarEntry())!=null){
- if (je.getName().contains("GT_MetaTileEntity_AssemblyLine")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Patchable class | "+je.getName());
- jis.close();
- return true;
- }
- }
- if (jis != null) {
- jis.close();
- }
- return true;
- } catch (IOException e1) {
- }
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Failed to find Gregtech classes using backup method, probably using GT 5.08");
-
- return false;
- }
-
- static ImmutableMap<File, ClassLoader> getClassPathEntries(ClassLoader classloader) {
- LinkedHashMap<File, ClassLoader> entries = Maps.newLinkedHashMap();
- // Search parent first, since it's the order ClassLoader#loadClass() uses.
- ClassLoader parent = classloader.getParent();
- if (parent != null) {
- entries.putAll(getClassPathEntries(parent));
- }
- if (classloader instanceof URLClassLoader) {
- URLClassLoader urlClassLoader = (URLClassLoader) classloader;
- for (URL entry : urlClassLoader.getURLs()) {
- if (entry.getProtocol().equals("file")) {
- File file = new File(entry.getFile());
- if (!entries.containsKey(file)) {
- entries.put(file, classloader);
- }
- }
- }
- }
- return ImmutableMap.copyOf(entries);
- }
-
- public boolean injectMethod(ClassWriter cw, String string) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Injecting " + string + ". Obfuscated? "+mObfuscated);
-
- if (string.equals("onPlayerTickEventClient")) {
- /**
- * Inject new, safer code
- */
- AnnotationVisitor av0;
- /**
- * Static invocation of custom handler instead
- */
- mv = cw.visitMethod(ACC_PUBLIC, "onPlayerTickEventClient", "(Lcpw/mods/fml/common/gameevent/TickEvent$PlayerTickEvent;)V", null, null);
- av0 = mv.visitAnnotation("Lcpw/mods/fml/common/eventhandler/SubscribeEvent;", true);
- av0.visitEnd();
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(371, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client", "onPlayerTickEventClient", "(Lcpw/mods/fml/common/gameevent/TickEvent$PlayerTickEvent;)V", false);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(372, l1);
- mv.visitInsn(RETURN);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLocalVariable("this", "Lgregtech/common/GT_Client;", null, l0, l2, 0);
- mv.visitLocalVariable("aEvent", "Lcpw/mods/fml/common/gameevent/TickEvent$PlayerTickEvent;", null, l0, l2, 1);
- mv.visitMaxs(1, 2);
- mv.visitEnd();
- didInject = true;
- }
- else if (string.equals("onPostLoad")) {
- mv = cw.visitMethod(ACC_PUBLIC, "onPostLoad", "()V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(315, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESPECIAL, "gregtech/common/GT_Proxy", "onPostLoad", "()V", false);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(316, l1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client", "onPostLoad", "()V", false);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(317, l2);
- mv.visitInsn(RETURN);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLocalVariable("this", "Lgregtech/common/GT_Client;", null, l0, l3, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
-
-
-
-
-
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Method injection complete.");
- return didInject;
-
- }
-
- public class MethodAdaptor2 extends ClassVisitor {
-
- public MethodAdaptor2(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- if (/*name.equals("onPlayerTickEventClient") || */name.equals("onPostLoad")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO,
- "Found method " + name + ", removing.");
- methodVisitor = null;
- }
- else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- return methodVisitor;
- }
- }
-
- public byte[] getByteArray() {
- if (mTooledClass != null) {
- return mTooledClass;
- }
- return getWriter().toByteArray();
- }
-
-
- private static final Map<UUID, Long> aTimeMap = new HashMap<UUID, Long>();
-
-
- public static void onPlayerTickEventClient(PlayerTickEvent aEvent) {
- if (aEvent.side.isClient() && aEvent.phase == Phase.END && !aEvent.player.isDead) {
- long aTime = 0;
- if (aTimeMap.get(aEvent.player.getUniqueID()) == null) {
- aTimeMap.put(aEvent.player.getUniqueID(), 0l);
- }
- else {
- aTime = aTimeMap.get(aEvent.player.getUniqueID()) + 1;
- aTimeMap.put(aEvent.player.getUniqueID(), aTime);
- }
- if (aTime >= 100L) {
- aTimeMap.put(aEvent.player.getUniqueID(), 0l);
- /**
- * Remove original handling
- */
- if (StaticFields59.mAssLineVisualMapNEI != null) {
- StatFileWriter tList = Minecraft.getMinecraft().thePlayer.getStatFileWriter();
- GT_Recipe_Map aAssLineNei;
- try {
- aAssLineNei = (GT_Recipe_Map) StaticFields59.mAssLineVisualMapNEI.get(null);
- for (GT_Recipe aFakeAssLineRecipe : aAssLineNei.mRecipeList) {
- String aSafeUnlocalName;
- if (aFakeAssLineRecipe.getOutput(0) == null) {
- Logger.INFO(
- "Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
- continue;
- }
- ItemStack aStack = aFakeAssLineRecipe.getOutput(0);
- try {
- aSafeUnlocalName = aStack.getUnlocalizedName();
- } catch (Throwable t) {
- aSafeUnlocalName = ItemUtils.getUnlocalizedItemName(aStack);
- }
- boolean aHidden = true;
- try {
- aHidden = tList.hasAchievementUnlocked(AssLineAchievements.getAchievement(aSafeUnlocalName));
- Logger.INFO("Found achievement for "+aSafeUnlocalName);
- }
- catch (NullPointerException rrr) {
- aHidden = true;
- //Logger.INFO("Exception handling achievement for "+aSafeUnlocalName);
- //rrr.printStackTrace();
- }
- aFakeAssLineRecipe.mHidden = !aHidden;
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- }
-
- Iterator tKey;
- ArrayList arg5 = new ArrayList();
- tKey = GT_Utility.sPlayedSoundMap.entrySet().iterator();
-
- while (tKey.hasNext()) {
- Entry arg7 = (Entry) tKey.next();
- if (((Integer) arg7.getValue()).intValue() < 0) {
- arg5.add(arg7.getKey());
- } else {
- arg7.setValue(Integer.valueOf(((Integer) arg7.getValue()).intValue() - 1));
- }
- }
-
- Iterator arg8 = arg5.iterator();
-
- while (arg8.hasNext()) {
- GT_PlayedSound arg6 = (GT_PlayedSound) arg8.next();
- GT_Utility.sPlayedSoundMap.remove(arg6);
- }
-
- if (!GregTech_API.mServerStarted) {
- GregTech_API.mServerStarted = true;
- }
- }
- }
-
-
-
-
- /**
- * GT_Client's onPostLoad
- */
-
- public static void onPostLoad() {
- try {
- for (int i = 0; i < GregTech_API.METATILEENTITIES.length; i++) {
- try {
- if (GregTech_API.METATILEENTITIES[i] != null) {
- GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip((EntityPlayer) null, true);
- }
- }
- catch (Throwable t) {
- GT_Log.err.println("Error in MetaTileEntity with ID of " + i);
- t.printStackTrace(GT_Log.err);
- }
- }
- }
- catch (Throwable var2) {
- var2.printStackTrace();
- }
- }
-
-
-
-
-
-
-
-} \ No newline at end of file
+public class ClassTransformer_GT_Client {
+
+ private final boolean valid;
+ private final ClassReader read;
+ private final ClassWriter write;
+ private boolean mModern = true;
+ private boolean mObfuscated = true;
+ private byte[] mTooledClass;
+
+ public ClassTransformer_GT_Client(byte[] basicClass, boolean obfuscated) {
+
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ mObfuscated = obfuscated;
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+
+ /**
+ * Let's just read the GT archive for some info
+ */
+ // mModern = findAssemblyLineClass();
+ // FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Found Assembly Line?
+ // "+mModern+".");
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Fixing Issues in vanilla GT.");
+ if (mModern) {
+ aTempReader.accept(new MethodAdaptor2(aTempWriter), 0);
+ // FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Patching Client handling of
+ // Assembly Line recipe visibility for GT 5.09");
+ // injectMethod(aTempWriter, "onPlayerTickEventClient");
+ injectMethod(aTempWriter, "onPostLoad");
+ if (aTempReader != null && aTempWriter != null) {
+ valid = true;
+ mTooledClass = aTempWriter.toByteArray();
+ } else {
+ valid = false;
+ }
+ } else {
+ mTooledClass = basicClass;
+ valid = true;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Valid? " + valid + ".");
+ read = aTempReader;
+ write = aTempWriter;
+ }
+
+ public boolean isValidTransformer() {
+ return valid;
+ }
+
+ public ClassReader getReader() {
+ return read;
+ }
+
+ public ClassWriter getWriter() {
+ return write;
+ }
+
+ public boolean findAssemblyLineClass() {
+ ClassLoader cl = getClass().getClassLoader();
+ try {
+ Set<ClassPath.ClassInfo> classesInPackage = ClassPath.from(cl).getTopLevelClassesRecursive("gregtech");
+ if (classesInPackage != null && classesInPackage.size() > 0) {
+ for (ClassInfo x : classesInPackage) {
+ if (x.getResourceName().contains("GT_MetaTileEntity_AssemblyLine")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Client Proxy Patch",
+ Level.INFO,
+ "Patchable class | " + x.getResourceName());
+ return true;
+ }
+ }
+ }
+ } catch (IOException e) {
+ }
+
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Client Proxy Patch",
+ Level.INFO,
+ "Failed to find Gregtech classes using prefered method, using backup.");
+
+ cl = ClassLoader.getSystemClassLoader();
+ ImmutableMap<File, ClassLoader> g = getClassPathEntries(cl);
+ File aGregtech = null;
+ if (g.size() > 0) {
+ for (int i = 0; i < g.size(); i++) {
+ String aName;
+ try {
+ File aF = g.keySet().asList().get(i);
+ aName = aF.getName();
+ if (aName != null && aName.length() > 0) {
+ if (aName.toLowerCase().contains("gregtech")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Patchable class | " + aName);
+ aGregtech = aF;
+ }
+ }
+ } catch (Throwable t) {
+ }
+ }
+ }
+
+ if (aGregtech != null) {
+ File file = aGregtech;
+ FileInputStream fis;
+ JarInputStream jis;
+ try {
+ fis = new FileInputStream(file);
+ jis = new JarInputStream(fis);
+ System.out.println(jis.markSupported());
+ JarEntry je;
+ while ((je = jis.getNextJarEntry()) != null) {
+ if (je.getName().contains("GT_MetaTileEntity_AssemblyLine")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Client Proxy Patch",
+ Level.INFO,
+ "Patchable class | " + je.getName());
+ jis.close();
+ return true;
+ }
+ }
+ if (jis != null) {
+ jis.close();
+ }
+ return true;
+ } catch (IOException e1) {
+ }
+ }
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Client Proxy Patch",
+ Level.INFO,
+ "Failed to find Gregtech classes using backup method, probably using GT 5.08");
+
+ return false;
+ }
+
+ static ImmutableMap<File, ClassLoader> getClassPathEntries(ClassLoader classloader) {
+ LinkedHashMap<File, ClassLoader> entries = Maps.newLinkedHashMap();
+ // Search parent first, since it's the order ClassLoader#loadClass() uses.
+ ClassLoader parent = classloader.getParent();
+ if (parent != null) {
+ entries.putAll(getClassPathEntries(parent));
+ }
+ if (classloader instanceof URLClassLoader) {
+ URLClassLoader urlClassLoader = (URLClassLoader) classloader;
+ for (URL entry : urlClassLoader.getURLs()) {
+ if (entry.getProtocol().equals("file")) {
+ File file = new File(entry.getFile());
+ if (!entries.containsKey(file)) {
+ entries.put(file, classloader);
+ }
+ }
+ }
+ }
+ return ImmutableMap.copyOf(entries);
+ }
+
+ public boolean injectMethod(ClassWriter cw, String string) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Client Proxy Patch",
+ Level.INFO,
+ "Injecting " + string + ". Obfuscated? " + mObfuscated);
+
+ if (string.equals("onPlayerTickEventClient")) {
+ /**
+ * Inject new, safer code
+ */
+ AnnotationVisitor av0;
+ /**
+ * Static invocation of custom handler instead
+ */
+ mv = cw.visitMethod(
+ ACC_PUBLIC,
+ "onPlayerTickEventClient",
+ "(Lcpw/mods/fml/common/gameevent/TickEvent$PlayerTickEvent;)V",
+ null,
+ null);
+ av0 = mv.visitAnnotation("Lcpw/mods/fml/common/eventhandler/SubscribeEvent;", true);
+ av0.visitEnd();
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(371, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client",
+ "onPlayerTickEventClient",
+ "(Lcpw/mods/fml/common/gameevent/TickEvent$PlayerTickEvent;)V",
+ false);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(372, l1);
+ mv.visitInsn(RETURN);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLocalVariable("this", "Lgregtech/common/GT_Client;", null, l0, l2, 0);
+ mv.visitLocalVariable(
+ "aEvent", "Lcpw/mods/fml/common/gameevent/TickEvent$PlayerTickEvent;", null, l0, l2, 1);
+ mv.visitMaxs(1, 2);
+ mv.visitEnd();
+ didInject = true;
+ } else if (string.equals("onPostLoad")) {
+ mv = cw.visitMethod(ACC_PUBLIC, "onPostLoad", "()V", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(315, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "gregtech/common/GT_Proxy", "onPostLoad", "()V", false);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(316, l1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client",
+ "onPostLoad",
+ "()V",
+ false);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(317, l2);
+ mv.visitInsn(RETURN);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLocalVariable("this", "Lgregtech/common/GT_Client;", null, l0, l3, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
+
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public class MethodAdaptor2 extends ClassVisitor {
+
+ public MethodAdaptor2(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ if (
+ /*name.equals("onPlayerTickEventClient") || */ name.equals("onPostLoad")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Client Proxy Patch", Level.INFO, "Found method " + name + ", removing.");
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ return methodVisitor;
+ }
+ }
+
+ public byte[] getByteArray() {
+ if (mTooledClass != null) {
+ return mTooledClass;
+ }
+ return getWriter().toByteArray();
+ }
+
+ private static final Map<UUID, Long> aTimeMap = new HashMap<UUID, Long>();
+
+ public static void onPlayerTickEventClient(PlayerTickEvent aEvent) {
+ if (aEvent.side.isClient() && aEvent.phase == Phase.END && !aEvent.player.isDead) {
+ long aTime = 0;
+ if (aTimeMap.get(aEvent.player.getUniqueID()) == null) {
+ aTimeMap.put(aEvent.player.getUniqueID(), 0l);
+ } else {
+ aTime = aTimeMap.get(aEvent.player.getUniqueID()) + 1;
+ aTimeMap.put(aEvent.player.getUniqueID(), aTime);
+ }
+ if (aTime >= 100L) {
+ aTimeMap.put(aEvent.player.getUniqueID(), 0l);
+ /**
+ * Remove original handling
+ */
+ if (StaticFields59.mAssLineVisualMapNEI != null) {
+ StatFileWriter tList = Minecraft.getMinecraft().thePlayer.getStatFileWriter();
+ GT_Recipe_Map aAssLineNei;
+ try {
+ aAssLineNei = (GT_Recipe_Map) StaticFields59.mAssLineVisualMapNEI.get(null);
+ for (GT_Recipe aFakeAssLineRecipe : aAssLineNei.mRecipeList) {
+ String aSafeUnlocalName;
+ if (aFakeAssLineRecipe.getOutput(0) == null) {
+ Logger.INFO(
+ "Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
+ continue;
+ }
+ ItemStack aStack = aFakeAssLineRecipe.getOutput(0);
+ try {
+ aSafeUnlocalName = aStack.getUnlocalizedName();
+ } catch (Throwable t) {
+ aSafeUnlocalName = ItemUtils.getUnlocalizedItemName(aStack);
+ }
+ boolean aHidden = true;
+ try {
+ aHidden = tList.hasAchievementUnlocked(
+ AssLineAchievements.getAchievement(aSafeUnlocalName));
+ Logger.INFO("Found achievement for " + aSafeUnlocalName);
+ } catch (NullPointerException rrr) {
+ aHidden = true;
+ // Logger.INFO("Exception handling achievement for "+aSafeUnlocalName);
+ // rrr.printStackTrace();
+ }
+ aFakeAssLineRecipe.mHidden = !aHidden;
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ }
+
+ Iterator tKey;
+ ArrayList arg5 = new ArrayList();
+ tKey = GT_Utility.sPlayedSoundMap.entrySet().iterator();
+
+ while (tKey.hasNext()) {
+ Entry arg7 = (Entry) tKey.next();
+ if (((Integer) arg7.getValue()).intValue() < 0) {
+ arg5.add(arg7.getKey());
+ } else {
+ arg7.setValue(Integer.valueOf(((Integer) arg7.getValue()).intValue() - 1));
+ }
+ }
+
+ Iterator arg8 = arg5.iterator();
+
+ while (arg8.hasNext()) {
+ GT_PlayedSound arg6 = (GT_PlayedSound) arg8.next();
+ GT_Utility.sPlayedSoundMap.remove(arg6);
+ }
+
+ if (!GregTech_API.mServerStarted) {
+ GregTech_API.mServerStarted = true;
+ }
+ }
+ }
+
+ /**
+ * GT_Client's onPostLoad
+ */
+ public static void onPostLoad() {
+ try {
+ for (int i = 0; i < GregTech_API.METATILEENTITIES.length; i++) {
+ try {
+ if (GregTech_API.METATILEENTITIES[i] != null) {
+ GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip((EntityPlayer) null, true);
+ }
+ } catch (Throwable t) {
+ GT_Log.err.println("Error in MetaTileEntity with ID of " + i);
+ t.printStackTrace(GT_Log.err);
+ }
+ }
+ } catch (Throwable var2) {
+ var2.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_ItemMachines_Tooltip.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_ItemMachines_Tooltip.java
index 4b2a10df07..473b763738 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_ItemMachines_Tooltip.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_ItemMachines_Tooltip.java
@@ -2,7 +2,8 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import java.io.IOException;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.preloader.DevHelper;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -10,130 +11,143 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.preloader.DevHelper;
-
-public class ClassTransformer_GT_ItemMachines_Tooltip {
-
- //The qualified name of the class we plan to transform.
- private static final String className = "gregtech.common.blocks.GT_Item_Machines";
- //gregtech/common/blocks/GT_Item_Machines
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- String aEntityPlayer;
- String aItemStack;
- String aWorld;
-
- private static boolean doesMethodAlreadyExist = false;
-
- public ClassTransformer_GT_ItemMachines_Tooltip(byte[] basicClass, boolean obfuscated) {
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- reader = aTempReader;
- writer = aTempWriter;
-
- if (reader != null && writer != null && !doesMethodAlreadyExist) {
- aEntityPlayer = obfuscated ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayer") : "net/minecraft/entity/player/EntityPlayer";
- aItemStack = obfuscated ? DevHelper.getObfuscated("net/minecraft/item/ItemStack") : "net/minecraft/item/ItemStack";
- aWorld = obfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
-
- injectMethod("addInformation");
- }
-
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public void injectMethod(String aMethodName) {
- MethodVisitor mv;
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Tooltip Patch", Level.INFO, "Injecting "+aMethodName+" into "+className+".");
- if (aMethodName.equals("addInformation")) {
-
- mv = getWriter().visitMethod(ACC_PUBLIC, "addInformation", "(L"+aItemStack+";L"+aEntityPlayer+";Ljava/util/List;Z)V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- Label l1 = new Label();
- Label l2 = new Label();
- mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable");
- mv.visitLabel(l0);
- mv.visitLineNumber(120, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitVarInsn(ILOAD, 4);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy", "conStructGtTileBlockTooltip", "(L"+aItemStack+";L"+aEntityPlayer+";Ljava/util/List;Z)V", false);
- mv.visitLabel(l1);
- mv.visitLineNumber(121, l1);
- Label l3 = new Label();
- mv.visitJumpInsn(GOTO, l3);
- mv.visitLabel(l2);
- mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {"java/lang/Throwable"});
- mv.visitVarInsn(ASTORE, 5);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(122, l4);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Throwable", "printStackTrace", "(Ljava/io/PrintStream;)V", false);
- mv.visitLabel(l3);
- mv.visitLineNumber(124, l3);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitInsn(RETURN);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Item_Machines;", null, l0, l5, 0);
- mv.visitLocalVariable("aStack", "L"+aItemStack+";", null, l0, l5, 1);
- mv.visitLocalVariable("aPlayer", "L"+aEntityPlayer+";", null, l0, l5, 2);
- mv.visitLocalVariable("aList", "Ljava/util/List;", null, l0, l5, 3);
- mv.visitLocalVariable("par4", "Z", null, l0, l5, 4);
- mv.visitLocalVariable("e", "Ljava/lang/Throwable;", null, l4, l3, 5);
- mv.visitMaxs(4, 6);
- mv.visitEnd();
-}
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Tooltip Patch", Level.INFO, "Method injection complete.");
-
- }
-
- public static final class localClassVisitor extends ClassVisitor {
-
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- if (name.equals("addInformation")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech Tooltip Patch", Level.INFO, "Found method "+name+", Patching.");
- return null;
- }
- MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- return methodVisitor;
- }
- }
-
+public class ClassTransformer_GT_ItemMachines_Tooltip {
+
+ // The qualified name of the class we plan to transform.
+ private static final String className = "gregtech.common.blocks.GT_Item_Machines";
+ // gregtech/common/blocks/GT_Item_Machines
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ String aEntityPlayer;
+ String aItemStack;
+ String aWorld;
+
+ private static boolean doesMethodAlreadyExist = false;
+
+ public ClassTransformer_GT_ItemMachines_Tooltip(byte[] basicClass, boolean obfuscated) {
+
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter), 0);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ reader = aTempReader;
+ writer = aTempWriter;
+
+ if (reader != null && writer != null && !doesMethodAlreadyExist) {
+ aEntityPlayer = obfuscated
+ ? DevHelper.getObfuscated("net/minecraft/entity/player/EntityPlayer")
+ : "net/minecraft/entity/player/EntityPlayer";
+ aItemStack = obfuscated
+ ? DevHelper.getObfuscated("net/minecraft/item/ItemStack")
+ : "net/minecraft/item/ItemStack";
+ aWorld = obfuscated ? DevHelper.getObfuscated("net/minecraft/world/World") : "net/minecraft/world/World";
+
+ injectMethod("addInformation");
+ }
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public void injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Tooltip Patch",
+ Level.INFO,
+ "Injecting " + aMethodName + " into " + className + ".");
+ if (aMethodName.equals("addInformation")) {
+
+ mv = getWriter()
+ .visitMethod(
+ ACC_PUBLIC,
+ "addInformation",
+ "(L" + aItemStack + ";L" + aEntityPlayer + ";Ljava/util/List;Z)V",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ Label l1 = new Label();
+ Label l2 = new Label();
+ mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable");
+ mv.visitLabel(l0);
+ mv.visitLineNumber(120, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitVarInsn(ILOAD, 4);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy",
+ "conStructGtTileBlockTooltip",
+ "(L" + aItemStack + ";L" + aEntityPlayer + ";Ljava/util/List;Z)V",
+ false);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(121, l1);
+ Label l3 = new Label();
+ mv.visitJumpInsn(GOTO, l3);
+ mv.visitLabel(l2);
+ mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {"java/lang/Throwable"});
+ mv.visitVarInsn(ASTORE, 5);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(122, l4);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "java/lang/Throwable", "printStackTrace", "(Ljava/io/PrintStream;)V", false);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(124, l3);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitInsn(RETURN);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLocalVariable("this", "Lgregtech/common/blocks/GT_Item_Machines;", null, l0, l5, 0);
+ mv.visitLocalVariable("aStack", "L" + aItemStack + ";", null, l0, l5, 1);
+ mv.visitLocalVariable("aPlayer", "L" + aEntityPlayer + ";", null, l0, l5, 2);
+ mv.visitLocalVariable("aList", "Ljava/util/List;", null, l0, l5, 3);
+ mv.visitLocalVariable("par4", "Z", null, l0, l5, 4);
+ mv.visitLocalVariable("e", "Ljava/lang/Throwable;", null, l4, l3, 5);
+ mv.visitMaxs(4, 6);
+ mv.visitEnd();
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech Tooltip Patch", Level.INFO, "Method injection complete.");
+ }
+
+ public static final class localClassVisitor extends ClassVisitor {
+
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ if (name.equals("addInformation")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech Tooltip Patch", Level.INFO, "Found method " + name + ", Patching.");
+ return null;
+ }
+ MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_MetaGenerated_Tool.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_MetaGenerated_Tool.java
index b6cd9c8d67..65229e3b1d 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_MetaGenerated_Tool.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_MetaGenerated_Tool.java
@@ -7,6 +7,7 @@ import static org.objectweb.asm.Opcodes.ASM5;
import static org.objectweb.asm.Opcodes.INVOKESTATIC;
import static org.objectweb.asm.Opcodes.RETURN;
+import gtPlusPlus.preloader.Preloader_Logger;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.ClassReader;
@@ -15,102 +16,109 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import gtPlusPlus.preloader.Preloader_Logger;
-
public class ClassTransformer_GT_MetaGenerated_Tool {
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- public ClassTransformer_GT_MetaGenerated_Tool(byte[] basicClass) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new LocalClassVisitor(aTempWriter), 0);
- boolean completed = injectMethod("getSubItems", aTempWriter);
- if (aTempReader != null && aTempWriter != null && completed) {
- isValid = true;
- } else {
- isValid = false;
- }
- Preloader_Logger.LOG("GT Tool Fix", Level.INFO, "Valid? " + isValid + ".");
- reader = aTempReader;
- writer = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
- public ClassReader getReader() {
- return reader;
- }
+ public ClassTransformer_GT_MetaGenerated_Tool(byte[] basicClass) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new LocalClassVisitor(aTempWriter), 0);
+ boolean completed = injectMethod("getSubItems", aTempWriter);
+ if (aTempReader != null && aTempWriter != null && completed) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ Preloader_Logger.LOG("GT Tool Fix", Level.INFO, "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
- public ClassWriter getWriter() {
- return writer;
- }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- public boolean injectMethod(String aMethodName, ClassWriter cw) {
- MethodVisitor mv;
- boolean didInject = false;
- Preloader_Logger.LOG("GT Tool Fix", Level.INFO, "Injecting " + aMethodName + ".");
- if (aMethodName.equals("getSubItems")) {
- {
- mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "getSubItems", "(Lnet/minecraft/item/Item;Lnet/minecraft/creativetab/CreativeTabs;Ljava/util/List;)V", null, null);
- {
- AnnotationVisitor av0 = mv.visitAnnotation("Lcpw/mods/fml/relauncher/SideOnly;", true);
- av0.visitEnum("value", "Lcpw/mods/fml/relauncher/Side;", "CLIENT");
- av0.visitEnd();
- }
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(321, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/helpers/MethodHelper_GT", "getSubItems", "(Lgregtech/api/items/GT_MetaGenerated_Tool;Lnet/minecraft/item/Item;Lnet/minecraft/creativetab/CreativeTabs;Ljava/util/List;)V", false);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(322, l1);
- mv.visitInsn(RETURN);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLocalVariable("this", "Lgregtech/api/items/GT_MetaGenerated_Tool;", null, l0, l2, 0);
- mv.visitLocalVariable("var1", "Lnet/minecraft/item/Item;", null, l0, l2, 1);
- mv.visitLocalVariable("aCreativeTab", "Lnet/minecraft/creativetab/CreativeTabs;", null, l0, l2, 2);
- mv.visitLocalVariable("aList", "Ljava/util/List;", null, l0, l2, 3);
- mv.visitMaxs(4, 4);
- mv.visitEnd();
- didInject = true;
- }
+ public ClassReader getReader() {
+ return reader;
+ }
- }
- Preloader_Logger.LOG("GT Tool Fix", Level.INFO, "Method injection complete.");
- return didInject;
- }
+ public ClassWriter getWriter() {
+ return writer;
+ }
- public final class LocalClassVisitor extends ClassVisitor {
+ public boolean injectMethod(String aMethodName, ClassWriter cw) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ Preloader_Logger.LOG("GT Tool Fix", Level.INFO, "Injecting " + aMethodName + ".");
+ if (aMethodName.equals("getSubItems")) {
+ {
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_FINAL,
+ "getSubItems",
+ "(Lnet/minecraft/item/Item;Lnet/minecraft/creativetab/CreativeTabs;Ljava/util/List;)V",
+ null,
+ null);
+ {
+ AnnotationVisitor av0 = mv.visitAnnotation("Lcpw/mods/fml/relauncher/SideOnly;", true);
+ av0.visitEnum("value", "Lcpw/mods/fml/relauncher/Side;", "CLIENT");
+ av0.visitEnd();
+ }
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(321, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/helpers/MethodHelper_GT",
+ "getSubItems",
+ "(Lgregtech/api/items/GT_MetaGenerated_Tool;Lnet/minecraft/item/Item;Lnet/minecraft/creativetab/CreativeTabs;Ljava/util/List;)V",
+ false);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(322, l1);
+ mv.visitInsn(RETURN);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLocalVariable("this", "Lgregtech/api/items/GT_MetaGenerated_Tool;", null, l0, l2, 0);
+ mv.visitLocalVariable("var1", "Lnet/minecraft/item/Item;", null, l0, l2, 1);
+ mv.visitLocalVariable("aCreativeTab", "Lnet/minecraft/creativetab/CreativeTabs;", null, l0, l2, 2);
+ mv.visitLocalVariable("aList", "Ljava/util/List;", null, l0, l2, 3);
+ mv.visitMaxs(4, 4);
+ mv.visitEnd();
+ didInject = true;
+ }
+ }
+ Preloader_Logger.LOG("GT Tool Fix", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
- public LocalClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
+ public final class LocalClassVisitor extends ClassVisitor {
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- if (name.equals("getSubItems") && desc.equals("(Lnet/minecraft/item/Item;Lnet/minecraft/creativetab/CreativeTabs;Ljava/util/List;)V")) {
- methodVisitor = null;
- Preloader_Logger.LOG("GT Tool Fix", Level.INFO, "Found method "+name+", removing.");
- }
- else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- return methodVisitor;
- }
- }
+ public LocalClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ if (name.equals("getSubItems")
+ && desc.equals(
+ "(Lnet/minecraft/item/Item;Lnet/minecraft/creativetab/CreativeTabs;Ljava/util/List;)V")) {
+ methodVisitor = null;
+ Preloader_Logger.LOG("GT Tool Fix", Level.INFO, "Found method " + name + ", removing.");
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Packet_TileEntity.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Packet_TileEntity.java
index 1f281ce492..94be6ef3ec 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Packet_TileEntity.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Packet_TileEntity.java
@@ -2,6 +2,7 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -9,311 +10,364 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-
-public class ClassTransformer_GT_Packet_TileEntity {
-
- //The qualified name of the class we plan to transform.
- //gregtech/common/blocks/GT_Block_Machines
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
-
- public ClassTransformer_GT_Packet_TileEntity(byte[] basicClass, boolean obfuscated) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
+public class ClassTransformer_GT_Packet_TileEntity {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Attempting to make GT Packets safer.");
+ // The qualified name of the class we plan to transform.
+ // gregtech/common/blocks/GT_Block_Machines
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter), 0);
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Valid patch? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
+ public ClassTransformer_GT_Packet_TileEntity(byte[] basicClass, boolean obfuscated) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Attempting to make GT Packets safer.");
- if (reader != null && writer != null) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Attempting Method Injection.");
- injectMethod("process", obfuscated);
- }
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter), 0);
- }
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Valid patch? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
- public boolean isValidTransformer() {
- return isValid;
- }
+ if (reader != null && writer != null) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Attempting Method Injection.");
+ injectMethod("process", obfuscated);
+ }
+ }
- public ClassReader getReader() {
- return reader;
- }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- public ClassWriter getWriter() {
- return writer;
- }
+ public ClassReader getReader() {
+ return reader;
+ }
- public boolean injectMethod(String aMethodName, boolean obfuscated) {
- MethodVisitor mv;
- boolean didInject = false;
- String aGetTile = obfuscated ? "func_147438_o" : "getTileEntity";
-
- FMLRelaunchLog.log("[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Injecting "+aMethodName+".");
- if (aMethodName.equals("process")) {
- mv = getWriter().visitMethod(ACC_PUBLIC, "process", "(Lnet/minecraft/world/IBlockAccess;)V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- Label l1 = new Label();
- Label l2 = new Label();
- mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable");
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(93, l3);
- mv.visitVarInsn(ALOAD, 1);
- Label l4 = new Label();
- mv.visitJumpInsn(IFNULL, l4);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(94, l5);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mX", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mY", "S");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mZ", "I");
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraft/world/IBlockAccess", ""+aGetTile+"", "(III)Lnet/minecraft/tileentity/TileEntity;", true);
- mv.visitVarInsn(ASTORE, 2);
- Label l6 = new Label();
- mv.visitLabel(l6);
- mv.visitLineNumber(95, l6);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitJumpInsn(IFNULL, l4);
- mv.visitLabel(l0);
- mv.visitLineNumber(97, l0);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitTypeInsn(INSTANCEOF, "gregtech/api/metatileentity/BaseMetaTileEntity");
- Label l7 = new Label();
- mv.visitJumpInsn(IFEQ, l7);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(98, l8);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitTypeInsn(CHECKCAST, "gregtech/api/metatileentity/BaseMetaTileEntity");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mID", "S");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC0", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC1", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC2", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC3", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC4", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC5", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mTexture", "B");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mTexturePage", "B");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mUpdate", "B");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mRedstone", "B");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mColor", "B");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/metatileentity/BaseMetaTileEntity", "receiveMetaTileEntityData", "(SIIIIIIBBBBB)V", false);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(99, l9);
- mv.visitJumpInsn(GOTO, l4);
- mv.visitLabel(l7);
- mv.visitLineNumber(101, l7);
- mv.visitFrame(F_APPEND,1, new Object[] {"net/minecraft/tileentity/TileEntity"}, 0, null);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitTypeInsn(INSTANCEOF, "gregtech/api/metatileentity/BaseMetaPipeEntity");
- mv.visitJumpInsn(IFEQ, l4);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(102, l10);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitTypeInsn(CHECKCAST, "gregtech/api/metatileentity/BaseMetaPipeEntity");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mID", "S");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC0", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC1", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC2", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC3", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC4", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC5", "I");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mTexture", "B");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mUpdate", "B");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mRedstone", "B");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mColor", "B");
- mv.visitMethodInsn(INVOKEVIRTUAL, "gregtech/api/metatileentity/BaseMetaPipeEntity", "receiveMetaTileEntityData", "(SIIIIIIBBBB)V", false);
- mv.visitLabel(l1);
- mv.visitLineNumber(104, l1);
- mv.visitJumpInsn(GOTO, l4);
- mv.visitLabel(l2);
- mv.visitLineNumber(105, l2);
- mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {"java/lang/Throwable"});
- mv.visitVarInsn(ASTORE, 3);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(106, l11);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
- mv.visitInsn(DUP);
- mv.visitLdcInsn("[GTPTE] Bad Tile Entity set in world, your game would have crashed if not for me! Was Null? ");
- mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "<init>", "(Ljava/lang/String;)V", false);
- mv.visitVarInsn(ALOAD, 2);
- Label l12 = new Label();
- mv.visitJumpInsn(IFNONNULL, l12);
- mv.visitInsn(ICONST_1);
- Label l13 = new Label();
- mv.visitJumpInsn(GOTO, l13);
- mv.visitLabel(l12);
- mv.visitFrame(F_FULL, 4, new Object[] {"gregtech/api/net/GT_Packet_TileEntity", "net/minecraft/world/IBlockAccess", "net/minecraft/tileentity/TileEntity", "java/lang/Throwable"}, 2, new Object[] {"java/io/PrintStream", "java/lang/StringBuilder"});
- mv.visitInsn(ICONST_0);
- mv.visitLabel(l13);
- mv.visitFrame(F_FULL, 4, new Object[] {"gregtech/api/net/GT_Packet_TileEntity", "net/minecraft/world/IBlockAccess", "net/minecraft/tileentity/TileEntity", "java/lang/Throwable"}, 3, new Object[] {"java/io/PrintStream", "java/lang/StringBuilder", INTEGER});
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Z)Ljava/lang/StringBuilder;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLineNumber(107, l14);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
- mv.visitInsn(DUP);
- mv.visitLdcInsn("Tile location [");
- mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "<init>", "(Ljava/lang/String;)V", false);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mX", "I");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(I)Ljava/lang/StringBuilder;", false);
- mv.visitLdcInsn("][");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mY", "S");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(I)Ljava/lang/StringBuilder;", false);
- mv.visitLdcInsn("][");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mZ", "I");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(I)Ljava/lang/StringBuilder;", false);
- mv.visitLdcInsn("]");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
- Label l15 = new Label();
- mv.visitLabel(l15);
- mv.visitLineNumber(108, l15);
- mv.visitVarInsn(ALOAD, 2);
- Label l16 = new Label();
- mv.visitJumpInsn(IFNULL, l16);
- Label l17 = new Label();
- mv.visitLabel(l17);
- mv.visitLineNumber(109, l17);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitTypeInsn(INSTANCEOF, "gregtech/api/metatileentity/BaseMetaPipeEntity");
- Label l18 = new Label();
- mv.visitJumpInsn(IFEQ, l18);
- Label l19 = new Label();
- mv.visitLabel(l19);
- mv.visitLineNumber(110, l19);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitLdcInsn("Type: Pipe");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
- Label l20 = new Label();
- mv.visitLabel(l20);
- mv.visitLineNumber(111, l20);
- mv.visitJumpInsn(GOTO, l16);
- mv.visitLabel(l18);
- mv.visitLineNumber(112, l18);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitTypeInsn(INSTANCEOF, "gregtech/api/metatileentity/BaseMetaTileEntity");
- Label l21 = new Label();
- mv.visitJumpInsn(IFEQ, l21);
- Label l22 = new Label();
- mv.visitLabel(l22);
- mv.visitLineNumber(113, l22);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitLdcInsn("Type: Machine");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
- Label l23 = new Label();
- mv.visitLabel(l23);
- mv.visitLineNumber(114, l23);
- mv.visitJumpInsn(GOTO, l16);
- mv.visitLabel(l21);
- mv.visitLineNumber(116, l21);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
- mv.visitLdcInsn("Type: Non-GT (Could be GT++/TT/BW)");
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
- mv.visitLabel(l16);
- mv.visitLineNumber(119, l16);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 3);
- mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Throwable", "printStackTrace", "()V", false);
- mv.visitLabel(l4);
- mv.visitLineNumber(123, l4);
- mv.visitFrame(F_CHOP,2, null, 0, null);
- mv.visitInsn(RETURN);
- Label l24 = new Label();
- mv.visitLabel(l24);
- mv.visitLocalVariable("this", "Lgregtech/api/net/GT_Packet_TileEntity;", null, l3, l24, 0);
- mv.visitLocalVariable("aWorld", "Lnet/minecraft/world/IBlockAccess;", null, l3, l24, 1);
- mv.visitLocalVariable("tTileEntity", "Lnet/minecraft/tileentity/TileEntity;", null, l6, l4, 2);
- mv.visitLocalVariable("t", "Ljava/lang/Throwable;", null, l11, l4, 3);
- mv.visitMaxs(13, 4);
- mv.visitEnd();
+ public ClassWriter getWriter() {
+ return writer;
+ }
+ public boolean injectMethod(String aMethodName, boolean obfuscated) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ String aGetTile = obfuscated ? "func_147438_o" : "getTileEntity";
- didInject = true;
- }
- FMLRelaunchLog.log("[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ if (aMethodName.equals("process")) {
+ mv = getWriter().visitMethod(ACC_PUBLIC, "process", "(Lnet/minecraft/world/IBlockAccess;)V", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ Label l1 = new Label();
+ Label l2 = new Label();
+ mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable");
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(93, l3);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l4 = new Label();
+ mv.visitJumpInsn(IFNULL, l4);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(94, l5);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mX", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mY", "S");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mZ", "I");
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraft/world/IBlockAccess",
+ "" + aGetTile + "",
+ "(III)Lnet/minecraft/tileentity/TileEntity;",
+ true);
+ mv.visitVarInsn(ASTORE, 2);
+ Label l6 = new Label();
+ mv.visitLabel(l6);
+ mv.visitLineNumber(95, l6);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitJumpInsn(IFNULL, l4);
+ mv.visitLabel(l0);
+ mv.visitLineNumber(97, l0);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitTypeInsn(INSTANCEOF, "gregtech/api/metatileentity/BaseMetaTileEntity");
+ Label l7 = new Label();
+ mv.visitJumpInsn(IFEQ, l7);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(98, l8);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitTypeInsn(CHECKCAST, "gregtech/api/metatileentity/BaseMetaTileEntity");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mID", "S");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC0", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC1", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC2", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC3", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC4", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC5", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mTexture", "B");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mTexturePage", "B");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mUpdate", "B");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mRedstone", "B");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mColor", "B");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/metatileentity/BaseMetaTileEntity",
+ "receiveMetaTileEntityData",
+ "(SIIIIIIBBBBB)V",
+ false);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(99, l9);
+ mv.visitJumpInsn(GOTO, l4);
+ mv.visitLabel(l7);
+ mv.visitLineNumber(101, l7);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"net/minecraft/tileentity/TileEntity"}, 0, null);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitTypeInsn(INSTANCEOF, "gregtech/api/metatileentity/BaseMetaPipeEntity");
+ mv.visitJumpInsn(IFEQ, l4);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(102, l10);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitTypeInsn(CHECKCAST, "gregtech/api/metatileentity/BaseMetaPipeEntity");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mID", "S");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC0", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC1", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC2", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC3", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC4", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mC5", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mTexture", "B");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mUpdate", "B");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mRedstone", "B");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mColor", "B");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "gregtech/api/metatileentity/BaseMetaPipeEntity",
+ "receiveMetaTileEntityData",
+ "(SIIIIIIBBBB)V",
+ false);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(104, l1);
+ mv.visitJumpInsn(GOTO, l4);
+ mv.visitLabel(l2);
+ mv.visitLineNumber(105, l2);
+ mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {"java/lang/Throwable"});
+ mv.visitVarInsn(ASTORE, 3);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(106, l11);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
+ mv.visitInsn(DUP);
+ mv.visitLdcInsn(
+ "[GTPTE] Bad Tile Entity set in world, your game would have crashed if not for me! Was Null? ");
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "<init>", "(Ljava/lang/String;)V", false);
+ mv.visitVarInsn(ALOAD, 2);
+ Label l12 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l12);
+ mv.visitInsn(ICONST_1);
+ Label l13 = new Label();
+ mv.visitJumpInsn(GOTO, l13);
+ mv.visitLabel(l12);
+ mv.visitFrame(
+ F_FULL,
+ 4,
+ new Object[] {
+ "gregtech/api/net/GT_Packet_TileEntity",
+ "net/minecraft/world/IBlockAccess",
+ "net/minecraft/tileentity/TileEntity",
+ "java/lang/Throwable"
+ },
+ 2,
+ new Object[] {"java/io/PrintStream", "java/lang/StringBuilder"});
+ mv.visitInsn(ICONST_0);
+ mv.visitLabel(l13);
+ mv.visitFrame(
+ F_FULL,
+ 4,
+ new Object[] {
+ "gregtech/api/net/GT_Packet_TileEntity",
+ "net/minecraft/world/IBlockAccess",
+ "net/minecraft/tileentity/TileEntity",
+ "java/lang/Throwable"
+ },
+ 3,
+ new Object[] {"java/io/PrintStream", "java/lang/StringBuilder", INTEGER});
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Z)Ljava/lang/StringBuilder;", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLineNumber(107, l14);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
+ mv.visitInsn(DUP);
+ mv.visitLdcInsn("Tile location [");
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "<init>", "(Ljava/lang/String;)V", false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mX", "I");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(I)Ljava/lang/StringBuilder;", false);
+ mv.visitLdcInsn("][");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "java/lang/StringBuilder",
+ "append",
+ "(Ljava/lang/String;)Ljava/lang/StringBuilder;",
+ false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mY", "S");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(I)Ljava/lang/StringBuilder;", false);
+ mv.visitLdcInsn("][");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "java/lang/StringBuilder",
+ "append",
+ "(Ljava/lang/String;)Ljava/lang/StringBuilder;",
+ false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "gregtech/api/net/GT_Packet_TileEntity", "mZ", "I");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(I)Ljava/lang/StringBuilder;", false);
+ mv.visitLdcInsn("]");
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "java/lang/StringBuilder",
+ "append",
+ "(Ljava/lang/String;)Ljava/lang/StringBuilder;",
+ false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
+ Label l15 = new Label();
+ mv.visitLabel(l15);
+ mv.visitLineNumber(108, l15);
+ mv.visitVarInsn(ALOAD, 2);
+ Label l16 = new Label();
+ mv.visitJumpInsn(IFNULL, l16);
+ Label l17 = new Label();
+ mv.visitLabel(l17);
+ mv.visitLineNumber(109, l17);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitTypeInsn(INSTANCEOF, "gregtech/api/metatileentity/BaseMetaPipeEntity");
+ Label l18 = new Label();
+ mv.visitJumpInsn(IFEQ, l18);
+ Label l19 = new Label();
+ mv.visitLabel(l19);
+ mv.visitLineNumber(110, l19);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn("Type: Pipe");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
+ Label l20 = new Label();
+ mv.visitLabel(l20);
+ mv.visitLineNumber(111, l20);
+ mv.visitJumpInsn(GOTO, l16);
+ mv.visitLabel(l18);
+ mv.visitLineNumber(112, l18);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitTypeInsn(INSTANCEOF, "gregtech/api/metatileentity/BaseMetaTileEntity");
+ Label l21 = new Label();
+ mv.visitJumpInsn(IFEQ, l21);
+ Label l22 = new Label();
+ mv.visitLabel(l22);
+ mv.visitLineNumber(113, l22);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn("Type: Machine");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
+ Label l23 = new Label();
+ mv.visitLabel(l23);
+ mv.visitLineNumber(114, l23);
+ mv.visitJumpInsn(GOTO, l16);
+ mv.visitLabel(l21);
+ mv.visitLineNumber(116, l21);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitFieldInsn(GETSTATIC, "gregtech/api/util/GT_Log", "err", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn("Type: Non-GT (Could be GT++/TT/BW)");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false);
+ mv.visitLabel(l16);
+ mv.visitLineNumber(119, l16);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 3);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Throwable", "printStackTrace", "()V", false);
+ mv.visitLabel(l4);
+ mv.visitLineNumber(123, l4);
+ mv.visitFrame(F_CHOP, 2, null, 0, null);
+ mv.visitInsn(RETURN);
+ Label l24 = new Label();
+ mv.visitLabel(l24);
+ mv.visitLocalVariable("this", "Lgregtech/api/net/GT_Packet_TileEntity;", null, l3, l24, 0);
+ mv.visitLocalVariable("aWorld", "Lnet/minecraft/world/IBlockAccess;", null, l3, l24, 1);
+ mv.visitLocalVariable("tTileEntity", "Lnet/minecraft/tileentity/TileEntity;", null, l6, l4, 2);
+ mv.visitLocalVariable("t", "Ljava/lang/Throwable;", null, l11, l4, 3);
+ mv.visitMaxs(13, 4);
+ mv.visitEnd();
- public final class localClassVisitor extends ClassVisitor {
+ didInject = true;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
- public localClassVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
+ public final class localClassVisitor extends ClassVisitor {
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- if (name.equals("process")) {
- FMLRelaunchLog.log("[GT++ ASM] Gregtech GT_Packet_TileEntity Patch", Level.INFO, "Found method "+name+", removing.");
- methodVisitor = null;
- }
- else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- return methodVisitor;
- }
- }
+ public localClassVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ if (name.equals("process")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Gregtech GT_Packet_TileEntity Patch",
+ Level.INFO,
+ "Found method " + name + ", removing.");
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java
index fa711e5693..92300bd3d1 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Utility.java
@@ -2,6 +2,8 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.preloader.Preloader_Logger;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -9,275 +11,327 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.preloader.Preloader_Logger;
-import ic2.core.IC2Potion;
-import ic2.core.item.armor.ItemArmorHazmat;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.EnumCreatureAttribute;
-import net.minecraft.potion.Potion;
-import net.minecraft.potion.PotionEffect;
-
public class ClassTransformer_GT_Utility {
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
- private final String className;
-
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+ private final String className;
+
+ public ClassTransformer_GT_Utility(byte[] basicClass, String aClassName) {
+
+ className = aClassName;
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter, className), 0);
- public ClassTransformer_GT_Utility(byte[] basicClass, String aClassName) {
-
- className = aClassName;
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter, className), 0);
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Valid patch? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- } else {
- isValid = false;
- }
-
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Valid patch? " + isValid + ".");
- reader = aTempReader;
- writer = aTempWriter;
+ if (reader != null && writer != null) {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Attempting Method Injection.");
+ injectMethod("getTier");
+ injectMethod("applyRadioactivity");
+ injectMethod("isWearingFullFrostHazmat");
+ injectMethod("isWearingFullHeatHazmat");
+ injectMethod("isWearingFullBioHazmat");
+ injectMethod("isWearingFullRadioHazmat");
+ injectMethod("isWearingFullElectroHazmat");
+ injectMethod("isWearingFullGasHazmat");
+ }
+ }
- if (reader != null && writer != null) {
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Attempting Method Injection.");
- injectMethod("getTier");
- injectMethod("applyRadioactivity");
- injectMethod("isWearingFullFrostHazmat");
- injectMethod("isWearingFullHeatHazmat");
- injectMethod("isWearingFullBioHazmat");
- injectMethod("isWearingFullRadioHazmat");
- injectMethod("isWearingFullElectroHazmat");
- injectMethod("isWearingFullGasHazmat");
- }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- }
+ public ClassReader getReader() {
+ return reader;
+ }
- public boolean isValidTransformer() {
- return isValid;
- }
+ public ClassWriter getWriter() {
+ return writer;
+ }
- public ClassReader getReader() {
- return reader;
- }
+ public boolean injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ ClassWriter cw = getWriter();
+ String aClassNameFormatted = Utils.class.getName().replace(".", "/");
- public ClassWriter getWriter() {
- return writer;
- }
+ if (aMethodName.equals("isWearingFullFrostHazmat")) {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "isWearingFullFrostHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(1273, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/core/util/minecraft/EntityUtils",
+ "isWearingFullFrostHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
- public boolean injectMethod(String aMethodName) {
- MethodVisitor mv;
- boolean didInject = false;
- ClassWriter cw = getWriter();
- String aClassNameFormatted = Utils.class.getName().replace(".", "/");
+ if (aMethodName.equals("isWearingFullHeatHazmat")) {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "isWearingFullHeatHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(1277, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/core/util/minecraft/EntityUtils",
+ "isWearingFullHeatHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
- if (aMethodName.equals("isWearingFullFrostHazmat")){
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullFrostHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(1273, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/EntityUtils", "isWearingFullFrostHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
+ if (aMethodName.equals("isWearingFullBioHazmat")) {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "isWearingFullBioHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(1281, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/core/util/minecraft/EntityUtils",
+ "isWearingFullBioHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
- if (aMethodName.equals("isWearingFullHeatHazmat")){
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullHeatHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(1277, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/EntityUtils", "isWearingFullHeatHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
+ if (aMethodName.equals("isWearingFullRadioHazmat")) {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "isWearingFullRadioHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(1285, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/core/util/minecraft/EntityUtils",
+ "isWearingFullRadioHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
- if (aMethodName.equals("isWearingFullBioHazmat")){
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullBioHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(1281, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/EntityUtils", "isWearingFullBioHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
+ if (aMethodName.equals("isWearingFullElectroHazmat")) {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "isWearingFullElectroHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(1289, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/core/util/minecraft/EntityUtils",
+ "isWearingFullElectroHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
- if (aMethodName.equals("isWearingFullRadioHazmat")){
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullRadioHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(1285, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/EntityUtils", "isWearingFullRadioHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
+ if (aMethodName.equals("isWearingFullGasHazmat")) {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "isWearingFullGasHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(1293, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/core/util/minecraft/EntityUtils",
+ "isWearingFullGasHazmat",
+ "(Lnet/minecraft/entity/EntityLivingBase;)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
- if (aMethodName.equals("isWearingFullElectroHazmat")){
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullElectroHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(1289, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/EntityUtils", "isWearingFullElectroHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
+ if (aMethodName.equals("getTier")) {
+ Preloader_Logger.LOG(
+ "Gregtech Utilities Patch",
+ Level.INFO,
+ "Injecting " + aMethodName + ", static replacement call to " + aClassNameFormatted + ".");
+ mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "getTier", "(J)B", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(23, l0);
+ mv.visitVarInsn(LLOAD, 0);
+ mv.visitMethodInsn(INVOKESTATIC, aClassNameFormatted, "getTier", "(J)B", false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("l", "J", null, l0, l1, 0);
+ mv.visitMaxs(2, 2);
+ mv.visitEnd();
+ didInject = true;
+ }
- if (aMethodName.equals("isWearingFullGasHazmat")){
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "isWearingFullGasHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(1293, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/EntityUtils", "isWearingFullGasHazmat", "(Lnet/minecraft/entity/EntityLivingBase;)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
-
- if (aMethodName.equals("getTier")) {
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ", static replacement call to "+aClassNameFormatted+".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "getTier", "(J)B", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(23, l0);
- mv.visitVarInsn(LLOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, aClassNameFormatted, "getTier", "(J)B", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("l", "J", null, l0, l1, 0);
- mv.visitMaxs(2, 2);
- mv.visitEnd();
- didInject = true;
- }
-
- if (aMethodName.equals("applyRadioactivity")){
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "applyRadioactivity", "(Lnet/minecraft/entity/EntityLivingBase;II)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(1342, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ILOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/EntityUtils", "applyRadioactivity", "(Lnet/minecraft/entity/EntityLivingBase;II)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
- mv.visitLocalVariable("aLevel", "I", null, l0, l1, 1);
- mv.visitLocalVariable("aAmountOfItems", "I", null, l0, l1, 2);
- mv.visitMaxs(3, 3);
- mv.visitEnd();
- didInject = true;
- }
-
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
+ if (aMethodName.equals("applyRadioactivity")) {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "applyRadioactivity",
+ "(Lnet/minecraft/entity/EntityLivingBase;II)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(1342, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/core/util/minecraft/EntityUtils",
+ "applyRadioactivity",
+ "(Lnet/minecraft/entity/EntityLivingBase;II)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("aEntity", "Lnet/minecraft/entity/EntityLivingBase;", null, l0, l1, 0);
+ mv.visitLocalVariable("aLevel", "I", null, l0, l1, 1);
+ mv.visitLocalVariable("aAmountOfItems", "I", null, l0, l1, 2);
+ mv.visitMaxs(3, 3);
+ mv.visitEnd();
+ didInject = true;
+ }
- public final class localClassVisitor extends ClassVisitor {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
- String aClassName;
+ public final class localClassVisitor extends ClassVisitor {
- public localClassVisitor(ClassVisitor cv, String aName) {
- super(ASM5, cv);
- aClassName = aName;
- }
+ String aClassName;
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
+ public localClassVisitor(ClassVisitor cv, String aName) {
+ super(ASM5, cv);
+ aClassName = aName;
+ }
- if (name.equals("getTier")) {
- methodVisitor = null;
- }
- else if (name.equals("applyRadioactivity")){
- methodVisitor = null;
- }
- else if (name.equals("isWearingFullFrostHazmat")){
- methodVisitor = null;
- }
- else if (name.equals("isWearingFullHeatHazmat")){
- methodVisitor = null;
- }
- else if (name.equals("isWearingFullBioHazmat")){
- methodVisitor = null;
- }
- else if (name.equals("isWearingFullRadioHazmat")){
- methodVisitor = null;
- }
- else if (name.equals("isWearingFullElectroHazmat")){
- methodVisitor = null;
- }
- else if (name.equals("isWearingFullGasHazmat")){
- methodVisitor = null;
- }
- else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
- if (methodVisitor == null) {
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Found method " + name + ", removing.");
- Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Descriptor: "+desc);
- }
- return methodVisitor;
- }
- }
+ if (name.equals("getTier")) {
+ methodVisitor = null;
+ } else if (name.equals("applyRadioactivity")) {
+ methodVisitor = null;
+ } else if (name.equals("isWearingFullFrostHazmat")) {
+ methodVisitor = null;
+ } else if (name.equals("isWearingFullHeatHazmat")) {
+ methodVisitor = null;
+ } else if (name.equals("isWearingFullBioHazmat")) {
+ methodVisitor = null;
+ } else if (name.equals("isWearingFullRadioHazmat")) {
+ methodVisitor = null;
+ } else if (name.equals("isWearingFullElectroHazmat")) {
+ methodVisitor = null;
+ } else if (name.equals("isWearingFullGasHazmat")) {
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ if (methodVisitor == null) {
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Found method " + name + ", removing.");
+ Preloader_Logger.LOG("Gregtech Utilities Patch", Level.INFO, "Descriptor: " + desc);
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java
index 6aad6831cb..659f76ca0e 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool.java
@@ -2,8 +2,10 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
import java.util.Random;
-
+import net.minecraft.block.Block;
+import net.minecraft.item.Item;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -11,204 +13,208 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import net.minecraft.block.Block;
-import net.minecraft.item.Item;
-
public class ClassTransformer_IC2_GetHarvestTool {
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
- private final String className;
-
- private final String aName_getItemDropped;
- private final String aName_damageDropped;
-
- public static String getHarvestTool(int aMeta) {
- return "wrench";
- }
-
- public static Item getItemDropped(Block aBlock, int meta, Random random, int fortune) {
- return Item.getItemFromBlock(aBlock);
- }
-
- public static int damageDropped(int aMeta) {
- return aMeta;
- }
-
- public ClassTransformer_IC2_GetHarvestTool(byte[] basicClass, boolean obfuscated, String aClassName) {
- className = aClassName;
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- aName_getItemDropped = obfuscated ? "func_149650_a" : "getItemDropped";
- aName_damageDropped = obfuscated ? "func_149692_a" : "damageDropped";
-
- FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO,
- "Attempting to patch in mode " + className + ". Obfuscated? "+obfuscated);
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter, className), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- } else {
- isValid = false;
- }
-
- FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Valid patch? " + isValid + ".");
- reader = aTempReader;
- writer = aTempWriter;
-
- if (reader != null && writer != null) {
- FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Attempting Method Injection.");
- injectMethod("getHarvestTool");
- if (aClassName.equals("ic2.core.block.machine.BlockMachine2")
- || aClassName.equals("ic2.core.block.machine.BlockMachine3")
- || aClassName.equals("ic2.core.block.wiring.BlockElectric")) {
- injectMethod(aName_getItemDropped);
- injectMethod(aName_damageDropped);
- }
- else if (aClassName.equals("ic2.core.block.generator.block.BlockGenerator")
- || aClassName.equals("ic2.core.block.machine.BlockMachine")) {
- injectMethod(aName_damageDropped);
- }
- }
-
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(String aMethodName) {
- MethodVisitor mv;
- boolean didInject = false;
- String aFormattedClassName = className.replace('.', '/');
- ClassWriter cw = getWriter();
-
-
- FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Injecting " + aMethodName + ".");
- if (aMethodName.equals("getHarvestTool")) {
- mv = getWriter().visitMethod(ACC_PUBLIC, "getHarvestTool", "(I)Ljava/lang/String;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(63, l0);
- mv.visitVarInsn(ILOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC,
- "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", "getHarvestTool",
- "(I)Ljava/lang/String;", false);
- mv.visitInsn(ARETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", "L" + aFormattedClassName + ";", null, l0, l1, 0);
- mv.visitLocalVariable("aMeta", "I", null, l0, l1, 1);
- mv.visitMaxs(1, 2);
- mv.visitEnd();
- didInject = true;
- }
- else if (aMethodName.equals(aName_getItemDropped)) {
- mv = cw.visitMethod(ACC_PUBLIC, aName_getItemDropped, "(ILjava/util/Random;I)Lnet/minecraft/item/Item;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(44, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ILOAD, 1);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", "getItemDropped", "(Lnet/minecraft/block/Block;ILjava/util/Random;I)Lnet/minecraft/item/Item;", false);
- mv.visitInsn(ARETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", "L"+aFormattedClassName+";", null, l0, l1, 0);
- mv.visitLocalVariable("meta", "I", null, l0, l1, 1);
- mv.visitLocalVariable("random", "Ljava/util/Random;", null, l0, l1, 2);
- mv.visitLocalVariable("fortune", "I", null, l0, l1, 3);
- mv.visitMaxs(4, 4);
- mv.visitEnd();
- didInject = true;
- }
- else if (aMethodName.equals(aName_damageDropped)) {
- mv = cw.visitMethod(ACC_PUBLIC, aName_damageDropped, "(I)I", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(48, l0);
- mv.visitVarInsn(ILOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool", "damageDropped", "(I)I", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", "L"+aFormattedClassName+";", null, l0, l1, 0);
- mv.visitLocalVariable("meta", "I", null, l0, l1, 1);
- mv.visitMaxs(1, 2);
- mv.visitEnd();
- didInject = true;
- }
- FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
-
- public final class localClassVisitor extends ClassVisitor {
-
- String aClassName;
-
- public localClassVisitor(ClassVisitor cv, String aName) {
- super(ASM5, cv);
- aClassName = aName;
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- if (aClassName.equals("ic2.core.block.machine.BlockMachine2")
- || aClassName.equals("ic2.core.block.machine.BlockMachine3")
- || aClassName.equals("ic2.core.block.wiring.BlockElectric")) {
- if (name.equals(aName_getItemDropped)) {
- methodVisitor = null;
- } else if (name.equals(aName_damageDropped)) {
- methodVisitor = null;
- } else if (name.equals("getHarvestTool")) {
- methodVisitor = null;
- } else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- }
- else if (aClassName.equals("ic2.core.block.generator.block.BlockGenerator")
- || aClassName.equals("ic2.core.block.machine.BlockMachine")) {
- if (name.equals(aName_damageDropped)) {
- methodVisitor = null;
- } else if (name.equals("getHarvestTool")) {
- methodVisitor = null;
- } else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- }
- else {
- if (name.equals("getHarvestTool")) {
- methodVisitor = null;
- } else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- }
- if (methodVisitor == null) {
- FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO,
- "Found method " + name + ", removing.");
- }
- return methodVisitor;
- }
- }
-
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+ private final String className;
+
+ private final String aName_getItemDropped;
+ private final String aName_damageDropped;
+
+ public static String getHarvestTool(int aMeta) {
+ return "wrench";
+ }
+
+ public static Item getItemDropped(Block aBlock, int meta, Random random, int fortune) {
+ return Item.getItemFromBlock(aBlock);
+ }
+
+ public static int damageDropped(int aMeta) {
+ return aMeta;
+ }
+
+ public ClassTransformer_IC2_GetHarvestTool(byte[] basicClass, boolean obfuscated, String aClassName) {
+ className = aClassName;
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ aName_getItemDropped = obfuscated ? "func_149650_a" : "getItemDropped";
+ aName_damageDropped = obfuscated ? "func_149692_a" : "damageDropped";
+
+ FMLRelaunchLog.log(
+ "[GT++ ASM] IC2 getHarvestTool Patch",
+ Level.INFO,
+ "Attempting to patch in mode " + className + ". Obfuscated? " + obfuscated);
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter, className), 0);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+
+ FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Valid patch? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+
+ if (reader != null && writer != null) {
+ FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Attempting Method Injection.");
+ injectMethod("getHarvestTool");
+ if (aClassName.equals("ic2.core.block.machine.BlockMachine2")
+ || aClassName.equals("ic2.core.block.machine.BlockMachine3")
+ || aClassName.equals("ic2.core.block.wiring.BlockElectric")) {
+ injectMethod(aName_getItemDropped);
+ injectMethod(aName_damageDropped);
+ } else if (aClassName.equals("ic2.core.block.generator.block.BlockGenerator")
+ || aClassName.equals("ic2.core.block.machine.BlockMachine")) {
+ injectMethod(aName_damageDropped);
+ }
+ }
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ String aFormattedClassName = className.replace('.', '/');
+ ClassWriter cw = getWriter();
+
+ FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ if (aMethodName.equals("getHarvestTool")) {
+ mv = getWriter().visitMethod(ACC_PUBLIC, "getHarvestTool", "(I)Ljava/lang/String;", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(63, l0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool",
+ "getHarvestTool",
+ "(I)Ljava/lang/String;",
+ false);
+ mv.visitInsn(ARETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("this", "L" + aFormattedClassName + ";", null, l0, l1, 0);
+ mv.visitLocalVariable("aMeta", "I", null, l0, l1, 1);
+ mv.visitMaxs(1, 2);
+ mv.visitEnd();
+ didInject = true;
+ } else if (aMethodName.equals(aName_getItemDropped)) {
+ mv = cw.visitMethod(
+ ACC_PUBLIC, aName_getItemDropped, "(ILjava/util/Random;I)Lnet/minecraft/item/Item;", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(44, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool",
+ "getItemDropped",
+ "(Lnet/minecraft/block/Block;ILjava/util/Random;I)Lnet/minecraft/item/Item;",
+ false);
+ mv.visitInsn(ARETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("this", "L" + aFormattedClassName + ";", null, l0, l1, 0);
+ mv.visitLocalVariable("meta", "I", null, l0, l1, 1);
+ mv.visitLocalVariable("random", "Ljava/util/Random;", null, l0, l1, 2);
+ mv.visitLocalVariable("fortune", "I", null, l0, l1, 3);
+ mv.visitMaxs(4, 4);
+ mv.visitEnd();
+ didInject = true;
+ } else if (aMethodName.equals(aName_damageDropped)) {
+ mv = cw.visitMethod(ACC_PUBLIC, aName_damageDropped, "(I)I", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(48, l0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_GetHarvestTool",
+ "damageDropped",
+ "(I)I",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("this", "L" + aFormattedClassName + ";", null, l0, l1, 0);
+ mv.visitLocalVariable("meta", "I", null, l0, l1, 1);
+ mv.visitMaxs(1, 2);
+ mv.visitEnd();
+ didInject = true;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public final class localClassVisitor extends ClassVisitor {
+
+ String aClassName;
+
+ public localClassVisitor(ClassVisitor cv, String aName) {
+ super(ASM5, cv);
+ aClassName = aName;
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ if (aClassName.equals("ic2.core.block.machine.BlockMachine2")
+ || aClassName.equals("ic2.core.block.machine.BlockMachine3")
+ || aClassName.equals("ic2.core.block.wiring.BlockElectric")) {
+ if (name.equals(aName_getItemDropped)) {
+ methodVisitor = null;
+ } else if (name.equals(aName_damageDropped)) {
+ methodVisitor = null;
+ } else if (name.equals("getHarvestTool")) {
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ } else if (aClassName.equals("ic2.core.block.generator.block.BlockGenerator")
+ || aClassName.equals("ic2.core.block.machine.BlockMachine")) {
+ if (name.equals(aName_damageDropped)) {
+ methodVisitor = null;
+ } else if (name.equals("getHarvestTool")) {
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ } else {
+ if (name.equals("getHarvestTool")) {
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+ }
+ if (methodVisitor == null) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] IC2 getHarvestTool Patch", Level.INFO, "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_Hazmat.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_Hazmat.java
index 10f04e7a48..a3c1d105d7 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_Hazmat.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_IC2_Hazmat.java
@@ -2,146 +2,146 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import org.apache.logging.log4j.Level;
-import org.objectweb.asm.*;
-
import cpw.mods.fml.relauncher.FMLRelaunchLog;
import gtPlusPlus.core.util.minecraft.HazmatUtils;
import net.minecraft.entity.EntityLivingBase;
+import org.apache.logging.log4j.Level;
+import org.objectweb.asm.*;
public class ClassTransformer_IC2_Hazmat {
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
- private final String className;
-
- public static boolean hasCompleteHazmat(EntityLivingBase living) {
- return HazmatUtils.hasCompleteHazmat(living);
- }
-
- public ClassTransformer_IC2_Hazmat(byte[] basicClass, String aClassName) {
- className = aClassName;
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Attempting to patch in mode " + className + ".");
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitor(aTempWriter, className), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- } else {
- isValid = false;
- }
-
- FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Valid patch? " + isValid + ".");
- reader = aTempReader;
- writer = aTempWriter;
-
- if (reader != null && writer != null) {
- FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Attempting Method Injection.");
- injectMethod("hasCompleteHazmat");
- }
-
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(String aMethodName) {
- MethodVisitor mv;
- boolean didInject = false;
- ClassWriter cw = getWriter();
-
- boolean isObf;
- try {
- isObf = Class.forName("net.minecraft.entity.EntityLivingBase") == null;
- } catch (ClassNotFoundException e) {
- isObf = true;
- }
- String aEntityLivingBase = "net/minecraft/entity/EntityLivingBase";
- if (isObf) {
- aEntityLivingBase = "sv";
- }
- FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Method Handler: "+aEntityLivingBase);
-
-
- FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Injecting " + aMethodName + ".");
- if (aMethodName.equals("hasCompleteHazmat")) {
-
- //Bad Local Variable - https://pastebin.com/TUCfdHqS
- /*mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "hasCompleteHazmat", "(L"+aEntityLivingBase+";)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(23, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/HazmatUtils", "hasCompleteHazmat", "(L"+aEntityLivingBase+";)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", "Lic2/core/item/armor/ItemArmorHazmat;", null, l0, l1, 0);
- mv.visitLocalVariable("living", "L"+aEntityLivingBase+";", null, l0, l1, 1);
- mv.visitMaxs(1, 2);
- mv.visitEnd();*/
-
-
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "hasCompleteHazmat", "(L"+aEntityLivingBase+";)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(24, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/HazmatUtils", "hasCompleteHazmat", "(L"+aEntityLivingBase+";)Z", false);
- mv.visitInsn(IRETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("living", "L"+aEntityLivingBase+";", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
- FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Method injection complete.");
- return didInject;
- }
-
- public final class localClassVisitor extends ClassVisitor {
-
- String aClassName;
-
- public localClassVisitor(ClassVisitor cv, String aName) {
- super(ASM5, cv);
- aClassName = aName;
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
-
- if (name.equals("hasCompleteHazmat")) {
- methodVisitor = null;
- } else {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
-
- if (methodVisitor == null) {
- FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO,
- "Found method " + name + ", removing.");
- }
- return methodVisitor;
- }
- }
-
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+ private final String className;
+
+ public static boolean hasCompleteHazmat(EntityLivingBase living) {
+ return HazmatUtils.hasCompleteHazmat(living);
+ }
+
+ public ClassTransformer_IC2_Hazmat(byte[] basicClass, String aClassName) {
+ className = aClassName;
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Attempting to patch in mode " + className + ".");
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitor(aTempWriter, className), 0);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+
+ FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Valid patch? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+
+ if (reader != null && writer != null) {
+ FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Attempting Method Injection.");
+ injectMethod("hasCompleteHazmat");
+ }
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean injectMethod(String aMethodName) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ ClassWriter cw = getWriter();
+
+ boolean isObf;
+ try {
+ isObf = Class.forName("net.minecraft.entity.EntityLivingBase") == null;
+ } catch (ClassNotFoundException e) {
+ isObf = true;
+ }
+ String aEntityLivingBase = "net/minecraft/entity/EntityLivingBase";
+ if (isObf) {
+ aEntityLivingBase = "sv";
+ }
+ FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Method Handler: " + aEntityLivingBase);
+
+ FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ if (aMethodName.equals("hasCompleteHazmat")) {
+
+ // Bad Local Variable - https://pastebin.com/TUCfdHqS
+ /*mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "hasCompleteHazmat", "(L"+aEntityLivingBase+";)Z", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(23, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/core/util/minecraft/HazmatUtils", "hasCompleteHazmat", "(L"+aEntityLivingBase+";)Z", false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("this", "Lic2/core/item/armor/ItemArmorHazmat;", null, l0, l1, 0);
+ mv.visitLocalVariable("living", "L"+aEntityLivingBase+";", null, l0, l1, 1);
+ mv.visitMaxs(1, 2);
+ mv.visitEnd();*/
+
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC, "hasCompleteHazmat", "(L" + aEntityLivingBase + ";)Z", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(24, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/core/util/minecraft/HazmatUtils",
+ "hasCompleteHazmat",
+ "(L" + aEntityLivingBase + ";)Z",
+ false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("living", "L" + aEntityLivingBase + ";", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public final class localClassVisitor extends ClassVisitor {
+
+ String aClassName;
+
+ public localClassVisitor(ClassVisitor cv, String aName) {
+ super(ASM5, cv);
+ aClassName = aName;
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+
+ if (name.equals("hasCompleteHazmat")) {
+ methodVisitor = null;
+ } else {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ }
+
+ if (methodVisitor == null) {
+ FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard.java
index 3ec4426ec1..d968d17ef5 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard.java
@@ -8,9 +8,14 @@ import static org.objectweb.asm.Opcodes.ASM5;
import static org.objectweb.asm.Opcodes.ILOAD;
import static org.objectweb.asm.Opcodes.INVOKESTATIC;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.lang.reflect.Field;
import java.util.HashMap;
-
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.settings.GameSettings;
+import net.minecraft.client.settings.KeyBinding;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -18,261 +23,276 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.settings.GameSettings;
-import net.minecraft.client.settings.KeyBinding;
-
public class ClassTransformer_LWJGL_Keyboard {
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- private static final HashMap<String, String> mBadKeyCache = new HashMap<String, String>();
-
- /**
- * Gets a key's name
- *
- * @param key The key
- * @return a String with the key's human readable name in it or null if the key
- * is unnamed
- */
- public static synchronized String getKeyName(int key) {
- if (init()) {
- String[] aTemp = getKeyName();
- if (key < aTemp.length && key >= 0) {
- return aTemp[key];
- }
- }
- String aCachedValue = mBadKeyCache.get("key-"+key);
- if (aCachedValue == null) {
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Unable to map key code "+key+" to LWJGL keymap.");
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Caching key value to be empty.");
- //mBadKeyCache.put("key-"+key, getKeyName()[0x00]);
- aCachedValue = "FIX!";
- mBadKeyCache.put("key-"+key, aCachedValue);
- trySetClientKey(key);
- }
- return aCachedValue; // Return nothing
- }
-
- public static void trySetClientKey(int aKey) {
- if (Utils.isClient() && ReflectionUtils.doesClassExist("net.minecraft.client.Minecraft")) {
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Trying to set key value to be empty.");
- GameSettings options = Minecraft.getMinecraft().gameSettings;
- KeyBinding[] akeybinding = Minecraft.getMinecraft().gameSettings.keyBindings;
- int i = akeybinding.length;
- for (int j = 0; j < i; ++j) {
- KeyBinding keybinding = akeybinding[j];
- if (keybinding != null && keybinding.getKeyCode() == aKey) {
- options.setOptionKeyBinding(keybinding, 0);
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Set keybind "+aKey+" to 0.");
- break;
- }
- }
- }
- }
-
- @SuppressWarnings("rawtypes")
- private static Class mKeyboard;
- private static Field mKeyName;
-
- @SuppressWarnings("rawtypes")
- private static boolean init() {
- if (mKeyName != null) {
- return true;
- }
- Class aKeyboard = ReflectionUtils.getClass("org.lwjgl.input.Keyboard");
- if (aKeyboard != null) {
- mKeyboard = aKeyboard;
- Field aKeyName = ReflectionUtils.getField(mKeyboard, "keyName");
- if (aKeyName != null) {
- mKeyName = aKeyName;
- }
- }
- return mKeyName != null;
- }
-
- private static String[] getKeyName() {
- if (init()) {
- try {
- Object o = mKeyName.get(null);
- if (o instanceof String[]) {
- String[] y = (String[]) o;
- return y;
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- return new String[] {};
- }
-
- public ClassTransformer_LWJGL_Keyboard(byte[] basicClass, boolean isClientSettings) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- if (!isClientSettings) {
- //gtPlusPlus.preloader.keyboard.BetterKeyboard.init();
- aTempReader.accept(new PatchLWJGL(aTempWriter), 0);
- injectLWJGLPatch(aTempWriter);
- }
- else {
- //gtPlusPlus.preloader.keyboard.BetterKeyboard.init();
- aTempReader.accept(new PatchClientSettings(aTempWriter), 0);
- injectClientSettingPatch(aTempWriter);
- }
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- } else {
- isValid = false;
- }
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Valid? " + isValid + ".");
- reader = aTempReader;
- writer = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- private boolean isClientSettingsObfuscated = false;
-
-
- public boolean injectLWJGLPatch(ClassWriter cw) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO,
- "Injecting " + "getKeyName" + ".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC + ACC_SYNCHRONIZED, "getKeyName", "(I)Ljava/lang/String;", null,
- null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(49, l0);
- mv.visitVarInsn(ILOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard",
- "getKeyName", "(I)Ljava/lang/String;", false);
- mv.visitInsn(ARETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("key", "I", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
-
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Method injection complete.");
- return didInject;
- }
-
-
- public boolean injectClientSettingPatch(ClassWriter cw) {
- MethodVisitor mv;
- boolean didInject = false;
- String aMethodName = this.isClientSettingsObfuscated ? "func_74298_c" : "getKeyDisplayString";
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Injecting " + aMethodName + ".");
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, aMethodName, "(I)Ljava/lang/String;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(130, l0);
- mv.visitVarInsn(ILOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/keyboard/BetterKeyboard", "getKeyDisplayString", "(I)Ljava/lang/String;", false);
- mv.visitInsn(ARETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("p_74298_0_", "I", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Method injection complete.");
- return didInject;
- }
-
-
-
- public class PatchClientSettings extends ClassVisitor {
-
- public PatchClientSettings(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
-
- private final String[] aMethodsToStrip = new String[] { "func_74298_c", "getKeyDisplayString" };
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- boolean found = false;
-
- for (String s : aMethodsToStrip) {
- if (name.equals(s)) {
- if (name.equals(aMethodsToStrip[0])) {
- isClientSettingsObfuscated = true;
- }
- else {
- isClientSettingsObfuscated = false;
- }
- found = true;
- break;
- }
- }
- if (!found) {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- } else {
- methodVisitor = null;
- }
- if (found) {
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Found method " + name + ", removing.");
- }
- return methodVisitor;
- }
-
- }
-
- public class PatchLWJGL extends ClassVisitor {
-
- public PatchLWJGL(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
-
- private final String[] aMethodsToStrip = new String[] { "getKeyName" };
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor;
- boolean found = false;
-
- for (String s : aMethodsToStrip) {
- if (name.equals(s)) {
- found = true;
- break;
- }
- }
- if (!found) {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- } else {
- methodVisitor = null;
- }
- if (found) {
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO,
- "Found method " + name + ", removing.");
- }
- return methodVisitor;
- }
-
- }
-
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ private static final HashMap<String, String> mBadKeyCache = new HashMap<String, String>();
+
+ /**
+ * Gets a key's name
+ *
+ * @param key The key
+ * @return a String with the key's human readable name in it or null if the key
+ * is unnamed
+ */
+ public static synchronized String getKeyName(int key) {
+ if (init()) {
+ String[] aTemp = getKeyName();
+ if (key < aTemp.length && key >= 0) {
+ return aTemp[key];
+ }
+ }
+ String aCachedValue = mBadKeyCache.get("key-" + key);
+ if (aCachedValue == null) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Unable to map key code " + key + " to LWJGL keymap.");
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Caching key value to be empty.");
+ // mBadKeyCache.put("key-"+key, getKeyName()[0x00]);
+ aCachedValue = "FIX!";
+ mBadKeyCache.put("key-" + key, aCachedValue);
+ trySetClientKey(key);
+ }
+ return aCachedValue; // Return nothing
+ }
+
+ public static void trySetClientKey(int aKey) {
+ if (Utils.isClient() && ReflectionUtils.doesClassExist("net.minecraft.client.Minecraft")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Trying to set key value to be empty.");
+ GameSettings options = Minecraft.getMinecraft().gameSettings;
+ KeyBinding[] akeybinding = Minecraft.getMinecraft().gameSettings.keyBindings;
+ int i = akeybinding.length;
+ for (int j = 0; j < i; ++j) {
+ KeyBinding keybinding = akeybinding[j];
+ if (keybinding != null && keybinding.getKeyCode() == aKey) {
+ options.setOptionKeyBinding(keybinding, 0);
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Set keybind " + aKey + " to 0.");
+ break;
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ private static Class mKeyboard;
+
+ private static Field mKeyName;
+
+ @SuppressWarnings("rawtypes")
+ private static boolean init() {
+ if (mKeyName != null) {
+ return true;
+ }
+ Class aKeyboard = ReflectionUtils.getClass("org.lwjgl.input.Keyboard");
+ if (aKeyboard != null) {
+ mKeyboard = aKeyboard;
+ Field aKeyName = ReflectionUtils.getField(mKeyboard, "keyName");
+ if (aKeyName != null) {
+ mKeyName = aKeyName;
+ }
+ }
+ return mKeyName != null;
+ }
+
+ private static String[] getKeyName() {
+ if (init()) {
+ try {
+ Object o = mKeyName.get(null);
+ if (o instanceof String[]) {
+ String[] y = (String[]) o;
+ return y;
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ return new String[] {};
+ }
+
+ public ClassTransformer_LWJGL_Keyboard(byte[] basicClass, boolean isClientSettings) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ if (!isClientSettings) {
+ // gtPlusPlus.preloader.keyboard.BetterKeyboard.init();
+ aTempReader.accept(new PatchLWJGL(aTempWriter), 0);
+ injectLWJGLPatch(aTempWriter);
+ } else {
+ // gtPlusPlus.preloader.keyboard.BetterKeyboard.init();
+ aTempReader.accept(new PatchClientSettings(aTempWriter), 0);
+ injectClientSettingPatch(aTempWriter);
+ }
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ private boolean isClientSettingsObfuscated = false;
+
+ public boolean injectLWJGLPatch(ClassWriter cw) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Injecting " + "getKeyName" + ".");
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC + ACC_SYNCHRONIZED, "getKeyName", "(I)Ljava/lang/String;", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(49, l0);
+ mv.visitVarInsn(ILOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_LWJGL_Keyboard",
+ "getKeyName",
+ "(I)Ljava/lang/String;",
+ false);
+ mv.visitInsn(ARETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("key", "I", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public boolean injectClientSettingPatch(ClassWriter cw) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ String aMethodName = this.isClientSettingsObfuscated ? "func_74298_c" : "getKeyDisplayString";
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Injecting " + aMethodName + ".");
+ mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, aMethodName, "(I)Ljava/lang/String;", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(130, l0);
+ mv.visitVarInsn(ILOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/keyboard/BetterKeyboard",
+ "getKeyDisplayString",
+ "(I)Ljava/lang/String;",
+ false);
+ mv.visitInsn(ARETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("p_74298_0_", "I", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Method injection complete.");
+ return didInject;
+ }
+
+ public class PatchClientSettings extends ClassVisitor {
+
+ public PatchClientSettings(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+
+ private final String[] aMethodsToStrip = new String[] {"func_74298_c", "getKeyDisplayString"};
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ boolean found = false;
+
+ for (String s : aMethodsToStrip) {
+ if (name.equals(s)) {
+ if (name.equals(aMethodsToStrip[0])) {
+ isClientSettingsObfuscated = true;
+ } else {
+ isClientSettingsObfuscated = false;
+ }
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ } else {
+ methodVisitor = null;
+ }
+ if (found) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+ }
+
+ public class PatchLWJGL extends ClassVisitor {
+
+ public PatchLWJGL(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+
+ private final String[] aMethodsToStrip = new String[] {"getKeyName"};
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ boolean found = false;
+
+ for (String s : aMethodsToStrip) {
+ if (name.equals(s)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ } else {
+ methodVisitor = null;
+ }
+ if (found) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidCartHandling.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidCartHandling.java
index bf71582ae7..686f929693 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidCartHandling.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidCartHandling.java
@@ -5,113 +5,109 @@ import static org.objectweb.asm.Opcodes.ACC_PRIVATE;
import static org.objectweb.asm.Opcodes.ACC_STATIC;
import static org.objectweb.asm.Opcodes.ASM5;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.preloader.asm.AsmConfig;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.preloader.asm.AsmConfig;
-
-public class ClassTransformer_Railcraft_FluidCartHandling {
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- //mods.railcraft.common.blocks.machine.gamma.TileFluidLoader
- //mods.railcraft.common.blocks.machine.gamma.TileFluidLoader.TRANSFER_RATE
-
- //mods.railcraft.common.blocks.machine.gamma.TileFluidUnloader
- //mods.railcraft.common.blocks.machine.gamma.TileFluidUnloader.TRANSFER_RATE
-
- public static final int TileFluidLoader_RATE = 20;
- public static final int TileFluidUnloader_RATE = 80;
-
- private static final int TYPE_LOADER = 0;
- private static final int TYPE_UNLOADER = 1;
-
- public ClassTransformer_Railcraft_FluidCartHandling(byte[] basicClass, boolean obfuscated, String aClassName) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
- boolean aLoader = aClassName.equals("mods.railcraft.common.blocks.machine.gamma.TileFluidLoader");
-
- FMLRelaunchLog.log("[GT++ ASM] Railcraft TRANSFER_RATE Patch", Level.INFO, "Attempting to patch field TRANSFER_RATE in "+aClassName+", default value is "+(aLoader ? 20 : 80));
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
-
- if (aLoader) {
- aTempReader.accept(new AddFieldAdapter(aTempWriter), 0);
- addField(ACC_PRIVATE + ACC_FINAL + ACC_STATIC, "TRANSFER_RATE", aTempWriter, TYPE_LOADER);
- }
- else {
- aTempReader.accept(new AddFieldAdapter(aTempWriter), 0);
- addField(ACC_PRIVATE + ACC_FINAL + ACC_STATIC, "TRANSFER_RATE", aTempWriter, TYPE_UNLOADER);
- }
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- FMLRelaunchLog.log("[GT++ ASM] Railcraft TRANSFER_RATE Patch", Level.INFO, "Valid? "+isValid+".");
- }
- else {
- isValid = false;
- }
- reader = aTempReader;
- writer = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean addField(int access, String fieldName, ClassWriter cv, int aType) {
- int aValue = (aType == TYPE_LOADER ? AsmConfig.maxRailcraftFluidLoaderFlow : AsmConfig.maxRailcraftFluidUnloaderFlow);
- FMLRelaunchLog.log("[GT++ ASM] Railcraft TRANSFER_RATE Patch", Level.INFO, "Injecting " + fieldName + " with new value: "+aValue);
- FieldVisitor fv = cv.visitField(access, fieldName, "I", null, new Integer(aValue));
- if (fv != null) {
- fv.visitEnd();
- return true;
- }
- return false;
- }
-
-
-
-
- public class AddFieldAdapter extends ClassVisitor {
-
- public AddFieldAdapter(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
-
- @Override
- public FieldVisitor visitField(
- int access, String name, String desc, String signature, Object value) {
- if (name.equals("TRANSFER_RATE") && desc.equals("I")) {
- FMLRelaunchLog.log("[GT++ ASM] Railcraft TRANSFER_RATE Patch", Level.INFO, "Removing "+"TRANSFER_RATE"+".");
- return null;
- }
- else {
- FMLRelaunchLog.log("[GT++ ASM] Railcraft TRANSFER_RATE Patch", Level.INFO, "Found Field "+name+" | "+desc);
- }
- return cv.visitField(access, name, desc, signature, value);
- }
-
- }
-
-
-
-
-
-
+public class ClassTransformer_Railcraft_FluidCartHandling {
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ // mods.railcraft.common.blocks.machine.gamma.TileFluidLoader
+ // mods.railcraft.common.blocks.machine.gamma.TileFluidLoader.TRANSFER_RATE
+
+ // mods.railcraft.common.blocks.machine.gamma.TileFluidUnloader
+ // mods.railcraft.common.blocks.machine.gamma.TileFluidUnloader.TRANSFER_RATE
+
+ public static final int TileFluidLoader_RATE = 20;
+ public static final int TileFluidUnloader_RATE = 80;
+
+ private static final int TYPE_LOADER = 0;
+ private static final int TYPE_UNLOADER = 1;
+
+ public ClassTransformer_Railcraft_FluidCartHandling(byte[] basicClass, boolean obfuscated, String aClassName) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ boolean aLoader = aClassName.equals("mods.railcraft.common.blocks.machine.gamma.TileFluidLoader");
+
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft TRANSFER_RATE Patch",
+ Level.INFO,
+ "Attempting to patch field TRANSFER_RATE in " + aClassName + ", default value is "
+ + (aLoader ? 20 : 80));
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+
+ if (aLoader) {
+ aTempReader.accept(new AddFieldAdapter(aTempWriter), 0);
+ addField(ACC_PRIVATE + ACC_FINAL + ACC_STATIC, "TRANSFER_RATE", aTempWriter, TYPE_LOADER);
+ } else {
+ aTempReader.accept(new AddFieldAdapter(aTempWriter), 0);
+ addField(ACC_PRIVATE + ACC_FINAL + ACC_STATIC, "TRANSFER_RATE", aTempWriter, TYPE_UNLOADER);
+ }
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ FMLRelaunchLog.log("[GT++ ASM] Railcraft TRANSFER_RATE Patch", Level.INFO, "Valid? " + isValid + ".");
+ } else {
+ isValid = false;
+ }
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean addField(int access, String fieldName, ClassWriter cv, int aType) {
+ int aValue = (aType == TYPE_LOADER
+ ? AsmConfig.maxRailcraftFluidLoaderFlow
+ : AsmConfig.maxRailcraftFluidUnloaderFlow);
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft TRANSFER_RATE Patch",
+ Level.INFO,
+ "Injecting " + fieldName + " with new value: " + aValue);
+ FieldVisitor fv = cv.visitField(access, fieldName, "I", null, new Integer(aValue));
+ if (fv != null) {
+ fv.visitEnd();
+ return true;
+ }
+ return false;
+ }
+
+ public class AddFieldAdapter extends ClassVisitor {
+
+ public AddFieldAdapter(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+
+ @Override
+ public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
+ if (name.equals("TRANSFER_RATE") && desc.equals("I")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft TRANSFER_RATE Patch", Level.INFO, "Removing " + "TRANSFER_RATE" + ".");
+ return null;
+ } else {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft TRANSFER_RATE Patch", Level.INFO, "Found Field " + name + " | " + desc);
+ }
+ return cv.visitField(access, name, desc, signature, value);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidHelper.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidHelper.java
index 1249df0777..98e964f69d 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidHelper.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_FluidHelper.java
@@ -2,8 +2,10 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.preloader.asm.AsmConfig;
import java.lang.reflect.Method;
-
+import net.minecraft.inventory.IInventory;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -12,684 +14,1026 @@ import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.preloader.asm.AsmConfig;
-import net.minecraft.inventory.IInventory;
+public class ClassTransformer_Railcraft_FluidHelper {
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ public static int PROCESS_VOLUME;
+
+ public ClassTransformer_Railcraft_FluidHelper(byte[] basicClass, boolean obfuscated2) {
+
+ PROCESS_VOLUME = AsmConfig.maxRailcraftTankProcessVolume;
+
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft PROCESS_VOLUME Patch",
+ Level.INFO,
+ "Attempting to patch field PROCESS_VOLUME in mods.railcraft.common.fluids.FluidHelper with new value: "
+ + PROCESS_VOLUME);
+
+ boolean obfuscated = false;
+ boolean a1 = false;
+ boolean a2 = false;
+
+ // Find Non-Obf method
+ try {
+ Method aGetStackInSlot = IInventory.class.getDeclaredMethod("getStackInSlot", int.class);
+ if (aGetStackInSlot != null) {
+ a1 = true;
+ }
+ } catch (NoSuchMethodException | SecurityException e) {
+ }
+
+ // Find Obf method
+ try {
+ Method aGetStackInSlotObf = IInventory.class.getDeclaredMethod("func_70301_a", int.class);
+ if (aGetStackInSlotObf != null) {
+ a2 = true;
+ }
+ } catch (NoSuchMethodException | SecurityException e) {
+ }
+
+ if (a1) {
+ obfuscated = false;
+ } else if (a2) {
+ obfuscated = true;
+ } else {
+ // Fallback
+ obfuscated = false;
+ }
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft PROCESS_VOLUME Patch",
+ Level.INFO,
+ "Are we patching obfuscated methods? " + obfuscated);
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new AddFieldAdapter(aTempWriter), 0);
+
+ addField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "PROCESS_VOLUME", aTempWriter);
+ injectMethod("fillContainers", aTempWriter, obfuscated);
+ injectMethod("drainContainers", aTempWriter, obfuscated);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+
+ FMLRelaunchLog.log("[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean addField(int access, String fieldName, ClassWriter cv) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Injecting " + fieldName + " with new value.");
+ FieldVisitor fv = cv.visitField(access, fieldName, "I", null, PROCESS_VOLUME);
+ if (fv != null) {
+ fv.visitEnd();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean injectMethod(String aMethodName, ClassWriter cw, boolean obfuscated) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log("[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Injecting " + aMethodName + ".");
+
+ if (aMethodName.equals("fillContainers") && !obfuscated) {
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "fillContainers",
+ "(Lnet/minecraftforge/fluids/IFluidHandler;Lnet/minecraft/inventory/IInventory;IILnet/minecraftforge/fluids/Fluid;)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(126, l0);
+ mv.visitVarInsn(ALOAD, 4);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(127, l2);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(128, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraft/inventory/IInventory",
+ "getStackInSlot",
+ "(I)Lnet/minecraft/item/ItemStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(129, l3);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraft/inventory/IInventory",
+ "getStackInSlot",
+ "(I)Lnet/minecraft/item/ItemStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 6);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(130, l4);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitIntInsn(SIPUSH, PROCESS_VOLUME);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "<init>",
+ "(Lnet/minecraftforge/fluids/Fluid;I)V",
+ false);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidItemHelper",
+ "fillContainer",
+ "(Lnet/minecraft/item/ItemStack;Lnet/minecraftforge/fluids/FluidStack;)Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;",
+ false);
+ mv.visitVarInsn(ASTORE, 7);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(131, l5);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNULL, l6);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidHelper",
+ "hasPlaceToPutContainer",
+ "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l6);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(132, l7);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/util/ForgeDirection",
+ "UNKNOWN",
+ "Lnet/minecraftforge/common/util/ForgeDirection;");
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraftforge/fluids/IFluidHandler",
+ "drain",
+ "(Lnet/minecraftforge/common/util/ForgeDirection;IZ)Lnet/minecraftforge/fluids/FluidStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 8);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(133, l8);
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitJumpInsn(IFNULL, l6);
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
+ mv.visitJumpInsn(IF_ICMPNE, l6);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(134, l9);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidItemHelper",
+ "fillContainer",
+ "(Lnet/minecraft/item/ItemStack;Lnet/minecraftforge/fluids/FluidStack;)Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;",
+ false);
+ mv.visitVarInsn(ASTORE, 7);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(135, l10);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ Label l11 = new Label();
+ mv.visitJumpInsn(IFNULL, l11);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitJumpInsn(IF_ICMPNE, l11);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLineNumber(136, l12);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/util/ForgeDirection",
+ "UNKNOWN",
+ "Lnet/minecraftforge/common/util/ForgeDirection;");
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
+ mv.visitInsn(ICONST_1);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraftforge/fluids/IFluidHandler",
+ "drain",
+ "(Lnet/minecraftforge/common/util/ForgeDirection;IZ)Lnet/minecraftforge/fluids/FluidStack;",
+ true);
+ mv.visitInsn(POP);
+ Label l13 = new Label();
+ mv.visitLabel(l13);
+ mv.visitLineNumber(137, l13);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidHelper",
+ "storeContainer",
+ "(Lnet/minecraft/inventory/IInventory;IILnet/minecraft/item/ItemStack;)V",
+ false);
+ mv.visitLabel(l11);
+ mv.visitLineNumber(139, l11);
+ mv.visitFrame(
+ F_FULL,
+ 9,
+ new Object[] {
+ "net/minecraftforge/fluids/IFluidHandler",
+ "net/minecraft/inventory/IInventory",
+ INTEGER,
+ INTEGER,
+ "net/minecraftforge/fluids/Fluid",
+ "net/minecraft/item/ItemStack",
+ "net/minecraft/item/ItemStack",
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "net/minecraftforge/fluids/FluidStack"
+ },
+ 0,
+ new Object[] {});
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(142, l6);
+ mv.visitFrame(F_CHOP, 1, null, 0, null);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(IRETURN);
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLocalVariable("drain", "Lnet/minecraftforge/fluids/FluidStack;", null, l8, l6, 8);
+ mv.visitLocalVariable("fluidHandler", "Lnet/minecraftforge/fluids/IFluidHandler;", null, l0, l14, 0);
+ mv.visitLocalVariable("inv", "Lnet/minecraft/inventory/IInventory;", null, l0, l14, 1);
+ mv.visitLocalVariable("inputSlot", "I", null, l0, l14, 2);
+ mv.visitLocalVariable("outputSlot", "I", null, l0, l14, 3);
+ mv.visitLocalVariable("fluidToFill", "Lnet/minecraftforge/fluids/Fluid;", null, l0, l14, 4);
+ mv.visitLocalVariable("input", "Lnet/minecraft/item/ItemStack;", null, l3, l14, 5);
+ mv.visitLocalVariable("output", "Lnet/minecraft/item/ItemStack;", null, l4, l14, 6);
+ mv.visitLocalVariable(
+ "fill", "Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;", null, l5, l14, 7);
+ mv.visitMaxs(5, 9);
+ mv.visitEnd();
+ didInject = true;
+ } else if (aMethodName.equals("fillContainers") && obfuscated) {
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "fillContainers",
+ "(Lnet/minecraftforge/fluids/IFluidHandler;Lnet/minecraft/inventory/IInventory;IILnet/minecraftforge/fluids/Fluid;)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(126, l0);
+ mv.visitVarInsn(ALOAD, 4);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(127, l2);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(128, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraft/inventory/IInventory",
+ "func_70301_a",
+ "(I)Lnet/minecraft/item/ItemStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(129, l3);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraft/inventory/IInventory",
+ "func_70301_a",
+ "(I)Lnet/minecraft/item/ItemStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 6);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(130, l4);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
+ mv.visitInsn(DUP);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitIntInsn(SIPUSH, PROCESS_VOLUME);
+ mv.visitMethodInsn(
+ INVOKESPECIAL,
+ "net/minecraftforge/fluids/FluidStack",
+ "<init>",
+ "(Lnet/minecraftforge/fluids/Fluid;I)V",
+ false);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidItemHelper",
+ "fillContainer",
+ "(Lnet/minecraft/item/ItemStack;Lnet/minecraftforge/fluids/FluidStack;)Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;",
+ false);
+ mv.visitVarInsn(ASTORE, 7);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(131, l5);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNULL, l6);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidHelper",
+ "hasPlaceToPutContainer",
+ "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l6);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(132, l7);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/util/ForgeDirection",
+ "UNKNOWN",
+ "Lnet/minecraftforge/common/util/ForgeDirection;");
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraftforge/fluids/IFluidHandler",
+ "drain",
+ "(Lnet/minecraftforge/common/util/ForgeDirection;IZ)Lnet/minecraftforge/fluids/FluidStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 8);
+ Label l8 = new Label();
+ mv.visitLabel(l8);
+ mv.visitLineNumber(133, l8);
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitJumpInsn(IFNULL, l6);
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
+ mv.visitJumpInsn(IF_ICMPNE, l6);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(134, l9);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidItemHelper",
+ "fillContainer",
+ "(Lnet/minecraft/item/ItemStack;Lnet/minecraftforge/fluids/FluidStack;)Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;",
+ false);
+ mv.visitVarInsn(ASTORE, 7);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(135, l10);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ Label l11 = new Label();
+ mv.visitJumpInsn(IFNULL, l11);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
+ mv.visitVarInsn(ALOAD, 8);
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitJumpInsn(IF_ICMPNE, l11);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLineNumber(136, l12);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/util/ForgeDirection",
+ "UNKNOWN",
+ "Lnet/minecraftforge/common/util/ForgeDirection;");
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
+ mv.visitInsn(ICONST_1);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraftforge/fluids/IFluidHandler",
+ "drain",
+ "(Lnet/minecraftforge/common/util/ForgeDirection;IZ)Lnet/minecraftforge/fluids/FluidStack;",
+ true);
+ mv.visitInsn(POP);
+ Label l13 = new Label();
+ mv.visitLabel(l13);
+ mv.visitLineNumber(137, l13);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitVarInsn(ALOAD, 7);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidHelper",
+ "storeContainer",
+ "(Lnet/minecraft/inventory/IInventory;IILnet/minecraft/item/ItemStack;)V",
+ false);
+ mv.visitLabel(l11);
+ mv.visitLineNumber(139, l11);
+ mv.visitFrame(
+ F_FULL,
+ 9,
+ new Object[] {
+ "net/minecraftforge/fluids/IFluidHandler",
+ "net/minecraft/inventory/IInventory",
+ INTEGER,
+ INTEGER,
+ "net/minecraftforge/fluids/Fluid",
+ "net/minecraft/item/ItemStack",
+ "net/minecraft/item/ItemStack",
+ "mods/railcraft/common/fluids/FluidItemHelper$FillReturn",
+ "net/minecraftforge/fluids/FluidStack"
+ },
+ 0,
+ new Object[] {});
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(142, l6);
+ mv.visitFrame(F_CHOP, 1, null, 0, null);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(IRETURN);
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLocalVariable("drain", "Lnet/minecraftforge/fluids/FluidStack;", null, l8, l6, 8);
+ mv.visitLocalVariable("fluidHandler", "Lnet/minecraftforge/fluids/IFluidHandler;", null, l0, l14, 0);
+ mv.visitLocalVariable("inv", "Lnet/minecraft/inventory/IInventory;", null, l0, l14, 1);
+ mv.visitLocalVariable("inputSlot", "I", null, l0, l14, 2);
+ mv.visitLocalVariable("outputSlot", "I", null, l0, l14, 3);
+ mv.visitLocalVariable("fluidToFill", "Lnet/minecraftforge/fluids/Fluid;", null, l0, l14, 4);
+ mv.visitLocalVariable("input", "Lnet/minecraft/item/ItemStack;", null, l3, l14, 5);
+ mv.visitLocalVariable("output", "Lnet/minecraft/item/ItemStack;", null, l4, l14, 6);
+ mv.visitLocalVariable(
+ "fill", "Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;", null, l5, l14, 7);
+ mv.visitMaxs(5, 9);
+ mv.visitEnd();
+ didInject = true;
+ } else if (aMethodName.equals("drainContainers") && !obfuscated) {
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "drainContainers",
+ "(Lnet/minecraftforge/fluids/IFluidHandler;Lnet/minecraft/inventory/IInventory;II)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(146, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraft/inventory/IInventory",
+ "getStackInSlot",
+ "(I)Lnet/minecraft/item/ItemStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 4);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(147, l1);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraft/inventory/IInventory",
+ "getStackInSlot",
+ "(I)Lnet/minecraft/item/ItemStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(148, l2);
+ mv.visitVarInsn(ALOAD, 4);
+ Label l3 = new Label();
+ mv.visitJumpInsn(IFNULL, l3);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(149, l4);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitIntInsn(SIPUSH, PROCESS_VOLUME);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidItemHelper",
+ "drainContainer",
+ "(Lnet/minecraft/item/ItemStack;I)Lmods/railcraft/common/fluids/FluidItemHelper$DrainReturn;",
+ false);
+ mv.visitVarInsn(ASTORE, 6);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(150, l5);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitJumpInsn(IFNULL, l3);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNULL, l6);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidHelper",
+ "hasPlaceToPutContainer",
+ "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l3);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(151, l6);
+ mv.visitFrame(
+ F_APPEND,
+ 3,
+ new Object[] {
+ "net/minecraft/item/ItemStack",
+ "net/minecraft/item/ItemStack",
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn"
+ },
+ 0,
+ null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/util/ForgeDirection",
+ "UNKNOWN",
+ "Lnet/minecraftforge/common/util/ForgeDirection;");
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraftforge/fluids/IFluidHandler",
+ "fill",
+ "(Lnet/minecraftforge/common/util/ForgeDirection;Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ true);
+ mv.visitVarInsn(ISTORE, 7);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(152, l7);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "isAtomic", "Z");
+ Label l8 = new Label();
+ mv.visitJumpInsn(IFEQ, l8);
+ mv.visitVarInsn(ILOAD, 7);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ Label l9 = new Label();
+ mv.visitJumpInsn(IF_ICMPEQ, l9);
+ mv.visitLabel(l8);
+ mv.visitFrame(F_APPEND, 1, new Object[] {INTEGER}, 0, null);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "isAtomic", "Z");
+ mv.visitJumpInsn(IFNE, l3);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitJumpInsn(IFLE, l3);
+ mv.visitLabel(l9);
+ mv.visitLineNumber(153, l9);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/util/ForgeDirection",
+ "UNKNOWN",
+ "Lnet/minecraftforge/common/util/ForgeDirection;");
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitInsn(ICONST_1);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraftforge/fluids/IFluidHandler",
+ "fill",
+ "(Lnet/minecraftforge/common/util/ForgeDirection;Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ true);
+ mv.visitInsn(POP);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(154, l10);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidHelper",
+ "storeContainer",
+ "(Lnet/minecraft/inventory/IInventory;IILnet/minecraft/item/ItemStack;)V",
+ false);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(155, l11);
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(159, l3);
+ mv.visitFrame(F_CHOP, 2, null, 0, null);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(IRETURN);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLocalVariable("used", "I", null, l7, l3, 7);
+ mv.visitLocalVariable(
+ "drain", "Lmods/railcraft/common/fluids/FluidItemHelper$DrainReturn;", null, l5, l3, 6);
+ mv.visitLocalVariable("fluidHandler", "Lnet/minecraftforge/fluids/IFluidHandler;", null, l0, l12, 0);
+ mv.visitLocalVariable("inv", "Lnet/minecraft/inventory/IInventory;", null, l0, l12, 1);
+ mv.visitLocalVariable("inputSlot", "I", null, l0, l12, 2);
+ mv.visitLocalVariable("outputSlot", "I", null, l0, l12, 3);
+ mv.visitLocalVariable("input", "Lnet/minecraft/item/ItemStack;", null, l1, l12, 4);
+ mv.visitLocalVariable("output", "Lnet/minecraft/item/ItemStack;", null, l2, l12, 5);
+ mv.visitMaxs(4, 8);
+ mv.visitEnd();
+ didInject = true;
+ } else if (aMethodName.equals("drainContainers") && obfuscated) {
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "drainContainers",
+ "(Lnet/minecraftforge/fluids/IFluidHandler;Lnet/minecraft/inventory/IInventory;II)Z",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(146, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraft/inventory/IInventory",
+ "func_70301_a",
+ "(I)Lnet/minecraft/item/ItemStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 4);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(147, l1);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraft/inventory/IInventory",
+ "func_70301_a",
+ "(I)Lnet/minecraft/item/ItemStack;",
+ true);
+ mv.visitVarInsn(ASTORE, 5);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(148, l2);
+ mv.visitVarInsn(ALOAD, 4);
+ Label l3 = new Label();
+ mv.visitJumpInsn(IFNULL, l3);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(149, l4);
+ mv.visitVarInsn(ALOAD, 4);
+ mv.visitIntInsn(SIPUSH, PROCESS_VOLUME);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidItemHelper",
+ "drainContainer",
+ "(Lnet/minecraft/item/ItemStack;I)Lmods/railcraft/common/fluids/FluidItemHelper$DrainReturn;",
+ false);
+ mv.visitVarInsn(ASTORE, 6);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(150, l5);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitJumpInsn(IFNULL, l3);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ Label l6 = new Label();
+ mv.visitJumpInsn(IFNULL, l6);
+ mv.visitVarInsn(ALOAD, 5);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidHelper",
+ "hasPlaceToPutContainer",
+ "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l3);
+ mv.visitLabel(l6);
+ mv.visitLineNumber(151, l6);
+ mv.visitFrame(
+ F_APPEND,
+ 3,
+ new Object[] {
+ "net/minecraft/item/ItemStack",
+ "net/minecraft/item/ItemStack",
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn"
+ },
+ 0,
+ null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/util/ForgeDirection",
+ "UNKNOWN",
+ "Lnet/minecraftforge/common/util/ForgeDirection;");
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraftforge/fluids/IFluidHandler",
+ "fill",
+ "(Lnet/minecraftforge/common/util/ForgeDirection;Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ true);
+ mv.visitVarInsn(ISTORE, 7);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(152, l7);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "isAtomic", "Z");
+ Label l8 = new Label();
+ mv.visitJumpInsn(IFEQ, l8);
+ mv.visitVarInsn(ILOAD, 7);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ Label l9 = new Label();
+ mv.visitJumpInsn(IF_ICMPEQ, l9);
+ mv.visitLabel(l8);
+ mv.visitFrame(F_APPEND, 1, new Object[] {INTEGER}, 0, null);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "isAtomic", "Z");
+ mv.visitJumpInsn(IFNE, l3);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
+ mv.visitJumpInsn(IFLE, l3);
+ mv.visitLabel(l9);
+ mv.visitLineNumber(153, l9);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "net/minecraftforge/common/util/ForgeDirection",
+ "UNKNOWN",
+ "Lnet/minecraftforge/common/util/ForgeDirection;");
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "fluidDrained",
+ "Lnet/minecraftforge/fluids/FluidStack;");
+ mv.visitInsn(ICONST_1);
+ mv.visitMethodInsn(
+ INVOKEINTERFACE,
+ "net/minecraftforge/fluids/IFluidHandler",
+ "fill",
+ "(Lnet/minecraftforge/common/util/ForgeDirection;Lnet/minecraftforge/fluids/FluidStack;Z)I",
+ true);
+ mv.visitInsn(POP);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(154, l10);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitVarInsn(ALOAD, 6);
+ mv.visitFieldInsn(
+ GETFIELD,
+ "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn",
+ "container",
+ "Lnet/minecraft/item/ItemStack;");
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "mods/railcraft/common/fluids/FluidHelper",
+ "storeContainer",
+ "(Lnet/minecraft/inventory/IInventory;IILnet/minecraft/item/ItemStack;)V",
+ false);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(155, l11);
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(159, l3);
+ mv.visitFrame(F_CHOP, 2, null, 0, null);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(IRETURN);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLocalVariable("used", "I", null, l7, l3, 7);
+ mv.visitLocalVariable(
+ "drain", "Lmods/railcraft/common/fluids/FluidItemHelper$DrainReturn;", null, l5, l3, 6);
+ mv.visitLocalVariable("fluidHandler", "Lnet/minecraftforge/fluids/IFluidHandler;", null, l0, l12, 0);
+ mv.visitLocalVariable("inv", "Lnet/minecraft/inventory/IInventory;", null, l0, l12, 1);
+ mv.visitLocalVariable("inputSlot", "I", null, l0, l12, 2);
+ mv.visitLocalVariable("outputSlot", "I", null, l0, l12, 3);
+ mv.visitLocalVariable("input", "Lnet/minecraft/item/ItemStack;", null, l1, l12, 4);
+ mv.visitLocalVariable("output", "Lnet/minecraft/item/ItemStack;", null, l2, l12, 5);
+ mv.visitMaxs(4, 8);
+ mv.visitEnd();
+ didInject = true;
+ }
-public class ClassTransformer_Railcraft_FluidHelper {
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- public static int PROCESS_VOLUME;
-
- public ClassTransformer_Railcraft_FluidHelper(byte[] basicClass, boolean obfuscated2) {
-
- PROCESS_VOLUME = AsmConfig.maxRailcraftTankProcessVolume;
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- FMLRelaunchLog.log("[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Attempting to patch field PROCESS_VOLUME in mods.railcraft.common.fluids.FluidHelper with new value: "+PROCESS_VOLUME);
-
- boolean obfuscated = false;
- boolean a1 = false;
- boolean a2 = false;
-
- //Find Non-Obf method
- try {
- Method aGetStackInSlot = IInventory.class.getDeclaredMethod("getStackInSlot", int.class);
- if (aGetStackInSlot != null) {
- a1 = true;
- }
- } catch (NoSuchMethodException | SecurityException e) {}
-
- //Find Obf method
- try {
- Method aGetStackInSlotObf = IInventory.class.getDeclaredMethod("func_70301_a", int.class);
- if (aGetStackInSlotObf != null) {
- a2 = true;
- }
- } catch (NoSuchMethodException | SecurityException e) {}
-
-
- if (a1) {
- obfuscated = false;
- }
- else if (a2) {
- obfuscated = true;
- }
- else {
- //Fallback
- obfuscated = false;
- }
- FMLRelaunchLog.log("[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Are we patching obfuscated methods? "+obfuscated);
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new AddFieldAdapter(aTempWriter), 0);
-
- addField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "PROCESS_VOLUME", aTempWriter);
- injectMethod("fillContainers", aTempWriter, obfuscated);
- injectMethod("drainContainers", aTempWriter, obfuscated);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
-
- FMLRelaunchLog.log("[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Valid? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean addField(int access, String fieldName, ClassWriter cv) {
- FMLRelaunchLog.log(
- "[GT++ ASM] Railcraft PROCESS_VOLUME Patch",
- Level.INFO,
- "Injecting " + fieldName + " with new value.");
- FieldVisitor fv = cv.visitField(access, fieldName, "I", null, PROCESS_VOLUME);
- if (fv != null) {
- fv.visitEnd();
- return true;
- }
- return false;
- }
-
- public boolean injectMethod(String aMethodName, ClassWriter cw, boolean obfuscated) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Injecting " + aMethodName + ".");
-
- if (aMethodName.equals("fillContainers") && !obfuscated) {
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "fillContainers", "(Lnet/minecraftforge/fluids/IFluidHandler;Lnet/minecraft/inventory/IInventory;IILnet/minecraftforge/fluids/Fluid;)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(126, l0);
- mv.visitVarInsn(ALOAD, 4);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNONNULL, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(127, l2);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l1);
- mv.visitLineNumber(128, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraft/inventory/IInventory", "getStackInSlot", "(I)Lnet/minecraft/item/ItemStack;", true);
- mv.visitVarInsn(ASTORE, 5);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(129, l3);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraft/inventory/IInventory", "getStackInSlot", "(I)Lnet/minecraft/item/ItemStack;", true);
- mv.visitVarInsn(ASTORE, 6);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(130, l4);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitIntInsn(SIPUSH, PROCESS_VOLUME);
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/FluidStack", "<init>", "(Lnet/minecraftforge/fluids/Fluid;I)V", false);
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidItemHelper", "fillContainer", "(Lnet/minecraft/item/ItemStack;Lnet/minecraftforge/fluids/FluidStack;)Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;", false);
- mv.visitVarInsn(ASTORE, 7);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(131, l5);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "container", "Lnet/minecraft/item/ItemStack;");
- Label l6 = new Label();
- mv.visitJumpInsn(IFNULL, l6);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "container", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidHelper", "hasPlaceToPutContainer", "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z", false);
- mv.visitJumpInsn(IFEQ, l6);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(132, l7);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/util/ForgeDirection", "UNKNOWN", "Lnet/minecraftforge/common/util/ForgeDirection;");
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraftforge/fluids/IFluidHandler", "drain", "(Lnet/minecraftforge/common/util/ForgeDirection;IZ)Lnet/minecraftforge/fluids/FluidStack;", true);
- mv.visitVarInsn(ASTORE, 8);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(133, l8);
- mv.visitVarInsn(ALOAD, 8);
- mv.visitJumpInsn(IFNULL, l6);
- mv.visitVarInsn(ALOAD, 8);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
- mv.visitJumpInsn(IF_ICMPNE, l6);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(134, l9);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 8);
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidItemHelper", "fillContainer", "(Lnet/minecraft/item/ItemStack;Lnet/minecraftforge/fluids/FluidStack;)Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;", false);
- mv.visitVarInsn(ASTORE, 7);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(135, l10);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "container", "Lnet/minecraft/item/ItemStack;");
- Label l11 = new Label();
- mv.visitJumpInsn(IFNULL, l11);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
- mv.visitVarInsn(ALOAD, 8);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitJumpInsn(IF_ICMPNE, l11);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLineNumber(136, l12);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/util/ForgeDirection", "UNKNOWN", "Lnet/minecraftforge/common/util/ForgeDirection;");
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
- mv.visitInsn(ICONST_1);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraftforge/fluids/IFluidHandler", "drain", "(Lnet/minecraftforge/common/util/ForgeDirection;IZ)Lnet/minecraftforge/fluids/FluidStack;", true);
- mv.visitInsn(POP);
- Label l13 = new Label();
- mv.visitLabel(l13);
- mv.visitLineNumber(137, l13);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "container", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidHelper", "storeContainer", "(Lnet/minecraft/inventory/IInventory;IILnet/minecraft/item/ItemStack;)V", false);
- mv.visitLabel(l11);
- mv.visitLineNumber(139, l11);
- mv.visitFrame(F_FULL, 9, new Object[] {"net/minecraftforge/fluids/IFluidHandler", "net/minecraft/inventory/IInventory", INTEGER, INTEGER, "net/minecraftforge/fluids/Fluid", "net/minecraft/item/ItemStack", "net/minecraft/item/ItemStack", "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "net/minecraftforge/fluids/FluidStack"}, 0, new Object[] {});
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l6);
- mv.visitLineNumber(142, l6);
- mv.visitFrame(F_CHOP,1, null, 0, null);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(IRETURN);
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLocalVariable("drain", "Lnet/minecraftforge/fluids/FluidStack;", null, l8, l6, 8);
- mv.visitLocalVariable("fluidHandler", "Lnet/minecraftforge/fluids/IFluidHandler;", null, l0, l14, 0);
- mv.visitLocalVariable("inv", "Lnet/minecraft/inventory/IInventory;", null, l0, l14, 1);
- mv.visitLocalVariable("inputSlot", "I", null, l0, l14, 2);
- mv.visitLocalVariable("outputSlot", "I", null, l0, l14, 3);
- mv.visitLocalVariable("fluidToFill", "Lnet/minecraftforge/fluids/Fluid;", null, l0, l14, 4);
- mv.visitLocalVariable("input", "Lnet/minecraft/item/ItemStack;", null, l3, l14, 5);
- mv.visitLocalVariable("output", "Lnet/minecraft/item/ItemStack;", null, l4, l14, 6);
- mv.visitLocalVariable("fill", "Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;", null, l5, l14, 7);
- mv.visitMaxs(5, 9);
- mv.visitEnd();
- didInject = true;
- }
- else if (aMethodName.equals("fillContainers") && obfuscated) {
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "fillContainers", "(Lnet/minecraftforge/fluids/IFluidHandler;Lnet/minecraft/inventory/IInventory;IILnet/minecraftforge/fluids/Fluid;)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(126, l0);
- mv.visitVarInsn(ALOAD, 4);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNONNULL, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(127, l2);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l1);
- mv.visitLineNumber(128, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraft/inventory/IInventory", "func_70301_a", "(I)Lnet/minecraft/item/ItemStack;", true);
- mv.visitVarInsn(ASTORE, 5);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(129, l3);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraft/inventory/IInventory", "func_70301_a", "(I)Lnet/minecraft/item/ItemStack;", true);
- mv.visitVarInsn(ASTORE, 6);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(130, l4);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitTypeInsn(NEW, "net/minecraftforge/fluids/FluidStack");
- mv.visitInsn(DUP);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitIntInsn(SIPUSH, PROCESS_VOLUME);
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/FluidStack", "<init>", "(Lnet/minecraftforge/fluids/Fluid;I)V", false);
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidItemHelper", "fillContainer", "(Lnet/minecraft/item/ItemStack;Lnet/minecraftforge/fluids/FluidStack;)Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;", false);
- mv.visitVarInsn(ASTORE, 7);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(131, l5);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "container", "Lnet/minecraft/item/ItemStack;");
- Label l6 = new Label();
- mv.visitJumpInsn(IFNULL, l6);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "container", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidHelper", "hasPlaceToPutContainer", "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z", false);
- mv.visitJumpInsn(IFEQ, l6);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(132, l7);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/util/ForgeDirection", "UNKNOWN", "Lnet/minecraftforge/common/util/ForgeDirection;");
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraftforge/fluids/IFluidHandler", "drain", "(Lnet/minecraftforge/common/util/ForgeDirection;IZ)Lnet/minecraftforge/fluids/FluidStack;", true);
- mv.visitVarInsn(ASTORE, 8);
- Label l8 = new Label();
- mv.visitLabel(l8);
- mv.visitLineNumber(133, l8);
- mv.visitVarInsn(ALOAD, 8);
- mv.visitJumpInsn(IFNULL, l6);
- mv.visitVarInsn(ALOAD, 8);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
- mv.visitJumpInsn(IF_ICMPNE, l6);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(134, l9);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 8);
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidItemHelper", "fillContainer", "(Lnet/minecraft/item/ItemStack;Lnet/minecraftforge/fluids/FluidStack;)Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;", false);
- mv.visitVarInsn(ASTORE, 7);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(135, l10);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "container", "Lnet/minecraft/item/ItemStack;");
- Label l11 = new Label();
- mv.visitJumpInsn(IFNULL, l11);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
- mv.visitVarInsn(ALOAD, 8);
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitJumpInsn(IF_ICMPNE, l11);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLineNumber(136, l12);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/util/ForgeDirection", "UNKNOWN", "Lnet/minecraftforge/common/util/ForgeDirection;");
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "amount", "I");
- mv.visitInsn(ICONST_1);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraftforge/fluids/IFluidHandler", "drain", "(Lnet/minecraftforge/common/util/ForgeDirection;IZ)Lnet/minecraftforge/fluids/FluidStack;", true);
- mv.visitInsn(POP);
- Label l13 = new Label();
- mv.visitLabel(l13);
- mv.visitLineNumber(137, l13);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitVarInsn(ALOAD, 7);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "container", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidHelper", "storeContainer", "(Lnet/minecraft/inventory/IInventory;IILnet/minecraft/item/ItemStack;)V", false);
- mv.visitLabel(l11);
- mv.visitLineNumber(139, l11);
- mv.visitFrame(F_FULL, 9, new Object[] {"net/minecraftforge/fluids/IFluidHandler", "net/minecraft/inventory/IInventory", INTEGER, INTEGER, "net/minecraftforge/fluids/Fluid", "net/minecraft/item/ItemStack", "net/minecraft/item/ItemStack", "mods/railcraft/common/fluids/FluidItemHelper$FillReturn", "net/minecraftforge/fluids/FluidStack"}, 0, new Object[] {});
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l6);
- mv.visitLineNumber(142, l6);
- mv.visitFrame(F_CHOP,1, null, 0, null);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(IRETURN);
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLocalVariable("drain", "Lnet/minecraftforge/fluids/FluidStack;", null, l8, l6, 8);
- mv.visitLocalVariable("fluidHandler", "Lnet/minecraftforge/fluids/IFluidHandler;", null, l0, l14, 0);
- mv.visitLocalVariable("inv", "Lnet/minecraft/inventory/IInventory;", null, l0, l14, 1);
- mv.visitLocalVariable("inputSlot", "I", null, l0, l14, 2);
- mv.visitLocalVariable("outputSlot", "I", null, l0, l14, 3);
- mv.visitLocalVariable("fluidToFill", "Lnet/minecraftforge/fluids/Fluid;", null, l0, l14, 4);
- mv.visitLocalVariable("input", "Lnet/minecraft/item/ItemStack;", null, l3, l14, 5);
- mv.visitLocalVariable("output", "Lnet/minecraft/item/ItemStack;", null, l4, l14, 6);
- mv.visitLocalVariable("fill", "Lmods/railcraft/common/fluids/FluidItemHelper$FillReturn;", null, l5, l14, 7);
- mv.visitMaxs(5, 9);
- mv.visitEnd();
- didInject = true;
- }
- else if (aMethodName.equals("drainContainers") && !obfuscated) {
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "drainContainers", "(Lnet/minecraftforge/fluids/IFluidHandler;Lnet/minecraft/inventory/IInventory;II)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(146, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraft/inventory/IInventory", "getStackInSlot", "(I)Lnet/minecraft/item/ItemStack;", true);
- mv.visitVarInsn(ASTORE, 4);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(147, l1);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraft/inventory/IInventory", "getStackInSlot", "(I)Lnet/minecraft/item/ItemStack;", true);
- mv.visitVarInsn(ASTORE, 5);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(148, l2);
- mv.visitVarInsn(ALOAD, 4);
- Label l3 = new Label();
- mv.visitJumpInsn(IFNULL, l3);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(149, l4);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitIntInsn(SIPUSH, PROCESS_VOLUME);
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidItemHelper", "drainContainer", "(Lnet/minecraft/item/ItemStack;I)Lmods/railcraft/common/fluids/FluidItemHelper$DrainReturn;", false);
- mv.visitVarInsn(ASTORE, 6);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(150, l5);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitJumpInsn(IFNULL, l3);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "container", "Lnet/minecraft/item/ItemStack;");
- Label l6 = new Label();
- mv.visitJumpInsn(IFNULL, l6);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "container", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidHelper", "hasPlaceToPutContainer", "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z", false);
- mv.visitJumpInsn(IFEQ, l3);
- mv.visitLabel(l6);
- mv.visitLineNumber(151, l6);
- mv.visitFrame(F_APPEND,3, new Object[] {"net/minecraft/item/ItemStack", "net/minecraft/item/ItemStack", "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn"}, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/util/ForgeDirection", "UNKNOWN", "Lnet/minecraftforge/common/util/ForgeDirection;");
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraftforge/fluids/IFluidHandler", "fill", "(Lnet/minecraftforge/common/util/ForgeDirection;Lnet/minecraftforge/fluids/FluidStack;Z)I", true);
- mv.visitVarInsn(ISTORE, 7);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(152, l7);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "isAtomic", "Z");
- Label l8 = new Label();
- mv.visitJumpInsn(IFEQ, l8);
- mv.visitVarInsn(ILOAD, 7);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- Label l9 = new Label();
- mv.visitJumpInsn(IF_ICMPEQ, l9);
- mv.visitLabel(l8);
- mv.visitFrame(F_APPEND,1, new Object[] {INTEGER}, 0, null);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "isAtomic", "Z");
- mv.visitJumpInsn(IFNE, l3);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitJumpInsn(IFLE, l3);
- mv.visitLabel(l9);
- mv.visitLineNumber(153, l9);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/util/ForgeDirection", "UNKNOWN", "Lnet/minecraftforge/common/util/ForgeDirection;");
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitInsn(ICONST_1);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraftforge/fluids/IFluidHandler", "fill", "(Lnet/minecraftforge/common/util/ForgeDirection;Lnet/minecraftforge/fluids/FluidStack;Z)I", true);
- mv.visitInsn(POP);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(154, l10);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "container", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidHelper", "storeContainer", "(Lnet/minecraft/inventory/IInventory;IILnet/minecraft/item/ItemStack;)V", false);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(155, l11);
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l3);
- mv.visitLineNumber(159, l3);
- mv.visitFrame(F_CHOP,2, null, 0, null);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(IRETURN);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLocalVariable("used", "I", null, l7, l3, 7);
- mv.visitLocalVariable("drain", "Lmods/railcraft/common/fluids/FluidItemHelper$DrainReturn;", null, l5, l3, 6);
- mv.visitLocalVariable("fluidHandler", "Lnet/minecraftforge/fluids/IFluidHandler;", null, l0, l12, 0);
- mv.visitLocalVariable("inv", "Lnet/minecraft/inventory/IInventory;", null, l0, l12, 1);
- mv.visitLocalVariable("inputSlot", "I", null, l0, l12, 2);
- mv.visitLocalVariable("outputSlot", "I", null, l0, l12, 3);
- mv.visitLocalVariable("input", "Lnet/minecraft/item/ItemStack;", null, l1, l12, 4);
- mv.visitLocalVariable("output", "Lnet/minecraft/item/ItemStack;", null, l2, l12, 5);
- mv.visitMaxs(4, 8);
- mv.visitEnd();
- didInject = true;
- }
- else if (aMethodName.equals("drainContainers") && obfuscated) {
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "drainContainers", "(Lnet/minecraftforge/fluids/IFluidHandler;Lnet/minecraft/inventory/IInventory;II)Z", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(146, l0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraft/inventory/IInventory", "func_70301_a", "(I)Lnet/minecraft/item/ItemStack;", true);
- mv.visitVarInsn(ASTORE, 4);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(147, l1);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraft/inventory/IInventory", "func_70301_a", "(I)Lnet/minecraft/item/ItemStack;", true);
- mv.visitVarInsn(ASTORE, 5);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(148, l2);
- mv.visitVarInsn(ALOAD, 4);
- Label l3 = new Label();
- mv.visitJumpInsn(IFNULL, l3);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(149, l4);
- mv.visitVarInsn(ALOAD, 4);
- mv.visitIntInsn(SIPUSH, PROCESS_VOLUME);
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidItemHelper", "drainContainer", "(Lnet/minecraft/item/ItemStack;I)Lmods/railcraft/common/fluids/FluidItemHelper$DrainReturn;", false);
- mv.visitVarInsn(ASTORE, 6);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(150, l5);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitJumpInsn(IFNULL, l3);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "container", "Lnet/minecraft/item/ItemStack;");
- Label l6 = new Label();
- mv.visitJumpInsn(IFNULL, l6);
- mv.visitVarInsn(ALOAD, 5);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "container", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidHelper", "hasPlaceToPutContainer", "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z", false);
- mv.visitJumpInsn(IFEQ, l3);
- mv.visitLabel(l6);
- mv.visitLineNumber(151, l6);
- mv.visitFrame(F_APPEND,3, new Object[] {"net/minecraft/item/ItemStack", "net/minecraft/item/ItemStack", "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn"}, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/util/ForgeDirection", "UNKNOWN", "Lnet/minecraftforge/common/util/ForgeDirection;");
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraftforge/fluids/IFluidHandler", "fill", "(Lnet/minecraftforge/common/util/ForgeDirection;Lnet/minecraftforge/fluids/FluidStack;Z)I", true);
- mv.visitVarInsn(ISTORE, 7);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(152, l7);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "isAtomic", "Z");
- Label l8 = new Label();
- mv.visitJumpInsn(IFEQ, l8);
- mv.visitVarInsn(ILOAD, 7);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- Label l9 = new Label();
- mv.visitJumpInsn(IF_ICMPEQ, l9);
- mv.visitLabel(l8);
- mv.visitFrame(F_APPEND,1, new Object[] {INTEGER}, 0, null);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "isAtomic", "Z");
- mv.visitJumpInsn(IFNE, l3);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitFieldInsn(GETFIELD, "net/minecraftforge/fluids/FluidStack", "amount", "I");
- mv.visitJumpInsn(IFLE, l3);
- mv.visitLabel(l9);
- mv.visitLineNumber(153, l9);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETSTATIC, "net/minecraftforge/common/util/ForgeDirection", "UNKNOWN", "Lnet/minecraftforge/common/util/ForgeDirection;");
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "fluidDrained", "Lnet/minecraftforge/fluids/FluidStack;");
- mv.visitInsn(ICONST_1);
- mv.visitMethodInsn(INVOKEINTERFACE, "net/minecraftforge/fluids/IFluidHandler", "fill", "(Lnet/minecraftforge/common/util/ForgeDirection;Lnet/minecraftforge/fluids/FluidStack;Z)I", true);
- mv.visitInsn(POP);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(154, l10);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitVarInsn(ALOAD, 6);
- mv.visitFieldInsn(GETFIELD, "mods/railcraft/common/fluids/FluidItemHelper$DrainReturn", "container", "Lnet/minecraft/item/ItemStack;");
- mv.visitMethodInsn(INVOKESTATIC, "mods/railcraft/common/fluids/FluidHelper", "storeContainer", "(Lnet/minecraft/inventory/IInventory;IILnet/minecraft/item/ItemStack;)V", false);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(155, l11);
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l3);
- mv.visitLineNumber(159, l3);
- mv.visitFrame(F_CHOP,2, null, 0, null);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(IRETURN);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLocalVariable("used", "I", null, l7, l3, 7);
- mv.visitLocalVariable("drain", "Lmods/railcraft/common/fluids/FluidItemHelper$DrainReturn;", null, l5, l3, 6);
- mv.visitLocalVariable("fluidHandler", "Lnet/minecraftforge/fluids/IFluidHandler;", null, l0, l12, 0);
- mv.visitLocalVariable("inv", "Lnet/minecraft/inventory/IInventory;", null, l0, l12, 1);
- mv.visitLocalVariable("inputSlot", "I", null, l0, l12, 2);
- mv.visitLocalVariable("outputSlot", "I", null, l0, l12, 3);
- mv.visitLocalVariable("input", "Lnet/minecraft/item/ItemStack;", null, l1, l12, 4);
- mv.visitLocalVariable("output", "Lnet/minecraft/item/ItemStack;", null, l2, l12, 5);
- mv.visitMaxs(4, 8);
- mv.visitEnd();
- didInject = true;
- }
-
- FMLRelaunchLog.log("[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Method injection complete. "+(obfuscated ? "Obfuscated" : "Non-Obfuscated"));
- return didInject;
- }
-
-
-
-
-
-
-
-
-
- public class AddFieldAdapter extends ClassVisitor {
-
- public AddFieldAdapter(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
-
- @Override
- public FieldVisitor visitField(
- int access, String name, String desc, String signature, Object value) {
- if (name.equals("PROCESS_VOLUME") && desc.equals("I")) {
- FMLRelaunchLog.log("[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Removing "+"PROCESS_VOLUME"+".");
- return null;
- }
- return cv.visitField(access, name, desc, signature, value);
- }
-
-
- private final String[] aMethodsToStrip = new String[] {"fillContainers", "drainContainers"};
-
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
-
- MethodVisitor methodVisitor;
- boolean found = false;
-
- for (String s : aMethodsToStrip) {
- if (name.equals(s)) {
- found = true;
- break;
- }
- }
- if (!found) {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- else {
- methodVisitor = null;
- }
-
- if (found) {
- FMLRelaunchLog.log("[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO,
- "Found method " + name + ", removing.");
- }
- return methodVisitor;
- }
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft PROCESS_VOLUME Patch",
+ Level.INFO,
+ "Method injection complete. " + (obfuscated ? "Obfuscated" : "Non-Obfuscated"));
+ return didInject;
+ }
+ public class AddFieldAdapter extends ClassVisitor {
- }
+ public AddFieldAdapter(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+ @Override
+ public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
+ if (name.equals("PROCESS_VOLUME") && desc.equals("I")) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft PROCESS_VOLUME Patch", Level.INFO, "Removing " + "PROCESS_VOLUME" + ".");
+ return null;
+ }
+ return cv.visitField(access, name, desc, signature, value);
+ }
+ private final String[] aMethodsToStrip = new String[] {"fillContainers", "drainContainers"};
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ boolean found = false;
+ for (String s : aMethodsToStrip) {
+ if (name.equals(s)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ } else {
+ methodVisitor = null;
+ }
+ if (found) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft PROCESS_VOLUME Patch",
+ Level.INFO,
+ "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_InvTools.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_InvTools.java
index 75896c1c0f..a74cb97500 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_InvTools.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_InvTools.java
@@ -7,8 +7,12 @@ import static org.objectweb.asm.Opcodes.ARETURN;
import static org.objectweb.asm.Opcodes.ASM5;
import static org.objectweb.asm.Opcodes.INVOKESTATIC;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gregtech.api.enums.GT_Values;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import java.lang.reflect.Method;
-
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -16,220 +20,210 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gregtech.api.enums.GT_Values;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-
-public class ClassTransformer_Railcraft_InvTools {
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
- private boolean obfuscated = true;
-
-
- public static ItemStack depleteItem(ItemStack stack) {
- if (stack == null) {
- return GT_Values.NI;
- } else {
- if (stack.stackSize == 0) {
- return GT_Values.NI;
- }
- else if (stack.stackSize == 1) {
- ItemStack container = stack.getItem().getContainerItem(stack);
- if (container != null) {
- return container;
- } else {
- return GT_Values.NI;
- }
- }
- else {
- return ItemUtils.depleteStack(stack);
- }
- }
- }
-
- public ClassTransformer_Railcraft_InvTools(byte[] basicClass, boolean obfuscated2) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- boolean devEnv = false;
- boolean a1 = false;
- boolean a2 = false;
-
- //Find Non-Obf method
- try {
- Method aGetStackInSlot = IInventory.class.getDeclaredMethod("getStackInSlot", int.class);
- if (aGetStackInSlot != null) {
- a1 = true;
- }
- } catch (NoSuchMethodException | SecurityException e) {}
-
- //Find Obf method
- try {
- Method aGetStackInSlotObf = IInventory.class.getDeclaredMethod("func_70301_a", int.class);
- if (aGetStackInSlotObf != null) {
- a2 = true;
- }
- } catch (NoSuchMethodException | SecurityException e) {}
-
-
- if (a1) {
- devEnv = false;
- }
- else if (a2) {
- devEnv = true;
- }
- else {
- //Fallback
- devEnv = false;
- }
-
- if (obfuscated && devEnv) {
-
- }
- else {
-
-
- }
-
-
-
- FMLRelaunchLog.log("[GT++ ASM] Railcraft negative ItemStack Fix", Level.INFO, "Are we patching obfuscated method? "+obfuscated);
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new AddFieldAdapter(aTempWriter), 0);
-
- injectMethod("depleteItem", aTempWriter, obfuscated);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
-
- FMLRelaunchLog.log("[GT++ ASM] Railcraft negative ItemStack Fix", Level.INFO, "Valid? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(String aMethodName, ClassWriter cw, boolean obfuscated) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Railcraft negative ItemStack Fix", Level.INFO, "Injecting " + aMethodName + ".");
- if (aMethodName.equals("depleteItem") && !obfuscated) {
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "depleteItem", "(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(36, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_InvTools", "depleteItem", "(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;", false);
- mv.visitInsn(ARETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("stack", "Lnet/minecraft/item/ItemStack;", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
- else if (aMethodName.equals("depleteItem") && obfuscated) {
- mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "depleteItem", "(Ladd;)Ladd;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(36, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_InvTools", "depleteItem", "(Ladd;)Ladd;", false);
- mv.visitInsn(ARETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("stack", "Ladd;", null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- }
- FMLRelaunchLog.log("[GT++ ASM] Railcraft negative ItemStack Fix", Level.INFO, "Method injection complete. "+(obfuscated ? "Obfuscated" : "Non-Obfuscated"));
- return didInject;
- }
-
-
-
-
-
-
-
-
-
- public class AddFieldAdapter extends ClassVisitor {
-
- public AddFieldAdapter(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
-
- private final String[] aMethodsToStrip = new String[] {"depleteItem"};
-
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
-
- MethodVisitor methodVisitor;
- boolean found = false;
-
- for (String s : aMethodsToStrip) {
- if (name.equals(s)) {
- found = true;
- break;
- }
- }
- if (!found) {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- else {
- if (desc.equals("(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;")) {
- obfuscated = false;
- }
- else if (desc.equals("(Ladd;)Ladd;")) {
- obfuscated = true;
- }
- else {
- obfuscated = false;
- }
- FMLRelaunchLog.log("[GT++ ASM] Railcraft negative ItemStack Fix", Level.INFO,
- "Method desc " + desc + ", using "+(obfuscated ? "obfuscated method handler" : "deobfuscated method handler"));
- methodVisitor = null;
- }
-
- if (found) {
- FMLRelaunchLog.log("[GT++ ASM] Railcraft negative ItemStack Fix", Level.INFO,
- "Found method " + name + ", removing.");
- }
- return methodVisitor;
- }
-
-
- }
-
-
-
-
-
-
+public class ClassTransformer_Railcraft_InvTools {
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+ private boolean obfuscated = true;
+
+ public static ItemStack depleteItem(ItemStack stack) {
+ if (stack == null) {
+ return GT_Values.NI;
+ } else {
+ if (stack.stackSize == 0) {
+ return GT_Values.NI;
+ } else if (stack.stackSize == 1) {
+ ItemStack container = stack.getItem().getContainerItem(stack);
+ if (container != null) {
+ return container;
+ } else {
+ return GT_Values.NI;
+ }
+ } else {
+ return ItemUtils.depleteStack(stack);
+ }
+ }
+ }
+
+ public ClassTransformer_Railcraft_InvTools(byte[] basicClass, boolean obfuscated2) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ boolean devEnv = false;
+ boolean a1 = false;
+ boolean a2 = false;
+
+ // Find Non-Obf method
+ try {
+ Method aGetStackInSlot = IInventory.class.getDeclaredMethod("getStackInSlot", int.class);
+ if (aGetStackInSlot != null) {
+ a1 = true;
+ }
+ } catch (NoSuchMethodException | SecurityException e) {
+ }
+
+ // Find Obf method
+ try {
+ Method aGetStackInSlotObf = IInventory.class.getDeclaredMethod("func_70301_a", int.class);
+ if (aGetStackInSlotObf != null) {
+ a2 = true;
+ }
+ } catch (NoSuchMethodException | SecurityException e) {
+ }
+
+ if (a1) {
+ devEnv = false;
+ } else if (a2) {
+ devEnv = true;
+ } else {
+ // Fallback
+ devEnv = false;
+ }
+
+ if (obfuscated && devEnv) {
+
+ } else {
+
+ }
+
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft negative ItemStack Fix",
+ Level.INFO,
+ "Are we patching obfuscated method? " + obfuscated);
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new AddFieldAdapter(aTempWriter), 0);
+
+ injectMethod("depleteItem", aTempWriter, obfuscated);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+
+ FMLRelaunchLog.log("[GT++ ASM] Railcraft negative ItemStack Fix", Level.INFO, "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean injectMethod(String aMethodName, ClassWriter cw, boolean obfuscated) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log("[GT++ ASM] Railcraft negative ItemStack Fix", Level.INFO, "Injecting " + aMethodName + ".");
+ if (aMethodName.equals("depleteItem") && !obfuscated) {
+ mv = cw.visitMethod(
+ ACC_PUBLIC + ACC_STATIC,
+ "depleteItem",
+ "(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(36, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_InvTools",
+ "depleteItem",
+ "(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;",
+ false);
+ mv.visitInsn(ARETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("stack", "Lnet/minecraft/item/ItemStack;", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ } else if (aMethodName.equals("depleteItem") && obfuscated) {
+ mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "depleteItem", "(Ladd;)Ladd;", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(36, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_Railcraft_InvTools",
+ "depleteItem",
+ "(Ladd;)Ladd;",
+ false);
+ mv.visitInsn(ARETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("stack", "Ladd;", null, l0, l1, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ }
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft negative ItemStack Fix",
+ Level.INFO,
+ "Method injection complete. " + (obfuscated ? "Obfuscated" : "Non-Obfuscated"));
+ return didInject;
+ }
+
+ public class AddFieldAdapter extends ClassVisitor {
+
+ public AddFieldAdapter(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+
+ private final String[] aMethodsToStrip = new String[] {"depleteItem"};
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+
+ MethodVisitor methodVisitor;
+ boolean found = false;
+
+ for (String s : aMethodsToStrip) {
+ if (name.equals(s)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ } else {
+ if (desc.equals("(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;")) {
+ obfuscated = false;
+ } else if (desc.equals("(Ladd;)Ladd;")) {
+ obfuscated = true;
+ } else {
+ obfuscated = false;
+ }
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft negative ItemStack Fix",
+ Level.INFO,
+ "Method desc " + desc + ", using "
+ + (obfuscated ? "obfuscated method handler" : "deobfuscated method handler"));
+ methodVisitor = null;
+ }
+
+ if (found) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Railcraft negative ItemStack Fix",
+ Level.INFO,
+ "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java
index 8f65709478..c73b97aa6d 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java
@@ -32,6 +32,8 @@ import static org.objectweb.asm.Opcodes.LDIV;
import static org.objectweb.asm.Opcodes.LREM;
import static org.objectweb.asm.Opcodes.NEW;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.preloader.DevHelper;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.ClassReader;
@@ -40,239 +42,277 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.preloader.DevHelper;
-
-public class ClassTransformer_TC_ItemWispEssence {
-
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- public ClassTransformer_TC_ItemWispEssence(byte[] basicClass, boolean obfuscated2) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
- boolean obfuscated = obfuscated2;
- FMLRelaunchLog.log("[GT++ ASM] Thaumcraft WispEssence_Patch", Level.INFO, "Are we patching obfuscated methods? "+obfuscated);
- String aGetColour = obfuscated ? DevHelper.getSRG("getColorFromItemStack") : "getColorFromItemStack";
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new AddAdapter(aTempWriter, new String[] {"getAspects", aGetColour}), 0);
- injectMethod("getAspects", aTempWriter, obfuscated);
- injectMethod(aGetColour, aTempWriter, obfuscated);
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- FMLRelaunchLog.log("[GT++ ASM] Thaumcraft WispEssence_Patch", Level.INFO, "Valid? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethod(String aMethodName, ClassWriter cw, boolean obfuscated) {
- MethodVisitor mv;
- boolean didInject = false;
- FMLRelaunchLog.log("[GT++ ASM] Thaumcraft WispEssence_Patch", Level.INFO, "Injecting " + aMethodName + ".");
+public class ClassTransformer_TC_ItemWispEssence {
- String aGetColour = obfuscated ? "func_82790_a" : "getColorFromItemStack";
- String aHasTagCompound = obfuscated ? "func_77942_o" : "hasTagCompound";
- String aGetTagCompound = obfuscated ? "func_77978_p" : "getTagCompound";
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
- if (aMethodName.equals("getAspects")) {
- mv = cw.visitMethod(ACC_PUBLIC, "getAspects", "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(141, l0);
- mv.visitVarInsn(ALOAD, 1);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNONNULL, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(142, l2);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(ARETURN);
- mv.visitLabel(l1);
- mv.visitLineNumber(144, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", aHasTagCompound, "()Z", false);
- Label l3 = new Label();
- mv.visitJumpInsn(IFEQ, l3);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(145, l4);
- mv.visitTypeInsn(NEW, "thaumcraft/api/aspects/AspectList");
- mv.visitInsn(DUP);
- mv.visitMethodInsn(INVOKESPECIAL, "thaumcraft/api/aspects/AspectList", "<init>", "()V", false);
- mv.visitVarInsn(ASTORE, 2);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(146, l5);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", aGetTagCompound, "()Lnet/minecraft/nbt/NBTTagCompound;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/AspectList", "readFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", false);
- Label l6 = new Label();
- mv.visitLabel(l6);
- mv.visitLineNumber(147, l6);
- mv.visitVarInsn(ALOAD, 2);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/AspectList", "size", "()I", false);
- Label l7 = new Label();
- mv.visitJumpInsn(IFLE, l7);
- mv.visitVarInsn(ALOAD, 2);
- Label l8 = new Label();
- mv.visitJumpInsn(GOTO, l8);
- mv.visitLabel(l7);
- mv.visitFrame(F_APPEND,1, new Object[] {"thaumcraft/api/aspects/AspectList"}, 0, null);
- mv.visitInsn(ACONST_NULL);
- mv.visitLabel(l8);
- mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {"thaumcraft/api/aspects/AspectList"});
- mv.visitInsn(ARETURN);
- mv.visitLabel(l3);
- mv.visitLineNumber(149, l3);
- mv.visitFrame(F_CHOP,1, null, 0, null);
- mv.visitInsn(ACONST_NULL);
- mv.visitInsn(ARETURN);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLocalVariable("this", "LgtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence;", null, l0, l9, 0);
- mv.visitLocalVariable("itemstack", "Lnet/minecraft/item/ItemStack;", null, l0, l9, 1);
- mv.visitLocalVariable("aspects", "Lthaumcraft/api/aspects/AspectList;", null, l5, l3, 2);
- mv.visitMaxs(2, 3);
- mv.visitEnd();
- didInject = true;
- }
- else if (aMethodName.equals(aGetColour)) {
+ public ClassTransformer_TC_ItemWispEssence(byte[] basicClass, boolean obfuscated2) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ boolean obfuscated = obfuscated2;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Thaumcraft WispEssence_Patch",
+ Level.INFO,
+ "Are we patching obfuscated methods? " + obfuscated);
+ String aGetColour = obfuscated ? DevHelper.getSRG("getColorFromItemStack") : "getColorFromItemStack";
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new AddAdapter(aTempWriter, new String[] {"getAspects", aGetColour}), 0);
+ injectMethod("getAspects", aTempWriter, obfuscated);
+ injectMethod(aGetColour, aTempWriter, obfuscated);
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] Thaumcraft WispEssence_Patch", Level.INFO, "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
- //thaumcraft/common/items/ItemWispEssence
- mv = cw.visitMethod(ACC_PUBLIC, aGetColour, "(Lnet/minecraft/item/ItemStack;I)I", null, null);
- AnnotationVisitor av0;
- {
- av0 = mv.visitAnnotation("Lcpw/mods/fml/relauncher/SideOnly;", true);
- av0.visitEnum("value", "Lcpw/mods/fml/relauncher/Side;", "CLIENT");
- av0.visitEnd();
- }
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(197, l0);
- mv.visitVarInsn(ALOAD, 1);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNONNULL, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(198, l2);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l1);
- mv.visitLineNumber(200, l1);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/common/items/ItemWispEssence", "getAspects", "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;", false);
- Label l3 = new Label();
- mv.visitJumpInsn(IFNULL, l3);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(201, l4);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/common/items/ItemWispEssence", "getAspects", "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/AspectList", "getAspects", "()[Lthaumcraft/api/aspects/Aspect;", false);
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/Aspect", "getColor", "()I", false);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l3);
- mv.visitLineNumber(203, l3);
- mv.visitFrame(F_SAME, 0, null, 0, null);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/System", "currentTimeMillis", "()J", false);
- mv.visitLdcInsn(new Long(500L));
- mv.visitInsn(LDIV);
- mv.visitFieldInsn(GETSTATIC, "thaumcraft/common/items/ItemWispEssence", "displayAspects", "[Lthaumcraft/api/aspects/Aspect;");
- mv.visitInsn(ARRAYLENGTH);
- mv.visitInsn(I2L);
- mv.visitInsn(LREM);
- mv.visitInsn(L2I);
- mv.visitVarInsn(ISTORE, 3);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(204, l5);
- mv.visitFieldInsn(GETSTATIC, "thaumcraft/common/items/ItemWispEssence", "displayAspects", "[Lthaumcraft/api/aspects/Aspect;");
- mv.visitVarInsn(ILOAD, 3);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/Aspect", "getColor", "()I", false);
- mv.visitInsn(IRETURN);
- Label l6 = new Label();
- mv.visitLabel(l6);
- mv.visitLocalVariable("this", "Lthaumcraft/common/items/ItemWispEssence;", null, l0, l6, 0);
- mv.visitLocalVariable("stack", "Lnet/minecraft/item/ItemStack;", null, l0, l6, 1);
- mv.visitLocalVariable("par2", "I", null, l0, l6, 2);
- mv.visitLocalVariable("idx", "I", null, l5, l6, 3);
- mv.visitMaxs(4, 4);
- mv.visitEnd();
- didInject = true;
- }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- FMLRelaunchLog.log("[GT++ ASM] Thaumcraft WispEssence_Patch", Level.INFO, "Method injection complete. "+(obfuscated ? "Obfuscated" : "Non-Obfuscated"));
- return didInject;
- }
+ public ClassReader getReader() {
+ return reader;
+ }
- public class AddAdapter extends ClassVisitor {
+ public ClassWriter getWriter() {
+ return writer;
+ }
- public AddAdapter(ClassVisitor cv, String[] aMethods) {
- super(ASM5, cv);
- this.cv = cv;
- this.aMethodsToStrip = aMethods;
- }
+ public boolean injectMethod(String aMethodName, ClassWriter cw, boolean obfuscated) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ FMLRelaunchLog.log("[GT++ ASM] Thaumcraft WispEssence_Patch", Level.INFO, "Injecting " + aMethodName + ".");
- private final String[] aMethodsToStrip;
+ String aGetColour = obfuscated ? "func_82790_a" : "getColorFromItemStack";
+ String aHasTagCompound = obfuscated ? "func_77942_o" : "hasTagCompound";
+ String aGetTagCompound = obfuscated ? "func_77978_p" : "getTagCompound";
+ if (aMethodName.equals("getAspects")) {
+ mv = cw.visitMethod(
+ ACC_PUBLIC,
+ "getAspects",
+ "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;",
+ null,
+ null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(141, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(142, l2);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(144, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", aHasTagCompound, "()Z", false);
+ Label l3 = new Label();
+ mv.visitJumpInsn(IFEQ, l3);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(145, l4);
+ mv.visitTypeInsn(NEW, "thaumcraft/api/aspects/AspectList");
+ mv.visitInsn(DUP);
+ mv.visitMethodInsn(INVOKESPECIAL, "thaumcraft/api/aspects/AspectList", "<init>", "()V", false);
+ mv.visitVarInsn(ASTORE, 2);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(146, l5);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "net/minecraft/item/ItemStack",
+ aGetTagCompound,
+ "()Lnet/minecraft/nbt/NBTTagCompound;",
+ false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "thaumcraft/api/aspects/AspectList",
+ "readFromNBT",
+ "(Lnet/minecraft/nbt/NBTTagCompound;)V",
+ false);
+ Label l6 = new Label();
+ mv.visitLabel(l6);
+ mv.visitLineNumber(147, l6);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/AspectList", "size", "()I", false);
+ Label l7 = new Label();
+ mv.visitJumpInsn(IFLE, l7);
+ mv.visitVarInsn(ALOAD, 2);
+ Label l8 = new Label();
+ mv.visitJumpInsn(GOTO, l8);
+ mv.visitLabel(l7);
+ mv.visitFrame(F_APPEND, 1, new Object[] {"thaumcraft/api/aspects/AspectList"}, 0, null);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitLabel(l8);
+ mv.visitFrame(F_SAME1, 0, null, 1, new Object[] {"thaumcraft/api/aspects/AspectList"});
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(149, l3);
+ mv.visitFrame(F_CHOP, 1, null, 0, null);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLocalVariable(
+ "this",
+ "LgtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence;",
+ null,
+ l0,
+ l9,
+ 0);
+ mv.visitLocalVariable("itemstack", "Lnet/minecraft/item/ItemStack;", null, l0, l9, 1);
+ mv.visitLocalVariable("aspects", "Lthaumcraft/api/aspects/AspectList;", null, l5, l3, 2);
+ mv.visitMaxs(2, 3);
+ mv.visitEnd();
+ didInject = true;
+ } else if (aMethodName.equals(aGetColour)) {
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ // thaumcraft/common/items/ItemWispEssence
+ mv = cw.visitMethod(ACC_PUBLIC, aGetColour, "(Lnet/minecraft/item/ItemStack;I)I", null, null);
+ AnnotationVisitor av0;
+ {
+ av0 = mv.visitAnnotation("Lcpw/mods/fml/relauncher/SideOnly;", true);
+ av0.visitEnum("value", "Lcpw/mods/fml/relauncher/Side;", "CLIENT");
+ av0.visitEnd();
+ }
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(197, l0);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(198, l2);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l1);
+ mv.visitLineNumber(200, l1);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "thaumcraft/common/items/ItemWispEssence",
+ "getAspects",
+ "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;",
+ false);
+ Label l3 = new Label();
+ mv.visitJumpInsn(IFNULL, l3);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(201, l4);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "thaumcraft/common/items/ItemWispEssence",
+ "getAspects",
+ "(Lnet/minecraft/item/ItemStack;)Lthaumcraft/api/aspects/AspectList;",
+ false);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL,
+ "thaumcraft/api/aspects/AspectList",
+ "getAspects",
+ "()[Lthaumcraft/api/aspects/Aspect;",
+ false);
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/Aspect", "getColor", "()I", false);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(203, l3);
+ mv.visitFrame(F_SAME, 0, null, 0, null);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/System", "currentTimeMillis", "()J", false);
+ mv.visitLdcInsn(new Long(500L));
+ mv.visitInsn(LDIV);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "thaumcraft/common/items/ItemWispEssence",
+ "displayAspects",
+ "[Lthaumcraft/api/aspects/Aspect;");
+ mv.visitInsn(ARRAYLENGTH);
+ mv.visitInsn(I2L);
+ mv.visitInsn(LREM);
+ mv.visitInsn(L2I);
+ mv.visitVarInsn(ISTORE, 3);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(204, l5);
+ mv.visitFieldInsn(
+ GETSTATIC,
+ "thaumcraft/common/items/ItemWispEssence",
+ "displayAspects",
+ "[Lthaumcraft/api/aspects/Aspect;");
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/api/aspects/Aspect", "getColor", "()I", false);
+ mv.visitInsn(IRETURN);
+ Label l6 = new Label();
+ mv.visitLabel(l6);
+ mv.visitLocalVariable("this", "Lthaumcraft/common/items/ItemWispEssence;", null, l0, l6, 0);
+ mv.visitLocalVariable("stack", "Lnet/minecraft/item/ItemStack;", null, l0, l6, 1);
+ mv.visitLocalVariable("par2", "I", null, l0, l6, 2);
+ mv.visitLocalVariable("idx", "I", null, l5, l6, 3);
+ mv.visitMaxs(4, 4);
+ mv.visitEnd();
+ didInject = true;
+ }
- MethodVisitor methodVisitor;
- boolean found = false;
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Thaumcraft WispEssence_Patch",
+ Level.INFO,
+ "Method injection complete. " + (obfuscated ? "Obfuscated" : "Non-Obfuscated"));
+ return didInject;
+ }
- for (String s : aMethodsToStrip) {
- if (name.equals(s)) {
- found = true;
- break;
- }
- }
- if (!found) {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- else {
- methodVisitor = null;
- }
+ public class AddAdapter extends ClassVisitor {
- if (found) {
- FMLRelaunchLog.log("[GT++ ASM] Thaumcraft WispEssence_Patch", Level.INFO,
- "Found method " + name + ", removing.");
- }
- return methodVisitor;
- }
+ public AddAdapter(ClassVisitor cv, String[] aMethods) {
+ super(ASM5, cv);
+ this.cv = cv;
+ this.aMethodsToStrip = aMethods;
+ }
- }
+ private final String[] aMethodsToStrip;
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ boolean found = false;
+ for (String s : aMethodsToStrip) {
+ if (name.equals(s)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ } else {
+ methodVisitor = null;
+ }
+ if (found) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Thaumcraft WispEssence_Patch", Level.INFO, "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java
index 86a22ce4b9..676c072eb2 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java
@@ -2,610 +2,676 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.logging.log4j.Level;
-import org.objectweb.asm.*;
-
import cpw.mods.fml.common.Loader;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.Preloader_Logger;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import org.apache.logging.log4j.Level;
+import org.objectweb.asm.*;
+
+public class ClassTransformer_TT_ThaumicRestorer {
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ private static boolean mInit = false;
-public class ClassTransformer_TT_ThaumicRestorer {
+ private static Class mTileRepairerClass;
+ private static Class mTTConfigHandler;
+ private static Class mTinkersConstructCompat;
+ private static Class mThaumicTinkerer;
+ private static Class mTCProxy;
- private final boolean isValid;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- private static boolean mInit = false;
-
- private static Class mTileRepairerClass;
- private static Class mTTConfigHandler;
- private static Class mTinkersConstructCompat;
- private static Class mThaumicTinkerer;
- private static Class mTCProxy;
+ private static Method mIsTcTool;
+ private static Method mGetTcDamage;
+ private static Method mFixTcDamage;
+ private static Method mSparkle;
+ private static Method mDrawEssentia;
- private static Method mIsTcTool;
- private static Method mGetTcDamage;
- private static Method mFixTcDamage;
- private static Method mSparkle;
- private static Method mDrawEssentia;
+ private static Field mRepairTiconTools;
+ private static Field mTicksExisted;
+ private static Field mInventory;
+ private static Field mTookLastTick;
+ private static Field mDamageLastTick;
+ private static Field mProxyTC;
- private static Field mRepairTiconTools;
- private static Field mTicksExisted;
- private static Field mInventory;
- private static Field mTookLastTick;
- private static Field mDamageLastTick;
- private static Field mProxyTC;
-
- private static boolean repairTConTools = false;
+ private static boolean repairTConTools = false;
- // thaumic.tinkerer.common.block.tile.TileRepairer
+ // thaumic.tinkerer.common.block.tile.TileRepairer
- private static final boolean isTConstructTool(ItemStack aStack) {
- return ReflectionUtils.invoke(null, mIsTcTool, new Object[] {aStack});
- }
- private static final int getDamage(ItemStack aStack) {
- return (int) ReflectionUtils.invokeNonBool(null, mGetTcDamage, new Object[] {aStack});
- }
- private static final boolean fixDamage(ItemStack aStack, int aAmount) {
- return ReflectionUtils.invoke(null, mFixTcDamage, new Object[] {aStack, aAmount});
- }
- private static final int drawEssentia(TileEntity aTile) {
- return (int) ReflectionUtils.invokeNonBool(aTile, mDrawEssentia, new Object[] {});
- }
- private static final void sparkle(float a, float b, float c, int d) {
- ReflectionUtils.invokeVoid(ReflectionUtils.getFieldValue(mProxyTC), mSparkle, new Object[] {a, b, c, d});
- }
-
- public static void updateEntity(TileEntity aTile) {
- if (!mInit) {
- // Set the classes we need
- mTileRepairerClass = ReflectionUtils.getClass("thaumic.tinkerer.common.block.tile.TileRepairer");
- mTTConfigHandler = ReflectionUtils.getClass("thaumic.tinkerer.common.core.handler.ConfigHandler");
- mTinkersConstructCompat = ReflectionUtils.getClass("thaumic.tinkerer.common.compat.TinkersConstructCompat");
- mThaumicTinkerer = ReflectionUtils.getClass("thaumic.tinkerer.common.ThaumicTinkerer");
- mTCProxy = ReflectionUtils.getClass("thaumcraft.common.CommonProxy");
- // Set the methods we need
- mIsTcTool = ReflectionUtils.getMethod(mTinkersConstructCompat, "isTConstructTool", new Class[] {ItemStack.class});
- mGetTcDamage = ReflectionUtils.getMethod(mTinkersConstructCompat, "getDamage", new Class[] {ItemStack.class});
- mFixTcDamage = ReflectionUtils.getMethod(mTinkersConstructCompat, "fixDamage", new Class[] {ItemStack.class, int.class});
- mSparkle = ReflectionUtils.getMethod(mTCProxy, "sparkle", new Class[] {float.class, float.class, float.class, int.class});
- mDrawEssentia = ReflectionUtils.getMethod(mTileRepairerClass, "drawEssentia", new Class[] {});
- // Set the fields we need
- mRepairTiconTools = ReflectionUtils.getField(mTTConfigHandler, "repairTConTools");
- mTicksExisted = ReflectionUtils.getField(mTileRepairerClass, "ticksExisted");
- mInventory = ReflectionUtils.getField(mTileRepairerClass, "inventorySlots");
- mTookLastTick = ReflectionUtils.getField(mTileRepairerClass, "tookLastTick");
- mDamageLastTick = ReflectionUtils.getField(mTileRepairerClass, "dmgLastTick");
- mProxyTC = ReflectionUtils.getField(mThaumicTinkerer, "tcProxy");
- repairTConTools = ReflectionUtils.getFieldValue(mRepairTiconTools);
- mInit = true;
- }
- if (mInit) {
- if (mTileRepairerClass.isInstance(aTile)) {
- int ticksExisted = (int) ReflectionUtils.getFieldValue(mTicksExisted, aTile);
- ItemStack[] inventorySlots = (ItemStack[]) ReflectionUtils.getFieldValue(mInventory, aTile);
- boolean tookLastTick = (boolean) ReflectionUtils.getFieldValue(mTookLastTick, aTile);
- int dmgLastTick = (int) ReflectionUtils.getFieldValue(mDamageLastTick, aTile);
- ticksExisted++;
- ReflectionUtils.setField(aTile, mTicksExisted, ticksExisted);
- boolean aDidRun = false;
- if (ticksExisted % 10 == 0) {
- if (Loader.isModLoaded("TConstruct") && repairTConTools && inventorySlots[0] != null && isTConstructTool(inventorySlots[0])) {
- final int dmg = getDamage(inventorySlots[0]);
- if (dmg > 0) {
- final int essentia = drawEssentia(aTile);
- fixDamage(inventorySlots[0], essentia);
- aTile.markDirty();
- if (dmgLastTick != 0 && dmgLastTick != dmg) {
- sparkle((float)(aTile.xCoord + 0.25 + Math.random() / 2.0), (float)(aTile.yCoord + 1 + Math.random() / 2.0), (float)(aTile.zCoord + 0.25 + Math.random() / 2.0), 0);
- tookLastTick = true;
- }
- else {
- tookLastTick = false;
- }
- }
- else {
- tookLastTick = false;
- }
- dmgLastTick = ((inventorySlots[0] == null) ? 0 : getDamage(inventorySlots[0]));
- aDidRun = true;
- }
- if (inventorySlots[0] != null && inventorySlots[0].getItemDamage() > 0 && inventorySlots[0].getItem().isRepairable()) {
- final int essentia2 = drawEssentia(aTile);
- final int dmg2 = inventorySlots[0].getItemDamage();
- inventorySlots[0].setItemDamage(Math.max(0, dmg2 - essentia2));
- aTile.markDirty();
- if (dmgLastTick != 0 && dmgLastTick != dmg2) {
- sparkle((float)(aTile.xCoord + 0.25 + Math.random() / 2.0), (float)(aTile.yCoord + 1 + Math.random() / 2.0), (float)(aTile.zCoord + 0.25 + Math.random() / 2.0), 0);
- tookLastTick = true;
- }
- else {
- tookLastTick = false;
- }
- }
- else {
- tookLastTick = false;
- }
- dmgLastTick = ((inventorySlots[0] == null) ? 0 : inventorySlots[0].getItemDamage());
- aDidRun = true;
- }
- if (aDidRun) {
- ReflectionUtils.setField(aTile, mInventory, inventorySlots);
- ReflectionUtils.setField(aTile, mTookLastTick, tookLastTick);
- ReflectionUtils.setField(aTile, mDamageLastTick, dmgLastTick);
- }
- }
- }
- }
+ private static final boolean isTConstructTool(ItemStack aStack) {
+ return ReflectionUtils.invoke(null, mIsTcTool, new Object[] {aStack});
+ }
- public ClassTransformer_TT_ThaumicRestorer(byte[] basicClass) {
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
- boolean obfuscated = false;
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- AddAdapter aMethodStripper = new AddAdapter(aTempWriter);
- aTempReader.accept(aMethodStripper, 0);
- obfuscated = aMethodStripper.isObfuscated;
- String aUpdateEntity = obfuscated ? "func_145845_h" : "updateEntity";
- Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Patching: "+aUpdateEntity+", Are we patching obfuscated methods? "+obfuscated);
- //injectMethod(aUpdateEntity, aTempWriter, obfuscated);
- injectMethodNew(aTempWriter, obfuscated);
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Valid? "+isValid+".");
- reader = aTempReader;
- writer = aTempWriter;
- }
+ private static final int getDamage(ItemStack aStack) {
+ return (int) ReflectionUtils.invokeNonBool(null, mGetTcDamage, new Object[] {aStack});
+ }
- public boolean isValidTransformer() {
- return isValid;
- }
+ private static final boolean fixDamage(ItemStack aStack, int aAmount) {
+ return ReflectionUtils.invoke(null, mFixTcDamage, new Object[] {aStack, aAmount});
+ }
- public ClassReader getReader() {
- return reader;
- }
+ private static final int drawEssentia(TileEntity aTile) {
+ return (int) ReflectionUtils.invokeNonBool(aTile, mDrawEssentia, new Object[] {});
+ }
- public ClassWriter getWriter() {
- return writer;
- }
-
- public boolean injectMethodNew(ClassWriter cw, boolean obfuscated) {
- MethodVisitor mv;
- boolean didInject = false;
- String aUpdateEntity = obfuscated ? "func_145845_h" : "updateEntity";
- String aTileEntity = obfuscated ? "aor" : "net/minecraft/tileentity/TileEntity";
- Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Injecting " + aUpdateEntity + ".");
- mv = cw.visitMethod(ACC_PUBLIC, aUpdateEntity, "()V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(60, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer", "updateEntity", "(L"+aTileEntity+";)V", false);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(61, l1);
- mv.visitInsn(RETURN);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLocalVariable("this", "Lthaumic/tinkerer/common/block/tile/TileRepairer;", null, l0, l2, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- didInject = true;
- Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Method injection complete. "+(obfuscated ? "Obfuscated" : "Non-Obfuscated"));
- return didInject;
- }
+ private static final void sparkle(float a, float b, float c, int d) {
+ ReflectionUtils.invokeVoid(ReflectionUtils.getFieldValue(mProxyTC), mSparkle, new Object[] {a, b, c, d});
+ }
- public boolean injectMethod(String aMethodName, ClassWriter cw, boolean obfuscated) {
- MethodVisitor mv;
- boolean didInject = false;
- Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Injecting " + aMethodName + ".");
+ public static void updateEntity(TileEntity aTile) {
+ if (!mInit) {
+ // Set the classes we need
+ mTileRepairerClass = ReflectionUtils.getClass("thaumic.tinkerer.common.block.tile.TileRepairer");
+ mTTConfigHandler = ReflectionUtils.getClass("thaumic.tinkerer.common.core.handler.ConfigHandler");
+ mTinkersConstructCompat = ReflectionUtils.getClass("thaumic.tinkerer.common.compat.TinkersConstructCompat");
+ mThaumicTinkerer = ReflectionUtils.getClass("thaumic.tinkerer.common.ThaumicTinkerer");
+ mTCProxy = ReflectionUtils.getClass("thaumcraft.common.CommonProxy");
+ // Set the methods we need
+ mIsTcTool = ReflectionUtils.getMethod(
+ mTinkersConstructCompat, "isTConstructTool", new Class[] {ItemStack.class});
+ mGetTcDamage =
+ ReflectionUtils.getMethod(mTinkersConstructCompat, "getDamage", new Class[] {ItemStack.class});
+ mFixTcDamage = ReflectionUtils.getMethod(
+ mTinkersConstructCompat, "fixDamage", new Class[] {ItemStack.class, int.class});
+ mSparkle = ReflectionUtils.getMethod(
+ mTCProxy, "sparkle", new Class[] {float.class, float.class, float.class, int.class});
+ mDrawEssentia = ReflectionUtils.getMethod(mTileRepairerClass, "drawEssentia", new Class[] {});
+ // Set the fields we need
+ mRepairTiconTools = ReflectionUtils.getField(mTTConfigHandler, "repairTConTools");
+ mTicksExisted = ReflectionUtils.getField(mTileRepairerClass, "ticksExisted");
+ mInventory = ReflectionUtils.getField(mTileRepairerClass, "inventorySlots");
+ mTookLastTick = ReflectionUtils.getField(mTileRepairerClass, "tookLastTick");
+ mDamageLastTick = ReflectionUtils.getField(mTileRepairerClass, "dmgLastTick");
+ mProxyTC = ReflectionUtils.getField(mThaumicTinkerer, "tcProxy");
+ repairTConTools = ReflectionUtils.getFieldValue(mRepairTiconTools);
+ mInit = true;
+ }
+ if (mInit) {
+ if (mTileRepairerClass.isInstance(aTile)) {
+ int ticksExisted = (int) ReflectionUtils.getFieldValue(mTicksExisted, aTile);
+ ItemStack[] inventorySlots = (ItemStack[]) ReflectionUtils.getFieldValue(mInventory, aTile);
+ boolean tookLastTick = (boolean) ReflectionUtils.getFieldValue(mTookLastTick, aTile);
+ int dmgLastTick = (int) ReflectionUtils.getFieldValue(mDamageLastTick, aTile);
+ ticksExisted++;
+ ReflectionUtils.setField(aTile, mTicksExisted, ticksExisted);
+ boolean aDidRun = false;
+ if (ticksExisted % 10 == 0) {
+ if (Loader.isModLoaded("TConstruct")
+ && repairTConTools
+ && inventorySlots[0] != null
+ && isTConstructTool(inventorySlots[0])) {
+ final int dmg = getDamage(inventorySlots[0]);
+ if (dmg > 0) {
+ final int essentia = drawEssentia(aTile);
+ fixDamage(inventorySlots[0], essentia);
+ aTile.markDirty();
+ if (dmgLastTick != 0 && dmgLastTick != dmg) {
+ sparkle(
+ (float) (aTile.xCoord + 0.25 + Math.random() / 2.0),
+ (float) (aTile.yCoord + 1 + Math.random() / 2.0),
+ (float) (aTile.zCoord + 0.25 + Math.random() / 2.0),
+ 0);
+ tookLastTick = true;
+ } else {
+ tookLastTick = false;
+ }
+ } else {
+ tookLastTick = false;
+ }
+ dmgLastTick = ((inventorySlots[0] == null) ? 0 : getDamage(inventorySlots[0]));
+ aDidRun = true;
+ }
+ if (inventorySlots[0] != null
+ && inventorySlots[0].getItemDamage() > 0
+ && inventorySlots[0].getItem().isRepairable()) {
+ final int essentia2 = drawEssentia(aTile);
+ final int dmg2 = inventorySlots[0].getItemDamage();
+ inventorySlots[0].setItemDamage(Math.max(0, dmg2 - essentia2));
+ aTile.markDirty();
+ if (dmgLastTick != 0 && dmgLastTick != dmg2) {
+ sparkle(
+ (float) (aTile.xCoord + 0.25 + Math.random() / 2.0),
+ (float) (aTile.yCoord + 1 + Math.random() / 2.0),
+ (float) (aTile.zCoord + 0.25 + Math.random() / 2.0),
+ 0);
+ tookLastTick = true;
+ } else {
+ tookLastTick = false;
+ }
+ } else {
+ tookLastTick = false;
+ }
+ dmgLastTick = ((inventorySlots[0] == null) ? 0 : inventorySlots[0].getItemDamage());
+ aDidRun = true;
+ }
+ if (aDidRun) {
+ ReflectionUtils.setField(aTile, mInventory, inventorySlots);
+ ReflectionUtils.setField(aTile, mTookLastTick, tookLastTick);
+ ReflectionUtils.setField(aTile, mDamageLastTick, dmgLastTick);
+ }
+ }
+ }
+ }
- String aItemStack = obfuscated ? "add" : "net/minecraft/item/ItemStack";
- String aItem = obfuscated ? "adb" : "net/minecraft/item/Item";
- String aGetItemDamage = obfuscated ? "func_150976_a" : "getItemDamage";
- String aGetItem = obfuscated ? "func_77973_b" : "getItem";
- String aSetItemDamage = obfuscated ? "func_77964_b" : "setItemDamage";
- String aIsRepairable = obfuscated ? "func_82789_a" : "isRepairable";
+ public ClassTransformer_TT_ThaumicRestorer(byte[] basicClass) {
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+ boolean obfuscated = false;
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ AddAdapter aMethodStripper = new AddAdapter(aTempWriter);
+ aTempReader.accept(aMethodStripper, 0);
+ obfuscated = aMethodStripper.isObfuscated;
+ String aUpdateEntity = obfuscated ? "func_145845_h" : "updateEntity";
+ Preloader_Logger.LOG(
+ "Thaumic Tinkerer RepairItem Patch",
+ Level.INFO,
+ "Patching: " + aUpdateEntity + ", Are we patching obfuscated methods? " + obfuscated);
+ // injectMethod(aUpdateEntity, aTempWriter, obfuscated);
+ injectMethodNew(aTempWriter, obfuscated);
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
- mv = cw.visitMethod(ACC_PUBLIC, aMethodName, "()V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(59, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(DUP);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "ticksExisted", "I");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IADD);
- mv.visitInsn(DUP_X1);
- mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "ticksExisted", "I");
- mv.visitIntInsn(BIPUSH, 10);
- mv.visitInsn(IREM);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNE, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(60, l2);
- mv.visitLdcInsn("TConstruct");
- mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/Loader", "isModLoaded", "(Ljava/lang/String;)Z", false);
- Label l3 = new Label();
- mv.visitJumpInsn(IFEQ, l3);
- mv.visitFieldInsn(GETSTATIC, "thaumic/tinkerer/common/core/handler/ConfigHandler", "repairTConTools", "Z");
- mv.visitJumpInsn(IFEQ, l3);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLineNumber(61, l4);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitJumpInsn(IFNULL, l3);
- Label l5 = new Label();
- mv.visitLabel(l5);
- mv.visitLineNumber(62, l5);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKESTATIC, "thaumic/tinkerer/common/compat/TinkersConstructCompat", "isTConstructTool", "(L"+aItemStack+";)Z", false);
- mv.visitJumpInsn(IFEQ, l3);
- Label l6 = new Label();
- mv.visitLabel(l6);
- mv.visitLineNumber(63, l6);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKESTATIC, "thaumic/tinkerer/common/compat/TinkersConstructCompat", "getDamage", "(L"+aItemStack+";)I", false);
- mv.visitVarInsn(ISTORE, 1);
- Label l7 = new Label();
- mv.visitLabel(l7);
- mv.visitLineNumber(64, l7);
- mv.visitVarInsn(ILOAD, 1);
- Label l8 = new Label();
- mv.visitJumpInsn(IFLE, l8);
- Label l9 = new Label();
- mv.visitLabel(l9);
- mv.visitLineNumber(65, l9);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumic/tinkerer/common/block/tile/TileRepairer", "drawEssentia", "()I", false);
- mv.visitVarInsn(ISTORE, 2);
- Label l10 = new Label();
- mv.visitLabel(l10);
- mv.visitLineNumber(66, l10);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitMethodInsn(INVOKESTATIC, "thaumic/tinkerer/common/compat/TinkersConstructCompat", "fixDamage", "(L"+aItemStack+";I)Z", false);
- mv.visitInsn(POP);
- Label l11 = new Label();
- mv.visitLabel(l11);
- mv.visitLineNumber(67, l11);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumic/tinkerer/common/block/tile/TileRepairer", "markDirty", "()V", false);
- Label l12 = new Label();
- mv.visitLabel(l12);
- mv.visitLineNumber(68, l12);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
- Label l13 = new Label();
- mv.visitJumpInsn(IFEQ, l13);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
- mv.visitVarInsn(ILOAD, 1);
- mv.visitJumpInsn(IF_ICMPEQ, l13);
- Label l14 = new Label();
- mv.visitLabel(l14);
- mv.visitLineNumber(69, l14);
- mv.visitFieldInsn(GETSTATIC, "thaumic/tinkerer/common/ThaumicTinkerer", "tcProxy", "Lthaumcraft/common/CommonProxy;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "xCoord", "I");
- mv.visitInsn(I2D);
- mv.visitLdcInsn(new Double("0.25"));
- mv.visitInsn(DADD);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
- mv.visitLdcInsn(new Double("2.0"));
- mv.visitInsn(DDIV);
- mv.visitInsn(DADD);
- mv.visitInsn(D2F);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "yCoord", "I");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IADD);
- mv.visitInsn(I2D);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
- mv.visitLdcInsn(new Double("2.0"));
- mv.visitInsn(DDIV);
- mv.visitInsn(DADD);
- mv.visitInsn(D2F);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "zCoord", "I");
- mv.visitInsn(I2D);
- mv.visitLdcInsn(new Double("0.25"));
- mv.visitInsn(DADD);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
- mv.visitLdcInsn(new Double("2.0"));
- mv.visitInsn(DDIV);
- mv.visitInsn(DADD);
- mv.visitInsn(D2F);
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/common/CommonProxy", "sparkle", "(FFFI)V", false);
- Label l15 = new Label();
- mv.visitLabel(l15);
- mv.visitLineNumber(70, l15);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(ICONST_1);
- mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
- Label l16 = new Label();
- mv.visitLabel(l16);
- mv.visitLineNumber(71, l16);
- Label l17 = new Label();
- mv.visitJumpInsn(GOTO, l17);
- mv.visitLabel(l13);
- mv.visitFrame(Opcodes.F_APPEND,2, new Object[] {Opcodes.INTEGER, Opcodes.INTEGER}, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(ICONST_0);
- mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
- Label l18 = new Label();
- mv.visitLabel(l18);
- mv.visitLineNumber(72, l18);
- mv.visitJumpInsn(GOTO, l17);
- mv.visitLabel(l8);
- mv.visitFrame(Opcodes.F_CHOP,1, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(ICONST_0);
- mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
- mv.visitLabel(l17);
- mv.visitLineNumber(73, l17);
- mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- Label l19 = new Label();
- mv.visitJumpInsn(IFNONNULL, l19);
- mv.visitInsn(ICONST_0);
- Label l20 = new Label();
- mv.visitJumpInsn(GOTO, l20);
- mv.visitLabel(l19);
- mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer"});
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKESTATIC, "thaumic/tinkerer/common/compat/TinkersConstructCompat", "getDamage", "(L"+aItemStack+";)I", false);
- mv.visitLabel(l20);
- mv.visitFrame(Opcodes.F_FULL, 2, new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer", Opcodes.INTEGER}, 2, new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer", Opcodes.INTEGER});
- mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
- Label l21 = new Label();
- mv.visitLabel(l21);
- mv.visitLineNumber(74, l21);
- mv.visitInsn(RETURN);
- mv.visitLabel(l3);
- mv.visitLineNumber(78, l3);
- mv.visitFrame(Opcodes.F_CHOP,1, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- Label l22 = new Label();
- mv.visitJumpInsn(IFNULL, l22);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aItemStack+"", ""+aGetItemDamage+"", "()I", false);
- mv.visitJumpInsn(IFLE, l22);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aItemStack+"", ""+aGetItem+"", "()L"+aItem+";", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aItem+"", ""+aIsRepairable+"", "()Z", false);
- mv.visitJumpInsn(IFEQ, l22);
- Label l23 = new Label();
- mv.visitLabel(l23);
- mv.visitLineNumber(79, l23);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumic/tinkerer/common/block/tile/TileRepairer", "drawEssentia", "()I", false);
- mv.visitVarInsn(ISTORE, 1);
- Label l24 = new Label();
- mv.visitLabel(l24);
- mv.visitLineNumber(80, l24);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aItemStack+"", ""+aGetItemDamage+"", "()I", false);
- mv.visitVarInsn(ISTORE, 2);
- Label l25 = new Label();
- mv.visitLabel(l25);
- mv.visitLineNumber(81, l25);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitInsn(ICONST_0);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitVarInsn(ILOAD, 1);
- mv.visitInsn(ISUB);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "max", "(II)I", false);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aItemStack+"", ""+aSetItemDamage+"", "(I)V", false);
- Label l26 = new Label();
- mv.visitLabel(l26);
- mv.visitLineNumber(82, l26);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumic/tinkerer/common/block/tile/TileRepairer", "markDirty", "()V", false);
- Label l27 = new Label();
- mv.visitLabel(l27);
- mv.visitLineNumber(84, l27);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
- Label l28 = new Label();
- mv.visitJumpInsn(IFEQ, l28);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
- mv.visitVarInsn(ILOAD, 2);
- mv.visitJumpInsn(IF_ICMPEQ, l28);
- Label l29 = new Label();
- mv.visitLabel(l29);
- mv.visitLineNumber(85, l29);
- mv.visitFieldInsn(GETSTATIC, "thaumic/tinkerer/common/ThaumicTinkerer", "tcProxy", "Lthaumcraft/common/CommonProxy;");
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "xCoord", "I");
- mv.visitInsn(I2D);
- mv.visitLdcInsn(new Double("0.25"));
- mv.visitInsn(DADD);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
- mv.visitLdcInsn(new Double("2.0"));
- mv.visitInsn(DDIV);
- mv.visitInsn(DADD);
- mv.visitInsn(D2F);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "yCoord", "I");
- mv.visitInsn(ICONST_1);
- mv.visitInsn(IADD);
- mv.visitInsn(I2D);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
- mv.visitLdcInsn(new Double("2.0"));
- mv.visitInsn(DDIV);
- mv.visitInsn(DADD);
- mv.visitInsn(D2F);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "zCoord", "I");
- mv.visitInsn(I2D);
- mv.visitLdcInsn(new Double("0.25"));
- mv.visitInsn(DADD);
- mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
- mv.visitLdcInsn(new Double("2.0"));
- mv.visitInsn(DDIV);
- mv.visitInsn(DADD);
- mv.visitInsn(D2F);
- mv.visitInsn(ICONST_0);
- mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/common/CommonProxy", "sparkle", "(FFFI)V", false);
- Label l30 = new Label();
- mv.visitLabel(l30);
- mv.visitLineNumber(86, l30);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(ICONST_1);
- mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
- Label l31 = new Label();
- mv.visitLabel(l31);
- mv.visitLineNumber(87, l31);
- Label l32 = new Label();
- mv.visitJumpInsn(GOTO, l32);
- mv.visitLabel(l28);
- mv.visitFrame(Opcodes.F_APPEND,2, new Object[] {Opcodes.INTEGER, Opcodes.INTEGER}, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(ICONST_0);
- mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
- Label l33 = new Label();
- mv.visitLabel(l33);
- mv.visitLineNumber(88, l33);
- mv.visitJumpInsn(GOTO, l32);
- mv.visitLabel(l22);
- mv.visitFrame(Opcodes.F_CHOP,2, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitInsn(ICONST_0);
- mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
- mv.visitLabel(l32);
- mv.visitLineNumber(90, l32);
- mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- Label l34 = new Label();
- mv.visitJumpInsn(IFNONNULL, l34);
- mv.visitInsn(ICONST_0);
- Label l35 = new Label();
- mv.visitJumpInsn(GOTO, l35);
- mv.visitLabel(l34);
- mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer"});
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L"+aItemStack+";");
- mv.visitInsn(ICONST_0);
- mv.visitInsn(AALOAD);
- mv.visitMethodInsn(INVOKEVIRTUAL, ""+aItemStack+"", ""+aGetItemDamage+"", "()I", false);
- mv.visitLabel(l35);
- mv.visitFrame(Opcodes.F_FULL, 1, new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer"}, 2, new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer", Opcodes.INTEGER});
- mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
- mv.visitLabel(l1);
- mv.visitLineNumber(92, l1);
- mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
- mv.visitInsn(RETURN);
- Label l36 = new Label();
- mv.visitLabel(l36);
- mv.visitLocalVariable("this", "Lthaumic/tinkerer/common/block/tile/TileRepairer;", null, l0, l36, 0);
- mv.visitLocalVariable("dmg", "I", null, l7, l3, 1);
- mv.visitLocalVariable("essentia", "I", null, l10, l18, 2);
- mv.visitLocalVariable("essentia", "I", null, l24, l33, 1);
- mv.visitLocalVariable("dmg", "I", null, l25, l33, 2);
- mv.visitMaxs(9, 3);
- mv.visitEnd();
- didInject = true;
- Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Method injection complete. "+(obfuscated ? "Obfuscated" : "Non-Obfuscated"));
- return didInject;
- }
+ public boolean isValidTransformer() {
+ return isValid;
+ }
- public class AddAdapter extends ClassVisitor {
+ public ClassReader getReader() {
+ return reader;
+ }
- public AddAdapter(ClassVisitor cv) {
- super(ASM5, cv);
- this.cv = cv;
- }
+ public ClassWriter getWriter() {
+ return writer;
+ }
- private final String[] aMethodsToStrip = new String[] {"updateEntity", "func_145845_h"};
- public boolean isObfuscated = false;
+ public boolean injectMethodNew(ClassWriter cw, boolean obfuscated) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ String aUpdateEntity = obfuscated ? "func_145845_h" : "updateEntity";
+ String aTileEntity = obfuscated ? "aor" : "net/minecraft/tileentity/TileEntity";
+ Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Injecting " + aUpdateEntity + ".");
+ mv = cw.visitMethod(ACC_PUBLIC, aUpdateEntity, "()V", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(60, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer",
+ "updateEntity",
+ "(L" + aTileEntity + ";)V",
+ false);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(61, l1);
+ mv.visitInsn(RETURN);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLocalVariable("this", "Lthaumic/tinkerer/common/block/tile/TileRepairer;", null, l0, l2, 0);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ didInject = true;
+ Preloader_Logger.LOG(
+ "Thaumic Tinkerer RepairItem Patch",
+ Level.INFO,
+ "Method injection complete. " + (obfuscated ? "Obfuscated" : "Non-Obfuscated"));
+ return didInject;
+ }
+ public boolean injectMethod(String aMethodName, ClassWriter cw, boolean obfuscated) {
+ MethodVisitor mv;
+ boolean didInject = false;
+ Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO, "Injecting " + aMethodName + ".");
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ String aItemStack = obfuscated ? "add" : "net/minecraft/item/ItemStack";
+ String aItem = obfuscated ? "adb" : "net/minecraft/item/Item";
+ String aGetItemDamage = obfuscated ? "func_150976_a" : "getItemDamage";
+ String aGetItem = obfuscated ? "func_77973_b" : "getItem";
+ String aSetItemDamage = obfuscated ? "func_77964_b" : "setItemDamage";
+ String aIsRepairable = obfuscated ? "func_82789_a" : "isRepairable";
- MethodVisitor methodVisitor;
- boolean found = false;
+ mv = cw.visitMethod(ACC_PUBLIC, aMethodName, "()V", null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(59, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(DUP);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "ticksExisted", "I");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IADD);
+ mv.visitInsn(DUP_X1);
+ mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "ticksExisted", "I");
+ mv.visitIntInsn(BIPUSH, 10);
+ mv.visitInsn(IREM);
+ Label l1 = new Label();
+ mv.visitJumpInsn(IFNE, l1);
+ Label l2 = new Label();
+ mv.visitLabel(l2);
+ mv.visitLineNumber(60, l2);
+ mv.visitLdcInsn("TConstruct");
+ mv.visitMethodInsn(INVOKESTATIC, "cpw/mods/fml/common/Loader", "isModLoaded", "(Ljava/lang/String;)Z", false);
+ Label l3 = new Label();
+ mv.visitJumpInsn(IFEQ, l3);
+ mv.visitFieldInsn(GETSTATIC, "thaumic/tinkerer/common/core/handler/ConfigHandler", "repairTConTools", "Z");
+ mv.visitJumpInsn(IFEQ, l3);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLineNumber(61, l4);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitJumpInsn(IFNULL, l3);
+ Label l5 = new Label();
+ mv.visitLabel(l5);
+ mv.visitLineNumber(62, l5);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "thaumic/tinkerer/common/compat/TinkersConstructCompat",
+ "isTConstructTool",
+ "(L" + aItemStack + ";)Z",
+ false);
+ mv.visitJumpInsn(IFEQ, l3);
+ Label l6 = new Label();
+ mv.visitLabel(l6);
+ mv.visitLineNumber(63, l6);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "thaumic/tinkerer/common/compat/TinkersConstructCompat",
+ "getDamage",
+ "(L" + aItemStack + ";)I",
+ false);
+ mv.visitVarInsn(ISTORE, 1);
+ Label l7 = new Label();
+ mv.visitLabel(l7);
+ mv.visitLineNumber(64, l7);
+ mv.visitVarInsn(ILOAD, 1);
+ Label l8 = new Label();
+ mv.visitJumpInsn(IFLE, l8);
+ Label l9 = new Label();
+ mv.visitLabel(l9);
+ mv.visitLineNumber(65, l9);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "thaumic/tinkerer/common/block/tile/TileRepairer", "drawEssentia", "()I", false);
+ mv.visitVarInsn(ISTORE, 2);
+ Label l10 = new Label();
+ mv.visitLabel(l10);
+ mv.visitLineNumber(66, l10);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "thaumic/tinkerer/common/compat/TinkersConstructCompat",
+ "fixDamage",
+ "(L" + aItemStack + ";I)Z",
+ false);
+ mv.visitInsn(POP);
+ Label l11 = new Label();
+ mv.visitLabel(l11);
+ mv.visitLineNumber(67, l11);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "thaumic/tinkerer/common/block/tile/TileRepairer", "markDirty", "()V", false);
+ Label l12 = new Label();
+ mv.visitLabel(l12);
+ mv.visitLineNumber(68, l12);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
+ Label l13 = new Label();
+ mv.visitJumpInsn(IFEQ, l13);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitJumpInsn(IF_ICMPEQ, l13);
+ Label l14 = new Label();
+ mv.visitLabel(l14);
+ mv.visitLineNumber(69, l14);
+ mv.visitFieldInsn(
+ GETSTATIC, "thaumic/tinkerer/common/ThaumicTinkerer", "tcProxy", "Lthaumcraft/common/CommonProxy;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "xCoord", "I");
+ mv.visitInsn(I2D);
+ mv.visitLdcInsn(new Double("0.25"));
+ mv.visitInsn(DADD);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
+ mv.visitLdcInsn(new Double("2.0"));
+ mv.visitInsn(DDIV);
+ mv.visitInsn(DADD);
+ mv.visitInsn(D2F);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "yCoord", "I");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IADD);
+ mv.visitInsn(I2D);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
+ mv.visitLdcInsn(new Double("2.0"));
+ mv.visitInsn(DDIV);
+ mv.visitInsn(DADD);
+ mv.visitInsn(D2F);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "zCoord", "I");
+ mv.visitInsn(I2D);
+ mv.visitLdcInsn(new Double("0.25"));
+ mv.visitInsn(DADD);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
+ mv.visitLdcInsn(new Double("2.0"));
+ mv.visitInsn(DDIV);
+ mv.visitInsn(DADD);
+ mv.visitInsn(D2F);
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/common/CommonProxy", "sparkle", "(FFFI)V", false);
+ Label l15 = new Label();
+ mv.visitLabel(l15);
+ mv.visitLineNumber(70, l15);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(ICONST_1);
+ mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
+ Label l16 = new Label();
+ mv.visitLabel(l16);
+ mv.visitLineNumber(71, l16);
+ Label l17 = new Label();
+ mv.visitJumpInsn(GOTO, l17);
+ mv.visitLabel(l13);
+ mv.visitFrame(Opcodes.F_APPEND, 2, new Object[] {Opcodes.INTEGER, Opcodes.INTEGER}, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(ICONST_0);
+ mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
+ Label l18 = new Label();
+ mv.visitLabel(l18);
+ mv.visitLineNumber(72, l18);
+ mv.visitJumpInsn(GOTO, l17);
+ mv.visitLabel(l8);
+ mv.visitFrame(Opcodes.F_CHOP, 1, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(ICONST_0);
+ mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
+ mv.visitLabel(l17);
+ mv.visitLineNumber(73, l17);
+ mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ Label l19 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l19);
+ mv.visitInsn(ICONST_0);
+ Label l20 = new Label();
+ mv.visitJumpInsn(GOTO, l20);
+ mv.visitLabel(l19);
+ mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer"});
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(
+ INVOKESTATIC,
+ "thaumic/tinkerer/common/compat/TinkersConstructCompat",
+ "getDamage",
+ "(L" + aItemStack + ";)I",
+ false);
+ mv.visitLabel(l20);
+ mv.visitFrame(
+ Opcodes.F_FULL,
+ 2,
+ new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer", Opcodes.INTEGER},
+ 2,
+ new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer", Opcodes.INTEGER});
+ mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
+ Label l21 = new Label();
+ mv.visitLabel(l21);
+ mv.visitLineNumber(74, l21);
+ mv.visitInsn(RETURN);
+ mv.visitLabel(l3);
+ mv.visitLineNumber(78, l3);
+ mv.visitFrame(Opcodes.F_CHOP, 1, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ Label l22 = new Label();
+ mv.visitJumpInsn(IFNULL, l22);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aItemStack + "", "" + aGetItemDamage + "", "()I", false);
+ mv.visitJumpInsn(IFLE, l22);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aItemStack + "", "" + aGetItem + "", "()L" + aItem + ";", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aItem + "", "" + aIsRepairable + "", "()Z", false);
+ mv.visitJumpInsn(IFEQ, l22);
+ Label l23 = new Label();
+ mv.visitLabel(l23);
+ mv.visitLineNumber(79, l23);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(
+ INVOKEVIRTUAL, "thaumic/tinkerer/common/block/tile/TileRepairer", "drawEssentia", "()I", false);
+ mv.visitVarInsn(ISTORE, 1);
+ Label l24 = new Label();
+ mv.visitLabel(l24);
+ mv.visitLineNumber(80, l24);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aItemStack + "", "" + aGetItemDamage + "", "()I", false);
+ mv.visitVarInsn(ISTORE, 2);
+ Label l25 = new Label();
+ mv.visitLabel(l25);
+ mv.visitLineNumber(81, l25);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitInsn(ICONST_0);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitInsn(ISUB);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "max", "(II)I", false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aItemStack + "", "" + aSetItemDamage + "", "(I)V", false);
+ Label l26 = new Label();
+ mv.visitLabel(l26);
+ mv.visitLineNumber(82, l26);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "thaumic/tinkerer/common/block/tile/TileRepairer", "markDirty", "()V", false);
+ Label l27 = new Label();
+ mv.visitLabel(l27);
+ mv.visitLineNumber(84, l27);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
+ Label l28 = new Label();
+ mv.visitJumpInsn(IFEQ, l28);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitJumpInsn(IF_ICMPEQ, l28);
+ Label l29 = new Label();
+ mv.visitLabel(l29);
+ mv.visitLineNumber(85, l29);
+ mv.visitFieldInsn(
+ GETSTATIC, "thaumic/tinkerer/common/ThaumicTinkerer", "tcProxy", "Lthaumcraft/common/CommonProxy;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "xCoord", "I");
+ mv.visitInsn(I2D);
+ mv.visitLdcInsn(new Double("0.25"));
+ mv.visitInsn(DADD);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
+ mv.visitLdcInsn(new Double("2.0"));
+ mv.visitInsn(DDIV);
+ mv.visitInsn(DADD);
+ mv.visitInsn(D2F);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "yCoord", "I");
+ mv.visitInsn(ICONST_1);
+ mv.visitInsn(IADD);
+ mv.visitInsn(I2D);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
+ mv.visitLdcInsn(new Double("2.0"));
+ mv.visitInsn(DDIV);
+ mv.visitInsn(DADD);
+ mv.visitInsn(D2F);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "zCoord", "I");
+ mv.visitInsn(I2D);
+ mv.visitLdcInsn(new Double("0.25"));
+ mv.visitInsn(DADD);
+ mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "random", "()D", false);
+ mv.visitLdcInsn(new Double("2.0"));
+ mv.visitInsn(DDIV);
+ mv.visitInsn(DADD);
+ mv.visitInsn(D2F);
+ mv.visitInsn(ICONST_0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "thaumcraft/common/CommonProxy", "sparkle", "(FFFI)V", false);
+ Label l30 = new Label();
+ mv.visitLabel(l30);
+ mv.visitLineNumber(86, l30);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(ICONST_1);
+ mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
+ Label l31 = new Label();
+ mv.visitLabel(l31);
+ mv.visitLineNumber(87, l31);
+ Label l32 = new Label();
+ mv.visitJumpInsn(GOTO, l32);
+ mv.visitLabel(l28);
+ mv.visitFrame(Opcodes.F_APPEND, 2, new Object[] {Opcodes.INTEGER, Opcodes.INTEGER}, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(ICONST_0);
+ mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
+ Label l33 = new Label();
+ mv.visitLabel(l33);
+ mv.visitLineNumber(88, l33);
+ mv.visitJumpInsn(GOTO, l32);
+ mv.visitLabel(l22);
+ mv.visitFrame(Opcodes.F_CHOP, 2, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitInsn(ICONST_0);
+ mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "tookLastTick", "Z");
+ mv.visitLabel(l32);
+ mv.visitLineNumber(90, l32);
+ mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ Label l34 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l34);
+ mv.visitInsn(ICONST_0);
+ Label l35 = new Label();
+ mv.visitJumpInsn(GOTO, l35);
+ mv.visitLabel(l34);
+ mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer"});
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(
+ GETFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "inventorySlots", "[L" + aItemStack + ";");
+ mv.visitInsn(ICONST_0);
+ mv.visitInsn(AALOAD);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "" + aItemStack + "", "" + aGetItemDamage + "", "()I", false);
+ mv.visitLabel(l35);
+ mv.visitFrame(
+ Opcodes.F_FULL, 1, new Object[] {"thaumic/tinkerer/common/block/tile/TileRepairer"}, 2, new Object[] {
+ "thaumic/tinkerer/common/block/tile/TileRepairer", Opcodes.INTEGER
+ });
+ mv.visitFieldInsn(PUTFIELD, "thaumic/tinkerer/common/block/tile/TileRepairer", "dmgLastTick", "I");
+ mv.visitLabel(l1);
+ mv.visitLineNumber(92, l1);
+ mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
+ mv.visitInsn(RETURN);
+ Label l36 = new Label();
+ mv.visitLabel(l36);
+ mv.visitLocalVariable("this", "Lthaumic/tinkerer/common/block/tile/TileRepairer;", null, l0, l36, 0);
+ mv.visitLocalVariable("dmg", "I", null, l7, l3, 1);
+ mv.visitLocalVariable("essentia", "I", null, l10, l18, 2);
+ mv.visitLocalVariable("essentia", "I", null, l24, l33, 1);
+ mv.visitLocalVariable("dmg", "I", null, l25, l33, 2);
+ mv.visitMaxs(9, 3);
+ mv.visitEnd();
+ didInject = true;
+ Preloader_Logger.LOG(
+ "Thaumic Tinkerer RepairItem Patch",
+ Level.INFO,
+ "Method injection complete. " + (obfuscated ? "Obfuscated" : "Non-Obfuscated"));
+ return didInject;
+ }
- for (String s : aMethodsToStrip) {
- if (name.equals(s)) {
- found = true;
- if (s.equals(aMethodsToStrip[1])) {
- isObfuscated = true;
- }
- break;
- }
- }
- if (!found) {
- methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- }
- else {
- methodVisitor = null;
- }
+ public class AddAdapter extends ClassVisitor {
- if (found) {
- Preloader_Logger.LOG("Thaumic Tinkerer RepairItem Patch", Level.INFO,
- "Found method " + name + ", removing.");
- }
- return methodVisitor;
- }
+ public AddAdapter(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
- }
+ private final String[] aMethodsToStrip = new String[] {"updateEntity", "func_145845_h"};
+ public boolean isObfuscated = false;
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ boolean found = false;
+ for (String s : aMethodsToStrip) {
+ if (name.equals(s)) {
+ found = true;
+ if (s.equals(aMethodsToStrip[1])) {
+ isObfuscated = true;
+ }
+ break;
+ }
+ }
+ if (!found) {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ } else {
+ methodVisitor = null;
+ }
+ if (found) {
+ Preloader_Logger.LOG(
+ "Thaumic Tinkerer RepairItem Patch", Level.INFO, "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TiConFluids.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TiConFluids.java
index 083041050d..5148df0349 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TiConFluids.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TiConFluids.java
@@ -2,8 +2,8 @@ package gtPlusPlus.preloader.asm.transformers;
import static org.objectweb.asm.Opcodes.*;
-import java.io.IOException;
-
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.preloader.DevHelper;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
@@ -11,154 +11,146 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.preloader.DevHelper;
-
-
-public class ClassTransformer_TiConFluids {
-
-
- //Leftover Code, in case I ever want to inject interfaces.
- //private static final String cloneableInterface = "java/lang/Cloneable";
-
- //The qualified name of the class we plan to transform.
- private static final String className = "tconstruct.smeltery.blocks.TConstructFluid";
-
- private final boolean isValid;
- private final boolean isObfuscated;
- private final String methodName;
- private final ClassReader reader;
- private final ClassWriter writer;
-
- public ClassTransformer_TiConFluids(String aMethodName, boolean obfuscated, byte[] basicClass) {
- isObfuscated = obfuscated;
-
- methodName = obfuscated ? DevHelper.getSRG(aMethodName) : aMethodName;
-
- ClassReader aTempReader = null;
- ClassWriter aTempWriter = null;
-
- aTempReader = new ClassReader(basicClass);
- aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new localClassVisitir(aTempWriter, isObfuscated), 0);
-
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- }
- else {
- isValid = false;
- }
- reader = aTempReader;
- writer = aTempWriter;
-
- if (reader != null && writer != null) {
- injectMethod();
- }
-
- }
-
- public boolean isValidTransformer() {
- return isValid;
- }
-
- public ClassReader getReader() {
- return reader;
- }
-
- public ClassWriter getWriter() {
- return writer;
- }
-
- public void injectMethod() {
- if (isValidTransformer()) {
- FMLRelaunchLog.log("[GT++ ASM] Bright Fluids", Level.INFO, "Injecting "+methodName+" into "+className+". ["+(isObfuscated ? "Obfuscated" : "Unobfuscated")+"]");
- //Account for Obfuscated constructor args.
- String IBlockAccessName = isObfuscated ? "ahl" : "net/minecraft/world/IBlockAccess";
- String aConstructorTypes = "(L"+IBlockAccessName+";III)I";
-
- MethodVisitor mv = getWriter().visitMethod(ACC_PUBLIC, methodName, aConstructorTypes, null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(17, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, "tconstruct/smeltery/blocks/TConstructFluid", "maxScaledLight", "I");
- mv.visitVarInsn(ISTORE, 5);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLineNumber(18, l1);
- mv.visitVarInsn(ILOAD, 5);
- Label l2 = new Label();
- mv.visitJumpInsn(IFLE, l2);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLineNumber(19, l3);
- mv.visitVarInsn(ILOAD, 5);
- mv.visitInsn(IRETURN);
- mv.visitLabel(l2);
- mv.visitLineNumber(21, l2);
- mv.visitFrame(F_APPEND,1, new Object[] {INTEGER}, 0, null);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(ALOAD, 1);
- mv.visitVarInsn(ILOAD, 2);
- mv.visitVarInsn(ILOAD, 3);
- mv.visitVarInsn(ILOAD, 4);
- //net.minecraftforge.fluids.BlockFluidClassic.getLightValue(IBlockAccess, int, int, int)
- mv.visitMethodInsn(INVOKESPECIAL, "net/minecraftforge/fluids/BlockFluidClassic", methodName, aConstructorTypes, false);
- mv.visitInsn(IRETURN);
- Label l4 = new Label();
- mv.visitLabel(l4);
- mv.visitLocalVariable("this", "Ltconstruct/smeltery/blocks/TConstructFluid;", null, l0, l4, 0);
- mv.visitLocalVariable("world", "L"+IBlockAccessName+";", null, l0, l4, 1);
- mv.visitLocalVariable("x", "I", null, l0, l4, 2);
- mv.visitLocalVariable("y", "I", null, l0, l4, 3);
- mv.visitLocalVariable("z", "I", null, l0, l4, 4);
- mv.visitLocalVariable("maxLight", "I", null, l1, l4, 5);
- mv.visitMaxs(5, 6);
- mv.visitEnd();
- FMLRelaunchLog.log("[GT++ ASM] Bright Fluids", Level.INFO, "Method injection complete.");
-
- }
- }
-
- public final class localClassVisitir extends ClassVisitor {
-
- private final boolean mIsObfuscated;
-
- public localClassVisitir(ClassVisitor cv, boolean obfuscated) {
- super(ASM5, cv);
- mIsObfuscated = obfuscated;
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- String IBlockAccessName = isObfuscated ? "ahl" : "net/minecraft/world/IBlockAccess";
- String aConstructorTypes = "(L"+IBlockAccessName+";III)I";
- MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- if(name.equals(methodName) && desc.equals(aConstructorTypes)) {
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Found target method. ["+mIsObfuscated+"]");
- return new localMethodVisitor(methodVisitor, mIsObfuscated);
- }
- return methodVisitor;
- }
-
- }
-
- private final class localMethodVisitor extends MethodVisitor {
-
- private final boolean mObfuscated;
-
- public localMethodVisitor(MethodVisitor mv, boolean obfuscated) {
- super(ASM5, mv);
- this.mObfuscated = obfuscated;
- }
-
- @Override
- public void visitCode() {
-
- }
-
- }
-
-
+public class ClassTransformer_TiConFluids {
+
+ // Leftover Code, in case I ever want to inject interfaces.
+ // private static final String cloneableInterface = "java/lang/Cloneable";
+
+ // The qualified name of the class we plan to transform.
+ private static final String className = "tconstruct.smeltery.blocks.TConstructFluid";
+
+ private final boolean isValid;
+ private final boolean isObfuscated;
+ private final String methodName;
+ private final ClassReader reader;
+ private final ClassWriter writer;
+
+ public ClassTransformer_TiConFluids(String aMethodName, boolean obfuscated, byte[] basicClass) {
+ isObfuscated = obfuscated;
+
+ methodName = obfuscated ? DevHelper.getSRG(aMethodName) : aMethodName;
+
+ ClassReader aTempReader = null;
+ ClassWriter aTempWriter = null;
+
+ aTempReader = new ClassReader(basicClass);
+ aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
+ aTempReader.accept(new localClassVisitir(aTempWriter, isObfuscated), 0);
+
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ reader = aTempReader;
+ writer = aTempWriter;
+
+ if (reader != null && writer != null) {
+ injectMethod();
+ }
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public void injectMethod() {
+ if (isValidTransformer()) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] Bright Fluids",
+ Level.INFO,
+ "Injecting " + methodName + " into " + className + ". ["
+ + (isObfuscated ? "Obfuscated" : "Unobfuscated") + "]");
+ // Account for Obfuscated constructor args.
+ String IBlockAccessName = isObfuscated ? "ahl" : "net/minecraft/world/IBlockAccess";
+ String aConstructorTypes = "(L" + IBlockAccessName + ";III)I";
+
+ MethodVisitor mv = getWriter().visitMethod(ACC_PUBLIC, methodName, aConstructorTypes, null, null);
+ mv.visitCode();
+ Label l0 = new Label();
+ mv.visitLabel(l0);
+ mv.visitLineNumber(17, l0);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "tconstruct/smeltery/blocks/TConstructFluid", "maxScaledLight", "I");
+ mv.visitVarInsn(ISTORE, 5);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLineNumber(18, l1);
+ mv.visitVarInsn(ILOAD, 5);
+ Label l2 = new Label();
+ mv.visitJumpInsn(IFLE, l2);
+ Label l3 = new Label();
+ mv.visitLabel(l3);
+ mv.visitLineNumber(19, l3);
+ mv.visitVarInsn(ILOAD, 5);
+ mv.visitInsn(IRETURN);
+ mv.visitLabel(l2);
+ mv.visitLineNumber(21, l2);
+ mv.visitFrame(F_APPEND, 1, new Object[] {INTEGER}, 0, null);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitVarInsn(ILOAD, 4);
+ // net.minecraftforge.fluids.BlockFluidClassic.getLightValue(IBlockAccess, int, int, int)
+ mv.visitMethodInsn(
+ INVOKESPECIAL, "net/minecraftforge/fluids/BlockFluidClassic", methodName, aConstructorTypes, false);
+ mv.visitInsn(IRETURN);
+ Label l4 = new Label();
+ mv.visitLabel(l4);
+ mv.visitLocalVariable("this", "Ltconstruct/smeltery/blocks/TConstructFluid;", null, l0, l4, 0);
+ mv.visitLocalVariable("world", "L" + IBlockAccessName + ";", null, l0, l4, 1);
+ mv.visitLocalVariable("x", "I", null, l0, l4, 2);
+ mv.visitLocalVariable("y", "I", null, l0, l4, 3);
+ mv.visitLocalVariable("z", "I", null, l0, l4, 4);
+ mv.visitLocalVariable("maxLight", "I", null, l1, l4, 5);
+ mv.visitMaxs(5, 6);
+ mv.visitEnd();
+ FMLRelaunchLog.log("[GT++ ASM] Bright Fluids", Level.INFO, "Method injection complete.");
+ }
+ }
+
+ public final class localClassVisitir extends ClassVisitor {
+
+ private final boolean mIsObfuscated;
+
+ public localClassVisitir(ClassVisitor cv, boolean obfuscated) {
+ super(ASM5, cv);
+ mIsObfuscated = obfuscated;
+ }
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ String IBlockAccessName = isObfuscated ? "ahl" : "net/minecraft/world/IBlockAccess";
+ String aConstructorTypes = "(L" + IBlockAccessName + ";III)I";
+ MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ if (name.equals(methodName) && desc.equals(aConstructorTypes)) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer", Level.INFO, "Found target method. [" + mIsObfuscated + "]");
+ return new localMethodVisitor(methodVisitor, mIsObfuscated);
+ }
+ return methodVisitor;
+ }
+ }
+
+ private final class localMethodVisitor extends MethodVisitor {
+
+ private final boolean mObfuscated;
+
+ public localMethodVisitor(MethodVisitor mv, boolean obfuscated) {
+ super(ASM5, mv);
+ this.mObfuscated = obfuscated;
+ }
+
+ @Override
+ public void visitCode() {}
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer.java
index 05a476c1c8..34425a49c3 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer.java
@@ -6,74 +6,73 @@ import static org.objectweb.asm.Opcodes.IFEQ;
import static org.objectweb.asm.Opcodes.INVOKESTATIC;
import static org.objectweb.asm.Opcodes.RETURN;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-
-public class Preloader_ClassTransformer {
-
- public static final class OreDictionaryVisitor extends ClassVisitor {
-
- public OreDictionaryVisitor(ClassVisitor cv) {
- super(ASM5, cv);
- }
+public class Preloader_ClassTransformer {
- @Override
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
- if(name.equals("registerOreImpl") && desc.equals("(Ljava/lang/String;Lnet/minecraft/item/ItemStack;)V")) {
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Found target method. [Unobfuscated]");
- return new RegisterOreImplVisitor(methodVisitor, false);
- }
- else if(name.equals("registerOreImpl") && desc.equals("(Ljava/lang/String;Ladd;)V")) {
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Found target method. [Obfuscated]");
- return new RegisterOreImplVisitor(methodVisitor, true);
- }
- return methodVisitor;
- }
+ public static final class OreDictionaryVisitor extends ClassVisitor {
- }
+ public OreDictionaryVisitor(ClassVisitor cv) {
+ super(ASM5, cv);
+ }
- private static final class RegisterOreImplVisitor extends MethodVisitor {
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ if (name.equals("registerOreImpl") && desc.equals("(Ljava/lang/String;Lnet/minecraft/item/ItemStack;)V")) {
+ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Found target method. [Unobfuscated]");
+ return new RegisterOreImplVisitor(methodVisitor, false);
+ } else if (name.equals("registerOreImpl") && desc.equals("(Ljava/lang/String;Ladd;)V")) {
+ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Found target method. [Obfuscated]");
+ return new RegisterOreImplVisitor(methodVisitor, true);
+ }
+ return methodVisitor;
+ }
+ }
- private final boolean mObfuscated;
-
- public RegisterOreImplVisitor(MethodVisitor mv, boolean obfuscated) {
- super(ASM5, mv);
- this.mObfuscated = obfuscated;
- }
+ private static final class RegisterOreImplVisitor extends MethodVisitor {
- @Override
- public void visitCode() {
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Fixing Forge's poor attempt at an oreDictionary.");
- super.visitCode();
- super.visitVarInsn(ALOAD, 0);
- super.visitVarInsn(ALOAD, 1);
- if (!mObfuscated){
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Injecting target method. [Unobfuscated]");
- super.visitMethodInsn(INVOKESTATIC,
- "gtPlusPlus/preloader/Preloader_GT_OreDict",
- "shouldPreventRegistration",
- "(Ljava/lang/String;Lnet/minecraft/item/ItemStack;)Z",
- false);
- }
- else {
- FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Injecting target method. [Obfuscated]");
- super.visitMethodInsn(INVOKESTATIC,
- "gtPlusPlus/preloader/Preloader_GT_OreDict",
- "shouldPreventRegistration",
- "(Ljava/lang/String;Ladd;)Z",
- false);
- }
- Label endLabel = new Label();
- super.visitJumpInsn(IFEQ, endLabel);
- super.visitInsn(RETURN);
- super.visitLabel(endLabel);
- }
+ private final boolean mObfuscated;
- }
+ public RegisterOreImplVisitor(MethodVisitor mv, boolean obfuscated) {
+ super(ASM5, mv);
+ this.mObfuscated = obfuscated;
+ }
+ @Override
+ public void visitCode() {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer", Level.INFO, "Fixing Forge's poor attempt at an oreDictionary.");
+ super.visitCode();
+ super.visitVarInsn(ALOAD, 0);
+ super.visitVarInsn(ALOAD, 1);
+ if (!mObfuscated) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer", Level.INFO, "Injecting target method. [Unobfuscated]");
+ super.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/Preloader_GT_OreDict",
+ "shouldPreventRegistration",
+ "(Ljava/lang/String;Lnet/minecraft/item/ItemStack;)Z",
+ false);
+ } else {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] OreDictTransformer", Level.INFO, "Injecting target method. [Obfuscated]");
+ super.visitMethodInsn(
+ INVOKESTATIC,
+ "gtPlusPlus/preloader/Preloader_GT_OreDict",
+ "shouldPreventRegistration",
+ "(Ljava/lang/String;Ladd;)Z",
+ false);
+ }
+ Label endLabel = new Label();
+ super.visitJumpInsn(IFEQ, endLabel);
+ super.visitInsn(RETURN);
+ super.visitLabel(endLabel);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java
index 443337bd35..3735f08860 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java
@@ -2,15 +2,14 @@ package gtPlusPlus.preloader.asm.transformers;
public class Preloader_ClassTransformer2 {
- /**
- *
- * So what I'd try is something like patch a new field into BaseMetaTileEntity to hold the ItemNBT,
- * then patch GT_Block_Machines.breakBlock to store the ItemNBT into that field by calling setItemNBT,
- * and then patch BaseMetaTileEntity.getDrops to retrieve that field instead of calling setItemNBT
- * But there's probably a simpler solution if all you want to do is fix this
- * for your super tanks rather than for all GT machines
- * (which would only include saving the output count for chest buffers and item distributors...)
- *
- */
-
+ /**
+ *
+ * So what I'd try is something like patch a new field into BaseMetaTileEntity to hold the ItemNBT,
+ * then patch GT_Block_Machines.breakBlock to store the ItemNBT into that field by calling setItemNBT,
+ * and then patch BaseMetaTileEntity.getDrops to retrieve that field instead of calling setItemNBT
+ * But there's probably a simpler solution if all you want to do is fix this
+ * for your super tanks rather than for all GT machines
+ * (which would only include saving the output count for chest buffers and item distributors...)
+ *
+ */
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java
index a8688e21ff..1f2abc4a06 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java
@@ -1,5 +1,7 @@
package gtPlusPlus.preloader.asm.transformers;
+import static gtPlusPlus.preloader.asm.ClassesToTransform.*;
+
import cpw.mods.fml.relauncher.CoreModManager;
import cpw.mods.fml.relauncher.ReflectionHelper;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -8,274 +10,309 @@ import gtPlusPlus.preloader.DevHelper;
import gtPlusPlus.preloader.Preloader_Logger;
import gtPlusPlus.preloader.asm.AsmConfig;
import gtPlusPlus.preloader.asm.transformers.Preloader_ClassTransformer.OreDictionaryVisitor;
+import java.io.File;
+import java.io.IOException;
import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraft.launchwrapper.Launch;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
-import java.io.File;
-import java.io.IOException;
-
-import static gtPlusPlus.preloader.asm.ClassesToTransform.*;
-
public class Preloader_Transformer_Handler implements IClassTransformer {
- public static final AsmConfig mConfig;
- public static final AutoMap<String> IC2_WRENCH_PATCH_CLASS_NAMES = new AutoMap<String>();
-
- static {
- mConfig = new AsmConfig(new File("config/GTplusplus/asm.cfg"));
- Preloader_Logger.INFO("Config Location: "+AsmConfig.config.getConfigFile().getAbsolutePath());
- Preloader_Logger.INFO("Is DevHelper Valid? "+DevHelper.mIsValidHelper);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_BASE_TILE_ENTITY);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_MACHINE1);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_MACHINE2);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_MACHINE3);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_KINETIC_GENERATOR);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_HEAT_GENERATOR);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_GENERATOR);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_ACCESS_HATCH);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_CHAMBER);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_FLUID_PORT);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_REDSTONE_PORT);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_VESSEL);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_PERSONAL);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_CHARGEPAD);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_ELECTRIC);
- IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_LUMINATOR);
- }
-
- private static Boolean mObf = null;
-
- public boolean checkObfuscated() {
- if (mObf != null) {
- return mObf;
- }
- boolean obfuscated = false;
- try {
- obfuscated = !(boolean) ReflectionHelper.findField(CoreModManager.class, "deobfuscatedEnvironment").get(null);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- e.printStackTrace();
- byte[] bs;
- try {
- bs = Launch.classLoader.getClassBytes("net.minecraft.world.World");
- if (bs != null) {
- obfuscated = false;
- } else {
- obfuscated = true;
- }
- } catch (IOException e1) {
- e1.printStackTrace();
- obfuscated = false;
- }
- }
- mObf = obfuscated;
- return obfuscated;
- }
-
- public byte[] transform(String name, String transformedName, byte[] basicClass) {
- /*
- * Here we patch all instances of entity.setHealth and replace them with a static function.
- * Only EntityLivingBase is left untouched, as nothing else truly needs to be calling this method and avoiding forge hooks.
- * May exclude all vanilla/forge class if this causes issues though.
- */
- /* PatchForge : if (AsmConfig.enabledFixEntitySetHealth && !transformedName.contains("gtPlusPlus.preloader")) {
-
- //Skip Vanilla/Forge Classes
- if (transformedName.contains("net.minecraft.") || transformedName.contains("cpw.")) {
- //break PatchForge;
- }
-
- ClassTransformer_Forge_EntityLivingBase_SetHealth aForgeHealthFix = new ClassTransformer_Forge_EntityLivingBase_SetHealth(transformedName, basicClass);
- if (aForgeHealthFix.isValidTransformer() && aForgeHealthFix.didPatchClass()) {
- Preloader_Logger.INFO("Fix EntityLivingBase.setHealth misuse", "Transforming "+transformedName);
- basicClass = aForgeHealthFix.getWriter().toByteArray();
- }
- }*/
-
- // Is this environment obfuscated? (Extra checks just in case some weird shit happens during the check)
- final boolean obfuscated = checkObfuscated();
-
- // Fix LWJGL index array out of bounds on keybinding IDs
- if ((transformedName.equals(LWJGL_KEYBOARD) || transformedName.equals(MINECRAFT_GAMESETTINGS_OBF) || transformedName.equals(MINECRAFT_GAMESETTINGS)) && AsmConfig.enabledLwjglKeybindingFix) {
- boolean isClientSettingsClass = false;
- if (!transformedName.equals("org.lwjgl.input.Keyboard")) {
- isClientSettingsClass = true;
- }
- Preloader_Logger.INFO("LWJGL Keybinding index out of bounds fix", "Transforming "+transformedName);
- return new ClassTransformer_LWJGL_Keyboard(basicClass, isClientSettingsClass).getWriter().toByteArray();
- }
-
- //Enable mapping of Tickets and loaded chunks. - Forge
- if (transformedName.equals(FORGE_CHUNK_MANAGER) && AsmConfig.enableChunkDebugging) {
- Preloader_Logger.INFO("Chunkloading Patch", "Transforming "+transformedName);
- return new ClassTransformer_Forge_ChunkLoading(basicClass, false).getWriter().toByteArray();
- }
-
- // Fix the OreDictionary - Forge
- if (transformedName.equals(FORGE_ORE_DICTIONARY) && AsmConfig.enableOreDictPatch) {
- Preloader_Logger.INFO("OreDictTransformer", "Transforming "+transformedName);
- ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
- new ClassReader(basicClass).accept(new OreDictionaryVisitor(classWriter), 0);
- return classWriter.toByteArray();
- }
-
- // Log Handling of CodeChicken
- if (transformedName.equals("codechicken.nei.guihook.GuiContainerManager")) {
- //Preloader_Logger.INFO("CodeChicken GuiContainerManager Patch", "Transforming "+transformedName);
- //return new ClassTransformer_CC_GuiContainerManager(basicClass).getWriter().toByteArray();
- }
- // Fix the OreDictionary COFH
- if (transformedName.equals(COFH_ORE_DICTIONARY_ARBITER) && (AsmConfig.enableCofhPatch || !obfuscated)) {
- Preloader_Logger.INFO("COFH", "Transforming "+transformedName);
- return new ClassTransformer_COFH_OreDictionaryArbiter(basicClass).getWriter().toByteArray();
- }
-
- // Fix Tinkers Fluids
- if (transformedName.equals(TINKERS_FLUID_BLOCK) && AsmConfig.enableTiConFluidLighting) {
- Preloader_Logger.INFO("Bright Fluids", "Transforming "+transformedName);
- return new ClassTransformer_TiConFluids("getLightValue", obfuscated, basicClass).getWriter().toByteArray();
- }
-
- //Fix RC stuff
- //Patching PROCESS_VOLUME to allow more transfer limits
- if (transformedName.equals(RAILCRAFT_FLUID_HELPER) && (AsmConfig.enableRcFlowFix && AsmConfig.maxRailcraftTankProcessVolume != 4000)) {
- Preloader_Logger.INFO("Railcraft PROCESS_VOLUME Patch", "Transforming "+transformedName);
- return new ClassTransformer_Railcraft_FluidHelper(basicClass, obfuscated).getWriter().toByteArray();
- }
- //Patching TRANSFER_RATE in Fluid Loaders/Unloaders
- if ((transformedName.equals(RAILCRAFT_TILE_FLUID_LOADER) && AsmConfig.maxRailcraftFluidLoaderFlow != 20) || (transformedName.equals("mods.railcraft.common.blocks.machine.gamma.TileFluidUnloader") && AsmConfig.maxRailcraftFluidUnloaderFlow != 80)) {
- Preloader_Logger.INFO("Railcraft TRANSFER_RATE Patch", "Transforming "+transformedName);
- return new ClassTransformer_Railcraft_FluidCartHandling(basicClass, obfuscated, transformedName).getWriter().toByteArray();
- }
- //Fix Weird glitch involving negative itemstacks.
- if (transformedName.equals(RAILCRAFT_INVENTORY_TOOLS) && AsmConfig.enableRcItemDupeFix) {
- Preloader_Logger.INFO("Railcraft negative ItemStack Fix", "Transforming "+transformedName);
- return new ClassTransformer_Railcraft_InvTools(basicClass, obfuscated).getWriter().toByteArray();
- }
-
- //Fix GC stuff
- if (AsmConfig.enableGcFuelChanges) {
- if (transformedName.equals(GALACTICRAFT_FLUID_UTILS)) {
- Preloader_Logger.INFO("Galacticraft FluidUtils Patch", "Transforming "+transformedName);
- return new ClassTransformer_GC_FluidUtil(basicClass, false).getWriter().toByteArray();
- }
- if (transformedName.equals(GALACTICRAFT_TILE_ENTITY_FUEL_LOADER)) {
- Preloader_Logger.INFO("Galacticraft Fuel_Loader Patch", "Transforming "+transformedName);
- return new ClassTransformer_GC_FuelLoader(basicClass, false).getWriter().toByteArray();
- }
- if (transformedName.equals(GALACTICRAFT_ENTITY_AUTO_ROCKET)) {
- Preloader_Logger.INFO("Galacticraft EntityAutoRocket Patch", "Transforming "+transformedName);
- return new ClassTransformer_GC_EntityAutoRocket(basicClass, false).getWriter().toByteArray();
- }
- }
-
-
- /**
- * Gregtech ASM Patches
- */
-
-// if (transformedName.equals(GT_UTILITY)) {
-// Preloader_Logger.INFO("Gregtech Utilities Patch", "Transforming "+transformedName);
-// return new ClassTransformer_GT_Utility(basicClass, transformedName).getWriter().toByteArray();
-// }
- //Try patch achievements
- if (transformedName.equals(GT_ACHIEVEMENTS)) {
- Preloader_Logger.INFO("Gregtech Achievements Patch", "Transforming " + transformedName);
- return new ClassTransformer_GT_Achievements_CrashFix(basicClass, obfuscated).getWriter().toByteArray();
- }
-
- //Fix bad handling of a loop left from original decompilation
- //Also Fix Achievements, although currently disabled.
- if (transformedName.equals(GT_CLIENT_PROXY)) {
- Preloader_Logger.INFO("Gregtech Client Proxy Patch", "Transforming " + transformedName);
- return new ClassTransformer_GT_Client(basicClass, obfuscated).getByteArray();
- }
-
- //Make GT packets safer, fill them with debug info.
- if (transformedName.equals(GT_PACKET_TILE_ENTITY)) {
- Preloader_Logger.INFO("Gregtech GT_Packet_TileEntity Patch", "Transforming "+transformedName);
- return new ClassTransformer_GT_Packet_TileEntity(basicClass, obfuscated).getWriter().toByteArray();
- }
- //Make the setting of GT Tiles safer, so as not to crash the client.
- if (transformedName.equals(GT_BASE_META_TILE_ENTITY)) {
- Preloader_Logger.INFO("Gregtech setMetaTileEntity Patch", "Transforming "+transformedName);
- return new ClassTransformer_GT_BaseMetaTileEntity(basicClass).getWriter().toByteArray();
- }
- //Add extra tools if we're in a dev environment.
- if (transformedName.equals(GT_METAGENERATED_TOOL) && CORE_Preloader.DEV_ENVIRONMENT) {
- Preloader_Logger.INFO("Gregtech Additional Tools Patch", "Transforming "+transformedName);
- return new ClassTransformer_GT_MetaGenerated_Tool(basicClass).getWriter().toByteArray();
- }
- //Fix log handling on the charcoal pit
- if (transformedName.equals(GT_MTE_CHARCOAL_PIT) && AsmConfig.enableGtCharcoalPitFix) {
- Preloader_Logger.INFO("GT Charcoal Pit Fix", "Transforming "+transformedName);
- return new ClassTransformer_GT_CharcoalPit(basicClass, obfuscated).getWriter().toByteArray();
- }
-
-
-
-
- //Patching Meta Tile Tooltips
- if (transformedName.equals(GT_ITEM_MACHINES) && AsmConfig.enableGtTooltipFix) {
- //Preloader_Logger.INFO("Gregtech Tooltip Patch", "Transforming "+transformedName);
- //return new ClassTransformer_GT_ItemMachines_Tooltip(basicClass, false).getWriter().toByteArray();
- }
-
-
- if (transformedName.equals(GT_BLOCK_MACHINES)) {
- //Fix GT NBT Persistency issue
- Preloader_Logger.INFO("Gregtech NBT Persistency Patch", "Transforming "+transformedName);
- byte[] g = new ClassTransformer_GT_BlockMachines_NBT(basicClass, false).getWriter().toByteArray();
- Preloader_Logger.INFO("Gregtech getTileEntityBaseType Patch", "Transforming "+transformedName);
- return new ClassTransformer_GT_BlockMachines_MetaPipeEntity(g, 0).getWriter().toByteArray();
- }
- if (transformedName.equals(GT_METAPIPE_ITEM) || transformedName.equals(GT_METAPIPE_FRAME) || transformedName.equals(GT_METAPIPE_FLUID)) {
- Preloader_Logger.INFO("Gregtech getTileEntityBaseType Patch", "Transforming "+transformedName);
- int mode = 0;
- if (transformedName.equals(GT_METAPIPE_ITEM)) {
- mode = 1;
- }
- else if (transformedName.equals(GT_METAPIPE_FRAME)) {
- mode = 2;
- }
- else {
- mode = 3;
- }
- return new ClassTransformer_GT_BlockMachines_MetaPipeEntity(basicClass, mode).getWriter().toByteArray();
- }
-
-
- //Fix IC2 Wrench Harvesting
- for (String y : IC2_WRENCH_PATCH_CLASS_NAMES) {
- if (transformedName.equals(y)) {
- Preloader_Logger.INFO("IC2 getHarvestTool Patch", "Transforming "+transformedName);
- return new ClassTransformer_IC2_GetHarvestTool(basicClass, obfuscated, transformedName).getWriter().toByteArray();
- }
- }
-
- //This is breaking IC2 Hazmat, moved to hodgepodge
-// if (transformedName.equals(IC2_ITEM_ARMOUR_HAZMAT)) {
-// Preloader_Logger.INFO("IC2 Hazmat Patch", "Transforming "+transformedName);
-// return new ClassTransformer_IC2_Hazmat(basicClass, transformedName).getWriter().toByteArray();
-// }
-
- //Fix Thaumcraft Shit
- //Patching ItemWispEssence to allow invalid item handling
- if (transformedName.equals(THAUMCRAFT_ITEM_WISP_ESSENCE) && AsmConfig.enableTcAspectSafety) {
- Preloader_Logger.INFO("Thaumcraft WispEssence_Patch", "Transforming "+transformedName);
- return new ClassTransformer_TC_ItemWispEssence(basicClass, obfuscated).getWriter().toByteArray();
- }
- //Fix Thaumic Tinkerer Shit
- if (transformedName.equals(THAUMICTINKERER_TILE_REPAIRER) && AsmConfig.enableThaumicTinkererRepairFix) {
- //Preloader_Logger.INFO("Thaumic Tinkerer RepairItem Patch", "Transforming "+transformedName);
- //return new ClassTransformer_TT_ThaumicRestorer(basicClass).getWriter().toByteArray();
- }
-
-
- return basicClass;
- }
-
-
-
+ public static final AsmConfig mConfig;
+ public static final AutoMap<String> IC2_WRENCH_PATCH_CLASS_NAMES = new AutoMap<String>();
+
+ static {
+ mConfig = new AsmConfig(new File("config/GTplusplus/asm.cfg"));
+ Preloader_Logger.INFO(
+ "Config Location: " + AsmConfig.config.getConfigFile().getAbsolutePath());
+ Preloader_Logger.INFO("Is DevHelper Valid? " + DevHelper.mIsValidHelper);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_BASE_TILE_ENTITY);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_MACHINE1);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_MACHINE2);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_MACHINE3);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_KINETIC_GENERATOR);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_HEAT_GENERATOR);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_GENERATOR);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_ACCESS_HATCH);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_CHAMBER);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_FLUID_PORT);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_REDSTONE_PORT);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_REACTOR_VESSEL);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_PERSONAL);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_CHARGEPAD);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_ELECTRIC);
+ IC2_WRENCH_PATCH_CLASS_NAMES.add(IC2_BLOCK_LUMINATOR);
+ }
+
+ private static Boolean mObf = null;
+
+ public boolean checkObfuscated() {
+ if (mObf != null) {
+ return mObf;
+ }
+ boolean obfuscated = false;
+ try {
+ obfuscated = !(boolean) ReflectionHelper.findField(CoreModManager.class, "deobfuscatedEnvironment")
+ .get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ byte[] bs;
+ try {
+ bs = Launch.classLoader.getClassBytes("net.minecraft.world.World");
+ if (bs != null) {
+ obfuscated = false;
+ } else {
+ obfuscated = true;
+ }
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ obfuscated = false;
+ }
+ }
+ mObf = obfuscated;
+ return obfuscated;
+ }
+
+ public byte[] transform(String name, String transformedName, byte[] basicClass) {
+ /*
+ * Here we patch all instances of entity.setHealth and replace them with a static function.
+ * Only EntityLivingBase is left untouched, as nothing else truly needs to be calling this method and avoiding forge hooks.
+ * May exclude all vanilla/forge class if this causes issues though.
+ */
+ /* PatchForge : if (AsmConfig.enabledFixEntitySetHealth && !transformedName.contains("gtPlusPlus.preloader")) {
+
+ //Skip Vanilla/Forge Classes
+ if (transformedName.contains("net.minecraft.") || transformedName.contains("cpw.")) {
+ //break PatchForge;
+ }
+
+ ClassTransformer_Forge_EntityLivingBase_SetHealth aForgeHealthFix = new ClassTransformer_Forge_EntityLivingBase_SetHealth(transformedName, basicClass);
+ if (aForgeHealthFix.isValidTransformer() && aForgeHealthFix.didPatchClass()) {
+ Preloader_Logger.INFO("Fix EntityLivingBase.setHealth misuse", "Transforming "+transformedName);
+ basicClass = aForgeHealthFix.getWriter().toByteArray();
+ }
+ }*/
+
+ // Is this environment obfuscated? (Extra checks just in case some weird shit happens during the check)
+ final boolean obfuscated = checkObfuscated();
+
+ // Fix LWJGL index array out of bounds on keybinding IDs
+ if ((transformedName.equals(LWJGL_KEYBOARD)
+ || transformedName.equals(MINECRAFT_GAMESETTINGS_OBF)
+ || transformedName.equals(MINECRAFT_GAMESETTINGS))
+ && AsmConfig.enabledLwjglKeybindingFix) {
+ boolean isClientSettingsClass = false;
+ if (!transformedName.equals("org.lwjgl.input.Keyboard")) {
+ isClientSettingsClass = true;
+ }
+ Preloader_Logger.INFO("LWJGL Keybinding index out of bounds fix", "Transforming " + transformedName);
+ return new ClassTransformer_LWJGL_Keyboard(basicClass, isClientSettingsClass)
+ .getWriter()
+ .toByteArray();
+ }
+
+ // Enable mapping of Tickets and loaded chunks. - Forge
+ if (transformedName.equals(FORGE_CHUNK_MANAGER) && AsmConfig.enableChunkDebugging) {
+ Preloader_Logger.INFO("Chunkloading Patch", "Transforming " + transformedName);
+ return new ClassTransformer_Forge_ChunkLoading(basicClass, false)
+ .getWriter()
+ .toByteArray();
+ }
+
+ // Fix the OreDictionary - Forge
+ if (transformedName.equals(FORGE_ORE_DICTIONARY) && AsmConfig.enableOreDictPatch) {
+ Preloader_Logger.INFO("OreDictTransformer", "Transforming " + transformedName);
+ ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
+ new ClassReader(basicClass).accept(new OreDictionaryVisitor(classWriter), 0);
+ return classWriter.toByteArray();
+ }
+
+ // Log Handling of CodeChicken
+ if (transformedName.equals("codechicken.nei.guihook.GuiContainerManager")) {
+ // Preloader_Logger.INFO("CodeChicken GuiContainerManager Patch", "Transforming "+transformedName);
+ // return new ClassTransformer_CC_GuiContainerManager(basicClass).getWriter().toByteArray();
+ }
+ // Fix the OreDictionary COFH
+ if (transformedName.equals(COFH_ORE_DICTIONARY_ARBITER) && (AsmConfig.enableCofhPatch || !obfuscated)) {
+ Preloader_Logger.INFO("COFH", "Transforming " + transformedName);
+ return new ClassTransformer_COFH_OreDictionaryArbiter(basicClass)
+ .getWriter()
+ .toByteArray();
+ }
+
+ // Fix Tinkers Fluids
+ if (transformedName.equals(TINKERS_FLUID_BLOCK) && AsmConfig.enableTiConFluidLighting) {
+ Preloader_Logger.INFO("Bright Fluids", "Transforming " + transformedName);
+ return new ClassTransformer_TiConFluids("getLightValue", obfuscated, basicClass)
+ .getWriter()
+ .toByteArray();
+ }
+
+ // Fix RC stuff
+ // Patching PROCESS_VOLUME to allow more transfer limits
+ if (transformedName.equals(RAILCRAFT_FLUID_HELPER)
+ && (AsmConfig.enableRcFlowFix && AsmConfig.maxRailcraftTankProcessVolume != 4000)) {
+ Preloader_Logger.INFO("Railcraft PROCESS_VOLUME Patch", "Transforming " + transformedName);
+ return new ClassTransformer_Railcraft_FluidHelper(basicClass, obfuscated)
+ .getWriter()
+ .toByteArray();
+ }
+ // Patching TRANSFER_RATE in Fluid Loaders/Unloaders
+ if ((transformedName.equals(RAILCRAFT_TILE_FLUID_LOADER) && AsmConfig.maxRailcraftFluidLoaderFlow != 20)
+ || (transformedName.equals("mods.railcraft.common.blocks.machine.gamma.TileFluidUnloader")
+ && AsmConfig.maxRailcraftFluidUnloaderFlow != 80)) {
+ Preloader_Logger.INFO("Railcraft TRANSFER_RATE Patch", "Transforming " + transformedName);
+ return new ClassTransformer_Railcraft_FluidCartHandling(basicClass, obfuscated, transformedName)
+ .getWriter()
+ .toByteArray();
+ }
+ // Fix Weird glitch involving negative itemstacks.
+ if (transformedName.equals(RAILCRAFT_INVENTORY_TOOLS) && AsmConfig.enableRcItemDupeFix) {
+ Preloader_Logger.INFO("Railcraft negative ItemStack Fix", "Transforming " + transformedName);
+ return new ClassTransformer_Railcraft_InvTools(basicClass, obfuscated)
+ .getWriter()
+ .toByteArray();
+ }
+
+ // Fix GC stuff
+ if (AsmConfig.enableGcFuelChanges) {
+ if (transformedName.equals(GALACTICRAFT_FLUID_UTILS)) {
+ Preloader_Logger.INFO("Galacticraft FluidUtils Patch", "Transforming " + transformedName);
+ return new ClassTransformer_GC_FluidUtil(basicClass, false)
+ .getWriter()
+ .toByteArray();
+ }
+ if (transformedName.equals(GALACTICRAFT_TILE_ENTITY_FUEL_LOADER)) {
+ Preloader_Logger.INFO("Galacticraft Fuel_Loader Patch", "Transforming " + transformedName);
+ return new ClassTransformer_GC_FuelLoader(basicClass, false)
+ .getWriter()
+ .toByteArray();
+ }
+ if (transformedName.equals(GALACTICRAFT_ENTITY_AUTO_ROCKET)) {
+ Preloader_Logger.INFO("Galacticraft EntityAutoRocket Patch", "Transforming " + transformedName);
+ return new ClassTransformer_GC_EntityAutoRocket(basicClass, false)
+ .getWriter()
+ .toByteArray();
+ }
+ }
+
+ /**
+ * Gregtech ASM Patches
+ */
+
+ // if (transformedName.equals(GT_UTILITY)) {
+ // Preloader_Logger.INFO("Gregtech Utilities Patch", "Transforming "+transformedName);
+ // return new ClassTransformer_GT_Utility(basicClass, transformedName).getWriter().toByteArray();
+ // }
+ // Try patch achievements
+ if (transformedName.equals(GT_ACHIEVEMENTS)) {
+ Preloader_Logger.INFO("Gregtech Achievements Patch", "Transforming " + transformedName);
+ return new ClassTransformer_GT_Achievements_CrashFix(basicClass, obfuscated)
+ .getWriter()
+ .toByteArray();
+ }
+
+ // Fix bad handling of a loop left from original decompilation
+ // Also Fix Achievements, although currently disabled.
+ if (transformedName.equals(GT_CLIENT_PROXY)) {
+ Preloader_Logger.INFO("Gregtech Client Proxy Patch", "Transforming " + transformedName);
+ return new ClassTransformer_GT_Client(basicClass, obfuscated).getByteArray();
+ }
+
+ // Make GT packets safer, fill them with debug info.
+ if (transformedName.equals(GT_PACKET_TILE_ENTITY)) {
+ Preloader_Logger.INFO("Gregtech GT_Packet_TileEntity Patch", "Transforming " + transformedName);
+ return new ClassTransformer_GT_Packet_TileEntity(basicClass, obfuscated)
+ .getWriter()
+ .toByteArray();
+ }
+ // Make the setting of GT Tiles safer, so as not to crash the client.
+ if (transformedName.equals(GT_BASE_META_TILE_ENTITY)) {
+ Preloader_Logger.INFO("Gregtech setMetaTileEntity Patch", "Transforming " + transformedName);
+ return new ClassTransformer_GT_BaseMetaTileEntity(basicClass)
+ .getWriter()
+ .toByteArray();
+ }
+ // Add extra tools if we're in a dev environment.
+ if (transformedName.equals(GT_METAGENERATED_TOOL) && CORE_Preloader.DEV_ENVIRONMENT) {
+ Preloader_Logger.INFO("Gregtech Additional Tools Patch", "Transforming " + transformedName);
+ return new ClassTransformer_GT_MetaGenerated_Tool(basicClass)
+ .getWriter()
+ .toByteArray();
+ }
+ // Fix log handling on the charcoal pit
+ if (transformedName.equals(GT_MTE_CHARCOAL_PIT) && AsmConfig.enableGtCharcoalPitFix) {
+ Preloader_Logger.INFO("GT Charcoal Pit Fix", "Transforming " + transformedName);
+ return new ClassTransformer_GT_CharcoalPit(basicClass, obfuscated)
+ .getWriter()
+ .toByteArray();
+ }
+
+ // Patching Meta Tile Tooltips
+ if (transformedName.equals(GT_ITEM_MACHINES) && AsmConfig.enableGtTooltipFix) {
+ // Preloader_Logger.INFO("Gregtech Tooltip Patch", "Transforming "+transformedName);
+ // return new ClassTransformer_GT_ItemMachines_Tooltip(basicClass, false).getWriter().toByteArray();
+ }
+
+ if (transformedName.equals(GT_BLOCK_MACHINES)) {
+ // Fix GT NBT Persistency issue
+ Preloader_Logger.INFO("Gregtech NBT Persistency Patch", "Transforming " + transformedName);
+ byte[] g = new ClassTransformer_GT_BlockMachines_NBT(basicClass, false)
+ .getWriter()
+ .toByteArray();
+ Preloader_Logger.INFO("Gregtech getTileEntityBaseType Patch", "Transforming " + transformedName);
+ return new ClassTransformer_GT_BlockMachines_MetaPipeEntity(g, 0)
+ .getWriter()
+ .toByteArray();
+ }
+ if (transformedName.equals(GT_METAPIPE_ITEM)
+ || transformedName.equals(GT_METAPIPE_FRAME)
+ || transformedName.equals(GT_METAPIPE_FLUID)) {
+ Preloader_Logger.INFO("Gregtech getTileEntityBaseType Patch", "Transforming " + transformedName);
+ int mode = 0;
+ if (transformedName.equals(GT_METAPIPE_ITEM)) {
+ mode = 1;
+ } else if (transformedName.equals(GT_METAPIPE_FRAME)) {
+ mode = 2;
+ } else {
+ mode = 3;
+ }
+ return new ClassTransformer_GT_BlockMachines_MetaPipeEntity(basicClass, mode)
+ .getWriter()
+ .toByteArray();
+ }
+
+ // Fix IC2 Wrench Harvesting
+ for (String y : IC2_WRENCH_PATCH_CLASS_NAMES) {
+ if (transformedName.equals(y)) {
+ Preloader_Logger.INFO("IC2 getHarvestTool Patch", "Transforming " + transformedName);
+ return new ClassTransformer_IC2_GetHarvestTool(basicClass, obfuscated, transformedName)
+ .getWriter()
+ .toByteArray();
+ }
+ }
+
+ // This is breaking IC2 Hazmat, moved to hodgepodge
+ // if (transformedName.equals(IC2_ITEM_ARMOUR_HAZMAT)) {
+ // Preloader_Logger.INFO("IC2 Hazmat Patch", "Transforming "+transformedName);
+ // return new ClassTransformer_IC2_Hazmat(basicClass, transformedName).getWriter().toByteArray();
+ // }
+
+ // Fix Thaumcraft Shit
+ // Patching ItemWispEssence to allow invalid item handling
+ if (transformedName.equals(THAUMCRAFT_ITEM_WISP_ESSENCE) && AsmConfig.enableTcAspectSafety) {
+ Preloader_Logger.INFO("Thaumcraft WispEssence_Patch", "Transforming " + transformedName);
+ return new ClassTransformer_TC_ItemWispEssence(basicClass, obfuscated)
+ .getWriter()
+ .toByteArray();
+ }
+ // Fix Thaumic Tinkerer Shit
+ if (transformedName.equals(THAUMICTINKERER_TILE_REPAIRER) && AsmConfig.enableThaumicTinkererRepairFix) {
+ // Preloader_Logger.INFO("Thaumic Tinkerer RepairItem Patch", "Transforming "+transformedName);
+ // return new ClassTransformer_TT_ThaumicRestorer(basicClass).getWriter().toByteArray();
+ }
+
+ return basicClass;
+ }
}
diff --git a/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java b/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java
index 532d20f1b2..4acfa1ccf2 100644
--- a/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java
+++ b/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java
@@ -31,20 +31,18 @@
*/
package gtPlusPlus.preloader.keyboard;
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.preloader.asm.transformers.ClassTransformer_LWJGL_Keyboard;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
-
+import net.minecraft.client.resources.I18n;
import org.apache.logging.log4j.Level;
import org.lwjgl.BufferUtils;
import org.lwjgl.input.Keyboard;
-import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import gtPlusPlus.preloader.asm.transformers.ClassTransformer_LWJGL_Keyboard;
-import net.minecraft.client.resources.I18n;
-
/**
* <br>
* A raw Keyboard interface. This can be used to poll the current state of the
@@ -58,75 +56,90 @@ import net.minecraft.client.resources.I18n;
*/
public class BetterKeyboard {
- public static final int KEYBOARD_SIZE = Short.MAX_VALUE;
-
- private static boolean init = false;
-
- public static void init() {
- if (!init) {
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Trying to patch out LWJGL internal arrays with larger ones.");
- Field aKeyNameSize = ReflectionUtils.getField(Keyboard.class, "keyName");
- Field aKeyMapSize = ReflectionUtils.getField(Keyboard.class, "keyMap");
- Field aKeyDownBuffer = ReflectionUtils.getField(Keyboard.class, "keyDownBuffer");
- String[] aOldKeyNameArray = ReflectionUtils.getFieldValue(aKeyNameSize);
- if (aOldKeyNameArray != null && aOldKeyNameArray.length < Short.MAX_VALUE) {
- String[] aNewKeyNameArray = new String[Short.MAX_VALUE];
- for (int i=0;i<aOldKeyNameArray.length;i++) {
- aNewKeyNameArray[i] = aOldKeyNameArray[i];
- }
- try {
- ReflectionUtils.setFinalFieldValue(Keyboard.class, aKeyNameSize.getName(), aNewKeyNameArray);
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Patched Field: "+aKeyNameSize.getName());
- }
- catch (Throwable t) {
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Failed Patching Field: "+aKeyDownBuffer.getName());
- }
- }
- Map<String, Integer> aOldKeyMapArray = ReflectionUtils.getFieldValue(aKeyMapSize);
- if (aOldKeyNameArray != null && aOldKeyMapArray.size() < Short.MAX_VALUE) {
- Map<String, Integer> aNewKeyMapArray = new HashMap<String, Integer>(Short.MAX_VALUE);
- aNewKeyMapArray.putAll(aOldKeyMapArray);
- try {
- ReflectionUtils.setFinalFieldValue(Keyboard.class, aKeyMapSize.getName(), aNewKeyMapArray);
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Patched Field: "+aKeyMapSize.getName());
- }
- catch (Throwable t) {
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Failed Patching Field: "+aKeyDownBuffer.getName());
- }
- }
- ByteBuffer aOldByteBuffer = ReflectionUtils.getFieldValue(aKeyDownBuffer);
- if (aOldByteBuffer != null && aOldByteBuffer.capacity() == Keyboard.KEYBOARD_SIZE) {
- ByteBuffer aNewByteBuffer = BufferUtils.createByteBuffer(Short.MAX_VALUE);
- try {
- ReflectionUtils.setFinalFieldValue(Keyboard.class, aKeyDownBuffer.getName(), aNewByteBuffer);
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Patched Field: "+aKeyDownBuffer.getName());
- }
- catch (Throwable t) {
- FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Failed Patching Field: "+aKeyDownBuffer.getName());
- }
- }
- init = true;
- }
- }
-
-
- /**
- * Gets a key's name
- * @param key The key
- * @return a String with the key's human readable name in it or null if the key is unnamed
- */
- public static synchronized String getKeyName(int key) {
- return ClassTransformer_LWJGL_Keyboard.getKeyName(key);
- }
-
+ public static final int KEYBOARD_SIZE = Short.MAX_VALUE;
+ private static boolean init = false;
+ public static void init() {
+ if (!init) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Trying to patch out LWJGL internal arrays with larger ones.");
+ Field aKeyNameSize = ReflectionUtils.getField(Keyboard.class, "keyName");
+ Field aKeyMapSize = ReflectionUtils.getField(Keyboard.class, "keyMap");
+ Field aKeyDownBuffer = ReflectionUtils.getField(Keyboard.class, "keyDownBuffer");
+ String[] aOldKeyNameArray = ReflectionUtils.getFieldValue(aKeyNameSize);
+ if (aOldKeyNameArray != null && aOldKeyNameArray.length < Short.MAX_VALUE) {
+ String[] aNewKeyNameArray = new String[Short.MAX_VALUE];
+ for (int i = 0; i < aOldKeyNameArray.length; i++) {
+ aNewKeyNameArray[i] = aOldKeyNameArray[i];
+ }
+ try {
+ ReflectionUtils.setFinalFieldValue(Keyboard.class, aKeyNameSize.getName(), aNewKeyNameArray);
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Patched Field: " + aKeyNameSize.getName());
+ } catch (Throwable t) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Failed Patching Field: " + aKeyDownBuffer.getName());
+ }
+ }
+ Map<String, Integer> aOldKeyMapArray = ReflectionUtils.getFieldValue(aKeyMapSize);
+ if (aOldKeyNameArray != null && aOldKeyMapArray.size() < Short.MAX_VALUE) {
+ Map<String, Integer> aNewKeyMapArray = new HashMap<String, Integer>(Short.MAX_VALUE);
+ aNewKeyMapArray.putAll(aOldKeyMapArray);
+ try {
+ ReflectionUtils.setFinalFieldValue(Keyboard.class, aKeyMapSize.getName(), aNewKeyMapArray);
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Patched Field: " + aKeyMapSize.getName());
+ } catch (Throwable t) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Failed Patching Field: " + aKeyDownBuffer.getName());
+ }
+ }
+ ByteBuffer aOldByteBuffer = ReflectionUtils.getFieldValue(aKeyDownBuffer);
+ if (aOldByteBuffer != null && aOldByteBuffer.capacity() == Keyboard.KEYBOARD_SIZE) {
+ ByteBuffer aNewByteBuffer = BufferUtils.createByteBuffer(Short.MAX_VALUE);
+ try {
+ ReflectionUtils.setFinalFieldValue(Keyboard.class, aKeyDownBuffer.getName(), aNewByteBuffer);
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Patched Field: " + aKeyDownBuffer.getName());
+ } catch (Throwable t) {
+ FMLRelaunchLog.log(
+ "[GT++ ASM] LWJGL Keybinding index out of bounds fix",
+ Level.INFO,
+ "Failed Patching Field: " + aKeyDownBuffer.getName());
+ }
+ }
+ init = true;
+ }
+ }
- /**
- * Represents a key or mouse button as a string. Args: key
- */
- public static String getKeyDisplayString(int aKeyValue) {
- return aKeyValue < 0 ? I18n.format("key.mouseButton", new Object[] {Integer.valueOf(aKeyValue + 101)}): getKeyName(aKeyValue);
- }
+ /**
+ * Gets a key's name
+ * @param key The key
+ * @return a String with the key's human readable name in it or null if the key is unnamed
+ */
+ public static synchronized String getKeyName(int key) {
+ return ClassTransformer_LWJGL_Keyboard.getKeyName(key);
+ }
+ /**
+ * Represents a key or mouse button as a string. Args: key
+ */
+ public static String getKeyDisplayString(int aKeyValue) {
+ return aKeyValue < 0
+ ? I18n.format("key.mouseButton", new Object[] {Integer.valueOf(aKeyValue + 101)})
+ : getKeyName(aKeyValue);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java b/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java
index 38f0d5a89b..72c6025323 100644
--- a/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java
+++ b/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java
@@ -7,10 +7,9 @@ import gtPlusPlus.core.util.minecraft.RecipeUtils;
public class HANDLER_AdvSolar {
- public static void postInit() {
- if (LoadedMods.AdvancedSolarPanel) {
- RecipeUtils.removeRecipeByOutput(ItemUtils.getSimpleStack(AdvancedSolarPanel.blockMolecularTransformer));
- }
- }
-
+ public static void postInit() {
+ if (LoadedMods.AdvancedSolarPanel) {
+ RecipeUtils.removeRecipeByOutput(ItemUtils.getSimpleStack(AdvancedSolarPanel.blockMolecularTransformer));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/HANDLER_CropsPlusPlus.java b/src/main/java/gtPlusPlus/xmod/bartcrops/HANDLER_CropsPlusPlus.java
index ce7d919431..9207749655 100644
--- a/src/main/java/gtPlusPlus/xmod/bartcrops/HANDLER_CropsPlusPlus.java
+++ b/src/main/java/gtPlusPlus/xmod/bartcrops/HANDLER_CropsPlusPlus.java
@@ -6,16 +6,16 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
public class HANDLER_CropsPlusPlus {
- public static void preInit(FMLPreInitializationEvent preinit) {
- LoaderOfTheCrops.load(preinit);
- }
-
- public static void init(FMLInitializationEvent init) {
- //registerItems();
- }
+ public static void preInit(FMLPreInitializationEvent preinit) {
+ LoaderOfTheCrops.load(preinit);
+ }
- public static void postInit(FMLPostInitializationEvent postinit) {
- LoaderOfTheCrops.register();
- LoaderOfTheCrops.registerBaseSeed();
- }
+ public static void init(FMLInitializationEvent init) {
+ // registerItems();
+ }
+
+ public static void postInit(FMLPostInitializationEvent postinit) {
+ LoaderOfTheCrops.register();
+ LoaderOfTheCrops.registerBaseSeed();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java
index 033aaac663..7114aa3db4 100644
--- a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java
+++ b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java
@@ -1,14 +1,13 @@
package gtPlusPlus.xmod.bartcrops;
-import java.util.ArrayList;
-import java.util.List;
-
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.bartcrops.crops.Crop_Force;
import gtPlusPlus.xmod.bartcrops.crops.Crop_Hemp;
import ic2.api.crops.CropCard;
import ic2.api.crops.Crops;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -16,96 +15,95 @@ import net.minecraft.item.ItemStack;
* Mostly borrowed from the Crops++ Crop Loader.
* @author Alkalus
*/
-
public class LoaderOfTheCrops {
-
- private static List<Boolean> mHasCropObj = new ArrayList<Boolean>();
- private CropCard mCropObj;
- private ItemStack mBaseSeed;
- private static List<LoaderOfTheCrops> mCropList = cropLoader();
-
- public LoaderOfTheCrops(CropCard cropObj) {
- this.mCropObj = cropObj;
- }
-
- public LoaderOfTheCrops(CropCard cropObj, ItemStack baseseed) {
- this.mCropObj = cropObj;
- this.mBaseSeed = baseseed;
- }
-
- public static CropCard cropUnpackerCC(LoaderOfTheCrops inp) {
- return inp.mCropObj;
- }
-
- private static ItemStack cropUnpackerCG(LoaderOfTheCrops inp) {
- return inp.mBaseSeed;
- }
-
- private static LoaderOfTheCrops cropHelper(CropCard cropObj) {
- return new LoaderOfTheCrops(cropObj, ItemUtils.getItemStackOfAmountFromOreDict("crop" + cropObj.name(), 0));
- }
-
- public static final List<LoaderOfTheCrops> cropLoader() {
- List<LoaderOfTheCrops> p = new ArrayList<LoaderOfTheCrops>();
-
- p.add(new LoaderOfTheCrops(new Crop_Hemp(), new ItemStack(Item.getItemById(111), 3)));
- p.add(new LoaderOfTheCrops(new Crop_Force(), new ItemStack(Item.getItemById(111), 3)));
-
- return p;
- }
-
- private static final List<CropCard> cropObjs() {
- List<CropCard> p = new ArrayList<CropCard>();
-
- for (int i = 0; i < mCropList.size(); ++i) {
- p.add(cropUnpackerCC((LoaderOfTheCrops) mCropList.get(i)));
- }
-
- return p;
- }
-
- private static final List<ItemStack> setBaseSeed() {
- List<ItemStack> p = new ArrayList<ItemStack>();
-
- for (int i = 0; i < mCropList.size(); ++i) {
- p.add(cropUnpackerCG((LoaderOfTheCrops) mCropList.get(i)));
- }
-
- return p;
- }
-
- private static final List<String> setnames() {
- List<String> s = new ArrayList<String>();
-
- for (int i = 0; i < mCropList.size(); ++i) {
- s.add(((CropCard) cropObjs().get(i)).name());
- }
-
- return s;
- }
-
- public static void load(FMLPreInitializationEvent preinit) {
- for (int i = 0; i < mCropList.size(); ++i) {
- mHasCropObj.add(true);
- }
- }
-
- public static void register() {
- for (int i = 0; i < mCropList.size(); ++i) {
- if ((Boolean) mHasCropObj.get(i) && cropObjs().get(i) != null) {
- Crops.instance.registerCrop((CropCard) cropObjs().get(i));
- }
- }
- }
-
- public static void registerBaseSeed() {
- List<ItemStack> baseseed = new ArrayList<ItemStack>(setBaseSeed());
-
- for (int i = 0; i < mCropList.size(); ++i) {
- if (baseseed.get(i) != null && cropObjs().get(i) != null) {
- Crops.instance.registerBaseSeed((ItemStack) baseseed.get(i), (CropCard) cropObjs().get(i), 1, 1, 1, 1);
- }
- }
-
- }
-} \ No newline at end of file
+
+ private static List<Boolean> mHasCropObj = new ArrayList<Boolean>();
+ private CropCard mCropObj;
+ private ItemStack mBaseSeed;
+ private static List<LoaderOfTheCrops> mCropList = cropLoader();
+
+ public LoaderOfTheCrops(CropCard cropObj) {
+ this.mCropObj = cropObj;
+ }
+
+ public LoaderOfTheCrops(CropCard cropObj, ItemStack baseseed) {
+ this.mCropObj = cropObj;
+ this.mBaseSeed = baseseed;
+ }
+
+ public static CropCard cropUnpackerCC(LoaderOfTheCrops inp) {
+ return inp.mCropObj;
+ }
+
+ private static ItemStack cropUnpackerCG(LoaderOfTheCrops inp) {
+ return inp.mBaseSeed;
+ }
+
+ private static LoaderOfTheCrops cropHelper(CropCard cropObj) {
+ return new LoaderOfTheCrops(cropObj, ItemUtils.getItemStackOfAmountFromOreDict("crop" + cropObj.name(), 0));
+ }
+
+ public static final List<LoaderOfTheCrops> cropLoader() {
+ List<LoaderOfTheCrops> p = new ArrayList<LoaderOfTheCrops>();
+
+ p.add(new LoaderOfTheCrops(new Crop_Hemp(), new ItemStack(Item.getItemById(111), 3)));
+ p.add(new LoaderOfTheCrops(new Crop_Force(), new ItemStack(Item.getItemById(111), 3)));
+
+ return p;
+ }
+
+ private static final List<CropCard> cropObjs() {
+ List<CropCard> p = new ArrayList<CropCard>();
+
+ for (int i = 0; i < mCropList.size(); ++i) {
+ p.add(cropUnpackerCC((LoaderOfTheCrops) mCropList.get(i)));
+ }
+
+ return p;
+ }
+
+ private static final List<ItemStack> setBaseSeed() {
+ List<ItemStack> p = new ArrayList<ItemStack>();
+
+ for (int i = 0; i < mCropList.size(); ++i) {
+ p.add(cropUnpackerCG((LoaderOfTheCrops) mCropList.get(i)));
+ }
+
+ return p;
+ }
+
+ private static final List<String> setnames() {
+ List<String> s = new ArrayList<String>();
+
+ for (int i = 0; i < mCropList.size(); ++i) {
+ s.add(((CropCard) cropObjs().get(i)).name());
+ }
+
+ return s;
+ }
+
+ public static void load(FMLPreInitializationEvent preinit) {
+ for (int i = 0; i < mCropList.size(); ++i) {
+ mHasCropObj.add(true);
+ }
+ }
+
+ public static void register() {
+ for (int i = 0; i < mCropList.size(); ++i) {
+ if ((Boolean) mHasCropObj.get(i) && cropObjs().get(i) != null) {
+ Crops.instance.registerCrop((CropCard) cropObjs().get(i));
+ }
+ }
+ }
+
+ public static void registerBaseSeed() {
+ List<ItemStack> baseseed = new ArrayList<ItemStack>(setBaseSeed());
+
+ for (int i = 0; i < mCropList.size(); ++i) {
+ if (baseseed.get(i) != null && cropObjs().get(i) != null) {
+ Crops.instance.registerBaseSeed(
+ (ItemStack) baseseed.get(i), (CropCard) cropObjs().get(i), 1, 1, 1, 1);
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java
index f62b429acb..41631eaae8 100644
--- a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java
+++ b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java
@@ -4,34 +4,33 @@ import gtPlusPlus.preloader.CORE_Preloader;
import ic2.api.crops.ICropTile;
public abstract class BaseAestheticCrop extends BaseHarvestableCrop {
-
- public int tier() {
- return 1;
- }
- public int stat(int n) {
- switch (n) {
- case 0 :
- return 0;
- case 1 :
- return 0;
- case 2 :
- return 0;
- case 3 :
- return 4;
- case 4 :
- return 0;
- default :
- return 0;
- }
- }
+ public int tier() {
+ return 1;
+ }
- public int growthDuration(ICropTile crop) {
- return CORE_Preloader.DEBUG_MODE ? 1 : 225;
- }
+ public int stat(int n) {
+ switch (n) {
+ case 0:
+ return 0;
+ case 1:
+ return 0;
+ case 2:
+ return 0;
+ case 3:
+ return 4;
+ case 4:
+ return 0;
+ default:
+ return 0;
+ }
+ }
- public byte getSizeAfterHarvest(ICropTile crop) {
- return 1;
- }
-
-} \ No newline at end of file
+ public int growthDuration(ICropTile crop) {
+ return CORE_Preloader.DEBUG_MODE ? 1 : 225;
+ }
+
+ public byte getSizeAfterHarvest(ICropTile crop) {
+ return 1;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java
index 271e3ad7eb..32c9dbf0f6 100644
--- a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java
+++ b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java
@@ -15,43 +15,42 @@ import net.minecraft.util.IIcon;
import speiger.src.crops.api.ICropCardInfo;
public abstract class BaseCrop extends CropCard implements ICropCardInfo {
-
- @SideOnly(Side.CLIENT)
- public void registerSprites(IIconRegister iconRegister) {
- this.textures = new IIcon[this.maxSize()];
- for (int i = 1; i <= this.textures.length; ++i) {
- this.textures[i - 1] = iconRegister.registerIcon(CORE.MODID+":crop/blockCrop." + this.name() + "." + i);
- }
-
- }
-
- public float dropGainChance() {
- return (float) (Math.pow(0.95D, (double) ((float) this.tier())) * (double) 1f);
- }
-
- public boolean canCross(ICropTile crop) {
- return crop.getSize() == this.maxSize();
- }
-
- public int getrootslength(ICropTile crop) {
- return 3;
- }
-
- public String discoveredBy() {
- return "Alkalus";
- }
-
- public String owner() {
- return "Gtplusplus";
- }
-
- public List<String> getCropInformation() {
- List<String> ret = new ArrayList<String>();
- ret.add(Arrays.toString(this.attributes()));
- return ret;
- }
-
- public ItemStack getDisplayItem(CropCard card) {
- return ItemUtils.getItemStackOfAmountFromOreDict("crop" + this.name(), 0);
- }
-} \ No newline at end of file
+
+ @SideOnly(Side.CLIENT)
+ public void registerSprites(IIconRegister iconRegister) {
+ this.textures = new IIcon[this.maxSize()];
+ for (int i = 1; i <= this.textures.length; ++i) {
+ this.textures[i - 1] = iconRegister.registerIcon(CORE.MODID + ":crop/blockCrop." + this.name() + "." + i);
+ }
+ }
+
+ public float dropGainChance() {
+ return (float) (Math.pow(0.95D, (double) ((float) this.tier())) * (double) 1f);
+ }
+
+ public boolean canCross(ICropTile crop) {
+ return crop.getSize() == this.maxSize();
+ }
+
+ public int getrootslength(ICropTile crop) {
+ return 3;
+ }
+
+ public String discoveredBy() {
+ return "Alkalus";
+ }
+
+ public String owner() {
+ return "Gtplusplus";
+ }
+
+ public List<String> getCropInformation() {
+ List<String> ret = new ArrayList<String>();
+ ret.add(Arrays.toString(this.attributes()));
+ return ret;
+ }
+
+ public ItemStack getDisplayItem(CropCard card) {
+ return ItemUtils.getItemStackOfAmountFromOreDict("crop" + this.name(), 0);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java
index e877233c67..3d56bba979 100644
--- a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java
+++ b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java
@@ -4,66 +4,66 @@ import gtPlusPlus.preloader.CORE_Preloader;
import ic2.api.crops.ICropTile;
public abstract class BaseHarvestableCrop extends BaseCrop {
-
- public int tier() {
- return 2;
- }
- public int stat(int n) {
- switch (n) {
- case 0 :
- return 0;
- case 1 :
- return 4;
- case 2 :
- return 0;
- case 3 :
- return 4;
- case 4 :
- return 0;
- default :
- return 0;
- }
- }
+ public int tier() {
+ return 2;
+ }
- public boolean canGrow(ICropTile crop) {
- return crop.getSize() < 3;
- }
+ public int stat(int n) {
+ switch (n) {
+ case 0:
+ return 0;
+ case 1:
+ return 4;
+ case 2:
+ return 0;
+ case 3:
+ return 4;
+ case 4:
+ return 0;
+ default:
+ return 0;
+ }
+ }
- public int getOptimalHavestSize(ICropTile crop) {
- return 3;
- }
+ public boolean canGrow(ICropTile crop) {
+ return crop.getSize() < 3;
+ }
- public boolean canBeHarvested(ICropTile crop) {
- return crop.getSize() == 3;
- }
+ public int getOptimalHavestSize(ICropTile crop) {
+ return 3;
+ }
- public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) {
- return (int) ((double) humidity * 1.2D + (double) nutrients * 0.9D + (double) air * 0.9D);
- }
+ public boolean canBeHarvested(ICropTile crop) {
+ return crop.getSize() == 3;
+ }
- public int growthDuration(ICropTile crop) {
- short r;
- if (CORE_Preloader.DEBUG_MODE) {
- r = 1;
- } else if (crop.getSize() == 2) {
- r = 200;
- } else {
- r = 700;
- }
+ public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) {
+ return (int) ((double) humidity * 1.2D + (double) nutrients * 0.9D + (double) air * 0.9D);
+ }
- return r;
- }
+ public int growthDuration(ICropTile crop) {
+ short r;
+ if (CORE_Preloader.DEBUG_MODE) {
+ r = 1;
+ } else if (crop.getSize() == 2) {
+ r = 200;
+ } else {
+ r = 700;
+ }
- public byte getSizeAfterHarvest(ICropTile crop) {
- return 2;
- }
+ return r;
+ }
- public int maxSize() {
- return 3;
- }
+ public byte getSizeAfterHarvest(ICropTile crop) {
+ return 2;
+ }
- public String discoveredBy() {
- return "Alkalus";
- }
-} \ No newline at end of file
+ public int maxSize() {
+ return 3;
+ }
+
+ public String discoveredBy() {
+ return "Alkalus";
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java b/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java
index 06238a4589..926bc33776 100644
--- a/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java
+++ b/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java
@@ -8,46 +8,46 @@ import ic2.api.crops.ICropTile;
import net.minecraft.item.ItemStack;
public class Crop_Force extends BaseAestheticCrop {
-
- public int tier() {
- return 4;
- }
-
- public String name() {
- return "Force";
- }
-
- public String discoveredBy() {
- return "Alkalus";
- }
-
- public int growthDuration(ICropTile crop) {
- int ret = 800;
-
- /*if (crop.isBlockBelow(Blocks.dirt) || crop.isBlockBelow(Blocks.flowing_water)) {
- ret = 225;
- }*/
-
- if (CORE_Preloader.DEBUG_MODE) {
- ret = 1;
- }
-
- return ret;
- }
-
- public String[] attributes() {
- return new String[]{"Power", "Soil", "Yellow", "Gold"};
- }
-
- public ItemStack getGain(ICropTile crop) {
- ItemStack ret = this.getDisplayItem();
- if (MathUtils.randInt(0, 10) > 8) {
- ret = STANDALONE.FORCE.getNugget(MathUtils.randInt(4, 8));
- }
- return ret;
- }
-
- public ItemStack getDisplayItem() {
- return STANDALONE.FORCE.getNugget(0);
- }
-} \ No newline at end of file
+
+ public int tier() {
+ return 4;
+ }
+
+ public String name() {
+ return "Force";
+ }
+
+ public String discoveredBy() {
+ return "Alkalus";
+ }
+
+ public int growthDuration(ICropTile crop) {
+ int ret = 800;
+
+ /*if (crop.isBlockBelow(Blocks.dirt) || crop.isBlockBelow(Blocks.flowing_water)) {
+ ret = 225;
+ }*/
+
+ if (CORE_Preloader.DEBUG_MODE) {
+ ret = 1;
+ }
+
+ return ret;
+ }
+
+ public String[] attributes() {
+ return new String[] {"Power", "Soil", "Yellow", "Gold"};
+ }
+
+ public ItemStack getGain(ICropTile crop) {
+ ItemStack ret = this.getDisplayItem();
+ if (MathUtils.randInt(0, 10) > 8) {
+ ret = STANDALONE.FORCE.getNugget(MathUtils.randInt(4, 8));
+ }
+ return ret;
+ }
+
+ public ItemStack getDisplayItem() {
+ return STANDALONE.FORCE.getNugget(0);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java b/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java
index 95e2766aae..c7cd1c0bea 100644
--- a/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java
+++ b/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java
@@ -9,48 +9,48 @@ import ic2.api.crops.ICropTile;
import net.minecraft.item.ItemStack;
public class Crop_Hemp extends BaseAestheticCrop {
-
- public int tier() {
- return 2;
- }
-
- public String name() {
- return "Hemp";
- }
-
- public String discoveredBy() {
- return "Alkalus";
- }
-
- public int growthDuration(ICropTile crop) {
- int ret = 550;
-
- /*if (crop.isBlockBelow(Blocks.dirt) || crop.isBlockBelow(Blocks.flowing_water)) {
- ret = 225;
- }*/
-
- if (CORE_Preloader.DEBUG_MODE) {
- ret = 1;
- }
-
- return ret;
- }
-
- public String[] attributes() {
- return new String[]{"Green", "Soil", "Orange"};
- }
-
- public ItemStack getGain(ICropTile crop) {
-
- ItemStack ret = this.getDisplayItem();
- if (MathUtils.randInt(0, 10) > 8) {
- ret = ItemUtils.getSimpleStack(ModItems.itemRope, MathUtils.randInt(1, 3));
- }
-
- return ret;
- }
-
- public ItemStack getDisplayItem() {
- return ItemUtils.getSimpleStack(ModItems.itemRope, 0);
- }
-} \ No newline at end of file
+
+ public int tier() {
+ return 2;
+ }
+
+ public String name() {
+ return "Hemp";
+ }
+
+ public String discoveredBy() {
+ return "Alkalus";
+ }
+
+ public int growthDuration(ICropTile crop) {
+ int ret = 550;
+
+ /*if (crop.isBlockBelow(Blocks.dirt) || crop.isBlockBelow(Blocks.flowing_water)) {
+ ret = 225;
+ }*/
+
+ if (CORE_Preloader.DEBUG_MODE) {
+ ret = 1;
+ }
+
+ return ret;
+ }
+
+ public String[] attributes() {
+ return new String[] {"Green", "Soil", "Orange"};
+ }
+
+ public ItemStack getGain(ICropTile crop) {
+
+ ItemStack ret = this.getDisplayItem();
+ if (MathUtils.randInt(0, 10) > 8) {
+ ret = ItemUtils.getSimpleStack(ModItems.itemRope, MathUtils.randInt(1, 3));
+ }
+
+ return ret;
+ }
+
+ public ItemStack getDisplayItem() {
+ return ItemUtils.getSimpleStack(ModItems.itemRope, 0);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bartworks/BW_Utils.java b/src/main/java/gtPlusPlus/xmod/bartworks/BW_Utils.java
index babd607aab..dba2976758 100644
--- a/src/main/java/gtPlusPlus/xmod/bartworks/BW_Utils.java
+++ b/src/main/java/gtPlusPlus/xmod/bartworks/BW_Utils.java
@@ -1,80 +1,85 @@
package gtPlusPlus.xmod.bartworks;
+import gregtech.api.enums.OrePrefixes;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Map;
-
-import gregtech.api.enums.OrePrefixes;
-import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.ItemStack;
public class BW_Utils {
- private final static Method sName;
- private final static Method sGet;
- private static final Class<?> sClassBW_NonMeta_MaterialItems;
- private static final Class<?> Werkstoff;
- private static final Class<?> WerkstoffLoader;
- private static final Map<Short, ?> werkstoffHashMap;
- private static final Method getCorrespondingItemStackUnsafe;
-
- static {
- sName = ReflectionUtils.getMethod(Enum.class, "name");
- sClassBW_NonMeta_MaterialItems = ReflectionUtils.getClass("com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems");
- sGet = ReflectionUtils.getMethod(sClassBW_NonMeta_MaterialItems, "get", long.class, Object[].class);
- Werkstoff = ReflectionUtils.getClass("com.github.bartimaeusnek.bartworks.system.material.Werkstoff");
- WerkstoffLoader = ReflectionUtils.getClass("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader");
- Field fieldWerkstoffHashMap = ReflectionUtils.getField(Werkstoff, "werkstoffHashMap");
- werkstoffHashMap = ReflectionUtils.getFieldValue(fieldWerkstoffHashMap);
- getCorrespondingItemStackUnsafe = ReflectionUtils.getMethod(WerkstoffLoader, "getCorrespondingItemStackUnsafe", OrePrefixes.class, Werkstoff, int.class);
- }
-
- public enum NonMeta_MaterialItem {
- Depleted_Tiberium_1,
- Depleted_Tiberium_2,
- Depleted_Tiberium_4,
- TiberiumCell_1,
- TiberiumCell_2,
- TiberiumCell_4,
- TheCoreCell,
- Depleted_TheCoreCell;
- }
-
- public static ItemStack getBW_NonMeta_MaterialItems(NonMeta_MaterialItem aItem, long aAmount) {
- if (sClassBW_NonMeta_MaterialItems != null && sClassBW_NonMeta_MaterialItems.isEnum()) {
- for (Object obj : sClassBW_NonMeta_MaterialItems.getEnumConstants()) {
- try {
- if (aItem.name().equals(ReflectionUtils.invokeNonBool(obj, sName, new Object[] {}))) {
- return ((ItemStack) ReflectionUtils.invokeNonBool(obj, sGet, new Object[] {aAmount, new Object[] {}})).copy();
- }
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
- }
- return null;
- }
-
- public static ArrayList<ItemStack> getAll(int aStackSize){
- ArrayList<ItemStack> aItems = new ArrayList<ItemStack>();
- aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_1, aStackSize));
- aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_2, aStackSize));
- aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_4, aStackSize));
- aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TheCoreCell, aStackSize));
- return aItems;
- }
+ private static final Method sName;
+ private static final Method sGet;
+ private static final Class<?> sClassBW_NonMeta_MaterialItems;
+ private static final Class<?> Werkstoff;
+ private static final Class<?> WerkstoffLoader;
+ private static final Map<Short, ?> werkstoffHashMap;
+ private static final Method getCorrespondingItemStackUnsafe;
+
+ static {
+ sName = ReflectionUtils.getMethod(Enum.class, "name");
+ sClassBW_NonMeta_MaterialItems =
+ ReflectionUtils.getClass("com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems");
+ sGet = ReflectionUtils.getMethod(sClassBW_NonMeta_MaterialItems, "get", long.class, Object[].class);
+ Werkstoff = ReflectionUtils.getClass("com.github.bartimaeusnek.bartworks.system.material.Werkstoff");
+ WerkstoffLoader =
+ ReflectionUtils.getClass("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader");
+ Field fieldWerkstoffHashMap = ReflectionUtils.getField(Werkstoff, "werkstoffHashMap");
+ werkstoffHashMap = ReflectionUtils.getFieldValue(fieldWerkstoffHashMap);
+ getCorrespondingItemStackUnsafe = ReflectionUtils.getMethod(
+ WerkstoffLoader, "getCorrespondingItemStackUnsafe", OrePrefixes.class, Werkstoff, int.class);
+ }
+
+ public enum NonMeta_MaterialItem {
+ Depleted_Tiberium_1,
+ Depleted_Tiberium_2,
+ Depleted_Tiberium_4,
+ TiberiumCell_1,
+ TiberiumCell_2,
+ TiberiumCell_4,
+ TheCoreCell,
+ Depleted_TheCoreCell;
+ }
+
+ public static ItemStack getBW_NonMeta_MaterialItems(NonMeta_MaterialItem aItem, long aAmount) {
+ if (sClassBW_NonMeta_MaterialItems != null && sClassBW_NonMeta_MaterialItems.isEnum()) {
+ for (Object obj : sClassBW_NonMeta_MaterialItems.getEnumConstants()) {
+ try {
+ if (aItem.name().equals(ReflectionUtils.invokeNonBool(obj, sName, new Object[] {}))) {
+ return ((ItemStack) ReflectionUtils.invokeNonBool(
+ obj, sGet, new Object[] {aAmount, new Object[] {}}))
+ .copy();
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ return null;
+ }
+
+ public static ArrayList<ItemStack> getAll(int aStackSize) {
+ ArrayList<ItemStack> aItems = new ArrayList<ItemStack>();
+ aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_1, aStackSize));
+ aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_2, aStackSize));
+ aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_4, aStackSize));
+ aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TheCoreCell, aStackSize));
+ return aItems;
+ }
- public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, short werkstoffID, int amount) {
- if (LoadedMods.BartWorks) {
- if (werkstoffHashMap != null) {
- Object werkstoff = werkstoffHashMap.get(werkstoffID);
- if (werkstoff != null) {
- return (ItemStack) ReflectionUtils.invokeNonBool(null, getCorrespondingItemStackUnsafe, new Object[]{orePrefixes, werkstoff, amount});
- }
- }
- }
- return null;
- }
+ public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, short werkstoffID, int amount) {
+ if (LoadedMods.BartWorks) {
+ if (werkstoffHashMap != null) {
+ Object werkstoff = werkstoffHashMap.get(werkstoffID);
+ if (werkstoff != null) {
+ return (ItemStack) ReflectionUtils.invokeNonBool(
+ null, getCorrespondingItemStackUnsafe, new Object[] {orePrefixes, werkstoff, amount});
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java b/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java
index 52f498988c..f66677838f 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java
@@ -1,181 +1,180 @@
package gtPlusPlus.xmod.bop;
-import java.lang.reflect.Field;
-
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
+import java.lang.reflect.Field;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class HANDLER_BiomesOPlenty {
-
- public static Item mPineCone;
-
- public static Block logs1;
- public static Block logs2;
- public static Block logs3;
- public static Block logs4;
-
- public static Block leaves1;
- public static Block leaves2;
- public static Block leaves3;
- public static Block leaves4;
-
- public static Block colorizedLeaves1;
- public static Block colorizedLeaves2;
-
- public static Block saplings;
- public static Block colorizedSaplings;
-
- public static void preInit(){
- BOP_Block_Registrator.run();
- if (LoadedMods.BiomesOPlenty){
- setFields();
- registerPineconeToOreDict();
- }
-
- }
-
- public static void init(){
- if (LoadedMods.BiomesOPlenty){
-
- }
- }
-
- public static void postInit(){
- BOP_Block_Registrator.recipes();
- if (LoadedMods.BiomesOPlenty){
-
- }
- }
-
- private static void registerPineconeToOreDict() {
- if (mPineCone != null) {
- ItemStack aPinecone = ItemUtils.simpleMetaStack(mPineCone, 13, 1);
- if (aPinecone != null) {
- ItemUtils.addItemToOreDictionary(aPinecone, "pinecone");
- }
- }
- }
-
- public static ItemStack getStack(Block aBlock, int aMeta, int aSize) {
- return ItemUtils.simpleMetaStack(aBlock, aMeta, aSize);
- }
-
-
-
- //BOPCBlocks.logs4 - 0
- //BOPCBlocks.colorizedLeaves2 - 1
-
- private static void setFields() {
- Field aBopMiscItem = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCItems"), "misc");
-
- Field aBopBlock1 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "logs1");
- Field aBopBlock2 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "logs2");
- Field aBopBlock3 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "logs3");
- Field aBopBlock4 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "logs4");
-
- Field aBopLeaves1 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "leaves1");
- Field aBopLeaves2 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "leaves2");
- Field aBopLeaves3 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "leaves3");
- Field aBopLeaves4 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "leaves4");
-
- Field aBopColouredLeaves1 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "colorizedLeaves1");
- Field aBopColouredLeaves2 = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "colorizedLeaves2");
-
- Field aBopSapling = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "saplings");
- Field aBopColouredSapling = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "colorizedSaplings");
-
- if (aBopMiscItem != null) {
- Item aMiscItem = ReflectionUtils.getFieldValue(aBopMiscItem);
- if (aMiscItem != null) {
- mPineCone = aMiscItem;
- }
- }
-
-
- if (aBopBlock1 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopBlock1);
- if (aBlock != null) {
- logs1 = aBlock;
- }
- }
- if (aBopBlock2 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopBlock2);
- if (aBlock != null) {
- logs2 = aBlock;
- }
- }
- if (aBopBlock3 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopBlock3);
- if (aBlock != null) {
- logs3 = aBlock;
- }
- }
- if (aBopBlock4 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopBlock4);
- if (aBlock != null) {
- logs4 = aBlock;
- }
- }
-
-
- if (aBopLeaves1 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves1);
- if (aBlock != null) {
- leaves1 = aBlock;
- }
- }
- if (aBopLeaves2 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves2);
- if (aBlock != null) {
- leaves2 = aBlock;
- }
- }
- if (aBopLeaves3 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves3);
- if (aBlock != null) {
- leaves3 = aBlock;
- }
- }
- if (aBopLeaves4 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves4);
- if (aBlock != null) {
- leaves4 = aBlock;
- }
- }
-
-
- if (aBopColouredLeaves1 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopColouredLeaves1);
- if (aBlock != null) {
- colorizedLeaves1 = aBlock;
- }
- }
- if (aBopColouredLeaves2 != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopColouredLeaves2);
- if (aBlock != null) {
- colorizedLeaves2 = aBlock;
- }
- }
-
-
- if (aBopSapling != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopSapling);
- if (aBlock != null) {
- saplings = aBlock;
- }
- }
- if (aBopColouredSapling != null) {
- Block aBlock = ReflectionUtils.getFieldValue(aBopColouredSapling);
- if (aBlock != null) {
- colorizedSaplings = aBlock;
- }
- }
- }
-
+ public static Item mPineCone;
+
+ public static Block logs1;
+ public static Block logs2;
+ public static Block logs3;
+ public static Block logs4;
+
+ public static Block leaves1;
+ public static Block leaves2;
+ public static Block leaves3;
+ public static Block leaves4;
+
+ public static Block colorizedLeaves1;
+ public static Block colorizedLeaves2;
+
+ public static Block saplings;
+ public static Block colorizedSaplings;
+
+ public static void preInit() {
+ BOP_Block_Registrator.run();
+ if (LoadedMods.BiomesOPlenty) {
+ setFields();
+ registerPineconeToOreDict();
+ }
+ }
+
+ public static void init() {
+ if (LoadedMods.BiomesOPlenty) {}
+ }
+
+ public static void postInit() {
+ BOP_Block_Registrator.recipes();
+ if (LoadedMods.BiomesOPlenty) {}
+ }
+
+ private static void registerPineconeToOreDict() {
+ if (mPineCone != null) {
+ ItemStack aPinecone = ItemUtils.simpleMetaStack(mPineCone, 13, 1);
+ if (aPinecone != null) {
+ ItemUtils.addItemToOreDictionary(aPinecone, "pinecone");
+ }
+ }
+ }
+
+ public static ItemStack getStack(Block aBlock, int aMeta, int aSize) {
+ return ItemUtils.simpleMetaStack(aBlock, aMeta, aSize);
+ }
+
+ // BOPCBlocks.logs4 - 0
+ // BOPCBlocks.colorizedLeaves2 - 1
+
+ private static void setFields() {
+ Field aBopMiscItem =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCItems"), "misc");
+
+ Field aBopBlock1 =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "logs1");
+ Field aBopBlock2 =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "logs2");
+ Field aBopBlock3 =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "logs3");
+ Field aBopBlock4 =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "logs4");
+
+ Field aBopLeaves1 =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "leaves1");
+ Field aBopLeaves2 =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "leaves2");
+ Field aBopLeaves3 =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "leaves3");
+ Field aBopLeaves4 =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "leaves4");
+
+ Field aBopColouredLeaves1 = ReflectionUtils.getField(
+ ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "colorizedLeaves1");
+ Field aBopColouredLeaves2 = ReflectionUtils.getField(
+ ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "colorizedLeaves2");
+
+ Field aBopSapling =
+ ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "saplings");
+ Field aBopColouredSapling = ReflectionUtils.getField(
+ ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "colorizedSaplings");
+
+ if (aBopMiscItem != null) {
+ Item aMiscItem = ReflectionUtils.getFieldValue(aBopMiscItem);
+ if (aMiscItem != null) {
+ mPineCone = aMiscItem;
+ }
+ }
+
+ if (aBopBlock1 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopBlock1);
+ if (aBlock != null) {
+ logs1 = aBlock;
+ }
+ }
+ if (aBopBlock2 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopBlock2);
+ if (aBlock != null) {
+ logs2 = aBlock;
+ }
+ }
+ if (aBopBlock3 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopBlock3);
+ if (aBlock != null) {
+ logs3 = aBlock;
+ }
+ }
+ if (aBopBlock4 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopBlock4);
+ if (aBlock != null) {
+ logs4 = aBlock;
+ }
+ }
+
+ if (aBopLeaves1 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves1);
+ if (aBlock != null) {
+ leaves1 = aBlock;
+ }
+ }
+ if (aBopLeaves2 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves2);
+ if (aBlock != null) {
+ leaves2 = aBlock;
+ }
+ }
+ if (aBopLeaves3 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves3);
+ if (aBlock != null) {
+ leaves3 = aBlock;
+ }
+ }
+ if (aBopLeaves4 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves4);
+ if (aBlock != null) {
+ leaves4 = aBlock;
+ }
+ }
+
+ if (aBopColouredLeaves1 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopColouredLeaves1);
+ if (aBlock != null) {
+ colorizedLeaves1 = aBlock;
+ }
+ }
+ if (aBopColouredLeaves2 != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopColouredLeaves2);
+ if (aBlock != null) {
+ colorizedLeaves2 = aBlock;
+ }
+ }
+
+ if (aBopSapling != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopSapling);
+ if (aBlock != null) {
+ saplings = aBlock;
+ }
+ }
+ if (aBopColouredSapling != null) {
+ Block aBlock = ReflectionUtils.getFieldValue(aBopColouredSapling);
+ if (aBlock != null) {
+ colorizedSaplings = aBlock;
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java
index 3716359d7a..add656087d 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java
@@ -30,169 +30,353 @@ import net.minecraft.item.ItemStack;
public class BOP_Block_Registrator {
- public static Block log_Rainforest;
- public static Block leaves_Rainforest;
- public static Block sapling_Rainforest;
- public static Block log_Pine;
- public static Block leaves_Pine;
- public static Block sapling_Pine;
+ public static Block log_Rainforest;
+ public static Block leaves_Rainforest;
+ public static Block sapling_Rainforest;
+ public static Block log_Pine;
+ public static Block leaves_Pine;
+ public static Block sapling_Pine;
- //Runs Each tree Type separately
- public static final void run(){
- registerTree_Rainforest();
- registerTree_Pine();
- }
+ // Runs Each tree Type separately
+ public static final void run() {
+ registerTree_Rainforest();
+ registerTree_Pine();
+ }
+ private static final boolean registerTree_Rainforest() {
+ log_Rainforest = new LogRainforestTree();
+ leaves_Rainforest = new LeavesRainforestTree();
+ sapling_Rainforest = new SaplingRainforestTree();
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(log_Rainforest), "logWood", true);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(leaves_Rainforest), "treeLeaves", true);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(sapling_Rainforest), "treeSapling", true);
+ return true;
+ }
- private static final boolean registerTree_Rainforest(){
- log_Rainforest = new LogRainforestTree();
- leaves_Rainforest = new LeavesRainforestTree();
- sapling_Rainforest = new SaplingRainforestTree();
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(log_Rainforest), "logWood", true);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(leaves_Rainforest), "treeLeaves", true);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(sapling_Rainforest), "treeSapling", true);
- return true;
- }
+ private static final boolean registerTree_Pine() {
+ log_Pine = new LogPineTree();
+ leaves_Pine = new LeavesPineTree();
+ sapling_Pine = new SaplingPineTree();
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(log_Pine), "logWood", true);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(leaves_Pine), "treeLeaves", true);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(sapling_Pine), "treeSapling", true);
+ return true;
+ }
- private static final boolean registerTree_Pine(){
- log_Pine = new LogPineTree();
- leaves_Pine = new LeavesPineTree();
- sapling_Pine = new SaplingPineTree();
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(log_Pine), "logWood", true);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(leaves_Pine), "treeLeaves", true);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(sapling_Pine), "treeSapling", true);
- return true;
- }
+ public static final void recipes() {
+ // Rainforest Oak
+ addLogRecipes(ItemUtils.getSimpleStack(log_Rainforest));
+ addSaplingRecipes(ItemUtils.getSimpleStack(sapling_Rainforest));
+ // Pine
+ addLogRecipes(ItemUtils.getSimpleStack(log_Pine));
+ addSaplingRecipes(ItemUtils.getSimpleStack(sapling_Pine));
+ }
- public static final void recipes() {
- // Rainforest Oak
- addLogRecipes(ItemUtils.getSimpleStack(log_Rainforest));
- addSaplingRecipes(ItemUtils.getSimpleStack(sapling_Rainforest));
- // Pine
- addLogRecipes(ItemUtils.getSimpleStack(log_Pine));
- addSaplingRecipes(ItemUtils.getSimpleStack(sapling_Pine));
+ public static final void addLogRecipes(final ItemStack aStack) {
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {aStack},
+ ItemUtils.getSimpleStack(
+ Item.getItemFromBlock(Blocks.planks), GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 4));
+ RecipeUtils.recipeBuilder(
+ CI.craftingToolSaw,
+ null,
+ null,
+ aStack,
+ null,
+ null,
+ null,
+ null,
+ null,
+ ItemUtils.getSimpleStack(Item.getItemFromBlock(Blocks.planks), 4));
+ GT_ModHandler.addPulverisationRecipe(
+ GT_Utility.copyAmount(1L, aStack),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L),
+ 80,
+ false);
+ GT_ModHandler.addCraftingRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Wood, 2L),
+ GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {"sLf", 'L', GT_Utility.copyAmount(1L, aStack)});
+ GT_Values.RA.addLatheRecipe(
+ GT_Utility.copyAmount(1L, aStack),
+ GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Wood, 4L),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L),
+ 160,
+ 8);
- }
+ if (!CORE.GTNH) {
+ GT_Values.RA.addAssemblerRecipe(
+ GT_Utility.copyAmount(1L, aStack),
+ ItemList.Circuit_Integrated.getWithDamage(0L, 2L, new Object[0]),
+ Materials.SeedOil.getFluid(50L),
+ ItemList.FR_Stick.get(1L, new Object[0]),
+ 16,
+ 8);
+ GT_Values.RA.addAssemblerRecipe(
+ GT_Utility.copyAmount(8L, aStack),
+ ItemList.Circuit_Integrated.getWithDamage(0L, 8L, new Object[0]),
+ Materials.SeedOil.getFluid(250L),
+ ItemList.FR_Casing_Impregnated.get(1L, new Object[0]),
+ 64,
+ 16);
+ GT_Values.RA.addChemicalBathRecipe(
+ GT_Utility.copyAmount(1L, aStack),
+ Materials.Creosote.getFluid(1000L),
+ GT_ModHandler.getModItem("Railcraft", "tile.railcraft.cube", 1L, 8),
+ null,
+ null,
+ null,
+ 16,
+ 16);
+ }
- public static final void addLogRecipes(final ItemStack aStack) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aStack}, ItemUtils.getSimpleStack(Item.getItemFromBlock(Blocks.planks), GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 4));
- RecipeUtils.recipeBuilder(
- CI.craftingToolSaw, null, null,
- aStack, null, null,
- null, null, null,
- ItemUtils.getSimpleStack(Item.getItemFromBlock(Blocks.planks), 4));
- GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), 80, false);
- GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Wood, 2L), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "sLf", 'L', GT_Utility.copyAmount(1L, aStack) });
- GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Wood, 4L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), 160, 8);
+ final short aMeta = (short) aStack.getItemDamage();
+ if (aMeta == 32767) {
+ if (GT_Utility.areStacksEqual(
+ GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(1L, aStack), false, null),
+ new ItemStack(Items.coal, 1, 1))) {
+ addPyrolyeOvenRecipes(aStack);
+ if (GregTech_API.sRecipeFile.get(
+ ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
+ GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack));
+ }
+ }
+ for (int i = 0; i < 32767; ++i) {
+ if (GT_Utility.areStacksEqual(
+ GT_ModHandler.getSmeltingOutput(new ItemStack(aStack.getItem(), 1, i), false, null),
+ new ItemStack(Items.coal, 1, 1))) {
+ addPyrolyeOvenRecipes(aStack);
+ if (GregTech_API.sRecipeFile.get(
+ ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
+ GT_ModHandler.removeFurnaceSmelting(new ItemStack(aStack.getItem(), 1, i));
+ }
+ }
+ final ItemStack tStack = GT_ModHandler.getRecipeOutput(new ItemStack(aStack.getItem(), 1, i));
+ if (tStack == null) {
+ if (i >= 16) {
+ break;
+ }
+ } else {
+ final ItemStack tPlanks = GT_Utility.copy(tStack);
+ tPlanks.stackSize = tPlanks.stackSize * 3 / 2;
+ GT_Values.RA.addCutterRecipe(
+ new ItemStack(aStack.getItem(), 1, i),
+ Materials.Lubricant.getFluid(1L),
+ GT_Utility.copy(tPlanks),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L),
+ 200,
+ 8);
+ GT_Values.RA.addCutterRecipe(
+ new ItemStack(aStack.getItem(), 1, i),
+ GT_Utility.copyAmount(
+ GT_Mod.gregtechproxy.mNerfedWoodPlank
+ ? ((long) tStack.stackSize)
+ : ((long) (tStack.stackSize * 5 / 4)),
+ tStack),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L),
+ 200,
+ 8);
+ GT_ModHandler.addSawmillRecipe(
+ new ItemStack(aStack.getItem(), 1, i),
+ tPlanks,
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L));
+ GT_ModHandler.removeRecipe(new ItemStack(aStack.getItem(), 1, i));
+ GT_ModHandler.addCraftingRecipe(
+ GT_Utility.copyAmount(
+ GT_Mod.gregtechproxy.mNerfedWoodPlank
+ ? ((long) tStack.stackSize)
+ : ((long) (tStack.stackSize * 5 / 4)),
+ tStack),
+ new Object[] {"s", "L", 'L', new ItemStack(aStack.getItem(), 1, i)});
+ GT_ModHandler.addShapelessCraftingRecipe(
+ GT_Utility.copyAmount(
+ tStack.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1), tStack),
+ new Object[] {new ItemStack(aStack.getItem(), 1, i)});
+ }
+ }
+ } else {
+ if (GT_Utility.areStacksEqual(
+ GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(1L, aStack), false, null),
+ new ItemStack(Items.coal, 1, 1))) {
+ addPyrolyeOvenRecipes(aStack);
+ if (GregTech_API.sRecipeFile.get(
+ ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
+ GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack));
+ }
+ }
+ final ItemStack tStack2 = GT_ModHandler.getRecipeOutput(GT_Utility.copyAmount(1L, aStack));
+ if (tStack2 != null) {
+ final ItemStack tPlanks2 = GT_Utility.copy(tStack2);
+ tPlanks2.stackSize = tPlanks2.stackSize * 3 / 2;
+ GT_Values.RA.addCutterRecipe(
+ GT_Utility.copyAmount(1L, aStack),
+ Materials.Lubricant.getFluid(1L),
+ GT_Utility.copy(tPlanks2),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L),
+ 200,
+ 8);
+ GT_Values.RA.addCutterRecipe(
+ GT_Utility.copyAmount(1L, aStack),
+ GT_Utility.copyAmount(
+ GT_Mod.gregtechproxy.mNerfedWoodPlank
+ ? ((long) tStack2.stackSize)
+ : ((long) (tStack2.stackSize * 5 / 4)),
+ tStack2),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L),
+ 200,
+ 8);
+ GT_ModHandler.addSawmillRecipe(
+ GT_Utility.copyAmount(1L, aStack),
+ tPlanks2,
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L));
+ GT_ModHandler.removeRecipe(GT_Utility.copyAmount(1L, aStack));
+ GT_ModHandler.addCraftingRecipe(
+ GT_Utility.copyAmount(
+ GT_Mod.gregtechproxy.mNerfedWoodPlank
+ ? ((long) tStack2.stackSize)
+ : ((long) (tStack2.stackSize * 5 / 4)),
+ tStack2),
+ new Object[] {"s", "L", 'L', GT_Utility.copyAmount(1L, aStack)});
+ GT_ModHandler.addShapelessCraftingRecipe(
+ GT_Utility.copyAmount(
+ tStack2.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1), tStack2),
+ new Object[] {GT_Utility.copyAmount(1L, aStack)});
+ }
+ }
+ if (GT_Utility.areStacksEqual(
+ GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(1L, aStack), false, null),
+ new ItemStack(Items.coal, 1, 1))) {
+ addPyrolyeOvenRecipes(aStack);
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
+ GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack));
+ }
+ }
+ }
- if (!CORE.GTNH) {
- GT_Values.RA.addAssemblerRecipe(GT_Utility.copyAmount(1L, aStack), ItemList.Circuit_Integrated.getWithDamage(0L, 2L, new Object[0]), Materials.SeedOil.getFluid(50L), ItemList.FR_Stick.get(1L, new Object[0]), 16, 8);
- GT_Values.RA.addAssemblerRecipe(GT_Utility.copyAmount(8L, aStack), ItemList.Circuit_Integrated.getWithDamage(0L, 8L, new Object[0]), Materials.SeedOil.getFluid(250L), ItemList.FR_Casing_Impregnated.get(1L, new Object[0]), 64, 16);
- GT_Values.RA.addChemicalBathRecipe(GT_Utility.copyAmount(1L, aStack), Materials.Creosote.getFluid(1000L), GT_ModHandler.getModItem("Railcraft", "tile.railcraft.cube", 1L, 8), null, null, null, 16, 16);
- }
+ public static void addSaplingRecipes(final ItemStack aStack) {
+ GT_ModHandler.addPulverisationRecipe(
+ GT_Utility.copyAmount(1L, aStack),
+ GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L),
+ null,
+ 0,
+ false);
+ GT_ModHandler.addCompressionRecipe(
+ GT_Utility.copyAmount(8L, aStack), ItemList.IC2_Plantball.get(1L, new Object[0]));
+ GT_Values.RA.addLatheRecipe(
+ GT_Utility.copyAmount(1L, aStack),
+ GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Wood, 1L),
+ 16,
+ 8);
+ }
- final short aMeta = (short)aStack.getItemDamage();
- if (aMeta == 32767) {
- if (GT_Utility.areStacksEqual(GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(1L, aStack), false, null), new ItemStack(Items.coal, 1, 1))) {
- addPyrolyeOvenRecipes(aStack);
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
- GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack));
- }
- }
- for (int i = 0; i < 32767; ++i) {
- if (GT_Utility.areStacksEqual(GT_ModHandler.getSmeltingOutput(new ItemStack(aStack.getItem(), 1, i), false, null), new ItemStack(Items.coal, 1, 1))) {
- addPyrolyeOvenRecipes(aStack);
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
- GT_ModHandler.removeFurnaceSmelting(new ItemStack(aStack.getItem(), 1, i));
- }
- }
- final ItemStack tStack = GT_ModHandler.getRecipeOutput(new ItemStack(aStack.getItem(), 1, i));
- if (tStack == null) {
- if (i >= 16) {
- break;
- }
- }
- else {
- final ItemStack tPlanks = GT_Utility.copy(tStack);
- tPlanks.stackSize = tPlanks.stackSize * 3 / 2;
- GT_Values.RA.addCutterRecipe(new ItemStack(aStack.getItem(), 1, i), Materials.Lubricant.getFluid(1L), GT_Utility.copy(tPlanks), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), 200, 8);
- GT_Values.RA.addCutterRecipe(new ItemStack(aStack.getItem(), 1, i), GT_Utility.copyAmount(GT_Mod.gregtechproxy.mNerfedWoodPlank ? ((long)tStack.stackSize) : ((long)(tStack.stackSize * 5 / 4)), tStack), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), 200, 8);
- GT_ModHandler.addSawmillRecipe(new ItemStack(aStack.getItem(), 1, i), tPlanks, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L));
- GT_ModHandler.removeRecipe(new ItemStack(aStack.getItem(), 1, i));
- GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(GT_Mod.gregtechproxy.mNerfedWoodPlank ? ((long)tStack.stackSize) : ((long)(tStack.stackSize * 5 / 4)), tStack), new Object[] { "s", "L", 'L', new ItemStack(aStack.getItem(), 1, i) });
- GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(tStack.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1), tStack), new Object[] { new ItemStack(aStack.getItem(), 1, i) });
- }
- }
- }
- else {
- if (GT_Utility.areStacksEqual(GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(1L, aStack), false, null), new ItemStack(Items.coal, 1, 1))) {
- addPyrolyeOvenRecipes(aStack);
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
- GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack));
- }
- }
- final ItemStack tStack2 = GT_ModHandler.getRecipeOutput(GT_Utility.copyAmount(1L, aStack));
- if (tStack2 != null) {
- final ItemStack tPlanks2 = GT_Utility.copy(tStack2);
- tPlanks2.stackSize = tPlanks2.stackSize * 3 / 2;
- GT_Values.RA.addCutterRecipe(GT_Utility.copyAmount(1L, aStack), Materials.Lubricant.getFluid(1L), GT_Utility.copy(tPlanks2), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), 200, 8);
- GT_Values.RA.addCutterRecipe(GT_Utility.copyAmount(1L, aStack), GT_Utility.copyAmount(GT_Mod.gregtechproxy.mNerfedWoodPlank ? ((long)tStack2.stackSize) : ((long)(tStack2.stackSize * 5 / 4)), tStack2), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), 200, 8);
- GT_ModHandler.addSawmillRecipe(GT_Utility.copyAmount(1L, aStack), tPlanks2, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L));
- GT_ModHandler.removeRecipe(GT_Utility.copyAmount(1L, aStack));
- GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(GT_Mod.gregtechproxy.mNerfedWoodPlank ? ((long)tStack2.stackSize) : ((long)(tStack2.stackSize * 5 / 4)), tStack2), new Object[] { "s", "L", 'L', GT_Utility.copyAmount(1L, aStack) });
- GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(tStack2.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1), tStack2), new Object[] { GT_Utility.copyAmount(1L, aStack) });
- }
- }
- if (GT_Utility.areStacksEqual(GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(1L, aStack), false, null), new ItemStack(Items.coal, 1, 1))) {
- addPyrolyeOvenRecipes(aStack);
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
- GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, aStack));
- }
- }
- }
+ public static void addPyrolyeOvenRecipes(final ItemStack logStack) {
- public static void addSaplingRecipes(final ItemStack aStack) {
- GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L), null, 0, false);
- GT_ModHandler.addCompressionRecipe(GT_Utility.copyAmount(8L, aStack), ItemList.IC2_Plantball.get(1L, new Object[0]));
- GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Wood, 1L), 16, 8);
- }
+ Materials aOilHeavy = MaterialUtils.getMaterial("OilHeavy");
+ Materials aCharcoalByproducts = MaterialUtils.getMaterial("CharcoalByproducts");
+ Materials aWoodGas = MaterialUtils.getMaterial("WoodGas");
+ Materials aWoodVinegar = MaterialUtils.getMaterial("WoodVinegar");
+ Materials aWoodTar = MaterialUtils.getMaterial("WoodTar");
- public static void addPyrolyeOvenRecipes(final ItemStack logStack) {
-
- Materials aOilHeavy = MaterialUtils.getMaterial("OilHeavy");
- Materials aCharcoalByproducts = MaterialUtils.getMaterial("CharcoalByproducts");
- Materials aWoodGas = MaterialUtils.getMaterial("WoodGas");
- Materials aWoodVinegar = MaterialUtils.getMaterial("WoodVinegar");
- Materials aWoodTar = MaterialUtils.getMaterial("WoodTar");
-
-
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 1, MaterialHelper.getGems(Materials.Charcoal, 20), Materials.Creosote.getFluid(4000L), 640, 64);
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 2, MaterialHelper.getGems(Materials.Charcoal, 20), Materials.Creosote.getFluid(4000L), 320, 96);
-
- if (aOilHeavy != null) {
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 3, MaterialHelper.getDust(Materials.Ash, 4), aOilHeavy.getFluid(200L), 320, 192);
-
- }
- if (aCharcoalByproducts != null) {
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 3, MaterialHelper.getGems(Materials.Charcoal, 20), aCharcoalByproducts.getGas(4000L), 640, 64);
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 4, MaterialHelper.getGems(Materials.Charcoal, 20), aCharcoalByproducts.getGas(4000L), 320, 96);
-
- }
- if (aWoodGas != null) {
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 5, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodGas.getGas(1500L), 640, 64);
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 6, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodGas.getGas(1500L), 320, 96);
-
- }
- if (aWoodVinegar != null) {
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 7, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodVinegar.getFluid(3000L), 640, 64);
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 8, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodVinegar.getFluid(3000L), 320, 96);
-
- }
- if (aWoodTar != null) {
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 9, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodTar.getFluid(1500L), 640, 64);
- CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 10, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodTar.getFluid(1500L), 320, 96);
-
- }
- }
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ GT_Values.NF,
+ 1,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ Materials.Creosote.getFluid(4000L),
+ 640,
+ 64);
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ Materials.Nitrogen.getGas(1000L),
+ 2,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ Materials.Creosote.getFluid(4000L),
+ 320,
+ 96);
+ if (aOilHeavy != null) {
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ GT_Values.NF,
+ 3,
+ MaterialHelper.getDust(Materials.Ash, 4),
+ aOilHeavy.getFluid(200L),
+ 320,
+ 192);
+ }
+ if (aCharcoalByproducts != null) {
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ GT_Values.NF,
+ 3,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ aCharcoalByproducts.getGas(4000L),
+ 640,
+ 64);
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ Materials.Nitrogen.getGas(1000L),
+ 4,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ aCharcoalByproducts.getGas(4000L),
+ 320,
+ 96);
+ }
+ if (aWoodGas != null) {
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ GT_Values.NF,
+ 5,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ aWoodGas.getGas(1500L),
+ 640,
+ 64);
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ Materials.Nitrogen.getGas(1000L),
+ 6,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ aWoodGas.getGas(1500L),
+ 320,
+ 96);
+ }
+ if (aWoodVinegar != null) {
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ GT_Values.NF,
+ 7,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ aWoodVinegar.getFluid(3000L),
+ 640,
+ 64);
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ Materials.Nitrogen.getGas(1000L),
+ 8,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ aWoodVinegar.getFluid(3000L),
+ 320,
+ 96);
+ }
+ if (aWoodTar != null) {
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ GT_Values.NF,
+ 9,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ aWoodTar.getFluid(1500L),
+ 640,
+ 64);
+ CORE.RA.addPyrolyseRecipe(
+ GT_Utility.copyAmount(16L, logStack),
+ Materials.Nitrogen.getGas(1000L),
+ 10,
+ MaterialHelper.getGems(Materials.Charcoal, 20),
+ aWoodTar.getFluid(1500L),
+ 320,
+ 96);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java
index 5c86c45591..c2d534dfb6 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java
@@ -1,13 +1,16 @@
package gtPlusPlus.xmod.bop.blocks.base;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
+import java.util.Random;
import net.minecraft.block.BlockLeaves;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -18,92 +21,87 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
public class LeavesBase extends BlockLeaves {
- protected IIcon[][] leafTextures = new IIcon[2][];
- protected String[][] leafType = new String[][] {{}, {}};
- protected String[] treeType = new String[] {};
- protected ItemStack[] bonusDrops;
-
- @SuppressWarnings("deprecation")
- public LeavesBase(String blockNameLocalized, String blockNameUnlocalized, ItemStack[] bonusDrops){
- this.bonusDrops = bonusDrops;
- String blockName = "block"+Utils.sanitizeString(blockNameLocalized)+"Leaves";
- GameRegistry.registerBlock(this, ItemBlock.class, blockName);
- this.setBlockName(blockName);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeLeaves", true);
- this.setCreativeTab(AddToCreativeTab.tabBOP);
- LanguageRegistry.addName(this, blockNameLocalized+" Leaves");
- Blocks.fire.setFireInfo(this, 80, 150);
- }
-
- private final void setVanillaVariable(Object toSet, Object value){
- toSet = value;
- }
-
- @Override
- public int quantityDropped(Random p_149745_1_){
- return p_149745_1_.nextInt(20) == 0 ? 1 : 0;
- }
-
-
- @Override//Drops when Leaf is broken
- protected void func_150124_c(World world, int x, int y, int z, int meta, int randomChance){
- Logger.INFO("Dropping Bonus Drops");
- for (int i = 0; i < this.bonusDrops.length; ++i){
- if (this.bonusDrops[i] != null && world.rand.nextInt(randomChance) == 0){
- this.dropBlockAsItem(world, x, y, z, ItemUtils.getSimpleStack(this.bonusDrops[i], 1));
- }
- }
- }
-
- /**
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
- */
- @SuppressWarnings("unchecked")
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(Item item, CreativeTabs tab, @SuppressWarnings("rawtypes") List metaList){
- for (int i = 0; i < this.treeType.length; ++i){
- metaList.add(new ItemStack(item, 1, i));
- }
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int p_149691_1_, int metaID){
- return (metaID & 3) == 1 ? this.leafTextures[this.field_150127_b][1] : this.leafTextures[this.field_150127_b][0];
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister iIcon){
- for (int i = 0; i < leafType.length; ++i){
- this.leafTextures[i] = new IIcon[leafType[i].length];
- for (int j = 0; j < leafType[i].length; ++j){
- this.leafTextures[i][j] = iIcon.registerIcon(CORE.MODID + ":" + "trees/" + "leaves/" + "leaves_" + leafType[i][j]);
- }
- }
- setVanillaVariable(this.field_150129_M, this.leafTextures);
- }
-
- @Override
- public String[] func_150125_e()
- {
- return treeType;
- }
-} \ No newline at end of file
+ protected IIcon[][] leafTextures = new IIcon[2][];
+ protected String[][] leafType = new String[][] {{}, {}};
+ protected String[] treeType = new String[] {};
+ protected ItemStack[] bonusDrops;
+
+ @SuppressWarnings("deprecation")
+ public LeavesBase(String blockNameLocalized, String blockNameUnlocalized, ItemStack[] bonusDrops) {
+ this.bonusDrops = bonusDrops;
+ String blockName = "block" + Utils.sanitizeString(blockNameLocalized) + "Leaves";
+ GameRegistry.registerBlock(this, ItemBlock.class, blockName);
+ this.setBlockName(blockName);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeLeaves", true);
+ this.setCreativeTab(AddToCreativeTab.tabBOP);
+ LanguageRegistry.addName(this, blockNameLocalized + " Leaves");
+ Blocks.fire.setFireInfo(this, 80, 150);
+ }
+
+ private final void setVanillaVariable(Object toSet, Object value) {
+ toSet = value;
+ }
+
+ @Override
+ public int quantityDropped(Random p_149745_1_) {
+ return p_149745_1_.nextInt(20) == 0 ? 1 : 0;
+ }
+
+ @Override // Drops when Leaf is broken
+ protected void func_150124_c(World world, int x, int y, int z, int meta, int randomChance) {
+ Logger.INFO("Dropping Bonus Drops");
+ for (int i = 0; i < this.bonusDrops.length; ++i) {
+ if (this.bonusDrops[i] != null && world.rand.nextInt(randomChance) == 0) {
+ this.dropBlockAsItem(world, x, y, z, ItemUtils.getSimpleStack(this.bonusDrops[i], 1));
+ }
+ }
+ }
+
+ /**
+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubBlocks(Item item, CreativeTabs tab, @SuppressWarnings("rawtypes") List metaList) {
+ for (int i = 0; i < this.treeType.length; ++i) {
+ metaList.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(int p_149691_1_, int metaID) {
+ return (metaID & 3) == 1
+ ? this.leafTextures[this.field_150127_b][1]
+ : this.leafTextures[this.field_150127_b][0];
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister iIcon) {
+ for (int i = 0; i < leafType.length; ++i) {
+ this.leafTextures[i] = new IIcon[leafType[i].length];
+ for (int j = 0; j < leafType[i].length; ++j) {
+ this.leafTextures[i][j] =
+ iIcon.registerIcon(CORE.MODID + ":" + "trees/" + "leaves/" + "leaves_" + leafType[i][j]);
+ }
+ }
+ setVanillaVariable(this.field_150129_M, this.leafTextures);
+ }
+
+ @Override
+ public String[] func_150125_e() {
+ return treeType;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java
index 8e8ca0ed0a..4c8a905834 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java
@@ -1,12 +1,14 @@
package gtPlusPlus.xmod.bop.blocks.base;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
import net.minecraft.block.BlockLog;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -16,71 +18,65 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public abstract class LogBase extends BlockLog
-{
- public String[] treeType = new String[] {};
- protected IIcon[] textureSide;
- protected IIcon[] textureTop;
-
- @SuppressWarnings("deprecation")
- public LogBase(String blockNameLocalized, String blockNameUnlocalized, String[] treeTypes){
- this.treeType = treeTypes;
- String blockName = "block"+Utils.sanitizeString(blockNameLocalized)+"Log";
- GameRegistry.registerBlock(this, ItemBlock.class, blockName);
- this.setBlockName(blockName);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "log"+Utils.sanitizeString(blockNameLocalized), true);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "logWood", true);
- this.setCreativeTab(AddToCreativeTab.tabBOP);
- LanguageRegistry.addName(this, blockNameLocalized);
- Blocks.fire.setFireInfo(this, 20, 100);
- }
+public abstract class LogBase extends BlockLog {
+ public String[] treeType = new String[] {};
+ protected IIcon[] textureSide;
+ protected IIcon[] textureTop;
- private final void setVanillaVariable(Object toSet, Object value){
- toSet = value;
- }
+ @SuppressWarnings("deprecation")
+ public LogBase(String blockNameLocalized, String blockNameUnlocalized, String[] treeTypes) {
+ this.treeType = treeTypes;
+ String blockName = "block" + Utils.sanitizeString(blockNameLocalized) + "Log";
+ GameRegistry.registerBlock(this, ItemBlock.class, blockName);
+ this.setBlockName(blockName);
+ ItemUtils.addItemToOreDictionary(
+ ItemUtils.getSimpleStack(this), "log" + Utils.sanitizeString(blockNameLocalized), true);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "logWood", true);
+ this.setCreativeTab(AddToCreativeTab.tabBOP);
+ LanguageRegistry.addName(this, blockNameLocalized);
+ Blocks.fire.setFireInfo(this, 20, 100);
+ }
- /**
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
- */
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(Item item, CreativeTabs tab, List metaList){
- for (int i = 0; i < this.textureSide.length; ++i){
- metaList.add(new ItemStack(item, 1, i));
- }
- }
+ private final void setVanillaVariable(Object toSet, Object value) {
+ toSet = value;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- protected IIcon getTopIcon(int meta){
- return this.textureTop[meta % this.textureTop.length];
- }
+ /**
+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubBlocks(Item item, CreativeTabs tab, List metaList) {
+ for (int i = 0; i < this.textureSide.length; ++i) {
+ metaList.add(new ItemStack(item, 1, i));
+ }
+ }
- @Override
- @SideOnly(Side.CLIENT)
- protected IIcon getSideIcon(int metaID){
- return this.textureSide[metaID % this.textureSide.length];
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ protected IIcon getTopIcon(int meta) {
+ return this.textureTop[meta % this.textureTop.length];
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister iIcon)
- {
- this.textureSide = new IIcon[treeType.length];
- this.textureTop = new IIcon[treeType.length];
+ @Override
+ @SideOnly(Side.CLIENT)
+ protected IIcon getSideIcon(int metaID) {
+ return this.textureSide[metaID % this.textureSide.length];
+ }
- for (int i = 0; i < this.textureSide.length; ++i){
- this.textureSide[i] = iIcon.registerIcon(CORE.MODID + ":" + "trees/" + "logs/" + "log_" + treeType[i]);
- this.textureTop[i] = iIcon.registerIcon(CORE.MODID + ":" + "trees/" + "logs/" + "log_" + treeType[i] + "_top");
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister iIcon) {
+ this.textureSide = new IIcon[treeType.length];
+ this.textureTop = new IIcon[treeType.length];
- setVanillaVariable(this.field_150167_a, this.textureSide);
- setVanillaVariable(this.field_150166_b, this.textureTop);
- }
+ for (int i = 0; i < this.textureSide.length; ++i) {
+ this.textureSide[i] = iIcon.registerIcon(CORE.MODID + ":" + "trees/" + "logs/" + "log_" + treeType[i]);
+ this.textureTop[i] =
+ iIcon.registerIcon(CORE.MODID + ":" + "trees/" + "logs/" + "log_" + treeType[i] + "_top");
+ }
-} \ No newline at end of file
+ setVanillaVariable(this.field_150167_a, this.textureSide);
+ setVanillaVariable(this.field_150166_b, this.textureTop);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java
index c039e1ebac..f606a3c173 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java
@@ -1,13 +1,16 @@
package gtPlusPlus.xmod.bop.blocks.base;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.List;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -23,176 +26,159 @@ import net.minecraft.world.gen.feature.WorldGenBigTree;
import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraft.world.gen.feature.WorldGenerator;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class SaplingBase extends BlockSapling
-{
- protected String[] saplingTypes = new String[] {};
- protected IIcon[] saplingTextures = new IIcon[] {};
-
- //Sapling types - field_149882_a
- //Iicons - field_149881_b
-
- protected SaplingBase(String blockNameLocalized, String blockNameUnlocalized, String[] saplingTypes){
- float f = 0.4F;
- this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
- this.saplingTypes = saplingTypes;
- this.saplingTextures = new IIcon[saplingTypes.length];
- String blockName = "block"+Utils.sanitizeString(blockNameLocalized);
- GameRegistry.registerBlock(this, ItemBlock.class, blockName);
- this.setBlockName(blockName);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeSapling", true);
- this.setCreativeTab(AddToCreativeTab.tabBOP);
- LanguageRegistry.addName(this, blockNameLocalized);
- }
-
- private final void setVanillaVariable(Object toSet, Object value){
- toSet = value;
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int someInt, int meta){
- /* p_149691_2_ &= 7;
+public class SaplingBase extends BlockSapling {
+ protected String[] saplingTypes = new String[] {};
+ protected IIcon[] saplingTextures = new IIcon[] {};
+
+ // Sapling types - field_149882_a
+ // Iicons - field_149881_b
+
+ protected SaplingBase(String blockNameLocalized, String blockNameUnlocalized, String[] saplingTypes) {
+ float f = 0.4F;
+ this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
+ this.saplingTypes = saplingTypes;
+ this.saplingTextures = new IIcon[saplingTypes.length];
+ String blockName = "block" + Utils.sanitizeString(blockNameLocalized);
+ GameRegistry.registerBlock(this, ItemBlock.class, blockName);
+ this.setBlockName(blockName);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeSapling", true);
+ this.setCreativeTab(AddToCreativeTab.tabBOP);
+ LanguageRegistry.addName(this, blockNameLocalized);
+ }
+
+ private final void setVanillaVariable(Object toSet, Object value) {
+ toSet = value;
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(int someInt, int meta) {
+ /* p_149691_2_ &= 7;
return saplingTextures[MathHelper.clamp_int(p_149691_2_, 0, 5)];*/
- //return this.saplingTextures[meta % this.saplingTextures.length];
- try {
- return this.saplingTextures[meta];
- }catch(Throwable T){
- Logger.WARNING("Invalid Sapling meta is "+meta);
- return this.saplingTextures[0];
- }
- }
-
- /**
- * Ticks the block if it's been scheduled
- */
- @Override
- public void updateTick(World world, int x, int y, int z, Random rand){
- if (!world.isRemote){
- super.updateTick(world, x, y, z, rand);
- if (world.getBlockLightValue(x, y + 1, z) >= 9 && rand.nextInt(7) == 0){
- Logger.WARNING("Update Tick");
- this.updateMeta(world, x, y, z, rand);
- }
- else {
- Logger.WARNING("Tried to Tick.");
- }
- }
- }
-
- //Dunno - Think it is doGrow || doGrowthTick
- @Override
- public void func_149853_b(World world, Random rand, int x, int y, int z){
- Logger.WARNING("Please find what calls me - func_149853_b");
- this.updateMeta(world, x, y, z, rand);
- }
-
- public void updateMeta(World world, int x, int y, int z, Random rand){
- func_149879_c(world, x, y, z, rand);
- }
-
- @Override
- public void func_149879_c(World world, int x, int y, int z, Random rand){
- Logger.WARNING("func_149879_c - 1");
- int l = world.getBlockMetadata(x, y, z);
-
- if ((l & 8) == 0){
- Logger.WARNING("func_149879_c - 2");
- world.setBlockMetadataWithNotify(x, y, z, l | 8, 4);
- }
- else{
- Logger.WARNING("func_149879_c - 3");
- this.func_149878_d(world, x, y, z, rand);
- }
- }
-
- @Override
- public void func_149878_d(World world, int x, int y, int z, Random rand){
- Logger.WARNING("func_149878_d - 1");
- if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return;
- int l = world.getBlockMetadata(x, y, z) & 7;
- Object object = rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
- int i1 = 0;
- int j1 = 0;
- boolean flag = false;
-
- switch (l)
- {
- case 0:
- default:
- Logger.WARNING("Case 0 - Grow Tree");
- break;
-
- }
-
- Block block = Blocks.air;
-
- if (flag)
- {
- world.setBlock(x + i1, y, z + j1, block, 0, 4);
- world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4);
- world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4);
- world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4);
- }
- else
- {
- world.setBlock(x, y, z, block, 0, 4);
- }
-
- if (!((WorldGenerator)object).generate(world, rand, x + i1, y, z + j1))
- {
- if (flag)
- {
- world.setBlock(x + i1, y, z + j1, this, l, 4);
- world.setBlock(x + i1 + 1, y, z + j1, this, l, 4);
- world.setBlock(x + i1, y, z + j1 + 1, this, l, 4);
- world.setBlock(x + i1 + 1, y, z + j1 + 1, this, l, 4);
- }
- else
- {
- world.setBlock(x, y, z, this, l, 4);
- }
- }
- }
-
- @Override
- public boolean func_149880_a(World world, int p_149880_2_, int p_149880_3_, int p_149880_4_, int p_149880_5_){
- return world.getBlock(p_149880_2_, p_149880_3_, p_149880_4_) == this && (world.getBlockMetadata(p_149880_2_, p_149880_3_, p_149880_4_) & 7) == p_149880_5_;
- }
-
- /**
- * Determines the damage on the item the block drops. Used in cloth and wood.
- */
- @Override
- public int damageDropped(int meta){
- return MathHelper.clamp_int(meta & 7, 0, 5);
- }
-
- /**
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
- */
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(Item item, CreativeTabs tab, List metaList){
- for (int i = 0; i < this.saplingTextures.length; ++i){
- metaList.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister iIcon){
- for (int i = 0; i < saplingTextures.length; ++i){
- saplingTextures[i] = iIcon.registerIcon(CORE.MODID + ":" + "trees/" + "saplings/" + "sapling_" + saplingTypes[i]);
- }
- }
-
-} \ No newline at end of file
+ // return this.saplingTextures[meta % this.saplingTextures.length];
+ try {
+ return this.saplingTextures[meta];
+ } catch (Throwable T) {
+ Logger.WARNING("Invalid Sapling meta is " + meta);
+ return this.saplingTextures[0];
+ }
+ }
+
+ /**
+ * Ticks the block if it's been scheduled
+ */
+ @Override
+ public void updateTick(World world, int x, int y, int z, Random rand) {
+ if (!world.isRemote) {
+ super.updateTick(world, x, y, z, rand);
+ if (world.getBlockLightValue(x, y + 1, z) >= 9 && rand.nextInt(7) == 0) {
+ Logger.WARNING("Update Tick");
+ this.updateMeta(world, x, y, z, rand);
+ } else {
+ Logger.WARNING("Tried to Tick.");
+ }
+ }
+ }
+
+ // Dunno - Think it is doGrow || doGrowthTick
+ @Override
+ public void func_149853_b(World world, Random rand, int x, int y, int z) {
+ Logger.WARNING("Please find what calls me - func_149853_b");
+ this.updateMeta(world, x, y, z, rand);
+ }
+
+ public void updateMeta(World world, int x, int y, int z, Random rand) {
+ func_149879_c(world, x, y, z, rand);
+ }
+
+ @Override
+ public void func_149879_c(World world, int x, int y, int z, Random rand) {
+ Logger.WARNING("func_149879_c - 1");
+ int l = world.getBlockMetadata(x, y, z);
+
+ if ((l & 8) == 0) {
+ Logger.WARNING("func_149879_c - 2");
+ world.setBlockMetadataWithNotify(x, y, z, l | 8, 4);
+ } else {
+ Logger.WARNING("func_149879_c - 3");
+ this.func_149878_d(world, x, y, z, rand);
+ }
+ }
+
+ @Override
+ public void func_149878_d(World world, int x, int y, int z, Random rand) {
+ Logger.WARNING("func_149878_d - 1");
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return;
+ int l = world.getBlockMetadata(x, y, z) & 7;
+ Object object = rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
+ int i1 = 0;
+ int j1 = 0;
+ boolean flag = false;
+
+ switch (l) {
+ case 0:
+ default:
+ Logger.WARNING("Case 0 - Grow Tree");
+ break;
+ }
+
+ Block block = Blocks.air;
+
+ if (flag) {
+ world.setBlock(x + i1, y, z + j1, block, 0, 4);
+ world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4);
+ world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4);
+ world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4);
+ } else {
+ world.setBlock(x, y, z, block, 0, 4);
+ }
+
+ if (!((WorldGenerator) object).generate(world, rand, x + i1, y, z + j1)) {
+ if (flag) {
+ world.setBlock(x + i1, y, z + j1, this, l, 4);
+ world.setBlock(x + i1 + 1, y, z + j1, this, l, 4);
+ world.setBlock(x + i1, y, z + j1 + 1, this, l, 4);
+ world.setBlock(x + i1 + 1, y, z + j1 + 1, this, l, 4);
+ } else {
+ world.setBlock(x, y, z, this, l, 4);
+ }
+ }
+ }
+
+ @Override
+ public boolean func_149880_a(World world, int p_149880_2_, int p_149880_3_, int p_149880_4_, int p_149880_5_) {
+ return world.getBlock(p_149880_2_, p_149880_3_, p_149880_4_) == this
+ && (world.getBlockMetadata(p_149880_2_, p_149880_3_, p_149880_4_) & 7) == p_149880_5_;
+ }
+
+ /**
+ * Determines the damage on the item the block drops. Used in cloth and wood.
+ */
+ @Override
+ public int damageDropped(int meta) {
+ return MathHelper.clamp_int(meta & 7, 0, 5);
+ }
+
+ /**
+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubBlocks(Item item, CreativeTabs tab, List metaList) {
+ for (int i = 0; i < this.saplingTextures.length; ++i) {
+ metaList.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister iIcon) {
+ for (int i = 0; i < saplingTextures.length; ++i) {
+ saplingTextures[i] =
+ iIcon.registerIcon(CORE.MODID + ":" + "trees/" + "saplings/" + "sapling_" + saplingTypes[i]);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java
index c942db14cf..b901766583 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java
@@ -1,36 +1,35 @@
package gtPlusPlus.xmod.bop.blocks.pine;
-import java.util.Random;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.chemistry.AgriculturalChem;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
import gtPlusPlus.xmod.bop.blocks.base.LeavesBase;
+import java.util.Random;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class LeavesPineTree extends LeavesBase {
- public LeavesPineTree(){
- super("Pine", "pine", new ItemStack[]{});
- this.treeType = new String[] {"pine"};
- this.leafType = new String[][] {{"pine"},{"pine_opaque"}};
- }
-
- @Override
- public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_){
- return Item.getItemFromBlock(BOP_Block_Registrator.sapling_Pine);
- }
+ public LeavesPineTree() {
+ super("Pine", "pine", new ItemStack[] {});
+ this.treeType = new String[] {"pine"};
+ this.leafType = new String[][] {{"pine"}, {"pine_opaque"}};
+ }
- @Override//Drops when Leaf is broken
- protected void func_150124_c(World world, int x, int y, int z, int meta, int randomChance){
- Logger.INFO("Dropping Bonus Drops");
- if (MathUtils.randInt(0, 10) >= 9) {
- this.dropBlockAsItem(world, x, y, z, ItemUtils.getSimpleStack(AgriculturalChem.mPinecone, MathUtils.randInt(1, 4)));
- }
- }
+ @Override
+ public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
+ return Item.getItemFromBlock(BOP_Block_Registrator.sapling_Pine);
+ }
-} \ No newline at end of file
+ @Override // Drops when Leaf is broken
+ protected void func_150124_c(World world, int x, int y, int z, int meta, int randomChance) {
+ Logger.INFO("Dropping Bonus Drops");
+ if (MathUtils.randInt(0, 10) >= 9) {
+ this.dropBlockAsItem(
+ world, x, y, z, ItemUtils.getSimpleStack(AgriculturalChem.mPinecone, MathUtils.randInt(1, 4)));
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java
index dee5bf02fd..e8de630960 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java
@@ -4,21 +4,21 @@ import gtPlusPlus.xmod.bop.blocks.base.LogBase;
public class LogPineTree extends LogBase {
- public LogPineTree(){
- super("Pine Log", "pine", new String[]{"pine"});
- this.treeType = new String[] {"pine"};
- }
+ public LogPineTree() {
+ super("Pine Log", "pine", new String[] {"pine"});
+ this.treeType = new String[] {"pine"};
+ }
- /*@Override
- @SideOnly(Side.CLIENT)
- protected IIcon getSideIcon(int metaID){
- return this.textureSide[metaID % this.textureSide.length];
- }
+ /*@Override
+ @SideOnly(Side.CLIENT)
+ protected IIcon getSideIcon(int metaID){
+ return this.textureSide[metaID % this.textureSide.length];
+ }
- @Override
- @SideOnly(Side.CLIENT)
- protected IIcon getTopIcon(int metaID){
- return this.textureTop[metaID % this.textureTop.length];
- }*/
-
-} \ No newline at end of file
+ @Override
+ @SideOnly(Side.CLIENT)
+ protected IIcon getTopIcon(int metaID){
+ return this.textureTop[metaID % this.textureTop.length];
+ }*/
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java
index 0ee04de899..a5c9012f76 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java
@@ -1,11 +1,10 @@
package gtPlusPlus.xmod.bop.blocks.pine;
-import java.util.Random;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.bop.blocks.base.SaplingBase;
import gtPlusPlus.xmod.bop.world.features.trees.WorldGenPineTree;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
@@ -15,41 +14,37 @@ import net.minecraft.world.gen.feature.WorldGenerator;
public class SaplingPineTree extends SaplingBase {
- public SaplingPineTree(){
- super("Pine Sapling", "pine", new String[]{"pine"});
- }
-
- @Override
- public void func_149878_d(World world, int x, int y, int z, Random rand){
- Logger.WARNING("func_149878_d - 1");
- if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return;
- rand.nextInt(10);
- new WorldGenBigTree(true);
- new WorldGenTrees(true);
- int i1 = 0;
- int j1 = 0;
- boolean flag = false;
-
- Block block = Blocks.air;
-
- if (flag)
- {
- world.setBlock(x + i1, y, z + j1, block, 0, 4);
- world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4);
- world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4);
- world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4);
- }
- else
- {
- world.setBlock(x, y, z, block, 0, 4);
- }
- Object obj = new WorldGenPineTree();
- if (obj != null) {
- world.setBlockToAir(x, y, z);
- if (!((WorldGenerator) obj).generate(world, CORE.RANDOM, x, y, z)) {
- world.setBlock(x, y, z, this, 0, 2);
- }
- }
- }
-
-} \ No newline at end of file
+ public SaplingPineTree() {
+ super("Pine Sapling", "pine", new String[] {"pine"});
+ }
+
+ @Override
+ public void func_149878_d(World world, int x, int y, int z, Random rand) {
+ Logger.WARNING("func_149878_d - 1");
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return;
+ rand.nextInt(10);
+ new WorldGenBigTree(true);
+ new WorldGenTrees(true);
+ int i1 = 0;
+ int j1 = 0;
+ boolean flag = false;
+
+ Block block = Blocks.air;
+
+ if (flag) {
+ world.setBlock(x + i1, y, z + j1, block, 0, 4);
+ world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4);
+ world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4);
+ world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4);
+ } else {
+ world.setBlock(x, y, z, block, 0, 4);
+ }
+ Object obj = new WorldGenPineTree();
+ if (obj != null) {
+ world.setBlockToAir(x, y, z);
+ if (!((WorldGenerator) obj).generate(world, CORE.RANDOM, x, y, z)) {
+ world.setBlock(x, y, z, this, 0, 2);
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LeavesRainforestTree.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LeavesRainforestTree.java
index 39e434243a..fe6eb4446d 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LeavesRainforestTree.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LeavesRainforestTree.java
@@ -1,26 +1,23 @@
package gtPlusPlus.xmod.bop.blocks.rainforest;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
+import gtPlusPlus.xmod.bop.blocks.base.LeavesBase;
import java.util.Random;
-
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
-import gtPlusPlus.xmod.bop.blocks.base.LeavesBase;
-
public class LeavesRainforestTree extends LeavesBase {
- public LeavesRainforestTree(){
- super("Rainforest Oak", "rainforestoak", new ItemStack[]{ItemUtils.getSimpleStack(Items.apple)});
- this.treeType = new String[] {"rainforest"};
- this.leafType = new String[][] {{"rainforest"},{"rainforest_opaque"}};
- }
-
- @Override
- public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_){
- return Item.getItemFromBlock(BOP_Block_Registrator.sapling_Rainforest);
- }
+ public LeavesRainforestTree() {
+ super("Rainforest Oak", "rainforestoak", new ItemStack[] {ItemUtils.getSimpleStack(Items.apple)});
+ this.treeType = new String[] {"rainforest"};
+ this.leafType = new String[][] {{"rainforest"}, {"rainforest_opaque"}};
+ }
-} \ No newline at end of file
+ @Override
+ public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
+ return Item.getItemFromBlock(BOP_Block_Registrator.sapling_Rainforest);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LogRainforestTree.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LogRainforestTree.java
index 6d30caafb7..b3f42fcd93 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LogRainforestTree.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/LogRainforestTree.java
@@ -4,21 +4,21 @@ import gtPlusPlus.xmod.bop.blocks.base.LogBase;
public class LogRainforestTree extends LogBase {
- public LogRainforestTree(){
- super("Rainforest Oak", "rainforestoak", new String[]{"rainforest"});
- this.treeType = new String[] {"rainforest"};
- }
+ public LogRainforestTree() {
+ super("Rainforest Oak", "rainforestoak", new String[] {"rainforest"});
+ this.treeType = new String[] {"rainforest"};
+ }
- /*@Override
- @SideOnly(Side.CLIENT)
- protected IIcon getSideIcon(int metaID){
- return this.textureSide[metaID % this.textureSide.length];
- }
+ /*@Override
+ @SideOnly(Side.CLIENT)
+ protected IIcon getSideIcon(int metaID){
+ return this.textureSide[metaID % this.textureSide.length];
+ }
- @Override
- @SideOnly(Side.CLIENT)
- protected IIcon getTopIcon(int metaID){
- return this.textureTop[metaID % this.textureTop.length];
- }*/
-
-} \ No newline at end of file
+ @Override
+ @SideOnly(Side.CLIENT)
+ protected IIcon getTopIcon(int metaID){
+ return this.textureTop[metaID % this.textureTop.length];
+ }*/
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java
index 73b916d383..72de197adf 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.bop.blocks.rainforest;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
+import gtPlusPlus.xmod.bop.blocks.base.SaplingBase;
+import gtPlusPlus.xmod.bop.world.features.trees.WorldGenRainForestTree_Ex;
import java.util.Random;
-
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
@@ -9,58 +12,46 @@ import net.minecraft.world.gen.feature.WorldGenBigTree;
import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraft.world.gen.feature.WorldGenerator;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
-import gtPlusPlus.xmod.bop.blocks.base.SaplingBase;
-import gtPlusPlus.xmod.bop.world.features.trees.WorldGenRainForestTree_Ex;
-
public class SaplingRainforestTree extends SaplingBase {
- public SaplingRainforestTree(){
- super("Rainforest Oak Sapling", "rainforestoak", new String[]{"rainforest"});
- }
-
- @Override
- public void func_149878_d(World world, int x, int y, int z, Random rand){
- Logger.WARNING("func_149878_d - 1");
- if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return;
- int l = world.getBlockMetadata(x, y, z) & 7;
- rand.nextInt(10);
- new WorldGenBigTree(true);
- new WorldGenTrees(true);
- int i1 = 0;
- int j1 = 0;
- boolean flag = false;
-
- Block block = Blocks.air;
-
- if (flag)
- {
- world.setBlock(x + i1, y, z + j1, block, 0, 4);
- world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4);
- world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4);
- world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4);
- }
- else
- {
- world.setBlock(x, y, z, block, 0, 4);
- }
- Object o = new WorldGenRainForestTree_Ex(BOP_Block_Registrator.log_Rainforest, BOP_Block_Registrator.leaves_Rainforest, 0, 0, true, 50, 75);
-
- if (!((WorldGenerator)o).generate(world, rand, x + i1, y, z + j1))
- {
- if (flag)
- {
- world.setBlock(x + i1, y, z + j1, this, l, 4);
- world.setBlock(x + i1 + 1, y, z + j1, this, l, 4);
- world.setBlock(x + i1, y, z + j1 + 1, this, l, 4);
- world.setBlock(x + i1 + 1, y, z + j1 + 1, this, l, 4);
- }
- else
- {
- world.setBlock(x, y, z, this, l, 4);
- }
- }
- }
-
-} \ No newline at end of file
+ public SaplingRainforestTree() {
+ super("Rainforest Oak Sapling", "rainforestoak", new String[] {"rainforest"});
+ }
+
+ @Override
+ public void func_149878_d(World world, int x, int y, int z, Random rand) {
+ Logger.WARNING("func_149878_d - 1");
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return;
+ int l = world.getBlockMetadata(x, y, z) & 7;
+ rand.nextInt(10);
+ new WorldGenBigTree(true);
+ new WorldGenTrees(true);
+ int i1 = 0;
+ int j1 = 0;
+ boolean flag = false;
+
+ Block block = Blocks.air;
+
+ if (flag) {
+ world.setBlock(x + i1, y, z + j1, block, 0, 4);
+ world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4);
+ world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4);
+ world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4);
+ } else {
+ world.setBlock(x, y, z, block, 0, 4);
+ }
+ Object o = new WorldGenRainForestTree_Ex(
+ BOP_Block_Registrator.log_Rainforest, BOP_Block_Registrator.leaves_Rainforest, 0, 0, true, 50, 75);
+
+ if (!((WorldGenerator) o).generate(world, rand, x + i1, y, z + j1)) {
+ if (flag) {
+ world.setBlock(x + i1, y, z + j1, this, l, 4);
+ world.setBlock(x + i1 + 1, y, z + j1, this, l, 4);
+ world.setBlock(x + i1, y, z + j1 + 1, this, l, 4);
+ world.setBlock(x + i1 + 1, y, z + j1 + 1, this, l, 4);
+ } else {
+ world.setBlock(x, y, z, this, l, 4);
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/creative/MiscUtilsBOPTab.java b/src/main/java/gtPlusPlus/xmod/bop/creative/MiscUtilsBOPTab.java
index d33b19aaf9..a4795efa51 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/creative/MiscUtilsBOPTab.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/creative/MiscUtilsBOPTab.java
@@ -1,20 +1,19 @@
package gtPlusPlus.xmod.bop.creative;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
public class MiscUtilsBOPTab extends CreativeTabs {
- public MiscUtilsBOPTab(final String lable) {
- super(lable);
- }
-
- @Override
- public Item getTabIconItem() {
- return ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest).getItem();
- }
+ public MiscUtilsBOPTab(final String lable) {
+ super(lable);
+ }
+ @Override
+ public Item getTabIconItem() {
+ return ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest)
+ .getItem();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenPineTree.java b/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenPineTree.java
index 831108ec99..a3f805c710 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenPineTree.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenPineTree.java
@@ -1,9 +1,8 @@
package gtPlusPlus.xmod.bop.world.features.trees;
-import java.util.Random;
-
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling;
import net.minecraft.init.Blocks;
@@ -11,161 +10,160 @@ import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraftforge.common.util.ForgeDirection;
-public class WorldGenPineTree extends WorldGenAbstractTree{
-
- public WorldGenPineTree() {
- super(true);
- }
-
- @Override
- public boolean generate(World world, Random random, int x, int y, int z) {
- while (world.isAirBlock(x, y, z) && y > 2) {
- --y;
- }
-
- Block aSoilBlock = world.getBlock(x, y, z);
-
- if (!canBlockSustainSapling(world, aSoilBlock, x, y, z)) {
- return false;
- } else {
- int height;
- int branches;
- for (height = -2; height <= 2; ++height) {
- for (branches = -2; branches <= 2; ++branches) {
- if (world.isAirBlock(x + height, y - 1, z + branches)
- && world.isAirBlock(x + height, y - 2, z + branches)
- && !world.isAirBlock(x + height, y, z + branches)) {
- return false;
- }
- }
- }
-
- height = 2 + MathUtils.randInt(8, 16);
- branches = 2 + MathUtils.randInt(6, 18);
- int h = 1;
- aSoilBlock.onPlantGrow(world, x, y - 1, z, x, y, z);
-
- int c;
- int r = MathUtils.randInt(1, 3);
- for (c = 0; c < height; ++c) {
- this.buildBlock(world, x, y + h, z, BOP_Block_Registrator.log_Pine, 0);
- h++;
- if (c >= r && c % 2 == 0) {
- this.generateBranch(world, random, x, y + h, z, c);
- }
- }
-
- this.generateTop(world, x, y + h, z);
- return true;
- }
- }
-
- public void generateTop(World world, int x, int y, int z) {
- for (int i = -1; i < 2; ++i) {
- for (int j = -1; j < 2; ++j) {
- this.buildBlock(world, x + i, y, z + j, BOP_Block_Registrator.leaves_Pine, 0);
- }
- }
-
- this.buildBlock(world, x, y, z, BOP_Block_Registrator.log_Pine, 0);
- this.buildBlock(world, x + 1, y + 1, z, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x, y + 1, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x, y + 1, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x - 1, y + 1, z, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x, y + 2, z, BOP_Block_Registrator.leaves_Pine, 0);
- }
-
- public void generateBranch(World world, Random rand, int x, int y, int z, int n) {
- int var99999;
- int var99998;
- for (var99999 = -1; var99999 < 2; ++var99999) {
- for (var99998 = -1; var99998 < 2; ++var99998) {
- this.buildBlock(world, x + var99999, y, z + var99998, BOP_Block_Registrator.leaves_Pine, 0);
- }
- }
-
- var99999 = rand.nextInt(2);
- var99998 = rand.nextInt(2);
- int var99997 = rand.nextInt(2);
- int var99996 = rand.nextInt(2);
- if (n % 2 == 0) {
- if (var99998 == 0) {
- this.buildBlock(world, x + 1, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x + 2, y - 1, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
- if (var99999 == 0) {
- this.buildBlock(world, x + 2, y - 2, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- } else {
- this.buildBlock(world, x + 2, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- }
- } else {
- this.buildBlock(world, x + 1, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x + 2, y, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x + 2, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- }
-
- if (var99997 == 0) {
- this.buildBlock(world, x - 2, y - 1, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x - 1, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- if (var99996 == 0) {
- this.buildBlock(world, x - 2, y - 2, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- } else {
- this.buildBlock(world, x - 2, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- }
- } else {
- this.buildBlock(world, x - 2, y, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x - 1, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x - 2, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- }
- } else {
- if (var99998 == 0) {
- this.buildBlock(world, x + 2, y - 1, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x + 1, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- if (var99999 == 0) {
- this.buildBlock(world, x + 2, y - 2, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- } else {
- this.buildBlock(world, x + 2, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- }
- } else {
- this.buildBlock(world, x + 2, y, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x + 1, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- if (var99999 == 0) {
- this.buildBlock(world, x + 2, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- } else {
- this.buildBlock(world, x + 2, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
- }
- }
-
- if (var99997 == 0) {
- this.buildBlock(world, x - 1, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x - 2, y - 1, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
- if (var99996 == 0) {
- this.buildBlock(world, x - 2, y - 2, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- } else {
- this.buildBlock(world, x - 2, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- }
- } else {
- this.buildBlock(world, x - 1, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- this.buildBlock(world, x - 2, y, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
- if (var99996 == 0) {
- this.buildBlock(world, x - 2, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- } else {
- this.buildBlock(world, x - 2, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
- }
- }
- }
-
- this.buildBlock(world, x, y, z, BOP_Block_Registrator.log_Pine, 0);
- this.buildBlock(world, x, y + 1, z, BOP_Block_Registrator.log_Pine, 0);
- }
-
- public void buildBlock(World world, int x, int y, int z, Block block, int meta) {
- if (world.isAirBlock(x, y, z) || world.getBlock(x, y, z).isLeaves(world, x, y, z)) {
- world.setBlock(x, y, z, block, meta, 2);
- }
- }
-
- public boolean canBlockSustainSapling(World world, Block block, int x, int y, int z) {
- return block.canSustainPlant(world, x, y, z, ForgeDirection.UP, (BlockSapling)Blocks.sapling);
- }
-
+public class WorldGenPineTree extends WorldGenAbstractTree {
+
+ public WorldGenPineTree() {
+ super(true);
+ }
+
+ @Override
+ public boolean generate(World world, Random random, int x, int y, int z) {
+ while (world.isAirBlock(x, y, z) && y > 2) {
+ --y;
+ }
+
+ Block aSoilBlock = world.getBlock(x, y, z);
+
+ if (!canBlockSustainSapling(world, aSoilBlock, x, y, z)) {
+ return false;
+ } else {
+ int height;
+ int branches;
+ for (height = -2; height <= 2; ++height) {
+ for (branches = -2; branches <= 2; ++branches) {
+ if (world.isAirBlock(x + height, y - 1, z + branches)
+ && world.isAirBlock(x + height, y - 2, z + branches)
+ && !world.isAirBlock(x + height, y, z + branches)) {
+ return false;
+ }
+ }
+ }
+
+ height = 2 + MathUtils.randInt(8, 16);
+ branches = 2 + MathUtils.randInt(6, 18);
+ int h = 1;
+ aSoilBlock.onPlantGrow(world, x, y - 1, z, x, y, z);
+
+ int c;
+ int r = MathUtils.randInt(1, 3);
+ for (c = 0; c < height; ++c) {
+ this.buildBlock(world, x, y + h, z, BOP_Block_Registrator.log_Pine, 0);
+ h++;
+ if (c >= r && c % 2 == 0) {
+ this.generateBranch(world, random, x, y + h, z, c);
+ }
+ }
+
+ this.generateTop(world, x, y + h, z);
+ return true;
+ }
+ }
+
+ public void generateTop(World world, int x, int y, int z) {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ this.buildBlock(world, x + i, y, z + j, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+ }
+
+ this.buildBlock(world, x, y, z, BOP_Block_Registrator.log_Pine, 0);
+ this.buildBlock(world, x + 1, y + 1, z, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x, y + 1, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x, y + 1, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x - 1, y + 1, z, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x, y + 2, z, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+
+ public void generateBranch(World world, Random rand, int x, int y, int z, int n) {
+ int var99999;
+ int var99998;
+ for (var99999 = -1; var99999 < 2; ++var99999) {
+ for (var99998 = -1; var99998 < 2; ++var99998) {
+ this.buildBlock(world, x + var99999, y, z + var99998, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+ }
+
+ var99999 = rand.nextInt(2);
+ var99998 = rand.nextInt(2);
+ int var99997 = rand.nextInt(2);
+ int var99996 = rand.nextInt(2);
+ if (n % 2 == 0) {
+ if (var99998 == 0) {
+ this.buildBlock(world, x + 1, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x + 2, y - 1, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
+ if (var99999 == 0) {
+ this.buildBlock(world, x + 2, y - 2, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ } else {
+ this.buildBlock(world, x + 2, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+ } else {
+ this.buildBlock(world, x + 1, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x + 2, y, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x + 2, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+
+ if (var99997 == 0) {
+ this.buildBlock(world, x - 2, y - 1, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x - 1, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ if (var99996 == 0) {
+ this.buildBlock(world, x - 2, y - 2, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ } else {
+ this.buildBlock(world, x - 2, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+ } else {
+ this.buildBlock(world, x - 2, y, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x - 1, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x - 2, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+ } else {
+ if (var99998 == 0) {
+ this.buildBlock(world, x + 2, y - 1, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x + 1, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ if (var99999 == 0) {
+ this.buildBlock(world, x + 2, y - 2, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ } else {
+ this.buildBlock(world, x + 2, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+ } else {
+ this.buildBlock(world, x + 2, y, z + 1, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x + 1, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ if (var99999 == 0) {
+ this.buildBlock(world, x + 2, y - 1, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ } else {
+ this.buildBlock(world, x + 2, y, z + 2, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+ }
+
+ if (var99997 == 0) {
+ this.buildBlock(world, x - 1, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x - 2, y - 1, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
+ if (var99996 == 0) {
+ this.buildBlock(world, x - 2, y - 2, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ } else {
+ this.buildBlock(world, x - 2, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+ } else {
+ this.buildBlock(world, x - 1, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ this.buildBlock(world, x - 2, y, z - 1, BOP_Block_Registrator.leaves_Pine, 0);
+ if (var99996 == 0) {
+ this.buildBlock(world, x - 2, y - 1, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ } else {
+ this.buildBlock(world, x - 2, y, z - 2, BOP_Block_Registrator.leaves_Pine, 0);
+ }
+ }
+ }
+
+ this.buildBlock(world, x, y, z, BOP_Block_Registrator.log_Pine, 0);
+ this.buildBlock(world, x, y + 1, z, BOP_Block_Registrator.log_Pine, 0);
+ }
+
+ public void buildBlock(World world, int x, int y, int z, Block block, int meta) {
+ if (world.isAirBlock(x, y, z) || world.getBlock(x, y, z).isLeaves(world, x, y, z)) {
+ world.setBlock(x, y, z, block, meta, 2);
+ }
+ }
+
+ public boolean canBlockSustainSapling(World world, Block block, int x, int y, int z) {
+ return block.canSustainPlant(world, x, y, z, ForgeDirection.UP, (BlockSapling) Blocks.sapling);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java b/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java
index fa29f99655..cdd14b9c71 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/world/features/trees/WorldGenRainForestTree_Ex.java
@@ -1,246 +1,268 @@
package gtPlusPlus.xmod.bop.world.features.trees;
+import gtPlusPlus.api.objects.Logger;
import java.util.Random;
-
import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
-
-import gtPlusPlus.api.objects.Logger;
import net.minecraftforge.common.util.ForgeDirection;
-public class WorldGenRainForestTree_Ex extends WorldGenAbstractTree{
-
- private final int minTreeHeight;
- private final int randomTreeHeight;
- private final Block wood;
- private final Block leaves;
- private final int woodMeta;
- private final int leavesMeta;
-
- // return random.nextInt(5) == 0 ? new WorldGenTrees(false, 4 + random.nextInt(7), 3, 3, true) : new WorldGenRainforestTree1(BOPCBlocks.logs4, BOPCBlocks.colorizedLeaves2, 3, 2, false, 8, 8);
+public class WorldGenRainForestTree_Ex extends WorldGenAbstractTree {
- public WorldGenRainForestTree_Ex(Block wood, Block leaves, int woodMeta, int leavesMeta, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight) {
- super(doBlockNotify);
- this.wood = wood;
- this.leaves = leaves;
- this.woodMeta = woodMeta;
- this.leavesMeta = leavesMeta;
- this.minTreeHeight = minTreeHeight;
- this.randomTreeHeight = randomTreeHeight;
- }
+ private final int minTreeHeight;
+ private final int randomTreeHeight;
+ private final Block wood;
+ private final Block leaves;
+ private final int woodMeta;
+ private final int leavesMeta;
- @Override
- public boolean generate(World world, Random random, int x, int y, int z)
- {
- int treeHeight = random.nextInt(this.randomTreeHeight) + this.minTreeHeight;
- boolean flag = true;
- if ((y >= 1) && (y + treeHeight + 1 <= 256))
- {
- for (int i1 = y; i1 <= y + 1 + treeHeight; i1++)
- {
- byte b0 = 1;
- if (i1 == y) {
- b0 = 0;
- }
- if (i1 >= y + 1 + treeHeight - 2) {
- b0 = 2;
- }
- for (int j1 = x - b0; (j1 <= x + b0) && (flag); j1++) {
- for (int k1 = z - b0; (k1 <= z + b0) && (flag); k1++) {
- if ((i1 >= 0) && (i1 < 256))
- {
- Block block = world.getBlock(j1, i1, k1);
- if (!isReplaceable(world, j1, i1, k1)) {
- flag = false;
- }
- }
- else
- {
- flag = false;
- }
- }
- }
- }
- if (!flag) {
- return false;
- }
- Block block2 = world.getBlock(x, y - 1, z);
+ // return random.nextInt(5) == 0 ? new WorldGenTrees(false, 4 + random.nextInt(7), 3, 3, true) : new
+ // WorldGenRainforestTree1(BOPCBlocks.logs4, BOPCBlocks.colorizedLeaves2, 3, 2, false, 8, 8);
- boolean isSoil = block2.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling)Blocks.sapling);
- if ((isSoil) && (y < 256 - treeHeight - 1))
- {
- block2.onPlantGrow(world, x, y - 1, z, x, y, z);
- byte b0 = 3;
- byte b1 = 0;
- Logger.WARNING("Sapling located at X:"+x+" | Y:"+y+" | Z:"+z);
- for (int k1 = y - b0 + treeHeight; k1 <= y + treeHeight; k1++)
- {
- Logger.WARNING("[1]| k1 = "+k1+" | y = "+y+" | b0 = "+b0+" | l = "+treeHeight+" | ");
- int i3 = k1 - (y + treeHeight);
- int l1 = b1 + 1 - i3;
- for (int i2 = x - l1; i2 <= x + l1; i2++){
- int j2 = i2 - x;
- Logger.WARNING("[2]| i2 = "+i2+" | x = "+x+" | l1 = "+l1+" | j2 = "+j2+" | ");
- for (int k2 = z - l1; k2 <= z + l1; k2++){
- int l2 = k2 - z;
- Logger.WARNING("[3]| k2 = "+k2+" | z = "+z+" | l1 = "+l1+" | l2 = "+l2+" | ");
- if ((Math.abs(j2) != l1) || (Math.abs(l2) != l1) || ((random.nextInt(2) != 0) && (i3 != 0)))
- {
- Block block1 = world.getBlock(i2, k1, k2);
- if ((block1.isAir(world, i2, k1, k2)) || (block1.isLeaves(world, i2, k1, k2))) {
- Logger.WARNING("Setting something as leaves?");
- setBlockAndNotifyAdequately(world, i2, k1, k2, this.leaves, this.leavesMeta);
- }
- }
- }
- }
- }
- for (int k1 = 0; k1 < treeHeight; k1++)
- {
- Logger.WARNING("Building tree - Layer "+k1+" | Max height is "+treeHeight);
- Block block = world.getBlock(x, y + k1, z);
- if ((block.isAir(world, x, y + k1, z)) || (block.isLeaves(world, x, y + k1, z))){
- setBlockAndNotifyAdequately(world, x, y + k1, z, this.wood, this.woodMeta);
+ public WorldGenRainForestTree_Ex(
+ Block wood,
+ Block leaves,
+ int woodMeta,
+ int leavesMeta,
+ boolean doBlockNotify,
+ int minTreeHeight,
+ int randomTreeHeight) {
+ super(doBlockNotify);
+ this.wood = wood;
+ this.leaves = leaves;
+ this.woodMeta = woodMeta;
+ this.leavesMeta = leavesMeta;
+ this.minTreeHeight = minTreeHeight;
+ this.randomTreeHeight = randomTreeHeight;
+ }
- //Trying this to make trunk
- setBlockAndNotifyAdequately(world, x, y + k1, z+1, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + k1, z-1, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x+1, y + k1, z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x-1, y + k1, z, this.wood, this.woodMeta);
+ @Override
+ public boolean generate(World world, Random random, int x, int y, int z) {
+ int treeHeight = random.nextInt(this.randomTreeHeight) + this.minTreeHeight;
+ boolean flag = true;
+ if ((y >= 1) && (y + treeHeight + 1 <= 256)) {
+ for (int i1 = y; i1 <= y + 1 + treeHeight; i1++) {
+ byte b0 = 1;
+ if (i1 == y) {
+ b0 = 0;
+ }
+ if (i1 >= y + 1 + treeHeight - 2) {
+ b0 = 2;
+ }
+ for (int j1 = x - b0; (j1 <= x + b0) && (flag); j1++) {
+ for (int k1 = z - b0; (k1 <= z + b0) && (flag); k1++) {
+ if ((i1 >= 0) && (i1 < 256)) {
+ Block block = world.getBlock(j1, i1, k1);
+ if (!isReplaceable(world, j1, i1, k1)) {
+ flag = false;
+ }
+ } else {
+ flag = false;
+ }
+ }
+ }
+ }
+ if (!flag) {
+ return false;
+ }
+ Block block2 = world.getBlock(x, y - 1, z);
+ boolean isSoil =
+ block2.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling) Blocks.sapling);
+ if ((isSoil) && (y < 256 - treeHeight - 1)) {
+ block2.onPlantGrow(world, x, y - 1, z, x, y, z);
+ byte b0 = 3;
+ byte b1 = 0;
+ Logger.WARNING("Sapling located at X:" + x + " | Y:" + y + " | Z:" + z);
+ for (int k1 = y - b0 + treeHeight; k1 <= y + treeHeight; k1++) {
+ Logger.WARNING(
+ "[1]| k1 = " + k1 + " | y = " + y + " | b0 = " + b0 + " | l = " + treeHeight + " | ");
+ int i3 = k1 - (y + treeHeight);
+ int l1 = b1 + 1 - i3;
+ for (int i2 = x - l1; i2 <= x + l1; i2++) {
+ int j2 = i2 - x;
+ Logger.WARNING("[2]| i2 = " + i2 + " | x = " + x + " | l1 = " + l1 + " | j2 = " + j2 + " | ");
+ for (int k2 = z - l1; k2 <= z + l1; k2++) {
+ int l2 = k2 - z;
+ Logger.WARNING(
+ "[3]| k2 = " + k2 + " | z = " + z + " | l1 = " + l1 + " | l2 = " + l2 + " | ");
+ if ((Math.abs(j2) != l1)
+ || (Math.abs(l2) != l1)
+ || ((random.nextInt(2) != 0) && (i3 != 0))) {
+ Block block1 = world.getBlock(i2, k1, k2);
+ if ((block1.isAir(world, i2, k1, k2)) || (block1.isLeaves(world, i2, k1, k2))) {
+ Logger.WARNING("Setting something as leaves?");
+ setBlockAndNotifyAdequately(world, i2, k1, k2, this.leaves, this.leavesMeta);
+ }
+ }
+ }
+ }
+ }
+ for (int k1 = 0; k1 < treeHeight; k1++) {
+ Logger.WARNING("Building tree - Layer " + k1 + " | Max height is " + treeHeight);
+ Block block = world.getBlock(x, y + k1, z);
+ if ((block.isAir(world, x, y + k1, z)) || (block.isLeaves(world, x, y + k1, z))) {
+ setBlockAndNotifyAdequately(world, x, y + k1, z, this.wood, this.woodMeta);
- if (k1 >= 5){
- if (k1 % 5 == 0){
- //Bottom layer
- Block block5 = world.getBlock(x, y + k1, z);
- for (int xDir = -5; xDir <= 5; xDir++){
- for (int zDir = -5; zDir <= 5; zDir++){
- if (canRemoveLeafBlockLayer2(-5, 5, xDir, -5, 5, zDir)){
- Logger.WARNING("Doing Nothing at "+"x="+xDir+" | y="+y+" z="+zDir);
- }
- else {
- Logger.WARNING("Trying to place leaves at "+"x="+xDir+" | y="+y+" z="+zDir);
- block5 = world.getBlock(x+xDir, y+k1, z+zDir);
- if (block5.isAir(world, x+xDir, y+k1, x+zDir)){
- setBlockAndNotifyAdequately(world, x+xDir, y + k1, z+zDir, this.leaves, this.leavesMeta);
- }
- }
- }
- }
- //Next Layer
- for (int xDir = -4; xDir <= 4; xDir++){
- for (int zDir = -4; zDir <= 4; zDir++){
- if (canRemoveLeafBlockLayer2(-4, 4, xDir, -4, 4, zDir)){
- Logger.WARNING("Doing Nothing at "+"x="+xDir+" | y="+y+k1+1+" z="+zDir);
- }
- else {
- Logger.WARNING("Trying to place leaves at "+"x="+xDir+" | y="+y + k1 + 1+" z="+zDir);
- block5 = world.getBlock(x+xDir, y+k1 + 1, z+zDir);
- if (block5.isAir(world, x+xDir, y+k1 + 1, x+zDir)){
- setBlockAndNotifyAdequately(world, x+xDir, y + k1 + 1, z+zDir, this.leaves, this.leavesMeta);
- }
- }
- }
- }
+ // Trying this to make trunk
+ setBlockAndNotifyAdequately(world, x, y + k1, z + 1, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + k1, z - 1, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x + 1, y + k1, z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x - 1, y + k1, z, this.wood, this.woodMeta);
- //Third Layer
- for (int xDir = -3; xDir <= 3; xDir++){
- for (int zDir = -3; zDir <= 3; zDir++){
- if (canRemoveLeafBlockLayer2(-3, 3, xDir, -3, 3, zDir)){
- Logger.WARNING("Doing Nothing at "+"x="+xDir+" | y="+y+k1+2+" z="+zDir);
- }
- else {
- Logger.WARNING("Trying to place leaves at "+"x="+xDir+" | y="+y+k1+2+" z="+zDir);
- block5 = world.getBlock(x+xDir, y+k1+2, z+zDir);
- if (block5.isAir(world, x+xDir, y+k1+2, x+zDir)){
- setBlockAndNotifyAdequately(world, x+xDir, y + k1 + 2, z+zDir, this.leaves, this.leavesMeta);
- }
- }
- }
- }
+ if (k1 >= 5) {
+ if (k1 % 5 == 0) {
+ // Bottom layer
+ Block block5 = world.getBlock(x, y + k1, z);
+ for (int xDir = -5; xDir <= 5; xDir++) {
+ for (int zDir = -5; zDir <= 5; zDir++) {
+ if (canRemoveLeafBlockLayer2(-5, 5, xDir, -5, 5, zDir)) {
+ Logger.WARNING(
+ "Doing Nothing at " + "x=" + xDir + " | y=" + y + " z=" + zDir);
+ } else {
+ Logger.WARNING("Trying to place leaves at " + "x=" + xDir + " | y=" + y
+ + " z=" + zDir);
+ block5 = world.getBlock(x + xDir, y + k1, z + zDir);
+ if (block5.isAir(world, x + xDir, y + k1, x + zDir)) {
+ setBlockAndNotifyAdequately(
+ world,
+ x + xDir,
+ y + k1,
+ z + zDir,
+ this.leaves,
+ this.leavesMeta);
+ }
+ }
+ }
+ }
+ // Next Layer
+ for (int xDir = -4; xDir <= 4; xDir++) {
+ for (int zDir = -4; zDir <= 4; zDir++) {
+ if (canRemoveLeafBlockLayer2(-4, 4, xDir, -4, 4, zDir)) {
+ Logger.WARNING("Doing Nothing at " + "x=" + xDir + " | y=" + y + k1 + 1
+ + " z=" + zDir);
+ } else {
+ Logger.WARNING("Trying to place leaves at " + "x=" + xDir + " | y=" + y + k1
+ + 1 + " z=" + zDir);
+ block5 = world.getBlock(x + xDir, y + k1 + 1, z + zDir);
+ if (block5.isAir(world, x + xDir, y + k1 + 1, x + zDir)) {
+ setBlockAndNotifyAdequately(
+ world,
+ x + xDir,
+ y + k1 + 1,
+ z + zDir,
+ this.leaves,
+ this.leavesMeta);
+ }
+ }
+ }
+ }
- //Fourth Layer
- for (int xDir = -2; xDir <= 2; xDir++){
- for (int zDir = -2; zDir <= 2; zDir++){
- if (canRemoveLeafBlockLayer2(-2, 2, xDir, -2, 2, zDir)){
- Logger.WARNING("Doing Nothing at "+"x="+xDir+" | y="+y+k1+3+" z="+zDir);
- }
- else {
- Logger.WARNING("Trying to place leaves at "+"x="+xDir+" | y="+y+k1+3+" z="+zDir);
- block5 = world.getBlock(x+xDir, y+k1+3, z+zDir);
- if (block5.isAir(world, x+xDir, y+k1+3, x+zDir)){
- setBlockAndNotifyAdequately(world, x+xDir, y + k1 + 3, z+zDir, this.leaves, this.leavesMeta);
- }
- }
- }
- }
- }
- else {
+ // Third Layer
+ for (int xDir = -3; xDir <= 3; xDir++) {
+ for (int zDir = -3; zDir <= 3; zDir++) {
+ if (canRemoveLeafBlockLayer2(-3, 3, xDir, -3, 3, zDir)) {
+ Logger.WARNING("Doing Nothing at " + "x=" + xDir + " | y=" + y + k1 + 2
+ + " z=" + zDir);
+ } else {
+ Logger.WARNING("Trying to place leaves at " + "x=" + xDir + " | y=" + y + k1
+ + 2 + " z=" + zDir);
+ block5 = world.getBlock(x + xDir, y + k1 + 2, z + zDir);
+ if (block5.isAir(world, x + xDir, y + k1 + 2, x + zDir)) {
+ setBlockAndNotifyAdequately(
+ world,
+ x + xDir,
+ y + k1 + 2,
+ z + zDir,
+ this.leaves,
+ this.leavesMeta);
+ }
+ }
+ }
+ }
- }
- }
+ // Fourth Layer
+ for (int xDir = -2; xDir <= 2; xDir++) {
+ for (int zDir = -2; zDir <= 2; zDir++) {
+ if (canRemoveLeafBlockLayer2(-2, 2, xDir, -2, 2, zDir)) {
+ Logger.WARNING("Doing Nothing at " + "x=" + xDir + " | y=" + y + k1 + 3
+ + " z=" + zDir);
+ } else {
+ Logger.WARNING("Trying to place leaves at " + "x=" + xDir + " | y=" + y + k1
+ + 3 + " z=" + zDir);
+ block5 = world.getBlock(x + xDir, y + k1 + 3, z + zDir);
+ if (block5.isAir(world, x + xDir, y + k1 + 3, x + zDir)) {
+ setBlockAndNotifyAdequately(
+ world,
+ x + xDir,
+ y + k1 + 3,
+ z + zDir,
+ this.leaves,
+ this.leavesMeta);
+ }
+ }
+ }
+ }
+ } else {
- setBlockAndNotifyAdequately(world, x - 3, y + (treeHeight - 3), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x + 3, y + (treeHeight - 3), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z - 3, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z + 3, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x - 2, y + (treeHeight - 4), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x + 2, y + (treeHeight - 4), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 4), z - 2, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 4), z + 2, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x - 2, y + (treeHeight - 5), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x + 2, y + (treeHeight - 5), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 5), z - 2, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 5), z + 2, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x - 1, y + (treeHeight - 6), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x + 1, y + (treeHeight - 6), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 6), z - 1, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 6), z + 1, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z, this.leaves, this.leavesMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 2), z, this.leaves, this.leavesMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 1), z, this.leaves, this.leavesMeta);
- setBlockAndNotifyAdequately(world, x, y + treeHeight, z, this.leaves, this.leavesMeta);
- func_150515_a(world, x, y + (treeHeight - 4), z, Blocks.air);
- func_150515_a(world, x, y + (treeHeight - 5), z, Blocks.air);
- setBlockAndNotifyAdequately(world, x - 1, y + (treeHeight - 3), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x + 1, y + (treeHeight - 3), z, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z - 1, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z + 1, this.wood, this.woodMeta);
- setBlockAndNotifyAdequately(world, x, y + (treeHeight - 2), z, this.wood, this.woodMeta);
- }
- }
- return true;
- }
- return false;
- }
- return false;
- }
+ }
+ }
- private boolean canRemoveLeafBlockLayer2(int xDirMin, int xDirMax, int xDir, int zDirMin, int zDirMax, int zDir){
- if (xDir == xDirMin || xDir == xDirMin +1 || xDir == xDirMax || xDir == xDirMax - 1){
- if (zDir == zDirMin || zDir == zDirMin + 1 || zDir == zDirMax || zDir == zDirMax - 1){
- if (xDir == xDirMin + 1 && zDir == zDirMin + 1){
- return false;
- }
- else if (xDir == xDirMin + 1 && zDir == zDirMax - 1){
- return false;
- }
- else if (xDir == xDirMax - 1 && zDir == zDirMin + 1){
- return false;
- }
- else if (xDir == xDirMax - 1 && zDir == zDirMax - 1){
- return false;
- }
- return true;
- }
- return false;
- }
- else {
- return false;
- }
- }
+ setBlockAndNotifyAdequately(world, x - 3, y + (treeHeight - 3), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x + 3, y + (treeHeight - 3), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z - 3, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z + 3, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x - 2, y + (treeHeight - 4), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x + 2, y + (treeHeight - 4), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 4), z - 2, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 4), z + 2, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x - 2, y + (treeHeight - 5), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x + 2, y + (treeHeight - 5), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 5), z - 2, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 5), z + 2, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x - 1, y + (treeHeight - 6), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x + 1, y + (treeHeight - 6), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 6), z - 1, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 6), z + 1, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z, this.leaves, this.leavesMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 2), z, this.leaves, this.leavesMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 1), z, this.leaves, this.leavesMeta);
+ setBlockAndNotifyAdequately(world, x, y + treeHeight, z, this.leaves, this.leavesMeta);
+ func_150515_a(world, x, y + (treeHeight - 4), z, Blocks.air);
+ func_150515_a(world, x, y + (treeHeight - 5), z, Blocks.air);
+ setBlockAndNotifyAdequately(world, x - 1, y + (treeHeight - 3), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x + 1, y + (treeHeight - 3), z, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z - 1, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 3), z + 1, this.wood, this.woodMeta);
+ setBlockAndNotifyAdequately(world, x, y + (treeHeight - 2), z, this.wood, this.woodMeta);
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+ return false;
+ }
+ private boolean canRemoveLeafBlockLayer2(int xDirMin, int xDirMax, int xDir, int zDirMin, int zDirMax, int zDir) {
+ if (xDir == xDirMin || xDir == xDirMin + 1 || xDir == xDirMax || xDir == xDirMax - 1) {
+ if (zDir == zDirMin || zDir == zDirMin + 1 || zDir == zDirMax || zDir == zDirMax - 1) {
+ if (xDir == xDirMin + 1 && zDir == zDirMin + 1) {
+ return false;
+ } else if (xDir == xDirMin + 1 && zDir == zDirMax - 1) {
+ return false;
+ } else if (xDir == xDirMax - 1 && zDir == zDirMin + 1) {
+ return false;
+ } else if (xDir == xDirMax - 1 && zDir == zDirMax - 1) {
+ return false;
+ }
+ return true;
+ }
+ return false;
+ } else {
+ return false;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java b/src/main/java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java
index 7bce4ab173..04c34f09ce 100644
--- a/src/main/java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java
+++ b/src/main/java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java
@@ -6,10 +6,9 @@ import gtPlusPlus.core.lib.LoadedMods;
public class HANDLER_COFH {
- public static void initItems() {
- if (LoadedMods.CoFHCore && (LoadedMods.IndustrialCraft2 || LoadedMods.IndustrialCraft2Classic)) {
- ModItems.RfEuBattery = new RF2EU_Battery();
- }
- }
-
+ public static void initItems() {
+ if (LoadedMods.CoFHCore && (LoadedMods.IndustrialCraft2 || LoadedMods.IndustrialCraft2Classic)) {
+ ModItems.RfEuBattery = new RF2EU_Battery();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/computronics/HANDLER_Computronics.java b/src/main/java/gtPlusPlus/xmod/computronics/HANDLER_Computronics.java
index 9647465711..446f232beb 100644
--- a/src/main/java/gtPlusPlus/xmod/computronics/HANDLER_Computronics.java
+++ b/src/main/java/gtPlusPlus/xmod/computronics/HANDLER_Computronics.java
@@ -3,37 +3,66 @@ package gtPlusPlus.xmod.computronics;
import gregtech.GT_Mod;
import gregtech.api.enums.*;
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.core.lib.LoadedMods;
public class HANDLER_Computronics {
- public static void preInit(){
- if (LoadedMods.Computronics){
-
- }
-
- }
-
- public static void init(){
- if (LoadedMods.Computronics){
-
- }
- else {
- GT_Mod.gregtechproxy.addFluid("Argon", "Argon", Materials.Argon, 2, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Argon, 1L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), 1000);
- GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 1L), Materials.Air.getGas(1000L), Materials.Nitrogen.getGas(780L), 1600, 32, false);
- GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 2L), Materials.Air.getGas(1000L), Materials.Oxygen.getGas(210L), 1600, 128, false);
- GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 3L), Materials.Air.getGas(1000L), Materials.Argon.getGas(5L), 6000, 512, false);
- GT_Values.RA.addElectrolyzerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Air, 1L), null, null, Materials.Air.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), null, null, null, null, null, null, 800, 30);
- }
- }
-
- public static void postInit(){
- if (LoadedMods.Computronics){
-
- }
+ public static void preInit() {
+ if (LoadedMods.Computronics) {}
+ }
- }
+ public static void init() {
+ if (LoadedMods.Computronics) {
+ } else {
+ GT_Mod.gregtechproxy.addFluid(
+ "Argon",
+ "Argon",
+ Materials.Argon,
+ 2,
+ 295,
+ GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Argon, 1L),
+ GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L),
+ 1000);
+ GT_Values.RA.addDistilleryRecipe(
+ ItemList.Circuit_Integrated.getWithDamage(0L, 1L),
+ Materials.Air.getGas(1000L),
+ Materials.Nitrogen.getGas(780L),
+ 1600,
+ 32,
+ false);
+ GT_Values.RA.addDistilleryRecipe(
+ ItemList.Circuit_Integrated.getWithDamage(0L, 2L),
+ Materials.Air.getGas(1000L),
+ Materials.Oxygen.getGas(210L),
+ 1600,
+ 128,
+ false);
+ GT_Values.RA.addDistilleryRecipe(
+ ItemList.Circuit_Integrated.getWithDamage(0L, 3L),
+ Materials.Air.getGas(1000L),
+ Materials.Argon.getGas(5L),
+ 6000,
+ 512,
+ false);
+ GT_Values.RA.addElectrolyzerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Air, 1L),
+ null,
+ null,
+ Materials.Air.getGas(2000L),
+ GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ 800,
+ 30);
+ }
+ }
+ public static void postInit() {
+ if (LoadedMods.Computronics) {}
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java b/src/main/java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java
index 5b3210d58a..1e96109660 100644
--- a/src/main/java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java
+++ b/src/main/java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java
@@ -2,86 +2,75 @@ package gtPlusPlus.xmod.eio.handler;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.disableEnderIOIngotTooltips;
-import java.lang.reflect.Field;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
import gregtech.api.enums.Materials;
-
import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.eio.material.MaterialEIO;
+import java.lang.reflect.Field;
+import net.minecraft.item.Item;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
public class HandlerTooltip_EIO {
- private static Item mIngot;
- Class oMainClass;
- Class oIngotClass;
+ private static Item mIngot;
+ Class oMainClass;
+ Class oIngotClass;
- @SubscribeEvent
- public void onItemTooltip(ItemTooltipEvent event){
- //Is EIO loaded?
- if (!disableEnderIOIngotTooltips && LoadedMods.EnderIO){
+ @SubscribeEvent
+ public void onItemTooltip(ItemTooltipEvent event) {
+ // Is EIO loaded?
+ if (!disableEnderIOIngotTooltips && LoadedMods.EnderIO) {
- //Is the EIO Ingot Item null?
- //If it is, reflect in.
- if (mIngot == null){
- try {
- oMainClass = ReflectionUtils.getClass("crazypants.enderio.EnderIO");
- oIngotClass = ReflectionUtils.getClass("crazypants.enderio.material.ItemAlloy");
- if (oMainClass != null && oIngotClass != null){
- Field oAlloyField = ReflectionUtils.getField(oMainClass, "itemAlloy");
- Object oAlloy = oAlloyField.get(oMainClass);
- if (oAlloy != null){
- if (oIngotClass.isInstance(oAlloy) || Item.class.isInstance(oAlloy)){
- mIngot = (Item) oAlloy;
- }
- }
- }
- }
- catch (Throwable e) {
- }
- }
+ // Is the EIO Ingot Item null?
+ // If it is, reflect in.
+ if (mIngot == null) {
+ try {
+ oMainClass = ReflectionUtils.getClass("crazypants.enderio.EnderIO");
+ oIngotClass = ReflectionUtils.getClass("crazypants.enderio.material.ItemAlloy");
+ if (oMainClass != null && oIngotClass != null) {
+ Field oAlloyField = ReflectionUtils.getField(oMainClass, "itemAlloy");
+ Object oAlloy = oAlloyField.get(oMainClass);
+ if (oAlloy != null) {
+ if (oIngotClass.isInstance(oAlloy) || Item.class.isInstance(oAlloy)) {
+ mIngot = (Item) oAlloy;
+ }
+ }
+ }
+ } catch (Throwable e) {
+ }
+ }
- if (mIngot != null){
- //If the Item is an instance of ItemAlloy.class then proceed
- if (event.itemStack.getItem() == mIngot || oIngotClass.isInstance(event.itemStack.getItem()) || event.itemStack.getUnlocalizedName().toLowerCase().contains("item.itemAlloy")){
+ if (mIngot != null) {
+ // If the Item is an instance of ItemAlloy.class then proceed
+ if (event.itemStack.getItem() == mIngot
+ || oIngotClass.isInstance(event.itemStack.getItem())
+ || event.itemStack.getUnlocalizedName().toLowerCase().contains("item.itemAlloy")) {
- //If stacks match, add a tooltip.
- if (mIngot != null){
- if (event.itemStack.getItem() == mIngot){
- if (event.itemStack.getItemDamage() == 0){
- event.toolTip.add(MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula);
- }
- else if (event.itemStack.getItemDamage() == 1){
- event.toolTip.add(MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula);
- }
- else if (event.itemStack.getItemDamage() == 2){
- event.toolTip.add(MaterialEIO.VIBRANT_ALLOY.vChemicalFormula);
- }
- else if (event.itemStack.getItemDamage() == 3){
- event.toolTip.add(MaterialEIO.REDSTONE_ALLOY.vChemicalFormula);
- }
- else if (event.itemStack.getItemDamage() == 4){
- event.toolTip.add(MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula);
- }
- else if (event.itemStack.getItemDamage() == 5){
- event.toolTip.add(MaterialEIO.PULSATING_IRON.vChemicalFormula);
- }
- else if (event.itemStack.getItemDamage() == 6){
- event.toolTip.add(Materials.DarkSteel.mChemicalFormula);
- }
- else if (event.itemStack.getItemDamage() == 7){
- event.toolTip.add(MaterialEIO.SOULARIUM.vChemicalFormula);
- }
- }
- }
- }
- }
- }
- }
+ // If stacks match, add a tooltip.
+ if (mIngot != null) {
+ if (event.itemStack.getItem() == mIngot) {
+ if (event.itemStack.getItemDamage() == 0) {
+ event.toolTip.add(MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula);
+ } else if (event.itemStack.getItemDamage() == 1) {
+ event.toolTip.add(MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula);
+ } else if (event.itemStack.getItemDamage() == 2) {
+ event.toolTip.add(MaterialEIO.VIBRANT_ALLOY.vChemicalFormula);
+ } else if (event.itemStack.getItemDamage() == 3) {
+ event.toolTip.add(MaterialEIO.REDSTONE_ALLOY.vChemicalFormula);
+ } else if (event.itemStack.getItemDamage() == 4) {
+ event.toolTip.add(MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula);
+ } else if (event.itemStack.getItemDamage() == 5) {
+ event.toolTip.add(MaterialEIO.PULSATING_IRON.vChemicalFormula);
+ } else if (event.itemStack.getItemDamage() == 6) {
+ event.toolTip.add(Materials.DarkSteel.mChemicalFormula);
+ } else if (event.itemStack.getItemDamage() == 7) {
+ event.toolTip.add(MaterialEIO.SOULARIUM.vChemicalFormula);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/eio/material/MaterialEIO.java b/src/main/java/gtPlusPlus/xmod/eio/material/MaterialEIO.java
index a5c87342e7..ea72b6312a 100644
--- a/src/main/java/gtPlusPlus/xmod/eio/material/MaterialEIO.java
+++ b/src/main/java/gtPlusPlus/xmod/eio/material/MaterialEIO.java
@@ -5,117 +5,107 @@ import gtPlusPlus.core.material.state.MaterialState;
public class MaterialEIO {
- public static final Material SOULARIUM = new Material(
- "Soularium", //Material Name
- MaterialState.SOLID, //State
- new short[]{95,90,54, 0}, //Material Colour
- 10, //Melting Point in C
- 10,
- 10,
- 10,
- false, //Uses Blast furnace?
- false, //Generates a cell
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().GOLD, 1),
- new MaterialStack(NONMATERIAL.SOULSAND, 1)
- });
-
- public static final Material CONDUCTIVE_IRON = new Material(
- "Conductive Iron", //Material Name
- MaterialState.SOLID, //State
- new short[]{164,109,100, 0}, //Material Colour
- 10, //Melting Point in C
- 10,
- 10,
- 10,
- false, //Uses Blast furnace?
- false, //Generates a cell
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().IRON, 1),
- new MaterialStack(NONMATERIAL.REDSTONE, 1)
- });
-
- public static final Material PULSATING_IRON = new Material(
- "Pulsating Iron", //Material Name
- MaterialState.SOLID, //State
- new short[]{50,91,21, 0}, //Material Colour
- 10, //Melting Point in C
- 10,
- 10,
- 10,
- false, //Uses Blast furnace?
- false, //Generates a cell
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().IRON, 1),
- new MaterialStack(NONMATERIAL.ENDERPEARL, 1)
- });
-
- public static final Material ELECTRICAL_STEEL = new Material(
- "Electrical Steel", //Material Name
- MaterialState.SOLID, //State
- new short[]{194,194,194, 0}, //Material Colour
- 10, //Melting Point in C
- 10,
- 10,
- 10,
- true, //Uses Blast furnace?
- false, //Generates a cell
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ALLOY.STEEL, 3),
- new MaterialStack(ELEMENT.getInstance().SILICON, 1)
- });
-
- public static final Material ENERGETIC_ALLOY = new Material(
- "Energetic Alloy", //Material Name
- MaterialState.SOLID, //State
- new short[]{252,151,45, 0}, //Material Colour
- 10, //Melting Point in C
- 10,
- 10,
- 10,
- true, //Uses Blast furnace?
- false, //Generates a cell
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().GOLD, 1),
- new MaterialStack(NONMATERIAL.REDSTONE, 1),
- new MaterialStack(NONMATERIAL.GLOWSTONE, 1)
- });
-
- public static final Material VIBRANT_ALLOY = new Material(
- "Vibrant Alloy", //Material Name
- MaterialState.SOLID, //State
- new short[]{204,242,142, 0}, //Material Colour
- 10, //Melting Point in C
- 10,
- 10,
- 10,
- true, //Uses Blast furnace?
- false, //Generates a cell
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ENERGETIC_ALLOY, 1),
- new MaterialStack(NONMATERIAL.ENDERPEARL, 1)
- });
-
- public static final Material REDSTONE_ALLOY = new Material(
- "Redstone Alloy", //Material Name
- MaterialState.SOLID, //State
- new short[]{178,34,34, 0}, //Material Colour
- 10, //Melting Point in C
- 10,
- 10,
- 10,
- false, //Uses Blast furnace?
- false, //Generates a cell
- //Material Stacks with Percentage of required elements.
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().SILICON, 1),
- new MaterialStack(NONMATERIAL.REDSTONE, 1)
- });
-
+ public static final Material SOULARIUM = new Material(
+ "Soularium", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {95, 90, 54, 0}, // Material Colour
+ 10, // Melting Point in C
+ 10,
+ 10,
+ 10,
+ false, // Uses Blast furnace?
+ false, // Generates a cell
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().GOLD, 1), new MaterialStack(NONMATERIAL.SOULSAND, 1)
+ });
+
+ public static final Material CONDUCTIVE_IRON = new Material(
+ "Conductive Iron", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {164, 109, 100, 0}, // Material Colour
+ 10, // Melting Point in C
+ 10,
+ 10,
+ 10,
+ false, // Uses Blast furnace?
+ false, // Generates a cell
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().IRON, 1), new MaterialStack(NONMATERIAL.REDSTONE, 1)
+ });
+
+ public static final Material PULSATING_IRON = new Material(
+ "Pulsating Iron", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {50, 91, 21, 0}, // Material Colour
+ 10, // Melting Point in C
+ 10,
+ 10,
+ 10,
+ false, // Uses Blast furnace?
+ false, // Generates a cell
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().IRON, 1), new MaterialStack(NONMATERIAL.ENDERPEARL, 1)
+ });
+
+ public static final Material ELECTRICAL_STEEL = new Material(
+ "Electrical Steel", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {194, 194, 194, 0}, // Material Colour
+ 10, // Melting Point in C
+ 10,
+ 10,
+ 10,
+ true, // Uses Blast furnace?
+ false, // Generates a cell
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {new MaterialStack(ALLOY.STEEL, 3), new MaterialStack(ELEMENT.getInstance().SILICON, 1)
+ });
+
+ public static final Material ENERGETIC_ALLOY = new Material(
+ "Energetic Alloy", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {252, 151, 45, 0}, // Material Colour
+ 10, // Melting Point in C
+ 10,
+ 10,
+ 10,
+ true, // Uses Blast furnace?
+ false, // Generates a cell
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().GOLD, 1),
+ new MaterialStack(NONMATERIAL.REDSTONE, 1),
+ new MaterialStack(NONMATERIAL.GLOWSTONE, 1)
+ });
+
+ public static final Material VIBRANT_ALLOY = new Material(
+ "Vibrant Alloy", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {204, 242, 142, 0}, // Material Colour
+ 10, // Melting Point in C
+ 10,
+ 10,
+ 10,
+ true, // Uses Blast furnace?
+ false, // Generates a cell
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {new MaterialStack(ENERGETIC_ALLOY, 1), new MaterialStack(NONMATERIAL.ENDERPEARL, 1)});
+
+ public static final Material REDSTONE_ALLOY = new Material(
+ "Redstone Alloy", // Material Name
+ MaterialState.SOLID, // State
+ new short[] {178, 34, 34, 0}, // Material Colour
+ 10, // Melting Point in C
+ 10,
+ 10,
+ 10,
+ false, // Uses Blast furnace?
+ false, // Generates a cell
+ // Material Stacks with Percentage of required elements.
+ new MaterialStack[] {
+ new MaterialStack(ELEMENT.getInstance().SILICON, 1), new MaterialStack(NONMATERIAL.REDSTONE, 1)
+ });
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
index 82793aa0d2..493d50490a 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.forestry;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import binnie.extratrees.genetics.ExtraTreeSpecies;
import cpw.mods.fml.common.Optional;
import forestry.api.arboriculture.EnumGermlingType;
@@ -15,94 +12,109 @@ import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry;
import gtPlusPlus.xmod.forestry.bees.recipe.FR_Gregtech_Recipes;
import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntityTreeFarm;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class HANDLER_FR {
- public static void preInit(){
- if (LoadedMods.Forestry){
- FR_ItemRegistry.Register();
- }
- }
-
- public static void Init(){
- if (LoadedMods.Forestry){
- }
- }
-
- public static void postInit(){
- if (LoadedMods.Forestry){
- FR_Gregtech_Recipes.registerItems();
- new GTPP_Bees();
- mapForestrySaplingToLog();
- }
-
- if (LoadedMods.ExtraTrees){
- mapExtraTreesSaplingToLog();
- }
- }
-
- public static boolean createBlockBreakParticles(final World world, final int x, final int y, final int z, final Block block){
- if (LoadedMods.Forestry){
- createBlockBreakParticles_INTERNAL(world, x, y, z, block);
- }
- return false;
- }
-
- @Optional.Method(modid = "Forestry")
- private static void createBlockBreakParticles_INTERNAL(final World world, final int x, final int y, final int z, final Block block){
- if (LoadedMods.Forestry){
- Class oClass;
- try {
- oClass = ReflectionUtils.getClass("forestry.core.proxy.ProxyCommon");
- Object oProxy = ReflectionUtils.getField(oClass, "common");
- if (oProxy != null && oClass.isInstance(oProxy)){
- Method mParticles = ReflectionUtils.getMethod(oClass, "addBlockDestroyEffects", World.class, int.class, int.class, int.class, Block.class, int.class);
- mParticles.invoke(oProxy, world, x, y, z, block, 0);
- }
- }
- catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- }
- }
-
- @Optional.Method(modid = "Forestry")
- private static void mapForestrySaplingToLog() {
- for (TreeDefinition value : TreeDefinition.values()) {
- ItemStack aSaplingStack = value.getMemberStack(EnumGermlingType.SAPLING);
- EnumWoodType woodType = ReflectionUtils.getField(value, "woodType");
- ItemStack aLog;
- if (woodType != null) {
- aLog = TreeManager.woodItemAccess.getLog(woodType, false);
-
- GregtechMetaTileEntityTreeFarm.sLogCache.put(value.getUID(), aLog);
- GregtechMetaTileEntityTreeFarm.sLogCache.put(value.getUID() + "fireproof", TreeManager.woodItemAccess.getLog(woodType, true));
- } else {
- aLog = ReflectionUtils.getField(value, "vanillaWood");
-
- GregtechMetaTileEntityTreeFarm.sLogCache.put(value.getUID(), ReflectionUtils.getField(value, "vanillaWood"));
- }
-
- GregtechMetaTileEntityTreeFarm.addFakeRecipeToNEI(aSaplingStack, aLog);
- }
- }
-
- @Optional.Method(modid = "ExtraTrees")
- private static void mapExtraTreesSaplingToLog() {
- for (ExtraTreeSpecies value : ExtraTreeSpecies.values()) {
- ItemStack aSaplingStack = TreeManager.treeRoot.getMemberStack(TreeManager.treeRoot.templateAsIndividual(value.getTemplate()), 0);
- ItemStack aLog = null;
- if (value.getLog() != null) {
- aLog = value.getLog().getItemStack();
-
- GregtechMetaTileEntityTreeFarm.sLogCache.put(value.getUID(), aLog);
- GregtechMetaTileEntityTreeFarm.sLogCache.put(value.getUID() + "fireproof", aLog);
- }
-
- GregtechMetaTileEntityTreeFarm.addFakeRecipeToNEI(aSaplingStack, aLog);
- }
- }
-
+ public static void preInit() {
+ if (LoadedMods.Forestry) {
+ FR_ItemRegistry.Register();
+ }
+ }
+
+ public static void Init() {
+ if (LoadedMods.Forestry) {}
+ }
+
+ public static void postInit() {
+ if (LoadedMods.Forestry) {
+ FR_Gregtech_Recipes.registerItems();
+ new GTPP_Bees();
+ mapForestrySaplingToLog();
+ }
+
+ if (LoadedMods.ExtraTrees) {
+ mapExtraTreesSaplingToLog();
+ }
+ }
+
+ public static boolean createBlockBreakParticles(
+ final World world, final int x, final int y, final int z, final Block block) {
+ if (LoadedMods.Forestry) {
+ createBlockBreakParticles_INTERNAL(world, x, y, z, block);
+ }
+ return false;
+ }
+
+ @Optional.Method(modid = "Forestry")
+ private static void createBlockBreakParticles_INTERNAL(
+ final World world, final int x, final int y, final int z, final Block block) {
+ if (LoadedMods.Forestry) {
+ Class oClass;
+ try {
+ oClass = ReflectionUtils.getClass("forestry.core.proxy.ProxyCommon");
+ Object oProxy = ReflectionUtils.getField(oClass, "common");
+ if (oProxy != null && oClass.isInstance(oProxy)) {
+ Method mParticles = ReflectionUtils.getMethod(
+ oClass,
+ "addBlockDestroyEffects",
+ World.class,
+ int.class,
+ int.class,
+ int.class,
+ Block.class,
+ int.class);
+ mParticles.invoke(oProxy, world, x, y, z, block, 0);
+ }
+ } catch (SecurityException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ }
+ }
+ }
+
+ @Optional.Method(modid = "Forestry")
+ private static void mapForestrySaplingToLog() {
+ for (TreeDefinition value : TreeDefinition.values()) {
+ ItemStack aSaplingStack = value.getMemberStack(EnumGermlingType.SAPLING);
+ EnumWoodType woodType = ReflectionUtils.getField(value, "woodType");
+ ItemStack aLog;
+ if (woodType != null) {
+ aLog = TreeManager.woodItemAccess.getLog(woodType, false);
+
+ GregtechMetaTileEntityTreeFarm.sLogCache.put(value.getUID(), aLog);
+ GregtechMetaTileEntityTreeFarm.sLogCache.put(
+ value.getUID() + "fireproof", TreeManager.woodItemAccess.getLog(woodType, true));
+ } else {
+ aLog = ReflectionUtils.getField(value, "vanillaWood");
+
+ GregtechMetaTileEntityTreeFarm.sLogCache.put(
+ value.getUID(), ReflectionUtils.getField(value, "vanillaWood"));
+ }
+
+ GregtechMetaTileEntityTreeFarm.addFakeRecipeToNEI(aSaplingStack, aLog);
+ }
+ }
+
+ @Optional.Method(modid = "ExtraTrees")
+ private static void mapExtraTreesSaplingToLog() {
+ for (ExtraTreeSpecies value : ExtraTreeSpecies.values()) {
+ ItemStack aSaplingStack = TreeManager.treeRoot.getMemberStack(
+ TreeManager.treeRoot.templateAsIndividual(value.getTemplate()), 0);
+ ItemStack aLog = null;
+ if (value.getLog() != null) {
+ aLog = value.getLog().getItemStack();
+
+ GregtechMetaTileEntityTreeFarm.sLogCache.put(value.getUID(), aLog);
+ GregtechMetaTileEntityTreeFarm.sLogCache.put(value.getUID() + "fireproof", aLog);
+ }
+
+ GregtechMetaTileEntityTreeFarm.addFakeRecipeToNEI(aSaplingStack, aLog);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/BlockDenseBeeHouse.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/BlockDenseBeeHouse.java
index 77ee15c5d5..ea95479cf7 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/BlockDenseBeeHouse.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/BlockDenseBeeHouse.java
@@ -1,4 +1,3 @@
-
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
@@ -16,9 +15,9 @@ import forestry.core.blocks.BlockBase;
import gtPlusPlus.core.creative.AddToCreativeTab;
public class BlockDenseBeeHouse extends BlockBase<BlockApicultureType> {
- public BlockDenseBeeHouse() {
- super();
- setCreativeTab(AddToCreativeTab.tabBOP);
- setHarvestLevel("axe", 0);
- }
-} \ No newline at end of file
+ public BlockDenseBeeHouse() {
+ super();
+ setCreativeTab(AddToCreativeTab.tabBOP);
+ setHarvestLevel("axe", 0);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/FR_BlockRegistry.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/FR_BlockRegistry.java
index fa36732cb6..02f74b55ae 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/FR_BlockRegistry.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/blocks/FR_BlockRegistry.java
@@ -1,26 +1,24 @@
package gtPlusPlus.xmod.forestry.bees.blocks;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import forestry.core.utils.StringUtil;
+import forestry.plugins.PluginManager;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
-
-import forestry.core.utils.StringUtil;
-import forestry.plugins.PluginManager;
import net.minecraftforge.oredict.OreDictionary;
public abstract class FR_BlockRegistry {
- protected static <T extends Block> T registerBlock(T block, Class<? extends ItemBlock> itemClass, String name) {
- if (PluginManager.getStage() != PluginManager.Stage.SETUP) {
- throw new RuntimeException("Tried to register Block outside of Setup");
- }
- block.setBlockName("for." + name);
- GameRegistry.registerBlock(block, itemClass, StringUtil.cleanBlockName(block));
- return block;
- }
+ protected static <T extends Block> T registerBlock(T block, Class<? extends ItemBlock> itemClass, String name) {
+ if (PluginManager.getStage() != PluginManager.Stage.SETUP) {
+ throw new RuntimeException("Tried to register Block outside of Setup");
+ }
+ block.setBlockName("for." + name);
+ GameRegistry.registerBlock(block, itemClass, StringUtil.cleanBlockName(block));
+ return block;
+ }
- protected static void registerOreDictWildcard(String oreDictName, Block block) {
- OreDictionary.registerOre(oreDictName, new ItemStack(block, 1, 32767));
- }
-} \ No newline at end of file
+ protected static void registerOreDictWildcard(String oreDictName, Block block) {
+ OreDictionary.registerOre(oreDictName, new ItemStack(block, 1, 32767));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java
index b4d6e4c2fc..5423ae803b 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java
@@ -2,53 +2,50 @@ package gtPlusPlus.xmod.forestry.bees.custom;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_LanguageManager;
-
import gtPlusPlus.core.util.Utils;
-public enum CustomCombs {
- //Custom Bees
-
- //Rubbers & Silicons
+public enum CustomCombs {
+ // Custom Bees
+
+ // Rubbers & Silicons
SILICON("silicon", true, Materials.Silicon, 100),
RUBBER("rubber", true, Materials.Rubber, 100),
PLASTIC("polyethylene", true, Materials.Plastic, 75),
PTFE("polytetrafluoroethylene", true, GTPP_Bees.PTFE, 50),
PBS("styrene-butadiene", true, GTPP_Bees.PBS, 25),
-
- //Fuels
+
+ // Fuels
BIOMASS("biomass", true, Materials.Biomass, 100),
ETHANOL("ethanol", true, Materials.Ethanol, 75),
DIESEL("diesel", true, Materials.Fuel, 50),
NITRO("nitro", true, Materials.NitroFuel, 25),
HOOTCH("hootch", true, Materials.Silicon, 50),
ROCKETFUEL("rocket", true, Materials.Silicon, 25),
-
-
- //Materials which are hard, if not impossible to obtain.
+
+ // Materials which are hard, if not impossible to obtain.
FLUORINE("fluorine", true, Materials.Fluorine, 25),
COKE("coke", true, Materials._NULL, 50),
FORCE("force", true, Materials.Force, 50),
- NIKOLITE("nikolite", true, Materials.Nikolite, 75),
+ NIKOLITE("nikolite", true, Materials.Nikolite, 75),
MITHRIL("mithril", true, Materials.Mithril, 10),
ADAMANTIUM("adamantium", true, Materials.Adamantium, 5),
-
- //Trash
+
+ // Trash
SALT("salt", true, Materials.Salt, 75),
- SAND("sand", true, Materials.Sand, 100),
-
+ SAND("sand", true, Materials.Sand, 100),
;
- private static int[][] colours = new int[][]{
- {Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)}, //SILICON
- {Utils.rgbtoHexValue(55, 55, 55), Utils.rgbtoHexValue(75, 75, 75)}, //RUBBER
- {Utils.rgbtoHexValue(245, 245, 245), Utils.rgbtoHexValue(175, 175, 175)}, //PLASTIC
- {Utils.rgbtoHexValue(150, 150, 150), Utils.rgbtoHexValue(75, 75, 75)}, //PTFE
- {Utils.rgbtoHexValue(33, 26, 24), Utils.rgbtoHexValue(23, 16, 14)}, //PBS
- //Unused
- {Utils.rgbtoHexValue(33, 225, 24), Utils.rgbtoHexValue(23, 175, 14)}, //Biofuel
- {Utils.rgbtoHexValue(255, 128, 0), Utils.rgbtoHexValue(220, 156, 32)}, //Ethanol
+ private static int[][] colours = new int[][] {
+ {Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)}, // SILICON
+ {Utils.rgbtoHexValue(55, 55, 55), Utils.rgbtoHexValue(75, 75, 75)}, // RUBBER
+ {Utils.rgbtoHexValue(245, 245, 245), Utils.rgbtoHexValue(175, 175, 175)}, // PLASTIC
+ {Utils.rgbtoHexValue(150, 150, 150), Utils.rgbtoHexValue(75, 75, 75)}, // PTFE
+ {Utils.rgbtoHexValue(33, 26, 24), Utils.rgbtoHexValue(23, 16, 14)}, // PBS
+ // Unused
+ {Utils.rgbtoHexValue(33, 225, 24), Utils.rgbtoHexValue(23, 175, 14)}, // Biofuel
+ {Utils.rgbtoHexValue(255, 128, 0), Utils.rgbtoHexValue(220, 156, 32)}, // Ethanol
+ {Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)}, //
{Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)}, //
- {Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)}, //
{Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)}, //
{Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)}, //
{Utils.rgbtoHexValue(30, 230, 230), Utils.rgbtoHexValue(10, 150, 150)}, // Fluorine
@@ -60,43 +57,44 @@ public enum CustomCombs {
{Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)}, //
{Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)}, //
{Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)},
- {0x666666, 0x525252},
- {0x2E8F5B, 0xDCC289},
- {0x4C4C4C, 0x333333},
- {0x808080, 0x999999},
- {0x57CFFB, 0xBBEEFF},
- {0x7D0F0F, 0xD11919},
- {0x1947D1, 0x476CDA},
- {0xE6005C, 0xCC0052},
- {0x0033CC, 0x00248F},
- {0xCCFFFF, 0xA3CCCC},
- {0x248F24, 0xCCFFCC},
- {0x248F24, 0x2EB82E},
- {0xD4D4D4, 0x58300B},
- {0xFF6600, 0xE65C00},
- {0xD4D4D4, 0xDDDDDD},
- {0x666699, 0xA3A3CC},
- {0xDA9147, 0xDE9C59},
- {0x808080, 0x999999},
- {0x8585AD, 0x9D9DBD},
- {0xF0DEF0, 0xF2E1F2},
- {0xC2C2D6, 0xCECEDE},
- {0xE6B800, 0xCFA600},
- {0x008AB8, 0xD6D6FF},
- {0xD5D5D5, 0xAAAAAA},
- {0xCC99FF, 0xDBB8FF},
- {0xEBA1EB, 0xF2C3F2},
- {0x62626D, 0x161620},
- {0xE6E6E6, 0xFFFFCC},
- {0xDADADA, 0xD1D1E0},
- {0x19AF19, 0x169E16},
- {0x335C33, 0x6B8F00},
- {0x003300, 0x002400},
+ {0x666666, 0x525252},
+ {0x2E8F5B, 0xDCC289},
+ {0x4C4C4C, 0x333333},
+ {0x808080, 0x999999},
+ {0x57CFFB, 0xBBEEFF},
+ {0x7D0F0F, 0xD11919},
+ {0x1947D1, 0x476CDA},
+ {0xE6005C, 0xCC0052},
+ {0x0033CC, 0x00248F},
+ {0xCCFFFF, 0xA3CCCC},
+ {0x248F24, 0xCCFFCC},
+ {0x248F24, 0x2EB82E},
+ {0xD4D4D4, 0x58300B},
+ {0xFF6600, 0xE65C00},
+ {0xD4D4D4, 0xDDDDDD},
+ {0x666699, 0xA3A3CC},
+ {0xDA9147, 0xDE9C59},
+ {0x808080, 0x999999},
+ {0x8585AD, 0x9D9DBD},
+ {0xF0DEF0, 0xF2E1F2},
+ {0xC2C2D6, 0xCECEDE},
+ {0xE6B800, 0xCFA600},
+ {0x008AB8, 0xD6D6FF},
+ {0xD5D5D5, 0xAAAAAA},
+ {0xCC99FF, 0xDBB8FF},
+ {0xEBA1EB, 0xF2C3F2},
+ {0x62626D, 0x161620},
+ {0xE6E6E6, 0xFFFFCC},
+ {0xDADADA, 0xD1D1E0},
+ {0x19AF19, 0x169E16},
+ {0x335C33, 0x6B8F00},
+ {0x003300, 0x002400},
};
public boolean showInList;
public Materials material;
public int chance;
private String name;
+
private CustomCombs(String pName, boolean show, Materials material, int chance) {
this.name = pName;
this.material = material;
@@ -109,11 +107,12 @@ public enum CustomCombs {
}
public String getName() {
-// return "gt.comb."+this.name;
- return GT_LanguageManager.addStringLocalization("comb." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Comb");
+ // return "gt.comb."+this.name;
+ return GT_LanguageManager.addStringLocalization(
+ "comb." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Comb");
}
public int[] getColours() {
return colours[this.ordinal()];
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java
index b36508f6aa..633178c851 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java
@@ -1,14 +1,5 @@
package gtPlusPlus.xmod.forestry.bees.custom;
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Locale;
-
-import org.apache.commons.lang3.reflect.FieldUtils;
-import org.apache.commons.lang3.text.WordUtils;
-
-import net.minecraft.item.ItemStack;
-
import forestry.api.apiculture.*;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
@@ -17,389 +8,28 @@ import forestry.api.genetics.IAllele;
import forestry.apiculture.genetics.*;
import forestry.core.genetics.alleles.AlleleHelper;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.Locale;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.common.BiomeDictionary.Type;
+import org.apache.commons.lang3.reflect.FieldUtils;
+import org.apache.commons.lang3.text.WordUtils;
public enum GTPP_Bee_Definition implements IBeeDefinition {
-
-
- SILICON(GTPP_Branch_Definition.ORGANIC, "Silicon", true, Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(getSlagComb(), 0.10f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SILICON), 0.20f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getGregtechBeeType("SLIMEBALL"), getGregtechBeeType("STICKYRESIN"), 10);
- }
- },
-
- RUBBER(GTPP_Branch_Definition.ORGANIC, "Rubber", true, Utils.rgbtoHexValue(55, 55, 55), Utils.rgbtoHexValue(75, 75, 75)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(getSlagComb(), 0.10f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.RUBBER), 0.30f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getGregtechBeeType("SLIMEBALL"), getGregtechBeeType("STICKYRESIN"), 10);
- }
- },
-
- PLASTIC(GTPP_Branch_Definition.ORGANIC, "Plastic", true, Utils.rgbtoHexValue(245, 245, 245), Utils.rgbtoHexValue(175, 175, 175)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(getStoneComb(), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.PLASTIC), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(RUBBER.species, getGregtechBeeType("OIL"), 10);
- }
- },
-
- PTFE(GTPP_Branch_Definition.ORGANIC, "Ptfe", true, Utils.rgbtoHexValue(150, 150, 150), Utils.rgbtoHexValue(75, 75, 75)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(getStoneComb(), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.PTFE), 0.10f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(RUBBER.species, PLASTIC.species, 10);
- }
- },
-
- PBS(GTPP_Branch_Definition.ORGANIC, "Pbs", true, Utils.rgbtoHexValue(33, 26, 24), Utils.rgbtoHexValue(23, 16, 14)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(getStoneComb(), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.PBS), 0.10f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(PTFE.species, PLASTIC.species, 10);
- }
- },
-
-
-
-
- /**
- * Fuels
- */
-
- BIOMASS(GTPP_Branch_Definition.ORGANIC, "Biomass", true, Utils.rgbtoHexValue(33, 225, 24), Utils.rgbtoHexValue(23, 175, 14)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SAND), 0.40f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.BIOMASS), 0.20f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getSpecies("Industrious"), getSpecies("Rural"), 10);
- tMutation.restrictBiomeType(Type.FOREST);
- }
- },
-
- ETHANOL(GTPP_Branch_Definition.ORGANIC, "Ethanol", true, Utils.rgbtoHexValue(255, 128, 0), Utils.rgbtoHexValue(220, 156, 32)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SAND), 0.40f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.ETHANOL), 0.20f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(BIOMASS.species, getSpecies("Farmerly"), 5);
- tMutation.restrictBiomeType(Type.FOREST);
- }
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /**
- * Materials
- */
-
-
- FLUORINE(GTPP_Branch_Definition.ORGANIC, "Fluorine", true, Utils.rgbtoHexValue(30, 230, 230), Utils.rgbtoHexValue(10, 150, 150)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(getStoneComb(), 0.40f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.FLUORINE), 0.05f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.COLD);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getGregtechBeeType("LAPIS"), getGregtechBeeType("SAPPHIRE"), 5);
- tMutation.restrictBiomeType(Type.COLD);
- }
- },
-
- //Coke
-
-
-
- //Force
- FORCE(GTPP_Branch_Definition.METAL, "Force", true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(getStoneComb(), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SAND), 0.25f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.FORCE), 0.25f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SALT), 0.05f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.HOT);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getGregtechBeeType("STEEL"), getGregtechBeeType("GOLD"), 10);
- tMutation.restrictBiomeType(Type.HOT);
- }
- },
-
- //Nikolite
- NIKOLITE(GTPP_Branch_Definition.METAL, "Nikolite", true, Utils.rgbtoHexValue(60, 180, 200), Utils.rgbtoHexValue(40, 150, 170)) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(getStoneComb(), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.NIKOLITE), 0.05f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.HOT);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getGregtechBeeType("ALUMINIUM"), getGregtechBeeType("SILVER"), 8);
- tMutation.restrictBiomeType(Type.HOT);
- }
- },
-
-
-
-
-
-
-
- /*
-
-
- CLAY(GTPP_Branch_Definition.ORGANIC, "Clay", true, 0x19d0ec, 0xffdc16) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f);
- beeSpecies.addProduct(new ItemStack(Items.clay_ball, 1), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.DAMP);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.MEADOWS.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getSpecies("Industrious"), getSpecies("Diligent"), 20);
- }
- },
- SLIMEBALL(GTPP_Branch_Definition.ORGANIC, "SlimeBall", true, 0x4E9E55, 0x00FF15) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 15), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STICKY), 0.30f);
- beeSpecies.setHumidity(EnumHumidity.DAMP);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.MARSHY.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getSpecies("Marshy"), CLAY.species, 15);
- }
- },
- PEAT(GTPP_Branch_Definition.ORGANIC, "Peat", true, 0x906237, 0x58300B) {
+ SILICON(
+ GTPP_Branch_Definition.ORGANIC,
+ "Silicon",
+ true,
+ Utils.rgbtoHexValue(75, 75, 75),
+ Utils.rgbtoHexValue(125, 125, 125)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.LIGNIE), 0.30f);
- beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.RURAL.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getSpecies("Rural"), CLAY.species, 20);
- }
- },
- STICKYRESIN(GTPP_Branch_Definition.ORGANIC, "StickyResin", true, 0x2E8F5B, 0xDCC289) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f);
- beeSpecies.addProduct(ItemList.IC2_Resin.get(1, new Object[0]), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.MEADOWS.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(SLIMEBALL.species, PEAT.species, 25);
- }
- },
- COAL(GTPP_Branch_Definition.ORGANIC, "Coal", true, 0x666666, 0x525252) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.LIGNIE), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.COAL), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.AUSTERE.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getSpecies("Industrious"), PEAT.species, 18);
- }
- },
- OIL(GTPP_Branch_Definition.ORGANIC, "Oil", true, 0x4C4C4C, 0x333333) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.OIL), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.DAMP);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- beeSpecies.setNocturnal();
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.MEADOWS.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(COAL.species, STICKYRESIN.species, 8);
- }
- },
- REDSTONE(GTPP_Branch_Definition.GEM, "Redstone", true, 0x7D0F0F, 0xD11919) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.REDSTONE), 0.15f);
+ beeSpecies.addProduct(getSlagComb(), 0.10f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SILICON), 0.20f);
beeSpecies.setHumidity(EnumHumidity.NORMAL);
beeSpecies.setTemperature(EnumTemperature.NORMAL);
}
@@ -411,33 +41,21 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getSpecies("Industrious"), getSpecies("Demonic"), 20);
+ IBeeMutationCustom tMutation =
+ registerMutation(getGregtechBeeType("SLIMEBALL"), getGregtechBeeType("STICKYRESIN"), 10);
}
},
- LAPIS(GTPP_Branch_Definition.GEM, "Lapis", true, 0x1947D1, 0x476CDA) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.LAPIS), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getSpecies("Demonic"), getSpecies("Imperial"), 20);
- }
- },
- CERTUS(GTPP_Branch_Definition.GEM, "CertusQuartz", true, 0x57CFFB, 0xBBEEFF) {
+ RUBBER(
+ GTPP_Branch_Definition.ORGANIC,
+ "Rubber",
+ true,
+ Utils.rgbtoHexValue(55, 55, 55),
+ Utils.rgbtoHexValue(75, 75, 75)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.CERTUS), 0.15f);
+ beeSpecies.addProduct(getSlagComb(), 0.10f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.RUBBER), 0.30f);
beeSpecies.setHumidity(EnumHumidity.NORMAL);
beeSpecies.setTemperature(EnumTemperature.NORMAL);
}
@@ -449,33 +67,21 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getSpecies("Hermitic"), LAPIS.species, 20);
+ IBeeMutationCustom tMutation =
+ registerMutation(getGregtechBeeType("SLIMEBALL"), getGregtechBeeType("STICKYRESIN"), 10);
}
},
- RUBY(GTPP_Branch_Definition.GEM, "Ruby", true, 0xE6005C, 0xCC0052) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.RUBY), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, DIAMOND.species, 10);
- }
- },
- SAPPHIRE(GTPP_Branch_Definition.GEM, "Sapphire", true, 0x0033CC, 0x00248F) {
+ PLASTIC(
+ GTPP_Branch_Definition.ORGANIC,
+ "Plastic",
+ true,
+ Utils.rgbtoHexValue(245, 245, 245),
+ Utils.rgbtoHexValue(175, 175, 175)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SAPPHIRE), 0.15f);
+ beeSpecies.addProduct(getStoneComb(), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.PLASTIC), 0.15f);
beeSpecies.setHumidity(EnumHumidity.NORMAL);
beeSpecies.setTemperature(EnumTemperature.NORMAL);
}
@@ -487,33 +93,20 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(CERTUS.species, LAPIS.species, 10);
+ IBeeMutationCustom tMutation = registerMutation(RUBBER.species, getGregtechBeeType("OIL"), 10);
}
},
- DIAMOND(GTPP_Branch_Definition.GEM, "Diamond", true, 0xCCFFFF, 0xA3CCCC) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.DIAMOND), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(CERTUS.species, COAL.species, 6);
- }
- },
- OLIVINE(GTPP_Branch_Definition.GEM, "Olivine", true, 0x248F24, 0xCCFFCC) {
+ PTFE(
+ GTPP_Branch_Definition.ORGANIC,
+ "Ptfe",
+ true,
+ Utils.rgbtoHexValue(150, 150, 150),
+ Utils.rgbtoHexValue(75, 75, 75)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.OLIVINE), 0.15f);
+ beeSpecies.addProduct(getStoneComb(), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.PTFE), 0.10f);
beeSpecies.setHumidity(EnumHumidity.NORMAL);
beeSpecies.setTemperature(EnumTemperature.NORMAL);
}
@@ -525,33 +118,15 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(CERTUS.species, getSpecies("Ended"), 10);
+ IBeeMutationCustom tMutation = registerMutation(RUBBER.species, PLASTIC.species, 10);
}
},
- EMERALD(GTPP_Branch_Definition.GEM, "Emerald", true, 0x248F24, 0x2EB82E) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.EMERALD), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.COLD);
- }
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(OLIVINE.species, DIAMOND.species, 8);
- }
- },
- COPPER(GTPP_Branch_Definition.METAL, "Copper", true, 0xFF6600, 0xE65C00) {
+ PBS(GTPP_Branch_Definition.ORGANIC, "Pbs", true, Utils.rgbtoHexValue(33, 26, 24), Utils.rgbtoHexValue(23, 16, 14)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.COPPER), 0.15f);
+ beeSpecies.addProduct(getStoneComb(), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.PBS), 0.10f);
beeSpecies.setHumidity(EnumHumidity.NORMAL);
beeSpecies.setTemperature(EnumTemperature.NORMAL);
}
@@ -563,14 +138,23 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(getSpecies("Majestic"), CLAY.species, 25);
+ IBeeMutationCustom tMutation = registerMutation(PTFE.species, PLASTIC.species, 10);
}
},
- TIN(GTPP_Branch_Definition.METAL, "Tin", true, 0xD4D4D4, 0xDDDDDD) {
+
+ /**
+ * Fuels
+ */
+ BIOMASS(
+ GTPP_Branch_Definition.ORGANIC,
+ "Biomass",
+ true,
+ Utils.rgbtoHexValue(33, 225, 24),
+ Utils.rgbtoHexValue(23, 175, 14)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.TIN), 0.15f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SAND), 0.40f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.BIOMASS), 0.20f);
beeSpecies.setHumidity(EnumHumidity.NORMAL);
beeSpecies.setTemperature(EnumTemperature.NORMAL);
}
@@ -582,33 +166,21 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(CLAY.species, getSpecies("Diligent"), 25);
+ IBeeMutationCustom tMutation = registerMutation(getSpecies("Industrious"), getSpecies("Rural"), 10);
+ tMutation.restrictBiomeType(Type.FOREST);
}
},
- LEAD(GTPP_Branch_Definition.METAL, "Lead", true, 0x666699, 0xA3A3CC) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.LEAD), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.DAMP);
- beeSpecies.setTemperature(EnumTemperature.WARM);
- }
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(COAL.species, COPPER.species, 25);
- }
- },
- IRON(GTPP_Branch_Definition.METAL, "Iron", true, 0xDA9147, 0xDE9C59) {
+ ETHANOL(
+ GTPP_Branch_Definition.ORGANIC,
+ "Ethanol",
+ true,
+ Utils.rgbtoHexValue(255, 128, 0),
+ Utils.rgbtoHexValue(220, 156, 32)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.IRON), 0.15f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SAND), 0.40f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.ETHANOL), 0.20f);
beeSpecies.setHumidity(EnumHumidity.NORMAL);
beeSpecies.setTemperature(EnumTemperature.NORMAL);
}
@@ -620,35 +192,26 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(TIN.species, COPPER.species, 25);
+ IBeeMutationCustom tMutation = registerMutation(BIOMASS.species, getSpecies("Farmerly"), 5);
+ tMutation.restrictBiomeType(Type.FOREST);
}
},
- STEEL(GTPP_Branch_Definition.METAL, "Steel", true, 0x808080, 0x999999) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STEEL), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
-
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(IRON.species, COAL.species, 20);
- }
- },
- NICKEL(GTPP_Branch_Definition.METAL, "Nickel", true, 0x8585AD, 0x8585AD) {
+ /**
+ * Materials
+ */
+ FLUORINE(
+ GTPP_Branch_Definition.ORGANIC,
+ "Fluorine",
+ true,
+ Utils.rgbtoHexValue(30, 230, 230),
+ Utils.rgbtoHexValue(10, 150, 150)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.NICKEL), 0.15f);
+ beeSpecies.addProduct(getStoneComb(), 0.40f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.FLUORINE), 0.05f);
beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.COLD);
}
@Override
@@ -658,35 +221,29 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(IRON.species, COPPER.species, 25);
+ IBeeMutationCustom tMutation =
+ registerMutation(getGregtechBeeType("LAPIS"), getGregtechBeeType("SAPPHIRE"), 5);
+ tMutation.restrictBiomeType(Type.COLD);
}
},
- ZINC(GTPP_Branch_Definition.METAL, "Zinc", true, 0xF0DEF0, 0xF2E1F2) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.ZINC), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
+ // Coke
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(IRON.species, TIN.species, 20);
- }
- },
- SILVER(GTPP_Branch_Definition.METAL, "Silver", true, 0xC2C2D6, 0xCECEDE) {
+ // Force
+ FORCE(
+ GTPP_Branch_Definition.METAL,
+ "Force",
+ true,
+ Utils.rgbtoHexValue(250, 250, 20),
+ Utils.rgbtoHexValue(200, 200, 5)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SILVER), 0.15f);
+ beeSpecies.addProduct(getStoneComb(), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SAND), 0.25f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.FORCE), 0.25f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SALT), 0.05f);
beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.HOT);
}
@Override
@@ -696,34 +253,24 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(LEAD.species, TIN.species, 20);
+ IBeeMutationCustom tMutation =
+ registerMutation(getGregtechBeeType("STEEL"), getGregtechBeeType("GOLD"), 10);
+ tMutation.restrictBiomeType(Type.HOT);
}
},
- GOLD(GTPP_Branch_Definition.METAL, "Gold", true, 0xEBC633, 0xEDCC47) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.GOLD), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.NORMAL);
- beeSpecies.setTemperature(EnumTemperature.NORMAL);
- }
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(LEAD.species, COPPER.species, 20);
- }
- },
- ALUMINIUM(GTPP_Branch_Definition.RAREMETAL, "Aluminium", true, 0xB8B8FF, 0xD6D6FF) {
+ // Nikolite
+ NIKOLITE(
+ GTPP_Branch_Definition.METAL,
+ "Nikolite",
+ true,
+ Utils.rgbtoHexValue(60, 180, 200),
+ Utils.rgbtoHexValue(40, 150, 170)) {
@Override
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.ALUMINIUM), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.ARID);
+ beeSpecies.addProduct(getStoneComb(), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.NIKOLITE), 0.05f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
beeSpecies.setTemperature(EnumTemperature.HOT);
}
@@ -734,143 +281,608 @@ public enum GTPP_Bee_Definition implements IBeeDefinition {
@Override
protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(NICKEL.species, ZINC.species, 18);
+ IBeeMutationCustom tMutation =
+ registerMutation(getGregtechBeeType("ALUMINIUM"), getGregtechBeeType("SILVER"), 8);
+ tMutation.restrictBiomeType(Type.HOT);
}
},
- TITANIUM(GTPP_Branch_Definition.RAREMETAL, "Titanium", true, 0xCC99FF, 0xDBB8FF) {
- @Override
- protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
- beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.TITANIUM), 0.15f);
- beeSpecies.setHumidity(EnumHumidity.ARID);
- beeSpecies.setTemperature(EnumTemperature.HOT);
- }
- @Override
- protected void setAlleles(IAllele[] template) {
- template = BeeDefinition.COMMON.getTemplate();
- }
-
- @Override
- protected void registerMutations() {
- IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, ALUMINIUM.species, 5);
+/*
+
+
+CLAY(GTPP_Branch_Definition.ORGANIC, "Clay", true, 0x19d0ec, 0xffdc16) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f);
+ beeSpecies.addProduct(new ItemStack(Items.clay_ball, 1), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.DAMP);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.MEADOWS.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(getSpecies("Industrious"), getSpecies("Diligent"), 20);
+ }
+ },
+ SLIMEBALL(GTPP_Branch_Definition.ORGANIC, "SlimeBall", true, 0x4E9E55, 0x00FF15) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 15), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STICKY), 0.30f);
+ beeSpecies.setHumidity(EnumHumidity.DAMP);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.MARSHY.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(getSpecies("Marshy"), CLAY.species, 15);
+ }
+ },
+ PEAT(GTPP_Branch_Definition.ORGANIC, "Peat", true, 0x906237, 0x58300B) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.LIGNIE), 0.30f);
+ beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.RURAL.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(getSpecies("Rural"), CLAY.species, 20);
+ }
+ },
+ STICKYRESIN(GTPP_Branch_Definition.ORGANIC, "StickyResin", true, 0x2E8F5B, 0xDCC289) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f);
+ beeSpecies.addProduct(ItemList.IC2_Resin.get(1, new Object[0]), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.MEADOWS.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(SLIMEBALL.species, PEAT.species, 25);
+ }
+ },
+ COAL(GTPP_Branch_Definition.ORGANIC, "Coal", true, 0x666666, 0x525252) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.LIGNIE), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.COAL), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.AUSTERE.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(getSpecies("Industrious"), PEAT.species, 18);
+ }
+ },
+ OIL(GTPP_Branch_Definition.ORGANIC, "Oil", true, 0x4C4C4C, 0x333333) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 0), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.OIL), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.DAMP);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ beeSpecies.setNocturnal();
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.MEADOWS.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(COAL.species, STICKYRESIN.species, 8);
+ }
+ },
+ REDSTONE(GTPP_Branch_Definition.GEM, "Redstone", true, 0x7D0F0F, 0xD11919) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.REDSTONE), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(getSpecies("Industrious"), getSpecies("Demonic"), 20);
+ }
+ },
+ LAPIS(GTPP_Branch_Definition.GEM, "Lapis", true, 0x1947D1, 0x476CDA) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.LAPIS), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(getSpecies("Demonic"), getSpecies("Imperial"), 20);
+ }
+ },
+ CERTUS(GTPP_Branch_Definition.GEM, "CertusQuartz", true, 0x57CFFB, 0xBBEEFF) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.CERTUS), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(getSpecies("Hermitic"), LAPIS.species, 20);
+ }
+ },
+ RUBY(GTPP_Branch_Definition.GEM, "Ruby", true, 0xE6005C, 0xCC0052) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.RUBY), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, DIAMOND.species, 10);
+ }
+ },
+ SAPPHIRE(GTPP_Branch_Definition.GEM, "Sapphire", true, 0x0033CC, 0x00248F) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SAPPHIRE), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(CERTUS.species, LAPIS.species, 10);
+ }
+ },
+ DIAMOND(GTPP_Branch_Definition.GEM, "Diamond", true, 0xCCFFFF, 0xA3CCCC) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.DIAMOND), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(CERTUS.species, COAL.species, 6);
+ }
+ },
+ OLIVINE(GTPP_Branch_Definition.GEM, "Olivine", true, 0x248F24, 0xCCFFCC) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.OLIVINE), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(CERTUS.species, getSpecies("Ended"), 10);
+ }
+ },
+ EMERALD(GTPP_Branch_Definition.GEM, "Emerald", true, 0x248F24, 0x2EB82E) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STONE), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.EMERALD), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.COLD);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(OLIVINE.species, DIAMOND.species, 8);
+ }
+ },
+ COPPER(GTPP_Branch_Definition.METAL, "Copper", true, 0xFF6600, 0xE65C00) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.COPPER), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(getSpecies("Majestic"), CLAY.species, 25);
+ }
+ },
+ TIN(GTPP_Branch_Definition.METAL, "Tin", true, 0xD4D4D4, 0xDDDDDD) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.TIN), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(CLAY.species, getSpecies("Diligent"), 25);
+ }
+ },
+ LEAD(GTPP_Branch_Definition.METAL, "Lead", true, 0x666699, 0xA3A3CC) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.LEAD), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.DAMP);
+ beeSpecies.setTemperature(EnumTemperature.WARM);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(COAL.species, COPPER.species, 25);
+ }
+ },
+ IRON(GTPP_Branch_Definition.METAL, "Iron", true, 0xDA9147, 0xDE9C59) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.IRON), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(TIN.species, COPPER.species, 25);
+ }
+ },
+ STEEL(GTPP_Branch_Definition.METAL, "Steel", true, 0x808080, 0x999999) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.STEEL), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(IRON.species, COAL.species, 20);
+ }
+ },
+ NICKEL(GTPP_Branch_Definition.METAL, "Nickel", true, 0x8585AD, 0x8585AD) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.NICKEL), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(IRON.species, COPPER.species, 25);
+ }
+ },
+ ZINC(GTPP_Branch_Definition.METAL, "Zinc", true, 0xF0DEF0, 0xF2E1F2) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.ZINC), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(IRON.species, TIN.species, 20);
+ }
+ },
+ SILVER(GTPP_Branch_Definition.METAL, "Silver", true, 0xC2C2D6, 0xCECEDE) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SILVER), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(LEAD.species, TIN.species, 20);
+ }
+ },
+ GOLD(GTPP_Branch_Definition.METAL, "Gold", true, 0xEBC633, 0xEDCC47) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.GOLD), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.NORMAL);
+ beeSpecies.setTemperature(EnumTemperature.NORMAL);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(LEAD.species, COPPER.species, 20);
+ }
+ },
+ ALUMINIUM(GTPP_Branch_Definition.RAREMETAL, "Aluminium", true, 0xB8B8FF, 0xD6D6FF) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.ALUMINIUM), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.ARID);
+ beeSpecies.setTemperature(EnumTemperature.HOT);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(NICKEL.species, ZINC.species, 18);
+ }
+ },
+ TITANIUM(GTPP_Branch_Definition.RAREMETAL, "Titanium", true, 0xCC99FF, 0xDBB8FF) {
+ @Override
+ protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.SLAG), 0.30f);
+ beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CustomCombs.TITANIUM), 0.15f);
+ beeSpecies.setHumidity(EnumHumidity.ARID);
+ beeSpecies.setTemperature(EnumTemperature.HOT);
+ }
+
+ @Override
+ protected void setAlleles(IAllele[] template) {
+ template = BeeDefinition.COMMON.getTemplate();
+ }
+
+ @Override
+ protected void registerMutations() {
+ IBeeMutationCustom tMutation = registerMutation(REDSTONE.species, ALUMINIUM.species, 5);
+ }
+ }*/
+
+;
+
+ private final GTPP_Branch_Definition branch;
+ private final IAlleleBeeSpeciesCustom species;
+
+ private IAllele[] template;
+ private IBeeGenome genome;
+
+ GTPP_Bee_Definition(GTPP_Branch_Definition branch, String binomial, boolean dominant, int primary, int secondary) {
+ String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH);
+ String species = "species" + WordUtils.capitalize(lowercaseName);
+
+ String uid = "forestry." + species;
+ String description = "for.description." + species;
+ String name = "for.bees.species." + lowercaseName;
+
+ this.branch = branch;
+ this.species = BeeManager.beeFactory.createSpecies(
+ uid, dominant, "Sengir", name, description, branch.getBranch(), binomial, primary, secondary);
+ }
+
+ public static void initBees() {
+ for (GTPP_Bee_Definition bee : values()) {
+ bee.init();
+ }
+ for (GTPP_Bee_Definition bee : values()) {
+ bee.registerMutations();
+ }
+ }
+
+ private static IAlleleBeeSpecies getSpecies(String name) {
+ return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(
+ (new StringBuilder()).append("forestry.species").append(name).toString());
+ }
+
+ protected abstract void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies);
+
+ protected abstract void setAlleles(IAllele[] template);
+
+ protected abstract void registerMutations();
+
+ private void init() {
+ setSpeciesProperties(species);
+
+ template = branch.getTemplate();
+ AlleleHelper.instance.set(template, EnumBeeChromosome.SPECIES, species);
+ setAlleles(template);
+
+ genome = BeeManager.beeRoot.templateAsGenome(template);
+
+ BeeManager.beeRoot.registerTemplate(template);
+ }
+
+ protected final IBeeMutationCustom registerMutation(
+ IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance) {
+ IAllele[] template = getTemplate();
+ Logger.DEBUG_BEES("parent1: " + (parent1 != null));
+ Logger.DEBUG_BEES("parent2: " + (parent2 != null));
+ Logger.DEBUG_BEES("chance: " + (chance));
+ Logger.DEBUG_BEES("template: " + (template != null));
+ return BeeManager.beeMutationFactory.createMutation(parent1, parent2, template, chance);
+ }
+
+ @Override
+ public final IAllele[] getTemplate() {
+ return Arrays.copyOf(template, template.length);
+ }
+
+ @Override
+ public final IBeeGenome getGenome() {
+ return genome;
+ }
+
+ @Override
+ public final IBee getIndividual() {
+ return new Bee(genome);
+ }
+
+ @Override
+ public final ItemStack getMemberStack(EnumBeeType beeType) {
+ IBee bee = getIndividual();
+ return BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal());
+ }
+
+ public final IBeeDefinition getRainResist() {
+ return new BeeVariation.RainResist(this);
+ }
+
+ private static ItemStack getSlagComb() {
+ return issStackValid(ItemUtils.getSimpleStack(GTPP_Bees.Comb_Slag, 1));
+ }
+
+ private static ItemStack getStoneComb() {
+ return issStackValid(ItemUtils.getSimpleStack(GTPP_Bees.Comb_Stone, 1));
+ }
+
+ private static ItemStack issStackValid(ItemStack result) {
+ if (result == null) {
+ return ItemUtils.getErrorStack(1);
}
- }*/
-
- ;
-
-
- private final GTPP_Branch_Definition branch;
- private final IAlleleBeeSpeciesCustom species;
-
- private IAllele[] template;
- private IBeeGenome genome;
-
- GTPP_Bee_Definition(GTPP_Branch_Definition branch, String binomial, boolean dominant, int primary, int secondary) {
- String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH);
- String species = "species" + WordUtils.capitalize(lowercaseName);
-
- String uid = "forestry." + species;
- String description = "for.description." + species;
- String name = "for.bees.species." + lowercaseName;
-
- this.branch = branch;
- this.species = BeeManager.beeFactory.createSpecies(uid, dominant, "Sengir", name, description, branch.getBranch(), binomial, primary, secondary);
- }
-
- public static void initBees() {
- for (GTPP_Bee_Definition bee : values()) {
- bee.init();
- }
- for (GTPP_Bee_Definition bee : values()) {
- bee.registerMutations();
- }
- }
-
- private static IAlleleBeeSpecies getSpecies(String name) {
- return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("forestry.species").append(name).toString());
- }
-
- protected abstract void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies);
-
- protected abstract void setAlleles(IAllele[] template);
-
- protected abstract void registerMutations();
-
- private void init() {
- setSpeciesProperties(species);
-
- template = branch.getTemplate();
- AlleleHelper.instance.set(template, EnumBeeChromosome.SPECIES, species);
- setAlleles(template);
-
- genome = BeeManager.beeRoot.templateAsGenome(template);
-
- BeeManager.beeRoot.registerTemplate(template);
- }
-
- protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance) {
- IAllele[] template = getTemplate();
- Logger.DEBUG_BEES("parent1: "+(parent1 != null));
- Logger.DEBUG_BEES("parent2: "+(parent2 != null));
- Logger.DEBUG_BEES("chance: "+(chance));
- Logger.DEBUG_BEES("template: "+(template != null));
- return BeeManager.beeMutationFactory.createMutation(parent1, parent2, template, chance);
- }
-
- @Override
- public final IAllele[] getTemplate() {
- return Arrays.copyOf(template, template.length);
- }
-
- @Override
- public final IBeeGenome getGenome() {
- return genome;
- }
-
- @Override
- public final IBee getIndividual() {
- return new Bee(genome);
- }
-
- @Override
- public final ItemStack getMemberStack(EnumBeeType beeType) {
- IBee bee = getIndividual();
- return BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal());
- }
-
- public final IBeeDefinition getRainResist() {
- return new BeeVariation.RainResist(this);
- }
-
- private static ItemStack getSlagComb(){
- return issStackValid(ItemUtils.getSimpleStack(GTPP_Bees.Comb_Slag, 1));
- }
- private static ItemStack getStoneComb(){
- return issStackValid(ItemUtils.getSimpleStack(GTPP_Bees.Comb_Stone, 1));
- }
-
- private static ItemStack issStackValid(ItemStack result){
- if (result == null){
- return ItemUtils.getErrorStack(1);
- }
- return result;
- }
-
- public static IAlleleBeeSpecies getGregtechBeeType(String name){
- Class<?> gtBees;
- try {
- Class gtBeeTypes = Class.forName("gregtech.loaders.misc.GT_BeeDefinition");
- Enum gtBeeEnumObject = Enum.valueOf(gtBeeTypes, name);
- Field gtBeesField = FieldUtils.getDeclaredField(gtBeeTypes, "species", true);
- gtBeesField.setAccessible(true);
- ReflectionUtils.makeFieldAccessible(gtBeesField);
- Object beeType = gtBeesField.get(gtBeeEnumObject);
- return (IAlleleBeeSpecies) beeType;
- }
- catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) {
- e.printStackTrace();
- }
- return null;
- }
+ return result;
+ }
+
+ public static IAlleleBeeSpecies getGregtechBeeType(String name) {
+ Class<?> gtBees;
+ try {
+ Class gtBeeTypes = Class.forName("gregtech.loaders.misc.GT_BeeDefinition");
+ Enum gtBeeEnumObject = Enum.valueOf(gtBeeTypes, name);
+ Field gtBeesField = FieldUtils.getDeclaredField(gtBeeTypes, "species", true);
+ gtBeesField.setAccessible(true);
+ ReflectionUtils.makeFieldAccessible(gtBeesField);
+ Object beeType = gtBeesField.get(gtBeeEnumObject);
+ return (IAlleleBeeSpecies) beeType;
+ } catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
index 49b8da0d1b..1007eac0be 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
@@ -1,11 +1,5 @@
package gtPlusPlus.xmod.forestry.bees.custom;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.commons.lang3.reflect.FieldUtils;
-
import cpw.mods.fml.common.Loader;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAllele;
@@ -20,176 +14,176 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
+import org.apache.commons.lang3.reflect.FieldUtils;
public class GTPP_Bees {
-
- //Custom Comb Drop Base Items
- public static Item dropForceGem;
- public static Item dropBiomassBlob;
- public static Item dropEthanolBlob;
- public static Item dropNikoliteDust;
- public static Item dropFluorineBlob;
-
- //Base Comb Item
+
+ // Custom Comb Drop Base Items
+ public static Item dropForceGem;
+ public static Item dropBiomassBlob;
+ public static Item dropEthanolBlob;
+ public static Item dropNikoliteDust;
+ public static Item dropFluorineBlob;
+
+ // Base Comb Item
public static ItemCustomComb combs;
- //Combs obtained via reflection
+ // Combs obtained via reflection
public static ItemStack Comb_Slag;
public static ItemStack Comb_Stone;
-
- //Materials obtained via reflection
+
+ // Materials obtained via reflection
public static Materials PTFE;
public static Materials PBS;
- //public static GTPP_Branch_Definition definition;
-
+ // public static GTPP_Branch_Definition definition;
public GTPP_Bees() {
if (Loader.isModLoaded("Forestry") /*&& tryGetBeesBoolean()*/) {
-
- for (IAllele o : AlleleManager.alleleRegistry.getRegisteredAlleles().values()){
- //Utils.LOG_DEBUG_BEES(" ==================================================");
- //Utils.LOG_DEBUG_BEES(" Name: "+o.getName());
- //Utils.LOG_DEBUG_BEES(" Name: "+o.getUnlocalizedName());
- //Utils.LOG_DEBUG_BEES(" getUID: "+o.getUID());
- //Utils.LOG_DEBUG_BEES(" isDominant: "+o.isDominant());
- }
-
- //Set Materials and Comb stacks from GT via Reflection
- setMaterials();
- setCustomItems();
-
- try {
- combs = new ItemCustomComb();
- combs.initCombsRecipes();
- GTPP_Bee_Definition.initBees();
- }
- catch (Throwable t){
- Logger.BEES("Failed to load bees, probably due to an ancient forestry version");
- t.printStackTrace();
- }
+
+ for (IAllele o : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) {
+ // Utils.LOG_DEBUG_BEES(" ==================================================");
+ // Utils.LOG_DEBUG_BEES(" Name: "+o.getName());
+ // Utils.LOG_DEBUG_BEES(" Name: "+o.getUnlocalizedName());
+ // Utils.LOG_DEBUG_BEES(" getUID: "+o.getUID());
+ // Utils.LOG_DEBUG_BEES(" isDominant: "+o.isDominant());
+ }
+
+ // Set Materials and Comb stacks from GT via Reflection
+ setMaterials();
+ setCustomItems();
+
+ try {
+ combs = new ItemCustomComb();
+ combs.initCombsRecipes();
+ GTPP_Bee_Definition.initBees();
+ } catch (Throwable t) {
+ Logger.BEES("Failed to load bees, probably due to an ancient forestry version");
+ t.printStackTrace();
+ }
}
}
-
+
private void setCustomItems() {
- dropForceGem = new BaseItemMisc("Force", new short[]{250, 250, 20}, 64, MiscTypes.GEM, null);
- //mGregMatLoader.enableMaterial(Materials.Force);
- //MaterialUtils.tryEnableMaterial(Materials.Force);
- //MaterialUtils.tryEnableMaterialPart(OrePrefixes.dust, Materials.Force);
- //MaterialUtils.tryEnableMaterialPart(OrePrefixes.ingot, Materials.Force);
- dropBiomassBlob = new BaseItemMisc("Biomass", new short[]{33, 225, 24}, 64, MiscTypes.DROP, null);
- dropEthanolBlob = new BaseItemMisc("Ethanol", new short[]{255, 128, 0}, 64, MiscTypes.DROP, null);
-
- //Nikolite may not exist, so lets make it.
- dropNikoliteDust = ItemUtils.generateSpecialUseDusts("Nikolite", "Nikolite", Utils.rgbtoHexValue(60, 180, 200))[2];
- //mGregMatLoader.enableMaterial(Materials.BlueAlloy);
- //mGregMatLoader.enableMaterial(Materials.Nikolite);
- //MaterialUtils.tryEnableMaterial(Materials.Nikolite);
- //MaterialUtils.tryEnableMaterialPart(OrePrefixes.dust, Materials.Nikolite);
- //MaterialUtils.tryEnableMaterialPart(OrePrefixes.ingot, Materials.Nikolite);
- //MaterialUtils.tryEnableMaterialPart(OrePrefixes.plate, Materials.Nikolite);
- //MaterialUtils.tryEnableMaterial(Materials.BlueAlloy);
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotNikolite", 1) == null){
- new BaseItemIngot_OLD("itemIngotNikolite", "Nikolite", Utils.rgbtoHexValue(60, 180, 200), 0);
- }
-
- dropFluorineBlob = new BaseItemMisc("Fluorine", new short[]{30, 230, 230}, 64, MiscTypes.DROP, null);
- addRecipes();
- }
-
- private void addRecipes(){
- addExtractorRecipe(ItemUtils.getSimpleStack(dropBiomassBlob), FluidUtils.getFluidStack("biomass", 30));
- addExtractorRecipe(ItemUtils.getSimpleStack(dropEthanolBlob), FluidUtils.getFluidStack("ethanol", 6));
- addExtractorRecipe(ItemUtils.getSimpleStack(dropFluorineBlob), FluidUtils.getFluidStack("fluorine", 4));
+ dropForceGem = new BaseItemMisc("Force", new short[] {250, 250, 20}, 64, MiscTypes.GEM, null);
+ // mGregMatLoader.enableMaterial(Materials.Force);
+ // MaterialUtils.tryEnableMaterial(Materials.Force);
+ // MaterialUtils.tryEnableMaterialPart(OrePrefixes.dust, Materials.Force);
+ // MaterialUtils.tryEnableMaterialPart(OrePrefixes.ingot, Materials.Force);
+ dropBiomassBlob = new BaseItemMisc("Biomass", new short[] {33, 225, 24}, 64, MiscTypes.DROP, null);
+ dropEthanolBlob = new BaseItemMisc("Ethanol", new short[] {255, 128, 0}, 64, MiscTypes.DROP, null);
+
+ // Nikolite may not exist, so lets make it.
+ dropNikoliteDust =
+ ItemUtils.generateSpecialUseDusts("Nikolite", "Nikolite", Utils.rgbtoHexValue(60, 180, 200))[2];
+ // mGregMatLoader.enableMaterial(Materials.BlueAlloy);
+ // mGregMatLoader.enableMaterial(Materials.Nikolite);
+ // MaterialUtils.tryEnableMaterial(Materials.Nikolite);
+ // MaterialUtils.tryEnableMaterialPart(OrePrefixes.dust, Materials.Nikolite);
+ // MaterialUtils.tryEnableMaterialPart(OrePrefixes.ingot, Materials.Nikolite);
+ // MaterialUtils.tryEnableMaterialPart(OrePrefixes.plate, Materials.Nikolite);
+ // MaterialUtils.tryEnableMaterial(Materials.BlueAlloy);
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotNikolite", 1) == null) {
+ new BaseItemIngot_OLD("itemIngotNikolite", "Nikolite", Utils.rgbtoHexValue(60, 180, 200), 0);
+ }
+
+ dropFluorineBlob = new BaseItemMisc("Fluorine", new short[] {30, 230, 230}, 64, MiscTypes.DROP, null);
+ addRecipes();
}
-
- private void addExtractorRecipe(ItemStack input, FluidStack output){
- CORE.RA.addFluidExtractionRecipe(
- input,
- output,
- 30,
- 8);
+
+ private void addRecipes() {
+ addExtractorRecipe(ItemUtils.getSimpleStack(dropBiomassBlob), FluidUtils.getFluidStack("biomass", 30));
+ addExtractorRecipe(ItemUtils.getSimpleStack(dropEthanolBlob), FluidUtils.getFluidStack("ethanol", 6));
+ addExtractorRecipe(ItemUtils.getSimpleStack(dropFluorineBlob), FluidUtils.getFluidStack("fluorine", 4));
}
-
-
- private static boolean tryGetBeesBoolean(){
- try {
- Class<?> mProxy = Class.forName("gregtech.GT_Mod.gregtechproxy");
- Field mNerf = FieldUtils.getDeclaredField(mProxy, "mGTBees", true);
- boolean returnValue = (boolean) mNerf.get(GT_Mod.gregtechproxy);
- return returnValue;
- }
- catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) {
- return false;
- }
- }
-
- private void setMaterials(){
- try {
-
- Class<?> gtBees = Class.forName("gregtech.loaders.misc.GT_Bees");
- Class<?> gtCombItemClass = Class.forName("gregtech.common.items.ItemComb");
- Class gtCombEnumClass = Class.forName("gregtech.common.items.CombType");
- Field gtCombs = FieldUtils.getDeclaredField(gtBees, "combs", true);
- gtCombs.setAccessible(true);
- ReflectionUtils.makeFieldAccessible(gtCombs);
- Enum gtCombTypeSlag = Enum.valueOf(gtCombEnumClass, "SLAG");
- Enum gtCombTypeStone = Enum.valueOf(gtCombEnumClass, "STONE");
- Object oCombObject = gtCombs.get(null);
-
- Logger.DEBUG_BEES("Field getModifiers: "+gtCombs.getModifiers());
- Logger.DEBUG_BEES("Field toGenericString: "+gtCombs.toGenericString());
- Logger.DEBUG_BEES("Field getClass: "+gtCombs.getClass());
- Logger.DEBUG_BEES("Field isEnumConstant: "+gtCombs.isEnumConstant());
- Logger.DEBUG_BEES("Field isSynthetic: "+gtCombs.isSynthetic());
- Logger.DEBUG_BEES("Field get(gtBees) != null: "+(gtCombs.get(gtBees) != null));
- Logger.DEBUG_BEES("Field isAccessible: "+gtCombs.isAccessible());
-
-
- Logger.BEES("gtBees: "+(gtBees != null));
- Logger.BEES("gtCombItemClass: "+(gtCombItemClass != null));
- Logger.BEES("gtCombEnumClass: "+(gtCombEnumClass != null));
- Logger.BEES("gtCombs: "+(gtCombs != null));
- Logger.BEES("gtCombTypeSlag: "+(gtCombTypeSlag != null));
- Logger.BEES("gtCombTypeStone: "+(gtCombTypeStone != null));
- Logger.BEES("oCombObject: "+(oCombObject != null));
-
-
- //if (gtCombItemClass.isInstance(oCombObject)){
- Method getStackForType;
- getStackForType = gtCombItemClass.getDeclaredMethod("getStackForType", gtCombEnumClass);
-
- if (getStackForType != null) {
- Logger.BEES("Found Method: getStackForType");
- }
- if (Comb_Slag == null){
- Comb_Slag = (ItemStack) getStackForType.invoke(gtBees, gtCombTypeSlag);
- }
- if (Comb_Stone == null){
- Comb_Stone = (ItemStack) getStackForType.invoke(gtBees, gtCombTypeStone);
- }
- /*}
- else {
- Utils.LOG_BEES("oCombObject was not an instance of gregtech.common.items.ItemComb");
- }*/
-
- }
- catch (NullPointerException | ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchMethodException | SecurityException | InvocationTargetException e){
- Logger.BEES("Bad Reflection. setMaterials()");
- }
-
- PTFE = trySetValue("Polytetrafluoroethylene");
- PBS = trySetValue("StyreneButadieneRubber");
+
+ private void addExtractorRecipe(ItemStack input, FluidStack output) {
+ CORE.RA.addFluidExtractionRecipe(input, output, 30, 8);
+ }
+
+ private static boolean tryGetBeesBoolean() {
+ try {
+ Class<?> mProxy = Class.forName("gregtech.GT_Mod.gregtechproxy");
+ Field mNerf = FieldUtils.getDeclaredField(mProxy, "mGTBees", true);
+ boolean returnValue = (boolean) mNerf.get(GT_Mod.gregtechproxy);
+ return returnValue;
+ } catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) {
+ return false;
+ }
+ }
+
+ private void setMaterials() {
+ try {
+
+ Class<?> gtBees = Class.forName("gregtech.loaders.misc.GT_Bees");
+ Class<?> gtCombItemClass = Class.forName("gregtech.common.items.ItemComb");
+ Class gtCombEnumClass = Class.forName("gregtech.common.items.CombType");
+ Field gtCombs = FieldUtils.getDeclaredField(gtBees, "combs", true);
+ gtCombs.setAccessible(true);
+ ReflectionUtils.makeFieldAccessible(gtCombs);
+ Enum gtCombTypeSlag = Enum.valueOf(gtCombEnumClass, "SLAG");
+ Enum gtCombTypeStone = Enum.valueOf(gtCombEnumClass, "STONE");
+ Object oCombObject = gtCombs.get(null);
+
+ Logger.DEBUG_BEES("Field getModifiers: " + gtCombs.getModifiers());
+ Logger.DEBUG_BEES("Field toGenericString: " + gtCombs.toGenericString());
+ Logger.DEBUG_BEES("Field getClass: " + gtCombs.getClass());
+ Logger.DEBUG_BEES("Field isEnumConstant: " + gtCombs.isEnumConstant());
+ Logger.DEBUG_BEES("Field isSynthetic: " + gtCombs.isSynthetic());
+ Logger.DEBUG_BEES("Field get(gtBees) != null: " + (gtCombs.get(gtBees) != null));
+ Logger.DEBUG_BEES("Field isAccessible: " + gtCombs.isAccessible());
+
+ Logger.BEES("gtBees: " + (gtBees != null));
+ Logger.BEES("gtCombItemClass: " + (gtCombItemClass != null));
+ Logger.BEES("gtCombEnumClass: " + (gtCombEnumClass != null));
+ Logger.BEES("gtCombs: " + (gtCombs != null));
+ Logger.BEES("gtCombTypeSlag: " + (gtCombTypeSlag != null));
+ Logger.BEES("gtCombTypeStone: " + (gtCombTypeStone != null));
+ Logger.BEES("oCombObject: " + (oCombObject != null));
+
+ // if (gtCombItemClass.isInstance(oCombObject)){
+ Method getStackForType;
+ getStackForType = gtCombItemClass.getDeclaredMethod("getStackForType", gtCombEnumClass);
+
+ if (getStackForType != null) {
+ Logger.BEES("Found Method: getStackForType");
+ }
+ if (Comb_Slag == null) {
+ Comb_Slag = (ItemStack) getStackForType.invoke(gtBees, gtCombTypeSlag);
+ }
+ if (Comb_Stone == null) {
+ Comb_Stone = (ItemStack) getStackForType.invoke(gtBees, gtCombTypeStone);
+ }
+ /*}
+ else {
+ Utils.LOG_BEES("oCombObject was not an instance of gregtech.common.items.ItemComb");
+ }*/
+
+ } catch (NullPointerException
+ | ClassNotFoundException
+ | IllegalArgumentException
+ | IllegalAccessException
+ | NoSuchMethodException
+ | SecurityException
+ | InvocationTargetException e) {
+ Logger.BEES("Bad Reflection. setMaterials()");
+ }
+
+ PTFE = trySetValue("Polytetrafluoroethylene");
+ PBS = trySetValue("StyreneButadieneRubber");
}
-
- private Materials trySetValue(String material){
- Materials mTemp = Materials.valueOf(material);
- if (mTemp != null){
- return mTemp;
- }
- return Materials._NULL;
+
+ private Materials trySetValue(String material) {
+ Materials mTemp = Materials.valueOf(material);
+ if (mTemp != null) {
+ return mTemp;
+ }
+ return Materials._NULL;
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Branch_Definition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Branch_Definition.java
index f59f0c537f..d61f0d749d 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Branch_Definition.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Branch_Definition.java
@@ -1,80 +1,82 @@
package gtPlusPlus.xmod.forestry.bees.custom;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IClassification;
import gtPlusPlus.api.objects.Logger;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
public enum GTPP_Branch_Definition {
+ ORGANIC("ORGANIC"),
+ GEM("GEM"),
+ METAL("METAL"),
+ RAREMETAL("RAREMETAL"),
+ RADIOACTIVE("RADIOACTIVE");
- ORGANIC("ORGANIC"),
- GEM("GEM"),
- METAL("METAL"),
- RAREMETAL("RAREMETAL"),
- RADIOACTIVE("RADIOACTIVE");
-
- final String mFieldName;
- final Enum mActualValues;
- GTPP_Branch_Definition(String mValue){
- this.mFieldName = mValue;
- this.mActualValues = setEnumVar(mValue);
- }
+ final String mFieldName;
+ final Enum mActualValues;
- public final IAllele[] getTemplate() {
- Class gtBranchDefClass;
- try {
- gtBranchDefClass = Class.forName("gregtech.loaders.misc.GT_BranchDefinition");
- Enum enumA = mActualValues;
- Method methodMyMethod = gtBranchDefClass.getMethod("getTemplate");
+ GTPP_Branch_Definition(String mValue) {
+ this.mFieldName = mValue;
+ this.mActualValues = setEnumVar(mValue);
+ }
- Logger.INFO("[Bees] gtBranchDefClass: "+(gtBranchDefClass != null));
- Logger.INFO("[Bees] enumA: "+(enumA != null));
- Logger.INFO("[Bees] methodMyMethod: "+(methodMyMethod != null));
-
- return (IAllele[]) methodMyMethod.invoke(enumA);
- }
- catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.INFO("[Bees] Bad Reflection. getTemplate()");
- e.printStackTrace();
- //gregtech.loaders.misc.GT_BranchDefinition.getTemplate()
- return null;
- }
- }
+ public final IAllele[] getTemplate() {
+ Class gtBranchDefClass;
+ try {
+ gtBranchDefClass = Class.forName("gregtech.loaders.misc.GT_BranchDefinition");
+ Enum enumA = mActualValues;
+ Method methodMyMethod = gtBranchDefClass.getMethod("getTemplate");
- public final IClassification getBranch() {
- Class gtBranchDefClass;
- try {
- gtBranchDefClass = Class.forName("gregtech.loaders.misc.GT_BranchDefinition");
- Enum enum_MY_SAMPLE_ENUM = mActualValues;
- Method methodMyMethod = gtBranchDefClass.getMethod("getBranch");
-
+ Logger.INFO("[Bees] gtBranchDefClass: " + (gtBranchDefClass != null));
+ Logger.INFO("[Bees] enumA: " + (enumA != null));
+ Logger.INFO("[Bees] methodMyMethod: " + (methodMyMethod != null));
- Logger.INFO("[Bees] gtBranchDefClass: "+(gtBranchDefClass != null));
- Logger.INFO("[Bees] enum_MY_SAMPLE_ENUM: "+(enum_MY_SAMPLE_ENUM != null));
- Logger.INFO("[Bees] methodMyMethod: "+(methodMyMethod != null));
-
- return (IClassification) methodMyMethod.invoke(enum_MY_SAMPLE_ENUM);
- }
- catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.INFO("[Bees] Bad Reflection. getBranch()");
- e.printStackTrace();
- return null;
- }
- }
+ return (IAllele[]) methodMyMethod.invoke(enumA);
+ } catch (ClassNotFoundException
+ | NoSuchMethodException
+ | SecurityException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ Logger.INFO("[Bees] Bad Reflection. getTemplate()");
+ e.printStackTrace();
+ // gregtech.loaders.misc.GT_BranchDefinition.getTemplate()
+ return null;
+ }
+ }
- private Enum setEnumVar(String value){
- try {
- Class gtBranchDefClass = Class.forName("gregtech.loaders.misc.GT_BranchDefinition");
- Enum branchDef = Enum.valueOf(gtBranchDefClass, value);
- return branchDef;
- }
- catch (ClassNotFoundException e){
- return null;
- }
- }
+ public final IClassification getBranch() {
+ Class gtBranchDefClass;
+ try {
+ gtBranchDefClass = Class.forName("gregtech.loaders.misc.GT_BranchDefinition");
+ Enum enum_MY_SAMPLE_ENUM = mActualValues;
+ Method methodMyMethod = gtBranchDefClass.getMethod("getBranch");
+ Logger.INFO("[Bees] gtBranchDefClass: " + (gtBranchDefClass != null));
+ Logger.INFO("[Bees] enum_MY_SAMPLE_ENUM: " + (enum_MY_SAMPLE_ENUM != null));
+ Logger.INFO("[Bees] methodMyMethod: " + (methodMyMethod != null));
+ return (IClassification) methodMyMethod.invoke(enum_MY_SAMPLE_ENUM);
+ } catch (ClassNotFoundException
+ | NoSuchMethodException
+ | SecurityException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ Logger.INFO("[Bees] Bad Reflection. getBranch()");
+ e.printStackTrace();
+ return null;
+ }
+ }
+ private Enum setEnumVar(String value) {
+ try {
+ Class gtBranchDefClass = Class.forName("gregtech.loaders.misc.GT_BranchDefinition");
+ Enum branchDef = Enum.valueOf(gtBranchDefClass, value);
+ return branchDef;
+ } catch (ClassNotFoundException e) {
+ return null;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/ItemCustomComb.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/ItemCustomComb.java
index 813ebcbe25..3e1c40e972 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/ItemCustomComb.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/ItemCustomComb.java
@@ -1,181 +1,279 @@
package gtPlusPlus.xmod.forestry.bees.custom;
-import java.lang.reflect.Field;
-import java.util.List;
-
-import org.apache.commons.lang3.reflect.FieldUtils;
-
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
+import forestry.api.core.Tabs;
import gregtech.GT_Mod;
import gregtech.api.enums.*;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-
-import forestry.api.core.Tabs;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.lang.reflect.Field;
+import java.util.List;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import org.apache.commons.lang3.reflect.FieldUtils;
public class ItemCustomComb extends Item {
- @SideOnly(Side.CLIENT)
- private IIcon secondIcon;
-
- public ItemCustomComb() {
- super();
- this.setCreativeTab(Tabs.tabApiculture);
- this.setHasSubtypes(true);
- this.setUnlocalizedName("gtpp.comb");
- GameRegistry.registerItem(this, "gtpp.comb", CORE.MODID);
- }
-
- public ItemStack getStackForType(CustomCombs type) {
- return new ItemStack(this, 1, type.ordinal());
- }
-
- public ItemStack getStackForType(CustomCombs type, int count) {
- return new ItemStack(this, count, type.ordinal());
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item item, CreativeTabs tabs, List list) {
- for (CustomCombs type : CustomCombs.values()) {
- if (type.showInList) {
- list.add(this.getStackForType(type));
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
- @Override
- public int getRenderPasses(int meta) {
- return 2;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister par1IconRegister) {
- this.itemIcon = par1IconRegister.registerIcon("forestry:beeCombs.0");
- this.secondIcon = par1IconRegister.registerIcon("forestry:beeCombs.1");
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return (pass == 0) ? itemIcon : secondIcon;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack stack, int pass) {
- int meta = Math.max(0, Math.min(CustomCombs.values().length - 1, stack.getItemDamage()));
- int colour = CustomCombs.values()[meta].getColours()[0];
-
- if (pass >= 1) {
- colour = CustomCombs.values()[meta].getColours()[1];
- }
-
- return colour;
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack stack) {
- return CustomCombs.values()[stack.getItemDamage()].getName();
- }
-
- public void initCombsRecipes() {
- ItemStack tComb;
-
- tComb = getStackForType(CustomCombs.SILICON);
- addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Silicon, 1), 30);
- //addProcess(tComb, Materials.Silver, 100);
- //addProcess(tComb, Materials.Galena, 100);
-
- //Rubbers
- tComb = getStackForType(CustomCombs.RUBBER);
- addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Rubber, 1), 30);
- tComb = getStackForType(CustomCombs.PLASTIC);
- addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Plastic, 1), 20);
- tComb = getStackForType(CustomCombs.PTFE);
- addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, GTPP_Bees.PTFE, 1), 10);
- tComb = getStackForType(CustomCombs.PBS);
- addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, GTPP_Bees.PBS, 1), 5);
-
-
- //Fuels
- tComb = getStackForType(CustomCombs.BIOMASS);
- addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropBiomassBlob), 5);
- tComb = getStackForType(CustomCombs.PBS);
- addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropEthanolBlob), 5);
-
- //Misc Materials
- tComb = getStackForType(CustomCombs.FORCE);
- addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropForceGem), 5);
- tComb = getStackForType(CustomCombs.FLUORINE);
- addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropFluorineBlob), 5);
- tComb = getStackForType(CustomCombs.NIKOLITE);
- addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropNikoliteDust), 5);
-
- }
- public void addSpecialCent(ItemStack tComb, ItemStack aOutput, int chance){
- GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput, ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 128, 5);
- //RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(aOutput, chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f));
- }
-
- public void addSpecialCent(ItemStack tComb, ItemStack aOutput, int chance, ItemStack aOutput2, int chance2){
- GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput, ItemList.FR_Wax.get(1, new Object[0]), aOutput2, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000, chance2 * 100 }, 128, 5);
- //RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(aOutput, chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f,aOutput2,chance2 * 0.01f));
- }
-
- public void addSpecialCent(ItemStack tComb, ItemStack aOutput, int chance, ItemStack aOutput2, int chance2, ItemStack aOutput3, int chance3){
- GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput, ItemList.FR_Wax.get(1, new Object[0]), aOutput2, aOutput3, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000, chance2 * 100, chance3*100 }, 128, 5);
- //RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(aOutput, chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f,aOutput2,chance2 * 0.01f,aOutput3,chance3*0.01f));
- }
-
- public void addProcess(ItemStack tComb, Materials aMaterial, int chance){
- if(tryGetNerfBoolean()){
- GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), Materials.Water.getFluid(1000), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 96);
- GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(16, tComb), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 1), 10000, (int) (aMaterial.getMass() * 128), 384);
- }else{
- GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 128, 5);
- //RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f));
- }
- }
-
- public void addProcess(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance){
- if(tryGetNerfBoolean()){
- GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1), Materials.Water.getFluid(1000), aInMaterial.mOreByProducts.isEmpty() ? null : aInMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), 96);
- GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(16, tComb), Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 1), 10000, (int) (aOutMaterial.getMass() * 128), 384);
- }else{
- GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 128, 5);
- //RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f));
- }
- }
-
- private static boolean tryGetNerfBoolean(){
- try {
- Class mProxy = Class.forName("gregtech.GT_Mod.gregtechproxy");
- Field mNerf = FieldUtils.getDeclaredField(mProxy, "mNerfedCombs", true);
- boolean returnValue = (boolean) mNerf.get(GT_Mod.gregtechproxy);
- return returnValue;
- }
- catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) {
- return false;
- }
- }
-
-} \ No newline at end of file
+ @SideOnly(Side.CLIENT)
+ private IIcon secondIcon;
+
+ public ItemCustomComb() {
+ super();
+ this.setCreativeTab(Tabs.tabApiculture);
+ this.setHasSubtypes(true);
+ this.setUnlocalizedName("gtpp.comb");
+ GameRegistry.registerItem(this, "gtpp.comb", CORE.MODID);
+ }
+
+ public ItemStack getStackForType(CustomCombs type) {
+ return new ItemStack(this, 1, type.ordinal());
+ }
+
+ public ItemStack getStackForType(CustomCombs type, int count) {
+ return new ItemStack(this, count, type.ordinal());
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tabs, List list) {
+ for (CustomCombs type : CustomCombs.values()) {
+ if (type.showInList) {
+ list.add(this.getStackForType(type));
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+
+ @Override
+ public int getRenderPasses(int meta) {
+ return 2;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister) {
+ this.itemIcon = par1IconRegister.registerIcon("forestry:beeCombs.0");
+ this.secondIcon = par1IconRegister.registerIcon("forestry:beeCombs.1");
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return (pass == 0) ? itemIcon : secondIcon;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass) {
+ int meta = Math.max(0, Math.min(CustomCombs.values().length - 1, stack.getItemDamage()));
+ int colour = CustomCombs.values()[meta].getColours()[0];
+
+ if (pass >= 1) {
+ colour = CustomCombs.values()[meta].getColours()[1];
+ }
+
+ return colour;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack stack) {
+ return CustomCombs.values()[stack.getItemDamage()].getName();
+ }
+
+ public void initCombsRecipes() {
+ ItemStack tComb;
+
+ tComb = getStackForType(CustomCombs.SILICON);
+ addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Silicon, 1), 30);
+ // addProcess(tComb, Materials.Silver, 100);
+ // addProcess(tComb, Materials.Galena, 100);
+
+ // Rubbers
+ tComb = getStackForType(CustomCombs.RUBBER);
+ addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Rubber, 1), 30);
+ tComb = getStackForType(CustomCombs.PLASTIC);
+ addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Plastic, 1), 20);
+ tComb = getStackForType(CustomCombs.PTFE);
+ addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, GTPP_Bees.PTFE, 1), 10);
+ tComb = getStackForType(CustomCombs.PBS);
+ addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, GTPP_Bees.PBS, 1), 5);
+
+ // Fuels
+ tComb = getStackForType(CustomCombs.BIOMASS);
+ addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropBiomassBlob), 5);
+ tComb = getStackForType(CustomCombs.PBS);
+ addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropEthanolBlob), 5);
+
+ // Misc Materials
+ tComb = getStackForType(CustomCombs.FORCE);
+ addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropForceGem), 5);
+ tComb = getStackForType(CustomCombs.FLUORINE);
+ addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropFluorineBlob), 5);
+ tComb = getStackForType(CustomCombs.NIKOLITE);
+ addSpecialCent(tComb, ItemUtils.getSimpleStack(GTPP_Bees.dropNikoliteDust), 5);
+ }
+
+ public void addSpecialCent(ItemStack tComb, ItemStack aOutput, int chance) {
+ GT_Values.RA.addCentrifugeRecipe(
+ tComb,
+ GT_Values.NI,
+ GT_Values.NF,
+ GT_Values.NF,
+ aOutput,
+ ItemList.FR_Wax.get(1, new Object[0]),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ new int[] {chance * 100, 3000},
+ 128,
+ 5);
+ // RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(aOutput, chance * 0.01f,
+ // ItemList.FR_Wax.get(1, new Object[0]), 0.3f));
+ }
+
+ public void addSpecialCent(ItemStack tComb, ItemStack aOutput, int chance, ItemStack aOutput2, int chance2) {
+ GT_Values.RA.addCentrifugeRecipe(
+ tComb,
+ GT_Values.NI,
+ GT_Values.NF,
+ GT_Values.NF,
+ aOutput,
+ ItemList.FR_Wax.get(1, new Object[0]),
+ aOutput2,
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ new int[] {chance * 100, 3000, chance2 * 100},
+ 128,
+ 5);
+ // RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(aOutput, chance * 0.01f,
+ // ItemList.FR_Wax.get(1, new Object[0]), 0.3f,aOutput2,chance2 * 0.01f));
+ }
+
+ public void addSpecialCent(
+ ItemStack tComb,
+ ItemStack aOutput,
+ int chance,
+ ItemStack aOutput2,
+ int chance2,
+ ItemStack aOutput3,
+ int chance3) {
+ GT_Values.RA.addCentrifugeRecipe(
+ tComb,
+ GT_Values.NI,
+ GT_Values.NF,
+ GT_Values.NF,
+ aOutput,
+ ItemList.FR_Wax.get(1, new Object[0]),
+ aOutput2,
+ aOutput3,
+ GT_Values.NI,
+ GT_Values.NI,
+ new int[] {chance * 100, 3000, chance2 * 100, chance3 * 100},
+ 128,
+ 5);
+ // RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(aOutput, chance * 0.01f,
+ // ItemList.FR_Wax.get(1, new Object[0]), 0.3f,aOutput2,chance2 * 0.01f,aOutput3,chance3*0.01f));
+ }
+
+ public void addProcess(ItemStack tComb, Materials aMaterial, int chance) {
+ if (tryGetNerfBoolean()) {
+ GT_Values.RA.addChemicalRecipe(
+ GT_Utility.copyAmount(9, tComb),
+ GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1),
+ Materials.Water.getFluid(1000),
+ aMaterial.mOreByProducts.isEmpty()
+ ? null
+ : aMaterial.mOreByProducts.get(0).getMolten(144),
+ GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4),
+ 96);
+ GT_Values.RA.addAutoclaveRecipe(
+ GT_Utility.copyAmount(16, tComb),
+ Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass() + 9) / 10))),
+ GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 1),
+ 10000,
+ (int) (aMaterial.getMass() * 128),
+ 384);
+ } else {
+ GT_Values.RA.addCentrifugeRecipe(
+ tComb,
+ GT_Values.NI,
+ GT_Values.NF,
+ GT_Values.NF,
+ GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1),
+ ItemList.FR_Wax.get(1, new Object[0]),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ new int[] {chance * 100, 3000},
+ 128,
+ 5);
+ // RecipeManagers.centrifugeManager.addRecipe(40, tComb,
+ // ImmutableMap.of(GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), chance * 0.01f,
+ // ItemList.FR_Wax.get(1, new Object[0]), 0.3f));
+ }
+ }
+
+ public void addProcess(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance) {
+ if (tryGetNerfBoolean()) {
+ GT_Values.RA.addChemicalRecipe(
+ GT_Utility.copyAmount(9, tComb),
+ GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1),
+ Materials.Water.getFluid(1000),
+ aInMaterial.mOreByProducts.isEmpty()
+ ? null
+ : aInMaterial.mOreByProducts.get(0).getMolten(144),
+ GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4),
+ 96);
+ GT_Values.RA.addAutoclaveRecipe(
+ GT_Utility.copyAmount(16, tComb),
+ Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass() + 9) / 10))),
+ GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 1),
+ 10000,
+ (int) (aOutMaterial.getMass() * 128),
+ 384);
+ } else {
+ GT_Values.RA.addCentrifugeRecipe(
+ tComb,
+ GT_Values.NI,
+ GT_Values.NF,
+ GT_Values.NF,
+ GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1),
+ ItemList.FR_Wax.get(1, new Object[0]),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ new int[] {chance * 100, 3000},
+ 128,
+ 5);
+ // RecipeManagers.centrifugeManager.addRecipe(40, tComb,
+ // ImmutableMap.of(GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), chance * 0.01f,
+ // ItemList.FR_Wax.get(1, new Object[0]), 0.3f));
+ }
+ }
+
+ private static boolean tryGetNerfBoolean() {
+ try {
+ Class mProxy = Class.forName("gregtech.GT_Mod.gregtechproxy");
+ Field mNerf = FieldUtils.getDeclaredField(mProxy, "mNerfedCombs", true);
+ boolean returnValue = (boolean) mNerf.get(GT_Mod.gregtechproxy);
+ return returnValue;
+ } catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) {
+ return false;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/gui/ContainerBeeHouse.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/gui/ContainerBeeHouse.java
index 4aa9de8220..3132cddc01 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/gui/ContainerBeeHouse.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/gui/ContainerBeeHouse.java
@@ -10,34 +10,32 @@
******************************************************************************/
package gtPlusPlus.xmod.forestry.bees.gui;
-import net.minecraft.entity.player.InventoryPlayer;
-
import forestry.apiculture.gui.ContainerBeeHelper;
import forestry.apiculture.gui.IContainerBeeHousing;
import forestry.apiculture.tiles.TileBeeHousingBase;
import forestry.core.gui.ContainerTile;
import forestry.core.network.IForestryPacketClient;
import forestry.core.network.packets.PacketGuiUpdate;
+import net.minecraft.entity.player.InventoryPlayer;
public class ContainerBeeHouse extends ContainerTile<TileBeeHousingBase> implements IContainerBeeHousing {
- public ContainerBeeHouse(InventoryPlayer player, TileBeeHousingBase tile, boolean hasFrames) {
- super(tile, player, 8, 108);
- ContainerBeeHelper.addSlots(this, tile, hasFrames);
- }
-
- private int beeProgress = 0;
+ public ContainerBeeHouse(InventoryPlayer player, TileBeeHousingBase tile, boolean hasFrames) {
+ super(tile, player, 8, 108);
+ ContainerBeeHelper.addSlots(this, tile, hasFrames);
+ }
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
+ private int beeProgress = 0;
- int beeProgress = tile.getBeekeepingLogic().getBeeProgressPercent();
- if (this.beeProgress != beeProgress) {
- this.beeProgress = beeProgress;
- IForestryPacketClient packet = new PacketGuiUpdate(tile);
- sendPacketToCrafters(packet);
- }
- }
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ int beeProgress = tile.getBeekeepingLogic().getBeeProgressPercent();
+ if (this.beeProgress != beeProgress) {
+ this.beeProgress = beeProgress;
+ IForestryPacketClient packet = new PacketGuiUpdate(tile);
+ sendPacketToCrafters(packet);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/gui/GuiBeeHouse.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/gui/GuiBeeHouse.java
index 89a2f121d9..5c0287628e 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/gui/GuiBeeHouse.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/gui/GuiBeeHouse.java
@@ -10,44 +10,47 @@
******************************************************************************/
package gtPlusPlus.xmod.forestry.bees.gui;
-import net.minecraft.inventory.Container;
-
import forestry.apiculture.gui.IContainerBeeHousing;
import forestry.apiculture.gui.IGuiBeeHousingInventory;
import forestry.core.config.Constants;
import forestry.core.gui.GuiForestryTitled;
import forestry.core.render.EnumTankLevel;
+import net.minecraft.inventory.Container;
-public class GuiBeeHouse<C extends Container & IContainerBeeHousing> extends GuiForestryTitled<C, IGuiBeeHousingInventory> {
-
- public enum Icon {
- APIARY("/apiary.png"),
- BEE_HOUSE("/alveary.png");
+public class GuiBeeHouse<C extends Container & IContainerBeeHousing>
+ extends GuiForestryTitled<C, IGuiBeeHousingInventory> {
- private final String path;
+ public enum Icon {
+ APIARY("/apiary.png"),
+ BEE_HOUSE("/alveary.png");
- Icon(String path) {
- this.path = path;
- }
- }
+ private final String path;
- public GuiBeeHouse(IGuiBeeHousingInventory tile, C container, Icon icon) {
- super(Constants.TEXTURE_PATH_GUI + icon.path, container, tile);
- ySize = 190;
- }
+ Icon(String path) {
+ this.path = path;
+ }
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(float var1, int mouseX, int mouseY) {
- super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY);
+ public GuiBeeHouse(IGuiBeeHousingInventory tile, C container, Icon icon) {
+ super(Constants.TEXTURE_PATH_GUI + icon.path, container, tile);
+ ySize = 190;
+ }
- drawHealthMeter(guiLeft + 20, guiTop + 37, inventory.getHealthScaled(46), EnumTankLevel.rateTankLevel(inventory.getHealthScaled(100)));
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float var1, int mouseX, int mouseY) {
+ super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY);
- private void drawHealthMeter(int x, int y, int height, EnumTankLevel rated) {
- int i = 176 + rated.getLevelScaled(16);
- int k = 0;
+ drawHealthMeter(
+ guiLeft + 20,
+ guiTop + 37,
+ inventory.getHealthScaled(46),
+ EnumTankLevel.rateTankLevel(inventory.getHealthScaled(100)));
+ }
- this.drawTexturedModalRect(x, y + 46 - height, i, k + 46 - height, 4, height);
- }
+ private void drawHealthMeter(int x, int y, int height, EnumTankLevel rated) {
+ int i = 176 + rated.getLevelScaled(16);
+ int k = 0;
+ this.drawTexturedModalRect(x, y + 46 - height, i, k + 46 - height, 4, height);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java
index 488ef2ea0b..196d0c8fe9 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java
@@ -7,51 +7,50 @@ import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
import net.minecraft.item.ItemStack;
public enum GTPP_CombType {
-
- DRAGONBLOOD(0, "Dragon Blood", true, 30, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)),
- FORCE(1, "Force", true, 30, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5));
-
- public boolean mShowInList;
- public Material mMaterial;
- public int mChance;
- public int mID;
-
- private String mName;
- private String mNameUnlocal;
- private int[] mColour;
-
- private static void map(int aId, GTPP_CombType aType) {
- GTPP_Bees.sCombMappings.put(aId, aType);
- }
-
- public static GTPP_CombType get(int aID) {
- return GTPP_Bees.sCombMappings.get(aID);
- }
-
- GTPP_CombType(int aID, String aName, boolean aShow, int aChance, int... aColour) {
- this.mID = aID;
- this.mName = aName;
- this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", "");
- this.mChance = aChance;
- this.mShowInList = aShow;
- this.mColour = aColour;
- map(aID, this);
- this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
- }
-
- public void setHidden() {
- this.mShowInList = false;
- }
-
- public String getName() {
- return GT_LanguageManager.addStringLocalization("comb." + this.mNameUnlocal, this.mName + " Comb");
- }
-
- public int[] getColours() {
- return mColour == null || mColour.length != 2 ? new int[]{0, 0} : mColour;
- }
-
- public ItemStack getStackForType(int count) {
- return new ItemStack(GTPP_Bees.combs, count, mID);
- }
+ DRAGONBLOOD(0, "Dragon Blood", true, 30, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)),
+ FORCE(1, "Force", true, 30, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5));
+
+ public boolean mShowInList;
+ public Material mMaterial;
+ public int mChance;
+ public int mID;
+
+ private String mName;
+ private String mNameUnlocal;
+ private int[] mColour;
+
+ private static void map(int aId, GTPP_CombType aType) {
+ GTPP_Bees.sCombMappings.put(aId, aType);
+ }
+
+ public static GTPP_CombType get(int aID) {
+ return GTPP_Bees.sCombMappings.get(aID);
+ }
+
+ GTPP_CombType(int aID, String aName, boolean aShow, int aChance, int... aColour) {
+ this.mID = aID;
+ this.mName = aName;
+ this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", "");
+ this.mChance = aChance;
+ this.mShowInList = aShow;
+ this.mColour = aColour;
+ map(aID, this);
+ this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
+ }
+
+ public void setHidden() {
+ this.mShowInList = false;
+ }
+
+ public String getName() {
+ return GT_LanguageManager.addStringLocalization("comb." + this.mNameUnlocal, this.mName + " Comb");
+ }
+
+ public int[] getColours() {
+ return mColour == null || mColour.length != 2 ? new int[] {0, 0} : mColour;
+ }
+
+ public ItemStack getStackForType(int count) {
+ return new ItemStack(GTPP_Bees.combs, count, mID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java
index 60b8a18e48..069bd86ff4 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java
@@ -7,35 +7,34 @@ import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
import net.minecraft.item.ItemStack;
public enum GTPP_DropType {
+ DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)),
+ FORCE(1, "Force", true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5));
+
+ public boolean mShowInList;
+ public Material mMaterial;
+ public int mChance;
+ public int mID;
+
+ private String mName;
+ private String mNameUnlocal;
+ private int[] mColour;
+
+ private static void map(int aId, GTPP_DropType aType) {
+ GTPP_Bees.sDropMappings.put(aId, aType);
+ }
+
+ public static GTPP_DropType get(int aID) {
+ return GTPP_Bees.sDropMappings.get(aID);
+ }
- DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)),
- FORCE(1, "Force", true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5));
-
- public boolean mShowInList;
- public Material mMaterial;
- public int mChance;
- public int mID;
-
- private String mName;
- private String mNameUnlocal;
- private int[] mColour;
-
- private static void map(int aId, GTPP_DropType aType) {
- GTPP_Bees.sDropMappings.put(aId, aType);
- }
-
- public static GTPP_DropType get(int aID) {
- return GTPP_Bees.sDropMappings.get(aID);
- }
-
private GTPP_DropType(int aID, String aName, boolean aShow, int... aColour) {
- this.mID = aID;
+ this.mID = aID;
this.mName = aName;
- this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", "");
+ this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", "");
this.mShowInList = aShow;
this.mColour = aColour;
- map(aID, this);
- this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
+ map(aID, this);
+ this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
}
public void setHidden() {
@@ -50,7 +49,7 @@ public enum GTPP_DropType {
return mColour;
}
- public ItemStack getStackForType(int count) {
- return new ItemStack(GTPP_Bees.drop, count, mID);
- }
+ public ItemStack getStackForType(int count) {
+ return new ItemStack(GTPP_Bees.drop, count, mID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java
index 70dae45d06..d275328194 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java
@@ -7,49 +7,48 @@ import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
import net.minecraft.item.ItemStack;
public enum GTPP_PollenType {
-
- DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20));
-
- public boolean mShowInList;
- public Material mMaterial;
- public int mChance;
- public int mID;
-
- private String mName;
- private String mNameUnlocal;
- private int[] mColour;
-
- private static void map(int aId, GTPP_PollenType aType) {
- GTPP_Bees.sPollenMappings.put(aId, aType);
- }
-
- public static GTPP_PollenType get(int aID) {
- return GTPP_Bees.sPollenMappings.get(aID);
- }
-
- private GTPP_PollenType(int aID, String aName, boolean aShow, int... aColour) {
- this.mID = aID;
- this.mName = aName;
- this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", "");
- this.mShowInList = aShow;
- this.mColour = aColour;
- map(aID, this);
- this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
- }
-
- public void setHidden() {
- this.mShowInList = false;
- }
-
- public String getName() {
- return GT_LanguageManager.addStringLocalization("pollen." + this.mNameUnlocal, this.mName + " Pollen");
- }
-
- public int[] getColours() {
- return mColour;
- }
-
- public ItemStack getStackForType(int count) {
- return new ItemStack(GTPP_Bees.pollen, count, mID);
- }
+ DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20));
+
+ public boolean mShowInList;
+ public Material mMaterial;
+ public int mChance;
+ public int mID;
+
+ private String mName;
+ private String mNameUnlocal;
+ private int[] mColour;
+
+ private static void map(int aId, GTPP_PollenType aType) {
+ GTPP_Bees.sPollenMappings.put(aId, aType);
+ }
+
+ public static GTPP_PollenType get(int aID) {
+ return GTPP_Bees.sPollenMappings.get(aID);
+ }
+
+ private GTPP_PollenType(int aID, String aName, boolean aShow, int... aColour) {
+ this.mID = aID;
+ this.mName = aName;
+ this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", "");
+ this.mShowInList = aShow;
+ this.mColour = aColour;
+ map(aID, this);
+ this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
+ }
+
+ public void setHidden() {
+ this.mShowInList = false;
+ }
+
+ public String getName() {
+ return GT_LanguageManager.addStringLocalization("pollen." + this.mNameUnlocal, this.mName + " Pollen");
+ }
+
+ public int[] getColours() {
+ return mColour;
+ }
+
+ public ItemStack getStackForType(int count) {
+ return new ItemStack(GTPP_Bees.pollen, count, mID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java
index 20e4f31008..00df14a3bc 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java
@@ -7,35 +7,34 @@ import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
import net.minecraft.item.ItemStack;
public enum GTPP_PropolisType {
-
DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20)),
FORCE(1, "Force", true, Utils.rgbtoHexValue(250, 250, 20));
- public boolean mShowInList;
- public Material mMaterial;
- public int mChance;
- public int mID;
+ public boolean mShowInList;
+ public Material mMaterial;
+ public int mChance;
+ public int mID;
- private String mName;
- private String mNameUnlocal;
- private int mColour;
+ private String mName;
+ private String mNameUnlocal;
+ private int mColour;
- private static void map(int aId, GTPP_PropolisType aType) {
- GTPP_Bees.sPropolisMappings.put(aId, aType);
- }
-
- public static GTPP_PropolisType get(int aID) {
- return GTPP_Bees.sPropolisMappings.get(aID);
- }
+ private static void map(int aId, GTPP_PropolisType aType) {
+ GTPP_Bees.sPropolisMappings.put(aId, aType);
+ }
+
+ public static GTPP_PropolisType get(int aID) {
+ return GTPP_Bees.sPropolisMappings.get(aID);
+ }
private GTPP_PropolisType(int aID, String aName, boolean aShow, int aColour) {
- this.mID = aID;
+ this.mID = aID;
this.mName = aName;
- this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", "");
+ this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", "");
this.mShowInList = aShow;
this.mColour = aColour;
- map(aID, this);
- this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
+ map(aID, this);
+ this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
}
public void setHidden() {
@@ -50,7 +49,7 @@ public enum GTPP_PropolisType {
return mColour;
}
- public ItemStack getStackForType(int count) {
- return new ItemStack(GTPP_Bees.propolis, count, mID);
- }
+ public ItemStack getStackForType(int count) {
+ return new ItemStack(GTPP_Bees.propolis, count, mID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/inventory/InventoryDenseBeeHouse.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/inventory/InventoryDenseBeeHouse.java
index 47c380fdfe..86b1184c6c 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/inventory/InventoryDenseBeeHouse.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/inventory/InventoryDenseBeeHouse.java
@@ -10,85 +10,83 @@
******************************************************************************/
package gtPlusPlus.xmod.forestry.bees.inventory;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-
import forestry.api.apiculture.*;
import forestry.apiculture.InventoryBeeHousing;
import forestry.apiculture.inventory.IApiaryInventory;
import forestry.core.access.IAccessHandler;
import forestry.core.utils.SlotUtil;
+import java.util.ArrayList;
+import java.util.Collection;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
public class InventoryDenseBeeHouse extends InventoryBeeHousing implements IApiaryInventory {
- public static final int SLOT_FRAMES_1 = 9;
- public static final int SLOT_FRAMES_COUNT = 3;
-
- public InventoryDenseBeeHouse(IAccessHandler accessHandler) {
- super(12, accessHandler);
- }
-
- @Override
- public boolean canSlotAccept(int slotIndex, ItemStack itemStack) {
- if (SlotUtil.isSlotInRange(slotIndex, SLOT_FRAMES_1, SLOT_FRAMES_COUNT)) {
- return (itemStack.getItem() instanceof IHiveFrame) && (getStackInSlot(slotIndex) == null);
- }
-
- return super.canSlotAccept(slotIndex, itemStack);
- }
-
- // override for pipe automation
- @Override
- public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack) {
- if (SlotUtil.isSlotInRange(slotIndex, SLOT_FRAMES_1, SLOT_FRAMES_COUNT)) {
- return false;
- }
- return super.isItemValidForSlot(slotIndex, itemStack);
- }
-
- public Collection<IHiveFrame> getFrames() {
- Collection<IHiveFrame> hiveFrames = new ArrayList<>(SLOT_FRAMES_COUNT);
-
- for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
- ItemStack stackInSlot = getStackInSlot(i);
- if (stackInSlot == null) {
- continue;
- }
-
- Item itemInSlot = stackInSlot.getItem();
- if (itemInSlot instanceof IHiveFrame) {
- hiveFrames.add((IHiveFrame) itemInSlot);
- }
- }
-
- return hiveFrames;
- }
-
- @Override
- public void wearOutFrames(IBeeHousing beeHousing, int amount) {
- IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(beeHousing.getWorld());
- int wear = Math.round(amount * beekeepingMode.getWearModifier());
-
- for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
- ItemStack hiveFrameStack = getStackInSlot(i);
- if (hiveFrameStack == null) {
- continue;
- }
-
- Item hiveFrameItem = hiveFrameStack.getItem();
- if (!(hiveFrameItem instanceof IHiveFrame)) {
- continue;
- }
-
- IHiveFrame hiveFrame = (IHiveFrame) hiveFrameItem;
-
- ItemStack queenStack = getQueen();
- IBee queen = BeeManager.beeRoot.getMember(queenStack);
- ItemStack usedFrame = hiveFrame.frameUsed(beeHousing, hiveFrameStack, queen, wear);
-
- setInventorySlotContents(i, usedFrame);
- }
- }
+ public static final int SLOT_FRAMES_1 = 9;
+ public static final int SLOT_FRAMES_COUNT = 3;
+
+ public InventoryDenseBeeHouse(IAccessHandler accessHandler) {
+ super(12, accessHandler);
+ }
+
+ @Override
+ public boolean canSlotAccept(int slotIndex, ItemStack itemStack) {
+ if (SlotUtil.isSlotInRange(slotIndex, SLOT_FRAMES_1, SLOT_FRAMES_COUNT)) {
+ return (itemStack.getItem() instanceof IHiveFrame) && (getStackInSlot(slotIndex) == null);
+ }
+
+ return super.canSlotAccept(slotIndex, itemStack);
+ }
+
+ // override for pipe automation
+ @Override
+ public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack) {
+ if (SlotUtil.isSlotInRange(slotIndex, SLOT_FRAMES_1, SLOT_FRAMES_COUNT)) {
+ return false;
+ }
+ return super.isItemValidForSlot(slotIndex, itemStack);
+ }
+
+ public Collection<IHiveFrame> getFrames() {
+ Collection<IHiveFrame> hiveFrames = new ArrayList<>(SLOT_FRAMES_COUNT);
+
+ for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
+ ItemStack stackInSlot = getStackInSlot(i);
+ if (stackInSlot == null) {
+ continue;
+ }
+
+ Item itemInSlot = stackInSlot.getItem();
+ if (itemInSlot instanceof IHiveFrame) {
+ hiveFrames.add((IHiveFrame) itemInSlot);
+ }
+ }
+
+ return hiveFrames;
+ }
+
+ @Override
+ public void wearOutFrames(IBeeHousing beeHousing, int amount) {
+ IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(beeHousing.getWorld());
+ int wear = Math.round(amount * beekeepingMode.getWearModifier());
+
+ for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
+ ItemStack hiveFrameStack = getStackInSlot(i);
+ if (hiveFrameStack == null) {
+ continue;
+ }
+
+ Item hiveFrameItem = hiveFrameStack.getItem();
+ if (!(hiveFrameItem instanceof IHiveFrame)) {
+ continue;
+ }
+
+ IHiveFrame hiveFrame = (IHiveFrame) hiveFrameItem;
+
+ ItemStack queenStack = getQueen();
+ IBee queen = BeeManager.beeRoot.getMember(queenStack);
+ ItemStack usedFrame = hiveFrame.frameUsed(beeHousing, hiveFrameStack, queen, wear);
+
+ setInventorySlotContents(i, usedFrame);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java
index e1d37ab463..00062dc0ec 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java
@@ -9,99 +9,120 @@
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package gtPlusPlus.xmod.forestry.bees.items;
+
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import forestry.core.utils.StringUtil;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandomChestContent;
-
-import forestry.core.utils.StringUtil;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.lib.LoadedMods;
import net.minecraftforge.common.ChestGenHooks;
public class FR_ItemRegistry {
+ // ----- Apiary Frames ----------------------
+ // public static FR_ItemHiveFrame frameUntreated;
+ // public static FR_ItemHiveFrame frameImpregnated;
+ // public static FR_ItemHiveFrame frameProven;
- //----- Apiary Frames ----------------------
- //public static FR_ItemHiveFrame frameUntreated;
- //public static FR_ItemHiveFrame frameImpregnated;
- //public static FR_ItemHiveFrame frameProven;
+ // Magic Bee Frame Items
+ public static MB_ItemFrame hiveFrameAccelerated;
+ public static MB_ItemFrame hiveFrameVoid;
+ public static MB_ItemFrame hiveFrameMutagenic;
+ public static MB_ItemFrame hiveFrameBusy;
- //Magic Bee Frame Items
- public static MB_ItemFrame hiveFrameAccelerated;
- public static MB_ItemFrame hiveFrameVoid;
- public static MB_ItemFrame hiveFrameMutagenic;
- public static MB_ItemFrame hiveFrameBusy;
+ // Extra Bee Frame Items
+ public static MB_ItemFrame hiveFrameCocoa;
+ public static MB_ItemFrame hiveFrameCaged;
+ public static MB_ItemFrame hiveFrameSoul;
+ public static MB_ItemFrame hiveFrameClay;
+ public static MB_ItemFrame hiveFrameNova;
- //Extra Bee Frame Items
- public static MB_ItemFrame hiveFrameCocoa;
- public static MB_ItemFrame hiveFrameCaged;
- public static MB_ItemFrame hiveFrameSoul;
- public static MB_ItemFrame hiveFrameClay;
- public static MB_ItemFrame hiveFrameNova;
-
- // Frame Items added by bartimaeusnek
- public static MB_ItemFrame hiveFrameDecay;
- public static MB_ItemFrame hiveFrameSlow;
- public static MB_ItemFrame hiveFrameStalilize;
- public static MB_ItemFrame hiveFrameArborist;
-
- @Optional.Method(modid = "Forestry")
- public static void Register() {
+ // Frame Items added by bartimaeusnek
+ public static MB_ItemFrame hiveFrameDecay;
+ public static MB_ItemFrame hiveFrameSlow;
+ public static MB_ItemFrame hiveFrameStalilize;
+ public static MB_ItemFrame hiveFrameArborist;
- //Forestry Frames
- //frameUntreated = registerItem(new FR_ItemHiveFrame(80, 0.9f), "frameUntreated");
- //frameImpregnated = registerItem(new FR_ItemHiveFrame(240, 0.4f), "frameImpregnated");
- //frameProven = registerItem(new FR_ItemHiveFrame(720, 0.3f), "frameProven");
+ @Optional.Method(modid = "Forestry")
+ public static void Register() {
- //Magic Bee like Frames
-
- if (!CORE.GTNH) {
- hiveFrameVoid = new MB_ItemFrame(MB_FrameType.VOID, EnumRarity.rare, "Makes your bee die in the blink of an eye.");
- }
- else {
- hiveFrameVoid = new MB_ItemFrame(MB_FrameType.USELESS, EnumRarity.common, "No more cheaty frames for GTNH players.");
- }
-
- hiveFrameAccelerated = new MB_ItemFrame(MB_FrameType.ACCELERATED, "Longevity for bees isn't very common, especially if they're working harder.");
- hiveFrameMutagenic = new MB_ItemFrame(MB_FrameType.MUTAGENIC, EnumRarity.epic, "Evolution of the fittest, finest and fastest.");
- hiveFrameBusy = new MB_ItemFrame(MB_FrameType.BUSY, "Your bee will work harder and longer than you expected.");
- ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_CORRIDOR, new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 1, 14));
- ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY, new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 3, 18));
- ChestGenHooks.addItem(ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 1, 14));
- ChestGenHooks.addItem(ChestGenHooks.MINESHAFT_CORRIDOR, new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 1, 9));
- ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST, new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 1, 9));
- ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST, new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 3, 12));
- ChestGenHooks.addItem(ChestGenHooks.MINESHAFT_CORRIDOR, new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 3, 8));
- ChestGenHooks.addItem(ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 3, 12));
+ // Forestry Frames
+ // frameUntreated = registerItem(new FR_ItemHiveFrame(80, 0.9f), "frameUntreated");
+ // frameImpregnated = registerItem(new FR_ItemHiveFrame(240, 0.4f), "frameImpregnated");
+ // frameProven = registerItem(new FR_ItemHiveFrame(720, 0.3f), "frameProven");
- //Extra Bee like Frames
- if (!LoadedMods.ExtraBees){
- hiveFrameCocoa = new MB_ItemFrame(MB_FrameType.COCOA, EnumRarity.common, "");
- hiveFrameCaged = new MB_ItemFrame(MB_FrameType.CAGE, EnumRarity.common, "");
- hiveFrameSoul = new MB_ItemFrame(MB_FrameType.SOUL, EnumRarity.common, "");
- hiveFrameClay = new MB_ItemFrame(MB_FrameType.CLAY, EnumRarity.common, "");
- hiveFrameNova = new MB_ItemFrame(MB_FrameType.NOVA, EnumRarity.epic, "A Creative Only Frame.");
- }
-
- // Frame Items added by bartimaeusnek
- hiveFrameDecay = new MB_ItemFrame(MB_FrameType.DECAYING, EnumRarity.uncommon, "Who really needs stable genetics?");
- hiveFrameSlow = new MB_ItemFrame(MB_FrameType.SLOWING, EnumRarity.common, "The journey is its own reward.");
- hiveFrameStalilize = new MB_ItemFrame(MB_FrameType.STABILIZING, EnumRarity.rare, "If you wish your bees to keep their form.");
- hiveFrameArborist = new MB_ItemFrame(MB_FrameType.ARBORISTS, EnumRarity.common, "Who need Bees when you can have Trees?");
- ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST, new WeightedRandomChestContent(new ItemStack(hiveFrameArborist), 1, 4, 24));
- ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY, new WeightedRandomChestContent(new ItemStack(hiveFrameSlow), 1, 4, 24));
- }
+ // Magic Bee like Frames
- protected static <T extends Item> T registerItem(final T item, final String name) {
- item.setUnlocalizedName(name);
- GameRegistry.registerItem(item, StringUtil.cleanItemName(item));
- return item;
- }
+ if (!CORE.GTNH) {
+ hiveFrameVoid =
+ new MB_ItemFrame(MB_FrameType.VOID, EnumRarity.rare, "Makes your bee die in the blink of an eye.");
+ } else {
+ hiveFrameVoid = new MB_ItemFrame(
+ MB_FrameType.USELESS, EnumRarity.common, "No more cheaty frames for GTNH players.");
+ }
-}
+ hiveFrameAccelerated = new MB_ItemFrame(
+ MB_FrameType.ACCELERATED,
+ "Longevity for bees isn't very common, especially if they're working harder.");
+ hiveFrameMutagenic = new MB_ItemFrame(
+ MB_FrameType.MUTAGENIC, EnumRarity.epic, "Evolution of the fittest, finest and fastest.");
+ hiveFrameBusy = new MB_ItemFrame(MB_FrameType.BUSY, "Your bee will work harder and longer than you expected.");
+ ChestGenHooks.addItem(
+ ChestGenHooks.STRONGHOLD_CORRIDOR,
+ new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 1, 14));
+ ChestGenHooks.addItem(
+ ChestGenHooks.STRONGHOLD_LIBRARY,
+ new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 3, 18));
+ ChestGenHooks.addItem(
+ ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 1, 14));
+ ChestGenHooks.addItem(
+ ChestGenHooks.MINESHAFT_CORRIDOR,
+ new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 1, 9));
+ ChestGenHooks.addItem(
+ ChestGenHooks.PYRAMID_DESERT_CHEST,
+ new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 1, 9));
+ ChestGenHooks.addItem(
+ ChestGenHooks.PYRAMID_JUNGLE_CHEST,
+ new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 3, 12));
+ ChestGenHooks.addItem(
+ ChestGenHooks.MINESHAFT_CORRIDOR,
+ new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 3, 8));
+ ChestGenHooks.addItem(
+ ChestGenHooks.DUNGEON_CHEST,
+ new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 3, 12));
+
+ // Extra Bee like Frames
+ if (!LoadedMods.ExtraBees) {
+ hiveFrameCocoa = new MB_ItemFrame(MB_FrameType.COCOA, EnumRarity.common, "");
+ hiveFrameCaged = new MB_ItemFrame(MB_FrameType.CAGE, EnumRarity.common, "");
+ hiveFrameSoul = new MB_ItemFrame(MB_FrameType.SOUL, EnumRarity.common, "");
+ hiveFrameClay = new MB_ItemFrame(MB_FrameType.CLAY, EnumRarity.common, "");
+ hiveFrameNova = new MB_ItemFrame(MB_FrameType.NOVA, EnumRarity.epic, "A Creative Only Frame.");
+ }
+ // Frame Items added by bartimaeusnek
+ hiveFrameDecay =
+ new MB_ItemFrame(MB_FrameType.DECAYING, EnumRarity.uncommon, "Who really needs stable genetics?");
+ hiveFrameSlow = new MB_ItemFrame(MB_FrameType.SLOWING, EnumRarity.common, "The journey is its own reward.");
+ hiveFrameStalilize = new MB_ItemFrame(
+ MB_FrameType.STABILIZING, EnumRarity.rare, "If you wish your bees to keep their form.");
+ hiveFrameArborist =
+ new MB_ItemFrame(MB_FrameType.ARBORISTS, EnumRarity.common, "Who need Bees when you can have Trees?");
+ ChestGenHooks.addItem(
+ ChestGenHooks.PYRAMID_JUNGLE_CHEST,
+ new WeightedRandomChestContent(new ItemStack(hiveFrameArborist), 1, 4, 24));
+ ChestGenHooks.addItem(
+ ChestGenHooks.STRONGHOLD_LIBRARY,
+ new WeightedRandomChestContent(new ItemStack(hiveFrameSlow), 1, 4, 24));
+ }
+ protected static <T extends Item> T registerItem(final T item, final String name) {
+ item.setUnlocalizedName(name);
+ GameRegistry.registerItem(item, StringUtil.cleanItemName(item));
+ return item;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java
index e075bf1eda..4312e36714 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java
@@ -2,23 +2,18 @@ package gtPlusPlus.xmod.forestry.bees.items;
import net.minecraft.util.StatCollector;
-public class FR_StringUtil
-{
- public static String getLocalizedString(final String key)
- {
- if(StatCollector.canTranslate(key))
- {
- return StatCollector.translateToLocal(key);
- }
- return StatCollector.translateToFallback(key);
- }
+public class FR_StringUtil {
+ public static String getLocalizedString(final String key) {
+ if (StatCollector.canTranslate(key)) {
+ return StatCollector.translateToLocal(key);
+ }
+ return StatCollector.translateToFallback(key);
+ }
- public static String getLocalizedString(final String key, final Object... objects)
- {
- if(StatCollector.canTranslate(key))
- {
- return String.format(StatCollector.translateToLocal(key), objects);
- }
- return String.format(StatCollector.translateToFallback(key), objects);
- }
+ public static String getLocalizedString(final String key, final Object... objects) {
+ if (StatCollector.canTranslate(key)) {
+ return String.format(StatCollector.translateToLocal(key), objects);
+ }
+ return String.format(StatCollector.translateToFallback(key), objects);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java
index 1016021e44..dcbb8b94a1 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java
@@ -3,124 +3,136 @@ package gtPlusPlus.xmod.forestry.bees.items;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeModifier;
-public enum MB_FrameType implements IBeeModifier
-{
- //ExtraBees Clone Frames
- //Name, FrameHP, territory (1f), Mutation rate, lifespan rate, production rate, genetic decay (1f)
- COCOA("Chocolate", 240, 1.0f, 1.0f, 0.50f, 1.50f, 1f),
- CAGE("Restraint", 240, 0.5f, 1.0f, 0.75f, 0.75f, 1f),
- SOUL("Soul", 80, 1.0f, 1.5f, 0.75f, 0.25f, 1f),
- CLAY("Healing", 240, 1.0f, 0.5f, 1.50f, 0.75f, 1f),
- NOVA("Nova", 240, 1.0f, 100.0f, 0.0001f, 1.00f, 1f),
-
-
- //Name, FrameHP, territory (1f), Mutation rate, lifespan rate, production rate, genetic decay (1f)
- ACCELERATED("Accelerated", 175, 1f, 1.2f, 0.9f, 1.8f, 1f),
- VOID("Void", 20, 1f, 1f, 0.0001f, 10f, 1f),
- MUTAGENIC("Mutagenic", 3, 1f, 5f, 0.0001f, 10f, 1f),
- BUSY("Busy", 2000, 1f, 0f, 3f, 4f, 1f),
- USELESS("Useless", 100, 1f, 0f, 1f, 1f, 1f),
-
- // Frame Items added by bartimaeusnek
- DECAYING("Decaying", 240, 1f, 1f, 1f, 1f, 10f), //enhanches decay to 10x
- SLOWING("Slowing", 175, 1f, 0.5f, 2f, 0.5f, 1f), //reduces mutation, production rate and enhanches lifespan
- STABILIZING("Stabilizing", 60, 1f, 0.1f, 1f, 0.1f, 0.5f), //reduces mutation, production and decay
- ARBORISTS("Arborists", 240, 3f, 0f, 3f, 0f, 1f); //3x territory and lifespan, sets mutation and production to zero
-
- private final String frameName;
- public final int maxDamage;
-
- private final float territoryMod;
- private final float mutationMod;
- private final float lifespanMod;
- private final float productionMod;
- private final float floweringMod;
- private final float geneticDecayMod;
- private final boolean isSealed;
- private final boolean isLit;
- private final boolean isSunlit;
- private final boolean isHellish;
-
- MB_FrameType(final String name, final int damage, final float territory, final float mutation, final float lifespan, final float production, final float geneticDecay) {
- this(name, damage, territory, mutation, lifespan, production, 1f, geneticDecay, false, false, false, false);
- }
-
- MB_FrameType(final String name, final int damage,
- final float territory, final float mutation, final float lifespan, final float production, final float flowering, final float geneticDecay,
- final boolean sealed, final boolean lit, final boolean sunlit, final boolean hellish)
- {
- this.frameName = name;
- this.maxDamage = damage;
-
- this.territoryMod = territory;
- this.mutationMod = mutation;
- this.lifespanMod = lifespan;
- this.productionMod = production;
- this.floweringMod = flowering;
- this.geneticDecayMod = geneticDecay;
- this.isSealed = sealed;
- this.isLit = lit;
- this.isSunlit = sunlit;
- this.isHellish = hellish;
- }
-
- public String getName()
- {
- return this.frameName;
- }
-
- public String getLocalizedName()
- {
- return FR_StringUtil.getLocalizedString("frame." + this.frameName);
- }
-
- @Override
- public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
- return this.territoryMod;
- }
-
- @Override
- public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
- return this.mutationMod;
- }
-
- @Override
- public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
- return this.lifespanMod;
- }
-
- @Override
- public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
- return this.productionMod;
- }
-
- @Override
- public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
- return this.floweringMod;
- }
-
- @Override
- public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
- return this.geneticDecayMod;
- }
-
- @Override
- public boolean isSealed() {
- return this.isSealed;
- }
-
- @Override
- public boolean isSelfLighted() {
- return this.isLit;
- }
-
- @Override
- public boolean isSunlightSimulated() {
- return this.isSunlit;
- }
-
- @Override
- public boolean isHellish() {
- return this.isHellish;
- }
+public enum MB_FrameType implements IBeeModifier {
+ // ExtraBees Clone Frames
+ // Name, FrameHP, territory (1f), Mutation rate, lifespan rate, production rate, genetic decay (1f)
+ COCOA("Chocolate", 240, 1.0f, 1.0f, 0.50f, 1.50f, 1f),
+ CAGE("Restraint", 240, 0.5f, 1.0f, 0.75f, 0.75f, 1f),
+ SOUL("Soul", 80, 1.0f, 1.5f, 0.75f, 0.25f, 1f),
+ CLAY("Healing", 240, 1.0f, 0.5f, 1.50f, 0.75f, 1f),
+ NOVA("Nova", 240, 1.0f, 100.0f, 0.0001f, 1.00f, 1f),
+
+ // Name, FrameHP, territory (1f), Mutation rate, lifespan rate, production rate, genetic decay (1f)
+ ACCELERATED("Accelerated", 175, 1f, 1.2f, 0.9f, 1.8f, 1f),
+ VOID("Void", 20, 1f, 1f, 0.0001f, 10f, 1f),
+ MUTAGENIC("Mutagenic", 3, 1f, 5f, 0.0001f, 10f, 1f),
+ BUSY("Busy", 2000, 1f, 0f, 3f, 4f, 1f),
+ USELESS("Useless", 100, 1f, 0f, 1f, 1f, 1f),
+
+ // Frame Items added by bartimaeusnek
+ DECAYING("Decaying", 240, 1f, 1f, 1f, 1f, 10f), // enhanches decay to 10x
+ SLOWING("Slowing", 175, 1f, 0.5f, 2f, 0.5f, 1f), // reduces mutation, production rate and enhanches lifespan
+ STABILIZING("Stabilizing", 60, 1f, 0.1f, 1f, 0.1f, 0.5f), // reduces mutation, production and decay
+ ARBORISTS("Arborists", 240, 3f, 0f, 3f, 0f, 1f); // 3x territory and lifespan, sets mutation and production to zero
+
+ private final String frameName;
+ public final int maxDamage;
+
+ private final float territoryMod;
+ private final float mutationMod;
+ private final float lifespanMod;
+ private final float productionMod;
+ private final float floweringMod;
+ private final float geneticDecayMod;
+ private final boolean isSealed;
+ private final boolean isLit;
+ private final boolean isSunlit;
+ private final boolean isHellish;
+
+ MB_FrameType(
+ final String name,
+ final int damage,
+ final float territory,
+ final float mutation,
+ final float lifespan,
+ final float production,
+ final float geneticDecay) {
+ this(name, damage, territory, mutation, lifespan, production, 1f, geneticDecay, false, false, false, false);
+ }
+
+ MB_FrameType(
+ final String name,
+ final int damage,
+ final float territory,
+ final float mutation,
+ final float lifespan,
+ final float production,
+ final float flowering,
+ final float geneticDecay,
+ final boolean sealed,
+ final boolean lit,
+ final boolean sunlit,
+ final boolean hellish) {
+ this.frameName = name;
+ this.maxDamage = damage;
+
+ this.territoryMod = territory;
+ this.mutationMod = mutation;
+ this.lifespanMod = lifespan;
+ this.productionMod = production;
+ this.floweringMod = flowering;
+ this.geneticDecayMod = geneticDecay;
+ this.isSealed = sealed;
+ this.isLit = lit;
+ this.isSunlit = sunlit;
+ this.isHellish = hellish;
+ }
+
+ public String getName() {
+ return this.frameName;
+ }
+
+ public String getLocalizedName() {
+ return FR_StringUtil.getLocalizedString("frame." + this.frameName);
+ }
+
+ @Override
+ public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
+ return this.territoryMod;
+ }
+
+ @Override
+ public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
+ return this.mutationMod;
+ }
+
+ @Override
+ public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
+ return this.lifespanMod;
+ }
+
+ @Override
+ public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
+ return this.productionMod;
+ }
+
+ @Override
+ public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
+ return this.floweringMod;
+ }
+
+ @Override
+ public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
+ return this.geneticDecayMod;
+ }
+
+ @Override
+ public boolean isSealed() {
+ return this.isSealed;
+ }
+
+ @Override
+ public boolean isSelfLighted() {
+ return this.isLit;
+ }
+
+ @Override
+ public boolean isSunlightSimulated() {
+ return this.isSunlit;
+ }
+
+ @Override
+ public boolean isHellish() {
+ return this.isHellish;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java
index 65b6977b8a..db2a8e317f 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java
@@ -1,11 +1,12 @@
package gtPlusPlus.xmod.forestry.bees.items;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import forestry.api.apiculture.*;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -13,131 +14,121 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import forestry.api.apiculture.*;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-
-public class MB_ItemFrame extends Item implements IHiveFrame
-{
- private final MB_FrameType type;
- private EnumRarity rarity_value = EnumRarity.uncommon;
- private final String toolTip;
-
- public MB_ItemFrame(final MB_FrameType frameType, final String description)
- {
- this(frameType, EnumRarity.uncommon, description);
- }
-
- public MB_ItemFrame(final MB_FrameType frameType, final EnumRarity rarity, final String description)
- {
- super();
- this.type = frameType;
- this.setMaxDamage(this.type.maxDamage);
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName("frame" + frameType.getName());
- this.rarity_value = rarity;
- this.toolTip = description;
- GameRegistry.registerItem(this, "frame" + frameType.getName());
- }
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if ((this.toolTip != "") || !this.toolTip.equals("")){
- list.add(EnumChatFormatting.GRAY+this.toolTip);
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister par1IconRegister)
- {
- this.itemIcon = par1IconRegister.registerIcon(CORE.MODID + ":frame" + this.type.getName());
- }
-
- // --------- IHiveFrame functions -----------------------------------------
-
- @Override
- public ItemStack frameUsed(final IBeeHousing housing, ItemStack frame, final IBee queen, final int wear) {
- frame.setItemDamage(frame.getItemDamage() + wear);
-
- if (frame.getItemDamage() >= frame.getMaxDamage()) {
- // Break the frame.
- frame = null;
- }
-
- return frame;
- }
-
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack){
- return this.rarity_value;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack){
- if ((this.rarity_value == EnumRarity.uncommon) || (this.rarity_value == EnumRarity.common)){
- return false;
- }
- return true;
- }
-
- @Override
- public IBeeModifier getBeeModifier() {
- return this.type;
- }
-
- @Override
- public boolean isBookEnchantable(final ItemStack itemstack1, final ItemStack itemstack2) {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
- return this.type.getTerritoryModifier(genome, currentModifier);
- }
-
- public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
- return this.type.getMutationModifier(genome, mate, currentModifier);
- }
-
- public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
- return this.type.getLifespanModifier(genome, mate, currentModifier);
- }
-
- public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
- return this.type.getProductionModifier(genome, currentModifier);
- }
-
- public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
- return this.type.getFloweringModifier(genome, currentModifier);
- }
-
- public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
- return this.type.getGeneticDecay(genome, currentModifier);
- }
-
- public boolean isSealed() {
- return this.type.isSealed();
- }
-
- public boolean isSelfLighted() {
- return this.type.isSelfLighted();
- }
-
- public boolean isSunlightSimulated() {
- return this.type.isSunlightSimulated();
- }
-
- public boolean isHellish(){
- return this.type.isHellish();
- }
-
+public class MB_ItemFrame extends Item implements IHiveFrame {
+ private final MB_FrameType type;
+ private EnumRarity rarity_value = EnumRarity.uncommon;
+ private final String toolTip;
+
+ public MB_ItemFrame(final MB_FrameType frameType, final String description) {
+ this(frameType, EnumRarity.uncommon, description);
+ }
+
+ public MB_ItemFrame(final MB_FrameType frameType, final EnumRarity rarity, final String description) {
+ super();
+ this.type = frameType;
+ this.setMaxDamage(this.type.maxDamage);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName("frame" + frameType.getName());
+ this.rarity_value = rarity;
+ this.toolTip = description;
+ GameRegistry.registerItem(this, "frame" + frameType.getName());
+ }
+
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if ((this.toolTip != "") || !this.toolTip.equals("")) {
+ list.add(EnumChatFormatting.GRAY + this.toolTip);
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(final IIconRegister par1IconRegister) {
+ this.itemIcon = par1IconRegister.registerIcon(CORE.MODID + ":frame" + this.type.getName());
+ }
+
+ // --------- IHiveFrame functions -----------------------------------------
+
+ @Override
+ public ItemStack frameUsed(final IBeeHousing housing, ItemStack frame, final IBee queen, final int wear) {
+ frame.setItemDamage(frame.getItemDamage() + wear);
+
+ if (frame.getItemDamage() >= frame.getMaxDamage()) {
+ // Break the frame.
+ frame = null;
+ }
+
+ return frame;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ return this.rarity_value;
+ }
+
+ @Override
+ public boolean hasEffect(final ItemStack par1ItemStack) {
+ if ((this.rarity_value == EnumRarity.uncommon) || (this.rarity_value == EnumRarity.common)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public IBeeModifier getBeeModifier() {
+ return this.type;
+ }
+
+ @Override
+ public boolean isBookEnchantable(final ItemStack itemstack1, final ItemStack itemstack2) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
+ return this.type.getTerritoryModifier(genome, currentModifier);
+ }
+
+ public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
+ return this.type.getMutationModifier(genome, mate, currentModifier);
+ }
+
+ public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
+ return this.type.getLifespanModifier(genome, mate, currentModifier);
+ }
+
+ public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
+ return this.type.getProductionModifier(genome, currentModifier);
+ }
+
+ public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
+ return this.type.getFloweringModifier(genome, currentModifier);
+ }
+
+ public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
+ return this.type.getGeneticDecay(genome, currentModifier);
+ }
+
+ public boolean isSealed() {
+ return this.type.isSealed();
+ }
+
+ public boolean isSelfLighted() {
+ return this.type.isSelfLighted();
+ }
+
+ public boolean isSunlightSimulated() {
+ return this.type.isSunlightSimulated();
+ }
+
+ public boolean isHellish() {
+ return this.type.isHellish();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java
index 26b32c8b22..df1b3be843 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java
@@ -1,138 +1,129 @@
package gtPlusPlus.xmod.forestry.bees.items.output;
-import static gregtech.api.enums.GT_Values.L;
-import static gregtech.api.enums.GT_Values.NF;
-import static gregtech.api.enums.GT_Values.NI;
-import static gregtech.api.enums.GT_Values.RA;
-import static gregtech.api.enums.GT_Values.V;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableMap.Builder;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs;
-import forestry.api.recipes.RecipeManagers;
-import gregtech.GT_Mod;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_CombType;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_PropolisType;
import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class GTPP_Comb extends Item {
- @SideOnly(Side.CLIENT)
- private IIcon secondIcon;
-
- public GTPP_Comb() {
- super();
- this.setCreativeTab(Tabs.tabApiculture);
- this.setHasSubtypes(true);
- this.setUnlocalizedName("gtpp.comb");
- GameRegistry.registerItem(this, "gtpp.comb", CORE.MODID);
- }
-
- public ItemStack getStackForType(GTPP_CombType type) {
- return new ItemStack(this, 1, type.mID);
- }
-
- public ItemStack getStackForType(GTPP_CombType type, int count) {
- return new ItemStack(this, count, type.mID);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item item, CreativeTabs tabs, List list) {
- for (GTPP_CombType type : GTPP_CombType.values()) {
- if (type.mShowInList) {
- list.add(this.getStackForType(type));
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
- @Override
- public int getRenderPasses(int meta) {
- return 2;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister par1IconRegister) {
- this.itemIcon = par1IconRegister.registerIcon("forestry:beeCombs.0");
- this.secondIcon = par1IconRegister.registerIcon("forestry:beeCombs.1");
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return (pass == 0) ? itemIcon : secondIcon;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack stack, int pass) {
- int colour = GTPP_CombType.get(stack.getItemDamage()).getColours()[0];
-
- if (pass >= 1) {
- colour = GTPP_CombType.get(stack.getItemDamage()).getColours()[1];
- }
-
- return colour;
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack stack) {
- return GTPP_CombType.get(stack.getItemDamage()).getName();
- }
-
- public static void initCombsRecipes() {
-
- addChemicalRecipe(GTPP_CombType.DRAGONBLOOD, new ItemStack[]{GT_ModHandler.getModItem("Forestry", "refractoryWax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.DRAGONBLOOD), GTPP_Bees.drop.getStackForType(GTPP_DropType.DRAGONBLOOD)}, new int[]{3000, 1500, 500});
- addChemicalRecipe(GTPP_CombType.FORCE, new ItemStack[]{GT_ModHandler.getModItem("Forestry", "beeswax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.FORCE), GTPP_Bees.drop.getStackForType(GTPP_DropType.FORCE)}, new int[]{5000, 3000, 1000});
-
- }
-
- public static void addChemicalRecipe(GTPP_CombType aInputStack, ItemStack[] aOutputs, int[] aChances) {
- Material aMat = aInputStack.mMaterial;
- long aEU = aMat.vVoltageMultiplier;
- int aTier = Math.max(aMat.vTier/2, 1);
- CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- aInputStack.getStackForType(aTier),
- },
- new FluidStack[] {},
- aOutputs,
- new FluidStack[] {},
- aChances,
- aTier * 20 * 60,
- aEU,
- aTier);
-
- }
-
+ @SideOnly(Side.CLIENT)
+ private IIcon secondIcon;
+
+ public GTPP_Comb() {
+ super();
+ this.setCreativeTab(Tabs.tabApiculture);
+ this.setHasSubtypes(true);
+ this.setUnlocalizedName("gtpp.comb");
+ GameRegistry.registerItem(this, "gtpp.comb", CORE.MODID);
+ }
+
+ public ItemStack getStackForType(GTPP_CombType type) {
+ return new ItemStack(this, 1, type.mID);
+ }
+
+ public ItemStack getStackForType(GTPP_CombType type, int count) {
+ return new ItemStack(this, count, type.mID);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tabs, List list) {
+ for (GTPP_CombType type : GTPP_CombType.values()) {
+ if (type.mShowInList) {
+ list.add(this.getStackForType(type));
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+
+ @Override
+ public int getRenderPasses(int meta) {
+ return 2;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister) {
+ this.itemIcon = par1IconRegister.registerIcon("forestry:beeCombs.0");
+ this.secondIcon = par1IconRegister.registerIcon("forestry:beeCombs.1");
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return (pass == 0) ? itemIcon : secondIcon;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass) {
+ int colour = GTPP_CombType.get(stack.getItemDamage()).getColours()[0];
+
+ if (pass >= 1) {
+ colour = GTPP_CombType.get(stack.getItemDamage()).getColours()[1];
+ }
+
+ return colour;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack stack) {
+ return GTPP_CombType.get(stack.getItemDamage()).getName();
+ }
+
+ public static void initCombsRecipes() {
+
+ addChemicalRecipe(
+ GTPP_CombType.DRAGONBLOOD,
+ new ItemStack[] {
+ GT_ModHandler.getModItem("Forestry", "refractoryWax", 1L, 0),
+ GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.DRAGONBLOOD),
+ GTPP_Bees.drop.getStackForType(GTPP_DropType.DRAGONBLOOD)
+ },
+ new int[] {3000, 1500, 500});
+ addChemicalRecipe(
+ GTPP_CombType.FORCE,
+ new ItemStack[] {
+ GT_ModHandler.getModItem("Forestry", "beeswax", 1L, 0),
+ GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.FORCE),
+ GTPP_Bees.drop.getStackForType(GTPP_DropType.FORCE)
+ },
+ new int[] {5000, 3000, 1000});
+ }
+
+ public static void addChemicalRecipe(GTPP_CombType aInputStack, ItemStack[] aOutputs, int[] aChances) {
+ Material aMat = aInputStack.mMaterial;
+ long aEU = aMat.vVoltageMultiplier;
+ int aTier = Math.max(aMat.vTier / 2, 1);
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ aInputStack.getStackForType(aTier),
+ },
+ new FluidStack[] {},
+ aOutputs,
+ new FluidStack[] {},
+ aChances,
+ aTier * 20 * 60,
+ aEU,
+ aTier);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java
index 922adad277..b32ac5c601 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.forestry.bees.items.output;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -11,6 +9,7 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType;
import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@@ -20,94 +19,96 @@ import net.minecraftforge.fluids.FluidStack;
public class GTPP_Drop extends Item {
- @SideOnly(Side.CLIENT)
- private IIcon secondIcon;
-
- public GTPP_Drop() {
- super();
- this.setCreativeTab(Tabs.tabApiculture);
- this.setHasSubtypes(true);
- this.setUnlocalizedName("gtpp.drop");
- GameRegistry.registerItem(this, "gtpp.drop", CORE.MODID);
- }
-
- public ItemStack getStackForType(GTPP_DropType type) {
- return new ItemStack(this, 1, type.mID);
- }
-
- public ItemStack getStackForType(GTPP_DropType type, int count) {
- return new ItemStack(this, count, type.mID);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item item, CreativeTabs tabs, List list) {
- for (GTPP_DropType type : GTPP_DropType.values()) {
- if (type.mShowInList) {
- list.add(this.getStackForType(type));
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
- @Override
- public int getRenderPasses(int meta) {
- return 2;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister par1IconRegister) {
- this.itemIcon = par1IconRegister.registerIcon("forestry:honeyDrop.0");
- this.secondIcon = par1IconRegister.registerIcon("forestry:honeyDrop.1");
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return (pass == 0) ? itemIcon : secondIcon;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack stack, int pass) {
- int colour = GTPP_DropType.get(stack.getItemDamage()).getColours()[0];
-
- if (pass >= 1) {
- colour = GTPP_DropType.get(stack.getItemDamage()).getColours()[1];
- }
-
- return colour;
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack stack) {
- return GTPP_DropType.get(stack.getItemDamage()).getName();
- }
-
- private static final int[] sFluidOutputs = new int[] {
- 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 48, 32, 16, 8, 4
- };
-
- public static void initDropsRecipes() {
- ItemStack tDrop;
- Logger.BEES("Processing recipes for "+GTPP_Bees.sDropMappings.size()+" Drops.");
- for (GTPP_DropType aDrop : GTPP_Bees.sDropMappings.values()) {
- tDrop = aDrop.getStackForType(1);
- if (addProcess(tDrop, new FluidStack(aDrop.mMaterial.getFluid(), sFluidOutputs[aDrop.mMaterial.vTier]), aDrop.mMaterial.vTier * 20 * 30, aDrop.mMaterial.vVoltageMultiplier)) {
- Logger.BEES("Added Drop extraction recipe for: "+aDrop.getName());
- }
- else {
- Logger.BEES("Failed to add Drop extraction recipe for: "+aDrop.getName());
- }
- }
- }
-
- public static boolean addProcess(ItemStack tDrop, FluidStack aOutput, int aDuration, int aEUt) {
- return GT_Values.RA.addFluidExtractionRecipe(tDrop, null, aOutput, 10000, aDuration, aEUt);
- }
+ @SideOnly(Side.CLIENT)
+ private IIcon secondIcon;
+
+ public GTPP_Drop() {
+ super();
+ this.setCreativeTab(Tabs.tabApiculture);
+ this.setHasSubtypes(true);
+ this.setUnlocalizedName("gtpp.drop");
+ GameRegistry.registerItem(this, "gtpp.drop", CORE.MODID);
+ }
+
+ public ItemStack getStackForType(GTPP_DropType type) {
+ return new ItemStack(this, 1, type.mID);
+ }
+
+ public ItemStack getStackForType(GTPP_DropType type, int count) {
+ return new ItemStack(this, count, type.mID);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tabs, List list) {
+ for (GTPP_DropType type : GTPP_DropType.values()) {
+ if (type.mShowInList) {
+ list.add(this.getStackForType(type));
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+
+ @Override
+ public int getRenderPasses(int meta) {
+ return 2;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister) {
+ this.itemIcon = par1IconRegister.registerIcon("forestry:honeyDrop.0");
+ this.secondIcon = par1IconRegister.registerIcon("forestry:honeyDrop.1");
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return (pass == 0) ? itemIcon : secondIcon;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass) {
+ int colour = GTPP_DropType.get(stack.getItemDamage()).getColours()[0];
+
+ if (pass >= 1) {
+ colour = GTPP_DropType.get(stack.getItemDamage()).getColours()[1];
+ }
+
+ return colour;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack stack) {
+ return GTPP_DropType.get(stack.getItemDamage()).getName();
+ }
+
+ private static final int[] sFluidOutputs =
+ new int[] {144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 48, 32, 16, 8, 4};
+
+ public static void initDropsRecipes() {
+ ItemStack tDrop;
+ Logger.BEES("Processing recipes for " + GTPP_Bees.sDropMappings.size() + " Drops.");
+ for (GTPP_DropType aDrop : GTPP_Bees.sDropMappings.values()) {
+ tDrop = aDrop.getStackForType(1);
+ if (addProcess(
+ tDrop,
+ new FluidStack(aDrop.mMaterial.getFluid(), sFluidOutputs[aDrop.mMaterial.vTier]),
+ aDrop.mMaterial.vTier * 20 * 30,
+ aDrop.mMaterial.vVoltageMultiplier)) {
+ Logger.BEES("Added Drop extraction recipe for: " + aDrop.getName());
+ } else {
+ Logger.BEES("Failed to add Drop extraction recipe for: " + aDrop.getName());
+ }
+ }
+ }
+
+ public static boolean addProcess(ItemStack tDrop, FluidStack aOutput, int aDuration, int aEUt) {
+ return GT_Values.RA.addFluidExtractionRecipe(tDrop, null, aOutput, 10000, aDuration, aEUt);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java
index 9d13ca7ebd..7fd8a7ec20 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java
@@ -1,13 +1,12 @@
package gtPlusPlus.xmod.forestry.bees.items.output;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_PollenType;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@@ -15,75 +14,73 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class GTPP_Pollen extends Item {
-
- @SideOnly(Side.CLIENT)
- private IIcon secondIcon;
-
- public GTPP_Pollen() {
- super();
- this.setCreativeTab(Tabs.tabApiculture);
- this.setHasSubtypes(true);
- this.setUnlocalizedName("gtpp.pollen");
- GameRegistry.registerItem(this, "gtpp.pollen", CORE.MODID);
- }
-
- public ItemStack getStackForType(GTPP_PollenType type) {
- return new ItemStack(this, 1, type.mID);
- }
- public ItemStack getStackForType(GTPP_PollenType type, int count) {
- return new ItemStack(this, count, type.mID);
- }
+ @SideOnly(Side.CLIENT)
+ private IIcon secondIcon;
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item item, CreativeTabs tabs, List list) {
- for (GTPP_PollenType type : GTPP_PollenType.values()) {
- if (type.mShowInList) {
- list.add(this.getStackForType(type));
- }
- }
- }
+ public GTPP_Pollen() {
+ super();
+ this.setCreativeTab(Tabs.tabApiculture);
+ this.setHasSubtypes(true);
+ this.setUnlocalizedName("gtpp.pollen");
+ GameRegistry.registerItem(this, "gtpp.pollen", CORE.MODID);
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
+ public ItemStack getStackForType(GTPP_PollenType type) {
+ return new ItemStack(this, 1, type.mID);
+ }
- @Override
- public int getRenderPasses(int meta) {
- return 2;
- }
+ public ItemStack getStackForType(GTPP_PollenType type, int count) {
+ return new ItemStack(this, count, type.mID);
+ }
- @Override
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tabs, List list) {
+ for (GTPP_PollenType type : GTPP_PollenType.values()) {
+ if (type.mShowInList) {
+ list.add(this.getStackForType(type));
+ }
+ }
+ }
+
+ @Override
@SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister par1IconRegister) {
- this.itemIcon = par1IconRegister.registerIcon("forestry:pollen.0");
- this.secondIcon = par1IconRegister.registerIcon("forestry:pollen.1");
- }
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return (pass == 0) ? itemIcon : secondIcon;
- }
+ @Override
+ public int getRenderPasses(int meta) {
+ return 2;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack stack, int pass) {
- int colour = GTPP_PollenType.get(stack.getItemDamage()).getColours()[0];
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister) {
+ this.itemIcon = par1IconRegister.registerIcon("forestry:pollen.0");
+ this.secondIcon = par1IconRegister.registerIcon("forestry:pollen.1");
+ }
- if (pass >= 1) {
- colour = GTPP_PollenType.get(stack.getItemDamage()).getColours()[1];
- }
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return (pass == 0) ? itemIcon : secondIcon;
+ }
- return colour;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass) {
+ int colour = GTPP_PollenType.get(stack.getItemDamage()).getColours()[0];
- @Override
- public String getItemStackDisplayName(ItemStack stack) {
- return GTPP_PollenType.get(stack.getItemDamage()).getName();
- }
+ if (pass >= 1) {
+ colour = GTPP_PollenType.get(stack.getItemDamage()).getColours()[1];
+ }
+ return colour;
+ }
+ @Override
+ public String getItemStackDisplayName(ItemStack stack) {
+ return GTPP_PollenType.get(stack.getItemDamage()).getName();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java
index fef721839b..e6976f0512 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java
@@ -1,16 +1,14 @@
package gtPlusPlus.xmod.forestry.bees.items.output;
-import java.util.List;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs;
-import gregtech.api.enums.GT_Values;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_PropolisType;
import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@@ -18,74 +16,77 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class GTPP_Propolis extends Item {
-
- @SideOnly(Side.CLIENT)
- private IIcon secondIcon;
- public GTPP_Propolis() {
- super();
- this.setCreativeTab(Tabs.tabApiculture);
- this.setHasSubtypes(true);
- this.setUnlocalizedName("gtpp.propolis");
- GameRegistry.registerItem(this, "gtpp.propolis", CORE.MODID);
- }
+ @SideOnly(Side.CLIENT)
+ private IIcon secondIcon;
- public ItemStack getStackForType(GTPP_PropolisType type) {
- return new ItemStack(this, 1, type.mID);
- }
+ public GTPP_Propolis() {
+ super();
+ this.setCreativeTab(Tabs.tabApiculture);
+ this.setHasSubtypes(true);
+ this.setUnlocalizedName("gtpp.propolis");
+ GameRegistry.registerItem(this, "gtpp.propolis", CORE.MODID);
+ }
- public ItemStack getStackForType(GTPP_PropolisType type, int count) {
- return new ItemStack(this, count, type.mID);
- }
+ public ItemStack getStackForType(GTPP_PropolisType type) {
+ return new ItemStack(this, 1, type.mID);
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item item, CreativeTabs tabs, List list) {
- for (GTPP_PropolisType type : GTPP_PropolisType.values()) {
- if (type.mShowInList) {
- list.add(this.getStackForType(type));
- }
- }
- }
+ public ItemStack getStackForType(GTPP_PropolisType type, int count) {
+ return new ItemStack(this, count, type.mID);
+ }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tabs, List list) {
+ for (GTPP_PropolisType type : GTPP_PropolisType.values()) {
+ if (type.mShowInList) {
+ list.add(this.getStackForType(type));
+ }
+ }
+ }
- @Override
+ @Override
@SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister par1IconRegister) {
- this.itemIcon = par1IconRegister.registerIcon("forestry:propolis.0");
- }
+ public void registerIcons(IIconRegister par1IconRegister) {
+ this.itemIcon = par1IconRegister.registerIcon("forestry:propolis.0");
+ }
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return itemIcon;
- }
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return itemIcon;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack stack, int pass) {
- return GTPP_PropolisType.get(stack.getItemDamage()).getColours();
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass) {
+ return GTPP_PropolisType.get(stack.getItemDamage()).getColours();
+ }
- @Override
- public String getItemStackDisplayName(ItemStack stack) {
- return GTPP_PropolisType.get(stack.getItemDamage()).getName();
- }
+ @Override
+ public String getItemStackDisplayName(ItemStack stack) {
+ return GTPP_PropolisType.get(stack.getItemDamage()).getName();
+ }
- public static void initPropolisRecipes() {
- ItemStack tDrop;
- Logger.BEES("Processing recipes for "+GTPP_Bees.sPropolisMappings.size()+" Propolis.");
- for (GTPP_PropolisType aProp : GTPP_Bees.sPropolisMappings.values()) {
- tDrop = aProp.getStackForType(1);
- if (addProcess(tDrop, aProp.mMaterial.getDust(1), Math.min(Math.max(10000-(aProp.mMaterial.vTier*625), 100), 10000), aProp.mMaterial.vTier * 20 * 15, aProp.mMaterial.vVoltageMultiplier)) {
- Logger.BEES("Added Propolis extraction recipe for: "+aProp.getName());
- }
- else {
- Logger.BEES("Failed to add Propolis extraction recipe for: "+aProp.getName());
- }
- }
- }
+ public static void initPropolisRecipes() {
+ ItemStack tDrop;
+ Logger.BEES("Processing recipes for " + GTPP_Bees.sPropolisMappings.size() + " Propolis.");
+ for (GTPP_PropolisType aProp : GTPP_Bees.sPropolisMappings.values()) {
+ tDrop = aProp.getStackForType(1);
+ if (addProcess(
+ tDrop,
+ aProp.mMaterial.getDust(1),
+ Math.min(Math.max(10000 - (aProp.mMaterial.vTier * 625), 100), 10000),
+ aProp.mMaterial.vTier * 20 * 15,
+ aProp.mMaterial.vVoltageMultiplier)) {
+ Logger.BEES("Added Propolis extraction recipe for: " + aProp.getName());
+ } else {
+ Logger.BEES("Failed to add Propolis extraction recipe for: " + aProp.getName());
+ }
+ }
+ }
- public static boolean addProcess(ItemStack tDrop, ItemStack aOutput, int aChance, int aDuration, int aEUt) {
- return CORE.RA.addExtractorRecipe(tDrop, aOutput, aChance, aDuration, aEUt);
- }
+ public static boolean addProcess(ItemStack tDrop, ItemStack aOutput, int aChance, int aDuration, int aEUt) {
+ return CORE.RA.addExtractorRecipe(tDrop, aOutput, aChance, aDuration, aEUt);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java
index ddc401f752..568508e06f 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java
@@ -1,129 +1,179 @@
package gtPlusPlus.xmod.forestry.bees.recipe;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
public class FR_Gregtech_Recipes {
- private static String rod_Electrum = "stickElectrum";
- private static String rod_LongElectrum = "stickLongElectrum";
- private static String foil_Electrum = "foilElectrum";
- private static String rod_Uranium = "stickUranium";
- private static String rod_LongUranium = "stickLongUranium";
- private static String foil_Uranium235 = "foilUranium235";
- private static ItemStack hiveFrameAccelerated = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameAccelerated);
- private static ItemStack hiveFrameMutagenic = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameMutagenic);
- private static ItemStack hiveFrameVoid = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameVoid);
- private static ItemStack hiveFrameBusy = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameBusy);
-
- private static ItemStack hiveFrameCocoa = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCocoa);
- private static ItemStack hiveFrameCaged = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCaged);
- private static ItemStack hiveFrameSoul = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameSoul);
- private static ItemStack hiveFrameClay = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameClay);
- private static ItemStack hiveFrameNova = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameNova);
-
- private static ItemStack hiveFrameImpregnated = ItemUtils.getItemStackFromFQRN("Forestry:frameImpregnated", 1);
- private static ItemStack blockSoulSand = new ItemStack(Blocks.soul_sand, 1);
- private static ItemStack blockIronBars = new ItemStack (Blocks.iron_bars, 1);
- private static ItemStack itemClayDust = new ItemStack(Items.clay_ball, 1);
- private static ItemStack itemCocoaBeans = new ItemStack(Items.dye, 1, 3);
-
- private static ItemStack hiveFrameDecay = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameDecay);
- private static ItemStack hiveFrameSlow = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameSlow);
- private static ItemStack hiveFrameStalilize = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameStalilize);
- private static ItemStack hiveFrameArborist = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameArborist);
-
- public static void registerItems(){
- //Magic Bee Like Frames
- RecipeUtils.addShapedGregtechRecipe(
- rod_LongElectrum, rod_Electrum, rod_LongElectrum,
- rod_LongElectrum, foil_Electrum, rod_LongElectrum,
- rod_Electrum, rod_Electrum, rod_Electrum,
- hiveFrameAccelerated);
-
- RecipeUtils.addShapedGregtechRecipe(
- rod_LongUranium, rod_Uranium, rod_LongUranium,
- rod_LongUranium, foil_Uranium235, rod_LongUranium,
- rod_Uranium, rod_Uranium, rod_Uranium,
- hiveFrameMutagenic);
- if (!CORE.GTNH) {
- RecipeUtils.addShapedGregtechRecipe(
- "stickLongThaumium", "stickThaumium", "stickLongThaumium",
- "stickLongThaumium", ItemUtils.getSimpleStack(Items.ender_pearl), "stickLongThaumium",
- "stickThaumium", "stickThaumium", "stickThaumium",
- hiveFrameVoid);
- }
- else {
- if (LoadedMods.MagicBees) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {hiveFrameVoid}, ItemUtils.getCorrectStacktype("MagicBees:frameOblivion", 1));
- }
- }
- RecipeUtils.addShapedGregtechRecipe(
- "stickLongBlueSteel", "stickBlueSteel", "stickLongBlueSteel",
- "stickLongBlueSteel", ItemUtils.getSimpleStack(Items.nether_star), "stickLongBlueSteel",
- "stickBlueSteel", "stickBlueSteel", "stickBlueSteel",
- hiveFrameBusy);
-
- if (!LoadedMods.ExtraBees){
- //Extra Bee Like Frames
- RecipeUtils.addShapedRecipe(
- null, itemCocoaBeans, null,
- itemCocoaBeans, hiveFrameImpregnated, itemCocoaBeans,
- null, itemCocoaBeans, null,
- hiveFrameCocoa);
-
- RecipeUtils.addShapedRecipe(
- hiveFrameImpregnated, blockIronBars, null,
- null, null, null,
- null, null, null,
- hiveFrameCaged);
-
- RecipeUtils.addShapedRecipe(
- hiveFrameImpregnated, blockSoulSand, null,
- null, null, null,
- null, null, null,
- hiveFrameSoul);
-
- RecipeUtils.addShapedRecipe(
- null, itemClayDust, null,
- itemClayDust, hiveFrameImpregnated, itemClayDust,
- null, itemClayDust, null,
- hiveFrameClay);
- }
-
- // Frame Items added by bartimaeusnek
- RecipeUtils.addShapedGregtechRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),foil_Electrum,ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),
- hiveFrameSlow);
-
- RecipeUtils.addShapedGregtechRecipe(
- "stickLongWroughtIron","stickWroughtIron","stickLongWroughtIron",
- "stickLongWroughtIron","foilZinc","stickLongWroughtIron",
- "stickWroughtIron","stickWroughtIron","stickWroughtIron",
- hiveFrameDecay);
-
- RecipeUtils.addShapedGregtechRecipe(
- "stickLongOsmiridium","stickOsmiridium","stickLongOsmiridium",
- "stickLongOsmiridium","foilOsmiridium","stickLongOsmiridium",
- "stickOsmiridium","stickOsmiridium","stickOsmiridium",
- hiveFrameStalilize);
-
- RecipeUtils.addShapedGregtechRecipe(
- "stickLongWoodSealed","stickWoodSealed","stickLongWoodSealed",
- "stickLongWoodSealed",Items.paper,"stickLongWoodSealed",
- "stickWoodSealed","stickWoodSealed","stickWoodSealed",
- hiveFrameArborist);
- }
-
+ private static String rod_Electrum = "stickElectrum";
+ private static String rod_LongElectrum = "stickLongElectrum";
+ private static String foil_Electrum = "foilElectrum";
+ private static String rod_Uranium = "stickUranium";
+ private static String rod_LongUranium = "stickLongUranium";
+ private static String foil_Uranium235 = "foilUranium235";
+ private static ItemStack hiveFrameAccelerated = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameAccelerated);
+ private static ItemStack hiveFrameMutagenic = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameMutagenic);
+ private static ItemStack hiveFrameVoid = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameVoid);
+ private static ItemStack hiveFrameBusy = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameBusy);
+
+ private static ItemStack hiveFrameCocoa = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCocoa);
+ private static ItemStack hiveFrameCaged = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCaged);
+ private static ItemStack hiveFrameSoul = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameSoul);
+ private static ItemStack hiveFrameClay = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameClay);
+ private static ItemStack hiveFrameNova = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameNova);
+
+ private static ItemStack hiveFrameImpregnated = ItemUtils.getItemStackFromFQRN("Forestry:frameImpregnated", 1);
+ private static ItemStack blockSoulSand = new ItemStack(Blocks.soul_sand, 1);
+ private static ItemStack blockIronBars = new ItemStack(Blocks.iron_bars, 1);
+ private static ItemStack itemClayDust = new ItemStack(Items.clay_ball, 1);
+ private static ItemStack itemCocoaBeans = new ItemStack(Items.dye, 1, 3);
+
+ private static ItemStack hiveFrameDecay = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameDecay);
+ private static ItemStack hiveFrameSlow = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameSlow);
+ private static ItemStack hiveFrameStalilize = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameStalilize);
+ private static ItemStack hiveFrameArborist = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameArborist);
+
+ public static void registerItems() {
+ // Magic Bee Like Frames
+ RecipeUtils.addShapedGregtechRecipe(
+ rod_LongElectrum,
+ rod_Electrum,
+ rod_LongElectrum,
+ rod_LongElectrum,
+ foil_Electrum,
+ rod_LongElectrum,
+ rod_Electrum,
+ rod_Electrum,
+ rod_Electrum,
+ hiveFrameAccelerated);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ rod_LongUranium,
+ rod_Uranium,
+ rod_LongUranium,
+ rod_LongUranium,
+ foil_Uranium235,
+ rod_LongUranium,
+ rod_Uranium,
+ rod_Uranium,
+ rod_Uranium,
+ hiveFrameMutagenic);
+ if (!CORE.GTNH) {
+ RecipeUtils.addShapedGregtechRecipe(
+ "stickLongThaumium",
+ "stickThaumium",
+ "stickLongThaumium",
+ "stickLongThaumium",
+ ItemUtils.getSimpleStack(Items.ender_pearl),
+ "stickLongThaumium",
+ "stickThaumium",
+ "stickThaumium",
+ "stickThaumium",
+ hiveFrameVoid);
+ } else {
+ if (LoadedMods.MagicBees) {
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {hiveFrameVoid}, ItemUtils.getCorrectStacktype("MagicBees:frameOblivion", 1));
+ }
+ }
+ RecipeUtils.addShapedGregtechRecipe(
+ "stickLongBlueSteel",
+ "stickBlueSteel",
+ "stickLongBlueSteel",
+ "stickLongBlueSteel",
+ ItemUtils.getSimpleStack(Items.nether_star),
+ "stickLongBlueSteel",
+ "stickBlueSteel",
+ "stickBlueSteel",
+ "stickBlueSteel",
+ hiveFrameBusy);
+
+ if (!LoadedMods.ExtraBees) {
+ // Extra Bee Like Frames
+ RecipeUtils.addShapedRecipe(
+ null,
+ itemCocoaBeans,
+ null,
+ itemCocoaBeans,
+ hiveFrameImpregnated,
+ itemCocoaBeans,
+ null,
+ itemCocoaBeans,
+ null,
+ hiveFrameCocoa);
+
+ RecipeUtils.addShapedRecipe(
+ hiveFrameImpregnated, blockIronBars, null, null, null, null, null, null, null, hiveFrameCaged);
+
+ RecipeUtils.addShapedRecipe(
+ hiveFrameImpregnated, blockSoulSand, null, null, null, null, null, null, null, hiveFrameSoul);
+
+ RecipeUtils.addShapedRecipe(
+ null,
+ itemClayDust,
+ null,
+ itemClayDust,
+ hiveFrameImpregnated,
+ itemClayDust,
+ null,
+ itemClayDust,
+ null,
+ hiveFrameClay);
+ }
+
+ // Frame Items added by bartimaeusnek
+ RecipeUtils.addShapedGregtechRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),
+ foil_Electrum,
+ ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),
+ hiveFrameSlow);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ "stickLongWroughtIron",
+ "stickWroughtIron",
+ "stickLongWroughtIron",
+ "stickLongWroughtIron",
+ "foilZinc",
+ "stickLongWroughtIron",
+ "stickWroughtIron",
+ "stickWroughtIron",
+ "stickWroughtIron",
+ hiveFrameDecay);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ "stickLongOsmiridium",
+ "stickOsmiridium",
+ "stickLongOsmiridium",
+ "stickLongOsmiridium",
+ "foilOsmiridium",
+ "stickLongOsmiridium",
+ "stickOsmiridium",
+ "stickOsmiridium",
+ "stickOsmiridium",
+ hiveFrameStalilize);
+
+ RecipeUtils.addShapedGregtechRecipe(
+ "stickLongWoodSealed",
+ "stickWoodSealed",
+ "stickLongWoodSealed",
+ "stickLongWoodSealed",
+ Items.paper,
+ "stickLongWoodSealed",
+ "stickWoodSealed",
+ "stickWoodSealed",
+ "stickWoodSealed",
+ hiveFrameArborist);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_AlleleBeeSpecies.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_AlleleBeeSpecies.java
index 222b1215eb..8258fbfcb5 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_AlleleBeeSpecies.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_AlleleBeeSpecies.java
@@ -9,32 +9,49 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class GTPP_AlleleBeeSpecies extends AlleleBeeSpecies {
-
- public GTPP_AlleleBeeSpecies(String uid, boolean dominant, String unlocalizedName, String authority, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor) {
- super(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, primaryColor, secondaryColor);
- AlleleManager.alleleRegistry.registerAllele(this, EnumBeeChromosome.SPECIES);
- }
- @Override
- public IAlleleBeeSpeciesCustom addProduct(ItemStack product, Float chance) {
- if (product == null || product.getItem() == null) {
- product = new ItemStack(Items.boat);
- }
- if (chance <= 0.0f || chance > 1.0f) {
- chance = 0.1f;
- }
- return super.addProduct(product, chance);
- }
+ public GTPP_AlleleBeeSpecies(
+ String uid,
+ boolean dominant,
+ String unlocalizedName,
+ String authority,
+ String unlocalizedDescription,
+ IClassification branch,
+ String binomial,
+ int primaryColor,
+ int secondaryColor) {
+ super(
+ uid,
+ unlocalizedName,
+ authority,
+ unlocalizedDescription,
+ dominant,
+ branch,
+ binomial,
+ primaryColor,
+ secondaryColor);
+ AlleleManager.alleleRegistry.registerAllele(this, EnumBeeChromosome.SPECIES);
+ }
- @Override
- public IAlleleBeeSpeciesCustom addSpecialty(ItemStack specialty, Float chance) {
- if (specialty == null || specialty.getItem() == null) {
- specialty = new ItemStack(Items.boat);
- }
- if (chance <= 0.0f || chance > 1.0f) {
- chance = 0.1f;
- }
- return super.addSpecialty(specialty, chance);
- }
+ @Override
+ public IAlleleBeeSpeciesCustom addProduct(ItemStack product, Float chance) {
+ if (product == null || product.getItem() == null) {
+ product = new ItemStack(Items.boat);
+ }
+ if (chance <= 0.0f || chance > 1.0f) {
+ chance = 0.1f;
+ }
+ return super.addProduct(product, chance);
+ }
+ @Override
+ public IAlleleBeeSpeciesCustom addSpecialty(ItemStack specialty, Float chance) {
+ if (specialty == null || specialty.getItem() == null) {
+ specialty = new ItemStack(Items.boat);
+ }
+ if (chance <= 0.0f || chance > 1.0f) {
+ chance = 0.1f;
+ }
+ return super.addSpecialty(specialty, chance);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java
index f94a178007..89cb54e603 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java
@@ -3,13 +3,6 @@ package gtPlusPlus.xmod.forestry.bees.registry;
import static forestry.api.apiculture.EnumBeeChromosome.*;
import static forestry.api.core.EnumHumidity.ARID;
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Locale;
-import java.util.function.Consumer;
-
-import org.apache.commons.lang3.text.WordUtils;
-
import forestry.api.apiculture.*;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
@@ -31,12 +24,22 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_CombType;
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.Locale;
+import java.util.function.Consumer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.BiomeDictionary.Type;
+import org.apache.commons.lang3.text.WordUtils;
public enum GTPP_BeeDefinition implements IBeeDefinition {
-
- DRAGONBLOOD(GTPP_BranchDefinition.LEGENDARY, "Dragon Blood", STANDALONE.DRAGON_METAL, true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20),
+ DRAGONBLOOD(
+ GTPP_BranchDefinition.LEGENDARY,
+ "Dragon Blood",
+ STANDALONE.DRAGON_METAL,
+ true,
+ Utils.rgbtoHexValue(220, 20, 20),
+ Utils.rgbtoHexValue(20, 20, 20),
beeSpecies -> {
beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f);
beeSpecies.addSpecialty(GTPP_Bees.combs.getStackForType(GTPP_CombType.DRAGONBLOOD), 0.10f);
@@ -54,10 +57,15 @@ public enum GTPP_BeeDefinition implements IBeeDefinition {
IBeeMutationCustom tMutation = dis.registerMutation("DRAGONESSENCE", "NEUTRONIUM", 2);
tMutation.restrictHumidity(ARID);
tMutation.requireResource(STANDALONE.DRAGON_METAL.getBlock(), 1);
- tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim
- }
- ),
- FORCE(GTPP_BranchDefinition.LEGENDARY, "Force", STANDALONE.FORCE, true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5),
+ tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End")); // End Dim
+ }),
+ FORCE(
+ GTPP_BranchDefinition.LEGENDARY,
+ "Force",
+ STANDALONE.FORCE,
+ true,
+ Utils.rgbtoHexValue(250, 250, 20),
+ Utils.rgbtoHexValue(200, 200, 5),
beeSpecies -> {
beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f);
beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALT), 0.15f);
@@ -75,220 +83,254 @@ public enum GTPP_BeeDefinition implements IBeeDefinition {
dis -> {
IBeeMutationCustom tMutation = dis.registerMutation("STEEL", "GOLD", 10);
tMutation.restrictHumidity(ARID);
- tMutation.restrictBiomeType(Type.HOT);
- }
- ),
-
+ tMutation.restrictBiomeType(Type.HOT);
+ }),
;
- private final GTPP_BranchDefinition branch;
- private final GTPP_AlleleBeeSpecies species;
- private final Consumer<GTPP_AlleleBeeSpecies> mSpeciesProperties;
- private final Consumer<IAllele[]> mAlleles;
- private final Consumer<GTPP_BeeDefinition> mMutations;
- private IAllele[] template;
- private IBeeGenome genome;
-
- GTPP_BeeDefinition(GTPP_BranchDefinition branch, String binomial, Materials aMat, boolean dominant, int primary, int secondary, Consumer<GTPP_AlleleBeeSpecies> aSpeciesProperties, Consumer<IAllele[]> aAlleles, Consumer<GTPP_BeeDefinition> aMutations) {
- this(branch, binomial, MaterialUtils.generateMaterialFromGtENUM(aMat), dominant, primary, secondary, aSpeciesProperties, aAlleles, aMutations);
- }
-
- GTPP_BeeDefinition(GTPP_BranchDefinition branch, String binomial, Material aMat, boolean dominant, int primary, int secondary, Consumer<GTPP_AlleleBeeSpecies> aSpeciesProperties, Consumer<IAllele[]> aAlleles, Consumer<GTPP_BeeDefinition> aMutations) {
- this.mAlleles = aAlleles;
- this.mMutations = aMutations;
- this.mSpeciesProperties = aSpeciesProperties;
- String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH);
- String species = WordUtils.capitalize(binomial);
- String uid = "gtpp.bee.species" + species;
- String description = "for.description." + species;
- String name = "for.bees.species." + lowercaseName;
- GT_LanguageManager.addStringLocalization("for.bees.species." + lowercaseName, species, true);
- GTPP_Bees.sMaterialMappings.put(binomial.toLowerCase().replaceAll(" ", ""), aMat);
- this.branch = branch;
- this.species = new GTPP_AlleleBeeSpecies(uid, dominant, name, "GT++", description, branch.getBranch(), binomial, primary, secondary);
- }
-
- public static void initBees() {
- for (GTPP_BeeDefinition bee : values()) { bee.init(); }
- for (GTPP_BeeDefinition bee : values()) { bee.registerMutations(); }
- }
-
- protected static IAlleleBeeEffect getEffect(byte modid, String name) {
- String s;
- switch (modid) {
- case GTPP_Bees.EXTRABEES :
- s = "extrabees.effect." + name;
- break;
- case GTPP_Bees.GENDUSTRY :
- s = "gendustry.effect." + name;
- break;
- case GTPP_Bees.MAGICBEES :
- s = "magicbees.effect" + name;
- break;
- case GTPP_Bees.GREGTECH :
- s = "gregtech.effect" + name;
- break;
- default :
- s = "forestry.effect" + name;
- break;
-
- }
- return (IAlleleBeeEffect) AlleleManager.alleleRegistry.getAllele(s);
- }
-
- protected static IAlleleFlowers getFlowers(byte modid, String name) {
- String s;
- switch (modid) {
- case GTPP_Bees.EXTRABEES :
- s = "extrabees.flower." + name;
- break;
- case GTPP_Bees.GENDUSTRY :
- s = "gendustry.flower." + name;
- break;
- case GTPP_Bees.MAGICBEES :
- s = "magicbees.flower" + name;
- break;
- case GTPP_Bees.GREGTECH :
- s = "gregtech.flower" + name;
- break;
- default :
- s = "forestry.flowers" + name;
- break;
-
- }
- return (IAlleleFlowers) AlleleManager.alleleRegistry.getAllele(s);
- }
-
- protected static IAlleleBeeSpecies getSpecies(byte modid, String name) {
- String s;
- switch (modid) {
- case GTPP_Bees.EXTRABEES :
- s = "extrabees.species." + name;
- break;
- case GTPP_Bees.GENDUSTRY :
- s = "gendustry.bee." + name;
- break;
- case GTPP_Bees.MAGICBEES :
- s = "magicbees.species" + name;
- break;
- case GTPP_Bees.GREGTECH :
- s = "gregtech.species" + name;
- break;
- default :
- s = "forestry.species" + name;
- break;
-
- }
- IAlleleBeeSpecies ret = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(s);
- return ret;
- }
-
- protected final void setSpeciesProperties(GTPP_AlleleBeeSpecies species2) {
- this.mSpeciesProperties.accept(species2);
- }
-
- protected final void setAlleles(IAllele[] template) {
- this.mAlleles.accept(template);
- }
-
- protected final void registerMutations() {
- this.mMutations.accept(this);
- }
-
- private void init() {
- setSpeciesProperties(species);
-
- template = branch.getTemplate();
- AlleleHelper.instance.set(template, SPECIES, species);
- setAlleles(template);
-
- genome = BeeManager.beeRoot.templateAsGenome(template);
-
- BeeManager.beeRoot.registerTemplate(template);
- }
-
- protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance) {
- return registerMutation(parent1, parent2, chance, 1f);
- }
-
- protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance) {
- return registerMutation(parent1, parent2, chance, 1f);
- }
-
- protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance) {
- return registerMutation(parent1, parent2, chance, 1f);
- }
-
- protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance) {
- return registerMutation(parent1, parent2, chance, 1f);
- }
-
- protected final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance) {
- return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, 1f);
- }
-
- /**
- * Diese neue Funtion erlaubt Mutationsraten unter 1%. Setze dazu die
- * Mutationsrate als Bruch mit chance / chancedivider This new function
- * allows Mutation percentages under 1%. Set them as a fraction with chance
- * / chancedivider
- */
- protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) {
- return new GTPP_Bee_Mutation(parent1, parent2, this.getTemplate(), chance, chancedivider);
- }
-
- protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) {
- return registerMutation(parent1.species, parent2, chance, chancedivider);
- }
-
- protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance, float chancedivider) {
- return registerMutation(parent1, parent2.species, chance, chancedivider);
- }
-
- protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance, float chancedivider) {
- return registerMutation(parent1.species, parent2, chance, chancedivider);
- }
-
- protected final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance, float chancedivider) {
- return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, chancedivider);
- }
-
- @Override
- public final IAllele[] getTemplate() {
- return Arrays.copyOf(template, template.length);
- }
-
- @Override
- public final IBeeGenome getGenome() {
- return genome;
- }
-
- @Override
- public final IBee getIndividual() {
- return new Bee(genome);
- }
-
- @Override
- public final ItemStack getMemberStack(EnumBeeType beeType) {
- return BeeManager.beeRoot.getMemberStack(getIndividual(), beeType.ordinal());
- }
-
- public final IBeeDefinition getRainResist() {
- return new BeeVariation.RainResist(this);
- }
-
- private static final Class sGtBees = ReflectionUtils.getClass("gregtech.loaders.misc.GT_BeeDefinition");
-
- public static IAlleleBeeSpecies getGregtechBeeType(String name) {
- try {
- Enum aBeeObject = ReflectionUtils.getEnum(sGtBees, name);
- Field gtBeesField = ReflectionUtils.getField(sGtBees, "species");
- IAlleleBeeSpecies beeType = ReflectionUtils.getFieldValue(gtBeesField, aBeeObject);
- return beeType != null ? beeType : null;
- }
- catch (Throwable t) {
- t.printStackTrace();
- return null;
- }
-
- }
+ private final GTPP_BranchDefinition branch;
+ private final GTPP_AlleleBeeSpecies species;
+ private final Consumer<GTPP_AlleleBeeSpecies> mSpeciesProperties;
+ private final Consumer<IAllele[]> mAlleles;
+ private final Consumer<GTPP_BeeDefinition> mMutations;
+ private IAllele[] template;
+ private IBeeGenome genome;
+
+ GTPP_BeeDefinition(
+ GTPP_BranchDefinition branch,
+ String binomial,
+ Materials aMat,
+ boolean dominant,
+ int primary,
+ int secondary,
+ Consumer<GTPP_AlleleBeeSpecies> aSpeciesProperties,
+ Consumer<IAllele[]> aAlleles,
+ Consumer<GTPP_BeeDefinition> aMutations) {
+ this(
+ branch,
+ binomial,
+ MaterialUtils.generateMaterialFromGtENUM(aMat),
+ dominant,
+ primary,
+ secondary,
+ aSpeciesProperties,
+ aAlleles,
+ aMutations);
+ }
+
+ GTPP_BeeDefinition(
+ GTPP_BranchDefinition branch,
+ String binomial,
+ Material aMat,
+ boolean dominant,
+ int primary,
+ int secondary,
+ Consumer<GTPP_AlleleBeeSpecies> aSpeciesProperties,
+ Consumer<IAllele[]> aAlleles,
+ Consumer<GTPP_BeeDefinition> aMutations) {
+ this.mAlleles = aAlleles;
+ this.mMutations = aMutations;
+ this.mSpeciesProperties = aSpeciesProperties;
+ String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH);
+ String species = WordUtils.capitalize(binomial);
+ String uid = "gtpp.bee.species" + species;
+ String description = "for.description." + species;
+ String name = "for.bees.species." + lowercaseName;
+ GT_LanguageManager.addStringLocalization("for.bees.species." + lowercaseName, species, true);
+ GTPP_Bees.sMaterialMappings.put(binomial.toLowerCase().replaceAll(" ", ""), aMat);
+ this.branch = branch;
+ this.species = new GTPP_AlleleBeeSpecies(
+ uid, dominant, name, "GT++", description, branch.getBranch(), binomial, primary, secondary);
+ }
+
+ public static void initBees() {
+ for (GTPP_BeeDefinition bee : values()) {
+ bee.init();
+ }
+ for (GTPP_BeeDefinition bee : values()) {
+ bee.registerMutations();
+ }
+ }
+
+ protected static IAlleleBeeEffect getEffect(byte modid, String name) {
+ String s;
+ switch (modid) {
+ case GTPP_Bees.EXTRABEES:
+ s = "extrabees.effect." + name;
+ break;
+ case GTPP_Bees.GENDUSTRY:
+ s = "gendustry.effect." + name;
+ break;
+ case GTPP_Bees.MAGICBEES:
+ s = "magicbees.effect" + name;
+ break;
+ case GTPP_Bees.GREGTECH:
+ s = "gregtech.effect" + name;
+ break;
+ default:
+ s = "forestry.effect" + name;
+ break;
+ }
+ return (IAlleleBeeEffect) AlleleManager.alleleRegistry.getAllele(s);
+ }
+
+ protected static IAlleleFlowers getFlowers(byte modid, String name) {
+ String s;
+ switch (modid) {
+ case GTPP_Bees.EXTRABEES:
+ s = "extrabees.flower." + name;
+ break;
+ case GTPP_Bees.GENDUSTRY:
+ s = "gendustry.flower." + name;
+ break;
+ case GTPP_Bees.MAGICBEES:
+ s = "magicbees.flower" + name;
+ break;
+ case GTPP_Bees.GREGTECH:
+ s = "gregtech.flower" + name;
+ break;
+ default:
+ s = "forestry.flowers" + name;
+ break;
+ }
+ return (IAlleleFlowers) AlleleManager.alleleRegistry.getAllele(s);
+ }
+
+ protected static IAlleleBeeSpecies getSpecies(byte modid, String name) {
+ String s;
+ switch (modid) {
+ case GTPP_Bees.EXTRABEES:
+ s = "extrabees.species." + name;
+ break;
+ case GTPP_Bees.GENDUSTRY:
+ s = "gendustry.bee." + name;
+ break;
+ case GTPP_Bees.MAGICBEES:
+ s = "magicbees.species" + name;
+ break;
+ case GTPP_Bees.GREGTECH:
+ s = "gregtech.species" + name;
+ break;
+ default:
+ s = "forestry.species" + name;
+ break;
+ }
+ IAlleleBeeSpecies ret = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(s);
+ return ret;
+ }
+
+ protected final void setSpeciesProperties(GTPP_AlleleBeeSpecies species2) {
+ this.mSpeciesProperties.accept(species2);
+ }
+
+ protected final void setAlleles(IAllele[] template) {
+ this.mAlleles.accept(template);
+ }
+
+ protected final void registerMutations() {
+ this.mMutations.accept(this);
+ }
+
+ private void init() {
+ setSpeciesProperties(species);
+
+ template = branch.getTemplate();
+ AlleleHelper.instance.set(template, SPECIES, species);
+ setAlleles(template);
+
+ genome = BeeManager.beeRoot.templateAsGenome(template);
+
+ BeeManager.beeRoot.registerTemplate(template);
+ }
+
+ protected final IBeeMutationCustom registerMutation(
+ IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance) {
+ return registerMutation(parent1, parent2, chance, 1f);
+ }
+
+ protected final IBeeMutationCustom registerMutation(
+ GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance) {
+ return registerMutation(parent1, parent2, chance, 1f);
+ }
+
+ protected final IBeeMutationCustom registerMutation(
+ IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance) {
+ return registerMutation(parent1, parent2, chance, 1f);
+ }
+
+ protected final IBeeMutationCustom registerMutation(
+ GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance) {
+ return registerMutation(parent1, parent2, chance, 1f);
+ }
+
+ protected final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance) {
+ return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, 1f);
+ }
+
+ /**
+ * Diese neue Funtion erlaubt Mutationsraten unter 1%. Setze dazu die
+ * Mutationsrate als Bruch mit chance / chancedivider This new function
+ * allows Mutation percentages under 1%. Set them as a fraction with chance
+ * / chancedivider
+ */
+ protected final IBeeMutationCustom registerMutation(
+ IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) {
+ return new GTPP_Bee_Mutation(parent1, parent2, this.getTemplate(), chance, chancedivider);
+ }
+
+ protected final IBeeMutationCustom registerMutation(
+ GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) {
+ return registerMutation(parent1.species, parent2, chance, chancedivider);
+ }
+
+ protected final IBeeMutationCustom registerMutation(
+ IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance, float chancedivider) {
+ return registerMutation(parent1, parent2.species, chance, chancedivider);
+ }
+
+ protected final IBeeMutationCustom registerMutation(
+ GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance, float chancedivider) {
+ return registerMutation(parent1.species, parent2, chance, chancedivider);
+ }
+
+ protected final IBeeMutationCustom registerMutation(
+ String parent1, String parent2, int chance, float chancedivider) {
+ return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, chancedivider);
+ }
+
+ @Override
+ public final IAllele[] getTemplate() {
+ return Arrays.copyOf(template, template.length);
+ }
+
+ @Override
+ public final IBeeGenome getGenome() {
+ return genome;
+ }
+
+ @Override
+ public final IBee getIndividual() {
+ return new Bee(genome);
+ }
+
+ @Override
+ public final ItemStack getMemberStack(EnumBeeType beeType) {
+ return BeeManager.beeRoot.getMemberStack(getIndividual(), beeType.ordinal());
+ }
+
+ public final IBeeDefinition getRainResist() {
+ return new BeeVariation.RainResist(this);
+ }
+
+ private static final Class sGtBees = ReflectionUtils.getClass("gregtech.loaders.misc.GT_BeeDefinition");
+
+ public static IAlleleBeeSpecies getGregtechBeeType(String name) {
+ try {
+ Enum aBeeObject = ReflectionUtils.getEnum(sGtBees, name);
+ Field gtBeesField = ReflectionUtils.getField(sGtBees, "species");
+ IAlleleBeeSpecies beeType = ReflectionUtils.getFieldValue(gtBeesField, aBeeObject);
+ return beeType != null ? beeType : null;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return null;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bee_Mutation.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bee_Mutation.java
index 92a2a9fb30..c9bf32d07b 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bee_Mutation.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bee_Mutation.java
@@ -7,19 +7,18 @@ import forestry.api.genetics.IGenome;
import forestry.api.genetics.IMutationCondition;
import forestry.apiculture.genetics.BeeMutation;
import forestry.core.genetics.mutations.Mutation;
+import java.lang.reflect.Field;
+import java.util.List;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import org.apache.commons.lang3.reflect.FieldUtils;
-import java.lang.reflect.Field;
-import java.util.List;
-
-
public class GTPP_Bee_Mutation extends BeeMutation {
private final float split;
- public GTPP_Bee_Mutation(IAlleleBeeSpecies bee0, IAlleleBeeSpecies bee1, IAllele[] result, int chance, float split) {
+ public GTPP_Bee_Mutation(
+ IAlleleBeeSpecies bee0, IAlleleBeeSpecies bee1, IAllele[] result, int chance, float split) {
super(bee0, bee1, result, chance);
this.split = split;
BeeManager.beeRoot.registerMutation(this);
@@ -31,7 +30,12 @@ public class GTPP_Bee_Mutation extends BeeMutation {
}
@Override
- public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1) {
+ public float getChance(
+ IBeeHousing housing,
+ IAlleleBeeSpecies allele0,
+ IAlleleBeeSpecies allele1,
+ IBeeGenome genome0,
+ IBeeGenome genome1) {
World world = housing != null ? housing.getWorld() : null;
ChunkCoordinates housingCoordinates = housing != null ? housing.getCoordinates() : null;
int x = housingCoordinates != null ? housingCoordinates.posX : 0;
@@ -45,7 +49,8 @@ public class GTPP_Bee_Mutation extends BeeMutation {
}
IBeeModifier beeHousingModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
- IBeeModifier beeModeModifier = BeeManager.beeRoot.getBeekeepingMode(world).getBeeModifier();
+ IBeeModifier beeModeModifier =
+ BeeManager.beeRoot.getBeekeepingMode(world).getBeeModifier();
processedChance *= beeHousingModifier.getMutationModifier(genome0, genome1, processedChance);
processedChance *= beeModeModifier.getMutationModifier(genome0, genome1, processedChance);
@@ -54,14 +59,21 @@ public class GTPP_Bee_Mutation extends BeeMutation {
}
@SuppressWarnings("unchecked")
- private float getBasicChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) {
+ private float getBasicChance(
+ World world,
+ int x,
+ int y,
+ int z,
+ IAllele allele0,
+ IAllele allele1,
+ IGenome genome0,
+ IGenome genome1,
+ IClimateProvider climate) {
float mutationChance = this.getBaseChance();
List<IMutationCondition> mutationConditions = null;
Field f = FieldUtils.getDeclaredField(Mutation.class, "mutationConditions", true);
- if (f == null)
- f = FieldUtils.getField(Mutation.class, "mutationConditions", true);
- if (f == null)
- return mutationChance;
+ if (f == null) f = FieldUtils.getField(Mutation.class, "mutationConditions", true);
+ if (f == null) return mutationChance;
try {
mutationConditions = f.get(this) instanceof List ? (List<IMutationCondition>) f.get(this) : null;
} catch (IllegalAccessException e) {
@@ -70,7 +82,8 @@ public class GTPP_Bee_Mutation extends BeeMutation {
if (mutationConditions != null)
for (IMutationCondition mutationCondition : mutationConditions) {
- mutationChance *= mutationCondition.getChance(world, x, y, z, allele0, allele1, genome0, genome1, climate);
+ mutationChance *=
+ mutationCondition.getChance(world, x, y, z, allele0, allele1, genome0, genome1, climate);
if (mutationChance == 0) {
return 0;
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java
index 14b5a7e8ea..38ba689944 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java
@@ -2,8 +2,6 @@ package gtPlusPlus.xmod.forestry.bees.registry;
import static gregtech.api.enums.GT_Values.MOD_ID_FR;
-import java.util.HashMap;
-
import cpw.mods.fml.common.Loader;
import gregtech.GT_Mod;
import gtPlusPlus.api.objects.Logger;
@@ -12,63 +10,62 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.forestry.bees.handler.*;
import gtPlusPlus.xmod.forestry.bees.items.output.*;
+import java.util.HashMap;
public class GTPP_Bees {
-
- public final static byte FORESTRY = 0;
- public final static byte EXTRABEES = 1;
- public final static byte GENDUSTRY = 2;
- public final static byte MAGICBEES = 3;
- public final static byte GREGTECH = 4;
+
+ public static final byte FORESTRY = 0;
+ public static final byte EXTRABEES = 1;
+ public static final byte GENDUSTRY = 2;
+ public static final byte MAGICBEES = 3;
+ public static final byte GREGTECH = 4;
public static GTPP_Propolis propolis;
public static GTPP_Pollen pollen;
public static GTPP_Drop drop;
public static GTPP_Comb combs;
-
-
+
public static HashMap<String, Material> sMaterialMappings = new HashMap<String, Material>();
- public static HashMap<Integer, GTPP_PropolisType> sPropolisMappings = new HashMap<Integer, GTPP_PropolisType>();
- public static HashMap<Integer, GTPP_PollenType> sPollenMappings = new HashMap<Integer, GTPP_PollenType>();
- public static HashMap<Integer, GTPP_DropType> sDropMappings = new HashMap<Integer, GTPP_DropType>();
- public static HashMap<Integer, GTPP_CombType> sCombMappings = new HashMap<Integer, GTPP_CombType>();
+ public static HashMap<Integer, GTPP_PropolisType> sPropolisMappings = new HashMap<Integer, GTPP_PropolisType>();
+ public static HashMap<Integer, GTPP_PollenType> sPollenMappings = new HashMap<Integer, GTPP_PollenType>();
+ public static HashMap<Integer, GTPP_DropType> sDropMappings = new HashMap<Integer, GTPP_DropType>();
+ public static HashMap<Integer, GTPP_CombType> sCombMappings = new HashMap<Integer, GTPP_CombType>();
public GTPP_Bees() {
if (Loader.isModLoaded(MOD_ID_FR) && GT_Mod.gregtechproxy.mGTBees) {
-
- if (!ReflectionUtils.doesClassExist("gregtech.loaders.misc.GT_BeeDefinition")) {
- CORE.crash("Missing gregtech.loaders.misc.GT_BeeDefinition.");
- }
- else {
- Logger.BEES("Loading GT++ Bees!");
- }
- Logger.BEES("Creating required items.");
+ if (!ReflectionUtils.doesClassExist("gregtech.loaders.misc.GT_BeeDefinition")) {
+ CORE.crash("Missing gregtech.loaders.misc.GT_BeeDefinition.");
+ } else {
+ Logger.BEES("Loading GT++ Bees!");
+ }
+
+ Logger.BEES("Creating required items.");
propolis = new GTPP_Propolis();
pollen = new GTPP_Pollen();
drop = new GTPP_Drop();
combs = new GTPP_Comb();
- Logger.BEES("Loading types.");
+ Logger.BEES("Loading types.");
initTypes();
- Logger.BEES("Adding recipes.");
+ Logger.BEES("Adding recipes.");
GTPP_Drop.initDropsRecipes();
GTPP_Propolis.initPropolisRecipes();
GTPP_Comb.initCombsRecipes();
- Logger.BEES("Initialising bees.");
+ Logger.BEES("Initialising bees.");
GTPP_BeeDefinition.initBees();
-
- Logger.BEES("Done!");
+
+ Logger.BEES("Done!");
}
}
-
+
private static void initTypes() {
- ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.registry.GTPP_BeeDefinition");
- ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_CombType");
- ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType");
- ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_PollenType");
- ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_PropolisType");
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.registry.GTPP_BeeDefinition");
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_CombType");
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType");
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_PollenType");
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_PropolisType");
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java
index 3c7630a434..76e195e9ef 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java
@@ -2,9 +2,6 @@ package gtPlusPlus.xmod.forestry.bees.registry;
import static forestry.api.apiculture.EnumBeeChromosome.*;
-import java.util.Arrays;
-import java.util.function.Consumer;
-
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.genetics.IAllele;
@@ -12,9 +9,10 @@ import forestry.api.genetics.IClassification;
import forestry.apiculture.genetics.alleles.AlleleEffect;
import forestry.core.genetics.alleles.AlleleHelper;
import forestry.core.genetics.alleles.EnumAllele.*;
+import java.util.Arrays;
+import java.util.function.Consumer;
public enum GTPP_BranchDefinition {
-
LEGENDARY("gtpp.legendary", "Summa Potestas", alleles -> {
AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.BOTH_2);
AlleleHelper.instance.set(alleles, HUMIDITY_TOLERANCE, Tolerance.BOTH_2);
@@ -25,9 +23,7 @@ public enum GTPP_BranchDefinition {
AlleleHelper.instance.set(alleles, FLOWERING, Flowering.SLOW);
AlleleHelper.instance.set(alleles, SPEED, Speed.FASTEST);
AlleleHelper.instance.set(alleles, TERRITORY, Territory.LARGER);
- }
- )
- ;
+ });
private static IAllele[] defaultTemplate;
private final IClassification branch;
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java
index 9b3424ef08..e8e2922791 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java
@@ -10,14 +10,8 @@
******************************************************************************/
package gtPlusPlus.xmod.forestry.bees.tileentities;
-import java.util.*;
-
-import cpw.mods.fml.common.Optional;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-
import buildcraft.api.statements.ITriggerExternal;
+import cpw.mods.fml.common.Optional;
import forestry.api.apiculture.*;
import forestry.apiculture.ApiaryBeeListener;
import forestry.apiculture.ApiaryBeeModifier;
@@ -28,65 +22,68 @@ import forestry.apiculture.tiles.TileBeeHousingBase;
import forestry.apiculture.trigger.ApicultureTriggers;
import gtPlusPlus.xmod.forestry.bees.gui.ContainerBeeHouse;
import gtPlusPlus.xmod.forestry.bees.gui.GuiBeeHouse;
+import java.util.*;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TileDenseBeeHouse extends TileBeeHousingBase implements IApiary {
- private final IBeeModifier beeModifier = new ApiaryBeeModifier();
- private final IBeeListener beeListener = new ApiaryBeeListener(this);
- private final InventoryApiary inventory = new InventoryApiary(getAccessHandler());
-
- public TileDenseBeeHouse() {
- super("apiary2");
- setInternalInventory(inventory);
- }
-
- @Override
- public IBeeHousingInventory getBeeInventory() {
- return inventory;
- }
-
- @Override
- public IApiaryInventory getApiaryInventory() {
- return inventory;
- }
-
- @Override
- public Collection<IBeeModifier> getBeeModifiers() {
- List<IBeeModifier> beeModifiers = new ArrayList<>();
-
- beeModifiers.add(beeModifier);
-
- for (IHiveFrame frame : inventory.getFrames()) {
- beeModifiers.add(frame.getBeeModifier());
- }
-
- return beeModifiers;
- }
-
- @Override
- public Iterable<IBeeListener> getBeeListeners() {
- return Collections.singleton(beeListener);
- }
-
- /* ITRIGGERPROVIDER */
- @Optional.Method(modid = "BuildCraftAPI|statements")
- @Override
- public Collection<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity tile) {
- LinkedList<ITriggerExternal> res = new LinkedList<>();
- res.add(ApicultureTriggers.missingQueen);
- res.add(ApicultureTriggers.missingDrone);
- res.add(ApicultureTriggers.noFrames);
- return res;
- }
-
- @Override
- public Object getGui(EntityPlayer player, int data) {
- ContainerBeeHouse container = new ContainerBeeHouse(player.inventory, this, true);
- return new GuiBeeHouse<>(this, container, GuiBeeHouse.Icon.APIARY);
- }
-
- @Override
- public Object getContainer(EntityPlayer player, int data) {
- return new ContainerBeeHouse(player.inventory, this, true);
- }
+ private final IBeeModifier beeModifier = new ApiaryBeeModifier();
+ private final IBeeListener beeListener = new ApiaryBeeListener(this);
+ private final InventoryApiary inventory = new InventoryApiary(getAccessHandler());
+
+ public TileDenseBeeHouse() {
+ super("apiary2");
+ setInternalInventory(inventory);
+ }
+
+ @Override
+ public IBeeHousingInventory getBeeInventory() {
+ return inventory;
+ }
+
+ @Override
+ public IApiaryInventory getApiaryInventory() {
+ return inventory;
+ }
+
+ @Override
+ public Collection<IBeeModifier> getBeeModifiers() {
+ List<IBeeModifier> beeModifiers = new ArrayList<>();
+
+ beeModifiers.add(beeModifier);
+
+ for (IHiveFrame frame : inventory.getFrames()) {
+ beeModifiers.add(frame.getBeeModifier());
+ }
+
+ return beeModifiers;
+ }
+
+ @Override
+ public Iterable<IBeeListener> getBeeListeners() {
+ return Collections.singleton(beeListener);
+ }
+
+ /* ITRIGGERPROVIDER */
+ @Optional.Method(modid = "BuildCraftAPI|statements")
+ @Override
+ public Collection<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity tile) {
+ LinkedList<ITriggerExternal> res = new LinkedList<>();
+ res.add(ApicultureTriggers.missingQueen);
+ res.add(ApicultureTriggers.missingDrone);
+ res.add(ApicultureTriggers.noFrames);
+ return res;
+ }
+
+ @Override
+ public Object getGui(EntityPlayer player, int data) {
+ ContainerBeeHouse container = new ContainerBeeHouse(player.inventory, this, true);
+ return new GuiBeeHouse<>(this, container, GuiBeeHouse.Icon.APIARY);
+ }
+
+ @Override
+ public Object getContainer(EntityPlayer player, int data) {
+ return new ContainerBeeHouse(player.inventory, this, true);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/galacticraft/HANDLER_GalactiCraft.java b/src/main/java/gtPlusPlus/xmod/galacticraft/HANDLER_GalactiCraft.java
index d5c7a7e4e5..5957cfc89d 100644
--- a/src/main/java/gtPlusPlus/xmod/galacticraft/HANDLER_GalactiCraft.java
+++ b/src/main/java/gtPlusPlus/xmod/galacticraft/HANDLER_GalactiCraft.java
@@ -3,32 +3,29 @@ package gtPlusPlus.xmod.galacticraft;
import gtPlusPlus.core.lib.LoadedMods;
public class HANDLER_GalactiCraft {
-
- //private static final HashMap<String, BaseSolarSystem> mSystemsCache = new HashMap<String, BaseSolarSystem>();
-
- public static void preInit(){
- if (LoadedMods.GalacticraftCore){
- //mSystemsCache.put("HD10180", new SystemHD10180());
- /*for (BaseSolarSystem solar : mSystemsCache.values()) {
- Logger.SPACE("Running 'pre-init' for "+solar.mSystemName);
- solar.preInit();
- }*/
- }
- }
- public static void init(){
- if (LoadedMods.GalacticraftCore){
- /*for (BaseSolarSystem solar : mSystemsCache.values()) {
- Logger.SPACE("Running 'init' for "+solar.mSystemName);
- solar.init();
- }*/
- }
- }
+ // private static final HashMap<String, BaseSolarSystem> mSystemsCache = new HashMap<String, BaseSolarSystem>();
- public static void postInit(){
- if (LoadedMods.GalacticraftCore){
-
- }
- }
-
+ public static void preInit() {
+ if (LoadedMods.GalacticraftCore) {
+ // mSystemsCache.put("HD10180", new SystemHD10180());
+ /*for (BaseSolarSystem solar : mSystemsCache.values()) {
+ Logger.SPACE("Running 'pre-init' for "+solar.mSystemName);
+ solar.preInit();
+ }*/
+ }
+ }
+
+ public static void init() {
+ if (LoadedMods.GalacticraftCore) {
+ /*for (BaseSolarSystem solar : mSystemsCache.values()) {
+ Logger.SPACE("Running 'init' for "+solar.mSystemName);
+ solar.init();
+ }*/
+ }
+ }
+
+ public static void postInit() {
+ if (LoadedMods.GalacticraftCore) {}
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java b/src/main/java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
index 3b59b58cab..b0c5032e5f 100644
--- a/src/main/java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
+++ b/src/main/java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
@@ -1,83 +1,85 @@
package gtPlusPlus.xmod.galacticraft.handler;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import net.minecraft.block.Block;
-import net.minecraft.item.Item;
import gtPlusPlus.core.item.chemistry.RocketFuels;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.asm.AsmConfig;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import net.minecraft.block.Block;
+import net.minecraft.item.Item;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fluids.Fluid;
public class HandlerTooltip_GC {
- private static Item mItemBlock;
- private static Block mBlock;
- private static Class<?> oMainClass;
- private static Class<?> oFuelLoaderClass;
- private static HashMap <Integer, String> mFuelNames;
-
- static {
- mFuelNames = new LinkedHashMap<Integer, String>();
- }
+ private static Item mItemBlock;
+ private static Block mBlock;
+ private static Class<?> oMainClass;
+ private static Class<?> oFuelLoaderClass;
+ private static HashMap<Integer, String> mFuelNames;
+
+ static {
+ mFuelNames = new LinkedHashMap<Integer, String>();
+ }
+
+ @SubscribeEvent
+ public void onItemTooltip(ItemTooltipEvent event) {
+ if (LoadedMods.GalacticraftCore && AsmConfig.enableGcFuelChanges) {
- @SubscribeEvent
- public void onItemTooltip(ItemTooltipEvent event) {
- if (LoadedMods.GalacticraftCore && AsmConfig.enableGcFuelChanges) {
+ if (mBlock == null) {
+ try {
+ Class<?> GCBlocks = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.blocks.GCBlocks");
+ if (GCBlocks != null) {
+ oMainClass = GCBlocks;
- if (mBlock == null) {
- try {
- Class<?> GCBlocks = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.blocks.GCBlocks");
- if (GCBlocks != null) {
- oMainClass = GCBlocks;
+ Class<?> GCFuelLoader =
+ ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.blocks.BlockFuelLoader");
- Class<?> GCFuelLoader = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.blocks.BlockFuelLoader");
+ if (GCFuelLoader != null) {
+ oFuelLoaderClass = GCFuelLoader;
+ }
- if (GCFuelLoader != null) {
- oFuelLoaderClass = GCFuelLoader;
- }
+ Field aField = ReflectionUtils.getField(oMainClass, "fuelLoader");
+ if (aField != null) {
+ Block aBlock = (Block) aField.get(null);
+ if (aBlock != null) {
+ mBlock = aBlock;
+ mItemBlock = Item.getItemFromBlock(mBlock);
+ }
+ }
+ }
+ } catch (Throwable t) {
+ }
+ }
+ if (mFuelNames == null) {
+ mFuelNames = new LinkedHashMap<Integer, String>();
+ }
- Field aField = ReflectionUtils.getField(oMainClass, "fuelLoader");
- if (aField != null) {
- Block aBlock = (Block) aField.get(null);
- if (aBlock != null) {
- mBlock = aBlock;
- mItemBlock = Item.getItemFromBlock(mBlock);
- }
- }
- }
- } catch (Throwable t) {
- }
- }
- if (mFuelNames == null) {
- mFuelNames = new LinkedHashMap<Integer, String>();
- }
-
- if (mFuelNames.isEmpty()) {
- for (int aMapKey : RocketFuels.mValidRocketFuels.keySet()) {
- Fluid aFuel = RocketFuels.mValidRocketFuels.get(aMapKey);
- if (aFuel != null) {
- mFuelNames.put(aMapKey, aFuel.getLocalizedName());
- }
- }
- }
- if (mItemBlock != null && !mFuelNames.isEmpty()) {
- Item aTempItem = event.itemStack.getItem();
- Block aTempBlock = Block.getBlockFromItem(aTempItem);
- if (aTempItem == mItemBlock || oFuelLoaderClass.isInstance(aTempBlock) || event.itemStack.getUnlocalizedName().toLowerCase().contains("fuelloader")) {
- for (int aMapKey : mFuelNames.keySet()) {
- String aFuel = mFuelNames.get(aMapKey);
- if (aFuel != null) {
- event.toolTip.add("Tier "+(aMapKey+1)+": "+aFuel);
- }
- }
- }
- }
- }
- }
+ if (mFuelNames.isEmpty()) {
+ for (int aMapKey : RocketFuels.mValidRocketFuels.keySet()) {
+ Fluid aFuel = RocketFuels.mValidRocketFuels.get(aMapKey);
+ if (aFuel != null) {
+ mFuelNames.put(aMapKey, aFuel.getLocalizedName());
+ }
+ }
+ }
+ if (mItemBlock != null && !mFuelNames.isEmpty()) {
+ Item aTempItem = event.itemStack.getItem();
+ Block aTempBlock = Block.getBlockFromItem(aTempItem);
+ if (aTempItem == mItemBlock
+ || oFuelLoaderClass.isInstance(aTempBlock)
+ || event.itemStack.getUnlocalizedName().toLowerCase().contains("fuelloader")) {
+ for (int aMapKey : mFuelNames.keySet()) {
+ String aFuel = mFuelNames.get(aMapKey);
+ if (aFuel != null) {
+ event.toolTip.add("Tier " + (aMapKey + 1) + ": " + aFuel);
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java b/src/main/java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java
index f237aed335..b0b5b48d7d 100644
--- a/src/main/java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java
+++ b/src/main/java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java
@@ -1,169 +1,163 @@
package gtPlusPlus.xmod.galacticraft.util;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import gregtech.api.enums.Materials;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.chemistry.RocketFuels;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import net.minecraft.entity.Entity;
import net.minecraftforge.fluids.FluidStack;
public class GalacticUtils {
- static final private Class<?> aTieredRocket;
- static final private Class<?> aLandingPad;
- static final private Class<?> aBuggyPad;
- static final private Class<?> aIDockable;
- static final private Class<?> aIFuelable;
- static final private Method getRocketTier;
- static final private Method getRocket;
- static final private Method getBuggy;
-
- static {
- Class<?> a1, a2, a3, a4, a5;
- Method m1, m2, m3;
- try {
- a1 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket");
- a2 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad");
- a3 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.tile.TileEntityBuggyFueler");
- a4 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.entity.IDockable");
- a5 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.entity.IFuelable");
- m1 = ReflectionUtils.getMethod(a1, "getRocketTier");
- m2 = ReflectionUtils.getMethod(a2, "getDockedEntity");
- m3 = ReflectionUtils.getMethod(a3, "getDockedEntity");
- }
- catch (Throwable t) {
- a1 = null;
- a2 = null;
- a3 = null;
- a4 = null;
- a5 = null;
- m1 = null;
- m2 = null;
- m3 = null;
- }
- aTieredRocket = a1;
- aLandingPad = a2;
- aBuggyPad = a3;
- aIDockable = a4;
- aIFuelable = a5;
- getRocketTier = m1;
- getRocket = m2;
- getBuggy = m3;
- if (a1 != null && a2 != null && a3 != null && a4 != null && a5 != null && m1 != null && m2 != null && m3 != null) {
- Logger.SPACE("Successfully relfected into 5 classes and 3 methods.");
- }
- else {
- Logger.SPACE("Failed to relfect into Galacticraft classes and methods.");
- if (a1 == null) {
- Logger.SPACE("micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket was null..");
- }
- if (a2 == null) {
- Logger.SPACE("micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad was null..");
- }
- if (a3 == null) {
- Logger.SPACE("micdoodle8.mods.galacticraft.core.tile.TileEntityBuggyFueler was null..");
- }
- if (a4 == null) {
- Logger.SPACE("micdoodle8.mods.galacticraft.api.entity.IDockable was null..");
- }
- if (a5 == null) {
- Logger.SPACE("micdoodle8.mods.galacticraft.api.entity.IFuelable was null..");
- }
- if (m1 == null) {
- Logger.SPACE("getRocketTier was null..");
- }
- if (m2 == null) {
- Logger.SPACE("getDockedEntity was null..");
- }
- if (m3 == null) {
- Logger.SPACE("getDockedEntity(buggy) was null..");
- }
- }
- }
-
-
- public static int getRocketTier(Entity aEntity) {
- if (aTieredRocket.isInstance(aEntity)) {
- if (getRocketTier != null) {
- try {
- return (int) getRocketTier.invoke(aEntity, new Object[] {});
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- }
- }
- return -1;
- }
-
- public static int getRocketTier(Object aEntity) {
- if (aIFuelable.isInstance(aEntity)) {
- if (aLandingPad.isInstance(aEntity)) {
- Object rocket;
- try {
- rocket = getRocket.invoke(aLandingPad, new Object[] {});
- if (aIDockable.isInstance(rocket) && rocket != null) {
- return getRocketTier((Entity) rocket);
- }
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- }
- else if (aBuggyPad.isInstance(aEntity)) {
- Object buggy;
- try {
- buggy = getBuggy.invoke(aBuggyPad, new Object[] {});
- if (aIDockable.isInstance(buggy) && buggy != null) {
- return 0;
- }
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- }
- }
- return -1;
- }
-
- public static boolean isFuelValidForTier(int aTier, FluidStack aFuel) {
- FluidStack aValidForThisTier = getValidFuelForTier(aTier);
- if (aFuel.isFluidEqual(aValidForThisTier)) {
- return true;
- }
- return false;
- }
+ private static final Class<?> aTieredRocket;
+ private static final Class<?> aLandingPad;
+ private static final Class<?> aBuggyPad;
+ private static final Class<?> aIDockable;
+ private static final Class<?> aIFuelable;
+ private static final Method getRocketTier;
+ private static final Method getRocket;
+ private static final Method getBuggy;
+ static {
+ Class<?> a1, a2, a3, a4, a5;
+ Method m1, m2, m3;
+ try {
+ a1 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket");
+ a2 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad");
+ a3 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.tile.TileEntityBuggyFueler");
+ a4 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.entity.IDockable");
+ a5 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.entity.IFuelable");
+ m1 = ReflectionUtils.getMethod(a1, "getRocketTier");
+ m2 = ReflectionUtils.getMethod(a2, "getDockedEntity");
+ m3 = ReflectionUtils.getMethod(a3, "getDockedEntity");
+ } catch (Throwable t) {
+ a1 = null;
+ a2 = null;
+ a3 = null;
+ a4 = null;
+ a5 = null;
+ m1 = null;
+ m2 = null;
+ m3 = null;
+ }
+ aTieredRocket = a1;
+ aLandingPad = a2;
+ aBuggyPad = a3;
+ aIDockable = a4;
+ aIFuelable = a5;
+ getRocketTier = m1;
+ getRocket = m2;
+ getBuggy = m3;
+ if (a1 != null
+ && a2 != null
+ && a3 != null
+ && a4 != null
+ && a5 != null
+ && m1 != null
+ && m2 != null
+ && m3 != null) {
+ Logger.SPACE("Successfully relfected into 5 classes and 3 methods.");
+ } else {
+ Logger.SPACE("Failed to relfect into Galacticraft classes and methods.");
+ if (a1 == null) {
+ Logger.SPACE("micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket was null..");
+ }
+ if (a2 == null) {
+ Logger.SPACE("micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad was null..");
+ }
+ if (a3 == null) {
+ Logger.SPACE("micdoodle8.mods.galacticraft.core.tile.TileEntityBuggyFueler was null..");
+ }
+ if (a4 == null) {
+ Logger.SPACE("micdoodle8.mods.galacticraft.api.entity.IDockable was null..");
+ }
+ if (a5 == null) {
+ Logger.SPACE("micdoodle8.mods.galacticraft.api.entity.IFuelable was null..");
+ }
+ if (m1 == null) {
+ Logger.SPACE("getRocketTier was null..");
+ }
+ if (m2 == null) {
+ Logger.SPACE("getDockedEntity was null..");
+ }
+ if (m3 == null) {
+ Logger.SPACE("getDockedEntity(buggy) was null..");
+ }
+ }
+ }
+ public static int getRocketTier(Entity aEntity) {
+ if (aTieredRocket.isInstance(aEntity)) {
+ if (getRocketTier != null) {
+ try {
+ return (int) getRocketTier.invoke(aEntity, new Object[] {});
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+ }
+ return -1;
+ }
- public static FluidStack getValidFuelForTier(Entity aEntity) {
- if (aTieredRocket.isInstance(aEntity)) {
- return getValidFuelForTier(getRocketTier(aEntity));
- }
- else {
- Logger.SPACE("Failed to get valid rocket fuel for "+aEntity.getClass().getCanonicalName());
- return getValidFuelForTier(0);
- }
- }
+ public static int getRocketTier(Object aEntity) {
+ if (aIFuelable.isInstance(aEntity)) {
+ if (aLandingPad.isInstance(aEntity)) {
+ Object rocket;
+ try {
+ rocket = getRocket.invoke(aLandingPad, new Object[] {});
+ if (aIDockable.isInstance(rocket) && rocket != null) {
+ return getRocketTier((Entity) rocket);
+ }
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ } else if (aBuggyPad.isInstance(aEntity)) {
+ Object buggy;
+ try {
+ buggy = getBuggy.invoke(aBuggyPad, new Object[] {});
+ if (aIDockable.isInstance(buggy) && buggy != null) {
+ return 0;
+ }
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+ }
+ return -1;
+ }
- public static FluidStack getValidFuelForTier(int aTier) {
- if (aTier > 0 && aTier <= 2) {
- return FluidUtils.getFluidStack(RocketFuels.RP1_Plus_Liquid_Oxygen, 1000);
- }
- else if (aTier >= 3 && aTier <= 5) {
- return FluidUtils.getFluidStack(RocketFuels.Dense_Hydrazine_Mix, 1000);
- }
- else if (aTier >= 6 && aTier <= 7) {
- return FluidUtils.getFluidStack(RocketFuels.Monomethylhydrazine_Plus_Nitric_Acid, 1000);
- }
- else if (aTier >= 8 && aTier <= 10) {
- return FluidUtils.getFluidStack(RocketFuels.Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide, 1000);
- }
- else {
- if (aTier == 0) {
- return Materials.Fuel.getFluid(1000);
- }
- return null;
- }
+ public static boolean isFuelValidForTier(int aTier, FluidStack aFuel) {
+ FluidStack aValidForThisTier = getValidFuelForTier(aTier);
+ if (aFuel.isFluidEqual(aValidForThisTier)) {
+ return true;
+ }
+ return false;
+ }
- }
+ public static FluidStack getValidFuelForTier(Entity aEntity) {
+ if (aTieredRocket.isInstance(aEntity)) {
+ return getValidFuelForTier(getRocketTier(aEntity));
+ } else {
+ Logger.SPACE(
+ "Failed to get valid rocket fuel for " + aEntity.getClass().getCanonicalName());
+ return getValidFuelForTier(0);
+ }
+ }
+ public static FluidStack getValidFuelForTier(int aTier) {
+ if (aTier > 0 && aTier <= 2) {
+ return FluidUtils.getFluidStack(RocketFuels.RP1_Plus_Liquid_Oxygen, 1000);
+ } else if (aTier >= 3 && aTier <= 5) {
+ return FluidUtils.getFluidStack(RocketFuels.Dense_Hydrazine_Mix, 1000);
+ } else if (aTier >= 6 && aTier <= 7) {
+ return FluidUtils.getFluidStack(RocketFuels.Monomethylhydrazine_Plus_Nitric_Acid, 1000);
+ } else if (aTier >= 8 && aTier <= 10) {
+ return FluidUtils.getFluidStack(RocketFuels.Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide, 1000);
+ } else {
+ if (aTier == 0) {
+ return Materials.Fuel.getFluid(1000);
+ }
+ return null;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/goodgenerator/GG_Utils.java b/src/main/java/gtPlusPlus/xmod/goodgenerator/GG_Utils.java
index d501958fcd..a48802a0ac 100644
--- a/src/main/java/gtPlusPlus/xmod/goodgenerator/GG_Utils.java
+++ b/src/main/java/gtPlusPlus/xmod/goodgenerator/GG_Utils.java
@@ -1,55 +1,55 @@
package gtPlusPlus.xmod.goodgenerator;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import gtPlusPlus.xmod.bartworks.BW_Utils.NonMeta_MaterialItem;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class GG_Utils {
- private static final Class sClassFuelRodLoader;
- private static final Field[] sClassFuelRodLoaderFields;
-
- static {
- sClassFuelRodLoader = ReflectionUtils.getClass("goodgenerator.loader.FuelRodLoader");
- sClassFuelRodLoaderFields = ReflectionUtils.getAllFields(sClassFuelRodLoader);
- }
-
- public enum GG_Fuel_Rod {
- rodCompressedUranium,
- rodCompressedUranium_2,
- rodCompressedUranium_4,
- rodCompressedPlutonium,
- rodCompressedPlutonium_2,
- rodCompressedPlutonium_4,
- rodCompressedUraniumDepleted,
- rodCompressedUraniumDepleted_2,
- rodCompressedUraniumDepleted_4,
- rodCompressedPlutoniumDepleted,
- rodCompressedPlutoniumDepleted_2,
- rodCompressedPlutoniumDepleted_4,;
- }
-
- public static ItemStack getGG_Fuel_Rod(GG_Fuel_Rod aItem, int aAmount) {
- if (sClassFuelRodLoader != null) {
- return ItemUtils.getSimpleStack((Item) ReflectionUtils.getFieldValue(ReflectionUtils.getField(sClassFuelRodLoader, aItem.name())), aAmount);
- }
- return null;
- }
-
- public static ArrayList<ItemStack> getAll(int aStackSize){
- ArrayList<ItemStack> aItems = new ArrayList<ItemStack>();
- aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium, aStackSize));
- aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_2, aStackSize));
- aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_4, aStackSize));
- aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium, aStackSize));
- aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_2, aStackSize));
- aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_4, aStackSize));
- return aItems;
- }
-
+ private static final Class sClassFuelRodLoader;
+ private static final Field[] sClassFuelRodLoaderFields;
+
+ static {
+ sClassFuelRodLoader = ReflectionUtils.getClass("goodgenerator.loader.FuelRodLoader");
+ sClassFuelRodLoaderFields = ReflectionUtils.getAllFields(sClassFuelRodLoader);
+ }
+
+ public enum GG_Fuel_Rod {
+ rodCompressedUranium,
+ rodCompressedUranium_2,
+ rodCompressedUranium_4,
+ rodCompressedPlutonium,
+ rodCompressedPlutonium_2,
+ rodCompressedPlutonium_4,
+ rodCompressedUraniumDepleted,
+ rodCompressedUraniumDepleted_2,
+ rodCompressedUraniumDepleted_4,
+ rodCompressedPlutoniumDepleted,
+ rodCompressedPlutoniumDepleted_2,
+ rodCompressedPlutoniumDepleted_4,
+ ;
+ }
+
+ public static ItemStack getGG_Fuel_Rod(GG_Fuel_Rod aItem, int aAmount) {
+ if (sClassFuelRodLoader != null) {
+ return ItemUtils.getSimpleStack(
+ (Item) ReflectionUtils.getFieldValue(ReflectionUtils.getField(sClassFuelRodLoader, aItem.name())),
+ aAmount);
+ }
+ return null;
+ }
+
+ public static ArrayList<ItemStack> getAll(int aStackSize) {
+ ArrayList<ItemStack> aItems = new ArrayList<ItemStack>();
+ aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium, aStackSize));
+ aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_2, aStackSize));
+ aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_4, aStackSize));
+ aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium, aStackSize));
+ aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_2, aStackSize));
+ aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_4, aStackSize));
+ return aItems;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 913b72fb0a..c0652c2a6d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -3,10 +3,6 @@ package gtPlusPlus.xmod.gregtech;
import static gtPlusPlus.core.recipe.common.CI.bits;
import static gtPlusPlus.core.util.minecraft.MaterialUtils.getMaterialName;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Element;
@@ -18,8 +14,8 @@ import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_ModHandler.RecipeBits;
+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;
@@ -70,431 +66,478 @@ import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_MolecularTransformer
import gtPlusPlus.xmod.gregtech.recipes.RecipesToRemove;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechNitroDieselFix;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class HANDLER_GT {
- public static GT_Config mMaterialProperties = null;
+ public static GT_Config mMaterialProperties = null;
+
+ public static GTPP_Config sCustomWorldgenFile = null;
+ public static final List<WorldGen_GT> sWorldgenListEverglades = new ArrayList<WorldGen_GT>();
+ public static final List<WorldGen_GT_Australia> sWorldgenListAustralia = new ArrayList<WorldGen_GT_Australia>();
+ public static final List<GTPP_Worldgen> sCustomWorldgenList = new ArrayList<GTPP_Worldgen>();
+ public static GT_MetaGenerated_Tool sMetaGeneratedToolInstance;
+
+ public static void preInit() {
+
+ if (mMaterialProperties != null) {
+ GT_Materials.init(mMaterialProperties);
+ }
+
+ if (ConfigSwitches.enableOldGTcircuits && !CORE.GTNH) {
+ OldCircuitHandler.preInit();
+ }
+
+ GregtechFluidHandler.run();
+ }
+
+ public static void init() {
+
+ // Load General Blocks and set up some Basic Meta Tile Entity states
+ Gregtech_Blocks.run();
+
+ // Add Custom Pipes, Wires and Cables.
+ GregtechConduits.run();
+
+ // Register Tile Entities
+ COMPAT_HANDLER.registerGregtechMachines();
+
+ // Only loads if the config option is true (default: true)
+ if (CORE.ConfigSwitches.enableSkookumChoochers) {
+ sMetaGeneratedToolInstance = MetaGeneratedGregtechTools.getInstance();
+ }
+
+ if (ConfigSwitches.enableOldGTcircuits && !CORE.GTNH) {
+ OldCircuitHandler.init();
+ }
+
+ // Generates recipes for all gregtech smelting and alloy smelting combinations.
+ // RecipeGen_BlastSmelterGT.generateRecipes();
+ // new RecipeGen_BlastSmelterGT_Ex();
+
+ }
+
+ public static void postInit() {
+
+ // Only loads if the config option is true (default: true)
+ if (CORE.ConfigSwitches.enableSkookumChoochers) {
+ new ProcessingToolHeadChoocher().run();
+ }
+ new ProcessingAngleGrinder().run();
+ new ProcessingElectricSnips().run();
+ new ProcessingElectricButcherKnife().run();
+ new ProcessingElectricLighter().run();
+
+ if (CORE.ConfigSwitches.enableNitroFix) {
+ GregtechNitroDieselFix.run();
+ }
+
+ if (ConfigSwitches.enableOldGTcircuits && !CORE.GTNH) {
+ OldCircuitHandler.postInit();
+ }
+
+ // Register custom singles to the PA
+ AddCustomMachineToPA.register();
+
+ // Register the No-Bonus Special Behaviour.
+ Multiblock_API.registerSpecialMultiBehaviour(new NoOutputBonusMultiBehaviour());
+ Multiblock_API.registerSpecialMultiBehaviour(new NoSpeedBonusMultiBehaviour());
+ Multiblock_API.registerSpecialMultiBehaviour(new NoEUBonusMultiBehaviour());
+
+ // Register some custom recipe maps for any enabled multiblocks.
+ // MultiblockRecipeMapHandler.run();
+
+ if (GregtechItemList.Circuit_BioRecipeSelector.hasBeenSet()) {
+ for (int i = 1; i <= 24; i++) {
+ GregTech_API.registerConfigurationCircuit(CI.getNumberedBioCircuit(i), 0);
+ }
+ }
+
+ if (GregtechItemList.Circuit_T3RecipeSelector.hasBeenSet()) {
+ for (int i = 1; i <= 24; i++) {
+ GregTech_API.registerConfigurationCircuit(CI.getNumberedAdvancedCircuit(i), 3);
+ }
+ }
+ }
+
+ public static void onLoadComplete(FMLLoadCompleteEvent event) {
+ removeCrudeTurbineRotors();
+ // cleanAssemblyLineRecipeMap();
+ if (ConfigSwitches.enableHarderRecipesForHighTierCasings) {
+ removeOldHighTierCasingRecipes();
+ }
+ RecipesToRemove.go();
+ convertPyroToCokeOven();
+ generateElementalDuplicatorRecipes();
+ Meta_GT_Proxy.fixIC2FluidNames();
+ GT_Computercube_Description.addStandardDescriptions();
+ GT_ComputerCube_Setup.init();
+ RecipeLoader_AlgaeFarm.generateRecipes();
+ if (LoadedMods.AdvancedSolarPanel) {
+ RecipeLoader_MolecularTransformer.run();
+ }
+ }
+
+ public static void addNewOrePrefixes() {
+ for (CustomOrePrefix aPrefixTest : CustomOrePrefix.values()) {
+ Logger.INFO("Adding " + aPrefixTest.name() + " to OrePrefixes Enum.");
+ Logger.INFO("Injecting: " + aPrefixTest.addToEnum());
+ }
+ }
+
+ private static void generateElementalDuplicatorRecipes() {
+ for (GT_Recipe aRecipe : GT_Recipe_Map.sReplicatorFakeRecipes.mRecipeList) {
+ Object aDataOrb = aRecipe.mSpecialItems;
+ if (aDataOrb != null) {
+ ItemStack aOutput = aRecipe.mOutputs[0];
+ if (aOutput != null) {
+ FluidStack aFluid = aRecipe.mFluidInputs[0];
+ if (aFluid != null && aFluid.amount > 0) {
+ ItemStack tDataOrb = GregtechMTE_ElementalDuplicator.getSpecialSlotStack(aRecipe);
+ Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb))
+ .mLinkedMaterials
+ .get(0);
+ FluidStack aOutputFluid = null;
+ ItemStack aOutputItem = null;
+ if (tMaterial != null) {
+ boolean aUsingFluid = false;
+ if ((aOutputItem = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null) {
+ if ((aOutputItem = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) {
+ aOutputFluid = GT_Utility.getFluidForFilledItem(aOutputItem, true);
+ aUsingFluid = true;
+ }
+ }
+ GTPP_Recipe aNewRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {},
+ new ItemStack[] {!aUsingFluid ? aOutputItem : null},
+ aRecipe.mSpecialItems,
+ null,
+ aRecipe.mFluidInputs,
+ new FluidStack[] {aUsingFluid ? aOutputFluid : null},
+ aRecipe.mDuration,
+ aRecipe.mEUt,
+ aRecipe.mFluidInputs[0].amount);
+ GTPP_Recipe_Map.sElementalDuplicatorRecipes.add(aNewRecipe);
+
+ Logger.INFO("[EM] Generated recipe for " + tMaterial.mLocalizedName + ", Outputs "
+ + (aUsingFluid ? "Fluid" : "Dust"));
+ }
+ } else {
+ Logger.INFO("[EM] Bad UU Requirement. " + RecipeUtils.getRecipeInfo(aRecipe));
+ }
+ } else {
+ Logger.INFO("[EM] Bad Output. " + RecipeUtils.getRecipeInfo(aRecipe));
+ }
+ } else {
+ Logger.INFO("[EM] Bad Data Orb. " + RecipeUtils.getRecipeInfo(aRecipe));
+ }
+ }
+ int aSize = GTPP_Recipe_Map.sElementalDuplicatorRecipes.mRecipeList.size();
+ Logger.INFO("[EM] Generated " + aSize + "/" + GT_Recipe_Map.sReplicatorFakeRecipes.mRecipeList.size()
+ + " Replicator recipes.");
+ }
+
+ private static void convertPyroToCokeOven() {
+ if (ReflectionUtils.doesFieldExist(GT_Recipe.GT_Recipe_Map.class, "sPyrolyseRecipes")) {
+ int aCount = 0;
+ GT_Recipe_Map aMap = StaticFields59.getPyrolyseRecipeMap();
+ if (aMap != null) {
+ for (GT_Recipe g : aMap.mRecipeList) {
+ if (AddGregtechRecipe.importPyroRecipe(g)) {
+ aCount++;
+ }
+ }
+ Logger.INFO("Converted " + aCount + " Pyrolyse recipes into Industrial Coke Oven recipes.");
+ }
+ }
+ }
+
+ private static GT_Recipe replaceItemInRecipeWithAnother(
+ GT_Recipe aRecipe, ItemStack aExisting, ItemStack aNewItem) {
+ ItemStack[] aInputItemsCopy = aRecipe.mInputs;
+ String aOutputName = ItemUtils.getItemName(aRecipe.mOutputs[0]);
+ boolean aDidChange = false;
+ Logger.INFO("Attempting to Modify Recipe for " + aOutputName);
+ for (int i = 0; i < aRecipe.mInputs.length; i++) {
+ ItemStack aCurrentInputSlot = aRecipe.mInputs[i];
+ if (aCurrentInputSlot != null) {
+ if (GT_Utility.areStacksEqual(aCurrentInputSlot, aExisting, true)) {
+ aInputItemsCopy[i] = ItemUtils.getSimpleStack(aNewItem, aCurrentInputSlot.stackSize);
+ aDidChange = true;
+ }
+ }
+ }
+ if (aDidChange) {
+ aRecipe.mInputs = aInputItemsCopy;
+ Logger.INFO("Modifed Recipe for " + aOutputName);
+ return aRecipe;
+ } else {
+ Logger.INFO("Failed to Modify Recipe for " + aOutputName);
+ return aRecipe;
+ }
+ }
- public static GTPP_Config sCustomWorldgenFile = null;
- public static final List<WorldGen_GT> sWorldgenListEverglades = new ArrayList<WorldGen_GT>();
- public static final List<WorldGen_GT_Australia> sWorldgenListAustralia = new ArrayList<WorldGen_GT_Australia>();
- public static final List<GTPP_Worldgen> sCustomWorldgenList = new ArrayList<GTPP_Worldgen>();
- public static GT_MetaGenerated_Tool sMetaGeneratedToolInstance;
-
- public static void preInit(){
-
- if (mMaterialProperties != null){
- GT_Materials.init(mMaterialProperties);
- }
-
- if (ConfigSwitches.enableOldGTcircuits && !CORE.GTNH){
- OldCircuitHandler.preInit();
- }
-
- GregtechFluidHandler.run();
- }
-
- public static void init(){
-
- //Load General Blocks and set up some Basic Meta Tile Entity states
- Gregtech_Blocks.run();
-
- //Add Custom Pipes, Wires and Cables.
- GregtechConduits.run();
-
- //Register Tile Entities
- COMPAT_HANDLER.registerGregtechMachines();
-
-
- //Only loads if the config option is true (default: true)
- if (CORE.ConfigSwitches.enableSkookumChoochers){
- sMetaGeneratedToolInstance= MetaGeneratedGregtechTools.getInstance();
- }
-
- if (ConfigSwitches.enableOldGTcircuits && !CORE.GTNH){
- OldCircuitHandler.init();
- }
-
- //Generates recipes for all gregtech smelting and alloy smelting combinations.
- //RecipeGen_BlastSmelterGT.generateRecipes();
- //new RecipeGen_BlastSmelterGT_Ex();
-
- }
-
- public static void postInit(){
-
- //Only loads if the config option is true (default: true)
- if (CORE.ConfigSwitches.enableSkookumChoochers){
- new ProcessingToolHeadChoocher().run();
- }
- new ProcessingAngleGrinder().run();
- new ProcessingElectricSnips().run();
- new ProcessingElectricButcherKnife().run();
- new ProcessingElectricLighter().run();
-
- if (CORE.ConfigSwitches.enableNitroFix){
- GregtechNitroDieselFix.run();
- }
-
- if (ConfigSwitches.enableOldGTcircuits && !CORE.GTNH){
- OldCircuitHandler.postInit();
- }
-
- // Register custom singles to the PA
- AddCustomMachineToPA.register();
-
-
- // Register the No-Bonus Special Behaviour.
- Multiblock_API.registerSpecialMultiBehaviour(new NoOutputBonusMultiBehaviour());
- Multiblock_API.registerSpecialMultiBehaviour(new NoSpeedBonusMultiBehaviour());
- Multiblock_API.registerSpecialMultiBehaviour(new NoEUBonusMultiBehaviour());
-
- //Register some custom recipe maps for any enabled multiblocks.
- //MultiblockRecipeMapHandler.run();
-
- if (GregtechItemList.Circuit_BioRecipeSelector.hasBeenSet()) {
- for (int i = 1; i <= 24; i++) {
- GregTech_API.registerConfigurationCircuit(CI.getNumberedBioCircuit(i), 0);
- }
- }
-
- if (GregtechItemList.Circuit_T3RecipeSelector.hasBeenSet()) {
- for (int i = 1; i <= 24; i++) {
- GregTech_API.registerConfigurationCircuit(CI.getNumberedAdvancedCircuit(i), 3);
- }
- }
- }
-
- public static void onLoadComplete(FMLLoadCompleteEvent event) {
- removeCrudeTurbineRotors();
- //cleanAssemblyLineRecipeMap();
- if (ConfigSwitches.enableHarderRecipesForHighTierCasings) {
- removeOldHighTierCasingRecipes();
- }
- RecipesToRemove.go();
- convertPyroToCokeOven();
- generateElementalDuplicatorRecipes();
- Meta_GT_Proxy.fixIC2FluidNames();
- GT_Computercube_Description.addStandardDescriptions();
- GT_ComputerCube_Setup.init();
- RecipeLoader_AlgaeFarm.generateRecipes();
- if (LoadedMods.AdvancedSolarPanel) {
- RecipeLoader_MolecularTransformer.run();
- }
- }
-
- public static void addNewOrePrefixes() {
- for (CustomOrePrefix aPrefixTest : CustomOrePrefix.values()) {
- Logger.INFO("Adding "+aPrefixTest.name()+" to OrePrefixes Enum.");
- Logger.INFO("Injecting: "+aPrefixTest.addToEnum());
- }
- }
-
-
- private static void generateElementalDuplicatorRecipes() {
- for (GT_Recipe aRecipe : GT_Recipe_Map.sReplicatorFakeRecipes.mRecipeList) {
- Object aDataOrb = aRecipe.mSpecialItems;
- if (aDataOrb != null) {
- ItemStack aOutput = aRecipe.mOutputs[0];
- if (aOutput != null) {
- FluidStack aFluid = aRecipe.mFluidInputs[0];
- if (aFluid != null && aFluid.amount > 0) {
- ItemStack tDataOrb = GregtechMTE_ElementalDuplicator.getSpecialSlotStack(aRecipe);
- Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0);
- FluidStack aOutputFluid = null;
- ItemStack aOutputItem = null;
- if (tMaterial != null) {
- boolean aUsingFluid = false;
- if ((aOutputItem = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null) {
- if ((aOutputItem = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) {
- aOutputFluid = GT_Utility.getFluidForFilledItem(aOutputItem, true);
- aUsingFluid = true;
- }
- }
- GTPP_Recipe aNewRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {},
- new ItemStack[] {!aUsingFluid ? aOutputItem : null},
- aRecipe.mSpecialItems,
- null,
- aRecipe.mFluidInputs,
- new FluidStack[] {aUsingFluid ? aOutputFluid : null},
- aRecipe.mDuration,
- aRecipe.mEUt,
- aRecipe.mFluidInputs[0].amount);
- GTPP_Recipe_Map.sElementalDuplicatorRecipes.add(aNewRecipe);
-
- Logger.INFO("[EM] Generated recipe for "+tMaterial.mLocalizedName+", Outputs "+(aUsingFluid ? "Fluid" : "Dust"));
- }
- }
- else {
- Logger.INFO("[EM] Bad UU Requirement. "+RecipeUtils.getRecipeInfo(aRecipe));
- }
- }
- else {
- Logger.INFO("[EM] Bad Output. "+RecipeUtils.getRecipeInfo(aRecipe));
- }
- }
- else {
- Logger.INFO("[EM] Bad Data Orb. "+RecipeUtils.getRecipeInfo(aRecipe));
- }
- }
- int aSize = GTPP_Recipe_Map.sElementalDuplicatorRecipes.mRecipeList.size();
- Logger.INFO("[EM] Generated "+aSize+"/"+GT_Recipe_Map.sReplicatorFakeRecipes.mRecipeList.size()+" Replicator recipes.");
- }
-
- private static void convertPyroToCokeOven() {
- if (ReflectionUtils.doesFieldExist(GT_Recipe.GT_Recipe_Map.class, "sPyrolyseRecipes")) {
- int aCount = 0;
- GT_Recipe_Map aMap = StaticFields59.getPyrolyseRecipeMap();
- if (aMap != null) {
- for (GT_Recipe g : aMap.mRecipeList) {
- if (AddGregtechRecipe.importPyroRecipe(g)) {
- aCount++;
- }
- }
- Logger.INFO("Converted "+aCount+" Pyrolyse recipes into Industrial Coke Oven recipes.");
- }
- }
+ private static void updateRecipeMap(GT_Recipe aOld, GT_Recipe aNew, GT_Recipe_Map aMap) {
+ RecipeUtils.removeGtRecipe(aOld, aMap);
+ RecipeUtils.addGtRecipe(aNew, aMap);
+ Logger.INFO("Updating recipe map: " + aMap.mNEIName);
+ Logger.INFO("Removed Recipe with hash: " + aOld.hashCode());
+ Logger.INFO("Added Recipe with hash: " + aNew.hashCode());
}
- private static GT_Recipe replaceItemInRecipeWithAnother(GT_Recipe aRecipe, ItemStack aExisting, ItemStack aNewItem) {
- ItemStack[] aInputItemsCopy = aRecipe.mInputs;
- String aOutputName = ItemUtils.getItemName(aRecipe.mOutputs[0]);
- boolean aDidChange = false;
- Logger.INFO("Attempting to Modify Recipe for "+aOutputName);
- for (int i=0;i<aRecipe.mInputs.length;i++) {
- ItemStack aCurrentInputSlot = aRecipe.mInputs[i];
- if (aCurrentInputSlot != null) {
- if (GT_Utility.areStacksEqual(aCurrentInputSlot, aExisting, true)) {
- aInputItemsCopy[i] = ItemUtils.getSimpleStack(aNewItem, aCurrentInputSlot.stackSize);
- aDidChange = true;
- }
- }
- }
- if (aDidChange) {
- aRecipe.mInputs = aInputItemsCopy;
- Logger.INFO("Modifed Recipe for "+aOutputName);
- return aRecipe;
- }
- else {
- Logger.INFO("Failed to Modify Recipe for "+aOutputName);
- return aRecipe;
- }
- }
-
- private static void updateRecipeMap(GT_Recipe aOld, GT_Recipe aNew, GT_Recipe_Map aMap) {
- RecipeUtils.removeGtRecipe(aOld, aMap);
- RecipeUtils.addGtRecipe(aNew, aMap);
- Logger.INFO("Updating recipe map: "+aMap.mNEIName);
- Logger.INFO("Removed Recipe with hash: "+aOld.hashCode());
- Logger.INFO("Added Recipe with hash: "+aNew.hashCode());
-
- }
-
- private static void removeOldHighTierCasingRecipes() {
+ private static void removeOldHighTierCasingRecipes() {
Logger.INFO("Trying to appropriately retier GT Machine Hulls/Casings from LuV+");
- final Object aHardCasingsTest = StaticFields59.getFieldFromGregtechProxy("mHardMachineCasings");
+ final Object aHardCasingsTest = StaticFields59.getFieldFromGregtechProxy("mHardMachineCasings");
+
+ boolean aHardCasings = aHardCasingsTest != null ? (boolean) aHardCasingsTest : false;
- boolean aHardCasings = aHardCasingsTest != null ? (boolean) aHardCasingsTest : false;
-
- Logger.INFO("Are Hard casings/hulls enabled within GT? "+(aHardCasingsTest == null ? "Version does not support config option" : aHardCasings));
+ Logger.INFO("Are Hard casings/hulls enabled within GT? "
+ + (aHardCasingsTest == null ? "Version does not support config option" : aHardCasings));
- // Static objects to save memory
- ItemStack aCasing_LUV = CI.machineCasing_LuV;
- ItemStack aCasing_ZPM = CI.machineCasing_ZPM;
- ItemStack aCasing_UV = CI.machineCasing_UV;
- ItemStack aCasing_MAX = CI.machineCasing_MAX;
+ // Static objects to save memory
+ ItemStack aCasing_LUV = CI.machineCasing_LuV;
+ ItemStack aCasing_ZPM = CI.machineCasing_ZPM;
+ ItemStack aCasing_UV = CI.machineCasing_UV;
+ ItemStack aCasing_MAX = CI.machineCasing_MAX;
- ItemStack aHull_LUV = CI.machineHull_LuV;
- ItemStack aHull_ZPM = CI.machineHull_ZPM;
- ItemStack aHull_UV = CI.machineHull_UV;
- ItemStack aHull_MAX = CI.machineHull_MAX;
+ ItemStack aHull_LUV = CI.machineHull_LuV;
+ ItemStack aHull_ZPM = CI.machineHull_ZPM;
+ ItemStack aHull_UV = CI.machineHull_UV;
+ ItemStack aHull_MAX = CI.machineHull_MAX;
int aTier_LUV = 5;
int aTier_ZPM = 6;
int aTier_UV = 7;
- //int aTier_MAX = 8;
-
+ // int aTier_MAX = 8;
- ItemStack[] aCasings = new ItemStack[] {aCasing_LUV, aCasing_ZPM, aCasing_UV, aCasing_MAX};
- ItemStack[] aHulls = new ItemStack[] {aHull_LUV, aHull_ZPM, aHull_UV, aHull_MAX};
+ ItemStack[] aCasings = new ItemStack[] {aCasing_LUV, aCasing_ZPM, aCasing_UV, aCasing_MAX};
+ ItemStack[] aHulls = new ItemStack[] {aHull_LUV, aHull_ZPM, aHull_UV, aHull_MAX};
- // Remove Hand Crafting Recipes
+ // Remove Hand Crafting Recipes
- // Casings
+ // Casings
Logger.INFO("Removing shaped crafting for Casings.");
- RecipeUtils.removeRecipeByOutput(aCasing_LUV);
- RecipeUtils.removeRecipeByOutput(aCasing_ZPM);
- RecipeUtils.removeRecipeByOutput(aCasing_UV);
- //RecipeUtils.removeRecipeByOutput(aCasing_MAX);
+ RecipeUtils.removeRecipeByOutput(aCasing_LUV);
+ RecipeUtils.removeRecipeByOutput(aCasing_ZPM);
+ RecipeUtils.removeRecipeByOutput(aCasing_UV);
+ // RecipeUtils.removeRecipeByOutput(aCasing_MAX);
- // Hulls
+ // Hulls
Logger.INFO("Removing shaped crafting for Hulls.");
- RecipeUtils.removeRecipeByOutput(aHull_LUV);
- RecipeUtils.removeRecipeByOutput(aHull_ZPM);
- RecipeUtils.removeRecipeByOutput(aHull_UV);
- //RecipeUtils.removeRecipeByOutput(aHull_MAX);
-
- // Modify Assembler Recipes
- Logger.INFO("Attempting to modify existing Assembly recipes for Casings & Hulls, this should provide best compatibility.");
+ RecipeUtils.removeRecipeByOutput(aHull_LUV);
+ RecipeUtils.removeRecipeByOutput(aHull_ZPM);
+ RecipeUtils.removeRecipeByOutput(aHull_UV);
+ // RecipeUtils.removeRecipeByOutput(aHull_MAX);
+
+ // Modify Assembler Recipes
+ Logger.INFO(
+ "Attempting to modify existing Assembly recipes for Casings & Hulls, this should provide best compatibility.");
int aUpdateCount = 0;
-
+
AutoMap<Pair<GT_Recipe, GT_Recipe>> aDataToModify = new AutoMap<Pair<GT_Recipe, GT_Recipe>>();
-
-
- Outer :for (final GT_Recipe r : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList) {
-
- if (r != null && r.mOutputs != null && r.mOutputs.length > 0) {
-
- GT_Recipe aOldRecipeCopy = r;
- GT_Recipe aNewRecipe = r.copy();
-
- //Casings
- Inner : for (ItemStack aCasingObject : aCasings) {
- if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aCasingObject)) {
- String aOutputName = ItemUtils.getItemName(aOldRecipeCopy.mOutputs[0]);
- Logger.INFO("Attempting to Modify Assembly Recipe for "+aOutputName);
- //Replace Chrome
- if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aCasing_LUV)) {
- aNewRecipe = replaceItemInRecipeWithAnother(aOldRecipeCopy, ItemUtils.getItemStackOfAmountFromOreDict("plateChrome", 1), ELEMENT.getInstance().SELENIUM.getPlate(1));
- aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
- aUpdateCount++;
- continue Outer;
- }
- //Replace Iridium
- else if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aCasing_ZPM)) {
- aNewRecipe = replaceItemInRecipeWithAnother(aOldRecipeCopy, ItemUtils.getItemStackOfAmountFromOreDict("plateIridium", 1), CI.getPlate(aTier_ZPM, 1));
- aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
+
+ Outer:
+ for (final GT_Recipe r : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList) {
+
+ if (r != null && r.mOutputs != null && r.mOutputs.length > 0) {
+
+ GT_Recipe aOldRecipeCopy = r;
+ GT_Recipe aNewRecipe = r.copy();
+
+ // Casings
+ Inner:
+ for (ItemStack aCasingObject : aCasings) {
+ if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aCasingObject)) {
+ String aOutputName = ItemUtils.getItemName(aOldRecipeCopy.mOutputs[0]);
+ Logger.INFO("Attempting to Modify Assembly Recipe for " + aOutputName);
+ // Replace Chrome
+ if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aCasing_LUV)) {
+ aNewRecipe = replaceItemInRecipeWithAnother(
+ aOldRecipeCopy,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateChrome", 1),
+ ELEMENT.getInstance().SELENIUM.getPlate(1));
+ aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
+ aUpdateCount++;
+ continue Outer;
+ }
+ // Replace Iridium
+ else if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aCasing_ZPM)) {
+ aNewRecipe = replaceItemInRecipeWithAnother(
+ aOldRecipeCopy,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateIridium", 1),
+ CI.getPlate(aTier_ZPM, 1));
+ aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
aUpdateCount++;
- continue Outer;
- }
- //Replace Osmium
- else if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aCasing_UV)) {
- aNewRecipe = replaceItemInRecipeWithAnother(aOldRecipeCopy, ItemUtils.getItemStackOfAmountFromOreDict("plateOsmium", 1), CI.getPlate(aTier_UV, 1));
- aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
+ continue Outer;
+ }
+ // Replace Osmium
+ else if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aCasing_UV)) {
+ aNewRecipe = replaceItemInRecipeWithAnother(
+ aOldRecipeCopy,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateOsmium", 1),
+ CI.getPlate(aTier_UV, 1));
+ aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
aUpdateCount++;
- continue Outer;
- }
- //else if (aOldRecipeCopy.mOutputs[0] == aCasing_LUV) {
- // aOldRecipeCopy = replaceItemInRecipeWithAnother(aOldRecipeCopy, ItemUtils.getItemStackOfAmountFromOreDict("plateChrome", 8), CI.getPlate(aTier_MAX, 8));
- // updateRecipeMap(aOldRecipeCopy, aNewRecipe, GT_Recipe.GT_Recipe_Map.sAssemblerRecipes);
- //}
- else {
- continue Inner;
- }
- }
- }
-
- //Hulls
- Inner : for (ItemStack aHullObject : aHulls) {
- if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aHullObject)) {
+ continue Outer;
+ }
+ // else if (aOldRecipeCopy.mOutputs[0] == aCasing_LUV) {
+ // aOldRecipeCopy = replaceItemInRecipeWithAnother(aOldRecipeCopy,
+ // ItemUtils.getItemStackOfAmountFromOreDict("plateChrome", 8), CI.getPlate(aTier_MAX, 8));
+ // updateRecipeMap(aOldRecipeCopy, aNewRecipe, GT_Recipe.GT_Recipe_Map.sAssemblerRecipes);
+ // }
+ else {
+ continue Inner;
+ }
+ }
+ }
+
+ // Hulls
+ Inner:
+ for (ItemStack aHullObject : aHulls) {
+ if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aHullObject)) {
String aOutputName = ItemUtils.getItemName(aOldRecipeCopy.mOutputs[0]);
- Logger.INFO("Attempting to Modify Assembly Recipe for "+aOutputName);
- //Replace Chrome
- if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aHull_LUV)) {
- aNewRecipe = replaceItemInRecipeWithAnother(aOldRecipeCopy, ItemUtils.getItemStackOfAmountFromOreDict("plateChrome", 1), ELEMENT.getInstance().SELENIUM.getPlate(1));
- aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
+ Logger.INFO("Attempting to Modify Assembly Recipe for " + aOutputName);
+ // Replace Chrome
+ if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aHull_LUV)) {
+ aNewRecipe = replaceItemInRecipeWithAnother(
+ aOldRecipeCopy,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateChrome", 1),
+ ELEMENT.getInstance().SELENIUM.getPlate(1));
+ aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
aUpdateCount++;
- continue Outer;
- }
- //Replace Iridium
- else if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aHull_ZPM)) {
- aNewRecipe = replaceItemInRecipeWithAnother(aOldRecipeCopy, ItemUtils.getItemStackOfAmountFromOreDict("plateIridium", 1), CI.getPlate(aTier_ZPM, 1));
- aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
+ continue Outer;
+ }
+ // Replace Iridium
+ else if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aHull_ZPM)) {
+ aNewRecipe = replaceItemInRecipeWithAnother(
+ aOldRecipeCopy,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateIridium", 1),
+ CI.getPlate(aTier_ZPM, 1));
+ aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
aUpdateCount++;
- continue Outer;
- }
- //Replace Osmium
- else if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aHull_UV)) {
- aNewRecipe = replaceItemInRecipeWithAnother(aOldRecipeCopy, ItemUtils.getItemStackOfAmountFromOreDict("plateOsmium", 1), CI.getPlate(aTier_UV, 1));
- aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
+ continue Outer;
+ }
+ // Replace Osmium
+ else if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aHull_UV)) {
+ aNewRecipe = replaceItemInRecipeWithAnother(
+ aOldRecipeCopy,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateOsmium", 1),
+ CI.getPlate(aTier_UV, 1));
+ aDataToModify.put(new Pair<GT_Recipe, GT_Recipe>(r, aNewRecipe));
aUpdateCount++;
- continue Outer;
- }
- //else if (aOldRecipeCopy.mOutputs[0] == aHull_LUV) {
- // aOldRecipeCopy = replaceItemInRecipeWithAnother(aOldRecipeCopy, ItemUtils.getItemStackOfAmountFromOreDict("plateChrome", 8), CI.getPlate(aTier_MAX, 8));
- // updateRecipeMap(aOldRecipeCopy, aNewRecipe, GT_Recipe.GT_Recipe_Map.sAssemblerRecipes);
- //}
- else {
- continue Inner;
- }
- }
- }
- }
- }
-
- Logger.INFO("There is "+aUpdateCount+" recipes flagged for update.");
-
- if (aUpdateCount > 0) {
- for (Pair<GT_Recipe, GT_Recipe> g : aDataToModify) {
- updateRecipeMap(g.getKey(), g.getValue(), GT_Recipe.GT_Recipe_Map.sAssemblerRecipes);
- }
- Logger.INFO("Modified "+aUpdateCount+" recipes.");
+ continue Outer;
+ }
+ // else if (aOldRecipeCopy.mOutputs[0] == aHull_LUV) {
+ // aOldRecipeCopy = replaceItemInRecipeWithAnother(aOldRecipeCopy,
+ // ItemUtils.getItemStackOfAmountFromOreDict("plateChrome", 8), CI.getPlate(aTier_MAX, 8));
+ // updateRecipeMap(aOldRecipeCopy, aNewRecipe, GT_Recipe.GT_Recipe_Map.sAssemblerRecipes);
+ // }
+ else {
+ continue Inner;
+ }
+ }
+ }
+ }
}
-
+ Logger.INFO("There is " + aUpdateCount + " recipes flagged for update.");
+
+ if (aUpdateCount > 0) {
+ for (Pair<GT_Recipe, GT_Recipe> g : aDataToModify) {
+ updateRecipeMap(g.getKey(), g.getValue(), GT_Recipe.GT_Recipe_Map.sAssemblerRecipes);
+ }
+ Logger.INFO("Modified " + aUpdateCount + " recipes.");
+ }
Logger.INFO("Adding new Shaped recipes for Casings.");
- GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), bits, new Object[]{"PPP", "PwP", "PPP", 'P', ELEMENT.getInstance().SELENIUM.getPlate(1)});
- GT_ModHandler.addCraftingRecipe(ItemList.Casing_ZPM.get(1), bits, new Object[]{"PPP", "PwP", "PPP", 'P', CI.getPlate(aTier_ZPM, 1)});
- GT_ModHandler.addCraftingRecipe(ItemList.Casing_UV.get(1), bits, new Object[]{"PPP", "PwP", "PPP", 'P', CI.getPlate(aTier_UV, 1)});
- //GT_ModHandler.addCraftingRecipe(ItemList.Casing_MAX.get(1), bits, new Object[]{"PPP", "PwP", "PPP", 'P', OrePrefixes.plate.get(Materials.Neutronium)});
-
- if (!aHardCasings) {
- Logger.INFO("Adding new easy Shaped recipes for Hulls.");
- GT_ModHandler.addCraftingRecipe(ItemList.Hull_LuV.get(1),
- RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[]{"CMC", 'M', ItemList.Casing_LuV, 'C',
- OrePrefixes.cableGt01.get(Materials.VanadiumGallium)});
- GT_ModHandler.addCraftingRecipe(ItemList.Hull_ZPM.get(1),
- RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED,
- new Object[]{"CMC", 'M', ItemList.Casing_ZPM, 'C', OrePrefixes.cableGt01.get(Materials.Naquadah)});
- GT_ModHandler.addCraftingRecipe(ItemList.Hull_UV.get(1),
- RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[]{"CMC", 'M', ItemList.Casing_UV, 'C',
- OrePrefixes.wireGt04.get(Materials.NaquadahAlloy)});
- /*GT_ModHandler.addCraftingRecipe(ItemList.Hull_MAX.get(1),
- RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[]{"CMC", 'M', ItemList.Casing_MAX, 'C',
- OrePrefixes.wireGt01.get(Materials.Superconductor)});*/
- }
- else {
-
-
- Materials aPolytetrafluoroethylene = MaterialUtils.getMaterial("Polytetrafluoroethylene", "Plastic");
-
- Logger.INFO("Adding new hard Shaped recipes for Hulls.");
- GT_ModHandler.addCraftingRecipe(ItemList.Hull_LuV.get(1),
- RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED,
- new Object[]{"PHP", "CMC", 'M', ItemList.Casing_LuV, 'C',
- OrePrefixes.cableGt01.get(Materials.VanadiumGallium), 'H',
- ELEMENT.getInstance().SELENIUM.getPlate(1), 'P', OrePrefixes.plate.get(Materials.Plastic)});
- GT_ModHandler.addCraftingRecipe(ItemList.Hull_ZPM.get(1),
- RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED,
- new Object[]{"PHP", "CMC", 'M', ItemList.Casing_ZPM, 'C',
- OrePrefixes.cableGt01.get(Materials.Naquadah), 'H',
- CI.getPlate(aTier_ZPM, 1), 'P',
- OrePrefixes.plate.get(aPolytetrafluoroethylene)});
- GT_ModHandler.addCraftingRecipe(ItemList.Hull_UV.get(1),
- RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED,
- new Object[]{"PHP", "CMC", 'M', ItemList.Casing_UV, 'C',
- OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), 'H',
- CI.getPlate(aTier_UV, 1), 'P',
- OrePrefixes.plate.get(aPolytetrafluoroethylene)});
- /*GT_ModHandler.addCraftingRecipe(ItemList.Hull_MAX.get(1),
+ GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), bits, new Object[] {
+ "PPP", "PwP", "PPP", 'P', ELEMENT.getInstance().SELENIUM.getPlate(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ ItemList.Casing_ZPM.get(1), bits, new Object[] {"PPP", "PwP", "PPP", 'P', CI.getPlate(aTier_ZPM, 1)});
+ GT_ModHandler.addCraftingRecipe(
+ ItemList.Casing_UV.get(1), bits, new Object[] {"PPP", "PwP", "PPP", 'P', CI.getPlate(aTier_UV, 1)});
+ // GT_ModHandler.addCraftingRecipe(ItemList.Casing_MAX.get(1), bits, new Object[]{"PPP", "PwP", "PPP", 'P',
+ // OrePrefixes.plate.get(Materials.Neutronium)});
+
+ if (!aHardCasings) {
+ Logger.INFO("Adding new easy Shaped recipes for Hulls.");
+ GT_ModHandler.addCraftingRecipe(
+ ItemList.Hull_LuV.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] {
+ "CMC", 'M', ItemList.Casing_LuV, 'C', OrePrefixes.cableGt01.get(Materials.VanadiumGallium)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ ItemList.Hull_ZPM.get(1),
RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED,
- new Object[]{"PHP", "CMC", 'M', ItemList.Casing_MAX, 'C',
- OrePrefixes.wireGt01.get(Materials.Superconductor), 'H',
- OrePrefixes.plate.get(Materials.Neutronium), 'P',
- OrePrefixes.plate.get(Materials.Polytetrafluoroethylene)});*/
- }
-
+ new Object[] {"CMC", 'M', ItemList.Casing_ZPM, 'C', OrePrefixes.cableGt01.get(Materials.Naquadah)});
+ GT_ModHandler.addCraftingRecipe(
+ ItemList.Hull_UV.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] {
+ "CMC", 'M', ItemList.Casing_UV, 'C', OrePrefixes.wireGt04.get(Materials.NaquadahAlloy)
+ });
+ /*GT_ModHandler.addCraftingRecipe(ItemList.Hull_MAX.get(1),
+ RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[]{"CMC", 'M', ItemList.Casing_MAX, 'C',
+ OrePrefixes.wireGt01.get(Materials.Superconductor)});*/
+ } else {
+
+ Materials aPolytetrafluoroethylene = MaterialUtils.getMaterial("Polytetrafluoroethylene", "Plastic");
+
+ Logger.INFO("Adding new hard Shaped recipes for Hulls.");
+ GT_ModHandler.addCraftingRecipe(
+ ItemList.Hull_LuV.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] {
+ "PHP",
+ "CMC",
+ 'M',
+ ItemList.Casing_LuV,
+ 'C',
+ OrePrefixes.cableGt01.get(Materials.VanadiumGallium),
+ 'H',
+ ELEMENT.getInstance().SELENIUM.getPlate(1),
+ 'P',
+ OrePrefixes.plate.get(Materials.Plastic)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ ItemList.Hull_ZPM.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] {
+ "PHP",
+ "CMC",
+ 'M',
+ ItemList.Casing_ZPM,
+ 'C',
+ OrePrefixes.cableGt01.get(Materials.Naquadah),
+ 'H',
+ CI.getPlate(aTier_ZPM, 1),
+ 'P',
+ OrePrefixes.plate.get(aPolytetrafluoroethylene)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ ItemList.Hull_UV.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] {
+ "PHP",
+ "CMC",
+ 'M',
+ ItemList.Casing_UV,
+ 'C',
+ OrePrefixes.wireGt04.get(Materials.NaquadahAlloy),
+ 'H',
+ CI.getPlate(aTier_UV, 1),
+ 'P',
+ OrePrefixes.plate.get(aPolytetrafluoroethylene)
+ });
+ /*GT_ModHandler.addCraftingRecipe(ItemList.Hull_MAX.get(1),
+ RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED,
+ new Object[]{"PHP", "CMC", 'M', ItemList.Casing_MAX, 'C',
+ OrePrefixes.wireGt01.get(Materials.Superconductor), 'H',
+ OrePrefixes.plate.get(Materials.Neutronium), 'P',
+ OrePrefixes.plate.get(Materials.Polytetrafluoroethylene)});*/
+ }
+ // Casings
- //Casings
-
/*GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 8L),
ItemList.Circuit_Integrated.getWithDamage(0L, 8L, new Object[0]),
ItemList.Casing_LuV.get(1), 50, 16);
@@ -506,13 +549,11 @@ public class HANDLER_GT {
ItemList.Casing_UV.get(1), 50, 16);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8L),
ItemList.Circuit_Integrated.getWithDamage(0L, 8L, new Object[0]),
- ItemList.Casing_MAX.get(1), 50, 16); */
-
-
+ ItemList.Casing_MAX.get(1), 50, 16); */
- //Hulls
+ // Hulls
- //Hard Hulls
+ // Hard Hulls
/*GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.VanadiumGallium, 2L),
ItemList.Casing_LuV.get(1), Materials.Plastic.getMolten(288L),
@@ -528,7 +569,7 @@ public class HANDLER_GT {
ItemList.Casing_MAX.get(1), Materials.Polytetrafluoroethylene.getMolten(288L),
ItemList.Hull_MAX.get(1), 50, 16);*/
- //Easy Hulls
+ // Easy Hulls
/*GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.VanadiumGallium, 2L),
ItemList.Casing_LuV.get(1), ItemList.Hull_LuV.get(1), 50, 16);
@@ -539,144 +580,143 @@ public class HANDLER_GT {
GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 2L),
ItemList.Casing_MAX.get(1), ItemList.Hull_MAX.get(1), 50, 16);*/
- }
-
- private static int removeCrudeTurbineRotors() {
- int aRemoved = 0;
- int CUT = CORE.turbineCutoffBase;
- Item aU;
- Collection<GT_Recipe> aAssRecipes = GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList;
- //170, 172, 174, 176
- if (aAssRecipes.size() > 0 && (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH)) {
- recipe: for (GT_Recipe aG : aAssRecipes) {
- if (aG.mOutputs != null && aG.mOutputs.length > 0) {
- outputs: for (ItemStack aI : aG.mOutputs) {
- if (aI == null) {
- continue;
- }
- aU = aI.getItem();
- if (aU == null) {
- continue;
- }
- if (aU instanceof GT_MetaGenerated_Tool_01) {
- int aMeta = aI.getItemDamage();
- //Logger.INFO("Found assembler recipe outputting a GT Tool with a meta value of "+aMeta);
- if (aMeta >= 170 && aMeta <= 176) {
- //Found a Turbine
- int aCutoff = aMeta == 170 ? CUT : (aMeta == 172 ? CUT*2 : (aMeta == 174 ? CUT*3 : CUT*4));
- String aType = aMeta == 170 ? "Small " : (aMeta == 172 ? "" : (aMeta == 174 ? "Large " : "Huge "));
- Materials aMainMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(aI);
- Materials aSecondaryMaterial = GT_MetaGenerated_Tool.getSecondaryMaterial(aI);
- long rotorDurabilityMax = GT_MetaGenerated_Tool.getToolMaxDamage(aI);
- //Logger.INFO("Found "+aType+"Turbine made out of "+getMaterialName(aMainMaterial)+", using "+getMaterialName(aSecondaryMaterial));
- if (rotorDurabilityMax < aCutoff) {
- Logger.WARNING("[Turbine Cleanup] "+getMaterialName(aMainMaterial)+" "+aType+"Turbines have "+rotorDurabilityMax+", which is below the cutoff durability of "+aCutoff+", disabling.");
- aG.mEnabled = false;
- aG.mHidden = true;
- aG.mCanBeBuffered = false;
- aRemoved++;
- }
- else {
- break outputs;
- }
-
- }
- else {
- continue outputs;
- }
- }
- else {
- continue outputs;
- }
- }
- }
- else {
- continue recipe;
- }
- }
- }
-
- Logger.INFO("Removed "+aRemoved+" useless Turbines.");
-
- return aRemoved;
- }
-
- /**
- * Should clean out any invalid Assembly Line recipes, if the map actually exists.
- * Prevents NPE's being thrown by GT's AL handler. (Fucking Annoying)
- * @return - Amount of Recipes removed, which were invalid in some way.
- */
- private static int cleanAssemblyLineRecipeMap() {
- GT_Recipe_Map g = StaticFields59.sAssemblylineVisualRecipes;
- if (g == null) {
- return 0;
- }
- else {
- AutoMap<GT_Recipe> aNewMap = new AutoMap<GT_Recipe>();
- AutoMap<GT_Recipe> aBadRecipeTempMap = new AutoMap<GT_Recipe>();
- for (GT_Recipe r : g.mRecipeList) {
- if (r != null) {
- if (r.mOutputs == null || r.mOutputs.length == 0 || r.mOutputs[0] == null) {
- aBadRecipeTempMap.put(r.copy());
- continue;
- }
- else {
- aNewMap.put(r.copy());
- }
- }
- }
- if (aNewMap.size() > 0) {
- g.mRecipeList.clear();
- for (GT_Recipe i : aNewMap) {
- g.add(i);
- }
- }
- if (aBadRecipeTempMap.size() > 0) {
- Logger.INFO("Found "+aBadRecipeTempMap.size()+" bad Assembly Line Recipes, attempting to dump all data about them.");
- Logger.INFO("This data should be given to the mod author for the recipe in question.");
- for (GT_Recipe i : aBadRecipeTempMap) {
- if (i == null) {
- Logger.INFO("Found NULL recipe. Impossible to determine who added this one. Please Report to Alkalus on Github.");
- }
- else {
- if (i.mOutputs == null || i.mOutputs.length == 0 || i.mOutputs[0] == null) {
- Logger.INFO("Found recipe with NULL output array, this will cause some issues. Attempting to determine other info about recipe.");
- if (i.mInputs != null && i.mInputs.length > 0) {
- Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(i.mInputs));
- }
- else {
- Logger.INFO("Recipe had no valid inputs.");
- }
- Logger.INFO("Time: "+i.mDuration);
- Logger.INFO("EU/T: "+i.mEUt);
- Logger.INFO("Special: "+i.mSpecialValue);
- }
- else {
- Logger.INFO("Found bad recipe, Attempting to determine other info.");
- if (i.mInputs != null && i.mInputs.length > 0) {
- Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(i.mInputs));
- }
- else {
- Logger.INFO("Recipe had no valid inputs.");
- }
- if (i.mOutputs != null && i.mOutputs.length > 0) {
- Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(i.mOutputs));
- }
- else {
- Logger.INFO("Recipe had no valid outputs.");
- }
- Logger.INFO("Time: "+i.mDuration);
- Logger.INFO("EU/T: "+i.mEUt);
- Logger.INFO("Special: "+i.mSpecialValue);
- }
- }
- }
- }
- else {
- Logger.INFO("No bad Assembly Line recipes found, this is great news!");
- }
- return aBadRecipeTempMap.size();
- }
- }
+ }
+
+ private static int removeCrudeTurbineRotors() {
+ int aRemoved = 0;
+ int CUT = CORE.turbineCutoffBase;
+ Item aU;
+ Collection<GT_Recipe> aAssRecipes = GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList;
+ // 170, 172, 174, 176
+ if (aAssRecipes.size() > 0 && (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH)) {
+ recipe:
+ for (GT_Recipe aG : aAssRecipes) {
+ if (aG.mOutputs != null && aG.mOutputs.length > 0) {
+ outputs:
+ for (ItemStack aI : aG.mOutputs) {
+ if (aI == null) {
+ continue;
+ }
+ aU = aI.getItem();
+ if (aU == null) {
+ continue;
+ }
+ if (aU instanceof GT_MetaGenerated_Tool_01) {
+ int aMeta = aI.getItemDamage();
+ // Logger.INFO("Found assembler recipe outputting a GT Tool with a meta value of "+aMeta);
+ if (aMeta >= 170 && aMeta <= 176) {
+ // Found a Turbine
+ int aCutoff = aMeta == 170
+ ? CUT
+ : (aMeta == 172 ? CUT * 2 : (aMeta == 174 ? CUT * 3 : CUT * 4));
+ String aType = aMeta == 170
+ ? "Small "
+ : (aMeta == 172 ? "" : (aMeta == 174 ? "Large " : "Huge "));
+ Materials aMainMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(aI);
+ Materials aSecondaryMaterial = GT_MetaGenerated_Tool.getSecondaryMaterial(aI);
+ long rotorDurabilityMax = GT_MetaGenerated_Tool.getToolMaxDamage(aI);
+ // Logger.INFO("Found "+aType+"Turbine made out of "+getMaterialName(aMainMaterial)+",
+ // using "+getMaterialName(aSecondaryMaterial));
+ if (rotorDurabilityMax < aCutoff) {
+ Logger.WARNING("[Turbine Cleanup] " + getMaterialName(aMainMaterial) + " " + aType
+ + "Turbines have " + rotorDurabilityMax
+ + ", which is below the cutoff durability of " + aCutoff + ", disabling.");
+ aG.mEnabled = false;
+ aG.mHidden = true;
+ aG.mCanBeBuffered = false;
+ aRemoved++;
+ } else {
+ break outputs;
+ }
+
+ } else {
+ continue outputs;
+ }
+ } else {
+ continue outputs;
+ }
+ }
+ } else {
+ continue recipe;
+ }
+ }
+ }
+ Logger.INFO("Removed " + aRemoved + " useless Turbines.");
+
+ return aRemoved;
+ }
+
+ /**
+ * Should clean out any invalid Assembly Line recipes, if the map actually exists.
+ * Prevents NPE's being thrown by GT's AL handler. (Fucking Annoying)
+ * @return - Amount of Recipes removed, which were invalid in some way.
+ */
+ private static int cleanAssemblyLineRecipeMap() {
+ GT_Recipe_Map g = StaticFields59.sAssemblylineVisualRecipes;
+ if (g == null) {
+ return 0;
+ } else {
+ AutoMap<GT_Recipe> aNewMap = new AutoMap<GT_Recipe>();
+ AutoMap<GT_Recipe> aBadRecipeTempMap = new AutoMap<GT_Recipe>();
+ for (GT_Recipe r : g.mRecipeList) {
+ if (r != null) {
+ if (r.mOutputs == null || r.mOutputs.length == 0 || r.mOutputs[0] == null) {
+ aBadRecipeTempMap.put(r.copy());
+ continue;
+ } else {
+ aNewMap.put(r.copy());
+ }
+ }
+ }
+ if (aNewMap.size() > 0) {
+ g.mRecipeList.clear();
+ for (GT_Recipe i : aNewMap) {
+ g.add(i);
+ }
+ }
+ if (aBadRecipeTempMap.size() > 0) {
+ Logger.INFO("Found " + aBadRecipeTempMap.size()
+ + " bad Assembly Line Recipes, attempting to dump all data about them.");
+ Logger.INFO("This data should be given to the mod author for the recipe in question.");
+ for (GT_Recipe i : aBadRecipeTempMap) {
+ if (i == null) {
+ Logger.INFO(
+ "Found NULL recipe. Impossible to determine who added this one. Please Report to Alkalus on Github.");
+ } else {
+ if (i.mOutputs == null || i.mOutputs.length == 0 || i.mOutputs[0] == null) {
+ Logger.INFO(
+ "Found recipe with NULL output array, this will cause some issues. Attempting to determine other info about recipe.");
+ if (i.mInputs != null && i.mInputs.length > 0) {
+ Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(i.mInputs));
+ } else {
+ Logger.INFO("Recipe had no valid inputs.");
+ }
+ Logger.INFO("Time: " + i.mDuration);
+ Logger.INFO("EU/T: " + i.mEUt);
+ Logger.INFO("Special: " + i.mSpecialValue);
+ } else {
+ Logger.INFO("Found bad recipe, Attempting to determine other info.");
+ if (i.mInputs != null && i.mInputs.length > 0) {
+ Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(i.mInputs));
+ } else {
+ Logger.INFO("Recipe had no valid inputs.");
+ }
+ if (i.mOutputs != null && i.mOutputs.length > 0) {
+ Logger.INFO("Outputs: " + ItemUtils.getArrayStackNames(i.mOutputs));
+ } else {
+ Logger.INFO("Recipe had no valid outputs.");
+ }
+ Logger.INFO("Time: " + i.mDuration);
+ Logger.INFO("EU/T: " + i.mEUt);
+ Logger.INFO("Special: " + i.mSpecialValue);
+ }
+ }
+ }
+ } else {
+ Logger.INFO("No bad Assembly Line recipes found, this is great news!");
+ }
+ return aBadRecipeTempMap.size();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
index 4ec4589c03..d4a7f97051 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
@@ -9,47 +9,46 @@ import net.minecraft.item.ItemStack;
* The item should have a maximum damage of 13.
*/
public interface IC2ElectricItem {
- /**
- * Determine if the item can be used in a machine or as an armor part to supply energy.
- *
- * @return Whether the item can supply energy
- */
- boolean canProvideEnergy(ItemStack itemStack);
-
- /**
- * Get the item ID to use for a charge energy greater than 0.
- *
- * @return Item ID to use
- */
- Item getChargedItem(ItemStack itemStack);
-
- /**
- * Get the item ID to use for a charge energy of 0.
- *
- * @return Item ID to use
- */
- Item getEmptyItem(ItemStack itemStack);
-
- /**
- * Get the item's maximum charge energy in EU.
- *
- * @return Maximum charge energy
- */
- double getMaxCharge(ItemStack itemStack);
-
- /**
- * Get the item's tier, lower tiers can't send energy to higher ones.
- * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3.
- *
- * @return Item's tier
- */
- int getTier(ItemStack itemStack);
-
- /**
- * Get the item's transfer limit in EU per transfer operation.
- *
- * @return Transfer limit
- */
- double getTransferLimit(ItemStack itemStack);
+ /**
+ * Determine if the item can be used in a machine or as an armor part to supply energy.
+ *
+ * @return Whether the item can supply energy
+ */
+ boolean canProvideEnergy(ItemStack itemStack);
+
+ /**
+ * Get the item ID to use for a charge energy greater than 0.
+ *
+ * @return Item ID to use
+ */
+ Item getChargedItem(ItemStack itemStack);
+
+ /**
+ * Get the item ID to use for a charge energy of 0.
+ *
+ * @return Item ID to use
+ */
+ Item getEmptyItem(ItemStack itemStack);
+
+ /**
+ * Get the item's maximum charge energy in EU.
+ *
+ * @return Maximum charge energy
+ */
+ double getMaxCharge(ItemStack itemStack);
+
+ /**
+ * Get the item's tier, lower tiers can't send energy to higher ones.
+ * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3.
+ *
+ * @return Item's tier
+ */
+ int getTier(ItemStack itemStack);
+
+ /**
+ * Get the item's transfer limit in EU per transfer operation.
+ *
+ * @return Transfer limit
+ */
+ double getTransferLimit(ItemStack itemStack);
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
index 8bf42578cc..4ec01ce63c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
@@ -18,78 +18,84 @@ import net.minecraft.item.ItemStack;
* more atomic features in the gateway manager.
*/
public interface IC2ElectricItemManager {
- /**
- * Charge an item with a specified amount of energy.
- *
- * @param itemStack electric item's stack
- * @param amount amount of energy to charge in EU
- * @param tier tier of the charging device, has to be at least as high as the item to charge
- * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
- * @param simulate don't actually change the item, just determine the return value
- * @return Energy transferred into the electric item
- */
- double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate);
+ /**
+ * Charge an item with a specified amount of energy.
+ *
+ * @param itemStack electric item's stack
+ * @param amount amount of energy to charge in EU
+ * @param tier tier of the charging device, has to be at least as high as the item to charge
+ * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
+ * @param simulate don't actually change the item, just determine the return value
+ * @return Energy transferred into the electric item
+ */
+ double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate);
- /**
- * Discharge an item by a specified amount of energy
- *
- * @param itemStack electric item's stack
- * @param amount amount of energy to discharge in EU
- * @param tier tier of the discharging device, has to be at least as high as the item to discharge
- * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
- * @param externally use the supplied item externally, i.e. to power something else as if it was a battery
- * @param simulate don't actually discharge the item, just determine the return value
- * @return Energy retrieved from the electric item
- */
- double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate);
+ /**
+ * Discharge an item by a specified amount of energy
+ *
+ * @param itemStack electric item's stack
+ * @param amount amount of energy to discharge in EU
+ * @param tier tier of the discharging device, has to be at least as high as the item to discharge
+ * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
+ * @param externally use the supplied item externally, i.e. to power something else as if it was a battery
+ * @param simulate don't actually discharge the item, just determine the return value
+ * @return Energy retrieved from the electric item
+ */
+ double discharge(
+ ItemStack stack,
+ double amount,
+ int tier,
+ boolean ignoreTransferLimit,
+ boolean externally,
+ boolean simulate);
- /**
- * Determine the charge level for the specified item.
- *
- * @param itemStack ItemStack containing the electric item
- * @return charge level in EU
- */
- double getCharge(ItemStack stack);
+ /**
+ * Determine the charge level for the specified item.
+ *
+ * @param itemStack ItemStack containing the electric item
+ * @return charge level in EU
+ */
+ double getCharge(ItemStack stack);
- /**
- * Determine if the specified electric item has at least a specific amount of EU.
- * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
- * BatPacks are not taken into account.
- *
- * @param itemStack electric item's stack
- * @param amount minimum amount of energy required
- * @return true if there's enough energy
- */
- boolean canUse(ItemStack stack, double amount);
+ /**
+ * Determine if the specified electric item has at least a specific amount of EU.
+ * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
+ * BatPacks are not taken into account.
+ *
+ * @param itemStack electric item's stack
+ * @param amount minimum amount of energy required
+ * @return true if there's enough energy
+ */
+ boolean canUse(ItemStack stack, double amount);
- /**
- * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack.
- * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
- *
- * @param itemStack electric item's stack
- * @param amount amount of energy to discharge in EU
- * @param entity entity holding the item
- * @return true if the operation succeeded
- */
- boolean use(ItemStack stack, double amount, EntityLivingBase entity);
+ /**
+ * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack.
+ * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
+ *
+ * @param itemStack electric item's stack
+ * @param amount amount of energy to discharge in EU
+ * @param entity entity holding the item
+ * @return true if the operation succeeded
+ */
+ boolean use(ItemStack stack, double amount, EntityLivingBase entity);
- /**
- * Charge an item from the BatPack a player is wearing.
- * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
- * use() already contains this functionality.
- *
- * @param itemStack electric item's stack
- * @param entity entity holding the item
- */
- void chargeFromArmor(ItemStack stack, EntityLivingBase entity);
+ /**
+ * Charge an item from the BatPack a player is wearing.
+ * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
+ * use() already contains this functionality.
+ *
+ * @param itemStack electric item's stack
+ * @param entity entity holding the item
+ */
+ void chargeFromArmor(ItemStack stack, EntityLivingBase entity);
- /**
- * Get the tool tip to display for electric items.
- *
- * @param itemStack ItemStack to determine the tooltip for
- * @return tool tip string or null for none
- */
- String getToolTip(ItemStack stack);
+ /**
+ * Get the tool tip to display for electric items.
+ *
+ * @param itemStack ItemStack to determine the tooltip for
+ * @return tool tip string or null for none
+ */
+ String getToolTip(ItemStack stack);
- // TODO: add tier getter
+ // TODO: add tier getter
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java
index 554983c41c..a31e728e23 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java
@@ -1,81 +1,79 @@
package gtPlusPlus.xmod.gregtech.api.enums;
-import net.minecraft.client.renderer.texture.TextureMap;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_RenderedTexture;
-
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
public class CustomGtTextures {
- public enum ItemIcons implements IIconContainer, Runnable {
- VOID, // The Empty Texture
- RENDERING_ERROR,
- PUMP,
- SKOOKUMCHOOCHER;
-
- public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)};
-
- protected IIcon mIcon, mOverlay;
-
- private ItemIcons() {
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
-
- @Override
- public void run() {
- this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this);
- this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY");
- }
-
- public static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon, mOverlay;
- protected String mIconName;
-
- public CustomIcon(final String aIconName) {
- this.mIconName = aIconName;
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public void run() {
- this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName);
- this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName + "_OVERLAY");
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
- }
- }
-} \ No newline at end of file
+ public enum ItemIcons implements IIconContainer, Runnable {
+ VOID, // The Empty Texture
+ RENDERING_ERROR,
+ PUMP,
+ SKOOKUMCHOOCHER;
+
+ public static final ITexture[] ERROR_RENDERING = new ITexture[] {new GT_RenderedTexture(RENDERING_ERROR)};
+
+ protected IIcon mIcon, mOverlay;
+
+ private ItemIcons() {
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return this.mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return this.mOverlay;
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+
+ @Override
+ public void run() {
+ this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this);
+ this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY");
+ }
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon, mOverlay;
+ protected String mIconName;
+
+ public CustomIcon(final String aIconName) {
+ this.mIconName = aIconName;
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return this.mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return this.mOverlay;
+ }
+
+ @Override
+ public void run() {
+ this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName);
+ this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomOrePrefix.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomOrePrefix.java
index 9647b00578..c0c4e6a5c8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomOrePrefix.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomOrePrefix.java
@@ -6,107 +6,135 @@ import gregtech.api.enums.OrePrefixes;
import net.minecraftforge.common.util.EnumHelper;
public enum CustomOrePrefix {
+ milled(
+ "Milled Ores",
+ "Milled ",
+ " Ore",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ B[3],
+ -1,
+ 64,
+ -1);
- milled("Milled Ores", "Milled ", " Ore", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1);
-
- private final String mRegularLocalName;
- private final String mLocalizedMaterialPre;
- private final String mLocalizedMaterialPost;
- private final boolean mIsUnificatable;
- private final boolean mIsMaterialBased;
- private final boolean mIsSelfReferencing;
- private final boolean mIsContainer;
- private final boolean mDontUnificateActively;
- private final boolean mIsUsedForBlocks;
- private final boolean mAllowNormalRecycling;
- private final boolean mGenerateDefaultItem;
- private final boolean mIsEnchantable;
- private final boolean mIsUsedForOreProcessing;
- private final int mMaterialGenerationBits;
- private final long mMaterialAmount;
- private final int mDefaultStackSize;
- private final int mTextureindex;
-
- private OrePrefixes mSelfReference;
-
- private CustomOrePrefix(
- 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) {
-
- mRegularLocalName = aRegularLocalName;
- mLocalizedMaterialPre = aLocalizedMaterialPre;
- mLocalizedMaterialPost = aLocalizedMaterialPost;
- mIsUnificatable = aIsUnificatable;
- mIsMaterialBased = aIsMaterialBased;
- mIsSelfReferencing = aIsSelfReferencing;
- mIsContainer = aIsContainer;
- mDontUnificateActively = aDontUnificateActively;
- mIsUsedForBlocks = aIsUsedForBlocks;
- mAllowNormalRecycling = aAllowNormalRecycling;
- mGenerateDefaultItem = aGenerateDefaultItem;
- mIsEnchantable = aIsEnchantable;
- mIsUsedForOreProcessing = aIsUsedForOreProcessing;
- mMaterialGenerationBits = aMaterialGenerationBits;
- mMaterialAmount = aMaterialAmount;
- mDefaultStackSize = aDefaultStackSize;
- mTextureindex = aTextureindex;
-
- }
-
- public final boolean addToEnum() {
-
- mSelfReference = EnumHelper.addEnum(OrePrefixes.class, this.name(),
- new Class[] {
- String.class,
- String.class, String.class, boolean.class,
- boolean.class, boolean.class, boolean.class,
- boolean.class, boolean.class, boolean.class,
- boolean.class, boolean.class, boolean.class,
- int.class, long.class, int.class, int.class
- },
- new Object[] {
- mRegularLocalName,
- mLocalizedMaterialPre,
- mLocalizedMaterialPost,
- mIsUnificatable,
- mIsMaterialBased,
- mIsSelfReferencing,
- mIsContainer,
- mDontUnificateActively,
- mIsUsedForBlocks,
- mAllowNormalRecycling,
- mGenerateDefaultItem,
- mIsEnchantable,
- mIsUsedForOreProcessing,
- mMaterialGenerationBits,
- mMaterialAmount,
- mDefaultStackSize,
- mTextureindex});
-
- return mSelfReference != null;
- }
-
- public static final boolean checkEntryWasAdded(CustomOrePrefix aCustomPrefixObject) {
- return aCustomPrefixObject.mSelfReference != null;
- }
-
- public OrePrefixes get() {
- return mSelfReference;
- }
+ private final String mRegularLocalName;
+ private final String mLocalizedMaterialPre;
+ private final String mLocalizedMaterialPost;
+ private final boolean mIsUnificatable;
+ private final boolean mIsMaterialBased;
+ private final boolean mIsSelfReferencing;
+ private final boolean mIsContainer;
+ private final boolean mDontUnificateActively;
+ private final boolean mIsUsedForBlocks;
+ private final boolean mAllowNormalRecycling;
+ private final boolean mGenerateDefaultItem;
+ private final boolean mIsEnchantable;
+ private final boolean mIsUsedForOreProcessing;
+ private final int mMaterialGenerationBits;
+ private final long mMaterialAmount;
+ private final int mDefaultStackSize;
+ private final int mTextureindex;
+ private OrePrefixes mSelfReference;
+
+ private CustomOrePrefix(
+ 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) {
+
+ mRegularLocalName = aRegularLocalName;
+ mLocalizedMaterialPre = aLocalizedMaterialPre;
+ mLocalizedMaterialPost = aLocalizedMaterialPost;
+ mIsUnificatable = aIsUnificatable;
+ mIsMaterialBased = aIsMaterialBased;
+ mIsSelfReferencing = aIsSelfReferencing;
+ mIsContainer = aIsContainer;
+ mDontUnificateActively = aDontUnificateActively;
+ mIsUsedForBlocks = aIsUsedForBlocks;
+ mAllowNormalRecycling = aAllowNormalRecycling;
+ mGenerateDefaultItem = aGenerateDefaultItem;
+ mIsEnchantable = aIsEnchantable;
+ mIsUsedForOreProcessing = aIsUsedForOreProcessing;
+ mMaterialGenerationBits = aMaterialGenerationBits;
+ mMaterialAmount = aMaterialAmount;
+ mDefaultStackSize = aDefaultStackSize;
+ mTextureindex = aTextureindex;
+ }
+
+ public final boolean addToEnum() {
+
+ mSelfReference = EnumHelper.addEnum(
+ OrePrefixes.class,
+ this.name(),
+ new Class[] {
+ String.class,
+ String.class,
+ String.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ boolean.class,
+ int.class,
+ long.class,
+ int.class,
+ int.class
+ },
+ new Object[] {
+ mRegularLocalName,
+ mLocalizedMaterialPre,
+ mLocalizedMaterialPost,
+ mIsUnificatable,
+ mIsMaterialBased,
+ mIsSelfReferencing,
+ mIsContainer,
+ mDontUnificateActively,
+ mIsUsedForBlocks,
+ mAllowNormalRecycling,
+ mGenerateDefaultItem,
+ mIsEnchantable,
+ mIsUsedForOreProcessing,
+ mMaterialGenerationBits,
+ mMaterialAmount,
+ mDefaultStackSize,
+ mTextureindex
+ });
+
+ return mSelfReference != null;
+ }
+
+ public static final boolean checkEntryWasAdded(CustomOrePrefix aCustomPrefixObject) {
+ return aCustomPrefixObject.mSelfReference != null;
+ }
+
+ public OrePrefixes get() {
+ return mSelfReference;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 32c3f9f271..cee5131f67 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -16,970 +16,1104 @@ import net.minecraft.item.ItemStack;
*/
public enum GregtechItemList implements GregtechItemContainer {
- /**
- * Items
- */
-
- // Advanced Hazmat Suit
- Armour_Hazmat_Advanced_Helmet,
- Armour_Hazmat_Advanced_Chest,
- Armour_Hazmat_Advanced_Legs,
- Armour_Hazmat_Advanced_Boots,
-
- //Gregtech Machine Parts
- Electric_Motor_LuV, Electric_Motor_ZPM, Electric_Motor_UV, Electric_Motor_MAX,
- Electric_Pump_LuV, Electric_Pump_ZPM, Electric_Pump_UV, Electric_Pump_MAX,
- Conveyor_Module_LuV, Conveyor_Module_ZPM, Conveyor_Module_UV, Conveyor_Module_MAX,
- Electric_Piston_LuV, Electric_Piston_ZPM, Electric_Piston_UV, Electric_Piston_MAX,
- Robot_Arm_LuV, Robot_Arm_ZPM, Robot_Arm_UV, Robot_Arm_MAX,
- Field_Generator_LuV, Field_Generator_ZPM, Field_Generator_UV, Field_Generator_MAX,
- Emitter_LuV, Emitter_ZPM, Emitter_UV, Emitter_MAX,
- Sensor_LuV, Sensor_ZPM, Sensor_UV, Sensor_MAX,
-
- //ULV Components
- Electric_Motor_ULV,
- Electric_Pump_ULV,
- Conveyor_Module_ULV,
- Electric_Piston_ULV,
- Robot_Arm_ULV,
- Field_Generator_ULV,
- Emitter_ULV,
- Sensor_ULV,
-
- // Mixed Components
- TransmissionComponent_ULV, TransmissionComponent_LV,
- TransmissionComponent_MV, TransmissionComponent_HV,
- TransmissionComponent_EV, TransmissionComponent_IV,
- TransmissionComponent_LuV, TransmissionComponent_ZPM,
- TransmissionComponent_UV, TransmissionComponent_MAX,
-
- //Recipe Circuit
- Circuit_BioRecipeSelector,
- Circuit_T3RecipeSelector,
-
- //Circuits
- Old_Circuit_Primitive, Old_Circuit_Basic, Old_Circuit_Good,
- Old_Circuit_Advanced, Old_Circuit_Data, Old_Circuit_Elite,
- Old_Circuit_Master, Old_Tool_DataOrb, Old_Circuit_Ultimate, Old_Tool_DataStick,
- Circuit_IV, Circuit_LuV, Circuit_ZPM,
-
- //Circuit Parts
- Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
- Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
- Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
- Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM,
-
- //Old Style Circuits
- Old_Circuit_Board_Basic, Old_Circuit_Board_Advanced, Old_Circuit_Board_Elite,
- Old_Circuit_Parts_Crystal_Chip_Elite, Old_Circuit_Parts_Crystal_Chip_Master, Old_Circuit_Parts_Advanced,
- Old_Circuit_Parts_Wiring_Basic, Old_Circuit_Parts_Wiring_Advanced, Old_Circuit_Parts_Wiring_Elite,
- Old_Empty_Board_Basic, Old_Empty_Board_Elite,
-
- //Batteries
- Battery_RE_EV_Sodium,
- Battery_RE_EV_Cadmium,
- Battery_RE_EV_Lithium,
-
- //Shapes for Extruder
- Shape_Extruder_WindmillShaft,
- Shape_Extruder_SmallGear,
-
- //Cooked Raisin Toast for ImQ009
- Food_Baked_Raisin_Bread,
-
-
- //Fluid Cells to regulate flows.
- Fluid_Cell_1L, Fluid_Cell_16L,
- Fluid_Cell_36L, Fluid_Cell_144L,
-
- //Debug
- TESTITEM,
-
- // Larger Volumetric Flasks
- VOLUMETRIC_FLASK_8k,
- VOLUMETRIC_FLASK_32k,
-
- //RTG Fuels
- Pellet_RTG_PU238, Pellet_RTG_SR90,
- Pellet_RTG_PO210, Pellet_RTG_AM241,
-
- //Computer Cube
- Gregtech_Computer_Cube,
- Gregtech_Computer_Cube_Machine,
-
- //Casings for batteries
- Battery_Casing_Gem_1, Battery_Casing_Gem_2,
- Battery_Casing_Gem_3, Battery_Casing_Gem_4,
-
- //Custom Batteries
- Battery_Gem_1, Battery_Gem_2,
- Battery_Gem_3, Battery_Gem_4,
-
- //Compressed Fusion MK3
- Compressed_Fusion_Reactor,
-
- //Carbon Materials
- NanoTube_Base_Substrate,
- NanoTube_Finished,
- Carbyne_Tube_Finished,
- Carbyne_Sheet_Finished,
-
- //End Game Laser Engraver Lens
- Laser_Lens_WoodsGlass,
- Laser_Lens_Special,
-
- //Bombs
- Bomb_Cast, Bomb_Cast_Molten,
- Bomb_Cast_Set, Bomb_Cast_Broken,
- Bomb_Cast_Mold,
-
- // Pellet Mold
- Pellet_Mold,
-
- //Charged Items for Tree Farms
- Farm_Processor_EV,
- Farm_Processor_IV,
- Farm_Processor_LuV,
- Farm_Processor_ZPM,
- Farm_Processor_UV,
-
- // Upgrade chip for Distillus
- Distillus_Upgrade_Chip,
-
-
- // Chips used to nerf my multis via custom behavioural attachments
- Chip_MultiNerf_NoOutputBonus,
- Chip_MultiNerf_NoSpeedBonus,
- Chip_MultiNerf_NoEuBonus,
-
- // Milling Balls
- Milling_Ball_Alumina,
- Milling_Ball_Soapstone,
-
-
- //----------------------------------------------------------------------------
-
-
-
- /**
- * MultiBlocks
- */
-
-
- // Tier GT++ Casings
- GTPP_Casing_ULV, GTPP_Casing_LV,
- GTPP_Casing_MV, GTPP_Casing_HV,
- GTPP_Casing_EV, GTPP_Casing_IV,
- GTPP_Casing_LuV, GTPP_Casing_ZPM,
- GTPP_Casing_UV, GTPP_Casing_MAX,
-
- //IronBlastFurnace Machine_Bronze_BlastFurnace
- Machine_Iron_BlastFurnace,
- Casing_IronPlatedBricks,
-
- //Large Centrifuge
- Industrial_Centrifuge,
- Casing_Centrifuge1,
-
- // Large Alloy Smelter
- Industrial_AlloySmelter,
-
- //Coke Oven
- Industrial_CokeOven,
- Casing_CokeOven,
- Casing_CokeOven_Coil1,
- Casing_CokeOven_Coil2,
-
- //Bending Maching // Plate Press // Press
- Industrial_PlatePress,
- Casing_MaterialPress,
-
- //Matter Fab
- Industrial_MassFab,
- Casing_MatterGen,
- Casing_MatterFab,
-
- //ABS
- Industrial_AlloyBlastSmelter,
- Casing_Coil_BlastSmelter,
- Casing_BlastSmelter,
-
- //Industrial Electrolyzer
- Industrial_Electrolyzer,
- Casing_Electrolyzer,
-
- //Industrial Maceration Stack
- Industrial_MacerationStack,
- Casing_MacerationStack,
-
- //Industrial Wire Factory
- Industrial_WireFactory,
- Casing_WireFactory,
-
- //Power sub-station for mass storage. 3 hatches for input and output, whatever voltages you desire.
- PowerSubStation,
- Casing_Vanadium_Redox,
- Casing_Vanadium_Redox_IV,
- Casing_Vanadium_Redox_LuV,
- Casing_Vanadium_Redox_ZPM,
- Casing_Vanadium_Redox_UV,
- Casing_Vanadium_Redox_MAX,
- Casing_Power_SubStation,
-
-
- //LFTR
- ThoriumReactor,
- Casing_Reactor_I,
- Casing_Reactor_II,
-
- //Multitank
- /*Industrial_MultiTank,*/
- Industrial_MultiTankDense,
- Casing_MultitankExterior,
-
-
- //Fission Fuel Refinery
- Industrial_FuelRefinery,
- Casing_Refinery_External,
- Casing_Refinery_Structural,
- Casing_Refinery_Internal,
-
-
- //Industrial Sifter
- Industrial_Sifter,
- Casing_Sifter,
- Casing_SifterGrate,
-
-
- //Large Thermal Centrifuge
- Industrial_ThermalCentrifuge,
- Casing_ThermalCentrifuge,
-
-
- //Cyclotron
- COMET_Cyclotron,
- Casing_Cyclotron_Coil,
- Casing_Cyclotron_External,
-
- //Thermal Boiler
- GT4_Thermal_Boiler,
- Casing_ThermalContainment,
-
-
- //Tree Farm
- Industrial_TreeFarm,
- TreeFarmer_Structural,
- Casing_PLACEHOLDER_TreeFarmer,
-
-
- //Fish Pond
- Industrial_FishingPond,
- Casing_FishPond,
-
- //Algae
- AlgaeFarm_Controller,
-
- //Chemical Plant
- ChemicalPlant_Controller,
-
- //GT4 autoCrafter
- GT4_Multi_Crafter,
- Casing_Autocrafter,
-
-
- //industrial Ore-Washer
- Industrial_WashPlant,
- Casing_WashPlant,
-
-
- //Generator Array
- Generator_Array_Controller,
-
-
- //Cutting Factory Controller
- Industrial_CuttingFactoryController,
- Casing_CuttingFactoryFrame,
-
-
- //Tesla Tower
- TelsaTower,
- Casing_TeslaTower,
-
-
- //Large Extruder
- Industrial_Extruder,
- Casing_Extruder,
-
-
- //Multi-Machine
- Industrial_MultiMachine,
- Casing_Multi_Use,
-
-
- //Bedrock Mining Platforms
- /*BedrockMiner_MKI, */
- /*BedrockMiner_MKII, */
- /*BedrockMiner_MKIII, */
- Casing_BedrockMiner,
-
-
- //Large Packager
- Amazon_Warehouse_Controller,
- Casing_AmazonWarehouse,
-
-
- //Advanced GT vanilla Multis
- Machine_Adv_BlastFurnace,
- Casing_Adv_BlastFurnace,
- Machine_Adv_ImplosionCompressor,
- Machine_Adv_DistillationTower,
-
- //Advanced Assembly Line
- Machine_Adv_AssemblyLine,
-
- //Advanced Vacuum Freezer
- Industrial_Cryogenic_Freezer,
- Casing_AdvancedVacuum,
-
-
- //FusionTek MK IV
- FusionComputer_UV2,
- Casing_Fusion_External,
- Casing_Fusion_Internal,
-
-
- //large mixer
- Industrial_Mixer,
-
-
- //Naq Reactor
- Casing_Naq_Reactor_A,
- Casing_Naq_Reactor_B,
- Casing_Naq_Reactor_C,
- /*Controller_Naq_Reactor, */
- Casing_Containment,
-
- //Arc Furnace
- Industrial_Arc_Furnace,
- Casing_Industrial_Arc_Furnace,
-
- //Solar Tower
- Industrial_Solar_Tower,
- Casing_SolarTower_Structural,
- Casing_SolarTower_SaltContainment,
- Casing_SolarTower_HeatContainment,
-
- //Larger Turbines
- Large_Steam_Turbine, Large_HPSteam_Turbine,
- Large_Gas_Turbine, Large_Plasma_Turbine,
- Casing_Turbine_Shaft,
- Casing_Turbine_LP, Casing_Turbine_HP,
- Casing_Turbine_Gas, Casing_Turbine_Plasma,
- XL_HeatExchanger, Casing_XL_HeatExchanger,
-
- // Large Engine
- Casing_Reinforced_Engine_Casing,
-
- //Large Vacuum Furnace
- Casing_Vacuum_Furnace,
- Controller_Vacuum_Furnace,
-
- // Large Rocket Engine
- Casing_RocketEngine,
- Controller_RocketEngine,
-
- // Large Semi-Fluid
- Controller_LargeSemifluidGenerator,
-
- // IsaMill
- Controller_IsaMill,
- Casing_IsaMill_Casing,
- Casing_IsaMill_Gearbox,
- Casing_IsaMill_Pipe,
-
- // Flotation Cell
- Controller_Flotation_Cell,
- Casing_Flotation_Cell,
-
- // Sparge Tower
- Controller_Sparge_Tower,
- Casing_Sparge_Tower_Exterior,
- Casing_Sparge_Tower_Interior,
-
- // Elemental Duplicator
- Controller_ElementalDuplicator,
- Casing_ElementalDuplicator,
-
- // Forge Hammer
- Controller_IndustrialForgeHammer,
- Casing_IndustrialForgeHammer,
-
- // Molecular Transformer
- Controller_MolecularTransformer,
- Casing_Molecular_Transformer_1,
- Casing_Molecular_Transformer_2,
- Casing_Molecular_Transformer_3,
-
- // Big Steam Macerator
- Controller_SteamMaceratorMulti,
- // Big Steam Compressor
- Controller_SteamCompressorMulti,
-
- // Industrial Rock Breaker
- Controller_IndustrialRockBreaker,
-
- // Industrial Chisel
- Controller_IndustrialAutoChisel,
- Casing_IndustrialAutoChisel,
-
- // Industrial Fluid Heater
- Controller_IndustrialFluidHeater,
-
- // Custom Machine Casings
- Casing_Machine_Custom_1,
- Casing_Machine_Custom_2,
- Casing_Machine_Custom_3,
- Casing_Machine_Custom_4,
- Casing_Machine_Custom_5,
- Casing_Machine_Custom_6,
-
-
- //----------------------------------------------------------------------------
-
- /**
- * Custom hatches/Busses
- */
-
- //Buffer Dynamos
- Hatch_Buffer_Dynamo_ULV, Hatch_Buffer_Dynamo_LV, Hatch_Buffer_Dynamo_MV, Hatch_Buffer_Dynamo_HV, Hatch_Buffer_Dynamo_EV,
- Hatch_Buffer_Dynamo_IV, Hatch_Buffer_Dynamo_LuV, Hatch_Buffer_Dynamo_ZPM, Hatch_Buffer_Dynamo_UV, Hatch_Buffer_Dynamo_MAX,
-
- //Air Intake hatch
- Hatch_Air_Intake,
- Hatch_Air_Intake_Extreme,
-
- //Reservoir Hatch
- Hatch_Reservoir,
-
- //XL Turbine Rotor Hatch
- Hatch_Turbine_Rotor,
-
- //Standard Turbine Rotor Hatch
- Hatch_Input_TurbineHousing,
-
- //Control Core
- Hatch_Control_Core,
-
- // Milling Ball Bus
- Bus_Milling_Balls,
-
- // Catalyst Bus
- Bus_Catalysts,
-
- //Custom Fluid Hatches
- Hatch_Input_Cryotheum,
- Hatch_Input_Pyrotheum,
- Hatch_Input_Naquadah,
- Hatch_Input_Steam,
-
- //Steam Multi Buses
- Hatch_Input_Bus_Steam,
- Hatch_Output_Bus_Steam,
-
- //Elemental Duplicator Data Orb Bus
- Hatch_Input_Elemental_Duplicator,
-
- //RTG Hatch
- Hatch_RTG_LV,
- Hatch_RTG_MV,
- Hatch_RTG_HV,
-
- //Battery hatches for PSS
- Hatch_Input_Battery_MV,
- Hatch_Input_Battery_EV,
- Hatch_Output_Battery_MV,
- Hatch_Output_Battery_EV,
-
- //Advanced Mufflers
- Hatch_Muffler_Adv_LV, Hatch_Muffler_Adv_MV, Hatch_Muffler_Adv_HV,
- Hatch_Muffler_Adv_EV, Hatch_Muffler_Adv_IV, Hatch_Muffler_Adv_LuV,
- Hatch_Muffler_Adv_ZPM, Hatch_Muffler_Adv_UV, Hatch_Muffler_Adv_MAX,
-
- //Super Input Busses
- Hatch_SuperBus_Input_ULV, Hatch_SuperBus_Input_LV, Hatch_SuperBus_Input_MV,
- Hatch_SuperBus_Input_HV, Hatch_SuperBus_Input_EV, Hatch_SuperBus_Input_IV,
- Hatch_SuperBus_Input_LuV, Hatch_SuperBus_Input_ZPM, Hatch_SuperBus_Input_UV,
- Hatch_SuperBus_Input_MAX,
-
- //Super Output Busses
- Hatch_SuperBus_Output_ULV, Hatch_SuperBus_Output_LV, Hatch_SuperBus_Output_MV,
- Hatch_SuperBus_Output_HV, Hatch_SuperBus_Output_EV, Hatch_SuperBus_Output_IV,
- Hatch_SuperBus_Output_LuV, Hatch_SuperBus_Output_ZPM, Hatch_SuperBus_Output_UV,
- Hatch_SuperBus_Output_MAX,
-
-
- //----------------------------------------------------------------------------
-
-
- /**
- * Blocks
- */
-
-
- ResonanceChamber_I,
- ResonanceChamber_II,
- ResonanceChamber_III,
- ResonanceChamber_IV,
-
- Modulator_I,
- Modulator_II,
- Modulator_III,
- Modulator_IV,
-
- //----------------------------------------------------------------------------
-
-
- /**
- * Single Block Tile Entities
- */
-
- //ULV Generators
- Generator_Diesel_ULV, Generator_Gas_Turbine_ULV, Generator_Steam_Turbine_ULV,
-
- //Crate Box
- CrateStorage,
-
- //Auto TC Research Creator
- Thaumcraft_Researcher,
-
- //Threaded Buffers
- Automation_Threaded_SuperBuffer_ULV, Automation_Threaded_SuperBuffer_LV, Automation_Threaded_SuperBuffer_MV, Automation_Threaded_SuperBuffer_HV, Automation_Threaded_SuperBuffer_EV,
- Automation_Threaded_SuperBuffer_IV, Automation_Threaded_SuperBuffer_LuV, Automation_Threaded_SuperBuffer_ZPM, Automation_Threaded_SuperBuffer_UV, Automation_Threaded_SuperBuffer_MAX,
-
- //infinite Items
- Infinite_Item_Chest,
-
- //GT4 Redstone
- GT4_Redstone_Lamp,
- GT4_Redstone_Button_Panel,
- GT4_Redstone_Scale,
- GT4_Redstone_Display,
- GT4_Redstone_Circuit,
-
- //Gt4 Workbenches
- GT4_Workbench_Bronze,
- GT4_Workbench_Advanced,
-
- //GT4 automation
- GT4_Electric_Auto_Workbench_LV,
- GT4_Electric_Auto_Workbench_MV,
- GT4_Electric_Auto_Workbench_HV,
- GT4_Electric_Auto_Workbench_EV,
- GT4_Electric_Auto_Workbench_IV,
- GT4_Electric_Auto_Workbench_LuV,
- GT4_Electric_Auto_Workbench_ZPM,
- GT4_Electric_Auto_Workbench_UV,
- GT4_Electric_Inventory_Manager_LV,
- GT4_Electric_Inventory_Manager_MV,
- GT4_Electric_Inventory_Manager_HV,
- GT4_Electric_Inventory_Manager_EV,
- GT4_Electric_Inventory_Manager_IV,
- GT4_Electric_Inventory_Manager_LuV,
- GT4_Electric_Inventory_Manager_ZPM,
- GT4_Electric_Inventory_Manager_UV,
-
- //GT4 Crop Harvester
- GT4_Crop_Harvester_LV,
- GT4_Crop_Harvester_MV,
- GT4_Crop_Harvester_HV,
- GT4_Crop_Harvester_EV,
- GT4_Crop_Harvester_IV,
- GT4_Crop_Harvester_LuV,
- GT4_Crop_Harvester_ZPM,
- GT4_Crop_Harvester_UV,
-
-
- //Geothermal Engines
- Geothermal_Engine_EV,
- Geothermal_Engine_IV,
- Geothermal_Engine_LuV,
-
-
- //Tesseracts
- GT4_Tesseract_Generator,
- GT4_Tesseract_Terminal,
-
-
- //Advanced Boilers
- Boiler_Advanced_LV,
- Boiler_Advanced_MV,
- Boiler_Advanced_HV,
-
-
- //Fancy Pollution Devices
- Pollution_Detector,
- Pollution_Cleaner_ULV, Pollution_Cleaner_LV,
- Pollution_Cleaner_MV, Pollution_Cleaner_HV,
- Pollution_Cleaner_EV, Pollution_Cleaner_IV,
- Pollution_Cleaner_LuV, Pollution_Cleaner_ZPM,
- Pollution_Cleaner_UV, Pollution_Cleaner_MAX,
-
-
- //Debug machine
- Pollution_Creator,
- Garbage_Collector_Debug_Machine,
-
-
- //Basically is an automatic Cauldron
- SimpleDustWasher_ULV,
- SimpleDustWasher_MV,
- SimpleDustWasher_EV,
- SimpleDustWasher_LuV,
- SimpleDustWasher_UV,
-
- //Solar Tower Reflector
- Solar_Tower_Reflector,
-
- //Super Tier Chests
- Super_Chest_LV, Super_Chest_MV, Super_Chest_HV, Super_Chest_EV, Super_Chest_IV,
-
- //Chunkloader
- GT_Chunkloader_HV, GT_Chunkloader_ZPM, GT_Chunkloader_IV,
-
-
- //Wireless Chargers
- Charger_LV, Charger_MV, Charger_HV,
- Charger_EV, Charger_IV, Charger_LuV,
- Charger_ZPM, Charger_UV, Charger_MAX,
-
-
- //Tiny Fusion
- /*Miniature_Fusion, */
-
-
- //Component Makers
- Machine_LV_Component_Maker,
- Machine_MV_Component_Maker,
- Machine_HV_Component_Maker,
- Machine_EV_Component_Maker,
- Machine_IV_Component_Maker,
- Machine_LuV_Component_Maker,
- Machine_ZPM_Component_Maker,
- Machine_UV_Component_Maker,
-
- // Reactor Processing Unit
- ReactorProcessingUnit_IV,
- ReactorProcessingUnit_ZPM,
-
- // Cold Trap
- ColdTrap_IV,
- ColdTrap_ZPM,
-
- //Breakers
- BreakerBox_ULV, BreakerBox_LV, BreakerBox_MV,
- BreakerBox_HV, BreakerBox_EV, BreakerBox_IV,
- BreakerBox_LuV, BreakerBox_ZPM, BreakerBox_UV,
- BreakerBox_MAX,
-
-
- //Solar Generators
- GT_Solar_ULV, GT_Solar_LV, GT_Solar_MV,
- GT_Solar_HV, GT_Solar_EV, GT_Solar_IV,
- GT_Solar_LuV, GT_Solar_ZPM, GT_Solar_UV, GT_Solar_MAX,
-
-
- //512v Creative Buffer
- Energy_Buffer_CREATIVE,
- //Variable voltage RF convertor
- Energy_Buffer_RF_Convertor,
- //Energy Buffers
- Energy_Buffer_1by1_ULV, Energy_Buffer_1by1_LV,
- Energy_Buffer_1by1_MV, Energy_Buffer_1by1_HV,
- Energy_Buffer_1by1_EV, Energy_Buffer_1by1_IV,
- Energy_Buffer_1by1_LuV, Energy_Buffer_1by1_ZPM,
- Energy_Buffer_1by1_UV, Energy_Buffer_1by1_MAX,
-
-
- //Cobble Generators
- Cobble_Generator_ULV, Cobble_Generator_LV,
- Cobble_Generator_MV, Cobble_Generator_HV,
- Cobble_Generator_EV, Cobble_Generator_IV,
- Cobble_Generator_LuV, Cobble_Generator_ZPM,
- Cobble_Generator_UV, Cobble_Generator_MAX,
-
-
- //The max Steam condenser
- Condensor_MAX,
-
-
- //Player owned Safes
- GT_Safe_ULV, GT_Safe_LV,
- GT_Safe_MV, GT_Safe_HV,
- GT_Safe_EV, GT_Safe_IV,
- GT_Safe_LuV, GT_Safe_ZPM,
- GT_Safe_UV, GT_Safe_MAX,
-
-
- //Rocket Engines
- Rocket_Engine_EV,
- Rocket_Engine_IV,
- Rocket_Engine_LuV,
-
-
- //GT4 Shelves
- GT4_Shelf, GT4_Shelf_Iron,
- GT4_Shelf_FileCabinet, GT4_Shelf_Desk,
- GT4_Shelf_Compartment, GT4_Shelf_Large,
-
-
- //Hi Amp Transformers
- Transformer_HA_LV_ULV, Transformer_HA_MV_LV, Transformer_HA_HV_MV,
- Transformer_HA_EV_HV, Transformer_HA_IV_EV, Transformer_HA_LuV_IV,
- Transformer_HA_ZPM_LuV, Transformer_HA_UV_ZPM, Transformer_HA_MAX_UV,
-
-
- //Semi-Fluid generators
- Generator_SemiFluid_LV,
- Generator_SemiFluid_MV,
- Generator_SemiFluid_HV,
-
-
- //Advanced Mixer 4x4
- Machine_Advanced_LV_Mixer, Machine_Advanced_MV_Mixer, Machine_Advanced_HV_Mixer,
- Machine_Advanced_EV_Mixer, Machine_Advanced_IV_Mixer, Machine_Advanced_LuV_Mixer,
- Machine_Advanced_ZPM_Mixer, Machine_Advanced_UV_Mixer,
-
-
- //Block that enables uplink to a superconductor network
- SuperConductorInputNode,
-
- //Heat Pipes
- HeatPipe_Tier_1,
- HeatPipe_Tier_2,
- HeatPipe_Tier_3,
-
-
- //Chemical Dehydrators for nuclear fuels
- GT_Dehydrator_MV, GT_Dehydrator_HV,
- GT_Dehydrator_EV, GT_Dehydrator_IV,
- GT_Dehydrator_LuV, GT_Dehydrator_ZPM,
-
-
- //Fluid Storage Tanks
- GT_FluidTank_ULV, GT_FluidTank_LV,
- GT_FluidTank_MV, GT_FluidTank_HV,
- GT_FluidTank_EV, GT_FluidTank_IV,
- GT_FluidTank_LuV, GT_FluidTank_ZPM,
- GT_FluidTank_UV, GT_FluidTank_MAX,
-
- //Tick Accelerators from GTNH
- AcceleratorLV, AcceleratorMV,
- AcceleratorHV, AcceleratorEV,
- AcceleratorIV, AcceleratorLuV,
- AcceleratorZPM, AcceleratorUV,
-
- //GT RTG
- RTG,
-
-
- // Chisel Machines
- GT_Chisel_LV,
- GT_Chisel_MV,
- GT_Chisel_HV,
-
- //Plasma Tank
- /*Plasma_Tank,*/
-
-
- //----------------------------------------------------------------------------
-
-
- /**
- * Covers
- */
-
- //Fluid Void Covers
- Cover_Overflow_ULV, Cover_Overflow_LV, Cover_Overflow_MV, Cover_Overflow_HV, Cover_Overflow_EV, Cover_Overflow_IV,
-
- //Item Void Covers
- Cover_Overflow_Item_ULV, Cover_Overflow_Item_LV, Cover_Overflow_Item_MV, Cover_Overflow_Item_HV, Cover_Overflow_Item_EV, Cover_Overflow_Item_IV,
-
- //Fake Hull Covers
- FakeMachineCasingPlate_ULV, FakeMachineCasingPlate_LV,
- FakeMachineCasingPlate_MV, FakeMachineCasingPlate_HV,
- FakeMachineCasingPlate_EV, FakeMachineCasingPlate_IV,
- FakeMachineCasingPlate_LuV, FakeMachineCasingPlate_ZPM,
- FakeMachineCasingPlate_UV, FakeMachineCasingPlate_MAX,
-
-
-
-
- //----------------------------------------------------------------------------
-
- ;
-
- public static final GregtechItemList[]
- DYE_ONLY_ITEMS = {
- Energy_Buffer_1by1_EV, Energy_Buffer_1by1_EV };
- private ItemStack mStack;
- private boolean mHasNotBeenSet = true;
-
-
- @Override
- public GregtechItemList set(final Item aItem) {
- this.mHasNotBeenSet = false;
- if (aItem == null) {
- return this;
- }
- final ItemStack aStack = new ItemStack(aItem, 1, 0);
- this.mStack = GT_Utility.copyAmount(1, aStack);
- return this;
- }
-
- @Override
- public GregtechItemList set(final ItemStack aStack) {
- this.mHasNotBeenSet = false;
- this.mStack = GT_Utility.copyAmount(1, aStack);
- return this;
- }
-
- @Override
- public Item getItem() {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return null;
- }
- return this.mStack.getItem();
- }
-
- @Override
- public Block getBlock() {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- return getBlockFromStack(this.getItem());
- }
-
- @Override
- public final boolean hasBeenSet() {
- return !this.mHasNotBeenSet;
- }
-
- @Override
- public boolean isStackEqual(final Object aStack) {
- return this.isStackEqual(aStack, false, false);
- }
-
- @Override
- public boolean isStackEqual(final Object aStack, final boolean aWildcard, final boolean aIgnoreNBT) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- return GT_Utility.areUnificationsEqual((ItemStack)aStack, aWildcard?this.getWildcard(1):this.get(1), aIgnoreNBT);
- }
-
- public static Block getBlockFromStack(Object aStack) {
- if (GT_Utility.isStackInvalid(aStack))
- return Blocks.air;
- return Block.getBlockFromItem(((ItemStack) aStack).getItem());
- }
-
- @Override
- public ItemStack get(final long aAmount, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(this.mStack));
- }
-
- @Override
- public ItemStack getWildcard(final long aAmount, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(this.mStack));
- }
-
- @Override
- public ItemStack getUndamaged(final long aAmount, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(this.mStack));
- }
-
- @Override
- public ItemStack getAlmostBroken(final long aAmount, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, this.mStack.getMaxDamage()-1, GT_OreDictUnificator.get(this.mStack));
- }
-
- @Override
- public ItemStack getWithName(final long aAmount, final String aDisplayName, final Object... aReplacements) {
- final ItemStack rStack = this.get(1, aReplacements);
- if (GT_Utility.isStackInvalid(rStack)) {
- return null;
- }
- rStack.setStackDisplayName(aDisplayName);
- return GT_Utility.copyAmount(aAmount, rStack);
- }
-
- @Override
- public ItemStack getWithCharge(final long aAmount, final int aEnergy, final Object... aReplacements) {
- final ItemStack rStack = this.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(final long aAmount, final long aMetaValue, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(this.mStack));
- }
-
- @Override
- public GregtechItemList registerOre(final Object... aOreNames) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- for (final Object tOreName : aOreNames) {
- GT_OreDictUnificator.registerOre(tOreName, this.get(1));
- }
- return this;
- }
-
- @Override
- public GregtechItemList registerWildcardAsOre(final Object... aOreNames) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- for (final Object tOreName : aOreNames) {
- GT_OreDictUnificator.registerOre(tOreName, this.getWildcard(1));
- }
- return this;
- }
-} \ No newline at end of file
+ /**
+ * Items
+ */
+
+ // Advanced Hazmat Suit
+ Armour_Hazmat_Advanced_Helmet,
+ Armour_Hazmat_Advanced_Chest,
+ Armour_Hazmat_Advanced_Legs,
+ Armour_Hazmat_Advanced_Boots,
+
+ // Gregtech Machine Parts
+ Electric_Motor_LuV,
+ Electric_Motor_ZPM,
+ Electric_Motor_UV,
+ Electric_Motor_MAX,
+ Electric_Pump_LuV,
+ Electric_Pump_ZPM,
+ Electric_Pump_UV,
+ Electric_Pump_MAX,
+ Conveyor_Module_LuV,
+ Conveyor_Module_ZPM,
+ Conveyor_Module_UV,
+ Conveyor_Module_MAX,
+ Electric_Piston_LuV,
+ Electric_Piston_ZPM,
+ Electric_Piston_UV,
+ Electric_Piston_MAX,
+ Robot_Arm_LuV,
+ Robot_Arm_ZPM,
+ Robot_Arm_UV,
+ Robot_Arm_MAX,
+ Field_Generator_LuV,
+ Field_Generator_ZPM,
+ Field_Generator_UV,
+ Field_Generator_MAX,
+ Emitter_LuV,
+ Emitter_ZPM,
+ Emitter_UV,
+ Emitter_MAX,
+ Sensor_LuV,
+ Sensor_ZPM,
+ Sensor_UV,
+ Sensor_MAX,
+
+ // ULV Components
+ Electric_Motor_ULV,
+ Electric_Pump_ULV,
+ Conveyor_Module_ULV,
+ Electric_Piston_ULV,
+ Robot_Arm_ULV,
+ Field_Generator_ULV,
+ Emitter_ULV,
+ Sensor_ULV,
+
+ // Mixed Components
+ TransmissionComponent_ULV,
+ TransmissionComponent_LV,
+ TransmissionComponent_MV,
+ TransmissionComponent_HV,
+ TransmissionComponent_EV,
+ TransmissionComponent_IV,
+ TransmissionComponent_LuV,
+ TransmissionComponent_ZPM,
+ TransmissionComponent_UV,
+ TransmissionComponent_MAX,
+
+ // Recipe Circuit
+ Circuit_BioRecipeSelector,
+ Circuit_T3RecipeSelector,
+
+ // Circuits
+ Old_Circuit_Primitive,
+ Old_Circuit_Basic,
+ Old_Circuit_Good,
+ Old_Circuit_Advanced,
+ Old_Circuit_Data,
+ Old_Circuit_Elite,
+ Old_Circuit_Master,
+ Old_Tool_DataOrb,
+ Old_Circuit_Ultimate,
+ Old_Tool_DataStick,
+ Circuit_IV,
+ Circuit_LuV,
+ Circuit_ZPM,
+
+ // Circuit Parts
+ Circuit_Board_IV,
+ Circuit_Board_LuV,
+ Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV,
+ Circuit_Parts_Crystal_Chip_LuV,
+ Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV,
+ Circuit_Parts_LuV,
+ Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV,
+ Circuit_Parts_Wiring_LuV,
+ Circuit_Parts_Wiring_ZPM,
+
+ // Old Style Circuits
+ Old_Circuit_Board_Basic,
+ Old_Circuit_Board_Advanced,
+ Old_Circuit_Board_Elite,
+ Old_Circuit_Parts_Crystal_Chip_Elite,
+ Old_Circuit_Parts_Crystal_Chip_Master,
+ Old_Circuit_Parts_Advanced,
+ Old_Circuit_Parts_Wiring_Basic,
+ Old_Circuit_Parts_Wiring_Advanced,
+ Old_Circuit_Parts_Wiring_Elite,
+ Old_Empty_Board_Basic,
+ Old_Empty_Board_Elite,
+
+ // Batteries
+ Battery_RE_EV_Sodium,
+ Battery_RE_EV_Cadmium,
+ Battery_RE_EV_Lithium,
+
+ // Shapes for Extruder
+ Shape_Extruder_WindmillShaft,
+ Shape_Extruder_SmallGear,
+
+ // Cooked Raisin Toast for ImQ009
+ Food_Baked_Raisin_Bread,
+
+ // Fluid Cells to regulate flows.
+ Fluid_Cell_1L,
+ Fluid_Cell_16L,
+ Fluid_Cell_36L,
+ Fluid_Cell_144L,
+
+ // Debug
+ TESTITEM,
+
+ // Larger Volumetric Flasks
+ VOLUMETRIC_FLASK_8k,
+ VOLUMETRIC_FLASK_32k,
+
+ // RTG Fuels
+ Pellet_RTG_PU238,
+ Pellet_RTG_SR90,
+ Pellet_RTG_PO210,
+ Pellet_RTG_AM241,
+
+ // Computer Cube
+ Gregtech_Computer_Cube,
+ Gregtech_Computer_Cube_Machine,
+
+ // Casings for batteries
+ Battery_Casing_Gem_1,
+ Battery_Casing_Gem_2,
+ Battery_Casing_Gem_3,
+ Battery_Casing_Gem_4,
+
+ // Custom Batteries
+ Battery_Gem_1,
+ Battery_Gem_2,
+ Battery_Gem_3,
+ Battery_Gem_4,
+
+ // Compressed Fusion MK3
+ Compressed_Fusion_Reactor,
+
+ // Carbon Materials
+ NanoTube_Base_Substrate,
+ NanoTube_Finished,
+ Carbyne_Tube_Finished,
+ Carbyne_Sheet_Finished,
+
+ // End Game Laser Engraver Lens
+ Laser_Lens_WoodsGlass,
+ Laser_Lens_Special,
+
+ // Bombs
+ Bomb_Cast,
+ Bomb_Cast_Molten,
+ Bomb_Cast_Set,
+ Bomb_Cast_Broken,
+ Bomb_Cast_Mold,
+
+ // Pellet Mold
+ Pellet_Mold,
+
+ // Charged Items for Tree Farms
+ Farm_Processor_EV,
+ Farm_Processor_IV,
+ Farm_Processor_LuV,
+ Farm_Processor_ZPM,
+ Farm_Processor_UV,
+
+ // Upgrade chip for Distillus
+ Distillus_Upgrade_Chip,
+
+ // Chips used to nerf my multis via custom behavioural attachments
+ Chip_MultiNerf_NoOutputBonus,
+ Chip_MultiNerf_NoSpeedBonus,
+ Chip_MultiNerf_NoEuBonus,
+
+ // Milling Balls
+ Milling_Ball_Alumina,
+ Milling_Ball_Soapstone,
+
+ // ----------------------------------------------------------------------------
+
+ /**
+ * MultiBlocks
+ */
+
+ // Tier GT++ Casings
+ GTPP_Casing_ULV,
+ GTPP_Casing_LV,
+ GTPP_Casing_MV,
+ GTPP_Casing_HV,
+ GTPP_Casing_EV,
+ GTPP_Casing_IV,
+ GTPP_Casing_LuV,
+ GTPP_Casing_ZPM,
+ GTPP_Casing_UV,
+ GTPP_Casing_MAX,
+
+ // IronBlastFurnace Machine_Bronze_BlastFurnace
+ Machine_Iron_BlastFurnace,
+ Casing_IronPlatedBricks,
+
+ // Large Centrifuge
+ Industrial_Centrifuge,
+ Casing_Centrifuge1,
+
+ // Large Alloy Smelter
+ Industrial_AlloySmelter,
+
+ // Coke Oven
+ Industrial_CokeOven,
+ Casing_CokeOven,
+ Casing_CokeOven_Coil1,
+ Casing_CokeOven_Coil2,
+
+ // Bending Maching // Plate Press // Press
+ Industrial_PlatePress,
+ Casing_MaterialPress,
+
+ // Matter Fab
+ Industrial_MassFab,
+ Casing_MatterGen,
+ Casing_MatterFab,
+
+ // ABS
+ Industrial_AlloyBlastSmelter,
+ Casing_Coil_BlastSmelter,
+ Casing_BlastSmelter,
+
+ // Industrial Electrolyzer
+ Industrial_Electrolyzer,
+ Casing_Electrolyzer,
+
+ // Industrial Maceration Stack
+ Industrial_MacerationStack,
+ Casing_MacerationStack,
+
+ // Industrial Wire Factory
+ Industrial_WireFactory,
+ Casing_WireFactory,
+
+ // Power sub-station for mass storage. 3 hatches for input and output, whatever voltages you desire.
+ PowerSubStation,
+ Casing_Vanadium_Redox,
+ Casing_Vanadium_Redox_IV,
+ Casing_Vanadium_Redox_LuV,
+ Casing_Vanadium_Redox_ZPM,
+ Casing_Vanadium_Redox_UV,
+ Casing_Vanadium_Redox_MAX,
+ Casing_Power_SubStation,
+
+ // LFTR
+ ThoriumReactor,
+ Casing_Reactor_I,
+ Casing_Reactor_II,
+
+ // Multitank
+ /*Industrial_MultiTank,*/
+ Industrial_MultiTankDense,
+ Casing_MultitankExterior,
+
+ // Fission Fuel Refinery
+ Industrial_FuelRefinery,
+ Casing_Refinery_External,
+ Casing_Refinery_Structural,
+ Casing_Refinery_Internal,
+
+ // Industrial Sifter
+ Industrial_Sifter,
+ Casing_Sifter,
+ Casing_SifterGrate,
+
+ // Large Thermal Centrifuge
+ Industrial_ThermalCentrifuge,
+ Casing_ThermalCentrifuge,
+
+ // Cyclotron
+ COMET_Cyclotron,
+ Casing_Cyclotron_Coil,
+ Casing_Cyclotron_External,
+
+ // Thermal Boiler
+ GT4_Thermal_Boiler,
+ Casing_ThermalContainment,
+
+ // Tree Farm
+ Industrial_TreeFarm,
+ TreeFarmer_Structural,
+ Casing_PLACEHOLDER_TreeFarmer,
+
+ // Fish Pond
+ Industrial_FishingPond,
+ Casing_FishPond,
+
+ // Algae
+ AlgaeFarm_Controller,
+
+ // Chemical Plant
+ ChemicalPlant_Controller,
+
+ // GT4 autoCrafter
+ GT4_Multi_Crafter,
+ Casing_Autocrafter,
+
+ // industrial Ore-Washer
+ Industrial_WashPlant,
+ Casing_WashPlant,
+
+ // Generator Array
+ Generator_Array_Controller,
+
+ // Cutting Factory Controller
+ Industrial_CuttingFactoryController,
+ Casing_CuttingFactoryFrame,
+
+ // Tesla Tower
+ TelsaTower,
+ Casing_TeslaTower,
+
+ // Large Extruder
+ Industrial_Extruder,
+ Casing_Extruder,
+
+ // Multi-Machine
+ Industrial_MultiMachine,
+ Casing_Multi_Use,
+
+ // Bedrock Mining Platforms
+ /*BedrockMiner_MKI, */
+ /*BedrockMiner_MKII, */
+ /*BedrockMiner_MKIII, */
+ Casing_BedrockMiner,
+
+ // Large Packager
+ Amazon_Warehouse_Controller,
+ Casing_AmazonWarehouse,
+
+ // Advanced GT vanilla Multis
+ Machine_Adv_BlastFurnace,
+ Casing_Adv_BlastFurnace,
+ Machine_Adv_ImplosionCompressor,
+ Machine_Adv_DistillationTower,
+
+ // Advanced Assembly Line
+ Machine_Adv_AssemblyLine,
+
+ // Advanced Vacuum Freezer
+ Industrial_Cryogenic_Freezer,
+ Casing_AdvancedVacuum,
+
+ // FusionTek MK IV
+ FusionComputer_UV2,
+ Casing_Fusion_External,
+ Casing_Fusion_Internal,
+
+ // large mixer
+ Industrial_Mixer,
+
+ // Naq Reactor
+ Casing_Naq_Reactor_A,
+ Casing_Naq_Reactor_B,
+ Casing_Naq_Reactor_C,
+ /*Controller_Naq_Reactor, */
+ Casing_Containment,
+
+ // Arc Furnace
+ Industrial_Arc_Furnace,
+ Casing_Industrial_Arc_Furnace,
+
+ // Solar Tower
+ Industrial_Solar_Tower,
+ Casing_SolarTower_Structural,
+ Casing_SolarTower_SaltContainment,
+ Casing_SolarTower_HeatContainment,
+
+ // Larger Turbines
+ Large_Steam_Turbine,
+ Large_HPSteam_Turbine,
+ Large_Gas_Turbine,
+ Large_Plasma_Turbine,
+ Casing_Turbine_Shaft,
+ Casing_Turbine_LP,
+ Casing_Turbine_HP,
+ Casing_Turbine_Gas,
+ Casing_Turbine_Plasma,
+ XL_HeatExchanger,
+ Casing_XL_HeatExchanger,
+
+ // Large Engine
+ Casing_Reinforced_Engine_Casing,
+
+ // Large Vacuum Furnace
+ Casing_Vacuum_Furnace,
+ Controller_Vacuum_Furnace,
+
+ // Large Rocket Engine
+ Casing_RocketEngine,
+ Controller_RocketEngine,
+
+ // Large Semi-Fluid
+ Controller_LargeSemifluidGenerator,
+
+ // IsaMill
+ Controller_IsaMill,
+ Casing_IsaMill_Casing,
+ Casing_IsaMill_Gearbox,
+ Casing_IsaMill_Pipe,
+
+ // Flotation Cell
+ Controller_Flotation_Cell,
+ Casing_Flotation_Cell,
+
+ // Sparge Tower
+ Controller_Sparge_Tower,
+ Casing_Sparge_Tower_Exterior,
+ Casing_Sparge_Tower_Interior,
+
+ // Elemental Duplicator
+ Controller_ElementalDuplicator,
+ Casing_ElementalDuplicator,
+
+ // Forge Hammer
+ Controller_IndustrialForgeHammer,
+ Casing_IndustrialForgeHammer,
+
+ // Molecular Transformer
+ Controller_MolecularTransformer,
+ Casing_Molecular_Transformer_1,
+ Casing_Molecular_Transformer_2,
+ Casing_Molecular_Transformer_3,
+
+ // Big Steam Macerator
+ Controller_SteamMaceratorMulti,
+ // Big Steam Compressor
+ Controller_SteamCompressorMulti,
+
+ // Industrial Rock Breaker
+ Controller_IndustrialRockBreaker,
+
+ // Industrial Chisel
+ Controller_IndustrialAutoChisel,
+ Casing_IndustrialAutoChisel,
+
+ // Industrial Fluid Heater
+ Controller_IndustrialFluidHeater,
+
+ // Custom Machine Casings
+ Casing_Machine_Custom_1,
+ Casing_Machine_Custom_2,
+ Casing_Machine_Custom_3,
+ Casing_Machine_Custom_4,
+ Casing_Machine_Custom_5,
+ Casing_Machine_Custom_6,
+
+ // ----------------------------------------------------------------------------
+
+ /**
+ * Custom hatches/Busses
+ */
+
+ // Buffer Dynamos
+ Hatch_Buffer_Dynamo_ULV,
+ Hatch_Buffer_Dynamo_LV,
+ Hatch_Buffer_Dynamo_MV,
+ Hatch_Buffer_Dynamo_HV,
+ Hatch_Buffer_Dynamo_EV,
+ Hatch_Buffer_Dynamo_IV,
+ Hatch_Buffer_Dynamo_LuV,
+ Hatch_Buffer_Dynamo_ZPM,
+ Hatch_Buffer_Dynamo_UV,
+ Hatch_Buffer_Dynamo_MAX,
+
+ // Air Intake hatch
+ Hatch_Air_Intake,
+ Hatch_Air_Intake_Extreme,
+
+ // Reservoir Hatch
+ Hatch_Reservoir,
+
+ // XL Turbine Rotor Hatch
+ Hatch_Turbine_Rotor,
+
+ // Standard Turbine Rotor Hatch
+ Hatch_Input_TurbineHousing,
+
+ // Control Core
+ Hatch_Control_Core,
+
+ // Milling Ball Bus
+ Bus_Milling_Balls,
+
+ // Catalyst Bus
+ Bus_Catalysts,
+
+ // Custom Fluid Hatches
+ Hatch_Input_Cryotheum,
+ Hatch_Input_Pyrotheum,
+ Hatch_Input_Naquadah,
+ Hatch_Input_Steam,
+
+ // Steam Multi Buses
+ Hatch_Input_Bus_Steam,
+ Hatch_Output_Bus_Steam,
+
+ // Elemental Duplicator Data Orb Bus
+ Hatch_Input_Elemental_Duplicator,
+
+ // RTG Hatch
+ Hatch_RTG_LV,
+ Hatch_RTG_MV,
+ Hatch_RTG_HV,
+
+ // Battery hatches for PSS
+ Hatch_Input_Battery_MV,
+ Hatch_Input_Battery_EV,
+ Hatch_Output_Battery_MV,
+ Hatch_Output_Battery_EV,
+
+ // Advanced Mufflers
+ Hatch_Muffler_Adv_LV,
+ Hatch_Muffler_Adv_MV,
+ Hatch_Muffler_Adv_HV,
+ Hatch_Muffler_Adv_EV,
+ Hatch_Muffler_Adv_IV,
+ Hatch_Muffler_Adv_LuV,
+ Hatch_Muffler_Adv_ZPM,
+ Hatch_Muffler_Adv_UV,
+ Hatch_Muffler_Adv_MAX,
+
+ // Super Input Busses
+ Hatch_SuperBus_Input_ULV,
+ Hatch_SuperBus_Input_LV,
+ Hatch_SuperBus_Input_MV,
+ Hatch_SuperBus_Input_HV,
+ Hatch_SuperBus_Input_EV,
+ Hatch_SuperBus_Input_IV,
+ Hatch_SuperBus_Input_LuV,
+ Hatch_SuperBus_Input_ZPM,
+ Hatch_SuperBus_Input_UV,
+ Hatch_SuperBus_Input_MAX,
+
+ // Super Output Busses
+ Hatch_SuperBus_Output_ULV,
+ Hatch_SuperBus_Output_LV,
+ Hatch_SuperBus_Output_MV,
+ Hatch_SuperBus_Output_HV,
+ Hatch_SuperBus_Output_EV,
+ Hatch_SuperBus_Output_IV,
+ Hatch_SuperBus_Output_LuV,
+ Hatch_SuperBus_Output_ZPM,
+ Hatch_SuperBus_Output_UV,
+ Hatch_SuperBus_Output_MAX,
+
+ // ----------------------------------------------------------------------------
+
+ /**
+ * Blocks
+ */
+ ResonanceChamber_I,
+ ResonanceChamber_II,
+ ResonanceChamber_III,
+ ResonanceChamber_IV,
+
+ Modulator_I,
+ Modulator_II,
+ Modulator_III,
+ Modulator_IV,
+
+ // ----------------------------------------------------------------------------
+
+ /**
+ * Single Block Tile Entities
+ */
+
+ // ULV Generators
+ Generator_Diesel_ULV,
+ Generator_Gas_Turbine_ULV,
+ Generator_Steam_Turbine_ULV,
+
+ // Crate Box
+ CrateStorage,
+
+ // Auto TC Research Creator
+ Thaumcraft_Researcher,
+
+ // Threaded Buffers
+ Automation_Threaded_SuperBuffer_ULV,
+ Automation_Threaded_SuperBuffer_LV,
+ Automation_Threaded_SuperBuffer_MV,
+ Automation_Threaded_SuperBuffer_HV,
+ Automation_Threaded_SuperBuffer_EV,
+ Automation_Threaded_SuperBuffer_IV,
+ Automation_Threaded_SuperBuffer_LuV,
+ Automation_Threaded_SuperBuffer_ZPM,
+ Automation_Threaded_SuperBuffer_UV,
+ Automation_Threaded_SuperBuffer_MAX,
+
+ // infinite Items
+ Infinite_Item_Chest,
+
+ // GT4 Redstone
+ GT4_Redstone_Lamp,
+ GT4_Redstone_Button_Panel,
+ GT4_Redstone_Scale,
+ GT4_Redstone_Display,
+ GT4_Redstone_Circuit,
+
+ // Gt4 Workbenches
+ GT4_Workbench_Bronze,
+ GT4_Workbench_Advanced,
+
+ // GT4 automation
+ GT4_Electric_Auto_Workbench_LV,
+ GT4_Electric_Auto_Workbench_MV,
+ GT4_Electric_Auto_Workbench_HV,
+ GT4_Electric_Auto_Workbench_EV,
+ GT4_Electric_Auto_Workbench_IV,
+ GT4_Electric_Auto_Workbench_LuV,
+ GT4_Electric_Auto_Workbench_ZPM,
+ GT4_Electric_Auto_Workbench_UV,
+ GT4_Electric_Inventory_Manager_LV,
+ GT4_Electric_Inventory_Manager_MV,
+ GT4_Electric_Inventory_Manager_HV,
+ GT4_Electric_Inventory_Manager_EV,
+ GT4_Electric_Inventory_Manager_IV,
+ GT4_Electric_Inventory_Manager_LuV,
+ GT4_Electric_Inventory_Manager_ZPM,
+ GT4_Electric_Inventory_Manager_UV,
+
+ // GT4 Crop Harvester
+ GT4_Crop_Harvester_LV,
+ GT4_Crop_Harvester_MV,
+ GT4_Crop_Harvester_HV,
+ GT4_Crop_Harvester_EV,
+ GT4_Crop_Harvester_IV,
+ GT4_Crop_Harvester_LuV,
+ GT4_Crop_Harvester_ZPM,
+ GT4_Crop_Harvester_UV,
+
+ // Geothermal Engines
+ Geothermal_Engine_EV,
+ Geothermal_Engine_IV,
+ Geothermal_Engine_LuV,
+
+ // Tesseracts
+ GT4_Tesseract_Generator,
+ GT4_Tesseract_Terminal,
+
+ // Advanced Boilers
+ Boiler_Advanced_LV,
+ Boiler_Advanced_MV,
+ Boiler_Advanced_HV,
+
+ // Fancy Pollution Devices
+ Pollution_Detector,
+ Pollution_Cleaner_ULV,
+ Pollution_Cleaner_LV,
+ Pollution_Cleaner_MV,
+ Pollution_Cleaner_HV,
+ Pollution_Cleaner_EV,
+ Pollution_Cleaner_IV,
+ Pollution_Cleaner_LuV,
+ Pollution_Cleaner_ZPM,
+ Pollution_Cleaner_UV,
+ Pollution_Cleaner_MAX,
+
+ // Debug machine
+ Pollution_Creator,
+ Garbage_Collector_Debug_Machine,
+
+ // Basically is an automatic Cauldron
+ SimpleDustWasher_ULV,
+ SimpleDustWasher_MV,
+ SimpleDustWasher_EV,
+ SimpleDustWasher_LuV,
+ SimpleDustWasher_UV,
+
+ // Solar Tower Reflector
+ Solar_Tower_Reflector,
+
+ // Super Tier Chests
+ Super_Chest_LV,
+ Super_Chest_MV,
+ Super_Chest_HV,
+ Super_Chest_EV,
+ Super_Chest_IV,
+
+ // Chunkloader
+ GT_Chunkloader_HV,
+ GT_Chunkloader_ZPM,
+ GT_Chunkloader_IV,
+
+ // Wireless Chargers
+ Charger_LV,
+ Charger_MV,
+ Charger_HV,
+ Charger_EV,
+ Charger_IV,
+ Charger_LuV,
+ Charger_ZPM,
+ Charger_UV,
+ Charger_MAX,
+
+ // Tiny Fusion
+ /*Miniature_Fusion, */
+
+ // Component Makers
+ Machine_LV_Component_Maker,
+ Machine_MV_Component_Maker,
+ Machine_HV_Component_Maker,
+ Machine_EV_Component_Maker,
+ Machine_IV_Component_Maker,
+ Machine_LuV_Component_Maker,
+ Machine_ZPM_Component_Maker,
+ Machine_UV_Component_Maker,
+
+ // Reactor Processing Unit
+ ReactorProcessingUnit_IV,
+ ReactorProcessingUnit_ZPM,
+
+ // Cold Trap
+ ColdTrap_IV,
+ ColdTrap_ZPM,
+
+ // Breakers
+ BreakerBox_ULV,
+ BreakerBox_LV,
+ BreakerBox_MV,
+ BreakerBox_HV,
+ BreakerBox_EV,
+ BreakerBox_IV,
+ BreakerBox_LuV,
+ BreakerBox_ZPM,
+ BreakerBox_UV,
+ BreakerBox_MAX,
+
+ // Solar Generators
+ GT_Solar_ULV,
+ GT_Solar_LV,
+ GT_Solar_MV,
+ GT_Solar_HV,
+ GT_Solar_EV,
+ GT_Solar_IV,
+ GT_Solar_LuV,
+ GT_Solar_ZPM,
+ GT_Solar_UV,
+ GT_Solar_MAX,
+
+ // 512v Creative Buffer
+ Energy_Buffer_CREATIVE,
+ // Variable voltage RF convertor
+ Energy_Buffer_RF_Convertor,
+ // Energy Buffers
+ Energy_Buffer_1by1_ULV,
+ Energy_Buffer_1by1_LV,
+ Energy_Buffer_1by1_MV,
+ Energy_Buffer_1by1_HV,
+ Energy_Buffer_1by1_EV,
+ Energy_Buffer_1by1_IV,
+ Energy_Buffer_1by1_LuV,
+ Energy_Buffer_1by1_ZPM,
+ Energy_Buffer_1by1_UV,
+ Energy_Buffer_1by1_MAX,
+
+ // Cobble Generators
+ Cobble_Generator_ULV,
+ Cobble_Generator_LV,
+ Cobble_Generator_MV,
+ Cobble_Generator_HV,
+ Cobble_Generator_EV,
+ Cobble_Generator_IV,
+ Cobble_Generator_LuV,
+ Cobble_Generator_ZPM,
+ Cobble_Generator_UV,
+ Cobble_Generator_MAX,
+
+ // The max Steam condenser
+ Condensor_MAX,
+
+ // Player owned Safes
+ GT_Safe_ULV,
+ GT_Safe_LV,
+ GT_Safe_MV,
+ GT_Safe_HV,
+ GT_Safe_EV,
+ GT_Safe_IV,
+ GT_Safe_LuV,
+ GT_Safe_ZPM,
+ GT_Safe_UV,
+ GT_Safe_MAX,
+
+ // Rocket Engines
+ Rocket_Engine_EV,
+ Rocket_Engine_IV,
+ Rocket_Engine_LuV,
+
+ // GT4 Shelves
+ GT4_Shelf,
+ GT4_Shelf_Iron,
+ GT4_Shelf_FileCabinet,
+ GT4_Shelf_Desk,
+ GT4_Shelf_Compartment,
+ GT4_Shelf_Large,
+
+ // Hi Amp Transformers
+ Transformer_HA_LV_ULV,
+ Transformer_HA_MV_LV,
+ Transformer_HA_HV_MV,
+ Transformer_HA_EV_HV,
+ Transformer_HA_IV_EV,
+ Transformer_HA_LuV_IV,
+ Transformer_HA_ZPM_LuV,
+ Transformer_HA_UV_ZPM,
+ Transformer_HA_MAX_UV,
+
+ // Semi-Fluid generators
+ Generator_SemiFluid_LV,
+ Generator_SemiFluid_MV,
+ Generator_SemiFluid_HV,
+
+ // Advanced Mixer 4x4
+ Machine_Advanced_LV_Mixer,
+ Machine_Advanced_MV_Mixer,
+ Machine_Advanced_HV_Mixer,
+ Machine_Advanced_EV_Mixer,
+ Machine_Advanced_IV_Mixer,
+ Machine_Advanced_LuV_Mixer,
+ Machine_Advanced_ZPM_Mixer,
+ Machine_Advanced_UV_Mixer,
+
+ // Block that enables uplink to a superconductor network
+ SuperConductorInputNode,
+
+ // Heat Pipes
+ HeatPipe_Tier_1,
+ HeatPipe_Tier_2,
+ HeatPipe_Tier_3,
+
+ // Chemical Dehydrators for nuclear fuels
+ GT_Dehydrator_MV,
+ GT_Dehydrator_HV,
+ GT_Dehydrator_EV,
+ GT_Dehydrator_IV,
+ GT_Dehydrator_LuV,
+ GT_Dehydrator_ZPM,
+
+ // Fluid Storage Tanks
+ GT_FluidTank_ULV,
+ GT_FluidTank_LV,
+ GT_FluidTank_MV,
+ GT_FluidTank_HV,
+ GT_FluidTank_EV,
+ GT_FluidTank_IV,
+ GT_FluidTank_LuV,
+ GT_FluidTank_ZPM,
+ GT_FluidTank_UV,
+ GT_FluidTank_MAX,
+
+ // Tick Accelerators from GTNH
+ AcceleratorLV,
+ AcceleratorMV,
+ AcceleratorHV,
+ AcceleratorEV,
+ AcceleratorIV,
+ AcceleratorLuV,
+ AcceleratorZPM,
+ AcceleratorUV,
+
+ // GT RTG
+ RTG,
+
+ // Chisel Machines
+ GT_Chisel_LV,
+ GT_Chisel_MV,
+ GT_Chisel_HV,
+
+ // Plasma Tank
+ /*Plasma_Tank,*/
+
+ // ----------------------------------------------------------------------------
+
+ /**
+ * Covers
+ */
+
+ // Fluid Void Covers
+ Cover_Overflow_ULV,
+ Cover_Overflow_LV,
+ Cover_Overflow_MV,
+ Cover_Overflow_HV,
+ Cover_Overflow_EV,
+ Cover_Overflow_IV,
+
+ // Item Void Covers
+ Cover_Overflow_Item_ULV,
+ Cover_Overflow_Item_LV,
+ Cover_Overflow_Item_MV,
+ Cover_Overflow_Item_HV,
+ Cover_Overflow_Item_EV,
+ Cover_Overflow_Item_IV,
+
+ // Fake Hull Covers
+ FakeMachineCasingPlate_ULV,
+ FakeMachineCasingPlate_LV,
+ FakeMachineCasingPlate_MV,
+ FakeMachineCasingPlate_HV,
+ FakeMachineCasingPlate_EV,
+ FakeMachineCasingPlate_IV,
+ FakeMachineCasingPlate_LuV,
+ FakeMachineCasingPlate_ZPM,
+ FakeMachineCasingPlate_UV,
+ FakeMachineCasingPlate_MAX,
+
+// ----------------------------------------------------------------------------
+
+;
+
+ public static final GregtechItemList[] DYE_ONLY_ITEMS = {Energy_Buffer_1by1_EV, Energy_Buffer_1by1_EV};
+ private ItemStack mStack;
+ private boolean mHasNotBeenSet = true;
+
+ @Override
+ public GregtechItemList set(final Item aItem) {
+ this.mHasNotBeenSet = false;
+ if (aItem == null) {
+ return this;
+ }
+ final ItemStack aStack = new ItemStack(aItem, 1, 0);
+ this.mStack = GT_Utility.copyAmount(1, aStack);
+ return this;
+ }
+
+ @Override
+ public GregtechItemList set(final ItemStack aStack) {
+ this.mHasNotBeenSet = false;
+ this.mStack = GT_Utility.copyAmount(1, aStack);
+ return this;
+ }
+
+ @Override
+ public Item getItem() {
+ if (this.mHasNotBeenSet) {
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ }
+ if (GT_Utility.isStackInvalid(this.mStack)) {
+ return null;
+ }
+ return this.mStack.getItem();
+ }
+
+ @Override
+ public Block getBlock() {
+ if (this.mHasNotBeenSet) {
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ }
+ return getBlockFromStack(this.getItem());
+ }
+
+ @Override
+ public final boolean hasBeenSet() {
+ return !this.mHasNotBeenSet;
+ }
+
+ @Override
+ public boolean isStackEqual(final Object aStack) {
+ return this.isStackEqual(aStack, false, false);
+ }
+
+ @Override
+ public boolean isStackEqual(final Object aStack, final boolean aWildcard, final boolean aIgnoreNBT) {
+ if (GT_Utility.isStackInvalid(aStack)) {
+ return false;
+ }
+ return GT_Utility.areUnificationsEqual(
+ (ItemStack) aStack, aWildcard ? this.getWildcard(1) : this.get(1), aIgnoreNBT);
+ }
+
+ public static Block getBlockFromStack(Object aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return Blocks.air;
+ return Block.getBlockFromItem(((ItemStack) aStack).getItem());
+ }
+
+ @Override
+ public ItemStack get(final long aAmount, final Object... aReplacements) {
+ if (this.mHasNotBeenSet) {
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ }
+ if (GT_Utility.isStackInvalid(this.mStack)) {
+ return GT_Utility.copyAmount(aAmount, aReplacements);
+ }
+ return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(this.mStack));
+ }
+
+ @Override
+ public ItemStack getWildcard(final long aAmount, final Object... aReplacements) {
+ if (this.mHasNotBeenSet) {
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ }
+ if (GT_Utility.isStackInvalid(this.mStack)) {
+ return GT_Utility.copyAmount(aAmount, aReplacements);
+ }
+ return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(this.mStack));
+ }
+
+ @Override
+ public ItemStack getUndamaged(final long aAmount, final Object... aReplacements) {
+ if (this.mHasNotBeenSet) {
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ }
+ if (GT_Utility.isStackInvalid(this.mStack)) {
+ return GT_Utility.copyAmount(aAmount, aReplacements);
+ }
+ return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(this.mStack));
+ }
+
+ @Override
+ public ItemStack getAlmostBroken(final long aAmount, final Object... aReplacements) {
+ if (this.mHasNotBeenSet) {
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ }
+ if (GT_Utility.isStackInvalid(this.mStack)) {
+ return GT_Utility.copyAmount(aAmount, aReplacements);
+ }
+ return GT_Utility.copyAmountAndMetaData(
+ aAmount, this.mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(this.mStack));
+ }
+
+ @Override
+ public ItemStack getWithName(final long aAmount, final String aDisplayName, final Object... aReplacements) {
+ final ItemStack rStack = this.get(1, aReplacements);
+ if (GT_Utility.isStackInvalid(rStack)) {
+ return null;
+ }
+ rStack.setStackDisplayName(aDisplayName);
+ return GT_Utility.copyAmount(aAmount, rStack);
+ }
+
+ @Override
+ public ItemStack getWithCharge(final long aAmount, final int aEnergy, final Object... aReplacements) {
+ final ItemStack rStack = this.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(final long aAmount, final long aMetaValue, final Object... aReplacements) {
+ if (this.mHasNotBeenSet) {
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ }
+ if (GT_Utility.isStackInvalid(this.mStack)) {
+ return GT_Utility.copyAmount(aAmount, aReplacements);
+ }
+ return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(this.mStack));
+ }
+
+ @Override
+ public GregtechItemList registerOre(final Object... aOreNames) {
+ if (this.mHasNotBeenSet) {
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ }
+ for (final Object tOreName : aOreNames) {
+ GT_OreDictUnificator.registerOre(tOreName, this.get(1));
+ }
+ return this;
+ }
+
+ @Override
+ public GregtechItemList registerWildcardAsOre(final Object... aOreNames) {
+ if (this.mHasNotBeenSet) {
+ throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
+ }
+ for (final Object tOreName : aOreNames) {
+ GT_OreDictUnificator.registerOre(tOreName, this.getWildcard(1));
+ }
+ return this;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java
index 7ef6b5701e..b535236575 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java
@@ -24,16 +24,27 @@ Circuit Parts
Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
*/
public enum GregtechOreDictNames {
- buffer_core, itemGregConduit, Circuit_IV, Circuit_LuV, Circuit_ZPM,
- Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
- Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
- Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
- Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
-
- public String unlocalisedName;
+ buffer_core,
+ itemGregConduit,
+ Circuit_IV,
+ Circuit_LuV,
+ Circuit_ZPM,
+ Circuit_Board_IV,
+ Circuit_Board_LuV,
+ Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV,
+ Circuit_Parts_Crystal_Chip_LuV,
+ Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV,
+ Circuit_Parts_LuV,
+ Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV,
+ Circuit_Parts_Wiring_LuV,
+ Circuit_Parts_Wiring_ZPM;
- private void ModObject() {
- this.unlocalisedName = this.name();
- }
+ public String unlocalisedName;
-} \ No newline at end of file
+ private void ModObject() {
+ this.unlocalisedName = this.name();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
index b17b4a26ff..03d2741fe3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
@@ -3,8 +3,6 @@ package gtPlusPlus.xmod.gregtech.api.enums;
import static gregtech.api.enums.GT_Values.*;
import static gtPlusPlus.core.util.Utils.getTcAspectStack;
-import java.util.*;
-
import gregtech.api.enums.*;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
import gregtech.api.interfaces.*;
@@ -15,927 +13,2565 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
import gtPlusPlus.xmod.gregtech.api.objects.GregtechItemData;
import gtPlusPlus.xmod.gregtech.api.objects.GregtechMaterialStack;
+import java.util.*;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
public enum GregtechOrePrefixes {
- /* 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)
- */
- ingotHot("Hot Ingots", "Hot ", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 16, 12), // A hot Ingot, which has to be cooled down by a Vacuum Freezer.
- ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64, 11), // A regular Ingot. Introduced by Eloraam
- dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 9, 64, 0), // 1/9th of a Dust.
- dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 4, 64, 1), // 1/4th of a Dust.
- dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, 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", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 2),
- dustPure("Purified Dusts", "Purified Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 4),
- dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false, 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", true, true, false, false, false, false, false, true, false, false, B[1], M / 9, 64, 9), // A Nugget. Introduced by Eloraam
- plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, 64, 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia
- block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0, M * 9, 64, 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar
- gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 1, 64, 8), // A regular Gem worth one Dust. Introduced by Eloraam
- gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 4, 64, 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft
- gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 2, 64, 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft
- gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 2, 32, 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft
- gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 4, 16, 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft
- stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 23), // Stick made of half an Ingot. Introduced by Eloraam
- type2("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 8, 64, -1),
-
- toolSkookumChoocher("Skookum Choocher", "", " Skookum Choocher", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots.
- toolAngleGrinder("Angle Grinder", "", "Angle Grinder", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots.
- toolElectricSnips("Electric Snips", "", "Electric Snips", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots.
- toolElectricLighter("Electric Lighter", "", "Electric Lighter", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots.
- toolElectricButcherKnife("Electric Butcher Knife", "", "Electric Butcher Knife", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots.
-
-
-
- batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
- circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
- chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Buildcraft
- computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1),; // A whole Computer. "computerMaster" = ComputerCube
-
- public static volatile int VERSION = 508;
-
- static {
-
- ingotHot.mHeatDamage = 3.0F;
-
- }
-
- public final ArrayList<ItemStack> mPrefixedItems = new ArrayList<>();
- public final short mTextureIndex;
- public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost;
- public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem;
- public final List<TC_AspectStack> mAspects = new ArrayList<>();
- public final Collection<GregtechOrePrefixes> mFamiliarPrefixes = new HashSet<>();
- /**
- * 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;
- private final Collection<Materials> mNotGeneratedItems = new HashSet<>(), mIgnoredMaterials = new HashSet<>(), mGeneratedItems = new HashSet<>();
- private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessing = new ArrayList<>();
- private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessingFake = new ArrayList<>();
- public ItemStack mContainerItem = null;
- public ICondition<ISubTagContainer> mCondition = null;
- public byte mDefaultStackSize = 64;
- public GregtechMaterialStack mSecondaryMaterial = null;
- public GregtechOrePrefixes mPrefixInto = this;
- public float mHeatDamage = 0.0F; // Negative for Frost Damage
- /**
- * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check.
- */
- public int mMaterialGenerationBits = 0;
- private GregtechOrePrefixes(final String aRegularLocalName, final String aLocalizedMaterialPre, final String aLocalizedMaterialPost, final boolean aIsUnificatable, final boolean aIsMaterialBased, final boolean aIsSelfReferencing, final boolean aIsContainer, final boolean aDontUnificateActively, final boolean aIsUsedForBlocks, final boolean aAllowNormalRecycling, final boolean aGenerateDefaultItem, final boolean aIsEnchantable, final boolean aIsUsedForOreProcessing, final int aMaterialGenerationBits, final long aMaterialAmount, final int aDefaultStackSize, final int aTextureindex) {
- this.mIsUnificatable = aIsUnificatable;
- this.mIsMaterialBased = aIsMaterialBased;
- this.mIsSelfReferencing = aIsSelfReferencing;
- this.mIsContainer = aIsContainer;
- this.mDontUnificateActively = aDontUnificateActively;
- this.mIsUsedForBlocks = aIsUsedForBlocks;
- this.mAllowNormalRecycling = aAllowNormalRecycling;
- this.mGenerateDefaultItem = aGenerateDefaultItem;
- this.mIsEnchantable = aIsEnchantable;
- this.mIsUsedForOreProcessing = aIsUsedForOreProcessing;
- this.mMaterialGenerationBits = aMaterialGenerationBits;
- this.mMaterialAmount = aMaterialAmount;
- this.mRegularLocalName = aRegularLocalName;
- this.mLocalizedMaterialPre = aLocalizedMaterialPre;
- this.mLocalizedMaterialPost = aLocalizedMaterialPost;
- this.mDefaultStackSize = (byte) aDefaultStackSize;
- this.mTextureIndex = (short) aTextureindex;
-
-
- //TODO - Utilise some form of way to check if it's gt 5.9 if so, use string switch.
- if (this.name().startsWith("ore")) {
- getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("wire") || this.name().startsWith("cable")) {
- getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("dust")) {
- getTcAspectStack(TC_Aspects.PERDITIO.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("crushed")) {
- getTcAspectStack(TC_Aspects.PERFODIO.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("ingot") || this.name().startsWith("nugget")) {
- getTcAspectStack(TC_Aspects.METALLUM.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("armor")) {
- getTcAspectStack(TC_Aspects.TUTAMEN.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("stone")) {
- getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("pipe")) {
- getTcAspectStack(TC_Aspects.ITER.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("gear")) {
- getTcAspectStack(TC_Aspects.MOTUS.name(), 1).addToAspectList(this.mAspects);
- getTcAspectStack(TC_Aspects.MACHINA.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("frame") || this.name().startsWith("plate")) {
- getTcAspectStack(TC_Aspects.FABRICO.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("tool")) {
- getTcAspectStack(TC_Aspects.INSTRUMENTUM.name(), 2).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("gem") || this.name().startsWith("crystal") || this.name().startsWith("lens")) {
- getTcAspectStack(TC_Aspects.VITREUS.name(), 1).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("crate")) {
- getTcAspectStack(TC_Aspects.ITER.name(), 2).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("circuit")) {
- getTcAspectStack("COGNITIO", 1);
- } else if (this.name().startsWith("computer")) {
- getTcAspectStack("COGNITIO", 4).addToAspectList(this.mAspects);
- } else if (this.name().startsWith("battery")) {
- getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(this.mAspects);
- }
- }
-
- public static GregtechOrePrefixes getOrePrefix(final String aOre) {
- for (final GregtechOrePrefixes tPrefix : values()) {
- if (aOre.startsWith(tPrefix.toString())) {
- return tPrefix;
- }
- }
- return null;
- }
-
- public static String stripPrefix(final String aOre) {
- for (final GregtechOrePrefixes tPrefix : values()) {
- if (aOre.startsWith(tPrefix.toString())) {
- return aOre.replaceFirst(tPrefix.toString(), "");
- }
- }
- return aOre;
- }
-
- public static String replacePrefix(final String aOre, final GregtechOrePrefixes aPrefix) {
- for (final GregtechOrePrefixes tPrefix : values()) {
- if (aOre.startsWith(tPrefix.toString())) {
- return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString());
- }
- }
- return "";
- }
-
- public static GregtechOrePrefixes getPrefix(final String aPrefixName) {
- return getPrefix(aPrefixName, null);
- }
-
- public static GregtechOrePrefixes getPrefix(final String aPrefixName, final GregtechOrePrefixes aReplacement) {
- final Object tObject = GT_Utility.getFieldContent(GregtechOrePrefixes.class, aPrefixName, false, false);
- if ((tObject != null) && (tObject instanceof GregtechOrePrefixes)) {
- return (GregtechOrePrefixes) tObject;
- }
- return aReplacement;
- }
-
- public static Materials getMaterial(final String aOre) {
- return Materials.get(stripPrefix(aOre));
- }
-
- public static Materials getMaterial(final String aOre, final GregtechOrePrefixes aPrefix) {
- return Materials.get(aOre.replaceFirst(aPrefix.toString(), ""));
- }
-
- public static Materials getRealMaterial(final String aOre, final GregtechOrePrefixes aPrefix) {
- return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), ""));
- }
-
- public static boolean isInstanceOf(final String aName, final GregtechOrePrefixes aPrefix) {
- return aName == null ? false : aName.startsWith(aPrefix.toString());
- }
-
- public boolean add(final ItemStack aStack) {
- if (aStack == null) {
- return false;
- }
- if (!this.contains(aStack)) {
- this.mPrefixedItems.add(aStack);
- }
- while (this.mPrefixedItems.contains(null)) {
- this.mPrefixedItems.remove(null);
- }
- return true;
- }
-
-
- public boolean contains(final ItemStack aStack) {
- if (aStack == null) {
- return false;
- }
- for (final ItemStack tStack : this.mPrefixedItems) {
- if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) {
- return true;
- }
- }
- return false;
- }
-
- public boolean doGenerateItem(final Materials aMaterial) {
- return (aMaterial != null) && (aMaterial != Materials._NULL) && (((aMaterial.mTypes & this.mMaterialGenerationBits) != 0) || this.mGeneratedItems.contains(aMaterial)) && !this.mNotGeneratedItems.contains(aMaterial) && ((this.mCondition == null) || this.mCondition.isTrue(aMaterial));
- }
-
- public boolean ignoreMaterials(final Materials... aMaterials) {
- for (final Materials tMaterial : aMaterials) {
- if (tMaterial != null) {
- this.mIgnoredMaterials.add(tMaterial);
- }
- }
- return true;
- }
-
- public boolean addFamiliarPrefix(final GregtechOrePrefixes aPrefix) {
- if ((aPrefix == null) || this.mFamiliarPrefixes.contains(aPrefix) || (aPrefix == this)) {
- return false;
- }
- return this.mFamiliarPrefixes.add(aPrefix);
- }
-
- public boolean add(final Interface_OreRecipeRegistrator aRegistrator) {
- if (aRegistrator == null) {
- return false;
- }
- return this.mOreProcessing.add(aRegistrator);
- }
-
- public void processOre(final GT_Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) {
- if ((aMaterial != null) && ((aMaterial != GT_Materials._NULL) || this.mIsSelfReferencing || !this.mIsMaterialBased) && GT_Utility.isStackValid(aStack)) {
- for (final Interface_OreRecipeRegistrator tRegistrator : this.mOreProcessing) {
- if (D2) {
- GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + this.name() + "' and the Material '" + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator));
- }
- tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
- }
- }
- }
-
- //TODO
- public void processOre(final Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) {
- if ((aMaterial != null) && ((aMaterial != Materials._NULL) || this.mIsSelfReferencing || !this.mIsMaterialBased) && GT_Utility.isStackValid(aStack)) {
- for (final Interface_OreRecipeRegistrator tRegistrator : this.mOreProcessingFake) {
- if (D2) {
- GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + this.name() + "' and the Material '" + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator));
- }
- tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
- }
- }
- }
-
- public Object get(final Object aMaterial) {
- if (aMaterial instanceof GT_Materials) {
- return new GregtechItemData(this, (GT_Materials) aMaterial);
- }
- return this.name() + aMaterial;
- }
-
- public String getDefaultLocalNameForItem(final Materials aMaterial) {
-
-
- // Use Standard Localization
- return this.mLocalizedMaterialPre + aMaterial.mDefaultLocalName + this.mLocalizedMaterialPost;
- }
-
- public enum GT_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.
- * <p/>
- * Mainly for preventing NullPointer Exceptions and providing Default Values.
- *
- * Unknown Material Components. Dead End Section.
- *
- * Alkalus Range 730-799 & 970-998
- * (aMetaItemSubID, TextureSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, R, G, B, Alpha, aLocalName,
- * aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor
- * this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true);
- *
- */
- _NULL(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, Element._NULL, Arrays.asList(getTcAspectStack(TC_Aspects.VACUOS.name(), 1))),
-
-
- //Lapis(526, TextureSet.SET_LAPIS, 1.0F, 0, 1, 1 | 4 | 8, 70, 70, 220, 0, "Lapis", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeBlue, 2, Arrays.asList(new MaterialStack(Materials.Lazurite, 12), new MaterialStack(Materials.Sodalite, 2), new MaterialStack(Materials.Pyrite, 1), new MaterialStack(Materials.Calcite, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.SENSUS, 1))),
- Pyrotheum(20, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 255, 128, 0, 0, "Pyrotheum", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeYellow, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1)), Arrays.asList(getTcAspectStack("PRAECANTATIO", 2), getTcAspectStack(TC_Aspects.IGNIS, 1))),
- Cryotheum(21, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 102, 178, 255, 0, "Cryotheum", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Blizz, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Snow, 1), new MaterialStack(Materials.Niter, 1)), Arrays.asList(getTcAspectStack("PRAECANTATIO", 2), getTcAspectStack(TC_Aspects.GELUM, 1))),
- Ender(22, TextureSet.SET_FLUID, 1.0F, 0, 2, 1, 255, 255, 255, 0, "Ender", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeGreen),
-
- /**
- * Circuitry, Batteries and other Technical things
- */
- Symbiotic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "IV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 4), getTcAspectStack(TC_Aspects.MACHINA, 4))),
- Neutronic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "LuV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 6), getTcAspectStack(TC_Aspects.MACHINA, 6))),
- Quantum(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "ZPM Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 8), getTcAspectStack(TC_Aspects.MACHINA, 8))),
-
- Superconductor(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 190, 240, 190, 0, "Superconductor", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeGreen, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 8))),
-
- Staballoy(30, TextureSet.SET_ROUGH, 10.0F, 5120, 4, 1 | 2 | 16 | 32 | 64 | 128, 68, 75, 66, 0, "Staballoy", 0, 0, 1500, 2800, true, false, 1, 3, 1, Dyes.dyeGreen, 2, Arrays.asList(new MaterialStack(Materials.Titanium, 1), new MaterialStack(Materials.Uranium, 9)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
- Bedrockium(31, TextureSet.SET_FINE, 8.0F, 8196, 3, 1 | 2 | 16 | 32 | 64 | 128, 39, 39, 39, 0, "Bedrockium", 0, 0, -1, 0, false, false, 1, 5, 1, Dyes.dyeLightGray, 2, Arrays.asList(new MaterialStack(Materials.Carbon, 63), new MaterialStack(Materials.Carbon, 56)), Arrays.asList(getTcAspectStack(TC_Aspects.VACUOS, 8), getTcAspectStack(TC_Aspects.TUTAMEN, 3))),
- BloodSteel(32, TextureSet.SET_METALLIC, 11.0F, 768, 4, 1 | 2 | 16 | 32 | 64 | 128, 142, 28, 0, 0, "Blood Steel", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Steel, 3)), Arrays.asList(getTcAspectStack(TC_Aspects.VICTUS, 8), getTcAspectStack(TC_Aspects.IGNIS, 3))),
- Void(33, TextureSet.SET_METALLIC, 6.0F, 1280, 3, 1 | 2 | 16 | 32 | 64 | 128, 82, 17, 82, 0, "Void Metal", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeBlack, Arrays.asList(getTcAspectStack("PRAECANTATIO", 5), getTcAspectStack(TC_Aspects.VACUOS, 7))),
- ConductiveIron(34, TextureSet.SET_METALLIC, 5.0F, 256, 2, 1 | 2, 164, 109, 100, 0, "Conductive Iron", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Iron, 6), new MaterialStack(Materials.Redstone, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.POTENTIA, 2), getTcAspectStack(TC_Aspects.METALLUM, 2))),
- ElectricalSteel(35, TextureSet.SET_METALLIC, 7.0F, 768, 3, 1 | 2 | 64 | 128, 194, 194, 194, 0, "Electrical Steel", 0, 0, 1811, 1000, true, false, 3, 1, 1, Dyes.dyeLightGray, 2, Arrays.asList(new MaterialStack(Materials.Iron, 3), new MaterialStack(Materials.Coal, 2), new MaterialStack(Materials.Silicon, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.MAGNETO, 2), getTcAspectStack(TC_Aspects.ELECTRUM, 5))),
- EnergeticAlloy(36, TextureSet.SET_SHINY, 5.0F, 512, 3, 1 | 2 | 64 | 128, 252, 152, 45, 0, "Energetic Alloy", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeOrange, 2, Arrays.asList(new MaterialStack(Materials.Gold, 3), new MaterialStack(Materials.Glowstone, 2), new MaterialStack(Materials.Redstone, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.POTENTIA, 4), getTcAspectStack(TC_Aspects.LUX, 3))),
- VibrantAlloy(37, TextureSet.SET_SHINY, 7.0F, 1280, 4, 1 | 2 | 64 | 128, 204, 242, 142, 0, "Vibrant Alloy", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeLime, 2, Arrays.asList(new MaterialStack(Materials.EnergeticAlloy, 1), new MaterialStack(Materials.EnderPearl, 3)), Arrays.asList(getTcAspectStack(TC_Aspects.MACHINA, 5), getTcAspectStack(TC_Aspects.TELUM, 4))),
- PulsatingIron(38, TextureSet.SET_SHINY, 5.0F, 256, 2, 1 | 2 | 64 | 128, 50, 91, 21, 0, "Pulsating Iron", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeGreen, 2, Arrays.asList(new MaterialStack(Materials.Iron, 2), new MaterialStack(Materials.EnderPearl, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.ALIENIS, 3), getTcAspectStack(TC_Aspects.METALLUM, 3))),
- /* TODO*/ RedstoneAlloy(39, TextureSet.SET_METALLIC, 1.0F, 256, 2, 1|2|16|32|64, 178,34,34, 0, "Redstone Alloy", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Iron, 2), new MaterialStack(Materials.Redstone, 4))),
-
- //Needs more Use, I think.
- Tantalloy60(40, TextureSet.SET_DULL, 8.0F, 5120, 3, 1 | 2 | 16 | 32 | 64 | 128, 68, 75, 166, 0, "Tantalloy-60", 0, 0, 3035, 2200, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
- Tantalloy61(41, TextureSet.SET_DULL, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 122, 135, 196, 0, "Tantalloy-61", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
-
- Potin(42, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 201,151,129, 0, "Potin", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
- Inconel792(43, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 108, 240, 118, 0, "Inconel-792", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
- Inconel690(44, TextureSet.SET_DULL, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 118, 220, 138, 0, "Inconel-690", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
- MaragingSteel300(45, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 150, 150, 150, 0, "Maraging Steel 300", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
- MaragingSteel350(46, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 160, 160, 160, 0, "Maraging Steel 350", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
- HastelloyX(47, TextureSet.SET_SHINY, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 255, 193, 37, 0, "Hastelloy-X", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
-
- TriniumNaquadahCarbonite(48, TextureSet.SET_SHINY, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 255, 233, 0, 0, "Trinium Naquadah Carbonite", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
-
-
- //Radioactive Materials
- HydrofluoricAcid(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 200, 200, 200, 0, "Hydrofluoric Acid", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
- UraniumHexaFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 73, 220, 83, 0, "Uranium Hexafluoride", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeLime, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
- UraniumTetraFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 73, 220, 83, 0, "Uranium Tetrafluoride", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeLime, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
- ThoriumTetraFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 15, 120, 15, 0, "Thorium Tetrafluoride", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeGreen, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
-
- SulfurousAcid(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 110, 220, 30, 0, "Sulfurous Acid", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
- SulfurDioxide(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 150, 200, 50, 0, "Sulfur Dioxide", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
- HydrogenChloride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 150, 240, 90, 0, "Hydrogen Chloride", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
- SulfuricApatite(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Sulfuric Apatite Solution", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
-
- SulfuricLithium(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Sulfuric Lithium Solution", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
- LithiumHydroxide(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Lithium Hydroxide", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
-
- ;
-
-
-
-
- /**
- * List of all Materials.
- */
- public static final Collection<GT_Materials> VALUES = new HashSet<>(Arrays.asList(values()));
-
-
- static {
- /*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);*/
- Symbiotic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- Neutronic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- Quantum.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- }
-
-
- /**
- * 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 final TextureSet mIconSet;
- public final int mMetaItemSubID;
- public final boolean mUnificatable;
- public final GT_Materials mMaterialInto;
- public final List<MaterialStack> mMaterialList = new ArrayList<>();
- public final List<GT_Materials> mOreByProducts = new ArrayList<>(), mOreReRegistrations = new ArrayList<>();
- public final List<TC_AspectStack> mAspects = new ArrayList<>();
- private final ArrayList<ItemStack> mMaterialItems = new ArrayList<>();
- private final Collection<SubTag> mSubTags = new HashSet<>();
- public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null;
- public byte mEnchantmentToolsLevel = 0, mEnchantmentArmorsLevel = 0;
- public boolean mBlastFurnaceRequired = false;
- 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 GT_Materials mDirectSmelting = this, mOreReplacement = this, mMacerateInto = this, mSmeltInto = this, mArcSmeltInto = this, mHandleMaterial = this;
- public byte mToolQuality = 0;
- 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;
-
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, final int aToolDurability, final int aToolQuality, final boolean aUnificatable) {
- this.mUnificatable = aUnificatable;
- this.mMaterialInto = this;
- this.mMetaItemSubID = aMetaItemSubID;
- this.mToolQuality = (byte) aToolQuality;
- this.mDurability = aToolDurability;
- this.mToolSpeed = aToolSpeed;
- this.mIconSet = aIconSet;
- if (aMetaItemSubID >= 0) {
- if (CORE.sMU_GeneratedMaterials[aMetaItemSubID] == null) {
- CORE.sMU_GeneratedMaterials[aMetaItemSubID] = this;
- } else {
- throw new IllegalArgumentException("The Index " + aMetaItemSubID + " is already used!");
- }
- }
- }
-
- private GT_Materials(final GT_Materials aMaterialInto, final boolean aReRegisterIntoThis) {
- this.mUnificatable = false;
- this.mDefaultLocalName = aMaterialInto.mDefaultLocalName;
- this.mMaterialInto = aMaterialInto.mMaterialInto;
- if (aReRegisterIntoThis) {
- this.mMaterialInto.mOreReRegistrations.add(this);
- }
- this.mChemicalFormula = aMaterialInto.mChemicalFormula;
- this.mMetaItemSubID = -1;
- this.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 GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, final int aDensityDivider, final Dyes aColor) {
- this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true);
- this.mDefaultLocalName = aLocalName;
- this.mMeltingPoint = (short) aMeltingPoint;
- this.mBlastFurnaceTemp = (short) aBlastFurnaceTemp;
- this.mBlastFurnaceRequired = aBlastFurnaceRequired;
- if (aTransparent) {
- this.add(SubTag.TRANSPARENT);
- }
- this.mFuelPower = aFuelPower;
- this.mFuelType = aFuelType;
- this.mOreValue = aOreValue;
- this.mDensity = (M * aDensityMultiplier) / aDensityDivider;
- this.mColor = aColor == null ? Dyes._NULL : aColor;
- if (this.mColor != null) {
- this.add(SubTag.HAS_COLOR);
- }
- this.mRGBa[0] = this.mMoltenRGBa[0] = (short) aR;
- this.mRGBa[1] = this.mMoltenRGBa[1] = (short) aG;
- this.mRGBa[2] = this.mMoltenRGBa[2] = (short) aB;
- this.mRGBa[3] = this.mMoltenRGBa[3] = (short) aA;
- this.mTypes = aTypes;
- if ((this.mTypes & 2) != 0) {
- this.add(SubTag.SMELTING_TO_FLUID);
- }
- }
-
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, final int aDensityDivider, final Dyes aColor, final List<TC_AspectStack> aAspects) {
- this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
- this.mAspects.addAll(aAspects);
- }
-
- /**
- * @param aElement The Element Enum represented by this Material
- */
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, final int aDensityDivider, final Dyes aColor, final Element aElement, final List<TC_AspectStack> aAspects) {
- this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
- this.mElement = aElement;
- //mElement.mLinkedMaterials.add(this);
- if (aElement == Element._NULL) {
- this.mChemicalFormula = "Empty";
- } else {
- this.mChemicalFormula = aElement.toString();
- this.mChemicalFormula = this.mChemicalFormula.replaceAll("_", "-");
- }
- this.mAspects.addAll(aAspects);
- }
-
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, final int aDensityDivider, final Dyes aColor, final int aExtraData, final List<MaterialStack> 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 GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, final int aDensityDivider, final Dyes aColor, final int aExtraData, final List<MaterialStack> aMaterialList, final List<TC_AspectStack> aAspects) {
- this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
- this.mExtraData = aExtraData;
- this.mMaterialList.addAll(aMaterialList);
- this.mChemicalFormula = "";
- for (final MaterialStack tMaterial : this.mMaterialList) {
- this.mChemicalFormula += tMaterial.toString();
- }
- this.mChemicalFormula = this.mChemicalFormula.replaceAll("_", "-");
-
- int tAmountOfComponents = 0, tMeltingPoint = 0;
- for (final MaterialStack tMaterial : this.mMaterialList) {
- tAmountOfComponents += tMaterial.mAmount;
- if (tMaterial.mMaterial.mMeltingPoint > 0) {
- tMeltingPoint += tMaterial.mMaterial.mMeltingPoint * tMaterial.mAmount;
- }
- if (aAspects == null) {
- for (final TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) {
- tAspect.addToAspectList(this.mAspects);
- }
- }
- }
-
- if (this.mMeltingPoint < 0) {
- this.mMeltingPoint = (short) (tMeltingPoint / tAmountOfComponents);
- }
-
- tAmountOfComponents *= aDensityMultiplier;
- tAmountOfComponents /= aDensityDivider;
- if (aAspects == null) {
- for (final TC_AspectStack tAspect : this.mAspects) {
- tAspect.mAmount = Math.max(1, tAspect.mAmount / Math.max(1, tAmountOfComponents));
- }
- } else {
- this.mAspects.addAll(aAspects);
- }
- }
-
- public static GT_Materials get(final String aMaterialName) {
- final Object tObject = GT_Utility.getFieldContent(GT_Materials.class, aMaterialName, false, false);
- if ((tObject != null) && (tObject instanceof GT_Materials)) {
- return (GT_Materials) tObject;
- }
- return _NULL;
- }
-
- public static GT_Materials getRealMaterial(final String aMaterialName) {
- return get(aMaterialName).mMaterialInto;
- }
-
- /**
- * Called in preInit with the Config to set Values.
- *
- * @param aConfiguration
- */
- public static void init(final GT_Config aConfiguration) {
- for (final GT_Materials tMaterial : VALUES) {
- final 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, true);
- }
- 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 (this.mElement != null) {
- return this.mElement.mHalfLifeSeconds >= 0;
- }
- for (final MaterialStack tMaterial : this.mMaterialList) {
- if (tMaterial.mMaterial.isRadioactive()) {
- return true;
- }
- }
- return false;
- }
-
- public long getProtons() {
- if (this.mElement != null) {
- return this.mElement.getProtons();
- }
- if (this.mMaterialList.size() <= 0) {
- return Element.Tc.getProtons();
- }
- long rAmount = 0, tAmount = 0;
- for (final MaterialStack tMaterial : this.mMaterialList) {
- tAmount += tMaterial.mAmount;
- rAmount += tMaterial.mAmount * tMaterial.mMaterial.getProtons();
- }
- return (this.getDensity() * rAmount) / (tAmount * M);
- }
-
- public long getNeutrons() {
- if (this.mElement != null) {
- return this.mElement.getNeutrons();
- }
- if (this.mMaterialList.size() <= 0) {
- return Element.Tc.getNeutrons();
- }
- long rAmount = 0, tAmount = 0;
- for (final MaterialStack tMaterial : this.mMaterialList) {
- tAmount += tMaterial.mAmount;
- rAmount += tMaterial.mAmount * tMaterial.mMaterial.getNeutrons();
- }
- return (this.getDensity() * rAmount) / (tAmount * M);
- }
-
- public long getMass() {
- if (this.mElement != null) {
- return this.mElement.getMass();
- }
- if (this.mMaterialList.size() <= 0) {
- return Element.Tc.getMass();
- }
- long rAmount = 0, tAmount = 0;
- for (final MaterialStack tMaterial : this.mMaterialList) {
- tAmount += tMaterial.mAmount;
- rAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
- }
- return (this.getDensity() * rAmount) / (tAmount * M);
- }
-
- public long getDensity() {
- return this.mDensity;
- }
-
- public String getToolTip() {
- return this.getToolTip(1, false);
- }
-
- public String getToolTip(final boolean aShowQuestionMarks) {
- return this.getToolTip(1, aShowQuestionMarks);
- }
-
- public String getToolTip(final long aMultiplier) {
- return this.getToolTip(aMultiplier, false);
- }
-
- public String getToolTip(final long aMultiplier, final boolean aShowQuestionMarks) {
- if (!aShowQuestionMarks && this.mChemicalFormula.equals("?")) {
- return "";
- }
- if ((aMultiplier >= (M * 2)) && !this.mMaterialList.isEmpty()) {
- return (((this.mElement != null) || ((this.mMaterialList.size() < 2) && (this.mMaterialList.get(0).mAmount == 1))) ? this.mChemicalFormula : "(" + this.mChemicalFormula + ")") + aMultiplier;
- }
- return this.mChemicalFormula;
- }
-
- /**
- * Adds an ItemStack to this Material.
- */
- public GT_Materials add(final ItemStack aStack) {
- if ((aStack != null) && !this.contains(aStack)) {
- this.mMaterialItems.add(aStack);
- }
- return this;
- }
-
- /**
- * This is used to determine if any of the ItemStacks belongs to this Material.
- */
- public boolean contains(final ItemStack... aStacks) {
- if ((aStacks == null) || (aStacks.length <= 0)) {
- return false;
- }
- for (final ItemStack tStack : this.mMaterialItems) {
- for (final ItemStack aStack : aStacks) {
- if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * This is used to determine if an ItemStack belongs to this Material.
- */
- public boolean remove(final ItemStack aStack) {
- if (aStack == null) {
- return false;
- }
- boolean temp = false;
- for (int i = 0; i < this.mMaterialItems.size(); i++) {
- if (GT_Utility.areStacksEqual(aStack, this.mMaterialItems.get(i))) {
- this.mMaterialItems.remove(i--);
- temp = true;
- }
- }
- return temp;
- }
-
- /**
- * Adds a SubTag to this Material
- */
- @Override
- public ISubTagContainer add(final SubTag... aTags) {
- if (aTags != null) {
- for (final SubTag aTag : aTags) {
- if ((aTag != null) && !this.contains(aTag)) {
- aTag.addContainerToList(this);
- this.mSubTags.add(aTag);
- }
- }
- }
- return this;
- }
-
- /**
- * If this Material has this exact SubTag
- */
- @Override
- public boolean contains(final SubTag aTag) {
- return this.mSubTags.contains(aTag);
- }
-
- /**
- * Removes a SubTag from this Material
- */
- @Override
- public boolean remove(final SubTag aTag) {
- return this.mSubTags.remove(aTag);
- }
-
- /**
- * Sets the Heat Damage for this Material (negative = frost)
- */
- public GT_Materials setHeatDamage(final float aHeatDamage) {
- this.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 GT_Materials addOreByProduct(final GT_Materials aMaterial) {
- if (!this.mOreByProducts.contains(aMaterial.mMaterialInto)) {
- this.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 GT_Materials addOreByProducts(final GT_Materials... aMaterials) {
- for (final GT_Materials tMaterial : aMaterials) {
- if (tMaterial != null) {
- this.addOreByProduct(tMaterial);
- }
- }
- return this;
- }
-
- /**
- * If this Ore gives multiple drops of its Main Material.
- * Lapis Ore for example gives about 6 drops.
- */
- public GT_Materials setOreMultiplier(final int aOreMultiplier) {
- if (aOreMultiplier > 0) {
- this.mOreMultiplier = aOreMultiplier;
- }
- return this;
- }
-
- /**
- * If this Ore gives multiple drops of its Byproduct Material.
- */
- public GT_Materials setByProductMultiplier(final int aByProductMultiplier) {
- if (aByProductMultiplier > 0) {
- this.mByProductMultiplier = aByProductMultiplier;
- }
- return this;
- }
-
- /**
- * If this Ore gives multiple drops of its Main Material.
- * Lapis Ore for example gives about 6 drops.
- */
- public GT_Materials setSmeltingMultiplier(final int aSmeltingMultiplier) {
- if (aSmeltingMultiplier > 0) {
- this.mSmeltingMultiplier = aSmeltingMultiplier;
- }
- return this;
- }
-
- /**
- * This Ore should be smolten directly into an Ingot of this Material instead of an Ingot of itself.
- */
- public GT_Materials setDirectSmelting(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.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 GT_Materials setOreReplacement(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.mOreReplacement = aMaterial.mMaterialInto.mOreReplacement;
- }
- return this;
- }
-
- /**
- * This Material smelts always into an instance of aMaterial. Used for Magnets.
- */
- public GT_Materials setSmeltingInto(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.mSmeltInto = aMaterial.mMaterialInto.mSmeltInto;
- }
- return this;
- }
-
- /**
- * This Material arc smelts always into an instance of aMaterial. Used for Wrought Iron.
- */
- public GT_Materials setArcSmeltingInto(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.mArcSmeltInto = aMaterial.mMaterialInto.mArcSmeltInto;
- }
- return this;
- }
-
- /**
- * This Material macerates always into an instance of aMaterial.
- */
- public GT_Materials setMaceratingInto(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.mMacerateInto = aMaterial.mMaterialInto.mMacerateInto;
- }
- return this;
- }
-
- public GT_Materials setEnchantmentForTools(final Enchantment aEnchantment, final int aEnchantmentLevel) {
- this.mEnchantmentTools = aEnchantment;
- this.mEnchantmentToolsLevel = (byte) aEnchantmentLevel;
- return this;
- }
-
- public GT_Materials setEnchantmentForArmors(final Enchantment aEnchantment, final int aEnchantmentLevel) {
- this.mEnchantmentArmors = aEnchantment;
- this.mEnchantmentArmorsLevel = (byte) aEnchantmentLevel;
- return this;
- }
-
- public FluidStack getSolid(final long aAmount) {
- if (this.mSolid == null) {
- return null;
- }
- return new GT_FluidStack(this.mSolid, (int) aAmount);
- }
-
- public FluidStack getFluid(final long aAmount) {
- if (this.mFluid == null) {
- return null;
- }
- return new GT_FluidStack(this.mFluid, (int) aAmount);
- }
-
- public FluidStack getGas(final long aAmount) {
- if (this.mGas == null) {
- return null;
- }
- return new GT_FluidStack(this.mGas, (int) aAmount);
- }
-
- public FluidStack getPlasma(final long aAmount) {
- if (this.mPlasma == null) {
- return null;
- }
- return new GT_FluidStack(this.mPlasma, (int) aAmount);
- }
-
- public FluidStack getMolten(final long aAmount) {
- if (this.mStandardMoltenFluid == null) {
- return null;
- }
- return new GT_FluidStack(this.mStandardMoltenFluid, (int) aAmount);
- }
-
- @Override
- public short[] getRGBA() {
- return this.mRGBa;
- }
-
- public static volatile int VERSION = 508;
-
- }
-
-
-} \ No newline at end of file
+ /* 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)
+ */
+ ingotHot(
+ "Hot Ingots",
+ "Hot ",
+ " Ingot",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ B[1],
+ M * 1,
+ 16,
+ 12), // A hot Ingot, which has to be cooled down by a Vacuum Freezer.
+ ingot(
+ "Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64,
+ 11), // A regular Ingot. Introduced by Eloraam
+ dustTiny(
+ "Tiny Dusts",
+ "Tiny Pile of ",
+ " Dust",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ B[0] | B[1] | B[2] | B[3],
+ M / 9,
+ 64,
+ 0), // 1/9th of a Dust.
+ dustSmall(
+ "Small Dusts",
+ "Small Pile of ",
+ " Dust",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ B[0] | B[1] | B[2] | B[3],
+ M / 4,
+ 64,
+ 1), // 1/4th of a Dust.
+ dustImpure(
+ "Impure Dusts",
+ "Impure Pile of ",
+ " Dust",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ true,
+ 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",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ true,
+ B[3],
+ M * 1,
+ 64,
+ 2),
+ dustPure(
+ "Purified Dusts",
+ "Purified Pile of ",
+ " Dust",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ true,
+ B[3],
+ M * 1,
+ 64,
+ 4),
+ dust(
+ "Dusts",
+ "",
+ " Dust",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ 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", true, true, false, false, false, false, false, true, false, false, B[1], M / 9,
+ 64, 9), // A Nugget. Introduced by Eloraam
+ plate(
+ "Plates",
+ "",
+ " Plate",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[1] | B[2],
+ M * 1,
+ 64,
+ 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia
+ block(
+ "Storage Blocks",
+ "Block of ",
+ "",
+ true,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ false,
+ 0,
+ M * 9,
+ 64,
+ 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar
+ gem(
+ "Gemstones",
+ "",
+ "",
+ true,
+ true,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[2],
+ M * 1,
+ 64,
+ 8), // A regular Gem worth one Dust. Introduced by Eloraam
+ gemChipped(
+ "Chipped Gemstones",
+ "Chipped ",
+ "",
+ true,
+ true,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[2],
+ M / 4,
+ 64,
+ 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft
+ gemFlawed(
+ "Flawed Gemstones",
+ "Flawed ",
+ "",
+ true,
+ true,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[2],
+ M / 2,
+ 64,
+ 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft
+ gemFlawless(
+ "Flawless Gemstones",
+ "Flawless ",
+ "",
+ true,
+ true,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[2],
+ M * 2,
+ 32,
+ 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft
+ gemExquisite(
+ "Exquisite Gemstones",
+ "Exquisite ",
+ "",
+ true,
+ true,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[2],
+ M * 4,
+ 16,
+ 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft
+ stick(
+ "Sticks/Rods",
+ "",
+ " Rod",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[1] | B[2],
+ M / 2,
+ 64,
+ 23), // Stick made of half an Ingot. Introduced by Eloraam
+ type2(
+ "16x Wires",
+ "16x ",
+ " Wire",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ 0,
+ M * 8,
+ 64,
+ -1),
+
+ toolSkookumChoocher(
+ "Skookum Choocher",
+ "",
+ " Skookum Choocher",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[6],
+ M * 6,
+ 16,
+ 37), // consisting out of 6 Ingots.
+ toolAngleGrinder(
+ "Angle Grinder",
+ "",
+ "Angle Grinder",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[6],
+ M * 6,
+ 16,
+ 37), // consisting out of 6 Ingots.
+ toolElectricSnips(
+ "Electric Snips",
+ "",
+ "Electric Snips",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[6],
+ M * 6,
+ 16,
+ 37), // consisting out of 6 Ingots.
+ toolElectricLighter(
+ "Electric Lighter",
+ "",
+ "Electric Lighter",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[6],
+ M * 6,
+ 16,
+ 37), // consisting out of 6 Ingots.
+ toolElectricButcherKnife(
+ "Electric Butcher Knife",
+ "",
+ "Electric Butcher Knife",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false,
+ B[6],
+ M * 6,
+ 16,
+ 37), // consisting out of 6 Ingots.
+
+ batterySingleuse(
+ "Single Use Batteries",
+ "",
+ "",
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ 0,
+ -1,
+ 64,
+ -1),
+ battery(
+ "Reusable Batteries",
+ "",
+ "",
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ 0,
+ -1,
+ 64,
+ -1), // Introduced by Calclavia
+ circuit(
+ "Circuits",
+ "",
+ "",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ 0,
+ -1,
+ 64,
+ -1), // Introduced by Calclavia
+ chipset(
+ "Chipsets",
+ "",
+ "",
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ 0,
+ -1,
+ 64,
+ -1), // Introduced by Buildcraft
+ computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1),
+ ; // A whole Computer. "computerMaster" = ComputerCube
+
+ public static volatile int VERSION = 508;
+
+ static {
+ ingotHot.mHeatDamage = 3.0F;
+ }
+
+ public final ArrayList<ItemStack> mPrefixedItems = new ArrayList<>();
+ public final short mTextureIndex;
+ public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost;
+ public final boolean mIsUsedForOreProcessing,
+ mIsEnchantable,
+ mIsUnificatable,
+ mIsMaterialBased,
+ mIsSelfReferencing,
+ mIsContainer,
+ mDontUnificateActively,
+ mIsUsedForBlocks,
+ mAllowNormalRecycling,
+ mGenerateDefaultItem;
+ public final List<TC_AspectStack> mAspects = new ArrayList<>();
+ public final Collection<GregtechOrePrefixes> mFamiliarPrefixes = new HashSet<>();
+ /**
+ * 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;
+
+ private final Collection<Materials> mNotGeneratedItems = new HashSet<>(),
+ mIgnoredMaterials = new HashSet<>(),
+ mGeneratedItems = new HashSet<>();
+ private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessing = new ArrayList<>();
+ private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessingFake = new ArrayList<>();
+ public ItemStack mContainerItem = null;
+ public ICondition<ISubTagContainer> mCondition = null;
+ public byte mDefaultStackSize = 64;
+ public GregtechMaterialStack mSecondaryMaterial = null;
+ public GregtechOrePrefixes mPrefixInto = this;
+ public float mHeatDamage = 0.0F; // Negative for Frost Damage
+ /**
+ * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check.
+ */
+ public int mMaterialGenerationBits = 0;
+
+ private GregtechOrePrefixes(
+ final String aRegularLocalName,
+ final String aLocalizedMaterialPre,
+ final String aLocalizedMaterialPost,
+ final boolean aIsUnificatable,
+ final boolean aIsMaterialBased,
+ final boolean aIsSelfReferencing,
+ final boolean aIsContainer,
+ final boolean aDontUnificateActively,
+ final boolean aIsUsedForBlocks,
+ final boolean aAllowNormalRecycling,
+ final boolean aGenerateDefaultItem,
+ final boolean aIsEnchantable,
+ final boolean aIsUsedForOreProcessing,
+ final int aMaterialGenerationBits,
+ final long aMaterialAmount,
+ final int aDefaultStackSize,
+ final int aTextureindex) {
+ this.mIsUnificatable = aIsUnificatable;
+ this.mIsMaterialBased = aIsMaterialBased;
+ this.mIsSelfReferencing = aIsSelfReferencing;
+ this.mIsContainer = aIsContainer;
+ this.mDontUnificateActively = aDontUnificateActively;
+ this.mIsUsedForBlocks = aIsUsedForBlocks;
+ this.mAllowNormalRecycling = aAllowNormalRecycling;
+ this.mGenerateDefaultItem = aGenerateDefaultItem;
+ this.mIsEnchantable = aIsEnchantable;
+ this.mIsUsedForOreProcessing = aIsUsedForOreProcessing;
+ this.mMaterialGenerationBits = aMaterialGenerationBits;
+ this.mMaterialAmount = aMaterialAmount;
+ this.mRegularLocalName = aRegularLocalName;
+ this.mLocalizedMaterialPre = aLocalizedMaterialPre;
+ this.mLocalizedMaterialPost = aLocalizedMaterialPost;
+ this.mDefaultStackSize = (byte) aDefaultStackSize;
+ this.mTextureIndex = (short) aTextureindex;
+
+ // TODO - Utilise some form of way to check if it's gt 5.9 if so, use string switch.
+ if (this.name().startsWith("ore")) {
+ getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("wire") || this.name().startsWith("cable")) {
+ getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("dust")) {
+ getTcAspectStack(TC_Aspects.PERDITIO.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("crushed")) {
+ getTcAspectStack(TC_Aspects.PERFODIO.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("ingot") || this.name().startsWith("nugget")) {
+ getTcAspectStack(TC_Aspects.METALLUM.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("armor")) {
+ getTcAspectStack(TC_Aspects.TUTAMEN.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("stone")) {
+ getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("pipe")) {
+ getTcAspectStack(TC_Aspects.ITER.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("gear")) {
+ getTcAspectStack(TC_Aspects.MOTUS.name(), 1).addToAspectList(this.mAspects);
+ getTcAspectStack(TC_Aspects.MACHINA.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("frame") || this.name().startsWith("plate")) {
+ getTcAspectStack(TC_Aspects.FABRICO.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("tool")) {
+ getTcAspectStack(TC_Aspects.INSTRUMENTUM.name(), 2).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("gem")
+ || this.name().startsWith("crystal")
+ || this.name().startsWith("lens")) {
+ getTcAspectStack(TC_Aspects.VITREUS.name(), 1).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("crate")) {
+ getTcAspectStack(TC_Aspects.ITER.name(), 2).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("circuit")) {
+ getTcAspectStack("COGNITIO", 1);
+ } else if (this.name().startsWith("computer")) {
+ getTcAspectStack("COGNITIO", 4).addToAspectList(this.mAspects);
+ } else if (this.name().startsWith("battery")) {
+ getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(this.mAspects);
+ }
+ }
+
+ public static GregtechOrePrefixes getOrePrefix(final String aOre) {
+ for (final GregtechOrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return tPrefix;
+ }
+ }
+ return null;
+ }
+
+ public static String stripPrefix(final String aOre) {
+ for (final GregtechOrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), "");
+ }
+ }
+ return aOre;
+ }
+
+ public static String replacePrefix(final String aOre, final GregtechOrePrefixes aPrefix) {
+ for (final GregtechOrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString());
+ }
+ }
+ return "";
+ }
+
+ public static GregtechOrePrefixes getPrefix(final String aPrefixName) {
+ return getPrefix(aPrefixName, null);
+ }
+
+ public static GregtechOrePrefixes getPrefix(final String aPrefixName, final GregtechOrePrefixes aReplacement) {
+ final Object tObject = GT_Utility.getFieldContent(GregtechOrePrefixes.class, aPrefixName, false, false);
+ if ((tObject != null) && (tObject instanceof GregtechOrePrefixes)) {
+ return (GregtechOrePrefixes) tObject;
+ }
+ return aReplacement;
+ }
+
+ public static Materials getMaterial(final String aOre) {
+ return Materials.get(stripPrefix(aOre));
+ }
+
+ public static Materials getMaterial(final String aOre, final GregtechOrePrefixes aPrefix) {
+ return Materials.get(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public static Materials getRealMaterial(final String aOre, final GregtechOrePrefixes aPrefix) {
+ return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public static boolean isInstanceOf(final String aName, final GregtechOrePrefixes aPrefix) {
+ return aName == null ? false : aName.startsWith(aPrefix.toString());
+ }
+
+ public boolean add(final ItemStack aStack) {
+ if (aStack == null) {
+ return false;
+ }
+ if (!this.contains(aStack)) {
+ this.mPrefixedItems.add(aStack);
+ }
+ while (this.mPrefixedItems.contains(null)) {
+ this.mPrefixedItems.remove(null);
+ }
+ return true;
+ }
+
+ public boolean contains(final ItemStack aStack) {
+ if (aStack == null) {
+ return false;
+ }
+ for (final ItemStack tStack : this.mPrefixedItems) {
+ if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean doGenerateItem(final Materials aMaterial) {
+ return (aMaterial != null)
+ && (aMaterial != Materials._NULL)
+ && (((aMaterial.mTypes & this.mMaterialGenerationBits) != 0)
+ || this.mGeneratedItems.contains(aMaterial))
+ && !this.mNotGeneratedItems.contains(aMaterial)
+ && ((this.mCondition == null) || this.mCondition.isTrue(aMaterial));
+ }
+
+ public boolean ignoreMaterials(final Materials... aMaterials) {
+ for (final Materials tMaterial : aMaterials) {
+ if (tMaterial != null) {
+ this.mIgnoredMaterials.add(tMaterial);
+ }
+ }
+ return true;
+ }
+
+ public boolean addFamiliarPrefix(final GregtechOrePrefixes aPrefix) {
+ if ((aPrefix == null) || this.mFamiliarPrefixes.contains(aPrefix) || (aPrefix == this)) {
+ return false;
+ }
+ return this.mFamiliarPrefixes.add(aPrefix);
+ }
+
+ public boolean add(final Interface_OreRecipeRegistrator aRegistrator) {
+ if (aRegistrator == null) {
+ return false;
+ }
+ return this.mOreProcessing.add(aRegistrator);
+ }
+
+ public void processOre(
+ final GT_Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) {
+ if ((aMaterial != null)
+ && ((aMaterial != GT_Materials._NULL) || this.mIsSelfReferencing || !this.mIsMaterialBased)
+ && GT_Utility.isStackValid(aStack)) {
+ for (final Interface_OreRecipeRegistrator tRegistrator : this.mOreProcessing) {
+ if (D2) {
+ GT_Log.ore.println(
+ "Processing '" + aOreDictName + "' with the Prefix '" + this.name() + "' and the Material '"
+ + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator));
+ }
+ tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
+ }
+ }
+ }
+
+ // TODO
+ public void processOre(
+ final Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) {
+ if ((aMaterial != null)
+ && ((aMaterial != Materials._NULL) || this.mIsSelfReferencing || !this.mIsMaterialBased)
+ && GT_Utility.isStackValid(aStack)) {
+ for (final Interface_OreRecipeRegistrator tRegistrator : this.mOreProcessingFake) {
+ if (D2) {
+ GT_Log.ore.println(
+ "Processing '" + aOreDictName + "' with the Prefix '" + this.name() + "' and the Material '"
+ + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator));
+ }
+ tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
+ }
+ }
+ }
+
+ public Object get(final Object aMaterial) {
+ if (aMaterial instanceof GT_Materials) {
+ return new GregtechItemData(this, (GT_Materials) aMaterial);
+ }
+ return this.name() + aMaterial;
+ }
+
+ public String getDefaultLocalNameForItem(final Materials aMaterial) {
+
+ // Use Standard Localization
+ return this.mLocalizedMaterialPre + aMaterial.mDefaultLocalName + this.mLocalizedMaterialPost;
+ }
+
+ public enum GT_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.
+ * <p/>
+ * Mainly for preventing NullPointer Exceptions and providing Default Values.
+ *
+ * Unknown Material Components. Dead End Section.
+ *
+ * Alkalus Range 730-799 & 970-998
+ * (aMetaItemSubID, TextureSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, R, G, B, Alpha, aLocalName,
+ * aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor
+ * this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true);
+ *
+ */
+ _NULL(
+ -1,
+ TextureSet.SET_NONE,
+ 1.0F,
+ 0,
+ 0,
+ 0,
+ 255,
+ 255,
+ 255,
+ 0,
+ "NULL",
+ 0,
+ 0,
+ 0,
+ 0,
+ false,
+ false,
+ 1,
+ 1,
+ 1,
+ Dyes._NULL,
+ Element._NULL,
+ Arrays.asList(getTcAspectStack(TC_Aspects.VACUOS.name(), 1))),
+
+ // Lapis(526, TextureSet.SET_LAPIS, 1.0F, 0, 1, 1 | 4 | 8, 70, 70, 220, 0, "Lapis", 0, 0, -1, 0, false, false,
+ // 3, 1, 1, Dyes.dyeBlue, 2, Arrays.asList(new MaterialStack(Materials.Lazurite, 12), new
+ // MaterialStack(Materials.Sodalite, 2), new MaterialStack(Materials.Pyrite, 1), new
+ // MaterialStack(Materials.Calcite, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.SENSUS, 1))),
+ Pyrotheum(
+ 20,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 255,
+ 128,
+ 0,
+ 0,
+ "Pyrotheum",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeYellow,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1)),
+ Arrays.asList(getTcAspectStack("PRAECANTATIO", 2), getTcAspectStack(TC_Aspects.IGNIS, 1))),
+ Cryotheum(
+ 21,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 102,
+ 178,
+ 255,
+ 0,
+ "Cryotheum",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Blizz, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Snow, 1),
+ new MaterialStack(Materials.Niter, 1)),
+ Arrays.asList(getTcAspectStack("PRAECANTATIO", 2), getTcAspectStack(TC_Aspects.GELUM, 1))),
+ Ender(
+ 22,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 2,
+ 1,
+ 255,
+ 255,
+ 255,
+ 0,
+ "Ender",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 3,
+ 1,
+ 1,
+ Dyes.dyeGreen),
+
+ /**
+ * Circuitry, Batteries and other Technical things
+ */
+ Symbiotic(
+ -1,
+ TextureSet.SET_NONE,
+ 1.0F,
+ 0,
+ 0,
+ 0,
+ 255,
+ 255,
+ 255,
+ 0,
+ "IV Tier",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 1,
+ 1,
+ 1,
+ Dyes.dyeLightGray,
+ Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 4), getTcAspectStack(TC_Aspects.MACHINA, 4))),
+ Neutronic(
+ -1,
+ TextureSet.SET_NONE,
+ 1.0F,
+ 0,
+ 0,
+ 0,
+ 255,
+ 255,
+ 255,
+ 0,
+ "LuV Tier",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 1,
+ 1,
+ 1,
+ Dyes.dyeLightGray,
+ Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 6), getTcAspectStack(TC_Aspects.MACHINA, 6))),
+ Quantum(
+ -1,
+ TextureSet.SET_NONE,
+ 1.0F,
+ 0,
+ 0,
+ 0,
+ 255,
+ 255,
+ 255,
+ 0,
+ "ZPM Tier",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 1,
+ 1,
+ 1,
+ Dyes.dyeLightGray,
+ Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 8), getTcAspectStack(TC_Aspects.MACHINA, 8))),
+
+ Superconductor(
+ -1,
+ TextureSet.SET_NONE,
+ 1.0F,
+ 0,
+ 0,
+ 0,
+ 190,
+ 240,
+ 190,
+ 0,
+ "Superconductor",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 1,
+ 1,
+ 1,
+ Dyes.dyeGreen,
+ Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 8))),
+
+ Staballoy(
+ 30,
+ TextureSet.SET_ROUGH,
+ 10.0F,
+ 5120,
+ 4,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 68,
+ 75,
+ 66,
+ 0,
+ "Staballoy",
+ 0,
+ 0,
+ 1500,
+ 2800,
+ true,
+ false,
+ 1,
+ 3,
+ 1,
+ Dyes.dyeGreen,
+ 2,
+ Arrays.asList(new MaterialStack(Materials.Titanium, 1), new MaterialStack(Materials.Uranium, 9)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ Bedrockium(
+ 31,
+ TextureSet.SET_FINE,
+ 8.0F,
+ 8196,
+ 3,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 39,
+ 39,
+ 39,
+ 0,
+ "Bedrockium",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 1,
+ 5,
+ 1,
+ Dyes.dyeLightGray,
+ 2,
+ Arrays.asList(new MaterialStack(Materials.Carbon, 63), new MaterialStack(Materials.Carbon, 56)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.VACUOS, 8), getTcAspectStack(TC_Aspects.TUTAMEN, 3))),
+ BloodSteel(
+ 32,
+ TextureSet.SET_METALLIC,
+ 11.0F,
+ 768,
+ 4,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 142,
+ 28,
+ 0,
+ 0,
+ "Blood Steel",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 1,
+ 1,
+ 1,
+ Dyes.dyeRed,
+ 2,
+ Arrays.asList(new MaterialStack(Materials.Steel, 3)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.VICTUS, 8), getTcAspectStack(TC_Aspects.IGNIS, 3))),
+ Void(
+ 33,
+ TextureSet.SET_METALLIC,
+ 6.0F,
+ 1280,
+ 3,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 82,
+ 17,
+ 82,
+ 0,
+ "Void Metal",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 3,
+ 1,
+ 1,
+ Dyes.dyeBlack,
+ Arrays.asList(getTcAspectStack("PRAECANTATIO", 5), getTcAspectStack(TC_Aspects.VACUOS, 7))),
+ ConductiveIron(
+ 34,
+ TextureSet.SET_METALLIC,
+ 5.0F,
+ 256,
+ 2,
+ 1 | 2,
+ 164,
+ 109,
+ 100,
+ 0,
+ "Conductive Iron",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 3,
+ 1,
+ 1,
+ Dyes.dyeRed,
+ 2,
+ Arrays.asList(new MaterialStack(Materials.Iron, 6), new MaterialStack(Materials.Redstone, 2)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.POTENTIA, 2), getTcAspectStack(TC_Aspects.METALLUM, 2))),
+ ElectricalSteel(
+ 35,
+ TextureSet.SET_METALLIC,
+ 7.0F,
+ 768,
+ 3,
+ 1 | 2 | 64 | 128,
+ 194,
+ 194,
+ 194,
+ 0,
+ "Electrical Steel",
+ 0,
+ 0,
+ 1811,
+ 1000,
+ true,
+ false,
+ 3,
+ 1,
+ 1,
+ Dyes.dyeLightGray,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Iron, 3),
+ new MaterialStack(Materials.Coal, 2),
+ new MaterialStack(Materials.Silicon, 2)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.MAGNETO, 2), getTcAspectStack(TC_Aspects.ELECTRUM, 5))),
+ EnergeticAlloy(
+ 36,
+ TextureSet.SET_SHINY,
+ 5.0F,
+ 512,
+ 3,
+ 1 | 2 | 64 | 128,
+ 252,
+ 152,
+ 45,
+ 0,
+ "Energetic Alloy",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 3,
+ 1,
+ 1,
+ Dyes.dyeOrange,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Gold, 3),
+ new MaterialStack(Materials.Glowstone, 2),
+ new MaterialStack(Materials.Redstone, 2)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.POTENTIA, 4), getTcAspectStack(TC_Aspects.LUX, 3))),
+ VibrantAlloy(
+ 37,
+ TextureSet.SET_SHINY,
+ 7.0F,
+ 1280,
+ 4,
+ 1 | 2 | 64 | 128,
+ 204,
+ 242,
+ 142,
+ 0,
+ "Vibrant Alloy",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 3,
+ 1,
+ 1,
+ Dyes.dyeLime,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.EnergeticAlloy, 1), new MaterialStack(Materials.EnderPearl, 3)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.MACHINA, 5), getTcAspectStack(TC_Aspects.TELUM, 4))),
+ PulsatingIron(
+ 38,
+ TextureSet.SET_SHINY,
+ 5.0F,
+ 256,
+ 2,
+ 1 | 2 | 64 | 128,
+ 50,
+ 91,
+ 21,
+ 0,
+ "Pulsating Iron",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 3,
+ 1,
+ 1,
+ Dyes.dyeGreen,
+ 2,
+ Arrays.asList(new MaterialStack(Materials.Iron, 2), new MaterialStack(Materials.EnderPearl, 2)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.ALIENIS, 3), getTcAspectStack(TC_Aspects.METALLUM, 3))),
+ /* TODO*/ RedstoneAlloy(
+ 39,
+ TextureSet.SET_METALLIC,
+ 1.0F,
+ 256,
+ 2,
+ 1 | 2 | 16 | 32 | 64,
+ 178,
+ 34,
+ 34,
+ 0,
+ "Redstone Alloy",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 3,
+ 1,
+ 1,
+ Dyes.dyeRed,
+ 2,
+ Arrays.asList(new MaterialStack(Materials.Iron, 2), new MaterialStack(Materials.Redstone, 4))),
+
+ // Needs more Use, I think.
+ Tantalloy60(
+ 40,
+ TextureSet.SET_DULL,
+ 8.0F,
+ 5120,
+ 3,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 68,
+ 75,
+ 166,
+ 0,
+ "Tantalloy-60",
+ 0,
+ 0,
+ 3035,
+ 2200,
+ true,
+ false,
+ 1,
+ 2,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ Tantalloy61(
+ 41,
+ TextureSet.SET_DULL,
+ 7.0F,
+ 5120,
+ 2,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 122,
+ 135,
+ 196,
+ 0,
+ "Tantalloy-61",
+ 0,
+ 0,
+ 3015,
+ 2150,
+ true,
+ false,
+ 1,
+ 2,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Tungsten, 1),
+ new MaterialStack(Materials.Tantalum, 9),
+ new MaterialStack(Materials.Titanium, 1)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+
+ Potin(
+ 42,
+ TextureSet.SET_METALLIC,
+ 7.0F,
+ 5120,
+ 2,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 201,
+ 151,
+ 129,
+ 0,
+ "Potin",
+ 0,
+ 0,
+ 3015,
+ 2150,
+ true,
+ false,
+ 1,
+ 2,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Tungsten, 1),
+ new MaterialStack(Materials.Tantalum, 9),
+ new MaterialStack(Materials.Titanium, 1)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ Inconel792(
+ 43,
+ TextureSet.SET_METALLIC,
+ 7.0F,
+ 5120,
+ 2,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 108,
+ 240,
+ 118,
+ 0,
+ "Inconel-792",
+ 0,
+ 0,
+ 3015,
+ 2150,
+ true,
+ false,
+ 1,
+ 2,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Tungsten, 1),
+ new MaterialStack(Materials.Tantalum, 9),
+ new MaterialStack(Materials.Titanium, 1)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ Inconel690(
+ 44,
+ TextureSet.SET_DULL,
+ 7.0F,
+ 5120,
+ 2,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 118,
+ 220,
+ 138,
+ 0,
+ "Inconel-690",
+ 0,
+ 0,
+ 3015,
+ 2150,
+ true,
+ false,
+ 1,
+ 2,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Tungsten, 1),
+ new MaterialStack(Materials.Tantalum, 9),
+ new MaterialStack(Materials.Titanium, 1)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ MaragingSteel300(
+ 45,
+ TextureSet.SET_METALLIC,
+ 7.0F,
+ 5120,
+ 2,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 150,
+ 150,
+ 150,
+ 0,
+ "Maraging Steel 300",
+ 0,
+ 0,
+ 3015,
+ 2150,
+ true,
+ false,
+ 1,
+ 2,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Tungsten, 1),
+ new MaterialStack(Materials.Tantalum, 9),
+ new MaterialStack(Materials.Titanium, 1)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ MaragingSteel350(
+ 46,
+ TextureSet.SET_METALLIC,
+ 7.0F,
+ 5120,
+ 2,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 160,
+ 160,
+ 160,
+ 0,
+ "Maraging Steel 350",
+ 0,
+ 0,
+ 3015,
+ 2150,
+ true,
+ false,
+ 1,
+ 2,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Tungsten, 1),
+ new MaterialStack(Materials.Tantalum, 9),
+ new MaterialStack(Materials.Titanium, 1)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ HastelloyX(
+ 47,
+ TextureSet.SET_SHINY,
+ 7.0F,
+ 5120,
+ 2,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 255,
+ 193,
+ 37,
+ 0,
+ "Hastelloy-X",
+ 0,
+ 0,
+ 3015,
+ 2150,
+ true,
+ false,
+ 1,
+ 2,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Tungsten, 1),
+ new MaterialStack(Materials.Tantalum, 9),
+ new MaterialStack(Materials.Titanium, 1)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+
+ TriniumNaquadahCarbonite(
+ 48,
+ TextureSet.SET_SHINY,
+ 7.0F,
+ 5120,
+ 2,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 255,
+ 233,
+ 0,
+ 0,
+ "Trinium Naquadah Carbonite",
+ 0,
+ 0,
+ 3015,
+ 2150,
+ true,
+ false,
+ 1,
+ 2,
+ 1,
+ Dyes.dyeLightBlue,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Tungsten, 1),
+ new MaterialStack(Materials.Tantalum, 9),
+ new MaterialStack(Materials.Titanium, 1)),
+ Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+
+ // Radioactive Materials
+ HydrofluoricAcid(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 200,
+ 200,
+ 200,
+ 0,
+ "Hydrofluoric Acid",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeWhite,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+ UraniumHexaFluoride(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 73,
+ 220,
+ 83,
+ 0,
+ "Uranium Hexafluoride",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeLime,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+ UraniumTetraFluoride(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 73,
+ 220,
+ 83,
+ 0,
+ "Uranium Tetrafluoride",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeLime,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+ ThoriumTetraFluoride(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 15,
+ 120,
+ 15,
+ 0,
+ "Thorium Tetrafluoride",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeGreen,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+
+ SulfurousAcid(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 110,
+ 220,
+ 30,
+ 0,
+ "Sulfurous Acid",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeWhite,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+ SulfurDioxide(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 150,
+ 200,
+ 50,
+ 0,
+ "Sulfur Dioxide",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeWhite,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+ HydrogenChloride(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 150,
+ 240,
+ 90,
+ 0,
+ "Hydrogen Chloride",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeWhite,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+ SulfuricApatite(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 0,
+ 105,
+ 105,
+ 0,
+ "Sulfuric Apatite Solution",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeWhite,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+
+ SulfuricLithium(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 0,
+ 105,
+ 105,
+ 0,
+ "Sulfuric Lithium Solution",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeWhite,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+ LithiumHydroxide(
+ -1,
+ TextureSet.SET_FLUID,
+ 1.0F,
+ 0,
+ 1,
+ 2 | 16 | 32,
+ 0,
+ 105,
+ 105,
+ 0,
+ "Lithium Hydroxide",
+ 0,
+ 0,
+ -1,
+ 0,
+ false,
+ false,
+ 2,
+ 3,
+ 1,
+ Dyes.dyeWhite,
+ 2,
+ Arrays.asList(
+ new MaterialStack(Materials.Coal, 1),
+ new MaterialStack(Materials.Redstone, 1),
+ new MaterialStack(Materials.Blaze, 1),
+ new MaterialStack(Materials.Sulfur, 1))),
+ ;
+
+ /**
+ * List of all Materials.
+ */
+ public static final Collection<GT_Materials> VALUES = new HashSet<>(Arrays.asList(values()));
+
+ static {
+ /*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);*/
+ Symbiotic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Neutronic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Quantum.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ }
+
+ /**
+ * 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 final TextureSet mIconSet;
+ public final int mMetaItemSubID;
+ public final boolean mUnificatable;
+ public final GT_Materials mMaterialInto;
+ public final List<MaterialStack> mMaterialList = new ArrayList<>();
+ public final List<GT_Materials> mOreByProducts = new ArrayList<>(), mOreReRegistrations = new ArrayList<>();
+ public final List<TC_AspectStack> mAspects = new ArrayList<>();
+ private final ArrayList<ItemStack> mMaterialItems = new ArrayList<>();
+ private final Collection<SubTag> mSubTags = new HashSet<>();
+ public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null;
+ public byte mEnchantmentToolsLevel = 0, mEnchantmentArmorsLevel = 0;
+ public boolean mBlastFurnaceRequired = false;
+ 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 GT_Materials mDirectSmelting = this,
+ mOreReplacement = this,
+ mMacerateInto = this,
+ mSmeltInto = this,
+ mArcSmeltInto = this,
+ mHandleMaterial = this;
+ public byte mToolQuality = 0;
+ 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;
+
+ private GT_Materials(
+ final int aMetaItemSubID,
+ final TextureSet aIconSet,
+ final float aToolSpeed,
+ final int aToolDurability,
+ final int aToolQuality,
+ final boolean aUnificatable) {
+ this.mUnificatable = aUnificatable;
+ this.mMaterialInto = this;
+ this.mMetaItemSubID = aMetaItemSubID;
+ this.mToolQuality = (byte) aToolQuality;
+ this.mDurability = aToolDurability;
+ this.mToolSpeed = aToolSpeed;
+ this.mIconSet = aIconSet;
+ if (aMetaItemSubID >= 0) {
+ if (CORE.sMU_GeneratedMaterials[aMetaItemSubID] == null) {
+ CORE.sMU_GeneratedMaterials[aMetaItemSubID] = this;
+ } else {
+ throw new IllegalArgumentException("The Index " + aMetaItemSubID + " is already used!");
+ }
+ }
+ }
+
+ private GT_Materials(final GT_Materials aMaterialInto, final boolean aReRegisterIntoThis) {
+ this.mUnificatable = false;
+ this.mDefaultLocalName = aMaterialInto.mDefaultLocalName;
+ this.mMaterialInto = aMaterialInto.mMaterialInto;
+ if (aReRegisterIntoThis) {
+ this.mMaterialInto.mOreReRegistrations.add(this);
+ }
+ this.mChemicalFormula = aMaterialInto.mChemicalFormula;
+ this.mMetaItemSubID = -1;
+ this.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 GT_Materials(
+ final int aMetaItemSubID,
+ final TextureSet aIconSet,
+ final float aToolSpeed,
+ final int aToolDurability,
+ final int aToolQuality,
+ final int aTypes,
+ final int aR,
+ final int aG,
+ final int aB,
+ final int aA,
+ final String aLocalName,
+ final int aFuelType,
+ final int aFuelPower,
+ final int aMeltingPoint,
+ final int aBlastFurnaceTemp,
+ final boolean aBlastFurnaceRequired,
+ final boolean aTransparent,
+ final int aOreValue,
+ final int aDensityMultiplier,
+ final int aDensityDivider,
+ final Dyes aColor) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true);
+ this.mDefaultLocalName = aLocalName;
+ this.mMeltingPoint = (short) aMeltingPoint;
+ this.mBlastFurnaceTemp = (short) aBlastFurnaceTemp;
+ this.mBlastFurnaceRequired = aBlastFurnaceRequired;
+ if (aTransparent) {
+ this.add(SubTag.TRANSPARENT);
+ }
+ this.mFuelPower = aFuelPower;
+ this.mFuelType = aFuelType;
+ this.mOreValue = aOreValue;
+ this.mDensity = (M * aDensityMultiplier) / aDensityDivider;
+ this.mColor = aColor == null ? Dyes._NULL : aColor;
+ if (this.mColor != null) {
+ this.add(SubTag.HAS_COLOR);
+ }
+ this.mRGBa[0] = this.mMoltenRGBa[0] = (short) aR;
+ this.mRGBa[1] = this.mMoltenRGBa[1] = (short) aG;
+ this.mRGBa[2] = this.mMoltenRGBa[2] = (short) aB;
+ this.mRGBa[3] = this.mMoltenRGBa[3] = (short) aA;
+ this.mTypes = aTypes;
+ if ((this.mTypes & 2) != 0) {
+ this.add(SubTag.SMELTING_TO_FLUID);
+ }
+ }
+
+ private GT_Materials(
+ final int aMetaItemSubID,
+ final TextureSet aIconSet,
+ final float aToolSpeed,
+ final int aToolDurability,
+ final int aToolQuality,
+ final int aTypes,
+ final int aR,
+ final int aG,
+ final int aB,
+ final int aA,
+ final String aLocalName,
+ final int aFuelType,
+ final int aFuelPower,
+ final int aMeltingPoint,
+ final int aBlastFurnaceTemp,
+ final boolean aBlastFurnaceRequired,
+ final boolean aTransparent,
+ final int aOreValue,
+ final int aDensityMultiplier,
+ final int aDensityDivider,
+ final Dyes aColor,
+ final List<TC_AspectStack> aAspects) {
+ this(
+ aMetaItemSubID,
+ aIconSet,
+ aToolSpeed,
+ aToolDurability,
+ aToolQuality,
+ aTypes,
+ aR,
+ aG,
+ aB,
+ aA,
+ aLocalName,
+ aFuelType,
+ aFuelPower,
+ aMeltingPoint,
+ aBlastFurnaceTemp,
+ aBlastFurnaceRequired,
+ aTransparent,
+ aOreValue,
+ aDensityMultiplier,
+ aDensityDivider,
+ aColor);
+ this.mAspects.addAll(aAspects);
+ }
+
+ /**
+ * @param aElement The Element Enum represented by this Material
+ */
+ private GT_Materials(
+ final int aMetaItemSubID,
+ final TextureSet aIconSet,
+ final float aToolSpeed,
+ final int aToolDurability,
+ final int aToolQuality,
+ final int aTypes,
+ final int aR,
+ final int aG,
+ final int aB,
+ final int aA,
+ final String aLocalName,
+ final int aFuelType,
+ final int aFuelPower,
+ final int aMeltingPoint,
+ final int aBlastFurnaceTemp,
+ final boolean aBlastFurnaceRequired,
+ final boolean aTransparent,
+ final int aOreValue,
+ final int aDensityMultiplier,
+ final int aDensityDivider,
+ final Dyes aColor,
+ final Element aElement,
+ final List<TC_AspectStack> aAspects) {
+ this(
+ aMetaItemSubID,
+ aIconSet,
+ aToolSpeed,
+ aToolDurability,
+ aToolQuality,
+ aTypes,
+ aR,
+ aG,
+ aB,
+ aA,
+ aLocalName,
+ aFuelType,
+ aFuelPower,
+ aMeltingPoint,
+ aBlastFurnaceTemp,
+ aBlastFurnaceRequired,
+ aTransparent,
+ aOreValue,
+ aDensityMultiplier,
+ aDensityDivider,
+ aColor);
+ this.mElement = aElement;
+ // mElement.mLinkedMaterials.add(this);
+ if (aElement == Element._NULL) {
+ this.mChemicalFormula = "Empty";
+ } else {
+ this.mChemicalFormula = aElement.toString();
+ this.mChemicalFormula = this.mChemicalFormula.replaceAll("_", "-");
+ }
+ this.mAspects.addAll(aAspects);
+ }
+
+ private GT_Materials(
+ final int aMetaItemSubID,
+ final TextureSet aIconSet,
+ final float aToolSpeed,
+ final int aToolDurability,
+ final int aToolQuality,
+ final int aTypes,
+ final int aR,
+ final int aG,
+ final int aB,
+ final int aA,
+ final String aLocalName,
+ final int aFuelType,
+ final int aFuelPower,
+ final int aMeltingPoint,
+ final int aBlastFurnaceTemp,
+ final boolean aBlastFurnaceRequired,
+ final boolean aTransparent,
+ final int aOreValue,
+ final int aDensityMultiplier,
+ final int aDensityDivider,
+ final Dyes aColor,
+ final int aExtraData,
+ final List<MaterialStack> 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 GT_Materials(
+ final int aMetaItemSubID,
+ final TextureSet aIconSet,
+ final float aToolSpeed,
+ final int aToolDurability,
+ final int aToolQuality,
+ final int aTypes,
+ final int aR,
+ final int aG,
+ final int aB,
+ final int aA,
+ final String aLocalName,
+ final int aFuelType,
+ final int aFuelPower,
+ final int aMeltingPoint,
+ final int aBlastFurnaceTemp,
+ final boolean aBlastFurnaceRequired,
+ final boolean aTransparent,
+ final int aOreValue,
+ final int aDensityMultiplier,
+ final int aDensityDivider,
+ final Dyes aColor,
+ final int aExtraData,
+ final List<MaterialStack> aMaterialList,
+ final List<TC_AspectStack> aAspects) {
+ this(
+ aMetaItemSubID,
+ aIconSet,
+ aToolSpeed,
+ aToolDurability,
+ aToolQuality,
+ aTypes,
+ aR,
+ aG,
+ aB,
+ aA,
+ aLocalName,
+ aFuelType,
+ aFuelPower,
+ aMeltingPoint,
+ aBlastFurnaceTemp,
+ aBlastFurnaceRequired,
+ aTransparent,
+ aOreValue,
+ aDensityMultiplier,
+ aDensityDivider,
+ aColor);
+ this.mExtraData = aExtraData;
+ this.mMaterialList.addAll(aMaterialList);
+ this.mChemicalFormula = "";
+ for (final MaterialStack tMaterial : this.mMaterialList) {
+ this.mChemicalFormula += tMaterial.toString();
+ }
+ this.mChemicalFormula = this.mChemicalFormula.replaceAll("_", "-");
+
+ int tAmountOfComponents = 0, tMeltingPoint = 0;
+ for (final MaterialStack tMaterial : this.mMaterialList) {
+ tAmountOfComponents += tMaterial.mAmount;
+ if (tMaterial.mMaterial.mMeltingPoint > 0) {
+ tMeltingPoint += tMaterial.mMaterial.mMeltingPoint * tMaterial.mAmount;
+ }
+ if (aAspects == null) {
+ for (final TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) {
+ tAspect.addToAspectList(this.mAspects);
+ }
+ }
+ }
+
+ if (this.mMeltingPoint < 0) {
+ this.mMeltingPoint = (short) (tMeltingPoint / tAmountOfComponents);
+ }
+
+ tAmountOfComponents *= aDensityMultiplier;
+ tAmountOfComponents /= aDensityDivider;
+ if (aAspects == null) {
+ for (final TC_AspectStack tAspect : this.mAspects) {
+ tAspect.mAmount = Math.max(1, tAspect.mAmount / Math.max(1, tAmountOfComponents));
+ }
+ } else {
+ this.mAspects.addAll(aAspects);
+ }
+ }
+
+ public static GT_Materials get(final String aMaterialName) {
+ final Object tObject = GT_Utility.getFieldContent(GT_Materials.class, aMaterialName, false, false);
+ if ((tObject != null) && (tObject instanceof GT_Materials)) {
+ return (GT_Materials) tObject;
+ }
+ return _NULL;
+ }
+
+ public static GT_Materials getRealMaterial(final String aMaterialName) {
+ return get(aMaterialName).mMaterialInto;
+ }
+
+ /**
+ * Called in preInit with the Config to set Values.
+ *
+ * @param aConfiguration
+ */
+ public static void init(final GT_Config aConfiguration) {
+ for (final GT_Materials tMaterial : VALUES) {
+ final 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, true);
+ }
+ 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 (this.mElement != null) {
+ return this.mElement.mHalfLifeSeconds >= 0;
+ }
+ for (final MaterialStack tMaterial : this.mMaterialList) {
+ if (tMaterial.mMaterial.isRadioactive()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public long getProtons() {
+ if (this.mElement != null) {
+ return this.mElement.getProtons();
+ }
+ if (this.mMaterialList.size() <= 0) {
+ return Element.Tc.getProtons();
+ }
+ long rAmount = 0, tAmount = 0;
+ for (final MaterialStack tMaterial : this.mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getProtons();
+ }
+ return (this.getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getNeutrons() {
+ if (this.mElement != null) {
+ return this.mElement.getNeutrons();
+ }
+ if (this.mMaterialList.size() <= 0) {
+ return Element.Tc.getNeutrons();
+ }
+ long rAmount = 0, tAmount = 0;
+ for (final MaterialStack tMaterial : this.mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getNeutrons();
+ }
+ return (this.getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getMass() {
+ if (this.mElement != null) {
+ return this.mElement.getMass();
+ }
+ if (this.mMaterialList.size() <= 0) {
+ return Element.Tc.getMass();
+ }
+ long rAmount = 0, tAmount = 0;
+ for (final MaterialStack tMaterial : this.mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
+ }
+ return (this.getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getDensity() {
+ return this.mDensity;
+ }
+
+ public String getToolTip() {
+ return this.getToolTip(1, false);
+ }
+
+ public String getToolTip(final boolean aShowQuestionMarks) {
+ return this.getToolTip(1, aShowQuestionMarks);
+ }
+
+ public String getToolTip(final long aMultiplier) {
+ return this.getToolTip(aMultiplier, false);
+ }
+
+ public String getToolTip(final long aMultiplier, final boolean aShowQuestionMarks) {
+ if (!aShowQuestionMarks && this.mChemicalFormula.equals("?")) {
+ return "";
+ }
+ if ((aMultiplier >= (M * 2)) && !this.mMaterialList.isEmpty()) {
+ return (((this.mElement != null)
+ || ((this.mMaterialList.size() < 2)
+ && (this.mMaterialList.get(0).mAmount == 1)))
+ ? this.mChemicalFormula
+ : "(" + this.mChemicalFormula + ")")
+ + aMultiplier;
+ }
+ return this.mChemicalFormula;
+ }
+
+ /**
+ * Adds an ItemStack to this Material.
+ */
+ public GT_Materials add(final ItemStack aStack) {
+ if ((aStack != null) && !this.contains(aStack)) {
+ this.mMaterialItems.add(aStack);
+ }
+ return this;
+ }
+
+ /**
+ * This is used to determine if any of the ItemStacks belongs to this Material.
+ */
+ public boolean contains(final ItemStack... aStacks) {
+ if ((aStacks == null) || (aStacks.length <= 0)) {
+ return false;
+ }
+ for (final ItemStack tStack : this.mMaterialItems) {
+ for (final ItemStack aStack : aStacks) {
+ if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * This is used to determine if an ItemStack belongs to this Material.
+ */
+ public boolean remove(final ItemStack aStack) {
+ if (aStack == null) {
+ return false;
+ }
+ boolean temp = false;
+ for (int i = 0; i < this.mMaterialItems.size(); i++) {
+ if (GT_Utility.areStacksEqual(aStack, this.mMaterialItems.get(i))) {
+ this.mMaterialItems.remove(i--);
+ temp = true;
+ }
+ }
+ return temp;
+ }
+
+ /**
+ * Adds a SubTag to this Material
+ */
+ @Override
+ public ISubTagContainer add(final SubTag... aTags) {
+ if (aTags != null) {
+ for (final SubTag aTag : aTags) {
+ if ((aTag != null) && !this.contains(aTag)) {
+ aTag.addContainerToList(this);
+ this.mSubTags.add(aTag);
+ }
+ }
+ }
+ return this;
+ }
+
+ /**
+ * If this Material has this exact SubTag
+ */
+ @Override
+ public boolean contains(final SubTag aTag) {
+ return this.mSubTags.contains(aTag);
+ }
+
+ /**
+ * Removes a SubTag from this Material
+ */
+ @Override
+ public boolean remove(final SubTag aTag) {
+ return this.mSubTags.remove(aTag);
+ }
+
+ /**
+ * Sets the Heat Damage for this Material (negative = frost)
+ */
+ public GT_Materials setHeatDamage(final float aHeatDamage) {
+ this.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 GT_Materials addOreByProduct(final GT_Materials aMaterial) {
+ if (!this.mOreByProducts.contains(aMaterial.mMaterialInto)) {
+ this.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 GT_Materials addOreByProducts(final GT_Materials... aMaterials) {
+ for (final GT_Materials tMaterial : aMaterials) {
+ if (tMaterial != null) {
+ this.addOreByProduct(tMaterial);
+ }
+ }
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Main Material.
+ * Lapis Ore for example gives about 6 drops.
+ */
+ public GT_Materials setOreMultiplier(final int aOreMultiplier) {
+ if (aOreMultiplier > 0) {
+ this.mOreMultiplier = aOreMultiplier;
+ }
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Byproduct Material.
+ */
+ public GT_Materials setByProductMultiplier(final int aByProductMultiplier) {
+ if (aByProductMultiplier > 0) {
+ this.mByProductMultiplier = aByProductMultiplier;
+ }
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Main Material.
+ * Lapis Ore for example gives about 6 drops.
+ */
+ public GT_Materials setSmeltingMultiplier(final int aSmeltingMultiplier) {
+ if (aSmeltingMultiplier > 0) {
+ this.mSmeltingMultiplier = aSmeltingMultiplier;
+ }
+ return this;
+ }
+
+ /**
+ * This Ore should be smolten directly into an Ingot of this Material instead of an Ingot of itself.
+ */
+ public GT_Materials setDirectSmelting(final GT_Materials aMaterial) {
+ if (aMaterial != null) {
+ this.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 GT_Materials setOreReplacement(final GT_Materials aMaterial) {
+ if (aMaterial != null) {
+ this.mOreReplacement = aMaterial.mMaterialInto.mOreReplacement;
+ }
+ return this;
+ }
+
+ /**
+ * This Material smelts always into an instance of aMaterial. Used for Magnets.
+ */
+ public GT_Materials setSmeltingInto(final GT_Materials aMaterial) {
+ if (aMaterial != null) {
+ this.mSmeltInto = aMaterial.mMaterialInto.mSmeltInto;
+ }
+ return this;
+ }
+
+ /**
+ * This Material arc smelts always into an instance of aMaterial. Used for Wrought Iron.
+ */
+ public GT_Materials setArcSmeltingInto(final GT_Materials aMaterial) {
+ if (aMaterial != null) {
+ this.mArcSmeltInto = aMaterial.mMaterialInto.mArcSmeltInto;
+ }
+ return this;
+ }
+
+ /**
+ * This Material macerates always into an instance of aMaterial.
+ */
+ public GT_Materials setMaceratingInto(final GT_Materials aMaterial) {
+ if (aMaterial != null) {
+ this.mMacerateInto = aMaterial.mMaterialInto.mMacerateInto;
+ }
+ return this;
+ }
+
+ public GT_Materials setEnchantmentForTools(final Enchantment aEnchantment, final int aEnchantmentLevel) {
+ this.mEnchantmentTools = aEnchantment;
+ this.mEnchantmentToolsLevel = (byte) aEnchantmentLevel;
+ return this;
+ }
+
+ public GT_Materials setEnchantmentForArmors(final Enchantment aEnchantment, final int aEnchantmentLevel) {
+ this.mEnchantmentArmors = aEnchantment;
+ this.mEnchantmentArmorsLevel = (byte) aEnchantmentLevel;
+ return this;
+ }
+
+ public FluidStack getSolid(final long aAmount) {
+ if (this.mSolid == null) {
+ return null;
+ }
+ return new GT_FluidStack(this.mSolid, (int) aAmount);
+ }
+
+ public FluidStack getFluid(final long aAmount) {
+ if (this.mFluid == null) {
+ return null;
+ }
+ return new GT_FluidStack(this.mFluid, (int) aAmount);
+ }
+
+ public FluidStack getGas(final long aAmount) {
+ if (this.mGas == null) {
+ return null;
+ }
+ return new GT_FluidStack(this.mGas, (int) aAmount);
+ }
+
+ public FluidStack getPlasma(final long aAmount) {
+ if (this.mPlasma == null) {
+ return null;
+ }
+ return new GT_FluidStack(this.mPlasma, (int) aAmount);
+ }
+
+ public FluidStack getMolten(final long aAmount) {
+ if (this.mStandardMoltenFluid == null) {
+ return null;
+ }
+ return new GT_FluidStack(this.mStandardMoltenFluid, (int) aAmount);
+ }
+
+ @Override
+ public short[] getRGBA() {
+ return this.mRGBa;
+ }
+
+ public static volatile int VERSION = 508;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java
index 26ee2bd401..4874e84b7b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java
@@ -4,141 +4,167 @@ import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IIconContainer;
public class GregtechTextureSet {
- public static final GregtechTextureSet
- SET_NONE = new GregtechTextureSet("NONE"), SET_DULL = new GregtechTextureSet("DULL"), SET_RUBY = new GregtechTextureSet("RUBY"), SET_OPAL = new GregtechTextureSet("OPAL"), SET_LEAF = new GregtechTextureSet("LEAF"), SET_WOOD = new GregtechTextureSet("WOOD"), SET_SAND = new GregtechTextureSet("SAND"), SET_FINE = new GregtechTextureSet("FINE"), SET_FIERY = new GregtechTextureSet("FIERY"), SET_FLUID = new GregtechTextureSet("FLUID"), SET_ROUGH = new GregtechTextureSet("ROUGH"), SET_PAPER = new GregtechTextureSet("PAPER"), SET_GLASS = new GregtechTextureSet("GLASS"), SET_FLINT = new GregtechTextureSet("FLINT"), SET_LAPIS = new GregtechTextureSet("LAPIS"), SET_SHINY = new GregtechTextureSet("SHINY"), SET_SHARDS = new GregtechTextureSet("SHARDS"), SET_POWDER = new GregtechTextureSet("POWDER"), SET_QUARTZ = new GregtechTextureSet("QUARTZ"), SET_EMERALD = new GregtechTextureSet("EMERALD"), SET_DIAMOND = new GregtechTextureSet("DIAMOND"), SET_LIGNITE = new GregtechTextureSet("LIGNITE"), SET_MAGNETIC = new GregtechTextureSet("MAGNETIC"), SET_METALLIC = new GregtechTextureSet("METALLIC"), SET_NETHERSTAR = new GregtechTextureSet("NETHERSTAR"), SET_GEM_VERTICAL = new GregtechTextureSet("GEM_VERTICAL"), SET_GEM_HORIZONTAL = new GregtechTextureSet("GEM_HORIZONTAL");
+ public static final GregtechTextureSet SET_NONE = new GregtechTextureSet("NONE"),
+ SET_DULL = new GregtechTextureSet("DULL"),
+ SET_RUBY = new GregtechTextureSet("RUBY"),
+ SET_OPAL = new GregtechTextureSet("OPAL"),
+ SET_LEAF = new GregtechTextureSet("LEAF"),
+ SET_WOOD = new GregtechTextureSet("WOOD"),
+ SET_SAND = new GregtechTextureSet("SAND"),
+ SET_FINE = new GregtechTextureSet("FINE"),
+ SET_FIERY = new GregtechTextureSet("FIERY"),
+ SET_FLUID = new GregtechTextureSet("FLUID"),
+ SET_ROUGH = new GregtechTextureSet("ROUGH"),
+ SET_PAPER = new GregtechTextureSet("PAPER"),
+ SET_GLASS = new GregtechTextureSet("GLASS"),
+ SET_FLINT = new GregtechTextureSet("FLINT"),
+ SET_LAPIS = new GregtechTextureSet("LAPIS"),
+ SET_SHINY = new GregtechTextureSet("SHINY"),
+ SET_SHARDS = new GregtechTextureSet("SHARDS"),
+ SET_POWDER = new GregtechTextureSet("POWDER"),
+ SET_QUARTZ = new GregtechTextureSet("QUARTZ"),
+ SET_EMERALD = new GregtechTextureSet("EMERALD"),
+ SET_DIAMOND = new GregtechTextureSet("DIAMOND"),
+ SET_LIGNITE = new GregtechTextureSet("LIGNITE"),
+ SET_MAGNETIC = new GregtechTextureSet("MAGNETIC"),
+ SET_METALLIC = new GregtechTextureSet("METALLIC"),
+ SET_NETHERSTAR = new GregtechTextureSet("NETHERSTAR"),
+ SET_GEM_VERTICAL = new GregtechTextureSet("GEM_VERTICAL"),
+ SET_GEM_HORIZONTAL = new GregtechTextureSet("GEM_HORIZONTAL");
- public final IIconContainer[] mTextures = new IIconContainer[128];
- public final String mSetName;
+ public final IIconContainer[] mTextures = new IIconContainer[128];
+ public final String mSetName;
- public GregtechTextureSet(final String aSetName) {
- this.mSetName = aSetName;
- this.mTextures[0] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/turbineBlade");
- this.mTextures[1] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/toolHeadSkookumChoocher");
- this.mTextures[2] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[3] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[4] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[5] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[6] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[7] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[8] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[9] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[10] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[11] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[12] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[13] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[14] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[15] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[16] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[17] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[18] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[19] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[20] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[21] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[22] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[23] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[24] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[25] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[26] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[27] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[28] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[29] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[30] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[31] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[32] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[33] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[34] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[35] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[36] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[37] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[38] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[39] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[40] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[41] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[42] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[43] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[44] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[45] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[46] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[47] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[48] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[49] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[50] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[51] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[52] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[53] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[54] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[55] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[56] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[57] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[58] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[59] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[60] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[61] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[62] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[63] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[64] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[65] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[66] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[67] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[68] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[69] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[70] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[71] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[72] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[73] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[74] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[75] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[76] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[77] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[78] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[79] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[80] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[81] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[82] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[83] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[84] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[85] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[86] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[87] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[88] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[89] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[90] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[91] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[92] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[93] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[94] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[95] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[96] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[97] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[98] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[99] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[100] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[101] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[102] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[103] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[104] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[105] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[106] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[107] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[108] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[109] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[110] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[111] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[112] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[113] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[114] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[115] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[116] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[117] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[118] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[119] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[120] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[121] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[122] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[123] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[124] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[125] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[126] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[127] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- }
-} \ No newline at end of file
+ public GregtechTextureSet(final String aSetName) {
+ this.mSetName = aSetName;
+ this.mTextures[0] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/turbineBlade");
+ this.mTextures[1] =
+ new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/toolHeadSkookumChoocher");
+ this.mTextures[2] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[3] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[4] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[5] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[6] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[7] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[8] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[9] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[10] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[11] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[12] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[13] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[14] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[15] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[16] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[17] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[18] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[19] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[20] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[21] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[22] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[23] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[24] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[25] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[26] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[27] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[28] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[29] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[30] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[31] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[32] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[33] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[34] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[35] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[36] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[37] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[38] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[39] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[40] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[41] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[42] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[43] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[44] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[45] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[46] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[47] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[48] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[49] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[50] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[51] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[52] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[53] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[54] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[55] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[56] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[57] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[58] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[59] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[60] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[61] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[62] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[63] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[64] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[65] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[66] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[67] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[68] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[69] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[70] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[71] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[72] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[73] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[74] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[75] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[76] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[77] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[78] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[79] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[80] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[81] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[82] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[83] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[84] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[85] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[86] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[87] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[88] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[89] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[90] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[91] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[92] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[93] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[94] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[95] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[96] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[97] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[98] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[99] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[100] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[101] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[102] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[103] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[104] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[105] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[106] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[107] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[108] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[109] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[110] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[111] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[112] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[113] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[114] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[115] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[116] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[117] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[118] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[119] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[120] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[121] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[122] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[123] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[124] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[125] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[126] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ this.mTextures[127] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java
index 5b1a34590f..b4251bd646 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java
@@ -1,120 +1,130 @@
package gtPlusPlus.xmod.gregtech.api.enums;
-import net.minecraft.client.renderer.texture.TextureMap;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_IconContainer;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_Texture;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
public class GregtechTextures {
- public enum BlockIcons implements Interface_IconContainer, Runnable {
-
- VOID,
-
- LARGECENTRIFUGE1, LARGECENTRIFUGE2, LARGECENTRIFUGE3,
- LARGECENTRIFUGE4, LARGECENTRIFUGE5, LARGECENTRIFUGE6,
- LARGECENTRIFUGE7, LARGECENTRIFUGE8, LARGECENTRIFUGE9,
- LARGECENTRIFUGE_ACTIVE1, LARGECENTRIFUGE_ACTIVE2, LARGECENTRIFUGE_ACTIVE3,
- LARGECENTRIFUGE_ACTIVE4, LARGECENTRIFUGE_ACTIVE5, LARGECENTRIFUGE_ACTIVE6,
- LARGECENTRIFUGE_ACTIVE7, LARGECENTRIFUGE_ACTIVE8, LARGECENTRIFUGE_ACTIVE9;
-
- public static final Interface_IconContainer[]
-
- CENTRIFUGE = new Interface_IconContainer[]{
- LARGECENTRIFUGE1,
- LARGECENTRIFUGE2,
- LARGECENTRIFUGE3,
- LARGECENTRIFUGE4,
- LARGECENTRIFUGE5,
- LARGECENTRIFUGE6,
- LARGECENTRIFUGE7,
- LARGECENTRIFUGE8,
- LARGECENTRIFUGE9
- },
- CENTRIFUGE_ACTIVE = new Interface_IconContainer[]{
- LARGECENTRIFUGE_ACTIVE1,
- LARGECENTRIFUGE_ACTIVE2,
- LARGECENTRIFUGE_ACTIVE3,
- LARGECENTRIFUGE_ACTIVE4,
- LARGECENTRIFUGE_ACTIVE5,
- LARGECENTRIFUGE_ACTIVE6,
- LARGECENTRIFUGE_ACTIVE7,
- LARGECENTRIFUGE_ACTIVE8,
- LARGECENTRIFUGE_ACTIVE9
- };
-
- public static Interface_Texture[]
- GT_CASING_BLOCKS = new Interface_Texture[64];
-
- protected IIcon mIcon;
-
- private BlockIcons() {
- Meta_GT_Proxy.GT_BlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public void run() {
- this.mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(CORE.MODID + ":" + "iconsets/" + this);
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
-
- public static class CustomIcon implements Interface_IconContainer, Runnable {
- protected IIcon mIcon;
- protected String mIconName;
-
- public CustomIcon(final String aIconName) {
- this.mIconName = aIconName;
- Meta_GT_Proxy.GT_BlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public void run() {
- this.mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
- }
- }
-
-
- public enum ItemIcons implements Interface_IconContainer, Runnable {
- VOID, // The Empty Texture
- RENDERING_ERROR, //The Purple/Black Texture
- SKOOKUMCHOOCHER, //The Skookum Tool Texture
- PUMP, // The Hand Pump Texture
- TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE;
-
- /* public static final Interface_IconContainer[]
+ public enum BlockIcons implements Interface_IconContainer, Runnable {
+ VOID,
+
+ LARGECENTRIFUGE1,
+ LARGECENTRIFUGE2,
+ LARGECENTRIFUGE3,
+ LARGECENTRIFUGE4,
+ LARGECENTRIFUGE5,
+ LARGECENTRIFUGE6,
+ LARGECENTRIFUGE7,
+ LARGECENTRIFUGE8,
+ LARGECENTRIFUGE9,
+ LARGECENTRIFUGE_ACTIVE1,
+ LARGECENTRIFUGE_ACTIVE2,
+ LARGECENTRIFUGE_ACTIVE3,
+ LARGECENTRIFUGE_ACTIVE4,
+ LARGECENTRIFUGE_ACTIVE5,
+ LARGECENTRIFUGE_ACTIVE6,
+ LARGECENTRIFUGE_ACTIVE7,
+ LARGECENTRIFUGE_ACTIVE8,
+ LARGECENTRIFUGE_ACTIVE9;
+ public static final Interface_IconContainer[]
+ CENTRIFUGE =
+ new Interface_IconContainer[] {
+ LARGECENTRIFUGE1,
+ LARGECENTRIFUGE2,
+ LARGECENTRIFUGE3,
+ LARGECENTRIFUGE4,
+ LARGECENTRIFUGE5,
+ LARGECENTRIFUGE6,
+ LARGECENTRIFUGE7,
+ LARGECENTRIFUGE8,
+ LARGECENTRIFUGE9
+ },
+ CENTRIFUGE_ACTIVE =
+ new Interface_IconContainer[] {
+ LARGECENTRIFUGE_ACTIVE1,
+ LARGECENTRIFUGE_ACTIVE2,
+ LARGECENTRIFUGE_ACTIVE3,
+ LARGECENTRIFUGE_ACTIVE4,
+ LARGECENTRIFUGE_ACTIVE5,
+ LARGECENTRIFUGE_ACTIVE6,
+ LARGECENTRIFUGE_ACTIVE7,
+ LARGECENTRIFUGE_ACTIVE8,
+ LARGECENTRIFUGE_ACTIVE9
+ };
+
+ public static Interface_Texture[] GT_CASING_BLOCKS = new Interface_Texture[64];
+
+ protected IIcon mIcon;
+
+ private BlockIcons() {
+ Meta_GT_Proxy.GT_BlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return this.mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ this.mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(CORE.MODID + ":" + "iconsets/" + this);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+
+ public static class CustomIcon implements Interface_IconContainer, Runnable {
+ protected IIcon mIcon;
+ protected String mIconName;
+
+ public CustomIcon(final String aIconName) {
+ this.mIconName = aIconName;
+ Meta_GT_Proxy.GT_BlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return this.mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ this.mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
+ }
+
+ public enum ItemIcons implements Interface_IconContainer, Runnable {
+ VOID, // The Empty Texture
+ RENDERING_ERROR, // The Purple/Black Texture
+ SKOOKUMCHOOCHER, // The Skookum Tool Texture
+ PUMP, // The Hand Pump Texture
+ TURBINE_SMALL,
+ TURBINE_LARGE,
+ TURBINE_HUGE;
+
+ /* public static final Interface_IconContainer[]
DURABILITY_BAR = new Interface_IconContainer[]{
DURABILITY_BAR_0,
DURABILITY_BAR_1,
@@ -138,66 +148,65 @@ public class GregtechTextures {
ENERGY_BAR_8,
};*/
- //public static final Interface_Texture[] ERROR_RENDERING = new Interface_Texture[]{new GregtechRenderedTexture(RENDERING_ERROR)};
-
- protected IIcon mIcon, mOverlay;
-
- private ItemIcons() {
- Meta_GT_Proxy.GT_ItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
-
- @Override
- public void run() {
- this.mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID+ ":" + "iconsets/" + this);
- this.mOverlay = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID+ ":" + "iconsets/" + this + "_OVERLAY");
- }
-
- public static class CustomIcon implements Interface_IconContainer, Runnable {
- protected IIcon mIcon, mOverlay;
- protected String mIconName;
-
- public CustomIcon(final String aIconName) {
- this.mIconName = aIconName;
- Meta_GT_Proxy.GT_ItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public void run() {
- this.mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID+ ":" + this.mIconName);
- this.mOverlay = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID+ ":" + this.mIconName + "_OVERLAY");
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
- }
- }
-
+ // public static final Interface_Texture[] ERROR_RENDERING = new Interface_Texture[]{new
+ // GregtechRenderedTexture(RENDERING_ERROR)};
+
+ protected IIcon mIcon, mOverlay;
+
+ private ItemIcons() {
+ Meta_GT_Proxy.GT_ItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return this.mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return this.mOverlay;
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+
+ @Override
+ public void run() {
+ this.mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID + ":" + "iconsets/" + this);
+ this.mOverlay = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID + ":" + "iconsets/" + this + "_OVERLAY");
+ }
+
+ public static class CustomIcon implements Interface_IconContainer, Runnable {
+ protected IIcon mIcon, mOverlay;
+ protected String mIconName;
+
+ public CustomIcon(final String aIconName) {
+ this.mIconName = aIconName;
+ Meta_GT_Proxy.GT_ItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return this.mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return this.mOverlay;
+ }
+
+ @Override
+ public void run() {
+ this.mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
+ this.mOverlay = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
index 105023065c..bae91b53fe 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.gregtech.api.enums;
public enum GregtechToolDictNames {
-
- craftingToolSkookumChoocher, craftingToolHandPump, craftingToolAngleGrinder, craftingToolElectricSnips, craftingToolElectricLighter, craftingToolElectricButcherKnife;
-
-} \ No newline at end of file
+ craftingToolSkookumChoocher,
+ craftingToolHandPump,
+ craftingToolAngleGrinder,
+ craftingToolElectricSnips,
+ craftingToolElectricLighter,
+ craftingToolElectricButcherKnife;
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java
index 04d8d91201..005485cbde 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java
@@ -1,32 +1,27 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
-import net.minecraft.inventory.Slot;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity_Boiler_Base;
+import java.util.Iterator;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.Slot;
-public class CONTAINER_AdvancedBoiler
- extends GT_ContainerMetaTile_Machine {
+public class CONTAINER_AdvancedBoiler extends GT_ContainerMetaTile_Machine {
public int mWaterAmount = 0;
public int mSteamAmount = 0;
public int mProcessingEnergy = 0;
public int mTemperature = 2;
-
+
public CONTAINER_AdvancedBoiler(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
@Override
- public void addSlots(InventoryPlayer aInventoryPlayer) {
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
@@ -34,33 +29,47 @@ public class CONTAINER_AdvancedBoiler
}
@Override
- public int getSlotCount() {
+ public int getSlotCount() {
return 4;
}
@Override
- public int getShiftClickSlotCount() {
+ public int getShiftClickSlotCount() {
return 1;
}
@Override
- public void detectAndSendChanges() {
+ public void detectAndSendChanges() {
super.detectAndSendChanges();
if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
return;
}
-
+
int steamCapacity = ((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).getSteamCapacity();
int waterCapacity = ((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).getCapacity();
this.mTemperature = ((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mTemperature;
- this.mProcessingEnergy = ((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
- this.mSteamAmount = (((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mSteam == null ? 0 : ((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mSteam.amount);
- this.mWaterAmount = (((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mFluid == null ? 0 : ((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mFluid.amount);
+ this.mProcessingEnergy =
+ ((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
+ this.mSteamAmount = (((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mSteam == null
+ ? 0
+ : ((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mSteam.amount);
+ this.mWaterAmount = (((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mFluid == null
+ ? 0
+ : ((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).mFluid.amount);
- this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
+ this.mTemperature = Math.min(
+ 54,
+ Math.max(
+ 0,
+ this.mTemperature
+ * 54
+ / (((GT_MetaTileEntity_Boiler_Base) this.mTileEntity.getMetaTileEntity())
+ .maxProgresstime()
+ - 10)));
this.mSteamAmount = Math.min(54, Math.max(0, this.mSteamAmount * 54 / (steamCapacity - 100)));
this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / (waterCapacity - 100)));
- this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000));
+ this.mProcessingEnergy =
+ Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000));
Iterator<?> var2 = this.crafters.iterator();
while (var2.hasNext()) {
@@ -73,7 +82,7 @@ public class CONTAINER_AdvancedBoiler
}
@Override
- @SideOnly(Side.CLIENT)
+ @SideOnly(Side.CLIENT)
public void updateProgressBar(int par1, int par2) {
super.updateProgressBar(par1, par2);
switch (par1) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java
index 6d0eb6b14c..f11a943e44 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java
@@ -11,27 +11,30 @@ import net.minecraft.entity.player.InventoryPlayer;
*/
public class CONTAINER_Cyclotron extends GT_ContainerMetaTile_Machine {
- public CONTAINER_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
-
- super(aInventoryPlayer, aTileEntity);
- }
-
- public CONTAINER_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
-
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- //this.addSlotToContainer(new Slot(this.mTileEntity, 1, 154, 42));
- }
-
- @Override
- public int getSlotCount() {
- return 0;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 0;
- }
+ public CONTAINER_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_Cyclotron(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
+
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ // this.addSlotToContainer(new Slot(this.mTileEntity, 1, 154, 42));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java
index fe100955e0..0951c231d5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java
@@ -3,9 +3,7 @@ package gtPlusPlus.xmod.gregtech.api.gui;
import gregtech.api.enums.ItemList;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.slots.SlotIntegratedCircuit;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
@@ -36,7 +34,6 @@ public class CONTAINER_DataHatch extends GT_ContainerMetaTile_Machine {
addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 14, 89, 62));
addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 15, 107, 62));
addSlotToContainer(new SlotIntegratedCircuit(mTileEntity, 16, 19, 35));
-
}
@Override
@@ -48,23 +45,23 @@ public class CONTAINER_DataHatch extends GT_ContainerMetaTile_Machine {
public int getShiftClickSlotCount() {
return 0;
}
-
- @Override
- public void putStackInSlot(int par1, ItemStack par2ItemStack) {
- /*Logger.INFO("Slot: "+par1);
- if (par1 < 16 && ItemList.Tool_DataOrb.isStackEqual(par2ItemStack)) {
- super.putStackInSlot(par1, par2ItemStack);
- }
- if (par1 == 16 && ItemUtils.isControlCircuit(par2ItemStack)) {
- super.putStackInSlot(par1, par2ItemStack);
- }*/
- super.putStackInSlot(par1, par2ItemStack);
- }
- @Override
- public boolean canDragIntoSlot(Slot par1Slot) {
- return super.canDragIntoSlot(par1Slot);
- }
+ @Override
+ public void putStackInSlot(int par1, ItemStack par2ItemStack) {
+ /*Logger.INFO("Slot: "+par1);
+ if (par1 < 16 && ItemList.Tool_DataOrb.isStackEqual(par2ItemStack)) {
+ super.putStackInSlot(par1, par2ItemStack);
+ }
+ if (par1 == 16 && ItemUtils.isControlCircuit(par2ItemStack)) {
+ super.putStackInSlot(par1, par2ItemStack);
+ }*/
+ super.putStackInSlot(par1, par2ItemStack);
+ }
+
+ @Override
+ public boolean canDragIntoSlot(Slot par1Slot) {
+ return super.canDragIntoSlot(par1Slot);
+ }
public class GT_Slot_DataOrb extends Slot {
public GT_Slot_DataOrb(IInventory par1iInventory, int par2, int par3, int par4) {
@@ -76,7 +73,4 @@ public class CONTAINER_DataHatch extends GT_ContainerMetaTile_Machine {
return ItemList.Tool_DataOrb.isStackEqual(aStack, false, true);
}
}
-
-
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java
index a4508781aa..e0698f9d24 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java
@@ -1,20 +1,16 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
-import net.minecraft.inventory.Slot;
-
import gregtech.api.gui.GT_Container_BasicTank;
import gregtech.api.gui.GT_Slot_Output;
import gregtech.api.gui.GT_Slot_Render;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeTank;
+import java.util.Iterator;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.Slot;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -23,58 +19,58 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEn
*/
public class CONTAINER_DeluxeTank extends GT_Container_BasicTank {
- public CONTAINER_DeluxeTank(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public CONTAINER_DeluxeTank(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new Slot(this.mTileEntity, 0, 80, 17));
- this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 1, 80, 53));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 41, 42));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 3, 59, 42));
- }
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new Slot(this.mTileEntity, 0, 80, 17));
+ this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 1, 80, 53));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 41, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 3, 59, 42));
+ }
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (this.mTileEntity.isClientSide() || (this.mTileEntity.getMetaTileEntity() == null)) {
- return;
- }
- if (((GT_MetaTileEntity_DeluxeTank) this.mTileEntity.getMetaTileEntity()).mFluid != null) {
- this.mContent = ((GT_MetaTileEntity_DeluxeTank) this.mTileEntity.getMetaTileEntity()).mFluid.amount;
- } else {
- this.mContent = 0;
- }
- final Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- final ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 100, this.mContent & 65535);
- var1.sendProgressBarUpdate(this, 101, this.mContent >>> 16);
- }
- }
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (this.mTileEntity.isClientSide() || (this.mTileEntity.getMetaTileEntity() == null)) {
+ return;
+ }
+ if (((GT_MetaTileEntity_DeluxeTank) this.mTileEntity.getMetaTileEntity()).mFluid != null) {
+ this.mContent = ((GT_MetaTileEntity_DeluxeTank) this.mTileEntity.getMetaTileEntity()).mFluid.amount;
+ } else {
+ this.mContent = 0;
+ }
+ final Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ final ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 100, this.mContent & 65535);
+ var1.sendProgressBarUpdate(this, 101, this.mContent >>> 16);
+ }
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(final int par1, final int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 100:
- this.mContent = (this.mContent & -65536) | par2;
- break;
- case 101:
- this.mContent = (this.mContent & 65535) | (par2 << 16);
- break;
- }
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(final int par1, final int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ this.mContent = (this.mContent & -65536) | par2;
+ break;
+ case 101:
+ this.mContent = (this.mContent & 65535) | (par2 << 16);
+ break;
+ }
+ }
- @Override
- public int getSlotCount() {
- return 2;
- }
+ @Override
+ public int getSlotCount() {
+ return 2;
+ }
- @Override
- public int getShiftClickSlotCount() {
- return 1;
- }
+ @Override
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java
index 17226a399e..9031003349 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java
@@ -5,47 +5,49 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.slots.SlotAirFilter;
import net.minecraft.entity.player.InventoryPlayer;
-
public class CONTAINER_Hatch_Muffler_Advanced extends GT_ContainerMetaTile_Machine {
- public long maxEU = 0;
- public long storedEU = 0;
-
- public CONTAINER_Hatch_Muffler_Advanced(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- public CONTAINER_Hatch_Muffler_Advanced(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
-
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new SlotAirFilter(this.mTileEntity, 0, 80, 35));
- }
-
- @Override
- public int getSlotCount() {
- return 1;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 1;
- }
-
- @Override
- public void updateProgressBar(final int id, final int value) {
- super.updateProgressBar(id, value);
- switch (id) {
- default:
- break;
- }
- }
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- }
-
-} \ No newline at end of file
+ public long maxEU = 0;
+ public long storedEU = 0;
+
+ public CONTAINER_Hatch_Muffler_Advanced(
+ final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_Hatch_Muffler_Advanced(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
+
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new SlotAirFilter(this.mTileEntity, 0, 80, 35));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 1;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
+
+ @Override
+ public void updateProgressBar(final int id, final int value) {
+ super.updateProgressBar(id, value);
+ switch (id) {
+ default:
+ break;
+ }
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
index df8df2f775..a24288e877 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
@@ -1,10 +1,9 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Slot;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -13,27 +12,31 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
*/
public class CONTAINER_IndustrialCentrifuge extends GT_ContainerMetaTile_Machine {
- public CONTAINER_IndustrialCentrifuge(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
-
- super(aInventoryPlayer, aTileEntity);
- }
-
- public CONTAINER_IndustrialCentrifuge(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
-
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new Slot(this.mTileEntity, 1, 154, 42));
- }
-
- @Override
- public int getSlotCount() {
- return 1;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 1;
- }
+ public CONTAINER_IndustrialCentrifuge(
+ final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_IndustrialCentrifuge(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
+
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new Slot(this.mTileEntity, 1, 154, 42));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 1;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
index 78150aedbe..483a1abc16 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
@@ -1,32 +1,31 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Slot;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.gui.GT_Slot_Output;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
public class CONTAINER_IronBlastFurnace extends GT_ContainerMetaTile_Machine {
- public CONTAINER_IronBlastFurnace(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public CONTAINER_IronBlastFurnace(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new Slot(this.mTileEntity, 0, 34, 16));
- this.addSlotToContainer(new Slot(this.mTileEntity, 1, 34, 34));
- this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 2, 86, 25));
- this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 3, 104, 25));
- }
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new Slot(this.mTileEntity, 0, 34, 16));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 1, 34, 34));
+ this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 2, 86, 25));
+ this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 3, 104, 25));
+ }
- @Override
- public int getSlotCount() {
- return 4;
- }
+ @Override
+ public int getSlotCount() {
+ return 4;
+ }
- @Override
- public int getShiftClickSlotCount() {
- return 2;
- }
+ @Override
+ public int getShiftClickSlotCount() {
+ return 2;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
index 93591b2aaf..43996e25c8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
@@ -1,13 +1,11 @@
package gtPlusPlus.xmod.gregtech.api.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.interfaces.tileentity.IGregTechTileEntity;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_MassFabricator;
+import java.util.Iterator;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
@@ -17,24 +15,27 @@ import net.minecraft.inventory.ICrafting;
* The Container I use for all my Basic Machines
*/
public class CONTAINER_MatterFab extends GT_ContainerMetaTile_Machine {
-
- public int mMatterProduced = 0;
- public int mScrapProduced = 0;
- public int mAmplifierProduced = 0;
- public int mScrapUsed = 0;
- public int mAmplifierUsed = 0;
- public CONTAINER_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public int mMatterProduced = 0;
+ public int mScrapProduced = 0;
+ public int mAmplifierProduced = 0;
+ public int mScrapUsed = 0;
+ public int mAmplifierUsed = 0;
+
+ public CONTAINER_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- public CONTAINER_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
+ public CONTAINER_MatterFab(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
- @Override
+ @Override
public void addSlots(InventoryPlayer aInventoryPlayer) {
- //addSlotToContainer(new SlotNoInput(mTileEntity, 1, 152, 5));
+ // addSlotToContainer(new SlotNoInput(mTileEntity, 1, 152, 5));
}
@Override
@@ -46,58 +47,58 @@ public class CONTAINER_MatterFab extends GT_ContainerMetaTile_Machine {
public int getShiftClickSlotCount() {
return 0;
}
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
- return;
- }
- GregtechMetaTileEntity_MassFabricator aTile = ((GregtechMetaTileEntity_MassFabricator)this.mTileEntity.getMetaTileEntity());
- mAmplifierProduced = aTile.mAmplifierProduced;
- mAmplifierUsed = aTile.mAmplifierUsed;
- mMatterProduced = aTile.mMatterProduced;
- mScrapProduced = aTile.mScrapProduced;
- mScrapUsed = aTile.mScrapUsed;
-
- Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 201, mAmplifierProduced);
- var1.sendProgressBarUpdate(this, 202, mAmplifierUsed);
- var1.sendProgressBarUpdate(this, 203, mMatterProduced);
- var1.sendProgressBarUpdate(this, 204, mScrapProduced);
- var1.sendProgressBarUpdate(this, 205, mScrapUsed);
- }
- }
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
+ return;
+ }
+ GregtechMetaTileEntity_MassFabricator aTile =
+ ((GregtechMetaTileEntity_MassFabricator) this.mTileEntity.getMetaTileEntity());
- @Override
- public void addCraftingToCrafters(ICrafting par1ICrafting) {
- super.addCraftingToCrafters(par1ICrafting);
- }
+ mAmplifierProduced = aTile.mAmplifierProduced;
+ mAmplifierUsed = aTile.mAmplifierUsed;
+ mMatterProduced = aTile.mMatterProduced;
+ mScrapProduced = aTile.mScrapProduced;
+ mScrapUsed = aTile.mScrapUsed;
- @Override
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 201:
- mAmplifierProduced = (par2);
- break;
- case 202:
- mAmplifierUsed = (par2);
- break;
- case 203:
- mMatterProduced = (par2);
- break;
- case 204:
- mScrapProduced = (par2);
- break;
- case 205:
- mScrapUsed = (par2);
- break;
- }
- }
-
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 201, mAmplifierProduced);
+ var1.sendProgressBarUpdate(this, 202, mAmplifierUsed);
+ var1.sendProgressBarUpdate(this, 203, mMatterProduced);
+ var1.sendProgressBarUpdate(this, 204, mScrapProduced);
+ var1.sendProgressBarUpdate(this, 205, mScrapUsed);
+ }
+ }
+
+ @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 201:
+ mAmplifierProduced = (par2);
+ break;
+ case 202:
+ mAmplifierUsed = (par2);
+ break;
+ case 203:
+ mMatterProduced = (par2);
+ break;
+ case 204:
+ mScrapProduced = (par2);
+ break;
+ case 205:
+ mScrapUsed = (par2);
+ break;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MetaTileMachineLong.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MetaTileMachineLong.java
index 6a3322ab2e..456d501fdc 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MetaTileMachineLong.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MetaTileMachineLong.java
@@ -2,243 +2,255 @@ package gtPlusPlus.xmod.gregtech.api.gui;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import gregtech.api.gui.GT_Container;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_LanguageManager;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
-
+import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
-import java.util.Iterator;
-
public class CONTAINER_MetaTileMachineLong extends GT_Container {
- public int mActive = 0, mMaxProgressTime = 0, mProgressTime = 0, mSteam = 0, mSteamStorage = 0, mOutput = 0, mInput = 0, mID = 0, mDisplayErrorCode = 0;
- private int oActive = 0, oMaxProgressTime = 0, oProgressTime = 0, oSteam = 0, oSteamStorage = 0, oOutput = 0, oInput = 0, oID = 0, oDisplayErrorCode = 0, mTimer = 0;
-
- public long pEnergy, pStorage;
- private long nEnergy, nStorage;
-
- public short pIntMaxCountCurrent, pIntMaxCountMax;
- private short nIntMaxCountCurrent, nIntMaxCountMax;
-
- public CONTAINER_MetaTileMachineLong(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 CONTAINER_MetaTileMachineLong(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;
- }
- }
-
- private Pair<Integer, Integer> getPowerStored(){
- final long mStoredPower = this.pEnergy;
- long mMaxInts = (mStoredPower/Integer.MAX_VALUE);
- long mLeftOver = (mStoredPower % Integer.MAX_VALUE);
- if (mMaxInts < 0 || mMaxInts >= /*4294967298L*/ Integer.MAX_VALUE) {
- return new Pair<Integer, Integer>(-1, 0);
- }
- if (mLeftOver < 0 || mLeftOver > Integer.MAX_VALUE) {
- mLeftOver = 0;
- }
- Pair<Integer, Integer> power = new Pair<Integer, Integer>((int) mMaxInts, (int) mLeftOver);
- return power;
- }
-
- private Pair<Integer, Integer> getMaxPowerStored(){
- final long mMaxStoredPower = this.pStorage;
- long mMaxInts = (mMaxStoredPower/Integer.MAX_VALUE);
- long mLeftOver = (mMaxStoredPower % Integer.MAX_VALUE);
- if (mMaxInts < 0 || mMaxInts >= /*4294967298L*/ Integer.MAX_VALUE) {
- return new Pair<Integer, Integer>(-1, 0);
- }
- if (mLeftOver < 0 || mLeftOver > Integer.MAX_VALUE) {
- mLeftOver = 0;
- }
- Pair<Integer, Integer> power = new Pair<Integer, Integer>((int) mMaxInts, (int) mLeftOver);
- return power;
- }
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
- pStorage = Math.min(Long.MAX_VALUE, mTileEntity.getEUCapacity());
- pEnergy = Math.min(Long.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++;
-
- Pair<Integer, Integer> powerPacket = getPowerStored();
- Pair<Integer, Integer> maxPowerPacket = getMaxPowerStored();
-
- int mPacketsToSend = powerPacket.getKey();
- int mLeftOverPowerStored = powerPacket.getValue();
-
- int mMaxStorageA = maxPowerPacket.getKey();
- int mMaxStorageB = maxPowerPacket.getValue();
-
- //Someone has a VERY FULL power supply.
- if (mPacketsToSend == -1) {
- Logger.INFO("TOO MUCH MATH - USE BIGINTEGER - GAME BREAKING BUG MAY OCCUR");
- return;
- }
-
-
- Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- if (mTimer % 500 == 10 || nEnergy != pEnergy) {
- var1.sendProgressBarUpdate(this, 0, mLeftOverPowerStored & 65535);
- var1.sendProgressBarUpdate(this, 1, mLeftOverPowerStored >>> 16);
- var1.sendProgressBarUpdate(this, 7730, mPacketsToSend);
- }
- if (mTimer % 500 == 10 || nStorage != pStorage) {
- var1.sendProgressBarUpdate(this, 2, mMaxStorageB & 65535);
- var1.sendProgressBarUpdate(this, 3, mMaxStorageB >>> 16);
- var1.sendProgressBarUpdate(this, 7731, mMaxStorageA);
- }
- 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;
- nEnergy = pEnergy;
- nStorage = pStorage;
- 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 7730:
- pIntMaxCountCurrent = par2;*/
- case 0:
- pEnergy = pEnergy & -65536 | par2;
- break;
- case 1:
- pEnergy = pEnergy & 65535 | par2 << 16;
- break;
- case 2:
- pStorage = pStorage & -65536 | par2;
- break;
- case 3:
- pStorage = pStorage & 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);
- }
-
- public String trans(String aKey, String aEnglish){
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false);
- }
-} \ No newline at end of file
+ public int mActive = 0,
+ mMaxProgressTime = 0,
+ mProgressTime = 0,
+ mSteam = 0,
+ mSteamStorage = 0,
+ mOutput = 0,
+ mInput = 0,
+ mID = 0,
+ mDisplayErrorCode = 0;
+ private int oActive = 0,
+ oMaxProgressTime = 0,
+ oProgressTime = 0,
+ oSteam = 0,
+ oSteamStorage = 0,
+ oOutput = 0,
+ oInput = 0,
+ oID = 0,
+ oDisplayErrorCode = 0,
+ mTimer = 0;
+ public long pEnergy, pStorage;
+ private long nEnergy, nStorage;
+ public short pIntMaxCountCurrent, pIntMaxCountMax;
+ private short nIntMaxCountCurrent, nIntMaxCountMax;
+
+ public CONTAINER_MetaTileMachineLong(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 CONTAINER_MetaTileMachineLong(
+ 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;
+ }
+ }
+
+ private Pair<Integer, Integer> getPowerStored() {
+ final long mStoredPower = this.pEnergy;
+ long mMaxInts = (mStoredPower / Integer.MAX_VALUE);
+ long mLeftOver = (mStoredPower % Integer.MAX_VALUE);
+ if (mMaxInts < 0 || mMaxInts >= /*4294967298L*/ Integer.MAX_VALUE) {
+ return new Pair<Integer, Integer>(-1, 0);
+ }
+ if (mLeftOver < 0 || mLeftOver > Integer.MAX_VALUE) {
+ mLeftOver = 0;
+ }
+ Pair<Integer, Integer> power = new Pair<Integer, Integer>((int) mMaxInts, (int) mLeftOver);
+ return power;
+ }
+
+ private Pair<Integer, Integer> getMaxPowerStored() {
+ final long mMaxStoredPower = this.pStorage;
+ long mMaxInts = (mMaxStoredPower / Integer.MAX_VALUE);
+ long mLeftOver = (mMaxStoredPower % Integer.MAX_VALUE);
+ if (mMaxInts < 0 || mMaxInts >= /*4294967298L*/ Integer.MAX_VALUE) {
+ return new Pair<Integer, Integer>(-1, 0);
+ }
+ if (mLeftOver < 0 || mLeftOver > Integer.MAX_VALUE) {
+ mLeftOver = 0;
+ }
+ Pair<Integer, Integer> power = new Pair<Integer, Integer>((int) mMaxInts, (int) mLeftOver);
+ return power;
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
+ pStorage = Math.min(Long.MAX_VALUE, mTileEntity.getEUCapacity());
+ pEnergy = Math.min(Long.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++;
+
+ Pair<Integer, Integer> powerPacket = getPowerStored();
+ Pair<Integer, Integer> maxPowerPacket = getMaxPowerStored();
+
+ int mPacketsToSend = powerPacket.getKey();
+ int mLeftOverPowerStored = powerPacket.getValue();
+
+ int mMaxStorageA = maxPowerPacket.getKey();
+ int mMaxStorageB = maxPowerPacket.getValue();
+
+ // Someone has a VERY FULL power supply.
+ if (mPacketsToSend == -1) {
+ Logger.INFO("TOO MUCH MATH - USE BIGINTEGER - GAME BREAKING BUG MAY OCCUR");
+ return;
+ }
+
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ if (mTimer % 500 == 10 || nEnergy != pEnergy) {
+ var1.sendProgressBarUpdate(this, 0, mLeftOverPowerStored & 65535);
+ var1.sendProgressBarUpdate(this, 1, mLeftOverPowerStored >>> 16);
+ var1.sendProgressBarUpdate(this, 7730, mPacketsToSend);
+ }
+ if (mTimer % 500 == 10 || nStorage != pStorage) {
+ var1.sendProgressBarUpdate(this, 2, mMaxStorageB & 65535);
+ var1.sendProgressBarUpdate(this, 3, mMaxStorageB >>> 16);
+ var1.sendProgressBarUpdate(this, 7731, mMaxStorageA);
+ }
+ 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;
+ nEnergy = pEnergy;
+ nStorage = pStorage;
+ 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 7730:
+ pIntMaxCountCurrent = par2;*/
+ case 0:
+ pEnergy = pEnergy & -65536 | par2;
+ break;
+ case 1:
+ pEnergy = pEnergy & 65535 | par2 << 16;
+ break;
+ case 2:
+ pStorage = pStorage & -65536 | par2;
+ break;
+ case 3:
+ pStorage = pStorage & 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);
+ }
+
+ public String trans(String aKey, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
index 88b9661c95..fd4aff592e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
@@ -1,9 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
@@ -14,6 +10,9 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
@@ -25,259 +24,263 @@ import net.minecraft.inventory.ICrafting;
*/
public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
- public String[] mTileDescription;
- private String[] oTileDescription;
-
- private GregtechMeta_MultiBlockBase mMCTEI;
- private boolean mControllerSet = false;
+ public String[] mTileDescription;
+ private String[] oTileDescription;
+
+ private GregtechMeta_MultiBlockBase mMCTEI;
+ private boolean mControllerSet = false;
+
+ public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+ public CONTAINER_MultiMachine(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
- public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public static void setControllerInstance(CONTAINER_MultiMachine aContainer, IGregTechTileEntity aTile) {
+ if (aTile == null) {
+ return;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return;
+ }
+ if (aMetaTileEntity instanceof GregtechMeta_MultiBlockBase) {
+ aContainer.mMCTEI = (GregtechMeta_MultiBlockBase) aMetaTileEntity;
+ }
+ }
- public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
-
- public static void setControllerInstance(CONTAINER_MultiMachine aContainer, IGregTechTileEntity aTile) {
- if (aTile == null) {
- return;
- }
- final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return;
- }
- if (aMetaTileEntity instanceof GregtechMeta_MultiBlockBase) {
- aContainer.mMCTEI = (GregtechMeta_MultiBlockBase) aMetaTileEntity;
- }
- }
+ public int aTotalTickTime = 0;
+ public int aMaxParallel = 0;
+ public int aPollutionTick = 0;
+ public int aMaxInputVoltage = 0;
+ public int aInputTier = 0;
+ public int aOutputTier = 0;
+ public int aRecipeDuration = 0;
+ public int aRecipeEU = 0;
+ public int aRecipeSpecial = 0;
+ public int aPollutionReduction = 0;
+ public int aStoredEnergy = 0;
+ public int aMaxEnergy = 0;
+ public int aEfficiency = 0;
- public int aTotalTickTime = 0;
- public int aMaxParallel = 0;
- public int aPollutionTick = 0;
- public int aMaxInputVoltage = 0;
- public int aInputTier = 0;
- public int aOutputTier = 0;
- public int aRecipeDuration = 0;
- public int aRecipeEU = 0;
- public int aRecipeSpecial = 0;
- public int aPollutionReduction = 0;
- public int aStoredEnergy = 0;
- public int aMaxEnergy = 0;
- public int aEfficiency = 0;
+ private int oTotalTickTime = 0;
+ private int oMaxParallel = 0;
+ private int oPollutionTick = 0;
+ private int oMaxInputVoltage = 0;
+ private int oInputTier = 0;
+ private int oOutputTier = 0;
+ private int oRecipeDuration = 0;
+ private int oRecipeEU = 0;
+ private int oRecipeSpecial = 0;
+ private int oPollutionReduction = 0;
+ private int oStoredEnergy = 0;
+ private int oMaxEnergy = 0;
+ private int oEfficiency = 0;
- private int oTotalTickTime = 0;
- private int oMaxParallel = 0;
- private int oPollutionTick = 0;
- private int oMaxInputVoltage = 0;
- private int oInputTier = 0;
- private int oOutputTier = 0;
- private int oRecipeDuration = 0;
- private int oRecipeEU = 0;
- private int oRecipeSpecial = 0;
- private int oPollutionReduction = 0;
- private int oStoredEnergy = 0;
- private int oMaxEnergy = 0;
- private int oEfficiency = 0;
+ private static Field timer;
+ // private static Field crafters;
- private static Field timer;
- //private static Field crafters;
+ @Override
+ public final void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) {
+ return;
+ }
+ if (!mControllerSet) {
+ setControllerInstance(this, this.mTileEntity);
+ }
+ mControllerSet = (mMCTEI != null);
+ if (timer == null) {
+ timer = ReflectionUtils.getField(getClass(), "mTimer");
+ }
+ if (crafters == null) {
+ // crafters = ReflectionUtils.getField(getClass(), "crafters");
+ }
+ if (timer != null && crafters != null && mControllerSet) {
+ // Logger.INFO("Trying to update clientside GUI data");
+ try {
+ // Logger.INFO("0");
+ int aTimer = (int) ReflectionUtils.getFieldValue(timer, this);
- @Override
- public final void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) {
- return;
- }
- if (!mControllerSet) {
- setControllerInstance(this, this.mTileEntity);
- }
- mControllerSet = (mMCTEI != null);
- if (timer == null) {
- timer = ReflectionUtils.getField(getClass(), "mTimer");
- }
- if (crafters == null) {
- //crafters = ReflectionUtils.getField(getClass(), "crafters");
- }
- if (timer != null && crafters != null && mControllerSet) {
- //Logger.INFO("Trying to update clientside GUI data");
- try {
- //Logger.INFO("0");
- int aTimer = (int) ReflectionUtils.getFieldValue(timer, this);
-
- //List crafters1List = (List) crafters1;
- List<ICrafting> crafters2 = new ArrayList<ICrafting>();
- //Logger.INFO("1");
- for (Object o : crafters) {
- if (o instanceof ICrafting) {
- crafters2.add((ICrafting) o);
- }
- }
- //Logger.INFO("2");
- if (!crafters2.isEmpty()) {
- //Logger.INFO("3");
- handleInitialFieldSetting();
+ // List crafters1List = (List) crafters1;
+ List<ICrafting> crafters2 = new ArrayList<ICrafting>();
+ // Logger.INFO("1");
+ for (Object o : crafters) {
+ if (o instanceof ICrafting) {
+ crafters2.add((ICrafting) o);
+ }
+ }
+ // Logger.INFO("2");
+ if (!crafters2.isEmpty()) {
+ // Logger.INFO("3");
+ handleInitialFieldSetting();
- try {
- //Logger.INFO("4");
- for (final ICrafting var3 : crafters2) {
- handleCraftingEvent(aTimer, var3);
- }
- //Logger.INFO("5");
- handleInternalFieldSetting();
- //Logger.INFO("6");
- } catch (Throwable t) {
+ try {
+ // Logger.INFO("4");
+ for (final ICrafting var3 : crafters2) {
+ handleCraftingEvent(aTimer, var3);
+ }
+ // Logger.INFO("5");
+ handleInternalFieldSetting();
+ // Logger.INFO("6");
+ } catch (Throwable t) {
- }
- }
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
- else {
- Logger.INFO("Failed.");
- }
- }
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ } else {
+ Logger.INFO("Failed.");
+ }
+ }
- public void handleInitialFieldSetting() {
- this.aTotalTickTime = MathUtils.balance((int) mMCTEI.getTotalRuntimeInTicks(), Integer.MIN_VALUE, Integer.MAX_VALUE);
- this.aMaxParallel = mMCTEI.getMaxParallelRecipes();
- this.aPollutionTick = mMCTEI.getPollutionPerTick(null);
- this.aMaxInputVoltage = MathUtils.balance((int) mMCTEI.getMaxInputVoltage(), Integer.MIN_VALUE, Integer.MAX_VALUE);
- this.aInputTier = MathUtils.balance((int) mMCTEI.getInputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE);
- this.aOutputTier = MathUtils.balance((int) mMCTEI.getOutputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE);
- if (mMCTEI.mLastRecipe != null) {
- GT_Recipe aRecipe = mMCTEI.mLastRecipe;
- this.aRecipeDuration = MathUtils.balance(aRecipe.mDuration, Integer.MIN_VALUE, Integer.MAX_VALUE);
- this.aRecipeEU = MathUtils.balance(aRecipe.mEUt, Integer.MIN_VALUE, Integer.MAX_VALUE);
- this.aRecipeSpecial = MathUtils.balance(aRecipe.mSpecialValue, Integer.MIN_VALUE, Integer.MAX_VALUE);
- }
- this.aPollutionReduction = mMCTEI.getPollutionReductionForAllMufflers();
-
- this.aStoredEnergy = MathUtils.balance((int) mMCTEI.getStoredEnergyInAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE);
- this.aMaxEnergy = MathUtils.balance((int) mMCTEI.getMaxEnergyStorageOfAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE);
- this.aEfficiency = MathUtils.balance(mMCTEI.mEfficiency, Integer.MIN_VALUE, Integer.MAX_VALUE);
- }
+ public void handleInitialFieldSetting() {
+ this.aTotalTickTime =
+ MathUtils.balance((int) mMCTEI.getTotalRuntimeInTicks(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aMaxParallel = mMCTEI.getMaxParallelRecipes();
+ this.aPollutionTick = mMCTEI.getPollutionPerTick(null);
+ this.aMaxInputVoltage =
+ MathUtils.balance((int) mMCTEI.getMaxInputVoltage(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aInputTier = MathUtils.balance((int) mMCTEI.getInputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aOutputTier = MathUtils.balance((int) mMCTEI.getOutputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ if (mMCTEI.mLastRecipe != null) {
+ GT_Recipe aRecipe = mMCTEI.mLastRecipe;
+ this.aRecipeDuration = MathUtils.balance(aRecipe.mDuration, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aRecipeEU = MathUtils.balance(aRecipe.mEUt, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aRecipeSpecial = MathUtils.balance(aRecipe.mSpecialValue, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ }
+ this.aPollutionReduction = mMCTEI.getPollutionReductionForAllMufflers();
- public void handleCraftingEvent(int aTimer, ICrafting aCrafter) {
- int aID = 750;
- if (aTimer % 500 == 10 || this.oTotalTickTime != this.aTotalTickTime) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aTotalTickTime);
- }
- if (aTimer % 500 == 10 || this.oMaxParallel != this.aMaxParallel) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxParallel);
- }
- if (aTimer % 500 == 10 || this.oPollutionTick != this.aPollutionTick) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionTick);
- }
- if (aTimer % 500 == 10 || this.oMaxInputVoltage != this.aMaxInputVoltage) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxInputVoltage);
- }
- if (aTimer % 500 == 10 || this.oInputTier != this.aInputTier) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aInputTier);
- }
- if (aTimer % 500 == 10 || this.oOutputTier != this.aOutputTier) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aOutputTier);
- }
- if (aTimer % 500 == 10 || this.oRecipeDuration != this.aRecipeDuration) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeDuration);
- }
- if (aTimer % 500 == 10 || this.oRecipeEU != this.aRecipeEU) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeEU);
- }
- if (aTimer % 500 == 10 || this.oRecipeSpecial != this.aRecipeSpecial) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeSpecial);
- }
- if (aTimer % 500 == 10 || this.oPollutionReduction != this.aPollutionReduction) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionReduction);
- }
- if (aTimer % 500 == 10 || this.oStoredEnergy != this.aStoredEnergy) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aStoredEnergy);
- }
- if (aTimer % 500 == 10 || this.oMaxEnergy != this.aMaxEnergy) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxEnergy);
- }
- if (aTimer % 500 == 10 || this.oEfficiency != this.aEfficiency) {
- aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aEfficiency);
- }
- }
+ this.aStoredEnergy = MathUtils.balance(
+ (int) mMCTEI.getStoredEnergyInAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aMaxEnergy = MathUtils.balance(
+ (int) mMCTEI.getMaxEnergyStorageOfAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aEfficiency = MathUtils.balance(mMCTEI.mEfficiency, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ }
- public void handleInternalFieldSetting() {
- this.oTotalTickTime = this.aTotalTickTime;
- this.oMaxParallel = this.aMaxParallel;
- this.oPollutionTick = this.aPollutionTick;
- this.oMaxInputVoltage = this.aMaxInputVoltage;
- this.oInputTier = this.aInputTier;
- this.oOutputTier = this.aOutputTier;
- this.oRecipeDuration = this.aRecipeDuration;
- this.oRecipeEU = this.aRecipeEU;
- this.oRecipeSpecial = this.aRecipeSpecial;
- this.oPollutionReduction = this.aPollutionReduction;
- this.oStoredEnergy = this.aStoredEnergy;
- this.oMaxEnergy = this.aMaxEnergy;
- this.oEfficiency = this.aEfficiency;
- }
+ public void handleCraftingEvent(int aTimer, ICrafting aCrafter) {
+ int aID = 750;
+ if (aTimer % 500 == 10 || this.oTotalTickTime != this.aTotalTickTime) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aTotalTickTime);
+ }
+ if (aTimer % 500 == 10 || this.oMaxParallel != this.aMaxParallel) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxParallel);
+ }
+ if (aTimer % 500 == 10 || this.oPollutionTick != this.aPollutionTick) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionTick);
+ }
+ if (aTimer % 500 == 10 || this.oMaxInputVoltage != this.aMaxInputVoltage) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxInputVoltage);
+ }
+ if (aTimer % 500 == 10 || this.oInputTier != this.aInputTier) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aInputTier);
+ }
+ if (aTimer % 500 == 10 || this.oOutputTier != this.aOutputTier) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aOutputTier);
+ }
+ if (aTimer % 500 == 10 || this.oRecipeDuration != this.aRecipeDuration) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeDuration);
+ }
+ if (aTimer % 500 == 10 || this.oRecipeEU != this.aRecipeEU) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeEU);
+ }
+ if (aTimer % 500 == 10 || this.oRecipeSpecial != this.aRecipeSpecial) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeSpecial);
+ }
+ if (aTimer % 500 == 10 || this.oPollutionReduction != this.aPollutionReduction) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionReduction);
+ }
+ if (aTimer % 500 == 10 || this.oStoredEnergy != this.aStoredEnergy) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aStoredEnergy);
+ }
+ if (aTimer % 500 == 10 || this.oMaxEnergy != this.aMaxEnergy) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxEnergy);
+ }
+ if (aTimer % 500 == 10 || this.oEfficiency != this.aEfficiency) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aEfficiency);
+ }
+ }
- @SideOnly(Side.CLIENT)
- @Override
- public void updateProgressBar(final int par1, final int par2) {
- super.updateProgressBar(par1, par2);
- int shiftedSwitch = par1 - 750;
- switch (shiftedSwitch) {
- case 0: {
- this.aTotalTickTime = par2;
- break;
- }
- case 1: {
- this.aMaxParallel = par2;
- break;
- }
- case 2: {
- this.aPollutionTick = par2;
- break;
- }
- case 3: {
- this.aMaxInputVoltage = par2;
- break;
- }
- case 4: {
- this.aInputTier = par2;
- break;
- }
- case 5: {
- this.aOutputTier = par2;
- break;
- }
- case 6: {
- this.aRecipeDuration = par2;
- break;
- }
- case 7: {
- this.aRecipeEU = par2;
- break;
- }
- case 8: {
- this.aRecipeSpecial = par2;
- break;
- }
- case 9: {
- this.aPollutionReduction = par2;
- break;
- }
- case 10: {
- this.aStoredEnergy = par2;
- break;
- }
- case 11: {
- this.aMaxEnergy = par2;
- break;
- }
- case 12: {
- this.aEfficiency = par2;
- break;
- }
- }
- }
+ public void handleInternalFieldSetting() {
+ this.oTotalTickTime = this.aTotalTickTime;
+ this.oMaxParallel = this.aMaxParallel;
+ this.oPollutionTick = this.aPollutionTick;
+ this.oMaxInputVoltage = this.aMaxInputVoltage;
+ this.oInputTier = this.aInputTier;
+ this.oOutputTier = this.aOutputTier;
+ this.oRecipeDuration = this.aRecipeDuration;
+ this.oRecipeEU = this.aRecipeEU;
+ this.oRecipeSpecial = this.aRecipeSpecial;
+ this.oPollutionReduction = this.aPollutionReduction;
+ this.oStoredEnergy = this.aStoredEnergy;
+ this.oMaxEnergy = this.aMaxEnergy;
+ this.oEfficiency = this.aEfficiency;
+ }
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void updateProgressBar(final int par1, final int par2) {
+ super.updateProgressBar(par1, par2);
+ int shiftedSwitch = par1 - 750;
+ switch (shiftedSwitch) {
+ case 0: {
+ this.aTotalTickTime = par2;
+ break;
+ }
+ case 1: {
+ this.aMaxParallel = par2;
+ break;
+ }
+ case 2: {
+ this.aPollutionTick = par2;
+ break;
+ }
+ case 3: {
+ this.aMaxInputVoltage = par2;
+ break;
+ }
+ case 4: {
+ this.aInputTier = par2;
+ break;
+ }
+ case 5: {
+ this.aOutputTier = par2;
+ break;
+ }
+ case 6: {
+ this.aRecipeDuration = par2;
+ break;
+ }
+ case 7: {
+ this.aRecipeEU = par2;
+ break;
+ }
+ case 8: {
+ this.aRecipeSpecial = par2;
+ break;
+ }
+ case 9: {
+ this.aPollutionReduction = par2;
+ break;
+ }
+ case 10: {
+ this.aStoredEnergy = par2;
+ break;
+ }
+ case 11: {
+ this.aMaxEnergy = par2;
+ break;
+ }
+ case 12: {
+ this.aEfficiency = par2;
+ break;
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java
index 2d63a13d60..579e0a7e1d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java
@@ -7,21 +7,25 @@ import net.minecraft.item.ItemStack;
public class CONTAINER_MultiMachine_NoPlayerInventory extends CONTAINER_MultiMachine {
- public CONTAINER_MultiMachine_NoPlayerInventory(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public CONTAINER_MultiMachine_NoPlayerInventory(
+ final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_MultiMachine_NoPlayerInventory(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
- public CONTAINER_MultiMachine_NoPlayerInventory(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
-
public boolean doesBindPlayerInventory() {
return false;
}
@Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
- return null;
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+ return null;
}
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java
index c42fa98cd3..f975539b83 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java
@@ -5,76 +5,81 @@ import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_Container_MultiMachine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.slots.SlotNoInput;
-import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.*;
public class CONTAINER_PowerSubStation extends GT_Container_MultiMachine {
- private final SyncedValueManager manager = new SyncedValueManager(21);
- public final SyncedLong mStoredEU = manager.allocateLong();
- public final SyncedLong mMaxStoredEU = manager.allocateLong();
- public final SyncedLong mAverageEuAdded = manager.allocateLong();
- public final SyncedLong mAverageEuConsumed = manager.allocateLong();
-
- public CONTAINER_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- public CONTAINER_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
-
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new Slot(this.mTileEntity, 1, 155, 5));
- this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 2, 155, 23));
-
- for (int i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 167)); }
-
- }
-
- @Override
- public boolean doesBindPlayerInventory() {
- return false;
- }
-
- public int getSlotCount() {
- return 10;
- }
-
- public int getShiftClickSlotCount() {
- return 1;
- }
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
-
- if (manager == null)
- // maybe not yet initialized
- // stupid java
- // ask greg why he wants to call a method that's definitely going to be overridden in subclass in constructor
- return;
-
- GregtechMetaTileEntity_PowerSubStationController aPSS = (GregtechMetaTileEntity_PowerSubStationController) mTileEntity.getMetaTileEntity();
- mStoredEU.setValue(mTileEntity.getStoredEU());
- mMaxStoredEU.setValue(mTileEntity.getEUCapacity());
- mAverageEuAdded.setValue(aPSS.getAverageEuAdded());
- mAverageEuConsumed.setValue(aPSS.getAverageEuConsumed());
-
- manager.detectAndSendChanges(this::sendProgressBarUpdate, mTimer);
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- manager.updateProgressBar(par1, par2);
- }
-
- private void sendProgressBarUpdate(int short1, int short2) {
- for (Object crafter : this.crafters) {
- ((ICrafting) crafter).sendProgressBarUpdate(this, short1, short2);
- }
- }
+ private final SyncedValueManager manager = new SyncedValueManager(21);
+ public final SyncedLong mStoredEU = manager.allocateLong();
+ public final SyncedLong mMaxStoredEU = manager.allocateLong();
+ public final SyncedLong mAverageEuAdded = manager.allocateLong();
+ public final SyncedLong mAverageEuConsumed = manager.allocateLong();
+
+ public CONTAINER_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_PowerSubStation(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
+
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new Slot(this.mTileEntity, 1, 155, 5));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 2, 155, 23));
+
+ for (int i = 0; i < 9; ++i) {
+ this.addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 167));
+ }
+ }
+
+ @Override
+ public boolean doesBindPlayerInventory() {
+ return false;
+ }
+
+ public int getSlotCount() {
+ return 10;
+ }
+
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+
+ if (manager == null)
+ // maybe not yet initialized
+ // stupid java
+ // ask greg why he wants to call a method that's definitely going to be overridden in subclass in
+ // constructor
+ return;
+
+ GregtechMetaTileEntity_PowerSubStationController aPSS =
+ (GregtechMetaTileEntity_PowerSubStationController) mTileEntity.getMetaTileEntity();
+ mStoredEU.setValue(mTileEntity.getStoredEU());
+ mMaxStoredEU.setValue(mTileEntity.getEUCapacity());
+ mAverageEuAdded.setValue(aPSS.getAverageEuAdded());
+ mAverageEuConsumed.setValue(aPSS.getAverageEuConsumed());
+
+ manager.detectAndSendChanges(this::sendProgressBarUpdate, mTimer);
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ manager.updateProgressBar(par1, par2);
+ }
+
+ private void sendProgressBarUpdate(int short1, int short2) {
+ for (Object crafter : this.crafters) {
+ ((ICrafting) crafter).sendProgressBarUpdate(this, short1, short2);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
index 9a84ba66ab..e317583413 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
@@ -1,57 +1,54 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.UUID;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaSafeBlock;
+import java.util.UUID;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
-public class CONTAINER_SafeBlock
-extends GT_ContainerMetaTile_Machine {
- public CONTAINER_SafeBlock(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- //public String UUID = ((BaseMetaTileEntity)mTileEntity).getMetaTileEntity().getBaseMetaTileEntity().getOwnerName();
- public UUID ownerUUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID;
- public String tempPlayer = PlayerCache.lookupPlayerByUUID(this.ownerUUID);
- public boolean blockStatus = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable;
-
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- for (int y = 0; y < 3; y++) {
- for (int x = 0; x < 9; x++) {
- this.addSlotToContainer(new Slot(this.mTileEntity, x + (y * 9), 8 + (x * 18), 5 + (y * 18)));
- }
- }
- this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 8, 63, false, true, 1));
- this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 26, 63, false, true, 1));
- this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1));
- }
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
- final int runs = 0;
- if (aSlotIndex < 27) {
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
- final Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
- if (tSlot != null) {
- if (this.mTileEntity.getMetaTileEntity() == null) {
- return null;
- }
- if (aSlotIndex == 27) {
-
+public class CONTAINER_SafeBlock extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_SafeBlock(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ // public String UUID =
+ // ((BaseMetaTileEntity)mTileEntity).getMetaTileEntity().getBaseMetaTileEntity().getOwnerName();
+ public UUID ownerUUID = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).ownerUUID;
+ public String tempPlayer = PlayerCache.lookupPlayerByUUID(this.ownerUUID);
+ public boolean blockStatus = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable;
+
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ for (int y = 0; y < 3; y++) {
+ for (int x = 0; x < 9; x++) {
+ this.addSlotToContainer(new Slot(this.mTileEntity, x + (y * 9), 8 + (x * 18), 5 + (y * 18)));
+ }
+ }
+ this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 8, 63, false, true, 1));
+ this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 26, 63, false, true, 1));
+ this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1));
+ }
+
+ @Override
+ public ItemStack slotClick(
+ final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+ final int runs = 0;
+ if (aSlotIndex < 27) {
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ final Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
+ if (tSlot != null) {
+ if (this.mTileEntity.getMetaTileEntity() == null) {
+ return null;
+ }
+ if (aSlotIndex == 27) {
- /*((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput);
+ /*((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput) {
if (aPlayer != null && aPlayer instanceof EntityPlayerMP && (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bOutput != false)) {
@@ -65,10 +62,9 @@ extends GT_ContainerMetaTile_Machine {
}
return null;*/
-
- }
- if (aSlotIndex == 28) {}
- /* ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
+ }
+ if (aSlotIndex == 28) {}
+ /* ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if no Slot is free");
} else {
@@ -76,7 +72,7 @@ extends GT_ContainerMetaTile_Machine {
}
return null;
}*/
- if (aSlotIndex == 29) /*{
+ if (aSlotIndex == 29) /*{
if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) {
if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) {
makeIndestructible(aPlayer);
@@ -88,37 +84,35 @@ extends GT_ContainerMetaTile_Machine {
makeIndestructible(aPlayer);
}
return null;
- }*/
-
- {
- ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable);
- this.blockStatus = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable;
- this.ownerUUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID;
- //Utils.messagePlayer(aPlayer, "Is the safe locked? "+String.valueOf(((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable).toUpperCase());
- /*if (aPlayer != null && aPlayer instanceof EntityPlayerMP && (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable != false)) {
- UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
- Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
- }
- else {
- UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
- Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
- }*/
- return null;
- }
-
-
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public int getSlotCount() {
- return 27;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 27;
- }
-
+ }*/ {
+
+ ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable =
+ (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable);
+ this.blockStatus = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable;
+ this.ownerUUID = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).ownerUUID;
+ // Utils.messagePlayer(aPlayer, "Is the safe locked? "+String.valueOf(((GregtechMetaSafeBlock)
+ // this.mTileEntity.getMetaTileEntity()).bUnbreakable).toUpperCase());
+ /*if (aPlayer != null && aPlayer instanceof EntityPlayerMP && (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable != false)) {
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
+ }
+ else {
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
+ }*/
+ return null;
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 27;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 27;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java
index a3f58836e3..93ba937f45 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java
@@ -1,85 +1,90 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntitySolarGenerator;
+import java.util.Iterator;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+
+public class CONTAINER_SolarGenerator extends GT_ContainerMetaTile_Machine {
+ public int mWaterAmount = 0;
+ public int mSteamAmount = 0;
+ public int mProcessingEnergy = 0;
+ public int mTemperature = 2;
-public class CONTAINER_SolarGenerator
-extends GT_ContainerMetaTile_Machine {
- public int mWaterAmount = 0;
- public int mSteamAmount = 0;
- public int mProcessingEnergy = 0;
- public int mTemperature = 2;
- public CONTAINER_SolarGenerator(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public CONTAINER_SolarGenerator(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- //addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
- //addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
- //addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
- //addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26));
- }
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ // addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
+ // addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
+ // addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
+ // addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26));
+ }
- @Override
- public int getSlotCount() {
- return 0;
- }
+ @Override
+ public int getSlotCount() {
+ return 0;
+ }
- @Override
- public int getShiftClickSlotCount() {
- return 0;
- }
+ @Override
+ public int getShiftClickSlotCount() {
+ return 0;
+ }
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
- return;
- }
- this.mTemperature = ((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).mSolarCharge;
- this.mProcessingEnergy = ((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
+ return;
+ }
+ this.mTemperature = ((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).mSolarCharge;
+ this.mProcessingEnergy =
+ ((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
- this.mTemperature = Math.min(54, Math.max(0, (this.mTemperature * 54) / (((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
- this.mEnergy = (int) Math.min(Integer.MAX_VALUE, this.mTileEntity.getStoredEU());
- this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, (this.mProcessingEnergy * 14) / 1000));
+ this.mTemperature = Math.min(
+ 54,
+ Math.max(
+ 0,
+ (this.mTemperature * 54)
+ / (((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity())
+ .maxProgresstime()
+ - 10)));
+ this.mEnergy = (int) Math.min(Integer.MAX_VALUE, this.mTileEntity.getStoredEU());
+ this.mProcessingEnergy =
+ Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, (this.mProcessingEnergy * 14) / 1000));
- final Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- final ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 100, this.mTemperature);
- var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy);
- var1.sendProgressBarUpdate(this, 102, this.mSteamAmount);
- var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
- }
- }
+ final Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ final ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 100, this.mTemperature);
+ var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy);
+ var1.sendProgressBarUpdate(this, 102, this.mSteamAmount);
+ var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
+ }
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(final int par1, final int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 100:
- this.mTemperature = par2;
- break;
- case 101:
- this.mProcessingEnergy = par2;
- break;
- case 102:
- this.mSteamAmount = par2;
- break;
- case 103:
- this.mWaterAmount = par2;
- }
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(final int par1, final int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ this.mTemperature = par2;
+ break;
+ case 101:
+ this.mProcessingEnergy = par2;
+ break;
+ case 102:
+ this.mSteamAmount = par2;
+ break;
+ case 103:
+ this.mWaterAmount = par2;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
index 6fcd53b139..361f24c4a1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
@@ -1,99 +1,100 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
-import net.minecraft.inventory.Slot;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechMetaBoilerBase;
+import java.util.Iterator;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.Slot;
-public class CONTAINER_SteamCondenser extends GT_ContainerMetaTile_Machine
-{
- public CONTAINER_SteamCondenser(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity)
- {
- super(aInventoryPlayer, aTileEntity);
- }
+public class CONTAINER_SteamCondenser extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_SteamCondenser(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer)
- {
- this.addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
- this.addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
- this.addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
- this.addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26));
- }
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26));
+ }
- @Override
- public int getSlotCount()
- {
- return 4;
- }
+ @Override
+ public int getSlotCount() {
+ return 4;
+ }
- @Override
- public int getShiftClickSlotCount()
- {
- return 1;
- }
+ @Override
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
- public int mWaterAmount = 0;
- public int mSteamAmount = 0;
- public int mProcessingEnergy = 0;
- public int mTemperature = 2;
- public long mTickingTime = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).RI;
+ public int mWaterAmount = 0;
+ public int mSteamAmount = 0;
+ public int mProcessingEnergy = 0;
+ public int mTemperature = 2;
+ public long mTickingTime = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).RI;
- @Override
- public void detectAndSendChanges()
- {
- super.detectAndSendChanges();
- if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
- return;
- }
- int steamCapacity = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).getSteamCapacity();
- int waterCapacity = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).getCapacity();
- this.mTemperature = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mTemperature;
- this.mProcessingEnergy = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
- this.mSteamAmount = (((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mSteam == null ? 0 : ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mSteam.amount);
- this.mWaterAmount = (((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mFluid == null ? 0 : ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mFluid.amount);
- this.mTickingTime = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).RI;
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
+ return;
+ }
+ int steamCapacity = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).getSteamCapacity();
+ int waterCapacity = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).getCapacity();
+ this.mTemperature = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mTemperature;
+ this.mProcessingEnergy = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
+ this.mSteamAmount = (((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mSteam == null
+ ? 0
+ : ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mSteam.amount);
+ this.mWaterAmount = (((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mFluid == null
+ ? 0
+ : ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mFluid.amount);
+ this.mTickingTime = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).RI;
- this.mTemperature = Math.min(54, Math.max(0, (this.mTemperature * 54) / (((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
- this.mSteamAmount = Math.min(54, Math.max(0, (this.mSteamAmount * 54) / (steamCapacity - 100)));
- this.mWaterAmount = Math.min(54, Math.max(0, (this.mWaterAmount * 54) / (waterCapacity - 100)));
- this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, (this.mProcessingEnergy * 14) / 1000));
+ this.mTemperature = Math.min(
+ 54,
+ Math.max(
+ 0,
+ (this.mTemperature * 54)
+ / (((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).maxProgresstime()
+ - 10)));
+ this.mSteamAmount = Math.min(54, Math.max(0, (this.mSteamAmount * 54) / (steamCapacity - 100)));
+ this.mWaterAmount = Math.min(54, Math.max(0, (this.mWaterAmount * 54) / (waterCapacity - 100)));
+ this.mProcessingEnergy =
+ Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, (this.mProcessingEnergy * 14) / 1000));
- final Iterator var2 = this.crafters.iterator();
- while (var2.hasNext())
- {
- final ICrafting var1 = (ICrafting)var2.next();
- var1.sendProgressBarUpdate(this, 100, this.mTemperature);
- var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy);
- var1.sendProgressBarUpdate(this, 102, this.mSteamAmount);
- var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
- }
- }
+ final Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ final ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 100, this.mTemperature);
+ var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy);
+ var1.sendProgressBarUpdate(this, 102, this.mSteamAmount);
+ var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
+ }
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(final int par1, final int par2)
- {
- super.updateProgressBar(par1, par2);
- switch (par1)
- {
- case 100:
- this.mTemperature = par2; break;
- case 101:
- this.mProcessingEnergy = par2; break;
- case 102:
- this.mSteamAmount = par2; break;
- case 103:
- this.mWaterAmount = par2;
- }
- }
-} \ No newline at end of file
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(final int par1, final int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ this.mTemperature = par2;
+ break;
+ case 101:
+ this.mProcessingEnergy = par2;
+ break;
+ case 102:
+ this.mSteamAmount = par2;
+ break;
+ case 103:
+ this.mWaterAmount = par2;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SuperChest.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SuperChest.java
index dcab57c380..65d4e46069 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SuperChest.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SuperChest.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
@@ -11,68 +9,67 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.slots.SlotLockedInput;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving.GT4Entity_Shelf_Large;
+import java.util.Iterator;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.item.ItemStack;
public class CONTAINER_SuperChest extends GT_ContainerMetaTile_Machine {
-
- public int mContent = 0;
- private ItemStack mLockedSlotStack = null;
- public CONTAINER_SuperChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public int mContent = 0;
+ private ItemStack mLockedSlotStack = null;
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new SlotLockedInput(this.mTileEntity, 0, 80, 17, mLockedSlotStack));
- this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 1, 80, 53));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 59, 42));
- }
+ public CONTAINER_SuperChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) {
- if (this.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_TieredChest) {
- this.mContent = ((GT_MetaTileEntity_TieredChest) this.mTileEntity.getMetaTileEntity()).mItemCount;
- mLockedSlotStack = ((GT_MetaTileEntity_TieredChest) this.mTileEntity.getMetaTileEntity()).mItemStack;
- }
- if (this.mTileEntity.getMetaTileEntity() instanceof GT4Entity_Shelf_Large) {
- this.mContent = ((GT4Entity_Shelf_Large) this.mTileEntity.getMetaTileEntity()).mItemCount;
- mLockedSlotStack = ((GT4Entity_Shelf_Large) this.mTileEntity.getMetaTileEntity()).mItemStack;
- }
- else {
- this.mContent = 0;
- }
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new SlotLockedInput(this.mTileEntity, 0, 80, 17, mLockedSlotStack));
+ this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 1, 80, 53));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 59, 42));
+ }
- Iterator var2 = this.crafters.iterator();
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) {
+ if (this.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_TieredChest) {
+ this.mContent = ((GT_MetaTileEntity_TieredChest) this.mTileEntity.getMetaTileEntity()).mItemCount;
+ mLockedSlotStack = ((GT_MetaTileEntity_TieredChest) this.mTileEntity.getMetaTileEntity()).mItemStack;
+ }
+ if (this.mTileEntity.getMetaTileEntity() instanceof GT4Entity_Shelf_Large) {
+ this.mContent = ((GT4Entity_Shelf_Large) this.mTileEntity.getMetaTileEntity()).mItemCount;
+ mLockedSlotStack = ((GT4Entity_Shelf_Large) this.mTileEntity.getMetaTileEntity()).mItemStack;
+ } else {
+ this.mContent = 0;
+ }
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 100, this.mContent & 65535);
- var1.sendProgressBarUpdate(this, 101, this.mContent >>> 16);
- }
- }
- }
+ Iterator var2 = this.crafters.iterator();
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 100 :
- this.mContent = this.mContent & -65536 | par2;
- break;
- case 101 :
- this.mContent = this.mContent & 65535 | par2 << 16;
- }
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 100, this.mContent & 65535);
+ var1.sendProgressBarUpdate(this, 101, this.mContent >>> 16);
+ }
+ }
+ }
- }
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ this.mContent = this.mContent & -65536 | par2;
+ break;
+ case 101:
+ this.mContent = this.mContent & 65535 | par2 << 16;
+ }
+ }
- public int getSlotCount() {
- return 2;
- }
+ public int getSlotCount() {
+ return 2;
+ }
- public int getShiftClickSlotCount() {
- return 1;
- }
-} \ No newline at end of file
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_TreeFarmer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_TreeFarmer.java
index bf4dffb904..5724ab6c04 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_TreeFarmer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_TreeFarmer.java
@@ -1,71 +1,72 @@
-
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.List;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.slots.SlotBuzzSaw;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntityTreeFarm;
+import java.util.List;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
public class CONTAINER_TreeFarmer extends GT_ContainerMetaTile_Machine {
- public long maxEU = 0;
- public long storedEU = 0;
-
- public CONTAINER_TreeFarmer(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public long maxEU = 0;
+ public long storedEU = 0;
- public CONTAINER_TreeFarmer(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
+ public CONTAINER_TreeFarmer(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new SlotBuzzSaw(this.mTileEntity, 1, 80, 17));
- }
+ public CONTAINER_TreeFarmer(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
- @Override
- public int getSlotCount() {
- return 1;
- }
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new SlotBuzzSaw(this.mTileEntity, 1, 80, 17));
+ }
- @Override
- public int getShiftClickSlotCount() {
- return 1;
- }
+ @Override
+ public int getSlotCount() {
+ return 1;
+ }
- @Override
- public void updateProgressBar(final int id, final int value) {
- super.updateProgressBar(id, value);
- switch (id) {
- case 100:
- this.maxEU = value;
- return;
- case 101:
- this.storedEU = value;
- break;
- default:
- break;
- }
- }
+ @Override
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
- @SuppressWarnings("unchecked")
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- for(final ICrafting crafting : (List<ICrafting>)this.crafters) {
- crafting.sendProgressBarUpdate(this, 100, (int) ((GregtechMetaTileEntityTreeFarm) this.mTileEntity.getMetaTileEntity()).maxEUStore());
- crafting.sendProgressBarUpdate(this, 101, (int) ((GregtechMetaTileEntityTreeFarm) this.mTileEntity.getMetaTileEntity()).getEUVar());
- if (((GregtechMetaTileEntityTreeFarm) this.mTileEntity.getMetaTileEntity()).isCorrectMachinePart(this.mTileEntity.getStackInSlot(1))){
- this.mTileEntity.markDirty();
- }
- }
- }
+ @Override
+ public void updateProgressBar(final int id, final int value) {
+ super.updateProgressBar(id, value);
+ switch (id) {
+ case 100:
+ this.maxEU = value;
+ return;
+ case 101:
+ this.storedEU = value;
+ break;
+ default:
+ break;
+ }
+ }
+ @SuppressWarnings("unchecked")
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ for (final ICrafting crafting : (List<ICrafting>) this.crafters) {
+ crafting.sendProgressBarUpdate(this, 100, (int)
+ ((GregtechMetaTileEntityTreeFarm) this.mTileEntity.getMetaTileEntity()).maxEUStore());
+ crafting.sendProgressBarUpdate(this, 101, (int)
+ ((GregtechMetaTileEntityTreeFarm) this.mTileEntity.getMetaTileEntity()).getEUVar());
+ if (((GregtechMetaTileEntityTreeFarm) this.mTileEntity.getMetaTileEntity())
+ .isCorrectMachinePart(this.mTileEntity.getStackInSlot(1))) {
+ this.mTileEntity.markDirty();
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedBoiler.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedBoiler.java
index d532a98030..a924e2a6a5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedBoiler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedBoiler.java
@@ -1,23 +1,21 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_AdvancedBoiler
- extends GT_GUIContainerMetaTile_Machine {
+public class GUI_AdvancedBoiler extends GT_GUIContainerMetaTile_Machine {
public GUI_AdvancedBoiler(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTextureName) {
super(new CONTAINER_AdvancedBoiler(aInventoryPlayer, aTileEntity), "miscutils:textures/gui/" + aTextureName);
}
@Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRendererObj.drawString("Advanced Boiler", 8, 4, 4210752);
}
@Override
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java
index 0be44fa616..b31bc7b24c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java
@@ -5,40 +5,45 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_Cyclotron extends GT_GUIContainerMetaTile_Machine
-{
+public class GUI_Cyclotron extends GT_GUIContainerMetaTile_Machine {
public final String mNEI;
public final String mName;
-
- public GUI_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aNEI) {
- super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity, false), "gregtech:textures/gui/multimachines/" + "FusionComputer.png");
+
+ public GUI_Cyclotron(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aNEI) {
+ super(
+ new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity, false),
+ "gregtech:textures/gui/multimachines/" + "FusionComputer.png");
this.mName = aName;
this.mNEI = aNEI;
}
-
+
@Override
protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
this.fontRendererObj.drawString(this.mName, 8, -10, 16448255);
if (this.mContainer != null) {
- if ((((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode & 0x40) != 0x0) {
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 0x40) != 0x0) {
this.fontRendererObj.drawString("Incomplete Structure.", 10, 8, 16448255);
}
- if (((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode == 0) {
- if (((GT_Container_MultiMachine)this.mContainer).mActive == 0) {
- this.fontRendererObj.drawString("Hit with Soft Hammer to (re-)start the Machine if it doesn't start.", -70, 170, 16448255);
- }
- else {
+ if (((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode == 0) {
+ if (((GT_Container_MultiMachine) this.mContainer).mActive == 0) {
+ this.fontRendererObj.drawString(
+ "Hit with Soft Hammer to (re-)start the Machine if it doesn't start.", -70, 170, 16448255);
+ } else {
this.fontRendererObj.drawString("Running perfectly.", 10, 170, 16448255);
}
- }
+ }
}
}
-
+
@Override
protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
final int x = (this.width - this.xSize) / 2;
final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java
index 77cb0d71a2..b42e2fae2f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java
@@ -1,11 +1,10 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.InventoryPlayer;
-
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
public class GUI_DataHatch extends GT_GUIContainerMetaTile_Machine {
@@ -16,7 +15,8 @@ public class GUI_DataHatch extends GT_GUIContainerMetaTile_Machine {
mName = aName;
}
- public GUI_DataHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ public GUI_DataHatch(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
super(new CONTAINER_DataHatch(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "HatchDataOrb.png");
mName = aName;
}
@@ -24,11 +24,11 @@ public class GUI_DataHatch extends GT_GUIContainerMetaTile_Machine {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
fontRendererObj.drawString(mName, 8, 4, 4210752);
- /*String[] aName = mName.trim().split("\\s+");
- int aY = 4;
- for (String s : aName) {
- fontRendererObj.drawString(s, 120, (aY += 12), 4210752);
- }*/
+ /*String[] aName = mName.trim().split("\\s+");
+ int aY = 4;
+ for (String s : aName) {
+ fontRendererObj.drawString(s, 120, (aY += 12), 4210752);
+ }*/
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java
index c6d8d4ef7e..0b851332b8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java
@@ -2,36 +2,38 @@ package gtPlusPlus.xmod.gregtech.api.gui;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.StatCollector;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.StatCollector;
public class GUI_DeluxeTank extends GT_GUIContainerMetaTile_Machine {
- private final String mName;
-
- public GUI_DeluxeTank(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName) {
- super(new CONTAINER_DeluxeTank(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "BasicTank.png");
- this.mName = aName;
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, (this.ySize - 96) + 2, 4210752);
- this.fontRendererObj.drawString(this.mName, 8, 6, 4210752);
- if (this.mContainer != null) {
- this.fontRendererObj.drawString("Fuel | A | B |", 10, 20, 16448255);
- //fontRendererObj.drawString(GT_Utility.parseNumberToString(((CONTAINER_DeluxeTank) mContainer).mContent), 10, 30, 16448255);
- }
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ private final String mName;
+
+ public GUI_DeluxeTank(
+ final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName) {
+ super(new CONTAINER_DeluxeTank(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "BasicTank.png");
+ this.mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(
+ StatCollector.translateToLocal("container.inventory"), 8, (this.ySize - 96) + 2, 4210752);
+ this.fontRendererObj.drawString(this.mName, 8, 6, 4210752);
+ if (this.mContainer != null) {
+ this.fontRendererObj.drawString("Fuel | A | B |", 10, 20, 16448255);
+ // fontRendererObj.drawString(GT_Utility.parseNumberToString(((CONTAINER_DeluxeTank) mContainer).mContent),
+ // 10, 30, 16448255);
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Hatch_Muffler_Advanced.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Hatch_Muffler_Advanced.java
index 4b998f6487..af0462b773 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Hatch_Muffler_Advanced.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Hatch_Muffler_Advanced.java
@@ -1,6 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
@@ -8,39 +7,45 @@ import net.minecraft.entity.player.InventoryPlayer;
public class GUI_Hatch_Muffler_Advanced extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
- long maxPower = 0;
- long storedPower = 0;
+ String mName = "";
+ long maxPower = 0;
+ long storedPower = 0;
- public GUI_Hatch_Muffler_Advanced(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
- super(new CONTAINER_Hatch_Muffler_Advanced(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
- }
+ public GUI_Hatch_Muffler_Advanced(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aTextureFile) {
+ super(
+ new CONTAINER_Hatch_Muffler_Advanced(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ this.mName = aName;
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 8, 8, 16448255);
- /*
- * ReflectionUtils.setField(this.fontRendererObj, "underlineStyle", true);
- * ReflectionUtils.setField(this.fontRendererObj, "italicStyle", true);
- * ReflectionUtils.setField(this.fontRendererObj, "boldStyle", true); boolean
- * isBold = ReflectionUtils.getField(this.fontRendererObj, "boldStyle");
- * this.fontRendererObj.drawString("Insert Air Filters - Bold: "+isBold, 8, 18,
- * 16448255);
- */
- if (this.mContainer != null) {
- //this.maxPower = ((CONTAINER_TreeFarmer)this.mContainer).maxEU;
- //this.storedPower = ((CONTAINER_TreeFarmer)this.mContainer).storedEU;
- }
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(this.mName, 8, 8, 16448255);
+ /*
+ * ReflectionUtils.setField(this.fontRendererObj, "underlineStyle", true);
+ * ReflectionUtils.setField(this.fontRendererObj, "italicStyle", true);
+ * ReflectionUtils.setField(this.fontRendererObj, "boldStyle", true); boolean
+ * isBold = ReflectionUtils.getField(this.fontRendererObj, "boldStyle");
+ * this.fontRendererObj.drawString("Insert Air Filters - Bold: "+isBold, 8, 18,
+ * 16448255);
+ */
+ if (this.mContainer != null) {
+ // this.maxPower = ((CONTAINER_TreeFarmer)this.mContainer).maxEU;
+ // this.storedPower = ((CONTAINER_TreeFarmer)this.mContainer).storedEU;
+ }
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- //this.maxPower = ((CONTAINER_TreeFarmer)this.mContainer).maxEU;
- //this.storedPower = ((CONTAINER_TreeFarmer)this.mContainer).storedEU;
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ // this.maxPower = ((CONTAINER_TreeFarmer)this.mContainer).maxEU;
+ // this.storedPower = ((CONTAINER_TreeFarmer)this.mContainer).storedEU;
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
index 2e1f76f362..d28e46b1d9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
@@ -1,73 +1,74 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.lib.CORE;
-
+import net.minecraft.entity.player.InventoryPlayer;
public class GUI_IndustrialCentrifuge extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
- private short counter = 0;
+ String mName = "";
+ private short counter = 0;
- public GUI_IndustrialCentrifuge(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
- super(new CONTAINER_IndustrialCentrifuge(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
- }
+ public GUI_IndustrialCentrifuge(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aTextureFile) {
+ super(
+ new CONTAINER_IndustrialCentrifuge(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ this.mName = aName;
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
- if (this.counter >= 100){
- this.counter = 0;
- }
- else {
- this.counter++;
- }
- if (this.mContainer != null) {
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 1) != 0) {
- this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 2) != 0) {
- this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 4) != 0) {
- this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 8) != 0) {
- this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 32) != 0) {
- this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
+ if (this.counter >= 100) {
+ this.counter = 0;
+ } else {
+ this.counter++;
+ }
+ if (this.mContainer != null) {
+ if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 1) != 0) {
+ this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
+ }
+ if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 2) != 0) {
+ this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
+ }
+ if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 4) != 0) {
+ this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
+ }
+ if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 8) != 0) {
+ this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
+ }
+ if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 32) != 0) {
+ this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
+ }
+ if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 64) != 0) {
+ this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
+ }
- if (((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode == 0) {
- if (((CONTAINER_IndustrialCentrifuge) this.mContainer).mActive == 0) {
- this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
- this.fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
- this.fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
- } else {
- this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
- /*if (CORE.DEBUG){
- fontRendererObj.drawString("Debug Counter: "+counter, 10, 56, 16448255);
- }*/
- }
- }
- }
- }
+ if (((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode == 0) {
+ if (((CONTAINER_IndustrialCentrifuge) this.mContainer).mActive == 0) {
+ this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
+ this.fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
+ this.fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
+ } else {
+ this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
+ /*if (CORE.DEBUG){
+ fontRendererObj.drawString("Debug Counter: "+counter, 10, 56, 16448255);
+ }*/
+ }
+ }
+ }
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
index b44ad916b7..409e7a29ae 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
@@ -1,32 +1,44 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_IronBlastFurnace
-extends GT_GUIContainerMetaTile_Machine {
- public GUI_IronBlastFurnace(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(new CONTAINER_IronBlastFurnace(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI+"IronBlastFurnace.png");
- }
+public class GUI_IronBlastFurnace extends GT_GUIContainerMetaTile_Machine {
+ public GUI_IronBlastFurnace(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(
+ new CONTAINER_IronBlastFurnace(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + "IronBlastFurnace.png");
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString("Iron Blast Furnace", 8, 4, 4210752);
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString("Iron Blast Furnace", 8, 4, 4210752);
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if ((this.mContainer != null) &&
- (this.mContainer.mProgressTime > 0)) {
- this.drawTexturedModalRect(x + 58, y + 28, 176, 0, Math.max(0, Math.min(20, 1 + ((this.mContainer.mProgressTime * 20) / (this.mContainer.mMaxProgressTime < 1 ? 1 : this.mContainer.mMaxProgressTime)))), 11);
- }
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if ((this.mContainer != null) && (this.mContainer.mProgressTime > 0)) {
+ this.drawTexturedModalRect(
+ x + 58,
+ y + 28,
+ 176,
+ 0,
+ Math.max(
+ 0,
+ Math.min(
+ 20,
+ 1
+ + ((this.mContainer.mProgressTime * 20)
+ / (this.mContainer.mMaxProgressTime < 1
+ ? 1
+ : this.mContainer.mMaxProgressTime)))),
+ 11);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java
index f7869bff60..9dc0c8b9e2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java
@@ -1,12 +1,9 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -17,78 +14,82 @@ import gtPlusPlus.core.lib.CORE;
*/
public class GUI_MatterFab extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
- public int mMatterProduced = 0;
- public int mScrapProduced = 0;
- public int mAmplifierProduced = 0;
- public int mScrapUsed = 0;
- public int mAmplifierUsed = 0;
+ String mName = "";
+ public int mMatterProduced = 0;
+ public int mScrapProduced = 0;
+ public int mAmplifierProduced = 0;
+ public int mScrapUsed = 0;
+ public int mAmplifierUsed = 0;
+
+ public GUI_MatterFab(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aTextureFile) {
+ super(
+ new CONTAINER_MatterFab(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ this.mName = aName;
+ }
- public GUI_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
- super(new CONTAINER_MatterFab(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
+ if (this.mContainer != null) {
+ if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 1) != 0) {
+ this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
+ }
+ if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 2) != 0) {
+ this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
+ }
+ if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 4) != 0) {
+ this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
+ }
+ if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 8) != 0) {
+ this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
+ }
+ if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 16) != 0) {
+ this.fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
+ }
+ if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 32) != 0) {
+ this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
+ }
+ if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 64) != 0) {
+ this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
+ }
+ if (((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode == 0) {
+ if (((CONTAINER_MatterFab) this.mContainer).mActive == 0) {
+ this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
+ this.fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
+ this.fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
+ } else {
+ CONTAINER_MatterFab aContainer = (CONTAINER_MatterFab) this.mContainer;
+ this.mMatterProduced = aContainer.mMatterProduced;
+ this.mAmplifierProduced = aContainer.mAmplifierProduced;
+ this.mAmplifierUsed = aContainer.mAmplifierUsed;
+ this.mScrapProduced = aContainer.mScrapProduced;
+ this.mScrapUsed = aContainer.mScrapUsed;
- if (this.mContainer != null) {
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 1) != 0) {
- this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 2) != 0) {
- this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 4) != 0) {
- this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 8) != 0) {
- this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 16) != 0) {
- this.fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 32) != 0) {
- this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
- }
+ this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
- if (((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode == 0) {
- if (((CONTAINER_MatterFab) this.mContainer).mActive == 0) {
- this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
- this.fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
- this.fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
- } else {
- CONTAINER_MatterFab aContainer = (CONTAINER_MatterFab) this.mContainer;
-
- this.mMatterProduced = aContainer.mMatterProduced;
- this.mAmplifierProduced = aContainer.mAmplifierProduced;
- this.mAmplifierUsed = aContainer.mAmplifierUsed;
- this.mScrapProduced = aContainer.mScrapProduced;
- this.mScrapUsed = aContainer.mScrapUsed;
-
- this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
-
- this.fontRendererObj.drawString("Scrap Made: "+this.mScrapProduced, 10, 32, 16448255);
- this.fontRendererObj.drawString("Scrap Used: "+this.mScrapUsed, 10, 40, 16448255);
- this.fontRendererObj.drawString("UUA Made: "+this.mAmplifierProduced, 10, 48, 16448255);
- this.fontRendererObj.drawString("UUA Used: "+this.mAmplifierUsed, 10, 56, 16448255);
- this.fontRendererObj.drawString("UUM Made: "+this.mMatterProduced, 10, 64, 16448255);
- }
- }
- }
- }
+ this.fontRendererObj.drawString("Scrap Made: " + this.mScrapProduced, 10, 32, 16448255);
+ this.fontRendererObj.drawString("Scrap Used: " + this.mScrapUsed, 10, 40, 16448255);
+ this.fontRendererObj.drawString("UUA Made: " + this.mAmplifierProduced, 10, 48, 16448255);
+ this.fontRendererObj.drawString("UUA Used: " + this.mAmplifierUsed, 10, 56, 16448255);
+ this.fontRendererObj.drawString("UUM Made: " + this.mMatterProduced, 10, 64, 16448255);
+ }
+ }
+ }
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
index 61cf59f6c9..7322570bab 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
@@ -1,12 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeUnit;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
@@ -16,6 +9,11 @@ import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -31,278 +29,330 @@ import net.minecraft.util.StatCollector;
*/
public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine {
- private final static Materials GOOD;
- private final static Materials BAD;
- private final String mName;
-
- private final static ConcurrentHashMap<String, ItemStack> mToolStacks = new ConcurrentHashMap<String, ItemStack>();
-
- //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
- private final static Method mDrawItemStack;
-
- static {
- GOOD = Materials.Uranium;
- BAD = Materials.Plutonium;
-
- //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
- mDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class});
- }
-
- public GUI_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
- super(new CONTAINER_MultiMachine_NoPlayerInventory(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName != null ? aName : "";
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- if (this.mContainer != null) {
- drawGuiInfoTextLayer(par1, par2);
- drawGuiRepairStatusLayer(par1, par2);
- }
- }
-
-
- protected void drawGuiInfoTextLayer(final float par1, final int par2) {
-
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString(mName, 6, 7, 16448255); // Move down 8px
- this.fontRendererObj.drawString("Incomplete Structure.", 6, 15, 16448255); // Move down 8px
- }
- else {
- int aTotalTickTime = ((CONTAINER_MultiMachine) this.mContainer).aTotalTickTime;
- int aMaxParallel = ((CONTAINER_MultiMachine) this.mContainer).aMaxParallel;
- int aPollutionTick = ((CONTAINER_MultiMachine) this.mContainer).aPollutionTick;
- int aMaxInputVoltage = ((CONTAINER_MultiMachine) this.mContainer).aMaxInputVoltage;
- int aInputTier = ((CONTAINER_MultiMachine) this.mContainer).aInputTier;
- int aOutputTier = ((CONTAINER_MultiMachine) this.mContainer).aOutputTier;
- int aRecipeDuration = ((CONTAINER_MultiMachine) this.mContainer).aRecipeDuration;
- int aRecipeEU = ((CONTAINER_MultiMachine) this.mContainer).aRecipeEU;
- int aRecipeSpecial = ((CONTAINER_MultiMachine) this.mContainer).aRecipeSpecial;
- int aEfficiency = ((CONTAINER_MultiMachine) this.mContainer).aEfficiency;
-
- int aPollutionReduction = ((CONTAINER_MultiMachine) this.mContainer).aPollutionReduction;
-
-
- long aStoredEnergy = ((CONTAINER_MultiMachine) this.mContainer).aStoredEnergy;
- long aMaxEnergy = ((CONTAINER_MultiMachine) this.mContainer).aMaxEnergy;
-
- /*
- * Logic Block
- */
-
- long seconds = (aTotalTickTime/20);
- int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7);
- int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks);
- long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7*weeks);
- long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
- long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60);
-
- ArrayList<String> mInfo = new ArrayList<String>();
-
- String EU = StatCollector.translateToLocal("GTPP.info.eu");
-
- //GTPP.machines.tier
-
- mInfo.add(mName);
-
- if (aInputTier > 0) {
- mInfo.add(StatCollector.translateToLocal("GTPP.machines.input")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aInputTier]);
- }
- if (aOutputTier > 0) {
- mInfo.add(StatCollector.translateToLocal("GTPP.machines.output")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aOutputTier]);
- }
-
-
-
-
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+
- EnumChatFormatting.GREEN + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mProgressTime/20) + EnumChatFormatting.RESET +" s / "+
- EnumChatFormatting.YELLOW + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mMaxProgressTime/20) + EnumChatFormatting.RESET +" s");
-
-
-
-
-
-
-
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+":");
- mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Long.toString(aStoredEnergy) + EnumChatFormatting.RESET +" EU / "+
- EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy) + EnumChatFormatting.RESET +" EU"));
-
- if (aRecipeEU != 0 && aRecipeDuration > 0) {
- if (aRecipeEU > 0) {
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+":");
- mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.RED + Integer.toString(-aRecipeEU) + EnumChatFormatting.RESET + " EU/t/parallel"));
- }
- else {
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.generation")+":");
- mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Integer.toString(aRecipeEU) + EnumChatFormatting.RESET + " EU/t/parallel"));
- }
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.duration")+": "+
- EnumChatFormatting.RED + Integer.toString(aRecipeDuration) + EnumChatFormatting.RESET + " ticks");
- if (aRecipeSpecial > 0) {
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.specialvalue")+": "+
- EnumChatFormatting.RED + Integer.toString(aRecipeEU) + EnumChatFormatting.RESET + "");
- }
- }
-
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+":");
- mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.YELLOW+Long.toString(aMaxInputVoltage)+EnumChatFormatting.RESET+ " EU/t(*2A) "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+
- EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]+ EnumChatFormatting.RESET));
-
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+ EnumChatFormatting.YELLOW+Float.toString(aEfficiency / 100.0F)+EnumChatFormatting.RESET + " %");
-
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + (aPollutionTick*20)+ EnumChatFormatting.RESET+"/sec");
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + aPollutionReduction + EnumChatFormatting.RESET+" %");
-
- //mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET);
-
- mInfo.add("Total Time Since Built: ");
- mInfo.add("" + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks,");
- mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Integer.toString(days) +EnumChatFormatting.RESET+ " Days,");
- mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(hours) +EnumChatFormatting.RESET+ " Hours,");
- mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(minutes) +EnumChatFormatting.RESET+ " Minutes,");
- mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(second) +EnumChatFormatting.RESET+ " Seconds");
-
-
-
- // Machine Name
- //fontRendererObj.drawString(this.mName, 6, 7, 16448255);
-
- for (int i=0;i<mInfo.size();i++) {
- fontRendererObj.drawString(mInfo.get(i), 6, 7+(i*8), 16448255);
- }
-
- }
-
-
-
-
- }
-
-
- protected void drawGuiRepairStatusLayer(final float par1, final int par2) {
-
- boolean aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0;
- boolean aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0;
- boolean aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0;
- boolean aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0;
- boolean aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0;
- boolean aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0;
-
- if (mToolStacks.isEmpty()) {
- // Map Stacks of Repair items
- aWrench = false;
- aScrewdriver = false;
- aMallet = false;
- aHammer = false;
- aSoldering = false;
- aCrowbar = false;
- mToolStacks.put(aWrench+"WRENCH", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aCrowbar+"CROWBAR", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aHammer+"HARDHAMMER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aMallet+"SOFTHAMMER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aScrewdriver+"SCREWDRIVER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, (aScrewdriver ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aSoldering+"SOLDERING_IRON_LV", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, (aSoldering ? BAD : GOOD), Materials.Tungsten, null));
-
- // Map Stacks of valid items
- aWrench = true;
- aScrewdriver = true;
- aMallet = true;
- aHammer = true;
- aSoldering = true;
- aCrowbar = true;
- mToolStacks.put(aWrench+"WRENCH", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aCrowbar+"CROWBAR", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aHammer+"HARDHAMMER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aMallet+"SOFTHAMMER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aScrewdriver+"SCREWDRIVER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, (aScrewdriver ? BAD : GOOD), Materials.Tungsten, null));
- mToolStacks.put(aSoldering+"SOLDERING_IRON_LV", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, (aSoldering ? BAD : GOOD), Materials.Tungsten, null));
-
- ItemStack aGlassPane1 = ItemUtils.getItemStackOfAmountFromOreDict("paneGlassRed", 1);
- ItemStack aGlassPane2 = ItemUtils.getItemStackOfAmountFromOreDict("paneGlassLime", 1);
- mToolStacks.put("falseGLASS", aGlassPane1);
- mToolStacks.put("trueGLASS", aGlassPane2);
-
- // Reset vars to real state
- aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0;
- aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0;
- aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0;
- aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0;
- aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0;
- aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0;
-
- }
-
- ItemStack aWrenchStack;
- ItemStack aCrowbarStack;
- ItemStack aHammerStack;
- ItemStack aMalletStack;
- ItemStack aScrewdriverStack;
- ItemStack aSolderingStack;
- if (!mToolStacks.isEmpty() && mDrawItemStack != null) {
-
- aWrenchStack = mToolStacks.get(aWrench + "WRENCH");
- aCrowbarStack = mToolStacks.get(aCrowbar + "CROWBAR");
- aHammerStack = mToolStacks.get(aHammer + "HARDHAMMER");
- aMalletStack = mToolStacks.get(aMallet + "SOFTHAMMER");
- aScrewdriverStack = mToolStacks.get(aScrewdriver + "SCREWDRIVER");
- aSolderingStack = mToolStacks.get(aSoldering + "SOLDERING_IRON_LV");
-
- try {
-
- ItemStack[] aToolStacks2 = new ItemStack[] {
- aWrenchStack, aCrowbarStack,
- aHammerStack, aMalletStack,
- aScrewdriverStack, aSolderingStack };
-
- int aIndex = 0;
- //Draw Repair status tools
- for (aIndex = 0; aIndex < 6; aIndex++) {
- int x = 156;
- int y = 112 - (18 * 3) + (aIndex * 18);
- mDrawItemStack.invoke(this,
- new Object[] {
- aToolStacks2[aIndex] != null ? aToolStacks2[aIndex]
- : ItemUtils.getErrorStack(1, "Bad Times"),
- x, y, "" + (aIndex == 2 ? "H" : aIndex == 3 ? "M" : "") // Stacksize Overlay
- });
- //this.fontRendererObj.drawString("", 10, 64, 16448255);
- }
-
- //Draw Running status
- boolean running = ((CONTAINER_MultiMachine) this.mContainer).mActive != 0;
- ItemStack aGlassPane = mToolStacks.get(running+"GLASS");
-
- if (aGlassPane == null) {
- aGlassPane = ItemUtils.getItemStackOfAmountFromOreDict("paneGlass" + (running ? "Lime" : "Red"), 1);
- mToolStacks.put(running+"GLASS", aGlassPane);
- }
-
- mDrawItemStack.invoke(this,
- new Object[] {
- aGlassPane != null ? aGlassPane
- : ItemUtils.getErrorStack(1, "Bad Times"),
- 156,
- 112 - (18 * 5),
- running ? "On" : "Off"}); // Stacksize Overlay
-
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- }
-
-
-
-
- }
-
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ private static final Materials GOOD;
+ private static final Materials BAD;
+ private final String mName;
+
+ private static final ConcurrentHashMap<String, ItemStack> mToolStacks = new ConcurrentHashMap<String, ItemStack>();
+
+ // net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
+ private static final Method mDrawItemStack;
+
+ static {
+ GOOD = Materials.Uranium;
+ BAD = Materials.Plutonium;
+
+ // net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
+ mDrawItemStack = ReflectionUtils.getMethod(
+ GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class});
+ }
+
+ public GUI_MultiMachine(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aTextureFile) {
+ super(
+ new CONTAINER_MultiMachine_NoPlayerInventory(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ this.mName = aName != null ? aName : "";
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ if (this.mContainer != null) {
+ drawGuiInfoTextLayer(par1, par2);
+ drawGuiRepairStatusLayer(par1, par2);
+ }
+ }
+
+ protected void drawGuiInfoTextLayer(final float par1, final int par2) {
+
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
+ this.fontRendererObj.drawString(mName, 6, 7, 16448255); // Move down 8px
+ this.fontRendererObj.drawString("Incomplete Structure.", 6, 15, 16448255); // Move down 8px
+ } else {
+ int aTotalTickTime = ((CONTAINER_MultiMachine) this.mContainer).aTotalTickTime;
+ int aMaxParallel = ((CONTAINER_MultiMachine) this.mContainer).aMaxParallel;
+ int aPollutionTick = ((CONTAINER_MultiMachine) this.mContainer).aPollutionTick;
+ int aMaxInputVoltage = ((CONTAINER_MultiMachine) this.mContainer).aMaxInputVoltage;
+ int aInputTier = ((CONTAINER_MultiMachine) this.mContainer).aInputTier;
+ int aOutputTier = ((CONTAINER_MultiMachine) this.mContainer).aOutputTier;
+ int aRecipeDuration = ((CONTAINER_MultiMachine) this.mContainer).aRecipeDuration;
+ int aRecipeEU = ((CONTAINER_MultiMachine) this.mContainer).aRecipeEU;
+ int aRecipeSpecial = ((CONTAINER_MultiMachine) this.mContainer).aRecipeSpecial;
+ int aEfficiency = ((CONTAINER_MultiMachine) this.mContainer).aEfficiency;
+
+ int aPollutionReduction = ((CONTAINER_MultiMachine) this.mContainer).aPollutionReduction;
+
+ long aStoredEnergy = ((CONTAINER_MultiMachine) this.mContainer).aStoredEnergy;
+ long aMaxEnergy = ((CONTAINER_MultiMachine) this.mContainer).aMaxEnergy;
+
+ /*
+ * Logic Block
+ */
+
+ long seconds = (aTotalTickTime / 20);
+ int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7);
+ int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks);
+ long hours =
+ TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7 * weeks);
+ long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
+ long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60);
+
+ ArrayList<String> mInfo = new ArrayList<String>();
+
+ String EU = StatCollector.translateToLocal("GTPP.info.eu");
+
+ // GTPP.machines.tier
+
+ mInfo.add(mName);
+
+ if (aInputTier > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.machines.input") + " "
+ + StatCollector.translateToLocal("GTPP.machines.tier") + ": " + EnumChatFormatting.GREEN
+ + GT_Values.VOLTAGE_NAMES[aInputTier]);
+ }
+ if (aOutputTier > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.machines.output") + " "
+ + StatCollector.translateToLocal("GTPP.machines.tier") + ": " + EnumChatFormatting.GREEN
+ + GT_Values.VOLTAGE_NAMES[aOutputTier]);
+ }
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress") + ": " + EnumChatFormatting.GREEN
+ + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mProgressTime / 20)
+ + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW
+ + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mMaxProgressTime / 20)
+ + EnumChatFormatting.RESET + " s");
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy") + ":");
+ mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.GREEN + Long.toString(aStoredEnergy)
+ + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy)
+ + EnumChatFormatting.RESET + " EU"));
+
+ if (aRecipeEU != 0 && aRecipeDuration > 0) {
+ if (aRecipeEU > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage") + ":");
+ mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.RED + Integer.toString(-aRecipeEU)
+ + EnumChatFormatting.RESET + " EU/t/parallel"));
+ } else {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.generation") + ":");
+ mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.GREEN + Integer.toString(aRecipeEU)
+ + EnumChatFormatting.RESET + " EU/t/parallel"));
+ }
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.duration") + ": " + EnumChatFormatting.RED
+ + Integer.toString(aRecipeDuration) + EnumChatFormatting.RESET + " ticks");
+ if (aRecipeSpecial > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.specialvalue") + ": "
+ + EnumChatFormatting.RED + Integer.toString(aRecipeEU) + EnumChatFormatting.RESET + "");
+ }
+ }
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei") + ":");
+ mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.YELLOW + Long.toString(aMaxInputVoltage)
+ + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GTPP.machines.tier")
+ + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]
+ + EnumChatFormatting.RESET));
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW
+ + Float.toString(aEfficiency / 100.0F) + EnumChatFormatting.RESET + " %");
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution") + ": " + EnumChatFormatting.RED
+ + (aPollutionTick * 20) + EnumChatFormatting.RESET + "/sec");
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced") + ": "
+ + EnumChatFormatting.GREEN + aPollutionReduction + EnumChatFormatting.RESET + " %");
+
+ // mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+":
+ // "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET);
+
+ mInfo.add("Total Time Since Built: ");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks) + EnumChatFormatting.RESET
+ + " Weeks,");
+ mInfo.add(
+ "" + EnumChatFormatting.DARK_GREEN + Integer.toString(days) + EnumChatFormatting.RESET + " Days,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN + Long.toString(hours) + EnumChatFormatting.RESET + " Hours,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN + Long.toString(minutes) + EnumChatFormatting.RESET
+ + " Minutes,");
+ mInfo.add(
+ "" + EnumChatFormatting.DARK_GREEN + Long.toString(second) + EnumChatFormatting.RESET + " Seconds");
+
+ // Machine Name
+ // fontRendererObj.drawString(this.mName, 6, 7, 16448255);
+
+ for (int i = 0; i < mInfo.size(); i++) {
+ fontRendererObj.drawString(mInfo.get(i), 6, 7 + (i * 8), 16448255);
+ }
+ }
+ }
+
+ protected void drawGuiRepairStatusLayer(final float par1, final int par2) {
+
+ boolean aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0;
+ boolean aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0;
+ boolean aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0;
+ boolean aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0;
+ boolean aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0;
+ boolean aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0;
+
+ if (mToolStacks.isEmpty()) {
+ // Map Stacks of Repair items
+ aWrench = false;
+ aScrewdriver = false;
+ aMallet = false;
+ aHammer = false;
+ aSoldering = false;
+ aCrowbar = false;
+ mToolStacks.put(
+ aWrench + "WRENCH",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(
+ aCrowbar + "CROWBAR",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(
+ aHammer + "HARDHAMMER",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(
+ aMallet + "SOFTHAMMER",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(
+ aScrewdriver + "SCREWDRIVER",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.SCREWDRIVER,
+ 1,
+ (aScrewdriver ? BAD : GOOD),
+ Materials.Tungsten,
+ null));
+ mToolStacks.put(
+ aSoldering + "SOLDERING_IRON_LV",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV,
+ 1,
+ (aSoldering ? BAD : GOOD),
+ Materials.Tungsten,
+ null));
+
+ // Map Stacks of valid items
+ aWrench = true;
+ aScrewdriver = true;
+ aMallet = true;
+ aHammer = true;
+ aSoldering = true;
+ aCrowbar = true;
+ mToolStacks.put(
+ aWrench + "WRENCH",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(
+ aCrowbar + "CROWBAR",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(
+ aHammer + "HARDHAMMER",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(
+ aMallet + "SOFTHAMMER",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(
+ aScrewdriver + "SCREWDRIVER",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.SCREWDRIVER,
+ 1,
+ (aScrewdriver ? BAD : GOOD),
+ Materials.Tungsten,
+ null));
+ mToolStacks.put(
+ aSoldering + "SOLDERING_IRON_LV",
+ GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV,
+ 1,
+ (aSoldering ? BAD : GOOD),
+ Materials.Tungsten,
+ null));
+
+ ItemStack aGlassPane1 = ItemUtils.getItemStackOfAmountFromOreDict("paneGlassRed", 1);
+ ItemStack aGlassPane2 = ItemUtils.getItemStackOfAmountFromOreDict("paneGlassLime", 1);
+ mToolStacks.put("falseGLASS", aGlassPane1);
+ mToolStacks.put("trueGLASS", aGlassPane2);
+
+ // Reset vars to real state
+ aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0;
+ aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0;
+ aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0;
+ aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0;
+ aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0;
+ aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0;
+ }
+
+ ItemStack aWrenchStack;
+ ItemStack aCrowbarStack;
+ ItemStack aHammerStack;
+ ItemStack aMalletStack;
+ ItemStack aScrewdriverStack;
+ ItemStack aSolderingStack;
+ if (!mToolStacks.isEmpty() && mDrawItemStack != null) {
+
+ aWrenchStack = mToolStacks.get(aWrench + "WRENCH");
+ aCrowbarStack = mToolStacks.get(aCrowbar + "CROWBAR");
+ aHammerStack = mToolStacks.get(aHammer + "HARDHAMMER");
+ aMalletStack = mToolStacks.get(aMallet + "SOFTHAMMER");
+ aScrewdriverStack = mToolStacks.get(aScrewdriver + "SCREWDRIVER");
+ aSolderingStack = mToolStacks.get(aSoldering + "SOLDERING_IRON_LV");
+
+ try {
+
+ ItemStack[] aToolStacks2 = new ItemStack[] {
+ aWrenchStack, aCrowbarStack,
+ aHammerStack, aMalletStack,
+ aScrewdriverStack, aSolderingStack
+ };
+
+ int aIndex = 0;
+ // Draw Repair status tools
+ for (aIndex = 0; aIndex < 6; aIndex++) {
+ int x = 156;
+ int y = 112 - (18 * 3) + (aIndex * 18);
+ mDrawItemStack.invoke(this, new Object[] {
+ aToolStacks2[aIndex] != null ? aToolStacks2[aIndex] : ItemUtils.getErrorStack(1, "Bad Times"),
+ x,
+ y,
+ "" + (aIndex == 2 ? "H" : aIndex == 3 ? "M" : "") // Stacksize Overlay
+ });
+ // this.fontRendererObj.drawString("", 10, 64, 16448255);
+ }
+
+ // Draw Running status
+ boolean running = ((CONTAINER_MultiMachine) this.mContainer).mActive != 0;
+ ItemStack aGlassPane = mToolStacks.get(running + "GLASS");
+
+ if (aGlassPane == null) {
+ aGlassPane = ItemUtils.getItemStackOfAmountFromOreDict("paneGlass" + (running ? "Lime" : "Red"), 1);
+ mToolStacks.put(running + "GLASS", aGlassPane);
+ }
+
+ mDrawItemStack.invoke(this, new Object[] {
+ aGlassPane != null ? aGlassPane : ItemUtils.getErrorStack(1, "Bad Times"),
+ 156,
+ 112 - (18 * 5),
+ running ? "On" : "Off"
+ }); // Stacksize Overlay
+
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java
index 0cfab4e71e..cfc2c10ef5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java
@@ -6,58 +6,62 @@ import gregtech.api.util.GT_LanguageManager;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_MultiMachine_Default extends GT_GUIContainerMetaTile_Machine
-{
+public class GUI_MultiMachine_Default extends GT_GUIContainerMetaTile_Machine {
String mName;
-
- public GUI_MultiMachine_Default(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
- super(new CONTAINER_MultiMachine(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + ((aTextureFile == null) ? "MultiblockDisplay" : aTextureFile));
+
+ public GUI_MultiMachine_Default(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aTextureFile) {
+ super(
+ new CONTAINER_MultiMachine(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + ((aTextureFile == null) ? "MultiblockDisplay" : aTextureFile));
this.mName = "";
this.mName = aName;
}
-
+
@Override
protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
if (this.mContainer != null) {
- if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x1) != 0x0) {
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 0x1) != 0x0) {
this.fontRendererObj.drawString(this.trans("132", "Pipe is loose."), 10, 16, 16448255);
}
- if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x2) != 0x0) {
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 0x2) != 0x0) {
this.fontRendererObj.drawString(this.trans("133", "Screws are missing."), 10, 24, 16448255);
}
- if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x4) != 0x0) {
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 0x4) != 0x0) {
this.fontRendererObj.drawString(this.trans("134", "Something is stuck."), 10, 32, 16448255);
}
- if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x8) != 0x0) {
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 0x8) != 0x0) {
this.fontRendererObj.drawString(this.trans("135", "Platings are dented."), 10, 40, 16448255);
}
- if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x10) != 0x0) {
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 0x10) != 0x0) {
this.fontRendererObj.drawString(this.trans("136", "Circuitry burned out."), 10, 48, 16448255);
}
- if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x20) != 0x0) {
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 0x20) != 0x0) {
this.fontRendererObj.drawString(this.trans("137", "That doesn't belong there."), 10, 56, 16448255);
}
- if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x40) != 0x0) {
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 0x40) != 0x0) {
this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 10, 64, 16448255);
}
- if (((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode == 0) {
- if (((CONTAINER_MultiMachine)this.mContainer).mActive == 0) {
+ if (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode == 0) {
+ if (((CONTAINER_MultiMachine) this.mContainer).mActive == 0) {
this.fontRendererObj.drawString(this.trans("139", "Hit with Soft Hammer"), 10, 16, 16448255);
this.fontRendererObj.drawString(this.trans("140", "to (re-)start the Machine"), 10, 24, 16448255);
this.fontRendererObj.drawString(this.trans("141", "if it doesn't start."), 10, 32, 16448255);
- }
- else {
+ } else {
this.fontRendererObj.drawString(this.trans("142", "Running perfectly."), 10, 16, 16448255);
}
}
}
}
-
+
public String trans(final String aKey, final String aEnglish) {
return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
}
-
+
@Override
protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java
index 0756effa26..a3ed8749c6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java
@@ -4,8 +4,6 @@ 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_LanguageManager;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine;
import gtPlusPlus.core.lib.CORE;
@@ -13,76 +11,82 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GUI_Multi_Basic_Slotted extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
+ String mName = "";
- public GUI_Multi_Basic_Slotted(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName,
- String aTextureFile) {
- super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
- }
+ public GUI_Multi_Basic_Slotted(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
+ super(
+ new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ this.mName = aName;
+ }
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
- if (this.mContainer != null) {
- if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0) {
- this.fontRendererObj.drawString(this.trans("132", "Pipe is loose."), 10, 16, 16448255);
- }
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
+ if (this.mContainer != null) {
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0) {
+ this.fontRendererObj.drawString(this.trans("132", "Pipe is loose."), 10, 16, 16448255);
+ }
- if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0) {
- this.fontRendererObj.drawString(this.trans("133", "Screws are missing."), 10, 24, 16448255);
- }
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0) {
+ this.fontRendererObj.drawString(this.trans("133", "Screws are missing."), 10, 24, 16448255);
+ }
- if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0) {
- this.fontRendererObj.drawString(this.trans("134", "Something is stuck."), 10, 32, 16448255);
- }
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0) {
+ this.fontRendererObj.drawString(this.trans("134", "Something is stuck."), 10, 32, 16448255);
+ }
- if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0) {
- this.fontRendererObj.drawString(this.trans("135", "Platings are dented."), 10, 40, 16448255);
- }
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0) {
+ this.fontRendererObj.drawString(this.trans("135", "Platings are dented."), 10, 40, 16448255);
+ }
- if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0) {
- this.fontRendererObj.drawString(this.trans("136", "Circuitry burned out."), 10, 48, 16448255);
- }
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0) {
+ this.fontRendererObj.drawString(this.trans("136", "Circuitry burned out."), 10, 48, 16448255);
+ }
- if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0) {
- this.fontRendererObj.drawString(this.trans("137", "That doesn\'t belong there."), 10, 56, 16448255);
- }
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0) {
+ this.fontRendererObj.drawString(this.trans("137", "That doesn\'t belong there."), 10, 56, 16448255);
+ }
- if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 10, 64, 16448255);
- }
+ if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
+ this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 10, 64, 16448255);
+ }
- if (((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode == 0) {
- if (((GT_Container_MultiMachine) this.mContainer).mActive == 0) {
- this.fontRendererObj.drawString(this.trans("139", "Hit with Soft Hammer"), 10, 16, 16448255);
- this.fontRendererObj.drawString(this.trans("140", "to (re-)start the Machine"), 10, 24, 16448255);
- this.fontRendererObj.drawString(this.trans("141", "if it doesn\'t start."), 10, 32, 16448255);
- } else {
- this.fontRendererObj.drawString(this.trans("142", "Running perfectly."), 10, 16, 16448255);
- }
+ if (((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode == 0) {
+ if (((GT_Container_MultiMachine) this.mContainer).mActive == 0) {
+ this.fontRendererObj.drawString(this.trans("139", "Hit with Soft Hammer"), 10, 16, 16448255);
+ this.fontRendererObj.drawString(this.trans("140", "to (re-)start the Machine"), 10, 24, 16448255);
+ this.fontRendererObj.drawString(this.trans("141", "if it doesn\'t start."), 10, 32, 16448255);
+ } else {
+ this.fontRendererObj.drawString(this.trans("142", "Running perfectly."), 10, 16, 16448255);
+ }
- ItemStack tItem;
- if (this.mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine) {
- tItem = this.mContainer.mTileEntity.getMetaTileEntity().getStackInSlot(1);
- if (tItem == null || tItem.getItem() != GT_MetaGenerated_Tool_01.INSTANCE
- || tItem.getItemDamage() < 170 || tItem.getItemDamage() > 177) {
- this.fontRendererObj.drawString(this.trans("144", "Missing Turbine Rotor"), 10,
- ((GT_Container_MultiMachine) this.mContainer).mActive == 0 ? 40 : 24, 16448255);
- }
- }
- }
- }
+ ItemStack tItem;
+ if (this.mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine) {
+ tItem = this.mContainer.mTileEntity.getMetaTileEntity().getStackInSlot(1);
+ if (tItem == null
+ || tItem.getItem() != GT_MetaGenerated_Tool_01.INSTANCE
+ || tItem.getItemDamage() < 170
+ || tItem.getItemDamage() > 177) {
+ this.fontRendererObj.drawString(
+ this.trans("144", "Missing Turbine Rotor"),
+ 10,
+ ((GT_Container_MultiMachine) this.mContainer).mActive == 0 ? 40 : 24,
+ 16448255);
+ }
+ }
+ }
+ }
+ }
- }
+ public String trans(String aKey, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ }
- public String trans(String aKey, String aEnglish) {
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
- }
-
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- int x = (this.width - this.xSize) / 2;
- int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-} \ No newline at end of file
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java
index e80235565e..beb6c1dc3e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java
@@ -9,118 +9,126 @@ import gtPlusPlus.core.util.math.MathUtils;
import net.minecraft.entity.player.InventoryPlayer;
public class GUI_PowerSubStation extends GT_GUIContainerMetaTile_Machine {
- public String mNEI;
- String mName;
- boolean[] mRepairStatus = new boolean[6];
+ public String mNEI;
+ String mName;
+ boolean[] mRepairStatus = new boolean[6];
- public final CONTAINER_PowerSubStation mPowerContainer;
+ public final CONTAINER_PowerSubStation mPowerContainer;
- public GUI_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aNEI) {
- super(new CONTAINER_PowerSubStation(aInventoryPlayer, aTileEntity, false), CORE.RES_PATH_GUI + "PowerSubStation.png");
- this.mName = aName;
- this.mNEI = aNEI;
- mPowerContainer = (CONTAINER_PowerSubStation) mContainer;
- /** The X size of the inventory window in pixels. */
- this.xSize = 196;
- /** The Y size of the inventory window in pixels. */
- this.ySize = 191;
- }
+ public GUI_PowerSubStation(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aNEI) {
+ super(
+ new CONTAINER_PowerSubStation(aInventoryPlayer, aTileEntity, false),
+ CORE.RES_PATH_GUI + "PowerSubStation.png");
+ this.mName = aName;
+ this.mNEI = aNEI;
+ mPowerContainer = (CONTAINER_PowerSubStation) mContainer;
+ /** The X size of the inventory window in pixels. */
+ this.xSize = 196;
+ /** The Y size of the inventory window in pixels. */
+ this.ySize = 191;
+ }
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 8, -10, 16448255);
- if (this.mPowerContainer != null) {
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(this.mName, 8, -10, 16448255);
+ if (this.mPowerContainer != null) {
- //this.fontRendererObj.drawString("Error Code: " + mPowerContainer.mDisplayErrorCode, 10, 142, 16448255);
+ // this.fontRendererObj.drawString("Error Code: " + mPowerContainer.mDisplayErrorCode, 10, 142, 16448255);
+ if (((this.mContainer).mDisplayErrorCode & 1) != 0) {
+ mRepairStatus[0] = false;
+ } else {
+ mRepairStatus[0] = true;
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 2) != 0) {
+ mRepairStatus[1] = false;
+ } else {
+ mRepairStatus[1] = true;
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 4) != 0) {
+ mRepairStatus[2] = false;
+ } else {
+ mRepairStatus[2] = true;
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 8) != 0) {
+ mRepairStatus[3] = false;
+ } else {
+ mRepairStatus[3] = true;
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 16) != 0) {
+ mRepairStatus[4] = false;
+ } else {
+ mRepairStatus[4] = true;
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 32) != 0) {
+ mRepairStatus[5] = false;
+ } else {
+ mRepairStatus[5] = true;
+ }
+ if (mPowerContainer.mDisplayErrorCode == 0) {
+ if (mPowerContainer.mActive == 0) {
+ this.fontRendererObj.drawString("Turn on with Mallet", 10, 8, 16448255);
+ } else {
+ this.fontRendererObj.drawString("Running perfectly", 10, 8, 16448255);
+ }
+ }
- if (((this.mContainer).mDisplayErrorCode & 1) != 0) {
- mRepairStatus[0] = false;
- }
- else {
- mRepairStatus[0] = true;
- }
- if ((mPowerContainer.mDisplayErrorCode & 2) != 0) {
- mRepairStatus[1] = false;
- }
- else {
- mRepairStatus[1] = true;
- }
- if ((mPowerContainer.mDisplayErrorCode & 4) != 0) {
- mRepairStatus[2] = false;
- }
- else {
- mRepairStatus[2] = true;
- }
- if ((mPowerContainer.mDisplayErrorCode & 8) != 0) {
- mRepairStatus[3] = false;
- }
- else {
- mRepairStatus[3] = true;
- }
- if ((mPowerContainer.mDisplayErrorCode & 16) != 0) {
- mRepairStatus[4] = false;
- }
- else {
- mRepairStatus[4] = true;
- }
- if ((mPowerContainer.mDisplayErrorCode & 32) != 0) {
- mRepairStatus[5] = false;
- }
- else {
- mRepairStatus[5] = true;
- }
- if (mPowerContainer.mDisplayErrorCode == 0) {
- if (mPowerContainer.mActive == 0) {
- this.fontRendererObj.drawString("Turn on with Mallet", 10, 8, 16448255);
- }
- else {
- this.fontRendererObj.drawString("Running perfectly", 10, 8, 16448255);
- }
- }
+ this.fontRendererObj.drawString("In", 178, 10, 16448255);
+ this.fontRendererObj.drawString("Out", 176, 28, 16448255);
+ this.fontRendererObj.drawString(
+ "Avg In: " + GT_Utility.formatNumbers(this.mPowerContainer.mAverageEuAdded.getValue()) + " EU",
+ 10,
+ 20,
+ 16448255);
+ this.fontRendererObj.drawString(
+ "Avg Out: " + GT_Utility.formatNumbers(this.mPowerContainer.mAverageEuConsumed.getValue()) + " EU",
+ 10,
+ 30,
+ 16448255);
- this.fontRendererObj.drawString("In", 178, 10, 16448255);
- this.fontRendererObj.drawString("Out", 176, 28, 16448255);
- this.fontRendererObj.drawString("Avg In: "+GT_Utility.formatNumbers(this.mPowerContainer.mAverageEuAdded.getValue())+" EU", 10, 20, 16448255);
- this.fontRendererObj.drawString("Avg Out: "+GT_Utility.formatNumbers(this.mPowerContainer.mAverageEuConsumed.getValue())+" EU", 10, 30, 16448255);
+ final double tScale2 = MathUtils.findPercentage(
+ this.mPowerContainer.mStoredEU.getValue(), this.mPowerContainer.mMaxStoredEU.getValue());
+ final int tScale = (int) (tScale2 * 2.55);
+ this.fontRendererObj.drawString("Stored:", 10, 132, 16448255);
+ this.fontRendererObj.drawString(
+ GT_Utility.formatNumbers(this.mPowerContainer.mStoredEU.getValue()) + " EU",
+ 10,
+ 142,
+ Utils.rgbtoHexValue((255 - tScale), (0 + tScale), 0));
+ this.fontRendererObj.drawString(GT_Utility.formatNumbers(tScale2) + "%", 70, 155, 16448255);
+ }
+ }
- final double tScale2 = MathUtils.findPercentage(this.mPowerContainer.mStoredEU.getValue(), this.mPowerContainer.mMaxStoredEU.getValue());
- final int tScale = (int) (tScale2 * 2.55);
- this.fontRendererObj.drawString("Stored:", 10, 132, 16448255);
- this.fontRendererObj.drawString(GT_Utility.formatNumbers(this.mPowerContainer.mStoredEU.getValue()) + " EU", 10, 142, Utils.rgbtoHexValue((255 - tScale), (0 + tScale), 0));
- this.fontRendererObj.drawString(GT_Utility.formatNumbers(tScale2)+"%", 70, 155, 16448255);
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ /** The X size of the inventory window in pixels. */
+ if (this.xSize != 196) this.xSize = 196;
+ /** The Y size of the inventory window in pixels. */
+ if (this.ySize != 191) this.ySize = 191;
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mPowerContainer != null) {
+ final double tScale = MathUtils.findPercentage(
+ this.mPowerContainer.mStoredEU.getValue(), this.mPowerContainer.mMaxStoredEU.getValue())
+ / 100;
+ this.drawTexturedModalRect(x + 5, y + 156, 0, 251, Math.min(147, (int) (tScale * 148.0)), 5);
- }
- }
-
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- /** The X size of the inventory window in pixels. */
- if (this.xSize != 196)
- this.xSize = 196;
- /** The Y size of the inventory window in pixels. */
- if (this.ySize != 191)
- this.ySize = 191;
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mPowerContainer != null) {
- final double tScale = MathUtils.findPercentage(this.mPowerContainer.mStoredEU.getValue(), this.mPowerContainer.mMaxStoredEU.getValue()) / 100;
- this.drawTexturedModalRect(x + 5, y + 156, 0, 251, Math.min(147, (int) (tScale * 148.0)), 5);
-
- // A1
- this.drawTexturedModalRect(x + 154, y + 76, 238, (!mRepairStatus[0] ? 0 : 18), 18, 18);
- // A2
- this.drawTexturedModalRect(x + 154 + 20, y + 76, 238, (!mRepairStatus[1] ? 0 : 18), 18, 18);
- // B1
- this.drawTexturedModalRect(x + 154, y + 76 + 18, 238, (!mRepairStatus[2] ? 0 : 18), 18, 18);
- // B2
- this.drawTexturedModalRect(x + 154 + 20, y + 76 + 18, 238, (!mRepairStatus[3] ? 0 : 18), 18, 18);
- // C1
- this.drawTexturedModalRect(x + 154, y + 76 + 36, 238, (!mRepairStatus[4] ? 0 : 18), 18, 18);
- // C2
- this.drawTexturedModalRect(x + 154 + 20, y + 76 + 36, 238, (!mRepairStatus[5] ? 0 : 18), 18, 18);
-
-
- }
- }
+ // A1
+ this.drawTexturedModalRect(x + 154, y + 76, 238, (!mRepairStatus[0] ? 0 : 18), 18, 18);
+ // A2
+ this.drawTexturedModalRect(x + 154 + 20, y + 76, 238, (!mRepairStatus[1] ? 0 : 18), 18, 18);
+ // B1
+ this.drawTexturedModalRect(x + 154, y + 76 + 18, 238, (!mRepairStatus[2] ? 0 : 18), 18, 18);
+ // B2
+ this.drawTexturedModalRect(x + 154 + 20, y + 76 + 18, 238, (!mRepairStatus[3] ? 0 : 18), 18, 18);
+ // C1
+ this.drawTexturedModalRect(x + 154, y + 76 + 36, 238, (!mRepairStatus[4] ? 0 : 18), 18, 18);
+ // C2
+ this.drawTexturedModalRect(x + 154 + 20, y + 76 + 36, 238, (!mRepairStatus[5] ? 0 : 18), 18, 18);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java
index c18d58b4b6..c44dbd0e1f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java
@@ -1,51 +1,46 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_SafeBlock
-extends GT_GUIContainerMetaTile_Machine {
- public GUI_SafeBlock(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(new CONTAINER_SafeBlock(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "SafeBlock.png");
- }
-
- //String UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID.toString();
- boolean blockStatus = ((CONTAINER_SafeBlock)this.mContainer).blockStatus;
- //String tempPlayer;
-
- private void updateVars(){
- //UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID;
- this.blockStatus = ((CONTAINER_SafeBlock)this.mContainer).blockStatus;
- // tempPlayer = PlayerCache.lookupPlayerByUUID(UUID);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2)
- {
- this.updateVars();
- //this.fontRendererObj.drawString("Owner: "+ tempPlayer, 64, 72, 4210752);
- //this.fontRendererObj.drawString(": "+ UUID.toLowerCase(), 44, 82, 4210752);
- this.fontRendererObj.drawString("Safe Status", 76, 61, 4210752);
- if (this.blockStatus){
- this.fontRendererObj.drawString("Locked", 88, 73, 4210752);
- }
- else {
- this.fontRendererObj.drawString("Unlocked", 82, 73, 4210752);
- }
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- /*String UUID = ((CONTAINER_SafeBlock)this.mContainer).UUID;
+public class GUI_SafeBlock extends GT_GUIContainerMetaTile_Machine {
+ public GUI_SafeBlock(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(new CONTAINER_SafeBlock(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "SafeBlock.png");
+ }
+
+ // String UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID.toString();
+ boolean blockStatus = ((CONTAINER_SafeBlock) this.mContainer).blockStatus;
+ // String tempPlayer;
+
+ private void updateVars() {
+ // UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID;
+ this.blockStatus = ((CONTAINER_SafeBlock) this.mContainer).blockStatus;
+ // tempPlayer = PlayerCache.lookupPlayerByUUID(UUID);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.updateVars();
+ // this.fontRendererObj.drawString("Owner: "+ tempPlayer, 64, 72, 4210752);
+ // this.fontRendererObj.drawString(": "+ UUID.toLowerCase(), 44, 82, 4210752);
+ this.fontRendererObj.drawString("Safe Status", 76, 61, 4210752);
+ if (this.blockStatus) {
+ this.fontRendererObj.drawString("Locked", 88, 73, 4210752);
+ } else {
+ this.fontRendererObj.drawString("Unlocked", 82, 73, 4210752);
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ /*String UUID = ((CONTAINER_SafeBlock)this.mContainer).UUID;
this.fontRendererObj.drawString("Owner UUID: "+ UUID, 8, 12, 4210752);*/
- }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java
index f0b3a0c879..8fb63fe148 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java
@@ -1,44 +1,43 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_SolarGenerator
-extends GT_GUIContainerMetaTile_Machine {
- public GUI_SolarGenerator(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aTextureName) {
- super(new CONTAINER_SolarGenerator(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/" + aTextureName);
- }
+public class GUI_SolarGenerator extends GT_GUIContainerMetaTile_Machine {
+ public GUI_SolarGenerator(
+ final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aTextureName) {
+ super(new CONTAINER_SolarGenerator(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/" + aTextureName);
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString("Solar Generator", 8, 4, 4210752);
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString("Solar Generator", 8, 4, 4210752);
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mContainer != null) {
- int tScale = ((CONTAINER_SolarGenerator) this.mContainer).mProcessingEnergy;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 70, (y + 25 + 54) - tScale, 194, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SolarGenerator) this.mContainer).mEnergy;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 83, (y + 25 + 54) - tScale, 204, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SolarGenerator) this.mContainer).mTemperature;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 96, (y + 25 + 54) - tScale, 214, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SolarGenerator) this.mContainer).mProcessingEnergy;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 117, (y + 44 + 14) - tScale, 177, 14 - tScale, 15, tScale + 1);
- }
- }
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mContainer != null) {
+ int tScale = ((CONTAINER_SolarGenerator) this.mContainer).mProcessingEnergy;
+ if (tScale > 0) {
+ this.drawTexturedModalRect(x + 70, (y + 25 + 54) - tScale, 194, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SolarGenerator) this.mContainer).mEnergy;
+ if (tScale > 0) {
+ this.drawTexturedModalRect(x + 83, (y + 25 + 54) - tScale, 204, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SolarGenerator) this.mContainer).mTemperature;
+ if (tScale > 0) {
+ this.drawTexturedModalRect(x + 96, (y + 25 + 54) - tScale, 214, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SolarGenerator) this.mContainer).mProcessingEnergy;
+ if (tScale > 0) {
+ this.drawTexturedModalRect(x + 117, (y + 44 + 14) - tScale, 177, 14 - tScale, 15, tScale + 1);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java
index 88a3e00bb5..de3d56bdac 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java
@@ -6,51 +6,47 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.preloader.CORE_Preloader;
import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_SteamCondenser extends GT_GUIContainerMetaTile_Machine
-{
- long tickTime = 0;
+public class GUI_SteamCondenser extends GT_GUIContainerMetaTile_Machine {
+ long tickTime = 0;
- public GUI_SteamCondenser(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aTextureName)
- {
- super(new CONTAINER_SteamCondenser(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + aTextureName);
- }
+ public GUI_SteamCondenser(
+ final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aTextureName) {
+ super(new CONTAINER_SteamCondenser(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + aTextureName);
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2)
- {
- this.fontRendererObj.drawString("Condenser", 8, 4, 4210752);
- if (CORE_Preloader.DEBUG_MODE){
- this.tickTime = ((CONTAINER_SteamCondenser)this.mContainer).mTickingTime;
- this.fontRendererObj.drawString("Tick Time: "+this.tickTime, 8, 12, 4210752);
- }
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString("Condenser", 8, 4, 4210752);
+ if (CORE_Preloader.DEBUG_MODE) {
+ this.tickTime = ((CONTAINER_SteamCondenser) this.mContainer).mTickingTime;
+ this.fontRendererObj.drawString("Tick Time: " + this.tickTime, 8, 12, 4210752);
+ }
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3)
- {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mContainer != null)
- {
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mContainer != null) {
- int tScale = ((CONTAINER_SteamCondenser)this.mContainer).mSteamAmount;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 70, (y + 25 + 54) - tScale, 194, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SteamCondenser)this.mContainer).mWaterAmount;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 83, (y + 25 + 54) - tScale, 204, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SteamCondenser)this.mContainer).mTemperature;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 96, (y + 25 + 54) - tScale, 214, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SteamCondenser)this.mContainer).mProcessingEnergy;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 115, y + 44 + 2/* - tScale*/, 177, 14 - tScale, 15, 1+tScale);
- }
- }
- }
-} \ No newline at end of file
+ int tScale = ((CONTAINER_SteamCondenser) this.mContainer).mSteamAmount;
+ if (tScale > 0) {
+ this.drawTexturedModalRect(x + 70, (y + 25 + 54) - tScale, 194, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SteamCondenser) this.mContainer).mWaterAmount;
+ if (tScale > 0) {
+ this.drawTexturedModalRect(x + 83, (y + 25 + 54) - tScale, 204, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SteamCondenser) this.mContainer).mTemperature;
+ if (tScale > 0) {
+ this.drawTexturedModalRect(x + 96, (y + 25 + 54) - tScale, 214, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SteamCondenser) this.mContainer).mProcessingEnergy;
+ if (tScale > 0) {
+ this.drawTexturedModalRect(x + 115, y + 44 + 2 /* - tScale*/, 177, 14 - tScale, 15, 1 + tScale);
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SuperChest.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SuperChest.java
index d324c50dd0..b65ac110c3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SuperChest.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SuperChest.java
@@ -1,38 +1,37 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.StatCollector;
-
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 GUI_SuperChest extends GT_GUIContainerMetaTile_Machine {
- private final String mName;
-
- public GUI_SuperChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity,
- String aName) {
- super(new CONTAINER_SuperChest(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/BasicTank.png");
- this.mName = aName;
- }
+ private final String mName;
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2,
- 4210752);
- this.fontRendererObj.drawString(this.mName, 8, 6, 4210752);
- if (this.mContainer != null) {
- this.fontRendererObj.drawString("Item Amount", 10, 20, 16448255);
- this.fontRendererObj.drawString(
- GT_Utility.parseNumberToString(((CONTAINER_SuperChest) this.mContainer).mContent), 10, 30,
- 16448255);
- }
+ public GUI_SuperChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_SuperChest(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/BasicTank.png");
+ this.mName = aName;
+ }
- }
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString(
+ StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
+ this.fontRendererObj.drawString(this.mName, 8, 6, 4210752);
+ if (this.mContainer != null) {
+ this.fontRendererObj.drawString("Item Amount", 10, 20, 16448255);
+ this.fontRendererObj.drawString(
+ GT_Utility.parseNumberToString(((CONTAINER_SuperChest) this.mContainer).mContent),
+ 10,
+ 30,
+ 16448255);
+ }
+ }
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- int x = (this.width - this.xSize) / 2;
- int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-} \ No newline at end of file
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_TreeFarmer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_TreeFarmer.java
index b236b0ff32..af6c212fdf 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_TreeFarmer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_TreeFarmer.java
@@ -1,46 +1,48 @@
-
package gtPlusPlus.xmod.gregtech.api.gui;
-
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
public class GUI_TreeFarmer extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
- long maxPower = 0;
- long storedPower = 0;
-
- public GUI_TreeFarmer(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
- super(new CONTAINER_TreeFarmer(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 64, 6, 16448255);
- if (this.mContainer != null) {
- this.maxPower = ((CONTAINER_TreeFarmer)this.mContainer).maxEU;
- this.storedPower = ((CONTAINER_TreeFarmer)this.mContainer).storedEU;
- if (((CONTAINER_TreeFarmer) this.mContainer).mDisplayErrorCode == 0) {
- this.fontRendererObj.drawString("Current Power: "+this.storedPower+"EU", 8, 52, 16448255);
- this.fontRendererObj.drawString("Max Power: "+this.maxPower+"EU", 8, 60, 16448255);
- this.fontRendererObj.drawString("Current operations left: "+(this.storedPower/32), 8, 68, 16448255);
- }
- }
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- this.maxPower = ((CONTAINER_TreeFarmer)this.mContainer).maxEU;
- this.storedPower = ((CONTAINER_TreeFarmer)this.mContainer).storedEU;
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ String mName = "";
+ long maxPower = 0;
+ long storedPower = 0;
+
+ public GUI_TreeFarmer(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aTextureFile) {
+ super(
+ new CONTAINER_TreeFarmer(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ this.mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(this.mName, 64, 6, 16448255);
+ if (this.mContainer != null) {
+ this.maxPower = ((CONTAINER_TreeFarmer) this.mContainer).maxEU;
+ this.storedPower = ((CONTAINER_TreeFarmer) this.mContainer).storedEU;
+ if (((CONTAINER_TreeFarmer) this.mContainer).mDisplayErrorCode == 0) {
+ this.fontRendererObj.drawString("Current Power: " + this.storedPower + "EU", 8, 52, 16448255);
+ this.fontRendererObj.drawString("Max Power: " + this.maxPower + "EU", 8, 60, 16448255);
+ this.fontRendererObj.drawString("Current operations left: " + (this.storedPower / 32), 8, 68, 16448255);
+ }
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ this.maxPower = ((CONTAINER_TreeFarmer) this.mContainer).maxEU;
+ this.storedPower = ((CONTAINER_TreeFarmer) this.mContainer).storedEU;
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedLong.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedLong.java
index 4214d32469..c738d41422 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedLong.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedLong.java
@@ -38,7 +38,7 @@ class SyncedLong {
dirty = false;
}
}
-
+
private long getPiece(int index) {
return ((long) pieces[index]) & 0xffff;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedValueManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedValueManager.java
index ecf591698b..219e503a99 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedValueManager.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/SyncedValueManager.java
@@ -29,7 +29,6 @@ class SyncedValueManager {
}
}
-
public void updateProgressBar(int short1, int short2) {
for (SyncedLong val : longs) {
if (val.updateProgressBar(short1, short2)) return;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java
index 1af597c05a..4efc08dad0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.gui.automation;
-import com.google.gson.JsonObject;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
@@ -10,7 +8,6 @@ import gregtech.api.gui.GT_Slot_Output;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_ElectricAutoWorkbench;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_CropHarvestor;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
@@ -18,124 +15,123 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class GT_Container_ElectricAutoWorkbench extends GT_ContainerMetaTile_Machine {
-
- public int mMode;
- public int mThroughPut;
- public GT_Container_ElectricAutoWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public int mMode;
+ public int mThroughPut;
+
+ public GT_Container_ElectricAutoWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 0, 8, 5));
- addSlotToContainer(new Slot(mTileEntity, 1, 26, 5));
- addSlotToContainer(new Slot(mTileEntity, 2, 44, 5));
- addSlotToContainer(new Slot(mTileEntity, 3, 8, 23));
- addSlotToContainer(new Slot(mTileEntity, 4, 26, 23));
- addSlotToContainer(new Slot(mTileEntity, 5, 44, 23));
- addSlotToContainer(new Slot(mTileEntity, 6, 8, 41));
- addSlotToContainer(new Slot(mTileEntity, 7, 26, 41));
- addSlotToContainer(new Slot(mTileEntity, 8, 44, 41));
-
- addSlotToContainer(new GT_Slot_Output(mTileEntity, 9, 8, 60));
- addSlotToContainer(new GT_Slot_Output(mTileEntity, 10, 26, 60));
- addSlotToContainer(new GT_Slot_Output(mTileEntity, 11, 44, 60));
- addSlotToContainer(new GT_Slot_Output(mTileEntity, 12, 62, 60));
- addSlotToContainer(new GT_Slot_Output(mTileEntity, 13, 80, 60));
- addSlotToContainer(new GT_Slot_Output(mTileEntity, 14, 98, 60));
+ addSlotToContainer(new Slot(mTileEntity, 0, 8, 5));
+ addSlotToContainer(new Slot(mTileEntity, 1, 26, 5));
+ addSlotToContainer(new Slot(mTileEntity, 2, 44, 5));
+ addSlotToContainer(new Slot(mTileEntity, 3, 8, 23));
+ addSlotToContainer(new Slot(mTileEntity, 4, 26, 23));
+ addSlotToContainer(new Slot(mTileEntity, 5, 44, 23));
+ addSlotToContainer(new Slot(mTileEntity, 6, 8, 41));
+ addSlotToContainer(new Slot(mTileEntity, 7, 26, 41));
+ addSlotToContainer(new Slot(mTileEntity, 8, 44, 41));
+
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 9, 8, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 10, 26, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 11, 44, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 12, 62, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 13, 80, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 14, 98, 60));
addSlotToContainer(new GT_Slot_Output(mTileEntity, 15, 116, 60));
addSlotToContainer(new GT_Slot_Output(mTileEntity, 16, 134, 60));
addSlotToContainer(new GT_Slot_Output(mTileEntity, 17, 152, 60));
-
+
addSlotToContainer(new GT_Slot_Output(mTileEntity, 18, 152, 41));
-
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 19, 64, 6, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 20, 81, 6, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 21, 98, 6, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 22, 64, 23, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 23, 81, 23, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 24, 98, 23, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 25, 64, 40, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 26, 81, 40, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 27, 98, 40, false, false, 1));
-
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 28, 152, 5, false, false, 1));
+
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 19, 64, 6, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 20, 81, 6, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 21, 98, 6, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 22, 64, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 23, 81, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 24, 98, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 25, 64, 40, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 26, 81, 40, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 27, 98, 40, false, false, 1));
+
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 28, 152, 5, false, false, 1));
addSlotToContainer(new GT_Slot_Holo(mTileEntity, 29, 121, 41, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 29, 121, 5, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 29, 121, 5, false, false, 1));
}
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (aSlotIndex < 18) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
-
- Slot tSlot = (Slot)inventorySlots.get(aSlotIndex);
- if (tSlot != null) {
- if (mTileEntity.getMetaTileEntity() == null) return null;
- if (aSlotIndex > 18 && aSlotIndex < 28) {
- ItemStack tStack = aPlayer.inventory.getItemStack();
- if (tStack != null) {
- tStack = GT_Utility.copy(1, tStack);
- }
- tSlot.putStack(tStack);
- return null;
- }
- if (aSlotIndex == 28) return null;
- if (aSlotIndex == 29) {
- if (aMouseclick == 0) {
- ((GT_MetaTileEntity_ElectricAutoWorkbench)mTileEntity.getMetaTileEntity()).switchModeForward();
- } else {
- ((GT_MetaTileEntity_ElectricAutoWorkbench)mTileEntity.getMetaTileEntity()).switchModeBackward();
- }
- return null;
- }
- if (aSlotIndex == 30) {
- ((GT_MetaTileEntity_ElectricAutoWorkbench)mTileEntity.getMetaTileEntity()).switchThrough();
- return null;
- }
- }
-
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ if (aSlotIndex < 18) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+
+ Slot tSlot = (Slot) inventorySlots.get(aSlotIndex);
+ if (tSlot != null) {
+ if (mTileEntity.getMetaTileEntity() == null) return null;
+ if (aSlotIndex > 18 && aSlotIndex < 28) {
+ ItemStack tStack = aPlayer.inventory.getItemStack();
+ if (tStack != null) {
+ tStack = GT_Utility.copy(1, tStack);
+ }
+ tSlot.putStack(tStack);
+ return null;
+ }
+ if (aSlotIndex == 28) return null;
+ if (aSlotIndex == 29) {
+ if (aMouseclick == 0) {
+ ((GT_MetaTileEntity_ElectricAutoWorkbench) mTileEntity.getMetaTileEntity()).switchModeForward();
+ } else {
+ ((GT_MetaTileEntity_ElectricAutoWorkbench) mTileEntity.getMetaTileEntity()).switchModeBackward();
+ }
+ return null;
+ }
+ if (aSlotIndex == 30) {
+ ((GT_MetaTileEntity_ElectricAutoWorkbench) mTileEntity.getMetaTileEntity()).switchThrough();
+ return null;
+ }
+ }
+
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
-
+
public int getSlotCount() {
- return 19;
+ return 19;
}
-
+
public int getShiftClickSlotCount() {
- return 9;
+ return 9;
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
+ return;
+ }
+ mMode = ((GT_MetaTileEntity_ElectricAutoWorkbench) mTileEntity.getMetaTileEntity()).mMode;
+ mThroughPut = ((GT_MetaTileEntity_ElectricAutoWorkbench) mTileEntity.getMetaTileEntity()).mThroughPut;
+ for (Object crafter : this.crafters) {
+ ICrafting var1 = (ICrafting) crafter;
+ var1.sendProgressBarUpdate(this, 103, this.mMode);
+ var1.sendProgressBarUpdate(this, 104, this.mThroughPut);
+ }
+ }
+
+ @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 103:
+ this.mMode = par2;
+ break;
+ case 104:
+ this.mThroughPut = par2;
+ break;
+ }
}
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
- return;
- }
- mMode = ((GT_MetaTileEntity_ElectricAutoWorkbench) mTileEntity.getMetaTileEntity()).mMode;
- mThroughPut = ((GT_MetaTileEntity_ElectricAutoWorkbench) mTileEntity.getMetaTileEntity()).mThroughPut;
- for (Object crafter : this.crafters) {
- ICrafting var1 = (ICrafting) crafter;
- var1.sendProgressBarUpdate(this, 103, this.mMode);
- var1.sendProgressBarUpdate(this, 104, this.mThroughPut);
- }
- }
-
- @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 103:
- this.mMode = par2;
- break;
- case 104:
- this.mThroughPut = par2;
- break;
- }
- }
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricInventoryManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricInventoryManager.java
index 3e8f509dfd..0796c28a79 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricInventoryManager.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricInventoryManager.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.gui.automation;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
@@ -9,6 +7,7 @@ import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_ElectricInventoryManager;
+import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
@@ -18,250 +17,300 @@ import net.minecraftforge.oredict.OreDictionary;
public class GT_Container_ElectricInventoryManager extends GT_ContainerMetaTile_Machine {
- public int[] mTargetDirections = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- public int[] mRangeDirections = new int[]{0, 0, 0, 0};
- public int mTargetInOut;
- public int mTargetEnergy;
+ public int[] mTargetDirections = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ public int[] mRangeDirections = new int[] {0, 0, 0, 0};
+ public int mTargetInOut;
+ public int mTargetEnergy;
- public GT_Container_ElectricInventoryManager(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public GT_Container_ElectricInventoryManager(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 0, 155, 5));
- addSlotToContainer(new Slot(mTileEntity, 1, 155, 23));
- addSlotToContainer(new Slot(mTileEntity, 2, 155, 41));
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 0, 155, 5));
+ addSlotToContainer(new Slot(mTileEntity, 1, 155, 23));
+ addSlotToContainer(new Slot(mTileEntity, 2, 155, 41));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 3, 5, 5, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 4, 5, 23, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 5, 5, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 6, 61, 5, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 7, 61, 23, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 8, 61, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 9, 80, 5, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 10, 80, 23, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 11, 80, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 12, 136, 5, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 13, 136, 23, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 14, 136, 41, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 3, 5, 5, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 4, 5, 23, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 5, 5, 41, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 6, 61, 5, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 7, 61, 23, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 8, 61, 41, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 9, 80, 5, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 10, 80, 23, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 11, 80, 41, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 12, 136, 5, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 13, 136, 23, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 14, 136, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 5, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 23, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 5, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 23, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 5, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 23, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 5, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 23, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 41, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 5, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 23, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 41, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 5, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 23, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 41, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 5, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 23, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 41, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 5, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 23, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 60, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 60, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 60, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 60, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 60, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 60, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 60, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 60, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 5, 60, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 61, 60, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 80, 60, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 136, 60, false, true, 1));
- }
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 5, 60, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 61, 60, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 80, 60, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 136, 60, false, true, 1));
+ }
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (aSlotIndex < 3 || aSlotIndex >= getAllSlotCount())
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- Slot tSlot = (Slot) inventorySlots.get(aSlotIndex);
- if (tSlot != null) {
- if (mTileEntity.getMetaTileEntity() == null)
- return null;
- if (aSlotIndex < 15) {
- ItemStack tStack = aPlayer.inventory.getItemStack();
- if (tStack != null) {
- tStack = GT_Utility.copy(tStack);
- if (aMouseclick != 0) {
- tStack.setItemDamage(OreDictionary.WILDCARD_VALUE);
- }
- tSlot.putStack(tStack);
- }
- else {
- if (tSlot.getStack() != null) {
- if (aMouseclick == 0) {
- tSlot.getStack().stackSize -= (aShifthold == 1 ? 8 : 1);
- if (tSlot.getStack().stackSize <= 0) {
- tSlot.putStack(null);
- }
- }
- else {
- tSlot.getStack().stackSize += (aShifthold == 1 ? 8 : 1);
- if (tSlot.getStack().stackSize > tSlot.getStack().getMaxStackSize()) {
- tSlot.getStack().stackSize = tSlot.getStack().getMaxStackSize();
- }
- }
- }
- }
- return null;
- }
- else if (aSlotIndex >= 27 && aSlotIndex <= 30) {
- ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).iterateRangeDirection(aSlotIndex - 27);
- }
- else if (aSlotIndex >= 31 && aSlotIndex <= 34) {
- ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).switchRangeEnergy(aSlotIndex - 31);
- }
- else if (aSlotIndex % 3 == 0) {
- if (aMouseclick != 0)
- ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).switchSlot1InOut((aSlotIndex - 15) / 3);
- else
- ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).iterateSlot1Direction((aSlotIndex - 15) / 3);
- }
- else if (aSlotIndex % 3 == 1) {
- if (aMouseclick != 0)
- ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).switchSlot2InOut((aSlotIndex - 16) / 3);
- else
- ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).iterateSlot2Direction((aSlotIndex - 16) / 3);
- }
- else if (aSlotIndex % 3 == 2) {
- if (aMouseclick != 0)
- ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).switchSlot3InOut((aSlotIndex - 17) / 3);
- else
- ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).iterateSlot3Direction((aSlotIndex - 17) / 3);
- }
- }
- return null;
- }
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ if (aSlotIndex < 3 || aSlotIndex >= getAllSlotCount())
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ Slot tSlot = (Slot) inventorySlots.get(aSlotIndex);
+ if (tSlot != null) {
+ if (mTileEntity.getMetaTileEntity() == null) return null;
+ if (aSlotIndex < 15) {
+ ItemStack tStack = aPlayer.inventory.getItemStack();
+ if (tStack != null) {
+ tStack = GT_Utility.copy(tStack);
+ if (aMouseclick != 0) {
+ tStack.setItemDamage(OreDictionary.WILDCARD_VALUE);
+ }
+ tSlot.putStack(tStack);
+ } else {
+ if (tSlot.getStack() != null) {
+ if (aMouseclick == 0) {
+ tSlot.getStack().stackSize -= (aShifthold == 1 ? 8 : 1);
+ if (tSlot.getStack().stackSize <= 0) {
+ tSlot.putStack(null);
+ }
+ } else {
+ tSlot.getStack().stackSize += (aShifthold == 1 ? 8 : 1);
+ if (tSlot.getStack().stackSize > tSlot.getStack().getMaxStackSize()) {
+ tSlot.getStack().stackSize = tSlot.getStack().getMaxStackSize();
+ }
+ }
+ }
+ }
+ return null;
+ } else if (aSlotIndex >= 27 && aSlotIndex <= 30) {
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity())
+ .iterateRangeDirection(aSlotIndex - 27);
+ } else if (aSlotIndex >= 31 && aSlotIndex <= 34) {
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity())
+ .switchRangeEnergy(aSlotIndex - 31);
+ } else if (aSlotIndex % 3 == 0) {
+ if (aMouseclick != 0)
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity())
+ .switchSlot1InOut((aSlotIndex - 15) / 3);
+ else
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity())
+ .iterateSlot1Direction((aSlotIndex - 15) / 3);
+ } else if (aSlotIndex % 3 == 1) {
+ if (aMouseclick != 0)
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity())
+ .switchSlot2InOut((aSlotIndex - 16) / 3);
+ else
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity())
+ .iterateSlot2Direction((aSlotIndex - 16) / 3);
+ } else if (aSlotIndex % 3 == 2) {
+ if (aMouseclick != 0)
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity())
+ .switchSlot3InOut((aSlotIndex - 17) / 3);
+ else
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity())
+ .iterateSlot3Direction((aSlotIndex - 17) / 3);
+ }
+ }
+ return null;
+ }
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
- return;
- }
- mTargetDirections = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- mRangeDirections = new int[]{0, 0, 0, 0};
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
+ return;
+ }
+ mTargetDirections = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ mRangeDirections = new int[] {0, 0, 0, 0};
- mRangeDirections[0] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(0);
- mRangeDirections[1] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(1);
- mRangeDirections[2] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(2);
- mRangeDirections[3] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(3);
+ mRangeDirections[0] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(0);
+ mRangeDirections[1] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(1);
+ mRangeDirections[2] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(2);
+ mRangeDirections[3] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(3);
- mTargetDirections[0] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(0);
- mTargetDirections[1] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(0);
- mTargetDirections[2] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(0);
- mTargetDirections[3] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(1);
- mTargetDirections[4] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(1);
- mTargetDirections[5] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(1);
- mTargetDirections[6] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(2);
- mTargetDirections[7] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(2);
- mTargetDirections[8] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(2);
- mTargetDirections[9] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(3);
- mTargetDirections[10] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(3);
- mTargetDirections[11] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(3);
+ mTargetDirections[0] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(0);
+ mTargetDirections[1] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(0);
+ mTargetDirections[2] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(0);
+ mTargetDirections[3] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(1);
+ mTargetDirections[4] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(1);
+ mTargetDirections[5] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(1);
+ mTargetDirections[6] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(2);
+ mTargetDirections[7] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(2);
+ mTargetDirections[8] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(2);
+ mTargetDirections[9] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(3);
+ mTargetDirections[10] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(3);
+ mTargetDirections[11] =
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(3);
- mTargetInOut = 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(0) ? 1 << 0 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(0) ? 1 << 1 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(0) ? 1 << 2 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(1) ? 1 << 3 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(1) ? 1 << 4 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(1) ? 1 << 5 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(2) ? 1 << 6 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(2) ? 1 << 7 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(2) ? 1 << 8 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(3) ? 1 << 9 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(3) ? 1 << 10 : 0;
- mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(3) ? 1 << 11 : 0;
+ mTargetInOut = 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(0)
+ ? 1 << 0
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(0)
+ ? 1 << 1
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(0)
+ ? 1 << 2
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(1)
+ ? 1 << 3
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(1)
+ ? 1 << 4
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(1)
+ ? 1 << 5
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(2)
+ ? 1 << 6
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(2)
+ ? 1 << 7
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(2)
+ ? 1 << 8
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(3)
+ ? 1 << 9
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(3)
+ ? 1 << 10
+ : 0;
+ mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(3)
+ ? 1 << 11
+ : 0;
- mTargetEnergy = 0;
- mTargetEnergy |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(0) ? 1 << 0 : 0;
- mTargetEnergy |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(1) ? 1 << 1 : 0;
- mTargetEnergy |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(2) ? 1 << 2 : 0;
- mTargetEnergy |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(3) ? 1 << 3 : 0;
+ mTargetEnergy = 0;
+ mTargetEnergy |=
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(0)
+ ? 1 << 0
+ : 0;
+ mTargetEnergy |=
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(1)
+ ? 1 << 1
+ : 0;
+ mTargetEnergy |=
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(2)
+ ? 1 << 2
+ : 0;
+ mTargetEnergy |=
+ ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(3)
+ ? 1 << 3
+ : 0;
- Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- for (int i = 0; i < 12; i++)
- var1.sendProgressBarUpdate(this, 100 + i, mTargetDirections[i]);
- var1.sendProgressBarUpdate(this, 113, mTargetInOut);
- var1.sendProgressBarUpdate(this, 114, mTargetEnergy);
- for (int i = 0; i < 4; i++)
- var1.sendProgressBarUpdate(this, 115 + i, mRangeDirections[i]);
- }
- }
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ for (int i = 0; i < 12; i++) var1.sendProgressBarUpdate(this, 100 + i, mTargetDirections[i]);
+ var1.sendProgressBarUpdate(this, 113, mTargetInOut);
+ var1.sendProgressBarUpdate(this, 114, mTargetEnergy);
+ for (int i = 0; i < 4; i++) var1.sendProgressBarUpdate(this, 115 + i, mRangeDirections[i]);
+ }
+ }
- @Override
- public void addCraftingToCrafters(ICrafting par1ICrafting) {
- super.addCraftingToCrafters(par1ICrafting);
- }
+ @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 100 :
- mTargetDirections[0] = par2;
- break;
- case 101 :
- mTargetDirections[1] = par2;
- break;
- case 102 :
- mTargetDirections[2] = par2;
- break;
- case 103 :
- mTargetDirections[3] = par2;
- break;
- case 104 :
- mTargetDirections[4] = par2;
- break;
- case 105 :
- mTargetDirections[5] = par2;
- break;
- case 106 :
- mTargetDirections[6] = par2;
- break;
- case 107 :
- mTargetDirections[7] = par2;
- break;
- case 108 :
- mTargetDirections[8] = par2;
- break;
- case 109 :
- mTargetDirections[9] = par2;
- break;
- case 110 :
- mTargetDirections[10] = par2;
- break;
- case 111 :
- mTargetDirections[11] = par2;
- break;
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ mTargetDirections[0] = par2;
+ break;
+ case 101:
+ mTargetDirections[1] = par2;
+ break;
+ case 102:
+ mTargetDirections[2] = par2;
+ break;
+ case 103:
+ mTargetDirections[3] = par2;
+ break;
+ case 104:
+ mTargetDirections[4] = par2;
+ break;
+ case 105:
+ mTargetDirections[5] = par2;
+ break;
+ case 106:
+ mTargetDirections[6] = par2;
+ break;
+ case 107:
+ mTargetDirections[7] = par2;
+ break;
+ case 108:
+ mTargetDirections[8] = par2;
+ break;
+ case 109:
+ mTargetDirections[9] = par2;
+ break;
+ case 110:
+ mTargetDirections[10] = par2;
+ break;
+ case 111:
+ mTargetDirections[11] = par2;
+ break;
- case 113 :
- mTargetInOut = par2;
- break;
- case 114 :
- mTargetEnergy = par2;
- break;
- case 115 :
- mRangeDirections[0] = par2;
- break;
- case 116 :
- mRangeDirections[1] = par2;
- break;
- case 117 :
- mRangeDirections[2] = par2;
- break;
- case 118 :
- mRangeDirections[3] = par2;
- break;
- }
- }
+ case 113:
+ mTargetInOut = par2;
+ break;
+ case 114:
+ mTargetEnergy = par2;
+ break;
+ case 115:
+ mRangeDirections[0] = par2;
+ break;
+ case 116:
+ mRangeDirections[1] = par2;
+ break;
+ case 117:
+ mRangeDirections[2] = par2;
+ break;
+ case 118:
+ mRangeDirections[3] = par2;
+ break;
+ }
+ }
- public int getSlotCount() {
- return 3;
- }
+ public int getSlotCount() {
+ return 3;
+ }
- public int getShiftClickSlotCount() {
- return 3;
- }
+ public int getShiftClickSlotCount() {
+ return 3;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java
index 90f8380d14..6be7eb042e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java
@@ -1,62 +1,66 @@
package gtPlusPlus.xmod.gregtech.api.gui.automation;
-import java.util.ArrayList;
-import java.util.List;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.gregtech.api.gui.basic.GT_Container_CropHarvestor;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_ElectricAutoWorkbench extends GT_GUIContainerMetaTile_Machine {
-
- private static final String[] mModeText = new String[] {"Normal Crafting Table", "???", "1x1", "2x2", "3x3", "Unifier", "Dust", "???", "Hammer?", "Circle"};
-
+
+ private static final String[] mModeText = new String[] {
+ "Normal Crafting Table", "???", "1x1", "2x2", "3x3", "Unifier", "Dust", "???", "Hammer?", "Circle"
+ };
+
public GT_GUIContainer_ElectricAutoWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(new GT_Container_ElectricAutoWorkbench(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "ElectricAutoWorkbench.png");
+ super(
+ new GT_Container_ElectricAutoWorkbench(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + "ElectricAutoWorkbench.png");
}
-
+
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- drawTooltip(par1, par2);
+ drawTooltip(par1, par2);
}
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, 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) {
- int tMode = ((GT_Container_ElectricAutoWorkbench)mContainer).mMode;
- if (tMode != 0) drawTexturedModalRect(x + 120, y + 40, tMode*18, 166, 18, 18);
- tMode = ((GT_Container_ElectricAutoWorkbench)mContainer).mThroughPut;
- drawTexturedModalRect(x + 120, y + 4, tMode*18, 184, 18, 18);
- }
+
+ if (mContainer != null) {
+ int tMode = ((GT_Container_ElectricAutoWorkbench) mContainer).mMode;
+ if (tMode != 0) drawTexturedModalRect(x + 120, y + 40, tMode * 18, 166, 18, 18);
+ tMode = ((GT_Container_ElectricAutoWorkbench) mContainer).mThroughPut;
+ drawTexturedModalRect(x + 120, y + 4, tMode * 18, 184, 18, 18);
+ }
+ }
+
+ private void drawTooltip(final int x2, final int y2) {
+ final int xStart = (this.width - this.xSize) / 2;
+ final int yStart = (this.height - this.ySize) / 2;
+ final int x3 = x2 - xStart;
+ final int y3 = y2 - yStart + 5;
+ List<String> list = new ArrayList<>();
+ String[] mModeText = new String[] {
+ "Normal Crafting Table", "???", "1x1", "2x2", "3x3", "Unifier", "Dust", "???", "Hammer?", "Circle"
+ };
+ if (y3 >= 45 && y3 <= 62) {
+ if (x3 >= 120 && x3 <= 137) {
+ list.add("Mode: " + mModeText[((GT_Container_ElectricAutoWorkbench) mContainer).mMode]);
+ /*switch (((GT_Container_ElectricAutoWorkbench) mContainer).mMode) {
+ case 0:
+ list.add("Mode: ");
+ }*/
+ }
+ }
+ if (!list.isEmpty()) {
+ drawHoveringText(list, x3, y3, fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
}
-
- private void drawTooltip(final int x2, final int y2) {
- final int xStart = (this.width - this.xSize) / 2;
- final int yStart = (this.height - this.ySize) / 2;
- final int x3 = x2 - xStart;
- final int y3 = y2 - yStart + 5;
- List<String> list = new ArrayList<>();
- String[] mModeText = new String[] {"Normal Crafting Table", "???", "1x1", "2x2", "3x3", "Unifier", "Dust", "???", "Hammer?", "Circle"};
- if (y3 >= 45 && y3 <= 62) {
- if (x3 >= 120 && x3 <= 137) {
- list.add("Mode: "+mModeText[((GT_Container_ElectricAutoWorkbench) mContainer).mMode]);
- /*switch (((GT_Container_ElectricAutoWorkbench) mContainer).mMode) {
- case 0:
- list.add("Mode: ");
- }*/
- }
- }
- if (!list.isEmpty()) {
- drawHoveringText(list, x3, y3, fontRendererObj);
- RenderHelper.enableGUIStandardItemLighting();
- }
- }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricInventoryManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricInventoryManager.java
index cf57d3faf1..77357056ba 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricInventoryManager.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricInventoryManager.java
@@ -6,53 +6,197 @@ import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_ElectricInventoryManager extends GT_GUIContainerMetaTile_Machine {
-
+
public GT_GUIContainer_ElectricInventoryManager(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(new GT_Container_ElectricInventoryManager(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "InventoryManager.png");
+ super(
+ new GT_Container_ElectricInventoryManager(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + "InventoryManager.png");
}
-
+
@Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
-
- }
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {}
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, 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) {
- drawTexturedModalRect(x + 4, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[0]*18, 202, 18, 54);
- drawTexturedModalRect(x + 60, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[1]*18, 202, 18, 54);
- drawTexturedModalRect(x + 79, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[2]*18, 202, 18, 54);
- drawTexturedModalRect(x + 135, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[3]*18, 202, 18, 54);
-
- drawTexturedModalRect(x + 23, y + 59, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[0]*18+126, 166, 18, 18);
- drawTexturedModalRect(x + 41, y + 59, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[1]*18+126, 166, 18, 18);
- drawTexturedModalRect(x + 98, y + 59, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[2]*18+126, 166, 18, 18);
- drawTexturedModalRect(x + 116, y + 59, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[3]*18+126, 166, 18, 18);
-
- drawTexturedModalRect(x + 4, y + 59, 108, (((GT_Container_ElectricInventoryManager)mContainer).mTargetEnergy & 1)!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 60, y + 59, 108, (((GT_Container_ElectricInventoryManager)mContainer).mTargetEnergy & 2)!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 79, y + 59, 108, (((GT_Container_ElectricInventoryManager)mContainer).mTargetEnergy & 4)!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 135, y + 59, 108, (((GT_Container_ElectricInventoryManager)mContainer).mTargetEnergy & 8)!=0?184:166, 18, 18);
-
- int i = -1;
-
- drawTexturedModalRect(x + 23, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 23, y + 22, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 23, y + 40, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 41, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 41, y + 22, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 41, y + 40, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 98, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 98, y + 22, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 98, y + 40, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 116, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 116, y + 22, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
- drawTexturedModalRect(x + 116, y + 40, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18);
+ drawTexturedModalRect(
+ x + 4,
+ y + 4,
+ ((GT_Container_ElectricInventoryManager) mContainer).mRangeDirections[0] * 18,
+ 202,
+ 18,
+ 54);
+ drawTexturedModalRect(
+ x + 60,
+ y + 4,
+ ((GT_Container_ElectricInventoryManager) mContainer).mRangeDirections[1] * 18,
+ 202,
+ 18,
+ 54);
+ drawTexturedModalRect(
+ x + 79,
+ y + 4,
+ ((GT_Container_ElectricInventoryManager) mContainer).mRangeDirections[2] * 18,
+ 202,
+ 18,
+ 54);
+ drawTexturedModalRect(
+ x + 135,
+ y + 4,
+ ((GT_Container_ElectricInventoryManager) mContainer).mRangeDirections[3] * 18,
+ 202,
+ 18,
+ 54);
+
+ drawTexturedModalRect(
+ x + 23,
+ y + 59,
+ ((GT_Container_ElectricInventoryManager) mContainer).mRangeDirections[0] * 18 + 126,
+ 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 41,
+ y + 59,
+ ((GT_Container_ElectricInventoryManager) mContainer).mRangeDirections[1] * 18 + 126,
+ 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 98,
+ y + 59,
+ ((GT_Container_ElectricInventoryManager) mContainer).mRangeDirections[2] * 18 + 126,
+ 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 116,
+ y + 59,
+ ((GT_Container_ElectricInventoryManager) mContainer).mRangeDirections[3] * 18 + 126,
+ 166,
+ 18,
+ 18);
+
+ drawTexturedModalRect(
+ x + 4,
+ y + 59,
+ 108,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetEnergy & 1) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 60,
+ y + 59,
+ 108,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetEnergy & 2) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 79,
+ y + 59,
+ 108,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetEnergy & 4) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 135,
+ y + 59,
+ 108,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetEnergy & 8) != 0 ? 184 : 166,
+ 18,
+ 18);
+
+ int i = -1;
+
+ drawTexturedModalRect(
+ x + 23,
+ y + 4,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 23,
+ y + 22,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 23,
+ y + 40,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 41,
+ y + 4,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 41,
+ y + 22,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 41,
+ y + 40,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 98,
+ y + 4,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 98,
+ y + 22,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 98,
+ y + 40,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 116,
+ y + 4,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 116,
+ y + 22,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
+ drawTexturedModalRect(
+ x + 116,
+ y + 40,
+ ((GT_Container_ElectricInventoryManager) mContainer).mTargetDirections[++i] * 18,
+ (((GT_Container_ElectricInventoryManager) mContainer).mTargetInOut & (1 << i)) != 0 ? 184 : 166,
+ 18,
+ 18);
}
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java
index e4dc7835cb..373ba8ae08 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java
@@ -1,22 +1,18 @@
package gtPlusPlus.xmod.gregtech.api.gui.basic;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-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;
-
import gregtech.api.gui.*;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.slots.SlotPollutionScrubber;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaAtmosphericReconditioner;
+import java.util.Iterator;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.item.ItemStack;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -25,82 +21,80 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaA
*/
public class CONTAINER_PollutionCleaner extends GT_Container_BasicTank {
- public boolean mFluidTransfer = false, mItemTransfer = false, mStuttering = false;
- public int mReduction = 0;
-
- public CONTAINER_PollutionCleaner(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- @Override
- public void addSlots(InventoryPlayer aInventoryPlayer) {
-
- int tStartIndex = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).getInputSlot();
- int aTier = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mTier;
-
-
- //Add 2 Item Slots
- addSlotToContainer(new SlotPollutionScrubber(0, aTier, mTileEntity, tStartIndex++, 53, 25));
- addSlotToContainer(new SlotPollutionScrubber(1, aTier, mTileEntity, tStartIndex++, 107, 25));
- // Upgrade Slot
- addSlotToContainer(new SlotPollutionScrubber(2, aTier, mTileEntity, tStartIndex++, 125, 63));
-
- }
-
- @Override
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- Logger.INFO("Clicked on slot "+aSlotIndex);
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
-
- Logger.INFO("TEST");
- mReduction = ((GregtechMetaAtmosphericReconditioner) mTileEntity.getMetaTileEntity()).mPollutionReduction;
-
- Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 105, mReduction);
- }
- }
-
- @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 105:
- mReduction = (par2);
- break;
- }
- }
-
- @Override
- public int getSlotStartIndex() {
- return 0;
- }
-
- @Override
- public int getShiftClickStartIndex() {
- return 0;
- }
-
- @Override
- public int getSlotCount() {
- return getShiftClickSlotCount();
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 3;
- }
+ public boolean mFluidTransfer = false, mItemTransfer = false, mStuttering = false;
+ public int mReduction = 0;
+
+ public CONTAINER_PollutionCleaner(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+
+ int tStartIndex = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).getInputSlot();
+ int aTier = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mTier;
+
+ // Add 2 Item Slots
+ addSlotToContainer(new SlotPollutionScrubber(0, aTier, mTileEntity, tStartIndex++, 53, 25));
+ addSlotToContainer(new SlotPollutionScrubber(1, aTier, mTileEntity, tStartIndex++, 107, 25));
+ // Upgrade Slot
+ addSlotToContainer(new SlotPollutionScrubber(2, aTier, mTileEntity, tStartIndex++, 125, 63));
+ }
+
+ @Override
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ Logger.INFO("Clicked on slot " + aSlotIndex);
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
+
+ Logger.INFO("TEST");
+ mReduction = ((GregtechMetaAtmosphericReconditioner) mTileEntity.getMetaTileEntity()).mPollutionReduction;
+
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 105, mReduction);
+ }
+ }
+
+ @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 105:
+ mReduction = (par2);
+ break;
+ }
+ }
+
+ @Override
+ public int getSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int getShiftClickStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int getSlotCount() {
+ return getShiftClickSlotCount();
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 3;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_Container_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_Container_CropHarvestor.java
index 9bca97de82..8380b2958f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_Container_CropHarvestor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_Container_CropHarvestor.java
@@ -17,171 +17,163 @@ import net.minecraft.item.ItemStack;
public class GT_Container_CropHarvestor extends GT_ContainerMetaTile_Machine {
- public boolean mModeAlternative = false;
- public int mWaterAmount = 0;
- public int mWaterRealAmount = 0;
-
- public GT_Container_CropHarvestor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- public void addSlots(InventoryPlayer aInventoryPlayer) {
-
-
- int aSlot = 1;
-
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 48, 64, false, true, 1));
- addSlotToContainer(new SlotWeedEx(mTileEntity, aSlot++, 8, 14));
- addSlotToContainer(new SlotWeedEx(mTileEntity, aSlot++, 26, 14));
- addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 8, 32));
- addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 26, 32));
- addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 8, 50));
- addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 26, 50));
-
-
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 61, 7));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 79, 7));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 97, 7));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 115, 7));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 133, 7));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 151, 7));
-
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 61, 25));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 79, 25));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 97, 25));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 115, 25));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 133, 25));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 151, 25));
-
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 61, 43));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 79, 43));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 97, 43));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 115, 43));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 133, 43));
- addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 151, 43));
-
-
- }
-
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
-
- GT_MetaTileEntity_CropHarvestor machine = (GT_MetaTileEntity_CropHarvestor) mTileEntity.getMetaTileEntity();
-
- if (aSlotIndex == 0) {
- machine.mModeAlternative = !machine.mModeAlternative;
- return null;
- }
-
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public int getSlotCount() {
- return 24;
- }
-
- @Override
- public int getSlotStartIndex() {
- return 1;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 6;
- }
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
- return;
- }
-
- // GT_MetaTileEntity_Boiler.getCapacity() is used for both water and steam capacity.
- int capacity = ((GT_MetaTileEntity_CropHarvestor) this.mTileEntity.getMetaTileEntity()).getCapacity();
-
- mModeAlternative = ((GT_MetaTileEntity_CropHarvestor) mTileEntity.getMetaTileEntity()).mModeAlternative;
- mWaterRealAmount = ((GT_MetaTileEntity_CropHarvestor) mTileEntity.getMetaTileEntity()).getFluidAmount();
- this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterRealAmount * 54 / (capacity - 100)));
- for (Object crafter : this.crafters) {
- ICrafting var1 = (ICrafting) crafter;
- var1.sendProgressBarUpdate(this, 102, mModeAlternative ? 1 : 0);
- var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
- var1.sendProgressBarUpdate(this, 104, this.mWaterRealAmount);
- }
- }
-
- @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:
- mModeAlternative = (par2 != 0);
- break;
- case 103:
- this.mWaterAmount = par2;
- break;
- case 104:
- this.mWaterRealAmount = par2;
- break;
- }
- }
-
- public static class SlotWeedEx extends Slot {
-
- public SlotWeedEx(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
-
- }
-
- @Override
- public synchronized boolean isItemValid(final ItemStack itemstack) {
- return isWeedEx(itemstack);
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
-
- private static boolean isWeedEx(ItemStack aStack) {
- if (aStack != null && aStack.getItem() instanceof ItemIC2) {
- if (aStack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) {
- return true;
- }
- }
- return false;
- }
- }
-
- public class SlotFertilizer extends Slot {
-
- public SlotFertilizer(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
-
- }
-
- @Override
- public synchronized boolean isItemValid(final ItemStack aStack) {
- if (aStack != null && aStack.getItem() instanceof ItemIC2) {
- if (aStack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 64;
- }
-
- }
-
+ public boolean mModeAlternative = false;
+ public int mWaterAmount = 0;
+ public int mWaterRealAmount = 0;
+
+ public GT_Container_CropHarvestor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+
+ int aSlot = 1;
+
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 48, 64, false, true, 1));
+ addSlotToContainer(new SlotWeedEx(mTileEntity, aSlot++, 8, 14));
+ addSlotToContainer(new SlotWeedEx(mTileEntity, aSlot++, 26, 14));
+ addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 8, 32));
+ addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 26, 32));
+ addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 8, 50));
+ addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 26, 50));
+
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 61, 7));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 79, 7));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 97, 7));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 115, 7));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 133, 7));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 151, 7));
+
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 61, 25));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 79, 25));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 97, 25));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 115, 25));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 133, 25));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 151, 25));
+
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 61, 43));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 79, 43));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 97, 43));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 115, 43));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 133, 43));
+ addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 151, 43));
+ }
+
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+
+ GT_MetaTileEntity_CropHarvestor machine = (GT_MetaTileEntity_CropHarvestor) mTileEntity.getMetaTileEntity();
+
+ if (aSlotIndex == 0) {
+ machine.mModeAlternative = !machine.mModeAlternative;
+ return null;
+ }
+
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 24;
+ }
+
+ @Override
+ public int getSlotStartIndex() {
+ return 1;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 6;
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
+ return;
+ }
+
+ // GT_MetaTileEntity_Boiler.getCapacity() is used for both water and steam capacity.
+ int capacity = ((GT_MetaTileEntity_CropHarvestor) this.mTileEntity.getMetaTileEntity()).getCapacity();
+
+ mModeAlternative = ((GT_MetaTileEntity_CropHarvestor) mTileEntity.getMetaTileEntity()).mModeAlternative;
+ mWaterRealAmount = ((GT_MetaTileEntity_CropHarvestor) mTileEntity.getMetaTileEntity()).getFluidAmount();
+ this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterRealAmount * 54 / (capacity - 100)));
+ for (Object crafter : this.crafters) {
+ ICrafting var1 = (ICrafting) crafter;
+ var1.sendProgressBarUpdate(this, 102, mModeAlternative ? 1 : 0);
+ var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
+ var1.sendProgressBarUpdate(this, 104, this.mWaterRealAmount);
+ }
+ }
+
+ @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:
+ mModeAlternative = (par2 != 0);
+ break;
+ case 103:
+ this.mWaterAmount = par2;
+ break;
+ case 104:
+ this.mWaterRealAmount = par2;
+ break;
+ }
+ }
+
+ public static class SlotWeedEx extends Slot {
+
+ public SlotWeedEx(final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ }
+
+ @Override
+ public synchronized boolean isItemValid(final ItemStack itemstack) {
+ return isWeedEx(itemstack);
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+ private static boolean isWeedEx(ItemStack aStack) {
+ if (aStack != null && aStack.getItem() instanceof ItemIC2) {
+ if (aStack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ public class SlotFertilizer extends Slot {
+
+ public SlotFertilizer(final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ }
+
+ @Override
+ public synchronized boolean isItemValid(final ItemStack aStack) {
+ if (aStack != null && aStack.getItem() instanceof ItemIC2) {
+ if (aStack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 64;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java
index 504ae61b4a..1b04ab15fe 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java
@@ -1,75 +1,77 @@
package gtPlusPlus.xmod.gregtech.api.gui.basic;
-import java.util.ArrayList;
-import java.util.List;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.common.gui.GT_Container_Boiler;
import gtPlusPlus.core.lib.CORE;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_CropHarvestor extends GT_GUIContainerMetaTile_Machine {
- private final String mLocalName;
-
- public GT_GUIContainer_CropHarvestor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aLocalName) {
- super(new GT_Container_CropHarvestor(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "CropHarvestor.png");
- mLocalName = aLocalName;
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- drawTooltip(par1, par2);
- //fontRendererObj.drawString("Crop Manager ("+this.mContainer.mTileEntity.getInputVoltage()+"v)", 8, 4, 4210752);
- //fontRendererObj.drawString(mLocalName, 70, 69, 4210752);
- }
+ private final String mLocalName;
- @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);
+ public GT_GUIContainer_CropHarvestor(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aLocalName) {
+ super(new GT_Container_CropHarvestor(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "CropHarvestor.png");
+ mLocalName = aLocalName;
+ }
- if (((GT_Container_CropHarvestor) mContainer).mModeAlternative) {
- drawTexturedModalRect(x + 48, y + 64, 177, 37, 16, 16);
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ drawTooltip(par1, par2);
+ // fontRendererObj.drawString("Crop Manager ("+this.mContainer.mTileEntity.getInputVoltage()+"v)", 8, 4,
+ // 4210752);
+ // fontRendererObj.drawString(mLocalName, 70, 69, 4210752);
+ }
- int tScale = ((GT_Container_CropHarvestor) this.mContainer).mWaterAmount;
- if (tScale > 0) {
- drawTexturedModalRect(x + 47, y + 61 - tScale, 204, 54 - tScale, 10, tScale);
- };
+ @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 (((GT_Container_CropHarvestor) mContainer).mModeAlternative) {
+ drawTexturedModalRect(x + 48, y + 64, 177, 37, 16, 16);
+ }
- private void drawTooltip(int x2, int y2) {
- int xStart = (width - xSize) / 2;
- int yStart = (height - ySize) / 2;
- int x = x2 - xStart;
- int y = y2 - yStart + 5;
- List<String> list = new ArrayList<>();
- if (y >= 68 && y <= 85) {
- if (x >= 47 && x <= 64) {
- if (((GT_Container_CropHarvestor) mContainer).mModeAlternative) {
- list.add("Disable Hydration/Fertilizing/Weed-EX");
- }
- else {
- list.add("Enable Hydration/Fertilizing/Weed-EX");
- }
- }
- }
- if (y >= 12 && y <= 66) {
- if (x >= 47 && x <= 56) {
- int aWater = ((GT_Container_CropHarvestor) mContainer).mWaterRealAmount;
- list.add("Water: "+aWater+"L / "+((GT_Container_CropHarvestor) mContainer).mTileEntity.getMetaTileEntity().getCapacity()+"L");
- }
- }
- if (!list.isEmpty()) {
- drawHoveringText(list, x, y, fontRendererObj);
- RenderHelper.enableGUIStandardItemLighting();
- }
- }
+ int tScale = ((GT_Container_CropHarvestor) this.mContainer).mWaterAmount;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 47, y + 61 - tScale, 204, 54 - tScale, 10, tScale);
+ }
+ ;
+ }
+ private void drawTooltip(int x2, int y2) {
+ int xStart = (width - xSize) / 2;
+ int yStart = (height - ySize) / 2;
+ int x = x2 - xStart;
+ int y = y2 - yStart + 5;
+ List<String> list = new ArrayList<>();
+ if (y >= 68 && y <= 85) {
+ if (x >= 47 && x <= 64) {
+ if (((GT_Container_CropHarvestor) mContainer).mModeAlternative) {
+ list.add("Disable Hydration/Fertilizing/Weed-EX");
+ } else {
+ list.add("Enable Hydration/Fertilizing/Weed-EX");
+ }
+ }
+ }
+ if (y >= 12 && y <= 66) {
+ if (x >= 47 && x <= 56) {
+ int aWater = ((GT_Container_CropHarvestor) mContainer).mWaterRealAmount;
+ list.add("Water: " + aWater + "L / "
+ + ((GT_Container_CropHarvestor) mContainer)
+ .mTileEntity
+ .getMetaTileEntity()
+ .getCapacity() + "L");
+ }
+ }
+ if (!list.isEmpty()) {
+ drawHoveringText(list, x, y, fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java
index 96e8e362ef..3e4280f650 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java
@@ -1,67 +1,76 @@
package gtPlusPlus.xmod.gregtech.api.gui.basic;
-import java.util.ArrayList;
-import java.util.List;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GUI_PollutionCleaner extends GT_GUIContainerMetaTile_Machine {
- public final String mName;
- public final String mNEI;
- public final byte mProgressBarDirection;
- public final byte mProgressBarAmount;
- public int mReduction;
+ public final String mName;
+ public final String mNEI;
+ public final byte mProgressBarDirection;
+ public final byte mProgressBarAmount;
+ public int mReduction;
- public GUI_PollutionCleaner(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final String aName, final String aTextureFile) {
- this(aInventoryPlayer, aTileEntity, aName, aTextureFile, "PollutionCleaner",(byte) 0, (byte) 1);
- }
+ public GUI_PollutionCleaner(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aTextureFile) {
+ this(aInventoryPlayer, aTileEntity, aName, aTextureFile, "PollutionCleaner", (byte) 0, (byte) 1);
+ }
- public GUI_PollutionCleaner(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final String aName, final String aTextureFile, final String aNEI, final byte aProgressBarDirection,
- final byte aProgressBarAmount) {
- super(new CONTAINER_PollutionCleaner(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "PollutionCleaner.png");
- this.mProgressBarDirection = aProgressBarDirection;
- this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount);
- this.mName = aName;
- this.mNEI = aNEI;
- }
+ public GUI_PollutionCleaner(
+ final InventoryPlayer aInventoryPlayer,
+ final IGregTechTileEntity aTileEntity,
+ final String aName,
+ final String aTextureFile,
+ final String aNEI,
+ final byte aProgressBarDirection,
+ final byte aProgressBarAmount) {
+ super(
+ new CONTAINER_PollutionCleaner(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + "PollutionCleaner.png");
+ this.mProgressBarDirection = aProgressBarDirection;
+ this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount);
+ this.mName = aName;
+ this.mNEI = aNEI;
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 8, 4, 4210752);
- this.drawTooltip(par1, par2);
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(this.mName, 8, 4, 4210752);
+ this.drawTooltip(par1, par2);
+ }
- private void drawTooltip(final int x2, final int y2) {
- final int xStart = (this.width - this.xSize) / 2;
- final int yStart = (this.height - this.ySize) / 2;
- final int x3 = x2 - xStart;
- final int y3 = y2 - yStart + 5;
- final List<String> list = new ArrayList<String>();
- if (y3 >= 67 && y3 <= 84) {
- if (x3 >= 77 && x3 <= 95) {
- //Do Dumb shit
- CONTAINER_PollutionCleaner aContainerCast = (CONTAINER_PollutionCleaner) this.mContainer;
- mReduction = aContainerCast.mReduction;
- list.add("Reduction: "+mReduction+"/s");
- }
- }
- if (!list.isEmpty()) {
- this.drawHoveringText(list, x3, y3, this.fontRendererObj);
- RenderHelper.enableGUIStandardItemLighting();
- }
- }
+ private void drawTooltip(final int x2, final int y2) {
+ final int xStart = (this.width - this.xSize) / 2;
+ final int yStart = (this.height - this.ySize) / 2;
+ final int x3 = x2 - xStart;
+ final int y3 = y2 - yStart + 5;
+ final List<String> list = new ArrayList<String>();
+ if (y3 >= 67 && y3 <= 84) {
+ if (x3 >= 77 && x3 <= 95) {
+ // Do Dumb shit
+ CONTAINER_PollutionCleaner aContainerCast = (CONTAINER_PollutionCleaner) this.mContainer;
+ mReduction = aContainerCast.mReduction;
+ list.add("Reduction: " + mReduction + "/s");
+ }
+ }
+ if (!list.isEmpty()) {
+ this.drawHoveringText(list, x3, y3, this.fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-} \ No newline at end of file
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java
index 8abe7bff66..5aa0da1c8c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.gui.computer;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.*;
@@ -12,398 +10,398 @@ import gtPlusPlus.core.slots.SlotDataStick;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube;
+import java.util.Iterator;
import net.minecraft.entity.player.*;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine {
- public long mEUOut;
- public int mEUOut1;
- public int mEUOut2;
+ public long mEUOut;
+ public int mEUOut1;
+ public int mEUOut2;
- public int mHeat;
+ public int mHeat;
- public int mMaxHeat;
+ public int mMaxHeat;
- public int mHEM;
+ public int mHEM;
- public int mExplosionStrength;
+ public int mExplosionStrength;
- public long mEU;
- public int mEU1;
- public int mEU2;
-
- public long mStoredEU;
- public int mStoredEU1;
- public int mStoredEU2;
- public long mMaxStoredEU;
- public int mMaxStoredEU1;
- public int mMaxStoredEU2;
+ public long mEU;
+ public int mEU1;
+ public int mEU2;
- public int mProgress;
+ public long mStoredEU;
+ public int mStoredEU1;
+ public int mStoredEU2;
+ public long mMaxStoredEU;
+ public int mMaxStoredEU1;
+ public int mMaxStoredEU2;
- public int mID;
+ public int mProgress;
- public GT_Container_ComputerCube(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aID) {
- super(aInventoryPlayer, aTileEntity);
- Logger.INFO("1 Container Mode: "+aID);
- Logger.INFO("2 Container Mode: "+getMode());
- mID = getMode();
- Logger.INFO("3 Container Mode: "+getMode());
- // addSlotsComputer(aInventoryPlayer);
- detectAndSendChanges();
- }
+ public int mID;
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotsComputer(aInventoryPlayer);
- }
+ public GT_Container_ComputerCube(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aID) {
+ super(aInventoryPlayer, aTileEntity);
+ Logger.INFO("1 Container Mode: " + aID);
+ Logger.INFO("2 Container Mode: " + getMode());
+ mID = getMode();
+ Logger.INFO("3 Container Mode: " + getMode());
+ // addSlotsComputer(aInventoryPlayer);
+ detectAndSendChanges();
+ }
- private int getMode() {
- return ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode;
- }
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotsComputer(aInventoryPlayer);
+ }
- public void addSlotsComputer(InventoryPlayer aInventoryPlayer) {
- int y;
- mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode;
- Logger.INFO(""+(Utils.isClient() ? "Client" : "Server")+" Mode: " + mID);
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156 + ((this.mID == 5) ? 50 : 0), 4, false, false, 1));
- switch (this.mID) {
- case 1 :
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 86, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 70, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 54, false, false, 1));
- for (y = 0; y < 6; y++) {
- for (int x = 0; x < 9; x++)
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, x + y * 9, 5 + x * 16, 5 + y * 16, false, false, 64));
- }
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 113, 153, 28, false, false, 64));
- break;
- case 2 :
- addSlotToContainer(new SlotDataStick(this.mTileEntity, 54, 8, 28));
- addSlotToContainer(new Slot(this.mTileEntity, 55, 26, 28));
- addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 56, 134, 28));
- addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 57, 152, 28));
- break;
- case 3 :
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 35, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 92, 5, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 122, 5, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 152, 35, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 122, 65, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 92, 35, false, false, 64));
- break;
- case 4 :
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 5, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 122, 65, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 152, 35, false, false, 64));
- break;
- case 5 :
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 190, 146, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 206, 146, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 206, 38, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 206, 56, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 206, 74, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 206, 92, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 206, 110, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 153, 7, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 65, 169, 7, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 66, 185, 7, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 67, 153, 23, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 68, 169, 23, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 69, 185, 23, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 70, 153, 39, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 71, 169, 39, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 72, 185, 39, false, false, 64));
- break;
- case 6 :
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 35, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 92, 5, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 122, 5, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 152, 35, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 122, 65, false, false, 64));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 92, 35, false, false, 64));
- break;
- }
- }
+ private int getMode() {
+ return ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode;
+ }
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- //Logger.INFO("Clicked slot " + aSlotIndex);
- if (aSlotIndex < 0) {
- //Logger.INFO("");
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
- if (this.mID != ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode) {
- //Logger.INFO("This ID: " + mID + ", Tile: " + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode);
- return null;
- }
- Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
- if (tSlot == null) {
- //Logger.INFO("Null Slot?");
- }
- else {
- ItemStack tStack = tSlot.getStack();
- //Logger.INFO("Good Slot!");
- if (aSlotIndex == 0) {
- //Logger.INFO("Slot is 0");
- if (aMouseclick == 0) {
- Logger.INFO("Forward");
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchModeForward();
- }
- else {
- Logger.INFO("Backwards");
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchModeBackward();
- }
- if (aPlayer instanceof EntityPlayerMP) {
- EntityPlayerMP aPlayerMP = (EntityPlayerMP) aPlayer;
- changePage(aPlayerMP, ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode);
- }
- //FMLNetworkHandler.openGui(entityPlayer, mod, modGuiId, world, x, y, z);
- //aPlayer.openGui(CORE.MODID, getComputerCubeGUIID(), this.mTileEntity.getWorld(), this.mTileEntity.getXCoord(), this.mTileEntity.getYCoord(), this.mTileEntity.getZCoord());
- }
- else if (aSlotIndex <= 2 && this.mID == 3) {
- if (aSlotIndex == 1) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchCentrifugePageBackward();
- onCraftMatrixChanged(this.mTileEntity);
- }
- else if (aSlotIndex == 2) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchCentrifugePageForward();
- onCraftMatrixChanged(this.mTileEntity);
- }
- }
- else if (aSlotIndex <= 2 && this.mID == 6) {
- if (aSlotIndex == 1) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchElectrolyzerPageBackward();
- onCraftMatrixChanged(this.mTileEntity);
- }
- else if (aSlotIndex == 2) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchElectrolyzerPageForward();
- onCraftMatrixChanged(this.mTileEntity);
- }
- }
- else if (aSlotIndex <= 2 && this.mID == 4) {
- if (aSlotIndex == 1) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchFusionPageBackward();
- onCraftMatrixChanged(this.mTileEntity);
- }
- else if (aSlotIndex == 2) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchFusionPageForward();
- onCraftMatrixChanged(this.mTileEntity);
- }
- }
- else if (aSlotIndex <= 2 && this.mID == 5) {
- if (aSlotIndex == 1) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchDescriptionPageBackward();
- onCraftMatrixChanged(this.mTileEntity);
- }
- else if (aSlotIndex == 2) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchDescriptionPageForward();
- onCraftMatrixChanged(this.mTileEntity);
- }
- }
- else if (aSlotIndex <= 58 && this.mID == 1) {
- if (aSlotIndex == 1) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchNuclearReactor();
- onCraftMatrixChanged(this.mTileEntity);
- }
- else if (aSlotIndex == 2) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).loadNuclearReactor();
- onCraftMatrixChanged(this.mTileEntity);
- }
- else if (aSlotIndex == 3) {
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).saveNuclearReactor();
- }
- else {
- if (aShifthold == 1) {
- tSlot.putStack(null);
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, null);
- return null;
- }
+ public void addSlotsComputer(InventoryPlayer aInventoryPlayer) {
+ int y;
+ mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode;
+ Logger.INFO("" + (Utils.isClient() ? "Client" : "Server") + " Mode: " + mID);
+ addSlotToContainer(
+ new GT_Slot_Holo(this.mTileEntity, 58, 156 + ((this.mID == 5) ? 50 : 0), 4, false, false, 1));
+ switch (this.mID) {
+ case 1:
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 86, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 70, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 54, false, false, 1));
+ for (y = 0; y < 6; y++) {
+ for (int x = 0; x < 9; x++)
+ addSlotToContainer(new GT_Slot_Holo(
+ this.mTileEntity, x + y * 9, 5 + x * 16, 5 + y * 16, false, false, 64));
+ }
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 113, 153, 28, false, false, 64));
+ break;
+ case 2:
+ addSlotToContainer(new SlotDataStick(this.mTileEntity, 54, 8, 28));
+ addSlotToContainer(new Slot(this.mTileEntity, 55, 26, 28));
+ addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 56, 134, 28));
+ addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 57, 152, 28));
+ break;
+ case 3:
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 35, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 92, 5, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 122, 5, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 152, 35, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 122, 65, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 92, 35, false, false, 64));
+ break;
+ case 4:
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 5, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 122, 65, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 152, 35, false, false, 64));
+ break;
+ case 5:
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 190, 146, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 206, 146, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 206, 38, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 206, 56, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 206, 74, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 206, 92, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 206, 110, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 153, 7, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 65, 169, 7, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 66, 185, 7, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 67, 153, 23, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 68, 169, 23, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 69, 185, 23, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 70, 153, 39, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 71, 169, 39, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 72, 185, 39, false, false, 64));
+ break;
+ case 6:
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 35, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 92, 5, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 122, 5, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 152, 35, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 122, 65, false, false, 64));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 92, 35, false, false, 64));
+ break;
+ }
+ }
- if (aMouseclick == 1) {
- tSlot.putStack(null);
- }
- if (aMouseclick == 0) {
- if (tStack == null) {
- if (getSlot(58).getStack() != null && aSlotIndex != 58) {
- tSlot.putStack(getSlot(58).getStack().copy());
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, new GT_ItemStack(getSlot(58).getStack().copy()));
- }
- else {
- tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(0).mItem, 1));
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(0));
- }
- return null;
- }
- for (int i = 1; i < GT_TileEntity_ComputerCube.sReactorList.size(); i++) {
- if (GT_TileEntity_ComputerCube.sReactorList.get(i - 1).mItem == tStack.getItem()) {
- tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(i).mItem, 1, 0));
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(i));
- /*if (tSlot.getStack() != null && tSlot.getStack().getItem() == GT_ModHandler.getIC2Item("reactorIsotopeCell", 1).getItem()) {
- tSlot.getStack().setItemDamage(tSlot.getStack().getMaxDamage() - 1);
- }*/
- return null;
- }
- }
- tSlot.putStack(null);
- ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, null);
- return null;
- }
- if (tStack == null)
- return null;
- if (tStack.stackSize < tStack.getMaxStackSize()) {
- tStack.stackSize++;
- return null;
- }
- tStack.stackSize = 1;
- return null;
- }
- }
- else {
- //Logger.INFO("Super 2");
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
- }
- //Logger.INFO("???");
- return null;
- }
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ // Logger.INFO("Clicked slot " + aSlotIndex);
+ if (aSlotIndex < 0) {
+ // Logger.INFO("");
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ if (this.mID != ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode) {
+ // Logger.INFO("This ID: " + mID + ", Tile: " + ((GT_TileEntity_ComputerCube)
+ // mTileEntity.getMetaTileEntity()).mMode);
+ return null;
+ }
+ Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
+ if (tSlot == null) {
+ // Logger.INFO("Null Slot?");
+ } else {
+ ItemStack tStack = tSlot.getStack();
+ // Logger.INFO("Good Slot!");
+ if (aSlotIndex == 0) {
+ // Logger.INFO("Slot is 0");
+ if (aMouseclick == 0) {
+ Logger.INFO("Forward");
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchModeForward();
+ } else {
+ Logger.INFO("Backwards");
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchModeBackward();
+ }
+ if (aPlayer instanceof EntityPlayerMP) {
+ EntityPlayerMP aPlayerMP = (EntityPlayerMP) aPlayer;
+ changePage(aPlayerMP, ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode);
+ }
+ // FMLNetworkHandler.openGui(entityPlayer, mod, modGuiId, world, x, y, z);
+ // aPlayer.openGui(CORE.MODID, getComputerCubeGUIID(), this.mTileEntity.getWorld(),
+ // this.mTileEntity.getXCoord(), this.mTileEntity.getYCoord(), this.mTileEntity.getZCoord());
+ } else if (aSlotIndex <= 2 && this.mID == 3) {
+ if (aSlotIndex == 1) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchCentrifugePageBackward();
+ onCraftMatrixChanged(this.mTileEntity);
+ } else if (aSlotIndex == 2) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchCentrifugePageForward();
+ onCraftMatrixChanged(this.mTileEntity);
+ }
+ } else if (aSlotIndex <= 2 && this.mID == 6) {
+ if (aSlotIndex == 1) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchElectrolyzerPageBackward();
+ onCraftMatrixChanged(this.mTileEntity);
+ } else if (aSlotIndex == 2) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchElectrolyzerPageForward();
+ onCraftMatrixChanged(this.mTileEntity);
+ }
+ } else if (aSlotIndex <= 2 && this.mID == 4) {
+ if (aSlotIndex == 1) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchFusionPageBackward();
+ onCraftMatrixChanged(this.mTileEntity);
+ } else if (aSlotIndex == 2) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchFusionPageForward();
+ onCraftMatrixChanged(this.mTileEntity);
+ }
+ } else if (aSlotIndex <= 2 && this.mID == 5) {
+ if (aSlotIndex == 1) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchDescriptionPageBackward();
+ onCraftMatrixChanged(this.mTileEntity);
+ } else if (aSlotIndex == 2) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchDescriptionPageForward();
+ onCraftMatrixChanged(this.mTileEntity);
+ }
+ } else if (aSlotIndex <= 58 && this.mID == 1) {
+ if (aSlotIndex == 1) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchNuclearReactor();
+ onCraftMatrixChanged(this.mTileEntity);
+ } else if (aSlotIndex == 2) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).loadNuclearReactor();
+ onCraftMatrixChanged(this.mTileEntity);
+ } else if (aSlotIndex == 3) {
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).saveNuclearReactor();
+ } else {
+ if (aShifthold == 1) {
+ tSlot.putStack(null);
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity())
+ .getSimulator()
+ .slotClick(aSlotIndex, null);
+ return null;
+ }
+ if (aMouseclick == 1) {
+ tSlot.putStack(null);
+ }
+ if (aMouseclick == 0) {
+ if (tStack == null) {
+ if (getSlot(58).getStack() != null && aSlotIndex != 58) {
+ tSlot.putStack(getSlot(58).getStack().copy());
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity())
+ .getSimulator()
+ .slotClick(
+ aSlotIndex,
+ new GT_ItemStack(
+ getSlot(58).getStack().copy()));
+ } else {
+ tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(0).mItem, 1));
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity())
+ .getSimulator()
+ .slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(0));
+ }
+ return null;
+ }
+ for (int i = 1; i < GT_TileEntity_ComputerCube.sReactorList.size(); i++) {
+ if (GT_TileEntity_ComputerCube.sReactorList.get(i - 1).mItem == tStack.getItem()) {
+ tSlot.putStack(
+ new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(i).mItem, 1, 0));
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity())
+ .getSimulator()
+ .slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(i));
+ /*if (tSlot.getStack() != null && tSlot.getStack().getItem() == GT_ModHandler.getIC2Item("reactorIsotopeCell", 1).getItem()) {
+ tSlot.getStack().setItemDamage(tSlot.getStack().getMaxDamage() - 1);
+ }*/
+ return null;
+ }
+ }
+ tSlot.putStack(null);
+ ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity())
+ .getSimulator()
+ .slotClick(aSlotIndex, null);
+ return null;
+ }
+ if (tStack == null) return null;
+ if (tStack.stackSize < tStack.getMaxStackSize()) {
+ tStack.stackSize++;
+ return null;
+ }
+ tStack.stackSize = 1;
+ return null;
+ }
+ } else {
+ // Logger.INFO("Super 2");
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ }
+ // Logger.INFO("???");
+ return null;
+ }
+ public void changePage(EntityPlayerMP aPlayerMP, int aMode) {
+ GT_TileEntity_ComputerCube aCompTile = (GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity();
+ aCompTile.onRightclick(mTileEntity, aPlayerMP);
+ }
- public void changePage(EntityPlayerMP aPlayerMP, int aMode) {
- GT_TileEntity_ComputerCube aCompTile = (GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity();
- aCompTile.onRightclick(mTileEntity, aPlayerMP);
- }
+ public boolean doesBindPlayerInventory() {
+ return (this.mID != 1 && this.mID != 5);
+ }
- public boolean doesBindPlayerInventory() {
- return (this.mID != 1 && this.mID != 5);
- }
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
+ return;
+ }
+ mStoredEU = mTileEntity.getStoredEU();
+ mMaxStoredEU = mTileEntity.getEUCapacity();
+ int[] aStored = MathUtils.splitLongIntoTwoIntegers(mStoredEU);
+ int[] aMaxStorage = MathUtils.splitLongIntoTwoIntegers(mMaxStoredEU);
+ mStoredEU1 = aStored[0];
+ mStoredEU2 = aStored[1];
+ mMaxStoredEU1 = aMaxStorage[0];
+ mMaxStoredEU2 = aMaxStorage[1];
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
- return;
- }
- mStoredEU = mTileEntity.getStoredEU();
- mMaxStoredEU = mTileEntity.getEUCapacity();
- int[] aStored = MathUtils.splitLongIntoTwoIntegers(mStoredEU);
- int[] aMaxStorage = MathUtils.splitLongIntoTwoIntegers(mMaxStoredEU);
- mStoredEU1 = aStored[0];
- mStoredEU2 = aStored[1];
- mMaxStoredEU1 = aMaxStorage[0];
- mMaxStoredEU2 = aMaxStorage[1];
-
-
- this.mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode;
- this.mEUOut = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEUOut;
- int[] aEUSplit1 = MathUtils.splitLongIntoTwoIntegers(mEUOut);
- this.mEUOut1 = aEUSplit1[0];
- this.mEUOut2 = aEUSplit1[1];
- this.mHeat = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mHeat;
- this.mMaxHeat = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMaxHeat;
- this.mHEM = (int) (((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mHEM * 10000.0F);
- this.mExplosionStrength = (int) (((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mExplosionStrength * 100.0F);
- this.mEU = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEU;
- this.mProgress = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mProgress;
- this.mMaxProgressTime = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMaxProgress;
- this.mProgressTime = (int) ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getEUVar();
- int[] aEUSplit2 = MathUtils.splitLongIntoTwoIntegers(mEU);
- this.mEU1 = aEUSplit2[0];
- this.mEU2 = aEUSplit2[1];
- Iterator<ICrafting> var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = var2.next();
- var1.sendProgressBarUpdate(this, 101, this.mID);
- var1.sendProgressBarUpdate(this, 102, this.mHeat & 0xFFFF);
- var1.sendProgressBarUpdate(this, 103, this.mMaxHeat & 0xFFFF);
- var1.sendProgressBarUpdate(this, 104, this.mHEM);
- var1.sendProgressBarUpdate(this, 105, this.mExplosionStrength);
- var1.sendProgressBarUpdate(this, 106, this.mHeat >>> 16);
- var1.sendProgressBarUpdate(this, 107, this.mMaxHeat >>> 16);
- var1.sendProgressBarUpdate(this, 108, this.mEU1);
- var1.sendProgressBarUpdate(this, 109, this.mEU2);
- var1.sendProgressBarUpdate(this, 110, this.mProgress);
- var1.sendProgressBarUpdate(this, 111, this.mEUOut1);
- var1.sendProgressBarUpdate(this, 112, this.mEUOut2);
- var1.sendProgressBarUpdate(this, 113, mStoredEU1);
- var1.sendProgressBarUpdate(this, 114, mStoredEU2);
- var1.sendProgressBarUpdate(this, 115, mMaxStoredEU1);
- var1.sendProgressBarUpdate(this, 116, mMaxStoredEU2);
- }
- }
+ this.mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode;
+ this.mEUOut = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEUOut;
+ int[] aEUSplit1 = MathUtils.splitLongIntoTwoIntegers(mEUOut);
+ this.mEUOut1 = aEUSplit1[0];
+ this.mEUOut2 = aEUSplit1[1];
+ this.mHeat = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mHeat;
+ this.mMaxHeat = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMaxHeat;
+ this.mHEM = (int) (((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mHEM * 10000.0F);
+ this.mExplosionStrength =
+ (int) (((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mExplosionStrength * 100.0F);
+ this.mEU = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEU;
+ this.mProgress = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mProgress;
+ this.mMaxProgressTime = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMaxProgress;
+ this.mProgressTime = (int) ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getEUVar();
+ int[] aEUSplit2 = MathUtils.splitLongIntoTwoIntegers(mEU);
+ this.mEU1 = aEUSplit2[0];
+ this.mEU2 = aEUSplit2[1];
+ Iterator<ICrafting> var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = var2.next();
+ var1.sendProgressBarUpdate(this, 101, this.mID);
+ var1.sendProgressBarUpdate(this, 102, this.mHeat & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 103, this.mMaxHeat & 0xFFFF);
+ var1.sendProgressBarUpdate(this, 104, this.mHEM);
+ var1.sendProgressBarUpdate(this, 105, this.mExplosionStrength);
+ var1.sendProgressBarUpdate(this, 106, this.mHeat >>> 16);
+ var1.sendProgressBarUpdate(this, 107, this.mMaxHeat >>> 16);
+ var1.sendProgressBarUpdate(this, 108, this.mEU1);
+ var1.sendProgressBarUpdate(this, 109, this.mEU2);
+ var1.sendProgressBarUpdate(this, 110, this.mProgress);
+ var1.sendProgressBarUpdate(this, 111, this.mEUOut1);
+ var1.sendProgressBarUpdate(this, 112, this.mEUOut2);
+ var1.sendProgressBarUpdate(this, 113, mStoredEU1);
+ var1.sendProgressBarUpdate(this, 114, mStoredEU2);
+ var1.sendProgressBarUpdate(this, 115, mMaxStoredEU1);
+ var1.sendProgressBarUpdate(this, 116, mMaxStoredEU2);
+ }
+ }
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 101 :
- this.mID = par2;
- break;
- case 102 :
- this.mHeat = this.mHeat & 0xFFFF0000 | par2;
- break;
- case 103 :
- this.mMaxHeat = this.mMaxHeat & 0xFFFF0000 | par2;
- break;
- case 104 :
- this.mHEM = par2;
- break;
- case 105 :
- this.mExplosionStrength = par2;
- break;
- case 106 :
- this.mHeat = this.mHeat & 0xFFFF | par2 << 16;
- break;
- case 107 :
- this.mMaxHeat = this.mMaxHeat & 0xFFFF | par2 << 16;
- break;
- case 108 :
- this.mEU1 = par2;
- case 109 :
- this.mEU2 = par2;
- this.mEU = MathUtils.combineTwoIntegersToLong(mEU1, mEU2);
- break;
- case 110 :
- this.mProgress = par2;
- break;
- case 111 :
- this.mEUOut1 = par2;
- case 112 :
- this.mEUOut2 = par2;
- this.mEUOut = MathUtils.combineTwoIntegersToLong(mEUOut1, mEUOut2);
- break;
- case 113 :
- mStoredEU1 = par2;
- break;
- case 114 :
- mStoredEU2 = par2;
- mStoredEU = MathUtils.combineTwoIntegersToLong(mStoredEU1, mStoredEU2);
- break;
- case 115 :
- mMaxStoredEU1 = par2;
- break;
- case 116 :
- mMaxStoredEU2 = par2;
- mMaxStoredEU = MathUtils.combineTwoIntegersToLong(mMaxStoredEU1, mMaxStoredEU2);
- break;
- }
- }
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 101:
+ this.mID = par2;
+ break;
+ case 102:
+ this.mHeat = this.mHeat & 0xFFFF0000 | par2;
+ break;
+ case 103:
+ this.mMaxHeat = this.mMaxHeat & 0xFFFF0000 | par2;
+ break;
+ case 104:
+ this.mHEM = par2;
+ break;
+ case 105:
+ this.mExplosionStrength = par2;
+ break;
+ case 106:
+ this.mHeat = this.mHeat & 0xFFFF | par2 << 16;
+ break;
+ case 107:
+ this.mMaxHeat = this.mMaxHeat & 0xFFFF | par2 << 16;
+ break;
+ case 108:
+ this.mEU1 = par2;
+ case 109:
+ this.mEU2 = par2;
+ this.mEU = MathUtils.combineTwoIntegersToLong(mEU1, mEU2);
+ break;
+ case 110:
+ this.mProgress = par2;
+ break;
+ case 111:
+ this.mEUOut1 = par2;
+ case 112:
+ this.mEUOut2 = par2;
+ this.mEUOut = MathUtils.combineTwoIntegersToLong(mEUOut1, mEUOut2);
+ break;
+ case 113:
+ mStoredEU1 = par2;
+ break;
+ case 114:
+ mStoredEU2 = par2;
+ mStoredEU = MathUtils.combineTwoIntegersToLong(mStoredEU1, mStoredEU2);
+ break;
+ case 115:
+ mMaxStoredEU1 = par2;
+ break;
+ case 116:
+ mMaxStoredEU2 = par2;
+ mMaxStoredEU = MathUtils.combineTwoIntegersToLong(mMaxStoredEU1, mMaxStoredEU2);
+ break;
+ }
+ }
- public int getSlotStartIndex() {
- return 1;
- }
+ public int getSlotStartIndex() {
+ return 1;
+ }
- public int getSlotCount() {
- return (this.mID == 2) ? 4 : 0;
- }
+ public int getSlotCount() {
+ return (this.mID == 2) ? 4 : 0;
+ }
- public int getShiftClickSlotCount() {
- return (this.mID == 2) ? 2 : 0;
- }
+ public int getShiftClickSlotCount() {
+ return (this.mID == 2) ? 2 : 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_RedstoneCircuitBlock.java
index acae0d39c5..d02061185a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_RedstoneCircuitBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_RedstoneCircuitBlock.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.gui.computer;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
@@ -9,6 +7,7 @@ import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.xmod.gregtech.common.tileentities.redstone.GT_MetaTileEntity_RedstoneCircuitBlock;
+import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
@@ -18,159 +17,159 @@ import net.minecraftforge.oredict.OreDictionary;
public class GT_Container_RedstoneCircuitBlock extends GT_ContainerMetaTile_Machine {
- public GT_Container_RedstoneCircuitBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public GT_Container_RedstoneCircuitBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 6, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 24, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 42, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 60, false, true, 1));
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 6, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 24, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 42, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 60, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 152, 6, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 152, 24, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 152, 42, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 152, 6, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 152, 24, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 152, 42, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 1, 26, 6, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 24, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 3, 26, 42, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 4, 26, 60, false, true, 1));
- }
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 1, 26, 6, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 24, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 3, 26, 42, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 4, 26, 60, false, true, 1));
+ }
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (aSlotIndex < 0 || aSlotIndex > 6)
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ if (aSlotIndex < 0 || aSlotIndex > 6) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- Slot tSlot = (Slot) inventorySlots.get(aSlotIndex);
- if (tSlot != null) {
- if (mTileEntity.getMetaTileEntity() == null)
- return null;
- if (aSlotIndex < 4) {
- ItemStack tStack = aPlayer.inventory.getItemStack();
- if (tStack == null) {
- ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).changeGateData(aSlotIndex, aMouseclick == 0 ? aShifthold == 0 ? +1 : aShifthold == 1 ? +128 : +16 : aShifthold == 0 ? -1 : aShifthold == 1 ? -128 : -16);
- }
- else {
- tStack = GT_Utility.copy(tStack);
- if (aMouseclick != 0)
- tStack.setItemDamage(OreDictionary.WILDCARD_VALUE);
- ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).stackGateData(aSlotIndex, tStack);
- }
- return null;
- }
- else if (aSlotIndex == 4) {
- ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).switchOutput();
- }
- else if (aSlotIndex == 5) {
- mTileEntity.setActive(!mTileEntity.isActive());
- }
- else if (aSlotIndex == 6) {
- if (aMouseclick == 0)
- ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).switchGateForward(aShifthold != 0);
- else
- ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).switchGateBackward(aShifthold != 0);
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
+ Slot tSlot = (Slot) inventorySlots.get(aSlotIndex);
+ if (tSlot != null) {
+ if (mTileEntity.getMetaTileEntity() == null) return null;
+ if (aSlotIndex < 4) {
+ ItemStack tStack = aPlayer.inventory.getItemStack();
+ if (tStack == null) {
+ ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity())
+ .changeGateData(
+ aSlotIndex,
+ aMouseclick == 0
+ ? aShifthold == 0 ? +1 : aShifthold == 1 ? +128 : +16
+ : aShifthold == 0 ? -1 : aShifthold == 1 ? -128 : -16);
+ } else {
+ tStack = GT_Utility.copy(tStack);
+ if (aMouseclick != 0) tStack.setItemDamage(OreDictionary.WILDCARD_VALUE);
+ ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity())
+ .stackGateData(aSlotIndex, tStack);
+ }
+ return null;
+ } else if (aSlotIndex == 4) {
+ ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).switchOutput();
+ } else if (aSlotIndex == 5) {
+ mTileEntity.setActive(!mTileEntity.isActive());
+ } else if (aSlotIndex == 6) {
+ if (aMouseclick == 0)
+ ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity())
+ .switchGateForward(aShifthold != 0);
+ else
+ ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity())
+ .switchGateBackward(aShifthold != 0);
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
- public int mData[] = new int[]{0, 0, 0, 0, 0, 0, 0, 0}, mGate = 0;
+ public int mData[] = new int[] {0, 0, 0, 0, 0, 0, 0, 0}, mGate = 0;
- @SuppressWarnings("rawtypes")
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null)
- return;
- mGate = ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).mGate;
- mData = ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).mGateData;
+ @SuppressWarnings("rawtypes")
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
+ mGate = ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).mGate;
+ mData = ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).mGateData;
- Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 100, mGate & 65535);
- var1.sendProgressBarUpdate(this, 101, mGate >>> 16);
- var1.sendProgressBarUpdate(this, 102, mData[0] & 65535);
- var1.sendProgressBarUpdate(this, 103, mData[0] >>> 16);
- var1.sendProgressBarUpdate(this, 104, mData[1] & 65535);
- var1.sendProgressBarUpdate(this, 105, mData[1] >>> 16);
- var1.sendProgressBarUpdate(this, 106, mData[2] & 65535);
- var1.sendProgressBarUpdate(this, 107, mData[2] >>> 16);
- var1.sendProgressBarUpdate(this, 108, mData[3] & 65535);
- var1.sendProgressBarUpdate(this, 109, mData[3] >>> 16);
- var1.sendProgressBarUpdate(this, 110, mData[4] & 65535);
- var1.sendProgressBarUpdate(this, 111, mData[4] >>> 16);
- var1.sendProgressBarUpdate(this, 112, mData[5] & 65535);
- var1.sendProgressBarUpdate(this, 113, mData[5] >>> 16);
- var1.sendProgressBarUpdate(this, 114, mData[6] & 65535);
- var1.sendProgressBarUpdate(this, 115, mData[6] >>> 16);
- var1.sendProgressBarUpdate(this, 116, mData[7] & 65535);
- var1.sendProgressBarUpdate(this, 117, mData[7] >>> 16);
- }
- }
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 100, mGate & 65535);
+ var1.sendProgressBarUpdate(this, 101, mGate >>> 16);
+ var1.sendProgressBarUpdate(this, 102, mData[0] & 65535);
+ var1.sendProgressBarUpdate(this, 103, mData[0] >>> 16);
+ var1.sendProgressBarUpdate(this, 104, mData[1] & 65535);
+ var1.sendProgressBarUpdate(this, 105, mData[1] >>> 16);
+ var1.sendProgressBarUpdate(this, 106, mData[2] & 65535);
+ var1.sendProgressBarUpdate(this, 107, mData[2] >>> 16);
+ var1.sendProgressBarUpdate(this, 108, mData[3] & 65535);
+ var1.sendProgressBarUpdate(this, 109, mData[3] >>> 16);
+ var1.sendProgressBarUpdate(this, 110, mData[4] & 65535);
+ var1.sendProgressBarUpdate(this, 111, mData[4] >>> 16);
+ var1.sendProgressBarUpdate(this, 112, mData[5] & 65535);
+ var1.sendProgressBarUpdate(this, 113, mData[5] >>> 16);
+ var1.sendProgressBarUpdate(this, 114, mData[6] & 65535);
+ var1.sendProgressBarUpdate(this, 115, mData[6] >>> 16);
+ var1.sendProgressBarUpdate(this, 116, mData[7] & 65535);
+ var1.sendProgressBarUpdate(this, 117, mData[7] >>> 16);
+ }
+ }
- public void addCraftingToCrafters(ICrafting par1ICrafting) {
- super.addCraftingToCrafters(par1ICrafting);
- }
+ public void addCraftingToCrafters(ICrafting par1ICrafting) {
+ super.addCraftingToCrafters(par1ICrafting);
+ }
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 100 :
- mGate = mGate & -65536 | par2;
- break;
- case 101 :
- mGate = mGate & 65535 | par2 << 16;
- break;
- case 102 :
- mData[0] = mData[0] & -65536 | par2;
- break;
- case 103 :
- mData[0] = mData[0] & 65535 | par2 << 16;
- break;
- case 104 :
- mData[1] = mData[1] & -65536 | par2;
- break;
- case 105 :
- mData[1] = mData[1] & 65535 | par2 << 16;
- break;
- case 106 :
- mData[2] = mData[2] & -65536 | par2;
- break;
- case 107 :
- mData[2] = mData[2] & 65535 | par2 << 16;
- break;
- case 108 :
- mData[3] = mData[3] & -65536 | par2;
- break;
- case 109 :
- mData[3] = mData[3] & 65535 | par2 << 16;
- break;
- case 110 :
- mData[4] = mData[4] & -65536 | par2;
- break;
- case 111 :
- mData[4] = mData[4] & 65535 | par2 << 16;
- break;
- case 112 :
- mData[5] = mData[5] & -65536 | par2;
- break;
- case 113 :
- mData[5] = mData[5] & 65535 | par2 << 16;
- break;
- case 114 :
- mData[6] = mData[6] & -65536 | par2;
- break;
- case 115 :
- mData[6] = mData[6] & 65535 | par2 << 16;
- break;
- case 116 :
- mData[7] = mData[7] & -65536 | par2;
- break;
- case 117 :
- mData[7] = mData[7] & 65535 | par2 << 16;
- break;
- }
- }
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ mGate = mGate & -65536 | par2;
+ break;
+ case 101:
+ mGate = mGate & 65535 | par2 << 16;
+ break;
+ case 102:
+ mData[0] = mData[0] & -65536 | par2;
+ break;
+ case 103:
+ mData[0] = mData[0] & 65535 | par2 << 16;
+ break;
+ case 104:
+ mData[1] = mData[1] & -65536 | par2;
+ break;
+ case 105:
+ mData[1] = mData[1] & 65535 | par2 << 16;
+ break;
+ case 106:
+ mData[2] = mData[2] & -65536 | par2;
+ break;
+ case 107:
+ mData[2] = mData[2] & 65535 | par2 << 16;
+ break;
+ case 108:
+ mData[3] = mData[3] & -65536 | par2;
+ break;
+ case 109:
+ mData[3] = mData[3] & 65535 | par2 << 16;
+ break;
+ case 110:
+ mData[4] = mData[4] & -65536 | par2;
+ break;
+ case 111:
+ mData[4] = mData[4] & 65535 | par2 << 16;
+ break;
+ case 112:
+ mData[5] = mData[5] & -65536 | par2;
+ break;
+ case 113:
+ mData[5] = mData[5] & 65535 | par2 << 16;
+ break;
+ case 114:
+ mData[6] = mData[6] & -65536 | par2;
+ break;
+ case 115:
+ mData[6] = mData[6] & 65535 | par2 << 16;
+ break;
+ case 116:
+ mData[7] = mData[7] & -65536 | par2;
+ break;
+ case 117:
+ mData[7] = mData[7] & 65535 | par2 << 16;
+ break;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java
index 71defdc72a..c7d2c47f7b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java
@@ -14,159 +14,212 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machine {
-
- public final GT_Container_ComputerCube mPowerContainer;
-
- public GT_GUIContainer_ComputerCube(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aBaseMetaTileEntity, int aID) {
- super(new GT_Container_ComputerCube(aInventoryPlayer, aBaseMetaTileEntity, aID), CORE.RES_PATH_GUI + "computer/"+aID+".png");
- mPowerContainer = (GT_Container_ComputerCube) mContainer;
- if (mPowerContainer.mID == 5) {
- this.xSize += 50;
- }
- }
-
+
+ public final GT_Container_ComputerCube mPowerContainer;
+
+ public GT_GUIContainer_ComputerCube(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aBaseMetaTileEntity, int aID) {
+ super(
+ new GT_Container_ComputerCube(aInventoryPlayer, aBaseMetaTileEntity, aID),
+ CORE.RES_PATH_GUI + "computer/" + aID + ".png");
+ mPowerContainer = (GT_Container_ComputerCube) mContainer;
+ if (mPowerContainer.mID == 5) {
+ this.xSize += 50;
+ }
+ }
public static ResourceLocation[] mGUIbackground = new ResourceLocation[8];
-
+
static {
- mGUIbackground[0] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/0.png");
- mGUIbackground[1] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/1.png");
- mGUIbackground[2] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/2.png");
- mGUIbackground[3] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/3.png");
- mGUIbackground[4] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/4.png");
- mGUIbackground[5] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/5.png");
- mGUIbackground[6] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/6.png");
- mGUIbackground[7] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/Redstone.png");
-
+ mGUIbackground[0] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/0.png");
+ mGUIbackground[1] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/1.png");
+ mGUIbackground[2] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/2.png");
+ mGUIbackground[3] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/3.png");
+ mGUIbackground[4] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/4.png");
+ mGUIbackground[5] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/5.png");
+ mGUIbackground[6] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/6.png");
+ mGUIbackground[7] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/Redstone.png");
}
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- GT_Container_ComputerCube tContainer = (GT_Container_ComputerCube) this.mContainer;
- //Logger.INFO("3 GUI Mode: "+xSize);
- //GT_TileEntity_ComputerCube tTileEntity = (GT_TileEntity_ComputerCube) tContainer.mTileEntity;
- if (tContainer != null)
- switch (tContainer.mID) {
- case 0 :
- this.fontRendererObj.drawString("Solaris 1.7.10", 56, 70, Utils.rgbtoHexValue(100, 190, 255));
- //this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
- break;
- case 1 :
- this.fontRendererObj.drawString("Reactorstats:", 7, 108, 16448255);
- this.fontRendererObj.drawString(toNumber(tContainer.mEU) + "EU at " + tContainer.mEUOut + "EU/t", 7, 120, 16448255);
- this.fontRendererObj.drawString("HEM: " + (tContainer.mHEM / 10000.0F), 7, 128, 16448255);
- this.fontRendererObj.drawString(toNumber(tContainer.mHeat) + "/" + toNumber(tContainer.mMaxHeat) + "Heat", 7, 136, 16448255);
- this.fontRendererObj.drawString("Explosionpower: " + (tContainer.mExplosionStrength / 100.0F), 7, 144, 16448255);
- this.fontRendererObj.drawString("Runtime: " + ((tContainer.mProgress > 0) ? (/*(tContainer.mEU / tContainer.mEUOut)*/ tContainer.mProgress / 20) : 0) + "secs", 7, 152, 16448255);
- break;
- case 2 :
- this.fontRendererObj.drawString("Scanner", 51, 7, 16448255);
- if (tContainer.mProgress == 0) {
- this.fontRendererObj.drawString("Can be used to", 51, 24, 16448255);
- this.fontRendererObj.drawString("scan things", 51, 32, 16448255);
- this.fontRendererObj.drawString("Currently", 51, 48, Utils.rgbtoHexValue(200, 20, 20));
- this.fontRendererObj.drawString("Disabled", 51, 56, Utils.rgbtoHexValue(200, 20, 20));
- }
- else {
- this.fontRendererObj.drawString("Progress:", 51, 24, 16448255);
- this.fontRendererObj.drawString(MathUtils.findPercentage(tContainer.mProgress, tContainer.mMaxProgressTime) + " %", 51, 32, 16448255);
- }
- this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
- break;
- case 3 :
- this.fontRendererObj.drawString("Centrifuge", 7, 7, 16448255);
- this.fontRendererObj.drawString("Recipe: " + (tContainer.mMaxHeat + 1) + "/" + GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size(), 7, 23, 16448255);
- this.fontRendererObj.drawString("EU: " + toNumber(tContainer.mEU), 7, 31, 16448255);
- break;
- case 4 :
- this.fontRendererObj.drawString("Fusionreactor", 7, 7, 16448255);
- this.fontRendererObj.drawString("Recipe: " + (tContainer.mMaxHeat + 1) + "/" + GT_TileEntity_ComputerCube.sFusionReactorRecipes.size(), 7, 15, 16448255);
- this.fontRendererObj.drawString("Start: " + toNumber(tContainer.mEU) + "EU", 7, 23, 16448255);
- this.fontRendererObj.drawString("EU/t: " + toNumber(tContainer.mEUOut), 7, 31, 16448255);
- this.fontRendererObj.drawString(toNumber(tContainer.mHeat) + " Ticks", 7, 39, 16448255);
- GT_Recipe tRecipe = GT_TileEntity_ComputerCube.sFusionReactorRecipes.get(tContainer.mMaxHeat);
- this.fontRendererObj.drawString(""+tRecipe.mFluidOutputs[0].getLocalizedName(), 7, 55, 16448255);
- if (tContainer.mEUOut < 0) {
- this.fontRendererObj.drawString("IN: " + toNumber(-tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 47, 16448255);
- break;
- }
- this.fontRendererObj.drawString("OUT: " + toNumber(tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 47, 16448255);
- break;
- case 5 :
- if (tContainer.mID == 5 && this.xSize == 176) {
- this.xSize += 50;
- }
- if (tContainer.mMaxHeat >= 0 && tContainer.mMaxHeat < GT_Computercube_Description.sDescriptions.size())
- for (int i = 0; i < ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(tContainer.mMaxHeat)).mDescription.length; i++) {
- if (i == 0) {
- this.fontRendererObj.drawString(((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(tContainer.mMaxHeat)).mDescription[i], 7, 7, 16448255);
- }
- else {
- this.fontRendererObj.drawString(((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(tContainer.mMaxHeat)).mDescription[i], 7, 7
- + 8 * i, 16448255);
- }
- }
- break;
- case 6 :
- this.fontRendererObj.drawString("Electrolyzer", 7, 7, 16448255);
- this.fontRendererObj.drawString("Recipe: " + (tContainer.mMaxHeat + 1) + "/" + GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size(), 7, 23, 16448255);
- this.fontRendererObj.drawString("EU: " + toNumber(tContainer.mEU), 7, 31, 16448255);
- break;
- }
- }
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ GT_Container_ComputerCube tContainer = (GT_Container_ComputerCube) this.mContainer;
+ // Logger.INFO("3 GUI Mode: "+xSize);
+ // GT_TileEntity_ComputerCube tTileEntity = (GT_TileEntity_ComputerCube) tContainer.mTileEntity;
+ if (tContainer != null)
+ switch (tContainer.mID) {
+ case 0:
+ this.fontRendererObj.drawString("Solaris 1.7.10", 56, 70, Utils.rgbtoHexValue(100, 190, 255));
+ // this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8,
+ // this.ySize - 96 + 2, 4210752);
+ break;
+ case 1:
+ this.fontRendererObj.drawString("Reactorstats:", 7, 108, 16448255);
+ this.fontRendererObj.drawString(
+ toNumber(tContainer.mEU) + "EU at " + tContainer.mEUOut + "EU/t", 7, 120, 16448255);
+ this.fontRendererObj.drawString("HEM: " + (tContainer.mHEM / 10000.0F), 7, 128, 16448255);
+ this.fontRendererObj.drawString(
+ toNumber(tContainer.mHeat) + "/" + toNumber(tContainer.mMaxHeat) + "Heat",
+ 7,
+ 136,
+ 16448255);
+ this.fontRendererObj.drawString(
+ "Explosionpower: " + (tContainer.mExplosionStrength / 100.0F), 7, 144, 16448255);
+ this.fontRendererObj.drawString(
+ "Runtime: "
+ + ((tContainer.mProgress > 0)
+ ? (
+ /*(tContainer.mEU / tContainer.mEUOut)*/ tContainer.mProgress / 20)
+ : 0)
+ + "secs",
+ 7,
+ 152,
+ 16448255);
+ break;
+ case 2:
+ this.fontRendererObj.drawString("Scanner", 51, 7, 16448255);
+ if (tContainer.mProgress == 0) {
+ this.fontRendererObj.drawString("Can be used to", 51, 24, 16448255);
+ this.fontRendererObj.drawString("scan things", 51, 32, 16448255);
+ this.fontRendererObj.drawString("Currently", 51, 48, Utils.rgbtoHexValue(200, 20, 20));
+ this.fontRendererObj.drawString("Disabled", 51, 56, Utils.rgbtoHexValue(200, 20, 20));
+ } else {
+ this.fontRendererObj.drawString("Progress:", 51, 24, 16448255);
+ this.fontRendererObj.drawString(
+ MathUtils.findPercentage(tContainer.mProgress, tContainer.mMaxProgressTime) + " %",
+ 51,
+ 32,
+ 16448255);
+ }
+ this.fontRendererObj.drawString(
+ StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
+ break;
+ case 3:
+ this.fontRendererObj.drawString("Centrifuge", 7, 7, 16448255);
+ this.fontRendererObj.drawString(
+ "Recipe: " + (tContainer.mMaxHeat + 1) + "/"
+ + GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size(),
+ 7,
+ 23,
+ 16448255);
+ this.fontRendererObj.drawString("EU: " + toNumber(tContainer.mEU), 7, 31, 16448255);
+ break;
+ case 4:
+ this.fontRendererObj.drawString("Fusionreactor", 7, 7, 16448255);
+ this.fontRendererObj.drawString(
+ "Recipe: " + (tContainer.mMaxHeat + 1) + "/"
+ + GT_TileEntity_ComputerCube.sFusionReactorRecipes.size(),
+ 7,
+ 15,
+ 16448255);
+ this.fontRendererObj.drawString("Start: " + toNumber(tContainer.mEU) + "EU", 7, 23, 16448255);
+ this.fontRendererObj.drawString("EU/t: " + toNumber(tContainer.mEUOut), 7, 31, 16448255);
+ this.fontRendererObj.drawString(toNumber(tContainer.mHeat) + " Ticks", 7, 39, 16448255);
+ GT_Recipe tRecipe = GT_TileEntity_ComputerCube.sFusionReactorRecipes.get(tContainer.mMaxHeat);
+ this.fontRendererObj.drawString("" + tRecipe.mFluidOutputs[0].getLocalizedName(), 7, 55, 16448255);
+ if (tContainer.mEUOut < 0) {
+ this.fontRendererObj.drawString(
+ "IN: " + toNumber(-tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 47, 16448255);
+ break;
+ }
+ this.fontRendererObj.drawString(
+ "OUT: " + toNumber(tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 47, 16448255);
+ break;
+ case 5:
+ if (tContainer.mID == 5 && this.xSize == 176) {
+ this.xSize += 50;
+ }
+ if (tContainer.mMaxHeat >= 0
+ && tContainer.mMaxHeat < GT_Computercube_Description.sDescriptions.size())
+ for (int i = 0;
+ i
+ < ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(
+ tContainer.mMaxHeat))
+ .mDescription
+ .length;
+ i++) {
+ if (i == 0) {
+ this.fontRendererObj.drawString(
+ ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(
+ tContainer.mMaxHeat))
+ .mDescription[i],
+ 7,
+ 7,
+ 16448255);
+ } else {
+ this.fontRendererObj.drawString(
+ ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(
+ tContainer.mMaxHeat))
+ .mDescription[i],
+ 7,
+ 7 + 8 * i,
+ 16448255);
+ }
+ }
+ break;
+ case 6:
+ this.fontRendererObj.drawString("Electrolyzer", 7, 7, 16448255);
+ this.fontRendererObj.drawString(
+ "Recipe: " + (tContainer.mMaxHeat + 1) + "/"
+ + GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size(),
+ 7,
+ 23,
+ 16448255);
+ this.fontRendererObj.drawString("EU: " + toNumber(tContainer.mEU), 7, 31, 16448255);
+ break;
+ }
+ }
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- if (mContainer != null) {
- GT_Container_ComputerCube tContainer = (GT_Container_ComputerCube) this.mContainer;
- mc.renderEngine.bindTexture(mGUIbackground[((GT_Container_ComputerCube) this.mContainer).mID]);
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- switch (tContainer.mID) {
- case 0 :
- if (this.mPowerContainer.mStoredEU > 0 && this.mPowerContainer.mMaxStoredEU > 0) {
- final double tScale = MathUtils.findPercentage(this.mPowerContainer.mStoredEU, this.mPowerContainer.mMaxStoredEU);
- this.drawTexturedModalRect(x + 44, y + 8, 0, 166, Math.min(MathUtils.roundToClosestInt(tScale), 95), 5);
- }
- else {
- //
- //Logger.INFO("1 No Power? "+tContainer.mProgressTime+" | "+tContainer.mTileEntity.getEUCapacity());
- //Logger.INFO("2 No Power? "+aComp.getEUVar()+" | "+aComp.maxEUStore());
- }
- break;
- case 5 :
- if (tContainer.mExplosionStrength != 0)
- drawTexturedModalRect(x + 152, y + 6, 0, 166, 50, 50);
- break;
- }
- }
- }
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ if (mContainer != null) {
+ GT_Container_ComputerCube tContainer = (GT_Container_ComputerCube) this.mContainer;
+ mc.renderEngine.bindTexture(mGUIbackground[((GT_Container_ComputerCube) this.mContainer).mID]);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ switch (tContainer.mID) {
+ case 0:
+ if (this.mPowerContainer.mStoredEU > 0 && this.mPowerContainer.mMaxStoredEU > 0) {
+ final double tScale = MathUtils.findPercentage(
+ this.mPowerContainer.mStoredEU, this.mPowerContainer.mMaxStoredEU);
+ this.drawTexturedModalRect(
+ x + 44, y + 8, 0, 166, Math.min(MathUtils.roundToClosestInt(tScale), 95), 5);
+ } else {
+ //
+ // Logger.INFO("1 No Power? "+tContainer.mProgressTime+" |
+ // "+tContainer.mTileEntity.getEUCapacity());
+ // Logger.INFO("2 No Power? "+aComp.getEUVar()+" | "+aComp.maxEUStore());
+ }
+ break;
+ case 5:
+ if (tContainer.mExplosionStrength != 0) drawTexturedModalRect(x + 152, y + 6, 0, 166, 50, 50);
+ break;
+ }
+ }
+ }
- public String toNumber(long mEU) {
- String tString = "";
- boolean temp = true, negative = false;
- if (mEU < 0) {
- mEU *= -1;
- negative = true;
- }
- int i;
- for (i = 1000000000; i > 0; i /= 10) {
- long tDigit = mEU / i % 10;
- if (temp && tDigit != 0)
- temp = false;
- if (!temp) {
- tString = tString + tDigit;
- if (i != 1) {
- int j;
- for (j = i; j > 0;) {
- if (j == 1)
- tString = tString + ",";
- j /= 1000;
- }
- }
- }
- }
- if (tString.equals(""))
- tString = "0";
- return negative ? ("-" + tString) : tString;
- }
+ public String toNumber(long mEU) {
+ String tString = "";
+ boolean temp = true, negative = false;
+ if (mEU < 0) {
+ mEU *= -1;
+ negative = true;
+ }
+ int i;
+ for (i = 1000000000; i > 0; i /= 10) {
+ long tDigit = mEU / i % 10;
+ if (temp && tDigit != 0) temp = false;
+ if (!temp) {
+ tString = tString + tDigit;
+ if (i != 1) {
+ int j;
+ for (j = i; j > 0; ) {
+ if (j == 1) tString = tString + ",";
+ j /= 1000;
+ }
+ }
+ }
+ }
+ if (tString.equals("")) tString = "0";
+ return negative ? ("-" + tString) : tString;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java
index 53d60c3a68..2612ad5592 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java
@@ -1,95 +1,136 @@
package gtPlusPlus.xmod.gregtech.api.gui.computer;
-import java.util.ArrayList;
-import java.util.List;
-
import gregtech.api.GregTech_API;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_CircuitryBehavior;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_RedstoneCircuitBlock extends GT_GUIContainerMetaTile_Machine {
- public GT_GUIContainer_RedstoneCircuitBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(new GT_Container_RedstoneCircuitBlock(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "RedstoneCircuitBlock.png");
- }
+ public GT_GUIContainer_RedstoneCircuitBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(
+ new GT_Container_RedstoneCircuitBlock(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + "RedstoneCircuitBlock.png");
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(((GT_Container_RedstoneCircuitBlock) mContainer).mGate);
- if (tCircuit != null) {
- this.fontRendererObj.drawString(tCircuit.getName(), 46, 8, 16448255);
- this.fontRendererObj.drawString(tCircuit.getDescription(), 46, 19, 16448255);
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ GT_CircuitryBehavior tCircuit =
+ GregTech_API.sCircuitryBehaviors.get(((GT_Container_RedstoneCircuitBlock) mContainer).mGate);
+ if (tCircuit != null) {
+ this.fontRendererObj.drawString(tCircuit.getName(), 46, 8, 16448255);
+ this.fontRendererObj.drawString(tCircuit.getDescription(), 46, 19, 16448255);
- this.fontRendererObj.drawString(tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 0), 46, 33, 16448255);
- this.fontRendererObj.drawString(tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 1), 46, 44, 16448255);
- this.fontRendererObj.drawString(tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 2), 46, 55, 16448255);
- this.fontRendererObj.drawString(tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 3), 46, 66, 16448255);
+ this.fontRendererObj.drawString(
+ tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 0),
+ 46,
+ 33,
+ 16448255);
+ this.fontRendererObj.drawString(
+ tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 1),
+ 46,
+ 44,
+ 16448255);
+ this.fontRendererObj.drawString(
+ tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 2),
+ 46,
+ 55,
+ 16448255);
+ this.fontRendererObj.drawString(
+ tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 3),
+ 46,
+ 66,
+ 16448255);
- String tString;
- tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 0);
- this.fontRendererObj.drawString(tString == null ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[0]) : tString, 99, 33, 16448255);
- tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 1);
- this.fontRendererObj.drawString(tString == null ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[1]) : tString, 99, 44, 16448255);
- tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 2);
- this.fontRendererObj.drawString(tString == null ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[2]) : tString, 99, 55, 16448255);
- tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 3);
- this.fontRendererObj.drawString(tString == null ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[3]) : tString, 99, 66, 16448255);
- }
- this.drawTooltip(par1, par2);
- }
+ String tString;
+ tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 0);
+ this.fontRendererObj.drawString(
+ tString == null
+ ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[0])
+ : tString,
+ 99,
+ 33,
+ 16448255);
+ tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 1);
+ this.fontRendererObj.drawString(
+ tString == null
+ ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[1])
+ : tString,
+ 99,
+ 44,
+ 16448255);
+ tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 2);
+ this.fontRendererObj.drawString(
+ tString == null
+ ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[2])
+ : tString,
+ 99,
+ 55,
+ 16448255);
+ tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 3);
+ this.fontRendererObj.drawString(
+ tString == null
+ ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[3])
+ : tString,
+ 99,
+ 66,
+ 16448255);
+ }
+ this.drawTooltip(par1, par2);
+ }
- @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);
+ @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_RedstoneCircuitBlock) mContainer).mOutput > 0)
- drawTexturedModalRect(x + 151, y + 5, 176, 0, 18, 18);
- if ((((GT_Container_RedstoneCircuitBlock) mContainer).mActive & 1) > 0)
- drawTexturedModalRect(x + 151, y + 23, 176, 18, 18, 18);
- if (((GT_Container_RedstoneCircuitBlock) mContainer).mDisplayErrorCode > 0)
- if ((((GT_Container_RedstoneCircuitBlock) mContainer).mTileEntity.getTimer() / 5) % 2 == 0)
- drawTexturedModalRect(x + 140, y + 9, 194, 0, 7, 7);
- else
- ;
- else
- drawTexturedModalRect(x + 140, y + 9, 201, 0, 7, 7);
- }
- }
+ if (mContainer != null) {
+ if (((GT_Container_RedstoneCircuitBlock) mContainer).mOutput > 0)
+ drawTexturedModalRect(x + 151, y + 5, 176, 0, 18, 18);
+ if ((((GT_Container_RedstoneCircuitBlock) mContainer).mActive & 1) > 0)
+ drawTexturedModalRect(x + 151, y + 23, 176, 18, 18, 18);
+ if (((GT_Container_RedstoneCircuitBlock) mContainer).mDisplayErrorCode > 0)
+ if ((((GT_Container_RedstoneCircuitBlock) mContainer).mTileEntity.getTimer() / 5) % 2 == 0)
+ drawTexturedModalRect(x + 140, y + 9, 194, 0, 7, 7);
+ else
+ ;
+ else drawTexturedModalRect(x + 140, y + 9, 201, 0, 7, 7);
+ }
+ }
- private void drawTooltip(final int x2, final int y2) {
- final int xStart = (this.width - this.xSize) / 2;
- final int yStart = (this.height - this.ySize) / 2;
- final int x3 = x2 - xStart;
- final int y3 = y2 - yStart + 5;
- final List<String> list = new ArrayList<String>();
+ private void drawTooltip(final int x2, final int y2) {
+ final int xStart = (this.width - this.xSize) / 2;
+ final int yStart = (this.height - this.ySize) / 2;
+ final int x3 = x2 - xStart;
+ final int y3 = y2 - yStart + 5;
+ final List<String> list = new ArrayList<String>();
- int y = 10;
- if (x3 >= 151 && x3 <= 168) {
- if (y3 >= y && y3 <= (y + 17)) {
- list.add("Toggle EU Output");
- }
- if (y3 >= (y + 18) && y3 <= (y + 35)) {
- list.add("Toggle Active State");
- }
- if (y3 >= (y + 36) && y3 <= (y + 53)) {
- list.add("Change Redstone Circuit");
- }
- }
+ int y = 10;
+ if (x3 >= 151 && x3 <= 168) {
+ if (y3 >= y && y3 <= (y + 17)) {
+ list.add("Toggle EU Output");
+ }
+ if (y3 >= (y + 18) && y3 <= (y + 35)) {
+ list.add("Toggle Active State");
+ }
+ if (y3 >= (y + 36) && y3 <= (y + 53)) {
+ list.add("Change Redstone Circuit");
+ }
+ }
- if (!list.isEmpty()) {
- //RenderHelper.enableGUIStandardItemLighting();
- this.drawHoveringText(list, x3, y3, this.fontRendererObj);
- RenderHelper.enableGUIStandardItemLighting();
- }
- //RenderHelper.enableStandardItemLighting();
- }
+ if (!list.isEmpty()) {
+ // RenderHelper.enableGUIStandardItemLighting();
+ this.drawHoveringText(list, x3, y3, this.fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
+ // RenderHelper.enableStandardItemLighting();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
index cdca065e60..dff58351e0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.gui.fluidreactor;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_Container_BasicMachine;
@@ -11,9 +9,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.slots.SlotChemicalPlantInput;
import gtPlusPlus.core.slots.SlotNoInput;
-import gtPlusPlus.core.slots.SlotNoInputLogging;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor;
+import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
@@ -21,164 +19,156 @@ import net.minecraft.item.ItemStack;
public class Container_FluidReactor extends GT_Container_BasicMachine {
- public boolean mFluidTransfer_1 = false;
- public boolean mFluidTransfer_2 = false;
- public boolean oFluidTransfer_1 = false;
- public boolean oFluidTransfer_2 = false;
-
- public Container_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- @Override
- public void addSlots(InventoryPlayer aInventoryPlayer) {
-
- // Gui Buttons
- this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 0, 8, 63)); // Fluid 1
- this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 1, 44, 63));
- this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 2, 26, 63)); // Fluid 2
-
- int tStartIndex = 3;
- // Input Slots
- this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 8, 7));
- this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 26, 7));
- this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 44, 7));
- this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 62, 7));
-
- // Output Slots
- this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 16));
- this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 16));
- this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 34));
- this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 34));
-
- // Cell Collector Slot
- this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 116, 63));
-
-
- // Inputs Fluids
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 8, 42));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 26, 42));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 44, 42));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 62, 42));
-
- // Output Fluids
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 16));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 34));
-
-
-
-
- }
-
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (aSlotIndex == 0 || aSlotIndex == 2) {
- if (this.mTileEntity != null && this.mTileEntity.isServerSide()) {
- try {
- final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return null;
- }
- if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) {
- //Set Tile
- if (aSlotIndex == 0) {
- ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1 = !((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1;
- }
- else if (aSlotIndex == 2) {
- ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2 = !((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2;
- }
- return null;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
- }
- //Logger.INFO("Clicked slot "+aSlotIndex);
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (this.mTileEntity != null && this.mTileEntity.isServerSide()) {
- try {
- Iterator var2 = this.crafters.iterator();
- final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- Logger.INFO("bad");
- return;
- }
- if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) {
- //Read from Tile
- this.mFluidTransfer_1 = ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1;
- this.mFluidTransfer_2 = ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2;
- int mTimer;
- mTimer = (int) ReflectionUtils.getField(this.getClass(), "mTimer").get(this);
- while (true) {
- ICrafting var1;
- do {
- if (!var2.hasNext()) {
- this.oFluidTransfer_1 = this.mFluidTransfer_1;
- this.oFluidTransfer_2 = this.mFluidTransfer_2;
- return;
- }
- var1 = (ICrafting) var2.next();
- if (mTimer % 500 == 10 || this.oFluidTransfer_1 != this.mFluidTransfer_1) {
- var1.sendProgressBarUpdate(this, -50, this.mFluidTransfer_1 ? 1 : 0);
- }
- if (mTimer % 500 == 10 || this.oFluidTransfer_2 != this.mFluidTransfer_2) {
- var1.sendProgressBarUpdate(this, -51, this.mFluidTransfer_2 ? 1 : 0);
- }
- } while (mTimer % 500 != 10);
- }
- }
- else {
- Logger.INFO("bad cast");
- }
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
- e.printStackTrace();
- }
- }
-
- }
-
- public void addCraftingToCrafters(ICrafting par1ICrafting) {
- super.addCraftingToCrafters(par1ICrafting);
- }
-
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- if (par1 > 0) {
- super.updateProgressBar(par1, par2);
- }
- else {
- switch (par1) {
- case -50 :
- this.mFluidTransfer_1 = par2 != 0;
- break;
- case -51 :
- this.mFluidTransfer_2 = par2 != 0;
- break;
- default :
- break;
- }
- }
- }
-
- public int getSlotStartIndex() {
- return 3;
- }
-
- public int getShiftClickStartIndex() {
- return 3;
- }
-
- public int getSlotCount() {
- return this.getShiftClickSlotCount() + 5 + 2;
- }
-
- public int getShiftClickSlotCount() {
- return 4;
- }
-} \ No newline at end of file
+ public boolean mFluidTransfer_1 = false;
+ public boolean mFluidTransfer_2 = false;
+ public boolean oFluidTransfer_1 = false;
+ public boolean oFluidTransfer_2 = false;
+
+ public Container_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+
+ // Gui Buttons
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 0, 8, 63)); // Fluid 1
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 1, 44, 63));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 2, 26, 63)); // Fluid 2
+
+ int tStartIndex = 3;
+ // Input Slots
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 8, 7));
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 26, 7));
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 44, 7));
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 62, 7));
+
+ // Output Slots
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 16));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 16));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 34));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 34));
+
+ // Cell Collector Slot
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 116, 63));
+
+ // Inputs Fluids
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 8, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 26, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 44, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 62, 42));
+
+ // Output Fluids
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 16));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 34));
+ }
+
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ if (aSlotIndex == 0 || aSlotIndex == 2) {
+ if (this.mTileEntity != null && this.mTileEntity.isServerSide()) {
+ try {
+ final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return null;
+ }
+ if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) {
+ // Set Tile
+ if (aSlotIndex == 0) {
+ ((GregtechMetaTileEntity_ChemicalReactor) aMetaTileEntity).mFluidTransfer_1 =
+ !((GregtechMetaTileEntity_ChemicalReactor) aMetaTileEntity).mFluidTransfer_1;
+ } else if (aSlotIndex == 2) {
+ ((GregtechMetaTileEntity_ChemicalReactor) aMetaTileEntity).mFluidTransfer_2 =
+ !((GregtechMetaTileEntity_ChemicalReactor) aMetaTileEntity).mFluidTransfer_2;
+ }
+ return null;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ // Logger.INFO("Clicked slot "+aSlotIndex);
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (this.mTileEntity != null && this.mTileEntity.isServerSide()) {
+ try {
+ Iterator var2 = this.crafters.iterator();
+ final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ Logger.INFO("bad");
+ return;
+ }
+ if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) {
+ // Read from Tile
+ this.mFluidTransfer_1 = ((GregtechMetaTileEntity_ChemicalReactor) aMetaTileEntity).mFluidTransfer_1;
+ this.mFluidTransfer_2 = ((GregtechMetaTileEntity_ChemicalReactor) aMetaTileEntity).mFluidTransfer_2;
+ int mTimer;
+ mTimer = (int)
+ ReflectionUtils.getField(this.getClass(), "mTimer").get(this);
+ while (true) {
+ ICrafting var1;
+ do {
+ if (!var2.hasNext()) {
+ this.oFluidTransfer_1 = this.mFluidTransfer_1;
+ this.oFluidTransfer_2 = this.mFluidTransfer_2;
+ return;
+ }
+ var1 = (ICrafting) var2.next();
+ if (mTimer % 500 == 10 || this.oFluidTransfer_1 != this.mFluidTransfer_1) {
+ var1.sendProgressBarUpdate(this, -50, this.mFluidTransfer_1 ? 1 : 0);
+ }
+ if (mTimer % 500 == 10 || this.oFluidTransfer_2 != this.mFluidTransfer_2) {
+ var1.sendProgressBarUpdate(this, -51, this.mFluidTransfer_2 ? 1 : 0);
+ }
+ } while (mTimer % 500 != 10);
+ }
+ } else {
+ Logger.INFO("bad cast");
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void addCraftingToCrafters(ICrafting par1ICrafting) {
+ super.addCraftingToCrafters(par1ICrafting);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ if (par1 > 0) {
+ super.updateProgressBar(par1, par2);
+ } else {
+ switch (par1) {
+ case -50:
+ this.mFluidTransfer_1 = par2 != 0;
+ break;
+ case -51:
+ this.mFluidTransfer_2 = par2 != 0;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ public int getSlotStartIndex() {
+ return 3;
+ }
+
+ public int getShiftClickStartIndex() {
+ return 3;
+ }
+
+ public int getSlotCount() {
+ return this.getShiftClickSlotCount() + 5 + 2;
+ }
+
+ public int getShiftClickSlotCount() {
+ return 4;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
index 4d35df251c..fa8c9f571d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
@@ -4,122 +4,132 @@ import gregtech.api.gui.GT_Container_BasicMachine;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
-
import java.util.ArrayList;
import java.util.List;
-
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GUI_FluidReactor extends GT_GUIContainerMetaTile_Machine {
- public final String mName;
- public final String mNEI;
- public final byte mProgressBarDirection;
- public final byte mProgressBarAmount;
-
- public GUI_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName,
- String aTextureFile, String aNEI) {
- this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1);
- }
-
- public GUI_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName,
- String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) {
- super(new Container_FluidReactor(aInventoryPlayer, aTileEntity), CORE.MODID+":textures/gui/FluidReactor.png");
- this.mProgressBarDirection = aProgressBarDirection;
- this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount);
- this.mName = aName;
- this.mNEI = aNEI;
- }
+ public final String mName;
+ public final String mNEI;
+ public final byte mProgressBarDirection;
+ public final byte mProgressBarAmount;
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- this.fontRendererObj.drawString(this.mName, 82, 5, 4210752);
- this.drawTooltip(par1, par2);
- }
+ public GUI_FluidReactor(
+ InventoryPlayer aInventoryPlayer,
+ IGregTechTileEntity aTileEntity,
+ String aName,
+ String aTextureFile,
+ String aNEI) {
+ this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1);
+ }
- private void drawTooltip(int x2, int y2) {
- int xStart = (this.width - this.xSize) / 2;
- int yStart = (this.height - this.ySize) / 2;
- int x = x2 - xStart;
- int y = y2 - yStart + 5;
- List<String> list = new ArrayList();
- if (y >= 67 && y <= 84) {
- if (x >= 7 && x <= 24) {
- list.add("Fluid 1 Auto-Output");
- }
- if (x >= 25 && x <= 42) {
- list.add("Fluid 2 Auto-Output");
- }
- if (x >= 43 && x <= 61) {
- list.add("Item Auto-Output");
- }
- }
+ public GUI_FluidReactor(
+ InventoryPlayer aInventoryPlayer,
+ IGregTechTileEntity aTileEntity,
+ String aName,
+ String aTextureFile,
+ String aNEI,
+ byte aProgressBarDirection,
+ byte aProgressBarAmount) {
+ super(new Container_FluidReactor(aInventoryPlayer, aTileEntity), CORE.MODID + ":textures/gui/FluidReactor.png");
+ this.mProgressBarDirection = aProgressBarDirection;
+ this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount);
+ this.mName = aName;
+ this.mNEI = aNEI;
+ }
- if (!list.isEmpty()) {
- this.drawHoveringText(list, x, y, this.fontRendererObj);
- RenderHelper.enableGUIStandardItemLighting();
- }
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString(this.mName, 82, 5, 4210752);
+ this.drawTooltip(par1, par2);
+ }
- }
+ private void drawTooltip(int x2, int y2) {
+ int xStart = (this.width - this.xSize) / 2;
+ int yStart = (this.height - this.ySize) / 2;
+ int x = x2 - xStart;
+ int y = y2 - yStart + 5;
+ List<String> list = new ArrayList();
+ if (y >= 67 && y <= 84) {
+ if (x >= 7 && x <= 24) {
+ list.add("Fluid 1 Auto-Output");
+ }
+ if (x >= 25 && x <= 42) {
+ list.add("Fluid 2 Auto-Output");
+ }
+ if (x >= 43 && x <= 61) {
+ list.add("Item Auto-Output");
+ }
+ }
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- int x = (this.width - this.xSize) / 2;
- int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mContainer != null) {
- if (((Container_FluidReactor) this.mContainer).mFluidTransfer_1) {
- this.drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18);
- }
- if (((Container_FluidReactor) this.mContainer).mFluidTransfer_2) {
- this.drawTexturedModalRect(x + 25, y + 62, 194, 18, 18, 18);
- }
- if (((GT_Container_BasicMachine) this.mContainer).mItemTransfer) {
- this.drawTexturedModalRect(x + 43, y + 62, 176, 36, 18, 18);
- }
+ if (!list.isEmpty()) {
+ this.drawHoveringText(list, x, y, this.fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
+ }
- if (((GT_Container_BasicMachine) this.mContainer).mStuttering) {
- this.drawTexturedModalRect(x + 79, y + 44, 176, 54, 18, 18);
- }
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mContainer != null) {
+ if (((Container_FluidReactor) this.mContainer).mFluidTransfer_1) {
+ this.drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18);
+ }
+ if (((Container_FluidReactor) this.mContainer).mFluidTransfer_2) {
+ this.drawTexturedModalRect(x + 25, y + 62, 194, 18, 18, 18);
+ }
+ if (((GT_Container_BasicMachine) this.mContainer).mItemTransfer) {
+ this.drawTexturedModalRect(x + 43, y + 62, 176, 36, 18, 18);
+ }
- if (this.mContainer.mMaxProgressTime > 0) {
- int tSize = this.mProgressBarDirection < 2 ? 20 : 18;
- int tProgress = Math
- .max(1, Math
- .min(tSize * this.mProgressBarAmount,
- (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime
- * tSize * this.mProgressBarAmount / this.mContainer.mMaxProgressTime))
- % (tSize + 1);
- switch (this.mProgressBarDirection) {
- case 0 :
- this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18);
- break;
- case 1 :
- this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18);
- break;
- case 2 :
- this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress);
- break;
- case 3 :
- this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress);
- break;
- case 4 :
- tProgress = 20 - tProgress;
- this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18);
- break;
- case 5 :
- tProgress = 20 - tProgress;
- this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18);
- break;
- case 6 :
- tProgress = 18 - tProgress;
- this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress);
- break;
- case 7 :
- tProgress = 18 - tProgress;
- this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress);
- }
- }
- }
+ if (((GT_Container_BasicMachine) this.mContainer).mStuttering) {
+ this.drawTexturedModalRect(x + 79, y + 44, 176, 54, 18, 18);
+ }
- }
-} \ No newline at end of file
+ if (this.mContainer.mMaxProgressTime > 0) {
+ int tSize = this.mProgressBarDirection < 2 ? 20 : 18;
+ int tProgress = Math.max(
+ 1,
+ Math.min(
+ tSize * this.mProgressBarAmount,
+ (this.mContainer.mProgressTime > 0 ? 1 : 0)
+ + this.mContainer.mProgressTime
+ * tSize
+ * this.mProgressBarAmount
+ / this.mContainer.mMaxProgressTime))
+ % (tSize + 1);
+ switch (this.mProgressBarDirection) {
+ case 0:
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18);
+ break;
+ case 1:
+ this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18);
+ break;
+ case 2:
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress);
+ break;
+ case 3:
+ this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress);
+ break;
+ case 4:
+ tProgress = 20 - tProgress;
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18);
+ break;
+ case 5:
+ tProgress = 20 - tProgress;
+ this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18);
+ break;
+ case 6:
+ tProgress = 18 - tProgress;
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress);
+ break;
+ case 7:
+ tProgress = 18 - tProgress;
+ this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java
index 606880d6e9..836e7198c3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java
@@ -2,7 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.gui.hatches;
import gregtech.api.gui.GT_Container_1by1;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaGenerated_Tool;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GregtechMetaTileEntity_LargerTurbineBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@@ -21,37 +20,41 @@ public class CONTAINER_1by1_Turbine extends GT_Container_1by1 {
addSlotToContainer(new SlotTurbine(mTileEntity, 0, 80, 35));
}
- @Override
- public int getShiftClickSlotCount() {
- return 0;
- }
+ @Override
+ public int getShiftClickSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public boolean canDragIntoSlot(Slot par1Slot) {
+ return false;
+ }
- @Override
- public boolean canDragIntoSlot(Slot par1Slot) {
- return false;
- }
-
public class SlotTurbine extends Slot {
- public SlotTurbine(final IInventory inventory, final int x, final int y, final int z) {
- super(inventory, x, y, z);
- }
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- return GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(itemstack);
- }
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
- @Override
- public boolean canTakeStack(EntityPlayer p_82869_1_) {
- return false;
- }
- @Override
- public void putStack(ItemStack aStack) {
- if (isItemValid(aStack)) {
- this.inventory.setInventorySlotContents(0, aStack);
- }
- }
- }
+ public SlotTurbine(final IInventory inventory, final int x, final int y, final int z) {
+ super(inventory, x, y, z);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(itemstack);
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+ @Override
+ public boolean canTakeStack(EntityPlayer p_82869_1_) {
+ return false;
+ }
+
+ @Override
+ public void putStack(ItemStack aStack) {
+ if (isItemValid(aStack)) {
+ this.inventory.setInventorySlotContents(0, aStack);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java
index 1d396811c1..60106825a0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java
@@ -1,10 +1,9 @@
package gtPlusPlus.xmod.gregtech.api.gui.hatches;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Slot;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
public class CONTAINER_2by2 extends GT_ContainerMetaTile_Machine {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java
index 8efe60a06e..0c011f164b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java
@@ -1,10 +1,9 @@
package gtPlusPlus.xmod.gregtech.api.gui.hatches;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Slot;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
public class CONTAINER_4by4 extends GT_ContainerMetaTile_Machine {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_HatchNbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_HatchNbtConsumable.java
index 9596d41387..9f3f42bb9b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_HatchNbtConsumable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_HatchNbtConsumable.java
@@ -1,13 +1,12 @@
package gtPlusPlus.xmod.gregtech.api.gui.hatches;
-import java.util.Iterator;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_Container;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_LanguageManager;
import gtPlusPlus.core.slots.SlotNoInput;
+import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
@@ -17,18 +16,19 @@ import net.minecraft.item.ItemStack;
public class CONTAINER_HatchNbtConsumable extends GT_Container {
- public final int mInputslotCount;
- private final int mTotalSlotCount;
-
- public CONTAINER_HatchNbtConsumable(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aInputslotCount) {
+ public final int mInputslotCount;
+ private final int mTotalSlotCount;
+
+ public CONTAINER_HatchNbtConsumable(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aInputslotCount) {
super(aInventoryPlayer, aTileEntity);
- mInputslotCount = aInputslotCount;
- mTotalSlotCount = aInputslotCount*2;
+ mInputslotCount = aInputslotCount;
+ mTotalSlotCount = aInputslotCount * 2;
mTileEntity = aTileEntity;
if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) {
addSlots(aInventoryPlayer);
if (doesBindPlayerInventory()) {
- bindPlayerInventory(aInventoryPlayer);
+ bindPlayerInventory(aInventoryPlayer);
}
detectAndSendChanges();
} else {
@@ -38,63 +38,61 @@ public class CONTAINER_HatchNbtConsumable extends GT_Container {
@Override
public void addSlots(InventoryPlayer aInventoryPlayer) {
- if (mTotalSlotCount == 8) {
- final int aSlotYStart = 26;
- final int aSlotYFinish = aSlotYStart + (18*2);
- final int aSlotXStart1 = 26;
- final int aSlotXFinish1 = aSlotXStart1 + (18*2);
- final int aSlotXStart2 = 116;
- final int aSlotXFinish2 = aSlotXStart2 + (18*2);
- int aSlotID = 0;
- for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
- for (int x = aSlotXStart1; x < aSlotXFinish1; x += 18) {
- addSlotToContainer(new Slot(mTileEntity, aSlotID++, x, y));
- }
- }
- for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
- for (int x = aSlotXStart2; x < aSlotXFinish2; x += 18) {
- addSlotToContainer(new ViewingSlot(mTileEntity, aSlotID++, x, y));
- }
- }
- }
- else if (mTotalSlotCount == 18) {
- int aSlotYStart = 20;
- int aSlotYFinish = aSlotYStart + (18*3);
- int aSlotXStart1 = 26;
- int aSlotXFinish1 = aSlotXStart1 + (18*3);
- int aSlotXStart2 = 98;
- int aSlotXFinish2 = aSlotXStart2 + (18*3);
- int aSlotID = 0;
- for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
- for (int x = aSlotXStart1; x < aSlotXFinish1; x += 18) {
- addSlotToContainer(new Slot(mTileEntity, aSlotID++, x, y));
- }
- }
- for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
- for (int x = aSlotXStart2; x < aSlotXFinish2; x += 18) {
- addSlotToContainer(new ViewingSlot(mTileEntity, aSlotID++, x, y));
- }
- }
- }
- else if (mTotalSlotCount == 32) {
- int aSlotYStart = 8;
- int aSlotYFinish = aSlotYStart + (18*4);
- int aSlotXStart1 = 8;
- int aSlotXFinish1 = aSlotXStart1 + (18*4);
- int aSlotXStart2 = 97;
- int aSlotXFinish2 = aSlotXStart2 + (18*4);
- int aSlotID = 0;
- for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
- for (int x = aSlotXStart1; x < aSlotXFinish1; x += 18) {
- addSlotToContainer(new Slot(mTileEntity, aSlotID++, x, y));
- }
- }
- for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
- for (int x = aSlotXStart2; x < aSlotXFinish2; x += 18) {
- addSlotToContainer(new ViewingSlot(mTileEntity, aSlotID++, x, y));
- }
- }
- }
+ if (mTotalSlotCount == 8) {
+ final int aSlotYStart = 26;
+ final int aSlotYFinish = aSlotYStart + (18 * 2);
+ final int aSlotXStart1 = 26;
+ final int aSlotXFinish1 = aSlotXStart1 + (18 * 2);
+ final int aSlotXStart2 = 116;
+ final int aSlotXFinish2 = aSlotXStart2 + (18 * 2);
+ int aSlotID = 0;
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart1; x < aSlotXFinish1; x += 18) {
+ addSlotToContainer(new Slot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart2; x < aSlotXFinish2; x += 18) {
+ addSlotToContainer(new ViewingSlot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ } else if (mTotalSlotCount == 18) {
+ int aSlotYStart = 20;
+ int aSlotYFinish = aSlotYStart + (18 * 3);
+ int aSlotXStart1 = 26;
+ int aSlotXFinish1 = aSlotXStart1 + (18 * 3);
+ int aSlotXStart2 = 98;
+ int aSlotXFinish2 = aSlotXStart2 + (18 * 3);
+ int aSlotID = 0;
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart1; x < aSlotXFinish1; x += 18) {
+ addSlotToContainer(new Slot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart2; x < aSlotXFinish2; x += 18) {
+ addSlotToContainer(new ViewingSlot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ } else if (mTotalSlotCount == 32) {
+ int aSlotYStart = 8;
+ int aSlotYFinish = aSlotYStart + (18 * 4);
+ int aSlotXStart1 = 8;
+ int aSlotXFinish1 = aSlotXStart1 + (18 * 4);
+ int aSlotXStart2 = 97;
+ int aSlotXFinish2 = aSlotXStart2 + (18 * 4);
+ int aSlotID = 0;
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart1; x < aSlotXFinish1; x += 18) {
+ addSlotToContainer(new Slot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ for (int y = aSlotYStart; y < aSlotYFinish; y += 18) {
+ for (int x = aSlotXStart2; x < aSlotXFinish2; x += 18) {
+ addSlotToContainer(new ViewingSlot(mTileEntity, aSlotID++, x, y));
+ }
+ }
+ }
}
@Override
@@ -106,16 +104,35 @@ public class CONTAINER_HatchNbtConsumable extends GT_Container {
public int getShiftClickSlotCount() {
return mInputslotCount;
}
-
+
/*
* Uselss stuff copied from GT
*/
-
- 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;
+ 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();
@@ -252,31 +269,30 @@ public class CONTAINER_HatchNbtConsumable extends GT_Container {
public boolean canInteractWith(EntityPlayer player) {
return mTileEntity.isUseableByPlayer(player);
}
-
- public String trans(String aKey, String aEnglish){
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false);
+
+ public String trans(String aKey, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
}
-
+
private static class ViewingSlot extends SlotNoInput {
- public ViewingSlot(IInventory inventory, int index, int x, int y) {
- super(inventory, index, x, y);
- }
+ public ViewingSlot(IInventory inventory, int index, int x, int y) {
+ super(inventory, index, x, y);
+ }
- @Override
- public boolean isItemValid(ItemStack itemstack) {
- return false;
- }
+ @Override
+ public boolean isItemValid(ItemStack itemstack) {
+ return false;
+ }
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
- @Override
- public boolean canTakeStack(EntityPlayer p_82869_1_) {
- return true;
- }
-
+ @Override
+ public boolean canTakeStack(EntityPlayer p_82869_1_) {
+ return true;
+ }
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java
index 5623f0e224..cd0381a1f1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_1by1_Turbine.java
@@ -1,11 +1,10 @@
package gtPlusPlus.xmod.gregtech.api.gui.hatches;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.InventoryPlayer;
-
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
public class GUI_1by1_Turbine extends GT_GUIContainerMetaTile_Machine {
@@ -15,8 +14,9 @@ public class GUI_1by1_Turbine extends GT_GUIContainerMetaTile_Machine {
super(new CONTAINER_1by1_Turbine(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "1by1.png");
mName = aName;
}
-
- public GUI_1by1_Turbine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+
+ public GUI_1by1_Turbine(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
super(new CONTAINER_1by1_Turbine(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "1by1.png");
mName = aName;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java
index b427a632f7..c31b74b0f8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java
@@ -2,21 +2,29 @@ package gtPlusPlus.xmod.gregtech.api.gui.hatches;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
public class GUI_2by2 extends GT_GUIContainerMetaTile_Machine {
private final String mName;
- public GUI_2by2(CONTAINER_2by2 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ public GUI_2by2(
+ CONTAINER_2by2 containerType,
+ InventoryPlayer aInventoryPlayer,
+ IGregTechTileEntity aTileEntity,
+ String aName) {
super(containerType, RES_PATH_GUI + "2by2.png");
mName = aName;
}
-
- public GUI_2by2(CONTAINER_2by2 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+
+ public GUI_2by2(
+ CONTAINER_2by2 containerType,
+ InventoryPlayer aInventoryPlayer,
+ IGregTechTileEntity aTileEntity,
+ String aName,
+ String aBackground) {
super(containerType, RES_PATH_GUI + aBackground + "2by2.png");
mName = aName;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java
index aced4342b3..379d1d7941 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java
@@ -2,21 +2,29 @@ package gtPlusPlus.xmod.gregtech.api.gui.hatches;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
public class GUI_4by4 extends GT_GUIContainerMetaTile_Machine {
private final String mName;
- public GUI_4by4(CONTAINER_4by4 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ public GUI_4by4(
+ CONTAINER_4by4 containerType,
+ InventoryPlayer aInventoryPlayer,
+ IGregTechTileEntity aTileEntity,
+ String aName) {
super(containerType, RES_PATH_GUI + "4by4.png");
mName = aName;
}
-
- public GUI_4by4(CONTAINER_4by4 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+
+ public GUI_4by4(
+ CONTAINER_4by4 containerType,
+ InventoryPlayer aInventoryPlayer,
+ IGregTechTileEntity aTileEntity,
+ String aName,
+ String aBackground) {
super(containerType, RES_PATH_GUI + aBackground + "4by4.png");
mName = aName;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_HatchNbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_HatchNbtConsumable.java
index dd19571646..47d24764cc 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_HatchNbtConsumable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_HatchNbtConsumable.java
@@ -7,46 +7,42 @@ import gregtech.api.gui.GT_GUIContainer;
public class GUI_HatchNbtConsumable extends GT_GUIContainer {
private final String mName;
- private final int mTotalSlotCount;
+ private final int mTotalSlotCount;
public final CONTAINER_HatchNbtConsumable mContainer;
-
+
public GUI_HatchNbtConsumable(CONTAINER_HatchNbtConsumable aContainer, String aName) {
- super(aContainer, RES_PATH_GUI + getTextureForGUI(aContainer.mInputslotCount*2)+".png");
+ super(aContainer, RES_PATH_GUI + getTextureForGUI(aContainer.mInputslotCount * 2) + ".png");
mContainer = aContainer;
mName = aName;
- mTotalSlotCount = aContainer.mInputslotCount*2;
- }
-
- private static final String getTextureForGUI(int aTotalSlotCOunt) {
- if (aTotalSlotCOunt == 18) {
- return "HatchNbtConsumable_3By3";
- }
- else if (aTotalSlotCOunt == 32) {
- return "HatchNbtConsumable_4By4";
- }
- else {
- return "HatchNbtConsumable_2By2";
- }
+ mTotalSlotCount = aContainer.mInputslotCount * 2;
+ }
+
+ private static final String getTextureForGUI(int aTotalSlotCOunt) {
+ if (aTotalSlotCOunt == 18) {
+ return "HatchNbtConsumable_3By3";
+ } else if (aTotalSlotCOunt == 32) {
+ return "HatchNbtConsumable_4By4";
+ } else {
+ return "HatchNbtConsumable_2By2";
+ }
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- if (mTotalSlotCount == 18) {
+ if (mTotalSlotCount == 18) {
fontRendererObj.drawString(mName, 8, 4, 4210752);
fontRendererObj.drawString("Stock", 25, 14, 4210752);
- fontRendererObj.drawString("Active", 115, 14, 4210752);
- }
- else if (mTotalSlotCount == 32) {
- //fontRendererObj.drawString("Slots: "+mTotalSlotCount, 8, 4, 4210752);
- //fontRendererObj.drawString(mName, 8, 4, 4210752);
- //fontRendererObj.drawString("Stock", 25, 16, 4210752);
- //fontRendererObj.drawString("Active", 115, 16, 4210752);
- }
- else {
+ fontRendererObj.drawString("Active", 115, 14, 4210752);
+ } else if (mTotalSlotCount == 32) {
+ // fontRendererObj.drawString("Slots: "+mTotalSlotCount, 8, 4, 4210752);
+ // fontRendererObj.drawString(mName, 8, 4, 4210752);
+ // fontRendererObj.drawString("Stock", 25, 16, 4210752);
+ // fontRendererObj.drawString("Active", 115, 16, 4210752);
+ } else {
fontRendererObj.drawString(mName, 8, 4, 4210752);
fontRendererObj.drawString("Stock", 25, 16, 4210752);
- fontRendererObj.drawString("Active", 115, 16, 4210752);
- }
+ fontRendererObj.drawString("Active", 115, 16, 4210752);
+ }
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java
index 00d022c481..52627305e2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java
@@ -1,24 +1,21 @@
package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.slots.SlotElectric;
import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_2by2;
+import net.minecraft.entity.player.InventoryPlayer;
-public class CONTAINER_Electric_2by2 extends CONTAINER_2by2{
+public class CONTAINER_Electric_2by2 extends CONTAINER_2by2 {
- public CONTAINER_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- @Override
+ public CONTAINER_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
public void addSlots(InventoryPlayer aInventoryPlayer) {
addSlotToContainer(new SlotElectric(mTileEntity, 0, 71, 26));
addSlotToContainer(new SlotElectric(mTileEntity, 1, 89, 26));
addSlotToContainer(new SlotElectric(mTileEntity, 2, 71, 44));
addSlotToContainer(new SlotElectric(mTileEntity, 3, 89, 44));
}
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java
index 1f833eb3cb..64f0f00fbd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java
@@ -1,18 +1,15 @@
package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.slots.SlotElectric;
import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_4by4;
+import net.minecraft.entity.player.InventoryPlayer;
-public class CONTAINER_Electric_4by4 extends CONTAINER_4by4{
-
- public CONTAINER_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+public class CONTAINER_Electric_4by4 extends CONTAINER_4by4 {
+ public CONTAINER_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
@Override
public void addSlots(InventoryPlayer aInventoryPlayer) {
@@ -33,5 +30,4 @@ public class CONTAINER_Electric_4by4 extends CONTAINER_4by4{
addSlotToContainer(new SlotElectric(mTileEntity, 14, 89, 62));
addSlotToContainer(new SlotElectric(mTileEntity, 15, 107, 62));
}
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java
index 9be7104bbc..de06a97aaa 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java
@@ -2,20 +2,22 @@ package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_2by2;
+import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_Electric_2by2 extends GUI_2by2{
+public class GUI_Electric_2by2 extends GUI_2by2 {
- public GUI_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
- super(new CONTAINER_Electric_2by2(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, aName);
- }
-
- public GUI_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
- super(new CONTAINER_Electric_2by2(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, RES_PATH_GUI + aBackground + "2by2.png");
+ public GUI_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_Electric_2by2(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, aName);
}
+ public GUI_Electric_2by2(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(
+ new CONTAINER_Electric_2by2(aInventoryPlayer, aTileEntity),
+ aInventoryPlayer,
+ aTileEntity,
+ RES_PATH_GUI + aBackground + "2by2.png");
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java
index ed3fce5e2c..16b1a44fea 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java
@@ -2,21 +2,22 @@ package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_4by4;
+import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_Electric_4by4 extends GUI_4by4{
-
- public GUI_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
- super(new CONTAINER_Electric_4by4(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, aName);
- }
-
- public GUI_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
- super(new CONTAINER_Electric_4by4(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, RES_PATH_GUI + aBackground + "4by4.png");
+public class GUI_Electric_4by4 extends GUI_4by4 {
+ public GUI_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_Electric_4by4(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, aName);
}
+ public GUI_Electric_4by4(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(
+ new CONTAINER_Electric_4by4(aInventoryPlayer, aTileEntity),
+ aInventoryPlayer,
+ aTileEntity,
+ RES_PATH_GUI + aBackground + "4by4.png");
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/CONTAINER_BasicTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/CONTAINER_BasicTank.java
index 9a58e74ec4..71c362b88b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/CONTAINER_BasicTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/CONTAINER_BasicTank.java
@@ -7,63 +7,60 @@ import gregtech.api.gui.GT_Slot_Output;
import gregtech.api.gui.GT_Slot_Render;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.GTPP_MTE_BasicTank;
-
import java.util.Iterator;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
public class CONTAINER_BasicTank extends GT_ContainerMetaTile_Machine {
- public int mContent = 0;
-
- public CONTAINER_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new Slot(this.mTileEntity, 0, 80, 17));
- this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 1, 80, 53));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 59, 42));
- }
+ public int mContent = 0;
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) {
- if (((GTPP_MTE_BasicTank) this.mTileEntity.getMetaTileEntity()).mFluid != null) {
- this.mContent = ((GTPP_MTE_BasicTank) this.mTileEntity.getMetaTileEntity()).mFluid.amount;
- } else {
- this.mContent = 0;
- }
+ public CONTAINER_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- Iterator var2 = this.crafters.iterator();
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ this.addSlotToContainer(new Slot(this.mTileEntity, 0, 80, 17));
+ this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 1, 80, 53));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 59, 42));
+ }
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 100, this.mContent & '￿');
- var1.sendProgressBarUpdate(this, 101, this.mContent >>> 16);
- }
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) {
+ if (((GTPP_MTE_BasicTank) this.mTileEntity.getMetaTileEntity()).mFluid != null) {
+ this.mContent = ((GTPP_MTE_BasicTank) this.mTileEntity.getMetaTileEntity()).mFluid.amount;
+ } else {
+ this.mContent = 0;
+ }
- }
- }
+ Iterator var2 = this.crafters.iterator();
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 100 :
- this.mContent = this.mContent & -65536 | par2;
- break;
- case 101 :
- this.mContent = this.mContent & '￿' | par2 << 16;
- }
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 100, this.mContent & '￿');
+ var1.sendProgressBarUpdate(this, 101, this.mContent >>> 16);
+ }
+ }
+ }
- }
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ this.mContent = this.mContent & -65536 | par2;
+ break;
+ case 101:
+ this.mContent = this.mContent & '￿' | par2 << 16;
+ }
+ }
- public int getSlotCount() {
- return 2;
- }
+ public int getSlotCount() {
+ return 2;
+ }
- public int getShiftClickSlotCount() {
- return 1;
- }
-} \ No newline at end of file
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/GUI_BasicTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/GUI_BasicTank.java
index a03aac346b..468b7dc7a9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/GUI_BasicTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/power/GUI_BasicTank.java
@@ -7,30 +7,28 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.StatCollector;
public class GUI_BasicTank extends GT_GUIContainerMetaTile_Machine {
- private final String mName;
+ private final String mName;
- public GUI_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
- super(new CONTAINER_BasicTank(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/BasicTank.png");
- this.mName = aName;
- }
+ public GUI_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_BasicTank(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/BasicTank.png");
+ this.mName = aName;
+ }
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2,
- 4210752);
- this.fontRendererObj.drawString(this.mName, 8, 6, 4210752);
- if (this.mContainer != null) {
- this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
- this.fontRendererObj.drawString(
- GT_Utility.parseNumberToString(((CONTAINER_BasicTank) this.mContainer).mContent), 10, 30,
- 16448255);
- }
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString(
+ StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
+ this.fontRendererObj.drawString(this.mName, 8, 6, 4210752);
+ if (this.mContainer != null) {
+ this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
+ this.fontRendererObj.drawString(
+ GT_Utility.parseNumberToString(((CONTAINER_BasicTank) this.mContainer).mContent), 10, 30, 16448255);
+ }
+ }
- }
-
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- int x = (this.width - this.xSize) / 2;
- int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-} \ No newline at end of file
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java
index d7ec19a9ac..23dd924702 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java
@@ -15,110 +15,144 @@ import net.minecraft.item.ItemStack;
public class GT_Container_AdvancedWorkbench extends GT_ContainerMetaTile_Machine {
- public GT_Container_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
+ public GT_Container_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 0, 8, 8));
- addSlotToContainer(new Slot(mTileEntity, 1, 26, 8));
- addSlotToContainer(new Slot(mTileEntity, 2, 44, 8));
- addSlotToContainer(new Slot(mTileEntity, 3, 62, 8));
- addSlotToContainer(new Slot(mTileEntity, 4, 8, 26));
- addSlotToContainer(new Slot(mTileEntity, 5, 26, 26));
- addSlotToContainer(new Slot(mTileEntity, 6, 44, 26));
- addSlotToContainer(new Slot(mTileEntity, 7, 62, 26));
- addSlotToContainer(new Slot(mTileEntity, 8, 8, 44));
- addSlotToContainer(new Slot(mTileEntity, 9, 26, 44));
- addSlotToContainer(new Slot(mTileEntity, 10, 44, 44));
- addSlotToContainer(new Slot(mTileEntity, 11, 62, 44));
- addSlotToContainer(new Slot(mTileEntity, 12, 8, 62));
- addSlotToContainer(new Slot(mTileEntity, 13, 26, 62));
- addSlotToContainer(new Slot(mTileEntity, 14, 44, 62));
- addSlotToContainer(new Slot(mTileEntity, 15, 62, 62));
-
- addSlotToContainer(new SlotElectric(mTileEntity, 16, 82, 8));
- addSlotToContainer(new SlotElectric(mTileEntity, 17, 100, 8));
- addSlotToContainer(new SlotElectric(mTileEntity, 18, 118, 8));
- addSlotToContainer(new SlotElectric(mTileEntity, 19, 136, 8));
- addSlotToContainer(new SlotElectric(mTileEntity, 20, 154, 8));
-
- addSlotToContainer(new Slot(mTileEntity, 21, 82, 28));
+ addSlotToContainer(new Slot(mTileEntity, 0, 8, 8));
+ addSlotToContainer(new Slot(mTileEntity, 1, 26, 8));
+ addSlotToContainer(new Slot(mTileEntity, 2, 44, 8));
+ addSlotToContainer(new Slot(mTileEntity, 3, 62, 8));
+ addSlotToContainer(new Slot(mTileEntity, 4, 8, 26));
+ addSlotToContainer(new Slot(mTileEntity, 5, 26, 26));
+ addSlotToContainer(new Slot(mTileEntity, 6, 44, 26));
+ addSlotToContainer(new Slot(mTileEntity, 7, 62, 26));
+ addSlotToContainer(new Slot(mTileEntity, 8, 8, 44));
+ addSlotToContainer(new Slot(mTileEntity, 9, 26, 44));
+ addSlotToContainer(new Slot(mTileEntity, 10, 44, 44));
+ addSlotToContainer(new Slot(mTileEntity, 11, 62, 44));
+ addSlotToContainer(new Slot(mTileEntity, 12, 8, 62));
+ addSlotToContainer(new Slot(mTileEntity, 13, 26, 62));
+ addSlotToContainer(new Slot(mTileEntity, 14, 44, 62));
+ addSlotToContainer(new Slot(mTileEntity, 15, 62, 62));
+
+ addSlotToContainer(new SlotElectric(mTileEntity, 16, 82, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 17, 100, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 18, 118, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 19, 136, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 20, 154, 8));
+
+ addSlotToContainer(new Slot(mTileEntity, 21, 82, 28));
addSlotToContainer(new Slot(mTileEntity, 22, 100, 28));
addSlotToContainer(new Slot(mTileEntity, 23, 118, 28));
- addSlotToContainer(new Slot(mTileEntity, 24, 82, 46));
+ addSlotToContainer(new Slot(mTileEntity, 24, 82, 46));
addSlotToContainer(new Slot(mTileEntity, 25, 100, 46));
addSlotToContainer(new Slot(mTileEntity, 26, 118, 46));
- addSlotToContainer(new Slot(mTileEntity, 27, 82, 64));
+ addSlotToContainer(new Slot(mTileEntity, 27, 82, 64));
addSlotToContainer(new Slot(mTileEntity, 28, 100, 64));
addSlotToContainer(new Slot(mTileEntity, 29, 118, 64));
-
+
addSlotToContainer(new Slot(mTileEntity, 33, 154, 28));
addSlotToContainer(new Slot(mTileEntity, 34, 154, 64));
-
+
addSlotToContainer(new SlotBlueprint(mTileEntity, 30, 136, 28));
addSlotToContainer(new GT_Slot_Holo(mTileEntity, 31, 136, 64, false, false, 1));
addSlotToContainer(new GT_Slot_Holo(mTileEntity, 32, 154, 46, false, false, 1));
addSlotToContainer(new GT_Slot_Holo(mTileEntity, 32, 136, 46, false, false, 1));
-
}
-
+
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- Logger.INFO("Clicked on slot "+aSlotIndex);
- if (aSlotIndex < 21 || aSlotIndex > 35) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- if (mTileEntity == null || mTileEntity.getMetaTileEntity() == null) return null;
- try {
- ItemStack tStack = ((Slot)inventorySlots.get(aSlotIndex)).getStack();
- if (tStack != null && tStack.stackSize <= 0 && !GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack())) {
- return null;
- }
- if (aSlotIndex == 32) {
- if (aMouseclick == 0 && aShifthold == 1) {
- ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).setBluePrint(null);
- return null;
- }
- } else if (aSlotIndex == 33) {
- ItemStack tStack2, tCraftedStack = ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput();
- if (tCraftedStack != null) {
- if (aShifthold == 1) {
- for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i++) {
- for (byte j = 0; j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize && ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput(); j++) {
- if (!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack) || tStack.stackSize != tStack2.stackSize) return aPlayer.inventory.getItemStack();
- aPlayer.inventory.mainInventory[i] = (((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.mainInventory[i]));
- }
- }
- } else {
- if (aMouseclick == 0) {
- if (((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput()) aPlayer.inventory.setItemStack(((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
- return aPlayer.inventory.getItemStack();
- } else {
- for (int i = 0; i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize && ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput(); i++) {
- if (!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack) || tStack.stackSize != tStack2.stackSize) return aPlayer.inventory.getItemStack();
- aPlayer.inventory.setItemStack(((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
- }
- return aPlayer.inventory.getItemStack();
- }
- }
- }
- return null;
- } else if (aSlotIndex == 34) {
- ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).mFlushMode = true;
- return null;
- } else if (aSlotIndex == 35) {
- ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).sortIntoTheInputSlots();
- return null;
- }
- } catch(Throwable e) {
- //GT_Log.log.catching(e);
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ Logger.INFO("Clicked on slot " + aSlotIndex);
+ if (aSlotIndex < 21 || aSlotIndex > 35) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ if (mTileEntity == null || mTileEntity.getMetaTileEntity() == null) return null;
+ try {
+ ItemStack tStack = ((Slot) inventorySlots.get(aSlotIndex)).getStack();
+ if (tStack != null
+ && tStack.stackSize <= 0
+ && !GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack())) {
+ return null;
+ }
+ if (aSlotIndex == 32) {
+ if (aMouseclick == 0 && aShifthold == 1) {
+ ((GT_MetaTileEntity_AdvancedCraftingTable) mTileEntity.getMetaTileEntity()).setBluePrint(null);
+ return null;
+ }
+ } else if (aSlotIndex == 33) {
+ ItemStack tStack2,
+ tCraftedStack =
+ ((GT_MetaTileEntity_AdvancedCraftingTable) mTileEntity.getMetaTileEntity())
+ .getCraftingOutput();
+ if (tCraftedStack != null) {
+ if (aShifthold == 1) {
+ for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i++) {
+ for (byte j = 0;
+ j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize
+ && ((GT_MetaTileEntity_AdvancedCraftingTable)
+ mTileEntity.getMetaTileEntity())
+ .canDoCraftingOutput();
+ j++) {
+ if (!GT_Utility.areStacksEqual(
+ tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)
+ mTileEntity.getMetaTileEntity())
+ .getCraftingOutput(),
+ tCraftedStack)
+ || tStack.stackSize != tStack2.stackSize)
+ return aPlayer.inventory.getItemStack();
+ aPlayer.inventory.mainInventory[i] = (((GT_MetaTileEntity_AdvancedCraftingTable)
+ mTileEntity.getMetaTileEntity())
+ .consumeMaterials(aPlayer, aPlayer.inventory.mainInventory[i]));
+ }
+ }
+ } else {
+ if (aMouseclick == 0) {
+ if (((GT_MetaTileEntity_AdvancedCraftingTable) mTileEntity.getMetaTileEntity())
+ .canDoCraftingOutput())
+ aPlayer.inventory.setItemStack(
+ ((GT_MetaTileEntity_AdvancedCraftingTable) mTileEntity.getMetaTileEntity())
+ .consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
+ return aPlayer.inventory.getItemStack();
+ } else {
+ for (int i = 0;
+ i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize
+ && ((GT_MetaTileEntity_AdvancedCraftingTable)
+ mTileEntity.getMetaTileEntity())
+ .canDoCraftingOutput();
+ i++) {
+ if (!GT_Utility.areStacksEqual(
+ tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)
+ mTileEntity.getMetaTileEntity())
+ .getCraftingOutput(),
+ tCraftedStack)
+ || tStack.stackSize != tStack2.stackSize)
+ return aPlayer.inventory.getItemStack();
+ aPlayer.inventory.setItemStack(
+ ((GT_MetaTileEntity_AdvancedCraftingTable) mTileEntity.getMetaTileEntity())
+ .consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
+ }
+ return aPlayer.inventory.getItemStack();
+ }
+ }
+ }
+ return null;
+ } else if (aSlotIndex == 34) {
+ ((GT_MetaTileEntity_AdvancedCraftingTable) mTileEntity.getMetaTileEntity()).mFlushMode = true;
+ return null;
+ } else if (aSlotIndex == 35) {
+ ((GT_MetaTileEntity_AdvancedCraftingTable) mTileEntity.getMetaTileEntity()).sortIntoTheInputSlots();
+ return null;
+ }
+ } catch (Throwable e) {
+ // GT_Log.log.catching(e);
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
-
+
public int getSlotCount() {
- return 33;
+ return 33;
}
-
+
public int getShiftClickSlotCount() {
- return 21;
+ return 21;
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java
index d26c4d49fd..46bd70e55a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java
@@ -13,109 +13,141 @@ import net.minecraft.item.ItemStack;
public class GT_Container_BronzeWorkbench extends GT_ContainerMetaTile_Machine {
- public GT_Container_BronzeWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
+ public GT_Container_BronzeWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 0, 8, 8));
- addSlotToContainer(new Slot(mTileEntity, 1, 26, 8));
- addSlotToContainer(new Slot(mTileEntity, 2, 44, 8));
- addSlotToContainer(new Slot(mTileEntity, 3, 62, 8));
- addSlotToContainer(new Slot(mTileEntity, 4, 8, 26));
- addSlotToContainer(new Slot(mTileEntity, 5, 26, 26));
- addSlotToContainer(new Slot(mTileEntity, 6, 44, 26));
- addSlotToContainer(new Slot(mTileEntity, 7, 62, 26));
- addSlotToContainer(new Slot(mTileEntity, 8, 8, 44));
- addSlotToContainer(new Slot(mTileEntity, 9, 26, 44));
- addSlotToContainer(new Slot(mTileEntity, 10, 44, 44));
- addSlotToContainer(new Slot(mTileEntity, 11, 62, 44));
- addSlotToContainer(new Slot(mTileEntity, 12, 8, 62));
- addSlotToContainer(new Slot(mTileEntity, 13, 26, 62));
- addSlotToContainer(new Slot(mTileEntity, 14, 44, 62));
- addSlotToContainer(new Slot(mTileEntity, 15, 62, 62));
-
- addSlotToContainer(new Slot(mTileEntity, 16, 82, 8));
- addSlotToContainer(new Slot(mTileEntity, 17, 100, 8));
- addSlotToContainer(new Slot(mTileEntity, 18, 118, 8));
- addSlotToContainer(new Slot(mTileEntity, 19, 136, 8));
- addSlotToContainer(new Slot(mTileEntity, 20, 154, 8));
-
- addSlotToContainer(new Slot(mTileEntity, 21, 82, 28));
+ addSlotToContainer(new Slot(mTileEntity, 0, 8, 8));
+ addSlotToContainer(new Slot(mTileEntity, 1, 26, 8));
+ addSlotToContainer(new Slot(mTileEntity, 2, 44, 8));
+ addSlotToContainer(new Slot(mTileEntity, 3, 62, 8));
+ addSlotToContainer(new Slot(mTileEntity, 4, 8, 26));
+ addSlotToContainer(new Slot(mTileEntity, 5, 26, 26));
+ addSlotToContainer(new Slot(mTileEntity, 6, 44, 26));
+ addSlotToContainer(new Slot(mTileEntity, 7, 62, 26));
+ addSlotToContainer(new Slot(mTileEntity, 8, 8, 44));
+ addSlotToContainer(new Slot(mTileEntity, 9, 26, 44));
+ addSlotToContainer(new Slot(mTileEntity, 10, 44, 44));
+ addSlotToContainer(new Slot(mTileEntity, 11, 62, 44));
+ addSlotToContainer(new Slot(mTileEntity, 12, 8, 62));
+ addSlotToContainer(new Slot(mTileEntity, 13, 26, 62));
+ addSlotToContainer(new Slot(mTileEntity, 14, 44, 62));
+ addSlotToContainer(new Slot(mTileEntity, 15, 62, 62));
+
+ addSlotToContainer(new Slot(mTileEntity, 16, 82, 8));
+ addSlotToContainer(new Slot(mTileEntity, 17, 100, 8));
+ addSlotToContainer(new Slot(mTileEntity, 18, 118, 8));
+ addSlotToContainer(new Slot(mTileEntity, 19, 136, 8));
+ addSlotToContainer(new Slot(mTileEntity, 20, 154, 8));
+
+ addSlotToContainer(new Slot(mTileEntity, 21, 82, 28));
addSlotToContainer(new Slot(mTileEntity, 22, 100, 28));
addSlotToContainer(new Slot(mTileEntity, 23, 118, 28));
- addSlotToContainer(new Slot(mTileEntity, 24, 82, 46));
+ addSlotToContainer(new Slot(mTileEntity, 24, 82, 46));
addSlotToContainer(new Slot(mTileEntity, 25, 100, 46));
addSlotToContainer(new Slot(mTileEntity, 26, 118, 46));
- addSlotToContainer(new Slot(mTileEntity, 27, 82, 64));
+ addSlotToContainer(new Slot(mTileEntity, 27, 82, 64));
addSlotToContainer(new Slot(mTileEntity, 28, 100, 64));
addSlotToContainer(new Slot(mTileEntity, 29, 118, 64));
-
+
addSlotToContainer(new Slot(mTileEntity, 33, 154, 28));
addSlotToContainer(new Slot(mTileEntity, 34, 154, 64));
-
+
addSlotToContainer(new SlotBlueprint(mTileEntity, 30, 136, 28));
addSlotToContainer(new GT_Slot_Holo(mTileEntity, 31, 136, 64, false, false, 1));
addSlotToContainer(new GT_Slot_Holo(mTileEntity, 32, 154, 46, false, false, 1));
addSlotToContainer(new GT_Slot_Holo(mTileEntity, 32, 136, 46, false, false, 1));
-
}
-
+
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (aSlotIndex < 21 || aSlotIndex > 35) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- if (mTileEntity == null || mTileEntity.getMetaTileEntity() == null) return null;
- try {
- ItemStack tStack = ((Slot)inventorySlots.get(aSlotIndex)).getStack();
- if (tStack != null && tStack.stackSize <= 0 && !GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack())) {
- return null;
- }
- if (aSlotIndex == 32) {
- if (aMouseclick == 0 && aShifthold == 1) {
- ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).setBluePrint(null);
- return null;
- }
- } else if (aSlotIndex == 33) {
- ItemStack tStack2, tCraftedStack = ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput();
- if (tCraftedStack != null) {
- if (aShifthold == 1) {
- for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i++) {
- for (byte j = 0; j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize && ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput(); j++) {
- if (!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack) || tStack.stackSize != tStack2.stackSize) return aPlayer.inventory.getItemStack();
- aPlayer.inventory.mainInventory[i] = (((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.mainInventory[i]));
- }
- }
- } else {
- if (aMouseclick == 0) {
- if (((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput()) aPlayer.inventory.setItemStack(((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
- return aPlayer.inventory.getItemStack();
- } else {
- for (int i = 0; i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize && ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput(); i++) {
- if (!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack) || tStack.stackSize != tStack2.stackSize) return aPlayer.inventory.getItemStack();
- aPlayer.inventory.setItemStack(((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
- }
- return aPlayer.inventory.getItemStack();
- }
- }
- }
- return null;
- } else if (aSlotIndex == 34) {
- ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).mFlushMode = true;
- return null;
- } else if (aSlotIndex == 35) {
- ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).sortIntoTheInputSlots();
- return null;
- }
- } catch(Throwable e) {
- //GT_Log.log.catching(e);
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ if (aSlotIndex < 21 || aSlotIndex > 35) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ if (mTileEntity == null || mTileEntity.getMetaTileEntity() == null) return null;
+ try {
+ ItemStack tStack = ((Slot) inventorySlots.get(aSlotIndex)).getStack();
+ if (tStack != null
+ && tStack.stackSize <= 0
+ && !GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack())) {
+ return null;
+ }
+ if (aSlotIndex == 32) {
+ if (aMouseclick == 0 && aShifthold == 1) {
+ ((GT_MetaTileEntity_BronzeCraftingTable) mTileEntity.getMetaTileEntity()).setBluePrint(null);
+ return null;
+ }
+ } else if (aSlotIndex == 33) {
+ ItemStack tStack2,
+ tCraftedStack =
+ ((GT_MetaTileEntity_BronzeCraftingTable) mTileEntity.getMetaTileEntity())
+ .getCraftingOutput();
+ if (tCraftedStack != null) {
+ if (aShifthold == 1) {
+ for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i++) {
+ for (byte j = 0;
+ j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize
+ && ((GT_MetaTileEntity_BronzeCraftingTable) mTileEntity.getMetaTileEntity())
+ .canDoCraftingOutput();
+ j++) {
+ if (!GT_Utility.areStacksEqual(
+ tStack2 = ((GT_MetaTileEntity_BronzeCraftingTable)
+ mTileEntity.getMetaTileEntity())
+ .getCraftingOutput(),
+ tCraftedStack)
+ || tStack.stackSize != tStack2.stackSize)
+ return aPlayer.inventory.getItemStack();
+ aPlayer.inventory.mainInventory[i] = (((GT_MetaTileEntity_BronzeCraftingTable)
+ mTileEntity.getMetaTileEntity())
+ .consumeMaterials(aPlayer, aPlayer.inventory.mainInventory[i]));
+ }
+ }
+ } else {
+ if (aMouseclick == 0) {
+ if (((GT_MetaTileEntity_BronzeCraftingTable) mTileEntity.getMetaTileEntity())
+ .canDoCraftingOutput())
+ aPlayer.inventory.setItemStack(
+ ((GT_MetaTileEntity_BronzeCraftingTable) mTileEntity.getMetaTileEntity())
+ .consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
+ return aPlayer.inventory.getItemStack();
+ } else {
+ for (int i = 0;
+ i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize
+ && ((GT_MetaTileEntity_BronzeCraftingTable) mTileEntity.getMetaTileEntity())
+ .canDoCraftingOutput();
+ i++) {
+ if (!GT_Utility.areStacksEqual(
+ tStack2 = ((GT_MetaTileEntity_BronzeCraftingTable)
+ mTileEntity.getMetaTileEntity())
+ .getCraftingOutput(),
+ tCraftedStack)
+ || tStack.stackSize != tStack2.stackSize)
+ return aPlayer.inventory.getItemStack();
+ aPlayer.inventory.setItemStack(
+ ((GT_MetaTileEntity_BronzeCraftingTable) mTileEntity.getMetaTileEntity())
+ .consumeMaterials(aPlayer, aPlayer.inventory.getItemStack()));
+ }
+ return aPlayer.inventory.getItemStack();
+ }
+ }
+ }
+ return null;
+ } else if (aSlotIndex == 34) {
+ ((GT_MetaTileEntity_BronzeCraftingTable) mTileEntity.getMetaTileEntity()).mFlushMode = true;
+ return null;
+ } else if (aSlotIndex == 35) {
+ ((GT_MetaTileEntity_BronzeCraftingTable) mTileEntity.getMetaTileEntity()).sortIntoTheInputSlots();
+ return null;
+ }
+ } catch (Throwable e) {
+ // GT_Log.log.catching(e);
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
-
+
public int getSlotCount() {
- return 33;
+ return 33;
}
-
+
public int getShiftClickSlotCount() {
- return 21;
+ return 21;
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java
index 094a7a7eb9..d341a0766d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java
@@ -1,84 +1,87 @@
package gtPlusPlus.xmod.gregtech.api.gui.workbench;
-import java.util.ArrayList;
-import java.util.List;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.sys.KeyboardUtils;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_AdvancedWorkbench extends GT_GUIContainerMetaTile_Machine {
-
- private final String mLocalName;
-
- public GT_GUIContainer_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aLocalName) {
- super(new GT_Container_AdvancedWorkbench(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "AdvancedCraftingTable.png");
+
+ private final String mLocalName;
+
+ public GT_GUIContainer_AdvancedWorkbench(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aLocalName) {
+ super(
+ new GT_Container_AdvancedWorkbench(aInventoryPlayer, aTileEntity),
+ CORE.RES_PATH_GUI + "AdvancedCraftingTable.png");
mLocalName = aLocalName;
}
-
- public GT_GUIContainer_AdvancedWorkbench(GT_ContainerMetaTile_Machine aContainer, String aLocalName, String aResource) {
+
+ public GT_GUIContainer_AdvancedWorkbench(
+ GT_ContainerMetaTile_Machine aContainer, String aLocalName, String aResource) {
super(aContainer, aResource);
mLocalName = aLocalName;
}
-
+
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- //fontRendererObj.drawString(mLocalName, 8, 4, 4210752);
- this.drawTooltip(par1, par2);
- }
+ // fontRendererObj.drawString(mLocalName, 8, 4, 4210752);
+ this.drawTooltip(par1, par2);
+ }
+
+ private void drawTooltip(final int x2, final int y2) {
+ final int xStart = (this.width - this.xSize) / 2;
+ final int yStart = (this.height - this.ySize) / 2;
+ final int x3 = x2 - xStart;
+ final int y3 = y2 - yStart + 5;
+ final List<String> list = new ArrayList<String>();
+ // 154 - 172
+
+ if (KeyboardUtils.isShiftKeyDown()) {
+ if (y3 >= 30 && y3 <= 49) {
+ if (x3 >= 135 && x3 <= 154) {
+ list.add("Blueprint Slot");
+ list.add("Shift+Lmb Sets to crafting output");
+ }
+ if (x3 >= 153 && x3 <= 170) {
+ list.add("Extraction Slot");
+ list.add("Things can always be pulled from here");
+ }
+ }
+ if (y3 >= 50 && y3 <= 67) {
+ if (x3 >= 135 && x3 <= 152) {
+ list.add("Flush");
+ list.add("Empty crafting grid back to storage");
+ }
+ if (x3 >= 153 && x3 <= 170) {
+ list.add("Automation");
+ list.add("Allows output while");
+ list.add("crafting grid is full");
+ }
+ }
+ if (y3 >= 68 && y3 <= 85) {
+ if (x3 >= 135 && x3 <= 152) {
+ list.add("Output Slot");
+ }
+ if (x3 >= 153 && x3 <= 170) {
+ list.add("Free Parking");
+ }
+ }
+ }
+ if (!list.isEmpty()) {
+ this.drawHoveringText(list, x3, y3, this.fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
+ }
- private void drawTooltip(final int x2, final int y2) {
- final int xStart = (this.width - this.xSize) / 2;
- final int yStart = (this.height - this.ySize) / 2;
- final int x3 = x2 - xStart;
- final int y3 = y2 - yStart + 5;
- final List<String> list = new ArrayList<String>();
- //154 - 172
-
- if (KeyboardUtils.isShiftKeyDown()) {
- if (y3 >= 30 && y3 <= 49) {
- if (x3 >= 135 && x3 <= 154) {
- list.add("Blueprint Slot");
- list.add("Shift+Lmb Sets to crafting output");
- }
- if (x3 >= 153 && x3 <= 170) {
- list.add("Extraction Slot");
- list.add("Things can always be pulled from here");
- }
- }
- if (y3 >= 50 && y3 <= 67) {
- if (x3 >= 135 && x3 <= 152) {
- list.add("Flush");
- list.add("Empty crafting grid back to storage");
- }
- if (x3 >= 153 && x3 <= 170) {
- list.add("Automation");
- list.add("Allows output while");
- list.add("crafting grid is full");
- }
- }
- if (y3 >= 68 && y3 <= 85){
- if (x3 >= 135 && x3 <= 152) {
- list.add("Output Slot");
- }
- if (x3 >= 153 && x3 <= 170) {
- list.add("Free Parking");
- }
- }
- }
- if (!list.isEmpty()) {
- this.drawHoveringText(list, x3, y3, this.fontRendererObj);
- RenderHelper.enableGUIStandardItemLighting();
- }
- }
-
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, 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/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java
index 178c9241f1..0967317090 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java
@@ -6,8 +6,11 @@ import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_BronzeWorkbench extends GT_GUIContainer_AdvancedWorkbench {
- public GT_GUIContainer_BronzeWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aLocalName) {
- super(new GT_Container_BronzeWorkbench(aInventoryPlayer, aTileEntity), aLocalName, CORE.RES_PATH_GUI + "BronzeCraftingTable.png");
+ public GT_GUIContainer_BronzeWorkbench(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aLocalName) {
+ super(
+ new GT_Container_BronzeWorkbench(aInventoryPlayer, aTileEntity),
+ aLocalName,
+ CORE.RES_PATH_GUI + "BronzeCraftingTable.png");
}
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java
index 3c29b34e27..d49f1e9ed0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java
@@ -5,20 +5,35 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public interface GregtechItemContainer {
- 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 GregtechItemContainer set(Item aItem);
- public GregtechItemContainer set(ItemStack aStack);
- public GregtechItemContainer registerOre(Object... aOreNames);
- public GregtechItemContainer 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
+ 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 GregtechItemContainer set(Item aItem);
+
+ public GregtechItemContainer set(ItemStack aStack);
+
+ public GregtechItemContainer registerOre(Object... aOreNames);
+
+ public GregtechItemContainer registerWildcardAsOre(Object... aOreNames);
+
+ public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements);
+
+ public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements);
+
+ public boolean hasBeenSet();
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IBaseCustomMetaTileEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IBaseCustomMetaTileEntity.java
index 71d15e6e77..e210dfb487 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IBaseCustomMetaTileEntity.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IBaseCustomMetaTileEntity.java
@@ -2,6 +2,5 @@ package gtPlusPlus.xmod.gregtech.api.interfaces;
public interface IBaseCustomMetaTileEntity {
- public boolean doesExplode();
-
+ public boolean doesExplode();
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java
index 824bb258d8..cf1f137e0d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java
@@ -5,22 +5,21 @@ import net.minecraftforge.common.util.ForgeDirection;
public interface IHeatEntity extends IHeatSource, IHeatSink {
- public int getHeatBuffer();
+ public int getHeatBuffer();
- public void setHeatBuffer(int HeatBuffer);
+ public void setHeatBuffer(int HeatBuffer);
- public void addtoHeatBuffer(int heat);
+ public void addtoHeatBuffer(int heat);
- public int getTransmitHeat();
+ public int getTransmitHeat();
- public int fillHeatBuffer(int maxAmount);
+ public int fillHeatBuffer(int maxAmount);
- public int getMaxHeatEmittedPerTick();
-
- public void updateHeatEntity();
+ public int getMaxHeatEmittedPerTick();
- public int maxrequestHeatTick(ForgeDirection directionFrom);
+ public void updateHeatEntity();
- public int requestHeat(ForgeDirection directionFrom, int requestheat);
-
+ public int maxrequestHeatTick(ForgeDirection directionFrom);
+
+ public int requestHeat(ForgeDirection directionFrom, int requestheat);
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatSink.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatSink.java
index 80adcf0d51..9e671fe538 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatSink.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatSink.java
@@ -3,11 +3,8 @@ package gtPlusPlus.xmod.gregtech.api.interfaces;
import net.minecraftforge.common.util.ForgeDirection;
public interface IHeatSink {
-
-
- int maxHeatInPerTick(ForgeDirection var1);
-
- int addHeat(ForgeDirection var1, int var2);
-
-
-} \ No newline at end of file
+
+ int maxHeatInPerTick(ForgeDirection var1);
+
+ int addHeat(ForgeDirection var1, int var2);
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java
index 770f249648..60477c9f31 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java
@@ -1,14 +1,10 @@
package gtPlusPlus.xmod.gregtech.api.interfaces;
-import java.util.ArrayList;
-
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import java.util.ArrayList;
import net.minecraft.tileentity.TileEntity;
public interface IMetaTileEntityHeatPipe extends IMetaTileEntity {
-
-
- long transferHeat(byte var1, long var2, long var4, ArrayList<TileEntity> var6);
-
-
-} \ No newline at end of file
+
+ long transferHeat(byte var1, long var2, long var4, ArrayList<TileEntity> var6);
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
index 1f4951979d..530d7aa86c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -6,214 +6,336 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public interface IGregtech_RecipeAdder {
- /**
- * Adds a Coke Oven Recipe
- *
- * @param aInput1 = first Input (not null, and respects StackSize)
- * @param aInputb = second Input (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Creosote (not null, and respects StackSize)
- * @param aFluidInput = fluid Input (can be null, and respects StackSize)
- * @param aOutput = Output of the Coal/coke (can be null, and respects StackSize)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
- //public boolean addCokeOvenRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue);
- public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt);
-
-
- public boolean addCokeOvenRecipe(int aCircuit, ItemStack aInput2, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt);
-
-
- public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt);
-
-
- public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType);
-
-
- /**
- * Adds a Matter Fabricator Recipe
- *
- * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
- * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
- public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
-
- /**
- * Adds a Matter Fabricator Recipe
- *
- * @param aItemInput = ItemStack Input, can be null I assume.
- * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
- public boolean addMatterFabricatorRecipe(ItemStack aItemInput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
-
-
-
-
- /**
- * Adds a Recipe for the Dehydrator. (up to 9 Outputs)
- *
- * @param aInput = Input itemstack (not null, and respects StackSize)
- * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aOutputItems = Itemstack[] (not null, and respects StackSize)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
-
- //public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);
- /*public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);*/
- /*public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt);
+ /**
+ * Adds a Coke Oven Recipe
+ *
+ * @param aInput1 = first Input (not null, and respects StackSize)
+ * @param aInputb = second Input (can be null, and respects StackSize)
+ * @param aFluidOutput = Output of the Creosote (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be null, and respects StackSize)
+ * @param aOutput = Output of the Coal/coke (can be null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ // public boolean addCokeOvenRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial,
+ // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue);
+ public boolean addCokeOvenRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack aOutput,
+ int aDuration,
+ int aEUt);
+
+ public boolean addCokeOvenRecipe(
+ int aCircuit,
+ ItemStack aInput2,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int aDuration,
+ int aEUt);
+
+ public boolean addCokeOvenRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int aDuration,
+ int aEUt);
+
+ public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType);
+
+ /**
+ * Adds a Matter Fabricator Recipe
+ *
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
+
+ /**
+ * Adds a Matter Fabricator Recipe
+ *
+ * @param aItemInput = ItemStack Input, can be null I assume.
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ public boolean addMatterFabricatorRecipe(
+ ItemStack aItemInput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
+
+ /**
+ * Adds a Recipe for the Dehydrator. (up to 9 Outputs)
+ *
+ * @param aInput = Input itemstack (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aOutputItems = Itemstack[] (not null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+
+ // public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration,
+ // int aEUt);
+ /*public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);*/
+ /*public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt);
public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt);*/
- /**
- * Adds a Recipe for the Dehydrator. (up to 9 Outputs)
- *
- * @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
- * @param aOutputItems = ItemStack[] (not null, and respects StackSize)
- * @param aChances = Output Change (can be == 0)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
- public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt);
-
-
- /**
- * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
- *
- * @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
- * @param aChances = Output Chance (can be == 0)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU per tick needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt);
-
- /**
- * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
- *
- * @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
- * @param aChances = Output Chance (can be == 0)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU per tick needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance, int aDuration, int aEUt);
-
- /**
- * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
- *
- * @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
- * @param aOutputStack = Item Output (Can be null)
- * @param aChances = Output Chance (can be == 0)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU per tick needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt);
-
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance, int aDuration, int aEUt, int aSpecialValue);
-
- /**
- * Adds a Recipe for the LFTRr. (up to 9 Inputs)
- *
- * @param aInput = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
- * @param aFluidOutput = Output of the Molten Salts (not null, and respects StackSize)
- * @param aOutputStack = Item Output (Can be null)
- * @param aChances = Output Chance (can be == 0)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU per tick needed for heating up (must be >= 0)
- * @param aSpecialValue = Power produced in EU/t per dynamo
- * @return true if the Recipe got added, otherwise false.
- */
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue);
-
-
- public boolean addLFTRRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt);
- public boolean addLFTRRecipe(ItemStack aInput1, FluidStack aInput2, ItemStack aOutput1, FluidStack aOutput2, int aDuration, int aEUt);
- public boolean addLFTRRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt);
-
-
- /**
- * Adds a custom Semifluid fuel for the GT++ SemiFluid Generators.
- * @param aFuelItem - A Fluidstack to be consumed.
- * @param aFuelValue - Fuel value in thousands (1 = 1000)
- * @return - Was the Fuel added?
- */
- public boolean addSemifluidFuel(FluidStack aFuelItem, int aFuelValue);
-
- /**
- * Adds a custom Semifluid fuel for the GT++ SemiFluid Generators.
- * @param aFuelItem - A Fluidstack to be consumed.
- * @param aFuelValue - Fuel value in thousands (1 = 1000)
- * @return - Was the Fuel added?
- */
- public boolean addSemifluidFuel(ItemStack aFuelItem, int aFuelValue);
-
- public boolean addFissionFuel(
- FluidStack aInput1, FluidStack aInput2, FluidStack aInput3,
- FluidStack aInput4, FluidStack aInput5, FluidStack aInput6,
- FluidStack aInput7, FluidStack aInput8, FluidStack aInput9,
- FluidStack aOutput1, FluidStack aOutput2,
- int aDuration, int aEUt);
-
- public boolean addFissionFuel(
- boolean aOptimise,
- FluidStack aInput1, FluidStack aInput2, FluidStack aInput3,
- FluidStack aInput4, FluidStack aInput5, FluidStack aInput6,
- FluidStack aInput7, FluidStack aInput8, FluidStack aInput9,
- FluidStack aOutput1, FluidStack aOutput2,
- int aDuration, int aEUt);
-
- public boolean addCyclotronRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs,
- FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt, int aSpecialValue);
-
- boolean addCyclotronRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack[] aOutput, FluidStack aFluidOutput,
- int[] aChances, int aDuration, int aEUt, int aSpecialValue);
-
- public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4,
- FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt);
-
-
- /**
- * Adds a Recipe for the Machine Component Assembler. (up to 6 Inputs)
- *
- * @param aInputs = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
- * @param aOutput1 = Output ItemStack (not null, and respects StackSize)
- * @param aDuration = Duration (must be >= 0)
- * @param aEUt = EU per tick needed for heating up (must be >= 0)
- * @return true if the Recipe got added, otherwise false.
- */
- public boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt);
-
- public boolean addMultiblockCentrifugeRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial);
-
- public boolean addMultiblockElectrolyzerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial);
-
- public boolean addAdvancedFreezerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial);
-
-
- public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2, ItemStack aOutput, int a1, int a2);
- public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2, FluidStack aInputFluid, ItemStack aOutput, int a1, int a2);
-
- public boolean addSixSlotAssemblingRecipe(ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1, int aDuration, int aEUt);
+ /**
+ * Adds a Recipe for the Dehydrator. (up to 9 Outputs)
+ *
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aOutputItems = ItemStack[] (not null, and respects StackSize)
+ * @param aChances = Output Change (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ public boolean addDehydratorRecipe(
+ ItemStack[] aInput,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack[] aOutputItems,
+ int[] aChances,
+ int aDuration,
+ int aEUt);
+
+ /**
+ * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
+ *
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
+ * @param aChances = Output Chance (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU per tick needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt);
+
+ /**
+ * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
+ *
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
+ * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
+ * @param aChances = Output Chance (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU per tick needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ public boolean addBlastSmelterRecipe(
+ ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance, int aDuration, int aEUt);
+
+ /**
+ * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
+ *
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
+ * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize)
+ * @param aOutputStack = Item Output (Can be null)
+ * @param aChances = Output Chance (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU per tick needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ public boolean addBlastSmelterRecipe(
+ ItemStack[] aInput,
+ FluidStack aInputFluid,
+ FluidStack aOutput,
+ ItemStack[] aOutputStack,
+ int[] aChance,
+ int aDuration,
+ int aEUt);
+
+ public boolean addBlastSmelterRecipe(
+ ItemStack[] aInput,
+ FluidStack aInputFluid,
+ FluidStack aOutput,
+ int aChance,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue);
+
+ /**
+ * Adds a Recipe for the LFTRr. (up to 9 Inputs)
+ *
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
+ * @param aFluidOutput = Output of the Molten Salts (not null, and respects StackSize)
+ * @param aOutputStack = Item Output (Can be null)
+ * @param aChances = Output Chance (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU per tick needed for heating up (must be >= 0)
+ * @param aSpecialValue = Power produced in EU/t per dynamo
+ * @return true if the Recipe got added, otherwise false.
+ */
+ public boolean addBlastSmelterRecipe(
+ ItemStack[] aInput,
+ FluidStack aInputFluid,
+ FluidStack aOutput,
+ ItemStack[] aOutputStack,
+ int[] aChance,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue);
+
+ public boolean addLFTRRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt);
+
+ public boolean addLFTRRecipe(
+ ItemStack aInput1, FluidStack aInput2, ItemStack aOutput1, FluidStack aOutput2, int aDuration, int aEUt);
+
+ public boolean addLFTRRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt);
+
+ /**
+ * Adds a custom Semifluid fuel for the GT++ SemiFluid Generators.
+ * @param aFuelItem - A Fluidstack to be consumed.
+ * @param aFuelValue - Fuel value in thousands (1 = 1000)
+ * @return - Was the Fuel added?
+ */
+ public boolean addSemifluidFuel(FluidStack aFuelItem, int aFuelValue);
+
+ /**
+ * Adds a custom Semifluid fuel for the GT++ SemiFluid Generators.
+ * @param aFuelItem - A Fluidstack to be consumed.
+ * @param aFuelValue - Fuel value in thousands (1 = 1000)
+ * @return - Was the Fuel added?
+ */
+ public boolean addSemifluidFuel(ItemStack aFuelItem, int aFuelValue);
+
+ public boolean addFissionFuel(
+ FluidStack aInput1,
+ FluidStack aInput2,
+ FluidStack aInput3,
+ FluidStack aInput4,
+ FluidStack aInput5,
+ FluidStack aInput6,
+ FluidStack aInput7,
+ FluidStack aInput8,
+ FluidStack aInput9,
+ FluidStack aOutput1,
+ FluidStack aOutput2,
+ int aDuration,
+ int aEUt);
+
+ public boolean addFissionFuel(
+ boolean aOptimise,
+ FluidStack aInput1,
+ FluidStack aInput2,
+ FluidStack aInput3,
+ FluidStack aInput4,
+ FluidStack aInput5,
+ FluidStack aInput6,
+ FluidStack aInput7,
+ FluidStack aInput8,
+ FluidStack aInput9,
+ FluidStack aOutput1,
+ FluidStack aOutput2,
+ int aDuration,
+ int aEUt);
+
+ public boolean addCyclotronRecipe(
+ ItemStack aInput,
+ FluidStack aFluidInput,
+ ItemStack[] aOutputs,
+ FluidStack aFluidOutput,
+ int[] aChances,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue);
+
+ boolean addCyclotronRecipe(
+ ItemStack[] aInputs,
+ FluidStack aFluidInput,
+ ItemStack[] aOutput,
+ FluidStack aFluidOutput,
+ int[] aChances,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue);
+
+ public boolean addMixerRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ ItemStack aInput3,
+ ItemStack aInput4,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ ItemStack aOutput4,
+ int aDuration,
+ int aEUt);
+
+ /**
+ * Adds a Recipe for the Machine Component Assembler. (up to 6 Inputs)
+ *
+ * @param aInputs = ItemStack[] (not null, and respects StackSize)
+ * @param aFluidInput = Input of a fluid (can be null, and respects StackSize)
+ * @param aOutput1 = Output ItemStack (not null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU per tick needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ public boolean addComponentMakerRecipe(
+ ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt);
+
+ public boolean addMultiblockCentrifugeRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ int aDuration,
+ int aEUtick,
+ int aSpecial);
+
+ public boolean addMultiblockElectrolyzerRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ int aDuration,
+ int aEUtick,
+ int aSpecial);
+
+ public boolean addAdvancedFreezerRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ int aDuration,
+ int aEUtick,
+ int aSpecial);
+
+ public boolean addAssemblerRecipeWithOreDict(
+ Object aInput1, int aAmount1, Object aInput2, int aAmount2, ItemStack aOutput, int a1, int a2);
+
+ public boolean addAssemblerRecipeWithOreDict(
+ Object aInput1,
+ int aAmount1,
+ Object aInput2,
+ int aAmount2,
+ FluidStack aInputFluid,
+ ItemStack aOutput,
+ int a1,
+ int a2);
+
+ public boolean addSixSlotAssemblingRecipe(
+ ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1, int aDuration, int aEUt);
/**
* Adds an Assemblyline Recipe
*
@@ -223,8 +345,15 @@ public interface IGregtech_RecipeAdder {
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
- public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt);
-
+ public boolean addAssemblylineRecipe(
+ ItemStack aResearchItem,
+ int aResearchTime,
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack aOutput,
+ int aDuration,
+ int aEUt);
+
/**
* Adds a Assemblyline Recipe
*
@@ -232,35 +361,91 @@ public interface IGregtech_RecipeAdder {
* ItemStack[] for multiple equivalent items;
* {OreDict, amount} for oredict.
*/
- boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt);
+ boolean addAssemblylineRecipe(
+ ItemStack aResearchItem,
+ int aResearchTime,
+ Object[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack aOutput1,
+ int aDuration,
+ int aEUt);
+
+ public boolean addChemicalRecipe(
+ ItemStack input1,
+ ItemStack input2,
+ FluidStack inputFluid,
+ FluidStack outputFluid,
+ ItemStack output,
+ int time,
+ int eu);
+
+ public boolean addChemicalRecipe(
+ ItemStack input1,
+ ItemStack input2,
+ FluidStack inputFluid,
+ FluidStack outputFluid,
+ ItemStack output,
+ Object object,
+ int time,
+ int eu);
+
+ public boolean addChemicalRecipe(
+ ItemStack input1,
+ ItemStack input2,
+ FluidStack inputFluid,
+ FluidStack outputFluid,
+ ItemStack output,
+ ItemStack object,
+ int time);
+
+ public boolean addChemicalRecipe(
+ ItemStack input1,
+ ItemStack input2,
+ int aCircuit,
+ FluidStack inputFluid,
+ FluidStack outputFluid,
+ ItemStack output,
+ ItemStack output2,
+ int time,
+ int eu);
+
+ public boolean addMultiblockChemicalRecipe(
+ ItemStack[] itemStacks,
+ FluidStack[] fluidStacks,
+ FluidStack[] fluidStacks2,
+ ItemStack[] outputs,
+ int time,
+ int eu);
-
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, int time, int eu);
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, Object object, int time, int eu);
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, ItemStack object, int time);
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, int aCircuit, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, ItemStack output2, int time, int eu);
+ public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt);
- public boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks, FluidStack[] fluidStacks2, ItemStack[] outputs, int time, int eu);
+ public boolean addBrewingRecipe(
+ ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden);
- public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt);
+ public boolean addBrewingRecipe(
+ int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden);
+
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput);
+
+ public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu);
+
+ public boolean addFluidExtractionRecipe(
+ ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut, int aTime, int aEu);
- public boolean addBrewingRecipe(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden);
-
- public boolean addBrewingRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden);
+ public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn);
- public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput);
+ public boolean addFluidCannerRecipe(
+ ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut);
- public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu);
-
- public boolean addFluidExtractionRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut, int aTime, int aEu);
+ public boolean addFluidCannerRecipe(
+ ItemStack aContainer,
+ ItemStack aFullContainer,
+ FluidStack rFluidIn,
+ FluidStack rFluidOut,
+ int aTime,
+ int aEu);
- public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn);
-
- public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut);
-
- public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut, int aTime, int aEu);
-
- /**
+ /**
* Adds a Fusion reactor Recipe
*
* @param aInput1 = first Input (not null, and respects StackSize)
@@ -269,9 +454,15 @@ public interface IGregtech_RecipeAdder {
* @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
* @param aEu = The EU generated per Tick (can even be negative!)
* @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma, int aFusionDurationInTicks, int aEu, int aSpecial);
- /**
+ */
+ public boolean addFusionReactorRecipe(
+ ItemStack aInputStackA,
+ ItemStack aInputStackB,
+ FluidStack plasma,
+ int aFusionDurationInTicks,
+ int aEu,
+ int aSpecial);
+ /**
* Adds a Fusion reactor Recipe
*
* @param aInput1 = first Input (not null, and respects StackSize)
@@ -281,9 +472,16 @@ public interface IGregtech_RecipeAdder {
* @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
* @param aEu = The EU generated per Tick (can even be negative!)
* @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- public boolean addFusionReactorRecipe(FluidStack aInputStackA, FluidStack aInputStackB, FluidStack plasma, int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial);
- /**
+ */
+ public boolean addFusionReactorRecipe(
+ FluidStack aInputStackA,
+ FluidStack aInputStackB,
+ FluidStack plasma,
+ int aOutputChance,
+ int aFusionDurationInTicks,
+ int aEu,
+ int aSpecial);
+ /**
* Adds a Fusion reactor Recipe
*
* @param aInput1 = first Input (not null, and respects StackSize)
@@ -293,54 +491,145 @@ public interface IGregtech_RecipeAdder {
* @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
* @param aEu = The EU generated per Tick (can even be negative!)
* @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma, int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial);
-
-
- public boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2,
- FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1,
- ItemStack aOutput2, int aDuration, int aEUt, int aLevel);
-
- public boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aLevel);
-
- public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu);
- public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu);
-
- public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier);
- public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int[] aChances, int time, long eu, int aTier);
-
- public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat);
-
- public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt);
-
- public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt);
-
- public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aChance, int aDuration, int aEUt);
-
- public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden);
-
- public boolean addPulverisationRecipe(final ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, final ItemStack aOutput3);
-
- public boolean addMillingRecipe(Materials aMat, int aEU);
- public boolean addMillingRecipe(Material aMat, int aEU);
-
- public boolean addFlotationRecipe(Materials aMat, ItemStack aXanthate, FluidStack[] aInputFluids, FluidStack[] aOutputFluids, int aTime, int aEU);
- public boolean addFlotationRecipe(Material aMat, ItemStack aXanthate, FluidStack[] aInputFluids, FluidStack[] aOutputFluids, int aTime, int aEU);
-
- public boolean addpackagerRecipe(ItemStack aRecipeType, ItemStack aInput1, ItemStack aInput2, ItemStack aOutputStack1);
-
- public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage);
-
- public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU);
-
- public boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU);
-
- public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt);
-
- public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU);
-
- public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU);
-
- public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU, int aAmps);
-
+ */
+ public boolean addFusionReactorRecipe(
+ ItemStack aInputStackA,
+ ItemStack aInputStackB,
+ FluidStack plasma,
+ int aOutputChance,
+ int aFusionDurationInTicks,
+ int aEu,
+ int aSpecial);
+
+ public boolean addVacuumFurnaceRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ int aDuration,
+ int aEUt,
+ int aLevel);
+
+ public boolean addVacuumFurnaceRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack[] aOutputs,
+ FluidStack[] aFluidOutputs,
+ int aDuration,
+ int aEUt,
+ int aLevel);
+
+ public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu);
+
+ public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu);
+
+ public boolean addChemicalPlantRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aInputFluids,
+ ItemStack[] aOutputs,
+ FluidStack[] aFluidOutputs,
+ int time,
+ long eu,
+ int aTier);
+
+ public boolean addChemicalPlantRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aInputFluids,
+ ItemStack[] aOutputs,
+ FluidStack[] aFluidOutputs,
+ int[] aChances,
+ int time,
+ long eu,
+ int aTier);
+
+ public boolean addBlastRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aInputFluids,
+ ItemStack[] aOutputs,
+ FluidStack[] aFluidOutputs,
+ int time,
+ long eu,
+ int aHeat);
+
+ public boolean addPyrolyseRecipe(
+ ItemStack aInput,
+ FluidStack aFluidInput,
+ int intCircuit,
+ ItemStack aOutput,
+ FluidStack aFluidOutput,
+ int aDuration,
+ int aEUt);
+
+ public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt);
+
+ public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aChance, int aDuration, int aEUt);
+
+ public boolean addDistilleryRecipe(
+ ItemStack aCircuit,
+ FluidStack aInput,
+ FluidStack aOutput,
+ ItemStack aSolidOutput,
+ int aDuration,
+ int aEUt,
+ boolean aHidden);
+
+ public boolean addPulverisationRecipe(
+ final ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, final ItemStack aOutput3);
+
+ public boolean addMillingRecipe(Materials aMat, int aEU);
+
+ public boolean addMillingRecipe(Material aMat, int aEU);
+
+ public boolean addFlotationRecipe(
+ Materials aMat,
+ ItemStack aXanthate,
+ FluidStack[] aInputFluids,
+ FluidStack[] aOutputFluids,
+ int aTime,
+ int aEU);
+
+ public boolean addFlotationRecipe(
+ Material aMat,
+ ItemStack aXanthate,
+ FluidStack[] aInputFluids,
+ FluidStack[] aOutputFluids,
+ int aTime,
+ int aEU);
+
+ public boolean addpackagerRecipe(
+ ItemStack aRecipeType, ItemStack aInput1, ItemStack aInput2, ItemStack aOutputStack1);
+
+ public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage);
+
+ public boolean addColdTrapRecipe(
+ int aCircuit,
+ ItemStack aInput,
+ FluidStack aFluidInput,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ FluidStack aFluidOutput,
+ int aTime,
+ int aEU);
+
+ public boolean addReactorProcessingUnitRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ FluidStack aFluidOutput,
+ int aTime,
+ int aEU);
+
+ public boolean addFluidHeaterRecipe(
+ ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt);
+
+ public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU);
+
+ public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU);
+
+ public boolean addMolecularTransformerRecipe(
+ ItemStack aInput, ItemStack aOutput, int aDuration, int aEU, int aAmps);
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java
index b6c36483af..b597c221f5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java
@@ -4,18 +4,18 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
public interface Interface_IconContainer {
- /**
- * @return A regular Icon.
- */
- public IIcon getIcon();
+ /**
+ * @return A regular Icon.
+ */
+ public IIcon getIcon();
- /**
- * @return Icon of the Overlay (or null if there is no Icon)
- */
- public IIcon getOverlayIcon();
+ /**
+ * @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();
-} \ No newline at end of file
+ /**
+ * @return the Default Texture File for this Icon.
+ */
+ public ResourceLocation getTextureFile();
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
index e874258a7a..85ebb53217 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
@@ -1,7 +1,8 @@
package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+import gregtech.api.enums.SubTag;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base;
import java.util.List;
-
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -11,32 +12,52 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import gregtech.api.enums.SubTag;
-
-import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base;
-
public interface Interface_ItemBehaviour<E extends Item> {
- 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<String> getAdditionalToolTips(E aItem, List<String> 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(Gregtech_MetaItem_Base 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
+ 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<String> getAdditionalToolTips(E aItem, List<String> 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(Gregtech_MetaItem_Base 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);
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
index c997f14c9e..ec6bcae20c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
@@ -1,21 +1,29 @@
package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.Materials;
-
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import net.minecraft.item.ItemStack;
public interface Interface_OreRecipeRegistrator {
- /**
- * 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(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
+ /**
+ * 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(
+ GregtechOrePrefixes aPrefix,
+ GT_Materials aMaterial,
+ String aOreDictName,
+ String aModName,
+ ItemStack aStack);
- public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack copyAmount);
-} \ No newline at end of file
+ public void registerOre(
+ GregtechOrePrefixes aPrefix,
+ Materials aMaterial,
+ String aOreDictName,
+ String aModName,
+ ItemStack copyAmount);
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
index 6037424d1f..616fdfdebf 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
@@ -1,18 +1,17 @@
package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.OrePrefixes;
-
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import net.minecraft.item.ItemStack;
public interface Interface_OreRecipeRegistrator_GT {
- /**
- * 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, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
-} \ No newline at end of file
+ /**
+ * 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, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java
index 74c996d116..5780109a7b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java
@@ -4,17 +4,17 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
public interface Interface_Texture {
- public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+ 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 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 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 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 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 void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
- public boolean isValidTexture();
-} \ No newline at end of file
+ public boolean isValidTexture();
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
index ca167e4c7f..6578ddeb0b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.IToolStats;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
@@ -9,12 +12,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
-
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.interfaces.IToolStats;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-
-import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
import net.minecraftforge.event.world.BlockEvent;
/**
@@ -22,172 +19,185 @@ import net.minecraftforge.event.world.BlockEvent;
* <p/>
* And this is supposed to not have any ItemStack Parameters as these are generic Stats.
*/
-public interface Interface_ToolStats extends IToolStats{
- /**
- * Called when aPlayer crafts this Tool
- */
- @Override
- public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
-
- /**
- * Called when this gets added to a Tool Item
- */
- public void onStatsAddedToTool(Gregtech_MetaTool gregtech_MetaTool, int aID);
-
- /**
- * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU).
- */
- @Override
- public int getToolDamagePerBlockBreak();
-
- /**
- * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU).
- */
- @Override
- 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.
- */
- @Override
- public int getToolDamagePerContainerCraft();
-
- /**
- * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons.
- */
- @Override
- 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.
- */
- @Override
- public int getBaseQuality();
-
- /**
- * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch.
- */
- @Override
- public float getBaseDamage();
-
- /**
- * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum)
- */
- @Override
- public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity);
-
- /**
- * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed.
- */
- @Override
- public float getSpeedMultiplier();
-
- /**
- * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability.
- */
- @Override
- public float getMaxDurabilityMultiplier();
-
- @Override
- public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
-
- @Override
- public String getMiningSound();
-
- @Override
- public String getCraftingSound();
-
- @Override
- public String getEntityHitSound();
-
- @Override
- public String getBreakingSound();
-
- @Override
- public Enchantment[] getEnchantments(ItemStack aStack);
-
- @Override
- public int[] getEnchantmentLevels(ItemStack aStack);
-
- /**
- * @return If this Tool can be used for blocking Damage like a Sword.
- */
- @Override
- public boolean canBlock();
-
- /**
- * @return If this Tool can be used as an RC Crowbar.
- */
- @Override
- public boolean isCrowbar();
-
- /**
- * @return If this Tool can be used as an BC Wrench.
- */
- public boolean isWrench();
-
- /**
- * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
- */
- @Override
- 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
- */
- @Override
- public boolean isRangedWeapon();
-
- /**
- * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
- */
- @Override
- 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.
- */
- @Override
- 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.
- */
- @Override
- public int convertBlockDrops(List<ItemStack> 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.
- */
- @Override
- public ItemStack getBrokenItem(ItemStack aStack);
-
- /**
- * @return the Damage actually done to the Mob.
- */
- @Override
- public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
-
- /**
- * @return the Damage actually done to the Mob.
- */
- @Override
- public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
-
- @Override
- public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
-
- @Override
- public short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
-
- /**
- * Called when this gets added to a Tool Item
- */
- @Override
- public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID);
-} \ No newline at end of file
+public interface Interface_ToolStats extends IToolStats {
+ /**
+ * Called when aPlayer crafts this Tool
+ */
+ @Override
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * Called when this gets added to a Tool Item
+ */
+ public void onStatsAddedToTool(Gregtech_MetaTool gregtech_MetaTool, int aID);
+
+ /**
+ * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU).
+ */
+ @Override
+ public int getToolDamagePerBlockBreak();
+
+ /**
+ * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU).
+ */
+ @Override
+ 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.
+ */
+ @Override
+ public int getToolDamagePerContainerCraft();
+
+ /**
+ * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons.
+ */
+ @Override
+ 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.
+ */
+ @Override
+ public int getBaseQuality();
+
+ /**
+ * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch.
+ */
+ @Override
+ public float getBaseDamage();
+
+ /**
+ * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum)
+ */
+ @Override
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity);
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed.
+ */
+ @Override
+ public float getSpeedMultiplier();
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability.
+ */
+ @Override
+ public float getMaxDurabilityMultiplier();
+
+ @Override
+ public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
+
+ @Override
+ public String getMiningSound();
+
+ @Override
+ public String getCraftingSound();
+
+ @Override
+ public String getEntityHitSound();
+
+ @Override
+ public String getBreakingSound();
+
+ @Override
+ public Enchantment[] getEnchantments(ItemStack aStack);
+
+ @Override
+ public int[] getEnchantmentLevels(ItemStack aStack);
+
+ /**
+ * @return If this Tool can be used for blocking Damage like a Sword.
+ */
+ @Override
+ public boolean canBlock();
+
+ /**
+ * @return If this Tool can be used as an RC Crowbar.
+ */
+ @Override
+ public boolean isCrowbar();
+
+ /**
+ * @return If this Tool can be used as an BC Wrench.
+ */
+ public boolean isWrench();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ @Override
+ 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
+ */
+ @Override
+ public boolean isRangedWeapon();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ @Override
+ 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.
+ */
+ @Override
+ 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.
+ */
+ @Override
+ public int convertBlockDrops(
+ List<ItemStack> 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.
+ */
+ @Override
+ public ItemStack getBrokenItem(ItemStack aStack);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ @Override
+ public float getNormalDamageAgainstEntity(
+ float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ @Override
+ public float getMagicDamageAgainstEntity(
+ float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ @Override
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
+
+ @Override
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
+
+ /**
+ * Called when this gets added to a Tool Item
+ */
+ @Override
+ public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID);
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java
index 43998577c9..b9e402a2f6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java
@@ -1,11 +1,17 @@
package gtPlusPlus.xmod.gregtech.api.items;
-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_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import java.util.List;
import net.minecraft.block.BlockDispenser;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.dispenser.*;
@@ -19,174 +25,175 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import gregtech.api.enums.SubTag;
-import gregtech.api.interfaces.IProjectileItem;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-
/**
* Extended by most Items, also used as a fallback Item, to prevent the accidental deletion when Errors occur.
*/
public class Gregtech_Generic_Item extends Item implements IProjectileItem {
- private final String mName, mTooltip;
- protected IIcon mIcon;
-
- public Gregtech_Generic_Item(final String aUnlocalized, final String aEnglish, final String aEnglishTooltip) {
- this(aUnlocalized, aEnglish, aEnglishTooltip, true);
- }
-
- public Gregtech_Generic_Item(final String aUnlocalized, final String aEnglish, final String aEnglishTooltip, final boolean aWriteToolTipIntoLangFile) {
- super();
- this.mName = aUnlocalized;
- GT_LanguageManager.addStringLocalization(this.mName + ".name", aEnglish);
- if (GT_Utility.isStringValid(aEnglishTooltip)) {
- GT_LanguageManager.addStringLocalization(this.mTooltip = this.mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile);
- } else {
- this.mTooltip = null;
- }
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerItem(this, this.mName, CORE.MODID);
- BlockDispenser.dispenseBehaviorRegistry.putObject(this, new GT_Item_Dispense());
- }
-
- @Override
- public final Item setUnlocalizedName(final String aName) {
- return this;
- }
-
- @Override
- public final String getUnlocalizedName() {
- return this.mName;
- }
-
- @Override
- public String getUnlocalizedName(final ItemStack aStack) {
- return this.getHasSubtypes() ? this.mName + "." + this.getDamage(aStack) : this.mName;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister aIconRegister) {
- this.mIcon = aIconRegister.registerIcon(CORE.MODID+":"+this.mName);
- }
-
- @Override
- public boolean doesSneakBypassUse(final World aWorld, final int aX, final int aY, final int aZ, final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public IIcon getIconFromDamage(final int par1) {
- return this.mIcon;
- }
-
- public int getTier(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) {
- if ((this.getMaxDamage() > 0) && !this.getHasSubtypes()) {
- aList.add((aStack.getMaxDamage() - this.getDamage(aStack)) + " / " + aStack.getMaxDamage());
- }
- if (this.mTooltip != null) {
- aList.add(GT_LanguageManager.getTranslation(this.mTooltip));
- }
- if (GT_ModHandler.isElectricItem(aStack)) {
- aList.add("Tier: " + this.getTier(aStack));
- }
- this.addAdditionalToolTips(aList, aStack);
- }
-
- protected void addAdditionalToolTips(final List aList, final ItemStack aStack) {
- //
- }
-
- @Override
- public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- this.isItemStackUsable(aStack);
- }
-
- public boolean isItemStackUsable(final ItemStack aStack) {
- return true;
- }
-
- public ItemStack onDispense(final IBlockSource aSource, final ItemStack aStack) {
- final EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
- final IPosition iposition = BlockDispenser.func_149939_a(aSource);
- final ItemStack itemstack1 = aStack.splitStack(1);
- BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
- return aStack;
- }
-
- @Override
- public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld, final double aX, final double aY, final double aZ) {
- return null;
- }
-
- @Override
- public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld, final EntityLivingBase aEntity, final float aSpeed) {
- return null;
- }
-
- @Override
- public boolean hasProjectile(final SubTag aProjectileType, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public ItemStack getContainerItem(final ItemStack aStack) {
- return null;
- }
-
- @Override
- public boolean hasContainerItem(final ItemStack aStack) {
- return this.getContainerItem(aStack) != null;
- }
-
- public static class GT_Item_Dispense extends BehaviorProjectileDispense {
- @Override
- public ItemStack dispenseStack(final IBlockSource aSource, final ItemStack aStack) {
- return ((Gregtech_Generic_Item) aStack.getItem()).onDispense(aSource, aStack);
- }
-
- @Override
- protected IProjectile getProjectileEntity(final World aWorld, final IPosition aPosition) {
- return null;
- }
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- if (stack.getDisplayName().contains("LuV")){
- HEX_OxFFFFFF = 0xffffcc;
- }
- else if (stack.getDisplayName().contains("ZPM")){
- HEX_OxFFFFFF = 0xace600;
- }
- else if (stack.getDisplayName().contains("UV")){
- HEX_OxFFFFFF = 0xffff00;
- }
- else if (stack.getDisplayName().contains("MAX")){
- HEX_OxFFFFFF = 0xff0000;
- }
- else if (stack.getDisplayName().contains("Sodium")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(0, 0, 150);
- }
- else if (stack.getDisplayName().contains("Cadmium")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(50, 50, 60);
- }
- else if (stack.getDisplayName().contains("Lithium")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
- }
- else {
- HEX_OxFFFFFF = 0xffffff;
- }
- return HEX_OxFFFFFF;
- }
-} \ No newline at end of file
+ private final String mName, mTooltip;
+ protected IIcon mIcon;
+
+ public Gregtech_Generic_Item(final String aUnlocalized, final String aEnglish, final String aEnglishTooltip) {
+ this(aUnlocalized, aEnglish, aEnglishTooltip, true);
+ }
+
+ public Gregtech_Generic_Item(
+ final String aUnlocalized,
+ final String aEnglish,
+ final String aEnglishTooltip,
+ final boolean aWriteToolTipIntoLangFile) {
+ super();
+ this.mName = aUnlocalized;
+ GT_LanguageManager.addStringLocalization(this.mName + ".name", aEnglish);
+ if (GT_Utility.isStringValid(aEnglishTooltip)) {
+ GT_LanguageManager.addStringLocalization(
+ this.mTooltip = this.mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile);
+ } else {
+ this.mTooltip = null;
+ }
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerItem(this, this.mName, CORE.MODID);
+ BlockDispenser.dispenseBehaviorRegistry.putObject(this, new GT_Item_Dispense());
+ }
+
+ @Override
+ public final Item setUnlocalizedName(final String aName) {
+ return this;
+ }
+
+ @Override
+ public final String getUnlocalizedName() {
+ return this.mName;
+ }
+
+ @Override
+ public String getUnlocalizedName(final ItemStack aStack) {
+ return this.getHasSubtypes() ? this.mName + "." + this.getDamage(aStack) : this.mName;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(final IIconRegister aIconRegister) {
+ this.mIcon = aIconRegister.registerIcon(CORE.MODID + ":" + this.mName);
+ }
+
+ @Override
+ public boolean doesSneakBypassUse(
+ final World aWorld, final int aX, final int aY, final int aZ, final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public IIcon getIconFromDamage(final int par1) {
+ return this.mIcon;
+ }
+
+ public int getTier(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public void addInformation(
+ final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) {
+ if ((this.getMaxDamage() > 0) && !this.getHasSubtypes()) {
+ aList.add((aStack.getMaxDamage() - this.getDamage(aStack)) + " / " + aStack.getMaxDamage());
+ }
+ if (this.mTooltip != null) {
+ aList.add(GT_LanguageManager.getTranslation(this.mTooltip));
+ }
+ if (GT_ModHandler.isElectricItem(aStack)) {
+ aList.add("Tier: " + this.getTier(aStack));
+ }
+ this.addAdditionalToolTips(aList, aStack);
+ }
+
+ protected void addAdditionalToolTips(final List aList, final ItemStack aStack) {
+ //
+ }
+
+ @Override
+ public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
+ this.isItemStackUsable(aStack);
+ }
+
+ public boolean isItemStackUsable(final ItemStack aStack) {
+ return true;
+ }
+
+ public ItemStack onDispense(final IBlockSource aSource, final ItemStack aStack) {
+ final EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
+ final IPosition iposition = BlockDispenser.func_149939_a(aSource);
+ final ItemStack itemstack1 = aStack.splitStack(1);
+ BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
+ return aStack;
+ }
+
+ @Override
+ public EntityArrow getProjectile(
+ final SubTag aProjectileType,
+ final ItemStack aStack,
+ final World aWorld,
+ final double aX,
+ final double aY,
+ final double aZ) {
+ return null;
+ }
+
+ @Override
+ public EntityArrow getProjectile(
+ final SubTag aProjectileType,
+ final ItemStack aStack,
+ final World aWorld,
+ final EntityLivingBase aEntity,
+ final float aSpeed) {
+ return null;
+ }
+
+ @Override
+ public boolean hasProjectile(final SubTag aProjectileType, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ItemStack getContainerItem(final ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public boolean hasContainerItem(final ItemStack aStack) {
+ return this.getContainerItem(aStack) != null;
+ }
+
+ public static class GT_Item_Dispense extends BehaviorProjectileDispense {
+ @Override
+ public ItemStack dispenseStack(final IBlockSource aSource, final ItemStack aStack) {
+ return ((Gregtech_Generic_Item) aStack.getItem()).onDispense(aSource, aStack);
+ }
+
+ @Override
+ protected IProjectile getProjectileEntity(final World aWorld, final IPosition aPosition) {
+ return null;
+ }
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")) {
+ HEX_OxFFFFFF = 0xffffcc;
+ } else if (stack.getDisplayName().contains("ZPM")) {
+ HEX_OxFFFFFF = 0xace600;
+ } else if (stack.getDisplayName().contains("UV")) {
+ HEX_OxFFFFFF = 0xffff00;
+ } else if (stack.getDisplayName().contains("MAX")) {
+ HEX_OxFFFFFF = 0xff0000;
+ } else if (stack.getDisplayName().contains("Sodium")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(0, 0, 150);
+ } else if (stack.getDisplayName().contains("Cadmium")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(50, 50, 60);
+ } else if (stack.getDisplayName().contains("Lithium")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
+ } else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java
index 12b90c9a6c..3daf2d3f31 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java
@@ -2,20 +2,8 @@ package gtPlusPlus.xmod.gregtech.api.items;
import static gregtech.api.enums.GT_Values.D1;
-import java.util.*;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.EnumAction;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.SubTag;
@@ -27,319 +15,336 @@ import gregtech.api.objects.ItemData;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
+import java.util.*;
+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.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
public abstract class Gregtech_MetaItem extends Gregtech_MetaItem_Base {
- /**
- * 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.
- * <p/>
- * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
- */
- public static final HashMap<String, Gregtech_MetaItem> 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<Short, IFoodStat> mFoodStats = new HashMap<>();
- public final HashMap<Short, Long[]> mElectricStats = new HashMap<>();
- public final HashMap<Short, Long[]> mFluidContainerStats = new HashMap<>();
- public final HashMap<Short, Short> mBurnValues = new HashMap<>();
-
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized The Unlocalized Name of this Item.
- */
- public Gregtech_MetaItem(final String aUnlocalized, final short aOffset, final short aItemAmount) {
- super(aUnlocalized);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setHasSubtypes(true);
- this.setMaxDamage(0);
- this.mEnabledItems = new BitSet(aItemAmount);
- this.mVisibleItems = new BitSet(aItemAmount);
-
- this.mOffset = (short) Math.min(32766, aOffset);
- this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset);
- this.mIconList = new IIcon[aItemAmount][1];
-
- sInstances.put(this.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(final int aID, final String aEnglish, String aToolTip, final Object... aRandomData) {
- if (aToolTip == null) {
- aToolTip = "";
- }
- if ((aID >= 0) && (aID < this.mItemAmount)) {
- final ItemStack rStack = new ItemStack(this, 1, this.mOffset + aID);
- this.mEnabledItems.set(aID);
- this.mVisibleItems.set(aID);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip);
- final List<TC_AspectStack> tAspects = new ArrayList<>();
- // Important Stuff to do first
- for (final Object tRandomData : aRandomData) {
- if (tRandomData instanceof SubTag) {
- if (tRandomData == SubTag.INVISIBLE) {
- this.mVisibleItems.set(aID, false);
- continue;
- }
- if (tRandomData == SubTag.NO_UNIFICATION) {
- GT_OreDictUnificator.addToBlacklist(rStack);
- continue;
- }
- }
- }
- // now check for the rest
- for (final Object tRandomData : aRandomData) {
- if (tRandomData != null) {
- boolean tUseOreDict = true;
-
- if (tRandomData instanceof Interface_ItemBehaviour) {
- this.addItemBehavior(this.mOffset + aID, (Interface_ItemBehaviour<Gregtech_MetaItem_Base>) 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 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 Gregtech_MetaItem setBurnValue(final int aMetaValue, final int aValue) {
- if ((aMetaValue < 0) || (aMetaValue >= (this.mOffset + this.mEnabledItems.length())) || (aValue < 0)) {
- return this;
- }
- if (aValue == 0) {
- this.mBurnValues.remove((short) aMetaValue);
- } else {
- this.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 Gregtech_MetaItem setElectricStats(final int aMetaValue, final long aMaxCharge, final long aTransferLimit, final long aTier, final long aSpecialData, final boolean aUseAnimations) {
- if ((aMetaValue < 0) || (aMetaValue >= (this.mOffset + this.mEnabledItems.length()))) {
- return this;
- }
- if (aMaxCharge == 0) {
- this.mElectricStats.remove((short) aMetaValue);
- } else {
- this.mElectricStats.put((short) aMetaValue, new Long[]{aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData});
- if ((aMetaValue >= this.mOffset) && aUseAnimations) {
- this.mIconList[aMetaValue - this.mOffset] = Arrays.copyOf(this.mIconList[aMetaValue - this.mOffset], Math.max(9, this.mIconList[aMetaValue - this.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 Gregtech_MetaItem setFluidContainerStats(final int aMetaValue, final long aCapacity, final long aStacksize) {
- if ((aMetaValue < 0) || (aMetaValue >= (this.mOffset + this.mEnabledItems.length()))) {
- return this;
- }
- if (aCapacity < 0) {
- this.mElectricStats.remove((short) aMetaValue);
- } else {
- this.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(final ItemStack aStack) {
- return Materials._NULL.getRGBA();
- }
-
- /**
- * @return the Icon the Material is going to be rendered with.
- */
- public IIconContainer getIconContainer(final int aMetaData) {
- return null;
- }
-
- /* ---------- INTERNAL OVERRIDES ---------- */
-
- @Override
- public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- return super.onItemRightClick(aStack, aWorld, aPlayer);
- }
-
- @Override
- public int getMaxItemUseDuration(final ItemStack aStack) {
- return this.mFoodStats.get((short) this.getDamage(aStack)) == null ? 0 : 32;
- }
-
- @Override
- public EnumAction getItemUseAction(final ItemStack aStack) {
- return EnumAction.none;
- }
-
- @Override
- public final ItemStack onEaten(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IFoodStat tStat = this.mFoodStats.get((short) this.getDamage(aStack));
- if (tStat != null) {
-
- }
- return aStack;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
- for (int i = 0, j = this.mEnabledItems.length(); i < j; i++) {
- if (this.mVisibleItems.get(i) || (D1 && this.mEnabledItems.get(i))) {
- final Long[] tStats = this.mElectricStats.get((short) (this.mOffset + i));
- if ((tStats != null) && (tStats[3] < 0)) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.setCharge(tStack, Math.abs(tStats[0]));
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- if ((tStats == null) || (tStats[3] != -2)) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerIcons(final IIconRegister aIconRegister) {
- for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) {
- if (this.mEnabledItems.get(i)) {
- for (byte k = 1; k < this.mIconList[i].length; k++) {
- this.mIconList[i][k] = aIconRegister.registerIcon(CORE.MODID+":"+this.getUnlocalizedName() + "/" + i + "/" + k);
- }
- this.mIconList[i][0] = aIconRegister.registerIcon(CORE.MODID+":"+this.getUnlocalizedName() + "/" + i);
- }
- }
- }
-
- @Override
- public final Long[] getElectricStats(final ItemStack aStack) {
- return this.mElectricStats.get((short) aStack.getItemDamage());
- }
-
- @Override
- public final Long[] getFluidContainerStats(final ItemStack aStack) {
- return this.mFluidContainerStats.get((short) aStack.getItemDamage());
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- if (stack.getDisplayName().contains("LuV")){
- HEX_OxFFFFFF = 0xffffcc;
- }
- else if (stack.getDisplayName().contains("ZPM")){
- HEX_OxFFFFFF = 0xace600;
- }
- else if (stack.getDisplayName().contains("UV")){
- HEX_OxFFFFFF = 0xffff00;
- }
- else if (stack.getDisplayName().contains("MAX")){
- HEX_OxFFFFFF = 0xff0000;
- }
- else {
- HEX_OxFFFFFF = 0xffffff;
- }
- return HEX_OxFFFFFF;
- }
-} \ No newline at end of file
+ /**
+ * 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.
+ * <p/>
+ * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
+ */
+ public static final HashMap<String, Gregtech_MetaItem> 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<Short, IFoodStat> mFoodStats = new HashMap<>();
+ public final HashMap<Short, Long[]> mElectricStats = new HashMap<>();
+ public final HashMap<Short, Long[]> mFluidContainerStats = new HashMap<>();
+ public final HashMap<Short, Short> mBurnValues = new HashMap<>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public Gregtech_MetaItem(final String aUnlocalized, final short aOffset, final short aItemAmount) {
+ super(aUnlocalized);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setHasSubtypes(true);
+ this.setMaxDamage(0);
+ this.mEnabledItems = new BitSet(aItemAmount);
+ this.mVisibleItems = new BitSet(aItemAmount);
+
+ this.mOffset = (short) Math.min(32766, aOffset);
+ this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset);
+ this.mIconList = new IIcon[aItemAmount][1];
+
+ sInstances.put(this.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(final int aID, final String aEnglish, String aToolTip, final Object... aRandomData) {
+ if (aToolTip == null) {
+ aToolTip = "";
+ }
+ if ((aID >= 0) && (aID < this.mItemAmount)) {
+ final ItemStack rStack = new ItemStack(this, 1, this.mOffset + aID);
+ this.mEnabledItems.set(aID);
+ this.mVisibleItems.set(aID);
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip);
+ final List<TC_AspectStack> tAspects = new ArrayList<>();
+ // Important Stuff to do first
+ for (final Object tRandomData : aRandomData) {
+ if (tRandomData instanceof SubTag) {
+ if (tRandomData == SubTag.INVISIBLE) {
+ this.mVisibleItems.set(aID, false);
+ continue;
+ }
+ if (tRandomData == SubTag.NO_UNIFICATION) {
+ GT_OreDictUnificator.addToBlacklist(rStack);
+ continue;
+ }
+ }
+ }
+ // now check for the rest
+ for (final Object tRandomData : aRandomData) {
+ if (tRandomData != null) {
+ boolean tUseOreDict = true;
+
+ if (tRandomData instanceof Interface_ItemBehaviour) {
+ this.addItemBehavior(
+ this.mOffset + aID, (Interface_ItemBehaviour<Gregtech_MetaItem_Base>) 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 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 Gregtech_MetaItem setBurnValue(final int aMetaValue, final int aValue) {
+ if ((aMetaValue < 0) || (aMetaValue >= (this.mOffset + this.mEnabledItems.length())) || (aValue < 0)) {
+ return this;
+ }
+ if (aValue == 0) {
+ this.mBurnValues.remove((short) aMetaValue);
+ } else {
+ this.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 Gregtech_MetaItem setElectricStats(
+ final int aMetaValue,
+ final long aMaxCharge,
+ final long aTransferLimit,
+ final long aTier,
+ final long aSpecialData,
+ final boolean aUseAnimations) {
+ if ((aMetaValue < 0) || (aMetaValue >= (this.mOffset + this.mEnabledItems.length()))) {
+ return this;
+ }
+ if (aMaxCharge == 0) {
+ this.mElectricStats.remove((short) aMetaValue);
+ } else {
+ this.mElectricStats.put(
+ (short) aMetaValue,
+ new Long[] {aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData});
+ if ((aMetaValue >= this.mOffset) && aUseAnimations) {
+ this.mIconList[aMetaValue - this.mOffset] = Arrays.copyOf(
+ this.mIconList[aMetaValue - this.mOffset],
+ Math.max(9, this.mIconList[aMetaValue - this.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 Gregtech_MetaItem setFluidContainerStats(
+ final int aMetaValue, final long aCapacity, final long aStacksize) {
+ if ((aMetaValue < 0) || (aMetaValue >= (this.mOffset + this.mEnabledItems.length()))) {
+ return this;
+ }
+ if (aCapacity < 0) {
+ this.mElectricStats.remove((short) aMetaValue);
+ } else {
+ this.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(final ItemStack aStack) {
+ return Materials._NULL.getRGBA();
+ }
+
+ /**
+ * @return the Icon the Material is going to be rendered with.
+ */
+ public IIconContainer getIconContainer(final int aMetaData) {
+ return null;
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ @Override
+ public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public int getMaxItemUseDuration(final ItemStack aStack) {
+ return this.mFoodStats.get((short) this.getDamage(aStack)) == null ? 0 : 32;
+ }
+
+ @Override
+ public EnumAction getItemUseAction(final ItemStack aStack) {
+ return EnumAction.none;
+ }
+
+ @Override
+ public final ItemStack onEaten(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
+ final IFoodStat tStat = this.mFoodStats.get((short) this.getDamage(aStack));
+ if (tStat != null) {}
+
+ return aStack;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
+ for (int i = 0, j = this.mEnabledItems.length(); i < j; i++) {
+ if (this.mVisibleItems.get(i) || (D1 && this.mEnabledItems.get(i))) {
+ final Long[] tStats = this.mElectricStats.get((short) (this.mOffset + i));
+ if ((tStats != null) && (tStats[3] < 0)) {
+ final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
+ this.setCharge(tStack, Math.abs(tStats[0]));
+ this.isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ if ((tStats == null) || (tStats[3] != -2)) {
+ final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
+ this.isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerIcons(final IIconRegister aIconRegister) {
+ for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) {
+ if (this.mEnabledItems.get(i)) {
+ for (byte k = 1; k < this.mIconList[i].length; k++) {
+ this.mIconList[i][k] = aIconRegister.registerIcon(
+ CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i + "/" + k);
+ }
+ this.mIconList[i][0] =
+ aIconRegister.registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i);
+ }
+ }
+ }
+
+ @Override
+ public final Long[] getElectricStats(final ItemStack aStack) {
+ return this.mElectricStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public final Long[] getFluidContainerStats(final ItemStack aStack) {
+ return this.mFluidContainerStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
+ return false;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")) {
+ HEX_OxFFFFFF = 0xffffcc;
+ } else if (stack.getDisplayName().contains("ZPM")) {
+ HEX_OxFFFFFF = 0xace600;
+ } else if (stack.getDisplayName().contains("UV")) {
+ HEX_OxFFFFFF = 0xffff00;
+ } else if (stack.getDisplayName().contains("MAX")) {
+ HEX_OxFFFFFF = 0xff0000;
+ } else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java
index ec1c90186a..a961b28cf7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java
@@ -2,10 +2,14 @@ package gtPlusPlus.xmod.gregtech.api.items;
import static gregtech.api.enums.GT_Values.*;
+import gregtech.api.enums.SubTag;
+import gregtech.api.util.*;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
+import ic2.api.item.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -17,659 +21,746 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-
-import gregtech.api.enums.SubTag;
-import gregtech.api.util.*;
-
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
-import ic2.api.item.*;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
-public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- private final HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>> 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 Gregtech_MetaItem_Base(final String aUnlocalized) {
- super(aUnlocalized, "Generated Item", null, false);
- this.setHasSubtypes(true);
- this.setMaxDamage(0);
- }
-
- /**
- * Adds a special Item Behaviour to the Item.
- * <p/>
- * 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 Gregtech_MetaItem_Base addItemBehavior(final int aMetaValue, final Interface_ItemBehaviour<Gregtech_MetaItem_Base> aBehavior) {
- if ((aMetaValue < 0) || (aMetaValue >= 32766) || (aBehavior == null)) {
- return this;
- }
- ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) aMetaValue);
- if (tList == null) {
- tList = new ArrayList<>(1);
- this.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(final SubTag aProjectileType, final ItemStack aStack) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- if (tBehavior.hasProjectile(this, aProjectileType, aStack)) {
- return true;
- }
- }
- }
- return super.hasProjectile(aProjectileType, aStack);
- }
-
- @Override
- public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld, final double aX, final double aY, final double aZ) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- final 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(final SubTag aProjectileType, final ItemStack aStack, final World aWorld, final EntityLivingBase aEntity, final float aSpeed) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- final 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(final IBlockSource aSource, final ItemStack aStack) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- if (tBehavior.canDispense(this, aSource, aStack)) {
- return tBehavior.onDispense(this, aSource, aStack);
- }
- }
- }
- return super.onDispense(aSource, aStack);
- }
-
- @Override
- public boolean isItemStackUsable(final ItemStack aStack) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- if (!tBehavior.isItemStackUsable(this, aStack)) {
- return false;
- }
- }
- }
- return super.isItemStackUsable(aStack);
- }
-
- @Override
- public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
- this.use(aStack, 0, aPlayer);
- this.isItemStackUsable(aStack);
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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 (final Throwable e) {
- if (D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean onItemUse(final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- this.use(aStack, 0, aPlayer);
- this.isItemStackUsable(aStack);
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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 (final Throwable e) {
- if (D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean onItemUseFirst(final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- this.use(aStack, 0, aPlayer);
- this.isItemStackUsable(aStack);
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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 (final Throwable e) {
- if (D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- return false;
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- this.use(aStack, 0, aPlayer);
- this.isItemStackUsable(aStack);
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- try {
- aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
- } catch (final Throwable e) {
- if (D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- return aStack;
- }
-
- @Override
- public final void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList, final boolean aF3_H) {
- final String tKey = this.getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey);
- if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) {
- aList.add(tString);
- }
-
- Long[]
- tStats = this.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 {
- final long tCharge = this.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] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY);
- }
- }
- }
-
- tStats = this.getFluidContainerStats(aStack);
- if ((tStats != null) && (tStats[0] > 0)) {
- final FluidStack tFluid = this.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);
- }
-
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
- }
- }
-
- this.addAdditionalToolTips(aList, aStack);
- }
-
- @Override
- public void onUpdate(final ItemStack aStack, final World aWorld, final Entity aPlayer, final int aTimer, final boolean aIsInHand) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand);
- }
- }
- }
-
- @Override
- public final boolean canProvideEnergy(final ItemStack aStack) {
- final Long[] tStats = this.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(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.abs(tStats[0]);
- }
-
- @Override
- public final double getTransferLimit(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.max(tStats[1], tStats[3]);
- }
-
- @Override
- public final double charge(final ItemStack aStack, final double aCharge, final int aTier, final boolean aIgnoreTransferLimit, final boolean aSimulate) {
- final Long[] tStats = this.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;
- }
- final long tChargeBefore = this.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) {
- this.setCharge(aStack, tNewCharge);
- }
- return tNewCharge - tChargeBefore;
- }
-
- @Override
- public final double discharge(final ItemStack aStack, final double aCharge, final int aTier, final boolean aIgnoreTransferLimit, final boolean aBatteryAlike, final boolean aSimulate) {
- final Long[] tStats = this.getElectricStats(aStack);
- if ((tStats == null) || (tStats[2] > aTier)) {
- return 0;
- }
- if (aBatteryAlike && !this.canProvideEnergy(aStack)) {
- return 0;
- }
- if (tStats[3] > 0) {
- if ((aCharge < tStats[3]) || (aStack.stackSize < 1)) {
- return 0;
- }
- if (!aSimulate) {
- aStack.stackSize--;
- }
- return tStats[3];
- }
- final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
- if (!aSimulate) {
- this.setCharge(aStack, tNewCharge);
- }
- return tChargeBefore - tNewCharge;
- }
-
- @Override
- public final double getCharge(final ItemStack aStack) {
- return this.getRealCharge(aStack);
- }
-
- @Override
- public final boolean canUse(final ItemStack aStack, final double aAmount) {
- return this.getRealCharge(aStack) >= aAmount;
- }
-
- @Override
- public final boolean use(final ItemStack aStack, final double aAmount, final EntityLivingBase aPlayer) {
- this.chargeFromArmor(aStack, aPlayer);
- if ((aPlayer instanceof EntityPlayer) && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) {
- return true;
- }
- final double tTransfer = this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
- if (tTransfer == aAmount) {
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return true;
- }
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return false;
- }
-
- @Override
- public final void chargeFromArmor(final ItemStack aStack, final EntityLivingBase aPlayer) {
- if ((aPlayer == null) || aPlayer.worldObj.isRemote) {
- return;
- }
- for (int i = 1; i < 5; i++) {
- final ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
- if (GT_ModHandler.isElectricItem(tArmor)) {
- final IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
- if (tArmorItem.canProvideEnergy(tArmor) && (tArmorItem.getTier(tArmor) >= this.getTier(aStack))) {
- final double tCharge = ElectricItem.manager.discharge(tArmor, this.charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, true, false);
- if (tCharge > 0) {
- this.charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
- if (aPlayer instanceof EntityPlayer) {
- final Container tContainer = ((EntityPlayer) aPlayer).openContainer;
- if (tContainer != null) {
- tContainer.detectAndSendChanges();
- }
- }
- }
- }
- }
- }
- }
-
- public final long getRealCharge(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- if (tStats[3] > 0) {
- return (int) (long) tStats[3];
- }
- final NBTTagCompound tNBT = aStack.getTagCompound();
- return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
- }
-
- public final boolean setCharge(final ItemStack aStack, long aCharge) {
- final Long[] tStats = this.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(this.getChargedMetaData(aStack));
- tNBT.setLong("GT.ItemCharge", aCharge);
- } else {
- aStack.setItemDamage(this.getEmptyMetaData(aStack));
- }
- if (tNBT.hasNoTags()) {
- aStack.setTagCompound(null);
- } else {
- aStack.setTagCompound(tNBT);
- }
- this.isItemStackUsable(aStack);
- return true;
- }
-
- public short getChargedMetaData(final ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
- public short getEmptyMetaData(final ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
- @Override
- public FluidStack getFluid(final ItemStack aStack) {
- return this.getFluidContent(aStack);
- }
-
- @Override
- public int getCapacity(final ItemStack aStack) {
- final Long[] tStats = this.getFluidContainerStats(aStack);
- return tStats == null ? 0 : (int) Math.max(0, tStats[0]);
- }
-
- @Override
- public int fill(final ItemStack aStack, final FluidStack aFluid, final boolean doFill) {
- if ((aStack == null) || (aStack.stackSize != 1)) {
- return 0;
- }
-
- final 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;
- }
-
- final Long[] tStats = this.getFluidContainerStats(aStack);
- if ((tStats == null) || (tStats[0] <= 0) || (aFluid == null) || (aFluid.getFluid().getID() <= 0) || (aFluid.amount <= 0)) {
- return 0;
- }
-
- FluidStack tFluid = this.getFluidContent(aStack);
-
- if ((tFluid == null) || (tFluid.getFluid().getID() <= 0)) {
- if (aFluid.amount <= tStats[0]) {
- if (doFill) {
- this.setFluidContent(aStack, aFluid);
- }
- return aFluid.amount;
- }
- if (doFill) {
- tFluid = aFluid.copy();
- tFluid.amount = (int) (long) tStats[0];
- this.setFluidContent(aStack, tFluid);
- }
- return (int) (long) tStats[0];
- }
-
- if (!tFluid.isFluidEqual(aFluid)) {
- return 0;
- }
-
- final int space = (int) (long) tStats[0] - tFluid.amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- tFluid.amount += aFluid.amount;
- this.setFluidContent(aStack, tFluid);
- }
- return aFluid.amount;
- }
- if (doFill) {
- tFluid.amount = (int) (long) tStats[0];
- this.setFluidContent(aStack, tFluid);
- }
- return space;
- }
-
- @Override
- public FluidStack drain(final ItemStack aStack, final int maxDrain, final boolean doDrain) {
- if ((aStack == null) || (aStack.stackSize != 1)) {
- return null;
- }
-
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(aStack, false);
- if ((tFluid != null) && (maxDrain >= tFluid.amount)) {
- final 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;
- }
-
- final Long[] tStats = this.getFluidContainerStats(aStack);
- if ((tStats == null) || (tStats[0] <= 0)) {
- return null;
- }
-
- tFluid = this.getFluidContent(aStack);
- if (tFluid == null) {
- return null;
- }
-
- int used = maxDrain;
- if (tFluid.amount < used) {
- used = tFluid.amount;
- }
- if (doDrain) {
- tFluid.amount -= used;
- this.setFluidContent(aStack, tFluid);
- }
-
- final FluidStack drained = tFluid.copy();
- drained.amount = used;
- return drained;
- }
-
- public FluidStack getFluidContent(final ItemStack aStack) {
- final Long[] tStats = this.getFluidContainerStats(aStack);
- if ((tStats == null) || (tStats[0] <= 0)) {
- return GT_Utility.getFluidForFilledItem(aStack, false);
- }
- final NBTTagCompound tNBT = aStack.getTagCompound();
- return tNBT == null ? null : FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("GT.FluidContent"));
- }
-
- public void setFluidContent(final ItemStack aStack, final 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);
- }
- this.isItemStackUsable(aStack);
- }
-
- @Override
- public int getItemStackLimit(final ItemStack aStack) {
- Long[] tStats = this.getElectricStats(aStack);
- if ((tStats != null) && ((tStats[3] == -1) || (tStats[3] == -3)) && (this.getRealCharge(aStack) > 0)) {
- return 1;
- }
- tStats = this.getFluidContainerStats(aStack);
- if (tStats != null) {
- return (int) (long) tStats[1];
- }
- return 64;
- }
-
- @Override
- public final Item getChargedItem(final ItemStack itemStack) {
- return this;
- }
-
- @Override
- public final Item getEmptyItem(final ItemStack itemStack) {
- return this;
- }
-
- @Override
- public final int getTier(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
- }
-
- @Override
- public final String getToolTip(final 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(final 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(final ItemStack aStack, final ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- if (stack.getDisplayName().contains("LuV")){
- HEX_OxFFFFFF = 0xffffcc;
- }
- else if (stack.getDisplayName().contains("ZPM")){
- HEX_OxFFFFFF = 0xace600;
- }
- else if (stack.getDisplayName().contains("UV")){
- HEX_OxFFFFFF = 0xffff00;
- }
- else if (stack.getDisplayName().contains("MAX")){
- HEX_OxFFFFFF = 0xff0000;
- }
- else if (stack.getDisplayName().contains("Sodium")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(0, 0, 150);
- }
- else if (stack.getDisplayName().contains("Cadmium")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(50, 50, 60);
- }
- else if (stack.getDisplayName().contains("Lithium")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
- }
- else {
- HEX_OxFFFFFF = 0xffffff;
- }
- return HEX_OxFFFFFF;
- }
-} \ No newline at end of file
+public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item
+ implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+ private final HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>> 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 Gregtech_MetaItem_Base(final String aUnlocalized) {
+ super(aUnlocalized, "Generated Item", null, false);
+ this.setHasSubtypes(true);
+ this.setMaxDamage(0);
+ }
+
+ /**
+ * Adds a special Item Behaviour to the Item.
+ * <p/>
+ * 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 Gregtech_MetaItem_Base addItemBehavior(
+ final int aMetaValue, final Interface_ItemBehaviour<Gregtech_MetaItem_Base> aBehavior) {
+ if ((aMetaValue < 0) || (aMetaValue >= 32766) || (aBehavior == null)) {
+ return this;
+ }
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) aMetaValue);
+ if (tList == null) {
+ tList = new ArrayList<>(1);
+ this.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(final SubTag aProjectileType, final ItemStack aStack) {
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ if (tBehavior.hasProjectile(this, aProjectileType, aStack)) {
+ return true;
+ }
+ }
+ }
+ return super.hasProjectile(aProjectileType, aStack);
+ }
+
+ @Override
+ public EntityArrow getProjectile(
+ final SubTag aProjectileType,
+ final ItemStack aStack,
+ final World aWorld,
+ final double aX,
+ final double aY,
+ final double aZ) {
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ final 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(
+ final SubTag aProjectileType,
+ final ItemStack aStack,
+ final World aWorld,
+ final EntityLivingBase aEntity,
+ final float aSpeed) {
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ final 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(final IBlockSource aSource, final ItemStack aStack) {
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ if (tBehavior.canDispense(this, aSource, aStack)) {
+ return tBehavior.onDispense(this, aSource, aStack);
+ }
+ }
+ }
+ return super.onDispense(aSource, aStack);
+ }
+
+ @Override
+ public boolean isItemStackUsable(final ItemStack aStack) {
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ if (!tBehavior.isItemStackUsable(this, aStack)) {
+ return false;
+ }
+ }
+ }
+ return super.isItemStackUsable(aStack);
+ }
+
+ @Override
+ public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
+ this.use(aStack, 0, aPlayer);
+ this.isItemStackUsable(aStack);
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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 (final Throwable e) {
+ if (D1) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onItemUse(
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final World aWorld,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final int aSide,
+ final float hitX,
+ final float hitY,
+ final float hitZ) {
+ this.use(aStack, 0, aPlayer);
+ this.isItemStackUsable(aStack);
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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 (final Throwable e) {
+ if (D1) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onItemUseFirst(
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final World aWorld,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final int aSide,
+ final float hitX,
+ final float hitY,
+ final float hitZ) {
+ this.use(aStack, 0, aPlayer);
+ this.isItemStackUsable(aStack);
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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 (final Throwable e) {
+ if (D1) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
+ this.use(aStack, 0, aPlayer);
+ this.isItemStackUsable(aStack);
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ try {
+ aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
+ } catch (final Throwable e) {
+ if (D1) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ }
+ return aStack;
+ }
+
+ @Override
+ public final void addInformation(
+ final ItemStack aStack, final EntityPlayer aPlayer, List aList, final boolean aF3_H) {
+ final String tKey = this.getUnlocalizedName(aStack) + ".tooltip",
+ tString = GT_LanguageManager.getTranslation(tKey);
+ if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) {
+ aList.add(tString);
+ }
+
+ Long[] tStats = this.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 {
+ final long tCharge = this.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] < V.length ? tStats[2] : V.length - 1 : 1)]
+ + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+
+ tStats = this.getFluidContainerStats(aStack);
+ if ((tStats != null) && (tStats[0] > 0)) {
+ final FluidStack tFluid = this.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);
+ }
+
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
+ }
+ }
+
+ this.addAdditionalToolTips(aList, aStack);
+ }
+
+ @Override
+ public void onUpdate(
+ final ItemStack aStack,
+ final World aWorld,
+ final Entity aPlayer,
+ final int aTimer,
+ final boolean aIsInHand) {
+ final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList =
+ this.mItemBehaviors.get((short) this.getDamage(aStack));
+ if (tList != null) {
+ for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand);
+ }
+ }
+ }
+
+ @Override
+ public final boolean canProvideEnergy(final ItemStack aStack) {
+ final Long[] tStats = this.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(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ return Math.abs(tStats[0]);
+ }
+
+ @Override
+ public final double getTransferLimit(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ return Math.max(tStats[1], tStats[3]);
+ }
+
+ @Override
+ public final double charge(
+ final ItemStack aStack,
+ final double aCharge,
+ final int aTier,
+ final boolean aIgnoreTransferLimit,
+ final boolean aSimulate) {
+ final Long[] tStats = this.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;
+ }
+ final long tChargeBefore = this.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) {
+ this.setCharge(aStack, tNewCharge);
+ }
+ return tNewCharge - tChargeBefore;
+ }
+
+ @Override
+ public final double discharge(
+ final ItemStack aStack,
+ final double aCharge,
+ final int aTier,
+ final boolean aIgnoreTransferLimit,
+ final boolean aBatteryAlike,
+ final boolean aSimulate) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if ((tStats == null) || (tStats[2] > aTier)) {
+ return 0;
+ }
+ if (aBatteryAlike && !this.canProvideEnergy(aStack)) {
+ return 0;
+ }
+ if (tStats[3] > 0) {
+ if ((aCharge < tStats[3]) || (aStack.stackSize < 1)) {
+ return 0;
+ }
+ if (!aSimulate) {
+ aStack.stackSize--;
+ }
+ return tStats[3];
+ }
+ final long tChargeBefore = this.getRealCharge(aStack),
+ tNewCharge =
+ Math.max(
+ 0,
+ tChargeBefore
+ - (aIgnoreTransferLimit
+ ? (long) aCharge
+ : Math.min(tStats[1], (long) aCharge)));
+ if (!aSimulate) {
+ this.setCharge(aStack, tNewCharge);
+ }
+ return tChargeBefore - tNewCharge;
+ }
+
+ @Override
+ public final double getCharge(final ItemStack aStack) {
+ return this.getRealCharge(aStack);
+ }
+
+ @Override
+ public final boolean canUse(final ItemStack aStack, final double aAmount) {
+ return this.getRealCharge(aStack) >= aAmount;
+ }
+
+ @Override
+ public final boolean use(final ItemStack aStack, final double aAmount, final EntityLivingBase aPlayer) {
+ this.chargeFromArmor(aStack, aPlayer);
+ if ((aPlayer instanceof EntityPlayer) && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) {
+ return true;
+ }
+ final double tTransfer = this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
+ if (tTransfer == aAmount) {
+ this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ this.chargeFromArmor(aStack, aPlayer);
+ return true;
+ }
+ this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ this.chargeFromArmor(aStack, aPlayer);
+ return false;
+ }
+
+ @Override
+ public final void chargeFromArmor(final ItemStack aStack, final EntityLivingBase aPlayer) {
+ if ((aPlayer == null) || aPlayer.worldObj.isRemote) {
+ return;
+ }
+ for (int i = 1; i < 5; i++) {
+ final ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
+ if (GT_ModHandler.isElectricItem(tArmor)) {
+ final IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
+ if (tArmorItem.canProvideEnergy(tArmor) && (tArmorItem.getTier(tArmor) >= this.getTier(aStack))) {
+ final double tCharge = ElectricItem.manager.discharge(
+ tArmor,
+ this.charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true),
+ Integer.MAX_VALUE,
+ true,
+ true,
+ false);
+ if (tCharge > 0) {
+ this.charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
+ if (aPlayer instanceof EntityPlayer) {
+ final Container tContainer = ((EntityPlayer) aPlayer).openContainer;
+ if (tContainer != null) {
+ tContainer.detectAndSendChanges();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public final long getRealCharge(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ if (tStats[3] > 0) {
+ return (int) (long) tStats[3];
+ }
+ final NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
+ }
+
+ public final boolean setCharge(final ItemStack aStack, long aCharge) {
+ final Long[] tStats = this.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(this.getChargedMetaData(aStack));
+ tNBT.setLong("GT.ItemCharge", aCharge);
+ } else {
+ aStack.setItemDamage(this.getEmptyMetaData(aStack));
+ }
+ if (tNBT.hasNoTags()) {
+ aStack.setTagCompound(null);
+ } else {
+ aStack.setTagCompound(tNBT);
+ }
+ this.isItemStackUsable(aStack);
+ return true;
+ }
+
+ public short getChargedMetaData(final ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ public short getEmptyMetaData(final ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ @Override
+ public FluidStack getFluid(final ItemStack aStack) {
+ return this.getFluidContent(aStack);
+ }
+
+ @Override
+ public int getCapacity(final ItemStack aStack) {
+ final Long[] tStats = this.getFluidContainerStats(aStack);
+ return tStats == null ? 0 : (int) Math.max(0, tStats[0]);
+ }
+
+ @Override
+ public int fill(final ItemStack aStack, final FluidStack aFluid, final boolean doFill) {
+ if ((aStack == null) || (aStack.stackSize != 1)) {
+ return 0;
+ }
+
+ final 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;
+ }
+
+ final Long[] tStats = this.getFluidContainerStats(aStack);
+ if ((tStats == null)
+ || (tStats[0] <= 0)
+ || (aFluid == null)
+ || (aFluid.getFluid().getID() <= 0)
+ || (aFluid.amount <= 0)) {
+ return 0;
+ }
+
+ FluidStack tFluid = this.getFluidContent(aStack);
+
+ if ((tFluid == null) || (tFluid.getFluid().getID() <= 0)) {
+ if (aFluid.amount <= tStats[0]) {
+ if (doFill) {
+ this.setFluidContent(aStack, aFluid);
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ tFluid = aFluid.copy();
+ tFluid.amount = (int) (long) tStats[0];
+ this.setFluidContent(aStack, tFluid);
+ }
+ return (int) (long) tStats[0];
+ }
+
+ if (!tFluid.isFluidEqual(aFluid)) {
+ return 0;
+ }
+
+ final int space = (int) (long) tStats[0] - tFluid.amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ tFluid.amount += aFluid.amount;
+ this.setFluidContent(aStack, tFluid);
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ tFluid.amount = (int) (long) tStats[0];
+ this.setFluidContent(aStack, tFluid);
+ }
+ return space;
+ }
+
+ @Override
+ public FluidStack drain(final ItemStack aStack, final int maxDrain, final boolean doDrain) {
+ if ((aStack == null) || (aStack.stackSize != 1)) {
+ return null;
+ }
+
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(aStack, false);
+ if ((tFluid != null) && (maxDrain >= tFluid.amount)) {
+ final 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;
+ }
+
+ final Long[] tStats = this.getFluidContainerStats(aStack);
+ if ((tStats == null) || (tStats[0] <= 0)) {
+ return null;
+ }
+
+ tFluid = this.getFluidContent(aStack);
+ if (tFluid == null) {
+ return null;
+ }
+
+ int used = maxDrain;
+ if (tFluid.amount < used) {
+ used = tFluid.amount;
+ }
+ if (doDrain) {
+ tFluid.amount -= used;
+ this.setFluidContent(aStack, tFluid);
+ }
+
+ final FluidStack drained = tFluid.copy();
+ drained.amount = used;
+ return drained;
+ }
+
+ public FluidStack getFluidContent(final ItemStack aStack) {
+ final Long[] tStats = this.getFluidContainerStats(aStack);
+ if ((tStats == null) || (tStats[0] <= 0)) {
+ return GT_Utility.getFluidForFilledItem(aStack, false);
+ }
+ final NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? null : FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("GT.FluidContent"));
+ }
+
+ public void setFluidContent(final ItemStack aStack, final 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);
+ }
+ this.isItemStackUsable(aStack);
+ }
+
+ @Override
+ public int getItemStackLimit(final ItemStack aStack) {
+ Long[] tStats = this.getElectricStats(aStack);
+ if ((tStats != null) && ((tStats[3] == -1) || (tStats[3] == -3)) && (this.getRealCharge(aStack) > 0)) {
+ return 1;
+ }
+ tStats = this.getFluidContainerStats(aStack);
+ if (tStats != null) {
+ return (int) (long) tStats[1];
+ }
+ return 64;
+ }
+
+ @Override
+ public final Item getChargedItem(final ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final Item getEmptyItem(final ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final int getTier(final ItemStack aStack) {
+ final Long[] tStats = this.getElectricStats(aStack);
+ return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
+ }
+
+ @Override
+ public final String getToolTip(final 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(final 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(final ItemStack aStack, final ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
+ return false;
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")) {
+ HEX_OxFFFFFF = 0xffffcc;
+ } else if (stack.getDisplayName().contains("ZPM")) {
+ HEX_OxFFFFFF = 0xace600;
+ } else if (stack.getDisplayName().contains("UV")) {
+ HEX_OxFFFFFF = 0xffff00;
+ } else if (stack.getDisplayName().contains("MAX")) {
+ HEX_OxFFFFFF = 0xff0000;
+ } else if (stack.getDisplayName().contains("Sodium")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(0, 0, 150);
+ } else if (stack.getDisplayName().contains("Cadmium")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(50, 50, 60);
+ } else if (stack.getDisplayName().contains("Lithium")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
+ } else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
index a5430846a9..a7f7cae271 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
@@ -1,16 +1,7 @@
package gtPlusPlus.xmod.gregtech.api.items;
-import java.util.Arrays;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
@@ -19,9 +10,14 @@ import gregtech.api.interfaces.IIconContainer;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
+import java.util.Arrays;
+import java.util.List;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
/**
* @author Gregorius Techneticies
@@ -37,207 +33,214 @@ import gtPlusPlus.core.util.math.MathUtils;
*/
public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem {
- protected final OrePrefixes[] mGeneratedPrefixList;
-
- /**
- * 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 Gregtech_MetaItem_X32(final String aUnlocalized, final OrePrefixes... aGeneratedPrefixList) {
- super(aUnlocalized, (short) 32000, (short) 766);
- this.mGeneratedPrefixList = Arrays.copyOf(aGeneratedPrefixList, 32);
-
- for (int i = 0; i < 32000; i++) {
- final OrePrefixes tPrefix = this.mGeneratedPrefixList[i / 1000];
- if (tPrefix == null) {
- continue;
- }
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
- if (tMaterial == null) {
- continue;
- }
- if (this.doesMaterialAllowGeneration(tPrefix, tMaterial)) {
- final ItemStack tStack = new ItemStack(this, 1, i);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(tPrefix, tMaterial, i));
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / GT_Values.M));
- if (tPrefix.mIsUnificatable) {
- GT_OreDictUnificator.set(tPrefix, tMaterial, tStack);
- } else {
- GT_OreDictUnificator.registerOre(tPrefix.get(tMaterial), tStack);
- }
- if (((tPrefix == OrePrefixes.stick) || (tPrefix == OrePrefixes.wireFine)) && ((tMaterial == Materials.Lead) || (tMaterial == Materials.Tin) || (tMaterial == Materials.SolderingAlloy))) {
- GregTech_API.sSolderingMetalList.add(tStack);
- }
- }
- }
- }
-
- /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
-
- /**
- * @return the Color Modulation the Material is going to be rendered with.
- */
- @Override
- public short[] getRGBa(final ItemStack aStack) {
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[this.getDamage(aStack) % 1000];
- return tMaterial == null ? Materials._NULL.mRGBa : tMaterial.mRGBa;
- }
-
- /**
- * @param aPrefix this can be null, you have to return false in that case
- * @param aMaterial this can be null, you have to return false in that case
- * @return if this Item should be generated and visible.
- */
- public boolean doesMaterialAllowGeneration(final OrePrefixes aPrefix, final Materials aMaterial) {
- // You have to check for at least these Conditions in every Case! So add a super Call like the following for this before executing your Code:
- // if (!super.doesMaterialAllowGeneration(aPrefix, aMaterial)) return false;
- return (aPrefix != null) && (aMaterial != null) && aPrefix.doGenerateItem(aMaterial);
- }
-
- /* ---------- 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(final OrePrefixes aPrefix, final Materials aMaterial, final int aMetaData) {
- return aPrefix.getDefaultLocalNameForItem(aMaterial);
- }
-
- /**
- * @param aMetaData a Index from [0 - 31999]
- * @param aMaterial the Material
- * @return an Icon Container for the Item Display.
- */
- public final IIconContainer getIconContainer(final int aMetaData, final Materials aMaterial) {
- return (this.mGeneratedPrefixList[aMetaData / 1000] != null) && (this.mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0) ? aMaterial.mIconSet.mTextures[this.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(final OrePrefixes aPrefix, final Materials aMaterial, final boolean aDoShowAllItems) {
- return true;
- }
-
- /* ---------- INTERNAL OVERRIDES ---------- */
-
- @Override
- public ItemStack getContainerItem(final ItemStack aStack) {
- final int aDamage = aStack.getItemDamage();
- if ((aDamage < 32000) && (aDamage >= 0)) {
- final Materials aMaterial = GregTech_API.sGeneratedMaterials[aDamage % 1000];
- if ((aMaterial != null) && (aMaterial != Materials.Empty) && (aMaterial != Materials._NULL)) {
- final OrePrefixes aPrefix = this.mGeneratedPrefixList[aDamage / 1000];
- if (aPrefix != null) {
- return GT_Utility.copyAmount(1, aPrefix.mContainerItem);
- }
- }
- }
- return null;
- }
-
- @Override
- public final IIconContainer getIconContainer(final int aMetaData) {
- return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null : this.getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
- for (int i = 0; i < 32000; i++) {
- if (this.doesMaterialAllowGeneration(this.mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000]) && this.doesShowInCreative(this.mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000], GregTech_API.sDoShowAllItemsInCreative)) {
- final ItemStack tStack = new ItemStack(this, 1, i);
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- }
- super.getSubItems(var1, aCreativeTab, aList);
- }
-
- @Override
- public final IIcon getIconFromDamage(final int aMetaData) {
- if (aMetaData < 0) {
- return null;
- }
- if (aMetaData < 32000) {
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData % 1000];
- if (tMaterial == null) {
- return null;
- }
- final IIconContainer tIcon = this.getIconContainer(aMetaData, tMaterial);
- if (tIcon != null) {
- return tIcon.getIcon();
- }
- return null;
- }
- return (aMetaData - 32000) < this.mIconList.length ? this.mIconList[aMetaData - 32000][0] : null;
- }
-
- @Override
- public int getItemStackLimit(final ItemStack aStack) {
- final int tDamage = this.getDamage(aStack);
- if ((tDamage < 32000) && (this.mGeneratedPrefixList[tDamage / 1000] != null)) {
- return Math.min(super.getItemStackLimit(aStack), this.mGeneratedPrefixList[tDamage / 1000].mDefaultStackSize);
- }
- return super.getItemStackLimit(aStack);
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
-
- int aMeta = stack.getItemDamage();
- if (stack.getDisplayName().contains("Sodium")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(90, 90, 255);
- }
- else if (stack.getDisplayName().contains("Cadmium")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(150, 150, 80);
- }
- else if (stack.getDisplayName().contains("Lithium")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
- }
- else if (stack.getDisplayName().contains("Wrought")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 180, 180);
- }
- else if (stack.getDisplayName().contains("Bronze")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(255, 128, 0);
- }
- else if (stack.getDisplayName().contains("Brass")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(255, 180, 0);
- }
- else if (stack.getDisplayName().contains("Invar")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(180, 180, 120);
- }
- else {
- if (aMeta > 50 && aMeta != 150) {
- HEX_OxFFFFFF = 0xffffff;
- }
- else if (stack.getDisplayName().contains("ULV")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 180, 180);
- }
- else if (stack.getDisplayName().contains("LuV")){
- HEX_OxFFFFFF = 0xffffcc;
- }
- else if (stack.getDisplayName().contains("ZPM")){
- HEX_OxFFFFFF = 0xffe600;
- }
- else if (stack.getDisplayName().contains("UV")){
- HEX_OxFFFFFF = 0xffb300;
- }
- else if (stack.getDisplayName().contains("MAX")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(MathUtils.randInt(220, 250), MathUtils.randInt(221, 251), MathUtils.randInt(220, 250));
- }
- else {
- HEX_OxFFFFFF = 0xffffff;
- }
- }
- return HEX_OxFFFFFF;
- }
-} \ No newline at end of file
+ protected final OrePrefixes[] mGeneratedPrefixList;
+
+ /**
+ * 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 Gregtech_MetaItem_X32(final String aUnlocalized, final OrePrefixes... aGeneratedPrefixList) {
+ super(aUnlocalized, (short) 32000, (short) 766);
+ this.mGeneratedPrefixList = Arrays.copyOf(aGeneratedPrefixList, 32);
+
+ for (int i = 0; i < 32000; i++) {
+ final OrePrefixes tPrefix = this.mGeneratedPrefixList[i / 1000];
+ if (tPrefix == null) {
+ continue;
+ }
+ final Materials tMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
+ if (tMaterial == null) {
+ continue;
+ }
+ if (this.doesMaterialAllowGeneration(tPrefix, tMaterial)) {
+ final ItemStack tStack = new ItemStack(this, 1, i);
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(tPrefix, tMaterial, i));
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName(tStack) + ".tooltip",
+ tMaterial.getToolTip(tPrefix.mMaterialAmount / GT_Values.M));
+ if (tPrefix.mIsUnificatable) {
+ GT_OreDictUnificator.set(tPrefix, tMaterial, tStack);
+ } else {
+ GT_OreDictUnificator.registerOre(tPrefix.get(tMaterial), tStack);
+ }
+ if (((tPrefix == OrePrefixes.stick) || (tPrefix == OrePrefixes.wireFine))
+ && ((tMaterial == Materials.Lead)
+ || (tMaterial == Materials.Tin)
+ || (tMaterial == Materials.SolderingAlloy))) {
+ GregTech_API.sSolderingMetalList.add(tStack);
+ }
+ }
+ }
+ }
+
+ /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
+
+ /**
+ * @return the Color Modulation the Material is going to be rendered with.
+ */
+ @Override
+ public short[] getRGBa(final ItemStack aStack) {
+ final Materials tMaterial = GregTech_API.sGeneratedMaterials[this.getDamage(aStack) % 1000];
+ return tMaterial == null ? Materials._NULL.mRGBa : tMaterial.mRGBa;
+ }
+
+ /**
+ * @param aPrefix this can be null, you have to return false in that case
+ * @param aMaterial this can be null, you have to return false in that case
+ * @return if this Item should be generated and visible.
+ */
+ public boolean doesMaterialAllowGeneration(final OrePrefixes aPrefix, final Materials aMaterial) {
+ // You have to check for at least these Conditions in every Case! So add a super Call like the following for
+ // this before executing your Code:
+ // if (!super.doesMaterialAllowGeneration(aPrefix, aMaterial)) return false;
+ return (aPrefix != null) && (aMaterial != null) && aPrefix.doGenerateItem(aMaterial);
+ }
+
+ /* ---------- 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(final OrePrefixes aPrefix, final Materials aMaterial, final int aMetaData) {
+ return aPrefix.getDefaultLocalNameForItem(aMaterial);
+ }
+
+ /**
+ * @param aMetaData a Index from [0 - 31999]
+ * @param aMaterial the Material
+ * @return an Icon Container for the Item Display.
+ */
+ public final IIconContainer getIconContainer(final int aMetaData, final Materials aMaterial) {
+ return (this.mGeneratedPrefixList[aMetaData / 1000] != null)
+ && (this.mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0)
+ ? aMaterial.mIconSet.mTextures[this.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(
+ final OrePrefixes aPrefix, final Materials aMaterial, final boolean aDoShowAllItems) {
+ return true;
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ @Override
+ public ItemStack getContainerItem(final ItemStack aStack) {
+ final int aDamage = aStack.getItemDamage();
+ if ((aDamage < 32000) && (aDamage >= 0)) {
+ final Materials aMaterial = GregTech_API.sGeneratedMaterials[aDamage % 1000];
+ if ((aMaterial != null) && (aMaterial != Materials.Empty) && (aMaterial != Materials._NULL)) {
+ final OrePrefixes aPrefix = this.mGeneratedPrefixList[aDamage / 1000];
+ if (aPrefix != null) {
+ return GT_Utility.copyAmount(1, aPrefix.mContainerItem);
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public final IIconContainer getIconContainer(final int aMetaData) {
+ return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null
+ ? null
+ : this.getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
+ for (int i = 0; i < 32000; i++) {
+ if (this.doesMaterialAllowGeneration(
+ this.mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000])
+ && this.doesShowInCreative(
+ this.mGeneratedPrefixList[i / 1000],
+ GregTech_API.sGeneratedMaterials[i % 1000],
+ GregTech_API.sDoShowAllItemsInCreative)) {
+ final ItemStack tStack = new ItemStack(this, 1, i);
+ this.isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ }
+ super.getSubItems(var1, aCreativeTab, aList);
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(final int aMetaData) {
+ if (aMetaData < 0) {
+ return null;
+ }
+ if (aMetaData < 32000) {
+ final Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData % 1000];
+ if (tMaterial == null) {
+ return null;
+ }
+ final IIconContainer tIcon = this.getIconContainer(aMetaData, tMaterial);
+ if (tIcon != null) {
+ return tIcon.getIcon();
+ }
+ return null;
+ }
+ return (aMetaData - 32000) < this.mIconList.length ? this.mIconList[aMetaData - 32000][0] : null;
+ }
+
+ @Override
+ public int getItemStackLimit(final ItemStack aStack) {
+ final int tDamage = this.getDamage(aStack);
+ if ((tDamage < 32000) && (this.mGeneratedPrefixList[tDamage / 1000] != null)) {
+ return Math.min(
+ super.getItemStackLimit(aStack), this.mGeneratedPrefixList[tDamage / 1000].mDefaultStackSize);
+ }
+ return super.getItemStackLimit(aStack);
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
+
+ int aMeta = stack.getItemDamage();
+ if (stack.getDisplayName().contains("Sodium")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(90, 90, 255);
+ } else if (stack.getDisplayName().contains("Cadmium")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(150, 150, 80);
+ } else if (stack.getDisplayName().contains("Lithium")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
+ } else if (stack.getDisplayName().contains("Wrought")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 180, 180);
+ } else if (stack.getDisplayName().contains("Bronze")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(255, 128, 0);
+ } else if (stack.getDisplayName().contains("Brass")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(255, 180, 0);
+ } else if (stack.getDisplayName().contains("Invar")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(180, 180, 120);
+ } else {
+ if (aMeta > 50 && aMeta != 150) {
+ HEX_OxFFFFFF = 0xffffff;
+ } else if (stack.getDisplayName().contains("ULV")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 180, 180);
+ } else if (stack.getDisplayName().contains("LuV")) {
+ HEX_OxFFFFFF = 0xffffcc;
+ } else if (stack.getDisplayName().contains("ZPM")) {
+ HEX_OxFFFFFF = 0xffe600;
+ } else if (stack.getDisplayName().contains("UV")) {
+ HEX_OxFFFFFF = 0xffb300;
+ } else if (stack.getDisplayName().contains("MAX")) {
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(
+ MathUtils.randInt(220, 250), MathUtils.randInt(221, 251), MathUtils.randInt(220, 250));
+ } else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ }
+ return HEX_OxFFFFFF;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java
index ae84afb056..7cb79a4ad6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java
@@ -1,12 +1,21 @@
package gtPlusPlus.xmod.gregtech.api.items;
+import buildcraft.api.tools.IToolWrench;
+import cpw.mods.fml.common.Optional;
+import gregtech.api.enchants.Enchantment_Radioactivity;
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.IDamagableItem;
+import gregtech.api.interfaces.IToolStats;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
-
-import cpw.mods.fml.common.Optional;
-
+import mods.railcraft.api.core.items.IToolCrowbar;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -23,481 +32,637 @@ import net.minecraft.stats.StatList;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
-
-import gregtech.api.enchants.Enchantment_Radioactivity;
-import gregtech.api.enums.Materials;
-import gregtech.api.interfaces.IDamagableItem;
-import gregtech.api.interfaces.IToolStats;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-
-import buildcraft.api.tools.IToolWrench;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
-import mods.railcraft.api.core.items.IToolCrowbar;
import net.minecraftforge.event.world.BlockEvent;
/**
* This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench:
* GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(16, 1, Materials.Bismuth, Materials.Bismuth, null);
*/
-@Optional.InterfaceList({@Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = "Forestry"),
- @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = "Railcraft"),
- @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft"),
- @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO")})
-public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool implements IDamagableItem, IToolCrowbar, IToolWrench {
- /**
- * 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.
- * <p/>
- * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
- */
- public static final HashMap<String, Gregtech_MetaTool> sInstances = new HashMap<>();
-
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
-
- public final HashMap<Short, IToolStats> mToolStats = new HashMap<>();
-
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized The Unlocalized Name of this Item.
- */
- public Gregtech_MetaTool(final String aUnlocalized) {
- super(aUnlocalized);
- GT_ModHandler.registerBoxableItemToToolBox(this);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setMaxStackSize(1);
- sInstances.put(this.getUnlocalizedName(), this);
- }
-
- /**
- * Called by the Block Harvesting Event within the GT_Proxy
- */
- @Override
- public void onHarvestBlockEvent(final ArrayList<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (this.isItemStackUsable(aStack) && (this.getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)) {
- this.doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion());
- }
- }
-
- @Override
- public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
- final IToolStats tStats = this.getToolStats(aStack);
- if ((tStats == null) || !this.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)) {
- final float tMagicDamage = tStats.getMagicDamageAgainstEntity(aEntity instanceof EntityLivingBase ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) : 0.0F, aEntity, aStack, aPlayer);
- float tDamage = tStats.getNormalDamageAgainstEntity((float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + this.getToolCombatDamage(aStack), aEntity, aStack, aPlayer);
- if ((tDamage + tMagicDamage) > 0.0F) {
- final 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);
- }
- final 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);
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
- }
- if (aStack.stackSize <= 0) {
- aPlayer.destroyCurrentEquippedItem();
- }
- return true;
- }
-
- @Override
- public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IToolStats tStats = this.getToolStats(aStack);
- if ((tStats != null) && tStats.canBlock()) {
- aPlayer.setItemInUse(aStack, 72000);
- }
- return super.onItemRightClick(aStack, aWorld, aPlayer);
- }
-
-
- @SuppressWarnings("unchecked")
- public void addAdditionalToolTips(final List aList, final ItemStack aStack) {
- final long tMaxDamage = getToolMaxDamage(aStack);
- final Materials tMaterial = getPrimaryMaterial(aStack);
- final IToolStats tStats = this.getToolStats(aStack);
- final int tOffset = this.getElectricStats(aStack) != null ? 2 : 1;
- if (tStats != null) {
- final 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 " + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE + (50.0F + (10.0F * this.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");
- aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 25) + EnumChatFormatting.GRAY + "EU/t");
- aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "EU/t");
-
- } 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 " + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE + this.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);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- public void addAdditionalToolTips(final List aList, final ItemStack aStack, final EntityPlayer aPlayer) {
- final long tMaxDamage = getToolMaxDamage(aStack);
- final Materials tMaterial = getPrimaryMaterial(aStack);
- final IToolStats tStats = this.getToolStats(aStack);
- final int tOffset = this.getElectricStats(aStack) != null ? 2 : 1;
- if (tStats != null) {
- final 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 " + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE + (50.0F + (10.0F * this.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");
- aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 50) + EnumChatFormatting.GRAY + "EU/t");
- aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "EU/t");
-
- } 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 " + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE + this.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);
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if ((aNBT != null) && aNBT.hasKey("Heat")){
- int tHeat = aNBT.getInteger("Heat");
- final long tWorldTime = aPlayer.getEntityWorld().getWorldTime();
- if(aNBT.hasKey("HeatTime")){
- final long tHeatTime = aNBT.getLong("HeatTime");
- if(tWorldTime>(tHeatTime+10)){
- tHeat = (int) (tHeat - ((tWorldTime-tHeatTime)/10));
- if((tHeat<300)&&(tHeat>-10000)) {
- tHeat=300;
- }
- }
- aNBT.setLong("HeatTime", tWorldTime);
- if(tHeat>-10000) {
- aNBT.setInteger("Heat", tHeat);
- }
- }
-
- aList.add(tOffset + 3, EnumChatFormatting.RED + "Heat: " + aNBT.getInteger("Heat")+" K" + EnumChatFormatting.GRAY);
- }
- }
- }
- }
- }
-
- @Override
- public Long[] getFluidContainerStats(final ItemStack aStack) {
- return null;
- }
-
- @Override
- public Long[] getElectricStats(final 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 new Long[] {};
- }
-
- @Override
- public float getToolCombatDamage(final ItemStack aStack) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
- }
-
- @Override
- public float getDigSpeed(final ItemStack aStack, final Block aBlock, final int aMetaData) {
- if (!this.isItemStackUsable(aStack)) {
- return 0.0F;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- if ((tStats == null) || (Math.max(0, this.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 boolean onBlockDestroyed(final ItemStack aStack, final World aWorld, final Block aBlock, final int aX, final int aY, final int aZ, final EntityLivingBase aPlayer) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return false;
- }
- GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F);
- this.doDamage(aStack, (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
- return this.getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
- }
-
- private ItemStack getContainerItem(ItemStack aStack, final boolean playSound) {
- if (!this.isItemStackUsable(aStack)) {
- return null;
- }
- aStack = GT_Utility.copyAmount(1, aStack);
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return null;
- }
- this.doDamage(aStack, tStats.getToolDamagePerContainerCraft());
- aStack = aStack.stackSize > 0 ? aStack : null;
- if (playSound) {
- //String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
- //GT_Utility.doSoundAtClient(sound, 1, 1.0F);
- }
- return aStack;
- }
-
- @Override
- public Interface_ToolStats getToolStats(final ItemStack aStack) {
- this.isItemStackUsable(aStack);
- return this.getToolStatsInternal(aStack);
- }
-
- private Interface_ToolStats getToolStatsInternal(final ItemStack aStack) {
- return (Interface_ToolStats) (aStack == null ? null : this.mToolStats.get((short) aStack.getItemDamage()));
- }
-
- @Override
- public boolean canWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- return (tStats != null) && tStats.isCrowbar();
- }
-
- @Override
- public void onWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
-
- @Override
- public boolean canWrench(final EntityPlayer player, final int x, final int y, final int z) {
- //System.out.println("canWrench");
- if(player==null) {
- return false;
- }
- if(player.getCurrentEquippedItem()==null) {
- return false;
- }
- if (!this.isItemStackUsable(player.getCurrentEquippedItem())) {
- return false;
- }
- final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- return (tStats != null) && tStats.isWrench();
- }
-
- @Override
- public void wrenchUsed(final EntityPlayer player, final int x, final int y, final int z) {
- if(player==null) {
- return;
- }
- if(player.getCurrentEquippedItem()==null) {
- return;
- }
- final IToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- if (tStats != null) {
- this.doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
- }
- }
-
- @Override
- public boolean canLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- return (tStats != null) && tStats.isCrowbar();
- }
-
- @Override
- public void onLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
-
- @Override
- public boolean canBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- return (tStats != null) && tStats.isCrowbar();
- }
-
- @Override
- public void onBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
-
- @Override
- public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IToolStats tStats = this.getToolStats(aStack);
- if ((tStats != null) && (aPlayer != null)) {
- tStats.onToolCrafted(aStack, aPlayer);
- }
- super.onCreated(aStack, aWorld, aPlayer);
- }
-
- @Override
- public boolean isFull3D() {
- return true;
- }
-
- @Override
- public boolean isItemStackUsable(final ItemStack aStack) {
- final IToolStats tStats = this.getToolStatsInternal(aStack);
- if (((aStack.getItemDamage() % 2) == 1) || (tStats == null)) {
- final NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT.removeTag("ench");
- }
- return false;
- }
- final Materials aMaterial = getPrimaryMaterial(aStack);
- final HashMap<Integer, Integer> 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);
- }
- }
- final Enchantment[] tEnchants = tStats.getEnchantments(aStack);
- final int[] tLevels = tStats.getEnchantmentLevels(aStack);
- for (int i = 0; i < tEnchants.length; i++) {
- if (tLevels[i] > 0) {
- final 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 (final Entry<Integer, Integer> tEntry : tMap.entrySet()) {
- if ((tEntry.getKey() == 33) || ((tEntry.getKey() == 20) && (tEntry.getValue() > 2)) || (tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)) {
- 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(final ItemStack aStack) {
- return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
- }
-
- @Override
- public short getEmptyMetaData(final ItemStack aStack) {
- final 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(final ItemStack aStack, final ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
- }
-} \ No newline at end of file
+@Optional.InterfaceList({
+ @Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = "Forestry"),
+ @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = "Railcraft"),
+ @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft"),
+ @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO")
+})
+public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool
+ implements IDamagableItem, IToolCrowbar, IToolWrench {
+ /**
+ * 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.
+ * <p/>
+ * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
+ */
+ public static final HashMap<String, Gregtech_MetaTool> sInstances = new HashMap<>();
+
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+
+ public final HashMap<Short, IToolStats> mToolStats = new HashMap<>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public Gregtech_MetaTool(final String aUnlocalized) {
+ super(aUnlocalized);
+ GT_ModHandler.registerBoxableItemToToolBox(this);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setMaxStackSize(1);
+ sInstances.put(this.getUnlocalizedName(), this);
+ }
+
+ /**
+ * Called by the Block Harvesting Event within the GT_Proxy
+ */
+ @Override
+ public void onHarvestBlockEvent(
+ final ArrayList<ItemStack> aDrops,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final Block aBlock,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final byte aMetaData,
+ final int aFortune,
+ final boolean aSilkTouch,
+ final BlockEvent.HarvestDropsEvent aEvent) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (this.isItemStackUsable(aStack) && (this.getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)) {
+ this.doDamage(
+ aStack,
+ tStats.convertBlockDrops(
+ aDrops,
+ aStack,
+ aPlayer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ aMetaData,
+ aFortune,
+ aSilkTouch,
+ aEvent)
+ * tStats.getToolDamagePerDropConversion());
+ }
+ }
+
+ @Override
+ public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if ((tStats == null) || !this.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)) {
+ final float tMagicDamage = tStats.getMagicDamageAgainstEntity(
+ aEntity instanceof EntityLivingBase
+ ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity)
+ : 0.0F,
+ aEntity,
+ aStack,
+ aPlayer);
+ float tDamage = tStats.getNormalDamageAgainstEntity(
+ (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage)
+ .getAttributeValue()
+ + this.getToolCombatDamage(aStack),
+ aEntity,
+ aStack,
+ aPlayer);
+ if ((tDamage + tMagicDamage) > 0.0F) {
+ final 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);
+ }
+ final 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);
+ this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+ }
+ if (aStack.stackSize <= 0) {
+ aPlayer.destroyCurrentEquippedItem();
+ }
+ return true;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if ((tStats != null) && tStats.canBlock()) {
+ aPlayer.setItemInUse(aStack, 72000);
+ }
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void addAdditionalToolTips(final List aList, final ItemStack aStack) {
+ final long tMaxDamage = getToolMaxDamage(aStack);
+ final Materials tMaterial = getPrimaryMaterial(aStack);
+ final IToolStats tStats = this.getToolStats(aStack);
+ final int tOffset = this.getElectricStats(aStack) != null ? 2 : 1;
+ if (tStats != null) {
+ final 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 "
+ + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(
+ tOffset + 2,
+ EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE
+ + (50.0F + (10.0F * this.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");
+ aList.add(
+ tOffset + 3,
+ EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): "
+ + EnumChatFormatting.LIGHT_PURPLE
+ + Math.max(
+ Float.MIN_NORMAL,
+ tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 25)
+ + EnumChatFormatting.GRAY + "EU/t");
+ aList.add(
+ tOffset + 3,
+ EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): "
+ + EnumChatFormatting.LIGHT_PURPLE
+ + Math.max(
+ Float.MIN_NORMAL,
+ tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000)
+ + EnumChatFormatting.GRAY + "EU/t");
+
+ } 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 "
+ + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(
+ tOffset + 2,
+ EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE
+ + this.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);
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void addAdditionalToolTips(final List aList, final ItemStack aStack, final EntityPlayer aPlayer) {
+ final long tMaxDamage = getToolMaxDamage(aStack);
+ final Materials tMaterial = getPrimaryMaterial(aStack);
+ final IToolStats tStats = this.getToolStats(aStack);
+ final int tOffset = this.getElectricStats(aStack) != null ? 2 : 1;
+ if (tStats != null) {
+ final 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 "
+ + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(
+ tOffset + 2,
+ EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE
+ + (50.0F + (10.0F * this.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");
+ aList.add(
+ tOffset + 3,
+ EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): "
+ + EnumChatFormatting.LIGHT_PURPLE
+ + Math.max(
+ Float.MIN_NORMAL,
+ tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 50)
+ + EnumChatFormatting.GRAY + "EU/t");
+ aList.add(
+ tOffset + 3,
+ EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): "
+ + EnumChatFormatting.LIGHT_PURPLE
+ + Math.max(
+ Float.MIN_NORMAL,
+ tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000)
+ + EnumChatFormatting.GRAY + "EU/t");
+
+ } 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 "
+ + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(
+ tOffset + 2,
+ EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE
+ + this.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);
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if ((aNBT != null) && aNBT.hasKey("Heat")) {
+ int tHeat = aNBT.getInteger("Heat");
+ final long tWorldTime = aPlayer.getEntityWorld().getWorldTime();
+ if (aNBT.hasKey("HeatTime")) {
+ final long tHeatTime = aNBT.getLong("HeatTime");
+ if (tWorldTime > (tHeatTime + 10)) {
+ tHeat = (int) (tHeat - ((tWorldTime - tHeatTime) / 10));
+ if ((tHeat < 300) && (tHeat > -10000)) {
+ tHeat = 300;
+ }
+ }
+ aNBT.setLong("HeatTime", tWorldTime);
+ if (tHeat > -10000) {
+ aNBT.setInteger("Heat", tHeat);
+ }
+ }
+
+ aList.add(
+ tOffset + 3,
+ EnumChatFormatting.RED + "Heat: " + aNBT.getInteger("Heat") + " K"
+ + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public Long[] getFluidContainerStats(final ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public Long[] getElectricStats(final 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 new Long[] {};
+ }
+
+ @Override
+ public float getToolCombatDamage(final ItemStack aStack) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
+ }
+
+ @Override
+ public float getDigSpeed(final ItemStack aStack, final Block aBlock, final int aMetaData) {
+ if (!this.isItemStackUsable(aStack)) {
+ return 0.0F;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ if ((tStats == null) || (Math.max(0, this.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 boolean onBlockDestroyed(
+ final ItemStack aStack,
+ final World aWorld,
+ final Block aBlock,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final EntityLivingBase aPlayer) {
+ if (!this.isItemStackUsable(aStack)) {
+ return false;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats == null) {
+ return false;
+ }
+ GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F);
+ this.doDamage(aStack, (int)
+ Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
+ return this.getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
+ }
+
+ private ItemStack getContainerItem(ItemStack aStack, final boolean playSound) {
+ if (!this.isItemStackUsable(aStack)) {
+ return null;
+ }
+ aStack = GT_Utility.copyAmount(1, aStack);
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats == null) {
+ return null;
+ }
+ this.doDamage(aStack, tStats.getToolDamagePerContainerCraft());
+ aStack = aStack.stackSize > 0 ? aStack : null;
+ if (playSound) {
+ // String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
+ // GT_Utility.doSoundAtClient(sound, 1, 1.0F);
+ }
+ return aStack;
+ }
+
+ @Override
+ public Interface_ToolStats getToolStats(final ItemStack aStack) {
+ this.isItemStackUsable(aStack);
+ return this.getToolStatsInternal(aStack);
+ }
+
+ private Interface_ToolStats getToolStatsInternal(final ItemStack aStack) {
+ return (Interface_ToolStats) (aStack == null ? null : this.mToolStats.get((short) aStack.getItemDamage()));
+ }
+
+ @Override
+ public boolean canWhack(
+ final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
+ if (!this.isItemStackUsable(aStack)) {
+ return false;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ return (tStats != null) && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats != null) {
+ this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+
+ @Override
+ public boolean canWrench(final EntityPlayer player, final int x, final int y, final int z) {
+ // System.out.println("canWrench");
+ if (player == null) {
+ return false;
+ }
+ if (player.getCurrentEquippedItem() == null) {
+ return false;
+ }
+ if (!this.isItemStackUsable(player.getCurrentEquippedItem())) {
+ return false;
+ }
+ final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
+ return (tStats != null) && tStats.isWrench();
+ }
+
+ @Override
+ public void wrenchUsed(final EntityPlayer player, final int x, final int y, final int z) {
+ if (player == null) {
+ return;
+ }
+ if (player.getCurrentEquippedItem() == null) {
+ return;
+ }
+ final IToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
+ if (tStats != null) {
+ this.doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
+ }
+ }
+
+ @Override
+ public boolean canLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
+ if (!this.isItemStackUsable(aStack)) {
+ return false;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ return (tStats != null) && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats != null) {
+ this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+
+ @Override
+ public boolean canBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
+ if (!this.isItemStackUsable(aStack)) {
+ return false;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ return (tStats != null) && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats != null) {
+ this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+
+ @Override
+ public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if ((tStats != null) && (aPlayer != null)) {
+ tStats.onToolCrafted(aStack, aPlayer);
+ }
+ super.onCreated(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public boolean isFull3D() {
+ return true;
+ }
+
+ @Override
+ public boolean isItemStackUsable(final ItemStack aStack) {
+ final IToolStats tStats = this.getToolStatsInternal(aStack);
+ if (((aStack.getItemDamage() % 2) == 1) || (tStats == null)) {
+ final NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT.removeTag("ench");
+ }
+ return false;
+ }
+ final Materials aMaterial = getPrimaryMaterial(aStack);
+ final HashMap<Integer, Integer> 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);
+ }
+ }
+ final Enchantment[] tEnchants = tStats.getEnchantments(aStack);
+ final int[] tLevels = tStats.getEnchantmentLevels(aStack);
+ for (int i = 0; i < tEnchants.length; i++) {
+ if (tLevels[i] > 0) {
+ final 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 (final Entry<Integer, Integer> tEntry : tMap.entrySet()) {
+ if ((tEntry.getKey() == 33)
+ || ((tEntry.getKey() == 20) && (tEntry.getValue() > 2))
+ || (tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)) {
+ 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(final ItemStack aStack) {
+ return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
+ }
+
+ @Override
+ public short getEmptyMetaData(final ItemStack aStack) {
+ final 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(final ItemStack aStack, final ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java
index 6f4202fdd8..c9f337d47b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java
@@ -1,10 +1,17 @@
package gtPlusPlus.xmod.gregtech.api.items.tools;
+import gregtech.api.GregTech_API;
+import gregtech.api.enchants.Enchantment_Radioactivity;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.interfaces.IToolStats;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.api.util.*;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
-
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -20,16 +27,6 @@ import net.minecraft.stats.AchievementList;
import net.minecraft.stats.StatList;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enchants.Enchantment_Radioactivity;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.TC_Aspects.TC_AspectStack;
-import gregtech.api.interfaces.IToolStats;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.*;
-
-import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
import net.minecraftforge.event.world.BlockEvent;
/**
@@ -37,510 +34,601 @@ import net.minecraftforge.event.world.BlockEvent;
* GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(16, 1, Materials.Bismuth, Materials.Bismuth, null);
*/
public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool {
- /**
- * 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.
- * <p/>
- * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
- */
- public static final HashMap<String, GT_MetaGenTool> sInstances = new HashMap<>();
-
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
-
- public final HashMap<Short, IToolStats> mToolStats = new HashMap<>();
-
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized The Unlocalized Name of this Item.
- */
- public GT_MetaGenTool(final String aUnlocalized) {
- super(aUnlocalized);
- GT_ModHandler.registerBoxableItemToToolBox(this);
- this.setCreativeTab(GregTech_API.TAB_GREGTECH);
- this.setMaxStackSize(1);
- sInstances.put(this.getUnlocalizedName(), this);
- }
-
- /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */
-
- public static final Materials getPrimaryMaterialEx(final 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 getSecondaryMaterialEx(final 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;
- }
-
- /**
- * 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 addToolEx(final int aID, final String aEnglish, String aToolTip, final IToolStats aToolStats, final Object... aOreDictNamesAndAspects) {
- if (aToolTip == null) {
- aToolTip = "";
- }
- if ((aID >= 0) && (aID < 32766) && ((aID % 2) == 0)) {
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + aID + ".name", aEnglish);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + aID + ".tooltip", aToolTip);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it");
- this.mToolStats.put((short) aID, aToolStats);
- this.mToolStats.put((short) (aID + 1), aToolStats);
- aToolStats.onStatsAddedToTool(this, aID);
- final ItemStack rStack = new ItemStack(this, 1, aID);
- final List<TC_AspectStack> tAspects = new ArrayList<>();
- for (final 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 getToolWithStatsEx(final int aToolID, final int aAmount, final Materials aPrimaryMaterial, final Materials aSecondaryMaterial, final long[] aElectricArray) {
- final ItemStack rStack = new ItemStack(this, aAmount, aToolID);
- final IToolStats tToolStats = this.getToolStats(rStack);
- if (tToolStats != null) {
- final 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);
- }
- this.isItemStackUsable(rStack);
- return rStack;
- }
-
- /**
- * Called by the Block Harvesting Event within the GT_Proxy
- */
- @Override
- public void onHarvestBlockEvent(final ArrayList<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (this.isItemStackUsable(aStack) && (this.getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)) {
- this.doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion());
- }
- }
-
- @Override
- public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
- final IToolStats tStats = this.getToolStats(aStack);
- if ((tStats == null) || !this.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)) {
- final float tMagicDamage = tStats.getMagicDamageAgainstEntity(aEntity instanceof EntityLivingBase ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) : 0.0F, aEntity, aStack, aPlayer);
- float tDamage = tStats.getNormalDamageAgainstEntity((float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + this.getToolCombatDamage(aStack), aEntity, aStack, aPlayer);
- if ((tDamage + tMagicDamage) > 0.0F) {
- final 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);
- }
- final 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);
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
- }
- if (aStack.stackSize <= 0) {
- aPlayer.destroyCurrentEquippedItem();
- }
- return true;
- }
-
- @Override
- public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IToolStats tStats = this.getToolStats(aStack);
- if ((tStats != null) && tStats.canBlock()) {
- aPlayer.setItemInUse(aStack, 72000);
- }
- return super.onItemRightClick(aStack, aWorld, aPlayer);
- }
-
-
- @Override
- public Long[] getFluidContainerStats(final ItemStack aStack) {
- return null;
- }
-
- @Override
- public Long[] getElectricStats(final 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;
- }
-
- @Override
- public float getToolCombatDamage(final ItemStack aStack) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
- }
-
- @Override
- public float getDigSpeed(final ItemStack aStack, final Block aBlock, final int aMetaData) {
- if (!this.isItemStackUsable(aStack)) {
- return 0.0F;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- if ((tStats == null) || (Math.max(0, this.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 boolean onBlockDestroyed(final ItemStack aStack, final World aWorld, final Block aBlock, final int aX, final int aY, final int aZ, final EntityLivingBase aPlayer) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return false;
- }
- GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F);
- this.doDamage(aStack, (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
- return this.getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
- }
-
- private ItemStack getContainerItem(ItemStack aStack, final boolean playSound) {
- if (!this.isItemStackUsable(aStack)) {
- return null;
- }
- aStack = GT_Utility.copyAmount(1, aStack);
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return null;
- }
- this.doDamage(aStack, tStats.getToolDamagePerContainerCraft());
- aStack = aStack.stackSize > 0 ? aStack : null;
- if (playSound) {
- //String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
- //GT_Utility.doSoundAtClient(sound, 1, 1.0F);
- }
- return aStack;
- }
-
- @Override
- public Interface_ToolStats getToolStats(final ItemStack aStack) {
- this.isItemStackUsable(aStack);
- return this.getToolStatsInternal(aStack);
- }
-
- private Interface_ToolStats getToolStatsInternal(final ItemStack aStack) {
- return (Interface_ToolStats) (aStack == null ? null : this.mToolStats.get((short) aStack.getItemDamage()));
- }
-
- @Override
- public float getSaplingModifier(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer, final int aX, final int aY, final int aZ) {
- final IToolStats tStats = this.getToolStats(aStack);
- return (tStats != null) && tStats.isGrafter() ? Math.min(100.0F, (1 + this.getHarvestLevel(aStack, "")) * 20.0F) : 0.0F;
- }
-
- @Override
- public boolean canWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- return (tStats != null) && tStats.isCrowbar();
- }
-
- @Override
- public void onWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
-
- public boolean canWrench(final EntityPlayer player, final int x, final int y, final int z) {
- System.out.println("canWrench");
- if(player==null) {
- return false;
- }
- if(player.getCurrentEquippedItem()==null) {
- return false;
- }
- if (!this.isItemStackUsable(player.getCurrentEquippedItem())) {
- return false;
- }
- final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- return (tStats != null) && tStats.isWrench();
- }
-
- public void wrenchUsed(final EntityPlayer player, final int x, final int y, final int z) {
- if(player==null) {
- return;
- }
- if(player.getCurrentEquippedItem()==null) {
- return;
- }
- final IToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- if (tStats != null) {
- this.doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
- }
- }
-
- public boolean canUse(final ItemStack stack, final EntityPlayer player, final int x, final int y, final int z){
- return this.canWrench(player, x, y, z);
- }
-
- public void used(final ItemStack stack, final EntityPlayer player, final int x, final int y, final int z){
- this.wrenchUsed(player, x, y, z);
- }
-
- public boolean shouldHideFacades(final ItemStack stack, final EntityPlayer player) {
- if(player==null) {
- return false;
- }
- if(player.getCurrentEquippedItem()==null) {
- return false;
- }
- if (!this.isItemStackUsable(player.getCurrentEquippedItem())) {
- return false;
- }
- final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- return tStats.isWrench();
- }
-
- @Override
- public boolean canLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- return (tStats != null) && tStats.isCrowbar();
- }
-
- @Override
- public void onLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
-
- @Override
- public boolean canBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- return (tStats != null) && tStats.isCrowbar();
- }
-
- @Override
- public void onBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
-
- @Override
- public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IToolStats tStats = this.getToolStats(aStack);
- if ((tStats != null) && (aPlayer != null)) {
- tStats.onToolCrafted(aStack, aPlayer);
- }
- super.onCreated(aStack, aWorld, aPlayer);
- }
-
- @Override
- public boolean isFull3D() {
- return true;
- }
-
- @Override
- public boolean isItemStackUsable(final ItemStack aStack) {
- final IToolStats tStats = this.getToolStatsInternal(aStack);
- if (((aStack.getItemDamage() % 2) == 1) || (tStats == null)) {
- final NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT.removeTag("ench");
- }
- return false;
- }
- final Materials aMaterial = getPrimaryMaterial(aStack);
- final HashMap<Integer, Integer> 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);
- }
- }
- final Enchantment[] tEnchants = tStats.getEnchantments(aStack);
- final int[] tLevels = tStats.getEnchantmentLevels(aStack);
- for (int i = 0; i < tEnchants.length; i++) {
- if (tLevels[i] > 0) {
- final 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 (final Entry<Integer, Integer> tEntry : tMap.entrySet()) {
- if ((tEntry.getKey() == 33) || ((tEntry.getKey() == 20) && (tEntry.getValue() > 2)) || (tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)) {
- 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(final ItemStack aStack) {
- return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
- }
-
- @Override
- public short getEmptyMetaData(final ItemStack aStack) {
- final 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(final ItemStack aStack, final ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
- }
-} \ No newline at end of file
+ /**
+ * 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.
+ * <p/>
+ * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
+ */
+ public static final HashMap<String, GT_MetaGenTool> sInstances = new HashMap<>();
+
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+
+ public final HashMap<Short, IToolStats> mToolStats = new HashMap<>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public GT_MetaGenTool(final String aUnlocalized) {
+ super(aUnlocalized);
+ GT_ModHandler.registerBoxableItemToToolBox(this);
+ this.setCreativeTab(GregTech_API.TAB_GREGTECH);
+ this.setMaxStackSize(1);
+ sInstances.put(this.getUnlocalizedName(), this);
+ }
+
+ /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */
+
+ public static final Materials getPrimaryMaterialEx(final 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 getSecondaryMaterialEx(final 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;
+ }
+
+ /**
+ * 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 addToolEx(
+ final int aID,
+ final String aEnglish,
+ String aToolTip,
+ final IToolStats aToolStats,
+ final Object... aOreDictNamesAndAspects) {
+ if (aToolTip == null) {
+ aToolTip = "";
+ }
+ if ((aID >= 0) && (aID < 32766) && ((aID % 2) == 0)) {
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + aID + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + aID + ".tooltip", aToolTip);
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it");
+ this.mToolStats.put((short) aID, aToolStats);
+ this.mToolStats.put((short) (aID + 1), aToolStats);
+ aToolStats.onStatsAddedToTool(this, aID);
+ final ItemStack rStack = new ItemStack(this, 1, aID);
+ final List<TC_AspectStack> tAspects = new ArrayList<>();
+ for (final 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 getToolWithStatsEx(
+ final int aToolID,
+ final int aAmount,
+ final Materials aPrimaryMaterial,
+ final Materials aSecondaryMaterial,
+ final long[] aElectricArray) {
+ final ItemStack rStack = new ItemStack(this, aAmount, aToolID);
+ final IToolStats tToolStats = this.getToolStats(rStack);
+ if (tToolStats != null) {
+ final 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);
+ }
+ this.isItemStackUsable(rStack);
+ return rStack;
+ }
+
+ /**
+ * Called by the Block Harvesting Event within the GT_Proxy
+ */
+ @Override
+ public void onHarvestBlockEvent(
+ final ArrayList<ItemStack> aDrops,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final Block aBlock,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final byte aMetaData,
+ final int aFortune,
+ final boolean aSilkTouch,
+ final BlockEvent.HarvestDropsEvent aEvent) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (this.isItemStackUsable(aStack) && (this.getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)) {
+ this.doDamage(
+ aStack,
+ tStats.convertBlockDrops(
+ aDrops,
+ aStack,
+ aPlayer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ aMetaData,
+ aFortune,
+ aSilkTouch,
+ aEvent)
+ * tStats.getToolDamagePerDropConversion());
+ }
+ }
+
+ @Override
+ public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if ((tStats == null) || !this.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)) {
+ final float tMagicDamage = tStats.getMagicDamageAgainstEntity(
+ aEntity instanceof EntityLivingBase
+ ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity)
+ : 0.0F,
+ aEntity,
+ aStack,
+ aPlayer);
+ float tDamage = tStats.getNormalDamageAgainstEntity(
+ (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage)
+ .getAttributeValue()
+ + this.getToolCombatDamage(aStack),
+ aEntity,
+ aStack,
+ aPlayer);
+ if ((tDamage + tMagicDamage) > 0.0F) {
+ final 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);
+ }
+ final 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);
+ this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+ }
+ if (aStack.stackSize <= 0) {
+ aPlayer.destroyCurrentEquippedItem();
+ }
+ return true;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if ((tStats != null) && tStats.canBlock()) {
+ aPlayer.setItemInUse(aStack, 72000);
+ }
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public Long[] getFluidContainerStats(final ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public Long[] getElectricStats(final 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;
+ }
+
+ @Override
+ public float getToolCombatDamage(final ItemStack aStack) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats == null) {
+ return 0;
+ }
+ return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
+ }
+
+ @Override
+ public float getDigSpeed(final ItemStack aStack, final Block aBlock, final int aMetaData) {
+ if (!this.isItemStackUsable(aStack)) {
+ return 0.0F;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ if ((tStats == null) || (Math.max(0, this.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 boolean onBlockDestroyed(
+ final ItemStack aStack,
+ final World aWorld,
+ final Block aBlock,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final EntityLivingBase aPlayer) {
+ if (!this.isItemStackUsable(aStack)) {
+ return false;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats == null) {
+ return false;
+ }
+ GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F);
+ this.doDamage(aStack, (int)
+ Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
+ return this.getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
+ }
+
+ private ItemStack getContainerItem(ItemStack aStack, final boolean playSound) {
+ if (!this.isItemStackUsable(aStack)) {
+ return null;
+ }
+ aStack = GT_Utility.copyAmount(1, aStack);
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats == null) {
+ return null;
+ }
+ this.doDamage(aStack, tStats.getToolDamagePerContainerCraft());
+ aStack = aStack.stackSize > 0 ? aStack : null;
+ if (playSound) {
+ // String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
+ // GT_Utility.doSoundAtClient(sound, 1, 1.0F);
+ }
+ return aStack;
+ }
+
+ @Override
+ public Interface_ToolStats getToolStats(final ItemStack aStack) {
+ this.isItemStackUsable(aStack);
+ return this.getToolStatsInternal(aStack);
+ }
+
+ private Interface_ToolStats getToolStatsInternal(final ItemStack aStack) {
+ return (Interface_ToolStats) (aStack == null ? null : this.mToolStats.get((short) aStack.getItemDamage()));
+ }
+
+ @Override
+ public float getSaplingModifier(
+ final ItemStack aStack,
+ final World aWorld,
+ final EntityPlayer aPlayer,
+ final int aX,
+ final int aY,
+ final int aZ) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ return (tStats != null) && tStats.isGrafter()
+ ? Math.min(100.0F, (1 + this.getHarvestLevel(aStack, "")) * 20.0F)
+ : 0.0F;
+ }
+
+ @Override
+ public boolean canWhack(
+ final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
+ if (!this.isItemStackUsable(aStack)) {
+ return false;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ return (tStats != null) && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats != null) {
+ this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+
+ public boolean canWrench(final EntityPlayer player, final int x, final int y, final int z) {
+ System.out.println("canWrench");
+ if (player == null) {
+ return false;
+ }
+ if (player.getCurrentEquippedItem() == null) {
+ return false;
+ }
+ if (!this.isItemStackUsable(player.getCurrentEquippedItem())) {
+ return false;
+ }
+ final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
+ return (tStats != null) && tStats.isWrench();
+ }
+
+ public void wrenchUsed(final EntityPlayer player, final int x, final int y, final int z) {
+ if (player == null) {
+ return;
+ }
+ if (player.getCurrentEquippedItem() == null) {
+ return;
+ }
+ final IToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
+ if (tStats != null) {
+ this.doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
+ }
+ }
+
+ public boolean canUse(final ItemStack stack, final EntityPlayer player, final int x, final int y, final int z) {
+ return this.canWrench(player, x, y, z);
+ }
+
+ public void used(final ItemStack stack, final EntityPlayer player, final int x, final int y, final int z) {
+ this.wrenchUsed(player, x, y, z);
+ }
+
+ public boolean shouldHideFacades(final ItemStack stack, final EntityPlayer player) {
+ if (player == null) {
+ return false;
+ }
+ if (player.getCurrentEquippedItem() == null) {
+ return false;
+ }
+ if (!this.isItemStackUsable(player.getCurrentEquippedItem())) {
+ return false;
+ }
+ final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
+ return tStats.isWrench();
+ }
+
+ @Override
+ public boolean canLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
+ if (!this.isItemStackUsable(aStack)) {
+ return false;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ return (tStats != null) && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats != null) {
+ this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+
+ @Override
+ public boolean canBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
+ if (!this.isItemStackUsable(aStack)) {
+ return false;
+ }
+ final IToolStats tStats = this.getToolStats(aStack);
+ return (tStats != null) && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if (tStats != null) {
+ this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+
+ @Override
+ public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
+ final IToolStats tStats = this.getToolStats(aStack);
+ if ((tStats != null) && (aPlayer != null)) {
+ tStats.onToolCrafted(aStack, aPlayer);
+ }
+ super.onCreated(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public boolean isFull3D() {
+ return true;
+ }
+
+ @Override
+ public boolean isItemStackUsable(final ItemStack aStack) {
+ final IToolStats tStats = this.getToolStatsInternal(aStack);
+ if (((aStack.getItemDamage() % 2) == 1) || (tStats == null)) {
+ final NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT.removeTag("ench");
+ }
+ return false;
+ }
+ final Materials aMaterial = getPrimaryMaterial(aStack);
+ final HashMap<Integer, Integer> 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);
+ }
+ }
+ final Enchantment[] tEnchants = tStats.getEnchantments(aStack);
+ final int[] tLevels = tStats.getEnchantmentLevels(aStack);
+ for (int i = 0; i < tEnchants.length; i++) {
+ if (tLevels[i] > 0) {
+ final 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 (final Entry<Integer, Integer> tEntry : tMap.entrySet()) {
+ if ((tEntry.getKey() == 33)
+ || ((tEntry.getKey() == 20) && (tEntry.getValue() > 2))
+ || (tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)) {
+ 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(final ItemStack aStack) {
+ return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
+ }
+
+ @Override
+ public short getEmptyMetaData(final ItemStack aStack) {
+ final 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(final ItemStack aStack, final ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java
index cefd72332b..e57f2009e7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java
@@ -1,7 +1,9 @@
package gtPlusPlus.xmod.gregtech.api.items.types;
+import gregtech.api.enums.SubTag;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base;
import java.util.List;
-
import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
import net.minecraft.dispenser.IBlockSource;
@@ -14,72 +16,118 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
-import gregtech.api.enums.SubTag;
-
-import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
-import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base;
-
public class ToolType_Base implements Interface_ItemBehaviour<Gregtech_MetaItem_Base> {
- @Override
- public boolean onLeftClickEntity(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
- return false;
- }
-
- @Override
- public boolean onItemUse(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- return false;
- }
-
- @Override
- public boolean onItemUseFirst(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- return false;
- }
-
- @Override
- public ItemStack onItemRightClick(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- return aStack;
- }
-
- @Override
- public List<String> getAdditionalToolTips(final Gregtech_MetaItem_Base aItem, final List<String> aList, final ItemStack aStack) {
- return aList;
- }
-
- @Override
- public void onUpdate(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final World aWorld, final Entity aPlayer, final int aTimer, final boolean aIsInHand) {
- }
-
- @Override
- public boolean isItemStackUsable(final Gregtech_MetaItem_Base aItem, final ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean canDispense(final Gregtech_MetaItem_Base aItem, final IBlockSource aSource, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public ItemStack onDispense(final Gregtech_MetaItem_Base aItem, final IBlockSource aSource, final ItemStack aStack) {
- final EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
- final IPosition iposition = BlockDispenser.func_149939_a(aSource);
- final ItemStack itemstack1 = aStack.splitStack(1);
- BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
- return aStack;
- }
-
- @Override
- public boolean hasProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public EntityArrow getProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, final ItemStack aStack, final World aWorld, final double aX, final double aY, final double aZ) {
- return null;
- }
-
- @Override
- public EntityArrow getProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, final ItemStack aStack, final World aWorld, final EntityLivingBase aEntity, final float aSpeed) {
- return null;
- }
+ @Override
+ public boolean onLeftClickEntity(
+ final Gregtech_MetaItem_Base aItem,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final Entity aEntity) {
+ return false;
+ }
+
+ @Override
+ public boolean onItemUse(
+ final Gregtech_MetaItem_Base aItem,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final World aWorld,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final int aSide,
+ final float hitX,
+ final float hitY,
+ final float hitZ) {
+ return false;
+ }
+
+ @Override
+ public boolean onItemUseFirst(
+ final Gregtech_MetaItem_Base aItem,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final World aWorld,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final int aSide,
+ final float hitX,
+ final float hitY,
+ final float hitZ) {
+ return false;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(
+ final Gregtech_MetaItem_Base aItem,
+ final ItemStack aStack,
+ final World aWorld,
+ final EntityPlayer aPlayer) {
+ return aStack;
+ }
+
+ @Override
+ public List<String> getAdditionalToolTips(
+ final Gregtech_MetaItem_Base aItem, final List<String> aList, final ItemStack aStack) {
+ return aList;
+ }
+
+ @Override
+ public void onUpdate(
+ final Gregtech_MetaItem_Base aItem,
+ final ItemStack aStack,
+ final World aWorld,
+ final Entity aPlayer,
+ final int aTimer,
+ final boolean aIsInHand) {}
+
+ @Override
+ public boolean isItemStackUsable(final Gregtech_MetaItem_Base aItem, final ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean canDispense(final Gregtech_MetaItem_Base aItem, final IBlockSource aSource, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ItemStack onDispense(
+ final Gregtech_MetaItem_Base aItem, final IBlockSource aSource, final ItemStack aStack) {
+ final EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
+ final IPosition iposition = BlockDispenser.func_149939_a(aSource);
+ final ItemStack itemstack1 = aStack.splitStack(1);
+ BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
+ return aStack;
+ }
+
+ @Override
+ public boolean hasProjectile(
+ final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public EntityArrow getProjectile(
+ final Gregtech_MetaItem_Base aItem,
+ final SubTag aProjectileType,
+ final ItemStack aStack,
+ final World aWorld,
+ final double aX,
+ final double aY,
+ final double aZ) {
+ return null;
+ }
+
+ @Override
+ public EntityArrow getProjectile(
+ final Gregtech_MetaItem_Base aItem,
+ final SubTag aProjectileType,
+ final ItemStack aStack,
+ final World aWorld,
+ final EntityLivingBase aEntity,
+ final float aSpeed) {
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java
index d4f5a87006..49063c43c2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java
@@ -1,15 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.items.types;
-import java.util.List;
-import java.util.Random;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.items.GT_MetaBase_Item;
@@ -18,108 +8,141 @@ import gregtech.api.objects.ItemData;
import gregtech.api.util.*;
import gregtech.common.blocks.GT_Block_Ores;
import gregtech.common.blocks.GT_TileEntity_Ores;
-
+import java.util.List;
+import java.util.Random;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.IFluidBlock;
-public class ToolType_HardHammer
-extends ToolType_Base {
- private final int mVanillaCosts;
- private final int mEUCosts;
- private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting");
-
- public ToolType_HardHammer(final int aVanillaCosts, final int aEUCosts) {
- this.mVanillaCosts = aVanillaCosts;
- this.mEUCosts = aEUCosts;
- }
+public class ToolType_HardHammer extends ToolType_Base {
+ private final int mVanillaCosts;
+ private final int mEUCosts;
+ private final String mTooltip =
+ GT_LanguageManager.addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting");
- public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
- final Block aBlock = aWorld.getBlock(aX, aY, aZ);
- if (aBlock == null) {
- return false;
- }
- final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
+ public ToolType_HardHammer(final int aVanillaCosts, final int aEUCosts) {
+ this.mVanillaCosts = aVanillaCosts;
+ this.mEUCosts = aEUCosts;
+ }
+ public boolean onItemUseFirst(
+ final GT_MetaBase_Item aItem,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final World aWorld,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final int aSide,
+ final float hitX,
+ final float hitY,
+ final float hitZ) {
+ if (aWorld.isRemote) {
+ return false;
+ }
+ final Block aBlock = aWorld.getBlock(aX, aY, aZ);
+ if (aBlock == null) {
+ return false;
+ }
+ final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
- ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
- if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
- GT_Utility.sendChatToPlayer(aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
- return true;
- }
- if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone))) {
- if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
- int tX = aX;
- int tY = aY;
- int tZ = aZ;
- int tMetaID = 0;
- final int tQuality = (aItem instanceof GT_MetaGenerated_Tool) ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0;
+ ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
+ if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
+ GT_Utility.sendChatToPlayer(
+ aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ return true;
+ }
+ if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone))
+ || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites))
+ || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack))
+ || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone))) {
+ if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ int tX = aX;
+ int tY = aY;
+ int tZ = aZ;
+ int tMetaID = 0;
+ final int tQuality = (aItem instanceof GT_MetaGenerated_Tool)
+ ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "")
+ : 0;
- int i = 0;
- for (final int j = 6 + tQuality; i < j; i++) {
- tX -= ForgeDirection.getOrientation(aSide).offsetX;
- tY -= ForgeDirection.getOrientation(aSide).offsetY;
- tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
+ int i = 0;
+ for (final int j = 6 + tQuality; i < j; i++) {
+ tX -= ForgeDirection.getOrientation(aSide).offsetX;
+ tY -= ForgeDirection.getOrientation(aSide).offsetY;
+ tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
- final Block tBlock = aWorld.getBlock(tX, tY, tZ);
- if ((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Rock.");
- break;
- }
- if ((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock))) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Rock.");
- break;
- }
- if ((tBlock == Blocks.monster_egg) || (!GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ))) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Rock.");
- break;
- }
- if (tBlock != aBlock) {
- if (i >= 4) {
- break;
- }
- GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Rock.");
- break;
- }
- }
- final Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide);
- i = 0;
- for (final int j = 9 + (2 * tQuality); i < j; i++) {
- tX = (aX - 4 - tQuality) + tRandom.nextInt(j);
- tY = (aY - 4 - tQuality) + tRandom.nextInt(j);
- tZ = (aZ - 4 - tQuality) + tRandom.nextInt(j);
- final Block tBlock = aWorld.getBlock(tX, tY, tZ);
- if ((tBlock instanceof GT_Block_Ores)) {
- final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
- if ((tTileEntity instanceof GT_TileEntity_Ores)) {
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
- if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
- GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore.");
- return true;
- }
- }
- } else {
- tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
- tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
- if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
- GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
- return true;
- }
- }
- }
- GT_Utility.sendChatToPlayer(aPlayer, "No Ores found.");
- }
- return true;
- }
- return false;
- }
+ final Block tBlock = aWorld.getBlock(tX, tY, tZ);
+ if ((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Rock.");
+ break;
+ }
+ if ((tBlock == Blocks.water)
+ || (tBlock == Blocks.flowing_water)
+ || ((tBlock instanceof IFluidBlock))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Rock.");
+ break;
+ }
+ if ((tBlock == Blocks.monster_egg) || (!GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Rock.");
+ break;
+ }
+ if (tBlock != aBlock) {
+ if (i >= 4) {
+ break;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Rock.");
+ break;
+ }
+ }
+ final Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide);
+ i = 0;
+ for (final int j = 9 + (2 * tQuality); i < j; i++) {
+ tX = (aX - 4 - tQuality) + tRandom.nextInt(j);
+ tY = (aY - 4 - tQuality) + tRandom.nextInt(j);
+ tZ = (aZ - 4 - tQuality) + tRandom.nextInt(j);
+ final Block tBlock = aWorld.getBlock(tX, tY, tZ);
+ if ((tBlock instanceof GT_Block_Ores)) {
+ final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
+ if ((tTileEntity instanceof GT_TileEntity_Ores)) {
+ final Materials tMaterial = GregTech_API.sGeneratedMaterials[
+ (((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
+ if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
+ GT_Utility.sendChatToPlayer(
+ aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore.");
+ return true;
+ }
+ }
+ } else {
+ tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
+ tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
+ if ((tAssotiation != null)
+ && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
+ GT_Utility.sendChatToPlayer(
+ aPlayer,
+ "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
+ return true;
+ }
+ }
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "No Ores found.");
+ }
+ return true;
+ }
+ return false;
+ }
- public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) {
- aList.add(this.mTooltip);
- return aList;
- }
+ public List<String> getAdditionalToolTips(
+ final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) {
+ aList.add(this.mTooltip);
+ return aList;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Pump.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Pump.java
index f62d9e5cfa..f1dd3b391d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Pump.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Pump.java
@@ -1,150 +1,151 @@
package gtPlusPlus.xmod.gregtech.api.items.types;
-import java.util.Arrays;
+import gregtech.api.items.GT_MetaBase_Item;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Utility;
import java.util.List;
-
import net.minecraft.block.Block;
-import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import gregtech.api.GregTech_API;
-import gregtech.api.items.GT_MetaBase_Item;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-
-import ic2.api.tile.IWrenchable;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class ToolType_Pump
-extends ToolType_Base {
- private final int mCosts;
- private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.pump", "Sucks in Machine Input Fluid tank contents on Rightclick");
+public class ToolType_Pump extends ToolType_Base {
+ private final int mCosts;
+ private final String mTooltip = GT_LanguageManager.addStringLocalization(
+ "gt.behaviour.pump", "Sucks in Machine Input Fluid tank contents on Rightclick");
- public ToolType_Pump(final int aCosts) {
- this.mCosts = aCosts;
- }
+ public ToolType_Pump(final int aCosts) {
+ this.mCosts = aCosts;
+ }
- public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
- final Block aBlock = aWorld.getBlock(aX, aY, aZ);
- if (aBlock == null) {
- return false;
- }
- final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
- final byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ);
- final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- /*try {
- if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) {
- if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- ((IWrenchable) aTileEntity).setFacing(aTargetSide);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) {
- final int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3;
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts))) {
- ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer);
- for (final ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) {
- if (tOutput == null) {
- aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack));
- } else {
- aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput));
- tOutput = null;
- }
- }
- aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- return true;
- }
- } catch (final Throwable e) {
- }
- if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if ((aBlock == Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if ((aBlock == Blocks.crafting_table) || (aBlock == Blocks.bookshelf)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta)));
- aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if (aMeta == aTargetSide) {
- if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.trapped_chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.hopper)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0)));
- aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- } else {
- if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) {
- if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) {
- if ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if (aBlock == Blocks.hopper) {
- if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- }
- if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)).contains(ForgeDirection.getOrientation(aTargetSide))) &&
- ((aPlayer.capabilities.isCreativeMode) || (!GT_ModHandler.isElectricItem(aStack)) || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) &&
- (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) {
- if (!aPlayer.capabilities.isCreativeMode) {
- ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts);
- }
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }*/
- return false;
- }
+ public boolean onItemUseFirst(
+ final GT_MetaBase_Item aItem,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final World aWorld,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final int aSide,
+ final float hitX,
+ final float hitY,
+ final float hitZ) {
+ if (aWorld.isRemote) {
+ return false;
+ }
+ final Block aBlock = aWorld.getBlock(aX, aY, aZ);
+ if (aBlock == null) {
+ return false;
+ }
+ final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
+ final byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ);
+ final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ /*try {
+ if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) {
+ if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ ((IWrenchable) aTileEntity).setFacing(aTargetSide);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) {
+ final int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3;
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts))) {
+ ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer);
+ for (final ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) {
+ if (tOutput == null) {
+ aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack));
+ } else {
+ aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput));
+ tOutput = null;
+ }
+ }
+ aWorld.setBlockToAir(aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ return true;
+ }
+ } catch (final Throwable e) {
+ }
+ if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.crafting_table) || (aBlock == Blocks.bookshelf)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta)));
+ aWorld.setBlockToAir(aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if (aMeta == aTargetSide) {
+ if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.trapped_chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.hopper)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0)));
+ aWorld.setBlockToAir(aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ } else {
+ if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) {
+ if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) {
+ if ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if (aBlock == Blocks.hopper) {
+ if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ }
+ if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)).contains(ForgeDirection.getOrientation(aTargetSide))) &&
+ ((aPlayer.capabilities.isCreativeMode) || (!GT_ModHandler.isElectricItem(aStack)) || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) &&
+ (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) {
+ if (!aPlayer.capabilities.isCreativeMode) {
+ ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts);
+ }
+ GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }*/
+ return false;
+ }
- public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) {
- aList.add(this.mTooltip);
- return aList;
- }
+ public List<String> getAdditionalToolTips(
+ final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) {
+ aList.add(this.mTooltip);
+ return aList;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java
index d0ef6a535c..6c12663bb6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java
@@ -1,8 +1,14 @@
package gtPlusPlus.xmod.gregtech.api.items.types;
+import gregtech.api.GregTech_API;
+import gregtech.api.items.GT_MetaBase_Item;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import ic2.api.tile.IWrenchable;
import java.util.Arrays;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@@ -10,141 +16,195 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.items.GT_MetaBase_Item;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-
-import ic2.api.tile.IWrenchable;
import net.minecraftforge.common.util.ForgeDirection;
-public class ToolType_Wrench
-extends ToolType_Base {
- private final int mCosts;
- private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick");
+public class ToolType_Wrench extends ToolType_Base {
+ private final int mCosts;
+ private final String mTooltip =
+ GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick");
- public ToolType_Wrench(final int aCosts) {
- this.mCosts = aCosts;
- }
+ public ToolType_Wrench(final int aCosts) {
+ this.mCosts = aCosts;
+ }
- public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
- final Block aBlock = aWorld.getBlock(aX, aY, aZ);
- if (aBlock == null) {
- return false;
- }
- final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
- final byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ);
- final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- try {
- if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) {
- if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- ((IWrenchable) aTileEntity).setFacing(aTargetSide);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) {
- final int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3;
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts))) {
- ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer);
- for (final ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) {
- if (tOutput == null) {
- aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack));
- } else {
- aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput));
- tOutput = null;
- }
- }
- aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- return true;
- }
- } catch (final Throwable e) {
- }
- if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if ((aBlock == Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if ((aBlock == Blocks.crafting_table) || (aBlock == Blocks.bookshelf)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta)));
- aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if (aMeta == aTargetSide) {
- if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.trapped_chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.hopper)) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0)));
- aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- } else {
- if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) {
- if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) {
- if ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if (aBlock == Blocks.hopper) {
- if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- }
- if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)).contains(ForgeDirection.getOrientation(aTargetSide))) &&
- ((aPlayer.capabilities.isCreativeMode) || (!GT_ModHandler.isElectricItem(aStack)) || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) &&
- (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) {
- if (!aPlayer.capabilities.isCreativeMode) {
- ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts);
- }
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return false;
- }
+ public boolean onItemUseFirst(
+ final GT_MetaBase_Item aItem,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final World aWorld,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final int aSide,
+ final float hitX,
+ final float hitY,
+ final float hitZ) {
+ if (aWorld.isRemote) {
+ return false;
+ }
+ final Block aBlock = aWorld.getBlock(aX, aY, aZ);
+ if (aBlock == null) {
+ return false;
+ }
+ final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
+ final byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ);
+ final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ try {
+ if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) {
+ if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) {
+ if ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ ((IWrenchable) aTileEntity).setFacing(aTargetSide);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) {
+ final int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3;
+ if ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts))) {
+ ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer);
+ for (final ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) {
+ if (tOutput == null) {
+ aWorld.spawnEntityInWorld(
+ new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack));
+ } else {
+ aWorld.spawnEntityInWorld(
+ new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput));
+ tOutput = null;
+ }
+ }
+ aWorld.setBlockToAir(aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ return true;
+ }
+ } catch (final Throwable e) {
+ }
+ if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) {
+ if ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) {
+ if ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) {
+ if ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.crafting_table) || (aBlock == Blocks.bookshelf)) {
+ if ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.spawnEntityInWorld(
+ new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta)));
+ aWorld.setBlockToAir(aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if (aMeta == aTargetSide) {
+ if ((aBlock == Blocks.pumpkin)
+ || (aBlock == Blocks.lit_pumpkin)
+ || (aBlock == Blocks.piston)
+ || (aBlock == Blocks.sticky_piston)
+ || (aBlock == Blocks.dispenser)
+ || (aBlock == Blocks.dropper)
+ || (aBlock == Blocks.furnace)
+ || (aBlock == Blocks.lit_furnace)
+ || (aBlock == Blocks.chest)
+ || (aBlock == Blocks.trapped_chest)
+ || (aBlock == Blocks.ender_chest)
+ || (aBlock == Blocks.hopper)) {
+ if ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.spawnEntityInWorld(
+ new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0)));
+ aWorld.setBlockToAir(aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ } else {
+ if ((aBlock == Blocks.piston)
+ || (aBlock == Blocks.sticky_piston)
+ || (aBlock == Blocks.dispenser)
+ || (aBlock == Blocks.dropper)) {
+ if ((aMeta < 6)
+ && ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.pumpkin)
+ || (aBlock == Blocks.lit_pumpkin)
+ || (aBlock == Blocks.furnace)
+ || (aBlock == Blocks.lit_furnace)
+ || (aBlock == Blocks.chest)
+ || (aBlock == Blocks.ender_chest)
+ || (aBlock == Blocks.trapped_chest)) {
+ if ((aTargetSide > 1)
+ && ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if (aBlock == Blocks.hopper) {
+ if ((aTargetSide != 1)
+ && ((aPlayer.capabilities.isCreativeMode)
+ || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ }
+ if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ))
+ .contains(ForgeDirection.getOrientation(aTargetSide)))
+ && ((aPlayer.capabilities.isCreativeMode)
+ || (!GT_ModHandler.isElectricItem(aStack))
+ || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts)))
+ && (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) {
+ if (!aPlayer.capabilities.isCreativeMode) {
+ ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts);
+ }
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return false;
+ }
- public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) {
- aList.add(this.mTooltip);
- return aList;
- }
+ public List<String> getAdditionalToolTips(
+ final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) {
+ aList.add(this.mTooltip);
+ return aList;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
index 5ccbd8cb2d..a88105f7f6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Random;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
@@ -12,201 +7,202 @@ import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.interfaces.IBaseCustomMetaTileEntity;
-import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import ic2.api.Direction;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Random;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class BaseCustomTileEntity extends BaseMetaTileEntity implements IBaseCustomMetaTileEntity {
-
- protected NBTTagCompound mRecipeStuff2;
- private static final Field ENTITY_ITEM_HEALTH_FIELD_2;
-
- static {
- Field f = null;
- try {
- f = EntityItem.class.getDeclaredField("field_70291_e");
- f.setAccessible(true);
- } catch (Exception var4) {
- try {
- f = EntityItem.class.getDeclaredField("health");
- f.setAccessible(true);
- } catch (Exception var3) {
- var4.printStackTrace();
- var3.printStackTrace();
- }
- }
-
- ENTITY_ITEM_HEALTH_FIELD_2 = f;
- }
-
- public BaseCustomTileEntity() {
- super();
- Logger.MACHINE_INFO("Created new BaseCustomTileEntity");
- }
-
- public boolean doesExplode() {
- return true;
- }
-
- public void writeToNBT(NBTTagCompound aNBT) {
- try {
- super.writeToNBT(aNBT);
- } catch (Throwable arg7) {
- 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!!!");
- arg7.printStackTrace(GT_Log.err);
- }
-
- try {
- if (!aNBT.hasKey("ModVersion"))
- aNBT.setString("ModVersion", CORE.VERSION);
- } catch (Throwable arg6) {
- 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!!!");
- arg6.printStackTrace(GT_Log.err);
- }
- }
-
- public void doEnergyExplosion() {
- if (!doesExplode()) {
- Logger.INFO("Machine tried to explode, let's stop that. xo [doEnergyExplosion]");
- return;
- }
- if (this.getUniversalEnergyCapacity() > 0L
- && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) {
- this.doExplosion(
- this.getOutput() * (long) (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() ? 4
- : (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2L ? 2 : 1)));
- GT_Mod arg9999 = GT_Mod.instance;
- GT_Mod.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(this.getOwnerName()),
- "electricproblems");
- }
-
- }
-
- public void doExplosion(long aAmount) {
-
- if (!doesExplode()) {
- Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]");
- return;
- }
-
- if (this.canAccessData()) {
- if (GregTech_API.sMachineWireFire && this.mMetaTileEntity.isElectric()) {
- try {
- this.mReleaseEnergy = true;
- Util.emitEnergyToNetwork(GT_Values.V[5], Math.max(1L, this.getStoredEU() / GT_Values.V[5]), this);
- } catch (Exception arg4) {
- ;
- }
- }
-
- this.mReleaseEnergy = false;
- this.mMetaTileEntity.onExplosion();
- int i;
-
- boolean aExplosionDropItem = false;
- Object aProxyField = StaticFields59.getFieldFromGregtechProxy(false, "mExplosionItemDrop");
- if (boolean.class.isInstance(aProxyField) || Boolean.class.isInstance(aProxyField)) {
- aExplosionDropItem = (boolean) aProxyField;
- }
-
- if (aExplosionDropItem) {
- for (i = 0; i < this.getSizeInventory(); ++i) {
- ItemStack tItem = this.getStackInSlot(i);
- if (tItem != null && tItem.stackSize > 0 && this.isValidSlot(i)) {
- this.dropItems(tItem);
- this.setInventorySlotContents(i, (ItemStack) null);
- }
- }
- }
-
- if (this.mRecipeStuff2 != null) {
- for (i = 0; i < 9; ++i) {
- this.dropItems(GT_Utility.loadItem(this.mRecipeStuff2, "Ingredient." + i));
- }
- }
-
- PollutionUtils.addPollution(this, 100000);
- this.mMetaTileEntity.doExplosion(aAmount);
- }
-
- }
-
-
- public void dropItems(ItemStack tItem) {
- if (tItem != null) {
- Random tRandom = new Random();
- EntityItem tItemEntity = new EntityItem(this.worldObj,
- (double) ((float) this.xCoord + tRandom.nextFloat() * 0.8F + 0.1F),
- (double) ((float) this.yCoord + tRandom.nextFloat() * 0.8F + 0.1F),
- (double) ((float) this.zCoord + tRandom.nextFloat() * 0.8F + 0.1F),
- new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
- if (tItem.hasTagCompound()) {
- tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy());
- }
-
- tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D;
- tItemEntity.motionY = tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D;
- tItemEntity.motionZ = tRandom.nextGaussian() * 0.0500000007450581D;
- tItemEntity.hurtResistantTime = 999999;
- tItemEntity.lifespan = 60000;
-
- try {
- if (ENTITY_ITEM_HEALTH_FIELD_2 != null) {
- ENTITY_ITEM_HEALTH_FIELD_2.setInt(tItemEntity, 99999999);
- }
- } catch (Exception var5) {
- ;
- }
-
- this.worldObj.spawnEntityInWorld(tItemEntity);
- tItem.stackSize = 0;
- }
- }
-
- public ArrayList<ItemStack> getDrops() {
- ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
- ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, this.getMetaTileID());
- // Currently not using my custom block.
- // ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1,
- // this.getMetaTileID());
- boolean fail = true;
-
- ArrayList<ItemStack> aSuperDrops = super.getDrops();
- if (aSuperDrops != null && !aSuperDrops.isEmpty()) {
- ItemStack aSuperStack = super.getDrops().get(0);
- if (aSuperStack != null && aSuperStack.hasTagCompound()) {
- NBTTagCompound aSuperNBT = aSuperStack.getTagCompound();
- if (aSuperNBT != null && !aSuperNBT.hasNoTags()) {
- NBTTagCompound tNBT = (NBTTagCompound) aSuperNBT.copy();
- if (tNBT != null && !tNBT.hasNoTags()) {
- if (this.hasValidMetaTileEntity()) {
- this.mMetaTileEntity.setItemNBT(tNBT);
- rStack.setTagCompound(tNBT);
- fail = false;
- aDrops.add(rStack);
- }
- }
- }
-
- }
- }
- if (fail) {
- aDrops.add(rStack);
- }
- return aDrops;
- }
-
- public boolean isTeleporterCompatible(Direction aSide) {
- return this.canAccessData() && this.mMetaTileEntity.isTeleporterCompatible();
- }
-
-} \ No newline at end of file
+
+ protected NBTTagCompound mRecipeStuff2;
+ private static final Field ENTITY_ITEM_HEALTH_FIELD_2;
+
+ static {
+ Field f = null;
+ try {
+ f = EntityItem.class.getDeclaredField("field_70291_e");
+ f.setAccessible(true);
+ } catch (Exception var4) {
+ try {
+ f = EntityItem.class.getDeclaredField("health");
+ f.setAccessible(true);
+ } catch (Exception var3) {
+ var4.printStackTrace();
+ var3.printStackTrace();
+ }
+ }
+
+ ENTITY_ITEM_HEALTH_FIELD_2 = f;
+ }
+
+ public BaseCustomTileEntity() {
+ super();
+ Logger.MACHINE_INFO("Created new BaseCustomTileEntity");
+ }
+
+ public boolean doesExplode() {
+ return true;
+ }
+
+ public void writeToNBT(NBTTagCompound aNBT) {
+ try {
+ super.writeToNBT(aNBT);
+ } catch (Throwable arg7) {
+ 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!!!");
+ arg7.printStackTrace(GT_Log.err);
+ }
+
+ try {
+ if (!aNBT.hasKey("ModVersion")) aNBT.setString("ModVersion", CORE.VERSION);
+ } catch (Throwable arg6) {
+ 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!!!");
+ arg6.printStackTrace(GT_Log.err);
+ }
+ }
+
+ public void doEnergyExplosion() {
+ if (!doesExplode()) {
+ Logger.INFO("Machine tried to explode, let's stop that. xo [doEnergyExplosion]");
+ return;
+ }
+ if (this.getUniversalEnergyCapacity() > 0L
+ && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) {
+ this.doExplosion(this.getOutput()
+ * (long)
+ (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity()
+ ? 4
+ : (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2L
+ ? 2
+ : 1)));
+ GT_Mod arg9999 = GT_Mod.instance;
+ GT_Mod.achievements.issueAchievement(
+ this.getWorldObj().getPlayerEntityByName(this.getOwnerName()), "electricproblems");
+ }
+ }
+
+ public void doExplosion(long aAmount) {
+
+ if (!doesExplode()) {
+ Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]");
+ return;
+ }
+
+ if (this.canAccessData()) {
+ if (GregTech_API.sMachineWireFire && this.mMetaTileEntity.isElectric()) {
+ try {
+ this.mReleaseEnergy = true;
+ Util.emitEnergyToNetwork(GT_Values.V[5], Math.max(1L, this.getStoredEU() / GT_Values.V[5]), this);
+ } catch (Exception arg4) {
+ ;
+ }
+ }
+
+ this.mReleaseEnergy = false;
+ this.mMetaTileEntity.onExplosion();
+ int i;
+
+ boolean aExplosionDropItem = false;
+ Object aProxyField = StaticFields59.getFieldFromGregtechProxy(false, "mExplosionItemDrop");
+ if (boolean.class.isInstance(aProxyField) || Boolean.class.isInstance(aProxyField)) {
+ aExplosionDropItem = (boolean) aProxyField;
+ }
+
+ if (aExplosionDropItem) {
+ for (i = 0; i < this.getSizeInventory(); ++i) {
+ ItemStack tItem = this.getStackInSlot(i);
+ if (tItem != null && tItem.stackSize > 0 && this.isValidSlot(i)) {
+ this.dropItems(tItem);
+ this.setInventorySlotContents(i, (ItemStack) null);
+ }
+ }
+ }
+
+ if (this.mRecipeStuff2 != null) {
+ for (i = 0; i < 9; ++i) {
+ this.dropItems(GT_Utility.loadItem(this.mRecipeStuff2, "Ingredient." + i));
+ }
+ }
+
+ PollutionUtils.addPollution(this, 100000);
+ this.mMetaTileEntity.doExplosion(aAmount);
+ }
+ }
+
+ public void dropItems(ItemStack tItem) {
+ if (tItem != null) {
+ Random tRandom = new Random();
+ EntityItem tItemEntity = new EntityItem(
+ this.worldObj,
+ (double) ((float) this.xCoord + tRandom.nextFloat() * 0.8F + 0.1F),
+ (double) ((float) this.yCoord + tRandom.nextFloat() * 0.8F + 0.1F),
+ (double) ((float) this.zCoord + tRandom.nextFloat() * 0.8F + 0.1F),
+ new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
+ if (tItem.hasTagCompound()) {
+ tItemEntity.getEntityItem().setTagCompound((NBTTagCompound)
+ tItem.getTagCompound().copy());
+ }
+
+ tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D;
+ tItemEntity.motionY = tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D;
+ tItemEntity.motionZ = tRandom.nextGaussian() * 0.0500000007450581D;
+ tItemEntity.hurtResistantTime = 999999;
+ tItemEntity.lifespan = 60000;
+
+ try {
+ if (ENTITY_ITEM_HEALTH_FIELD_2 != null) {
+ ENTITY_ITEM_HEALTH_FIELD_2.setInt(tItemEntity, 99999999);
+ }
+ } catch (Exception var5) {
+ ;
+ }
+
+ this.worldObj.spawnEntityInWorld(tItemEntity);
+ tItem.stackSize = 0;
+ }
+ }
+
+ public ArrayList<ItemStack> getDrops() {
+ ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
+ ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, this.getMetaTileID());
+ // Currently not using my custom block.
+ // ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1,
+ // this.getMetaTileID());
+ boolean fail = true;
+
+ ArrayList<ItemStack> aSuperDrops = super.getDrops();
+ if (aSuperDrops != null && !aSuperDrops.isEmpty()) {
+ ItemStack aSuperStack = super.getDrops().get(0);
+ if (aSuperStack != null && aSuperStack.hasTagCompound()) {
+ NBTTagCompound aSuperNBT = aSuperStack.getTagCompound();
+ if (aSuperNBT != null && !aSuperNBT.hasNoTags()) {
+ NBTTagCompound tNBT = (NBTTagCompound) aSuperNBT.copy();
+ if (tNBT != null && !tNBT.hasNoTags()) {
+ if (this.hasValidMetaTileEntity()) {
+ this.mMetaTileEntity.setItemNBT(tNBT);
+ rStack.setTagCompound(tNBT);
+ fail = false;
+ aDrops.add(rStack);
+ }
+ }
+ }
+ }
+ }
+ if (fail) {
+ aDrops.add(rStack);
+ }
+ return aDrops;
+ }
+
+ public boolean isTeleporterCompatible(Direction aSide) {
+ return this.canAccessData() && this.mMetaTileEntity.isTeleporterCompatible();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java
index d600d0baca..b3d8b8aa8c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java
@@ -8,277 +8,283 @@ import net.minecraftforge.common.util.ForgeDirection;
public class BaseCustomPower_MTE extends BaseCustomTileEntity {
- public BaseCustomPower_MTE() {
- super();
- Logger.INFO("Created new BaseCustomPower_MTE");
- }
-
- public boolean doesExplode() {
- return false;
- }
-
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (mMetaTileEntity == null) {
- Logger.INFO("Bad Tile");
- }
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.inputEnergyFrom(aSide) && aAmperage > 0L
- && aVoltage > 0L && this.getStoredEU() < this.getEUCapacity()
- && this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()) {
- Logger.INFO("Injecting Energy Units");
- return super.injectEnergyUnits(aSide, aVoltage, aAmperage);
- } else {
- Logger.INFO("canAccessData(): "+canAccessData());
- Logger.INFO("isElectric(): "+this.mMetaTileEntity.isElectric());
- Logger.INFO("InputEnergyFromSide("+aSide+"): "+this.inputEnergyFrom(aSide));
- Logger.INFO("aAmperage: "+aAmperage);
- Logger.INFO("aVoltage: "+aVoltage);
- Logger.INFO("this.getStoredEU() < this.getEUCapacity(): "+(this.getStoredEU() < this.getEUCapacity()));
- Logger.INFO("this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: "+(this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()));
- Logger.INFO("this.mMetaTileEntity.maxAmperesIn(): "+(this.mMetaTileEntity.maxAmperesIn()));
- Logger.INFO("this.mAcceptedAmperes: "+(this.getInputAmperage()));
- return 0L;
- }
- }
-
- public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- Logger.INFO("Draining Energy Units 4");
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.outputsEnergyTo(aSide)
- && this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) {
- if (this.decreaseStoredEU(aVoltage * aAmperage, false)) {
- this.mAverageEUOutput[this.mAverageEUOutputIndex] = (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex]
- + aVoltage * aAmperage);
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
- Logger.INFO("Draining Energy Units 3");
- // TODO Auto-generated method stub
- return super.decreaseStoredEnergyUnits(aEnergy, aIgnoreTooLessEnergy);
- }
-
- @Override
- public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
- // TODO Auto-generated method stub
- return super.increaseStoredEnergyUnits(aEnergy, aIgnoreTooMuchEnergy);
- }
-
- @Override
- public boolean inputEnergyFrom(byte aSide) {
- // TODO Auto-generated method stub
- return super.inputEnergyFrom(aSide);
- }
-
- @Override
- public boolean outputsEnergyTo(byte aSide) {
- Logger.INFO("Draining Energy Units 2");
- // TODO Auto-generated method stub
- return super.outputsEnergyTo(aSide);
- }
-
- @Override
- public long getOutputAmperage() {
- // TODO Auto-generated method stub
- return super.getOutputAmperage();
- }
-
- @Override
- public long getOutputVoltage() {
- // TODO Auto-generated method stub
- return super.getOutputVoltage();
- }
-
- @Override
- public long getInputAmperage() {
- // TODO Auto-generated method stub
- return super.getInputAmperage();
- }
-
- @Override
- public long getInputVoltage() {
- // TODO Auto-generated method stub
- return super.getInputVoltage();
- }
-
- @Override
- public long getUniversalEnergyStored() {
- // TODO Auto-generated method stub
- return super.getUniversalEnergyStored();
- }
-
- @Override
- public long getUniversalEnergyCapacity() {
- // TODO Auto-generated method stub
- return super.getUniversalEnergyCapacity();
- }
-
- @Override
- public long getStoredEU() {
- // TODO Auto-generated method stub
- return super.getStoredEU();
- }
-
- @Override
- public long getEUCapacity() {
- // TODO Auto-generated method stub
- return super.getEUCapacity();
- }
-
- @Override
- public boolean setStoredEU(long aEnergy) {
- // TODO Auto-generated method stub
- return super.setStoredEU(aEnergy);
- }
-
- @Override
- public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) {
- Logger.INFO("Draining Energy Units 1");
- // TODO Auto-generated method stub
- return super.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy);
- }
-
- @Override
- public boolean decreaseStoredSteam(long aEnergy, boolean aIgnoreTooLessEnergy) {
- // TODO Auto-generated method stub
- return super.decreaseStoredSteam(aEnergy, aIgnoreTooLessEnergy);
- }
-
- @Override
- public void doEnergyExplosion() {
- // TODO Auto-generated method stub
- super.doEnergyExplosion();
- }
-
- @Override
- public void doExplosion(long aAmount) {
- // TODO Auto-generated method stub
- super.doExplosion(aAmount);
- }
-
- @Override
- public byte getLightValue() {
- // TODO Auto-generated method stub
- return super.getLightValue();
- }
-
- @Override
- public long getAverageElectricInput() {
- // TODO Auto-generated method stub
- return super.getAverageElectricInput();
- }
-
- @Override
- public long getAverageElectricOutput() {
- // TODO Auto-generated method stub
- return super.getAverageElectricOutput();
- }
-
- @Override
- public double getOutputEnergyUnitsPerTick() {
- // TODO Auto-generated method stub
- return super.getOutputEnergyUnitsPerTick();
- }
-
- @Override
- public double demandedEnergyUnits() {
- // TODO Auto-generated method stub
- return super.demandedEnergyUnits();
- }
-
- @Override
- public double injectEnergyUnits(ForgeDirection aDirection, double aAmount) {
- // TODO Auto-generated method stub
- return super.injectEnergyUnits(aDirection, aAmount);
- }
-
- @Override
- public boolean acceptsEnergyFrom(TileEntity aEmitter, ForgeDirection aDirection) {
- // TODO Auto-generated method stub
- return super.acceptsEnergyFrom(aEmitter, aDirection);
- }
-
- @Override
- public boolean emitsEnergyTo(TileEntity aReceiver, ForgeDirection aDirection) {
- // TODO Auto-generated method stub
- return super.emitsEnergyTo(aReceiver, aDirection);
- }
-
- @Override
- public double getOfferedEnergy() {
- // TODO Auto-generated method stub
- return super.getOfferedEnergy();
- }
-
- @Override
- public void drawEnergy(double amount) {
- // TODO Auto-generated method stub
- super.drawEnergy(amount);
- }
-
- @Override
- public int injectEnergy(ForgeDirection aForgeDirection, int aAmount) {
- // TODO Auto-generated method stub
- return super.injectEnergy(aForgeDirection, aAmount);
- }
-
- @Override
- public int addEnergy(int aEnergy) {
- // TODO Auto-generated method stub
- return super.addEnergy(aEnergy);
- }
-
- @Override
- public boolean isAddedToEnergyNet() {
- // TODO Auto-generated method stub
- return super.isAddedToEnergyNet();
- }
-
- @Override
- public int demandsEnergy() {
- // TODO Auto-generated method stub
- return super.demandsEnergy();
- }
-
- @Override
- public int getMaxSafeInput() {
- // TODO Auto-generated method stub
- return super.getMaxSafeInput();
- }
-
- @Override
- public int getMaxEnergyOutput() {
- // TODO Auto-generated method stub
- return super.getMaxEnergyOutput();
- }
-
- @Override
- public int injectEnergy(Direction aDirection, int aAmount) {
- // TODO Auto-generated method stub
- return super.injectEnergy(aDirection, aAmount);
- }
-
- @Override
- public boolean acceptsEnergyFrom(TileEntity aReceiver, Direction aDirection) {
- // TODO Auto-generated method stub
- return super.acceptsEnergyFrom(aReceiver, aDirection);
- }
-
- @Override
- public boolean emitsEnergyTo(TileEntity aReceiver, Direction aDirection) {
- // TODO Auto-generated method stub
- return super.emitsEnergyTo(aReceiver, aDirection);
- }
-
- @Override
- public boolean isUniversalEnergyStored(long aEnergyAmount) {
- // TODO Auto-generated method stub
- return super.isUniversalEnergyStored(aEnergyAmount);
- }
-
+ public BaseCustomPower_MTE() {
+ super();
+ Logger.INFO("Created new BaseCustomPower_MTE");
+ }
+
+ public boolean doesExplode() {
+ return false;
+ }
+
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (mMetaTileEntity == null) {
+ Logger.INFO("Bad Tile");
+ }
+ if (this.canAccessData()
+ && this.mMetaTileEntity.isElectric()
+ && this.inputEnergyFrom(aSide)
+ && aAmperage > 0L
+ && aVoltage > 0L
+ && this.getStoredEU() < this.getEUCapacity()
+ && this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()) {
+ Logger.INFO("Injecting Energy Units");
+ return super.injectEnergyUnits(aSide, aVoltage, aAmperage);
+ } else {
+ Logger.INFO("canAccessData(): " + canAccessData());
+ Logger.INFO("isElectric(): " + this.mMetaTileEntity.isElectric());
+ Logger.INFO("InputEnergyFromSide(" + aSide + "): " + this.inputEnergyFrom(aSide));
+ Logger.INFO("aAmperage: " + aAmperage);
+ Logger.INFO("aVoltage: " + aVoltage);
+ Logger.INFO("this.getStoredEU() < this.getEUCapacity(): " + (this.getStoredEU() < this.getEUCapacity()));
+ Logger.INFO("this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: "
+ + (this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()));
+ Logger.INFO("this.mMetaTileEntity.maxAmperesIn(): " + (this.mMetaTileEntity.maxAmperesIn()));
+ Logger.INFO("this.mAcceptedAmperes: " + (this.getInputAmperage()));
+ return 0L;
+ }
+ }
+
+ public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ Logger.INFO("Draining Energy Units 4");
+ if (this.canAccessData()
+ && this.mMetaTileEntity.isElectric()
+ && this.outputsEnergyTo(aSide)
+ && this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) {
+ if (this.decreaseStoredEU(aVoltage * aAmperage, false)) {
+ this.mAverageEUOutput[this.mAverageEUOutputIndex] =
+ (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex] + aVoltage * aAmperage);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ Logger.INFO("Draining Energy Units 3");
+ // TODO Auto-generated method stub
+ return super.decreaseStoredEnergyUnits(aEnergy, aIgnoreTooLessEnergy);
+ }
+
+ @Override
+ public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ // TODO Auto-generated method stub
+ return super.increaseStoredEnergyUnits(aEnergy, aIgnoreTooMuchEnergy);
+ }
+
+ @Override
+ public boolean inputEnergyFrom(byte aSide) {
+ // TODO Auto-generated method stub
+ return super.inputEnergyFrom(aSide);
+ }
+
+ @Override
+ public boolean outputsEnergyTo(byte aSide) {
+ Logger.INFO("Draining Energy Units 2");
+ // TODO Auto-generated method stub
+ return super.outputsEnergyTo(aSide);
+ }
+
+ @Override
+ public long getOutputAmperage() {
+ // TODO Auto-generated method stub
+ return super.getOutputAmperage();
+ }
+
+ @Override
+ public long getOutputVoltage() {
+ // TODO Auto-generated method stub
+ return super.getOutputVoltage();
+ }
+
+ @Override
+ public long getInputAmperage() {
+ // TODO Auto-generated method stub
+ return super.getInputAmperage();
+ }
+
+ @Override
+ public long getInputVoltage() {
+ // TODO Auto-generated method stub
+ return super.getInputVoltage();
+ }
+
+ @Override
+ public long getUniversalEnergyStored() {
+ // TODO Auto-generated method stub
+ return super.getUniversalEnergyStored();
+ }
+
+ @Override
+ public long getUniversalEnergyCapacity() {
+ // TODO Auto-generated method stub
+ return super.getUniversalEnergyCapacity();
+ }
+
+ @Override
+ public long getStoredEU() {
+ // TODO Auto-generated method stub
+ return super.getStoredEU();
+ }
+
+ @Override
+ public long getEUCapacity() {
+ // TODO Auto-generated method stub
+ return super.getEUCapacity();
+ }
+
+ @Override
+ public boolean setStoredEU(long aEnergy) {
+ // TODO Auto-generated method stub
+ return super.setStoredEU(aEnergy);
+ }
+
+ @Override
+ public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ Logger.INFO("Draining Energy Units 1");
+ // TODO Auto-generated method stub
+ return super.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy);
+ }
+
+ @Override
+ public boolean decreaseStoredSteam(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ // TODO Auto-generated method stub
+ return super.decreaseStoredSteam(aEnergy, aIgnoreTooLessEnergy);
+ }
+
+ @Override
+ public void doEnergyExplosion() {
+ // TODO Auto-generated method stub
+ super.doEnergyExplosion();
+ }
+
+ @Override
+ public void doExplosion(long aAmount) {
+ // TODO Auto-generated method stub
+ super.doExplosion(aAmount);
+ }
+
+ @Override
+ public byte getLightValue() {
+ // TODO Auto-generated method stub
+ return super.getLightValue();
+ }
+
+ @Override
+ public long getAverageElectricInput() {
+ // TODO Auto-generated method stub
+ return super.getAverageElectricInput();
+ }
+
+ @Override
+ public long getAverageElectricOutput() {
+ // TODO Auto-generated method stub
+ return super.getAverageElectricOutput();
+ }
+
+ @Override
+ public double getOutputEnergyUnitsPerTick() {
+ // TODO Auto-generated method stub
+ return super.getOutputEnergyUnitsPerTick();
+ }
+
+ @Override
+ public double demandedEnergyUnits() {
+ // TODO Auto-generated method stub
+ return super.demandedEnergyUnits();
+ }
+
+ @Override
+ public double injectEnergyUnits(ForgeDirection aDirection, double aAmount) {
+ // TODO Auto-generated method stub
+ return super.injectEnergyUnits(aDirection, aAmount);
+ }
+
+ @Override
+ public boolean acceptsEnergyFrom(TileEntity aEmitter, ForgeDirection aDirection) {
+ // TODO Auto-generated method stub
+ return super.acceptsEnergyFrom(aEmitter, aDirection);
+ }
+
+ @Override
+ public boolean emitsEnergyTo(TileEntity aReceiver, ForgeDirection aDirection) {
+ // TODO Auto-generated method stub
+ return super.emitsEnergyTo(aReceiver, aDirection);
+ }
+
+ @Override
+ public double getOfferedEnergy() {
+ // TODO Auto-generated method stub
+ return super.getOfferedEnergy();
+ }
+
+ @Override
+ public void drawEnergy(double amount) {
+ // TODO Auto-generated method stub
+ super.drawEnergy(amount);
+ }
+
+ @Override
+ public int injectEnergy(ForgeDirection aForgeDirection, int aAmount) {
+ // TODO Auto-generated method stub
+ return super.injectEnergy(aForgeDirection, aAmount);
+ }
+
+ @Override
+ public int addEnergy(int aEnergy) {
+ // TODO Auto-generated method stub
+ return super.addEnergy(aEnergy);
+ }
+
+ @Override
+ public boolean isAddedToEnergyNet() {
+ // TODO Auto-generated method stub
+ return super.isAddedToEnergyNet();
+ }
+
+ @Override
+ public int demandsEnergy() {
+ // TODO Auto-generated method stub
+ return super.demandsEnergy();
+ }
+
+ @Override
+ public int getMaxSafeInput() {
+ // TODO Auto-generated method stub
+ return super.getMaxSafeInput();
+ }
+
+ @Override
+ public int getMaxEnergyOutput() {
+ // TODO Auto-generated method stub
+ return super.getMaxEnergyOutput();
+ }
+
+ @Override
+ public int injectEnergy(Direction aDirection, int aAmount) {
+ // TODO Auto-generated method stub
+ return super.injectEnergy(aDirection, aAmount);
+ }
+
+ @Override
+ public boolean acceptsEnergyFrom(TileEntity aReceiver, Direction aDirection) {
+ // TODO Auto-generated method stub
+ return super.acceptsEnergyFrom(aReceiver, aDirection);
+ }
+
+ @Override
+ public boolean emitsEnergyTo(TileEntity aReceiver, Direction aDirection) {
+ // TODO Auto-generated method stub
+ return super.emitsEnergyTo(aReceiver, aDirection);
+ }
+
+ @Override
+ public boolean isUniversalEnergyStored(long aEnergyAmount) {
+ // TODO Auto-generated method stub
+ return super.isUniversalEnergyStored(aEnergyAmount);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
index e1b329c07f..332d911ac4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
@@ -5,10 +5,10 @@ import gregtech.api.enums.Textures.BlockIcons;
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 gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import java.util.Collection;
import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,297 +17,317 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank {
- public GTPP_MTE_BasicLosslessGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription,
- ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
- }
-
- public GTPP_MTE_BasicLosslessGenerator(int aID, String aName, String aNameRegional, int aTier,
- String[] aDescription, ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
- }
-
- public GTPP_MTE_BasicLosslessGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- public GTPP_MTE_BasicLosslessGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- ITexture[][][] rTextures = new ITexture[10][17][];
-
- for (byte i = -1; i < 16; ++i) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
-
- return rTextures;
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing
- ? 0
- : (aSide == GT_Utility.getOppositeSide(aFacing)
- ? 1
- : (aSide == 0 ? 2 : (aSide == 1 ? 3 : 4))))][aColorIndex + 1];
- }
-
- public String[] getDescription() {
- String[] desc = new String[this.mDescriptionArray.length + 1];
- System.arraycopy(this.mDescriptionArray, 0, desc, 0, this.mDescriptionArray.length);
- desc[this.mDescriptionArray.length] = "Fuel Efficiency: " + this.getEfficiency() + "%";
- return desc;
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- Logger.WARNING("Right Clicked");
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- } else {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
- }
-
- public ITexture[] getFront(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBack(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getTop(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getSides(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getFrontActive(byte aColor) {
- return this.getFront(aColor);
- }
-
- public ITexture[] getBackActive(byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottomActive(byte aColor) {
- return this.getBottom(aColor);
- }
-
- public ITexture[] getTopActive(byte aColor) {
- return this.getTop(aColor);
- }
-
- public ITexture[] getSidesActive(byte aColor) {
- return this.getSides(aColor);
- }
-
- public boolean isFacingValid(byte aSide) {
- return aSide > 1;
- }
-
- public boolean isSimpleMachine() {
- return false;
- }
-
- public boolean isValidSlot(int aIndex) {
- return aIndex < 2;
- }
-
- public boolean isEnetOutput() {
- return true;
- }
-
- public boolean isOutputFacing(byte aSide) {
- return true;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- public long maxEUOutput() {
- return this.getBaseMetaTileEntity().isAllowedToWork() ? GT_Values.V[this.mTier] : 0L;
- }
-
- public long maxEUStore() {
- return Math.max(this.getEUVar(), GT_Values.V[this.mTier] * 40L + this.getMinimumStoredEU());
- }
-
- public boolean doesFillContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public boolean doesEmptyContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public boolean canTankBeFilled() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public boolean canTankBeEmptied() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public boolean displaysItemStack() {
- return true;
- }
-
- public boolean displaysStackSize() {
- return false;
- }
-
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- int aVal = this.getFuelValue(aFluid);
- Logger.WARNING("Fuel Value: "+aVal);
- return aVal > 0;
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
- int tFuelValue;
- if (this.mFluid == null) {
- if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- } else {
- if (this.mInventory[this.getStackDisplaySlot()] == null) {
- this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- }
-
- this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
- + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
- }
- } else {
- tFuelValue = this.getFuelValue(this.mFluid);
- int tConsumed = this.consumedFluidPerOperation(this.mFluid);
- if (tFuelValue > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) {
- long tFluidAmountToUse = Math.min((long) (this.mFluid.amount / tConsumed),
- (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
- if (tFluidAmountToUse > 0L && aBaseMetaTileEntity
- .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) {
- PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
- this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed);
- }
- }
- }
-
- if (this.mInventory[this.getInputSlot()] != null
- && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20L
- + this.getMinimumStoredEU()
- && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
- tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
- if (tFuelValue > 0) {
- ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
- }
- }
- }
- }
-
- if (aBaseMetaTileEntity.isServerSide()) {
- Logger.WARNING("Ticking Servside");
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
- }
-
- }
-
- public abstract int getPollution();
-
- 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 && this.getRecipes() != null) {
- Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
- if (tRecipeList != null) {
- Logger.WARNING("Fuels: "+tRecipeList.size());
- Iterator<GT_Recipe> var4 = tRecipeList.iterator();
-
- while (var4.hasNext()) {
- GT_Recipe tFuel = (GT_Recipe) var4.next();
- FluidStack tLiquid;
- if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null
- && aLiquid.isFluidEqual(tLiquid)) {
- Logger.WARNING("Fuel Ok");
- return (int) ((long) tFuel.mSpecialValue * (long) this.getEfficiency()
- * (long) this.consumedFluidPerOperation(tLiquid) / 100L);
- }
- if ((tLiquid = tFuel.getRepresentativeFluidInput(0)) != null
- && aLiquid.isFluidEqual(tLiquid)) {
- Logger.WARNING("Fuel Ok");
- return (int) ((long) tFuel.mSpecialValue * (long) this.getEfficiency()
- * (long) this.consumedFluidPerOperation(tLiquid) / 100L);
- }
- }
- }
-
- return 0;
- } else {
- return 0;
- }
- }
-
- public int getFuelValue(ItemStack aStack) {
- if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) {
- Logger.WARNING("Fuel Item OK");
- GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE,
- (FluidStack[]) null, new ItemStack[]{aStack});
- return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.getEfficiency() / 100L) : 0;
- } else {
- return 0;
- }
- }
-
- public ItemStack getEmptyContainer(ItemStack aStack) {
- if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) {
- GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE,
- (FluidStack[]) null, new ItemStack[]{aStack});
- return tFuel != null
- ? GT_Utility.copy(new Object[]{tFuel.getOutput(0)})
- : GT_Utility.getContainerItem(aStack, true);
- } else {
- return null;
- }
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (this.getFuelValue(aStack) > 0
- || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
- }
-
- public int getCapacity() {
- return 16000;
- }
-
- public int getTankPressure() {
- return -100;
- }
-} \ No newline at end of file
+ public GTPP_MTE_BasicLosslessGenerator(
+ int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ }
+
+ public GTPP_MTE_BasicLosslessGenerator(
+ int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ }
+
+ public GTPP_MTE_BasicLosslessGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ public GTPP_MTE_BasicLosslessGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[10][17][];
+
+ for (byte i = -1; i < 16; ++i) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+
+ return rTextures;
+ }
+
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : (aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : (aSide == 0 ? 2 : (aSide == 1 ? 3 : 4))))][
+ aColorIndex + 1];
+ }
+
+ public String[] getDescription() {
+ String[] desc = new String[this.mDescriptionArray.length + 1];
+ System.arraycopy(this.mDescriptionArray, 0, desc, 0, this.mDescriptionArray.length);
+ desc[this.mDescriptionArray.length] = "Fuel Efficiency: " + this.getEfficiency() + "%";
+ return desc;
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ Logger.WARNING("Right Clicked");
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ } else {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return this.getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return this.getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return this.getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return this.getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ public boolean isFacingValid(byte aSide) {
+ return aSide > 1;
+ }
+
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 2;
+ }
+
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return true;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public long maxEUOutput() {
+ return this.getBaseMetaTileEntity().isAllowedToWork() ? GT_Values.V[this.mTier] : 0L;
+ }
+
+ public long maxEUStore() {
+ return Math.max(this.getEUVar(), GT_Values.V[this.mTier] * 40L + this.getMinimumStoredEU());
+ }
+
+ public boolean doesFillContainers() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ public boolean doesEmptyContainers() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ public boolean canTankBeFilled() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ public boolean canTankBeEmptied() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ int aVal = this.getFuelValue(aFluid);
+ Logger.WARNING("Fuel Value: " + aVal);
+ return aVal > 0;
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
+ int tFuelValue;
+ if (this.mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
+ this.mInventory[this.getStackDisplaySlot()] = null;
+ } else {
+ if (this.mInventory[this.getStackDisplaySlot()] == null) {
+ this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ }
+
+ this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
+ + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ tFuelValue = this.getFuelValue(this.mFluid);
+ int tConsumed = this.consumedFluidPerOperation(this.mFluid);
+ if (tFuelValue > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) {
+ long tFluidAmountToUse = Math.min(
+ (long) (this.mFluid.amount / tConsumed),
+ (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
+ if (tFluidAmountToUse > 0L
+ && aBaseMetaTileEntity.increaseStoredEnergyUnits(
+ tFluidAmountToUse * (long) tFuelValue, true)) {
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
+ this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed);
+ }
+ }
+ }
+
+ if (this.mInventory[this.getInputSlot()] != null
+ && aBaseMetaTileEntity.getUniversalEnergyStored()
+ < this.maxEUOutput() * 20L + this.getMinimumStoredEU()
+ && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
+ tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
+ if (tFuelValue > 0) {
+ ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
+ }
+ }
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ Logger.WARNING("Ticking Servside");
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.getUniversalEnergyStored()
+ >= this.maxEUOutput() + this.getMinimumStoredEU());
+ }
+ }
+
+ public abstract int getPollution();
+
+ 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 && this.getRecipes() != null) {
+ Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
+ if (tRecipeList != null) {
+ Logger.WARNING("Fuels: " + tRecipeList.size());
+ Iterator<GT_Recipe> var4 = tRecipeList.iterator();
+
+ while (var4.hasNext()) {
+ GT_Recipe tFuel = (GT_Recipe) var4.next();
+ FluidStack tLiquid;
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null
+ && aLiquid.isFluidEqual(tLiquid)) {
+ Logger.WARNING("Fuel Ok");
+ return (int) ((long) tFuel.mSpecialValue
+ * (long) this.getEfficiency()
+ * (long) this.consumedFluidPerOperation(tLiquid)
+ / 100L);
+ }
+ if ((tLiquid = tFuel.getRepresentativeFluidInput(0)) != null && aLiquid.isFluidEqual(tLiquid)) {
+ Logger.WARNING("Fuel Ok");
+ return (int) ((long) tFuel.mSpecialValue
+ * (long) this.getEfficiency()
+ * (long) this.consumedFluidPerOperation(tLiquid)
+ / 100L);
+ }
+ }
+ }
+
+ return 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) {
+ Logger.WARNING("Fuel Item OK");
+ GT_Recipe tFuel = this.getRecipes()
+ .findRecipe(
+ this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] {
+ aStack
+ });
+ return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.getEfficiency() / 100L) : 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public ItemStack getEmptyContainer(ItemStack aStack) {
+ if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) {
+ GT_Recipe tFuel = this.getRecipes()
+ .findRecipe(
+ this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] {
+ aStack
+ });
+ return tFuel != null
+ ? GT_Utility.copy(new Object[] {tFuel.getOutput(0)})
+ : GT_Utility.getContainerItem(aStack, true);
+ } else {
+ return null;
+ }
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)
+ && (this.getFuelValue(aStack) > 0
+ || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
+ }
+
+ public int getCapacity() {
+ return 16000;
+ }
+
+ public int getTankPressure() {
+ return -100;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
index 2eb1d36791..f6cf2391b3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
@@ -1,6 +1,7 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
-import gregtech.GT_Mod;
+import static gregtech.api.enums.GT_Values.V;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
@@ -16,6 +17,7 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.random.XSTR;
+import java.util.Arrays;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -26,10 +28,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
-import java.util.Arrays;
-
-import static gregtech.api.enums.GT_Values.V;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
@@ -40,14 +38,20 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
/**
* return values for checkRecipe()
*/
- protected static final int
- DID_NOT_FIND_RECIPE = 0,
+ protected static final int DID_NOT_FIND_RECIPE = 0,
FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
+
public static final int OTHER_SLOT_COUNT = 4;
public final ItemStack[] mOutputItems;
public final int mInputSlotCount, mAmperage;
- public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false;
+ 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;
public String mGUIName = "", mNEIName = "";
@@ -56,6 +60,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
* Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered
*/
protected GT_Recipe mLastRecipe = null;
+
private FluidStack mFluidOut;
/**
@@ -75,8 +80,26 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
* 12 = SideFacingPipeActive
* 13 = SideFacingPipeInactive
*/
- public GTPP_MTE_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);
+ public GTPP_MTE_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;
@@ -84,8 +107,26 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
mNEIName = aNEIName;
}
- public GTPP_MTE_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);
+ public GTPP_MTE_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;
@@ -93,7 +134,16 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
mNEIName = aNEIName;
}
- public GTPP_MTE_BasicMachine(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+ public GTPP_MTE_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)];
@@ -101,8 +151,17 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
mGUIName = aGUIName;
mNEIName = aNEIName;
}
-
- public GTPP_MTE_BasicMachine(String aName, int aTier, int aAmperage, String[] aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+
+ public GTPP_MTE_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)];
@@ -112,18 +171,18 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
protected boolean isValidMainFacing(byte aSide) {
- return aSide > 1;
- }
-
- public boolean setMainFacing(byte aSide){
- if (!isValidMainFacing(aSide)) return false;
- mMainFacing = aSide;
- if(getBaseMetaTileEntity().getFrontFacing() == mMainFacing){
- getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aSide));
- }
+ return aSide > 1;
+ }
+
+ public boolean setMainFacing(byte aSide) {
+ if (!isValidMainFacing(aSide)) return false;
+ mMainFacing = aSide;
+ if (getBaseMetaTileEntity().getFrontFacing() == mMainFacing) {
+ getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aSide));
+ }
onFacingChange();
onMachineBlockUpdate();
- return true;
+ return true;
}
@Override
@@ -132,10 +191,12 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
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]};
- }
+ 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);
@@ -157,8 +218,28 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
@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];
+ 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
@@ -183,7 +264,9 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean isValidSlot(int aIndex) {
- return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
+ return aIndex > 0
+ && super.isValidSlot(aIndex)
+ && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
}
@Override
@@ -213,7 +296,9 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean isLiquidInput(byte aSide) {
- return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing());
+ return aSide != mMainFacing
+ && (mAllowInputFromOutputSide
+ || aSide != getBaseMetaTileEntity().getFrontFacing());
}
@Override
@@ -304,7 +389,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean isFluidInputAllowed(FluidStack aFluid) {
- return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
+ return getFillableStack() != null
+ || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
}
@Override
@@ -372,7 +458,14 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@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 : "");
+ return new GT_GUIContainer_BasicMachine(
+ aPlayerInventory,
+ aBaseMetaTileEntity,
+ getLocalName(),
+ mGUIName,
+ GT_Utility.isStringValid(mNEIName)
+ ? mNEIName
+ : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "");
}
@Override
@@ -434,8 +527,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
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 (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break;
if (mOutputFluid != null)
if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy());
else if (mOutputFluid.isFluidEqual(getDrainableStack()))
@@ -451,8 +544,11 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
if (mProgresstime > 5) mStuttering = false;
XSTR aXSTR = new XSTR();
- //Dumb April Fools Shit
- // if(GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
+ // Dumb April Fools Shit
+ // if(GT_Mod.gregtechproxy.mAprilFool &&
+ // aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(),
+ // GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(),
+ // aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
} else {
if (!mStuttering) {
stutterProcess();
@@ -466,32 +562,65 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
boolean tRemovedOutputFluid = false;
- if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) {
+ 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);
+ int tFilledAmount = tTank.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
if (tFilledAmount > 0)
- tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), drain(tFilledAmount, true), true);
+ 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)) {
+ 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);
+ 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 (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 (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; i < j; i++)
@@ -538,7 +667,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true))
mInventory[tDisplayStackSlot] = null;
} else {
- mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize());
+ mInventory[tDisplayStackSlot] =
+ GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize());
}
}
}
@@ -584,14 +714,20 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
protected boolean canOutput(GT_Recipe aRecipe) {
- return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs));
+ 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())) {
+ 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;
}
@@ -599,7 +735,11 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
protected boolean canOutput(FluidStack aOutput) {
- return getDrainableStack() == null || aOutput == null || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0 || getDrainableStack().amount + aOutput.amount <= getCapacity()));
+ return getDrainableStack() == null
+ || aOutput == null
+ || (getDrainableStack().isFluidEqual(aOutput)
+ && (getDrainableStack().amount <= 0
+ || getDrainableStack().amount + aOutput.amount <= getCapacity()));
}
protected ItemStack getInputAt(int aIndex) {
@@ -699,13 +839,15 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public String[] getInfoData() {
- return new String[]{
- mNEIName,
- "Progress:", (mProgresstime / 20) + " secs",
- (mMaxProgresstime / 20) + " secs",
- "Stored Energy:",
- getBaseMetaTileEntity().getStoredEU() + "EU",
- getBaseMetaTileEntity().getEUCapacity() + "EU"};
+ return new String[] {
+ mNEIName,
+ "Progress:",
+ (mProgresstime / 20) + " secs",
+ (mMaxProgresstime / 20) + " secs",
+ "Stored Energy:",
+ getBaseMetaTileEntity().getStoredEU() + "EU",
+ getBaseMetaTileEntity().getEUCapacity() + "EU"
+ };
}
@Override
@@ -717,13 +859,17 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
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");
+ 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()));
+ return (aSide != mMainFacing
+ || GregTech_API.getCoverBehavior(aCoverID.toStack())
+ .isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity()));
}
@Override
@@ -733,8 +879,10 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (aSide == mMainFacing || aIndex < getInputSlot() || aIndex >= getInputSlot() + mInputSlotCount || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing()))
- return false;
+ if (aSide == mMainFacing
+ || aIndex < getInputSlot()
+ || aIndex >= getInputSlot() + mInputSlotCount
+ || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) return false;
for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i])) return i == aIndex;
return true;
@@ -760,25 +908,31 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
return checkRecipe(false);
}
- public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId){
- return //TODO check or get a better solution
- DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit") ||
- DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space") ||
- DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids") ||
- DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS") ||
- DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation");
+ public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId) {
+ return // TODO check or get a better solution
+ DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit")
+ || DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space")
+ || DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids")
+ || DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS")
+ || DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation");
}
-
/**
*
* @param skipOC disables OverclockedNess calculation and check - if you do you must implement your own method...
* @return
*/
- public int checkRecipe(boolean skipOC){
+ public int checkRecipe(boolean skipOC) {
GT_Recipe_Map tMap = getRecipeList();
if (tMap == null) return DID_NOT_FIND_RECIPE;
- GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
+ GT_Recipe tRecipe = tMap.findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ V[mTier],
+ new FluidStack[] {getFillableStack()},
+ getSpecialSlot(),
+ getAllInputs());
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
@@ -788,7 +942,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
if (tRecipe.mSpecialValue == -200 && (mCleanroom == null || mCleanroom.mEfficiency == 0))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs()))
+ if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs()))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < mOutputItems.length; i++)
if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i))
@@ -803,58 +957,76 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java
index 9c6840e33c..bbc2206784 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java
@@ -1,8 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
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;
@@ -25,19 +23,35 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
/**
* @param aInvSlotCount should be 3
*/
- public GTPP_MTE_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
+ public GTPP_MTE_BasicTank(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInvSlotCount,
+ String aDescription,
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GTPP_MTE_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription, ITexture... aTextures) {
+ public GTPP_MTE_BasicTank(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInvSlotCount,
+ String[] aDescription,
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GTPP_MTE_BasicTank(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GTPP_MTE_BasicTank(
+ String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
-
- public GTPP_MTE_BasicTank(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+
+ public GTPP_MTE_BasicTank(
+ String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -136,7 +150,8 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot()], true, true))
mInventory[getStackDisplaySlot()] = null;
} else {
- mInventory[getStackDisplaySlot()] = GT_Utility.getFluidDisplayStack(getDisplayedFluid(), displaysStackSize());
+ mInventory[getStackDisplaySlot()] =
+ GT_Utility.getFluidDisplayStack(getDisplayedFluid(), displaysStackSize());
}
}
@@ -145,15 +160,22 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
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)) {
+ if (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot(),
+ GT_Utility.getContainerItem(mInventory[getInputSlot()], true),
+ 1)) {
setFillableStack(tFluid.copy());
this.onEmptyingContainerWhenEmpty();
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)) {
+ 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);
}
@@ -163,7 +185,8 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
}
if (doesFillContainers()) {
- ItemStack tOutput = GT_Utility.fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true);
+ 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);
@@ -186,8 +209,11 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
@Override
public int fill(FluidStack aFluid, boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid))
- return 0;
+ 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()) {
@@ -205,8 +231,7 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
return getCapacity();
}
- if (!getFillableStack().isFluidEqual(aFluid))
- return 0;
+ if (!getFillableStack().isFluidEqual(aFluid)) return 0;
int space = getCapacity() - getFillableStack().amount;
if (aFluid.amount <= space) {
@@ -216,8 +241,7 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
}
return aFluid.amount;
}
- if (doFill)
- getFillableStack().amount = getCapacity();
+ if (doFill) getFillableStack().amount = getCapacity();
return space;
}
@@ -231,8 +255,7 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
}
int used = maxDrain;
- if (getDrainableStack().amount < used)
- used = getDrainableStack().amount;
+ if (getDrainableStack().amount < used) used = getDrainableStack().amount;
if (doDrain) {
getDrainableStack().amount -= used;
@@ -259,8 +282,8 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return aIndex == getInputSlot();
}
-
- protected void onEmptyingContainerWhenEmpty(){
- //Do nothing
+
+ protected void onEmptyingContainerWhenEmpty() {
+ // Do nothing
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java
index 8110037c46..e45588e126 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java
@@ -4,7 +4,6 @@ import static gregtech.api.enums.GT_Values.GT;
import gregtech.api.interfaces.ITexture;
import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.lib.CORE;
public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPower {
/**
@@ -25,17 +24,31 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo
*/
public final ITexture[][][] mTextures;
- public GTPP_MTE_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
+ public GTPP_MTE_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));
- mDescriptionArray = aDescription == null ? new String[0] : new String[]{aDescription};
+ mDescriptionArray = aDescription == null ? new String[0] : new String[] {aDescription};
mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : "";
// must always be the last call!
if (GT.isClientSide()) mTextures = getTextureSet(aTextures);
else mTextures = null;
}
- public GTPP_MTE_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription, ITexture... aTextures) {
+ public GTPP_MTE_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));
mDescriptionArray = aDescription == null ? new String[0] : aDescription;
@@ -46,15 +59,17 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo
else mTextures = null;
}
- public GTPP_MTE_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GTPP_MTE_TieredMachineBlock(
+ String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
mTier = (byte) aTier;
- mDescriptionArray = aDescription == null ? new String[0] : new String[]{aDescription};
+ mDescriptionArray = aDescription == null ? new String[0] : new String[] {aDescription};
mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : "";
mTextures = aTextures;
}
- public GTPP_MTE_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GTPP_MTE_TieredMachineBlock(
+ String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
mTier = (byte) aTier;
mDescriptionArray = aDescription == null ? new String[0] : aDescription;
@@ -79,14 +94,14 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo
@Override
public String[] getDescription() {
- AutoMap<String> aTooltip = new AutoMap<String>();
- String []s1 = null;
- s1 = new String[aTooltip.size()];
- int u = 0;
- for (String s : aTooltip) {
- s1[u] = s;
- }
- return s1;
+ AutoMap<String> aTooltip = new AutoMap<String>();
+ String[] s1 = null;
+ s1 = new String[aTooltip.size()];
+ int u = 0;
+ for (String s : aTooltip) {
+ s1[u] = s;
+ }
+ return s1;
}
/**
@@ -96,4 +111,4 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo
* @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/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java
index 31d24ff343..36185b638b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java
@@ -12,83 +12,79 @@ import net.minecraft.world.World;
public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase {
- public MetaTileEntityCustomPower(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
- super(aID, aBasicName, aRegionalName, aInvSlotCount);
- this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower());
- this.getBaseMetaTileEntity().setMetaTileID((short) aID);
- }
-
- public MetaTileEntityCustomPower(String aStack, int aInvSlotCount) {
- super(aStack, aInvSlotCount);
- }
-
- public long getMinimumStoredEU() {
- return 0L;
- }
-
- public boolean doesExplode() {
- return this.getBaseCustomMetaTileEntity().doesExplode();
- }
-
-
+ public MetaTileEntityCustomPower(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
+ super(aID, aBasicName, aRegionalName, aInvSlotCount);
+ this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower());
+ this.getBaseMetaTileEntity().setMetaTileID((short) aID);
+ }
- public void doExplosion(long aExplosionPower) {
-
- if (!doesExplode()) {
- Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]");
- return;
- }
-
- float tStrength = aExplosionPower < GT_Values.V[0]
- ? 1.0F
- : (aExplosionPower < GT_Values.V[1]
- ? 2.0F
- : (aExplosionPower < GT_Values.V[2]
- ? 3.0F
- : (aExplosionPower < GT_Values.V[3]
- ? 4.0F
- : (aExplosionPower < GT_Values.V[4]
- ? 5.0F
- : (aExplosionPower < GT_Values.V[4] * 2L
- ? 6.0F
- : (aExplosionPower < GT_Values.V[5]
- ? 7.0F
- : (aExplosionPower < GT_Values.V[6]
- ? 8.0F
- : (aExplosionPower < GT_Values.V[7]
- ? 9.0F
- : 10.0F))))))));
- int tX = this.getBaseMetaTileEntity().getXCoord();
- short tY = this.getBaseMetaTileEntity().getYCoord();
- int tZ = this.getBaseMetaTileEntity().getZCoord();
- World tWorld = this.getBaseMetaTileEntity().getWorld();
- GT_Utility.sendSoundToPlayers(tWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(209)), 1.0F, -1.0F,
- tX, tY, tZ);
- tWorld.setBlock(tX, tY, tZ, Blocks.air);
- if (GregTech_API.sMachineExplosions) {
- tWorld.createExplosion((Entity) null, (double) tX + 0.5D, (double) tY + 0.5D, (double) tZ + 0.5D, tStrength,
- true);
- }
+ public MetaTileEntityCustomPower(String aStack, int aInvSlotCount) {
+ super(aStack, aInvSlotCount);
+ }
- }
+ public long getMinimumStoredEU() {
+ return 0L;
+ }
- @Override
- public void onExplosion() {
- if (!doesExplode()) {
- Logger.INFO("Machine tried to explode, let's stop that. xo [onExplosion]");
- return;
- }
- super.onExplosion();
- }
+ public boolean doesExplode() {
+ return this.getBaseCustomMetaTileEntity().doesExplode();
+ }
- @Override
- public boolean isElectric() {
- return true;
- }
+ public void doExplosion(long aExplosionPower) {
- @Override
- public long getEUVar() {
- return super.getEUVar();
- }
+ if (!doesExplode()) {
+ Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]");
+ return;
+ }
+ float tStrength = aExplosionPower < GT_Values.V[0]
+ ? 1.0F
+ : (aExplosionPower < GT_Values.V[1]
+ ? 2.0F
+ : (aExplosionPower < GT_Values.V[2]
+ ? 3.0F
+ : (aExplosionPower < GT_Values.V[3]
+ ? 4.0F
+ : (aExplosionPower < GT_Values.V[4]
+ ? 5.0F
+ : (aExplosionPower < GT_Values.V[4] * 2L
+ ? 6.0F
+ : (aExplosionPower < GT_Values.V[5]
+ ? 7.0F
+ : (aExplosionPower < GT_Values.V[6]
+ ? 8.0F
+ : (aExplosionPower < GT_Values.V[7]
+ ? 9.0F
+ : 10.0F))))))));
+ int tX = this.getBaseMetaTileEntity().getXCoord();
+ short tY = this.getBaseMetaTileEntity().getYCoord();
+ int tZ = this.getBaseMetaTileEntity().getZCoord();
+ World tWorld = this.getBaseMetaTileEntity().getWorld();
+ GT_Utility.sendSoundToPlayers(
+ tWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(209)), 1.0F, -1.0F, tX, tY, tZ);
+ tWorld.setBlock(tX, tY, tZ, Blocks.air);
+ if (GregTech_API.sMachineExplosions) {
+ tWorld.createExplosion(
+ (Entity) null, (double) tX + 0.5D, (double) tY + 0.5D, (double) tZ + 0.5D, tStrength, true);
+ }
+ }
+
+ @Override
+ public void onExplosion() {
+ if (!doesExplode()) {
+ Logger.INFO("Machine tried to explode, let's stop that. xo [onExplosion]");
+ return;
+ }
+ super.onExplosion();
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public long getEUVar() {
+ return super.getEUVar();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java
index 3821b2a95c..ac069be52d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java
@@ -21,265 +21,282 @@ import net.minecraft.util.EnumChatFormatting;
public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock {
- public boolean mCharge = false;
- public boolean mDecharge = false;
- public int mBatteryCount = 0;
- public int mChargeableCount = 0;
- private long count = 0L;
- private long mStored = 0L;
- private long mMax = 0L;
-
- public GT_MetaTileEntity_BasicBreaker(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription, new ITexture[0]);
- }
-
- public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
- super(aName, aTier, aSlotCount, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) {
- super(aName, aTier, aSlotCount, aDescription, aTextures);
- }
-
- public String[] getDescription() {
- final String[] desc = new String[6];
- int tTier = this.mTier;
- desc[0] = "" + EnumChatFormatting.BOLD + "16 Fuse Slots";
- desc[1] = "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + (GT_Values.V[tTier]) + EnumChatFormatting.GRAY + " EU/t";
- desc[2] = "However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST" + EnumChatFormatting.GRAY + " be in a single Amp";
- desc[3] = "This machine can accept upto a single amp of " + GT_Values.VN[Math.min(tTier + 2, 15)] + " as a result";
- desc[4] = "Breaker Loss: " + EnumChatFormatting.RED + "" + (GT_Values.V[tTier] / 16) + EnumChatFormatting.GRAY + " EU/t";
- desc[5] = CORE.GT_Tooltip;
- return desc;
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- ITexture[][][] rTextures = new ITexture[2][17][];
-
- for (byte i = -1; i < 16; ++i) {
- rTextures[0][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i
- + 1], this.mInventory.length > 4 ? BlockIcons.OVERLAYS_ENERGY_IN_MULTI[Math.min(12, mTier)] : BlockIcons.OVERLAYS_ENERGY_IN[Math.min(12, mTier)]};
-
- rTextures[1][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i
- + 1], this.mInventory.length > 4 ? BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] : BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
- }
-
- return rTextures;
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_BasicBreaker(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mInventory.length);
- }
-
- public boolean isSimpleMachine() {
- return false;
- }
-
- public boolean isElectric() {
- return true;
- }
-
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- public boolean isEnetInput() {
- return true;
- }
-
- public boolean isEnetOutput() {
- return true;
- }
-
- public boolean isInputFacing(byte aSide) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- public boolean isOutputFacing(byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- public long getMinimumStoredEU() {
- return GT_Values.V[this.mTier] * 16L * 16;
- }
-
- public long maxEUStore() {
- return GT_Values.V[this.mTier] * 64L * 16;
- }
-
- public long maxEUInput() {
- return GT_Values.V[this.mTier] * 16;
- }
-
- public long maxEUOutput() {
- return GT_Values.V[this.mTier];
- }
-
- public long maxAmperesIn() {
- return 16;
- }
-
- public long maxAmperesOut() {
- return 16;
- }
-
- public int rechargerSlotStartIndex() {
- return 0;
- }
-
- public int dechargerSlotStartIndex() {
- return 0;
- }
-
- public int rechargerSlotCount() {
- return 0;
- }
-
- public int dechargerSlotCount() {
- return 0;
- }
-
- public int getProgresstime() {
- return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored();
- }
-
- public int maxProgresstime() {
- return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- public void saveNBTData(NBTTagCompound aNBT) {
- }
-
- public void loadNBTData(NBTTagCompound aNBT) {
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- else {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aBaseMetaTileEntity.isServerSide()) {
- /*this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L;
- this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L;
- this.mBatteryCount = 0;
- this.mChargeableCount = 0;
- ItemStack[] arg3 = this.mInventory;
- int arg4 = arg3.length;
-
- for (int arg5 = 0; arg5 < arg4; ++arg5) {
- ItemStack tStack = arg3[arg5];
- if (GT_ModHandler.isElectricItem(tStack, this.mTier)) {
- if (GT_ModHandler.isChargerItem(tStack)) {
- ++this.mBatteryCount;
- }
-
- ++this.mChargeableCount;
- }
- }*/
- }
-
- }
-
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return true;
- }
-
- public int getInventoryStackLimit() {
- return 1;
- }
-
- public long[] getStoredEnergy() {
- boolean scaleOverflow = false;
- boolean storedOverflow = false;
- long tScale = this.getBaseMetaTileEntity().getEUCapacity();
- long tStored = this.getBaseMetaTileEntity().getStoredEU();
- long tStep = 0L;
- if (this.mInventory != null) {
- ItemStack[] arg8 = this.mInventory;
- int arg9 = arg8.length;
-
- for (int arg10 = 0; arg10 < arg9; ++arg10) {
- ItemStack aStack = arg8[arg10];
- if (GT_ModHandler.isElectricItem(aStack)) {
- if (aStack.getItem() instanceof GT_MetaBase_Item) {
- Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack);
- if (stats != null) {
- if (stats[0].longValue() > 4611686018427387903L) {
- scaleOverflow = true;
- }
-
- tScale += stats[0].longValue();
- tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack);
- if (tStep > 4611686018427387903L) {
- storedOverflow = true;
- }
-
- tStored += tStep;
- }
- }
- else if (aStack.getItem() instanceof IElectricItem) {
- tStored += (long) ElectricItem.manager.getCharge(aStack);
- tScale += (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack);
- }
- }
- }
- }
-
- if (scaleOverflow) {
- tScale = Long.MAX_VALUE;
- }
-
- if (storedOverflow) {
- tStored = Long.MAX_VALUE;
- }
-
- return new long[]{tStored, tScale};
- }
-
- public String[] getInfoData() {
- return new String[]{"Tile Type: " + this.getTileEntityBaseType()};
- }
-
- public boolean isGivingInformation() {
- return true;
- }
-
- public boolean doesExplode() {
- return true;
- }
+ public boolean mCharge = false;
+ public boolean mDecharge = false;
+ public int mBatteryCount = 0;
+ public int mChargeableCount = 0;
+ private long count = 0L;
+ private long mStored = 0L;
+ private long mMax = 0L;
+
+ public GT_MetaTileEntity_BasicBreaker(
+ int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription, new ITexture[0]);
+ }
+
+ public GT_MetaTileEntity_BasicBreaker(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_BasicBreaker(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ public String[] getDescription() {
+ final String[] desc = new String[6];
+ int tTier = this.mTier;
+ desc[0] = "" + EnumChatFormatting.BOLD + "16 Fuse Slots";
+ desc[1] = "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + (GT_Values.V[tTier])
+ + EnumChatFormatting.GRAY + " EU/t";
+ desc[2] = "However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST"
+ + EnumChatFormatting.GRAY + " be in a single Amp";
+ desc[3] = "This machine can accept upto a single amp of " + GT_Values.VN[Math.min(tTier + 2, 15)]
+ + " as a result";
+ desc[4] = "Breaker Loss: " + EnumChatFormatting.RED + "" + (GT_Values.V[tTier] / 16) + EnumChatFormatting.GRAY
+ + " EU/t";
+ desc[5] = CORE.GT_Tooltip;
+ return desc;
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[2][17][];
+
+ for (byte i = -1; i < 16; ++i) {
+ rTextures[0][i + 1] = new ITexture[] {
+ BlockIcons.MACHINE_CASINGS[this.mTier][i + 1],
+ this.mInventory.length > 4
+ ? BlockIcons.OVERLAYS_ENERGY_IN_MULTI[Math.min(12, mTier)]
+ : BlockIcons.OVERLAYS_ENERGY_IN[Math.min(12, mTier)]
+ };
+
+ rTextures[1][i + 1] = new ITexture[] {
+ BlockIcons.MACHINE_CASINGS[this.mTier][i + 1],
+ this.mInventory.length > 4
+ ? BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ : BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]
+ };
+ }
+
+ return rTextures;
+ }
+
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_BasicBreaker(
+ this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mInventory.length);
+ }
+
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ public boolean isElectric() {
+ return true;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ public boolean isInputFacing(byte aSide) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ public long getMinimumStoredEU() {
+ return GT_Values.V[this.mTier] * 16L * 16;
+ }
+
+ public long maxEUStore() {
+ return GT_Values.V[this.mTier] * 64L * 16;
+ }
+
+ public long maxEUInput() {
+ return GT_Values.V[this.mTier] * 16;
+ }
+
+ public long maxEUOutput() {
+ return GT_Values.V[this.mTier];
+ }
+
+ public long maxAmperesIn() {
+ return 16;
+ }
+
+ public long maxAmperesOut() {
+ return 16;
+ }
+
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
+
+ public int rechargerSlotCount() {
+ return 0;
+ }
+
+ public int dechargerSlotCount() {
+ return 0;
+ }
+
+ public int getProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored();
+ }
+
+ public int maxProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {}
+
+ public void loadNBTData(NBTTagCompound aNBT) {}
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ } else {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isServerSide()) {
+ /*this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L;
+ this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L;
+ this.mBatteryCount = 0;
+ this.mChargeableCount = 0;
+ ItemStack[] arg3 = this.mInventory;
+ int arg4 = arg3.length;
+
+ for (int arg5 = 0; arg5 < arg4; ++arg5) {
+ ItemStack tStack = arg3[arg5];
+ if (GT_ModHandler.isElectricItem(tStack, this.mTier)) {
+ if (GT_ModHandler.isChargerItem(tStack)) {
+ ++this.mBatteryCount;
+ }
+
+ ++this.mChargeableCount;
+ }
+ }*/
+ }
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return true;
+ }
+
+ public int getInventoryStackLimit() {
+ return 1;
+ }
+
+ public long[] getStoredEnergy() {
+ boolean scaleOverflow = false;
+ boolean storedOverflow = false;
+ long tScale = this.getBaseMetaTileEntity().getEUCapacity();
+ long tStored = this.getBaseMetaTileEntity().getStoredEU();
+ long tStep = 0L;
+ if (this.mInventory != null) {
+ ItemStack[] arg8 = this.mInventory;
+ int arg9 = arg8.length;
+
+ for (int arg10 = 0; arg10 < arg9; ++arg10) {
+ ItemStack aStack = arg8[arg10];
+ if (GT_ModHandler.isElectricItem(aStack)) {
+ if (aStack.getItem() instanceof GT_MetaBase_Item) {
+ Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack);
+ if (stats != null) {
+ if (stats[0].longValue() > 4611686018427387903L) {
+ scaleOverflow = true;
+ }
+
+ tScale += stats[0].longValue();
+ tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack);
+ if (tStep > 4611686018427387903L) {
+ storedOverflow = true;
+ }
+
+ tStored += tStep;
+ }
+ } else if (aStack.getItem() instanceof IElectricItem) {
+ tStored += (long) ElectricItem.manager.getCharge(aStack);
+ tScale += (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack);
+ }
+ }
+ }
+ }
+
+ if (scaleOverflow) {
+ tScale = Long.MAX_VALUE;
+ }
+
+ if (storedOverflow) {
+ tStored = Long.MAX_VALUE;
+ }
+
+ return new long[] {tStored, tScale};
+ }
+
+ public String[] getInfoData() {
+ return new String[] {"Tile Type: " + this.getTileEntityBaseType()};
+ }
+
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ public boolean doesExplode() {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java
index 18665538d0..cf92bdc0ba 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java
@@ -5,34 +5,120 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
public class GT_MetaTileEntity_BasicMachine_GTPP_Recipe extends GT_MetaTileEntity_BasicMachine_GT_Recipe {
-
- public GT_MetaTileEntity_BasicMachine_GTPP_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, aDescription, aRecipes, aInputSlots, aOutputSlots, aTankCapacity,
- aGUIParameterA, aGUIParameterB, aGUIName, aSound, aSharedTank, aRequiresFluidForFiltering, aSpecialEffect,
- aOverlays, aRecipe);
- }
- public GT_MetaTileEntity_BasicMachine_GTPP_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, aDescription, aRecipes, aInputSlots, aOutputSlots, aTankCapacity, aAmperage, aGUIParameterA,
- aGUIParameterB, aTextures, aGUIName, aNEIName, aSound, aSharedTank, aRequiresFluidForFiltering, aSpecialEffect);
- }
-
- public GT_MetaTileEntity_BasicMachine_GTPP_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, aDescription[0], aRecipes, aInputSlots, aOutputSlots, aTankCapacity, aAmperage, aGUIParameterA,
- aGUIParameterB, aTextures, aGUIName, aNEIName, aSound, aSharedTank, aRequiresFluidForFiltering, aSpecialEffect);
- }
+ public GT_MetaTileEntity_BasicMachine_GTPP_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,
+ aDescription,
+ aRecipes,
+ aInputSlots,
+ aOutputSlots,
+ aTankCapacity,
+ aGUIParameterA,
+ aGUIParameterB,
+ aGUIName,
+ aSound,
+ aSharedTank,
+ aRequiresFluidForFiltering,
+ aSpecialEffect,
+ aOverlays,
+ aRecipe);
+ }
-
-
-
+ public GT_MetaTileEntity_BasicMachine_GTPP_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,
+ aDescription,
+ aRecipes,
+ aInputSlots,
+ aOutputSlots,
+ aTankCapacity,
+ aAmperage,
+ aGUIParameterA,
+ aGUIParameterB,
+ aTextures,
+ aGUIName,
+ aNEIName,
+ aSound,
+ aSharedTank,
+ aRequiresFluidForFiltering,
+ aSpecialEffect);
+ }
+ public GT_MetaTileEntity_BasicMachine_GTPP_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,
+ aDescription[0],
+ aRecipes,
+ aInputSlots,
+ aOutputSlots,
+ aTankCapacity,
+ aAmperage,
+ aGUIParameterA,
+ aGUIParameterB,
+ aTextures,
+ aGUIName,
+ aNEIName,
+ aSound,
+ aSharedTank,
+ aRequiresFluidForFiltering,
+ aSpecialEffect);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java
index aebf188fc0..02f0a3ff40 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java
@@ -19,51 +19,105 @@ import gtPlusPlus.core.lib.CORE;
@SuppressWarnings("deprecation")
public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine_GT_Recipe {
- private static final CustomIcon[] sDehydratorOverlays = new CustomIcon[10];
- static {
- sDehydratorOverlays[0] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT");
- sDehydratorOverlays[2] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM");
- sDehydratorOverlays[3] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE");
- sDehydratorOverlays[4] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT");
- sDehydratorOverlays[5] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE");
- sDehydratorOverlays[7] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM_ACTIVE");
- sDehydratorOverlays[8] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE_ACTIVE");
- sDehydratorOverlays[9] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT_ACTIVE");
- //3 8
- }
-
+ private static final CustomIcon[] sDehydratorOverlays = new CustomIcon[10];
+
+ static {
+ sDehydratorOverlays[0] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT");
+ sDehydratorOverlays[2] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM");
+ sDehydratorOverlays[3] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE");
+ sDehydratorOverlays[4] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT");
+ sDehydratorOverlays[5] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE");
+ sDehydratorOverlays[7] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM_ACTIVE");
+ sDehydratorOverlays[8] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE_ACTIVE");
+ sDehydratorOverlays[9] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT_ACTIVE");
+ // 3 8
+ }
+
private GT_Recipe_Map xRecipes;
- private int xTankCapacity;
+ private int xTankCapacity;
+
+ public GT_MetaTileEntity_Dehydrator(
+ int aID, String aName, String aNameRegional, int aTier, String aDescription, int aTankCapacity) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ aDescription,
+ GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes,
+ 2,
+ 9,
+ aTankCapacity,
+ 2,
+ 5,
+ "Dehydrator.png",
+ "UNBOXINATOR",
+ false,
+ false,
+ 0,
+ "",
+ null);
+ xRecipes = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes;
+ xTankCapacity = aTankCapacity;
+ }
- public GT_MetaTileEntity_Dehydrator(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aTankCapacity) {
- super(aID, aName, aNameRegional, aTier, aDescription, GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, aTankCapacity, 2, 5, "Dehydrator.png", "UNBOXINATOR", false, false, 0, "", null);
- xRecipes = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes;
- xTankCapacity = aTankCapacity;
- }
+ public GT_MetaTileEntity_Dehydrator(
+ String aName,
+ int aTier,
+ String[] aDescription,
+ GT_Recipe.GT_Recipe_Map aRecipes,
+ int aTankCapacity,
+ int aAmperage,
+ ITexture[][][] aTextures,
+ String aGUIName,
+ String aNEIName) {
+ super(
+ aName,
+ aTier,
+ aDescription,
+ aRecipes,
+ 2,
+ 9,
+ aTankCapacity,
+ aAmperage,
+ 2,
+ 5,
+ aTextures,
+ aGUIName,
+ aNEIName,
+ "",
+ false,
+ false,
+ 0);
+ }
- public GT_MetaTileEntity_Dehydrator(String aName, int aTier, String[] aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aTankCapacity, int aAmperage, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, aDescription, aRecipes, 2, 9, aTankCapacity, aAmperage, 2, 5, aTextures, aGUIName, aNEIName, "", false, false, 0);
-
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Dehydrator(
+ this.mName,
+ this.mTier,
+ this.mDescriptionArray,
+ this.xRecipes,
+ this.xTankCapacity,
+ this.mAmperage,
+ this.mTextures,
+ this.mGUIName,
+ this.mNEIName);
}
@Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Dehydrator(this.mName, this.mTier, this.mDescriptionArray, this.xRecipes, this.xTankCapacity, this.mAmperage, this.mTextures, this.mGUIName, this.mNEIName);
+ public String[] getDescription() {
+ String[] S = super.getDescription();
+ final String[] desc = new String[S.length + 1];
+ System.arraycopy(S, 0, desc, 0, S.length);
+ desc[S.length] = CORE.GT_Tooltip;
+ return desc;
}
-
- @Override
- public String[] getDescription() {
- String[] S = super.getDescription();
- final String[] desc = new String[S.length + 1];
- System.arraycopy(S, 0, desc, 0, S.length);
- desc[S.length] = CORE.GT_Tooltip;
- return desc;
- }
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[15][17][];
- for (byte i = -1; i < 16; i++) {
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[15][17][];
+ for (byte i = -1; i < 16; i++) {
rTextures[0][i + 1] = getSideFacingActive(i);
rTextures[1][i + 1] = getSideFacingInactive(i);
rTextures[2][i + 1] = getFrontFacingActive(i);
@@ -71,93 +125,113 @@ public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine
rTextures[4][i + 1] = getTopFacingActive(i);
rTextures[5][i + 1] = getTopFacingInactive(i);
rTextures[6][i + 1] = getBottomFacingActive(i);
- rTextures[7][i + 1] = getBottomFacingInactive(i);
+ rTextures[7][i + 1] = getBottomFacingInactive(i);
rTextures[8][i + 1] = getBottomFacingPipeActive(i);
rTextures[9][i + 1] = getBottomFacingPipeInactive(i);
rTextures[10][i + 1] = getTopFacingPipeActive(i);
rTextures[11][i + 1] = getTopFacingPipeInactive(i);
rTextures[12][i + 1] = getSideFacingPipeActive(i);
rTextures[13][i + 1] = getSideFacingPipeInactive(i);
- }
- return rTextures;
- }
-
-
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return super.getTexture(aBaseMetaTileEntity, aSide, aFacing, aColorIndex, aActive, aRedstone);
- //return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
- @Override
- public ITexture[] getFrontFacingInactive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[0])};
- }
-
- @Override
- public ITexture[] getBottomFacingInactive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[2])};
- }
-
- @Override
- public ITexture[] getTopFacingInactive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[3])};
- }
-
- @Override
- public ITexture[] getSideFacingInactive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[4])};
- }
-
- @Override
- public ITexture[] getFrontFacingActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[5])};
- }
-
- @Override
- public ITexture[] getBottomFacingActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[7])};
- }
-
- @Override
- public ITexture[] getTopFacingActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[8])};
- }
-
- @Override
- public ITexture[] getSideFacingActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[9])};
- }
-
- @Override
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return super.getTexture(aBaseMetaTileEntity, aSide, aFacing, aColorIndex, aActive, aRedstone);
+ // return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide ==
+ // GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
+ }
+
+ @Override
+ public ITexture[] getFrontFacingInactive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[0])
+ };
+ }
+
+ @Override
+ public ITexture[] getBottomFacingInactive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[2])
+ };
+ }
+
+ @Override
+ public ITexture[] getTopFacingInactive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[3])
+ };
+ }
+
+ @Override
+ public ITexture[] getSideFacingInactive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[4])
+ };
+ }
+
+ @Override
+ public ITexture[] getFrontFacingActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[5])
+ };
+ }
+
+ @Override
+ public ITexture[] getBottomFacingActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[7])
+ };
+ }
+
+ @Override
+ public ITexture[] getTopFacingActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[8])
+ };
+ }
+
+ @Override
+ public ITexture[] getSideFacingActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[9])
+ };
+ }
+
+ @Override
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
- @Override
+ @Override
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
- @Override
+ @Override
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
- @Override
+ @Override
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
- @Override
+ @Override
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
- @Override
+ @Override
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
- }
-
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java
index 79238240d2..007e6a1761 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java
@@ -2,14 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
-import java.util.Arrays;
-
-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 gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
@@ -23,9 +15,14 @@ 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 gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.random.XSTR;
+import java.util.Arrays;
+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.DimensionManager;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
@@ -41,14 +38,20 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
/**
* return values for checkRecipe()
*/
- protected static final int
- DID_NOT_FIND_RECIPE = 0,
+ protected static final int DID_NOT_FIND_RECIPE = 0,
FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
+
public static final int OTHER_SLOT_COUNT = 4;
public final ItemStack[] mOutputItems;
public final int mInputSlotCount, mAmperage;
- public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false;
+ 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;
public String mGUIName = "", mNEIName = "";
@@ -56,6 +59,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
* Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered
*/
protected GT_Recipe mLastRecipe = null;
+
private FluidStack mFluidOut;
/**
@@ -75,8 +79,26 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
* 12 = SideFacingPipeActive
* 13 = SideFacingPipeInactive
*/
- public GT_MetaTileEntity_DeluxeMachine(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);
+ public GT_MetaTileEntity_DeluxeMachine(
+ 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;
@@ -84,7 +106,16 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
mNEIName = aNEIName;
}
- public GT_MetaTileEntity_DeluxeMachine(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+ public GT_MetaTileEntity_DeluxeMachine(
+ 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)];
@@ -92,15 +123,15 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
mGUIName = aGUIName;
mNEIName = aNEIName;
}
-
- public boolean setMainFacing(byte aDirection){
- mMainFacing = aDirection;
- if(getBaseMetaTileEntity().getFrontFacing() == mMainFacing){
- getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aDirection));
- }
+
+ public boolean setMainFacing(byte aDirection) {
+ mMainFacing = aDirection;
+ if (getBaseMetaTileEntity().getFrontFacing() == mMainFacing) {
+ getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aDirection));
+ }
onFacingChange();
onMachineBlockUpdate();
- return true;
+ return true;
}
@Override
@@ -109,10 +140,12 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
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]};
- }
+ 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);
@@ -134,8 +167,28 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
@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];
+ 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
@@ -160,7 +213,9 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
@Override
public boolean isValidSlot(int aIndex) {
- return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
+ return aIndex > 0
+ && super.isValidSlot(aIndex)
+ && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
}
@Override
@@ -190,7 +245,9 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
@Override
public boolean isLiquidInput(byte aSide) {
- return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing());
+ return aSide != mMainFacing
+ && (mAllowInputFromOutputSide
+ || aSide != getBaseMetaTileEntity().getFrontFacing());
}
@Override
@@ -281,7 +338,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
@Override
public boolean isFluidInputAllowed(FluidStack aFluid) {
- return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
+ return getFillableStack() != null
+ || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
}
@Override
@@ -338,17 +396,17 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
if (aBaseMetaTileEntity.isClientSide()) return true;
- if(!false) {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
+ if (!false) {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
}
- for(byte i=0;i < 6; i++){
- if(aBaseMetaTileEntity.getAirAtSide(i)){
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
+ for (byte i = 0; i < 6; i++) {
+ if (aBaseMetaTileEntity.getAirAtSide(i)) {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
}
- GT_Utility.sendChatToPlayer(aPlayer,"No free Side!");
+ GT_Utility.sendChatToPlayer(aPlayer, "No free Side!");
return true;
}
@@ -359,7 +417,14 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
@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 : "");
+ return new GT_GUIContainer_BasicMachine(
+ aPlayerInventory,
+ aBaseMetaTileEntity,
+ getLocalName(),
+ mGUIName,
+ GT_Utility.isStringValid(mNEIName)
+ ? mNEIName
+ : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "");
}
@Override
@@ -408,8 +473,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
super.onPostTick(aBaseMetaTileEntity, aTick);
if (aBaseMetaTileEntity.isServerSide()) {
-
- //Utils.LOG_WARNING("Ticking Tank.");
+
+ // Utils.LOG_WARNING("Ticking Tank.");
mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3;
mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
@@ -423,8 +488,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
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 (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break;
if (mOutputFluid != null)
if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy());
else if (mOutputFluid.isFluidEqual(getDrainableStack()))
@@ -440,7 +505,15 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
if (mProgresstime > 5) mStuttering = false;
XSTR aXSTR = new XSTR();
- if(false && aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
+ if (false && aXSTR.nextInt(5000) == 0)
+ GT_Utility.sendSoundToPlayers(
+ aBaseMetaTileEntity.getWorld(),
+ GregTech_API.sSoundList.get(5),
+ 10.0F,
+ -1.0F,
+ aBaseMetaTileEntity.getXCoord(),
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getZCoord());
} else {
if (!mStuttering) {
stutterProcess();
@@ -455,46 +528,80 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
boolean tRemovedOutputFluid = false;
Logger.WARNING("R0");
- if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) {
+ 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);
+ int tFilledAmount = tTank.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
if (tFilledAmount > 0)
- tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), drain(tFilledAmount, true), true);
+ 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)) {
+ 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);
+ 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 (mOutputBlocked != 0)
+ if (isOutputEmpty()) mOutputBlocked = 0;
+ else mOutputBlocked++;
Logger.WARNING("R1");
if (allowToCheckRecipe()) {
Logger.WARNING("R2--------------------------------------------------");
- Logger.WARNING("R2: (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe())");
+ Logger.WARNING(
+ "R2: (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe())");
Logger.WARNING("R2--------------------------------------------------");
- Logger.WARNING("R2-mMaxProgresstime: "+mMaxProgresstime);
- Logger.WARNING("R2-isAllowedToWork(): "+aBaseMetaTileEntity.isAllowedToWork());
+ Logger.WARNING("R2-mMaxProgresstime: " + mMaxProgresstime);
+ Logger.WARNING("R2-isAllowedToWork(): " + aBaseMetaTileEntity.isAllowedToWork());
Logger.WARNING("R2--------------------------------------------------");
- Logger.WARNING("R2-tRemovedOutputFluid: "+tRemovedOutputFluid);
- Logger.WARNING("R2-tSucceeded: "+tSucceeded);
- Logger.WARNING("R2-hasInventoryBeenModified(): "+aBaseMetaTileEntity.hasInventoryBeenModified());
- Logger.WARNING("R2-(aTick % 600 == 0): "+(aTick % 600 == 0));
- Logger.WARNING("R2-hasWorkJustBeenEnabled(): "+aBaseMetaTileEntity.hasWorkJustBeenEnabled());
+ Logger.WARNING("R2-tRemovedOutputFluid: " + tRemovedOutputFluid);
+ Logger.WARNING("R2-tSucceeded: " + tSucceeded);
+ Logger.WARNING("R2-hasInventoryBeenModified(): " + aBaseMetaTileEntity.hasInventoryBeenModified());
+ Logger.WARNING("R2-(aTick % 600 == 0): " + (aTick % 600 == 0));
+ Logger.WARNING("R2-hasWorkJustBeenEnabled(): " + aBaseMetaTileEntity.hasWorkJustBeenEnabled());
Logger.WARNING("R2--------------------------------------------------");
- Logger.WARNING("R2-hasEnoughEnergyToCheckRecipe(): "+hasEnoughEnergyToCheckRecipe());
+ Logger.WARNING("R2-hasEnoughEnergyToCheckRecipe(): " + hasEnoughEnergyToCheckRecipe());
Logger.WARNING("R2--------------------------------------------------");
- if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) {
+ if (mMaxProgresstime <= 0
+ && aBaseMetaTileEntity.isAllowedToWork()
+ && (tRemovedOutputFluid
+ || tSucceeded
+ || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600 == 0
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled())
+ && hasEnoughEnergyToCheckRecipe()) {
Logger.WARNING("R3");
if (checkRecipe() == 2) {
if (mInventory[3] != null && mInventory[3].stackSize <= 0) mInventory[3] = null;
@@ -534,7 +641,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
if (mMainFacing >= 2 && !mHasBeenUpdated) {
mHasBeenUpdated = true;
- //getBaseMetaTileEntity().setFrontFacing(getBaseMetaTileEntity().getBackFacing());
+ // getBaseMetaTileEntity().setFrontFacing(getBaseMetaTileEntity().getBackFacing());
}
if (displaysInputFluid()) {
@@ -543,7 +650,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true))
mInventory[tDisplayStackSlot] = null;
} else {
- mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize());
+ mInventory[tDisplayStackSlot] =
+ GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize());
}
}
}
@@ -589,14 +697,20 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
protected boolean canOutput(GT_Recipe aRecipe) {
- return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs));
+ 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())) {
+ 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;
}
@@ -604,7 +718,11 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
protected boolean canOutput(FluidStack aOutput) {
- return getDrainableStack() == null || aOutput == null || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0 || getDrainableStack().amount + aOutput.amount <= getCapacity()));
+ return getDrainableStack() == null
+ || aOutput == null
+ || (getDrainableStack().isFluidEqual(aOutput)
+ && (getDrainableStack().amount <= 0
+ || getDrainableStack().amount + aOutput.amount <= getCapacity()));
}
protected ItemStack getInputAt(int aIndex) {
@@ -704,13 +822,15 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
@Override
public String[] getInfoData() {
- return new String[]{
- mNEIName,
- "Progress:", (mProgresstime / 20) + " secs",
- (mMaxProgresstime / 20) + " secs",
- "Stored Energy:",
- getBaseMetaTileEntity().getStoredEU() + "EU",
- getBaseMetaTileEntity().getEUCapacity() + "EU"};
+ return new String[] {
+ mNEIName,
+ "Progress:",
+ (mProgresstime / 20) + " secs",
+ (mMaxProgresstime / 20) + " secs",
+ "Stored Energy:",
+ getBaseMetaTileEntity().getStoredEU() + "EU",
+ getBaseMetaTileEntity().getEUCapacity() + "EU"
+ };
}
@Override
@@ -722,13 +842,19 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
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"));
+ 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()));
+ return (aSide != mMainFacing
+ || GregTech_API.getCoverBehavior(aCoverID.toStack())
+ .isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity()));
}
@Override
@@ -738,8 +864,10 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (aSide == mMainFacing || aIndex < getInputSlot() || aIndex >= getInputSlot() + mInputSlotCount || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing()))
- return false;
+ if (aSide == mMainFacing
+ || aIndex < getInputSlot()
+ || aIndex >= getInputSlot() + mInputSlotCount
+ || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) return false;
for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i])) return i == aIndex;
return true;
@@ -765,98 +893,123 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
return checkRecipe(false);
}
- public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId){
- return //TODO check or get a better solution
- DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit") ||
- DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space") ||
- DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids") ||
- DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS") ||
- DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation");
+ public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId) {
+ return // TODO check or get a better solution
+ DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit")
+ || DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space")
+ || DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids")
+ || DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS")
+ || DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation");
}
-
/**
*
* @param skipOC disables OverclockedNess calculation and check - if you do you must implement your own method...
* @return
*/
- public int checkRecipe(boolean skipOC){
+ public int checkRecipe(boolean skipOC) {
GT_Recipe_Map tMap = getRecipeList();
if (tMap == null) return DID_NOT_FIND_RECIPE;
- GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
+ GT_Recipe tRecipe = tMap.findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ V[mTier],
+ new FluidStack[] {getFillableStack()},
+ getSpecialSlot(),
+ getAllInputs());
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
- if (false && tRecipe.mSpecialValue == -100 &&
- !isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId))
+ if (false
+ && tRecipe.mSpecialValue == -100
+ && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
if (!canOutput(tRecipe)) {
mOutputBlocked++;
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
}
- if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs()))
+ if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs()))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < mOutputItems.length; i++)
if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i))
- mOutputItems[i] = tRecipe.getOutput(i);
+ mOutputItems[i] = tRecipe.getOutput(i);
mOutputFluid = tRecipe.getFluidOutput(0);
calculateOverclockedNess(tRecipe);
return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
}
public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
index 1e367d4f15..4bd4e30f30 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
@@ -1,18 +1,16 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.enums.ItemList;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_DeluxeTank;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_DeluxeTank;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
/**
@@ -22,324 +20,367 @@ import net.minecraftforge.fluids.FluidStack;
*/
public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_BasicTank {
- public FluidStack mFluid2;
-
- /**
- * @param aInvSlotCount should be 3
- */
- public GT_MetaTileEntity_DeluxeTank(final int aID, final String aName, final String aNameRegional, final int aTier, final int aInvSlotCount, final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_DeluxeTank(final String aName, final int aTier, final int aInvSlotCount, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex != this.getStackDisplaySlot();
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- if (this.mFluid != null) {
- aNBT.setTag("mFluid", this.mFluid.writeToNBT(new NBTTagCompound()));
- }
- if (this.mFluid2 != null) {
- aNBT.setTag("mFluid2", this.mFluid2.writeToNBT(new NBTTagCompound()));
- }
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- this.mFluid2 = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid2"));
- }
-
- @Override
- public abstract boolean doesFillContainers();
-
- @Override
- public abstract boolean doesEmptyContainers();
-
- @Override
- public abstract boolean canTankBeFilled();
-
- @Override
- public abstract boolean canTankBeEmptied();
-
- @Override
- public abstract boolean displaysItemStack();
-
- @Override
- public abstract boolean displaysStackSize();
-
- @Override
- public int getInputSlot() {
- return 0;
- }
-
- @Override
- public int getOutputSlot() {
- return 1;
- }
-
- @Override
- public int getStackDisplaySlot() {
- return 2;
- }
-
- public int getStackDisplaySlot2() {
- return 3;
- }
-
- @Override
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return true;
- }
-
- @Override
- public boolean isFluidChangingAllowed() {
- return true;
- }
-
- @Override
- public FluidStack getFillableStack() {
- return this.getFillableStackEx(1);
- }
-
- public FluidStack getFillableStackEx(final int stackID) {
- if (stackID <= 1){
- return this.mFluid;
- }
- return this.mFluid2;
- }
-
- @Override
- public FluidStack setFillableStack(final FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
- }
-
- public FluidStack setFillableStack2(final FluidStack aFluid) {
- this.mFluid2 = aFluid;
- return this.mFluid2;
- }
-
- @Override
- public FluidStack getDrainableStack() {
- return this.getDrainableStackEx(1);
- }
-
- public FluidStack getDrainableStackEx(final int stackID) {
- if (stackID <= 1){
- return this.mFluid;
- }
- return this.mFluid2;
- }
-
- @Override
- public FluidStack setDrainableStack(final FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
- }
-
- @Override
- public FluidStack getDisplayedFluid() {
- return this.getDrainableStack();
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_DeluxeTank(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_DeluxeTank(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
-
- @Override
- public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.isFluidChangingAllowed() && (this.getFillableStack() != null) && (this.getFillableStack().amount <= 0)) {
- this.setFillableStack(null);
- }
-
- if (this.displaysItemStack() && (this.getStackDisplaySlot() >= 0) && (this.getStackDisplaySlot() < this.mInventory.length)) {
- if (this.getDisplayedFluid() == null) {
- if (ItemList.Display_Fluid.isStackEqual(this.mInventory[this.getStackDisplaySlot()], true, true)) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- }
- } else {
- this.mInventory[this.getStackDisplaySlot()] = GT_Utility.getFluidDisplayStack(this.getDisplayedFluid(), this.displaysStackSize());
- }
- }
-
- if (this.displaysItemStack() && (this.getStackDisplaySlot2() >= 0) && (this.getStackDisplaySlot2() < this.mInventory.length)) {
- if (this.getDrainableStackEx(2) == null) {
- if (ItemList.Display_Fluid.isStackEqual(this.mInventory[this.getStackDisplaySlot2()], true, true)) {
- this.mInventory[this.getStackDisplaySlot2()] = null;
- }
- } else {
- this.mInventory[this.getStackDisplaySlot2()] = GT_Utility.getFluidDisplayStack(this.getDrainableStackEx(2), this.displaysStackSize());
- }
- }
-
- if (this.doesEmptyContainers()) {
- final FluidStack tFluid = GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true);
- if ((tFluid != null) && this.isFluidInputAllowed(tFluid)) {
-
- if (tFluid.isFluidEqual(this.getDrainableStackEx(1)) || (this.getDrainableStackEx(1) == null)){
- if (this.getFillableStackEx(1) == null) {
- if (this.isFluidInputAllowed(tFluid) && (tFluid.amount <= this.getCapacity())) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.setFillableStack(tFluid.copy());
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- }
- }
- } else {
- if (tFluid.isFluidEqual(this.getFillableStack()) && ((tFluid.amount + this.getFillableStack().amount) <= this.getCapacity())) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.getFillableStack().amount += tFluid.amount;
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- }
- }
- }
- }
- else if (tFluid.isFluidEqual(this.getDrainableStackEx(2)) || (this.getDrainableStackEx(2) == null)){
- if (this.getFillableStackEx(2) == null) {
- if (this.isFluidInputAllowed(tFluid) && (tFluid.amount <= this.getCapacity())) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.setFillableStack2(tFluid.copy());
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- }
- }
- } else {
- if (tFluid.isFluidEqual(this.getFillableStackEx(2)) && ((tFluid.amount + this.getFillableStackEx(2).amount) <= this.getCapacity())) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.getFillableStackEx(2).amount += tFluid.amount;
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- }
- }
- }
- }
- else {
- Logger.INFO("Something broke when trying to empty cells between two fluid tank areas.");
- }
- }
- }
-
- if (this.doesFillContainers()) {
- final ItemStack tOutput = GT_Utility.fillFluidContainer(this.getDrainableStack(), this.mInventory[this.getInputSlot()], false, true);
- if ((tOutput != null) && aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tOutput, 1)) {
- final FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- if (tFluid != null) {
- this.getDrainableStack().amount -= tFluid.amount;
- }
- if ((this.getDrainableStack().amount <= 0) && this.isFluidChangingAllowed()) {
- this.setDrainableStack(null);
- }
- }
- }
- }
- }
-
- @Override
- public FluidStack getFluid() {
- return this.getDrainableStack();
- }
-
- @Override
- public int getFluidAmount() {
- return this.getDrainableStack() != null ? this.getDrainableStack().amount : 0;
- }
-
- @Override
- public int fill(final FluidStack aFluid, final boolean doFill) {
- if ((aFluid == null) || (aFluid.getFluid().getID() <= 0) || (aFluid.amount <= 0) || !this.canTankBeFilled() || !this.isFluidInputAllowed(aFluid)) {
- return 0;
- }
-
- if ((this.getFillableStack() == null) || (this.getFillableStack().getFluid().getID() <= 0)) {
- if (aFluid.amount <= this.getCapacity()) {
- if (doFill) {
- this.setFillableStack(aFluid.copy());
- this.getBaseMetaTileEntity().markDirty();
- }
- return aFluid.amount;
- }
- if (doFill) {
- this.setFillableStack(aFluid.copy());
- this.getFillableStack().amount = this.getCapacity();
- this.getBaseMetaTileEntity().markDirty();
- }
- return this.getCapacity();
- }
-
- if (!this.getFillableStack().isFluidEqual(aFluid)) {
- return 0;
- }
-
- final int space = this.getCapacity() - this.getFillableStack().amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- this.getFillableStack().amount += aFluid.amount;
- this.getBaseMetaTileEntity().markDirty();
- }
- return aFluid.amount;
- }
- if (doFill) {
- this.getFillableStack().amount = this.getCapacity();
- }
- return space;
- }
-
- @Override
- public FluidStack drain(final int maxDrain, final boolean doDrain) {
- if ((this.getDrainableStack() == null) || !this.canTankBeEmptied()) {
- return null;
- }
- if ((this.getDrainableStack().amount <= 0) && this.isFluidChangingAllowed()) {
- this.setDrainableStack(null);
- this.getBaseMetaTileEntity().markDirty();
- return null;
- }
-
- int used = maxDrain;
- if (this.getDrainableStack().amount < used) {
- used = this.getDrainableStack().amount;
- }
-
- if (doDrain) {
- this.getDrainableStack().amount -= used;
- this.getBaseMetaTileEntity().markDirty();
- }
-
- final FluidStack drained = this.getDrainableStack().copy();
- drained.amount = used;
-
- if ((this.getDrainableStack().amount <= 0) && this.isFluidChangingAllowed()) {
- this.setDrainableStack(null);
- this.getBaseMetaTileEntity().markDirty();
- }
-
- return drained;
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return aIndex == this.getOutputSlot();
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return aIndex == this.getInputSlot();
- }
-} \ No newline at end of file
+ public FluidStack mFluid2;
+
+ /**
+ * @param aInvSlotCount should be 3
+ */
+ public GT_MetaTileEntity_DeluxeTank(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription,
+ final ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_DeluxeTank(
+ final String aName,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription,
+ final ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return aIndex != this.getStackDisplaySlot();
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ if (this.mFluid != null) {
+ aNBT.setTag("mFluid", this.mFluid.writeToNBT(new NBTTagCompound()));
+ }
+ if (this.mFluid2 != null) {
+ aNBT.setTag("mFluid2", this.mFluid2.writeToNBT(new NBTTagCompound()));
+ }
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ this.mFluid2 = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid2"));
+ }
+
+ @Override
+ public abstract boolean doesFillContainers();
+
+ @Override
+ public abstract boolean doesEmptyContainers();
+
+ @Override
+ public abstract boolean canTankBeFilled();
+
+ @Override
+ public abstract boolean canTankBeEmptied();
+
+ @Override
+ public abstract boolean displaysItemStack();
+
+ @Override
+ public abstract boolean displaysStackSize();
+
+ @Override
+ public int getInputSlot() {
+ return 0;
+ }
+
+ @Override
+ public int getOutputSlot() {
+ return 1;
+ }
+
+ @Override
+ public int getStackDisplaySlot() {
+ return 2;
+ }
+
+ public int getStackDisplaySlot2() {
+ return 3;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(final FluidStack aFluid) {
+ return true;
+ }
+
+ @Override
+ public boolean isFluidChangingAllowed() {
+ return true;
+ }
+
+ @Override
+ public FluidStack getFillableStack() {
+ return this.getFillableStackEx(1);
+ }
+
+ public FluidStack getFillableStackEx(final int stackID) {
+ if (stackID <= 1) {
+ return this.mFluid;
+ }
+ return this.mFluid2;
+ }
+
+ @Override
+ public FluidStack setFillableStack(final FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+ public FluidStack setFillableStack2(final FluidStack aFluid) {
+ this.mFluid2 = aFluid;
+ return this.mFluid2;
+ }
+
+ @Override
+ public FluidStack getDrainableStack() {
+ return this.getDrainableStackEx(1);
+ }
+
+ public FluidStack getDrainableStackEx(final int stackID) {
+ if (stackID <= 1) {
+ return this.mFluid;
+ }
+ return this.mFluid2;
+ }
+
+ @Override
+ public FluidStack setDrainableStack(final FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+ @Override
+ public FluidStack getDisplayedFluid() {
+ return this.getDrainableStack();
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_DeluxeTank(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_DeluxeTank(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
+ }
+
+ @Override
+ public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.isFluidChangingAllowed()
+ && (this.getFillableStack() != null)
+ && (this.getFillableStack().amount <= 0)) {
+ this.setFillableStack(null);
+ }
+
+ if (this.displaysItemStack()
+ && (this.getStackDisplaySlot() >= 0)
+ && (this.getStackDisplaySlot() < this.mInventory.length)) {
+ if (this.getDisplayedFluid() == null) {
+ if (ItemList.Display_Fluid.isStackEqual(this.mInventory[this.getStackDisplaySlot()], true, true)) {
+ this.mInventory[this.getStackDisplaySlot()] = null;
+ }
+ } else {
+ this.mInventory[this.getStackDisplaySlot()] =
+ GT_Utility.getFluidDisplayStack(this.getDisplayedFluid(), this.displaysStackSize());
+ }
+ }
+
+ if (this.displaysItemStack()
+ && (this.getStackDisplaySlot2() >= 0)
+ && (this.getStackDisplaySlot2() < this.mInventory.length)) {
+ if (this.getDrainableStackEx(2) == null) {
+ if (ItemList.Display_Fluid.isStackEqual(this.mInventory[this.getStackDisplaySlot2()], true, true)) {
+ this.mInventory[this.getStackDisplaySlot2()] = null;
+ }
+ } else {
+ this.mInventory[this.getStackDisplaySlot2()] =
+ GT_Utility.getFluidDisplayStack(this.getDrainableStackEx(2), this.displaysStackSize());
+ }
+ }
+
+ if (this.doesEmptyContainers()) {
+ final FluidStack tFluid = GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true);
+ if ((tFluid != null) && this.isFluidInputAllowed(tFluid)) {
+
+ if (tFluid.isFluidEqual(this.getDrainableStackEx(1)) || (this.getDrainableStackEx(1) == null)) {
+ if (this.getFillableStackEx(1) == null) {
+ if (this.isFluidInputAllowed(tFluid) && (tFluid.amount <= this.getCapacity())) {
+ if (aBaseMetaTileEntity.addStackToSlot(
+ this.getOutputSlot(),
+ GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true),
+ 1)) {
+ this.setFillableStack(tFluid.copy());
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ }
+ }
+ } else {
+ if (tFluid.isFluidEqual(this.getFillableStack())
+ && ((tFluid.amount + this.getFillableStack().amount) <= this.getCapacity())) {
+ if (aBaseMetaTileEntity.addStackToSlot(
+ this.getOutputSlot(),
+ GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true),
+ 1)) {
+ this.getFillableStack().amount += tFluid.amount;
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ }
+ }
+ }
+ } else if (tFluid.isFluidEqual(this.getDrainableStackEx(2))
+ || (this.getDrainableStackEx(2) == null)) {
+ if (this.getFillableStackEx(2) == null) {
+ if (this.isFluidInputAllowed(tFluid) && (tFluid.amount <= this.getCapacity())) {
+ if (aBaseMetaTileEntity.addStackToSlot(
+ this.getOutputSlot(),
+ GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true),
+ 1)) {
+ this.setFillableStack2(tFluid.copy());
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ }
+ }
+ } else {
+ if (tFluid.isFluidEqual(this.getFillableStackEx(2))
+ && ((tFluid.amount + this.getFillableStackEx(2).amount) <= this.getCapacity())) {
+ if (aBaseMetaTileEntity.addStackToSlot(
+ this.getOutputSlot(),
+ GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true),
+ 1)) {
+ this.getFillableStackEx(2).amount += tFluid.amount;
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ }
+ }
+ }
+ } else {
+ Logger.INFO("Something broke when trying to empty cells between two fluid tank areas.");
+ }
+ }
+ }
+
+ if (this.doesFillContainers()) {
+ final ItemStack tOutput = GT_Utility.fillFluidContainer(
+ this.getDrainableStack(), this.mInventory[this.getInputSlot()], false, true);
+ if ((tOutput != null) && aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tOutput, 1)) {
+ final FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ if (tFluid != null) {
+ this.getDrainableStack().amount -= tFluid.amount;
+ }
+ if ((this.getDrainableStack().amount <= 0) && this.isFluidChangingAllowed()) {
+ this.setDrainableStack(null);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public FluidStack getFluid() {
+ return this.getDrainableStack();
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return this.getDrainableStack() != null ? this.getDrainableStack().amount : 0;
+ }
+
+ @Override
+ public int fill(final FluidStack aFluid, final boolean doFill) {
+ if ((aFluid == null)
+ || (aFluid.getFluid().getID() <= 0)
+ || (aFluid.amount <= 0)
+ || !this.canTankBeFilled()
+ || !this.isFluidInputAllowed(aFluid)) {
+ return 0;
+ }
+
+ if ((this.getFillableStack() == null)
+ || (this.getFillableStack().getFluid().getID() <= 0)) {
+ if (aFluid.amount <= this.getCapacity()) {
+ if (doFill) {
+ this.setFillableStack(aFluid.copy());
+ this.getBaseMetaTileEntity().markDirty();
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ this.setFillableStack(aFluid.copy());
+ this.getFillableStack().amount = this.getCapacity();
+ this.getBaseMetaTileEntity().markDirty();
+ }
+ return this.getCapacity();
+ }
+
+ if (!this.getFillableStack().isFluidEqual(aFluid)) {
+ return 0;
+ }
+
+ final int space = this.getCapacity() - this.getFillableStack().amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ this.getFillableStack().amount += aFluid.amount;
+ this.getBaseMetaTileEntity().markDirty();
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ this.getFillableStack().amount = this.getCapacity();
+ }
+ return space;
+ }
+
+ @Override
+ public FluidStack drain(final int maxDrain, final boolean doDrain) {
+ if ((this.getDrainableStack() == null) || !this.canTankBeEmptied()) {
+ return null;
+ }
+ if ((this.getDrainableStack().amount <= 0) && this.isFluidChangingAllowed()) {
+ this.setDrainableStack(null);
+ this.getBaseMetaTileEntity().markDirty();
+ return null;
+ }
+
+ int used = maxDrain;
+ if (this.getDrainableStack().amount < used) {
+ used = this.getDrainableStack().amount;
+ }
+
+ if (doDrain) {
+ this.getDrainableStack().amount -= used;
+ this.getBaseMetaTileEntity().markDirty();
+ }
+
+ final FluidStack drained = this.getDrainableStack().copy();
+ drained.amount = used;
+
+ if ((this.getDrainableStack().amount <= 0) && this.isFluidChangingAllowed()) {
+ this.setDrainableStack(null);
+ this.getBaseMetaTileEntity().markDirty();
+ }
+
+ return drained;
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return aIndex == this.getOutputSlot();
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return aIndex == this.getInputSlot();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java
index 02b7a03f3b..6a49e9b84d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java
@@ -11,100 +11,112 @@ import net.minecraftforge.fluids.Fluid;
public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_FluidGenerator {
- public GT_MetaTileEntity_Hatch_AirIntake(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier);
- }
-
- public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
-
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_AirIntake(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public String[] getCustomTooltip() {
- String[] aTooltip = new String[3];
- aTooltip[0] = "DO NOT OBSTRUCT THE INPUT!";
- aTooltip[1] = "Draws in Air from the surrounding environment";
- aTooltip[2] = "Creates "+getAmountOfFluidToGenerate()+"L of Air every "+getMaxTickTime()+" ticks";
- return aTooltip;
- }
-
- @Override
- public Fluid getFluidToGenerate() {
- return FluidUtils.getAir(1).getFluid();
- }
-
- @Override
- public int getAmountOfFluidToGenerate() {
- return 1000;
- }
-
- @Override
- public int getMaxTickTime() {
- return 4;
- }
-
- @Override
- public int getCapacity() {
- return 128000;
- }
-
- @Override
- public boolean doesHatchMeetConditionsToGenerate() {
- return this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing());
- }
-
- @Override
- public void generateParticles(World aWorld, String name) {
- if (this.getBaseMetaTileEntity().isServerSide()) {
- return;
- }
- final float ran1 = GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat();
- float ran2 = 0.0f;
- float ran3 = 0.0f;
- ran2 = GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat();
- ran3 = GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat();
-
- final IGregTechTileEntity aMuffler = this.getBaseMetaTileEntity();
- final ForgeDirection aDir = ForgeDirection.getOrientation((int) aMuffler.getFrontFacing());
- final float xPos = aDir.offsetX * 0.76f + aMuffler.getXCoord() + 0.25f;
- float yPos = aDir.offsetY * 0.76f + aMuffler.getYCoord() + 0.65f;
- final float zPos = aDir.offsetZ * 0.76f + aMuffler.getZCoord() + 0.25f;
- float ySpd = aDir.offsetY * 0.1f + 0.2f + 0.1f * GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat();
- float xSpd;
- float zSpd;
- if (aDir.offsetY == -1) {
- //Logger.INFO("Y = -1");
- final float temp = GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 2.0f * CORE.PI;
- xSpd = (float) Math.sin(temp) * 0.1f;
- zSpd = (float) Math.cos(temp) * 0.1f;
- ySpd = -ySpd;
- yPos = yPos - 0.8f;
- }
- else {
- xSpd = aDir.offsetX * (0.1f + 0.2f * GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat());
- zSpd = aDir.offsetZ * (0.1f + 0.2f * GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat());
-
- xSpd = -xSpd;
- zSpd = -zSpd;
- }
-
- aWorld.spawnParticle(name, (double) (xPos + ran1 * 0.5f),
- (double) (yPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f),
- (double) (zPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f), (double) xSpd,
- (double) -ySpd, (double) zSpd);
- aWorld.spawnParticle(name, (double) (xPos + ran2 * 0.5f),
- (double) (yPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f),
- (double) (zPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f), (double) xSpd,
- (double) -ySpd, (double) zSpd);
- aWorld.spawnParticle(name, (double) (xPos + ran3 * 0.5f),
- (double) (yPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f),
- (double) (zPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f), (double) xSpd,
- (double) -ySpd, (double) zSpd);
- }
-
+ public GT_MetaTileEntity_Hatch_AirIntake(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ }
+
+ public GT_MetaTileEntity_Hatch_AirIntake(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_AirIntake(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public String[] getCustomTooltip() {
+ String[] aTooltip = new String[3];
+ aTooltip[0] = "DO NOT OBSTRUCT THE INPUT!";
+ aTooltip[1] = "Draws in Air from the surrounding environment";
+ aTooltip[2] = "Creates " + getAmountOfFluidToGenerate() + "L of Air every " + getMaxTickTime() + " ticks";
+ return aTooltip;
+ }
+
+ @Override
+ public Fluid getFluidToGenerate() {
+ return FluidUtils.getAir(1).getFluid();
+ }
+
+ @Override
+ public int getAmountOfFluidToGenerate() {
+ return 1000;
+ }
+
+ @Override
+ public int getMaxTickTime() {
+ return 4;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 128000;
+ }
+
+ @Override
+ public boolean doesHatchMeetConditionsToGenerate() {
+ return this.getBaseMetaTileEntity()
+ .getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing());
+ }
+
+ @Override
+ public void generateParticles(World aWorld, String name) {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ return;
+ }
+ final float ran1 = GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat();
+ float ran2 = 0.0f;
+ float ran3 = 0.0f;
+ ran2 = GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat();
+ ran3 = GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat();
+
+ final IGregTechTileEntity aMuffler = this.getBaseMetaTileEntity();
+ final ForgeDirection aDir = ForgeDirection.getOrientation((int) aMuffler.getFrontFacing());
+ final float xPos = aDir.offsetX * 0.76f + aMuffler.getXCoord() + 0.25f;
+ float yPos = aDir.offsetY * 0.76f + aMuffler.getYCoord() + 0.65f;
+ final float zPos = aDir.offsetZ * 0.76f + aMuffler.getZCoord() + 0.25f;
+ float ySpd = aDir.offsetY * 0.1f + 0.2f + 0.1f * GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat();
+ float xSpd;
+ float zSpd;
+ if (aDir.offsetY == -1) {
+ // Logger.INFO("Y = -1");
+ final float temp = GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 2.0f * CORE.PI;
+ xSpd = (float) Math.sin(temp) * 0.1f;
+ zSpd = (float) Math.cos(temp) * 0.1f;
+ ySpd = -ySpd;
+ yPos = yPos - 0.8f;
+ } else {
+ xSpd = aDir.offsetX * (0.1f + 0.2f * GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat());
+ zSpd = aDir.offsetZ * (0.1f + 0.2f * GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat());
+
+ xSpd = -xSpd;
+ zSpd = -zSpd;
+ }
+
+ aWorld.spawnParticle(
+ name,
+ (double) (xPos + ran1 * 0.5f),
+ (double) (yPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f),
+ (double) (zPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f),
+ (double) xSpd,
+ (double) -ySpd,
+ (double) zSpd);
+ aWorld.spawnParticle(
+ name,
+ (double) (xPos + ran2 * 0.5f),
+ (double) (yPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f),
+ (double) (zPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f),
+ (double) xSpd,
+ (double) -ySpd,
+ (double) zSpd);
+ aWorld.spawnParticle(
+ name,
+ (double) (xPos + ran3 * 0.5f),
+ (double) (yPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f),
+ (double) (zPos + GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat() * 0.5f),
+ (double) xSpd,
+ (double) -ySpd,
+ (double) zSpd);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java
index 45611d9e05..ca640b7a1d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java
@@ -6,27 +6,27 @@ import gregtech.api.metatileentity.MetaTileEntity;
public class GT_MetaTileEntity_Hatch_AirIntake_Extreme extends GT_MetaTileEntity_Hatch_AirIntake {
- public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier);
- }
-
- public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
-
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_AirIntake_Extreme(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public int getAmountOfFluidToGenerate() {
- return 8000;
- }
-
- @Override
- public int getCapacity() {
- return 256000;
- }
-
+ public GT_MetaTileEntity_Hatch_AirIntake_Extreme(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ }
+
+ public GT_MetaTileEntity_Hatch_AirIntake_Extreme(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_AirIntake_Extreme(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public int getAmountOfFluidToGenerate() {
+ return 8000;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 256000;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java
index 5347b2e4f7..b2ea5a62ec 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java
@@ -19,38 +19,43 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch {
-
+
public GT_Recipe_Map mRecipeMap = null;
-
+
public BlockPos mControllerLocation;
public GT_MetaTileEntity_Hatch_ControlCore(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Core determines maximum tier machine will operate at");
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ getSlots(aTier),
+ "Core determines maximum tier machine will operate at");
}
public GT_MetaTileEntity_Hatch_ControlCore(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription, aTextures);
}
-
- public GT_MetaTileEntity_Hatch_ControlCore(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+
+ public GT_MetaTileEntity_Hatch_ControlCore(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription[0], aTextures);
}
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- CORE.GT_Tooltip};
- }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, CORE.GT_Tooltip};
+ }
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core)};
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core)};
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core)};
}
@Override
@@ -75,7 +80,8 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_ControlCore(mName, mTier, StaticFields59.getDescriptionArray(this), mTextures);
+ return new GT_MetaTileEntity_Hatch_ControlCore(
+ mName, mTier, StaticFields59.getDescriptionArray(this), mTextures);
}
@Override
@@ -87,12 +93,12 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch
@Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
+ return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
}
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, "Control Core Module");
+ return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, "Control Core Module");
}
@Override
@@ -111,8 +117,17 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch
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);
+ 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);
}
}
@@ -123,26 +138,25 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aSide == getBaseMetaTileEntity().getFrontFacing() && (aStack != null && aStack.getItem() instanceof ItemControlCore);
- }
-
- public boolean setOwner(TileEntity aTileEntity) {
- if (mControllerLocation != null) {
- return false;
- }
- else {
- mControllerLocation = new BlockPos(aTileEntity);
- return true;
- }
- }
-
- public boolean setOwner(IGregTechTileEntity aTileEntity) {
- if (mControllerLocation != null) {
- return false;
- }
- else {
- mControllerLocation = new BlockPos(aTileEntity);
- return true;
- }
- }
+ return aSide == getBaseMetaTileEntity().getFrontFacing()
+ && (aStack != null && aStack.getItem() instanceof ItemControlCore);
+ }
+
+ public boolean setOwner(TileEntity aTileEntity) {
+ if (mControllerLocation != null) {
+ return false;
+ } else {
+ mControllerLocation = new BlockPos(aTileEntity);
+ return true;
+ }
+ }
+
+ public boolean setOwner(IGregTechTileEntity aTileEntity) {
+ if (mControllerLocation != null) {
+ return false;
+ } else {
+ mControllerLocation = new BlockPos(aTileEntity);
+ return true;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java
index 39f477b173..8405e2b09c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java
@@ -1,84 +1,85 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.interfaces.ITexture;
-
public class GT_MetaTileEntity_Hatch_DynamoBuffer extends GT_MetaTileEntity_Hatch_Dynamo {
- public GT_MetaTileEntity_Hatch_DynamoBuffer(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
- super(aID, aName, aNameRegional, aTier);
- }
+ public GT_MetaTileEntity_Hatch_DynamoBuffer(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ }
+
+ public GT_MetaTileEntity_Hatch_DynamoBuffer(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
- public GT_MetaTileEntity_Hatch_DynamoBuffer(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
+ /*public GT_MetaTileEntity_Hatch_DynamoBuffer(final String aName, final int aTier, final String[] aDescription,
+ final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }*/
- /*public GT_MetaTileEntity_Hatch_DynamoBuffer(final String aName, final int aTier, final String[] aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }*/
+ public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier]};
+ }
- public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier]};
- }
+ public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier]};
+ }
- public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier]};
- }
+ @Override
+ public long getMinimumStoredEU() {
+ return 0L;
+ }
- @Override
- public long getMinimumStoredEU() {
- return 0L;
- }
+ @Override
+ public long maxEUStore() {
+ return 512L + GT_Values.V[this.mTier + 1] * 2048L;
+ }
- @Override
- public long maxEUStore() {
- return 512L + GT_Values.V[this.mTier + 1] * 2048L;
- }
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return (MetaTileEntity)
+ new GT_MetaTileEntity_Hatch_DynamoBuffer(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return (MetaTileEntity) new GT_MetaTileEntity_Hatch_DynamoBuffer(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
+ @Override
+ public String[] getDescription() {
+ String[] g;
+ if (CORE.GTNH || (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechVersionAsInt() >= 50932)) {
+ g = new String[] {
+ "Dynamo with internal storage and additional Amp capacity",
+ "Does not accept more than " + (this.maxEUOutput() * this.maxAmperesIn()) + "EU/t as input",
+ CORE.GT_Tooltip
+ };
- @Override
- public String[] getDescription() {
- String[] g;
- if (CORE.GTNH || (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechVersionAsInt() >= 50932)) {
- g = new String[]{
- "Dynamo with internal storage and additional Amp capacity",
- "Does not accept more than "+(this.maxEUOutput() * this.maxAmperesIn())+"EU/t as input",
- CORE.GT_Tooltip};
-
- }
- else {
- g = new String[]{
- "Dynamo with internal storage and additional Amp capacity",
- "Stores "+maxEUStore()+"EU",
- "Amperage In: 4",
- "Amperage Out: 4",
- "Does not accept more than "+(this.maxEUOutput() * this.maxAmperesIn())+"EU/t as input",
- "Large Turbines only supply 1A to this, other Multiblocks can inject more amps",
- CORE.GT_Tooltip};
- }
- return g;
- }
+ } else {
+ g = new String[] {
+ "Dynamo with internal storage and additional Amp capacity",
+ "Stores " + maxEUStore() + "EU",
+ "Amperage In: 4",
+ "Amperage Out: 4",
+ "Does not accept more than " + (this.maxEUOutput() * this.maxAmperesIn()) + "EU/t as input",
+ "Large Turbines only supply 1A to this, other Multiblocks can inject more amps",
+ CORE.GT_Tooltip
+ };
+ }
+ return g;
+ }
- @Override
- public long maxAmperesIn() {
- return 4;
- }
+ @Override
+ public long maxAmperesIn() {
+ return 4;
+ }
- @Override
- public long maxAmperesOut() {
- return 4;
- }
-} \ No newline at end of file
+ @Override
+ public long maxAmperesOut() {
+ return 4;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java
index 67a6fc7aeb..500f1945bc 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import java.util.ArrayList;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -15,166 +13,172 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_DataHatch;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_DataHatch;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
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_Hatch_ElementalDataOrbHolder extends GT_MetaTileEntity_Hatch {
- public GT_Recipe_Map mRecipeMap = null;
-
- public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 17, new String[]{
- "Holds Data Orbs for the Elemental Duplicator",
- "Can insert/extract the circuit slot",
- "Use Circuit to select a slot (1-16)",
- CORE.GT_Tooltip
- });
- }
-
- public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 17, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 17, aDescription, aTextures);
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb)};
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb)};
- }
-
- @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_ElementalDataOrbHolder(mName, mTier, mDescriptionArray, 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) {
- return new CONTAINER_DataHatch(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_DataHatch(aPlayerInventory, aBaseMetaTileEntity, "Data Orb Repository");
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
- fillStacksIntoFirstSlots();
- }
- }
-
- public void updateSlots() {
- for (int i = 0; i < mInventory.length-1; i++)
- if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null;
- fillStacksIntoFirstSlots();
- }
-
- protected void fillStacksIntoFirstSlots() {
- for (int i = 0; i < mInventory.length-1; i++) {
- if (mInventory[i] != null && mInventory[i].stackSize <= 0) {
- mInventory[i] = null;
- }
- }
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
-
- }
-
- public String trans(String aKey, String aEnglish) {
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- Logger.INFO("Checking if we can pull "+aStack.getDisplayName()+" from slot "+aIndex);
- if (aIndex == mInventory.length-1 && ItemUtils.isControlCircuit(aStack) && aSide == getBaseMetaTileEntity().getFrontFacing()) {
- return true;
- }
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- Logger.INFO("Checking if we can put "+aStack.getDisplayName()+" into slot "+aIndex);
- if (aIndex == mInventory.length-1 && ItemUtils.isControlCircuit(aStack) && aSide == getBaseMetaTileEntity().getFrontFacing()) {
- return true;
- }
- return false;
- }
-
- public ArrayList<ItemStack> getInventory(){
- ArrayList<ItemStack> aContents = new ArrayList<ItemStack>();
- for (int i = getBaseMetaTileEntity().getSizeInventory() - 2; i >= 0; i--) {
+ public GT_Recipe_Map mRecipeMap = null;
+
+ public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 17, new String[] {
+ "Holds Data Orbs for the Elemental Duplicator",
+ "Can insert/extract the circuit slot",
+ "Use Circuit to select a slot (1-16)",
+ CORE.GT_Tooltip
+ });
+ }
+
+ public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 17, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 17, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb)};
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb)};
+ }
+
+ @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_ElementalDataOrbHolder(mName, mTier, mDescriptionArray, 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) {
+ return new CONTAINER_DataHatch(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_DataHatch(aPlayerInventory, aBaseMetaTileEntity, "Data Orb Repository");
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ fillStacksIntoFirstSlots();
+ }
+ }
+
+ public void updateSlots() {
+ for (int i = 0; i < mInventory.length - 1; i++)
+ if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null;
+ fillStacksIntoFirstSlots();
+ }
+
+ protected void fillStacksIntoFirstSlots() {
+ for (int i = 0; i < mInventory.length - 1; i++) {
+ if (mInventory[i] != null && mInventory[i].stackSize <= 0) {
+ mInventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {}
+
+ public String trans(String aKey, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ Logger.INFO("Checking if we can pull " + aStack.getDisplayName() + " from slot " + aIndex);
+ if (aIndex == mInventory.length - 1
+ && ItemUtils.isControlCircuit(aStack)
+ && aSide == getBaseMetaTileEntity().getFrontFacing()) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ Logger.INFO("Checking if we can put " + aStack.getDisplayName() + " into slot " + aIndex);
+ if (aIndex == mInventory.length - 1
+ && ItemUtils.isControlCircuit(aStack)
+ && aSide == getBaseMetaTileEntity().getFrontFacing()) {
+ return true;
+ }
+ return false;
+ }
+
+ public ArrayList<ItemStack> getInventory() {
+ ArrayList<ItemStack> aContents = new ArrayList<ItemStack>();
+ for (int i = getBaseMetaTileEntity().getSizeInventory() - 2; i >= 0; i--) {
if (getBaseMetaTileEntity().getStackInSlot(i) != null)
- aContents.add(getBaseMetaTileEntity().getStackInSlot(i));
- }
- return aContents;
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- if (aIndex == mInventory.length-1 && ItemUtils.isControlCircuit(aStack) && aSide == getBaseMetaTileEntity().getFrontFacing()) {
- Logger.INFO("Putting "+aStack.getDisplayName()+" into slot "+aIndex);
- return true;
- }
- return false;
- }
-
- @Override
- public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
- if (aIndex == mInventory.length-1 && ItemUtils.isControlCircuit(aStack)) {
- Logger.INFO("Pulling "+aStack.getDisplayName()+" from slot "+aIndex);
- return true;
- }
- return false;
- }
-
+ aContents.add(getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ return aContents;
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ if (aIndex == mInventory.length - 1
+ && ItemUtils.isControlCircuit(aStack)
+ && aSide == getBaseMetaTileEntity().getFrontFacing()) {
+ Logger.INFO("Putting " + aStack.getDisplayName() + " into slot " + aIndex);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ if (aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)) {
+ Logger.INFO("Pulling " + aStack.getDisplayName() + " from slot " + aIndex);
+ return true;
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java
index 8646e7e0a7..d70a84949f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java
@@ -2,10 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.HashMap;
-
import gregtech.api.gui.GT_Container_3by3;
import gregtech.api.gui.GT_GUIContainer_3by3;
import gregtech.api.interfaces.ITexture;
@@ -17,6 +13,9 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.InventoryUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.Item;
@@ -25,269 +24,277 @@ import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_Hatch_Energy_RTG extends GT_MetaTileEntity_Hatch_Energy {
- public GT_MetaTileEntity_Hatch_Energy_RTG(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount) {
- super(aID, aName, aNameRegional, aTier);
- setInventoryContent(aInvSlotCount);
- }
-
- public GT_MetaTileEntity_Hatch_Energy_RTG(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Hatch_Energy_RTG(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aInvSlotCount) {
- super(aName, aTier, aDescription, aTextures);
- setInventoryContent(aInvSlotCount);
- }
-
- @Override
- public String[] getDescription() {
- String[] S = super.getDescription();
- final String[] desc = new String[S.length + 1];
- System.arraycopy(S, 0, desc, 0, S.length);
- desc[S.length] = CORE.GT_Tooltip;
- return desc;
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, TexturesGtBlock.getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_On, new short[] {220, 220, 220, 0})};
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, TexturesGtBlock.getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_Off, new short[] {220, 220, 220, 0})};
- }
-
- @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 false;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 0;
- }
-
- @Override
- public long maxEUInput() {
- return V[mTier];
- }
-
- @Override
- public long maxEUStore() {
- return Long.MAX_VALUE / (Short.MAX_VALUE * Byte.MAX_VALUE) ;
- }
-
- @Override
- public long maxAmperesIn() {
- return 0;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_Energy_RTG(mName, mTier, mDescriptionArray, mTextures, 9);
- }
-
- @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 true;
- }
-
- @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_3by3(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, "RTG Power Unit");
- }
-
- private static class Dat {
-
- protected final String mUniqueDataTag;
- private final ItemStack mStack;
- private final NBTTagCompound mNBT;
-
- public Dat(ItemStack aStack) {
- mStack = aStack;
- mNBT = (aStack.getTagCompound() != null ? aStack.getTagCompound() : new NBTTagCompound());
- mUniqueDataTag = ""+Item.getIdFromItem(aStack.getItem())+""+aStack.getItemDamage()+""+1+""+mNBT.getId();
- }
-
- public int getKey() {
- return Item.getIdFromItem(mStack.getItem())+mStack.getItemDamage();
- }
-
- }
-
- private static final HashMap<String, ItemStack> mFuelInstanceMap = new HashMap<String, ItemStack>();
- private static final HashMap<String, Long> mFuelValueMap = new HashMap<String, Long>();
- private static final HashMap<String, Integer> mFuelTypeMap = new HashMap<String, Integer>();
- private static final HashMap<Integer, String> mFuelTypeMapReverse = new HashMap<Integer, String>();
-
- public static boolean registerPelletForHatch(ItemStack aStack, long aFuelValue) {
- if (!ItemUtils.checkForInvalidItems(aStack)) {
- return false;
- }
- ItemStack aTemp = aStack.copy();
- aTemp.stackSize = 1;
- Dat aDat = new Dat(aTemp);
- String aKey = aDat.mUniqueDataTag;
- mFuelInstanceMap.put(aKey, aTemp);
- mFuelValueMap.put(aKey, aFuelValue);
- mFuelTypeMap.put(aKey, aDat.getKey());
- mFuelTypeMapReverse.put(aDat.getKey(), aKey);
- Logger.INFO("RTG Hatch: Registered Fuel Pellet: "+ItemUtils.getItemName(aTemp)+", Fuel Value: "+aFuelValue+", Key: "+aKey+", Key2: "+aDat.getKey());
- return true;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
- InventoryUtils.sortInventoryItems(this);
- }
- if (aTimer % 100 == 0 && aBaseMetaTileEntity.isServerSide()) {
- if (hasPellet(this)) {
- Logger.INFO("Has Pellet");
- tryConsumePellet(this);
- }
- }
- }
-
- private static void tryConsumePellet(GT_MetaTileEntity_Hatch_Energy_RTG aTile) {
- ItemStack aPellet = getPelletToConsume(aTile);
- if (aPellet != null) {
- Logger.INFO("Found Pellet");
- long aFuel = getFuelValueOfPellet(aPellet);
- if (aFuel > 0) {
- Logger.INFO("Has Fuel Value: "+aFuel);
- if (hasSpaceForEnergy(aTile, aFuel)) {
- Logger.INFO("Can buffer");
- aPellet.stackSize = 0;
- Logger.INFO("Stack set to 0");
- aPellet = null;
- Logger.INFO("null stack");
- addEnergyToInternalStorage(aTile, aFuel);
- Logger.INFO("Consumed");
- }
- }
- }
- aTile.updateSlots();
- Logger.INFO("updating slots");
- }
-
- private static void addEnergyToInternalStorage(GT_MetaTileEntity_Hatch_Energy_RTG aTile, long aFuel) {
- aTile.getBaseMetaTileEntity().increaseStoredEnergyUnits(aFuel, true);
- }
-
- public static boolean hasSpaceForEnergy(GT_MetaTileEntity_Hatch_Energy_RTG aTile, long aAmount) {
- long aMax = aTile.maxEUStore();
- long aCurrent = aTile.getEUVar();
- if ((aMax - aCurrent) >= aAmount) {
- return true;
- }
- return false;
- }
-
- public void updateSlots() {
- for (int i = 0; i < mInventory.length; i++) {
- if (mInventory[i] != null && mInventory[i].stackSize <= 0) {
- mInventory[i] = null;
- }
- }
- InventoryUtils.sortInventoryItems(this);
- }
-
- public static boolean hasPellet(GT_MetaTileEntity_Hatch_Energy_RTG aTile) {
- for (ItemStack o : aTile.mInventory) {
- if (o != null ) {
- for (ItemStack i : mFuelInstanceMap.values()) {
- if (ItemUtils.areItemsEqual(o, i)) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static String getPelletType(ItemStack o) {
- if (o == null) {
- return "error";
- }
- Dat aDat = new Dat(o);
- return mFuelTypeMapReverse.get(aDat.getKey());
- }
-
- public static long getFuelValueOfPellet(ItemStack aPellet) {
- String aType = getPelletType(aPellet);
- if (mFuelValueMap.containsKey(aType)) {
- return mFuelValueMap.get(aType);
- }
- return 0;
- }
-
- public static ItemStack getPelletToConsume(GT_MetaTileEntity_Hatch_Energy_RTG aTile) {
- for (ItemStack o : aTile.mInventory) {
- if (o != null ) {
- for (ItemStack i : mFuelInstanceMap.values()) {
- if (ItemUtils.areItemsEqual(o, i)) {
- return o;
- }
- }
- }
- }
- return null;
- }
-
- private void setInventoryContent(int aInvSlotCount) {
- try {
- Field fieldInventory = MetaTileEntity.class.getDeclaredField("mInventory");
- Field modifiersField = Field.class.getDeclaredField("modifiers");
- modifiersField.setAccessible(true);
- modifiersField.setInt(fieldInventory, fieldInventory.getModifiers() & ~Modifier.PRIVATE & ~Modifier.FINAL);
- fieldInventory.set(this, new ItemStack[aInvSlotCount]);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-} \ No newline at end of file
+ public GT_MetaTileEntity_Hatch_Energy_RTG(
+ int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount) {
+ super(aID, aName, aNameRegional, aTier);
+ setInventoryContent(aInvSlotCount);
+ }
+
+ public GT_MetaTileEntity_Hatch_Energy_RTG(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_Hatch_Energy_RTG(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aInvSlotCount) {
+ super(aName, aTier, aDescription, aTextures);
+ setInventoryContent(aInvSlotCount);
+ }
+
+ @Override
+ public String[] getDescription() {
+ String[] S = super.getDescription();
+ final String[] desc = new String[S.length + 1];
+ System.arraycopy(S, 0, desc, 0, S.length);
+ desc[S.length] = CORE.GT_Tooltip;
+ return desc;
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[] {
+ aBaseTexture,
+ TexturesGtBlock.getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_On, new short[] {220, 220, 220, 0})
+ };
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[] {
+ aBaseTexture,
+ TexturesGtBlock.getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_Off, new short[] {220, 220, 220, 0})
+ };
+ }
+
+ @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 false;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Long.MAX_VALUE / (Short.MAX_VALUE * Byte.MAX_VALUE);
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 0;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_Energy_RTG(mName, mTier, mDescriptionArray, mTextures, 9);
+ }
+
+ @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 true;
+ }
+
+ @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_3by3(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, "RTG Power Unit");
+ }
+
+ private static class Dat {
+
+ protected final String mUniqueDataTag;
+ private final ItemStack mStack;
+ private final NBTTagCompound mNBT;
+
+ public Dat(ItemStack aStack) {
+ mStack = aStack;
+ mNBT = (aStack.getTagCompound() != null ? aStack.getTagCompound() : new NBTTagCompound());
+ mUniqueDataTag = "" + Item.getIdFromItem(aStack.getItem()) + "" + aStack.getItemDamage() + "" + 1 + ""
+ + mNBT.getId();
+ }
+
+ public int getKey() {
+ return Item.getIdFromItem(mStack.getItem()) + mStack.getItemDamage();
+ }
+ }
+
+ private static final HashMap<String, ItemStack> mFuelInstanceMap = new HashMap<String, ItemStack>();
+ private static final HashMap<String, Long> mFuelValueMap = new HashMap<String, Long>();
+ private static final HashMap<String, Integer> mFuelTypeMap = new HashMap<String, Integer>();
+ private static final HashMap<Integer, String> mFuelTypeMapReverse = new HashMap<Integer, String>();
+
+ public static boolean registerPelletForHatch(ItemStack aStack, long aFuelValue) {
+ if (!ItemUtils.checkForInvalidItems(aStack)) {
+ return false;
+ }
+ ItemStack aTemp = aStack.copy();
+ aTemp.stackSize = 1;
+ Dat aDat = new Dat(aTemp);
+ String aKey = aDat.mUniqueDataTag;
+ mFuelInstanceMap.put(aKey, aTemp);
+ mFuelValueMap.put(aKey, aFuelValue);
+ mFuelTypeMap.put(aKey, aDat.getKey());
+ mFuelTypeMapReverse.put(aDat.getKey(), aKey);
+ Logger.INFO("RTG Hatch: Registered Fuel Pellet: " + ItemUtils.getItemName(aTemp) + ", Fuel Value: " + aFuelValue
+ + ", Key: " + aKey + ", Key2: " + aDat.getKey());
+ return true;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ InventoryUtils.sortInventoryItems(this);
+ }
+ if (aTimer % 100 == 0 && aBaseMetaTileEntity.isServerSide()) {
+ if (hasPellet(this)) {
+ Logger.INFO("Has Pellet");
+ tryConsumePellet(this);
+ }
+ }
+ }
+
+ private static void tryConsumePellet(GT_MetaTileEntity_Hatch_Energy_RTG aTile) {
+ ItemStack aPellet = getPelletToConsume(aTile);
+ if (aPellet != null) {
+ Logger.INFO("Found Pellet");
+ long aFuel = getFuelValueOfPellet(aPellet);
+ if (aFuel > 0) {
+ Logger.INFO("Has Fuel Value: " + aFuel);
+ if (hasSpaceForEnergy(aTile, aFuel)) {
+ Logger.INFO("Can buffer");
+ aPellet.stackSize = 0;
+ Logger.INFO("Stack set to 0");
+ aPellet = null;
+ Logger.INFO("null stack");
+ addEnergyToInternalStorage(aTile, aFuel);
+ Logger.INFO("Consumed");
+ }
+ }
+ }
+ aTile.updateSlots();
+ Logger.INFO("updating slots");
+ }
+
+ private static void addEnergyToInternalStorage(GT_MetaTileEntity_Hatch_Energy_RTG aTile, long aFuel) {
+ aTile.getBaseMetaTileEntity().increaseStoredEnergyUnits(aFuel, true);
+ }
+
+ public static boolean hasSpaceForEnergy(GT_MetaTileEntity_Hatch_Energy_RTG aTile, long aAmount) {
+ long aMax = aTile.maxEUStore();
+ long aCurrent = aTile.getEUVar();
+ if ((aMax - aCurrent) >= aAmount) {
+ return true;
+ }
+ return false;
+ }
+
+ public void updateSlots() {
+ for (int i = 0; i < mInventory.length; i++) {
+ if (mInventory[i] != null && mInventory[i].stackSize <= 0) {
+ mInventory[i] = null;
+ }
+ }
+ InventoryUtils.sortInventoryItems(this);
+ }
+
+ public static boolean hasPellet(GT_MetaTileEntity_Hatch_Energy_RTG aTile) {
+ for (ItemStack o : aTile.mInventory) {
+ if (o != null) {
+ for (ItemStack i : mFuelInstanceMap.values()) {
+ if (ItemUtils.areItemsEqual(o, i)) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public static String getPelletType(ItemStack o) {
+ if (o == null) {
+ return "error";
+ }
+ Dat aDat = new Dat(o);
+ return mFuelTypeMapReverse.get(aDat.getKey());
+ }
+
+ public static long getFuelValueOfPellet(ItemStack aPellet) {
+ String aType = getPelletType(aPellet);
+ if (mFuelValueMap.containsKey(aType)) {
+ return mFuelValueMap.get(aType);
+ }
+ return 0;
+ }
+
+ public static ItemStack getPelletToConsume(GT_MetaTileEntity_Hatch_Energy_RTG aTile) {
+ for (ItemStack o : aTile.mInventory) {
+ if (o != null) {
+ for (ItemStack i : mFuelInstanceMap.values()) {
+ if (ItemUtils.areItemsEqual(o, i)) {
+ return o;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private void setInventoryContent(int aInvSlotCount) {
+ try {
+ Field fieldInventory = MetaTileEntity.class.getDeclaredField("mInventory");
+ Field modifiersField = Field.class.getDeclaredField("modifiers");
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(fieldInventory, fieldInventory.getModifiers() & ~Modifier.PRIVATE & ~Modifier.FINAL);
+ fieldInventory.set(this, new ItemStack[aInvSlotCount]);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java
index c7e07b7534..b11b3bc78e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import java.lang.reflect.Field;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
@@ -14,6 +12,7 @@ import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -23,133 +22,130 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTileEntity_Hatch_Input {
-
- protected static XSTR floatGen = new XSTR();
+
+ protected static XSTR floatGen = new XSTR();
public int mProgresstime = 0, mMaxProgresstime = 0;
- public GT_MetaTileEntity_Hatch_FluidGenerator(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier);
- }
-
- public GT_MetaTileEntity_Hatch_FluidGenerator(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- private static String[] S;
- private static Field F;
-
- public abstract String[] getCustomTooltip();
-
- public abstract Fluid getFluidToGenerate();
-
- public abstract int getAmountOfFluidToGenerate();
-
- public abstract int getMaxTickTime();
-
- public synchronized String[] getDescription() {
- try {
- if (F == null || S == null) {
- Field t = ReflectionUtils.getField(this.getClass(), "mDescriptionArray");
- if (t != null) {
- F = t;
- }
- else {
- F = ReflectionUtils.getField(this.getClass(), "mDescription");
- }
- if (S == null && F != null) {
- Object o = F.get(this);
- if (o instanceof String[]) {
- S = (String[]) o;
- }
- else if (o instanceof String) {
- S = new String[] {(String) o};
- }
- }
-
- }
- }
- catch (Throwable t) {
- Logger.INFO("1");
- t.printStackTrace();
- }
- try {
- if (S != null) {
- String[] aCustomTips = getCustomTooltip();
- final String[] desc = new String[S.length + aCustomTips.length + 1];
- System.arraycopy(S, 0, desc, 0, S.length);
- for (int i=0;i<aCustomTips.length;i++) {
- desc[S.length + i] = aCustomTips[i];
- }
- desc[S.length + aCustomTips.length] = CORE.GT_Tooltip;
- return desc;
- }
- }
- catch (Throwable t) {
- Logger.INFO("2");
- t.printStackTrace();
- }
-
- return new String[] {"Broken Tooltip - Report on Github"};
-
- }
-
- public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture,
- new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)};
- }
-
- public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture,
- new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)};
- }
-
- public boolean isSimpleMachine() {
- return true;
- }
-
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- public boolean isValidSlot(final int aIndex) {
- return false;
- }
-
- public abstract MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity);
-
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (!aBaseMetaTileEntity.isAllowedToWork()) {
- aBaseMetaTileEntity.setActive(false);
- mProgresstime = 0;
- mMaxProgresstime = 0;
- }
- else {
- aBaseMetaTileEntity.setActive(true);
- mMaxProgresstime = getMaxTickTime();
- if (++mProgresstime >= mMaxProgresstime) {
- if (this.canTankBeFilled()) {
- addFluidToHatch(aTick);
- }
- mProgresstime = 0;
- }
- }
- }
-
+ public GT_MetaTileEntity_Hatch_FluidGenerator(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ }
+
+ public GT_MetaTileEntity_Hatch_FluidGenerator(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ private static String[] S;
+ private static Field F;
+
+ public abstract String[] getCustomTooltip();
+
+ public abstract Fluid getFluidToGenerate();
+
+ public abstract int getAmountOfFluidToGenerate();
+
+ public abstract int getMaxTickTime();
+
+ public synchronized String[] getDescription() {
+ try {
+ if (F == null || S == null) {
+ Field t = ReflectionUtils.getField(this.getClass(), "mDescriptionArray");
+ if (t != null) {
+ F = t;
+ } else {
+ F = ReflectionUtils.getField(this.getClass(), "mDescription");
+ }
+ if (S == null && F != null) {
+ Object o = F.get(this);
+ if (o instanceof String[]) {
+ S = (String[]) o;
+ } else if (o instanceof String) {
+ S = new String[] {(String) o};
+ }
+ }
+ }
+ } catch (Throwable t) {
+ Logger.INFO("1");
+ t.printStackTrace();
+ }
+ try {
+ if (S != null) {
+ String[] aCustomTips = getCustomTooltip();
+ final String[] desc = new String[S.length + aCustomTips.length + 1];
+ System.arraycopy(S, 0, desc, 0, S.length);
+ for (int i = 0; i < aCustomTips.length; i++) {
+ desc[S.length + i] = aCustomTips[i];
+ }
+ desc[S.length + aCustomTips.length] = CORE.GT_Tooltip;
+ return desc;
+ }
+ } catch (Throwable t) {
+ Logger.INFO("2");
+ t.printStackTrace();
+ }
+
+ return new String[] {"Broken Tooltip - Report on Github"};
+ }
+
+ public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
+ return new ITexture[] {
+ aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)
+ };
+ }
+
+ public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
+ return new ITexture[] {
+ aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)
+ };
+ }
+
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public boolean isValidSlot(final int aIndex) {
+ return false;
+ }
+
+ public abstract MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity);
+
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (!aBaseMetaTileEntity.isAllowedToWork()) {
+ aBaseMetaTileEntity.setActive(false);
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ } else {
+ aBaseMetaTileEntity.setActive(true);
+ mMaxProgresstime = getMaxTickTime();
+ if (++mProgresstime >= mMaxProgresstime) {
+ if (this.canTankBeFilled()) {
+ addFluidToHatch(aTick);
+ }
+ mProgresstime = 0;
+ }
+ }
+ }
+
@Override
public int getProgresstime() {
return mProgresstime;
@@ -166,62 +162,68 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile
return mMaxProgresstime - mProgresstime;
}
- public abstract void generateParticles(final World aWorld, final String name);
-
- public int getTankPressure() {
- return 100;
- }
-
- public abstract int getCapacity();
-
- @Override
- public boolean canTankBeEmptied() {
- return true;
- }
-
- public abstract boolean doesHatchMeetConditionsToGenerate();
-
- public boolean addFluidToHatch(long aTick) {
- if (!doesHatchMeetConditionsToGenerate()) {
- return false;
- }
- int aFillAmount = this.fill(FluidUtils.getFluidStack(getFluidToGenerate(), getAmountOfFluidToGenerate()), true);
- if (aFillAmount > 0) {
- if (this.getBaseMetaTileEntity().isClientSide()) {
- generateParticles(this.getBaseMetaTileEntity().getWorld(), "cloud");
- }
- }
- return aFillAmount > 0;
- }
-
- @Override
- public boolean canTankBeFilled() {
- if (this.getCapacity()-this.getFluidAmount() > 0) {
- //Logger.INFO("Total Space: "+this.getCapacity());
- //Logger.INFO("Current amount: "+this.getFluidAmount());
- //Logger.INFO("To add: "+this.getAmountOfFluidToGenerate());
- //Logger.INFO("Space Free: "+(this.getCapacity()-this.getFluidAmount()));
- }
- if (this.mFluid == null || (this.mFluid != null && (this.getCapacity() - this.getFluidAmount() >= this.getAmountOfFluidToGenerate()))) {
- return true;
- }
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return false;
- }
-
- @Override
- public boolean doesFillContainers() {
- return true;
- }
-
- @Override
- public int fill(FluidStack aFluid, boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || aFluid.getFluid() != getFluidToGenerate() || !canTankBeFilled()) {
- return 0;
+ public abstract void generateParticles(final World aWorld, final String name);
+
+ public int getTankPressure() {
+ return 100;
+ }
+
+ public abstract int getCapacity();
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return true;
+ }
+
+ public abstract boolean doesHatchMeetConditionsToGenerate();
+
+ public boolean addFluidToHatch(long aTick) {
+ if (!doesHatchMeetConditionsToGenerate()) {
+ return false;
+ }
+ int aFillAmount = this.fill(FluidUtils.getFluidStack(getFluidToGenerate(), getAmountOfFluidToGenerate()), true);
+ if (aFillAmount > 0) {
+ if (this.getBaseMetaTileEntity().isClientSide()) {
+ generateParticles(this.getBaseMetaTileEntity().getWorld(), "cloud");
+ }
+ }
+ return aFillAmount > 0;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ if (this.getCapacity() - this.getFluidAmount() > 0) {
+ // Logger.INFO("Total Space: "+this.getCapacity());
+ // Logger.INFO("Current amount: "+this.getFluidAmount());
+ // Logger.INFO("To add: "+this.getAmountOfFluidToGenerate());
+ // Logger.INFO("Space Free: "+(this.getCapacity()-this.getFluidAmount()));
+ }
+ if (this.mFluid == null
+ || (this.mFluid != null
+ && (this.getCapacity() - this.getFluidAmount() >= this.getAmountOfFluidToGenerate()))) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return true;
+ }
+
+ @Override
+ public int fill(FluidStack aFluid, boolean doFill) {
+ if (aFluid == null
+ || aFluid.getFluid().getID() <= 0
+ || aFluid.amount <= 0
+ || aFluid.getFluid() != getFluidToGenerate()
+ || !canTankBeFilled()) {
+ return 0;
}
if (getFillableStack() == null || getFillableStack().getFluid().getID() <= 0) {
@@ -240,8 +242,7 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile
return getCapacity();
}
- if (!getFillableStack().isFluidEqual(aFluid))
- return 0;
+ if (!getFillableStack().isFluidEqual(aFluid)) return 0;
int space = getCapacity() - getFillableStack().amount;
if (aFluid.amount <= space) {
@@ -251,37 +252,36 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile
}
return aFluid.amount;
}
- if (doFill)
- getFillableStack().amount = getCapacity();
+ if (doFill) getFillableStack().amount = getCapacity();
return space;
}
- @Override
- public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- return false;
- }
-
- @Override
- public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
- return 0;
- }
-
- @Override
- public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- return 0;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ return false;
+ }
+
+ @Override
+ public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
+ return 0;
+ }
+
+ @Override
+ public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return 0;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
aNBT.setInteger("mProgresstime", mProgresstime);
aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
- super.saveNBTData(aNBT);
- }
+ super.saveNBTData(aNBT);
+ }
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
mProgresstime = aNBT.getInteger("mProgresstime");
mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- super.loadNBTData(aNBT);
- }
+ super.loadNBTData(aNBT);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java
index 57f8b722c3..d56a95d60f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java
@@ -2,10 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -15,57 +11,48 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.*;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
-public class GT_MetaTileEntity_Hatch_InputBattery
-extends
-GT_MetaTileEntity_Hatch {
- public final GT_Recipe_Map mRecipeMap = null;
+public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatch {
+ public final GT_Recipe_Map mRecipeMap = null;
- public GT_MetaTileEntity_Hatch_InputBattery(int aID, String aName,
- String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Chargeable Item Bus for Multiblocks");
- }
+ public GT_MetaTileEntity_Hatch_InputBattery(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Chargeable Item Bus for Multiblocks");
+ }
- public GT_MetaTileEntity_Hatch_InputBattery(String aName, int aTier,
- String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier,
- aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 4 : 16,
- aDescription, aTextures);
- }
+ public GT_MetaTileEntity_Hatch_InputBattery(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 4 : 16, aDescription, aTextures);
+ }
- @Override
- public String[] getDescription() {
- int mSlots = 0;
- if (this.mTier == 2) {
- mSlots = 4;
- }
- else if (this.mTier == 4) {
- mSlots = 16;
- }
- else {
- mSlots = 16;
- }
- return new String[]{
- this.mDescription,
- "Capacity: " + mSlots + " slots",
- CORE.GT_Tooltip};
- }
+ @Override
+ public String[] getDescription() {
+ int mSlots = 0;
+ if (this.mTier == 2) {
+ mSlots = 4;
+ } else if (this.mTier == 4) {
+ mSlots = 16;
+ } else {
+ mSlots = 16;
+ }
+ return new String[] {this.mDescription, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip};
+ }
- @Override
+ @Override
public boolean isEnetInput() {
return true;
}
- @Override
+ @Override
public boolean isInputFacing(byte aSide) {
return aSide == getBaseMetaTileEntity().getFrontFacing();
}
-
@Override
public long getMinimumStoredEU() {
return 0;
@@ -85,174 +72,171 @@ GT_MetaTileEntity_Hatch {
public long maxAmperesIn() {
return 4;
}
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture,
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Charger)};
- }
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture,
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Charger)};
- }
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Charger)};
+ }
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Charger)};
+ }
- @Override
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
- @Override
- public boolean isValidSlot(int aIndex) {
- 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_InputBattery(mName, mTier,
- mDescription, mTextures);
- }
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_InputBattery(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 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 2 :
- return new CONTAINER_Electric_2by2(aPlayerInventory,
- aBaseMetaTileEntity);
- case 4 :
- return new CONTAINER_Electric_4by4(aPlayerInventory,
- aBaseMetaTileEntity);
- default :
- return new CONTAINER_Electric_4by4(aPlayerInventory,
- aBaseMetaTileEntity);
- }
- }
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ switch (mTier) {
+ case 2:
+ return new CONTAINER_Electric_2by2(aPlayerInventory, aBaseMetaTileEntity);
+ case 4:
+ return new CONTAINER_Electric_4by4(aPlayerInventory, aBaseMetaTileEntity);
+ default:
+ return new CONTAINER_Electric_4by4(aPlayerInventory, aBaseMetaTileEntity);
+ }
+ }
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory,
- IGregTechTileEntity aBaseMetaTileEntity) {
- switch (mTier) {
- case 2 :
- return new GUI_Electric_2by2(aPlayerInventory,
- aBaseMetaTileEntity, "Charging Bus");
- case 4 :
- return new GUI_Electric_4by4(aPlayerInventory,
- aBaseMetaTileEntity, "Charging Bus");
- default :
- return new GUI_Electric_4by4(aPlayerInventory,
- aBaseMetaTileEntity, "Charging Bus");
- }
- }
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ switch (mTier) {
+ case 2:
+ return new GUI_Electric_2by2(aPlayerInventory, aBaseMetaTileEntity, "Charging Bus");
+ case 4:
+ return new GUI_Electric_4by4(aPlayerInventory, aBaseMetaTileEntity, "Charging Bus");
+ default:
+ return new GUI_Electric_4by4(aPlayerInventory, aBaseMetaTileEntity, "Charging Bus");
+ }
+ }
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (aBaseMetaTileEntity.isServerSide()
- && aBaseMetaTileEntity.hasInventoryBeenModified()) {
- fillStacksIntoFirstSlots();
- }
- if (aBaseMetaTileEntity.isServerSide()){
- if (aBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) {
- MetaTileEntity mMetaTileEntity = (MetaTileEntity) aBaseMetaTileEntity.getMetaTileEntity();
- if (mMetaTileEntity.rechargerSlotCount() > 0 && aBaseMetaTileEntity.getStoredEU() > 0) {
- for (int i = mMetaTileEntity.rechargerSlotStartIndex(), k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) {
- if (aBaseMetaTileEntity.getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) {
- for (int u=0;u<10;u++){
- aBaseMetaTileEntity.decreaseStoredEnergyUnits(GT_ModHandler.chargeElectricItem(mMetaTileEntity.mInventory[i], (int) Math.min(V[this.mTier] * 15, aBaseMetaTileEntity.getStoredEU()), (int) Math.min(Integer.MAX_VALUE, GT_Values.V[u]), false, false), true);
- if (mMetaTileEntity.mInventory[i].stackSize <= 0){
- mMetaTileEntity.mInventory[i] = null;
- }
- }
- }
- }
- }
- else {
- //Utils.LOG_INFO("reCharger Slot Count = "+mMetaTileEntity.rechargerSlotCount());
- //Utils.LOG_INFO("getStoredEU = "+aBaseMetaTileEntity.getStoredEU());
- //Utils.LOG_INFO("getEUVar = "+mMetaTileEntity.getEUVar());
- }
- }
- }
- super.onPostTick(aBaseMetaTileEntity, aTimer);
- }
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ fillStacksIntoFirstSlots();
+ }
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (aBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) {
+ MetaTileEntity mMetaTileEntity = (MetaTileEntity) aBaseMetaTileEntity.getMetaTileEntity();
+ if (mMetaTileEntity.rechargerSlotCount() > 0 && aBaseMetaTileEntity.getStoredEU() > 0) {
+ for (int i = mMetaTileEntity.rechargerSlotStartIndex(),
+ k = mMetaTileEntity.rechargerSlotCount() + i;
+ i < k;
+ i++) {
+ if (aBaseMetaTileEntity.getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) {
+ for (int u = 0; u < 10; u++) {
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(
+ GT_ModHandler.chargeElectricItem(
+ mMetaTileEntity.mInventory[i],
+ (int) Math.min(V[this.mTier] * 15, aBaseMetaTileEntity.getStoredEU()),
+ (int) Math.min(Integer.MAX_VALUE, GT_Values.V[u]),
+ false,
+ false),
+ true);
+ if (mMetaTileEntity.mInventory[i].stackSize <= 0) {
+ mMetaTileEntity.mInventory[i] = null;
+ }
+ }
+ }
+ }
+ } else {
+ // Utils.LOG_INFO("reCharger Slot Count = "+mMetaTileEntity.rechargerSlotCount());
+ // Utils.LOG_INFO("getStoredEU = "+aBaseMetaTileEntity.getStoredEU());
+ // Utils.LOG_INFO("getEUVar = "+mMetaTileEntity.getEUVar());
+ }
+ }
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTimer);
+ }
- public void updateSlots() {
- for (int i = 0; i < mInventory.length; i++)
- if (mInventory[i] != null && mInventory[i].stackSize <= 0)
- mInventory[i] = null;
- 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);
- }
- }
+ 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 aSide == getBaseMetaTileEntity().getFrontFacing()
- && (mRecipeMap == null || mRecipeMap.containsInput(aStack));
- }
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing()
+ && (mRecipeMap == null || mRecipeMap.containsInput(aStack));
+ }
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity,
- int aIndex, byte aSide, ItemStack aStack) {
- return aSide == getBaseMetaTileEntity().getFrontFacing()
- && (mRecipeMap == null || mRecipeMap.containsInput(aStack));
- }
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing()
+ && (mRecipeMap == null || mRecipeMap.containsInput(aStack));
+ }
- @Override
- public int rechargerSlotStartIndex() {
- return 0;
- }
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
- @Override
- public int rechargerSlotCount() {
- switch (mTier) {
- case 2 :
- return 4;
- case 4 :
- return 16;
- default :
- return 16;
- }
- }
+ @Override
+ public int rechargerSlotCount() {
+ switch (mTier) {
+ case 2:
+ return 4;
+ case 4:
+ return 16;
+ default:
+ return 16;
+ }
+ }
- @Override
- public int dechargerSlotStartIndex() {
- return 0;
- }
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
- @Override
- public int dechargerSlotCount() {
- return 0;
- }
+ @Override
+ public int dechargerSlotCount() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java
index ba4e394114..94b927c80d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java
@@ -24,306 +24,314 @@ import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch_Muffler {
- protected int SLOT_FILTER = 0;
-
- @Override
- public void onConfigLoad(GT_Config aConfig) {
- super.onConfigLoad(aConfig);
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
- try {
- Integer a1 = (int) StaticFields59.getFieldFromGregtechProxy("mPollutionSmogLimit");
- if (a1 != null && a1 > 0) {
- mPollutionSmogLimit = a1;
- }
- }
- catch (Throwable t) {
- mPollutionSmogLimit = 500000;
- }
- }
- }
-
- private int mPollutionSmogLimit = 500000;
-
- public GT_MetaTileEntity_Hatch_Muffler_Adv(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier);
- ReflectionUtils.setField(this, "mInventory", new ItemStack[1]);
- }
-
- public GT_MetaTileEntity_Hatch_Muffler_Adv(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- ReflectionUtils.setField(this, "mInventory", new ItemStack[1]);
- }
-
- public GT_MetaTileEntity_Hatch_Muffler_Adv(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription[0], aTextures);
- ReflectionUtils.setField(this, "mInventory", new ItemStack[1]);
- }
-
- public String[] getDescription() {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- String[] mDescArray = StaticFields59.getDescriptionArray(this);
- String[] desc = new String[mDescArray.length + 7];
- System.arraycopy(mDescArray, 0, desc, 0, mDescArray.length);
- desc[mDescArray.length] = "DO NOT OBSTRUCT THE OUTPUT!";
- desc[mDescArray.length + 1] = "Requires 3 Air on the exhaust face";
- desc[mDescArray.length + 2] = "Requires Air Filters";
- desc[mDescArray.length + 3] = "Mufflers require T2 Filters from IV-"+GT_Values.VN[9];
- desc[mDescArray.length + 4] = "Reduces Pollution to " + this.calculatePollutionReductionForTooltip(100) + "%";
- desc[mDescArray.length + 5] = "Recovers " + (105 - this.calculatePollutionReductionForTooltip(100)) + "% of CO2/CO/SO2";
- desc[mDescArray.length + 6] = CORE.GT_Tooltip;
- return desc;
- }
- else {
- return new String[] {};
- }
- }
-
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Muffler_Adv)};
- }
-
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Muffler_Adv)};
- }
-
- public boolean isValidSlot(int aIndex) {
- return aIndex == SLOT_FILTER;
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_Muffler_Adv(this.mName, this.mTier, StaticFields59.getDescriptionArray(this), this.mTextures);
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity,
- EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide())
- return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
-
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_Hatch_Muffler_Advanced(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_Hatch_Muffler_Advanced(aPlayerInventory, aBaseMetaTileEntity, "Advanced Muffler", "machine_Charger.png");
- }
-
- private boolean airCheck() {
- if (
- this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing()) &&
- this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getFrontFacing(), 1) &&
- this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getFrontFacing(), 2)
- ) {
- return true;
- }
- return false;
- }
-
- public boolean polluteEnvironment() {
- if (airCheck() && damageAirFilter()) {
- int aEmission = this.calculatePollutionReduction(10000);
- PollutionUtils.addPollution(this.getBaseMetaTileEntity(), aEmission);
- //Logger.INFO("Outputting "+aEmission+"gbl");
- return true;
- } else {
- //Logger.INFO("Failed to output pollution");
- return false;
- }
- }
-
-
- public int calculatePollutionReductionForTooltip(int aPollution) {
- return (int) (aPollution * Math.pow(0.64D, (double) (this.mTier - 1)));
- }
-
- public int calculatePollutionReduction(int aPollution) {
- double aVal1 = aPollution * Math.pow(0.64D, (double) (this.mTier - 1));
- int aVal2 = (int) aVal1;
- if (!hasValidFilter()) {
- aVal2 = (int) ((double) aPollution * Math.pow(0.7D, (double) (this.mTier - 1)));;
- }
- return aVal2;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (aIndex == this.SLOT_FILTER) {
- if (isAirFilter(aStack)) {
- return true;
- }
- }
- return false;
- }
-
- private ItemStack getInventoryStack() {
- if (this.mInventory != null && this.mInventory.length > 0) {
- if (this.mInventory.length-1 >= this.SLOT_FILTER) {
- return this.mInventory[this.SLOT_FILTER];
- }
- }
- return null;
- }
-
- private void breakAirFilter() {
- if (this.mInventory != null && this.mInventory.length > 0) {
- if (this.mInventory.length-1 >= this.SLOT_FILTER) {
- Logger.INFO("Breaking Filter");
- this.mInventory[this.SLOT_FILTER] = null;
- }
- }
- }
-
- public boolean hasValidFilter() {
- return isAirFilter(getInventoryStack());
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
-
- //Logger.INFO("A1");
-
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- //Logger.INFO("A2");
-
- String aParticleName;
- if ((aTick % 2) == 0){
- aParticleName = "cloud";
- }
- else {
- aParticleName = "smoke";
- }
-
- //Logger.INFO("A3");
-
- if (aBaseMetaTileEntity.isClientSide()) {
- //Logger.INFO("B1");
- if (this.getBaseMetaTileEntity().isActive()) {
- //Logger.INFO("C1");
- this.pollutionParticles(this.getBaseMetaTileEntity().getWorld(), aParticleName);
- }
- //return;
- }
- else {
- //Logger.INFO("B2");
- if (this.getInventoryStack() == null) {
- //Logger.INFO("D1");
- //Logger.INFO("Empty - "+this.mInventory.length);
- }
- else {
- //Logger.INFO("D2");
- }
- }
- //Logger.INFO("A4");
-
-
-
- }
-
- public boolean isAirFilter(ItemStack filter){
- if (filter == null) {
- return false;
- }
- if (filter.getItem() instanceof ItemAirFilter){
-
- if (this.mTier < 5) {
- return true;
- }
- else {
- if (filter.getItemDamage() == 1) {
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean damageAirFilter(){
- ItemStack filter = getInventoryStack();
- if (filter == null) {
- return false;
- }
-
- if (isAirFilter(filter)){
- long currentUse = ItemAirFilter.getFilterDamage(filter);
- Logger.INFO("Filter Damage: "+currentUse);
- //Remove broken Filter
- if ((filter.getItemDamage() == 0 && currentUse >= 50-1) || (filter.getItemDamage() == 1 && currentUse >= 2500-1)){
- breakAirFilter();
- return true;
- }
- else {
- //Do Damage
- ItemAirFilter.setFilterDamage(filter, currentUse+1);
- Logger.INFO("Filter Damage now: "+currentUse);
- return true;
- }
- }
- return false;
- }
-
- public void pollutionParticles(World aWorld, String name) {
- float ran1 = CORE.RANDOM.nextFloat();
- float ran2 = 0.0F;
- float ran3 = 0.0F;
- boolean chk1 = ran1 * 100.0F < (float) this.calculatePollutionReduction(100);
- boolean chk2;
- boolean chk3;
- int aPollutionAmount = PollutionUtils.getPollution(getBaseMetaTileEntity());
- if (aPollutionAmount >= mPollutionSmogLimit) {
- ran2 = CORE.RANDOM.nextFloat();
- ran3 = CORE.RANDOM.nextFloat();
- chk2 = ran2 * 100.0F < (float) this.calculatePollutionReduction(100);
- chk3 = ran3 * 100.0F < (float) this.calculatePollutionReduction(100);
- if (!chk1 && !chk2 && !chk3) {
- return;
- }
- } else {
- if (!chk1) {
- return;
- }
-
- chk3 = false;
- chk2 = false;
- }
-
- IGregTechTileEntity aMuffler = this.getBaseMetaTileEntity();
- ForgeDirection aDir = ForgeDirection.getOrientation(aMuffler.getFrontFacing());
- float xPos = (float) aDir.offsetX * 0.76F + (float) aMuffler.getXCoord() + 0.25F;
- float yPos = (float) aDir.offsetY * 0.76F + (float) aMuffler.getYCoord() + 0.25F;
- float zPos = (float) aDir.offsetZ * 0.76F + (float) aMuffler.getZCoord() + 0.25F;
- float ySpd = (float) aDir.offsetY * 0.1F + 0.2F + 0.1F * CORE.RANDOM.nextFloat();
- float xSpd;
- float zSpd;
- if (aDir.offsetY == -1) {
- float temp = CORE.RANDOM.nextFloat() * 2.0F * CORE.PI;
- xSpd = (float) Math.sin((double) temp) * 0.1F;
- zSpd = (float) Math.cos((double) temp) * 0.1F;
- } else {
- xSpd = (float) aDir.offsetX * (0.1F + 0.2F * CORE.RANDOM.nextFloat());
- zSpd = (float) aDir.offsetZ * (0.1F + 0.2F * CORE.RANDOM.nextFloat());
- }
-
- if (chk1) {
- aWorld.spawnParticle(name, (double) (xPos + ran1 * 0.5F), (double) (yPos + CORE.RANDOM.nextFloat() * 0.5F),
- (double) (zPos + CORE.RANDOM.nextFloat() * 0.5F), (double) xSpd, (double) ySpd, (double) zSpd);
- }
-
- if (chk2) {
- aWorld.spawnParticle(name, (double) (xPos + ran2 * 0.5F), (double) (yPos + CORE.RANDOM.nextFloat() * 0.5F),
- (double) (zPos + CORE.RANDOM.nextFloat() * 0.5F), (double) xSpd, (double) ySpd, (double) zSpd);
- }
-
- if (chk3) {
- aWorld.spawnParticle(name, (double) (xPos + ran3 * 0.5F), (double) (yPos + CORE.RANDOM.nextFloat() * 0.5F),
- (double) (zPos + CORE.RANDOM.nextFloat() * 0.5F), (double) xSpd, (double) ySpd, (double) zSpd);
- }
-
- }
-
-
-
-} \ No newline at end of file
+ protected int SLOT_FILTER = 0;
+
+ @Override
+ public void onConfigLoad(GT_Config aConfig) {
+ super.onConfigLoad(aConfig);
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
+ try {
+ Integer a1 = (int) StaticFields59.getFieldFromGregtechProxy("mPollutionSmogLimit");
+ if (a1 != null && a1 > 0) {
+ mPollutionSmogLimit = a1;
+ }
+ } catch (Throwable t) {
+ mPollutionSmogLimit = 500000;
+ }
+ }
+ }
+
+ private int mPollutionSmogLimit = 500000;
+
+ public GT_MetaTileEntity_Hatch_Muffler_Adv(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ ReflectionUtils.setField(this, "mInventory", new ItemStack[1]);
+ }
+
+ public GT_MetaTileEntity_Hatch_Muffler_Adv(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ ReflectionUtils.setField(this, "mInventory", new ItemStack[1]);
+ }
+
+ public GT_MetaTileEntity_Hatch_Muffler_Adv(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription[0], aTextures);
+ ReflectionUtils.setField(this, "mInventory", new ItemStack[1]);
+ }
+
+ public String[] getDescription() {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ String[] mDescArray = StaticFields59.getDescriptionArray(this);
+ String[] desc = new String[mDescArray.length + 7];
+ System.arraycopy(mDescArray, 0, desc, 0, mDescArray.length);
+ desc[mDescArray.length] = "DO NOT OBSTRUCT THE OUTPUT!";
+ desc[mDescArray.length + 1] = "Requires 3 Air on the exhaust face";
+ desc[mDescArray.length + 2] = "Requires Air Filters";
+ desc[mDescArray.length + 3] = "Mufflers require T2 Filters from IV-" + GT_Values.VN[9];
+ desc[mDescArray.length + 4] =
+ "Reduces Pollution to " + this.calculatePollutionReductionForTooltip(100) + "%";
+ desc[mDescArray.length + 5] =
+ "Recovers " + (105 - this.calculatePollutionReductionForTooltip(100)) + "% of CO2/CO/SO2";
+ desc[mDescArray.length + 6] = CORE.GT_Tooltip;
+ return desc;
+ } else {
+ return new String[] {};
+ }
+ }
+
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Muffler_Adv)};
+ }
+
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Muffler_Adv)};
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return aIndex == SLOT_FILTER;
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ this.mName, this.mTier, StaticFields59.getDescriptionArray(this), this.mTextures);
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_Hatch_Muffler_Advanced(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_Hatch_Muffler_Advanced(
+ aPlayerInventory, aBaseMetaTileEntity, "Advanced Muffler", "machine_Charger.png");
+ }
+
+ private boolean airCheck() {
+ if (this.getBaseMetaTileEntity()
+ .getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing())
+ && this.getBaseMetaTileEntity()
+ .getAirAtSideAndDistance(this.getBaseMetaTileEntity().getFrontFacing(), 1)
+ && this.getBaseMetaTileEntity()
+ .getAirAtSideAndDistance(this.getBaseMetaTileEntity().getFrontFacing(), 2)) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean polluteEnvironment() {
+ if (airCheck() && damageAirFilter()) {
+ int aEmission = this.calculatePollutionReduction(10000);
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), aEmission);
+ // Logger.INFO("Outputting "+aEmission+"gbl");
+ return true;
+ } else {
+ // Logger.INFO("Failed to output pollution");
+ return false;
+ }
+ }
+
+ public int calculatePollutionReductionForTooltip(int aPollution) {
+ return (int) (aPollution * Math.pow(0.64D, (double) (this.mTier - 1)));
+ }
+
+ public int calculatePollutionReduction(int aPollution) {
+ double aVal1 = aPollution * Math.pow(0.64D, (double) (this.mTier - 1));
+ int aVal2 = (int) aVal1;
+ if (!hasValidFilter()) {
+ aVal2 = (int) ((double) aPollution * Math.pow(0.7D, (double) (this.mTier - 1)));
+ ;
+ }
+ return aVal2;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (aIndex == this.SLOT_FILTER) {
+ if (isAirFilter(aStack)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private ItemStack getInventoryStack() {
+ if (this.mInventory != null && this.mInventory.length > 0) {
+ if (this.mInventory.length - 1 >= this.SLOT_FILTER) {
+ return this.mInventory[this.SLOT_FILTER];
+ }
+ }
+ return null;
+ }
+
+ private void breakAirFilter() {
+ if (this.mInventory != null && this.mInventory.length > 0) {
+ if (this.mInventory.length - 1 >= this.SLOT_FILTER) {
+ Logger.INFO("Breaking Filter");
+ this.mInventory[this.SLOT_FILTER] = null;
+ }
+ }
+ }
+
+ public boolean hasValidFilter() {
+ return isAirFilter(getInventoryStack());
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+
+ // Logger.INFO("A1");
+
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ // Logger.INFO("A2");
+
+ String aParticleName;
+ if ((aTick % 2) == 0) {
+ aParticleName = "cloud";
+ } else {
+ aParticleName = "smoke";
+ }
+
+ // Logger.INFO("A3");
+
+ if (aBaseMetaTileEntity.isClientSide()) {
+ // Logger.INFO("B1");
+ if (this.getBaseMetaTileEntity().isActive()) {
+ // Logger.INFO("C1");
+ this.pollutionParticles(this.getBaseMetaTileEntity().getWorld(), aParticleName);
+ }
+ // return;
+ } else {
+ // Logger.INFO("B2");
+ if (this.getInventoryStack() == null) {
+ // Logger.INFO("D1");
+ // Logger.INFO("Empty - "+this.mInventory.length);
+ } else {
+ // Logger.INFO("D2");
+ }
+ }
+ // Logger.INFO("A4");
+
+ }
+
+ public boolean isAirFilter(ItemStack filter) {
+ if (filter == null) {
+ return false;
+ }
+ if (filter.getItem() instanceof ItemAirFilter) {
+
+ if (this.mTier < 5) {
+ return true;
+ } else {
+ if (filter.getItemDamage() == 1) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean damageAirFilter() {
+ ItemStack filter = getInventoryStack();
+ if (filter == null) {
+ return false;
+ }
+
+ if (isAirFilter(filter)) {
+ long currentUse = ItemAirFilter.getFilterDamage(filter);
+ Logger.INFO("Filter Damage: " + currentUse);
+ // Remove broken Filter
+ if ((filter.getItemDamage() == 0 && currentUse >= 50 - 1)
+ || (filter.getItemDamage() == 1 && currentUse >= 2500 - 1)) {
+ breakAirFilter();
+ return true;
+ } else {
+ // Do Damage
+ ItemAirFilter.setFilterDamage(filter, currentUse + 1);
+ Logger.INFO("Filter Damage now: " + currentUse);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void pollutionParticles(World aWorld, String name) {
+ float ran1 = CORE.RANDOM.nextFloat();
+ float ran2 = 0.0F;
+ float ran3 = 0.0F;
+ boolean chk1 = ran1 * 100.0F < (float) this.calculatePollutionReduction(100);
+ boolean chk2;
+ boolean chk3;
+ int aPollutionAmount = PollutionUtils.getPollution(getBaseMetaTileEntity());
+ if (aPollutionAmount >= mPollutionSmogLimit) {
+ ran2 = CORE.RANDOM.nextFloat();
+ ran3 = CORE.RANDOM.nextFloat();
+ chk2 = ran2 * 100.0F < (float) this.calculatePollutionReduction(100);
+ chk3 = ran3 * 100.0F < (float) this.calculatePollutionReduction(100);
+ if (!chk1 && !chk2 && !chk3) {
+ return;
+ }
+ } else {
+ if (!chk1) {
+ return;
+ }
+
+ chk3 = false;
+ chk2 = false;
+ }
+
+ IGregTechTileEntity aMuffler = this.getBaseMetaTileEntity();
+ ForgeDirection aDir = ForgeDirection.getOrientation(aMuffler.getFrontFacing());
+ float xPos = (float) aDir.offsetX * 0.76F + (float) aMuffler.getXCoord() + 0.25F;
+ float yPos = (float) aDir.offsetY * 0.76F + (float) aMuffler.getYCoord() + 0.25F;
+ float zPos = (float) aDir.offsetZ * 0.76F + (float) aMuffler.getZCoord() + 0.25F;
+ float ySpd = (float) aDir.offsetY * 0.1F + 0.2F + 0.1F * CORE.RANDOM.nextFloat();
+ float xSpd;
+ float zSpd;
+ if (aDir.offsetY == -1) {
+ float temp = CORE.RANDOM.nextFloat() * 2.0F * CORE.PI;
+ xSpd = (float) Math.sin((double) temp) * 0.1F;
+ zSpd = (float) Math.cos((double) temp) * 0.1F;
+ } else {
+ xSpd = (float) aDir.offsetX * (0.1F + 0.2F * CORE.RANDOM.nextFloat());
+ zSpd = (float) aDir.offsetZ * (0.1F + 0.2F * CORE.RANDOM.nextFloat());
+ }
+
+ if (chk1) {
+ aWorld.spawnParticle(
+ name,
+ (double) (xPos + ran1 * 0.5F),
+ (double) (yPos + CORE.RANDOM.nextFloat() * 0.5F),
+ (double) (zPos + CORE.RANDOM.nextFloat() * 0.5F),
+ (double) xSpd,
+ (double) ySpd,
+ (double) zSpd);
+ }
+
+ if (chk2) {
+ aWorld.spawnParticle(
+ name,
+ (double) (xPos + ran2 * 0.5F),
+ (double) (yPos + CORE.RANDOM.nextFloat() * 0.5F),
+ (double) (zPos + CORE.RANDOM.nextFloat() * 0.5F),
+ (double) xSpd,
+ (double) ySpd,
+ (double) zSpd);
+ }
+
+ if (chk3) {
+ aWorld.spawnParticle(
+ name,
+ (double) (xPos + ran3 * 0.5F),
+ (double) (yPos + CORE.RANDOM.nextFloat() * 0.5F),
+ (double) (zPos + CORE.RANDOM.nextFloat() * 0.5F),
+ (double) xSpd,
+ (double) ySpd,
+ (double) zSpd);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
index d0f1d8e03f..350b7a788a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import java.lang.reflect.Field;
-
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
import gregtech.api.enums.Textures.BlockIcons;
@@ -15,194 +13,209 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
+import java.lang.reflect.Field;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_Input {
- public final FluidStack[] mFluidsToUse = new FluidStack[3];
- public final int mFluidCapacity;
-
- public GT_MetaTileEntity_Hatch_Naquadah(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, 6);
- mFluidCapacity = 32000;
- initHatch();
- }
-
- public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, 6, aDescription, aTextures);
- mFluidCapacity = 32000;
- initHatch();
- }
-
- public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String[] aDescription,
- final ITexture[][][] aTextures) {
- super(aName, 6, aDescription[0], aTextures);
- mFluidCapacity = 32000;
- initHatch();
- }
-
- private void initHatch() {
- if (mFluidsToUse[0] == null) {
- mFluidsToUse[0] = Materials.Naquadah.getMolten(1);
- }
- if (mFluidsToUse[1] == null) {
- mFluidsToUse[1] = Materials.NaquadahEnriched.getMolten(1);
- }
- if (mFluidsToUse[2] == null) {
- mFluidsToUse[2] = Materials.Naquadria.getMolten(1);
- }
- }
-
- public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) };
- }
-
- public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) };
- }
-
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) {
- for (FluidStack f : mFluidsToUse) {
- if (f != null) {
- if (GT_Utility.getFluidForFilledItem(aStack, true).getFluid() == f.getFluid()) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- for (FluidStack f : mFluidsToUse) {
- if (f != null) {
- if (aFluid.getFluid() == f.getFluid()) {
- return true;
- }
- }
- }
- return false;
- }
-
- public int getCapacity() {
- return this.mFluidCapacity;
- }
-
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Naquadah(this.mName, this.mDescription, this.mTextures);
- }
-
- @Override
- public String[] getDescription() {
- if (aDescCache[0] == null || aDescCache[0].contains(".name") || aDescCache[0].contains("fluid.")) {
- aDescCache[0] = formatFluidString(this.mFluidsToUse[0]);
- }
- if (aDescCache[1] == null || aDescCache[1].contains(".name") || aDescCache[1].contains("fluid.")) {
- aDescCache[1] = formatFluidString(this.mFluidsToUse[1]);
- }
- if (aDescCache[2] == null || aDescCache[2].contains(".name") || aDescCache[2].contains("fluid.")) {
- aDescCache[2] = formatFluidString(this.mFluidsToUse[2]);
- }
- String aNaq = aDescCache[0];
- String aEnrNaq = aDescCache[1];
- String aNaquad = aDescCache[2];
- String[] s2 = new String[]{
- "Fluid Input for Multiblocks",
- "Capacity: " + getCapacity()+"L",
- "Accepted Fluid: " + aNaq,
- "Accepted Fluid: " + aEnrNaq,
- "Accepted Fluid: " + aNaquad,
- CORE.GT_Tooltip
- };
- return s2;
- }
-
- private static String[] aDescCache = new String[3];
- private String formatFluidString(FluidStack f) {
- FluidStack mLockedStack = f;
- Integer mLockedTemp = 0;;
- String mTempMod = ""+EnumChatFormatting.RESET;
- mLockedTemp = mLockedStack.getFluid().getTemperature();
- if (mLockedTemp != null) {
- if (mLockedTemp <= -3000) {
- mTempMod = ""+EnumChatFormatting.DARK_PURPLE;
- }
- else if (mLockedTemp >= -2999 && mLockedTemp <= -500) {
- mTempMod = ""+EnumChatFormatting.DARK_BLUE;
- }
- else if (mLockedTemp >= -499 && mLockedTemp <= -50) {
- mTempMod = ""+EnumChatFormatting.BLUE;
- }
- else if (mLockedTemp >= 30 && mLockedTemp <= 300) {
- mTempMod = ""+EnumChatFormatting.AQUA;
- }
- else if (mLockedTemp >= 301 && mLockedTemp <= 800) {
- mTempMod = ""+EnumChatFormatting.YELLOW;
- }
- else if (mLockedTemp >= 801 && mLockedTemp <= 1500) {
- mTempMod = ""+EnumChatFormatting.GOLD;
- }
- else if (mLockedTemp >= 1501) {
- mTempMod = ""+EnumChatFormatting.RED;
- }
- }
- return mTempMod + mLockedStack.getLocalizedName();
- }
-
- @Override
- public boolean doesFillContainers() {
- return false;
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- // TODO Auto-generated method stub
- return super.getTextureSet(aTextures);
- }
-
- private Field F1, F2;
-
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- byte a1 = 0, a2 = 0;
- try {
- if (F1 == null) {
- F1 = ReflectionUtils.getField(getClass(), "actualTexture");
- }
- if (F2 == null) {
- F2 = ReflectionUtils.getField(getClass(), "mTexturePage");
- }
-
- if (F1 != null) {
- a1 = F1.getByte(this);
- }
- if (F2 != null) {
- a2 = F2.getByte(this);
- }
- }
- catch (IllegalArgumentException | IllegalAccessException n) {}
-
- int textureIndex = a1 | a2 << 7;
- byte texturePointer = (byte) (a1 & 127);
-
-
-
- if (aSide == 1 || aSide == 0) {
- ITexture g = textureIndex > 0 ? StaticFields59.getCasingTexturePages(a2, texturePointer) : BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1];
-
- return new ITexture[] {g, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP_ACTIVE) };
- }
-
- return aSide != aFacing ?
- (textureIndex > 0 ? new ITexture[] { StaticFields59.getCasingTexturePages(a2, texturePointer) } : new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1] })
- : (textureIndex > 0 ? (aActive ? this.getTexturesActive(StaticFields59.getCasingTexturePages(a2, texturePointer)) : this.getTexturesInactive(StaticFields59.getCasingTexturePages(a2, texturePointer)))
- : (aActive ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]) : this.getTexturesInactive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1])));
- }
-
+ public final FluidStack[] mFluidsToUse = new FluidStack[3];
+ public final int mFluidCapacity;
+
+ public GT_MetaTileEntity_Hatch_Naquadah(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional, 6);
+ mFluidCapacity = 32000;
+ initHatch();
+ }
+
+ public GT_MetaTileEntity_Hatch_Naquadah(
+ final String aName, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 6, aDescription, aTextures);
+ mFluidCapacity = 32000;
+ initHatch();
+ }
+
+ public GT_MetaTileEntity_Hatch_Naquadah(
+ final String aName, final String[] aDescription, final ITexture[][][] aTextures) {
+ super(aName, 6, aDescription[0], aTextures);
+ mFluidCapacity = 32000;
+ initHatch();
+ }
+
+ private void initHatch() {
+ if (mFluidsToUse[0] == null) {
+ mFluidsToUse[0] = Materials.Naquadah.getMolten(1);
+ }
+ if (mFluidsToUse[1] == null) {
+ mFluidsToUse[1] = Materials.NaquadahEnriched.getMolten(1);
+ }
+ if (mFluidsToUse[2] == null) {
+ mFluidsToUse[2] = Materials.Naquadria.getMolten(1);
+ }
+ }
+
+ public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
+ return new ITexture[] {
+ aBaseTexture,
+ new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE)
+ };
+ }
+
+ public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
+ return new ITexture[] {
+ aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE)
+ };
+ }
+
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) {
+ for (FluidStack f : mFluidsToUse) {
+ if (f != null) {
+ if (GT_Utility.getFluidForFilledItem(aStack, true).getFluid() == f.getFluid()) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean isFluidInputAllowed(final FluidStack aFluid) {
+ for (FluidStack f : mFluidsToUse) {
+ if (f != null) {
+ if (aFluid.getFluid() == f.getFluid()) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public int getCapacity() {
+ return this.mFluidCapacity;
+ }
+
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Naquadah(this.mName, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ if (aDescCache[0] == null || aDescCache[0].contains(".name") || aDescCache[0].contains("fluid.")) {
+ aDescCache[0] = formatFluidString(this.mFluidsToUse[0]);
+ }
+ if (aDescCache[1] == null || aDescCache[1].contains(".name") || aDescCache[1].contains("fluid.")) {
+ aDescCache[1] = formatFluidString(this.mFluidsToUse[1]);
+ }
+ if (aDescCache[2] == null || aDescCache[2].contains(".name") || aDescCache[2].contains("fluid.")) {
+ aDescCache[2] = formatFluidString(this.mFluidsToUse[2]);
+ }
+ String aNaq = aDescCache[0];
+ String aEnrNaq = aDescCache[1];
+ String aNaquad = aDescCache[2];
+ String[] s2 = new String[] {
+ "Fluid Input for Multiblocks",
+ "Capacity: " + getCapacity() + "L",
+ "Accepted Fluid: " + aNaq,
+ "Accepted Fluid: " + aEnrNaq,
+ "Accepted Fluid: " + aNaquad,
+ CORE.GT_Tooltip
+ };
+ return s2;
+ }
+
+ private static String[] aDescCache = new String[3];
+
+ private String formatFluidString(FluidStack f) {
+ FluidStack mLockedStack = f;
+ Integer mLockedTemp = 0;
+ ;
+ String mTempMod = "" + EnumChatFormatting.RESET;
+ mLockedTemp = mLockedStack.getFluid().getTemperature();
+ if (mLockedTemp != null) {
+ if (mLockedTemp <= -3000) {
+ mTempMod = "" + EnumChatFormatting.DARK_PURPLE;
+ } else if (mLockedTemp >= -2999 && mLockedTemp <= -500) {
+ mTempMod = "" + EnumChatFormatting.DARK_BLUE;
+ } else if (mLockedTemp >= -499 && mLockedTemp <= -50) {
+ mTempMod = "" + EnumChatFormatting.BLUE;
+ } else if (mLockedTemp >= 30 && mLockedTemp <= 300) {
+ mTempMod = "" + EnumChatFormatting.AQUA;
+ } else if (mLockedTemp >= 301 && mLockedTemp <= 800) {
+ mTempMod = "" + EnumChatFormatting.YELLOW;
+ } else if (mLockedTemp >= 801 && mLockedTemp <= 1500) {
+ mTempMod = "" + EnumChatFormatting.GOLD;
+ } else if (mLockedTemp >= 1501) {
+ mTempMod = "" + EnumChatFormatting.RED;
+ }
+ }
+ return mTempMod + mLockedStack.getLocalizedName();
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ // TODO Auto-generated method stub
+ return super.getTextureSet(aTextures);
+ }
+
+ private Field F1, F2;
+
+ @Override
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ byte a1 = 0, a2 = 0;
+ try {
+ if (F1 == null) {
+ F1 = ReflectionUtils.getField(getClass(), "actualTexture");
+ }
+ if (F2 == null) {
+ F2 = ReflectionUtils.getField(getClass(), "mTexturePage");
+ }
+
+ if (F1 != null) {
+ a1 = F1.getByte(this);
+ }
+ if (F2 != null) {
+ a2 = F2.getByte(this);
+ }
+ } catch (IllegalArgumentException | IllegalAccessException n) {
+ }
+
+ int textureIndex = a1 | a2 << 7;
+ byte texturePointer = (byte) (a1 & 127);
+
+ if (aSide == 1 || aSide == 0) {
+ ITexture g = textureIndex > 0
+ ? StaticFields59.getCasingTexturePages(a2, texturePointer)
+ : BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1];
+
+ return new ITexture[] {
+ g, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP_ACTIVE)
+ };
+ }
+
+ return aSide != aFacing
+ ? (textureIndex > 0
+ ? new ITexture[] {StaticFields59.getCasingTexturePages(a2, texturePointer)}
+ : new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]})
+ : (textureIndex > 0
+ ? (aActive
+ ? this.getTexturesActive(StaticFields59.getCasingTexturePages(a2, texturePointer))
+ : this.getTexturesInactive(StaticFields59.getCasingTexturePages(a2, texturePointer)))
+ : (aActive
+ ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1])
+ : this.getTexturesInactive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1])));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java
index ba97cc38eb..d6b0a570ac 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java
@@ -2,10 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -13,224 +9,215 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.*;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
-public class GT_MetaTileEntity_Hatch_OutputBattery
-extends
-GT_MetaTileEntity_Hatch {
- public GT_MetaTileEntity_Hatch_OutputBattery(int aID, String aName,
- String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, getSlots(aTier),
- "Dischargeable Item Bus for Multiblocks");
- }
-
- public GT_MetaTileEntity_Hatch_OutputBattery(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 String[] getDescription() {
- int mSlots = 0;
- if (this.mTier == 2) {
- mSlots = 4;
- }
- else if (this.mTier == 4) {
- mSlots = 16;
- }
- else {
- mSlots = 16;
- }
- return new String[]{
- this.mDescription,
- "Capacity: " + mSlots + " slots",
- CORE.GT_Tooltip};
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 0;
- }
-
- @Override
- public long maxEUOutput() {
- return V[mTier];
- }
-
- @Override
- public long maxEUStore() {
- return 512 + V[mTier + 1] * 8;
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture,
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Discharger)};
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture,
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Discharger)};
- }
-
- @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_OutputBattery(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 2 :
- return new CONTAINER_Electric_2by2(aPlayerInventory,
- aBaseMetaTileEntity);
- case 4 :
- return new CONTAINER_Electric_4by4(aPlayerInventory,
- aBaseMetaTileEntity);
- default :
- return new CONTAINER_Electric_4by4(aPlayerInventory,
- aBaseMetaTileEntity);
- }
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory,
- IGregTechTileEntity aBaseMetaTileEntity) {
- switch (mTier) {
- case 2 :
- return new GUI_Electric_2by2(aPlayerInventory,
- aBaseMetaTileEntity, "Discharging Bus");
- case 4 :
- return new GUI_Electric_4by4(aPlayerInventory,
- aBaseMetaTileEntity, "Discharging Bus");
- default :
- return new GUI_Electric_4by4(aPlayerInventory,
- aBaseMetaTileEntity, "Discharging 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 aSide == aBaseMetaTileEntity.getFrontFacing();
- }
-
- 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 int rechargerSlotStartIndex() {
- return 0;
- }
-
- @Override
- public int rechargerSlotCount() {
- return 0;
- }
-
- @Override
- public int dechargerSlotStartIndex() {
- return 0;
- }
-
- @Override
- public int dechargerSlotCount() {
- return mTier == 2 ? 4 : 16;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (aBaseMetaTileEntity.isServerSide()
- && aBaseMetaTileEntity.hasInventoryBeenModified()) {
- fillStacksIntoFirstSlots();
- }
-
- if (aBaseMetaTileEntity.isServerSide()){
- if (aBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) {
- MetaTileEntity mMetaTileEntity = (MetaTileEntity) aBaseMetaTileEntity.getMetaTileEntity();
- if (mMetaTileEntity.dechargerSlotCount() > 0 && mMetaTileEntity.getEUVar() < aBaseMetaTileEntity.getEUCapacity()) {
- for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) {
- if (mMetaTileEntity.mInventory[i] != null && mMetaTileEntity.getEUVar() < aBaseMetaTileEntity.getEUCapacity()) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits(GT_ModHandler.dischargeElectricItem(mMetaTileEntity.mInventory[i], (int) Math.min(V[mTier] * 15, aBaseMetaTileEntity.getEUCapacity() - aBaseMetaTileEntity.getStoredEU()), (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), true, false, false), true);
- if (mMetaTileEntity.mInventory[i].stackSize <= 0)
- mMetaTileEntity.mInventory[i] = null;
- }
- }
- }
- }
- }
- super.onPostTick(aBaseMetaTileEntity, aTimer);
- }
-
-
+public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hatch {
+ public GT_MetaTileEntity_Hatch_OutputBattery(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Dischargeable Item Bus for Multiblocks");
+ }
+
+ public GT_MetaTileEntity_Hatch_OutputBattery(
+ 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 String[] getDescription() {
+ int mSlots = 0;
+ if (this.mTier == 2) {
+ mSlots = 4;
+ } else if (this.mTier == 4) {
+ mSlots = 16;
+ } else {
+ mSlots = 16;
+ }
+ return new String[] {this.mDescription, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip};
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 512 + V[mTier + 1] * 8;
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Discharger)};
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Discharger)};
+ }
+
+ @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_OutputBattery(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 2:
+ return new CONTAINER_Electric_2by2(aPlayerInventory, aBaseMetaTileEntity);
+ case 4:
+ return new CONTAINER_Electric_4by4(aPlayerInventory, aBaseMetaTileEntity);
+ default:
+ return new CONTAINER_Electric_4by4(aPlayerInventory, aBaseMetaTileEntity);
+ }
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ switch (mTier) {
+ case 2:
+ return new GUI_Electric_2by2(aPlayerInventory, aBaseMetaTileEntity, "Discharging Bus");
+ case 4:
+ return new GUI_Electric_4by4(aPlayerInventory, aBaseMetaTileEntity, "Discharging Bus");
+ default:
+ return new GUI_Electric_4by4(aPlayerInventory, aBaseMetaTileEntity, "Discharging 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 aSide == aBaseMetaTileEntity.getFrontFacing();
+ }
+
+ 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 int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotCount() {
+ return mTier == 2 ? 4 : 16;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ fillStacksIntoFirstSlots();
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (aBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) {
+ MetaTileEntity mMetaTileEntity = (MetaTileEntity) aBaseMetaTileEntity.getMetaTileEntity();
+ if (mMetaTileEntity.dechargerSlotCount() > 0
+ && mMetaTileEntity.getEUVar() < aBaseMetaTileEntity.getEUCapacity()) {
+ for (int i = mMetaTileEntity.dechargerSlotStartIndex(),
+ k = mMetaTileEntity.dechargerSlotCount() + i;
+ i < k;
+ i++) {
+ if (mMetaTileEntity.mInventory[i] != null
+ && mMetaTileEntity.getEUVar() < aBaseMetaTileEntity.getEUCapacity()) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits(
+ GT_ModHandler.dischargeElectricItem(
+ mMetaTileEntity.mInventory[i],
+ (int) Math.min(
+ V[mTier] * 15,
+ aBaseMetaTileEntity.getEUCapacity()
+ - aBaseMetaTileEntity.getStoredEU()),
+ (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()),
+ true,
+ false,
+ false),
+ true);
+ if (mMetaTileEntity.mInventory[i].stackSize <= 0) mMetaTileEntity.mInventory[i] = null;
+ }
+ }
+ }
+ }
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTimer);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java
index 1251c42ae3..7f09abf177 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java
@@ -1,9 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import java.lang.reflect.Field;
-
import com.google.common.collect.BiMap;
-
import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -14,6 +11,7 @@ import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
+import java.lang.reflect.Field;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.Fluid;
@@ -22,198 +20,201 @@ import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Output {
- public final AutoMap<Fluid> mFluidsToUse = new AutoMap<Fluid>();
- public final int mFluidCapacity;
- private int mTotalPlasmaSupported = -1;
-
- public GT_MetaTileEntity_Hatch_Plasma(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, 6);
- mFluidCapacity = 256000;
- initHatch();
- }
-
- public GT_MetaTileEntity_Hatch_Plasma(final String aName, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, 6, aDescription, aTextures);
- mFluidCapacity = 256000;
- initHatch();
- }
-
- public GT_MetaTileEntity_Hatch_Plasma(final String aName, final String[] aDescription,
- final ITexture[][][] aTextures) {
- super(aName, 6, aDescription[0], aTextures);
- mFluidCapacity = 256000;
- initHatch();
- }
-
- private void initHatch() {
-
- //Get all Plasmas, but the easiest way to do this is to just ask the Fluid Registry what exists and filter through them lazily.
- Field fluidNameCache;
-
- fluidNameCache = ReflectionUtils.getField(FluidRegistry.class, "fluidNames");
-
- AutoMap<String> mValidPlasmaNameCache = new AutoMap<String>();
- if (fluidNameCache != null) {
- try {
- Object fluidNames = fluidNameCache.get(null);
- if (fluidNames != null) {
- try {
- @SuppressWarnings("unchecked")
- BiMap<Integer, String> fluidNamesMap = (BiMap<Integer, String>) fluidNames;
- if (fluidNamesMap != null) {
- for (String g : fluidNamesMap.values()) {
- if (g.toLowerCase().contains("plasma")) {
- mValidPlasmaNameCache.put(g);
- }
- }
- }
- } catch (ClassCastException e) {
- }
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
-
- AutoMap<Fluid> mPlasmaCache = new AutoMap<Fluid>();
- if (!mValidPlasmaNameCache.isEmpty()) {
- for (String y : mValidPlasmaNameCache) {
- Fluid t = FluidRegistry.getFluid(y);
- if (t != null) {
- if (t.getTemperature() > 1000) {
- mPlasmaCache.put(t);
- }
- }
- }
- }
-
- if (!mPlasmaCache.isEmpty()) {
- for (Fluid w : mPlasmaCache) {
- mFluidsToUse.put(w);
- }
- }
-
-
-
-
-
- }
-
- public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture };
- }
-
- public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture };
- }
-
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) {
- for (Fluid f : mFluidsToUse) {
- if (f != null) {
- if (GT_Utility.getFluidForFilledItem(aStack, true).getFluid() == f) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- for (Fluid f : mFluidsToUse) {
- if (f != null) {
- if (aFluid.getFluid() == f) {
- return true;
- }
- }
- }
- return false;
- }
-
- public int getCapacity() {
- return this.mFluidCapacity;
- }
-
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Plasma(this.mName, this.mDescription, this.mTextures);
- }
-
- @Override
- public String[] getDescription() {
-
- if (mTotalPlasmaSupported < 0) {
- if (mFluidsToUse.isEmpty()) {
- mTotalPlasmaSupported = 0;
- }
- else {
- mTotalPlasmaSupported = mFluidsToUse.size();
- }
- }
-
- String aX = EnumChatFormatting.GRAY+"";
- String a1 = EnumChatFormatting.GOLD+"Refined containment"+aX;
- String a2 = EnumChatFormatting.GOLD+"Capacity: "+EnumChatFormatting.DARK_AQUA+getCapacity()+"L"+aX;
- String a3 = EnumChatFormatting.GOLD+"Supports "+EnumChatFormatting.DARK_RED+mTotalPlasmaSupported+EnumChatFormatting.GOLD+" types of plasma"+aX;
-
-
-
- String[] s2 = new String[]{
- a1, a2, a3, CORE.GT_Tooltip
- };
- return s2;
- }
-
- @Override
- public boolean doesFillContainers() {
- return true;
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- // TODO Auto-generated method stub
- return super.getTextureSet(aTextures);
- }
-
- private Field F1, F2;
-
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- byte a1 = 0, a2 = 0;
- try {
- if (F1 == null) {
- F1 = ReflectionUtils.getField(getClass(), "actualTexture");
- }
- if (F2 == null) {
- F2 = ReflectionUtils.getField(getClass(), "mTexturePage");
- }
-
- if (F1 != null) {
- a1 = F1.getByte(this);
- }
- if (F2 != null) {
- a2 = F2.getByte(this);
- }
- }
- catch (IllegalArgumentException | IllegalAccessException n) {}
-
- int textureIndex = a1 | a2 << 7;
- byte texturePointer = (byte) (a1 & 127);
-
-
-
- if (aSide == 1 || aSide == 0) {
- ITexture g = textureIndex > 0 ? StaticFields59.getCasingTexturePages(a2, texturePointer) : BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1];
-
- return new ITexture[] {g};
- }
-
- return aSide != aFacing ?
- (textureIndex > 0 ? new ITexture[] { StaticFields59.getCasingTexturePages(a2, texturePointer) } : new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1] })
- : (textureIndex > 0 ? (aActive ? this.getTexturesActive(StaticFields59.getCasingTexturePages(a2, texturePointer)) : this.getTexturesInactive(StaticFields59.getCasingTexturePages(a2, texturePointer)))
- : (aActive ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]) : this.getTexturesInactive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1])));
- }
-
+ public final AutoMap<Fluid> mFluidsToUse = new AutoMap<Fluid>();
+ public final int mFluidCapacity;
+ private int mTotalPlasmaSupported = -1;
+
+ public GT_MetaTileEntity_Hatch_Plasma(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional, 6);
+ mFluidCapacity = 256000;
+ initHatch();
+ }
+
+ public GT_MetaTileEntity_Hatch_Plasma(
+ final String aName, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 6, aDescription, aTextures);
+ mFluidCapacity = 256000;
+ initHatch();
+ }
+
+ public GT_MetaTileEntity_Hatch_Plasma(
+ final String aName, final String[] aDescription, final ITexture[][][] aTextures) {
+ super(aName, 6, aDescription[0], aTextures);
+ mFluidCapacity = 256000;
+ initHatch();
+ }
+
+ private void initHatch() {
+
+ // Get all Plasmas, but the easiest way to do this is to just ask the Fluid Registry what exists and filter
+ // through them lazily.
+ Field fluidNameCache;
+
+ fluidNameCache = ReflectionUtils.getField(FluidRegistry.class, "fluidNames");
+
+ AutoMap<String> mValidPlasmaNameCache = new AutoMap<String>();
+ if (fluidNameCache != null) {
+ try {
+ Object fluidNames = fluidNameCache.get(null);
+ if (fluidNames != null) {
+ try {
+ @SuppressWarnings("unchecked")
+ BiMap<Integer, String> fluidNamesMap = (BiMap<Integer, String>) fluidNames;
+ if (fluidNamesMap != null) {
+ for (String g : fluidNamesMap.values()) {
+ if (g.toLowerCase().contains("plasma")) {
+ mValidPlasmaNameCache.put(g);
+ }
+ }
+ }
+ } catch (ClassCastException e) {
+ }
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+
+ AutoMap<Fluid> mPlasmaCache = new AutoMap<Fluid>();
+ if (!mValidPlasmaNameCache.isEmpty()) {
+ for (String y : mValidPlasmaNameCache) {
+ Fluid t = FluidRegistry.getFluid(y);
+ if (t != null) {
+ if (t.getTemperature() > 1000) {
+ mPlasmaCache.put(t);
+ }
+ }
+ }
+ }
+
+ if (!mPlasmaCache.isEmpty()) {
+ for (Fluid w : mPlasmaCache) {
+ mFluidsToUse.put(w);
+ }
+ }
+ }
+
+ public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture};
+ }
+
+ public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture};
+ }
+
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) {
+ for (Fluid f : mFluidsToUse) {
+ if (f != null) {
+ if (GT_Utility.getFluidForFilledItem(aStack, true).getFluid() == f) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean isFluidInputAllowed(final FluidStack aFluid) {
+ for (Fluid f : mFluidsToUse) {
+ if (f != null) {
+ if (aFluid.getFluid() == f) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public int getCapacity() {
+ return this.mFluidCapacity;
+ }
+
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Plasma(this.mName, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+
+ if (mTotalPlasmaSupported < 0) {
+ if (mFluidsToUse.isEmpty()) {
+ mTotalPlasmaSupported = 0;
+ } else {
+ mTotalPlasmaSupported = mFluidsToUse.size();
+ }
+ }
+
+ String aX = EnumChatFormatting.GRAY + "";
+ String a1 = EnumChatFormatting.GOLD + "Refined containment" + aX;
+ String a2 = EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.DARK_AQUA + getCapacity() + "L" + aX;
+ String a3 = EnumChatFormatting.GOLD + "Supports " + EnumChatFormatting.DARK_RED + mTotalPlasmaSupported
+ + EnumChatFormatting.GOLD + " types of plasma" + aX;
+
+ String[] s2 = new String[] {a1, a2, a3, CORE.GT_Tooltip};
+ return s2;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return true;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ // TODO Auto-generated method stub
+ return super.getTextureSet(aTextures);
+ }
+
+ private Field F1, F2;
+
+ @Override
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ byte a1 = 0, a2 = 0;
+ try {
+ if (F1 == null) {
+ F1 = ReflectionUtils.getField(getClass(), "actualTexture");
+ }
+ if (F2 == null) {
+ F2 = ReflectionUtils.getField(getClass(), "mTexturePage");
+ }
+
+ if (F1 != null) {
+ a1 = F1.getByte(this);
+ }
+ if (F2 != null) {
+ a2 = F2.getByte(this);
+ }
+ } catch (IllegalArgumentException | IllegalAccessException n) {
+ }
+
+ int textureIndex = a1 | a2 << 7;
+ byte texturePointer = (byte) (a1 & 127);
+
+ if (aSide == 1 || aSide == 0) {
+ ITexture g = textureIndex > 0
+ ? StaticFields59.getCasingTexturePages(a2, texturePointer)
+ : BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1];
+
+ return new ITexture[] {g};
+ }
+
+ return aSide != aFacing
+ ? (textureIndex > 0
+ ? new ITexture[] {StaticFields59.getCasingTexturePages(a2, texturePointer)}
+ : new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]})
+ : (textureIndex > 0
+ ? (aActive
+ ? this.getTexturesActive(StaticFields59.getCasingTexturePages(a2, texturePointer))
+ : this.getTexturesInactive(StaticFields59.getCasingTexturePages(a2, texturePointer)))
+ : (aActive
+ ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1])
+ : this.getTexturesInactive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1])));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java
index 75c5dbb9ee..0a2ccdb8e5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java
@@ -18,106 +18,109 @@ import net.minecraftforge.fluids.IFluidHandler;
public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_FluidGenerator {
- private static Block sBlock_EIO;
- private static Block sBlock_RIO;
-
- public GT_MetaTileEntity_Hatch_Reservoir(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier);
- }
-
- public GT_MetaTileEntity_Hatch_Reservoir(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
-
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_Reservoir(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public String[] getCustomTooltip() {
- String[] aTooltip = new String[3];
- aTooltip[0] = "Requires a Block of water facing the intake";
- aTooltip[1] = "Infinite water supply hatch";
- aTooltip[2] = "Creates 8000L of Water every 4 ticks";
- return aTooltip;
- }
-
- @Override
- public Fluid getFluidToGenerate() {
- return FluidRegistry.WATER;
- }
-
- @Override
- public int getAmountOfFluidToGenerate() {
- return 8000;
- }
-
- @Override
- public int getMaxTickTime() {
- return 4;
- }
-
- @Override
- public int getCapacity() {
- return 256000;
- }
-
- private static void setCrossModData() {
- if (LoadedMods.EnderIO && sBlock_EIO == null) {
- sBlock_EIO = GameRegistry.findBlock("EnderIO", "blockReservoir");
- }
- if (LoadedMods.RemoteIO && sBlock_RIO == null) {
- sBlock_RIO = GameRegistry.findBlock("RIO", "machine");
- }
- }
-
- public static boolean isTileValid(TileEntity aTile) {
- if (aTile != null) {
- if (aTile instanceof IFluidHandler) {
- IFluidHandler aFluidHandler = (IFluidHandler) aTile;
- return aFluidHandler.canDrain(ForgeDirection.UNKNOWN, FluidRegistry.WATER);
- }
- }
- return false;
- }
-
- @Override
- public boolean doesHatchMeetConditionsToGenerate() {
- Block aWater = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getFrontFacing());
- if (aWater != null && aWater != Blocks.air) {
- if (!this.canTankBeFilled()) {
- return false;
- }
- setCrossModData();
- if (LoadedMods.EnderIO) {
- if (aWater == sBlock_EIO) {
- return isTileValid(this.getBaseMetaTileEntity().getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing()));
- }
- }
- if (LoadedMods.RemoteIO) {
- if (aWater == sBlock_RIO && this.getBaseMetaTileEntity().getMetaIDAtSide(this.getBaseMetaTileEntity().getFrontFacing()) == 0) {
- return isTileValid(this.getBaseMetaTileEntity().getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing()));
- }
- }
- return aWater == Blocks.water || aWater == Blocks.flowing_water;
- }
- return false;
- }
-
- @Override
- public void generateParticles(World aWorld, String name) {
-
- }
-
- public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture,
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)};
- }
-
- public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture,
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)};
- }
+ private static Block sBlock_EIO;
+ private static Block sBlock_RIO;
+ public GT_MetaTileEntity_Hatch_Reservoir(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ }
+
+ public GT_MetaTileEntity_Hatch_Reservoir(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_Reservoir(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public String[] getCustomTooltip() {
+ String[] aTooltip = new String[3];
+ aTooltip[0] = "Requires a Block of water facing the intake";
+ aTooltip[1] = "Infinite water supply hatch";
+ aTooltip[2] = "Creates 8000L of Water every 4 ticks";
+ return aTooltip;
+ }
+
+ @Override
+ public Fluid getFluidToGenerate() {
+ return FluidRegistry.WATER;
+ }
+
+ @Override
+ public int getAmountOfFluidToGenerate() {
+ return 8000;
+ }
+
+ @Override
+ public int getMaxTickTime() {
+ return 4;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 256000;
+ }
+
+ private static void setCrossModData() {
+ if (LoadedMods.EnderIO && sBlock_EIO == null) {
+ sBlock_EIO = GameRegistry.findBlock("EnderIO", "blockReservoir");
+ }
+ if (LoadedMods.RemoteIO && sBlock_RIO == null) {
+ sBlock_RIO = GameRegistry.findBlock("RIO", "machine");
+ }
+ }
+
+ public static boolean isTileValid(TileEntity aTile) {
+ if (aTile != null) {
+ if (aTile instanceof IFluidHandler) {
+ IFluidHandler aFluidHandler = (IFluidHandler) aTile;
+ return aFluidHandler.canDrain(ForgeDirection.UNKNOWN, FluidRegistry.WATER);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean doesHatchMeetConditionsToGenerate() {
+ Block aWater = this.getBaseMetaTileEntity()
+ .getBlockAtSide(this.getBaseMetaTileEntity().getFrontFacing());
+ if (aWater != null && aWater != Blocks.air) {
+ if (!this.canTankBeFilled()) {
+ return false;
+ }
+ setCrossModData();
+ if (LoadedMods.EnderIO) {
+ if (aWater == sBlock_EIO) {
+ return isTileValid(this.getBaseMetaTileEntity()
+ .getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing()));
+ }
+ }
+ if (LoadedMods.RemoteIO) {
+ if (aWater == sBlock_RIO
+ && this.getBaseMetaTileEntity()
+ .getMetaIDAtSide(
+ this.getBaseMetaTileEntity().getFrontFacing())
+ == 0) {
+ return isTileValid(this.getBaseMetaTileEntity()
+ .getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing()));
+ }
+ }
+ return aWater == Blocks.water || aWater == Blocks.flowing_water;
+ }
+ return false;
+ }
+
+ @Override
+ public void generateParticles(World aWorld, String name) {}
+
+ public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)};
+ }
+
+ public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java
index f1dd131a67..2f3574ed5d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java
@@ -10,225 +10,302 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gtPlusPlus.core.lib.CORE;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.lib.CORE;
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_Hatch_Steam_BusInput extends GT_MetaTileEntity_Hatch {
- public GT_Recipe_Map mRecipeMap = null;
- public boolean disableSort;
-
- public GT_MetaTileEntity_Hatch_Steam_BusInput(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, getSlots(aTier), new String[]{
- "Item Input for Steam Multiblocks",
- "Shift + right click with screwdriver to toggle automatic item shuffling",
- "Capacity: 4 stacks",
- "Does not work with non-steam multiblocks",
- CORE.GT_Tooltip});
- }
-
- public GT_MetaTileEntity_Hatch_Steam_BusInput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 4, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Hatch_Steam_BusInput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 4, 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_Steam_BusInput(mName, mTier, mDescriptionArray, 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) {
- return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Steam 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() {
- if (disableSort) {
- for (int i = 0; i < mInventory.length; i++)
- if (mInventory[i] != null && mInventory[i].stackSize <= 0)
- mInventory[i] = null;
- } else {
- 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 void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("disableSort", disableSort);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- disableSort = aNBT.getBoolean("disableSort");
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aPlayer.isSneaking()) {
- disableSort = !disableSort;
- GT_Utility.sendChatToPlayer(aPlayer, trans("200", "Automatic Item Shuffling: " + (disableSort ? "Disabled" : "Enabled")));
- }
- }
-
- public String trans(String aKey, String aEnglish) {
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
- }
-
- @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));
- }
-
-
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- ITexture[][][] rTextures = new ITexture[14][17][];
- 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;
- }
-
- public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)};
- }
-
- public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)};
- }
-
- public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)};
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)};
- }
-
- public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)};
- }
-
- public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)};
- }
-
- public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)};
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)};
- }
-
- public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
- public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
- }
-
-
+ public GT_Recipe_Map mRecipeMap = null;
+ public boolean disableSort;
+
+ public GT_MetaTileEntity_Hatch_Steam_BusInput(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, getSlots(aTier), new String[] {
+ "Item Input for Steam Multiblocks",
+ "Shift + right click with screwdriver to toggle automatic item shuffling",
+ "Capacity: 4 stacks",
+ "Does not work with non-steam multiblocks",
+ CORE.GT_Tooltip
+ });
+ }
+
+ public GT_MetaTileEntity_Hatch_Steam_BusInput(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 4, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_Hatch_Steam_BusInput(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 4, 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_Steam_BusInput(mName, mTier, mDescriptionArray, 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) {
+ return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Steam 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() {
+ if (disableSort) {
+ for (int i = 0; i < mInventory.length; i++)
+ if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null;
+ } else {
+ 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 void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("disableSort", disableSort);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ disableSort = aNBT.getBoolean("disableSort");
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aPlayer.isSneaking()) {
+ disableSort = !disableSort;
+ GT_Utility.sendChatToPlayer(
+ aPlayer, trans("200", "Automatic Item Shuffling: " + (disableSort ? "Disabled" : "Enabled")));
+ }
+ }
+
+ public String trans(String aKey, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ }
+
+ @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));
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[14][17][];
+ 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;
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE)
+ };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE)
+ };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE)
+ };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE)
+ };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)
+ };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)
+ };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM
+ : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)
+ };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM
+ : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)
+ };
+ }
+
+ public ITexture[] getBottomFacingPipeActive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM
+ : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
+ }
+
+ public ITexture[] getBottomFacingPipeInactive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM
+ : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
+ }
+
+ public ITexture[] getTopFacingPipeActive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
+ }
+
+ public ITexture[] getTopFacingPipeInactive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
+ }
+
+ public ITexture[] getSideFacingPipeActive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
+ }
+
+ public ITexture[] getSideFacingPipeInactive(byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java
index 2fb3fea084..fa5cf4bd5b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java
@@ -15,28 +15,32 @@ import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Hatch_Steam_BusOutput extends GT_MetaTileEntity_Hatch {
public GT_MetaTileEntity_Hatch_Steam_BusOutput(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 4, new String[]{"Item Output for Steam Multiblocks",
- "Capacity: 4 stacks",
- "Does not work with non-steam multiblocks",
- CORE.GT_Tooltip});
+ super(aID, aName, aNameRegional, aTier, 4, new String[] {
+ "Item Output for Steam Multiblocks",
+ "Capacity: 4 stacks",
+ "Does not work with non-steam multiblocks",
+ CORE.GT_Tooltip
+ });
}
- public GT_MetaTileEntity_Hatch_Steam_BusOutput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_Steam_BusOutput(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 4, aDescription, aTextures);
}
- public GT_MetaTileEntity_Hatch_Steam_BusOutput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_Steam_BusOutput(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 4, aDescription, aTextures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ 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)};
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
}
@Override
@@ -73,12 +77,12 @@ public class GT_MetaTileEntity_Hatch_Steam_BusOutput extends GT_MetaTileEntity_H
@Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity);
+ return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity);
}
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Steam Output Bus");
+ return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Steam Output Bus");
}
@Override
@@ -90,8 +94,6 @@ public class GT_MetaTileEntity_Hatch_Steam_BusOutput extends GT_MetaTileEntity_H
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
-
-
@Override
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
@@ -114,62 +116,128 @@ public class GT_MetaTileEntity_Hatch_Steam_BusOutput extends GT_MetaTileEntity_H
}
return rTextures;
}
-
-
public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE)
+ };
}
public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE)
+ };
}
public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE)
+ };
}
public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE)
+ };
}
public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)
+ };
}
public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)
+ };
}
public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM
+ : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)
+ };
}
public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM
+ : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)
+ };
}
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM
+ : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM
+ : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ mTier == 1
+ ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE
+ : Textures.BlockIcons.MACHINE_BRONZE_SIDE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java
index 69f7f98606..5973d21fc5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java
@@ -30,376 +30,389 @@ import net.minecraft.nbt.NBTTagCompound;
@SuppressWarnings("deprecation")
public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch {
- public boolean mHasController = false;
- public boolean mUsingAnimation = true;
- private String mControllerLocation;
- public int mEUt = 0;
-
- public GT_MetaTileEntity_Hatch_Turbine(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 16, "Turbine Rotor holder for XL Turbines");
- }
-
- public GT_MetaTileEntity_Hatch_Turbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 1, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Hatch_Turbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 1, aDescription[0], aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- "Right Click with a soldering iron to reset controller link",
- "Right Click with a wrench to remove turbine",
- "Right Click with a screwdriver for technical information",
- "Sneak + Right Click with a wrench to rotate",
- "Sneak + Right Click with a screwdriver to disable animations",
- CORE.GT_Tooltip};
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, getFrontFacingTurbineTexture()};
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, getFrontFacingTurbineTexture()};
- }
-
- public int getEU() {
- return this.mEUt;
- }
-
- public void setEU(int aEU) {
- this.mEUt = aEU;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return false;
- }
-
- public boolean hasTurbine() {
- ItemStack aStack = this.mInventory[0];
- boolean aIsValid = GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(aStack);
- return aIsValid;
- }
-
- public ItemStack getTurbine() {
- if (hasTurbine()) {
- return this.mInventory[0];
- }
- return null;
- }
-
- public boolean canWork() {
- return hasTurbine();
- }
-
- public boolean insertTurbine(ItemStack aTurbine) {
- if (GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(aTurbine)) {
- this.mInventory[0] = aTurbine;
- return true;
- }
- return false;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_Turbine(mName, mTier, StaticFields59.getDescriptionArray(this), mTextures);
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- else {
- aBaseMetaTileEntity.openGUI(aPlayer);
- }
- return true;
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity, "Turbine Rotor Hatch");
- }
-
- @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 int getInventoryStackLimit() {
- return 1;
- }
-
- public void damageTurbine(int aEUt, int damageFactorLow, float damageFactorHigh) {
- if (hasTurbine() && MathUtils.randInt(0, 1) == 0) {
- ItemStack aTurbine = getTurbine();
- ((GT_MetaGenerated_Tool) aTurbine.getItem()).doDamage(aTurbine, (long)getDamageToComponent(aTurbine) * (long) Math.min(aEUt / damageFactorLow, Math.pow(aEUt, damageFactorHigh)));
- }
- }
-
- private final int getDamageToComponent(ItemStack aStack) {
- return 1;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mHasController", mHasController);
- aNBT.setBoolean("mUsingAnimation", mUsingAnimation);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mHasController = aNBT.getBoolean("mHasController");
- mUsingAnimation = aNBT.getBoolean("mUsingAnimation");
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (this.mHasController) {
- if (aTick % 20 == 0) {
- if (isControllerActive()) {
- this.getBaseMetaTileEntity().setActive(true);
- }
- else {
- this.getBaseMetaTileEntity().setActive(false);
- }
- }
- }
- else if (!this.mHasController && this.mControllerLocation != null) {
- //Weird Invalid State
- if (setController(BlockPos.generateBlockPos(mControllerLocation))) {
- //Valid
- }
- }
- else {
- //No Controller
- }
- if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0)
- this.mInventory[0] = null;
- }
-
- public boolean isControllerActive() {
- GregtechMetaTileEntity_LargerTurbineBase x = getController();
- if (x != null) {
- //Logger.INFO("Checking Status of Controller. Running? "+(x.mEUt > 0));
- return x.mEUt > 0;
- }
- //Logger.INFO("Status of Controller failed, controller is null.");
- return false;
- }
-
- public GregtechMetaTileEntity_LargerTurbineBase getController() {
- if (this.mHasController && this.mControllerLocation != null && this.mControllerLocation.length() > 0) {
- BlockPos p = BlockPos.generateBlockPos(mControllerLocation);
- if (p != null) {
- //Logger.INFO(p.getLocationString());
- IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntity(p.xPos, p.yPos,
- p.zPos);
- if (tTileEntity != null && tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_LargerTurbineBase) {
- return (GregtechMetaTileEntity_LargerTurbineBase) tTileEntity.getMetaTileEntity();
- }
- else {
- if (tTileEntity == null) {
- Logger.INFO("Controller MTE is null, somehow?");
- }
- else {
- Logger.INFO("Controller is a different MTE to expected");
- }
- }
- }
- }
- //Logger.INFO("Failed to Get Controller.");
- return null;
- }
-
- public boolean canSetNewController() {
- if ((mControllerLocation != null && mControllerLocation.length() > 0) || this.mHasController) {
- return false;
- }
- return true;
- }
-
- public boolean setController(BlockPos aPos) {
- clearController();
- if (canSetNewController()) {
- mControllerLocation = aPos.getUniqueIdentifier();
- mHasController = true;
- Logger.INFO("Successfully injected controller into this Turbine Assembly Hatch.");
- }
- return mHasController;
- }
-
- public void clearController() {
- this.mControllerLocation = null;
- this.mHasController = false;
- }
-
- public boolean usingAnimations() {
- return mUsingAnimation;
- }
-
- private ITexture getFrontFacingTurbineTexture() {
- if (!mHasController) {
- return this.getBaseMetaTileEntity().isActive() ? new GT_RenderedTexture(LargeTurbineTextureHandler.OVERLAY_LP_TURBINE_ACTIVE[4] ) : new GT_RenderedTexture(LargeTurbineTextureHandler.OVERLAY_LP_TURBINE[4] );
- }
- else {
- if (usingAnimations()) {
- if (isControllerActive()) {
- return getController().frontFaceActive;
- }
- }
- return getController().frontFace;
- }
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 0;
- }
-
- @Override
- public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
- return false;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(int aSide) {
- return new int[] {};
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return false;
- }
-
- public void setActive(boolean b) {
- this.getBaseMetaTileEntity().setActive(b);
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
- return false;
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (!aPlayer.isSneaking()) {
- PlayerUtils.messagePlayer(aPlayer, "Using Animations? "+usingAnimations());
- PlayerUtils.messagePlayer(aPlayer, "Has Controller? "+this.mHasController);
- if (mHasController) {
- PlayerUtils.messagePlayer(aPlayer, "Controller Location: "+BlockPos.generateBlockPos(mControllerLocation).getLocationString());
- PlayerUtils.messagePlayer(aPlayer, "Controller Active? "+this.isControllerActive());
- }
- PlayerUtils.messagePlayer(aPlayer, "Active? "+this.getBaseMetaTileEntity().isActive());
- PlayerUtils.messagePlayer(aPlayer, "Has Turbine inserted? "+this.hasTurbine());
- if (this.hasTurbine()) {
- Materials aMat = GT_MetaGenerated_Tool.getPrimaryMaterial(getTurbine());
- String aSize = GregtechMetaTileEntity_LargerTurbineBase.getTurbineSizeString(GregtechMetaTileEntity_LargerTurbineBase.getTurbineSize(getTurbine()));
- PlayerUtils.messagePlayer(aPlayer, "Using: "+aMat.mLocalizedName+" "+aSize);
- }
- }
- else {
- this.mUsingAnimation = Utils.invertBoolean(mUsingAnimation);
- if (this.mUsingAnimation) {
- PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture.");
- }
- }
- }
-
- @Override
- public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (this.getBaseMetaTileEntity().isServerSide() && !aPlayer.isSneaking()) {
- ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
- if (tCurrentItem != null) {
- if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) {
- return onToolClick(tCurrentItem, aPlayer, aWrenchingSide);
- }
- }
- }
- return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
- }
-
- @Override
- public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (this.getBaseMetaTileEntity().isServerSide()) {
- ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
- if (tCurrentItem != null) {
- if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) {
- return onToolClick(tCurrentItem, aPlayer, aWrenchingSide);
- }
- }
- }
- return false;
- }
-
- public boolean onToolClick(ItemStack tCurrentItem, EntityPlayer aPlayer, byte aSide) {
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) {
- boolean aHasTurbine = this.hasTurbine();
- if (aPlayer.inventory.getFirstEmptyStack() >= 0 && aHasTurbine) {
- if (PlayerUtils.isCreative(aPlayer) || GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- aPlayer.inventory.addItemStackToInventory((this.getTurbine()));
- this.mInventory[0] = null;
- GT_Utility.sendChatToPlayer(aPlayer, "Removed turbine with wrench.");
- return true;
- }
- }
- else {
- GT_Utility.sendChatToPlayer(aPlayer, aHasTurbine ? "Cannot remove turbine, no free inventory space." : "No turbine to remove.");
- }
- }
- else if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
- if (mControllerLocation != null && mControllerLocation.length() > 0) {
- if (setController(BlockPos.generateBlockPos(mControllerLocation))) {
- if (PlayerUtils.isCreative(aPlayer) || GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- String tChat = "Trying to Reset linked Controller";
- IGregTechTileEntity g = this.getBaseMetaTileEntity();
- GT_Utility.sendChatToPlayer(aPlayer, tChat);
- GT_Utility.sendSoundToPlayers(g.getWorld(), GregTech_API.sSoundList.get(101), 1.0F, -1, g.getXCoord(), g.getYCoord(), g.getZCoord());
- return true;
- }
- }
- }
- }
- return false;
- }
-
+ public boolean mHasController = false;
+ public boolean mUsingAnimation = true;
+ private String mControllerLocation;
+ public int mEUt = 0;
+
+ public GT_MetaTileEntity_Hatch_Turbine(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 16, "Turbine Rotor holder for XL Turbines");
+ }
+
+ public GT_MetaTileEntity_Hatch_Turbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 1, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_Hatch_Turbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 1, aDescription[0], aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Right Click with a soldering iron to reset controller link",
+ "Right Click with a wrench to remove turbine",
+ "Right Click with a screwdriver for technical information",
+ "Sneak + Right Click with a wrench to rotate",
+ "Sneak + Right Click with a screwdriver to disable animations",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, getFrontFacingTurbineTexture()};
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, getFrontFacingTurbineTexture()};
+ }
+
+ public int getEU() {
+ return this.mEUt;
+ }
+
+ public void setEU(int aEU) {
+ this.mEUt = aEU;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return false;
+ }
+
+ public boolean hasTurbine() {
+ ItemStack aStack = this.mInventory[0];
+ boolean aIsValid = GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(aStack);
+ return aIsValid;
+ }
+
+ public ItemStack getTurbine() {
+ if (hasTurbine()) {
+ return this.mInventory[0];
+ }
+ return null;
+ }
+
+ public boolean canWork() {
+ return hasTurbine();
+ }
+
+ public boolean insertTurbine(ItemStack aTurbine) {
+ if (GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(aTurbine)) {
+ this.mInventory[0] = aTurbine;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_Turbine(mName, mTier, StaticFields59.getDescriptionArray(this), mTextures);
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ } else {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ }
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity, "Turbine Rotor Hatch");
+ }
+
+ @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 int getInventoryStackLimit() {
+ return 1;
+ }
+
+ public void damageTurbine(int aEUt, int damageFactorLow, float damageFactorHigh) {
+ if (hasTurbine() && MathUtils.randInt(0, 1) == 0) {
+ ItemStack aTurbine = getTurbine();
+ ((GT_MetaGenerated_Tool) aTurbine.getItem())
+ .doDamage(
+ aTurbine,
+ (long) getDamageToComponent(aTurbine)
+ * (long) Math.min(aEUt / damageFactorLow, Math.pow(aEUt, damageFactorHigh)));
+ }
+ }
+
+ private final int getDamageToComponent(ItemStack aStack) {
+ return 1;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mHasController", mHasController);
+ aNBT.setBoolean("mUsingAnimation", mUsingAnimation);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mHasController = aNBT.getBoolean("mHasController");
+ mUsingAnimation = aNBT.getBoolean("mUsingAnimation");
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (this.mHasController) {
+ if (aTick % 20 == 0) {
+ if (isControllerActive()) {
+ this.getBaseMetaTileEntity().setActive(true);
+ } else {
+ this.getBaseMetaTileEntity().setActive(false);
+ }
+ }
+ } else if (!this.mHasController && this.mControllerLocation != null) {
+ // Weird Invalid State
+ if (setController(BlockPos.generateBlockPos(mControllerLocation))) {
+ // Valid
+ }
+ } else {
+ // No Controller
+ }
+ if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) this.mInventory[0] = null;
+ }
+
+ public boolean isControllerActive() {
+ GregtechMetaTileEntity_LargerTurbineBase x = getController();
+ if (x != null) {
+ // Logger.INFO("Checking Status of Controller. Running? "+(x.mEUt > 0));
+ return x.mEUt > 0;
+ }
+ // Logger.INFO("Status of Controller failed, controller is null.");
+ return false;
+ }
+
+ public GregtechMetaTileEntity_LargerTurbineBase getController() {
+ if (this.mHasController && this.mControllerLocation != null && this.mControllerLocation.length() > 0) {
+ BlockPos p = BlockPos.generateBlockPos(mControllerLocation);
+ if (p != null) {
+ // Logger.INFO(p.getLocationString());
+ IGregTechTileEntity tTileEntity =
+ getBaseMetaTileEntity().getIGregTechTileEntity(p.xPos, p.yPos, p.zPos);
+ if (tTileEntity != null
+ && tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_LargerTurbineBase) {
+ return (GregtechMetaTileEntity_LargerTurbineBase) tTileEntity.getMetaTileEntity();
+ } else {
+ if (tTileEntity == null) {
+ Logger.INFO("Controller MTE is null, somehow?");
+ } else {
+ Logger.INFO("Controller is a different MTE to expected");
+ }
+ }
+ }
+ }
+ // Logger.INFO("Failed to Get Controller.");
+ return null;
+ }
+
+ public boolean canSetNewController() {
+ if ((mControllerLocation != null && mControllerLocation.length() > 0) || this.mHasController) {
+ return false;
+ }
+ return true;
+ }
+
+ public boolean setController(BlockPos aPos) {
+ clearController();
+ if (canSetNewController()) {
+ mControllerLocation = aPos.getUniqueIdentifier();
+ mHasController = true;
+ Logger.INFO("Successfully injected controller into this Turbine Assembly Hatch.");
+ }
+ return mHasController;
+ }
+
+ public void clearController() {
+ this.mControllerLocation = null;
+ this.mHasController = false;
+ }
+
+ public boolean usingAnimations() {
+ return mUsingAnimation;
+ }
+
+ private ITexture getFrontFacingTurbineTexture() {
+ if (!mHasController) {
+ return this.getBaseMetaTileEntity().isActive()
+ ? new GT_RenderedTexture(LargeTurbineTextureHandler.OVERLAY_LP_TURBINE_ACTIVE[4])
+ : new GT_RenderedTexture(LargeTurbineTextureHandler.OVERLAY_LP_TURBINE[4]);
+ } else {
+ if (usingAnimations()) {
+ if (isControllerActive()) {
+ return getController().frontFaceActive;
+ }
+ }
+ return getController().frontFace;
+ }
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ return new int[] {};
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ return false;
+ }
+
+ public void setActive(boolean b) {
+ this.getBaseMetaTileEntity().setActive(b);
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (!aPlayer.isSneaking()) {
+ PlayerUtils.messagePlayer(aPlayer, "Using Animations? " + usingAnimations());
+ PlayerUtils.messagePlayer(aPlayer, "Has Controller? " + this.mHasController);
+ if (mHasController) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "Controller Location: "
+ + BlockPos.generateBlockPos(mControllerLocation).getLocationString());
+ PlayerUtils.messagePlayer(aPlayer, "Controller Active? " + this.isControllerActive());
+ }
+ PlayerUtils.messagePlayer(
+ aPlayer, "Active? " + this.getBaseMetaTileEntity().isActive());
+ PlayerUtils.messagePlayer(aPlayer, "Has Turbine inserted? " + this.hasTurbine());
+ if (this.hasTurbine()) {
+ Materials aMat = GT_MetaGenerated_Tool.getPrimaryMaterial(getTurbine());
+ String aSize = GregtechMetaTileEntity_LargerTurbineBase.getTurbineSizeString(
+ GregtechMetaTileEntity_LargerTurbineBase.getTurbineSize(getTurbine()));
+ PlayerUtils.messagePlayer(aPlayer, "Using: " + aMat.mLocalizedName + " " + aSize);
+ }
+ } else {
+ this.mUsingAnimation = Utils.invertBoolean(mUsingAnimation);
+ if (this.mUsingAnimation) {
+ PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture.");
+ }
+ }
+ }
+
+ @Override
+ public boolean onWrenchRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (this.getBaseMetaTileEntity().isServerSide() && !aPlayer.isSneaking()) {
+ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
+ if (tCurrentItem != null) {
+ if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) {
+ return onToolClick(tCurrentItem, aPlayer, aWrenchingSide);
+ }
+ }
+ }
+ return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
+ if (tCurrentItem != null) {
+ if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) {
+ return onToolClick(tCurrentItem, aPlayer, aWrenchingSide);
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean onToolClick(ItemStack tCurrentItem, EntityPlayer aPlayer, byte aSide) {
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) {
+ boolean aHasTurbine = this.hasTurbine();
+ if (aPlayer.inventory.getFirstEmptyStack() >= 0 && aHasTurbine) {
+ if (PlayerUtils.isCreative(aPlayer)
+ || GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ aPlayer.inventory.addItemStackToInventory((this.getTurbine()));
+ this.mInventory[0] = null;
+ GT_Utility.sendChatToPlayer(aPlayer, "Removed turbine with wrench.");
+ return true;
+ }
+ } else {
+ GT_Utility.sendChatToPlayer(
+ aPlayer,
+ aHasTurbine ? "Cannot remove turbine, no free inventory space." : "No turbine to remove.");
+ }
+ } else if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
+ if (mControllerLocation != null && mControllerLocation.length() > 0) {
+ if (setController(BlockPos.generateBlockPos(mControllerLocation))) {
+ if (PlayerUtils.isCreative(aPlayer)
+ || GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ String tChat = "Trying to Reset linked Controller";
+ IGregTechTileEntity g = this.getBaseMetaTileEntity();
+ GT_Utility.sendChatToPlayer(aPlayer, tChat);
+ GT_Utility.sendSoundToPlayers(
+ g.getWorld(),
+ GregTech_API.sSoundList.get(101),
+ 1.0F,
+ -1,
+ g.getXCoord(),
+ g.getYCoord(),
+ g.getZCoord());
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java
index 0b84f676f4..85b921b1ed 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java
@@ -23,198 +23,194 @@ import net.minecraft.world.chunk.Chunk;
public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_Hatch_InputBus {
- public GT_MetaTileEntity_Hatch_TurbineProvider(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier);
- }
-
- public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription[0], aTextures);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_TurbineProvider(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity, "Turbine Housing");
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- "An automation port for Large Turbines",
- "Will attempt once per 1200 ticks to fill the turbine slot of it's parent turbine",
- "You may adjust this with a screwdriver",
- "Hold shift to adjust in finer amounts",
- "Hold control to adjust direction",
- "Left Click with Screwdriver to reset",
- "This module assumes the entire turbine is in the same Chunk",
- CORE.GT_Tooltip};
- }
-
-
- private GT_MetaTileEntity_LargeTurbine mParent = null;
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- super.onPostTick(aBaseMetaTileEntity, aTimer);
- if (aTimer % mRefreshTime == 0 && this.getBaseMetaTileEntity().isServerSide()) {
- tryRefillTurbine();
- }
- }
-
- private final void tryFindParentTurbine() {
- Logger.INFO("This turbine housing has no parent, searching world.");
- IGregTechTileEntity T = this.getBaseMetaTileEntity();
- World W = T.getWorld();
- Chunk C = W.getChunkFromBlockCoords(T.getXCoord(), T.getZCoord());
- for (Object o : C.chunkTileEntityMap.values()) {
- if (o instanceof IGregTechTileEntity) {
- IGregTechTileEntity G = (IGregTechTileEntity) o;
- final IMetaTileEntity aMetaTileEntity = G.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- continue;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine) {
- GT_MetaTileEntity_LargeTurbine aTurb = (GT_MetaTileEntity_LargeTurbine) aMetaTileEntity;
- for (GT_MetaTileEntity_Hatch_InputBus ee : aTurb.mInputBusses) {
- if (ee.equals(this)) {
- mParent = aTurb;
- Logger.INFO("Found a Parent to attach to this housing.");
- return;
- }
- }
- }
- }
- }
- }
-
- private final void tryRefillTurbine() {
- if (mParent == null) {
- tryFindParentTurbine();
- }
- if (mParent != null && mParent.mInventory[1] == null) {
- for (ItemStack aStack : this.mInventory) {
- if (isItemStackTurbine(aStack)) {
- setGUIItemStack(aStack);
- }
- }
- }
- }
-
- protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) {
- boolean result = false;
- if (mParent.mInventory[1] == null) {
- mParent.mInventory[1] = aNewGuiSlotContents != null ? aNewGuiSlotContents.copy() : null;
- mParent.depleteInput(aNewGuiSlotContents);
- mParent.updateSlots();
- this.updateSlots();
- result = true;
- }
- return result;
- }
-
- public boolean isItemStackTurbine(ItemStack aStack) {
- if (aStack.getItem() instanceof GT_MetaGenerated_Tool) {
- if (aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 176) {
- return true;
- }
- }
- return false;
- }
-
- public boolean isItemStackScrewdriver(ItemStack aStack) {
- if (aStack.getItem() instanceof GT_MetaGenerated_Tool) {
- if (aStack.getItemDamage() == 22 || aStack.getItemDamage() == 150) {
- return true;
- }
- }
- return false;
- }
-
-
- @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 isItemStackTurbine(aStack);
- }
-
- private int mRefreshTime = 1200;
- private boolean mDescending = true;
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mRefreshTime", mRefreshTime);
- aNBT.setBoolean("mDescending", mDescending);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mRefreshTime = aNBT.getInteger("mRefreshTime");
- mDescending = aNBT.getBoolean("mDescending");
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aPlayer != null) {
- if (KeyboardUtils.isCtrlKeyDown()) {
- mDescending = Utils.invertBoolean(mDescending);
- PlayerUtils.messagePlayer(aPlayer, "Direction: "+(mDescending ? "DOWN" : "UP"));
- }
- else {
- int aAmount = 0;
- if (KeyboardUtils.isShiftKeyDown()) {
- aAmount = 10;
- }
- else {
- aAmount = 100;
- }
- if (mDescending) {
- mRefreshTime -= aAmount;
- if (mRefreshTime < 0) {
- mRefreshTime = 1200;
- }
- }
- else {
- mRefreshTime += aAmount;
- if (mRefreshTime > 1200) {
- mRefreshTime = 0;
- }
- }
- PlayerUtils.messagePlayer(aPlayer, "Set check time to be every "+mRefreshTime+" ticks.");
- }
- }
- }
-
- @Override
- public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- boolean aDidScrewdriver = false;
- if (aPlayer != null) {
- if (aPlayer.getHeldItem() != null) {
- if (isItemStackScrewdriver(aPlayer.getHeldItem())) {
- aDidScrewdriver = true;
- mRefreshTime = 1200;
- PlayerUtils.messagePlayer(aPlayer, "Reset check time to "+mRefreshTime+" ticks.");
- }
- }
- }
- if (!aDidScrewdriver) {
- super.onLeftclick(aBaseMetaTileEntity, aPlayer);
- }
- }
-
+ public GT_MetaTileEntity_Hatch_TurbineProvider(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ }
+ public GT_MetaTileEntity_Hatch_TurbineProvider(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_Hatch_TurbineProvider(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription[0], aTextures);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_TurbineProvider(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity, "Turbine Housing");
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "An automation port for Large Turbines",
+ "Will attempt once per 1200 ticks to fill the turbine slot of it's parent turbine",
+ "You may adjust this with a screwdriver",
+ "Hold shift to adjust in finer amounts",
+ "Hold control to adjust direction",
+ "Left Click with Screwdriver to reset",
+ "This module assumes the entire turbine is in the same Chunk",
+ CORE.GT_Tooltip
+ };
+ }
+
+ private GT_MetaTileEntity_LargeTurbine mParent = null;
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ super.onPostTick(aBaseMetaTileEntity, aTimer);
+ if (aTimer % mRefreshTime == 0 && this.getBaseMetaTileEntity().isServerSide()) {
+ tryRefillTurbine();
+ }
+ }
+
+ private final void tryFindParentTurbine() {
+ Logger.INFO("This turbine housing has no parent, searching world.");
+ IGregTechTileEntity T = this.getBaseMetaTileEntity();
+ World W = T.getWorld();
+ Chunk C = W.getChunkFromBlockCoords(T.getXCoord(), T.getZCoord());
+ for (Object o : C.chunkTileEntityMap.values()) {
+ if (o instanceof IGregTechTileEntity) {
+ IGregTechTileEntity G = (IGregTechTileEntity) o;
+ final IMetaTileEntity aMetaTileEntity = G.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ continue;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine) {
+ GT_MetaTileEntity_LargeTurbine aTurb = (GT_MetaTileEntity_LargeTurbine) aMetaTileEntity;
+ for (GT_MetaTileEntity_Hatch_InputBus ee : aTurb.mInputBusses) {
+ if (ee.equals(this)) {
+ mParent = aTurb;
+ Logger.INFO("Found a Parent to attach to this housing.");
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private final void tryRefillTurbine() {
+ if (mParent == null) {
+ tryFindParentTurbine();
+ }
+ if (mParent != null && mParent.mInventory[1] == null) {
+ for (ItemStack aStack : this.mInventory) {
+ if (isItemStackTurbine(aStack)) {
+ setGUIItemStack(aStack);
+ }
+ }
+ }
+ }
+
+ protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) {
+ boolean result = false;
+ if (mParent.mInventory[1] == null) {
+ mParent.mInventory[1] = aNewGuiSlotContents != null ? aNewGuiSlotContents.copy() : null;
+ mParent.depleteInput(aNewGuiSlotContents);
+ mParent.updateSlots();
+ this.updateSlots();
+ result = true;
+ }
+ return result;
+ }
+
+ public boolean isItemStackTurbine(ItemStack aStack) {
+ if (aStack.getItem() instanceof GT_MetaGenerated_Tool) {
+ if (aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 176) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean isItemStackScrewdriver(ItemStack aStack) {
+ if (aStack.getItem() instanceof GT_MetaGenerated_Tool) {
+ if (aStack.getItemDamage() == 22 || aStack.getItemDamage() == 150) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @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 isItemStackTurbine(aStack);
+ }
+
+ private int mRefreshTime = 1200;
+ private boolean mDescending = true;
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mRefreshTime", mRefreshTime);
+ aNBT.setBoolean("mDescending", mDescending);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mRefreshTime = aNBT.getInteger("mRefreshTime");
+ mDescending = aNBT.getBoolean("mDescending");
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aPlayer != null) {
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ mDescending = Utils.invertBoolean(mDescending);
+ PlayerUtils.messagePlayer(aPlayer, "Direction: " + (mDescending ? "DOWN" : "UP"));
+ } else {
+ int aAmount = 0;
+ if (KeyboardUtils.isShiftKeyDown()) {
+ aAmount = 10;
+ } else {
+ aAmount = 100;
+ }
+ if (mDescending) {
+ mRefreshTime -= aAmount;
+ if (mRefreshTime < 0) {
+ mRefreshTime = 1200;
+ }
+ } else {
+ mRefreshTime += aAmount;
+ if (mRefreshTime > 1200) {
+ mRefreshTime = 0;
+ }
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Set check time to be every " + mRefreshTime + " ticks.");
+ }
+ }
+ }
+
+ @Override
+ public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ boolean aDidScrewdriver = false;
+ if (aPlayer != null) {
+ if (aPlayer.getHeldItem() != null) {
+ if (isItemStackScrewdriver(aPlayer.getHeldItem())) {
+ aDidScrewdriver = true;
+ mRefreshTime = 1200;
+ PlayerUtils.messagePlayer(aPlayer, "Reset check time to " + mRefreshTime + " ticks.");
+ }
+ }
+ }
+ if (!aDidScrewdriver) {
+ super.onLeftclick(aBaseMetaTileEntity, aPlayer);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
index d0682b85e8..f144076131 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
@@ -15,134 +15,130 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_InputBus {
- public GT_MetaTileEntity_SuperBus_Input(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, getSlots(aTier));
- }
-
- public GT_MetaTileEntity_SuperBus_Input(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, getSlots(aTier), aDescription, aTextures);
- }
-
- /**
- * Returns a factor of 16 based on tier.
- *
- * @param aTier The tier of this bus.
- * @return (1 + aTier) * 16
- */
- public static int getSlots(int aTier) {
- return (1 + aTier) * 16;
- }
-
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE_IN)};
- }
-
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE_IN)};
- }
-
- public boolean isSimpleMachine() {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SuperBus_Input(this.mName, this.mTier, ArrayExt.of(this.mDescription), this.mTextures);
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public String[] getDescription() {
- String[] aDesc = new String[] {
- "Item Input for Multiblocks",
- "This bus has no GUI, but can have items extracted",
- ""+getSlots(this.mTier)+" Slots",
- CORE.GT_Tooltip
- };
- return aDesc;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
- float aY, float aZ) {
- return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- } else {
- //Logger.INFO("Trying to display Super Input Bus contents.");
- displayBusContents(aPlayer);
- return true;
- }
- }
-
- public void displayBusContents(EntityPlayer aPlayer) {
- String STRIP = "Item Array: ";
- String aNameString = ItemUtils.getArrayStackNames(getRealInventory());
- aNameString = aNameString.replace(STRIP, "");
-
- String[] aNames;
- if (aNameString.length() < 1) {
- aNames = null;
- }
- else {
- aNames = aNameString.split(",");
- }
-
- if (aNames == null || aNames.length <= 0) {
- PlayerUtils.messagePlayer(aPlayer, "This Super Bus (I) is Empty. Total Slots: "+getSlots(this.mTier));
- return;
- }
-
- PlayerUtils.messagePlayer(aPlayer, "This Super Bus (I) contains: ["+getRealInventory().length+"]");
-
- if (aNames.length <= 12) {
- for (String s : aNames) {
- if (s.startsWith(" ")) {
- s = s.substring(1);
- }
- //Logger.INFO("Trying to display Super Input Bus contents. "+s);
- PlayerUtils.messagePlayer(aPlayer, s);
- }
- }
- else {
-
- String superString = "";
-
- for (String s : aNames) {
- if (s.startsWith(" ")) {
- s = s.substring(1);
- }
- superString += (s+", ");
- }
- PlayerUtils.messagePlayer(aPlayer, superString);
- }
-
-
- }
-
-} \ No newline at end of file
+ public GT_MetaTileEntity_SuperBus_Input(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, getSlots(aTier));
+ }
+
+ public GT_MetaTileEntity_SuperBus_Input(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, getSlots(aTier), aDescription, aTextures);
+ }
+
+ /**
+ * Returns a factor of 16 based on tier.
+ *
+ * @param aTier The tier of this bus.
+ * @return (1 + aTier) * 16
+ */
+ public static int getSlots(int aTier) {
+ return (1 + aTier) * 16;
+ }
+
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE_IN)};
+ }
+
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE_IN)};
+ }
+
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_SuperBus_Input(
+ this.mName, this.mTier, ArrayExt.of(this.mDescription), this.mTextures);
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public String[] getDescription() {
+ String[] aDesc = new String[] {
+ "Item Input for Multiblocks",
+ "This bus has no GUI, but can have items extracted",
+ "" + getSlots(this.mTier) + " Slots",
+ CORE.GT_Tooltip
+ };
+ return aDesc;
+ }
+
+ @Override
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ } else {
+ // Logger.INFO("Trying to display Super Input Bus contents.");
+ displayBusContents(aPlayer);
+ return true;
+ }
+ }
+
+ public void displayBusContents(EntityPlayer aPlayer) {
+ String STRIP = "Item Array: ";
+ String aNameString = ItemUtils.getArrayStackNames(getRealInventory());
+ aNameString = aNameString.replace(STRIP, "");
+
+ String[] aNames;
+ if (aNameString.length() < 1) {
+ aNames = null;
+ } else {
+ aNames = aNameString.split(",");
+ }
+
+ if (aNames == null || aNames.length <= 0) {
+ PlayerUtils.messagePlayer(aPlayer, "This Super Bus (I) is Empty. Total Slots: " + getSlots(this.mTier));
+ return;
+ }
+
+ PlayerUtils.messagePlayer(aPlayer, "This Super Bus (I) contains: [" + getRealInventory().length + "]");
+
+ if (aNames.length <= 12) {
+ for (String s : aNames) {
+ if (s.startsWith(" ")) {
+ s = s.substring(1);
+ }
+ // Logger.INFO("Trying to display Super Input Bus contents. "+s);
+ PlayerUtils.messagePlayer(aPlayer, s);
+ }
+ } else {
+
+ String superString = "";
+
+ for (String s : aNames) {
+ if (s.startsWith(" ")) {
+ s = s.substring(1);
+ }
+ superString += (s + ", ");
+ }
+ PlayerUtils.messagePlayer(aPlayer, superString);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java
index 37aa57298a..7fecabd5d7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java
@@ -17,164 +17,170 @@ import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_OutputBus {
- public GT_MetaTileEntity_SuperBus_Output(int id, String name, String nameRegional, int tier) {
- super(id, name, nameRegional, tier, getSlots(tier));
- }
-
- public GT_MetaTileEntity_SuperBus_Output(String name, int tier, String[] description, ITexture[][][] textures) {
- super(name, tier, getSlots(tier), description, textures);
- }
-
- /**
- * Returns a factor of 16 based on tier.
- *
- * @param aTier The tier of this bus.
- * @return (1 + aTier) * 16
- */
- public static int getSlots(int aTier) {
- return (1 + aTier) * 16;
- }
-
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SuperBus_Output(this.mName, this.mTier, ArrayExt.of(this.mDescription), this.mTextures);
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
- this.fillStacksIntoFirstSlots();
- }
+ public GT_MetaTileEntity_SuperBus_Output(int id, String name, String nameRegional, int tier) {
+ super(id, name, nameRegional, tier, getSlots(tier));
+ }
+
+ public GT_MetaTileEntity_SuperBus_Output(String name, int tier, String[] description, ITexture[][][] textures) {
+ super(name, tier, getSlots(tier), description, textures);
+ }
+
+ /**
+ * Returns a factor of 16 based on tier.
+ *
+ * @param aTier The tier of this bus.
+ * @return (1 + aTier) * 16
+ */
+ public static int getSlots(int aTier) {
+ return (1 + aTier) * 16;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_SuperBus_Output(
+ this.mName, this.mTier, ArrayExt.of(this.mDescription), this.mTextures);
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ this.fillStacksIntoFirstSlots();
+ }
super.onPostTick(aBaseMetaTileEntity, aTimer);
- }
-
- public void updateSlots() {
- for (int i = 0; i < this.mInventory.length; ++i) {
- if (this.mInventory[i] != null && this.mInventory[i].stackSize <= 0) {
- this.mInventory[i] = null;
- }
- }
- this.fillStacksIntoFirstSlots();
- }
-
- protected void fillStacksIntoFirstSlots() {
- for (int i = 0; i < this.mInventory.length; ++i) {
- for (int j = i + 1; j < this.mInventory.length; ++j) {
- if (this.mInventory[j] != null && (this.mInventory[i] == null
- || GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j]))) {
- GT_Utility.moveStackFromSlotAToSlotB((IInventory) this.getBaseMetaTileEntity(), (IInventory) this.getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- }
- }
- }
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public String[] getDescription() {
- String[] aDesc = new String[] {
- "Item Output for Multiblocks",
- "This bus has no GUI",
- ""+getSlots(this.mTier)+" Slots",
- CORE.GT_Tooltip
- };
- return aDesc;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
- float aY, float aZ) {
- return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- } else {
- displayBusContents(aPlayer);
- return true;
- }
- }
-
- public void displayBusContents(EntityPlayer aPlayer) {
- String STRIP = "Item Array: ";
- String aNameString = ItemUtils.getArrayStackNames(getRealInventory());
- aNameString = aNameString.replace(STRIP, "");
-
- String[] aNames;
- if (aNameString.length() < 1) {
- aNames = null;
- }
- else {
- aNames = aNameString.split(",");
- }
-
- if (aNames == null || aNames.length <= 0) {
- PlayerUtils.messagePlayer(aPlayer, "This Super Bus (O) is Empty. Total Slots: "+getSlots(this.mTier));
- return;
- }
-
- PlayerUtils.messagePlayer(aPlayer, "This Super Bus (O) contains:");
- for (String s : aNames) {
- if (s.startsWith(" ")) {
- s = s.substring(1);
- }
- //Logger.INFO("Trying to display Super Output Bus contents. "+s);
- PlayerUtils.messagePlayer(aPlayer, s);
- }
- }
-
- @Override
- public int getMaxItemCount() {
- // TODO Auto-generated method stub
- return super.getMaxItemCount();
- }
-
- @Override
- public int getSizeInventory() {
- // TODO Auto-generated method stub
- return super.getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(int aIndex) {
- // TODO Auto-generated method stub
- return super.getStackInSlot(aIndex);
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- // TODO Auto-generated method stub
- return super.canInsertItem(aIndex, aStack, aSide);
- }
-
- @Override
- public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
- // TODO Auto-generated method stub
- return super.canExtractItem(aIndex, aStack, aSide);
- }
-
- @Override
- public ItemStack[] getRealInventory() {
- // TODO Auto-generated method stub
- return super.getRealInventory();
- }
-} \ No newline at end of file
+ }
+
+ public void updateSlots() {
+ for (int i = 0; i < this.mInventory.length; ++i) {
+ if (this.mInventory[i] != null && this.mInventory[i].stackSize <= 0) {
+ this.mInventory[i] = null;
+ }
+ }
+ this.fillStacksIntoFirstSlots();
+ }
+
+ protected void fillStacksIntoFirstSlots() {
+ for (int i = 0; i < this.mInventory.length; ++i) {
+ for (int j = i + 1; j < this.mInventory.length; ++j) {
+ if (this.mInventory[j] != null
+ && (this.mInventory[i] == null
+ || GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j]))) {
+ GT_Utility.moveStackFromSlotAToSlotB(
+ (IInventory) this.getBaseMetaTileEntity(),
+ (IInventory) this.getBaseMetaTileEntity(),
+ j,
+ i,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public String[] getDescription() {
+ String[] aDesc = new String[] {
+ "Item Output for Multiblocks", "This bus has no GUI", "" + getSlots(this.mTier) + " Slots", CORE.GT_Tooltip
+ };
+ return aDesc;
+ }
+
+ @Override
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ } else {
+ displayBusContents(aPlayer);
+ return true;
+ }
+ }
+
+ public void displayBusContents(EntityPlayer aPlayer) {
+ String STRIP = "Item Array: ";
+ String aNameString = ItemUtils.getArrayStackNames(getRealInventory());
+ aNameString = aNameString.replace(STRIP, "");
+
+ String[] aNames;
+ if (aNameString.length() < 1) {
+ aNames = null;
+ } else {
+ aNames = aNameString.split(",");
+ }
+
+ if (aNames == null || aNames.length <= 0) {
+ PlayerUtils.messagePlayer(aPlayer, "This Super Bus (O) is Empty. Total Slots: " + getSlots(this.mTier));
+ return;
+ }
+
+ PlayerUtils.messagePlayer(aPlayer, "This Super Bus (O) contains:");
+ for (String s : aNames) {
+ if (s.startsWith(" ")) {
+ s = s.substring(1);
+ }
+ // Logger.INFO("Trying to display Super Output Bus contents. "+s);
+ PlayerUtils.messagePlayer(aPlayer, s);
+ }
+ }
+
+ @Override
+ public int getMaxItemCount() {
+ // TODO Auto-generated method stub
+ return super.getMaxItemCount();
+ }
+
+ @Override
+ public int getSizeInventory() {
+ // TODO Auto-generated method stub
+ return super.getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex) {
+ // TODO Auto-generated method stub
+ return super.getStackInSlot(aIndex);
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ // TODO Auto-generated method stub
+ return super.canInsertItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ // TODO Auto-generated method stub
+ return super.canExtractItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public ItemStack[] getRealInventory() {
+ // TODO Auto-generated method stub
+ return super.getRealInventory();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
index f6e778f989..8f7fd8d4d3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
@@ -13,107 +13,167 @@ import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import net.minecraft.util.EnumChatFormatting;
public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid {
-
-
- public static final boolean mGt6Pipe;
-
- static {
- mGt6Pipe = StaticFields59.mGT6StylePipes;
- }
-
- public final GT_Materials mMaterial;
- private boolean mCheckConnections;
-
-
- public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial,
- int aCapacity, int aHeatResistance, boolean aGasProof) {
- this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
- }
-
- public GregtechMetaPipeEntityFluid(final String aName, final float aThickNess, final GT_Materials aMaterial, final int aCapacity, final int aHeatResistance, final boolean aGasProof) {
- this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
- }
- public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial,
- int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
- super(aID, aName, aNameRegional, aThickNess, null, aCapacity, aHeatResistance, aGasProof);
- this.mLastReceivedFrom = 0;
- this.oLastReceivedFrom = 0;
- this.mCheckConnections = !mGt6Pipe;
- this.mMaterial = aMaterial;
- }
-
+ public static final boolean mGt6Pipe;
+ static {
+ mGt6Pipe = StaticFields59.mGT6StylePipes;
+ }
- public GregtechMetaPipeEntityFluid(String aName, float aThickNess, GT_Materials aMaterial, int aCapacity,
- int aHeatResistance, boolean aGasProof, int aFluidTypes) {
- super(aName, aThickNess, null, aCapacity, aHeatResistance, aGasProof);
- this.mLastReceivedFrom = 0;
- this.oLastReceivedFrom = 0;
- this.mCheckConnections = !mGt6Pipe;
- this.mMaterial = aMaterial;
- }
+ public final GT_Materials mMaterial;
+ private boolean mCheckConnections;
+ public GregtechMetaPipeEntityFluid(
+ int aID,
+ String aName,
+ String aNameRegional,
+ float aThickNess,
+ GT_Materials aMaterial,
+ int aCapacity,
+ int aHeatResistance,
+ boolean aGasProof) {
+ this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
+ }
- @Override
- public byte getTileEntityBaseType() {
- return this.mMaterial == null ? 4 : (byte) ((this.mMaterial.contains(SubTag.WOOD) ? 12 : 4) + Math.max(0, Math.min(3, this.mMaterial.mToolQuality)));
- }
+ public GregtechMetaPipeEntityFluid(
+ final String aName,
+ final float aThickNess,
+ final GT_Materials aMaterial,
+ final int aCapacity,
+ final int aHeatResistance,
+ final boolean aGasProof) {
+ this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
+ }
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPipeEntityFluid(this.mName, this.mThickNess, this.mMaterial, this.mCapacity, this.mHeatResistance, this.mGasProof);
- }
+ public GregtechMetaPipeEntityFluid(
+ int aID,
+ String aName,
+ String aNameRegional,
+ float aThickNess,
+ GT_Materials aMaterial,
+ int aCapacity,
+ int aHeatResistance,
+ boolean aGasProof,
+ int aFluidTypes) {
+ super(aID, aName, aNameRegional, aThickNess, null, aCapacity, aHeatResistance, aGasProof);
+ this.mLastReceivedFrom = 0;
+ this.oLastReceivedFrom = 0;
+ this.mCheckConnections = !mGt6Pipe;
+ this.mMaterial = aMaterial;
+ }
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- float tThickNess = getThickNess();
- if (mDisableInput == 0)
- return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- byte tMask = 0;
- byte[][] sRestrictionArray = {
- {2, 3, 5, 4},
- {2, 3, 4, 5},
- {1, 0, 4, 5},
- {1, 0, 4, 5},
- {1, 0, 2, 3},
- {1, 0, 2, 3}
- };
- if (aSide >= 0 && aSide < 6) {
- for (byte i = 0; i < 4; i++) if (isInputDisabledAtSide(sRestrictionArray[aSide][i])) tMask |= 1 << i;
- //Full block size renderer flips side 5 and 2 textures, flip restrictor textures to compensate
- if (aSide == 5 || aSide == 2)
- if (tMask > 3 && tMask < 12)
- tMask = (byte) (tMask ^ 12);
- }
- return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), getRestrictorTexture(tMask)};
- }
+ public GregtechMetaPipeEntityFluid(
+ String aName,
+ float aThickNess,
+ GT_Materials aMaterial,
+ int aCapacity,
+ int aHeatResistance,
+ boolean aGasProof,
+ int aFluidTypes) {
+ super(aName, aThickNess, null, aCapacity, aHeatResistance, aGasProof);
+ this.mLastReceivedFrom = 0;
+ this.oLastReceivedFrom = 0;
+ this.mCheckConnections = !mGt6Pipe;
+ this.mMaterial = aMaterial;
+ }
- protected static ITexture getBaseTexture(float aThickNess, int aPipeAmount, GT_Materials aMaterial, byte aColorIndex) {
- if (aPipeAmount >= 9)
- return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aPipeAmount >= 4)
- return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.124F)
- return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.374F)
- return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.499F)
- return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.749F)
- return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.874F)
- return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- }
+ @Override
+ public byte getTileEntityBaseType() {
+ return this.mMaterial == null
+ ? 4
+ : (byte) ((this.mMaterial.contains(SubTag.WOOD) ? 12 : 4)
+ + Math.max(0, Math.min(3, this.mMaterial.mToolQuality)));
+ }
- @Override
- public String[] getDescription() {
- return new String[]{
- EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
- EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY,
- EnumChatFormatting.DARK_GREEN + "Gas Proof: " + (this.mGasProof) + EnumChatFormatting.GRAY,
- //CORE.GT_Tooltip
- };
- }
-} \ No newline at end of file
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntityFluid(
+ this.mName, this.mThickNess, this.mMaterial, this.mCapacity, this.mHeatResistance, this.mGasProof);
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aConnections,
+ byte aColorIndex,
+ boolean aConnected,
+ boolean aRedstone) {
+ float tThickNess = getThickNess();
+ if (mDisableInput == 0)
+ return new ITexture[] {
+ aConnected
+ ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex)
+ : TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa))
+ };
+ byte tMask = 0;
+ byte[][] sRestrictionArray = {
+ {2, 3, 5, 4},
+ {2, 3, 4, 5},
+ {1, 0, 4, 5},
+ {1, 0, 4, 5},
+ {1, 0, 2, 3},
+ {1, 0, 2, 3}
+ };
+ if (aSide >= 0 && aSide < 6) {
+ for (byte i = 0; i < 4; i++) if (isInputDisabledAtSide(sRestrictionArray[aSide][i])) tMask |= 1 << i;
+ // Full block size renderer flips side 5 and 2 textures, flip restrictor textures to compensate
+ if (aSide == 5 || aSide == 2) if (tMask > 3 && tMask < 12) tMask = (byte) (tMask ^ 12);
+ }
+ return new ITexture[] {
+ aConnected
+ ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex)
+ : TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)),
+ getRestrictorTexture(tMask)
+ };
+ }
+
+ protected static ITexture getBaseTexture(
+ float aThickNess, int aPipeAmount, GT_Materials aMaterial, byte aColorIndex) {
+ if (aPipeAmount >= 9)
+ return TextureFactory.of(
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aPipeAmount >= 4)
+ return TextureFactory.of(
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.124F)
+ return TextureFactory.of(
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.374F)
+ return TextureFactory.of(
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.499F)
+ return TextureFactory.of(
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.749F)
+ return TextureFactory.of(
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.874F)
+ return TextureFactory.of(
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ return TextureFactory.of(
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.DARK_GREEN + "Gas Proof: " + (this.mGasProof) + EnumChatFormatting.GRAY,
+ // CORE.GT_Tooltip
+ };
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
index c2ffcbce46..eff2413102 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
@@ -1,10 +1,7 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import static gregtech.api.enums.GT_Values.VN;
import static gtPlusPlus.core.lib.CORE.GTNH;
-import net.minecraft.util.EnumChatFormatting;
-
import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -14,142 +11,285 @@ import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.lib.CORE;
-
public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implements IMetaTileEntityCable {
- private static Textures.BlockIcons INSULATION_MEDIUM_PLUS;
- static{
- if(GTNH) {
- try {
- INSULATION_MEDIUM_PLUS = (Textures.BlockIcons) GT_Utility.getField(Textures.BlockIcons.class, "INSULATION_MEDIUM_PLUS").get(null);
- } catch (IllegalAccessException | NullPointerException e) {
- throw new Error(e);
- }
- }
- }
-
- private short[] vRGB = null;
-
- public GregtechMetaPipeEntity_Cable(final int aID, final String aName, final String aNameRegional, final float aThickNess, final Materials aMaterial, final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated, final boolean aCanShock, final short[] aRGB) {
- super(aID, aName, aNameRegional, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock);
- this.vRGB = aRGB==null || aRGB.length!=4?Materials.Iron.mRGBa:aRGB;
- }
-
- public GregtechMetaPipeEntity_Cable(final String aName, final float aThickNess, final Materials aMaterial, final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated, final boolean aCanShock, final short[] aRGB) {
- super(aName, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock);
- this.vRGB = aRGB==null || aRGB.length!=4?Materials.Iron.mRGBa:aRGB;
- }
-
- public GregtechMetaPipeEntity_Cable(final int aID, final String aName, final String aNameRegional, final float aThickNess, final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated, final boolean aCanShock, final short[] aRGB) {
- this(aID, aName, aNameRegional, aThickNess, null, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock,aRGB);
- }
-
- public GregtechMetaPipeEntity_Cable(final String aName, final float aThickNess, final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated, final boolean aCanShock, final short[] aRGB) {
- this(aName, aThickNess, null, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock,aRGB);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPipeEntity_Cable(this.mName, this.mThickNess, this.mMaterial, this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock, this.vRGB);
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- return GTNH?
- getTextureGTNH(aBaseMetaTileEntity,aSide,aConnections,aColorIndex,aConnected,aRedstone):
- getTexturePure(aBaseMetaTileEntity,aSide,aConnections,aColorIndex,aConnected,aRedstone);
- }
-
- private ITexture[] getTextureGTNH(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
- byte aColorIndex, boolean aConnected, boolean aRedstone) {
-
- Materials wireMaterial=mMaterial;
- if (wireMaterial == null){
- wireMaterial = Materials.Iron;
- }
-
- if (!mInsulated)
- return new ITexture[]{new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, vRGB) )};
- if (aConnected) {
- float tThickNess = getThickNess();
- if (tThickNess < 0.124F)
- return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.374F)//0.375 x1
- return new ITexture[]{new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.499F)//0.500 x2
- return new ITexture[]{new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.624F)//0.625 x4
- return new ITexture[]{new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.749F)//0.750 x8
- return new ITexture[]{new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), new GT_RenderedTexture(INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.874F)//0.825 x12
- return new ITexture[]{new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- return new ITexture[]{new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), 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))};
- }
-
- private ITexture[] getTexturePure(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
- byte aColorIndex, boolean aConnected, boolean aRedstone) {
-
- //if (this.vRGB == null || this.vRGB.length < 3 || this.vRGB.length > 4){
- // this.vRGB = new short[]{200, 0, 200, 0};
- //}
- //if (this.vRGB.length != 4){
- // short[] tempRGB = this.vRGB;
- // this.vRGB = new short[]{tempRGB[0], tempRGB[1], tempRGB[2], 0};
- //}
- //
- //Materials wireMaterial = this.mMaterial;
- //
- //if (wireMaterial == null){
- // wireMaterial = Materials.Iron;
- //}
-
- //With the code in constructors it should work
- Materials wireMaterial=mMaterial;
- if (wireMaterial == null){
- wireMaterial = Materials.Iron;
- }
-
- if (!(this.mInsulated))
- return new ITexture[] { new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69],
- Dyes.getModulation(aColorIndex, this.vRGB)) };
- if (aConnected) {
- float tThickNess = getThickNess();
- if (tThickNess < 0.124F)
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- if (tThickNess < 0.374F)
- return new ITexture[] {
- new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- if (tThickNess < 0.499F)
- return new ITexture[] {
- new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- if (tThickNess < 0.624F)
- return new ITexture[] {
- new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- if (tThickNess < 0.749F)
- return new ITexture[] {
- new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- if (tThickNess < 0.874F)
- return new ITexture[] {
- new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- return new ITexture[] { new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- }
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- }
-} \ No newline at end of file
+ private static Textures.BlockIcons INSULATION_MEDIUM_PLUS;
+
+ static {
+ if (GTNH) {
+ try {
+ INSULATION_MEDIUM_PLUS =
+ (Textures.BlockIcons) GT_Utility.getField(Textures.BlockIcons.class, "INSULATION_MEDIUM_PLUS")
+ .get(null);
+ } catch (IllegalAccessException | NullPointerException e) {
+ throw new Error(e);
+ }
+ }
+ }
+
+ private short[] vRGB = null;
+
+ public GregtechMetaPipeEntity_Cable(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final float aThickNess,
+ final Materials aMaterial,
+ final long aCableLossPerMeter,
+ final long aAmperage,
+ final long aVoltage,
+ final boolean aInsulated,
+ final boolean aCanShock,
+ final short[] aRGB) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aThickNess,
+ aMaterial,
+ aCableLossPerMeter,
+ aAmperage,
+ aVoltage,
+ aInsulated,
+ aCanShock);
+ this.vRGB = aRGB == null || aRGB.length != 4 ? Materials.Iron.mRGBa : aRGB;
+ }
+
+ public GregtechMetaPipeEntity_Cable(
+ final String aName,
+ final float aThickNess,
+ final Materials aMaterial,
+ final long aCableLossPerMeter,
+ final long aAmperage,
+ final long aVoltage,
+ final boolean aInsulated,
+ final boolean aCanShock,
+ final short[] aRGB) {
+ super(aName, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock);
+ this.vRGB = aRGB == null || aRGB.length != 4 ? Materials.Iron.mRGBa : aRGB;
+ }
+
+ public GregtechMetaPipeEntity_Cable(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final float aThickNess,
+ final long aCableLossPerMeter,
+ final long aAmperage,
+ final long aVoltage,
+ final boolean aInsulated,
+ final boolean aCanShock,
+ final short[] aRGB) {
+ this(
+ aID,
+ aName,
+ aNameRegional,
+ aThickNess,
+ null,
+ aCableLossPerMeter,
+ aAmperage,
+ aVoltage,
+ aInsulated,
+ aCanShock,
+ aRGB);
+ }
+
+ public GregtechMetaPipeEntity_Cable(
+ final String aName,
+ final float aThickNess,
+ final long aCableLossPerMeter,
+ final long aAmperage,
+ final long aVoltage,
+ final boolean aInsulated,
+ final boolean aCanShock,
+ final short[] aRGB) {
+ this(aName, aThickNess, null, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock, aRGB);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntity_Cable(
+ this.mName,
+ this.mThickNess,
+ this.mMaterial,
+ this.mCableLossPerMeter,
+ this.mAmperage,
+ this.mVoltage,
+ this.mInsulated,
+ this.mCanShock,
+ this.vRGB);
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aConnections,
+ byte aColorIndex,
+ boolean aConnected,
+ boolean aRedstone) {
+ return GTNH
+ ? getTextureGTNH(aBaseMetaTileEntity, aSide, aConnections, aColorIndex, aConnected, aRedstone)
+ : getTexturePure(aBaseMetaTileEntity, aSide, aConnections, aColorIndex, aConnected, aRedstone);
+ }
+
+ private ITexture[] getTextureGTNH(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aConnections,
+ byte aColorIndex,
+ boolean aConnected,
+ boolean aRedstone) {
+
+ Materials wireMaterial = mMaterial;
+ if (wireMaterial == null) {
+ wireMaterial = Materials.Iron;
+ }
+
+ if (!mInsulated)
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, vRGB))
+ };
+ if (aConnected) {
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.124F)
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_FULL,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.374F) // 0.375 x1
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_TINY,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.499F) // 0.500 x2
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_SMALL,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.624F) // 0.625 x4
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_MEDIUM,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.749F) // 0.750 x8
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB),
+ new GT_RenderedTexture(
+ INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.874F) // 0.825 x12
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_LARGE,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB),
+ 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))
+ };
+ }
+
+ private ITexture[] getTexturePure(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aConnections,
+ byte aColorIndex,
+ boolean aConnected,
+ boolean aRedstone) {
+
+ // if (this.vRGB == null || this.vRGB.length < 3 || this.vRGB.length > 4){
+ // this.vRGB = new short[]{200, 0, 200, 0};
+ // }
+ // if (this.vRGB.length != 4){
+ // short[] tempRGB = this.vRGB;
+ // this.vRGB = new short[]{tempRGB[0], tempRGB[1], tempRGB[2], 0};
+ // }
+ //
+ // Materials wireMaterial = this.mMaterial;
+ //
+ // if (wireMaterial == null){
+ // wireMaterial = Materials.Iron;
+ // }
+
+ // With the code in constructors it should work
+ Materials wireMaterial = mMaterial;
+ if (wireMaterial == null) {
+ wireMaterial = Materials.Iron;
+ }
+
+ if (!(this.mInsulated))
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], Dyes.getModulation(aColorIndex, this.vRGB))
+ };
+ if (aConnected) {
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.124F)
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_FULL,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.374F)
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_TINY,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.499F)
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_SMALL,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.624F)
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_MEDIUM,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.749F)
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_LARGE,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ if (tThickNess < 0.874F)
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_HUGE,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ return new ITexture[] {
+ new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_FULL,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ }
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java
index d05a254bf7..14399e525d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java
@@ -1,56 +1,63 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import net.minecraft.nbt.NBTTagCompound;
-
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.objects.GT_RenderedTexture;
-
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaTreeFarmerBase;
+import net.minecraft.nbt.NBTTagCompound;
-public class GregtechMetaTreeFarmerStructural
-extends GregtechMetaTreeFarmerBase {
-
- @Override
- public String[] getDescription() {
- return new String[] {this.mDescription};
- }
-
- public GregtechMetaTreeFarmerStructural(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, 0, "Structural Blocks for the Tree Farmer.");
- }
-
- public GregtechMetaTreeFarmerStructural(final int aID, final String aName, final String aNameRegional, final int aTier, final int aInvSlotCount, final String aDescription) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
- }
-
- public GregtechMetaTreeFarmerStructural(final String aName, final int aTier, final int aInvSlotCount, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTreeFarmerStructural(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
- }
-
- @Override
- public ITexture getOverlayIcon() {
- return new GT_RenderedTexture(Textures.BlockIcons.VOID);
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return false;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound paramNBTTagCompound) {
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound paramNBTTagCompound) {
- }
+public class GregtechMetaTreeFarmerStructural extends GregtechMetaTreeFarmerBase {
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription};
+ }
+
+ public GregtechMetaTreeFarmerStructural(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier, 0, "Structural Blocks for the Tree Farmer.");
+ }
+
+ public GregtechMetaTreeFarmerStructural(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
+
+ public GregtechMetaTreeFarmerStructural(
+ final String aName,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription,
+ final ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTreeFarmerStructural(
+ this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.VOID);
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return false;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound paramNBTTagCompound) {}
+
+ @Override
+ public void loadNBTData(final NBTTagCompound paramNBTTagCompound) {}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java
index fdc8a7777b..cd4d0c0edd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java
@@ -1,67 +1,70 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
-import java.util.Locale;
-
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.util.GT_LanguageManager;
import gtPlusPlus.xmod.gregtech.api.interfaces.IBaseCustomMetaTileEntity;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import java.util.Locale;
import net.minecraft.item.ItemStack;
public abstract class CustomMetaTileBase extends MetaTileEntity {
+ private IBaseCustomMetaTileEntity mBaseCustomMetaTileEntity2;
- private IBaseCustomMetaTileEntity mBaseCustomMetaTileEntity2;
-
/**
* accessibility to this Field is no longer given, see below
*/
private IGregTechTileEntity mBaseCustomMetaTileEntity;
-
- public CustomMetaTileBase(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
- super(aID, aBasicName, aRegionalName, aInvSlotCount);
- GT_LanguageManager.addStringLocalization("gtpp.blockmachines." + aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH) + ".name", aRegionalName);
- this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntity());
- this.getBaseMetaTileEntity().setMetaTileID((short) aID);
- mBaseCustomMetaTileEntity2 = (IBaseCustomMetaTileEntity) getBaseMetaTileEntity();
- }
-
+
+ public CustomMetaTileBase(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
+ super(aID, aBasicName, aRegionalName, aInvSlotCount);
+ GT_LanguageManager.addStringLocalization(
+ "gtpp.blockmachines." + aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH) + ".name",
+ aRegionalName);
+ this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntity());
+ this.getBaseMetaTileEntity().setMetaTileID((short) aID);
+ mBaseCustomMetaTileEntity2 = (IBaseCustomMetaTileEntity) getBaseMetaTileEntity();
+ }
+
@Override
public IGregTechTileEntity getBaseMetaTileEntity() {
return mBaseCustomMetaTileEntity;
}
-
+
public IBaseCustomMetaTileEntity getBaseCustomMetaTileEntity() {
return mBaseCustomMetaTileEntity2;
}
@Override
public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) {
- super.setBaseMetaTileEntity(aBaseMetaTileEntity);
+ super.setBaseMetaTileEntity(aBaseMetaTileEntity);
if (mBaseCustomMetaTileEntity != null && aBaseMetaTileEntity == null) {
- mBaseCustomMetaTileEntity.getMetaTileEntity().inValidate();
- mBaseCustomMetaTileEntity.setMetaTileEntity(null);
+ mBaseCustomMetaTileEntity.getMetaTileEntity().inValidate();
+ mBaseCustomMetaTileEntity.setMetaTileEntity(null);
}
mBaseCustomMetaTileEntity = aBaseMetaTileEntity;
if (mBaseCustomMetaTileEntity != null) {
- mBaseCustomMetaTileEntity.setMetaTileEntity(this);
+ mBaseCustomMetaTileEntity.setMetaTileEntity(this);
}
}
- public CustomMetaTileBase(String aName, int aInvSlotCount) {
- super(aName, aInvSlotCount);
- }
+ public CustomMetaTileBase(String aName, int aInvSlotCount) {
+ super(aName, aInvSlotCount);
+ }
+
+ public ItemStack getStackForm(long aAmount) {
+ return new ItemStack(
+ Meta_GT_Proxy.sBlockMachines,
+ (int) aAmount,
+ this.getBaseMetaTileEntity().getMetaTileID());
+ }
- public ItemStack getStackForm(long aAmount) {
- return new ItemStack(Meta_GT_Proxy.sBlockMachines, (int) aAmount, this.getBaseMetaTileEntity().getMetaTileID());
- }
+ public String getLocalName() {
+ return GT_LanguageManager.getTranslation("gtpp.blockmachines." + this.mName + ".name");
+ }
- public String getLocalName() {
- return GT_LanguageManager.getTranslation("gtpp.blockmachines." + this.mName + ".name");
- }
-
- /**
+ /**
* This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself.
* <p/>
* 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantlee
@@ -76,17 +79,16 @@ public abstract class CustomMetaTileBase extends MetaTileEntity {
* 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle
* 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle
* 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle
- *
+ *
* == Reserved for Alk now
- *
+ *
* 12 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle
* 13 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle
* 14 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle
* 15 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle
*/
- @Override
+ @Override
public byte getTileEntityBaseType() {
- return 12;
- }
-
-} \ No newline at end of file
+ return 12;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
index ba9e618539..f00901c45b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
@@ -1,5 +1,8 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
+import static gregtech.api.enums.Textures.BlockIcons.FLUID_IN_SIGN;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN;
+
import gregtech.GT_Mod;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -15,185 +18,182 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
-
-import static gregtech.api.enums.Textures.BlockIcons.FLUID_IN_SIGN;
-import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN;
-
public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_Hatch {
- public final Fluid mLockedFluid;
- public final int mFluidCapacity;
- protected FluidStack mLockedStack = null;
- protected String mTempMod = null;
-
- public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, 6, 3, new String[]{
- "Fluid Input for Multiblocks",
- "Capacity: " + GT_Utility.formatNumbers(aAmount) + "L"});
- this.mLockedFluid = aFluid;
- this.mFluidCapacity = aAmount;
- }
-
- public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, 6, 3, aDescription, aTextures);
- this.mLockedFluid = aFluid;
- this.mFluidCapacity = aAmount;
- }
-
- public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, final String[] aDescription, final ITexture[][][] aTextures) {
- super(aName, 6, 3, aDescription[0], aTextures);
- this.mLockedFluid = aFluid;
- this.mFluidCapacity = aAmount;
- }
-
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) {
+ public final Fluid mLockedFluid;
+ public final int mFluidCapacity;
+ protected FluidStack mLockedStack = null;
+ protected String mTempMod = null;
+
+ public GT_MetaTileEntity_Hatch_CustomFluidBase(
+ Fluid aFluid, int aAmount, final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional, 6, 3, new String[] {
+ "Fluid Input for Multiblocks", "Capacity: " + GT_Utility.formatNumbers(aAmount) + "L"
+ });
+ this.mLockedFluid = aFluid;
+ this.mFluidCapacity = aAmount;
+ }
+
+ public GT_MetaTileEntity_Hatch_CustomFluidBase(
+ Fluid aFluid, int aAmount, final String aName, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 6, 3, aDescription, aTextures);
+ this.mLockedFluid = aFluid;
+ this.mFluidCapacity = aAmount;
+ }
+
+ public GT_MetaTileEntity_Hatch_CustomFluidBase(
+ Fluid aFluid,
+ int aAmount,
+ final String aName,
+ final String[] aDescription,
+ final ITexture[][][] aTextures) {
+ super(aName, 6, 3, aDescription[0], aTextures);
+ this.mLockedFluid = aFluid;
+ this.mFluidCapacity = aAmount;
+ }
+
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) {
FluidStack fs = GT_Utility.getFluidForFilledItem(aStack, true);
- return fs != null && fs.getFluid() == this.mLockedFluid;
+ return fs != null && fs.getFluid() == this.mLockedFluid;
}
return false;
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 1;
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ?
- new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN)} :
- new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)};
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ?
- new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN)} :
- new ITexture[]{aBaseTexture, TextureFactory.of(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 onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public boolean doesFillContainers() {
- //return true;
- return false;
- }
-
- @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 int getTankPressure() {
- return -100;
- }
-
- public int getCapacity() {
- return this.mFluidCapacity;
- }
-
- @Override
- public String[] getDescription() {
- if (mLockedStack == null) {
- mLockedStack = FluidUtils.getFluidStack(mLockedFluid, 1);
- }
- int aFluidTemp = 0;
- boolean isSteam = false;
- if (mLockedFluid != null) {
- aFluidTemp = mLockedFluid.getTemperature();
- mTempMod = mLockedFluid.getName();
- }
- if (mTempMod.equalsIgnoreCase("steam")) {
- isSteam = true;
- }
-
-
- EnumChatFormatting aColour = EnumChatFormatting.BLUE;
- if (aFluidTemp <= -3000) {
- aColour = EnumChatFormatting.DARK_PURPLE;
- }
- else if (aFluidTemp >= -2999 && aFluidTemp <= -500) {
- aColour = EnumChatFormatting.DARK_BLUE;
- }
- else if (aFluidTemp >= -499 && aFluidTemp <= -50) {
- aColour = EnumChatFormatting.BLUE;
- }
- else if (aFluidTemp >= 30 && aFluidTemp <= 300) {
- aColour = EnumChatFormatting.AQUA;
- }
- else if (aFluidTemp >= 301 && aFluidTemp <= 800) {
- aColour = EnumChatFormatting.YELLOW;
- }
- else if (aFluidTemp >= 801 && aFluidTemp <= 1500) {
- aColour = EnumChatFormatting.GOLD;
- }
- else if (aFluidTemp >= 1501) {
- aColour = EnumChatFormatting.RED;
- }
- String aFluidName = "Accepted Fluid: " + aColour + (mLockedStack != null ? mLockedStack.getLocalizedName() : "Empty") + EnumChatFormatting.RESET;
- return new String[]{
- "Fluid Input for "+(isSteam ? "Steam " : "")+"Multiblocks",
- "Capacity: " + getCapacity()+"L",
- aFluidName,
- CORE.GT_Tooltip
- };
- }
-
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return aFluid.getFluid() == this.mLockedFluid;
- }
-
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_CustomFluidBase(this.mLockedFluid, this.mFluidCapacity, this.mName, this.mDescription, this.mTextures);
- }
-} \ No newline at end of file
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 1;
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
+ ? new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN)}
+ : new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)};
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
+ ? new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN)}
+ : new ITexture[] {aBaseTexture, TextureFactory.of(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 onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ // return true;
+ return false;
+ }
+
+ @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 int getTankPressure() {
+ return -100;
+ }
+
+ public int getCapacity() {
+ return this.mFluidCapacity;
+ }
+
+ @Override
+ public String[] getDescription() {
+ if (mLockedStack == null) {
+ mLockedStack = FluidUtils.getFluidStack(mLockedFluid, 1);
+ }
+ int aFluidTemp = 0;
+ boolean isSteam = false;
+ if (mLockedFluid != null) {
+ aFluidTemp = mLockedFluid.getTemperature();
+ mTempMod = mLockedFluid.getName();
+ }
+ if (mTempMod.equalsIgnoreCase("steam")) {
+ isSteam = true;
+ }
+
+ EnumChatFormatting aColour = EnumChatFormatting.BLUE;
+ if (aFluidTemp <= -3000) {
+ aColour = EnumChatFormatting.DARK_PURPLE;
+ } else if (aFluidTemp >= -2999 && aFluidTemp <= -500) {
+ aColour = EnumChatFormatting.DARK_BLUE;
+ } else if (aFluidTemp >= -499 && aFluidTemp <= -50) {
+ aColour = EnumChatFormatting.BLUE;
+ } else if (aFluidTemp >= 30 && aFluidTemp <= 300) {
+ aColour = EnumChatFormatting.AQUA;
+ } else if (aFluidTemp >= 301 && aFluidTemp <= 800) {
+ aColour = EnumChatFormatting.YELLOW;
+ } else if (aFluidTemp >= 801 && aFluidTemp <= 1500) {
+ aColour = EnumChatFormatting.GOLD;
+ } else if (aFluidTemp >= 1501) {
+ aColour = EnumChatFormatting.RED;
+ }
+ String aFluidName = "Accepted Fluid: " + aColour
+ + (mLockedStack != null ? mLockedStack.getLocalizedName() : "Empty") + EnumChatFormatting.RESET;
+ return new String[] {
+ "Fluid Input for " + (isSteam ? "Steam " : "") + "Multiblocks",
+ "Capacity: " + getCapacity() + "L",
+ aFluidName,
+ CORE.GT_Tooltip
+ };
+ }
+
+ public boolean isFluidInputAllowed(final FluidStack aFluid) {
+ return aFluid.getFluid() == this.mLockedFluid;
+ }
+
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_CustomFluidBase(
+ this.mLockedFluid, this.mFluidCapacity, this.mName, this.mDescription, this.mTextures);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
index 4dd5bf25d6..efc2d008bb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
@@ -2,21 +2,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
import static gregtech.api.enums.GT_Values.VN;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-
import cofh.api.energy.IEnergyReceiver;
-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 gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Dyes;
@@ -33,436 +19,534 @@ import gregtech.api.metatileentity.MetaPipeEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Proxy;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import ic2.api.energy.tile.IEnergySink;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+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 GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements IMetaTileEntityCable {
- public final float mThickNess;
- public final GT_Materials mMaterial;
- public final long mCableLossPerMeter, mAmperage, mVoltage;
- public final boolean mInsulated, mCanShock;
- public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
- public long mRestRF;
- public short mOverheat;
- public final int mWireHeatingTicks;
-
- public GregtechMetaPipeEntityBase_Cable(final int aID, final String aName, final String aNameRegional,
- final float aThickNess, final GT_Materials aMaterial, final long aCableLossPerMeter, final long aAmperage,
- final long aVoltage, final boolean aInsulated, final boolean aCanShock) {
- super(aID, aName, aNameRegional, 0);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mAmperage = aAmperage;
- this.mVoltage = aVoltage;
- this.mInsulated = aInsulated;
- this.mCanShock = aCanShock;
- this.mCableLossPerMeter = aCableLossPerMeter;
- this.mWireHeatingTicks = this.getGT5Var();
- }
-
- public GregtechMetaPipeEntityBase_Cable(final String aName, final float aThickNess, final GT_Materials aMaterial,
- final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated,
- final boolean aCanShock) {
- super(aName, 0);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mAmperage = aAmperage;
- this.mVoltage = aVoltage;
- this.mInsulated = aInsulated;
- this.mCanShock = aCanShock;
- this.mCableLossPerMeter = aCableLossPerMeter;
- this.mWireHeatingTicks = this.getGT5Var();
- }
-
- private int getGT5Var() {
- final Class<? extends GT_Proxy> clazz = GT_Mod.gregtechproxy.getClass();
- final String lookingForValue = "mWireHeatingTicks";
- int temp = 4;
- Field field;
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- try {
- field = clazz.getClass().getField(lookingForValue);
- final Class<?> clazzType = field.getType();
- if (clazzType.toString().equals("int")) {
- temp = (field.getInt(clazz));
- } else {
- temp = 4;
- }
- } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
- // Utils.LOG_INFO("FATAL ERROR - REFLECTION FAILED FOR GT CABLES
- // - PLEASE REPORT THIS.");
- Logger.WARNING("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
- Logger.ERROR("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
- temp = 4;
- }
- }
- return temp;
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return (byte) (this.mInsulated ? 9 : 8);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPipeEntityBase_Cable(this.mName, this.mThickNess, this.mMaterial,
- this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock);
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide,
- final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) {
- if (!this.mInsulated) {
- return new ITexture[] { new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa) };
- }
- if (aConnected) {
- final float tThickNess = this.getThickNess();
- if (tThickNess < 0.37F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.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(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.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(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.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(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- }
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.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(final World aWorld, final int aX, final int aY, final int aZ,
- final Entity aEntity) {
- if (this.mCanShock && ((((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0)
- && (aEntity instanceof EntityLivingBase)) {
- GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, this.mTransferredVoltageLast20,
- this.mTransferredAmperageLast20);
- }
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
- if (!this.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(final byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return true;
- }
-
- @Override
- public final boolean renderInside(final byte aSide) {
- return false;
- }
-
- @Override
- public int getProgresstime() {
- return (int) this.mTransferredAmperage * 64;
- }
-
- @Override
- public int maxProgresstime() {
- return (int) this.mAmperage * 64;
- }
-
- @Override
- public long injectEnergyUnits(final byte aSide, final long aVoltage, final long aAmperage) {
- if (!this.getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide,
- this.getBaseMetaTileEntity().getCoverIDAtSide(aSide),
- this.getBaseMetaTileEntity().getCoverDataAtSide(aSide), this.getBaseMetaTileEntity())) {
- return 0;
- }
- return this.transferElectricity(aSide, aVoltage, aAmperage,
- new ArrayList<>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity())));
- }
-
-
- /**
- * Adds support for the newer function added by https://github.com/Blood-Asp/GT5-Unofficial/commit/73ee102b63efd92c0f164a7ed7a79ebcd2619617#diff-3051838621d8ae87aa5ccd1345e1f07d
- */
- public long transferElectricity(byte arg0, long arg1, long arg2, HashSet<TileEntity> arg3) {
- ArrayList<TileEntity> aTiles = new ArrayList<TileEntity>();
- for (TileEntity y : arg3) {
- aTiles.add(y);
- }
- return transferElectricity(arg0, arg1, arg2, aTiles);
- }
-
- @Override
- public long transferElectricity(final byte aSide, long aVoltage, final long aAmperage,
- final ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
- long rUsedAmperes = 0;
- aVoltage -= this.mCableLossPerMeter;
- if (aVoltage > 0) {
- for (byte i = 0; (i < 6) && (aAmperage > rUsedAmperes); i++) {
- if ((i != aSide) && ((this.mConnections & (1 << i)) != 0)
- && this.getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i,
- this.getBaseMetaTileEntity().getCoverIDAtSide(i),
- this.getBaseMetaTileEntity().getCoverDataAtSide(i), this.getBaseMetaTileEntity())) {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide(i);
- if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
- aAlreadyPassedTileEntityList.add(tTileEntity);
- if (tTileEntity instanceof IEnergyConnected) {
- if (this.getBaseMetaTileEntity().getColorization() >= 0) {
- final byte tColor = ((IEnergyConnected) tTileEntity).getColorization();
- if ((tColor >= 0) && (tColor != this.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) {
- final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- if (((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(),
- tDirection)) {
- if ((((IEnergySink) tTileEntity).getDemandedEnergy() > 0)
- && (((IEnergySink) tTileEntity).injectEnergy(tDirection, aVoltage,
- aVoltage) < aVoltage)) {
- rUsedAmperes++;
- }
- }
- } else if (GregTech_API.mOutputRF && (tTileEntity instanceof IEnergyReceiver)) {
- final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- final int rfOut = (int) ((aVoltage * GregTech_API.mEUtoRF) / 100);
- if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
- ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
- rUsedAmperes++;
- } else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) {
- if (this.mRestRF == 0) {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut,
- false);
- rUsedAmperes++;
- this.mRestRF = rfOut - RFtrans;
- } else {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection,
- (int) this.mRestRF, false);
- this.mRestRF = this.mRestRF - RFtrans;
- }
- }
- if (GregTech_API.mRFExplosions && (((IEnergyReceiver) tTileEntity)
- .getMaxEnergyStored(tDirection) < (rfOut * 600))) {
- if (rfOut > ((32 * GregTech_API.mEUtoRF) / 100)) {
- this.doExplosion(rfOut);
- }
- }
- }
- }
- }
- }
- }
-
- this.mTransferredAmperage += rUsedAmperes;
- this.mTransferredVoltageLast20 = Math.max(this.mTransferredVoltageLast20, aVoltage);
- this.mTransferredAmperageLast20 = Math.max(this.mTransferredAmperageLast20, this.mTransferredAmperage);
-
- if ((aVoltage > this.mVoltage) || (this.mTransferredAmperage > this.mAmperage)) {
- // GT 5.09
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- if (this.mOverheat > (this.mWireHeatingTicks * 100)) {
- this.getBaseMetaTileEntity().setToFire();
- } else {
- this.mOverheat += 100;
- }
- return aAmperage;
- }
- // GT 5.08
- else {
- this.getBaseMetaTileEntity().setToFire();
- return aAmperage;
- }
- }
-
- return rUsedAmperes;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- this.mTransferredAmperage = 0;
- if (this.mOverheat > 0) {
- this.mOverheat--;
- }
-
- if ((aTick % 20) == 0) {
- this.mTransferredVoltageLast20 = 0;
- this.mTransferredAmperageLast20 = 0;
- this.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)) {
- final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
- if (tTileEntity instanceof IColoredTileEntity) {
- if (aBaseMetaTileEntity.getColorization() >= 0) {
- final byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
- if ((tColor >= 0) && (tColor != aBaseMetaTileEntity.getColorization())) {
- continue;
- }
- }
- }
- if ((tTileEntity instanceof IEnergyConnected)
- && (((IEnergyConnected) tTileEntity).inputEnergyFrom(j)
- || ((IEnergyConnected) tTileEntity).outputsEnergyTo(j))) {
- this.mConnections |= (1 << i);
- continue;
- }
- if ((tTileEntity instanceof IGregTechTileEntity) && (((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity() instanceof IMetaTileEntityCable)) {
- if (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- ((IGregTechTileEntity) tTileEntity))
- || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- ((IGregTechTileEntity) tTileEntity))
- || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- ((IGregTechTileEntity) tTileEntity))) {
- this.mConnections |= (1 << i);
- continue;
- }
- }
- if ((tTileEntity instanceof IEnergySink) && ((IEnergySink) tTileEntity).acceptsEnergyFrom(
- (TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
- this.mConnections |= (1 << i);
- continue;
- }
- if (GregTech_API.mOutputRF && (tTileEntity instanceof IEnergyReceiver)
- && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) {
- this.mConnections |= (1 << i);
- continue;
- }
- /*
- * if (tTileEntity instanceof IEnergyEmitter &&
- * ((IEnergyEmitter)tTileEntity).emitsEnergyTo((
- * TileEntity)aBaseMetaTileEntity,
- * ForgeDirection.getOrientation(j))) { mConnections |=
- * (1<<i); continue; }
- */
- }
- }
- }
- }
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Max Voltage: " + EnumChatFormatting.GREEN + this.mVoltage + " ("
- + VN[GT_Utility.getTier(this.mVoltage)] + ")" + EnumChatFormatting.GRAY,
- "Max Amperage: " + EnumChatFormatting.YELLOW + this.mAmperage + EnumChatFormatting.GRAY,
- "Loss/Meter/Ampere: " + EnumChatFormatting.RED + this.mCableLossPerMeter + EnumChatFormatting.GRAY
- + " EU-Volt" };
- }
-
- @Override
- public float getThickNess() {
- return this.mThickNess;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- //
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- //
- }
-} \ No newline at end of file
+ public final float mThickNess;
+ public final GT_Materials mMaterial;
+ public final long mCableLossPerMeter, mAmperage, mVoltage;
+ public final boolean mInsulated, mCanShock;
+ public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
+ public long mRestRF;
+ public short mOverheat;
+ public final int mWireHeatingTicks;
+
+ public GregtechMetaPipeEntityBase_Cable(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final float aThickNess,
+ final GT_Materials aMaterial,
+ final long aCableLossPerMeter,
+ final long aAmperage,
+ final long aVoltage,
+ final boolean aInsulated,
+ final boolean aCanShock) {
+ super(aID, aName, aNameRegional, 0);
+ this.mThickNess = aThickNess;
+ this.mMaterial = aMaterial;
+ this.mAmperage = aAmperage;
+ this.mVoltage = aVoltage;
+ this.mInsulated = aInsulated;
+ this.mCanShock = aCanShock;
+ this.mCableLossPerMeter = aCableLossPerMeter;
+ this.mWireHeatingTicks = this.getGT5Var();
+ }
+
+ public GregtechMetaPipeEntityBase_Cable(
+ final String aName,
+ final float aThickNess,
+ final GT_Materials aMaterial,
+ final long aCableLossPerMeter,
+ final long aAmperage,
+ final long aVoltage,
+ final boolean aInsulated,
+ final boolean aCanShock) {
+ super(aName, 0);
+ this.mThickNess = aThickNess;
+ this.mMaterial = aMaterial;
+ this.mAmperage = aAmperage;
+ this.mVoltage = aVoltage;
+ this.mInsulated = aInsulated;
+ this.mCanShock = aCanShock;
+ this.mCableLossPerMeter = aCableLossPerMeter;
+ this.mWireHeatingTicks = this.getGT5Var();
+ }
+
+ private int getGT5Var() {
+ final Class<? extends GT_Proxy> clazz = GT_Mod.gregtechproxy.getClass();
+ final String lookingForValue = "mWireHeatingTicks";
+ int temp = 4;
+ Field field;
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try {
+ field = clazz.getClass().getField(lookingForValue);
+ final Class<?> clazzType = field.getType();
+ if (clazzType.toString().equals("int")) {
+ temp = (field.getInt(clazz));
+ } else {
+ temp = 4;
+ }
+ } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
+ // Utils.LOG_INFO("FATAL ERROR - REFLECTION FAILED FOR GT CABLES
+ // - PLEASE REPORT THIS.");
+ Logger.WARNING("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
+ Logger.ERROR("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
+ temp = 4;
+ }
+ }
+ return temp;
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte) (this.mInsulated ? 9 : 8);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntityBase_Cable(
+ this.mName,
+ this.mThickNess,
+ this.mMaterial,
+ this.mCableLossPerMeter,
+ this.mAmperage,
+ this.mVoltage,
+ this.mInsulated,
+ this.mCanShock);
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aConnections,
+ final byte aColorIndex,
+ final boolean aConnected,
+ final boolean aRedstone) {
+ if (!this.mInsulated) {
+ return new ITexture[] {
+ new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa)
+ };
+ }
+ if (aConnected) {
+ final float tThickNess = this.getThickNess();
+ if (tThickNess < 0.37F) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.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(
+ this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.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(
+ this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.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(
+ this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa),
+ new GT_RenderedTexture(
+ Textures.BlockIcons.INSULATION_LARGE,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
+ };
+ }
+ return new ITexture[] {
+ new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.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(
+ final World aWorld, final int aX, final int aY, final int aZ, final Entity aEntity) {
+ if (this.mCanShock
+ && ((((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0)
+ && (aEntity instanceof EntityLivingBase)) {
+ GT_Utility.applyElectricityDamage(
+ (EntityLivingBase) aEntity, this.mTransferredVoltageLast20, this.mTransferredAmperageLast20);
+ }
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
+ if (!this.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(final byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return true;
+ }
+
+ @Override
+ public final boolean renderInside(final byte aSide) {
+ return false;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return (int) this.mTransferredAmperage * 64;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return (int) this.mAmperage * 64;
+ }
+
+ @Override
+ public long injectEnergyUnits(final byte aSide, final long aVoltage, final long aAmperage) {
+ if (!this.getBaseMetaTileEntity()
+ .getCoverBehaviorAtSide(aSide)
+ .letsEnergyIn(
+ aSide,
+ this.getBaseMetaTileEntity().getCoverIDAtSide(aSide),
+ this.getBaseMetaTileEntity().getCoverDataAtSide(aSide),
+ this.getBaseMetaTileEntity())) {
+ return 0;
+ }
+ return this.transferElectricity(
+ aSide, aVoltage, aAmperage, new ArrayList<>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity())));
+ }
+
+ /**
+ * Adds support for the newer function added by https://github.com/Blood-Asp/GT5-Unofficial/commit/73ee102b63efd92c0f164a7ed7a79ebcd2619617#diff-3051838621d8ae87aa5ccd1345e1f07d
+ */
+ public long transferElectricity(byte arg0, long arg1, long arg2, HashSet<TileEntity> arg3) {
+ ArrayList<TileEntity> aTiles = new ArrayList<TileEntity>();
+ for (TileEntity y : arg3) {
+ aTiles.add(y);
+ }
+ return transferElectricity(arg0, arg1, arg2, aTiles);
+ }
+
+ @Override
+ public long transferElectricity(
+ final byte aSide,
+ long aVoltage,
+ final long aAmperage,
+ final ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ long rUsedAmperes = 0;
+ aVoltage -= this.mCableLossPerMeter;
+ if (aVoltage > 0) {
+ for (byte i = 0; (i < 6) && (aAmperage > rUsedAmperes); i++) {
+ if ((i != aSide)
+ && ((this.mConnections & (1 << i)) != 0)
+ && this.getBaseMetaTileEntity()
+ .getCoverBehaviorAtSide(i)
+ .letsEnergyOut(
+ i,
+ this.getBaseMetaTileEntity().getCoverIDAtSide(i),
+ this.getBaseMetaTileEntity().getCoverDataAtSide(i),
+ this.getBaseMetaTileEntity())) {
+ final TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide(i);
+ if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
+ aAlreadyPassedTileEntityList.add(tTileEntity);
+ if (tTileEntity instanceof IEnergyConnected) {
+ if (this.getBaseMetaTileEntity().getColorization() >= 0) {
+ final byte tColor = ((IEnergyConnected) tTileEntity).getColorization();
+ if ((tColor >= 0)
+ && (tColor
+ != this.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) {
+ final ForgeDirection tDirection =
+ ForgeDirection.getOrientation(i).getOpposite();
+ if (((IEnergySink) tTileEntity)
+ .acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(), tDirection)) {
+ if ((((IEnergySink) tTileEntity).getDemandedEnergy() > 0)
+ && (((IEnergySink) tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage)
+ < aVoltage)) {
+ rUsedAmperes++;
+ }
+ }
+ } else if (GregTech_API.mOutputRF && (tTileEntity instanceof IEnergyReceiver)) {
+ final ForgeDirection tDirection =
+ ForgeDirection.getOrientation(i).getOpposite();
+ final int rfOut = (int) ((aVoltage * GregTech_API.mEUtoRF) / 100);
+ if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
+ ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
+ rUsedAmperes++;
+ } else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) {
+ if (this.mRestRF == 0) {
+ final int RFtrans =
+ ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
+ rUsedAmperes++;
+ this.mRestRF = rfOut - RFtrans;
+ } else {
+ final int RFtrans = ((IEnergyReceiver) tTileEntity)
+ .receiveEnergy(tDirection, (int) this.mRestRF, false);
+ this.mRestRF = this.mRestRF - RFtrans;
+ }
+ }
+ if (GregTech_API.mRFExplosions
+ && (((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection)
+ < (rfOut * 600))) {
+ if (rfOut > ((32 * GregTech_API.mEUtoRF) / 100)) {
+ this.doExplosion(rfOut);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ this.mTransferredAmperage += rUsedAmperes;
+ this.mTransferredVoltageLast20 = Math.max(this.mTransferredVoltageLast20, aVoltage);
+ this.mTransferredAmperageLast20 = Math.max(this.mTransferredAmperageLast20, this.mTransferredAmperage);
+
+ if ((aVoltage > this.mVoltage) || (this.mTransferredAmperage > this.mAmperage)) {
+ // GT 5.09
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if (this.mOverheat > (this.mWireHeatingTicks * 100)) {
+ this.getBaseMetaTileEntity().setToFire();
+ } else {
+ this.mOverheat += 100;
+ }
+ return aAmperage;
+ }
+ // GT 5.08
+ else {
+ this.getBaseMetaTileEntity().setToFire();
+ return aAmperage;
+ }
+ }
+
+ return rUsedAmperes;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ this.mTransferredAmperage = 0;
+ if (this.mOverheat > 0) {
+ this.mOverheat--;
+ }
+
+ if ((aTick % 20) == 0) {
+ this.mTransferredVoltageLast20 = 0;
+ this.mTransferredAmperageLast20 = 0;
+ this.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)) {
+ final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
+ if (tTileEntity instanceof IColoredTileEntity) {
+ if (aBaseMetaTileEntity.getColorization() >= 0) {
+ final byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
+ if ((tColor >= 0) && (tColor != aBaseMetaTileEntity.getColorization())) {
+ continue;
+ }
+ }
+ }
+ if ((tTileEntity instanceof IEnergyConnected)
+ && (((IEnergyConnected) tTileEntity).inputEnergyFrom(j)
+ || ((IEnergyConnected) tTileEntity).outputsEnergyTo(j))) {
+ this.mConnections |= (1 << i);
+ continue;
+ }
+ if ((tTileEntity instanceof IGregTechTileEntity)
+ && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity()
+ instanceof IMetaTileEntityCable)) {
+ if (((IGregTechTileEntity) tTileEntity)
+ .getCoverBehaviorAtSide(j)
+ .alwaysLookConnected(
+ j,
+ ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
+ ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
+ ((IGregTechTileEntity) tTileEntity))
+ || ((IGregTechTileEntity) tTileEntity)
+ .getCoverBehaviorAtSide(j)
+ .letsEnergyIn(
+ j,
+ ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
+ ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
+ ((IGregTechTileEntity) tTileEntity))
+ || ((IGregTechTileEntity) tTileEntity)
+ .getCoverBehaviorAtSide(j)
+ .letsEnergyOut(
+ j,
+ ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
+ ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
+ ((IGregTechTileEntity) tTileEntity))) {
+ this.mConnections |= (1 << i);
+ continue;
+ }
+ }
+ if ((tTileEntity instanceof IEnergySink)
+ && ((IEnergySink) tTileEntity)
+ .acceptsEnergyFrom(
+ (TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
+ this.mConnections |= (1 << i);
+ continue;
+ }
+ if (GregTech_API.mOutputRF
+ && (tTileEntity instanceof IEnergyReceiver)
+ && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) {
+ this.mConnections |= (1 << i);
+ continue;
+ }
+ /*
+ * if (tTileEntity instanceof IEnergyEmitter &&
+ * ((IEnergyEmitter)tTileEntity).emitsEnergyTo((
+ * TileEntity)aBaseMetaTileEntity,
+ * ForgeDirection.getOrientation(j))) { mConnections |=
+ * (1<<i); continue; }
+ */
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "Max Voltage: " + EnumChatFormatting.GREEN + this.mVoltage + " (" + VN[GT_Utility.getTier(this.mVoltage)]
+ + ")" + EnumChatFormatting.GRAY,
+ "Max Amperage: " + EnumChatFormatting.YELLOW + this.mAmperage + EnumChatFormatting.GRAY,
+ "Loss/Meter/Ampere: " + EnumChatFormatting.RED + this.mCableLossPerMeter + EnumChatFormatting.GRAY
+ + " EU-Volt"
+ };
+ }
+
+ @Override
+ public float getThickNess() {
+ return this.mThickNess;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ //
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ //
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
index c9201471a4..41f434f7e6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
@@ -5,73 +5,80 @@ import static gregtech.api.enums.GT_Values.GT;
import gregtech.api.interfaces.ITexture;
import gregtech.api.metatileentity.MetaTileEntity;
-import gtPlusPlus.core.lib.CORE;
-
public abstract class GregtechMetaTileEntity extends MetaTileEntity {
- /**
- * Value between [0 - 9] to describe the Tier of this Machine.
- */
- protected byte mTier;
-
- /**
- * A simple Description.
- */
- protected final String mDescription;
+ /**
+ * Value between [0 - 9] to describe the Tier of this Machine.
+ */
+ protected byte mTier;
- /**
- * Contains all Textures used by this Block.
- */
- public final ITexture[][][] mTextures;
+ /**
+ * A simple Description.
+ */
+ protected final String mDescription;
- public GregtechMetaTileEntity(final int aID, final String aName, final String aNameRegional, final int aTier,
- final int aInvSlotCount, final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aInvSlotCount);
- this.mTier = (byte) Math.max(0, Math.min(aTier, 9));
- this.mDescription = aDescription;
+ /**
+ * Contains all Textures used by this Block.
+ */
+ public final ITexture[][][] mTextures;
- // must always be the last call!
- if (GT.isClientSide()) {
- this.mTextures = this.getTextureSet(aTextures);
- } else {
- this.mTextures = null;
- }
- }
+ public GregtechMetaTileEntity(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription,
+ final ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aInvSlotCount);
+ this.mTier = (byte) Math.max(0, Math.min(aTier, 9));
+ this.mDescription = aDescription;
- public GregtechMetaTileEntity(final String aName, final int aTier, final int aInvSlotCount,
- final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aInvSlotCount);
- this.mTier = (byte) aTier;
- this.mDescription = aDescription;
- this.mTextures = aTextures;
+ // must always be the last call!
+ if (GT.isClientSide()) {
+ this.mTextures = this.getTextureSet(aTextures);
+ } else {
+ this.mTextures = null;
+ }
+ }
- }
+ public GregtechMetaTileEntity(
+ final String aName,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription,
+ final ITexture[][][] aTextures) {
+ super(aName, aInvSlotCount);
+ this.mTier = (byte) aTier;
+ this.mDescription = aDescription;
+ this.mTextures = aTextures;
+ }
- @Override
- public byte getTileEntityBaseType() {
- return (byte) (Math.min(3, this.mTier <= 0 ? 0 : 1 + ((this.mTier - 1) / 4)));
- }
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte) (Math.min(3, this.mTier <= 0 ? 0 : 1 + ((this.mTier - 1) / 4)));
+ }
- @Override
- public long getInputTier() {
- return this.mTier;
- }
+ @Override
+ public long getInputTier() {
+ return this.mTier;
+ }
- @Override
- public long getOutputTier() {
- return this.mTier;
- }
+ @Override
+ public long getOutputTier() {
+ return this.mTier;
+ }
- @Override
- public String[] getDescription() {
- return new String[] { this.mDescription };
- }
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.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
+ /**
+ * 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);
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java
index d0021f8358..e900aac944 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java
@@ -1,116 +1,131 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-
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.metatileentity.implementations.GT_MetaTileEntity_Transformer;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTTagCompound;
public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer {
- private boolean mHalfMode = false;
-
- public GregtechMetaTransformerHiAmp(int aID, String aName, String aNameRegional, int aTier, String aDescription) {
- super(aID, aName, aNameRegional, aTier, aDescription);
- }
-
- public GregtechMetaTransformerHiAmp(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- @Override
- public long maxEUStore() {
- return ((512L + gregtech.api.enums.GT_Values.V[(this.mTier + 1)] * 2L) * 8);
- }
-
- @Override
- public long maxAmperesOut() {
- if (this.mHalfMode) {
- return ((getBaseMetaTileEntity().isAllowedToWork()) ? 8L : 2L);
- }
- return ((getBaseMetaTileEntity().isAllowedToWork()) ? 16L : 4L);
- }
-
- @Override
- public long maxAmperesIn() {
- if (this.mHalfMode) {
- return ((getBaseMetaTileEntity().isAllowedToWork()) ? 2L : 8L);
- }
- return ((getBaseMetaTileEntity().isAllowedToWork()) ? 4L : 16L);
- }
-
- @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 + 1] };
- rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1] };
- rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1] };
- 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 + 1] };
- rTextures[10][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1] };
- rTextures[11][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1] };
- }
- return rTextures;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTransformerHiAmp(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] { this.mDescription,
- "Accepts 4A and outputs 16A",
- "Toggle 2A/8A half-mode with Screwdriver",
- CORE.GT_Tooltip};
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setBoolean("mHalfMode", this.mHalfMode);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- this.mHalfMode = aNBT.getBoolean("mHalfMode");
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- this.mHalfMode = Utils.invertBoolean(mHalfMode);
- if (this.mHalfMode) {
- PlayerUtils.messagePlayer(aPlayer, "Transformer is now running at 2A:8A in/out Ratio.");
- } else {
-
- PlayerUtils.messagePlayer(aPlayer, "Transformer is now running at 4A:16A in/out Ratio.");
- }
- }
-} \ No newline at end of file
+ private boolean mHalfMode = false;
+
+ public GregtechMetaTransformerHiAmp(int aID, String aName, String aNameRegional, int aTier, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GregtechMetaTransformerHiAmp(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public long maxEUStore() {
+ return ((512L + gregtech.api.enums.GT_Values.V[(this.mTier + 1)] * 2L) * 8);
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ if (this.mHalfMode) {
+ return ((getBaseMetaTileEntity().isAllowedToWork()) ? 8L : 2L);
+ }
+ return ((getBaseMetaTileEntity().isAllowedToWork()) ? 16L : 4L);
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ if (this.mHalfMode) {
+ return ((getBaseMetaTileEntity().isAllowedToWork()) ? 2L : 8L);
+ }
+ return ((getBaseMetaTileEntity().isAllowedToWork()) ? 4L : 16L);
+ }
+
+ @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 + 1]
+ };
+ rTextures[4][i + 1] = new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1]
+ };
+ rTextures[5][i + 1] = new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1]
+ };
+ 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 + 1]
+ };
+ rTextures[10][i + 1] = new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1]
+ };
+ rTextures[11][i + 1] = new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1]
+ };
+ }
+ return rTextures;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTransformerHiAmp(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription, "Accepts 4A and outputs 16A", "Toggle 2A/8A half-mode with Screwdriver", CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("mHalfMode", this.mHalfMode);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mHalfMode = aNBT.getBoolean("mHalfMode");
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ this.mHalfMode = Utils.invertBoolean(mHalfMode);
+ if (this.mHalfMode) {
+ PlayerUtils.messagePlayer(aPlayer, "Transformer is now running at 2A:8A in/out Ratio.");
+ } else {
+
+ PlayerUtils.messagePlayer(aPlayer, "Transformer is now running at 4A:16A in/out Ratio.");
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index f6d4d3946c..4bd18819c6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -1,5 +1,7 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
+
import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureElement;
@@ -44,6 +46,15 @@ import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.preloader.asm.AsmConfig;
import gtPlusPlus.xmod.gregtech.api.gui.*;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.function.BiConsumer;
+import java.util.function.BiPredicate;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.stream.Collectors;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -61,1562 +72,1590 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import org.apache.commons.lang3.ArrayUtils;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.function.BiConsumer;
-import java.util.function.BiPredicate;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import java.util.stream.Collectors;
+// Glee8e - 11/12/21 - 2:15pm
+// Yeah, now I see what's wrong. Someone inherited from GregtechMeta_MultiBlockBase instead of
+// GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator> as it should have been
+// so any method in GregtechMetaTileEntity_IndustrialDehydrator would see generic field declared in
+// GregtechMeta_MultiBlockBase without generic parameter
+
+public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_EnhancedMultiBlockBase<T>>
+ extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> {
+
+ public static final boolean DEBUG_DISABLE_CORES_TEMPORARILY = true;
+
+ static {
+ Method a08 = findRecipe08 = ReflectionUtils.getMethod(
+ GT_Recipe_Map.class,
+ "findRecipe",
+ IHasWorldObjectAndCoords.class,
+ GT_Recipe.class,
+ boolean.class,
+ long.class,
+ FluidStack[].class,
+ ItemStack.class,
+ ItemStack[].class);
+ Method a09 = findRecipe09 = ReflectionUtils.getMethod(
+ GT_Recipe_Map.class,
+ "findRecipe",
+ IHasWorldObjectAndCoords.class,
+ GT_Recipe.class,
+ boolean.class,
+ boolean.class,
+ long.class,
+ FluidStack[].class,
+ ItemStack.class,
+ ItemStack[].class);
+ Logger.MACHINE_INFO("Found .08 findRecipe method? " + (a08 != null));
+ Logger.MACHINE_INFO("Found .09 findRecipe method? " + (a09 != null));
+
+ try {
+ calculatePollutionReduction =
+ GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class);
+ } catch (NoSuchMethodException | SecurityException e) {
+ }
+ }
+ // Find Recipe Methods
+ private static final Method findRecipe08;
+ private static final Method findRecipe09;
+
+ public GT_Recipe mLastRecipe;
+ private boolean mInternalCircuit = false;
+ protected long mTotalRunTime = 0;
+ protected boolean mVoidExcess = false;
+
+ public ArrayList<GT_MetaTileEntity_Hatch_ControlCore> mControlCoreBus =
+ new ArrayList<GT_MetaTileEntity_Hatch_ControlCore>();
+ /**
+ * Don't use this for recipe input check, otherwise you'll get duplicated fluids
+ */
+ public ArrayList<GT_MetaTileEntity_Hatch_AirIntake> mAirIntakes =
+ new ArrayList<GT_MetaTileEntity_Hatch_AirIntake>();
+
+ public ArrayList<GT_MetaTileEntity_Hatch_InputBattery> mChargeHatches =
+ new ArrayList<GT_MetaTileEntity_Hatch_InputBattery>();
+ public ArrayList<GT_MetaTileEntity_Hatch_OutputBattery> mDischargeHatches =
+ new ArrayList<GT_MetaTileEntity_Hatch_OutputBattery>();
+ public ArrayList<GT_MetaTileEntity_Hatch> mAllEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
+ public ArrayList<GT_MetaTileEntity_Hatch> mAllDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
+
+ // Custom Behaviour Map
+ private static final HashMap<String, SpecialMultiBehaviour> mCustomBehviours =
+ new HashMap<String, SpecialMultiBehaviour>();
+
+ public GregtechMeta_MultiBlockBase(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
+ public GregtechMeta_MultiBlockBase(final String aName) {
+ super(aName);
+ }
-// Glee8e - 11/12/21 - 2:15pm
-// Yeah, now I see what's wrong. Someone inherited from GregtechMeta_MultiBlockBase instead of GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator> as it should have been
-// so any method in GregtechMetaTileEntity_IndustrialDehydrator would see generic field declared in GregtechMeta_MultiBlockBase without generic parameter
-
-public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_EnhancedMultiBlockBase<T>> extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> {
-
- public static final boolean DEBUG_DISABLE_CORES_TEMPORARILY = true;
-
- static {
-
- Method a08 = findRecipe08 = ReflectionUtils.getMethod(GT_Recipe_Map.class, "findRecipe", IHasWorldObjectAndCoords.class, GT_Recipe.class, boolean.class, long.class, FluidStack[].class, ItemStack.class, ItemStack[].class);
- Method a09 = findRecipe09 = ReflectionUtils.getMethod(GT_Recipe_Map.class, "findRecipe", IHasWorldObjectAndCoords.class, GT_Recipe.class, boolean.class, boolean.class, long.class, FluidStack[].class, ItemStack.class, ItemStack[].class);
- Logger.MACHINE_INFO("Found .08 findRecipe method? "+(a08 != null));
- Logger.MACHINE_INFO("Found .09 findRecipe method? "+(a09 != null));
-
- try {
- calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class);
- }
- catch (NoSuchMethodException | SecurityException e) {}
-
- }
-
- //Find Recipe Methods
- private static final Method findRecipe08;
- private static final Method findRecipe09;
-
- public GT_Recipe mLastRecipe;
- private boolean mInternalCircuit = false;
- protected long mTotalRunTime = 0;
- protected boolean mVoidExcess = false;
-
- public ArrayList<GT_MetaTileEntity_Hatch_ControlCore> mControlCoreBus = new ArrayList<GT_MetaTileEntity_Hatch_ControlCore>();
- /**
- * Don't use this for recipe input check, otherwise you'll get duplicated fluids
- */
- public ArrayList<GT_MetaTileEntity_Hatch_AirIntake> mAirIntakes = new ArrayList<GT_MetaTileEntity_Hatch_AirIntake>();
- public ArrayList<GT_MetaTileEntity_Hatch_InputBattery> mChargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_InputBattery>();
- public ArrayList<GT_MetaTileEntity_Hatch_OutputBattery> mDischargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_OutputBattery>();
- public ArrayList<GT_MetaTileEntity_Hatch> mAllEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
- public ArrayList<GT_MetaTileEntity_Hatch> mAllDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
-
- // Custom Behaviour Map
- private static final HashMap<String, SpecialMultiBehaviour> mCustomBehviours = new HashMap<String, SpecialMultiBehaviour>();
-
-
- public GregtechMeta_MultiBlockBase(final int aID, final String aName,
- final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMeta_MultiBlockBase(final String aName) {
- super(aName);
- }
-
- public static boolean isValidMetaTileEntity(
- final MetaTileEntity aMetaTileEntity) {
- return (aMetaTileEntity.getBaseMetaTileEntity() != null)
- && (aMetaTileEntity.getBaseMetaTileEntity()
- .getMetaTileEntity() == aMetaTileEntity)
- && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
- }
-
- public abstract boolean hasSlotInGUI();
-
- public long getTotalRuntimeInTicks() {
- return this.mTotalRunTime;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- if (hasSlotInGUI()) {
- return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
- }
- else {
- String aCustomGUI = getCustomGUIResourceName();
- if (aCustomGUI == null) {
- return new CONTAINER_MultiMachine_NoPlayerInventory(aPlayerInventory, aBaseMetaTileEntity);
- }
- else {
- return new CONTAINER_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
- }
- }
- }
-
- public abstract String getCustomGUIResourceName();
-
- public boolean requiresVanillaGtGUI() {
- return false;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- String aCustomGUI = getCustomGUIResourceName();
- aCustomGUI = aCustomGUI != null ? aCustomGUI : hasSlotInGUI() ? "MultiblockDisplay" : "MultiblockDisplay_Generic";
- aCustomGUI = aCustomGUI + ".png";
- if (hasSlotInGUI()) {
- if (!requiresVanillaGtGUI()) {
- return new GUI_Multi_Basic_Slotted(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
- }
- else {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
- }
- }
- else {
- if (getCustomGUIResourceName() == null && !hasSlotInGUI()) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
- }
- else {
- return new GUI_MultiMachine_Default(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
- }
- }
- }
-
- public abstract String getMachineType();
-
- public String getMachineTooltip() {
- return "Machine Type: " + EnumChatFormatting.YELLOW + getMachineType() + EnumChatFormatting.RESET;
- }
-
- public String[] getExtraInfoData() {
- return new String[0];
- };
-
- @Override
- public final String[] getInfoData() {
- ArrayList<String> mInfo = new ArrayList<String>();
- try {
- if (!this.getMetaName().equals("")) {
- mInfo.add(this.getMetaName());
- }
-
- String[] extra = getExtraInfoData();
-
- if (extra == null) {
- extra = new String[0];
- }
- if (extra.length > 0) {
- for (String s : extra) {
- mInfo.add(s);
- }
- }
-
- long seconds = (this.mTotalRunTime/20);
- int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7);
- int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks);
- long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7*weeks);
- long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
- long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60);
-
- mInfo.add(getMachineTooltip());
-
- //Lets borrow the GTNH handling
-
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+
- EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+
- EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s");
-
-
- if (!this.mAllEnergyHatches.isEmpty()) {
- long storedEnergy = getStoredEnergyInAllEnergyHatches();
- long maxEnergy = getMaxEnergyStorageOfAllEnergyHatches();
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+":");
- mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+
- EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU"));
-
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+":");
- mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+ " EU/t(*2A) "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+
- EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(getMaxInputVoltage())]+ EnumChatFormatting.RESET));
- ;
- }
- if (!this.mAllDynamoHatches.isEmpty()) {
- long storedEnergy = getStoredEnergyInAllDynamoHatches();
- long maxEnergy = getMaxEnergyStorageOfAllDynamoHatches();
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+" In Dynamos:");
- mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+
- EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU"));
- }
-
- if (-mEUt > 0) {
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+":");
- mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t"));
- }
- else {
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.generation")+":");
- mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Integer.toString(mEUt) + EnumChatFormatting.RESET + " EU/t"));
- }
-
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.problems")+": "+
- EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+
- " "+StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+
- EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %");
-
- if (this.getPollutionPerSecond(null) > 0) {
- int mPollutionReduction = getPollutionReductionForAllMufflers();
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + this.getPollutionPerSecond(null)+ EnumChatFormatting.RESET+"/sec");
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %");
- }
-
- if (this.mControlCoreBus.size() > 0) {
- int tTier = this.getControlCoreTier();
- mInfo.add(StatCollector.translateToLocal("GTPP.CC.machinetier")+": "+
- EnumChatFormatting.GREEN+tTier+EnumChatFormatting.RESET);
- }
-
- mInfo.add(StatCollector.translateToLocal("GTPP.CC.discount")+": "+
- EnumChatFormatting.GREEN+(getEuDiscountForParallelism())+EnumChatFormatting.RESET + "%");
-
- mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(getMaxParallelRecipes())+EnumChatFormatting.RESET);
-
-
- mInfo.add("Total Time Since Built: " + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks, " + EnumChatFormatting.DARK_GREEN+ Integer.toString(days) +EnumChatFormatting.RESET+ " Days, ");
- mInfo.add(EnumChatFormatting.DARK_GREEN + Long.toString(hours) +EnumChatFormatting.RESET + " Hours, " + EnumChatFormatting.DARK_GREEN+ Long.toString(minutes) +EnumChatFormatting.RESET+ " Minutes, " + EnumChatFormatting.DARK_GREEN+ Long.toString(second) +EnumChatFormatting.RESET+ " Seconds.");
- mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + Long.toString(this.mTotalRunTime));
-
-
- String[] mInfo2 = mInfo.toArray(new String[mInfo.size()]);
- return mInfo2;
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- return new String[] {};
-
-
- }
-
- public int getPollutionReductionForAllMufflers() {
- int mPollutionReduction=0;
- for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- mPollutionReduction=Math.max(calculatePollutionReductionForHatch(tHatch, 100),mPollutionReduction);
- }
- }
- return mPollutionReduction;
- }
-
- public long getStoredEnergyInAllEnergyHatches() {
- long storedEnergy=0;
- for(GT_MetaTileEntity_Hatch tHatch : mAllEnergyHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU();
- }
- }
- return storedEnergy;
- }
-
- public long getMaxEnergyStorageOfAllEnergyHatches() {
- long maxEnergy=0;
- for(GT_MetaTileEntity_Hatch tHatch : mAllEnergyHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity();
- }
- }
- return maxEnergy;
- }
-
- public long getStoredEnergyInAllDynamoHatches() {
- long storedEnergy=0;
- for(GT_MetaTileEntity_Hatch tHatch : mAllDynamoHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU();
- }
- }
- return storedEnergy;
- }
-
- public long getMaxEnergyStorageOfAllDynamoHatches() {
- long maxEnergy=0;
- for(GT_MetaTileEntity_Hatch tHatch : mAllDynamoHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity();
- }
- }
- return maxEnergy;
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- private String[] aCachedToolTip;
-
- /*private final String aRequiresMuffler = "1x Muffler Hatch";
- private final String aRequiresCoreModule = "1x Core Module";
- private final String aRequiresMaint = "1x Maintanence Hatch";*/
-
- public final static String TAG_HIDE_HATCHES = "TAG_HIDE_HATCHES";
- public final static String TAG_HIDE_MAINT = "TAG_HIDE_MAINT";
- public final static String TAG_HIDE_POLLUTION = "TAG_HIDE_POLLUTION";
- public final static String TAG_HIDE_MACHINE_TYPE = "TAG_HIDE_MACHINE_TYPE";
-
- public int getAmountOfOutputs() {
- return 1;
- }
-
- public abstract int getMaxParallelRecipes();
- public abstract int getEuDiscountForParallelism();
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack paramItemStack) {
- return true;
- }
-
- @Override
- public int getDamageToComponent(final ItemStack paramItemStack) {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack p0) {
- return false;
- }
-
- @Override
- public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient(getSound(), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess() {
- if(GT_Utility.isStringValid(getSound())) this.sendLoopStart((byte) 1);
- }
-
- public String getSound() { return ""; }
-
-
- public int canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) {
- return canBufferOutputs(aRecipe, aParallelRecipes, true);
- }
-
- public int canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes, boolean aAllow16SlotWithoutCheck) {
- // Null recipe or a recipe with lots of outputs?
- // E.G. Gendustry custom comb with a billion centrifuge outputs?
- // Do it anyway, provided the multi allows it. Default behaviour is aAllow16SlotWithoutCheck = true.
- if (aRecipe == null || aRecipe.mOutputs.length > 16) {
- if (aRecipe == null) {
- return 0;
- }
- else if (aRecipe.mOutputs.length > 16) {
- if (aAllow16SlotWithoutCheck) {
- return aParallelRecipes;
- }
- else {
- // Do nothing, we want to check this recipe properly.
- }
- }
- }
- return canBufferOutputs(aRecipe.mOutputs, aRecipe.mFluidOutputs, aParallelRecipes);
- }
-
- public int canBufferOutputs(ItemStack[] aItemOutputs, FluidStack[] aFluidOutputs, int aParallelRecipes) {
- if (mVoidExcess) return aParallelRecipes;
- log("Determining if we have space to buffer outputs. Parallel: "+aParallelRecipes);
-
- // Do we even need to check for item outputs?
- boolean aDoesOutputItems = aItemOutputs.length > 0;
- // Do we even need to check for fluid outputs?
- boolean aDoesOutputFluids = aFluidOutputs.length > 0;
-
-
-
- /* ========================================
- * Item Management
- * ========================================
- */
-
- if (aDoesOutputItems) {
- log("We have items to output.");
-
- // How many slots are free across all the output buses?
- int aInputBusSlotsFree = 0;
-
- /*
- * Create Variables for Item Output
- */
-
- AutoMap<FlexiblePair<ItemStack, Integer>> aItemMap = new AutoMap<FlexiblePair<ItemStack, Integer>>();
- AutoMap<ItemStack> aOutputs = new AutoMap<ItemStack>(aItemOutputs);
-
- for (final GT_MetaTileEntity_Hatch_OutputBus tBus : this.mOutputBusses) {
- if (!isValidMetaTileEntity(tBus)) {
- continue;
- }
- final IInventory tBusInv = tBus.getBaseMetaTileEntity();
- for (int i = 0; i < tBusInv.getSizeInventory(); i++) {
- if (tBus.getStackInSlot(i) == null) {
- aInputBusSlotsFree++;
- }
- else {
- ItemStack aT = tBus.getStackInSlot(i);
- int aSize = aT.stackSize;
- aT = aT.copy();
- aT.stackSize = 0;
- aItemMap.put(new FlexiblePair<ItemStack, Integer>(aT, aSize));
- }
- }
- }
-
- // A map to hold the items we will be 'inputting' into the output buses. These itemstacks are actually the recipe outputs.
- ConcurrentSet<FlexiblePair<ItemStack, Integer>> aInputMap = new ConcurrentHashSet<FlexiblePair<ItemStack, Integer>>();
-
- // Iterate over the outputs, calculating require stack spacing they will require.
- for (int i=0;i<aOutputs.size();i++) {
- ItemStack aY = aOutputs.get(i);
- if (aY == null) {
- continue;
- }
- else {
- int aStackSize = aY.stackSize * aParallelRecipes;
-
- int aSlotsNeedsForThisStack = (int) Math.ceil((float) aStackSize / aY.getMaxStackSize());
- // Should round up and add as many stacks as required nicely.
- for (int o=0;o<aSlotsNeedsForThisStack;o++) {
- if (aStackSize < 1) break;
- int aStackToRemove = Math.min(aStackSize, aY.getMaxStackSize());
- aStackSize -= aStackToRemove;
- aY = aY.copy();
- aY.stackSize = 0;
- aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackToRemove));
- }
- }
- }
-
- // We have items to add to the output buses. See if any are not full stacks and see if we can make them full.
- if (aInputMap.size() > 0) {
- // Iterate over the current stored items in the Output busses, if any match and are not full, we can try account for merging.
- busItems: for (FlexiblePair<ItemStack, Integer> y : aItemMap) {
- // Iterate over the 'inputs', we can safely remove these as we go.
- outputItems: for (FlexiblePair<ItemStack, Integer> u : aInputMap) {
- // Create local vars for readability.
- ItemStack aOutputBusStack = y.getKey();
- ItemStack aOutputStack = u.getKey();
- // Stacks match, including NBT.
- if (GT_Utility.areStacksEqual(aOutputBusStack, aOutputStack, false)) {
- // Stack Matches, but it's full, continue.
- if (aOutputBusStack.stackSize >= 64) {
- // This stack is full, no point checking it.
- continue busItems;
- }
- else {
- // We can merge these two stacks without any hassle.
- if ((aOutputBusStack.stackSize + aOutputStack.stackSize) <= 64) {
- // Update the stack size in the bus storage map.
- y.setValue(aOutputBusStack.stackSize + aOutputStack.stackSize);
- // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
- aInputMap.remove(u);
- continue outputItems;
- }
- // Stack merging is too much, so we fill this stack, leave the remainder.
- else {
- int aRemainder = (aOutputBusStack.stackSize + aOutputStack.stackSize) - 64;
- // Update the stack size in the bus storage map.
- y.setValue(64);
- // Create a new object to iterate over later, with the remainder data;
- FlexiblePair<ItemStack, Integer> t = new FlexiblePair<ItemStack, Integer>(u.getKey(), aRemainder);
- // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
- aInputMap.remove(u);
- // Add the remainder stack.
- aInputMap.add(t);
- continue outputItems;
- }
- }
- }
- else {
- continue outputItems;
- }
- }
- }
- }
-
- // We have stacks that did not merge, do we have space for them?
- if (aInputMap.size() > 0) {
- if (aInputMap.size() > aInputBusSlotsFree) {
- aParallelRecipes = (int) Math.floor((double) aInputBusSlotsFree/aInputMap.size() * aParallelRecipes);
- // We do not have enough free slots in total to accommodate the remaining managed stacks.
- log(" Free: "+aInputBusSlotsFree+", Required: "+aInputMap.size());
- if(aParallelRecipes == 0) {
- log("Failed to find enough space for all item outputs.");
- return 0;
- }
-
- }
- }
-
- /*
- * End Item Management
- */
-
- }
-
-
-
-
-
- /* ========================================
- * Fluid Management
- * ========================================
- */
-
-
-
- if (aDoesOutputFluids) {
- log("We have Fluids to output.");
- // How many slots are free across all the output buses?
- int aFluidHatches = 0;
- int aEmptyFluidHatches = 0;
- int aFullFluidHatches = 0;
- // Create Map for Fluid Output
- ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches = new ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>();
- for (final GT_MetaTileEntity_Hatch_Output tBus : this.mOutputHatches) {
- if (!isValidMetaTileEntity(tBus)) {
- continue;
- }
- aFluidHatches++;
- // Map the Hatch with the space left for easy checking later.
- if (tBus.getFluid() == null) {
- aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(tBus, null, tBus.getCapacity()));
- }
- else {
- int aSpaceLeft = tBus.getCapacity() - tBus.getFluidAmount();
- aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(tBus, tBus.getFluid(), aSpaceLeft));
- }
- }
- // Create a map of all the fluids we would like to output, we can iterate over this and see how many we can merge into existing hatch stacks.
- ArrayList<FluidStack> aOutputFluids = new ArrayList<FluidStack>();
- // Ugly ass boxing
- aOutputFluids.addAll(new AutoMap<FluidStack>(aFluidOutputs));
- // Iterate the Hatches, updating their 'stored' data.
- //for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aHatchData : aOutputHatches) {
- for (int i = 0;i<aOutputHatches.size();i++) {
- // The Hatch Itself
- GT_MetaTileEntity_Hatch_Output aHatch = aOutputHatches.get(i).getValue_1();
- // Fluid in the Hatch
- FluidStack aHatchStack = aOutputHatches.get(i).getValue_2();
- // Fluid that the hatch is locked to
- String aHatchLockedFluid = aOutputHatches.get(i).getValue_1().getLockedFluidName();
- // Space left in Hatch
- int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount();
- // Hatch is full,
- if (aSpaceLeftInHatch <= 0) {
- aFullFluidHatches++;
- aOutputHatches.remove(aOutputHatches.get(i));
- i--;
- continue;
- }
- // Hatch has space
- else {
- // Check if any fluids match
- //aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) {
- for(int j = 0;j<aOutputFluids.size();j++) {
- //log(" aHatchStack "+aHatchStack.getLocalizedName()+" aOutput stack "+aOutputStack.getLocalizedName());
- if (GT_Utility.areFluidsEqual(aHatchStack, aOutputFluids.get(j)) && (aHatchLockedFluid == null || aHatchLockedFluid.equals(aOutputFluids.get(j).getFluid().getName()))) {
- int aFluidToPutIntoHatch = aOutputFluids.get(j).amount * aParallelRecipes;
- // Not Enough space to insert all of the fluid.
- // We fill this hatch and add a smaller Fluidstack back to the iterator.
- if (aSpaceLeftInHatch < aFluidToPutIntoHatch) {
- // Copy existing Hatch Stack
- FluidStack aNewHatchStack = aHatchStack.copy();
- aNewHatchStack.amount = 0;
- // Copy existing Hatch Stack again
- FluidStack aNewOutputStack = aHatchStack.copy();
- aNewOutputStack.amount = 0;
- // How much fluid do we have left after we fill the hatch?
- int aFluidLeftAfterInsert = aFluidToPutIntoHatch - aSpaceLeftInHatch;
- // Set new stacks to appropriate values
- aNewHatchStack.amount = aHatch.getCapacity();
- aNewOutputStack.amount = aFluidLeftAfterInsert;
- // Remove fluid from output list, merge success
- aOutputFluids.remove(aOutputFluids.get(j));
- j--;
- // Remove hatch from hatch list, data is now invalid.
- aOutputHatches.remove(aOutputHatches.get(i));
- i--;
- // Add remaining Fluid to Output list
- aOutputFluids.add(aNewOutputStack);
- // Re-add hatch to hatch list, with new data.
- //Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
- //aOutputHatches.add(aNewHatchData);
- break;
- }
- // We can fill this hatch perfectly (rare case), may as well add it directly to the full list.
- else if (aSpaceLeftInHatch == aFluidToPutIntoHatch) {
- // Copy Old Stack
- FluidStack aNewHatchStack = aHatchStack.copy();
- // Add in amount from output stack
- aNewHatchStack.amount += aFluidToPutIntoHatch;
- // Remove fluid from output list, merge success
- aOutputFluids.remove(aOutputFluids.get(j));
- j--;
- // Remove hatch from hatch list, data is now invalid.
- aOutputHatches.remove(aOutputHatches.get(i));
- i--;
- // Re-add hatch to hatch list, with new data.
- Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
- aOutputHatches.add(aNewHatchData);
- break;
- }
- // We have more space than we need to merge, so we remove the stack from the output list and update the hatch list.
- else {
- // Copy Old Stack
- FluidStack aNewHatchStack = aHatchStack.copy();
- // Add in amount from output stack
- aNewHatchStack.amount += aFluidToPutIntoHatch;
- // Remove fluid from output list, merge success
- aOutputFluids.remove(aOutputFluids.get(j));
- j--;
- // Remove hatch from hatch list, data is now invalid.
- aOutputHatches.remove(aOutputHatches.get(i));
- i--;
- // Re-add hatch to hatch list, with new data.
- Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
- aOutputHatches.add(aNewHatchData);
- // Check next fluid
- continue;
- }
-
- }
- else if (aHatchLockedFluid == null || aHatchLockedFluid.equals(aOutputFluids.get(j).getFluid().getName())) {
- aEmptyFluidHatches++;
- }
- else {
- continue;
- }
- }
- }
- }
-
- for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aFreeHatchCheck : aOutputHatches) {
- // Free Hatch
- if ((aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) && !aFreeHatchCheck.getValue_1().isFluidLocked()) {
- aEmptyFluidHatches++;
- }
- }
-
- // We have Fluid Stacks we did not merge. Do we have space?
- log("fluids to output "+aOutputFluids.size()+" empty hatches "+aEmptyFluidHatches);
- if (aOutputFluids.size() > 0) {
- // Not enough space to add fluids.
- if (aOutputFluids.size() > aEmptyFluidHatches) {
- aParallelRecipes = (int) Math.floor((double) aEmptyFluidHatches/aOutputFluids.size() * aParallelRecipes);
- log("Failed to find enough space for all fluid outputs. Free: "+aEmptyFluidHatches+", Required: "+aOutputFluids.size());
- return 0;
-
- }
- }
-
- /*
- * End Fluid Management
- */
- }
-
- return aParallelRecipes;
- }
-
- /**
- * A Static {@link Method} object which holds the current status of logging.
- */
- public static Method aLogger = null;
-
- public void log(String s) {
- if (!AsmConfig.disableAllLogging) {
- if (CORE_Preloader.DEBUG_MODE) {
- Logger.INFO(s);
- } else {
- Logger.MACHINE_INFO(s);
- }
- }
- }
-
- public boolean checkRecipeGeneric() {
- return checkRecipeGeneric(1, 100, 0);
- }
-
- public boolean checkRecipeGeneric(int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent) {
- return checkRecipeGeneric(aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, 10000);
- }
-
- public boolean checkRecipeGeneric(int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
- ArrayList<ItemStack> tItems = getStoredInputs();
- ArrayList<FluidStack> tFluids = getStoredFluids();
- ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
- FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
- return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll);
- }
-
- public boolean checkRecipeGeneric(GT_Recipe aRecipe,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
- if (aRecipe == null) {
- return false;
- }
- ArrayList<ItemStack> tItems = getStoredInputs();
- ArrayList<FluidStack> tFluids = getStoredFluids();
- ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
- FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
- return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe);
- }
-
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
- return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null);
- }
-
-
- /*
- * public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[]
- * aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int
- * aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on
- * the Processing Array. A bit overkill, but very flexible.
- *
- *
- * if (this.doesMachineBoostOutput()) { log("Boosting."); return
- * checkRecipeBoostedOutputs(aItemInputs, aFluidInputs, aMaxParallelRecipes,
- * aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe); }
- *
- *
- * //Control Core to control the Multiblocks behaviour. int aControlCoreTier =
- * getControlCoreTier();
- *
- * //If no core, return false; if (aControlCoreTier > 0) {
- * log("Control core found."); }
- *
- *
- * // Reset outputs and progress stats this.mEUt = 0; this.mMaxProgresstime = 0;
- * this.mOutputItems = new ItemStack[]{}; this.mOutputFluids = new
- * FluidStack[]{};
- *
- * long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1,
- * GT_Utility.getTier(tVoltage)); log("Running checkRecipeGeneric(0)");
- *
- * //Check to see if Voltage Tier > Control Core Tier if (tTier >
- * aControlCoreTier) {
- * log("Control core found is lower tier than power tier. OK"); tTier = (byte)
- * aControlCoreTier; }
- *
- * tTier = (byte) MathUtils.getValueWithinRange(tTier, 0, 9);
- *
- * GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe(
- * getBaseMetaTileEntity(), mLastRecipe, false,
- * gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
- *
- * log("Running checkRecipeGeneric(1)"); // Remember last recipe - an
- * optimization for findRecipe() this.mLastRecipe = tRecipe;
- *
- * if (tRecipe == null) { log("BAD RETURN - 1"); return false; }
- *
- * if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
- * log("BAD RETURN - 2"); return false; }
- *
- * // EU discount float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; float
- * tTotalEUt = 0.0f;
- *
- * int parallelRecipes = 0;
- *
- * log("parallelRecipes: "+parallelRecipes);
- * log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- * log("tTotalEUt: "+tTotalEUt); log("tVoltage: "+tVoltage);
- * log("tRecipeEUt: "+tRecipeEUt); log("EU1: "+tRecipeEUt); // Count
- * recipes to do in parallel, consuming input items and fluids and considering
- * input voltage limits for (; parallelRecipes < aMaxParallelRecipes &&
- * tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { if
- * (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- * log("Broke at "+parallelRecipes+"."); break; }
- * log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt
- * += tRecipeEUt; log("EU2: "+tTotalEUt); }
- *
- * if (parallelRecipes == 0) { log("BAD RETURN - 3"); return false; }
- *
- * log("EU3: "+tTotalEUt);
- *
- * // -- Try not to fail after this point - inputs have already been consumed!
- * --
- *
- *
- * // Convert speed bonus to duration multiplier // e.g. 100% speed bonus = 200%
- * speed = 100%/200% = 50% recipe duration. aSpeedBonusPercent = Math.max(-99,
- * aSpeedBonusPercent); float tTimeFactor = 100.0f / (100.0f +
- * aSpeedBonusPercent); this.mMaxProgresstime = (int)(tRecipe.mDuration *
- * tTimeFactor * 10000);
- *
- * int aTempEu = (int) Math.floor(tTotalEUt); log("EU4: "+aTempEu);
- * this.mEUt = (int) aTempEu;
- *
- *
- * this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- * this.mEfficiencyIncrease = 10000;
- *
- * // Overclock if (this.mEUt <= 16) { this.mEUt = (this.mEUt * (1 << tTier - 1)
- * * (1 << tTier - 1)); this.mMaxProgresstime = (this.mMaxProgresstime / (1 <<
- * tTier - 1)); } else { while (this.mEUt <=
- * gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4;
- * this.mMaxProgresstime /= 2; } }
- *
- * if (this.mEUt > 0) { this.mEUt = (-this.mEUt); }
- *
- * this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- *
- * // Collect fluid outputs FluidStack[] tOutputFluids = new
- * FluidStack[tRecipe.mFluidOutputs.length]; for (int h = 0; h <
- * tRecipe.mFluidOutputs.length; h++) { if (tRecipe.getFluidOutput(h) != null) {
- * tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); tOutputFluids[h].amount
- * *= parallelRecipes; } }
- *
- * // Collect output item types ItemStack[] tOutputItems = new
- * ItemStack[tRecipe.mOutputs.length]; for (int h = 0; h <
- * tRecipe.mOutputs.length; h++) { if (tRecipe.getOutput(h) != null) {
- * tOutputItems[h] = tRecipe.getOutput(h).copy(); tOutputItems[h].stackSize = 0;
- * } }
- *
- * // Set output item stack sizes (taking output chance into account) for (int f
- * = 0; f < tOutputItems.length; f++) { if (tRecipe.mOutputs[f] != null &&
- * tOutputItems[f] != null) { for (int g = 0; g < parallelRecipes; g++) { if
- * (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) <
- * tRecipe.getOutputChance(f)) tOutputItems[f].stackSize +=
- * tRecipe.mOutputs[f].stackSize; } } }
- *
- * tOutputItems = removeNulls(tOutputItems);
- *
- * // Sanitize item stack size, splitting any stacks greater than max stack size
- * List<ItemStack> splitStacks = new ArrayList<ItemStack>(); for (ItemStack
- * tItem : tOutputItems) { while (tItem.getMaxStackSize() < tItem.stackSize) {
- * ItemStack tmp = tItem.copy(); tmp.stackSize = tmp.getMaxStackSize();
- * tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- * splitStacks.add(tmp); } }
- *
- * if (splitStacks.size() > 0) { ItemStack[] tmp = new
- * ItemStack[splitStacks.size()]; tmp = splitStacks.toArray(tmp); tOutputItems =
- * ArrayUtils.addAll(tOutputItems, tmp); }
- *
- * // Strip empty stacks List<ItemStack> tSList = new ArrayList<ItemStack>();
- * for (ItemStack tS : tOutputItems) { if (tS.stackSize > 0) tSList.add(tS); }
- * tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
- *
- * // Commit outputs this.mOutputItems = tOutputItems; this.mOutputFluids =
- * tOutputFluids; updateSlots();
- *
- * // Play sounds (GT++ addition - GT multiblocks play no sounds)
- * startProcess();
- *
- * log("GOOD RETURN - 1"); return true; }
- */
-
- public long getMaxInputEnergy() {
- long rEnergy = 0;
- if (mEnergyHatches.size() == 1) // so it only takes 1 amp is only 1 hatch is present so it works like most gt multies
- return mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage();
+ public static boolean isValidMetaTileEntity(final MetaTileEntity aMetaTileEntity) {
+ return (aMetaTileEntity.getBaseMetaTileEntity() != null)
+ && (aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity)
+ && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
+ }
+
+ public abstract boolean hasSlotInGUI();
+
+ public long getTotalRuntimeInTicks() {
+ return this.mTotalRunTime;
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ if (hasSlotInGUI()) {
+ return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ } else {
+ String aCustomGUI = getCustomGUIResourceName();
+ if (aCustomGUI == null) {
+ return new CONTAINER_MultiMachine_NoPlayerInventory(aPlayerInventory, aBaseMetaTileEntity);
+ } else {
+ return new CONTAINER_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+ }
+ }
+
+ public abstract String getCustomGUIResourceName();
+
+ public boolean requiresVanillaGtGUI() {
+ return false;
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ String aCustomGUI = getCustomGUIResourceName();
+ aCustomGUI =
+ aCustomGUI != null ? aCustomGUI : hasSlotInGUI() ? "MultiblockDisplay" : "MultiblockDisplay_Generic";
+ aCustomGUI = aCustomGUI + ".png";
+ if (hasSlotInGUI()) {
+ if (!requiresVanillaGtGUI()) {
+ return new GUI_Multi_Basic_Slotted(
+ aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
+ } else {
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
+ }
+ } else {
+ if (getCustomGUIResourceName() == null && !hasSlotInGUI()) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
+ } else {
+ return new GUI_MultiMachine_Default(
+ aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
+ }
+ }
+ }
+
+ public abstract String getMachineType();
+
+ public String getMachineTooltip() {
+ return "Machine Type: " + EnumChatFormatting.YELLOW + getMachineType() + EnumChatFormatting.RESET;
+ }
+
+ public String[] getExtraInfoData() {
+ return new String[0];
+ }
+ ;
+
+ @Override
+ public final String[] getInfoData() {
+ ArrayList<String> mInfo = new ArrayList<String>();
+ try {
+ if (!this.getMetaName().equals("")) {
+ mInfo.add(this.getMetaName());
+ }
+
+ String[] extra = getExtraInfoData();
+
+ if (extra == null) {
+ extra = new String[0];
+ }
+ if (extra.length > 0) {
+ for (String s : extra) {
+ mInfo.add(s);
+ }
+ }
+
+ long seconds = (this.mTotalRunTime / 20);
+ int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7);
+ int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks);
+ long hours =
+ TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7 * weeks);
+ long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
+ long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60);
+
+ mInfo.add(getMachineTooltip());
+
+ // Lets borrow the GTNH handling
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress") + ": " + EnumChatFormatting.GREEN
+ + Integer.toString(mProgresstime / 20) + EnumChatFormatting.RESET + " s / "
+ + EnumChatFormatting.YELLOW
+ + Integer.toString(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s");
+
+ if (!this.mAllEnergyHatches.isEmpty()) {
+ long storedEnergy = getStoredEnergyInAllEnergyHatches();
+ long maxEnergy = getMaxEnergyStorageOfAllEnergyHatches();
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy") + ":");
+ mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.GREEN + Long.toString(storedEnergy)
+ + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + Long.toString(maxEnergy)
+ + EnumChatFormatting.RESET + " EU"));
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei") + ":");
+ mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.YELLOW
+ + Long.toString(getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) "
+ + StatCollector.translateToLocal("GTPP.machines.tier") + ": " + EnumChatFormatting.YELLOW
+ + GT_Values.VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET));
+ ;
+ }
+ if (!this.mAllDynamoHatches.isEmpty()) {
+ long storedEnergy = getStoredEnergyInAllDynamoHatches();
+ long maxEnergy = getMaxEnergyStorageOfAllDynamoHatches();
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy") + " In Dynamos:");
+ mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.GREEN + Long.toString(storedEnergy)
+ + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + Long.toString(maxEnergy)
+ + EnumChatFormatting.RESET + " EU"));
+ }
+
+ if (-mEUt > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage") + ":");
+ mInfo.add(StatCollector.translateToLocal(
+ "" + EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t"));
+ } else {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.generation") + ":");
+ mInfo.add(StatCollector.translateToLocal(
+ "" + EnumChatFormatting.GREEN + Integer.toString(mEUt) + EnumChatFormatting.RESET + " EU/t"));
+ }
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.problems") + ": " + EnumChatFormatting.RED
+ + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " "
+ + StatCollector.translateToLocal("GTPP.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW
+ + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %");
+
+ if (this.getPollutionPerSecond(null) > 0) {
+ int mPollutionReduction = getPollutionReductionForAllMufflers();
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution") + ": " + EnumChatFormatting.RED
+ + this.getPollutionPerSecond(null) + EnumChatFormatting.RESET + "/sec");
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced") + ": "
+ + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %");
+ }
+
+ if (this.mControlCoreBus.size() > 0) {
+ int tTier = this.getControlCoreTier();
+ mInfo.add(StatCollector.translateToLocal("GTPP.CC.machinetier") + ": " + EnumChatFormatting.GREEN
+ + tTier + EnumChatFormatting.RESET);
+ }
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.CC.discount") + ": " + EnumChatFormatting.GREEN
+ + (getEuDiscountForParallelism()) + EnumChatFormatting.RESET + "%");
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel") + ": " + EnumChatFormatting.GREEN
+ + (getMaxParallelRecipes()) + EnumChatFormatting.RESET);
+
+ mInfo.add("Total Time Since Built: " + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)
+ + EnumChatFormatting.RESET + " Weeks, " + EnumChatFormatting.DARK_GREEN + Integer.toString(days)
+ + EnumChatFormatting.RESET + " Days, ");
+ mInfo.add(EnumChatFormatting.DARK_GREEN + Long.toString(hours) + EnumChatFormatting.RESET + " Hours, "
+ + EnumChatFormatting.DARK_GREEN + Long.toString(minutes) + EnumChatFormatting.RESET + " Minutes, "
+ + EnumChatFormatting.DARK_GREEN + Long.toString(second) + EnumChatFormatting.RESET + " Seconds.");
+ mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + Long.toString(this.mTotalRunTime));
+
+ String[] mInfo2 = mInfo.toArray(new String[mInfo.size()]);
+ return mInfo2;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ return new String[] {};
+ }
+
+ public int getPollutionReductionForAllMufflers() {
+ int mPollutionReduction = 0;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ mPollutionReduction = Math.max(calculatePollutionReductionForHatch(tHatch, 100), mPollutionReduction);
+ }
+ }
+ return mPollutionReduction;
+ }
+
+ public long getStoredEnergyInAllEnergyHatches() {
+ long storedEnergy = 0;
+ for (GT_MetaTileEntity_Hatch tHatch : mAllEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ }
+ }
+ return storedEnergy;
+ }
+
+ public long getMaxEnergyStorageOfAllEnergyHatches() {
+ long maxEnergy = 0;
+ for (GT_MetaTileEntity_Hatch tHatch : mAllEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
+ }
+ }
+ return maxEnergy;
+ }
+
+ public long getStoredEnergyInAllDynamoHatches() {
+ long storedEnergy = 0;
+ for (GT_MetaTileEntity_Hatch tHatch : mAllDynamoHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ }
+ }
+ return storedEnergy;
+ }
+
+ public long getMaxEnergyStorageOfAllDynamoHatches() {
+ long maxEnergy = 0;
+ for (GT_MetaTileEntity_Hatch tHatch : mAllDynamoHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
+ }
+ }
+ return maxEnergy;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ private String[] aCachedToolTip;
+
+ /*private final String aRequiresMuffler = "1x Muffler Hatch";
+ private final String aRequiresCoreModule = "1x Core Module";
+ private final String aRequiresMaint = "1x Maintanence Hatch";*/
+
+ public static final String TAG_HIDE_HATCHES = "TAG_HIDE_HATCHES";
+ public static final String TAG_HIDE_MAINT = "TAG_HIDE_MAINT";
+ public static final String TAG_HIDE_POLLUTION = "TAG_HIDE_POLLUTION";
+ public static final String TAG_HIDE_MACHINE_TYPE = "TAG_HIDE_MACHINE_TYPE";
+
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ public abstract int getMaxParallelRecipes();
+
+ public abstract int getEuDiscountForParallelism();
+
+ @Override
+ public boolean isCorrectMachinePart(final ItemStack paramItemStack) {
+ return true;
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack paramItemStack) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack p0) {
+ return false;
+ }
+
+ @Override
+ public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient(getSound(), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ if (GT_Utility.isStringValid(getSound())) this.sendLoopStart((byte) 1);
+ }
+
+ public String getSound() {
+ return "";
+ }
+
+ public int canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) {
+ return canBufferOutputs(aRecipe, aParallelRecipes, true);
+ }
+
+ public int canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes, boolean aAllow16SlotWithoutCheck) {
+ // Null recipe or a recipe with lots of outputs?
+ // E.G. Gendustry custom comb with a billion centrifuge outputs?
+ // Do it anyway, provided the multi allows it. Default behaviour is aAllow16SlotWithoutCheck = true.
+ if (aRecipe == null || aRecipe.mOutputs.length > 16) {
+ if (aRecipe == null) {
+ return 0;
+ } else if (aRecipe.mOutputs.length > 16) {
+ if (aAllow16SlotWithoutCheck) {
+ return aParallelRecipes;
+ } else {
+ // Do nothing, we want to check this recipe properly.
+ }
+ }
+ }
+ return canBufferOutputs(aRecipe.mOutputs, aRecipe.mFluidOutputs, aParallelRecipes);
+ }
+
+ public int canBufferOutputs(ItemStack[] aItemOutputs, FluidStack[] aFluidOutputs, int aParallelRecipes) {
+ if (mVoidExcess) return aParallelRecipes;
+ log("Determining if we have space to buffer outputs. Parallel: " + aParallelRecipes);
+
+ // Do we even need to check for item outputs?
+ boolean aDoesOutputItems = aItemOutputs.length > 0;
+ // Do we even need to check for fluid outputs?
+ boolean aDoesOutputFluids = aFluidOutputs.length > 0;
+
+ /* ========================================
+ * Item Management
+ * ========================================
+ */
+
+ if (aDoesOutputItems) {
+ log("We have items to output.");
+
+ // How many slots are free across all the output buses?
+ int aInputBusSlotsFree = 0;
+
+ /*
+ * Create Variables for Item Output
+ */
+
+ AutoMap<FlexiblePair<ItemStack, Integer>> aItemMap = new AutoMap<FlexiblePair<ItemStack, Integer>>();
+ AutoMap<ItemStack> aOutputs = new AutoMap<ItemStack>(aItemOutputs);
+
+ for (final GT_MetaTileEntity_Hatch_OutputBus tBus : this.mOutputBusses) {
+ if (!isValidMetaTileEntity(tBus)) {
+ continue;
+ }
+ final IInventory tBusInv = tBus.getBaseMetaTileEntity();
+ for (int i = 0; i < tBusInv.getSizeInventory(); i++) {
+ if (tBus.getStackInSlot(i) == null) {
+ aInputBusSlotsFree++;
+ } else {
+ ItemStack aT = tBus.getStackInSlot(i);
+ int aSize = aT.stackSize;
+ aT = aT.copy();
+ aT.stackSize = 0;
+ aItemMap.put(new FlexiblePair<ItemStack, Integer>(aT, aSize));
+ }
+ }
+ }
+
+ // A map to hold the items we will be 'inputting' into the output buses. These itemstacks are actually the
+ // recipe outputs.
+ ConcurrentSet<FlexiblePair<ItemStack, Integer>> aInputMap =
+ new ConcurrentHashSet<FlexiblePair<ItemStack, Integer>>();
+
+ // Iterate over the outputs, calculating require stack spacing they will require.
+ for (int i = 0; i < aOutputs.size(); i++) {
+ ItemStack aY = aOutputs.get(i);
+ if (aY == null) {
+ continue;
+ } else {
+ int aStackSize = aY.stackSize * aParallelRecipes;
+
+ int aSlotsNeedsForThisStack = (int) Math.ceil((float) aStackSize / aY.getMaxStackSize());
+ // Should round up and add as many stacks as required nicely.
+ for (int o = 0; o < aSlotsNeedsForThisStack; o++) {
+ if (aStackSize < 1) break;
+ int aStackToRemove = Math.min(aStackSize, aY.getMaxStackSize());
+ aStackSize -= aStackToRemove;
+ aY = aY.copy();
+ aY.stackSize = 0;
+ aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackToRemove));
+ }
+ }
+ }
+
+ // We have items to add to the output buses. See if any are not full stacks and see if we can make them
+ // full.
+ if (aInputMap.size() > 0) {
+ // Iterate over the current stored items in the Output busses, if any match and are not full, we can try
+ // account for merging.
+ busItems:
+ for (FlexiblePair<ItemStack, Integer> y : aItemMap) {
+ // Iterate over the 'inputs', we can safely remove these as we go.
+ outputItems:
+ for (FlexiblePair<ItemStack, Integer> u : aInputMap) {
+ // Create local vars for readability.
+ ItemStack aOutputBusStack = y.getKey();
+ ItemStack aOutputStack = u.getKey();
+ // Stacks match, including NBT.
+ if (GT_Utility.areStacksEqual(aOutputBusStack, aOutputStack, false)) {
+ // Stack Matches, but it's full, continue.
+ if (aOutputBusStack.stackSize >= 64) {
+ // This stack is full, no point checking it.
+ continue busItems;
+ } else {
+ // We can merge these two stacks without any hassle.
+ if ((aOutputBusStack.stackSize + aOutputStack.stackSize) <= 64) {
+ // Update the stack size in the bus storage map.
+ y.setValue(aOutputBusStack.stackSize + aOutputStack.stackSize);
+ // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
+ aInputMap.remove(u);
+ continue outputItems;
+ }
+ // Stack merging is too much, so we fill this stack, leave the remainder.
+ else {
+ int aRemainder = (aOutputBusStack.stackSize + aOutputStack.stackSize) - 64;
+ // Update the stack size in the bus storage map.
+ y.setValue(64);
+ // Create a new object to iterate over later, with the remainder data;
+ FlexiblePair<ItemStack, Integer> t =
+ new FlexiblePair<ItemStack, Integer>(u.getKey(), aRemainder);
+ // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
+ aInputMap.remove(u);
+ // Add the remainder stack.
+ aInputMap.add(t);
+ continue outputItems;
+ }
+ }
+ } else {
+ continue outputItems;
+ }
+ }
+ }
+ }
+
+ // We have stacks that did not merge, do we have space for them?
+ if (aInputMap.size() > 0) {
+ if (aInputMap.size() > aInputBusSlotsFree) {
+ aParallelRecipes =
+ (int) Math.floor((double) aInputBusSlotsFree / aInputMap.size() * aParallelRecipes);
+ // We do not have enough free slots in total to accommodate the remaining managed stacks.
+ log(" Free: " + aInputBusSlotsFree + ", Required: " + aInputMap.size());
+ if (aParallelRecipes == 0) {
+ log("Failed to find enough space for all item outputs.");
+ return 0;
+ }
+ }
+ }
+
+ /*
+ * End Item Management
+ */
+
+ }
+
+ /* ========================================
+ * Fluid Management
+ * ========================================
+ */
+
+ if (aDoesOutputFluids) {
+ log("We have Fluids to output.");
+ // How many slots are free across all the output buses?
+ int aFluidHatches = 0;
+ int aEmptyFluidHatches = 0;
+ int aFullFluidHatches = 0;
+ // Create Map for Fluid Output
+ ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches =
+ new ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>();
+ for (final GT_MetaTileEntity_Hatch_Output tBus : this.mOutputHatches) {
+ if (!isValidMetaTileEntity(tBus)) {
+ continue;
+ }
+ aFluidHatches++;
+ // Map the Hatch with the space left for easy checking later.
+ if (tBus.getFluid() == null) {
+ aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(
+ tBus, null, tBus.getCapacity()));
+ } else {
+ int aSpaceLeft = tBus.getCapacity() - tBus.getFluidAmount();
+ aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(
+ tBus, tBus.getFluid(), aSpaceLeft));
+ }
+ }
+ // Create a map of all the fluids we would like to output, we can iterate over this and see how many we can
+ // merge into existing hatch stacks.
+ ArrayList<FluidStack> aOutputFluids = new ArrayList<FluidStack>();
+ // Ugly ass boxing
+ aOutputFluids.addAll(new AutoMap<FluidStack>(aFluidOutputs));
+ // Iterate the Hatches, updating their 'stored' data.
+ // for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aHatchData : aOutputHatches) {
+ for (int i = 0; i < aOutputHatches.size(); i++) {
+ // The Hatch Itself
+ GT_MetaTileEntity_Hatch_Output aHatch = aOutputHatches.get(i).getValue_1();
+ // Fluid in the Hatch
+ FluidStack aHatchStack = aOutputHatches.get(i).getValue_2();
+ // Fluid that the hatch is locked to
+ String aHatchLockedFluid = aOutputHatches.get(i).getValue_1().getLockedFluidName();
+ // Space left in Hatch
+ int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount();
+ // Hatch is full,
+ if (aSpaceLeftInHatch <= 0) {
+ aFullFluidHatches++;
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
+ continue;
+ }
+ // Hatch has space
+ else {
+ // Check if any fluids match
+ // aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) {
+ for (int j = 0; j < aOutputFluids.size(); j++) {
+ // log(" aHatchStack "+aHatchStack.getLocalizedName()+" aOutput stack
+ // "+aOutputStack.getLocalizedName());
+ if (GT_Utility.areFluidsEqual(aHatchStack, aOutputFluids.get(j))
+ && (aHatchLockedFluid == null
+ || aHatchLockedFluid.equals(
+ aOutputFluids.get(j).getFluid().getName()))) {
+ int aFluidToPutIntoHatch = aOutputFluids.get(j).amount * aParallelRecipes;
+ // Not Enough space to insert all of the fluid.
+ // We fill this hatch and add a smaller Fluidstack back to the iterator.
+ if (aSpaceLeftInHatch < aFluidToPutIntoHatch) {
+ // Copy existing Hatch Stack
+ FluidStack aNewHatchStack = aHatchStack.copy();
+ aNewHatchStack.amount = 0;
+ // Copy existing Hatch Stack again
+ FluidStack aNewOutputStack = aHatchStack.copy();
+ aNewOutputStack.amount = 0;
+ // How much fluid do we have left after we fill the hatch?
+ int aFluidLeftAfterInsert = aFluidToPutIntoHatch - aSpaceLeftInHatch;
+ // Set new stacks to appropriate values
+ aNewHatchStack.amount = aHatch.getCapacity();
+ aNewOutputStack.amount = aFluidLeftAfterInsert;
+ // Remove fluid from output list, merge success
+ aOutputFluids.remove(aOutputFluids.get(j));
+ j--;
+ // Remove hatch from hatch list, data is now invalid.
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
+ // Add remaining Fluid to Output list
+ aOutputFluids.add(aNewOutputStack);
+ // Re-add hatch to hatch list, with new data.
+ // Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new
+ // Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack,
+ // aNewHatchStack.amount);
+ // aOutputHatches.add(aNewHatchData);
+ break;
+ }
+ // We can fill this hatch perfectly (rare case), may as well add it directly to the full
+ // list.
+ else if (aSpaceLeftInHatch == aFluidToPutIntoHatch) {
+ // Copy Old Stack
+ FluidStack aNewHatchStack = aHatchStack.copy();
+ // Add in amount from output stack
+ aNewHatchStack.amount += aFluidToPutIntoHatch;
+ // Remove fluid from output list, merge success
+ aOutputFluids.remove(aOutputFluids.get(j));
+ j--;
+ // Remove hatch from hatch list, data is now invalid.
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
+ // Re-add hatch to hatch list, with new data.
+ Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData =
+ new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(
+ aHatch, aNewHatchStack, aNewHatchStack.amount);
+ aOutputHatches.add(aNewHatchData);
+ break;
+ }
+ // We have more space than we need to merge, so we remove the stack from the output list and
+ // update the hatch list.
+ else {
+ // Copy Old Stack
+ FluidStack aNewHatchStack = aHatchStack.copy();
+ // Add in amount from output stack
+ aNewHatchStack.amount += aFluidToPutIntoHatch;
+ // Remove fluid from output list, merge success
+ aOutputFluids.remove(aOutputFluids.get(j));
+ j--;
+ // Remove hatch from hatch list, data is now invalid.
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
+ // Re-add hatch to hatch list, with new data.
+ Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData =
+ new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(
+ aHatch, aNewHatchStack, aNewHatchStack.amount);
+ aOutputHatches.add(aNewHatchData);
+ // Check next fluid
+ continue;
+ }
+
+ } else if (aHatchLockedFluid == null
+ || aHatchLockedFluid.equals(
+ aOutputFluids.get(j).getFluid().getName())) {
+ aEmptyFluidHatches++;
+ } else {
+ continue;
+ }
+ }
+ }
+ }
+
+ for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aFreeHatchCheck : aOutputHatches) {
+ // Free Hatch
+ if ((aFreeHatchCheck.getValue_2() == null
+ || aFreeHatchCheck.getValue_3() == 0
+ || aFreeHatchCheck.getValue_1().getFluid() == null)
+ && !aFreeHatchCheck.getValue_1().isFluidLocked()) {
+ aEmptyFluidHatches++;
+ }
+ }
+
+ // We have Fluid Stacks we did not merge. Do we have space?
+ log("fluids to output " + aOutputFluids.size() + " empty hatches " + aEmptyFluidHatches);
+ if (aOutputFluids.size() > 0) {
+ // Not enough space to add fluids.
+ if (aOutputFluids.size() > aEmptyFluidHatches) {
+ aParallelRecipes =
+ (int) Math.floor((double) aEmptyFluidHatches / aOutputFluids.size() * aParallelRecipes);
+ log("Failed to find enough space for all fluid outputs. Free: " + aEmptyFluidHatches
+ + ", Required: " + aOutputFluids.size());
+ return 0;
+ }
+ }
+
+ /*
+ * End Fluid Management
+ */
+ }
+
+ return aParallelRecipes;
+ }
+
+ /**
+ * A Static {@link Method} object which holds the current status of logging.
+ */
+ public static Method aLogger = null;
+
+ public void log(String s) {
+ if (!AsmConfig.disableAllLogging) {
+ if (CORE_Preloader.DEBUG_MODE) {
+ Logger.INFO(s);
+ } else {
+ Logger.MACHINE_INFO(s);
+ }
+ }
+ }
+
+ public boolean checkRecipeGeneric() {
+ return checkRecipeGeneric(1, 100, 0);
+ }
+
+ public boolean checkRecipeGeneric(int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent) {
+ return checkRecipeGeneric(aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, 10000);
+ }
+
+ public boolean checkRecipeGeneric(
+ int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
+ FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
+ return checkRecipeGeneric(
+ tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll);
+ }
+
+ public boolean checkRecipeGeneric(
+ GT_Recipe aRecipe,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+ if (aRecipe == null) {
+ return false;
+ }
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
+ FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
+ return checkRecipeGeneric(
+ tItemInputs,
+ tFluidInputs,
+ aMaxParallelRecipes,
+ aEUPercent,
+ aSpeedBonusPercent,
+ aOutputChanceRoll,
+ aRecipe);
+ }
+
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+ return checkRecipeGeneric(
+ aItemInputs,
+ aFluidInputs,
+ aMaxParallelRecipes,
+ aEUPercent,
+ aSpeedBonusPercent,
+ aOutputChanceRoll,
+ null);
+ }
+
+ /*
+ * public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[]
+ * aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int
+ * aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on
+ * the Processing Array. A bit overkill, but very flexible.
+ *
+ *
+ * if (this.doesMachineBoostOutput()) { log("Boosting."); return
+ * checkRecipeBoostedOutputs(aItemInputs, aFluidInputs, aMaxParallelRecipes,
+ * aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe); }
+ *
+ *
+ * //Control Core to control the Multiblocks behaviour. int aControlCoreTier =
+ * getControlCoreTier();
+ *
+ * //If no core, return false; if (aControlCoreTier > 0) {
+ * log("Control core found."); }
+ *
+ *
+ * // Reset outputs and progress stats this.mEUt = 0; this.mMaxProgresstime = 0;
+ * this.mOutputItems = new ItemStack[]{}; this.mOutputFluids = new
+ * FluidStack[]{};
+ *
+ * long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1,
+ * GT_Utility.getTier(tVoltage)); log("Running checkRecipeGeneric(0)");
+ *
+ * //Check to see if Voltage Tier > Control Core Tier if (tTier >
+ * aControlCoreTier) {
+ * log("Control core found is lower tier than power tier. OK"); tTier = (byte)
+ * aControlCoreTier; }
+ *
+ * tTier = (byte) MathUtils.getValueWithinRange(tTier, 0, 9);
+ *
+ * GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe(
+ * getBaseMetaTileEntity(), mLastRecipe, false,
+ * gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
+ *
+ * log("Running checkRecipeGeneric(1)"); // Remember last recipe - an
+ * optimization for findRecipe() this.mLastRecipe = tRecipe;
+ *
+ * if (tRecipe == null) { log("BAD RETURN - 1"); return false; }
+ *
+ * if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
+ * log("BAD RETURN - 2"); return false; }
+ *
+ * // EU discount float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; float
+ * tTotalEUt = 0.0f;
+ *
+ * int parallelRecipes = 0;
+ *
+ * log("parallelRecipes: "+parallelRecipes);
+ * log("aMaxParallelRecipes: "+aMaxParallelRecipes);
+ * log("tTotalEUt: "+tTotalEUt); log("tVoltage: "+tVoltage);
+ * log("tRecipeEUt: "+tRecipeEUt); log("EU1: "+tRecipeEUt); // Count
+ * recipes to do in parallel, consuming input items and fluids and considering
+ * input voltage limits for (; parallelRecipes < aMaxParallelRecipes &&
+ * tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { if
+ * (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ * log("Broke at "+parallelRecipes+"."); break; }
+ * log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt
+ * += tRecipeEUt; log("EU2: "+tTotalEUt); }
+ *
+ * if (parallelRecipes == 0) { log("BAD RETURN - 3"); return false; }
+ *
+ * log("EU3: "+tTotalEUt);
+ *
+ * // -- Try not to fail after this point - inputs have already been consumed!
+ * --
+ *
+ *
+ * // Convert speed bonus to duration multiplier // e.g. 100% speed bonus = 200%
+ * speed = 100%/200% = 50% recipe duration. aSpeedBonusPercent = Math.max(-99,
+ * aSpeedBonusPercent); float tTimeFactor = 100.0f / (100.0f +
+ * aSpeedBonusPercent); this.mMaxProgresstime = (int)(tRecipe.mDuration *
+ * tTimeFactor * 10000);
+ *
+ * int aTempEu = (int) Math.floor(tTotalEUt); log("EU4: "+aTempEu);
+ * this.mEUt = (int) aTempEu;
+ *
+ *
+ * this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ * this.mEfficiencyIncrease = 10000;
+ *
+ * // Overclock if (this.mEUt <= 16) { this.mEUt = (this.mEUt * (1 << tTier - 1)
+ * * (1 << tTier - 1)); this.mMaxProgresstime = (this.mMaxProgresstime / (1 <<
+ * tTier - 1)); } else { while (this.mEUt <=
+ * gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4;
+ * this.mMaxProgresstime /= 2; } }
+ *
+ * if (this.mEUt > 0) { this.mEUt = (-this.mEUt); }
+ *
+ * this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ *
+ * // Collect fluid outputs FluidStack[] tOutputFluids = new
+ * FluidStack[tRecipe.mFluidOutputs.length]; for (int h = 0; h <
+ * tRecipe.mFluidOutputs.length; h++) { if (tRecipe.getFluidOutput(h) != null) {
+ * tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); tOutputFluids[h].amount
+ * *= parallelRecipes; } }
+ *
+ * // Collect output item types ItemStack[] tOutputItems = new
+ * ItemStack[tRecipe.mOutputs.length]; for (int h = 0; h <
+ * tRecipe.mOutputs.length; h++) { if (tRecipe.getOutput(h) != null) {
+ * tOutputItems[h] = tRecipe.getOutput(h).copy(); tOutputItems[h].stackSize = 0;
+ * } }
+ *
+ * // Set output item stack sizes (taking output chance into account) for (int f
+ * = 0; f < tOutputItems.length; f++) { if (tRecipe.mOutputs[f] != null &&
+ * tOutputItems[f] != null) { for (int g = 0; g < parallelRecipes; g++) { if
+ * (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) <
+ * tRecipe.getOutputChance(f)) tOutputItems[f].stackSize +=
+ * tRecipe.mOutputs[f].stackSize; } } }
+ *
+ * tOutputItems = removeNulls(tOutputItems);
+ *
+ * // Sanitize item stack size, splitting any stacks greater than max stack size
+ * List<ItemStack> splitStacks = new ArrayList<ItemStack>(); for (ItemStack
+ * tItem : tOutputItems) { while (tItem.getMaxStackSize() < tItem.stackSize) {
+ * ItemStack tmp = tItem.copy(); tmp.stackSize = tmp.getMaxStackSize();
+ * tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ * splitStacks.add(tmp); } }
+ *
+ * if (splitStacks.size() > 0) { ItemStack[] tmp = new
+ * ItemStack[splitStacks.size()]; tmp = splitStacks.toArray(tmp); tOutputItems =
+ * ArrayUtils.addAll(tOutputItems, tmp); }
+ *
+ * // Strip empty stacks List<ItemStack> tSList = new ArrayList<ItemStack>();
+ * for (ItemStack tS : tOutputItems) { if (tS.stackSize > 0) tSList.add(tS); }
+ * tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+ *
+ * // Commit outputs this.mOutputItems = tOutputItems; this.mOutputFluids =
+ * tOutputFluids; updateSlots();
+ *
+ * // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ * startProcess();
+ *
+ * log("GOOD RETURN - 1"); return true; }
+ */
+
+ public long getMaxInputEnergy() {
+ long rEnergy = 0;
+ if (mEnergyHatches.size()
+ == 1) // so it only takes 1 amp is only 1 hatch is present so it works like most gt multies
+ return mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage();
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
- if (isValidMetaTileEntity(tHatch)) rEnergy += tHatch.getBaseMetaTileEntity().getInputVoltage() * tHatch.getBaseMetaTileEntity().getInputAmperage();
+ if (isValidMetaTileEntity(tHatch))
+ rEnergy += tHatch.getBaseMetaTileEntity().getInputVoltage()
+ * tHatch.getBaseMetaTileEntity().getInputAmperage();
return rEnergy;
- }
-
- public boolean hasPerfectOverclock() {
- return false;
- }
-
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- GT_Recipe tRecipe = findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
-
-
- /*
- * Check for Special Behaviours
- */
-
- // First populate the map if we need to.
- if (mCustomBehviours.isEmpty()) {
- mCustomBehviours.putAll(Multiblock_API.getSpecialBehaviourItemMap());
- }
-
- // We have a special slot object in the recipe
- if (tRecipe.mSpecialItems != null) {
- // The special slot is an item
- if (tRecipe.mSpecialItems instanceof ItemStack) {
- // Make an Itemstack instance of this.
- ItemStack aSpecialStack = (ItemStack) tRecipe.mSpecialItems;
- // Check if this item is in an input bus.
- boolean aDidFindMatch = false;
- for (ItemStack aInputItemsToCheck : aItemInputs) {
- // If we find a matching stack, continue.
- if (GT_Utility.areStacksEqual(aSpecialStack, aInputItemsToCheck, false)) {
- // Iterate all special behaviour items, to see if we need to utilise one.
- aDidFindMatch = true;
- break;
- }
- }
- // Try prevent needless iteration loops if we don't have the required inputs at all.
- if (aDidFindMatch) {
- // Iterate all special behaviour items, to see if we need to utilise one.
- for (SpecialMultiBehaviour aBehaviours : mCustomBehviours.values()) {
- // Found a match, let's adjust this recipe now.
- if (aBehaviours.isTriggerItem(aSpecialStack)) {
- // Adjust this recipe to suit special item
- aMaxParallelRecipes = aBehaviours.getMaxParallelRecipes();
- aEUPercent = aBehaviours.getEUPercent();
- aSpeedBonusPercent = aBehaviours.getSpeedBonusPercent();
- aOutputChanceRoll = aBehaviours.getOutputChanceRoll();
- break;
- }
- }
- }
- }
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- if (hasPerfectOverclock()) {
- this.mMaxProgresstime /= 4;
- }
- else {
- this.mMaxProgresstime /= 2;
- }
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
- }
-
-
-
-
-
- /*
- * Here we handle recipe boosting, which grants additional output %'s to recipes that do not have 100%.
- */
-
- private boolean mHasBoostedCurrentRecipe = false;
- private GT_Recipe mBoostedRecipe = null;
- private ItemStack[] mInputVerificationForBoosting = null;
-
- /**
- * Does this machine boost it's output?
- * @return - if true, gives additional % to output chances.
- */
- protected boolean doesMachineBoostOutput() {
- return false;
- }
-
-
-
- private int boostOutput(int aAmount) {
- if (aAmount <= 0) {
- return 10000;
- }
- if (aAmount <= 250) {
- aAmount += MathUtils.randInt(Math.max(aAmount/2, 1), aAmount*2);
- }
- else if (aAmount <= 500) {
- aAmount += MathUtils.randInt(Math.max(aAmount/2, 1), aAmount*2);
- }
- else if (aAmount <= 750) {
- aAmount += MathUtils.randInt(Math.max(aAmount/2, 1), aAmount*2);
- }
- else if (aAmount <= 1000) {
- aAmount = (aAmount*2);
- }
- else if (aAmount <= 1500) {
- aAmount = (aAmount*2);
- }
- else if (aAmount <= 2000) {
- aAmount = (int) (aAmount*1.5);
- }
- else if (aAmount <= 3000) {
- aAmount = (int) (aAmount*1.5);
- }
- else if (aAmount <= 4000) {
- aAmount = (int) (aAmount*1.2);
- }
- else if (aAmount <= 5000) {
- aAmount = (int) (aAmount*1.2);
- }
- else if (aAmount <= 7000) {
- aAmount = (int) (aAmount*1.2);
- }
- else if (aAmount <= 9000) {
- aAmount = (int) (aAmount*1.1);
- }
- return Math.min(10000, aAmount);
- }
-
- public GT_Recipe generateAdditionalOutputForRecipe(GT_Recipe aRecipe) {
- AutoMap<Integer> aNewChances = new AutoMap<Integer>();
- for (int chance : aRecipe.mChances) {
- aNewChances.put(boostOutput(chance));
- }
- GT_Recipe aClone = aRecipe.copy();
- int[] aTemp = new int[aNewChances.size()];
- int slot = 0;
- for (int g : aNewChances) {
- aTemp[slot] = g;
- slot++;
- }
- aClone.mChances = aTemp;
- return aClone;
- }
-
-
- /**
- * Processes recipes but provides a bonus to the output % of items if they are < 100%.
- *
- * @param aItemInputs
- * @param aFluidInputs
- * @param aMaxParallelRecipes
- * @param aEUPercent
- * @param aSpeedBonusPercent
- * @param aOutputChanceRoll
- * @param aRecipe
- * @return
- */
- public boolean checkRecipeBoostedOutputs(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
- log("Running checkRecipeGeneric(1)");
-
- //First we check whether or not we have an input cached for boosting.
- //If not, we set it to the current recipe.
- //If we do, we compare it against the current recipe, if thy are the same, we try return a boosted recipe, if not, we boost a new recipe.
- boolean isRecipeInputTheSame = false;
-
- //No cached recipe inputs, assume first run.
- if (mInputVerificationForBoosting == null) {
- mInputVerificationForBoosting = tRecipe.mInputs;
- isRecipeInputTheSame = true;
- }
- //If the inputs match, we are good.
- else {
- if (tRecipe.mInputs == mInputVerificationForBoosting) {
- isRecipeInputTheSame = true;
- }
- else {
- isRecipeInputTheSame = false;
- }
- }
-
- //Inputs are the same, let's see if there's a boosted version.
- if (isRecipeInputTheSame) {
- //Yes, let's just set that as the recipe
- if (mHasBoostedCurrentRecipe && mBoostedRecipe != null) {
- tRecipe = mBoostedRecipe;
- }
- //We have yet to generate a new boosted recipe
- else {
- GT_Recipe aBoostedRecipe = this.generateAdditionalOutputForRecipe(tRecipe);
- if (aBoostedRecipe != null) {
- mBoostedRecipe = aBoostedRecipe;
- mHasBoostedCurrentRecipe = true;
- tRecipe = mBoostedRecipe;
- }
- //Bad boost
- else {
- mBoostedRecipe = null;
- mHasBoostedCurrentRecipe = false;
- }
- }
- }
- //We have changed inputs, so we should generate a new boosted recipe
- else {
- GT_Recipe aBoostedRecipe = this.generateAdditionalOutputForRecipe(tRecipe);
- if (aBoostedRecipe != null) {
- mBoostedRecipe = aBoostedRecipe;
- mHasBoostedCurrentRecipe = true;
- tRecipe = mBoostedRecipe;
- }
- //Bad boost
- else {
- mBoostedRecipe = null;
- mHasBoostedCurrentRecipe = false;
- }
- }
-
- //Bad modify, let's just use the original recipe.
- if (!mHasBoostedCurrentRecipe || mBoostedRecipe == null) {
- tRecipe = aRecipe != null ? aRecipe : findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
- }
-
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
+ }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
+ public boolean hasPerfectOverclock() {
+ return false;
+ }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
+ /*
+ * Check for Special Behaviours
+ */
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
+ // First populate the map if we need to.
+ if (mCustomBehviours.isEmpty()) {
+ mCustomBehviours.putAll(Multiblock_API.getSpecialBehaviourItemMap());
+ }
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
+ // We have a special slot object in the recipe
+ if (tRecipe.mSpecialItems != null) {
+ // The special slot is an item
+ if (tRecipe.mSpecialItems instanceof ItemStack) {
+ // Make an Itemstack instance of this.
+ ItemStack aSpecialStack = (ItemStack) tRecipe.mSpecialItems;
+ // Check if this item is in an input bus.
+ boolean aDidFindMatch = false;
+ for (ItemStack aInputItemsToCheck : aItemInputs) {
+ // If we find a matching stack, continue.
+ if (GT_Utility.areStacksEqual(aSpecialStack, aInputItemsToCheck, false)) {
+ // Iterate all special behaviour items, to see if we need to utilise one.
+ aDidFindMatch = true;
+ break;
+ }
+ }
+ // Try prevent needless iteration loops if we don't have the required inputs at all.
+ if (aDidFindMatch) {
+ // Iterate all special behaviour items, to see if we need to utilise one.
+ for (SpecialMultiBehaviour aBehaviours : mCustomBehviours.values()) {
+ // Found a match, let's adjust this recipe now.
+ if (aBehaviours.isTriggerItem(aSpecialStack)) {
+ // Adjust this recipe to suit special item
+ aMaxParallelRecipes = aBehaviours.getMaxParallelRecipes();
+ aEUPercent = aBehaviours.getEUPercent();
+ aSpeedBonusPercent = aBehaviours.getSpeedBonusPercent();
+ aOutputChanceRoll = aBehaviours.getOutputChanceRoll();
+ break;
+ }
+ }
+ }
+ }
+ }
- tOutputItems = removeNulls(tOutputItems);
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ log("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ if (hasPerfectOverclock()) {
+ this.mMaxProgresstime /= 4;
+ } else {
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ }
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- log("GOOD RETURN - 1");
- return true;
- }
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+ tOutputItems = removeNulls(tOutputItems);
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+ log("GOOD RETURN - 1");
+ return true;
+ }
+ /*
+ * Here we handle recipe boosting, which grants additional output %'s to recipes that do not have 100%.
+ */
+ private boolean mHasBoostedCurrentRecipe = false;
+ private GT_Recipe mBoostedRecipe = null;
+ private ItemStack[] mInputVerificationForBoosting = null;
+ /**
+ * Does this machine boost it's output?
+ * @return - if true, gives additional % to output chances.
+ */
+ protected boolean doesMachineBoostOutput() {
+ return false;
+ }
+ private int boostOutput(int aAmount) {
+ if (aAmount <= 0) {
+ return 10000;
+ }
+ if (aAmount <= 250) {
+ aAmount += MathUtils.randInt(Math.max(aAmount / 2, 1), aAmount * 2);
+ } else if (aAmount <= 500) {
+ aAmount += MathUtils.randInt(Math.max(aAmount / 2, 1), aAmount * 2);
+ } else if (aAmount <= 750) {
+ aAmount += MathUtils.randInt(Math.max(aAmount / 2, 1), aAmount * 2);
+ } else if (aAmount <= 1000) {
+ aAmount = (aAmount * 2);
+ } else if (aAmount <= 1500) {
+ aAmount = (aAmount * 2);
+ } else if (aAmount <= 2000) {
+ aAmount = (int) (aAmount * 1.5);
+ } else if (aAmount <= 3000) {
+ aAmount = (int) (aAmount * 1.5);
+ } else if (aAmount <= 4000) {
+ aAmount = (int) (aAmount * 1.2);
+ } else if (aAmount <= 5000) {
+ aAmount = (int) (aAmount * 1.2);
+ } else if (aAmount <= 7000) {
+ aAmount = (int) (aAmount * 1.2);
+ } else if (aAmount <= 9000) {
+ aAmount = (int) (aAmount * 1.1);
+ }
+ return Math.min(10000, aAmount);
+ }
+ public GT_Recipe generateAdditionalOutputForRecipe(GT_Recipe aRecipe) {
+ AutoMap<Integer> aNewChances = new AutoMap<Integer>();
+ for (int chance : aRecipe.mChances) {
+ aNewChances.put(boostOutput(chance));
+ }
+ GT_Recipe aClone = aRecipe.copy();
+ int[] aTemp = new int[aNewChances.size()];
+ int slot = 0;
+ for (int g : aNewChances) {
+ aTemp[slot] = g;
+ slot++;
+ }
+ aClone.mChances = aTemp;
+ return aClone;
+ }
+ /**
+ * Processes recipes but provides a bonus to the output % of items if they are < 100%.
+ *
+ * @param aItemInputs
+ * @param aFluidInputs
+ * @param aMaxParallelRecipes
+ * @param aEUPercent
+ * @param aSpeedBonusPercent
+ * @param aOutputChanceRoll
+ * @param aRecipe
+ * @return
+ */
+ public boolean checkRecipeBoostedOutputs(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = aRecipe != null
+ ? aRecipe
+ : findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+
+ log("Running checkRecipeGeneric(1)");
+
+ // First we check whether or not we have an input cached for boosting.
+ // If not, we set it to the current recipe.
+ // If we do, we compare it against the current recipe, if thy are the same, we try return a boosted recipe, if
+ // not, we boost a new recipe.
+ boolean isRecipeInputTheSame = false;
+
+ // No cached recipe inputs, assume first run.
+ if (mInputVerificationForBoosting == null) {
+ mInputVerificationForBoosting = tRecipe.mInputs;
+ isRecipeInputTheSame = true;
+ }
+ // If the inputs match, we are good.
+ else {
+ if (tRecipe.mInputs == mInputVerificationForBoosting) {
+ isRecipeInputTheSame = true;
+ } else {
+ isRecipeInputTheSame = false;
+ }
+ }
+ // Inputs are the same, let's see if there's a boosted version.
+ if (isRecipeInputTheSame) {
+ // Yes, let's just set that as the recipe
+ if (mHasBoostedCurrentRecipe && mBoostedRecipe != null) {
+ tRecipe = mBoostedRecipe;
+ }
+ // We have yet to generate a new boosted recipe
+ else {
+ GT_Recipe aBoostedRecipe = this.generateAdditionalOutputForRecipe(tRecipe);
+ if (aBoostedRecipe != null) {
+ mBoostedRecipe = aBoostedRecipe;
+ mHasBoostedCurrentRecipe = true;
+ tRecipe = mBoostedRecipe;
+ }
+ // Bad boost
+ else {
+ mBoostedRecipe = null;
+ mHasBoostedCurrentRecipe = false;
+ }
+ }
+ }
+ // We have changed inputs, so we should generate a new boosted recipe
+ else {
+ GT_Recipe aBoostedRecipe = this.generateAdditionalOutputForRecipe(tRecipe);
+ if (aBoostedRecipe != null) {
+ mBoostedRecipe = aBoostedRecipe;
+ mHasBoostedCurrentRecipe = true;
+ tRecipe = mBoostedRecipe;
+ }
+ // Bad boost
+ else {
+ mBoostedRecipe = null;
+ mHasBoostedCurrentRecipe = false;
+ }
+ }
+
+ // Bad modify, let's just use the original recipe.
+ if (!mHasBoostedCurrentRecipe || mBoostedRecipe == null) {
+ tRecipe = aRecipe != null
+ ? aRecipe
+ : findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+ }
+
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ log("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+ log("GOOD RETURN - 1");
+ return true;
+ }
+ public boolean isMachineRunning() {
+ boolean aRunning = this.getBaseMetaTileEntity().isActive();
+ // log("Queried Multiblock is currently running: "+aRunning);
+ return aRunning;
+ }
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ // Time Counter
+ if (aBaseMetaTileEntity.isServerSide()) {
+ this.mTotalRunTime++;
+ }
- public boolean isMachineRunning() {
- boolean aRunning = this.getBaseMetaTileEntity().isActive();
- //log("Queried Multiblock is currently running: "+aRunning);
- return aRunning;
- }
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
+ this.mChargeHatches.clear();
+ this.mDischargeHatches.clear();
+ this.mControlCoreBus.clear();
+ this.mAirIntakes.clear();
+ this.mTecTechEnergyHatches.clear();
+ this.mTecTechDynamoHatches.clear();
+ this.mAllEnergyHatches.clear();
+ this.mAllDynamoHatches.clear();
+ }
+ }
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity,
- final long aTick) {
-
- //Time Counter
- if (aBaseMetaTileEntity.isServerSide()){
- this.mTotalRunTime++;
- }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
- this.mChargeHatches.clear();
- this.mDischargeHatches.clear();
- this.mControlCoreBus.clear();
- this.mAirIntakes.clear();
- this.mTecTechEnergyHatches.clear();
- this.mTecTechDynamoHatches.clear();
- this.mAllEnergyHatches.clear();
- this.mAllDynamoHatches.clear();
- }
- }
+ @Override
+ public void explodeMultiblock() {
+ MetaTileEntity tTileEntity;
+ for (final Iterator<GT_MetaTileEntity_Hatch_InputBattery> localIterator = this.mChargeHatches.iterator();
+ localIterator.hasNext();
+ tTileEntity.getBaseMetaTileEntity().doExplosion(gregtech.api.enums.GT_Values.V[8])) {
+ tTileEntity = localIterator.next();
+ }
+ tTileEntity = null;
+ for (final Iterator<GT_MetaTileEntity_Hatch_OutputBattery> localIterator = this.mDischargeHatches.iterator();
+ localIterator.hasNext();
+ tTileEntity.getBaseMetaTileEntity().doExplosion(gregtech.api.enums.GT_Values.V[8])) {
+ tTileEntity = localIterator.next();
+ }
+ tTileEntity = null;
+ for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechDynamoHatches.iterator();
+ localIterator.hasNext();
+ tTileEntity.getBaseMetaTileEntity().doExplosion(gregtech.api.enums.GT_Values.V[8])) {
+ tTileEntity = localIterator.next();
+ }
+ tTileEntity = null;
+ for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechEnergyHatches.iterator();
+ localIterator.hasNext();
+ tTileEntity.getBaseMetaTileEntity().doExplosion(gregtech.api.enums.GT_Values.V[8])) {
+ tTileEntity = localIterator.next();
+ }
+ super.explodeMultiblock();
+ }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
+ protected int getGUICircuit(ItemStack[] t) {
+ Item g = CI.getNumberedCircuit(0).getItem();
+ ItemStack guiSlot = this.mInventory[1];
+ int mMode = -1;
+ if (guiSlot != null && guiSlot.getItem() == g) {
+ this.mInternalCircuit = true;
+ return guiSlot.getItemDamage();
+ } else {
+ this.mInternalCircuit = false;
+ }
- @Override
- public void explodeMultiblock() {
- MetaTileEntity tTileEntity;
- for (final Iterator<GT_MetaTileEntity_Hatch_InputBattery> localIterator = this.mChargeHatches
- .iterator(); localIterator.hasNext(); tTileEntity
- .getBaseMetaTileEntity()
- .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
- tTileEntity = localIterator.next();
- }
- tTileEntity = null;
- for (final Iterator<GT_MetaTileEntity_Hatch_OutputBattery> localIterator = this.mDischargeHatches
- .iterator(); localIterator.hasNext(); tTileEntity
- .getBaseMetaTileEntity()
- .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
- tTileEntity = localIterator.next();
- }
- tTileEntity = null;
- for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechDynamoHatches
- .iterator(); localIterator.hasNext(); tTileEntity
- .getBaseMetaTileEntity()
- .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
- tTileEntity = localIterator.next();
- }
- tTileEntity = null;
- for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechEnergyHatches
- .iterator(); localIterator.hasNext(); tTileEntity
- .getBaseMetaTileEntity()
- .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
- tTileEntity = localIterator.next();
- }
+ if (!this.mInternalCircuit) {
+ for (ItemStack j : t) {
+ if (j.getItem() == g) {
+ mMode = j.getItemDamage();
+ break;
+ }
+ }
+ }
+ return mMode;
+ }
+ protected ItemStack getGUIItemStack() {
+ ItemStack guiSlot = this.mInventory[1];
+ return guiSlot;
+ }
+
+ protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) {
+ boolean result = false;
+ if (this.mInventory[1] == null) {
+ this.mInventory[1] = aNewGuiSlotContents != null ? aNewGuiSlotContents.copy() : null;
+ this.depleteInput(aNewGuiSlotContents);
+ this.updateSlots();
+ result = true;
+ }
+ return result;
+ }
+ protected boolean clearGUIItemSlot() {
+ return setGUIItemStack(null);
+ }
- super.explodeMultiblock();
- }
+ public ItemStack findItemInInventory(Item aSearchStack) {
+ return findItemInInventory(aSearchStack, 0);
+ }
- protected int getGUICircuit(ItemStack[] t) {
- Item g = CI.getNumberedCircuit(0).getItem();
- ItemStack guiSlot = this.mInventory[1];
- int mMode = -1;
- if (guiSlot != null && guiSlot.getItem() == g) {
- this.mInternalCircuit = true;
- return guiSlot.getItemDamage();
- }
- else {
- this.mInternalCircuit = false;
- }
+ public ItemStack findItemInInventory(Item aSearchStack, int aMeta) {
+ return findItemInInventory(ItemUtils.simpleMetaStack(aSearchStack, aMeta, 1));
+ }
- if (!this.mInternalCircuit) {
- for (ItemStack j : t) {
- if (j.getItem() == g) {
- mMode = j.getItemDamage();
- break;
- }
- }
- }
- return mMode;
- }
-
- protected ItemStack getGUIItemStack() {
- ItemStack guiSlot = this.mInventory[1];
- return guiSlot;
- }
-
- protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) {
- boolean result = false;
- if (this.mInventory[1] == null) {
- this.mInventory[1] = aNewGuiSlotContents != null ? aNewGuiSlotContents.copy() : null;
- this.depleteInput(aNewGuiSlotContents);
- this.updateSlots();
- result = true;
- }
- return result;
- }
-
- protected boolean clearGUIItemSlot() {
- return setGUIItemStack(null);
- }
-
-
- public ItemStack findItemInInventory(Item aSearchStack) {
- return findItemInInventory(aSearchStack, 0);
- }
-
- public ItemStack findItemInInventory(Item aSearchStack, int aMeta) {
- return findItemInInventory(ItemUtils.simpleMetaStack(aSearchStack, aMeta, 1));
- }
-
- public ItemStack findItemInInventory(ItemStack aSearchStack) {
- if (aSearchStack != null && this.mInputBusses.size() > 0) {
- for (GT_MetaTileEntity_Hatch_InputBus bus : this.mInputBusses) {
- if (bus != null) {
- for (ItemStack uStack : bus.mInventory) {
- if (uStack != null) {
- if (aSearchStack.getClass().isInstance(uStack.getItem())) {
- return uStack;
- }
- }
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Deplete fluid input from a set of restricted hatches. This assumes these hatches can store nothing else but your
- * expected fluid
- */
- protected boolean depleteInputFromRestrictedHatches(Collection<GT_MetaTileEntity_Hatch_CustomFluidBase> aHatches, int aAmount) {
+ public ItemStack findItemInInventory(ItemStack aSearchStack) {
+ if (aSearchStack != null && this.mInputBusses.size() > 0) {
+ for (GT_MetaTileEntity_Hatch_InputBus bus : this.mInputBusses) {
+ if (bus != null) {
+ for (ItemStack uStack : bus.mInventory) {
+ if (uStack != null) {
+ if (aSearchStack.getClass().isInstance(uStack.getItem())) {
+ return uStack;
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Deplete fluid input from a set of restricted hatches. This assumes these hatches can store nothing else but your
+ * expected fluid
+ */
+ protected boolean depleteInputFromRestrictedHatches(
+ Collection<GT_MetaTileEntity_Hatch_CustomFluidBase> aHatches, int aAmount) {
for (final GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : aHatches) {
if (isValidMetaTileEntity(tHatch)) {
FluidStack tLiquid = tHatch.getFluid();
@@ -1634,1181 +1673,1254 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En
}
@Override
- public void updateSlots() {
- for (final GT_MetaTileEntity_Hatch_InputBattery tHatch : this.mChargeHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
- }
- }
- for (final GT_MetaTileEntity_Hatch_OutputBattery tHatch : this.mDischargeHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
- }
- }
- super.updateSlots();
- }
-
- public boolean isToolCreative(ItemStack mStack){
- Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(mStack);
- Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(mStack);
- if (t1 == Materials._NULL && t2 == Materials._NULL){
- return true;
- }
- return false;
- }
-
- /**
- * Causes a Random Maint. Issue.
- * @return {@link boolean} - Returns whether or not an issue was caused, should always be true.
- */
- public boolean causeMaintenanceIssue() {
- boolean b = false;
- switch (this.getBaseMetaTileEntity().getRandomNumber(6)) {
- case 0 : {
- this.mWrench = false;
- b = true;
- break;
- }
- case 1 : {
- this.mScrewdriver = false;
- b = true;
- break;
- }
- case 2 : {
- this.mSoftHammer = false;
- b = true;
- break;
- }
- case 3 : {
- this.mHardHammer = false;
- b = true;
- break;
- }
- case 4 : {
- this.mSolderingTool = false;
- b = true;
- break;
- }
- case 5 : {
- this.mCrowbar = false;
- b = true;
- break;
- }
- }
- return b;
- }
-
- public void fixAllMaintenanceIssue() {
- this.mCrowbar = true;
- this.mWrench = true;
- this.mHardHammer = true;
- this.mSoftHammer = true;
- this.mSolderingTool = true;
- this.mScrewdriver = true;
- }
-
- public boolean checkHatch() {
- return mMaintenanceHatches.size() <= 1 && (this.getPollutionPerSecond(null) > 0 ? !mMufflerHatches.isEmpty() : true);
- }
-
- public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- return addToMachineListInternal(aList, getMetaTileEntity(aTileEntity), aBaseCasingIndex);
- }
-
- public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
-
- //Check type
- /*
- * Class <?> aHatchType = ReflectionUtils.getTypeOfGenericObject(aList); if
- * (!aHatchType.isInstance(aTileEntity)) { return false; }
- */
-
- // Try setRecipeMap
-
- try {
- if (aTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- resetRecipeMapForHatch((GT_MetaTileEntity_Hatch) aTileEntity, getRecipeMap());
- }
- if (aTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- resetRecipeMapForHatch((GT_MetaTileEntity_Hatch) aTileEntity, getRecipeMap());
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
-
- if (aList.isEmpty()) {
- if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
- if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
- log("Adding " + aTileEntity.getInventoryName() + " at " + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString());
- }
- updateTexture(aTileEntity, aBaseCasingIndex);
- return aList.add((E) aTileEntity);
- }
- }
- else {
- IGregTechTileEntity aCur = aTileEntity.getBaseMetaTileEntity();
- if (aList.contains(aTileEntity)) {
- log("Found Duplicate "+aTileEntity.getInventoryName()+" @ " + new BlockPos(aCur).getLocationString());
- return false;
- }
- BlockPos aCurPos = new BlockPos(aCur);
- boolean aExists = false;
- for (E m : aList) {
- IGregTechTileEntity b = ((IMetaTileEntity) m).getBaseMetaTileEntity();
- if (b != null) {
- BlockPos aPos = new BlockPos(b);
- if (aPos != null) {
- if (aCurPos.equals(aPos)) {
- if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
- log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString());
- }
- return false;
- }
- }
- }
- }
- if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
- if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
- log("Adding " + aCur.getInventoryName() + " at " + aCurPos.getLocationString());
- }
- updateTexture(aTileEntity, aBaseCasingIndex);
- return aList.add((E) aTileEntity);
- }
- }
- return false;
- }
-
- public int getControlCoreTier() {
-
- //Always return best tier if config is off.
- /*boolean aCoresConfig = gtPlusPlus.core.lib.CORE.ConfigSwitches.requireControlCores;
- if (!aCoresConfig) {
- return 10;
- }*/
-
- if (mControlCoreBus.isEmpty()) {
- log("No Control Core Modules Found.");
- return 0;
- }
- GT_MetaTileEntity_Hatch_ControlCore i = getControlCoreBus();
- if (i != null) {
- ItemStack x = i.mInventory[0];
- if (x != null) {
- return x.getItemDamage();
- }
- }
- log("Control Core Module was null.");
- return 0;
- }
-
- public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() {
- if (this.mControlCoreBus == null || this.mControlCoreBus.isEmpty()) {
- return null;
- }
- GT_MetaTileEntity_Hatch_ControlCore x = this.mControlCoreBus.get(0);
- if (x != null) {
- log("getControlCore(ok)");
- return x;
- }
- log("getControlCore(bad)");
- return null;
- }
-
- //mControlCoreBus
- public boolean addControlCoreToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (!mControlCoreBus.isEmpty()) {
- log("Tried to add a secondary control core module.");
- return false;
- }
- GT_MetaTileEntity_Hatch_ControlCore Module = (GT_MetaTileEntity_Hatch_ControlCore) getMetaTileEntity(aTileEntity);
- if (Module != null) {
- if (Module.setOwner(aTileEntity)) {
- log("Adding control core module.");
- return addToMachineListInternal(mControlCoreBus, Module, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- private IMetaTileEntity getMetaTileEntity(final IGregTechTileEntity aTileEntity) {
- if (aTileEntity == null) {
- return null;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- return aMetaTileEntity;
- }
-
-
- @Override
- public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- return addToMachineList(getMetaTileEntity(aTileEntity), aBaseCasingIndex);
- }
-
- public boolean addToMachineList(final IMetaTileEntity aMetaTileEntity, final int aBaseCasingIndex) {
- if (aMetaTileEntity == null) {
- return false;
- }
-
- //Use this to determine the correct value, then update the hatch texture after.
- boolean aDidAdd = false;
-
- //Handle Custom Hatches
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ControlCore) {
- log("Found GT_MetaTileEntity_Hatch_ControlCore");
- if (!mControlCoreBus.isEmpty()) {
- log("Tried to add a secondary control core module.");
- return false;
- }
- aDidAdd = addToMachineListInternal(this.mControlCoreBus, aMetaTileEntity, aBaseCasingIndex);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) {
- log("Found GT_MetaTileEntity_Hatch_InputBattery");
- aDidAdd = addToMachineListInternal(mChargeHatches, aMetaTileEntity, aBaseCasingIndex);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBattery) {
- log("Found GT_MetaTileEntity_Hatch_OutputBattery");
- aDidAdd = addToMachineListInternal(mDischargeHatches, aMetaTileEntity, aBaseCasingIndex);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) {
- aDidAdd = addToMachineListInternal(mAirIntakes, aMetaTileEntity, aBaseCasingIndex) && addToMachineListInternal(mInputHatches, aMetaTileEntity, aBaseCasingIndex);
- }
-
- //Handle TT Multi-A Energy Hatches
- else if (LoadedMods.TecTech && isThisHatchMultiEnergy(aMetaTileEntity)) {
- log("Found isThisHatchMultiEnergy");
- aDidAdd = addToMachineListInternal(mTecTechEnergyHatches, aMetaTileEntity, aBaseCasingIndex);
- updateMasterEnergyHatchList(aMetaTileEntity);
- }
-
- //Handle TT Multi-A Dynamos
- else if (LoadedMods.TecTech && isThisHatchMultiDynamo(aMetaTileEntity)) {
- log("Found isThisHatchMultiDynamo");
- aDidAdd = addToMachineListInternal(mTecTechDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
- updateMasterDynamoHatchList(aMetaTileEntity);
- }
-
- //Handle Fluid Hatches using seperate logic
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)
- aDidAdd = addToMachineListInternal(mInputHatches, aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output)
- aDidAdd = addToMachineListInternal(mOutputHatches, aMetaTileEntity, aBaseCasingIndex);
-
- //Process Remaining hatches using Vanilla GT Logic
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus)
- aDidAdd = addToMachineListInternal(mInputBusses, aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus)
- aDidAdd = addToMachineListInternal(mOutputBusses, aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
- aDidAdd = addToMachineListInternal(mEnergyHatches, aMetaTileEntity, aBaseCasingIndex);
- updateMasterEnergyHatchList(aMetaTileEntity);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
- aDidAdd = addToMachineListInternal(mDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
- updateMasterDynamoHatchList(aMetaTileEntity);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance)
- aDidAdd = addToMachineListInternal(mMaintenanceHatches, aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler)
- aDidAdd = addToMachineListInternal(mMufflerHatches, aMetaTileEntity, aBaseCasingIndex);
-
- //return super.addToMachineList(aTileEntity, aBaseCasingIndex);
- return aDidAdd;
- }
-
-
-
- @Override
- public boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
- return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- @Override
- public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
- return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- @Override
- public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- @Override
- public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
- return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- public boolean addAirIntakeToMachineList(final IGregTechTileEntity aMetaTileEntity, final int aBaseCasingIndex) {
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) {
- return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- return addFluidInputToMachineList(getMetaTileEntity(aTileEntity), aBaseCasingIndex);
- }
-
- public boolean addFluidInputToMachineList(final IMetaTileEntity aMetaTileEntity, final int aBaseCasingIndex) {
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- public boolean clearRecipeMapForAllInputHatches() {
- return resetRecipeMapForAllInputHatches(null);
- }
-
- public boolean resetRecipeMapForAllInputHatches() {
- return resetRecipeMapForAllInputHatches(this.getRecipeMap());
- }
-
- public boolean resetRecipeMapForAllInputHatches(GT_Recipe_Map aMap) {
- int cleared = 0;
- for (GT_MetaTileEntity_Hatch_Input g : this.mInputHatches) {
- if (resetRecipeMapForHatch(g, aMap)) {
- cleared++;
- }
- }
- for (GT_MetaTileEntity_Hatch_InputBus g : this.mInputBusses) {
- if (resetRecipeMapForHatch(g, aMap)) {
- cleared++;
- }
- }
- return cleared > 0;
- }
- public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, GT_Recipe_Map aMap) {
- try {
- final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) {
- return resetRecipeMapForHatch((GT_MetaTileEntity_Hatch)aMetaTileEntity, aMap);
- }
- else {
- return false;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- return false;
- }
- }
-
- public boolean resetRecipeMapForHatch(GT_MetaTileEntity_Hatch aTileEntity, GT_Recipe_Map aMap) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity;
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) {
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input){
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = null;
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = aMap;
- if (aMap != null && aMap.mNEIName != null) {
- log("Remapped Input Hatch to "+aMap.mNEIName+".");
- }
- else {
- log("Cleared Input Hatch.");
- }
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = null;
- ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = aMap;
- if (aMap != null && aMap.mNEIName != null) {
- log("Remapped Input Bus to "+aMap.mNEIName+".");
- }
- else {
- log("Cleared Input Bus.");
- }
- }
- else {
- ((GT_MetaTileEntity_Hatch_Steam_BusInput) aMetaTileEntity).mRecipeMap = null;
- ((GT_MetaTileEntity_Hatch_Steam_BusInput) aMetaTileEntity).mRecipeMap = aMap;
- if (aMap != null && aMap.mNEIName != null) {
- log("Remapped Input Bus to "+aMap.mNEIName+".");
- }
- else {
- log("Cleared Input Bus.");
- }
- }
- return true;
- }
- else {
- return false;
- }
- }
-
- @Override
- public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- clearRecipeMapForAllInputHatches();
- onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ);
- resetRecipeMapForAllInputHatches();
- }
-
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
-
- }
-
-
-
-
-
- /**
- * Enable Texture Casing Support if found in GT 5.09
- */
-
- public boolean updateTexture(final IGregTechTileEntity aTileEntity, int aCasingID){
- return updateTexture(getMetaTileEntity(aTileEntity), aCasingID);
- }
-
- /**
- * Enable Texture Casing Support if found in GT 5.09
- */
-
- @SuppressWarnings("deprecation")
- public boolean updateTexture(final IMetaTileEntity aTileEntity, int aCasingID){
- try { //gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch.updateTexture(int)
-
- final IMetaTileEntity aMetaTileEntity = aTileEntity;
- if (aMetaTileEntity == null) {
- return false;
- }
- Method mProper = ReflectionUtils.getMethod(GT_MetaTileEntity_Hatch.class, "updateTexture", int.class);
- if (mProper != null){
- if (GT_MetaTileEntity_Hatch.class.isInstance(aMetaTileEntity)){
- mProper.setAccessible(true);
- mProper.invoke(aMetaTileEntity, aCasingID);
- //log("Good Method Call for updateTexture.");
- return true;
- }
- }
- else {
- log("Bad Method Call for updateTexture.");
- if (GT_MetaTileEntity_Hatch.class.isInstance(aMetaTileEntity)){
- if (aCasingID <= Byte.MAX_VALUE) {
- ((GT_MetaTileEntity_Hatch) aTileEntity).mMachineBlock = (byte) aCasingID;
- log("Good Method Call for updateTexture. Used fallback method of setting mMachineBlock as casing id was <= 128.");
- return true;
- }
- else {
- log("updateTexture returning false. 1.2");
- }
- }
- else {
- log("updateTexture returning false. 1.3");
- }
- }
- log("updateTexture returning false. 1");
- return false;
- }
- catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- log("updateTexture returning false.");
- log("updateTexture returning false. 2");
- e.printStackTrace();
- return false;
- }
-
- }
-
-
-
-
-
-
-
-
-
- /**
- * TecTech Support
- */
-
-
- /**
- * This is the array Used to Store the Tectech Multi-Amp Dynamo hatches.
- */
-
- public ArrayList<GT_MetaTileEntity_Hatch> mTecTechDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
-
- /**
- * This is the array Used to Store the Tectech Multi-Amp Energy hatches.
- */
-
- public ArrayList<GT_MetaTileEntity_Hatch> mTecTechEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
-
- /**
- * TecTech Multi-Amp Dynamo Support
- * @param aTileEntity - The Dynamo Hatch
- * @param aBaseCasingIndex - Casing Texture
- * @return
- */
-
- public boolean addMultiAmpDynamoToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex){
- final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
- if (aMetaTileEntity == null) {
- return false;
- }
- if (isThisHatchMultiDynamo(aTileEntity)) {
- return addToMachineListInternal(mTecTechDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- public boolean isThisHatchMultiDynamo(IGregTechTileEntity aTileEntity){
- return isThisHatchMultiDynamo(getMetaTileEntity(aTileEntity));
- }
-
- public boolean isThisHatchMultiDynamo(IMetaTileEntity aMetaTileEntity){
- Class<?> mDynamoClass;
- mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti");
- if (mDynamoClass != null){
- if (mDynamoClass.isInstance(aMetaTileEntity)){
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo || isThisHatchMultiDynamo(aMetaTileEntity)) {
- return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- private boolean updateMasterDynamoHatchList(IMetaTileEntity aMetaTileEntity) {
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) {
- GT_MetaTileEntity_Hatch aHatch = (GT_MetaTileEntity_Hatch) aMetaTileEntity;
- return mAllDynamoHatches.add(aHatch);
- }
- return false;
- }
-
-
- /**
- * TecTech Multi-Amp Energy Hatch Support
- * @param aTileEntity - The Energy Hatch
- * @param aBaseCasingIndex - Casing Texture
- * @return
- */
-
- public boolean addMultiAmpEnergyToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex){
- final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
- if (aMetaTileEntity == null) {
- return false;
- }
- if (isThisHatchMultiEnergy(aMetaTileEntity)) {
- return addToMachineListInternal(mTecTechEnergyHatches, aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- public boolean isThisHatchMultiEnergy(IGregTechTileEntity aTileEntity){
- return isThisHatchMultiEnergy(getMetaTileEntity(aTileEntity));
- }
-
- public boolean isThisHatchMultiEnergy(IMetaTileEntity aMetaTileEntity){
- Class<?> mDynamoClass;
- mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti");
- if (mDynamoClass != null){
- if (mDynamoClass.isInstance(aMetaTileEntity)){
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy || isThisHatchMultiEnergy(aMetaTileEntity)) {
- return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
- }
- return false;
- }
-
- private boolean updateMasterEnergyHatchList(IMetaTileEntity aMetaTileEntity) {
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) {
- GT_MetaTileEntity_Hatch aHatch = (GT_MetaTileEntity_Hatch) aMetaTileEntity;
- return mAllEnergyHatches.add(aHatch);
- }
- return false;
- }
-
-
- /**
- * Pollution Management
- */
-
- private static Method calculatePollutionReduction = null;
- public int calculatePollutionReductionForHatch(GT_MetaTileEntity_Hatch_Muffler i , int g) {
- if (calculatePollutionReduction != null) {
- try {
- return (int) calculatePollutionReduction.invoke(i, g);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-
- }
- }
- return 0;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setLong("mTotalRunTime", this.mTotalRunTime);
- aNBT.setBoolean("mVoidExcess", this.mVoidExcess);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- this.mTotalRunTime = aNBT.getLong("mTotalRunTime");
- this.mVoidExcess = aNBT.getBoolean("mVoidExcess");
- super.loadNBTData(aNBT);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- /**
- * Custom Find Recipe with Debugging
- */
-
-
- public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated,
- final boolean aDontCheckStackSizes, final long aVoltage, final FluidStack[] aFluids,
- final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids,
- (ItemStack) null, aInputs);
- }
-
- public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated,
- final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs);
- }
-
- public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
- final boolean aNotUnificated, final boolean aDontCheckStackSizes, final long aVoltage,
- final FluidStack[] aFluids, final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids,
- (ItemStack) null, aInputs);
- }
-
- public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
- final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids,
- final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs);
- }
-
- public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
- final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids,
- final ItemStack aSpecialSlot, final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, true, aVoltage, aFluids, aSpecialSlot,
- aInputs);
- }
-
- public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
- final boolean aNotUnificated, final boolean aDontCheckStackSizes, final long aVoltage,
- final FluidStack[] aFluids, final ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (this.getRecipeMap().mRecipeList.isEmpty()) {
- log("No Recipes in Map to search through.");
- return null;
- }
- GT_Recipe mRecipeResult = null;
- try {
- if (GregTech_API.sPostloadFinished) {
- if (this.getRecipeMap().mMinimalInputFluids > 0) {
- if (aFluids == null) {
- log("aFluids == null && minFluids > 0");
- return null;
- }
- int tAmount = 0;
- for (final FluidStack aFluid : aFluids) {
- if (aFluid != null) {
- ++tAmount;
- }
- }
- if (tAmount < this.getRecipeMap().mMinimalInputFluids) {
- log("Not enough fluids?");
- return null;
- }
- }
- if (this.getRecipeMap().mMinimalInputItems > 0) {
- if (aInputs == null) {
- log("No inputs and minItems > 0");
- return null;
- }
- int tAmount = 0;
- for (final ItemStack aInput : aInputs) {
- if (aInput != null) {
- ++tAmount;
- }
- }
- if (tAmount < this.getRecipeMap().mMinimalInputItems) {
- log("Not enough items?");
- return null;
- }
- }
- }
- else {
- log("Game Not Loaded properly for recipe lookup.");
- }
- if (aNotUnificated) {
- aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
- }
- if (aRecipe != null && !aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered
- && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- mRecipeResult = (aRecipe.mEnabled/* && aVoltage * this.getRecipeMap().mAmperage >= aRecipe.mEUt*/) ? aRecipe : null;
- log("x) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
- if (mRecipeResult != null) {
- return mRecipeResult;
- }
- }
- if (mRecipeResult == null && this.getRecipeMap().mUsualInputCount >= 0 && aInputs != null && aInputs.length > 0) {
- for (final ItemStack tStack : aInputs) {
- if (tStack != null) {
- Collection<GT_Recipe> tRecipes = this.getRecipeMap().mRecipeItemMap.get(new GT_ItemStack(tStack));
- if (tRecipes != null) {
- for (final GT_Recipe tRecipe : tRecipes) {
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- mRecipeResult = (tRecipe.mEnabled/* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
- ? tRecipe
- : null;
- log("1) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
- //return mRecipeResult;
- }
- }
- }
-
- //TODO - Investigate if this requires to be in it's own block
- tRecipes = this.getRecipeMap().mRecipeItemMap
- .get(new GT_ItemStack(GT_Utility.copyMetaData(32767L, new Object[]{tStack})));
- if (tRecipes != null) {
- for (final GT_Recipe tRecipe : tRecipes) {
- if (!tRecipe.mFakeRecipe
- && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- mRecipeResult = (tRecipe.mEnabled /*&& aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
- ? tRecipe
- : null;
- log("2) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
- //return mRecipeResult;
- }
- }
- }
- }
- }
- }
- if (mRecipeResult == null && this.getRecipeMap().mMinimalInputItems == 0 && aFluids != null && aFluids.length > 0) {
- for (final FluidStack aFluid2 : aFluids) {
- if (aFluid2 != null) {
- final Collection<GT_Recipe> tRecipes = this.getRecipeMap().mRecipeFluidMap.get(aFluid2.getFluid());
- if (tRecipes != null) {
- for (final GT_Recipe tRecipe : tRecipes) {
- if (!tRecipe.mFakeRecipe
- && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- mRecipeResult = (tRecipe.mEnabled/* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
- ? tRecipe
- : null;
- log("3) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
- //return mRecipeResult;
- }
- }
- }
- }
- }
- }
- }
- catch (Throwable t) {
- log("Invalid recipe lookup.");
- }
-
-
- if (mRecipeResult == null) {
- log("Invalid recipe, Fallback lookup. "+this.getRecipeMap().mRecipeList.size()+" | "+this.getRecipeMap().mNEIName);
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- try {
- return (GT_Recipe) findRecipe08.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- return null;
- }
- }
- else {
- try {
- return (GT_Recipe) findRecipe09.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- return null;
- }
- }
- }
- else {
- return mRecipeResult;
- }
-
-
-
-
- }
-
-
-
-
- /**
- * Custom Tool Handling
- */
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
- float aY, float aZ) {
- // Do Things
- if (this.getBaseMetaTileEntity().isServerSide()) {
- //Logger.INFO("Right Clicked Controller.");
- ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
- if (tCurrentItem != null) {
- //Logger.INFO("Holding Item.");
- if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) {
- //Logger.INFO("Is GT_MetaGenerated_Tool.");
- int[] aOreID = OreDictionary.getOreIDs(tCurrentItem);
- for (int id : aOreID) {
- // Plunger
- if (OreDictionary.getOreName(id).equals("craftingToolPlunger")) {
- //Logger.INFO("Is Plunger.");
- return onPlungerRightClick(aPlayer, aSide, aX, aY, aZ);
- }
- }
- }
- }
- }
- //Do Super
- boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
- return aSuper;
- }
-
- public boolean onPlungerRightClick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
- int aHatchIndex = 0;
- PlayerUtils.messagePlayer(aPlayer, "Trying to clear "+mOutputHatches.size()+" output hatches.");
- for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) {
- if (hatch.mFluid != null) {
- PlayerUtils.messagePlayer(aPlayer, "Clearing "+hatch.mFluid.amount+"L of "+hatch.mFluid.getLocalizedName()+" from hatch "+aHatchIndex+".");
- hatch.mFluid = null;
- }
- aHatchIndex++;
- }
- return aHatchIndex > 0;
- }
-
- @Override
- public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- boolean tSuper = super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
- if (aPlayer.isSneaking())
- return tSuper;
- mVoidExcess = !mVoidExcess;
- aPlayer.addChatMessage(new ChatComponentTranslation(mVoidExcess ? "interaction.voidexcess.enabled" : "interaction.voidexcess.disabled"));
- return true;
- }
-
- public boolean isValidBlockForStructure(IGregTechTileEntity aBaseMetaTileEntity, int aCasingID, boolean canBeHatch,
- Block aFoundBlock, int aFoundMeta, Block aExpectedBlock, int aExpectedMeta) {
- boolean isHatch = false;
- if (aBaseMetaTileEntity != null) {
-
- // Unsure why this check exists?
- /*if (aCasingID < 64) {
- aCasingID = TAE.GTPP_INDEX(aCasingID);
- }*/
-
- isHatch = this.addToMachineList(aBaseMetaTileEntity, aCasingID);
- if (isHatch) {
- return true;
- }
- else {
- int aMetaTileID = aBaseMetaTileEntity.getMetaTileID();
- //Found a controller
- if (aMetaTileID >= 750 && aMetaTileID < 1000 && aFoundBlock == GregTech_API.sBlockMachines) {
- return true;
- }
- //Vanilla Hatches/Busses
- else if (aMetaTileID >= 10 && aMetaTileID <= 99 && aFoundBlock == GregTech_API.sBlockMachines) {
- return true;
- }
- //Adv Mufflers
- else if (aMetaTileID >= 30001 && aMetaTileID <= 30009 && aFoundBlock == GregTech_API.sBlockMachines) {
- return true;
- }
- //Control Core, Super IO
- else if (aMetaTileID >= 30020 && aMetaTileID <= 30040 && aFoundBlock == GregTech_API.sBlockMachines) {
- return true;
- }
- //Auto maint
- else if (aMetaTileID == 111 && aFoundBlock == GregTech_API.sBlockMachines) {
- return true;
- }
- //Data Ports
- else if ((aMetaTileID == 131 || aMetaTileID == 132) && aFoundBlock == GregTech_API.sBlockMachines) {
- return true;
- }
- else {
- log("Found meta Tile: "+aMetaTileID);
- }
- }
- }
- if (!isHatch) {
- if (aFoundBlock == aExpectedBlock && aFoundMeta == aExpectedMeta) {
- return true;
- }
- else if (aFoundBlock != aExpectedBlock) {
- if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
- log("A1 - Found: "+aFoundBlock.getLocalizedName()+":"+aFoundMeta+", Expected: "+aExpectedBlock.getLocalizedName()+":"+aExpectedMeta);
- //log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString()));
- }
- return false;
- }
- else if (aFoundMeta != aExpectedMeta) {
- log("A2");
- return false;
- }
-
- }
- log("A3");
- return false;
- }
-
- @Override
- public void onServerStart() {
- super.onServerStart();
- tryTickWaitTimerDown();
- }
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- super.onFirstTick(aBaseMetaTileEntity);
- tryTickWaitTimerDown();
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- tryTickWaitTimerDown();
- }
-
- @Override
- public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- super.onCreated(aStack, aWorld, aPlayer);
- tryTickWaitTimerDown();
- }
-
- private final void tryTickWaitTimerDown() {
- /*if (mStartUpCheck > 10) {
- mStartUpCheck = 10;
- }*/
- }
-
- //Only support to use meta to tier
-
- /**
- * accept meta [0, maxMeta)
- * @param maxMeta exclusive
- */
- public static <T> IStructureElement<T> addTieredBlock(Block aBlock, BiConsumer<T, Integer> aSetTheFuckingMeta, Function<T, Integer> aGetTheFuckingMeta, int maxMeta) {
- return addTieredBlock(aBlock, (t, i) -> {
- aSetTheFuckingMeta.accept(t, i);
- return true;
- }, aGetTheFuckingMeta, 0, maxMeta
- );
- }
-
- /**
- *
- * @param minMeta inclusive
- * @param maxMeta exclusive
- */
- public static <T> IStructureElement<T> addTieredBlock(Block aBlock, BiConsumer<T, Integer> aSetTheFuckingMeta, Function<T, Integer> aGetTheFuckingMeta, int minMeta, int maxMeta) {
- return addTieredBlock(aBlock, (t, i) -> {
- aSetTheFuckingMeta.accept(t, i);
- return true;
- }, aGetTheFuckingMeta, minMeta, maxMeta
- );
- }
-
- /**
- *
- * @param minMeta inclusive
- * @param maxMeta exclusive
- */
- public static <T> IStructureElement<T> addTieredBlock(Block aBlock, BiPredicate<T, Integer> aSetTheFuckingMeta, Function<T, Integer> aGetTheFuckingMeta, int minMeta, int maxMeta) {
-
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block tBlock = world.getBlock(x, y, z);
- if (aBlock == tBlock) {
- Integer currentMeta = aGetTheFuckingMeta.apply(t);
- int newMeta = tBlock.getDamageValue(world, x, y, z) + 1;
- if (newMeta > maxMeta || newMeta < minMeta + 1) return false;
- if (currentMeta == 0) {
- return aSetTheFuckingMeta.test(t, newMeta);
- } else {
- return currentMeta == newMeta;
- }
- }
- return false;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- StructureLibAPI.hintParticle(world, x, y, z, aBlock, getMeta(trigger));
- return true;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return world.setBlock(x, y, z, aBlock, getMeta(trigger), 3);
- }
-
- private int getMeta(ItemStack trigger) {
- int meta = trigger.stackSize;
- if (meta <= 0) meta = minMeta;
- if (meta + minMeta >= maxMeta) meta = maxMeta - 1 - minMeta;
- return meta + minMeta;
- }
-
- @Override
- public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
- if (world.getBlock(x, y, z) == aBlock) {
- if (world.getBlockMetadata(x, y, z) == getMeta(trigger)) {
- return PlaceResult.SKIP;
- }
- return PlaceResult.REJECT;
- }
- return StructureUtility.survivalPlaceBlock(aBlock, getMeta(trigger), world, x, y, z, s, actor, chatter);
- }
- };
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing) {
- if (aActive)
- return new ITexture[]{getCasingTexture(),
- TextureFactory.builder().addIcon(getActiveOverlay()).extFacing().build()};
- return new ITexture[]{getCasingTexture(),
- TextureFactory.builder().addIcon(getInactiveOverlay()).extFacing().build()};
- }
- return new ITexture[]{getCasingTexture()};
- }
-
- protected IIconContainer getActiveOverlay() {
- return null;
- }
-
- protected IIconContainer getInactiveOverlay() {
- return null;
- }
-
- protected ITexture getCasingTexture() {
- return Textures.BlockIcons.getCasingTextureForId(getCasingTextureId());
- }
-
- protected int getCasingTextureId() {
- return 0;
- }
-
- public enum GTPPHatchElement implements IHatchElement<GregtechMeta_MultiBlockBase<?>> {
- AirIntake(GregtechMeta_MultiBlockBase::addAirIntakeToMachineList, GT_MetaTileEntity_Hatch_AirIntake.class) {
- @Override
- public long count(GregtechMeta_MultiBlockBase<?> t) {
- return t.mAirIntakes.size();
- }
- },
- ControlCore(GregtechMeta_MultiBlockBase::addControlCoreToMachineList, GT_MetaTileEntity_Hatch_ControlCore.class) {
- @Override
- public long count(GregtechMeta_MultiBlockBase<?> t) {
- return t.mControlCoreBus.size();
- }
- },
- TTDynamo(GregtechMeta_MultiBlockBase::addMultiAmpDynamoToMachineList, "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti") {
- @Override
- public long count(GregtechMeta_MultiBlockBase<?> t) {
- return t.mTecTechDynamoHatches.size();
- }
- },
- TTEnergy(GregtechMeta_MultiBlockBase::addMultiAmpEnergyToMachineList, "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti") {
- @Override
- public long count(GregtechMeta_MultiBlockBase<?> t) {
- return t.mTecTechEnergyHatches.size();
- }
- },
- ;
-
- @SuppressWarnings("unchecked")
- private static <T> Class<T> retype(Class<?> clazz) {
- return (Class<T>) clazz;
- }
-
- private final List<? extends Class<? extends IMetaTileEntity>> mMteClasses;
- private final IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> mAdder;
-
- @SafeVarargs
- GTPPHatchElement(IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> aAdder, Class<? extends IMetaTileEntity>... aMteClasses) {
- this.mMteClasses = Arrays.asList(aMteClasses);
- this.mAdder = aAdder;
- }
-
- GTPPHatchElement(IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> aAdder, String... aClassNames) {
- this.mMteClasses = Arrays.stream(aClassNames)
- .map(ReflectionUtils::getClass)
- .filter(Objects::nonNull)
- .<Class<? extends IMetaTileEntity>>map(GTPPHatchElement::retype)
- .collect(Collectors.toList());
- this.mAdder = aAdder;
- }
-
- @Override
- public List<? extends Class<? extends IMetaTileEntity>> mteClasses() {
- return mMteClasses;
- }
-
- @Override
- public IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> adder() {
- return mAdder;
- }
- }
+ public void updateSlots() {
+ for (final GT_MetaTileEntity_Hatch_InputBattery tHatch : this.mChargeHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ tHatch.updateSlots();
+ }
+ }
+ for (final GT_MetaTileEntity_Hatch_OutputBattery tHatch : this.mDischargeHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ tHatch.updateSlots();
+ }
+ }
+ super.updateSlots();
+ }
+
+ public boolean isToolCreative(ItemStack mStack) {
+ Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(mStack);
+ Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(mStack);
+ if (t1 == Materials._NULL && t2 == Materials._NULL) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Causes a Random Maint. Issue.
+ * @return {@link boolean} - Returns whether or not an issue was caused, should always be true.
+ */
+ public boolean causeMaintenanceIssue() {
+ boolean b = false;
+ switch (this.getBaseMetaTileEntity().getRandomNumber(6)) {
+ case 0: {
+ this.mWrench = false;
+ b = true;
+ break;
+ }
+ case 1: {
+ this.mScrewdriver = false;
+ b = true;
+ break;
+ }
+ case 2: {
+ this.mSoftHammer = false;
+ b = true;
+ break;
+ }
+ case 3: {
+ this.mHardHammer = false;
+ b = true;
+ break;
+ }
+ case 4: {
+ this.mSolderingTool = false;
+ b = true;
+ break;
+ }
+ case 5: {
+ this.mCrowbar = false;
+ b = true;
+ break;
+ }
+ }
+ return b;
+ }
+
+ public void fixAllMaintenanceIssue() {
+ this.mCrowbar = true;
+ this.mWrench = true;
+ this.mHardHammer = true;
+ this.mSoftHammer = true;
+ this.mSolderingTool = true;
+ this.mScrewdriver = true;
+ }
+
+ public boolean checkHatch() {
+ return mMaintenanceHatches.size() <= 1
+ && (this.getPollutionPerSecond(null) > 0 ? !mMufflerHatches.isEmpty() : true);
+ }
+
+ public <E> boolean addToMachineListInternal(
+ ArrayList<E> aList, final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ return addToMachineListInternal(aList, getMetaTileEntity(aTileEntity), aBaseCasingIndex);
+ }
+
+ public <E> boolean addToMachineListInternal(
+ ArrayList<E> aList, final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+
+ // Check type
+ /*
+ * Class <?> aHatchType = ReflectionUtils.getTypeOfGenericObject(aList); if
+ * (!aHatchType.isInstance(aTileEntity)) { return false; }
+ */
+
+ // Try setRecipeMap
+
+ try {
+ if (aTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ resetRecipeMapForHatch((GT_MetaTileEntity_Hatch) aTileEntity, getRecipeMap());
+ }
+ if (aTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ resetRecipeMapForHatch((GT_MetaTileEntity_Hatch) aTileEntity, getRecipeMap());
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+
+ if (aList.isEmpty()) {
+ if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("Adding " + aTileEntity.getInventoryName() + " at "
+ + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString());
+ }
+ updateTexture(aTileEntity, aBaseCasingIndex);
+ return aList.add((E) aTileEntity);
+ }
+ } else {
+ IGregTechTileEntity aCur = aTileEntity.getBaseMetaTileEntity();
+ if (aList.contains(aTileEntity)) {
+ log("Found Duplicate " + aTileEntity.getInventoryName() + " @ "
+ + new BlockPos(aCur).getLocationString());
+ return false;
+ }
+ BlockPos aCurPos = new BlockPos(aCur);
+ boolean aExists = false;
+ for (E m : aList) {
+ IGregTechTileEntity b = ((IMetaTileEntity) m).getBaseMetaTileEntity();
+ if (b != null) {
+ BlockPos aPos = new BlockPos(b);
+ if (aPos != null) {
+ if (aCurPos.equals(aPos)) {
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("Found Duplicate " + b.getInventoryName() + " at " + aPos.getLocationString());
+ }
+ return false;
+ }
+ }
+ }
+ }
+ if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("Adding " + aCur.getInventoryName() + " at " + aCurPos.getLocationString());
+ }
+ updateTexture(aTileEntity, aBaseCasingIndex);
+ return aList.add((E) aTileEntity);
+ }
+ }
+ return false;
+ }
+
+ public int getControlCoreTier() {
+
+ // Always return best tier if config is off.
+ /*boolean aCoresConfig = gtPlusPlus.core.lib.CORE.ConfigSwitches.requireControlCores;
+ if (!aCoresConfig) {
+ return 10;
+ }*/
+
+ if (mControlCoreBus.isEmpty()) {
+ log("No Control Core Modules Found.");
+ return 0;
+ }
+ GT_MetaTileEntity_Hatch_ControlCore i = getControlCoreBus();
+ if (i != null) {
+ ItemStack x = i.mInventory[0];
+ if (x != null) {
+ return x.getItemDamage();
+ }
+ }
+ log("Control Core Module was null.");
+ return 0;
+ }
+
+ public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() {
+ if (this.mControlCoreBus == null || this.mControlCoreBus.isEmpty()) {
+ return null;
+ }
+ GT_MetaTileEntity_Hatch_ControlCore x = this.mControlCoreBus.get(0);
+ if (x != null) {
+ log("getControlCore(ok)");
+ return x;
+ }
+ log("getControlCore(bad)");
+ return null;
+ }
+
+ // mControlCoreBus
+ public boolean addControlCoreToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (!mControlCoreBus.isEmpty()) {
+ log("Tried to add a secondary control core module.");
+ return false;
+ }
+ GT_MetaTileEntity_Hatch_ControlCore Module =
+ (GT_MetaTileEntity_Hatch_ControlCore) getMetaTileEntity(aTileEntity);
+ if (Module != null) {
+ if (Module.setOwner(aTileEntity)) {
+ log("Adding control core module.");
+ return addToMachineListInternal(mControlCoreBus, Module, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ private IMetaTileEntity getMetaTileEntity(final IGregTechTileEntity aTileEntity) {
+ if (aTileEntity == null) {
+ return null;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ return aMetaTileEntity;
+ }
+
+ @Override
+ public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ return addToMachineList(getMetaTileEntity(aTileEntity), aBaseCasingIndex);
+ }
+
+ public boolean addToMachineList(final IMetaTileEntity aMetaTileEntity, final int aBaseCasingIndex) {
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+
+ // Use this to determine the correct value, then update the hatch texture after.
+ boolean aDidAdd = false;
+
+ // Handle Custom Hatches
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ControlCore) {
+ log("Found GT_MetaTileEntity_Hatch_ControlCore");
+ if (!mControlCoreBus.isEmpty()) {
+ log("Tried to add a secondary control core module.");
+ return false;
+ }
+ aDidAdd = addToMachineListInternal(this.mControlCoreBus, aMetaTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) {
+ log("Found GT_MetaTileEntity_Hatch_InputBattery");
+ aDidAdd = addToMachineListInternal(mChargeHatches, aMetaTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBattery) {
+ log("Found GT_MetaTileEntity_Hatch_OutputBattery");
+ aDidAdd = addToMachineListInternal(mDischargeHatches, aMetaTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) {
+ aDidAdd = addToMachineListInternal(mAirIntakes, aMetaTileEntity, aBaseCasingIndex)
+ && addToMachineListInternal(mInputHatches, aMetaTileEntity, aBaseCasingIndex);
+ }
+
+ // Handle TT Multi-A Energy Hatches
+ else if (LoadedMods.TecTech && isThisHatchMultiEnergy(aMetaTileEntity)) {
+ log("Found isThisHatchMultiEnergy");
+ aDidAdd = addToMachineListInternal(mTecTechEnergyHatches, aMetaTileEntity, aBaseCasingIndex);
+ updateMasterEnergyHatchList(aMetaTileEntity);
+ }
+
+ // Handle TT Multi-A Dynamos
+ else if (LoadedMods.TecTech && isThisHatchMultiDynamo(aMetaTileEntity)) {
+ log("Found isThisHatchMultiDynamo");
+ aDidAdd = addToMachineListInternal(mTecTechDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
+ updateMasterDynamoHatchList(aMetaTileEntity);
+ }
+
+ // Handle Fluid Hatches using seperate logic
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)
+ aDidAdd = addToMachineListInternal(mInputHatches, aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output)
+ aDidAdd = addToMachineListInternal(mOutputHatches, aMetaTileEntity, aBaseCasingIndex);
+
+ // Process Remaining hatches using Vanilla GT Logic
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus)
+ aDidAdd = addToMachineListInternal(mInputBusses, aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus)
+ aDidAdd = addToMachineListInternal(mOutputBusses, aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ aDidAdd = addToMachineListInternal(mEnergyHatches, aMetaTileEntity, aBaseCasingIndex);
+ updateMasterEnergyHatchList(aMetaTileEntity);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ aDidAdd = addToMachineListInternal(mDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
+ updateMasterDynamoHatchList(aMetaTileEntity);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance)
+ aDidAdd = addToMachineListInternal(mMaintenanceHatches, aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler)
+ aDidAdd = addToMachineListInternal(mMufflerHatches, aMetaTileEntity, aBaseCasingIndex);
+
+ // return super.addToMachineList(aTileEntity, aBaseCasingIndex);
+ return aDidAdd;
+ }
+
+ @Override
+ public boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input
+ || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output
+ || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ public boolean addAirIntakeToMachineList(final IGregTechTileEntity aMetaTileEntity, final int aBaseCasingIndex) {
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) {
+ return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ return addFluidInputToMachineList(getMetaTileEntity(aTileEntity), aBaseCasingIndex);
+ }
+
+ public boolean addFluidInputToMachineList(final IMetaTileEntity aMetaTileEntity, final int aBaseCasingIndex) {
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ public boolean clearRecipeMapForAllInputHatches() {
+ return resetRecipeMapForAllInputHatches(null);
+ }
+
+ public boolean resetRecipeMapForAllInputHatches() {
+ return resetRecipeMapForAllInputHatches(this.getRecipeMap());
+ }
+
+ public boolean resetRecipeMapForAllInputHatches(GT_Recipe_Map aMap) {
+ int cleared = 0;
+ for (GT_MetaTileEntity_Hatch_Input g : this.mInputHatches) {
+ if (resetRecipeMapForHatch(g, aMap)) {
+ cleared++;
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_InputBus g : this.mInputBusses) {
+ if (resetRecipeMapForHatch(g, aMap)) {
+ cleared++;
+ }
+ }
+ return cleared > 0;
+ }
+
+ public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, GT_Recipe_Map aMap) {
+ try {
+ final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input
+ || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus
+ || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) {
+ return resetRecipeMapForHatch((GT_MetaTileEntity_Hatch) aMetaTileEntity, aMap);
+ } else {
+ return false;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return false;
+ }
+ }
+
+ public boolean resetRecipeMapForHatch(GT_MetaTileEntity_Hatch aTileEntity, GT_Recipe_Map aMap) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input
+ || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus
+ || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) {
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = null;
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = aMap;
+ if (aMap != null && aMap.mNEIName != null) {
+ log("Remapped Input Hatch to " + aMap.mNEIName + ".");
+ } else {
+ log("Cleared Input Hatch.");
+ }
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = null;
+ ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = aMap;
+ if (aMap != null && aMap.mNEIName != null) {
+ log("Remapped Input Bus to " + aMap.mNEIName + ".");
+ } else {
+ log("Cleared Input Bus.");
+ }
+ } else {
+ ((GT_MetaTileEntity_Hatch_Steam_BusInput) aMetaTileEntity).mRecipeMap = null;
+ ((GT_MetaTileEntity_Hatch_Steam_BusInput) aMetaTileEntity).mRecipeMap = aMap;
+ if (aMap != null && aMap.mNEIName != null) {
+ log("Remapped Input Bus to " + aMap.mNEIName + ".");
+ } else {
+ log("Cleared Input Bus.");
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ clearRecipeMapForAllInputHatches();
+ onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ);
+ resetRecipeMapForAllInputHatches();
+ }
+
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {}
+
+ /**
+ * Enable Texture Casing Support if found in GT 5.09
+ */
+ public boolean updateTexture(final IGregTechTileEntity aTileEntity, int aCasingID) {
+ return updateTexture(getMetaTileEntity(aTileEntity), aCasingID);
+ }
+
+ /**
+ * Enable Texture Casing Support if found in GT 5.09
+ */
+ @SuppressWarnings("deprecation")
+ public boolean updateTexture(final IMetaTileEntity aTileEntity, int aCasingID) {
+ try { // gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch.updateTexture(int)
+
+ final IMetaTileEntity aMetaTileEntity = aTileEntity;
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ Method mProper = ReflectionUtils.getMethod(GT_MetaTileEntity_Hatch.class, "updateTexture", int.class);
+ if (mProper != null) {
+ if (GT_MetaTileEntity_Hatch.class.isInstance(aMetaTileEntity)) {
+ mProper.setAccessible(true);
+ mProper.invoke(aMetaTileEntity, aCasingID);
+ // log("Good Method Call for updateTexture.");
+ return true;
+ }
+ } else {
+ log("Bad Method Call for updateTexture.");
+ if (GT_MetaTileEntity_Hatch.class.isInstance(aMetaTileEntity)) {
+ if (aCasingID <= Byte.MAX_VALUE) {
+ ((GT_MetaTileEntity_Hatch) aTileEntity).mMachineBlock = (byte) aCasingID;
+ log(
+ "Good Method Call for updateTexture. Used fallback method of setting mMachineBlock as casing id was <= 128.");
+ return true;
+ } else {
+ log("updateTexture returning false. 1.2");
+ }
+ } else {
+ log("updateTexture returning false. 1.3");
+ }
+ }
+ log("updateTexture returning false. 1");
+ return false;
+ } catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ log("updateTexture returning false.");
+ log("updateTexture returning false. 2");
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * TecTech Support
+ */
+
+ /**
+ * This is the array Used to Store the Tectech Multi-Amp Dynamo hatches.
+ */
+ public ArrayList<GT_MetaTileEntity_Hatch> mTecTechDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
+
+ /**
+ * This is the array Used to Store the Tectech Multi-Amp Energy hatches.
+ */
+ public ArrayList<GT_MetaTileEntity_Hatch> mTecTechEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
+
+ /**
+ * TecTech Multi-Amp Dynamo Support
+ * @param aTileEntity - The Dynamo Hatch
+ * @param aBaseCasingIndex - Casing Texture
+ * @return
+ */
+ public boolean addMultiAmpDynamoToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (isThisHatchMultiDynamo(aTileEntity)) {
+ return addToMachineListInternal(mTecTechDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ public boolean isThisHatchMultiDynamo(IGregTechTileEntity aTileEntity) {
+ return isThisHatchMultiDynamo(getMetaTileEntity(aTileEntity));
+ }
+
+ public boolean isThisHatchMultiDynamo(IMetaTileEntity aMetaTileEntity) {
+ Class<?> mDynamoClass;
+ mDynamoClass = ReflectionUtils.getClass(
+ "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti");
+ if (mDynamoClass != null) {
+ if (mDynamoClass.isInstance(aMetaTileEntity)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo || isThisHatchMultiDynamo(aMetaTileEntity)) {
+ return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ private boolean updateMasterDynamoHatchList(IMetaTileEntity aMetaTileEntity) {
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) {
+ GT_MetaTileEntity_Hatch aHatch = (GT_MetaTileEntity_Hatch) aMetaTileEntity;
+ return mAllDynamoHatches.add(aHatch);
+ }
+ return false;
+ }
+
+ /**
+ * TecTech Multi-Amp Energy Hatch Support
+ * @param aTileEntity - The Energy Hatch
+ * @param aBaseCasingIndex - Casing Texture
+ * @return
+ */
+ public boolean addMultiAmpEnergyToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (isThisHatchMultiEnergy(aMetaTileEntity)) {
+ return addToMachineListInternal(mTecTechEnergyHatches, aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ public boolean isThisHatchMultiEnergy(IGregTechTileEntity aTileEntity) {
+ return isThisHatchMultiEnergy(getMetaTileEntity(aTileEntity));
+ }
+
+ public boolean isThisHatchMultiEnergy(IMetaTileEntity aMetaTileEntity) {
+ Class<?> mDynamoClass;
+ mDynamoClass = ReflectionUtils.getClass(
+ "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti");
+ if (mDynamoClass != null) {
+ if (mDynamoClass.isInstance(aMetaTileEntity)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy || isThisHatchMultiEnergy(aMetaTileEntity)) {
+ return addToMachineList(aMetaTileEntity, aBaseCasingIndex);
+ }
+ return false;
+ }
+
+ private boolean updateMasterEnergyHatchList(IMetaTileEntity aMetaTileEntity) {
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) {
+ GT_MetaTileEntity_Hatch aHatch = (GT_MetaTileEntity_Hatch) aMetaTileEntity;
+ return mAllEnergyHatches.add(aHatch);
+ }
+ return false;
+ }
+
+ /**
+ * Pollution Management
+ */
+ private static Method calculatePollutionReduction = null;
+
+ public int calculatePollutionReductionForHatch(GT_MetaTileEntity_Hatch_Muffler i, int g) {
+ if (calculatePollutionReduction != null) {
+ try {
+ return (int) calculatePollutionReduction.invoke(i, g);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+
+ }
+ }
+ return 0;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setLong("mTotalRunTime", this.mTotalRunTime);
+ aNBT.setBoolean("mVoidExcess", this.mVoidExcess);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mTotalRunTime = aNBT.getLong("mTotalRunTime");
+ this.mVoidExcess = aNBT.getBoolean("mVoidExcess");
+ super.loadNBTData(aNBT);
+ }
+
+ /**
+ * Custom Find Recipe with Debugging
+ */
+ public GT_Recipe findRecipe(
+ final IHasWorldObjectAndCoords aTileEntity,
+ final boolean aNotUnificated,
+ final boolean aDontCheckStackSizes,
+ final long aVoltage,
+ final FluidStack[] aFluids,
+ final ItemStack... aInputs) {
+ return this.findRecipe(
+ aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, (ItemStack) null, aInputs);
+ }
+
+ public GT_Recipe findRecipe(
+ final IHasWorldObjectAndCoords aTileEntity,
+ final boolean aNotUnificated,
+ final long aVoltage,
+ final FluidStack[] aFluids,
+ final ItemStack... aInputs) {
+ return this.findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs);
+ }
+
+ public GT_Recipe findRecipe(
+ final IHasWorldObjectAndCoords aTileEntity,
+ final GT_Recipe aRecipe,
+ final boolean aNotUnificated,
+ final boolean aDontCheckStackSizes,
+ final long aVoltage,
+ final FluidStack[] aFluids,
+ final ItemStack... aInputs) {
+ return this.findRecipe(
+ aTileEntity,
+ aRecipe,
+ aNotUnificated,
+ aDontCheckStackSizes,
+ aVoltage,
+ aFluids,
+ (ItemStack) null,
+ aInputs);
+ }
+
+ public GT_Recipe findRecipe(
+ final IHasWorldObjectAndCoords aTileEntity,
+ final GT_Recipe aRecipe,
+ final boolean aNotUnificated,
+ final long aVoltage,
+ final FluidStack[] aFluids,
+ final ItemStack... aInputs) {
+ return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs);
+ }
+
+ public GT_Recipe findRecipe(
+ final IHasWorldObjectAndCoords aTileEntity,
+ final GT_Recipe aRecipe,
+ final boolean aNotUnificated,
+ final long aVoltage,
+ final FluidStack[] aFluids,
+ final ItemStack aSpecialSlot,
+ final ItemStack... aInputs) {
+ return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, true, aVoltage, aFluids, aSpecialSlot, aInputs);
+ }
+
+ public GT_Recipe findRecipe(
+ final IHasWorldObjectAndCoords aTileEntity,
+ final GT_Recipe aRecipe,
+ final boolean aNotUnificated,
+ final boolean aDontCheckStackSizes,
+ final long aVoltage,
+ final FluidStack[] aFluids,
+ final ItemStack aSpecialSlot,
+ ItemStack... aInputs) {
+ if (this.getRecipeMap().mRecipeList.isEmpty()) {
+ log("No Recipes in Map to search through.");
+ return null;
+ }
+ GT_Recipe mRecipeResult = null;
+ try {
+ if (GregTech_API.sPostloadFinished) {
+ if (this.getRecipeMap().mMinimalInputFluids > 0) {
+ if (aFluids == null) {
+ log("aFluids == null && minFluids > 0");
+ return null;
+ }
+ int tAmount = 0;
+ for (final FluidStack aFluid : aFluids) {
+ if (aFluid != null) {
+ ++tAmount;
+ }
+ }
+ if (tAmount < this.getRecipeMap().mMinimalInputFluids) {
+ log("Not enough fluids?");
+ return null;
+ }
+ }
+ if (this.getRecipeMap().mMinimalInputItems > 0) {
+ if (aInputs == null) {
+ log("No inputs and minItems > 0");
+ return null;
+ }
+ int tAmount = 0;
+ for (final ItemStack aInput : aInputs) {
+ if (aInput != null) {
+ ++tAmount;
+ }
+ }
+ if (tAmount < this.getRecipeMap().mMinimalInputItems) {
+ log("Not enough items?");
+ return null;
+ }
+ }
+ } else {
+ log("Game Not Loaded properly for recipe lookup.");
+ }
+ if (aNotUnificated) {
+ aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
+ }
+ if (aRecipe != null
+ && !aRecipe.mFakeRecipe
+ && aRecipe.mCanBeBuffered
+ && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ mRecipeResult = (aRecipe.mEnabled /* && aVoltage * this.getRecipeMap().mAmperage >= aRecipe.mEUt*/)
+ ? aRecipe
+ : null;
+ log("x) Found Recipe? " + (mRecipeResult != null ? "true" : "false"));
+ if (mRecipeResult != null) {
+ return mRecipeResult;
+ }
+ }
+ if (mRecipeResult == null
+ && this.getRecipeMap().mUsualInputCount >= 0
+ && aInputs != null
+ && aInputs.length > 0) {
+ for (final ItemStack tStack : aInputs) {
+ if (tStack != null) {
+ Collection<GT_Recipe> tRecipes =
+ this.getRecipeMap().mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) {
+ for (final GT_Recipe tRecipe : tRecipes) {
+ if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ mRecipeResult =
+ (tRecipe.mEnabled /* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
+ ? tRecipe
+ : null;
+ log("1) Found Recipe? " + (mRecipeResult != null ? "true" : "false"));
+ // return mRecipeResult;
+ }
+ }
+ }
+
+ // TODO - Investigate if this requires to be in it's own block
+ tRecipes = this.getRecipeMap()
+ .mRecipeItemMap
+ .get(new GT_ItemStack(GT_Utility.copyMetaData(32767L, new Object[] {tStack})));
+ if (tRecipes != null) {
+ for (final GT_Recipe tRecipe : tRecipes) {
+ if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ mRecipeResult =
+ (tRecipe.mEnabled /*&& aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
+ ? tRecipe
+ : null;
+ log("2) Found Recipe? " + (mRecipeResult != null ? "true" : "false"));
+ // return mRecipeResult;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (mRecipeResult == null
+ && this.getRecipeMap().mMinimalInputItems == 0
+ && aFluids != null
+ && aFluids.length > 0) {
+ for (final FluidStack aFluid2 : aFluids) {
+ if (aFluid2 != null) {
+ final Collection<GT_Recipe> tRecipes =
+ this.getRecipeMap().mRecipeFluidMap.get(aFluid2.getFluid());
+ if (tRecipes != null) {
+ for (final GT_Recipe tRecipe : tRecipes) {
+ if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ mRecipeResult =
+ (tRecipe.mEnabled /* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
+ ? tRecipe
+ : null;
+ log("3) Found Recipe? " + (mRecipeResult != null ? "true" : "false"));
+ // return mRecipeResult;
+ }
+ }
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ log("Invalid recipe lookup.");
+ }
+
+ if (mRecipeResult == null) {
+ log("Invalid recipe, Fallback lookup. "
+ + this.getRecipeMap().mRecipeList.size() + " | " + this.getRecipeMap().mNEIName);
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try {
+ return (GT_Recipe) findRecipe08.invoke(
+ getRecipeMap(),
+ aTileEntity,
+ aRecipe,
+ aNotUnificated,
+ aVoltage,
+ aFluids,
+ aSpecialSlot,
+ aInputs);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ return null;
+ }
+ } else {
+ try {
+ return (GT_Recipe) findRecipe09.invoke(
+ getRecipeMap(),
+ aTileEntity,
+ aRecipe,
+ aNotUnificated,
+ aDontCheckStackSizes,
+ aVoltage,
+ aFluids,
+ aSpecialSlot,
+ aInputs);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+ } else {
+ return mRecipeResult;
+ }
+ }
+
+ /**
+ * Custom Tool Handling
+ */
+ @Override
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ // Do Things
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ // Logger.INFO("Right Clicked Controller.");
+ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
+ if (tCurrentItem != null) {
+ // Logger.INFO("Holding Item.");
+ if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) {
+ // Logger.INFO("Is GT_MetaGenerated_Tool.");
+ int[] aOreID = OreDictionary.getOreIDs(tCurrentItem);
+ for (int id : aOreID) {
+ // Plunger
+ if (OreDictionary.getOreName(id).equals("craftingToolPlunger")) {
+ // Logger.INFO("Is Plunger.");
+ return onPlungerRightClick(aPlayer, aSide, aX, aY, aZ);
+ }
+ }
+ }
+ }
+ }
+ // Do Super
+ boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
+ return aSuper;
+ }
+
+ public boolean onPlungerRightClick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ int aHatchIndex = 0;
+ PlayerUtils.messagePlayer(aPlayer, "Trying to clear " + mOutputHatches.size() + " output hatches.");
+ for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) {
+ if (hatch.mFluid != null) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "Clearing " + hatch.mFluid.amount + "L of " + hatch.mFluid.getLocalizedName() + " from hatch "
+ + aHatchIndex + ".");
+ hatch.mFluid = null;
+ }
+ aHatchIndex++;
+ }
+ return aHatchIndex > 0;
+ }
+
+ @Override
+ public boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ boolean tSuper = super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
+ if (aPlayer.isSneaking()) return tSuper;
+ mVoidExcess = !mVoidExcess;
+ aPlayer.addChatMessage(new ChatComponentTranslation(
+ mVoidExcess ? "interaction.voidexcess.enabled" : "interaction.voidexcess.disabled"));
+ return true;
+ }
+
+ public boolean isValidBlockForStructure(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ int aCasingID,
+ boolean canBeHatch,
+ Block aFoundBlock,
+ int aFoundMeta,
+ Block aExpectedBlock,
+ int aExpectedMeta) {
+ boolean isHatch = false;
+ if (aBaseMetaTileEntity != null) {
+
+ // Unsure why this check exists?
+ /*if (aCasingID < 64) {
+ aCasingID = TAE.GTPP_INDEX(aCasingID);
+ }*/
+
+ isHatch = this.addToMachineList(aBaseMetaTileEntity, aCasingID);
+ if (isHatch) {
+ return true;
+ } else {
+ int aMetaTileID = aBaseMetaTileEntity.getMetaTileID();
+ // Found a controller
+ if (aMetaTileID >= 750 && aMetaTileID < 1000 && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ // Vanilla Hatches/Busses
+ else if (aMetaTileID >= 10 && aMetaTileID <= 99 && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ // Adv Mufflers
+ else if (aMetaTileID >= 30001 && aMetaTileID <= 30009 && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ // Control Core, Super IO
+ else if (aMetaTileID >= 30020 && aMetaTileID <= 30040 && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ // Auto maint
+ else if (aMetaTileID == 111 && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ // Data Ports
+ else if ((aMetaTileID == 131 || aMetaTileID == 132) && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ } else {
+ log("Found meta Tile: " + aMetaTileID);
+ }
+ }
+ }
+ if (!isHatch) {
+ if (aFoundBlock == aExpectedBlock && aFoundMeta == aExpectedMeta) {
+ return true;
+ } else if (aFoundBlock != aExpectedBlock) {
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("A1 - Found: " + aFoundBlock.getLocalizedName() + ":" + aFoundMeta + ", Expected: "
+ + aExpectedBlock.getLocalizedName() + ":" + aExpectedMeta);
+ // log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString()));
+ }
+ return false;
+ } else if (aFoundMeta != aExpectedMeta) {
+ log("A2");
+ return false;
+ }
+ }
+ log("A3");
+ return false;
+ }
+
+ @Override
+ public void onServerStart() {
+ super.onServerStart();
+ tryTickWaitTimerDown();
+ }
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ super.onFirstTick(aBaseMetaTileEntity);
+ tryTickWaitTimerDown();
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ tryTickWaitTimerDown();
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ super.onCreated(aStack, aWorld, aPlayer);
+ tryTickWaitTimerDown();
+ }
+
+ private final void tryTickWaitTimerDown() {
+ /*if (mStartUpCheck > 10) {
+ mStartUpCheck = 10;
+ }*/
+ }
+
+ // Only support to use meta to tier
+
+ /**
+ * accept meta [0, maxMeta)
+ * @param maxMeta exclusive
+ */
+ public static <T> IStructureElement<T> addTieredBlock(
+ Block aBlock,
+ BiConsumer<T, Integer> aSetTheFuckingMeta,
+ Function<T, Integer> aGetTheFuckingMeta,
+ int maxMeta) {
+ return addTieredBlock(
+ aBlock,
+ (t, i) -> {
+ aSetTheFuckingMeta.accept(t, i);
+ return true;
+ },
+ aGetTheFuckingMeta,
+ 0,
+ maxMeta);
+ }
+
+ /**
+ *
+ * @param minMeta inclusive
+ * @param maxMeta exclusive
+ */
+ public static <T> IStructureElement<T> addTieredBlock(
+ Block aBlock,
+ BiConsumer<T, Integer> aSetTheFuckingMeta,
+ Function<T, Integer> aGetTheFuckingMeta,
+ int minMeta,
+ int maxMeta) {
+ return addTieredBlock(
+ aBlock,
+ (t, i) -> {
+ aSetTheFuckingMeta.accept(t, i);
+ return true;
+ },
+ aGetTheFuckingMeta,
+ minMeta,
+ maxMeta);
+ }
+
+ /**
+ *
+ * @param minMeta inclusive
+ * @param maxMeta exclusive
+ */
+ public static <T> IStructureElement<T> addTieredBlock(
+ Block aBlock,
+ BiPredicate<T, Integer> aSetTheFuckingMeta,
+ Function<T, Integer> aGetTheFuckingMeta,
+ int minMeta,
+ int maxMeta) {
+
+ return new IStructureElement<T>() {
+ @Override
+ public boolean check(T t, World world, int x, int y, int z) {
+ Block tBlock = world.getBlock(x, y, z);
+ if (aBlock == tBlock) {
+ Integer currentMeta = aGetTheFuckingMeta.apply(t);
+ int newMeta = tBlock.getDamageValue(world, x, y, z) + 1;
+ if (newMeta > maxMeta || newMeta < minMeta + 1) return false;
+ if (currentMeta == 0) {
+ return aSetTheFuckingMeta.test(t, newMeta);
+ } else {
+ return currentMeta == newMeta;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
+ StructureLibAPI.hintParticle(world, x, y, z, aBlock, getMeta(trigger));
+ return true;
+ }
+
+ @Override
+ public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
+ return world.setBlock(x, y, z, aBlock, getMeta(trigger), 3);
+ }
+
+ private int getMeta(ItemStack trigger) {
+ int meta = trigger.stackSize;
+ if (meta <= 0) meta = minMeta;
+ if (meta + minMeta >= maxMeta) meta = maxMeta - 1 - minMeta;
+ return meta + minMeta;
+ }
+
+ @Override
+ public PlaceResult survivalPlaceBlock(
+ T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ IItemSource s,
+ EntityPlayerMP actor,
+ Consumer<IChatComponent> chatter) {
+ if (world.getBlock(x, y, z) == aBlock) {
+ if (world.getBlockMetadata(x, y, z) == getMeta(trigger)) {
+ return PlaceResult.SKIP;
+ }
+ return PlaceResult.REJECT;
+ }
+ return StructureUtility.survivalPlaceBlock(aBlock, getMeta(trigger), world, x, y, z, s, actor, chatter);
+ }
+ };
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ if (aSide == aFacing) {
+ if (aActive)
+ return new ITexture[] {
+ getCasingTexture(),
+ TextureFactory.builder()
+ .addIcon(getActiveOverlay())
+ .extFacing()
+ .build()
+ };
+ return new ITexture[] {
+ getCasingTexture(),
+ TextureFactory.builder()
+ .addIcon(getInactiveOverlay())
+ .extFacing()
+ .build()
+ };
+ }
+ return new ITexture[] {getCasingTexture()};
+ }
+
+ protected IIconContainer getActiveOverlay() {
+ return null;
+ }
+
+ protected IIconContainer getInactiveOverlay() {
+ return null;
+ }
+
+ protected ITexture getCasingTexture() {
+ return Textures.BlockIcons.getCasingTextureForId(getCasingTextureId());
+ }
+
+ protected int getCasingTextureId() {
+ return 0;
+ }
+
+ public enum GTPPHatchElement implements IHatchElement<GregtechMeta_MultiBlockBase<?>> {
+ AirIntake(GregtechMeta_MultiBlockBase::addAirIntakeToMachineList, GT_MetaTileEntity_Hatch_AirIntake.class) {
+ @Override
+ public long count(GregtechMeta_MultiBlockBase<?> t) {
+ return t.mAirIntakes.size();
+ }
+ },
+ ControlCore(
+ GregtechMeta_MultiBlockBase::addControlCoreToMachineList, GT_MetaTileEntity_Hatch_ControlCore.class) {
+ @Override
+ public long count(GregtechMeta_MultiBlockBase<?> t) {
+ return t.mControlCoreBus.size();
+ }
+ },
+ TTDynamo(
+ GregtechMeta_MultiBlockBase::addMultiAmpDynamoToMachineList,
+ "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti") {
+ @Override
+ public long count(GregtechMeta_MultiBlockBase<?> t) {
+ return t.mTecTechDynamoHatches.size();
+ }
+ },
+ TTEnergy(
+ GregtechMeta_MultiBlockBase::addMultiAmpEnergyToMachineList,
+ "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti") {
+ @Override
+ public long count(GregtechMeta_MultiBlockBase<?> t) {
+ return t.mTecTechEnergyHatches.size();
+ }
+ },
+ ;
+
+ @SuppressWarnings("unchecked")
+ private static <T> Class<T> retype(Class<?> clazz) {
+ return (Class<T>) clazz;
+ }
+
+ private final List<? extends Class<? extends IMetaTileEntity>> mMteClasses;
+ private final IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> mAdder;
+
+ @SafeVarargs
+ GTPPHatchElement(
+ IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> aAdder,
+ Class<? extends IMetaTileEntity>... aMteClasses) {
+ this.mMteClasses = Arrays.asList(aMteClasses);
+ this.mAdder = aAdder;
+ }
+
+ GTPPHatchElement(IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> aAdder, String... aClassNames) {
+ this.mMteClasses = Arrays.stream(aClassNames)
+ .map(ReflectionUtils::getClass)
+ .filter(Objects::nonNull)
+ .<Class<? extends IMetaTileEntity>>map(GTPPHatchElement::retype)
+ .collect(Collectors.toList());
+ this.mAdder = aAdder;
+ }
+
+ @Override
+ public List<? extends Class<? extends IMetaTileEntity>> mteClasses() {
+ return mMteClasses;
+ }
+
+ @Override
+ public IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> adder() {
+ return mAdder;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java
index 5503280409..119d681212 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java
@@ -1,7 +1,7 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
-import java.util.ArrayList;
-import java.util.List;
+import static gregtech.api.enums.GT_Values.V;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -16,265 +16,268 @@ import gtPlusPlus.api.objects.data.*;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusOutput;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
+public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMultiBase<T>>
+ extends GregtechMeta_MultiBlockBase<T> {
-import static gregtech.api.enums.GT_Values.V;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
+ public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput> mSteamInputs =
+ new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput> mSteamOutputs =
+ new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput>();
+ public ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mSteamInputFluids =
+ new ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase>();
+
+ protected static final String TT_steaminputbus = StatCollector.translateToLocal("GTPP.MBTT.SteamInputBus");
+ protected static final String TT_steamoutputbus = StatCollector.translateToLocal("GTPP.MBTT.SteamOutputBus");
+ protected static final String TT_steamhatch = StatCollector.translateToLocal("GTPP.MBTT.SteamHatch");
+
+ public GregtechMeta_SteamMultiBase(String aName) {
+ super(aName);
+ }
+
+ public GregtechMeta_SteamMultiBase(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[] {
+ Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()),
+ aActive ? getFrontOverlayActive() : getFrontOverlay()
+ };
+ }
+ return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())};
+ }
+
+ protected abstract GT_RenderedTexture getFrontOverlay();
+
+ protected abstract GT_RenderedTexture getFrontOverlayActive();
+
+ private int getCasingTextureIndex() {
+ return 10;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack arg0) {
+
+ log("Running checkRecipeGeneric(0)");
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ GT_Recipe_Map tMap = this.getRecipeMap();
+ if (tMap == null) {
+ return false;
+ }
+ ItemStack[] aItemInputs = tItems.toArray(new ItemStack[0]);
+ FluidStack[] aFluidInputs = tFluids.toArray(new FluidStack[0]);
+ GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, aItemInputs);
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
+
+ int aEUPercent = 100;
+ int aSpeedBonusPercent = 0;
+ int aOutputChanceRoll = 10000;
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ int aMaxParallelRecipes =
+ canBufferOutputs(tRecipe.mOutputs, tRecipe.mFluidOutputs, this.getMaxParallelRecipes());
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tRecipeEUt: " + tRecipeEUt);
+
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (32 - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ log("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor * 1.5f);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt * 1.33f);
+
+ // this.mEUt = (3 * tRecipe.mEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = getOutputFluids(tRecipe, parallelRecipes);
+
+ // Collect output item types
+ ItemStack[] tOutputItems = getOutputItems(tRecipe);
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[0]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ log("GOOD RETURN - 1");
+ return true;
+ }
+
+ public ArrayList<FluidStack> getAllSteamStacks() {
+ ArrayList<FluidStack> aFluids = new ArrayList<FluidStack>();
+ FluidStack aSteam = FluidUtils.getSteam(1);
+ for (FluidStack aFluid : this.getStoredFluids()) {
+ if (aFluid.isFluidEqual(aSteam)) {
+ aFluids.add(aFluid);
+ }
+ }
+ return aFluids;
+ }
+
+ public int getTotalSteamStored() {
+ int aSteam = 0;
+ for (FluidStack aFluid : getAllSteamStacks()) {
+ aSteam += aFluid.amount;
+ }
+ return aSteam;
+ }
+
+ public boolean tryConsumeSteam(int aAmount) {
+ if (getTotalSteamStored() <= 0) {
+ return false;
+ } else {
+ return this.depleteInput(FluidUtils.getSteam(aAmount));
+ }
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack arg0) {
+ return 0;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
+ this.mSteamInputs.clear();
+ this.mSteamOutputs.clear();
+ this.mSteamInputFluids.clear();
+ }
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
-public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMultiBase<T>> extends GregtechMeta_MultiBlockBase<T> {
-
- public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput> mSteamInputs = new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput>();
- public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput> mSteamOutputs = new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput>();
- public ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mSteamInputFluids = new ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase>();
-
- protected static final String TT_steaminputbus = StatCollector.translateToLocal("GTPP.MBTT.SteamInputBus");
- protected static final String TT_steamoutputbus = StatCollector.translateToLocal("GTPP.MBTT.SteamOutputBus");
- protected static final String TT_steamhatch = StatCollector.translateToLocal("GTPP.MBTT.SteamHatch");
-
- public GregtechMeta_SteamMultiBase(String aName) {
- super(aName);
- }
-
- public GregtechMeta_SteamMultiBase(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()), aActive ? getFrontOverlayActive() : getFrontOverlay()};
- }
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())};
- }
-
- protected abstract GT_RenderedTexture getFrontOverlay();
-
- protected abstract GT_RenderedTexture getFrontOverlayActive();
-
- private int getCasingTextureIndex() {
- return 10;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public boolean checkRecipe(ItemStack arg0) {
-
-
- log("Running checkRecipeGeneric(0)");
- ArrayList<ItemStack> tItems = getStoredInputs();
- ArrayList<FluidStack> tFluids = getStoredFluids();
- GT_Recipe_Map tMap = this.getRecipeMap();
- if (tMap == null) {
- return false;
- }
- ItemStack[] aItemInputs = tItems.toArray(new ItemStack[0]);
- FluidStack[] aFluidInputs = tFluids.toArray(new FluidStack[0]);
- GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, aItemInputs);
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
-
- int aEUPercent = 100;
- int aSpeedBonusPercent = 0;
- int aOutputChanceRoll = 10000;
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
-
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
-
- int aMaxParallelRecipes = canBufferOutputs(tRecipe.mOutputs, tRecipe.mFluidOutputs, this.getMaxParallelRecipes());
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tRecipeEUt: "+tRecipeEUt);
-
-
-
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (32 - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor * 1.5f);
-
- this.mEUt = (int)Math.ceil(tTotalEUt*1.33f);
-
- //this.mEUt = (3 * tRecipe.mEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = getOutputFluids(tRecipe, parallelRecipes);
-
- // Collect output item types
- ItemStack[] tOutputItems = getOutputItems(tRecipe);
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[0]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
-
- }
-
- public ArrayList<FluidStack> getAllSteamStacks(){
- ArrayList<FluidStack> aFluids = new ArrayList<FluidStack>();
- FluidStack aSteam = FluidUtils.getSteam(1);
- for (FluidStack aFluid : this.getStoredFluids()) {
- if (aFluid.isFluidEqual(aSteam)) {
- aFluids.add(aFluid);
- }
- }
- return aFluids;
- }
-
- public int getTotalSteamStored() {
- int aSteam = 0;
- for (FluidStack aFluid : getAllSteamStacks()) {
- aSteam += aFluid.amount;
- }
- return aSteam;
- }
-
- public boolean tryConsumeSteam(int aAmount) {
- if (getTotalSteamStored() <= 0) {
- return false;
- }
- else {
- return this.depleteInput(FluidUtils.getSteam(aAmount));
- }
- }
-
- @Override
- public int getMaxEfficiency(ItemStack arg0) {
- return 0;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
- this.mSteamInputs.clear();
- this.mSteamOutputs.clear();
- this.mSteamInputFluids.clear();
- }
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
/**
* Called every tick the Machine runs
*/
public boolean onRunningTick(ItemStack aStack) {
- fixAllMaintenanceIssue();
+ fixAllMaintenanceIssue();
if (mEUt < 0) {
- long aSteamVal = (((long) -mEUt * 10000) / Math.max(1000, mEfficiency));
- //Logger.INFO("Trying to drain "+aSteamVal+" steam per tick.");
+ long aSteamVal = (((long) -mEUt * 10000) / Math.max(1000, mEfficiency));
+ // Logger.INFO("Trying to drain "+aSteamVal+" steam per tick.");
if (!tryConsumeSteam((int) aSteamVal)) {
stopMachine();
return false;
@@ -282,403 +285,408 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
}
return true;
}
-
- @Override
- public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- log("Invalid IGregTechTileEntity");
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- log("Invalid IMetaTileEntity");
- return false;
- }
-
- //Use this to determine the correct value, then update the hatch texture after.
- boolean aDidAdd = false;
-
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase) {
- log("Adding Steam Input Hatch");
- aDidAdd = addToMachineListInternal(mSteamInputFluids, aMetaTileEntity, aBaseCasingIndex);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) {
- log("Trying to set recipe map. Type: "+(getRecipeMap() != null ? getRecipeMap().mNEIName : "Null"));
- this.resetRecipeMapForHatch(aTileEntity, getRecipeMap());
- log("Adding Steam Input Bus");
+
+ @Override
+ public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ log("Invalid IGregTechTileEntity");
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ log("Invalid IMetaTileEntity");
+ return false;
+ }
+
+ // Use this to determine the correct value, then update the hatch texture after.
+ boolean aDidAdd = false;
+
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase) {
+ log("Adding Steam Input Hatch");
+ aDidAdd = addToMachineListInternal(mSteamInputFluids, aMetaTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) {
+ log("Trying to set recipe map. Type: " + (getRecipeMap() != null ? getRecipeMap().mNEIName : "Null"));
+ this.resetRecipeMapForHatch(aTileEntity, getRecipeMap());
+ log("Adding Steam Input Bus");
aDidAdd = addToMachineListInternal(mSteamInputs, aMetaTileEntity, aBaseCasingIndex);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput) {
- log("Adding Steam Output Bus");
- aDidAdd = addToMachineListInternal(mSteamOutputs, aMetaTileEntity, aBaseCasingIndex);
- }
-
- return aDidAdd;
- }
-
-
-
-
- @Override
- public void stopMachine() {
- super.stopMachine();
- }
-
- public FluidStack[] getOutputFluids(GT_Recipe aRecipe, int parallelRecipes) {
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[aRecipe.mFluidOutputs.length];
- for (int h = 0; h < aRecipe.mFluidOutputs.length; h++) {
- if (aRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = aRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
- return tOutputFluids;
- }
-
- public ItemStack[] getOutputItems(GT_Recipe aRecipe) {
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[aRecipe.mOutputs.length];
- for (int h = 0; h < aRecipe.mOutputs.length; h++) {
- if (aRecipe.getOutput(h) != null) {
- tOutputItems[h] = aRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
- return tOutputItems;
- }
-
- public int getOutputCount(ItemStack[] aOutputs) {
- return aOutputs.length;
- }
- public int getOutputFluidCount(FluidStack[] aOutputs) {
- return aOutputs.length;
- }
-
- public int canBufferOutputs(final ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int aParallelRecipes) {
-
- log("Determining if we have space to buffer outputs. Parallel: "+aParallelRecipes);
-
- // Null recipe or a recipe with lots of outputs?
- // E.G. Gendustry custom comb with a billion centrifuge outputs?
- // Do it anyway, provided the multi allows it. Default behaviour is aAllow16SlotWithoutCheck = true.
- if (aOutputs == null && aFluidOutputs == null) {
- return 0;
- }
-
- // Do we even need to check for item outputs?
- boolean aDoesOutputItems = aOutputs != null ? aOutputs.length > 0 : false;
- // Do we even need to check for fluid outputs?
- boolean aDoesOutputFluids = aFluidOutputs != null ? aFluidOutputs.length > 0 : false;
-
- if (!aDoesOutputItems && !aDoesOutputFluids) {
- return 0;
- }
-
- /* ========================================
- * Item Management
- * ========================================
- */
-
- if (aDoesOutputItems) {
- log("We have items to output.");
-
- // How many slots are free across all the output buses?
- int aInputBusSlotsFree = 0;
-
- /*
- * Create Variables for Item Output
- */
-
- AutoMap<FlexiblePair<ItemStack, Integer>> aItemMap = new AutoMap<FlexiblePair<ItemStack, Integer>>();
- AutoMap<ItemStack> aItemOutputs = new AutoMap<ItemStack>(aOutputs);
-
- for (final GT_MetaTileEntity_Hatch_Steam_BusOutput tBus : this.mSteamOutputs) {
- if (!isValidMetaTileEntity(tBus)) {
- continue;
- }
- final IInventory tBusInv = tBus.getBaseMetaTileEntity();
- for (int i = 0; i < tBusInv.getSizeInventory(); i++) {
- if (tBus.getStackInSlot(i) == null) {
- aInputBusSlotsFree++;
- }
- else {
- ItemStack aT = tBus.getStackInSlot(i);
- int aSize = aT.stackSize;
- aT = aT.copy();
- aT.stackSize = 0;
- aItemMap.put(new FlexiblePair<ItemStack, Integer>(aT, aSize));
- }
- }
- }
-
- // Count the slots we need, later we can check if any are able to merge with existing stacks
- int aRecipeSlotsRequired = 0;
-
- // A map to hold the items we will be 'inputting' into the output buses. These itemstacks are actually the recipe outputs.
- ConcurrentSet<FlexiblePair<ItemStack, Integer>> aInputMap = new ConcurrentHashSet<FlexiblePair<ItemStack, Integer>>();
-
- // Iterate over the outputs, calculating require stack spacing they will require.
- for (int i=0;i<getOutputCount(aOutputs);i++) {
- ItemStack aY = aItemOutputs.get(i);
- if (aY == null) {
- continue;
- }
- else {
- int aStackSize = aY.stackSize * aParallelRecipes;
- if (aStackSize > 64) {
- int aSlotsNeedsForThisStack = (int) Math.ceil((double) ((float) aStackSize / 64f));
- // Should round up and add as many stacks as required nicely.
- aRecipeSlotsRequired += aSlotsNeedsForThisStack;
- for (int o=0;o<aRecipeSlotsRequired;o++) {
- int aStackToRemove = (aStackSize -= 64) > 64 ? 64 : aStackSize;
- aY = aY.copy();
- aY.stackSize = 0;
- aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackToRemove));
- }
- }
- else {
- // Only requires one slot
- aRecipeSlotsRequired++;
- aY = aY.copy();
- aY.stackSize = 0;
- aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackSize));
- }
- }
- }
-
- // We have items to add to the output buses. See if any are not full stacks and see if we can make them full.
- if (aInputMap.size() > 0) {
- // Iterate over the current stored items in the Output busses, if any match and are not full, we can try account for merging.
- busItems: for (FlexiblePair<ItemStack, Integer> y : aItemMap) {
- // Iterate over the 'inputs', we can safely remove these as we go.
- outputItems: for (FlexiblePair<ItemStack, Integer> u : aInputMap) {
- // Create local vars for readability.
- ItemStack aOutputBusStack = y.getKey();
- ItemStack aOutputStack = u.getKey();
- // Stacks match, including NBT.
- if (GT_Utility.areStacksEqual(aOutputBusStack, aOutputStack, false)) {
- // Stack Matches, but it's full, continue.
- if (aOutputBusStack.stackSize >= 64) {
- // This stack is full, no point checking it.
- continue busItems;
- }
- else {
- // We can merge these two stacks without any hassle.
- if ((aOutputBusStack.stackSize + aOutputStack.stackSize) <= 64) {
- // Update the stack size in the bus storage map.
- y.setValue(aOutputBusStack.stackSize + aOutputStack.stackSize);
- // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
- aInputMap.remove(u);
- continue outputItems;
- }
- // Stack merging is too much, so we fill this stack, leave the remainder.
- else {
- int aRemainder = (aOutputBusStack.stackSize + aOutputStack.stackSize) - 64;
- // Update the stack size in the bus storage map.
- y.setValue(64);
- // Create a new object to iterate over later, with the remainder data;
- FlexiblePair<ItemStack, Integer> t = new FlexiblePair<ItemStack, Integer>(u.getKey(), aRemainder);
- // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
- aInputMap.remove(u);
- // Add the remainder stack.
- aInputMap.add(t);
- continue outputItems;
- }
- }
- }
- else {
- continue outputItems;
- }
- }
- }
- }
-
- // We have stacks that did not merge, do we have space for them?
- if (aInputMap.size() > 0) {
- if (aInputMap.size() > aInputBusSlotsFree) {
- aParallelRecipes = (int) Math.floor((double) aInputBusSlotsFree/aInputMap.size() * aParallelRecipes);
- // We do not have enough free slots in total to accommodate the remaining managed stacks.
- log(" Free: "+aInputBusSlotsFree+", Required: "+aInputMap.size());
- if(aParallelRecipes == 0) {
- log("Failed to find enough space for all item outputs.");
- return 0;
- }
-
- }
- }
-
- /*
- * End Item Management
- */
-
- }
-
-
-
-
-
- /* ========================================
- * Fluid Management
- * ========================================
- */
-
-
-
- if (aDoesOutputFluids) {
- log("We have Fluids to output.");
- // How many slots are free across all the output buses?
- int aFluidHatches = 0;
- int aEmptyFluidHatches = 0;
- int aFullFluidHatches = 0;
- // Create Map for Fluid Output
- ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches = new ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>();
- for (final GT_MetaTileEntity_Hatch_Output tBus : this.mOutputHatches) {
- if (!isValidMetaTileEntity(tBus)) {
- continue;
- }
- aFluidHatches++;
- // Map the Hatch with the space left for easy checking later.
- if (tBus.getFluid() == null) {
- aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(tBus, null, tBus.getCapacity()));
- }
- else {
- int aSpaceLeft = tBus.getCapacity() - tBus.getFluidAmount();
- aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(tBus, tBus.getFluid(), aSpaceLeft));
- }
- }
- // Create a map of all the fluids we would like to output, we can iterate over this and see how many we can merge into existing hatch stacks.
- ArrayList<FluidStack> aOutputFluids = new ArrayList<FluidStack>();
- // Ugly ass boxing
- aOutputFluids.addAll(new AutoMap<FluidStack>(aFluidOutputs));
- // Iterate the Hatches, updating their 'stored' data.
- //for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aHatchData : aOutputHatches) {
- for (int i = 0;i<aOutputHatches.size();i++) {
- // The Hatch Itself
- GT_MetaTileEntity_Hatch_Output aHatch = aOutputHatches.get(i).getValue_1();
- // Fluid in the Hatch
- FluidStack aHatchStack = aOutputHatches.get(i).getValue_2();
- // Space left in Hatch
- int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount();
- // Hatch is full,
- if (aSpaceLeftInHatch <= 0) {
- aFullFluidHatches++;
- aOutputHatches.remove(aOutputHatches.get(i));
- i--;
- continue;
- }
- // Hatch has space
- else {
- // Check if any fluids match
- //aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) {
- for(int j = 0;j<getOutputFluidCount(aFluidOutputs);j++) {
- //log(" aHatchStack "+aHatchStack.getLocalizedName()+" aOutput stack "+aOutputStack.getLocalizedName());
- if (GT_Utility.areFluidsEqual(aHatchStack, aOutputFluids.get(j))) {
- int aFluidToPutIntoHatch = aOutputFluids.get(j).amount * aParallelRecipes;
- // Not Enough space to insert all of the fluid.
- // We fill this hatch and add a smaller Fluidstack back to the iterator.
- if (aSpaceLeftInHatch < aFluidToPutIntoHatch) {
- // Copy existing Hatch Stack
- FluidStack aNewHatchStack = aHatchStack.copy();
- aNewHatchStack.amount = 0;
- // Copy existing Hatch Stack again
- FluidStack aNewOutputStack = aHatchStack.copy();
- aNewOutputStack.amount = 0;
- // How much fluid do we have left after we fill the hatch?
- int aFluidLeftAfterInsert = aFluidToPutIntoHatch - aSpaceLeftInHatch;
- // Set new stacks to appropriate values
- aNewHatchStack.amount = aHatch.getCapacity();
- aNewOutputStack.amount = aFluidLeftAfterInsert;
- // Remove fluid from output list, merge success
- aOutputFluids.remove(aOutputFluids.get(j));
- j--;
- // Remove hatch from hatch list, data is now invalid.
- aOutputHatches.remove(aOutputHatches.get(i));
- i--;
- // Add remaining Fluid to Output list
- aOutputFluids.add(aNewOutputStack);
- // Re-add hatch to hatch list, with new data.
- //Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
- //aOutputHatches.add(aNewHatchData);
- break;
- }
- // We can fill this hatch perfectly (rare case), may as well add it directly to the full list.
- else if (aSpaceLeftInHatch == aFluidToPutIntoHatch) {
- // Copy Old Stack
- FluidStack aNewHatchStack = aHatchStack.copy();
- // Add in amount from output stack
- aNewHatchStack.amount += aFluidToPutIntoHatch;
- // Remove fluid from output list, merge success
- aOutputFluids.remove(aOutputFluids.get(j));
- j--;
- // Remove hatch from hatch list, data is now invalid.
- aOutputHatches.remove(aOutputHatches.get(i));
- i--;
- // Re-add hatch to hatch list, with new data.
- Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
- aOutputHatches.add(aNewHatchData);
- break;
- }
- // We have more space than we need to merge, so we remove the stack from the output list and update the hatch list.
- else {
- // Copy Old Stack
- FluidStack aNewHatchStack = aHatchStack.copy();
- // Add in amount from output stack
- aNewHatchStack.amount += aFluidToPutIntoHatch;
- // Remove fluid from output list, merge success
- aOutputFluids.remove(aOutputFluids.get(j));
- j--;
- // Remove hatch from hatch list, data is now invalid.
- aOutputHatches.remove(aOutputHatches.get(i));
- i--;
- // Re-add hatch to hatch list, with new data.
- Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
- aOutputHatches.add(aNewHatchData);
- // Check next fluid
- continue;
- }
-
- }
- else {
- continue;
- }
- }
- }
- }
-
- for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aFreeHatchCheck : aOutputHatches) {
- // Free Hatch
- if (aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) {
- aEmptyFluidHatches++;
- }
- }
-
- // We have Fluid Stacks we did not merge. Do we have space?
- log("fluids to output "+aOutputFluids.size()+" empty hatches "+aEmptyFluidHatches);
- if (aOutputFluids.size() > 0) {
- // Not enough space to add fluids.
- if (aOutputFluids.size() > aEmptyFluidHatches) {
- aParallelRecipes = (int) Math.floor((double) aEmptyFluidHatches/aOutputFluids.size() * aParallelRecipes);
- log("Failed to find enough space for all fluid outputs. Free: "+aEmptyFluidHatches+", Required: "+aOutputFluids.size());
- return 0;
-
- }
- }
-
- /*
- * End Fluid Management
- */
- }
-
- return aParallelRecipes;
- }
-
-
- /*
- * Handle I/O with custom hatches
- */
-
- @Override
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput) {
+ log("Adding Steam Output Bus");
+ aDidAdd = addToMachineListInternal(mSteamOutputs, aMetaTileEntity, aBaseCasingIndex);
+ }
+
+ return aDidAdd;
+ }
+
+ @Override
+ public void stopMachine() {
+ super.stopMachine();
+ }
+
+ public FluidStack[] getOutputFluids(GT_Recipe aRecipe, int parallelRecipes) {
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[aRecipe.mFluidOutputs.length];
+ for (int h = 0; h < aRecipe.mFluidOutputs.length; h++) {
+ if (aRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = aRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+ return tOutputFluids;
+ }
+
+ public ItemStack[] getOutputItems(GT_Recipe aRecipe) {
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[aRecipe.mOutputs.length];
+ for (int h = 0; h < aRecipe.mOutputs.length; h++) {
+ if (aRecipe.getOutput(h) != null) {
+ tOutputItems[h] = aRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+ return tOutputItems;
+ }
+
+ public int getOutputCount(ItemStack[] aOutputs) {
+ return aOutputs.length;
+ }
+
+ public int getOutputFluidCount(FluidStack[] aOutputs) {
+ return aOutputs.length;
+ }
+
+ public int canBufferOutputs(final ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int aParallelRecipes) {
+
+ log("Determining if we have space to buffer outputs. Parallel: " + aParallelRecipes);
+
+ // Null recipe or a recipe with lots of outputs?
+ // E.G. Gendustry custom comb with a billion centrifuge outputs?
+ // Do it anyway, provided the multi allows it. Default behaviour is aAllow16SlotWithoutCheck = true.
+ if (aOutputs == null && aFluidOutputs == null) {
+ return 0;
+ }
+
+ // Do we even need to check for item outputs?
+ boolean aDoesOutputItems = aOutputs != null ? aOutputs.length > 0 : false;
+ // Do we even need to check for fluid outputs?
+ boolean aDoesOutputFluids = aFluidOutputs != null ? aFluidOutputs.length > 0 : false;
+
+ if (!aDoesOutputItems && !aDoesOutputFluids) {
+ return 0;
+ }
+
+ /* ========================================
+ * Item Management
+ * ========================================
+ */
+
+ if (aDoesOutputItems) {
+ log("We have items to output.");
+
+ // How many slots are free across all the output buses?
+ int aInputBusSlotsFree = 0;
+
+ /*
+ * Create Variables for Item Output
+ */
+
+ AutoMap<FlexiblePair<ItemStack, Integer>> aItemMap = new AutoMap<FlexiblePair<ItemStack, Integer>>();
+ AutoMap<ItemStack> aItemOutputs = new AutoMap<ItemStack>(aOutputs);
+
+ for (final GT_MetaTileEntity_Hatch_Steam_BusOutput tBus : this.mSteamOutputs) {
+ if (!isValidMetaTileEntity(tBus)) {
+ continue;
+ }
+ final IInventory tBusInv = tBus.getBaseMetaTileEntity();
+ for (int i = 0; i < tBusInv.getSizeInventory(); i++) {
+ if (tBus.getStackInSlot(i) == null) {
+ aInputBusSlotsFree++;
+ } else {
+ ItemStack aT = tBus.getStackInSlot(i);
+ int aSize = aT.stackSize;
+ aT = aT.copy();
+ aT.stackSize = 0;
+ aItemMap.put(new FlexiblePair<ItemStack, Integer>(aT, aSize));
+ }
+ }
+ }
+
+ // Count the slots we need, later we can check if any are able to merge with existing stacks
+ int aRecipeSlotsRequired = 0;
+
+ // A map to hold the items we will be 'inputting' into the output buses. These itemstacks are actually the
+ // recipe outputs.
+ ConcurrentSet<FlexiblePair<ItemStack, Integer>> aInputMap =
+ new ConcurrentHashSet<FlexiblePair<ItemStack, Integer>>();
+
+ // Iterate over the outputs, calculating require stack spacing they will require.
+ for (int i = 0; i < getOutputCount(aOutputs); i++) {
+ ItemStack aY = aItemOutputs.get(i);
+ if (aY == null) {
+ continue;
+ } else {
+ int aStackSize = aY.stackSize * aParallelRecipes;
+ if (aStackSize > 64) {
+ int aSlotsNeedsForThisStack = (int) Math.ceil((double) ((float) aStackSize / 64f));
+ // Should round up and add as many stacks as required nicely.
+ aRecipeSlotsRequired += aSlotsNeedsForThisStack;
+ for (int o = 0; o < aRecipeSlotsRequired; o++) {
+ int aStackToRemove = (aStackSize -= 64) > 64 ? 64 : aStackSize;
+ aY = aY.copy();
+ aY.stackSize = 0;
+ aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackToRemove));
+ }
+ } else {
+ // Only requires one slot
+ aRecipeSlotsRequired++;
+ aY = aY.copy();
+ aY.stackSize = 0;
+ aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackSize));
+ }
+ }
+ }
+
+ // We have items to add to the output buses. See if any are not full stacks and see if we can make them
+ // full.
+ if (aInputMap.size() > 0) {
+ // Iterate over the current stored items in the Output busses, if any match and are not full, we can try
+ // account for merging.
+ busItems:
+ for (FlexiblePair<ItemStack, Integer> y : aItemMap) {
+ // Iterate over the 'inputs', we can safely remove these as we go.
+ outputItems:
+ for (FlexiblePair<ItemStack, Integer> u : aInputMap) {
+ // Create local vars for readability.
+ ItemStack aOutputBusStack = y.getKey();
+ ItemStack aOutputStack = u.getKey();
+ // Stacks match, including NBT.
+ if (GT_Utility.areStacksEqual(aOutputBusStack, aOutputStack, false)) {
+ // Stack Matches, but it's full, continue.
+ if (aOutputBusStack.stackSize >= 64) {
+ // This stack is full, no point checking it.
+ continue busItems;
+ } else {
+ // We can merge these two stacks without any hassle.
+ if ((aOutputBusStack.stackSize + aOutputStack.stackSize) <= 64) {
+ // Update the stack size in the bus storage map.
+ y.setValue(aOutputBusStack.stackSize + aOutputStack.stackSize);
+ // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
+ aInputMap.remove(u);
+ continue outputItems;
+ }
+ // Stack merging is too much, so we fill this stack, leave the remainder.
+ else {
+ int aRemainder = (aOutputBusStack.stackSize + aOutputStack.stackSize) - 64;
+ // Update the stack size in the bus storage map.
+ y.setValue(64);
+ // Create a new object to iterate over later, with the remainder data;
+ FlexiblePair<ItemStack, Integer> t =
+ new FlexiblePair<ItemStack, Integer>(u.getKey(), aRemainder);
+ // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
+ aInputMap.remove(u);
+ // Add the remainder stack.
+ aInputMap.add(t);
+ continue outputItems;
+ }
+ }
+ } else {
+ continue outputItems;
+ }
+ }
+ }
+ }
+
+ // We have stacks that did not merge, do we have space for them?
+ if (aInputMap.size() > 0) {
+ if (aInputMap.size() > aInputBusSlotsFree) {
+ aParallelRecipes =
+ (int) Math.floor((double) aInputBusSlotsFree / aInputMap.size() * aParallelRecipes);
+ // We do not have enough free slots in total to accommodate the remaining managed stacks.
+ log(" Free: " + aInputBusSlotsFree + ", Required: " + aInputMap.size());
+ if (aParallelRecipes == 0) {
+ log("Failed to find enough space for all item outputs.");
+ return 0;
+ }
+ }
+ }
+
+ /*
+ * End Item Management
+ */
+
+ }
+
+ /* ========================================
+ * Fluid Management
+ * ========================================
+ */
+
+ if (aDoesOutputFluids) {
+ log("We have Fluids to output.");
+ // How many slots are free across all the output buses?
+ int aFluidHatches = 0;
+ int aEmptyFluidHatches = 0;
+ int aFullFluidHatches = 0;
+ // Create Map for Fluid Output
+ ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches =
+ new ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>();
+ for (final GT_MetaTileEntity_Hatch_Output tBus : this.mOutputHatches) {
+ if (!isValidMetaTileEntity(tBus)) {
+ continue;
+ }
+ aFluidHatches++;
+ // Map the Hatch with the space left for easy checking later.
+ if (tBus.getFluid() == null) {
+ aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(
+ tBus, null, tBus.getCapacity()));
+ } else {
+ int aSpaceLeft = tBus.getCapacity() - tBus.getFluidAmount();
+ aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(
+ tBus, tBus.getFluid(), aSpaceLeft));
+ }
+ }
+ // Create a map of all the fluids we would like to output, we can iterate over this and see how many we can
+ // merge into existing hatch stacks.
+ ArrayList<FluidStack> aOutputFluids = new ArrayList<FluidStack>();
+ // Ugly ass boxing
+ aOutputFluids.addAll(new AutoMap<FluidStack>(aFluidOutputs));
+ // Iterate the Hatches, updating their 'stored' data.
+ // for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aHatchData : aOutputHatches) {
+ for (int i = 0; i < aOutputHatches.size(); i++) {
+ // The Hatch Itself
+ GT_MetaTileEntity_Hatch_Output aHatch = aOutputHatches.get(i).getValue_1();
+ // Fluid in the Hatch
+ FluidStack aHatchStack = aOutputHatches.get(i).getValue_2();
+ // Space left in Hatch
+ int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount();
+ // Hatch is full,
+ if (aSpaceLeftInHatch <= 0) {
+ aFullFluidHatches++;
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
+ continue;
+ }
+ // Hatch has space
+ else {
+ // Check if any fluids match
+ // aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) {
+ for (int j = 0; j < getOutputFluidCount(aFluidOutputs); j++) {
+ // log(" aHatchStack "+aHatchStack.getLocalizedName()+" aOutput stack
+ // "+aOutputStack.getLocalizedName());
+ if (GT_Utility.areFluidsEqual(aHatchStack, aOutputFluids.get(j))) {
+ int aFluidToPutIntoHatch = aOutputFluids.get(j).amount * aParallelRecipes;
+ // Not Enough space to insert all of the fluid.
+ // We fill this hatch and add a smaller Fluidstack back to the iterator.
+ if (aSpaceLeftInHatch < aFluidToPutIntoHatch) {
+ // Copy existing Hatch Stack
+ FluidStack aNewHatchStack = aHatchStack.copy();
+ aNewHatchStack.amount = 0;
+ // Copy existing Hatch Stack again
+ FluidStack aNewOutputStack = aHatchStack.copy();
+ aNewOutputStack.amount = 0;
+ // How much fluid do we have left after we fill the hatch?
+ int aFluidLeftAfterInsert = aFluidToPutIntoHatch - aSpaceLeftInHatch;
+ // Set new stacks to appropriate values
+ aNewHatchStack.amount = aHatch.getCapacity();
+ aNewOutputStack.amount = aFluidLeftAfterInsert;
+ // Remove fluid from output list, merge success
+ aOutputFluids.remove(aOutputFluids.get(j));
+ j--;
+ // Remove hatch from hatch list, data is now invalid.
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
+ // Add remaining Fluid to Output list
+ aOutputFluids.add(aNewOutputStack);
+ // Re-add hatch to hatch list, with new data.
+ // Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new
+ // Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack,
+ // aNewHatchStack.amount);
+ // aOutputHatches.add(aNewHatchData);
+ break;
+ }
+ // We can fill this hatch perfectly (rare case), may as well add it directly to the full
+ // list.
+ else if (aSpaceLeftInHatch == aFluidToPutIntoHatch) {
+ // Copy Old Stack
+ FluidStack aNewHatchStack = aHatchStack.copy();
+ // Add in amount from output stack
+ aNewHatchStack.amount += aFluidToPutIntoHatch;
+ // Remove fluid from output list, merge success
+ aOutputFluids.remove(aOutputFluids.get(j));
+ j--;
+ // Remove hatch from hatch list, data is now invalid.
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
+ // Re-add hatch to hatch list, with new data.
+ Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData =
+ new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(
+ aHatch, aNewHatchStack, aNewHatchStack.amount);
+ aOutputHatches.add(aNewHatchData);
+ break;
+ }
+ // We have more space than we need to merge, so we remove the stack from the output list and
+ // update the hatch list.
+ else {
+ // Copy Old Stack
+ FluidStack aNewHatchStack = aHatchStack.copy();
+ // Add in amount from output stack
+ aNewHatchStack.amount += aFluidToPutIntoHatch;
+ // Remove fluid from output list, merge success
+ aOutputFluids.remove(aOutputFluids.get(j));
+ j--;
+ // Remove hatch from hatch list, data is now invalid.
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
+ // Re-add hatch to hatch list, with new data.
+ Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData =
+ new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(
+ aHatch, aNewHatchStack, aNewHatchStack.amount);
+ aOutputHatches.add(aNewHatchData);
+ // Check next fluid
+ continue;
+ }
+
+ } else {
+ continue;
+ }
+ }
+ }
+ }
+
+ for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aFreeHatchCheck : aOutputHatches) {
+ // Free Hatch
+ if (aFreeHatchCheck.getValue_2() == null
+ || aFreeHatchCheck.getValue_3() == 0
+ || aFreeHatchCheck.getValue_1().getFluid() == null) {
+ aEmptyFluidHatches++;
+ }
+ }
+
+ // We have Fluid Stacks we did not merge. Do we have space?
+ log("fluids to output " + aOutputFluids.size() + " empty hatches " + aEmptyFluidHatches);
+ if (aOutputFluids.size() > 0) {
+ // Not enough space to add fluids.
+ if (aOutputFluids.size() > aEmptyFluidHatches) {
+ aParallelRecipes =
+ (int) Math.floor((double) aEmptyFluidHatches / aOutputFluids.size() * aParallelRecipes);
+ log("Failed to find enough space for all fluid outputs. Free: " + aEmptyFluidHatches
+ + ", Required: " + aOutputFluids.size());
+ return 0;
+ }
+ }
+
+ /*
+ * End Fluid Management
+ */
+ }
+
+ return aParallelRecipes;
+ }
+
+ /*
+ * Handle I/O with custom hatches
+ */
+
+ @Override
public boolean depleteInput(FluidStack aLiquid) {
if (aLiquid == null) return false;
for (GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : mSteamInputFluids) {
@@ -696,14 +704,15 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
return false;
}
- @Override
+ @Override
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_CustomFluidBase tHatch : mSteamInputFluids) {
if (isValidMetaTileEntity(tHatch)) {
- if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) {
+ 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;
@@ -715,7 +724,8 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
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 (GT_Utility.areStacksEqual(
+ aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) {
if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
return true;
@@ -727,7 +737,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
return false;
}
- @Override
+ @Override
public ArrayList<FluidStack> getStoredFluids() {
ArrayList<FluidStack> rList = new ArrayList<FluidStack>();
for (GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : mSteamInputFluids) {
@@ -738,7 +748,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
return rList;
}
- @Override
+ @Override
public ArrayList<ItemStack> getStoredInputs() {
ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
for (GT_MetaTileEntity_Hatch_Steam_BusInput tHatch : mSteamInputs) {
@@ -746,7 +756,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
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));
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
}
}
}
@@ -754,7 +764,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
return rList;
}
- @Override
+ @Override
public boolean addOutput(ItemStack aStack) {
if (GT_Utility.isStackInvalid(aStack)) return false;
aStack = GT_Utility.copy(aStack);
@@ -778,7 +788,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
return outputSuccess;
}
- @Override
+ @Override
public ArrayList<ItemStack> getStoredOutputs() {
ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
for (GT_MetaTileEntity_Hatch_Steam_BusOutput tHatch : mSteamOutputs) {
@@ -791,13 +801,11 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
return rList;
}
- @Override
+ @Override
public void updateSlots() {
for (GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : mSteamInputFluids)
if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
for (GT_MetaTileEntity_Hatch_Steam_BusInput tHatch : mSteamInputs)
if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
}
-
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java
index 287d2105ac..473b2ad538 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java
@@ -2,427 +2,478 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generat
import static gregtech.api.enums.GT_Values.V;
-import java.util.Collection;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-
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 gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeTank;
+import java.util.Collection;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_DeluxeTank {
- private boolean useFuel = false;
-
- public GregtechDoubleFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 4, aDescription, aTextures);
- }
-
- public GregtechDoubleFuelGeneratorBase(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, 4, aDescription, aTextures);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.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[]{this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%"};
- }
-
-
- /* @Override
+ private boolean useFuel = false;
+
+ public GregtechDoubleFuelGeneratorBase(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 4, aDescription, aTextures);
+ }
+
+ public GregtechDoubleFuelGeneratorBase(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 4, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.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[] {this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%"};
+ }
+
+ /* @Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
if (aBaseMetaTileEntity.isClientSide()) return true;
aBaseMetaTileEntity.openGUI(aPlayer);
return true;
}*/
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()){
- Logger.WARNING("Entity is Client side, simply returning true");
- return true;
- }
- Logger.WARNING("Entity is not Client side, opening entity Container and by extension, it's GUI, then returning true");
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFront(aColor);
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
- }
-
- @Override
- public boolean isFacingValid(final byte aSide) {
- return aSide > 1;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < 2;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public long maxEUOutput() {
- return this.getBaseMetaTileEntity().isAllowedToWork() ? V[this.mTier] : 0;
- }
-
- @Override
- public long maxEUStore() {
- return Math.max(this.getEUVar(), (V[this.mTier] * 115) + this.getMinimumStoredEU());
- }
-
- @Override
- public boolean doesFillContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- @Override
- public boolean canTankBeFilled() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- @Override
- public boolean displaysItemStack() {
- return true;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return this.getFuelValue(aFluid) > 0;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 512;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && ((aTick % 10) == 0)) {
- if (this.mFluid == null) {
- if (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + this.getMinimumStoredEU())) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- } else {
- if (this.mInventory[this.getStackDisplaySlot()] == null) {
- this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- }
- this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
- }
- } else {
- if ((this.mFluid != null) && (this.mFluid2 != null)){
- final int tFuelValue = this.getFuelValue(this.mFluid), tConsumed = this.consumedFluidPerOperation(this.mFluid);
- final int tFuelValue2 = this.getFuelValue(this.mFluid2), tConsumed2 = this.consumedFluidPerOperation(this.mFluid2);
- if (((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount > tConsumed))/* && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)*/) {
-
- Logger.WARNING("tFuelValue: "+tFuelValue);
- Logger.WARNING("tConsumed: "+tConsumed);
- Logger.WARNING("mFluid.name: "+this.mFluid.getFluid().getName());
- Logger.WARNING("mFluid.amount: "+this.mFluid.amount);
- Logger.WARNING("mFluid.amount > tConsumed: "+(this.mFluid.amount > tConsumed));
-
- Logger.WARNING("=========================================================");
-
- Logger.WARNING("tFuelValue2: "+tFuelValue2);
- Logger.WARNING("tConsumed2: "+tConsumed2);
- Logger.WARNING("mFluid2.name: "+this.mFluid2.getFluid().getName());
- Logger.WARNING("mFluid2.amount: "+this.mFluid2.amount);
- Logger.WARNING("mFluid2.amount > tConsumed2: "+(this.mFluid2.amount > tConsumed2));
- long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed, (((this.maxEUOutput() * 30) + this.getMinimumStoredEU()) - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
- long tFluidAmountToUse2 = Math.min(this.mFluid2.amount / tConsumed2, (((this.maxEUOutput() * 30) + this.getMinimumStoredEU()) - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2);
-
- if (tFluidAmountToUse <= 0){
- /*if ((mFluid.amount / tConsumed) == getCapacity()){
- tFluidAmountToUse = 1;
- }*/
-
- if (aBaseMetaTileEntity.getUniversalEnergyStored() <= (aBaseMetaTileEntity.getEUCapacity()-aBaseMetaTileEntity.getUniversalEnergyStored())){
- tFluidAmountToUse = 1;
- Logger.WARNING("=========================================================");
- Logger.WARNING("tFluidAmountToUse - Updated: "+tFluidAmountToUse);
- Logger.WARNING("=========================================================");
- }
- }
-
- if (tFluidAmountToUse2 <= 0){
- /*if ((mFluid2.amount / tConsumed) == getCapacity()){
- tFluidAmountToUse2 = 1;
- }*/
- if (aBaseMetaTileEntity.getUniversalEnergyStored() <= (aBaseMetaTileEntity.getEUCapacity()-aBaseMetaTileEntity.getUniversalEnergyStored())){
- tFluidAmountToUse2 = 1;
- Logger.WARNING("=========================================================");
- Logger.WARNING("tFluidAmountToUse2 - Updated: "+tFluidAmountToUse2);
- Logger.WARNING("=========================================================");
- }
- }
-
- Logger.WARNING("=========================================================");
- Logger.WARNING("tFluidAmountToUse: "+tFluidAmountToUse);
- Logger.WARNING("=========================================================");
-
- /*Utils.LOG_WARNING("mFluid.amount / tConsumed: "+("fluidAmount:"+mFluid.amount)+(" tConsumed:"+tConsumed)+" | "+(mFluid.amount / tConsumed));
- Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU()));
- Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput());
- Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30));
- Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU()));
- Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity.getUniversalEnergyStored()));
- Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored())));
- Utils.LOG_WARNING("tFuelValue: "+(tFuelValue));
- Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue));
- */
-
- Logger.WARNING("=========================================================");
- Logger.WARNING("tFluidAmountToUse2: "+tFluidAmountToUse2);
- Logger.WARNING("=========================================================");
-
- /*Utils.LOG_WARNING("mFluid2.amount / tConsumed2: "+("fluidAmount2:"+mFluid2.amount)+(" tConsumed2:"+tConsumed2)+" | "+(mFluid2.amount / tConsumed2));
- Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU()));
- Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput());
- Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30));
- Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU()));
- Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity.getUniversalEnergyStored()));
- Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored())));
- Utils.LOG_WARNING("tFuelValue2: "+(tFuelValue2));
- Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2));
- */
- if (((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) && ((tFluidAmountToUse2 > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse2 * tFuelValue2, true))){
-
- Logger.WARNING("tFuelValue: "+tFuelValue);
- Logger.WARNING("tConsumed: "+tConsumed);
- Logger.WARNING("mFluid.name: "+this.mFluid.getFluid().getName());
- Logger.WARNING("mFluid.amount: "+this.mFluid.amount);
- Logger.WARNING("mFluid.amount > tConsumed: "+(this.mFluid.amount > tConsumed));
-
- Logger.WARNING("=========================================================");
-
- Logger.WARNING("tFuelValue2: "+tFuelValue2);
- Logger.WARNING("tConsumed2: "+tConsumed2);
- Logger.WARNING("mFluid2.name: "+this.mFluid2.getFluid().getName());
- Logger.WARNING("mFluid2.amount: "+this.mFluid2.amount);
- Logger.WARNING("mFluid2.amount > tConsumed2: "+(this.mFluid2.amount > tConsumed2));
-
- if (this.useFuel){
- this.mFluid.amount -= tFluidAmountToUse * tConsumed;
- this.mFluid2.amount -= tFluidAmountToUse2 * tConsumed2;
- this.useFuel = false;
- }
- else {
- this.useFuel = true;
- }
-
- }
- else {
- Logger.WARNING("=========================================================");
- Logger.WARNING("Either tFluidAmountToUse1 <= 0, power cannot be increased of tFluidAmountToUse2 <= 0");
- Logger.WARNING("tFluidAmountToUse1: "+tFluidAmountToUse);
- Logger.WARNING("tFluidAmountToUse2: "+tFluidAmountToUse2);
- }
- }
- else {
- /*Utils.LOG_WARNING("(tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)");
- Utils.LOG_WARNING("tFuelValue: "+tFuelValue);
- Utils.LOG_WARNING("tConsumed: "+tConsumed);
- Utils.LOG_WARNING("mFluid.amount: "+mFluid.amount);
- Utils.LOG_WARNING("mFluid.amount > tConsumed: "+(mFluid.amount > tConsumed));
-
- Utils.LOG_WARNING("=========================================================");
-
- Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2);
- Utils.LOG_WARNING("tConsumed2: "+tConsumed2);
- Utils.LOG_WARNING("mFluid2.amount: "+mFluid2.amount);
- Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "+(mFluid2.amount > tConsumed2)); */
- }
- }
- else {
- Logger.WARNING("One mFluid is null");
- if (this.mFluid != null) {
- Logger.WARNING("mFluid1 is not null");
- }
- if (this.mFluid2 != null) {
- Logger.WARNING("mFluid2 is not null");
- }
- }
- }
- if ((this.mInventory[this.getInputSlot()] != null) && (aBaseMetaTileEntity.getUniversalEnergyStored() < ((this.maxEUOutput() * 20) + this.getMinimumStoredEU())) && (GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null)) {
- final int tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
- if (tFuelValue > 0) {
- final ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- }
- }
- }
- }
-
- if (aBaseMetaTileEntity.isServerSide()) {
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.getUniversalEnergyStored() >= (this.maxEUOutput() + this.getMinimumStoredEU())));
- }
- }
-
- public abstract GT_Recipe_Map getRecipes();
-
- public abstract int getEfficiency();
-
- public int consumedFluidPerOperation(final FluidStack aLiquid) {
- return 1;
- }
-
- public int getFuelValue(final FluidStack aLiquid) {
- if ((aLiquid == null) || (this.getRecipes() == null)) {
- return 0;
- }
- FluidStack tLiquid;
- final Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
- if (tRecipeList != null) {
- for (final GT_Recipe tFuel : tRecipeList) {
- if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) {
- if (aLiquid.isFluidEqual(tLiquid)) {
- return (int) (((long) tFuel.mSpecialValue * this.getEfficiency() * this.consumedFluidPerOperation(tLiquid)) / 100);
- }
- }
- }
- }
- return 0;
- }
-
- public int getFuelValue(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
- return 0;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
- if (tFuel != null) {
- return (int) ((tFuel.mSpecialValue * 1000L * this.getEfficiency()) / 100);
- }
- return 0;
- }
-
- public ItemStack getEmptyContainer(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
- return null;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.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(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && ((this.getFuelValue(aStack) > 0) || (this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0));
- }
-
- @Override
- public int getCapacity() {
- return 32000;
- }
-
- @Override
- public int getTankPressure() {
- return -100;
- }
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ Logger.WARNING("Entity is Client side, simply returning true");
+ return true;
+ }
+ Logger.WARNING(
+ "Entity is not Client side, opening entity Container and by extension, it's GUI, then returning true");
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return this.getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return this.getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return this.getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return this.getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return aIndex < 2;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return this.getBaseMetaTileEntity().isAllowedToWork() ? V[this.mTier] : 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Math.max(this.getEUVar(), (V[this.mTier] * 115) + this.getMinimumStoredEU());
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(final FluidStack aFluid) {
+ return this.getFuelValue(aFluid) > 0;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 512;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && ((aTick % 10) == 0)) {
+ if (this.mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + this.getMinimumStoredEU())) {
+ this.mInventory[this.getStackDisplaySlot()] = null;
+ } else {
+ if (this.mInventory[this.getStackDisplaySlot()] == null) {
+ this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ }
+ this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
+ + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ if ((this.mFluid != null) && (this.mFluid2 != null)) {
+ final int tFuelValue = this.getFuelValue(this.mFluid),
+ tConsumed = this.consumedFluidPerOperation(this.mFluid);
+ final int tFuelValue2 = this.getFuelValue(this.mFluid2),
+ tConsumed2 = this.consumedFluidPerOperation(this.mFluid2);
+ if (((tFuelValue > 0)
+ && (tConsumed > 0)
+ && (this.mFluid.amount
+ > tConsumed)) /* && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)*/) {
+
+ Logger.WARNING("tFuelValue: " + tFuelValue);
+ Logger.WARNING("tConsumed: " + tConsumed);
+ Logger.WARNING("mFluid.name: " + this.mFluid.getFluid().getName());
+ Logger.WARNING("mFluid.amount: " + this.mFluid.amount);
+ Logger.WARNING("mFluid.amount > tConsumed: " + (this.mFluid.amount > tConsumed));
+
+ Logger.WARNING("=========================================================");
+
+ Logger.WARNING("tFuelValue2: " + tFuelValue2);
+ Logger.WARNING("tConsumed2: " + tConsumed2);
+ Logger.WARNING(
+ "mFluid2.name: " + this.mFluid2.getFluid().getName());
+ Logger.WARNING("mFluid2.amount: " + this.mFluid2.amount);
+ Logger.WARNING("mFluid2.amount > tConsumed2: " + (this.mFluid2.amount > tConsumed2));
+ long tFluidAmountToUse = Math.min(
+ this.mFluid.amount / tConsumed,
+ (((this.maxEUOutput() * 30) + this.getMinimumStoredEU())
+ - aBaseMetaTileEntity.getUniversalEnergyStored())
+ / tFuelValue);
+ long tFluidAmountToUse2 = Math.min(
+ this.mFluid2.amount / tConsumed2,
+ (((this.maxEUOutput() * 30) + this.getMinimumStoredEU())
+ - aBaseMetaTileEntity.getUniversalEnergyStored())
+ / tFuelValue2);
+
+ if (tFluidAmountToUse <= 0) {
+ /*if ((mFluid.amount / tConsumed) == getCapacity()){
+ tFluidAmountToUse = 1;
+ }*/
+
+ if (aBaseMetaTileEntity.getUniversalEnergyStored()
+ <= (aBaseMetaTileEntity.getEUCapacity()
+ - aBaseMetaTileEntity.getUniversalEnergyStored())) {
+ tFluidAmountToUse = 1;
+ Logger.WARNING("=========================================================");
+ Logger.WARNING("tFluidAmountToUse - Updated: " + tFluidAmountToUse);
+ Logger.WARNING("=========================================================");
+ }
+ }
+
+ if (tFluidAmountToUse2 <= 0) {
+ /*if ((mFluid2.amount / tConsumed) == getCapacity()){
+ tFluidAmountToUse2 = 1;
+ }*/
+ if (aBaseMetaTileEntity.getUniversalEnergyStored()
+ <= (aBaseMetaTileEntity.getEUCapacity()
+ - aBaseMetaTileEntity.getUniversalEnergyStored())) {
+ tFluidAmountToUse2 = 1;
+ Logger.WARNING("=========================================================");
+ Logger.WARNING("tFluidAmountToUse2 - Updated: " + tFluidAmountToUse2);
+ Logger.WARNING("=========================================================");
+ }
+ }
+
+ Logger.WARNING("=========================================================");
+ Logger.WARNING("tFluidAmountToUse: " + tFluidAmountToUse);
+ Logger.WARNING("=========================================================");
+
+ /*Utils.LOG_WARNING("mFluid.amount / tConsumed: "+("fluidAmount:"+mFluid.amount)+(" tConsumed:"+tConsumed)+" | "+(mFluid.amount / tConsumed));
+ Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU()));
+ Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput());
+ Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30));
+ Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU()));
+ Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity.getUniversalEnergyStored()));
+ Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored())));
+ Utils.LOG_WARNING("tFuelValue: "+(tFuelValue));
+ Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue));
+ */
+
+ Logger.WARNING("=========================================================");
+ Logger.WARNING("tFluidAmountToUse2: " + tFluidAmountToUse2);
+ Logger.WARNING("=========================================================");
+
+ /*Utils.LOG_WARNING("mFluid2.amount / tConsumed2: "+("fluidAmount2:"+mFluid2.amount)+(" tConsumed2:"+tConsumed2)+" | "+(mFluid2.amount / tConsumed2));
+ Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU()));
+ Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput());
+ Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30));
+ Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU()));
+ Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity.getUniversalEnergyStored()));
+ Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored())));
+ Utils.LOG_WARNING("tFuelValue2: "+(tFuelValue2));
+ Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2));
+ */
+ if (((tFluidAmountToUse > 0)
+ && aBaseMetaTileEntity.increaseStoredEnergyUnits(
+ tFluidAmountToUse * tFuelValue, true))
+ && ((tFluidAmountToUse2 > 0)
+ && aBaseMetaTileEntity.increaseStoredEnergyUnits(
+ tFluidAmountToUse2 * tFuelValue2, true))) {
+
+ Logger.WARNING("tFuelValue: " + tFuelValue);
+ Logger.WARNING("tConsumed: " + tConsumed);
+ Logger.WARNING(
+ "mFluid.name: " + this.mFluid.getFluid().getName());
+ Logger.WARNING("mFluid.amount: " + this.mFluid.amount);
+ Logger.WARNING("mFluid.amount > tConsumed: " + (this.mFluid.amount > tConsumed));
+
+ Logger.WARNING("=========================================================");
+
+ Logger.WARNING("tFuelValue2: " + tFuelValue2);
+ Logger.WARNING("tConsumed2: " + tConsumed2);
+ Logger.WARNING(
+ "mFluid2.name: " + this.mFluid2.getFluid().getName());
+ Logger.WARNING("mFluid2.amount: " + this.mFluid2.amount);
+ Logger.WARNING("mFluid2.amount > tConsumed2: " + (this.mFluid2.amount > tConsumed2));
+
+ if (this.useFuel) {
+ this.mFluid.amount -= tFluidAmountToUse * tConsumed;
+ this.mFluid2.amount -= tFluidAmountToUse2 * tConsumed2;
+ this.useFuel = false;
+ } else {
+ this.useFuel = true;
+ }
+
+ } else {
+ Logger.WARNING("=========================================================");
+ Logger.WARNING(
+ "Either tFluidAmountToUse1 <= 0, power cannot be increased of tFluidAmountToUse2 <= 0");
+ Logger.WARNING("tFluidAmountToUse1: " + tFluidAmountToUse);
+ Logger.WARNING("tFluidAmountToUse2: " + tFluidAmountToUse2);
+ }
+ } else {
+ /*Utils.LOG_WARNING("(tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)");
+ Utils.LOG_WARNING("tFuelValue: "+tFuelValue);
+ Utils.LOG_WARNING("tConsumed: "+tConsumed);
+ Utils.LOG_WARNING("mFluid.amount: "+mFluid.amount);
+ Utils.LOG_WARNING("mFluid.amount > tConsumed: "+(mFluid.amount > tConsumed));
+
+ Utils.LOG_WARNING("=========================================================");
+
+ Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2);
+ Utils.LOG_WARNING("tConsumed2: "+tConsumed2);
+ Utils.LOG_WARNING("mFluid2.amount: "+mFluid2.amount);
+ Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "+(mFluid2.amount > tConsumed2)); */
+ }
+ } else {
+ Logger.WARNING("One mFluid is null");
+ if (this.mFluid != null) {
+ Logger.WARNING("mFluid1 is not null");
+ }
+ if (this.mFluid2 != null) {
+ Logger.WARNING("mFluid2 is not null");
+ }
+ }
+ }
+ if ((this.mInventory[this.getInputSlot()] != null)
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ < ((this.maxEUOutput() * 20) + this.getMinimumStoredEU()))
+ && (GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null)) {
+ final int tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
+ if (tFuelValue > 0) {
+ final ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ }
+ }
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ >= (this.maxEUOutput() + this.getMinimumStoredEU())));
+ }
+ }
+
+ public abstract GT_Recipe_Map getRecipes();
+
+ public abstract int getEfficiency();
+
+ public int consumedFluidPerOperation(final FluidStack aLiquid) {
+ return 1;
+ }
+
+ public int getFuelValue(final FluidStack aLiquid) {
+ if ((aLiquid == null) || (this.getRecipes() == null)) {
+ return 0;
+ }
+ FluidStack tLiquid;
+ final Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
+ if (tRecipeList != null) {
+ for (final GT_Recipe tFuel : tRecipeList) {
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) {
+ if (aLiquid.isFluidEqual(tLiquid)) {
+ return (int) (((long) tFuel.mSpecialValue
+ * this.getEfficiency()
+ * this.consumedFluidPerOperation(tLiquid))
+ / 100);
+ }
+ }
+ }
+ }
+ return 0;
+ }
+
+ public int getFuelValue(final ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
+ return 0;
+ }
+ final GT_Recipe tFuel =
+ this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null) {
+ return (int) ((tFuel.mSpecialValue * 1000L * this.getEfficiency()) / 100);
+ }
+ return 0;
+ }
+
+ public ItemStack getEmptyContainer(final ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
+ return null;
+ }
+ final GT_Recipe tFuel =
+ this.getRecipes().findRecipe(this.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(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)
+ && ((this.getFuelValue(aStack) > 0)
+ || (this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0));
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return -100;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java
index 99ad81a4a9..7333f5fb3d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -15,368 +10,360 @@ 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 gtPlusPlus.core.util.math.MathUtils;
+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.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
-public abstract class GregtechMetaBoilerBase 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 long RI = MathUtils.randLong(5L, 30L);
-
- public GregtechMetaBoilerBase(final int aID, final String aName, final String aNameRegional, final String aDescription, final ITexture... aTextures)
- {
- super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures);
- }
-
- public GregtechMetaBoilerBase(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures)
- {
- super(aName, aTier, 4, aDescription, aTextures);
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone)
- {
- ITexture[] tmp = this.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(final byte aFacing)
- {
- return aFacing > 1;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer)
- {
- return true;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex)
- {
- return true;
- }
-
- @Override
- public int getProgresstime()
- {
- return this.mTemperature;
- }
-
- @Override
- public int maxProgresstime()
- {
- return 500;
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer)
- {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- if (aPlayer != null) {
- if (GT_Utility.areStacksEqual(aPlayer.getCurrentEquippedItem(), new ItemStack(Items.water_bucket, 1)))
- {
- this.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(final FluidStack aFluid)
- {
- return GT_ModHandler.isWater(aFluid);
- }
-
- @Override
- public FluidStack getDrainableStack()
- {
- return this.mSteam;
- }
-
- @Override
- public FluidStack setDrainableStack(final FluidStack aFluid)
- {
- this.mSteam = aFluid;
- return this.mSteam;
- }
-
- @Override
- public boolean isDrainableStackSeparate() {
- return true;
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCover)
- {
- return GregTech_API.getCoverBehavior(aCover.toStack()).isSimpleCover();
- }
-
- @Override
- public void saveNBTData(final 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 (final Throwable e) {}
- }
- }
-
- @Override
- public void loadNBTData(final 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(final IGregTechTileEntity aBaseMetaTileEntity, final 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())
- {
- final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null)
- {
- final FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null)
- {
- final 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 > getSteamCapacity()))
- {
- this.sendSound((byte)1);
- this.mSteam.amount = getSteamCapacity() * 3 / 4;
- }
- 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
- // Since this type of machine can have different water and steam capacities, we need to override getTankInfo() to
- // support returning those different capacities.
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- return new FluidTankInfo[]{
- new FluidTankInfo(this.mFluid, getCapacity()),
- new FluidTankInfo(this.mSteam, getSteamCapacity())
- };
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack)
- {
- return (aIndex == 1) || (aIndex == 3);
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack)
- {
- return aIndex == 2;
- }
-
- @Override
- public void doSound(final byte aIndex, final double aX, final double aY, final 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++) {
- this.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;
- }
-
- // This type of machine can have different water and steam capacities.
- public int getSteamCapacity()
- {
- return 32000;
- }
-
- @Override
- public int getTankPressure()
- {
- return 100;
- }
+public abstract class GregtechMetaBoilerBase 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 long RI = MathUtils.randLong(5L, 30L);
+
+ public GregtechMetaBoilerBase(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final String aDescription,
+ final ITexture... aTextures) {
+ super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures);
+ }
+
+ public GregtechMetaBoilerBase(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 4, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ ITexture[] tmp =
+ this.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(final byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return true;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return this.mTemperature;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return 500;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ if (aPlayer != null) {
+ if (GT_Utility.areStacksEqual(aPlayer.getCurrentEquippedItem(), new ItemStack(Items.water_bucket, 1))) {
+ this.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(final FluidStack aFluid) {
+ return GT_ModHandler.isWater(aFluid);
+ }
+
+ @Override
+ public FluidStack getDrainableStack() {
+ return this.mSteam;
+ }
+
+ @Override
+ public FluidStack setDrainableStack(final FluidStack aFluid) {
+ this.mSteam = aFluid;
+ return this.mSteam;
+ }
+
+ @Override
+ public boolean isDrainableStackSeparate() {
+ return true;
+ }
+
+ @Override
+ public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCover) {
+ return GregTech_API.getCoverBehavior(aCover.toStack()).isSimpleCover();
+ }
+
+ @Override
+ public void saveNBTData(final 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 (final Throwable e) {
+ }
+ }
+ }
+
+ @Override
+ public void loadNBTData(final 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(final IGregTechTileEntity aBaseMetaTileEntity, final 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()) {
+ final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null) {
+ final FluidStack tDrained = aBaseMetaTileEntity.drain(
+ ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null) {
+ final 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 > getSteamCapacity())) {
+ this.sendSound((byte) 1);
+ this.mSteam.amount = getSteamCapacity() * 3 / 4;
+ }
+ 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
+ // Since this type of machine can have different water and steam capacities, we need to override getTankInfo() to
+ // support returning those different capacities.
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ return new FluidTankInfo[] {
+ new FluidTankInfo(this.mFluid, getCapacity()), new FluidTankInfo(this.mSteam, getSteamCapacity())
+ };
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return (aIndex == 1) || (aIndex == 3);
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return aIndex == 2;
+ }
+
+ @Override
+ public void doSound(final byte aIndex, final double aX, final double aY, final 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++) {
+ this.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;
+ }
+
+ // This type of machine can have different water and steam capacities.
+ public int getSteamCapacity() {
+ return 32000;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return 100;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java
index e692530963..258f6320ae 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java
@@ -2,214 +2,251 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generat
import static gregtech.api.enums.GT_Values.V;
-import net.minecraft.entity.player.EntityPlayer;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.EntityPlayer;
public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_BasicTank {
- public int mEfficiency;
- public int mProcessingEnergy = 0;
- public int mSolarCharge = 20;
- public int mLossTimer = 0;
- public static int sEnergyPerTick = 16;
-
- public GregtechMetaSolarGenerator(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
- }
-
- public GregtechMetaSolarGenerator(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.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[]{this.mDescription, "Efficiency: " + this.getEfficiency() + "%"};
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFront(aColor);
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
- }
-
- @Override
- public boolean isFacingValid(final byte aSide) {
- return aSide > 1;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < 2;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public long maxEUOutput() {
- return this.getBaseMetaTileEntity().isAllowedToWork() ? V[this.mTier] : 0;
- }
-
- @Override
- public long maxEUStore() {
- return Math.max(this.getEUVar(), (V[this.mTier] * 40) + this.getMinimumStoredEU());
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && (aTick > 20L)
- && (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()))) {
-
- if (this.mSolarCharge <= 20) {
- this.mSolarCharge = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 45) {
- this.mSolarCharge -= 1;
- this.mLossTimer = 0;
- }
-
- if ((aTick % 25L) == 0L) {
- if (this.mSolarCharge > 100) {
- if ((this.mProcessingEnergy > 0) && (aBaseMetaTileEntity.isAllowedToWork()) && ((aTick % 256L) == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering() && (aBaseMetaTileEntity.getUniversalEnergyStored() < ((this.maxEUOutput() * 20) + this.getMinimumStoredEU())))) {
- this.getBaseMetaTileEntity().increaseStoredEnergyUnits((sEnergyPerTick * this.getEfficiency()) / 10, false);
- }
- }
- }
-
- if ((this.mSolarCharge < 500) && (this.mProcessingEnergy > 0) && ((aTick % 12L) == 0L)) {
- this.mProcessingEnergy -= 1;
- this.mSolarCharge += 1;
- }
-
- if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && ((aTick % 256L) == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) {
- final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F);
- this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4)) || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
- }
-
- if (aBaseMetaTileEntity.isServerSide()){
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.getUniversalEnergyStored() >= (this.maxEUOutput() + this.getMinimumStoredEU())));
- }
- }
- }
-
- public abstract int getEfficiency();
-
- @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;
- }
+ public int mEfficiency;
+ public int mProcessingEnergy = 0;
+ public int mSolarCharge = 20;
+ public int mLossTimer = 0;
+ public static int sEnergyPerTick = 16;
+
+ public GregtechMetaSolarGenerator(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ }
+
+ public GregtechMetaSolarGenerator(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.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[] {this.mDescription, "Efficiency: " + this.getEfficiency() + "%"};
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return this.getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return this.getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return this.getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return this.getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return aIndex < 2;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return this.getBaseMetaTileEntity().isAllowedToWork() ? V[this.mTier] : 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Math.max(this.getEUVar(), (V[this.mTier] * 40) + this.getMinimumStoredEU());
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()
+ && aBaseMetaTileEntity.isAllowedToWork()
+ && (aTick > 20L)
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ < (this.maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()))) {
+
+ if (this.mSolarCharge <= 20) {
+ this.mSolarCharge = 20;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 45) {
+ this.mSolarCharge -= 1;
+ this.mLossTimer = 0;
+ }
+
+ if ((aTick % 25L) == 0L) {
+ if (this.mSolarCharge > 100) {
+ if ((this.mProcessingEnergy > 0)
+ && (aBaseMetaTileEntity.isAllowedToWork())
+ && ((aTick % 256L) == 0L)
+ && (!aBaseMetaTileEntity.getWorld().isThundering()
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ < ((this.maxEUOutput() * 20) + this.getMinimumStoredEU())))) {
+ this.getBaseMetaTileEntity()
+ .increaseStoredEnergyUnits((sEnergyPerTick * this.getEfficiency()) / 10, false);
+ }
+ }
+ }
+
+ if ((this.mSolarCharge < 500) && (this.mProcessingEnergy > 0) && ((aTick % 12L) == 0L)) {
+ this.mProcessingEnergy -= 1;
+ this.mSolarCharge += 1;
+ }
+
+ if ((this.mProcessingEnergy <= 0)
+ && (aBaseMetaTileEntity.isAllowedToWork())
+ && ((aTick % 256L) == 0L)
+ && (!aBaseMetaTileEntity.getWorld().isThundering())) {
+ final boolean bRain =
+ aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F);
+ this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4))
+ || !aBaseMetaTileEntity.getSkyAtSide((byte) 1)
+ ? 0
+ : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ >= (this.maxEUOutput() + this.getMinimumStoredEU())));
+ }
+ }
+ }
+
+ public abstract int getEfficiency();
+
+ @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/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
index f9105dceb1..fe7ffee685 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
@@ -2,8 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generat
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;
@@ -14,6 +12,7 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
+import java.util.Collection;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -21,352 +20,384 @@ import net.minecraftforge.fluids.FluidStack;
public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_BasicTank {
- private boolean useFuel = false;
- protected int pollMin, pollMax;
-
- public GregtechRocketFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
- int pollMin = (int)(CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
- int pollMax = (int)(CORE.ConfigSwitches.baseMaxPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
- }
-
- public GregtechRocketFuelGeneratorBase(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- int pollMin = (int)(CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
- int pollMax = (int)(CORE.ConfigSwitches.baseMaxPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.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() {
- String aPollution = "Causes between "+pollMin+" and "+pollMax+ " Pollution per second";
- return new String[]{
- this.mDescription,
- "Fuel Efficiency: " + this.getEfficiency() + "%",
- aPollution,
- CORE.GT_Tooltip};
- }
-
-
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFront(aColor);
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
- }
-
- @Override
- public boolean isFacingValid(final byte aSide) {
- return aSide > 1;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < 2;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return this.getBaseMetaTileEntity().getFrontFacing() == aSide;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public long maxEUOutput() {
- return V[this.mTier];
- }
-
- @Override
- public long maxEUStore() {
- return Math.max(this.getEUVar(), (V[this.mTier] * 500) + this.getMinimumStoredEU());
- }
-
- @Override
- public boolean doesFillContainers() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return true;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return true;
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return false;
- }
-
- @Override
- public boolean displaysItemStack() {
- return true;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return this.getFuelValue(aFluid) > 0;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
-
-
- //super.onPostTick(aBaseMetaTileEntity, aTick);
-
- /*if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
- int tFuelValue;
- if (this.mFluid == null) {
- if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- } else {
- if (this.mInventory[this.getStackDisplaySlot()] == null) {
- this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- }
-
- this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
- + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
- }
- } else {
- tFuelValue = this.getFuelValue(this.mFluid);
- int tConsumed = this.consumedFluidPerOperation(this.mFluid);
- if (tFuelValue > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) {
- long tFluidAmountToUse = Math.min((long) (this.mFluid.amount / tConsumed),
- (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
- if (tFluidAmountToUse > 0L && aBaseMetaTileEntity
- .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) {
- PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
- this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed);
- }
- }
- }
-
- if (this.mInventory[this.getInputSlot()] != null
- && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20L
- + this.getMinimumStoredEU()
- && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
- tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
- if (tFuelValue > 0) {
- ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
- }
- }
- }
- }
-
- if (aBaseMetaTileEntity.isServerSide()) {
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
- }*/
-
-
-
-
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && ((aTick % 10) == 0)) {
- if (this.mFluid == null) {
- if (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + this.getMinimumStoredEU())) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- } else {
- if (this.mInventory[this.getStackDisplaySlot()] == null) {
- this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- }
- this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
- }
- } else {
- final int tFuelValue = this.getFuelValue(this.mFluid), tConsumed = this.consumedFluidPerOperation(this.mFluid);
- if ((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount >= tConsumed)) {
- final long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed, (((this.maxEUOutput() * 20) + this.getMinimumStoredEU()) - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
- if ((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)){
- int aSafeFloor = (int) Math.max(((tFluidAmountToUse * tConsumed)/3), 1);
- this.mFluid.amount -= (int) aSafeFloor;
- PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution());
- }
- }
- }
- if ((this.mInventory[this.getInputSlot()] != null) && (aBaseMetaTileEntity.getUniversalEnergyStored() < ((this.maxEUOutput() * 20) + this.getMinimumStoredEU())) && (GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null)) {
- final int tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
- if (tFuelValue > 0) {
- final ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution());
- }
- }
- }
- }
-
- if (aBaseMetaTileEntity.isServerSide()) {
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.getUniversalEnergyStored() >= (this.maxEUOutput() + this.getMinimumStoredEU())));
- }
- }
-
- public int getPollution() {
- return MathUtils.randInt(pollMin, pollMax);
- }
-
- public abstract GT_Recipe_Map getRecipes();
-
- public abstract int getEfficiency();
-
- public int consumedFluidPerOperation(final FluidStack aLiquid) {
- return 1;
- }
-
- public int getFuelValue(final FluidStack aLiquid) {
- if ((aLiquid == null) || (this.getRecipes() == null)) {
- return 0;
- }
- FluidStack tLiquid;
- final Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
- if (tRecipeList != null) {
- //Logger.INFO("Step A");
- for (final GT_Recipe tFuel : tRecipeList) {
- //Logger.INFO("Step B");
- if ((tLiquid = tFuel.mFluidInputs[0]) != null) {
- //Logger.INFO("Step C");
- if (aLiquid.isFluidEqual(tLiquid)) {
- //Logger.INFO("Found some fuel?");
- int aperOp = this.consumedFluidPerOperation(tLiquid);
- int aConsume = (int) (((long) tFuel.mSpecialValue * this.getEfficiency() * aperOp) / 100);
- //Logger.INFO("Fuel Value: "+tFuel.mSpecialValue);
- //Logger.INFO("Efficiency: "+getEfficiency());
- //Logger.INFO("Consumed per op: "+aperOp);
- //Logger.INFO("Consuming "+aConsume);
- return aConsume;
- }
- }
- }
- }
- //Logger.INFO("No Fuel Value | Valid? "+(aLiquid != null));
- return 0;
- }
-
- public int getFuelValue(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
- return 0;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
- if (tFuel != null) {
- return (int) ((tFuel.mSpecialValue * 1000L * this.getEfficiency()) / 100);
- }
- return 0;
- }
-
- public ItemStack getEmptyContainer(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
- return null;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.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(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && ((this.getFuelValue(aStack) > 0) || (this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0));
- }
-
- @Override
- public int getCapacity() {
- return 32000;
- }
-
- @Override
- public int getTankPressure() {
- return -100;
- }
+ private boolean useFuel = false;
+ protected int pollMin, pollMax;
+
+ public GregtechRocketFuelGeneratorBase(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ int pollMin = (int) (CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator
+ * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
+ int pollMax = (int) (CORE.ConfigSwitches.baseMaxPollutionPerSecondRocketFuelGenerator
+ * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
+ }
+
+ public GregtechRocketFuelGeneratorBase(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ int pollMin = (int) (CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator
+ * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
+ int pollMax = (int) (CORE.ConfigSwitches.baseMaxPollutionPerSecondRocketFuelGenerator
+ * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.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() {
+ String aPollution = "Causes between " + pollMin + " and " + pollMax + " Pollution per second";
+ return new String[] {
+ this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%", aPollution, CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return this.getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return this.getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return this.getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return this.getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return aIndex < 2;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return this.getBaseMetaTileEntity().getFrontFacing() == aSide;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[this.mTier];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Math.max(this.getEUVar(), (V[this.mTier] * 500) + this.getMinimumStoredEU());
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(final FluidStack aFluid) {
+ return this.getFuelValue(aFluid) > 0;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+
+ // super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ /*if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
+ int tFuelValue;
+ if (this.mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
+ this.mInventory[this.getStackDisplaySlot()] = null;
+ } else {
+ if (this.mInventory[this.getStackDisplaySlot()] == null) {
+ this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ }
+
+ this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
+ + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ tFuelValue = this.getFuelValue(this.mFluid);
+ int tConsumed = this.consumedFluidPerOperation(this.mFluid);
+ if (tFuelValue > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) {
+ long tFluidAmountToUse = Math.min((long) (this.mFluid.amount / tConsumed),
+ (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
+ if (tFluidAmountToUse > 0L && aBaseMetaTileEntity
+ .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) {
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
+ this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed);
+ }
+ }
+ }
+
+ if (this.mInventory[this.getInputSlot()] != null
+ && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20L
+ + this.getMinimumStoredEU()
+ && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
+ tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
+ if (tFuelValue > 0) {
+ ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
+ }
+ }
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
+ .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
+ }*/
+
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && ((aTick % 10) == 0)) {
+ if (this.mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + this.getMinimumStoredEU())) {
+ this.mInventory[this.getStackDisplaySlot()] = null;
+ } else {
+ if (this.mInventory[this.getStackDisplaySlot()] == null) {
+ this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ }
+ this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
+ + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ final int tFuelValue = this.getFuelValue(this.mFluid),
+ tConsumed = this.consumedFluidPerOperation(this.mFluid);
+ if ((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount >= tConsumed)) {
+ final long tFluidAmountToUse = Math.min(
+ this.mFluid.amount / tConsumed,
+ (((this.maxEUOutput() * 20) + this.getMinimumStoredEU())
+ - aBaseMetaTileEntity.getUniversalEnergyStored())
+ / tFuelValue);
+ if ((tFluidAmountToUse > 0)
+ && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) {
+ int aSafeFloor = (int) Math.max(((tFluidAmountToUse * tConsumed) / 3), 1);
+ this.mFluid.amount -= (int) aSafeFloor;
+ PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution());
+ }
+ }
+ }
+ if ((this.mInventory[this.getInputSlot()] != null)
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ < ((this.maxEUOutput() * 20) + this.getMinimumStoredEU()))
+ && (GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null)) {
+ final int tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
+ if (tFuelValue > 0) {
+ final ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution());
+ }
+ }
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ >= (this.maxEUOutput() + this.getMinimumStoredEU())));
+ }
+ }
+
+ public int getPollution() {
+ return MathUtils.randInt(pollMin, pollMax);
+ }
+
+ public abstract GT_Recipe_Map getRecipes();
+
+ public abstract int getEfficiency();
+
+ public int consumedFluidPerOperation(final FluidStack aLiquid) {
+ return 1;
+ }
+
+ public int getFuelValue(final FluidStack aLiquid) {
+ if ((aLiquid == null) || (this.getRecipes() == null)) {
+ return 0;
+ }
+ FluidStack tLiquid;
+ final Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
+ if (tRecipeList != null) {
+ // Logger.INFO("Step A");
+ for (final GT_Recipe tFuel : tRecipeList) {
+ // Logger.INFO("Step B");
+ if ((tLiquid = tFuel.mFluidInputs[0]) != null) {
+ // Logger.INFO("Step C");
+ if (aLiquid.isFluidEqual(tLiquid)) {
+ // Logger.INFO("Found some fuel?");
+ int aperOp = this.consumedFluidPerOperation(tLiquid);
+ int aConsume = (int) (((long) tFuel.mSpecialValue * this.getEfficiency() * aperOp) / 100);
+ // Logger.INFO("Fuel Value: "+tFuel.mSpecialValue);
+ // Logger.INFO("Efficiency: "+getEfficiency());
+ // Logger.INFO("Consumed per op: "+aperOp);
+ // Logger.INFO("Consuming "+aConsume);
+ return aConsume;
+ }
+ }
+ }
+ }
+ // Logger.INFO("No Fuel Value | Valid? "+(aLiquid != null));
+ return 0;
+ }
+
+ public int getFuelValue(final ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
+ return 0;
+ }
+ final GT_Recipe tFuel =
+ this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null) {
+ return (int) ((tFuel.mSpecialValue * 1000L * this.getEfficiency()) / 100);
+ }
+ return 0;
+ }
+
+ public ItemStack getEmptyContainer(final ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
+ return null;
+ }
+ final GT_Recipe tFuel =
+ this.getRecipes().findRecipe(this.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(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)
+ && ((this.getFuelValue(aStack) > 0)
+ || (this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0));
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return -100;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
index 34b3e86c70..a76ed88a17 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
@@ -2,290 +2,310 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machine
import static gregtech.api.enums.GT_Values.V;
-import java.util.UUID;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.player.PlayerCache;
+import java.util.UUID;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_TieredMachineBlock {
- public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false;
- public int mSuccess = 0, mTargetStackSize = 0;
- public UUID ownerUUID;
- //UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
- private boolean value_last = false, value_current = false;
-
- public GregtechMetaSafeBlockBase(final int aID, final String aName, final String aNameRegional, final int aTier, final int aInvSlotCount, final String aDescription) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
- }
-
- public GregtechMetaSafeBlockBase(final String aName, final int aTier, final int aInvSlotCount, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[6][17][];
- final ITexture tIcon = this.getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST), tUp = new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT);
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tUp, tIcon}; //Back
- rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon}; // Right, Strangely The top side as well when facing East?
- rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon}; // Top And Bottom, When Facing South (What the hell?)
- rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon}; // Left, Top if facing West and Bottom if facing east?
- rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon}; // Top and Bottom when Facing North..
- rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tOut}; // Front
- }
- return rTextures;
-
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return this.mTextures[5][aColorIndex + 1];
- }
- if (GT_Utility.getOppositeSide(aSide) == aFacing) {
- return this.mTextures[0][aColorIndex + 1];
- }
- switch (aFacing) {
- case 0:
- return this.mTextures[4][aColorIndex + 1];
- case 1:
- return this.mTextures[2][aColorIndex + 1];
- case 2:
- switch (aSide) {
- case 0:
- return this.mTextures[2][aColorIndex + 1];
- case 1:
- return this.mTextures[2][aColorIndex + 1];
- case 4:
- return this.mTextures[1][aColorIndex + 1];
- case 5:
- return this.mTextures[3][aColorIndex + 1];
- }
- case 3:
- switch (aSide) {
- case 0:
- return this.mTextures[4][aColorIndex + 1];
- case 1:
- return this.mTextures[4][aColorIndex + 1];
- case 4:
- return this.mTextures[3][aColorIndex + 1];
- case 5:
- return this.mTextures[1][aColorIndex + 1];
- }
- case 4:
- switch (aSide) {
- case 0:
- return this.mTextures[3][aColorIndex + 1];
- case 1:
- return this.mTextures[1][aColorIndex + 1];
- case 2:
- return this.mTextures[3][aColorIndex + 1];
- case 3:
- return this.mTextures[1][aColorIndex + 1];
- }
- case 5:
- switch (aSide) {
- case 0:
- return this.mTextures[1][aColorIndex + 1];
- case 1:
- return this.mTextures[3][aColorIndex + 1];
- case 2:
- return this.mTextures[1][aColorIndex + 1];
- case 3:
- return this.mTextures[3][aColorIndex + 1];
- }
- }
- return this.mTextures[5][aColorIndex + 1];
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < (this.mInventory.length - 1);
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isInputFacing(final byte aSide) {
- return !this.isOutputFacing(aSide);
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return this.getBaseMetaTileEntity().getBackFacing() == aSide;
- }
-
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 512;
- }
-
- @Override
- public long maxEUStore() {
- return 512 + (V[this.mTier] * 50);
- }
-
- @Override
- public long maxEUInput() {
- return V[this.mTier];
- }
-
- @Override
- public long maxEUOutput() {
- return this.bOutput ? V[this.mTier] : 0;
- }
-
- @Override
- public long maxAmperesIn() {
- return 1;
- }
-
- @Override
- public long maxAmperesOut() {
- return 1;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- public abstract ITexture getOverlayIcon();
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
-
- if (aBaseMetaTileEntity.isClientSide()) {
- //Utils.LOG_WARNING("Clicky Clicky.");
- return true;
-
- }
- if (aPlayer != null) {
- final UUID tempUUID = aPlayer.getUniqueID();
- /*if (!aPlayer.worldObj.isRemote){
- //PlayerCache.appendParamChanges(aPlayer.getDisplayName(), aPlayer.getUniqueID().toString());
- }*/
- //Utils.LOG_INFO("test");
- if (this.ownerUUID == null){
- Logger.INFO("No owner yet for this block.");
- }
- else {
- //Utils.LOG_INFO("test");
- Logger.INFO("Current Owner: "+PlayerCache.lookupPlayerByUUID(this.ownerUUID)+" - UUID: "+this.ownerUUID);
- }
- Logger.WARNING("Is ownerUUID Null");
- if (this.ownerUUID == null){
- Logger.WARNING("OwnerUUID is Null, let's set it.");
- Logger.WARNING("Accessing Players UUID is: "+tempUUID);
- this.ownerUUID = tempUUID;
- //Utils.messagePlayer(aPlayer, "Owner of this safe, now set. Try accessing it again.");
- Logger.WARNING("Block Owner is now set to: "+this.ownerUUID);
- }
- Logger.WARNING("No, it is not.");
- Logger.WARNING("Checking ownerUUID.");
- if (this.ownerUUID != null){
- Logger.WARNING("ownerUUID != Null, if accessor == owner.");
- Logger.WARNING("Accessing is: "+PlayerCache.lookupPlayerByUUID(tempUUID));
- if (this.ownerUUID.equals(tempUUID)){
- Logger.WARNING("Owner's UUID: "+this.ownerUUID);
- aBaseMetaTileEntity.openGUI(aPlayer);
- //Utils.LOG_WARNING("GUI should now be open for you sir.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Access Denied, This does not belong to you.");
- PlayerUtils.messagePlayer(aPlayer, "it is owned by: "+PlayerCache.lookupPlayerByUUID(this.ownerUUID));
- Logger.WARNING("Expecting Player : "+PlayerCache.lookupPlayerByUUID(this.ownerUUID));
- Logger.ERROR("Access Denied.");
- return true;
- }
-
- }
-
- /*else {
- Utils.LOG_ERROR("This is NOT good. Tell Draknyte1 your safe broke.");
- }*/
- /*Utils.LOG_WARNING("Clicky Clicky.");
- Utils.messagePlayer(aPlayer, "Owner of this safe, now set.");
- aBaseMetaTileEntity.openGUI(aPlayer); */
-
- }
- return true;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setBoolean("bUnbreakable", this.bUnbreakable);
- aNBT.setBoolean("bOutput", this.bOutput);
- aNBT.setBoolean("bRedstoneIfFull", this.bRedstoneIfFull);
- aNBT.setInteger("mTargetStackSize", this.mTargetStackSize);
- if (this.ownerUUID != null) {
- aNBT.setString("ownerUUID", this.ownerUUID.toString());
- }
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.bUnbreakable = aNBT.getBoolean("bUnbreakable");
- this.bOutput = aNBT.getBoolean("bOutput");
- this.bRedstoneIfFull = aNBT.getBoolean("bRedstoneIfFull");
- this.mTargetStackSize = aNBT.getInteger("mTargetStackSize");
- if (aNBT.hasKey("ownerUUID")) {
- this.ownerUUID = UUID.fromString(aNBT.getString("ownerUUID"));
- }
- }
-
- @Override
- public void setItemNBT(final NBTTagCompound aNBT) {
- super.setItemNBT(aNBT);
- if (this.mTargetStackSize > 0) {
- aNBT.setInteger("mTargetStackSize", this.mTargetStackSize);
- }
- }
-
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return aSide != aBaseMetaTileEntity.getBackFacing();
- }
-} \ No newline at end of file
+ public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false;
+ public int mSuccess = 0, mTargetStackSize = 0;
+ public UUID ownerUUID;
+ // UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ private boolean value_last = false, value_current = false;
+
+ public GregtechMetaSafeBlockBase(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
+
+ public GregtechMetaSafeBlockBase(
+ final String aName,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription,
+ final ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[6][17][];
+ final ITexture tIcon = this.getOverlayIcon(),
+ tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST),
+ tUp = new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT);
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] =
+ new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tUp, tIcon}; // Back
+ rTextures[1][i + 1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon
+ }; // Right, Strangely The top side as well when facing East?
+ rTextures[2][i + 1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon
+ }; // Top And Bottom, When Facing South (What the hell?)
+ rTextures[3][i + 1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon
+ }; // Left, Top if facing West and Bottom if facing east?
+ rTextures[4][i + 1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon
+ }; // Top and Bottom when Facing North..
+ rTextures[5][i + 1] =
+ new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tOut}; // Front
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return this.mTextures[5][aColorIndex + 1];
+ }
+ if (GT_Utility.getOppositeSide(aSide) == aFacing) {
+ return this.mTextures[0][aColorIndex + 1];
+ }
+ switch (aFacing) {
+ case 0:
+ return this.mTextures[4][aColorIndex + 1];
+ case 1:
+ return this.mTextures[2][aColorIndex + 1];
+ case 2:
+ switch (aSide) {
+ case 0:
+ return this.mTextures[2][aColorIndex + 1];
+ case 1:
+ return this.mTextures[2][aColorIndex + 1];
+ case 4:
+ return this.mTextures[1][aColorIndex + 1];
+ case 5:
+ return this.mTextures[3][aColorIndex + 1];
+ }
+ case 3:
+ switch (aSide) {
+ case 0:
+ return this.mTextures[4][aColorIndex + 1];
+ case 1:
+ return this.mTextures[4][aColorIndex + 1];
+ case 4:
+ return this.mTextures[3][aColorIndex + 1];
+ case 5:
+ return this.mTextures[1][aColorIndex + 1];
+ }
+ case 4:
+ switch (aSide) {
+ case 0:
+ return this.mTextures[3][aColorIndex + 1];
+ case 1:
+ return this.mTextures[1][aColorIndex + 1];
+ case 2:
+ return this.mTextures[3][aColorIndex + 1];
+ case 3:
+ return this.mTextures[1][aColorIndex + 1];
+ }
+ case 5:
+ switch (aSide) {
+ case 0:
+ return this.mTextures[1][aColorIndex + 1];
+ case 1:
+ return this.mTextures[3][aColorIndex + 1];
+ case 2:
+ return this.mTextures[1][aColorIndex + 1];
+ case 3:
+ return this.mTextures[3][aColorIndex + 1];
+ }
+ }
+ return this.mTextures[5][aColorIndex + 1];
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return aIndex < (this.mInventory.length - 1);
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return !this.isOutputFacing(aSide);
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return this.getBaseMetaTileEntity().getBackFacing() == aSide;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 512;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 512 + (V[this.mTier] * 50);
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[this.mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return this.bOutput ? V[this.mTier] : 0;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 1;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public abstract ITexture getOverlayIcon();
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+
+ if (aBaseMetaTileEntity.isClientSide()) {
+ // Utils.LOG_WARNING("Clicky Clicky.");
+ return true;
+ }
+ if (aPlayer != null) {
+ final UUID tempUUID = aPlayer.getUniqueID();
+ /*if (!aPlayer.worldObj.isRemote){
+ //PlayerCache.appendParamChanges(aPlayer.getDisplayName(), aPlayer.getUniqueID().toString());
+ }*/
+ // Utils.LOG_INFO("test");
+ if (this.ownerUUID == null) {
+ Logger.INFO("No owner yet for this block.");
+ } else {
+ // Utils.LOG_INFO("test");
+ Logger.INFO("Current Owner: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID) + " - UUID: "
+ + this.ownerUUID);
+ }
+ Logger.WARNING("Is ownerUUID Null");
+ if (this.ownerUUID == null) {
+ Logger.WARNING("OwnerUUID is Null, let's set it.");
+ Logger.WARNING("Accessing Players UUID is: " + tempUUID);
+ this.ownerUUID = tempUUID;
+ // Utils.messagePlayer(aPlayer, "Owner of this safe, now set. Try accessing it again.");
+ Logger.WARNING("Block Owner is now set to: " + this.ownerUUID);
+ }
+ Logger.WARNING("No, it is not.");
+ Logger.WARNING("Checking ownerUUID.");
+ if (this.ownerUUID != null) {
+ Logger.WARNING("ownerUUID != Null, if accessor == owner.");
+ Logger.WARNING("Accessing is: " + PlayerCache.lookupPlayerByUUID(tempUUID));
+ if (this.ownerUUID.equals(tempUUID)) {
+ Logger.WARNING("Owner's UUID: " + this.ownerUUID);
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ // Utils.LOG_WARNING("GUI should now be open for you sir.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Access Denied, This does not belong to you.");
+ PlayerUtils.messagePlayer(
+ aPlayer, "it is owned by: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID));
+ Logger.WARNING("Expecting Player : " + PlayerCache.lookupPlayerByUUID(this.ownerUUID));
+ Logger.ERROR("Access Denied.");
+ return true;
+ }
+ }
+
+ /*else {
+ Utils.LOG_ERROR("This is NOT good. Tell Draknyte1 your safe broke.");
+ }*/
+ /*Utils.LOG_WARNING("Clicky Clicky.");
+ Utils.messagePlayer(aPlayer, "Owner of this safe, now set.");
+ aBaseMetaTileEntity.openGUI(aPlayer); */
+
+ }
+ return true;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setBoolean("bUnbreakable", this.bUnbreakable);
+ aNBT.setBoolean("bOutput", this.bOutput);
+ aNBT.setBoolean("bRedstoneIfFull", this.bRedstoneIfFull);
+ aNBT.setInteger("mTargetStackSize", this.mTargetStackSize);
+ if (this.ownerUUID != null) {
+ aNBT.setString("ownerUUID", this.ownerUUID.toString());
+ }
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.bUnbreakable = aNBT.getBoolean("bUnbreakable");
+ this.bOutput = aNBT.getBoolean("bOutput");
+ this.bRedstoneIfFull = aNBT.getBoolean("bRedstoneIfFull");
+ this.mTargetStackSize = aNBT.getInteger("mTargetStackSize");
+ if (aNBT.hasKey("ownerUUID")) {
+ this.ownerUUID = UUID.fromString(aNBT.getString("ownerUUID"));
+ }
+ }
+
+ @Override
+ public void setItemNBT(final NBTTagCompound aNBT) {
+ super.setItemNBT(aNBT);
+ if (this.mTargetStackSize > 0) {
+ aNBT.setInteger("mTargetStackSize", this.mTargetStackSize);
+ }
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return aSide != aBaseMetaTileEntity.getBackFacing();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java
index df838f012a..39d61acebc 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java
@@ -1,176 +1,199 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
public abstract class GregtechMetaTreeFarmerBase extends GT_MetaTileEntity_TieredMachineBlock {
- public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false;
- public int mSuccess = 0, mTargetStackSize = 0;
-
- public GregtechMetaTreeFarmerBase(final int aID, final String aName, final String aNameRegional, final int aTier, final int aInvSlotCount, final String aDescription) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
- }
-
- public GregtechMetaTreeFarmerBase(final String aName, final int aTier, final int aInvSlotCount, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return false;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return false;
- }
-
- @Override
- public boolean isEnetOutput() {
- return false;
- }
-
- @Override
- public boolean isInputFacing(final byte aSide) {
- return !this.isOutputFacing(aSide);
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return this.getBaseMetaTileEntity().getBackFacing() == aSide;
- }
-
- @Override
- public boolean isTeleporterCompatible() {
- 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 long maxAmperesIn() {
- return 0;
- }
-
- @Override
- public long maxAmperesOut() {
- return 0;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return false;
- }
-
- public abstract ITexture getOverlayIcon();
-
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager)};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager)};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log)};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Podzol)};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager)};
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFront(aColor);
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
- }
-} \ No newline at end of file
+ public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false;
+ public int mSuccess = 0, mTargetStackSize = 0;
+
+ public GregtechMetaTreeFarmerBase(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
+
+ public GregtechMetaTreeFarmerBase(
+ final String aName,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription,
+ final ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return !this.isOutputFacing(aSide);
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return this.getBaseMetaTileEntity().getBackFacing() == aSide;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ 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 long maxAmperesIn() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 0;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return false;
+ }
+
+ public abstract ITexture getOverlayIcon();
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager)};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager)};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log)};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Podzol)};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager)};
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return this.getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return this.getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return this.getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return this.getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return this.getSides(aColor);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java
index 5e0918059d..46666114c1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java
@@ -9,7 +9,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Hatch_Catalysts extends GT_MetaTileEntity_Hatch_NbtConsumable {
-
+
public GT_MetaTileEntity_Hatch_Catalysts(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 0, 16, "Dedicated Catalyst Storage", false);
}
@@ -17,55 +17,53 @@ public class GT_MetaTileEntity_Hatch_Catalysts extends GT_MetaTileEntity_Hatch_N
public GT_MetaTileEntity_Hatch_Catalysts(String aName, String aDescription, ITexture[][][] aTextures) {
super(aName, 0, 16, aDescription, false, aTextures);
}
-
+
public GT_MetaTileEntity_Hatch_Catalysts(String aName, String[] aDescription, ITexture[][][] aTextures) {
super(aName, 0, 16, aDescription[0], false, aTextures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst)};
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst)};
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst)};
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, CORE.GT_Tooltip};
}
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- CORE.GT_Tooltip};
- }
@Override
public boolean isFacingValid(byte aFacing) {
return true;
}
- @Override
- public Class<? extends GT_MetaTileEntity_Hatch_NbtConsumable> getHatchEntityClass() {
- return GT_MetaTileEntity_Hatch_Catalysts.class;
- }
+ @Override
+ public Class<? extends GT_MetaTileEntity_Hatch_NbtConsumable> getHatchEntityClass() {
+ return GT_MetaTileEntity_Hatch_Catalysts.class;
+ }
- @Override
- public String getNameGUI() {
- return "Catalyst Container";
- }
+ @Override
+ public String getNameGUI() {
+ return "Catalyst Container";
+ }
- @Override
- public AutoMap<ItemStack> getItemsValidForUsageSlots() {
- return new AutoMap<ItemStack>();
- }
+ @Override
+ public AutoMap<ItemStack> getItemsValidForUsageSlots() {
+ return new AutoMap<ItemStack>();
+ }
- @Override
- public boolean isItemValidForUsageSlot(ItemStack aStack) {
- return ItemUtils.isCatalyst(aStack);
- }
+ @Override
+ public boolean isItemValidForUsageSlot(ItemStack aStack) {
+ return ItemUtils.isCatalyst(aStack);
+ }
- @Override
- public int getInputSlotCount() {
- return 16;
- }
+ @Override
+ public int getInputSlotCount() {
+ return 16;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java
index 0f10272ad7..265088a9e0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java
@@ -9,7 +9,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Hatch_MillingBalls extends GT_MetaTileEntity_Hatch_NbtConsumable {
-
+
public GT_MetaTileEntity_Hatch_MillingBalls(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 6, 4, "Dedicated Milling Ball Storage", false);
}
@@ -17,55 +17,53 @@ public class GT_MetaTileEntity_Hatch_MillingBalls extends GT_MetaTileEntity_Hatc
public GT_MetaTileEntity_Hatch_MillingBalls(String aName, String aDescription, ITexture[][][] aTextures) {
super(aName, 6, 4, aDescription, false, aTextures);
}
-
+
public GT_MetaTileEntity_Hatch_MillingBalls(String aName, String[] aDescription, ITexture[][][] aTextures) {
super(aName, 6, 4, aDescription[0], false, aTextures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Milling_Balls)};
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Milling_Balls)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Milling_Balls)};
+ return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Milling_Balls)};
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, CORE.GT_Tooltip};
}
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- CORE.GT_Tooltip};
- }
@Override
public boolean isFacingValid(byte aFacing) {
return true;
}
- @Override
- public Class<? extends GT_MetaTileEntity_Hatch_NbtConsumable> getHatchEntityClass() {
- return GT_MetaTileEntity_Hatch_MillingBalls.class;
- }
+ @Override
+ public Class<? extends GT_MetaTileEntity_Hatch_NbtConsumable> getHatchEntityClass() {
+ return GT_MetaTileEntity_Hatch_MillingBalls.class;
+ }
- @Override
- public String getNameGUI() {
- return "Ball Housing";
- }
+ @Override
+ public String getNameGUI() {
+ return "Ball Housing";
+ }
- @Override
- public AutoMap<ItemStack> getItemsValidForUsageSlots() {
- return new AutoMap<ItemStack>();
- }
+ @Override
+ public AutoMap<ItemStack> getItemsValidForUsageSlots() {
+ return new AutoMap<ItemStack>();
+ }
- @Override
- public boolean isItemValidForUsageSlot(ItemStack aStack) {
- return ItemUtils.isMillingBall(aStack);
- }
+ @Override
+ public boolean isItemValidForUsageSlot(ItemStack aStack) {
+ return ItemUtils.isMillingBall(aStack);
+ }
- @Override
- public int getInputSlotCount() {
- return 4;
- }
+ @Override
+ public int getInputSlotCount() {
+ return 4;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java
index 552042a4c5..5d232836b4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers;
-import java.lang.reflect.Constructor;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -15,269 +13,308 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_HatchNbtConsumable;
import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_HatchNbtConsumable;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
+import java.lang.reflect.Constructor;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileEntity_Hatch {
- public GT_Recipe_Map mRecipeMap = null;
- private final int mInputslotCount;
- private final int mTotalSlotCount;
- private final boolean mAllowDuplicateUsageTypes;
-
- public GT_MetaTileEntity_Hatch_NbtConsumable(int aID, String aName, String aNameRegional, int aTier, int aInputSlots, String aDescription, boolean aAllowDuplicateTypes) {
- super(aID, aName, aNameRegional, aTier, aInputSlots*2, aDescription);
- mInputslotCount = getInputSlotCount();
- mTotalSlotCount = getInputSlotCount()*2;
- mAllowDuplicateUsageTypes = aAllowDuplicateTypes;
- }
-
- public GT_MetaTileEntity_Hatch_NbtConsumable(String aName, int aTier, int aInputSlots, String aDescription, boolean aAllowDuplicateTypes, ITexture[][][] aTextures) {
- super(aName, aTier, aInputSlots*2, aDescription, aTextures);
- mInputslotCount = getInputSlotCount();
- mTotalSlotCount = getInputSlotCount()*2;
- mAllowDuplicateUsageTypes = aAllowDuplicateTypes;
- }
-
- public GT_MetaTileEntity_Hatch_NbtConsumable(String aName, int aTier, int aInputSlots, String[] aDescription, boolean aAllowDuplicateTypes, ITexture[][][] aTextures) {
- super(aName, aTier, aInputSlots*2, aDescription, aTextures);
- mInputslotCount = getInputSlotCount();
- mTotalSlotCount = getInputSlotCount()*2;
- mAllowDuplicateUsageTypes = aAllowDuplicateTypes;
- }
-
- @Override
- public abstract ITexture[] getTexturesActive(ITexture aBaseTexture);
-
- @Override
- public abstract ITexture[] getTexturesInactive(ITexture aBaseTexture);
-
- public abstract int getInputSlotCount();
-
- @Override
- public final boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- @Override
- public final boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public final boolean isValidSlot(int aIndex) {
- return true;
- }
-
- @Override
- public final MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- Constructor<?> aConstructor = ReflectionUtils.getConstructor(getHatchEntityClass(), new Class[] {String.class, String[].class, ITexture[][][].class});
- GT_MetaTileEntity_Hatch_NbtConsumable aInstance = ReflectionUtils.createNewInstanceFromConstructor(aConstructor, new Object[] {mName, StaticFields59.getDescriptionArray(this), mTextures});
- if (aInstance instanceof GT_MetaTileEntity_Hatch_NbtConsumable) {
- GT_MetaTileEntity_Hatch_NbtConsumable aMetaTile = (GT_MetaTileEntity_Hatch_NbtConsumable) aInstance;
- return aMetaTile;
- }
- return null;
- }
-
- public abstract Class<? extends GT_MetaTileEntity_Hatch_NbtConsumable> getHatchEntityClass();
-
- @Override
- public final boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public final Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_HatchNbtConsumable(aPlayerInventory, aBaseMetaTileEntity, mInputslotCount);
- }
-
- @Override
- public final Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- CONTAINER_HatchNbtConsumable aContainer = new CONTAINER_HatchNbtConsumable(aPlayerInventory, aBaseMetaTileEntity, mInputslotCount);
- return new GUI_HatchNbtConsumable(aContainer, getNameGUI());
- }
-
- public abstract String getNameGUI();
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- validateUsageSlots();
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
- fillStacksIntoFirstSlots();
- tryFillUsageSlots();
- }
- }
-
- public final void updateSlots() {
- for (int i = 0; i < mInventory.length; i++) {
- if (mInventory[i] != null && mInventory[i].stackSize <= 0) {
- mInventory[i] = null;
- }
- // Only moves items in the first four slots
- if (i <= getSlotID_LastInput()) {
- fillStacksIntoFirstSlots();
- }
- }
- }
-
- protected void validateUsageSlots() {
- for (int i = getSlotID_FirstUsage(); i <= getSlotID_LastUsage(); i++) {
- if (mInventory[i] != null && mInventory[i].stackSize < 1) {
- mInventory[i] = null;
- this.markDirty();
- }
- }
- }
-
- // Only moves items in the first four slots
- protected final void fillStacksIntoFirstSlots() {
- for (int i = 0; i <= getSlotID_LastInput() ; i++) {
- for (int j = i + 1; j <= getSlotID_LastInput(); 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);
- }
- }
- }
- }
-
- public final void tryFillUsageSlots() {
- int aSlotSpace = (mInputslotCount - getContentUsageSlots().size());
- if (aSlotSpace > 0) {
- Logger.INFO("We have empty usage slots. "+aSlotSpace);
- for (int i=getSlotID_FirstInput();i<=getSlotID_LastInput();i++) {
- ItemStack aStackToTryMove = mInventory[i];
- if (aStackToTryMove != null && isItemValidForUsageSlot(aStackToTryMove)) {
- Logger.INFO("Trying to move stack from input slot "+i);
- if (moveItemFromStockToUsageSlots(aStackToTryMove)) {
- Logger.INFO("Updating Slots.");
- updateSlots();
- }
- }
- }
- }
- }
-
- private int getSlotID_FirstInput() {
- return 0;
- }
- private int getSlotID_LastInput() {
- return mInputslotCount-1;
- }
- private int getSlotID_FirstUsage() {
- return mInputslotCount;
- }
- private int getSlotID_LastUsage() {
- return mTotalSlotCount-1;
- }
-
-
- public final AutoMap<ItemStack> getContentUsageSlots() {
- AutoMap<ItemStack> aItems = new AutoMap<ItemStack>();
- for (int i=mInputslotCount;i<mTotalSlotCount;i++) {
- if (mInventory[i] != null) {
- aItems.add(mInventory[i]);
- }
- }
- return aItems;
- }
-
-
- public final boolean moveItemFromStockToUsageSlots(ItemStack aStack) {
- return moveItemFromStockToUsageSlots(aStack, mAllowDuplicateUsageTypes);
- }
-
- public final boolean moveItemFromStockToUsageSlots(ItemStack aStack, boolean aAllowMultiOfSameTypeInUsageSlots) {
- if (aStack != null) {
- if (aStack.stackSize > 0) {
-
- if (!isItemValidForUsageSlot(aStack)) {
- Logger.INFO("Stack not valid: "+ItemUtils.getItemName(aStack));
- return false;
- }
-
- // Copy the input stack into a new object
- ItemStack aStackToMove = aStack.copy();
- // Set stack size of stack to move to 1.
- aStackToMove.stackSize = 1;
- // Did we set a stack in the usage slots?
- boolean aDidSet = false;
- // Did we find another of this item already in the usage slots?
- boolean aFoundMatching = false;
- // Continue processing with our new stack
- // First check for duplicates
- for (int i = getSlotID_FirstUsage(); i <= getSlotID_LastUsage(); i++) {
- if (mInventory[i] != null) {
- if (GT_Utility.areStacksEqual(aStackToMove, mInventory[i], true)) {
- Logger.INFO("Found matching stack in slot "+i+".");
- aFoundMatching = true;
- break;
- }
- }
- }
- // Then Move stack to Usage slots
- for (int i = getSlotID_FirstUsage(); i <= getSlotID_LastUsage(); i++) {
- if (mInventory[i] == null) {
- if ((aFoundMatching && aAllowMultiOfSameTypeInUsageSlots) || !aFoundMatching) {
- mInventory[i] = aStackToMove;
- aDidSet = true;
- Logger.INFO("Moving new stack to usage slots.");
- break;
- }
- }
- }
- if (aDidSet) {
- Logger.INFO("Depleting input stack size by 1.");
- // Depleted one from the original input stack
- aStack.stackSize--;
- }
- return aDidSet;
- }
- }
- return false;
- }
-
- @Override
- public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aSide == getBaseMetaTileEntity().getFrontFacing() && isItemValidForUsageSlot(aStack) && aIndex < mInputslotCount;
- }
-
- /**
- * Items that get compared when checking for Usage Slot validity.
- * Can return an empty map if isItemValidForUsageSlot() is overridden.
- * @return
- */
- public abstract AutoMap<ItemStack> getItemsValidForUsageSlots();
-
- /**
- * Checks if the given item is valid for Usage Slots.
- * Can be overridden for easier handling if you already have methods to check this.
- * @param aStack
- * @return
- */
- public boolean isItemValidForUsageSlot(ItemStack aStack) {
- if (aStack != null) {
- for (ItemStack aValid : getItemsValidForUsageSlots()) {
- if (GT_Utility.areStacksEqual(aStack, aValid, true)) {
- return true;
- }
- }
- }
- return false;
- }
+ public GT_Recipe_Map mRecipeMap = null;
+ private final int mInputslotCount;
+ private final int mTotalSlotCount;
+ private final boolean mAllowDuplicateUsageTypes;
+
+ public GT_MetaTileEntity_Hatch_NbtConsumable(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInputSlots,
+ String aDescription,
+ boolean aAllowDuplicateTypes) {
+ super(aID, aName, aNameRegional, aTier, aInputSlots * 2, aDescription);
+ mInputslotCount = getInputSlotCount();
+ mTotalSlotCount = getInputSlotCount() * 2;
+ mAllowDuplicateUsageTypes = aAllowDuplicateTypes;
+ }
+
+ public GT_MetaTileEntity_Hatch_NbtConsumable(
+ String aName,
+ int aTier,
+ int aInputSlots,
+ String aDescription,
+ boolean aAllowDuplicateTypes,
+ ITexture[][][] aTextures) {
+ super(aName, aTier, aInputSlots * 2, aDescription, aTextures);
+ mInputslotCount = getInputSlotCount();
+ mTotalSlotCount = getInputSlotCount() * 2;
+ mAllowDuplicateUsageTypes = aAllowDuplicateTypes;
+ }
+
+ public GT_MetaTileEntity_Hatch_NbtConsumable(
+ String aName,
+ int aTier,
+ int aInputSlots,
+ String[] aDescription,
+ boolean aAllowDuplicateTypes,
+ ITexture[][][] aTextures) {
+ super(aName, aTier, aInputSlots * 2, aDescription, aTextures);
+ mInputslotCount = getInputSlotCount();
+ mTotalSlotCount = getInputSlotCount() * 2;
+ mAllowDuplicateUsageTypes = aAllowDuplicateTypes;
+ }
+
+ @Override
+ public abstract ITexture[] getTexturesActive(ITexture aBaseTexture);
+
+ @Override
+ public abstract ITexture[] getTexturesInactive(ITexture aBaseTexture);
+
+ public abstract int getInputSlotCount();
+
+ @Override
+ public final boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public final boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public final boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ @Override
+ public final MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ Constructor<?> aConstructor = ReflectionUtils.getConstructor(
+ getHatchEntityClass(), new Class[] {String.class, String[].class, ITexture[][][].class});
+ GT_MetaTileEntity_Hatch_NbtConsumable aInstance = ReflectionUtils.createNewInstanceFromConstructor(
+ aConstructor, new Object[] {mName, StaticFields59.getDescriptionArray(this), mTextures});
+ if (aInstance instanceof GT_MetaTileEntity_Hatch_NbtConsumable) {
+ GT_MetaTileEntity_Hatch_NbtConsumable aMetaTile = (GT_MetaTileEntity_Hatch_NbtConsumable) aInstance;
+ return aMetaTile;
+ }
+ return null;
+ }
+
+ public abstract Class<? extends GT_MetaTileEntity_Hatch_NbtConsumable> getHatchEntityClass();
+
+ @Override
+ public final boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public final Object getServerGUI(
+ int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_HatchNbtConsumable(aPlayerInventory, aBaseMetaTileEntity, mInputslotCount);
+ }
+
+ @Override
+ public final Object getClientGUI(
+ int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ CONTAINER_HatchNbtConsumable aContainer =
+ new CONTAINER_HatchNbtConsumable(aPlayerInventory, aBaseMetaTileEntity, mInputslotCount);
+ return new GUI_HatchNbtConsumable(aContainer, getNameGUI());
+ }
+
+ public abstract String getNameGUI();
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ validateUsageSlots();
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ fillStacksIntoFirstSlots();
+ tryFillUsageSlots();
+ }
+ }
+
+ public final void updateSlots() {
+ for (int i = 0; i < mInventory.length; i++) {
+ if (mInventory[i] != null && mInventory[i].stackSize <= 0) {
+ mInventory[i] = null;
+ }
+ // Only moves items in the first four slots
+ if (i <= getSlotID_LastInput()) {
+ fillStacksIntoFirstSlots();
+ }
+ }
+ }
+
+ protected void validateUsageSlots() {
+ for (int i = getSlotID_FirstUsage(); i <= getSlotID_LastUsage(); i++) {
+ if (mInventory[i] != null && mInventory[i].stackSize < 1) {
+ mInventory[i] = null;
+ this.markDirty();
+ }
+ }
+ }
+
+ // Only moves items in the first four slots
+ protected final void fillStacksIntoFirstSlots() {
+ for (int i = 0; i <= getSlotID_LastInput(); i++) {
+ for (int j = i + 1; j <= getSlotID_LastInput(); 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);
+ }
+ }
+ }
+ }
+
+ public final void tryFillUsageSlots() {
+ int aSlotSpace = (mInputslotCount - getContentUsageSlots().size());
+ if (aSlotSpace > 0) {
+ Logger.INFO("We have empty usage slots. " + aSlotSpace);
+ for (int i = getSlotID_FirstInput(); i <= getSlotID_LastInput(); i++) {
+ ItemStack aStackToTryMove = mInventory[i];
+ if (aStackToTryMove != null && isItemValidForUsageSlot(aStackToTryMove)) {
+ Logger.INFO("Trying to move stack from input slot " + i);
+ if (moveItemFromStockToUsageSlots(aStackToTryMove)) {
+ Logger.INFO("Updating Slots.");
+ updateSlots();
+ }
+ }
+ }
+ }
+ }
+
+ private int getSlotID_FirstInput() {
+ return 0;
+ }
+
+ private int getSlotID_LastInput() {
+ return mInputslotCount - 1;
+ }
+
+ private int getSlotID_FirstUsage() {
+ return mInputslotCount;
+ }
+
+ private int getSlotID_LastUsage() {
+ return mTotalSlotCount - 1;
+ }
+
+ public final AutoMap<ItemStack> getContentUsageSlots() {
+ AutoMap<ItemStack> aItems = new AutoMap<ItemStack>();
+ for (int i = mInputslotCount; i < mTotalSlotCount; i++) {
+ if (mInventory[i] != null) {
+ aItems.add(mInventory[i]);
+ }
+ }
+ return aItems;
+ }
+
+ public final boolean moveItemFromStockToUsageSlots(ItemStack aStack) {
+ return moveItemFromStockToUsageSlots(aStack, mAllowDuplicateUsageTypes);
+ }
+
+ public final boolean moveItemFromStockToUsageSlots(ItemStack aStack, boolean aAllowMultiOfSameTypeInUsageSlots) {
+ if (aStack != null) {
+ if (aStack.stackSize > 0) {
+
+ if (!isItemValidForUsageSlot(aStack)) {
+ Logger.INFO("Stack not valid: " + ItemUtils.getItemName(aStack));
+ return false;
+ }
+
+ // Copy the input stack into a new object
+ ItemStack aStackToMove = aStack.copy();
+ // Set stack size of stack to move to 1.
+ aStackToMove.stackSize = 1;
+ // Did we set a stack in the usage slots?
+ boolean aDidSet = false;
+ // Did we find another of this item already in the usage slots?
+ boolean aFoundMatching = false;
+ // Continue processing with our new stack
+ // First check for duplicates
+ for (int i = getSlotID_FirstUsage(); i <= getSlotID_LastUsage(); i++) {
+ if (mInventory[i] != null) {
+ if (GT_Utility.areStacksEqual(aStackToMove, mInventory[i], true)) {
+ Logger.INFO("Found matching stack in slot " + i + ".");
+ aFoundMatching = true;
+ break;
+ }
+ }
+ }
+ // Then Move stack to Usage slots
+ for (int i = getSlotID_FirstUsage(); i <= getSlotID_LastUsage(); i++) {
+ if (mInventory[i] == null) {
+ if ((aFoundMatching && aAllowMultiOfSameTypeInUsageSlots) || !aFoundMatching) {
+ mInventory[i] = aStackToMove;
+ aDidSet = true;
+ Logger.INFO("Moving new stack to usage slots.");
+ break;
+ }
+ }
+ }
+ if (aDidSet) {
+ Logger.INFO("Depleting input stack size by 1.");
+ // Depleted one from the original input stack
+ aStack.stackSize--;
+ }
+ return aDidSet;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public final boolean allowPullStack(
+ IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public final boolean allowPutStack(
+ IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing()
+ && isItemValidForUsageSlot(aStack)
+ && aIndex < mInputslotCount;
+ }
+
+ /**
+ * Items that get compared when checking for Usage Slot validity.
+ * Can return an empty map if isItemValidForUsageSlot() is overridden.
+ * @return
+ */
+ public abstract AutoMap<ItemStack> getItemsValidForUsageSlots();
+
+ /**
+ * Checks if the given item is valid for Usage Slots.
+ * Can be overridden for easier handling if you already have methods to check this.
+ * @param aStack
+ * @return
+ */
+ public boolean isItemValidForUsageSlot(ItemStack aStack) {
+ if (aStack != null) {
+ for (ItemStack aValid : getItemsValidForUsageSlots()) {
+ if (GT_Utility.areStacksEqual(aStack, aValid, true)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java
index fdf237bb11..5336b60fc7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java
@@ -12,7 +12,7 @@ import net.minecraft.block.Block;
@SuppressWarnings("deprecation")
public class GTPP_CopiedBlockTexture extends GT_CopiedBlockTexture {
- public GTPP_CopiedBlockTexture(Block aBlock, int aSide, int aMeta, short[] aRGBa, boolean aAllowAlpha) {
+ public GTPP_CopiedBlockTexture(Block aBlock, int aSide, int aMeta, short[] aRGBa, boolean aAllowAlpha) {
super(aBlock, aMeta, aMeta, aRGBa, aAllowAlpha);
}
@@ -23,5 +23,4 @@ public class GTPP_CopiedBlockTexture extends GT_CopiedBlockTexture {
public GTPP_CopiedBlockTexture(Block aBlock, int aSide, int aMeta) {
this(aBlock, aSide, aMeta, Dyes._NULL.mRGBa);
}
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java
index 562be6a8ef..6764a1e206 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java
@@ -12,7 +12,7 @@ import gregtech.api.objects.GT_RenderedTexture;
@SuppressWarnings("deprecation")
public class GTPP_RenderedTexture extends GT_RenderedTexture {
- public GTPP_RenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) {
+ public GTPP_RenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) {
super(aIcon, aRGBa, aAllowAlpha);
}
@@ -23,5 +23,4 @@ public class GTPP_RenderedTexture extends GT_RenderedTexture {
public GTPP_RenderedTexture(IIconContainer aIcon) {
this(aIcon, Dyes._NULL.mRGBa);
}
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
index 9cc0e3a315..40699aa108 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
@@ -1,28 +1,29 @@
package gtPlusPlus.xmod.gregtech.api.objects;
import gregtech.api.GregTech_API;
-
import gtPlusPlus.core.lib.CORE;
import net.minecraftforge.fluids.Fluid;
public class GregtechFluid extends Fluid implements Runnable {
- public final String mTextureName;
- private final short[] mRGBa;
+ public final String mTextureName;
+ private final short[] mRGBa;
- public GregtechFluid(final String aName, final String aTextureName, final short[] aRGBa) {
- super(aName);
- this.mRGBa = aRGBa;
- this.mTextureName = aTextureName;
- GregTech_API.sGTBlockIconload.add(this);
- }
+ public GregtechFluid(final String aName, final String aTextureName, final short[] aRGBa) {
+ super(aName);
+ this.mRGBa = aRGBa;
+ this.mTextureName = aTextureName;
+ GregTech_API.sGTBlockIconload.add(this);
+ }
- @Override
- public int getColor() {
- return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16) | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8) | Math.max(0, Math.min(255, this.mRGBa[2]));
- }
+ @Override
+ public int getColor() {
+ return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16)
+ | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8)
+ | Math.max(0, Math.min(255, this.mRGBa[2]));
+ }
- @Override
- public void run() {
- this.setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID+ ":" + "fluids/fluid." + this.mTextureName));
- }
-} \ No newline at end of file
+ @Override
+ public void run() {
+ this.setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + "fluids/fluid." + this.mTextureName));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
index eb5939caca..a26cfbb192 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
@@ -1,144 +1,151 @@
package gtPlusPlus.xmod.gregtech.api.objects;
-import java.util.*;
-
-import net.minecraft.item.ItemStack;
-
import gregtech.api.objects.GT_ArrayList;
-
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import java.util.*;
+import net.minecraft.item.ItemStack;
public class GregtechItemData {
- private static final GregtechMaterialStack[] EMPTY_GT_MaterialStack_ARRAY = new GregtechMaterialStack[0];
-
- public final List<Object> mExtraData = new GT_ArrayList<>(false, 1);
- public final GregtechOrePrefixes mPrefix;
- public final GregtechMaterialStack mMaterial;
- public final GregtechMaterialStack[] mByProducts;
- public boolean mBlackListed = false;
- public ItemStack mUnificationTarget = null;
-
- public GregtechItemData(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final boolean aBlackListed) {
- this.mPrefix = aPrefix;
- this.mMaterial = aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aPrefix.mMaterialAmount);
- this.mBlackListed = aBlackListed;
- this.mByProducts = (aPrefix.mSecondaryMaterial == null) || (aPrefix.mSecondaryMaterial.mMaterial == null) ? EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[]{aPrefix.mSecondaryMaterial.clone()};
- }
-
- public GregtechItemData(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial) {
- this(aPrefix, aMaterial, false);
- }
-
- public GregtechItemData(final GregtechMaterialStack aMaterial, final GregtechMaterialStack... aByProducts) {
- this.mPrefix = null;
- this.mMaterial = aMaterial.mMaterial == null ? null : aMaterial.clone();
- this.mBlackListed = true;
- if (aByProducts == null) {
- this.mByProducts = EMPTY_GT_MaterialStack_ARRAY;
- } else {
- final GregtechMaterialStack[] tByProducts = aByProducts.length < 1 ? EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[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();
- }
- }
- this.mByProducts = j > 0 ? new GregtechMaterialStack[j] : EMPTY_GT_MaterialStack_ARRAY;
- for (int i = 0; i < this.mByProducts.length; i++) {
- this.mByProducts[i] = tByProducts[i];
- }
- }
- }
-
- public GregtechItemData(final GT_Materials aMaterial, final long aAmount, final GregtechMaterialStack... aByProducts) {
- this(new GregtechMaterialStack(aMaterial, aAmount), aByProducts);
- }
-
- public GregtechItemData(final GT_Materials aMaterial, final long aAmount, final GT_Materials aByProduct, final long aByProductAmount) {
- this(new GregtechMaterialStack(aMaterial, aAmount), new GregtechMaterialStack(aByProduct, aByProductAmount));
- }
-
- public GregtechItemData(final GregtechItemData... aData) {
- this.mPrefix = null;
- this.mBlackListed = true;
-
- final ArrayList<GregtechMaterialStack> aList = new ArrayList<>(), rList = new ArrayList<>();
-
- for (final GregtechItemData tData : aData) {
- if (tData != null) {
- if (tData.hasValidMaterialData() && (tData.mMaterial.mAmount > 0)) {
- aList.add(tData.mMaterial.clone());
- }
- for (final GregtechMaterialStack tMaterial : tData.mByProducts) {
- if (tMaterial.mAmount > 0) {
- aList.add(tMaterial.clone());
- }
- }
- }
- }
-
- for (final GregtechMaterialStack aMaterial : aList) {
- boolean temp = true;
- for (final GregtechMaterialStack 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<GregtechMaterialStack>() {
- @Override
- public int compare(final GregtechMaterialStack a, final GregtechMaterialStack b) {
- return a.mAmount == b.mAmount ? 0 : a.mAmount > b.mAmount ? -1 : +1;
- }
- });
-
- if (rList.isEmpty()) {
- this.mMaterial = null;
- } else {
- this.mMaterial = rList.get(0);
- rList.remove(0);
- }
-
- this.mByProducts = rList.toArray(new GregtechMaterialStack[rList.size()]);
- }
-
- public boolean hasValidPrefixMaterialData() {
- return (this.mPrefix != null) && (this.mMaterial != null) && (this.mMaterial.mMaterial != null);
- }
-
- public boolean hasValidPrefixData() {
- return this.mPrefix != null;
- }
-
- public boolean hasValidMaterialData() {
- return (this.mMaterial != null) && (this.mMaterial.mMaterial != null);
- }
-
- public ArrayList<GregtechMaterialStack> getAllGT_MaterialStacks() {
- final ArrayList<GregtechMaterialStack> rList = new ArrayList<GregtechMaterialStack>();
- if (this.hasValidMaterialData()) {
- rList.add(this.mMaterial);
- }
- rList.addAll(Arrays.asList(this.mByProducts));
- return rList;
- }
-
- public GregtechMaterialStack getByProduct(final int aIndex) {
- return (aIndex >= 0) && (aIndex < this.mByProducts.length) ? this.mByProducts[aIndex] : null;
- }
-
- @Override
- public String toString() {
- if ((this.mPrefix == null) || (this.mMaterial == null) || (this.mMaterial.mMaterial == null)) {
- return "";
- }
- return this.mPrefix.name() + this.mMaterial.mMaterial.name();
- }
-} \ No newline at end of file
+ private static final GregtechMaterialStack[] EMPTY_GT_MaterialStack_ARRAY = new GregtechMaterialStack[0];
+
+ public final List<Object> mExtraData = new GT_ArrayList<>(false, 1);
+ public final GregtechOrePrefixes mPrefix;
+ public final GregtechMaterialStack mMaterial;
+ public final GregtechMaterialStack[] mByProducts;
+ public boolean mBlackListed = false;
+ public ItemStack mUnificationTarget = null;
+
+ public GregtechItemData(
+ final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final boolean aBlackListed) {
+ this.mPrefix = aPrefix;
+ this.mMaterial = aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aPrefix.mMaterialAmount);
+ this.mBlackListed = aBlackListed;
+ this.mByProducts = (aPrefix.mSecondaryMaterial == null) || (aPrefix.mSecondaryMaterial.mMaterial == null)
+ ? EMPTY_GT_MaterialStack_ARRAY
+ : new GregtechMaterialStack[] {aPrefix.mSecondaryMaterial.clone()};
+ }
+
+ public GregtechItemData(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial) {
+ this(aPrefix, aMaterial, false);
+ }
+
+ public GregtechItemData(final GregtechMaterialStack aMaterial, final GregtechMaterialStack... aByProducts) {
+ this.mPrefix = null;
+ this.mMaterial = aMaterial.mMaterial == null ? null : aMaterial.clone();
+ this.mBlackListed = true;
+ if (aByProducts == null) {
+ this.mByProducts = EMPTY_GT_MaterialStack_ARRAY;
+ } else {
+ final GregtechMaterialStack[] tByProducts = aByProducts.length < 1
+ ? EMPTY_GT_MaterialStack_ARRAY
+ : new GregtechMaterialStack[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();
+ }
+ }
+ this.mByProducts = j > 0 ? new GregtechMaterialStack[j] : EMPTY_GT_MaterialStack_ARRAY;
+ for (int i = 0; i < this.mByProducts.length; i++) {
+ this.mByProducts[i] = tByProducts[i];
+ }
+ }
+ }
+
+ public GregtechItemData(
+ final GT_Materials aMaterial, final long aAmount, final GregtechMaterialStack... aByProducts) {
+ this(new GregtechMaterialStack(aMaterial, aAmount), aByProducts);
+ }
+
+ public GregtechItemData(
+ final GT_Materials aMaterial,
+ final long aAmount,
+ final GT_Materials aByProduct,
+ final long aByProductAmount) {
+ this(new GregtechMaterialStack(aMaterial, aAmount), new GregtechMaterialStack(aByProduct, aByProductAmount));
+ }
+
+ public GregtechItemData(final GregtechItemData... aData) {
+ this.mPrefix = null;
+ this.mBlackListed = true;
+
+ final ArrayList<GregtechMaterialStack> aList = new ArrayList<>(), rList = new ArrayList<>();
+
+ for (final GregtechItemData tData : aData) {
+ if (tData != null) {
+ if (tData.hasValidMaterialData() && (tData.mMaterial.mAmount > 0)) {
+ aList.add(tData.mMaterial.clone());
+ }
+ for (final GregtechMaterialStack tMaterial : tData.mByProducts) {
+ if (tMaterial.mAmount > 0) {
+ aList.add(tMaterial.clone());
+ }
+ }
+ }
+ }
+
+ for (final GregtechMaterialStack aMaterial : aList) {
+ boolean temp = true;
+ for (final GregtechMaterialStack 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<GregtechMaterialStack>() {
+ @Override
+ public int compare(final GregtechMaterialStack a, final GregtechMaterialStack b) {
+ return a.mAmount == b.mAmount ? 0 : a.mAmount > b.mAmount ? -1 : +1;
+ }
+ });
+
+ if (rList.isEmpty()) {
+ this.mMaterial = null;
+ } else {
+ this.mMaterial = rList.get(0);
+ rList.remove(0);
+ }
+
+ this.mByProducts = rList.toArray(new GregtechMaterialStack[rList.size()]);
+ }
+
+ public boolean hasValidPrefixMaterialData() {
+ return (this.mPrefix != null) && (this.mMaterial != null) && (this.mMaterial.mMaterial != null);
+ }
+
+ public boolean hasValidPrefixData() {
+ return this.mPrefix != null;
+ }
+
+ public boolean hasValidMaterialData() {
+ return (this.mMaterial != null) && (this.mMaterial.mMaterial != null);
+ }
+
+ public ArrayList<GregtechMaterialStack> getAllGT_MaterialStacks() {
+ final ArrayList<GregtechMaterialStack> rList = new ArrayList<GregtechMaterialStack>();
+ if (this.hasValidMaterialData()) {
+ rList.add(this.mMaterial);
+ }
+ rList.addAll(Arrays.asList(this.mByProducts));
+ return rList;
+ }
+
+ public GregtechMaterialStack getByProduct(final int aIndex) {
+ return (aIndex >= 0) && (aIndex < this.mByProducts.length) ? this.mByProducts[aIndex] : null;
+ }
+
+ @Override
+ public String toString() {
+ if ((this.mPrefix == null) || (this.mMaterial == null) || (this.mMaterial.mMaterial == null)) {
+ return "";
+ }
+ return this.mPrefix.name() + this.mMaterial.mMaterial.name();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java
index 6ec5907256..107202a027 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java
@@ -3,47 +3,53 @@ package gtPlusPlus.xmod.gregtech.api.objects;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
public class GregtechMaterialStack implements Cloneable {
- public long mAmount;
- public GT_Materials mMaterial;
-
- public GregtechMaterialStack(final GT_Materials aMaterial, final long aAmount) {
- this.mMaterial = aMaterial == null ? GT_Materials._NULL : aMaterial;
- this.mAmount = aAmount;
- }
-
- public GregtechMaterialStack copy(final long aAmount) {
- return new GregtechMaterialStack(this.mMaterial, aAmount);
- }
-
- @Override
- public GregtechMaterialStack clone() {
- return new GregtechMaterialStack(this.mMaterial, this.mAmount);
- }
-
- @Override
- public boolean equals(final Object aObject) {
- if (aObject == this) {
- return true;
- }
- if (aObject == null) {
- return false;
- }
- if (aObject instanceof GT_Materials) {
- return aObject == this.mMaterial;
- }
- if (aObject instanceof GregtechMaterialStack) {
- return (((GregtechMaterialStack) aObject).mMaterial == this.mMaterial) && ((this.mAmount < 0) || (((GregtechMaterialStack) aObject).mAmount < 0) || (((GregtechMaterialStack) aObject).mAmount == this.mAmount));
- }
- return false;
- }
-
- @Override
- public String toString() {
- return ((this.mMaterial.mMaterialList.size() > 1) && (this.mAmount > 1) ? "(" : "") + this.mMaterial.getToolTip(true) + ((this.mMaterial.mMaterialList.size() > 1) && (this.mAmount > 1) ? ")" : "") + (this.mAmount > 1 ? this.mAmount : "");
- }
-
- @Override
- public int hashCode() {
- return this.mMaterial.hashCode();
- }
-} \ No newline at end of file
+ public long mAmount;
+ public GT_Materials mMaterial;
+
+ public GregtechMaterialStack(final GT_Materials aMaterial, final long aAmount) {
+ this.mMaterial = aMaterial == null ? GT_Materials._NULL : aMaterial;
+ this.mAmount = aAmount;
+ }
+
+ public GregtechMaterialStack copy(final long aAmount) {
+ return new GregtechMaterialStack(this.mMaterial, aAmount);
+ }
+
+ @Override
+ public GregtechMaterialStack clone() {
+ return new GregtechMaterialStack(this.mMaterial, this.mAmount);
+ }
+
+ @Override
+ public boolean equals(final Object aObject) {
+ if (aObject == this) {
+ return true;
+ }
+ if (aObject == null) {
+ return false;
+ }
+ if (aObject instanceof GT_Materials) {
+ return aObject == this.mMaterial;
+ }
+ if (aObject instanceof GregtechMaterialStack) {
+ return (((GregtechMaterialStack) aObject).mMaterial == this.mMaterial)
+ && ((this.mAmount < 0)
+ || (((GregtechMaterialStack) aObject).mAmount < 0)
+ || (((GregtechMaterialStack) aObject).mAmount == this.mAmount));
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return ((this.mMaterial.mMaterialList.size() > 1) && (this.mAmount > 1) ? "(" : "")
+ + this.mMaterial.getToolTip(true)
+ + ((this.mMaterial.mMaterialList.size() > 1) && (this.mAmount > 1) ? ")" : "")
+ + (this.mAmount > 1 ? this.mAmount : "");
+ }
+
+ @Override
+ public int hashCode() {
+ return this.mMaterial.hashCode();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java
index 976f21c329..ce73d1495f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java
@@ -1,22 +1,32 @@
package gtPlusPlus.xmod.gregtech.api.recipe;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.ToolDictNames;
import gregtech.api.interfaces.IOreRecipeRegistrator;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
+import net.minecraft.item.ItemStack;
public class ProcessingSkookumChoocherToolRecipes implements IOreRecipeRegistrator {
- public ProcessingSkookumChoocherToolRecipes() {
- //GregtechOrePrefixes.toolSkookumChoocher.add(this);
- }
+ public ProcessingSkookumChoocherToolRecipes() {
+ // GregtechOrePrefixes.toolSkookumChoocher.add(this);
+ }
- @Override
- public void registerOre(final OrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) {
- GT_ModHandler.addShapelessCraftingRecipe(MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(7734, 1, aMaterial, aMaterial, null), new Object[]{aOreDictName, OrePrefixes.stick.get(aMaterial), OrePrefixes.screw.get(aMaterial), ToolDictNames.craftingToolScrewdriver});
- }
+ @Override
+ public void registerOre(
+ final OrePrefixes aPrefix,
+ final Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ GT_ModHandler.addShapelessCraftingRecipe(
+ MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(7734, 1, aMaterial, aMaterial, null),
+ new Object[] {
+ aOreDictName,
+ OrePrefixes.stick.get(aMaterial),
+ OrePrefixes.screw.get(aMaterial),
+ ToolDictNames.craftingToolScrewdriver
+ });
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GTPP_Config.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GTPP_Config.java
index dcdc1220d0..ee4892e11a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GTPP_Config.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GTPP_Config.java
@@ -2,12 +2,10 @@ package gtPlusPlus.xmod.gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.GregTech_API;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-
+import net.minecraft.item.ItemStack;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
@@ -25,7 +23,8 @@ public class GTPP_Config implements Runnable {
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);
+ 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;
@@ -37,7 +36,9 @@ public class GTPP_Config implements Runnable {
if (rName != null) return rName.toString();
try {
if (GT_Utility.isStringValid(rName = aStack.getUnlocalizedName())) return rName.toString();
- } catch (Throwable e) {/*Do nothing*/}
+ } catch (Throwable e) {
+ /*Do nothing*/
+ }
String sName = aStack.getItem().toString();
String[] tmp = sName.split("@");
if (tmp.length > 0) sName = tmp[0];
@@ -51,7 +52,8 @@ public class GTPP_Config implements Runnable {
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);
+ 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;
@@ -63,7 +65,8 @@ public class GTPP_Config implements Runnable {
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);
+ 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;
@@ -75,7 +78,8 @@ public class GTPP_Config implements Runnable {
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);
+ 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;
@@ -87,7 +91,8 @@ public class GTPP_Config implements Runnable {
public String get(Object aCategory, String aName, String aDefault) {
if (GT_Utility.isStringInvalid(aName)) return aDefault;
- Property tProperty = mConfig.get(aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault);
+ Property tProperty = mConfig.get(
+ aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault);
String rResult = tProperty.getString();
if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save();
return rResult;
@@ -97,4 +102,4 @@ public class GTPP_Config implements Runnable {
public void run() {
mConfig.save();
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
index 3e0084139e..c5671b88b9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
@@ -1,5 +1,7 @@
package gtPlusPlus.xmod.gregtech.api.util;
+import static gregtech.api.enums.GT_Values.*;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Materials;
@@ -10,37 +12,32 @@ import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.ItemData;
import gregtech.api.objects.MaterialStack;
import gregtech.api.util.*;
-
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.oredict.OreDictionary;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-
-import static gregtech.api.enums.GT_Values.*;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
public class GregtechOreDictUnificator {
-
-
+
private static final Map<String, ItemStack> sName2StackMap = new HashMap<String, ItemStack>();
private static final Map<GT_ItemStack, ItemData> sItemStack2DataMap = new HashMap<GT_ItemStack, ItemData>();
- private static final Map<GT_ItemStack, List<ItemStack>> sUnificationTable = new HashMap<GT_ItemStack, List<ItemStack>>();
+ private static final Map<GT_ItemStack, List<ItemStack>> sUnificationTable =
+ new HashMap<GT_ItemStack, List<ItemStack>>();
private static final GT_HashSet<GT_ItemStack> sNoUnificationList = new GT_HashSet<GT_ItemStack>();
-
-
+
private static int isRegisteringOre = 0, isAddingOre = 0;
private static boolean mRunThroughTheList = true;
static {
- if (ReflectionUtils.getField(GT_OreDictUnificator.class, "sUnificationTable") == null) {
- GregTech_API.sItemStackMappings.add(sUnificationTable);
- }
+ if (ReflectionUtils.getField(GT_OreDictUnificator.class, "sUnificationTable") == null) {
+ GregTech_API.sItemStackMappings.add(sUnificationTable);
+ }
}
/**
@@ -64,14 +61,23 @@ public class GregtechOreDictUnificator {
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;
+ 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())))
+ if (aOverwrite
+ || GT_Utility.isStackInvalid(
+ sName2StackMap.get(aPrefix.get(aMaterial).toString())))
sName2StackMap.put(aPrefix.get(aMaterial).toString(), aStack);
isAddingOre--;
}
@@ -96,16 +102,24 @@ public class GregtechOreDictUnificator {
}
public static ItemStack get(OrePrefixes aPrefix, Object aMaterial, ItemStack aReplacement, long aAmount) {
- //if (Materials.mDefaultComponents.contains(aPrefix) && !aPrefix.mDynamicItems.contains((Materials)aMaterial)) aPrefix.mDynamicItems.add((Materials) aMaterial);
- if (StaticFields59.geOrePrefixesBooleanPreventableComponents().contains(aPrefix) && StaticFields59.getOrePrefixesBooleanDisabledItems().contains(aMaterial)) return aReplacement;
+ // if (Materials.mDefaultComponents.contains(aPrefix) && !aPrefix.mDynamicItems.contains((Materials)aMaterial))
+ // aPrefix.mDynamicItems.add((Materials) aMaterial);
+ if (StaticFields59.geOrePrefixesBooleanPreventableComponents().contains(aPrefix)
+ && StaticFields59.getOrePrefixesBooleanDisabledItems().contains(aMaterial)) return aReplacement;
return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true);
}
- public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount, boolean aMentionPossibleTypos, boolean aNoInvalidAmounts) {
+ 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);
+ return GT_Utility.copyAmount(
+ aAmount, sName2StackMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement);
}
public static ItemStack[] setStackArray(boolean aUseBlackList, ItemStack... aStacks) {
@@ -141,18 +155,19 @@ public class GregtechOreDictUnificator {
}
public static ItemStack get(boolean aUseBlackList, ItemStack aStack, boolean aOnUnificationTableCreation) {
- if (GT_Utility.isStackInvalid(aStack)) return null;
+ 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 (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());
- if (!aOnUnificationTableCreation) sUnificationTable.clear();
+ tPrefixMaterial.mUnificationTarget = sName2StackMap.get(tPrefixMaterial.toString());
+ if (!aOnUnificationTableCreation) sUnificationTable.clear();
}
rStack = tPrefixMaterial.mUnificationTarget;
if (GT_Utility.isStackInvalid(rStack)) return GT_Utility.copy(aStack);
@@ -162,37 +177,37 @@ public class GregtechOreDictUnificator {
}
public static List<ItemStack> getNonUnifiedStacks(Object obj) {
- synchronized (sUnificationTable) {
- if (sUnificationTable.isEmpty() && !sItemStack2DataMap.isEmpty()) {
- for (GT_ItemStack tGTStack0 : sItemStack2DataMap.keySet()) {
- ItemStack tStack0 = tGTStack0.toStack();
- ItemStack tStack1 = get(false, tStack0, true);
- if (tStack0 != null && tStack1 != null && !GT_Utility.areStacksEqual(tStack0, tStack1)) {
- GT_ItemStack tGTStack1 = new GT_ItemStack(tStack1);
- List<ItemStack> list = sUnificationTable.get(tGTStack1);
- if (list == null) sUnificationTable.put(tGTStack1, list = new ArrayList<ItemStack>());
- if (!list.contains(tStack0)) list.add(tStack0);
- }
- }
- }
- }
- ItemStack[] aStacks = {};
- if (obj instanceof ItemStack) aStacks = new ItemStack[]{(ItemStack) obj};
- else if (obj instanceof ItemStack[]) aStacks = (ItemStack[]) obj;
- else if (obj instanceof List) aStacks = (ItemStack[]) ((List)obj).toArray(new ItemStack[0]);
- List<ItemStack> rList = new ArrayList<ItemStack>();
- for (ItemStack aStack : aStacks) {
- rList.add(aStack);
- List<ItemStack> tList = sUnificationTable.get(new GT_ItemStack(aStack));
- if (tList != null) {
- for (ItemStack tStack : tList) {
- ItemStack tStack1 = GT_Utility.copyAmount(aStack.stackSize, tStack);
- tStack1.setTagCompound(aStack.getTagCompound());
- rList.add(tStack1);
- }
- }
- }
- return rList;
+ synchronized (sUnificationTable) {
+ if (sUnificationTable.isEmpty() && !sItemStack2DataMap.isEmpty()) {
+ for (GT_ItemStack tGTStack0 : sItemStack2DataMap.keySet()) {
+ ItemStack tStack0 = tGTStack0.toStack();
+ ItemStack tStack1 = get(false, tStack0, true);
+ if (tStack0 != null && tStack1 != null && !GT_Utility.areStacksEqual(tStack0, tStack1)) {
+ GT_ItemStack tGTStack1 = new GT_ItemStack(tStack1);
+ List<ItemStack> list = sUnificationTable.get(tGTStack1);
+ if (list == null) sUnificationTable.put(tGTStack1, list = new ArrayList<ItemStack>());
+ if (!list.contains(tStack0)) list.add(tStack0);
+ }
+ }
+ }
+ }
+ ItemStack[] aStacks = {};
+ if (obj instanceof ItemStack) aStacks = new ItemStack[] {(ItemStack) obj};
+ else if (obj instanceof ItemStack[]) aStacks = (ItemStack[]) obj;
+ else if (obj instanceof List) aStacks = (ItemStack[]) ((List) obj).toArray(new ItemStack[0]);
+ List<ItemStack> rList = new ArrayList<ItemStack>();
+ for (ItemStack aStack : aStacks) {
+ rList.add(aStack);
+ List<ItemStack> tList = sUnificationTable.get(new GT_ItemStack(aStack));
+ if (tList != null) {
+ for (ItemStack tStack : tList) {
+ ItemStack tStack1 = GT_Utility.copyAmount(aStack.stackSize, tStack);
+ tStack1.setTagCompound(aStack.getTagCompound());
+ rList.add(tStack1);
+ }
+ }
+ }
+ return rList;
}
public static void addItemData(ItemStack aStack, ItemData aData) {
@@ -203,8 +218,9 @@ public class GregtechOreDictUnificator {
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 (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;
@@ -212,9 +228,13 @@ public class GregtechOreDictUnificator {
}
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;
+ 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;
+ tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING)
+ ? 0
+ : tMaterial.mAmount >= 0 ? tMaterial.mAmount : M;
if (tValidMaterialAmount < M) GT_ModHandler.addToRecyclerBlackList(aStack);
}
if (mRunThroughTheList) {
@@ -222,7 +242,8 @@ public class GregtechOreDictUnificator {
mRunThroughTheList = false;
for (Entry<GT_ItemStack, ItemData> tEntry : sItemStack2DataMap.entrySet())
if (!tEntry.getValue().hasValidPrefixData() || tEntry.getValue().mPrefix.mAllowNormalRecycling)
- GT_RecipeRegistrator.registerMaterialRecycling(tEntry.getKey().toStack(), tEntry.getValue());
+ GT_RecipeRegistrator.registerMaterialRecycling(
+ tEntry.getKey().toStack(), tEntry.getValue());
}
} else {
if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling)
@@ -234,10 +255,13 @@ public class GregtechOreDictUnificator {
}
}
- public static void addAssociation(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aBlackListed) {
+ 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));
+ 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));
}
@@ -305,8 +329,7 @@ public class GregtechOreDictUnificator {
public static ItemStack getGem(Materials aMaterial, long aMaterialAmount) {
ItemStack rStack = null;
- if (((aMaterialAmount >= M)))
- rStack = get(OrePrefixes.gem, aMaterial, aMaterialAmount / M);
+ if (((aMaterialAmount >= M))) rStack = get(OrePrefixes.gem, aMaterial, aMaterialAmount / M);
if (rStack == null) {
if ((((aMaterialAmount * 2) % M == 0) || aMaterialAmount >= M * 16))
rStack = get(OrePrefixes.gemFlawed, aMaterial, (aMaterialAmount * 2) / M);
@@ -365,7 +388,10 @@ public class GregtechOreDictUnificator {
public static ItemStack getIngotOrDust(MaterialStack aMaterial) {
ItemStack rStack = getIngot(aMaterial);
- if(aMaterial!=null&&aMaterial.mMaterial!=null&&(aMaterial.mMaterial==Materials.Naquadah||aMaterial.mMaterial==Materials.NaquadahEnriched))rStack = getDust(aMaterial);
+ if (aMaterial != null
+ && aMaterial.mMaterial != null
+ && (aMaterial.mMaterial == Materials.Naquadah || aMaterial.mMaterial == Materials.NaquadahEnriched))
+ rStack = getDust(aMaterial);
if (rStack == null) rStack = getDust(aMaterial);
return rStack;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java
index 74655fb744..d03d4da099 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java
@@ -1,35 +1,33 @@
package gtPlusPlus.xmod.gregtech.api.util;
-import java.util.HashMap;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gregtech.api.util.GT_Utility;
+import java.util.HashMap;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
public class SpecialBehaviourTooltipHandler {
- private static final HashMap<ItemStack, String> mTooltipCache = new HashMap<ItemStack, String>();
-
- public static void addTooltipForItem(ItemStack aStack, String aTooltip) {
- mTooltipCache.put(aStack, aTooltip);
- }
-
- @SubscribeEvent
- public void onItemTooltip(ItemTooltipEvent event){
- if (event != null) {
- if (event.itemStack != null) {
- for (ItemStack aKey : mTooltipCache.keySet()) {
- if (GT_Utility.areStacksEqual(aKey, event.itemStack, false)) {
- String s = mTooltipCache.get(aKey);
- if (s != null && s.length() > 0) {
- event.toolTip.add(EnumChatFormatting.RED+s);
- }
- }
- }
- }
- }
- }
-
+ private static final HashMap<ItemStack, String> mTooltipCache = new HashMap<ItemStack, String>();
+
+ public static void addTooltipForItem(ItemStack aStack, String aTooltip) {
+ mTooltipCache.put(aStack, aTooltip);
+ }
+
+ @SubscribeEvent
+ public void onItemTooltip(ItemTooltipEvent event) {
+ if (event != null) {
+ if (event.itemStack != null) {
+ for (ItemStack aKey : mTooltipCache.keySet()) {
+ if (GT_Utility.areStacksEqual(aKey, event.itemStack, false)) {
+ String s = mTooltipCache.get(aKey);
+ if (s != null && s.length() > 0) {
+ event.toolTip.add(EnumChatFormatting.RED + s);
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java
index 795fd18826..6f58823eb1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java
@@ -6,11 +6,10 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
-
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
-public abstract class GTPP_Worldgen{
+public abstract class GTPP_Worldgen {
public final String mWorldGenName;
public final boolean mEnabled;
@@ -31,7 +30,15 @@ public abstract class GTPP_Worldgen{
* @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) {
+ public boolean executeWorldgen(
+ World aWorld,
+ Random aRandom,
+ String aBiome,
+ int aDimensionType,
+ int aChunkX,
+ int aChunkZ,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider) {
return false;
}
@@ -44,7 +51,15 @@ public abstract class GTPP_Worldgen{
* @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) {
+ public boolean executeCavegen(
+ World aWorld,
+ Random aRandom,
+ String aBiome,
+ int aDimensionType,
+ int aChunkX,
+ int aChunkZ,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider) {
return false;
}
@@ -52,10 +67,11 @@ public abstract class GTPP_Worldgen{
String aDimName = aWorld.provider.getDimensionName();
Boolean tAllowed = mDimensionMap.get(aDimName);
if (tAllowed == null) {
- boolean tValue = sCustomWorldgenFile.get("worldgen.dimensions." + mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType);
+ boolean tValue = sCustomWorldgenFile.get(
+ "worldgen.dimensions." + mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType);
mDimensionMap.put(aDimName, tValue);
return tValue;
}
return tAllowed;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java
index ca78a72e04..26f1b38084 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java
@@ -1,9 +1,8 @@
package gtPlusPlus.xmod.gregtech.api.world;
+import gtPlusPlus.core.lib.CORE;
import java.util.Collection;
import java.util.Random;
-
-import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.util.MathHelper;
@@ -11,26 +10,69 @@ import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
public class GTPP_Worldgen_Boulder extends GTPP_Worldgen_Ore {
- public GTPP_Worldgen_Boulder(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, boolean aAllowToGenerateinVoid) {
- super(aName, aDefault, aBlock, aBlockMeta, aDimensionType, aAmount, aSize, aProbability, aMinY, aMaxY, aBiomeList, aAllowToGenerateinVoid);
+ public GTPP_Worldgen_Boulder(
+ String aName,
+ boolean aDefault,
+ Block aBlock,
+ int aBlockMeta,
+ int aDimensionType,
+ int aAmount,
+ int aSize,
+ int aProbability,
+ int aMinY,
+ int aMaxY,
+ Collection<String> 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)) {
+ 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);
+ 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)) {
+ if (tBlock != null
+ && tBlock.isOpaqueCube()
+ && aWorld.getBlock(tX, tY - 6, tZ).isAir(aWorld, tX, tY - 6, tZ)) {
float math_pi = CORE.PI;
float var6 = aRandom.nextFloat() * math_pi;
float var1b = mSize / 8.0F;
- float var3b = MathHelper.sin(var6) * var1b; float var4b = MathHelper.cos(var6) * var1b;
- float var8b = -2*var3b;float var9b = -2*var4b;
- int var10b = (tX + 8);int var11b = (tZ + 8);
+ float var3b = MathHelper.sin(var6) * var1b;
+ float var4b = MathHelper.cos(var6) * var1b;
+ float var8b = -2 * var3b;
+ float var9b = -2 * var4b;
+ int var10b = (tX + 8);
+ int var11b = (tZ + 8);
float var7 = (var10b + var3b);
float var11 = (var11b + var4b);
- int var5b = aRandom.nextInt(3);int var6b = aRandom.nextInt(3);int var7b = var6b - var5b;
+ int var5b = aRandom.nextInt(3);
+ int var6b = aRandom.nextInt(3);
+ int var7b = var6b - var5b;
float var15 = (tY + var5b - 2);
float var12b = math_pi / mSize;
@@ -59,7 +101,11 @@ public class GTPP_Worldgen_Boulder extends GTPP_Worldgen_Ore {
for (int var44 = var34; var44 <= var37; ++var44) {
float var45 = (var44 + 0.5F - var24) / (var28);
Block block = aWorld.getBlock(var38, var41, var44);
- if (var14b + var45 * var45 < 1.0F && ((mAllowToGenerateinVoid && aWorld.getBlock(var38, var41, var44).isAir(aWorld, var38, var41, var44)) || (block != null && !(block instanceof BlockContainer)))) {
+ if (var14b + var45 * var45 < 1.0F
+ && ((mAllowToGenerateinVoid
+ && aWorld.getBlock(var38, var41, var44)
+ .isAir(aWorld, var38, var41, var44))
+ || (block != null && !(block instanceof BlockContainer)))) {
aWorld.setBlock(var38, var41, var44, mBlock, mBlockMeta, 0);
}
}
@@ -74,4 +120,4 @@ public class GTPP_Worldgen_Boulder extends GTPP_Worldgen_Ore {
}
return false;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java
index 7cd215aa4e..0dbd354547 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java
@@ -2,166 +2,274 @@ package gtPlusPlus.xmod.gregtech.api.world;
import static gtPlusPlus.xmod.gregtech.HANDLER_GT.sCustomWorldgenFile;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.common.blocks.GT_TileEntity_Ores;
+import gregtech.loaders.misc.GT_Achievements;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Random;
-
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Materials;
-import gregtech.common.blocks.GT_TileEntity_Ores;
-import gregtech.loaders.misc.GT_Achievements;
+public class GTPP_Worldgen_GT_Ore_Layer extends GTPP_Worldgen {
+ public static ArrayList<GTPP_Worldgen_GT_Ore_Layer> sList = new ArrayList<GTPP_Worldgen_GT_Ore_Layer>();
+ public static int sWeight = 0;
+ public final short mMinY;
+ public final short mMaxY;
+ public final short mWeight;
+ public final short mDensity;
+ public final short mSize;
+ public short mPrimaryMeta;
+ public short mSecondaryMeta;
+ public short mBetweenMeta;
+ public short mSporadicMeta;
+ public final String mRestrictBiome;
+ public final boolean mDarkWorld;
+ public final String aTextWorldgen = "worldgen.gtpp.";
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
+ public GTPP_Worldgen_GT_Ore_Layer(
+ String aName,
+ boolean aDefault,
+ int aMinY,
+ int aMaxY,
+ int aWeight,
+ int aDensity,
+ int aSize,
+ boolean aOverworld,
+ Materials aPrimary,
+ Materials aSecondary,
+ Materials aBetween,
+ Materials aSporadic) {
+ super(aName, sList, aDefault);
+ this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
+ this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
+ this.mMaxY = ((short) Math.max(
+ this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)));
+ this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
+ this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
+ this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
+ this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(
+ aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID));
+ this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(
+ aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID));
+ this.mBetweenMeta = ((short) sCustomWorldgenFile.get(
+ aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID));
+ this.mSporadicMeta = ((short) sCustomWorldgenFile.get(
+ aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID));
+ this.mRestrictBiome =
+ sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
-public class GTPP_Worldgen_GT_Ore_Layer
-extends GTPP_Worldgen {
- public static ArrayList<GTPP_Worldgen_GT_Ore_Layer> sList = new ArrayList<GTPP_Worldgen_GT_Ore_Layer>();
- public static int sWeight = 0;
- public final short mMinY;
- public final short mMaxY;
- public final short mWeight;
- public final short mDensity;
- public final short mSize;
- public short mPrimaryMeta;
- public short mSecondaryMeta;
- public short mBetweenMeta;
- public short mSporadicMeta;
- public final String mRestrictBiome;
- public final boolean mDarkWorld;
- public final String aTextWorldgen = "worldgen.gtpp.";
+ if (this.mEnabled) {
+ GT_Achievements.registerOre(
+ GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)],
+ aMinY,
+ aMaxY,
+ aWeight,
+ false,
+ false,
+ false);
+ GT_Achievements.registerOre(
+ GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)],
+ aMinY,
+ aMaxY,
+ aWeight,
+ false,
+ false,
+ false);
+ GT_Achievements.registerOre(
+ GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)],
+ aMinY,
+ aMaxY,
+ aWeight,
+ false,
+ false,
+ false);
+ GT_Achievements.registerOre(
+ GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)],
+ aMinY,
+ aMaxY,
+ aWeight,
+ false,
+ false,
+ false);
+ sWeight += this.mWeight;
+ }
+ }
- public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) {
- super(aName, sList, aDefault);
- this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
- this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
- this.mMaxY = ((short) Math.max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)));
- this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
- this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
- this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
- this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID));
- this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID));
- this.mBetweenMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID));
- this.mSporadicMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID));
- this.mRestrictBiome = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
+ public GTPP_Worldgen_GT_Ore_Layer(
+ String aName,
+ boolean aDefault,
+ int aMinY,
+ int aMaxY,
+ int aWeight,
+ int aDensity,
+ int aSize,
+ Material aPrimary,
+ Material aSecondary,
+ Material aBetween,
+ Material aSporadic) {
+ super(aName, sList, aDefault);
+ this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Darkworld", true);
+ this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
+ this.mMaxY = ((short) Math.max(
+ this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)));
+ this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
+ this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
+ this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
+ /*this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID));
+ this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID));
+ this.mBetweenMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID));
+ this.mSporadicMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID));
+ */ this.mRestrictBiome =
+ sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
- if (this.mEnabled) {
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- sWeight += this.mWeight;
- }
- }
+ if (this.mEnabled) {
+ /* GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
+ */ sWeight += this.mWeight;
+ }
+ }
- public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity,
- int aSize, Material aPrimary, Material aSecondary, Material aBetween,
- Material aSporadic) {
- super(aName, sList, aDefault);
- this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Darkworld", true);
- this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
- this.mMaxY = ((short) Math.max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)));
- this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
- this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
- this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
- /*this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID));
- this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID));
- this.mBetweenMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID));
- this.mSporadicMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID));
- */this.mRestrictBiome = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
+ @Override
+ public boolean executeWorldgen(
+ World aWorld,
+ Random aRandom,
+ String aBiome,
+ int aDimensionType,
+ int aChunkX,
+ int aChunkZ,
+ IChunkProvider aChunkGenerator,
+ IChunkProvider aChunkProvider) {
+ if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
+ return false; // Not the correct biome for ore mix
+ }
+ if (!isGenerationAllowed(
+ aWorld,
+ aDimensionType,
+ ((aDimensionType == -1) && (false))
+ || ((aDimensionType == 0) && (this.mDarkWorld))
+ || ((aDimensionType == 1) && (false))
+ || ((aWorld.provider.getDimensionName().equals("Moon")) && (false))
+ || ((aWorld.provider.getDimensionName().equals("Mars")) && (false))
+ ? aDimensionType
+ : aDimensionType ^ 0xFFFFFFFF)) {
+ return false;
+ }
+ int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5);
- if (this.mEnabled) {
- /* GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false);
- */ sWeight += this.mWeight;
- }
- }
+ int cX = aChunkX - aRandom.nextInt(this.mSize);
+ int eX = aChunkX + 16 + aRandom.nextInt(this.mSize);
+ for (int tX = cX; tX <= eX; tX++) {
+ int cZ = aChunkZ - aRandom.nextInt(this.mSize);
+ int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize);
+ for (int tZ = cZ; tZ <= eZ; tZ++) {
+ if (this.mSecondaryMeta > 0) {
+ for (int i = tMinY - 1; i < tMinY + 2; i++) {
+ if ((aRandom.nextInt(Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ))
+ / this.mDensity))
+ == 0)
+ || (aRandom.nextInt(Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX))
+ / this.mDensity))
+ == 0)) {
+ setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false);
+ }
+ }
+ }
+ if ((this.mBetweenMeta > 0)
+ && ((aRandom.nextInt(Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ))
+ / this.mDensity))
+ == 0)
+ || (aRandom.nextInt(Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX))
+ / this.mDensity))
+ == 0))) {
+ setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false);
+ }
+ if (this.mPrimaryMeta > 0) {
+ for (int i = tMinY + 3; i < tMinY + 6; i++) {
+ if ((aRandom.nextInt(Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ))
+ / this.mDensity))
+ == 0)
+ || (aRandom.nextInt(Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX))
+ / this.mDensity))
+ == 0)) {
+ setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false);
+ }
+ }
+ }
+ if ((this.mSporadicMeta > 0)
+ && ((aRandom.nextInt(Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ))
+ / this.mDensity))
+ == 0)
+ || (aRandom.nextInt(Math.max(
+ 1,
+ Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX))
+ / this.mDensity))
+ == 0))) {
+ setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false);
+ }
+ }
+ }
+ if (GT_Values.D1) {
+ System.out.println("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ);
+ }
+ return true;
+ }
- @Override
- public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
- if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
- return false; //Not the correct biome for ore mix
- }
- if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (false)) || ((aDimensionType == 0) && (this.mDarkWorld)) || ((aDimensionType == 1) && (false)) || ((aWorld.provider.getDimensionName().equals("Moon")) && (false)) || ((aWorld.provider.getDimensionName().equals("Mars")) && (false)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) {
- return false;
- }
- int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5);
+ private Method mSetOre = null;
- int cX = aChunkX - aRandom.nextInt(this.mSize);
- int eX = aChunkX + 16 + aRandom.nextInt(this.mSize);
- for (int tX = cX; tX <= eX; tX++) {
- int cZ = aChunkZ - aRandom.nextInt(this.mSize);
- int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize);
- for (int tZ = cZ; tZ <= eZ; tZ++) {
- if (this.mSecondaryMeta > 0) {
- for (int i = tMinY - 1; i < tMinY + 2; i++) {
- if ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) {
- setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false);
- }
- }
- }
- if ((this.mBetweenMeta > 0) && ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0))) {
- setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false);
- }
- if (this.mPrimaryMeta > 0) {
- for (int i = tMinY + 3; i < tMinY + 6; i++) {
- if ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) {
- setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false);
- }
- }
- }
- if ((this.mSporadicMeta > 0) && ((aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) || (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0))) {
- setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false);
- }
- }
- }
- if (GT_Values.D1) {
- System.out.println("Generated Orevein: " + this.mWorldGenName+" "+aChunkX +" "+ aChunkZ);
- }
- return true;
- }
- private Method mSetOre = null;
- private boolean setOreBlock(World world, int x, int y, int z, int secondarymeta, boolean bool){
+ private boolean setOreBlock(World world, int x, int y, int z, int secondarymeta, boolean bool) {
- if (mSetOre == null){
- try {
- mSetOre = GT_TileEntity_Ores.class.getMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class, boolean.class);
- }
- catch (SecurityException | NoSuchMethodException e) {
- try {
- mSetOre = GT_TileEntity_Ores.class.getMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class);
- }
- catch (SecurityException | NoSuchMethodException r) {}
- }
- }
+ if (mSetOre == null) {
+ try {
+ mSetOre = GT_TileEntity_Ores.class.getMethod(
+ "setOreBlock", World.class, int.class, int.class, int.class, int.class, boolean.class);
+ } catch (SecurityException | NoSuchMethodException e) {
+ try {
+ mSetOre = GT_TileEntity_Ores.class.getMethod(
+ "setOreBlock", World.class, int.class, int.class, int.class, int.class);
+ } catch (SecurityException | NoSuchMethodException r) {
+ }
+ }
+ }
- if (mSetOre != null) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- try {
- return (boolean) mSetOre.invoke(world, x, y, z, secondarymeta, bool);
- }
- catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException t) {
- return false;
- }
- }
- else {
- try {
- return (boolean) mSetOre.invoke(world, x, y, z, secondarymeta);
- }
- catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException t) {
- return false;}
- }
- }
- else {
- return false;
- }
- }
-} \ No newline at end of file
+ if (mSetOre != null) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try {
+ return (boolean) mSetOre.invoke(world, x, y, z, secondarymeta, bool);
+ } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException t) {
+ return false;
+ }
+ } else {
+ try {
+ return (boolean) mSetOre.invoke(world, x, y, z, secondarymeta);
+ } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException t) {
+ return false;
+ }
+ }
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java
index aae3bdd48a..b295d5be82 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java
@@ -4,38 +4,52 @@ import static gtPlusPlus.xmod.gregtech.api.world.WorldGenUtils.mOresToRegister;
import gtPlusPlus.core.material.Material;
-public class GTPP_Worldgen_Handler implements Runnable{
-
-
-
- @Override
- public void run() {
-
- for (GT_OreVein_Object ore : mOresToRegister){
- generateNewVein(ore);
- }
-
- }
-
-
-
- private final GTPP_Worldgen_GT_Ore_Layer generateNewVein(final GT_OreVein_Object ore){
- return generateNewVein(ore.mOreMixName, ore.minY, ore.maxY, ore.weight, ore.density, ore.size, ore.aPrimary, ore.aSecondary, ore.aBetween, ore.aSporadic);
- }
-
- private final GTPP_Worldgen_GT_Ore_Layer generateNewVein(String mOreMixName, int minY, int maxY, int weight, int density, int size,
- Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic){
- return new GTPP_Worldgen_GT_Ore_Layer(
- "ore.mix."+mOreMixName, //String aName,
- true, //boolean aDefault,
- minY, maxY, //int aMinY, int aMaxY,
- weight, //int aWeight,
- density, //int aDensity,
- size, //int aSize,
- aPrimary, //Materials aPrimary,
- aSecondary, //Materials aSecondary,
- aBetween, //Materials aBetween,
- aSporadic); //Materials aSporadic
- }
-
+public class GTPP_Worldgen_Handler implements Runnable {
+
+ @Override
+ public void run() {
+
+ for (GT_OreVein_Object ore : mOresToRegister) {
+ generateNewVein(ore);
+ }
+ }
+
+ private final GTPP_Worldgen_GT_Ore_Layer generateNewVein(final GT_OreVein_Object ore) {
+ return generateNewVein(
+ ore.mOreMixName,
+ ore.minY,
+ ore.maxY,
+ ore.weight,
+ ore.density,
+ ore.size,
+ ore.aPrimary,
+ ore.aSecondary,
+ ore.aBetween,
+ ore.aSporadic);
+ }
+
+ private final GTPP_Worldgen_GT_Ore_Layer generateNewVein(
+ String mOreMixName,
+ int minY,
+ int maxY,
+ int weight,
+ int density,
+ int size,
+ Material aPrimary,
+ Material aSecondary,
+ Material aBetween,
+ Material aSporadic) {
+ return new GTPP_Worldgen_GT_Ore_Layer(
+ "ore.mix." + mOreMixName, // String aName,
+ true, // boolean aDefault,
+ minY,
+ maxY, // int aMinY, int aMaxY,
+ weight, // int aWeight,
+ density, // int aDensity,
+ size, // int aSize,
+ aPrimary, // Materials aPrimary,
+ aSecondary, // Materials aSecondary,
+ aBetween, // Materials aBetween,
+ aSporadic); // Materials aSporadic
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java
index 2d7f817060..e93a6c6d38 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java
@@ -2,13 +2,11 @@ package gtPlusPlus.xmod.gregtech.api.world;
import static gtPlusPlus.xmod.gregtech.HANDLER_GT.sCustomWorldgenFile;
+import gtPlusPlus.xmod.gregtech.HANDLER_GT;
import java.util.ArrayList;
import java.util.Collection;
-
import net.minecraft.block.Block;
-import gtPlusPlus.xmod.gregtech.HANDLER_GT;
-
public abstract class GTPP_Worldgen_Ore extends GTPP_Worldgen {
public final int mBlockMeta, mAmount, mSize, mMinY, mMaxY, mProbability, mDimensionType;
public final Block mBlock;
@@ -16,7 +14,19 @@ public abstract class GTPP_Worldgen_Ore extends GTPP_Worldgen {
public final boolean mAllowToGenerateinVoid;
private final String aTextWorldgen = "worldgen.";
- public GTPP_Worldgen_Ore(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, boolean aAllowToGenerateinVoid) {
+ public GTPP_Worldgen_Ore(
+ String aName,
+ boolean aDefault,
+ Block aBlock,
+ int aBlockMeta,
+ int aDimensionType,
+ int aAmount,
+ int aSize,
+ int aProbability,
+ int aMinY,
+ int aMaxY,
+ Collection<String> aBiomeList,
+ boolean aAllowToGenerateinVoid) {
super(aName, HANDLER_GT.sCustomWorldgenList, aDefault);
mDimensionType = aDimensionType;
mBlock = aBlock;
@@ -30,4 +40,4 @@ public abstract class GTPP_Worldgen_Ore extends GTPP_Worldgen {
else mBiomeList = aBiomeList;
mAllowToGenerateinVoid = aAllowToGenerateinVoid;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java
index e66106ad4a..3f0a6d48c9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java
@@ -1,9 +1,8 @@
package gtPlusPlus.xmod.gregtech.api.world;
+import gtPlusPlus.core.lib.CORE;
import java.util.Collection;
import java.util.Random;
-
-import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
@@ -11,24 +10,66 @@ import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
public class GTPP_Worldgen_Ore_Normal extends GTPP_Worldgen_Ore {
- public GTPP_Worldgen_Ore_Normal(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, boolean aAllowToGenerateinVoid) {
- super(aName, aDefault, aBlock, aBlockMeta, aDimensionType, aAmount, aSize, aProbability, aMinY, aMaxY, aBiomeList, aAllowToGenerateinVoid);
+ public GTPP_Worldgen_Ore_Normal(
+ String aName,
+ boolean aDefault,
+ Block aBlock,
+ int aBlockMeta,
+ int aDimensionType,
+ int aAmount,
+ int aSize,
+ int aProbability,
+ int aMinY,
+ int aMaxY,
+ Collection<String> 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)) {
+ 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);
+ 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 math_pi = CORE.PI;float var1b = mSize / 8.0F;
+ float math_pi = CORE.PI;
+ float var1b = mSize / 8.0F;
float var6 = aRandom.nextFloat() * math_pi;
- float var3b = MathHelper.sin(var6) * var1b; float var4b = MathHelper.cos(var6) * var1b;
- float var8b = -2*var3b;float var9b = -2*var4b;
- int var10b = (tX + 8);int var11b = (tZ + 8);
+ float var3b = MathHelper.sin(var6) * var1b;
+ float var4b = MathHelper.cos(var6) * var1b;
+ float var8b = -2 * var3b;
+ float var9b = -2 * var4b;
+ int var10b = (tX + 8);
+ int var11b = (tZ + 8);
float var7 = (var10b + var3b);
float var11 = (var11b + var4b);
- int var5b = aRandom.nextInt(3);int var6b = aRandom.nextInt(3);int var7b = var6b - var5b;
+ int var5b = aRandom.nextInt(3);
+ int var6b = aRandom.nextInt(3);
+ int var7b = var6b - var5b;
float var15 = (tY + var5b - 2);
float var12b = math_pi / mSize;
@@ -57,7 +98,29 @@ public class GTPP_Worldgen_Ore_Normal extends GTPP_Worldgen_Ore {
for (int var44 = var34; var44 <= var37; ++var44) {
float var45 = (var44 + 0.5F - var24) / (var28);
Block block = aWorld.getBlock(var38, var41, var44);
- if (var14b + var45 * var45 < 1.0F && ((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))))) {
+ if (var14b + var45 * var45 < 1.0F
+ && ((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);
}
}
@@ -72,4 +135,4 @@ public class GTPP_Worldgen_Ore_Normal extends GTPP_Worldgen_Ore {
}
return false;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java
index 770083fee8..c6e9e6c92a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java
@@ -4,28 +4,36 @@ import gtPlusPlus.core.material.Material;
public class GT_OreVein_Object {
- final String mOreMixName; //String aName,
- final int minY, maxY; //int aMinY, int aMaxY,
- final int weight; //int aWeight,
- final int density; //int aDensity,
- final int size; //int aSize,
- final Material aPrimary; //Materials aPrimary,
- final Material aSecondary; //Materials aSecondary,
- final Material aBetween; //Materials aBetween,
- final Material aSporadic; //Materials aSporadic
-
- GT_OreVein_Object(String mOreMixName, int minY, int maxY, int weight, int density, int size,
- Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic){
- this.mOreMixName = mOreMixName;
- this.minY = minY;
- this.maxY = maxY;
- this.weight = weight;
- this.density = density;
- this.size = size;
- this.aPrimary = aPrimary;
- this.aSecondary = aSecondary;
- this.aBetween = aBetween;
- this.aSporadic = aSporadic;
- }
-
+ final String mOreMixName; // String aName,
+ final int minY, maxY; // int aMinY, int aMaxY,
+ final int weight; // int aWeight,
+ final int density; // int aDensity,
+ final int size; // int aSize,
+ final Material aPrimary; // Materials aPrimary,
+ final Material aSecondary; // Materials aSecondary,
+ final Material aBetween; // Materials aBetween,
+ final Material aSporadic; // Materials aSporadic
+
+ GT_OreVein_Object(
+ String mOreMixName,
+ int minY,
+ int maxY,
+ int weight,
+ int density,
+ int size,
+ Material aPrimary,
+ Material aSecondary,
+ Material aBetween,
+ Material aSporadic) {
+ this.mOreMixName = mOreMixName;
+ this.minY = minY;
+ this.maxY = maxY;
+ this.weight = weight;
+ this.density = density;
+ this.size = size;
+ this.aPrimary = aPrimary;
+ this.aSecondary = aSecondary;
+ this.aBetween = aBetween;
+ this.aSporadic = aSporadic;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java
index fd0738596a..78f04269cf 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java
@@ -1,23 +1,31 @@
package gtPlusPlus.xmod.gregtech.api.world;
+import gtPlusPlus.core.material.Material;
import java.util.ArrayList;
import java.util.List;
-import gtPlusPlus.core.material.Material;
-
public class WorldGenUtils {
- static List<GT_OreVein_Object> mOresToRegister = new ArrayList<GT_OreVein_Object>();
-
- public static final void addNewOreMixForWorldgen(GT_OreVein_Object newVein){
- mOresToRegister.add(newVein);
- }
-
- public static boolean generateNewOreVeinObject(String mOreMixName, int minY, int maxY, int weight, int density, int size,
- Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic){
- GT_OreVein_Object newVein = new GT_OreVein_Object(mOreMixName, minY, maxY, weight, density, size, aPrimary, aSecondary, aBetween, aSporadic);
- addNewOreMixForWorldgen(newVein);
- return true;
- }
-
+ static List<GT_OreVein_Object> mOresToRegister = new ArrayList<GT_OreVein_Object>();
+
+ public static final void addNewOreMixForWorldgen(GT_OreVein_Object newVein) {
+ mOresToRegister.add(newVein);
+ }
+
+ public static boolean generateNewOreVeinObject(
+ String mOreMixName,
+ int minY,
+ int maxY,
+ int weight,
+ int density,
+ int size,
+ Material aPrimary,
+ Material aSecondary,
+ Material aBetween,
+ Material aSporadic) {
+ GT_OreVein_Object newVein = new GT_OreVein_Object(
+ mOreMixName, minY, maxY, weight, density, size, aPrimary, aSecondary, aBetween, aSporadic);
+ addNewOreMixForWorldgen(newVein);
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
index fe0be2f126..535b4b7169 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -1,12 +1,5 @@
package gtPlusPlus.xmod.gregtech.common;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.util.*;
-
-import org.apache.commons.lang3.ArrayUtils;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -34,6 +27,10 @@ import gtPlusPlus.xmod.gregtech.common.helpers.MachineUpdateHandler;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_WorldAccelerator;
import ic2.core.init.BlocksItems;
import ic2.core.init.InternalName;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
@@ -44,531 +41,547 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
+import org.apache.commons.lang3.ArrayUtils;
public class Meta_GT_Proxy {
- static {
- Logger.INFO("GT_PROXY - initialized.");
- sDoesVolumetricFlaskExist = ReflectionUtils.doesClassExist("gregtech.common.items.GT_VolumetricFlask");
- }
-
- public static List<Runnable> GT_BlockIconload = new ArrayList<>();
- public static List<Runnable> GT_ItemIconload = new ArrayList<>();
-
- public static AutoMap<Integer> GT_ValidHeatingCoilMetas = new AutoMap<Integer>();
-
- private static Class<BaseCustomTileEntity> sBaseMetaTileEntityClass;
- private static Class<BaseCustomPower_MTE> sBaseMetaTileEntityClass2;
-
- public static AchievementHandler mAssemblyAchievements;
-
- public static final Map<String, FormattedTooltipString> mCustomGregtechMetaTooltips = new LinkedHashMap<String, FormattedTooltipString>();
-
- /**
- * Does this feature exist within GT? Saves loading useless content if not.
- */
- public static final boolean sDoesVolumetricFlaskExist;
-
- @SideOnly(Side.CLIENT)
- public static IIconRegister sBlockIcons, sItemIcons;
-
- public Meta_GT_Proxy() {
-
- }
-
- public static Block sBlockMachines;
-
- public static void preInit() {
-
- //New GT++ Block, yay! (Progress)
- //sBlockMachines = new GTPP_Block_Machines();
- fixIC2FluidNames();
-
- GT_Log.out.println("GT++ Mod: Register TileEntities.");
- BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity();
- BaseMetaTileEntity tBaseMetaTileEntity2 = constructBaseMetaTileEntityCustomPower();
-
- GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity.");
- if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) {
- GT_Log.err.println("GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft.");
- CORE.crash("GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft.");
- }
-
- //Gotta set it here so that we don't try call gregtech too early.
- //Must set on the correct side
-
- if (ReflectionUtils.doesFieldExist(GT_Proxy.class, "gt6Pipe")) {
- StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe");
- }
- else {
- StaticFields59.mGT6StylePipes = false;
- }
-
- GT_Log.out.println("GT++ Mod: Registering custom BaseMetaTileEntities.");
- GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP");
- GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2");
- CoverManager.generateCustomCovers();
- }
-
- public static void init() {
- setValidHeatingCoilMetas();
- PollutionUtils.setPollutionFluids();
- fixIC2FluidNames();
- Utils.registerEvent(new MachineUpdateHandler());
- }
-
- public static void postInit() {
- mAssemblyAchievements = new AchievementHandler();
- fixIC2FluidNames();
-
- // Finalise TAE
- TAE.finalizeTAE();
- }
-
- @SuppressWarnings("deprecation")
- public static void fixIC2FluidNames() {
- //Fix IC2 Hot Water name
- try {
- String aNewHeatedWaterName = "Heated Water";
- Logger.INFO("Renaming [IC2 Hotspring Water] --> ["+aNewHeatedWaterName+"].");LanguageRegistry.instance().addStringLocalization("fluidHotWater", "Heated Water");
- LanguageRegistry.instance().addStringLocalization("fluidHotWater", aNewHeatedWaterName);
- LanguageRegistry.instance().addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
- GT_LanguageManager.addStringLocalization("fluidHotWater", aNewHeatedWaterName);
- GT_LanguageManager.addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
-
- Block b = BlocksItems.getFluidBlock(InternalName.fluidHotWater);
- if (b != null) {
- LanguageRegistry.addName(ItemUtils.getSimpleStack(b), aNewHeatedWaterName);
- LanguageRegistry.instance().addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
- GT_LanguageManager.addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
- }
- Fluid f = BlocksItems.getFluid(InternalName.fluidHotWater);
- if (f != null) {
- LanguageRegistry.instance().addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
- GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
- int aDam = FluidRegistry.getFluidID(f);
- ItemStack s = ItemList.Display_Fluid.getWithDamage(1, aDam);
- if (s != null) {
- LanguageRegistry.addName(s, aNewHeatedWaterName);
- }
- }
-
- String[] aLangs = new String[] {
- "de_DE",
- "en_US",
- "en_GB",
- "en_IC",
- "es_AR",
- "es_ES",
- "es_MX",
- "es_UY",
- "es_VE",
- "fr_CA",
- "fr_FR",
- "it_IT",
- "ko_KR",
- "pt_BR",
- "pt_PT",
- "ru_RU",
- "sv_SE",
- "tr_TR",
- "zh_CN",
- "zh_TW",
- };
- String[] aLangValues = new String[] {
- "Erhitztes Wasser",
- "Heated Water",
- "Heated Water",
- "Heated Water",
- "Agua caliente",
- "Agua caliente",
- "Agua caliente",
- "Agua caliente",
- "Agua caliente",
- "Eau chauffée",
- "Eau chauffée",
- "Acqua riscaldata",
- "온수",
- "Água aquecida",
- "Água aquecida",
- "Вода с подогревом",
- "Uppvärmt vatten",
- "Isıtılmış Su",
- "热水",
- "热水",
-
- };
- for (int i=0;i<aLangs.length;i++) {
- Logger.REFLECTION("Trying to inject new lang data for "+aLangs[i]+", using value: "+aLangValues[i]);
- LangUtils.rewriteEntryForLanguageRegistry(aLangs[i], "fluidHotWater", aLangValues[i]);
- LangUtils.rewriteEntryForLanguageRegistry(aLangs[i], "ic2.fluidHotWater", aLangValues[i]);
- }
- }
-
- catch (Throwable t) {
-
- }
- }
-
- public static boolean generatePlasmaRecipesForAdvVacFreezer() {
-
- AutoMap<GT_Recipe> aFreezerMapRebaked = new AutoMap<GT_Recipe>();
- AutoMap<GT_Recipe> aRemovedRecipes = new AutoMap<GT_Recipe>();
-
- //Find recipes containing Plasma and map them
- for (GT_Recipe y : GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList) {
- if (y.mFluidInputs.length > 0) {
- for (FluidStack r : y.mFluidInputs) {
- if (r.getUnlocalizedName().toLowerCase().contains("plasma")) {
- aRemovedRecipes.put(y);
- continue;
- }
- }
- aFreezerMapRebaked.put(y);
- }
- }
-
- AutoMap<GTPP_Recipe> aNewRecipes = new AutoMap<GTPP_Recipe>();
- int aAtomicMass = 0;
- int aAtomicTier = 0;
-
- final FluidStack NULL_PLASMA = Materials._NULL.getPlasma(1);
-
- for (String s : ELEMENT.NAMES) {
-
- aAtomicMass++;
- aAtomicTier = (aAtomicMass/30)+1;
- FluidStack aMoltenFluid = null;
- FluidStack aPlasma = null;
-
- //Try Get Material via Gregtech
- Materials aGregMaterial = MaterialUtils.getMaterial(s);
- if (aGregMaterial != null) {
- aMoltenFluid = aGregMaterial.getMolten(1);
- if (aMoltenFluid == null) {
- aMoltenFluid = aGregMaterial.getFluid(1);
- if (aMoltenFluid == null) {
- aMoltenFluid = aGregMaterial.getGas(1);
- if (aMoltenFluid == null) {
- aMoltenFluid = aGregMaterial.getSolid(1);
- }
- }
- }
- aPlasma = aGregMaterial.getPlasma(100);
- }
-
- //Just wildcard values
- if (aMoltenFluid == null || aPlasma == null) {
- if (aMoltenFluid == null) {
- aMoltenFluid = FluidUtils.getWildcardFluidStack(s, 1);
- }
- if (aPlasma == null) {
- aPlasma = FluidUtils.getFluidStack("plasma."+s.toLowerCase(), 1);
- }
- }
-
- //Skip this material
- if (aMoltenFluid == null || aPlasma == null || aPlasma.isFluidEqual(NULL_PLASMA)) {
- Logger.INFO("Could not generate Advanced Vacuum Freezer recipe. Cooling "+s+" plasma. Molten Form Exists? "+(aMoltenFluid != null)+" | Plasma Exists? "+(aPlasma != null));
- continue;
- }
- else {
- //Build a new plasma recipe
- int aTotalTickTime = (20 * 1 + (aAtomicMass));
- GTPP_Recipe aTempRecipe = new GTPP_Recipe(true,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {10000},
- new FluidStack[] {
- aPlasma,
- FluidUtils.getFluidStack("cryotheum", aTotalTickTime)
- },
- new FluidStack[] {
- aMoltenFluid
- },
- aTotalTickTime,
- (int) GT_Values.V[4+aAtomicTier],
- aAtomicMass);
-
- //Add it to the map if it's valid
- if (aTempRecipe != null) {
- aNewRecipes.put(aTempRecipe);
- }
- }
-
- }
-
-
- //Add the new recipes to the map we will rebake over the original
- for (GTPP_Recipe w : aNewRecipes) {
- aFreezerMapRebaked.put(w);
- }
-
- //Best not touch the original map if we don't have a valid map to override it with.
- if (aFreezerMapRebaked.size() > 0) {
-
- int aOriginalCount = GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList.size();
-
- //Empty the original map
- GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList.clear();
-
- //Rebake the real map
- for (GT_Recipe w : aFreezerMapRebaked) {
- GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList.add(w);
- }
-
- return GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList.size() >= aOriginalCount;
- }
-
- return false;
- }
-
- public static TileEntity constructCustomGregtechMetaTileEntityByMeta(int aMeta) {
- if (aMeta == 12) {
- return Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower();
- }
- else {
- return Meta_GT_Proxy.constructBaseMetaTileEntity();
- }
- }
-
- public static BaseCustomTileEntity constructBaseMetaTileEntity() {
- if (sBaseMetaTileEntityClass == null) {
- try {
- sBaseMetaTileEntityClass = BaseCustomTileEntity.class;
- return (BaseCustomTileEntity) BaseCustomTileEntity.class.newInstance();
- } catch (Throwable arg1) {
- try {
- Constructor<?> g = BaseCustomTileEntity.class.getConstructors()[0];
- g.setAccessible(true);
- return (BaseCustomTileEntity) g.newInstance();
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException | SecurityException e) {
- }
- }
- }
- try {
- return (BaseCustomTileEntity) ((BaseCustomTileEntity) sBaseMetaTileEntityClass.newInstance());
- } catch (Throwable arg0) {
- arg0.printStackTrace(GT_Log.err);
- try {
- Constructor<?> g = BaseCustomTileEntity.class.getConstructors()[0];
- g.setAccessible(true);
- return (BaseCustomTileEntity) g.newInstance();
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException | SecurityException e) {
- GT_Log.err
- .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
- e.printStackTrace(GT_Log.err);
- CORE.crash("GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft.");
- throw new RuntimeException(e);
- }
- }
- }
-
- public static BaseCustomPower_MTE constructBaseMetaTileEntityCustomPower() {
- if (sBaseMetaTileEntityClass2 == null) {
- try {
- sBaseMetaTileEntityClass2 = BaseCustomPower_MTE.class;
- return (BaseCustomPower_MTE) BaseCustomPower_MTE.class.newInstance();
- } catch (Throwable arg1) {
- try {
- Constructor<?> g = BaseCustomPower_MTE.class.getConstructors()[0];
- g.setAccessible(true);
- return (BaseCustomPower_MTE) g.newInstance();
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException | SecurityException e) {
- // e.printStackTrace();
- }
- }
- }
-
- try {
- return (BaseCustomPower_MTE) ((BaseCustomPower_MTE) sBaseMetaTileEntityClass2.newInstance());
- } catch (Throwable arg0) {
- arg0.printStackTrace(GT_Log.err);
- try {
- Constructor<?> g = BaseCustomPower_MTE.class.getConstructors()[0];
- g.setAccessible(true);
- return (BaseCustomPower_MTE) g.newInstance();
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException | SecurityException e) {
- GT_Log.err
- .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
- e.printStackTrace(GT_Log.err);
- CORE.crash("GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft.");
- throw new RuntimeException(e);
- }
- }
- }
-
-
-
-
-
- public static boolean setTileEntityClassAsBlacklistedInWorldAccelerator(String aClassName) {
- if (CORE.GTNH) {
- Class aMainModClass = ReflectionUtils.getClass("com.dreammaster.main.MainRegistry");
- Class aCoreModConfig = ReflectionUtils.getClass("com.dreammaster.config");
- if (aMainModClass != null && aCoreModConfig != null) {
- Field aCoreConfig = ReflectionUtils.getField(aMainModClass, "CoreConfig");
- if (aCoreConfig != null) {
- Field aBlackList = ReflectionUtils.getField(aCoreModConfig, "BlacklistedTileEntiyClassNames");
- Object aInstance = ReflectionUtils.getFieldValue(aCoreConfig);
- if (aBlackList != null && aInstance != null) {
- String[] aBlackListValue = (String[]) ReflectionUtils.getFieldValue(aBlackList, aInstance);
- if (aBlackListValue != null) {
- aBlackListValue = ArrayUtils.add(aBlackListValue, aClassName);
- ReflectionUtils.setField(aInstance, aBlackList, aBlackListValue);
- return true;
- }
- }
- }
- }
- }
- else {
- GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames = ArrayUtils.add(GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames, aClassName);
- return true;
- }
- return false;
- }
-
-
-
- public static void setValidHeatingCoilMetas() {
- for (int i = 0; i <= 6; i++ ) {
- GT_ValidHeatingCoilMetas.put(i);
- }
- if (CORE.GTNH) {
- for (int i = 7; i <= 8; i++ ) {
- GT_ValidHeatingCoilMetas.put(i);
- }
- }
- }
-
- public static boolean areWeUsingGregtech5uExperimental(){
- final int version = GregTech_API.VERSION;
- if ((version == 508) || (version == 507)){
- return false;
- }
- else if (version == 509){
- return true;
- }
- else {
- return false;
- }
- }
-
- static GT_Proxy[] mProxies = new GT_Proxy[2];
-
- /**
- * @deprecated Use {@link StaticFields59#getFieldFromGregtechProxy(boolean,String)} instead
- */
- public static Object getFieldFromGregtechProxy(boolean client, String fieldName) {
- return StaticFields59.getFieldFromGregtechProxy(client, fieldName);
- }
-
- public static void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) {
- mCustomGregtechMetaTooltips.put(aNbtTagName, aData);
- }
-
- public static void conStructGtTileBlockTooltip(ItemStack aStack, EntityPlayer aPlayer, List<Object> aList, boolean par4) {
- try {
- int tDamage = aStack.getItemDamage();
- if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) {
- return;
- }
-
- if (GregTech_API.METATILEENTITIES[tDamage] != null) {
- IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity();
- if (tTileEntity.getDescription() != null) {
- int i = 0;
- for (String tDescription : tTileEntity.getDescription()) {
- if (GT_Utility.isStringValid(tDescription)) {
- if(tDescription.contains("%%%")){
- String[] tString = tDescription.split("%%%");
- if(tString.length>=2){
- StringBuffer tBuffer = new StringBuffer();
- Object tRep[] = new String[tString.length / 2];
- for (int j = 0; j < tString.length; j++)
- if (j % 2 == 0) tBuffer.append(tString[j]);
- else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];}
- aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep));
- }
- }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished );
- aList.add(tTranslated.equals("") ? tDescription : tTranslated);}
- }else i++;
- }
- }
-
-
-
- if (tTileEntity.getEUCapacity() > 0L) {
-
- final long tVoltage = tTileEntity.getInputVoltage();
- byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage)));
-
- //Custom handling
- if (tDamage < 30500 && tDamage >= 30400) {
- int aOffset = tDamage - 30400;
- if ((aOffset) <= 10) {
- tTier -= 2;
- aList.add(EnumChatFormatting.BOLD+"16"+" Fuse Slots"+EnumChatFormatting.GRAY);
- aList.add("Per each fuse, you may insert "+EnumChatFormatting.YELLOW+(GT_Values.V[tTier])+EnumChatFormatting.GRAY+" EU/t");
- aList.add("However this "+EnumChatFormatting.ITALIC+EnumChatFormatting.RED+"MUST"+EnumChatFormatting.GRAY+" be in a single Amp");
- aList.add("This machine can accept upto a single amp of "+GT_Values.VN[Math.min(tTier+2, 12)]+" as a result");
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Breaker_Loss", "Breaker Loss: "+EnumChatFormatting.RED+""+(GT_Values.V[Math.max(tTier-1, 0)]/10)+EnumChatFormatting.GRAY+" EU/t", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
- }
-
-
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Special_Power_1", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
- //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
- //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_3", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
- }
-
-
- if (tTileEntity.getInputVoltage() > 0L) {
- String inA = "0";
- if (tTileEntity.getInputAmperage() >= 1L) {
- inA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getInputAmperage() + EnumChatFormatting.GRAY +" Amps";
- }
- else {
- inA = " at " + EnumChatFormatting.WHITE + tTileEntity.getInputAmperage() + EnumChatFormatting.GRAY +" Amps";
- }
- String a1 = "Voltage IN: "+EnumChatFormatting.GREEN + tTileEntity.getInputVoltage()
- + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")"
- + EnumChatFormatting.GRAY + inA;
- aList.add(a1);
- }
-
- if (tTileEntity.getOutputVoltage() > 0L) {
- String outA = "0";
- if (tTileEntity.getOutputAmperage() >= 1L) {
- outA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps";
- }
- else {
- outA = " at " + EnumChatFormatting.WHITE + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps";
- }
- String a1 = "Voltage OUT: "+EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage()
- + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")"
- + EnumChatFormatting.GRAY + outA;
- aList.add(a1);
- }
-
-
- if (tTileEntity.getOutputVoltage() > 0L) {
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Lossess_EU", "Transmission Loss: "+EnumChatFormatting.DARK_BLUE+""+(tDamage < 30500 && tDamage >= 30400 ? 0 : 1), !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
- }
-
- if (tTileEntity.getEUCapacity() > 0) {
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE2",
- "Internal Capacity: ", !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE
- + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY + " EU");
- }
- }
-
- /*if (tTileEntity.getEUCapacity() > 0L) {
+ static {
+ Logger.INFO("GT_PROXY - initialized.");
+ sDoesVolumetricFlaskExist = ReflectionUtils.doesClassExist("gregtech.common.items.GT_VolumetricFlask");
+ }
+
+ public static List<Runnable> GT_BlockIconload = new ArrayList<>();
+ public static List<Runnable> GT_ItemIconload = new ArrayList<>();
+
+ public static AutoMap<Integer> GT_ValidHeatingCoilMetas = new AutoMap<Integer>();
+
+ private static Class<BaseCustomTileEntity> sBaseMetaTileEntityClass;
+ private static Class<BaseCustomPower_MTE> sBaseMetaTileEntityClass2;
+
+ public static AchievementHandler mAssemblyAchievements;
+
+ public static final Map<String, FormattedTooltipString> mCustomGregtechMetaTooltips =
+ new LinkedHashMap<String, FormattedTooltipString>();
+
+ /**
+ * Does this feature exist within GT? Saves loading useless content if not.
+ */
+ public static final boolean sDoesVolumetricFlaskExist;
+
+ @SideOnly(Side.CLIENT)
+ public static IIconRegister sBlockIcons, sItemIcons;
+
+ public Meta_GT_Proxy() {}
+
+ public static Block sBlockMachines;
+
+ public static void preInit() {
+
+ // New GT++ Block, yay! (Progress)
+ // sBlockMachines = new GTPP_Block_Machines();
+ fixIC2FluidNames();
+
+ GT_Log.out.println("GT++ Mod: Register TileEntities.");
+ BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity();
+ BaseMetaTileEntity tBaseMetaTileEntity2 = constructBaseMetaTileEntityCustomPower();
+
+ GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity.");
+ if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) {
+ GT_Log.err.println(
+ "GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft.");
+ CORE.crash(
+ "GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft.");
+ }
+
+ // Gotta set it here so that we don't try call gregtech too early.
+ // Must set on the correct side
+
+ if (ReflectionUtils.doesFieldExist(GT_Proxy.class, "gt6Pipe")) {
+ StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe");
+ } else {
+ StaticFields59.mGT6StylePipes = false;
+ }
+
+ GT_Log.out.println("GT++ Mod: Registering custom BaseMetaTileEntities.");
+ GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP");
+ GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2");
+ CoverManager.generateCustomCovers();
+ }
+
+ public static void init() {
+ setValidHeatingCoilMetas();
+ PollutionUtils.setPollutionFluids();
+ fixIC2FluidNames();
+ Utils.registerEvent(new MachineUpdateHandler());
+ }
+
+ public static void postInit() {
+ mAssemblyAchievements = new AchievementHandler();
+ fixIC2FluidNames();
+
+ // Finalise TAE
+ TAE.finalizeTAE();
+ }
+
+ @SuppressWarnings("deprecation")
+ public static void fixIC2FluidNames() {
+ // Fix IC2 Hot Water name
+ try {
+ String aNewHeatedWaterName = "Heated Water";
+ Logger.INFO("Renaming [IC2 Hotspring Water] --> [" + aNewHeatedWaterName + "].");
+ LanguageRegistry.instance().addStringLocalization("fluidHotWater", "Heated Water");
+ LanguageRegistry.instance().addStringLocalization("fluidHotWater", aNewHeatedWaterName);
+ LanguageRegistry.instance().addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization("fluidHotWater", aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
+
+ Block b = BlocksItems.getFluidBlock(InternalName.fluidHotWater);
+ if (b != null) {
+ LanguageRegistry.addName(ItemUtils.getSimpleStack(b), aNewHeatedWaterName);
+ LanguageRegistry.instance().addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
+ }
+ Fluid f = BlocksItems.getFluid(InternalName.fluidHotWater);
+ if (f != null) {
+ LanguageRegistry.instance().addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
+ int aDam = FluidRegistry.getFluidID(f);
+ ItemStack s = ItemList.Display_Fluid.getWithDamage(1, aDam);
+ if (s != null) {
+ LanguageRegistry.addName(s, aNewHeatedWaterName);
+ }
+ }
+
+ String[] aLangs = new String[] {
+ "de_DE", "en_US", "en_GB", "en_IC", "es_AR", "es_ES", "es_MX", "es_UY", "es_VE", "fr_CA", "fr_FR",
+ "it_IT", "ko_KR", "pt_BR", "pt_PT", "ru_RU", "sv_SE", "tr_TR", "zh_CN", "zh_TW",
+ };
+ String[] aLangValues = new String[] {
+ "Erhitztes Wasser",
+ "Heated Water",
+ "Heated Water",
+ "Heated Water",
+ "Agua caliente",
+ "Agua caliente",
+ "Agua caliente",
+ "Agua caliente",
+ "Agua caliente",
+ "Eau chauffée",
+ "Eau chauffée",
+ "Acqua riscaldata",
+ "온수",
+ "Água aquecida",
+ "Água aquecida",
+ "Вода с подогревом",
+ "Uppvärmt vatten",
+ "Isıtılmış Su",
+ "热水",
+ "热水",
+ };
+ for (int i = 0; i < aLangs.length; i++) {
+ Logger.REFLECTION(
+ "Trying to inject new lang data for " + aLangs[i] + ", using value: " + aLangValues[i]);
+ LangUtils.rewriteEntryForLanguageRegistry(aLangs[i], "fluidHotWater", aLangValues[i]);
+ LangUtils.rewriteEntryForLanguageRegistry(aLangs[i], "ic2.fluidHotWater", aLangValues[i]);
+ }
+ } catch (Throwable t) {
+
+ }
+ }
+
+ public static boolean generatePlasmaRecipesForAdvVacFreezer() {
+
+ AutoMap<GT_Recipe> aFreezerMapRebaked = new AutoMap<GT_Recipe>();
+ AutoMap<GT_Recipe> aRemovedRecipes = new AutoMap<GT_Recipe>();
+
+ // Find recipes containing Plasma and map them
+ for (GT_Recipe y : GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList) {
+ if (y.mFluidInputs.length > 0) {
+ for (FluidStack r : y.mFluidInputs) {
+ if (r.getUnlocalizedName().toLowerCase().contains("plasma")) {
+ aRemovedRecipes.put(y);
+ continue;
+ }
+ }
+ aFreezerMapRebaked.put(y);
+ }
+ }
+
+ AutoMap<GTPP_Recipe> aNewRecipes = new AutoMap<GTPP_Recipe>();
+ int aAtomicMass = 0;
+ int aAtomicTier = 0;
+
+ final FluidStack NULL_PLASMA = Materials._NULL.getPlasma(1);
+
+ for (String s : ELEMENT.NAMES) {
+
+ aAtomicMass++;
+ aAtomicTier = (aAtomicMass / 30) + 1;
+ FluidStack aMoltenFluid = null;
+ FluidStack aPlasma = null;
+
+ // Try Get Material via Gregtech
+ Materials aGregMaterial = MaterialUtils.getMaterial(s);
+ if (aGregMaterial != null) {
+ aMoltenFluid = aGregMaterial.getMolten(1);
+ if (aMoltenFluid == null) {
+ aMoltenFluid = aGregMaterial.getFluid(1);
+ if (aMoltenFluid == null) {
+ aMoltenFluid = aGregMaterial.getGas(1);
+ if (aMoltenFluid == null) {
+ aMoltenFluid = aGregMaterial.getSolid(1);
+ }
+ }
+ }
+ aPlasma = aGregMaterial.getPlasma(100);
+ }
+
+ // Just wildcard values
+ if (aMoltenFluid == null || aPlasma == null) {
+ if (aMoltenFluid == null) {
+ aMoltenFluid = FluidUtils.getWildcardFluidStack(s, 1);
+ }
+ if (aPlasma == null) {
+ aPlasma = FluidUtils.getFluidStack("plasma." + s.toLowerCase(), 1);
+ }
+ }
+
+ // Skip this material
+ if (aMoltenFluid == null || aPlasma == null || aPlasma.isFluidEqual(NULL_PLASMA)) {
+ Logger.INFO("Could not generate Advanced Vacuum Freezer recipe. Cooling " + s
+ + " plasma. Molten Form Exists? " + (aMoltenFluid != null) + " | Plasma Exists? "
+ + (aPlasma != null));
+ continue;
+ } else {
+ // Build a new plasma recipe
+ int aTotalTickTime = (20 * 1 + (aAtomicMass));
+ GTPP_Recipe aTempRecipe = new GTPP_Recipe(
+ true,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {10000},
+ new FluidStack[] {aPlasma, FluidUtils.getFluidStack("cryotheum", aTotalTickTime)},
+ new FluidStack[] {aMoltenFluid},
+ aTotalTickTime,
+ (int) GT_Values.V[4 + aAtomicTier],
+ aAtomicMass);
+
+ // Add it to the map if it's valid
+ if (aTempRecipe != null) {
+ aNewRecipes.put(aTempRecipe);
+ }
+ }
+ }
+
+ // Add the new recipes to the map we will rebake over the original
+ for (GTPP_Recipe w : aNewRecipes) {
+ aFreezerMapRebaked.put(w);
+ }
+
+ // Best not touch the original map if we don't have a valid map to override it with.
+ if (aFreezerMapRebaked.size() > 0) {
+
+ int aOriginalCount = GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList.size();
+
+ // Empty the original map
+ GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList.clear();
+
+ // Rebake the real map
+ for (GT_Recipe w : aFreezerMapRebaked) {
+ GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList.add(w);
+ }
+
+ return GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mRecipeList.size() >= aOriginalCount;
+ }
+
+ return false;
+ }
+
+ public static TileEntity constructCustomGregtechMetaTileEntityByMeta(int aMeta) {
+ if (aMeta == 12) {
+ return Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower();
+ } else {
+ return Meta_GT_Proxy.constructBaseMetaTileEntity();
+ }
+ }
+
+ public static BaseCustomTileEntity constructBaseMetaTileEntity() {
+ if (sBaseMetaTileEntityClass == null) {
+ try {
+ sBaseMetaTileEntityClass = BaseCustomTileEntity.class;
+ return (BaseCustomTileEntity) BaseCustomTileEntity.class.newInstance();
+ } catch (Throwable arg1) {
+ try {
+ Constructor<?> g = BaseCustomTileEntity.class.getConstructors()[0];
+ g.setAccessible(true);
+ return (BaseCustomTileEntity) g.newInstance();
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException
+ | SecurityException e) {
+ }
+ }
+ }
+ try {
+ return (BaseCustomTileEntity) ((BaseCustomTileEntity) sBaseMetaTileEntityClass.newInstance());
+ } catch (Throwable arg0) {
+ arg0.printStackTrace(GT_Log.err);
+ try {
+ Constructor<?> g = BaseCustomTileEntity.class.getConstructors()[0];
+ g.setAccessible(true);
+ return (BaseCustomTileEntity) g.newInstance();
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException
+ | SecurityException e) {
+ GT_Log.err.println(
+ "GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ e.printStackTrace(GT_Log.err);
+ CORE.crash(
+ "GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft.");
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public static BaseCustomPower_MTE constructBaseMetaTileEntityCustomPower() {
+ if (sBaseMetaTileEntityClass2 == null) {
+ try {
+ sBaseMetaTileEntityClass2 = BaseCustomPower_MTE.class;
+ return (BaseCustomPower_MTE) BaseCustomPower_MTE.class.newInstance();
+ } catch (Throwable arg1) {
+ try {
+ Constructor<?> g = BaseCustomPower_MTE.class.getConstructors()[0];
+ g.setAccessible(true);
+ return (BaseCustomPower_MTE) g.newInstance();
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException
+ | SecurityException e) {
+ // e.printStackTrace();
+ }
+ }
+ }
+
+ try {
+ return (BaseCustomPower_MTE) ((BaseCustomPower_MTE) sBaseMetaTileEntityClass2.newInstance());
+ } catch (Throwable arg0) {
+ arg0.printStackTrace(GT_Log.err);
+ try {
+ Constructor<?> g = BaseCustomPower_MTE.class.getConstructors()[0];
+ g.setAccessible(true);
+ return (BaseCustomPower_MTE) g.newInstance();
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException
+ | SecurityException e) {
+ GT_Log.err.println(
+ "GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ e.printStackTrace(GT_Log.err);
+ CORE.crash(
+ "GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft.");
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public static boolean setTileEntityClassAsBlacklistedInWorldAccelerator(String aClassName) {
+ if (CORE.GTNH) {
+ Class aMainModClass = ReflectionUtils.getClass("com.dreammaster.main.MainRegistry");
+ Class aCoreModConfig = ReflectionUtils.getClass("com.dreammaster.config");
+ if (aMainModClass != null && aCoreModConfig != null) {
+ Field aCoreConfig = ReflectionUtils.getField(aMainModClass, "CoreConfig");
+ if (aCoreConfig != null) {
+ Field aBlackList = ReflectionUtils.getField(aCoreModConfig, "BlacklistedTileEntiyClassNames");
+ Object aInstance = ReflectionUtils.getFieldValue(aCoreConfig);
+ if (aBlackList != null && aInstance != null) {
+ String[] aBlackListValue = (String[]) ReflectionUtils.getFieldValue(aBlackList, aInstance);
+ if (aBlackListValue != null) {
+ aBlackListValue = ArrayUtils.add(aBlackListValue, aClassName);
+ ReflectionUtils.setField(aInstance, aBlackList, aBlackListValue);
+ return true;
+ }
+ }
+ }
+ }
+ } else {
+ GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames =
+ ArrayUtils.add(GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames, aClassName);
+ return true;
+ }
+ return false;
+ }
+
+ public static void setValidHeatingCoilMetas() {
+ for (int i = 0; i <= 6; i++) {
+ GT_ValidHeatingCoilMetas.put(i);
+ }
+ if (CORE.GTNH) {
+ for (int i = 7; i <= 8; i++) {
+ GT_ValidHeatingCoilMetas.put(i);
+ }
+ }
+ }
+
+ public static boolean areWeUsingGregtech5uExperimental() {
+ final int version = GregTech_API.VERSION;
+ if ((version == 508) || (version == 507)) {
+ return false;
+ } else if (version == 509) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ static GT_Proxy[] mProxies = new GT_Proxy[2];
+
+ /**
+ * @deprecated Use {@link StaticFields59#getFieldFromGregtechProxy(boolean,String)} instead
+ */
+ public static Object getFieldFromGregtechProxy(boolean client, String fieldName) {
+ return StaticFields59.getFieldFromGregtechProxy(client, fieldName);
+ }
+
+ public static void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) {
+ mCustomGregtechMetaTooltips.put(aNbtTagName, aData);
+ }
+
+ public static void conStructGtTileBlockTooltip(
+ ItemStack aStack, EntityPlayer aPlayer, List<Object> aList, boolean par4) {
+ try {
+ int tDamage = aStack.getItemDamage();
+ if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) {
+ return;
+ }
+
+ if (GregTech_API.METATILEENTITIES[tDamage] != null) {
+ IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity();
+ if (tTileEntity.getDescription() != null) {
+ int i = 0;
+ for (String tDescription : tTileEntity.getDescription()) {
+ if (GT_Utility.isStringValid(tDescription)) {
+ if (tDescription.contains("%%%")) {
+ String[] tString = tDescription.split("%%%");
+ if (tString.length >= 2) {
+ StringBuffer tBuffer = new StringBuffer();
+ Object tRep[] = new String[tString.length / 2];
+ for (int j = 0; j < tString.length; j++)
+ if (j % 2 == 0) tBuffer.append(tString[j]);
+ else {
+ tBuffer.append(" %s");
+ tRep[j / 2] = tString[j];
+ }
+ aList.add(String.format(
+ GT_LanguageManager.addStringLocalization(
+ "TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++,
+ tBuffer.toString(),
+ !GregTech_API.sPostloadFinished),
+ tRep));
+ }
+ } else {
+ String tTranslated = GT_LanguageManager.addStringLocalization(
+ "TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++,
+ tDescription,
+ !GregTech_API.sPostloadFinished);
+ aList.add(tTranslated.equals("") ? tDescription : tTranslated);
+ }
+ } else i++;
+ }
+ }
+
+ if (tTileEntity.getEUCapacity() > 0L) {
+
+ final long tVoltage = tTileEntity.getInputVoltage();
+ byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage)));
+
+ // Custom handling
+ if (tDamage < 30500 && tDamage >= 30400) {
+ int aOffset = tDamage - 30400;
+ if ((aOffset) <= 10) {
+ tTier -= 2;
+ aList.add(EnumChatFormatting.BOLD + "16" + " Fuse Slots" + EnumChatFormatting.GRAY);
+ aList.add("Per each fuse, you may insert " + EnumChatFormatting.YELLOW
+ + (GT_Values.V[tTier]) + EnumChatFormatting.GRAY + " EU/t");
+ aList.add("However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST"
+ + EnumChatFormatting.GRAY + " be in a single Amp");
+ aList.add("This machine can accept upto a single amp of "
+ + GT_Values.VN[Math.min(tTier + 2, 12)] + " as a result");
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "TileEntity_Breaker_Loss",
+ "Breaker Loss: " + EnumChatFormatting.RED + ""
+ + (GT_Values.V[Math.max(tTier - 1, 0)] / 10)
+ + EnumChatFormatting.GRAY + " EU/t",
+ !GregTech_API.sPostloadFinished)
+ + EnumChatFormatting.GRAY);
+ }
+
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "TileEntity_Special_Power_1",
+ EnumChatFormatting.RED + "Special Power Handling, please read manual",
+ !GregTech_API.sPostloadFinished)
+ + EnumChatFormatting.GRAY);
+ // aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2",
+ // EnumChatFormatting.RED+"Special Power Handling, please read manual",
+ // !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
+ // aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_3",
+ // EnumChatFormatting.RED+"Special Power Handling, please read manual",
+ // !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
+ }
+
+ if (tTileEntity.getInputVoltage() > 0L) {
+ String inA = "0";
+ if (tTileEntity.getInputAmperage() >= 1L) {
+ inA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getInputAmperage()
+ + EnumChatFormatting.GRAY + " Amps";
+ } else {
+ inA = " at " + EnumChatFormatting.WHITE + tTileEntity.getInputAmperage()
+ + EnumChatFormatting.GRAY + " Amps";
+ }
+ String a1 = "Voltage IN: " + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage()
+ + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")"
+ + EnumChatFormatting.GRAY + inA;
+ aList.add(a1);
+ }
+
+ if (tTileEntity.getOutputVoltage() > 0L) {
+ String outA = "0";
+ if (tTileEntity.getOutputAmperage() >= 1L) {
+ outA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage()
+ + EnumChatFormatting.GRAY + " Amps";
+ } else {
+ outA = " at " + EnumChatFormatting.WHITE + tTileEntity.getOutputAmperage()
+ + EnumChatFormatting.GRAY + " Amps";
+ }
+ String a1 = "Voltage OUT: " + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage()
+ + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")"
+ + EnumChatFormatting.GRAY + outA;
+ aList.add(a1);
+ }
+
+ if (tTileEntity.getOutputVoltage() > 0L) {
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "TileEntity_Lossess_EU",
+ "Transmission Loss: " + EnumChatFormatting.DARK_BLUE + ""
+ + (tDamage < 30500 && tDamage >= 30400 ? 0 : 1),
+ !GregTech_API.sPostloadFinished)
+ + EnumChatFormatting.GRAY);
+ }
+
+ if (tTileEntity.getEUCapacity() > 0) {
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "TileEntity_EUp_STORE2", "Internal Capacity: ", !GregTech_API.sPostloadFinished)
+ + EnumChatFormatting.BLUE
+ + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY + " EU");
+ }
+ }
+
+ /*if (tTileEntity.getEUCapacity() > 0L) {
if (tTileEntity.getInputVoltage() > 0L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY);
}
@@ -581,53 +594,60 @@ public class Meta_GT_Proxy {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY);
}*/
- }
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- if (aNBT.getBoolean("mMuffler")) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished ));
- }
- if (aNBT.getBoolean("mSteamConverter")) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished ));
- }
- int tAmount = 0;
- if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) {
- aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished ));
- }
-
- FluidStack afluid = net.minecraftforge.fluids.FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- if (afluid != null) {
- int tFluidAmount = afluid.amount;
- if (tFluidAmount > 0) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_FLUIDTANK", "Tank Fluid: "+tFluidAmount+"L "+afluid.getLocalizedName()+"", !GregTech_API.sPostloadFinished ));
- }
- }
-
- }
-
- //Add Custom Here
-
- //Add Custom Tooltips
- for (String s : mCustomGregtechMetaTooltips.keySet()) {
- if (aNBT.hasKey(s)) {
- String aTip = mCustomGregtechMetaTooltips.get(s).getTooltip(aNBT.getString(s));
- aList.add(aTip);
- }
- }
-
- //Add GT++ Stuff
-
- if (tDamage >= 30400 && tDamage < 30500) {
- aList.add(EnumChatFormatting.UNDERLINE+"Special GT++ Machine");
- }
- if ((tDamage >= 750 && tDamage < 1000) || (tDamage >= 30000 && tDamage < 31000)) {
- aList.add(CORE.GT_Tooltip);
- }
-
-
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
- }
-
+ }
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ if (aNBT.getBoolean("mMuffler")) {
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished));
+ }
+ if (aNBT.getBoolean("mSteamConverter")) {
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished));
+ }
+ int tAmount = 0;
+ if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) {
+ aList.add(tAmount + " "
+ + GT_LanguageManager.addStringLocalization(
+ "GT_TileEntity_STEAMTANKS",
+ "Steam Tank Upgrades",
+ !GregTech_API.sPostloadFinished));
+ }
+
+ FluidStack afluid =
+ net.minecraftforge.fluids.FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ if (afluid != null) {
+ int tFluidAmount = afluid.amount;
+ if (tFluidAmount > 0) {
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "GT_TileEntity_FLUIDTANK",
+ "Tank Fluid: " + tFluidAmount + "L " + afluid.getLocalizedName() + "",
+ !GregTech_API.sPostloadFinished));
+ }
+ }
+ }
+
+ // Add Custom Here
+
+ // Add Custom Tooltips
+ for (String s : mCustomGregtechMetaTooltips.keySet()) {
+ if (aNBT.hasKey(s)) {
+ String aTip = mCustomGregtechMetaTooltips.get(s).getTooltip(aNBT.getString(s));
+ aList.add(aTip);
+ }
+ }
+
+ // Add GT++ Stuff
+
+ if (tDamage >= 30400 && tDamage < 30500) {
+ aList.add(EnumChatFormatting.UNDERLINE + "Special GT++ Machine");
+ }
+ if ((tDamage >= 750 && tDamage < 1000) || (tDamage >= 30000 && tDamage < 31000)) {
+ aList.add(CORE.GT_Tooltip);
+ }
+
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
index 44c580fe4f..0f98d8ab55 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
@@ -1,14 +1,5 @@
package gtPlusPlus.xmod.gregtech.common;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -26,278 +17,280 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.reflect.ProxyFinder;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
public class StaticFields59 {
-
- public static boolean mGT6StylePipes;
-
- public static final Field mGtBlockCasings5;
- public static final Field mPreventableComponents;
- public static final Field mDisabledItems;
- public static final Field mMultiblockChemicalRecipes;
- public static final Field mPyrolyseRecipes;
- public static final Field mDescriptionArray;
- public static final Field mCasingTexturePages;
- public static final Field mAssLineVisualMapNEI;
- public static final GT_Recipe_Map sAssemblylineVisualRecipes;
-
- public static final Method mCalculatePollutionReduction;
- public static final Method mAddFurnaceRecipe;
-
- private static final Map<String, Materials> mMaterialCache = new LinkedHashMap<String, Materials>();
-
-
- //OrePrefixes
-
- static {
- Logger.INFO("[SH] Creating Static Helper for various fields which require reflective access.");
-
- mGtBlockCasings5 = getField(GregTech_API.class, "sBlockCasings5");
- Logger.INFO("[SH] Got Field: sBlockCasings5");
- mPreventableComponents = getField(OrePrefixes.class, "mPreventableComponents");
- Logger.INFO("[SH] Got Field: mPreventableComponents");
- mDisabledItems = getField(OrePrefixes.class, "mDisabledItems");
- Logger.INFO("[SH] Got Field: mDisabledItems");
- mDescriptionArray = getField(GT_MetaTileEntity_TieredMachineBlock.class, "mDescriptionArray");
- Logger.INFO("[SH] Got Field: mDescriptionArray");
- mCasingTexturePages = getField(BlockIcons.class, "casingTexturePages");
- Logger.INFO("[SH] Got Field: casingTexturePages");
-
- mAssLineVisualMapNEI = getField(GT_Recipe_Map.class, "sAssemblylineVisualRecipes");
- Logger.INFO("[SH] Got Field: mAssLineVisualMapNEI");
- GT_Recipe_Map aTemp;
- if (mAssLineVisualMapNEI != null) {
- try {
- aTemp = (GT_Recipe_Map) mAssLineVisualMapNEI.get(null);
- Logger.INFO("[SH] Got Field: sAssemblylineVisualRecipes");
- } catch (IllegalArgumentException | IllegalAccessException e) {
- aTemp = null;
- }
- } else {
- aTemp = null;
- }
-
- sAssemblylineVisualRecipes = aTemp;
-
- mMultiblockChemicalRecipes = getField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes");
- Logger.INFO("[SH] Got Field: sMultiblockChemicalRecipes");
- if (ReflectionUtils.doesFieldExist(GT_Recipe.GT_Recipe_Map.class, "sPyrolyseRecipes")) {
- mPyrolyseRecipes = getField(GT_Recipe_Map.class, "sPyrolyseRecipes");
- Logger.INFO("[SH] Got Field: sPyrolyseRecipes");
- }
- else {
- mPyrolyseRecipes = null;
- }
-
- mCalculatePollutionReduction = getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction",
- int.class);
- Logger.INFO("[SH] Got Method: calculatePollutionReduction");
-
- // Yep...
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
- ItemStack.class);
- Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe");
- } else {
- mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
- ItemStack.class, boolean.class);
- Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe");
- }
-
- }
-
- public static synchronized final Block getBlockCasings5() {
- try {
- return (Block) mGtBlockCasings5.get(GregTech_API.class);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return null;
- }
- }
-
- public static int calculatePollutionReducation(GT_MetaTileEntity_Hatch_Muffler h, int i) {
- try {
- return (int) mCalculatePollutionReduction.invoke(h, i);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return 0;
- }
- }
-
- public static Field getField(Class a, String b) {
- return ReflectionUtils.getField(a, b);
- }
-
- public static Method getMethod(Class a, String b, Class... params) {
- return ReflectionUtils.getMethod(a, b, params);
- }
-
- public static synchronized final Collection<Materials> getOrePrefixesBooleanDisabledItems() {
- try {
- return (Collection<Materials>) mDisabledItems.get(OrePrefixes.class);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return new ArrayList<Materials>();
- }
- }
-
-
- public static synchronized final List<OrePrefixes> geOrePrefixesBooleanPreventableComponents() {
- try {
- return (List<OrePrefixes>) mPreventableComponents.get(OrePrefixes.class);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return new ArrayList<OrePrefixes>();
- }
- }
-
- public static synchronized final GT_Recipe_Map getLargeChemicalReactorRecipeMap() {
- try {
- return (GT_Recipe_Map) mMultiblockChemicalRecipes.get(null);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return null;
- }
- }
-
- public static synchronized final GT_Recipe_Map getPyrolyseRecipeMap() {
- try {
- return mPyrolyseRecipes != null ? (GT_Recipe_Map) mPyrolyseRecipes.get(null) : null;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return null;
- }
- }
-
- public static Materials getMaterial(String aMaterialName) {
- Materials m = mMaterialCache.get(aMaterialName);
- if (m != null) {
- return m;
- }
- else {
- m = Materials.get(aMaterialName);
- if (m != null) {
- mMaterialCache.put(aMaterialName, m);
- return m;
- }
- return null;
- }
- }
-
- public static String[] getDescriptionArray(GT_MetaTileEntity_TieredMachineBlock aTile) {
- try {
- return (String[]) mDescriptionArray.get(aTile);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- return new String[] {aTile.mDescription};
- }
- }
-
- public static ITexture getCasingTexturePages(int a, int b) {
- try {
- ITexture[][] g = (ITexture[][]) mCasingTexturePages.get(null);
- if (g != null) {
- return g[a][b];
- }
- }
- catch (Throwable t) {
-
- }
- return null;
- }
-
-
- public static Object getFieldFromGregtechProxy(String fieldName) {
- return getFieldFromGregtechProxy(Utils.isServer() ? false : true, fieldName);
- }
-
- public static Object getFieldFromGregtechProxy(boolean client, String fieldName) {
- Object proxyGT;
-
- if (Meta_GT_Proxy.mProxies[0] != null && client) {
- proxyGT = Meta_GT_Proxy.mProxies[0];
- } else if (Meta_GT_Proxy.mProxies[1] != null && !client) {
- proxyGT = Meta_GT_Proxy.mProxies[1];
- } else {
- try {
- proxyGT = (client ? ProxyFinder.getClientProxy(GT_Mod.instance)
- : ProxyFinder.getServerProxy(GT_Mod.instance));
- } catch (final ReflectiveOperationException e1) {
- proxyGT = null;
- Logger.INFO("Failed to obtain instance of GT " + (client ? "Client" : "Server") + " proxy.");
- }
- if (Meta_GT_Proxy.mProxies[0] == null && client) {
- Meta_GT_Proxy.mProxies[0] = (GT_Proxy) proxyGT;
- } else if (Meta_GT_Proxy.mProxies[1] == null && !client) {
- Meta_GT_Proxy.mProxies[1] = (GT_Proxy) proxyGT;
- }
- }
-
- if (proxyGT != null && proxyGT instanceof GT_Proxy) {
- try {
- return ReflectionUtils.getField(proxyGT.getClass(), fieldName).get(proxyGT);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- return null;
- }
-
-
-
- public static int getTierForCoil(Block aBlock, int aMeta) {
- if (aBlock == GregTech_API.sBlockCasings1 && (aMeta >= 12 && aMeta <= 14)) {
- return aMeta == 12 ? 1 : aMeta == 13 ? 2 : 3;
- }
- else if (aBlock == getBlockCasings5() && (aMeta >= 0 && aMeta <= 10)) {
- return aMeta;
- }
- return 0;
- }
-
- public static int getHeatingCapacityForCoil(Block aBlock, int aMeta) {
- int aTier = getTierForCoil(aBlock, aMeta);
- return aTier > 0 ? getHeatingCapacityForCoilTier(aTier) : 0;
- }
-
- public static int getHeatingCapacityForCoilTier(int aCoilTier) {
- int mHeatingCapacity = 0;
- switch (aCoilTier) {
- case 0:
- mHeatingCapacity = 1800;
- break;
- case 1:
- mHeatingCapacity = 2700;
- break;
- case 2:
- mHeatingCapacity = 3600;
- break;
- case 3:
- mHeatingCapacity = 4500;
- break;
- case 4:
- mHeatingCapacity = 5400;
- break;
- case 5:
- mHeatingCapacity = 7200;
- break;
- case 6:
- mHeatingCapacity = 9000;
- break;
- case 7:
- mHeatingCapacity = 9900;
- break;
- case 8:
- mHeatingCapacity = 10800;
- break;
- case 9:
- mHeatingCapacity = 6300;
- break;
- case 10:
- mHeatingCapacity = 9000;
- break;
- default:
- Logger.INFO("Heating Coils are bad.");
- mHeatingCapacity = 0;
- }
- if (CORE.GTNH && aCoilTier <= 10) {
- mHeatingCapacity += 1;
- }
- return mHeatingCapacity;
- }
+ public static boolean mGT6StylePipes;
+
+ public static final Field mGtBlockCasings5;
+ public static final Field mPreventableComponents;
+ public static final Field mDisabledItems;
+ public static final Field mMultiblockChemicalRecipes;
+ public static final Field mPyrolyseRecipes;
+ public static final Field mDescriptionArray;
+ public static final Field mCasingTexturePages;
+ public static final Field mAssLineVisualMapNEI;
+ public static final GT_Recipe_Map sAssemblylineVisualRecipes;
+
+ public static final Method mCalculatePollutionReduction;
+ public static final Method mAddFurnaceRecipe;
+
+ private static final Map<String, Materials> mMaterialCache = new LinkedHashMap<String, Materials>();
+
+ // OrePrefixes
+
+ static {
+ Logger.INFO("[SH] Creating Static Helper for various fields which require reflective access.");
+
+ mGtBlockCasings5 = getField(GregTech_API.class, "sBlockCasings5");
+ Logger.INFO("[SH] Got Field: sBlockCasings5");
+ mPreventableComponents = getField(OrePrefixes.class, "mPreventableComponents");
+ Logger.INFO("[SH] Got Field: mPreventableComponents");
+ mDisabledItems = getField(OrePrefixes.class, "mDisabledItems");
+ Logger.INFO("[SH] Got Field: mDisabledItems");
+ mDescriptionArray = getField(GT_MetaTileEntity_TieredMachineBlock.class, "mDescriptionArray");
+ Logger.INFO("[SH] Got Field: mDescriptionArray");
+ mCasingTexturePages = getField(BlockIcons.class, "casingTexturePages");
+ Logger.INFO("[SH] Got Field: casingTexturePages");
+
+ mAssLineVisualMapNEI = getField(GT_Recipe_Map.class, "sAssemblylineVisualRecipes");
+ Logger.INFO("[SH] Got Field: mAssLineVisualMapNEI");
+ GT_Recipe_Map aTemp;
+ if (mAssLineVisualMapNEI != null) {
+ try {
+ aTemp = (GT_Recipe_Map) mAssLineVisualMapNEI.get(null);
+ Logger.INFO("[SH] Got Field: sAssemblylineVisualRecipes");
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ aTemp = null;
+ }
+ } else {
+ aTemp = null;
+ }
+
+ sAssemblylineVisualRecipes = aTemp;
+
+ mMultiblockChemicalRecipes = getField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes");
+ Logger.INFO("[SH] Got Field: sMultiblockChemicalRecipes");
+ if (ReflectionUtils.doesFieldExist(GT_Recipe.GT_Recipe_Map.class, "sPyrolyseRecipes")) {
+ mPyrolyseRecipes = getField(GT_Recipe_Map.class, "sPyrolyseRecipes");
+ Logger.INFO("[SH] Got Field: sPyrolyseRecipes");
+ } else {
+ mPyrolyseRecipes = null;
+ }
+
+ mCalculatePollutionReduction =
+ getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction", int.class);
+ Logger.INFO("[SH] Got Method: calculatePollutionReduction");
+
+ // Yep...
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ mAddFurnaceRecipe = getMethod(
+ GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class);
+ Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe");
+ } else {
+ mAddFurnaceRecipe = getMethod(
+ GT_ModHandler.class,
+ "addSmeltingAndAlloySmeltingRecipe",
+ ItemStack.class,
+ ItemStack.class,
+ boolean.class);
+ Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe");
+ }
+ }
+
+ public static final synchronized Block getBlockCasings5() {
+ try {
+ return (Block) mGtBlockCasings5.get(GregTech_API.class);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return null;
+ }
+ }
+
+ public static int calculatePollutionReducation(GT_MetaTileEntity_Hatch_Muffler h, int i) {
+ try {
+ return (int) mCalculatePollutionReduction.invoke(h, i);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return 0;
+ }
+ }
+
+ public static Field getField(Class a, String b) {
+ return ReflectionUtils.getField(a, b);
+ }
+
+ public static Method getMethod(Class a, String b, Class... params) {
+ return ReflectionUtils.getMethod(a, b, params);
+ }
+
+ public static final synchronized Collection<Materials> getOrePrefixesBooleanDisabledItems() {
+ try {
+ return (Collection<Materials>) mDisabledItems.get(OrePrefixes.class);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return new ArrayList<Materials>();
+ }
+ }
+
+ public static final synchronized List<OrePrefixes> geOrePrefixesBooleanPreventableComponents() {
+ try {
+ return (List<OrePrefixes>) mPreventableComponents.get(OrePrefixes.class);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return new ArrayList<OrePrefixes>();
+ }
+ }
+
+ public static final synchronized GT_Recipe_Map getLargeChemicalReactorRecipeMap() {
+ try {
+ return (GT_Recipe_Map) mMultiblockChemicalRecipes.get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return null;
+ }
+ }
+
+ public static final synchronized GT_Recipe_Map getPyrolyseRecipeMap() {
+ try {
+ return mPyrolyseRecipes != null ? (GT_Recipe_Map) mPyrolyseRecipes.get(null) : null;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return null;
+ }
+ }
+
+ public static Materials getMaterial(String aMaterialName) {
+ Materials m = mMaterialCache.get(aMaterialName);
+ if (m != null) {
+ return m;
+ } else {
+ m = Materials.get(aMaterialName);
+ if (m != null) {
+ mMaterialCache.put(aMaterialName, m);
+ return m;
+ }
+ return null;
+ }
+ }
+
+ public static String[] getDescriptionArray(GT_MetaTileEntity_TieredMachineBlock aTile) {
+ try {
+ return (String[]) mDescriptionArray.get(aTile);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return new String[] {aTile.mDescription};
+ }
+ }
+
+ public static ITexture getCasingTexturePages(int a, int b) {
+ try {
+ ITexture[][] g = (ITexture[][]) mCasingTexturePages.get(null);
+ if (g != null) {
+ return g[a][b];
+ }
+ } catch (Throwable t) {
+
+ }
+ return null;
+ }
+
+ public static Object getFieldFromGregtechProxy(String fieldName) {
+ return getFieldFromGregtechProxy(Utils.isServer() ? false : true, fieldName);
+ }
+
+ public static Object getFieldFromGregtechProxy(boolean client, String fieldName) {
+ Object proxyGT;
+
+ if (Meta_GT_Proxy.mProxies[0] != null && client) {
+ proxyGT = Meta_GT_Proxy.mProxies[0];
+ } else if (Meta_GT_Proxy.mProxies[1] != null && !client) {
+ proxyGT = Meta_GT_Proxy.mProxies[1];
+ } else {
+ try {
+ proxyGT = (client
+ ? ProxyFinder.getClientProxy(GT_Mod.instance)
+ : ProxyFinder.getServerProxy(GT_Mod.instance));
+ } catch (final ReflectiveOperationException e1) {
+ proxyGT = null;
+ Logger.INFO("Failed to obtain instance of GT " + (client ? "Client" : "Server") + " proxy.");
+ }
+ if (Meta_GT_Proxy.mProxies[0] == null && client) {
+ Meta_GT_Proxy.mProxies[0] = (GT_Proxy) proxyGT;
+ } else if (Meta_GT_Proxy.mProxies[1] == null && !client) {
+ Meta_GT_Proxy.mProxies[1] = (GT_Proxy) proxyGT;
+ }
+ }
+
+ if (proxyGT != null && proxyGT instanceof GT_Proxy) {
+ try {
+ return ReflectionUtils.getField(proxyGT.getClass(), fieldName).get(proxyGT);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ return null;
+ }
+
+ public static int getTierForCoil(Block aBlock, int aMeta) {
+ if (aBlock == GregTech_API.sBlockCasings1 && (aMeta >= 12 && aMeta <= 14)) {
+ return aMeta == 12 ? 1 : aMeta == 13 ? 2 : 3;
+ } else if (aBlock == getBlockCasings5() && (aMeta >= 0 && aMeta <= 10)) {
+ return aMeta;
+ }
+ return 0;
+ }
+
+ public static int getHeatingCapacityForCoil(Block aBlock, int aMeta) {
+ int aTier = getTierForCoil(aBlock, aMeta);
+ return aTier > 0 ? getHeatingCapacityForCoilTier(aTier) : 0;
+ }
+
+ public static int getHeatingCapacityForCoilTier(int aCoilTier) {
+ int mHeatingCapacity = 0;
+ switch (aCoilTier) {
+ case 0:
+ mHeatingCapacity = 1800;
+ break;
+ case 1:
+ mHeatingCapacity = 2700;
+ break;
+ case 2:
+ mHeatingCapacity = 3600;
+ break;
+ case 3:
+ mHeatingCapacity = 4500;
+ break;
+ case 4:
+ mHeatingCapacity = 5400;
+ break;
+ case 5:
+ mHeatingCapacity = 7200;
+ break;
+ case 6:
+ mHeatingCapacity = 9000;
+ break;
+ case 7:
+ mHeatingCapacity = 9900;
+ break;
+ case 8:
+ mHeatingCapacity = 10800;
+ break;
+ case 9:
+ mHeatingCapacity = 6300;
+ break;
+ case 10:
+ mHeatingCapacity = 9000;
+ break;
+ default:
+ Logger.INFO("Heating Coils are bad.");
+ mHeatingCapacity = 0;
+ }
+ if (CORE.GTNH && aCoilTier <= 10) {
+ mHeatingCapacity += 1;
+ }
+ return mHeatingCapacity;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java
index 01f655c355..83cbc0065c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java
@@ -1,29 +1,24 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-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.enums.Textures.BlockIcons;
import gregtech.api.interfaces.IDebugableBlock;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_Generic_Block;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.BaseTileEntity;
-import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
-import gregtech.common.blocks.GT_Item_Machines;
import gregtech.common.blocks.GT_Material_Machines;
-import gregtech.common.render.GT_Renderer_Block;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -47,488 +42,497 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableBlock, ITileEntityProvider {
- public static ThreadLocal<IGregTechTileEntity> mTemporaryTileEntity = new ThreadLocal<IGregTechTileEntity>();
-
- public GTPP_Block_Machines() {
- super(GTPP_Item_Machines.class, "gtpp.blockmachines", new GT_Material_Machines());
- GregTech_API.registerMachineBlock(this, -1);
- this.setHardness(1.0F);
- this.setResistance(10.0F);
- this.setStepSound(soundTypeMetal);
- this.setCreativeTab(GregTech_API.TAB_GREGTECH);
- this.isBlockContainer = true;
- }
-
- public String getHarvestTool(int aMeta) {
- switch (aMeta / 4) {
- case 0 :
- return "wrench";
- case 1 :
- return "wrench";
- case 2 :
- return "cutter";
- case 3 :
- return "axe";
- default :
- return "wrench";
- }
- }
-
- public int getHarvestLevel(int aMeta) {
- return aMeta % 4;
- }
-
- protected boolean canSilkHarvest() {
- return false;
- }
-
- public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof BaseTileEntity) {
- ((BaseTileEntity) tTileEntity).onAdjacentBlockChange(aTileX, aTileY, aTileZ);
- }
-
- }
-
- public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
- super.onBlockAdded(aWorld, aX, aY, aZ);
- if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- }
-
- }
-
- public String getUnlocalizedName() {
- int tDamage = 0;
- String aUnlocalName = (tDamage >= 0 && tDamage < GregTech_API.METATILEENTITIES.length)
- ? (GregTech_API.METATILEENTITIES[tDamage] != null
- ? ("gtpp.blockmachines.name" + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName())
- : ("gtpp.blockmachines.name")) : "";
-
- Logger.INFO("Unlocal Name: "+aUnlocalName);
- return aUnlocalName;
- }
-
- public String getLocalizedName() {
- String aName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name");;
- if (aName.toLowerCase().contains(".name")) {
- aName = StatCollector.translateToLocal(getUnlocalizedName() + ".name");
- }
- if (aName.toLowerCase().contains(".name")) {
- aName = StatCollector.translateToLocal("gt.blockmachines" + ".name");
- }
- if (aName.toLowerCase().contains(".name")) {
- aName = "BAD";
- }
- Logger.INFO("Name: "+aName);
- return aName;
- }
-
- public int getFlammability(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) {
- return 0;
- }
-
- public int getFireSpreadSpeed(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) {
- return GregTech_API.sMachineFlammable && aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 100 : 0;
- }
-
- public int getRenderType() {
- return GTPP_Render_MachineBlock.INSTANCE == null ? super.getRenderType() : GTPP_Render_MachineBlock.INSTANCE.mRenderID;
- }
-
- public boolean isFireSource(World aWorld, int aX, int aY, int aZ, ForgeDirection side) {
- return GregTech_API.sMachineFlammable && aWorld.getBlockMetadata(aX, aY, aZ) == 0;
- }
-
- public boolean isFlammable(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) {
- return GregTech_API.sMachineFlammable && aWorld.getBlockMetadata(aX, aY, aZ) == 0;
- }
-
- public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess aWorld, int aX, int aY, int aZ) {
- return false;
- }
-
- public boolean canConnectRedstone(IBlockAccess var1, int var2, int var3, int var4, int var5) {
- return true;
- }
-
- public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return false;
- }
-
- public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return false;
- }
-
- public boolean hasTileEntity(int aMeta) {
- return true;
- }
-
- public boolean hasComparatorInputOverride() {
- return true;
- }
-
- public boolean renderAsNormalBlock() {
- return false;
- }
-
- public boolean canProvidePower() {
- return true;
- }
-
- public boolean isOpaqueCube() {
- return false;
- }
-
- public TileEntity createNewTileEntity(World aWorld, int aMeta) {
- return this.createTileEntity(aWorld, aMeta);
- }
-
- public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) {
- return BlockIcons.MACHINE_LV_SIDE.getIcon();
- }
-
- public IIcon getIcon(int aSide, int aMeta) {
- return BlockIcons.MACHINE_LV_SIDE.getIcon();
- }
-
- public boolean onBlockEventReceived(World aWorld, int aX, int aY, int aZ, int aData1, int aData2) {
- super.onBlockEventReceived(aWorld, aX, aY, aZ, aData1, aData2);
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity != null ? tTileEntity.receiveClientEvent(aData1, aData2) : false;
- }
-
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB,
- Entity collider) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) {
- ((IGregTechTileEntity) tTileEntity).addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB,
- collider);
- } else {
- super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- }
- }
-
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null
- ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ)
- : super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- @SideOnly(Side.CLIENT)
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null
- ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ)
- : super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) {
- TileEntity tTileEntity = blockAccess.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) {
- AxisAlignedBB bbb = ((IGregTechTileEntity) tTileEntity)
- .getCollisionBoundingBoxFromPool(((IGregTechTileEntity) tTileEntity).getWorld(), 0, 0, 0);
- this.minX = bbb.minX;
- this.minY = bbb.minY;
- this.minZ = bbb.minZ;
- this.maxX = bbb.maxX;
- this.maxY = bbb.maxY;
- this.maxZ = bbb.maxZ;
- } else {
- super.setBlockBoundsBasedOnState(blockAccess, aX, aY, aZ);
- }
- }
-
- public void setBlockBoundsForItemRender() {
- super.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
-
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) {
- ((IGregTechTileEntity) tTileEntity).onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
- } else {
- super.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
- }
- }
-
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister aIconRegister) {
-
- }
-
- public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
- return super.getBlockHardness(aWorld, aX, aY, aZ);
- }
-
- public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof BaseMetaTileEntity && ((BaseMetaTileEntity) tTileEntity).privateAccess()
- && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true)
- ? -1.0F
- : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ);
- }
-
- public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1,
- float par2, float par3) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity == null) {
- return false;
- } else {
- if (aPlayer.isSneaking()) {
- ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
- if (tCurrentItem == null) {
- return false;
- }
-
- if (!GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)
- && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) {
- return false;
- }
- }
-
- return tTileEntity instanceof IGregTechTileEntity
- ? (((IGregTechTileEntity) tTileEntity).getTimer() < 50L
- ? false
- : (!aWorld.isRemote && !((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer)
- ? true
- : ((IGregTechTileEntity) tTileEntity).onRightclick(aPlayer, (byte) aSide, par1,
- par2, par3)))
- : false;
- }
- }
-
- public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof IGregTechTileEntity) {
- ((IGregTechTileEntity) tTileEntity).onLeftclick(aPlayer);
- }
-
- }
-
- public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getMetaTileID() : 0;
- }
-
- public void onBlockExploded(World aWorld, int aX, int aY, int aZ, Explosion aExplosion) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof BaseMetaTileEntity) {
- ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion();
- }
-
- super.onBlockExploded(aWorld, aX, aY, aZ, aExplosion);
- }
-
- public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof IGregTechTileEntity) {
- IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity;
- XSTR tRandom = new XSTR();
- mTemporaryTileEntity.set(tGregTechTileEntity);
-
- for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); ++i) {
- ItemStack tItem = tGregTechTileEntity.getStackInSlot(i);
- if (tItem != null && tItem.stackSize > 0 && tGregTechTileEntity.isValidSlot(i)) {
- EntityItem tItemEntity = new EntityItem(aWorld,
- (double) ((float) aX + tRandom.nextFloat() * 0.8F + 0.1F),
- (double) ((float) aY + tRandom.nextFloat() * 0.8F + 0.1F),
- (double) ((float) aZ + tRandom.nextFloat() * 0.8F + 0.1F),
- new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
- if (tItem.hasTagCompound()) {
- tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy());
- }
-
- tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D;
- tItemEntity.motionY = tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D;
- tItemEntity.motionZ = tRandom.nextGaussian() * 0.0500000007450581D;
- aWorld.spawnEntityInWorld(tItemEntity);
- tItem.stackSize = 0;
- tGregTechTileEntity.setInventorySlotContents(i, (ItemStack) null);
- }
- }
- }
-
- super.breakBlock(aWorld, aX, aY, aZ, par5, par6);
- aWorld.removeTileEntity(aX, aY, aZ);
- }
-
- public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity
- ? ((IGregTechTileEntity) tTileEntity).getDrops()
- : (mTemporaryTileEntity.get() == null
- ? new ArrayList()
- : ((IGregTechTileEntity) mTemporaryTileEntity.get()).getDrops());
- }
-
- public int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity
- ? ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide)
- : 0;
- }
-
- public int isProvidingWeakPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
- if (aSide >= 0 && aSide <= 5) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity
- ? ((IGregTechTileEntity) tTileEntity).getOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide))
- : 0;
- } else {
- return 0;
- }
- }
-
- public int isProvidingStrongPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
- if (aSide >= 0 && aSide <= 5) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity
- ? ((IGregTechTileEntity) tTileEntity)
- .getStrongOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide))
- : 0;
- } else {
- return 0;
- }
- }
-
- public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int par5, float chance, int par7) {
- if (!aWorld.isRemote) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity != null && chance < 1.0F) {
- if (tTileEntity instanceof BaseMetaTileEntity && GregTech_API.sMachineNonWrenchExplosions) {
- ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion();
- }
- } else {
- super.dropBlockAsItemWithChance(aWorld, aX, aY, aZ, par5, chance, par7);
- }
- }
-
- }
-
- public boolean isSideSolid(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aSide) {
- if (aWorld.getBlockMetadata(aX, aY, aZ) == 0) {
- return true;
- } else {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity != null) {
- if (tTileEntity instanceof BaseMetaTileEntity) {
- return true;
- }
-
- if (tTileEntity instanceof BaseMetaPipeEntity
- && (((BaseMetaPipeEntity) tTileEntity).mConnections & -64) != 0) {
- return true;
- }
-
- if (tTileEntity instanceof ICoverable
- && ((ICoverable) tTileEntity).getCoverIDAtSide((byte) aSide.ordinal()) != 0) {
- return true;
- }
- }
-
- return false;
- }
- }
-
- public int getLightOpacity(IBlockAccess aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity == null
- ? 0
- : (tTileEntity instanceof IGregTechTileEntity
- ? ((IGregTechTileEntity) tTileEntity).getLightOpacity()
- : (aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 255 : 0));
- }
-
- public int getLightValue(IBlockAccess aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof BaseMetaTileEntity ? ((BaseMetaTileEntity) tTileEntity).getLightValue() : 0;
- }
-
- public TileEntity createTileEntity(World aWorld, int aMeta) {
- return (TileEntity) (aMeta >= 4 ? Meta_GT_Proxy.constructBaseMetaTileEntity() : Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower());
- }
-
- public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX,
- double explosionY, double explosionZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof IGregTechTileEntity
- ? ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6)
- : 10.0F;
- }
-
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
- for (int i = 0; i < 100; ++i) {
- if (GregTech_API.METATILEENTITIES[(30400 + i)] != null) {
- par3List.add(new ItemStack(par1, 1, i));
- }
- }
-
- }
-
- public void onBlockPlacedBy(World aWorld, int aX, int aY, int aZ, EntityLivingBase aPlayer, ItemStack aStack) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity != null) {
- if (tTileEntity instanceof IGregTechTileEntity) {
- IGregTechTileEntity var6 = (IGregTechTileEntity) tTileEntity;
- if (aPlayer == null) {
- var6.setFrontFacing((byte) 1);
- } else {
- int var7 = MathHelper.floor_double((double) (aPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
- int var8 = Math.round(aPlayer.rotationPitch);
- if (var8 >= 65 && var6.isValidFacing((byte) 1)) {
- var6.setFrontFacing((byte) 1);
- } else if (var8 <= -65 && var6.isValidFacing((byte) 0)) {
- var6.setFrontFacing((byte) 0);
- } else {
- switch (var7) {
- case 0 :
- var6.setFrontFacing((byte) 2);
- break;
- case 1 :
- var6.setFrontFacing((byte) 5);
- break;
- case 2 :
- var6.setFrontFacing((byte) 3);
- break;
- case 3 :
- var6.setFrontFacing((byte) 4);
- }
- }
- }
- }
-
- }
- }
-
- public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) {
- TileEntity tTileEntity = aPlayer.worldObj.getTileEntity(aX, aY, aZ);
- return tTileEntity instanceof BaseMetaTileEntity
- ? ((BaseMetaTileEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel)
- : (tTileEntity instanceof BaseMetaPipeEntity
- ? ((BaseMetaPipeEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel)
- : null);
- }
-
- public boolean recolourBlock(World aWorld, int aX, int aY, int aZ, ForgeDirection aSide, int aColor) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity instanceof IGregTechTileEntity) {
- if (((IGregTechTileEntity) tTileEntity).getColorization() == (byte) (~aColor & 15)) {
- return false;
- } else {
- ((IGregTechTileEntity) tTileEntity).setColorization((byte) (~aColor & 15));
- return true;
- }
- } else {
- return false;
- }
- }
-} \ No newline at end of file
+ public static ThreadLocal<IGregTechTileEntity> mTemporaryTileEntity = new ThreadLocal<IGregTechTileEntity>();
+
+ public GTPP_Block_Machines() {
+ super(GTPP_Item_Machines.class, "gtpp.blockmachines", new GT_Material_Machines());
+ GregTech_API.registerMachineBlock(this, -1);
+ this.setHardness(1.0F);
+ this.setResistance(10.0F);
+ this.setStepSound(soundTypeMetal);
+ this.setCreativeTab(GregTech_API.TAB_GREGTECH);
+ this.isBlockContainer = true;
+ }
+
+ public String getHarvestTool(int aMeta) {
+ switch (aMeta / 4) {
+ case 0:
+ return "wrench";
+ case 1:
+ return "wrench";
+ case 2:
+ return "cutter";
+ case 3:
+ return "axe";
+ default:
+ return "wrench";
+ }
+ }
+
+ public int getHarvestLevel(int aMeta) {
+ return aMeta % 4;
+ }
+
+ protected boolean canSilkHarvest() {
+ return false;
+ }
+
+ public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof BaseTileEntity) {
+ ((BaseTileEntity) tTileEntity).onAdjacentBlockChange(aTileX, aTileY, aTileZ);
+ }
+ }
+
+ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
+ super.onBlockAdded(aWorld, aX, aY, aZ);
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
+
+ public String getUnlocalizedName() {
+ int tDamage = 0;
+ String aUnlocalName = (tDamage >= 0 && tDamage < GregTech_API.METATILEENTITIES.length)
+ ? (GregTech_API.METATILEENTITIES[tDamage] != null
+ ? ("gtpp.blockmachines.name" + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName())
+ : ("gtpp.blockmachines.name"))
+ : "";
+
+ Logger.INFO("Unlocal Name: " + aUnlocalName);
+ return aUnlocalName;
+ }
+
+ public String getLocalizedName() {
+ String aName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name");
+ ;
+ if (aName.toLowerCase().contains(".name")) {
+ aName = StatCollector.translateToLocal(getUnlocalizedName() + ".name");
+ }
+ if (aName.toLowerCase().contains(".name")) {
+ aName = StatCollector.translateToLocal("gt.blockmachines" + ".name");
+ }
+ if (aName.toLowerCase().contains(".name")) {
+ aName = "BAD";
+ }
+ Logger.INFO("Name: " + aName);
+ return aName;
+ }
+
+ public int getFlammability(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) {
+ return 0;
+ }
+
+ public int getFireSpreadSpeed(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) {
+ return GregTech_API.sMachineFlammable && aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 100 : 0;
+ }
+
+ public int getRenderType() {
+ return GTPP_Render_MachineBlock.INSTANCE == null
+ ? super.getRenderType()
+ : GTPP_Render_MachineBlock.INSTANCE.mRenderID;
+ }
+
+ public boolean isFireSource(World aWorld, int aX, int aY, int aZ, ForgeDirection side) {
+ return GregTech_API.sMachineFlammable && aWorld.getBlockMetadata(aX, aY, aZ) == 0;
+ }
+
+ public boolean isFlammable(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) {
+ return GregTech_API.sMachineFlammable && aWorld.getBlockMetadata(aX, aY, aZ) == 0;
+ }
+
+ public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return false;
+ }
+
+ public boolean canConnectRedstone(IBlockAccess var1, int var2, int var3, int var4, int var5) {
+ return true;
+ }
+
+ public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return false;
+ }
+
+ public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return false;
+ }
+
+ public boolean hasTileEntity(int aMeta) {
+ return true;
+ }
+
+ public boolean hasComparatorInputOverride() {
+ return true;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ public boolean canProvidePower() {
+ return true;
+ }
+
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public TileEntity createNewTileEntity(World aWorld, int aMeta) {
+ return this.createTileEntity(aWorld, aMeta);
+ }
+
+ public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) {
+ return BlockIcons.MACHINE_LV_SIDE.getIcon();
+ }
+
+ public IIcon getIcon(int aSide, int aMeta) {
+ return BlockIcons.MACHINE_LV_SIDE.getIcon();
+ }
+
+ public boolean onBlockEventReceived(World aWorld, int aX, int aY, int aZ, int aData1, int aData2) {
+ super.onBlockEventReceived(aWorld, aX, aY, aZ, aData1, aData2);
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity != null ? tTileEntity.receiveClientEvent(aData1, aData2) : false;
+ }
+
+ public void addCollisionBoxesToList(
+ World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof IGregTechTileEntity
+ && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) {
+ ((IGregTechTileEntity) tTileEntity)
+ .addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ } else {
+ super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ }
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity
+ && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null
+ ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ)
+ : super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity
+ && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null
+ ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ)
+ : super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = blockAccess.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof IGregTechTileEntity
+ && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) {
+ AxisAlignedBB bbb = ((IGregTechTileEntity) tTileEntity)
+ .getCollisionBoundingBoxFromPool(((IGregTechTileEntity) tTileEntity).getWorld(), 0, 0, 0);
+ this.minX = bbb.minX;
+ this.minY = bbb.minY;
+ this.minZ = bbb.minZ;
+ this.maxX = bbb.maxX;
+ this.maxY = bbb.maxY;
+ this.maxZ = bbb.maxZ;
+ } else {
+ super.setBlockBoundsBasedOnState(blockAccess, aX, aY, aZ);
+ }
+ }
+
+ public void setBlockBoundsForItemRender() {
+ super.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof IGregTechTileEntity
+ && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) {
+ ((IGregTechTileEntity) tTileEntity).onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
+ } else {
+ super.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister aIconRegister) {}
+
+ public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
+ return super.getBlockHardness(aWorld, aX, aY, aZ);
+ }
+
+ public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof BaseMetaTileEntity
+ && ((BaseMetaTileEntity) tTileEntity).privateAccess()
+ && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true)
+ ? -1.0F
+ : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ);
+ }
+
+ public boolean onBlockActivated(
+ World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, float par2, float par3) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity == null) {
+ return false;
+ } else {
+ if (aPlayer.isSneaking()) {
+ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
+ if (tCurrentItem == null) {
+ return false;
+ }
+
+ if (!GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)
+ && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) {
+ return false;
+ }
+ }
+
+ return tTileEntity instanceof IGregTechTileEntity
+ ? (((IGregTechTileEntity) tTileEntity).getTimer() < 50L
+ ? false
+ : (!aWorld.isRemote && !((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer)
+ ? true
+ : ((IGregTechTileEntity) tTileEntity)
+ .onRightclick(aPlayer, (byte) aSide, par1, par2, par3)))
+ : false;
+ }
+ }
+
+ public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof IGregTechTileEntity) {
+ ((IGregTechTileEntity) tTileEntity).onLeftclick(aPlayer);
+ }
+ }
+
+ public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getMetaTileID() : 0;
+ }
+
+ public void onBlockExploded(World aWorld, int aX, int aY, int aZ, Explosion aExplosion) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof BaseMetaTileEntity) {
+ ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion();
+ }
+
+ super.onBlockExploded(aWorld, aX, aY, aZ, aExplosion);
+ }
+
+ public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof IGregTechTileEntity) {
+ IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity;
+ XSTR tRandom = new XSTR();
+ mTemporaryTileEntity.set(tGregTechTileEntity);
+
+ for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); ++i) {
+ ItemStack tItem = tGregTechTileEntity.getStackInSlot(i);
+ if (tItem != null && tItem.stackSize > 0 && tGregTechTileEntity.isValidSlot(i)) {
+ EntityItem tItemEntity = new EntityItem(
+ aWorld,
+ (double) ((float) aX + tRandom.nextFloat() * 0.8F + 0.1F),
+ (double) ((float) aY + tRandom.nextFloat() * 0.8F + 0.1F),
+ (double) ((float) aZ + tRandom.nextFloat() * 0.8F + 0.1F),
+ new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
+ if (tItem.hasTagCompound()) {
+ tItemEntity.getEntityItem().setTagCompound((NBTTagCompound)
+ tItem.getTagCompound().copy());
+ }
+
+ tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D;
+ tItemEntity.motionY = tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D;
+ tItemEntity.motionZ = tRandom.nextGaussian() * 0.0500000007450581D;
+ aWorld.spawnEntityInWorld(tItemEntity);
+ tItem.stackSize = 0;
+ tGregTechTileEntity.setInventorySlotContents(i, (ItemStack) null);
+ }
+ }
+ }
+
+ super.breakBlock(aWorld, aX, aY, aZ, par5, par6);
+ aWorld.removeTileEntity(aX, aY, aZ);
+ }
+
+ public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity
+ ? ((IGregTechTileEntity) tTileEntity).getDrops()
+ : (mTemporaryTileEntity.get() == null
+ ? new ArrayList()
+ : ((IGregTechTileEntity) mTemporaryTileEntity.get()).getDrops());
+ }
+
+ public int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity
+ ? ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide)
+ : 0;
+ }
+
+ public int isProvidingWeakPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
+ if (aSide >= 0 && aSide <= 5) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity
+ ? ((IGregTechTileEntity) tTileEntity).getOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide))
+ : 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public int isProvidingStrongPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
+ if (aSide >= 0 && aSide <= 5) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity
+ ? ((IGregTechTileEntity) tTileEntity)
+ .getStrongOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide))
+ : 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int par5, float chance, int par7) {
+ if (!aWorld.isRemote) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity != null && chance < 1.0F) {
+ if (tTileEntity instanceof BaseMetaTileEntity && GregTech_API.sMachineNonWrenchExplosions) {
+ ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion();
+ }
+ } else {
+ super.dropBlockAsItemWithChance(aWorld, aX, aY, aZ, par5, chance, par7);
+ }
+ }
+ }
+
+ public boolean isSideSolid(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aSide) {
+ if (aWorld.getBlockMetadata(aX, aY, aZ) == 0) {
+ return true;
+ } else {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity != null) {
+ if (tTileEntity instanceof BaseMetaTileEntity) {
+ return true;
+ }
+
+ if (tTileEntity instanceof BaseMetaPipeEntity
+ && (((BaseMetaPipeEntity) tTileEntity).mConnections & -64) != 0) {
+ return true;
+ }
+
+ if (tTileEntity instanceof ICoverable
+ && ((ICoverable) tTileEntity).getCoverIDAtSide((byte) aSide.ordinal()) != 0) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ public int getLightOpacity(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity == null
+ ? 0
+ : (tTileEntity instanceof IGregTechTileEntity
+ ? ((IGregTechTileEntity) tTileEntity).getLightOpacity()
+ : (aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 255 : 0));
+ }
+
+ public int getLightValue(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof BaseMetaTileEntity ? ((BaseMetaTileEntity) tTileEntity).getLightValue() : 0;
+ }
+
+ public TileEntity createTileEntity(World aWorld, int aMeta) {
+ return (TileEntity)
+ (aMeta >= 4
+ ? Meta_GT_Proxy.constructBaseMetaTileEntity()
+ : Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower());
+ }
+
+ public float getExplosionResistance(
+ Entity par1Entity,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ double explosionX,
+ double explosionY,
+ double explosionZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof IGregTechTileEntity
+ ? ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6)
+ : 10.0F;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
+ for (int i = 0; i < 100; ++i) {
+ if (GregTech_API.METATILEENTITIES[(30400 + i)] != null) {
+ par3List.add(new ItemStack(par1, 1, i));
+ }
+ }
+ }
+
+ public void onBlockPlacedBy(World aWorld, int aX, int aY, int aZ, EntityLivingBase aPlayer, ItemStack aStack) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity != null) {
+ if (tTileEntity instanceof IGregTechTileEntity) {
+ IGregTechTileEntity var6 = (IGregTechTileEntity) tTileEntity;
+ if (aPlayer == null) {
+ var6.setFrontFacing((byte) 1);
+ } else {
+ int var7 = MathHelper.floor_double((double) (aPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
+ int var8 = Math.round(aPlayer.rotationPitch);
+ if (var8 >= 65 && var6.isValidFacing((byte) 1)) {
+ var6.setFrontFacing((byte) 1);
+ } else if (var8 <= -65 && var6.isValidFacing((byte) 0)) {
+ var6.setFrontFacing((byte) 0);
+ } else {
+ switch (var7) {
+ case 0:
+ var6.setFrontFacing((byte) 2);
+ break;
+ case 1:
+ var6.setFrontFacing((byte) 5);
+ break;
+ case 2:
+ var6.setFrontFacing((byte) 3);
+ break;
+ case 3:
+ var6.setFrontFacing((byte) 4);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) {
+ TileEntity tTileEntity = aPlayer.worldObj.getTileEntity(aX, aY, aZ);
+ return tTileEntity instanceof BaseMetaTileEntity
+ ? ((BaseMetaTileEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel)
+ : (tTileEntity instanceof BaseMetaPipeEntity
+ ? ((BaseMetaPipeEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel)
+ : null);
+ }
+
+ public boolean recolourBlock(World aWorld, int aX, int aY, int aZ, ForgeDirection aSide, int aColor) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity instanceof IGregTechTileEntity) {
+ if (((IGregTechTileEntity) tTileEntity).getColorization() == (byte) (~aColor & 15)) {
+ return false;
+ } else {
+ ((IGregTechTileEntity) tTileEntity).setColorization((byte) (~aColor & 15));
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java
index ba3b05ff8e..9e732d2443 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java
@@ -8,8 +8,6 @@ import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
-
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
@@ -20,210 +18,251 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class GTPP_Item_Machines extends ItemBlock {
- public GTPP_Item_Machines(Block par1) {
- super(par1);
- this.setMaxDamage(0);
- this.setHasSubtypes(true);
- this.setCreativeTab(GregTech_API.TAB_GREGTECH);
- }
-
- @SuppressWarnings("unchecked")
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean par4) {
- try {
- int e = this.getDamage(aStack) + 30400; //Add Offset
- if (e <= 0 || e >= GregTech_API.METATILEENTITIES.length) {
- return;
- }
-
- if (GregTech_API.METATILEENTITIES[e] != null) {
-
- IGregTechTileEntity aNBT = GregTech_API.METATILEENTITIES[e].getBaseMetaTileEntity();
-
- final long tVoltage = aNBT.getInputVoltage();
- byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage)));
-
- /*if (aNBT.getDescription() != null) {
- int tAmount = 0;
- String[] arg7 = aNBT.getDescription();
- int arg8 = arg7.length-1;
-
- if (arg7 != null && arg7.length > 0) {
- for (String t : arg7) {
- aList.add(t);
- }
-
- }
- else {
- aList.add("ERROR");
- }
-
- for (int y = 0; y < arg8; y++) {
- String tDescription = arg7[y];
-
- if (tDescription != null) {
- aList.add(tDescription+"|"+arg8);
- continue;
- }
- else {
- continue;
- }
- }
- }*/
-
- if (aNBT.getEUCapacity() > 0L) {
-
- //Custom handling
- if ((e - 30400) <= 100) {
-
-
- if ((e - 30400) <= 10) {
- tTier -= 2;
- aList.add(EnumChatFormatting.BOLD+"16"+" Fuse Slots"+EnumChatFormatting.GRAY);
- aList.add("Per each fuse, you may insert "+EnumChatFormatting.YELLOW+(GT_Values.V[tTier])+EnumChatFormatting.GRAY+" EU/t");
- aList.add("However this "+EnumChatFormatting.ITALIC+EnumChatFormatting.RED+"MUST"+EnumChatFormatting.GRAY+" be in a single Amp");
- aList.add("This machine can accept upto a single amp of "+GT_Values.VN[Math.min(tTier+2, 12)]+" as a result");
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Breaker_Loss", "Breaker Loss: "+EnumChatFormatting.RED+""+(GT_Values.V[Math.max(tTier-1, 0)]/10)+EnumChatFormatting.GRAY+" EU/t", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
- }
-
-
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Special_Power_1", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
- //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
- //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_3", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
- }
-
-
- if (aNBT.getInputVoltage() > 0L) {
- String inA = "0";
- if (aNBT.getInputAmperage() >= 1L) {
- inA = " at " + EnumChatFormatting.YELLOW + aNBT.getInputAmperage() + EnumChatFormatting.GRAY +" Amps";
- }
- else {
- inA = " at " + EnumChatFormatting.WHITE + aNBT.getInputAmperage() + EnumChatFormatting.GRAY +" Amps";
- }
- String a1 = "Voltage IN: "+EnumChatFormatting.GREEN + aNBT.getInputVoltage()
- + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getInputVoltage())] + ")"
- + EnumChatFormatting.GRAY + inA;
- aList.add(a1);
- }
-
- if (aNBT.getOutputVoltage() > 0L) {
- String outA = "0";
- if (aNBT.getOutputAmperage() >= 1L) {
- outA = " at " + EnumChatFormatting.YELLOW + aNBT.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps";
- }
- else {
- outA = " at " + EnumChatFormatting.WHITE + aNBT.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps";
- }
- String a1 = "Voltage OUT: "+EnumChatFormatting.GREEN + aNBT.getOutputVoltage()
- + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getOutputVoltage())] + ")"
- + EnumChatFormatting.GRAY + outA;
- aList.add(a1);
- }
-
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Lossess_EU", "Transmission Loss: "+EnumChatFormatting.DARK_BLUE+"0", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
-
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE2", "Internal Capacity: ",
- !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + aNBT.getEUCapacity()
- + EnumChatFormatting.GRAY + " EU");
- }
- }
-
- NBTTagCompound arg16 = aStack.getTagCompound();
- if (arg16 != null) {
- if (arg16.getBoolean("mMuffler")) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade",
- !GregTech_API.sPostloadFinished));
- }
-
- if (arg16.getBoolean("mSteamConverter")) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER",
- "has Steam Upgrade", !GregTech_API.sPostloadFinished));
- }
-
- boolean arg17 = false;
- byte arg18;
- if ((arg18 = arg16.getByte("mSteamTanks")) > 0) {
- aList.add(arg18 + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS",
- "Steam Tank Upgrades", !GregTech_API.sPostloadFinished));
- }
- }
-
-
- aList.add(EnumChatFormatting.UNDERLINE+"Special GT++ Machine");
-
- } catch (Throwable arg15) {
- arg15.printStackTrace(GT_Log.err);
- }
-
- }
-
- public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
- float hitX, float hitY, float hitZ) {
- return false;
- }
-
- public String getUnlocalizedName(ItemStack aStack) {
- short tDamage = (short) (this.getDamage(aStack) + 30400); //Add Offset;
- return tDamage >= 0 && tDamage < GregTech_API.METATILEENTITIES.length
- ? (GregTech_API.METATILEENTITIES[tDamage] != null
- ? "gtpp.blockmachines" + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName()
- : "")
- : "";
- }
-
- public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- super.onCreated(aStack, aWorld, aPlayer);
- short tDamage = (short) ((short) this.getDamage(aStack) + 30400); //Add Offset;
- if (tDamage < 0
- || tDamage >= GregTech_API.METATILEENTITIES.length && GregTech_API.METATILEENTITIES[tDamage] != null) {
- GregTech_API.METATILEENTITIES[tDamage].onCreated(aStack, aWorld, aPlayer);
- }
-
- }
-
- public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side,
- float hitX, float hitY, float hitZ, int aMeta) {
- short tDamage = (short) ((short) this.getDamage(aStack) + 30400); //Add Offset;
- if (tDamage > 0) {
- if (GregTech_API.METATILEENTITIES[tDamage] == null) {
- return false;
- }
-
- byte tMetaData = 32;
- //byte tMetaData = GregTech_API.METATILEENTITIES[tDamage].getTileEntityBaseType();
- Logger.INFO("Using Meta: "+tMetaData+" for ID "+tDamage+" | "+GregTech_API.METATILEENTITIES[tDamage].getInventoryName());
- if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tMetaData, 3)) {
- return false;
- }
-
- if (aWorld.getBlock(aX, aY, aZ) != this.field_150939_a) {
- throw new GT_ItsNotMyFaultException(
- "Failed to place Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don\'t report this Bug to me, I don\'t know how to fix it.");
- }
-
- if (aWorld.getBlockMetadata(aX, aY, aZ) != tMetaData) {
- throw new GT_ItsNotMyFaultException(
- "Failed to set the MetaValue of the Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don\'t report this Bug to me, I don\'t know how to fix it.");
- }
-
- IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity != null) {
- tTileEntity.setInitialValuesAsNBT(tTileEntity.isServerSide() ? aStack.getTagCompound() : null, tDamage);
- if (aPlayer != null) {
- tTileEntity.setOwnerName(aPlayer.getDisplayName());
- }
-
- tTileEntity.getMetaTileEntity().initDefaultModes(aStack.getTagCompound());
- }
- } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) {
- return false;
- }
-
- if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) {
- this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack);
- this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage);
- }
-
- return true;
- }
-} \ No newline at end of file
+ public GTPP_Item_Machines(Block par1) {
+ super(par1);
+ this.setMaxDamage(0);
+ this.setHasSubtypes(true);
+ this.setCreativeTab(GregTech_API.TAB_GREGTECH);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean par4) {
+ try {
+ int e = this.getDamage(aStack) + 30400; // Add Offset
+ if (e <= 0 || e >= GregTech_API.METATILEENTITIES.length) {
+ return;
+ }
+
+ if (GregTech_API.METATILEENTITIES[e] != null) {
+
+ IGregTechTileEntity aNBT = GregTech_API.METATILEENTITIES[e].getBaseMetaTileEntity();
+
+ final long tVoltage = aNBT.getInputVoltage();
+ byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage)));
+
+ /*if (aNBT.getDescription() != null) {
+ int tAmount = 0;
+ String[] arg7 = aNBT.getDescription();
+ int arg8 = arg7.length-1;
+
+ if (arg7 != null && arg7.length > 0) {
+ for (String t : arg7) {
+ aList.add(t);
+ }
+
+ }
+ else {
+ aList.add("ERROR");
+ }
+
+ for (int y = 0; y < arg8; y++) {
+ String tDescription = arg7[y];
+
+ if (tDescription != null) {
+ aList.add(tDescription+"|"+arg8);
+ continue;
+ }
+ else {
+ continue;
+ }
+ }
+ }*/
+
+ if (aNBT.getEUCapacity() > 0L) {
+
+ // Custom handling
+ if ((e - 30400) <= 100) {
+
+ if ((e - 30400) <= 10) {
+ tTier -= 2;
+ aList.add(EnumChatFormatting.BOLD + "16" + " Fuse Slots" + EnumChatFormatting.GRAY);
+ aList.add("Per each fuse, you may insert " + EnumChatFormatting.YELLOW
+ + (GT_Values.V[tTier]) + EnumChatFormatting.GRAY + " EU/t");
+ aList.add("However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST"
+ + EnumChatFormatting.GRAY + " be in a single Amp");
+ aList.add("This machine can accept upto a single amp of "
+ + GT_Values.VN[Math.min(tTier + 2, 12)] + " as a result");
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "TileEntity_Breaker_Loss",
+ "Breaker Loss: " + EnumChatFormatting.RED + ""
+ + (GT_Values.V[Math.max(tTier - 1, 0)] / 10)
+ + EnumChatFormatting.GRAY + " EU/t",
+ !GregTech_API.sPostloadFinished)
+ + EnumChatFormatting.GRAY);
+ }
+
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "TileEntity_Special_Power_1",
+ EnumChatFormatting.RED + "Special Power Handling, please read manual",
+ !GregTech_API.sPostloadFinished)
+ + EnumChatFormatting.GRAY);
+ // aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2",
+ // EnumChatFormatting.RED+"Special Power Handling, please read manual",
+ // !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
+ // aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_3",
+ // EnumChatFormatting.RED+"Special Power Handling, please read manual",
+ // !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
+ }
+
+ if (aNBT.getInputVoltage() > 0L) {
+ String inA = "0";
+ if (aNBT.getInputAmperage() >= 1L) {
+ inA = " at " + EnumChatFormatting.YELLOW + aNBT.getInputAmperage() + EnumChatFormatting.GRAY
+ + " Amps";
+ } else {
+ inA = " at " + EnumChatFormatting.WHITE + aNBT.getInputAmperage() + EnumChatFormatting.GRAY
+ + " Amps";
+ }
+ String a1 = "Voltage IN: " + EnumChatFormatting.GREEN + aNBT.getInputVoltage()
+ + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getInputVoltage())] + ")"
+ + EnumChatFormatting.GRAY + inA;
+ aList.add(a1);
+ }
+
+ if (aNBT.getOutputVoltage() > 0L) {
+ String outA = "0";
+ if (aNBT.getOutputAmperage() >= 1L) {
+ outA = " at " + EnumChatFormatting.YELLOW + aNBT.getOutputAmperage()
+ + EnumChatFormatting.GRAY + " Amps";
+ } else {
+ outA = " at " + EnumChatFormatting.WHITE + aNBT.getOutputAmperage()
+ + EnumChatFormatting.GRAY + " Amps";
+ }
+ String a1 = "Voltage OUT: " + EnumChatFormatting.GREEN + aNBT.getOutputVoltage()
+ + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getOutputVoltage())] + ")"
+ + EnumChatFormatting.GRAY + outA;
+ aList.add(a1);
+ }
+
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "TileEntity_Lossess_EU",
+ "Transmission Loss: " + EnumChatFormatting.DARK_BLUE + "0",
+ !GregTech_API.sPostloadFinished)
+ + EnumChatFormatting.GRAY);
+
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "TileEntity_EUp_STORE2", "Internal Capacity: ", !GregTech_API.sPostloadFinished)
+ + EnumChatFormatting.BLUE + aNBT.getEUCapacity()
+ + EnumChatFormatting.GRAY + " EU");
+ }
+ }
+
+ NBTTagCompound arg16 = aStack.getTagCompound();
+ if (arg16 != null) {
+ if (arg16.getBoolean("mMuffler")) {
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished));
+ }
+
+ if (arg16.getBoolean("mSteamConverter")) {
+ aList.add(GT_LanguageManager.addStringLocalization(
+ "GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished));
+ }
+
+ boolean arg17 = false;
+ byte arg18;
+ if ((arg18 = arg16.getByte("mSteamTanks")) > 0) {
+ aList.add(arg18 + " "
+ + GT_LanguageManager.addStringLocalization(
+ "GT_TileEntity_STEAMTANKS",
+ "Steam Tank Upgrades",
+ !GregTech_API.sPostloadFinished));
+ }
+ }
+
+ aList.add(EnumChatFormatting.UNDERLINE + "Special GT++ Machine");
+
+ } catch (Throwable arg15) {
+ arg15.printStackTrace(GT_Log.err);
+ }
+ }
+
+ public boolean onItemUseFirst(
+ ItemStack stack,
+ EntityPlayer player,
+ World world,
+ int x,
+ int y,
+ int z,
+ int side,
+ float hitX,
+ float hitY,
+ float hitZ) {
+ return false;
+ }
+
+ public String getUnlocalizedName(ItemStack aStack) {
+ short tDamage = (short) (this.getDamage(aStack) + 30400); // Add Offset;
+ return tDamage >= 0 && tDamage < GregTech_API.METATILEENTITIES.length
+ ? (GregTech_API.METATILEENTITIES[tDamage] != null
+ ? "gtpp.blockmachines" + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName()
+ : "")
+ : "";
+ }
+
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ super.onCreated(aStack, aWorld, aPlayer);
+ short tDamage = (short) ((short) this.getDamage(aStack) + 30400); // Add Offset;
+ if (tDamage < 0
+ || tDamage >= GregTech_API.METATILEENTITIES.length && GregTech_API.METATILEENTITIES[tDamage] != null) {
+ GregTech_API.METATILEENTITIES[tDamage].onCreated(aStack, aWorld, aPlayer);
+ }
+ }
+
+ public boolean placeBlockAt(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ int side,
+ float hitX,
+ float hitY,
+ float hitZ,
+ int aMeta) {
+ short tDamage = (short) ((short) this.getDamage(aStack) + 30400); // Add Offset;
+ if (tDamage > 0) {
+ if (GregTech_API.METATILEENTITIES[tDamage] == null) {
+ return false;
+ }
+
+ byte tMetaData = 32;
+ // byte tMetaData = GregTech_API.METATILEENTITIES[tDamage].getTileEntityBaseType();
+ Logger.INFO("Using Meta: " + tMetaData + " for ID " + tDamage + " | "
+ + GregTech_API.METATILEENTITIES[tDamage].getInventoryName());
+ if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tMetaData, 3)) {
+ return false;
+ }
+
+ if (aWorld.getBlock(aX, aY, aZ) != this.field_150939_a) {
+ throw new GT_ItsNotMyFaultException(
+ "Failed to place Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don\'t report this Bug to me, I don\'t know how to fix it.");
+ }
+
+ if (aWorld.getBlockMetadata(aX, aY, aZ) != tMetaData) {
+ throw new GT_ItsNotMyFaultException(
+ "Failed to set the MetaValue of the Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don\'t report this Bug to me, I don\'t know how to fix it.");
+ }
+
+ IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aWorld.getTileEntity(aX, aY, aZ);
+ if (tTileEntity != null) {
+ tTileEntity.setInitialValuesAsNBT(tTileEntity.isServerSide() ? aStack.getTagCompound() : null, tDamage);
+ if (aPlayer != null) {
+ tTileEntity.setOwnerName(aPlayer.getDisplayName());
+ }
+
+ tTileEntity.getMetaTileEntity().initDefaultModes(aStack.getTagCompound());
+ }
+ } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) {
+ return false;
+ }
+
+ if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) {
+ this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack);
+ this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage);
+ }
+
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
index daeebe2fe6..026d3d471f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
@@ -12,64 +12,66 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
-public class GregtechMetaCasingBlocks
-extends GregtechMetaCasingBlocksAbstract {
+public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract {
- CasingTextureHandler TextureHandler = new CasingTextureHandler();
+ CasingTextureHandler TextureHandler = new CasingTextureHandler();
- public GregtechMetaCasingBlocks() {
- super(GregtechMetaCasingItems.class, "miscutils.blockcasings", GT_Material_Casings.INSTANCE);
- for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- if (i == 2 || i == 3 || i == 4) {
- continue;
- }
- TAE.registerTexture(0, i, new GTPP_CopiedBlockTexture(this, 6, i));
- }
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Centrifuge Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); //60
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Material Press Machine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Electrolyzer Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Wire Factory Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Maceration Stack Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Matter Generation Coil"); //65
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Matter Fabricator Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Iron Plated Bricks");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Multitank Exterior Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Hastelloy-N Reactor Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Zeron-100 Reactor Shielding");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Blast Smelter Heat Containment Coil ");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Blast Smelter Casing Block");
- GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0));
- GregtechItemList.Casing_CokeOven.set(new ItemStack(this, 1, 1));
- GregtechItemList.Casing_CokeOven_Coil1.set(new ItemStack(this, 1, 2));
- GregtechItemList.Casing_CokeOven_Coil2.set(new ItemStack(this, 1, 3));
- GregtechItemList.Casing_MaterialPress.set(new ItemStack(this, 1, 4));
- GregtechItemList.Casing_Electrolyzer.set(new ItemStack(this, 1, 5));
- GregtechItemList.Casing_WireFactory.set(new ItemStack(this, 1, 6));
- GregtechItemList.Casing_MacerationStack.set(new ItemStack(this, 1, 7));
- GregtechItemList.Casing_MatterGen.set(new ItemStack(this, 1, 8));
- GregtechItemList.Casing_MatterFab.set(new ItemStack(this, 1, 9));
- GregtechItemList.Casing_IronPlatedBricks.set(new ItemStack(this, 1, 10));
- GregtechItemList.Casing_MultitankExterior.set(new ItemStack(this, 1, 11));
- GregtechItemList.Casing_Reactor_I.set(new ItemStack(this, 1, 12));
- GregtechItemList.Casing_Reactor_II.set(new ItemStack(this, 1, 13));
- GregtechItemList.Casing_Coil_BlastSmelter.set(new ItemStack(this, 1, 14));
- GregtechItemList.Casing_BlastSmelter.set(new ItemStack(this, 1, 15));
- }
-
- @Override
- public IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57]
- return CasingTextureHandler.getIcon(aSide, aMeta);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
- final GregtechMetaCasingBlocks i = this;
- return CasingTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i);
- }
+ public GregtechMetaCasingBlocks() {
+ super(GregtechMetaCasingItems.class, "miscutils.blockcasings", GT_Material_Casings.INSTANCE);
+ for (byte i = 0; i < 16; i = (byte) (i + 1)) {
+ if (i == 2 || i == 3 || i == 4) {
+ continue;
+ }
+ TAE.registerTexture(0, i, new GTPP_CopiedBlockTexture(this, 6, i));
+ }
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Centrifuge Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); // 60
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".4.name", "Material Press Machine Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Electrolyzer Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Wire Factory Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Maceration Stack Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Matter Generation Coil"); // 65
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Matter Fabricator Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Iron Plated Bricks");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Multitank Exterior Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Hastelloy-N Reactor Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Zeron-100 Reactor Shielding");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".14.name", "Blast Smelter Heat Containment Coil ");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Blast Smelter Casing Block");
+ GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0));
+ GregtechItemList.Casing_CokeOven.set(new ItemStack(this, 1, 1));
+ GregtechItemList.Casing_CokeOven_Coil1.set(new ItemStack(this, 1, 2));
+ GregtechItemList.Casing_CokeOven_Coil2.set(new ItemStack(this, 1, 3));
+ GregtechItemList.Casing_MaterialPress.set(new ItemStack(this, 1, 4));
+ GregtechItemList.Casing_Electrolyzer.set(new ItemStack(this, 1, 5));
+ GregtechItemList.Casing_WireFactory.set(new ItemStack(this, 1, 6));
+ GregtechItemList.Casing_MacerationStack.set(new ItemStack(this, 1, 7));
+ GregtechItemList.Casing_MatterGen.set(new ItemStack(this, 1, 8));
+ GregtechItemList.Casing_MatterFab.set(new ItemStack(this, 1, 9));
+ GregtechItemList.Casing_IronPlatedBricks.set(new ItemStack(this, 1, 10));
+ GregtechItemList.Casing_MultitankExterior.set(new ItemStack(this, 1, 11));
+ GregtechItemList.Casing_Reactor_I.set(new ItemStack(this, 1, 12));
+ GregtechItemList.Casing_Reactor_II.set(new ItemStack(this, 1, 13));
+ GregtechItemList.Casing_Coil_BlastSmelter.set(new ItemStack(this, 1, 14));
+ GregtechItemList.Casing_BlastSmelter.set(new ItemStack(this, 1, 15));
+ }
+ @Override
+ public IIcon getIcon(final int aSide, final int aMeta) { // Texture ID's. case 0 == ID[57]
+ return CasingTextureHandler.getIcon(aSide, aMeta);
+ }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(
+ final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
+ final GregtechMetaCasingBlocks i = this;
+ return CasingTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
index 171339b08b..f71805784b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import java.util.List;
-
import gregtech.api.enums.TAE;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
@@ -10,78 +8,81 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler2;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-public class GregtechMetaCasingBlocks2
-extends GregtechMetaCasingBlocksAbstract {
+public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract {
- CasingTextureHandler2 TextureHandler = new CasingTextureHandler2();
+ CasingTextureHandler2 TextureHandler = new CasingTextureHandler2();
- public static class GregtechMetaCasingItemBlocks2 extends GregtechMetaCasingItems {
+ public static class GregtechMetaCasingItemBlocks2 extends GregtechMetaCasingItems {
- public GregtechMetaCasingItemBlocks2(Block par1) {
- super(par1);
- }
+ public GregtechMetaCasingItemBlocks2(Block par1) {
+ super(par1);
+ }
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- int meta = aStack.getItemDamage();
- int tier = GregtechMetaTileEntity_PowerSubStationController.getCellTier(field_150939_a, meta);
- if (meta == 7 && tier > 0) {
- long capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(tier);
- aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity));
- }
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- }
- }
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ int meta = aStack.getItemDamage();
+ int tier = GregtechMetaTileEntity_PowerSubStationController.getCellTier(field_150939_a, meta);
+ if (meta == 7 && tier > 0) {
+ long capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(tier);
+ aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity));
+ }
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ }
+ }
- public GregtechMetaCasingBlocks2() {
- super(GregtechMetaCasingItemBlocks2.class, "gtplusplus.blockcasings.2", GT_Material_Casings.INSTANCE);
- for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- if (i == 4 || i == 10 || i == 11 || i == 12 || i == 14) {
- continue;
- }
- TAE.registerTexture(1, i, new GTPP_CopiedBlockTexture(this, 6, i));
- }
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Thermal Processing Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Hastelloy-N Sealant Block");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Hastelloy-X Structural Block");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Incoloy-DS Fluid Containment Block");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Wash Plant Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Industrial Sieve Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Large Sieve Grate");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (EV)");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Sub-Station External Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Cyclotron Coil");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Cyclotron Outer Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Thermal Containment Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Autocrafter Frame");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cutting Factory Frame");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Sterile Farm Casing"); //Tree Farmer Textures
- GregtechItemList.Casing_ThermalCentrifuge.set(new ItemStack(this, 1, 0));
- GregtechItemList.Casing_Refinery_External.set(new ItemStack(this, 1, 1));
- GregtechItemList.Casing_Refinery_Structural.set(new ItemStack(this, 1, 2));
- GregtechItemList.Casing_Refinery_Internal.set(new ItemStack(this, 1, 3));
- GregtechItemList.Casing_WashPlant.set(new ItemStack(this, 1, 4));
- GregtechItemList.Casing_Sifter.set(new ItemStack(this, 1, 5));
- GregtechItemList.Casing_SifterGrate.set(new ItemStack(this, 1, 6));
- GregtechItemList.Casing_Vanadium_Redox.set(new ItemStack(this, 1, 7));
- GregtechItemList.Casing_Power_SubStation.set(new ItemStack(this, 1, 8));
- GregtechItemList.Casing_Cyclotron_Coil.set(new ItemStack(this, 1, 9));
- GregtechItemList.Casing_Cyclotron_External.set(new ItemStack(this, 1, 10));
- GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11));
- GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12));
- GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13));
- //GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 14));
- GregtechItemList.Casing_PLACEHOLDER_TreeFarmer.set(new ItemStack(this, 1, 15)); //Tree Farmer Textures
- }
+ public GregtechMetaCasingBlocks2() {
+ super(GregtechMetaCasingItemBlocks2.class, "gtplusplus.blockcasings.2", GT_Material_Casings.INSTANCE);
+ for (byte i = 0; i < 16; i = (byte) (i + 1)) {
+ if (i == 4 || i == 10 || i == 11 || i == 12 || i == 14) {
+ continue;
+ }
+ TAE.registerTexture(1, i, new GTPP_CopiedBlockTexture(this, 6, i));
+ }
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Thermal Processing Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Hastelloy-N Sealant Block");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Hastelloy-X Structural Block");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".3.name", "Incoloy-DS Fluid Containment Block");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Wash Plant Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Industrial Sieve Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Large Sieve Grate");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (EV)");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Sub-Station External Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Cyclotron Coil");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Cyclotron Outer Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Thermal Containment Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Autocrafter Frame");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cutting Factory Frame");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".15.name", "Sterile Farm Casing"); // Tree Farmer Textures
+ GregtechItemList.Casing_ThermalCentrifuge.set(new ItemStack(this, 1, 0));
+ GregtechItemList.Casing_Refinery_External.set(new ItemStack(this, 1, 1));
+ GregtechItemList.Casing_Refinery_Structural.set(new ItemStack(this, 1, 2));
+ GregtechItemList.Casing_Refinery_Internal.set(new ItemStack(this, 1, 3));
+ GregtechItemList.Casing_WashPlant.set(new ItemStack(this, 1, 4));
+ GregtechItemList.Casing_Sifter.set(new ItemStack(this, 1, 5));
+ GregtechItemList.Casing_SifterGrate.set(new ItemStack(this, 1, 6));
+ GregtechItemList.Casing_Vanadium_Redox.set(new ItemStack(this, 1, 7));
+ GregtechItemList.Casing_Power_SubStation.set(new ItemStack(this, 1, 8));
+ GregtechItemList.Casing_Cyclotron_Coil.set(new ItemStack(this, 1, 9));
+ GregtechItemList.Casing_Cyclotron_External.set(new ItemStack(this, 1, 10));
+ GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11));
+ GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12));
+ GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13));
+ // GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 14));
+ GregtechItemList.Casing_PLACEHOLDER_TreeFarmer.set(new ItemStack(this, 1, 15)); // Tree Farmer Textures
+ }
- @Override
- public IIcon getIcon(final int aSide, final int aMeta) {
- return CasingTextureHandler2.getIcon(aSide, aMeta);
- }
+ @Override
+ public IIcon getIcon(final int aSide, final int aMeta) {
+ return CasingTextureHandler2.getIcon(aSide, aMeta);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java
index e9251d908e..59bcfa5347 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.TAE;
@@ -13,358 +11,367 @@ import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler3;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
-public class GregtechMetaCasingBlocks3
-extends GregtechMetaCasingBlocksAbstract {
+public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract {
- public static boolean mConnectedMachineTextures = false;
- CasingTextureHandler3 TextureHandler = new CasingTextureHandler3();
+ public static boolean mConnectedMachineTextures = false;
+ CasingTextureHandler3 TextureHandler = new CasingTextureHandler3();
- public static class GregtechMetaCasingItemBlocks3 extends GregtechMetaCasingItems {
+ public static class GregtechMetaCasingItemBlocks3 extends GregtechMetaCasingItems {
- public GregtechMetaCasingItemBlocks3(Block par1) {
- super(par1);
- }
+ public GregtechMetaCasingItemBlocks3(Block par1) {
+ super(par1);
+ }
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- int meta = aStack.getItemDamage();
- int tier = GregtechMetaTileEntity_PowerSubStationController.getCellTier(field_150939_a, meta);
- if (tier > 0) {
- long capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(tier);
- aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity));
- }
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- }
- }
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ int meta = aStack.getItemDamage();
+ int tier = GregtechMetaTileEntity_PowerSubStationController.getCellTier(field_150939_a, meta);
+ if (tier > 0) {
+ long capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(tier);
+ aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity));
+ }
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ }
+ }
- public GregtechMetaCasingBlocks3() {
- super(GregtechMetaCasingItemBlocks3.class, "gtplusplus.blockcasings.3", GT_Material_Casings.INSTANCE);
- for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- // Free up Redox casing in TAE
- if (i >= 4 && i <= 8) {
- continue;
- }
- TAE.registerTexture(2, i, new GTPP_CopiedBlockTexture(this, 6, i));
- }
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Aquatic Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel Reinforced Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Multi-Use Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Trinium Plated Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Vanadium Redox Power Cell (IV)");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Vanadium Redox Power Cell (LuV)");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Vanadium Redox Power Cell (ZPM)");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (MAX)");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Supply Depot Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Advanced Cryogenic Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Volcanus Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Fusion Machine Casing MK III");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Advanced Fusion Coil");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Unnamed"); // Can Use, don't change texture (Used for Fusion MK4)
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Containment Casing");
- GregtechItemList.Casing_FishPond.set(new ItemStack(this, 1, 0));
- GregtechItemList.Casing_Extruder.set(new ItemStack(this, 1, 1));
- GregtechItemList.Casing_Multi_Use.set(new ItemStack(this, 1, 2));
- GregtechItemList.Casing_BedrockMiner.set(new ItemStack(this, 1, 3));
- GregtechItemList.Casing_Vanadium_Redox_IV.set(new ItemStack(this, 1, 4));
- GregtechItemList.Casing_Vanadium_Redox_LuV.set(new ItemStack(this, 1, 5));
- GregtechItemList.Casing_Vanadium_Redox_ZPM.set(new ItemStack(this, 1, 6));
- GregtechItemList.Casing_Vanadium_Redox_UV.set(new ItemStack(this, 1, 7));
- GregtechItemList.Casing_Vanadium_Redox_MAX.set(new ItemStack(this, 1, 8));
- GregtechItemList.Casing_AmazonWarehouse.set(new ItemStack(this, 1, 9));
- GregtechItemList.Casing_AdvancedVacuum.set(new ItemStack(this, 1, 10));
- GregtechItemList.Casing_Adv_BlastFurnace.set(new ItemStack(this, 1, 11));
- GregtechItemList.Casing_Fusion_External.set(new ItemStack(this, 1, 12));
- GregtechItemList.Casing_Fusion_Internal.set(new ItemStack(this, 1, 13));
- GregtechItemList.Casing_Containment.set(new ItemStack(this, 1, 15));
- }
+ public GregtechMetaCasingBlocks3() {
+ super(GregtechMetaCasingItemBlocks3.class, "gtplusplus.blockcasings.3", GT_Material_Casings.INSTANCE);
+ for (byte i = 0; i < 16; i = (byte) (i + 1)) {
+ // Free up Redox casing in TAE
+ if (i >= 4 && i <= 8) {
+ continue;
+ }
+ TAE.registerTexture(2, i, new GTPP_CopiedBlockTexture(this, 6, i));
+ }
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Aquatic Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel Reinforced Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Multi-Use Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Trinium Plated Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".4.name", "Vanadium Redox Power Cell (IV)");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".5.name", "Vanadium Redox Power Cell (LuV)");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".6.name", "Vanadium Redox Power Cell (ZPM)");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (MAX)");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Supply Depot Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Advanced Cryogenic Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Volcanus Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".12.name", "Fusion Machine Casing MK III");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Advanced Fusion Coil");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".14.name",
+ "Unnamed"); // Can Use, don't change texture (Used for Fusion MK4)
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Containment Casing");
+ GregtechItemList.Casing_FishPond.set(new ItemStack(this, 1, 0));
+ GregtechItemList.Casing_Extruder.set(new ItemStack(this, 1, 1));
+ GregtechItemList.Casing_Multi_Use.set(new ItemStack(this, 1, 2));
+ GregtechItemList.Casing_BedrockMiner.set(new ItemStack(this, 1, 3));
+ GregtechItemList.Casing_Vanadium_Redox_IV.set(new ItemStack(this, 1, 4));
+ GregtechItemList.Casing_Vanadium_Redox_LuV.set(new ItemStack(this, 1, 5));
+ GregtechItemList.Casing_Vanadium_Redox_ZPM.set(new ItemStack(this, 1, 6));
+ GregtechItemList.Casing_Vanadium_Redox_UV.set(new ItemStack(this, 1, 7));
+ GregtechItemList.Casing_Vanadium_Redox_MAX.set(new ItemStack(this, 1, 8));
+ GregtechItemList.Casing_AmazonWarehouse.set(new ItemStack(this, 1, 9));
+ GregtechItemList.Casing_AdvancedVacuum.set(new ItemStack(this, 1, 10));
+ GregtechItemList.Casing_Adv_BlastFurnace.set(new ItemStack(this, 1, 11));
+ GregtechItemList.Casing_Fusion_External.set(new ItemStack(this, 1, 12));
+ GregtechItemList.Casing_Fusion_Internal.set(new ItemStack(this, 1, 13));
+ GregtechItemList.Casing_Containment.set(new ItemStack(this, 1, 15));
+ }
- @Override
- public IIcon getIcon(final int aSide, final int aMeta) {
- return CasingTextureHandler3.getIcon(aSide, aMeta);
- }
+ @Override
+ public IIcon getIcon(final int aSide, final int aMeta) {
+ return CasingTextureHandler3.getIcon(aSide, aMeta);
+ }
- @SideOnly(Side.CLIENT)
- @Override
- public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord,
- final int aSide) {
- final Block thisBlock = aWorld.getBlock(xCoord, yCoord, zCoord);
- final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- if ((tMeta != 12)|| !GregtechMetaCasingBlocks3.mConnectedMachineTextures) {
- return getIcon(aSide, tMeta);
- }
- final int tStartIndex = 0;
- if (tMeta == 12) {
- final boolean[] tConnectedSides = {
- aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta,
- aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta,
- aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta};
- switch (aSide) {
- case 0 : {
- if (tConnectedSides[0]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[2]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[5] && !tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
- }
- }
- case 1 : {
- if (tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
- }
- }
- case 2 : {
- if (tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
- }
- }
- case 3 : {
- if (tConnectedSides[3]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
- }
- }
- case 4 : {
- if (tConnectedSides[4]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
- }
- }
- case 5 : {
- if (tConnectedSides[2]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
- }
- break;
- }
- }
- return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
- }
- return CasingTextureHandler3.getIcon(aSide, tMeta);
- }
+ @SideOnly(Side.CLIENT)
+ @Override
+ public IIcon getIcon(
+ final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
+ final Block thisBlock = aWorld.getBlock(xCoord, yCoord, zCoord);
+ final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if ((tMeta != 12) || !GregtechMetaCasingBlocks3.mConnectedMachineTextures) {
+ return getIcon(aSide, tMeta);
+ }
+ final int tStartIndex = 0;
+ if (tMeta == 12) {
+ final boolean[] tConnectedSides = {
+ aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock
+ && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta,
+ aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock
+ && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta,
+ aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock
+ && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta,
+ aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock
+ && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta,
+ aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock
+ && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta,
+ aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock
+ && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta
+ };
+ switch (aSide) {
+ case 0: {
+ if (tConnectedSides[0]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
+ }
+ if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
+ }
+ if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
+ }
+ if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
+ }
+ if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
+ }
+ if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
+ }
+ if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
+ }
+ if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
+ }
+ if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
+ }
+ if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (!tConnectedSides[4] && !tConnectedSides[2]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
+ }
+ if (!tConnectedSides[5] && !tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
+ }
+ }
+ case 1: {
+ if (tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
+ }
+ if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
+ }
+ if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
+ }
+ if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
+ }
+ if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
+ }
+ if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
+ }
+ if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
+ }
+ if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
+ }
+ if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
+ }
+ if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (!tConnectedSides[2] && !tConnectedSides[4]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
+ }
+ if (!tConnectedSides[3] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
+ }
+ }
+ case 2: {
+ if (tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
+ }
+ if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
+ }
+ if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
+ }
+ if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
+ }
+ if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
+ }
+ if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
+ }
+ if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
+ }
+ if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
+ }
+ if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
+ }
+ if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (!tConnectedSides[2] && !tConnectedSides[4]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
+ }
+ if (!tConnectedSides[0] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
+ }
+ }
+ case 3: {
+ if (tConnectedSides[3]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
+ }
+ if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
+ }
+ if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
+ }
+ if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
+ }
+ if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
+ }
+ if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
+ }
+ if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
+ }
+ if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
+ }
+ if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
+ }
+ if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (!tConnectedSides[2] && !tConnectedSides[4]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
+ }
+ if (!tConnectedSides[0] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
+ }
+ }
+ case 4: {
+ if (tConnectedSides[4]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
+ }
+ if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
+ }
+ if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
+ }
+ if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
+ }
+ if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
+ }
+ if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
+ }
+ if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
+ }
+ if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
+ }
+ if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
+ }
+ if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (!tConnectedSides[0] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
+ }
+ if (!tConnectedSides[3] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
+ }
+ }
+ case 5: {
+ if (tConnectedSides[2]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon();
+ }
+ if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon();
+ }
+ if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon();
+ }
+ if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon();
+ }
+ if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon();
+ }
+ if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon();
+ }
+ if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon();
+ }
+ if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon();
+ }
+ if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon();
+ }
+ if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ if (!tConnectedSides[0] && !tConnectedSides[1]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon();
+ }
+ if (!tConnectedSides[3] && !tConnectedSides[5]) {
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon();
+ }
+ break;
+ }
+ }
+ return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon();
+ }
+ return CasingTextureHandler3.getIcon(aSide, tMeta);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
index 93ec53baba..5456aa27a2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
@@ -10,102 +10,98 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
+public class GregtechMetaCasingBlocks4 extends GregtechMetaCasingBlocksAbstract {
-public class GregtechMetaCasingBlocks4
-extends GregtechMetaCasingBlocksAbstract {
+ public GregtechMetaCasingBlocks4() {
+ super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.4", GT_Material_Casings.INSTANCE);
+ for (byte i = 0; i < 16; i = (byte) (i + 1)) {
+ if (i == 2 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 12 || i == 13 || i == 14 || i == 15) {
+ continue;
+ }
+ TAE.registerTexture(3, i, new GTPP_CopiedBlockTexture(this, 6, i));
+ }
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Naquadah Reactor Base"); // 48
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reactor Piping");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Naquadah Containment Chamber");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Tempered Arc Furnace Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
+ GregtechItemList.Casing_Naq_Reactor_A.set(new ItemStack(this, 1, 0));
+ GregtechItemList.Casing_Naq_Reactor_B.set(new ItemStack(this, 1, 1));
+ GregtechItemList.Casing_Naq_Reactor_C.set(new ItemStack(this, 1, 2));
+ GregtechItemList.Casing_Industrial_Arc_Furnace.set(new ItemStack(this, 1, 3));
+ GregtechItemList.Casing_Vacuum_Furnace.set(new ItemStack(this, 1, 10));
+ GregtechItemList.Casing_RocketEngine.set(new ItemStack(this, 1, 11));
+ }
- public GregtechMetaCasingBlocks4() {
- super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.4", GT_Material_Casings.INSTANCE);
- for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- if (i == 2 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 12 || i == 13 || i == 14 || i == 15) {
- continue;
- }
- TAE.registerTexture(3, i, new GTPP_CopiedBlockTexture(this, 6, i));
- }
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Naquadah Reactor Base"); //48
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reactor Piping");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Naquadah Containment Chamber");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Tempered Arc Furnace Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
- GregtechItemList.Casing_Naq_Reactor_A.set(new ItemStack(this, 1, 0));
- GregtechItemList.Casing_Naq_Reactor_B.set(new ItemStack(this, 1, 1));
- GregtechItemList.Casing_Naq_Reactor_C.set(new ItemStack(this, 1, 2));
- GregtechItemList.Casing_Industrial_Arc_Furnace.set(new ItemStack(this, 1, 3));
- GregtechItemList.Casing_Vacuum_Furnace.set(new ItemStack(this, 1, 10));
- GregtechItemList.Casing_RocketEngine.set(new ItemStack(this, 1, 11));
- }
+ // private static final LargeTurbineTextureHandler mTurbineTextures = new LargeTurbineTextureHandler();
- //private static final LargeTurbineTextureHandler mTurbineTextures = new LargeTurbineTextureHandler();
-
- /*@Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
- final GregtechMetaCasingBlocks4 i = this;
- return mTurbineTextures.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i);
- }*/
-
- @Override
- public IIcon getIcon(final int aSide, final int aMeta) {
- return getStaticIcon((byte) aSide, (byte) aMeta);
- }
-
- public static IIcon getStaticIcon(final byte aSide, final byte aMeta) {
- //Texture ID's. case 0 == ID[57]
- if ((aMeta >= 0) && (aMeta < 16)) {
- switch (aMeta) {
- case 0:
- return TexturesGtBlock.Casing_Trinium_Titanium.getIcon();
- case 1:
- return TexturesGtBlock.TEXTURE_TECH_C.getIcon();
- case 2:
- return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon();
- case 3:
- return TexturesGtBlock.TEXTURE_METAL_PANEL_A.getIcon();
- case 4:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 5:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 6:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 7:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 8:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 9:
- return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
- case 10:
- if (aSide <2) {
- return TexturesGtBlock.TEXTURE_STONE_RED_B.getIcon();
- }
- else {
- return TexturesGtBlock.TEXTURE_STONE_RED_A.getIcon();
- }
- case 11:
- return TexturesGtBlock.TEXTURE_CASING_ROCKETDYNE.getIcon();
- case 12:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 13:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 14:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 15:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- default:
- return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
+ /*@Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
+ final GregtechMetaCasingBlocks4 i = this;
+ return mTurbineTextures.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i);
+ }*/
- }
- }
- return TexturesGtBlock._PlaceHolder.getIcon();
- }
+ @Override
+ public IIcon getIcon(final int aSide, final int aMeta) {
+ return getStaticIcon((byte) aSide, (byte) aMeta);
+ }
+
+ public static IIcon getStaticIcon(final byte aSide, final byte aMeta) {
+ // Texture ID's. case 0 == ID[57]
+ if ((aMeta >= 0) && (aMeta < 16)) {
+ switch (aMeta) {
+ case 0:
+ return TexturesGtBlock.Casing_Trinium_Titanium.getIcon();
+ case 1:
+ return TexturesGtBlock.TEXTURE_TECH_C.getIcon();
+ case 2:
+ return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon();
+ case 3:
+ return TexturesGtBlock.TEXTURE_METAL_PANEL_A.getIcon();
+ case 4:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 5:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 6:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 7:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 8:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 9:
+ return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
+ case 10:
+ if (aSide < 2) {
+ return TexturesGtBlock.TEXTURE_STONE_RED_B.getIcon();
+ } else {
+ return TexturesGtBlock.TEXTURE_STONE_RED_A.getIcon();
+ }
+ case 11:
+ return TexturesGtBlock.TEXTURE_CASING_ROCKETDYNE.getIcon();
+ case 12:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 13:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 14:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 15:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ default:
+ return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
+ }
+ }
+ return TexturesGtBlock._PlaceHolder.getIcon();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java
index 27fa7349ca..834fb2c186 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java
@@ -14,79 +14,85 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
+public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract {
-public class GregtechMetaCasingBlocks5
-extends GregtechMetaCasingBlocksAbstract {
+ // Free Indexes within TAE: 91, 92, 94, 100, 101, 102, 103, 104, 114, 116, 117, 118, 119, 120, 121, 124, 125, 126,
+ // 127
+ // 19 Free Indexes
+ private static final TexturesGrinderMultiblock mGrinderOverlayHandler = new TexturesGrinderMultiblock();
- // Free Indexes within TAE: 91, 92, 94, 100, 101, 102, 103, 104, 114, 116, 117, 118, 119, 120, 121, 124, 125, 126, 127
- // 19 Free Indexes
- private static final TexturesGrinderMultiblock mGrinderOverlayHandler = new TexturesGrinderMultiblock();
-
- public GregtechMetaCasingBlocks5() {
- super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.5", GT_Material_Casings.INSTANCE);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "IsaMill Exterior Casing"); // IsaMill Casing
- TAE.registerTexture(0, 2, new GTPP_CopiedBlockTexture(this, 6, 0));
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "IsaMill Piping"); // IsaMill Pipe
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "IsaMill Gearbox"); // IsaMill Gearbox
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Elemental Confinement Shell"); // Duplicator Casing
- TAE.registerTexture(0, 3, new GTPP_CopiedBlockTexture(this, 6, 3));
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing
- TAE.registerTexture(0, 4, new GTPP_CopiedBlockTexture(this, 6, 4));
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Sturdy Printer Casing"); // Unused
- TAE.registerTexture(1, 10, new GTPP_CopiedBlockTexture(this, 6, 5));
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Forge Casing"); // Forge Hammer Casing
- TAE.registerTexture(1, 11, new GTPP_CopiedBlockTexture(this, 6, 6));
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
-
- GregtechItemList.Casing_IsaMill_Casing.set(new ItemStack(this, 1, 0));
- GregtechItemList.Casing_IsaMill_Pipe.set(new ItemStack(this, 1, 1));
- GregtechItemList.Casing_IsaMill_Gearbox.set(new ItemStack(this, 1, 2));
- GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 3));
- GregtechItemList.Casing_Sparge_Tower_Exterior.set(new ItemStack(this, 1, 4));
- GregtechItemList.Casing_IndustrialAutoChisel.set(new ItemStack(this, 1, 5));
- GregtechItemList.Casing_IndustrialForgeHammer.set(new ItemStack(this, 1, 6));
- }
-
- @Override
- public IIcon getIcon(final int aSide, final int aMeta) {
- return getStaticIcon(aSide, aMeta);
- }
-
+ public GregtechMetaCasingBlocks5() {
+ super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.5", GT_Material_Casings.INSTANCE);
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".0.name", "IsaMill Exterior Casing"); // IsaMill Casing
+ TAE.registerTexture(0, 2, new GTPP_CopiedBlockTexture(this, 6, 0));
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".1.name", "IsaMill Piping"); // IsaMill Pipe
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".2.name", "IsaMill Gearbox"); // IsaMill Gearbox
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".3.name", "Elemental Confinement Shell"); // Duplicator Casing
+ TAE.registerTexture(0, 3, new GTPP_CopiedBlockTexture(this, 6, 3));
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing
+ TAE.registerTexture(0, 4, new GTPP_CopiedBlockTexture(this, 6, 4));
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".5.name", "Sturdy Printer Casing"); // Unused
+ TAE.registerTexture(1, 10, new GTPP_CopiedBlockTexture(this, 6, 5));
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".6.name", "Forge Casing"); // Forge Hammer Casing
+ TAE.registerTexture(1, 11, new GTPP_CopiedBlockTexture(this, 6, 6));
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
- public static IIcon getStaticIcon(final int aSide, final int aMeta) {
- if ((aMeta >= 0) && (aMeta < 16)) {
- switch (aMeta) {
- case 0:
- return TexturesGtBlock.TEXTURE_PIPE_GRINDING_MILL.getIcon();
- case 1:
- return TexturesGtBlock.TEXTURE_CASING_GRINDING_MILL.getIcon();
- case 2:
- return TexturesGtBlock.TEXTURE_GEARBOX_GRINDING_MILL.getIcon();
- case 3:
- return TexturesGtBlock.TEXTURE_TECH_PANEL_D.getIcon();
- case 4:
- return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon();
- case 5:
- return TexturesGtBlock.Casing_Machine_Metal_Sheet_I.getIcon();
- case 6:
- return TexturesGtBlock.TEXTURE_TECH_PANEL_H.getIcon();
- }
- }
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- }
+ GregtechItemList.Casing_IsaMill_Casing.set(new ItemStack(this, 1, 0));
+ GregtechItemList.Casing_IsaMill_Pipe.set(new ItemStack(this, 1, 1));
+ GregtechItemList.Casing_IsaMill_Gearbox.set(new ItemStack(this, 1, 2));
+ GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 3));
+ GregtechItemList.Casing_Sparge_Tower_Exterior.set(new ItemStack(this, 1, 4));
+ GregtechItemList.Casing_IndustrialAutoChisel.set(new ItemStack(this, 1, 5));
+ GregtechItemList.Casing_IndustrialForgeHammer.set(new ItemStack(this, 1, 6));
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
- final GregtechMetaCasingBlocks5 i = this;
- return mGrinderOverlayHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i);
- }
+ @Override
+ public IIcon getIcon(final int aSide, final int aMeta) {
+ return getStaticIcon(aSide, aMeta);
+ }
+
+ public static IIcon getStaticIcon(final int aSide, final int aMeta) {
+ if ((aMeta >= 0) && (aMeta < 16)) {
+ switch (aMeta) {
+ case 0:
+ return TexturesGtBlock.TEXTURE_PIPE_GRINDING_MILL.getIcon();
+ case 1:
+ return TexturesGtBlock.TEXTURE_CASING_GRINDING_MILL.getIcon();
+ case 2:
+ return TexturesGtBlock.TEXTURE_GEARBOX_GRINDING_MILL.getIcon();
+ case 3:
+ return TexturesGtBlock.TEXTURE_TECH_PANEL_D.getIcon();
+ case 4:
+ return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon();
+ case 5:
+ return TexturesGtBlock.Casing_Machine_Metal_Sheet_I.getIcon();
+ case 6:
+ return TexturesGtBlock.TEXTURE_TECH_PANEL_H.getIcon();
+ }
+ }
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(
+ final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
+ final GregtechMetaCasingBlocks5 i = this;
+ return mGrinderOverlayHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
index ea59eb50ba..683159de98 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
@@ -1,11 +1,13 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gregtech.api.GregTech_API;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.common.blocks.GT_Block_Casings_Abstract;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import java.util.List;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -20,131 +22,127 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gregtech.api.GregTech_API;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.common.blocks.GT_Block_Casings_Abstract;
-
-import gtPlusPlus.core.creative.AddToCreativeTab;
-
-public abstract class GregtechMetaCasingBlocksAbstract
-extends GT_Block_Casings_Abstract {
- public GregtechMetaCasingBlocksAbstract(final Class<? extends ItemBlock> aItemClass, final String aName, final Material aMaterial) {
- super(aItemClass, aName, aMaterial);
- this.setStepSound(soundTypeMetal);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GregTech_API.registerMachineBlock(this, -1);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this");
- }
-
- @Override
- public String getHarvestTool(final int aMeta) {
- return "wrench";
- }
-
- @Override
- public int getHarvestLevel(final int aMeta) {
- return 2;
- }
-
- @Override
- public float getBlockHardness(final World aWorld, final int aX, final int aY, final int aZ) {
- return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
- }
-
- @Override
- public float getExplosionResistance(final Entity aTNT) {
- return Blocks.iron_block.getExplosionResistance(aTNT);
- }
-
- @Override
- protected boolean canSilkHarvest() {
- return false;
- }
-
- @Override
- public void onBlockAdded(final World aWorld, final int aX, final int aY, final int aZ) {
- if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- }
- }
-
- @Override
- public String getUnlocalizedName() {
- return this.mUnlocalizedName;
- }
-
- @Override
- public String getLocalizedName() {
- return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
- }
-
- @Override
- public boolean canBeReplacedByLeaves(final IBlockAccess aWorld, final int aX, final int aY, final int aZ) {
- return false;
- }
-
- @Override
- public boolean isNormalCube(final IBlockAccess aWorld, final int aX, final int aY, final int aZ) {
- return true;
- }
-
- @Override
- public boolean renderAsNormalBlock() {
- return true;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 0;
- }
-
- @Override
- public void breakBlock(final World aWorld, final int aX, final int aY, final int aZ, final Block aBlock, final int aMetaData) {
- if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
- @Override
- public int damageDropped(final int par1) {
- return par1;
- }
-
- @Override
- public int getDamageValue(final World par1World, final int par2, final int par3, final int par4) {
- return par1World.getBlockMetadata(par2, par3, par4);
- }
-
- @Override
- public int quantityDropped(final Random par1Random) {
- return 1;
- }
-
- @Override
- public Item getItemDropped(final int par1, final Random par2Random, final int par3) {
- return Item.getItemFromBlock(this);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister aIconRegister) {
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(final Item aItem, final CreativeTabs par2CreativeTabs, final List aList) {
- for (int i = 0; i < 16; i++) {
- aList.add(new ItemStack(aItem, 1, i));
- }
- }
+public abstract class GregtechMetaCasingBlocksAbstract extends GT_Block_Casings_Abstract {
+ public GregtechMetaCasingBlocksAbstract(
+ final Class<? extends ItemBlock> aItemClass, final String aName, final Material aMaterial) {
+ super(aItemClass, aName, aMaterial);
+ this.setStepSound(soundTypeMetal);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GregTech_API.registerMachineBlock(this, -1);
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this");
+ }
+
+ @Override
+ public String getHarvestTool(final int aMeta) {
+ return "wrench";
+ }
+
+ @Override
+ public int getHarvestLevel(final int aMeta) {
+ return 2;
+ }
+
+ @Override
+ public float getBlockHardness(final World aWorld, final int aX, final int aY, final int aZ) {
+ return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
+ }
+
+ @Override
+ public float getExplosionResistance(final Entity aTNT) {
+ return Blocks.iron_block.getExplosionResistance(aTNT);
+ }
+
+ @Override
+ protected boolean canSilkHarvest() {
+ return false;
+ }
+
+ @Override
+ public void onBlockAdded(final World aWorld, final int aX, final int aY, final int aZ) {
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName() {
+ return this.mUnlocalizedName;
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
+ }
+
+ @Override
+ public boolean canBeReplacedByLeaves(final IBlockAccess aWorld, final int aX, final int aY, final int aZ) {
+ return false;
+ }
+
+ @Override
+ public boolean isNormalCube(final IBlockAccess aWorld, final int aX, final int aY, final int aZ) {
+ return true;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock() {
+ return true;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ @Override
+ public void breakBlock(
+ final World aWorld, final int aX, final int aY, final int aZ, final Block aBlock, final int aMetaData) {
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(
+ final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+ @Override
+ public int damageDropped(final int par1) {
+ return par1;
+ }
+
+ @Override
+ public int getDamageValue(final World par1World, final int par2, final int par3, final int par4) {
+ return par1World.getBlockMetadata(par2, par3, par4);
+ }
+
+ @Override
+ public int quantityDropped(final Random par1Random) {
+ return 1;
+ }
+
+ @Override
+ public Item getItemDropped(final int par1, final Random par2Random, final int par3) {
+ return Item.getItemFromBlock(this);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister aIconRegister) {}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubBlocks(final Item aItem, final CreativeTabs par2CreativeTabs, final List aList) {
+ for (int i = 0; i < 16; i++) {
+ aList.add(new ItemStack(aItem, 1, i));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java
index 10c1a4e80f..22c1d87b4e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import java.util.HashMap;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -9,95 +7,95 @@ import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Material_Casings;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.HashMap;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
public class GregtechMetaCasingBlocksPipeGearbox extends GregtechMetaCasingBlocksAbstract {
- private static HashMap<Integer, Integer> sMaterialMapping = new HashMap<Integer, Integer>();
-
- public GregtechMetaCasingBlocksPipeGearbox() {
- super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.pipesgears", GT_Material_Casings.INSTANCE);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Eglin Steel Gear Box Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel-792 Gear Box Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Incoloy MA956 Gear Box Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Nitinol-60 Gear Box Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Zeron-100 Gear Box Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Pikyonium Gear Box Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Titansteel Gear Box Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Abyssal Gear Box Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Babbit Alloy Pipe Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Inconel-690 Pipe Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Stellite Pipe Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Nitinol-60 Pipe Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Lafium Pipe Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cinobite Pipe Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Titansteel Pipe Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Abyssal Pipe Casing");
+ private static HashMap<Integer, Integer> sMaterialMapping = new HashMap<Integer, Integer>();
- int aMappingID = 0;
- sMaterialMapping.put(aMappingID++, ALLOY.EGLIN_STEEL.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.INCONEL_792.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.INCOLOY_MA956.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.NITINOL_60.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.ZERON_100.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.PIKYONIUM.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.TITANSTEEL.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.ABYSSAL.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.BABBIT_ALLOY.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.INCONEL_690.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.STELLITE.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.NITINOL_60.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.LAFIUM.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.CINOBITE.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.TITANSTEEL.getRgbAsHex());
- sMaterialMapping.put(aMappingID++, ALLOY.ABYSSAL.getRgbAsHex());
+ public GregtechMetaCasingBlocksPipeGearbox() {
+ super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.pipesgears", GT_Material_Casings.INSTANCE);
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Eglin Steel Gear Box Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel-792 Gear Box Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".2.name", "Incoloy MA956 Gear Box Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Nitinol-60 Gear Box Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Zeron-100 Gear Box Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Pikyonium Gear Box Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Titansteel Gear Box Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Abyssal Gear Box Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Babbit Alloy Pipe Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Inconel-690 Pipe Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Stellite Pipe Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Nitinol-60 Pipe Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Lafium Pipe Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cinobite Pipe Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Titansteel Pipe Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Abyssal Pipe Casing");
- }
+ int aMappingID = 0;
+ sMaterialMapping.put(aMappingID++, ALLOY.EGLIN_STEEL.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.INCONEL_792.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.INCOLOY_MA956.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.NITINOL_60.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.ZERON_100.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.PIKYONIUM.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.TITANSTEEL.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.ABYSSAL.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.BABBIT_ALLOY.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.INCONEL_690.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.STELLITE.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.NITINOL_60.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.LAFIUM.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.CINOBITE.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.TITANSTEEL.getRgbAsHex());
+ sMaterialMapping.put(aMappingID++, ALLOY.ABYSSAL.getRgbAsHex());
+ }
- @Override
- public IIcon getIcon(final int aSide, final int aMeta) {
- if ((aMeta >= 0) && (aMeta < 16)) {
- switch (aMeta) {
- case 0 :
- case 1 :
- case 2 :
- case 3 :
- case 4 :
- case 5 :
- case 6 :
- case 7 :
- return TexturesGtBlock.TEXTURE_GEARBOX_GENERIC.getIcon();
- case 8 :
- case 9 :
- case 10 :
- case 11 :
- case 12 :
- case 13 :
- case 14 :
- case 15 :
- return TexturesGtBlock.TEXTURE_PIPE_GENERIC.getIcon();
- }
- }
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- }
+ @Override
+ public IIcon getIcon(final int aSide, final int aMeta) {
+ if ((aMeta >= 0) && (aMeta < 16)) {
+ switch (aMeta) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ return TexturesGtBlock.TEXTURE_GEARBOX_GENERIC.getIcon();
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ return TexturesGtBlock.TEXTURE_PIPE_GENERIC.getIcon();
+ }
+ }
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ }
@SideOnly(Side.CLIENT)
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
- return sMaterialMapping.get(par1IBlockAccess.getBlockMetadata(par2, par3, par4));
- }
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
+ return sMaterialMapping.get(par1IBlockAccess.getBlockMetadata(par2, par3, par4));
+ }
@SideOnly(Side.CLIENT)
- @Override
- public int getRenderColor(final int aMeta) {
- return sMaterialMapping.get(aMeta);
- }
+ @Override
+ public int getRenderColor(final int aMeta) {
+ return sMaterialMapping.get(aMeta);
+ }
@SideOnly(Side.CLIENT)
- @Override
- public int getBlockColor() {
- return super.getBlockColor();
- }
-
+ @Override
+ public int getBlockColor() {
+ return super.getBlockColor();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java
index de51cb164b..9927060164 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java
@@ -2,9 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks;
import net.minecraft.block.Block;
-public class GregtechMetaCasingItems
-extends GregtechMetaItemCasingsAbstract {
- public GregtechMetaCasingItems(final Block par1) {
- super(par1);
- }
+public class GregtechMetaCasingItems extends GregtechMetaItemCasingsAbstract {
+ public GregtechMetaCasingItems(final Block par1) {
+ super(par1);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java
index 7fb344a4ec..ba4929c011 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java
@@ -1,36 +1,35 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
-public class GregtechMetaItemCasings1
-extends GregtechMetaItemCasingsAbstract {
- public GregtechMetaItemCasings1(final Block par1) {
- super(par1);
- }
+public class GregtechMetaItemCasings1 extends GregtechMetaItemCasingsAbstract {
+ public GregtechMetaItemCasings1(final Block par1) {
+ super(par1);
+ }
- @Override
- public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) {
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- switch (this.getDamage(aStack)) {
- case 0:
- aList.add(this.mCasing_Centrifuge);
- break;
- case 1:
- aList.add(this.mCasing_CokeOven);
- break;
- case 2:
- aList.add(this.mCasing_CokeCoil1);
- break;
- case 3:
- aList.add(this.mCasing_CokeCoil2);
- break;
- default:
- aList.add(this.mCasing_CokeCoil2);
- break;
- }
- }
+ @Override
+ public void addInformation(
+ final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) {
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ switch (this.getDamage(aStack)) {
+ case 0:
+ aList.add(this.mCasing_Centrifuge);
+ break;
+ case 1:
+ aList.add(this.mCasing_CokeOven);
+ break;
+ case 2:
+ aList.add(this.mCasing_CokeCoil1);
+ break;
+ case 3:
+ aList.add(this.mCasing_CokeCoil2);
+ break;
+ default:
+ aList.add(this.mCasing_CokeCoil2);
+ break;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
index 62e0f0acdf..d9102f0994 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
@@ -1,61 +1,65 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
+import gregtech.api.util.GT_LanguageManager;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
-import gregtech.api.util.GT_LanguageManager;
-
-public abstract class GregtechMetaItemCasingsAbstract
-extends ItemBlock {
+public abstract class GregtechMetaItemCasingsAbstract extends ItemBlock {
- protected final String mCasing_Centrifuge = GT_LanguageManager.addStringLocalization("mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended");
- protected final String mCasing_CokeOven = GT_LanguageManager.addStringLocalization("mu.cokeoven", "Sturdy and Strong");
- protected final String mCasing_CokeCoil1 = GT_LanguageManager.addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin");
- protected final String mCasing_CokeCoil2 = GT_LanguageManager.addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin");
- protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block");
- protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!");
+ protected final String mCasing_Centrifuge = GT_LanguageManager.addStringLocalization(
+ "mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended");
+ protected final String mCasing_CokeOven =
+ GT_LanguageManager.addStringLocalization("mu.cokeoven", "Sturdy and Strong");
+ protected final String mCasing_CokeCoil1 =
+ GT_LanguageManager.addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin");
+ protected final String mCasing_CokeCoil2 =
+ GT_LanguageManager.addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin");
+ protected final String mNoMobsToolTip =
+ GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block");
+ protected final String mNoTileEntityToolTip =
+ GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!");
- public GregtechMetaItemCasingsAbstract(final Block par1) {
- super(par1);
- this.setMaxDamage(0);
- this.setHasSubtypes(true);
- //setCreativeTab(AddToCreativeTab.tabMachines);
- }
+ public GregtechMetaItemCasingsAbstract(final Block par1) {
+ super(par1);
+ this.setMaxDamage(0);
+ this.setHasSubtypes(true);
+ // setCreativeTab(AddToCreativeTab.tabMachines);
+ }
- @Override
- public int getMetadata(final int aMeta) {
- return aMeta;
- }
+ @Override
+ public int getMetadata(final int aMeta) {
+ return aMeta;
+ }
- @Override
- public String getUnlocalizedName(final ItemStack aStack) {
- return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack);
- }
+ @Override
+ public String getUnlocalizedName(final ItemStack aStack) {
+ return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack);
+ }
- @Override
- public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) {
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- switch (this.getDamage(aStack)) {
- case 0:
- //aList.add(this.mCasing_Centrifuge);
- break;
- case 1:
- //aList.add(this.mCasing_CokeOven);
- break;
- case 2:
- //aList.add(this.mCasing_CokeCoil1);
- break;
- case 3:
- //aList.add(this.mCasing_CokeCoil2);
- break;
- default:
- break;
- }
- aList.add(this.mNoMobsToolTip);
- aList.add(this.mNoTileEntityToolTip);
- }
+ @Override
+ public void addInformation(
+ final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) {
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ switch (this.getDamage(aStack)) {
+ case 0:
+ // aList.add(this.mCasing_Centrifuge);
+ break;
+ case 1:
+ // aList.add(this.mCasing_CokeOven);
+ break;
+ case 2:
+ // aList.add(this.mCasing_CokeCoil1);
+ break;
+ case 3:
+ // aList.add(this.mCasing_CokeCoil2);
+ break;
+ default:
+ break;
+ }
+ aList.add(this.mNoMobsToolTip);
+ aList.add(this.mNoTileEntityToolTip);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java
index b46e9d7464..f0a69e49d3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import java.util.List;
-
import gregtech.api.enums.TAE;
import gregtech.api.enums.Textures;
import gregtech.api.util.GT_LanguageManager;
@@ -9,73 +7,74 @@ import gregtech.common.blocks.GT_Material_Casings;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-
public class GregtechMetaSpecialMachineCasings extends GregtechMetaCasingBlocksAbstract {
+ public static class SpecialCasingItemBlock extends GregtechMetaCasingItems {
- public static class SpecialCasingItemBlock extends GregtechMetaCasingItems {
+ public SpecialCasingItemBlock(Block par1) {
+ super(par1);
+ }
- public SpecialCasingItemBlock(Block par1) {
- super(par1);
- }
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ int aMeta = aStack.getItemDamage();
+ if (aMeta < 10) {
+ // aList.add("Tier: "+GT_Values.VN[aMeta]);
+ }
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ }
+ }
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- int aMeta = aStack.getItemDamage();
- if (aMeta < 10) {
- //aList.add("Tier: "+GT_Values.VN[aMeta]);
- }
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- }
- }
-
- public GregtechMetaSpecialMachineCasings() {
- super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.2", GT_Material_Casings.INSTANCE);
- for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- //TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i));
- // Don't register these Textures, They already exist within vanilla GT. (May not exist in 5.08)
- }
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Strong Bronze Machine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Sturdy Aluminium Machine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Vigorous Laurenium Machine Casing");
- TAE.registerTexture(84, new GTPP_CopiedBlockTexture(this, 6, 2));
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Rugged Botmium Machine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
-
- GregtechItemList.Casing_Machine_Custom_1.set(new ItemStack(this, 1, 0));
- GregtechItemList.Casing_Machine_Custom_2.set(new ItemStack(this, 1, 1));
- GregtechItemList.Casing_Machine_Custom_3.set(new ItemStack(this, 1, 2));
- GregtechItemList.Casing_Machine_Custom_4.set(new ItemStack(this, 1, 3));
- }
+ public GregtechMetaSpecialMachineCasings() {
+ super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.2", GT_Material_Casings.INSTANCE);
+ for (byte i = 0; i < 16; i = (byte) (i + 1)) {
+ // TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i));
+ // Don't register these Textures, They already exist within vanilla GT. (May not exist in 5.08)
+ }
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Strong Bronze Machine Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".1.name", "Sturdy Aluminium Machine Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".2.name", "Vigorous Laurenium Machine Casing");
+ TAE.registerTexture(84, new GTPP_CopiedBlockTexture(this, 6, 2));
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".3.name", "Rugged Botmium Machine Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
- public IIcon getIcon(int aSide, int aMeta) {
- switch (aMeta) {
- case 0:
- return Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon();
- case 1:
- return Textures.BlockIcons.MACHINE_CASING_FROST_PROOF.getIcon();
- case 2:
- return TexturesGtBlock.Casing_Material_Laurenium.getIcon();
- case 3:
- return Textures.BlockIcons.MACHINE_HEATPROOFCASING.getIcon();
- }
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- }
+ GregtechItemList.Casing_Machine_Custom_1.set(new ItemStack(this, 1, 0));
+ GregtechItemList.Casing_Machine_Custom_2.set(new ItemStack(this, 1, 1));
+ GregtechItemList.Casing_Machine_Custom_3.set(new ItemStack(this, 1, 2));
+ GregtechItemList.Casing_Machine_Custom_4.set(new ItemStack(this, 1, 3));
+ }
+ public IIcon getIcon(int aSide, int aMeta) {
+ switch (aMeta) {
+ case 0:
+ return Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon();
+ case 1:
+ return Textures.BlockIcons.MACHINE_CASING_FROST_PROOF.getIcon();
+ case 2:
+ return TexturesGtBlock.Casing_Material_Laurenium.getIcon();
+ case 3:
+ return Textures.BlockIcons.MACHINE_HEATPROOFCASING.getIcon();
+ }
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java
index 8b8955df43..96a4e6da82 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.TAE;
@@ -12,114 +10,120 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
-
public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbstract {
-
- public static class SpecialCasingItemBlock extends GregtechMetaCasingItems {
- public SpecialCasingItemBlock(Block par1) {
- super(par1);
- }
+ public static class SpecialCasingItemBlock extends GregtechMetaCasingItems {
+
+ public SpecialCasingItemBlock(Block par1) {
+ super(par1);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ int aMeta = aStack.getItemDamage();
+ if (aMeta < 10) {
+ // aList.add("Tier: "+GT_Values.VN[aMeta]);
+ }
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ }
+ }
+
+ public GregtechMetaSpecialMultiCasings() {
+ super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.1", GT_Material_Casings.INSTANCE);
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Turbine Shaft");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".1.name", "Reinforced Steam Turbine Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".2.name", "Reinforced HP Steam Turbine Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".3.name", "Reinforced Gas Turbine Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".4.name", "Reinforced Plasma Turbine Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Tesla Containment Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Structural Solar Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Salt Containment Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Thermally Insulated Casing");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Flotation Cell Casings");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Reinforced Engine Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".11.name", "Molecular Containment Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".12.name", "High Voltage Current Capacitor");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Particle Containment Casing");
+ GT_LanguageManager.addStringLocalization(
+ this.getUnlocalizedName() + ".14.name", "Reinforced Heat Exchanger Casing");
+ TAE.registerTexture(1, 12, new GTPP_CopiedBlockTexture(this, 6, 14));
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- int aMeta = aStack.getItemDamage();
- if (aMeta < 10) {
- //aList.add("Tier: "+GT_Values.VN[aMeta]);
- }
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- }
- }
-
- public GregtechMetaSpecialMultiCasings() {
- super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.1", GT_Material_Casings.INSTANCE);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Turbine Shaft");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reinforced Steam Turbine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Reinforced HP Steam Turbine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Reinforced Gas Turbine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Reinforced Plasma Turbine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Tesla Containment Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Structural Solar Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Salt Containment Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Thermally Insulated Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Flotation Cell Casings");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Reinforced Engine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Molecular Containment Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "High Voltage Current Capacitor");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Particle Containment Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Reinforced Heat Exchanger Casing");
- TAE.registerTexture(1, 12, new GTPP_CopiedBlockTexture(this, 6, 14));
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
+ GregtechItemList.Casing_Turbine_Shaft.set(new ItemStack(this, 1, 0));
+ GregtechItemList.Casing_Turbine_LP.set(new ItemStack(this, 1, 1));
+ GregtechItemList.Casing_Turbine_HP.set(new ItemStack(this, 1, 2));
+ GregtechItemList.Casing_Turbine_Gas.set(new ItemStack(this, 1, 3));
+ GregtechItemList.Casing_Turbine_Plasma.set(new ItemStack(this, 1, 4));
+ GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 5));
+ GregtechItemList.Casing_SolarTower_Structural.set(new ItemStack(this, 1, 6));
+ GregtechItemList.Casing_SolarTower_SaltContainment.set(new ItemStack(this, 1, 7));
+ GregtechItemList.Casing_SolarTower_HeatContainment.set(new ItemStack(this, 1, 8));
+ GregtechItemList.Casing_Flotation_Cell.set(new ItemStack(this, 1, 9));
+ GregtechItemList.Casing_Reinforced_Engine_Casing.set(new ItemStack(this, 1, 10));
+ GregtechItemList.Casing_Molecular_Transformer_1.set(new ItemStack(this, 1, 11));
+ GregtechItemList.Casing_Molecular_Transformer_2.set(new ItemStack(this, 1, 12));
+ GregtechItemList.Casing_Molecular_Transformer_3.set(new ItemStack(this, 1, 13));
+ GregtechItemList.Casing_XL_HeatExchanger.set(new ItemStack(this, 1, 14));
+ }
- GregtechItemList.Casing_Turbine_Shaft.set(new ItemStack(this, 1, 0));
- GregtechItemList.Casing_Turbine_LP.set(new ItemStack(this, 1, 1));
- GregtechItemList.Casing_Turbine_HP.set(new ItemStack(this, 1, 2));
- GregtechItemList.Casing_Turbine_Gas.set(new ItemStack(this, 1, 3));
- GregtechItemList.Casing_Turbine_Plasma.set(new ItemStack(this, 1, 4));
- GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 5));
- GregtechItemList.Casing_SolarTower_Structural.set(new ItemStack(this, 1, 6));
- GregtechItemList.Casing_SolarTower_SaltContainment.set(new ItemStack(this, 1, 7));
- GregtechItemList.Casing_SolarTower_HeatContainment.set(new ItemStack(this, 1, 8));
- GregtechItemList.Casing_Flotation_Cell.set(new ItemStack(this, 1, 9));
- GregtechItemList.Casing_Reinforced_Engine_Casing.set(new ItemStack(this, 1, 10));
- GregtechItemList.Casing_Molecular_Transformer_1.set(new ItemStack(this, 1, 11));
- GregtechItemList.Casing_Molecular_Transformer_2.set(new ItemStack(this, 1, 12));
- GregtechItemList.Casing_Molecular_Transformer_3.set(new ItemStack(this, 1, 13));
- GregtechItemList.Casing_XL_HeatExchanger.set(new ItemStack(this, 1, 14));
-
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
- return LargeTurbineTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, this);
- }
- @Override
- public IIcon getIcon(final int aSide, final int aMeta) {
- return getStaticIcon((byte) aSide, (byte) aMeta);
- }
-
- public static IIcon getStaticIcon(final byte aSide, final byte aMeta) {
- switch (aMeta) {
- case 0:
- return TexturesGtBlock.Casing_Redox_1.getIcon();
- case 1:
- return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon();
- case 2:
- return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
- case 3:
- return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon();
- case 4:
- return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon();
- case 5:
- return TexturesGtBlock.Casing_Material_RedSteel.getIcon();
- case 6:
- return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
- case 7:
- return TexturesGtBlock.Casing_Material_Stellite.getIcon();
- case 8:
- return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
- case 9:
- return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon();
- case 10:
- return TexturesGtBlock.Casing_Material_Talonite.getIcon();
- case 11:
- return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon();
- case 12:
- return TexturesGtBlock.Casing_Redox_5.getIcon();
- case 13:
- return TexturesGtBlock.TEXTURE_MAGIC_PANEL_B.getIcon();
- case 14:
- return TexturesGtBlock.Casing_Material_Talonite.getIcon();
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(
+ final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
+ return LargeTurbineTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, this);
+ }
- }
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- }
+ @Override
+ public IIcon getIcon(final int aSide, final int aMeta) {
+ return getStaticIcon((byte) aSide, (byte) aMeta);
+ }
+ public static IIcon getStaticIcon(final byte aSide, final byte aMeta) {
+ switch (aMeta) {
+ case 0:
+ return TexturesGtBlock.Casing_Redox_1.getIcon();
+ case 1:
+ return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon();
+ case 2:
+ return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
+ case 3:
+ return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon();
+ case 4:
+ return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon();
+ case 5:
+ return TexturesGtBlock.Casing_Material_RedSteel.getIcon();
+ case 6:
+ return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
+ case 7:
+ return TexturesGtBlock.Casing_Material_Stellite.getIcon();
+ case 8:
+ return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
+ case 9:
+ return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon();
+ case 10:
+ return TexturesGtBlock.Casing_Material_Talonite.getIcon();
+ case 11:
+ return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon();
+ case 12:
+ return TexturesGtBlock.Casing_Redox_5.getIcon();
+ case 13:
+ return TexturesGtBlock.TEXTURE_MAGIC_PANEL_B.getIcon();
+ case 14:
+ return TexturesGtBlock.Casing_Material_Talonite.getIcon();
+ }
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java
index a80b788aa1..664f949b30 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -9,99 +7,98 @@ import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Material_Casings;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
-
public class GregtechMetaSpecialMultiCasings2 extends GregtechMetaCasingBlocksAbstract {
-
- public static class SpecialCasingItemBlock extends GregtechMetaCasingItems {
- public SpecialCasingItemBlock(Block par1) {
- super(par1);
- }
+ public static class SpecialCasingItemBlock extends GregtechMetaCasingItems {
+
+ public SpecialCasingItemBlock(Block par1) {
+ super(par1);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ int aMeta = aStack.getItemDamage();
+ if (aMeta < 4) {
+ aList.add("Provides quantum stability");
+ }
+ if (aMeta >= 4 && aMeta < 8) {
+ aList.add("Provides quantum modulation");
+ }
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ }
+ }
+
+ public GregtechMetaSpecialMultiCasings2() {
+ super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.3", GT_Material_Casings.INSTANCE);
+ for (byte i = 0; i < 16; i = (byte) (i + 1)) {
+ // TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i));
+ // Don't register these Textures, They already exist within vanilla GT. (May not exist in 5.08)
+ }
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Resonance Chamber I");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Resonance Chamber II");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Resonance Chamber III");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Resonance Chamber IV");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Modulator I");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Modulator II");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Modulator III");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Modulator IV");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- int aMeta = aStack.getItemDamage();
- if (aMeta < 4) {
- aList.add("Provides quantum stability");
- }
- if (aMeta >= 4 && aMeta < 8) {
- aList.add("Provides quantum modulation");
- }
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- }
- }
-
- public GregtechMetaSpecialMultiCasings2() {
- super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.3", GT_Material_Casings.INSTANCE);
- for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- //TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i));
- // Don't register these Textures, They already exist within vanilla GT. (May not exist in 5.08)
- }
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Resonance Chamber I");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Resonance Chamber II");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Resonance Chamber III");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Resonance Chamber IV");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Modulator I");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Modulator II");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Modulator III");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Modulator IV");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused
+ GregtechItemList.ResonanceChamber_I.set(new ItemStack(this, 1, 0));
+ GregtechItemList.ResonanceChamber_II.set(new ItemStack(this, 1, 1));
+ GregtechItemList.ResonanceChamber_III.set(new ItemStack(this, 1, 2));
+ GregtechItemList.ResonanceChamber_IV.set(new ItemStack(this, 1, 3));
+ GregtechItemList.Modulator_I.set(new ItemStack(this, 1, 4));
+ GregtechItemList.Modulator_II.set(new ItemStack(this, 1, 5));
+ GregtechItemList.Modulator_III.set(new ItemStack(this, 1, 6));
+ GregtechItemList.Modulator_IV.set(new ItemStack(this, 1, 7));
+ }
- GregtechItemList.ResonanceChamber_I.set(new ItemStack(this, 1, 0));
- GregtechItemList.ResonanceChamber_II.set(new ItemStack(this, 1, 1));
- GregtechItemList.ResonanceChamber_III.set(new ItemStack(this, 1, 2));
- GregtechItemList.ResonanceChamber_IV.set(new ItemStack(this, 1, 3));
- GregtechItemList.Modulator_I.set(new ItemStack(this, 1, 4));
- GregtechItemList.Modulator_II.set(new ItemStack(this, 1, 5));
- GregtechItemList.Modulator_III.set(new ItemStack(this, 1, 6));
- GregtechItemList.Modulator_IV.set(new ItemStack(this, 1, 7));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
- return getStaticIcon((byte) aSide, (byte) aWorld.getBlockMetadata(xCoord, yCoord, zCoord));
- }
-
- @Override
- public IIcon getIcon(final int aSide, final int aMeta) {
- return getStaticIcon((byte) aSide, (byte) aMeta);
- }
-
- public static IIcon getStaticIcon(final byte aSide, final byte aMeta) {
- switch (aMeta) {
- case 0:
- return TexturesGtBlock.Casing_Resonance_1.getIcon();
- case 1:
- return TexturesGtBlock.Casing_Resonance_2.getIcon();
- case 2:
- return TexturesGtBlock.Casing_Resonance_3.getIcon();
- case 3:
- return TexturesGtBlock.Casing_Resonance_4.getIcon();
- case 4:
- return TexturesGtBlock.Casing_Modulator_1.getIcon();
- case 5:
- return TexturesGtBlock.Casing_Modulator_2.getIcon();
- case 6:
- return TexturesGtBlock.Casing_Modulator_3.getIcon();
- case 7:
- return TexturesGtBlock.Casing_Modulator_4.getIcon();
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(
+ final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
+ return getStaticIcon((byte) aSide, (byte) aWorld.getBlockMetadata(xCoord, yCoord, zCoord));
+ }
- }
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- }
+ @Override
+ public IIcon getIcon(final int aSide, final int aMeta) {
+ return getStaticIcon((byte) aSide, (byte) aMeta);
+ }
+ public static IIcon getStaticIcon(final byte aSide, final byte aMeta) {
+ switch (aMeta) {
+ case 0:
+ return TexturesGtBlock.Casing_Resonance_1.getIcon();
+ case 1:
+ return TexturesGtBlock.Casing_Resonance_2.getIcon();
+ case 2:
+ return TexturesGtBlock.Casing_Resonance_3.getIcon();
+ case 3:
+ return TexturesGtBlock.Casing_Resonance_4.getIcon();
+ case 4:
+ return TexturesGtBlock.Casing_Modulator_1.getIcon();
+ case 5:
+ return TexturesGtBlock.Casing_Modulator_2.getIcon();
+ case 6:
+ return TexturesGtBlock.Casing_Modulator_3.getIcon();
+ case 7:
+ return TexturesGtBlock.Casing_Modulator_4.getIcon();
+ }
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java
index cbd585e50d..b511926137 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java
@@ -1,110 +1,96 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-
-import java.util.List;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.TAE;
import gregtech.api.enums.Textures;
-import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Material_Casings;
-
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController;
-
+import java.util.List;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
public class GregtechMetaTieredCasingBlocks1 extends GregtechMetaCasingBlocksAbstract {
+ public static class TieredCasingItemBlock extends GregtechMetaCasingItems {
+
+ public TieredCasingItemBlock(Block par1) {
+ super(par1);
+ }
- public static class TieredCasingItemBlock extends GregtechMetaCasingItems {
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ int aMeta = aStack.getItemDamage();
+ if (aMeta < 10) {
+ aList.add("Tier: " + GT_Values.VN[aMeta]);
+ }
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ }
+ }
- public TieredCasingItemBlock(Block par1) {
- super(par1);
- }
+ public GregtechMetaTieredCasingBlocks1() {
+ super(TieredCasingItemBlock.class, "gtplusplus.blocktieredcasings.1", GT_Material_Casings.INSTANCE);
+ for (byte i = 0; i < 16; i = (byte) (i + 1)) {
+ // TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i));
+ // Don't register these Textures, Hatches should never need to use their Textures.
+ }
+ int aIndex = 0;
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Integral Encasement I");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Integral Encasement II");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Integral Encasement III");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Integral Encasement IV");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Integral Encasement V");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Integral Framework I");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Integral Framework II");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Integral Framework III");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Integral Framework IV");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Integral Framework V");
+ // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing");
+ // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing");
+ // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "");
+ // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "");
+ // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Placeholder Block");
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- int aMeta = aStack.getItemDamage();
- if (aMeta < 10) {
- aList.add("Tier: "+GT_Values.VN[aMeta]);
- }
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- }
- }
-
- public GregtechMetaTieredCasingBlocks1() {
- super(TieredCasingItemBlock.class, "gtplusplus.blocktieredcasings.1", GT_Material_Casings.INSTANCE);
- for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- //TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i));
- // Don't register these Textures, Hatches should never need to use their Textures.
- }
- int aIndex = 0;
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Integral Encasement I");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Integral Encasement II");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Integral Encasement III");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Integral Encasement IV");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Integral Encasement V");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Integral Framework I");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Integral Framework II");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Integral Framework III");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Integral Framework IV");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Integral Framework V");
- //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing");
- //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing");
- //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "");
- //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "");
- //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Placeholder Block");
-
- GregtechItemList.GTPP_Casing_ULV.set(new ItemStack(this, 1, 0));
- GregtechItemList.GTPP_Casing_LV.set(new ItemStack(this, 1, 1));
- GregtechItemList.GTPP_Casing_MV.set(new ItemStack(this, 1, 2));
- GregtechItemList.GTPP_Casing_HV.set(new ItemStack(this, 1, 3));
- GregtechItemList.GTPP_Casing_EV.set(new ItemStack(this, 1, 4));
- GregtechItemList.GTPP_Casing_IV.set(new ItemStack(this, 1, 5));
- GregtechItemList.GTPP_Casing_LuV.set(new ItemStack(this, 1, 6));
- GregtechItemList.GTPP_Casing_ZPM.set(new ItemStack(this, 1, 7));
- GregtechItemList.GTPP_Casing_UV.set(new ItemStack(this, 1, 8));
- GregtechItemList.GTPP_Casing_MAX.set(new ItemStack(this, 1, 9));
-
- //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 10));
- //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 11));
- //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 12));
- //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 13));
- //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 14));
- //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 15));
- }
+ GregtechItemList.GTPP_Casing_ULV.set(new ItemStack(this, 1, 0));
+ GregtechItemList.GTPP_Casing_LV.set(new ItemStack(this, 1, 1));
+ GregtechItemList.GTPP_Casing_MV.set(new ItemStack(this, 1, 2));
+ GregtechItemList.GTPP_Casing_HV.set(new ItemStack(this, 1, 3));
+ GregtechItemList.GTPP_Casing_EV.set(new ItemStack(this, 1, 4));
+ GregtechItemList.GTPP_Casing_IV.set(new ItemStack(this, 1, 5));
+ GregtechItemList.GTPP_Casing_LuV.set(new ItemStack(this, 1, 6));
+ GregtechItemList.GTPP_Casing_ZPM.set(new ItemStack(this, 1, 7));
+ GregtechItemList.GTPP_Casing_UV.set(new ItemStack(this, 1, 8));
+ GregtechItemList.GTPP_Casing_MAX.set(new ItemStack(this, 1, 9));
- public IIcon getIcon(int aSide, int aMeta) {
- if (aMeta < 10) {
- return TexturesGtBlock.TIERED_MACHINE_HULLS[aMeta].getIcon();
- }
- switch (aMeta) {
- case 10:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 11:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 12:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 13:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 14:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 15:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- }
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- }
+ // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 10));
+ // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 11));
+ // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 12));
+ // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 13));
+ // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 14));
+ // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 15));
+ }
+ public IIcon getIcon(int aSide, int aMeta) {
+ if (aMeta < 10) {
+ return TexturesGtBlock.TIERED_MACHINE_HULLS[aMeta].getIcon();
+ }
+ switch (aMeta) {
+ case 10:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 11:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 12:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 13:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 14:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 15:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ }
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
index 3e4b9a3fee..7ffa95c081 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
@@ -1,111 +1,183 @@
package gtPlusPlus.xmod.gregtech.common.blocks.fluid;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidRegistry;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
public class GregtechFluidHandler {
- protected static int cellID = 0;
-
- public static void run(){
- start();
- }
-
- private static void start(){
-
- /* Meta_GT_Proxy.addFluid("lubricant", "Lubricant", Materials.Lubricant, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("creosote", "Creosote Oil", Materials.Creosote, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Creosote, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("seedoil", "Seed Oil", Materials.SeedOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SeedOil, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("fishoil", "Fish Oil", Materials.FishOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.FishOil, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("oil", "Oil", Materials.Oil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Oil, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("fuel", "Diesel", Materials.Fuel, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("for.honey", "Honey", Materials.Honey, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Honey, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("biomass", "Biomass", Materials.Biomass, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Biomass, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("bioethanol", "Bio Ethanol", Materials.Ethanol, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Ethanol, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("sulfuricacid", "Sulfuric Acid", Materials.SulfuricAcid, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SulfuricAcid, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("milk", "Milk", Materials.Milk, 1, 290, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Milk, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("mcguffium", "Mc Guffium 239", Materials.McGuffium239, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.McGuffium239, 1L), ItemUtils.getEmptyCell(), 1000);
- Meta_GT_Proxy.addFluid("glue", "Glue", Materials.Glue, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Glue, 1L), ItemUtils.getEmptyCell(), 1000);
- */
-
- if (!LoadedMods.ThermalFoundation){
-
- Logger.INFO("Adding in our own GT versions of Thermal Foundation Fluids if they do not already exist.");
- if (!FluidRegistry.isFluidRegistered("cryotheum")) {
- FluidUtils.addGtFluid("cryotheum", "Gelid Cryotheum", GT_Materials.Cryotheum, 4, -1200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), ItemUtils.getEmptyCell(), 1000);
- }
- if (!FluidRegistry.isFluidRegistered("pyrotheum")) {
- FluidUtils.addGtFluid("pyrotheum", "Blazing Pyrotheum", GT_Materials.Pyrotheum, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), ItemUtils.getEmptyCell(), 1000);
- }
- if (!FluidRegistry.isFluidRegistered("ender")) {
- FluidUtils.addGtFluid("ender", "Resonant Ender", GT_Materials.Ender, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Ender, 1L), ItemUtils.getEmptyCell(), 1000);
- }
-
- }
-
- if (LoadedMods.IndustrialCraft2){
- Logger.INFO("Adding in GT Fluids for various nuclear related content.");
-
- FluidUtils.addGtFluid("hydrofluoricAcid", "Industrial Strength Hydrofluoric Acid", GT_Materials.HydrofluoricAcid, 1, 120, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L), ItemUtils.getEmptyCell(), 1000, false);
- generateIC2FluidCell("HydrofluoricAcid");
-
- FluidUtils.generateFluidNoPrefix("SulfurDioxide", "High Quality Sulfur Dioxide", 263, GT_Materials.SulfurDioxide.mRGBa);
-
- FluidUtils.addGtFluid("sulfurousAcid", "Sulfurous Acid", GT_Materials.SulfurousAcid, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurousAcid, 1L), ItemUtils.getEmptyCell(), 1000, false);
- generateIC2FluidCell("SulfurousAcid");
-
- FluidUtils.addGtFluid("sulfuricApatite", "Sulfuric Apatite Mix", GT_Materials.SulfuricApatite, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), ItemUtils.getEmptyCell(), 1000, false);
- generateIC2FluidCell("SulfuricApatite");
-
-
- //Check for IHL Hydrogen Chloride
- if (!LoadedMods.IHL || (ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 1) == null)){
- if (FluidUtils.getFluidStack("hydrogenchloride", 1) == null){
- if (LoadedMods.IHL){
- Logger.INFO("IHL Loaded but hydrogen chloride could not be found for some reason. How about we add our own.");
- }
- else {
- Logger.INFO("No Suitable versions of Hydrogen Chloride available, adding our own.");
- }
- FluidUtils.addGtFluid("hydrogenChloride", "Industrial Strength Hydrogen Chloride", GT_Materials.HydrogenChloride, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L), ItemUtils.getEmptyCell(), 1000, false);
- generateIC2FluidCell("HydrogenChloride");
- }
- }
-
-
- FluidUtils.addGtFluid("sulfuricLithium", "Sulfuric Lithium Mix", GT_Materials.SulfuricLithium, 4, 280, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricLithium, 1L), ItemUtils.getEmptyCell(), 1000, false);
- generateIC2FluidCell("SulfuricLithium");
-
- FluidUtils.addGtFluid("lithiumHydroxide", "Lithium Hydroxide", GT_Materials.LithiumHydroxide, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.LithiumHydroxide, 1L), ItemUtils.getEmptyCell(), 1000, false);
- generateIC2FluidCell("LithiumHydroxide");
-
-
- }
- }
-
- private static ItemStack generateIC2FluidCell(final String fluidNameWithCaps){
- Logger.INFO("Adding a Cell for "+fluidNameWithCaps);
- if (LoadedMods.IndustrialCraft2 && !LoadedMods.IndustrialCraft2Classic){
- return Utils.createInternalNameAndFluidCell(fluidNameWithCaps);
- }
- return null;
- }
-
- private static ItemStack generateIC2FluidCellNoOreDict(final String fluidNameWithCaps){
- Logger.INFO("Adding a Cell for "+fluidNameWithCaps);
- if (LoadedMods.IndustrialCraft2 && !LoadedMods.IndustrialCraft2Classic){
- return Utils.createInternalNameAndFluidCellNoOreDict(fluidNameWithCaps);
- }
- return null;
- }
-
+ protected static int cellID = 0;
+
+ public static void run() {
+ start();
+ }
+
+ private static void start() {
+
+ /* Meta_GT_Proxy.addFluid("lubricant", "Lubricant", Materials.Lubricant, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("creosote", "Creosote Oil", Materials.Creosote, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Creosote, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("seedoil", "Seed Oil", Materials.SeedOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SeedOil, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("fishoil", "Fish Oil", Materials.FishOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.FishOil, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("oil", "Oil", Materials.Oil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Oil, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("fuel", "Diesel", Materials.Fuel, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("for.honey", "Honey", Materials.Honey, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Honey, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("biomass", "Biomass", Materials.Biomass, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Biomass, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("bioethanol", "Bio Ethanol", Materials.Ethanol, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Ethanol, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("sulfuricacid", "Sulfuric Acid", Materials.SulfuricAcid, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SulfuricAcid, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("milk", "Milk", Materials.Milk, 1, 290, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Milk, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("mcguffium", "Mc Guffium 239", Materials.McGuffium239, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.McGuffium239, 1L), ItemUtils.getEmptyCell(), 1000);
+ Meta_GT_Proxy.addFluid("glue", "Glue", Materials.Glue, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Glue, 1L), ItemUtils.getEmptyCell(), 1000);
+ */
+
+ if (!LoadedMods.ThermalFoundation) {
+
+ Logger.INFO("Adding in our own GT versions of Thermal Foundation Fluids if they do not already exist.");
+ if (!FluidRegistry.isFluidRegistered("cryotheum")) {
+ FluidUtils.addGtFluid(
+ "cryotheum",
+ "Gelid Cryotheum",
+ GT_Materials.Cryotheum,
+ 4,
+ -1200,
+ GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000);
+ }
+ if (!FluidRegistry.isFluidRegistered("pyrotheum")) {
+ FluidUtils.addGtFluid(
+ "pyrotheum",
+ "Blazing Pyrotheum",
+ GT_Materials.Pyrotheum,
+ 4,
+ 4000,
+ GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000);
+ }
+ if (!FluidRegistry.isFluidRegistered("ender")) {
+ FluidUtils.addGtFluid(
+ "ender",
+ "Resonant Ender",
+ GT_Materials.Ender,
+ 4,
+ 4000,
+ GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Ender, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000);
+ }
+ }
+
+ if (LoadedMods.IndustrialCraft2) {
+ Logger.INFO("Adding in GT Fluids for various nuclear related content.");
+
+ FluidUtils.addGtFluid(
+ "hydrofluoricAcid",
+ "Industrial Strength Hydrofluoric Acid",
+ GT_Materials.HydrofluoricAcid,
+ 1,
+ 120,
+ GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000,
+ false);
+ generateIC2FluidCell("HydrofluoricAcid");
+
+ FluidUtils.generateFluidNoPrefix(
+ "SulfurDioxide", "High Quality Sulfur Dioxide", 263, GT_Materials.SulfurDioxide.mRGBa);
+
+ FluidUtils.addGtFluid(
+ "sulfurousAcid",
+ "Sulfurous Acid",
+ GT_Materials.SulfurousAcid,
+ 4,
+ 75,
+ GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurousAcid, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000,
+ false);
+ generateIC2FluidCell("SulfurousAcid");
+
+ FluidUtils.addGtFluid(
+ "sulfuricApatite",
+ "Sulfuric Apatite Mix",
+ GT_Materials.SulfuricApatite,
+ 4,
+ 500,
+ GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000,
+ false);
+ generateIC2FluidCell("SulfuricApatite");
+
+ // Check for IHL Hydrogen Chloride
+ if (!LoadedMods.IHL || (ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 1) == null)) {
+ if (FluidUtils.getFluidStack("hydrogenchloride", 1) == null) {
+ if (LoadedMods.IHL) {
+ Logger.INFO(
+ "IHL Loaded but hydrogen chloride could not be found for some reason. How about we add our own.");
+ } else {
+ Logger.INFO("No Suitable versions of Hydrogen Chloride available, adding our own.");
+ }
+ FluidUtils.addGtFluid(
+ "hydrogenChloride",
+ "Industrial Strength Hydrogen Chloride",
+ GT_Materials.HydrogenChloride,
+ 4,
+ 75,
+ GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000,
+ false);
+ generateIC2FluidCell("HydrogenChloride");
+ }
+ }
+
+ FluidUtils.addGtFluid(
+ "sulfuricLithium",
+ "Sulfuric Lithium Mix",
+ GT_Materials.SulfuricLithium,
+ 4,
+ 280,
+ GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricLithium, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000,
+ false);
+ generateIC2FluidCell("SulfuricLithium");
+
+ FluidUtils.addGtFluid(
+ "lithiumHydroxide",
+ "Lithium Hydroxide",
+ GT_Materials.LithiumHydroxide,
+ 4,
+ 500,
+ GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.LithiumHydroxide, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000,
+ false);
+ generateIC2FluidCell("LithiumHydroxide");
+ }
+ }
+
+ private static ItemStack generateIC2FluidCell(final String fluidNameWithCaps) {
+ Logger.INFO("Adding a Cell for " + fluidNameWithCaps);
+ if (LoadedMods.IndustrialCraft2 && !LoadedMods.IndustrialCraft2Classic) {
+ return Utils.createInternalNameAndFluidCell(fluidNameWithCaps);
+ }
+ return null;
+ }
+
+ private static ItemStack generateIC2FluidCellNoOreDict(final String fluidNameWithCaps) {
+ Logger.INFO("Adding a Cell for " + fluidNameWithCaps);
+ if (LoadedMods.IndustrialCraft2 && !LoadedMods.IndustrialCraft2Classic) {
+ return Utils.createInternalNameAndFluidCellNoOreDict(fluidNameWithCaps);
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
index 123df8fe0f..467602ce04 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
@@ -1,82 +1,84 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-
import gregtech.api.enums.Textures;
-
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
public class CasingTextureHandler {
- //private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59();
- //private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58();
- private static final TexturesCentrifugeMultiblock gregtechX = new TexturesCentrifugeMultiblock();
-
- public static IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57]
- if ((aMeta >= 0) && (aMeta < 16)) {
- switch (aMeta) {
- //Centrifuge
- case 0:
- return TexturesGtBlock.Casing_Material_Centrifuge.getIcon();
- //Coke Oven Frame
- case 1:
- return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon();
- //Coke Oven Casing Tier 1
- case 2:
- return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon();
- //Coke Oven Casing Tier 2
- case 3:
- return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon();
- //Material Press Casings
- case 4:
- return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
- //Electrolyzer Casings
- case 5:
- return TexturesGtBlock.Casing_Material_Potin.getIcon();
- //Broken Blue Fusion Casings
- case 6:
- return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
- //Maceration Stack Casings
- case 7:
- return TexturesGtBlock.Casing_Material_Tumbaga.getIcon();
- //Broken Pink Fusion Casings
- case 8:
- return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon();
- //Matter Fabricator Casings
- case 9:
- return TexturesGtBlock.TEXTURE_METAL_PANEL_F.getIcon();
- //Iron Blast Fuance Textures
- case 10:
- return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
- //Multitank Exterior Casing
- case 11:
- return TexturesGtBlock.Casing_Material_Grisium.getIcon();
- //Reactor Casing I
- case 12:
- return TexturesGtBlock.Casing_Material_Stellite.getIcon();
- //Reactor Casing II
- case 13:
- return TexturesGtBlock.Casing_Material_Zeron100.getIcon();
- case 14:
- return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon();
- case 15:
- return TexturesGtBlock.Casing_Material_ZirconiumCarbide.getIcon();
-
- default:
- return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon();
+ // private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59();
+ // private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58();
+ private static final TexturesCentrifugeMultiblock gregtechX = new TexturesCentrifugeMultiblock();
- }
- }
- return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon();
- }
+ public static IIcon getIcon(final int aSide, final int aMeta) { // Texture ID's. case 0 == ID[57]
+ if ((aMeta >= 0) && (aMeta < 16)) {
+ switch (aMeta) {
+ // Centrifuge
+ case 0:
+ return TexturesGtBlock.Casing_Material_Centrifuge.getIcon();
+ // Coke Oven Frame
+ case 1:
+ return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon();
+ // Coke Oven Casing Tier 1
+ case 2:
+ return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon();
+ // Coke Oven Casing Tier 2
+ case 3:
+ return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon();
+ // Material Press Casings
+ case 4:
+ return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
+ // Electrolyzer Casings
+ case 5:
+ return TexturesGtBlock.Casing_Material_Potin.getIcon();
+ // Broken Blue Fusion Casings
+ case 6:
+ return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
+ // Maceration Stack Casings
+ case 7:
+ return TexturesGtBlock.Casing_Material_Tumbaga.getIcon();
+ // Broken Pink Fusion Casings
+ case 8:
+ return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon();
+ // Matter Fabricator Casings
+ case 9:
+ return TexturesGtBlock.TEXTURE_METAL_PANEL_F.getIcon();
+ // Iron Blast Fuance Textures
+ case 10:
+ return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
+ // Multitank Exterior Casing
+ case 11:
+ return TexturesGtBlock.Casing_Material_Grisium.getIcon();
+ // Reactor Casing I
+ case 12:
+ return TexturesGtBlock.Casing_Material_Stellite.getIcon();
+ // Reactor Casing II
+ case 13:
+ return TexturesGtBlock.Casing_Material_Zeron100.getIcon();
+ case 14:
+ return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon();
+ case 15:
+ return TexturesGtBlock.Casing_Material_ZirconiumCarbide.getIcon();
+ default:
+ return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon();
+ }
+ }
+ return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon();
+ }
- public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- /*if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
- }
- return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);*/
- return gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
- }
-} \ No newline at end of file
+ public static IIcon handleCasingsGT(
+ final IBlockAccess aWorld,
+ final int xCoord,
+ final int yCoord,
+ final int zCoord,
+ final int aSide,
+ final GregtechMetaCasingBlocks thisBlock) {
+ /*if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ }
+ return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);*/
+ return gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java
index c980997c64..20519c0bb1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java
@@ -1,57 +1,53 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
-import net.minecraft.util.IIcon;
-
import gregtech.api.enums.Textures;
+import net.minecraft.util.IIcon;
public class CasingTextureHandler2 {
- public static IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57]
- if ((aMeta >= 0) && (aMeta < 16)) {
- switch (aMeta) {
- case 0:
- return TexturesGtBlock.Casing_Material_RedSteel.getIcon();
- case 1:
- return TexturesGtBlock.Casing_Material_HastelloyX.getIcon();
- case 2:
- return TexturesGtBlock.Casing_Material_HastelloyN.getIcon();
- case 3:
- return TexturesGtBlock.Casing_Material_Fluid_IncoloyDS.getIcon();
- case 4:
- return TexturesGtBlock.Casing_Material_Grisium.getIcon();
- case 5:
- return TexturesGtBlock.Casing_Machine_Metal_Panel_A.getIcon();
- case 6:
- return TexturesGtBlock.Casing_Machine_Metal_Grate_A.getIcon();
- case 7:
- return TexturesGtBlock.Casing_Redox_1.getIcon();
- case 8:
- return TexturesGtBlock.Casing_Machine_Metal_Sheet_A.getIcon();
- case 9:
- return TexturesGtBlock.Overlay_Machine_Cyber_A.getIcon();
- case 10:
- return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon();
- case 11:
- return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon();
- case 12:
- return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
- case 13:
- if (aSide <2) {
- return TexturesGtBlock.TEXTURE_TECH_A.getIcon();
- }
- else {
- return TexturesGtBlock.TEXTURE_TECH_B.getIcon();
- }
- case 14:
- return Textures.BlockIcons.RENDERING_ERROR.getIcon();
- case 15:
- return TexturesGtBlock.Casing_Machine_Acacia_Log.getIcon();
- default:
- return TexturesGtBlock.Overlay_UU_Matter.getIcon();
-
- }
- }
- return TexturesGtBlock._PlaceHolder.getIcon();
- }
-
-} \ No newline at end of file
+ public static IIcon getIcon(final int aSide, final int aMeta) { // Texture ID's. case 0 == ID[57]
+ if ((aMeta >= 0) && (aMeta < 16)) {
+ switch (aMeta) {
+ case 0:
+ return TexturesGtBlock.Casing_Material_RedSteel.getIcon();
+ case 1:
+ return TexturesGtBlock.Casing_Material_HastelloyX.getIcon();
+ case 2:
+ return TexturesGtBlock.Casing_Material_HastelloyN.getIcon();
+ case 3:
+ return TexturesGtBlock.Casing_Material_Fluid_IncoloyDS.getIcon();
+ case 4:
+ return TexturesGtBlock.Casing_Material_Grisium.getIcon();
+ case 5:
+ return TexturesGtBlock.Casing_Machine_Metal_Panel_A.getIcon();
+ case 6:
+ return TexturesGtBlock.Casing_Machine_Metal_Grate_A.getIcon();
+ case 7:
+ return TexturesGtBlock.Casing_Redox_1.getIcon();
+ case 8:
+ return TexturesGtBlock.Casing_Machine_Metal_Sheet_A.getIcon();
+ case 9:
+ return TexturesGtBlock.Overlay_Machine_Cyber_A.getIcon();
+ case 10:
+ return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon();
+ case 11:
+ return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon();
+ case 12:
+ return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
+ case 13:
+ if (aSide < 2) {
+ return TexturesGtBlock.TEXTURE_TECH_A.getIcon();
+ } else {
+ return TexturesGtBlock.TEXTURE_TECH_B.getIcon();
+ }
+ case 14:
+ return Textures.BlockIcons.RENDERING_ERROR.getIcon();
+ case 15:
+ return TexturesGtBlock.Casing_Machine_Acacia_Log.getIcon();
+ default:
+ return TexturesGtBlock.Overlay_UU_Matter.getIcon();
+ }
+ }
+ return TexturesGtBlock._PlaceHolder.getIcon();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java
index 019a432013..da2a09c7d2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java
@@ -1,68 +1,66 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
-import net.minecraft.util.IIcon;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks3;
+import net.minecraft.util.IIcon;
public class CasingTextureHandler3 {
- public static IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57]
- if ((aMeta >= 0) && (aMeta < 16)) {
- switch (aMeta) {
- case 0:
- //Aquatic Casing
- return TexturesGtBlock.TEXTURE_METAL_PANEL_B.getIcon();
- case 1:
- //Inconel Reinforced Casing
- return TexturesGtBlock.TEXTURE_METAL_PANEL_D.getIcon();
- case 2:
- //Multi-Use Casing
- return TexturesGtBlock.TEXTURE_METAL_PANEL_C.getIcon();
- case 3:
- //Trinium Plated Mining Platform Casing
- return TexturesGtBlock.Casing_Trinium_Naquadah_Vent.getIcon();
- case 4:
- //Vanadium Redox IV
- return TexturesGtBlock.Casing_Redox_2.getIcon();
- case 5:
- //Vanadium Redox LuV
- return TexturesGtBlock.Casing_Redox_3.getIcon();
- case 6:
- //Vanadium Redox ZPM
- return TexturesGtBlock.Casing_Redox_4.getIcon();
- case 7:
- //Vanadium Redox UV
- return TexturesGtBlock.Casing_Redox_5.getIcon();
- case 8:
- //Vanadium Redox MAX
- return TexturesGtBlock.Casing_Redox_6.getIcon();
- case 9:
- //Amazon Warehouse Casing
- return TexturesGtBlock.TEXTURE_CASING_AMAZON.getIcon();
- case 10:
- //Adv. Vac. Freezer
- return TexturesGtBlock.TEXTURE_CASING_ADVANCED_CRYOGENIC.getIcon();
- case 11:
- //Adv. EBF
- return TexturesGtBlock.TEXTURE_CASING_ADVANCED_VOLCNUS.getIcon();
- case 12:
- return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II.getIcon();
- case 13:
- return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II_INNER.getIcon();
- case 14:
- return TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA.getIcon();
- case 15:
- return TexturesGtBlock.TEXTURE_MAGIC_PANEL_A.getIcon();
-
- default:
- return TexturesGtBlock._PlaceHolder.getIcon();
-
- }
- }
- return TexturesGtBlock._PlaceHolder.getIcon();
- }
+ public static IIcon getIcon(final int aSide, final int aMeta) { // Texture ID's. case 0 == ID[57]
+ if ((aMeta >= 0) && (aMeta < 16)) {
+ switch (aMeta) {
+ case 0:
+ // Aquatic Casing
+ return TexturesGtBlock.TEXTURE_METAL_PANEL_B.getIcon();
+ case 1:
+ // Inconel Reinforced Casing
+ return TexturesGtBlock.TEXTURE_METAL_PANEL_D.getIcon();
+ case 2:
+ // Multi-Use Casing
+ return TexturesGtBlock.TEXTURE_METAL_PANEL_C.getIcon();
+ case 3:
+ // Trinium Plated Mining Platform Casing
+ return TexturesGtBlock.Casing_Trinium_Naquadah_Vent.getIcon();
+ case 4:
+ // Vanadium Redox IV
+ return TexturesGtBlock.Casing_Redox_2.getIcon();
+ case 5:
+ // Vanadium Redox LuV
+ return TexturesGtBlock.Casing_Redox_3.getIcon();
+ case 6:
+ // Vanadium Redox ZPM
+ return TexturesGtBlock.Casing_Redox_4.getIcon();
+ case 7:
+ // Vanadium Redox UV
+ return TexturesGtBlock.Casing_Redox_5.getIcon();
+ case 8:
+ // Vanadium Redox MAX
+ return TexturesGtBlock.Casing_Redox_6.getIcon();
+ case 9:
+ // Amazon Warehouse Casing
+ return TexturesGtBlock.TEXTURE_CASING_AMAZON.getIcon();
+ case 10:
+ // Adv. Vac. Freezer
+ return TexturesGtBlock.TEXTURE_CASING_ADVANCED_CRYOGENIC.getIcon();
+ case 11:
+ // Adv. EBF
+ return TexturesGtBlock.TEXTURE_CASING_ADVANCED_VOLCNUS.getIcon();
+ case 12:
+ return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II.getIcon();
+ case 13:
+ return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II_INNER.getIcon();
+ case 14:
+ return TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA.getIcon();
+ case 15:
+ return TexturesGtBlock.TEXTURE_MAGIC_PANEL_A.getIcon();
- static {
- GregtechMetaCasingBlocks3.mConnectedMachineTextures = true;
- }
+ default:
+ return TexturesGtBlock._PlaceHolder.getIcon();
+ }
+ }
+ return TexturesGtBlock._PlaceHolder.getIcon();
+ }
-} \ No newline at end of file
+ static {
+ GregtechMetaCasingBlocks3.mConnectedMachineTextures = true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java
index 6326dd2c29..2eef9d37f0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java
@@ -1,6 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
@@ -12,155 +11,166 @@ import net.minecraft.world.IBlockAccess;
public class TexturesCentrifugeMultiblock {
- private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE1");
- private static CustomIcon GT8_1 = new CustomIcon("iconsets/LARGECENTRIFUGE1");
- private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE2");
- private static CustomIcon GT8_2 = new CustomIcon("iconsets/LARGECENTRIFUGE2");
- private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE3");
- private static CustomIcon GT8_3 = new CustomIcon("iconsets/LARGECENTRIFUGE3");
- private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE4");
- private static CustomIcon GT8_4 = new CustomIcon("iconsets/LARGECENTRIFUGE4");
- private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
- private static CustomIcon GT8_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5");
- private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE6");
- private static CustomIcon GT8_6 = new CustomIcon("iconsets/LARGECENTRIFUGE6");
- private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE7");
- private static CustomIcon GT8_7 = new CustomIcon("iconsets/LARGECENTRIFUGE7");
- private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE8");
- private static CustomIcon GT8_8 = new CustomIcon("iconsets/LARGECENTRIFUGE8");
- private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE9");
- private static CustomIcon GT8_9 = new CustomIcon("iconsets/LARGECENTRIFUGE9");
+ private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE1");
+ private static CustomIcon GT8_1 = new CustomIcon("iconsets/LARGECENTRIFUGE1");
+ private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE2");
+ private static CustomIcon GT8_2 = new CustomIcon("iconsets/LARGECENTRIFUGE2");
+ private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE3");
+ private static CustomIcon GT8_3 = new CustomIcon("iconsets/LARGECENTRIFUGE3");
+ private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE4");
+ private static CustomIcon GT8_4 = new CustomIcon("iconsets/LARGECENTRIFUGE4");
+ private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
+ private static CustomIcon GT8_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5");
+ private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE6");
+ private static CustomIcon GT8_6 = new CustomIcon("iconsets/LARGECENTRIFUGE6");
+ private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE7");
+ private static CustomIcon GT8_7 = new CustomIcon("iconsets/LARGECENTRIFUGE7");
+ private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE8");
+ private static CustomIcon GT8_8 = new CustomIcon("iconsets/LARGECENTRIFUGE8");
+ private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE9");
+ private static CustomIcon GT8_9 = new CustomIcon("iconsets/LARGECENTRIFUGE9");
- private static CustomIcon frontFace_0 = (GT8_1);
- private static CustomIcon frontFaceActive_0 = (GT8_1_Active);
- private static CustomIcon frontFace_1 = (GT8_2);
- private static CustomIcon frontFaceActive_1 = (GT8_2_Active);
- private static CustomIcon frontFace_2 = (GT8_3);
- private static CustomIcon frontFaceActive_2 = (GT8_3_Active);
- private static CustomIcon frontFace_3 = (GT8_4);
- private static CustomIcon frontFaceActive_3 = (GT8_4_Active);
- private static CustomIcon frontFace_4 = (GT8_5);
- private static CustomIcon frontFaceActive_4 = (GT8_5_Active);
- private static CustomIcon frontFace_5 = (GT8_6);
- private static CustomIcon frontFaceActive_5 = (GT8_6_Active);
- private static CustomIcon frontFace_6 = (GT8_7);
- private static CustomIcon frontFaceActive_6 = (GT8_7_Active);
- private static CustomIcon frontFace_7 = (GT8_8);
- private static CustomIcon frontFaceActive_7 = (GT8_8_Active);
- private static CustomIcon frontFace_8 = (GT8_9);
- private static CustomIcon frontFaceActive_8 = (GT8_9_Active);
+ private static CustomIcon frontFace_0 = (GT8_1);
+ private static CustomIcon frontFaceActive_0 = (GT8_1_Active);
+ private static CustomIcon frontFace_1 = (GT8_2);
+ private static CustomIcon frontFaceActive_1 = (GT8_2_Active);
+ private static CustomIcon frontFace_2 = (GT8_3);
+ private static CustomIcon frontFaceActive_2 = (GT8_3_Active);
+ private static CustomIcon frontFace_3 = (GT8_4);
+ private static CustomIcon frontFaceActive_3 = (GT8_4_Active);
+ private static CustomIcon frontFace_4 = (GT8_5);
+ private static CustomIcon frontFaceActive_4 = (GT8_5_Active);
+ private static CustomIcon frontFace_5 = (GT8_6);
+ private static CustomIcon frontFaceActive_5 = (GT8_6_Active);
+ private static CustomIcon frontFace_6 = (GT8_7);
+ private static CustomIcon frontFaceActive_6 = (GT8_7_Active);
+ private static CustomIcon frontFace_7 = (GT8_8);
+ private static CustomIcon frontFaceActive_7 = (GT8_8_Active);
+ private static CustomIcon frontFace_8 = (GT8_9);
+ private static CustomIcon frontFaceActive_8 = (GT8_9_Active);
- CustomIcon[] CENTRIFUGE = new CustomIcon[]{
- frontFace_0,
- frontFace_1,
- frontFace_2,
- frontFace_3,
- frontFace_4,
- frontFace_5,
- frontFace_6,
- frontFace_7,
- frontFace_8
- };
+ CustomIcon[] CENTRIFUGE = new CustomIcon[] {
+ frontFace_0,
+ frontFace_1,
+ frontFace_2,
+ frontFace_3,
+ frontFace_4,
+ frontFace_5,
+ frontFace_6,
+ frontFace_7,
+ frontFace_8
+ };
- CustomIcon[] CENTRIFUGE_ACTIVE = new CustomIcon[]{
- frontFaceActive_0,
- frontFaceActive_1,
- frontFaceActive_2,
- frontFaceActive_3,
- frontFaceActive_4,
- frontFaceActive_5,
- frontFaceActive_6,
- frontFaceActive_7,
- frontFaceActive_8
- };
+ CustomIcon[] CENTRIFUGE_ACTIVE = new CustomIcon[] {
+ frontFaceActive_0,
+ frontFaceActive_1,
+ frontFaceActive_2,
+ frontFaceActive_3,
+ frontFaceActive_4,
+ frontFaceActive_5,
+ frontFaceActive_6,
+ frontFaceActive_7,
+ frontFaceActive_8
+ };
- public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
- }
+ public IIcon handleCasingsGT(
+ final IBlockAccess aWorld,
+ final int xCoord,
+ final int yCoord,
+ final int zCoord,
+ final int aSide,
+ final GregtechMetaCasingBlocks thisBlock) {
+ return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ }
- private static int isCentrifugeControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (!(tTileEntity instanceof IGregTechTileEntity)) return 0;
- IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity;
- if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialCentrifuge && tTile.getFrontFacing() == aSide)
- return tTile.isActive() ? 1 : 2;
- return 0;
- }
+ private static int isCentrifugeControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (!(tTileEntity instanceof IGregTechTileEntity)) return 0;
+ IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity;
+ if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialCentrifuge
+ && tTile.getFrontFacing() == aSide) return tTile.isActive() ? 1 : 2;
+ return 0;
+ }
- public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- if (tMeta != 0) {
- return CasingTextureHandler.getIcon(aSide, tMeta);
- }
- int tInvertLeftRightMod = aSide % 2 * 2 - 1;
- switch (aSide / 2) {
- case 0:
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (i == 0 && j == 0)
- continue;
- if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide) != 0) {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity();
- return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j);
- }
- }
- }
- break;
- case 1:
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (i == 0 && j == 0)
- continue;
- if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide) != 0) {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity();
- return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod);
- }
- }
- }
- break;
- case 2:
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (i == 0 && j == 0)
- continue;
- if (isCentrifugeControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide) != 0) {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity();
- return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod);
- }
- }
- }
- break;
- }
- return TexturesGtBlock.Casing_Material_Centrifuge.getIcon();
- }
-
- public boolean isCentrifugeRunning(IMetaTileEntity aTile) {
- if (aTile == null) {
- return false;
- }
- else {
- return aTile.getBaseMetaTileEntity().isActive();
- }
-
-
- }
-
- public boolean isUsingAnimatedTexture(IMetaTileEntity aMetaTileEntity) {
- if (aMetaTileEntity != null) {
- if (aMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- return ((GregtechMetaTileEntity_IndustrialCentrifuge) aMetaTileEntity).usingAnimations();
- }
- }
- return false;
- }
+ public IIcon handleCasingsGT58(
+ final IBlockAccess aWorld,
+ final int xCoord,
+ final int yCoord,
+ final int zCoord,
+ final int aSide,
+ final GregtechMetaCasingBlocks thisBlock) {
+ final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if (tMeta != 0) {
+ return CasingTextureHandler.getIcon(aSide, tMeta);
+ }
+ int tInvertLeftRightMod = aSide % 2 * 2 - 1;
+ switch (aSide / 2) {
+ case 0:
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if (i == 0 && j == 0) continue;
+ if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide) != 0) {
+ IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity)
+ aWorld.getTileEntity(xCoord + j, yCoord, zCoord + i))
+ .getMetaTileEntity();
+ return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j);
+ }
+ }
+ }
+ break;
+ case 1:
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if (i == 0 && j == 0) continue;
+ if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide) != 0) {
+ IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity)
+ aWorld.getTileEntity(xCoord + j, yCoord + i, zCoord))
+ .getMetaTileEntity();
+ return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod);
+ }
+ }
+ }
+ break;
+ case 2:
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if (i == 0 && j == 0) continue;
+ if (isCentrifugeControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide) != 0) {
+ IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity)
+ aWorld.getTileEntity(xCoord, yCoord + i, zCoord + j))
+ .getMetaTileEntity();
+ return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod);
+ }
+ }
+ }
+ break;
+ }
+ return TexturesGtBlock.Casing_Material_Centrifuge.getIcon();
+ }
- public IIcon getIconByIndex(IMetaTileEntity aMetaTileEntity, int aIndex) {
- if (isUsingAnimatedTexture(aMetaTileEntity)) {
- if (isCentrifugeRunning(aMetaTileEntity)) {
- return this.CENTRIFUGE_ACTIVE[aIndex].getIcon();
- }
- }
- return this.CENTRIFUGE[aIndex].getIcon();
- }
-
+ public boolean isCentrifugeRunning(IMetaTileEntity aTile) {
+ if (aTile == null) {
+ return false;
+ } else {
+ return aTile.getBaseMetaTileEntity().isActive();
+ }
+ }
+
+ public boolean isUsingAnimatedTexture(IMetaTileEntity aMetaTileEntity) {
+ if (aMetaTileEntity != null) {
+ if (aMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ return ((GregtechMetaTileEntity_IndustrialCentrifuge) aMetaTileEntity).usingAnimations();
+ }
+ }
+ return false;
+ }
+
+ public IIcon getIconByIndex(IMetaTileEntity aMetaTileEntity, int aIndex) {
+ if (isUsingAnimatedTexture(aMetaTileEntity)) {
+ if (isCentrifugeRunning(aMetaTileEntity)) {
+ return this.CENTRIFUGE_ACTIVE[aIndex].getIcon();
+ }
+ }
+ return this.CENTRIFUGE[aIndex].getIcon();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java
index e772f0f48c..2298e0731e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java
@@ -1,443 +1,536 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialCentrifuge;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
public class TexturesGregtech58 {
- private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE1");
- private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE1");
- private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE2");
- private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE2");
- private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE3");
- private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE3");
- private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE4");
- private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE4");
- private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE5");
- private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE5");
- private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE6");
- private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE6");
- private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE7");
- private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE7");
- private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE8");
- private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE8");
- private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE9");
- private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE9");
-
- private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_1 = (GT8_2);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = (GT8_2_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_2 = (GT8_3);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = (GT8_3_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_3 = (GT8_4);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = (GT8_4_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_4 = (GT8_5);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = (GT8_5_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_5 = (GT8_6);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = (GT8_6_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_6 = (GT8_7);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = (GT8_7_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_7 = (GT8_8);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = (GT8_8_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active);
-
- Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[]{
- frontFace_0,
- frontFace_1,
- frontFace_2,
- frontFace_3,
- frontFace_4,
- frontFace_5,
- frontFace_6,
- frontFace_7,
- frontFace_8
- };
-
- Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[]{
- frontFaceActive_0,
- frontFaceActive_1,
- frontFaceActive_2,
- frontFaceActive_3,
- frontFaceActive_4,
- frontFaceActive_5,
- frontFaceActive_6,
- frontFaceActive_7,
- frontFaceActive_8
- };
+ private static Textures.BlockIcons.CustomIcon GT8_1_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE1");
+ private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE1");
+ private static Textures.BlockIcons.CustomIcon GT8_2_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE2");
+ private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE2");
+ private static Textures.BlockIcons.CustomIcon GT8_3_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE3");
+ private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE3");
+ private static Textures.BlockIcons.CustomIcon GT8_4_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE4");
+ private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE4");
+ private static Textures.BlockIcons.CustomIcon GT8_5_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE5");
+ private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE5");
+ private static Textures.BlockIcons.CustomIcon GT8_6_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE6");
+ private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE6");
+ private static Textures.BlockIcons.CustomIcon GT8_7_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE7");
+ private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE7");
+ private static Textures.BlockIcons.CustomIcon GT8_8_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE8");
+ private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE8");
+ private static Textures.BlockIcons.CustomIcon GT8_9_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE9");
+ private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE9");
+ private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_1 = (GT8_2);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = (GT8_2_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_2 = (GT8_3);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = (GT8_3_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_3 = (GT8_4);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = (GT8_4_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_4 = (GT8_5);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = (GT8_5_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_5 = (GT8_6);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = (GT8_6_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_6 = (GT8_7);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = (GT8_7_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_7 = (GT8_8);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = (GT8_8_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active);
- public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
- }
+ Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] {
+ frontFace_0,
+ frontFace_1,
+ frontFace_2,
+ frontFace_3,
+ frontFace_4,
+ frontFace_5,
+ frontFace_6,
+ frontFace_7,
+ frontFace_8
+ };
+ Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] {
+ frontFaceActive_0,
+ frontFaceActive_1,
+ frontFaceActive_2,
+ frontFaceActive_3,
+ frontFaceActive_4,
+ frontFaceActive_5,
+ frontFaceActive_6,
+ frontFaceActive_7,
+ frontFaceActive_8
+ };
- public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) {
- return CasingTextureHandler.getIcon(aSide, tMeta);
- }
- final int tStartIndex = tMeta == 6 ? 1 : 13;
- if (tMeta == 0) {
- if ((aSide == 2) || (aSide == 3)) {
- TileEntity tTileEntity;
- IMetaTileEntity tMetaTileEntity;
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[0].getIcon();
- }
- return this.TURBINE[0].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[3].getIcon();
- }
- return this.TURBINE[3].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[6].getIcon();
- }
- return this.TURBINE[6].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[1].getIcon();
- }
- return this.TURBINE[1].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[7].getIcon();
- }
- return this.TURBINE[7].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[8].getIcon();
- }
- return this.TURBINE[8].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[5].getIcon();
- }
- return this.TURBINE[5].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[2].getIcon();
- }
- return this.TURBINE[2].getIcon();
- }
- } else if ((aSide == 4) || (aSide == 5)) {
- TileEntity tTileEntity;
- Object tMetaTileEntity;
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[0].getIcon();
- }
- return this.TURBINE[0].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[3].getIcon();
- }
- return this.TURBINE[3].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[6].getIcon();
- }
- return this.TURBINE[6].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[1].getIcon();
- }
- return this.TURBINE[1].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[7].getIcon();
- }
- return this.TURBINE[7].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[8].getIcon();
- }
- return this.TURBINE[8].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[5].getIcon();
- }
- return this.TURBINE[5].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[2].getIcon();
- }
- return this.TURBINE[2].getIcon();
- }
- }
- return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
- }
- final boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)};
- switch (aSide) {
- case 0:
- if (tConnectedSides[0]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[2])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- if ((!tConnectedSides[5]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- case 1:
- if (tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- case 2:
- if (tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- case 3:
- if (tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- case 4:
- if (tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- case 5:
- if (tConnectedSides[2]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- break;
- }
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
+ public IIcon handleCasingsGT(
+ final IBlockAccess aWorld,
+ final int xCoord,
+ final int yCoord,
+ final int zCoord,
+ final int aSide,
+ final GregtechMetaCasingBlocks thisBlock) {
+ return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ }
+ public IIcon handleCasingsGT58(
+ final IBlockAccess aWorld,
+ final int xCoord,
+ final int yCoord,
+ final int zCoord,
+ final int aSide,
+ final GregtechMetaCasingBlocks thisBlock) {
+ final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) {
+ return CasingTextureHandler.getIcon(aSide, tMeta);
+ }
+ final int tStartIndex = tMeta == 6 ? 1 : 13;
+ if (tMeta == 0) {
+ if ((aSide == 2) || (aSide == 3)) {
+ TileEntity tTileEntity;
+ IMetaTileEntity tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[0].getIcon();
+ }
+ return this.TURBINE[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[3].getIcon();
+ }
+ return this.TURBINE[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[6].getIcon();
+ }
+ return this.TURBINE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[1].getIcon();
+ }
+ return this.TURBINE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[7].getIcon();
+ }
+ return this.TURBINE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[8].getIcon();
+ }
+ return this.TURBINE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[5].getIcon();
+ }
+ return this.TURBINE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[2].getIcon();
+ }
+ return this.TURBINE[2].getIcon();
+ }
+ } else if ((aSide == 4) || (aSide == 5)) {
+ TileEntity tTileEntity;
+ Object tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[0].getIcon();
+ }
+ return this.TURBINE[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[3].getIcon();
+ }
+ return this.TURBINE[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[6].getIcon();
+ }
+ return this.TURBINE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[1].getIcon();
+ }
+ return this.TURBINE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[7].getIcon();
+ }
+ return this.TURBINE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[8].getIcon();
+ }
+ return this.TURBINE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[5].getIcon();
+ }
+ return this.TURBINE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[2].getIcon();
+ }
+ return this.TURBINE[2].getIcon();
+ }
+ }
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
+ }
+ final boolean[] tConnectedSides = {
+ (aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta),
+ (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta),
+ (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta),
+ (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta),
+ (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta),
+ (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)
+ };
+ switch (aSide) {
+ case 0:
+ if (tConnectedSides[0]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[2])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[5]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 1:
+ if (tConnectedSides[1]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 2:
+ if (tConnectedSides[5]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 3:
+ if (tConnectedSides[3]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 4:
+ if (tConnectedSides[4]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ case 5:
+ if (tConnectedSides[2]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ break;
+ }
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java
index ac721d81c3..990db20285 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java
@@ -1,444 +1,545 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialCentrifuge;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
public class TexturesGregtech59 {
- private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE1");
- private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST1");
- private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE2");
- private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST2");
- private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE3");
- private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST3");
- private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE4");
- private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST4");
- private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE5");
- private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST5");
- private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE6");
- private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST6");
- private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE7");
- private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST7");
- private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE8");
- private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST8");
- private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE9");
- private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST9");
-
- private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_1 = (GT8_2);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = (GT8_2_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_2 = (GT8_3);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = (GT8_3_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_3 = (GT8_4);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = (GT8_4_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_4 = (GT8_5);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = (GT8_5_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_5 = (GT8_6);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = (GT8_6_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_6 = (GT8_7);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = (GT8_7_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_7 = (GT8_8);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = (GT8_8_Active);
- private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9);
- private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active);
-
- Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[]{
- frontFace_0,
- frontFace_1,
- frontFace_2,
- frontFace_3,
- frontFace_4,
- frontFace_5,
- frontFace_6,
- frontFace_7,
- frontFace_8
- };
-
- Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[]{
- frontFaceActive_0,
- frontFaceActive_1,
- frontFaceActive_2,
- frontFaceActive_3,
- frontFaceActive_4,
- frontFaceActive_5,
- frontFaceActive_6,
- frontFaceActive_7,
- frontFaceActive_8
- };
-
+ private static Textures.BlockIcons.CustomIcon GT8_1_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE1");
+ private static Textures.BlockIcons.CustomIcon GT8_1 =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST1");
+ private static Textures.BlockIcons.CustomIcon GT8_2_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE2");
+ private static Textures.BlockIcons.CustomIcon GT8_2 =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST2");
+ private static Textures.BlockIcons.CustomIcon GT8_3_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE3");
+ private static Textures.BlockIcons.CustomIcon GT8_3 =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST3");
+ private static Textures.BlockIcons.CustomIcon GT8_4_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE4");
+ private static Textures.BlockIcons.CustomIcon GT8_4 =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST4");
+ private static Textures.BlockIcons.CustomIcon GT8_5_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE5");
+ private static Textures.BlockIcons.CustomIcon GT8_5 =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST5");
+ private static Textures.BlockIcons.CustomIcon GT8_6_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE6");
+ private static Textures.BlockIcons.CustomIcon GT8_6 =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST6");
+ private static Textures.BlockIcons.CustomIcon GT8_7_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE7");
+ private static Textures.BlockIcons.CustomIcon GT8_7 =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST7");
+ private static Textures.BlockIcons.CustomIcon GT8_8_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE8");
+ private static Textures.BlockIcons.CustomIcon GT8_8 =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST8");
+ private static Textures.BlockIcons.CustomIcon GT8_9_Active =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE9");
+ private static Textures.BlockIcons.CustomIcon GT8_9 =
+ new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST9");
- public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- return this.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
- }
+ private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_1 = (GT8_2);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = (GT8_2_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_2 = (GT8_3);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = (GT8_3_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_3 = (GT8_4);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = (GT8_4_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_4 = (GT8_5);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = (GT8_5_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_5 = (GT8_6);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = (GT8_6_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_6 = (GT8_7);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = (GT8_7_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_7 = (GT8_8);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = (GT8_8_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active);
+ Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] {
+ frontFace_0,
+ frontFace_1,
+ frontFace_2,
+ frontFace_3,
+ frontFace_4,
+ frontFace_5,
+ frontFace_6,
+ frontFace_7,
+ frontFace_8
+ };
- public IIcon handleCasingsGT59(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) {
- return CasingTextureHandler.getIcon(aSide, tMeta);
- }
- final int tStartIndex = tMeta == 6 ? 1 : 13;
- if (tMeta == 0) {
- if ((aSide == 2) || (aSide == 3)) {
- TileEntity tTileEntity;
- IMetaTileEntity tMetaTileEntity;
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[0].getIcon();
- }
- return this.TURBINE[0].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[3].getIcon();
- }
- return this.TURBINE[3].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[6].getIcon();
- }
- return this.TURBINE[6].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[1].getIcon();
- }
- return this.TURBINE[1].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[7].getIcon();
- }
- return this.TURBINE[7].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[8].getIcon();
- }
- return this.TURBINE[8].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[5].getIcon();
- }
- return this.TURBINE[5].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[2].getIcon();
- }
- return this.TURBINE[2].getIcon();
- }
- } else if ((aSide == 4) || (aSide == 5)) {
- TileEntity tTileEntity;
- Object tMetaTileEntity;
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[0].getIcon();
- }
- return this.TURBINE[0].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[3].getIcon();
- }
- return this.TURBINE[3].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[6].getIcon();
- }
- return this.TURBINE[6].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[1].getIcon();
- }
- return this.TURBINE[1].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[7].getIcon();
- }
- return this.TURBINE[7].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[8].getIcon();
- }
- return this.TURBINE[8].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[5].getIcon();
- }
- return this.TURBINE[5].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[2].getIcon();
- }
- return this.TURBINE[2].getIcon();
- }
- }
- return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
- }
- final boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)};
- switch (aSide) {
- case 0:
- if (tConnectedSides[0]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[2])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- if ((!tConnectedSides[5]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- case 1:
- if (tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- case 2:
- if (tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- case 3:
- if (tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- case 4:
- if (tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- case 5:
- if (tConnectedSides[2]) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
- }
- if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
- }
- if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
- }
- if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
- }
- if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
- }
- if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
- if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
- }
- if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
- }
- break;
- }
- return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
- }
+ Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] {
+ frontFaceActive_0,
+ frontFaceActive_1,
+ frontFaceActive_2,
+ frontFaceActive_3,
+ frontFaceActive_4,
+ frontFaceActive_5,
+ frontFaceActive_6,
+ frontFaceActive_7,
+ frontFaceActive_8
+ };
+ public IIcon handleCasingsGT(
+ final IBlockAccess aWorld,
+ final int xCoord,
+ final int yCoord,
+ final int zCoord,
+ final int aSide,
+ final GregtechMetaCasingBlocks thisBlock) {
+ return this.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ }
+ public IIcon handleCasingsGT59(
+ final IBlockAccess aWorld,
+ final int xCoord,
+ final int yCoord,
+ final int zCoord,
+ final int aSide,
+ final GregtechMetaCasingBlocks thisBlock) {
+ final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) {
+ return CasingTextureHandler.getIcon(aSide, tMeta);
+ }
+ final int tStartIndex = tMeta == 6 ? 1 : 13;
+ if (tMeta == 0) {
+ if ((aSide == 2) || (aSide == 3)) {
+ TileEntity tTileEntity;
+ IMetaTileEntity tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[0].getIcon();
+ }
+ return this.TURBINE[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[3].getIcon();
+ }
+ return this.TURBINE[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[6].getIcon();
+ }
+ return this.TURBINE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[1].getIcon();
+ }
+ return this.TURBINE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[7].getIcon();
+ }
+ return this.TURBINE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[8].getIcon();
+ }
+ return this.TURBINE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[5].getIcon();
+ }
+ return this.TURBINE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[2].getIcon();
+ }
+ return this.TURBINE[2].getIcon();
+ }
+ } else if ((aSide == 4) || (aSide == 5)) {
+ TileEntity tTileEntity;
+ Object tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[0].getIcon();
+ }
+ return this.TURBINE[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[3].getIcon();
+ }
+ return this.TURBINE[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[6].getIcon();
+ }
+ return this.TURBINE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[1].getIcon();
+ }
+ return this.TURBINE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[7].getIcon();
+ }
+ return this.TURBINE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[8].getIcon();
+ }
+ return this.TURBINE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[5].getIcon();
+ }
+ return this.TURBINE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return this.TURBINE_ACTIVE[2].getIcon();
+ }
+ return this.TURBINE[2].getIcon();
+ }
+ }
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
+ }
+ final boolean[] tConnectedSides = {
+ (aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta),
+ (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta),
+ (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta),
+ (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta),
+ (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta),
+ (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock)
+ && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)
+ };
+ switch (aSide) {
+ case 0:
+ if (tConnectedSides[0]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[2])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[5]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 1:
+ if (tConnectedSides[1]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 2:
+ if (tConnectedSides[5]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 3:
+ if (tConnectedSides[3]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 4:
+ if (tConnectedSides[4]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ case 5:
+ if (tConnectedSides[2]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ break;
+ }
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java
index b254fdbc1e..e2d304572a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java
@@ -1,6 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks5;
@@ -12,139 +11,146 @@ import net.minecraft.world.IBlockAccess;
public class TexturesGrinderMultiblock {
- private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE1");
- private static CustomIcon GT8_1 = new CustomIcon("iconsets/Grinder/GRINDER1");
- private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE2");
- private static CustomIcon GT8_2 = new CustomIcon("iconsets/Grinder/GRINDER2");
- private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE3");
- private static CustomIcon GT8_3 = new CustomIcon("iconsets/Grinder/GRINDER3");
- private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE4");
- private static CustomIcon GT8_4 = new CustomIcon("iconsets/Grinder/GRINDER4");
- private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE5");
- private static CustomIcon GT8_5 = new CustomIcon("iconsets/Grinder/GRINDER5");
- private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE6");
- private static CustomIcon GT8_6 = new CustomIcon("iconsets/Grinder/GRINDER6");
- private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE7");
- private static CustomIcon GT8_7 = new CustomIcon("iconsets/Grinder/GRINDER7");
- private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE8");
- private static CustomIcon GT8_8 = new CustomIcon("iconsets/Grinder/GRINDER8");
- private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE9");
- private static CustomIcon GT8_9 = new CustomIcon("iconsets/Grinder/GRINDER9");
+ private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE1");
+ private static CustomIcon GT8_1 = new CustomIcon("iconsets/Grinder/GRINDER1");
+ private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE2");
+ private static CustomIcon GT8_2 = new CustomIcon("iconsets/Grinder/GRINDER2");
+ private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE3");
+ private static CustomIcon GT8_3 = new CustomIcon("iconsets/Grinder/GRINDER3");
+ private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE4");
+ private static CustomIcon GT8_4 = new CustomIcon("iconsets/Grinder/GRINDER4");
+ private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE5");
+ private static CustomIcon GT8_5 = new CustomIcon("iconsets/Grinder/GRINDER5");
+ private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE6");
+ private static CustomIcon GT8_6 = new CustomIcon("iconsets/Grinder/GRINDER6");
+ private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE7");
+ private static CustomIcon GT8_7 = new CustomIcon("iconsets/Grinder/GRINDER7");
+ private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE8");
+ private static CustomIcon GT8_8 = new CustomIcon("iconsets/Grinder/GRINDER8");
+ private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE9");
+ private static CustomIcon GT8_9 = new CustomIcon("iconsets/Grinder/GRINDER9");
- private static CustomIcon frontFace_0 = (GT8_1);
- private static CustomIcon frontFaceActive_0 = (GT8_1_Active);
- private static CustomIcon frontFace_1 = (GT8_2);
- private static CustomIcon frontFaceActive_1 = (GT8_2_Active);
- private static CustomIcon frontFace_2 = (GT8_3);
- private static CustomIcon frontFaceActive_2 = (GT8_3_Active);
- private static CustomIcon frontFace_3 = (GT8_4);
- private static CustomIcon frontFaceActive_3 = (GT8_4_Active);
- private static CustomIcon frontFace_4 = (GT8_5);
- private static CustomIcon frontFaceActive_4 = (GT8_5_Active);
- private static CustomIcon frontFace_5 = (GT8_6);
- private static CustomIcon frontFaceActive_5 = (GT8_6_Active);
- private static CustomIcon frontFace_6 = (GT8_7);
- private static CustomIcon frontFaceActive_6 = (GT8_7_Active);
- private static CustomIcon frontFace_7 = (GT8_8);
- private static CustomIcon frontFaceActive_7 = (GT8_8_Active);
- private static CustomIcon frontFace_8 = (GT8_9);
- private static CustomIcon frontFaceActive_8 = (GT8_9_Active);
+ private static CustomIcon frontFace_0 = (GT8_1);
+ private static CustomIcon frontFaceActive_0 = (GT8_1_Active);
+ private static CustomIcon frontFace_1 = (GT8_2);
+ private static CustomIcon frontFaceActive_1 = (GT8_2_Active);
+ private static CustomIcon frontFace_2 = (GT8_3);
+ private static CustomIcon frontFaceActive_2 = (GT8_3_Active);
+ private static CustomIcon frontFace_3 = (GT8_4);
+ private static CustomIcon frontFaceActive_3 = (GT8_4_Active);
+ private static CustomIcon frontFace_4 = (GT8_5);
+ private static CustomIcon frontFaceActive_4 = (GT8_5_Active);
+ private static CustomIcon frontFace_5 = (GT8_6);
+ private static CustomIcon frontFaceActive_5 = (GT8_6_Active);
+ private static CustomIcon frontFace_6 = (GT8_7);
+ private static CustomIcon frontFaceActive_6 = (GT8_7_Active);
+ private static CustomIcon frontFace_7 = (GT8_8);
+ private static CustomIcon frontFaceActive_7 = (GT8_8_Active);
+ private static CustomIcon frontFace_8 = (GT8_9);
+ private static CustomIcon frontFaceActive_8 = (GT8_9_Active);
- CustomIcon[] GRINDER = new CustomIcon[]{
- frontFace_0,
- frontFace_1,
- frontFace_2,
- frontFace_3,
- frontFace_4,
- frontFace_5,
- frontFace_6,
- frontFace_7,
- frontFace_8
- };
+ CustomIcon[] GRINDER = new CustomIcon[] {
+ frontFace_0,
+ frontFace_1,
+ frontFace_2,
+ frontFace_3,
+ frontFace_4,
+ frontFace_5,
+ frontFace_6,
+ frontFace_7,
+ frontFace_8
+ };
- CustomIcon[] GRINDER_ACTIVE = new CustomIcon[]{
- frontFaceActive_0,
- frontFaceActive_1,
- frontFaceActive_2,
- frontFaceActive_3,
- frontFaceActive_4,
- frontFaceActive_5,
- frontFaceActive_6,
- frontFaceActive_7,
- frontFaceActive_8
- };
+ CustomIcon[] GRINDER_ACTIVE = new CustomIcon[] {
+ frontFaceActive_0,
+ frontFaceActive_1,
+ frontFaceActive_2,
+ frontFaceActive_3,
+ frontFaceActive_4,
+ frontFaceActive_5,
+ frontFaceActive_6,
+ frontFaceActive_7,
+ frontFaceActive_8
+ };
- private static int isIsaControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (!(tTileEntity instanceof IGregTechTileEntity)) return 0;
- IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity;
- if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IsaMill && tTile.getFrontFacing() == aSide)
- return tTile.isActive() ? 1 : 2;
- return 0;
- }
+ private static int isIsaControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (!(tTileEntity instanceof IGregTechTileEntity)) return 0;
+ IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity;
+ if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IsaMill && tTile.getFrontFacing() == aSide)
+ return tTile.isActive() ? 1 : 2;
+ return 0;
+ }
- public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks5 ii) {
- final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- if (tMeta != 1) {
- return GregtechMetaCasingBlocks5.getStaticIcon(aSide, tMeta);
- }
- int tInvertLeftRightMod = aSide % 2 * 2 - 1;
- switch (aSide / 2) {
- case 0:
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (i == 0 && j == 0)
- continue;
- if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide) != 0) {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity();
- return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j);
- }
- }
- }
- break;
- case 1:
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (i == 0 && j == 0)
- continue;
- if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide) != 0) {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity();
- return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod);
- }
- }
- }
- break;
- case 2:
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (i == 0 && j == 0)
- continue;
- if (isIsaControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide) != 0) {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity();
- return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod);
- }
- }
- }
- break;
- }
- return TexturesGtBlock.TEXTURE_CASING_GRINDING_MILL.getIcon();
- }
-
- public boolean isCentrifugeRunning(IMetaTileEntity aTile) {
- if (aTile == null) {
- return false;
- }
- else {
- return aTile.getBaseMetaTileEntity().isActive();
- }
- }
+ public IIcon handleCasingsGT(
+ final IBlockAccess aWorld,
+ final int xCoord,
+ final int yCoord,
+ final int zCoord,
+ final int aSide,
+ final GregtechMetaCasingBlocks5 ii) {
+ final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if (tMeta != 1) {
+ return GregtechMetaCasingBlocks5.getStaticIcon(aSide, tMeta);
+ }
+ int tInvertLeftRightMod = aSide % 2 * 2 - 1;
+ switch (aSide / 2) {
+ case 0:
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if (i == 0 && j == 0) continue;
+ if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide) != 0) {
+ IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity)
+ aWorld.getTileEntity(xCoord + j, yCoord, zCoord + i))
+ .getMetaTileEntity();
+ return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j);
+ }
+ }
+ }
+ break;
+ case 1:
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if (i == 0 && j == 0) continue;
+ if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide) != 0) {
+ IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity)
+ aWorld.getTileEntity(xCoord + j, yCoord + i, zCoord))
+ .getMetaTileEntity();
+ return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod);
+ }
+ }
+ }
+ break;
+ case 2:
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if (i == 0 && j == 0) continue;
+ if (isIsaControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide) != 0) {
+ IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity)
+ aWorld.getTileEntity(xCoord, yCoord + i, zCoord + j))
+ .getMetaTileEntity();
+ return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod);
+ }
+ }
+ }
+ break;
+ }
+ return TexturesGtBlock.TEXTURE_CASING_GRINDING_MILL.getIcon();
+ }
- public IIcon getIconByIndex(IMetaTileEntity aMetaTileEntity, int aIndex) {
- if (isCentrifugeRunning(aMetaTileEntity)) {
- return this.GRINDER_ACTIVE[aIndex].getIcon();
- }
-
- return this.GRINDER[aIndex].getIcon();
- }
-
+ public boolean isCentrifugeRunning(IMetaTileEntity aTile) {
+ if (aTile == null) {
+ return false;
+ } else {
+ return aTile.getBaseMetaTileEntity().isActive();
+ }
+ }
+
+ public IIcon getIconByIndex(IMetaTileEntity aMetaTileEntity, int aIndex) {
+ if (isCentrifugeRunning(aMetaTileEntity)) {
+ return this.GRINDER_ACTIVE[aIndex].getIcon();
+ }
+
+ return this.GRINDER[aIndex].getIcon();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
index 27c33e53b6..a0e7fd0875 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
@@ -1,773 +1,831 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
-import net.minecraft.client.renderer.texture.TextureMap;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_RenderedTexture;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
public class TexturesGtBlock {
- private static AutoMap<Runnable> mCustomiconMap = new AutoMap<Runnable>();
-
- static {
-
- }
-
- //public static ITexture[] CASING_BLOCKS_GTPP = new ITexture[256];
-
- /*
- * Handles Custom Textures.
- */
-
- public static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon;
- protected String mIconName;
- protected String mModID;
-
- public CustomIcon(final String aIconName) {
- this(CORE.MODID, aIconName);
- }
-
- public CustomIcon(final String aModID, final String aIconName) {
- this.mIconName = aIconName;
- this.mModID = aModID;
- mCustomiconMap.put(this);
- Logger.WARNING("Constructing a Custom Texture. " + this.mIconName);
- GregTech_API.sGTBlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public void run() {
- this.mIcon = GregTech_API.sBlockIcons.registerIcon(this.mModID + ":" + this.mIconName);
- Logger.WARNING("FIND ME _ Processing texture: "+this.getTextureFile().getResourcePath());
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
- }
-
-
- public static class VanillaIcon implements IIconContainer, Runnable {
- protected IIcon mIcon;
- protected String mIconName;
-
- public VanillaIcon(final String aIconName) {
- this.mIconName = aIconName;
- mCustomiconMap.put(this);
- Logger.WARNING("Constructing a Custom Texture. " + this.mIconName);
- GregTech_API.sGTBlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public void run() {
- this.mIcon = GregTech_API.sBlockIcons.registerIcon("minecraft" + ":" + this.mIconName);
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
- }
-
- public static GT_RenderedTexture getTextureFromIcon(CustomIcon aIcon, short[] aRGB) {
- return new GT_RenderedTexture(aIcon, aRGB);
- }
-
- /*
- * Add Some Custom Textures below.
- * I am not sure whether or not I need to declare them as such, but better to be safe than sorry.
- * Right?
- */
-
- //Vanilla Textures
- public static final VanillaIcon VanillaIcon_OakPlanks = new VanillaIcon("planks_oak");
-
-
-
- //PlaceHolder Texture
- private static final CustomIcon Internal_PlaceHolder = new CustomIcon("TileEntities/_PlaceHolder");
- public static final CustomIcon _PlaceHolder = Internal_PlaceHolder;
-
- //Energy overlays
- public static final CustomIcon OVERLAY_ENERGY_OUT_BUFFER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_BUFFER");
- public static final CustomIcon OVERLAY_ENERGY_OUT_MULTI_BUFFER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_MULTI_BUFFER");
-
- //Wooden Shelf and Compartment Overlays
- public static final CustomIcon OVERLAY_WOODEN_SHELF_FRONT = new CustomIcon("TileEntities/Compartment/wood_shelf");
- public static final CustomIcon OVERLAY_WOODEN_SHELF_CANS_FRONT = new CustomIcon("TileEntities/Compartment/wood_shelf_cans");
- public static final CustomIcon OVERLAY_WOODEN_SHELF_PAPER_FRONT = new CustomIcon("TileEntities/Compartment/wood_shelf_paper");
- public static final CustomIcon OVERLAY_CABINET_1 = new CustomIcon("TileEntities/Compartment/0");
- public static final CustomIcon OVERLAY_CABINET_2 = new CustomIcon("TileEntities/Compartment/1");
- public static final CustomIcon OVERLAY_CABINET_3 = new CustomIcon("TileEntities/Compartment/2");
- public static final CustomIcon OVERLAY_CABINET_4 = new CustomIcon("TileEntities/Compartment/3");
- public static final CustomIcon OVERLAY_CABINET_5 = new CustomIcon("TileEntities/Compartment/4");
- public static final CustomIcon OVERLAY_CABINET_6 = new CustomIcon("TileEntities/Compartment/5");
- public static final CustomIcon OVERLAY_CABINET_7 = new CustomIcon("TileEntities/Compartment/6");
- public static final CustomIcon OVERLAY_CABINET_8 = new CustomIcon("TileEntities/Compartment/7");
- public static final CustomIcon OVERLAY_CABINET_9 = new CustomIcon("TileEntities/Compartment/8");
- public static final CustomIcon OVERLAY_CABINET_10 = new CustomIcon("TileEntities/Compartment/9");
- public static final CustomIcon OVERLAY_CABINET_11 = new CustomIcon("TileEntities/Compartment/10");
- public static final CustomIcon OVERLAY_CABINET_12 = new CustomIcon("TileEntities/Compartment/11");
- public static final CustomIcon OVERLAY_CABINET_13 = new CustomIcon("TileEntities/Compartment/12");
- public static final CustomIcon OVERLAY_CABINET_14 = new CustomIcon("TileEntities/Compartment/13");
- public static final CustomIcon OVERLAY_CABINET_15 = new CustomIcon("TileEntities/Compartment/14");
- public static final CustomIcon OVERLAY_CABINET_16 = new CustomIcon("TileEntities/Compartment/15");
- public static final CustomIcon OVERLAY_COMPARTMENT_1 = new CustomIcon("TileEntities/Compartment/16");
- public static final CustomIcon OVERLAY_COMPARTMENT_2 = new CustomIcon("TileEntities/Compartment/17");
- public static final CustomIcon OVERLAY_COMPARTMENT_3 = new CustomIcon("TileEntities/Compartment/18");
- public static final CustomIcon OVERLAY_COMPARTMENT_4 = new CustomIcon("TileEntities/Compartment/19");
- public static final CustomIcon OVERLAY_COMPARTMENT_5 = new CustomIcon("TileEntities/Compartment/20");
- public static final CustomIcon OVERLAY_COMPARTMENT_6 = new CustomIcon("TileEntities/Compartment/21");
- public static final CustomIcon OVERLAY_COMPARTMENT_7 = new CustomIcon("TileEntities/Compartment/22");
- public static final CustomIcon OVERLAY_COMPARTMENT_8 = new CustomIcon("TileEntities/Compartment/23");
- public static final CustomIcon OVERLAY_COMPARTMENT_9 = new CustomIcon("TileEntities/Compartment/24");
- public static final CustomIcon OVERLAY_COMPARTMENT_10 = new CustomIcon("TileEntities/Compartment/25");
- public static final CustomIcon OVERLAY_COMPARTMENT_11 = new CustomIcon("TileEntities/Compartment/26");
- public static final CustomIcon OVERLAY_COMPARTMENT_12 = new CustomIcon("TileEntities/Compartment/27");
- public static final CustomIcon OVERLAY_COMPARTMENT_13 = new CustomIcon("TileEntities/Compartment/28");
- public static final CustomIcon OVERLAY_COMPARTMENT_14 = new CustomIcon("TileEntities/Compartment/29");
- public static final CustomIcon OVERLAY_COMPARTMENT_15 = new CustomIcon("TileEntities/Compartment/30");
- public static final CustomIcon OVERLAY_COMPARTMENT_16 = new CustomIcon("TileEntities/Compartment/31");
-
- //Controllers
- private static final CustomIcon Internal_Casing_Fusion_Simple_Front = new CustomIcon("TileEntities/MACHINE_CASING_FUSION_FRONT");
- public static final CustomIcon Casing_Fusion_Simple_Front = Internal_Casing_Fusion_Simple_Front;
- private static final CustomIcon Internal_Casing_Fusion_Simple_Front_Active = new CustomIcon("TileEntities/MACHINE_CASING_FUSION_FRONT_ACTIVE");
- public static final CustomIcon Casing_Fusion_Simple_Front_Active = Internal_Casing_Fusion_Simple_Front_Active;
-
- //Machine Casings
- //Simple
- private static final CustomIcon Internal_Casing_Machine_Simple_Top = new CustomIcon("TileEntities/machine_top");
- public static final CustomIcon Casing_Machine_Simple_Top = Internal_Casing_Machine_Simple_Top;
- private static final CustomIcon Internal_Casing_Machine_Simple_Bottom = new CustomIcon("TileEntities/machine_bottom");
- public static final CustomIcon Casing_Machine_Simple_Bottom = Internal_Casing_Machine_Simple_Bottom;
- //Advanced and Ultra
- private static final CustomIcon Internal_Casing_Machine_Advanced = new CustomIcon("TileEntities/high_adv_machine");
- public static final CustomIcon Casing_Machine_Advanced = Internal_Casing_Machine_Advanced;
- private static final CustomIcon Internal_Casing_Machine_Ultra = new CustomIcon("TileEntities/adv_machine_lesu");
- public static final CustomIcon Casing_Machine_Ultra = Internal_Casing_Machine_Ultra;
- //Dimensional - Non Overlay
- private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon("TileEntities/adv_machine_dimensional");
- public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional;
- private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = new CustomIcon("TileEntities/high_adv_machine_dimensional");
- public static final CustomIcon Casing_Machine_Dimensional_Adv = Internal_Casing_Machine_Dimensional_Adv;
-
- //Material Casings
- private static final CustomIcon Internal_Casing_Tantalloy61 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TANTALLOY61");
- public static final CustomIcon Casing_Material_Tantalloy61 = Internal_Casing_Tantalloy61;
- private static final CustomIcon Internal_Casing_MaragingSteel = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL");
- public static final CustomIcon Casing_Material_MaragingSteel = Internal_Casing_MaragingSteel;
- private static final CustomIcon Internal_Casing_Stellite = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_STELLITE");
- public static final CustomIcon Casing_Material_Stellite = Internal_Casing_Stellite;
- private static final CustomIcon Internal_Casing_Talonite = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TALONITE");
- public static final CustomIcon Casing_Material_Talonite = Internal_Casing_Talonite;
- private static final CustomIcon Internal_Casing_Tumbaga = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TUMBAGA");
- public static final CustomIcon Casing_Material_Tumbaga = Internal_Casing_Tumbaga;
- private static final CustomIcon Internal_Casing_Zeron100 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZERON100");
- public static final CustomIcon Casing_Material_Zeron100 = Internal_Casing_Zeron100;
- private static final CustomIcon Internal_Casing_Potin = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_POTIN");
- public static final CustomIcon Casing_Material_Potin = Internal_Casing_Potin;
-
- private static final CustomIcon Internal_Casing_Grisium = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_GRISIUM");
- public static final CustomIcon Casing_Material_Grisium = Internal_Casing_Grisium;
- private static final CustomIcon Internal_Casing_RedSteel = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_RED_STEEL");
- public static final CustomIcon Casing_Material_RedSteel = Internal_Casing_RedSteel;
- private static final CustomIcon Internal_Casing_Incoloy020 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_020");
- public static final CustomIcon Casing_Material_Incoloy020 = Internal_Casing_Incoloy020;
- private static final CustomIcon Internal_Casing_IncoloyDS = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_DS");
- public static final CustomIcon Casing_Material_IncoloyDS = Internal_Casing_IncoloyDS;
- private static final CustomIcon Internal_Casing_IncoloyMA956 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_MA956");
- public static final CustomIcon Casing_Material_IncoloyMA956 = Internal_Casing_IncoloyMA956;
- private static final CustomIcon Internal_Casing_ZirconiumCarbide = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE");
- public static final CustomIcon Casing_Material_ZirconiumCarbide = Internal_Casing_ZirconiumCarbide;
-
-
- private static final CustomIcon Internal_Casing_HastelloyX = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_X");
- public static final CustomIcon Casing_Material_HastelloyX = Internal_Casing_HastelloyX;
- private static final CustomIcon Internal_Casing_HastelloyN = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_N");
- public static final CustomIcon Casing_Material_HastelloyN = Internal_Casing_HastelloyN;
- private static final CustomIcon Internal_Casing_Fluid_IncoloyDS = new CustomIcon("TileEntities/MACHINE_CASING_FLUID_INCOLOY_DS");
- public static final CustomIcon Casing_Material_Fluid_IncoloyDS = Internal_Casing_Fluid_IncoloyDS;
-
- private static final CustomIcon Internal_Casing_Laurenium = new CustomIcon("TileEntities/MACHINE_CASING_LAURENIUM");
- public static final CustomIcon Casing_Material_Laurenium = Internal_Casing_Laurenium;
-
- //Trinium Alloys
- public static final CustomIcon Casing_Trinium_Titanium = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_TITANIUM");
- public static final CustomIcon Casing_Trinium_Naquadah = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH");
- public static final CustomIcon Casing_Trinium_Naquadah_Vent = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_VENT");
- public static final CustomIcon Casing_Trinium_Naquadah_Carbon = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_CARBON");
-
- //Material Machine/Firebox Casings
- private static final CustomIcon Internal_Casing_Staballoy_Firebox = new CustomIcon("TileEntities/MACHINE_CASING_FIREBOX_STABALLOY");
- public static final CustomIcon Casing_Staballoy_Firebox = Internal_Casing_Staballoy_Firebox;
-
- //Misc Casings
- private static final CustomIcon Internal_Casing_Machine_Redstone_Off = new CustomIcon("TileEntities/cover_redstone_conductor");
- public static final CustomIcon Casing_Machine_Redstone_Off = Internal_Casing_Machine_Redstone_Off;
- private static final CustomIcon Internal_Casing_Machine_Redstone_On = new CustomIcon("TileEntities/cover_redstone_emitter");
- public static final CustomIcon Casing_Machine_Redstone_On = Internal_Casing_Machine_Redstone_On;
-
- //Redox Cells
- public static final CustomIcon Casing_Redox_1 = new CustomIcon("redox/redox1");
- public static final CustomIcon Casing_Redox_2 = new CustomIcon("redox/redox2");
- public static final CustomIcon Casing_Redox_3 = new CustomIcon("redox/redox3");
- public static final CustomIcon Casing_Redox_4 = new CustomIcon("redox/redox4");
- public static final CustomIcon Casing_Redox_5 = new CustomIcon("redox/redox5");
- public static final CustomIcon Casing_Redox_6 = new CustomIcon("redox/redox6");
- //public static final CustomIcon Casing_Redox_7 = new CustomIcon("redox/redox7");
- //public static final CustomIcon Casing_Redox_8 = new CustomIcon("redox/redox8");
-
- // Special Block 2
- public static final CustomIcon Casing_Resonance_1 = new CustomIcon("special/block_1");
- public static final CustomIcon Casing_Resonance_2 = new CustomIcon("special/block_2");
- public static final CustomIcon Casing_Resonance_3 = new CustomIcon("special/block_3");
- public static final CustomIcon Casing_Resonance_4 = new CustomIcon("special/block_4");
- public static final CustomIcon Casing_Modulator_1 = new CustomIcon("special/block_5");
- public static final CustomIcon Casing_Modulator_2 = new CustomIcon("special/block_6");
- public static final CustomIcon Casing_Modulator_3 = new CustomIcon("special/block_7");
- public static final CustomIcon Casing_Modulator_4 = new CustomIcon("special/block_8");
-
- //Centrifuge Casing
- private static final CustomIcon Internal_Casing_Centrifuge = new CustomIcon("TileEntities/MACHINE_CASING_CENTRIFUGE");
- public static final CustomIcon Casing_Material_Centrifuge = Internal_Casing_Centrifuge;
-
- //MACHINE_CASING_FARM_MANAGER_STRUCTURAL
- //Farm Manager Casings
- private static final CustomIcon Internal_Casing_Machine_Farm_Manager = new CustomIcon("TileEntities/MACHINE_CASING_FARM_MANAGER_STRUCTURAL");
- public static final CustomIcon Casing_Machine_Farm_Manager = Internal_Casing_Machine_Farm_Manager;
- //Acacia_Log
- private static final CustomIcon Internal_Casing_Machine_Acacia_Log = new CustomIcon("TileEntities/log_acacia_top");
- public static final CustomIcon Casing_Machine_Acacia_Log = Internal_Casing_Machine_Acacia_Log;
- //Podzol Top
- private static final CustomIcon Internal_Casing_Machine_Podzol = new CustomIcon("TileEntities/dirt_podzol_top");
- public static final CustomIcon Casing_Machine_Podzol = Internal_Casing_Machine_Podzol;
-
- //Structural Blocks
- private static final CustomIcon Internal_Casing_Machine_Metal_Grate_A = new CustomIcon("chrono/MetalGrate");
- public static final CustomIcon Casing_Machine_Metal_Grate_A = Internal_Casing_Machine_Metal_Grate_A;
- private static final CustomIcon Internal_Casing_Machine_Metal_Grate_A_Solid = new CustomIcon("chrono/MetalGrateA_Solid");
- public static final CustomIcon Casing_Machine_Metal_Grate_A_Solid = Internal_Casing_Machine_Metal_Grate_A_Solid;
- private static final CustomIcon Internal_Casing_Machine_Metal_Grate_B = new CustomIcon("chrono/MetalGrate2");
- public static final CustomIcon Casing_Machine_Metal_Grate_B = Internal_Casing_Machine_Metal_Grate_B;
- private static final CustomIcon Internal_Casing_Machine_Metal_Panel_A = new CustomIcon("chrono/MetalPanel");
- public static final CustomIcon Casing_Machine_Metal_Panel_A = Internal_Casing_Machine_Metal_Panel_A;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_A = new CustomIcon("chrono/MetalSheet");
- public static final CustomIcon Casing_Machine_Metal_Sheet_A = Internal_Casing_Machine_Metal_Sheet_A;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_B = new CustomIcon("chrono/MetalSheet2");
- public static final CustomIcon Casing_Machine_Metal_Sheet_B = Internal_Casing_Machine_Metal_Sheet_B;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_C = new CustomIcon("chrono/MetalSheet3");
- public static final CustomIcon Casing_Machine_Metal_Sheet_C = Internal_Casing_Machine_Metal_Sheet_C;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_D = new CustomIcon("chrono/MetalSheet4");
- public static final CustomIcon Casing_Machine_Metal_Sheet_D = Internal_Casing_Machine_Metal_Sheet_D;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_E = new CustomIcon("chrono/MetalSheet5");
- public static final CustomIcon Casing_Machine_Metal_Sheet_E = Internal_Casing_Machine_Metal_Sheet_E;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_F = new CustomIcon("chrono/MetalSheet6");
- public static final CustomIcon Casing_Machine_Metal_Sheet_F = Internal_Casing_Machine_Metal_Sheet_F;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_G = new CustomIcon("chrono/MetalSheet7");
- public static final CustomIcon Casing_Machine_Metal_Sheet_G = Internal_Casing_Machine_Metal_Sheet_G;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_H = new CustomIcon("chrono/MetalSheet8");
- public static final CustomIcon Casing_Machine_Metal_Sheet_H = Internal_Casing_Machine_Metal_Sheet_H;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_I = new CustomIcon("chrono/MetalSheet9");
- public static final CustomIcon Casing_Machine_Metal_Sheet_I = Internal_Casing_Machine_Metal_Sheet_I;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_J = new CustomIcon("chrono/MetalSheet10");
- public static final CustomIcon Casing_Machine_Metal_Sheet_J = Internal_Casing_Machine_Metal_Sheet_J;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_K = new CustomIcon("chrono/MetalSheet11");
- public static final CustomIcon Casing_Machine_Metal_Sheet_K = Internal_Casing_Machine_Metal_Sheet_K;
- private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_L = new CustomIcon("chrono/MetalSheet12");
- public static final CustomIcon Casing_Machine_Metal_Sheet_L = Internal_Casing_Machine_Metal_Sheet_L;
- private static final CustomIcon Internal_Overlay_Machine_Cyber_A = new CustomIcon("chrono/CyberPanel");
- public static final CustomIcon Overlay_Machine_Cyber_A = Internal_Overlay_Machine_Cyber_A;
- private static final CustomIcon Internal_Overlay_Machine_Cyber_B = new CustomIcon("chrono/CyberPanel2");
- public static final CustomIcon Overlay_Machine_Cyber_B = Internal_Overlay_Machine_Cyber_B;
-
-
- public static final CustomIcon TEXTURE_CASING_AMAZON = new CustomIcon("TileEntities/CASING_AMAZON");
- public static final CustomIcon TEXTURE_CASING_ADVANCED_CRYOGENIC = new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC");
- public static final CustomIcon TEXTURE_CASING_ADVANCED_VOLCNUS = new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_VOLCANUS");
- public static final CustomIcon TEXTURE_CASING_ROCKETDYNE = new CustomIcon("TileEntities/MACHINE_CASING_ROCKETDYNE");
- public static final CustomIcon TEXTURE_CASING_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_GRINDING_FACTORY");
- public static final CustomIcon TEXTURE_CASING_FLOTATION = new CustomIcon("TileEntities/MACHINE_CASING_FLOTATION");
-
- // Custom Pipes
- public static final CustomIcon TEXTURE_PIPE_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_PIPE_T1");
- public static final CustomIcon TEXTURE_PIPE_GENERIC = new CustomIcon("iconsets/MACHINE_CASING_PIPE_GENERIC");
-
- public static final CustomIcon TEXTURE_PIPE_T1_BABBIT_ALLOY = new CustomIcon("iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY");
- public static final CustomIcon TEXTURE_PIPE_T2_INCONEL_690 = new CustomIcon("iconsets/MACHINE_CASING_PIPE_INCONEL_690");
- public static final CustomIcon TEXTURE_PIPE_T3_STELLITE = new CustomIcon("iconsets/MACHINE_CASING_PIPE_STELLITE");
- public static final CustomIcon TEXTURE_PIPE_T4_NITINOL_60 = new CustomIcon("iconsets/MACHINE_CASING_PIPE_NITINOL_60");
- public static final CustomIcon TEXTURE_PIPE_T5_LAFIUM = new CustomIcon("iconsets/MACHINE_CASING_PIPE_LAFIUM");
- public static final CustomIcon TEXTURE_PIPE_T6_CINOBITE = new CustomIcon("iconsets/MACHINE_CASING_PIPE_CINOBITE");
- public static final CustomIcon TEXTURE_PIPE_T7_TITANSTEEL = new CustomIcon("iconsets/MACHINE_CASING_PIPE_TITANSTEEL");
- public static final CustomIcon TEXTURE_PIPE_T8_ABYSSAL = new CustomIcon("iconsets/MACHINE_CASING_PIPE_ABYSSAL");
-
- // Custom Gearboxes
- public static final CustomIcon TEXTURE_GEARBOX_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_GEARBOX_T1");
- public static final CustomIcon TEXTURE_GEARBOX_GENERIC = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_GENERIC");
-
- public static final CustomIcon TEXTURE_GEARBOX_T1_EGLIN_STEEL = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_EGLIN_STEEL");
- public static final CustomIcon TEXTURE_GEARBOX_T2_INCONEL_792 = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_INCONEL_792");
- public static final CustomIcon TEXTURE_GEARBOX_T3_INCOLOY_MA956 = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_INCOLOY_MA956");
- public static final CustomIcon TEXTURE_GEARBOX_T4_NITINOL_60 = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_NITINOL_60");
- public static final CustomIcon TEXTURE_GEARBOX_T5_ZERON_100 = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_ZERON_100");
- public static final CustomIcon TEXTURE_GEARBOX_T6_PIKYONIUM = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM");
- public static final CustomIcon TEXTURE_GEARBOX_T7_TITANSTEEL = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL");
- public static final CustomIcon TEXTURE_GEARBOX_T8_ABYSSAL = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_ABYSSAL");
-
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II = new CustomIcon("iconsets/MACHINE_CASING_FUSION_3");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_INNER = new CustomIcon("iconsets/MACHINE_CASING_FUSION_COIL_II");
- public static final CustomIcon TEXTURE_CASING_FUSION_CASING_ULTRA = new CustomIcon("iconsets/MACHINE_CASING_FUSION_GLASS_ULTRA");
- //
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_1 = new CustomIcon("iconsets/FUSIONIII_1");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_2 = new CustomIcon("iconsets/FUSIONIII_2");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_3 = new CustomIcon("iconsets/FUSIONIII_3");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_4 = new CustomIcon("iconsets/FUSIONIII_4");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_5 = new CustomIcon("iconsets/FUSIONIII_5");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_6 = new CustomIcon("iconsets/FUSIONIII_6");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_7 = new CustomIcon("iconsets/FUSIONIII_7");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_8 = new CustomIcon("iconsets/FUSIONIII_8");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_9 = new CustomIcon("iconsets/FUSIONIII_9");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_10 = new CustomIcon("iconsets/FUSIONIII_10");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_11 = new CustomIcon("iconsets/FUSIONIII_11");
- public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_12 = new CustomIcon("iconsets/FUSIONIII_12");
-
- //Overlays
- //Fan Textures
- private static final CustomIcon Internal_Overlay_Machine_Vent = new CustomIcon("TileEntities/machine_top_vent_rotating");
- public static final CustomIcon Overlay_Machine_Vent = Internal_Overlay_Machine_Vent;
- private static final CustomIcon Internal_Overlay_Machine_Vent_Fast = new CustomIcon("TileEntities/machine_top_vent_rotating_fast");
- public static final CustomIcon Overlay_Machine_Vent_Fast = Internal_Overlay_Machine_Vent_Fast;
- private static final CustomIcon Internal_Overlay_Machine_Vent_Adv = new CustomIcon("TileEntities/adv_machine_vent_rotating");
- public static final CustomIcon Overlay_Machine_Vent_Adv = Internal_Overlay_Machine_Vent_Adv;
- private static final CustomIcon Internal_Overlay_Machine_Turbine_Active = new CustomIcon("TileEntities/STEAM_TURBINE_SIDE_ACTIVE");
- public static final CustomIcon Overlay_Machine_Turbine_Active = Internal_Overlay_Machine_Turbine_Active;
- //Grate Texture
- public static final CustomIcon OVERLAY_GRATE_A = new CustomIcon("metro/OVERLAY_GRATE_A");
- //Speaker Texture
- private static final CustomIcon Internal_Overlay_Machine_Sound = new CustomIcon("TileEntities/audio_out");
- public static final CustomIcon Overlay_Machine_Sound = Internal_Overlay_Machine_Sound;
- private static final CustomIcon Internal_Overlay_Machine_Sound_Active = new CustomIcon("TileEntities/audio_out_active");
- public static final CustomIcon Overlay_Machine_Sound_Active = Internal_Overlay_Machine_Sound_Active;
- //Diesel Engines
- private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical = new CustomIcon("TileEntities/machine_top_dieselmotor");
- public static final CustomIcon Overlay_Machine_Diesel_Vertical = Internal_Overlay_Machine_Diesel_Vertical;
- private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal = new CustomIcon("TileEntities/machine_top_dieselmotor2");
- public static final CustomIcon Overlay_Machine_Diesel_Horizontal = Internal_Overlay_Machine_Diesel_Horizontal;
- private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical_Active = new CustomIcon("TileEntities/machine_top_dieselmotor_active");
- public static final CustomIcon Overlay_Machine_Diesel_Vertical_Active = Internal_Overlay_Machine_Diesel_Vertical_Active;
- private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal_Active = new CustomIcon("TileEntities/machine_top_dieselmotor2_active");
- public static final CustomIcon Overlay_Machine_Diesel_Horizontal_Active = Internal_Overlay_Machine_Diesel_Horizontal_Active;
- //Computer Screens
- private static final CustomIcon Internal_Casing_Machine_Screen_1 = new CustomIcon("TileEntities/adv_machine_screen_random1");
- public static final CustomIcon Casing_Machine_Screen_1 = Internal_Casing_Machine_Screen_1;
- private static final CustomIcon Internal_Casing_Machine_Screen_2 = new CustomIcon("TileEntities/adv_machine_screen_random2");
- public static final CustomIcon Casing_Machine_Screen_2 = Internal_Casing_Machine_Screen_2;
- private static final CustomIcon Internal_Casing_Machine_Screen_3 = new CustomIcon("TileEntities/adv_machine_screen_random3");
- public static final CustomIcon Casing_Machine_Screen_3 = Internal_Casing_Machine_Screen_3;
- private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = new CustomIcon("TileEntities/adv_machine_screen_frequency");
- public static final CustomIcon Casing_Machine_Screen_Frequency = Internal_Casing_Machine_Screen_Frequency;
- private static final CustomIcon Internal_Overlay_Machine_Screen_Logo = new CustomIcon("TileEntities/adv_machine_screen_logo");
- public static final CustomIcon Overlay_Machine_Screen_Logo = Internal_Overlay_Machine_Screen_Logo;
- private static final CustomIcon Internal_Overlay_Machine_Cyber_Interface = new CustomIcon("chrono/Overlay_Cyber");
- public static final CustomIcon Overlay_Machine_Cyber_Interface = Internal_Overlay_Machine_Cyber_Interface;
-
- //Machine Controller Overlays
- private static final CustomIcon Internal_Overlay_Machine_Controller_Default = new CustomIcon("iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED");
- public static final CustomIcon Overlay_Machine_Controller_Default = Internal_Overlay_Machine_Controller_Default;
- private static final CustomIcon Internal_Overlay_Machine_Controller_Default_Active = new CustomIcon("iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED_ACTIVE");
- public static final CustomIcon Overlay_Machine_Controller_Default_Active = Internal_Overlay_Machine_Controller_Default_Active;
-
- private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced = new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED");
- public static final CustomIcon Overlay_Machine_Controller_Advanced = Internal_Overlay_Machine_Controller_Advanced;
- private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced_Active = new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE");
- public static final CustomIcon Overlay_Machine_Controller_Advanced_Active = Internal_Overlay_Machine_Controller_Advanced_Active;
-
- //Fluid Reactor Overlays
- public static final CustomIcon Overlay_FluidReactor_Front = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT");
- public static final CustomIcon Overlay_FluidReactor_Side = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE");
- public static final CustomIcon Overlay_FluidReactor_Top = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP");
- public static final CustomIcon Overlay_FluidReactor_Front_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE");
- public static final CustomIcon Overlay_FluidReactor_Side_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE");
- public static final CustomIcon Overlay_FluidReactor_Top_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE");
-
- //Crafting Overlays
- public static final CustomIcon Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting");
- public static final CustomIcon Overlay_Crafting_Steel = new CustomIcon("TileEntities/cover_crafting");
-
- public static final CustomIcon Casing_Workbench_Crafting_Overlay = new CustomIcon("TileEntities/gt4/bronze_top_crafting");
- public static final CustomIcon Casing_Workbench_Top = new CustomIcon("TileEntities/gt4/bronze_top");
- public static final CustomIcon Casing_Workbench_Side = new CustomIcon("TileEntities/gt4/bronze_side");
- public static final CustomIcon Casing_Workbench_Bottom = new CustomIcon("TileEntities/gt4/bronze_bottom");
- public static final CustomIcon Casing_Adv_Workbench_Crafting_Overlay = new CustomIcon("TileEntities/gt4/machine_top_crafting");
- public static final CustomIcon Casing_Adv_Workbench_Top = new CustomIcon("TileEntities/gt4/machine_top");
- public static final CustomIcon Casing_Adv_Workbench_Side = new CustomIcon("TileEntities/gt4/machine_side");
- public static final CustomIcon Casing_Adv_Workbench_Bottom = new CustomIcon("TileEntities/gt4/machine_bottom");
-
-
- public static final CustomIcon Casing_Redstone_Top_Off = new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_off");
- public static final CustomIcon Casing_Redstone_Top_Main_Off = new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_main_off");
- public static final CustomIcon Casing_Redstone_Top_On = new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_on");
- public static final CustomIcon Casing_Redstone_Top_Main_On = new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_main_on");
-
- public static final CustomIcon Casing_Redstone_Side_Off = new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_off");
- public static final CustomIcon Casing_Redstone_Side_Main_Off = new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_main_off");
- public static final CustomIcon Casing_Redstone_Side_On = new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_on");
- public static final CustomIcon Casing_Redstone_Side_Main_On = new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_main_on");
-
- public static final CustomIcon Casing_Redstone_Bottom_Off = new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_off");
- public static final CustomIcon Casing_Redstone_Bottom_Main_Off = new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_main_off");
- public static final CustomIcon Casing_Redstone_Bottom_On = new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_on");
- public static final CustomIcon Casing_Redstone_Bottom_Main_On = new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_main_on");
-
-
- public static final CustomIcon Casing_Electric_Auto_Workbench_Side = new CustomIcon("TileEntities/gt4/OVERLAY_SIDE_CABINET");
- public static final CustomIcon Casing_Computer_Cube = new CustomIcon("TileEntities/gt4/computer");
-
- public static final CustomIcon Casing_CropHarvester_Cutter = new CustomIcon("TileEntities/gt4/OVERLAY_CROP");
- public static final CustomIcon Casing_CropHarvester_Boxes = new CustomIcon("TileEntities/gt4/OVERLAY_BOXES");
-
- public static final CustomIcon Casing_InventoryManagaer_Cyan = new CustomIcon("TileEntities/gt4/OVERLAY_CYAN");
- public static final CustomIcon Casing_InventoryManagaer_Green = new CustomIcon("TileEntities/gt4/OVERLAY_GREEN");
- public static final CustomIcon Casing_InventoryManagaer_Purple = new CustomIcon("TileEntities/gt4/OVERLAY_PURPLE");
- public static final CustomIcon Casing_InventoryManagaer_Red = new CustomIcon("TileEntities/gt4/OVERLAY_RED");
- public static final CustomIcon Casing_InventoryManagaer_Yellow = new CustomIcon("TileEntities/gt4/OVERLAY_YELLOW");
- public static final CustomIcon Casing_InventoryManagaer_Blue = new CustomIcon("TileEntities/gt4/OVERLAY_BLUE");
-
- public static final CustomIcon Casing_InventoryManagaer_Cyan_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_CYAN_REDSTONE");
- public static final CustomIcon Casing_InventoryManagaer_Green_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_GREEN_REDSTONE");
- public static final CustomIcon Casing_InventoryManagaer_Purple_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_PURPLE_REDSTONE");
- public static final CustomIcon Casing_InventoryManagaer_Red_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_RED_REDSTONE");
- public static final CustomIcon Casing_InventoryManagaer_Yellow_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_YELLOW_REDSTONE");
- public static final CustomIcon Casing_InventoryManagaer_Blue_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_BLUE_REDSTONE");
-
- private static final CustomIcon Casing_Test_1 = new CustomIcon("number/1");
- private static final CustomIcon Casing_Test_2 = new CustomIcon("number/2");
- private static final CustomIcon Casing_Test_3 = new CustomIcon("number/3");
- private static final CustomIcon Casing_Test_4 = new CustomIcon("number/4");
- private static final CustomIcon Casing_Test_5 = new CustomIcon("number/5");
- private static final CustomIcon Casing_Test_6 = new CustomIcon("number/6");
- private static final CustomIcon Casing_Test_7 = new CustomIcon("number/7");
- private static final CustomIcon Casing_Test_8 = new CustomIcon("number/8");
- private static final CustomIcon Casing_Test_9 = new CustomIcon("number/9");
- private static final CustomIcon Casing_Test_10 = new CustomIcon("number/10");
- private static final CustomIcon Casing_Test_11 = new CustomIcon("number/11");
- private static final CustomIcon Casing_Test_12 = new CustomIcon("number/12");
- private static final CustomIcon Casing_Test_13 = new CustomIcon("number/13");
- private static final CustomIcon Casing_Test_14 = new CustomIcon("number/14");
- private static final CustomIcon Casing_Test_15 = new CustomIcon("number/15");
- private static final CustomIcon Casing_Test_16 = new CustomIcon("number/16");
-
- public static final CustomIcon[] TEST_NUMBER = new CustomIcon[] {
- Casing_Test_1, Casing_Test_2, Casing_Test_3, Casing_Test_4,
- Casing_Test_5, Casing_Test_6, Casing_Test_7, Casing_Test_8,
- Casing_Test_9, Casing_Test_10, Casing_Test_11, Casing_Test_12,
- Casing_Test_13, Casing_Test_14, Casing_Test_15, Casing_Test_16
-
- };
-
- //Covers
- private static final CustomIcon Internal_Overlay_Overflow_Valve = new CustomIcon("iconsets/OVERLAY_OVERFLOW_VALVE");
- public static final CustomIcon Overlay_Overflow_Valve = Internal_Overlay_Overflow_Valve;
-
-
- //Hatch Overlays
- //Charger Texture
- private static final CustomIcon Internal_Overlay_Hatch_Charger = new CustomIcon("TileEntities/cover_charger");
- public static final CustomIcon Overlay_Hatch_Charger = Internal_Overlay_Hatch_Charger;
- //Discharger Texture
- private static final CustomIcon Internal_Overlay_Hatch_Discharger = new CustomIcon("TileEntities/cover_discharge");
- public static final CustomIcon Overlay_Hatch_Discharger = Internal_Overlay_Hatch_Discharger;
- //Advanced Muffler
- private static final CustomIcon Internal_Overlay_Hatch_Muffler_Adv = new CustomIcon("iconsets/OVERLAY_MUFFLER_ADV");
- public static final CustomIcon Overlay_Hatch_Muffler_Adv = Internal_Overlay_Hatch_Muffler_Adv;
- //Control Core Bus
- private static final CustomIcon Internal_Overlay_Hatch_Control_Core = new CustomIcon("iconsets/OVERLAY_CONTROL_CORE_BUS");
- public static final CustomIcon Overlay_Hatch_Control_Core = Internal_Overlay_Hatch_Control_Core;
- // Milling Ball Bus
- private static final CustomIcon Internal_Overlay_Bus_Milling_Balls = new CustomIcon("iconsets/OVERLAY_MILLING_BALL_BUS");
- public static final CustomIcon Overlay_Bus_Milling_Balls = Internal_Overlay_Bus_Milling_Balls;
- // Catalyst Bus
- private static final CustomIcon Internal_Overlay_Bus_Catalyst = new CustomIcon("iconsets/OVERLAY_CATALYSTS");
- public static final CustomIcon Overlay_Bus_Catalyst = Internal_Overlay_Bus_Catalyst;
-
-
- public static final CustomIcon Overlay_Cobble = new CustomIcon("iconsets/OVERLAY_COBBLE");
- public static final CustomIcon Overlay_Connector = new CustomIcon("iconsets/OVERLAY_CONNECTOR");
- public static final CustomIcon Overlay_Fire = new CustomIcon("iconsets/OVERLAY_FIRE");
- public static final CustomIcon Overlay_Grinder = new CustomIcon("iconsets/OVERLAY_GRINDER");
- public static final CustomIcon Overlay_GT_Logo = new CustomIcon("iconsets/OVERLAY_GT");
- public static final CustomIcon Overlay_Ice = new CustomIcon("iconsets/OVERLAY_ICE");
- public static final CustomIcon Overlay_Implosion = new CustomIcon("iconsets/OVERLAY_IMPLOSION");
- // Lapo Orb Hatch
- public static final CustomIcon Overlay_Hatch_Lapo_Orb = new CustomIcon("iconsets/OVERLAY_LAPO");
- // Data Orb Hatch
- public static final CustomIcon Overlay_Hatch_Data_Orb = new CustomIcon("iconsets/OVERLAY_DATA_ORB");
-
- // RTG Hatch
- private static final CustomIcon Internal_Overlay_Hatch_RTG_Off = new CustomIcon("iconsets/OVERLAY_ENERGY_RTG_OFF");
- public static final CustomIcon Overlay_Hatch_RTG_Off = Internal_Overlay_Hatch_RTG_Off;
- private static final CustomIcon Internal_Overlay_Hatch_RTG_On = new CustomIcon("iconsets/OVERLAY_ENERGY_RTG_ON");
- public static final CustomIcon Overlay_Hatch_RTG_On = Internal_Overlay_Hatch_RTG_On;
-
- //Dimensional
- private static final CustomIcon Internal_Overlay_Machine_Dimensional_Blue = new CustomIcon("TileEntities/adv_machine_dimensional_cover_blue");
- public static final CustomIcon Overlay_Machine_Dimensional_Blue = Internal_Overlay_Machine_Dimensional_Blue;
- private static final CustomIcon Internal_Overlay_Machine_Dimensional_Orange = new CustomIcon("TileEntities/adv_machine_dimensional_cover_orange");
- public static final CustomIcon Overlay_Machine_Dimensional_Orange = Internal_Overlay_Machine_Dimensional_Orange;
- //Icons
- private static final CustomIcon Internal_Overlay_MatterFab = new CustomIcon("TileEntities/adv_machine_matterfab");
- public static final CustomIcon Overlay_MatterFab = Internal_Overlay_MatterFab;
- private static final CustomIcon Internal_Overlay_MatterFab_Active = new CustomIcon("TileEntities/adv_machine_matterfab_active");
- public static final CustomIcon Overlay_MatterFab_Active = Internal_Overlay_MatterFab_Active;
-
- private static final CustomIcon Internal_Overlay_MatterFab_Animated = new CustomIcon("TileEntities/adv_machine_matterfab_animated");
- public static final CustomIcon Overlay_MatterFab_Animated = Internal_Overlay_MatterFab_Animated;
- private static final CustomIcon Internal_Overlay_MatterFab_Active_Animated = new CustomIcon("TileEntities/adv_machine_matterfab_active_animated");
- public static final CustomIcon Overlay_MatterFab_Active_Animated = Internal_Overlay_MatterFab_Active_Animated;
-
- private static final CustomIcon Internal_Overlay_Oil = new CustomIcon("TileEntities/adv_machine_oil");
- public static final CustomIcon Overlay_Oil = Internal_Overlay_Oil;
- private static final CustomIcon Internal_Overlay_Water = new CustomIcon("TileEntities/adv_machine_water");
- public static final CustomIcon Overlay_Water = Internal_Overlay_Water;
- private static final CustomIcon Internal_Overlay_UU_Matter = new CustomIcon("TileEntities/adv_machine_uum");
- public static final CustomIcon Overlay_UU_Matter = Internal_Overlay_UU_Matter;
-
- // GT++ Tiered Hulls
- public static final CustomIcon TEXTURE_CASING_TIERED_ULV = new CustomIcon("iconsets/TieredHulls/CASING_ULV");
- public static final CustomIcon TEXTURE_CASING_TIERED_LV = new CustomIcon("iconsets/TieredHulls/CASING_LV");
- public static final CustomIcon TEXTURE_CASING_TIERED_MV = new CustomIcon("iconsets/TieredHulls/CASING_MV");
- public static final CustomIcon TEXTURE_CASING_TIERED_HV = new CustomIcon("iconsets/TieredHulls/CASING_HV");
- public static final CustomIcon TEXTURE_CASING_TIERED_EV = new CustomIcon("iconsets/TieredHulls/CASING_EV");
- public static final CustomIcon TEXTURE_CASING_TIERED_IV = new CustomIcon("iconsets/TieredHulls/CASING_IV");
- public static final CustomIcon TEXTURE_CASING_TIERED_LuV = new CustomIcon("iconsets/TieredHulls/CASING_LuV");
- public static final CustomIcon TEXTURE_CASING_TIERED_ZPM = new CustomIcon("iconsets/TieredHulls/CASING_ZPM");
- public static final CustomIcon TEXTURE_CASING_TIERED_UV = new CustomIcon("iconsets/TieredHulls/CASING_UV");
- public static final CustomIcon TEXTURE_CASING_TIERED_MAX = new CustomIcon("iconsets/TieredHulls/CASING_MAX");
-
- //Metroid related
- public static final CustomIcon TEXTURE_METAL_PANEL_A = new CustomIcon("metro/TEXTURE_METAL_PANEL_A");
- public static final CustomIcon TEXTURE_METAL_PANEL_B = new CustomIcon("metro/TEXTURE_METAL_PANEL_B");
- public static final CustomIcon TEXTURE_METAL_PANEL_C = new CustomIcon("metro/TEXTURE_METAL_PANEL_C");
- public static final CustomIcon TEXTURE_METAL_PANEL_D = new CustomIcon("metro/TEXTURE_METAL_PANEL_D");
- public static final CustomIcon TEXTURE_METAL_PANEL_E = new CustomIcon("metro/TEXTURE_METAL_PANEL_E");
- public static final CustomIcon TEXTURE_METAL_PANEL_F = new CustomIcon("metro/TEXTURE_METAL_PANEL_F");
- public static final CustomIcon TEXTURE_METAL_PANEL_G = new CustomIcon("metro/TEXTURE_METAL_PANEL_G");
- public static final CustomIcon TEXTURE_METAL_PANEL_H = new CustomIcon("metro/TEXTURE_METAL_PANEL_H");
- public static final CustomIcon TEXTURE_METAL_PANEL_I = new CustomIcon("metro/TEXTURE_METAL_PANEL_I");
-
- public static final CustomIcon TEXTURE_MAGIC_PANEL_A = new CustomIcon("metro/TEXTURE_MAGIC_A");
- public static final CustomIcon TEXTURE_MAGIC_PANEL_B = new CustomIcon("metro/TEXTURE_MAGIC_B");
-
- public static final CustomIcon TEXTURE_ORGANIC_PANEL_A = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A");
- public static final CustomIcon TEXTURE_ORGANIC_PANEL_A_GLOWING = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A_GLOWING");
-
- public static final CustomIcon TEXTURE_STONE_BIRD_A = new CustomIcon("metro/TEXTURE_STONE_BIRD_A");
- public static final CustomIcon TEXTURE_STONE_BIRD_A_LEFT = new CustomIcon("metro/TEXTURE_STONE_BIRD_A_LEFT");
- public static final CustomIcon TEXTURE_STONE_BIRD_A_RIGHT = new CustomIcon("metro/TEXTURE_STONE_BIRD_A_RIGHT");
- public static final CustomIcon TEXTURE_STONE_RED_A = new CustomIcon("metro/TEXTURE_STONE_RED_A");
- public static final CustomIcon TEXTURE_STONE_RED_B = new CustomIcon("metro/TEXTURE_STONE_RED_B");
- public static final CustomIcon TEXTURE_STONE_BLUE_A = new CustomIcon("metro/TEXTURE_STONE_BLUE_A");
- public static final CustomIcon TEXTURE_STONE_GREEN_A = new CustomIcon("metro/TEXTURE_STONE_GREEN_A");
- public static final CustomIcon TEXTURE_STONE_TABLET_A = new CustomIcon("metro/TEXTURE_STONE_TABLET_A");
- public static final CustomIcon TEXTURE_STONE_TABLET_B = new CustomIcon("metro/TEXTURE_STONE_TABLET_B");
-
- public static final CustomIcon TEXTURE_TECH_A = new CustomIcon("metro/TEXTURE_TECH_A");
- public static final CustomIcon TEXTURE_TECH_B = new CustomIcon("metro/TEXTURE_TECH_B");
- public static final CustomIcon TEXTURE_TECH_C = new CustomIcon("metro/TEXTURE_TECH_C");
-
- public static final CustomIcon TEXTURE_TECH_PANEL_A = new CustomIcon("metro/TEXTURE_TECH_PANEL_A");
- public static final CustomIcon TEXTURE_TECH_PANEL_B = new CustomIcon("metro/TEXTURE_TECH_PANEL_B");
- public static final CustomIcon TEXTURE_TECH_PANEL_C = new CustomIcon("metro/TEXTURE_TECH_PANEL_C");
- public static final CustomIcon TEXTURE_TECH_PANEL_D = new CustomIcon("metro/TEXTURE_TECH_PANEL_D");
- public static final CustomIcon TEXTURE_TECH_PANEL_E = new CustomIcon("metro/TEXTURE_TECH_PANEL_E");
- public static final CustomIcon TEXTURE_TECH_PANEL_F = new CustomIcon("metro/TEXTURE_TECH_PANEL_F");
- public static final CustomIcon TEXTURE_TECH_PANEL_G = new CustomIcon("metro/TEXTURE_TECH_PANEL_G");
- public static final CustomIcon TEXTURE_TECH_PANEL_H = new CustomIcon("metro/TEXTURE_TECH_PANEL_H");
- public static final CustomIcon TEXTURE_TECH_PANEL_I = new CustomIcon("metro/TEXTURE_TECH_PANEL_I");
-
- public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE = new CustomIcon("TileEntities/DecayablesChest_bottom");
- public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT = new CustomIcon("TileEntities/DecayablesChest_top");
-
- // LFTR Single blocks
- public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT");
- public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE");
- public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE");
- public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE");
- public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP");
- public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE");
-
- public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT");
- public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE");
- public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE");
- public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE");
- public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP");
- public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE");
-
-
- //Overlay Arrays
- public static ITexture[] OVERLAYS_ENERGY_OUT_BUFFER = new ITexture[]{
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER,
- new short[]{240, 240, 245, 0})};
-
- public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI_BUFFER = new ITexture[]{
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER,
- new short[]{240, 240, 245, 0})};
-
- public static ITexture[] OVERLAYS_CABINET_FRONT = new ITexture[]{
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_1,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_2,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_3,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_4,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_5,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_6,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_7,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_8,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_9,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_10,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_11,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_12,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_13,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_14,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_15,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_16,
- new short[]{255, 255, 255, 0}),};
-
- public static ITexture[] OVERLAYS_COMPARTMENT_FRONT = new ITexture[]{
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_1,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_2,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_3,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_4,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_5,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_6,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_7,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_8,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_9,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_10,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_11,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_12,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_13,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_14,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_15,
- new short[]{255, 255, 255, 0}),
- new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_16,
- new short[]{255, 255, 255, 0}),};
-
- public static IIconContainer[] CONNECTED_FUSION_HULLS = new IIconContainer[]{
- TEXTURE_CASING_FUSION_COIL_II_1, TEXTURE_CASING_FUSION_COIL_II_2, TEXTURE_CASING_FUSION_COIL_II_3,
- TEXTURE_CASING_FUSION_COIL_II_4, TEXTURE_CASING_FUSION_COIL_II_5, TEXTURE_CASING_FUSION_COIL_II_6,
- TEXTURE_CASING_FUSION_COIL_II_7, TEXTURE_CASING_FUSION_COIL_II_8, TEXTURE_CASING_FUSION_COIL_II_9,
- TEXTURE_CASING_FUSION_COIL_II_10, TEXTURE_CASING_FUSION_COIL_II_11, TEXTURE_CASING_FUSION_COIL_II_12};
-
- public static IIconContainer[] TIERED_MACHINE_HULLS = new IIconContainer[]{
- TEXTURE_CASING_TIERED_ULV,
- TEXTURE_CASING_TIERED_LV,
- TEXTURE_CASING_TIERED_MV,
- TEXTURE_CASING_TIERED_HV,
- TEXTURE_CASING_TIERED_EV,
- TEXTURE_CASING_TIERED_IV,
- TEXTURE_CASING_TIERED_LuV,
- TEXTURE_CASING_TIERED_ZPM,
- TEXTURE_CASING_TIERED_UV,
- TEXTURE_CASING_TIERED_MAX};
-
-
- public static Object Casing_Material_Turbine;
-
-
+ private static AutoMap<Runnable> mCustomiconMap = new AutoMap<Runnable>();
+
+ static {
+ }
+
+ // public static ITexture[] CASING_BLOCKS_GTPP = new ITexture[256];
+
+ /*
+ * Handles Custom Textures.
+ */
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon;
+ protected String mIconName;
+ protected String mModID;
+
+ public CustomIcon(final String aIconName) {
+ this(CORE.MODID, aIconName);
+ }
+
+ public CustomIcon(final String aModID, final String aIconName) {
+ this.mIconName = aIconName;
+ this.mModID = aModID;
+ mCustomiconMap.put(this);
+ Logger.WARNING("Constructing a Custom Texture. " + this.mIconName);
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return this.mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ this.mIcon = GregTech_API.sBlockIcons.registerIcon(this.mModID + ":" + this.mIconName);
+ Logger.WARNING(
+ "FIND ME _ Processing texture: " + this.getTextureFile().getResourcePath());
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
+
+ public static class VanillaIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon;
+ protected String mIconName;
+
+ public VanillaIcon(final String aIconName) {
+ this.mIconName = aIconName;
+ mCustomiconMap.put(this);
+ Logger.WARNING("Constructing a Custom Texture. " + this.mIconName);
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return this.mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ this.mIcon = GregTech_API.sBlockIcons.registerIcon("minecraft" + ":" + this.mIconName);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
+
+ public static GT_RenderedTexture getTextureFromIcon(CustomIcon aIcon, short[] aRGB) {
+ return new GT_RenderedTexture(aIcon, aRGB);
+ }
+
+ /*
+ * Add Some Custom Textures below.
+ * I am not sure whether or not I need to declare them as such, but better to be safe than sorry.
+ * Right?
+ */
+
+ // Vanilla Textures
+ public static final VanillaIcon VanillaIcon_OakPlanks = new VanillaIcon("planks_oak");
+
+ // PlaceHolder Texture
+ private static final CustomIcon Internal_PlaceHolder = new CustomIcon("TileEntities/_PlaceHolder");
+ public static final CustomIcon _PlaceHolder = Internal_PlaceHolder;
+
+ // Energy overlays
+ public static final CustomIcon OVERLAY_ENERGY_OUT_BUFFER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_BUFFER");
+ public static final CustomIcon OVERLAY_ENERGY_OUT_MULTI_BUFFER =
+ new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_MULTI_BUFFER");
+
+ // Wooden Shelf and Compartment Overlays
+ public static final CustomIcon OVERLAY_WOODEN_SHELF_FRONT = new CustomIcon("TileEntities/Compartment/wood_shelf");
+ public static final CustomIcon OVERLAY_WOODEN_SHELF_CANS_FRONT =
+ new CustomIcon("TileEntities/Compartment/wood_shelf_cans");
+ public static final CustomIcon OVERLAY_WOODEN_SHELF_PAPER_FRONT =
+ new CustomIcon("TileEntities/Compartment/wood_shelf_paper");
+ public static final CustomIcon OVERLAY_CABINET_1 = new CustomIcon("TileEntities/Compartment/0");
+ public static final CustomIcon OVERLAY_CABINET_2 = new CustomIcon("TileEntities/Compartment/1");
+ public static final CustomIcon OVERLAY_CABINET_3 = new CustomIcon("TileEntities/Compartment/2");
+ public static final CustomIcon OVERLAY_CABINET_4 = new CustomIcon("TileEntities/Compartment/3");
+ public static final CustomIcon OVERLAY_CABINET_5 = new CustomIcon("TileEntities/Compartment/4");
+ public static final CustomIcon OVERLAY_CABINET_6 = new CustomIcon("TileEntities/Compartment/5");
+ public static final CustomIcon OVERLAY_CABINET_7 = new CustomIcon("TileEntities/Compartment/6");
+ public static final CustomIcon OVERLAY_CABINET_8 = new CustomIcon("TileEntities/Compartment/7");
+ public static final CustomIcon OVERLAY_CABINET_9 = new CustomIcon("TileEntities/Compartment/8");
+ public static final CustomIcon OVERLAY_CABINET_10 = new CustomIcon("TileEntities/Compartment/9");
+ public static final CustomIcon OVERLAY_CABINET_11 = new CustomIcon("TileEntities/Compartment/10");
+ public static final CustomIcon OVERLAY_CABINET_12 = new CustomIcon("TileEntities/Compartment/11");
+ public static final CustomIcon OVERLAY_CABINET_13 = new CustomIcon("TileEntities/Compartment/12");
+ public static final CustomIcon OVERLAY_CABINET_14 = new CustomIcon("TileEntities/Compartment/13");
+ public static final CustomIcon OVERLAY_CABINET_15 = new CustomIcon("TileEntities/Compartment/14");
+ public static final CustomIcon OVERLAY_CABINET_16 = new CustomIcon("TileEntities/Compartment/15");
+ public static final CustomIcon OVERLAY_COMPARTMENT_1 = new CustomIcon("TileEntities/Compartment/16");
+ public static final CustomIcon OVERLAY_COMPARTMENT_2 = new CustomIcon("TileEntities/Compartment/17");
+ public static final CustomIcon OVERLAY_COMPARTMENT_3 = new CustomIcon("TileEntities/Compartment/18");
+ public static final CustomIcon OVERLAY_COMPARTMENT_4 = new CustomIcon("TileEntities/Compartment/19");
+ public static final CustomIcon OVERLAY_COMPARTMENT_5 = new CustomIcon("TileEntities/Compartment/20");
+ public static final CustomIcon OVERLAY_COMPARTMENT_6 = new CustomIcon("TileEntities/Compartment/21");
+ public static final CustomIcon OVERLAY_COMPARTMENT_7 = new CustomIcon("TileEntities/Compartment/22");
+ public static final CustomIcon OVERLAY_COMPARTMENT_8 = new CustomIcon("TileEntities/Compartment/23");
+ public static final CustomIcon OVERLAY_COMPARTMENT_9 = new CustomIcon("TileEntities/Compartment/24");
+ public static final CustomIcon OVERLAY_COMPARTMENT_10 = new CustomIcon("TileEntities/Compartment/25");
+ public static final CustomIcon OVERLAY_COMPARTMENT_11 = new CustomIcon("TileEntities/Compartment/26");
+ public static final CustomIcon OVERLAY_COMPARTMENT_12 = new CustomIcon("TileEntities/Compartment/27");
+ public static final CustomIcon OVERLAY_COMPARTMENT_13 = new CustomIcon("TileEntities/Compartment/28");
+ public static final CustomIcon OVERLAY_COMPARTMENT_14 = new CustomIcon("TileEntities/Compartment/29");
+ public static final CustomIcon OVERLAY_COMPARTMENT_15 = new CustomIcon("TileEntities/Compartment/30");
+ public static final CustomIcon OVERLAY_COMPARTMENT_16 = new CustomIcon("TileEntities/Compartment/31");
+
+ // Controllers
+ private static final CustomIcon Internal_Casing_Fusion_Simple_Front =
+ new CustomIcon("TileEntities/MACHINE_CASING_FUSION_FRONT");
+ public static final CustomIcon Casing_Fusion_Simple_Front = Internal_Casing_Fusion_Simple_Front;
+ private static final CustomIcon Internal_Casing_Fusion_Simple_Front_Active =
+ new CustomIcon("TileEntities/MACHINE_CASING_FUSION_FRONT_ACTIVE");
+ public static final CustomIcon Casing_Fusion_Simple_Front_Active = Internal_Casing_Fusion_Simple_Front_Active;
+
+ // Machine Casings
+ // Simple
+ private static final CustomIcon Internal_Casing_Machine_Simple_Top = new CustomIcon("TileEntities/machine_top");
+ public static final CustomIcon Casing_Machine_Simple_Top = Internal_Casing_Machine_Simple_Top;
+ private static final CustomIcon Internal_Casing_Machine_Simple_Bottom =
+ new CustomIcon("TileEntities/machine_bottom");
+ public static final CustomIcon Casing_Machine_Simple_Bottom = Internal_Casing_Machine_Simple_Bottom;
+ // Advanced and Ultra
+ private static final CustomIcon Internal_Casing_Machine_Advanced = new CustomIcon("TileEntities/high_adv_machine");
+ public static final CustomIcon Casing_Machine_Advanced = Internal_Casing_Machine_Advanced;
+ private static final CustomIcon Internal_Casing_Machine_Ultra = new CustomIcon("TileEntities/adv_machine_lesu");
+ public static final CustomIcon Casing_Machine_Ultra = Internal_Casing_Machine_Ultra;
+ // Dimensional - Non Overlay
+ private static final CustomIcon Internal_Casing_Machine_Dimensional =
+ new CustomIcon("TileEntities/adv_machine_dimensional");
+ public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional;
+ private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv =
+ new CustomIcon("TileEntities/high_adv_machine_dimensional");
+ public static final CustomIcon Casing_Machine_Dimensional_Adv = Internal_Casing_Machine_Dimensional_Adv;
+
+ // Material Casings
+ private static final CustomIcon Internal_Casing_Tantalloy61 =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TANTALLOY61");
+ public static final CustomIcon Casing_Material_Tantalloy61 = Internal_Casing_Tantalloy61;
+ private static final CustomIcon Internal_Casing_MaragingSteel =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL");
+ public static final CustomIcon Casing_Material_MaragingSteel = Internal_Casing_MaragingSteel;
+ private static final CustomIcon Internal_Casing_Stellite =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_STELLITE");
+ public static final CustomIcon Casing_Material_Stellite = Internal_Casing_Stellite;
+ private static final CustomIcon Internal_Casing_Talonite =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TALONITE");
+ public static final CustomIcon Casing_Material_Talonite = Internal_Casing_Talonite;
+ private static final CustomIcon Internal_Casing_Tumbaga =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TUMBAGA");
+ public static final CustomIcon Casing_Material_Tumbaga = Internal_Casing_Tumbaga;
+ private static final CustomIcon Internal_Casing_Zeron100 =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZERON100");
+ public static final CustomIcon Casing_Material_Zeron100 = Internal_Casing_Zeron100;
+ private static final CustomIcon Internal_Casing_Potin = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_POTIN");
+ public static final CustomIcon Casing_Material_Potin = Internal_Casing_Potin;
+
+ private static final CustomIcon Internal_Casing_Grisium =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_GRISIUM");
+ public static final CustomIcon Casing_Material_Grisium = Internal_Casing_Grisium;
+ private static final CustomIcon Internal_Casing_RedSteel =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_RED_STEEL");
+ public static final CustomIcon Casing_Material_RedSteel = Internal_Casing_RedSteel;
+ private static final CustomIcon Internal_Casing_Incoloy020 =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_020");
+ public static final CustomIcon Casing_Material_Incoloy020 = Internal_Casing_Incoloy020;
+ private static final CustomIcon Internal_Casing_IncoloyDS =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_DS");
+ public static final CustomIcon Casing_Material_IncoloyDS = Internal_Casing_IncoloyDS;
+ private static final CustomIcon Internal_Casing_IncoloyMA956 =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_MA956");
+ public static final CustomIcon Casing_Material_IncoloyMA956 = Internal_Casing_IncoloyMA956;
+ private static final CustomIcon Internal_Casing_ZirconiumCarbide =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE");
+ public static final CustomIcon Casing_Material_ZirconiumCarbide = Internal_Casing_ZirconiumCarbide;
+
+ private static final CustomIcon Internal_Casing_HastelloyX =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_X");
+ public static final CustomIcon Casing_Material_HastelloyX = Internal_Casing_HastelloyX;
+ private static final CustomIcon Internal_Casing_HastelloyN =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_N");
+ public static final CustomIcon Casing_Material_HastelloyN = Internal_Casing_HastelloyN;
+ private static final CustomIcon Internal_Casing_Fluid_IncoloyDS =
+ new CustomIcon("TileEntities/MACHINE_CASING_FLUID_INCOLOY_DS");
+ public static final CustomIcon Casing_Material_Fluid_IncoloyDS = Internal_Casing_Fluid_IncoloyDS;
+
+ private static final CustomIcon Internal_Casing_Laurenium = new CustomIcon("TileEntities/MACHINE_CASING_LAURENIUM");
+ public static final CustomIcon Casing_Material_Laurenium = Internal_Casing_Laurenium;
+
+ // Trinium Alloys
+ public static final CustomIcon Casing_Trinium_Titanium =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_TITANIUM");
+ public static final CustomIcon Casing_Trinium_Naquadah =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH");
+ public static final CustomIcon Casing_Trinium_Naquadah_Vent =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_VENT");
+ public static final CustomIcon Casing_Trinium_Naquadah_Carbon =
+ new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_CARBON");
+
+ // Material Machine/Firebox Casings
+ private static final CustomIcon Internal_Casing_Staballoy_Firebox =
+ new CustomIcon("TileEntities/MACHINE_CASING_FIREBOX_STABALLOY");
+ public static final CustomIcon Casing_Staballoy_Firebox = Internal_Casing_Staballoy_Firebox;
+
+ // Misc Casings
+ private static final CustomIcon Internal_Casing_Machine_Redstone_Off =
+ new CustomIcon("TileEntities/cover_redstone_conductor");
+ public static final CustomIcon Casing_Machine_Redstone_Off = Internal_Casing_Machine_Redstone_Off;
+ private static final CustomIcon Internal_Casing_Machine_Redstone_On =
+ new CustomIcon("TileEntities/cover_redstone_emitter");
+ public static final CustomIcon Casing_Machine_Redstone_On = Internal_Casing_Machine_Redstone_On;
+
+ // Redox Cells
+ public static final CustomIcon Casing_Redox_1 = new CustomIcon("redox/redox1");
+ public static final CustomIcon Casing_Redox_2 = new CustomIcon("redox/redox2");
+ public static final CustomIcon Casing_Redox_3 = new CustomIcon("redox/redox3");
+ public static final CustomIcon Casing_Redox_4 = new CustomIcon("redox/redox4");
+ public static final CustomIcon Casing_Redox_5 = new CustomIcon("redox/redox5");
+ public static final CustomIcon Casing_Redox_6 = new CustomIcon("redox/redox6");
+ // public static final CustomIcon Casing_Redox_7 = new CustomIcon("redox/redox7");
+ // public static final CustomIcon Casing_Redox_8 = new CustomIcon("redox/redox8");
+
+ // Special Block 2
+ public static final CustomIcon Casing_Resonance_1 = new CustomIcon("special/block_1");
+ public static final CustomIcon Casing_Resonance_2 = new CustomIcon("special/block_2");
+ public static final CustomIcon Casing_Resonance_3 = new CustomIcon("special/block_3");
+ public static final CustomIcon Casing_Resonance_4 = new CustomIcon("special/block_4");
+ public static final CustomIcon Casing_Modulator_1 = new CustomIcon("special/block_5");
+ public static final CustomIcon Casing_Modulator_2 = new CustomIcon("special/block_6");
+ public static final CustomIcon Casing_Modulator_3 = new CustomIcon("special/block_7");
+ public static final CustomIcon Casing_Modulator_4 = new CustomIcon("special/block_8");
+
+ // Centrifuge Casing
+ private static final CustomIcon Internal_Casing_Centrifuge =
+ new CustomIcon("TileEntities/MACHINE_CASING_CENTRIFUGE");
+ public static final CustomIcon Casing_Material_Centrifuge = Internal_Casing_Centrifuge;
+
+ // MACHINE_CASING_FARM_MANAGER_STRUCTURAL
+ // Farm Manager Casings
+ private static final CustomIcon Internal_Casing_Machine_Farm_Manager =
+ new CustomIcon("TileEntities/MACHINE_CASING_FARM_MANAGER_STRUCTURAL");
+ public static final CustomIcon Casing_Machine_Farm_Manager = Internal_Casing_Machine_Farm_Manager;
+ // Acacia_Log
+ private static final CustomIcon Internal_Casing_Machine_Acacia_Log = new CustomIcon("TileEntities/log_acacia_top");
+ public static final CustomIcon Casing_Machine_Acacia_Log = Internal_Casing_Machine_Acacia_Log;
+ // Podzol Top
+ private static final CustomIcon Internal_Casing_Machine_Podzol = new CustomIcon("TileEntities/dirt_podzol_top");
+ public static final CustomIcon Casing_Machine_Podzol = Internal_Casing_Machine_Podzol;
+
+ // Structural Blocks
+ private static final CustomIcon Internal_Casing_Machine_Metal_Grate_A = new CustomIcon("chrono/MetalGrate");
+ public static final CustomIcon Casing_Machine_Metal_Grate_A = Internal_Casing_Machine_Metal_Grate_A;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Grate_A_Solid =
+ new CustomIcon("chrono/MetalGrateA_Solid");
+ public static final CustomIcon Casing_Machine_Metal_Grate_A_Solid = Internal_Casing_Machine_Metal_Grate_A_Solid;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Grate_B = new CustomIcon("chrono/MetalGrate2");
+ public static final CustomIcon Casing_Machine_Metal_Grate_B = Internal_Casing_Machine_Metal_Grate_B;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Panel_A = new CustomIcon("chrono/MetalPanel");
+ public static final CustomIcon Casing_Machine_Metal_Panel_A = Internal_Casing_Machine_Metal_Panel_A;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_A = new CustomIcon("chrono/MetalSheet");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_A = Internal_Casing_Machine_Metal_Sheet_A;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_B = new CustomIcon("chrono/MetalSheet2");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_B = Internal_Casing_Machine_Metal_Sheet_B;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_C = new CustomIcon("chrono/MetalSheet3");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_C = Internal_Casing_Machine_Metal_Sheet_C;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_D = new CustomIcon("chrono/MetalSheet4");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_D = Internal_Casing_Machine_Metal_Sheet_D;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_E = new CustomIcon("chrono/MetalSheet5");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_E = Internal_Casing_Machine_Metal_Sheet_E;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_F = new CustomIcon("chrono/MetalSheet6");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_F = Internal_Casing_Machine_Metal_Sheet_F;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_G = new CustomIcon("chrono/MetalSheet7");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_G = Internal_Casing_Machine_Metal_Sheet_G;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_H = new CustomIcon("chrono/MetalSheet8");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_H = Internal_Casing_Machine_Metal_Sheet_H;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_I = new CustomIcon("chrono/MetalSheet9");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_I = Internal_Casing_Machine_Metal_Sheet_I;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_J = new CustomIcon("chrono/MetalSheet10");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_J = Internal_Casing_Machine_Metal_Sheet_J;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_K = new CustomIcon("chrono/MetalSheet11");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_K = Internal_Casing_Machine_Metal_Sheet_K;
+ private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_L = new CustomIcon("chrono/MetalSheet12");
+ public static final CustomIcon Casing_Machine_Metal_Sheet_L = Internal_Casing_Machine_Metal_Sheet_L;
+ private static final CustomIcon Internal_Overlay_Machine_Cyber_A = new CustomIcon("chrono/CyberPanel");
+ public static final CustomIcon Overlay_Machine_Cyber_A = Internal_Overlay_Machine_Cyber_A;
+ private static final CustomIcon Internal_Overlay_Machine_Cyber_B = new CustomIcon("chrono/CyberPanel2");
+ public static final CustomIcon Overlay_Machine_Cyber_B = Internal_Overlay_Machine_Cyber_B;
+
+ public static final CustomIcon TEXTURE_CASING_AMAZON = new CustomIcon("TileEntities/CASING_AMAZON");
+ public static final CustomIcon TEXTURE_CASING_ADVANCED_CRYOGENIC =
+ new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC");
+ public static final CustomIcon TEXTURE_CASING_ADVANCED_VOLCNUS =
+ new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_VOLCANUS");
+ public static final CustomIcon TEXTURE_CASING_ROCKETDYNE = new CustomIcon("TileEntities/MACHINE_CASING_ROCKETDYNE");
+ public static final CustomIcon TEXTURE_CASING_GRINDING_MILL =
+ new CustomIcon("TileEntities/MACHINE_CASING_GRINDING_FACTORY");
+ public static final CustomIcon TEXTURE_CASING_FLOTATION = new CustomIcon("TileEntities/MACHINE_CASING_FLOTATION");
+
+ // Custom Pipes
+ public static final CustomIcon TEXTURE_PIPE_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_PIPE_T1");
+ public static final CustomIcon TEXTURE_PIPE_GENERIC = new CustomIcon("iconsets/MACHINE_CASING_PIPE_GENERIC");
+
+ public static final CustomIcon TEXTURE_PIPE_T1_BABBIT_ALLOY =
+ new CustomIcon("iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY");
+ public static final CustomIcon TEXTURE_PIPE_T2_INCONEL_690 =
+ new CustomIcon("iconsets/MACHINE_CASING_PIPE_INCONEL_690");
+ public static final CustomIcon TEXTURE_PIPE_T3_STELLITE = new CustomIcon("iconsets/MACHINE_CASING_PIPE_STELLITE");
+ public static final CustomIcon TEXTURE_PIPE_T4_NITINOL_60 =
+ new CustomIcon("iconsets/MACHINE_CASING_PIPE_NITINOL_60");
+ public static final CustomIcon TEXTURE_PIPE_T5_LAFIUM = new CustomIcon("iconsets/MACHINE_CASING_PIPE_LAFIUM");
+ public static final CustomIcon TEXTURE_PIPE_T6_CINOBITE = new CustomIcon("iconsets/MACHINE_CASING_PIPE_CINOBITE");
+ public static final CustomIcon TEXTURE_PIPE_T7_TITANSTEEL =
+ new CustomIcon("iconsets/MACHINE_CASING_PIPE_TITANSTEEL");
+ public static final CustomIcon TEXTURE_PIPE_T8_ABYSSAL = new CustomIcon("iconsets/MACHINE_CASING_PIPE_ABYSSAL");
+
+ // Custom Gearboxes
+ public static final CustomIcon TEXTURE_GEARBOX_GRINDING_MILL =
+ new CustomIcon("TileEntities/MACHINE_CASING_GEARBOX_T1");
+ public static final CustomIcon TEXTURE_GEARBOX_GENERIC = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_GENERIC");
+
+ public static final CustomIcon TEXTURE_GEARBOX_T1_EGLIN_STEEL =
+ new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_EGLIN_STEEL");
+ public static final CustomIcon TEXTURE_GEARBOX_T2_INCONEL_792 =
+ new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_INCONEL_792");
+ public static final CustomIcon TEXTURE_GEARBOX_T3_INCOLOY_MA956 =
+ new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_INCOLOY_MA956");
+ public static final CustomIcon TEXTURE_GEARBOX_T4_NITINOL_60 =
+ new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_NITINOL_60");
+ public static final CustomIcon TEXTURE_GEARBOX_T5_ZERON_100 =
+ new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_ZERON_100");
+ public static final CustomIcon TEXTURE_GEARBOX_T6_PIKYONIUM =
+ new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM");
+ public static final CustomIcon TEXTURE_GEARBOX_T7_TITANSTEEL =
+ new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL");
+ public static final CustomIcon TEXTURE_GEARBOX_T8_ABYSSAL =
+ new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_ABYSSAL");
+
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II = new CustomIcon("iconsets/MACHINE_CASING_FUSION_3");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_INNER =
+ new CustomIcon("iconsets/MACHINE_CASING_FUSION_COIL_II");
+ public static final CustomIcon TEXTURE_CASING_FUSION_CASING_ULTRA =
+ new CustomIcon("iconsets/MACHINE_CASING_FUSION_GLASS_ULTRA");
+ //
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_1 = new CustomIcon("iconsets/FUSIONIII_1");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_2 = new CustomIcon("iconsets/FUSIONIII_2");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_3 = new CustomIcon("iconsets/FUSIONIII_3");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_4 = new CustomIcon("iconsets/FUSIONIII_4");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_5 = new CustomIcon("iconsets/FUSIONIII_5");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_6 = new CustomIcon("iconsets/FUSIONIII_6");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_7 = new CustomIcon("iconsets/FUSIONIII_7");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_8 = new CustomIcon("iconsets/FUSIONIII_8");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_9 = new CustomIcon("iconsets/FUSIONIII_9");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_10 = new CustomIcon("iconsets/FUSIONIII_10");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_11 = new CustomIcon("iconsets/FUSIONIII_11");
+ public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_12 = new CustomIcon("iconsets/FUSIONIII_12");
+
+ // Overlays
+ // Fan Textures
+ private static final CustomIcon Internal_Overlay_Machine_Vent =
+ new CustomIcon("TileEntities/machine_top_vent_rotating");
+ public static final CustomIcon Overlay_Machine_Vent = Internal_Overlay_Machine_Vent;
+ private static final CustomIcon Internal_Overlay_Machine_Vent_Fast =
+ new CustomIcon("TileEntities/machine_top_vent_rotating_fast");
+ public static final CustomIcon Overlay_Machine_Vent_Fast = Internal_Overlay_Machine_Vent_Fast;
+ private static final CustomIcon Internal_Overlay_Machine_Vent_Adv =
+ new CustomIcon("TileEntities/adv_machine_vent_rotating");
+ public static final CustomIcon Overlay_Machine_Vent_Adv = Internal_Overlay_Machine_Vent_Adv;
+ private static final CustomIcon Internal_Overlay_Machine_Turbine_Active =
+ new CustomIcon("TileEntities/STEAM_TURBINE_SIDE_ACTIVE");
+ public static final CustomIcon Overlay_Machine_Turbine_Active = Internal_Overlay_Machine_Turbine_Active;
+ // Grate Texture
+ public static final CustomIcon OVERLAY_GRATE_A = new CustomIcon("metro/OVERLAY_GRATE_A");
+ // Speaker Texture
+ private static final CustomIcon Internal_Overlay_Machine_Sound = new CustomIcon("TileEntities/audio_out");
+ public static final CustomIcon Overlay_Machine_Sound = Internal_Overlay_Machine_Sound;
+ private static final CustomIcon Internal_Overlay_Machine_Sound_Active =
+ new CustomIcon("TileEntities/audio_out_active");
+ public static final CustomIcon Overlay_Machine_Sound_Active = Internal_Overlay_Machine_Sound_Active;
+ // Diesel Engines
+ private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical =
+ new CustomIcon("TileEntities/machine_top_dieselmotor");
+ public static final CustomIcon Overlay_Machine_Diesel_Vertical = Internal_Overlay_Machine_Diesel_Vertical;
+ private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal =
+ new CustomIcon("TileEntities/machine_top_dieselmotor2");
+ public static final CustomIcon Overlay_Machine_Diesel_Horizontal = Internal_Overlay_Machine_Diesel_Horizontal;
+ private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical_Active =
+ new CustomIcon("TileEntities/machine_top_dieselmotor_active");
+ public static final CustomIcon Overlay_Machine_Diesel_Vertical_Active =
+ Internal_Overlay_Machine_Diesel_Vertical_Active;
+ private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal_Active =
+ new CustomIcon("TileEntities/machine_top_dieselmotor2_active");
+ public static final CustomIcon Overlay_Machine_Diesel_Horizontal_Active =
+ Internal_Overlay_Machine_Diesel_Horizontal_Active;
+ // Computer Screens
+ private static final CustomIcon Internal_Casing_Machine_Screen_1 =
+ new CustomIcon("TileEntities/adv_machine_screen_random1");
+ public static final CustomIcon Casing_Machine_Screen_1 = Internal_Casing_Machine_Screen_1;
+ private static final CustomIcon Internal_Casing_Machine_Screen_2 =
+ new CustomIcon("TileEntities/adv_machine_screen_random2");
+ public static final CustomIcon Casing_Machine_Screen_2 = Internal_Casing_Machine_Screen_2;
+ private static final CustomIcon Internal_Casing_Machine_Screen_3 =
+ new CustomIcon("TileEntities/adv_machine_screen_random3");
+ public static final CustomIcon Casing_Machine_Screen_3 = Internal_Casing_Machine_Screen_3;
+ private static final CustomIcon Internal_Casing_Machine_Screen_Frequency =
+ new CustomIcon("TileEntities/adv_machine_screen_frequency");
+ public static final CustomIcon Casing_Machine_Screen_Frequency = Internal_Casing_Machine_Screen_Frequency;
+ private static final CustomIcon Internal_Overlay_Machine_Screen_Logo =
+ new CustomIcon("TileEntities/adv_machine_screen_logo");
+ public static final CustomIcon Overlay_Machine_Screen_Logo = Internal_Overlay_Machine_Screen_Logo;
+ private static final CustomIcon Internal_Overlay_Machine_Cyber_Interface = new CustomIcon("chrono/Overlay_Cyber");
+ public static final CustomIcon Overlay_Machine_Cyber_Interface = Internal_Overlay_Machine_Cyber_Interface;
+
+ // Machine Controller Overlays
+ private static final CustomIcon Internal_Overlay_Machine_Controller_Default =
+ new CustomIcon("iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED");
+ public static final CustomIcon Overlay_Machine_Controller_Default = Internal_Overlay_Machine_Controller_Default;
+ private static final CustomIcon Internal_Overlay_Machine_Controller_Default_Active =
+ new CustomIcon("iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED_ACTIVE");
+ public static final CustomIcon Overlay_Machine_Controller_Default_Active =
+ Internal_Overlay_Machine_Controller_Default_Active;
+
+ private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced =
+ new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED");
+ public static final CustomIcon Overlay_Machine_Controller_Advanced = Internal_Overlay_Machine_Controller_Advanced;
+ private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced_Active =
+ new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE");
+ public static final CustomIcon Overlay_Machine_Controller_Advanced_Active =
+ Internal_Overlay_Machine_Controller_Advanced_Active;
+
+ // Fluid Reactor Overlays
+ public static final CustomIcon Overlay_FluidReactor_Front =
+ new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT");
+ public static final CustomIcon Overlay_FluidReactor_Side = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE");
+ public static final CustomIcon Overlay_FluidReactor_Top = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP");
+ public static final CustomIcon Overlay_FluidReactor_Front_Active =
+ new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE");
+ public static final CustomIcon Overlay_FluidReactor_Side_Active =
+ new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE");
+ public static final CustomIcon Overlay_FluidReactor_Top_Active =
+ new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE");
+
+ // Crafting Overlays
+ public static final CustomIcon Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting");
+ public static final CustomIcon Overlay_Crafting_Steel = new CustomIcon("TileEntities/cover_crafting");
+
+ public static final CustomIcon Casing_Workbench_Crafting_Overlay =
+ new CustomIcon("TileEntities/gt4/bronze_top_crafting");
+ public static final CustomIcon Casing_Workbench_Top = new CustomIcon("TileEntities/gt4/bronze_top");
+ public static final CustomIcon Casing_Workbench_Side = new CustomIcon("TileEntities/gt4/bronze_side");
+ public static final CustomIcon Casing_Workbench_Bottom = new CustomIcon("TileEntities/gt4/bronze_bottom");
+ public static final CustomIcon Casing_Adv_Workbench_Crafting_Overlay =
+ new CustomIcon("TileEntities/gt4/machine_top_crafting");
+ public static final CustomIcon Casing_Adv_Workbench_Top = new CustomIcon("TileEntities/gt4/machine_top");
+ public static final CustomIcon Casing_Adv_Workbench_Side = new CustomIcon("TileEntities/gt4/machine_side");
+ public static final CustomIcon Casing_Adv_Workbench_Bottom = new CustomIcon("TileEntities/gt4/machine_bottom");
+
+ public static final CustomIcon Casing_Redstone_Top_Off =
+ new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_off");
+ public static final CustomIcon Casing_Redstone_Top_Main_Off =
+ new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_main_off");
+ public static final CustomIcon Casing_Redstone_Top_On =
+ new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_on");
+ public static final CustomIcon Casing_Redstone_Top_Main_On =
+ new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_main_on");
+
+ public static final CustomIcon Casing_Redstone_Side_Off =
+ new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_off");
+ public static final CustomIcon Casing_Redstone_Side_Main_Off =
+ new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_main_off");
+ public static final CustomIcon Casing_Redstone_Side_On =
+ new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_on");
+ public static final CustomIcon Casing_Redstone_Side_Main_On =
+ new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_main_on");
+
+ public static final CustomIcon Casing_Redstone_Bottom_Off =
+ new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_off");
+ public static final CustomIcon Casing_Redstone_Bottom_Main_Off =
+ new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_main_off");
+ public static final CustomIcon Casing_Redstone_Bottom_On =
+ new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_on");
+ public static final CustomIcon Casing_Redstone_Bottom_Main_On =
+ new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_main_on");
+
+ public static final CustomIcon Casing_Electric_Auto_Workbench_Side =
+ new CustomIcon("TileEntities/gt4/OVERLAY_SIDE_CABINET");
+ public static final CustomIcon Casing_Computer_Cube = new CustomIcon("TileEntities/gt4/computer");
+
+ public static final CustomIcon Casing_CropHarvester_Cutter = new CustomIcon("TileEntities/gt4/OVERLAY_CROP");
+ public static final CustomIcon Casing_CropHarvester_Boxes = new CustomIcon("TileEntities/gt4/OVERLAY_BOXES");
+
+ public static final CustomIcon Casing_InventoryManagaer_Cyan = new CustomIcon("TileEntities/gt4/OVERLAY_CYAN");
+ public static final CustomIcon Casing_InventoryManagaer_Green = new CustomIcon("TileEntities/gt4/OVERLAY_GREEN");
+ public static final CustomIcon Casing_InventoryManagaer_Purple = new CustomIcon("TileEntities/gt4/OVERLAY_PURPLE");
+ public static final CustomIcon Casing_InventoryManagaer_Red = new CustomIcon("TileEntities/gt4/OVERLAY_RED");
+ public static final CustomIcon Casing_InventoryManagaer_Yellow = new CustomIcon("TileEntities/gt4/OVERLAY_YELLOW");
+ public static final CustomIcon Casing_InventoryManagaer_Blue = new CustomIcon("TileEntities/gt4/OVERLAY_BLUE");
+
+ public static final CustomIcon Casing_InventoryManagaer_Cyan_Redstone =
+ new CustomIcon("TileEntities/gt4/OVERLAY_CYAN_REDSTONE");
+ public static final CustomIcon Casing_InventoryManagaer_Green_Redstone =
+ new CustomIcon("TileEntities/gt4/OVERLAY_GREEN_REDSTONE");
+ public static final CustomIcon Casing_InventoryManagaer_Purple_Redstone =
+ new CustomIcon("TileEntities/gt4/OVERLAY_PURPLE_REDSTONE");
+ public static final CustomIcon Casing_InventoryManagaer_Red_Redstone =
+ new CustomIcon("TileEntities/gt4/OVERLAY_RED_REDSTONE");
+ public static final CustomIcon Casing_InventoryManagaer_Yellow_Redstone =
+ new CustomIcon("TileEntities/gt4/OVERLAY_YELLOW_REDSTONE");
+ public static final CustomIcon Casing_InventoryManagaer_Blue_Redstone =
+ new CustomIcon("TileEntities/gt4/OVERLAY_BLUE_REDSTONE");
+
+ private static final CustomIcon Casing_Test_1 = new CustomIcon("number/1");
+ private static final CustomIcon Casing_Test_2 = new CustomIcon("number/2");
+ private static final CustomIcon Casing_Test_3 = new CustomIcon("number/3");
+ private static final CustomIcon Casing_Test_4 = new CustomIcon("number/4");
+ private static final CustomIcon Casing_Test_5 = new CustomIcon("number/5");
+ private static final CustomIcon Casing_Test_6 = new CustomIcon("number/6");
+ private static final CustomIcon Casing_Test_7 = new CustomIcon("number/7");
+ private static final CustomIcon Casing_Test_8 = new CustomIcon("number/8");
+ private static final CustomIcon Casing_Test_9 = new CustomIcon("number/9");
+ private static final CustomIcon Casing_Test_10 = new CustomIcon("number/10");
+ private static final CustomIcon Casing_Test_11 = new CustomIcon("number/11");
+ private static final CustomIcon Casing_Test_12 = new CustomIcon("number/12");
+ private static final CustomIcon Casing_Test_13 = new CustomIcon("number/13");
+ private static final CustomIcon Casing_Test_14 = new CustomIcon("number/14");
+ private static final CustomIcon Casing_Test_15 = new CustomIcon("number/15");
+ private static final CustomIcon Casing_Test_16 = new CustomIcon("number/16");
+
+ public static final CustomIcon[] TEST_NUMBER = new CustomIcon[] {
+ Casing_Test_1, Casing_Test_2, Casing_Test_3, Casing_Test_4,
+ Casing_Test_5, Casing_Test_6, Casing_Test_7, Casing_Test_8,
+ Casing_Test_9, Casing_Test_10, Casing_Test_11, Casing_Test_12,
+ Casing_Test_13, Casing_Test_14, Casing_Test_15, Casing_Test_16
+ };
+
+ // Covers
+ private static final CustomIcon Internal_Overlay_Overflow_Valve = new CustomIcon("iconsets/OVERLAY_OVERFLOW_VALVE");
+ public static final CustomIcon Overlay_Overflow_Valve = Internal_Overlay_Overflow_Valve;
+
+ // Hatch Overlays
+ // Charger Texture
+ private static final CustomIcon Internal_Overlay_Hatch_Charger = new CustomIcon("TileEntities/cover_charger");
+ public static final CustomIcon Overlay_Hatch_Charger = Internal_Overlay_Hatch_Charger;
+ // Discharger Texture
+ private static final CustomIcon Internal_Overlay_Hatch_Discharger = new CustomIcon("TileEntities/cover_discharge");
+ public static final CustomIcon Overlay_Hatch_Discharger = Internal_Overlay_Hatch_Discharger;
+ // Advanced Muffler
+ private static final CustomIcon Internal_Overlay_Hatch_Muffler_Adv = new CustomIcon("iconsets/OVERLAY_MUFFLER_ADV");
+ public static final CustomIcon Overlay_Hatch_Muffler_Adv = Internal_Overlay_Hatch_Muffler_Adv;
+ // Control Core Bus
+ private static final CustomIcon Internal_Overlay_Hatch_Control_Core =
+ new CustomIcon("iconsets/OVERLAY_CONTROL_CORE_BUS");
+ public static final CustomIcon Overlay_Hatch_Control_Core = Internal_Overlay_Hatch_Control_Core;
+ // Milling Ball Bus
+ private static final CustomIcon Internal_Overlay_Bus_Milling_Balls =
+ new CustomIcon("iconsets/OVERLAY_MILLING_BALL_BUS");
+ public static final CustomIcon Overlay_Bus_Milling_Balls = Internal_Overlay_Bus_Milling_Balls;
+ // Catalyst Bus
+ private static final CustomIcon Internal_Overlay_Bus_Catalyst = new CustomIcon("iconsets/OVERLAY_CATALYSTS");
+ public static final CustomIcon Overlay_Bus_Catalyst = Internal_Overlay_Bus_Catalyst;
+
+ public static final CustomIcon Overlay_Cobble = new CustomIcon("iconsets/OVERLAY_COBBLE");
+ public static final CustomIcon Overlay_Connector = new CustomIcon("iconsets/OVERLAY_CONNECTOR");
+ public static final CustomIcon Overlay_Fire = new CustomIcon("iconsets/OVERLAY_FIRE");
+ public static final CustomIcon Overlay_Grinder = new CustomIcon("iconsets/OVERLAY_GRINDER");
+ public static final CustomIcon Overlay_GT_Logo = new CustomIcon("iconsets/OVERLAY_GT");
+ public static final CustomIcon Overlay_Ice = new CustomIcon("iconsets/OVERLAY_ICE");
+ public static final CustomIcon Overlay_Implosion = new CustomIcon("iconsets/OVERLAY_IMPLOSION");
+ // Lapo Orb Hatch
+ public static final CustomIcon Overlay_Hatch_Lapo_Orb = new CustomIcon("iconsets/OVERLAY_LAPO");
+ // Data Orb Hatch
+ public static final CustomIcon Overlay_Hatch_Data_Orb = new CustomIcon("iconsets/OVERLAY_DATA_ORB");
+
+ // RTG Hatch
+ private static final CustomIcon Internal_Overlay_Hatch_RTG_Off = new CustomIcon("iconsets/OVERLAY_ENERGY_RTG_OFF");
+ public static final CustomIcon Overlay_Hatch_RTG_Off = Internal_Overlay_Hatch_RTG_Off;
+ private static final CustomIcon Internal_Overlay_Hatch_RTG_On = new CustomIcon("iconsets/OVERLAY_ENERGY_RTG_ON");
+ public static final CustomIcon Overlay_Hatch_RTG_On = Internal_Overlay_Hatch_RTG_On;
+
+ // Dimensional
+ private static final CustomIcon Internal_Overlay_Machine_Dimensional_Blue =
+ new CustomIcon("TileEntities/adv_machine_dimensional_cover_blue");
+ public static final CustomIcon Overlay_Machine_Dimensional_Blue = Internal_Overlay_Machine_Dimensional_Blue;
+ private static final CustomIcon Internal_Overlay_Machine_Dimensional_Orange =
+ new CustomIcon("TileEntities/adv_machine_dimensional_cover_orange");
+ public static final CustomIcon Overlay_Machine_Dimensional_Orange = Internal_Overlay_Machine_Dimensional_Orange;
+ // Icons
+ private static final CustomIcon Internal_Overlay_MatterFab = new CustomIcon("TileEntities/adv_machine_matterfab");
+ public static final CustomIcon Overlay_MatterFab = Internal_Overlay_MatterFab;
+ private static final CustomIcon Internal_Overlay_MatterFab_Active =
+ new CustomIcon("TileEntities/adv_machine_matterfab_active");
+ public static final CustomIcon Overlay_MatterFab_Active = Internal_Overlay_MatterFab_Active;
+
+ private static final CustomIcon Internal_Overlay_MatterFab_Animated =
+ new CustomIcon("TileEntities/adv_machine_matterfab_animated");
+ public static final CustomIcon Overlay_MatterFab_Animated = Internal_Overlay_MatterFab_Animated;
+ private static final CustomIcon Internal_Overlay_MatterFab_Active_Animated =
+ new CustomIcon("TileEntities/adv_machine_matterfab_active_animated");
+ public static final CustomIcon Overlay_MatterFab_Active_Animated = Internal_Overlay_MatterFab_Active_Animated;
+
+ private static final CustomIcon Internal_Overlay_Oil = new CustomIcon("TileEntities/adv_machine_oil");
+ public static final CustomIcon Overlay_Oil = Internal_Overlay_Oil;
+ private static final CustomIcon Internal_Overlay_Water = new CustomIcon("TileEntities/adv_machine_water");
+ public static final CustomIcon Overlay_Water = Internal_Overlay_Water;
+ private static final CustomIcon Internal_Overlay_UU_Matter = new CustomIcon("TileEntities/adv_machine_uum");
+ public static final CustomIcon Overlay_UU_Matter = Internal_Overlay_UU_Matter;
+
+ // GT++ Tiered Hulls
+ public static final CustomIcon TEXTURE_CASING_TIERED_ULV = new CustomIcon("iconsets/TieredHulls/CASING_ULV");
+ public static final CustomIcon TEXTURE_CASING_TIERED_LV = new CustomIcon("iconsets/TieredHulls/CASING_LV");
+ public static final CustomIcon TEXTURE_CASING_TIERED_MV = new CustomIcon("iconsets/TieredHulls/CASING_MV");
+ public static final CustomIcon TEXTURE_CASING_TIERED_HV = new CustomIcon("iconsets/TieredHulls/CASING_HV");
+ public static final CustomIcon TEXTURE_CASING_TIERED_EV = new CustomIcon("iconsets/TieredHulls/CASING_EV");
+ public static final CustomIcon TEXTURE_CASING_TIERED_IV = new CustomIcon("iconsets/TieredHulls/CASING_IV");
+ public static final CustomIcon TEXTURE_CASING_TIERED_LuV = new CustomIcon("iconsets/TieredHulls/CASING_LuV");
+ public static final CustomIcon TEXTURE_CASING_TIERED_ZPM = new CustomIcon("iconsets/TieredHulls/CASING_ZPM");
+ public static final CustomIcon TEXTURE_CASING_TIERED_UV = new CustomIcon("iconsets/TieredHulls/CASING_UV");
+ public static final CustomIcon TEXTURE_CASING_TIERED_MAX = new CustomIcon("iconsets/TieredHulls/CASING_MAX");
+
+ // Metroid related
+ public static final CustomIcon TEXTURE_METAL_PANEL_A = new CustomIcon("metro/TEXTURE_METAL_PANEL_A");
+ public static final CustomIcon TEXTURE_METAL_PANEL_B = new CustomIcon("metro/TEXTURE_METAL_PANEL_B");
+ public static final CustomIcon TEXTURE_METAL_PANEL_C = new CustomIcon("metro/TEXTURE_METAL_PANEL_C");
+ public static final CustomIcon TEXTURE_METAL_PANEL_D = new CustomIcon("metro/TEXTURE_METAL_PANEL_D");
+ public static final CustomIcon TEXTURE_METAL_PANEL_E = new CustomIcon("metro/TEXTURE_METAL_PANEL_E");
+ public static final CustomIcon TEXTURE_METAL_PANEL_F = new CustomIcon("metro/TEXTURE_METAL_PANEL_F");
+ public static final CustomIcon TEXTURE_METAL_PANEL_G = new CustomIcon("metro/TEXTURE_METAL_PANEL_G");
+ public static final CustomIcon TEXTURE_METAL_PANEL_H = new CustomIcon("metro/TEXTURE_METAL_PANEL_H");
+ public static final CustomIcon TEXTURE_METAL_PANEL_I = new CustomIcon("metro/TEXTURE_METAL_PANEL_I");
+
+ public static final CustomIcon TEXTURE_MAGIC_PANEL_A = new CustomIcon("metro/TEXTURE_MAGIC_A");
+ public static final CustomIcon TEXTURE_MAGIC_PANEL_B = new CustomIcon("metro/TEXTURE_MAGIC_B");
+
+ public static final CustomIcon TEXTURE_ORGANIC_PANEL_A = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A");
+ public static final CustomIcon TEXTURE_ORGANIC_PANEL_A_GLOWING =
+ new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A_GLOWING");
+
+ public static final CustomIcon TEXTURE_STONE_BIRD_A = new CustomIcon("metro/TEXTURE_STONE_BIRD_A");
+ public static final CustomIcon TEXTURE_STONE_BIRD_A_LEFT = new CustomIcon("metro/TEXTURE_STONE_BIRD_A_LEFT");
+ public static final CustomIcon TEXTURE_STONE_BIRD_A_RIGHT = new CustomIcon("metro/TEXTURE_STONE_BIRD_A_RIGHT");
+ public static final CustomIcon TEXTURE_STONE_RED_A = new CustomIcon("metro/TEXTURE_STONE_RED_A");
+ public static final CustomIcon TEXTURE_STONE_RED_B = new CustomIcon("metro/TEXTURE_STONE_RED_B");
+ public static final CustomIcon TEXTURE_STONE_BLUE_A = new CustomIcon("metro/TEXTURE_STONE_BLUE_A");
+ public static final CustomIcon TEXTURE_STONE_GREEN_A = new CustomIcon("metro/TEXTURE_STONE_GREEN_A");
+ public static final CustomIcon TEXTURE_STONE_TABLET_A = new CustomIcon("metro/TEXTURE_STONE_TABLET_A");
+ public static final CustomIcon TEXTURE_STONE_TABLET_B = new CustomIcon("metro/TEXTURE_STONE_TABLET_B");
+
+ public static final CustomIcon TEXTURE_TECH_A = new CustomIcon("metro/TEXTURE_TECH_A");
+ public static final CustomIcon TEXTURE_TECH_B = new CustomIcon("metro/TEXTURE_TECH_B");
+ public static final CustomIcon TEXTURE_TECH_C = new CustomIcon("metro/TEXTURE_TECH_C");
+
+ public static final CustomIcon TEXTURE_TECH_PANEL_A = new CustomIcon("metro/TEXTURE_TECH_PANEL_A");
+ public static final CustomIcon TEXTURE_TECH_PANEL_B = new CustomIcon("metro/TEXTURE_TECH_PANEL_B");
+ public static final CustomIcon TEXTURE_TECH_PANEL_C = new CustomIcon("metro/TEXTURE_TECH_PANEL_C");
+ public static final CustomIcon TEXTURE_TECH_PANEL_D = new CustomIcon("metro/TEXTURE_TECH_PANEL_D");
+ public static final CustomIcon TEXTURE_TECH_PANEL_E = new CustomIcon("metro/TEXTURE_TECH_PANEL_E");
+ public static final CustomIcon TEXTURE_TECH_PANEL_F = new CustomIcon("metro/TEXTURE_TECH_PANEL_F");
+ public static final CustomIcon TEXTURE_TECH_PANEL_G = new CustomIcon("metro/TEXTURE_TECH_PANEL_G");
+ public static final CustomIcon TEXTURE_TECH_PANEL_H = new CustomIcon("metro/TEXTURE_TECH_PANEL_H");
+ public static final CustomIcon TEXTURE_TECH_PANEL_I = new CustomIcon("metro/TEXTURE_TECH_PANEL_I");
+
+ public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE =
+ new CustomIcon("TileEntities/DecayablesChest_bottom");
+ public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT =
+ new CustomIcon("TileEntities/DecayablesChest_top");
+
+ // LFTR Single blocks
+ public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT =
+ new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT");
+ public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE =
+ new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE");
+ public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE =
+ new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE");
+ public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE =
+ new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE");
+ public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP =
+ new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP");
+ public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE =
+ new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE");
+
+ public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT =
+ new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT");
+ public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE =
+ new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE");
+ public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE =
+ new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE");
+ public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE =
+ new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE");
+ public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP =
+ new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP");
+ public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE =
+ new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE");
+
+ // Overlay Arrays
+ public static ITexture[] OVERLAYS_ENERGY_OUT_BUFFER = new ITexture[] {
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {220, 220, 220, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {220, 220, 220, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {255, 100, 0, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {255, 255, 30, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {128, 128, 128, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0})
+ };
+
+ public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI_BUFFER = new ITexture[] {
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {220, 220, 220, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {220, 220, 220, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {255, 100, 0, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {255, 255, 30, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {128, 128, 128, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0})
+ };
+
+ public static ITexture[] OVERLAYS_CABINET_FRONT = new ITexture[] {
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_1, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_2, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_3, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_4, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_5, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_6, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_7, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_8, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_9, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_10, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_11, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_12, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_13, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_14, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_15, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_16, new short[] {255, 255, 255, 0}),
+ };
+
+ public static ITexture[] OVERLAYS_COMPARTMENT_FRONT = new ITexture[] {
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_1, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_2, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_3, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_4, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_5, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_6, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_7, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_8, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_9, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_10, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_11, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_12, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_13, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_14, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_15, new short[] {255, 255, 255, 0}),
+ new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_16, new short[] {255, 255, 255, 0}),
+ };
+
+ public static IIconContainer[] CONNECTED_FUSION_HULLS = new IIconContainer[] {
+ TEXTURE_CASING_FUSION_COIL_II_1, TEXTURE_CASING_FUSION_COIL_II_2, TEXTURE_CASING_FUSION_COIL_II_3,
+ TEXTURE_CASING_FUSION_COIL_II_4, TEXTURE_CASING_FUSION_COIL_II_5, TEXTURE_CASING_FUSION_COIL_II_6,
+ TEXTURE_CASING_FUSION_COIL_II_7, TEXTURE_CASING_FUSION_COIL_II_8, TEXTURE_CASING_FUSION_COIL_II_9,
+ TEXTURE_CASING_FUSION_COIL_II_10, TEXTURE_CASING_FUSION_COIL_II_11, TEXTURE_CASING_FUSION_COIL_II_12
+ };
+
+ public static IIconContainer[] TIERED_MACHINE_HULLS = new IIconContainer[] {
+ TEXTURE_CASING_TIERED_ULV,
+ TEXTURE_CASING_TIERED_LV,
+ TEXTURE_CASING_TIERED_MV,
+ TEXTURE_CASING_TIERED_HV,
+ TEXTURE_CASING_TIERED_EV,
+ TEXTURE_CASING_TIERED_IV,
+ TEXTURE_CASING_TIERED_LuV,
+ TEXTURE_CASING_TIERED_ZPM,
+ TEXTURE_CASING_TIERED_UV,
+ TEXTURE_CASING_TIERED_MAX
+ };
+
+ public static Object Casing_Material_Turbine;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java
index cc5cf3d55e..bb09531d10 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java
@@ -4,29 +4,32 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIco
public class TexturesGtCutomCovers {
- public static final CustomIcon[] TEXTURE_ZTONES_AGON = new CustomIcon[16];
- public static final CustomIcon[] TEXTURE_ZTONES_ISZM = new CustomIcon[16];
- public static final CustomIcon[] TEXTURE_ZTONES_KORP = new CustomIcon[16];
- public static final CustomIcon[] TEXTURE_ZTONES_JELT = new CustomIcon[16];
- public static final CustomIcon[] TEXTURE_ZTONES_BITT = new CustomIcon[16];
-
- public static void init() {
- generateZTones();
- }
+ public static final CustomIcon[] TEXTURE_ZTONES_AGON = new CustomIcon[16];
+ public static final CustomIcon[] TEXTURE_ZTONES_ISZM = new CustomIcon[16];
+ public static final CustomIcon[] TEXTURE_ZTONES_KORP = new CustomIcon[16];
+ public static final CustomIcon[] TEXTURE_ZTONES_JELT = new CustomIcon[16];
+ public static final CustomIcon[] TEXTURE_ZTONES_BITT = new CustomIcon[16];
- private static void generateZTones() {
- // ZTONES
- String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" };
- int aArrayIndex = 0;
- CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP,
- TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT };
+ public static void init() {
+ generateZTones();
+ }
- for (CustomIcon[] t : aArrays) {
- for (int s = 0; s < 16; s++) {
- t[s] = new CustomIcon("Ztones", "sets/" + aZtoneCoverTextureNames[aArrayIndex] + "/"+aZtoneCoverTextureNames[aArrayIndex]+"_ (" + s + ")");
- }
- aArrayIndex++;
- }
- }
+ private static void generateZTones() {
+ // ZTONES
+ String[] aZtoneCoverTextureNames = new String[] {"agon", "iszm", "korp", "jelt", "bitt"};
+ int aArrayIndex = 0;
+ CustomIcon[][] aArrays = new CustomIcon[][] {
+ TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT
+ };
+ for (CustomIcon[] t : aArrays) {
+ for (int s = 0; s < 16; s++) {
+ t[s] = new CustomIcon(
+ "Ztones",
+ "sets/" + aZtoneCoverTextureNames[aArrayIndex] + "/" + aZtoneCoverTextureNames[aArrayIndex]
+ + "_ (" + s + ")");
+ }
+ aArrayIndex++;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java
index ee104eaca3..b068d12d26 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java
@@ -1,61 +1,51 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
-import net.minecraft.client.renderer.texture.TextureMap;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
public final class TexturesGtTools {
- public final static CustomIcon SKOOKUM_CHOOCHER = new CustomIcon("iconsets/SKOOKUMCHOOCHER");
- public final static CustomIcon ANGLE_GRINDER = new CustomIcon("iconsets/ANGLE_GRINDER");
- public final static CustomIcon ELECTRIC_SNIPS = new CustomIcon("iconsets/ELECTRIC_SNIPS");
- public final static CustomIcon ELECTRIC_LIGHTER = new CustomIcon("iconsets/ELECTRIC_LIGHTER");
- public final static CustomIcon ELECTRIC_BUTCHER_KNIFE = new CustomIcon("iconsets/ELECTRIC_BUTCHER_KNIFE");
-
-
-
-
-
-
-
-
- public final static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon, mOverlay;
- protected final String mIconName;
-
- public CustomIcon(final String aIconName) {
- this.mIconName = aIconName;
- Logger.INFO("Constructing a Custom Texture. " + this.mIconName);
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public void run() {
- this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
- //Utils.LOG_INFO("Registering a Custom Texture. "+mIcon.g);
- this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName + "_OVERLAY");
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
- }
-
+ public static final CustomIcon SKOOKUM_CHOOCHER = new CustomIcon("iconsets/SKOOKUMCHOOCHER");
+ public static final CustomIcon ANGLE_GRINDER = new CustomIcon("iconsets/ANGLE_GRINDER");
+ public static final CustomIcon ELECTRIC_SNIPS = new CustomIcon("iconsets/ELECTRIC_SNIPS");
+ public static final CustomIcon ELECTRIC_LIGHTER = new CustomIcon("iconsets/ELECTRIC_LIGHTER");
+ public static final CustomIcon ELECTRIC_BUTCHER_KNIFE = new CustomIcon("iconsets/ELECTRIC_BUTCHER_KNIFE");
+
+ public static final class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon, mOverlay;
+ protected final String mIconName;
+
+ public CustomIcon(final String aIconName) {
+ this.mIconName = aIconName;
+ Logger.INFO("Constructing a Custom Texture. " + this.mIconName);
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return this.mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return this.mOverlay;
+ }
+
+ @Override
+ public void run() {
+ this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
+ // Utils.LOG_INFO("Registering a Custom Texture. "+mIcon.g);
+ this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java
index 7169861340..b811f601e2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java
@@ -76,7 +76,6 @@ import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE9;
import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaSpecialMultiCasings;
import net.minecraft.tileentity.TileEntity;
@@ -85,288 +84,348 @@ import net.minecraft.world.IBlockAccess;
public class LargeTurbineTextureHandler {
- /**
- * LP Turbines
- */
+ /**
+ * LP Turbines
+ */
+ public static BlockIcons[] OVERLAY_LP_TURBINE = new BlockIcons[] {
+ LARGETURBINE_ST1,
+ LARGETURBINE_ST2,
+ LARGETURBINE_ST3,
+ LARGETURBINE_ST4,
+ LARGETURBINE_ST5,
+ LARGETURBINE_ST6,
+ LARGETURBINE_ST7,
+ LARGETURBINE_ST8,
+ LARGETURBINE_ST9,
+ };
- public static BlockIcons[] OVERLAY_LP_TURBINE = new BlockIcons[]{
- LARGETURBINE_ST1,
- LARGETURBINE_ST2,
- LARGETURBINE_ST3,
- LARGETURBINE_ST4,
- LARGETURBINE_ST5,
- LARGETURBINE_ST6,
- LARGETURBINE_ST7,
- LARGETURBINE_ST8,
- LARGETURBINE_ST9,
- };
+ public static BlockIcons[] OVERLAY_LP_TURBINE_ACTIVE = new BlockIcons[] {
+ LARGETURBINE_ST_ACTIVE1,
+ LARGETURBINE_ST_ACTIVE2,
+ LARGETURBINE_ST_ACTIVE3,
+ LARGETURBINE_ST_ACTIVE4,
+ LARGETURBINE_ST_ACTIVE5,
+ LARGETURBINE_ST_ACTIVE6,
+ LARGETURBINE_ST_ACTIVE7,
+ LARGETURBINE_ST_ACTIVE8,
+ LARGETURBINE_ST_ACTIVE9,
+ };
- public static BlockIcons[] OVERLAY_LP_TURBINE_ACTIVE = new BlockIcons[]{
- LARGETURBINE_ST_ACTIVE1,
- LARGETURBINE_ST_ACTIVE2,
- LARGETURBINE_ST_ACTIVE3,
- LARGETURBINE_ST_ACTIVE4,
- LARGETURBINE_ST_ACTIVE5,
- LARGETURBINE_ST_ACTIVE6,
- LARGETURBINE_ST_ACTIVE7,
- LARGETURBINE_ST_ACTIVE8,
- LARGETURBINE_ST_ACTIVE9,
- };
+ /**
+ * HP Turbines
+ */
+ public static BlockIcons[] OVERLAY_HP_TURBINE = new BlockIcons[] {
+ LARGETURBINE_TI1,
+ LARGETURBINE_TI2,
+ LARGETURBINE_TI3,
+ LARGETURBINE_TI4,
+ LARGETURBINE_TI5,
+ LARGETURBINE_TI6,
+ LARGETURBINE_TI7,
+ LARGETURBINE_TI8,
+ LARGETURBINE_TI9,
+ };
- /**
- * HP Turbines
- */
+ public static BlockIcons[] OVERLAY_HP_TURBINE_ACTIVE = new BlockIcons[] {
+ LARGETURBINE_TI_ACTIVE1,
+ LARGETURBINE_TI_ACTIVE2,
+ LARGETURBINE_TI_ACTIVE3,
+ LARGETURBINE_TI_ACTIVE4,
+ LARGETURBINE_TI_ACTIVE5,
+ LARGETURBINE_TI_ACTIVE6,
+ LARGETURBINE_TI_ACTIVE7,
+ LARGETURBINE_TI_ACTIVE8,
+ LARGETURBINE_TI_ACTIVE9,
+ };
- public static BlockIcons[] OVERLAY_HP_TURBINE = new BlockIcons[]{
- LARGETURBINE_TI1,
- LARGETURBINE_TI2,
- LARGETURBINE_TI3,
- LARGETURBINE_TI4,
- LARGETURBINE_TI5,
- LARGETURBINE_TI6,
- LARGETURBINE_TI7,
- LARGETURBINE_TI8,
- LARGETURBINE_TI9,
- };
+ /**
+ * Gas Turbines
+ */
+ public static BlockIcons[] OVERLAY_GAS_TURBINE = new BlockIcons[] {
+ LARGETURBINE_SS1,
+ LARGETURBINE_SS2,
+ LARGETURBINE_SS3,
+ LARGETURBINE_SS4,
+ LARGETURBINE_SS5,
+ LARGETURBINE_SS6,
+ LARGETURBINE_SS7,
+ LARGETURBINE_SS8,
+ LARGETURBINE_SS9,
+ };
- public static BlockIcons[] OVERLAY_HP_TURBINE_ACTIVE = new BlockIcons[]{
- LARGETURBINE_TI_ACTIVE1,
- LARGETURBINE_TI_ACTIVE2,
- LARGETURBINE_TI_ACTIVE3,
- LARGETURBINE_TI_ACTIVE4,
- LARGETURBINE_TI_ACTIVE5,
- LARGETURBINE_TI_ACTIVE6,
- LARGETURBINE_TI_ACTIVE7,
- LARGETURBINE_TI_ACTIVE8,
- LARGETURBINE_TI_ACTIVE9,
- };
-
- /**
- * Gas Turbines
- */
-
- public static BlockIcons[] OVERLAY_GAS_TURBINE = new BlockIcons[]{
- LARGETURBINE_SS1,
- LARGETURBINE_SS2,
- LARGETURBINE_SS3,
- LARGETURBINE_SS4,
- LARGETURBINE_SS5,
- LARGETURBINE_SS6,
- LARGETURBINE_SS7,
- LARGETURBINE_SS8,
- LARGETURBINE_SS9,
- };
+ public static BlockIcons[] OVERLAY_GAS_TURBINE_ACTIVE = new BlockIcons[] {
+ LARGETURBINE_SS_ACTIVE1,
+ LARGETURBINE_SS_ACTIVE2,
+ LARGETURBINE_SS_ACTIVE3,
+ LARGETURBINE_SS_ACTIVE4,
+ LARGETURBINE_SS_ACTIVE5,
+ LARGETURBINE_SS_ACTIVE6,
+ LARGETURBINE_SS_ACTIVE7,
+ LARGETURBINE_SS_ACTIVE8,
+ LARGETURBINE_SS_ACTIVE9,
+ };
- public static BlockIcons[] OVERLAY_GAS_TURBINE_ACTIVE = new BlockIcons[]{
- LARGETURBINE_SS_ACTIVE1,
- LARGETURBINE_SS_ACTIVE2,
- LARGETURBINE_SS_ACTIVE3,
- LARGETURBINE_SS_ACTIVE4,
- LARGETURBINE_SS_ACTIVE5,
- LARGETURBINE_SS_ACTIVE6,
- LARGETURBINE_SS_ACTIVE7,
- LARGETURBINE_SS_ACTIVE8,
- LARGETURBINE_SS_ACTIVE9,
- };
-
- /**
- * Plasma Turbines
- */
-
- public static BlockIcons[] OVERLAY_PLASMA_TURBINE = new BlockIcons[]{
- LARGETURBINE_TU1,
- LARGETURBINE_TU2,
- LARGETURBINE_TU3,
- LARGETURBINE_TU4,
- LARGETURBINE_TU5,
- LARGETURBINE_TU6,
- LARGETURBINE_TU7,
- LARGETURBINE_TU8,
- LARGETURBINE_TU9,
- };
+ /**
+ * Plasma Turbines
+ */
+ public static BlockIcons[] OVERLAY_PLASMA_TURBINE = new BlockIcons[] {
+ LARGETURBINE_TU1,
+ LARGETURBINE_TU2,
+ LARGETURBINE_TU3,
+ LARGETURBINE_TU4,
+ LARGETURBINE_TU5,
+ LARGETURBINE_TU6,
+ LARGETURBINE_TU7,
+ LARGETURBINE_TU8,
+ LARGETURBINE_TU9,
+ };
- public static BlockIcons[] OVERLAY_PLASMA_TURBINE_ACTIVE = new BlockIcons[]{
- LARGETURBINE_TU_ACTIVE1,
- LARGETURBINE_TU_ACTIVE2,
- LARGETURBINE_TU_ACTIVE3,
- LARGETURBINE_TU_ACTIVE4,
- LARGETURBINE_TU_ACTIVE5,
- LARGETURBINE_TU_ACTIVE6,
- LARGETURBINE_TU_ACTIVE7,
- LARGETURBINE_TU_ACTIVE8,
- LARGETURBINE_TU_ACTIVE9,
- };
+ public static BlockIcons[] OVERLAY_PLASMA_TURBINE_ACTIVE = new BlockIcons[] {
+ LARGETURBINE_TU_ACTIVE1,
+ LARGETURBINE_TU_ACTIVE2,
+ LARGETURBINE_TU_ACTIVE3,
+ LARGETURBINE_TU_ACTIVE4,
+ LARGETURBINE_TU_ACTIVE5,
+ LARGETURBINE_TU_ACTIVE6,
+ LARGETURBINE_TU_ACTIVE7,
+ LARGETURBINE_TU_ACTIVE8,
+ LARGETURBINE_TU_ACTIVE9,
+ };
- public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaSpecialMultiCasings i) {
- final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ public static IIcon handleCasingsGT(
+ final IBlockAccess aWorld,
+ final int xCoord,
+ final int yCoord,
+ final int zCoord,
+ final int aSide,
+ final GregtechMetaSpecialMultiCasings i) {
+ final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- //0 shaft
- //1 LP
- //2 HP
- //3 Gas
- //4 Plasma
+ // 0 shaft
+ // 1 LP
+ // 2 HP
+ // 3 Gas
+ // 4 Plasma
- BlockIcons[] mGetCurrentTextureSet = null;
- BlockIcons[] mGetCurrentTextureSet_ACTIVE = null;
+ BlockIcons[] mGetCurrentTextureSet = null;
+ BlockIcons[] mGetCurrentTextureSet_ACTIVE = null;
+ if (tMeta <= 0 || tMeta >= 5) {
+ return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta);
+ } else {
+ if (tMeta == 1) {
+ mGetCurrentTextureSet = OVERLAY_LP_TURBINE;
+ mGetCurrentTextureSet_ACTIVE = OVERLAY_LP_TURBINE_ACTIVE;
+ } else if (tMeta == 2) {
+ mGetCurrentTextureSet = OVERLAY_HP_TURBINE;
+ mGetCurrentTextureSet_ACTIVE = OVERLAY_HP_TURBINE_ACTIVE;
+ } else if (tMeta == 3) {
+ mGetCurrentTextureSet = OVERLAY_GAS_TURBINE;
+ mGetCurrentTextureSet_ACTIVE = OVERLAY_GAS_TURBINE_ACTIVE;
+ } else if (tMeta == 4) {
+ mGetCurrentTextureSet = OVERLAY_PLASMA_TURBINE;
+ mGetCurrentTextureSet_ACTIVE = OVERLAY_PLASMA_TURBINE_ACTIVE;
+ }
+ if (mGetCurrentTextureSet == null || mGetCurrentTextureSet_ACTIVE == null) {
+ return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta);
+ }
- if (tMeta <= 0 || tMeta >= 5) {
- return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta);
- }
- else {
- if (tMeta == 1) {
- mGetCurrentTextureSet = OVERLAY_LP_TURBINE;
- mGetCurrentTextureSet_ACTIVE = OVERLAY_LP_TURBINE_ACTIVE;
- }
- else if (tMeta == 2) {
- mGetCurrentTextureSet = OVERLAY_HP_TURBINE;
- mGetCurrentTextureSet_ACTIVE = OVERLAY_HP_TURBINE_ACTIVE;
- }
- else if (tMeta == 3) {
- mGetCurrentTextureSet = OVERLAY_GAS_TURBINE;
- mGetCurrentTextureSet_ACTIVE = OVERLAY_GAS_TURBINE_ACTIVE;
- }
- else if (tMeta == 4) {
- mGetCurrentTextureSet = OVERLAY_PLASMA_TURBINE;
- mGetCurrentTextureSet_ACTIVE = OVERLAY_PLASMA_TURBINE_ACTIVE;
- }
- if (mGetCurrentTextureSet == null || mGetCurrentTextureSet_ACTIVE == null) {
- return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta);
- }
+ if ((aSide == 2) || (aSide == 3)) {
+ TileEntity tTileEntity;
+ IMetaTileEntity tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[0].getIcon();
+ }
+ return mGetCurrentTextureSet[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[3].getIcon();
+ }
+ return mGetCurrentTextureSet[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[6].getIcon();
+ }
+ return mGetCurrentTextureSet[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[1].getIcon();
+ }
+ return mGetCurrentTextureSet[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[7].getIcon();
+ }
+ return mGetCurrentTextureSet[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[8].getIcon();
+ }
+ return mGetCurrentTextureSet[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[5].getIcon();
+ }
+ return mGetCurrentTextureSet[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[2].getIcon();
+ }
+ return mGetCurrentTextureSet[2].getIcon();
+ }
+ } else if ((aSide == 4) || (aSide == 5)) {
+ TileEntity tTileEntity;
+ Object tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[0].getIcon();
+ }
+ return mGetCurrentTextureSet[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[3].getIcon();
+ }
+ return mGetCurrentTextureSet[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[6].getIcon();
+ }
+ return mGetCurrentTextureSet[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[1].getIcon();
+ }
+ return mGetCurrentTextureSet[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord)))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[7].getIcon();
+ }
+ return mGetCurrentTextureSet[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[8].getIcon();
+ }
+ return mGetCurrentTextureSet[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[5].getIcon();
+ }
+ return mGetCurrentTextureSet[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1))))
+ && ((tTileEntity instanceof IGregTechTileEntity))
+ && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide)
+ && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()))
+ && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
+ if (isUsingAnimatedTexture(tTileEntity)) {
+ return mGetCurrentTextureSet_ACTIVE[2].getIcon();
+ }
+ return mGetCurrentTextureSet[2].getIcon();
+ }
+ }
+ }
+ return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta);
+ }
+ public static boolean isUsingAnimatedTexture(TileEntity tTileEntity) {
+ boolean aVal = true;
+ IGregTechTileEntity aTile;
+ if (tTileEntity instanceof IGregTechTileEntity) {
+ aTile = (IGregTechTileEntity) tTileEntity;
+ if (aTile != null) {
+ final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity();
+ if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
+ aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity)
+ .getBaseMetaTileEntity()
+ .isActive();
+ // Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status");
+ }
+ }
+ }
+ return aVal;
+ }
-
- if ((aSide == 2) || (aSide == 3)) {
- TileEntity tTileEntity;
- IMetaTileEntity tMetaTileEntity;
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[0].getIcon();
- }
- return mGetCurrentTextureSet[0].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[3].getIcon();
- }
- return mGetCurrentTextureSet[3].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[6].getIcon();
- }
- return mGetCurrentTextureSet[6].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[1].getIcon();
- }
- return mGetCurrentTextureSet[1].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[7].getIcon();
- }
- return mGetCurrentTextureSet[7].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[8].getIcon();
- }
- return mGetCurrentTextureSet[8].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[5].getIcon();
- }
- return mGetCurrentTextureSet[5].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[2].getIcon();
- }
- return mGetCurrentTextureSet[2].getIcon();
- }
- } else if ((aSide == 4) || (aSide == 5)) {
- TileEntity tTileEntity;
- Object tMetaTileEntity;
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[0].getIcon();
- }
- return mGetCurrentTextureSet[0].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[3].getIcon();
- }
- return mGetCurrentTextureSet[3].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[6].getIcon();
- }
- return mGetCurrentTextureSet[6].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[1].getIcon();
- }
- return mGetCurrentTextureSet[1].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[7].getIcon();
- }
- return mGetCurrentTextureSet[7].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[8].getIcon();
- }
- return mGetCurrentTextureSet[8].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[5].getIcon();
- }
- return mGetCurrentTextureSet[5].getIcon();
- }
- if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) {
- if (isUsingAnimatedTexture(tTileEntity)) {
- return mGetCurrentTextureSet_ACTIVE[2].getIcon();
- }
- return mGetCurrentTextureSet[2].getIcon();
- }
- }
- }
- return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta);
- }
-
- public static boolean isUsingAnimatedTexture(TileEntity tTileEntity) {
- boolean aVal = true;
- IGregTechTileEntity aTile;
- if (tTileEntity instanceof IGregTechTileEntity) {
- aTile = (IGregTechTileEntity) tTileEntity;
- if (aTile != null) {
- final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity();
- if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
- aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity).getBaseMetaTileEntity().isActive();
- //Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status");
- }
- }
- }
- return aVal;
- }
-
- public static GT_MetaTileEntity_Hatch_Turbine isTurbineHatch(final IGregTechTileEntity aTileEntity) {
- if (aTileEntity != null) {
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
- return (GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity;
- }
- }
- return null;
- }
-
+ public static GT_MetaTileEntity_Hatch_Turbine isTurbineHatch(final IGregTechTileEntity aTileEntity) {
+ if (aTileEntity != null) {
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
+ return (GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity;
+ }
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java
index bd2df1b8ff..4c6dee9c2f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java
@@ -2,8 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.computer;
import static gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube.sReactorList;
-import java.util.ArrayList;
-
import Ic2ExpReactorPlanner.ComponentFactory;
import gregtech.api.enums.ItemList;
import gregtech.api.objects.GT_ItemStack;
@@ -14,61 +12,97 @@ import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.bartworks.BW_Utils;
import gtPlusPlus.xmod.goodgenerator.GG_Utils;
+import java.util.ArrayList;
import net.minecraft.item.ItemStack;
public class GT_ComputerCube_Setup {
- public static void init() {
- Logger.INFO("[Reactor Simulator] Added " + ComponentFactory.getComponentCount() + " components to ComponentFactory.");
- if (sReactorList == null) {
- sReactorList = new ArrayList<GT_ItemStack>();
-
- String[] aIc2Items = new String[]{
- "reactorUraniumSimple", "reactorUraniumDual", "reactorUraniumQuad", /*"reactorIsotopeCell",*/ "reactorReflector", "reactorReflectorThick", "reactorCoolantSimple",
- "reactorCoolantTriple", "reactorCoolantSix", "reactorCondensator", "reactorCondensatorLap", "reactorPlating", "reactorPlatingHeat", "reactorPlatingExplosive", "reactorVent",
- "reactorVentCore", "reactorVentGold", "reactorVentSpread", "reactorVentDiamond", "reactorHeatSwitch", "reactorHeatSwitchCore", "reactorHeatSwitchSpread",
- "reactorHeatSwitchDiamond", /*"reactorHeatpack",*/
- };
-
- for (String aItem : aIc2Items) {
- ItemStack aStack = GT_ModHandler.getIC2Item(aItem, 1);
- if (!ItemUtils.checkForInvalidItems(aStack)) {
- Logger.INFO("Unable to find IC2 Item: " + aItem);
- CORE.crash("Unable to find IC2 Item: " + aItem);
- }
- else {
- sReactorList.add(new GT_ItemStack(aStack.copy()));
- }
- }
+ public static void init() {
+ Logger.INFO("[Reactor Simulator] Added " + ComponentFactory.getComponentCount()
+ + " components to ComponentFactory.");
+ if (sReactorList == null) {
+ sReactorList = new ArrayList<GT_ItemStack>();
- ItemList[] aGtItems = new ItemList[]{
- ItemList.Neutron_Reflector, ItemList.Moxcell_1, ItemList.Moxcell_2, ItemList.Moxcell_4, /*ItemList.Uraniumcell_1, ItemList.Uraniumcell_2, ItemList.Uraniumcell_4,*/
- ItemList.NaquadahCell_1, ItemList.NaquadahCell_2, ItemList.NaquadahCell_4, ItemList.ThoriumCell_1, ItemList.ThoriumCell_2, ItemList.ThoriumCell_4, ItemList.MNqCell_1,
- ItemList.MNqCell_2, ItemList.MNqCell_4, ItemList.Reactor_Coolant_He_1, ItemList.Reactor_Coolant_He_3, ItemList.Reactor_Coolant_He_6, ItemList.Reactor_Coolant_NaK_1,
- ItemList.Reactor_Coolant_NaK_3, ItemList.Reactor_Coolant_NaK_6, ItemList.Reactor_Coolant_Sp_1, ItemList.Reactor_Coolant_Sp_2, ItemList.Reactor_Coolant_Sp_3,
- ItemList.Reactor_Coolant_Sp_6
- };
+ String[] aIc2Items = new String[] {
+ "reactorUraniumSimple",
+ "reactorUraniumDual",
+ "reactorUraniumQuad", /*"reactorIsotopeCell",*/
+ "reactorReflector",
+ "reactorReflectorThick",
+ "reactorCoolantSimple",
+ "reactorCoolantTriple",
+ "reactorCoolantSix",
+ "reactorCondensator",
+ "reactorCondensatorLap",
+ "reactorPlating",
+ "reactorPlatingHeat",
+ "reactorPlatingExplosive",
+ "reactorVent",
+ "reactorVentCore",
+ "reactorVentGold",
+ "reactorVentSpread",
+ "reactorVentDiamond",
+ "reactorHeatSwitch",
+ "reactorHeatSwitchCore",
+ "reactorHeatSwitchSpread",
+ "reactorHeatSwitchDiamond", /*"reactorHeatpack",*/
+ };
- for (ItemList aItem : aGtItems) {
- sReactorList.add(new GT_ItemStack(aItem.get(1)));
- }
+ for (String aItem : aIc2Items) {
+ ItemStack aStack = GT_ModHandler.getIC2Item(aItem, 1);
+ if (!ItemUtils.checkForInvalidItems(aStack)) {
+ Logger.INFO("Unable to find IC2 Item: " + aItem);
+ CORE.crash("Unable to find IC2 Item: " + aItem);
+ } else {
+ sReactorList.add(new GT_ItemStack(aStack.copy()));
+ }
+ }
- if (LoadedMods.BartWorks) {
- ArrayList<ItemStack> aBartReactorItems = BW_Utils.getAll(1);
- for (ItemStack aReactorItem : aBartReactorItems) {
- sReactorList.add(new GT_ItemStack(aReactorItem));
- }
- }
+ ItemList[] aGtItems = new ItemList[] {
+ ItemList.Neutron_Reflector,
+ ItemList.Moxcell_1,
+ ItemList.Moxcell_2,
+ ItemList.Moxcell_4, /*ItemList.Uraniumcell_1, ItemList.Uraniumcell_2, ItemList.Uraniumcell_4,*/
+ ItemList.NaquadahCell_1,
+ ItemList.NaquadahCell_2,
+ ItemList.NaquadahCell_4,
+ ItemList.ThoriumCell_1,
+ ItemList.ThoriumCell_2,
+ ItemList.ThoriumCell_4,
+ ItemList.MNqCell_1,
+ ItemList.MNqCell_2,
+ ItemList.MNqCell_4,
+ ItemList.Reactor_Coolant_He_1,
+ ItemList.Reactor_Coolant_He_3,
+ ItemList.Reactor_Coolant_He_6,
+ ItemList.Reactor_Coolant_NaK_1,
+ ItemList.Reactor_Coolant_NaK_3,
+ ItemList.Reactor_Coolant_NaK_6,
+ ItemList.Reactor_Coolant_Sp_1,
+ ItemList.Reactor_Coolant_Sp_2,
+ ItemList.Reactor_Coolant_Sp_3,
+ ItemList.Reactor_Coolant_Sp_6
+ };
- if (LoadedMods.GoodGenerator) {
- ArrayList<ItemStack> aGlodReactorItems = GG_Utils.getAll(1);
- for (ItemStack aReactorItem : aGlodReactorItems) {
- sReactorList.add(new GT_ItemStack(aReactorItem));
- }
- }
- Logger.INFO("[Reactor Simulator] Added " + sReactorList.size() + " components to GT_TileEntity_ComputerCube.");
+ for (ItemList aItem : aGtItems) {
+ sReactorList.add(new GT_ItemStack(aItem.get(1)));
+ }
- }
- }
+ if (LoadedMods.BartWorks) {
+ ArrayList<ItemStack> aBartReactorItems = BW_Utils.getAll(1);
+ for (ItemStack aReactorItem : aBartReactorItems) {
+ sReactorList.add(new GT_ItemStack(aReactorItem));
+ }
+ }
+ if (LoadedMods.GoodGenerator) {
+ ArrayList<ItemStack> aGlodReactorItems = GG_Utils.getAll(1);
+ for (ItemStack aReactorItem : aGlodReactorItems) {
+ sReactorList.add(new GT_ItemStack(aReactorItem));
+ }
+ }
+ Logger.INFO(
+ "[Reactor Simulator] Added " + sReactorList.size() + " components to GT_TileEntity_ComputerCube.");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java
index fedb4e6028..18ae44ab79 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java
@@ -1,194 +1,534 @@
package gtPlusPlus.xmod.gregtech.common.computer;
-import java.util.ArrayList;
-
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import java.util.ArrayList;
import net.minecraft.item.ItemStack;
public class GT_Computercube_Description {
- public static ArrayList<GT_Computercube_Description> sDescriptions = new ArrayList<GT_Computercube_Description>();
-
- public String[] mDescription;
-
- public ItemStack[] mStacks;
-
- public GT_Computercube_Description(String[] aDescription, ItemStack[] aStacks) {
- this.mDescription = aDescription;
- this.mStacks = aStacks;
- sDescriptions.add(this);
- }
-
- public static void addStandardDescriptions() {
- Logger.INFO("Adding Default Description Set of the Computer Cube");
- new GT_Computercube_Description(new String[] {
- "Lightning Rod", "Also known as the Bane of", "Alblaka. The Lightning Rod", "enables you to gain Energy", "from Lightning! To set it up", "you just need the Block", "itself, 4 HV-Transformers", "and a crapton of Ironfences,", "which you then place on top", "of it. After that you have to",
- "wait for a Thunderstorm and", "when you are lucky you get", "2.5 MFSU of Energy out of", "it. If a Rod is high enough", "then Rain is also enough to", "get stroke, but with less", "probability ofcourse." }, new ItemStack[] {
- GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), ItemList.Machine_IV_LightningRod.get(1), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Quantum Chest", "You want to store tons of", "Materials into your Chests", "but you hate the Item limit", "of them? Not anymore! The", "Quantum Chest is able to", "store an INFINITE* amount", "of one single Item type per", "Chest.", "This Chest stores your Items",
- "like Data and ever has a", "Stack of the Item ready for", "extraction. It is compatible", "with any Item that doesnt", "have a NBT-Tag. You ask what", "NBT is? I know it, thats enough.", "Up to 2147483391*" }, new ItemStack[] {
- ItemList.Quantum_Chest_IV.get(1), ItemList.Quantum_Chest_EV.get(1), ItemList.Quantum_Chest_HV.get(1), ItemList.Quantum_Chest_MV.get(1), ItemList.Quantum_Chest_LV.get(1), null,
- null, null, null, null, null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Quantum Tank", "You want to store tons of", "Fluids into your Tanks", "but you hate the capacity", "of them? Not anymore! The", "Quantum Tank is able to", "store an INFINITE* amount", "of one single Fluid type per", "Tank.", "This Tank stores your Fluids",
- "like Data and ever has a", "Stack of the Fluid ready for", "extraction. It is compatible", "with any Fluid. ", "You ask what", "NBT is? I know it, thats enough.", "* = 2147483391" }, new ItemStack[] {
- ItemList.Quantum_Tank_IV.get(1), ItemList.Quantum_Tank_EV.get(1), ItemList.Quantum_Tank_HV.get(1), ItemList.Quantum_Tank_MV.get(1), ItemList.Quantum_Tank_LV.get(1), null,
- null, null, null, null, null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Computer Cube", "The Device you are", "currently using. This Computer", "is running the G.L.A.D.-OS,", "which is containing many", "usefull Apps:", "- Reactor Planner", "- Seedbag Scanner", "- Recipelists for GT-Devices", "- ",
- "- ", "- ", "- ", "- ", "And the Description List you", "are currently reading.", "~This Device has private Access~" }, new ItemStack[] {
- null, null, null, null, GregtechItemList.Gregtech_Computer_Cube_Machine.get(1), null, null, null, null, null,
- null, null, null, null });
- /* new GT_Computercube_Description(new String[] {
- "UUM-Assembler", "It's like an automatic", "Crafting Table just for UUM", "It can store 20 UUM-Recipes", "and produces those on demand", "It costs 512EU per used piece", "of Universal-Usable-Matter(TM).", "The integrated Quantum Chest", "allows it to store all your", "UUM inside it.",
- "Top and Bottom are for Input,", "while the Output is on the", "Sides. The Output is designed,", "to work with RP-Managers, so", "build it into your recursive", "Autocraftingsystem.", "" }, new ItemStack[] {
- null, null, null, GT_ModHandler.getIC2Item("matter", 1), new ItemStack(GregTech_API.sBlockList[1], 1, 5), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Sonictron", "You like Music? Then the", "Sonictron 9001 is your best", "choice! You can compose Alarms,", "Doorbell Sounds or boring", "Elevator Music, with the 64 Slots", "inside it. Just leftclick them", "to switch the Sound, rightclick", "them to switch the modulation", "and shiftclick to remove it.",
- "Then apply Redstone to play", "With the mobile Version you can", "play sounds everywhere, after", "you copied them from a normal", "Sonictron via rightclicking", "Sneakrightclicking pastes", "Emits Redstone when finished." }, new ItemStack[] {
- null, null, null, GregTech_API.getGregTechItem(32, 1, 0), new ItemStack(GregTech_API.sBlockList[1], 1, 6), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "L.E.S.U.", "The unlaggiest Multiblock ever!", "One Controllerblock, and as many", "'stupid' Storageblocks as you want.", "To use it, place one Controller", "and then place the LESU-Storages", "adjacent to it or other placed", "LESU-Storages. The Tier (max EU/t)", "of it depends on the amount of", "adjacent Storages. The",
- "Storageblocks are NOT TileEntities,", "what means that they cause as much", "Lag as a random Dirtblock. And the", "Controller Block only checks ONCE", "for the Storages, so no", "Blockiterationlag, AT. ALL. Anyone,", "who says that they lag gets murdered!" }, new ItemStack[] {
- null, null, null, new ItemStack(GregTech_API.sBlockList[0], 1, 6), new ItemStack(GregTech_API.sBlockList[1], 1, 7), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "I.D.S.U.", "The Interdimensional Storage Unit", "is a Device, which is like a", "wireless, crossdimensional and", "enderchestlike EU-Storage Block", "", "Every Player has one Network of", "these. The ID is determined by", "the Hashcode of the Name from the", "first Player, who opens it's GUI",
- "", "It stores up to 1 Billion EU", "and emits EV. But you need at", "least two of them for Energy", "Transfer", "", "" }, new ItemStack[] {
- null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 8), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "A.E.S.U.", "The Adjustable Energy Storage Unit", "is like 10 MFSU and has an", "adjustable Output between 0 and", "2048EU/t. You could use it as a", "Transformer. It is Tier-IV, so", "it's basically needed to charge", "Energy Orbs and Lapotron Packs", "", "Not much else to say about it.",
- "", "", "", "", "", "", "" }, new ItemStack[] {
- null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 9), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Charge-O-Mat", "An automatable Charging Bench", "It puts (de-)charged Tools into", "the right Outputslots, which are", "accessible on the Sides of it.", "", "The Energy Orb inside stores enough", "to charge your QSuit almost instantly", "", "This is a Tier-V Charging Station",
- "even when the Max-IN/OUT is only", "2048EU/t. It also charges your Armor", "when you are standing close to it.", "", "If you apply Redstone, then it", "decharges instead.", "" }, new ItemStack[] {
- null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 10), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Centrifuge", "This is a Machine to seperate", "Isotopes.", "", "It has a maximum Consumption Rate", "of 5EU/t, and its Maxinput is", "32EU/t. The time it needs depends", "on the Recipe you use.", "", "It needs Tin Cells for some Recipes,",
- "which you put in the Top Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "", "You can pipe Lava into this Device" }, new ItemStack[] {
- null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 11), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Electrolyzer", "This is a Machine to seperate", "Molecules and electrolyze", "Watercells.", "", "It has a maximum Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs depends", "on the Recipe you use.", "",
- "It needs Tin Cells for some Recipes,", "which you put in the Bottom Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "" }, new ItemStack[] {
- null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 25), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Grinder", "This Machines purpose is to", "macerate and grind Ores.", "It can ONLY grind Ores, don't", "try regular Macerator Recipes.", "It has a fixed Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs is", "5 seconds per Ore Block", "It needs Water for most Recipes,",
- "which you put in the Bottom Left Slot", "Top = Input", "Bottom = Water", "Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
- null, new ItemStack(Block.field_71943_B, 1), new ItemStack(GregTech_API.sBlockList[0], 1, 14), new ItemStack(GregTech_API.sBlockList[0], 1, 13), new ItemStack(GregTech_API.sBlockList[1], 1, 28), null, null, null, null, null,
- null, null, null, null });*/
- new GT_Computercube_Description(new String[] {
- "Electric Blast Furnace", "You may know the Blast Furnace", "of Railcraft. This one works", "similar, as it can also produce", "Steel out of Iron and Coal.", "", "Its heat Capacity depends on the", "used Machine Casings for building", "it. The better they are, the more", "Heat it can achieve.",
- "", "Top = Input 1", "Bottom = Input 2", "Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
- null, null, null, ItemList.Casing_HeatProof.get(1), ItemList.Machine_Multi_BlastFurnace.get(1), ItemList.Casing_Coil_Cupronickel.get(1), ItemList.Casing_Coil_Kanthal.get(1), ItemList.Casing_Coil_Nichrome.get(1), ItemList.Casing_Coil_TungstenSteel.get(1), ItemList.Casing_Coil_HSSG.get(1),
- ItemList.Casing_Coil_HSSS.get(1), ItemList.Casing_Coil_Naquadah.get(1), ItemList.Casing_Coil_NaquadahAlloy.get(1), null });
- /* new GT_Computercube_Description(new String[] {
- "Sawmill", "This Device turns your Logs", "into more Planks, than a normal", "Steve can produce with his Hands.", "", "Its byproduct, Wood Pulp, can be", "compressed into special Planks,", "which are burning like Charcoal.", "", "It needs Water for most Recipes,",
- "which you put in the Bottom Left Slot", "Top = Input", "Water Sides = Water", "Saw Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
- null, null, GT_MetaItem_Material.instance.getStack(15, 1), GT_MetaItem_Dust.instance.getStack(15, 1), new ItemStack(GregTech_API.sBlockList[1], 1, 32), null, null, null, null, null,
- null, null, null, null });*/
- new GT_Computercube_Description(new String[] {
- "Implosion Compressor", "You need to turn Dusts back", "into Gems? Or do you just want", "to make Iridium Plates?", "With a bit ITNT you can achieve", "that in this Device!", "", "We strongly recommend to use", "Flint Dust instead of Flints", "for making the ITNT.",
- "", "Top = Input", "Explosion Sides = Output", "ITNT Side = ITNT Input", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
- null, null, null, GT_ModHandler.getIC2Item("industrialTnt", 1, new ItemStack(net.minecraft.init.Blocks.tnt, 1)), ItemList.Machine_Multi_ImplosionCompressor.get(1), null, null, null, null, null,
- null, null, null, null });
- /* new GT_Computercube_Description(new String[] {
- "Superconductor", "Expensive, but superconducting", "nearly infinite EU/p and it has", "no Cableloss!", "Do not confuse this with the", "Superconductor Item!", "", "Supercondensator", "This is a special kind of Transformer", "It allows you to convert anything down",
- "to 8192 EU/t, what is like a normal HVT.", "But if you apply Redstone to it then it", "outputs friggin 1000000EU/t!!!", "", "You also need it for the Fusion Reactor.", "Some Machines will require that high", "Voltage in a short period of time." }, new ItemStack[] {
- null, null, GregTech_API.getGregTechItem(3, 1, 2), new ItemStack(GregTech_API.sBlockList[1], 1, 12), new ItemStack(GregTech_API.sBlockList[1], 1, 15), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Player Detector", "This nice little Device is able", "to detect Players in a Range of", "16-Spherical Meters and a", "EU-Consumption of 2.5EU/t.", "", "It can be switched to 3 Diffrent", "Modes, to detect YOURSELF, OTHERS", "and ALL Players by Rightclicking it.", "",
- "It doesnt detect regular Mobs.", "", "", "", "", "", "~This Device has private Access~" }, new ItemStack[] {
- null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 13), null, null, null, null, null,
- null, null, null, null });*/
- new GT_Computercube_Description(new String[] {
- "Matter Fabricator", "The Matter Fabricator is nothing", "else than a Mass Fabricator, which", "can ONLY run on Scrap and other", "Amplifiers.", "", "With the Default Config it is 100", "times more expensive than normal.", "Of course you can set the Config", "to 166666, to get your normal",
- "Massfabricationrate back, or you", "could make Mass Fabrication even", "cheaper, if you really want to", "make Mass Fabrication that easy", "", "", "" }, new ItemStack[] {
- null, null, null, GT_Utility.getFluidDisplayStack(FluidUtils.getUUM(1), false), ItemList.Machine_LV_Massfab.get(1), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Electric Autocrafting Tables", "These are Crafting Tables for the", "common need of autocrafting in", "Factories. One Craft needs 5000EU to", "be performed, so you have actually to", "lay Wires to it. This Table is", "unique as its also able, to give you", "the used Capsulecellcontainers, made", "by Industrial Corp, back.", "You may use that behaviour to",
- "craft anything releated to chemics,", "like the 2xKNO3-Recipe for Saltpeter.", "The 5 Modes are the following:", "1. Craft Recipe, 2. All 5 Modes", "3. Craft all as single Items", "4. 2x2-Grid and 5. a 3x3-Grid.", "It accepts only 32EU/p as Input." }, new ItemStack[] {
- null, null, null, null, GregtechItemList.GT4_Electric_Auto_Workbench_LV.get(1), null, null, null, null, null,
- null, null, null, null });
- /* new GT_Computercube_Description(new String[] {
- "Automation with GregTech", "Translocators and Buffers are the", "newest Way to automate your Machines.", "Screw Buildcraft, these EU-wasting", "Devices are much more awesome.", "They output 32EU/t to their directed", "IN- and OUT-puts, making them usefull", "for things, like saving wires.", "Translocators are taking Stuff from", "the Block at their green Inputfacing",
- "and putting it into the Block at the", "red Outputfacing. Buffers do the same,", "but the grab Items from their own", "Inventory, what makes them usefull", "as Pipe-replacement.", "Buffers also have Redstone Intelligence,", "which you can configure in their GUI." }, new ItemStack[] {
- null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 19), new ItemStack(GregTech_API.sBlockList[1], 1, 18), new ItemStack(GregTech_API.sBlockList[1], 1, 17), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Silver Ore", "It's rarity is similar to Gold", "Silver can be used, to make", "Circuits cheaper, or you can use", "it for Redpowerstuff.", "", "", "", "", "",
- "", "", "", "", "", "", "" }, new ItemStack[] {
- null, null, GT_OreDictUnificator.get("dustSilver", 1), GregTech_API.getGregTechItem(0, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 1), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Sapphires and Rubys", "These spawn exactly like Emeralds.", "But Rubies are found in Deserts,", "while Sapphires can be found in", "Oceans.", "", "They currently make only a cheaper", "Recipe for Energycrystals and", "Lapotroncrystals, but they are", "Redpower Compatible.",
- "", "They also sometimes drop random", "other Gems, like Garnet for Ruby", "or green Sapphire for Sapphire", "in addition.", "", "" }, new ItemStack[] {
- null, GregTech_API.getGregTechItem(0, 1, 32), new ItemStack(GregTech_API.sBlockList[2], 1, 3), GregTech_API.getGregTechItem(0, 1, 33), new ItemStack(GregTech_API.sBlockList[2], 1, 4), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Bauxite Ore", "The Stuff out of which you can", "produce Aluminium and also", "Titanium.", "You find this Ore in Plains and", "Forests.", "", "If you think Aluminium is useless", "then note, that mobs NEVER spawn", "ontop of an Aluminium Block",
- "(Same applies also for Silver-,", "Gem- and Iridium Blocks)", "Production Chain:", "macerating Bauxite Ore", "electrolyzing 24 Bauxite Dust", "smelting Aluminium Dust in a", "Blast Furnace" }, new ItemStack[] {
- new ItemStack(GregTech_API.sBlockList[0], 1, 7), GregTech_API.getGregTechItem(0, 1, 18), GregTech_API.getGregTechItem(1, 1, 18), GregTech_API.getGregTechItem(1, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Titanium", "Produced by centrifuging Bauxitedust", "as a byproduct, this Material can make", "anything much more resistant against", "damage, like Explosions.", "Blocks made of Titaniumingots have a", "large Blastresistance", "", "It can also be used to craft tons of", "mixed Metal Ingots",
- "", "", "", "", "", "", "" }, new ItemStack[] {
- new ItemStack(GregTech_API.sBlockList[0], 1, 8), GregTech_API.getGregTechItem(0, 1, 19), GregTech_API.getGregTechItem(1, 1, 19), GregTech_API.getGregTechItem(1, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Iridium Ore", "You can find it only when you", "stripmine very large Areas with", "Quarries and such. There is only", "one in every 5th-10th Chunk.", "It's even more rare in Oceans!", "", "Some people disable the UUM-Recipe", "for Iridium, for making getting it", "an Achievement.",
- "", "However Iridium Ore contains traces", "of Platinum, so it's best to use the", "Industrial Grinder for this Ore.", "", "", "" }, new ItemStack[] {
- null, null, GT_OreDictUnificator.get("plateAlloyIridium", 1), GT_ModHandler.getIC2Item("iridiumOre", 1), new ItemStack(GregTech_API.sBlockList[2], 1, 2), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Helium Coolant Cell", "These are just cheaper, than the", "Water based Coolant Cells, and can", "also hold six times more Heat.", "", "Helium Cells can also be used for", "making Luminators and Mininglasers", "", "", "",
- "", "", "", "", "", "", "" }, new ItemStack[] {
- GregTech_API.getGregTechItem(2, 1, 6), GregTech_API.getGregTechItem(2, 1, 3), GregTech_API.getGregTechItem(34, 1, 0), GregTech_API.getGregTechItem(35, 1, 0), GregTech_API.getGregTechItem(36, 1, 0), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Destructopack", "Open its GUI via rightclick and", "dump all the useless Stuff from", "your Inventory into it, instead of", "littering Items into the World.", "", "", "", "", "",
- "", "", "", "", "", "", "" }, new ItemStack[] {
- null, null, null, null, GregTech_API.getGregTechItem(33, 1, 0), null, null, null, null, null,
- null, null, null, null });*/
- new GT_Computercube_Description(new String[] {
- "Data Orbs", "They store Data.", "", "Rightclick on a Computer Cube, to", "extract a Reactorplan", "", "Sneak-Rightclick on it, to insert", "a Reactorplan", "", "Works also with Sonictrons",
- "", "", "", "", "", "", "" }, new ItemStack[] {
- null, null, null, null, ItemList.Tool_DataOrb.get(1), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Energy Orbs", "100 Million EU in one Orb!", "", "This is a Tier-IV-Energystorage", "So a MFSU is not enough for it!", "", "Use it to create a Lapotron Pack,", "which is like an ultimate Lap Pack!", "", "",
- "", "", "", "", "", "", "" }, new ItemStack[] {
- null, null, null, null, ItemList.Energy_LapotronicOrb.get(1), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Iridium Neutron Reflector", "It's used for Fusion Reactor Coils,", "and works like a normal one", "inside a Reactor, but it's also", "INDESTRUCTIBLE*.", "", "", "", "", "",
- "", "", "", "", "", "", "* = for weardown" }, new ItemStack[] {
- null, null, null, null, ItemList.Neutron_Reflector.get(1), null, null, null, null, null,
+ public static ArrayList<GT_Computercube_Description> sDescriptions = new ArrayList<GT_Computercube_Description>();
+
+ public String[] mDescription;
+
+ public ItemStack[] mStacks;
+
+ public GT_Computercube_Description(String[] aDescription, ItemStack[] aStacks) {
+ this.mDescription = aDescription;
+ this.mStacks = aStacks;
+ sDescriptions.add(this);
+ }
+
+ public static void addStandardDescriptions() {
+ Logger.INFO("Adding Default Description Set of the Computer Cube");
+ new GT_Computercube_Description(
+ new String[] {
+ "Lightning Rod",
+ "Also known as the Bane of",
+ "Alblaka. The Lightning Rod",
+ "enables you to gain Energy",
+ "from Lightning! To set it up",
+ "you just need the Block",
+ "itself, 4 HV-Transformers",
+ "and a crapton of Ironfences,",
+ "which you then place on top",
+ "of it. After that you have to",
+ "wait for a Thunderstorm and",
+ "when you are lucky you get",
+ "2.5 MFSU of Energy out of",
+ "it. If a Rod is high enough",
+ "then Rain is also enough to",
+ "get stroke, but with less",
+ "probability ofcourse."
+ },
+ new ItemStack[] {
+ GT_ModHandler.getIC2Item("ironFence", 1),
+ GT_ModHandler.getIC2Item("ironFence", 1),
+ GT_ModHandler.getIC2Item("ironFence", 1),
+ GT_ModHandler.getIC2Item("ironFence", 1),
+ ItemList.Machine_IV_LightningRod.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ new GT_Computercube_Description(
+ new String[] {
+ "Quantum Chest",
+ "You want to store tons of",
+ "Materials into your Chests",
+ "but you hate the Item limit",
+ "of them? Not anymore! The",
+ "Quantum Chest is able to",
+ "store an INFINITE* amount",
+ "of one single Item type per",
+ "Chest.",
+ "This Chest stores your Items",
+ "like Data and ever has a",
+ "Stack of the Item ready for",
+ "extraction. It is compatible",
+ "with any Item that doesnt",
+ "have a NBT-Tag. You ask what",
+ "NBT is? I know it, thats enough.",
+ "Up to 2147483391*"
+ },
+ new ItemStack[] {
+ ItemList.Quantum_Chest_IV.get(1),
+ ItemList.Quantum_Chest_EV.get(1),
+ ItemList.Quantum_Chest_HV.get(1),
+ ItemList.Quantum_Chest_MV.get(1),
+ ItemList.Quantum_Chest_LV.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ new GT_Computercube_Description(
+ new String[] {
+ "Quantum Tank",
+ "You want to store tons of",
+ "Fluids into your Tanks",
+ "but you hate the capacity",
+ "of them? Not anymore! The",
+ "Quantum Tank is able to",
+ "store an INFINITE* amount",
+ "of one single Fluid type per",
+ "Tank.",
+ "This Tank stores your Fluids",
+ "like Data and ever has a",
+ "Stack of the Fluid ready for",
+ "extraction. It is compatible",
+ "with any Fluid. ",
+ "You ask what",
+ "NBT is? I know it, thats enough.",
+ "* = 2147483391"
+ },
+ new ItemStack[] {
+ ItemList.Quantum_Tank_IV.get(1),
+ ItemList.Quantum_Tank_EV.get(1),
+ ItemList.Quantum_Tank_HV.get(1),
+ ItemList.Quantum_Tank_MV.get(1),
+ ItemList.Quantum_Tank_LV.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ new GT_Computercube_Description(
+ new String[] {
+ "Computer Cube",
+ "The Device you are",
+ "currently using. This Computer",
+ "is running the G.L.A.D.-OS,",
+ "which is containing many",
+ "usefull Apps:",
+ "- Reactor Planner",
+ "- Seedbag Scanner",
+ "- Recipelists for GT-Devices",
+ "- ",
+ "- ",
+ "- ",
+ "- ",
+ "- ",
+ "And the Description List you",
+ "are currently reading.",
+ "~This Device has private Access~"
+ },
+ new ItemStack[] {
+ null,
+ null,
+ null,
+ null,
+ GregtechItemList.Gregtech_Computer_Cube_Machine.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ /* new GT_Computercube_Description(new String[] {
+ "UUM-Assembler", "It's like an automatic", "Crafting Table just for UUM", "It can store 20 UUM-Recipes", "and produces those on demand", "It costs 512EU per used piece", "of Universal-Usable-Matter(TM).", "The integrated Quantum Chest", "allows it to store all your", "UUM inside it.",
+ "Top and Bottom are for Input,", "while the Output is on the", "Sides. The Output is designed,", "to work with RP-Managers, so", "build it into your recursive", "Autocraftingsystem.", "" }, new ItemStack[] {
+ null, null, null, GT_ModHandler.getIC2Item("matter", 1), new ItemStack(GregTech_API.sBlockList[1], 1, 5), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Sonictron", "You like Music? Then the", "Sonictron 9001 is your best", "choice! You can compose Alarms,", "Doorbell Sounds or boring", "Elevator Music, with the 64 Slots", "inside it. Just leftclick them", "to switch the Sound, rightclick", "them to switch the modulation", "and shiftclick to remove it.",
+ "Then apply Redstone to play", "With the mobile Version you can", "play sounds everywhere, after", "you copied them from a normal", "Sonictron via rightclicking", "Sneakrightclicking pastes", "Emits Redstone when finished." }, new ItemStack[] {
+ null, null, null, GregTech_API.getGregTechItem(32, 1, 0), new ItemStack(GregTech_API.sBlockList[1], 1, 6), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "L.E.S.U.", "The unlaggiest Multiblock ever!", "One Controllerblock, and as many", "'stupid' Storageblocks as you want.", "To use it, place one Controller", "and then place the LESU-Storages", "adjacent to it or other placed", "LESU-Storages. The Tier (max EU/t)", "of it depends on the amount of", "adjacent Storages. The",
+ "Storageblocks are NOT TileEntities,", "what means that they cause as much", "Lag as a random Dirtblock. And the", "Controller Block only checks ONCE", "for the Storages, so no", "Blockiterationlag, AT. ALL. Anyone,", "who says that they lag gets murdered!" }, new ItemStack[] {
+ null, null, null, new ItemStack(GregTech_API.sBlockList[0], 1, 6), new ItemStack(GregTech_API.sBlockList[1], 1, 7), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "I.D.S.U.", "The Interdimensional Storage Unit", "is a Device, which is like a", "wireless, crossdimensional and", "enderchestlike EU-Storage Block", "", "Every Player has one Network of", "these. The ID is determined by", "the Hashcode of the Name from the", "first Player, who opens it's GUI",
+ "", "It stores up to 1 Billion EU", "and emits EV. But you need at", "least two of them for Energy", "Transfer", "", "" }, new ItemStack[] {
+ null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 8), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "A.E.S.U.", "The Adjustable Energy Storage Unit", "is like 10 MFSU and has an", "adjustable Output between 0 and", "2048EU/t. You could use it as a", "Transformer. It is Tier-IV, so", "it's basically needed to charge", "Energy Orbs and Lapotron Packs", "", "Not much else to say about it.",
+ "", "", "", "", "", "", "" }, new ItemStack[] {
+ null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 9), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Charge-O-Mat", "An automatable Charging Bench", "It puts (de-)charged Tools into", "the right Outputslots, which are", "accessible on the Sides of it.", "", "The Energy Orb inside stores enough", "to charge your QSuit almost instantly", "", "This is a Tier-V Charging Station",
+ "even when the Max-IN/OUT is only", "2048EU/t. It also charges your Armor", "when you are standing close to it.", "", "If you apply Redstone, then it", "decharges instead.", "" }, new ItemStack[] {
+ null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 10), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Centrifuge", "This is a Machine to seperate", "Isotopes.", "", "It has a maximum Consumption Rate", "of 5EU/t, and its Maxinput is", "32EU/t. The time it needs depends", "on the Recipe you use.", "", "It needs Tin Cells for some Recipes,",
+ "which you put in the Top Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "", "You can pipe Lava into this Device" }, new ItemStack[] {
+ null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 11), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Electrolyzer", "This is a Machine to seperate", "Molecules and electrolyze", "Watercells.", "", "It has a maximum Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs depends", "on the Recipe you use.", "",
+ "It needs Tin Cells for some Recipes,", "which you put in the Bottom Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "" }, new ItemStack[] {
+ null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 25), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Grinder", "This Machines purpose is to", "macerate and grind Ores.", "It can ONLY grind Ores, don't", "try regular Macerator Recipes.", "It has a fixed Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs is", "5 seconds per Ore Block", "It needs Water for most Recipes,",
+ "which you put in the Bottom Left Slot", "Top = Input", "Bottom = Water", "Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
+ null, new ItemStack(Block.field_71943_B, 1), new ItemStack(GregTech_API.sBlockList[0], 1, 14), new ItemStack(GregTech_API.sBlockList[0], 1, 13), new ItemStack(GregTech_API.sBlockList[1], 1, 28), null, null, null, null, null,
+ null, null, null, null });*/
+ new GT_Computercube_Description(
+ new String[] {
+ "Electric Blast Furnace",
+ "You may know the Blast Furnace",
+ "of Railcraft. This one works",
+ "similar, as it can also produce",
+ "Steel out of Iron and Coal.",
+ "",
+ "Its heat Capacity depends on the",
+ "used Machine Casings for building",
+ "it. The better they are, the more",
+ "Heat it can achieve.",
+ "",
+ "Top = Input 1",
+ "Bottom = Input 2",
+ "Side = Output",
+ "Its a lagfree Multiblock Structure,",
+ "so you need a special Machine Casing",
+ "for this Device. (see GUI)"
+ },
+ new ItemStack[] {
+ null,
+ null,
+ null,
+ ItemList.Casing_HeatProof.get(1),
+ ItemList.Machine_Multi_BlastFurnace.get(1),
+ ItemList.Casing_Coil_Cupronickel.get(1),
+ ItemList.Casing_Coil_Kanthal.get(1),
+ ItemList.Casing_Coil_Nichrome.get(1),
+ ItemList.Casing_Coil_TungstenSteel.get(1),
+ ItemList.Casing_Coil_HSSG.get(1),
+ ItemList.Casing_Coil_HSSS.get(1),
+ ItemList.Casing_Coil_Naquadah.get(1),
+ ItemList.Casing_Coil_NaquadahAlloy.get(1),
+ null
+ });
+ /* new GT_Computercube_Description(new String[] {
+ "Sawmill", "This Device turns your Logs", "into more Planks, than a normal", "Steve can produce with his Hands.", "", "Its byproduct, Wood Pulp, can be", "compressed into special Planks,", "which are burning like Charcoal.", "", "It needs Water for most Recipes,",
+ "which you put in the Bottom Left Slot", "Top = Input", "Water Sides = Water", "Saw Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] {
+ null, null, GT_MetaItem_Material.instance.getStack(15, 1), GT_MetaItem_Dust.instance.getStack(15, 1), new ItemStack(GregTech_API.sBlockList[1], 1, 32), null, null, null, null, null,
+ null, null, null, null });*/
+ new GT_Computercube_Description(
+ new String[] {
+ "Implosion Compressor",
+ "You need to turn Dusts back",
+ "into Gems? Or do you just want",
+ "to make Iridium Plates?",
+ "With a bit ITNT you can achieve",
+ "that in this Device!",
+ "",
+ "We strongly recommend to use",
+ "Flint Dust instead of Flints",
+ "for making the ITNT.",
+ "",
+ "Top = Input",
+ "Explosion Sides = Output",
+ "ITNT Side = ITNT Input",
+ "Its a lagfree Multiblock Structure,",
+ "so you need a special Machine Casing",
+ "for this Device. (see GUI)"
+ },
+ new ItemStack[] {
+ null,
+ null,
+ null,
+ GT_ModHandler.getIC2Item("industrialTnt", 1, new ItemStack(net.minecraft.init.Blocks.tnt, 1)),
+ ItemList.Machine_Multi_ImplosionCompressor.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ /* new GT_Computercube_Description(new String[] {
+ "Superconductor", "Expensive, but superconducting", "nearly infinite EU/p and it has", "no Cableloss!", "Do not confuse this with the", "Superconductor Item!", "", "Supercondensator", "This is a special kind of Transformer", "It allows you to convert anything down",
+ "to 8192 EU/t, what is like a normal HVT.", "But if you apply Redstone to it then it", "outputs friggin 1000000EU/t!!!", "", "You also need it for the Fusion Reactor.", "Some Machines will require that high", "Voltage in a short period of time." }, new ItemStack[] {
+ null, null, GregTech_API.getGregTechItem(3, 1, 2), new ItemStack(GregTech_API.sBlockList[1], 1, 12), new ItemStack(GregTech_API.sBlockList[1], 1, 15), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Player Detector", "This nice little Device is able", "to detect Players in a Range of", "16-Spherical Meters and a", "EU-Consumption of 2.5EU/t.", "", "It can be switched to 3 Diffrent", "Modes, to detect YOURSELF, OTHERS", "and ALL Players by Rightclicking it.", "",
+ "It doesnt detect regular Mobs.", "", "", "", "", "", "~This Device has private Access~" }, new ItemStack[] {
+ null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 13), null, null, null, null, null,
+ null, null, null, null });*/
+ new GT_Computercube_Description(
+ new String[] {
+ "Matter Fabricator",
+ "The Matter Fabricator is nothing",
+ "else than a Mass Fabricator, which",
+ "can ONLY run on Scrap and other",
+ "Amplifiers.",
+ "",
+ "With the Default Config it is 100",
+ "times more expensive than normal.",
+ "Of course you can set the Config",
+ "to 166666, to get your normal",
+ "Massfabricationrate back, or you",
+ "could make Mass Fabrication even",
+ "cheaper, if you really want to",
+ "make Mass Fabrication that easy",
+ "",
+ "",
+ ""
+ },
+ new ItemStack[] {
+ null,
+ null,
+ null,
+ GT_Utility.getFluidDisplayStack(FluidUtils.getUUM(1), false),
+ ItemList.Machine_LV_Massfab.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ new GT_Computercube_Description(
+ new String[] {
+ "Electric Autocrafting Tables",
+ "These are Crafting Tables for the",
+ "common need of autocrafting in",
+ "Factories. One Craft needs 5000EU to",
+ "be performed, so you have actually to",
+ "lay Wires to it. This Table is",
+ "unique as its also able, to give you",
+ "the used Capsulecellcontainers, made",
+ "by Industrial Corp, back.",
+ "You may use that behaviour to",
+ "craft anything releated to chemics,",
+ "like the 2xKNO3-Recipe for Saltpeter.",
+ "The 5 Modes are the following:",
+ "1. Craft Recipe, 2. All 5 Modes",
+ "3. Craft all as single Items",
+ "4. 2x2-Grid and 5. a 3x3-Grid.",
+ "It accepts only 32EU/p as Input."
+ },
+ new ItemStack[] {
+ null,
+ null,
+ null,
+ null,
+ GregtechItemList.GT4_Electric_Auto_Workbench_LV.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ /* new GT_Computercube_Description(new String[] {
+ "Automation with GregTech", "Translocators and Buffers are the", "newest Way to automate your Machines.", "Screw Buildcraft, these EU-wasting", "Devices are much more awesome.", "They output 32EU/t to their directed", "IN- and OUT-puts, making them usefull", "for things, like saving wires.", "Translocators are taking Stuff from", "the Block at their green Inputfacing",
+ "and putting it into the Block at the", "red Outputfacing. Buffers do the same,", "but the grab Items from their own", "Inventory, what makes them usefull", "as Pipe-replacement.", "Buffers also have Redstone Intelligence,", "which you can configure in their GUI." }, new ItemStack[] {
+ null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 19), new ItemStack(GregTech_API.sBlockList[1], 1, 18), new ItemStack(GregTech_API.sBlockList[1], 1, 17), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Silver Ore", "It's rarity is similar to Gold", "Silver can be used, to make", "Circuits cheaper, or you can use", "it for Redpowerstuff.", "", "", "", "", "",
+ "", "", "", "", "", "", "" }, new ItemStack[] {
+ null, null, GT_OreDictUnificator.get("dustSilver", 1), GregTech_API.getGregTechItem(0, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 1), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Sapphires and Rubys", "These spawn exactly like Emeralds.", "But Rubies are found in Deserts,", "while Sapphires can be found in", "Oceans.", "", "They currently make only a cheaper", "Recipe for Energycrystals and", "Lapotroncrystals, but they are", "Redpower Compatible.",
+ "", "They also sometimes drop random", "other Gems, like Garnet for Ruby", "or green Sapphire for Sapphire", "in addition.", "", "" }, new ItemStack[] {
+ null, GregTech_API.getGregTechItem(0, 1, 32), new ItemStack(GregTech_API.sBlockList[2], 1, 3), GregTech_API.getGregTechItem(0, 1, 33), new ItemStack(GregTech_API.sBlockList[2], 1, 4), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Bauxite Ore", "The Stuff out of which you can", "produce Aluminium and also", "Titanium.", "You find this Ore in Plains and", "Forests.", "", "If you think Aluminium is useless", "then note, that mobs NEVER spawn", "ontop of an Aluminium Block",
+ "(Same applies also for Silver-,", "Gem- and Iridium Blocks)", "Production Chain:", "macerating Bauxite Ore", "electrolyzing 24 Bauxite Dust", "smelting Aluminium Dust in a", "Blast Furnace" }, new ItemStack[] {
+ new ItemStack(GregTech_API.sBlockList[0], 1, 7), GregTech_API.getGregTechItem(0, 1, 18), GregTech_API.getGregTechItem(1, 1, 18), GregTech_API.getGregTechItem(1, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Titanium", "Produced by centrifuging Bauxitedust", "as a byproduct, this Material can make", "anything much more resistant against", "damage, like Explosions.", "Blocks made of Titaniumingots have a", "large Blastresistance", "", "It can also be used to craft tons of", "mixed Metal Ingots",
+ "", "", "", "", "", "", "" }, new ItemStack[] {
+ new ItemStack(GregTech_API.sBlockList[0], 1, 8), GregTech_API.getGregTechItem(0, 1, 19), GregTech_API.getGregTechItem(1, 1, 19), GregTech_API.getGregTechItem(1, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Iridium Ore", "You can find it only when you", "stripmine very large Areas with", "Quarries and such. There is only", "one in every 5th-10th Chunk.", "It's even more rare in Oceans!", "", "Some people disable the UUM-Recipe", "for Iridium, for making getting it", "an Achievement.",
+ "", "However Iridium Ore contains traces", "of Platinum, so it's best to use the", "Industrial Grinder for this Ore.", "", "", "" }, new ItemStack[] {
+ null, null, GT_OreDictUnificator.get("plateAlloyIridium", 1), GT_ModHandler.getIC2Item("iridiumOre", 1), new ItemStack(GregTech_API.sBlockList[2], 1, 2), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Helium Coolant Cell", "These are just cheaper, than the", "Water based Coolant Cells, and can", "also hold six times more Heat.", "", "Helium Cells can also be used for", "making Luminators and Mininglasers", "", "", "",
+ "", "", "", "", "", "", "" }, new ItemStack[] {
+ GregTech_API.getGregTechItem(2, 1, 6), GregTech_API.getGregTechItem(2, 1, 3), GregTech_API.getGregTechItem(34, 1, 0), GregTech_API.getGregTechItem(35, 1, 0), GregTech_API.getGregTechItem(36, 1, 0), null, null, null, null, null,
+ null, null, null, null });
+ new GT_Computercube_Description(new String[] {
+ "Destructopack", "Open its GUI via rightclick and", "dump all the useless Stuff from", "your Inventory into it, instead of", "littering Items into the World.", "", "", "", "", "",
+ "", "", "", "", "", "", "" }, new ItemStack[] {
+ null, null, null, null, GregTech_API.getGregTechItem(33, 1, 0), null, null, null, null, null,
+ null, null, null, null });*/
+ new GT_Computercube_Description(
+ new String[] {
+ "Data Orbs",
+ "They store Data.",
+ "",
+ "Rightclick on a Computer Cube, to",
+ "extract a Reactorplan",
+ "",
+ "Sneak-Rightclick on it, to insert",
+ "a Reactorplan",
+ "",
+ "Works also with Sonictrons",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ },
+ new ItemStack[] {
+ null,
+ null,
+ null,
+ null,
+ ItemList.Tool_DataOrb.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ new GT_Computercube_Description(
+ new String[] {
+ "Energy Orbs",
+ "100 Million EU in one Orb!",
+ "",
+ "This is a Tier-IV-Energystorage",
+ "So a MFSU is not enough for it!",
+ "",
+ "Use it to create a Lapotron Pack,",
+ "which is like an ultimate Lap Pack!",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ },
+ new ItemStack[] {
+ null,
+ null,
+ null,
+ null,
+ ItemList.Energy_LapotronicOrb.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ new GT_Computercube_Description(
+ new String[] {
+ "Iridium Neutron Reflector",
+ "It's used for Fusion Reactor Coils,",
+ "and works like a normal one",
+ "inside a Reactor, but it's also",
+ "INDESTRUCTIBLE*.",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "* = for weardown"
+ },
+ new ItemStack[] {
+ null,
+ null,
+ null,
+ null,
+ ItemList.Neutron_Reflector.get(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ });
+ /*new GT_Computercube_Description(new String[] {
+ "Rock Cutter", "You want to get whole Blocks, but", "your Drill is not enchantable?", "The Rock Cutter has an awesome", "SilkTouch-III-Function!", "", "It works like a Drill, but you", "get the whole Block instead of", "'macerated' Ores!", "",
+ "Put those Blocks into a Macerator", "and double your Diamond Income!", "", "Or better. Use the Industrial", "Grinder to get even more", "Resources!", "" }, new ItemStack[] {
+ null, null, null, null, GregTech_API.getGregTechItem(46, 1, 0), null, null, null, null, null,
null, null, null, null });
- /*new GT_Computercube_Description(new String[] {
- "Rock Cutter", "You want to get whole Blocks, but", "your Drill is not enchantable?", "The Rock Cutter has an awesome", "SilkTouch-III-Function!", "", "It works like a Drill, but you", "get the whole Block instead of", "'macerated' Ores!", "",
- "Put those Blocks into a Macerator", "and double your Diamond Income!", "", "Or better. Use the Industrial", "Grinder to get even more", "Resources!", "" }, new ItemStack[] {
- null, null, null, null, GregTech_API.getGregTechItem(46, 1, 0), null, null, null, null, null,
- null, null, null, null });
- new GT_Computercube_Description(new String[] {
- "Tesla Staff", "This completly untested PvP-Weapon", "destroys electric Armor in one hit", "", "The Energy Orb inside it must be", "fully charged to let this work.", "", "We are not responsible for any", "Electrocution Damage to yourself,", "while using it.",
- "", "We also dont even know, if this", "Weapon has any effect AT ALL.", "", "", "", "" }, new ItemStack[] {
- null, null, null, null, GregTech_API.getGregTechItem(47, 1, 0), null, null, null, null, null,
- null, null, null, null });*/
- }
+ new GT_Computercube_Description(new String[] {
+ "Tesla Staff", "This completly untested PvP-Weapon", "destroys electric Armor in one hit", "", "The Energy Orb inside it must be", "fully charged to let this work.", "", "We are not responsible for any", "Electrocution Damage to yourself,", "while using it.",
+ "", "We also dont even know, if this", "Weapon has any effect AT ALL.", "", "", "", "" }, new ItemStack[] {
+ null, null, null, null, GregTech_API.getGregTechItem(47, 1, 0), null, null, null, null, null,
+ null, null, null, null });*/
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java
index e0bedb5d18..fc57930dda 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.computer;
-import java.util.ArrayList;
-import java.util.HashMap;
-
import Ic2ExpReactorPlanner.AutomationSimulator;
import Ic2ExpReactorPlanner.Reactor;
import Ic2ExpReactorPlanner.SimulationData;
@@ -12,138 +9,142 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube;
+import java.util.ArrayList;
+import java.util.HashMap;
public class GT_Computercube_Simulator {
- private static final HashMap<Integer, Pair<Integer, Integer>> sSlotPositions = new HashMap<Integer, Pair<Integer, Integer>>();
-
- static {
- int aSlot = 4;
- for (int column = 0; column < 6; column++) {
- for (int row = 0; row < 9; row++) {
- sSlotPositions.put(aSlot++, new Pair<Integer, Integer>(row, column));
- }
- }
- }
-
- private final Reactor reactor = new Reactor();
-
- public AutomationSimulator simulator = null;
- /**
- * The reactor that was last simulated.
- */
- public Reactor simulatedReactor = null;
-
- private String currentReactorCode = null;
-
- private String currentReactorOldCode = null;
-
- private ArrayList<String> output = new ArrayList<String>();
-
- private final GT_TileEntity_ComputerCube mTile;
-
- public GT_Computercube_Simulator(GT_TileEntity_ComputerCube aTile) {
- mTile = aTile;
- }
-
- public void slotClick(int aSlot, GT_ItemStack aStack) {
-
- /*if (selection != null) {
- componentToPlace = ComponentFactory.createComponent(selection.getActionCommand());
- if (componentToPlace != null) {
- componentToPlace.setInitialHeat(((Number)componentHeatSpinner.getValue()).intValue());
- componentToPlace.setAutomationThreshold(((Number)placingThresholdSpinner.getValue()).intValue());
- componentToPlace.setReactorPause(((Number)placingReactorPauseSpinner.getValue()).intValue());
- }
- }*/
- if (aSlot >= 4 && aSlot < 58) {
- Pair<Integer, Integer> aSpot = sSlotPositions.get(aSlot);
- ReactorItem aItem;
- if (aStack == null) {
- aItem = null;
- }
- else {
-
- Logger.INFO("Using lookup key: "+ItemUtils.getModId(aStack.toStack())+"."+aStack.mItem.getUnlocalizedName()+"."+aStack.mMetaData);
- aItem = ReactorItem.sComponentMap.get(ItemUtils.getModId(aStack.toStack())+"."+aStack.mItem.getUnlocalizedName()+"."+aStack.mMetaData);
-
- }
- int aRow = aSpot.getKey();
- int aColumn = aSpot.getValue();
- Logger.INFO("Putting "+(aItem == null ? "null" : aItem.name)+" at x:"+aRow+", y:"+aColumn);
- reactor.setComponentAt(aColumn, aRow, aItem);
- currentReactorCode = reactor.getCode();
- currentReactorOldCode = reactor.getOldCode();
- Logger.INFO("Code: "+currentReactorCode);
- }
- //maxHeatLabel.setText(formatI18n("UI.MaxHeatSpecific", reactor.getMaxHeat()));
- //heatSpinnerModel.setMaximum(reactor.getMaxHeat() - 1);
- //heatSpinnerModel.setValue(Math.min(((Number)heatSpinnerModel.getValue()).intValue(), reactor.getMaxHeat() - 1));
- //temperatureEffectsLabel.setText(formatI18n("UI.TemperatureEffectsSpecific", (int) (reactor.getMaxHeat() * 0.4), (int) (reactor.getMaxHeat() * 0.5), (int) (reactor.getMaxHeat() * 0.7), (int) (reactor.getMaxHeat() * 0.85), (int) (reactor.getMaxHeat() * 1.0)));
- }
-
- public void simulate() {
- /*if (Utils.isClient()) {
- return;
- }*/
- if (simulator != null && simulator.isRunning()) {
- Logger.INFO("Simulator Running, Stopping.");
- simulator.cancel();
- }
- Logger.INFO("Starting Simulator.");
- mTile.mHeat = 0;
- mTile.mEU = 0;
- currentReactorCode = reactor.getCode();
- currentReactorOldCode = reactor.getOldCode();
- output.clear();
- simulatedReactor = new Reactor();
- simulatedReactor.setCode(reactor.getCode());
- Logger.INFO("Making new AutomationSimulator.");
- simulator = new AutomationSimulator(simulatedReactor, output, mTile);
- Logger.INFO("Starting AutomationSimulator.process().");
- simulator.process();
- Logger.INFO("Done.");
-
- SimulationData aData = simulator.getData();
- if (aData != null && aData.totalReactorTicks > 0) {
- mTile.mEU = aData.avgEUoutput * aData.totalReactorTicks;
- mTile.mEUOut = aData.avgEUoutput;
- mTile.mHeat = aData.avgHUoutput;
- mTile.mMaxHeat = aData.maxHUoutput;
- mTile.mExplosionStrength = aData.explosionPower;
- mTile.mHEM = (float) aData.hullHeating;
- mTile.mProgress = aData.totalReactorTicks;
- }
-
- for (String s : output) {
- Logger.INFO(" "+s);
- }
- }
-
- public ArrayList<String> getOutputData() {
- return output;
- }
-
- private void clearGrid() {
- reactor.clearGrid();
- /*for (int i = 0; i < reactorButtons.length; i++) {
- for (int j = 0; j < reactorButtons[i].length; j++) {
- reactorButtons[i][j].setIcon(null);
- reactorButtons[i][j].setToolTipText(null);
- reactorButtonPanels[i][j].setBackground(Color.LIGHT_GRAY);
- }
- }*/
- output.clear();
- /*materialsArea.setText(reactor.getMaterials().toString());
- componentListArea.setText(reactor.getComponentList().toString());
- maxHeatLabel.setText(formatI18n("UI.MaxHeatSpecific", reactor.getMaxHeat()));
- heatSpinnerModel.setMaximum(reactor.getMaxHeat() - 1);
- heatSpinnerModel.setValue(Math.min(((Number) heatSpinnerModel.getValue()).intValue(), reactor.getMaxHeat() - 1));
- temperatureEffectsLabel.setText(formatI18n("UI.TemperatureEffectsSpecific", (int)(reactor.getMaxHeat() * 0.4), (int)(reactor.getMaxHeat() * 0.5), (int)(reactor.getMaxHeat() * 0.7), (int)(reactor.getMaxHeat() * 0.85), (int)(reactor.getMaxHeat() * 1.0)));
- lockCode = true;
- codeField.setText(null);
- lockCode = false;*/
- }
-
-
+ private static final HashMap<Integer, Pair<Integer, Integer>> sSlotPositions =
+ new HashMap<Integer, Pair<Integer, Integer>>();
+
+ static {
+ int aSlot = 4;
+ for (int column = 0; column < 6; column++) {
+ for (int row = 0; row < 9; row++) {
+ sSlotPositions.put(aSlot++, new Pair<Integer, Integer>(row, column));
+ }
+ }
+ }
+
+ private final Reactor reactor = new Reactor();
+
+ public AutomationSimulator simulator = null;
+ /**
+ * The reactor that was last simulated.
+ */
+ public Reactor simulatedReactor = null;
+
+ private String currentReactorCode = null;
+
+ private String currentReactorOldCode = null;
+
+ private ArrayList<String> output = new ArrayList<String>();
+
+ private final GT_TileEntity_ComputerCube mTile;
+
+ public GT_Computercube_Simulator(GT_TileEntity_ComputerCube aTile) {
+ mTile = aTile;
+ }
+
+ public void slotClick(int aSlot, GT_ItemStack aStack) {
+
+ /*if (selection != null) {
+ componentToPlace = ComponentFactory.createComponent(selection.getActionCommand());
+ if (componentToPlace != null) {
+ componentToPlace.setInitialHeat(((Number)componentHeatSpinner.getValue()).intValue());
+ componentToPlace.setAutomationThreshold(((Number)placingThresholdSpinner.getValue()).intValue());
+ componentToPlace.setReactorPause(((Number)placingReactorPauseSpinner.getValue()).intValue());
+ }
+ }*/
+ if (aSlot >= 4 && aSlot < 58) {
+ Pair<Integer, Integer> aSpot = sSlotPositions.get(aSlot);
+ ReactorItem aItem;
+ if (aStack == null) {
+ aItem = null;
+ } else {
+
+ Logger.INFO("Using lookup key: " + ItemUtils.getModId(aStack.toStack()) + "."
+ + aStack.mItem.getUnlocalizedName() + "." + aStack.mMetaData);
+ aItem = ReactorItem.sComponentMap.get(ItemUtils.getModId(aStack.toStack()) + "."
+ + aStack.mItem.getUnlocalizedName() + "." + aStack.mMetaData);
+ }
+ int aRow = aSpot.getKey();
+ int aColumn = aSpot.getValue();
+ Logger.INFO("Putting " + (aItem == null ? "null" : aItem.name) + " at x:" + aRow + ", y:" + aColumn);
+ reactor.setComponentAt(aColumn, aRow, aItem);
+ currentReactorCode = reactor.getCode();
+ currentReactorOldCode = reactor.getOldCode();
+ Logger.INFO("Code: " + currentReactorCode);
+ }
+ // maxHeatLabel.setText(formatI18n("UI.MaxHeatSpecific", reactor.getMaxHeat()));
+ // heatSpinnerModel.setMaximum(reactor.getMaxHeat() - 1);
+ // heatSpinnerModel.setValue(Math.min(((Number)heatSpinnerModel.getValue()).intValue(), reactor.getMaxHeat() -
+ // 1));
+ // temperatureEffectsLabel.setText(formatI18n("UI.TemperatureEffectsSpecific", (int) (reactor.getMaxHeat() *
+ // 0.4), (int) (reactor.getMaxHeat() * 0.5), (int) (reactor.getMaxHeat() * 0.7), (int) (reactor.getMaxHeat() *
+ // 0.85), (int) (reactor.getMaxHeat() * 1.0)));
+ }
+
+ public void simulate() {
+ /*if (Utils.isClient()) {
+ return;
+ }*/
+ if (simulator != null && simulator.isRunning()) {
+ Logger.INFO("Simulator Running, Stopping.");
+ simulator.cancel();
+ }
+ Logger.INFO("Starting Simulator.");
+ mTile.mHeat = 0;
+ mTile.mEU = 0;
+ currentReactorCode = reactor.getCode();
+ currentReactorOldCode = reactor.getOldCode();
+ output.clear();
+ simulatedReactor = new Reactor();
+ simulatedReactor.setCode(reactor.getCode());
+ Logger.INFO("Making new AutomationSimulator.");
+ simulator = new AutomationSimulator(simulatedReactor, output, mTile);
+ Logger.INFO("Starting AutomationSimulator.process().");
+ simulator.process();
+ Logger.INFO("Done.");
+
+ SimulationData aData = simulator.getData();
+ if (aData != null && aData.totalReactorTicks > 0) {
+ mTile.mEU = aData.avgEUoutput * aData.totalReactorTicks;
+ mTile.mEUOut = aData.avgEUoutput;
+ mTile.mHeat = aData.avgHUoutput;
+ mTile.mMaxHeat = aData.maxHUoutput;
+ mTile.mExplosionStrength = aData.explosionPower;
+ mTile.mHEM = (float) aData.hullHeating;
+ mTile.mProgress = aData.totalReactorTicks;
+ }
+
+ for (String s : output) {
+ Logger.INFO(" " + s);
+ }
+ }
+
+ public ArrayList<String> getOutputData() {
+ return output;
+ }
+
+ private void clearGrid() {
+ reactor.clearGrid();
+ /*for (int i = 0; i < reactorButtons.length; i++) {
+ for (int j = 0; j < reactorButtons[i].length; j++) {
+ reactorButtons[i][j].setIcon(null);
+ reactorButtons[i][j].setToolTipText(null);
+ reactorButtonPanels[i][j].setBackground(Color.LIGHT_GRAY);
+ }
+ }*/
+ output.clear();
+ /*materialsArea.setText(reactor.getMaterials().toString());
+ componentListArea.setText(reactor.getComponentList().toString());
+ maxHeatLabel.setText(formatI18n("UI.MaxHeatSpecific", reactor.getMaxHeat()));
+ heatSpinnerModel.setMaximum(reactor.getMaxHeat() - 1);
+ heatSpinnerModel.setValue(Math.min(((Number) heatSpinnerModel.getValue()).intValue(), reactor.getMaxHeat() - 1));
+ temperatureEffectsLabel.setText(formatI18n("UI.TemperatureEffectsSpecific", (int)(reactor.getMaxHeat() * 0.4), (int)(reactor.getMaxHeat() * 0.5), (int)(reactor.getMaxHeat() * 0.7), (int)(reactor.getMaxHeat() * 0.85), (int)(reactor.getMaxHeat() * 1.0)));
+ lockCode = true;
+ codeField.setText(null);
+ lockCode = false;*/
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java
index 2fba1b0448..9e507048ed 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java
@@ -15,88 +15,132 @@ import gtPlusPlus.xmod.gregtech.common.items.covers.MetaItemCoverCasings;
public class CoverManager {
- // ZTones
- public static MetaCustomCoverItem Cover_Agon;
- public static MetaCustomCoverItem Cover_Iszm;
- public static MetaCustomCoverItem Cover_Korp;
- public static MetaCustomCoverItem Cover_Jelt;
- public static MetaCustomCoverItem Cover_Bitt;
+ // ZTones
+ public static MetaCustomCoverItem Cover_Agon;
+ public static MetaCustomCoverItem Cover_Iszm;
+ public static MetaCustomCoverItem Cover_Korp;
+ public static MetaCustomCoverItem Cover_Jelt;
+ public static MetaCustomCoverItem Cover_Bitt;
- // GT
- public static MetaItemCoverCasings Cover_Gt_Machine_Casing;
+ // GT
+ public static MetaItemCoverCasings Cover_Gt_Machine_Casing;
- public static void generateCustomCovers() {
+ public static void generateCustomCovers() {
- // init textures
- TexturesGtCutomCovers.init();
+ // init textures
+ TexturesGtCutomCovers.init();
- // GT Machine Casings
- Cover_Gt_Machine_Casing = new MetaItemCoverCasings();
+ // GT Machine Casings
+ Cover_Gt_Machine_Casing = new MetaItemCoverCasings();
- if (Loader.isModLoaded("Ztones")) {
- String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" };
- MetaCustomCoverItem[] aZtoneCoverItems = new MetaCustomCoverItem[] { Cover_Agon, Cover_Iszm, Cover_Korp,
- Cover_Jelt, Cover_Bitt };
- CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP,
- TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT };
- short[][][] aRGB = new short[][][] { ZTONES.RGB_AGON, ZTONES.RGB_ISZM, ZTONES.RGB_KORP, ZTONES.RGB_JELT,
- ZTONES.RGB_BITT };
- for (int y = 0; y < aZtoneCoverTextureNames.length; y++) {
- aZtoneCoverItems[y] = new MetaCustomCoverItem("Ztones", 16, aZtoneCoverTextureNames[y], aArrays[y],
- aRGB[y]);
- }
- }
+ if (Loader.isModLoaded("Ztones")) {
+ String[] aZtoneCoverTextureNames = new String[] {"agon", "iszm", "korp", "jelt", "bitt"};
+ MetaCustomCoverItem[] aZtoneCoverItems =
+ new MetaCustomCoverItem[] {Cover_Agon, Cover_Iszm, Cover_Korp, Cover_Jelt, Cover_Bitt};
+ CustomIcon[][] aArrays = new CustomIcon[][] {
+ TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT
+ };
+ short[][][] aRGB =
+ new short[][][] {ZTONES.RGB_AGON, ZTONES.RGB_ISZM, ZTONES.RGB_KORP, ZTONES.RGB_JELT, ZTONES.RGB_BITT
+ };
+ for (int y = 0; y < aZtoneCoverTextureNames.length; y++) {
+ aZtoneCoverItems[y] =
+ new MetaCustomCoverItem("Ztones", 16, aZtoneCoverTextureNames[y], aArrays[y], aRGB[y]);
+ }
+ }
+ }
- }
-
- final static class ZTONES {
-
- private static final short[][] RGB_AGON = new short[][] { VanillaColours.DYE_WHITE.getAsShort(),
- VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_LIME.getAsShort(),
- VanillaColours.DYE_GREEN.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(),
- VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(),
- VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(),
- VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_BROWN.getAsShort(),
- VanillaColours.DYE_BLACK.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
- VanillaColours.DYE_LIGHT_GRAY.getAsShort(), };
- private static final short[][] RGB_ISZM = new short[][] { VanillaColours.DYE_LIGHT_GRAY.getAsShort(),
- VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
- VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(),
- VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_RED.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(),
- VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_RED.getAsShort(),
- VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(),
- VanillaColours.DYE_DARK_PURPLE.getAsShort(),
- };
- private static final short[][] RGB_KORP = new short[][] { new short[] { 125, 125, 125 },
- VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
- VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
- VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
- VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
- VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
- VanillaColours.DYE_DARK_GRAY.getAsShort(), new short[] { 22, 156, 156 }, new short[] { 22, 156, 156 },
- VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), };
- private static final short[][] RGB_JELT = new short[][] { VanillaColours.DYE_ORANGE.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
- VanillaColours.DYE_ORANGE.getAsShort(), };
- private static final short[][] RGB_BITT = new short[][] { VanillaColours.DYE_BLACK.getAsShort(),
- VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(),
- VanillaColours.DYE_LIME.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(),
- VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(),
- VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(),
- VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(),
- VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(),
- VanillaColours.DYE_RED.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
- VanillaColours.DYE_BROWN.getAsShort(), };
-
- }
+ static final class ZTONES {
+ private static final short[][] RGB_AGON = new short[][] {
+ VanillaColours.DYE_WHITE.getAsShort(),
+ VanillaColours.DYE_YELLOW.getAsShort(),
+ VanillaColours.DYE_LIME.getAsShort(),
+ VanillaColours.DYE_GREEN.getAsShort(),
+ VanillaColours.DYE_CYAN.getAsShort(),
+ VanillaColours.DYE_LIGHT_BLUE.getAsShort(),
+ VanillaColours.DYE_DARK_BLUE.getAsShort(),
+ VanillaColours.DYE_DARK_PURPLE.getAsShort(),
+ VanillaColours.DYE_LIGHT_PURPLE.getAsShort(),
+ VanillaColours.DYE_PINK.getAsShort(),
+ VanillaColours.DYE_RED.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_BROWN.getAsShort(),
+ VanillaColours.DYE_BLACK.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_LIGHT_GRAY.getAsShort(),
+ };
+ private static final short[][] RGB_ISZM = new short[][] {
+ VanillaColours.DYE_LIGHT_GRAY.getAsShort(),
+ VanillaColours.DYE_WHITE.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_BLUE.getAsShort(),
+ VanillaColours.DYE_YELLOW.getAsShort(),
+ VanillaColours.DYE_DARK_BLUE.getAsShort(),
+ VanillaColours.DYE_RED.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_CYAN.getAsShort(),
+ VanillaColours.DYE_YELLOW.getAsShort(),
+ VanillaColours.DYE_RED.getAsShort(),
+ VanillaColours.DYE_CYAN.getAsShort(),
+ VanillaColours.DYE_GREEN.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_LIGHT_BLUE.getAsShort(),
+ VanillaColours.DYE_DARK_PURPLE.getAsShort(),
+ };
+ private static final short[][] RGB_KORP = new short[][] {
+ new short[] {125, 125, 125},
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ new short[] {22, 156, 156},
+ new short[] {22, 156, 156},
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ };
+ private static final short[][] RGB_JELT = new short[][] {
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ };
+ private static final short[][] RGB_BITT = new short[][] {
+ VanillaColours.DYE_BLACK.getAsShort(),
+ VanillaColours.DYE_WHITE.getAsShort(),
+ VanillaColours.DYE_YELLOW.getAsShort(),
+ VanillaColours.DYE_LIME.getAsShort(),
+ VanillaColours.DYE_GREEN.getAsShort(),
+ VanillaColours.DYE_CYAN.getAsShort(),
+ VanillaColours.DYE_LIGHT_BLUE.getAsShort(),
+ VanillaColours.DYE_LIGHT_BLUE.getAsShort(),
+ VanillaColours.DYE_DARK_BLUE.getAsShort(),
+ VanillaColours.DYE_DARK_PURPLE.getAsShort(),
+ VanillaColours.DYE_LIGHT_PURPLE.getAsShort(),
+ VanillaColours.DYE_PINK.getAsShort(),
+ VanillaColours.DYE_RED.getAsShort(),
+ VanillaColours.DYE_RED.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_BROWN.getAsShort(),
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java
index 072cf78c90..001b840df7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.covers;
+import gregtech.api.enums.GT_Values;
import gregtech.api.gui.GT_GUICover;
+import gregtech.api.gui.widgets.GT_GuiIntegerTextBox;
import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.net.GT_Packet_TileEntityCover;
import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.minecraft.LangUtils;
@@ -10,238 +13,261 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
-import gregtech.api.gui.widgets.GT_GuiIntegerTextBox;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.net.GT_Packet_TileEntityCover;
-
public class GTPP_Cover_Overflow extends GT_CoverBehavior {
- public final int mTransferRate;
- public final int mInitialTransferRate;
- public final int mMaxTransferRate;
-
- public GTPP_Cover_Overflow(int aTransferRate) {
- this.mTransferRate = aTransferRate * 1000 / 10;
- this.mInitialTransferRate = aTransferRate;
- this.mMaxTransferRate = aTransferRate * 1000;
- }
-
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- long aTimer) {
- if (aCoverVariable == 0) {
- return aCoverVariable;
- }
- if ((aTileEntity instanceof IFluidHandler)) {
- //Logger.INFO("Trying to Void via Overflow.");
- IFluidHandler tTank1;
- ForgeDirection directionFrom;
- directionFrom = ForgeDirection.UNKNOWN;
- tTank1 = (IFluidHandler) aTileEntity;
- if (tTank1 != null) {
- //Logger.INFO("Found Self. "+aSide);
- //FluidStack aTankStack = tTank1.drain(ForgeDirection.UNKNOWN, 1, false);
- FluidStack aTankStack = tTank1.getTankInfo(directionFrom)[0].fluid;
- if (aTankStack != null) {
- //Logger.INFO("Found Fluid inside self - "+aTankStack.getLocalizedName()+", overflow point set at "+aCoverVariable+"L and we have "+aTankStack.amount+"L inside.");
- if (aTankStack.amount > aCoverVariable) {
- int aAmountToDrain = aTankStack.amount - aCoverVariable;
- //Logger.INFO("There is "+aAmountToDrain+" more fluid in the tank than we would like.");
- if (aAmountToDrain > 0) {
- FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aAmountToDrain), true);
- if (tLiquid != null) {
- //Logger.INFO("Drained "+aAmountToDrain+"L.");
- }
- }
- }
- }
- else {
- //Logger.INFO("Could not simulate drain on self.");
- }
- }
- }
- return aCoverVariable;
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
- aCoverVariable += (mMaxTransferRate * (aPlayer.isSneaking() ? 0.1f : 0.01f));
- } else {
- aCoverVariable -= (mMaxTransferRate * (aPlayer.isSneaking() ? 0.1f : 0.01f));
- }
- if (aCoverVariable > mMaxTransferRate) {
- aCoverVariable = mInitialTransferRate;
- }
- if (aCoverVariable <= 0) {
- aCoverVariable = mMaxTransferRate;
- }
- GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L"));
- return aCoverVariable;
- }
-
- public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- boolean aShift = aPlayer.isSneaking();
- int aAmount = aShift ? 128 : 8;
- if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
- aCoverVariable += aAmount;
- } else {
- aCoverVariable -= aAmount;
- }
- if (aCoverVariable > mMaxTransferRate) {
- aCoverVariable = mInitialTransferRate;
- }
- if (aCoverVariable <= 0) {
- aCoverVariable = mMaxTransferRate;
- }
- GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L"));
- aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
- return true;
- }
-
- public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return 5;
- }
-
- //GUI
- @Override
- public boolean hasCoverGUI() {
- return true;
- }
-
- @Override
- public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) {
- return new GTPP_Cover_Overflow.GUI(aSide, aCoverID, coverData, aTileEntity);
- }
-
- private class GUI extends GT_GUICover {
- private final byte side;
- private final int coverID;
- private GT_GuiIntegerTextBox tBox;
- private int coverVariable;
-
- private static final int startX = 10;
- private static final int startY = 25;
- private static final int spaceX = 18;
- private static final int spaceY = 18;
-
- private boolean warn = false;
-
- public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID));
- this.side = aSide;
- this.coverID = aCoverID;
- this.coverVariable = aCoverVariable;
-
- tBox = new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 0 + 8, spaceX * 4 - 3, 12);
- tBox.setText(String.valueOf(this.coverVariable));
- tBox.setMaxStringLength(10);
- }
-
- @Override
- protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) {
- tBox.setFocused(true);
- }
-
- @Override
- public void drawExtras(int mouseX, int mouseY, float parTicks) {
- super.drawExtras(mouseX, mouseY, parTicks);
- this.getFontRenderer().drawString(trans("323", "L"), startX + spaceX * 4, 4 + startY + spaceY * 0 + 8, 0xFF555555);
- if (warn)
- this.getFontRenderer().drawString(trans("325","Max")+": "+coverVariable+"/"+mMaxTransferRate+" "+trans("323", "L"), startX + spaceX * 0, 4 + startY + spaceY * 1 + 6, 0xffff0000);
- else
- this.getFontRenderer().drawString(trans("324","Now")+": "+coverVariable+"/"+mMaxTransferRate+" "+trans("323", "L"), startX + spaceX * 0, 4 + startY + spaceY * 1 + 6, 0xFF555555);
- }
- @Override
- public void onMouseWheel(int x, int y, int delta) {
- for (GT_GuiIntegerTextBox box : textBoxes){
- if (box.isFocused()) {
- int step = Math.max(1, Math.abs(delta / 120));
- step = (isShiftKeyDown() ? 50 : isCtrlKeyDown() ? 5 : 1) * (delta > 0 ? step : -step);
- long i;
- try {
- i = Long.parseLong(box.getText());
- } catch (NumberFormatException e) {
- return;
- }
- if (i > (Long.MAX_VALUE-1000))
- break;
-
- i = i + step;
- if (i <= 0)
- i = 0;
- box.setText(String.valueOf(i));
- break;
- }
- }
- }
-
- @Override
- public void applyTextBox(GT_GuiIntegerTextBox box) {
- long i;
- String s = box.getText().trim();
- try {
- i = Long.parseLong(s);
- } catch (NumberFormatException e) {
- resetTextBox(box);
- return;
- }
-
- warn = false;
- if (box.id == 2) {
- if (i > (long) mMaxTransferRate) {
- i = mMaxTransferRate;
- warn = true;
- } else if (i < 0) {
- i = 0;
- }
- coverVariable = (int) i;
- }
- box.setText(String.valueOf(i));
- GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile));
- }
-
- @Override
- public void resetTextBox(GT_GuiIntegerTextBox box) {
- if (box.id == 2)
- box.setText(String.valueOf(coverVariable));
- }
- }
+ public final int mTransferRate;
+ public final int mInitialTransferRate;
+ public final int mMaxTransferRate;
+
+ public GTPP_Cover_Overflow(int aTransferRate) {
+ this.mTransferRate = aTransferRate * 1000 / 10;
+ this.mInitialTransferRate = aTransferRate;
+ this.mMaxTransferRate = aTransferRate * 1000;
+ }
+
+ public int doCoverThings(
+ byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ if (aCoverVariable == 0) {
+ return aCoverVariable;
+ }
+ if ((aTileEntity instanceof IFluidHandler)) {
+ // Logger.INFO("Trying to Void via Overflow.");
+ IFluidHandler tTank1;
+ ForgeDirection directionFrom;
+ directionFrom = ForgeDirection.UNKNOWN;
+ tTank1 = (IFluidHandler) aTileEntity;
+ if (tTank1 != null) {
+ // Logger.INFO("Found Self. "+aSide);
+ // FluidStack aTankStack = tTank1.drain(ForgeDirection.UNKNOWN, 1, false);
+ FluidStack aTankStack = tTank1.getTankInfo(directionFrom)[0].fluid;
+ if (aTankStack != null) {
+ // Logger.INFO("Found Fluid inside self - "+aTankStack.getLocalizedName()+", overflow point set at
+ // "+aCoverVariable+"L and we have "+aTankStack.amount+"L inside.");
+ if (aTankStack.amount > aCoverVariable) {
+ int aAmountToDrain = aTankStack.amount - aCoverVariable;
+ // Logger.INFO("There is "+aAmountToDrain+" more fluid in the tank than we would like.");
+ if (aAmountToDrain > 0) {
+ FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aAmountToDrain), true);
+ if (tLiquid != null) {
+ // Logger.INFO("Drained "+aAmountToDrain+"L.");
+ }
+ }
+ }
+ } else {
+ // Logger.INFO("Could not simulate drain on self.");
+ }
+ }
+ }
+ return aCoverVariable;
+ }
+
+ public int onCoverScrewdriverclick(
+ byte aSide,
+ int aCoverID,
+ int aCoverVariable,
+ ICoverable aTileEntity,
+ EntityPlayer aPlayer,
+ float aX,
+ float aY,
+ float aZ) {
+ if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
+ aCoverVariable += (mMaxTransferRate * (aPlayer.isSneaking() ? 0.1f : 0.01f));
+ } else {
+ aCoverVariable -= (mMaxTransferRate * (aPlayer.isSneaking() ? 0.1f : 0.01f));
+ }
+ if (aCoverVariable > mMaxTransferRate) {
+ aCoverVariable = mInitialTransferRate;
+ }
+ if (aCoverVariable <= 0) {
+ aCoverVariable = mMaxTransferRate;
+ }
+ GT_Utility.sendChatToPlayer(
+ aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L"));
+ return aCoverVariable;
+ }
+
+ public boolean onCoverRightclick(
+ byte aSide,
+ int aCoverID,
+ int aCoverVariable,
+ ICoverable aTileEntity,
+ EntityPlayer aPlayer,
+ float aX,
+ float aY,
+ float aZ) {
+ boolean aShift = aPlayer.isSneaking();
+ int aAmount = aShift ? 128 : 8;
+ if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
+ aCoverVariable += aAmount;
+ } else {
+ aCoverVariable -= aAmount;
+ }
+ if (aCoverVariable > mMaxTransferRate) {
+ aCoverVariable = mInitialTransferRate;
+ }
+ if (aCoverVariable <= 0) {
+ aCoverVariable = mMaxTransferRate;
+ }
+ GT_Utility.sendChatToPlayer(
+ aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L"));
+ aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
+ return true;
+ }
+
+ public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return false;
+ }
+
+ public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return 5;
+ }
+
+ // GUI
+ @Override
+ public boolean hasCoverGUI() {
+ return true;
+ }
+
+ @Override
+ public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) {
+ return new GTPP_Cover_Overflow.GUI(aSide, aCoverID, coverData, aTileEntity);
+ }
+
+ private class GUI extends GT_GUICover {
+ private final byte side;
+ private final int coverID;
+ private GT_GuiIntegerTextBox tBox;
+ private int coverVariable;
+
+ private static final int startX = 10;
+ private static final int startY = 25;
+ private static final int spaceX = 18;
+ private static final int spaceY = 18;
+
+ private boolean warn = false;
+
+ public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID));
+ this.side = aSide;
+ this.coverID = aCoverID;
+ this.coverVariable = aCoverVariable;
+
+ tBox = new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 0 + 8, spaceX * 4 - 3, 12);
+ tBox.setText(String.valueOf(this.coverVariable));
+ tBox.setMaxStringLength(10);
+ }
+
+ @Override
+ protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) {
+ tBox.setFocused(true);
+ }
+
+ @Override
+ public void drawExtras(int mouseX, int mouseY, float parTicks) {
+ super.drawExtras(mouseX, mouseY, parTicks);
+ this.getFontRenderer()
+ .drawString(trans("323", "L"), startX + spaceX * 4, 4 + startY + spaceY * 0 + 8, 0xFF555555);
+ if (warn)
+ this.getFontRenderer()
+ .drawString(
+ trans("325", "Max") + ": " + coverVariable + "/" + mMaxTransferRate + " "
+ + trans("323", "L"),
+ startX + spaceX * 0,
+ 4 + startY + spaceY * 1 + 6,
+ 0xffff0000);
+ else
+ this.getFontRenderer()
+ .drawString(
+ trans("324", "Now") + ": " + coverVariable + "/" + mMaxTransferRate + " "
+ + trans("323", "L"),
+ startX + spaceX * 0,
+ 4 + startY + spaceY * 1 + 6,
+ 0xFF555555);
+ }
+
+ @Override
+ public void onMouseWheel(int x, int y, int delta) {
+ for (GT_GuiIntegerTextBox box : textBoxes) {
+ if (box.isFocused()) {
+ int step = Math.max(1, Math.abs(delta / 120));
+ step = (isShiftKeyDown() ? 50 : isCtrlKeyDown() ? 5 : 1) * (delta > 0 ? step : -step);
+ long i;
+ try {
+ i = Long.parseLong(box.getText());
+ } catch (NumberFormatException e) {
+ return;
+ }
+ if (i > (Long.MAX_VALUE - 1000)) break;
+
+ i = i + step;
+ if (i <= 0) i = 0;
+ box.setText(String.valueOf(i));
+ break;
+ }
+ }
+ }
+
+ @Override
+ public void applyTextBox(GT_GuiIntegerTextBox box) {
+ long i;
+ String s = box.getText().trim();
+ try {
+ i = Long.parseLong(s);
+ } catch (NumberFormatException e) {
+ resetTextBox(box);
+ return;
+ }
+
+ warn = false;
+ if (box.id == 2) {
+ if (i > (long) mMaxTransferRate) {
+ i = mMaxTransferRate;
+ warn = true;
+ } else if (i < 0) {
+ i = 0;
+ }
+ coverVariable = (int) i;
+ }
+ box.setText(String.valueOf(i));
+ GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile));
+ }
+
+ @Override
+ public void resetTextBox(GT_GuiIntegerTextBox box) {
+ if (box.id == 2) box.setText(String.valueOf(coverVariable));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java
index 0299447694..16369f570f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.covers;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,172 +8,189 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.LangUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.util.HashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior {
- public final int mInitialCapacity;
- public final int mMaxItemCapacity;
-
- public static final Class sQuantumChest;
- public static final Class sSuperChestGTPP;
- public static final Class sSuperChestGTNH;
- public static HashMap<Integer, Field> mItemAmountFields = new HashMap<Integer, Field>();
- public static HashMap<Integer, Field> mItemTypeFields = new HashMap<Integer, Field>();
-
- static {
- sQuantumChest = ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest");
- sSuperChestGTPP = ReflectionUtils.getClass("gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest");
- if (CORE.GTNH) {
- sSuperChestGTNH = ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest");
- }
- else {
- sSuperChestGTNH = null;
- }
- if (sQuantumChest != null) {
- mItemAmountFields.put(0, ReflectionUtils.getField(sQuantumChest, "mItemCount"));
- mItemTypeFields.put(0, ReflectionUtils.getField(sQuantumChest, "mItemStack"));
- }
- if (sSuperChestGTPP != null) {
- mItemAmountFields.put(1, ReflectionUtils.getField(sSuperChestGTPP, "mItemCount"));
- mItemTypeFields.put(1, ReflectionUtils.getField(sSuperChestGTPP, "mItemStack"));
- }
- if (sSuperChestGTNH != null) {
- mItemAmountFields.put(2, ReflectionUtils.getField(sSuperChestGTNH, "mItemCount"));
- mItemTypeFields.put(2, ReflectionUtils.getField(sSuperChestGTNH, "mItemStack"));
- }
- }
-
- public GTPP_Cover_Overflow_Item(int aCapacity) {
- this.mInitialCapacity = aCapacity;
- this.mMaxItemCapacity = aCapacity * 1000;
- }
-
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- long aTimer) {
- if (aCoverVariable == 0) {
- return aCoverVariable;
- }
-
- // Get the IGTTile
- IGregTechTileEntity aGtTileEntity = aTileEntity.getIGregTechTileEntity(aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord());
- if (aGtTileEntity == null) {
- return aCoverVariable;
- }
-
- // Get the MetaTile
- final IMetaTileEntity aMetaTileEntity = aGtTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return aCoverVariable;
- }
- boolean didHandle = false;
- // Special Case for everything I want to support. /facepalm
- if (sQuantumChest != null && sQuantumChest.isInstance(aMetaTileEntity)) {
- didHandle = handleDigitalChest(aMetaTileEntity, 0);
- }
- else if (sSuperChestGTPP.isInstance(aMetaTileEntity)) {
- didHandle = handleDigitalChest(aMetaTileEntity, 1);
-
- }
- else if (CORE.GTNH && sSuperChestGTNH != null && sSuperChestGTNH.isInstance(aMetaTileEntity)) {
- didHandle = handleDigitalChest(aMetaTileEntity, 2);
- }
-
+ public final int mInitialCapacity;
+ public final int mMaxItemCapacity;
+
+ public static final Class sQuantumChest;
+ public static final Class sSuperChestGTPP;
+ public static final Class sSuperChestGTNH;
+ public static HashMap<Integer, Field> mItemAmountFields = new HashMap<Integer, Field>();
+ public static HashMap<Integer, Field> mItemTypeFields = new HashMap<Integer, Field>();
+
+ static {
+ sQuantumChest = ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest");
+ sSuperChestGTPP = ReflectionUtils.getClass(
+ "gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest");
+ if (CORE.GTNH) {
+ sSuperChestGTNH =
+ ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest");
+ } else {
+ sSuperChestGTNH = null;
+ }
+ if (sQuantumChest != null) {
+ mItemAmountFields.put(0, ReflectionUtils.getField(sQuantumChest, "mItemCount"));
+ mItemTypeFields.put(0, ReflectionUtils.getField(sQuantumChest, "mItemStack"));
+ }
+ if (sSuperChestGTPP != null) {
+ mItemAmountFields.put(1, ReflectionUtils.getField(sSuperChestGTPP, "mItemCount"));
+ mItemTypeFields.put(1, ReflectionUtils.getField(sSuperChestGTPP, "mItemStack"));
+ }
+ if (sSuperChestGTNH != null) {
+ mItemAmountFields.put(2, ReflectionUtils.getField(sSuperChestGTNH, "mItemCount"));
+ mItemTypeFields.put(2, ReflectionUtils.getField(sSuperChestGTNH, "mItemStack"));
+ }
+ }
+
+ public GTPP_Cover_Overflow_Item(int aCapacity) {
+ this.mInitialCapacity = aCapacity;
+ this.mMaxItemCapacity = aCapacity * 1000;
+ }
+
+ public int doCoverThings(
+ byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ if (aCoverVariable == 0) {
+ return aCoverVariable;
+ }
+
+ // Get the IGTTile
+ IGregTechTileEntity aGtTileEntity = aTileEntity.getIGregTechTileEntity(
+ aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord());
+ if (aGtTileEntity == null) {
+ return aCoverVariable;
+ }
+
+ // Get the MetaTile
+ final IMetaTileEntity aMetaTileEntity = aGtTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return aCoverVariable;
+ }
+ boolean didHandle = false;
+ // Special Case for everything I want to support. /facepalm
+ if (sQuantumChest != null && sQuantumChest.isInstance(aMetaTileEntity)) {
+ didHandle = handleDigitalChest(aMetaTileEntity, 0);
+ } else if (sSuperChestGTPP.isInstance(aMetaTileEntity)) {
+ didHandle = handleDigitalChest(aMetaTileEntity, 1);
+
+ } else if (CORE.GTNH && sSuperChestGTNH != null && sSuperChestGTNH.isInstance(aMetaTileEntity)) {
+ didHandle = handleDigitalChest(aMetaTileEntity, 2);
+ }
+
+ return aCoverVariable;
+ }
+
+ private boolean handleDigitalChest(IMetaTileEntity aTile, int aType) {
+ int aItemAmount = (int) ReflectionUtils.getFieldValue(mItemAmountFields.get(aType), aTile);
+ ItemStack aItemType = (ItemStack) ReflectionUtils.getFieldValue(mItemTypeFields.get(aType), aTile);
+
+ if (aItemType == null || aItemAmount <= 0) {
+ return false;
+ } else {
+ if (aItemAmount > mInitialCapacity) {
+ int aNewItemAmount = mInitialCapacity;
+ ReflectionUtils.setField(aTile, mItemAmountFields.get(aType), aNewItemAmount);
+ }
+ }
+ return true;
+ }
+
+ public int onCoverScrewdriverclick(
+ byte aSide,
+ int aCoverID,
+ int aCoverVariable,
+ ICoverable aTileEntity,
+ EntityPlayer aPlayer,
+ float aX,
+ float aY,
+ float aZ) {
+ if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
+ aCoverVariable += (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f));
+ } else {
+ aCoverVariable -= (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f));
+ }
+ if (aCoverVariable > mMaxItemCapacity) {
+ aCoverVariable = mInitialCapacity;
+ }
+ if (aCoverVariable <= 0) {
+ aCoverVariable = mMaxItemCapacity;
+ }
+ GT_Utility.sendChatToPlayer(
+ aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L"));
return aCoverVariable;
- }
-
- private boolean handleDigitalChest(IMetaTileEntity aTile, int aType) {
- int aItemAmount = (int) ReflectionUtils.getFieldValue(mItemAmountFields.get(aType), aTile);
- ItemStack aItemType = (ItemStack) ReflectionUtils.getFieldValue(mItemTypeFields.get(aType), aTile);
-
- if (aItemType == null || aItemAmount <= 0) {
- return false;
- }
- else {
- if (aItemAmount > mInitialCapacity) {
- int aNewItemAmount = mInitialCapacity;
- ReflectionUtils.setField(aTile, mItemAmountFields.get(aType), aNewItemAmount);
- }
- }
- return true;
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
- aCoverVariable += (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f));
- } else {
- aCoverVariable -= (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f));
- }
- if (aCoverVariable > mMaxItemCapacity) {
- aCoverVariable = mInitialCapacity;
- }
- if (aCoverVariable <= 0) {
- aCoverVariable = mMaxItemCapacity;
- }
- GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L"));
- return aCoverVariable;
- }
-
- public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- boolean aShift = aPlayer.isSneaking();
- int aAmount = aShift ? 128 : 8;
- if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
- aCoverVariable += aAmount;
- } else {
- aCoverVariable -= aAmount;
- }
- if (aCoverVariable > mMaxItemCapacity) {
- aCoverVariable = mInitialCapacity;
- }
- if (aCoverVariable <= 0) {
- aCoverVariable = mMaxItemCapacity;
- }
- GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L"));
- aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
- return true;
- }
-
- public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return 5;
- }
+ }
+
+ public boolean onCoverRightclick(
+ byte aSide,
+ int aCoverID,
+ int aCoverVariable,
+ ICoverable aTileEntity,
+ EntityPlayer aPlayer,
+ float aX,
+ float aY,
+ float aZ) {
+ boolean aShift = aPlayer.isSneaking();
+ int aAmount = aShift ? 128 : 8;
+ if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
+ aCoverVariable += aAmount;
+ } else {
+ aCoverVariable -= aAmount;
+ }
+ if (aCoverVariable > mMaxItemCapacity) {
+ aCoverVariable = mInitialCapacity;
+ }
+ if (aCoverVariable <= 0) {
+ aCoverVariable = mMaxItemCapacity;
+ }
+ GT_Utility.sendChatToPlayer(
+ aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L"));
+ aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
+ return true;
+ }
+
+ public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return false;
+ }
+
+ public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return 5;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
index 65b59ce151..b8b130e987 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.covers;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_CoverBehavior;
@@ -11,6 +8,8 @@ import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.core.util.minecraft.LangUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -19,168 +18,182 @@ import net.minecraftforge.fluids.Fluid;
public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior {
- private static final Map<String, Integer> sConnectionStateForEntityMap = new ConcurrentHashMap<String, Integer>();
- private static final Map<String, String> sPrefixMap = new ConcurrentHashMap<String, String>();
- private static final int VALUE_OFF = 0;
- private static final int VALUE_ON = 1;
-
- public static String generateUniqueKey(byte aSide, ICoverable aEntity) {
- try {
- BlockPos aPos = new BlockPos(aEntity.getIGregTechTileEntity(aEntity.getXCoord(), aEntity.getYCoord(), aEntity.getZCoord()));
- ForgeDirection aDir = ForgeDirection.getOrientation(aSide);
- String s = aEntity.getInventoryName()+"."+aPos.getUniqueIdentifier()+aDir.name();
- return s;
- }
- catch (Throwable t) {}
- XSTR x = new XSTR();
- return "ERROR."+x.getSeed()+x.hashCode()+x.nextDouble()+".ID";
- }
-
- public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- PlayerUtils.messagePlayer(aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable));
- return super.onCoverRightclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ);
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- return super.onCoverScrewdriverclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ);
- }
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return getConnectionState(aCoverVariable);
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return getConnectionState(aCoverVariable);
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return getConnectionState(aCoverVariable);
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return getConnectionState(aCoverVariable);
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return getConnectionState(aCoverVariable);
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return getConnectionState(aCoverVariable);
- }
-
- public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable);
- }
-
- public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return 1;
- }
-
- @Override
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- long aTimer) {
- try {
- String aKey = generateUniqueKey(aSide, aTileEntity);
- Integer b = sConnectionStateForEntityMap.get(aKey);
- //Logger.INFO("Val: "+aCoverVariable);
- if (b != null && aCoverVariable != b) {
- aCoverVariable = b;
- }
- if (b == null) {
- b = aCoverVariable;
- sConnectionStateForEntityMap.put(aKey, b);
- trySetState(aSide, b == VALUE_ON ? VALUE_ON : VALUE_OFF, aTileEntity);
- }
- }
- catch (Throwable t) {
-
- }
- return aCoverVariable;
- }
-
- @Override
- public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return getConnectionState(aCoverVariable);
- }
-
- @Override
- public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return getConnectionState(aCoverVariable);
- }
-
- @Override
- public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return super.alwaysLookConnected(aSide, aCoverID, aCoverVariable, aTileEntity);
- }
-
- @Override
- public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable,
- ICoverable aTileEntity) {
- if (!getConnectionState(aCoverVariable)) {
- return 0;
- }
- return super.getRedstoneInput(aSide, aInputRedstone, aCoverID, aCoverVariable, aTileEntity);
- }
-
- @Override
- public void placeCover(byte aSide, ItemStack aCover, ICoverable aTileEntity) {
- String aKey = generateUniqueKey(aSide, aTileEntity);
- boolean state = getCoverConnections(aCover);
- sPrefixMap.put(aKey, aCover.getUnlocalizedName());
- Logger.INFO("Mapping key "+aKey+" to "+state);
- sConnectionStateForEntityMap.put(aKey, state ? VALUE_ON : VALUE_OFF);
- Logger.INFO("Key Value: "+(state ? VALUE_ON : VALUE_OFF));
- //Try set cover state directly
- //trySetState(aSide, state ? VALUE_ON : VALUE_OFF, aTileEntity);
- super.placeCover(aSide, aCover, aTileEntity);
- }
-
- @Override
- public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- boolean aForced) {
- String aKey = generateUniqueKey(aSide, aTileEntity);
- sConnectionStateForEntityMap.remove(aKey);
- //Logger.INFO("Unmapping key "+aKey+".");
- return true;
- }
-
- public static boolean getConnectionState(int aCoverVar) {
- return aCoverVar == VALUE_ON;
- }
-
- private static final void trySetState(byte aSide, int aState, ICoverable aTile) {
- //Try set cover state directly
- if (aTile instanceof IGregTechTileEntity) {
- IGregTechTileEntity gTileEntity = (IGregTechTileEntity) aTile;
- if (gTileEntity != null) {
- gTileEntity.setCoverDataAtSide(aSide, aState);
- }
- }
- }
-
-
- public static boolean getConnectionState(byte aSide, ICoverable aTile) {
- String aKey = generateUniqueKey(aSide, aTile);
- return getConnectionState(aKey);
- }
-
- public static boolean getConnectionState(String aKey) {
- Integer b = sConnectionStateForEntityMap.get(aKey);
- //Logger.INFO("Get State: "+b+" | "+aKey);
- return b != null ? b == VALUE_ON : false;
- }
-
- public static final boolean getCoverConnections(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("CustomCoverMeta");
- if (aNBT != null) {
- return aNBT.getBoolean("AllowConnections");
- }
- }
- return false;
- }
-} \ No newline at end of file
+ private static final Map<String, Integer> sConnectionStateForEntityMap = new ConcurrentHashMap<String, Integer>();
+ private static final Map<String, String> sPrefixMap = new ConcurrentHashMap<String, String>();
+ private static final int VALUE_OFF = 0;
+ private static final int VALUE_ON = 1;
+
+ public static String generateUniqueKey(byte aSide, ICoverable aEntity) {
+ try {
+ BlockPos aPos = new BlockPos(
+ aEntity.getIGregTechTileEntity(aEntity.getXCoord(), aEntity.getYCoord(), aEntity.getZCoord()));
+ ForgeDirection aDir = ForgeDirection.getOrientation(aSide);
+ String s = aEntity.getInventoryName() + "." + aPos.getUniqueIdentifier() + aDir.name();
+ return s;
+ } catch (Throwable t) {
+ }
+ XSTR x = new XSTR();
+ return "ERROR." + x.getSeed() + x.hashCode() + x.nextDouble() + ".ID";
+ }
+
+ public boolean onCoverRightclick(
+ byte aSide,
+ int aCoverID,
+ int aCoverVariable,
+ ICoverable aTileEntity,
+ EntityPlayer aPlayer,
+ float aX,
+ float aY,
+ float aZ) {
+ PlayerUtils.messagePlayer(
+ aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable));
+ return super.onCoverRightclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ);
+ }
+
+ public int onCoverScrewdriverclick(
+ byte aSide,
+ int aCoverID,
+ int aCoverVariable,
+ ICoverable aTileEntity,
+ EntityPlayer aPlayer,
+ float aX,
+ float aY,
+ float aZ) {
+ return super.onCoverScrewdriverclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ);
+ }
+
+ public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable);
+ }
+
+ public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return 1;
+ }
+
+ @Override
+ public int doCoverThings(
+ byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ try {
+ String aKey = generateUniqueKey(aSide, aTileEntity);
+ Integer b = sConnectionStateForEntityMap.get(aKey);
+ // Logger.INFO("Val: "+aCoverVariable);
+ if (b != null && aCoverVariable != b) {
+ aCoverVariable = b;
+ }
+ if (b == null) {
+ b = aCoverVariable;
+ sConnectionStateForEntityMap.put(aKey, b);
+ trySetState(aSide, b == VALUE_ON ? VALUE_ON : VALUE_OFF, aTileEntity);
+ }
+ } catch (Throwable t) {
+
+ }
+ return aCoverVariable;
+ }
+
+ @Override
+ public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ @Override
+ public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ @Override
+ public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return super.alwaysLookConnected(aSide, aCoverID, aCoverVariable, aTileEntity);
+ }
+
+ @Override
+ public byte getRedstoneInput(
+ byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ if (!getConnectionState(aCoverVariable)) {
+ return 0;
+ }
+ return super.getRedstoneInput(aSide, aInputRedstone, aCoverID, aCoverVariable, aTileEntity);
+ }
+
+ @Override
+ public void placeCover(byte aSide, ItemStack aCover, ICoverable aTileEntity) {
+ String aKey = generateUniqueKey(aSide, aTileEntity);
+ boolean state = getCoverConnections(aCover);
+ sPrefixMap.put(aKey, aCover.getUnlocalizedName());
+ Logger.INFO("Mapping key " + aKey + " to " + state);
+ sConnectionStateForEntityMap.put(aKey, state ? VALUE_ON : VALUE_OFF);
+ Logger.INFO("Key Value: " + (state ? VALUE_ON : VALUE_OFF));
+ // Try set cover state directly
+ // trySetState(aSide, state ? VALUE_ON : VALUE_OFF, aTileEntity);
+ super.placeCover(aSide, aCover, aTileEntity);
+ }
+
+ @Override
+ public boolean onCoverRemoval(
+ byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) {
+ String aKey = generateUniqueKey(aSide, aTileEntity);
+ sConnectionStateForEntityMap.remove(aKey);
+ // Logger.INFO("Unmapping key "+aKey+".");
+ return true;
+ }
+
+ public static boolean getConnectionState(int aCoverVar) {
+ return aCoverVar == VALUE_ON;
+ }
+
+ private static final void trySetState(byte aSide, int aState, ICoverable aTile) {
+ // Try set cover state directly
+ if (aTile instanceof IGregTechTileEntity) {
+ IGregTechTileEntity gTileEntity = (IGregTechTileEntity) aTile;
+ if (gTileEntity != null) {
+ gTileEntity.setCoverDataAtSide(aSide, aState);
+ }
+ }
+ }
+
+ public static boolean getConnectionState(byte aSide, ICoverable aTile) {
+ String aKey = generateUniqueKey(aSide, aTile);
+ return getConnectionState(aKey);
+ }
+
+ public static boolean getConnectionState(String aKey) {
+ Integer b = sConnectionStateForEntityMap.get(aKey);
+ // Logger.INFO("Get State: "+b+" | "+aKey);
+ return b != null ? b == VALUE_ON : false;
+ }
+
+ public static final boolean getCoverConnections(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ return aNBT.getBoolean("AllowConnections");
+ }
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java
index 69dd5ac9e9..a55cae39ea 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java
@@ -1,8 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.helpers;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
+import static gregtech.api.GregTech_API.mEUtoRF;
import cofh.api.energy.IEnergyContainerItem;
import cpw.mods.fml.common.eventhandler.EventPriority;
@@ -12,7 +10,6 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.common.items.GT_MetaGenerated_Item_01;
import gregtech.common.items.GT_MetaGenerated_Item_02;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
-import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.api.objects.minecraft.BlockPos;
@@ -24,425 +21,440 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaWirelessCharger;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
-import static gregtech.api.GregTech_API.mEUtoRF;
-
public class ChargingHelper {
- private static Map<String, Pair<GregtechMetaWirelessCharger, Byte>> mValidPlayers = new HashMap<String, Pair<GregtechMetaWirelessCharger, Byte>>();
- protected static Map<BlockPos, GregtechMetaWirelessCharger> mChargerMap = new HashMap<BlockPos, GregtechMetaWirelessCharger>();
- private int mTickTimer = 0;
- private final int mTickMultiplier = 20;
-
- //Called whenever the player is updated or ticked.
- @SubscribeEvent(priority = EventPriority.HIGHEST)
- public void onPlayerTick(LivingUpdateEvent event) {
- try {
- if (event.entity != null && event.entityLiving != null){
- if (event.entityLiving instanceof EntityPlayer){
- EntityPlayer mPlayerMan = (EntityPlayer) event.entityLiving;
-
-
- if (mPlayerMan != null){
- //Utils.LOG_WARNING("Found Player.");
-
- if (Utils.isServer()){
- //Utils.LOG_WARNING("Found Server-Side.");
-
- mTickTimer++;
- if (mTickTimer % mTickMultiplier == 0){
-
- long mVoltage = 0;
- long mEuStored = 0;
-
- if (!mChargerMap.isEmpty() && mValidPlayers.containsKey(mPlayerMan.getDisplayName())){
- InventoryPlayer mPlayerInventory = mPlayerMan.inventory;
- ItemStack[] mArmourContents = mPlayerInventory.armorInventory.clone();
- ItemStack[] mInventoryContents = mPlayerInventory.mainInventory.clone();
-
- for (GregtechMetaWirelessCharger mEntityTemp : mChargerMap.values()){
- if (mEntityTemp != null){
- if (mEntityTemp.getBaseMetaTileEntity() == null || !mEntityTemp.getBaseMetaTileEntity().isAllowedToWork()) continue;
- if (mPlayerMan.getEntityWorld().provider.dimensionId == mEntityTemp.getDimensionID()){
- mVoltage = mEntityTemp.maxEUInput();
- mEuStored = mEntityTemp.getEUVar();
- if (mVoltage > 0 && mEuStored >= mVoltage){
-
- Map<String, UUID> LR = mEntityTemp.getLongRangeMap();
- Map<String, UUID> LO = mEntityTemp.getLocalMap();
-
- long mStartingEu = mEntityTemp.getEUVar();
- long mCurrentEu = mEntityTemp.getEUVar();
- long mEuUsed = 0;
- if (mEntityTemp.getMode() == 0){
- if (!LR.isEmpty() && LR.containsKey(mPlayerMan.getDisplayName())){
- mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
- mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
- }
- }
- else if (mEntityTemp.getMode() == 1){
- if (!LO.isEmpty() && LO.containsKey(mPlayerMan.getDisplayName())){
- mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
- mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
- }
- }
- else {
- if (!LR.isEmpty() && LR.containsKey(mPlayerMan.getDisplayName())){
- mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
- mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
- }
- if (!LO.isEmpty() && LO.containsKey(mPlayerMan.getDisplayName())){
- mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
- mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
- }
- }
-
- if ((mEuUsed = (mStartingEu - mCurrentEu)) <= 0 && mEntityTemp != null){
- long mMaxDistance;
- if (mEntityTemp.getMode() == 0){
- mMaxDistance = (4*GT_Values.V[mEntityTemp.getTier()]);
- }
- else if (mEntityTemp.getMode() == 1){
- mMaxDistance = (mEntityTemp.getTier()*10);
- }
- else {
- mMaxDistance = (4*GT_Values.V[mEntityTemp.getTier()]/2);
- }
- double mDistance = calculateDistance(mEntityTemp, mPlayerMan);
- long mVoltageCost = MathUtils.findPercentageOfInt(mMaxDistance, (float) mDistance);
-
- if (mVoltageCost > 0){
- if (mVoltageCost > mEntityTemp.maxEUInput()){
- mEntityTemp.setEUVar((mEntityTemp.getEUVar()-mEntityTemp.maxEUInput()));
- }
- else {
- mEntityTemp.setEUVar((mEntityTemp.getEUVar()-mVoltageCost));
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- catch (Throwable t){
- //Utils.LOG_WARNING("State of Wireless Charger changed in an invalid way, this prevented a crash.");
- if (!mChargerMap.isEmpty()){
- for (BlockPos aPos : mChargerMap.keySet()) {
- GregtechMetaWirelessCharger r = mChargerMap.get(aPos);
- if (r == null || r.getBaseMetaTileEntity().isInvalidTileEntity()){
- mChargerMap.remove(aPos);
- }
- }
- }
- //t.printStackTrace();
- }
-
-
- }
-
- public static boolean addEntry(BlockPos mPos, GregtechMetaWirelessCharger mEntity){
- if (mEntity == null){
- return false;
- }
- if (!mChargerMap.containsKey(mPos)){
- if (mChargerMap.put(mPos, mEntity) == null){
- return true;
- }
- else {
- return false;
- }
- }
- else {
- return true;
- }
- }
-
- public static boolean removeEntry(BlockPos mPos, GregtechMetaWirelessCharger mEntity){
- if (mEntity == null){
- return false;
- }
- if (mChargerMap.containsKey(mPos)){
- if (mChargerMap.remove(mPos, mEntity)){
- return true;
- }
- else {
- return false;
- }
- }
- else {
- return false;
- }
- }
-
- public static boolean addValidPlayer(EntityPlayer mPlayer, GregtechMetaWirelessCharger mEntity){
- if (mEntity == null){
- return false;
- }
- Logger.WARNING("trying to map new player");
- if (mValidPlayers.containsKey(mPlayer.getDisplayName())){
- Logger.WARNING("Key contains player already?");
- return false;
- }
- else {
- Logger.WARNING("key not found, adding");
- Pair<GregtechMetaWirelessCharger, Byte> mEntry = new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode());
- if (mValidPlayers.put(mPlayer.getDisplayName(), mEntry) == null){
- Logger.WARNING("Added a Player to the Tick Map.");
- return true;
- }
- else {
- Logger.WARNING("Tried to add player but it was already there?");
- return false;
- }
- }
- }
-
- public static boolean removeValidPlayer(EntityPlayer mPlayer, GregtechMetaWirelessCharger mEntity){
- if (mEntity == null){
- return false;
- }
- Logger.WARNING("trying to remove player from map");
- if (mValidPlayers.containsKey(mPlayer.getDisplayName())){
- Logger.WARNING("key found, removing");
- Pair<GregtechMetaWirelessCharger, Byte> mEntry = new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode());
- if (mValidPlayers.remove(mPlayer, mEntry)){
- Logger.WARNING("Removed a Player to the Tick Map.");
- return true;
- }
- else {
- Logger.WARNING("Tried to remove player but it was not there?");
- return false;
- }
- }
- else {
- Logger.WARNING("Key does not contain player?");
- return false;
- }
- }
-
- public double calculateDistance(GregtechMetaWirelessCharger mEntityTemp, EntityPlayer mPlayerMan){
- if (mEntityTemp == null || mPlayerMan == null){
- return 0;
- }
- return mEntityTemp.getDistanceBetweenTwoPositions(mEntityTemp.getTileEntityPosition(), mEntityTemp.getPositionOfEntity(mPlayerMan));
- }
-
- public long chargeItems(GregtechMetaWirelessCharger mEntity, ItemStack[] mItems, EntityPlayer mPlayer){
- if (mEntity == null){
- return -100;
- }
- if (mItems == null || mItems.length == 0){
- return mEntity.getEUVar();
- }
- long mInitialValue = mEntity.getEUVar();
- long mReturnValue = chargeItemsEx(mEntity, mItems, mPlayer);
- return ((mReturnValue < mInitialValue) ? mReturnValue : mInitialValue);
- }
-
- public long chargeItemsEx(GregtechMetaWirelessCharger mEntity, ItemStack[] mItems, EntityPlayer mPlayer){
-
- //Bad Entity
- if (mEntity == null){
- return -100;
- }
- //Bad Inventory
- if (mItems == null || mItems.length == 0){
- return mEntity.getEUVar();
- }
- //Set Variables to Charge
- int mChargedItems = 0;
- final int mTier = mEntity.getTier();
- final long mVoltage = mEntity.maxEUInput();
- long mEuStored = mEntity.getEUVar();
- final long mEuStoredOriginal = mEntity.getEUVar();
- //For Inventory Contents
-
- int mItemSlot = 0;
-
- for (ItemStack mTemp : mItems){
- mItemSlot++;
- if (mTemp != null){
- Logger.WARNING("Slot "+mItemSlot+" contains "+mTemp.getDisplayName());
- }
- //Is item Electrical
- if (isItemValid(mTemp)){
- Logger.WARNING("1");
-
- //Transfer Limit
- double mItemEuTLimit = ((IElectricItem) mTemp.getItem()).getTransferLimit(mTemp);
- //Check if Tile has more or equal EU to what can be transferred into the item.
- if (mEuStored >= mItemEuTLimit){
- Logger.WARNING("2");
-
- double mItemMaxCharge = ((IElectricItem) mTemp.getItem()).getMaxCharge(mTemp);
- double mitemCurrentCharge = ElectricItem.manager.getCharge(mTemp);
-
- if (mitemCurrentCharge >= mItemMaxCharge){
- continue;
- }
-
- //Try get charge direct from NBT for GT and IC2 stacks
- Logger.WARNING("3");
- if (mTemp.getItem() instanceof GT_MetaGenerated_Tool_01
- || mTemp.getItem() instanceof GT_MetaGenerated_Item_01
- || mTemp.getItem() instanceof GT_MetaGenerated_Item_02
- || ReflectionUtils.getClass("gregtech.common.items.GT_MetaGenerated_Item_03").isInstance(mTemp.getItem())
- || mTemp.getItem().getClass().getName().toLowerCase().equals(("gregtech.common.items.GT_MetaGenerated_Tool_01").toLowerCase())){
- if (!NBTUtils.hasKey(mTemp, "GT.ItemCharge")){
- if (!mTemp.getDisplayName().toLowerCase().contains("battery")){
- if (!GT_ModHandler.isElectricItem(mTemp)){
- continue;
- }
- }
- else {
- mitemCurrentCharge = 0;
- }
- }
- else {
- mitemCurrentCharge = NBTUtils.getLong(mTemp, "GT.ItemCharge");
- }
- }
- else if (mTemp.getItem() instanceof IElectricItem){
- mitemCurrentCharge = NBTUtils.getLong(mTemp, "charge");
- }
-
- double mVoltageIncrease;
- if (mItemEuTLimit >= mVoltage){
- mVoltageIncrease = mVoltage;
- }
- else if (mItemEuTLimit < mVoltage){
- mVoltageIncrease = mItemEuTLimit;
- }
- else {
- mVoltageIncrease = mItemEuTLimit;
- }
-
- Logger.WARNING("4");
-
- int mMulti;
- if ((mitemCurrentCharge + (mVoltageIncrease*20)) <= (mItemMaxCharge - (mVoltageIncrease*20))){
- mMulti = 20;
- }
- else if ((mitemCurrentCharge + (mVoltageIncrease*10)) <= (mItemMaxCharge - (mVoltageIncrease*10))){
- mMulti = 10;
- }
- else if ((mitemCurrentCharge + (mVoltageIncrease*5)) <= (mItemMaxCharge - (mVoltageIncrease*5))){
- mMulti = 5;
- }
- else {
- mMulti = 1;
- }
- Logger.WARNING("5");
-
-
- int mMultiVoltage = (int) (mMulti*mVoltageIncrease);
-
- if ((mitemCurrentCharge + mMultiVoltage) <= mItemMaxCharge){
- Logger.WARNING("6");
- int g = 0;
- if ((g = GT_ModHandler.chargeElectricItem(mTemp, mMultiVoltage, Integer.MAX_VALUE, true, false)) > 0){
- Logger.WARNING("6.5 - "+g+" - "+mMulti);
- for (int i=0; i<mMulti;i++){
- if (ElectricItem.manager.charge(mTemp, mVoltageIncrease, Integer.MAX_VALUE, false, false) > 0){
- continue;
- }
- }
- }
- if (ElectricItem.manager.getCharge(mTemp) > mitemCurrentCharge){
- Logger.WARNING("7");
- mEntity.setEUVar(mEuStored-(mVoltage*mMulti));
- mEuStored = mEntity.getEUVar();
- Logger.WARNING("Charged "+mTemp.getDisplayName()+" | Slot: "+mItemSlot+" | EU Multiplier: "+mMulti+" | EU/t input: "+mVoltageIncrease+" | EU/t consumed by Tile: "+mVoltage+" | Item Max Charge: "+mItemMaxCharge+" | Item Start Charge: "+mitemCurrentCharge+" | Item New Charge"+ElectricItem.manager.getCharge(mTemp));
- mChargedItems++;
- }
- }
-
- //Try top up Item Chrage
- mitemCurrentCharge = ElectricItem.manager.getCharge(mTemp);
- if (mitemCurrentCharge < mItemMaxCharge && mitemCurrentCharge >= (mItemMaxCharge-mVoltage)){
- int xDif = (int) (mItemMaxCharge - mitemCurrentCharge);
- Logger.WARNING("8 - "+xDif);
- int g = 0;
- if ((g = GT_ModHandler.chargeElectricItem(mTemp, xDif, Integer.MAX_VALUE, true, false)) >= 0){
- Logger.WARNING("8.5 - "+g);
- if (ElectricItem.manager.getCharge(mTemp) >= mItemMaxCharge){
- Logger.WARNING("9");
- mEntity.setEUVar(mEntity.getEUVar()-(xDif));
- mEuStored = mEntity.getEUVar();
- Logger.WARNING("Charged "+mTemp.getDisplayName()+" | Slot: "+mItemSlot+" | EU Multiplier: "+mMulti+" | EU/t input: "+mVoltageIncrease+" | EU/t consumed by Tile: "+mVoltage+" | Item Max Charge: "+mItemMaxCharge+" | Item Start Charge: "+mitemCurrentCharge+" | Item New Charge"+ElectricItem.manager.getCharge(mTemp));
- mChargedItems++;
- }
- }
- }
-
-
- }
- }
- else if (isItemValidRF(mTemp)) {
- try {
- IEnergyContainerItem rfItem = (IEnergyContainerItem)mTemp.getItem();
- long chargedPower = Math.min(rfItem.getMaxEnergyStored(mTemp) - rfItem.getEnergyStored(mTemp), mEntity.getEUVar() * mEUtoRF / 100L);
- chargedPower = rfItem.receiveEnergy(mTemp, chargedPower > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) chargedPower, false);
- chargedPower = chargedPower * 100L / mEUtoRF;
- mEntity.setEUVar(Math.max(mEntity.getEUVar() - chargedPower, 0));
- mChargedItems++;
- mEuStored = mEntity.getEUVar();
- } catch (Exception e) {
- Logger.WARNING("Failed charging of RF-Tool");
- }
- }
- else {
- if (mTemp != null){
- Logger.WARNING("Found Non-Valid item. "+mTemp.getDisplayName());
- }
- }
- }
-
- //Return Values
- if (mChargedItems < 1){
- return mEuStoredOriginal;
- }
-
- return mEntity.getEUVar();
- }
-
- public static boolean isItemValid(final ItemStack itemstack) {
- if (itemstack == null){
- return false;
- }
- if (GT_ModHandler.isElectricItem(itemstack)){
- return true;
- }
- if ((accepts(itemstack)) || (itemstack.getItem() instanceof IElectricItem)) {
- return true;
- }
- return false;
- }
-
- public static boolean isItemValidRF(final ItemStack itemStack) {
- return itemStack != null && LoadedMods.CoFHCore && itemStack.getItem() instanceof IEnergyContainerItem;
- }
-
- public static boolean accepts(final ItemStack stack) {
- if (stack == null) {
- return false;
- }
- else {
- return false;
- }
- //return (Info.itemEnergy.getEnergyValue(stack) > 0.0D) || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), 4, true, true, true) > 0.0D);
- }
-
+ private static Map<String, Pair<GregtechMetaWirelessCharger, Byte>> mValidPlayers =
+ new HashMap<String, Pair<GregtechMetaWirelessCharger, Byte>>();
+ protected static Map<BlockPos, GregtechMetaWirelessCharger> mChargerMap =
+ new HashMap<BlockPos, GregtechMetaWirelessCharger>();
+ private int mTickTimer = 0;
+ private final int mTickMultiplier = 20;
+
+ // Called whenever the player is updated or ticked.
+ @SubscribeEvent(priority = EventPriority.HIGHEST)
+ public void onPlayerTick(LivingUpdateEvent event) {
+ try {
+ if (event.entity != null && event.entityLiving != null) {
+ if (event.entityLiving instanceof EntityPlayer) {
+ EntityPlayer mPlayerMan = (EntityPlayer) event.entityLiving;
+
+ if (mPlayerMan != null) {
+ // Utils.LOG_WARNING("Found Player.");
+
+ if (Utils.isServer()) {
+ // Utils.LOG_WARNING("Found Server-Side.");
+
+ mTickTimer++;
+ if (mTickTimer % mTickMultiplier == 0) {
+
+ long mVoltage = 0;
+ long mEuStored = 0;
+
+ if (!mChargerMap.isEmpty() && mValidPlayers.containsKey(mPlayerMan.getDisplayName())) {
+ InventoryPlayer mPlayerInventory = mPlayerMan.inventory;
+ ItemStack[] mArmourContents = mPlayerInventory.armorInventory.clone();
+ ItemStack[] mInventoryContents = mPlayerInventory.mainInventory.clone();
+
+ for (GregtechMetaWirelessCharger mEntityTemp : mChargerMap.values()) {
+ if (mEntityTemp != null) {
+ if (mEntityTemp.getBaseMetaTileEntity() == null
+ || !mEntityTemp
+ .getBaseMetaTileEntity()
+ .isAllowedToWork()) continue;
+ if (mPlayerMan.getEntityWorld().provider.dimensionId
+ == mEntityTemp.getDimensionID()) {
+ mVoltage = mEntityTemp.maxEUInput();
+ mEuStored = mEntityTemp.getEUVar();
+ if (mVoltage > 0 && mEuStored >= mVoltage) {
+
+ Map<String, UUID> LR = mEntityTemp.getLongRangeMap();
+ Map<String, UUID> LO = mEntityTemp.getLocalMap();
+
+ long mStartingEu = mEntityTemp.getEUVar();
+ long mCurrentEu = mEntityTemp.getEUVar();
+ long mEuUsed = 0;
+ if (mEntityTemp.getMode() == 0) {
+ if (!LR.isEmpty()
+ && LR.containsKey(mPlayerMan.getDisplayName())) {
+ mCurrentEu = chargeItems(
+ mEntityTemp, mArmourContents, mPlayerMan);
+ mCurrentEu = chargeItems(
+ mEntityTemp, mInventoryContents, mPlayerMan);
+ }
+ } else if (mEntityTemp.getMode() == 1) {
+ if (!LO.isEmpty()
+ && LO.containsKey(mPlayerMan.getDisplayName())) {
+ mCurrentEu = chargeItems(
+ mEntityTemp, mArmourContents, mPlayerMan);
+ mCurrentEu = chargeItems(
+ mEntityTemp, mInventoryContents, mPlayerMan);
+ }
+ } else {
+ if (!LR.isEmpty()
+ && LR.containsKey(mPlayerMan.getDisplayName())) {
+ mCurrentEu = chargeItems(
+ mEntityTemp, mArmourContents, mPlayerMan);
+ mCurrentEu = chargeItems(
+ mEntityTemp, mInventoryContents, mPlayerMan);
+ }
+ if (!LO.isEmpty()
+ && LO.containsKey(mPlayerMan.getDisplayName())) {
+ mCurrentEu = chargeItems(
+ mEntityTemp, mArmourContents, mPlayerMan);
+ mCurrentEu = chargeItems(
+ mEntityTemp, mInventoryContents, mPlayerMan);
+ }
+ }
+
+ if ((mEuUsed = (mStartingEu - mCurrentEu)) <= 0
+ && mEntityTemp != null) {
+ long mMaxDistance;
+ if (mEntityTemp.getMode() == 0) {
+ mMaxDistance = (4 * GT_Values.V[mEntityTemp.getTier()]);
+ } else if (mEntityTemp.getMode() == 1) {
+ mMaxDistance = (mEntityTemp.getTier() * 10);
+ } else {
+ mMaxDistance = (4 * GT_Values.V[mEntityTemp.getTier()] / 2);
+ }
+ double mDistance = calculateDistance(mEntityTemp, mPlayerMan);
+ long mVoltageCost = MathUtils.findPercentageOfInt(
+ mMaxDistance, (float) mDistance);
+
+ if (mVoltageCost > 0) {
+ if (mVoltageCost > mEntityTemp.maxEUInput()) {
+ mEntityTemp.setEUVar((mEntityTemp.getEUVar()
+ - mEntityTemp.maxEUInput()));
+ } else {
+ mEntityTemp.setEUVar(
+ (mEntityTemp.getEUVar() - mVoltageCost));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ // Utils.LOG_WARNING("State of Wireless Charger changed in an invalid way, this prevented a crash.");
+ if (!mChargerMap.isEmpty()) {
+ for (BlockPos aPos : mChargerMap.keySet()) {
+ GregtechMetaWirelessCharger r = mChargerMap.get(aPos);
+ if (r == null || r.getBaseMetaTileEntity().isInvalidTileEntity()) {
+ mChargerMap.remove(aPos);
+ }
+ }
+ }
+ // t.printStackTrace();
+ }
+ }
+
+ public static boolean addEntry(BlockPos mPos, GregtechMetaWirelessCharger mEntity) {
+ if (mEntity == null) {
+ return false;
+ }
+ if (!mChargerMap.containsKey(mPos)) {
+ if (mChargerMap.put(mPos, mEntity) == null) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return true;
+ }
+ }
+
+ public static boolean removeEntry(BlockPos mPos, GregtechMetaWirelessCharger mEntity) {
+ if (mEntity == null) {
+ return false;
+ }
+ if (mChargerMap.containsKey(mPos)) {
+ if (mChargerMap.remove(mPos, mEntity)) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public static boolean addValidPlayer(EntityPlayer mPlayer, GregtechMetaWirelessCharger mEntity) {
+ if (mEntity == null) {
+ return false;
+ }
+ Logger.WARNING("trying to map new player");
+ if (mValidPlayers.containsKey(mPlayer.getDisplayName())) {
+ Logger.WARNING("Key contains player already?");
+ return false;
+ } else {
+ Logger.WARNING("key not found, adding");
+ Pair<GregtechMetaWirelessCharger, Byte> mEntry =
+ new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode());
+ if (mValidPlayers.put(mPlayer.getDisplayName(), mEntry) == null) {
+ Logger.WARNING("Added a Player to the Tick Map.");
+ return true;
+ } else {
+ Logger.WARNING("Tried to add player but it was already there?");
+ return false;
+ }
+ }
+ }
+
+ public static boolean removeValidPlayer(EntityPlayer mPlayer, GregtechMetaWirelessCharger mEntity) {
+ if (mEntity == null) {
+ return false;
+ }
+ Logger.WARNING("trying to remove player from map");
+ if (mValidPlayers.containsKey(mPlayer.getDisplayName())) {
+ Logger.WARNING("key found, removing");
+ Pair<GregtechMetaWirelessCharger, Byte> mEntry =
+ new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode());
+ if (mValidPlayers.remove(mPlayer, mEntry)) {
+ Logger.WARNING("Removed a Player to the Tick Map.");
+ return true;
+ } else {
+ Logger.WARNING("Tried to remove player but it was not there?");
+ return false;
+ }
+ } else {
+ Logger.WARNING("Key does not contain player?");
+ return false;
+ }
+ }
+
+ public double calculateDistance(GregtechMetaWirelessCharger mEntityTemp, EntityPlayer mPlayerMan) {
+ if (mEntityTemp == null || mPlayerMan == null) {
+ return 0;
+ }
+ return mEntityTemp.getDistanceBetweenTwoPositions(
+ mEntityTemp.getTileEntityPosition(), mEntityTemp.getPositionOfEntity(mPlayerMan));
+ }
+
+ public long chargeItems(GregtechMetaWirelessCharger mEntity, ItemStack[] mItems, EntityPlayer mPlayer) {
+ if (mEntity == null) {
+ return -100;
+ }
+ if (mItems == null || mItems.length == 0) {
+ return mEntity.getEUVar();
+ }
+ long mInitialValue = mEntity.getEUVar();
+ long mReturnValue = chargeItemsEx(mEntity, mItems, mPlayer);
+ return ((mReturnValue < mInitialValue) ? mReturnValue : mInitialValue);
+ }
+
+ public long chargeItemsEx(GregtechMetaWirelessCharger mEntity, ItemStack[] mItems, EntityPlayer mPlayer) {
+
+ // Bad Entity
+ if (mEntity == null) {
+ return -100;
+ }
+ // Bad Inventory
+ if (mItems == null || mItems.length == 0) {
+ return mEntity.getEUVar();
+ }
+ // Set Variables to Charge
+ int mChargedItems = 0;
+ final int mTier = mEntity.getTier();
+ final long mVoltage = mEntity.maxEUInput();
+ long mEuStored = mEntity.getEUVar();
+ final long mEuStoredOriginal = mEntity.getEUVar();
+ // For Inventory Contents
+
+ int mItemSlot = 0;
+
+ for (ItemStack mTemp : mItems) {
+ mItemSlot++;
+ if (mTemp != null) {
+ Logger.WARNING("Slot " + mItemSlot + " contains " + mTemp.getDisplayName());
+ }
+ // Is item Electrical
+ if (isItemValid(mTemp)) {
+ Logger.WARNING("1");
+
+ // Transfer Limit
+ double mItemEuTLimit = ((IElectricItem) mTemp.getItem()).getTransferLimit(mTemp);
+ // Check if Tile has more or equal EU to what can be transferred into the item.
+ if (mEuStored >= mItemEuTLimit) {
+ Logger.WARNING("2");
+
+ double mItemMaxCharge = ((IElectricItem) mTemp.getItem()).getMaxCharge(mTemp);
+ double mitemCurrentCharge = ElectricItem.manager.getCharge(mTemp);
+
+ if (mitemCurrentCharge >= mItemMaxCharge) {
+ continue;
+ }
+
+ // Try get charge direct from NBT for GT and IC2 stacks
+ Logger.WARNING("3");
+ if (mTemp.getItem() instanceof GT_MetaGenerated_Tool_01
+ || mTemp.getItem() instanceof GT_MetaGenerated_Item_01
+ || mTemp.getItem() instanceof GT_MetaGenerated_Item_02
+ || ReflectionUtils.getClass("gregtech.common.items.GT_MetaGenerated_Item_03")
+ .isInstance(mTemp.getItem())
+ || mTemp.getItem()
+ .getClass()
+ .getName()
+ .toLowerCase()
+ .equals(("gregtech.common.items.GT_MetaGenerated_Tool_01").toLowerCase())) {
+ if (!NBTUtils.hasKey(mTemp, "GT.ItemCharge")) {
+ if (!mTemp.getDisplayName().toLowerCase().contains("battery")) {
+ if (!GT_ModHandler.isElectricItem(mTemp)) {
+ continue;
+ }
+ } else {
+ mitemCurrentCharge = 0;
+ }
+ } else {
+ mitemCurrentCharge = NBTUtils.getLong(mTemp, "GT.ItemCharge");
+ }
+ } else if (mTemp.getItem() instanceof IElectricItem) {
+ mitemCurrentCharge = NBTUtils.getLong(mTemp, "charge");
+ }
+
+ double mVoltageIncrease;
+ if (mItemEuTLimit >= mVoltage) {
+ mVoltageIncrease = mVoltage;
+ } else if (mItemEuTLimit < mVoltage) {
+ mVoltageIncrease = mItemEuTLimit;
+ } else {
+ mVoltageIncrease = mItemEuTLimit;
+ }
+
+ Logger.WARNING("4");
+
+ int mMulti;
+ if ((mitemCurrentCharge + (mVoltageIncrease * 20)) <= (mItemMaxCharge - (mVoltageIncrease * 20))) {
+ mMulti = 20;
+ } else if ((mitemCurrentCharge + (mVoltageIncrease * 10))
+ <= (mItemMaxCharge - (mVoltageIncrease * 10))) {
+ mMulti = 10;
+ } else if ((mitemCurrentCharge + (mVoltageIncrease * 5))
+ <= (mItemMaxCharge - (mVoltageIncrease * 5))) {
+ mMulti = 5;
+ } else {
+ mMulti = 1;
+ }
+ Logger.WARNING("5");
+
+ int mMultiVoltage = (int) (mMulti * mVoltageIncrease);
+
+ if ((mitemCurrentCharge + mMultiVoltage) <= mItemMaxCharge) {
+ Logger.WARNING("6");
+ int g = 0;
+ if ((g = GT_ModHandler.chargeElectricItem(mTemp, mMultiVoltage, Integer.MAX_VALUE, true, false))
+ > 0) {
+ Logger.WARNING("6.5 - " + g + " - " + mMulti);
+ for (int i = 0; i < mMulti; i++) {
+ if (ElectricItem.manager.charge(
+ mTemp, mVoltageIncrease, Integer.MAX_VALUE, false, false)
+ > 0) {
+ continue;
+ }
+ }
+ }
+ if (ElectricItem.manager.getCharge(mTemp) > mitemCurrentCharge) {
+ Logger.WARNING("7");
+ mEntity.setEUVar(mEuStored - (mVoltage * mMulti));
+ mEuStored = mEntity.getEUVar();
+ Logger.WARNING("Charged " + mTemp.getDisplayName() + " | Slot: " + mItemSlot
+ + " | EU Multiplier: " + mMulti + " | EU/t input: " + mVoltageIncrease
+ + " | EU/t consumed by Tile: " + mVoltage + " | Item Max Charge: " + mItemMaxCharge
+ + " | Item Start Charge: " + mitemCurrentCharge + " | Item New Charge"
+ + ElectricItem.manager.getCharge(mTemp));
+ mChargedItems++;
+ }
+ }
+
+ // Try top up Item Chrage
+ mitemCurrentCharge = ElectricItem.manager.getCharge(mTemp);
+ if (mitemCurrentCharge < mItemMaxCharge && mitemCurrentCharge >= (mItemMaxCharge - mVoltage)) {
+ int xDif = (int) (mItemMaxCharge - mitemCurrentCharge);
+ Logger.WARNING("8 - " + xDif);
+ int g = 0;
+ if ((g = GT_ModHandler.chargeElectricItem(mTemp, xDif, Integer.MAX_VALUE, true, false)) >= 0) {
+ Logger.WARNING("8.5 - " + g);
+ if (ElectricItem.manager.getCharge(mTemp) >= mItemMaxCharge) {
+ Logger.WARNING("9");
+ mEntity.setEUVar(mEntity.getEUVar() - (xDif));
+ mEuStored = mEntity.getEUVar();
+ Logger.WARNING("Charged " + mTemp.getDisplayName() + " | Slot: " + mItemSlot
+ + " | EU Multiplier: " + mMulti + " | EU/t input: " + mVoltageIncrease
+ + " | EU/t consumed by Tile: " + mVoltage + " | Item Max Charge: "
+ + mItemMaxCharge + " | Item Start Charge: " + mitemCurrentCharge
+ + " | Item New Charge" + ElectricItem.manager.getCharge(mTemp));
+ mChargedItems++;
+ }
+ }
+ }
+ }
+ } else if (isItemValidRF(mTemp)) {
+ try {
+ IEnergyContainerItem rfItem = (IEnergyContainerItem) mTemp.getItem();
+ long chargedPower = Math.min(
+ rfItem.getMaxEnergyStored(mTemp) - rfItem.getEnergyStored(mTemp),
+ mEntity.getEUVar() * mEUtoRF / 100L);
+ chargedPower = rfItem.receiveEnergy(
+ mTemp, chargedPower > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) chargedPower, false);
+ chargedPower = chargedPower * 100L / mEUtoRF;
+ mEntity.setEUVar(Math.max(mEntity.getEUVar() - chargedPower, 0));
+ mChargedItems++;
+ mEuStored = mEntity.getEUVar();
+ } catch (Exception e) {
+ Logger.WARNING("Failed charging of RF-Tool");
+ }
+ } else {
+ if (mTemp != null) {
+ Logger.WARNING("Found Non-Valid item. " + mTemp.getDisplayName());
+ }
+ }
+ }
+
+ // Return Values
+ if (mChargedItems < 1) {
+ return mEuStoredOriginal;
+ }
+
+ return mEntity.getEUVar();
+ }
+
+ public static boolean isItemValid(final ItemStack itemstack) {
+ if (itemstack == null) {
+ return false;
+ }
+ if (GT_ModHandler.isElectricItem(itemstack)) {
+ return true;
+ }
+ if ((accepts(itemstack)) || (itemstack.getItem() instanceof IElectricItem)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isItemValidRF(final ItemStack itemStack) {
+ return itemStack != null && LoadedMods.CoFHCore && itemStack.getItem() instanceof IEnergyContainerItem;
+ }
+
+ public static boolean accepts(final ItemStack stack) {
+ if (stack == null) {
+ return false;
+ } else {
+ return false;
+ }
+ // return (Info.itemEnergy.getEnergyValue(stack) > 0.0D) || (ElectricItem.manager.discharge(stack, (1.0D /
+ // 0.0D), 4, true, true, true) > 0.0D);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java
index e06636e168..bb81c349a0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java
@@ -1,42 +1,38 @@
package gtPlusPlus.xmod.gregtech.common.helpers;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.world.World;
-import net.minecraft.world.WorldServer;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Container;
import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Utils;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GT4Entity_AutoCrafter;
-import net.minecraftforge.common.util.FakePlayerFactory;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.world.World;
-public class CraftingHelper{
+public class CraftingHelper {
- public final String mInventoryName;
- public final int mPosX;
- public final int mPosY;
- public final int mPosZ;
- public final GT4Entity_AutoCrafter crafter;
- public final World world;
- public final EntityPlayerMP player;
- public final AC_Helper_Container inventory;
+ public final String mInventoryName;
+ public final int mPosX;
+ public final int mPosY;
+ public final int mPosZ;
+ public final GT4Entity_AutoCrafter crafter;
+ public final World world;
+ public final EntityPlayerMP player;
+ public final AC_Helper_Container inventory;
- public CraftingHelper(GT4Entity_AutoCrafter AC){
- Logger.INFO("[A-C] Created a crafting helper.");
- crafter = AC;
- AC_Helper_Utils.addCrafter(AC);
- //Get some variables.
- world = AC.getBaseMetaTileEntity().getWorld();
- mPosX = AC.getBaseMetaTileEntity().getXCoord();
- mPosY = AC.getBaseMetaTileEntity().getYCoord();
- mPosZ = AC.getBaseMetaTileEntity().getZCoord();
- //Create Fake player to handle crating.
-
- player = CORE.getFakePlayer(world);
- //Set storage container
- inventory = new AC_Helper_Container(player.inventory, world, mPosX, mPosY, mPosZ);
- mInventoryName = inventory.getMatrix().getInventoryName();
+ public CraftingHelper(GT4Entity_AutoCrafter AC) {
+ Logger.INFO("[A-C] Created a crafting helper.");
+ crafter = AC;
+ AC_Helper_Utils.addCrafter(AC);
+ // Get some variables.
+ world = AC.getBaseMetaTileEntity().getWorld();
+ mPosX = AC.getBaseMetaTileEntity().getXCoord();
+ mPosY = AC.getBaseMetaTileEntity().getYCoord();
+ mPosZ = AC.getBaseMetaTileEntity().getZCoord();
+ // Create Fake player to handle crating.
- }
-} \ No newline at end of file
+ player = CORE.getFakePlayer(world);
+ // Set storage container
+ inventory = new AC_Helper_Container(player.inventory, world, mPosX, mPosY, mPosZ);
+ mInventoryName = inventory.getMatrix().getInventoryName();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java
index 8a2c82535f..bb8dac49d7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java
@@ -1,63 +1,60 @@
package gtPlusPlus.xmod.gregtech.common.helpers;
-import java.util.HashMap;
-
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.sys.Log;
import gtPlusPlus.xmod.gregtech.api.enums.CustomOrePrefix;
+import java.util.HashMap;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class FlotationRecipeHandler {
- private static final HashMap<String, Material> sMaterialMap = new HashMap<String, Material>();
- private static final HashMap<String, ItemStack> sMilledMap = new HashMap<String, ItemStack>();
-
- public static boolean registerOreType(Material aMaterial) {
- String aMaterialKey = aMaterial.getUnlocalizedName();
- if (sMaterialMap.containsKey(aMaterialKey)) {
- Log.warn("Tried to register a Flotation material already in use. Material: "+aMaterialKey);
- return false;
- }
- else {
- sMaterialMap.put(aMaterialKey, aMaterial);
- sMilledMap.put(aMaterialKey, aMaterial.getMilled(1));
- }
- return true;
- }
-
- public static Material getMaterialOfMilledProduct(ItemStack aMilled) {
- for (String aKey : sMilledMap.keySet()) {
- ItemStack aTempMilledStack = sMilledMap.get(aKey);
- if (GT_Utility.areStacksEqual(aTempMilledStack, aMilled, true)) {
- return sMaterialMap.get(aKey);
- }
- }
- return null;
- }
-
- public static ItemStack findMilledStack(GT_Recipe aRecipe) {
- if (aRecipe == null || aRecipe.mInputs == null || aRecipe.mInputs.length <= 0) {
- return null;
- }
- return findMilledStack(aRecipe.mInputs);
- }
-
- public static ItemStack findMilledStack(ItemStack[] aInputs) {
- if (aInputs == null || aInputs.length <= 0) {
- return null;
- }
- for (ItemStack aStack : aInputs) {
- for (int oredictID : OreDictionary.getOreIDs(aStack)) {
- String oredict = OreDictionary.getOreName(oredictID);
- if (oredict.startsWith(CustomOrePrefix.milled.toString())) {
- return aStack;
- }
- }
- }
- return null;
- }
-
+ private static final HashMap<String, Material> sMaterialMap = new HashMap<String, Material>();
+ private static final HashMap<String, ItemStack> sMilledMap = new HashMap<String, ItemStack>();
+
+ public static boolean registerOreType(Material aMaterial) {
+ String aMaterialKey = aMaterial.getUnlocalizedName();
+ if (sMaterialMap.containsKey(aMaterialKey)) {
+ Log.warn("Tried to register a Flotation material already in use. Material: " + aMaterialKey);
+ return false;
+ } else {
+ sMaterialMap.put(aMaterialKey, aMaterial);
+ sMilledMap.put(aMaterialKey, aMaterial.getMilled(1));
+ }
+ return true;
+ }
+
+ public static Material getMaterialOfMilledProduct(ItemStack aMilled) {
+ for (String aKey : sMilledMap.keySet()) {
+ ItemStack aTempMilledStack = sMilledMap.get(aKey);
+ if (GT_Utility.areStacksEqual(aTempMilledStack, aMilled, true)) {
+ return sMaterialMap.get(aKey);
+ }
+ }
+ return null;
+ }
+
+ public static ItemStack findMilledStack(GT_Recipe aRecipe) {
+ if (aRecipe == null || aRecipe.mInputs == null || aRecipe.mInputs.length <= 0) {
+ return null;
+ }
+ return findMilledStack(aRecipe.mInputs);
+ }
+
+ public static ItemStack findMilledStack(ItemStack[] aInputs) {
+ if (aInputs == null || aInputs.length <= 0) {
+ return null;
+ }
+ for (ItemStack aStack : aInputs) {
+ for (int oredictID : OreDictionary.getOreIDs(aStack)) {
+ String oredict = OreDictionary.getOreName(oredictID);
+ if (oredict.startsWith(CustomOrePrefix.milled.toString())) {
+ return aStack;
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java
index d51107bbf0..0b60e057f4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java
@@ -1,80 +1,80 @@
package gtPlusPlus.xmod.gregtech.common.helpers;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
public class GT_MethodHelper {
- private static final Method mGetTexture;
- private static final Class mITexturedTileEntity;
-
- static {
- Class clazz = null;
- Method aMeth = null;
- if (ReflectionUtils.doesClassExist("gregtech.api.interfaces.tileentity.ITexturedTileEntity")) {
- clazz = ReflectionUtils.getClass("gregtech.api.interfaces.tileentity.ITexturedTileEntity");
- aMeth = ReflectionUtils.getMethod(clazz, "getTexture", Block.class, byte.class);
- }
- mITexturedTileEntity = clazz;
- mGetTexture = aMeth;
- }
-
+ private static final Method mGetTexture;
+ private static final Class mITexturedTileEntity;
- public static ITexture[] getTexture(TileEntity tTileEntity, Block aBlock, byte aSide) {
+ static {
+ Class clazz = null;
+ Method aMeth = null;
+ if (ReflectionUtils.doesClassExist("gregtech.api.interfaces.tileentity.ITexturedTileEntity")) {
+ clazz = ReflectionUtils.getClass("gregtech.api.interfaces.tileentity.ITexturedTileEntity");
+ aMeth = ReflectionUtils.getMethod(clazz, "getTexture", Block.class, byte.class);
+ }
+ mITexturedTileEntity = clazz;
+ mGetTexture = aMeth;
+ }
- if (mITexturedTileEntity.isInstance(tTileEntity)) {
+ public static ITexture[] getTexture(TileEntity tTileEntity, Block aBlock, byte aSide) {
- if (mGetTexture != null) {
- try {
- mGetTexture.invoke(tTileEntity, aBlock, aSide);
- }
- catch (IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- e.printStackTrace();
- }
- }
- else {
- if (tTileEntity instanceof BaseMetaTileEntity) {
- try {
- BaseMetaTileEntity aTile = (BaseMetaTileEntity) tTileEntity;
- ITexture rIcon = aTile.getCoverTexture(aSide);
- Field aFacing = ReflectionUtils.getField(BaseMetaTileEntity.class, "mFacing");
- Field aColor = ReflectionUtils.getField(BaseMetaTileEntity.class, "mColor");
- Field aActive = ReflectionUtils.getField(BaseMetaTileEntity.class, "mActive");
- Field aMetaTile = ReflectionUtils.getField(BaseMetaTileEntity.class, "mMetaTileEntity");
- Method aHasValidTile = ReflectionUtils.getMethod(BaseMetaTileEntity.class, "hasValidMetaTileEntity", new Class[] {});
+ if (mITexturedTileEntity.isInstance(tTileEntity)) {
- boolean hasValidTileObj = (boolean) aHasValidTile.invoke(aTile, new Object[] {});
- boolean aActiveObj = aActive.getBoolean(aTile);
- byte aFacingObj = aFacing.getByte(aTile);
- byte aColorObj = aColor.getByte(aTile);;
- MetaTileEntity aMetaTileObj = (MetaTileEntity) aMetaTile.get(aTile);
+ if (mGetTexture != null) {
+ try {
+ mGetTexture.invoke(tTileEntity, aBlock, aSide);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ } else {
+ if (tTileEntity instanceof BaseMetaTileEntity) {
+ try {
+ BaseMetaTileEntity aTile = (BaseMetaTileEntity) tTileEntity;
+ ITexture rIcon = aTile.getCoverTexture(aSide);
+ Field aFacing = ReflectionUtils.getField(BaseMetaTileEntity.class, "mFacing");
+ Field aColor = ReflectionUtils.getField(BaseMetaTileEntity.class, "mColor");
+ Field aActive = ReflectionUtils.getField(BaseMetaTileEntity.class, "mActive");
+ Field aMetaTile = ReflectionUtils.getField(BaseMetaTileEntity.class, "mMetaTileEntity");
+ Method aHasValidTile = ReflectionUtils.getMethod(
+ BaseMetaTileEntity.class, "hasValidMetaTileEntity", new Class[] {});
- if (rIcon != null) {
- return new ITexture[]{rIcon};
- } else {
- return hasValidTileObj
- ? aMetaTileObj.getTexture(aTile, aSide, aFacingObj, (byte) (aColorObj - 1), aActiveObj,
- aTile.getOutputRedstoneSignal(aSide) > 0)
- : BlockIcons.ERROR_RENDERING;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
- }
- }
- return BlockIcons.ERROR_RENDERING;
- }
+ boolean hasValidTileObj = (boolean) aHasValidTile.invoke(aTile, new Object[] {});
+ boolean aActiveObj = aActive.getBoolean(aTile);
+ byte aFacingObj = aFacing.getByte(aTile);
+ byte aColorObj = aColor.getByte(aTile);
+ ;
+ MetaTileEntity aMetaTileObj = (MetaTileEntity) aMetaTile.get(aTile);
+ if (rIcon != null) {
+ return new ITexture[] {rIcon};
+ } else {
+ return hasValidTileObj
+ ? aMetaTileObj.getTexture(
+ aTile,
+ aSide,
+ aFacingObj,
+ (byte) (aColorObj - 1),
+ aActiveObj,
+ aTile.getOutputRedstoneSignal(aSide) > 0)
+ : BlockIcons.ERROR_RENDERING;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ }
+ return BlockIcons.ERROR_RENDERING;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java
index 0b52560e0d..8263243474 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java
@@ -1,42 +1,39 @@
package gtPlusPlus.xmod.gregtech.common.helpers;
-import java.util.HashMap;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gregtech.api.GregTech_API;
+import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraftforge.event.world.BlockEvent;
public class MachineUpdateHandler {
- private static final HashMap<String, Block> mBlockCache = new HashMap<String, Block>();
-
- public static void registerBlockToCauseMachineUpdate(String aUnlocalName, Block aBlock) {
- mBlockCache.put(aUnlocalName, aBlock);
- }
-
+ private static final HashMap<String, Block> mBlockCache = new HashMap<String, Block>();
+
+ public static void registerBlockToCauseMachineUpdate(String aUnlocalName, Block aBlock) {
+ mBlockCache.put(aUnlocalName, aBlock);
+ }
+
@SubscribeEvent
public void onBlockEvent(BlockEvent event) {
- Block aBlock = event.block;
- String aUnlocalName = aBlock != null ? aBlock.getUnlocalizedName() : "NULL";
- boolean aDoUpdate = false;
- if (aBlock != null && aUnlocalName != null && !aUnlocalName.equals("NULL")) {
- for (String aCachedName : mBlockCache.keySet()) {
- if (aCachedName.equals(aUnlocalName)) {
- aDoUpdate = true;
- break;
- }
- else {
- if (aBlock == mBlockCache.get(aCachedName)) {
- aDoUpdate = true;
- break;
- }
- }
- }
- if (aDoUpdate) {
- GregTech_API.causeMachineUpdate(event.world, event.x, event.y, event.z);
- }
- }
+ Block aBlock = event.block;
+ String aUnlocalName = aBlock != null ? aBlock.getUnlocalizedName() : "NULL";
+ boolean aDoUpdate = false;
+ if (aBlock != null && aUnlocalName != null && !aUnlocalName.equals("NULL")) {
+ for (String aCachedName : mBlockCache.keySet()) {
+ if (aCachedName.equals(aUnlocalName)) {
+ aDoUpdate = true;
+ break;
+ } else {
+ if (aBlock == mBlockCache.get(aCachedName)) {
+ aDoUpdate = true;
+ break;
+ }
+ }
+ }
+ if (aDoUpdate) {
+ GregTech_API.causeMachineUpdate(event.world, event.x, event.y, event.z);
+ }
+ }
}
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java
index 1ab479a2d5..d054e5da3b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java
@@ -1,5 +1,7 @@
package gtPlusPlus.xmod.gregtech.common.helpers;
+import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableTreeFarmerParticles;
+
import com.google.common.collect.Lists;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Optional;
@@ -28,6 +30,15 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.particles.BlockBreakParticles;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+import java.util.Stack;
+import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.block.IGrowable;
@@ -47,224 +58,215 @@ import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Set;
-import java.util.Stack;
-import java.util.concurrent.ConcurrentHashMap;
+public class TreeFarmHelper {
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableTreeFarmerParticles;
+ public static final FluidStack fertT1 = FluidUtils.getFluidStack("fluid.fertiliser", 3);
+ public static final FluidStack fertT2 = FluidUtils.getFluidStack("fluid.un18fertiliser", 2);
+ public static final FluidStack fertT3 = FluidUtils.getFluidStack("fluid.un32fertiliser", 1);
+ private static final int sawOreId = OreDictionary.getOreID(ToolDictNames.craftingToolSaw.name());
+
+ public static ITexture[][][] getTextureSet() {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = TreeFarmHelper.getFront(i);
+ rTextures[1][i + 1] = TreeFarmHelper.getBack(i);
+ rTextures[2][i + 1] = TreeFarmHelper.getBottom(i);
+ rTextures[3][i + 1] = TreeFarmHelper.getTop(i);
+ rTextures[4][i + 1] = TreeFarmHelper.getSides(i);
+ rTextures[5][i + 1] = TreeFarmHelper.getFrontActive(i);
+ rTextures[6][i + 1] = TreeFarmHelper.getBackActive(i);
+ rTextures[7][i + 1] = TreeFarmHelper.getBottomActive(i);
+ rTextures[8][i + 1] = TreeFarmHelper.getTopActive(i);
+ rTextures[9][i + 1] = TreeFarmHelper.getSidesActive(i);
+ }
+ return rTextures;
+ }
-public class TreeFarmHelper {
+ public static ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
+ }
- public static final FluidStack fertT1 = FluidUtils.getFluidStack("fluid.fertiliser", 3);
- public static final FluidStack fertT2 = FluidUtils.getFluidStack("fluid.un18fertiliser", 2);
- public static final FluidStack fertT3 = FluidUtils.getFluidStack("fluid.un32fertiliser", 1);
- private static final int sawOreId = OreDictionary.getOreID(ToolDictNames.craftingToolSaw.name());
-
- public static ITexture[][][] getTextureSet() {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = TreeFarmHelper.getFront(i);
- rTextures[1][i + 1] = TreeFarmHelper.getBack(i);
- rTextures[2][i + 1] = TreeFarmHelper.getBottom(i);
- rTextures[3][i + 1] = TreeFarmHelper.getTop(i);
- rTextures[4][i + 1] = TreeFarmHelper.getSides(i);
- rTextures[5][i + 1] = TreeFarmHelper.getFrontActive(i);
- rTextures[6][i + 1] = TreeFarmHelper.getBackActive(i);
- rTextures[7][i + 1] = TreeFarmHelper.getBottomActive(i);
- rTextures[8][i + 1] = TreeFarmHelper.getTopActive(i);
- rTextures[9][i + 1] = TreeFarmHelper.getSidesActive(i);
- }
- return rTextures;
- }
-
- public static ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
- }
-
- public static ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
- }
-
- public static ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
- }
-
- public static ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
- }
-
- public static ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
- }
-
- public static ITexture[] getFrontActive(final byte aColor) {
- return getFront(aColor);
- }
-
- public static ITexture[] getBackActive(final byte aColor) {
- return getBack(aColor);
- }
-
- public static ITexture[] getBottomActive(final byte aColor) {
- return getBottom(aColor);
- }
-
- public static ITexture[] getTopActive(final byte aColor) {
- return getTop(aColor);
- }
-
- public static ITexture[] getSidesActive(final byte aColor) {
- return getSides(aColor);
- }
-
- public static boolean applyBonemeal(final EntityPlayer player, final World world, final int intX, final int intY, final int intZ, final short multiplier){
- final Block block = world.getBlock(intX, intY, intZ);
-
-
- int roll;
- int rollNeeded;
-
- if (multiplier==1){
- roll = MathUtils.randInt(1, 15);
- rollNeeded = 15;
- }
- else if (multiplier==2){
- roll = MathUtils.randInt(1, 10);
- rollNeeded = 10;
- }
- else {
- roll = MathUtils.randInt(1, 5);
- rollNeeded = 5;
- }
-
- if (roll != rollNeeded){
- return false;
- }
-
- //EntityPlayer player = FakePlayerFactory.getMinecraft((WorldServer)world);
- if (!world.isRemote){
- if (enableTreeFarmerParticles){
- world.playAuxSFX(2005, intX, intY, intZ, 0);
- }
- }
- final BonemealEvent event = new BonemealEvent(player, world, block, intX, intY, intZ);
- if (MinecraftForge.EVENT_BUS.post(event)){
- Logger.MACHINE_INFO("Not sure why this returned false");
- return false;
- }
- if (event.getResult() == Result.ALLOW){
- if (!world.isRemote){
- world.playAuxSFX(2005, intX, intY, intZ, 0);
- }
- return true;
- }
- if (block instanceof IGrowable){
- final IGrowable igrowable = (IGrowable)block;
- if (igrowable.func_149851_a(world, intX, intY, intZ, world.isRemote)){
- if (!world.isRemote){
- if (igrowable.func_149852_a(world, CORE.RANDOM, intX, intY, intZ)){
- igrowable.func_149853_b(world, CORE.RANDOM, intX, intY, intZ);
- }
- }
- return true;
- }
- }
- return false;
- }
-
- public static boolean cleanUp(final IGregTechTileEntity aBaseMetaTileEntity){
- Logger.MACHINE_INFO("called cleanUp()");
- int cleanedUp = 0;
- final int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 11;
- final int zDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 11;
-
- for (int h=1;h<175;h++){
- for (int i = -11; i <= 11; i++) {
- for (int j = -11; j <= 11; j++) {
-
- final Block testBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
-
-
- if
- ((
- ((i == -8) || (i == 8)) ||
- ((i == -9) || (i == 9)) ||
- ((i == -10) || (i == 10)) ||
- ((i == -11) || (i == 11))
- )
- &&
- (
- ((j == -8) || (j == 8)) ||
- ((j == -9) || (j == 9)) ||
- ((j == -10) || (j == 10)) ||
- ((j == -11) || (j == 11))
- )){
-
- if (!testBlock.getUnlocalizedName().toLowerCase().contains("air") || !testBlock.getUnlocalizedName().toLowerCase().contains("pumpkin")) {
- //Logger.WARNING("5:"+testBlock.getUnlocalizedName());
- } else {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord()+xDir+i, aBaseMetaTileEntity.getYCoord()+h, aBaseMetaTileEntity.getZCoord()+zDir+j, Blocks.bookshelf);
- }
- }
-
-
- //If not in the middle - don't know how else to check this one without lots of !=
- if (
- (i != 7) && (i != -7) && (j != 7) && (j != -7) &&
- (i != 6) && (i != -6) && (j != 6) && (j != -6) &&
- (i != 5) && (i != -5) && (j != 5) && (j != -5) &&
- (i != 4) && (i != -4) && (j != 4) && (j != -4) &&
- (i != 3) && (i != -3) && (j != 3) && (j != -3) &&
- (i != 2) && (i != -2) && (j != 2) && (j != -2) &&
- (i != 1) && (i != -1) && (j != 1) && (j != -1) &&
- (i != 0) && (j != 0)
- ){
-
- if (!testBlock.getUnlocalizedName().toLowerCase().contains("air") || !testBlock.getUnlocalizedName().toLowerCase().contains("pumpkin")) {
- //Logger.WARNING("0:"+testBlock.getUnlocalizedName());
- } else {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord()+xDir+i, aBaseMetaTileEntity.getYCoord()+h, aBaseMetaTileEntity.getZCoord()+zDir+j, Blocks.melon_block);
- }
-
-
- if (isLeaves(testBlock) || isWoodLog(testBlock)){
- //Logger.WARNING("1:"+testBlock.getUnlocalizedName());
- int posiX, posiY, posiZ;
- posiX = aBaseMetaTileEntity.getXCoord()+xDir+i;
- posiY = aBaseMetaTileEntity.getYCoord()+h;
- posiZ = aBaseMetaTileEntity.getZCoord()+zDir+j;
- //Utils.LOG_MACHINE_INFO("Cleaning Up some leftovers.");
- cleanedUp++;
- aBaseMetaTileEntity.getWorld().setBlockToAir(posiX, posiY, posiZ);
- new BlockBreakParticles(aBaseMetaTileEntity.getWorld(), posiX, posiY, posiZ, Blocks.dirt);
- }
- else {
- //Utils.LOG_WARNING("2:"+testBlock.getUnlocalizedName());
- }
- }
- else {
- //Utils.LOG_WARNING("1");
- }
-
-
- }
-
- }
- }
- Logger.MACHINE_INFO("cleaning up | "+cleanedUp );
- return true;
- }
-
-
- public static boolean isValidForGUI(final ItemStack aStack) {
- return isCorrectMachinePart(aStack) != SAWTOOL.NONE;
- }
+ public static ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
+ }
+
+ public static ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
+ }
+
+ public static ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
+ }
+
+ public static ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]};
+ }
+
+ public static ITexture[] getFrontActive(final byte aColor) {
+ return getFront(aColor);
+ }
+
+ public static ITexture[] getBackActive(final byte aColor) {
+ return getBack(aColor);
+ }
+
+ public static ITexture[] getBottomActive(final byte aColor) {
+ return getBottom(aColor);
+ }
+
+ public static ITexture[] getTopActive(final byte aColor) {
+ return getTop(aColor);
+ }
+
+ public static ITexture[] getSidesActive(final byte aColor) {
+ return getSides(aColor);
+ }
+
+ public static boolean applyBonemeal(
+ final EntityPlayer player,
+ final World world,
+ final int intX,
+ final int intY,
+ final int intZ,
+ final short multiplier) {
+ final Block block = world.getBlock(intX, intY, intZ);
+
+ int roll;
+ int rollNeeded;
+
+ if (multiplier == 1) {
+ roll = MathUtils.randInt(1, 15);
+ rollNeeded = 15;
+ } else if (multiplier == 2) {
+ roll = MathUtils.randInt(1, 10);
+ rollNeeded = 10;
+ } else {
+ roll = MathUtils.randInt(1, 5);
+ rollNeeded = 5;
+ }
+
+ if (roll != rollNeeded) {
+ return false;
+ }
+
+ // EntityPlayer player = FakePlayerFactory.getMinecraft((WorldServer)world);
+ if (!world.isRemote) {
+ if (enableTreeFarmerParticles) {
+ world.playAuxSFX(2005, intX, intY, intZ, 0);
+ }
+ }
+ final BonemealEvent event = new BonemealEvent(player, world, block, intX, intY, intZ);
+ if (MinecraftForge.EVENT_BUS.post(event)) {
+ Logger.MACHINE_INFO("Not sure why this returned false");
+ return false;
+ }
+ if (event.getResult() == Result.ALLOW) {
+ if (!world.isRemote) {
+ world.playAuxSFX(2005, intX, intY, intZ, 0);
+ }
+ return true;
+ }
+ if (block instanceof IGrowable) {
+ final IGrowable igrowable = (IGrowable) block;
+ if (igrowable.func_149851_a(world, intX, intY, intZ, world.isRemote)) {
+ if (!world.isRemote) {
+ if (igrowable.func_149852_a(world, CORE.RANDOM, intX, intY, intZ)) {
+ igrowable.func_149853_b(world, CORE.RANDOM, intX, intY, intZ);
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean cleanUp(final IGregTechTileEntity aBaseMetaTileEntity) {
+ Logger.MACHINE_INFO("called cleanUp()");
+ int cleanedUp = 0;
+ final int xDir =
+ net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing())
+ .offsetX
+ * 11;
+ final int zDir =
+ net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing())
+ .offsetZ
+ * 11;
+
+ for (int h = 1; h < 175; h++) {
+ for (int i = -11; i <= 11; i++) {
+ for (int j = -11; j <= 11; j++) {
+
+ final Block testBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+
+ if ((((i == -8) || (i == 8))
+ || ((i == -9) || (i == 9))
+ || ((i == -10) || (i == 10))
+ || ((i == -11) || (i == 11)))
+ && (((j == -8) || (j == 8))
+ || ((j == -9) || (j == 9))
+ || ((j == -10) || (j == 10))
+ || ((j == -11) || (j == 11)))) {
+
+ if (!testBlock.getUnlocalizedName().toLowerCase().contains("air")
+ || !testBlock.getUnlocalizedName().toLowerCase().contains("pumpkin")) {
+ // Logger.WARNING("5:"+testBlock.getUnlocalizedName());
+ } else {
+ aBaseMetaTileEntity
+ .getWorld()
+ .setBlock(
+ aBaseMetaTileEntity.getXCoord() + xDir + i,
+ aBaseMetaTileEntity.getYCoord() + h,
+ aBaseMetaTileEntity.getZCoord() + zDir + j,
+ Blocks.bookshelf);
+ }
+ }
+
+ // If not in the middle - don't know how else to check this one without lots of !=
+ if ((i != 7) && (i != -7) && (j != 7) && (j != -7) && (i != 6) && (i != -6) && (j != 6) && (j != -6)
+ && (i != 5) && (i != -5) && (j != 5) && (j != -5) && (i != 4) && (i != -4) && (j != 4)
+ && (j != -4) && (i != 3) && (i != -3) && (j != 3) && (j != -3) && (i != 2) && (i != -2)
+ && (j != 2) && (j != -2) && (i != 1) && (i != -1) && (j != 1) && (j != -1) && (i != 0)
+ && (j != 0)) {
+
+ if (!testBlock.getUnlocalizedName().toLowerCase().contains("air")
+ || !testBlock.getUnlocalizedName().toLowerCase().contains("pumpkin")) {
+ // Logger.WARNING("0:"+testBlock.getUnlocalizedName());
+ } else {
+ aBaseMetaTileEntity
+ .getWorld()
+ .setBlock(
+ aBaseMetaTileEntity.getXCoord() + xDir + i,
+ aBaseMetaTileEntity.getYCoord() + h,
+ aBaseMetaTileEntity.getZCoord() + zDir + j,
+ Blocks.melon_block);
+ }
+
+ if (isLeaves(testBlock) || isWoodLog(testBlock)) {
+ // Logger.WARNING("1:"+testBlock.getUnlocalizedName());
+ int posiX, posiY, posiZ;
+ posiX = aBaseMetaTileEntity.getXCoord() + xDir + i;
+ posiY = aBaseMetaTileEntity.getYCoord() + h;
+ posiZ = aBaseMetaTileEntity.getZCoord() + zDir + j;
+ // Utils.LOG_MACHINE_INFO("Cleaning Up some leftovers.");
+ cleanedUp++;
+ aBaseMetaTileEntity.getWorld().setBlockToAir(posiX, posiY, posiZ);
+ new BlockBreakParticles(aBaseMetaTileEntity.getWorld(), posiX, posiY, posiZ, Blocks.dirt);
+ } else {
+ // Utils.LOG_WARNING("2:"+testBlock.getUnlocalizedName());
+ }
+ } else {
+ // Utils.LOG_WARNING("1");
+ }
+ }
+ }
+ }
+ Logger.MACHINE_INFO("cleaning up | " + cleanedUp);
+ return true;
+ }
+
+ public static boolean isValidForGUI(final ItemStack aStack) {
+ return isCorrectMachinePart(aStack) != SAWTOOL.NONE;
+ }
public static SAWTOOL isCorrectMachinePart(final ItemStack aStack) {
if (aStack != null && aStack.getItem() instanceof GT_MetaGenerated_Tool_01) {
@@ -283,747 +285,766 @@ public class TreeFarmHelper {
}
return SAWTOOL.NONE;
}
-
- public static ToolType getPartType(final ItemStack aStack) {
- if (aStack != null){
- //Utils.LOG_WARNING("Found "+aStack.getDisplayName()+" in the GUI slot.");
-
- if (aStack.getItem() == MetaGeneratedGregtechItems.INSTANCE) {
- int aDmg = aStack.getItemDamage();
- if (aDmg >= 32120 && aDmg <= 32128) {
- return ToolType.Unbreakable;
- }
- Logger.INFO("bad Tool in Slot 2 | "+aStack.getUnlocalizedName().toLowerCase() + " | "+aDmg);
- return null;
- }
-
- if (aStack.getItem() instanceof GT_MetaGenerated_Tool) {
- if (Arrays.stream(OreDictionary.getOreIDs(aStack)).anyMatch(i -> i == sawOreId))
- return ToolType.Breakable;
- }
- }
- Logger.INFO("bad Tool in Slot 4");
- return null;
- }
-
- public static boolean isHumusLoaded = false;
- public static boolean isForestryLogsLoaded = false;
- public static boolean isForestryFenceLoaded = false;
- public static boolean isForestrySaplingsLoaded = false;
- public static boolean isForestryLeavesLoaded = false;
- public static Block blockHumus;
-
- public static boolean isForestryValid(){
- if (!LoadedMods.Forestry){
- return false;
- }
- if (ReflectionUtils.doesClassExist("forestry.core.blocks.BlockSoil")){
- isHumusLoaded = true;
- }
- if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockLog")){
- isForestryLogsLoaded = true;
- }
- if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockArbFence")){
- isForestryFenceLoaded = true;
- }
- if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockSapling")){
- isForestrySaplingsLoaded = true;
- }
- if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockForestryLeaves")){
- isForestryLeavesLoaded = true;
- }
- return true;
- }
-
- @Optional.Method(modid = "Forestry")
- public static Block getHumus(){
- if(blockHumus != null){
- return blockHumus;
- }
- else if (isHumusLoaded){
- final Class<?> humusClass = ReflectionUtils.getClass("forestry.core.blocks.BlockSoil");
- final ItemStack humusStack = ItemUtils.getCorrectStacktype("Forestry:soil", 1);
- if (humusClass != null){
- blockHumus = Block.getBlockFromItem(humusStack.getItem());
- return Block.getBlockFromItem(humusStack.getItem());
- }
- }
- return null;
- }
-
- public static boolean isWoodLog(final Block log){
- final String tTool = log.getHarvestTool(0);
-
- if ((log == Blocks.log) || (log == Blocks.log2)){
- return true;
- }
-
- //Forestry/General Compat
- if (log.getClass().getName().toLowerCase().contains("blocklog")){
- return true;
- }
-
- //IC2 Rubber Tree Compat
- if (log.getClass().getName().toLowerCase().contains("rubwood") || log.getClass().getName().toLowerCase().contains("rubleaves")){
- return true;
- }
-
- return (OrePrefixes.log.contains(new ItemStack(log, 1))&& ((tTool != null) && (tTool.equals("axe")))) || (log.getMaterial() != Material.wood) ? false : (OrePrefixes.fence.contains(new ItemStack(log, 1)) ? false : true);
- }
-
- public static boolean isLeaves(final Block log){
- if (log.getUnlocalizedName().toLowerCase().contains("leaf")){
- return true;
- }
- if (log.getUnlocalizedName().toLowerCase().contains("leaves")){
- return true;
- }
- if (log.getLocalizedName().toLowerCase().contains("leaf")){
- return true;
- }
- if (log.getLocalizedName().toLowerCase().contains("leaves")){
- return true;
- }
- return OrePrefixes.leaves.contains(new ItemStack(log, 1)) || log.getMaterial() == Material.leaves || OrePrefixes.treeLeaves.contains(new ItemStack(log, 1)) || log.getMaterial() == Material.vine || OrePrefixes.mushroom.contains(new ItemStack(log, 1)) || log.getMaterial() == Material.cactus;
- }
-
- public static boolean isSapling(final Block log){
- if (log != null){
- if (OrePrefixes.sapling.contains(new ItemStack(log, 1))){
- //Logger.WARNING(""+log.getLocalizedName());
- }
- if (log.getLocalizedName().toLowerCase().contains("sapling")){
- //Logger.WARNING(""+log.getLocalizedName());
- return true;
- }
- }
- return OrePrefixes.sapling.contains(new ItemStack(log, 1));
- }
-
- public static boolean isDirtBlock(final Block dirt){
- return (dirt == Blocks.dirt ? true : (dirt == Blocks.grass ? true : (getHumus() == null ? false : (dirt == blockHumus ? true : false))));
- }
-
- public static boolean isFenceBlock(final Block fence){
- return (fence == Blocks.fence ? true : (fence == Blocks.fence_gate ? true : (fence == Blocks.nether_brick_fence ? true : (OrePrefixes.fence.contains(new ItemStack(fence, 1)) ? true : false))));
- }
-
- public static boolean isAirBlock(final Block air){
- if (air.getLocalizedName().toLowerCase().contains("air")){
- return true;
- }
- if (air.getClass().getName().toLowerCase().contains("residual") || air.getClass().getName().toLowerCase().contains("heat")){
- return true;
- }
- return (air == Blocks.air ? true : (air instanceof BlockAir ? true : false));
- }
-
- /*public static boolean isSaplingBlock(Block sapling){
- return (sapling == Blocks.sapling ? true : (sapling == Blocks.))
- }*/
-
- public static BlockPos checkForLogsInGrowArea(final IGregTechTileEntity aBaseMetaTileEntity) {
- final int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7;
- final int zDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7;
- for (int i = -7; i <= 7; i++) {
- for (int j = -7; j <= 7; j++) {
- for (int h = 0; h <= 1; h++) {
- //Farm Floor inner 14x14
- if (((i != -7) && (i != 7)) && ((j != -7) && (j != 7))) {
- if (h == 1) {
- if (TreeFarmHelper.isWoodLog(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))) {
- Logger.INFO("Found a Log");
- return new BlockPos(aBaseMetaTileEntity.getXCoord()+xDir + i, aBaseMetaTileEntity.getYCoord()+h, aBaseMetaTileEntity.getZCoord()+zDir + j, aBaseMetaTileEntity.getWorld());
- }
- }
- }
- }
- }
- }
- return null;
- }
-
- public static ItemStack[] findTreeFromBase(World world, BlockPos h) {
- int HARD_LIMIT = 10000;
- int mCount = 0;
- Logger.INFO("Finding Rest of Tree.");
- BlockPos mFirstSpot = h;
- Set<BlockPos> mSearchedSpaces = new HashSet<BlockPos>();
- Set<BlockPos> mTreeSet = getConnectedBlocks(world, mFirstSpot, mSearchedSpaces);
- Set<Set<BlockPos>> mTreeSet2 = new HashSet<Set<BlockPos>>();
- Set<BlockPos> mFinalTree = new HashSet<BlockPos>();
- Iterator<BlockPos> it = mTreeSet.iterator();
-
-
- Logger.INFO("Running first iteration.");
- while(it.hasNext()){
- BlockPos G = it.next();
- mSearchedSpaces.add(G);
- mTreeSet2.add(getConnectedBlocks(world, G, mSearchedSpaces));
- mCount++;
- Logger.INFO("First Search: "+G.getLocationString());
- if (mCount > HARD_LIMIT) {
- break;
- }
- }
-
- mCount = 0;
- Iterator<Set<BlockPos>> it2 = mTreeSet2.iterator();
- Iterator<BlockPos> it3;
- Logger.INFO("Running second iteration.");
- while(it2.hasNext()){
- Set<BlockPos> G = it2.next();
- it3 = G.iterator();
- while(it3.hasNext()){
- BlockPos G2 = it3.next();
- mSearchedSpaces.add(G2);
- mFinalTree.add(G2);
- mCount++;
- Logger.INFO("Second Search: "+G2.getLocationString());
- if (mCount > HARD_LIMIT) {
- break;
- }
- }
- if (mCount > HARD_LIMIT) {
- break;
- }
- }
-
-
- if (mFinalTree.size() > 0) {
- Logger.INFO("Queuing "+mFinalTree.size()+" to Harvest Manager.");
- TreeCutter harvestManager = new TreeCutter(world);
-
- Iterator<BlockPos> ith = mFinalTree.iterator();
- while(ith.hasNext()){
- BlockPos G = ith.next();
- harvestManager.queue(G);
- mCount++;
- Logger.INFO("Queued: "+G.getLocationString());
- if (mCount > HARD_LIMIT) {
- break;
- }
- }
-
- if (harvestManager.isValid) {
- ItemStack[] loot = harvestManager.getDrops();
- if (loot.length > 0) {
- //Logger.INFO("Returning Drops from harvestManager Queue.");
- return loot;
- }
- }
- }
- return new ItemStack[] {};
- }
-
-
- public static Set<BlockPos> getConnectedBlocks(World W, BlockPos P, Set<BlockPos> checkedSpaces) {
- int HARD_LIMIT = 1000;
- int mCount = 0;
- Logger.INFO("Finding blocks connected to "+P.getLocationString()+".");
- Set<BlockPos> mCheckedSpaces = checkedSpaces;
- Set<BlockPos> mStartSearch = searchSixFaces(W, P, mCheckedSpaces, false);
- Set<BlockPos> mSecondSearch = new HashSet<BlockPos>();
- Set<BlockPos> mThirdSearch = new HashSet<BlockPos>();
- Iterator<BlockPos> it = mStartSearch.iterator();
- while(it.hasNext()){
- Logger.INFO("Running first iteration. [II]");
- BlockPos G = it.next();
- mCheckedSpaces.add(G);
- Set<BlockPos> mBranchSearch = searchSixFaces(W, G, mCheckedSpaces, true);
- Iterator<BlockPos> it2 = mBranchSearch.iterator();
- while(it2.hasNext()){
- Logger.INFO("Running second iteration. [II]");
- BlockPos G2 = it2.next();
- mCheckedSpaces.add(G2);
- mSecondSearch.add(G2);
- mCount++;
- if (mCount > HARD_LIMIT) {
- break;
- }
- }
- if (mCount > HARD_LIMIT) {
- break;
- }
- }
- mCount = 0;
- Iterator<BlockPos> itx = mSecondSearch.iterator();
- while(itx.hasNext()){
- BlockPos G = itx.next();
- mCheckedSpaces.add(G);
- Set<BlockPos> mBranchSearch = searchSixFaces(W, G, mCheckedSpaces, true);
- Iterator<BlockPos> it2 = mBranchSearch.iterator();
- while(it2.hasNext()){
- BlockPos G2 = it2.next();
- mCheckedSpaces.add(G2);
- mThirdSearch.add(G2);
- mCount++;
- if (mCount > HARD_LIMIT) {
- break;
- }
- }
- if (mCount > HARD_LIMIT) {
- break;
- }
- }
- return mThirdSearch;
- }
-
- public static Set<BlockPos> searchSixFaces(World W, BlockPos P, Set<BlockPos> checkedSpaces, boolean checkLeaves) {
- Set<BlockPos> mConnected = new HashSet<BlockPos>();
- int x = P.xPos;
- int y = P.yPos;
- int z = P.zPos;
- if (checkLeaves) {
- if (isWoodLog(W.getBlock(x-1, y, z)) || isLeaves(W.getBlock(x-1, y, z))) {
- BlockPos L = new BlockPos(x-1, y, z, W);
- if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- }
- }
- if (isWoodLog(W.getBlock(x+1, y, z)) || isLeaves(W.getBlock(x+1, y, z))) {
- BlockPos L = new BlockPos(x+1, y, z, W);
- if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- }
- }
- if (isWoodLog(W.getBlock(x, y-1, z)) || isLeaves(W.getBlock(x, y-1, z))) {
- BlockPos L = new BlockPos(x, y-1, z, W);
- if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- }
- }
- if (isWoodLog(W.getBlock(x, y+1, z)) || isLeaves(W.getBlock(x, y+1, z))) {
- BlockPos L = new BlockPos(x, y+1, z, W);
- if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- }
- }
- if (isWoodLog(W.getBlock(x, y, z-1)) || isLeaves(W.getBlock(x, y, z-1))) {
- BlockPos L = new BlockPos(x, y, z-1, W);
- if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- }
- }
- if (isWoodLog(W.getBlock(x, y, z+1)) || isLeaves(W.getBlock(x, y, z+1))) {
- BlockPos L = new BlockPos(x, y, z+1, W);
- if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- }
- }
- }
- else {
- if (isWoodLog(W.getBlock(x-1, y, z))) {
- BlockPos L = new BlockPos(x-1, y, z, W);
- //if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- //}
- }
- if (isWoodLog(W.getBlock(x+1, y, z))) {
- BlockPos L = new BlockPos(x+1, y, z, W);
- //if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- //}
- }
- if (isWoodLog(W.getBlock(x, y-1, z))) {
- BlockPos L = new BlockPos(x, y-1, z, W);
- //if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- //}
- }
- if (isWoodLog(W.getBlock(x, y+1, z))) {
- BlockPos L = new BlockPos(x, y+1, z, W);
- //if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- //}
- }
- if (isWoodLog(W.getBlock(x, y, z-1))) {
- BlockPos L = new BlockPos(x, y, z-1, W);
- //if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- //}
- }
- if (isWoodLog(W.getBlock(x, y, z+1))) {
- BlockPos L = new BlockPos(x, y, z+1, W);
- //if (!checkedSpaces.contains(L)) {
- mConnected.add(L);
- Logger.INFO("Found Connected. [III]");
- //}
- }
- }
- return mConnected;
- }
-
-
- public enum ToolType {
- Unbreakable,
- Breakable
- }
-
-
- /**
- * Tree Cutting
- */
-
- public static class TreeCutter {
-
- private final World mWorld;
- private Map<String, BlockPos> mQueue = new ConcurrentHashMap<String, BlockPos>();
- private AutoMap<ItemStack[]> mDrops = new AutoMap<ItemStack[]>();
- private boolean isValid = true;
-
- public TreeCutter(World world) {
- this.mWorld = world;
- }
-
- public boolean queue(BlockPos pos) {
- if (isValid && pos != null) {
- //Logger.INFO("Queued: "+pos.getLocationString());
- String hash = Utils.calculateChecksumMD5(pos);
- if (hash != null && !mQueue.containsKey(hash)) {
- mQueue.put(hash, pos);
- return true;
- }
- }
- return false;
- }
-
- private boolean emptyQueue() {
- if (isValid) {
- Logger.INFO("Emptying Queue.");
- if (this.mQueue.size() > 0) {
- int totalRemoved = 0;
- for (BlockPos h : mQueue.values()) {
- final Block block = mWorld.getBlock(h.xPos, h.yPos, h.zPos);
- if (block != null) {
- final int dropMeta = mWorld.getBlockMetadata(h.xPos, h.yPos, h.zPos);
- final ArrayList<ItemStack> blockDrops = block.getDrops(mWorld, h.xPos, h.yPos, h.zPos, dropMeta, 0);
- final ItemStack[] drops = ItemUtils.getBlockDrops(blockDrops);
- mDrops.put(drops);
- //Remove drop that was added to the bus.
- mWorld.setBlockToAir(h.xPos, h.yPos, h.zPos);
- //new BlockBreakParticles(mWorld, h.xPos, h.yPos, h.zPos, block);
- totalRemoved++;
- }
- }
- if (totalRemoved > 0 && mDrops.size() > 0) {
- return true;
- }
- }
- }
- return false;
- }
-
- public ItemStack[] getDrops() {
- //If Queue is successfully cleared and drops are created, let us continue.
- if (isValid && emptyQueue()) {
- AutoMap<ItemStack> mCollective = new AutoMap<ItemStack>();
- //Iterate ALL of the arrays, add output to a collective.
- for (ItemStack[] i : this.mDrops) {
- //Array is not null.
- if (i != null) {
- //Iterate this array.
- for (int d=0;d<i.length;d++) {
- //Put Output into collective if valid
- if (i[d] != null && i[d].stackSize > 0) {
- mCollective.put(i[d]);
- }
- }
- }
- }
- //Build an ItemStack array.
- ItemStack[] drops = new ItemStack[mCollective.size()];
- for (int m=0;m<drops.length;m++) {
- drops[m] = mCollective.get(m);
- }
- //Return drops array if it's valid.
- if (drops.length > 0) {
- isValid = false;
- return drops;
- }
- }
- //Invalid or no drops, return empty array.
- isValid = false;
- return new ItemStack[] {};
- }
-
- }
-
-
- /**
- * Farm AI
- */
- private static EntityPlayerMP farmerAI;
- public EntityPlayerMP getFakePlayer(World world) {
- return farmerAI = checkFakePlayer(world);
- }
-
- public static EntityPlayerMP checkFakePlayer(World world) {
- if (farmerAI == null) {
- return new FakeFarmer(MinecraftServer.getServer().worldServerForDimension(world.provider.dimensionId));
- }
- return farmerAI;
- }
-
- public static boolean onBlockStartBreak (int x, int y, int z, World world){
- final Block wood = world.getBlock(x, y, z);
- if (wood == null){
- return false;
- }
- if (wood.isWood(world, x, y, z) || wood.getMaterial() == Material.sponge)
- if(detectTree(world, x,y,z)) {
- TreeChopTask chopper = new TreeChopTask(new ChunkPosition(x, y, z), checkFakePlayer(world), 128);
- FMLCommonHandler.instance().bus().register(chopper);
- // custom block breaking code, don't call vanilla code
- return true;
- }
- //return onBlockStartBreak(stack, x, y, z, player);
- return false;
- }
-
- public static boolean detectTree(World world, int pX, int pY, int pZ) {
- ChunkPosition pos = null;
- Stack<ChunkPosition> candidates = new Stack<>();
- candidates.add(new ChunkPosition(pX, pY, pZ));
-
- while (!candidates.isEmpty()) {
- ChunkPosition candidate = candidates.pop();
- int curX = candidate.chunkPosX, curY = candidate.chunkPosY, curZ = candidate.chunkPosZ;
-
- Block block = world.getBlock(curX, curY, curZ);
- if ((pos == null || candidate.chunkPosY > pos.chunkPosY) && block.isWood(world, curX, curY, curZ)) {
- pos = new ChunkPosition(curX, candidate.chunkPosY + 1, curZ);
- // go up
- while (world.getBlock(curX, pos.chunkPosY, curZ).isWood(world, curX, pos.chunkPosY, curZ)) {
- pos = new ChunkPosition(curX, pos.chunkPosY + 1, curZ);
- }
- // check if we still have a way diagonally up
- candidates.add(new ChunkPosition(curX + 1, pos.chunkPosY + 1, curZ ));
- candidates.add(new ChunkPosition(curX , pos.chunkPosY + 1, curZ + 1));
- candidates.add(new ChunkPosition(curX - 1, pos.chunkPosY + 1, curZ ));
- candidates.add(new ChunkPosition(curX , pos.chunkPosY + 1, curZ - 1));
- }
- }
-
- // not even one match, so there were no logs.
- if (pos == null) {
- return false;
- }
-
- // check if there were enough leaves around the last position
- // pos now contains the block above the topmost log
- // we want at least 5 leaves in the surrounding 26 blocks
- int d = 3;
- int leaves = 0;
- for (int offX = 0; offX < d; offX++) {
- for (int offY = 0; offY < d; offY++) {
- for (int offZ = 0; offZ < d; offZ++) {
- int xPos = pos.chunkPosX -1 + offX, yPos = pos.chunkPosY - 1 + offY, zPos = pos.chunkPosZ - 1 + offZ;
- Block leaf = world.getBlock(xPos, yPos, zPos);
- if (leaf != null && leaf.isLeaves(world, xPos, yPos, zPos)) {
- if (++leaves >= 5) {
- return true;
- }
- }
- }
- }
- }
-
- // not enough leaves. sorreh
- return false;
- }
-
- public static class TreeChopTask {
-
- public final World world;
- public final EntityPlayer player;
- public final int blocksPerTick;
-
- public Queue<ChunkPosition> blocks = Lists.newLinkedList();
- public Set<ChunkPosition> visited = new THashSet<>();
-
- public TreeChopTask(ChunkPosition start, EntityPlayer player, int blocksPerTick) {
- this.world = player.getEntityWorld();
- this.player = player;
- this.blocksPerTick = blocksPerTick;
-
- this.blocks.add(start);
- }
-
- private void queueCoordinate(int x, int y, int z) {
- ChunkPosition pos = new ChunkPosition(x, y, z);
- if (!visited.contains(pos)) {
- blocks.add(pos);
- }
- }
-
- @SubscribeEvent
- public void onWorldTick(TickEvent.WorldTickEvent event) {
- if (event.side.isClient()) {
- finish();
- return;
- }
- // only if same dimension
- if (event.world.provider.dimensionId != world.provider.dimensionId) {
- return;
- }
-
- // setup
- int left = blocksPerTick;
- //NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
-
- // continue running
- ChunkPosition pos;
- while (left > 0) {
- // completely done or can't do our job anymore?!
- if (blocks.isEmpty()/* || tags.getBoolean("Broken")*/) {
- finish();
- return;
- }
-
- pos = blocks.remove();
- if (!visited.add(pos)) {
- continue;
- }
- int x = pos.chunkPosX, y = pos.chunkPosY, z = pos.chunkPosZ;
-
- Block block = world.getBlock(x, y, z);
- int meta = world.getBlockMetadata(x, y, z);
-
- // can we harvest the block and is effective?
- if (!block.isWood(world, x, y, z) || !isWoodLog(block)) {
- continue;
- }
-
- // save its neighbors
- queueCoordinate(x + 1, y, z );
- queueCoordinate(x, y, z + 1);
- queueCoordinate(x - 1, y, z );
- queueCoordinate(x, y, z - 1);
-
- // also add the layer above.. stupid acacia trees
- for (int offX = 0; offX < 3; offX++) {
- for (int offZ = 0; offZ < 3; offZ++) {
- queueCoordinate(x - 1 + offX, y + 1, z - 1 + offZ);
- }
- }
-
- // break it, wooo!
- breakExtraBlock(player.worldObj, x, y, z, 0, player, x, y, z);
- left--;
- }
- }
-
- private void finish() {
- // goodbye cruel world
- FMLCommonHandler.instance().bus().unregister(this);
- }
- }
-
-
- public static void breakExtraBlock(World world, int x, int y, int z, int sidehit, EntityPlayer playerEntity, int refX, int refY, int refZ) {
- // prevent calling that stuff for air blocks, could lead to unexpected behaviour since it fires events
- if (world.isAirBlock(x, y, z))
- return;
-
- // what?
- if(!(playerEntity instanceof EntityPlayerMP))
- return;
- EntityPlayerMP player = (EntityPlayerMP) playerEntity;
-
- // check if the block can be broken, since extra block breaks shouldn't instantly break stuff like obsidian
- // or precious ores you can't harvest while mining stone
- Block block = world.getBlock(x, y, z);
- int meta = world.getBlockMetadata(x, y, z);
-
- // only effective materials
- if (!isWoodLog(block))
- return;
-
- Block refBlock = world.getBlock(refX, refY, refZ);
- float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
- float strength = ForgeHooks.blockStrength(block, player, world, x,y,z);
-
- // only harvestable blocks that aren't impossibly slow to harvest
- if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength/strength > 10f)
- return;
-
- // send the blockbreak event
- BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x,y,z);
- if(event.isCanceled())
- return;
-
- if (player.capabilities.isCreativeMode) {
- block.onBlockHarvested(world, x, y, z, meta, player);
- if (block.removedByPlayer(world, player, x, y, z, false))
- block.onBlockDestroyedByPlayer(world, x, y, z, meta);
-
- // send update to client
- if (!world.isRemote) {
- player.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
- }
- return;
- }
-
- // callback to the tool the player uses. Called on both sides. This damages the tool n stuff.
- player.getCurrentEquippedItem().func_150999_a(world, block, x, y, z, player);
-
- // server sided handling
- if (!world.isRemote) {
- // serverside we reproduce ItemInWorldManager.tryHarvestBlock
-
- // ItemInWorldManager.removeBlock
- block.onBlockHarvested(world, x,y,z, meta, player);
-
- if(block.removedByPlayer(world, player, x,y,z, true)) // boolean is if block can be harvested, checked above
- {
- block.onBlockDestroyedByPlayer( world, x,y,z, meta);
- block.harvestBlock(world, player, x,y,z, meta);
- block.dropXpOnBlockBreak(world, x,y,z, event.getExpToDrop());
- }
-
- // always send block update to client
- player.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
- }
- // client sided handling
- else {
- //PlayerControllerMP pcmp = Minecraft.getMinecraft().playerController;
- // clientside we do a "this clock has been clicked on long enough to be broken" call. This should not send any new packets
- // the code above, executed on the server, sends a block-updates that give us the correct state of the block we destroy.
-
- // following code can be found in PlayerControllerMP.onPlayerDestroyBlock
- world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
- if(block.removedByPlayer(world, player, x,y,z, true))
- {
- block.onBlockDestroyedByPlayer(world, x,y,z, meta);
- }
- // callback to the tool
- ItemStack itemstack = player.getCurrentEquippedItem();
- if (itemstack != null)
- {
- itemstack.func_150999_a(world, block, x, y, z, player);
-
- if (itemstack.stackSize == 0)
- {
- player.destroyCurrentEquippedItem();
- }
- }
-
- // send an update to the server, so we get an update back
- //if(PHConstruct.extraBlockUpdates)
- //Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(2, x,y,z, Minecraft.getMinecraft().objectMouseOver.sideHit));
- }
- }
+ public static ToolType getPartType(final ItemStack aStack) {
+ if (aStack != null) {
+ // Utils.LOG_WARNING("Found "+aStack.getDisplayName()+" in the GUI slot.");
+
+ if (aStack.getItem() == MetaGeneratedGregtechItems.INSTANCE) {
+ int aDmg = aStack.getItemDamage();
+ if (aDmg >= 32120 && aDmg <= 32128) {
+ return ToolType.Unbreakable;
+ }
+ Logger.INFO(
+ "bad Tool in Slot 2 | " + aStack.getUnlocalizedName().toLowerCase() + " | " + aDmg);
+ return null;
+ }
+
+ if (aStack.getItem() instanceof GT_MetaGenerated_Tool) {
+ if (Arrays.stream(OreDictionary.getOreIDs(aStack)).anyMatch(i -> i == sawOreId))
+ return ToolType.Breakable;
+ }
+ }
+ Logger.INFO("bad Tool in Slot 4");
+ return null;
+ }
+
+ public static boolean isHumusLoaded = false;
+ public static boolean isForestryLogsLoaded = false;
+ public static boolean isForestryFenceLoaded = false;
+ public static boolean isForestrySaplingsLoaded = false;
+ public static boolean isForestryLeavesLoaded = false;
+ public static Block blockHumus;
+
+ public static boolean isForestryValid() {
+ if (!LoadedMods.Forestry) {
+ return false;
+ }
+ if (ReflectionUtils.doesClassExist("forestry.core.blocks.BlockSoil")) {
+ isHumusLoaded = true;
+ }
+ if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockLog")) {
+ isForestryLogsLoaded = true;
+ }
+ if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockArbFence")) {
+ isForestryFenceLoaded = true;
+ }
+ if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockSapling")) {
+ isForestrySaplingsLoaded = true;
+ }
+ if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockForestryLeaves")) {
+ isForestryLeavesLoaded = true;
+ }
+ return true;
+ }
+
+ @Optional.Method(modid = "Forestry")
+ public static Block getHumus() {
+ if (blockHumus != null) {
+ return blockHumus;
+ } else if (isHumusLoaded) {
+ final Class<?> humusClass = ReflectionUtils.getClass("forestry.core.blocks.BlockSoil");
+ final ItemStack humusStack = ItemUtils.getCorrectStacktype("Forestry:soil", 1);
+ if (humusClass != null) {
+ blockHumus = Block.getBlockFromItem(humusStack.getItem());
+ return Block.getBlockFromItem(humusStack.getItem());
+ }
+ }
+ return null;
+ }
+
+ public static boolean isWoodLog(final Block log) {
+ final String tTool = log.getHarvestTool(0);
+
+ if ((log == Blocks.log) || (log == Blocks.log2)) {
+ return true;
+ }
+
+ // Forestry/General Compat
+ if (log.getClass().getName().toLowerCase().contains("blocklog")) {
+ return true;
+ }
+
+ // IC2 Rubber Tree Compat
+ if (log.getClass().getName().toLowerCase().contains("rubwood")
+ || log.getClass().getName().toLowerCase().contains("rubleaves")) {
+ return true;
+ }
+
+ return (OrePrefixes.log.contains(new ItemStack(log, 1)) && ((tTool != null) && (tTool.equals("axe"))))
+ || (log.getMaterial() != Material.wood)
+ ? false
+ : (OrePrefixes.fence.contains(new ItemStack(log, 1)) ? false : true);
+ }
+
+ public static boolean isLeaves(final Block log) {
+ if (log.getUnlocalizedName().toLowerCase().contains("leaf")) {
+ return true;
+ }
+ if (log.getUnlocalizedName().toLowerCase().contains("leaves")) {
+ return true;
+ }
+ if (log.getLocalizedName().toLowerCase().contains("leaf")) {
+ return true;
+ }
+ if (log.getLocalizedName().toLowerCase().contains("leaves")) {
+ return true;
+ }
+ return OrePrefixes.leaves.contains(new ItemStack(log, 1))
+ || log.getMaterial() == Material.leaves
+ || OrePrefixes.treeLeaves.contains(new ItemStack(log, 1))
+ || log.getMaterial() == Material.vine
+ || OrePrefixes.mushroom.contains(new ItemStack(log, 1))
+ || log.getMaterial() == Material.cactus;
+ }
+
+ public static boolean isSapling(final Block log) {
+ if (log != null) {
+ if (OrePrefixes.sapling.contains(new ItemStack(log, 1))) {
+ // Logger.WARNING(""+log.getLocalizedName());
+ }
+ if (log.getLocalizedName().toLowerCase().contains("sapling")) {
+ // Logger.WARNING(""+log.getLocalizedName());
+ return true;
+ }
+ }
+ return OrePrefixes.sapling.contains(new ItemStack(log, 1));
+ }
+
+ public static boolean isDirtBlock(final Block dirt) {
+ return (dirt == Blocks.dirt
+ ? true
+ : (dirt == Blocks.grass ? true : (getHumus() == null ? false : (dirt == blockHumus ? true : false))));
+ }
+
+ public static boolean isFenceBlock(final Block fence) {
+ return (fence == Blocks.fence
+ ? true
+ : (fence == Blocks.fence_gate
+ ? true
+ : (fence == Blocks.nether_brick_fence
+ ? true
+ : (OrePrefixes.fence.contains(new ItemStack(fence, 1)) ? true : false))));
+ }
+
+ public static boolean isAirBlock(final Block air) {
+ if (air.getLocalizedName().toLowerCase().contains("air")) {
+ return true;
+ }
+ if (air.getClass().getName().toLowerCase().contains("residual")
+ || air.getClass().getName().toLowerCase().contains("heat")) {
+ return true;
+ }
+ return (air == Blocks.air ? true : (air instanceof BlockAir ? true : false));
+ }
+
+ /*public static boolean isSaplingBlock(Block sapling){
+ return (sapling == Blocks.sapling ? true : (sapling == Blocks.))
+ }*/
+
+ public static BlockPos checkForLogsInGrowArea(final IGregTechTileEntity aBaseMetaTileEntity) {
+ final int xDir =
+ net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing())
+ .offsetX
+ * 7;
+ final int zDir =
+ net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing())
+ .offsetZ
+ * 7;
+ for (int i = -7; i <= 7; i++) {
+ for (int j = -7; j <= 7; j++) {
+ for (int h = 0; h <= 1; h++) {
+ // Farm Floor inner 14x14
+ if (((i != -7) && (i != 7)) && ((j != -7) && (j != 7))) {
+ if (h == 1) {
+ if (TreeFarmHelper.isWoodLog(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))) {
+ Logger.INFO("Found a Log");
+ return new BlockPos(
+ aBaseMetaTileEntity.getXCoord() + xDir + i,
+ aBaseMetaTileEntity.getYCoord() + h,
+ aBaseMetaTileEntity.getZCoord() + zDir + j,
+ aBaseMetaTileEntity.getWorld());
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public static ItemStack[] findTreeFromBase(World world, BlockPos h) {
+ int HARD_LIMIT = 10000;
+ int mCount = 0;
+ Logger.INFO("Finding Rest of Tree.");
+ BlockPos mFirstSpot = h;
+ Set<BlockPos> mSearchedSpaces = new HashSet<BlockPos>();
+ Set<BlockPos> mTreeSet = getConnectedBlocks(world, mFirstSpot, mSearchedSpaces);
+ Set<Set<BlockPos>> mTreeSet2 = new HashSet<Set<BlockPos>>();
+ Set<BlockPos> mFinalTree = new HashSet<BlockPos>();
+ Iterator<BlockPos> it = mTreeSet.iterator();
+
+ Logger.INFO("Running first iteration.");
+ while (it.hasNext()) {
+ BlockPos G = it.next();
+ mSearchedSpaces.add(G);
+ mTreeSet2.add(getConnectedBlocks(world, G, mSearchedSpaces));
+ mCount++;
+ Logger.INFO("First Search: " + G.getLocationString());
+ if (mCount > HARD_LIMIT) {
+ break;
+ }
+ }
+
+ mCount = 0;
+ Iterator<Set<BlockPos>> it2 = mTreeSet2.iterator();
+ Iterator<BlockPos> it3;
+ Logger.INFO("Running second iteration.");
+ while (it2.hasNext()) {
+ Set<BlockPos> G = it2.next();
+ it3 = G.iterator();
+ while (it3.hasNext()) {
+ BlockPos G2 = it3.next();
+ mSearchedSpaces.add(G2);
+ mFinalTree.add(G2);
+ mCount++;
+ Logger.INFO("Second Search: " + G2.getLocationString());
+ if (mCount > HARD_LIMIT) {
+ break;
+ }
+ }
+ if (mCount > HARD_LIMIT) {
+ break;
+ }
+ }
+
+ if (mFinalTree.size() > 0) {
+ Logger.INFO("Queuing " + mFinalTree.size() + " to Harvest Manager.");
+ TreeCutter harvestManager = new TreeCutter(world);
+
+ Iterator<BlockPos> ith = mFinalTree.iterator();
+ while (ith.hasNext()) {
+ BlockPos G = ith.next();
+ harvestManager.queue(G);
+ mCount++;
+ Logger.INFO("Queued: " + G.getLocationString());
+ if (mCount > HARD_LIMIT) {
+ break;
+ }
+ }
+
+ if (harvestManager.isValid) {
+ ItemStack[] loot = harvestManager.getDrops();
+ if (loot.length > 0) {
+ // Logger.INFO("Returning Drops from harvestManager Queue.");
+ return loot;
+ }
+ }
+ }
+ return new ItemStack[] {};
+ }
+
+ public static Set<BlockPos> getConnectedBlocks(World W, BlockPos P, Set<BlockPos> checkedSpaces) {
+ int HARD_LIMIT = 1000;
+ int mCount = 0;
+ Logger.INFO("Finding blocks connected to " + P.getLocationString() + ".");
+ Set<BlockPos> mCheckedSpaces = checkedSpaces;
+ Set<BlockPos> mStartSearch = searchSixFaces(W, P, mCheckedSpaces, false);
+ Set<BlockPos> mSecondSearch = new HashSet<BlockPos>();
+ Set<BlockPos> mThirdSearch = new HashSet<BlockPos>();
+ Iterator<BlockPos> it = mStartSearch.iterator();
+ while (it.hasNext()) {
+ Logger.INFO("Running first iteration. [II]");
+ BlockPos G = it.next();
+ mCheckedSpaces.add(G);
+ Set<BlockPos> mBranchSearch = searchSixFaces(W, G, mCheckedSpaces, true);
+ Iterator<BlockPos> it2 = mBranchSearch.iterator();
+ while (it2.hasNext()) {
+ Logger.INFO("Running second iteration. [II]");
+ BlockPos G2 = it2.next();
+ mCheckedSpaces.add(G2);
+ mSecondSearch.add(G2);
+ mCount++;
+ if (mCount > HARD_LIMIT) {
+ break;
+ }
+ }
+ if (mCount > HARD_LIMIT) {
+ break;
+ }
+ }
+ mCount = 0;
+ Iterator<BlockPos> itx = mSecondSearch.iterator();
+ while (itx.hasNext()) {
+ BlockPos G = itx.next();
+ mCheckedSpaces.add(G);
+ Set<BlockPos> mBranchSearch = searchSixFaces(W, G, mCheckedSpaces, true);
+ Iterator<BlockPos> it2 = mBranchSearch.iterator();
+ while (it2.hasNext()) {
+ BlockPos G2 = it2.next();
+ mCheckedSpaces.add(G2);
+ mThirdSearch.add(G2);
+ mCount++;
+ if (mCount > HARD_LIMIT) {
+ break;
+ }
+ }
+ if (mCount > HARD_LIMIT) {
+ break;
+ }
+ }
+ return mThirdSearch;
+ }
+
+ public static Set<BlockPos> searchSixFaces(World W, BlockPos P, Set<BlockPos> checkedSpaces, boolean checkLeaves) {
+ Set<BlockPos> mConnected = new HashSet<BlockPos>();
+ int x = P.xPos;
+ int y = P.yPos;
+ int z = P.zPos;
+ if (checkLeaves) {
+ if (isWoodLog(W.getBlock(x - 1, y, z)) || isLeaves(W.getBlock(x - 1, y, z))) {
+ BlockPos L = new BlockPos(x - 1, y, z, W);
+ if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ }
+ }
+ if (isWoodLog(W.getBlock(x + 1, y, z)) || isLeaves(W.getBlock(x + 1, y, z))) {
+ BlockPos L = new BlockPos(x + 1, y, z, W);
+ if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ }
+ }
+ if (isWoodLog(W.getBlock(x, y - 1, z)) || isLeaves(W.getBlock(x, y - 1, z))) {
+ BlockPos L = new BlockPos(x, y - 1, z, W);
+ if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ }
+ }
+ if (isWoodLog(W.getBlock(x, y + 1, z)) || isLeaves(W.getBlock(x, y + 1, z))) {
+ BlockPos L = new BlockPos(x, y + 1, z, W);
+ if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ }
+ }
+ if (isWoodLog(W.getBlock(x, y, z - 1)) || isLeaves(W.getBlock(x, y, z - 1))) {
+ BlockPos L = new BlockPos(x, y, z - 1, W);
+ if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ }
+ }
+ if (isWoodLog(W.getBlock(x, y, z + 1)) || isLeaves(W.getBlock(x, y, z + 1))) {
+ BlockPos L = new BlockPos(x, y, z + 1, W);
+ if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ }
+ }
+ } else {
+ if (isWoodLog(W.getBlock(x - 1, y, z))) {
+ BlockPos L = new BlockPos(x - 1, y, z, W);
+ // if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ // }
+ }
+ if (isWoodLog(W.getBlock(x + 1, y, z))) {
+ BlockPos L = new BlockPos(x + 1, y, z, W);
+ // if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ // }
+ }
+ if (isWoodLog(W.getBlock(x, y - 1, z))) {
+ BlockPos L = new BlockPos(x, y - 1, z, W);
+ // if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ // }
+ }
+ if (isWoodLog(W.getBlock(x, y + 1, z))) {
+ BlockPos L = new BlockPos(x, y + 1, z, W);
+ // if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ // }
+ }
+ if (isWoodLog(W.getBlock(x, y, z - 1))) {
+ BlockPos L = new BlockPos(x, y, z - 1, W);
+ // if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ // }
+ }
+ if (isWoodLog(W.getBlock(x, y, z + 1))) {
+ BlockPos L = new BlockPos(x, y, z + 1, W);
+ // if (!checkedSpaces.contains(L)) {
+ mConnected.add(L);
+ Logger.INFO("Found Connected. [III]");
+ // }
+ }
+ }
+ return mConnected;
+ }
+
+ public enum ToolType {
+ Unbreakable,
+ Breakable
+ }
+
+ /**
+ * Tree Cutting
+ */
+ public static class TreeCutter {
+
+ private final World mWorld;
+ private Map<String, BlockPos> mQueue = new ConcurrentHashMap<String, BlockPos>();
+ private AutoMap<ItemStack[]> mDrops = new AutoMap<ItemStack[]>();
+ private boolean isValid = true;
+
+ public TreeCutter(World world) {
+ this.mWorld = world;
+ }
+
+ public boolean queue(BlockPos pos) {
+ if (isValid && pos != null) {
+ // Logger.INFO("Queued: "+pos.getLocationString());
+ String hash = Utils.calculateChecksumMD5(pos);
+ if (hash != null && !mQueue.containsKey(hash)) {
+ mQueue.put(hash, pos);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean emptyQueue() {
+ if (isValid) {
+ Logger.INFO("Emptying Queue.");
+ if (this.mQueue.size() > 0) {
+ int totalRemoved = 0;
+ for (BlockPos h : mQueue.values()) {
+ final Block block = mWorld.getBlock(h.xPos, h.yPos, h.zPos);
+ if (block != null) {
+ final int dropMeta = mWorld.getBlockMetadata(h.xPos, h.yPos, h.zPos);
+ final ArrayList<ItemStack> blockDrops =
+ block.getDrops(mWorld, h.xPos, h.yPos, h.zPos, dropMeta, 0);
+ final ItemStack[] drops = ItemUtils.getBlockDrops(blockDrops);
+ mDrops.put(drops);
+ // Remove drop that was added to the bus.
+ mWorld.setBlockToAir(h.xPos, h.yPos, h.zPos);
+ // new BlockBreakParticles(mWorld, h.xPos, h.yPos, h.zPos, block);
+ totalRemoved++;
+ }
+ }
+ if (totalRemoved > 0 && mDrops.size() > 0) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public ItemStack[] getDrops() {
+ // If Queue is successfully cleared and drops are created, let us continue.
+ if (isValid && emptyQueue()) {
+ AutoMap<ItemStack> mCollective = new AutoMap<ItemStack>();
+ // Iterate ALL of the arrays, add output to a collective.
+ for (ItemStack[] i : this.mDrops) {
+ // Array is not null.
+ if (i != null) {
+ // Iterate this array.
+ for (int d = 0; d < i.length; d++) {
+ // Put Output into collective if valid
+ if (i[d] != null && i[d].stackSize > 0) {
+ mCollective.put(i[d]);
+ }
+ }
+ }
+ }
+ // Build an ItemStack array.
+ ItemStack[] drops = new ItemStack[mCollective.size()];
+ for (int m = 0; m < drops.length; m++) {
+ drops[m] = mCollective.get(m);
+ }
+ // Return drops array if it's valid.
+ if (drops.length > 0) {
+ isValid = false;
+ return drops;
+ }
+ }
+ // Invalid or no drops, return empty array.
+ isValid = false;
+ return new ItemStack[] {};
+ }
+ }
+
+ /**
+ * Farm AI
+ */
+ private static EntityPlayerMP farmerAI;
+
+ public EntityPlayerMP getFakePlayer(World world) {
+ return farmerAI = checkFakePlayer(world);
+ }
+
+ public static EntityPlayerMP checkFakePlayer(World world) {
+ if (farmerAI == null) {
+ return new FakeFarmer(MinecraftServer.getServer().worldServerForDimension(world.provider.dimensionId));
+ }
+ return farmerAI;
+ }
+
+ public static boolean onBlockStartBreak(int x, int y, int z, World world) {
+ final Block wood = world.getBlock(x, y, z);
+ if (wood == null) {
+ return false;
+ }
+ if (wood.isWood(world, x, y, z) || wood.getMaterial() == Material.sponge)
+ if (detectTree(world, x, y, z)) {
+ TreeChopTask chopper = new TreeChopTask(new ChunkPosition(x, y, z), checkFakePlayer(world), 128);
+ FMLCommonHandler.instance().bus().register(chopper);
+ // custom block breaking code, don't call vanilla code
+ return true;
+ }
+ // return onBlockStartBreak(stack, x, y, z, player);
+ return false;
+ }
+
+ public static boolean detectTree(World world, int pX, int pY, int pZ) {
+ ChunkPosition pos = null;
+ Stack<ChunkPosition> candidates = new Stack<>();
+ candidates.add(new ChunkPosition(pX, pY, pZ));
+
+ while (!candidates.isEmpty()) {
+ ChunkPosition candidate = candidates.pop();
+ int curX = candidate.chunkPosX, curY = candidate.chunkPosY, curZ = candidate.chunkPosZ;
+
+ Block block = world.getBlock(curX, curY, curZ);
+ if ((pos == null || candidate.chunkPosY > pos.chunkPosY) && block.isWood(world, curX, curY, curZ)) {
+ pos = new ChunkPosition(curX, candidate.chunkPosY + 1, curZ);
+ // go up
+ while (world.getBlock(curX, pos.chunkPosY, curZ).isWood(world, curX, pos.chunkPosY, curZ)) {
+ pos = new ChunkPosition(curX, pos.chunkPosY + 1, curZ);
+ }
+ // check if we still have a way diagonally up
+ candidates.add(new ChunkPosition(curX + 1, pos.chunkPosY + 1, curZ));
+ candidates.add(new ChunkPosition(curX, pos.chunkPosY + 1, curZ + 1));
+ candidates.add(new ChunkPosition(curX - 1, pos.chunkPosY + 1, curZ));
+ candidates.add(new ChunkPosition(curX, pos.chunkPosY + 1, curZ - 1));
+ }
+ }
+
+ // not even one match, so there were no logs.
+ if (pos == null) {
+ return false;
+ }
+
+ // check if there were enough leaves around the last position
+ // pos now contains the block above the topmost log
+ // we want at least 5 leaves in the surrounding 26 blocks
+ int d = 3;
+ int leaves = 0;
+ for (int offX = 0; offX < d; offX++) {
+ for (int offY = 0; offY < d; offY++) {
+ for (int offZ = 0; offZ < d; offZ++) {
+ int xPos = pos.chunkPosX - 1 + offX,
+ yPos = pos.chunkPosY - 1 + offY,
+ zPos = pos.chunkPosZ - 1 + offZ;
+ Block leaf = world.getBlock(xPos, yPos, zPos);
+ if (leaf != null && leaf.isLeaves(world, xPos, yPos, zPos)) {
+ if (++leaves >= 5) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ // not enough leaves. sorreh
+ return false;
+ }
+
+ public static class TreeChopTask {
+
+ public final World world;
+ public final EntityPlayer player;
+ public final int blocksPerTick;
+
+ public Queue<ChunkPosition> blocks = Lists.newLinkedList();
+ public Set<ChunkPosition> visited = new THashSet<>();
+
+ public TreeChopTask(ChunkPosition start, EntityPlayer player, int blocksPerTick) {
+ this.world = player.getEntityWorld();
+ this.player = player;
+ this.blocksPerTick = blocksPerTick;
+
+ this.blocks.add(start);
+ }
+
+ private void queueCoordinate(int x, int y, int z) {
+ ChunkPosition pos = new ChunkPosition(x, y, z);
+ if (!visited.contains(pos)) {
+ blocks.add(pos);
+ }
+ }
+
+ @SubscribeEvent
+ public void onWorldTick(TickEvent.WorldTickEvent event) {
+ if (event.side.isClient()) {
+ finish();
+ return;
+ }
+ // only if same dimension
+ if (event.world.provider.dimensionId != world.provider.dimensionId) {
+ return;
+ }
+
+ // setup
+ int left = blocksPerTick;
+ // NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
+
+ // continue running
+ ChunkPosition pos;
+ while (left > 0) {
+ // completely done or can't do our job anymore?!
+ if (blocks.isEmpty() /* || tags.getBoolean("Broken")*/) {
+ finish();
+ return;
+ }
+
+ pos = blocks.remove();
+ if (!visited.add(pos)) {
+ continue;
+ }
+ int x = pos.chunkPosX, y = pos.chunkPosY, z = pos.chunkPosZ;
+
+ Block block = world.getBlock(x, y, z);
+ int meta = world.getBlockMetadata(x, y, z);
+
+ // can we harvest the block and is effective?
+ if (!block.isWood(world, x, y, z) || !isWoodLog(block)) {
+ continue;
+ }
+
+ // save its neighbors
+ queueCoordinate(x + 1, y, z);
+ queueCoordinate(x, y, z + 1);
+ queueCoordinate(x - 1, y, z);
+ queueCoordinate(x, y, z - 1);
+
+ // also add the layer above.. stupid acacia trees
+ for (int offX = 0; offX < 3; offX++) {
+ for (int offZ = 0; offZ < 3; offZ++) {
+ queueCoordinate(x - 1 + offX, y + 1, z - 1 + offZ);
+ }
+ }
+
+ // break it, wooo!
+ breakExtraBlock(player.worldObj, x, y, z, 0, player, x, y, z);
+ left--;
+ }
+ }
+
+ private void finish() {
+ // goodbye cruel world
+ FMLCommonHandler.instance().bus().unregister(this);
+ }
+ }
+
+ public static void breakExtraBlock(
+ World world, int x, int y, int z, int sidehit, EntityPlayer playerEntity, int refX, int refY, int refZ) {
+ // prevent calling that stuff for air blocks, could lead to unexpected behaviour since it fires events
+ if (world.isAirBlock(x, y, z)) return;
+
+ // what?
+ if (!(playerEntity instanceof EntityPlayerMP)) return;
+ EntityPlayerMP player = (EntityPlayerMP) playerEntity;
+
+ // check if the block can be broken, since extra block breaks shouldn't instantly break stuff like obsidian
+ // or precious ores you can't harvest while mining stone
+ Block block = world.getBlock(x, y, z);
+ int meta = world.getBlockMetadata(x, y, z);
+
+ // only effective materials
+ if (!isWoodLog(block)) return;
+
+ Block refBlock = world.getBlock(refX, refY, refZ);
+ float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
+ float strength = ForgeHooks.blockStrength(block, player, world, x, y, z);
+
+ // only harvestable blocks that aren't impossibly slow to harvest
+ if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength / strength > 10f) return;
+
+ // send the blockbreak event
+ BlockEvent.BreakEvent event =
+ ForgeHooks.onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x, y, z);
+ if (event.isCanceled()) return;
+
+ if (player.capabilities.isCreativeMode) {
+ block.onBlockHarvested(world, x, y, z, meta, player);
+ if (block.removedByPlayer(world, player, x, y, z, false))
+ block.onBlockDestroyedByPlayer(world, x, y, z, meta);
+
+ // send update to client
+ if (!world.isRemote) {
+ player.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
+ }
+ return;
+ }
+
+ // callback to the tool the player uses. Called on both sides. This damages the tool n stuff.
+ player.getCurrentEquippedItem().func_150999_a(world, block, x, y, z, player);
+
+ // server sided handling
+ if (!world.isRemote) {
+ // serverside we reproduce ItemInWorldManager.tryHarvestBlock
+
+ // ItemInWorldManager.removeBlock
+ block.onBlockHarvested(world, x, y, z, meta, player);
+
+ if (block.removedByPlayer(
+ world, player, x, y, z, true)) // boolean is if block can be harvested, checked above
+ {
+ block.onBlockDestroyedByPlayer(world, x, y, z, meta);
+ block.harvestBlock(world, player, x, y, z, meta);
+ block.dropXpOnBlockBreak(world, x, y, z, event.getExpToDrop());
+ }
+
+ // always send block update to client
+ player.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
+ }
+ // client sided handling
+ else {
+ // PlayerControllerMP pcmp = Minecraft.getMinecraft().playerController;
+ // clientside we do a "this clock has been clicked on long enough to be broken" call. This should not send
+ // any new packets
+ // the code above, executed on the server, sends a block-updates that give us the correct state of the block
+ // we destroy.
+
+ // following code can be found in PlayerControllerMP.onPlayerDestroyBlock
+ world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
+ if (block.removedByPlayer(world, player, x, y, z, true)) {
+ block.onBlockDestroyedByPlayer(world, x, y, z, meta);
+ }
+ // callback to the tool
+ ItemStack itemstack = player.getCurrentEquippedItem();
+ if (itemstack != null) {
+ itemstack.func_150999_a(world, block, x, y, z, player);
+
+ if (itemstack.stackSize == 0) {
+ player.destroyCurrentEquippedItem();
+ }
+ }
+
+ // send an update to the server, so we get an update back
+ // if(PHConstruct.extraBlockUpdates)
+ // Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(2, x,y,z,
+ // Minecraft.getMinecraft().objectMouseOver.sideHit));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java
index 575e094696..72d6111b8a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java
@@ -1,14 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.helpers;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -16,146 +14,142 @@ import net.minecraftforge.fluids.FluidStack;
public class VolumetricFlaskHelper {
- private static final Class sClassVolumetricFlask;
- private static final Method sMethodGetFlaskMaxCapacity;
- private static Item mFlask;
-
- static {
- if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
- sClassVolumetricFlask = ReflectionUtils.getClass("gregtech.common.items.GT_VolumetricFlask");
- Method aMaxCapacity = null;
- try {
- aMaxCapacity = sClassVolumetricFlask.getDeclaredMethod("getMaxCapacity", new Class[] {});
- }
- catch (NoSuchMethodException e) {
- e.printStackTrace();
- CORE.crash("Secondary Error Obtaining instance of 'getMaxCapacity' from 'GT_VolumetricFlask'. Crashing.");
- }
- sMethodGetFlaskMaxCapacity = aMaxCapacity;
- }
- else {
- sClassVolumetricFlask = null;
- sMethodGetFlaskMaxCapacity = null;
- }
- }
-
- public static ItemStack getVolumetricFlask(int aAmount) {
- ItemStack aFlask = ItemUtils.getValueOfItemList("VOLUMETRIC_FLASK", aAmount, (ItemStack) null);
- return aFlask;
- }
-
- public static ItemStack getLargeVolumetricFlask(int aAmount) {
- ItemStack aFlask = GregtechItemList.VOLUMETRIC_FLASK_8k.get(aAmount);
- return aFlask;
- }
-
- public static ItemStack getGiganticVolumetricFlask(int aAmount) {
- ItemStack aFlask = GregtechItemList.VOLUMETRIC_FLASK_32k.get(aAmount);
- return aFlask;
- }
-
- public static boolean isVolumetricFlask(ItemStack aStack) {
- if (isNormalVolumetricFlask(aStack) || isLargeVolumetricFlask(aStack) || isGiganticVolumetricFlask(aStack)) {
- return true;
- }
- return false;
- }
-
- public static boolean isNormalVolumetricFlask(ItemStack aStack) {
- if (mFlask == null) {
- ItemStack aFlask = ItemUtils.getValueOfItemList("VOLUMETRIC_FLASK", 1, (ItemStack) null);
- if (aFlask != null) {
- mFlask = aFlask.getItem();
- }
- }
- if (aStack.getItem() == mFlask) {
- return true;
- }
- return false;
- }
-
- public static boolean isLargeVolumetricFlask(ItemStack aStack) {
- if (GregtechItemList.VOLUMETRIC_FLASK_8k.getItem() == aStack.getItem()) {
- return true;
- }
- return false;
- }
-
- public static boolean isGiganticVolumetricFlask(ItemStack aStack) {
- if (GregtechItemList.VOLUMETRIC_FLASK_32k.getItem() == aStack.getItem()) {
- return true;
- }
- return false;
- }
-
- public static int getMaxFlaskCapacity(ItemStack aStack) {
- if (aStack != null && sMethodGetFlaskMaxCapacity != null) {
- Item aItem = aStack.getItem();
- if (sClassVolumetricFlask.isInstance(aItem)) {
- int aMaxCapacity = (int) ReflectionUtils.invokeNonBool(aItem, sMethodGetFlaskMaxCapacity, new Object[] {});
- return aMaxCapacity;
- }
- }
- return 0;
- }
-
- public static boolean isFlaskEmpty(ItemStack aStack) {
- return getFlaskFluid(aStack) == null;
- }
-
- public static FluidStack getFlaskFluid(ItemStack aStack) {
- if (aStack.hasTagCompound()) {
- NBTTagCompound nbt = aStack.getTagCompound();
- if (nbt.hasKey("Fluid", 10))
- return FluidStack.loadFluidStackFromNBT(nbt.getCompoundTag("Fluid"));
- }
- return null;
- }
-
- public static void setFluid(ItemStack stack, FluidStack fluidStack) {
- boolean removeFluid = (fluidStack == null) || (fluidStack.amount <= 0);
- NBTTagCompound nbt = stack.getTagCompound();
- if (nbt == null) {
- if (removeFluid)
- return;
- stack.setTagCompound(nbt = new NBTTagCompound());
- }
- if (removeFluid) {
- nbt.removeTag("Fluid");
- if (nbt.hasNoTags()) {
- stack.setTagCompound(null);
- }
- } else {
- nbt.setTag("Fluid", fluidStack.writeToNBT(new NBTTagCompound()));
- }
- }
-
- public static int getFlaskCapacity(ItemStack aStack) {
- int capacity = 1000;
- if (aStack.hasTagCompound()) {
- NBTTagCompound nbt = aStack.getTagCompound();
- if (nbt.hasKey("Capacity", 3))
- capacity = nbt.getInteger("Capacity");
- }
- return Math.min(getMaxFlaskCapacity(aStack), capacity);
- }
-
- public static boolean setNewFlaskCapacity(ItemStack aStack, int aCapacity) {
- if (aStack == null || aCapacity <= 0) {
- return false;
- }
- aCapacity = Math.min(aCapacity, getMaxFlaskCapacity(aStack));
- NBTTagCompound nbt = aStack.getTagCompound();
- if (nbt == null) {
- aStack.setTagCompound(nbt = new NBTTagCompound());
- }
- nbt.setInteger("Capacity", aCapacity);
- return true;
- }
-
+ private static final Class sClassVolumetricFlask;
+ private static final Method sMethodGetFlaskMaxCapacity;
+ private static Item mFlask;
+
+ static {
+ if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
+ sClassVolumetricFlask = ReflectionUtils.getClass("gregtech.common.items.GT_VolumetricFlask");
+ Method aMaxCapacity = null;
+ try {
+ aMaxCapacity = sClassVolumetricFlask.getDeclaredMethod("getMaxCapacity", new Class[] {});
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ CORE.crash(
+ "Secondary Error Obtaining instance of 'getMaxCapacity' from 'GT_VolumetricFlask'. Crashing.");
+ }
+ sMethodGetFlaskMaxCapacity = aMaxCapacity;
+ } else {
+ sClassVolumetricFlask = null;
+ sMethodGetFlaskMaxCapacity = null;
+ }
+ }
+
+ public static ItemStack getVolumetricFlask(int aAmount) {
+ ItemStack aFlask = ItemUtils.getValueOfItemList("VOLUMETRIC_FLASK", aAmount, (ItemStack) null);
+ return aFlask;
+ }
+
+ public static ItemStack getLargeVolumetricFlask(int aAmount) {
+ ItemStack aFlask = GregtechItemList.VOLUMETRIC_FLASK_8k.get(aAmount);
+ return aFlask;
+ }
+
+ public static ItemStack getGiganticVolumetricFlask(int aAmount) {
+ ItemStack aFlask = GregtechItemList.VOLUMETRIC_FLASK_32k.get(aAmount);
+ return aFlask;
+ }
+
+ public static boolean isVolumetricFlask(ItemStack aStack) {
+ if (isNormalVolumetricFlask(aStack) || isLargeVolumetricFlask(aStack) || isGiganticVolumetricFlask(aStack)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isNormalVolumetricFlask(ItemStack aStack) {
+ if (mFlask == null) {
+ ItemStack aFlask = ItemUtils.getValueOfItemList("VOLUMETRIC_FLASK", 1, (ItemStack) null);
+ if (aFlask != null) {
+ mFlask = aFlask.getItem();
+ }
+ }
+ if (aStack.getItem() == mFlask) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isLargeVolumetricFlask(ItemStack aStack) {
+ if (GregtechItemList.VOLUMETRIC_FLASK_8k.getItem() == aStack.getItem()) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isGiganticVolumetricFlask(ItemStack aStack) {
+ if (GregtechItemList.VOLUMETRIC_FLASK_32k.getItem() == aStack.getItem()) {
+ return true;
+ }
+ return false;
+ }
+
+ public static int getMaxFlaskCapacity(ItemStack aStack) {
+ if (aStack != null && sMethodGetFlaskMaxCapacity != null) {
+ Item aItem = aStack.getItem();
+ if (sClassVolumetricFlask.isInstance(aItem)) {
+ int aMaxCapacity =
+ (int) ReflectionUtils.invokeNonBool(aItem, sMethodGetFlaskMaxCapacity, new Object[] {});
+ return aMaxCapacity;
+ }
+ }
+ return 0;
+ }
+
+ public static boolean isFlaskEmpty(ItemStack aStack) {
+ return getFlaskFluid(aStack) == null;
+ }
+
+ public static FluidStack getFlaskFluid(ItemStack aStack) {
+ if (aStack.hasTagCompound()) {
+ NBTTagCompound nbt = aStack.getTagCompound();
+ if (nbt.hasKey("Fluid", 10)) return FluidStack.loadFluidStackFromNBT(nbt.getCompoundTag("Fluid"));
+ }
+ return null;
+ }
+
+ public static void setFluid(ItemStack stack, FluidStack fluidStack) {
+ boolean removeFluid = (fluidStack == null) || (fluidStack.amount <= 0);
+ NBTTagCompound nbt = stack.getTagCompound();
+ if (nbt == null) {
+ if (removeFluid) return;
+ stack.setTagCompound(nbt = new NBTTagCompound());
+ }
+ if (removeFluid) {
+ nbt.removeTag("Fluid");
+ if (nbt.hasNoTags()) {
+ stack.setTagCompound(null);
+ }
+ } else {
+ nbt.setTag("Fluid", fluidStack.writeToNBT(new NBTTagCompound()));
+ }
+ }
+
+ public static int getFlaskCapacity(ItemStack aStack) {
+ int capacity = 1000;
+ if (aStack.hasTagCompound()) {
+ NBTTagCompound nbt = aStack.getTagCompound();
+ if (nbt.hasKey("Capacity", 3)) capacity = nbt.getInteger("Capacity");
+ }
+ return Math.min(getMaxFlaskCapacity(aStack), capacity);
+ }
+
+ public static boolean setNewFlaskCapacity(ItemStack aStack, int aCapacity) {
+ if (aStack == null || aCapacity <= 0) {
+ return false;
+ }
+ aCapacity = Math.min(aCapacity, getMaxFlaskCapacity(aStack));
+ NBTTagCompound nbt = aStack.getTagCompound();
+ if (nbt == null) {
+ aStack.setTagCompound(nbt = new NBTTagCompound());
+ }
+ nbt.setInteger("Capacity", aCapacity);
+ return true;
+ }
+
public static int fillFlask(ItemStack stack, FluidStack resource, boolean doFill) {
- if (stack.stackSize != 1)
- return 0;
+ if (stack.stackSize != 1) return 0;
if ((resource == null) || (resource.amount <= 0)) {
return 0;
}
@@ -173,16 +167,17 @@ public class VolumetricFlaskHelper {
return amount;
}
- public static Item generateNewFlask(String unlocalized, String english, int maxCapacity) {
- Constructor aFlask = ReflectionUtils.getConstructor(sClassVolumetricFlask, new Class[] {String.class, String.class, int.class});
- if (aFlask != null) {
- Object aInstance = ReflectionUtils.createNewInstanceFromConstructor(aFlask, new Object[] {unlocalized, english, maxCapacity});
- if (aInstance != null && aInstance instanceof Item) {
- Item aNewFlaskItem = (Item) aInstance;
- return aNewFlaskItem;
- }
- }
- return null;
- }
-
+ public static Item generateNewFlask(String unlocalized, String english, int maxCapacity) {
+ Constructor aFlask = ReflectionUtils.getConstructor(
+ sClassVolumetricFlask, new Class[] {String.class, String.class, int.class});
+ if (aFlask != null) {
+ Object aInstance = ReflectionUtils.createNewInstanceFromConstructor(
+ aFlask, new Object[] {unlocalized, english, maxCapacity});
+ if (aInstance != null && aInstance instanceof Item) {
+ Item aNewFlaskItem = (Item) aInstance;
+ return aNewFlaskItem;
+ }
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java
index 29dabaf084..165941b1d2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java
@@ -1,5 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.helpers.autocrafter;
+import gtPlusPlus.api.objects.Logger;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.*;
@@ -7,112 +8,98 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.world.World;
-import gtPlusPlus.api.objects.Logger;
+public class AC_Helper_Container extends Container {
+ /** The crafting matrix inventory (3x3). */
+ public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
+
+ public IInventory craftResult = new InventoryCraftResult();
+ private World worldObj;
+
+ public InventoryCrafting getMatrix() {
+ return this.craftMatrix;
+ }
+
+ public boolean putItemsIntoGrid(ItemStack[] inputs) {
+ if (inputs.length < 9) {
+ return false;
+ }
+ for (int i = 0; i < 9; i++) {
+ this.putStackInSlot(i, inputs[i]);
+ }
+ this.onCraftMatrixChanged(this.craftMatrix);
+ return true;
+ }
+
+ public AC_Helper_Container(InventoryPlayer playerInventory, World world, int x, int y, int z) {
+ this.worldObj = world;
+ this.addSlotToContainer(
+ new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 124, 35));
+ int l;
+ int i1;
+
+ for (l = 0; l < 3; ++l) {
+ for (i1 = 0; i1 < 3; ++i1) {
+ this.addSlotToContainer(new Slot(this.craftMatrix, i1 + l * 3, 30 + i1 * 18, 17 + l * 18));
+ }
+ }
+
+ for (l = 0; l < 3; ++l) {
+ for (i1 = 0; i1 < 9; ++i1) {
+ this.addSlotToContainer(new Slot(playerInventory, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
+ }
+ }
+
+ for (l = 0; l < 9; ++l) {
+ this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142));
+ }
+
+ this.onCraftMatrixChanged(this.craftMatrix);
+ }
+
+ /**
+ * Callback for when the crafting matrix is changed.
+ */
+ @Override
+ public void onCraftMatrixChanged(IInventory p_75130_1_) {
+ this.craftResult.setInventorySlotContents(
+ 0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
+ Logger.INFO("Crafted " + this.craftResult.getStackInSlot(0));
+ }
+
+ /**
+ * Called when the container is closed.
+ */
+ @Override
+ public void onContainerClosed(EntityPlayer p_75134_1_) {
+ super.onContainerClosed(p_75134_1_);
+
+ if (!this.worldObj.isRemote) {
+ for (int i = 0; i < 9; ++i) {
+ ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);
+
+ if (itemstack != null) {
+ p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false);
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer p_75145_1_) {
+ return true;
+ }
+
+ /**
+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
+ */
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
+ ItemStack itemstack = null;
+ return itemstack;
+ }
-public class AC_Helper_Container extends Container
-{
- /** The crafting matrix inventory (3x3). */
- public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
- public IInventory craftResult = new InventoryCraftResult();
- private World worldObj;
-
- public InventoryCrafting getMatrix(){
- return this.craftMatrix;
- }
-
- public boolean putItemsIntoGrid(ItemStack[] inputs){
- if (inputs.length < 9){
- return false;
- }
- for (int i=0;i<9;i++){
- this.putStackInSlot(i, inputs[i]);
- }
- this.onCraftMatrixChanged(this.craftMatrix);
- return true;
- }
-
- public AC_Helper_Container(InventoryPlayer playerInventory, World world, int x, int y, int z)
- {
- this.worldObj = world;
- this.addSlotToContainer(new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 124, 35));
- int l;
- int i1;
-
- for (l = 0; l < 3; ++l)
- {
- for (i1 = 0; i1 < 3; ++i1)
- {
- this.addSlotToContainer(new Slot(this.craftMatrix, i1 + l * 3, 30 + i1 * 18, 17 + l * 18));
- }
- }
-
- for (l = 0; l < 3; ++l)
- {
- for (i1 = 0; i1 < 9; ++i1)
- {
- this.addSlotToContainer(new Slot(playerInventory, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
- }
- }
-
- for (l = 0; l < 9; ++l)
- {
- this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142));
- }
-
- this.onCraftMatrixChanged(this.craftMatrix);
- }
-
- /**
- * Callback for when the crafting matrix is changed.
- */
- @Override
- public void onCraftMatrixChanged(IInventory p_75130_1_)
- {
- this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
- Logger.INFO("Crafted "+this.craftResult.getStackInSlot(0));
-
- }
-
- /**
- * Called when the container is closed.
- */
- @Override
- public void onContainerClosed(EntityPlayer p_75134_1_)
- {
- super.onContainerClosed(p_75134_1_);
-
- if (!this.worldObj.isRemote)
- {
- for (int i = 0; i < 9; ++i)
- {
- ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);
-
- if (itemstack != null)
- {
- p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false);
- }
- }
- }
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer p_75145_1_)
- {
- return true;
- }
-
- /**
- * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
- */
- @Override
- public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_){
- ItemStack itemstack = null;
- return itemstack;
- }
-
- @Override
- public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_)
- {
- return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-} \ No newline at end of file
+ @Override
+ public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) {
+ return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java
index 772ece96aa..6b8452eeed 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java
@@ -1,80 +1,78 @@
package gtPlusPlus.xmod.gregtech.common.helpers.autocrafter;
-import java.util.*;
-import java.util.Map.Entry;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GT4Entity_AutoCrafter;
+import java.util.*;
+import java.util.Map.Entry;
public class AC_Helper_Utils {
- //AC maps
- public static final Map<Integer, GT4Entity_AutoCrafter> sAutocrafterMap = new HashMap<Integer, GT4Entity_AutoCrafter>();
-
- //Add Crafter
- public final static int addCrafter(GT4Entity_AutoCrafter AC) {
- if (!sAutocrafterMap.containsValue(AC)){
- int increase = sAutocrafterMap.size()+1;
- sAutocrafterMap.put(increase, AC);
- Logger.INFO("[A-C] "+"Added Auto-Crafter to index on position "+increase+".");
- return increase;
- }
- else {
- Logger.INFO("[A-C] Tried adding an Auto-Crafter to Index, but found one already there.");
- }
- return 0;
- }
+ // AC maps
+ public static final Map<Integer, GT4Entity_AutoCrafter> sAutocrafterMap =
+ new HashMap<Integer, GT4Entity_AutoCrafter>();
- //Remove Crafter
- public final static boolean removeCrafter(int frequency) {
- if (!sAutocrafterMap.isEmpty()){
- if (sAutocrafterMap.containsKey(frequency)){
- sAutocrafterMap.remove(frequency);
- return true;
- }
- }
- return false;
- }
+ // Add Crafter
+ public static final int addCrafter(GT4Entity_AutoCrafter AC) {
+ if (!sAutocrafterMap.containsValue(AC)) {
+ int increase = sAutocrafterMap.size() + 1;
+ sAutocrafterMap.put(increase, AC);
+ Logger.INFO("[A-C] " + "Added Auto-Crafter to index on position " + increase + ".");
+ return increase;
+ } else {
+ Logger.INFO("[A-C] Tried adding an Auto-Crafter to Index, but found one already there.");
+ }
+ return 0;
+ }
- public final static boolean removeCrafter(GT4Entity_AutoCrafter AC) {
- if (!sAutocrafterMap.isEmpty()){
- if (sAutocrafterMap.containsValue(AC)){
- sAutocrafterMap.remove(getIDByCrafter(AC));
- return true;
- }
- }
- return false;
- }
+ // Remove Crafter
+ public static final boolean removeCrafter(int frequency) {
+ if (!sAutocrafterMap.isEmpty()) {
+ if (sAutocrafterMap.containsKey(frequency)) {
+ sAutocrafterMap.remove(frequency);
+ return true;
+ }
+ }
+ return false;
+ }
- //Get Crafter
- public final static GT4Entity_AutoCrafter getCrafterByID(int ID) {
- if (!sAutocrafterMap.isEmpty()) {
- Set<Entry<Integer, GT4Entity_AutoCrafter>> players = sAutocrafterMap.entrySet();
- Iterator<Entry<Integer, GT4Entity_AutoCrafter>> i = players.iterator();
- while (i.hasNext()) {
- Entry<Integer, GT4Entity_AutoCrafter> current = i.next();
- if (current.getKey().equals(ID)) {
- return current.getValue();
- }
- }
- }
- Logger.WARNING("Failed. [getCrafterByID]");
- return null;
- }
+ public static final boolean removeCrafter(GT4Entity_AutoCrafter AC) {
+ if (!sAutocrafterMap.isEmpty()) {
+ if (sAutocrafterMap.containsValue(AC)) {
+ sAutocrafterMap.remove(getIDByCrafter(AC));
+ return true;
+ }
+ }
+ return false;
+ }
- public final static int getIDByCrafter(GT4Entity_AutoCrafter AC) {
- if (!sAutocrafterMap.isEmpty()) {
- Set<Entry<Integer, GT4Entity_AutoCrafter>> players = sAutocrafterMap.entrySet();
- Iterator<Entry<Integer, GT4Entity_AutoCrafter>> i = players.iterator();
- while (i.hasNext()) {
- Entry<Integer, GT4Entity_AutoCrafter> current = i.next();
- if (current.getValue().equals(AC)) {
- return current.getKey();
- }
- }
- }
- Logger.WARNING("Failed. [getIDByCrafter]");
- return 0;
- }
+ // Get Crafter
+ public static final GT4Entity_AutoCrafter getCrafterByID(int ID) {
+ if (!sAutocrafterMap.isEmpty()) {
+ Set<Entry<Integer, GT4Entity_AutoCrafter>> players = sAutocrafterMap.entrySet();
+ Iterator<Entry<Integer, GT4Entity_AutoCrafter>> i = players.iterator();
+ while (i.hasNext()) {
+ Entry<Integer, GT4Entity_AutoCrafter> current = i.next();
+ if (current.getKey().equals(ID)) {
+ return current.getValue();
+ }
+ }
+ }
+ Logger.WARNING("Failed. [getCrafterByID]");
+ return null;
+ }
+ public static final int getIDByCrafter(GT4Entity_AutoCrafter AC) {
+ if (!sAutocrafterMap.isEmpty()) {
+ Set<Entry<Integer, GT4Entity_AutoCrafter>> players = sAutocrafterMap.entrySet();
+ Iterator<Entry<Integer, GT4Entity_AutoCrafter>> i = players.iterator();
+ while (i.hasNext()) {
+ Entry<Integer, GT4Entity_AutoCrafter> current = i.next();
+ if (current.getValue().equals(AC)) {
+ return current.getKey();
+ }
+ }
+ }
+ Logger.WARNING("Failed. [getIDByCrafter]");
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java
index a3a116fea6..f4eb274179 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java
@@ -2,262 +2,256 @@ package gtPlusPlus.xmod.gregtech.common.helpers.tesseract;
import static gtPlusPlus.core.lib.CORE.*;
-import java.util.*;
-import java.util.Map.Entry;
-
-import net.minecraft.entity.player.EntityPlayer;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractTerminal;
+import java.util.*;
+import java.util.Map.Entry;
+import net.minecraft.entity.player.EntityPlayer;
public class TesseractHelper {
- /**
- * Tesseract Generator Helpers
- *
- * @param player
- * @return
- */
-
- //Checks if a Generator is owned by a player.
- public final static boolean isGeneratorOwnedByPlayer(EntityPlayer player,
- GT_MetaTileEntity_TesseractGenerator generator) {
- if (player == null){
- Logger.WARNING("Failed. [isGeneratorOwnedByPlayer]");
- return false;
- }
- //Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 1");
- UUID playerIdentifier = player.getUniqueID();
- if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) {
- //Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 2");
- Map<Integer, GT_MetaTileEntity_TesseractGenerator> generators = getGeneratorOwnershipByPlayer(player);
- Set<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> players = generators.entrySet();
- Iterator<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> i = players.iterator();
- while (i.hasNext()) {
- //Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 3");
- Entry<Integer, GT_MetaTileEntity_TesseractGenerator> current = i.next();
- if (current.getValue().equals(generator)) {
- //Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 4");
- return true;
- }
- }
- }
- Logger.WARNING("Failed. [isGeneratorOwnedByPlayer]");
- return false;
- }
-
- //Saves A Generator to the Players UUID map along with the Freq.
- public final static boolean setGeneratorOwnershipByPlayer(EntityPlayer player, int freq,
- GT_MetaTileEntity_TesseractGenerator generator) {
- if (player == null){
- return false;
- }
- UUID playerIdentifier = player.getUniqueID();
- Logger.WARNING("Setting Generator on "+freq+" for "+player.getDisplayName()+".");
- if (playerIdentifier != null) {
- Map<Integer, GT_MetaTileEntity_TesseractGenerator> playerOwned = sTesseractGeneratorOwnershipMap
- .get(playerIdentifier);
- if (playerOwned == null || playerOwned.isEmpty()) {
- Map<Integer, GT_MetaTileEntity_TesseractGenerator> newOwnershipMap = new HashMap<Integer, GT_MetaTileEntity_TesseractGenerator>();
- newOwnershipMap.put(freq, generator);
- sTesseractGeneratorOwnershipMap.put(playerIdentifier, newOwnershipMap);
- Logger.WARNING("Success! [Empty Map]");
- return true;
- } else if (sTesseractGeneratorOwnershipMap.containsKey(playerIdentifier)) {
- Map<Integer, GT_MetaTileEntity_TesseractGenerator> ownershipMap = sTesseractGeneratorOwnershipMap
- .get(playerIdentifier);
- if (!ownershipMap.containsKey(freq)){
- ownershipMap.put(freq, generator);
- }
- ownershipMap.put(freq, generator);
- sTesseractGeneratorOwnershipMap.put(playerIdentifier, ownershipMap);
- Logger.WARNING("Success!");
- return true;
- }
- }
- Logger.WARNING("Failed. [setGeneratorOwnershipByPlayer]");
- return false;
- }
-
- //Gets Generator based on Frequency.
- public final static GT_MetaTileEntity_TesseractGenerator getGeneratorByFrequency(EntityPlayer player,
- int freq) {
- if (player == null){
- return null;
- }
- UUID playerIdentifier = player.getUniqueID();
- Logger.WARNING("Getting Generator on "+freq+" for "+player.getDisplayName()+".");
- if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) {
- //Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 1");
- Map<Integer, GT_MetaTileEntity_TesseractGenerator> generators = getGeneratorOwnershipByPlayer(player);
- Set<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> players = generators.entrySet();
- Iterator<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> i = players.iterator();
- while (i.hasNext()) {
- //Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 2");
- Entry<Integer, GT_MetaTileEntity_TesseractGenerator> current = i.next();
- if (current.getKey().equals(freq)) {
- //Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 3");
- Logger.WARNING("Success!");
- return current.getValue();
- }
- }
- }
- Logger.WARNING("Failed. [getGeneratorByFrequency]");
- return null;
- }
-
- //Remove Tesseract Generator
- public final static boolean removeGenerator(EntityPlayer player, int frequency) {
- if (player == null){
- return false;
- }
- UUID playerIdentifier = player.getUniqueID();
- if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) {
- sTesseractGeneratorOwnershipMap.get(playerIdentifier).remove(frequency);
- return true;
- }
- return false;
- }
+ /**
+ * Tesseract Generator Helpers
+ *
+ * @param player
+ * @return
+ */
- /**
- *
- * Tesseract Terminal Helpers
- *
- * @param player
- * @return
- */
+ // Checks if a Generator is owned by a player.
+ public static final boolean isGeneratorOwnedByPlayer(
+ EntityPlayer player, GT_MetaTileEntity_TesseractGenerator generator) {
+ if (player == null) {
+ Logger.WARNING("Failed. [isGeneratorOwnedByPlayer]");
+ return false;
+ }
+ // Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 1");
+ UUID playerIdentifier = player.getUniqueID();
+ if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) {
+ // Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 2");
+ Map<Integer, GT_MetaTileEntity_TesseractGenerator> generators = getGeneratorOwnershipByPlayer(player);
+ Set<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> players = generators.entrySet();
+ Iterator<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> i = players.iterator();
+ while (i.hasNext()) {
+ // Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 3");
+ Entry<Integer, GT_MetaTileEntity_TesseractGenerator> current = i.next();
+ if (current.getValue().equals(generator)) {
+ // Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 4");
+ return true;
+ }
+ }
+ }
+ Logger.WARNING("Failed. [isGeneratorOwnedByPlayer]");
+ return false;
+ }
- //Checks if a Terminal is owned by a player.
- public final static boolean isTerminalOwnedByPlayer(EntityPlayer player,
- GT_MetaTileEntity_TesseractTerminal generator) {
- if (player == null){
- return false;
- }
- UUID playerIdentifier = player.getUniqueID();
- if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) {
- Map<Integer, GT_MetaTileEntity_TesseractTerminal> generators = getTerminalOwnershipByPlayer(player);
- Set<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> players = generators.entrySet();
- Iterator<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> i = players.iterator();
- while (i.hasNext()) {
- Entry<Integer, GT_MetaTileEntity_TesseractTerminal> current = i.next();
- if (current.getValue().equals(generator)) {
- return true;
- }
- }
- }
- return false;
- }
+ // Saves A Generator to the Players UUID map along with the Freq.
+ public static final boolean setGeneratorOwnershipByPlayer(
+ EntityPlayer player, int freq, GT_MetaTileEntity_TesseractGenerator generator) {
+ if (player == null) {
+ return false;
+ }
+ UUID playerIdentifier = player.getUniqueID();
+ Logger.WARNING("Setting Generator on " + freq + " for " + player.getDisplayName() + ".");
+ if (playerIdentifier != null) {
+ Map<Integer, GT_MetaTileEntity_TesseractGenerator> playerOwned =
+ sTesseractGeneratorOwnershipMap.get(playerIdentifier);
+ if (playerOwned == null || playerOwned.isEmpty()) {
+ Map<Integer, GT_MetaTileEntity_TesseractGenerator> newOwnershipMap =
+ new HashMap<Integer, GT_MetaTileEntity_TesseractGenerator>();
+ newOwnershipMap.put(freq, generator);
+ sTesseractGeneratorOwnershipMap.put(playerIdentifier, newOwnershipMap);
+ Logger.WARNING("Success! [Empty Map]");
+ return true;
+ } else if (sTesseractGeneratorOwnershipMap.containsKey(playerIdentifier)) {
+ Map<Integer, GT_MetaTileEntity_TesseractGenerator> ownershipMap =
+ sTesseractGeneratorOwnershipMap.get(playerIdentifier);
+ if (!ownershipMap.containsKey(freq)) {
+ ownershipMap.put(freq, generator);
+ }
+ ownershipMap.put(freq, generator);
+ sTesseractGeneratorOwnershipMap.put(playerIdentifier, ownershipMap);
+ Logger.WARNING("Success!");
+ return true;
+ }
+ }
+ Logger.WARNING("Failed. [setGeneratorOwnershipByPlayer]");
+ return false;
+ }
- //Saves A Terminal to the Players UUID map along with the Freq.
- public final static boolean setTerminalOwnershipByPlayer(EntityPlayer player, int freq,
- GT_MetaTileEntity_TesseractTerminal generator) {
- if (player == null){
- return false;
- }
- UUID playerIdentifier = player.getUniqueID();
- if (playerIdentifier != null) {
- Logger.WARNING("Setting Terminal on "+freq+" for "+player.getDisplayName()+".");
- Map<Integer, GT_MetaTileEntity_TesseractTerminal> playerOwned = sTesseractTerminalOwnershipMap
- .get(playerIdentifier);
- if (playerOwned == null || playerOwned.isEmpty()) {
- Map<Integer, GT_MetaTileEntity_TesseractTerminal> newOwnershipMap = new HashMap<Integer, GT_MetaTileEntity_TesseractTerminal>();
- newOwnershipMap.put(freq, generator);
- sTesseractTerminalOwnershipMap.put(playerIdentifier, newOwnershipMap);
- Logger.WARNING("Success! [Empty Map]");
- return true;
- } else if (sTesseractTerminalOwnershipMap.containsKey(playerIdentifier)) {
- Map<Integer, GT_MetaTileEntity_TesseractTerminal> ownershipMap = sTesseractTerminalOwnershipMap
- .get(playerIdentifier);
- if (!ownershipMap.containsKey(freq)){
- ownershipMap.put(freq, generator);
- }
- sTesseractTerminalOwnershipMap.put(playerIdentifier, ownershipMap);
- Logger.WARNING("Success!");
- return true;
- }
- }
- Logger.WARNING("Failed. [setTerminalOwnershipByPlayer]");
- return false;
- }
+ // Gets Generator based on Frequency.
+ public static final GT_MetaTileEntity_TesseractGenerator getGeneratorByFrequency(EntityPlayer player, int freq) {
+ if (player == null) {
+ return null;
+ }
+ UUID playerIdentifier = player.getUniqueID();
+ Logger.WARNING("Getting Generator on " + freq + " for " + player.getDisplayName() + ".");
+ if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) {
+ // Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 1");
+ Map<Integer, GT_MetaTileEntity_TesseractGenerator> generators = getGeneratorOwnershipByPlayer(player);
+ Set<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> players = generators.entrySet();
+ Iterator<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> i = players.iterator();
+ while (i.hasNext()) {
+ // Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 2");
+ Entry<Integer, GT_MetaTileEntity_TesseractGenerator> current = i.next();
+ if (current.getKey().equals(freq)) {
+ // Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 3");
+ Logger.WARNING("Success!");
+ return current.getValue();
+ }
+ }
+ }
+ Logger.WARNING("Failed. [getGeneratorByFrequency]");
+ return null;
+ }
- //Gets Terminal based on Frequency.
- public final static GT_MetaTileEntity_TesseractTerminal getTerminalByFrequency(EntityPlayer player,
- int freq) {
- if (player == null){
- return null;
- }
- UUID playerIdentifier = player.getUniqueID();
- Logger.WARNING("Getting Terminal on "+freq+" for "+player.getDisplayName()+".");
- if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) {
- Map<Integer, GT_MetaTileEntity_TesseractTerminal> generators = getTerminalOwnershipByPlayer(player);
- Set<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> players = generators.entrySet();
- Iterator<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> i = players.iterator();
- while (i.hasNext()) {
- Entry<Integer, GT_MetaTileEntity_TesseractTerminal> current = i.next();
- if (current.getKey().equals(freq)) {
- Logger.WARNING("Success!");
- return current.getValue();
- }
- }
- }
- Logger.WARNING("Failed. [getTerminalByFrequency]");
- return null;
- }
+ // Remove Tesseract Generator
+ public static final boolean removeGenerator(EntityPlayer player, int frequency) {
+ if (player == null) {
+ return false;
+ }
+ UUID playerIdentifier = player.getUniqueID();
+ if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) {
+ sTesseractGeneratorOwnershipMap.get(playerIdentifier).remove(frequency);
+ return true;
+ }
+ return false;
+ }
- //Remove Tesseract Terminal
- public final static boolean removeTerminal(EntityPlayer player, int frequency) {
- if (player == null){
- return false;
- }
- UUID playerIdentifier = player.getUniqueID();
- if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) {
- sTesseractTerminalOwnershipMap.get(playerIdentifier).remove(frequency);
- return true;
- }
- return false;
- }
+ /**
+ *
+ * Tesseract Terminal Helpers
+ *
+ * @param player
+ * @return
+ */
- /**
- *
- * Internal Methods
- *
- */
+ // Checks if a Terminal is owned by a player.
+ public static final boolean isTerminalOwnedByPlayer(
+ EntityPlayer player, GT_MetaTileEntity_TesseractTerminal generator) {
+ if (player == null) {
+ return false;
+ }
+ UUID playerIdentifier = player.getUniqueID();
+ if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) {
+ Map<Integer, GT_MetaTileEntity_TesseractTerminal> generators = getTerminalOwnershipByPlayer(player);
+ Set<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> players = generators.entrySet();
+ Iterator<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> i = players.iterator();
+ while (i.hasNext()) {
+ Entry<Integer, GT_MetaTileEntity_TesseractTerminal> current = i.next();
+ if (current.getValue().equals(generator)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
- private final static Map<Integer, GT_MetaTileEntity_TesseractGenerator> getGeneratorOwnershipByPlayer(
- EntityPlayer player) {
- UUID playerIdentifier = player.getUniqueID();
- if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) {
- Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>> players = sTesseractGeneratorOwnershipMap
- .entrySet();
- Iterator<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>> i = players.iterator();
- while (i.hasNext()) {
- Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>> current = i.next();
- if (current.getKey().compareTo(playerIdentifier) == 0) {
- return current.getValue();
- }
+ // Saves A Terminal to the Players UUID map along with the Freq.
+ public static final boolean setTerminalOwnershipByPlayer(
+ EntityPlayer player, int freq, GT_MetaTileEntity_TesseractTerminal generator) {
+ if (player == null) {
+ return false;
+ }
+ UUID playerIdentifier = player.getUniqueID();
+ if (playerIdentifier != null) {
+ Logger.WARNING("Setting Terminal on " + freq + " for " + player.getDisplayName() + ".");
+ Map<Integer, GT_MetaTileEntity_TesseractTerminal> playerOwned =
+ sTesseractTerminalOwnershipMap.get(playerIdentifier);
+ if (playerOwned == null || playerOwned.isEmpty()) {
+ Map<Integer, GT_MetaTileEntity_TesseractTerminal> newOwnershipMap =
+ new HashMap<Integer, GT_MetaTileEntity_TesseractTerminal>();
+ newOwnershipMap.put(freq, generator);
+ sTesseractTerminalOwnershipMap.put(playerIdentifier, newOwnershipMap);
+ Logger.WARNING("Success! [Empty Map]");
+ return true;
+ } else if (sTesseractTerminalOwnershipMap.containsKey(playerIdentifier)) {
+ Map<Integer, GT_MetaTileEntity_TesseractTerminal> ownershipMap =
+ sTesseractTerminalOwnershipMap.get(playerIdentifier);
+ if (!ownershipMap.containsKey(freq)) {
+ ownershipMap.put(freq, generator);
+ }
+ sTesseractTerminalOwnershipMap.put(playerIdentifier, ownershipMap);
+ Logger.WARNING("Success!");
+ return true;
+ }
+ }
+ Logger.WARNING("Failed. [setTerminalOwnershipByPlayer]");
+ return false;
+ }
- }
- }
- return null;
- }
+ // Gets Terminal based on Frequency.
+ public static final GT_MetaTileEntity_TesseractTerminal getTerminalByFrequency(EntityPlayer player, int freq) {
+ if (player == null) {
+ return null;
+ }
+ UUID playerIdentifier = player.getUniqueID();
+ Logger.WARNING("Getting Terminal on " + freq + " for " + player.getDisplayName() + ".");
+ if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) {
+ Map<Integer, GT_MetaTileEntity_TesseractTerminal> generators = getTerminalOwnershipByPlayer(player);
+ Set<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> players = generators.entrySet();
+ Iterator<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> i = players.iterator();
+ while (i.hasNext()) {
+ Entry<Integer, GT_MetaTileEntity_TesseractTerminal> current = i.next();
+ if (current.getKey().equals(freq)) {
+ Logger.WARNING("Success!");
+ return current.getValue();
+ }
+ }
+ }
+ Logger.WARNING("Failed. [getTerminalByFrequency]");
+ return null;
+ }
- private final static Map<Integer, GT_MetaTileEntity_TesseractTerminal> getTerminalOwnershipByPlayer(
- EntityPlayer player) {
- UUID playerIdentifier = player.getUniqueID();
- if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) {
- Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>> players = sTesseractTerminalOwnershipMap
- .entrySet();
- Iterator<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>> i = players.iterator();
- while (i.hasNext()) {
- Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>> current = i.next();
- if (current.getKey().compareTo(playerIdentifier) == 0) {
- return current.getValue();
- }
+ // Remove Tesseract Terminal
+ public static final boolean removeTerminal(EntityPlayer player, int frequency) {
+ if (player == null) {
+ return false;
+ }
+ UUID playerIdentifier = player.getUniqueID();
+ if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) {
+ sTesseractTerminalOwnershipMap.get(playerIdentifier).remove(frequency);
+ return true;
+ }
+ return false;
+ }
- }
- }
- return null;
- }
+ /**
+ *
+ * Internal Methods
+ *
+ */
+ private static final Map<Integer, GT_MetaTileEntity_TesseractGenerator> getGeneratorOwnershipByPlayer(
+ EntityPlayer player) {
+ UUID playerIdentifier = player.getUniqueID();
+ if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) {
+ Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>> players =
+ sTesseractGeneratorOwnershipMap.entrySet();
+ Iterator<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>> i = players.iterator();
+ while (i.hasNext()) {
+ Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>> current = i.next();
+ if (current.getKey().compareTo(playerIdentifier) == 0) {
+ return current.getValue();
+ }
+ }
+ }
+ return null;
+ }
+ private static final Map<Integer, GT_MetaTileEntity_TesseractTerminal> getTerminalOwnershipByPlayer(
+ EntityPlayer player) {
+ UUID playerIdentifier = player.getUniqueID();
+ if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) {
+ Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>> players =
+ sTesseractTerminalOwnershipMap.entrySet();
+ Iterator<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>> i = players.iterator();
+ while (i.hasNext()) {
+ Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>> current = i.next();
+ if (current.getKey().compareTo(playerIdentifier) == 0) {
+ return current.getValue();
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java
index bb40c9b379..1e45b7c60b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java
@@ -1,13 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.helpers.treefarm;
-import java.util.Random;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.FakeBlockPos;
import gtPlusPlus.api.objects.minecraft.FakeWorld;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling;
import net.minecraft.block.material.Material;
@@ -20,367 +19,353 @@ import net.minecraftforge.common.util.ForgeDirection;
public class TreeGenerator {
- private static final FakeTreeInFakeWorldGenerator mTreeData;
-
- static {
- Logger.WARNING("Created Fake Tree Generator.");
- mTreeData = new FakeTreeInFakeWorldGenerator();
- }
-
-
- public TreeGenerator() {
- if (!mTreeData.hasGenerated) {
- mTreeData.generate(null, CORE.RANDOM, 0, 0, 0);
- }
- }
-
- public AutoMap<ItemStack> generateOutput(int aTreeSize){
- AutoMap<ItemStack> aOutputMap = mTreeData.getOutputFromTree();
- if (aOutputMap != null && aOutputMap.size() > 0) {
- Logger.WARNING("Valid tree data output");
- return aOutputMap;
- }
- Logger.WARNING("Invalid tree data output");
- return new AutoMap<ItemStack>();
- }
-
- public static class FakeTreeInFakeWorldGenerator extends WorldGenAbstractTree
- {
- /** The minimum height of a generated tree. */
- private final int minTreeHeight;
- /** True if this tree should grow Vines. */
- private final boolean vinesGrow;
- /** The metadata value of the wood to use in tree generation. */
- private final int metaWood;
- /** The metadata value of the leaves to use in tree generation. */
- private final int metaLeaves;
-
- private final AutoMap<FakeWorld> mFakeWorld;
- private final int mTreesToGenerate;
-
- private int mCurrentGeneratorIteration = 0;
-
- private boolean hasGenerated = false;
- private AutoMap<ItemStack> aOutputsFromGenerator = new AutoMap<ItemStack>();
-
- public FakeTreeInFakeWorldGenerator()
- {
- this(4, 0, 0, false, 5000);
- }
-
- public FakeTreeInFakeWorldGenerator(int aMinHeight, int aWoodMeta, int aLeafMeta, boolean aVines, int aTreeCount)
- {
- super(false);
- this.minTreeHeight = aMinHeight;
- this.metaWood = aWoodMeta;
- this.metaLeaves = aLeafMeta;
- this.vinesGrow = aVines;
- this.mFakeWorld = new AutoMap<FakeWorld>();
- this.mTreesToGenerate = aTreeCount;
- Logger.WARNING("Created Fake Tree In Fake World Instance.");
- }
-
-
- public AutoMap<ItemStack> getOutputFromTree(){
- if (!hasGenerated) {
- Logger.WARNING("Generating Tree sample data");
- generate(null, CORE.RANDOM, 0, 0, 0);
- }
- AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>();
- int aRandomTreeID = MathUtils.randInt(0, this.mFakeWorld.size()-1);
- FakeWorld aWorld = this.mFakeWorld.get(aRandomTreeID);
- if (aWorld != null) {
- //Logger.WARNING("Getting all block data from fake world");
- aOutputMap = aWorld.getAllBlocksStoredInFakeWorld();
- }
- return aOutputMap;
-
- }
-
- @Override
- protected boolean func_150523_a(Block p_150523_1_)
- {
- return p_150523_1_.getMaterial() == Material.air || p_150523_1_.getMaterial() == Material.leaves || p_150523_1_ == Blocks.grass || p_150523_1_ == Blocks.dirt || p_150523_1_ == Blocks.log || p_150523_1_ == Blocks.log2 || p_150523_1_ == Blocks.sapling || p_150523_1_ == Blocks.vine;
- }
-
- @Override
- protected boolean isReplaceable(World world, int x, int y, int z)
- {
- FakeWorld aWorld = getWorld();
- Block block = aWorld.getBlock(x, y, z);
- return block.isAir(null, x, y, z) || block.isLeaves(null, x, y, z) || block.isWood(null, x, y, z) || func_150523_a(block);
- }
-
- @Override
- public boolean generate(World world, Random aRand, int aWorldX, int aWorldRealY, int aWorldZ){
- //Only Generate Once - This object is Cached
- if (hasGenerated) {
- return hasGenerated;
- }
- else {
- for (int yy=0;yy<mTreesToGenerate;yy++) {
- generateTree(0, 0, 0);
- mCurrentGeneratorIteration++;
- }
- hasGenerated = true;
- if (this.mFakeWorld.size() > 0) {
- for (FakeWorld aWorld : this.mFakeWorld) {
- for (ItemStack aBlockInFakeWorld : aWorld.getAllBlocksStoredInFakeWorld()) {
- aOutputsFromGenerator.add(aBlockInFakeWorld);
- }
- }
- return true;
- }
- else {
- return false;
- }
- }
- }
-
- private FakeWorld aFakeWorld;
-
- public FakeWorld getWorld() {
- FakeWorld aWorld = this.mFakeWorld.get(mCurrentGeneratorIteration);
- if (aWorld == null) {
- this.mFakeWorld.set(mCurrentGeneratorIteration, new FakeWorld(200));
- aWorld = this.mFakeWorld.get(mCurrentGeneratorIteration);
- }
- return aWorld;
- }
-
- public boolean generateTree(int aWorldX, int aWorldRealY, int aWorldZ) {
- FakeWorld aWorld = getWorld();
-
- //Set some static values
-
- Logger.WARNING("Stepping through generateTree [0]");
- //Dummy Value
- int aWorldY = 10;
-
- int l = CORE.RANDOM.nextInt(3) + this.minTreeHeight;
- boolean flag = true;
-
- if (aWorldY >= 1 && aWorldY + l + 1 <= 256)
- {
- Logger.WARNING("Stepping through generateTree [1]");
- byte b0;
- int k1;
- Block block;
-
- for (int i1 = aWorldY; i1 <= aWorldY + 1 + l; ++i1)
- {
- b0 = 1;
-
- if (i1 == aWorldY)
- {
- b0 = 0;
- }
-
- if (i1 >= aWorldY + 1 + l - 2)
- {
- b0 = 2;
- }
-
- for (int j1 = aWorldX - b0; j1 <= aWorldX + b0 && flag; ++j1)
- {
- for (k1 = aWorldZ - b0; k1 <= aWorldZ + b0 && flag; ++k1)
- {
- if (i1 >= 0 && i1 < 256)
- {
- block = aWorld.getBlock(j1, i1, k1);
-
- if (!this.isReplaceable(null, j1, i1, k1))
- {
- flag = false;
- }
- }
- else
- {
- flag = false;
- }
- }
- }
- }
-
- if (!flag)
- {
- Logger.WARNING("Stepping through generateTree [2]");
- return false;
- }
- else
- {
- Logger.WARNING("Stepping through generateTree [3]");
- Block block2 = aWorld.getBlock(aWorldX, aWorldY - 1, aWorldZ);
- FakeBlockPos aBlockToGrowPlantOn = aWorld.getBlockAtCoords(aWorldX, aWorldY-1, aWorldZ);
-
- boolean isSoil = block2.canSustainPlant(aWorld, aWorldX, aWorldY - 1, aWorldZ, ForgeDirection.UP, (BlockSapling)Blocks.sapling);
- if (/*isSoil &&*/ aWorldY < 256 - l - 1)
- {
- Logger.WARNING("Stepping through generateTree [4]");
- aBlockToGrowPlantOn.onPlantGrow(aWorld, aWorldX, aWorldY - 1, aWorldZ, aWorldX, aWorldY, aWorldZ);
- b0 = 3;
- byte b1 = 0;
- int l1;
- int i2;
- int j2;
- int i3;
-
- for (k1 = aWorldY - b0 + l; k1 <= aWorldY + l; ++k1)
- {
- i3 = k1 - (aWorldY + l);
- l1 = b1 + 1 - i3 / 2;
-
- for (i2 = aWorldX - l1; i2 <= aWorldX + l1; ++i2)
- {
- j2 = i2 - aWorldX;
-
- for (int k2 = aWorldZ - l1; k2 <= aWorldZ + l1; ++k2)
- {
- int l2 = k2 - aWorldZ;
-
- if (Math.abs(j2) != l1 || Math.abs(l2) != l1 || CORE.RANDOM.nextInt(2) != 0 && i3 != 0)
- {
- Block block1 = aWorld.getBlock(i2, k1, k2);
-
- if (block1.isAir(null, i2, k1, k2) || block1.isLeaves(null, i2, k1, k2))
- {
- this.setBlockAndNotifyAdequately(aWorld, i2, k1, k2, Blocks.leaves, this.metaLeaves);
- }
- }
- }
- }
- }
- Logger.WARNING("Stepping through generateTree [5]");
-
- for (k1 = 0; k1 < l; ++k1)
- {
- block = aWorld.getBlock(aWorldX, aWorldY + k1, aWorldZ);
-
- if (block.isAir(null, aWorldX, aWorldY + k1, aWorldZ) || block.isLeaves(null, aWorldX, aWorldY + k1, aWorldZ))
- {
- this.setBlockAndNotifyAdequately(aWorld, aWorldX, aWorldY + k1, aWorldZ, Blocks.log, this.metaWood);
-
- if (this.vinesGrow && k1 > 0)
- {
- if (CORE.RANDOM.nextInt(3) > 0 && aWorld.isAirBlock(aWorldX - 1, aWorldY + k1, aWorldZ))
- {
- this.setBlockAndNotifyAdequately(aWorld, aWorldX - 1, aWorldY + k1, aWorldZ, Blocks.vine, 8);
- }
-
- if (CORE.RANDOM.nextInt(3) > 0 && aWorld.isAirBlock(aWorldX + 1, aWorldY + k1, aWorldZ))
- {
- this.setBlockAndNotifyAdequately(aWorld, aWorldX + 1, aWorldY + k1, aWorldZ, Blocks.vine, 2);
- }
-
- if (CORE.RANDOM.nextInt(3) > 0 && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ - 1))
- {
- this.setBlockAndNotifyAdequately(aWorld, aWorldX, aWorldY + k1, aWorldZ - 1, Blocks.vine, 1);
- }
-
- if (CORE.RANDOM.nextInt(3) > 0 && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ + 1))
- {
- this.setBlockAndNotifyAdequately(aWorld, aWorldX, aWorldY + k1, aWorldZ + 1, Blocks.vine, 4);
- }
- }
- }
- }
- Logger.WARNING("Stepping through generateTree [6]");
-
- if (this.vinesGrow)
- {
- Logger.WARNING("Stepping through generateTree [7]");
- for (k1 = aWorldY - 3 + l; k1 <= aWorldY + l; ++k1)
- {
- i3 = k1 - (aWorldY + l);
- l1 = 2 - i3 / 2;
-
- for (i2 = aWorldX - l1; i2 <= aWorldX + l1; ++i2)
- {
- for (j2 = aWorldZ - l1; j2 <= aWorldZ + l1; ++j2)
- {
- if (aWorld.getBlock(i2, k1, j2).isLeaves(null, i2, k1, j2))
- {
- if (CORE.RANDOM.nextInt(4) == 0 && aWorld.getBlock(i2 - 1, k1, j2).isAir(null, i2 - 1, k1, j2))
- {
- this.growVines(aWorld, i2 - 1, k1, j2, 8);
- }
-
- if (CORE.RANDOM.nextInt(4) == 0 && aWorld.getBlock(i2 + 1, k1, j2).isAir(null, i2 + 1, k1, j2))
- {
- this.growVines(aWorld, i2 + 1, k1, j2, 2);
- }
-
- if (CORE.RANDOM.nextInt(4) == 0 && aWorld.getBlock(i2, k1, j2 - 1).isAir(null, i2, k1, j2 - 1))
- {
- this.growVines(aWorld, i2, k1, j2 - 1, 1);
- }
-
- if (CORE.RANDOM.nextInt(4) == 0 && aWorld.getBlock(i2, k1, j2 + 1).isAir(null, i2, k1, j2 + 1))
- {
- this.growVines(aWorld, i2, k1, j2 + 1, 4);
- }
- }
- }
- }
- }
- Logger.WARNING("Stepping through generateTree [8]");
-
- if (CORE.RANDOM.nextInt(5) == 0 && l > 5)
- {
- for (k1 = 0; k1 < 2; ++k1)
- {
- for (i3 = 0; i3 < 4; ++i3)
- {
- if (CORE.RANDOM.nextInt(4 - k1) == 0)
- {
- l1 = CORE.RANDOM.nextInt(3);
- this.setBlockAndNotifyAdequately(aWorld, aWorldX + Direction.offsetX[Direction.rotateOpposite[i3]], aWorldY + l - 5 + k1, aWorldZ + Direction.offsetZ[Direction.rotateOpposite[i3]], Blocks.cocoa, l1 << 2 | i3);
- }
- }
- }
- }
- }
- Logger.WARNING("Stepping through generateTree [9]");
- return true;
- }
- else
- {
- Logger.WARNING("Stepping through generateTree [10]");
- return false;
- }
- }
- }
- else
- {
- Logger.WARNING("Stepping through generateTree [11]");
- return false;
- }
- }
-
- /**
- * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length
- */
- private void growVines(FakeWorld aWorld, int aX, int aY, int aZ, int aMeta)
- {
- int aLoopSize = vinesGrow ? MathUtils.randInt(0, 4) : 0;
- for (int i=0;i<aLoopSize;i++) {
- this.setBlockAndNotifyAdequately(aWorld, aX, aY, aZ, Blocks.vine, aMeta);
- }
- }
-
- @Override
- protected void setBlockAndNotifyAdequately(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) {
- setBlockAndNotifyAdequately(getWorld(), aX, aY, aZ, aBlock, aMeta);
- }
-
- protected void setBlockAndNotifyAdequately(FakeWorld aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) {
- if (aBlock != null && (aMeta >= 0 && aMeta <= Short.MAX_VALUE)) {
- Logger.WARNING("Setting block "+aX+", "+aY+", "+aZ+" | "+aBlock.getLocalizedName()+" | "+aMeta);
- aWorld.setBlockAtCoords(aX, aY, aZ, aBlock, aMeta);
- //aOutputsFromGenerator.put(ItemUtils.simpleMetaStack(aBlock, aMeta, 1));
- }
- }
- }
-
-
+ private static final FakeTreeInFakeWorldGenerator mTreeData;
+
+ static {
+ Logger.WARNING("Created Fake Tree Generator.");
+ mTreeData = new FakeTreeInFakeWorldGenerator();
+ }
+
+ public TreeGenerator() {
+ if (!mTreeData.hasGenerated) {
+ mTreeData.generate(null, CORE.RANDOM, 0, 0, 0);
+ }
+ }
+
+ public AutoMap<ItemStack> generateOutput(int aTreeSize) {
+ AutoMap<ItemStack> aOutputMap = mTreeData.getOutputFromTree();
+ if (aOutputMap != null && aOutputMap.size() > 0) {
+ Logger.WARNING("Valid tree data output");
+ return aOutputMap;
+ }
+ Logger.WARNING("Invalid tree data output");
+ return new AutoMap<ItemStack>();
+ }
+
+ public static class FakeTreeInFakeWorldGenerator extends WorldGenAbstractTree {
+ /** The minimum height of a generated tree. */
+ private final int minTreeHeight;
+ /** True if this tree should grow Vines. */
+ private final boolean vinesGrow;
+ /** The metadata value of the wood to use in tree generation. */
+ private final int metaWood;
+ /** The metadata value of the leaves to use in tree generation. */
+ private final int metaLeaves;
+
+ private final AutoMap<FakeWorld> mFakeWorld;
+ private final int mTreesToGenerate;
+
+ private int mCurrentGeneratorIteration = 0;
+
+ private boolean hasGenerated = false;
+ private AutoMap<ItemStack> aOutputsFromGenerator = new AutoMap<ItemStack>();
+
+ public FakeTreeInFakeWorldGenerator() {
+ this(4, 0, 0, false, 5000);
+ }
+
+ public FakeTreeInFakeWorldGenerator(
+ int aMinHeight, int aWoodMeta, int aLeafMeta, boolean aVines, int aTreeCount) {
+ super(false);
+ this.minTreeHeight = aMinHeight;
+ this.metaWood = aWoodMeta;
+ this.metaLeaves = aLeafMeta;
+ this.vinesGrow = aVines;
+ this.mFakeWorld = new AutoMap<FakeWorld>();
+ this.mTreesToGenerate = aTreeCount;
+ Logger.WARNING("Created Fake Tree In Fake World Instance.");
+ }
+
+ public AutoMap<ItemStack> getOutputFromTree() {
+ if (!hasGenerated) {
+ Logger.WARNING("Generating Tree sample data");
+ generate(null, CORE.RANDOM, 0, 0, 0);
+ }
+ AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>();
+ int aRandomTreeID = MathUtils.randInt(0, this.mFakeWorld.size() - 1);
+ FakeWorld aWorld = this.mFakeWorld.get(aRandomTreeID);
+ if (aWorld != null) {
+ // Logger.WARNING("Getting all block data from fake world");
+ aOutputMap = aWorld.getAllBlocksStoredInFakeWorld();
+ }
+ return aOutputMap;
+ }
+
+ @Override
+ protected boolean func_150523_a(Block p_150523_1_) {
+ return p_150523_1_.getMaterial() == Material.air
+ || p_150523_1_.getMaterial() == Material.leaves
+ || p_150523_1_ == Blocks.grass
+ || p_150523_1_ == Blocks.dirt
+ || p_150523_1_ == Blocks.log
+ || p_150523_1_ == Blocks.log2
+ || p_150523_1_ == Blocks.sapling
+ || p_150523_1_ == Blocks.vine;
+ }
+
+ @Override
+ protected boolean isReplaceable(World world, int x, int y, int z) {
+ FakeWorld aWorld = getWorld();
+ Block block = aWorld.getBlock(x, y, z);
+ return block.isAir(null, x, y, z)
+ || block.isLeaves(null, x, y, z)
+ || block.isWood(null, x, y, z)
+ || func_150523_a(block);
+ }
+
+ @Override
+ public boolean generate(World world, Random aRand, int aWorldX, int aWorldRealY, int aWorldZ) {
+ // Only Generate Once - This object is Cached
+ if (hasGenerated) {
+ return hasGenerated;
+ } else {
+ for (int yy = 0; yy < mTreesToGenerate; yy++) {
+ generateTree(0, 0, 0);
+ mCurrentGeneratorIteration++;
+ }
+ hasGenerated = true;
+ if (this.mFakeWorld.size() > 0) {
+ for (FakeWorld aWorld : this.mFakeWorld) {
+ for (ItemStack aBlockInFakeWorld : aWorld.getAllBlocksStoredInFakeWorld()) {
+ aOutputsFromGenerator.add(aBlockInFakeWorld);
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ private FakeWorld aFakeWorld;
+
+ public FakeWorld getWorld() {
+ FakeWorld aWorld = this.mFakeWorld.get(mCurrentGeneratorIteration);
+ if (aWorld == null) {
+ this.mFakeWorld.set(mCurrentGeneratorIteration, new FakeWorld(200));
+ aWorld = this.mFakeWorld.get(mCurrentGeneratorIteration);
+ }
+ return aWorld;
+ }
+
+ public boolean generateTree(int aWorldX, int aWorldRealY, int aWorldZ) {
+ FakeWorld aWorld = getWorld();
+
+ // Set some static values
+
+ Logger.WARNING("Stepping through generateTree [0]");
+ // Dummy Value
+ int aWorldY = 10;
+
+ int l = CORE.RANDOM.nextInt(3) + this.minTreeHeight;
+ boolean flag = true;
+
+ if (aWorldY >= 1 && aWorldY + l + 1 <= 256) {
+ Logger.WARNING("Stepping through generateTree [1]");
+ byte b0;
+ int k1;
+ Block block;
+
+ for (int i1 = aWorldY; i1 <= aWorldY + 1 + l; ++i1) {
+ b0 = 1;
+
+ if (i1 == aWorldY) {
+ b0 = 0;
+ }
+
+ if (i1 >= aWorldY + 1 + l - 2) {
+ b0 = 2;
+ }
+
+ for (int j1 = aWorldX - b0; j1 <= aWorldX + b0 && flag; ++j1) {
+ for (k1 = aWorldZ - b0; k1 <= aWorldZ + b0 && flag; ++k1) {
+ if (i1 >= 0 && i1 < 256) {
+ block = aWorld.getBlock(j1, i1, k1);
+
+ if (!this.isReplaceable(null, j1, i1, k1)) {
+ flag = false;
+ }
+ } else {
+ flag = false;
+ }
+ }
+ }
+ }
+
+ if (!flag) {
+ Logger.WARNING("Stepping through generateTree [2]");
+ return false;
+ } else {
+ Logger.WARNING("Stepping through generateTree [3]");
+ Block block2 = aWorld.getBlock(aWorldX, aWorldY - 1, aWorldZ);
+ FakeBlockPos aBlockToGrowPlantOn = aWorld.getBlockAtCoords(aWorldX, aWorldY - 1, aWorldZ);
+
+ boolean isSoil = block2.canSustainPlant(
+ aWorld, aWorldX, aWorldY - 1, aWorldZ, ForgeDirection.UP, (BlockSapling) Blocks.sapling);
+ if (
+ /*isSoil &&*/ aWorldY < 256 - l - 1) {
+ Logger.WARNING("Stepping through generateTree [4]");
+ aBlockToGrowPlantOn.onPlantGrow(
+ aWorld, aWorldX, aWorldY - 1, aWorldZ, aWorldX, aWorldY, aWorldZ);
+ b0 = 3;
+ byte b1 = 0;
+ int l1;
+ int i2;
+ int j2;
+ int i3;
+
+ for (k1 = aWorldY - b0 + l; k1 <= aWorldY + l; ++k1) {
+ i3 = k1 - (aWorldY + l);
+ l1 = b1 + 1 - i3 / 2;
+
+ for (i2 = aWorldX - l1; i2 <= aWorldX + l1; ++i2) {
+ j2 = i2 - aWorldX;
+
+ for (int k2 = aWorldZ - l1; k2 <= aWorldZ + l1; ++k2) {
+ int l2 = k2 - aWorldZ;
+
+ if (Math.abs(j2) != l1
+ || Math.abs(l2) != l1
+ || CORE.RANDOM.nextInt(2) != 0 && i3 != 0) {
+ Block block1 = aWorld.getBlock(i2, k1, k2);
+
+ if (block1.isAir(null, i2, k1, k2) || block1.isLeaves(null, i2, k1, k2)) {
+ this.setBlockAndNotifyAdequately(
+ aWorld, i2, k1, k2, Blocks.leaves, this.metaLeaves);
+ }
+ }
+ }
+ }
+ }
+ Logger.WARNING("Stepping through generateTree [5]");
+
+ for (k1 = 0; k1 < l; ++k1) {
+ block = aWorld.getBlock(aWorldX, aWorldY + k1, aWorldZ);
+
+ if (block.isAir(null, aWorldX, aWorldY + k1, aWorldZ)
+ || block.isLeaves(null, aWorldX, aWorldY + k1, aWorldZ)) {
+ this.setBlockAndNotifyAdequately(
+ aWorld, aWorldX, aWorldY + k1, aWorldZ, Blocks.log, this.metaWood);
+
+ if (this.vinesGrow && k1 > 0) {
+ if (CORE.RANDOM.nextInt(3) > 0
+ && aWorld.isAirBlock(aWorldX - 1, aWorldY + k1, aWorldZ)) {
+ this.setBlockAndNotifyAdequately(
+ aWorld, aWorldX - 1, aWorldY + k1, aWorldZ, Blocks.vine, 8);
+ }
+
+ if (CORE.RANDOM.nextInt(3) > 0
+ && aWorld.isAirBlock(aWorldX + 1, aWorldY + k1, aWorldZ)) {
+ this.setBlockAndNotifyAdequately(
+ aWorld, aWorldX + 1, aWorldY + k1, aWorldZ, Blocks.vine, 2);
+ }
+
+ if (CORE.RANDOM.nextInt(3) > 0
+ && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ - 1)) {
+ this.setBlockAndNotifyAdequately(
+ aWorld, aWorldX, aWorldY + k1, aWorldZ - 1, Blocks.vine, 1);
+ }
+
+ if (CORE.RANDOM.nextInt(3) > 0
+ && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ + 1)) {
+ this.setBlockAndNotifyAdequately(
+ aWorld, aWorldX, aWorldY + k1, aWorldZ + 1, Blocks.vine, 4);
+ }
+ }
+ }
+ }
+ Logger.WARNING("Stepping through generateTree [6]");
+
+ if (this.vinesGrow) {
+ Logger.WARNING("Stepping through generateTree [7]");
+ for (k1 = aWorldY - 3 + l; k1 <= aWorldY + l; ++k1) {
+ i3 = k1 - (aWorldY + l);
+ l1 = 2 - i3 / 2;
+
+ for (i2 = aWorldX - l1; i2 <= aWorldX + l1; ++i2) {
+ for (j2 = aWorldZ - l1; j2 <= aWorldZ + l1; ++j2) {
+ if (aWorld.getBlock(i2, k1, j2).isLeaves(null, i2, k1, j2)) {
+ if (CORE.RANDOM.nextInt(4) == 0
+ && aWorld.getBlock(i2 - 1, k1, j2)
+ .isAir(null, i2 - 1, k1, j2)) {
+ this.growVines(aWorld, i2 - 1, k1, j2, 8);
+ }
+
+ if (CORE.RANDOM.nextInt(4) == 0
+ && aWorld.getBlock(i2 + 1, k1, j2)
+ .isAir(null, i2 + 1, k1, j2)) {
+ this.growVines(aWorld, i2 + 1, k1, j2, 2);
+ }
+
+ if (CORE.RANDOM.nextInt(4) == 0
+ && aWorld.getBlock(i2, k1, j2 - 1)
+ .isAir(null, i2, k1, j2 - 1)) {
+ this.growVines(aWorld, i2, k1, j2 - 1, 1);
+ }
+
+ if (CORE.RANDOM.nextInt(4) == 0
+ && aWorld.getBlock(i2, k1, j2 + 1)
+ .isAir(null, i2, k1, j2 + 1)) {
+ this.growVines(aWorld, i2, k1, j2 + 1, 4);
+ }
+ }
+ }
+ }
+ }
+ Logger.WARNING("Stepping through generateTree [8]");
+
+ if (CORE.RANDOM.nextInt(5) == 0 && l > 5) {
+ for (k1 = 0; k1 < 2; ++k1) {
+ for (i3 = 0; i3 < 4; ++i3) {
+ if (CORE.RANDOM.nextInt(4 - k1) == 0) {
+ l1 = CORE.RANDOM.nextInt(3);
+ this.setBlockAndNotifyAdequately(
+ aWorld,
+ aWorldX + Direction.offsetX[Direction.rotateOpposite[i3]],
+ aWorldY + l - 5 + k1,
+ aWorldZ + Direction.offsetZ[Direction.rotateOpposite[i3]],
+ Blocks.cocoa,
+ l1 << 2 | i3);
+ }
+ }
+ }
+ }
+ }
+ Logger.WARNING("Stepping through generateTree [9]");
+ return true;
+ } else {
+ Logger.WARNING("Stepping through generateTree [10]");
+ return false;
+ }
+ }
+ } else {
+ Logger.WARNING("Stepping through generateTree [11]");
+ return false;
+ }
+ }
+
+ /**
+ * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length
+ */
+ private void growVines(FakeWorld aWorld, int aX, int aY, int aZ, int aMeta) {
+ int aLoopSize = vinesGrow ? MathUtils.randInt(0, 4) : 0;
+ for (int i = 0; i < aLoopSize; i++) {
+ this.setBlockAndNotifyAdequately(aWorld, aX, aY, aZ, Blocks.vine, aMeta);
+ }
+ }
+
+ @Override
+ protected void setBlockAndNotifyAdequately(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) {
+ setBlockAndNotifyAdequately(getWorld(), aX, aY, aZ, aBlock, aMeta);
+ }
+
+ protected void setBlockAndNotifyAdequately(FakeWorld aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) {
+ if (aBlock != null && (aMeta >= 0 && aMeta <= Short.MAX_VALUE)) {
+ Logger.WARNING("Setting block " + aX + ", " + aY + ", " + aZ + " | " + aBlock.getLocalizedName() + " | "
+ + aMeta);
+ aWorld.setBlockAtCoords(aX, aY, aZ, aBlock, aMeta);
+ // aOutputsFromGenerator.put(ItemUtils.simpleMetaStack(aBlock, aMeta, 1));
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java
index 7c3f764794..7012f6d0f7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.items;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-
-import cofh.core.render.IconRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
@@ -12,17 +7,13 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_MultiTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.client.renderer.CustomItemBlockRenderer;
-import gtPlusPlus.core.common.CommonProxy;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_ToggleVisual;
-import net.minecraft.client.renderer.texture.IIconRegister;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -31,195 +22,195 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import org.apache.commons.lang3.StringUtils;
public class MetaCustomCoverItem extends Item {
- protected final IIcon[] icons;
- private final String mModID;
- private final String mTextureSetName;
- protected final IIconContainer[] mTextures;
- private final short[][] mRGB;
-
- public MetaCustomCoverItem(String aModId, int aTextureCount, String aTextureSetName, IIconContainer[] aTextures, short[][] aRGB) {
- super();
- icons = new IIcon[aTextureCount];
- mModID = aModId;
- mTextureSetName = Utils.sanitizeString(aTextureSetName);
- mTextures = aTextures;
- mRGB = aRGB;
- this.setTextureName(CORE.MODID + ":" + "itemPlate");
- this.setHasSubtypes(true);
- String unlocalizedName = "itemCustomMetaCover." + mModID + "." + mTextureSetName;
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setMaxStackSize(1);
- GameRegistry.registerItem(this, unlocalizedName);
- registerCover();
- Logger.INFO("[Covers] Generated Custom covers for "+mModID+" using "+aTextureCount+" textures from "+mTextureSetName+".");
- }
-
- public boolean hide() {
- return true;
- }
-
- private final void registerCover() {
- //CommonProxy.registerItemRendererGlobal(this, new CustomItemBlockRenderer());
- for (int i=0;i<icons.length;i++) {
- ItemStack thisStack = ItemUtils.simpleMetaStack(this, i, 1);
- if (i > 0 && hide()) {
- ItemUtils.hideItemFromNEI(thisStack);
- }
- GregTech_API.registerCover(
- thisStack,
- new GT_MultiTexture(
- new ITexture[]{
- new GT_RenderedTexture(mTextures[i])
- }),
- new GTPP_Cover_ToggleVisual());
- }
- }
-
- /*
- * @Override public void registerIcons(IIconRegister reg) { for (int i = 0; i <
- * icons.length; i++) { this.icons[i] = mTextures[i].getIcon(); } }
- *
- * @Override public IIcon getIconFromDamage(int meta) { return this.icons[meta];
- * }
- */
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < icons.length; i++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return this.getUnlocalizedName() + "_" + stack.getItemDamage();
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- return StringUtils.capitalize(mTextureSetName) + " (" + tItem.getItemDamage() + ")"; //super.getItemStackDisplayName(tItem);
- }
-
- private static boolean createNBT(ItemStack rStack) {
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Damage", 0);
- tagNBT.setBoolean("AllowConnections", false);
- tagMain.setTag("CustomCoverMeta", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static final long getCoverDamage(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("CustomCoverMeta");
- if (aNBT != null) {
- return aNBT.getLong("Damage");
- }
- } else {
- createNBT(aStack);
- }
- return 0L;
- }
-
- public static final boolean setCoverDamage(final ItemStack aStack, final long aDamage) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("CustomCoverMeta");
- if (aNBT != null) {
- aNBT.setLong("Damage", aDamage);
- return true;
- }
- }
- return false;
- }
-
- public static final boolean getCoverConnections(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("CustomCoverMeta");
- if (aNBT != null) {
- return aNBT.getBoolean("AllowConnections");
- }
- } else {
- createNBT(aStack);
- }
- return false;
- }
-
- public static final boolean setCoverConnections(final ItemStack aStack, final boolean aConnections) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("CustomCoverMeta");
- if (aNBT != null) {
- aNBT.setBoolean("AllowConnections", aConnections);
- return true;
- }
- }
- return false;
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- if (stack.getTagCompound() == null) {
- createNBT(stack);
- }
- double currentDamage = getCoverDamage(stack);
- double meta = stack.getItemDamage() == 0 ? 50 : 2500;
- double durabilitypercent = currentDamage / meta;
- return durabilitypercent;
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
- if (KeyboardUtils.isShiftKeyDown()) {
- boolean con = getCoverConnections(stack);
- if (con) {
- setCoverConnections(stack, false);
- } else {
- setCoverConnections(stack, true);
- }
- }
- return stack;
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- boolean cons = getCoverConnections(stack);
- list.add(EnumChatFormatting.GRAY + "Allows Connections: "+cons);
- list.add(EnumChatFormatting.GRAY + "Shift Rmb to change state before applying");
- super.addInformation(stack, player, list, bool);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public Item setFull3D() {
- // TODO Auto-generated method stub
- return super.setFull3D();
- }
-
- @Override
- public boolean isFull3D() {
- // TODO Auto-generated method stub
- return super.isFull3D();
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.mRGB == null){
- return super.getColorFromItemStack(stack, HEX_OxFFFFFF);
- }
- int aMeta = stack.getItemDamage();
- return Utils.rgbtoHexValue(mRGB[aMeta][0], mRGB[aMeta][1], mRGB[aMeta][2]);
- }
-
-} \ No newline at end of file
+ protected final IIcon[] icons;
+ private final String mModID;
+ private final String mTextureSetName;
+ protected final IIconContainer[] mTextures;
+ private final short[][] mRGB;
+
+ public MetaCustomCoverItem(
+ String aModId, int aTextureCount, String aTextureSetName, IIconContainer[] aTextures, short[][] aRGB) {
+ super();
+ icons = new IIcon[aTextureCount];
+ mModID = aModId;
+ mTextureSetName = Utils.sanitizeString(aTextureSetName);
+ mTextures = aTextures;
+ mRGB = aRGB;
+ this.setTextureName(CORE.MODID + ":" + "itemPlate");
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemCustomMetaCover." + mModID + "." + mTextureSetName;
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setMaxStackSize(1);
+ GameRegistry.registerItem(this, unlocalizedName);
+ registerCover();
+ Logger.INFO("[Covers] Generated Custom covers for " + mModID + " using " + aTextureCount + " textures from "
+ + mTextureSetName + ".");
+ }
+
+ public boolean hide() {
+ return true;
+ }
+
+ private final void registerCover() {
+ // CommonProxy.registerItemRendererGlobal(this, new CustomItemBlockRenderer());
+ for (int i = 0; i < icons.length; i++) {
+ ItemStack thisStack = ItemUtils.simpleMetaStack(this, i, 1);
+ if (i > 0 && hide()) {
+ ItemUtils.hideItemFromNEI(thisStack);
+ }
+ GregTech_API.registerCover(
+ thisStack,
+ new GT_MultiTexture(new ITexture[] {new GT_RenderedTexture(mTextures[i])}),
+ new GTPP_Cover_ToggleVisual());
+ }
+ }
+
+ /*
+ * @Override public void registerIcons(IIconRegister reg) { for (int i = 0; i <
+ * icons.length; i++) { this.icons[i] = mTextures[i].getIcon(); } }
+ *
+ * @Override public IIcon getIconFromDamage(int meta) { return this.icons[meta];
+ * }
+ */
+
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < icons.length; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ return StringUtils.capitalize(mTextureSetName) + " (" + tItem.getItemDamage()
+ + ")"; // super.getItemStackDisplayName(tItem);
+ }
+
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Damage", 0);
+ tagNBT.setBoolean("AllowConnections", false);
+ tagMain.setTag("CustomCoverMeta", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static final long getCoverDamage(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ return aNBT.getLong("Damage");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return 0L;
+ }
+
+ public static final boolean setCoverDamage(final ItemStack aStack, final long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ aNBT.setLong("Damage", aDamage);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static final boolean getCoverConnections(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ return aNBT.getBoolean("AllowConnections");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return false;
+ }
+
+ public static final boolean setCoverConnections(final ItemStack aStack, final boolean aConnections) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ aNBT.setBoolean("AllowConnections", aConnections);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (stack.getTagCompound() == null) {
+ createNBT(stack);
+ }
+ double currentDamage = getCoverDamage(stack);
+ double meta = stack.getItemDamage() == 0 ? 50 : 2500;
+ double durabilitypercent = currentDamage / meta;
+ return durabilitypercent;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
+ if (KeyboardUtils.isShiftKeyDown()) {
+ boolean con = getCoverConnections(stack);
+ if (con) {
+ setCoverConnections(stack, false);
+ } else {
+ setCoverConnections(stack, true);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ boolean cons = getCoverConnections(stack);
+ list.add(EnumChatFormatting.GRAY + "Allows Connections: " + cons);
+ list.add(EnumChatFormatting.GRAY + "Shift Rmb to change state before applying");
+ super.addInformation(stack, player, list, bool);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public Item setFull3D() {
+ // TODO Auto-generated method stub
+ return super.setFull3D();
+ }
+
+ @Override
+ public boolean isFull3D() {
+ // TODO Auto-generated method stub
+ return super.isFull3D();
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ if (this.mRGB == null) {
+ return super.getColorFromItemStack(stack, HEX_OxFFFFFF);
+ }
+ int aMeta = stack.getItemDamage();
+ return Utils.rgbtoHexValue(mRGB[aMeta][0], mRGB[aMeta][1], mRGB[aMeta][2]);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
index ce8b6eaf62..9ff348ddcc 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
@@ -16,7 +16,6 @@ import gregtech.api.objects.ItemData;
import gregtech.api.objects.MaterialStack;
import gregtech.api.util.GT_FoodStat;
import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GTPP_Recipe;
import gregtech.common.covers.GT_Cover_Arm;
import gregtech.common.covers.GT_Cover_Conveyor;
import gregtech.common.covers.GT_Cover_Pump;
@@ -35,419 +34,1201 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_X32;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow;
-import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow_Item;
import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_ToggleVisual;
import net.minecraft.item.EnumAction;
-import net.minecraft.item.ItemStack;
public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
- public final static MetaGeneratedGregtechItems INSTANCE;
-
- static {
- INSTANCE = new MetaGeneratedGregtechItems();
- }
-
- public MetaGeneratedGregtechItems() {
- super("MU-metaitem.01", new OrePrefixes[]{null});
- }
-
- public void generateMetaItems() {
- int tLastID = 0;
-
- registerCustomCircuits();
- OldCircuitHandler.addCircuitItems();
-
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- Logger.INFO("Gregtech 5.09 not found, using fallback components. (I like how I have to add compat to something I added first and had stolen.)");
- GregtechItemList.Electric_Pump_LuV.set(this.addItem(tLastID = 0, "Electric Pump (LuV)", "163920 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Electric_Pump_ZPM.set(this.addItem(tLastID = 1, "Electric Pump (ZPM)", "655680 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.ITER, 2L), getTcAspectStack(TC_Aspects.AQUA, 2L)}));
- GregtechItemList.Electric_Pump_UV.set(this.addItem(tLastID = 2, "Electric Pump (UV)", "2622720 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.ITER, 4L), getTcAspectStack(TC_Aspects.AQUA, 4L)}));
- GregtechItemList.Electric_Pump_MAX.set(this.addItem(tLastID = 3, "Electric Pump (MAX)", "10490880 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L), getTcAspectStack(TC_Aspects.AQUA, 8L)}));
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_LuV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(8196));
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_ZPM.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[6][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(32768));
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_UV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[7][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(131072));
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_MAX.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(524288));
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_LuV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Tin), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Tin), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Tin), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Bronze)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_ZPM.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Bronze), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Bronze), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.AnyCopper), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Steel)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_UV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Steel), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Gold), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.StainlessSteel)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_MAX.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.StainlessSteel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.StainlessSteel), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Aluminium), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Titanium)});
- tLastID = 4;
- GregtechItemList.Electric_Motor_LuV.set(this.addItem(tLastID = 4, "Electric Motor (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.MOTUS, 1L)}));
- GregtechItemList.Electric_Motor_ZPM.set(this.addItem(tLastID = 5, "Electric Motor (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 2L)}));
- GregtechItemList.Electric_Motor_UV.set(this.addItem(tLastID = 6, "Electric Motor (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.MOTUS, 4L)}));
- GregtechItemList.Electric_Motor_MAX.set(this.addItem(tLastID = 7, "Electric Motor (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 8L)}));
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_LuV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.IronMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.AnyIron), Character.valueOf('W'), OrePrefixes.wireGt01.get(Materials.AnyCopper), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_ZPM.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.SteelMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('W'), OrePrefixes.wireGt01.get(Materials.Electrum), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Silver)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_UV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.SteelMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.Cupronickel), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_MAX.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.NeodymiumMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.TungstenSteel), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Nichrome)});
-
- tLastID = 8;
- GregtechItemList.Conveyor_Module_LuV.set(this.addItem(tLastID = 8, "Conveyor Module (LuV)", "1 Stack every 20 secs (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L)}));
- GregtechItemList.Conveyor_Module_ZPM.set(this.addItem(tLastID = 9, "Conveyor Module (ZPM)", "1 Stack every 5 secs (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.ITER, 2L)}));
- GregtechItemList.Conveyor_Module_UV.set(this.addItem(tLastID = 10, "Conveyor Module (UV)", "1 Stack every 1 sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.ITER, 4L)}));
- GregtechItemList.Conveyor_Module_MAX.set(this.addItem(tLastID = 11, "Conveyor Module (MAX)", "1 Stack every 1/5 sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L)}));
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_LuV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_ZPM.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.AnyCopper), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_UV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_MAX.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Aluminium), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_LuV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(400));
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_ZPM.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(100));
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_UV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(20));
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_MAX.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(4));
- tLastID = 12;
- GregtechItemList.Electric_Piston_LuV.set(this.addItem(tLastID = 12, "Electric Piston (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 1L)}));
- GregtechItemList.Electric_Piston_ZPM.set(this.addItem(tLastID = 13, "Electric Piston (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.MOTUS, 2L)}));
- GregtechItemList.Electric_Piston_UV.set(this.addItem(tLastID = 14, "Electric Piston (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 4L)}));
- GregtechItemList.Electric_Piston_MAX.set(this.addItem(tLastID = 15, "Electric Piston (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L)}));
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_LuV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Steel), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Steel), Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_ZPM.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Aluminium), Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.AnyCopper)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_UV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_MAX.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Titanium), Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Aluminium)});
- tLastID = 16;
- GregtechItemList.Robot_Arm_LuV.set(this.addItem(tLastID = 16, "Robot Arm (LuV)", "Inserts into specific Slots (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 1L), Utils.getTcAspectStack("COGNITIO", 1L)}));
- GregtechItemList.Robot_Arm_ZPM.set(this.addItem(tLastID = 17, "Robot Arm (ZPM)", "Inserts into specific Slots (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.MOTUS, 2L), getTcAspectStack("COGNITIO", 2L)}));
- GregtechItemList.Robot_Arm_UV.set(this.addItem(tLastID = 18, "Robot Arm (UV)", "Inserts into specific Slots (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 4L), getTcAspectStack("COGNITIO", 4L)}));
- GregtechItemList.Robot_Arm_MAX.set(this.addItem(tLastID = 19, "Robot Arm (MAX)", "Inserts into specific Slots (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L), getTcAspectStack("COGNITIO", 8L)}));
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_LuV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.Steel), Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('P'), GregtechItemList.Electric_Piston_LuV, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_ZPM.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('P'), GregtechItemList.Electric_Piston_ZPM, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.AnyCopper)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_UV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('P'), GregtechItemList.Electric_Piston_UV, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_MAX.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('P'), GregtechItemList.Electric_Piston_MAX, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Aluminium)});
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_LuV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(400));
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_ZPM.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(100));
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_UV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(20));
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_MAX.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(4));
- tLastID = 20;
- GregtechItemList.Field_Generator_LuV.set(this.addItem(tLastID = 20, "Field Generator (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.TUTAMEN, 1L)}));
- GregtechItemList.Field_Generator_ZPM.set(this.addItem(tLastID = 21, "Field Generator (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.TUTAMEN, 2L)}));
- GregtechItemList.Field_Generator_UV.set(this.addItem(tLastID = 22, "Field Generator (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.TUTAMEN, 4L)}));
- GregtechItemList.Field_Generator_MAX.set(this.addItem(tLastID = 23, "Field Generator (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 16L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.TUTAMEN, 8L)}));
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_LuV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'), OrePrefixes.wireGt01.get(Materials.Osmium)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_ZPM.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.EnderEye), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.Osmium)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_UV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.NetherStar), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Osmium)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_MAX.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.NetherStar), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium)});
- tLastID = 24;
- GregtechItemList.Emitter_LuV.set(this.addItem(tLastID = 24, "Emitter (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.LUX, 1L)}));
- GregtechItemList.Emitter_ZPM.set(this.addItem(tLastID = 25, "Emitter (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.LUX, 2L)}));
- GregtechItemList.Emitter_UV.set(this.addItem(tLastID = 26, "Emitter (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.LUX, 4L)}));
- GregtechItemList.Emitter_MAX.set(this.addItem(tLastID = 27, "Emitter (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.LUX, 8L)}));
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_LuV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Brass), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Tin)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_ZPM.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.NetherQuartz), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Electrum), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.AnyCopper)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_UV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Chrome), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Gold)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_MAX.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Platinum), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Aluminium)});
- tLastID = 28;
- GregtechItemList.Sensor_LuV.set(this.addItem(tLastID = 28, "Sensor (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.SENSUS, 1L)}));
- GregtechItemList.Sensor_ZPM.set(this.addItem(tLastID = 29, "Sensor (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.SENSUS, 2L)}));
- GregtechItemList.Sensor_UV.set(this.addItem(tLastID = 30, "Sensor (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.SENSUS, 4L)}));
- GregtechItemList.Sensor_MAX.set(this.addItem(tLastID = 31, "Sensor (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.SENSUS, 8L)}));
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_LuV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Brass), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_ZPM.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.NetherQuartz), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Electrum), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_UV.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Chrome), Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced)});
- //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_MAX.get(1L), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Platinum), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite)});
-
- //Handler for ULV Components
- registerComponents_ULV();
-
-
- }
-
- else {
- //Simplify life.
- registerComponents_ULV();
- registerComponents_MAX();
- }
-
- //Extruder Shape
- GregtechItemList.Shape_Extruder_WindmillShaft.set(this.addItem(tLastID = 40, "Extruder Shape (Shaft)", "Extruder Shape for making Windmill Shafts"));
-
- //GTNH Already adds this.
- if (!CORE.GTNH) {
- GregtechItemList.Shape_Extruder_SmallGear.set(this.addItem(221, "Extruder Shape (Small Gear)", "Extruder Shape for making small gears"));
- }
-
- //Batteries
- GregtechItemList.Battery_RE_EV_Sodium.set(this.addItem(tLastID = 50, "Quad Cell Sodium Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.METALLUM, 2L), getTcAspectStack(TC_Aspects.POTENTIA, 2L)}));
- this.setElectricStats(32000 + tLastID, 3200000L, GT_Values.V[4], 4L, -3L, true);
-
- GregtechItemList.Battery_RE_EV_Cadmium.set(this.addItem(tLastID = 52, "Quad Cell Cadmium Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)}));
- this.setElectricStats(32000 + tLastID, 4800000L, GT_Values.V[4], 4L, -3L, true);
-
- GregtechItemList.Battery_RE_EV_Lithium.set(this.addItem(tLastID = 54, "Quad Cell Lithium Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 3L), getTcAspectStack(TC_Aspects.METALLUM, 3L), getTcAspectStack(TC_Aspects.POTENTIA, 3L)}));
- this.setElectricStats(32000 + tLastID, 6400000L, GT_Values.V[4], 4L, -3L, true);
-
- /**
- * Power Gems
- */
-
- GregtechItemList.Battery_Gem_1.set(this.addItem(tLastID = 66, "Proton Cell", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.METALLUM, 24L), getTcAspectStack(TC_Aspects.POTENTIA, 16L)}));
- this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 20 * 300 / 4, GT_Values.V[6], 6L, -3L, false);
- GregtechItemList.Battery_Gem_2.set(this.addItem(tLastID = 68, "Electron Cell", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 16L), getTcAspectStack(TC_Aspects.METALLUM, 32L), getTcAspectStack(TC_Aspects.POTENTIA, 32L)}));
- this.setElectricStats(32000 + tLastID, GT_Values.V[7] * 20 * 300 / 4, GT_Values.V[7], 7L, -3L, false);
- GregtechItemList.Battery_Gem_3.set(this.addItem(tLastID = 70, "Quark Entanglement", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 32L), getTcAspectStack(TC_Aspects.METALLUM, 48L), getTcAspectStack(TC_Aspects.POTENTIA, 64L)}));
- this.setElectricStats(32000 + tLastID, GT_Values.V[8] * 20 * 300 / 4, GT_Values.V[8], 8L, -3L, false);
- //ItemUtils.addItemToOreDictionary(GregtechItemList.Battery_Gem_1.get(1), "batteryFutureBasic");
- //ItemUtils.addItemToOreDictionary(GregtechItemList.Battery_Gem_2.get(1), "batteryFutureGood");
- //ItemUtils.addItemToOreDictionary(GregtechItemList.Battery_Gem_3.get(1), "batteryFutureAdvanced");
-
-
- /*GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Acid Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)}));
+ public static final MetaGeneratedGregtechItems INSTANCE;
+
+ static {
+ INSTANCE = new MetaGeneratedGregtechItems();
+ }
+
+ public MetaGeneratedGregtechItems() {
+ super("MU-metaitem.01", new OrePrefixes[] {null});
+ }
+
+ public void generateMetaItems() {
+ int tLastID = 0;
+
+ registerCustomCircuits();
+ OldCircuitHandler.addCircuitItems();
+
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ Logger.INFO(
+ "Gregtech 5.09 not found, using fallback components. (I like how I have to add compat to something I added first and had stolen.)");
+ GregtechItemList.Electric_Pump_LuV.set(
+ this.addItem(tLastID = 0, "Electric Pump (LuV)", "163920 L/sec (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ GregtechItemList.Electric_Pump_ZPM.set(
+ this.addItem(tLastID = 1, "Electric Pump (ZPM)", "655680 L/sec (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.ITER, 2L),
+ getTcAspectStack(TC_Aspects.AQUA, 2L)
+ }));
+ GregtechItemList.Electric_Pump_UV.set(
+ this.addItem(tLastID = 2, "Electric Pump (UV)", "2622720 L/sec (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
+ getTcAspectStack(TC_Aspects.MACHINA, 4L),
+ getTcAspectStack(TC_Aspects.ITER, 4L),
+ getTcAspectStack(TC_Aspects.AQUA, 4L)
+ }));
+ GregtechItemList.Electric_Pump_MAX.set(
+ this.addItem(tLastID = 3, "Electric Pump (MAX)", "10490880 L/sec (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.ITER, 8L),
+ getTcAspectStack(TC_Aspects.AQUA, 8L)
+ }));
+ GregTech_API.registerCover(
+ GregtechItemList.Electric_Pump_LuV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[5][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
+ }),
+ new GT_Cover_Pump(8196));
+ GregTech_API.registerCover(
+ GregtechItemList.Electric_Pump_ZPM.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[6][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
+ }),
+ new GT_Cover_Pump(32768));
+ GregTech_API.registerCover(
+ GregtechItemList.Electric_Pump_UV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[7][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
+ }),
+ new GT_Cover_Pump(131072));
+ GregTech_API.registerCover(
+ GregtechItemList.Electric_Pump_MAX.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[8][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
+ }),
+ new GT_Cover_Pump(524288));
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_LuV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_LuV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber),
+ // Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Tin), Character.valueOf('S'),
+ // OrePrefixes.screw.get(Materials.Tin), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Tin),
+ // Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Bronze)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_ZPM.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_ZPM, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber),
+ // Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Bronze), Character.valueOf('S'),
+ // OrePrefixes.screw.get(Materials.Bronze), Character.valueOf('W'),
+ // OrePrefixes.cableGt01.get(Materials.AnyCopper), Character.valueOf('P'),
+ // OrePrefixes.pipeMedium.get(Materials.Steel)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_UV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_UV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber),
+ // Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Steel), Character.valueOf('S'),
+ // OrePrefixes.screw.get(Materials.Steel), Character.valueOf('W'),
+ // OrePrefixes.cableGt01.get(Materials.Gold), Character.valueOf('P'),
+ // OrePrefixes.pipeMedium.get(Materials.StainlessSteel)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_MAX.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_MAX, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber),
+ // Character.valueOf('X'), OrePrefixes.rotor.get(Materials.StainlessSteel), Character.valueOf('S'),
+ // OrePrefixes.screw.get(Materials.StainlessSteel), Character.valueOf('W'),
+ // OrePrefixes.cableGt01.get(Materials.Aluminium), Character.valueOf('P'),
+ // OrePrefixes.pipeMedium.get(Materials.Titanium)});
+ tLastID = 4;
+ GregtechItemList.Electric_Motor_LuV.set(this.addItem(tLastID = 4, "Electric Motor (LuV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.MOTUS, 1L)
+ }));
+ GregtechItemList.Electric_Motor_ZPM.set(this.addItem(tLastID = 5, "Electric Motor (ZPM)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.MOTUS, 2L)
+ }));
+ GregtechItemList.Electric_Motor_UV.set(this.addItem(tLastID = 6, "Electric Motor (UV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
+ getTcAspectStack(TC_Aspects.MACHINA, 4L),
+ getTcAspectStack(TC_Aspects.MOTUS, 4L)
+ }));
+ GregtechItemList.Electric_Motor_MAX.set(this.addItem(tLastID = 7, "Electric Motor (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.MOTUS, 8L)
+ }));
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_LuV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'),
+ // OrePrefixes.stick.get(Materials.IronMagnetic), Character.valueOf('R'),
+ // OrePrefixes.stick.get(Materials.AnyIron), Character.valueOf('W'),
+ // OrePrefixes.wireGt01.get(Materials.AnyCopper), Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.Tin)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_ZPM.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'),
+ // OrePrefixes.stick.get(Materials.SteelMagnetic), Character.valueOf('R'),
+ // OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('W'),
+ // OrePrefixes.wireGt01.get(Materials.Electrum), Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.Silver)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_UV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'),
+ // OrePrefixes.stick.get(Materials.SteelMagnetic), Character.valueOf('R'),
+ // OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('W'),
+ // OrePrefixes.wireGt02.get(Materials.Cupronickel), Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.Gold)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_MAX.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'),
+ // OrePrefixes.stick.get(Materials.NeodymiumMagnetic), Character.valueOf('R'),
+ // OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('W'),
+ // OrePrefixes.wireGt02.get(Materials.TungstenSteel), Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.Nichrome)});
+
+ tLastID = 8;
+ GregtechItemList.Conveyor_Module_LuV.set(this.addItem(
+ tLastID = 8, "Conveyor Module (LuV)", "1 Stack every 20 secs (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L)
+ }));
+ GregtechItemList.Conveyor_Module_ZPM.set(
+ this.addItem(tLastID = 9, "Conveyor Module (ZPM)", "1 Stack every 5 secs (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.ITER, 2L)
+ }));
+ GregtechItemList.Conveyor_Module_UV.set(
+ this.addItem(tLastID = 10, "Conveyor Module (UV)", "1 Stack every 1 sec (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
+ getTcAspectStack(TC_Aspects.MACHINA, 4L),
+ getTcAspectStack(TC_Aspects.ITER, 4L)
+ }));
+ GregtechItemList.Conveyor_Module_MAX.set(this.addItem(
+ tLastID = 11, "Conveyor Module (MAX)", "1 Stack every 1/5 sec (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.ITER, 8L)
+ }));
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_LuV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_LuV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin),
+ // Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_ZPM.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_ZPM, Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.AnyCopper), Character.valueOf('R'),
+ // OrePrefixes.plate.get(Materials.Rubber)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_UV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_UV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold),
+ // Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_MAX.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.Aluminium), Character.valueOf('R'),
+ // OrePrefixes.plate.get(Materials.Rubber)});
+ GregTech_API.registerCover(
+ GregtechItemList.Conveyor_Module_LuV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[1][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
+ }),
+ new GT_Cover_Conveyor(400));
+ GregTech_API.registerCover(
+ GregtechItemList.Conveyor_Module_ZPM.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[2][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
+ }),
+ new GT_Cover_Conveyor(100));
+ GregTech_API.registerCover(
+ GregtechItemList.Conveyor_Module_UV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[3][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
+ }),
+ new GT_Cover_Conveyor(20));
+ GregTech_API.registerCover(
+ GregtechItemList.Conveyor_Module_MAX.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[4][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
+ }),
+ new GT_Cover_Conveyor(4));
+ tLastID = 12;
+ GregtechItemList.Electric_Piston_LuV.set(
+ this.addItem(tLastID = 12, "Electric Piston (LuV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.MOTUS, 1L)
+ }));
+ GregtechItemList.Electric_Piston_ZPM.set(
+ this.addItem(tLastID = 13, "Electric Piston (ZPM)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.MACHINA, 4L),
+ getTcAspectStack(TC_Aspects.MOTUS, 2L)
+ }));
+ GregtechItemList.Electric_Piston_UV.set(
+ this.addItem(tLastID = 14, "Electric Piston (UV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.MOTUS, 4L)
+ }));
+ GregtechItemList.Electric_Piston_MAX.set(
+ this.addItem(tLastID = 15, "Electric Piston (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 16L),
+ getTcAspectStack(TC_Aspects.MOTUS, 8L)
+ }));
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_LuV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'),
+ // OrePrefixes.plate.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Steel),
+ // Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Steel), Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_LuV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_ZPM.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'),
+ // OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('G'),
+ // OrePrefixes.gearGtSmall.get(Materials.Aluminium), Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_ZPM, Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.AnyCopper)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_UV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'),
+ // OrePrefixes.plate.get(Materials.StainlessSteel), Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('G'),
+ // OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_UV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_MAX.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'),
+ // OrePrefixes.plate.get(Materials.Titanium), Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('G'),
+ // OrePrefixes.gearGtSmall.get(Materials.Titanium), Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.Aluminium)});
+ tLastID = 16;
+ GregtechItemList.Robot_Arm_LuV.set(this.addItem(
+ tLastID = 16, "Robot Arm (LuV)", "Inserts into specific Slots (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.MOTUS, 1L),
+ Utils.getTcAspectStack("COGNITIO", 1L)
+ }));
+ GregtechItemList.Robot_Arm_ZPM.set(this.addItem(
+ tLastID = 17, "Robot Arm (ZPM)", "Inserts into specific Slots (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.MACHINA, 4L),
+ getTcAspectStack(TC_Aspects.MOTUS, 2L),
+ getTcAspectStack("COGNITIO", 2L)
+ }));
+ GregtechItemList.Robot_Arm_UV.set(this.addItem(
+ tLastID = 18, "Robot Arm (UV)", "Inserts into specific Slots (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.MOTUS, 4L),
+ getTcAspectStack("COGNITIO", 4L)
+ }));
+ GregtechItemList.Robot_Arm_MAX.set(this.addItem(
+ tLastID = 19, "Robot Arm (MAX)", "Inserts into specific Slots (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 16L),
+ getTcAspectStack(TC_Aspects.MOTUS, 8L),
+ getTcAspectStack("COGNITIO", 8L)
+ }));
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_LuV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.Steel), Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV,
+ // Character.valueOf('P'), GregtechItemList.Electric_Piston_LuV, Character.valueOf('E'),
+ // OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.Tin)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_ZPM.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM,
+ // Character.valueOf('P'), GregtechItemList.Electric_Piston_ZPM, Character.valueOf('E'),
+ // OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.AnyCopper)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_UV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('M'),
+ // GregtechItemList.Electric_Motor_UV, Character.valueOf('P'), GregtechItemList.Electric_Piston_UV,
+ // Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.Gold)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_MAX.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX,
+ // Character.valueOf('P'), GregtechItemList.Electric_Piston_MAX, Character.valueOf('E'),
+ // OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'),
+ // OrePrefixes.cableGt01.get(Materials.Aluminium)});
+ GregTech_API.registerCover(
+ GregtechItemList.Robot_Arm_LuV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[1][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
+ }),
+ new GT_Cover_Arm(400));
+ GregTech_API.registerCover(
+ GregtechItemList.Robot_Arm_ZPM.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[2][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
+ }),
+ new GT_Cover_Arm(100));
+ GregTech_API.registerCover(
+ GregtechItemList.Robot_Arm_UV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[3][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
+ }),
+ new GT_Cover_Arm(20));
+ GregTech_API.registerCover(
+ GregtechItemList.Robot_Arm_MAX.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[4][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
+ }),
+ new GT_Cover_Arm(4));
+ tLastID = 20;
+ GregtechItemList.Field_Generator_LuV.set(
+ this.addItem(tLastID = 20, "Field Generator (LuV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.TUTAMEN, 1L)
+ }));
+ GregtechItemList.Field_Generator_ZPM.set(
+ this.addItem(tLastID = 21, "Field Generator (ZPM)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.TUTAMEN, 2L)
+ }));
+ GregtechItemList.Field_Generator_UV.set(
+ this.addItem(tLastID = 22, "Field Generator (UV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 4L),
+ getTcAspectStack(TC_Aspects.TUTAMEN, 4L)
+ }));
+ GregtechItemList.Field_Generator_MAX.set(
+ this.addItem(tLastID = 23, "Field Generator (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 16L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.TUTAMEN, 8L)
+ }));
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_LuV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'),
+ // OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('C'),
+ // OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'),
+ // OrePrefixes.wireGt01.get(Materials.Osmium)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_ZPM.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'),
+ // OrePrefixes.gem.get(Materials.EnderEye), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good),
+ // Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.Osmium)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_UV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'),
+ // OrePrefixes.gem.get(Materials.NetherStar), Character.valueOf('C'),
+ // OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'),
+ // OrePrefixes.wireGt04.get(Materials.Osmium)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_MAX.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'),
+ // OrePrefixes.gem.get(Materials.NetherStar), Character.valueOf('C'),
+ // OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'),
+ // OrePrefixes.wireGt08.get(Materials.Osmium)});
+ tLastID = 24;
+ GregtechItemList.Emitter_LuV.set(this.addItem(tLastID = 24, "Emitter (LuV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.LUX, 1L)
+ }));
+ GregtechItemList.Emitter_ZPM.set(this.addItem(tLastID = 25, "Emitter (ZPM)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.LUX, 2L)
+ }));
+ GregtechItemList.Emitter_UV.set(this.addItem(tLastID = 26, "Emitter (UV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
+ getTcAspectStack(TC_Aspects.MACHINA, 4L),
+ getTcAspectStack(TC_Aspects.LUX, 4L)
+ }));
+ GregtechItemList.Emitter_MAX.set(this.addItem(tLastID = 27, "Emitter (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.LUX, 8L)
+ }));
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_LuV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'),
+ // OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Brass),
+ // Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'),
+ // OrePrefixes.cableGt01.get(Materials.Tin)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_ZPM.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'),
+ // OrePrefixes.gem.get(Materials.NetherQuartz), Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.Electrum), Character.valueOf('C'),
+ // OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'),
+ // OrePrefixes.cableGt01.get(Materials.AnyCopper)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_UV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'),
+ // OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Chrome),
+ // Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'),
+ // OrePrefixes.cableGt01.get(Materials.Gold)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_MAX.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'),
+ // OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.Platinum), Character.valueOf('C'),
+ // OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'),
+ // OrePrefixes.cableGt01.get(Materials.Aluminium)});
+ tLastID = 28;
+ GregtechItemList.Sensor_LuV.set(this.addItem(tLastID = 28, "Sensor (LuV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.SENSUS, 1L)
+ }));
+ GregtechItemList.Sensor_ZPM.set(this.addItem(tLastID = 29, "Sensor (ZPM)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.SENSUS, 2L)
+ }));
+ GregtechItemList.Sensor_UV.set(this.addItem(tLastID = 30, "Sensor (UV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
+ getTcAspectStack(TC_Aspects.MACHINA, 4L),
+ getTcAspectStack(TC_Aspects.SENSUS, 4L)
+ }));
+ GregtechItemList.Sensor_MAX.set(this.addItem(tLastID = 31, "Sensor (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.SENSUS, 8L)
+ }));
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_LuV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'),
+ // OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Brass),
+ // Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('C'),
+ // OrePrefixes.circuit.get(Materials.Basic)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_ZPM.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'),
+ // OrePrefixes.gem.get(Materials.NetherQuartz), Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.Electrum), Character.valueOf('P'),
+ // OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('C'),
+ // OrePrefixes.circuit.get(Materials.Good)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_UV.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'),
+ // OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Chrome),
+ // Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel), Character.valueOf('C'),
+ // OrePrefixes.circuit.get(Materials.Advanced)});
+ // GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_MAX.get(1L),
+ // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'),
+ // OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('S'),
+ // OrePrefixes.stick.get(Materials.Platinum), Character.valueOf('P'),
+ // OrePrefixes.plate.get(Materials.Titanium), Character.valueOf('C'),
+ // OrePrefixes.circuit.get(Materials.Elite)});
+
+ // Handler for ULV Components
+ registerComponents_ULV();
+
+ } else {
+ // Simplify life.
+ registerComponents_ULV();
+ registerComponents_MAX();
+ }
+
+ // Extruder Shape
+ GregtechItemList.Shape_Extruder_WindmillShaft.set(
+ this.addItem(tLastID = 40, "Extruder Shape (Shaft)", "Extruder Shape for making Windmill Shafts"));
+
+ // GTNH Already adds this.
+ if (!CORE.GTNH) {
+ GregtechItemList.Shape_Extruder_SmallGear.set(
+ this.addItem(221, "Extruder Shape (Small Gear)", "Extruder Shape for making small gears"));
+ }
+
+ // Batteries
+ GregtechItemList.Battery_RE_EV_Sodium.set(
+ this.addItem(tLastID = 50, "Quad Cell Sodium Battery", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.METALLUM, 2L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 2L)
+ }));
+ this.setElectricStats(32000 + tLastID, 3200000L, GT_Values.V[4], 4L, -3L, true);
+
+ GregtechItemList.Battery_RE_EV_Cadmium.set(
+ this.addItem(tLastID = 52, "Quad Cell Cadmium Battery", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.METALLUM, 1L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 1L)
+ }));
+ this.setElectricStats(32000 + tLastID, 4800000L, GT_Values.V[4], 4L, -3L, true);
+
+ GregtechItemList.Battery_RE_EV_Lithium.set(
+ this.addItem(tLastID = 54, "Quad Cell Lithium Battery", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 3L),
+ getTcAspectStack(TC_Aspects.METALLUM, 3L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 3L)
+ }));
+ this.setElectricStats(32000 + tLastID, 6400000L, GT_Values.V[4], 4L, -3L, true);
+
+ /**
+ * Power Gems
+ */
+ GregtechItemList.Battery_Gem_1.set(this.addItem(tLastID = 66, "Proton Cell", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.METALLUM, 24L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 16L)
+ }));
+ this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 20 * 300 / 4, GT_Values.V[6], 6L, -3L, false);
+ GregtechItemList.Battery_Gem_2.set(this.addItem(tLastID = 68, "Electron Cell", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 16L),
+ getTcAspectStack(TC_Aspects.METALLUM, 32L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 32L)
+ }));
+ this.setElectricStats(32000 + tLastID, GT_Values.V[7] * 20 * 300 / 4, GT_Values.V[7], 7L, -3L, false);
+ GregtechItemList.Battery_Gem_3.set(this.addItem(tLastID = 70, "Quark Entanglement", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 32L),
+ getTcAspectStack(TC_Aspects.METALLUM, 48L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 64L)
+ }));
+ this.setElectricStats(32000 + tLastID, GT_Values.V[8] * 20 * 300 / 4, GT_Values.V[8], 8L, -3L, false);
+ // ItemUtils.addItemToOreDictionary(GregtechItemList.Battery_Gem_1.get(1), "batteryFutureBasic");
+ // ItemUtils.addItemToOreDictionary(GregtechItemList.Battery_Gem_2.get(1), "batteryFutureGood");
+ // ItemUtils.addItemToOreDictionary(GregtechItemList.Battery_Gem_3.get(1), "batteryFutureAdvanced");
+
+ /*GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Acid Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)}));
setElectricStats(32000 + tLastID, 5000000L, GT_Values.V[2], 4L, -3L, true);
GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Mercury Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)}));
setElectricStats(32000 + tLastID, 5000000L, GT_Values.V[2], 4L, -3L, true);*/
- //RTG Pellet
- GregtechItemList.Pellet_RTG_PU238.set(this.addItem(41, StringUtils.superscript("238")+"Pu Pellet", "", new Object[]{getTcAspectStack(TC_Aspects.RADIO, 4L), getTcAspectStack(TC_Aspects.POTENTIA, 2L), getTcAspectStack(TC_Aspects.METALLUM, 2L)}));
- GregtechItemList.Pellet_RTG_SR90.set(this.addItem(42, StringUtils.superscript("90")+"Sr Pellet", "", new Object[]{getTcAspectStack(TC_Aspects.RADIO, 4L), getTcAspectStack(TC_Aspects.POTENTIA, 2L), getTcAspectStack(TC_Aspects.METALLUM, 2L)}));
- GregtechItemList.Pellet_RTG_PO210.set(this.addItem(43, StringUtils.superscript("210")+"Po Pellet", "", new Object[]{getTcAspectStack(TC_Aspects.RADIO, 4L), getTcAspectStack(TC_Aspects.POTENTIA, 2L), getTcAspectStack(TC_Aspects.METALLUM, 2L)}));
- GregtechItemList.Pellet_RTG_AM241.set(this.addItem(44, StringUtils.superscript("241")+"Am Pellet", "", new Object[]{getTcAspectStack(TC_Aspects.RADIO, 4L), getTcAspectStack(TC_Aspects.POTENTIA, 2L), getTcAspectStack(TC_Aspects.METALLUM, 2L)}));
-
- CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_PU238.get(1), MathUtils.roundToClosestInt(87.7f), 64);
- CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_SR90.get(1), MathUtils.roundToClosestInt(28.8f), 32);
- CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_PO210.get(1), 1, 512);
- CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_AM241.get(1), MathUtils.roundToClosestInt(432/2), 16);
- CORE.RA.addFuelForRTG(GT_ModHandler.getIC2Item("RTGPellets", 1), MathUtils.roundToClosestInt(2.6f), 8);
-
- //Computer Cube
- GregtechItemList.Gregtech_Computer_Cube.set(this.addItem(tLastID = 55, "Gregtech Computer Cube", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.METALLUM, 8L), getTcAspectStack(TC_Aspects.POTENTIA, 8L)}));
- this.setElectricStats(32000 + tLastID, GT_Values.V[6]* 10 * 60 * 20, GT_Values.V[5], 5L, -3L, true);
-
- //FOOOOOOOOOOOOOOD
- GregtechItemList.Food_Baked_Raisin_Bread.set(this.addItem(tLastID = 60, "Raisin Bread", "Extra Raisins, Just for ImQ009", new Object[]{new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false, new int[0]), getTcAspectStack(TC_Aspects.CORPUS, 1L), getTcAspectStack(TC_Aspects.FAMES, 1L), getTcAspectStack(TC_Aspects.IGNIS, 1L)}));
-
- if (!CORE.GTNH) {
- GregtechItemList.Fluid_Cell_144L.set(this.addItem(tLastID = 61, "144L Invar Fluid Cell", "Holds exactly one dust worth of liquid.", new Object[]{new ItemData(Materials.Invar, (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount), new MaterialStack[0]), getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- this.setFluidContainerStats(32000 + tLastID, 144L, 64L);
-
- GregtechItemList.Fluid_Cell_36L.set(this.addItem(tLastID = 62, "36L Brass Fluid Cell", "Holds exactly one small dust worth of liquid.", new Object[]{new ItemData(Materials.Brass, (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount), new MaterialStack[0]), getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- this.setFluidContainerStats(32000 + tLastID, 36L, 64L);
-
- GregtechItemList.Fluid_Cell_16L.set(this.addItem(tLastID = 63, "16L Bronze Fluid Cell", "Holds exactly one tiny dust / nugget worth of liquid.", new Object[]{new ItemData(Materials.Bronze, (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount), new MaterialStack[0]), getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- this.setFluidContainerStats(32000 + tLastID, 16L, 64L);
-
- GregtechItemList.Fluid_Cell_1L.set(this.addItem(tLastID = 64, "1L Wrought Iron Fluid Cell", "Holds exactly one litre worth of liquid.", new Object[]{new ItemData(Materials.WroughtIron, (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount), new MaterialStack[0]), getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- this.setFluidContainerStats(32000 + tLastID, 1L, 64L);
- }
-
-
-
- GregtechItemList.Cover_Overflow_ULV.set(this.addItem(71, "Overflow Valve (ULV)", "Maximum void amount: 8000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_LV.set(this.addItem(72, "Overflow Valve (LV)", "Maximum void amount: 64000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_MV.set(this.addItem(73, "Overflow Valve (MV)", "Maximum void amount: 512000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_HV.set(this.addItem(74, "Overflow Valve (HV)", "Maximum void amount: 4096000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_EV.set(this.addItem(75, "Overflow Valve (EV)", "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_IV.set(this.addItem(76, "Overflow Valve (IV)", "Maximum void amount: 262144000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
-
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(8));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_LV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(64));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_MV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(512));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_HV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(4096));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_EV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(32768));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_IV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(262144));
-
- //Fusion Reactor MK4 Singularity
- GregtechItemList.Compressed_Fusion_Reactor.set(this.addItem(100, "Hypervisor Matrix (Fusion)", "A memory unit containing an RI (Restricted Intelligence)"));
-
-
- //NanoTubes
- GregtechItemList.NanoTube_Base_Substrate.set(this.addItem(101, "Silicon Base Substrate", "Used in the production of Carbon Nanotubes"));
- GregtechItemList.NanoTube_Finished.set(this.addItem(102, "Carbon Nanotubes", "Multi-walled Zigzag nanotubes, possibly Carbon's final form"));
- GregtechItemList.Carbyne_Tube_Finished.set(this.addItem(103, "Linear Acetylenic Carbon (LAC/Carbyne)", "LAC chains grown inside Multi-walled Carbon Nanotubes, highly stable"));
- GregtechItemList.Carbyne_Sheet_Finished.set(this.addItem(104, "Carbyne Composite Panel", "Nanotubes which contain LAC, arranged side by side and compressed further"));
- GregtechItemList.Laser_Lens_Special.set(this.addItem(105, "Quantum Anomaly", "Probably should shoot it with lasers"));
-
- GregtechItemList.Battery_Casing_Gem_1.set(this.addItem(106, "Containment Unit I", "Used in crafting"));
- GregtechItemList.Battery_Casing_Gem_2.set(this.addItem(107, "Containment Unit II", "Used in crafting"));
- GregtechItemList.Battery_Casing_Gem_3.set(this.addItem(108, "Advanced Containment Unit", "Used in crafting"));
- GregtechItemList.Battery_Casing_Gem_4.set(this.addItem(109, "Exotic Containment Unit", "Used in crafting"));
-
- GregtechItemList.Battery_Gem_4.set(this.addItem(tLastID = 110, "Graviton Anomaly", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 64L), getTcAspectStack(TC_Aspects.METALLUM, 64L), getTcAspectStack(TC_Aspects.POTENTIA, 64L)}));
- this.setElectricStats(32000 + tLastID, (64000000000L*16), GT_Values.V[9], 9L, -3L, false);
-
-
-
- /*
- * Bombs
- */
- GregtechItemList.Bomb_Cast.set(this.addItem(111, "Bomb Cast", "Used in the production of Bombs"));
- GregtechItemList.Bomb_Cast_Molten.set(this.addItem(112, "Bomb Cast (Hot)", "Consider cooling this off"));
- GregtechItemList.Bomb_Cast_Set.set(this.addItem(113, "Bomb Cast (Set)", "Break it open for the goodies inside!"));
- GregtechItemList.Bomb_Cast_Broken.set(this.addItem(114, "Bomb Cast (Broken)", "This is probably just junk"));
- GregtechItemList.Bomb_Cast_Mold.set(this.addItem(115, "Mold (Bomb Cast)", "Used in the production of Bombs"));
-
- /*
- * High Tier 'Saws' for the tree Farm
- */
- GregtechItemList.Farm_Processor_EV.set(this.addItem(tLastID = 120, "Farm Processor [EV]", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.METALLUM, 8L), getTcAspectStack(TC_Aspects.POTENTIA, 8L)}));
- this.setElectricStats(32000 + tLastID, GT_Values.V[5]* 10 * 60 * 20, GT_Values.V[4], 4L, -3L, false);
- GregtechItemList.Farm_Processor_IV.set(this.addItem(tLastID = 122, "Farm Processor [IV]", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.METALLUM, 8L), getTcAspectStack(TC_Aspects.POTENTIA, 8L)}));
- this.setElectricStats(32000 + tLastID, GT_Values.V[6]* 10 * 60 * 20, GT_Values.V[5], 5L, -3L, false);
- GregtechItemList.Farm_Processor_LuV.set(this.addItem(tLastID = 124, "Farm Processor [LuV]", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.METALLUM, 8L), getTcAspectStack(TC_Aspects.POTENTIA, 8L)}));
- this.setElectricStats(32000 + tLastID, GT_Values.V[7]* 10 * 60 * 20, GT_Values.V[6], 6L, -3L, false);
- GregtechItemList.Farm_Processor_ZPM.set(this.addItem(tLastID = 126, "Farm Processor [ZPM]", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.METALLUM, 8L), getTcAspectStack(TC_Aspects.POTENTIA, 8L)}));
- this.setElectricStats(32000 + tLastID, GT_Values.V[8]* 10 * 60 * 20, GT_Values.V[7], 7L, -3L, false);
- GregtechItemList.Farm_Processor_UV.set(this.addItem(tLastID = 128, "Farm Processor [UV]", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.METALLUM, 8L), getTcAspectStack(TC_Aspects.POTENTIA, 8L)}));
- this.setElectricStats(32000 + tLastID, GT_Values.V[9]* 10 * 60 * 20, GT_Values.V[8], 8L, -3L, false);
-
- String aTierName;
+ // RTG Pellet
+ GregtechItemList.Pellet_RTG_PU238.set(
+ this.addItem(41, StringUtils.superscript("238") + "Pu Pellet", "", new Object[] {
+ getTcAspectStack(TC_Aspects.RADIO, 4L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 2L),
+ getTcAspectStack(TC_Aspects.METALLUM, 2L)
+ }));
+ GregtechItemList.Pellet_RTG_SR90.set(
+ this.addItem(42, StringUtils.superscript("90") + "Sr Pellet", "", new Object[] {
+ getTcAspectStack(TC_Aspects.RADIO, 4L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 2L),
+ getTcAspectStack(TC_Aspects.METALLUM, 2L)
+ }));
+ GregtechItemList.Pellet_RTG_PO210.set(
+ this.addItem(43, StringUtils.superscript("210") + "Po Pellet", "", new Object[] {
+ getTcAspectStack(TC_Aspects.RADIO, 4L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 2L),
+ getTcAspectStack(TC_Aspects.METALLUM, 2L)
+ }));
+ GregtechItemList.Pellet_RTG_AM241.set(
+ this.addItem(44, StringUtils.superscript("241") + "Am Pellet", "", new Object[] {
+ getTcAspectStack(TC_Aspects.RADIO, 4L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 2L),
+ getTcAspectStack(TC_Aspects.METALLUM, 2L)
+ }));
+
+ CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_PU238.get(1), MathUtils.roundToClosestInt(87.7f), 64);
+ CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_SR90.get(1), MathUtils.roundToClosestInt(28.8f), 32);
+ CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_PO210.get(1), 1, 512);
+ CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_AM241.get(1), MathUtils.roundToClosestInt(432 / 2), 16);
+ CORE.RA.addFuelForRTG(GT_ModHandler.getIC2Item("RTGPellets", 1), MathUtils.roundToClosestInt(2.6f), 8);
+
+ // Computer Cube
+ GregtechItemList.Gregtech_Computer_Cube.set(
+ this.addItem(tLastID = 55, "Gregtech Computer Cube", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.METALLUM, 8L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 8L)
+ }));
+ this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 10 * 60 * 20, GT_Values.V[5], 5L, -3L, true);
+
+ // FOOOOOOOOOOOOOOD
+ GregtechItemList.Food_Baked_Raisin_Bread.set(
+ this.addItem(tLastID = 60, "Raisin Bread", "Extra Raisins, Just for ImQ009", new Object[] {
+ new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false, new int[0]),
+ getTcAspectStack(TC_Aspects.CORPUS, 1L),
+ getTcAspectStack(TC_Aspects.FAMES, 1L),
+ getTcAspectStack(TC_Aspects.IGNIS, 1L)
+ }));
+
+ if (!CORE.GTNH) {
+ GregtechItemList.Fluid_Cell_144L.set(this.addItem(
+ tLastID = 61, "144L Invar Fluid Cell", "Holds exactly one dust worth of liquid.", new Object[] {
+ new ItemData(
+ Materials.Invar,
+ (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount),
+ new MaterialStack[0]),
+ getTcAspectStack(TC_Aspects.VACUOS, 2L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ this.setFluidContainerStats(32000 + tLastID, 144L, 64L);
+
+ GregtechItemList.Fluid_Cell_36L.set(this.addItem(
+ tLastID = 62,
+ "36L Brass Fluid Cell",
+ "Holds exactly one small dust worth of liquid.",
+ new Object[] {
+ new ItemData(
+ Materials.Brass,
+ (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount),
+ new MaterialStack[0]),
+ getTcAspectStack(TC_Aspects.VACUOS, 2L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ this.setFluidContainerStats(32000 + tLastID, 36L, 64L);
+
+ GregtechItemList.Fluid_Cell_16L.set(this.addItem(
+ tLastID = 63,
+ "16L Bronze Fluid Cell",
+ "Holds exactly one tiny dust / nugget worth of liquid.",
+ new Object[] {
+ new ItemData(
+ Materials.Bronze,
+ (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount),
+ new MaterialStack[0]),
+ getTcAspectStack(TC_Aspects.VACUOS, 2L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ this.setFluidContainerStats(32000 + tLastID, 16L, 64L);
+
+ GregtechItemList.Fluid_Cell_1L.set(this.addItem(
+ tLastID = 64,
+ "1L Wrought Iron Fluid Cell",
+ "Holds exactly one litre worth of liquid.",
+ new Object[] {
+ new ItemData(
+ Materials.WroughtIron,
+ (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount),
+ new MaterialStack[0]),
+ getTcAspectStack(TC_Aspects.VACUOS, 2L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ this.setFluidContainerStats(32000 + tLastID, 1L, 64L);
+ }
+
+ GregtechItemList.Cover_Overflow_ULV.set(
+ this.addItem(71, "Overflow Valve (ULV)", "Maximum void amount: 8000", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ GregtechItemList.Cover_Overflow_LV.set(
+ this.addItem(72, "Overflow Valve (LV)", "Maximum void amount: 64000", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ GregtechItemList.Cover_Overflow_MV.set(
+ this.addItem(73, "Overflow Valve (MV)", "Maximum void amount: 512000", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ GregtechItemList.Cover_Overflow_HV.set(
+ this.addItem(74, "Overflow Valve (HV)", "Maximum void amount: 4096000", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ GregtechItemList.Cover_Overflow_EV.set(
+ this.addItem(75, "Overflow Valve (EV)", "Maximum void amount: 32768000", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ GregtechItemList.Cover_Overflow_IV.set(
+ this.addItem(76, "Overflow Valve (IV)", "Maximum void amount: 262144000", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+
+ GregTech_API.registerCover(
+ GregtechItemList.Cover_Overflow_ULV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[4][0],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)
+ }),
+ new GTPP_Cover_Overflow(8));
+ GregTech_API.registerCover(
+ GregtechItemList.Cover_Overflow_LV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[4][0],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)
+ }),
+ new GTPP_Cover_Overflow(64));
+ GregTech_API.registerCover(
+ GregtechItemList.Cover_Overflow_MV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[5][0],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)
+ }),
+ new GTPP_Cover_Overflow(512));
+ GregTech_API.registerCover(
+ GregtechItemList.Cover_Overflow_HV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[5][0],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)
+ }),
+ new GTPP_Cover_Overflow(4096));
+ GregTech_API.registerCover(
+ GregtechItemList.Cover_Overflow_EV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[8][0],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)
+ }),
+ new GTPP_Cover_Overflow(32768));
+ GregTech_API.registerCover(
+ GregtechItemList.Cover_Overflow_IV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[8][0],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)
+ }),
+ new GTPP_Cover_Overflow(262144));
+
+ // Fusion Reactor MK4 Singularity
+ GregtechItemList.Compressed_Fusion_Reactor.set(this.addItem(
+ 100, "Hypervisor Matrix (Fusion)", "A memory unit containing an RI (Restricted Intelligence)"));
+
+ // NanoTubes
+ GregtechItemList.NanoTube_Base_Substrate.set(
+ this.addItem(101, "Silicon Base Substrate", "Used in the production of Carbon Nanotubes"));
+ GregtechItemList.NanoTube_Finished.set(
+ this.addItem(102, "Carbon Nanotubes", "Multi-walled Zigzag nanotubes, possibly Carbon's final form"));
+ GregtechItemList.Carbyne_Tube_Finished.set(this.addItem(
+ 103,
+ "Linear Acetylenic Carbon (LAC/Carbyne)",
+ "LAC chains grown inside Multi-walled Carbon Nanotubes, highly stable"));
+ GregtechItemList.Carbyne_Sheet_Finished.set(this.addItem(
+ 104,
+ "Carbyne Composite Panel",
+ "Nanotubes which contain LAC, arranged side by side and compressed further"));
+ GregtechItemList.Laser_Lens_Special.set(
+ this.addItem(105, "Quantum Anomaly", "Probably should shoot it with lasers"));
+
+ GregtechItemList.Battery_Casing_Gem_1.set(this.addItem(106, "Containment Unit I", "Used in crafting"));
+ GregtechItemList.Battery_Casing_Gem_2.set(this.addItem(107, "Containment Unit II", "Used in crafting"));
+ GregtechItemList.Battery_Casing_Gem_3.set(this.addItem(108, "Advanced Containment Unit", "Used in crafting"));
+ GregtechItemList.Battery_Casing_Gem_4.set(this.addItem(109, "Exotic Containment Unit", "Used in crafting"));
+
+ GregtechItemList.Battery_Gem_4.set(this.addItem(tLastID = 110, "Graviton Anomaly", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 64L),
+ getTcAspectStack(TC_Aspects.METALLUM, 64L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 64L)
+ }));
+ this.setElectricStats(32000 + tLastID, (64000000000L * 16), GT_Values.V[9], 9L, -3L, false);
+
+ /*
+ * Bombs
+ */
+ GregtechItemList.Bomb_Cast.set(this.addItem(111, "Bomb Cast", "Used in the production of Bombs"));
+ GregtechItemList.Bomb_Cast_Molten.set(this.addItem(112, "Bomb Cast (Hot)", "Consider cooling this off"));
+ GregtechItemList.Bomb_Cast_Set.set(
+ this.addItem(113, "Bomb Cast (Set)", "Break it open for the goodies inside!"));
+ GregtechItemList.Bomb_Cast_Broken.set(this.addItem(114, "Bomb Cast (Broken)", "This is probably just junk"));
+ GregtechItemList.Bomb_Cast_Mold.set(this.addItem(115, "Mold (Bomb Cast)", "Used in the production of Bombs"));
+
+ /*
+ * High Tier 'Saws' for the tree Farm
+ */
+ GregtechItemList.Farm_Processor_EV.set(
+ this.addItem(tLastID = 120, "Farm Processor [EV]", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.METALLUM, 8L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 8L)
+ }));
+ this.setElectricStats(32000 + tLastID, GT_Values.V[5] * 10 * 60 * 20, GT_Values.V[4], 4L, -3L, false);
+ GregtechItemList.Farm_Processor_IV.set(
+ this.addItem(tLastID = 122, "Farm Processor [IV]", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.METALLUM, 8L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 8L)
+ }));
+ this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 10 * 60 * 20, GT_Values.V[5], 5L, -3L, false);
+ GregtechItemList.Farm_Processor_LuV.set(
+ this.addItem(tLastID = 124, "Farm Processor [LuV]", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.METALLUM, 8L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 8L)
+ }));
+ this.setElectricStats(32000 + tLastID, GT_Values.V[7] * 10 * 60 * 20, GT_Values.V[6], 6L, -3L, false);
+ GregtechItemList.Farm_Processor_ZPM.set(
+ this.addItem(tLastID = 126, "Farm Processor [ZPM]", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.METALLUM, 8L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 8L)
+ }));
+ this.setElectricStats(32000 + tLastID, GT_Values.V[8] * 10 * 60 * 20, GT_Values.V[7], 7L, -3L, false);
+ GregtechItemList.Farm_Processor_UV.set(
+ this.addItem(tLastID = 128, "Farm Processor [UV]", "Reusable", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.METALLUM, 8L),
+ getTcAspectStack(TC_Aspects.POTENTIA, 8L)
+ }));
+ this.setElectricStats(32000 + tLastID, GT_Values.V[9] * 10 * 60 * 20, GT_Values.V[8], 8L, -3L, false);
+
+ String aTierName;
int aFirstMachineCasingID = 130;
GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] {
- GregtechItemList.FakeMachineCasingPlate_ULV,
- GregtechItemList.FakeMachineCasingPlate_LV,
- GregtechItemList.FakeMachineCasingPlate_MV,
- GregtechItemList.FakeMachineCasingPlate_HV,
- GregtechItemList.FakeMachineCasingPlate_EV,
- GregtechItemList.FakeMachineCasingPlate_IV,
- GregtechItemList.FakeMachineCasingPlate_LuV,
- GregtechItemList.FakeMachineCasingPlate_ZPM,
- GregtechItemList.FakeMachineCasingPlate_UV,
- GregtechItemList.FakeMachineCasingPlate_MAX,
+ GregtechItemList.FakeMachineCasingPlate_ULV,
+ GregtechItemList.FakeMachineCasingPlate_LV,
+ GregtechItemList.FakeMachineCasingPlate_MV,
+ GregtechItemList.FakeMachineCasingPlate_HV,
+ GregtechItemList.FakeMachineCasingPlate_EV,
+ GregtechItemList.FakeMachineCasingPlate_IV,
+ GregtechItemList.FakeMachineCasingPlate_LuV,
+ GregtechItemList.FakeMachineCasingPlate_ZPM,
+ GregtechItemList.FakeMachineCasingPlate_UV,
+ GregtechItemList.FakeMachineCasingPlate_MAX,
};
- for (int i=0;i<10;i++) {
- if (i==10) {
+ for (int i = 0; i < 10; i++) {
+ if (i == 10) {
break;
- }
- else {
+ } else {
aTierName = GT_Values.VN[i];
- mMachineCasingCovers[i].set(this.addItem(aFirstMachineCasingID++, aTierName+" Machine Plate Cover", "Deprecated - Shapeless Craft to new version", new Object[]{}));
- GregTech_API.registerCover(mMachineCasingCovers[i].get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[i][0]}), new GTPP_Cover_ToggleVisual());
- }
+ mMachineCasingCovers[i].set(this.addItem(
+ aFirstMachineCasingID++,
+ aTierName + " Machine Plate Cover",
+ "Deprecated - Shapeless Craft to new version",
+ new Object[] {}));
+ GregTech_API.registerCover(
+ mMachineCasingCovers[i].get(1L),
+ new GT_MultiTexture(new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[i][0]}),
+ new GTPP_Cover_ToggleVisual());
+ }
}
- GregtechItemList.Laser_Lens_WoodsGlass.set(this.addItem(140, "Wood's Glass Lens", "Allows UV & IF to pass through, blocks visible light spectrums"));
-
+ GregtechItemList.Laser_Lens_WoodsGlass.set(this.addItem(
+ 140, "Wood's Glass Lens", "Allows UV & IF to pass through, blocks visible light spectrums"));
+
int aStartID = 141;
GregtechItemList[] aTransParts = new GregtechItemList[] {
- GregtechItemList.TransmissionComponent_ULV,
- GregtechItemList.TransmissionComponent_LV,
- GregtechItemList.TransmissionComponent_MV,
- GregtechItemList.TransmissionComponent_HV,
- GregtechItemList.TransmissionComponent_EV,
- GregtechItemList.TransmissionComponent_IV,
- GregtechItemList.TransmissionComponent_LuV,
- GregtechItemList.TransmissionComponent_ZPM,
- GregtechItemList.TransmissionComponent_UV,
- GregtechItemList.TransmissionComponent_MAX,
+ GregtechItemList.TransmissionComponent_ULV,
+ GregtechItemList.TransmissionComponent_LV,
+ GregtechItemList.TransmissionComponent_MV,
+ GregtechItemList.TransmissionComponent_HV,
+ GregtechItemList.TransmissionComponent_EV,
+ GregtechItemList.TransmissionComponent_IV,
+ GregtechItemList.TransmissionComponent_LuV,
+ GregtechItemList.TransmissionComponent_ZPM,
+ GregtechItemList.TransmissionComponent_UV,
+ GregtechItemList.TransmissionComponent_MAX,
};
- for (int aIndex=0;aIndex<10;aIndex++){
- aTransParts[aIndex].set(this.addItem(aStartID++, "Transmission Component ("+GT_Values.VN[aIndex]+")", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, aIndex), getTcAspectStack(TC_Aspects.MACHINA, aIndex), getTcAspectStack(TC_Aspects.MAGNETO, aIndex)}));
+ for (int aIndex = 0; aIndex < 10; aIndex++) {
+ aTransParts[aIndex].set(
+ this.addItem(aStartID++, "Transmission Component (" + GT_Values.VN[aIndex] + ")", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, aIndex),
+ getTcAspectStack(TC_Aspects.MACHINA, aIndex),
+ getTcAspectStack(TC_Aspects.MAGNETO, aIndex)
+ }));
}
-
+
// Distillus Chip
- GregtechItemList.Distillus_Upgrade_Chip.set(this.addItem(151, "Upgrade Chip", "Used to upgrade Distillus to Tier 2"));
-
-
- GregtechItemList.Chip_MultiNerf_NoOutputBonus.set(this.addItem(160, "No-Bonus Chip", "You won't like using this"));
- GregtechItemList.Chip_MultiNerf_NoSpeedBonus.set(this.addItem(161, "No-Bonus Chip", "You won't like using this"));
- GregtechItemList.Chip_MultiNerf_NoEuBonus.set(this.addItem(162, "No-Bonus Chip", "You won't like using this"));
-
-
- /*
- GregtechItemList.Cover_Overflow_Item_ULV.set(this.addItem(165, "Item Overflow Valve (ULV)", "Maximum void amount: 8000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_Item_LV.set(this.addItem(166, "Item Overflow Valve (LV)", "Maximum void amount: 64000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_Item_MV.set(this.addItem(167, "Item Overflow Valve (MV)", "Maximum void amount: 512000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_Item_HV.set(this.addItem(168, "Item Overflow Valve (HV)", "Maximum void amount: 4096000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_Item_EV.set(this.addItem(169, "Item Overflow Valve (EV)", "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Cover_Overflow_Item_IV.set(this.addItem(170, "Item Overflow Valve (IV)", "Maximum void amount: 262144000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
-
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(8));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_LV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(64));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_MV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(512));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_HV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(4096));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_EV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(32768));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_IV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(262144));
- */
- }
-
- private boolean registerComponents_ULV(){
- GregtechItemList.Electric_Pump_ULV.set(this.addItem(32, "Electric Pump (ULV)", "160 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregtechItemList.Electric_Motor_ULV.set(this.addItem(33, "Electric Motor (ULV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.MOTUS, 1L)}));
- GregtechItemList.Conveyor_Module_ULV.set(this.addItem(34, "Conveyor Module (ULV)", "1 Stack every 80 secs (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L)}));
- GregtechItemList.Electric_Piston_ULV.set(this.addItem(35, "Electric Piston (ULV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 1L)}));
- GregtechItemList.Robot_Arm_ULV.set(this.addItem(36, "Robot Arm (ULV)", "Inserts into specific Slots (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 1L), Utils.getTcAspectStack("COGNITIO", 1L)}));
- GregtechItemList.Field_Generator_ULV.set(this.addItem(37, "Field Generator (ULV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.TUTAMEN, 1L)}));
- GregtechItemList.Emitter_ULV.set(this.addItem(38, "Emitter (ULV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.LUX, 1L)}));
- GregtechItemList.Sensor_ULV.set(this.addItem(39, "Sensor (ULV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.SENSUS, 1L)}));
-
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(8));
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(1600));
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(1600));
-
- return true;
- }
-
- private boolean registerComponents_MAX(){
- GregtechItemList.Electric_Pump_MAX.set(this.addItem(3, "Electric Pump (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L), getTcAspectStack(TC_Aspects.AQUA, 8L)}));
- GregtechItemList.Electric_Motor_MAX.set(this.addItem(7, "Electric Motor (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 8L)}));
- GregtechItemList.Conveyor_Module_MAX.set(this.addItem(11, "Conveyor Module (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L)}));
- GregtechItemList.Electric_Piston_MAX.set(this.addItem(15, "Electric Piston (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L)}));
- GregtechItemList.Robot_Arm_MAX.set(this.addItem(19, "Robot Arm (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L), getTcAspectStack("COGNITIO", 8L)}));
- GregtechItemList.Field_Generator_MAX.set(this.addItem(23, "Field Generator (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 16L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.TUTAMEN, 8L)}));
- GregtechItemList.Emitter_MAX.set(this.addItem(27, "Emitter (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.LUX, 8L)}));
- GregtechItemList.Sensor_MAX.set(this.addItem(31, "Sensor (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.SENSUS, 8L)}));
-
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_MAX.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(524288));
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_MAX.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(4));
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_MAX.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(4));
-
-
- return true;
- }
-
- public boolean registerOldCircuits(){
- //Enable Old Circuits
- Logger.INFO("[Old Feature - Circuits] Enabling Pre-5.09.28 Circuits and Data Storage.");
-
- GregtechItemList.Old_Circuit_Primitive.set(this.addItem(200, "NAND Chip", "A very simple Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Primitive)}));
- GregtechItemList.Old_Circuit_Basic.set(this.addItem(201, "Basic Electronic Circuit", "A basic Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Basic)}));
- GregtechItemList.Old_Circuit_Good.set(this.addItem(202, "Good Electronic Circuit", "A good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good)}));
- GregtechItemList.Old_Circuit_Advanced.set(this.addItem(203, "Advanced Circuit", "An advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced)}));
- GregtechItemList.Old_Circuit_Data.set(this.addItem(204, "Data Storage Circuit", "A Data Storage Chip", new Object[]{OrePrefixes.circuit.get(Materials.Data)}));
- GregtechItemList.Old_Circuit_Elite.set(this.addItem(205, "Data Control Circuit", "A Processor", new Object[]{OrePrefixes.circuit.get(Materials.Elite)}));
- GregtechItemList.Old_Circuit_Master.set(this.addItem(206, "Energy Flow Circuit", "A High Voltage Processor", new Object[]{OrePrefixes.circuit.get(Materials.Master)}));
-
- GregtechItemList.Old_Tool_DataOrb.set(this.addItem(207, "Data Orb [GT++]", "A High Capacity Data Storage", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION, new Behaviour_DataOrb()}));
- GregtechItemList.Old_Circuit_Ultimate.set(GregtechItemList.Old_Tool_DataOrb.get(1L));
- GT_ModHandler.addShapelessCraftingRecipe(GregtechItemList.Old_Tool_DataOrb.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{GregtechItemList.Old_Tool_DataOrb.get(1L)});
-
- GregtechItemList.Old_Tool_DataStick.set(this.addItem(208, "Data Stick [GT++]", "A Low Capacity Data Storage", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION, new Behaviour_DataStick()}));
- GT_ModHandler.addShapelessCraftingRecipe(GregtechItemList.Old_Tool_DataStick.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{GregtechItemList.Old_Tool_DataStick.get(1L)});
-
- GregtechItemList.Old_Circuit_Board_Basic.set(this.addItem(210, "Basic Circuit Board", "A basic Board"));
- GregtechItemList.Old_Circuit_Board_Advanced.set(this.addItem(211, "Advanced Circuit Board", "An advanced Board"));
- GregtechItemList.Old_Circuit_Board_Elite.set(this.addItem(212, "Processor Board", "A Processor Board"));
- GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.set(this.addItem(213, "Engraved Crystal Chip", "Needed for Circuits"));
- GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.set(this.addItem(214, "Engraved Lapotron Chip", "Needed for Circuits"));
- GregtechItemList.Old_Circuit_Parts_Advanced.set(this.addItem(215, "Advanced Circuit Parts", "Advanced Circuit Parts"));
- GregtechItemList.Old_Circuit_Parts_Wiring_Basic.set(this.addItem(216, "Etched Medium Voltage Wiring", "Part of Circuit Boards"));
- GregtechItemList.Old_Circuit_Parts_Wiring_Advanced.set(this.addItem(217, "Etched High Voltage Wiring", "Part of Circuit Boards"));
- GregtechItemList.Old_Circuit_Parts_Wiring_Elite.set(this.addItem(218, "Etched Extreme Voltage Wiring", "Part of Circuit Boards"));
- GregtechItemList.Old_Empty_Board_Basic.set(this.addItem(219, "Empty Circuit Board", "A Board Part"));
- GregtechItemList.Old_Empty_Board_Elite.set(this.addItem(220, "Empty Processor Board", "A Processor Board Part"));
-
- return true;
- }
-
- public boolean registerCustomCircuits() {
- if (CORE.ConfigSwitches.enableCustomCircuits){
- GregtechItemList.Circuit_IV.set(this.addItem(704, "Symbiotic Circuit (IV)", "A Symbiotic Data Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic)}));
- GregtechItemList.Circuit_LuV.set(this.addItem(705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic)}));
- GregtechItemList.Circuit_ZPM.set(this.addItem(706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Quantum)}));
- GregtechItemList.Circuit_Board_IV.set(this.addItem(710, "IV Circuit Board", "An IV Voltage Rated Circuit Board"));
- GregtechItemList.Circuit_Board_LuV.set(this.addItem(711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board"));
- GregtechItemList.Circuit_Board_ZPM.set(this.addItem(712, "ZPM Processor Board", "A ZPM Voltage Rated Processor Board"));
- GregtechItemList.Circuit_Parts_Crystal_Chip_IV.set(this.addItem(713, "(IV) Energized Crystal Chip", "Needed for Circuits"));
- GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.set(this.addItem(714, "(LuV) Neutron based Microchip", "Needed for Circuits"));
- GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.set(this.addItem(715, "(ZPM) Quantum Chip", "Needed for Circuits"));
- GregtechItemList.Circuit_Parts_IV.set(this.addItem(716, "(IV) Energized Circuit Parts", "Circuit Parts"));
- GregtechItemList.Circuit_Parts_LuV.set(this.addItem(717, "(LuV) Neutron-based Circuit Parts", "Circuit Parts"));
- GregtechItemList.Circuit_Parts_ZPM.set(this.addItem(718, "(ZPM) Quantum Circuit Parts", "Circuit Parts"));
- GregtechItemList.Circuit_Parts_Wiring_IV.set(this.addItem(719, "Etched IV Voltage Wiring", "Part of Circuit Boards"));
- GregtechItemList.Circuit_Parts_Wiring_LuV.set(this.addItem(720, "Etched LuV Voltage Wiring", "Part of Circuit Boards"));
- GregtechItemList.Circuit_Parts_Wiring_ZPM.set(this.addItem(721, "Etched ZPM Voltage Wiring", "Part of Circuit Boards"));
- ItemUtils.addItemToOreDictionary(GregtechItemList.Circuit_IV.get(1), "circuitSuperconductor");
- ItemUtils.addItemToOreDictionary(GregtechItemList.Circuit_LuV.get(1), "circuitInfinite");
- return true;
- }
- return false;
- }
+ GregtechItemList.Distillus_Upgrade_Chip.set(
+ this.addItem(151, "Upgrade Chip", "Used to upgrade Distillus to Tier 2"));
+
+ GregtechItemList.Chip_MultiNerf_NoOutputBonus.set(
+ this.addItem(160, "No-Bonus Chip", "You won't like using this"));
+ GregtechItemList.Chip_MultiNerf_NoSpeedBonus.set(
+ this.addItem(161, "No-Bonus Chip", "You won't like using this"));
+ GregtechItemList.Chip_MultiNerf_NoEuBonus.set(this.addItem(162, "No-Bonus Chip", "You won't like using this"));
+
+ /*
+ GregtechItemList.Cover_Overflow_Item_ULV.set(this.addItem(165, "Item Overflow Valve (ULV)", "Maximum void amount: 8000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ GregtechItemList.Cover_Overflow_Item_LV.set(this.addItem(166, "Item Overflow Valve (LV)", "Maximum void amount: 64000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ GregtechItemList.Cover_Overflow_Item_MV.set(this.addItem(167, "Item Overflow Valve (MV)", "Maximum void amount: 512000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ GregtechItemList.Cover_Overflow_Item_HV.set(this.addItem(168, "Item Overflow Valve (HV)", "Maximum void amount: 4096000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ GregtechItemList.Cover_Overflow_Item_EV.set(this.addItem(169, "Item Overflow Valve (EV)", "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ GregtechItemList.Cover_Overflow_Item_IV.set(this.addItem(170, "Item Overflow Valve (IV)", "Maximum void amount: 262144000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(8));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_LV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(64));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_MV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(512));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_HV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(4096));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_EV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(32768));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_IV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(262144));
+ */
+ }
+
+ private boolean registerComponents_ULV() {
+ GregtechItemList.Electric_Pump_ULV.set(
+ this.addItem(32, "Electric Pump (ULV)", "160 L/sec (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L),
+ getTcAspectStack(TC_Aspects.AQUA, 1L)
+ }));
+ GregtechItemList.Electric_Motor_ULV.set(this.addItem(33, "Electric Motor (ULV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.MOTUS, 1L)
+ }));
+ GregtechItemList.Conveyor_Module_ULV.set(
+ this.addItem(34, "Conveyor Module (ULV)", "1 Stack every 80 secs (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.ITER, 1L)
+ }));
+ GregtechItemList.Electric_Piston_ULV.set(this.addItem(35, "Electric Piston (ULV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.MOTUS, 1L)
+ }));
+ GregtechItemList.Robot_Arm_ULV.set(
+ this.addItem(36, "Robot Arm (ULV)", "Inserts into specific Slots (as Cover)", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 2L),
+ getTcAspectStack(TC_Aspects.MOTUS, 1L),
+ Utils.getTcAspectStack("COGNITIO", 1L)
+ }));
+ GregtechItemList.Field_Generator_ULV.set(this.addItem(37, "Field Generator (ULV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.TUTAMEN, 1L)
+ }));
+ GregtechItemList.Emitter_ULV.set(this.addItem(38, "Emitter (ULV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.LUX, 1L)
+ }));
+ GregtechItemList.Sensor_ULV.set(this.addItem(39, "Sensor (ULV)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
+ getTcAspectStack(TC_Aspects.MACHINA, 1L),
+ getTcAspectStack(TC_Aspects.SENSUS, 1L)
+ }));
+
+ GregTech_API.registerCover(
+ GregtechItemList.Electric_Pump_ULV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
+ }),
+ new GT_Cover_Pump(8));
+ GregTech_API.registerCover(
+ GregtechItemList.Conveyor_Module_ULV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[1][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
+ }),
+ new GT_Cover_Conveyor(1600));
+ GregTech_API.registerCover(
+ GregtechItemList.Robot_Arm_ULV.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
+ }),
+ new GT_Cover_Arm(1600));
+
+ return true;
+ }
+
+ private boolean registerComponents_MAX() {
+ GregtechItemList.Electric_Pump_MAX.set(this.addItem(3, "Electric Pump (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.ITER, 8L),
+ getTcAspectStack(TC_Aspects.AQUA, 8L)
+ }));
+ GregtechItemList.Electric_Motor_MAX.set(this.addItem(7, "Electric Motor (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.MOTUS, 8L)
+ }));
+ GregtechItemList.Conveyor_Module_MAX.set(this.addItem(11, "Conveyor Module (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.ITER, 8L)
+ }));
+ GregtechItemList.Electric_Piston_MAX.set(this.addItem(15, "Electric Piston (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 16L),
+ getTcAspectStack(TC_Aspects.MOTUS, 8L)
+ }));
+ GregtechItemList.Robot_Arm_MAX.set(this.addItem(19, "Robot Arm (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 16L),
+ getTcAspectStack(TC_Aspects.MOTUS, 8L),
+ getTcAspectStack("COGNITIO", 8L)
+ }));
+ GregtechItemList.Field_Generator_MAX.set(this.addItem(23, "Field Generator (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 16L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.TUTAMEN, 8L)
+ }));
+ GregtechItemList.Emitter_MAX.set(this.addItem(27, "Emitter (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.LUX, 8L)
+ }));
+ GregtechItemList.Sensor_MAX.set(this.addItem(31, "Sensor (MAX)", "", new Object[] {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
+ getTcAspectStack(TC_Aspects.MACHINA, 8L),
+ getTcAspectStack(TC_Aspects.SENSUS, 8L)
+ }));
+
+ GregTech_API.registerCover(
+ GregtechItemList.Electric_Pump_MAX.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
+ }),
+ new GT_Cover_Pump(524288));
+ GregTech_API.registerCover(
+ GregtechItemList.Conveyor_Module_MAX.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[4][0],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
+ }),
+ new GT_Cover_Conveyor(4));
+ GregTech_API.registerCover(
+ GregtechItemList.Robot_Arm_MAX.get(1L),
+ new GT_MultiTexture(new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
+ }),
+ new GT_Cover_Arm(4));
+
+ return true;
+ }
+
+ public boolean registerOldCircuits() {
+ // Enable Old Circuits
+ Logger.INFO("[Old Feature - Circuits] Enabling Pre-5.09.28 Circuits and Data Storage.");
+
+ GregtechItemList.Old_Circuit_Primitive.set(this.addItem(
+ 200, "NAND Chip", "A very simple Circuit", new Object[] {OrePrefixes.circuit.get(Materials.Primitive)
+ }));
+ GregtechItemList.Old_Circuit_Basic.set(
+ this.addItem(201, "Basic Electronic Circuit", "A basic Circuit", new Object[] {
+ OrePrefixes.circuit.get(Materials.Basic)
+ }));
+ GregtechItemList.Old_Circuit_Good.set(this.addItem(
+ 202, "Good Electronic Circuit", "A good Circuit", new Object[] {OrePrefixes.circuit.get(Materials.Good)
+ }));
+ GregtechItemList.Old_Circuit_Advanced.set(
+ this.addItem(203, "Advanced Circuit", "An advanced Circuit", new Object[] {
+ OrePrefixes.circuit.get(Materials.Advanced)
+ }));
+ GregtechItemList.Old_Circuit_Data.set(
+ this.addItem(204, "Data Storage Circuit", "A Data Storage Chip", new Object[] {
+ OrePrefixes.circuit.get(Materials.Data)
+ }));
+ GregtechItemList.Old_Circuit_Elite.set(this.addItem(
+ 205, "Data Control Circuit", "A Processor", new Object[] {OrePrefixes.circuit.get(Materials.Elite)}));
+ GregtechItemList.Old_Circuit_Master.set(
+ this.addItem(206, "Energy Flow Circuit", "A High Voltage Processor", new Object[] {
+ OrePrefixes.circuit.get(Materials.Master)
+ }));
+
+ GregtechItemList.Old_Tool_DataOrb.set(
+ this.addItem(207, "Data Orb [GT++]", "A High Capacity Data Storage", new Object[] {
+ OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION, new Behaviour_DataOrb()
+ }));
+ GregtechItemList.Old_Circuit_Ultimate.set(GregtechItemList.Old_Tool_DataOrb.get(1L));
+ GT_ModHandler.addShapelessCraftingRecipe(
+ GregtechItemList.Old_Tool_DataOrb.get(1L),
+ GT_ModHandler.RecipeBits.NOT_REMOVABLE,
+ new Object[] {GregtechItemList.Old_Tool_DataOrb.get(1L)});
+
+ GregtechItemList.Old_Tool_DataStick.set(
+ this.addItem(208, "Data Stick [GT++]", "A Low Capacity Data Storage", new Object[] {
+ OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION, new Behaviour_DataStick()
+ }));
+ GT_ModHandler.addShapelessCraftingRecipe(
+ GregtechItemList.Old_Tool_DataStick.get(1L),
+ GT_ModHandler.RecipeBits.NOT_REMOVABLE,
+ new Object[] {GregtechItemList.Old_Tool_DataStick.get(1L)});
+
+ GregtechItemList.Old_Circuit_Board_Basic.set(this.addItem(210, "Basic Circuit Board", "A basic Board"));
+ GregtechItemList.Old_Circuit_Board_Advanced.set(
+ this.addItem(211, "Advanced Circuit Board", "An advanced Board"));
+ GregtechItemList.Old_Circuit_Board_Elite.set(this.addItem(212, "Processor Board", "A Processor Board"));
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.set(
+ this.addItem(213, "Engraved Crystal Chip", "Needed for Circuits"));
+ GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.set(
+ this.addItem(214, "Engraved Lapotron Chip", "Needed for Circuits"));
+ GregtechItemList.Old_Circuit_Parts_Advanced.set(
+ this.addItem(215, "Advanced Circuit Parts", "Advanced Circuit Parts"));
+ GregtechItemList.Old_Circuit_Parts_Wiring_Basic.set(
+ this.addItem(216, "Etched Medium Voltage Wiring", "Part of Circuit Boards"));
+ GregtechItemList.Old_Circuit_Parts_Wiring_Advanced.set(
+ this.addItem(217, "Etched High Voltage Wiring", "Part of Circuit Boards"));
+ GregtechItemList.Old_Circuit_Parts_Wiring_Elite.set(
+ this.addItem(218, "Etched Extreme Voltage Wiring", "Part of Circuit Boards"));
+ GregtechItemList.Old_Empty_Board_Basic.set(this.addItem(219, "Empty Circuit Board", "A Board Part"));
+ GregtechItemList.Old_Empty_Board_Elite.set(
+ this.addItem(220, "Empty Processor Board", "A Processor Board Part"));
+
+ return true;
+ }
+
+ public boolean registerCustomCircuits() {
+ if (CORE.ConfigSwitches.enableCustomCircuits) {
+ GregtechItemList.Circuit_IV.set(
+ this.addItem(704, "Symbiotic Circuit (IV)", "A Symbiotic Data Processor", new Object[] {
+ GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic)
+ }));
+ GregtechItemList.Circuit_LuV.set(
+ this.addItem(705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[] {
+ GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic)
+ }));
+ GregtechItemList.Circuit_ZPM.set(
+ this.addItem(706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[] {
+ GregtechOrePrefixes.circuit.get(GT_Materials.Quantum)
+ }));
+ GregtechItemList.Circuit_Board_IV.set(
+ this.addItem(710, "IV Circuit Board", "An IV Voltage Rated Circuit Board"));
+ GregtechItemList.Circuit_Board_LuV.set(
+ this.addItem(711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board"));
+ GregtechItemList.Circuit_Board_ZPM.set(
+ this.addItem(712, "ZPM Processor Board", "A ZPM Voltage Rated Processor Board"));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_IV.set(
+ this.addItem(713, "(IV) Energized Crystal Chip", "Needed for Circuits"));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.set(
+ this.addItem(714, "(LuV) Neutron based Microchip", "Needed for Circuits"));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.set(
+ this.addItem(715, "(ZPM) Quantum Chip", "Needed for Circuits"));
+ GregtechItemList.Circuit_Parts_IV.set(this.addItem(716, "(IV) Energized Circuit Parts", "Circuit Parts"));
+ GregtechItemList.Circuit_Parts_LuV.set(
+ this.addItem(717, "(LuV) Neutron-based Circuit Parts", "Circuit Parts"));
+ GregtechItemList.Circuit_Parts_ZPM.set(this.addItem(718, "(ZPM) Quantum Circuit Parts", "Circuit Parts"));
+ GregtechItemList.Circuit_Parts_Wiring_IV.set(
+ this.addItem(719, "Etched IV Voltage Wiring", "Part of Circuit Boards"));
+ GregtechItemList.Circuit_Parts_Wiring_LuV.set(
+ this.addItem(720, "Etched LuV Voltage Wiring", "Part of Circuit Boards"));
+ GregtechItemList.Circuit_Parts_Wiring_ZPM.set(
+ this.addItem(721, "Etched ZPM Voltage Wiring", "Part of Circuit Boards"));
+ ItemUtils.addItemToOreDictionary(GregtechItemList.Circuit_IV.get(1), "circuitSuperconductor");
+ ItemUtils.addItemToOreDictionary(GregtechItemList.Circuit_LuV.get(1), "circuitInfinite");
+ return true;
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
index 14100d1599..0e937a9485 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.items;
-import java.lang.reflect.Field;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.ToolDictNames;
@@ -15,87 +13,112 @@ import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_Choocher;
import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_ElectricButcherKnife;
import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_ElectricLighter;
import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_ElectricSnips;
+import java.lang.reflect.Field;
public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool {
- public static final short ELECTRIC_LIGHTER = 7534;
- public static final short ELECTRIC_BUTCHER_KNIFE = 7634;
- public static final short SKOOKUM_CHOOCHER = 7734;
- public static final short ANGLE_GRINDER = 7834;
- public static final short ELECTRIC_SNIPS = 7934;
- public static GT_MetaGenerated_Tool INSTANCE;
-
- static {
- INSTANCE = new MetaGeneratedGregtechTools();
- }
-
- public static GT_MetaGenerated_Tool getInstance() {
- return INSTANCE;
- }
-
+ public static final short ELECTRIC_LIGHTER = 7534;
+ public static final short ELECTRIC_BUTCHER_KNIFE = 7634;
+ public static final short SKOOKUM_CHOOCHER = 7734;
+ public static final short ANGLE_GRINDER = 7834;
+ public static final short ELECTRIC_SNIPS = 7934;
+ public static GT_MetaGenerated_Tool INSTANCE;
+
+ static {
+ INSTANCE = new MetaGeneratedGregtechTools();
+ }
- private MetaGeneratedGregtechTools() {
- super("plusplus.metatool.01");
- // Skookum Choocher
- GregTech_API.registerTool(this.addTool(SKOOKUM_CHOOCHER, "Skookum Choocher",
- "Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.", new TOOL_Gregtech_Choocher(),
- new Object[] { GregtechToolDictNames.craftingToolSkookumChoocher, ToolDictNames.craftingToolHardHammer,
- ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) }),
- GregTech_API.sWrenchList);
+ public static GT_MetaGenerated_Tool getInstance() {
+ return INSTANCE;
+ }
- // Electric File
- this.addTool(ANGLE_GRINDER, "Angle Grinder", "Hand-held electric filing device",
- new TOOL_Gregtech_AngleGrinder(),
- new Object[] { GregtechToolDictNames.craftingToolAngleGrinder, ToolDictNames.craftingToolFile,
- new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) });
+ private MetaGeneratedGregtechTools() {
+ super("plusplus.metatool.01");
+ // Skookum Choocher
+ GregTech_API.registerTool(
+ this.addTool(
+ SKOOKUM_CHOOCHER,
+ "Skookum Choocher",
+ "Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.",
+ new TOOL_Gregtech_Choocher(),
+ new Object[] {
+ GregtechToolDictNames.craftingToolSkookumChoocher,
+ ToolDictNames.craftingToolHardHammer,
+ ToolDictNames.craftingToolWrench,
+ new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)
+ }),
+ GregTech_API.sWrenchList);
- GT_HashSet<GT_ItemStack> aWireCutterList = new GT_HashSet<GT_ItemStack>();
- //Does not exist prior to 5.09.32, use an empty field if we can't find the existing one.
- if (ReflectionUtils.doesFieldExist(GregTech_API.class, "sWireCutterList")) {
- Field sWireCutterList = ReflectionUtils.getField(GregTech_API.class, "sWireCutterList");
- try {
- if (sWireCutterList != null) {
- Object val = sWireCutterList.get(null);
- if (val != null && val instanceof GT_HashSet) {
- aWireCutterList = (GT_HashSet<GT_ItemStack>) val;
- }
- }
-
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
- // Not found, so it's GT 5.09.31 or earlier.
- }
- }
+ // Electric File
+ this.addTool(
+ ANGLE_GRINDER,
+ "Angle Grinder",
+ "Hand-held electric filing device",
+ new TOOL_Gregtech_AngleGrinder(),
+ new Object[] {
+ GregtechToolDictNames.craftingToolAngleGrinder,
+ ToolDictNames.craftingToolFile,
+ new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)
+ });
- // Electric Wire Cutter
- GregTech_API.registerTool(
- this.addTool(ELECTRIC_SNIPS, "Automatic Snips", "Hand-held electric wire cutter",
- new TOOL_Gregtech_ElectricSnips(),
- new Object[] { GregtechToolDictNames.craftingToolElectricSnips, ToolDictNames.craftingToolWireCutter,
- new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 4L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 4L) }), aWireCutterList);
+ GT_HashSet<GT_ItemStack> aWireCutterList = new GT_HashSet<GT_ItemStack>();
+ // Does not exist prior to 5.09.32, use an empty field if we can't find the existing one.
+ if (ReflectionUtils.doesFieldExist(GregTech_API.class, "sWireCutterList")) {
+ Field sWireCutterList = ReflectionUtils.getField(GregTech_API.class, "sWireCutterList");
+ try {
+ if (sWireCutterList != null) {
+ Object val = sWireCutterList.get(null);
+ if (val != null && val instanceof GT_HashSet) {
+ aWireCutterList = (GT_HashSet<GT_ItemStack>) val;
+ }
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ // Not found, so it's GT 5.09.31 or earlier.
+ }
+ }
- // Electric Lighter
- this.addTool(ELECTRIC_LIGHTER, "Pyromatic 9k", "Electric Fire!",
- new TOOL_Gregtech_ElectricLighter(),
- new Object[] { GregtechToolDictNames.craftingToolElectricLighter,
- new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) });
+ // Electric Wire Cutter
+ GregTech_API.registerTool(
+ this.addTool(
+ ELECTRIC_SNIPS,
+ "Automatic Snips",
+ "Hand-held electric wire cutter",
+ new TOOL_Gregtech_ElectricSnips(),
+ new Object[] {
+ GregtechToolDictNames.craftingToolElectricSnips,
+ ToolDictNames.craftingToolWireCutter,
+ new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 4L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 4L)
+ }),
+ aWireCutterList);
- // Electric Butcher Knife
- this.addTool(ELECTRIC_BUTCHER_KNIFE, "Meat-o-matic", "Electric butcher knife",
- new TOOL_Gregtech_ElectricButcherKnife(),
- new Object[] { GregtechToolDictNames.craftingToolElectricButcherKnife, ToolDictNames.craftingToolKnife,
- new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) });
- }
+ // Electric Lighter
+ this.addTool(
+ ELECTRIC_LIGHTER, "Pyromatic 9k", "Electric Fire!", new TOOL_Gregtech_ElectricLighter(), new Object[] {
+ GregtechToolDictNames.craftingToolElectricLighter,
+ new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)
+ });
+ // Electric Butcher Knife
+ this.addTool(
+ ELECTRIC_BUTCHER_KNIFE,
+ "Meat-o-matic",
+ "Electric butcher knife",
+ new TOOL_Gregtech_ElectricButcherKnife(),
+ new Object[] {
+ GregtechToolDictNames.craftingToolElectricButcherKnife,
+ ToolDictNames.craftingToolKnife,
+ new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)
+ });
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java
index f82e0e5cb0..ef72c5edd4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java
@@ -1,11 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.items.behaviours;
-import java.util.List;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.items.behaviors.Behaviour_None;
@@ -13,76 +7,89 @@ import gregtech.common.items.behaviors.Behaviour_Wrench;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.NBTUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.List;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public class Behaviour_Choocher extends Behaviour_None {
+ private boolean isWrench = true;
+ private final Behaviour_Wrench wrench = new Behaviour_Wrench(150);
+ private final Behaviour_Prospecting_Ex prospecting = new Behaviour_Prospecting_Ex(10, 1250);
+ private final String mTooltip1 =
+ GT_LanguageManager.addStringLocalization("gt.behaviour.choochering1", "Current tool mode: ");
+ private final String mTooltip2 = GT_LanguageManager.addStringLocalization(
+ "gt.behaviour.choochering2", "Change tool mode using Shift+Rightclick.");
+ private final String mTooltipH = GT_LanguageManager.addStringLocalization(
+ "gt.behaviour.prospectingEx", "Usable for Prospecting large areas.");
+ private final String mTooltipW =
+ GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick.");
-public class Behaviour_Choocher
-extends Behaviour_None {
- private boolean isWrench = true;
- private final Behaviour_Wrench wrench = new Behaviour_Wrench(150);
- private final Behaviour_Prospecting_Ex prospecting = new Behaviour_Prospecting_Ex(10, 1250);
- private final String mTooltip1 = GT_LanguageManager.addStringLocalization("gt.behaviour.choochering1", "Current tool mode: ");
- private final String mTooltip2 = GT_LanguageManager.addStringLocalization("gt.behaviour.choochering2", "Change tool mode using Shift+Rightclick.");
- private final String mTooltipH = GT_LanguageManager.addStringLocalization("gt.behaviour.prospectingEx", "Usable for Prospecting large areas.");
- private final String mTooltipW = GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick.");
+ public Behaviour_Choocher() {}
- public Behaviour_Choocher() {
+ @Override
+ public boolean onItemUseFirst(
+ final GT_MetaBase_Item aItem,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final World aWorld,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final int aSide,
+ final float hitX,
+ final float hitY,
+ final float hitZ) {
+ if (aWorld.isRemote) {
+ return false;
+ }
- }
+ boolean inWrenchMode;
+ if (NBTUtils.hasKey(aStack, "aMode")) {
+ inWrenchMode = NBTUtils.getBoolean(aStack, "aMode");
+ } else {
+ aStack.getTagCompound().setBoolean("aMode", true);
+ inWrenchMode = true;
+ }
- @Override
- public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
-
- boolean inWrenchMode;
- if (NBTUtils.hasKey(aStack, "aMode")) {
- inWrenchMode = NBTUtils.getBoolean(aStack, "aMode");
- }
- else {
- aStack.getTagCompound().setBoolean("aMode", true);
- inWrenchMode = true;
- }
-
- if (aPlayer.isSneaking()){
- boolean aModeNew = Utils.invertBoolean(inWrenchMode);
- aStack.getTagCompound().setBoolean("aMode", aModeNew);
- PlayerUtils.messagePlayer(aPlayer, "Mode: "+(aModeNew ? "Wrench" : "Hammer"));
- return true;
- }
- else {
- if (inWrenchMode){
- return this.wrench.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aSide, aSide, aSide, aSide, hitZ, hitZ, hitZ);
- }
- else {
- return this.prospecting.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ);
- }
- }
- }
+ if (aPlayer.isSneaking()) {
+ boolean aModeNew = Utils.invertBoolean(inWrenchMode);
+ aStack.getTagCompound().setBoolean("aMode", aModeNew);
+ PlayerUtils.messagePlayer(aPlayer, "Mode: " + (aModeNew ? "Wrench" : "Hammer"));
+ return true;
+ } else {
+ if (inWrenchMode) {
+ return this.wrench.onItemUseFirst(
+ aItem, aStack, aPlayer, aWorld, aSide, aSide, aSide, aSide, hitZ, hitZ, hitZ);
+ } else {
+ return this.prospecting.onItemUseFirst(
+ aItem, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ);
+ }
+ }
+ }
- @Override
- public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) {
+ @Override
+ public List<String> getAdditionalToolTips(
+ final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) {
- boolean inWrenchMode;
- if (NBTUtils.hasKey(aStack, "aMode")) {
- inWrenchMode = NBTUtils.getBoolean(aStack, "aMode");
- }
- else {
- NBTUtils.setBoolean(aStack, "aMode", true);
- aStack.getTagCompound().setBoolean("aMode", true);
- inWrenchMode = true;
- }
-
+ boolean inWrenchMode;
+ if (NBTUtils.hasKey(aStack, "aMode")) {
+ inWrenchMode = NBTUtils.getBoolean(aStack, "aMode");
+ } else {
+ NBTUtils.setBoolean(aStack, "aMode", true);
+ aStack.getTagCompound().setBoolean("aMode", true);
+ inWrenchMode = true;
+ }
- if (inWrenchMode){
- aList.add(this.mTooltip1+"Wrench");
- aList.add(this.mTooltipW);
- }
- else {
- aList.add(this.mTooltip1+"Prospecting");
- aList.add(this.mTooltipH);
- }
- aList.add(this.mTooltip2);
+ if (inWrenchMode) {
+ aList.add(this.mTooltip1 + "Wrench");
+ aList.add(this.mTooltipW);
+ } else {
+ aList.add(this.mTooltip1 + "Prospecting");
+ aList.add(this.mTooltipH);
+ }
+ aList.add(this.mTooltip2);
- return aList;
- }
+ return aList;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java
index 422a29c34e..922c09c1eb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.items.behaviours;
-import java.util.List;
-
import codechicken.lib.math.MathHelper;
import gregtech.api.GregTech_API;
import gregtech.api.items.GT_MetaBase_Item;
@@ -17,6 +15,7 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import ic2.api.item.IElectricItemManager;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
@@ -28,193 +27,214 @@ import net.minecraftforge.common.util.ForgeDirection;
public class Behaviour_Electric_Lighter extends Behaviour_None {
- private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.tooltip",
- "Can light things on Fire");
- private final String mTooltipUses = GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.uses",
- "Remaining Uses:");
- private final String mTooltipUnstackable = GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable",
- "Not usable when stacked!");
-
- public Behaviour_Electric_Lighter() {
-
- }
+ private final String mTooltip =
+ GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire");
+ private final String mTooltipUses =
+ GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:");
+ private final String mTooltipUnstackable =
+ GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!");
- public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
- if (!aPlayer.worldObj.isRemote && aStack != null && aStack.stackSize == 1) {
- boolean rOutput = false;
- if (aEntity instanceof EntityCreeper) {
- if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) {
- GT_Utility.sendSoundToPlayers(aPlayer.worldObj, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F,
- MathHelper.floor_double(aEntity.posX), MathHelper.floor_double(aEntity.posY),
- MathHelper.floor_double(aEntity.posZ));
- ((EntityCreeper) aEntity).func_146079_cb();
- rOutput = true;
- }
- }
- return rOutput;
- } else {
- return false;
- }
- }
+ public Behaviour_Electric_Lighter() {}
- public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX,
- int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) {
- if (aPlayer.isSneaking()) {
- Logger.INFO("Changing Mode");
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
- Logger.INFO("Is currently in Fireball mode? "+aCurrentMode);
- boolean aNewMode = Utils.invertBoolean(aCurrentMode);
- Logger.INFO("Is now set to Fireball mode? "+aNewMode);
- aStack.getTagCompound().setBoolean("aFireballMod", aNewMode);
- //NBTUtils.setBoolean(aStack, "aFireballMode", aNewMode);
- PlayerUtils.messagePlayer(aPlayer, "Current Mode: "+EnumChatFormatting.RED+(aNewMode ? "Projectile" : "Fire Starter"));
- }
- else {
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
- if (aCurrentMode) {
- //Shoot Lightning Attack
- aWorld.playSoundAtEntity(aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F));
- if (!aWorld.isRemote) {
- aWorld.spawnEntityInWorld(new EntityLightningAttack(aWorld, aPlayer, hitX, hitY, hitZ));
- }
- }
- else {
- //Lights Fires Mode
- Logger.WARNING("Preparing Lighter a");
- boolean rOutput = false;
- ForgeDirection tDirection = ForgeDirection.getOrientation(aSide);
- aX += tDirection.offsetX;
- aY += tDirection.offsetY;
- aZ += tDirection.offsetZ;
- if (GT_Utility.isBlockAir(aWorld, aX, aY, aZ) && aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack)) {
- Logger.WARNING("Preparing Lighter b");
- if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) {
- Logger.WARNING("Preparing Lighter c");
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, aX, aY,
- aZ);
- aWorld.setBlock(aX, aY, aZ, Blocks.fire);
- rOutput = true;
- // ItemNBT.setLighterFuel(aStack, tFuelAmount);
- return rOutput;
- }
- }
- }
- }
- }
- Logger.WARNING("Preparing Lighter z");
- return false;
- }
+ public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ if (!aPlayer.worldObj.isRemote && aStack != null && aStack.stackSize == 1) {
+ boolean rOutput = false;
+ if (aEntity instanceof EntityCreeper) {
+ if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) {
+ GT_Utility.sendSoundToPlayers(
+ aPlayer.worldObj,
+ (String) GregTech_API.sSoundList.get(6),
+ 1.0F,
+ 1.0F,
+ MathHelper.floor_double(aEntity.posX),
+ MathHelper.floor_double(aEntity.posY),
+ MathHelper.floor_double(aEntity.posZ));
+ ((EntityCreeper) aEntity).func_146079_cb();
+ rOutput = true;
+ }
+ }
+ return rOutput;
+ } else {
+ return false;
+ }
+ }
- public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX,
- int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) {
- if (aPlayer.isSneaking()) {
- Logger.INFO("Changing Mode");
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
- Logger.INFO("Is currently in Fireball mode? "+aCurrentMode);
- boolean aNewMode = Utils.invertBoolean(aCurrentMode);
- Logger.INFO("Is now set to Fireball mode? "+aNewMode);
- aStack.getTagCompound().setBoolean("aFireballMode", aNewMode);
- //NBTUtils.setBoolean(aStack, "aFireballMode", aNewMode);
- PlayerUtils.messagePlayer(aPlayer, "Current Mode: "+EnumChatFormatting.RED+(aNewMode ? "Projectile" : "Fire Starter"));
- }
- else {
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
- if (aCurrentMode) {
- //Shoot Lightning Attack
- aWorld.playSoundAtEntity(aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F));
- if (!aWorld.isRemote) {
- aWorld.spawnEntityInWorld(new EntityLightningAttack(aWorld, aPlayer, hitX, hitY, hitZ));
- }
- }
- else {
- //Lights Fires Mode
- Logger.WARNING("Preparing Lighter a");
- boolean rOutput = false;
- ForgeDirection tDirection = ForgeDirection.getOrientation(aSide);
- aX += tDirection.offsetX;
- aY += tDirection.offsetY;
- aZ += tDirection.offsetZ;
- if (GT_Utility.isBlockAir(aWorld, aX, aY, aZ) && aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack)) {
- Logger.WARNING("Preparing Lighter b");
- if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) {
- Logger.WARNING("Preparing Lighter c");
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, aX, aY,
- aZ);
- aWorld.setBlock(aX, aY, aZ, Blocks.fire);
- rOutput = true;
- // ItemNBT.setLighterFuel(aStack, tFuelAmount);
- return rOutput;
- }
- }
- }
- }
- }
- Logger.WARNING("Preparing Lighter z");
- return false;
- }
+ public boolean onItemUse(
+ GT_MetaBase_Item aItem,
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ int aSide,
+ float hitX,
+ float hitY,
+ float hitZ) {
+ if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) {
+ if (aPlayer.isSneaking()) {
+ Logger.INFO("Changing Mode");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
+ Logger.INFO("Is currently in Fireball mode? " + aCurrentMode);
+ boolean aNewMode = Utils.invertBoolean(aCurrentMode);
+ Logger.INFO("Is now set to Fireball mode? " + aNewMode);
+ aStack.getTagCompound().setBoolean("aFireballMod", aNewMode);
+ // NBTUtils.setBoolean(aStack, "aFireballMode", aNewMode);
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "Current Mode: " + EnumChatFormatting.RED + (aNewMode ? "Projectile" : "Fire Starter"));
+ } else {
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
+ if (aCurrentMode) {
+ // Shoot Lightning Attack
+ aWorld.playSoundAtEntity(
+ aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F));
+ if (!aWorld.isRemote) {
+ aWorld.spawnEntityInWorld(new EntityLightningAttack(aWorld, aPlayer, hitX, hitY, hitZ));
+ }
+ } else {
+ // Lights Fires Mode
+ Logger.WARNING("Preparing Lighter a");
+ boolean rOutput = false;
+ ForgeDirection tDirection = ForgeDirection.getOrientation(aSide);
+ aX += tDirection.offsetX;
+ aY += tDirection.offsetY;
+ aZ += tDirection.offsetZ;
+ if (GT_Utility.isBlockAir(aWorld, aX, aY, aZ) && aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack)) {
+ Logger.WARNING("Preparing Lighter b");
+ if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) {
+ Logger.WARNING("Preparing Lighter c");
+ GT_Utility.sendSoundToPlayers(
+ aWorld, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, aX, aY, aZ);
+ aWorld.setBlock(aX, aY, aZ, Blocks.fire);
+ rOutput = true;
+ // ItemNBT.setLighterFuel(aStack, tFuelAmount);
+ return rOutput;
+ }
+ }
+ }
+ }
+ }
+ Logger.WARNING("Preparing Lighter z");
+ return false;
+ }
- private boolean prepare(ItemStack aStack) {
- if (aStack != null) {
- Logger.WARNING("Preparing Lighter 1");
- if (aStack.getItem() instanceof MetaGeneratedGregtechTools) {
- Logger.WARNING("Preparing Lighter 2");
- if (ChargingHelper.isItemValid(aStack)) {
- Logger.WARNING("Preparing Lighter 3");
- if (aStack.getItem() instanceof IElectricItemManager) {
- Logger.WARNING("Preparing Lighter 4");
- IElectricItemManager aItemElec = (IElectricItemManager) aStack.getItem();
- double aCharge = aItemElec.getCharge(aStack);
- long aEuCost = 4096 * 2;
- if (aCharge >= aEuCost) {
- Logger.WARNING("Preparing Lighter 5");
- aItemElec.discharge(aStack, aEuCost, 3, true, true, false);
- return true;
- }
- }
- }
- }
- }
- Logger.WARNING("Preparing Lighter 0");
- return false;
- }
+ public boolean onItemUseFirst(
+ GT_MetaBase_Item aItem,
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ int aSide,
+ float hitX,
+ float hitY,
+ float hitZ) {
+ if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) {
+ if (aPlayer.isSneaking()) {
+ Logger.INFO("Changing Mode");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
+ Logger.INFO("Is currently in Fireball mode? " + aCurrentMode);
+ boolean aNewMode = Utils.invertBoolean(aCurrentMode);
+ Logger.INFO("Is now set to Fireball mode? " + aNewMode);
+ aStack.getTagCompound().setBoolean("aFireballMode", aNewMode);
+ // NBTUtils.setBoolean(aStack, "aFireballMode", aNewMode);
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "Current Mode: " + EnumChatFormatting.RED + (aNewMode ? "Projectile" : "Fire Starter"));
+ } else {
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
+ if (aCurrentMode) {
+ // Shoot Lightning Attack
+ aWorld.playSoundAtEntity(
+ aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F));
+ if (!aWorld.isRemote) {
+ aWorld.spawnEntityInWorld(new EntityLightningAttack(aWorld, aPlayer, hitX, hitY, hitZ));
+ }
+ } else {
+ // Lights Fires Mode
+ Logger.WARNING("Preparing Lighter a");
+ boolean rOutput = false;
+ ForgeDirection tDirection = ForgeDirection.getOrientation(aSide);
+ aX += tDirection.offsetX;
+ aY += tDirection.offsetY;
+ aZ += tDirection.offsetZ;
+ if (GT_Utility.isBlockAir(aWorld, aX, aY, aZ) && aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack)) {
+ Logger.WARNING("Preparing Lighter b");
+ if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) {
+ Logger.WARNING("Preparing Lighter c");
+ GT_Utility.sendSoundToPlayers(
+ aWorld, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, aX, aY, aZ);
+ aWorld.setBlock(aX, aY, aZ, Blocks.fire);
+ rOutput = true;
+ // ItemNBT.setLighterFuel(aStack, tFuelAmount);
+ return rOutput;
+ }
+ }
+ }
+ }
+ }
+ Logger.WARNING("Preparing Lighter z");
+ return false;
+ }
- private void useUp(ItemStack aStack) {
+ private boolean prepare(ItemStack aStack) {
+ if (aStack != null) {
+ Logger.WARNING("Preparing Lighter 1");
+ if (aStack.getItem() instanceof MetaGeneratedGregtechTools) {
+ Logger.WARNING("Preparing Lighter 2");
+ if (ChargingHelper.isItemValid(aStack)) {
+ Logger.WARNING("Preparing Lighter 3");
+ if (aStack.getItem() instanceof IElectricItemManager) {
+ Logger.WARNING("Preparing Lighter 4");
+ IElectricItemManager aItemElec = (IElectricItemManager) aStack.getItem();
+ double aCharge = aItemElec.getCharge(aStack);
+ long aEuCost = 4096 * 2;
+ if (aCharge >= aEuCost) {
+ Logger.WARNING("Preparing Lighter 5");
+ aItemElec.discharge(aStack, aEuCost, 3, true, true, false);
+ return true;
+ }
+ }
+ }
+ }
+ }
+ Logger.WARNING("Preparing Lighter 0");
+ return false;
+ }
- }
+ private void useUp(ItemStack aStack) {}
- public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
- aList.add(this.mTooltip);
- int aUses = 0;
- if (aStack != null) {
- if (aStack.getItem() instanceof MetaGeneratedGregtechTools) {
- if (ChargingHelper.isItemValid(aStack)) {
- if (aStack.getItem() instanceof IElectricItemManager) {
- IElectricItemManager aItemElec = (IElectricItemManager) aStack.getItem();
- double aCharge = aItemElec.getCharge(aStack);
- long aEuCost = 4096 * 2;
- aUses = (int) (aCharge / aEuCost);
- }
- }
- boolean aCurrentMode;
- if (!NBTUtils.hasTagCompound(aStack)) {
- NBTUtils.createEmptyTagCompound(aStack);
- }
- if (NBTUtils.hasKey(aStack, "aFireballMode")) {
- aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
- }
- else {
- aStack.getTagCompound().setBoolean("aFireballMode", false);
- aCurrentMode = false;
- }
- aList.add("Current Mode: "+EnumChatFormatting.RED+(aCurrentMode ? "Projectile" : "Fire Starter"));
- }
-
- }
+ public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
+ aList.add(this.mTooltip);
+ int aUses = 0;
+ if (aStack != null) {
+ if (aStack.getItem() instanceof MetaGeneratedGregtechTools) {
+ if (ChargingHelper.isItemValid(aStack)) {
+ if (aStack.getItem() instanceof IElectricItemManager) {
+ IElectricItemManager aItemElec = (IElectricItemManager) aStack.getItem();
+ double aCharge = aItemElec.getCharge(aStack);
+ long aEuCost = 4096 * 2;
+ aUses = (int) (aCharge / aEuCost);
+ }
+ }
+ boolean aCurrentMode;
+ if (!NBTUtils.hasTagCompound(aStack)) {
+ NBTUtils.createEmptyTagCompound(aStack);
+ }
+ if (NBTUtils.hasKey(aStack, "aFireballMode")) {
+ aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
+ } else {
+ aStack.getTagCompound().setBoolean("aFireballMode", false);
+ aCurrentMode = false;
+ }
+ aList.add("Current Mode: " + EnumChatFormatting.RED + (aCurrentMode ? "Projectile" : "Fire Starter"));
+ }
+ }
- aList.add(this.mTooltipUses + " " + aUses);
- aList.add(this.mTooltipUnstackable);
- return aList;
- }
-} \ No newline at end of file
+ aList.add(this.mTooltipUses + " " + aUses);
+ aList.add(this.mTooltipUnstackable);
+ return aList;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java
index 9012bb8cd8..a2106fe679 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java
@@ -1,10 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.items.behaviours;
-import java.util.List;
-
import gregtech.api.enums.SubTag;
import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.items.GT_MetaBase_Item;
+import java.util.List;
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -15,80 +14,99 @@ import net.minecraft.world.World;
public class Behaviour_Grinder implements IItemBehaviour<GT_MetaBase_Item> {
- @Override
- public boolean onLeftClickEntity(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, Entity var4) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean onItemUse(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, World var4, int var5, int var6,
- int var7, int var8, float var9, float var10, float var11) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean onItemUseFirst(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, World var4, int var5,
- int var6, int var7, int var8, float var9, float var10, float var11) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public ItemStack onItemRightClick(GT_MetaBase_Item var1, ItemStack var2, World var3, EntityPlayer var4) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public List<String> getAdditionalToolTips(GT_MetaBase_Item var1, List<String> var2, ItemStack var3) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void onUpdate(GT_MetaBase_Item var1, ItemStack var2, World var3, Entity var4, int var5, boolean var6) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean isItemStackUsable(GT_MetaBase_Item var1, ItemStack var2) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean canDispense(GT_MetaBase_Item var1, IBlockSource var2, ItemStack var3) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public ItemStack onDispense(GT_MetaBase_Item var1, IBlockSource var2, ItemStack var3) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean hasProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public EntityArrow getProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, double var5,
- double var7, double var9) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public EntityArrow getProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4,
- EntityLivingBase var5, float var6) {
- // TODO Auto-generated method stub
- return null;
- }
-
+ @Override
+ public boolean onLeftClickEntity(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, Entity var4) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean onItemUse(
+ GT_MetaBase_Item var1,
+ ItemStack var2,
+ EntityPlayer var3,
+ World var4,
+ int var5,
+ int var6,
+ int var7,
+ int var8,
+ float var9,
+ float var10,
+ float var11) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean onItemUseFirst(
+ GT_MetaBase_Item var1,
+ ItemStack var2,
+ EntityPlayer var3,
+ World var4,
+ int var5,
+ int var6,
+ int var7,
+ int var8,
+ float var9,
+ float var10,
+ float var11) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(GT_MetaBase_Item var1, ItemStack var2, World var3, EntityPlayer var4) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public List<String> getAdditionalToolTips(GT_MetaBase_Item var1, List<String> var2, ItemStack var3) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void onUpdate(GT_MetaBase_Item var1, ItemStack var2, World var3, Entity var4, int var5, boolean var6) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean isItemStackUsable(GT_MetaBase_Item var1, ItemStack var2) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean canDispense(GT_MetaBase_Item var1, IBlockSource var2, ItemStack var3) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public ItemStack onDispense(GT_MetaBase_Item var1, IBlockSource var2, ItemStack var3) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean hasProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public EntityArrow getProjectile(
+ GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, double var5, double var7, double var9) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public EntityArrow getProjectile(
+ GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, EntityLivingBase var5, float var6) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java
index f320bfc77d..514e1070ac 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java
@@ -1,14 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.items.behaviours;
-import java.util.Random;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.items.GT_MetaBase_Item;
@@ -20,104 +11,137 @@ import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Block_Ores;
import gregtech.common.blocks.GT_TileEntity_Ores;
import gregtech.common.items.behaviors.Behaviour_Prospecting;
-
+import java.util.Random;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.IFluidBlock;
-public class Behaviour_Prospecting_Ex
-extends Behaviour_Prospecting {
- private final int mVanillaCosts;
- private final int mEUCosts;
-
- public Behaviour_Prospecting_Ex(final int aVanillaCosts, final int aEUCosts) {
- super(aVanillaCosts, aEUCosts);
- this.mVanillaCosts = aVanillaCosts;
- this.mEUCosts = aEUCosts;
- }
+public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting {
+ private final int mVanillaCosts;
+ private final int mEUCosts;
- @Override
- public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
- final Block aBlock = aWorld.getBlock(aX, aY, aZ);
- if (aBlock == null) {
- return false;
- }
- final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
+ public Behaviour_Prospecting_Ex(final int aVanillaCosts, final int aEUCosts) {
+ super(aVanillaCosts, aEUCosts);
+ this.mVanillaCosts = aVanillaCosts;
+ this.mEUCosts = aEUCosts;
+ }
+ @Override
+ public boolean onItemUseFirst(
+ final GT_MetaBase_Item aItem,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final World aWorld,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final int aSide,
+ final float hitX,
+ final float hitY,
+ final float hitZ) {
+ if (aWorld.isRemote) {
+ return false;
+ }
+ final Block aBlock = aWorld.getBlock(aX, aY, aZ);
+ if (aBlock == null) {
+ return false;
+ }
+ final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
- ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
- if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
- GT_Utility.sendChatToPlayer(aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
- return true;
- }
- if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt)) ||(aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.grass)) ) {
- if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
- int tX = aX;
- int tY = aY;
- int tZ = aZ;
- int tMetaID = 0;
- final int tQuality = ((aItem instanceof GT_MetaGenerated_Tool) ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0)*3;
+ ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
+ if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
+ GT_Utility.sendChatToPlayer(
+ aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ return true;
+ }
+ if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone))
+ || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites))
+ || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack))
+ || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone))
+ || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt))
+ || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.grass))) {
+ if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
+ GT_Utility.sendSoundToPlayers(
+ aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ int tX = aX;
+ int tY = aY;
+ int tZ = aZ;
+ int tMetaID = 0;
+ final int tQuality = ((aItem instanceof GT_MetaGenerated_Tool)
+ ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "")
+ : 0)
+ * 3;
- int i = 0;
- for (final int j = 6 + tQuality; i < j; i++) {
- tX -= ForgeDirection.getOrientation(aSide).offsetX;
- tY -= ForgeDirection.getOrientation(aSide).offsetY;
- tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
+ int i = 0;
+ for (final int j = 6 + tQuality; i < j; i++) {
+ tX -= ForgeDirection.getOrientation(aSide).offsetX;
+ tY -= ForgeDirection.getOrientation(aSide).offsetY;
+ tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
- final Block tBlock = aWorld.getBlock(tX, tY, tZ);
- if ((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Block.");
- break;
- }
- if ((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock))) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Block.");
- break;
- }
- if ((tBlock == Blocks.monster_egg) || (!GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ))) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Block.");
- break;
- }
- if (tBlock != aBlock) {
- if (i >= 4) {
- break;
- }
- GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Block.");
- break;
- }
- }
- final Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide);
- i = 0;
- for (final int j = 9 + (2 * tQuality); i < j; i++) {
- tX = (aX - 4 - tQuality) + tRandom.nextInt(j);
- tY = (aY - 4 - tQuality) + tRandom.nextInt(j);
- tZ = (aZ - 4 - tQuality) + tRandom.nextInt(j);
- final Block tBlock = aWorld.getBlock(tX, tY, tZ);
- if ((tBlock instanceof GT_Block_Ores)) {
- final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
- if ((tTileEntity instanceof GT_TileEntity_Ores)) {
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
- if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
- GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore.");
- return true;
- }
- }
- } else {
- tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
- tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
- if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
- GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
- return true;
- }
- }
- }
- GT_Utility.sendChatToPlayer(aPlayer, "No Ores found.");
- }
- return true;
- }
- return false;
- }
+ final Block tBlock = aWorld.getBlock(tX, tY, tZ);
+ if ((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Block.");
+ break;
+ }
+ if ((tBlock == Blocks.water)
+ || (tBlock == Blocks.flowing_water)
+ || ((tBlock instanceof IFluidBlock))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Block.");
+ break;
+ }
+ if ((tBlock == Blocks.monster_egg) || (!GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Block.");
+ break;
+ }
+ if (tBlock != aBlock) {
+ if (i >= 4) {
+ break;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Block.");
+ break;
+ }
+ }
+ final Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide);
+ i = 0;
+ for (final int j = 9 + (2 * tQuality); i < j; i++) {
+ tX = (aX - 4 - tQuality) + tRandom.nextInt(j);
+ tY = (aY - 4 - tQuality) + tRandom.nextInt(j);
+ tZ = (aZ - 4 - tQuality) + tRandom.nextInt(j);
+ final Block tBlock = aWorld.getBlock(tX, tY, tZ);
+ if ((tBlock instanceof GT_Block_Ores)) {
+ final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
+ if ((tTileEntity instanceof GT_TileEntity_Ores)) {
+ final Materials tMaterial = GregTech_API.sGeneratedMaterials[
+ (((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
+ if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
+ GT_Utility.sendChatToPlayer(
+ aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore.");
+ return true;
+ }
+ }
+ } else {
+ tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
+ tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
+ if ((tAssotiation != null)
+ && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
+ GT_Utility.sendChatToPlayer(
+ aPlayer,
+ "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
+ return true;
+ }
+ }
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "No Ores found.");
+ }
+ return true;
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java
index 7af057bc59..b1f2309b69 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java
@@ -12,29 +12,36 @@ import net.minecraft.util.IIcon;
public class MetaItemCoverCasings extends MetaCustomCoverItem {
- public MetaItemCoverCasings() {
- super(CORE.MODID, Textures.BlockIcons.MACHINECASINGS_SIDE.length, "Gt Machine Casings", Textures.BlockIcons.MACHINECASINGS_SIDE, null);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- for (int i = 0; i < icons.length; i++) {
- this.icons[i] = reg.registerIcon(CORE.MODID+":"+"covers/"+i);
- }
- }
-
- public boolean hide() {
- return false;
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[MathUtils.balance(meta, 0, 15)];
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- return EnumChatFormatting.LIGHT_PURPLE + GT_Values.VOLTAGE_NAMES[MathUtils.balance(tItem.getItemDamage(), 0, GT_Values.VOLTAGE_NAMES.length-1)]+" Machine Plate Cover"; //super.getItemStackDisplayName(tItem);
- }
-
+ public MetaItemCoverCasings() {
+ super(
+ CORE.MODID,
+ Textures.BlockIcons.MACHINECASINGS_SIDE.length,
+ "Gt Machine Casings",
+ Textures.BlockIcons.MACHINECASINGS_SIDE,
+ null);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ for (int i = 0; i < icons.length; i++) {
+ this.icons[i] = reg.registerIcon(CORE.MODID + ":" + "covers/" + i);
+ }
+ }
+
+ public boolean hide() {
+ return false;
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[MathUtils.balance(meta, 0, 15)];
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ return EnumChatFormatting.LIGHT_PURPLE
+ + GT_Values.VOLTAGE_NAMES[
+ MathUtils.balance(tItem.getItemDamage(), 0, GT_Values.VOLTAGE_NAMES.length - 1)]
+ + " Machine Plate Cover"; // super.getItemStackDisplayName(tItem);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java
index 49537ab559..384e264dcb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java
@@ -1,16 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.render;
-import java.io.*;
-import java.net.URL;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.commons.io.IOUtils;
-import org.lwjgl.opengl.GL11;
-
import com.mojang.authlib.GameProfile;
-
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -21,6 +11,11 @@ import gtPlusPlus.core.proxy.ClientProxy;
import gtPlusPlus.core.util.data.AES;
import gtPlusPlus.core.util.data.FileUtils;
import gtPlusPlus.core.util.math.MathUtils;
+import java.io.*;
+import java.net.URL;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderManager;
@@ -30,488 +25,505 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderPlayerEvent;
+import org.apache.commons.io.IOUtils;
+import org.lwjgl.opengl.GL11;
public class GTPP_CapeRenderer extends RenderPlayer {
- private static final ResourceLocation[] mCapes = {
- new ResourceLocation("miscutils:textures/OrangeHD.png"),
- new ResourceLocation("miscutils:textures/FancyCapeHD.png"),
- new ResourceLocation("miscutils:textures/TesterCapeHD.png"),
- new ResourceLocation("miscutils:textures/PatreonCapeHD.png"),
- new ResourceLocation("miscutils:textures/DevCapeHD.png"),
- };
-
- private final boolean mInit;
-
- public GTPP_CapeRenderer() {
- mInit = init();
- }
-
- private final boolean init() {
- if (mInit) {
- return false;
- }
- return CapeUtils.init();
- }
-
- private static boolean hasResourceChecked = false;
- private static boolean hasSetRenderer = false;
- private boolean hasCape = false;
- private ResourceLocation tResource = null;
-
- public synchronized void receiveRenderSpecialsEvent(RenderPlayerEvent.Specials.Pre aEvent) {
-
- // Check we have set Render Manager
- if (this.renderManager == null) {
- hasSetRenderer = false;
- }
-
- // Set Render Manager
- if (!hasSetRenderer) {
- if (RenderManager.instance != null) {
- setRenderManager(RenderManager.instance);
- hasSetRenderer = true;
- }
- }
-
- // Actually Render
- if (hasSetRenderer) {
-
- // We have capes turned off, so let's not render.
- if (!ConfigSwitches.enableCustomCapes) {
- return;
- }
-
- // We have already checked if this player has a cape, but since they do not, we best not render.
- if (hasResourceChecked) {
- if (!hasCape && !CORE.DEVENV) {
- return;
- }
- }
-
- // Allocate client player object
- AbstractClientPlayer aPlayer = (AbstractClientPlayer) aEvent.entityPlayer;
-
- // Make sure we don't keep checking on clients who dont have capes.
- if (!hasResourceChecked) {
-
- // Get players UUID
- String aPlayerUUID = aPlayer != null ? aPlayer.getGameProfile().getId().toString() : "BAD";
-
- // If for whatever reason this fails, we just exit early.
- if (aPlayerUUID.equals("BAD")) {
- return;
- }
-
- // Automatically allocate a Dev cape while in Dev mode.
- if (tResource == null && CORE.DEVENV) {
- tResource = mCapes[4];
- hasCape = true;
- }
-
- String aPlayerName = ClientProxy.playerName;
-
- // Check cape lists for the cape this player owns.
- if (!hasCape) {
- for (Pair<String, String> aData : CapeUtils.mOrangeCapes) {
- if (aData.getKey().equals(aPlayerUUID) || aPlayerName .equals(aData.getValue())) {
- tResource = mCapes[0];
- hasCape = true;
- break;
- }
- }
- }
- if (!hasCape) {
- for (Pair<String, String> aData : CapeUtils.mMiscCapes) {
- if (aData.getKey().equals(aPlayerUUID) || aPlayerName .equals(aData.getValue())) {
- tResource = mCapes[1];
- hasCape = true;
- break;
- }
- }
- }
- if (!hasCape) {
- for (Pair<String, String> aData : CapeUtils.mBetaTestCapes) {
- if (aData.getKey().equals(aPlayerUUID) || aPlayerName .equals(aData.getValue())) {
- tResource = mCapes[2];
- hasCape = true;
- break;
- }
- }
- }
- if (!hasCape) {
- for (Pair<String, String> aData : CapeUtils.mPatreonCapes) {
- if (aData.getKey().equals(aPlayerUUID) || aPlayerName .equals(aData.getValue())) {
- tResource = mCapes[3];
- hasCape = true;
- break;
- }
- }
- }
- if (!hasCape) {
- for (Pair<String, String> aData : CapeUtils.mDevCapes) {
- if (aData.getKey().equals(aPlayerUUID) || aPlayerName .equals(aData.getValue())) {
- tResource = mCapes[4];
- hasCape = true;
- break;
- }
- }
- }
- hasResourceChecked = true;
- }
-
- if (hasResourceChecked) {
- // We have met all the conditions, let's render that cape.
- renderCapeOnPlayer(aEvent, aPlayer);
- }
- }
-
- }
-
- private final boolean renderCapeOnPlayer(RenderPlayerEvent.Specials.Pre aEvent, AbstractClientPlayer aPlayer) {
- float aPartialTicks = aEvent.partialRenderTick;
- try {
- if (tResource == null && CORE.DEVENV) {
- tResource = mCapes[3];
- }
-
- // If player is invisible, don't render.
- if (GT_Utility.getFullInvisibility(aPlayer) || aPlayer.isInvisible()
- || GT_Utility.getPotion(aPlayer, Integer.valueOf(Potion.invisibility.id).intValue())) {
- aEvent.setCanceled(true);
- return false;
- }
-
- if ((tResource != null) && (!aPlayer.getHideCape())) {
- bindTexture(tResource);
- GL11.glPushMatrix();
- GL11.glTranslatef(0.0F, 0.0F, 0.125F);
- double d0 = aPlayer.field_71091_bM + (aPlayer.field_71094_bP - aPlayer.field_71091_bM) * aPartialTicks
- - (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks);
- double d1 = aPlayer.field_71096_bN + (aPlayer.field_71095_bQ - aPlayer.field_71096_bN) * aPartialTicks
- - (aPlayer.prevPosY + (aPlayer.posY - aPlayer.prevPosY) * aPartialTicks);
- double d2 = aPlayer.field_71097_bO + (aPlayer.field_71085_bR - aPlayer.field_71097_bO) * aPartialTicks
- - (aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks);
- float f6 = aPlayer.prevRenderYawOffset
- + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks;
- double d3 = MathHelper.sin(f6 * CORE.PI / 180.0F);
- double d4 = -MathHelper.cos(f6 * CORE.PI / 180.0F);
- float f7 = (float) d1 * 10.0F;
- float f8 = (float) (d0 * d3 + d2 * d4) * 100.0F;
- float f9 = (float) (d0 * d4 - d2 * d3) * 100.0F;
- if (f7 < -6.0F) {
- f7 = -6.0F;
- }
- if (f7 > 32.0F) {
- f7 = 32.0F;
- }
- if (f8 < 0.0F) {
- f8 = 0.0F;
- }
- float f10 = aPlayer.prevCameraYaw + (aPlayer.cameraYaw - aPlayer.prevCameraYaw) * aPartialTicks;
- f7 += MathHelper.sin((aPlayer.prevDistanceWalkedModified
- + (aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified) * aPartialTicks) * 6.0F)
- * 32.0F * f10;
- if (aPlayer.isSneaking()) {
- f7 += 25.0F;
- }
- GL11.glRotatef(6.0F + f8 / 2.0F + f7, 1.0F, 0.0F, 0.0F);
- GL11.glRotatef(f9 / 2.0F, 0.0F, 0.0F, 1.0F);
- GL11.glRotatef(-f9 / 2.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
- ((ModelBiped) this.mainModel).renderCloak(0.0625F);
- GL11.glPopMatrix();
- return true;
- }
- } catch (Throwable e) {
-
- }
- return false;
- }
-
- @SuppressWarnings("unused")
- @Deprecated
- /**
- * Should be able to get the username from a UUID
- * @param name - Players Name
- * @param uuid - Players known UUID
- * @return - The newest Player name
- */
- private String getPlayerName(String name, String uuid) {
- try {
- Logger.WORLD("[Capes++] Trying to UUID check " + name + ".");
- if (uuid != null) {
- if (uuid.length() > 0) {
- UUID g = UUID.fromString(uuid);
- if (g != null) {
- Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + ".");
- GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152652_a(g);
- if (profile != null) {
- Logger.WARNING("[Capes++] Found for UUID check: " + profile.getName() + ".");
- return profile.getName();
- }
- } else {
- g = UUID.fromString(uuid.replace("-", ""));
- if (g != null) {
- Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + ".");
- GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152652_a(g);
- if (profile != null) {
- Logger.WARNING("[Capes++] Found for UUID check 2: " + profile.getName() + ".");
- return profile.getName();
- }
- }
- }
- }
- }
- if (name != null) {
- if (name.length() > 0) {
- Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + ".");
- GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152655_a(name);
- if (profile != null) {
- Logger.WARNING("[Capes++] Found for name check: " + profile.getName() + ".");
- return profile.getName();
- }
- }
- }
- Logger.WORLD("[Capes++] Failed UUID check for " + name + ".");
- } catch (Throwable t) {
- }
- return name;
- }
-
-
-
- private static class CapeUtils {
-
- private static char SPLIT_CHARACTER = '§';
- private static AES sAES;
-
- // UUID - Username
- private static final AutoMap<Pair<String, String>> mOrangeCapes = new AutoMap<Pair<String, String>>();
- private static final AutoMap<Pair<String, String>> mMiscCapes = new AutoMap<Pair<String, String>>();
- private static final AutoMap<Pair<String, String>> mBetaTestCapes = new AutoMap<Pair<String, String>>();
- private static final AutoMap<Pair<String, String>> mPatreonCapes = new AutoMap<Pair<String, String>>();
- private static final AutoMap<Pair<String, String>> mDevCapes = new AutoMap<Pair<String, String>>();
-
- private static final boolean init() {
- CapeUtils.handleOldCapeCache();
- if (CORE.DEVENV) {
- return true;
- }
- try {
- if (shouldDownloadCapeList()) {
- downloadCapeList();
- }
- }
- catch (Exception e) {
- return false;
- }
- writeCacheToMaps();
- return true;
- }
-
-
- private static boolean shouldDownloadCapeList() {
- if (!doesCapeCacheExistLocally()) {
- return true;
- }
- if (isCapeCacheWeekOld()) {
- return true;
- }
- return false;
- }
-
- private static final boolean isCapeCacheWeekOld() {
- if (!doesCapeCacheExistLocally()) {
- return true;
- }
- else {
- File dat = CapeUtils.getCapeCache();
- Date dateLastMod = new Date(dat.lastModified());
- Date dateNow = new Date(System.currentTimeMillis() - (7l * 24 * 60 * 60 * 1000));
- if (dateLastMod.before(dateNow)) {
- return true;
- }
- }
- return false;
- }
-
- private static final void downloadCapeList() {
- try {
- File dat = getCapeCache();
- File temp = allocateTempFile();
- InputStream inputStream = new URL("https://alkcorp.overminddl1.com/CapeCache.dat").openStream();
- FileOutputStream fileOS = new FileOutputStream(temp);
- IOUtils.copy(inputStream, fileOS);
- if (isDownloadedCapeListBigger(temp)) {
- fileOS = new FileOutputStream(dat);
- IOUtils.copy(inputStream, fileOS);
- }
- } catch (Throwable t) {
- Logger.INFO("Unable to download GT++ cape list.");
- }
- }
-
- private static final boolean isDownloadedCapeListBigger(File aFile) {
- double aExistingFileSize = (doesCapeCacheExistLocally() ? getCapeCache().length() : 0);
- double aNewFileSize = aFile.length();
- if (aNewFileSize > aExistingFileSize) {
- return true;
- }
- return false;
- }
-
- private static void handleOldCapeCache() {
- File aCacheFile = FileUtils.getFile("GTPP", "dat");
- if (FileUtils.doesFileExist(aCacheFile)) {
- aCacheFile.delete();
- }
- }
-
- private static final boolean doesCapeCacheExistLocally() {
- File aCacheFile = FileUtils.getFile("CapeCache", "dat");
- if (FileUtils.doesFileExist(aCacheFile)) {
- return true;
- }
- return false;
- }
-
- private static final File getCapeCache() {
- File aCacheFile = FileUtils.getFile("CapeCache", "dat");
- if (FileUtils.doesFileExist(aCacheFile)) {
- FileUtils.createFile(aCacheFile);
- }
- return aCacheFile;
- }
-
- public static final List<String> getDataFromCache(){
- File aCacheFile = getCapeCache();
- List<String> aCache = FileUtils.readLines(aCacheFile);
- if (aCache != null && !aCache.isEmpty()) {
- return aCache;
- }
- return new AutoMap<String>();
- }
-
- private static final File allocateTempFile() {
- File tempFile = null;
- try {
- tempFile = File.createTempFile("gtpp-", null);
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- if (tempFile == null) {
- tempFile = FileUtils.createFile("", "gtpp-"+MathUtils.randInt(Short.MAX_VALUE, (Integer.MAX_VALUE/2)), "tmp");
- }
- tempFile.deleteOnExit();
- return tempFile;
- }
-
-
- public static final void writeCacheToMaps() {
- List<String> aCacheData = getDataFromCache();
- if (aCacheData != null && !aCacheData.isEmpty()) {
- if (sAES == null) {
- sAES = new AES();
- }
- AutoMap<String> aDecodedData = new AutoMap<String>();
- for (String aToDecode : aCacheData) {
- aDecodedData.put(sAES.decode(aToDecode));
- }
- if (!aDecodedData.isEmpty()) {
- AutoMap<Pair<String, String>> aCapeType1 = new AutoMap<Pair<String, String>>();
- AutoMap<Pair<String, String>> aCapeType2 = new AutoMap<Pair<String, String>>();
- AutoMap<Pair<String, String>> aCapeType3 = new AutoMap<Pair<String, String>>();
- AutoMap<Pair<String, String>> aCapeType4 = new AutoMap<Pair<String, String>>();
- AutoMap<Pair<String, String>> aCapeType5 = new AutoMap<Pair<String, String>>();
- boolean didProcessStringData = false;
- Logger.INFO("Decoded String Count: "+aDecodedData.size());
- for (String aToSplit : aDecodedData) {
- String[] aSplitData = aToSplit.split(""+SPLIT_CHARACTER);
- if (aSplitData != null && aSplitData.length >= 2) {
- if (aSplitData[0] != null) {
- Integer aCapeTypeID2 = Integer.parseInt(aSplitData[0]);
- if (aCapeTypeID2 != null) {
- int aCapeTypeID = aCapeTypeID2;
- Pair<String, String> aFinalString = new Pair<String, String>("UUID: "+aSplitData[1], "Username: "+(aSplitData[2] != null && aSplitData[0].length() > 0 ? aSplitData[2] : "Not Specified"));
- Logger.INFO("Cape Type: "+aCapeTypeID);
- switch (aCapeTypeID) {
- case 0:
- aCapeType1.add(aFinalString);
- Logger.INFO("Added user to map "+aCapeTypeID+", map now holds "+aCapeType1.size()+" users.");
- break;
- case 1:
- aCapeType2.add(aFinalString);
- Logger.INFO("Added user to map "+aCapeTypeID+", map now holds "+aCapeType2.size()+" users.");
- break;
- case 2:
- aCapeType3.add(aFinalString);
- Logger.INFO("Added user to map "+aCapeTypeID+", map now holds "+aCapeType3.size()+" users.");
- break;
- case 3:
- aCapeType4.add(aFinalString);
- Logger.INFO("Added user to map "+aCapeTypeID+", map now holds "+aCapeType4.size()+" users.");
- break;
- case 4:
- aCapeType5.add(aFinalString);
- Logger.INFO("Added user to map "+aCapeTypeID+", map now holds "+aCapeType5.size()+" users.");
- break;
- default:
- break;
- }
- }
- }
- }
- }
- if (!aCapeType1.isEmpty() || !aCapeType2.isEmpty() || !aCapeType3.isEmpty() || !aCapeType4.isEmpty() || !aCapeType5.isEmpty()) {
- didProcessStringData = true;
- }
- else {
- // did not process any data
- }
- if (didProcessStringData) {
- if (!aCapeType1.isEmpty()) {
- for (Pair<String, String> aUser : aCapeType1) {
- Logger.INFO("Adding Generic cape for "+aUser.getKey());
- mOrangeCapes.add(aUser);
- }
- }
- if (!aCapeType2.isEmpty()) {
- for (Pair<String, String> aUser : aCapeType2) {
- Logger.INFO("Adding Blue cape for "+aUser.getKey());
- mMiscCapes.add(aUser);
- }
- }
- if (!aCapeType3.isEmpty()) {
- for (Pair<String, String> aUser : aCapeType3) {
- Logger.INFO("Adding Beta cape for "+aUser.getKey());
- mBetaTestCapes.add(aUser);
- }
- }
- if (!aCapeType4.isEmpty()) {
- for (Pair<String, String> aUser : aCapeType4) {
- Logger.INFO("Adding Patreon cape for "+aUser.getKey());
- mPatreonCapes.add(aUser);
- }
- }
- if (!aCapeType5.isEmpty()) {
- for (Pair<String, String> aUser : aCapeType5) {
- Logger.INFO("Adding Dev cape for "+aUser.getKey());
- mDevCapes.add(aUser);
- }
- }
- }
- }
- else {
- // No data decoded
- }
- }
- else {
- // Nothing was cached?
- }
- }
- }
-
-
-} \ No newline at end of file
+ private static final ResourceLocation[] mCapes = {
+ new ResourceLocation("miscutils:textures/OrangeHD.png"),
+ new ResourceLocation("miscutils:textures/FancyCapeHD.png"),
+ new ResourceLocation("miscutils:textures/TesterCapeHD.png"),
+ new ResourceLocation("miscutils:textures/PatreonCapeHD.png"),
+ new ResourceLocation("miscutils:textures/DevCapeHD.png"),
+ };
+
+ private final boolean mInit;
+
+ public GTPP_CapeRenderer() {
+ mInit = init();
+ }
+
+ private final boolean init() {
+ if (mInit) {
+ return false;
+ }
+ return CapeUtils.init();
+ }
+
+ private static boolean hasResourceChecked = false;
+ private static boolean hasSetRenderer = false;
+ private boolean hasCape = false;
+ private ResourceLocation tResource = null;
+
+ public synchronized void receiveRenderSpecialsEvent(RenderPlayerEvent.Specials.Pre aEvent) {
+
+ // Check we have set Render Manager
+ if (this.renderManager == null) {
+ hasSetRenderer = false;
+ }
+
+ // Set Render Manager
+ if (!hasSetRenderer) {
+ if (RenderManager.instance != null) {
+ setRenderManager(RenderManager.instance);
+ hasSetRenderer = true;
+ }
+ }
+
+ // Actually Render
+ if (hasSetRenderer) {
+
+ // We have capes turned off, so let's not render.
+ if (!ConfigSwitches.enableCustomCapes) {
+ return;
+ }
+
+ // We have already checked if this player has a cape, but since they do not, we best not render.
+ if (hasResourceChecked) {
+ if (!hasCape && !CORE.DEVENV) {
+ return;
+ }
+ }
+
+ // Allocate client player object
+ AbstractClientPlayer aPlayer = (AbstractClientPlayer) aEvent.entityPlayer;
+
+ // Make sure we don't keep checking on clients who dont have capes.
+ if (!hasResourceChecked) {
+
+ // Get players UUID
+ String aPlayerUUID =
+ aPlayer != null ? aPlayer.getGameProfile().getId().toString() : "BAD";
+
+ // If for whatever reason this fails, we just exit early.
+ if (aPlayerUUID.equals("BAD")) {
+ return;
+ }
+
+ // Automatically allocate a Dev cape while in Dev mode.
+ if (tResource == null && CORE.DEVENV) {
+ tResource = mCapes[4];
+ hasCape = true;
+ }
+
+ String aPlayerName = ClientProxy.playerName;
+
+ // Check cape lists for the cape this player owns.
+ if (!hasCape) {
+ for (Pair<String, String> aData : CapeUtils.mOrangeCapes) {
+ if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) {
+ tResource = mCapes[0];
+ hasCape = true;
+ break;
+ }
+ }
+ }
+ if (!hasCape) {
+ for (Pair<String, String> aData : CapeUtils.mMiscCapes) {
+ if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) {
+ tResource = mCapes[1];
+ hasCape = true;
+ break;
+ }
+ }
+ }
+ if (!hasCape) {
+ for (Pair<String, String> aData : CapeUtils.mBetaTestCapes) {
+ if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) {
+ tResource = mCapes[2];
+ hasCape = true;
+ break;
+ }
+ }
+ }
+ if (!hasCape) {
+ for (Pair<String, String> aData : CapeUtils.mPatreonCapes) {
+ if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) {
+ tResource = mCapes[3];
+ hasCape = true;
+ break;
+ }
+ }
+ }
+ if (!hasCape) {
+ for (Pair<String, String> aData : CapeUtils.mDevCapes) {
+ if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) {
+ tResource = mCapes[4];
+ hasCape = true;
+ break;
+ }
+ }
+ }
+ hasResourceChecked = true;
+ }
+
+ if (hasResourceChecked) {
+ // We have met all the conditions, let's render that cape.
+ renderCapeOnPlayer(aEvent, aPlayer);
+ }
+ }
+ }
+
+ private final boolean renderCapeOnPlayer(RenderPlayerEvent.Specials.Pre aEvent, AbstractClientPlayer aPlayer) {
+ float aPartialTicks = aEvent.partialRenderTick;
+ try {
+ if (tResource == null && CORE.DEVENV) {
+ tResource = mCapes[3];
+ }
+
+ // If player is invisible, don't render.
+ if (GT_Utility.getFullInvisibility(aPlayer)
+ || aPlayer.isInvisible()
+ || GT_Utility.getPotion(
+ aPlayer, Integer.valueOf(Potion.invisibility.id).intValue())) {
+ aEvent.setCanceled(true);
+ return false;
+ }
+
+ if ((tResource != null) && (!aPlayer.getHideCape())) {
+ bindTexture(tResource);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(0.0F, 0.0F, 0.125F);
+ double d0 = aPlayer.field_71091_bM
+ + (aPlayer.field_71094_bP - aPlayer.field_71091_bM) * aPartialTicks
+ - (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks);
+ double d1 = aPlayer.field_71096_bN
+ + (aPlayer.field_71095_bQ - aPlayer.field_71096_bN) * aPartialTicks
+ - (aPlayer.prevPosY + (aPlayer.posY - aPlayer.prevPosY) * aPartialTicks);
+ double d2 = aPlayer.field_71097_bO
+ + (aPlayer.field_71085_bR - aPlayer.field_71097_bO) * aPartialTicks
+ - (aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks);
+ float f6 = aPlayer.prevRenderYawOffset
+ + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks;
+ double d3 = MathHelper.sin(f6 * CORE.PI / 180.0F);
+ double d4 = -MathHelper.cos(f6 * CORE.PI / 180.0F);
+ float f7 = (float) d1 * 10.0F;
+ float f8 = (float) (d0 * d3 + d2 * d4) * 100.0F;
+ float f9 = (float) (d0 * d4 - d2 * d3) * 100.0F;
+ if (f7 < -6.0F) {
+ f7 = -6.0F;
+ }
+ if (f7 > 32.0F) {
+ f7 = 32.0F;
+ }
+ if (f8 < 0.0F) {
+ f8 = 0.0F;
+ }
+ float f10 = aPlayer.prevCameraYaw + (aPlayer.cameraYaw - aPlayer.prevCameraYaw) * aPartialTicks;
+ f7 += MathHelper.sin((aPlayer.prevDistanceWalkedModified
+ + (aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified)
+ * aPartialTicks)
+ * 6.0F)
+ * 32.0F
+ * f10;
+ if (aPlayer.isSneaking()) {
+ f7 += 25.0F;
+ }
+ GL11.glRotatef(6.0F + f8 / 2.0F + f7, 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(f9 / 2.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(-f9 / 2.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
+ ((ModelBiped) this.mainModel).renderCloak(0.0625F);
+ GL11.glPopMatrix();
+ return true;
+ }
+ } catch (Throwable e) {
+
+ }
+ return false;
+ }
+
+ @SuppressWarnings("unused")
+ @Deprecated
+ /**
+ * Should be able to get the username from a UUID
+ * @param name - Players Name
+ * @param uuid - Players known UUID
+ * @return - The newest Player name
+ */
+ private String getPlayerName(String name, String uuid) {
+ try {
+ Logger.WORLD("[Capes++] Trying to UUID check " + name + ".");
+ if (uuid != null) {
+ if (uuid.length() > 0) {
+ UUID g = UUID.fromString(uuid);
+ if (g != null) {
+ Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + ".");
+ GameProfile profile =
+ MinecraftServer.getServer().func_152358_ax().func_152652_a(g);
+ if (profile != null) {
+ Logger.WARNING("[Capes++] Found for UUID check: " + profile.getName() + ".");
+ return profile.getName();
+ }
+ } else {
+ g = UUID.fromString(uuid.replace("-", ""));
+ if (g != null) {
+ Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + ".");
+ GameProfile profile =
+ MinecraftServer.getServer().func_152358_ax().func_152652_a(g);
+ if (profile != null) {
+ Logger.WARNING("[Capes++] Found for UUID check 2: " + profile.getName() + ".");
+ return profile.getName();
+ }
+ }
+ }
+ }
+ }
+ if (name != null) {
+ if (name.length() > 0) {
+ Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + ".");
+ GameProfile profile =
+ MinecraftServer.getServer().func_152358_ax().func_152655_a(name);
+ if (profile != null) {
+ Logger.WARNING("[Capes++] Found for name check: " + profile.getName() + ".");
+ return profile.getName();
+ }
+ }
+ }
+ Logger.WORLD("[Capes++] Failed UUID check for " + name + ".");
+ } catch (Throwable t) {
+ }
+ return name;
+ }
+
+ private static class CapeUtils {
+
+ private static char SPLIT_CHARACTER = '§';
+ private static AES sAES;
+
+ // UUID - Username
+ private static final AutoMap<Pair<String, String>> mOrangeCapes = new AutoMap<Pair<String, String>>();
+ private static final AutoMap<Pair<String, String>> mMiscCapes = new AutoMap<Pair<String, String>>();
+ private static final AutoMap<Pair<String, String>> mBetaTestCapes = new AutoMap<Pair<String, String>>();
+ private static final AutoMap<Pair<String, String>> mPatreonCapes = new AutoMap<Pair<String, String>>();
+ private static final AutoMap<Pair<String, String>> mDevCapes = new AutoMap<Pair<String, String>>();
+
+ private static final boolean init() {
+ CapeUtils.handleOldCapeCache();
+ if (CORE.DEVENV) {
+ return true;
+ }
+ try {
+ if (shouldDownloadCapeList()) {
+ downloadCapeList();
+ }
+ } catch (Exception e) {
+ return false;
+ }
+ writeCacheToMaps();
+ return true;
+ }
+
+ private static boolean shouldDownloadCapeList() {
+ if (!doesCapeCacheExistLocally()) {
+ return true;
+ }
+ if (isCapeCacheWeekOld()) {
+ return true;
+ }
+ return false;
+ }
+
+ private static final boolean isCapeCacheWeekOld() {
+ if (!doesCapeCacheExistLocally()) {
+ return true;
+ } else {
+ File dat = CapeUtils.getCapeCache();
+ Date dateLastMod = new Date(dat.lastModified());
+ Date dateNow = new Date(System.currentTimeMillis() - (7l * 24 * 60 * 60 * 1000));
+ if (dateLastMod.before(dateNow)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static final void downloadCapeList() {
+ try {
+ File dat = getCapeCache();
+ File temp = allocateTempFile();
+ InputStream inputStream = new URL("https://alkcorp.overminddl1.com/CapeCache.dat").openStream();
+ FileOutputStream fileOS = new FileOutputStream(temp);
+ IOUtils.copy(inputStream, fileOS);
+ if (isDownloadedCapeListBigger(temp)) {
+ fileOS = new FileOutputStream(dat);
+ IOUtils.copy(inputStream, fileOS);
+ }
+ } catch (Throwable t) {
+ Logger.INFO("Unable to download GT++ cape list.");
+ }
+ }
+
+ private static final boolean isDownloadedCapeListBigger(File aFile) {
+ double aExistingFileSize =
+ (doesCapeCacheExistLocally() ? getCapeCache().length() : 0);
+ double aNewFileSize = aFile.length();
+ if (aNewFileSize > aExistingFileSize) {
+ return true;
+ }
+ return false;
+ }
+
+ private static void handleOldCapeCache() {
+ File aCacheFile = FileUtils.getFile("GTPP", "dat");
+ if (FileUtils.doesFileExist(aCacheFile)) {
+ aCacheFile.delete();
+ }
+ }
+
+ private static final boolean doesCapeCacheExistLocally() {
+ File aCacheFile = FileUtils.getFile("CapeCache", "dat");
+ if (FileUtils.doesFileExist(aCacheFile)) {
+ return true;
+ }
+ return false;
+ }
+
+ private static final File getCapeCache() {
+ File aCacheFile = FileUtils.getFile("CapeCache", "dat");
+ if (FileUtils.doesFileExist(aCacheFile)) {
+ FileUtils.createFile(aCacheFile);
+ }
+ return aCacheFile;
+ }
+
+ public static final List<String> getDataFromCache() {
+ File aCacheFile = getCapeCache();
+ List<String> aCache = FileUtils.readLines(aCacheFile);
+ if (aCache != null && !aCache.isEmpty()) {
+ return aCache;
+ }
+ return new AutoMap<String>();
+ }
+
+ private static final File allocateTempFile() {
+ File tempFile = null;
+ try {
+ tempFile = File.createTempFile("gtpp-", null);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (tempFile == null) {
+ tempFile = FileUtils.createFile(
+ "", "gtpp-" + MathUtils.randInt(Short.MAX_VALUE, (Integer.MAX_VALUE / 2)), "tmp");
+ }
+ tempFile.deleteOnExit();
+ return tempFile;
+ }
+
+ public static final void writeCacheToMaps() {
+ List<String> aCacheData = getDataFromCache();
+ if (aCacheData != null && !aCacheData.isEmpty()) {
+ if (sAES == null) {
+ sAES = new AES();
+ }
+ AutoMap<String> aDecodedData = new AutoMap<String>();
+ for (String aToDecode : aCacheData) {
+ aDecodedData.put(sAES.decode(aToDecode));
+ }
+ if (!aDecodedData.isEmpty()) {
+ AutoMap<Pair<String, String>> aCapeType1 = new AutoMap<Pair<String, String>>();
+ AutoMap<Pair<String, String>> aCapeType2 = new AutoMap<Pair<String, String>>();
+ AutoMap<Pair<String, String>> aCapeType3 = new AutoMap<Pair<String, String>>();
+ AutoMap<Pair<String, String>> aCapeType4 = new AutoMap<Pair<String, String>>();
+ AutoMap<Pair<String, String>> aCapeType5 = new AutoMap<Pair<String, String>>();
+ boolean didProcessStringData = false;
+ Logger.INFO("Decoded String Count: " + aDecodedData.size());
+ for (String aToSplit : aDecodedData) {
+ String[] aSplitData = aToSplit.split("" + SPLIT_CHARACTER);
+ if (aSplitData != null && aSplitData.length >= 2) {
+ if (aSplitData[0] != null) {
+ Integer aCapeTypeID2 = Integer.parseInt(aSplitData[0]);
+ if (aCapeTypeID2 != null) {
+ int aCapeTypeID = aCapeTypeID2;
+ Pair<String, String> aFinalString = new Pair<String, String>(
+ "UUID: " + aSplitData[1],
+ "Username: "
+ + (aSplitData[2] != null && aSplitData[0].length() > 0
+ ? aSplitData[2]
+ : "Not Specified"));
+ Logger.INFO("Cape Type: " + aCapeTypeID);
+ switch (aCapeTypeID) {
+ case 0:
+ aCapeType1.add(aFinalString);
+ Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds "
+ + aCapeType1.size() + " users.");
+ break;
+ case 1:
+ aCapeType2.add(aFinalString);
+ Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds "
+ + aCapeType2.size() + " users.");
+ break;
+ case 2:
+ aCapeType3.add(aFinalString);
+ Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds "
+ + aCapeType3.size() + " users.");
+ break;
+ case 3:
+ aCapeType4.add(aFinalString);
+ Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds "
+ + aCapeType4.size() + " users.");
+ break;
+ case 4:
+ aCapeType5.add(aFinalString);
+ Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds "
+ + aCapeType5.size() + " users.");
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (!aCapeType1.isEmpty()
+ || !aCapeType2.isEmpty()
+ || !aCapeType3.isEmpty()
+ || !aCapeType4.isEmpty()
+ || !aCapeType5.isEmpty()) {
+ didProcessStringData = true;
+ } else {
+ // did not process any data
+ }
+ if (didProcessStringData) {
+ if (!aCapeType1.isEmpty()) {
+ for (Pair<String, String> aUser : aCapeType1) {
+ Logger.INFO("Adding Generic cape for " + aUser.getKey());
+ mOrangeCapes.add(aUser);
+ }
+ }
+ if (!aCapeType2.isEmpty()) {
+ for (Pair<String, String> aUser : aCapeType2) {
+ Logger.INFO("Adding Blue cape for " + aUser.getKey());
+ mMiscCapes.add(aUser);
+ }
+ }
+ if (!aCapeType3.isEmpty()) {
+ for (Pair<String, String> aUser : aCapeType3) {
+ Logger.INFO("Adding Beta cape for " + aUser.getKey());
+ mBetaTestCapes.add(aUser);
+ }
+ }
+ if (!aCapeType4.isEmpty()) {
+ for (Pair<String, String> aUser : aCapeType4) {
+ Logger.INFO("Adding Patreon cape for " + aUser.getKey());
+ mPatreonCapes.add(aUser);
+ }
+ }
+ if (!aCapeType5.isEmpty()) {
+ for (Pair<String, String> aUser : aCapeType5) {
+ Logger.INFO("Adding Dev cape for " + aUser.getKey());
+ mDevCapes.add(aUser);
+ }
+ }
+ }
+ } else {
+ // No data decoded
+ }
+ } else {
+ // Nothing was cached?
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java
index 1561ba9f73..1d4e367c4f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java
@@ -1,7 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.render;
import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.ItemList;
import gregtech.common.items.GT_VolumetricFlask;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import ic2.core.util.DrawUtil;
@@ -18,7 +17,7 @@ import org.lwjgl.opengl.GL11;
@SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
public final class GTPP_FlaskRenderer implements net.minecraftforge.client.IItemRenderer {
-
+
public GTPP_FlaskRenderer() {
MinecraftForgeClient.registerItemRenderer(GregtechItemList.VOLUMETRIC_FLASK_8k.getItem(), this);
MinecraftForgeClient.registerItemRenderer(GregtechItemList.VOLUMETRIC_FLASK_32k.getItem(), this);
@@ -28,14 +27,13 @@ public final class GTPP_FlaskRenderer implements net.minecraftforge.client.IItem
return type != ItemRenderType.FIRST_PERSON_MAP;
}
-
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
return type == ItemRenderType.ENTITY;
}
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
GT_VolumetricFlask cell = (GT_VolumetricFlask) item.getItem();
-
+
int aType = cell.getMaxCapacity() == 8000 ? 0 : 1;
IIcon icon = item.getIconIndex();
GL11.glEnable(3042);
@@ -86,9 +84,17 @@ public final class GTPP_FlaskRenderer implements net.minecraftforge.client.IItem
if (type.equals(ItemRenderType.INVENTORY)) {
DrawUtil.renderIcon(icon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
} else {
- ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
+ ItemRenderer.renderItemIn2D(
+ Tessellator.instance,
+ icon.getMaxU(),
+ icon.getMinV(),
+ icon.getMinU(),
+ icon.getMaxV(),
+ icon.getIconWidth(),
+ icon.getIconHeight(),
+ 0.0625F);
}
GL11.glDisable(3008);
GL11.glDisable(3042);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java
index 35d78008c5..1a5117ac2e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.render;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.client.registry.RenderingRegistry;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
@@ -18,642 +16,767 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
+import org.lwjgl.opengl.GL11;
public class GTPP_Render_MachineBlock extends GT_Renderer_Block {
-
- public static GTPP_Render_MachineBlock INSTANCE;
- public final int mRenderID = RenderingRegistry.getNextAvailableRenderId();
-
- public GTPP_Render_MachineBlock() {
- INSTANCE = this;
- RenderingRegistry.registerBlockHandler(this);
- }
-
- private static ITexture[] getTexture(IMetaTileEntity arg0, int arg1, int arg2, int arg3, boolean arg4, boolean arg5) {
- IGregTechTileEntity arg0b = arg0.getBaseMetaTileEntity();
- return arg0.getTexture(arg0b, (byte) arg1, (byte) arg2, (byte) arg3, arg4, arg5);
- }
-
- private static void renderNormalInventoryMetaTileEntity(Block aBlock, int aMeta, RenderBlocks aRenderer) {
- if (aMeta > 0 && aMeta < GregTech_API.METATILEENTITIES.length) {
- IMetaTileEntity tMetaTileEntity = GregTech_API.METATILEENTITIES[aMeta];
- if (tMetaTileEntity != null) {
- aBlock.setBlockBoundsForItemRender();
- aRenderer.setRenderBoundsFromBlock(aBlock);
- GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- if (tMetaTileEntity.getBaseMetaTileEntity() instanceof IPipeRenderedTileEntity) {
- float tThickness = ((IPipeRenderedTileEntity) tMetaTileEntity.getBaseMetaTileEntity())
- .getThickNess();
- float sp = (1.0F - tThickness) / 2.0F;
- aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
- renderNegativeYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 0, 9, -1, false, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
- renderPositiveYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 1, 9, -1, false, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
- renderNegativeZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 2, 9, -1, false, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
- renderPositiveZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 3, 9, -1, false, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
- renderNegativeXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 4, 9, -1, true, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
- renderPositiveXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 5, 9, -1, true, false),
- true);
- Tessellator.instance.draw();
- } else {
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
- renderNegativeYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 0, 4, -1, true, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
- renderPositiveYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 1, 4, -1, true, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
- renderNegativeZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 2, 4, -1, true, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
- renderPositiveZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 3, 4, -1, true, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
- renderNegativeXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 4, 4, -1, true, false),
- true);
- Tessellator.instance.draw();
- Tessellator.instance.startDrawingQuads();
- Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
- renderPositiveXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0,
- getTexture(tMetaTileEntity, 5, 4, -1, true, false),
- true);
- Tessellator.instance.draw();
- }
-
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
- }
- }
- }
-
- public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock,
- RenderBlocks aRenderer) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
-
- return tTileEntity instanceof ITexturedTileEntity
- ? renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer,
- new ITexture[][]{GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 0),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 1),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 2),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 3),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 4),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 5)})
- : false;
- }
-
- public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock,
- RenderBlocks aRenderer, ITexture[][] aTextures) {
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[0], true);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[1], true);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[2], true);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[3], true);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[4], true);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[5], true);
- return true;
- }
-
- public static boolean renderPipeBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock,
- IPipeRenderedTileEntity aTileEntity, RenderBlocks aRenderer) {
- byte aConnections = aTileEntity.getConnections();
- if ((aConnections & 192) != 0) {
- return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
- } else {
- float tThickness = aTileEntity.getThickNess();
- if (tThickness >= 0.99F) {
- return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
- } else {
- float sp = (1.0F - tThickness) / 2.0F;
- byte tConnections = 0;
-
- for (byte tIsCovered = 0; tIsCovered < 6; ++tIsCovered) {
- if ((aConnections & 1 << tIsCovered) != 0) {
- tConnections = (byte) (tConnections | 1 << (tIsCovered + 2) % 6);
- }
- }
-
- boolean[] arg14 = new boolean[6];
-
- for (byte tIcons = 0; tIcons < 6; ++tIcons) {
- arg14[tIcons] = aTileEntity.getCoverIDAtSide(tIcons) != 0;
- }
-
- if (arg14[0] && arg14[1] && arg14[2] && arg14[3] && arg14[4] && arg14[5]) {
- return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
- } else {
- ITexture[][] arg15 = new ITexture[6][];
- ITexture[][] tCovers = new ITexture[6][];
-
- for (byte i = 0; i < 6; ++i) {
- tCovers[i] = GT_MethodHelper.getTexture((TileEntity) aTileEntity, aBlock, i);
- arg15[i] = aTileEntity.getTextureUncovered(i);
- }
-
- if (tConnections == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- } else if (tConnections == 3) {
- aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- if (!arg14[4]) {
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- }
-
- if (!arg14[5]) {
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- }
- } else if (tConnections == 12) {
- aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, 1.0F, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[0]) {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- }
-
- if (!arg14[1]) {
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- }
- } else if (tConnections == 48) {
- aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[2]) {
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- }
-
- if (!arg14[3]) {
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- }
- } else {
- if ((tConnections & 1) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- } else {
- aBlock.setBlockBounds(0.0F, sp, sp, sp, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- if (!arg14[4]) {
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- }
- }
-
- if ((tConnections & 2) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- } else {
- aBlock.setBlockBounds(sp + tThickness, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- if (!arg14[5]) {
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- }
- }
-
- if ((tConnections & 4) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- } else {
- aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, sp, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[0]) {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- }
- }
-
- if ((tConnections & 8) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- } else {
- aBlock.setBlockBounds(sp, sp + tThickness, sp, sp + tThickness, 1.0F, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[1]) {
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- }
- }
-
- if ((tConnections & 16) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- } else {
- aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, sp);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[2]) {
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- }
- }
-
- if ((tConnections & 32) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- } else {
- aBlock.setBlockBounds(sp, sp, sp + tThickness, sp + tThickness, sp + tThickness, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[3]) {
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- }
- }
- }
-
- if (arg14[0]) {
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
- if (!arg14[2]) {
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
- }
-
- if (!arg14[3]) {
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
- }
-
- if (!arg14[4]) {
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
- }
-
- if (!arg14[5]) {
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
- }
- }
-
- if (arg14[1]) {
- aBlock.setBlockBounds(0.0F, 0.875F, 0.0F, 1.0F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
- if (!arg14[2]) {
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
- }
-
- if (!arg14[3]) {
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
- }
-
- if (!arg14[4]) {
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
- }
-
- if (!arg14[5]) {
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
- }
- }
-
- if (arg14[2]) {
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.125F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- if (!arg14[0]) {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
- }
-
- if (!arg14[1]) {
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
- }
-
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
- if (!arg14[4]) {
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
- }
-
- if (!arg14[5]) {
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
- }
- }
-
- if (arg14[3]) {
- aBlock.setBlockBounds(0.0F, 0.0F, 0.875F, 1.0F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- if (!arg14[0]) {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
- }
-
- if (!arg14[1]) {
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
- }
-
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
- if (!arg14[4]) {
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
- }
-
- if (!arg14[5]) {
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
- }
- }
-
- if (arg14[4]) {
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 0.125F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- if (!arg14[0]) {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
- }
-
- if (!arg14[1]) {
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
- }
-
- if (!arg14[2]) {
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
- }
-
- if (!arg14[3]) {
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
- }
-
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
- }
-
- if (arg14[5]) {
- aBlock.setBlockBounds(0.875F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- if (!arg14[0]) {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
- }
-
- if (!arg14[1]) {
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
- }
-
- if (!arg14[2]) {
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
- }
-
- if (!arg14[3]) {
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
- }
-
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
- }
-
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- return true;
- }
- }
- }
- }
-
- public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
- int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0)) {
- return;
- }
-
- Tessellator.instance
- .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ));
- }
-
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; ++i) {
- if (aIcon[i] != null) {
- aIcon[i].renderYNeg(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
-
- aRenderer.flipTexture = false;
- }
-
- public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
- int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1)) {
- return;
- }
-
- Tessellator.instance
- .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ));
- }
-
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; ++i) {
- if (aIcon[i] != null) {
- aIcon[i].renderYPos(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
-
- aRenderer.flipTexture = false;
- }
-
- public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
- int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2)) {
- return;
- }
-
- Tessellator.instance
- .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ));
- }
-
- aRenderer.flipTexture = !aFullBlock;
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; ++i) {
- if (aIcon[i] != null) {
- aIcon[i].renderZNeg(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
-
- aRenderer.flipTexture = false;
- }
-
- public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
- int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3)) {
- return;
- }
-
- Tessellator.instance
- .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ));
- }
-
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; ++i) {
- if (aIcon[i] != null) {
- aIcon[i].renderZPos(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
-
- aRenderer.flipTexture = false;
- }
-
- public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
- int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4)) {
- return;
- }
-
- Tessellator.instance
- .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ));
- }
-
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; ++i) {
- if (aIcon[i] != null) {
- aIcon[i].renderXNeg(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
-
- aRenderer.flipTexture = false;
- }
-
- public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
- int aZ, ITexture[] aIcon, boolean aFullBlock) {
- if (aWorld != null) {
- if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5)) {
- return;
- }
-
- Tessellator.instance
- .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ));
- }
-
- aRenderer.flipTexture = !aFullBlock;
- if (aIcon != null) {
- for (int i = 0; i < aIcon.length; ++i) {
- if (aIcon[i] != null) {
- aIcon[i].renderXPos(aRenderer, aBlock, aX, aY, aZ);
- }
- }
- }
-
- aRenderer.flipTexture = false;
- }
-
- public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) {
- aMeta += 30400;
- if (aBlock instanceof GT_Block_Machines || aBlock instanceof GTPP_Block_Machines) {
- if (aMeta > 0 && aMeta < GregTech_API.METATILEENTITIES.length
- && GregTech_API.METATILEENTITIES[aMeta] != null
- && !GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer)) {
- renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer);
- }
- }
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
- }
-
- public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID,
- RenderBlocks aRenderer) {
- TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return aTileEntity == null
- ? false
- : (aTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null
- && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity().renderInWorld(aWorld, aX, aY, aZ,
- aBlock, aRenderer)
- ? true
- : (aTileEntity instanceof IPipeRenderedTileEntity
- ? renderPipeBlock(aWorld, aX, aY, aZ, aBlock,
- (IPipeRenderedTileEntity) aTileEntity, aRenderer)
- : renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer)));
- }
-
- public boolean shouldRender3DInInventory(int aModel) {
- return true;
- }
-
- public int getRenderId() {
- return this.mRenderID;
- }
-} \ No newline at end of file
+
+ public static GTPP_Render_MachineBlock INSTANCE;
+ public final int mRenderID = RenderingRegistry.getNextAvailableRenderId();
+
+ public GTPP_Render_MachineBlock() {
+ INSTANCE = this;
+ RenderingRegistry.registerBlockHandler(this);
+ }
+
+ private static ITexture[] getTexture(
+ IMetaTileEntity arg0, int arg1, int arg2, int arg3, boolean arg4, boolean arg5) {
+ IGregTechTileEntity arg0b = arg0.getBaseMetaTileEntity();
+ return arg0.getTexture(arg0b, (byte) arg1, (byte) arg2, (byte) arg3, arg4, arg5);
+ }
+
+ private static void renderNormalInventoryMetaTileEntity(Block aBlock, int aMeta, RenderBlocks aRenderer) {
+ if (aMeta > 0 && aMeta < GregTech_API.METATILEENTITIES.length) {
+ IMetaTileEntity tMetaTileEntity = GregTech_API.METATILEENTITIES[aMeta];
+ if (tMetaTileEntity != null) {
+ aBlock.setBlockBoundsForItemRender();
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ if (tMetaTileEntity.getBaseMetaTileEntity() instanceof IPipeRenderedTileEntity) {
+ float tThickness =
+ ((IPipeRenderedTileEntity) tMetaTileEntity.getBaseMetaTileEntity()).getThickNess();
+ float sp = (1.0F - tThickness) / 2.0F;
+ aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
+ renderNegativeYFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 0, 9, -1, false, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
+ renderPositiveYFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 1, 9, -1, false, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
+ renderNegativeZFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 2, 9, -1, false, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
+ renderPositiveZFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 3, 9, -1, false, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
+ renderNegativeXFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 4, 9, -1, true, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
+ renderPositiveXFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 5, 9, -1, true, false),
+ true);
+ Tessellator.instance.draw();
+ } else {
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
+ renderNegativeYFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 0, 4, -1, true, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
+ renderPositiveYFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 1, 4, -1, true, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
+ renderNegativeZFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 2, 4, -1, true, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
+ renderPositiveZFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 3, 4, -1, true, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
+ renderNegativeXFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 4, 4, -1, true, false),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
+ renderPositiveXFacing(
+ (IBlockAccess) null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ getTexture(tMetaTileEntity, 5, 4, -1, true, false),
+ true);
+ Tessellator.instance.draw();
+ }
+
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ }
+ }
+ }
+
+ public static boolean renderStandardBlock(
+ IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+
+ return tTileEntity instanceof ITexturedTileEntity
+ ? renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][] {
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 0),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 1),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 2),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 3),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 4),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 5)
+ })
+ : false;
+ }
+
+ public static boolean renderStandardBlock(
+ IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) {
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[0], true);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[1], true);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[2], true);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[3], true);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[4], true);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[5], true);
+ return true;
+ }
+
+ public static boolean renderPipeBlock(
+ IBlockAccess aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ Block aBlock,
+ IPipeRenderedTileEntity aTileEntity,
+ RenderBlocks aRenderer) {
+ byte aConnections = aTileEntity.getConnections();
+ if ((aConnections & 192) != 0) {
+ return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
+ } else {
+ float tThickness = aTileEntity.getThickNess();
+ if (tThickness >= 0.99F) {
+ return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
+ } else {
+ float sp = (1.0F - tThickness) / 2.0F;
+ byte tConnections = 0;
+
+ for (byte tIsCovered = 0; tIsCovered < 6; ++tIsCovered) {
+ if ((aConnections & 1 << tIsCovered) != 0) {
+ tConnections = (byte) (tConnections | 1 << (tIsCovered + 2) % 6);
+ }
+ }
+
+ boolean[] arg14 = new boolean[6];
+
+ for (byte tIcons = 0; tIcons < 6; ++tIcons) {
+ arg14[tIcons] = aTileEntity.getCoverIDAtSide(tIcons) != 0;
+ }
+
+ if (arg14[0] && arg14[1] && arg14[2] && arg14[3] && arg14[4] && arg14[5]) {
+ return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
+ } else {
+ ITexture[][] arg15 = new ITexture[6][];
+ ITexture[][] tCovers = new ITexture[6][];
+
+ for (byte i = 0; i < 6; ++i) {
+ tCovers[i] = GT_MethodHelper.getTexture((TileEntity) aTileEntity, aBlock, i);
+ arg15[i] = aTileEntity.getTextureUncovered(i);
+ }
+
+ if (tConnections == 0) {
+ aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ } else if (tConnections == 3) {
+ aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ if (!arg14[4]) {
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ }
+
+ if (!arg14[5]) {
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ }
+ } else if (tConnections == 12) {
+ aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, 1.0F, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ if (!arg14[0]) {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ }
+
+ if (!arg14[1]) {
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ }
+ } else if (tConnections == 48) {
+ aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ if (!arg14[2]) {
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ }
+
+ if (!arg14[3]) {
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ }
+ } else {
+ if ((tConnections & 1) == 0) {
+ aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ } else {
+ aBlock.setBlockBounds(0.0F, sp, sp, sp, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ if (!arg14[4]) {
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ }
+ }
+
+ if ((tConnections & 2) == 0) {
+ aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ } else {
+ aBlock.setBlockBounds(sp + tThickness, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ if (!arg14[5]) {
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ }
+ }
+
+ if ((tConnections & 4) == 0) {
+ aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ } else {
+ aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, sp, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ if (!arg14[0]) {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ }
+ }
+
+ if ((tConnections & 8) == 0) {
+ aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ } else {
+ aBlock.setBlockBounds(sp, sp + tThickness, sp, sp + tThickness, 1.0F, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ if (!arg14[1]) {
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ }
+ }
+
+ if ((tConnections & 16) == 0) {
+ aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ } else {
+ aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, sp);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ if (!arg14[2]) {
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ }
+ }
+
+ if ((tConnections & 32) == 0) {
+ aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ } else {
+ aBlock.setBlockBounds(sp, sp, sp + tThickness, sp + tThickness, sp + tThickness, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ if (!arg14[3]) {
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
+ }
+ }
+ }
+
+ if (arg14[0]) {
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
+ if (!arg14[2]) {
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
+ }
+
+ if (!arg14[3]) {
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
+ }
+
+ if (!arg14[4]) {
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
+ }
+
+ if (!arg14[5]) {
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
+ }
+ }
+
+ if (arg14[1]) {
+ aBlock.setBlockBounds(0.0F, 0.875F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
+ if (!arg14[2]) {
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
+ }
+
+ if (!arg14[3]) {
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
+ }
+
+ if (!arg14[4]) {
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
+ }
+
+ if (!arg14[5]) {
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
+ }
+ }
+
+ if (arg14[2]) {
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.125F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ if (!arg14[0]) {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
+ }
+
+ if (!arg14[1]) {
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
+ }
+
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
+ if (!arg14[4]) {
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
+ }
+
+ if (!arg14[5]) {
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
+ }
+ }
+
+ if (arg14[3]) {
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.875F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ if (!arg14[0]) {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
+ }
+
+ if (!arg14[1]) {
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
+ }
+
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
+ if (!arg14[4]) {
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
+ }
+
+ if (!arg14[5]) {
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
+ }
+ }
+
+ if (arg14[4]) {
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 0.125F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ if (!arg14[0]) {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
+ }
+
+ if (!arg14[1]) {
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
+ }
+
+ if (!arg14[2]) {
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
+ }
+
+ if (!arg14[3]) {
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
+ }
+
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
+ }
+
+ if (arg14[5]) {
+ aBlock.setBlockBounds(0.875F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ if (!arg14[0]) {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
+ }
+
+ if (!arg14[1]) {
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
+ }
+
+ if (!arg14[2]) {
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
+ }
+
+ if (!arg14[3]) {
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
+ }
+
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);
+ }
+
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ return true;
+ }
+ }
+ }
+ }
+
+ public static void renderNegativeYFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0)) {
+ return;
+ }
+
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ));
+ }
+
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; ++i) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderYNeg(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderPositiveYFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1)) {
+ return;
+ }
+
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ));
+ }
+
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; ++i) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderYPos(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderNegativeZFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2)) {
+ return;
+ }
+
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ));
+ }
+
+ aRenderer.flipTexture = !aFullBlock;
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; ++i) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderZNeg(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderPositiveZFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3)) {
+ return;
+ }
+
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ));
+ }
+
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; ++i) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderZPos(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderNegativeXFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4)) {
+ return;
+ }
+
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ));
+ }
+
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; ++i) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderXNeg(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderPositiveXFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
+ if (aWorld != null) {
+ if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5)) {
+ return;
+ }
+
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ));
+ }
+
+ aRenderer.flipTexture = !aFullBlock;
+ if (aIcon != null) {
+ for (int i = 0; i < aIcon.length; ++i) {
+ if (aIcon[i] != null) {
+ aIcon[i].renderXPos(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+
+ aRenderer.flipTexture = false;
+ }
+
+ public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) {
+ aMeta += 30400;
+ if (aBlock instanceof GT_Block_Machines || aBlock instanceof GTPP_Block_Machines) {
+ if (aMeta > 0
+ && aMeta < GregTech_API.METATILEENTITIES.length
+ && GregTech_API.METATILEENTITIES[aMeta] != null
+ && !GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer)) {
+ renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer);
+ }
+ }
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ }
+
+ public boolean renderWorldBlock(
+ IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) {
+ TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return aTileEntity == null
+ ? false
+ : (aTileEntity instanceof IGregTechTileEntity
+ && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null
+ && ((IGregTechTileEntity) aTileEntity)
+ .getMetaTileEntity()
+ .renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer)
+ ? true
+ : (aTileEntity instanceof IPipeRenderedTileEntity
+ ? renderPipeBlock(
+ aWorld, aX, aY, aZ, aBlock, (IPipeRenderedTileEntity) aTileEntity, aRenderer)
+ : renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer)));
+ }
+
+ public boolean shouldRender3DInInventory(int aModel) {
+ return true;
+ }
+
+ public int getRenderId() {
+ return this.mRenderID;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java
index 7b223f8245..79400b68e6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.automation;
-import java.util.ArrayList;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
@@ -19,6 +17,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.automation.GT_Container_ElectricAutoWorkbench;
import gtPlusPlus.xmod.gregtech.api.gui.automation.GT_GUIContainer_ElectricAutoWorkbench;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -26,747 +25,844 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.oredict.OreDictionary;
public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_BasicTank {
-
- public int mMode = 0, mCurrentSlot = 0, mThroughPut = 0, mTicksUntilNextUpdate = 20;
- public boolean mLastCraftSuccessful = false;
- protected String mLocalName;
-
- public GT_MetaTileEntity_ElectricAutoWorkbench(final int aID, final int aTier, final String aDescription) {
- super(aID, "basicmachine.automation.autoworkbench.0"+aTier, "Auto Workbench ("+GT_Values.VN[aTier]+")", aTier, 30, aDescription);
- mLocalName = "Auto Workbench ("+GT_Values.VN[aTier]+")";
- }
-
- public GT_MetaTileEntity_ElectricAutoWorkbench(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, 30, aDescription, aTextures);
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_ElectricAutoWorkbench(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_ElectricAutoWorkbench(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return true;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return aIndex < 19;
- }
-
- @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 !isOutputFacing(aSide);
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getBackFacing();
- }
-
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- @Override
- public long maxEUInput() {
- return GT_Values.V[mTier];
- }
-
- @Override
- public long maxEUOutput() {
- return mThroughPut % 2 == 0 ? GT_Values.V[mTier] : 0;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return GT_Values.V[this.mTier];
- }
-
- @Override
- public long maxEUStore() {
- return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]);
- }
-
- @Override
- public int getSizeInventory() {
- return 30;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_ElectricAutoWorkbench(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mMode", mMode);
- aNBT.setInteger("mThroughPut", mThroughPut);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mMode = aNBT.getInteger("mMode");
- mThroughPut = aNBT.getInteger("mThroughPut");
- }
-
- @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 boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
- return aSide != getBaseMetaTileEntity().getFrontFacing() && aSide != getBaseMetaTileEntity().getBackFacing();
- }
-
- private static final int MAX_MODES = 10;
-
- public void switchModeForward() {
- mMode = (mMode + 1) % MAX_MODES;
- switchMode();
- }
-
- public void switchModeBackward() {
- mMode--;
- if (mMode < 0) mMode = MAX_MODES-1;
- switchMode();
- }
-
- private void switchMode() {
- mInventory[28] = null;
- }
-
- public void switchThrough() {
- mThroughPut = (mThroughPut + 1) % 4;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().getUniversalEnergyStored() >= (mMode==5||mMode==6?128:2048) && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || --mTicksUntilNextUpdate<1)) {
- mTicksUntilNextUpdate = 32;
-
- for (byte i = 19; i < 28; i++) {
- if (mInventory[i] != null && mInventory[i].isItemStackDamageable() && mInventory[i].getItem().hasContainerItem()) {
- mInventory[i].setItemDamage(OreDictionary.WILDCARD_VALUE);
- }
- }
-
- if (mInventory[18] == null) {
- for (byte i = 0; i < 18 && mFluid != null; i++) {
- ItemStack tOutput = GT_Utility.fillFluidContainer(mFluid, mInventory[i], false, true);
- if (tOutput != null) {
- for (byte j = 0; j < 9; j++) {
- if (mInventory[j] == null || (GT_Utility.areStacksEqual(tOutput, mInventory[j]) && mInventory[j].stackSize + tOutput.stackSize <= tOutput.getMaxStackSize())) {
- mFluid.amount -= GT_Utility.getFluidForFilledItem(tOutput, true).amount * tOutput.stackSize;
- getBaseMetaTileEntity().decrStackSize(i, 1);
- if (mInventory[j] == null) {
- mInventory[j] = tOutput;
- } else {
- mInventory[j].stackSize++;
- }
- if (mFluid.amount <= 0) mFluid = null;
- break;
- }
- }
- }
- }
-
- ItemStack[] tRecipe = new ItemStack[9];
- ItemStack tTempStack = null, tOutput = null;
-
- if (mInventory[17] != null && mThroughPut < 2 && mMode != 0) {
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[17];
- mInventory[17] = null;
- }
- } else {
- if (!mLastCraftSuccessful) {
- mCurrentSlot = (mCurrentSlot+1)%18;
- for (int i = 0; i < 17 && mInventory[mCurrentSlot] == null; i++)
- mCurrentSlot = (mCurrentSlot+1)%18;
- }
- switch (mMode) {
- case 0:
- if (mInventory[mCurrentSlot] != null && !isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
- if (mInventory[18] == null && mThroughPut < 2 && mCurrentSlot < 8) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- for (int i = 0; i < 9; i++) {
- tRecipe[i] = mInventory[i+19];
- if (tRecipe[i] != null) {
- tRecipe[i] = GT_Utility.copy(tRecipe[i]);
- tRecipe[i].stackSize = 1;
- }
- }
- break;
- case 1:
- if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
- tTempStack.stackSize = 1;
- tRecipe[0] = tTempStack;
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- tRecipe[1] = tTempStack;
- tRecipe[3] = tTempStack;
- tRecipe[4] = tTempStack;
- } else break;
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- tRecipe[2] = tTempStack;
- tRecipe[5] = tTempStack;
- tRecipe[6] = tTempStack;
- tRecipe[7] = tTempStack;
- tRecipe[8] = tTempStack;
- } else break;
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- break;
- case 2:
- if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
- tTempStack.stackSize = 1;
- tRecipe[0] = tTempStack;
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- break;
- case 3:
- if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
- tTempStack.stackSize = 1;
- tRecipe[0] = tTempStack;
- tRecipe[1] = tTempStack;
- tRecipe[3] = tTempStack;
- tRecipe[4] = tTempStack;
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- break;
- case 4:
- if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
- tTempStack.stackSize = 1;
- tRecipe[0] = tTempStack;
- tRecipe[1] = tTempStack;
- tRecipe[2] = tTempStack;
- tRecipe[3] = tTempStack;
- tRecipe[4] = tTempStack;
- tRecipe[5] = tTempStack;
- tRecipe[6] = tTempStack;
- tRecipe[7] = tTempStack;
- tRecipe[8] = tTempStack;
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- break;
- case 5:
- if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
- tTempStack.stackSize = 1;
- tRecipe[0] = tTempStack;
-
- tOutput = GT_OreDictUnificator.get(true, tTempStack);
-
- if (tOutput != null && GT_Utility.areStacksEqual(tOutput, tTempStack)) tOutput = null;
-
- if (tOutput == null) {
- tRecipe[0] = null;
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- }
- break;
- case 6:
- if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- } else if (OrePrefixes.dustSmall.contains(mInventory[mCurrentSlot])) {
- tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
- tTempStack.stackSize = 1;
- tRecipe[0] = tTempStack;
- tRecipe[1] = tTempStack;
- tRecipe[3] = tTempStack;
- tRecipe[4] = tTempStack;
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- } else if (OrePrefixes.dustTiny.contains(mInventory[mCurrentSlot])) {
- tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
- tTempStack.stackSize = 1;
- tRecipe[0] = tTempStack;
- tRecipe[1] = tTempStack;
- tRecipe[2] = tTempStack;
- tRecipe[3] = tTempStack;
- tRecipe[4] = tTempStack;
- tRecipe[5] = tTempStack;
- tRecipe[6] = tTempStack;
- tRecipe[7] = tTempStack;
- tRecipe[8] = tTempStack;
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- } else {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- break;
- case 7:
- if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot]) || !OrePrefixes.nugget.contains(mInventory[mCurrentSlot])) {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
- tTempStack.stackSize = 1;
- tRecipe[0] = tTempStack;
- tRecipe[1] = tTempStack;
- tRecipe[2] = tTempStack;
- tRecipe[3] = tTempStack;
- tRecipe[4] = tTempStack;
- tRecipe[5] = tTempStack;
- tRecipe[6] = tTempStack;
- tRecipe[7] = tTempStack;
- tRecipe[8] = tTempStack;
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- break;
- case 8:
- if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot]) || mInventory[mCurrentSlot].getItemDamage() <= 0 || !mInventory[mCurrentSlot].getItem().isRepairable()) {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
- tTempStack.stackSize = 1;
- for (int i = mCurrentSlot + 1; i < 18; i++) {
- if (mInventory[i] != null && mInventory[i].getItem() == tTempStack.getItem() && mInventory[mCurrentSlot].getItemDamage()+mInventory[i].getItemDamage()>tTempStack.getMaxDamage()) {
- tRecipe[0] = tTempStack;
- tRecipe[1] = GT_Utility.copy(mInventory[i]);
- if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) {
- if (mInventory[18] == null) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- }
- break;
- }
- }
- break;
- case 9:
- if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
- if (mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mCurrentSlot];
- mInventory[mCurrentSlot] = null;
- mTicksUntilNextUpdate = 1;
- }
- break;
- }
- for (byte i = 0, j = 0; i < 18 && j < 9 && (j < 2 || GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null); i++) {
- tRecipe[j] = mInventory[(mCurrentSlot+i)%18];
- if (tRecipe[j] != null) {
- tRecipe[j] = GT_Utility.copy(tRecipe[j]);
- tRecipe[j].stackSize = 1;
- j++;
- }
- }
- if (tRecipe[1] == null) tRecipe[0] = null;
- break;
- }
- }
-
- if (tOutput == null) tOutput = GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe);
-
- if (tOutput != null || mMode == 0) mInventory[28] = tOutput;
-
- if (tOutput == null) {
- mLastCraftSuccessful = false;
- } else {
- if ((tTempStack = GT_OreDictUnificator.get(true, tOutput)) != null) {
- tTempStack.stackSize = tOutput.stackSize;
- tOutput = tTempStack;
- }
-
- mInventory[28] = GT_Utility.copy(tOutput);
- ArrayList<ItemStack> tList = recipeContent(tRecipe), tContent = benchContent();
- if (tList.size() > 0 && tContent.size() > 0) {
-
- boolean success = (mMode==6||mMode==7||mInventory[17]==null);
- for (byte i = 0; i < tList.size() && success; i++) {
- success = false;
- for (byte j = 0; j < tContent.size() && !success; j++) {
- if (GT_Utility.areStacksEqual(tList.get(i), tContent.get(j))) {
- if (tList.get(i).stackSize <= tContent.get(j).stackSize) {
- success = true;
- }
- }
- }
- }
-
- if (success) {
- mLastCraftSuccessful = true;
-
- for (byte i = 8; i > -1; i--) {
- for (byte j = 17; j > -1; j--) {
- if (tRecipe[i] != null && mInventory[j] != null) {
- if (GT_Utility.areStacksEqual(tRecipe[i], mInventory[j])) {
- ItemStack tStack = GT_Utility.getContainerItem(mInventory[j], true);
- if (tStack != null) {
- getBaseMetaTileEntity().decrStackSize(j, 1);
- if (!tStack.isItemStackDamageable() || tStack.getItemDamage() < tStack.getMaxDamage()) {
- for (byte k = 9; k < 18; k++) {
- if (mInventory[k] == null) {
- mInventory[k] = GT_Utility.copy(tStack);
- break;
- } else if (GT_Utility.areStacksEqual(mInventory[k], tStack) && mInventory[k].stackSize + tStack.stackSize <= tStack.getMaxStackSize()) {
- mInventory[k].stackSize += tStack.stackSize;
- break;
- }
- }
- }
- } else {
- getBaseMetaTileEntity().decrStackSize(j, 1);
- }
- break;
- }
- }
- }
- }
-
- mInventory[18] = GT_Utility.copy(tOutput);
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(mMode==5||mMode==6||mMode==7?128:2048, true);
- mTicksUntilNextUpdate = 1;
- } else {
- mLastCraftSuccessful = false;
- if (mInventory[mMode==0?8:17] != null && mInventory[18] == null && mThroughPut < 2) {
- mInventory[18] = mInventory[mMode==0?8:17];
- mInventory[mMode==0?8:17] = null;
- mTicksUntilNextUpdate = 1;
- }
- }
- }
-
- if (mInventory[18] == null && mThroughPut < 2) {
- for (byte i = 0; i < 8; i++) {
- for (byte j = i; ++j < 9;) {
- if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j]) && mInventory[i].getMaxStackSize() > 8) {
- mInventory[18] = mInventory[j];
- mInventory[j] = null;
- mTicksUntilNextUpdate = 1;
- break;
- }
- }
- }
- }
- }
- }
-
- if (mThroughPut < 2) {
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), getBaseMetaTileEntity().getFrontFacing(), null, false, (byte)64, (byte)1, (byte)64, (byte)1)*10, true);
- }
- }
- }
-
- private boolean isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(ItemStack aStack) {
- if (aStack == null) return true;
- for (byte i = 19; i < 28; i++) {
- if (mInventory[i] != null) {
- if (GT_Utility.areStacksEqual(mInventory[i], aStack)) return true;
- if (GT_Utility.areStacksEqual(GT_Utility.getContainerForFilledItem(mInventory[i], true), aStack)) return true;
- }
- }
- return false;
- }
-
- private ArrayList<ItemStack> recipeContent(ItemStack[] tRecipe) {
- ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
- for (byte i = 0; i < 9; i++) {
- if (tRecipe[i] != null) {
- boolean temp = false;
- for (byte j = 0; j < tList.size(); j++) {
- if (GT_Utility.areStacksEqual(tRecipe[i], tList.get(j))) {
- tList.get(j).stackSize++;
- temp = true;
- break;
- }
- }
- if (!temp) tList.add(GT_Utility.copy(1, tRecipe[i]));
- }
- }
- return tList;
- }
-
- private ArrayList<ItemStack> benchContent() {
- ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
- for (byte i = 0; i < 18; i++) {
- if (mInventory[i] != null) {
- boolean temp = false;
- for (byte j = 0; j < tList.size(); j++) {
- if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j])) {
- tList.get(j).stackSize += mInventory[i].stackSize;
- temp = true;
- break;
- }
- }
- if (!temp) tList.add(GT_Utility.copy(mInventory[i]));
- }
- }
- return tList;
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return mMode==0?aIndex>=10:aIndex>=18;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return mMode==0?aIndex<9:aIndex<18;
- }
-
- /*@Override
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing)
- return 112;
- if (GT_Utility.getOppositeSide(aSide) == aFacing)
- return 113;
- return 114;
- }*/
-
- @Override
- public int getCapacity() {
- return 16000;
- }
-
- @Override
- public int getTankPressure() {
- return -100;
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Automatic Crafting Table Mk III",
- //this.mDescription,
- CORE.GT_Tooltip };
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFront(i);
- rTextures[6][i + 1] = this.getBack(i);
- rTextures[7][i + 1] = this.getBottom(i);
- rTextures[8][i + 1] = this.getTop(i);
- rTextures[9][i + 1] = this.getSides(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return this.mTextures[0][aColorIndex + 1];
- }
- else if (GT_Utility.getOppositeSide(aSide) == aFacing) {
- return this.mTextures[1][aColorIndex + 1];
- }
- else {
- return this.mTextures[4][aColorIndex + 1];
- }
- /*return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];*/
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay)};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE)};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], };
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) };
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay)};
- }
+
+ public int mMode = 0, mCurrentSlot = 0, mThroughPut = 0, mTicksUntilNextUpdate = 20;
+ public boolean mLastCraftSuccessful = false;
+ protected String mLocalName;
+
+ public GT_MetaTileEntity_ElectricAutoWorkbench(final int aID, final int aTier, final String aDescription) {
+ super(
+ aID,
+ "basicmachine.automation.autoworkbench.0" + aTier,
+ "Auto Workbench (" + GT_Values.VN[aTier] + ")",
+ aTier,
+ 30,
+ aDescription);
+ mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")";
+ }
+
+ public GT_MetaTileEntity_ElectricAutoWorkbench(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 30, aDescription, aTextures);
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_ElectricAutoWorkbench(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_ElectricAutoWorkbench(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return true;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 19;
+ }
+
+ @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 !isOutputFacing(aSide);
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return GT_Values.V[mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return mThroughPut % 2 == 0 ? GT_Values.V[mTier] : 0;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return GT_Values.V[this.mTier];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 30;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_ElectricAutoWorkbench(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mMode", mMode);
+ aNBT.setInteger("mThroughPut", mThroughPut);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mMode = aNBT.getInteger("mMode");
+ mThroughPut = aNBT.getInteger("mThroughPut");
+ }
+
+ @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 boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return aSide != getBaseMetaTileEntity().getFrontFacing()
+ && aSide != getBaseMetaTileEntity().getBackFacing();
+ }
+
+ private static final int MAX_MODES = 10;
+
+ public void switchModeForward() {
+ mMode = (mMode + 1) % MAX_MODES;
+ switchMode();
+ }
+
+ public void switchModeBackward() {
+ mMode--;
+ if (mMode < 0) mMode = MAX_MODES - 1;
+ switchMode();
+ }
+
+ private void switchMode() {
+ mInventory[28] = null;
+ }
+
+ public void switchThrough() {
+ mThroughPut = (mThroughPut + 1) % 4;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (getBaseMetaTileEntity().isAllowedToWork()
+ && getBaseMetaTileEntity().isServerSide()
+ && getBaseMetaTileEntity().getUniversalEnergyStored() >= (mMode == 5 || mMode == 6 ? 128 : 2048)
+ && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || --mTicksUntilNextUpdate < 1)) {
+ mTicksUntilNextUpdate = 32;
+
+ for (byte i = 19; i < 28; i++) {
+ if (mInventory[i] != null
+ && mInventory[i].isItemStackDamageable()
+ && mInventory[i].getItem().hasContainerItem()) {
+ mInventory[i].setItemDamage(OreDictionary.WILDCARD_VALUE);
+ }
+ }
+
+ if (mInventory[18] == null) {
+ for (byte i = 0; i < 18 && mFluid != null; i++) {
+ ItemStack tOutput = GT_Utility.fillFluidContainer(mFluid, mInventory[i], false, true);
+ if (tOutput != null) {
+ for (byte j = 0; j < 9; j++) {
+ if (mInventory[j] == null
+ || (GT_Utility.areStacksEqual(tOutput, mInventory[j])
+ && mInventory[j].stackSize + tOutput.stackSize
+ <= tOutput.getMaxStackSize())) {
+ mFluid.amount -=
+ GT_Utility.getFluidForFilledItem(tOutput, true).amount * tOutput.stackSize;
+ getBaseMetaTileEntity().decrStackSize(i, 1);
+ if (mInventory[j] == null) {
+ mInventory[j] = tOutput;
+ } else {
+ mInventory[j].stackSize++;
+ }
+ if (mFluid.amount <= 0) mFluid = null;
+ break;
+ }
+ }
+ }
+ }
+
+ ItemStack[] tRecipe = new ItemStack[9];
+ ItemStack tTempStack = null, tOutput = null;
+
+ if (mInventory[17] != null && mThroughPut < 2 && mMode != 0) {
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[17];
+ mInventory[17] = null;
+ }
+ } else {
+ if (!mLastCraftSuccessful) {
+ mCurrentSlot = (mCurrentSlot + 1) % 18;
+ for (int i = 0; i < 17 && mInventory[mCurrentSlot] == null; i++)
+ mCurrentSlot = (mCurrentSlot + 1) % 18;
+ }
+ switch (mMode) {
+ case 0:
+ if (mInventory[mCurrentSlot] != null
+ && !isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
+ if (mInventory[18] == null && mThroughPut < 2 && mCurrentSlot < 8) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ for (int i = 0; i < 9; i++) {
+ tRecipe[i] = mInventory[i + 19];
+ if (tRecipe[i] != null) {
+ tRecipe[i] = GT_Utility.copy(tRecipe[i]);
+ tRecipe[i].stackSize = 1;
+ }
+ }
+ break;
+ case 1:
+ if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
+ tTempStack.stackSize = 1;
+ tRecipe[0] = tTempStack;
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ tRecipe[1] = tTempStack;
+ tRecipe[3] = tTempStack;
+ tRecipe[4] = tTempStack;
+ } else break;
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ tRecipe[2] = tTempStack;
+ tRecipe[5] = tTempStack;
+ tRecipe[6] = tTempStack;
+ tRecipe[7] = tTempStack;
+ tRecipe[8] = tTempStack;
+ } else break;
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ break;
+ case 2:
+ if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
+ tTempStack.stackSize = 1;
+ tRecipe[0] = tTempStack;
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ break;
+ case 3:
+ if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
+ tTempStack.stackSize = 1;
+ tRecipe[0] = tTempStack;
+ tRecipe[1] = tTempStack;
+ tRecipe[3] = tTempStack;
+ tRecipe[4] = tTempStack;
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ break;
+ case 4:
+ if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
+ tTempStack.stackSize = 1;
+ tRecipe[0] = tTempStack;
+ tRecipe[1] = tTempStack;
+ tRecipe[2] = tTempStack;
+ tRecipe[3] = tTempStack;
+ tRecipe[4] = tTempStack;
+ tRecipe[5] = tTempStack;
+ tRecipe[6] = tTempStack;
+ tRecipe[7] = tTempStack;
+ tRecipe[8] = tTempStack;
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ break;
+ case 5:
+ if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
+ tTempStack.stackSize = 1;
+ tRecipe[0] = tTempStack;
+
+ tOutput = GT_OreDictUnificator.get(true, tTempStack);
+
+ if (tOutput != null && GT_Utility.areStacksEqual(tOutput, tTempStack)) tOutput = null;
+
+ if (tOutput == null) {
+ tRecipe[0] = null;
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ }
+ break;
+ case 6:
+ if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ } else if (OrePrefixes.dustSmall.contains(mInventory[mCurrentSlot])) {
+ tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
+ tTempStack.stackSize = 1;
+ tRecipe[0] = tTempStack;
+ tRecipe[1] = tTempStack;
+ tRecipe[3] = tTempStack;
+ tRecipe[4] = tTempStack;
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ } else if (OrePrefixes.dustTiny.contains(mInventory[mCurrentSlot])) {
+ tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
+ tTempStack.stackSize = 1;
+ tRecipe[0] = tTempStack;
+ tRecipe[1] = tTempStack;
+ tRecipe[2] = tTempStack;
+ tRecipe[3] = tTempStack;
+ tRecipe[4] = tTempStack;
+ tRecipe[5] = tTempStack;
+ tRecipe[6] = tTempStack;
+ tRecipe[7] = tTempStack;
+ tRecipe[8] = tTempStack;
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ } else {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ break;
+ case 7:
+ if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])
+ || !OrePrefixes.nugget.contains(mInventory[mCurrentSlot])) {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
+ tTempStack.stackSize = 1;
+ tRecipe[0] = tTempStack;
+ tRecipe[1] = tTempStack;
+ tRecipe[2] = tTempStack;
+ tRecipe[3] = tTempStack;
+ tRecipe[4] = tTempStack;
+ tRecipe[5] = tTempStack;
+ tRecipe[6] = tTempStack;
+ tRecipe[7] = tTempStack;
+ tRecipe[8] = tTempStack;
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ break;
+ case 8:
+ if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])
+ || mInventory[mCurrentSlot].getItemDamage() <= 0
+ || !mInventory[mCurrentSlot].getItem().isRepairable()) {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]);
+ tTempStack.stackSize = 1;
+ for (int i = mCurrentSlot + 1; i < 18; i++) {
+ if (mInventory[i] != null
+ && mInventory[i].getItem() == tTempStack.getItem()
+ && mInventory[mCurrentSlot].getItemDamage() + mInventory[i].getItemDamage()
+ > tTempStack.getMaxDamage()) {
+ tRecipe[0] = tTempStack;
+ tRecipe[1] = GT_Utility.copy(mInventory[i]);
+ if (GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe)
+ == null) {
+ if (mInventory[18] == null) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ case 9:
+ if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) {
+ if (mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mCurrentSlot];
+ mInventory[mCurrentSlot] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ break;
+ }
+ for (byte i = 0, j = 0;
+ i < 18
+ && j < 9
+ && (j < 2
+ || GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity()
+ .getWorld(),
+ tRecipe)
+ == null);
+ i++) {
+ tRecipe[j] = mInventory[(mCurrentSlot + i) % 18];
+ if (tRecipe[j] != null) {
+ tRecipe[j] = GT_Utility.copy(tRecipe[j]);
+ tRecipe[j].stackSize = 1;
+ j++;
+ }
+ }
+ if (tRecipe[1] == null) tRecipe[0] = null;
+ break;
+ }
+ }
+
+ if (tOutput == null)
+ tOutput = GT_ModHandler.getAllRecipeOutput(
+ getBaseMetaTileEntity().getWorld(), tRecipe);
+
+ if (tOutput != null || mMode == 0) mInventory[28] = tOutput;
+
+ if (tOutput == null) {
+ mLastCraftSuccessful = false;
+ } else {
+ if ((tTempStack = GT_OreDictUnificator.get(true, tOutput)) != null) {
+ tTempStack.stackSize = tOutput.stackSize;
+ tOutput = tTempStack;
+ }
+
+ mInventory[28] = GT_Utility.copy(tOutput);
+ ArrayList<ItemStack> tList = recipeContent(tRecipe), tContent = benchContent();
+ if (tList.size() > 0 && tContent.size() > 0) {
+
+ boolean success = (mMode == 6 || mMode == 7 || mInventory[17] == null);
+ for (byte i = 0; i < tList.size() && success; i++) {
+ success = false;
+ for (byte j = 0; j < tContent.size() && !success; j++) {
+ if (GT_Utility.areStacksEqual(tList.get(i), tContent.get(j))) {
+ if (tList.get(i).stackSize <= tContent.get(j).stackSize) {
+ success = true;
+ }
+ }
+ }
+ }
+
+ if (success) {
+ mLastCraftSuccessful = true;
+
+ for (byte i = 8; i > -1; i--) {
+ for (byte j = 17; j > -1; j--) {
+ if (tRecipe[i] != null && mInventory[j] != null) {
+ if (GT_Utility.areStacksEqual(tRecipe[i], mInventory[j])) {
+ ItemStack tStack = GT_Utility.getContainerItem(mInventory[j], true);
+ if (tStack != null) {
+ getBaseMetaTileEntity().decrStackSize(j, 1);
+ if (!tStack.isItemStackDamageable()
+ || tStack.getItemDamage() < tStack.getMaxDamage()) {
+ for (byte k = 9; k < 18; k++) {
+ if (mInventory[k] == null) {
+ mInventory[k] = GT_Utility.copy(tStack);
+ break;
+ } else if (GT_Utility.areStacksEqual(mInventory[k], tStack)
+ && mInventory[k].stackSize + tStack.stackSize
+ <= tStack.getMaxStackSize()) {
+ mInventory[k].stackSize += tStack.stackSize;
+ break;
+ }
+ }
+ }
+ } else {
+ getBaseMetaTileEntity().decrStackSize(j, 1);
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ mInventory[18] = GT_Utility.copy(tOutput);
+ getBaseMetaTileEntity()
+ .decreaseStoredEnergyUnits(
+ mMode == 5 || mMode == 6 || mMode == 7 ? 128 : 2048, true);
+ mTicksUntilNextUpdate = 1;
+ } else {
+ mLastCraftSuccessful = false;
+ if (mInventory[mMode == 0 ? 8 : 17] != null && mInventory[18] == null && mThroughPut < 2) {
+ mInventory[18] = mInventory[mMode == 0 ? 8 : 17];
+ mInventory[mMode == 0 ? 8 : 17] = null;
+ mTicksUntilNextUpdate = 1;
+ }
+ }
+ }
+
+ if (mInventory[18] == null && mThroughPut < 2) {
+ for (byte i = 0; i < 8; i++) {
+ for (byte j = i; ++j < 9; ) {
+ if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j])
+ && mInventory[i].getMaxStackSize() > 8) {
+ mInventory[18] = mInventory[j];
+ mInventory[j] = null;
+ mTicksUntilNextUpdate = 1;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (mThroughPut < 2) {
+ getBaseMetaTileEntity()
+ .decreaseStoredEnergyUnits(
+ GT_Utility.moveOneItemStack(
+ getBaseMetaTileEntity(),
+ getBaseMetaTileEntity()
+ .getIInventoryAtSide(getBaseMetaTileEntity()
+ .getBackFacing()),
+ getBaseMetaTileEntity().getBackFacing(),
+ getBaseMetaTileEntity().getFrontFacing(),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1)
+ * 10,
+ true);
+ }
+ }
+ }
+
+ private boolean isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(ItemStack aStack) {
+ if (aStack == null) return true;
+ for (byte i = 19; i < 28; i++) {
+ if (mInventory[i] != null) {
+ if (GT_Utility.areStacksEqual(mInventory[i], aStack)) return true;
+ if (GT_Utility.areStacksEqual(GT_Utility.getContainerForFilledItem(mInventory[i], true), aStack))
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private ArrayList<ItemStack> recipeContent(ItemStack[] tRecipe) {
+ ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
+ for (byte i = 0; i < 9; i++) {
+ if (tRecipe[i] != null) {
+ boolean temp = false;
+ for (byte j = 0; j < tList.size(); j++) {
+ if (GT_Utility.areStacksEqual(tRecipe[i], tList.get(j))) {
+ tList.get(j).stackSize++;
+ temp = true;
+ break;
+ }
+ }
+ if (!temp) tList.add(GT_Utility.copy(1, tRecipe[i]));
+ }
+ }
+ return tList;
+ }
+
+ private ArrayList<ItemStack> benchContent() {
+ ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
+ for (byte i = 0; i < 18; i++) {
+ if (mInventory[i] != null) {
+ boolean temp = false;
+ for (byte j = 0; j < tList.size(); j++) {
+ if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j])) {
+ tList.get(j).stackSize += mInventory[i].stackSize;
+ temp = true;
+ break;
+ }
+ }
+ if (!temp) tList.add(GT_Utility.copy(mInventory[i]));
+ }
+ }
+ return tList;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return mMode == 0 ? aIndex >= 10 : aIndex >= 18;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return mMode == 0 ? aIndex < 9 : aIndex < 18;
+ }
+
+ /*@Override
+ public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing)
+ return 112;
+ if (GT_Utility.getOppositeSide(aSide) == aFacing)
+ return 113;
+ return 114;
+ }*/
+
+ @Override
+ public int getCapacity() {
+ return 16000;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return -100;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "Automatic Crafting Table Mk III",
+ // this.mDescription,
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFront(i);
+ rTextures[6][i + 1] = this.getBack(i);
+ rTextures[7][i + 1] = this.getBottom(i);
+ rTextures[8][i + 1] = this.getTop(i);
+ rTextures[9][i + 1] = this.getSides(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return this.mTextures[0][aColorIndex + 1];
+ } else if (GT_Utility.getOppositeSide(aSide) == aFacing) {
+ return this.mTextures[1][aColorIndex + 1];
+ } else {
+ return this.mTextures[4][aColorIndex + 1];
+ }
+ /*return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];*/
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay)
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay)
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java
index 732996de71..ebce1fcec6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.automation;
-import java.util.ArrayList;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -15,437 +13,591 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.automation.GT_Container_ElectricInventoryManager;
import gtPlusPlus.xmod.gregtech.api.gui.automation.GT_GUIContainer_ElectricInventoryManager;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
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.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntity_TieredMachineBlock {
- public int[] mSlotRange = new int[4];
- public boolean mWorkedLastTick = false;
- protected String mLocalName;
-
- public GT_MetaTileEntity_ElectricInventoryManager(final int aID, final int aTier, final String aDescription) {
- super(aID, "basicmachine.automation.inventorymanager.0" + aTier, "Electric Inventory Manager (" + GT_Values.VN[aTier] + ")", aTier, 16, aDescription);
- mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")";
- }
-
- public GT_MetaTileEntity_ElectricInventoryManager(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, 16, aDescription, aTextures);
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_ElectricInventoryManager(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_ElectricInventoryManager(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return true;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
- @Override
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public long maxEUInput() {
- return GT_Values.V[mTier];
- }
-
- @Override
- public long maxEUOutput() {
- return GT_Values.V[mTier];
- }
-
- @Override
- public long getMinimumStoredEU() {
- return GT_Values.V[this.mTier];
- }
-
- @Override
- public long maxEUStore() {
- return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]);
- }
-
- @Override
- public long maxAmperesIn() {
- return 4;
- }
-
- @Override
- public long maxAmperesOut() {
- return 4;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return aIndex < 3;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return !isOutputFacing(aSide);
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- for (int i = 0; i < mSlotRange.length; i++) {
- if (aSide == getRangeDirection(i) && getRangeEnergy(i)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 16;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_ElectricInventoryManager(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mSlotRange0", mSlotRange[0]);
- aNBT.setInteger("mSlotRange1", mSlotRange[1]);
- aNBT.setInteger("mSlotRange2", mSlotRange[2]);
- aNBT.setInteger("mSlotRange3", mSlotRange[3]);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mSlotRange[0] = aNBT.getInteger("mSlotRange0");
- mSlotRange[1] = aNBT.getInteger("mSlotRange1");
- mSlotRange[2] = aNBT.getInteger("mSlotRange2");
- mSlotRange[3] = aNBT.getInteger("mSlotRange3");
- }
-
- public void iterateRangeDirection(int aIndex) {
- mSlotRange[aIndex] = (mSlotRange[aIndex] & ~7) | (((mSlotRange[aIndex] & 7) + 1) % 6);
- }
-
- public void switchRangeEnergy(int aIndex) {
- mSlotRange[aIndex] = (mSlotRange[aIndex] & ~8) | ((mSlotRange[aIndex] & 8) > 0 ? 0 : 8);
- }
-
- public void iterateSlot1Direction(int aIndex) {
- mSlotRange[aIndex] = (mSlotRange[aIndex] & ~112) | (((((mSlotRange[aIndex] & 112) >> 4) + 1) % 6) << 4);
- }
-
- public void iterateSlot2Direction(int aIndex) {
- mSlotRange[aIndex] = (mSlotRange[aIndex] & ~896) | (((((mSlotRange[aIndex] & 896) >> 7) + 1) % 6) << 7);
- }
-
- public void iterateSlot3Direction(int aIndex) {
- mSlotRange[aIndex] = (mSlotRange[aIndex] & ~7168) | (((((mSlotRange[aIndex] & 7168) >> 10) + 1) % 6) << 10);
- }
-
- public void switchSlot1InOut(int aIndex) {
- mSlotRange[aIndex] = (mSlotRange[aIndex] & ~8192) | ((mSlotRange[aIndex] & 8192) > 0 ? 0 : 8192);
- }
-
- public void switchSlot2InOut(int aIndex) {
- mSlotRange[aIndex] = (mSlotRange[aIndex] & ~16384) | ((mSlotRange[aIndex] & 16384) > 0 ? 0 : 16384);
- }
-
- public void switchSlot3InOut(int aIndex) {
- mSlotRange[aIndex] = (mSlotRange[aIndex] & ~32768) | ((mSlotRange[aIndex] & 32768) > 0 ? 0 : 32768);
- }
-
- public byte getRangeDirection(int aIndex) {
- return (byte) (mSlotRange[aIndex] & 7);
- }
-
- public byte getSlot1Direction(int aIndex) {
- return (byte) ((mSlotRange[aIndex] & 112) >> 4);
- }
-
- public byte getSlot2Direction(int aIndex) {
- return (byte) ((mSlotRange[aIndex] & 896) >> 7);
- }
-
- public byte getSlot3Direction(int aIndex) {
- return (byte) ((mSlotRange[aIndex] & 7168) >> 10);
- }
-
- public boolean getRangeEnergy(int aIndex) {
- return (mSlotRange[aIndex] & 8) > 0;
- }
-
- public boolean getSlot1InOut(int aIndex) {
- return (mSlotRange[aIndex] & 8192) > 0;
- }
-
- public boolean getSlot2InOut(int aIndex) {
- return (mSlotRange[aIndex] & 16384) > 0;
- }
-
- public boolean getSlot3InOut(int aIndex) {
- return (mSlotRange[aIndex] & 32768) > 0;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().getUniversalEnergyStored() >= 5000
- && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || getBaseMetaTileEntity().getTimer() % 100 == 0 || mWorkedLastTick || getBaseMetaTileEntity().hasInventoryBeenModified())) {
- mWorkedLastTick = false;
-
- IInventory[] tTileEntities = new IInventory[]{
- getBaseMetaTileEntity().getIInventoryAtSide((byte) 0), getBaseMetaTileEntity().getIInventoryAtSide((byte) 1), getBaseMetaTileEntity().getIInventoryAtSide((byte) 2),
- getBaseMetaTileEntity().getIInventoryAtSide((byte) 3), getBaseMetaTileEntity().getIInventoryAtSide((byte) 4), getBaseMetaTileEntity().getIInventoryAtSide((byte) 5), null, null
- };
-
- int tCost = 0;
-
- for (int i = 0; i < 4; i++) {
- if (tTileEntities[getRangeDirection(i)] != null) {
- ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
- ItemStack tStack;
- tList.add(null);
-
- tStack = mInventory[3 + i * 3 + 0];
- if (tStack == null) {
- if (getSlot1InOut(i))
- tCost += 5
- * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot1Direction(i), getSlot1Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- else
- tCost += 5
- * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot1Direction(i), getSlot1Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- }
- else {
- tList.set(0, tStack);
- if (getSlot1InOut(i))
- tCost += 5
- * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot1Direction(i), getSlot1Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1);
- else
- tCost += 5
- * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot1Direction(i), getSlot1Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1);
- }
-
- tStack = mInventory[3 + i * 3 + 1];
- if (tStack == null) {
- if (getSlot2InOut(i))
- tCost += 5
- * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot2Direction(i), getSlot2Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- else
- tCost += 5
- * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot2Direction(i), getSlot2Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- }
- else {
- tList.set(0, tStack);
- if (getSlot2InOut(i))
- tCost += 5
- * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot2Direction(i), getSlot2Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1);
- else
- tCost += 5
- * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot2Direction(i), getSlot2Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1);
- }
-
- tStack = mInventory[3 + i * 3 + 2];
- if (tStack == null) {
- if (getSlot3InOut(i))
- tCost += 5
- * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot3Direction(i), getSlot3Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- else
- tCost += 5
- * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot3Direction(i), getSlot3Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- }
- else {
- tList.set(0, tStack);
- if (getSlot3InOut(i))
- tCost += 5
- * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot3Direction(i), getSlot3Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1);
- else
- tCost += 5
- * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot3Direction(i), getSlot3Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1);
- }
- }
- }
-
- if (tCost > 0) {
- mWorkedLastTick = true;
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCost, true);
- }
- }
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- "It's simpler than you think. I promise.", this.mDescription, CORE.GT_Tooltip
- };
- }
-
- /*@Override
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
- switch (aSide) {
- case 0: return 113 + (aRedstone?8:0);
- case 1: return 112 + (aRedstone?8:0);
- case 2: return 116 + (aRedstone?8:0);
- case 3: return 213 + (aRedstone?8:0);
- case 4: return 212 + (aRedstone?8:0);
- case 5: return 117 + (aRedstone?8:0);
- }
- return 0;
- }*/
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
- return false;
- }
-
- @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 ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[16][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getBottom(i);
- rTextures[1][i + 1] = this.getTop(i);
- rTextures[2][i + 1] = this.getNegativeZ(i);
- rTextures[3][i + 1] = this.getPositiveZ(i);
- rTextures[4][i + 1] = this.getNegativeX(i);
- rTextures[5][i + 1] = this.getPositiveX(i);
- rTextures[6][i + 1] = this.getBottomRedstone(i);
- rTextures[7][i + 1] = this.getTopRedstone(i);
- rTextures[8][i + 1] = this.getNegativeZRedstone(i);
- rTextures[9][i + 1] = this.getPositiveZRedstone(i);
- rTextures[10][i + 1] = this.getNegativeXRedstone(i);
- rTextures[11][i + 1] = this.getPositiveXRedstone(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[!aRedstone ? aSide : aSide + 6][aColorIndex < 0 ? 0 : aColorIndex];
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red)
- };
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green)
- };
- }
-
- public ITexture[] getNegativeZ(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue)
- };
- }
-
- public ITexture[] getPositiveZ(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan)
- };
- }
-
- public ITexture[] getNegativeX(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple)
- };
- }
-
- public ITexture[] getPositiveX(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow)
- };
- }
-
- public ITexture[] getBottomRedstone(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone)
- };
- }
-
- public ITexture[] getTopRedstone(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green_Redstone)
- };
- }
-
- public ITexture[] getNegativeZRedstone(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue_Redstone)
- };
- }
-
- public ITexture[] getPositiveZRedstone(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan_Redstone)
- };
- }
-
- public ITexture[] getNegativeXRedstone(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple_Redstone)
- };
- }
-
- public ITexture[] getPositiveXRedstone(final byte aColor) {
- return new ITexture[]{
- Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow_Redstone)
- };
- }
-
+ public int[] mSlotRange = new int[4];
+ public boolean mWorkedLastTick = false;
+ protected String mLocalName;
+
+ public GT_MetaTileEntity_ElectricInventoryManager(final int aID, final int aTier, final String aDescription) {
+ super(
+ aID,
+ "basicmachine.automation.inventorymanager.0" + aTier,
+ "Electric Inventory Manager (" + GT_Values.VN[aTier] + ")",
+ aTier,
+ 16,
+ aDescription);
+ mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")";
+ }
+
+ public GT_MetaTileEntity_ElectricInventoryManager(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 16, aDescription, aTextures);
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_ElectricInventoryManager(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_ElectricInventoryManager(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return true;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return GT_Values.V[mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return GT_Values.V[mTier];
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return GT_Values.V[this.mTier];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]);
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 4;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 4;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 3;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return !isOutputFacing(aSide);
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ for (int i = 0; i < mSlotRange.length; i++) {
+ if (aSide == getRangeDirection(i) && getRangeEnergy(i)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 16;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_ElectricInventoryManager(
+ this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mSlotRange0", mSlotRange[0]);
+ aNBT.setInteger("mSlotRange1", mSlotRange[1]);
+ aNBT.setInteger("mSlotRange2", mSlotRange[2]);
+ aNBT.setInteger("mSlotRange3", mSlotRange[3]);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mSlotRange[0] = aNBT.getInteger("mSlotRange0");
+ mSlotRange[1] = aNBT.getInteger("mSlotRange1");
+ mSlotRange[2] = aNBT.getInteger("mSlotRange2");
+ mSlotRange[3] = aNBT.getInteger("mSlotRange3");
+ }
+
+ public void iterateRangeDirection(int aIndex) {
+ mSlotRange[aIndex] = (mSlotRange[aIndex] & ~7) | (((mSlotRange[aIndex] & 7) + 1) % 6);
+ }
+
+ public void switchRangeEnergy(int aIndex) {
+ mSlotRange[aIndex] = (mSlotRange[aIndex] & ~8) | ((mSlotRange[aIndex] & 8) > 0 ? 0 : 8);
+ }
+
+ public void iterateSlot1Direction(int aIndex) {
+ mSlotRange[aIndex] = (mSlotRange[aIndex] & ~112) | (((((mSlotRange[aIndex] & 112) >> 4) + 1) % 6) << 4);
+ }
+
+ public void iterateSlot2Direction(int aIndex) {
+ mSlotRange[aIndex] = (mSlotRange[aIndex] & ~896) | (((((mSlotRange[aIndex] & 896) >> 7) + 1) % 6) << 7);
+ }
+
+ public void iterateSlot3Direction(int aIndex) {
+ mSlotRange[aIndex] = (mSlotRange[aIndex] & ~7168) | (((((mSlotRange[aIndex] & 7168) >> 10) + 1) % 6) << 10);
+ }
+
+ public void switchSlot1InOut(int aIndex) {
+ mSlotRange[aIndex] = (mSlotRange[aIndex] & ~8192) | ((mSlotRange[aIndex] & 8192) > 0 ? 0 : 8192);
+ }
+
+ public void switchSlot2InOut(int aIndex) {
+ mSlotRange[aIndex] = (mSlotRange[aIndex] & ~16384) | ((mSlotRange[aIndex] & 16384) > 0 ? 0 : 16384);
+ }
+
+ public void switchSlot3InOut(int aIndex) {
+ mSlotRange[aIndex] = (mSlotRange[aIndex] & ~32768) | ((mSlotRange[aIndex] & 32768) > 0 ? 0 : 32768);
+ }
+
+ public byte getRangeDirection(int aIndex) {
+ return (byte) (mSlotRange[aIndex] & 7);
+ }
+
+ public byte getSlot1Direction(int aIndex) {
+ return (byte) ((mSlotRange[aIndex] & 112) >> 4);
+ }
+
+ public byte getSlot2Direction(int aIndex) {
+ return (byte) ((mSlotRange[aIndex] & 896) >> 7);
+ }
+
+ public byte getSlot3Direction(int aIndex) {
+ return (byte) ((mSlotRange[aIndex] & 7168) >> 10);
+ }
+
+ public boolean getRangeEnergy(int aIndex) {
+ return (mSlotRange[aIndex] & 8) > 0;
+ }
+
+ public boolean getSlot1InOut(int aIndex) {
+ return (mSlotRange[aIndex] & 8192) > 0;
+ }
+
+ public boolean getSlot2InOut(int aIndex) {
+ return (mSlotRange[aIndex] & 16384) > 0;
+ }
+
+ public boolean getSlot3InOut(int aIndex) {
+ return (mSlotRange[aIndex] & 32768) > 0;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (getBaseMetaTileEntity().isAllowedToWork()
+ && getBaseMetaTileEntity().isServerSide()
+ && getBaseMetaTileEntity().getUniversalEnergyStored() >= 5000
+ && (getBaseMetaTileEntity().hasWorkJustBeenEnabled()
+ || getBaseMetaTileEntity().getTimer() % 100 == 0
+ || mWorkedLastTick
+ || getBaseMetaTileEntity().hasInventoryBeenModified())) {
+ mWorkedLastTick = false;
+
+ IInventory[] tTileEntities = new IInventory[] {
+ getBaseMetaTileEntity().getIInventoryAtSide((byte) 0),
+ getBaseMetaTileEntity().getIInventoryAtSide((byte) 1),
+ getBaseMetaTileEntity().getIInventoryAtSide((byte) 2),
+ getBaseMetaTileEntity().getIInventoryAtSide((byte) 3),
+ getBaseMetaTileEntity().getIInventoryAtSide((byte) 4),
+ getBaseMetaTileEntity().getIInventoryAtSide((byte) 5),
+ null,
+ null
+ };
+
+ int tCost = 0;
+
+ for (int i = 0; i < 4; i++) {
+ if (tTileEntities[getRangeDirection(i)] != null) {
+ ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
+ ItemStack tStack;
+ tList.add(null);
+
+ tStack = mInventory[3 + i * 3 + 0];
+ if (tStack == null) {
+ if (getSlot1InOut(i))
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ getBaseMetaTileEntity(),
+ tTileEntities[getRangeDirection(i)],
+ getSlot1Direction(i),
+ getSlot1Direction(i),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ else
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ tTileEntities[getRangeDirection(i)],
+ getBaseMetaTileEntity(),
+ getSlot1Direction(i),
+ getSlot1Direction(i),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ } else {
+ tList.set(0, tStack);
+ if (getSlot1InOut(i))
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ getBaseMetaTileEntity(),
+ tTileEntities[getRangeDirection(i)],
+ getSlot1Direction(i),
+ getSlot1Direction(i),
+ tList,
+ false,
+ (byte) tStack.stackSize,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ else
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ tTileEntities[getRangeDirection(i)],
+ getBaseMetaTileEntity(),
+ getSlot1Direction(i),
+ getSlot1Direction(i),
+ tList,
+ false,
+ (byte) tStack.stackSize,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ }
+
+ tStack = mInventory[3 + i * 3 + 1];
+ if (tStack == null) {
+ if (getSlot2InOut(i))
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ getBaseMetaTileEntity(),
+ tTileEntities[getRangeDirection(i)],
+ getSlot2Direction(i),
+ getSlot2Direction(i),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ else
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ tTileEntities[getRangeDirection(i)],
+ getBaseMetaTileEntity(),
+ getSlot2Direction(i),
+ getSlot2Direction(i),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ } else {
+ tList.set(0, tStack);
+ if (getSlot2InOut(i))
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ getBaseMetaTileEntity(),
+ tTileEntities[getRangeDirection(i)],
+ getSlot2Direction(i),
+ getSlot2Direction(i),
+ tList,
+ false,
+ (byte) tStack.stackSize,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ else
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ tTileEntities[getRangeDirection(i)],
+ getBaseMetaTileEntity(),
+ getSlot2Direction(i),
+ getSlot2Direction(i),
+ tList,
+ false,
+ (byte) tStack.stackSize,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ }
+
+ tStack = mInventory[3 + i * 3 + 2];
+ if (tStack == null) {
+ if (getSlot3InOut(i))
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ getBaseMetaTileEntity(),
+ tTileEntities[getRangeDirection(i)],
+ getSlot3Direction(i),
+ getSlot3Direction(i),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ else
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ tTileEntities[getRangeDirection(i)],
+ getBaseMetaTileEntity(),
+ getSlot3Direction(i),
+ getSlot3Direction(i),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ } else {
+ tList.set(0, tStack);
+ if (getSlot3InOut(i))
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ getBaseMetaTileEntity(),
+ tTileEntities[getRangeDirection(i)],
+ getSlot3Direction(i),
+ getSlot3Direction(i),
+ tList,
+ false,
+ (byte) tStack.stackSize,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ else
+ tCost += 5
+ * GT_Utility.moveOneItemStack(
+ tTileEntities[getRangeDirection(i)],
+ getBaseMetaTileEntity(),
+ getSlot3Direction(i),
+ getSlot3Direction(i),
+ tList,
+ false,
+ (byte) tStack.stackSize,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ }
+ }
+ }
+
+ if (tCost > 0) {
+ mWorkedLastTick = true;
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCost, true);
+ }
+ }
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {"It's simpler than you think. I promise.", this.mDescription, CORE.GT_Tooltip};
+ }
+
+ /*@Override
+ public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
+ switch (aSide) {
+ case 0: return 113 + (aRedstone?8:0);
+ case 1: return 112 + (aRedstone?8:0);
+ case 2: return 116 + (aRedstone?8:0);
+ case 3: return 213 + (aRedstone?8:0);
+ case 4: return 212 + (aRedstone?8:0);
+ case 5: return 117 + (aRedstone?8:0);
+ }
+ return 0;
+ }*/
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return false;
+ }
+
+ @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 ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[16][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getBottom(i);
+ rTextures[1][i + 1] = this.getTop(i);
+ rTextures[2][i + 1] = this.getNegativeZ(i);
+ rTextures[3][i + 1] = this.getPositiveZ(i);
+ rTextures[4][i + 1] = this.getNegativeX(i);
+ rTextures[5][i + 1] = this.getPositiveX(i);
+ rTextures[6][i + 1] = this.getBottomRedstone(i);
+ rTextures[7][i + 1] = this.getTopRedstone(i);
+ rTextures[8][i + 1] = this.getNegativeZRedstone(i);
+ rTextures[9][i + 1] = this.getPositiveZRedstone(i);
+ rTextures[10][i + 1] = this.getNegativeXRedstone(i);
+ rTextures[11][i + 1] = this.getPositiveXRedstone(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[!aRedstone ? aSide : aSide + 6][aColorIndex < 0 ? 0 : aColorIndex];
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red)
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green)
+ };
+ }
+
+ public ITexture[] getNegativeZ(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue)
+ };
+ }
+
+ public ITexture[] getPositiveZ(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan)
+ };
+ }
+
+ public ITexture[] getNegativeX(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple)
+ };
+ }
+
+ public ITexture[] getPositiveX(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow)
+ };
+ }
+
+ public ITexture[] getBottomRedstone(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone)
+ };
+ }
+
+ public ITexture[] getTopRedstone(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green_Redstone)
+ };
+ }
+
+ public ITexture[] getNegativeZRedstone(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue_Redstone)
+ };
+ }
+
+ public ITexture[] getPositiveZRedstone(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan_Redstone)
+ };
+ }
+
+ public ITexture[] getNegativeXRedstone(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple_Redstone)
+ };
+ }
+
+ public ITexture[] getPositiveXRedstone(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow_Redstone)
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
index 9c856840b0..b990e3c55e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
@@ -2,17 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.automation;
import static gtPlusPlus.core.lib.CORE.*;
-import java.util.UUID;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.ISidedInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IDigitalChest;
@@ -23,708 +12,752 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.helpers.tesseract.TesseractHelper;
+import java.util.UUID;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.ISidedInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.*;
public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_BasicTank {
- public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 512;
- public static int TESSERACT_ENERGY_COST = 128;
- public byte isWorking = 0;
- public int oFrequency = 0;
- public int mNeededEnergy = 0;
- public int mFrequency = 0;
- public UUID mOwner;
-
- public GT_MetaTileEntity_TesseractGenerator(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "");
- }
-
- public GT_MetaTileEntity_TesseractGenerator(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_TesseractGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return true;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return false;
- }
-
- @Override
- public boolean isInputFacing(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getBackFacing();
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return false;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return this.getBaseMetaTileEntity().getEUCapacity() / 2;
- }
-
- @Override
- public long maxEUInput() {
- return 512;
- }
-
- @Override
- public long maxEUOutput() {
- return 0;
- }
-
- @Override
- public long maxEUStore() {
- return 512 * 32;
- }
-
- @Override
- public long maxSteamStore() {
- return this.maxEUStore();
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean ownerControl() {
- return true;
- }
-
- @Override
- public int getProgresstime() {
- return (TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner),
- this.mFrequency) == this) && (this.isWorking >= 20) ? 999 : 0;
- }
-
- @Override
- public int maxProgresstime() {
- return 1000;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mFrequency", this.mFrequency);
- if (mOwner != null)
- aNBT.setString("mOwner", mOwner.toString());
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mFrequency = aNBT.getInteger("mFrequency");
- try {
- this.mOwner = UUID.fromString(aNBT.getString("mOnwer"));
- }
- catch (IllegalArgumentException i){
-
- }
- }
-
- @Override
- public void onConfigLoad(final GT_Config aConfig) {
- int J = 1;
- if (CORE.GTNH) {
- J = 4;
- }
- TESSERACT_ENERGY_COST = 128*J;
- TESSERACT_ENERGY_COST_DIMENSIONAL = 512*J;
- }
-
- @Override
- public void onServerStart() {
- sTesseractGeneratorOwnershipMap.clear();
- sTesseractTerminalOwnershipMap.clear();
- }
-
- public void onServerStop() {
- sTesseractGeneratorOwnershipMap.clear();
- sTesseractTerminalOwnershipMap.clear();
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer,
- final byte aSide, final float aX, final float aY, final float aZ) {
-
- if (this.mOwner == null) {
- if (this.getBaseMetaTileEntity().getOwnerName() != null
- && !this.getBaseMetaTileEntity().getOwnerName().equals("")) {
- if (this.getBaseMetaTileEntity().getOwnerName().toLowerCase()
- .equals(aPlayer.getDisplayName().toLowerCase())) {
- this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName());
- }
- }
- }
-
- if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) {
- final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
- case 0:
- Logger.WARNING("Freq. -1 | " + this.mFrequency);
- try {
- CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency -= 1;
-
- break;
- case 1:
- Logger.WARNING("Freq. +1 | " + this.mFrequency);
- try {
- CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency += 1;
- default:
- // Utils.LOG_WARNING("Did not click the correct place.");
- break;
- }
- if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this){
- GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)");
- }
- else {
- GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency);
- }
- } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0){
- GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Generator to configure.");
- }
- }
-
- return true;
- }
-
- @Override
- public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY,
- final float aZ) {
- if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) {
- if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
- case 0:
- try {
- CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency -= 64;
- break;
- case 1:
- try {
- CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency += 64;
- break;
- case 2:
- try {
- CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency -= 512;
- break;
- case 3:
- try {
- CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency += 512;
- }
- if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this){
- GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)");
- }
- else {
- GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency);
- }
- }
- } else {
- GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Generator to configure.");
- }
- }
-
- public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public String[] getInfoData() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork())
- && ((tTileEntity instanceof IGregTechDeviceInformation))
- && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) {
- return ((IGregTechDeviceInformation) tTileEntity).getInfoData();
- }
- return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency,
- (getGeneratorEntity() == this) && (this.isWorking >= 20) ? "Active" : "Inactive" };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- public boolean isSendingInformation() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork())
- && ((tTileEntity instanceof IGregTechDeviceInformation))) {
- return ((IGregTechDeviceInformation) tTileEntity).isGivingInformation();
- }
- return false;
- }
-
- @Override
- public boolean isDigitalChest() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork())
- && ((tTileEntity instanceof IDigitalChest))) {
- return ((IDigitalChest) tTileEntity).isDigitalChest();
- }
- return false;
- }
-
- @Override
- public ItemStack[] getStoredItemData() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork())
- && ((tTileEntity instanceof IDigitalChest))) {
- return ((IDigitalChest) tTileEntity).getStoredItemData();
- }
- return new ItemStack[] {};
- }
-
- @Override
- public void setItemCount(final int aCount) {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork())
- && ((tTileEntity instanceof IDigitalChest))) {
- ((IDigitalChest) tTileEntity).setItemCount(aCount);
- }
- }
-
- @Override
- public int getMaxItemCount() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork())
- && ((tTileEntity instanceof IDigitalChest))) {
- return ((IDigitalChest) tTileEntity).getMaxItemCount();
- }
- return 0;
- }
-
- @Override
- public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- return tTileEntity.isItemValidForSlot(aIndex, aStack);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int aSide) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return new int[0];
- }
- if ((tTileEntity instanceof ISidedInventory)) {
- return ((ISidedInventory) tTileEntity).getAccessibleSlotsFromSide(aSide);
- }
- final int[] rArray = new int[this.getSizeInventory()];
- for (int i = 0; i < this.getSizeInventory(); i++) {
- rArray[i] = i;
- }
- return rArray;
- }
-
- @Override
- public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- if ((tTileEntity instanceof ISidedInventory)) {
- return ((ISidedInventory) tTileEntity).canInsertItem(aIndex, aStack, aSide);
- }
- return true;
- }
-
- @Override
- public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- if ((tTileEntity instanceof ISidedInventory)) {
- return ((ISidedInventory) tTileEntity).canExtractItem(aIndex, aStack, aSide);
- }
- return true;
- }
-
- @Override
- public int getSizeInventory() {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(final int aIndex) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.getStackInSlot(aIndex);
- }
-
- @Override
- public void setInventorySlotContents(final int aIndex, final ItemStack aStack) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return;
- }
- tTileEntity.setInventorySlotContents(aIndex, aStack);
- }
-
- @Override
- public ItemStack decrStackSize(final int aIndex, final int aAmount) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.decrStackSize(aIndex, aAmount);
- }
-
- @Override
- public String getInventoryName() {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return "";
- }
- return tTileEntity.getInventoryName();
- }
-
- @Override
- public int getInventoryStackLimit() {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.getInventoryStackLimit();
- }
-
- @Override
- public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- return tTileEntity.canFill(aSide, aFluid);
- }
-
- @Override
- public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- return tTileEntity.canDrain(aSide, aFluid);
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return new FluidTankInfo[0];
- }
- return tTileEntity.getTankInfo(aSide);
- }
-
- @Override
- public int fill_default(final ForgeDirection aDirection, final FluidStack aFluid, final boolean doFill) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.fill(aDirection, aFluid, doFill);
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aDirection, final int maxDrain, final boolean doDrain) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.drain(aDirection, maxDrain, doDrain);
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.drain(aSide, aFluid, doDrain);
- }
-
- public boolean addEnergyConsumption(final GT_MetaTileEntity_TesseractTerminal aTerminal) {
- if (!this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- int J = (aTerminal.getBaseMetaTileEntity().getWorld() == this.getBaseMetaTileEntity().getWorld()
- ? TESSERACT_ENERGY_COST : TESSERACT_ENERGY_COST_DIMENSIONAL);
-
- if (CORE.GTNH) {
- J *= 4;
- }
-
- this.mNeededEnergy += J;
-
- return true;
- }
-
- public boolean isValidTesseractGenerator(final String aOwnerName, final boolean aWorkIrrelevant) {
- return (this.getBaseMetaTileEntity() != null) && (!this.getBaseMetaTileEntity().isInvalidTileEntity())
- && (this.getBaseMetaTileEntity().isAllowedToWork())
- && ((aOwnerName == null) || (this.getBaseMetaTileEntity().getOwnerName().equals(aOwnerName)))
- && ((aWorkIrrelevant) || (this.isWorking >= 20));
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- // TODO Auto-generated method stub
- super.onPreTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- //Utils.LOG_WARNING("Ticking Generator. 0");
- if (this.getBaseMetaTileEntity().isServerSide()) {
- //Utils.LOG_WARNING("Ticking Generator.");
- // Set owner
- if (PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()) != null) {
- if (this.mOwner == null) {
- Logger.WARNING("Setting Generators Owner. 1");
- this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName());
- }
- }
-
- if (this.mFrequency != this.oFrequency) {
-
- Logger.WARNING("mFreq != oFreq");
-
- if (getGeneratorEntity() == this) {
- getGeneratorEntity(this.oFrequency);
- this.getBaseMetaTileEntity().issueBlockUpdate();
- Logger.WARNING("this Gen == oFreq on map - do block update");
- }
- Logger.WARNING("mFreq will be set to oFreq");
- this.oFrequency = this.mFrequency;
- }
- if ((this.getBaseMetaTileEntity().isAllowedToWork())
- && (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mNeededEnergy, false))) {
- //Utils.LOG_WARNING("Can Work & Has Energy");
- if ((getGeneratorEntity(Integer.valueOf(this.mFrequency)) == null)
- || (!getGeneratorEntity(Integer.valueOf(this.mFrequency)).isValidTesseractGenerator(null,
- true))) {
- //Utils.LOG_WARNING("storing TE I think to mFreq map?");
- TesseractHelper.setGeneratorOwnershipByPlayer(PlayerUtils.getPlayerOnServerFromUUID(mOwner),
- this.mFrequency, this);
- }
- } else {
- if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) {
- Logger.WARNING("this gen == mFreq on map - do block update");
- TesseractHelper.removeGenerator(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency);
- this.getBaseMetaTileEntity().issueBlockUpdate();
- }
- this.isWorking = 0;
- }
- if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) {
- //Utils.LOG_WARNING("mFreq == this - do work related things");
- if (this.isWorking < 20) {
- this.isWorking = ((byte) (this.isWorking + 1));
- }
- if (this.isWorking == 20) {
- this.getBaseMetaTileEntity().issueBlockUpdate();
- this.isWorking = ((byte) (this.isWorking + 1));
- }
- } else {
- this.isWorking = 0;
- }
- this.mNeededEnergy = 0;
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] { this.mDescription,
- "Generates a Tesseract for the attached Inventory",
- "Connect with pipes to insert items",
- "Consumes "+TESSERACT_ENERGY_COST+"EU/t for same dimension transfers",
- "Consumes "+TESSERACT_ENERGY_COST_DIMENSIONAL+"EU/t for cross dimensional transfers",
- CORE.GT_Tooltip};
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- return new ITexture[0][0][0];
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return aSide == aFacing
- ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) }
- : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(Textures.BlockIcons.VOID) };
- }
-
- // To-Do?
- @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;
- }
-
- private GT_MetaTileEntity_TesseractGenerator getGeneratorEntity() {
- GT_MetaTileEntity_TesseractGenerator thisGenerator = TesseractHelper
- .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency);
- if (thisGenerator != null) {
- return thisGenerator;
- }
- return null;
- }
-
- private GT_MetaTileEntity_TesseractGenerator getGeneratorEntity(int frequency) {
- GT_MetaTileEntity_TesseractGenerator thisGenerator = TesseractHelper
- .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency);
- if (thisGenerator != null) {
- return thisGenerator;
- }
- return null;
- }
-
- @Override
- public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- if (this.getBaseMetaTileEntity().getOwnerName() != null
- && !this.getBaseMetaTileEntity().getOwnerName().equals("")) {
- this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName());
- Logger.WARNING("Setting Generators Owner. 2");
- }
- super.onCreated(aStack, aWorld, aPlayer);
- }
-
- @Override
- public void onRemoval() {
- try {
- CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- super.onRemoval();
- }
+ public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 512;
+ public static int TESSERACT_ENERGY_COST = 128;
+ public byte isWorking = 0;
+ public int oFrequency = 0;
+ public int mNeededEnergy = 0;
+ public int mFrequency = 0;
+ public UUID mOwner;
+
+ public GT_MetaTileEntity_TesseractGenerator(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "");
+ }
+
+ public GT_MetaTileEntity_TesseractGenerator(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TesseractGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return true;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return this.getBaseMetaTileEntity().getEUCapacity() / 2;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return 512;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 512 * 32;
+ }
+
+ @Override
+ public long maxSteamStore() {
+ return this.maxEUStore();
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean ownerControl() {
+ return true;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return (TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency)
+ == this)
+ && (this.isWorking >= 20)
+ ? 999
+ : 0;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return 1000;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setInteger("mFrequency", this.mFrequency);
+ if (mOwner != null) aNBT.setString("mOwner", mOwner.toString());
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mFrequency = aNBT.getInteger("mFrequency");
+ try {
+ this.mOwner = UUID.fromString(aNBT.getString("mOnwer"));
+ } catch (IllegalArgumentException i) {
+
+ }
+ }
+
+ @Override
+ public void onConfigLoad(final GT_Config aConfig) {
+ int J = 1;
+ if (CORE.GTNH) {
+ J = 4;
+ }
+ TESSERACT_ENERGY_COST = 128 * J;
+ TESSERACT_ENERGY_COST_DIMENSIONAL = 512 * J;
+ }
+
+ @Override
+ public void onServerStart() {
+ sTesseractGeneratorOwnershipMap.clear();
+ sTesseractTerminalOwnershipMap.clear();
+ }
+
+ public void onServerStop() {
+ sTesseractGeneratorOwnershipMap.clear();
+ sTesseractTerminalOwnershipMap.clear();
+ }
+
+ @Override
+ public boolean onRightclick(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final EntityPlayer aPlayer,
+ final byte aSide,
+ final float aX,
+ final float aY,
+ final float aZ) {
+
+ if (this.mOwner == null) {
+ if (this.getBaseMetaTileEntity().getOwnerName() != null
+ && !this.getBaseMetaTileEntity().getOwnerName().equals("")) {
+ if (this.getBaseMetaTileEntity()
+ .getOwnerName()
+ .toLowerCase()
+ .equals(aPlayer.getDisplayName().toLowerCase())) {
+ this.mOwner = PlayerUtils.getPlayersUUIDByName(
+ this.getBaseMetaTileEntity().getOwnerName());
+ }
+ }
+ }
+
+ if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
+ if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) {
+ final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
+ case 0:
+ Logger.WARNING("Freq. -1 | " + this.mFrequency);
+ try {
+ CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency -= 1;
+
+ break;
+ case 1:
+ Logger.WARNING("Freq. +1 | " + this.mFrequency);
+ try {
+ CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency += 1;
+ default:
+ // Utils.LOG_WARNING("Did not click the correct place.");
+ break;
+ }
+ if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this) {
+ GT_Utility.sendChatToPlayer(
+ aPlayer, "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)");
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency);
+ }
+ } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0) {
+ GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Generator to configure.");
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(
+ final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ) {
+ if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) {
+ if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
+ final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
+ case 0:
+ try {
+ CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency -= 64;
+ break;
+ case 1:
+ try {
+ CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency += 64;
+ break;
+ case 2:
+ try {
+ CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency -= 512;
+ break;
+ case 3:
+ try {
+ CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency += 512;
+ }
+ if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this) {
+ GT_Utility.sendChatToPlayer(
+ aPlayer, "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)");
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency);
+ }
+ }
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Generator to configure.");
+ }
+ }
+
+ public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public String[] getInfoData() {
+ final TileEntity tTileEntity = this.getBaseMetaTileEntity()
+ .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null)
+ && (this.getBaseMetaTileEntity().isAllowedToWork())
+ && ((tTileEntity instanceof IGregTechDeviceInformation))
+ && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) {
+ return ((IGregTechDeviceInformation) tTileEntity).getInfoData();
+ }
+ return new String[] {
+ "Tesseract Generator",
+ "Freqency:",
+ "" + this.mFrequency,
+ (getGeneratorEntity() == this) && (this.isWorking >= 20) ? "Active" : "Inactive"
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ public boolean isSendingInformation() {
+ final TileEntity tTileEntity = this.getBaseMetaTileEntity()
+ .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null)
+ && (this.getBaseMetaTileEntity().isAllowedToWork())
+ && ((tTileEntity instanceof IGregTechDeviceInformation))) {
+ return ((IGregTechDeviceInformation) tTileEntity).isGivingInformation();
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isDigitalChest() {
+ final TileEntity tTileEntity = this.getBaseMetaTileEntity()
+ .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null)
+ && (this.getBaseMetaTileEntity().isAllowedToWork())
+ && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest) tTileEntity).isDigitalChest();
+ }
+ return false;
+ }
+
+ @Override
+ public ItemStack[] getStoredItemData() {
+ final TileEntity tTileEntity = this.getBaseMetaTileEntity()
+ .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null)
+ && (this.getBaseMetaTileEntity().isAllowedToWork())
+ && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest) tTileEntity).getStoredItemData();
+ }
+ return new ItemStack[] {};
+ }
+
+ @Override
+ public void setItemCount(final int aCount) {
+ final TileEntity tTileEntity = this.getBaseMetaTileEntity()
+ .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null)
+ && (this.getBaseMetaTileEntity().isAllowedToWork())
+ && ((tTileEntity instanceof IDigitalChest))) {
+ ((IDigitalChest) tTileEntity).setItemCount(aCount);
+ }
+ }
+
+ @Override
+ public int getMaxItemCount() {
+ final TileEntity tTileEntity = this.getBaseMetaTileEntity()
+ .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null)
+ && (this.getBaseMetaTileEntity().isAllowedToWork())
+ && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest) tTileEntity).getMaxItemCount();
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.isItemValidForSlot(aIndex, aStack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int aSide) {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return new int[0];
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory) tTileEntity).getAccessibleSlotsFromSide(aSide);
+ }
+ final int[] rArray = new int[this.getSizeInventory()];
+ for (int i = 0; i < this.getSizeInventory(); i++) {
+ rArray[i] = i;
+ }
+ return rArray;
+ }
+
+ @Override
+ public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory) tTileEntity).canInsertItem(aIndex, aStack, aSide);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory) tTileEntity).canExtractItem(aIndex, aStack, aSide);
+ }
+ return true;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int aIndex) {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.getStackInSlot(aIndex);
+ }
+
+ @Override
+ public void setInventorySlotContents(final int aIndex, final ItemStack aStack) {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setInventorySlotContents(aIndex, aStack);
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int aIndex, final int aAmount) {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.decrStackSize(aIndex, aAmount);
+ }
+
+ @Override
+ public String getInventoryName() {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return "";
+ }
+ return tTileEntity.getInventoryName();
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
+ final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
+ .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canFill(aSide, aFluid);
+ }
+
+ @Override
+ public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
+ final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
+ .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canDrain(aSide, aFluid);
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
+ final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
+ .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return new FluidTankInfo[0];
+ }
+ return tTileEntity.getTankInfo(aSide);
+ }
+
+ @Override
+ public int fill_default(final ForgeDirection aDirection, final FluidStack aFluid, final boolean doFill) {
+ final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
+ .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.fill(aDirection, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(final ForgeDirection aDirection, final int maxDrain, final boolean doDrain) {
+ final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
+ .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aDirection, maxDrain, doDrain);
+ }
+
+ @Override
+ public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
+ final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
+ .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aSide, aFluid, doDrain);
+ }
+
+ public boolean addEnergyConsumption(final GT_MetaTileEntity_TesseractTerminal aTerminal) {
+ if (!this.getBaseMetaTileEntity().isAllowedToWork()) {
+ return false;
+ }
+ int J = (aTerminal.getBaseMetaTileEntity().getWorld()
+ == this.getBaseMetaTileEntity().getWorld()
+ ? TESSERACT_ENERGY_COST
+ : TESSERACT_ENERGY_COST_DIMENSIONAL);
+
+ if (CORE.GTNH) {
+ J *= 4;
+ }
+
+ this.mNeededEnergy += J;
+
+ return true;
+ }
+
+ public boolean isValidTesseractGenerator(final String aOwnerName, final boolean aWorkIrrelevant) {
+ return (this.getBaseMetaTileEntity() != null)
+ && (!this.getBaseMetaTileEntity().isInvalidTileEntity())
+ && (this.getBaseMetaTileEntity().isAllowedToWork())
+ && ((aOwnerName == null)
+ || (this.getBaseMetaTileEntity().getOwnerName().equals(aOwnerName)))
+ && ((aWorkIrrelevant) || (this.isWorking >= 20));
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ // TODO Auto-generated method stub
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ // Utils.LOG_WARNING("Ticking Generator. 0");
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ // Utils.LOG_WARNING("Ticking Generator.");
+ // Set owner
+ if (PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()) != null) {
+ if (this.mOwner == null) {
+ Logger.WARNING("Setting Generators Owner. 1");
+ this.mOwner = PlayerUtils.getPlayersUUIDByName(
+ this.getBaseMetaTileEntity().getOwnerName());
+ }
+ }
+
+ if (this.mFrequency != this.oFrequency) {
+
+ Logger.WARNING("mFreq != oFreq");
+
+ if (getGeneratorEntity() == this) {
+ getGeneratorEntity(this.oFrequency);
+ this.getBaseMetaTileEntity().issueBlockUpdate();
+ Logger.WARNING("this Gen == oFreq on map - do block update");
+ }
+ Logger.WARNING("mFreq will be set to oFreq");
+ this.oFrequency = this.mFrequency;
+ }
+ if ((this.getBaseMetaTileEntity().isAllowedToWork())
+ && (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mNeededEnergy, false))) {
+ // Utils.LOG_WARNING("Can Work & Has Energy");
+ if ((getGeneratorEntity(Integer.valueOf(this.mFrequency)) == null)
+ || (!getGeneratorEntity(Integer.valueOf(this.mFrequency))
+ .isValidTesseractGenerator(null, true))) {
+ // Utils.LOG_WARNING("storing TE I think to mFreq map?");
+ TesseractHelper.setGeneratorOwnershipByPlayer(
+ PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency, this);
+ }
+ } else {
+ if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) {
+ Logger.WARNING("this gen == mFreq on map - do block update");
+ TesseractHelper.removeGenerator(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency);
+ this.getBaseMetaTileEntity().issueBlockUpdate();
+ }
+ this.isWorking = 0;
+ }
+ if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) {
+ // Utils.LOG_WARNING("mFreq == this - do work related things");
+ if (this.isWorking < 20) {
+ this.isWorking = ((byte) (this.isWorking + 1));
+ }
+ if (this.isWorking == 20) {
+ this.getBaseMetaTileEntity().issueBlockUpdate();
+ this.isWorking = ((byte) (this.isWorking + 1));
+ }
+ } else {
+ this.isWorking = 0;
+ }
+ this.mNeededEnergy = 0;
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Generates a Tesseract for the attached Inventory",
+ "Connect with pipes to insert items",
+ "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers",
+ "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ return new ITexture[0][0][0];
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return aSide == aFacing
+ ? new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency)
+ }
+ : new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
+ new GT_RenderedTexture(Textures.BlockIcons.VOID)
+ };
+ }
+
+ // To-Do?
+ @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;
+ }
+
+ private GT_MetaTileEntity_TesseractGenerator getGeneratorEntity() {
+ GT_MetaTileEntity_TesseractGenerator thisGenerator =
+ TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency);
+ if (thisGenerator != null) {
+ return thisGenerator;
+ }
+ return null;
+ }
+
+ private GT_MetaTileEntity_TesseractGenerator getGeneratorEntity(int frequency) {
+ GT_MetaTileEntity_TesseractGenerator thisGenerator =
+ TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency);
+ if (thisGenerator != null) {
+ return thisGenerator;
+ }
+ return null;
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ if (this.getBaseMetaTileEntity().getOwnerName() != null
+ && !this.getBaseMetaTileEntity().getOwnerName().equals("")) {
+ this.mOwner = PlayerUtils.getPlayersUUIDByName(
+ this.getBaseMetaTileEntity().getOwnerName());
+ Logger.WARNING("Setting Generators Owner. 2");
+ }
+ super.onCreated(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public void onRemoval() {
+ try {
+ CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ super.onRemoval();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java
index 088a596410..5d2a9ae009 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java
@@ -1,13 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.automation;
-import java.util.UUID;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -16,566 +8,605 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.helpers.tesseract.TesseractHelper;
+import java.util.UUID;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+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;
public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_BasicTank {
- public int mFrequency = 0;
- public UUID mOwner;
- public boolean mDidWork = false;
- public static boolean sInterDimensionalTesseractAllowed = true;
- private static int TESSERACT_ENERGY_COST = 128;
- private static int TESSERACT_ENERGY_COST_DIMENSIONAL = 512;
-
- public GT_MetaTileEntity_TesseractTerminal(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "");
- }
-
- public GT_MetaTileEntity_TesseractTerminal(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_TesseractTerminal(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getBackFacing();
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return false;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return (this.getBaseMetaTileEntity().getEUCapacity() / 100);
- }
-
- @Override
- public long maxEUInput() {
- return TESSERACT_ENERGY_COST_DIMENSIONAL;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public long maxEUStore() {
- return TESSERACT_ENERGY_COST_DIMENSIONAL * 8 * 32;
- }
-
- @Override
- public long maxSteamStore() {
- return this.maxEUStore();
- }
-
- @Override
- public boolean ownerControl() {
- return true;
- }
-
- @Override
- public int getProgresstime() {
- return this.getTesseract(this.mFrequency, false) != null ? 999 : 0;
- }
-
- @Override
- public int maxProgresstime() {
- return 1000;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mFrequency", this.mFrequency);
- aNBT.setString("mOwner", mOwner.toString());
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mFrequency = aNBT.getInteger("mFrequency");
- this.mOwner = UUID.fromString(aNBT.getString("mOnwer"));
- }
-
- @Override
- public void onConfigLoad(final GT_Config aConfig) {
- sInterDimensionalTesseractAllowed = true;
- if (CORE.GTNH) {
- TESSERACT_ENERGY_COST = 512;
- TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
- }
- else {
- TESSERACT_ENERGY_COST = 128;
- TESSERACT_ENERGY_COST_DIMENSIONAL = 512;
- }
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer,
- final byte aSide, final float aX, final float aY, final float aZ) {
-
- if (this.mOwner == null) {
- if (this.getBaseMetaTileEntity().getOwnerName() != null
- && !this.getBaseMetaTileEntity().getOwnerName().equals("")) {
- if (this.getBaseMetaTileEntity().getOwnerName().toLowerCase()
- .equals(aPlayer.getDisplayName().toLowerCase())) {
- this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName());
- }
- }
- }
-
- if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) {
- if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
- case 0:
- //Utils.LOG_WARNING("Freq. -1 | " + this.mFrequency);
- try {
- CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency -= 1;
- break;
- case 1:
- //Utils.LOG_WARNING("Freq. +1 | " + this.mFrequency);
- try {
- CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency += 1;
- default:
- // Utils.LOG_WARNING("Did not click the correct place.");
- try {
- CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- break;
- }
- PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency);
- if (this.getTesseract(this.mFrequency, false) != null) {
- PlayerUtils.messagePlayer(aPlayer,
- new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString());
- }
- }
- } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0){
- GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure.");
- }
- return true;
- }
-
- @Override
- public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY,
- final float aZ) {
- if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) {
- if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
- case 0:
- try {
- CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency -= 64;
- break;
- case 1:
- try {
- CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency += 64;
- break;
- case 2:
- try {
- CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency -= 512;
- break;
- case 3:
- try {
- CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- this.mFrequency += 512;
- }
- GT_Utility.sendChatToPlayer(aPlayer,
- "Frequency: " + this.mFrequency
- + (this.getTesseract(this.mFrequency, false) == null ? ""
- : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)")
- .toString()));
- }
- } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0){
- GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure.");
- }
- }
-
- public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- public GT_MetaTileEntity_TesseractGenerator getTesseract(final int aFrequency, final boolean aWorkIrrelevant) {
- final GT_MetaTileEntity_TesseractGenerator rTesseract = TesseractHelper
- .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), aFrequency);
- if (rTesseract == null) {
- return null;
- }
- if (!TesseractHelper.isGeneratorOwnedByPlayer(PlayerUtils.getPlayerOnServerFromUUID(mOwner), rTesseract)) {
- return null;
- }
- if (rTesseract.mFrequency != aFrequency) {
- TesseractHelper.setTerminalOwnershipByPlayer(PlayerUtils.getPlayerOnServerFromUUID(mOwner),
- Integer.valueOf(aFrequency), null);
- return null;
- }
- if (!rTesseract.isValidTesseractGenerator(this.getBaseMetaTileEntity().getOwnerName(), aWorkIrrelevant)) {
- return null;
- }
- if ((!sInterDimensionalTesseractAllowed)
- && (rTesseract.getBaseMetaTileEntity().getWorld() != this.getBaseMetaTileEntity().getWorld())) {
- return null;
- }
- return rTesseract;
- }
-
- @Override
- public String[] getInfoData() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork())
- && (tTileEntity.isSendingInformation())) {
- return tTileEntity.getInfoData();
- }
- return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency,
- this.getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive" };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean isDigitalChest() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- return tTileEntity.isDigitalChest();
- }
-
- @Override
- public ItemStack[] getStoredItemData() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.getStoredItemData();
- }
-
- @Override
- public void setItemCount(final int aCount) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return;
- }
- tTileEntity.setItemCount(aCount);
- }
-
- @Override
- public int getMaxItemCount() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.getMaxItemCount();
- }
-
- @Override
- public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- return tTileEntity.isItemValidForSlot(aIndex, aStack);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int aSide) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return new int[0];
- }
- return tTileEntity.getAccessibleSlotsFromSide(aSide);
- }
-
- @Override
- public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- return tTileEntity.canInsertItem(aIndex, aStack, aSide);
- }
-
- @Override
- public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- return tTileEntity.canExtractItem(aIndex, aStack, aSide);
- }
-
- @Override
- public int getSizeInventory() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(final int aIndex) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.getStackInSlot(aIndex);
- }
-
- @Override
- public void setInventorySlotContents(final int aIndex, final ItemStack aStack) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return;
- }
- tTileEntity.setInventorySlotContents(aIndex, aStack);
- }
-
- @Override
- public ItemStack decrStackSize(final int aIndex, final int aAmount) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.decrStackSize(aIndex, aAmount);
- }
-
- @Override
- public String getInventoryName() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return "";
- }
- return tTileEntity.getInventoryName();
- }
-
- @Override
- public int getInventoryStackLimit() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.getInventoryStackLimit();
- }
-
- @Override
- public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- return tTileEntity.canFill(aSide, aFluid);
- }
-
- @Override
- public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
- }
- return tTileEntity.canDrain(aSide, aFluid);
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return new FluidTankInfo[0];
- }
- return tTileEntity.getTankInfo(aSide);
- }
-
- @Override
- public int fill_default(final ForgeDirection aDirection, final FluidStack aFluid, final boolean doFill) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.fill(aDirection, aFluid, doFill);
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aDirection, final int maxDrain, final boolean doDrain) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.drain(aDirection, maxDrain, doDrain);
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.drain(aSide, aFluid, doDrain);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if ((this.getBaseMetaTileEntity().isServerSide()) && (this.getBaseMetaTileEntity().isAllowedToWork())) {
- // Set owner
- if (PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()) != null) {
- if (this.mOwner == null) {
- this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName());
- }
- }
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, true);
- if (tTileEntity != null) {
- tTileEntity.addEnergyConsumption(this);
- if ((!this.mDidWork) && (this.getTesseract(this.mFrequency, false) != null)) {
- this.mDidWork = true;
- this.getBaseMetaTileEntity().issueBlockUpdate();
- this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(128, false);
- }
- } else if (this.mDidWork == true) {
- this.mDidWork = false;
- this.getBaseMetaTileEntity().issueBlockUpdate();
- }
- }
- }
-
- @Override
- public String[] getDescription() {
- return new String[] { this.mDescription,
- "Accesses Tesseract Generators remotely",
- "Connect with pipes to extract items or fluids",
- "Outputs from the back face",
- "Consumes "+TESSERACT_ENERGY_COST+"EU/t for same dimension transfers",
- "Consumes "+TESSERACT_ENERGY_COST_DIMENSIONAL+"EU/t for cross dimensional transfers",
- CORE.GT_Tooltip};
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- return new ITexture[0][0][0];
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return aSide == aFacing
- ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) }
- : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(Textures.BlockIcons.VOID) };
- }
-
- // To-Do?
- @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;
- }
-
- @Override
- public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- if (this.getBaseMetaTileEntity().getOwnerName() != null
- && !this.getBaseMetaTileEntity().getOwnerName().equals("")) {
- this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName());
- }
- super.onCreated(aStack, aWorld, aPlayer);
- }
-
- @Override
- public void onRemoval() {
- try {
- CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
- } catch (Throwable t) {
- }
- super.onRemoval();
- }
-
+ public int mFrequency = 0;
+ public UUID mOwner;
+ public boolean mDidWork = false;
+ public static boolean sInterDimensionalTesseractAllowed = true;
+ private static int TESSERACT_ENERGY_COST = 128;
+ private static int TESSERACT_ENERGY_COST_DIMENSIONAL = 512;
+
+ public GT_MetaTileEntity_TesseractTerminal(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "");
+ }
+
+ public GT_MetaTileEntity_TesseractTerminal(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TesseractTerminal(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return (this.getBaseMetaTileEntity().getEUCapacity() / 100);
+ }
+
+ @Override
+ public long maxEUInput() {
+ return TESSERACT_ENERGY_COST_DIMENSIONAL;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return TESSERACT_ENERGY_COST_DIMENSIONAL * 8 * 32;
+ }
+
+ @Override
+ public long maxSteamStore() {
+ return this.maxEUStore();
+ }
+
+ @Override
+ public boolean ownerControl() {
+ return true;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return this.getTesseract(this.mFrequency, false) != null ? 999 : 0;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return 1000;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setInteger("mFrequency", this.mFrequency);
+ aNBT.setString("mOwner", mOwner.toString());
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mFrequency = aNBT.getInteger("mFrequency");
+ this.mOwner = UUID.fromString(aNBT.getString("mOnwer"));
+ }
+
+ @Override
+ public void onConfigLoad(final GT_Config aConfig) {
+ sInterDimensionalTesseractAllowed = true;
+ if (CORE.GTNH) {
+ TESSERACT_ENERGY_COST = 512;
+ TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
+ } else {
+ TESSERACT_ENERGY_COST = 128;
+ TESSERACT_ENERGY_COST_DIMENSIONAL = 512;
+ }
+ }
+
+ @Override
+ public boolean onRightclick(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final EntityPlayer aPlayer,
+ final byte aSide,
+ final float aX,
+ final float aY,
+ final float aZ) {
+
+ if (this.mOwner == null) {
+ if (this.getBaseMetaTileEntity().getOwnerName() != null
+ && !this.getBaseMetaTileEntity().getOwnerName().equals("")) {
+ if (this.getBaseMetaTileEntity()
+ .getOwnerName()
+ .toLowerCase()
+ .equals(aPlayer.getDisplayName().toLowerCase())) {
+ this.mOwner = PlayerUtils.getPlayersUUIDByName(
+ this.getBaseMetaTileEntity().getOwnerName());
+ }
+ }
+ }
+
+ if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) {
+ if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
+ final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
+ case 0:
+ // Utils.LOG_WARNING("Freq. -1 | " + this.mFrequency);
+ try {
+ CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency -= 1;
+ break;
+ case 1:
+ // Utils.LOG_WARNING("Freq. +1 | " + this.mFrequency);
+ try {
+ CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency += 1;
+ default:
+ // Utils.LOG_WARNING("Did not click the correct place.");
+ try {
+ CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ break;
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency);
+ if (this.getTesseract(this.mFrequency, false) != null) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ new StringBuilder()
+ .append(EnumChatFormatting.GREEN)
+ .append(" (Connected)")
+ .toString());
+ }
+ }
+ } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0) {
+ GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure.");
+ }
+ return true;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(
+ final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ) {
+ if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) {
+ if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
+ final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
+ case 0:
+ try {
+ CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency -= 64;
+ break;
+ case 1:
+ try {
+ CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency += 64;
+ break;
+ case 2:
+ try {
+ CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency -= 512;
+ break;
+ case 3:
+ try {
+ CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ this.mFrequency += 512;
+ }
+ GT_Utility.sendChatToPlayer(
+ aPlayer,
+ "Frequency: " + this.mFrequency
+ + (this.getTesseract(this.mFrequency, false) == null
+ ? ""
+ : new StringBuilder()
+ .append(EnumChatFormatting.GREEN)
+ .append(" (Connected)")
+ .toString()));
+ }
+ } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0) {
+ GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure.");
+ }
+ }
+
+ public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public GT_MetaTileEntity_TesseractGenerator getTesseract(final int aFrequency, final boolean aWorkIrrelevant) {
+ final GT_MetaTileEntity_TesseractGenerator rTesseract =
+ TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), aFrequency);
+ if (rTesseract == null) {
+ return null;
+ }
+ if (!TesseractHelper.isGeneratorOwnedByPlayer(PlayerUtils.getPlayerOnServerFromUUID(mOwner), rTesseract)) {
+ return null;
+ }
+ if (rTesseract.mFrequency != aFrequency) {
+ TesseractHelper.setTerminalOwnershipByPlayer(
+ PlayerUtils.getPlayerOnServerFromUUID(mOwner), Integer.valueOf(aFrequency), null);
+ return null;
+ }
+ if (!rTesseract.isValidTesseractGenerator(this.getBaseMetaTileEntity().getOwnerName(), aWorkIrrelevant)) {
+ return null;
+ }
+ if ((!sInterDimensionalTesseractAllowed)
+ && (rTesseract.getBaseMetaTileEntity().getWorld()
+ != this.getBaseMetaTileEntity().getWorld())) {
+ return null;
+ }
+ return rTesseract;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity != null)
+ && (this.getBaseMetaTileEntity().isAllowedToWork())
+ && (tTileEntity.isSendingInformation())) {
+ return tTileEntity.getInfoData();
+ }
+ return new String[] {
+ "Tesseract Generator",
+ "Freqency:",
+ "" + this.mFrequency,
+ this.getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive"
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean isDigitalChest() {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.isDigitalChest();
+ }
+
+ @Override
+ public ItemStack[] getStoredItemData() {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.getStoredItemData();
+ }
+
+ @Override
+ public void setItemCount(final int aCount) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setItemCount(aCount);
+ }
+
+ @Override
+ public int getMaxItemCount() {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getMaxItemCount();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.isItemValidForSlot(aIndex, aStack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int aSide) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return new int[0];
+ }
+ return tTileEntity.getAccessibleSlotsFromSide(aSide);
+ }
+
+ @Override
+ public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canInsertItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canExtractItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int aIndex) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.getStackInSlot(aIndex);
+ }
+
+ @Override
+ public void setInventorySlotContents(final int aIndex, final ItemStack aStack) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setInventorySlotContents(aIndex, aStack);
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int aIndex, final int aAmount) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.decrStackSize(aIndex, aAmount);
+ }
+
+ @Override
+ public String getInventoryName() {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return "";
+ }
+ return tTileEntity.getInventoryName();
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canFill(aSide, aFluid);
+ }
+
+ @Override
+ public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canDrain(aSide, aFluid);
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return new FluidTankInfo[0];
+ }
+ return tTileEntity.getTankInfo(aSide);
+ }
+
+ @Override
+ public int fill_default(final ForgeDirection aDirection, final FluidStack aFluid, final boolean doFill) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.fill(aDirection, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(final ForgeDirection aDirection, final int maxDrain, final boolean doDrain) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aDirection, maxDrain, doDrain);
+ }
+
+ @Override
+ public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aSide, aFluid, doDrain);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if ((this.getBaseMetaTileEntity().isServerSide())
+ && (this.getBaseMetaTileEntity().isAllowedToWork())) {
+ // Set owner
+ if (PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()) != null) {
+ if (this.mOwner == null) {
+ this.mOwner = PlayerUtils.getPlayersUUIDByName(
+ this.getBaseMetaTileEntity().getOwnerName());
+ }
+ }
+ final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, true);
+ if (tTileEntity != null) {
+ tTileEntity.addEnergyConsumption(this);
+ if ((!this.mDidWork) && (this.getTesseract(this.mFrequency, false) != null)) {
+ this.mDidWork = true;
+ this.getBaseMetaTileEntity().issueBlockUpdate();
+ this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(128, false);
+ }
+ } else if (this.mDidWork == true) {
+ this.mDidWork = false;
+ this.getBaseMetaTileEntity().issueBlockUpdate();
+ }
+ }
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Accesses Tesseract Generators remotely",
+ "Connect with pipes to extract items or fluids",
+ "Outputs from the back face",
+ "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers",
+ "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ return new ITexture[0][0][0];
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return aSide == aFacing
+ ? new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency)
+ }
+ : new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
+ new GT_RenderedTexture(Textures.BlockIcons.VOID)
+ };
+ }
+
+ // To-Do?
+ @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;
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ if (this.getBaseMetaTileEntity().getOwnerName() != null
+ && !this.getBaseMetaTileEntity().getOwnerName().equals("")) {
+ this.mOwner = PlayerUtils.getPlayersUUIDByName(
+ this.getBaseMetaTileEntity().getOwnerName());
+ }
+ super.onCreated(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public void onRemoval() {
+ try {
+ CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency);
+ } catch (Throwable t) {
+ }
+ super.onRemoval();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java
index 4173489be6..5bd16c7fb2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java
@@ -23,274 +23,287 @@ import net.minecraftforge.fluids.FluidTankInfo;
public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler {
- private final int steamPerSecond;
- private final int tier;
-
- public GT_MetaTileEntity_Boiler_Base(int aID, String aNameRegional, int tier) {
- super(aID, "electricboiler." + tier + ".tier.single", aNameRegional,
- "Produces " + (CORE.ConfigSwitches.boilerSteamPerSecond * tier) + "L of Steam per second");
- this.steamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * tier);
- this.tier = tier;
- }
-
- public GT_MetaTileEntity_Boiler_Base(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- this.steamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * aTier);
- this.tier = aTier;
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- "Produces " + getPollution() + " pollution/sec",
- "Consumes fuel only when temperature is less than 100C",
- "Fuel with burn time greater than 500 is more efficient.",
- "Doesn't explode if there's no water",
- CORE.GT_Tooltip
- };
- }
-
- public ITexture getOverlayIcon() {
- return new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- protected GT_RenderedTexture getCasingTexture() {
- if (this.tier == 1) {
- return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_LV_SIDE);
- } else if (this.tier == 2) {
- return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_MV_SIDE);
- } else {
- return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_HV_SIDE);
- }
- // return new
- // GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1],
- this.getCasingTexture() };
- }
-
- public ITexture[] getBack(final byte aColor) {
- return this.getSides(aColor);
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return this.getSides(aColor);
- }
-
- public ITexture[] getTop(final byte aColor) {
- return this.getSides(aColor);
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1],
- this.getCasingTexture() };
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFront(aColor);
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return this.getSides(aColor);
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public boolean isFacingValid(final byte aSide) {
- return aSide > 1;
- }
-
- // Please find out what I do.
- // I do stuff within the GUI.
- // this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
- @Override
- public int maxProgresstime() {
- return 1000 + (250 * tier);
- }
-
- @Override
- public boolean isElectric() {
- return false;
- }
-
- @Override
- public int getCapacity() {
- return (16000 + (16000 * tier));
- }
-
- // This type of machine can have different water and steam capacities.
- public int getSteamCapacity() {
- return 2 * getCapacity();
- }
-
- @Override
- protected int getProductionPerSecond() {
- return steamPerSecond;
- }
-
- @Override
- protected int getMaxTemperature() {
- return maxProgresstime();
- }
-
- @Override
- protected int getEnergyConsumption() {
- return 2;
- }
-
- @Override
- protected int getCooldownInterval() {
- return 40;
- }
-
- @Override
- protected int getHeatUpRate() {
- return 10;
- }
-
- @Override
- protected void updateFuel(IGregTechTileEntity tile, long ticks) {
- ItemStack fuelStack = this.mInventory[2];
- if(fuelStack == null) return;
-
- int burnTime = getBurnTime(fuelStack);
- if (burnTime > 0 && this.mTemperature <= 101) {
- consumeFuel(tile, fuelStack, burnTime);
- }
- }
-
- @Override
- protected void produceSteam(int aAmount) {
- super.produceSteam(aAmount);
-
- if(mSteam.amount > getSteamCapacity()) {
- sendSound(SOUND_EVENT_LET_OFF_EXCESS_STEAM);
-
- mSteam.amount = getSteamCapacity();
- }
- }
-
- @Override
- // Since this type of machine can have different water and steam capacities, we need to override getTankInfo() to
- // support returning those different capacities.
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- return new FluidTankInfo[]{
- new FluidTankInfo(this.mFluid, getCapacity()),
- new FluidTankInfo(this.mSteam, getSteamCapacity())
- };
- }
-
- @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
- protected int getPollution() {
- return (int) (CORE.ConfigSwitches.basePollutionPerSecondBoiler*CORE.ConfigSwitches.pollutionReleasedByTierBoiler[this.tier]);
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity, "AdvancedBoiler.png");
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Boiler_Base(this.mName, tier, this.mDescription, this.mTextures);
- }
-
- @Override
- protected void onDangerousWaterLack(IGregTechTileEntity tile, long ticks) {
- // Smart boilers don't explode!
- }
-
- /**
- * Returns burn time if the stack is a valid fuel, otherwise return 0.
- */
- private static int getBurnTime(ItemStack stack) {
- int burnTime = GameRegistry.getFuelValue(stack);
- if (burnTime <= 0) {
- burnTime = TileEntityFurnace.getItemBurnTime(stack);
- }
-
- return burnTime;
- }
-
- public void consumeFuel(IGregTechTileEntity tile, ItemStack fuel, int burnTime) {
- this.mProcessingEnergy += burnTime / 10;
- this.mTemperature += burnTime / 500; // will add bonus temperature points if the burn time is pretty high
-
- tile.decrStackSize(2, 1);
- if (tile.getRandomNumber(3) == 0) {
- if (fuel.getDisplayName().toLowerCase().contains("charcoal")
- || fuel.getDisplayName().toLowerCase().contains("coke")) {
- tile.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
- } else {
- tile.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
- }
- }
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) {
- if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) {
- return true;
- }
- return super.allowCoverOnSide(aSide, aCover);
- }
+ private final int steamPerSecond;
+ private final int tier;
+
+ public GT_MetaTileEntity_Boiler_Base(int aID, String aNameRegional, int tier) {
+ super(
+ aID,
+ "electricboiler." + tier + ".tier.single",
+ aNameRegional,
+ "Produces " + (CORE.ConfigSwitches.boilerSteamPerSecond * tier) + "L of Steam per second");
+ this.steamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * tier);
+ this.tier = tier;
+ }
+
+ public GT_MetaTileEntity_Boiler_Base(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ this.steamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * aTier);
+ this.tier = aTier;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Produces " + getPollution() + " pollution/sec",
+ "Consumes fuel only when temperature is less than 100C",
+ "Fuel with burn time greater than 500 is more efficient.",
+ "Doesn't explode if there's no water",
+ CORE.GT_Tooltip
+ };
+ }
+
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ protected GT_RenderedTexture getCasingTexture() {
+ if (this.tier == 1) {
+ return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_LV_SIDE);
+ } else if (this.tier == 2) {
+ return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_MV_SIDE);
+ } else {
+ return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_HV_SIDE);
+ }
+ // return new
+ // GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1], this.getCasingTexture()};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1], this.getCasingTexture()};
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return this.getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return this.getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return this.getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aSide) {
+ return aSide > 1;
+ }
+
+ // Please find out what I do.
+ // I do stuff within the GUI.
+ // this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GT_MetaTileEntity_Boiler)
+ // this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
+ @Override
+ public int maxProgresstime() {
+ return 1000 + (250 * tier);
+ }
+
+ @Override
+ public boolean isElectric() {
+ return false;
+ }
+
+ @Override
+ public int getCapacity() {
+ return (16000 + (16000 * tier));
+ }
+
+ // This type of machine can have different water and steam capacities.
+ public int getSteamCapacity() {
+ return 2 * getCapacity();
+ }
+
+ @Override
+ protected int getProductionPerSecond() {
+ return steamPerSecond;
+ }
+
+ @Override
+ protected int getMaxTemperature() {
+ return maxProgresstime();
+ }
+
+ @Override
+ protected int getEnergyConsumption() {
+ return 2;
+ }
+
+ @Override
+ protected int getCooldownInterval() {
+ return 40;
+ }
+
+ @Override
+ protected int getHeatUpRate() {
+ return 10;
+ }
+
+ @Override
+ protected void updateFuel(IGregTechTileEntity tile, long ticks) {
+ ItemStack fuelStack = this.mInventory[2];
+ if (fuelStack == null) return;
+
+ int burnTime = getBurnTime(fuelStack);
+ if (burnTime > 0 && this.mTemperature <= 101) {
+ consumeFuel(tile, fuelStack, burnTime);
+ }
+ }
+
+ @Override
+ protected void produceSteam(int aAmount) {
+ super.produceSteam(aAmount);
+
+ if (mSteam.amount > getSteamCapacity()) {
+ sendSound(SOUND_EVENT_LET_OFF_EXCESS_STEAM);
+
+ mSteam.amount = getSteamCapacity();
+ }
+ }
+
+ @Override
+ // Since this type of machine can have different water and steam capacities, we need to override getTankInfo() to
+ // support returning those different capacities.
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ return new FluidTankInfo[] {
+ new FluidTankInfo(this.mFluid, getCapacity()), new FluidTankInfo(this.mSteam, getSteamCapacity())
+ };
+ }
+
+ @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
+ protected int getPollution() {
+ return (int) (CORE.ConfigSwitches.basePollutionPerSecondBoiler
+ * CORE.ConfigSwitches.pollutionReleasedByTierBoiler[this.tier]);
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity, "AdvancedBoiler.png");
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boiler_Base(this.mName, tier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ protected void onDangerousWaterLack(IGregTechTileEntity tile, long ticks) {
+ // Smart boilers don't explode!
+ }
+
+ /**
+ * Returns burn time if the stack is a valid fuel, otherwise return 0.
+ */
+ private static int getBurnTime(ItemStack stack) {
+ int burnTime = GameRegistry.getFuelValue(stack);
+ if (burnTime <= 0) {
+ burnTime = TileEntityFurnace.getItemBurnTime(stack);
+ }
+
+ return burnTime;
+ }
+
+ public void consumeFuel(IGregTechTileEntity tile, ItemStack fuel, int burnTime) {
+ this.mProcessingEnergy += burnTime / 10;
+ this.mTemperature += burnTime / 500; // will add bonus temperature points if the burn time is pretty high
+
+ tile.decrStackSize(2, 1);
+ if (tile.getRandomNumber(3) == 0) {
+ if (fuel.getDisplayName().toLowerCase().contains("charcoal")
+ || fuel.getDisplayName().toLowerCase().contains("coke")) {
+ tile.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ } else {
+ tile.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) {
+ if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) {
+ return true;
+ }
+ return super.allowCoverOnSide(aSide, aCover);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java
index dfbd254897..867623f692 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java
@@ -5,52 +5,55 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
-
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-public class GT_MetaTileEntity_Boiler_HV
- extends GT_MetaTileEntity_Boiler_Base {
-
+public class GT_MetaTileEntity_Boiler_HV extends GT_MetaTileEntity_Boiler_Base {
+
public GT_MetaTileEntity_Boiler_HV(int aID, String aNameRegional, int aBoilerTier) {
- super(aID, aNameRegional, aBoilerTier);
+ super(aID, aNameRegional, aBoilerTier);
}
-
+
public GT_MetaTileEntity_Boiler_HV(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
@Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_Boiler_HV(this.mName, 3, this.mDescription, this.mTextures);
}
-
-
+
+ @Override
+ protected GT_RenderedTexture getCasingTexture() {
+ return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_HV_SIDE);
+ }
+
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ super.getFront(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)
+ };
+ }
+
+ @Override
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ super.getTop(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Talonite)
+ };
+ }
+
@Override
- protected GT_RenderedTexture getCasingTexture(){
- return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_HV_SIDE);
- }
-
-
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)
+ };
+ }
+
@Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)};
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Talonite)};
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)};
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return getTop(aColor);
- }
-
-
-
-} \ No newline at end of file
+ public ITexture[] getTopActive(final byte aColor) {
+ return getTop(aColor);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java
index e2b9046c68..6aeedaa6f3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java
@@ -5,48 +5,55 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
-
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-public class GT_MetaTileEntity_Boiler_LV
-extends GT_MetaTileEntity_Boiler_Base {
-
- public GT_MetaTileEntity_Boiler_LV(int aID, String aNameRegional, int aBoilerTier) {
- super(aID, aNameRegional, aBoilerTier);
- }
-
- public GT_MetaTileEntity_Boiler_LV(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Boiler_LV(this.mName, 1, this.mDescription, this.mTextures);
- }
-
-
- @Override
- protected GT_RenderedTexture getCasingTexture(){
- return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_LV_SIDE);
- }
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)};
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Potin)};
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)};
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return getTop(aColor);
- }
-} \ No newline at end of file
+public class GT_MetaTileEntity_Boiler_LV extends GT_MetaTileEntity_Boiler_Base {
+
+ public GT_MetaTileEntity_Boiler_LV(int aID, String aNameRegional, int aBoilerTier) {
+ super(aID, aNameRegional, aBoilerTier);
+ }
+
+ public GT_MetaTileEntity_Boiler_LV(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boiler_LV(this.mName, 1, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ protected GT_RenderedTexture getCasingTexture() {
+ return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_LV_SIDE);
+ }
+
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ super.getFront(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)
+ };
+ }
+
+ @Override
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ super.getTop(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Potin)
+ };
+ }
+
+ @Override
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getTopActive(final byte aColor) {
+ return getTop(aColor);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java
index 7ef781da17..9f329f92da 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java
@@ -5,48 +5,55 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
-
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-public class GT_MetaTileEntity_Boiler_MV
-extends GT_MetaTileEntity_Boiler_Base {
-
- public GT_MetaTileEntity_Boiler_MV(int aID, String aNameRegional, int aBoilerTier) {
- super(aID, aNameRegional, aBoilerTier);
- }
-
- public GT_MetaTileEntity_Boiler_MV(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Boiler_MV(this.mName, 2, this.mDescription, this.mTextures);
- }
-
- @Override
- protected GT_RenderedTexture getCasingTexture(){
- return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_MV_SIDE);
- }
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)};
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Tumbaga)};
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)};
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return getTop(aColor);
- }
-
-} \ No newline at end of file
+public class GT_MetaTileEntity_Boiler_MV extends GT_MetaTileEntity_Boiler_Base {
+
+ public GT_MetaTileEntity_Boiler_MV(int aID, String aNameRegional, int aBoilerTier) {
+ super(aID, aNameRegional, aBoilerTier);
+ }
+
+ public GT_MetaTileEntity_Boiler_MV(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boiler_MV(this.mName, 2, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ protected GT_RenderedTexture getCasingTexture() {
+ return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_MV_SIDE);
+ }
+
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ super.getFront(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)
+ };
+ }
+
+ @Override
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ super.getTop(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Tumbaga)
+ };
+ }
+
+ @Override
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getTopActive(final byte aColor) {
+ return getTop(aColor);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java
index f9cf904cc2..ba6b037d76 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java
@@ -1,11 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_AdvancedBoiler;
-import gtPlusPlus.xmod.gregtech.api.gui.GUI_AdvancedBoiler;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -13,182 +7,214 @@ 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.common.gui.GT_Container_Boiler;
-import gregtech.common.gui.GT_GUIContainer_Boiler;
import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler;
-
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_AdvancedBoiler;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_AdvancedBoiler;
+import net.minecraft.entity.player.InventoryPlayer;
+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_Boiler_Solar
-extends GT_MetaTileEntity_Boiler {
- public GT_MetaTileEntity_Boiler_Solar(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, "Steam Power by the Sun");
- }
-
- public GT_MetaTileEntity_Boiler_Solar(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- "Produces "+(this.getPollution()*20)+" pollution/sec",
- CORE.GT_Tooltip};
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[4][17][];
- for (byte i = -1; i < 16; i = (byte) (i + 1)) {
- final ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
- rTextures[0][(i + 1)] = tmp0;
- final 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;
- final ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
- rTextures[2][(i + 1)] = tmp2;
- final 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;
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[aSide >= 2 ? ((byte) (aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1];
- }
-
- @Override
- public int maxProgresstime() {
- return 500;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png");
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- private int mRunTime = 0;
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mRunTime", this.mRunTime);
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mRunTime = aNBT.getInteger("mRunTime");
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final 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;
- }
- if (this.mSteam != null) {
- final byte i = aBaseMetaTileEntity.getFrontFacing();
- final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null) {
- final FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null) {
- final 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;
- this.mRunTime += 1;
- int tOutput = 150;
- if(this.mRunTime > 10000){
- tOutput = Math.max(50, 150 - ((this.mRunTime-10000)/100));
- }
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(tOutput);
- } else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += tOutput;
- } else {
- this.mSteam = GT_ModHandler.getSteam(tOutput);
- }
- }
- } else {
- this.mHadNoWater = false;
- }
- }
- if ((this.mSteam != null) &&
- (this.mSteam.amount > 16000)) {
- this.sendSound((byte) 1);
- this.mSteam.amount = 12000;
- }
- if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && ((aTick % 256L) == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) {
- final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F);
- this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4)) || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
- }
- if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && ((aTick % 12L) == 0L)) {
- this.mProcessingEnergy -= 1;
- this.mTemperature += 1;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
- }
- }
-
- @Override
- protected int getPollution() {
- return 0;
- }
-
- @Override
- protected int getProductionPerSecond() {
- return 0;
- }
-
- @Override
- protected int getMaxTemperature() {
- return 0;
- }
-
- @Override
- protected int getEnergyConsumption() {
- return 0;
- }
-
- @Override
- protected int getCooldownInterval() {
- return 0;
- }
-
- @Override
- protected void updateFuel(IGregTechTileEntity iGregTechTileEntity, long l) {
-
- }
+public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
+ public GT_MetaTileEntity_Boiler_Solar(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional, "Steam Power by the Sun");
+ }
+
+ public GT_MetaTileEntity_Boiler_Solar(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[4][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ final ITexture[] tmp0 = {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))
+ };
+ rTextures[0][(i + 1)] = tmp0;
+ final 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;
+ final ITexture[] tmp2 = {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))
+ };
+ rTextures[2][(i + 1)] = tmp2;
+ final 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;
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[aSide >= 2 ? ((byte) (aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1];
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return 500;
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png");
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ private int mRunTime = 0;
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mRunTime", this.mRunTime);
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mRunTime = aNBT.getInteger("mRunTime");
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final 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;
+ }
+ if (this.mSteam != null) {
+ final byte i = aBaseMetaTileEntity.getFrontFacing();
+ final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null) {
+ final FluidStack tDrained = aBaseMetaTileEntity.drain(
+ ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null) {
+ final 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;
+ this.mRunTime += 1;
+ int tOutput = 150;
+ if (this.mRunTime > 10000) {
+ tOutput = Math.max(50, 150 - ((this.mRunTime - 10000) / 100));
+ }
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(tOutput);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += tOutput;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(tOutput);
+ }
+ }
+ } else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) && (this.mSteam.amount > 16000)) {
+ this.sendSound((byte) 1);
+ this.mSteam.amount = 12000;
+ }
+ if ((this.mProcessingEnergy <= 0)
+ && (aBaseMetaTileEntity.isAllowedToWork())
+ && ((aTick % 256L) == 0L)
+ && (!aBaseMetaTileEntity.getWorld().isThundering())) {
+ final boolean bRain =
+ aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F);
+ this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4))
+ || !aBaseMetaTileEntity.getSkyAtSide((byte) 1)
+ ? 0
+ : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
+ }
+ if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && ((aTick % 12L) == 0L)) {
+ this.mProcessingEnergy -= 1;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
+ }
+ }
+
+ @Override
+ protected int getPollution() {
+ return 0;
+ }
+
+ @Override
+ protected int getProductionPerSecond() {
+ return 0;
+ }
+
+ @Override
+ protected int getMaxTemperature() {
+ return 0;
+ }
+
+ @Override
+ protected int getEnergyConsumption() {
+ return 0;
+ }
+
+ @Override
+ protected int getCooldownInterval() {
+ return 0;
+ }
+
+ @Override
+ protected void updateFuel(IGregTechTileEntity iGregTechTileEntity, long l) {}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java
index c6f368f0c0..340a97fccf 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java
@@ -2,8 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
import static gregtech.api.enums.GT_Values.V;
-import cofh.api.energy.IEnergyConnection;
-import cofh.api.energy.IEnergyHandler;
import cofh.api.energy.IEnergyProvider;
import cofh.api.energy.IEnergyReceiver;
import cofh.api.energy.IEnergyStorage;
@@ -20,7 +18,6 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
@@ -41,308 +38,342 @@ import net.minecraftforge.common.util.ForgeDirection;
*/
public class GT_MetaTileEntity_RfConvertor extends GregtechMetaEnergyBuffer implements IEnergyReceiver {
-
- public GT_MetaTileEntity_RfConvertor(final String aName, final int aTier,
- final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
- super(aName, aTier, aDescription, aTextures, aSlotCount);
- }
-
- public GT_MetaTileEntity_RfConvertor(final int aID, final String aName,
- final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Use Screwdriver to change voltage",
- "Hold Shift while using Screwdriver to change amperage",
- EnumChatFormatting.DARK_AQUA+"Variable Output Voltage",
- CORE.GT_Tooltip};
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- ITexture[][][] rTextures = new ITexture[12][17][];
- GT_RenderedTexture aTex = new GT_RenderedTexture(TexturesGtBlock.Casing_Material_ZirconiumCarbide);
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
- rTextures[1][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
- rTextures[2][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
- rTextures[3][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
- rTextures[4][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
- rTextures[5][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
- rTextures[6][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]};
- rTextures[7][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]};
- rTextures[8][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]};
- rTextures[9][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]};
- rTextures[10][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]};
- rTextures[11][i + 1] = new ITexture[]{aTex, 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(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_RfConvertor(this.mName, this.mTier, this.mDescription,
- this.mTextures, this.mInventory.length);
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 0;
- }
-
- @Override
- public long maxEUStore() {
- return Integer.MAX_VALUE;
- }
-
- @Override
- public long maxEUInput() {
- return 0;
- }
-
- @Override
- public long maxEUOutput() {
- return V[this.mTier];
- }
-
- @Override
- public long maxAmperesIn() {
- return 0;
- }
-
- @Override
- public boolean isEnetInput() {
- return false;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return !isOutputFacing(aSide);
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;}
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (!aBaseMetaTileEntity.isActive()) {
- aBaseMetaTileEntity.setActive(true);
- }
- if (this.getEUVar() < this.maxEUStore()) {
- for (byte i = 0; i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); i++) {
- if (isInputFacing(i)) {
- receiveEnergy(ForgeDirection.getOrientation(i), Integer.MAX_VALUE, false);
- }
- }
- }
- return;
- }
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public String[] getInfoData() {
- String[] infoData = super.getInfoData();
- return new String[] {
- infoData[0],
- "Converts RF -> GTEU | Tier: "+this.mTier,
- infoData[1],
- infoData[2]
- };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setByte("mTier", this.mTier);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mTier = aNBT.getByte("mTier");
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aPlayer.isSneaking()) {
- byte aTest = (byte) (aCurrentOutputAmperage + 1);
- if (aTest > 16 || aTest <= 0 ) {
- aTest = 1;
- }
- aCurrentOutputAmperage = aTest;
- PlayerUtils.messagePlayer(aPlayer, "Now handling "+maxAmperesOut()+" Amps.");
- }
- else {
- if (this.mTier < (CORE.GTNH ? GT_Values.V.length : 9)) {
- this.mTier++;
- }
- else {
- this.mTier = 0;
- }
- PlayerUtils.messagePlayer(aPlayer, "Now running at "+GT_Values.VOLTAGE_NAMES[this.mTier]+".");
- }
-
- }
-
- @Override
- public boolean canConnectEnergy(ForgeDirection from) {
- if (isOutputFacing((byte) from.ordinal())) {
- return false;
- }
- return true;
- }
-
- @Override
- public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
-
- // Cannot accept power on the output face.
- if (!canConnectEnergy(from) || isOutputFacing((byte) from.ordinal())) {
- return 0;
- }
-
- TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide((byte) from.ordinal());
- if (tTileEntity == null) {
- return 0;
- }
-
- Logger.WARNING("Someone is trying to inject RF from "+from+". Type:"+tTileEntity.getClass().getName());
-
- // Calculate maximum RF we need to consume
- int aInputRF = MathUtils.safeInt(this.maxEUOutput() * GregTech_API.mEUtoRF / 100);
-
- // Make sure we only consume the correct amount of RF that is pushed into this Tile.
- if (aInputRF > maxReceive) {
- aInputRF = maxReceive;
- }
-
- int aInjectedRF = 0;
- boolean aVal = false;
-
- long aStoredEU = this.getEUVar();
- long aMaxEU = this.maxEUStore();
- Logger.WARNING("Stored: "+aStoredEU+", Capacity: "+aMaxEU+"");
- if (aStoredEU < aMaxEU) {
- Logger.WARNING("StoredEU < MaxEU");
- long aRemainingSpace = aMaxEU - aStoredEU;
- if (aRemainingSpace > 0) {
- long tEU = 0;
- byte aSide = (byte) from.ordinal();
- Logger.WARNING("Free: "+aRemainingSpace+"EU");
- if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)), 1, true) == 1) {
- tEU = (long) ((IEnergyProvider) tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)), (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU, false);
- Logger.WARNING("Drained from IEnergyProvider Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
- tEU = tEU * GregTech_API.mRFtoEU / 100;
- }
- else if (tTileEntity instanceof IEnergyStorage && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) {
- tEU = (long) ((IEnergyStorage) tTileEntity).extractEnergy((int) maxEUOutput() * 100 / GregTech_API.mRFtoEU, false);
- Logger.WARNING("Drained from IEnergyStorage Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
- tEU = tEU * GregTech_API.mRFtoEU / 100;
- }
- else if (GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) {
- int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored();
- int extractRF = (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU;
- tEU = 0;
- if (tTileEntity instanceof TileCapBank) {
- ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork();
- if (network != null && network.getEnergyStoredL() > 0) {
- tEU = Math.min((Math.min(Math.min(network.getEnergyStoredL(), storedRF - extractRF), network.getMaxOutput())) * GregTech_API.mRFtoEU / 100, maxEUOutput());
- Logger.WARNING("Drained from EIO CapBank Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
- network.addEnergy((int) -(tEU * 100 / GregTech_API.mRFtoEU));
- }
- } else {
- if (storedRF > extractRF) {
- ((IPowerContainer) tTileEntity).setEnergyStored(storedRF - extractRF);
- tEU = maxEUOutput();
- Logger.WARNING("Drained from EIO Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
- } else {
- ((IPowerContainer) tTileEntity).setEnergyStored(0);
- tEU = storedRF * GregTech_API.mRFtoEU / 100;
- Logger.WARNING("Drained from EIO Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
- }
- }
- }
- Logger.WARNING("EU to inject: "+tEU+"EU");
- if (!simulate) {
- aVal = this.getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true);
- }
- if (tEU > 0) {
- Logger.WARNING("Tried injecting "+tEU+" eu into self. Success? "+aVal);
- }
- }
- }
- return aInjectedRF;
- }
-
- @Override
- public int getEnergyStored(ForgeDirection from) {
- long aStoredEU = this.getEUVar();
- long aMaxEU = this.maxEUStore();
- if (aStoredEU == 0) {
- return 0;
- }
- if (aStoredEU < aMaxEU) {
- long aRemainingSpace = aMaxEU - aStoredEU;
- if (aRemainingSpace > 0) {
- if (aRemainingSpace > (this.maxEUOutput() / (GregTech_API.mEUtoRF / 100))) {
- int aCalculatedFreeSpace = 0;
- int aRfPer10Eu = GregTech_API.mEUtoRF / 10;
- // Calculate how many lots of '10
- aCalculatedFreeSpace = (int) Math.floor(aRemainingSpace / 10);
- // Return value equal to how many lots of '10eu' packets we can fit in.
- return Integer.MAX_VALUE - MathUtils.balance(aCalculatedFreeSpace * aRfPer10Eu, 0, Integer.MAX_VALUE);
- }
- }
- }
- return Integer.MAX_VALUE;
- }
-
- @Override
- public int getMaxEnergyStored(ForgeDirection from) {
- return Integer.MAX_VALUE;
- }
-} \ No newline at end of file
+ public GT_MetaTileEntity_RfConvertor(
+ final String aName,
+ final int aTier,
+ final String aDescription,
+ final ITexture[][][] aTextures,
+ final int aSlotCount) {
+ super(aName, aTier, aDescription, aTextures, aSlotCount);
+ }
+
+ public GT_MetaTileEntity_RfConvertor(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "Use Screwdriver to change voltage",
+ "Hold Shift while using Screwdriver to change amperage",
+ EnumChatFormatting.DARK_AQUA + "Variable Output Voltage",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[12][17][];
+ GT_RenderedTexture aTex = new GT_RenderedTexture(TexturesGtBlock.Casing_Material_ZirconiumCarbide);
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
+ rTextures[1][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
+ rTextures[2][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
+ rTextures[3][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
+ rTextures[4][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
+ rTextures[5][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
+ rTextures[6][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]};
+ rTextures[7][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]};
+ rTextures[8][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]};
+ rTextures[9][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]};
+ rTextures[10][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]};
+ rTextures[11][i + 1] = new ITexture[] {aTex, 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(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_RfConvertor(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[this.mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 0;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return !isOutputFacing(aSide);
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (!aBaseMetaTileEntity.isActive()) {
+ aBaseMetaTileEntity.setActive(true);
+ }
+ if (this.getEUVar() < this.maxEUStore()) {
+ for (byte i = 0;
+ i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity();
+ i++) {
+ if (isInputFacing(i)) {
+ receiveEnergy(ForgeDirection.getOrientation(i), Integer.MAX_VALUE, false);
+ }
+ }
+ }
+ return;
+ }
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ String[] infoData = super.getInfoData();
+ return new String[] {infoData[0], "Converts RF -> GTEU | Tier: " + this.mTier, infoData[1], infoData[2]};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setByte("mTier", this.mTier);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mTier = aNBT.getByte("mTier");
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aPlayer.isSneaking()) {
+ byte aTest = (byte) (aCurrentOutputAmperage + 1);
+ if (aTest > 16 || aTest <= 0) {
+ aTest = 1;
+ }
+ aCurrentOutputAmperage = aTest;
+ PlayerUtils.messagePlayer(aPlayer, "Now handling " + maxAmperesOut() + " Amps.");
+ } else {
+ if (this.mTier < (CORE.GTNH ? GT_Values.V.length : 9)) {
+ this.mTier++;
+ } else {
+ this.mTier = 0;
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Now running at " + GT_Values.VOLTAGE_NAMES[this.mTier] + ".");
+ }
+ }
+
+ @Override
+ public boolean canConnectEnergy(ForgeDirection from) {
+ if (isOutputFacing((byte) from.ordinal())) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
+
+ // Cannot accept power on the output face.
+ if (!canConnectEnergy(from) || isOutputFacing((byte) from.ordinal())) {
+ return 0;
+ }
+
+ TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide((byte) from.ordinal());
+ if (tTileEntity == null) {
+ return 0;
+ }
+
+ Logger.WARNING("Someone is trying to inject RF from " + from + ". Type:"
+ + tTileEntity.getClass().getName());
+
+ // Calculate maximum RF we need to consume
+ int aInputRF = MathUtils.safeInt(this.maxEUOutput() * GregTech_API.mEUtoRF / 100);
+
+ // Make sure we only consume the correct amount of RF that is pushed into this Tile.
+ if (aInputRF > maxReceive) {
+ aInputRF = maxReceive;
+ }
+
+ int aInjectedRF = 0;
+ boolean aVal = false;
+
+ long aStoredEU = this.getEUVar();
+ long aMaxEU = this.maxEUStore();
+ Logger.WARNING("Stored: " + aStoredEU + ", Capacity: " + aMaxEU + "");
+ if (aStoredEU < aMaxEU) {
+ Logger.WARNING("StoredEU < MaxEU");
+ long aRemainingSpace = aMaxEU - aStoredEU;
+ if (aRemainingSpace > 0) {
+ long tEU = 0;
+ byte aSide = (byte) from.ordinal();
+ Logger.WARNING("Free: " + aRemainingSpace + "EU");
+ if (tTileEntity instanceof IEnergyProvider
+ && ((IEnergyProvider) tTileEntity)
+ .extractEnergy(
+ ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)),
+ 1,
+ true)
+ == 1) {
+ tEU = (long) ((IEnergyProvider) tTileEntity)
+ .extractEnergy(
+ ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)),
+ (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU,
+ false);
+ Logger.WARNING("Drained from IEnergyProvider Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + "");
+ tEU = tEU * GregTech_API.mRFtoEU / 100;
+ } else if (tTileEntity instanceof IEnergyStorage
+ && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) {
+ tEU = (long) ((IEnergyStorage) tTileEntity)
+ .extractEnergy((int) maxEUOutput() * 100 / GregTech_API.mRFtoEU, false);
+ Logger.WARNING("Drained from IEnergyStorage Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + "");
+ tEU = tEU * GregTech_API.mRFtoEU / 100;
+ } else if (GregTech_API.meIOLoaded
+ && tTileEntity instanceof IPowerContainer
+ && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) {
+ int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored();
+ int extractRF = (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU;
+ tEU = 0;
+ if (tTileEntity instanceof TileCapBank) {
+ ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork();
+ if (network != null && network.getEnergyStoredL() > 0) {
+ tEU = Math.min(
+ (Math.min(
+ Math.min(network.getEnergyStoredL(), storedRF - extractRF),
+ network.getMaxOutput()))
+ * GregTech_API.mRFtoEU
+ / 100,
+ maxEUOutput());
+ Logger.WARNING("Drained from EIO CapBank Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + "");
+ network.addEnergy((int) -(tEU * 100 / GregTech_API.mRFtoEU));
+ }
+ } else {
+ if (storedRF > extractRF) {
+ ((IPowerContainer) tTileEntity).setEnergyStored(storedRF - extractRF);
+ tEU = maxEUOutput();
+ Logger.WARNING("Drained from EIO Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + "");
+ } else {
+ ((IPowerContainer) tTileEntity).setEnergyStored(0);
+ tEU = storedRF * GregTech_API.mRFtoEU / 100;
+ Logger.WARNING("Drained from EIO Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + "");
+ }
+ }
+ }
+ Logger.WARNING("EU to inject: " + tEU + "EU");
+ if (!simulate) {
+ aVal = this.getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true);
+ }
+ if (tEU > 0) {
+ Logger.WARNING("Tried injecting " + tEU + " eu into self. Success? " + aVal);
+ }
+ }
+ }
+ return aInjectedRF;
+ }
+
+ @Override
+ public int getEnergyStored(ForgeDirection from) {
+ long aStoredEU = this.getEUVar();
+ long aMaxEU = this.maxEUStore();
+ if (aStoredEU == 0) {
+ return 0;
+ }
+ if (aStoredEU < aMaxEU) {
+ long aRemainingSpace = aMaxEU - aStoredEU;
+ if (aRemainingSpace > 0) {
+ if (aRemainingSpace > (this.maxEUOutput() / (GregTech_API.mEUtoRF / 100))) {
+ int aCalculatedFreeSpace = 0;
+ int aRfPer10Eu = GregTech_API.mEUtoRF / 10;
+ // Calculate how many lots of '10
+ aCalculatedFreeSpace = (int) Math.floor(aRemainingSpace / 10);
+ // Return value equal to how many lots of '10eu' packets we can fit in.
+ return Integer.MAX_VALUE
+ - MathUtils.balance(aCalculatedFreeSpace * aRfPer10Eu, 0, Integer.MAX_VALUE);
+ }
+ }
+ }
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ public int getMaxEnergyStored(ForgeDirection from) {
+ return Integer.MAX_VALUE;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java
index d1628bdb59..7d9ecebf2c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java
@@ -11,161 +11,175 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_BasicGenerator {
- public int mEfficiency;
-
- /*public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier);
- onConfigLoad();
- }*/
-
- public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier,
- "Requires semi-fluid Fuel",
- new ITexture[0]);
- onConfigLoad();
- }
-
- public GT_MetaTileEntity_SemiFluidGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- onConfigLoad();
- }
-
- public int getPollution() {
- return (int) (CORE.ConfigSwitches.basePollutionPerSecondSemiFluidGenerator * CORE.ConfigSwitches.pollutionReleasedByTierSemiFluidGenerator[this.mTier]);
- }
-
- @Override
- public int getCapacity() {
- return 4000 * this.mTier;
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
- "SemiFluidGenerator.efficiency.tier." + this.mTier, 100 - (this.mTier * 5));
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SemiFluidGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- //Logger.WARNING("Fuel Count: "+Gregtech_Recipe_Map.sSemiFluidLiquidFuels.mRecipeList.size());
- return GTPP_Recipe_Map.sSemiFluidLiquidFuels;
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- "Produces "+(this.getPollution())+" pollution/sec",
- "Fuel Efficiency: "+this.getEfficiency() + "%",
- CORE.GT_Tooltip};
- }
-
- @Override
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return (aSide == getBaseMetaTileEntity().getFrontFacing());
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) {
- if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) {
- return true;
- }
- return super.allowCoverOnSide(aSide, aCover);
- }
-
- @Override
- public int getFuelValue(ItemStack aStack) {
- if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null)) {
- Logger.WARNING("Bad Fuel?");
- return 0;
- }
- int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
- if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
- }
- Logger.WARNING("Good Fuel: "+rValue);
- return rValue;
- }
-
- @Override
- public ITexture[] getFront(byte aColor) {
- return new ITexture[] { super.getFront(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- @Override
- public ITexture[] getBack(byte aColor) {
- return new ITexture[] { super.getBack(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) };
- }
-
- @Override
- public ITexture[] getBottom(byte aColor) {
- return new ITexture[] { super.getBottom(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) };
- }
-
- @Override
- public ITexture[] getTop(byte aColor) {
- return new ITexture[] { super.getTop(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) };
- }
-
- @Override
- public ITexture[] getSides(byte aColor) {
- return new ITexture[] { super.getSides(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) };
- }
-
- @Override
- public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[] { super.getFrontActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- @Override
- public ITexture[] getBackActive(byte aColor) {
- return new ITexture[] { super.getBackActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) };
- }
-
- @Override
- public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[] { super.getBottomActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) };
- }
-
- @Override
- public ITexture[] getTopActive(byte aColor) {
- return new ITexture[] { super.getTopActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) };
- }
-
- @Override
- public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[] { super.getSidesActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) };
- }
-
+ public int mEfficiency;
+
+ /*public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ onConfigLoad();
+ }*/
+
+ public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires semi-fluid Fuel", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_SemiFluidGenerator(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ public int getPollution() {
+ return (int) (CORE.ConfigSwitches.basePollutionPerSecondSemiFluidGenerator
+ * CORE.ConfigSwitches.pollutionReleasedByTierSemiFluidGenerator[this.mTier]);
+ }
+
+ @Override
+ public int getCapacity() {
+ return 4000 * this.mTier;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig,
+ "SemiFluidGenerator.efficiency.tier." + this.mTier,
+ 100 - (this.mTier * 5));
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_SemiFluidGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ // Logger.WARNING("Fuel Count: "+Gregtech_Recipe_Map.sSemiFluidLiquidFuels.mRecipeList.size());
+ return GTPP_Recipe_Map.sSemiFluidLiquidFuels;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Produces " + (this.getPollution()) + " pollution/sec",
+ "Fuel Efficiency: " + this.getEfficiency() + "%",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return (aSide == getBaseMetaTileEntity().getFrontFacing());
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) {
+ if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) {
+ return true;
+ }
+ return super.allowCoverOnSide(aSide, aCover);
+ }
+
+ @Override
+ public int getFuelValue(ItemStack aStack) {
+ if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null)) {
+ Logger.WARNING("Bad Fuel?");
+ return 0;
+ }
+ int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ Logger.WARNING("Good Fuel: " + rValue);
+ return rValue;
+ }
+
+ @Override
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[] {
+ super.getFront(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[] {
+ super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[] {
+ super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)
+ };
+ }
+
+ @Override
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[] {
+ super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE)
+ };
+ }
+
+ @Override
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[] {
+ super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)
+ };
+ }
+
+ @Override
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[] {
+ super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[] {
+ super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[] {
+ super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[] {
+ super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java
index 2a0133245e..2897f621d6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java
@@ -1,9 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.item.ItemStack;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.ItemList;
@@ -17,137 +14,177 @@ import gregtech.api.util.GT_Recipe;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.item.ItemStack;
-public class GregtechMetaTileEntityDoubleFuelGeneratorBase
-extends GregtechRocketFuelGeneratorBase {
+public class GregtechMetaTileEntityDoubleFuelGeneratorBase extends GregtechRocketFuelGeneratorBase {
- public int mEfficiency;
+ public int mEfficiency;
- public GregtechMetaTileEntityDoubleFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires two liquid Fuels. Fuel A is Fastburn, Fuel B is slowburn.", new ITexture[0]);
- this.onConfigLoad();
- }
+ public GregtechMetaTileEntityDoubleFuelGeneratorBase(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ "Requires two liquid Fuels. Fuel A is Fastburn, Fuel B is slowburn.",
+ new ITexture[0]);
+ this.onConfigLoad();
+ }
+
+ public GregtechMetaTileEntityDoubleFuelGeneratorBase(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ this.onConfigLoad();
+ }
- public GregtechMetaTileEntityDoubleFuelGeneratorBase(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- this.onConfigLoad();
- }
-
@Override
public String[] getDescription() {
- return new String[]{this.mDescription,
- "Generates power at " + this.getEfficiency() + "% Efficiency per tick",
- "Output Voltage: "+this.getOutputTier()+" EU/t",
- CORE.GT_Tooltip
- };
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityDoubleFuelGeneratorBase(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- return GT_Recipe.GT_Recipe_Map.sDieselFuels;
- }
-
- @Override
- public int getCapacity() {
- return 32000;
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, (100 - (this.mTier * 8)));
- }
-
- @Override
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- @Override
- public int getFuelValue(final ItemStack aStack) {
- int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack));
- if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
- }
- return rValue;
- }
-
- private GT_RenderedTexture getCasingTexture(){
- if (this.mTier <= 4){
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
- else if (this.mTier == 5){
-
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
- }
- else {
-
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra);
- }
- //return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
-
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], this.getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
- }
-
- @Override
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent)};
- }
-
- @Override
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)};
- }
-
- @Override
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal)};
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], this.getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
- }
-
- @Override
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast)};
- }
-
- @Override
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)};
- }
-
- @Override
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active)};
- }
-
- @Override
- public int getPollution() {
- return 250;
- }
+ return new String[] {
+ this.mDescription,
+ "Generates power at " + this.getEfficiency() + "% Efficiency per tick",
+ "Output Voltage: " + this.getOutputTier() + " EU/t",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityDoubleFuelGeneratorBase(
+ this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sDieselFuels;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, (100 - (this.mTier * 8)));
+ }
+
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ @Override
+ public int getFuelValue(final ItemStack aStack) {
+ int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ return rValue;
+ }
+
+ private GT_RenderedTexture getCasingTexture() {
+ if (this.mTier <= 4) {
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ } else if (this.mTier == 5) {
+
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
+ } else {
+
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra);
+ }
+ // return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ }
+
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ super.getFront(aColor)[0],
+ this.getCasingTexture(),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ super.getBack(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ @Override
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)
+ };
+ }
+
+ @Override
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ super.getSides(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal)
+ };
+ }
+
+ @Override
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ this.getCasingTexture(),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ super.getBackActive(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ @Override
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)
+ };
+ }
+
+ @Override
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ super.getSidesActive(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active)
+ };
+ }
+
+ @Override
+ public int getPollution() {
+ return 250;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java
index a392ae5a58..ba63952baf 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java
@@ -1,10 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.ItemList;
@@ -16,136 +12,172 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
-public class GregtechMetaTileEntityGeothermalGenerator
-extends GT_MetaTileEntity_BasicGenerator
-{
-
- public int mEfficiency;
-
- public GregtechMetaTileEntityGeothermalGenerator(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires Pahoehoe Lava or Normal Lava as Fuel", new ITexture[0]);
- this.onConfigLoad();
- }
-
- public GregtechMetaTileEntityGeothermalGenerator(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- this.onConfigLoad();
- }
-
- @Override
- public String[] getDescription() {
- String aPollution = "Causes "+this.getPollution()+ " Pollution per second";
- return new String[]{
- this.mDescription,
- "Generates power at " + this.getEfficiency() + "% Efficiency per tick",
- aPollution,
- CORE.GT_Tooltip};
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()){
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public int getCapacity() {
- //return MathUtils.roundToClosestMultiple(32000*(this.mTier/2), 25000);
- return 5000*this.mTier;
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "ThermalGenerator.efficiency.tier." + this.mTier, (100 - (this.mTier * 7)));
- }
-
- @Override
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- @Override
- public int getFuelValue(final ItemStack aStack) {
- int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack));
- if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
- }
- return rValue;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityGeothermalGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
- }
-
- @Override
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical)};
- }
-
- @Override
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)};
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER)};
- }
-
- @Override
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT)};
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
- }
-
- @Override
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical_Active)};
- }
-
- @Override
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)};
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE)};
- }
-
- @Override
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE)};
- }
-
- @Override
- public GT_Recipe_Map getRecipes()
- {
- return GT_Recipe_Map.sHotFuels;
- }
-
- public int getPollution() {
- return (int) (CORE.ConfigSwitches.basePollutionPerSecondGeothermalGenerator * CORE.ConfigSwitches.pollutionReleasedByTierGeothermalGenerator[mTier]);
- }
-} \ No newline at end of file
+public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity_BasicGenerator {
+
+ public int mEfficiency;
+
+ public GregtechMetaTileEntityGeothermalGenerator(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires Pahoehoe Lava or Normal Lava as Fuel", new ITexture[0]);
+ this.onConfigLoad();
+ }
+
+ public GregtechMetaTileEntityGeothermalGenerator(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ this.onConfigLoad();
+ }
+
+ @Override
+ public String[] getDescription() {
+ String aPollution = "Causes " + this.getPollution() + " Pollution per second";
+ return new String[] {
+ this.mDescription,
+ "Generates power at " + this.getEfficiency() + "% Efficiency per tick",
+ aPollution,
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public int getCapacity() {
+ // return MathUtils.roundToClosestMultiple(32000*(this.mTier/2), 25000);
+ return 5000 * this.mTier;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig,
+ "ThermalGenerator.efficiency.tier." + this.mTier,
+ (100 - (this.mTier * 7)));
+ }
+
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ @Override
+ public int getFuelValue(final ItemStack aStack) {
+ int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ return rValue;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityGeothermalGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ super.getFront(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ super.getBack(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)
+ };
+ }
+
+ @Override
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ super.getTop(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER)
+ };
+ }
+
+ @Override
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT)
+ };
+ }
+
+ @Override
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ super.getBackActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical_Active)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ super.getTopActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE)
+ };
+ }
+
+ @Override
+ public GT_Recipe_Map getRecipes() {
+ return GT_Recipe_Map.sHotFuels;
+ }
+
+ public int getPollution() {
+ return (int) (CORE.ConfigSwitches.basePollutionPerSecondGeothermalGenerator
+ * CORE.ConfigSwitches.pollutionReleasedByTierGeothermalGenerator[mTier]);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
index c05c7ae3ff..b6c2f27ce6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
@@ -9,134 +9,164 @@ 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.GTPP_Recipe;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GTPP_Recipe;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.item.ItemStack;
-public class GregtechMetaTileEntityRocketFuelGenerator
-extends GregtechRocketFuelGeneratorBase {
-
- public int mEfficiency;
-
- public GregtechMetaTileEntityRocketFuelGenerator(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires GT++ Rocket Fuels", new ITexture[0]);
- this.onConfigLoad();
- }
-
- public GregtechMetaTileEntityRocketFuelGenerator(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- this.onConfigLoad();
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- //Logger.INFO("Valid Fuels: "+Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList.size());
- return new GregtechMetaTileEntityRocketFuelGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels;
- }
-
- @Override
- public int getCapacity() {
- return 32000;
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, 80 - (10 * (this.mTier - 4)));
- }
-
- @Override
- public int getEfficiency() {
- int eff = 80 - (10 * (this.mTier - 4));
- return eff;
-
- }
-
- @Override
- public int getFuelValue(final ItemStack aStack) {
- int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack));
- if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
- }
- return rValue;
- }
-
- private GT_RenderedTexture getCasingTexture(){
- if (this.mTier <= 4){
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
- else if (this.mTier == 5){
-
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
- }
- else{
-
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra);
- }
- //return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
-
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], this.getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
- }
-
- @Override
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent)};
- }
-
- @Override
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)};
- }
-
- @Override
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal)};
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], this.getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
- }
-
- @Override
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast)};
- }
-
- @Override
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)};
- }
-
- @Override
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active)};
- }
+public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFuelGeneratorBase {
+
+ public int mEfficiency;
+
+ public GregtechMetaTileEntityRocketFuelGenerator(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires GT++ Rocket Fuels", new ITexture[0]);
+ this.onConfigLoad();
+ }
+
+ public GregtechMetaTileEntityRocketFuelGenerator(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ this.onConfigLoad();
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ // Logger.INFO("Valid Fuels: "+Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList.size());
+ return new GregtechMetaTileEntityRocketFuelGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig,
+ "RocketEngine.efficiency.tier." + this.mTier,
+ 80 - (10 * (this.mTier - 4)));
+ }
+
+ @Override
+ public int getEfficiency() {
+ int eff = 80 - (10 * (this.mTier - 4));
+ return eff;
+ }
+
+ @Override
+ public int getFuelValue(final ItemStack aStack) {
+ int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ return rValue;
+ }
+
+ private GT_RenderedTexture getCasingTexture() {
+ if (this.mTier <= 4) {
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ } else if (this.mTier == 5) {
+
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
+ } else {
+
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra);
+ }
+ // return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ }
+
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ super.getFront(aColor)[0],
+ this.getCasingTexture(),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ super.getBack(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ @Override
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)
+ };
+ }
+
+ @Override
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ super.getSides(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal)
+ };
+ }
+
+ @Override
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ this.getCasingTexture(),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ super.getBackActive(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ @Override
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)
+ };
+ }
+
+ @Override
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ super.getSidesActive(aColor)[0],
+ this.getCasingTexture(),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active)
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java
index 68dbc4fb61..660fdb50b6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java
@@ -2,8 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
import static gregtech.api.enums.GT_Values.V;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Textures;
@@ -11,177 +9,218 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SolarGenerator;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_SolarGenerator;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechMetaSolarGenerator;
+import net.minecraft.entity.player.InventoryPlayer;
public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGenerator {
- public GregtechMetaTileEntitySolarGenerator(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, "Feasts on the power of the Sun!", new ITexture[0]);
- this.onConfigLoad();
- }
+ public GregtechMetaTileEntitySolarGenerator(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Feasts on the power of the Sun!", new ITexture[0]);
+ this.onConfigLoad();
+ }
+
+ public GregtechMetaTileEntitySolarGenerator(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ this.onConfigLoad();
+ }
- public GregtechMetaTileEntitySolarGenerator(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- this.onConfigLoad();
- }
-
@Override
public String[] getDescription() {
- return new String[]{this.mDescription,
- "Generates power at " + this.getEfficiency() + "% Efficiency per tick",
- "Output Voltage: "+this.getOutputTier()+" EU/t",
- CORE.GT_Tooltip
- };
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png");
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntitySolarGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SunAbsorber.efficiency.tier." + this.mTier, 100 - (this.mTier * 10));
-
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork()
- && (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()))) {
-
- if (this.mSolarCharge <= 20) {
- //Utils.LOG_WARNING("1.");
- this.mSolarCharge = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 45) {
- //Utils.LOG_WARNING("2.");
- this.mSolarCharge -= 1;
- this.mLossTimer = 0;
- }
-
- if ((aTick % 10L) == 0L) {
-
- Logger.WARNING("getUniversalEnergyStored: "+aBaseMetaTileEntity.getUniversalEnergyStored() + " maxEUOutput * 20 + getMinimumStoredEU: " + ((this.maxEUOutput() * 20) + this.getMinimumStoredEU()));
-
- if ((this.mSolarCharge > 100) && (aBaseMetaTileEntity.isAllowedToWork()) &&
- (!aBaseMetaTileEntity.getWorld().isThundering()) &&
- (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUStore() - this.getMinimumStoredEU()))) {
- this.getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerTick * this.getEfficiency(), true);
- }
- }
-
- if ((this.mSolarCharge < 500) && (this.mProcessingEnergy != 0) && ((aTick % 32L) == 0L)) {
- Logger.WARNING("Adding Solar Charge. Currently "+this.mSolarCharge);
- this.mProcessingEnergy -= 1;
- this.mSolarCharge += 1;
- }
-
- if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && ((aTick % 64L) == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) {
- Logger.WARNING("Adding Processing Energy. Currently "+this.mProcessingEnergy);
- final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F);
- this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4)) || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
- }
-
- if (aBaseMetaTileEntity.isServerSide()){
- //Utils.LOG_WARNING("6.");
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.getUniversalEnergyStored() >= (this.maxEUOutput() + this.getMinimumStoredEU())));
- }
- }
- }
-
- @Override
- public void inValidate() {
-
- }
-
- @Override
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- @Override
- public long maxEUStore() {
- return Math.max(this.getEUVar(), (V[this.mTier] * 16000) + this.getMinimumStoredEU());
- }
-
-
- ITexture SolarArray[] = {new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_8V),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_MV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_HV),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_EV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_ZPM), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
-
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
- }
-
- @Override
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
- }
-
- @Override
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
- }
-
- @Override
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
- }
-
- @Override
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
- }
-
- @Override
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
- }
-
- @Override
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
- }
-
-} \ No newline at end of file
+ return new String[] {
+ this.mDescription,
+ "Generates power at " + this.getEfficiency() + "% Efficiency per tick",
+ "Output Voltage: " + this.getOutputTier() + " EU/t",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png");
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntitySolarGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig, "SunAbsorber.efficiency.tier." + this.mTier, 100 - (this.mTier * 10));
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()
+ && aBaseMetaTileEntity.isAllowedToWork()
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ < (this.maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()))) {
+
+ if (this.mSolarCharge <= 20) {
+ // Utils.LOG_WARNING("1.");
+ this.mSolarCharge = 20;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 45) {
+ // Utils.LOG_WARNING("2.");
+ this.mSolarCharge -= 1;
+ this.mLossTimer = 0;
+ }
+
+ if ((aTick % 10L) == 0L) {
+
+ Logger.WARNING("getUniversalEnergyStored: " + aBaseMetaTileEntity.getUniversalEnergyStored()
+ + " maxEUOutput * 20 + getMinimumStoredEU: "
+ + ((this.maxEUOutput() * 20) + this.getMinimumStoredEU()));
+
+ if ((this.mSolarCharge > 100)
+ && (aBaseMetaTileEntity.isAllowedToWork())
+ && (!aBaseMetaTileEntity.getWorld().isThundering())
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ < (this.maxEUStore() - this.getMinimumStoredEU()))) {
+ this.getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerTick * this.getEfficiency(), true);
+ }
+ }
+
+ if ((this.mSolarCharge < 500) && (this.mProcessingEnergy != 0) && ((aTick % 32L) == 0L)) {
+ Logger.WARNING("Adding Solar Charge. Currently " + this.mSolarCharge);
+ this.mProcessingEnergy -= 1;
+ this.mSolarCharge += 1;
+ }
+
+ if ((this.mProcessingEnergy <= 0)
+ && (aBaseMetaTileEntity.isAllowedToWork())
+ && ((aTick % 64L) == 0L)
+ && (!aBaseMetaTileEntity.getWorld().isThundering())) {
+ Logger.WARNING("Adding Processing Energy. Currently " + this.mProcessingEnergy);
+ final boolean bRain =
+ aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F);
+ this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4))
+ || !aBaseMetaTileEntity.getSkyAtSide((byte) 1)
+ ? 0
+ : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ // Utils.LOG_WARNING("6.");
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
+ && (aBaseMetaTileEntity.getUniversalEnergyStored()
+ >= (this.maxEUOutput() + this.getMinimumStoredEU())));
+ }
+ }
+ }
+
+ @Override
+ public void inValidate() {}
+
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Math.max(this.getEUVar(), (V[this.mTier] * 16000) + this.getMinimumStoredEU());
+ }
+
+ ITexture SolarArray[] = {
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_8V),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LV),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_MV),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_HV),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_EV),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_ZPM),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UV),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)
+ };
+
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ super.getFront(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)
+ };
+ }
+
+ @Override
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
+ }
+
+ @Override
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)
+ };
+ }
+
+ @Override
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]
+ };
+ }
+
+ @Override
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
+ }
+
+ @Override
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)
+ };
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java
index ab000b98d4..5e8907073f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java
@@ -1,390 +1,399 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-
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_BasicGenerator;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GTPP_Recipe;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.fluids.FluidStack;
public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator {
- public int mEfficiency;
- private int mDays;
- private long mTicksToBurnFor;
- private int mVoltage = 0;
- private GT_Recipe mCurrentRecipe;
- private int mDaysRemaining = 0;
- private int mDayTick = 0;
- private byte mNewTier = 0;
-
- public int removeDayOfTime(){
- if (this.mDaysRemaining > 0){
- return this.mDaysRemaining--;
- }
- return this.mDaysRemaining;
- }
-
- //Generates fuel value based on MC days
- public static int convertDaysToTicks(float days){
- int value = 0;
- value = MathUtils.roundToClosestInt(20*86400*days);
- return value;
- }
-
- public static long getTotalEUGenerated(int ticks, int voltage){
- return ticks*voltage;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setLong("mTicksToBurnFor", this.mTicksToBurnFor);
- aNBT.setInteger("mVoltage", this.mVoltage);
- aNBT.setInteger("mDaysRemaining", this.mDaysRemaining);
- aNBT.setInteger("mDayTick", this.mDayTick);
- aNBT.setByte("mNewTier", this.mNewTier);
-
-
- if (this.mCurrentRecipe != null){
- final NBTTagList list = new NBTTagList();
- final ItemStack stack = this.mCurrentRecipe.mInputs[0];
- if(stack != null){
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("mSlot", 0);
- list.appendTag(data);
- }
- aNBT.setTag("mRecipeItem", list);
- }
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- //this.mMachineBlock = aNBT.getByte("mMachineBlock");
- this.mTicksToBurnFor = aNBT.getLong("mTicksToBurnFor");
- this.mVoltage = aNBT.getInteger("mVoltage");
- this.mDaysRemaining = aNBT.getInteger("mDaysRemaining");
- this.mDayTick = aNBT.getInteger("mDayTick");
- this.mNewTier = aNBT.getByte("mNewTier");
-
- try {
- ReflectionUtils.setByte(this, "mTier", this.mNewTier);
- }
- catch (Exception e) {
- if (this.getBaseMetaTileEntity() != null){
- IGregTechTileEntity thisTile = this.getBaseMetaTileEntity();
- if (thisTile.isAllowedToWork() || thisTile.isActive()){
- thisTile.setActive(false);
- }
- }
- }
-
-
- final NBTTagList list = aNBT.getTagList("mRecipeItem", 10);
- final NBTTagCompound data = list.getCompoundTagAt(0);
- ItemStack lastUsedFuel = ItemStack.loadItemStackFromNBT(data);
- if (lastUsedFuel != null){
- this.mCurrentRecipe = getRecipes().findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] { lastUsedFuel });
- }
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()){
- if (this.mDayTick < 24000){
- this.mDayTick++;
- }
- else if (this.mDayTick >= 24000){
- this.mDayTick = 0;
- this.mDaysRemaining = this.removeDayOfTime();
- }
- }
-
-
- if ((aBaseMetaTileEntity.isServerSide()) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 10L == 0L)) {
- long tProducedEU = 0L;
- if (this.mFluid == null) {
- if (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + getMinimumStoredEU()) {
- this.mInventory[getStackDisplaySlot()] = null;
- } else {
- if (this.mInventory[getStackDisplaySlot()] == null)
- this.mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- this.mInventory[getStackDisplaySlot()].setStackDisplayName("Generating: "
- + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU");
- }
- } else {
- int tFuelValue = getFuelValue(this.mFluid);
- int tConsumed = consumedFluidPerOperation(this.mFluid);
- if ((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount > tConsumed)) {
- long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed,
- (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
- if ((tFluidAmountToUse > 0L)
- && (aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true))) {
- tProducedEU = tFluidAmountToUse * tFuelValue;
- FluidStack tmp260_257 = this.mFluid;
- tmp260_257.amount = (int) (tmp260_257.amount - (tFluidAmountToUse * tConsumed));
- }
- }
- }
- if ((this.mInventory[getInputSlot()] != null)
- && (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() * 20L + getMinimumStoredEU())
- && (GT_Utility.getFluidForFilledItem(this.mInventory[getInputSlot()], true) == null)) {
- int tFuelValue = getFuelValue(this.mInventory[getInputSlot()]);
- if (tFuelValue > 0) {
- ItemStack tEmptyContainer = getEmptyContainer(this.mInventory[getInputSlot()]);
- if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
- aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
- tProducedEU = tFuelValue;
- }
- }
- }
- if ((tProducedEU > 0L) && (getPollution() > 0)) {
- PollutionUtils.addPollution(aBaseMetaTileEntity, (int) (tProducedEU * getPollution() / 500 * this.mTier + 1L));
- }
- }
-
- if (aBaseMetaTileEntity.isServerSide())
- aBaseMetaTileEntity.setActive((aBaseMetaTileEntity.isAllowedToWork())
- && (aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()));
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{this.mDescription,
- "Fuel is measured in minecraft days (Check with Scanner)",
- "RTG changes output voltage depending on fuel",
- "Generates power at " + this.getEfficiency() + "% Efficiency per tick",
- "Output Voltage: "+this.getOutputTier()+" EU/t",
- CORE.GT_Tooltip
- };
- }
-
- public GregtechMetaTileEntity_RTG(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires RTG Pellets", new ITexture[0]);
- }
-
- private byte getTier(){
- int voltage = this.mVoltage;
- if (voltage >= 512){
- return 4;
- }
- else if (voltage >= 128){
- return 3;
- }
- else if (voltage >= 32){
- return 2;
- }
- else if (voltage >= 8){
- return 1;
- }
- return 0;
- }
-
- public GregtechMetaTileEntity_RTG(String aName, int aTier, String aDescription,
- ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return ((aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing())
- && (aSide != getBaseMetaTileEntity().getBackFacing()));
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_RTG(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- return GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels;
- }
-
- @Override
- public int getCapacity() {
- return 0;
- }
-
- @Override
- public int getEfficiency() {
- return this.mEfficiency = 100;
- }
-
- @Override
- public ITexture[] getFront(byte aColor) {
- return new ITexture[] { super.getFront(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB) };
- }
-
- @Override
- public ITexture[] getBack(byte aColor) {
- return new ITexture[] { super.getBack(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) };
- }
-
- @Override
- public ITexture[] getBottom(byte aColor) {
- return new ITexture[] { super.getBottom(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) };
- }
-
- @Override
- public ITexture[] getTop(byte aColor) {
- return new ITexture[] { super.getTop(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP),
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) };
- }
-
- @Override
- public ITexture[] getSides(byte aColor) {
- return new ITexture[]{
- gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
- gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()]};
- }
-
- @Override
- public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[] { super.getFrontActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE) };
- }
-
- @Override
- public ITexture[] getBackActive(byte aColor) {
- return new ITexture[] { super.getBackActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) };
- }
-
- @Override
- public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[] { super.getBottomActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) };
- }
-
- @Override
- public ITexture[] getTopActive(byte aColor) {
- return new ITexture[] { super.getTopActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) };
- }
-
- @Override
- public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[]{
- gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)],
- new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
- gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()]};
- }
-
-
- public int getPollution() {
- return 0;
- }
-
- @Override
- public int getFuelValue(ItemStack aStack) {
- if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null))
- return 0;
- GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null,
- new ItemStack[] { aStack });
- if (tFuel != null){
- this.mCurrentRecipe = tFuel;
- int voltage = tFuel.mEUt;
- this.mVoltage = voltage;
- int sfsf = this.mTier;
- //this.mDaysRemaining = tFuel.mSpecialValue*365;
-
- //Do some voodoo.
- byte mTier2;
- //mTier2 = ReflectionUtils.getField(this.getClass(), "mTier");
- try {
- if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_AM241.get(1))){
- mTier2 = 1;
- }
- else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PO210.get(1))){
- mTier2 = 3;
- }
- else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PU238.get(1))){
- mTier2 = 2;
- }
- else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_SR90.get(1))){
- mTier2 = 1;
- }
- else {
- //Utils.LOG_INFO("test:"+tFuel.mInputs[0].getDisplayName() + " | " + (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PU238.get(1))));
- mTier2 = 0;
- }
- ReflectionUtils.setByte(this, "mTier", mTier2);
- this.mNewTier = mTier2;
- //ReflectionUtils.setFinalStatic(mTier2, GT_Values.V[0]);
- } catch (Exception e) {
- Logger.WARNING("Failed setting mTier.");
- e.printStackTrace();
- }
-
- this.mTicksToBurnFor = getTotalEUGenerated(convertDaysToTicks(tFuel.mSpecialValue), voltage);
- if (mTicksToBurnFor >= Integer.MAX_VALUE){
- mTicksToBurnFor = Integer.MAX_VALUE;
- Logger.WARNING("Fuel went over Int limit, setting to MAX_VALUE.");
- }
- this.mDaysRemaining = MathUtils.roundToClosestInt(mTicksToBurnFor/20/60/3);
- Logger.WARNING("step | "+(int) (mTicksToBurnFor * getEfficiency() / 100L));
- return (int) (mTicksToBurnFor * getEfficiency() / 100L);
- //return (int) (tFuel.mSpecialValue * 365L * getEfficiency() / 100L);
- //return tFuel.mEUt;
- }
- Logger.WARNING("Not sure");
- return 0;
- }
-
- @Override
- public long maxEUOutput() {
- return ((getBaseMetaTileEntity().isAllowedToWork()) ? this.mVoltage : 0L);
- }
-
- @Override
- public long getOutputTier() {
- if (this.mCurrentRecipe != null){
- return this.mVoltage = this.mCurrentRecipe.mEUt;
- }
- return 0;
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[] { "RTG - Running at tier "+this.mTier,
- "Active: "+this.getBaseMetaTileEntity().isActive(), "Current Output: " + this.mVoltage + " EU/t",
- "Days of Fuel remaining: "+(mTicksToBurnFor/20/60/20),
- "Hours of Fuel remaining: "+(mTicksToBurnFor/20/60/60),
- "Ticks of "+this.mVoltage+"v remaining: "+(mTicksToBurnFor),
- "Current Recipe input: "+ this.mCurrentRecipe != null ? this.mCurrentRecipe.mInputs[0].getDisplayName() + " x1" : "NUll"
- };
- }
-
-} \ No newline at end of file
+ public int mEfficiency;
+ private int mDays;
+ private long mTicksToBurnFor;
+ private int mVoltage = 0;
+ private GT_Recipe mCurrentRecipe;
+ private int mDaysRemaining = 0;
+ private int mDayTick = 0;
+ private byte mNewTier = 0;
+
+ public int removeDayOfTime() {
+ if (this.mDaysRemaining > 0) {
+ return this.mDaysRemaining--;
+ }
+ return this.mDaysRemaining;
+ }
+
+ // Generates fuel value based on MC days
+ public static int convertDaysToTicks(float days) {
+ int value = 0;
+ value = MathUtils.roundToClosestInt(20 * 86400 * days);
+ return value;
+ }
+
+ public static long getTotalEUGenerated(int ticks, int voltage) {
+ return ticks * voltage;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setLong("mTicksToBurnFor", this.mTicksToBurnFor);
+ aNBT.setInteger("mVoltage", this.mVoltage);
+ aNBT.setInteger("mDaysRemaining", this.mDaysRemaining);
+ aNBT.setInteger("mDayTick", this.mDayTick);
+ aNBT.setByte("mNewTier", this.mNewTier);
+
+ if (this.mCurrentRecipe != null) {
+ final NBTTagList list = new NBTTagList();
+ final ItemStack stack = this.mCurrentRecipe.mInputs[0];
+ if (stack != null) {
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("mSlot", 0);
+ list.appendTag(data);
+ }
+ aNBT.setTag("mRecipeItem", list);
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ // this.mMachineBlock = aNBT.getByte("mMachineBlock");
+ this.mTicksToBurnFor = aNBT.getLong("mTicksToBurnFor");
+ this.mVoltage = aNBT.getInteger("mVoltage");
+ this.mDaysRemaining = aNBT.getInteger("mDaysRemaining");
+ this.mDayTick = aNBT.getInteger("mDayTick");
+ this.mNewTier = aNBT.getByte("mNewTier");
+
+ try {
+ ReflectionUtils.setByte(this, "mTier", this.mNewTier);
+ } catch (Exception e) {
+ if (this.getBaseMetaTileEntity() != null) {
+ IGregTechTileEntity thisTile = this.getBaseMetaTileEntity();
+ if (thisTile.isAllowedToWork() || thisTile.isActive()) {
+ thisTile.setActive(false);
+ }
+ }
+ }
+
+ final NBTTagList list = aNBT.getTagList("mRecipeItem", 10);
+ final NBTTagCompound data = list.getCompoundTagAt(0);
+ ItemStack lastUsedFuel = ItemStack.loadItemStackFromNBT(data);
+ if (lastUsedFuel != null) {
+ this.mCurrentRecipe = getRecipes()
+ .findRecipe(
+ getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] {lastUsedFuel});
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mDayTick < 24000) {
+ this.mDayTick++;
+ } else if (this.mDayTick >= 24000) {
+ this.mDayTick = 0;
+ this.mDaysRemaining = this.removeDayOfTime();
+ }
+ }
+
+ if ((aBaseMetaTileEntity.isServerSide()) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 10L == 0L)) {
+ long tProducedEU = 0L;
+ if (this.mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + getMinimumStoredEU()) {
+ this.mInventory[getStackDisplaySlot()] = null;
+ } else {
+ if (this.mInventory[getStackDisplaySlot()] == null)
+ this.mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ this.mInventory[getStackDisplaySlot()].setStackDisplayName("Generating: "
+ + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ int tFuelValue = getFuelValue(this.mFluid);
+ int tConsumed = consumedFluidPerOperation(this.mFluid);
+ if ((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount > tConsumed)) {
+ long tFluidAmountToUse = Math.min(
+ this.mFluid.amount / tConsumed,
+ (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
+ if ((tFluidAmountToUse > 0L)
+ && (aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true))) {
+ tProducedEU = tFluidAmountToUse * tFuelValue;
+ FluidStack tmp260_257 = this.mFluid;
+ tmp260_257.amount = (int) (tmp260_257.amount - (tFluidAmountToUse * tConsumed));
+ }
+ }
+ }
+ if ((this.mInventory[getInputSlot()] != null)
+ && (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() * 20L + getMinimumStoredEU())
+ && (GT_Utility.getFluidForFilledItem(this.mInventory[getInputSlot()], true) == null)) {
+ int tFuelValue = getFuelValue(this.mInventory[getInputSlot()]);
+ if (tFuelValue > 0) {
+ ItemStack tEmptyContainer = getEmptyContainer(this.mInventory[getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
+ tProducedEU = tFuelValue;
+ }
+ }
+ }
+ if ((tProducedEU > 0L) && (getPollution() > 0)) {
+ PollutionUtils.addPollution(
+ aBaseMetaTileEntity, (int) (tProducedEU * getPollution() / 500 * this.mTier + 1L));
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide())
+ aBaseMetaTileEntity.setActive((aBaseMetaTileEntity.isAllowedToWork())
+ && (aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()));
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Fuel is measured in minecraft days (Check with Scanner)",
+ "RTG changes output voltage depending on fuel",
+ "Generates power at " + this.getEfficiency() + "% Efficiency per tick",
+ "Output Voltage: " + this.getOutputTier() + " EU/t",
+ CORE.GT_Tooltip
+ };
+ }
+
+ public GregtechMetaTileEntity_RTG(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires RTG Pellets", new ITexture[0]);
+ }
+
+ private byte getTier() {
+ int voltage = this.mVoltage;
+ if (voltage >= 512) {
+ return 4;
+ } else if (voltage >= 128) {
+ return 3;
+ } else if (voltage >= 32) {
+ return 2;
+ } else if (voltage >= 8) {
+ return 1;
+ }
+ return 0;
+ }
+
+ public GregtechMetaTileEntity_RTG(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return ((aSide > 1)
+ && (aSide != getBaseMetaTileEntity().getFrontFacing())
+ && (aSide != getBaseMetaTileEntity().getBackFacing()));
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_RTG(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 0;
+ }
+
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency = 100;
+ }
+
+ @Override
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[] {
+ super.getFront(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB)
+ };
+ }
+
+ @Override
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[] {
+ super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[] {
+ super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP)
+ };
+ }
+
+ @Override
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[] {
+ super.getTop(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP),
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE)
+ };
+ }
+
+ @Override
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[] {
+ gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)],
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
+ gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()]
+ };
+ }
+
+ @Override
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[] {
+ super.getFrontActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[] {
+ super.getBackActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[] {
+ super.getBottomActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[] {
+ super.getTopActive(aColor)[0],
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE)
+ };
+ }
+
+ @Override
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[] {
+ gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)],
+ new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
+ gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()]
+ };
+ }
+
+ public int getPollution() {
+ return 0;
+ }
+
+ @Override
+ public int getFuelValue(ItemStack aStack) {
+ if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null)) return 0;
+ GT_Recipe tFuel = getRecipes()
+ .findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] {aStack});
+ if (tFuel != null) {
+ this.mCurrentRecipe = tFuel;
+ int voltage = tFuel.mEUt;
+ this.mVoltage = voltage;
+ int sfsf = this.mTier;
+ // this.mDaysRemaining = tFuel.mSpecialValue*365;
+
+ // Do some voodoo.
+ byte mTier2;
+ // mTier2 = ReflectionUtils.getField(this.getClass(), "mTier");
+ try {
+ if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_AM241.get(1))) {
+ mTier2 = 1;
+ } else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PO210.get(1))) {
+ mTier2 = 3;
+ } else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PU238.get(1))) {
+ mTier2 = 2;
+ } else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_SR90.get(1))) {
+ mTier2 = 1;
+ } else {
+ // Utils.LOG_INFO("test:"+tFuel.mInputs[0].getDisplayName() + " | " +
+ // (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PU238.get(1))));
+ mTier2 = 0;
+ }
+ ReflectionUtils.setByte(this, "mTier", mTier2);
+ this.mNewTier = mTier2;
+ // ReflectionUtils.setFinalStatic(mTier2, GT_Values.V[0]);
+ } catch (Exception e) {
+ Logger.WARNING("Failed setting mTier.");
+ e.printStackTrace();
+ }
+
+ this.mTicksToBurnFor = getTotalEUGenerated(convertDaysToTicks(tFuel.mSpecialValue), voltage);
+ if (mTicksToBurnFor >= Integer.MAX_VALUE) {
+ mTicksToBurnFor = Integer.MAX_VALUE;
+ Logger.WARNING("Fuel went over Int limit, setting to MAX_VALUE.");
+ }
+ this.mDaysRemaining = MathUtils.roundToClosestInt(mTicksToBurnFor / 20 / 60 / 3);
+ Logger.WARNING("step | " + (int) (mTicksToBurnFor * getEfficiency() / 100L));
+ return (int) (mTicksToBurnFor * getEfficiency() / 100L);
+ // return (int) (tFuel.mSpecialValue * 365L * getEfficiency() / 100L);
+ // return tFuel.mEUt;
+ }
+ Logger.WARNING("Not sure");
+ return 0;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return ((getBaseMetaTileEntity().isAllowedToWork()) ? this.mVoltage : 0L);
+ }
+
+ @Override
+ public long getOutputTier() {
+ if (this.mCurrentRecipe != null) {
+ return this.mVoltage = this.mCurrentRecipe.mEUt;
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[] {
+ "RTG - Running at tier " + this.mTier,
+ "Active: " + this.getBaseMetaTileEntity().isActive(),
+ "Current Output: " + this.mVoltage + " EU/t",
+ "Days of Fuel remaining: " + (mTicksToBurnFor / 20 / 60 / 20),
+ "Hours of Fuel remaining: " + (mTicksToBurnFor / 20 / 60 / 60),
+ "Ticks of " + this.mVoltage + "v remaining: " + (mTicksToBurnFor),
+ "Current Recipe input: " + this.mCurrentRecipe != null
+ ? this.mCurrentRecipe.mInputs[0].getDisplayName() + " x1"
+ : "NUll"
+ };
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java
index 58919f0954..3398ad0fc6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java
@@ -15,25 +15,27 @@ public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity
super(aID, aName, aNameRegional, aTier);
}
- public GT_MetaTileEntity_ULV_CombustionGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_ULV_CombustionGenerator(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- "Produces "+(this.getPollution()*20)+" pollution/sec",
- "Fuel Efficiency: "+this.getEfficiency() + "%",
- CORE.GT_Tooltip};
- }
@Override
- public long maxEUStore() {
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Produces " + (this.getPollution() * 20) + " pollution/sec",
+ "Fuel Efficiency: " + this.getEfficiency() + "%",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public long maxEUStore() {
return Math.max(getEUVar(), V[1] * 80L + getMinimumStoredEU());
- }
+ }
- @Override
+ @Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_ULV_CombustionGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
}
@@ -45,6 +47,7 @@ public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity
@Override
public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, 95);
+ this.mEfficiency = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, 95);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java
index 17bb4463c4..b8f8004dad 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java
@@ -21,20 +21,21 @@ public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbi
public GT_MetaTileEntity_ULV_GasTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- "Produces "+(this.getPollution()*20)+" pollution/sec",
- "Fuel Efficiency: "+this.getEfficiency() + "%",
- CORE.GT_Tooltip};
- }
@Override
- public long maxEUStore() {
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Produces " + (this.getPollution() * 20) + " pollution/sec",
+ "Fuel Efficiency: " + this.getEfficiency() + "%",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public long maxEUStore() {
return Math.max(getEUVar(), V[1] * 80L + getMinimumStoredEU());
- }
+ }
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_ULV_GasTurbine(this.mName, this.mTier, this.mDescription, this.mTextures);
@@ -47,13 +48,15 @@ public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbi
@Override
public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, 95);
+ this.mEfficiency = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, 95);
}
@Override
public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0],
- new GT_RenderedTexture((IIconContainer) TexturesGtBlock.Overlay_Machine_Turbine_Active)};
- }
-
-} \ No newline at end of file
+ return new ITexture[] {
+ super.getSidesActive(aColor)[0],
+ new GT_RenderedTexture((IIconContainer) TexturesGtBlock.Overlay_Machine_Turbine_Active)
+ };
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java
index ef3310c6fc..09e3e3201c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java
@@ -21,20 +21,21 @@ public class GT_MetaTileEntity_ULV_SteamTurbine extends GT_MetaTileEntity_SteamT
public GT_MetaTileEntity_ULV_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- "Produces "+(this.getPollution()*20)+" pollution/sec",
- "Fuel Efficiency: "+this.getEfficiency() + "%",
- CORE.GT_Tooltip};
- }
@Override
- public long maxEUStore() {
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Produces " + (this.getPollution() * 20) + " pollution/sec",
+ "Fuel Efficiency: " + this.getEfficiency() + "%",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public long maxEUStore() {
return Math.max(getEUVar(), V[1] * 80L + getMinimumStoredEU());
- }
+ }
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_ULV_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures);
@@ -44,15 +45,18 @@ public class GT_MetaTileEntity_ULV_SteamTurbine extends GT_MetaTileEntity_SteamT
public int getCapacity() {
return 16000;
}
-
+
@Override
public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + 1);
+ this.mEfficiency = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + 1);
}
@Override
public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0],
- new GT_RenderedTexture((IIconContainer) TexturesGtBlock.Overlay_Machine_Turbine_Active)};
- }
+ return new ITexture[] {
+ super.getSidesActive(aColor)[0],
+ new GT_RenderedTexture((IIconContainer) TexturesGtBlock.Overlay_Machine_Turbine_Active)
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java
index 087da7465d..fb2af1cd44 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java
@@ -2,9 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators.creative;
import static gregtech.api.enums.GT_Values.V;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -21,6 +18,8 @@ import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -36,198 +35,229 @@ import net.minecraft.world.World;
*/
public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
- private int mVoltageTier = 3;
-
- public GregtechMetaCreativeEnergyBuffer(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
- super(aName, aTier, aDescription, aTextures, aSlotCount);
- // TODO Auto-generated constructor stub
- }
-
- public GregtechMetaCreativeEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{this.mDescription, "Use Screwdriver to change voltage", "Hold Shift while using Screwdriver to change amperage", EnumChatFormatting.GREEN
- + "CREATIVE MACHINE", CORE.GT_Tooltip};
- }
-
- /*
- * MACHINE_STEEL_SIDE
- */
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- CustomIcon h = TexturesGtBlock.Casing_Material_RedSteel;
- CustomIcon g = TexturesGtBlock.Casing_Material_Grisium;
- CustomIcon k;
- boolean j = MathUtils.isNumberEven(this.mVoltageTier);
- final ITexture[][][] rTextures = new ITexture[2][17][];
- k = j ? g : h;
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = new ITexture[]{new GT_RenderedTexture(k)};
- rTextures[1][i
- + 1] = new ITexture[]{new GT_RenderedTexture(k), this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mVoltageTier] : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mVoltageTier]};
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
- }
-
- @Override
- protected void showEnergy(final World worldIn, final EntityPlayer playerIn){
- final long tempStorage = this.getBaseMetaTileEntity().getStoredEU();
- final double c = ((double) tempStorage / this.maxEUStore()) * 100;
- final double roundOff = Math.round(c * 100.00) / 100.00;
- PlayerUtils.messagePlayer(playerIn, "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at "+V[this.mVoltageTier]+"v ("+roundOff+"%)");
- PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut())+"A");
-
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaCreativeEnergyBuffer(this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 0;
- }
-
- @Override
- public long maxEUStore() {
- return Long.MAX_VALUE;
- }
-
- @Override
- public long maxEUInput() {
- return V[mVoltageTier];
- }
-
- @Override
- public long maxEUOutput() {
- return V[mVoltageTier];
- }
-
- @Override
- public long maxAmperesIn() {
- return aCurrentOutputAmperage;
- }
-
- @Override
- public long maxAmperesOut() {
- return aCurrentOutputAmperage;
- }
-
- @Override
- public int getProgresstime() {
- return Integer.MAX_VALUE;
- }
- @Override
- public int maxProgresstime() {
- return Integer.MAX_VALUE;
- }
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits(Integer.MAX_VALUE, true);
- }
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public String[] getInfoData() {
- String[] infoData = super.getInfoData();
- return new String[]{infoData[0], "THIS IS A CREATIVE ITEM - FOR TESTING | Tier: " + this.mVoltageTier, infoData[1], infoData[2]};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mVoltageTier", this.mVoltageTier);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- this.mVoltageTier = aNBT.getInteger("mVoltageTier");
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (KeyboardUtils.isShiftKeyDown()) {
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
- else {
- if (this.mVoltageTier < (GT_Values.VN[9].equals("UHV") ? GT_Values.V.length - 1 : 9)) {
- this.mVoltageTier++;
- }
- else {
- this.mVoltageTier = 0;
- }
- this.markDirty();
- try {
- Field field = ReflectionUtils.getField(this.getClass(), "mTextures");
- field.setAccessible(true);
- Field modifiersField = Field.class.getDeclaredField("modifiers");
- modifiersField.setAccessible(true);
- modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
- ITexture[][][] V = getTextureSet(null);
- if (V != null) {
- Logger.REFLECTION("Got Valid Textures.");
- if (this.getBaseMetaTileEntity().isClientSide()) {
- Logger.REFLECTION("Clientside Call.");
- Logger.REFLECTION("Refreshing Textures on buffer.");
- field.set(this, V);
- Logger.REFLECTION("Refreshed Textures on buffer.");
- }
- else {
- Logger.REFLECTION("Serverside Call.");
- }
- }
- else {
- Logger.REFLECTION("Bad mTextures setter.");
- }
- }
- catch (Throwable t) {
- // Bad refresh.
- t.printStackTrace();
- Logger.REFLECTION("Bad mTextures setter.");
- }
- PlayerUtils.messagePlayer(aPlayer, "Now running at " + GT_Values.VOLTAGE_NAMES[this.mVoltageTier] + ".");
- }
-
- }
+ private int mVoltageTier = 3;
+
+ public GregtechMetaCreativeEnergyBuffer(
+ final String aName,
+ final int aTier,
+ final String aDescription,
+ final ITexture[][][] aTextures,
+ final int aSlotCount) {
+ super(aName, aTier, aDescription, aTextures, aSlotCount);
+ // TODO Auto-generated constructor stub
+ }
+
+ public GregtechMetaCreativeEnergyBuffer(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Use Screwdriver to change voltage",
+ "Hold Shift while using Screwdriver to change amperage",
+ EnumChatFormatting.GREEN + "CREATIVE MACHINE",
+ CORE.GT_Tooltip
+ };
+ }
+
+ /*
+ * MACHINE_STEEL_SIDE
+ */
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ CustomIcon h = TexturesGtBlock.Casing_Material_RedSteel;
+ CustomIcon g = TexturesGtBlock.Casing_Material_Grisium;
+ CustomIcon k;
+ boolean j = MathUtils.isNumberEven(this.mVoltageTier);
+ final ITexture[][][] rTextures = new ITexture[2][17][];
+ k = j ? g : h;
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = new ITexture[] {new GT_RenderedTexture(k)};
+ rTextures[1][i + 1] = new ITexture[] {
+ new GT_RenderedTexture(k),
+ this.mInventory.length > 4
+ ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mVoltageTier]
+ : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mVoltageTier]
+ };
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
+ }
+
+ @Override
+ protected void showEnergy(final World worldIn, final EntityPlayer playerIn) {
+ final long tempStorage = this.getBaseMetaTileEntity().getStoredEU();
+ final double c = ((double) tempStorage / this.maxEUStore()) * 100;
+ final double roundOff = Math.round(c * 100.00) / 100.00;
+ PlayerUtils.messagePlayer(
+ playerIn,
+ "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at " + V[this.mVoltageTier] + "v (" + roundOff
+ + "%)");
+ PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut()) + "A");
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaCreativeEnergyBuffer(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Long.MAX_VALUE;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mVoltageTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[mVoltageTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return aCurrentOutputAmperage;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return aCurrentOutputAmperage;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits(Integer.MAX_VALUE, true);
+ }
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ String[] infoData = super.getInfoData();
+ return new String[] {
+ infoData[0], "THIS IS A CREATIVE ITEM - FOR TESTING | Tier: " + this.mVoltageTier, infoData[1], infoData[2]
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mVoltageTier", this.mVoltageTier);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mVoltageTier = aNBT.getInteger("mVoltageTier");
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (KeyboardUtils.isShiftKeyDown()) {
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ } else {
+ if (this.mVoltageTier < (GT_Values.VN[9].equals("UHV") ? GT_Values.V.length - 1 : 9)) {
+ this.mVoltageTier++;
+ } else {
+ this.mVoltageTier = 0;
+ }
+ this.markDirty();
+ try {
+ Field field = ReflectionUtils.getField(this.getClass(), "mTextures");
+ field.setAccessible(true);
+ Field modifiersField = Field.class.getDeclaredField("modifiers");
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
+ ITexture[][][] V = getTextureSet(null);
+ if (V != null) {
+ Logger.REFLECTION("Got Valid Textures.");
+ if (this.getBaseMetaTileEntity().isClientSide()) {
+ Logger.REFLECTION("Clientside Call.");
+ Logger.REFLECTION("Refreshing Textures on buffer.");
+ field.set(this, V);
+ Logger.REFLECTION("Refreshed Textures on buffer.");
+ } else {
+ Logger.REFLECTION("Serverside Call.");
+ }
+ } else {
+ Logger.REFLECTION("Bad mTextures setter.");
+ }
+ } catch (Throwable t) {
+ // Bad refresh.
+ t.printStackTrace();
+ Logger.REFLECTION("Bad mTextures setter.");
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Now running at " + GT_Values.VOLTAGE_NAMES[this.mVoltageTier] + ".");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java
index 4651121500..2847a15539 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import java.util.*;
-
import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -18,6 +16,7 @@ import gtPlusPlus.xmod.gregtech.api.gui.basic.*;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import ic2.api.crops.*;
import ic2.core.item.DamageHandler;
+import java.util.*;
import net.minecraft.entity.player.*;
import net.minecraft.item.*;
import net.minecraft.nbt.NBTTagCompound;
@@ -25,668 +24,709 @@ import net.minecraft.tileentity.TileEntity;
public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank {
- protected String mLocalName;
-
- private static final int SLOT_WEEDEX_1 = 1;
- private static final int SLOT_WEEDEX_2 = 2;
- private static final int SLOT_FERT_1 = 3;
- private static final int SLOT_FERT_4 = 6;
- private static final int SLOT_OUTPUT_START = 7;
-
- public boolean mModeAlternative = false;
-
- public GT_MetaTileEntity_CropHarvestor(final int aID, final int aTier, final String aDescription) {
- super(aID, "basicmachine.cropharvester.0"+aTier, "Crop Manager ("+GT_Values.VN[aTier]+")", aTier, 21, aDescription);
- this.mLocalName = "Crop Manager ("+GT_Values.VN[aTier]+")";
- }
-
- public GT_MetaTileEntity_CropHarvestor(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, 21, aDescription, aTextures);
- this.mLocalName = "Crop Manager ("+GT_Values.VN[aTier]+")";
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_CropHarvestor(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_CropHarvestor(aPlayerInventory, aBaseMetaTileEntity, this.mLocalName);
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return true;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isElectric() {
- return true;
- }
-
- @Override
- public long maxAmperesIn() {
- return 8;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return GT_Values.V[this.mTier];
- }
-
- @Override
- public long maxEUStore() {
- return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]);
- }
-
- @Override
- public long maxEUInput() {
- return GT_Values.V[this.mTier];
- }
-
- @Override
- public int getCapacity() {
- return 32000 * this.mTier;
- }
-
- @Override
- public int getTankPressure() {
- return -100;
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_CropHarvestor(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public int getSizeInventory() {
- return 21;
- }
-
- private static final int getRange(int aTier) {
- switch(aTier) {
- case 1:
- return 1;
- case 2:
- return 5;
- case 3:
- return 9;
- case 4:
- return 13;
- case 5:
- return 17;
- case 6:
- return 21;
- case 7:
- return 25;
- case 8:
- return 29;
- case 9:
- return 33;
- default:
- return 0;
- }
- }
-
- private HashSet<ICropTile> mCropCache = new HashSet<ICropTile>();
- private boolean mInvalidCache = false;
-
- public boolean doesInventoryHaveSpace() {
- for (int i = SLOT_OUTPUT_START; i < this.getSizeInventory(); i++) {
- if (this.mInventory[i] == null || this.mInventory[i].stackSize < 64) {
- return true;
- }
- }
- return false;
- }
-
- public long powerUsage() {
- return this.maxEUInput() / 8;
- }
-
- public long powerUsageSecondary() {
- return this.maxEUInput() / 32;
- }
-
-
- public static AutoMap<ItemStack> splitOutputStacks(ItemStack aOutput) {
- return splitOutputStacks(new ItemStack[] {aOutput});
- }
-
- public static AutoMap<ItemStack> splitOutputStacks(ItemStack[] aOutputs) {
- AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>();
- for (ItemStack aStack : aOutputs) {
- if (aStack != null) {
- if (aStack.stackSize <= 64) {
- aOutputMap.add(aStack);
- } else {
- int aStacks = 0;
- int aExcess = 0;
- int aOriginalSize = aStack.stackSize;
- while (aOriginalSize >= 64) {
- aStacks += 1;
- aOriginalSize -= 64;
- }
- aExcess = aOriginalSize;
- for (int i = 0; i < aStacks; i++) {
- aOutputMap.add(ItemUtils.getSimpleStack(aStack, 64));
- }
- aOutputMap.add(ItemUtils.getSimpleStack(aStack, aExcess));
- }
- }
- }
- return aOutputMap;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().isAllowedToWork() && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || aTick % 100 == 0)) {
- if (this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()) {
-
- int aTileX = this.getBaseMetaTileEntity().getXCoord();
- int aTileY = this.getBaseMetaTileEntity().getXCoord();
- int aTileZ = this.getBaseMetaTileEntity().getXCoord();
-
- int aRadius = 10 + getRange(this.mTier);
- int aSide = (aRadius-1)/2;
- ArrayList<ItemStack> aAllDrops = new ArrayList<ItemStack>();
-
- if (this.mCropCache.isEmpty() || aTick % 1200 == 0 || this.mInvalidCache) {
- if (!this.mCropCache.isEmpty()) {
- this.mCropCache.clear();
- }
- //Logger.INFO("Looking for crops.");
- for (int y = 0; y <= 2; y++) {
- for (int x = (-aSide); x <= aSide; x++) {
- for (int z = (-aSide); z <= aSide; z++) {
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, y, z);
- if (tTileEntity != null && tTileEntity instanceof ICropTile) {
- ICropTile tCrop = (ICropTile) tTileEntity;
- this.mCropCache.add(tCrop);
- }
- }
- }
- }
- }
-
- //Process Cache
- if (doesInventoryHaveSpace()) {
- for (ICropTile tCrop : this.mCropCache) {
- if (tCrop == null) {
- this.mInvalidCache = true;
- break;
- }
- CropCard aCrop = tCrop.getCrop();
- if (aCrop != null) {
- //Logger.INFO("Found "+aCrop.displayName()+" at offset "+x+", "+y+", "+z);
- if (!aCrop.canGrow(tCrop) && aCrop.canBeHarvested(tCrop)) {
- if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsage(), true)) {
- ItemStack[] aHarvest = tCrop.harvest_automated(true);
- if (aHarvest != null && aHarvest.length > 0) {
- for (ItemStack aStack : aHarvest) {
- if (aStack.stackSize > 0) {
- if (this.mTier * 5 > MathUtils.randInt(1, 100)) {
- aStack.stackSize += Math.floor(tCrop.getGain()/10);
- Logger.INFO("Bonus output given for "+aCrop.displayName());
- }
- Logger.INFO("Harvested "+aCrop.displayName());
- aAllDrops.addAll(splitOutputStacks(aStack));
- }
- }
- }
- }
- }
- if (this.mModeAlternative) {
- processSecondaryFunctions(tCrop);
- }
- }
- }
-
- if (!aAllDrops.isEmpty()) {
- Logger.INFO("Handling "+aAllDrops.size()+" Harvests");
- Iterator<ItemStack> iter = aAllDrops.iterator();
- while (iter.hasNext()) {
- ItemStack aDrop = iter.next();
- if (ItemUtils.checkForInvalidItems(aDrop)) {
-
- for (int i = SLOT_OUTPUT_START; i < this.getSizeInventory(); i++) {
- if (this.mInventory[i] != null) {
- //Logger.INFO("Slot "+i+" contains "+this.mInventory[i].getDisplayName());
- if (GT_Utility.areStacksEqual(aDrop, this.mInventory[i], false)) {
- //Same
- if (this.mInventory[i].stackSize < 64 && (this.mInventory[i].stackSize + aDrop.stackSize <= 64)) {
- //can merge
- //Logger.INFO("Slot "+i+" size: "+mInventory[i].stackSize+" + Drop Size: "+aDrop.stackSize+" = "+(mInventory[i].stackSize + aDrop.stackSize));
- this.mInventory[i].stackSize += aDrop.stackSize;
- break;
- }
- else if (this.mInventory[i].stackSize < 64 && (this.mInventory[i].stackSize + aDrop.stackSize > 64)) {
- //can merge
- //Logger.INFO("Slot "+i+" size: "+mInventory[i].stackSize+" + Drop Size: "+aDrop.stackSize+" = "+(mInventory[i].stackSize + aDrop.stackSize));
- int aRemainder = this.mInventory[i].stackSize + aDrop.stackSize - 64;
- Logger.INFO("Remainder: "+aRemainder+", Continuing.");
- this.mInventory[i].stackSize = 64;
- aDrop.stackSize = aRemainder;
- continue;
- }
- else {
- //Logger.INFO("Slot "+i+" size: 64, Continuing.");
- continue;
- }
- }
- }
- else {
- //Logger.INFO("Slot "+i+" is empty, setting to "+aDrop.getDisplayName()+" x"+aDrop.stackSize);
- this.mInventory[i] = aDrop;
- break;
- }
- }
- }
-
- }
- }
- }
- }
- }
- }
-
- public boolean hasFertilizer() {
- for (int i = SLOT_FERT_1; i <= SLOT_FERT_4; i++) {
- if (this.mInventory[i] != null) {
- return true;
- }
- }
- return false;
- }
-
- public boolean consumeFertilizer(boolean aSimulate) {
- if (hasFertilizer()) {
- for (int i = SLOT_FERT_1; i <= SLOT_FERT_4; i++) {
- if (this.mInventory[i] != null) {
- consume(i, 1, aSimulate);
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean hasWeedEX() {
- for (int i = SLOT_WEEDEX_1; i <= SLOT_WEEDEX_2; i++) {
- if (this.mInventory[i] != null) {
- return true;
- }
- }
- return false;
- }
-
- public boolean consumeWeedEX(boolean aSimulate) {
- if (hasWeedEX()) {
- for (int i = SLOT_WEEDEX_1; i <= SLOT_WEEDEX_2; i++) {
- if (this.mInventory[i] != null) {
- damage(i, 1, aSimulate);
- return true;
- }
- }
- }
- return false;
- }
-
- public void processSecondaryFunctions(ICropTile aCrop) {
- if (!this.mModeAlternative) {
- return;
- }
- if (hasFertilizer() && consumeFertilizer(true) && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyFertilizer(aCrop)) {
- if (consumeFertilizer(false)) {
- //Logger.INFO("Consumed Fert.");
- }
- }
- if (this.getFluidAmount() > 0 && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyHydration(aCrop)) {
- //Logger.INFO("Consumed Water.");
- }
- if (hasWeedEX() && consumeWeedEX(true) && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyWeedEx(aCrop)) {
- if (consumeWeedEX(false)) {
- //Logger.INFO("Consumed Weed-EX.");
- }
- }
- }
-
-
- public boolean applyWeedEx(ICropTile aCrop) {
- if (aCrop.getWeedExStorage() < 150) {
- aCrop.setWeedExStorage(aCrop.getWeedExStorage() + 50);
- boolean triggerDecline;
- triggerDecline = aCrop.getWorld().rand.nextInt(3) == 0;
- if (aCrop.getCrop() != null && aCrop.getCrop().isWeed(aCrop) && aCrop.getWeedExStorage() >= 75 && triggerDecline) {
- switch (aCrop.getWorld().rand.nextInt(5)) {
- case 0 :
- if (aCrop.getGrowth() > 0) {
- aCrop.setGrowth((byte) (aCrop.getGrowth() - 1));
- }
- case 1 :
- if (aCrop.getGain() > 0) {
- aCrop.setGain((byte) (aCrop.getGain() - 1));
- }
- default :
- if (aCrop.getResistance() > 0) {
- aCrop.setResistance((byte) (aCrop.getResistance() - 1));
- }
- }
- }
- return true;
- } else {
- return false;
- }
- }
-
- public boolean applyFertilizer(ICropTile aCrop) {
- if (aCrop.getNutrientStorage() >= 100) {
- return false;
- } else {
- //Logger.INFO("Current Nutrient: "+aCrop.getNutrientStorage()+" for "+aCrop.getCrop().displayName());
- aCrop.setNutrientStorage(aCrop.getNutrientStorage() + 100);
- return true;
- }
- }
-
- public boolean applyHydration(ICropTile aCrop) {
- if (aCrop.getHydrationStorage() >= 200 || this.getFluidAmount() == 0) {
- //Logger.INFO("Hydration Max");
- return false;
- } else {
- int apply = 200 - aCrop.getHydrationStorage();
- if (this.getFluidAmount() >= 0) {
- int drain = 0;
- if (this.getFluidAmount() >= apply) {
- drain = apply;
- }
- else {
- drain = this.getFluidAmount();
- }
- this.mFluid.amount -= drain;
- if (this.mFluid.amount <= 0) {
- this.mFluid = null;
- }
- //Logger.INFO("Did Hydrate");
- aCrop.setHydrationStorage(aCrop.getHydrationStorage() + drain);
- return true;
- }
- else {
- //Logger.INFO("No water?");
- return false;
- }
- }
- }
-
- public boolean consume(int aSlot, int amount, boolean simulate) {
- ItemStack stack = this.mInventory[aSlot];
- if (stack != null && stack.stackSize >= amount) {
- int currentAmount = Math.min(amount, stack.stackSize);
- amount -= currentAmount;
- if (!simulate) {
- if (stack.stackSize == currentAmount) {
- this.mInventory[aSlot] = null;
- } else {
- stack.stackSize -= currentAmount;
- }
- }
- else {
- return amount >= 0;
- }
- return true;
- }
- return false;
- }
-
- public ItemStack damage(int aSlot, int amount, boolean simulate) {
- ItemStack ret = null;
- int damageApplied = 0;
- ItemStack stack = this.mInventory[aSlot];
- Item item = stack.getItem();
- if (stack != null && item.isDamageable() && (ret == null
- || stack.getItem() == ret.getItem() && ItemStack.areItemStackTagsEqual(stack, ret))) {
- if (simulate) {
- stack = stack.copy();
- }
- int maxDamage = DamageHandler.getMaxDamage(stack);
- while (amount > 0 && stack.stackSize > 0) {
- int currentAmount = Math.min(amount, maxDamage - DamageHandler.getDamage(stack));
- DamageHandler.damage(stack, currentAmount, null);
- damageApplied += currentAmount;
- amount -= currentAmount;
- if (DamageHandler.getDamage(stack) >= maxDamage) {
- --stack.stackSize;
- DamageHandler.setDamage(stack, 0);
- }
-
- if (ret == null) {
- ret = stack.copy();
- }
- }
- if (stack.stackSize == 0 && !simulate) {
- this.mInventory[aSlot] = null;
- }
- }
-
- if (ret != null) {
- int i = DamageHandler.getMaxDamage(ret);
- ret.stackSize = damageApplied / i;
- DamageHandler.setDamage(ret, damageApplied % i);
- }
- return ret;
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aStack != null && aIndex >= SLOT_OUTPUT_START && aIndex < this.getSizeInventory();
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (aStack != null) {
- if (aStack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) {
- return aIndex >= SLOT_FERT_1 && aIndex <= SLOT_FERT_4;
- }
- else if (aStack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) {
- return aIndex >= SLOT_WEEDEX_1 && aIndex <= SLOT_WEEDEX_2;
- }
- }
- return false;
- }
-
- @Override
- public String[] getDescription() {
- int aRadius = 10 + getRange(this.mTier);
- int aSide = (aRadius-1)/2;
- return new String[] {
- this.mDescription,
- "Secondary mode can Hydrate/Fertilize/Weed-EX",
- "Consumes "+powerUsage()+"eu per harvest",
- "Consumes "+powerUsageSecondary()+"eu per secondary operation",
- "Can harvest 2 blocks above",
- "Radius: "+aSide+" each side ("+aRadius+"x3x"+aRadius+")",
- "Has "+(this.mTier * 5)+"% chance for extra drops",
- "Holds "+this.getCapacity()+"L of Water",
- CORE.GT_Tooltip
- };
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
- return true;
- }
-
- /*@Override
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing)
- return 118+(aRedstone?8:0);
- if (GT_Utility.getOppositeSide(aSide) == aFacing)
- return 113+(aRedstone?8:0);
-
- int tIndex = 128+(aRedstone?8:0);
-
- switch (aFacing) {
- case 0:
- return tIndex+64;
- case 1:
- return tIndex+32;
- case 2: switch (aSide) {
- case 0: return tIndex+32;
- case 1: return tIndex+32;
- case 4: return tIndex+16;
- case 5: return tIndex+48;
- }
- case 3: switch (aSide) {
- case 0: return tIndex+64;
- case 1: return tIndex+64;
- case 4: return tIndex+48;
- case 5: return tIndex+16;
- }
- case 4: switch (aSide) {
- case 0: return tIndex+16;
- case 1: return tIndex+16;
- case 2: return tIndex+48;
- case 3: return tIndex+16;
- }
- case 5: switch (aSide) {
- case 0: return tIndex+48;
- case 1: return tIndex+48;
- case 2: return tIndex+16;
- case 3: return tIndex+48;
- }
- }
- return tIndex;
- } */
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFront(i);
- rTextures[6][i + 1] = this.getBack(i);
- rTextures[7][i + 1] = this.getBottom(i);
- rTextures[8][i + 1] = this.getTop(i);
- rTextures[9][i + 1] = this.getSides(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == 0 || aSide == 1) {
- return this.mTextures[3][aColorIndex + 1];
- }
- else {
- return this.mTextures[4][aColorIndex + 1];
- }
- /*return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];*/
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)};
- }
-
- @Override
- public boolean doesFillContainers() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return false;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return true;
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return false;
- }
-
- @Override
- public boolean displaysItemStack() {
- return false;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mModeAlternative", this.mModeAlternative);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mModeAlternative = aNBT.getBoolean("mModeAlternative");
- }
-
+ protected String mLocalName;
+
+ private static final int SLOT_WEEDEX_1 = 1;
+ private static final int SLOT_WEEDEX_2 = 2;
+ private static final int SLOT_FERT_1 = 3;
+ private static final int SLOT_FERT_4 = 6;
+ private static final int SLOT_OUTPUT_START = 7;
+
+ public boolean mModeAlternative = false;
+
+ public GT_MetaTileEntity_CropHarvestor(final int aID, final int aTier, final String aDescription) {
+ super(
+ aID,
+ "basicmachine.cropharvester.0" + aTier,
+ "Crop Manager (" + GT_Values.VN[aTier] + ")",
+ aTier,
+ 21,
+ aDescription);
+ this.mLocalName = "Crop Manager (" + GT_Values.VN[aTier] + ")";
+ }
+
+ public GT_MetaTileEntity_CropHarvestor(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 21, aDescription, aTextures);
+ this.mLocalName = "Crop Manager (" + GT_Values.VN[aTier] + ")";
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_CropHarvestor(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_CropHarvestor(aPlayerInventory, aBaseMetaTileEntity, this.mLocalName);
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return true;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return true;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 8;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return GT_Values.V[this.mTier];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]);
+ }
+
+ @Override
+ public long maxEUInput() {
+ return GT_Values.V[this.mTier];
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000 * this.mTier;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return -100;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_CropHarvestor(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 21;
+ }
+
+ private static final int getRange(int aTier) {
+ switch (aTier) {
+ case 1:
+ return 1;
+ case 2:
+ return 5;
+ case 3:
+ return 9;
+ case 4:
+ return 13;
+ case 5:
+ return 17;
+ case 6:
+ return 21;
+ case 7:
+ return 25;
+ case 8:
+ return 29;
+ case 9:
+ return 33;
+ default:
+ return 0;
+ }
+ }
+
+ private HashSet<ICropTile> mCropCache = new HashSet<ICropTile>();
+ private boolean mInvalidCache = false;
+
+ public boolean doesInventoryHaveSpace() {
+ for (int i = SLOT_OUTPUT_START; i < this.getSizeInventory(); i++) {
+ if (this.mInventory[i] == null || this.mInventory[i].stackSize < 64) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public long powerUsage() {
+ return this.maxEUInput() / 8;
+ }
+
+ public long powerUsageSecondary() {
+ return this.maxEUInput() / 32;
+ }
+
+ public static AutoMap<ItemStack> splitOutputStacks(ItemStack aOutput) {
+ return splitOutputStacks(new ItemStack[] {aOutput});
+ }
+
+ public static AutoMap<ItemStack> splitOutputStacks(ItemStack[] aOutputs) {
+ AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>();
+ for (ItemStack aStack : aOutputs) {
+ if (aStack != null) {
+ if (aStack.stackSize <= 64) {
+ aOutputMap.add(aStack);
+ } else {
+ int aStacks = 0;
+ int aExcess = 0;
+ int aOriginalSize = aStack.stackSize;
+ while (aOriginalSize >= 64) {
+ aStacks += 1;
+ aOriginalSize -= 64;
+ }
+ aExcess = aOriginalSize;
+ for (int i = 0; i < aStacks; i++) {
+ aOutputMap.add(ItemUtils.getSimpleStack(aStack, 64));
+ }
+ aOutputMap.add(ItemUtils.getSimpleStack(aStack, aExcess));
+ }
+ }
+ }
+ return aOutputMap;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (getBaseMetaTileEntity().isServerSide()
+ && getBaseMetaTileEntity().isAllowedToWork()
+ && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || aTick % 100 == 0)) {
+ if (this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()) {
+
+ int aTileX = this.getBaseMetaTileEntity().getXCoord();
+ int aTileY = this.getBaseMetaTileEntity().getXCoord();
+ int aTileZ = this.getBaseMetaTileEntity().getXCoord();
+
+ int aRadius = 10 + getRange(this.mTier);
+ int aSide = (aRadius - 1) / 2;
+ ArrayList<ItemStack> aAllDrops = new ArrayList<ItemStack>();
+
+ if (this.mCropCache.isEmpty() || aTick % 1200 == 0 || this.mInvalidCache) {
+ if (!this.mCropCache.isEmpty()) {
+ this.mCropCache.clear();
+ }
+ // Logger.INFO("Looking for crops.");
+ for (int y = 0; y <= 2; y++) {
+ for (int x = (-aSide); x <= aSide; x++) {
+ for (int z = (-aSide); z <= aSide; z++) {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, y, z);
+ if (tTileEntity != null && tTileEntity instanceof ICropTile) {
+ ICropTile tCrop = (ICropTile) tTileEntity;
+ this.mCropCache.add(tCrop);
+ }
+ }
+ }
+ }
+ }
+
+ // Process Cache
+ if (doesInventoryHaveSpace()) {
+ for (ICropTile tCrop : this.mCropCache) {
+ if (tCrop == null) {
+ this.mInvalidCache = true;
+ break;
+ }
+ CropCard aCrop = tCrop.getCrop();
+ if (aCrop != null) {
+ // Logger.INFO("Found "+aCrop.displayName()+" at offset "+x+", "+y+", "+z);
+ if (!aCrop.canGrow(tCrop) && aCrop.canBeHarvested(tCrop)) {
+ if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsage(), true)) {
+ ItemStack[] aHarvest = tCrop.harvest_automated(true);
+ if (aHarvest != null && aHarvest.length > 0) {
+ for (ItemStack aStack : aHarvest) {
+ if (aStack.stackSize > 0) {
+ if (this.mTier * 5 > MathUtils.randInt(1, 100)) {
+ aStack.stackSize += Math.floor(tCrop.getGain() / 10);
+ Logger.INFO("Bonus output given for " + aCrop.displayName());
+ }
+ Logger.INFO("Harvested " + aCrop.displayName());
+ aAllDrops.addAll(splitOutputStacks(aStack));
+ }
+ }
+ }
+ }
+ }
+ if (this.mModeAlternative) {
+ processSecondaryFunctions(tCrop);
+ }
+ }
+ }
+
+ if (!aAllDrops.isEmpty()) {
+ Logger.INFO("Handling " + aAllDrops.size() + " Harvests");
+ Iterator<ItemStack> iter = aAllDrops.iterator();
+ while (iter.hasNext()) {
+ ItemStack aDrop = iter.next();
+ if (ItemUtils.checkForInvalidItems(aDrop)) {
+
+ for (int i = SLOT_OUTPUT_START; i < this.getSizeInventory(); i++) {
+ if (this.mInventory[i] != null) {
+ // Logger.INFO("Slot "+i+" contains "+this.mInventory[i].getDisplayName());
+ if (GT_Utility.areStacksEqual(aDrop, this.mInventory[i], false)) {
+ // Same
+ if (this.mInventory[i].stackSize < 64
+ && (this.mInventory[i].stackSize + aDrop.stackSize <= 64)) {
+ // can merge
+ // Logger.INFO("Slot "+i+" size: "+mInventory[i].stackSize+" + Drop
+ // Size: "+aDrop.stackSize+" = "+(mInventory[i].stackSize +
+ // aDrop.stackSize));
+ this.mInventory[i].stackSize += aDrop.stackSize;
+ break;
+ } else if (this.mInventory[i].stackSize < 64
+ && (this.mInventory[i].stackSize + aDrop.stackSize > 64)) {
+ // can merge
+ // Logger.INFO("Slot "+i+" size: "+mInventory[i].stackSize+" + Drop
+ // Size: "+aDrop.stackSize+" = "+(mInventory[i].stackSize +
+ // aDrop.stackSize));
+ int aRemainder = this.mInventory[i].stackSize + aDrop.stackSize - 64;
+ Logger.INFO("Remainder: " + aRemainder + ", Continuing.");
+ this.mInventory[i].stackSize = 64;
+ aDrop.stackSize = aRemainder;
+ continue;
+ } else {
+ // Logger.INFO("Slot "+i+" size: 64, Continuing.");
+ continue;
+ }
+ }
+ } else {
+ // Logger.INFO("Slot "+i+" is empty, setting to "+aDrop.getDisplayName()+"
+ // x"+aDrop.stackSize);
+ this.mInventory[i] = aDrop;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public boolean hasFertilizer() {
+ for (int i = SLOT_FERT_1; i <= SLOT_FERT_4; i++) {
+ if (this.mInventory[i] != null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean consumeFertilizer(boolean aSimulate) {
+ if (hasFertilizer()) {
+ for (int i = SLOT_FERT_1; i <= SLOT_FERT_4; i++) {
+ if (this.mInventory[i] != null) {
+ consume(i, 1, aSimulate);
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean hasWeedEX() {
+ for (int i = SLOT_WEEDEX_1; i <= SLOT_WEEDEX_2; i++) {
+ if (this.mInventory[i] != null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean consumeWeedEX(boolean aSimulate) {
+ if (hasWeedEX()) {
+ for (int i = SLOT_WEEDEX_1; i <= SLOT_WEEDEX_2; i++) {
+ if (this.mInventory[i] != null) {
+ damage(i, 1, aSimulate);
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public void processSecondaryFunctions(ICropTile aCrop) {
+ if (!this.mModeAlternative) {
+ return;
+ }
+ if (hasFertilizer()
+ && consumeFertilizer(true)
+ && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()
+ && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true)
+ && applyFertilizer(aCrop)) {
+ if (consumeFertilizer(false)) {
+ // Logger.INFO("Consumed Fert.");
+ }
+ }
+ if (this.getFluidAmount() > 0
+ && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()
+ && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true)
+ && applyHydration(aCrop)) {
+ // Logger.INFO("Consumed Water.");
+ }
+ if (hasWeedEX()
+ && consumeWeedEX(true)
+ && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()
+ && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true)
+ && applyWeedEx(aCrop)) {
+ if (consumeWeedEX(false)) {
+ // Logger.INFO("Consumed Weed-EX.");
+ }
+ }
+ }
+
+ public boolean applyWeedEx(ICropTile aCrop) {
+ if (aCrop.getWeedExStorage() < 150) {
+ aCrop.setWeedExStorage(aCrop.getWeedExStorage() + 50);
+ boolean triggerDecline;
+ triggerDecline = aCrop.getWorld().rand.nextInt(3) == 0;
+ if (aCrop.getCrop() != null
+ && aCrop.getCrop().isWeed(aCrop)
+ && aCrop.getWeedExStorage() >= 75
+ && triggerDecline) {
+ switch (aCrop.getWorld().rand.nextInt(5)) {
+ case 0:
+ if (aCrop.getGrowth() > 0) {
+ aCrop.setGrowth((byte) (aCrop.getGrowth() - 1));
+ }
+ case 1:
+ if (aCrop.getGain() > 0) {
+ aCrop.setGain((byte) (aCrop.getGain() - 1));
+ }
+ default:
+ if (aCrop.getResistance() > 0) {
+ aCrop.setResistance((byte) (aCrop.getResistance() - 1));
+ }
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean applyFertilizer(ICropTile aCrop) {
+ if (aCrop.getNutrientStorage() >= 100) {
+ return false;
+ } else {
+ // Logger.INFO("Current Nutrient: "+aCrop.getNutrientStorage()+" for "+aCrop.getCrop().displayName());
+ aCrop.setNutrientStorage(aCrop.getNutrientStorage() + 100);
+ return true;
+ }
+ }
+
+ public boolean applyHydration(ICropTile aCrop) {
+ if (aCrop.getHydrationStorage() >= 200 || this.getFluidAmount() == 0) {
+ // Logger.INFO("Hydration Max");
+ return false;
+ } else {
+ int apply = 200 - aCrop.getHydrationStorage();
+ if (this.getFluidAmount() >= 0) {
+ int drain = 0;
+ if (this.getFluidAmount() >= apply) {
+ drain = apply;
+ } else {
+ drain = this.getFluidAmount();
+ }
+ this.mFluid.amount -= drain;
+ if (this.mFluid.amount <= 0) {
+ this.mFluid = null;
+ }
+ // Logger.INFO("Did Hydrate");
+ aCrop.setHydrationStorage(aCrop.getHydrationStorage() + drain);
+ return true;
+ } else {
+ // Logger.INFO("No water?");
+ return false;
+ }
+ }
+ }
+
+ public boolean consume(int aSlot, int amount, boolean simulate) {
+ ItemStack stack = this.mInventory[aSlot];
+ if (stack != null && stack.stackSize >= amount) {
+ int currentAmount = Math.min(amount, stack.stackSize);
+ amount -= currentAmount;
+ if (!simulate) {
+ if (stack.stackSize == currentAmount) {
+ this.mInventory[aSlot] = null;
+ } else {
+ stack.stackSize -= currentAmount;
+ }
+ } else {
+ return amount >= 0;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public ItemStack damage(int aSlot, int amount, boolean simulate) {
+ ItemStack ret = null;
+ int damageApplied = 0;
+ ItemStack stack = this.mInventory[aSlot];
+ Item item = stack.getItem();
+ if (stack != null
+ && item.isDamageable()
+ && (ret == null || stack.getItem() == ret.getItem() && ItemStack.areItemStackTagsEqual(stack, ret))) {
+ if (simulate) {
+ stack = stack.copy();
+ }
+ int maxDamage = DamageHandler.getMaxDamage(stack);
+ while (amount > 0 && stack.stackSize > 0) {
+ int currentAmount = Math.min(amount, maxDamage - DamageHandler.getDamage(stack));
+ DamageHandler.damage(stack, currentAmount, null);
+ damageApplied += currentAmount;
+ amount -= currentAmount;
+ if (DamageHandler.getDamage(stack) >= maxDamage) {
+ --stack.stackSize;
+ DamageHandler.setDamage(stack, 0);
+ }
+
+ if (ret == null) {
+ ret = stack.copy();
+ }
+ }
+ if (stack.stackSize == 0 && !simulate) {
+ this.mInventory[aSlot] = null;
+ }
+ }
+
+ if (ret != null) {
+ int i = DamageHandler.getMaxDamage(ret);
+ ret.stackSize = damageApplied / i;
+ DamageHandler.setDamage(ret, damageApplied % i);
+ }
+ return ret;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aStack != null && aIndex >= SLOT_OUTPUT_START && aIndex < this.getSizeInventory();
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (aStack != null) {
+ if (aStack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) {
+ return aIndex >= SLOT_FERT_1 && aIndex <= SLOT_FERT_4;
+ } else if (aStack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) {
+ return aIndex >= SLOT_WEEDEX_1 && aIndex <= SLOT_WEEDEX_2;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String[] getDescription() {
+ int aRadius = 10 + getRange(this.mTier);
+ int aSide = (aRadius - 1) / 2;
+ return new String[] {
+ this.mDescription,
+ "Secondary mode can Hydrate/Fertilize/Weed-EX",
+ "Consumes " + powerUsage() + "eu per harvest",
+ "Consumes " + powerUsageSecondary() + "eu per secondary operation",
+ "Can harvest 2 blocks above",
+ "Radius: " + aSide + " each side (" + aRadius + "x3x" + aRadius + ")",
+ "Has " + (this.mTier * 5) + "% chance for extra drops",
+ "Holds " + this.getCapacity() + "L of Water",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return true;
+ }
+
+ /*@Override
+ public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing)
+ return 118+(aRedstone?8:0);
+ if (GT_Utility.getOppositeSide(aSide) == aFacing)
+ return 113+(aRedstone?8:0);
+
+ int tIndex = 128+(aRedstone?8:0);
+
+ switch (aFacing) {
+ case 0:
+ return tIndex+64;
+ case 1:
+ return tIndex+32;
+ case 2: switch (aSide) {
+ case 0: return tIndex+32;
+ case 1: return tIndex+32;
+ case 4: return tIndex+16;
+ case 5: return tIndex+48;
+ }
+ case 3: switch (aSide) {
+ case 0: return tIndex+64;
+ case 1: return tIndex+64;
+ case 4: return tIndex+48;
+ case 5: return tIndex+16;
+ }
+ case 4: switch (aSide) {
+ case 0: return tIndex+16;
+ case 1: return tIndex+16;
+ case 2: return tIndex+48;
+ case 3: return tIndex+16;
+ }
+ case 5: switch (aSide) {
+ case 0: return tIndex+48;
+ case 1: return tIndex+48;
+ case 2: return tIndex+16;
+ case 3: return tIndex+48;
+ }
+ }
+ return tIndex;
+ } */
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFront(i);
+ rTextures[6][i + 1] = this.getBack(i);
+ rTextures[7][i + 1] = this.getBottom(i);
+ rTextures[8][i + 1] = this.getTop(i);
+ rTextures[9][i + 1] = this.getSides(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == 0 || aSide == 1) {
+ return this.mTextures[3][aColorIndex + 1];
+ } else {
+ return this.mTextures[4][aColorIndex + 1];
+ }
+ /*return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
+ + 1];*/
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)
+ };
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mModeAlternative", this.mModeAlternative);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mModeAlternative = aNBT.getBoolean("mModeAlternative");
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java
index 129446c40d..6ba1e373eb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java
@@ -2,21 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.V;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
import gregtech.api.enums.Textures;
import gregtech.api.enums.Textures.BlockIcons.CustomIcon;
import gregtech.api.interfaces.ITexture;
@@ -24,305 +11,313 @@ 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 gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_TieredMachineBlock {
- public static String[] BlacklistedTileEntiyClassNames;
-
- private byte mMode = 0; // 0: RandomTicks around 1: TileEntities with range
- // 1
- private static CustomIcon _mGTIco_Norm_Idle;
- private static CustomIcon _mGTIco_Norm_Active;
- private static CustomIcon _mGTIco_TE_Idle;
- private static CustomIcon _mGTIco_TE_Active;
- private static int[] mAccelerateStatic = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512, 512, 512, 512 };
-
- @Override
- public void registerIcons(IIconRegister aBlockIconRegister) {
- super.registerIcons(aBlockIconRegister);
- _mGTIco_Norm_Idle = new CustomIcon("iconsets/OVERLAY_ACCELERATOR");
- _mGTIco_Norm_Active = new CustomIcon("iconsets/OVERLAY_ACCELERATOR_ACTIVE");
- _mGTIco_TE_Idle = new CustomIcon("iconsets/OVERLAY_ACCELERATOR_TE");
- _mGTIco_TE_Active = new CustomIcon("iconsets/OVERLAY_ACCELERATOR_TE_ACTIVE");
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void onValueUpdate(byte aValue) {
- mMode = aValue;
- }
-
- @Override
- public byte getUpdateData() {
- return mMode;
- }
-
- public GT_MetaTileEntity_WorldAccelerator(int pID, String pName, String pNameRegional, int pTier) {
- super(pID, pName, pNameRegional, pTier, 0, "");
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- String.format("Accelerating things (Radius: %d EU/t: %d Speed Bonus: x%d)", mTier,
- getEnergyDemand(mTier, false), mAccelerateStatic[mTier]),
- "Use a screwdriver to change mode", "To accelerate TileEntities, this machine has to be adjacent to it",
- "This machine accepts up to 8 Amps", "Accelerating TileEntities doubles Energy-Demand"};
-
- }
-
- public GT_MetaTileEntity_WorldAccelerator(String pName, int pTier, int pInvSlotCount, String pDescription,
- ITexture[][][] pTextures) {
- super(pName, pTier, pInvSlotCount, pDescription, pTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity pTileEntity) {
- return new GT_MetaTileEntity_WorldAccelerator(mName, mTier, mInventory.length, mDescription, mTextures);
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] pTextures) {
- return new ITexture[0][0][0];
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity pBaseMetaTileEntity, byte pSide, byte pFacing, byte pColorIndex,
- boolean pActive, boolean pRedstone) {
- if (mMode == 0)
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1],
- (pSide < 2) ? null
- : pActive ? new GT_RenderedTexture(_mGTIco_Norm_Active)
- : new GT_RenderedTexture(_mGTIco_Norm_Idle) };
- else
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1], (pSide < 2) ? null
- : pActive ? new GT_RenderedTexture(_mGTIco_TE_Active) : new GT_RenderedTexture(_mGTIco_TE_Idle) };
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity pBaseMetaTileEntity, int pIndex, byte pSide, ItemStack pStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity pBaseMetaTileEntity, int pIndex, byte pSide, ItemStack pStack) {
- return false;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound pNBT) {
- pNBT.setByte("mAccelMode", mMode);
- }
-
- public static long getEnergyDemand(int pTier, boolean pIsAcceleratingTEs) {
- return V[pTier] * (pIsAcceleratingTEs ? 6 : 3);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound pNBT) {
- mMode = pNBT.getByte("mAccelMode");
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer pPlayer) {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return true;
- }
-
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- @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 maxAmperesIn() {
- return 8;
- }
-
- private static String[] mModeStr = { "Blocks", "TileEntities" };
-
- @Override
- public void onScrewdriverRightClick(byte pSide, EntityPlayer pPlayer, float pX, float pY, float pZ) {
- mMode = (byte) (mMode == 0x00 ? 0x01 : 0x00);
- markDirty();
- PlayerUtils.messagePlayer(pPlayer, String.format("Switched mode to: %s", mModeStr[mMode]));
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity pBaseMetaTileEntity, long pTick) {
- try {
- if (!pBaseMetaTileEntity.isServerSide())
- return;
-
- long tEnergyDemand = getEnergyDemand(mTier, (mMode == 1));
-
- // Do we have enough energy to run? Or are we not allowed to run?
- if (pBaseMetaTileEntity.getStoredEU() < tEnergyDemand || !pBaseMetaTileEntity.isAllowedToWork()) {
- // Check if machine was active before
- if (pBaseMetaTileEntity.isActive())
- pBaseMetaTileEntity.setActive(false); // Then disable it now
- } else {
- // Continue to drain power
- if (pBaseMetaTileEntity.decreaseStoredEnergyUnits(tEnergyDemand, false)) {
- World tWorld = pBaseMetaTileEntity.getWorld();
- // Limit the random ticks to once per second
- if (mMode == 0) {
- if (pTick % 20 == 0)
- doAccelerateNormalBlocks(pBaseMetaTileEntity, tWorld);
- } else
- doAccelerateTileEntities(pBaseMetaTileEntity, tWorld);
-
- } else {
- // Energy drain failed. Disable machine
- if (pBaseMetaTileEntity.isActive())
- pBaseMetaTileEntity.setActive(false);
- }
- }
- } catch (Exception e) {
- Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.onPostTick.crash");
- Logger.ERROR(e.getMessage());
- }
- }
-
- private void doAccelerateTileEntities(IGregTechTileEntity pBaseMetaTileEntity, World pWorld) {
- try {
- if (!pBaseMetaTileEntity.isActive())
- getBaseMetaTileEntity().setActive(true);
-
- for (ForgeDirection tDir : ForgeDirection.VALID_DIRECTIONS) {
- TileEntity tTile = pBaseMetaTileEntity.getTileEntityAtSide((byte) tDir.ordinal());
- if (isTEBlackListed(tTile))
- continue;
-
- long tMaxTime = System.nanoTime() + 1000000;
- for (int j = 0; j < mAccelerateStatic[mTier]; j++) {
- tTile.updateEntity();
- if (System.nanoTime() > tMaxTime)
- break;
- }
- }
- } catch (Exception e) {
- Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.doAccelerateTileEntities.crash");
- Logger.ERROR(e.getMessage());
- }
- }
-
- private static List<String> _mBlacklistedTileEntities = new ArrayList<String>();
-
- // Inspired by ChromatiCraft's TileAccelerator
- private boolean isTEBlackListed(TileEntity pTile) {
- if (pTile == null)
- return true; // Obvious
- if (!pTile.canUpdate())
- return true; // Skip if TE can't update at all
- if (pTile.isInvalid())
- return true; // Obvious
-
- String tSimpleClassName = pTile.getClass().getSimpleName().toLowerCase();
- String tCanonicalName = pTile.getClass().getCanonicalName().toLowerCase();
- if (tSimpleClassName.contains("conduit") || tSimpleClassName.contains("wire")
- || tSimpleClassName.contains("cable"))
- return true;
- if (tCanonicalName.contains("appeng") || tCanonicalName.contains("gregtech"))
- // Don't accelerate ANY Gregtech machines!
- return true;
- for (String tS : BlacklistedTileEntiyClassNames) {
- if (tCanonicalName.equalsIgnoreCase(tS))
- return true;
- }
-
- return false;
- }
-
- /**
- * Accelerate normal blocks. Eats some power and adds randomTicks to every
- * block within its working area (Tier-Number = radius) This does only
- * affect blocks that implement the "RandomTick" method; Which is mostly
- * used for grass growth and plants.
- *
- * @param pBaseMetaTileEntity
- */
- private void doAccelerateNormalBlocks(IGregTechTileEntity pBaseMetaTileEntity, World pWorld) {
- if (!pBaseMetaTileEntity.isActive())
- getBaseMetaTileEntity().setActive(true);
-
- Random rnd = new Random();
- int tX = pBaseMetaTileEntity.getXCoord();
- int tY = pBaseMetaTileEntity.getYCoord();
- int tZ = pBaseMetaTileEntity.getZCoord();
-
- int tX1 = tX - mTier;
- int tX2 = tX + mTier;
- int tY1 = Math.max(tY - mTier, 0); // Limit to bedrock
- int tY2 = Math.min(tY + mTier, 255); // Limit to build height
- int tZ1 = tZ - mTier;
- int tZ2 = tZ + mTier;
-
- for (int xi = tX1; xi <= tX2; xi++)
- for (int yi = tY1; yi <= tY2; yi++)
- for (int zi = tZ1; zi <= tZ2; zi++)
- tryTickBlock(pWorld, xi, yi, zi, rnd);
-
- }
-
- /**
- * Send a tick to the target block
- *
- * @param pWorld
- * @param pX
- * @param pY
- * @param pZ
- * @param pRnd
- */
- private void tryTickBlock(World pWorld, int pX, int pY, int pZ, Random pRnd) {
- try {
- for (int j = 0; j < mTier; j++) {
- Block tBlock = pWorld.getBlock(pX, pY, pZ);
- if (tBlock.getTickRandomly())
- tBlock.updateTick(pWorld, pX, pY, pZ, pRnd);
- }
- } catch (Exception e) {
- Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.tryTickBlock.crash");
- Logger.ERROR(e.getMessage());
- }
- }
-} \ No newline at end of file
+ public static String[] BlacklistedTileEntiyClassNames;
+
+ private byte mMode = 0; // 0: RandomTicks around 1: TileEntities with range
+ // 1
+ private static CustomIcon _mGTIco_Norm_Idle;
+ private static CustomIcon _mGTIco_Norm_Active;
+ private static CustomIcon _mGTIco_TE_Idle;
+ private static CustomIcon _mGTIco_TE_Active;
+ private static int[] mAccelerateStatic = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512, 512, 512, 512};
+
+ @Override
+ public void registerIcons(IIconRegister aBlockIconRegister) {
+ super.registerIcons(aBlockIconRegister);
+ _mGTIco_Norm_Idle = new CustomIcon("iconsets/OVERLAY_ACCELERATOR");
+ _mGTIco_Norm_Active = new CustomIcon("iconsets/OVERLAY_ACCELERATOR_ACTIVE");
+ _mGTIco_TE_Idle = new CustomIcon("iconsets/OVERLAY_ACCELERATOR_TE");
+ _mGTIco_TE_Active = new CustomIcon("iconsets/OVERLAY_ACCELERATOR_TE_ACTIVE");
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void onValueUpdate(byte aValue) {
+ mMode = aValue;
+ }
+
+ @Override
+ public byte getUpdateData() {
+ return mMode;
+ }
+
+ public GT_MetaTileEntity_WorldAccelerator(int pID, String pName, String pNameRegional, int pTier) {
+ super(pID, pName, pNameRegional, pTier, 0, "");
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ String.format(
+ "Accelerating things (Radius: %d EU/t: %d Speed Bonus: x%d)",
+ mTier, getEnergyDemand(mTier, false), mAccelerateStatic[mTier]),
+ "Use a screwdriver to change mode",
+ "To accelerate TileEntities, this machine has to be adjacent to it",
+ "This machine accepts up to 8 Amps",
+ "Accelerating TileEntities doubles Energy-Demand"
+ };
+ }
+
+ public GT_MetaTileEntity_WorldAccelerator(
+ String pName, int pTier, int pInvSlotCount, String pDescription, ITexture[][][] pTextures) {
+ super(pName, pTier, pInvSlotCount, pDescription, pTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity pTileEntity) {
+ return new GT_MetaTileEntity_WorldAccelerator(mName, mTier, mInventory.length, mDescription, mTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] pTextures) {
+ return new ITexture[0][0][0];
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ IGregTechTileEntity pBaseMetaTileEntity,
+ byte pSide,
+ byte pFacing,
+ byte pColorIndex,
+ boolean pActive,
+ boolean pRedstone) {
+ if (mMode == 0)
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1],
+ (pSide < 2)
+ ? null
+ : pActive
+ ? new GT_RenderedTexture(_mGTIco_Norm_Active)
+ : new GT_RenderedTexture(_mGTIco_Norm_Idle)
+ };
+ else
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1],
+ (pSide < 2)
+ ? null
+ : pActive ? new GT_RenderedTexture(_mGTIco_TE_Active) : new GT_RenderedTexture(_mGTIco_TE_Idle)
+ };
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity pBaseMetaTileEntity, int pIndex, byte pSide, ItemStack pStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity pBaseMetaTileEntity, int pIndex, byte pSide, ItemStack pStack) {
+ return false;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound pNBT) {
+ pNBT.setByte("mAccelMode", mMode);
+ }
+
+ public static long getEnergyDemand(int pTier, boolean pIsAcceleratingTEs) {
+ return V[pTier] * (pIsAcceleratingTEs ? 6 : 3);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound pNBT) {
+ mMode = pNBT.getByte("mAccelMode");
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer pPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @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 maxAmperesIn() {
+ return 8;
+ }
+
+ private static String[] mModeStr = {"Blocks", "TileEntities"};
+
+ @Override
+ public void onScrewdriverRightClick(byte pSide, EntityPlayer pPlayer, float pX, float pY, float pZ) {
+ mMode = (byte) (mMode == 0x00 ? 0x01 : 0x00);
+ markDirty();
+ PlayerUtils.messagePlayer(pPlayer, String.format("Switched mode to: %s", mModeStr[mMode]));
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity pBaseMetaTileEntity, long pTick) {
+ try {
+ if (!pBaseMetaTileEntity.isServerSide()) return;
+
+ long tEnergyDemand = getEnergyDemand(mTier, (mMode == 1));
+
+ // Do we have enough energy to run? Or are we not allowed to run?
+ if (pBaseMetaTileEntity.getStoredEU() < tEnergyDemand || !pBaseMetaTileEntity.isAllowedToWork()) {
+ // Check if machine was active before
+ if (pBaseMetaTileEntity.isActive()) pBaseMetaTileEntity.setActive(false); // Then disable it now
+ } else {
+ // Continue to drain power
+ if (pBaseMetaTileEntity.decreaseStoredEnergyUnits(tEnergyDemand, false)) {
+ World tWorld = pBaseMetaTileEntity.getWorld();
+ // Limit the random ticks to once per second
+ if (mMode == 0) {
+ if (pTick % 20 == 0) doAccelerateNormalBlocks(pBaseMetaTileEntity, tWorld);
+ } else doAccelerateTileEntities(pBaseMetaTileEntity, tWorld);
+
+ } else {
+ // Energy drain failed. Disable machine
+ if (pBaseMetaTileEntity.isActive()) pBaseMetaTileEntity.setActive(false);
+ }
+ }
+ } catch (Exception e) {
+ Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.onPostTick.crash");
+ Logger.ERROR(e.getMessage());
+ }
+ }
+
+ private void doAccelerateTileEntities(IGregTechTileEntity pBaseMetaTileEntity, World pWorld) {
+ try {
+ if (!pBaseMetaTileEntity.isActive()) getBaseMetaTileEntity().setActive(true);
+
+ for (ForgeDirection tDir : ForgeDirection.VALID_DIRECTIONS) {
+ TileEntity tTile = pBaseMetaTileEntity.getTileEntityAtSide((byte) tDir.ordinal());
+ if (isTEBlackListed(tTile)) continue;
+
+ long tMaxTime = System.nanoTime() + 1000000;
+ for (int j = 0; j < mAccelerateStatic[mTier]; j++) {
+ tTile.updateEntity();
+ if (System.nanoTime() > tMaxTime) break;
+ }
+ }
+ } catch (Exception e) {
+ Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.doAccelerateTileEntities.crash");
+ Logger.ERROR(e.getMessage());
+ }
+ }
+
+ private static List<String> _mBlacklistedTileEntities = new ArrayList<String>();
+
+ // Inspired by ChromatiCraft's TileAccelerator
+ private boolean isTEBlackListed(TileEntity pTile) {
+ if (pTile == null) return true; // Obvious
+ if (!pTile.canUpdate()) return true; // Skip if TE can't update at all
+ if (pTile.isInvalid()) return true; // Obvious
+
+ String tSimpleClassName = pTile.getClass().getSimpleName().toLowerCase();
+ String tCanonicalName = pTile.getClass().getCanonicalName().toLowerCase();
+ if (tSimpleClassName.contains("conduit")
+ || tSimpleClassName.contains("wire")
+ || tSimpleClassName.contains("cable")) return true;
+ if (tCanonicalName.contains("appeng") || tCanonicalName.contains("gregtech"))
+ // Don't accelerate ANY Gregtech machines!
+ return true;
+ for (String tS : BlacklistedTileEntiyClassNames) {
+ if (tCanonicalName.equalsIgnoreCase(tS)) return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Accelerate normal blocks. Eats some power and adds randomTicks to every
+ * block within its working area (Tier-Number = radius) This does only
+ * affect blocks that implement the "RandomTick" method; Which is mostly
+ * used for grass growth and plants.
+ *
+ * @param pBaseMetaTileEntity
+ */
+ private void doAccelerateNormalBlocks(IGregTechTileEntity pBaseMetaTileEntity, World pWorld) {
+ if (!pBaseMetaTileEntity.isActive()) getBaseMetaTileEntity().setActive(true);
+
+ Random rnd = new Random();
+ int tX = pBaseMetaTileEntity.getXCoord();
+ int tY = pBaseMetaTileEntity.getYCoord();
+ int tZ = pBaseMetaTileEntity.getZCoord();
+
+ int tX1 = tX - mTier;
+ int tX2 = tX + mTier;
+ int tY1 = Math.max(tY - mTier, 0); // Limit to bedrock
+ int tY2 = Math.min(tY + mTier, 255); // Limit to build height
+ int tZ1 = tZ - mTier;
+ int tZ2 = tZ + mTier;
+
+ for (int xi = tX1; xi <= tX2; xi++)
+ for (int yi = tY1; yi <= tY2; yi++)
+ for (int zi = tZ1; zi <= tZ2; zi++) tryTickBlock(pWorld, xi, yi, zi, rnd);
+ }
+
+ /**
+ * Send a tick to the target block
+ *
+ * @param pWorld
+ * @param pX
+ * @param pY
+ * @param pZ
+ * @param pRnd
+ */
+ private void tryTickBlock(World pWorld, int pX, int pY, int pZ, Random pRnd) {
+ try {
+ for (int j = 0; j < mTier; j++) {
+ Block tBlock = pWorld.getBlock(pX, pY, pZ);
+ if (tBlock.getTickRandomly()) tBlock.updateTick(pWorld, pX, pY, pZ, pRnd);
+ }
+ } catch (Exception e) {
+ Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.tryTickBlock.crash");
+ Logger.ERROR(e.getMessage());
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
index 33ffd1f118..23263bd9fd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
@@ -2,8 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.V;
-import org.apache.commons.lang3.ArrayUtils;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
@@ -34,834 +32,865 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
+import org.apache.commons.lang3.ArrayUtils;
public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_BasicMachine {
- public int mPollutionReduction = 0;
- protected int mBaseEff = 2500;
- protected int mOptimalAirFlow = 0;
- protected boolean mHasPollution = false;
- protected int SLOT_ROTOR = 5;
- protected int SLOT_FILTER = 6;
- protected static boolean mPollutionEnabled = true;
-
- protected boolean mSaveRotor = false;
-
- public GregtechMetaAtmosphericReconditioner(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 2, "Making sure you don't live in Gwalior - Uses 2A", 3, 0, "Recycler.png", "",
- new ITexture[]{
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)
- });
- mPollutionEnabled = PollutionUtils.isPollutionEnabled();
- }
-
- public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName);
- mPollutionEnabled = PollutionUtils.isPollutionEnabled();
- }
-
- /*public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName);
- }*/
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaAtmosphericReconditioner(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- @Override
- public String[] getDescription() {
-
- boolean highTier = this.mTier >= 7;
-
- String[] A = new String[]{
- this.mDescription,
- highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "",
- highTier ? "If these chunks are not loaded, they will be ignored" : "",
- "Requires a turbine rotor and an Air Filter [T1/T2] to run.",
- "The turbine rotor must be manually inserted/replaced",
- "Can be configured with a soldering iron to change modes",
- "Low Efficiency: Removes half pollution, Turbine takes 50% dmg",
- "High Efficiency: Removes full pollution, Turbine takes 100% dmg",
- "Turbine Rotor will not break in LE mode",
- "Insert an equal tier Conveyor Module to enable automation"
- };
- if (!mPollutionEnabled) {
- String[] B = new String[] {
- "===============================================",
- "Pollution is disabled, scrubbers will now have a bonus use",
- "They are now able to remove ALL lingering pollution as GT ignores it",
- "and it will linger forever!",
- "===============================================",
- };
- A = ArrayUtils.addAll(A, B);
- }
- return A;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mOptimalAirFlow", this.mOptimalAirFlow);
- aNBT.setBoolean("mSaveRotor", mSaveRotor);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mOptimalAirFlow = aNBT.getInteger("mOptimalAirFlow");
- this.mSaveRotor = aNBT.getBoolean("mSaveRotor");
- }
-
- @Override
- public long maxAmperesIn() {
- return 2;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return V[mTier] * 2;
- }
-
- @Override
- public long maxEUStore() {
- return V[mTier] * 256;
- }
-
- @Override
- public long maxEUInput() {
- return V[mTier];
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aBaseMetaTileEntity.isServerSide()) {
-
- //Get Current Pollution Amount.
- int mCurrentPollution = getCurrentChunkPollution();
- boolean isIdle = true;
-
- //Get Inventory Item
- ItemStack stackRotor = this.mInventory[SLOT_ROTOR];
- ItemStack stackFilter = this.mInventory[SLOT_FILTER];
-
- //Power Drain
- long drainEU = maxEUInput() * maxAmperesIn();
- if (aBaseMetaTileEntity.isActive() && aBaseMetaTileEntity.getStoredEU() >= drainEU){
- if(aBaseMetaTileEntity.decreaseStoredEnergyUnits(drainEU, false)){
- isIdle = false;
- }
- else {
- aBaseMetaTileEntity.setActive(false);
- this.sendSound((byte) -122);
- }
- }
- else if (!aBaseMetaTileEntity.isActive() && aBaseMetaTileEntity.getStoredEU() >= drainEU/4){
- if(aBaseMetaTileEntity.decreaseStoredEnergyUnits((drainEU/4), false)){
- isIdle = false;
- }
- else {
- aBaseMetaTileEntity.setActive(false);
- this.sendSound((byte) -122);
- }
- }
- else {
- aBaseMetaTileEntity.setActive(false);
- this.sendSound((byte) -122);
- }
-
- //Only try once/sec.
- if (!isIdle && aTick % 20L == 0L){
-
-
-
- for (int i=0;i<this.mInventory.length;i++) {
- ItemStack aSlotContent = this.mInventory[i];
- if (aSlotContent != null) {
- Logger.INFO("Found "+aSlotContent.getDisplayName()+" in slot "+i);
- }
- }
-
- for (int i=0;i<this.mInventory.length;i++) {
- if (hasRotor(this.mInventory[i])) {
- Logger.INFO("Found Rotor in slot "+i);
- break;
- }
- }
- for (int i=0;i<this.mInventory.length;i++) {
- if (hasAirFilter(this.mInventory[i])) {
- Logger.INFO("Found Filter in slot "+i);
- break;
- }
- }
-
- //Check if machine can work.
- if ((aBaseMetaTileEntity.isAllowedToWork())){
- Logger.INFO("Can work.");
-
- //Enable machine animation/graphic
- if (hasRotor(stackRotor) && hasAirFilter(stackFilter) && this.mHasPollution){
- if (!this.getBaseMetaTileEntity().isActive()) {
- Logger.INFO("Set Active.");
- aBaseMetaTileEntity.setActive(true);
- }
- }
- else if (!this.mHasPollution || mCurrentPollution <= 0 || stackRotor == null || stackFilter == null || !hasRotor(stackRotor) || !hasAirFilter(stackFilter)){
- if (!this.getBaseMetaTileEntity().isActive()) {
- Logger.INFO("Set Inactive.");
- aBaseMetaTileEntity.setActive(false);
- this.sendSound((byte) -122);
- }
- }
-
- //If Active.
- if (aBaseMetaTileEntity.isActive()){
- Logger.INFO("Doing something.");
-
- //Do nothing if there is no pollution.
- if(this.mHasPollution && mCurrentPollution > 0){
- Logger.INFO("Has Pollution? "+mHasPollution+", Current Pollution: "+mCurrentPollution);
-
- //Only check every 30s.
- if (!isIdle && aTick % (20L * 30) == 0L){
- mPollutionEnabled = PollutionUtils.isPollutionEnabled();
- //Clear out pollution if it's disabled, because I am a nice gal.
- if (!PollutionUtils.isPollutionEnabled()) {
- PollutionUtils.nullifyPollution(this.getBaseMetaTileEntity());
- }
- }
-
-
-
-
- //Use a Turbine
- if(hasRotor(stackRotor) && hasAirFilter(stackFilter)){
- Logger.INFO("Found Turbine.");
-
- mBaseEff = getBaseEfficiency(stackRotor);
- mOptimalAirFlow = getOptimalAirFlow(stackRotor);
-
- //Make sure we have a valid Turbine and Eff/Airflow
- if (this.mBaseEff > 0 && this.mOptimalAirFlow > 0){
- //Utils.LOG_WARNING("Pollution Cleaner [5]");
-
- //Log Debug information.
- Logger.INFO("mBaseEff[1]:"+mBaseEff);
- Logger.INFO("mOptimalAirFlow[1]:"+mOptimalAirFlow);
-
- //Calculate The Voltage we are running
- long tVoltage = drainEU;
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-
- //Check Sides for Air,
- //More air means more pollution processing.
- int mAirSides = getFreeSpaces();
-
- int reduction = 0;
-
- //If no sides are free, how will you process the atmosphere?
- if (mAirSides > 0){
- reduction += (((Math.max((tTier-2), 1)*2)*50)*mAirSides); //Was originally *100
- Logger.INFO("mPollutionReduction[1]:"+reduction);
-
- //I stole this code
- reduction = (MathUtils.safeInt((long)reduction*this.mBaseEff)/100000)*mAirSides*Math.max((tTier-2), 1);
- Logger.INFO("reduction[2]:"+reduction);
- reduction = MathUtils.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
- Logger.INFO("reduction[3]:"+reduction);
-
- mPollutionReduction = reduction;
-
- //Set a temp to remove variable to aleviate duplicate code.
- int toRemove = 0;
-
- Logger.INFO("mCurrentPollution[4]:"+mCurrentPollution);
- Logger.INFO("mCurrentPollution[5]:"+reduction);
- if (reduction <= mCurrentPollution){
- //Clean some Air.
- toRemove = reduction;
- }
- else {
- //Makes sure we don't get negative pollution.
- toRemove = mCurrentPollution;
- }
-
- toRemove = toRemove/2;
- Logger.INFO("mCurrentPollution[6]:"+toRemove);
-
- //We are good to clean
- if (toRemove > 0){
- if (damageTurbineRotor() && damageAirFilter()){
- Logger.INFO("Removing "+toRemove+" pollution");
- removePollution(mSaveRotor ? (toRemove/2) : toRemove);
- Logger.INFO("mNewPollution[4]:"+getCurrentChunkPollution());
- }
- else {
- Logger.INFO("Could not damage turbine rotor or Air Filter.");
- aBaseMetaTileEntity.setActive(false);
- }
- } //End of pollution removal block.
- } //End of valid air sides block.
- } //End of valid toolstats block.
- } //End of correct inventory item block.
- else {
- //Utils.LOG_WARNING("Wrong Tool metaitem Found.");
- }
- }
- }
- else if (!aBaseMetaTileEntity.isActive()) {
- return;
- }
- } //End of can work block.
- else { //Disable Machine.
- //aBaseMetaTileEntity.setActive(false);
- }
- } //End of 1/sec action block.
- else {
-
- if (hasRotor(stackRotor) && hasAirFilter(stackFilter) && this.mHasPollution && !isIdle && aBaseMetaTileEntity.isAllowedToWork()){
- aBaseMetaTileEntity.setActive(true);
- }
- else if (isIdle || !this.mHasPollution || mCurrentPollution <= 0 || stackRotor == null || stackFilter == null || !hasRotor(stackRotor) || !hasAirFilter(stackFilter)){
- aBaseMetaTileEntity.setActive(false);
- }
-
- }
- if (this.getBaseMetaTileEntity().isActive()) {
- if (MathUtils.randInt(0, 5) <= 2) {
- this.sendSound((byte) -120);
- }
- }
-
- } //End of is serverside block.
- }
-
-
- public int getCurrentChunkPollution(){
- int mCurrentChunkPollution = 0;
- if (this.mTier < 7) {
- mCurrentChunkPollution = PollutionUtils.getPollution(getBaseMetaTileEntity());
- }
- else {
- AutoMap<Chunk> aSurrounding = new AutoMap<Chunk>();
- World aWorld = this.getBaseMetaTileEntity().getWorld();
- int xPos = this.getBaseMetaTileEntity().getXCoord();
- int zPos = this.getBaseMetaTileEntity().getZCoord();
- Chunk a1 = aWorld.getChunkFromBlockCoords(xPos-32, zPos-32);
- Chunk a2 = aWorld.getChunkFromBlockCoords(xPos-32, zPos);
- Chunk a3 = aWorld.getChunkFromBlockCoords(xPos-32, zPos+32);
- Chunk b1 = aWorld.getChunkFromBlockCoords(xPos, zPos-32);
- Chunk b2 = aWorld.getChunkFromBlockCoords(xPos, zPos);
- Chunk b3 = aWorld.getChunkFromBlockCoords(xPos, zPos+32);
- Chunk c1 = aWorld.getChunkFromBlockCoords(xPos+32, zPos-32);
- Chunk c2 = aWorld.getChunkFromBlockCoords(xPos+32, zPos);
- Chunk c3 = aWorld.getChunkFromBlockCoords(xPos+32, zPos+32);
- aSurrounding.put(a1);
- aSurrounding.put(a2);
- aSurrounding.put(a3);
- aSurrounding.put(b1);
- aSurrounding.put(b2);
- aSurrounding.put(b3);
- aSurrounding.put(c1);
- aSurrounding.put(c2);
- aSurrounding.put(c3);
- for (Chunk r : aSurrounding) {
- mCurrentChunkPollution += getPollutionInChunk(r);
- }
- }
- if (mCurrentChunkPollution > 0){
- mHasPollution = true;
- }
- else {
- mHasPollution = false;
- }
- return mCurrentChunkPollution;
- }
-
- public int getPollutionInChunk(Chunk aChunk){
- int mCurrentChunkPollution = PollutionUtils.getPollution(aChunk);
- if (mCurrentChunkPollution > 0){
- mHasPollution = true;
- }
- else {
- mHasPollution = false;
- }
- return mCurrentChunkPollution;
- }
-
- public boolean hasRotor(ItemStack rotorStack){
- if(rotorStack != null){
- if (rotorStack.getItem() instanceof ItemBasicScrubberTurbine) {
- //Logger.INFO("Found Basic Turbine Rotor.");
- return true;
- }
- else if (rotorStack.getItem() instanceof GT_MetaGenerated_Tool && rotorStack.getItemDamage() >= 170 && rotorStack.getItemDamage() <= 179){
- //Logger.INFO("Found Turbine Rotor.");
- return true;
- }
- else {
- //Logger.INFO("Found: "+rotorStack.getDisplayName()+":"+rotorStack.getItemDamage());
- }
- }
- //Logger.INFO("Found No Turbine Rotor.");
- return false;
- }
-
- public boolean damageTurbineRotor(){
- try{
-
- boolean creativeRotor = false;
- ItemStack rotorStack = this.mInventory[SLOT_ROTOR];
- if (rotorStack == null) {
- return false;
- }
- else if (rotorStack.getItem() instanceof ItemBasicScrubberTurbine) {
- long currentUse = ItemBasicScrubberTurbine.getFilterDamage(rotorStack);
- //Remove broken Filter
- if (rotorStack.getItemDamage() == 0 && currentUse >= 2000-10){
- Logger.INFO("Depleting ItemBasicScrubberTurbine T1");
- this.mInventory[this.SLOT_FILTER] = null;
- return false;
- }
- else if (rotorStack.getItemDamage() == 1 && currentUse >= 4000-10){
- Logger.INFO("Depleting ItemBasicScrubberTurbine T2");
- this.mInventory[this.SLOT_FILTER] = null;
- return false;
- }
- else if (rotorStack.getItemDamage() == 2 && currentUse >= 6000-10){
- Logger.INFO("Depleting ItemBasicScrubberTurbine T3");
- this.mInventory[this.SLOT_FILTER] = null;
- return false;
- }
- else {
- //Do Damage
- Logger.INFO("Damaging ItemBasicScrubberTurbine");
- ItemBasicScrubberTurbine.setFilterDamage(rotorStack, currentUse+10);
- Logger.INFO("Rotor Damage: "+currentUse);
- return true;
- }
- }
- else if(rotorStack.getItem() instanceof GT_MetaGenerated_Tool_01) {
- Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(rotorStack);
- Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(rotorStack);
- if (t1 == Materials._NULL && t2 == Materials._NULL){
- Logger.INFO("Found creative rotor.");
- creativeRotor = true;
- }
- }
- else {
- Logger.INFO("Bad item in rotor slot.");
- return false;
- }
-
- if(mInventory[SLOT_ROTOR].getItem() instanceof GT_MetaGenerated_Tool_01 &&
- ((GT_MetaGenerated_Tool) mInventory[SLOT_ROTOR].getItem()).getToolStats(mInventory[SLOT_ROTOR]).getSpeedMultiplier()>0 &&
- GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[SLOT_ROTOR]).mToolSpeed>0 ) {
-
- long damageValue = (long) Math.floor(Math.abs(MathUtils.randFloat(1, 2) - MathUtils.randFloat(1, 3)) * (1 + 3 - 1) + 1);
- double fDam = Math.floor(Math.abs(MathUtils.randFloat(1f, 2f) - MathUtils.randFloat(1f, 2f)) * (1f + 2f - 1f) + 1f);
- damageValue -= fDam;
-
- //Logger.INFO("Trying to do "+damageValue+" damage to the rotor. ["+fDam+"]");
- /*Materials M1 = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[this.SLOT_ROTOR]);
- Materials M2 = GT_MetaGenerated_Tool.getSecondaryMaterial(this.mInventory[this.SLOT_ROTOR]);
-
- Logger.INFO("Trying to do "+damageValue+" damage to the rotor. [2]");*/
-
- //Damage Rotor
- //int rotorDurability = this.mInventory[this.SLOT_ROTOR].getItemDamage();
- long rotorDamage = creativeRotor ? 0 : GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]);
- long rotorDurabilityMax = creativeRotor ? Integer.MAX_VALUE : GT_MetaGenerated_Tool.getToolMaxDamage(this.mInventory[this.SLOT_ROTOR]);
- long rotorDurability = (rotorDurabilityMax - rotorDamage);
- Logger.INFO("Rotor Damage: "+rotorDamage + " | Max Durability: "+rotorDurabilityMax+" | "+" Remaining Durability: "+rotorDurability);
- if (rotorDurability >= damageValue){
-
-
- if (!mSaveRotor){
- Logger.INFO("Damaging Rotor.");
-
- if (!creativeRotor)
- GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null);
-
- long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]);
- if (tempDur < rotorDurabilityMax){
- return true;
- }
- else {
- rotorDurability = 0;
- }
- }
- else {
- Logger.INFO("Damaging Rotor.");
- if (rotorDurability > 1000){
- if (!creativeRotor)
- GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue/2, 0, null);
- long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]);
- if (tempDur < rotorDurabilityMax){
- return true;
- }
- else {
- rotorDurability = 0;
- }
- }
- }
-
-
- }
-
- if (rotorDurability <= 0 && !mSaveRotor && !creativeRotor) {
- Logger.INFO("Destroying Rotor.");
- this.mInventory[this.SLOT_ROTOR] = null;
- return false;
- }
- else if (rotorDurability <= 0 && mSaveRotor) {
- Logger.INFO("Saving Rotor.");
- return false;
- }
-
-
- }else {
- Logger.INFO("Bad Rotor.");
- return false;
- }
- }
- catch (Throwable t){
- t.printStackTrace();
- }
- return false;
- }
-
- public int getFreeSpaces(){
- int mAir = 0;
- IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
- if(aBaseMetaTileEntity.getAirOffset(1, 0, 0)){
- mAir++;
- }
- if(aBaseMetaTileEntity.getAirOffset(-1, 0, 0)){
- mAir++;
- }
- if(aBaseMetaTileEntity.getAirOffset(0, 0, 1)){
- mAir++;
- }
- if(aBaseMetaTileEntity.getAirOffset(0, 0, -1)){
- mAir++;
- }
- if(aBaseMetaTileEntity.getAirOffset(0, 1, 0)){
- mAir++;
- }
- if(aBaseMetaTileEntity.getAirOffset(0, -1, 0)){
- mAir++;
- }
- return mAir;
- }
-
- public boolean removePollution(int toRemove){
-
- if (this == null || this.getBaseMetaTileEntity() == null || this.getBaseMetaTileEntity().getWorld() == null) {
- return false;
- }
-
- if (this.mTier < 7) {
- int startPollution = getCurrentChunkPollution();
- Logger.INFO("Current Chunk Pollution: "+startPollution);
- PollutionUtils.removePollution(this.getBaseMetaTileEntity(), toRemove);
- int after = getCurrentChunkPollution();
- Logger.INFO("Current Chunk Pollution: "+after);
- return (after<startPollution);
- }
- else {
- int chunksWithRemoval = 0;
- int totalRemoved = 0;
- AutoMap<Chunk> aSurrounding = new AutoMap<Chunk>();
- Chunk aThisChunk = this.getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord());
- int mainChunkX = aThisChunk.xPosition;
- int mainChunkZ = aThisChunk.zPosition;
-
- World aWorld = this.getBaseMetaTileEntity().getWorld();
- int xPos = this.getBaseMetaTileEntity().getXCoord();
- int zPos = this.getBaseMetaTileEntity().getZCoord();
-
- Chunk a1 = aWorld.getChunkFromBlockCoords(xPos-32, zPos-32);
- Chunk a2 = aWorld.getChunkFromBlockCoords(xPos-32, zPos);
- Chunk a3 = aWorld.getChunkFromBlockCoords(xPos-32, zPos+32);
- Chunk b1 = aWorld.getChunkFromBlockCoords(xPos, zPos-32);
- Chunk b2 = aWorld.getChunkFromBlockCoords(xPos, zPos);
- Chunk b3 = aWorld.getChunkFromBlockCoords(xPos, zPos+32);
- Chunk c1 = aWorld.getChunkFromBlockCoords(xPos+32, zPos-32);
- Chunk c2 = aWorld.getChunkFromBlockCoords(xPos+32, zPos);
- Chunk c3 = aWorld.getChunkFromBlockCoords(xPos+32, zPos+32);
-
- aSurrounding.put(a1);
- aSurrounding.put(a2);
- aSurrounding.put(a3);
- aSurrounding.put(b1);
- aSurrounding.put(b2);
- aSurrounding.put(b3);
- aSurrounding.put(c1);
- aSurrounding.put(c2);
- aSurrounding.put(c3);
-
- for (Chunk r : aSurrounding) {
- if (!r.isChunkLoaded) {
- continue;
- }
-
- int startPollution = getPollutionInChunk(r);
- if (startPollution == 0) {
- continue;
- }
-
- Logger.INFO("Trying to remove pollution from chunk "+r.xPosition+", "+r.zPosition+" | "+startPollution);
- int after = 0;
- boolean isMainChunk = r.isAtLocation(mainChunkX, mainChunkZ);
-
- int removal = Math.max(0, !isMainChunk ? (toRemove/4) : toRemove);
- if (removePollution(r, removal)) {
- chunksWithRemoval++;
- after = getPollutionInChunk(r);
- }
- else {
- after = 0;
- }
- if (startPollution - after > 0) {
- totalRemoved += (startPollution - after);
- }
- Logger.INFO("Removed "+(startPollution - after)+" pollution from chunk "+r.xPosition+", "+r.zPosition+" | "+after);
- }
- return totalRemoved > 0 && chunksWithRemoval > 0;
- }
- }
-
- public boolean removePollution(Chunk aChunk, int toRemove){
- int before = getCurrentChunkPollution();
- PollutionUtils.removePollution(aChunk, toRemove);
- int after = getCurrentChunkPollution();
- return (after<before);
- }
-
-
- public boolean hasAirFilter(ItemStack filter){
- if (filter == null) {
- return false;
- }
- if (filter.getItem() instanceof ItemAirFilter){
- return true;
- }
- return false;
- }
-
- public boolean damageAirFilter(){
- ItemStack filter = this.mInventory[this.SLOT_FILTER];
- if (filter == null) {
- return false;
- }
-
- boolean creativeRotor = false;
- ItemStack rotorStack = this.mInventory[SLOT_ROTOR];
- if (rotorStack != null) {
- if(rotorStack.getItem() instanceof GT_MetaGenerated_Tool_01) {
- Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(rotorStack);
- Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(rotorStack);
- if (t1 == Materials._NULL && t2 == Materials._NULL){
- creativeRotor = true;
- }
- }
- }
-
- if (creativeRotor) {
- return true;
- }
-
-
- if (filter.getItem() instanceof ItemAirFilter){
-
- long currentUse = ItemAirFilter.getFilterDamage(filter);
-
- //Remove broken Filter
- if (filter.getItemDamage() == 0 && currentUse >= 50-1){
- this.mInventory[this.SLOT_FILTER] = null;
- return false;
- }
- else if (filter.getItemDamage() == 1 && currentUse >= 2500-1){
- this.mInventory[this.SLOT_FILTER] = null;
- return false;
- }
- else {
- //Do Damage
- ItemAirFilter.setFilterDamage(filter, currentUse+1);
- Logger.INFO("Filter Damage: "+currentUse);
- return true;
- }
- }
- return false;
- }
-
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_PollutionCleaner(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_PollutionCleaner(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), this.mGUIName);
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- if (aIndex == SLOT_FILTER) {
- if (aStack.getItem() instanceof ItemAirFilter) {
- Logger.INFO("Inserting Air Filter into "+aIndex);
- return true;
- }
- }
- if (aIndex == SLOT_ROTOR) {
- if (this.mInventory[7] != null) {
- Logger.INFO("Found conveyor, can automate turbines. Inserting into "+aIndex);
- if (aStack.getItem() instanceof ItemBasicScrubberTurbine) {
- return true;
- }
- if (aStack.getItem() instanceof GT_MetaGenerated_Tool && aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 179){
- return true;
- }
- }
- }
- //return super.canInsertItem(aIndex, aStack, aSide);
- return false;
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
-
- public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
- this.mSaveRotor = Utils.invertBoolean(mSaveRotor);
- if (mSaveRotor){
- PlayerUtils.messagePlayer(aPlayer, "Running in low efficiency mode, rotors will not break.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Running in high efficiency mode, rotors will break.");
- }
- return true;
- }
-
- @Override
- public void doSound(byte aIndex, double aX, double aY, double aZ) {
- if (aIndex == -120) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(103)), MathUtils.randInt(5, 50), 0.05F, aX, aY, aZ);
- } else if (aIndex == -121 || aIndex == -122) {
- //GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(108)), 0, 0.5F, aX, aY, aZ);
- } /*else if (aIndex == -122) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(6)), 100, 1.0F, aX, aY, aZ);
- }*/ else {
- super.doSound((byte) 0, aX, aY, aZ);
- }
- }
-
- @Override
- public boolean canHaveInsufficientEnergy() {
- // TODO Auto-generated method stub
- return super.canHaveInsufficientEnergy();
- }
-
- @Override
- public String[] getInfoData() {
- AutoMap<String> aTooltipSuper = new AutoMap<String>();
- for (String s : super.getInfoData()) {
- aTooltipSuper.put(s);
- }
- int mAirSides = getFreeSpaces();
- int reduction = 0;
-
- try {
- long tVoltage = maxEUInput();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- reduction += (((Math.max((tTier-2), 1)*2)*50)*mAirSides);
- reduction = (MathUtils.safeInt((long)reduction*this.mBaseEff)/100000)*mAirSides*Math.max((tTier-2), 1);
- reduction = MathUtils.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
-
- aTooltipSuper.put("Maximum pollution removed per second: "+reduction);
- }
- catch (Throwable t) {
- aTooltipSuper.put("Maximum pollution removed per second: "+mPollutionReduction);
- }
- aTooltipSuper.put("Air Sides: "+mAirSides);
-
- String[] mBuiltOutput = new String[aTooltipSuper.size()];
- int aIndex = 0;
- for (String i : aTooltipSuper) {
- mBuiltOutput[aIndex++] = i;
- }
-
-
-
- return mBuiltOutput;
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
- if (aSide <= 1) {
- return false;
- }
- return super.allowCoverOnSide(aSide, aCoverID);
- }
-
- @Override
- public ITexture[] getTopFacingInactive(byte aColor) {
- return super.getTopFacingInactive(aColor);
- }
-
- @Override
- public void setItemNBT(NBTTagCompound aNBT) {
- aNBT.setInteger("mOptimalAirFlow", this.mOptimalAirFlow);
- aNBT.setBoolean("mSaveRotor", mSaveRotor);
- super.setItemNBT(aNBT);
- }
-
- private static ItemStack[] sGregTurbines;
-
- public static ItemStack getTieredTurbine(int aTier) {
- if (sGregTurbines == null) {
- sGregTurbines = new ItemStack[3];
- sGregTurbines[0] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Iron, Materials.Iron, null);
- sGregTurbines[1] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Bronze, Materials.Bronze, null);
- sGregTurbines[2] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Steel, Materials.Steel, null);
- }
- else {
- return sGregTurbines[aTier];
- }
-
- return null;
- }
-
- public int getBaseEfficiency(ItemStack aStackRotor) {
- if (aStackRotor.getItem() instanceof ItemBasicScrubberTurbine) {
- return getBaseEfficiency(getTieredTurbine(aStackRotor.getItemDamage()));
- }
- return (int) ((50.0F + (10.0F * ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolCombatDamage(aStackRotor))) * 100);
- }
-
- public int getOptimalAirFlow(ItemStack aStackRotor) {
- if (aStackRotor.getItem() instanceof ItemBasicScrubberTurbine) {
- return getOptimalAirFlow(getTieredTurbine(aStackRotor.getItemDamage()));
- }
- return (int) Math.max(Float.MIN_NORMAL, ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolStats(aStackRotor).getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStackRotor).mToolSpeed * 50);
- }
-
-} \ No newline at end of file
+ public int mPollutionReduction = 0;
+ protected int mBaseEff = 2500;
+ protected int mOptimalAirFlow = 0;
+ protected boolean mHasPollution = false;
+ protected int SLOT_ROTOR = 5;
+ protected int SLOT_FILTER = 6;
+ protected static boolean mPollutionEnabled = true;
+
+ protected boolean mSaveRotor = false;
+
+ public GregtechMetaAtmosphericReconditioner(int aID, String aName, String aNameRegional, int aTier) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 2,
+ "Making sure you don't live in Gwalior - Uses 2A",
+ 3,
+ 0,
+ "Recycler.png",
+ "",
+ new ITexture[] {
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)
+ });
+ mPollutionEnabled = PollutionUtils.isPollutionEnabled();
+ }
+
+ public GregtechMetaAtmosphericReconditioner(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName);
+ mPollutionEnabled = PollutionUtils.isPollutionEnabled();
+ }
+
+ /*public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName);
+ }*/
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaAtmosphericReconditioner(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ @Override
+ public String[] getDescription() {
+
+ boolean highTier = this.mTier >= 7;
+
+ String[] A = new String[] {
+ this.mDescription,
+ highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "",
+ highTier ? "If these chunks are not loaded, they will be ignored" : "",
+ "Requires a turbine rotor and an Air Filter [T1/T2] to run.",
+ "The turbine rotor must be manually inserted/replaced",
+ "Can be configured with a soldering iron to change modes",
+ "Low Efficiency: Removes half pollution, Turbine takes 50% dmg",
+ "High Efficiency: Removes full pollution, Turbine takes 100% dmg",
+ "Turbine Rotor will not break in LE mode",
+ "Insert an equal tier Conveyor Module to enable automation"
+ };
+ if (!mPollutionEnabled) {
+ String[] B = new String[] {
+ "===============================================",
+ "Pollution is disabled, scrubbers will now have a bonus use",
+ "They are now able to remove ALL lingering pollution as GT ignores it",
+ "and it will linger forever!",
+ "===============================================",
+ };
+ A = ArrayUtils.addAll(A, B);
+ }
+ return A;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mOptimalAirFlow", this.mOptimalAirFlow);
+ aNBT.setBoolean("mSaveRotor", mSaveRotor);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mOptimalAirFlow = aNBT.getInteger("mOptimalAirFlow");
+ this.mSaveRotor = aNBT.getBoolean("mSaveRotor");
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 2;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return V[mTier] * 2;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * 256;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isServerSide()) {
+
+ // Get Current Pollution Amount.
+ int mCurrentPollution = getCurrentChunkPollution();
+ boolean isIdle = true;
+
+ // Get Inventory Item
+ ItemStack stackRotor = this.mInventory[SLOT_ROTOR];
+ ItemStack stackFilter = this.mInventory[SLOT_FILTER];
+
+ // Power Drain
+ long drainEU = maxEUInput() * maxAmperesIn();
+ if (aBaseMetaTileEntity.isActive() && aBaseMetaTileEntity.getStoredEU() >= drainEU) {
+ if (aBaseMetaTileEntity.decreaseStoredEnergyUnits(drainEU, false)) {
+ isIdle = false;
+ } else {
+ aBaseMetaTileEntity.setActive(false);
+ this.sendSound((byte) -122);
+ }
+ } else if (!aBaseMetaTileEntity.isActive() && aBaseMetaTileEntity.getStoredEU() >= drainEU / 4) {
+ if (aBaseMetaTileEntity.decreaseStoredEnergyUnits((drainEU / 4), false)) {
+ isIdle = false;
+ } else {
+ aBaseMetaTileEntity.setActive(false);
+ this.sendSound((byte) -122);
+ }
+ } else {
+ aBaseMetaTileEntity.setActive(false);
+ this.sendSound((byte) -122);
+ }
+
+ // Only try once/sec.
+ if (!isIdle && aTick % 20L == 0L) {
+
+ for (int i = 0; i < this.mInventory.length; i++) {
+ ItemStack aSlotContent = this.mInventory[i];
+ if (aSlotContent != null) {
+ Logger.INFO("Found " + aSlotContent.getDisplayName() + " in slot " + i);
+ }
+ }
+
+ for (int i = 0; i < this.mInventory.length; i++) {
+ if (hasRotor(this.mInventory[i])) {
+ Logger.INFO("Found Rotor in slot " + i);
+ break;
+ }
+ }
+ for (int i = 0; i < this.mInventory.length; i++) {
+ if (hasAirFilter(this.mInventory[i])) {
+ Logger.INFO("Found Filter in slot " + i);
+ break;
+ }
+ }
+
+ // Check if machine can work.
+ if ((aBaseMetaTileEntity.isAllowedToWork())) {
+ Logger.INFO("Can work.");
+
+ // Enable machine animation/graphic
+ if (hasRotor(stackRotor) && hasAirFilter(stackFilter) && this.mHasPollution) {
+ if (!this.getBaseMetaTileEntity().isActive()) {
+ Logger.INFO("Set Active.");
+ aBaseMetaTileEntity.setActive(true);
+ }
+ } else if (!this.mHasPollution
+ || mCurrentPollution <= 0
+ || stackRotor == null
+ || stackFilter == null
+ || !hasRotor(stackRotor)
+ || !hasAirFilter(stackFilter)) {
+ if (!this.getBaseMetaTileEntity().isActive()) {
+ Logger.INFO("Set Inactive.");
+ aBaseMetaTileEntity.setActive(false);
+ this.sendSound((byte) -122);
+ }
+ }
+
+ // If Active.
+ if (aBaseMetaTileEntity.isActive()) {
+ Logger.INFO("Doing something.");
+
+ // Do nothing if there is no pollution.
+ if (this.mHasPollution && mCurrentPollution > 0) {
+ Logger.INFO(
+ "Has Pollution? " + mHasPollution + ", Current Pollution: " + mCurrentPollution);
+
+ // Only check every 30s.
+ if (!isIdle && aTick % (20L * 30) == 0L) {
+ mPollutionEnabled = PollutionUtils.isPollutionEnabled();
+ // Clear out pollution if it's disabled, because I am a nice gal.
+ if (!PollutionUtils.isPollutionEnabled()) {
+ PollutionUtils.nullifyPollution(this.getBaseMetaTileEntity());
+ }
+ }
+
+ // Use a Turbine
+ if (hasRotor(stackRotor) && hasAirFilter(stackFilter)) {
+ Logger.INFO("Found Turbine.");
+
+ mBaseEff = getBaseEfficiency(stackRotor);
+ mOptimalAirFlow = getOptimalAirFlow(stackRotor);
+
+ // Make sure we have a valid Turbine and Eff/Airflow
+ if (this.mBaseEff > 0 && this.mOptimalAirFlow > 0) {
+ // Utils.LOG_WARNING("Pollution Cleaner [5]");
+
+ // Log Debug information.
+ Logger.INFO("mBaseEff[1]:" + mBaseEff);
+ Logger.INFO("mOptimalAirFlow[1]:" + mOptimalAirFlow);
+
+ // Calculate The Voltage we are running
+ long tVoltage = drainEU;
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ // Check Sides for Air,
+ // More air means more pollution processing.
+ int mAirSides = getFreeSpaces();
+
+ int reduction = 0;
+
+ // If no sides are free, how will you process the atmosphere?
+ if (mAirSides > 0) {
+ reduction += (((Math.max((tTier - 2), 1) * 2) * 50)
+ * mAirSides); // Was originally *100
+ Logger.INFO("mPollutionReduction[1]:" + reduction);
+
+ // I stole this code
+ reduction = (MathUtils.safeInt((long) reduction * this.mBaseEff) / 100000)
+ * mAirSides
+ * Math.max((tTier - 2), 1);
+ Logger.INFO("reduction[2]:" + reduction);
+ reduction = MathUtils.safeInt(((long) reduction / 100) * this.mOptimalAirFlow);
+ Logger.INFO("reduction[3]:" + reduction);
+
+ mPollutionReduction = reduction;
+
+ // Set a temp to remove variable to aleviate duplicate code.
+ int toRemove = 0;
+
+ Logger.INFO("mCurrentPollution[4]:" + mCurrentPollution);
+ Logger.INFO("mCurrentPollution[5]:" + reduction);
+ if (reduction <= mCurrentPollution) {
+ // Clean some Air.
+ toRemove = reduction;
+ } else {
+ // Makes sure we don't get negative pollution.
+ toRemove = mCurrentPollution;
+ }
+
+ toRemove = toRemove / 2;
+ Logger.INFO("mCurrentPollution[6]:" + toRemove);
+
+ // We are good to clean
+ if (toRemove > 0) {
+ if (damageTurbineRotor() && damageAirFilter()) {
+ Logger.INFO("Removing " + toRemove + " pollution");
+ removePollution(mSaveRotor ? (toRemove / 2) : toRemove);
+ Logger.INFO("mNewPollution[4]:" + getCurrentChunkPollution());
+ } else {
+ Logger.INFO("Could not damage turbine rotor or Air Filter.");
+ aBaseMetaTileEntity.setActive(false);
+ }
+ } // End of pollution removal block.
+ } // End of valid air sides block.
+ } // End of valid toolstats block.
+ } // End of correct inventory item block.
+ else {
+ // Utils.LOG_WARNING("Wrong Tool metaitem Found.");
+ }
+ }
+ } else if (!aBaseMetaTileEntity.isActive()) {
+ return;
+ }
+ } // End of can work block.
+ else { // Disable Machine.
+ // aBaseMetaTileEntity.setActive(false);
+ }
+ } // End of 1/sec action block.
+ else {
+
+ if (hasRotor(stackRotor)
+ && hasAirFilter(stackFilter)
+ && this.mHasPollution
+ && !isIdle
+ && aBaseMetaTileEntity.isAllowedToWork()) {
+ aBaseMetaTileEntity.setActive(true);
+ } else if (isIdle
+ || !this.mHasPollution
+ || mCurrentPollution <= 0
+ || stackRotor == null
+ || stackFilter == null
+ || !hasRotor(stackRotor)
+ || !hasAirFilter(stackFilter)) {
+ aBaseMetaTileEntity.setActive(false);
+ }
+ }
+ if (this.getBaseMetaTileEntity().isActive()) {
+ if (MathUtils.randInt(0, 5) <= 2) {
+ this.sendSound((byte) -120);
+ }
+ }
+ } // End of is serverside block.
+ }
+
+ public int getCurrentChunkPollution() {
+ int mCurrentChunkPollution = 0;
+ if (this.mTier < 7) {
+ mCurrentChunkPollution = PollutionUtils.getPollution(getBaseMetaTileEntity());
+ } else {
+ AutoMap<Chunk> aSurrounding = new AutoMap<Chunk>();
+ World aWorld = this.getBaseMetaTileEntity().getWorld();
+ int xPos = this.getBaseMetaTileEntity().getXCoord();
+ int zPos = this.getBaseMetaTileEntity().getZCoord();
+ Chunk a1 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos - 32);
+ Chunk a2 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos);
+ Chunk a3 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos + 32);
+ Chunk b1 = aWorld.getChunkFromBlockCoords(xPos, zPos - 32);
+ Chunk b2 = aWorld.getChunkFromBlockCoords(xPos, zPos);
+ Chunk b3 = aWorld.getChunkFromBlockCoords(xPos, zPos + 32);
+ Chunk c1 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos - 32);
+ Chunk c2 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos);
+ Chunk c3 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos + 32);
+ aSurrounding.put(a1);
+ aSurrounding.put(a2);
+ aSurrounding.put(a3);
+ aSurrounding.put(b1);
+ aSurrounding.put(b2);
+ aSurrounding.put(b3);
+ aSurrounding.put(c1);
+ aSurrounding.put(c2);
+ aSurrounding.put(c3);
+ for (Chunk r : aSurrounding) {
+ mCurrentChunkPollution += getPollutionInChunk(r);
+ }
+ }
+ if (mCurrentChunkPollution > 0) {
+ mHasPollution = true;
+ } else {
+ mHasPollution = false;
+ }
+ return mCurrentChunkPollution;
+ }
+
+ public int getPollutionInChunk(Chunk aChunk) {
+ int mCurrentChunkPollution = PollutionUtils.getPollution(aChunk);
+ if (mCurrentChunkPollution > 0) {
+ mHasPollution = true;
+ } else {
+ mHasPollution = false;
+ }
+ return mCurrentChunkPollution;
+ }
+
+ public boolean hasRotor(ItemStack rotorStack) {
+ if (rotorStack != null) {
+ if (rotorStack.getItem() instanceof ItemBasicScrubberTurbine) {
+ // Logger.INFO("Found Basic Turbine Rotor.");
+ return true;
+ } else if (rotorStack.getItem() instanceof GT_MetaGenerated_Tool
+ && rotorStack.getItemDamage() >= 170
+ && rotorStack.getItemDamage() <= 179) {
+ // Logger.INFO("Found Turbine Rotor.");
+ return true;
+ } else {
+ // Logger.INFO("Found: "+rotorStack.getDisplayName()+":"+rotorStack.getItemDamage());
+ }
+ }
+ // Logger.INFO("Found No Turbine Rotor.");
+ return false;
+ }
+
+ public boolean damageTurbineRotor() {
+ try {
+
+ boolean creativeRotor = false;
+ ItemStack rotorStack = this.mInventory[SLOT_ROTOR];
+ if (rotorStack == null) {
+ return false;
+ } else if (rotorStack.getItem() instanceof ItemBasicScrubberTurbine) {
+ long currentUse = ItemBasicScrubberTurbine.getFilterDamage(rotorStack);
+ // Remove broken Filter
+ if (rotorStack.getItemDamage() == 0 && currentUse >= 2000 - 10) {
+ Logger.INFO("Depleting ItemBasicScrubberTurbine T1");
+ this.mInventory[this.SLOT_FILTER] = null;
+ return false;
+ } else if (rotorStack.getItemDamage() == 1 && currentUse >= 4000 - 10) {
+ Logger.INFO("Depleting ItemBasicScrubberTurbine T2");
+ this.mInventory[this.SLOT_FILTER] = null;
+ return false;
+ } else if (rotorStack.getItemDamage() == 2 && currentUse >= 6000 - 10) {
+ Logger.INFO("Depleting ItemBasicScrubberTurbine T3");
+ this.mInventory[this.SLOT_FILTER] = null;
+ return false;
+ } else {
+ // Do Damage
+ Logger.INFO("Damaging ItemBasicScrubberTurbine");
+ ItemBasicScrubberTurbine.setFilterDamage(rotorStack, currentUse + 10);
+ Logger.INFO("Rotor Damage: " + currentUse);
+ return true;
+ }
+ } else if (rotorStack.getItem() instanceof GT_MetaGenerated_Tool_01) {
+ Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(rotorStack);
+ Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(rotorStack);
+ if (t1 == Materials._NULL && t2 == Materials._NULL) {
+ Logger.INFO("Found creative rotor.");
+ creativeRotor = true;
+ }
+ } else {
+ Logger.INFO("Bad item in rotor slot.");
+ return false;
+ }
+
+ if (mInventory[SLOT_ROTOR].getItem() instanceof GT_MetaGenerated_Tool_01
+ && ((GT_MetaGenerated_Tool) mInventory[SLOT_ROTOR].getItem())
+ .getToolStats(mInventory[SLOT_ROTOR])
+ .getSpeedMultiplier()
+ > 0
+ && GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[SLOT_ROTOR]).mToolSpeed > 0) {
+
+ long damageValue = (long)
+ Math.floor(Math.abs(MathUtils.randFloat(1, 2) - MathUtils.randFloat(1, 3)) * (1 + 3 - 1) + 1);
+ double fDam = Math.floor(
+ Math.abs(MathUtils.randFloat(1f, 2f) - MathUtils.randFloat(1f, 2f)) * (1f + 2f - 1f) + 1f);
+ damageValue -= fDam;
+
+ // Logger.INFO("Trying to do "+damageValue+" damage to the rotor. ["+fDam+"]");
+ /*Materials M1 = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[this.SLOT_ROTOR]);
+ Materials M2 = GT_MetaGenerated_Tool.getSecondaryMaterial(this.mInventory[this.SLOT_ROTOR]);
+
+ Logger.INFO("Trying to do "+damageValue+" damage to the rotor. [2]");*/
+
+ // Damage Rotor
+ // int rotorDurability = this.mInventory[this.SLOT_ROTOR].getItemDamage();
+ long rotorDamage =
+ creativeRotor ? 0 : GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]);
+ long rotorDurabilityMax = creativeRotor
+ ? Integer.MAX_VALUE
+ : GT_MetaGenerated_Tool.getToolMaxDamage(this.mInventory[this.SLOT_ROTOR]);
+ long rotorDurability = (rotorDurabilityMax - rotorDamage);
+ Logger.INFO("Rotor Damage: " + rotorDamage + " | Max Durability: " + rotorDurabilityMax + " | "
+ + " Remaining Durability: " + rotorDurability);
+ if (rotorDurability >= damageValue) {
+
+ if (!mSaveRotor) {
+ Logger.INFO("Damaging Rotor.");
+
+ if (!creativeRotor)
+ GT_ModHandler.damageOrDechargeItem(
+ this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null);
+
+ long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]);
+ if (tempDur < rotorDurabilityMax) {
+ return true;
+ } else {
+ rotorDurability = 0;
+ }
+ } else {
+ Logger.INFO("Damaging Rotor.");
+ if (rotorDurability > 1000) {
+ if (!creativeRotor)
+ GT_ModHandler.damageOrDechargeItem(
+ this.mInventory[this.SLOT_ROTOR], (int) damageValue / 2, 0, null);
+ long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]);
+ if (tempDur < rotorDurabilityMax) {
+ return true;
+ } else {
+ rotorDurability = 0;
+ }
+ }
+ }
+ }
+
+ if (rotorDurability <= 0 && !mSaveRotor && !creativeRotor) {
+ Logger.INFO("Destroying Rotor.");
+ this.mInventory[this.SLOT_ROTOR] = null;
+ return false;
+ } else if (rotorDurability <= 0 && mSaveRotor) {
+ Logger.INFO("Saving Rotor.");
+ return false;
+ }
+
+ } else {
+ Logger.INFO("Bad Rotor.");
+ return false;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ return false;
+ }
+
+ public int getFreeSpaces() {
+ int mAir = 0;
+ IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
+ if (aBaseMetaTileEntity.getAirOffset(1, 0, 0)) {
+ mAir++;
+ }
+ if (aBaseMetaTileEntity.getAirOffset(-1, 0, 0)) {
+ mAir++;
+ }
+ if (aBaseMetaTileEntity.getAirOffset(0, 0, 1)) {
+ mAir++;
+ }
+ if (aBaseMetaTileEntity.getAirOffset(0, 0, -1)) {
+ mAir++;
+ }
+ if (aBaseMetaTileEntity.getAirOffset(0, 1, 0)) {
+ mAir++;
+ }
+ if (aBaseMetaTileEntity.getAirOffset(0, -1, 0)) {
+ mAir++;
+ }
+ return mAir;
+ }
+
+ public boolean removePollution(int toRemove) {
+
+ if (this == null
+ || this.getBaseMetaTileEntity() == null
+ || this.getBaseMetaTileEntity().getWorld() == null) {
+ return false;
+ }
+
+ if (this.mTier < 7) {
+ int startPollution = getCurrentChunkPollution();
+ Logger.INFO("Current Chunk Pollution: " + startPollution);
+ PollutionUtils.removePollution(this.getBaseMetaTileEntity(), toRemove);
+ int after = getCurrentChunkPollution();
+ Logger.INFO("Current Chunk Pollution: " + after);
+ return (after < startPollution);
+ } else {
+ int chunksWithRemoval = 0;
+ int totalRemoved = 0;
+ AutoMap<Chunk> aSurrounding = new AutoMap<Chunk>();
+ Chunk aThisChunk = this.getBaseMetaTileEntity()
+ .getWorld()
+ .getChunkFromBlockCoords(
+ this.getBaseMetaTileEntity().getXCoord(),
+ this.getBaseMetaTileEntity().getZCoord());
+ int mainChunkX = aThisChunk.xPosition;
+ int mainChunkZ = aThisChunk.zPosition;
+
+ World aWorld = this.getBaseMetaTileEntity().getWorld();
+ int xPos = this.getBaseMetaTileEntity().getXCoord();
+ int zPos = this.getBaseMetaTileEntity().getZCoord();
+
+ Chunk a1 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos - 32);
+ Chunk a2 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos);
+ Chunk a3 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos + 32);
+ Chunk b1 = aWorld.getChunkFromBlockCoords(xPos, zPos - 32);
+ Chunk b2 = aWorld.getChunkFromBlockCoords(xPos, zPos);
+ Chunk b3 = aWorld.getChunkFromBlockCoords(xPos, zPos + 32);
+ Chunk c1 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos - 32);
+ Chunk c2 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos);
+ Chunk c3 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos + 32);
+
+ aSurrounding.put(a1);
+ aSurrounding.put(a2);
+ aSurrounding.put(a3);
+ aSurrounding.put(b1);
+ aSurrounding.put(b2);
+ aSurrounding.put(b3);
+ aSurrounding.put(c1);
+ aSurrounding.put(c2);
+ aSurrounding.put(c3);
+
+ for (Chunk r : aSurrounding) {
+ if (!r.isChunkLoaded) {
+ continue;
+ }
+
+ int startPollution = getPollutionInChunk(r);
+ if (startPollution == 0) {
+ continue;
+ }
+
+ Logger.INFO("Trying to remove pollution from chunk " + r.xPosition + ", " + r.zPosition + " | "
+ + startPollution);
+ int after = 0;
+ boolean isMainChunk = r.isAtLocation(mainChunkX, mainChunkZ);
+
+ int removal = Math.max(0, !isMainChunk ? (toRemove / 4) : toRemove);
+ if (removePollution(r, removal)) {
+ chunksWithRemoval++;
+ after = getPollutionInChunk(r);
+ } else {
+ after = 0;
+ }
+ if (startPollution - after > 0) {
+ totalRemoved += (startPollution - after);
+ }
+ Logger.INFO("Removed " + (startPollution - after) + " pollution from chunk " + r.xPosition + ", "
+ + r.zPosition + " | " + after);
+ }
+ return totalRemoved > 0 && chunksWithRemoval > 0;
+ }
+ }
+
+ public boolean removePollution(Chunk aChunk, int toRemove) {
+ int before = getCurrentChunkPollution();
+ PollutionUtils.removePollution(aChunk, toRemove);
+ int after = getCurrentChunkPollution();
+ return (after < before);
+ }
+
+ public boolean hasAirFilter(ItemStack filter) {
+ if (filter == null) {
+ return false;
+ }
+ if (filter.getItem() instanceof ItemAirFilter) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean damageAirFilter() {
+ ItemStack filter = this.mInventory[this.SLOT_FILTER];
+ if (filter == null) {
+ return false;
+ }
+
+ boolean creativeRotor = false;
+ ItemStack rotorStack = this.mInventory[SLOT_ROTOR];
+ if (rotorStack != null) {
+ if (rotorStack.getItem() instanceof GT_MetaGenerated_Tool_01) {
+ Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(rotorStack);
+ Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(rotorStack);
+ if (t1 == Materials._NULL && t2 == Materials._NULL) {
+ creativeRotor = true;
+ }
+ }
+ }
+
+ if (creativeRotor) {
+ return true;
+ }
+
+ if (filter.getItem() instanceof ItemAirFilter) {
+
+ long currentUse = ItemAirFilter.getFilterDamage(filter);
+
+ // Remove broken Filter
+ if (filter.getItemDamage() == 0 && currentUse >= 50 - 1) {
+ this.mInventory[this.SLOT_FILTER] = null;
+ return false;
+ } else if (filter.getItemDamage() == 1 && currentUse >= 2500 - 1) {
+ this.mInventory[this.SLOT_FILTER] = null;
+ return false;
+ } else {
+ // Do Damage
+ ItemAirFilter.setFilterDamage(filter, currentUse + 1);
+ Logger.INFO("Filter Damage: " + currentUse);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_PollutionCleaner(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_PollutionCleaner(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), this.mGUIName);
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ if (aIndex == SLOT_FILTER) {
+ if (aStack.getItem() instanceof ItemAirFilter) {
+ Logger.INFO("Inserting Air Filter into " + aIndex);
+ return true;
+ }
+ }
+ if (aIndex == SLOT_ROTOR) {
+ if (this.mInventory[7] != null) {
+ Logger.INFO("Found conveyor, can automate turbines. Inserting into " + aIndex);
+ if (aStack.getItem() instanceof ItemBasicScrubberTurbine) {
+ return true;
+ }
+ if (aStack.getItem() instanceof GT_MetaGenerated_Tool
+ && aStack.getItemDamage() >= 170
+ && aStack.getItemDamage() <= 179) {
+ return true;
+ }
+ }
+ }
+ // return super.canInsertItem(aIndex, aStack, aSide);
+ return false;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+
+ public boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ this.mSaveRotor = Utils.invertBoolean(mSaveRotor);
+ if (mSaveRotor) {
+ PlayerUtils.messagePlayer(aPlayer, "Running in low efficiency mode, rotors will not break.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Running in high efficiency mode, rotors will break.");
+ }
+ return true;
+ }
+
+ @Override
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ if (aIndex == -120) {
+ GT_Utility.doSoundAtClient(
+ (String) GregTech_API.sSoundList.get(Integer.valueOf(103)),
+ MathUtils.randInt(5, 50),
+ 0.05F,
+ aX,
+ aY,
+ aZ);
+ } else if (aIndex == -121 || aIndex == -122) {
+ // GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(108)), 0, 0.5F, aX, aY,
+ // aZ);
+ } /*else if (aIndex == -122) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(6)), 100, 1.0F, aX, aY, aZ);
+ }*/ else {
+ super.doSound((byte) 0, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public boolean canHaveInsufficientEnergy() {
+ // TODO Auto-generated method stub
+ return super.canHaveInsufficientEnergy();
+ }
+
+ @Override
+ public String[] getInfoData() {
+ AutoMap<String> aTooltipSuper = new AutoMap<String>();
+ for (String s : super.getInfoData()) {
+ aTooltipSuper.put(s);
+ }
+ int mAirSides = getFreeSpaces();
+ int reduction = 0;
+
+ try {
+ long tVoltage = maxEUInput();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ reduction += (((Math.max((tTier - 2), 1) * 2) * 50) * mAirSides);
+ reduction = (MathUtils.safeInt((long) reduction * this.mBaseEff) / 100000)
+ * mAirSides
+ * Math.max((tTier - 2), 1);
+ reduction = MathUtils.safeInt(((long) reduction / 100) * this.mOptimalAirFlow);
+
+ aTooltipSuper.put("Maximum pollution removed per second: " + reduction);
+ } catch (Throwable t) {
+ aTooltipSuper.put("Maximum pollution removed per second: " + mPollutionReduction);
+ }
+ aTooltipSuper.put("Air Sides: " + mAirSides);
+
+ String[] mBuiltOutput = new String[aTooltipSuper.size()];
+ int aIndex = 0;
+ for (String i : aTooltipSuper) {
+ mBuiltOutput[aIndex++] = i;
+ }
+
+ return mBuiltOutput;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ if (aSide <= 1) {
+ return false;
+ }
+ return super.allowCoverOnSide(aSide, aCoverID);
+ }
+
+ @Override
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return super.getTopFacingInactive(aColor);
+ }
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ aNBT.setInteger("mOptimalAirFlow", this.mOptimalAirFlow);
+ aNBT.setBoolean("mSaveRotor", mSaveRotor);
+ super.setItemNBT(aNBT);
+ }
+
+ private static ItemStack[] sGregTurbines;
+
+ public static ItemStack getTieredTurbine(int aTier) {
+ if (sGregTurbines == null) {
+ sGregTurbines = new ItemStack[3];
+ sGregTurbines[0] = GT_MetaGenerated_Tool.sInstances
+ .get("gt.metatool.01")
+ .getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Iron, Materials.Iron, null);
+ sGregTurbines[1] = GT_MetaGenerated_Tool.sInstances
+ .get("gt.metatool.01")
+ .getToolWithStats(
+ GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Bronze, Materials.Bronze, null);
+ sGregTurbines[2] = GT_MetaGenerated_Tool.sInstances
+ .get("gt.metatool.01")
+ .getToolWithStats(
+ GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Steel, Materials.Steel, null);
+ } else {
+ return sGregTurbines[aTier];
+ }
+
+ return null;
+ }
+
+ public int getBaseEfficiency(ItemStack aStackRotor) {
+ if (aStackRotor.getItem() instanceof ItemBasicScrubberTurbine) {
+ return getBaseEfficiency(getTieredTurbine(aStackRotor.getItemDamage()));
+ }
+ return (int)
+ ((50.0F + (10.0F * ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolCombatDamage(aStackRotor)))
+ * 100);
+ }
+
+ public int getOptimalAirFlow(ItemStack aStackRotor) {
+ if (aStackRotor.getItem() instanceof ItemBasicScrubberTurbine) {
+ return getOptimalAirFlow(getTieredTurbine(aStackRotor.getItemDamage()));
+ }
+ return (int) Math.max(
+ Float.MIN_NORMAL,
+ ((GT_MetaGenerated_Tool) aStackRotor.getItem())
+ .getToolStats(aStackRotor)
+ .getSpeedMultiplier()
+ * GT_MetaGenerated_Tool.getPrimaryMaterial(aStackRotor).mToolSpeed
+ * 50);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java
index 0f7edd062d..531c7c5694 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -9,166 +7,174 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SteamCondenser;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_SteamCondenser;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechMetaBoilerBase;
+import net.minecraft.entity.player.InventoryPlayer;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
-public class GregtechMetaCondensor extends GregtechMetaBoilerBase{
+public class GregtechMetaCondensor extends GregtechMetaBoilerBase {
- public GregtechMetaCondensor(final int aID, final String aName, final String aNameRegional)
- {
- super(aID, aName, aNameRegional, "A Steam condenser - [IC2->Steam]", new ITexture[0]);
- }
+ public GregtechMetaCondensor(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional, "A Steam condenser - [IC2->Steam]", new ITexture[0]);
+ }
- public GregtechMetaCondensor(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- }
+ public GregtechMetaCondensor(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
- @Override
- public String[] getDescription() {
- return new String[]{this.mDescription, "IC2 Steam + Water = Normal Steam.", "Requires no power to run, although it's not very fast.", CORE.GT_Tooltip};
- }
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "IC2 Steam + Water = Normal Steam.",
+ "Requires no power to run, although it's not very fast.",
+ CORE.GT_Tooltip
+ };
+ }
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures)
- {
- final 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_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa))};
- rTextures[1][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
- rTextures[2][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
- rTextures[3][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER) };
- rTextures[4][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE) };
- }
- return rTextures;
- }
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final 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_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa))
+ };
+ rTextures[1][(i + 1)] = new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)
+ };
+ rTextures[2][(i + 1)] = new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)
+ };
+ rTextures[3][(i + 1)] = new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER)
+ };
+ rTextures[4][(i + 1)] = new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE)
+ };
+ }
+ return rTextures;
+ }
- @Override
- public int maxProgresstime()
- {
- return 1000;
- }
+ @Override
+ public int maxProgresstime() {
+ return 1000;
+ }
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new CONTAINER_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity);
- }
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity);
+ }
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GUI_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png");
- }
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png");
+ }
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity)
- {
- return new GregtechMetaCondensor(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaCondensor(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick)
- {
- this.RI = MathUtils.randLong(5L, 30L);
- if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
- {
- if (this.mTemperature <= 5)
- {
- this.mTemperature = 5;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 10)
- {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
- if (i != aBaseMetaTileEntity.getFrontFacing())
- {
- final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null)
- {
- final FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null)
- {
- final 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 > 5)
- {
- 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(30L);
- } else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += 30;
- } else {
- this.mSteam = GT_ModHandler.getSteam(30L);
- }
- }
- }
- else {
- this.mHadNoWater = false;
- }
- }
- if ((this.mSteam != null) &&
- (this.mSteam.amount > getSteamCapacity()))
- {
- this.sendSound((byte)1);
- this.mSteam.amount = getSteamCapacity() * 3 / 4;
- }
- /*if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
- (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(IC2.getItemFromBlock(p_150898_0_)))))
- {
- this.mProcessingEnergy += 1000;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L));
- }*/
- if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && ((aTick % this.RI) == 0L))
- {
- this.mProcessingEnergy -= 40;
- this.mTemperature += 2;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
- }
- }
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ this.RI = MathUtils.randLong(5L, 30L);
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
+ if (this.mTemperature <= 5) {
+ this.mTemperature = 5;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 10) {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
+ }
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing()) {
+ final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null) {
+ final FluidStack tDrained = aBaseMetaTileEntity.drain(
+ ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null) {
+ final 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 > 5) {
+ 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(30L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 30;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(30L);
+ }
+ }
+ } else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) && (this.mSteam.amount > getSteamCapacity())) {
+ this.sendSound((byte) 1);
+ this.mSteam.amount = getSteamCapacity() * 3 / 4;
+ }
+ /*if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(IC2.getItemFromBlock(p_150898_0_)))))
+ {
+ this.mProcessingEnergy += 1000;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L));
+ }*/
+ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && ((aTick % this.RI) == 0L)) {
+ this.mProcessingEnergy -= 40;
+ this.mTemperature += 2;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
+ }
+ }
- @Override
- public final int fill(final FluidStack aFluid, final boolean doFill)
- {
- if ((Utils.isIC2Steam(aFluid)) && (this.mProcessingEnergy < 50))
- {
- final int tFilledAmount = Math.min(50, aFluid.amount);
- if (doFill) {
- this.mProcessingEnergy += tFilledAmount;
- }
- return tFilledAmount;
- }
- return super.fill(aFluid, doFill);
- }
+ @Override
+ public final int fill(final FluidStack aFluid, final boolean doFill) {
+ if ((Utils.isIC2Steam(aFluid)) && (this.mProcessingEnergy < 50)) {
+ final int tFilledAmount = Math.min(50, aFluid.amount);
+ if (doFill) {
+ this.mProcessingEnergy += tFilledAmount;
+ }
+ return tFilledAmount;
+ }
+ return super.fill(aFluid, doFill);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java
index 88658c399d..f1e0cc7161 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java
@@ -18,306 +18,402 @@ import net.minecraft.world.World;
public class GregtechMetaGarbageCollector extends GregtechMetaTileEntity {
- long mLastCleanup = 0;
- long mLocalTickVar = 0;
- int mFrequency = 5;
-
- public GregtechMetaGarbageCollector(final String aName, final String aNameRegional, final String aDescription) {
- super(991, aName, aNameRegional, 5, 0, aDescription);
- }
-
- public GregtechMetaGarbageCollector(final String aName, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, 5, 0, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {this.mDescription,
- "Can request the JVM to perform garbage collection",
- "Configurable to run once every 5 minute interval (5-180)",
- "This Machine has no recipe",
- "Admin Tool, Limit one per world if possible",
- CORE.GT_Tooltip};
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
- }
-
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
- }
-
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)};
- }
-
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)};
- }
-
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3)};
- }
-
-
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
- }
-
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
- }
-
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)};
- }
-
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)};
- }
-
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3)};
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (mFrequency < 180){
- mFrequency += 5;
- }
- else {
- mFrequency = 5;
- }
- PlayerUtils.messagePlayer(aPlayer, "Running every "+mFrequency+" minutes.");
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaGarbageCollector(this.mName, this.mDescription, this.mTextures);
- }
-
- @Override public boolean isSimpleMachine() {return true;}
- @Override public boolean isElectric() {return false;}
- @Override public boolean isValidSlot(final int aIndex) {return false;}
- @Override public boolean isFacingValid(final byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return false;}
- @Override public boolean isEnetOutput() {return false;}
- @Override public boolean isInputFacing(final byte aSide) {return aSide!=this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isOutputFacing(final byte aSide) {return aSide==this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return 0;}
- @Override public long maxEUStore() {return 0;}
-
- @Override
- public int getCapacity() {
- return 0;
- }
-
- @Override
- public long maxEUInput() {
- return 0;
- }
-
- @Override
- public long maxEUOutput() {
- return 0;
- }
-
- @Override
- public long maxAmperesIn() {
- return 0;
- }
-
- @Override
- public long maxAmperesOut() {
- return 0;
- }
- @Override public int rechargerSlotStartIndex() {return 0;}
- @Override public int dechargerSlotStartIndex() {return 0;}
- @Override public int rechargerSlotCount() {return 0;}
- @Override public int dechargerSlotCount() {return 0;}
- @Override public int getProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyStored();}
- @Override public int maxProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyCapacity();}
- @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;}
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide())
- {
- return true;
- }
- this.showPollution(aPlayer.getEntityWorld(), aPlayer);
- return true;
- }
-
- private void showPollution(final World worldIn, final EntityPlayer playerIn){
- PlayerUtils.messagePlayer(playerIn, "Running every "+mFrequency+" minutes. Owner: "+this.getBaseMetaTileEntity().getOwnerName());
- long aDiff = mLocalTickVar - this.mLastCleanup;
- PlayerUtils.messagePlayer(playerIn, "Last run: "+Utils.getSecondsFromMillis(aDiff)+" seconds ago.");
-
-
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
-
- @Override
- public String[] getInfoData() {
- return new String[] {
- this.getLocalName()
- };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- return new int[] {};
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(final int p_70301_1_) {
- return null;
- }
-
- @Override
- public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
- return null;
- }
-
- @Override
- public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {
- }
-
- @Override
- public String getInventoryName() {
- return null;
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 0;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
- return true;
- }
-
- @Override
- public void openInventory() {
- }
-
- @Override
- public void closeInventory() {
- }
-
- @Override
- public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
- return false;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
-
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
-
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (this.getBaseMetaTileEntity().isServerSide()) {
- mLocalTickVar = System.currentTimeMillis();
- long aDiff = mLocalTickVar - this.mLastCleanup;
- if (Utils.getSecondsFromMillis(aDiff) >= (this.mFrequency * 60)) {
- CORE.gc();
- this.mLastCleanup = mLocalTickVar;
- }
- }
- }
-
-} \ No newline at end of file
+ long mLastCleanup = 0;
+ long mLocalTickVar = 0;
+ int mFrequency = 5;
+
+ public GregtechMetaGarbageCollector(final String aName, final String aNameRegional, final String aDescription) {
+ super(991, aName, aNameRegional, 5, 0, aDescription);
+ }
+
+ public GregtechMetaGarbageCollector(final String aName, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 5, 0, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Can request the JVM to perform garbage collection",
+ "Configurable to run once every 5 minute interval (5-180)",
+ "This Machine has no recipe",
+ "Admin Tool, Limit one per world if possible",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3)
+ };
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)
+ };
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)
+ };
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3)
+ };
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (mFrequency < 180) {
+ mFrequency += 5;
+ } else {
+ mFrequency = 5;
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Running every " + mFrequency + " minutes.");
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaGarbageCollector(this.mName, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 0;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored();
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ this.showPollution(aPlayer.getEntityWorld(), aPlayer);
+ return true;
+ }
+
+ private void showPollution(final World worldIn, final EntityPlayer playerIn) {
+ PlayerUtils.messagePlayer(
+ playerIn,
+ "Running every " + mFrequency + " minutes. Owner: "
+ + this.getBaseMetaTileEntity().getOwnerName());
+ long aDiff = mLocalTickVar - this.mLastCleanup;
+ PlayerUtils.messagePlayer(playerIn, "Last run: " + Utils.getSecondsFromMillis(aDiff) + " seconds ago.");
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[] {this.getLocalName()};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ return new int[] {};
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int p_70301_1_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {}
+
+ @Override
+ public String getInventoryName() {
+ return null;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 0;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
+ return true;
+ }
+
+ @Override
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {}
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {}
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ mLocalTickVar = System.currentTimeMillis();
+ long aDiff = mLocalTickVar - this.mLastCleanup;
+ if (Utils.getSecondsFromMillis(aDiff) >= (this.mFrequency * 60)) {
+ CORE.gc();
+ this.mLastCleanup = mLocalTickVar;
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java
index 65217f9e53..ce04d50fab 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java
@@ -18,365 +18,476 @@ import net.minecraft.world.World;
public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity {
- int mCurrentPollution;
- int mAveragePollution;
- int mAveragePollutionArray[] = new int[10];
- private int mArrayPos = 0;
- private int mTickTimer = 0;
- private int mSecondTimer = 0;
-
- public GregtechMetaPollutionCreator(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
- }
-
- public GregtechMetaPollutionCreator(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
- super(aName, aTier, aSlotCount, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {this.mDescription, "A useful debug machine to create pollution.", CORE.GT_Tooltip};
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)};
- }
-
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)};
- }
-
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (pollutionMultiplier > 99){
- pollutionMultiplier = 1;
- }
- else {
- pollutionMultiplier++;
- }
- PlayerUtils.messagePlayer(aPlayer, "Pollution Mutliplier is now "+pollutionMultiplier+".");
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPollutionCreator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
- }
-
- @Override public boolean isSimpleMachine() {return false;}
- @Override public boolean isElectric() {return true;}
- @Override public boolean isValidSlot(final int aIndex) {return true;}
- @Override public boolean isFacingValid(final byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return true;}
- @Override public boolean isEnetOutput() {return false;}
- @Override public boolean isInputFacing(final byte aSide) {return aSide!=this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isOutputFacing(final byte aSide) {return aSide==this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return 0;}
- @Override public long maxEUStore() {return 0;}
-
- @Override
- public int getCapacity() {
- return 0;
- }
-
- @Override
- public long maxEUInput() {
- return 0;
- }
-
- @Override
- public long maxEUOutput() {
- return 0;
- }
-
- @Override
- public long maxAmperesIn() {
- return 0;
- }
-
- @Override
- public long maxAmperesOut() {
- return 0;
- }
- @Override public int rechargerSlotStartIndex() {return 0;}
- @Override public int dechargerSlotStartIndex() {return 0;}
- @Override public int rechargerSlotCount() {return 0;}
- @Override public int dechargerSlotCount() {return 0;}
- @Override public int getProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyStored();}
- @Override public int maxProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyCapacity();}
- @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;}
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide())
- {
- return true;
- }
- this.showPollution(aPlayer.getEntityWorld(), aPlayer);
- return true;
- }
-
- public int pollutionMultiplier = 1;
-
- private void showPollution(final World worldIn, final EntityPlayer playerIn){
- if(!PollutionUtils.isPollutionEnabled()){
- PlayerUtils.messagePlayer(playerIn, "This block is useless, Pollution is disabled.");
- }
- else {
- addPollution();
- PlayerUtils.messagePlayer(playerIn, "This chunk now contains "+getCurrentChunkPollution()+" pollution.");
- //PlayerUtils.messagePlayer(playerIn, "Average over last ten minutes: "+getAveragePollutionOverLastTen()+" pollution.");
- }
- }
-
- private boolean addPollution(){
- PollutionUtils.addPollution(getBaseMetaTileEntity(), 100000*pollutionMultiplier);
- return true;
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- public int getCurrentChunkPollution(){
- return getCurrentChunkPollution(this.getBaseMetaTileEntity());
- }
-
- public int getCurrentChunkPollution(IGregTechTileEntity aBaseMetaTileEntity){
- return PollutionUtils.getPollution(aBaseMetaTileEntity);
- }
-
-
- @Override
- public String[] getInfoData() {
- return new String[] {
- this.getLocalName(),
- "Current Pollution: "+this.mCurrentPollution,
- "Average/10 minutes:"+getAveragePollutionOverLastTen()};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- return new int[] {};
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(final int p_70301_1_) {
- return null;
- }
-
- @Override
- public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
- return null;
- }
-
- @Override
- public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {
- }
-
- @Override
- public String getInventoryName() {
- return null;
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 0;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
- return false;
- }
-
- @Override
- public void openInventory() {
- }
-
- @Override
- public void closeInventory() {
- }
-
- @Override
- public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
- return false;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- //int mCurrentPollution;
- //int mAveragePollution;
- //int mAveragePollutionArray[] = new int[10];
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mCurrentPollution", this.mCurrentPollution);
- aNBT.setInteger("mAveragePollution", this.mAveragePollution);
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mCurrentPollution = aNBT.getInteger("mCurrentPollution");
- this.mAveragePollution = aNBT.getInteger("mAveragePollution");
- }
-
- @Override
- public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
- if (this.getBaseMetaTileEntity().isServerSide()) {
- if (this.mCurrentPollution == 0) {
- this.mCurrentPollution = getCurrentChunkPollution();
- }
- if (this.mArrayPos < 0 || this.mArrayPos > 9) {
- this.mArrayPos = 0;
- }
- this.mTickTimer = 0;
- }
- }
-
-
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (this.getBaseMetaTileEntity().isServerSide()) {
- //TickTimer - 20 times a second
- this.mTickTimer++;
- if (mTickTimer % 20 == 0){
- this.mCurrentPollution = getCurrentChunkPollution();
- }
- }
- }
-
- public int getAveragePollutionOverLastTen(){
- int counter = 0;
- int total = 0;
-
- for (int i=0;i<this.mAveragePollutionArray.length;i++){
- if (this.mAveragePollutionArray[i] != 0){
- total += this.mAveragePollutionArray[i];
- counter++;
- }
- }
- int returnValue = 0;
- if (total > 0 && counter > 0){
- returnValue = (total/counter);
- this.mAveragePollution = returnValue;
- }
- else {
- returnValue = getCurrentChunkPollution();
- }
- //Logger.INFO("| DEBUG: "+returnValue +" | ArrayPos:"+this.mArrayPos+" | Counter:"+counter+" | Total:"+total+" |");
- return returnValue;
- }
-
-} \ No newline at end of file
+ int mCurrentPollution;
+ int mAveragePollution;
+ int mAveragePollutionArray[] = new int[10];
+ private int mArrayPos = 0;
+ private int mTickTimer = 0;
+ private int mSecondTimer = 0;
+
+ public GregtechMetaPollutionCreator(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
+ }
+
+ public GregtechMetaPollutionCreator(
+ final String aName,
+ final int aTier,
+ final String aDescription,
+ final ITexture[][][] aTextures,
+ final int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, "A useful debug machine to create pollution.", CORE.GT_Tooltip};
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (pollutionMultiplier > 99) {
+ pollutionMultiplier = 1;
+ } else {
+ pollutionMultiplier++;
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Pollution Mutliplier is now " + pollutionMultiplier + ".");
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPollutionCreator(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 0;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored();
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ this.showPollution(aPlayer.getEntityWorld(), aPlayer);
+ return true;
+ }
+
+ public int pollutionMultiplier = 1;
+
+ private void showPollution(final World worldIn, final EntityPlayer playerIn) {
+ if (!PollutionUtils.isPollutionEnabled()) {
+ PlayerUtils.messagePlayer(playerIn, "This block is useless, Pollution is disabled.");
+ } else {
+ addPollution();
+ PlayerUtils.messagePlayer(
+ playerIn, "This chunk now contains " + getCurrentChunkPollution() + " pollution.");
+ // PlayerUtils.messagePlayer(playerIn, "Average over last ten minutes: "+getAveragePollutionOverLastTen()+"
+ // pollution.");
+ }
+ }
+
+ private boolean addPollution() {
+ PollutionUtils.addPollution(getBaseMetaTileEntity(), 100000 * pollutionMultiplier);
+ return true;
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ public int getCurrentChunkPollution() {
+ return getCurrentChunkPollution(this.getBaseMetaTileEntity());
+ }
+
+ public int getCurrentChunkPollution(IGregTechTileEntity aBaseMetaTileEntity) {
+ return PollutionUtils.getPollution(aBaseMetaTileEntity);
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[] {
+ this.getLocalName(),
+ "Current Pollution: " + this.mCurrentPollution,
+ "Average/10 minutes:" + getAveragePollutionOverLastTen()
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ return new int[] {};
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int p_70301_1_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {}
+
+ @Override
+ public String getInventoryName() {
+ return null;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 0;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
+ return false;
+ }
+
+ @Override
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ // int mCurrentPollution;
+ // int mAveragePollution;
+ // int mAveragePollutionArray[] = new int[10];
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setInteger("mCurrentPollution", this.mCurrentPollution);
+ aNBT.setInteger("mAveragePollution", this.mAveragePollution);
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mCurrentPollution = aNBT.getInteger("mCurrentPollution");
+ this.mAveragePollution = aNBT.getInteger("mAveragePollution");
+ }
+
+ @Override
+ public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ if (this.mCurrentPollution == 0) {
+ this.mCurrentPollution = getCurrentChunkPollution();
+ }
+ if (this.mArrayPos < 0 || this.mArrayPos > 9) {
+ this.mArrayPos = 0;
+ }
+ this.mTickTimer = 0;
+ }
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ // TickTimer - 20 times a second
+ this.mTickTimer++;
+ if (mTickTimer % 20 == 0) {
+ this.mCurrentPollution = getCurrentChunkPollution();
+ }
+ }
+ }
+
+ public int getAveragePollutionOverLastTen() {
+ int counter = 0;
+ int total = 0;
+
+ for (int i = 0; i < this.mAveragePollutionArray.length; i++) {
+ if (this.mAveragePollutionArray[i] != 0) {
+ total += this.mAveragePollutionArray[i];
+ counter++;
+ }
+ }
+ int returnValue = 0;
+ if (total > 0 && counter > 0) {
+ returnValue = (total / counter);
+ this.mAveragePollution = returnValue;
+ } else {
+ returnValue = getCurrentChunkPollution();
+ }
+ // Logger.INFO("| DEBUG: "+returnValue +" | ArrayPos:"+this.mArrayPos+" | Counter:"+counter+" | Total:"+total+"
+ // |");
+ return returnValue;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java
index 69a4f96708..9ba3db911a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java
@@ -19,417 +19,524 @@ import net.minecraft.world.World;
public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity {
- int mCurrentPollution;
- int mAveragePollution;
- int mAveragePollutionArray[] = new int[10];
- private int mArrayPos = 0;
- private int mTickTimer = 0;
- private int mSecondTimer = 0;
- private long mRedstoneLevel = 0;
-
- public GregtechMetaPollutionDetector(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
- }
-
- public GregtechMetaPollutionDetector(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
- super(aName, aTier, aSlotCount, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {this.mDescription, "Right click to check pollution levels.",
- "Configure with screwdriver to set redstone output amount.",
- "Does not use power.",
- CORE.GT_Tooltip};
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return aSide == aFacing
- ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) }
- : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(Textures.BlockIcons.VOID) };
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- /*@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }*/
-
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)};
- }
-
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)};
- }
-
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPollutionDetector(this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
- }
-
- @Override public boolean isSimpleMachine() {return false;}
- @Override public boolean isElectric() {return true;}
- @Override public boolean isValidSlot(final int aIndex) {return true;}
- @Override public boolean isFacingValid(final byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return true;}
- @Override public boolean isEnetOutput() {return false;}
- @Override public boolean isInputFacing(final byte aSide) {return aSide!=this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isOutputFacing(final byte aSide) {return aSide==this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return 0;}
- @Override public long maxEUStore() {return 0;}
-
- @Override
- public int getCapacity() {
- return 0;
- }
-
- @Override
- public long maxEUInput() {
- return 0;
- }
-
- @Override
- public long maxEUOutput() {
- return 0;
- }
-
- @Override
- public long maxAmperesIn() {
- return 0;
- }
-
- @Override
- public long maxAmperesOut() {
- return 0;
- }
- @Override public int rechargerSlotStartIndex() {return 0;}
- @Override public int dechargerSlotStartIndex() {return 0;}
- @Override public int rechargerSlotCount() {return 0;}
- @Override public int dechargerSlotCount() {return 0;}
- @Override public int getProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyStored();}
- @Override public int maxProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyCapacity();}
- @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;}
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide())
- {
- return true;
- }
- this.showPollution(aPlayer.getEntityWorld(), aPlayer);
- return true;
- }
-
- private void showPollution(final World worldIn, final EntityPlayer playerIn){
- if(!PollutionUtils.isPollutionEnabled()){
- PlayerUtils.messagePlayer(playerIn, "This block is useless, Pollution is disabled.");
- }
- else {
- PlayerUtils.messagePlayer(playerIn, "This chunk contains "+getCurrentChunkPollution()+" pollution.");
- PlayerUtils.messagePlayer(playerIn, "Emit Redstone at pollution level: "+this.mRedstoneLevel);
- }
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- public int getCurrentChunkPollution(){
- return getCurrentChunkPollution(this.getBaseMetaTileEntity());
- }
-
- public int getCurrentChunkPollution(IGregTechTileEntity aBaseMetaTileEntity){
- return PollutionUtils.getPollution(aBaseMetaTileEntity);
- }
-
-
- @Override
- public String[] getInfoData() {
- return new String[] {
- this.getLocalName(),
- "Current Pollution: "+this.mCurrentPollution,
- "Average/10 Sec: "+this.mAveragePollution,
- "Emit Redstone at pollution level: "+this.mRedstoneLevel};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- return new int[] {};
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(final int p_70301_1_) {
- return null;
- }
-
- @Override
- public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
- return null;
- }
-
- @Override
- public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {
- }
-
- @Override
- public String getInventoryName() {
- return null;
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 0;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
- return false;
- }
-
- @Override
- public void openInventory() {
- }
-
- @Override
- public void closeInventory() {
- }
-
- @Override
- public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
- return false;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- //int mCurrentPollution;
- //int mAveragePollution;
- //int mAveragePollutionArray[] = new int[10];
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mCurrentPollution", this.mCurrentPollution);
- aNBT.setInteger("mAveragePollution", this.mAveragePollution);
- aNBT.setLong("mRedstoneLevel", this.mRedstoneLevel);
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mCurrentPollution = aNBT.getInteger("mCurrentPollution");
- this.mAveragePollution = aNBT.getInteger("mAveragePollution");
- this.mRedstoneLevel = aNBT.getLong("mRedstoneLevel");
- }
-
- @Override
- public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
- super.onFirstTick(aBaseMetaTileEntity);
- }
-
- public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- //Only Calc server-side
- if (!this.getBaseMetaTileEntity().isServerSide()) {
- return;
- }
- //Emit Redstone
- if (this.getCurrentChunkPollution() >= this.mRedstoneLevel){
- for (int i=0;i<6;i++){
- this.getBaseMetaTileEntity().setStrongOutputRedstoneSignal((byte) i, (byte) 16);
- }
- this.markDirty();
- }
- else {
- for (int i=0;i<6;i++){
- this.getBaseMetaTileEntity().setStrongOutputRedstoneSignal((byte) i, (byte) 0);
- }
- this.markDirty();
- }
-
- //Do Math for stats
- if (this.mTickTimer % 20 == 0) {
- mCurrentPollution = this.getCurrentChunkPollution();
- if (mArrayPos > mAveragePollutionArray.length-1) {
- mArrayPos = 0;
- }
- mAveragePollutionArray[mArrayPos] = mCurrentPollution;
- mAveragePollution = getAveragePollutionOverLastTen();
- mArrayPos++;
- }
- this.mTickTimer++;
-
- }
-
- public int getAveragePollutionOverLastTen(){
- return MathUtils.getIntAverage(mAveragePollutionArray);
-
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer,
- float aX, float aY, float aZ) {
-
- if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
- case 0:
- this.mRedstoneLevel -= 5000;
- break;
- case 1:
- this.mRedstoneLevel += 5000;
- break;
- case 2:
- this.mRedstoneLevel -= 50000;
- break;
- case 3:
- this.mRedstoneLevel += 50000;
- }
- this.markDirty();
- GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone at Pollution Level: " + this.mRedstoneLevel);
- }
-
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
-
- public boolean allowGeneralRedstoneOutput() {
- if (this.getCurrentChunkPollution() >= this.mRedstoneLevel){
- this.markDirty();
- return true;
- }
- return false;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity,
- EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
- return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
- }
-
- @Override
- public void onMachineBlockUpdate() {
- super.onMachineBlockUpdate();
- }
-
- @Override
- public boolean hasSidedRedstoneOutputBehavior() {
- if (this.getCurrentChunkPollution() >= this.mRedstoneLevel){
- this.markDirty();
- return true;
- }
- return false;
- }
-
-} \ No newline at end of file
+ int mCurrentPollution;
+ int mAveragePollution;
+ int mAveragePollutionArray[] = new int[10];
+ private int mArrayPos = 0;
+ private int mTickTimer = 0;
+ private int mSecondTimer = 0;
+ private long mRedstoneLevel = 0;
+
+ public GregtechMetaPollutionDetector(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
+ }
+
+ public GregtechMetaPollutionDetector(
+ final String aName,
+ final int aTier,
+ final String aDescription,
+ final ITexture[][][] aTextures,
+ final int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Right click to check pollution levels.",
+ "Configure with screwdriver to set redstone output amount.",
+ "Does not use power.",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return aSide == aFacing
+ ? new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency)
+ }
+ : new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
+ new GT_RenderedTexture(Textures.BlockIcons.VOID)
+ };
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ /*@Override
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
+ return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
+ }*/
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPollutionDetector(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 0;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored();
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ this.showPollution(aPlayer.getEntityWorld(), aPlayer);
+ return true;
+ }
+
+ private void showPollution(final World worldIn, final EntityPlayer playerIn) {
+ if (!PollutionUtils.isPollutionEnabled()) {
+ PlayerUtils.messagePlayer(playerIn, "This block is useless, Pollution is disabled.");
+ } else {
+ PlayerUtils.messagePlayer(playerIn, "This chunk contains " + getCurrentChunkPollution() + " pollution.");
+ PlayerUtils.messagePlayer(playerIn, "Emit Redstone at pollution level: " + this.mRedstoneLevel);
+ }
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ public int getCurrentChunkPollution() {
+ return getCurrentChunkPollution(this.getBaseMetaTileEntity());
+ }
+
+ public int getCurrentChunkPollution(IGregTechTileEntity aBaseMetaTileEntity) {
+ return PollutionUtils.getPollution(aBaseMetaTileEntity);
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[] {
+ this.getLocalName(),
+ "Current Pollution: " + this.mCurrentPollution,
+ "Average/10 Sec: " + this.mAveragePollution,
+ "Emit Redstone at pollution level: " + this.mRedstoneLevel
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ return new int[] {};
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int p_70301_1_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {}
+
+ @Override
+ public String getInventoryName() {
+ return null;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 0;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
+ return false;
+ }
+
+ @Override
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ // int mCurrentPollution;
+ // int mAveragePollution;
+ // int mAveragePollutionArray[] = new int[10];
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setInteger("mCurrentPollution", this.mCurrentPollution);
+ aNBT.setInteger("mAveragePollution", this.mAveragePollution);
+ aNBT.setLong("mRedstoneLevel", this.mRedstoneLevel);
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mCurrentPollution = aNBT.getInteger("mCurrentPollution");
+ this.mAveragePollution = aNBT.getInteger("mAveragePollution");
+ this.mRedstoneLevel = aNBT.getLong("mRedstoneLevel");
+ }
+
+ @Override
+ public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
+ super.onFirstTick(aBaseMetaTileEntity);
+ }
+
+ public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ // Only Calc server-side
+ if (!this.getBaseMetaTileEntity().isServerSide()) {
+ return;
+ }
+ // Emit Redstone
+ if (this.getCurrentChunkPollution() >= this.mRedstoneLevel) {
+ for (int i = 0; i < 6; i++) {
+ this.getBaseMetaTileEntity().setStrongOutputRedstoneSignal((byte) i, (byte) 16);
+ }
+ this.markDirty();
+ } else {
+ for (int i = 0; i < 6; i++) {
+ this.getBaseMetaTileEntity().setStrongOutputRedstoneSignal((byte) i, (byte) 0);
+ }
+ this.markDirty();
+ }
+
+ // Do Math for stats
+ if (this.mTickTimer % 20 == 0) {
+ mCurrentPollution = this.getCurrentChunkPollution();
+ if (mArrayPos > mAveragePollutionArray.length - 1) {
+ mArrayPos = 0;
+ }
+ mAveragePollutionArray[mArrayPos] = mCurrentPollution;
+ mAveragePollution = getAveragePollutionOverLastTen();
+ mArrayPos++;
+ }
+ this.mTickTimer++;
+ }
+
+ public int getAveragePollutionOverLastTen() {
+ return MathUtils.getIntAverage(mAveragePollutionArray);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+
+ if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
+ final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) {
+ case 0:
+ this.mRedstoneLevel -= 5000;
+ break;
+ case 1:
+ this.mRedstoneLevel += 5000;
+ break;
+ case 2:
+ this.mRedstoneLevel -= 50000;
+ break;
+ case 3:
+ this.mRedstoneLevel += 50000;
+ }
+ this.markDirty();
+ GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone at Pollution Level: " + this.mRedstoneLevel);
+ }
+
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+
+ public boolean allowGeneralRedstoneOutput() {
+ if (this.getCurrentChunkPollution() >= this.mRedstoneLevel) {
+ this.markDirty();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ super.onMachineBlockUpdate();
+ }
+
+ @Override
+ public boolean hasSidedRedstoneOutputBehavior() {
+ if (this.getCurrentChunkPollution() >= this.mRedstoneLevel) {
+ this.markDirty();
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java
index 58bddefc19..9b60732f62 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java
@@ -3,11 +3,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.V;
import static net.minecraftforge.common.ForgeChunkManager.getMaxChunkDepthFor;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
import com.google.common.collect.MapMaker;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -20,6 +15,10 @@ import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.chunkloading.GTPP_ChunkManager;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -29,378 +28,451 @@ import net.minecraftforge.common.ForgeChunkManager.Ticket;
public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMachine {
- public GregtechMetaTileEntityChunkLoader(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 4, "Loads " + getMaxChunksToLoadForTier(aTier) + " chunks when powered", 0, 0, "Recycler.png", "", new ITexture[]{});
- }
-
- public GregtechMetaTileEntityChunkLoader(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 4, aDescription, aTextures, 0, 0, aGUIName, aNEIName);
- }
-
- public static int getMaxChunksToLoadForTier(int aTier) {
- if (aTier < 4) {
- return Math.min(3 * 3, getMaxChunkDepthFor(CORE.MODID));
- }
- if (aTier < 6) {
- return Math.min(7 * 7, getMaxChunkDepthFor(CORE.MODID));
- }
- if (aTier < 8) {
- return Math.min(15 * 15, getMaxChunkDepthFor(CORE.MODID));
- }
- else {
- return 0;
- }
- }
-
- public static int getChunkRadiusForTier(int aTier) {
- if (aTier < 4) {
- return Math.min(1, (int)Math.floor(Math.sqrt(getMaxChunkDepthFor(CORE.MODID))));
- }
- if (aTier < 6) {
- return Math.min(3, (int)Math.floor(Math.sqrt(getMaxChunkDepthFor(CORE.MODID))));
- }
- if (aTier < 8) {
- return Math.min(7, (int)Math.floor(Math.sqrt(getMaxChunkDepthFor(CORE.MODID))));
- }
- else {
- return 0;
- }
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Loads " + getMaxChunksToLoadForTier(this.mTier) + " chunks when powered",
- "Consumes 2A",
- "Behaves Identically to a Railcraft World Anchor",
- CORE.GT_Tooltip
- };
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
- }
-
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
- }
-
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
- }
-
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
- }
-
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
- }
-
-
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
- }
-
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
- }
-
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
- }
-
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
- }
-
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityChunkLoader(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
-
- @Override
- public String[] getInfoData() {
- return super.getInfoData();
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 0;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
- return true;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- if (aBaseMetaTileEntity.isServerSide()) {
- if (aBaseMetaTileEntity.getXCoord() != prevX || aBaseMetaTileEntity.getYCoord() != prevY || aBaseMetaTileEntity.getZCoord() != prevZ) {
- releaseTicket();
- prevX = aBaseMetaTileEntity.getXCoord();
- prevY = aBaseMetaTileEntity.getYCoord();
- prevZ = aBaseMetaTileEntity.getZCoord();
- }
-
- if (hasActiveTicket() && (getTicket().world != aBaseMetaTileEntity.getWorld() || refreshTicket || !aBaseMetaTileEntity.isAllowedToWork())) {
- releaseTicket();
- }
-
- if (++updateCycle % updateCycleLength == 0) {
- updateCycle = 0;
- if (canChunkload()) {
- setEUVar(getEUVar() - getEnergyConsumption());
- }
- }
-
- if (!hasActiveTicket()) {
- requestTicket();
- }
- }
- }
-
- @Override
- public long maxAmperesIn() {
- return 4;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return V[mTier] * 2;
- }
-
- @Override
- public long maxEUStore() {
- return V[mTier] * 256;
- }
-
- @Override
- public long maxEUInput() {
- return V[mTier];
- }
-
- @Override
- public void onRemoval() {
- super.onRemoval();
- releaseTicket();
- }
-
- public long getEnergyConsumption() {
- return V[mTier] * 2 * updateCycleLength;
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
-
- prevX = aNBT.getInteger("prevX");
- prevY = aNBT.getInteger("prevY");
- prevZ = aNBT.getInteger("prevZ");
-
- NBTTagCompound uuidNBT = aNBT.getCompoundTag("uuid");
- uuid = new UUID(uuidNBT.getLong("most"), uuidNBT.getLong("least"));
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
-
- aNBT.setInteger("prevX", prevX);
- aNBT.setInteger("prevY", prevY);
- aNBT.setInteger("prevZ", prevZ);
-
- if (uuid != null) {
- NBTTagCompound uuidNBT = new NBTTagCompound();
- uuidNBT.setLong("most", uuid.getMostSignificantBits());
- uuidNBT.setLong("least", uuid.getLeastSignificantBits());
- aNBT.setTag("uuid", uuidNBT);
- }
- }
-
- public boolean canChunkload() {
- return getBaseMetaTileEntity().isAllowedToWork() && getEUVar() >= getEnergyConsumption();
- }
-
- /*
- * Chunkloading Vars
- */
-
- private Set<ChunkCoordIntPair> mLoadedChunks = new HashSet<>();
- private static final Map<UUID, Ticket> tickets = new MapMaker().makeMap();
- private boolean refreshTicket;
- private int updateCycle = 0;
- private static final int updateCycleLength = 20;
- private UUID uuid;
- private int prevX, prevY, prevZ;
- private boolean hasTicket;
-
- public boolean addChunkToLoadedList(ChunkCoordIntPair aActiveChunk) {
- return mLoadedChunks.add(aActiveChunk);
- }
-
- public boolean removeChunkFromLoadedList(ChunkCoordIntPair aActiveChunk) {
- return mLoadedChunks.remove(aActiveChunk);
- }
-
- public Set<ChunkCoordIntPair> getManagedChunks() {
- return mLoadedChunks;
- }
-
- public int getChunkloaderTier() {
- return mTier;
- }
-
- public void forceChunkLoading(Ticket ticket) {
- setTicket(ticket);
- setupChunks();
-
- if (mLoadedChunks != null) {
- for (ChunkCoordIntPair chunk : mLoadedChunks) {
- ForgeChunkManager.forceChunk(ticket, chunk);
- }
- }
- }
-
- public void setupChunks() {
- if (!hasTicket) {
- mLoadedChunks = null;
- } else {
- mLoadedChunks = GTPP_ChunkManager.getChunksAround(getBaseMetaTileEntity().getXCoord() >> 4, getBaseMetaTileEntity().getZCoord() >> 4, getChunkRadiusForTier(mTier));
- }
- }
-
- protected Ticket getTicketFromForge() {
- return ForgeChunkManager.requestTicket(GTplusplus.instance, getBaseMetaTileEntity().getWorld(), ForgeChunkManager.Type.NORMAL);
- }
-
- public boolean hasActiveTicket() {
- return getTicket() != null;
- }
-
- protected void releaseTicket() {
- refreshTicket = false;
- setTicket(null);
- }
-
- protected void requestTicket() {
- if (canChunkload()) {
- Ticket chunkTicket = getTicketFromForge();
- if (chunkTicket != null) {
- setTicketData(chunkTicket);
- forceChunkLoading(chunkTicket);
- }
- }
- }
-
- protected void setTicketData(Ticket chunkTicket) {
- if (chunkTicket != null) {
- chunkTicket.getModData().setInteger("xCoord", getBaseMetaTileEntity().getXCoord());
- chunkTicket.getModData().setInteger("yCoord", getBaseMetaTileEntity().getYCoord());
- chunkTicket.getModData().setInteger("zCoord", getBaseMetaTileEntity().getZCoord());
- chunkTicket.setChunkListDepth(getMaxChunksToLoadForTier(mTier));
- }
- }
-
- public void setTicket(Ticket t) {
- Ticket ticket = getTicket();
- if (ticket != t) {
- if (ticket != null) {
- if (ticket.world == getBaseMetaTileEntity().getWorld()) {
- for (ChunkCoordIntPair chunk : ticket.getChunkList()) {
- if (ForgeChunkManager.getPersistentChunksFor(getBaseMetaTileEntity().getWorld()).keys().contains(chunk)) {
- ForgeChunkManager.unforceChunk(ticket, chunk);
- }
- }
- ForgeChunkManager.releaseTicket(ticket);
- }
- tickets.remove(getUUID());
- }
- }
- hasTicket = t != null;
- if (hasTicket) {
- tickets.put(getUUID(), t);
- }
- }
-
- public Ticket getTicket() {
- return tickets.get(getUUID());
- }
-
- public UUID getUUID() {
- if (uuid == null) {
- uuid = UUID.randomUUID();
- }
- return uuid;
- }
-} \ No newline at end of file
+ public GregtechMetaTileEntityChunkLoader(int aID, String aName, String aNameRegional, int aTier) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 4,
+ "Loads " + getMaxChunksToLoadForTier(aTier) + " chunks when powered",
+ 0,
+ 0,
+ "Recycler.png",
+ "",
+ new ITexture[] {});
+ }
+
+ public GregtechMetaTileEntityChunkLoader(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 4, aDescription, aTextures, 0, 0, aGUIName, aNEIName);
+ }
+
+ public static int getMaxChunksToLoadForTier(int aTier) {
+ if (aTier < 4) {
+ return Math.min(3 * 3, getMaxChunkDepthFor(CORE.MODID));
+ }
+ if (aTier < 6) {
+ return Math.min(7 * 7, getMaxChunkDepthFor(CORE.MODID));
+ }
+ if (aTier < 8) {
+ return Math.min(15 * 15, getMaxChunkDepthFor(CORE.MODID));
+ } else {
+ return 0;
+ }
+ }
+
+ public static int getChunkRadiusForTier(int aTier) {
+ if (aTier < 4) {
+ return Math.min(1, (int) Math.floor(Math.sqrt(getMaxChunkDepthFor(CORE.MODID))));
+ }
+ if (aTier < 6) {
+ return Math.min(3, (int) Math.floor(Math.sqrt(getMaxChunkDepthFor(CORE.MODID))));
+ }
+ if (aTier < 8) {
+ return Math.min(7, (int) Math.floor(Math.sqrt(getMaxChunkDepthFor(CORE.MODID))));
+ } else {
+ return 0;
+ }
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "Loads " + getMaxChunksToLoadForTier(this.mTier) + " chunks when powered",
+ "Consumes 2A",
+ "Behaves Identically to a Railcraft World Anchor",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])
+ };
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1])
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1])
+ };
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1])
+ };
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1])
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel),
+ new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1])
+ };
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityChunkLoader(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return super.getInfoData();
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 0;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
+ return true;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (aBaseMetaTileEntity.getXCoord() != prevX
+ || aBaseMetaTileEntity.getYCoord() != prevY
+ || aBaseMetaTileEntity.getZCoord() != prevZ) {
+ releaseTicket();
+ prevX = aBaseMetaTileEntity.getXCoord();
+ prevY = aBaseMetaTileEntity.getYCoord();
+ prevZ = aBaseMetaTileEntity.getZCoord();
+ }
+
+ if (hasActiveTicket()
+ && (getTicket().world != aBaseMetaTileEntity.getWorld()
+ || refreshTicket
+ || !aBaseMetaTileEntity.isAllowedToWork())) {
+ releaseTicket();
+ }
+
+ if (++updateCycle % updateCycleLength == 0) {
+ updateCycle = 0;
+ if (canChunkload()) {
+ setEUVar(getEUVar() - getEnergyConsumption());
+ }
+ }
+
+ if (!hasActiveTicket()) {
+ requestTicket();
+ }
+ }
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 4;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return V[mTier] * 2;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * 256;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public void onRemoval() {
+ super.onRemoval();
+ releaseTicket();
+ }
+
+ public long getEnergyConsumption() {
+ return V[mTier] * 2 * updateCycleLength;
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+
+ prevX = aNBT.getInteger("prevX");
+ prevY = aNBT.getInteger("prevY");
+ prevZ = aNBT.getInteger("prevZ");
+
+ NBTTagCompound uuidNBT = aNBT.getCompoundTag("uuid");
+ uuid = new UUID(uuidNBT.getLong("most"), uuidNBT.getLong("least"));
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+
+ aNBT.setInteger("prevX", prevX);
+ aNBT.setInteger("prevY", prevY);
+ aNBT.setInteger("prevZ", prevZ);
+
+ if (uuid != null) {
+ NBTTagCompound uuidNBT = new NBTTagCompound();
+ uuidNBT.setLong("most", uuid.getMostSignificantBits());
+ uuidNBT.setLong("least", uuid.getLeastSignificantBits());
+ aNBT.setTag("uuid", uuidNBT);
+ }
+ }
+
+ public boolean canChunkload() {
+ return getBaseMetaTileEntity().isAllowedToWork() && getEUVar() >= getEnergyConsumption();
+ }
+
+ /*
+ * Chunkloading Vars
+ */
+
+ private Set<ChunkCoordIntPair> mLoadedChunks = new HashSet<>();
+ private static final Map<UUID, Ticket> tickets = new MapMaker().makeMap();
+ private boolean refreshTicket;
+ private int updateCycle = 0;
+ private static final int updateCycleLength = 20;
+ private UUID uuid;
+ private int prevX, prevY, prevZ;
+ private boolean hasTicket;
+
+ public boolean addChunkToLoadedList(ChunkCoordIntPair aActiveChunk) {
+ return mLoadedChunks.add(aActiveChunk);
+ }
+
+ public boolean removeChunkFromLoadedList(ChunkCoordIntPair aActiveChunk) {
+ return mLoadedChunks.remove(aActiveChunk);
+ }
+
+ public Set<ChunkCoordIntPair> getManagedChunks() {
+ return mLoadedChunks;
+ }
+
+ public int getChunkloaderTier() {
+ return mTier;
+ }
+
+ public void forceChunkLoading(Ticket ticket) {
+ setTicket(ticket);
+ setupChunks();
+
+ if (mLoadedChunks != null) {
+ for (ChunkCoordIntPair chunk : mLoadedChunks) {
+ ForgeChunkManager.forceChunk(ticket, chunk);
+ }
+ }
+ }
+
+ public void setupChunks() {
+ if (!hasTicket) {
+ mLoadedChunks = null;
+ } else {
+ mLoadedChunks = GTPP_ChunkManager.getChunksAround(
+ getBaseMetaTileEntity().getXCoord() >> 4,
+ getBaseMetaTileEntity().getZCoord() >> 4,
+ getChunkRadiusForTier(mTier));
+ }
+ }
+
+ protected Ticket getTicketFromForge() {
+ return ForgeChunkManager.requestTicket(
+ GTplusplus.instance, getBaseMetaTileEntity().getWorld(), ForgeChunkManager.Type.NORMAL);
+ }
+
+ public boolean hasActiveTicket() {
+ return getTicket() != null;
+ }
+
+ protected void releaseTicket() {
+ refreshTicket = false;
+ setTicket(null);
+ }
+
+ protected void requestTicket() {
+ if (canChunkload()) {
+ Ticket chunkTicket = getTicketFromForge();
+ if (chunkTicket != null) {
+ setTicketData(chunkTicket);
+ forceChunkLoading(chunkTicket);
+ }
+ }
+ }
+
+ protected void setTicketData(Ticket chunkTicket) {
+ if (chunkTicket != null) {
+ chunkTicket
+ .getModData()
+ .setInteger("xCoord", getBaseMetaTileEntity().getXCoord());
+ chunkTicket
+ .getModData()
+ .setInteger("yCoord", getBaseMetaTileEntity().getYCoord());
+ chunkTicket
+ .getModData()
+ .setInteger("zCoord", getBaseMetaTileEntity().getZCoord());
+ chunkTicket.setChunkListDepth(getMaxChunksToLoadForTier(mTier));
+ }
+ }
+
+ public void setTicket(Ticket t) {
+ Ticket ticket = getTicket();
+ if (ticket != t) {
+ if (ticket != null) {
+ if (ticket.world == getBaseMetaTileEntity().getWorld()) {
+ for (ChunkCoordIntPair chunk : ticket.getChunkList()) {
+ if (ForgeChunkManager.getPersistentChunksFor(
+ getBaseMetaTileEntity().getWorld())
+ .keys()
+ .contains(chunk)) {
+ ForgeChunkManager.unforceChunk(ticket, chunk);
+ }
+ }
+ ForgeChunkManager.releaseTicket(ticket);
+ }
+ tickets.remove(getUUID());
+ }
+ }
+ hasTicket = t != null;
+ if (hasTicket) {
+ tickets.put(getUUID(), t);
+ }
+ }
+
+ public Ticket getTicket() {
+ return tickets.get(getUUID());
+ }
+
+ public UUID getUUID() {
+ if (uuid == null) {
+ uuid = UUID.randomUUID();
+ }
+ return uuid;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java
index 8456f40797..ea2f47ab8e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java
@@ -1,204 +1,286 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
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_Utility;
-
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
public class GregtechMetaTileEntityThaumcraftResearcher extends GregtechMetaTileEntity {
- public GregtechMetaTileEntityThaumcraftResearcher(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
- }
-
- public GregtechMetaTileEntityThaumcraftResearcher(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
- super(aName, aTier, aSlotCount, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {this.mDescription, "Generates Thaumcraft research notes, because it's magic."};
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_A)};
- }
-
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_B)};
- }
-
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{getSides(aColor)[0]};
- }
-
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue)};
- }
-
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
- }
-
-
- public ITexture[] getFrontActive(final byte aColor) {
- return getFront(aColor);
- }
-
-
- public ITexture[] getBackActive(final byte aColor) {
- return getBack(aColor);
- }
-
-
- public ITexture[] getBottomActive(final byte aColor) {
- return getBottom(aColor);
- }
-
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
- }
-
-
- public ITexture[] getSidesActive(final byte aColor) {
- return getSides(aColor);
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityThaumcraftResearcher(this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
- }
-
- @Override public boolean isSimpleMachine() {return false;}
- @Override public boolean isElectric() {return true;}
- @Override public boolean isValidSlot(final int aIndex) {return true;}
- @Override public boolean isFacingValid(final byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return true;}
- @Override public boolean isEnetOutput() {return false;}
- @Override public boolean isInputFacing(final byte aSide) {return aSide!=this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isOutputFacing(final byte aSide) {return aSide==this.getBaseMetaTileEntity().getBackFacing();}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return 0;}
- @Override public long maxEUStore() {return 512000;}
- @Override public int rechargerSlotStartIndex() {return 0;}
- @Override public int dechargerSlotStartIndex() {return 0;}
- @Override public int rechargerSlotCount() {return 0;}
- @Override public int dechargerSlotCount() {return 0;}
- @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;}
-
- @Override
- public int getCapacity() {
- return 128000;
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide())
- {
- return true;
- }
- return true;
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return aSide==this.getBaseMetaTileEntity().getBackFacing();
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return true;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[] {
- this.getLocalName(),
- };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public int getSizeInventory() {
- return 2;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- //aNBT.setInteger("mCurrentPollution", this.mCurrentPollution);
- //aNBT.setInteger("mAveragePollution", this.mAveragePollution);
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- //this.mCurrentPollution = aNBT.getInteger("mCurrentPollution");
- //this.mAveragePollution = aNBT.getInteger("mAveragePollution");
- }
-
- @Override
- public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
- super.onFirstTick(aBaseMetaTileEntity);
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
-} \ No newline at end of file
+ public GregtechMetaTileEntityThaumcraftResearcher(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
+ }
+
+ public GregtechMetaTileEntityThaumcraftResearcher(
+ final String aName,
+ final int aTier,
+ final String aDescription,
+ final ITexture[][][] aTextures,
+ final int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, "Generates Thaumcraft research notes, because it's magic."};
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_A)
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_B)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {getSides(aColor)[0]};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return getSides(aColor);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityThaumcraftResearcher(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 512000;
+ }
+
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 128000;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[] {
+ this.getLocalName(),
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 2;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ // aNBT.setInteger("mCurrentPollution", this.mCurrentPollution);
+ // aNBT.setInteger("mAveragePollution", this.mAveragePollution);
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ // this.mCurrentPollution = aNBT.getInteger("mCurrentPollution");
+ // this.mAveragePollution = aNBT.getInteger("mAveragePollution");
+ }
+
+ @Override
+ public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
+ super.onFirstTick(aBaseMetaTileEntity);
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java
index f2fc0cce7a..ae8be6a161 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import java.util.List;
-
import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -12,58 +10,72 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.List;
import net.minecraft.item.ItemStack;
import team.chisel.carving.Carving;
public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMachine {
- private ItemStack mInputCache;
- private ItemStack mOutputCache;
-
- public GregtechMetaTileEntity_AutoChisel(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "Chisels things, Gregtech style", 1, 1, "Compressor.png", "",
- new ITexture[]{
- new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE),
- new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB),
- new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE),
- new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab),
- new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
- new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB)
- });
- }
-
- public GregtechMetaTileEntity_AutoChisel(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 GregtechMetaTileEntity_AutoChisel(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- @Override
- public String[] getDescription() {
- String[] A = new String[]{
- this.mDescription,
- "What you want to chisel goes in slot 1",
- "What you want to get goes in the special slot (bottom right)",
- "If special slot is empty, first chisel result is used"
- };
- return A;
- }
-
+ private ItemStack mInputCache;
+ private ItemStack mOutputCache;
+
+ public GregtechMetaTileEntity_AutoChisel(int aID, String aName, String aNameRegional, int aTier) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 1,
+ "Chisels things, Gregtech style",
+ 1,
+ 1,
+ "Compressor.png",
+ "",
+ new ITexture[] {
+ new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE),
+ new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB),
+ new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE),
+ new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab),
+ new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
+ new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB)
+ });
+ }
+
+ public GregtechMetaTileEntity_AutoChisel(
+ 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 GregtechMetaTileEntity_AutoChisel(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ String[] A = new String[] {
+ this.mDescription,
+ "What you want to chisel goes in slot 1",
+ "What you want to get goes in the special slot (bottom right)",
+ "If special slot is empty, first chisel result is used"
+ };
+ return A;
+ }
+
@Override
public GT_Recipe.GT_Recipe_Map getRecipeList() {
return null;
}
-
+
private boolean hasValidCache(ItemStack aStack, ItemStack aSpecialSlot, boolean aClearOnFailure) {
- if (mInputCache != null && mOutputCache != null) {
- if (GT_Utility.areStacksEqual(aStack, mInputCache) && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) {
- return true;
- }
+ if (mInputCache != null && mOutputCache != null) {
+ if (GT_Utility.areStacksEqual(aStack, mInputCache)
+ && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) {
+ return true;
+ }
}
// clear cache if it was invalid
if (aClearOnFailure) {
@@ -72,84 +84,83 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa
}
return false;
}
-
+
private void cacheItem(ItemStack mInputItem, ItemStack mOutputItem) {
mOutputCache = mOutputItem.copy();
mInputCache = mInputItem.copy();
}
@Override
- protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return hasValidCache(aStack, this.getSpecialSlot(), false) ? true : super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && hasChiselResults(aStack);
+ protected boolean allowPutStackValidated(
+ IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return hasValidCache(aStack, this.getSpecialSlot(), false)
+ ? true
+ : super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && hasChiselResults(aStack);
+ }
+
+ // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
+ private static boolean canBeMadeFrom(ItemStack from, ItemStack to) {
+ List<ItemStack> results = getItemsForChiseling(from);
+ for (ItemStack s : results) {
+ if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
+ private static boolean hasChiselResults(ItemStack from) {
+ List<ItemStack> results = getItemsForChiseling(from);
+ return results.size() > 0;
}
-
- // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
- private static boolean canBeMadeFrom(ItemStack from, ItemStack to) {
- List<ItemStack> results = getItemsForChiseling(from);
- for (ItemStack s : results) {
- if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) {
- return true;
- }
- }
- return false;
- }
-
- // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
- private static boolean hasChiselResults(ItemStack from) {
- List<ItemStack> results = getItemsForChiseling(from);
- return results.size() > 0;
- }
-
- private static List<ItemStack> getItemsForChiseling(ItemStack aStack){
- return Carving.chisel.getItemsForChiseling(aStack);
- }
-
- private static ItemStack getChiselOutput(ItemStack aInput, ItemStack aTarget) {
- ItemStack tOutput = null;
- if (aTarget != null && canBeMadeFrom(aInput, aTarget)) {
- tOutput = aTarget;
- }
- else if (aTarget != null && !canBeMadeFrom(aInput, aTarget)) {
- tOutput = null;
- }
- else {
- tOutput = getItemsForChiseling(aInput).get(0);
- }
- return tOutput;
- }
-
+
+ private static List<ItemStack> getItemsForChiseling(ItemStack aStack) {
+ return Carving.chisel.getItemsForChiseling(aStack);
+ }
+
+ private static ItemStack getChiselOutput(ItemStack aInput, ItemStack aTarget) {
+ ItemStack tOutput = null;
+ if (aTarget != null && canBeMadeFrom(aInput, aTarget)) {
+ tOutput = aTarget;
+ } else if (aTarget != null && !canBeMadeFrom(aInput, aTarget)) {
+ tOutput = null;
+ } else {
+ tOutput = getItemsForChiseling(aInput).get(0);
+ }
+ return tOutput;
+ }
+
@Override
public int checkRecipe() {
- ItemStack tOutput = null;
- ItemStack aInput = getInputAt(0);
- ItemStack aTarget = getSpecialSlot();
+ ItemStack tOutput = null;
+ ItemStack aInput = getInputAt(0);
+ ItemStack aTarget = getSpecialSlot();
boolean tIsCached = hasValidCache(aInput, aTarget, true);
- if (aInput != null && hasChiselResults(aInput) && aInput.stackSize > 0) {
- tOutput = tIsCached ? mOutputCache.copy() : getChiselOutput(aInput, aTarget);
- if (tOutput != null) {
- tOutput = tOutput.copy();
- tOutput.stackSize = 1;
- // We can chisel this
- if (canOutput(tOutput)) {
- getInputAt(0).stackSize -= 1;
- calculateOverclockedNess(16, 20);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) {
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- }
- if (!tIsCached) {
- cacheItem(ItemUtils.getSimpleStack(aInput, 1), ItemUtils.getSimpleStack(tOutput, 1));
- }
- this.mOutputItems[0] = tOutput.copy();
- return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
- }
- else {
- mOutputBlocked++;
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- }
- }
- }
- return DID_NOT_FIND_RECIPE;
+ if (aInput != null && hasChiselResults(aInput) && aInput.stackSize > 0) {
+ tOutput = tIsCached ? mOutputCache.copy() : getChiselOutput(aInput, aTarget);
+ if (tOutput != null) {
+ tOutput = tOutput.copy();
+ tOutput.stackSize = 1;
+ // We can chisel this
+ if (canOutput(tOutput)) {
+ getInputAt(0).stackSize -= 1;
+ calculateOverclockedNess(16, 20);
+ // In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) {
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
+ }
+ if (!tIsCached) {
+ cacheItem(ItemUtils.getSimpleStack(aInput, 1), ItemUtils.getSimpleStack(tOutput, 1));
+ }
+ this.mOutputItems[0] = tOutput.copy();
+ return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
+ } else {
+ mOutputBlocked++;
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
+ }
+ }
+ }
+ return DID_NOT_FIND_RECIPE;
}
-
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java
index 99b3faa7d4..268863ffd2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java
@@ -6,66 +6,76 @@ 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.GTPP_Recipe;
import gregtech.api.util.GT_Recipe;
import gtPlusPlus.core.lib.CORE;
-import gregtech.api.util.GTPP_Recipe;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicMachine {
- public GregtechMetaTileEntity_BasicWasher(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1,
- "It's like an automatic Cauldron for washing dusts.", 1, 1, "PotionBrewer.png", "",
- new ITexture[]{
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)
- }
- );
- }
-
- public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
+ public GregtechMetaTileEntity_BasicWasher(int aID, String aName, String aNameRegional, int aTier) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 1,
+ "It's like an automatic Cauldron for washing dusts.",
+ 1,
+ 1,
+ "PotionBrewer.png",
+ "",
+ new ITexture[] {
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)
+ });
+ }
- /*public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }*/
+ public GregtechMetaTileEntity_BasicWasher(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
- @Override
- public String[] getDescription() {
- return new String[]{this.mDescription, "Grants no byproducts, but it is fast.", CORE.GT_Tooltip};
- }
+ /*public GregtechMetaTileEntity_BasicWasher(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 GregtechMetaTileEntity_BasicWasher(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, "Grants no byproducts, but it is fast.", CORE.GT_Tooltip};
+ }
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeList() {
- return GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes;
- }
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_BasicWasher(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
- }
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes;
+ }
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return (aFluid.getFluid().getName().equals("water")) || (super.isFluidInputAllowed(aFluid));
- }
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
+ && (getRecipeList().containsInput(aStack));
+ }
- @Override
- public int getCapacity() {
- return 8000 * Math.max(1, this.mTier);
- }
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return (aFluid.getFluid().getName().equals("water")) || (super.isFluidInputAllowed(aFluid));
+ }
+ @Override
+ public int getCapacity() {
+ return 8000 * Math.max(1, this.mTier);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java
index c872e5c912..2ae5e1e54a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java
@@ -1,13 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import static gregtech.api.enums.GT_Values.E;
-
-import java.util.HashSet;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -15,16 +7,13 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
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 gregtech.api.util.GTPP_Recipe;
-import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.slots.SlotChemicalPlantInput;
import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.Container_FluidReactor;
import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.GUI_FluidReactor;
-import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.List;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -37,630 +26,648 @@ import net.minecraftforge.fluids.IFluidHandler;
public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_BasicMachine {
- public boolean mFluidTransfer_1 = false;
- public boolean mFluidTransfer_2 = false;
-
- public FluidStack[] mInputFluids = new FluidStack[4];
- public FluidStack[] mOutputFluids = new FluidStack[2];
-
- public GregtechMetaTileEntity_ChemicalReactor(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1,
- "For mixing fluids", 4, 4, "ChemicalReactor.png", "",
- new ITexture[]{
- new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side_Active),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front_Active),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top)
- }
- );
- }
-
- public GregtechMetaTileEntity_ChemicalReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- /*public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }*/
-
- @Override
- public String[] getDescription() {
- return new String[]{this.mDescription, "Because why not?", CORE.GT_Tooltip};
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- try {
- GregtechMetaTileEntity_ChemicalReactor y = new GregtechMetaTileEntity_ChemicalReactor(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- return y;
- }
- catch(Throwable t) {
- t.printStackTrace();
- }
- return null;
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- try {
- Container_FluidReactor y = new Container_FluidReactor(aPlayerInventory, aBaseMetaTileEntity);
- return y;
- }
- catch(Throwable t) {
- t.printStackTrace();
- }
- return null;
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_FluidReactor(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- this.mGUIName,
- GT_Utility.isStringValid(this.mNEIName)
- ? this.mNEIName
- : (this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : ""));
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeList() {
- return null;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
- }
-
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return (super.isFluidInputAllowed(aFluid));
- }
-
- @Override
- public int getCapacity() {
- return 32000 * Math.max(1, this.mTier) / 4;
- }
-
- @Override
- public int getInputSlot() {
- return 3;
- }
-
- @Override
- public boolean isLiquidInput(byte aSide) {
- return aSide > 1;
- }
-
- @Override
- public boolean isLiquidOutput(byte aSide) {
- return aSide < 2;
- }
-
- @Override
- public int getOutputSlot() {
- return super.getOutputSlot();
- }
-
- @Override
- public int getStackDisplaySlot() {
- return super.getStackDisplaySlot();
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return true;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return super.canTankBeFilled();
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return super.canTankBeEmptied();
- }
-
- @Override
- public FluidStack getDisplayedFluid() {
- return super.getDisplayedFluid();
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mFluidTransfer_1", mFluidTransfer_1);
- aNBT.setBoolean("mFluidTransfer_2", mFluidTransfer_2);
- for (int i=0;i<4;i++) {
- if (this.mInputFluids[i] != null) {
- aNBT.setTag("mInputFluid"+i, this.mInputFluids[i].writeToNBT(new NBTTagCompound()));
- }
- }
- for (int i=0;i<2;i++) {
- if (this.mOutputFluids[i] != null) {
- aNBT.setTag("mOutputFluid"+i, this.mOutputFluids[i].writeToNBT(new NBTTagCompound()));
- }
- }
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mFluidTransfer_1 = aNBT.getBoolean("mFluidTransfer_1");
- mFluidTransfer_2 = aNBT.getBoolean("mFluidTransfer_2");
- for (int i=0;i<4;i++) {
- if (this.mInputFluids[i] == null) {
- this.mInputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mInputFluid"+i));
- }
- }
- for (int i=0;i<2;i++) {
- if (this.mOutputFluids[i] == null) {
- this.mOutputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid"+i));
- }
- }
- }
-
- /*
- * Custom Fluid Handling - TODO
- */
-
- public FluidStack getFillableStack() {
- return this.mFluid;
- }
-
- public FluidStack setFillableStack(FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
- }
-
- public FluidStack getDrainableStack() {
- return this.mFluid;
- }
-
- public FluidStack setDrainableStack(FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
- }
-
-
-
-
-
-
-
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- // Re-implement basic machine logic from the ground up.=
-
- if (aBaseMetaTileEntity.isServerSide()) {
- this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L;
- this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L;
- this.doDisplayThings();
- boolean tSucceeded = false;
- int i;
- if (this.mMaxProgresstime > 0 && (this.mProgresstime >= 0 || aBaseMetaTileEntity.isAllowedToWork())) {
- aBaseMetaTileEntity.setActive(true);
- if (this.mProgresstime >= 0 && !this.drainEnergyForProcess((long) this.mEUt)) {
- if (!this.mStuttering) {
- this.stutterProcess();
- if (this.canHaveInsufficientEnergy()) {
- this.mProgresstime = -100;
- }
-
- this.mStuttering = true;
- }
- } else {
- if (++this.mProgresstime >= this.mMaxProgresstime) {
- for (i = 0; i < this.mOutputItems.length; ++i) {
- for (i = 0; i < this.mOutputItems.length && !aBaseMetaTileEntity.addStackToSlot(
- this.getOutputSlot() + (i + i) % this.mOutputItems.length,
- this.mOutputItems[i]); ++i) {
- ;
- }
- }
-
- if (this.mOutputFluid != null) {
- if (this.getDrainableStack() == null) {
- this.setDrainableStack(this.mOutputFluid.copy());
- } else if (this.mOutputFluid.isFluidEqual(this.getDrainableStack())) {
- FluidStack var10000 = this.getDrainableStack();
- var10000.amount += this.mOutputFluid.amount;
- }
- }
-
- for (i = 0; i < this.mOutputItems.length; ++i) {
- this.mOutputItems[i] = null;
- }
-
- this.mOutputFluid = null;
- this.mEUt = 0;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- this.mStuttering = false;
- tSucceeded = true;
- this.endProcess();
- }
-
- if (this.mProgresstime > 5) {
- this.mStuttering = false;
- }
- }
- } else {
- aBaseMetaTileEntity.setActive(false);
- }
-
- boolean tRemovedOutputFluid = false;
- if (this.doesAutoOutputFluids() && this.getDrainableStack() != null
- && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing && (tSucceeded || aTick % 20L == 0L)) {
- IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
- if (tTank != null) {
- FluidStack tDrained = this.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()),
- this.drain(tFilledAmount, true), true);
- }
- }
- }
-
- if (this.getDrainableStack() == null) {
- tRemovedOutputFluid = true;
- }
- }
-
- int j;
- if (this.doesAutoOutput() && !this.isOutputEmpty()
- && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing
- && (tSucceeded || this.mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified()
- || aTick % 600L == 0L)) {
- TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing());
- j = 0;
-
- for (byte tCosts = 1; j < this.mOutputItems.length && tCosts > 0
- && aBaseMetaTileEntity.isUniversalEnergyStored(128L); ++j) {
- tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2,
- aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), (List) null,
- false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- if (tCosts > 0) {
- aBaseMetaTileEntity.decreaseStoredEnergyUnits((long) tCosts, true);
- }
- }
- }
-
- if (this.mOutputBlocked != 0) {
- if (this.isOutputEmpty()) {
- this.mOutputBlocked = 0;
- } else {
- ++this.mOutputBlocked;
- }
- }
-
- if (this.allowToCheckRecipe()) {
- if (this.mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork()
- && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified()
- || aTick % 600L == 0L || aBaseMetaTileEntity.hasWorkJustBeenEnabled())
- && this.hasEnoughEnergyToCheckRecipe()) {
- if (this.checkRecipe() == 2) {
- if (this.mInventory[3] != null && this.mInventory[3].stackSize <= 0) {
- this.mInventory[3] = null;
- }
-
- i = this.getInputSlot();
-
- for (j = i + this.mInputSlotCount; i < j; ++i) {
- if (this.mInventory[i] != null && this.mInventory[i].stackSize <= 0) {
- this.mInventory[i] = null;
- }
- }
-
- for (i = 0; i < this.mOutputItems.length; ++i) {
- this.mOutputItems[i] = GT_Utility.copy(new Object[]{this.mOutputItems[i]});
- if (this.mOutputItems[i] != null && this.mOutputItems[i].stackSize > 64) {
- this.mOutputItems[i].stackSize = 64;
- }
-
- this.mOutputItems[i] = GT_OreDictUnificator.get(true, this.mOutputItems[i]);
- }
-
- if (this.mFluid != null && this.mFluid.amount <= 0) {
- this.mFluid = null;
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- if (GT_Utility.isDebugItem(this.mInventory[this.dechargerSlotStartIndex()])) {
- this.mEUt = this.mMaxProgresstime = 1;
- }
-
- this.startProcess();
- } else {
- this.mMaxProgresstime = 0;
-
- for (i = 0; i < this.mOutputItems.length; ++i) {
- this.mOutputItems[i] = null;
- }
-
- this.mOutputFluid = null;
- }
- }
- } else if (!this.mStuttering) {
- this.stutterProcess();
- this.mStuttering = true;
- }
- }
-
-
-
- }
-
- @Override
- protected void doDisplayThings() {
- // TODO Auto-generated method stub
- super.doDisplayThings();
- }
-
- @Override
- protected ItemStack getSpecialSlot() {
- // TODO Auto-generated method stub
- return super.getSpecialSlot();
- }
-
- @Override
- protected ItemStack getOutputAt(int aIndex) {
- // TODO Auto-generated method stub
- return super.getOutputAt(aIndex);
- }
-
- @Override
- protected ItemStack[] getAllOutputs() {
- // TODO Auto-generated method stub
- return super.getAllOutputs();
- }
-
- @Override
- protected ItemStack getInputAt(int aIndex) {
- // TODO Auto-generated method stub
- return super.getInputAt(aIndex);
- }
-
- @Override
- protected ItemStack[] getAllInputs() {
- // TODO Auto-generated method stub
- return super.getAllInputs();
- }
-
- @Override
- protected boolean displaysInputFluid() {
- return true;
- }
-
- @Override
- protected boolean displaysOutputFluid() {
- return true;
- }
-
- @Override
- public boolean doesAutoOutput() {
- return super.doesAutoOutput();
- }
-
- @Override
- public boolean doesAutoOutputFluids() {
- return this.mFluidTransfer_1 && this.mFluidTransfer_2;
- }
-
- @Override
- public void startProcess() {
- super.startProcess();
- }
-
- @Override
- public void endProcess() {
- super.endProcess();
- }
-
- @Override
- public String[] getInfoData() {
- return super.getInfoData();
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return super.allowPullStack(aBaseMetaTileEntity, aIndex, aSide, aStack);
- }
-
- @Override
- public int checkRecipe() {
- return super.checkRecipe();
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
-
- /* if (aBaseMetaTileEntity != null) {
- if (!aBaseMetaTileEntity.getWorld().isRemote) {
- itemslots : for (int i=3;i<7;i++) {
- ItemStack aStack = aBaseMetaTileEntity.getStackInSlot(i);
- if (aStack != null) {
- if (FluidContainerRegistry.isContainer(aStack)) {
- if (this.isItemValidForSlot(i, aStack)) {
- // Add Fluid
- FluidStack aContainerFluid = FluidContainerRegistry.getFluidForFilledItem(aStack);
- if (aContainerFluid != null) {
- fluidslots : for (FluidStack u : mInputFluids) {
- if (u != null && u.isFluidEqual(aContainerFluid)) {
- if (u.amount <= (this.getCapacity() - aContainerFluid.amount)) {
-
- // Matching, not full, let's fill, then continue
- u.amount += aContainerFluid.amount;
-
- // Update stack size
- if (aStack.stackSize > 1) {
- aStack.stackSize--;
- }
- else {
- aStack = null;
- }
-
- // Add Output container
- // TODO
-
- continue itemslots;
- }
- else {
- // Too full
- break fluidslots;
- }
- }
- else {
- if (u == null ) {
-
- // Empty, let's fill, then continue
- u = aContainerFluid.copy();
-
- // Update stack size
- if (aStack.stackSize > 1) {
- aStack.stackSize--;
- }
- else {
- aStack = null;
- }
-
- // Add Output container
- // TODO
-
- continue itemslots;
-
- }
- else {
- // Not empty, doesn't match, check next slot.
- continue fluidslots;
- }
- }
- }
-
-
-
- }
- // Eat Input
-
- // Add Container to Output
- }
- }
- }
- }
- }
- }*/
-
- }
-
- @Override
- public FluidStack getFluid() {
- return super.getFluid();
- }
-
- @Override
- public int getFluidAmount() {
- return super.getFluidAmount();
- }
-
- @Override
- public int fill(FluidStack aFluid, boolean doFill) {
- return super.fill(aFluid, doFill);
- }
-
- @Override
- public FluidStack drain(int maxDrain, boolean doDrain) {
- return super.drain(maxDrain, doDrain);
- }
-
- @Override
- public void setItemNBT(NBTTagCompound aNBT) {
- super.setItemNBT(aNBT);
- }
-
- @Override
- public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
- if (aIndex >= 3 && aIndex <= 6) {
- return SlotChemicalPlantInput.isItemValidForChemicalPlantSlot(aStack);
- }
- return false;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(int aSide) {
- return super.getAccessibleSlotsFromSide(aSide);
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- if (aIndex >= 3 && aIndex <= 6) {
- return super.canInsertItem(aIndex, aStack, aSide);
- }
- return false;
- }
-
- @Override
- public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
- if (aIndex >= 7 && aIndex <= 11) {
- return super.canExtractItem(aIndex, aStack, aSide);
- }
- return false;
- }
-
- @Override
- public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- // TODO Auto-generated method stub
- return super.canFill(aSide, aFluid);
- }
-
- @Override
- public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- // TODO Auto-generated method stub
- return super.canDrain(aSide, aFluid);
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- // TODO Auto-generated method stub
- return super.getTankInfo(aSide);
- }
-
- @Override
- public int fill_default(
- ForgeDirection aSide, FluidStack aFluid, boolean doFill
- ) {
- // TODO Auto-generated method stub
- return super.fill_default(aSide, aFluid, doFill);
- }
-
- @Override
- public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- // TODO Auto-generated method stub
- return super.fill(aSide, aFluid, doFill);
- }
-
- @Override
- public FluidStack drain(
- ForgeDirection aSide, FluidStack aFluid, boolean doDrain
- ) {
- // TODO Auto-generated method stub
- return super.drain(aSide, aFluid, doDrain);
- }
-
- @Override
- public FluidStack drain(
- ForgeDirection aSide, int maxDrain, boolean doDrain
- ) {
- // TODO Auto-generated method stub
- return super.drain(aSide, maxDrain, doDrain);
- }
-
+ public boolean mFluidTransfer_1 = false;
+ public boolean mFluidTransfer_2 = false;
+
+ public FluidStack[] mInputFluids = new FluidStack[4];
+ public FluidStack[] mOutputFluids = new FluidStack[2];
+
+ public GregtechMetaTileEntity_ChemicalReactor(int aID, String aName, String aNameRegional, int aTier) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 1,
+ "For mixing fluids",
+ 4,
+ 4,
+ "ChemicalReactor.png",
+ "",
+ new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top)
+ });
+ }
+
+ public GregtechMetaTileEntity_ChemicalReactor(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ /*public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }*/
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, "Because why not?", CORE.GT_Tooltip};
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ try {
+ GregtechMetaTileEntity_ChemicalReactor y = new GregtechMetaTileEntity_ChemicalReactor(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ return y;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ try {
+ Container_FluidReactor y = new Container_FluidReactor(aPlayerInventory, aBaseMetaTileEntity);
+ return y;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_FluidReactor(
+ aPlayerInventory,
+ aBaseMetaTileEntity,
+ this.getLocalName(),
+ this.mGUIName,
+ GT_Utility.isStringValid(this.mNEIName)
+ ? this.mNEIName
+ : (this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : ""));
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return null;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
+ && (getRecipeList().containsInput(aStack));
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return (super.isFluidInputAllowed(aFluid));
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000 * Math.max(1, this.mTier) / 4;
+ }
+
+ @Override
+ public int getInputSlot() {
+ return 3;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return aSide < 2;
+ }
+
+ @Override
+ public int getOutputSlot() {
+ return super.getOutputSlot();
+ }
+
+ @Override
+ public int getStackDisplaySlot() {
+ return super.getStackDisplaySlot();
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return super.canTankBeFilled();
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return super.canTankBeEmptied();
+ }
+
+ @Override
+ public FluidStack getDisplayedFluid() {
+ return super.getDisplayedFluid();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mFluidTransfer_1", mFluidTransfer_1);
+ aNBT.setBoolean("mFluidTransfer_2", mFluidTransfer_2);
+ for (int i = 0; i < 4; i++) {
+ if (this.mInputFluids[i] != null) {
+ aNBT.setTag("mInputFluid" + i, this.mInputFluids[i].writeToNBT(new NBTTagCompound()));
+ }
+ }
+ for (int i = 0; i < 2; i++) {
+ if (this.mOutputFluids[i] != null) {
+ aNBT.setTag("mOutputFluid" + i, this.mOutputFluids[i].writeToNBT(new NBTTagCompound()));
+ }
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mFluidTransfer_1 = aNBT.getBoolean("mFluidTransfer_1");
+ mFluidTransfer_2 = aNBT.getBoolean("mFluidTransfer_2");
+ for (int i = 0; i < 4; i++) {
+ if (this.mInputFluids[i] == null) {
+ this.mInputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mInputFluid" + i));
+ }
+ }
+ for (int i = 0; i < 2; i++) {
+ if (this.mOutputFluids[i] == null) {
+ this.mOutputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid" + i));
+ }
+ }
+ }
+
+ /*
+ * Custom Fluid Handling - TODO
+ */
+
+ public FluidStack getFillableStack() {
+ return this.mFluid;
+ }
+
+ public FluidStack setFillableStack(FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+ public FluidStack getDrainableStack() {
+ return this.mFluid;
+ }
+
+ public FluidStack setDrainableStack(FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ // Re-implement basic machine logic from the ground up.=
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L;
+ this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L;
+ this.doDisplayThings();
+ boolean tSucceeded = false;
+ int i;
+ if (this.mMaxProgresstime > 0 && (this.mProgresstime >= 0 || aBaseMetaTileEntity.isAllowedToWork())) {
+ aBaseMetaTileEntity.setActive(true);
+ if (this.mProgresstime >= 0 && !this.drainEnergyForProcess((long) this.mEUt)) {
+ if (!this.mStuttering) {
+ this.stutterProcess();
+ if (this.canHaveInsufficientEnergy()) {
+ this.mProgresstime = -100;
+ }
+
+ this.mStuttering = true;
+ }
+ } else {
+ if (++this.mProgresstime >= this.mMaxProgresstime) {
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ for (i = 0;
+ i < this.mOutputItems.length
+ && !aBaseMetaTileEntity.addStackToSlot(
+ this.getOutputSlot() + (i + i) % this.mOutputItems.length,
+ this.mOutputItems[i]);
+ ++i) {
+ ;
+ }
+ }
+
+ if (this.mOutputFluid != null) {
+ if (this.getDrainableStack() == null) {
+ this.setDrainableStack(this.mOutputFluid.copy());
+ } else if (this.mOutputFluid.isFluidEqual(this.getDrainableStack())) {
+ FluidStack var10000 = this.getDrainableStack();
+ var10000.amount += this.mOutputFluid.amount;
+ }
+ }
+
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ this.mOutputItems[i] = null;
+ }
+
+ this.mOutputFluid = null;
+ this.mEUt = 0;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ this.mStuttering = false;
+ tSucceeded = true;
+ this.endProcess();
+ }
+
+ if (this.mProgresstime > 5) {
+ this.mStuttering = false;
+ }
+ }
+ } else {
+ aBaseMetaTileEntity.setActive(false);
+ }
+
+ boolean tRemovedOutputFluid = false;
+ if (this.doesAutoOutputFluids()
+ && this.getDrainableStack() != null
+ && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing
+ && (tSucceeded || aTick % 20L == 0L)) {
+ IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
+ if (tTank != null) {
+ FluidStack tDrained = this.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()),
+ this.drain(tFilledAmount, true),
+ true);
+ }
+ }
+ }
+
+ if (this.getDrainableStack() == null) {
+ tRemovedOutputFluid = true;
+ }
+ }
+
+ int j;
+ if (this.doesAutoOutput()
+ && !this.isOutputEmpty()
+ && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing
+ && (tSucceeded
+ || this.mOutputBlocked % 300 == 1
+ || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600L == 0L)) {
+ TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing());
+ j = 0;
+
+ for (byte tCosts = 1;
+ j < this.mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128L);
+ ++j) {
+ tCosts = GT_Utility.moveOneItemStack(
+ aBaseMetaTileEntity,
+ tTileEntity2,
+ aBaseMetaTileEntity.getFrontFacing(),
+ aBaseMetaTileEntity.getBackFacing(),
+ (List) null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ if (tCosts > 0) {
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits((long) tCosts, true);
+ }
+ }
+ }
+
+ if (this.mOutputBlocked != 0) {
+ if (this.isOutputEmpty()) {
+ this.mOutputBlocked = 0;
+ } else {
+ ++this.mOutputBlocked;
+ }
+ }
+
+ if (this.allowToCheckRecipe()) {
+ if (this.mMaxProgresstime <= 0
+ && aBaseMetaTileEntity.isAllowedToWork()
+ && (tRemovedOutputFluid
+ || tSucceeded
+ || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600L == 0L
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled())
+ && this.hasEnoughEnergyToCheckRecipe()) {
+ if (this.checkRecipe() == 2) {
+ if (this.mInventory[3] != null && this.mInventory[3].stackSize <= 0) {
+ this.mInventory[3] = null;
+ }
+
+ i = this.getInputSlot();
+
+ for (j = i + this.mInputSlotCount; i < j; ++i) {
+ if (this.mInventory[i] != null && this.mInventory[i].stackSize <= 0) {
+ this.mInventory[i] = null;
+ }
+ }
+
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ this.mOutputItems[i] = GT_Utility.copy(new Object[] {this.mOutputItems[i]});
+ if (this.mOutputItems[i] != null && this.mOutputItems[i].stackSize > 64) {
+ this.mOutputItems[i].stackSize = 64;
+ }
+
+ this.mOutputItems[i] = GT_OreDictUnificator.get(true, this.mOutputItems[i]);
+ }
+
+ if (this.mFluid != null && this.mFluid.amount <= 0) {
+ this.mFluid = null;
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ if (GT_Utility.isDebugItem(this.mInventory[this.dechargerSlotStartIndex()])) {
+ this.mEUt = this.mMaxProgresstime = 1;
+ }
+
+ this.startProcess();
+ } else {
+ this.mMaxProgresstime = 0;
+
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ this.mOutputItems[i] = null;
+ }
+
+ this.mOutputFluid = null;
+ }
+ }
+ } else if (!this.mStuttering) {
+ this.stutterProcess();
+ this.mStuttering = true;
+ }
+ }
+ }
+
+ @Override
+ protected void doDisplayThings() {
+ // TODO Auto-generated method stub
+ super.doDisplayThings();
+ }
+
+ @Override
+ protected ItemStack getSpecialSlot() {
+ // TODO Auto-generated method stub
+ return super.getSpecialSlot();
+ }
+
+ @Override
+ protected ItemStack getOutputAt(int aIndex) {
+ // TODO Auto-generated method stub
+ return super.getOutputAt(aIndex);
+ }
+
+ @Override
+ protected ItemStack[] getAllOutputs() {
+ // TODO Auto-generated method stub
+ return super.getAllOutputs();
+ }
+
+ @Override
+ protected ItemStack getInputAt(int aIndex) {
+ // TODO Auto-generated method stub
+ return super.getInputAt(aIndex);
+ }
+
+ @Override
+ protected ItemStack[] getAllInputs() {
+ // TODO Auto-generated method stub
+ return super.getAllInputs();
+ }
+
+ @Override
+ protected boolean displaysInputFluid() {
+ return true;
+ }
+
+ @Override
+ protected boolean displaysOutputFluid() {
+ return true;
+ }
+
+ @Override
+ public boolean doesAutoOutput() {
+ return super.doesAutoOutput();
+ }
+
+ @Override
+ public boolean doesAutoOutputFluids() {
+ return this.mFluidTransfer_1 && this.mFluidTransfer_2;
+ }
+
+ @Override
+ public void startProcess() {
+ super.startProcess();
+ }
+
+ @Override
+ public void endProcess() {
+ super.endProcess();
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return super.getInfoData();
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPullStack(aBaseMetaTileEntity, aIndex, aSide, aStack);
+ }
+
+ @Override
+ public int checkRecipe() {
+ return super.checkRecipe();
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+
+ /* if (aBaseMetaTileEntity != null) {
+ if (!aBaseMetaTileEntity.getWorld().isRemote) {
+ itemslots : for (int i=3;i<7;i++) {
+ ItemStack aStack = aBaseMetaTileEntity.getStackInSlot(i);
+ if (aStack != null) {
+ if (FluidContainerRegistry.isContainer(aStack)) {
+ if (this.isItemValidForSlot(i, aStack)) {
+ // Add Fluid
+ FluidStack aContainerFluid = FluidContainerRegistry.getFluidForFilledItem(aStack);
+ if (aContainerFluid != null) {
+ fluidslots : for (FluidStack u : mInputFluids) {
+ if (u != null && u.isFluidEqual(aContainerFluid)) {
+ if (u.amount <= (this.getCapacity() - aContainerFluid.amount)) {
+
+ // Matching, not full, let's fill, then continue
+ u.amount += aContainerFluid.amount;
+
+ // Update stack size
+ if (aStack.stackSize > 1) {
+ aStack.stackSize--;
+ }
+ else {
+ aStack = null;
+ }
+
+ // Add Output container
+ // TODO
+
+ continue itemslots;
+ }
+ else {
+ // Too full
+ break fluidslots;
+ }
+ }
+ else {
+ if (u == null ) {
+
+ // Empty, let's fill, then continue
+ u = aContainerFluid.copy();
+
+ // Update stack size
+ if (aStack.stackSize > 1) {
+ aStack.stackSize--;
+ }
+ else {
+ aStack = null;
+ }
+
+ // Add Output container
+ // TODO
+
+ continue itemslots;
+
+ }
+ else {
+ // Not empty, doesn't match, check next slot.
+ continue fluidslots;
+ }
+ }
+ }
+
+
+
+ }
+ // Eat Input
+
+ // Add Container to Output
+ }
+ }
+ }
+ }
+ }
+ }*/
+
+ }
+
+ @Override
+ public FluidStack getFluid() {
+ return super.getFluid();
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return super.getFluidAmount();
+ }
+
+ @Override
+ public int fill(FluidStack aFluid, boolean doFill) {
+ return super.fill(aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return super.drain(maxDrain, doDrain);
+ }
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ super.setItemNBT(aNBT);
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ if (aIndex >= 3 && aIndex <= 6) {
+ return SlotChemicalPlantInput.isItemValidForChemicalPlantSlot(aStack);
+ }
+ return false;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ return super.getAccessibleSlotsFromSide(aSide);
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ if (aIndex >= 3 && aIndex <= 6) {
+ return super.canInsertItem(aIndex, aStack, aSide);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ if (aIndex >= 7 && aIndex <= 11) {
+ return super.canExtractItem(aIndex, aStack, aSide);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ // TODO Auto-generated method stub
+ return super.canFill(aSide, aFluid);
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ // TODO Auto-generated method stub
+ return super.canDrain(aSide, aFluid);
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ // TODO Auto-generated method stub
+ return super.getTankInfo(aSide);
+ }
+
+ @Override
+ public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ // TODO Auto-generated method stub
+ return super.fill_default(aSide, aFluid, doFill);
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ // TODO Auto-generated method stub
+ return super.fill(aSide, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ // TODO Auto-generated method stub
+ return super.drain(aSide, aFluid, doDrain);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ // TODO Auto-generated method stub
+ return super.drain(aSide, maxDrain, doDrain);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java
index 2197ce193d..eb52042b9b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java
@@ -1,13 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import java.util.ArrayList;
-import java.util.Random;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
@@ -15,688 +7,718 @@ 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.GTPP_Recipe;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GTPP_Recipe;
-
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeMachine;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.Random;
+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.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEntity_DeluxeMachine {
- private boolean mCanProcessRecipe = false;
- private boolean mCharging = false;
- private long mChargeConsumed = 0;
-
- private GT_Recipe mLastRecipe;
- private long mEUStore;
- private boolean mRunningOnLoad = false;
- private boolean mMachine = false;
- private int mEfficiency, mEfficiencyIncrease, mEfficiencyMax = 0;
- private int mStartUpCheck = 100, mUpdate = 0;
- private FluidStack[] mOutputFluids = null;
-
- public GregtechMetaTileEntity_CompactFusionReactor(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "It's like a midget Ra.", 1, 1, "PotionBrewer.png", "");
- }
-
- public GregtechMetaTileEntity_CompactFusionReactor(String aName, int aTier, String aDescription,
- ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] { this.mDescription, "Not Very Fast, but not very big either.",
- "Each side pair in/out puts to different slots.", "Top & Bottom Sides are Outputs.",
- "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2." };
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_CompactFusionReactor(this.mName, this.mTier, this.mDescription,
- this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public int tier() {
- return this.mTier;
- }
-
- public int tierOverclock() {
- return this.mTier == 6 ? 0 : this.mTier == 7 ? 1 : 2;
- }
-
- private GT_RenderedTexture getCasingTexture() {
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeList() {
- return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getBackFacing();
- }
-
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return (aFluid.getFluid().getName().contains("plasma")) || (super.isFluidInputAllowed(aFluid));
- }
-
- @Override
- public int getCapacity() {
- return 32000;
- }
-
- @Override
- public void abortProcess() {
- super.abortProcess();
- }
-
- long mFusionPoint = 20000000L;
-
- @Override
- public int checkRecipe() {
- Logger.MACHINE_INFO("Recipe Tick 1.");
- if (!this.mCanProcessRecipe) {
- Logger.MACHINE_INFO("Recipe Tick 1.1 - Cannot Process Recipe.");
- if (this.mChargeConsumed < mFusionPoint) {
- Logger.MACHINE_INFO("Recipe Tick 1.2 - Cannot Ignite Fusion, Charge too low.");
- this.mCharging = true;
- this.mCanProcessRecipe = false;
- if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits((mFusionPoint / 100), false)) {
- Logger.MACHINE_INFO("Recipe Tick 1.3 - Charging Internal storage. " + (mFusionPoint / 100) + "/"
- + mFusionPoint);
- mChargeConsumed += (mFusionPoint / 100);
- }
- }
- else {
- mChargeConsumed = 0;
- this.mCharging = false;
- this.mCanProcessRecipe = true;
-
- }
- }
- else {
- Logger.MACHINE_INFO("Recipe Tick 1.1 - Try to Process Recipe.");
- if (checkRecipeMulti()) {
- Logger.MACHINE_INFO("Recipe Tick 1.2 - Process Recipe was Successful.");
- return 2;
- }
- }
- Logger.MACHINE_INFO("Recipe Tick 2. - Process Recipe failed.");
- return 0;
- }
-
- public ArrayList<FluidStack> getStoredFluids() {
- ArrayList<FluidStack> mList = new ArrayList<FluidStack>();
- mList.add(this.mFluid);
- mList.add(this.mFluid2);
- return mList;
- }
-
- public boolean checkRecipeMulti() {
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- int tFluidList_sS = tFluidList.size();
- for (int i = 0; i < tFluidList_sS - 1; i++) {
- for (int j = i + 1; j < tFluidList_sS; j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
- tFluidList.remove(j--);
- tFluidList_sS = tFluidList.size();
- }
- else {
- tFluidList.remove(i--);
- tFluidList_sS = tFluidList.size();
- break;
- }
- }
- }
- }
- if (tFluidList.size() > 1) {
- FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
- GT_Recipe tRecipe = getRecipeList().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false,
- GT_Values.V[8], tFluids, new ItemStack[] {});
- if (tRecipe == null) {
- return false;
- }
- if ((tRecipe == null && !mRunningOnLoad) || (tRecipe != null && maxEUStore() < tRecipe.mSpecialValue)) {
- this.mLastRecipe = null;
- Logger.MACHINE_INFO("Just plain bad.");
- return false;
- }
- if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) {
- this.mLastRecipe = tRecipe;
- this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue));
- this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue);
-
- this.mEfficiencyIncrease = 10000;
-
- this.mOutputFluids = this.mLastRecipe.mFluidOutputs;
- mRunningOnLoad = false;
- return true;
- }
- }
- return false;
- }
-
- public int overclock(int mStartEnergy) {
- if (tierOverclock() == 1) {
- return 1;
- }
- if (tierOverclock() == 2) {
- return mStartEnergy < 160000000 ? 2 : 1;
- }
- return mStartEnergy < 160000000 ? 4 : mStartEnergy < 320000000 ? 2 : 1;
- }
-
- @Override
- public boolean displaysItemStack() {
- return false;
- }
-
- @Override
- public boolean doesAutoOutputFluids() {
- return true;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return true;
- }
-
- @Override
- public boolean doesFillContainers() {
- return true;
- }
-
- @Override
- public long maxAmperesIn() {
- return 16L;
- }
-
- @Override
- public long maxEUStore() {
- return Long.MAX_VALUE;
- }
-
- @Override
- public void doExplosion(long aExplosionPower) {
- super.doExplosion(aExplosionPower * 2);
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- onRunningTickMulti();
- if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())
- && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0)
- && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
- if (MathUtils.randInt(0, 4) == 4) {
- final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
- aBaseMetaTileEntity.getWorld().spawnParticle("magicCrit",
- (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F),
- aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F),
- (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F), 0.0D, 0.0D, 0.0D);
- aBaseMetaTileEntity.getWorld().spawnParticle("magicCrit",
- (aBaseMetaTileEntity.getXCoord() + 0.4F) - (tRandom.nextFloat() * 0.3F),
- aBaseMetaTileEntity.getYCoord() + 0.2f + (tRandom.nextFloat() * 0.1F),
- (aBaseMetaTileEntity.getZCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), 0.0D, 0.0D, 0.0D);
- aBaseMetaTileEntity.getWorld().spawnParticle("magicCrit",
- (aBaseMetaTileEntity.getXCoord() + 0.6F) - (tRandom.nextFloat() * 0.9F),
- aBaseMetaTileEntity.getYCoord() + 0.4f + (tRandom.nextFloat() * 0.3F),
- (aBaseMetaTileEntity.getZCoord() + 1.8F) - (tRandom.nextFloat() * 2.6F), 0.0D, 0.0D, 0.0D);
- }
- }
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setBoolean("mCanProcessRecipe", this.mCanProcessRecipe);
- aNBT.setBoolean("mCharging", this.mCharging);
- aNBT.setLong("mChargeConsumed", this.mChargeConsumed);
- aNBT.setInteger("mEfficiency", this.mEfficiency);
- aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
- aNBT.setInteger("mEfficiencyMax", this.mEfficiencyMax);
- aNBT.setInteger("mStartUpCheck", this.mStartUpCheck);
- aNBT.setInteger("mUpdate", mUpdate);
- aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease);
- aNBT.setBoolean("mRunningOnLoad", this.mRunningOnLoad);
- aNBT.setBoolean("mMachine", this.mMachine);
- aNBT.setLong("mEUStore", this.mEUStore);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- if (mMaxProgresstime > 0)
- mRunningOnLoad = true;
- this.mCanProcessRecipe = aNBT.getBoolean("mCanProcessRecipe");
- this.mCharging = aNBT.getBoolean("mCharging");
- this.mChargeConsumed = aNBT.getLong("mChargeConsumed");
- this.mEfficiency = aNBT.getInteger("mEfficiency");
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mEfficiencyMax = aNBT.getInteger("mEfficiencyMax");
- this.mStartUpCheck = aNBT.getInteger("mStartUpCheck");
- this.mUpdate = aNBT.getInteger("mUpdate");
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mRunningOnLoad = aNBT.getBoolean("mRunningOnLoad");
- this.mMachine = aNBT.getBoolean("mMachine");
- this.mEUStore = aNBT.getLong("mEUStore");
- super.loadNBTData(aNBT);
- }
-
- @Override
- public String[] getInfoData() {
- String tier = tier() == 6 ? "I" : tier() == 7 ? "II" : "III";
- float plasmaOut = 0;
- String fusionName = "";
- int powerRequired = 0;
- if (this.mLastRecipe != null) {
- fusionName = this.mLastRecipe.mFluidOutputs[0].getLocalizedName() + " Fusion.";
- powerRequired = this.mLastRecipe.mEUt;
- if (this.mLastRecipe.getFluidOutput(0) != null) {
- plasmaOut = (float) this.mLastRecipe.getFluidOutput(0).amount / (float) this.mLastRecipe.mDuration;
- }
- }
-
- return new String[] { "Fusion Reactor MK " + tier, "EU Required: " + powerRequired + "EU/t",
- "Stored EU: " + this.getEUVar() + " / " + maxEUStore(), "Plasma Output: " + plasmaOut + "L/t",
- "Current Recipe: " + fusionName };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab) };
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) };
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active) };
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) };
- }
-
- @Override
- public void onMachineBlockUpdate() {
- this.mUpdate = 50;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- // super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aBaseMetaTileEntity.isServerSide()) {
- // Logger.MACHINE_INFO("1");
- if (mEfficiency < 0)
- mEfficiency = 0;
- if (mRunningOnLoad) {
- Logger.MACHINE_INFO("2");
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- checkRecipeMulti();
- }
- if (--mUpdate == 0 || --mStartUpCheck == 0) {
- Logger.MACHINE_INFO("3");
- mMachine = true;
- }
- if (mStartUpCheck < 0) {
- //Logger.MACHINE_INFO("4");
- if (mMachine) {
- //Logger.MACHINE_INFO("5");
-
- if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore()) {
- if (aBaseMetaTileEntity.increaseStoredEnergyUnits(2048 * tierOverclock(), true)) {
- //Logger.MACHINE_INFO("5.5 A");
- }
- else {
- //Logger.MACHINE_INFO("5.5 B");
- }
- }
- if (this.mEUStore <= 0 && mMaxProgresstime > 0) {
- Logger.MACHINE_INFO("6");
- stopMachine();
- this.mLastRecipe = null;
- }
- if (mMaxProgresstime > 0) {
- Logger.MACHINE_INFO("7");
- this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true);
- if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
- if (mOutputFluids != null)
- for (FluidStack tStack : mOutputFluids)
- if (tStack != null)
- addOutput(tStack);
- mEfficiency = Math.max(0, (mEfficiency + mEfficiencyIncrease));
- mProgresstime = 0;
- mMaxProgresstime = 0;
- mEfficiencyIncrease = 0;
- if (mOutputFluids != null && mOutputFluids.length > 0) {
-
- }
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (aBaseMetaTileEntity.isAllowedToWork())
- checkRecipeMulti();
- }
- }
- else {
- //Logger.MACHINE_INFO("8");
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
- || aBaseMetaTileEntity.hasInventoryBeenModified()) {
- Logger.MACHINE_INFO("9");
- // turnCasingActive(mMaxProgresstime > 0);
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- Logger.MACHINE_INFO("10");
- if (checkRecipeMulti()) {
- Logger.MACHINE_INFO("11");
- if (this.mEUStore < this.mLastRecipe.mSpecialValue) {
- Logger.MACHINE_INFO("12");
- mMaxProgresstime = 0;
- // turnCasingActive(false);
- }
- aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true);
- }
- }
- if (mMaxProgresstime <= 0)
- mEfficiency = Math.max(0, mEfficiency - 1000);
- }
- }
- }
- else {
- // turnCasingActive(false);
- Logger.MACHINE_INFO("Bad");
- this.mLastRecipe = null;
- stopMachine();
- }
- }
- Logger.MACHINE_INFO("Good | "+mMaxProgresstime);
- aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
- }
- }
-
- public boolean onRunningTickMulti() {
- if (this.getBaseMetaTileEntity().isServerSide()) {
- if (mEUt < 0) {
- if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
- this.mLastRecipe = null;
- stopMachine();
- Logger.MACHINE_INFO("a1");
- return false;
- }
- }
- if (this.mEUStore <= 0) {
- this.mLastRecipe = null;
- stopMachine();
- Logger.MACHINE_INFO("a2");
- return false;
- }
- }
- return true;
- }
-
- public boolean drainEnergyInput(long aEU) {
- return false;
- }
-
- public boolean addOutput(FluidStack aLiquid) {
- if (aLiquid == null)
- return false;
- FluidStack copiedFluidStack = aLiquid.copy();
- this.mOutputFluid = copiedFluidStack;
- return false;
- }
-
- public void stopMachine() {
- mEUt = 0;
- mEfficiency = 0;
- mProgresstime = 0;
- mMaxProgresstime = 0;
- mEfficiencyIncrease = 0;
- getBaseMetaTileEntity().disableWorking();
- }
-
- @Override
- public boolean isLiquidInput(byte aSide) {
- switch (aSide) {
- case 0:
- return true;
- case 1:
- return true;
- case 2:
- return true;
- case 3:
- return false;
- case 4:
- return false;
- case 5:
- return false;
- default:
- return false;
- }
- }
-
- @Override
- public boolean isLiquidOutput(byte aSide) {
- switch (aSide) {
- case 0:
- return false;
- case 1:
- return false;
- case 2:
- return false;
- case 3:
- return true;
- case 4:
- return true;
- case 5:
- return true;
- default:
- return true;
- }
- }
-
- @Override
- public int fill(FluidStack aFluid, boolean doFill) {
- return super.fill(aFluid, doFill);
- }
-
- @Override
- public FluidStack drain(int maxDrain, boolean doDrain) {
- return super.drain(maxDrain, doDrain);
- }
-
- @Override
- public int getTankPressure() {
- return 500;
- }
-
- @Override
- public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return false;
- }
- else {
- return super.canFill(aSide, aFluid);
- }
- }
-
- @Override
- public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return super.canDrain(aSide, aFluid);
- }
- else {
- return false;
- }
- }
-
- @Override
- public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return 0;
- }
- else {
- return super.fill_default(aSide, aFluid, doFill);
- }
- }
-
- @Override
- public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return super.fill(aSide, aFluid, doFill);
- }
- else {
- return 0;
- }
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return super.drain(aSide, aFluid, doDrain);
- }
- else {
- return null;
- }
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return super.drain(aSide, maxDrain, doDrain);
- }
- else {
- return null;
- }
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return true;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- // TODO Auto-generated method stub
- return super.onRightclick(aBaseMetaTileEntity, aPlayer);
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
- float aY, float aZ) {
- // TODO Auto-generated method stub
- return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- // TODO Auto-generated method stub
- return super.getServerGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- // TODO Auto-generated method stub
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return false;
- }
-
- @Override
- public void onExplosion() {
- // TODO Auto-generated method stub
- super.onExplosion();
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY,
- aZ);
- }
- }
-
+ private boolean mCanProcessRecipe = false;
+ private boolean mCharging = false;
+ private long mChargeConsumed = 0;
+
+ private GT_Recipe mLastRecipe;
+ private long mEUStore;
+ private boolean mRunningOnLoad = false;
+ private boolean mMachine = false;
+ private int mEfficiency, mEfficiencyIncrease, mEfficiencyMax = 0;
+ private int mStartUpCheck = 100, mUpdate = 0;
+ private FluidStack[] mOutputFluids = null;
+
+ public GregtechMetaTileEntity_CompactFusionReactor(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "It's like a midget Ra.", 1, 1, "PotionBrewer.png", "");
+ }
+
+ public GregtechMetaTileEntity_CompactFusionReactor(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Not Very Fast, but not very big either.",
+ "Each side pair in/out puts to different slots.",
+ "Top & Bottom Sides are Outputs.",
+ "Front & Back are Input Plasma 1.",
+ "Sides are Input Plasma 2."
+ };
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_CompactFusionReactor(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public int tier() {
+ return this.mTier;
+ }
+
+ public int tierOverclock() {
+ return this.mTier == 6 ? 0 : this.mTier == 7 ? 1 : 2;
+ }
+
+ private GT_RenderedTexture getCasingTexture() {
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return (aFluid.getFluid().getName().contains("plasma")) || (super.isFluidInputAllowed(aFluid));
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ @Override
+ public void abortProcess() {
+ super.abortProcess();
+ }
+
+ long mFusionPoint = 20000000L;
+
+ @Override
+ public int checkRecipe() {
+ Logger.MACHINE_INFO("Recipe Tick 1.");
+ if (!this.mCanProcessRecipe) {
+ Logger.MACHINE_INFO("Recipe Tick 1.1 - Cannot Process Recipe.");
+ if (this.mChargeConsumed < mFusionPoint) {
+ Logger.MACHINE_INFO("Recipe Tick 1.2 - Cannot Ignite Fusion, Charge too low.");
+ this.mCharging = true;
+ this.mCanProcessRecipe = false;
+ if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits((mFusionPoint / 100), false)) {
+ Logger.MACHINE_INFO("Recipe Tick 1.3 - Charging Internal storage. " + (mFusionPoint / 100) + "/"
+ + mFusionPoint);
+ mChargeConsumed += (mFusionPoint / 100);
+ }
+ } else {
+ mChargeConsumed = 0;
+ this.mCharging = false;
+ this.mCanProcessRecipe = true;
+ }
+ } else {
+ Logger.MACHINE_INFO("Recipe Tick 1.1 - Try to Process Recipe.");
+ if (checkRecipeMulti()) {
+ Logger.MACHINE_INFO("Recipe Tick 1.2 - Process Recipe was Successful.");
+ return 2;
+ }
+ }
+ Logger.MACHINE_INFO("Recipe Tick 2. - Process Recipe failed.");
+ return 0;
+ }
+
+ public ArrayList<FluidStack> getStoredFluids() {
+ ArrayList<FluidStack> mList = new ArrayList<FluidStack>();
+ mList.add(this.mFluid);
+ mList.add(this.mFluid2);
+ return mList;
+ }
+
+ public boolean checkRecipeMulti() {
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ int tFluidList_sS = tFluidList.size();
+ for (int i = 0; i < tFluidList_sS - 1; i++) {
+ for (int j = i + 1; j < tFluidList_sS; j++) {
+ if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
+ if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
+ tFluidList.remove(j--);
+ tFluidList_sS = tFluidList.size();
+ } else {
+ tFluidList.remove(i--);
+ tFluidList_sS = tFluidList.size();
+ break;
+ }
+ }
+ }
+ }
+ if (tFluidList.size() > 1) {
+ FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
+ GT_Recipe tRecipe = getRecipeList()
+ .findRecipe(
+ this.getBaseMetaTileEntity(),
+ this.mLastRecipe,
+ false,
+ GT_Values.V[8],
+ tFluids,
+ new ItemStack[] {});
+ if (tRecipe == null) {
+ return false;
+ }
+ if ((tRecipe == null && !mRunningOnLoad) || (tRecipe != null && maxEUStore() < tRecipe.mSpecialValue)) {
+ this.mLastRecipe = null;
+ Logger.MACHINE_INFO("Just plain bad.");
+ return false;
+ }
+ if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) {
+ this.mLastRecipe = tRecipe;
+ this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue));
+ this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue);
+
+ this.mEfficiencyIncrease = 10000;
+
+ this.mOutputFluids = this.mLastRecipe.mFluidOutputs;
+ mRunningOnLoad = false;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int overclock(int mStartEnergy) {
+ if (tierOverclock() == 1) {
+ return 1;
+ }
+ if (tierOverclock() == 2) {
+ return mStartEnergy < 160000000 ? 2 : 1;
+ }
+ return mStartEnergy < 160000000 ? 4 : mStartEnergy < 320000000 ? 2 : 1;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean doesAutoOutputFluids() {
+ return true;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return true;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 16L;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Long.MAX_VALUE;
+ }
+
+ @Override
+ public void doExplosion(long aExplosionPower) {
+ super.doExplosion(aExplosionPower * 2);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ onRunningTickMulti();
+ if ((aBaseMetaTileEntity.isClientSide())
+ && (aBaseMetaTileEntity.isActive())
+ && (aBaseMetaTileEntity.getFrontFacing() != 1)
+ && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0)
+ && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
+ if (MathUtils.randInt(0, 4) == 4) {
+ final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity
+ .getWorld()
+ .spawnParticle(
+ "magicCrit",
+ (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F),
+ aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F),
+ (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ aBaseMetaTileEntity
+ .getWorld()
+ .spawnParticle(
+ "magicCrit",
+ (aBaseMetaTileEntity.getXCoord() + 0.4F) - (tRandom.nextFloat() * 0.3F),
+ aBaseMetaTileEntity.getYCoord() + 0.2f + (tRandom.nextFloat() * 0.1F),
+ (aBaseMetaTileEntity.getZCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ aBaseMetaTileEntity
+ .getWorld()
+ .spawnParticle(
+ "magicCrit",
+ (aBaseMetaTileEntity.getXCoord() + 0.6F) - (tRandom.nextFloat() * 0.9F),
+ aBaseMetaTileEntity.getYCoord() + 0.4f + (tRandom.nextFloat() * 0.3F),
+ (aBaseMetaTileEntity.getZCoord() + 1.8F) - (tRandom.nextFloat() * 2.6F),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("mCanProcessRecipe", this.mCanProcessRecipe);
+ aNBT.setBoolean("mCharging", this.mCharging);
+ aNBT.setLong("mChargeConsumed", this.mChargeConsumed);
+ aNBT.setInteger("mEfficiency", this.mEfficiency);
+ aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
+ aNBT.setInteger("mEfficiencyMax", this.mEfficiencyMax);
+ aNBT.setInteger("mStartUpCheck", this.mStartUpCheck);
+ aNBT.setInteger("mUpdate", mUpdate);
+ aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease);
+ aNBT.setBoolean("mRunningOnLoad", this.mRunningOnLoad);
+ aNBT.setBoolean("mMachine", this.mMachine);
+ aNBT.setLong("mEUStore", this.mEUStore);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ if (mMaxProgresstime > 0) mRunningOnLoad = true;
+ this.mCanProcessRecipe = aNBT.getBoolean("mCanProcessRecipe");
+ this.mCharging = aNBT.getBoolean("mCharging");
+ this.mChargeConsumed = aNBT.getLong("mChargeConsumed");
+ this.mEfficiency = aNBT.getInteger("mEfficiency");
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mEfficiencyMax = aNBT.getInteger("mEfficiencyMax");
+ this.mStartUpCheck = aNBT.getInteger("mStartUpCheck");
+ this.mUpdate = aNBT.getInteger("mUpdate");
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mRunningOnLoad = aNBT.getBoolean("mRunningOnLoad");
+ this.mMachine = aNBT.getBoolean("mMachine");
+ this.mEUStore = aNBT.getLong("mEUStore");
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public String[] getInfoData() {
+ String tier = tier() == 6 ? "I" : tier() == 7 ? "II" : "III";
+ float plasmaOut = 0;
+ String fusionName = "";
+ int powerRequired = 0;
+ if (this.mLastRecipe != null) {
+ fusionName = this.mLastRecipe.mFluidOutputs[0].getLocalizedName() + " Fusion.";
+ powerRequired = this.mLastRecipe.mEUt;
+ if (this.mLastRecipe.getFluidOutput(0) != null) {
+ plasmaOut = (float) this.mLastRecipe.getFluidOutput(0).amount / (float) this.mLastRecipe.mDuration;
+ }
+ }
+
+ return new String[] {
+ "Fusion Reactor MK " + tier,
+ "EU Required: " + powerRequired + "EU/t",
+ "Stored EU: " + this.getEUVar() + " / " + maxEUStore(),
+ "Plasma Output: " + plasmaOut + "L/t",
+ "Current Recipe: " + fusionName
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab)};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
+ };
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active)
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue)
+ };
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ this.mUpdate = 50;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ // super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isServerSide()) {
+ // Logger.MACHINE_INFO("1");
+ if (mEfficiency < 0) mEfficiency = 0;
+ if (mRunningOnLoad) {
+ Logger.MACHINE_INFO("2");
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ checkRecipeMulti();
+ }
+ if (--mUpdate == 0 || --mStartUpCheck == 0) {
+ Logger.MACHINE_INFO("3");
+ mMachine = true;
+ }
+ if (mStartUpCheck < 0) {
+ // Logger.MACHINE_INFO("4");
+ if (mMachine) {
+ // Logger.MACHINE_INFO("5");
+
+ if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore()) {
+ if (aBaseMetaTileEntity.increaseStoredEnergyUnits(2048 * tierOverclock(), true)) {
+ // Logger.MACHINE_INFO("5.5 A");
+ } else {
+ // Logger.MACHINE_INFO("5.5 B");
+ }
+ }
+ if (this.mEUStore <= 0 && mMaxProgresstime > 0) {
+ Logger.MACHINE_INFO("6");
+ stopMachine();
+ this.mLastRecipe = null;
+ }
+ if (mMaxProgresstime > 0) {
+ Logger.MACHINE_INFO("7");
+ this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true);
+ if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
+ if (mOutputFluids != null)
+ for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack);
+ mEfficiency = Math.max(0, (mEfficiency + mEfficiencyIncrease));
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ if (mOutputFluids != null && mOutputFluids.length > 0) {}
+
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ if (aBaseMetaTileEntity.isAllowedToWork()) checkRecipeMulti();
+ }
+ } else {
+ // Logger.MACHINE_INFO("8");
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ if (aTick % 100 == 0
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
+ || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ Logger.MACHINE_INFO("9");
+ // turnCasingActive(mMaxProgresstime > 0);
+ if (aBaseMetaTileEntity.isAllowedToWork()) {
+ Logger.MACHINE_INFO("10");
+ if (checkRecipeMulti()) {
+ Logger.MACHINE_INFO("11");
+ if (this.mEUStore < this.mLastRecipe.mSpecialValue) {
+ Logger.MACHINE_INFO("12");
+ mMaxProgresstime = 0;
+ // turnCasingActive(false);
+ }
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true);
+ }
+ }
+ if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000);
+ }
+ }
+ } else {
+ // turnCasingActive(false);
+ Logger.MACHINE_INFO("Bad");
+ this.mLastRecipe = null;
+ stopMachine();
+ }
+ }
+ Logger.MACHINE_INFO("Good | " + mMaxProgresstime);
+ aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
+ }
+ }
+
+ public boolean onRunningTickMulti() {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ if (mEUt < 0) {
+ if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
+ this.mLastRecipe = null;
+ stopMachine();
+ Logger.MACHINE_INFO("a1");
+ return false;
+ }
+ }
+ if (this.mEUStore <= 0) {
+ this.mLastRecipe = null;
+ stopMachine();
+ Logger.MACHINE_INFO("a2");
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public boolean drainEnergyInput(long aEU) {
+ return false;
+ }
+
+ public boolean addOutput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ FluidStack copiedFluidStack = aLiquid.copy();
+ this.mOutputFluid = copiedFluidStack;
+ return false;
+ }
+
+ public void stopMachine() {
+ mEUt = 0;
+ mEfficiency = 0;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ getBaseMetaTileEntity().disableWorking();
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ switch (aSide) {
+ case 0:
+ return true;
+ case 1:
+ return true;
+ case 2:
+ return true;
+ case 3:
+ return false;
+ case 4:
+ return false;
+ case 5:
+ return false;
+ default:
+ return false;
+ }
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ switch (aSide) {
+ case 0:
+ return false;
+ case 1:
+ return false;
+ case 2:
+ return false;
+ case 3:
+ return true;
+ case 4:
+ return true;
+ case 5:
+ return true;
+ default:
+ return true;
+ }
+ }
+
+ @Override
+ public int fill(FluidStack aFluid, boolean doFill) {
+ return super.fill(aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return super.drain(maxDrain, doDrain);
+ }
+
+ @Override
+ public int getTankPressure() {
+ return 500;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return false;
+ } else {
+ return super.canFill(aSide, aFluid);
+ }
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return super.canDrain(aSide, aFluid);
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return 0;
+ } else {
+ return super.fill_default(aSide, aFluid, doFill);
+ }
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return super.fill(aSide, aFluid, doFill);
+ } else {
+ return 0;
+ }
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return super.drain(aSide, aFluid, doDrain);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return super.drain(aSide, maxDrain, doDrain);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return true;
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ // TODO Auto-generated method stub
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer);
+ }
+
+ @Override
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ // TODO Auto-generated method stub
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ // TODO Auto-generated method stub
+ return super.getServerGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ // TODO Auto-generated method stub
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ return false;
+ }
+
+ @Override
+ public void onExplosion() {
+ // TODO Auto-generated method stub
+ super.onExplosion();
+ }
+
+ @Override
+ public void startProcess() {
+ this.sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient(
+ (String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java
index 6cae58ced2..08c9934db8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java
@@ -1,13 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import java.util.ArrayList;
-import java.util.Random;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
@@ -15,690 +7,722 @@ 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.GTPP_Recipe;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GTPP_Recipe;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeMachine;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.Random;
+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.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_DeluxeMachine {
- private boolean mCanProcessRecipe = false;
- private boolean mCharging = false;
- private long mChargeConsumed = 0;
-
- private GT_Recipe mLastRecipe;
- private long mEUStore;
- private boolean mRunningOnLoad = false;
- private boolean mMachine = false;
- private int mEfficiency, mEfficiencyIncrease, mEfficiencyMax = 0;
- private int mStartUpCheck = 100, mUpdate = 0;
- private FluidStack[] mOutputFluids = null;
-
- public GregtechMetaTileEntity_PocketFusion(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "It's like a midget Ra.", 1, 1, "PotionBrewer.png", "");
- }
-
- public GregtechMetaTileEntity_PocketFusion(String aName, int aTier, String aDescription,
- ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] { this.mDescription, "Not Very Fast, but not very big either.",
- "Each side pair in/out puts to different slots.", "Top & Bottom Sides are Outputs.",
- "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2.", CORE.GT_Tooltip };
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_PocketFusion(this.mName, this.mTier, this.mDescription,
- this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public int tier() {
- return this.mTier;
- }
-
- public int tierOverclock() {
- return this.mTier == 6 ? 0 : this.mTier == 7 ? 1 : 2;
- }
-
- private GT_RenderedTexture getCasingTexture() {
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeList() {
- return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getBackFacing();
- }
-
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return (aFluid.getFluid().getName().contains("plasma")) || (super.isFluidInputAllowed(aFluid));
- }
-
- @Override
- public int getCapacity() {
- return 32000;
- }
-
- @Override
- public void abortProcess() {
- super.abortProcess();
- }
-
- long mFusionPoint = 20000000L;
-
- @Override
- public int checkRecipe() {
- Logger.MACHINE_INFO("Recipe Tick 1.");
- if (!this.mCanProcessRecipe) {
- Logger.MACHINE_INFO("Recipe Tick 1.1 - Cannot Process Recipe.");
- if (this.mChargeConsumed < mFusionPoint) {
- Logger.MACHINE_INFO("Recipe Tick 1.2 - Cannot Ignite Fusion, Charge too low.");
- this.mCharging = true;
- this.mCanProcessRecipe = false;
- if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits((mFusionPoint / 100), false)) {
- Logger.MACHINE_INFO("Recipe Tick 1.3 - Charging Internal storage. " + (mFusionPoint / 100) + "/"
- + mFusionPoint);
- mChargeConsumed += (mFusionPoint / 100);
- }
- }
- else {
- mChargeConsumed = 0;
- this.mCharging = false;
- this.mCanProcessRecipe = true;
-
- }
- }
- else {
- Logger.MACHINE_INFO("Recipe Tick 1.1 - Try to Process Recipe.");
- if (checkRecipeMulti()) {
- Logger.MACHINE_INFO("Recipe Tick 1.2 - Process Recipe was Successful.");
- return 2;
- }
- }
- Logger.MACHINE_INFO("Recipe Tick 2. - Process Recipe failed.");
- return 0;
- }
-
- public ArrayList<FluidStack> getStoredFluids() {
- ArrayList<FluidStack> mList = new ArrayList<FluidStack>();
- mList.add(this.mFluid);
- mList.add(this.mFluid2);
- return mList;
- }
-
- public boolean checkRecipeMulti() {
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- int tFluidList_sS = tFluidList.size();
- for (int i = 0; i < tFluidList_sS - 1; i++) {
- for (int j = i + 1; j < tFluidList_sS; j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
- tFluidList.remove(j--);
- tFluidList_sS = tFluidList.size();
- }
- else {
- tFluidList.remove(i--);
- tFluidList_sS = tFluidList.size();
- break;
- }
- }
- }
- }
- if (tFluidList.size() > 1) {
- FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
- GT_Recipe tRecipe = getRecipeList().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false,
- GT_Values.V[8], tFluids, new ItemStack[] {});
-
- if (tRecipe == null) {
- return false;
- }
-
- if ((tRecipe == null && !mRunningOnLoad) || (tRecipe != null && maxEUStore() < tRecipe.mSpecialValue)) {
- this.mLastRecipe = null;
- Logger.MACHINE_INFO("Just plain bad.");
- return false;
- }
- if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) {
- this.mLastRecipe = tRecipe;
- this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue));
- this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue);
-
- this.mEfficiencyIncrease = 10000;
-
- this.mOutputFluids = this.mLastRecipe.mFluidOutputs;
- mRunningOnLoad = false;
- return true;
- }
- }
- return false;
- }
-
- public int overclock(int mStartEnergy) {
- if (tierOverclock() == 1) {
- return 1;
- }
- if (tierOverclock() == 2) {
- return mStartEnergy < 160000000 ? 2 : 1;
- }
- return mStartEnergy < 160000000 ? 4 : mStartEnergy < 320000000 ? 2 : 1;
- }
-
- @Override
- public boolean displaysItemStack() {
- return false;
- }
-
- @Override
- public boolean doesAutoOutputFluids() {
- return true;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return true;
- }
-
- @Override
- public boolean doesFillContainers() {
- return true;
- }
-
- @Override
- public long maxAmperesIn() {
- return 16L;
- }
-
- @Override
- public long maxEUStore() {
- return Long.MAX_VALUE;
- }
-
- @Override
- public void doExplosion(long aExplosionPower) {
- super.doExplosion(aExplosionPower * 2);
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- onRunningTickMulti();
- if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())
- && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0)
- && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
- if (MathUtils.randInt(0, 4) == 4) {
- final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
- aBaseMetaTileEntity.getWorld().spawnParticle("magicCrit",
- (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F),
- aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F),
- (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F), 0.0D, 0.0D, 0.0D);
- aBaseMetaTileEntity.getWorld().spawnParticle("magicCrit",
- (aBaseMetaTileEntity.getXCoord() + 0.4F) - (tRandom.nextFloat() * 0.3F),
- aBaseMetaTileEntity.getYCoord() + 0.2f + (tRandom.nextFloat() * 0.1F),
- (aBaseMetaTileEntity.getZCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), 0.0D, 0.0D, 0.0D);
- aBaseMetaTileEntity.getWorld().spawnParticle("magicCrit",
- (aBaseMetaTileEntity.getXCoord() + 0.6F) - (tRandom.nextFloat() * 0.9F),
- aBaseMetaTileEntity.getYCoord() + 0.4f + (tRandom.nextFloat() * 0.3F),
- (aBaseMetaTileEntity.getZCoord() + 1.8F) - (tRandom.nextFloat() * 2.6F), 0.0D, 0.0D, 0.0D);
- }
- }
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setBoolean("mCanProcessRecipe", this.mCanProcessRecipe);
- aNBT.setBoolean("mCharging", this.mCharging);
- aNBT.setLong("mChargeConsumed", this.mChargeConsumed);
- aNBT.setInteger("mEfficiency", this.mEfficiency);
- aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
- aNBT.setInteger("mEfficiencyMax", this.mEfficiencyMax);
- aNBT.setInteger("mStartUpCheck", this.mStartUpCheck);
- aNBT.setInteger("mUpdate", mUpdate);
- aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease);
- aNBT.setBoolean("mRunningOnLoad", this.mRunningOnLoad);
- aNBT.setBoolean("mMachine", this.mMachine);
- aNBT.setLong("mEUStore", this.mEUStore);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- if (mMaxProgresstime > 0)
- mRunningOnLoad = true;
- this.mCanProcessRecipe = aNBT.getBoolean("mCanProcessRecipe");
- this.mCharging = aNBT.getBoolean("mCharging");
- this.mChargeConsumed = aNBT.getLong("mChargeConsumed");
- this.mEfficiency = aNBT.getInteger("mEfficiency");
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mEfficiencyMax = aNBT.getInteger("mEfficiencyMax");
- this.mStartUpCheck = aNBT.getInteger("mStartUpCheck");
- this.mUpdate = aNBT.getInteger("mUpdate");
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mRunningOnLoad = aNBT.getBoolean("mRunningOnLoad");
- this.mMachine = aNBT.getBoolean("mMachine");
- this.mEUStore = aNBT.getLong("mEUStore");
- super.loadNBTData(aNBT);
- }
-
- @Override
- public String[] getInfoData() {
- String tier = tier() == 6 ? "I" : tier() == 7 ? "II" : "III";
- float plasmaOut = 0;
- String fusionName = "";
- int powerRequired = 0;
- if (this.mLastRecipe != null) {
- fusionName = this.mLastRecipe.mFluidOutputs[0].getLocalizedName() + " Fusion.";
- powerRequired = this.mLastRecipe.mEUt;
- if (this.mLastRecipe.getFluidOutput(0) != null) {
- plasmaOut = (float) this.mLastRecipe.getFluidOutput(0).amount / (float) this.mLastRecipe.mDuration;
- }
- }
-
- return new String[] { "Fusion Reactor MK " + tier, "EU Required: " + powerRequired + "EU/t",
- "Stored EU: " + this.getEUVar() + " / " + maxEUStore(), "Plasma Output: " + plasmaOut + "L/t",
- "Current Recipe: " + fusionName };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab) };
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) };
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active) };
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] { this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) };
- }
-
- @Override
- public void onMachineBlockUpdate() {
- this.mUpdate = 50;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- // super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aBaseMetaTileEntity.isServerSide()) {
- // Logger.MACHINE_INFO("1");
- if (mEfficiency < 0)
- mEfficiency = 0;
- if (mRunningOnLoad) {
- Logger.MACHINE_INFO("2");
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- checkRecipeMulti();
- }
- if (--mUpdate == 0 || --mStartUpCheck == 0) {
- Logger.MACHINE_INFO("3");
- mMachine = true;
- }
- if (mStartUpCheck < 0) {
- //Logger.MACHINE_INFO("4");
- if (mMachine) {
- //Logger.MACHINE_INFO("5");
-
- if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore()) {
- if (aBaseMetaTileEntity.increaseStoredEnergyUnits(2048 * tierOverclock(), true)) {
- //Logger.MACHINE_INFO("5.5 A");
- }
- else {
- //Logger.MACHINE_INFO("5.5 B");
- }
- }
- if (this.mEUStore <= 0 && mMaxProgresstime > 0) {
- Logger.MACHINE_INFO("6");
- stopMachine();
- this.mLastRecipe = null;
- }
- if (mMaxProgresstime > 0) {
- Logger.MACHINE_INFO("7");
- this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true);
- if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
- if (mOutputFluids != null)
- for (FluidStack tStack : mOutputFluids)
- if (tStack != null)
- addOutput(tStack);
- mEfficiency = Math.max(0, (mEfficiency + mEfficiencyIncrease));
- mProgresstime = 0;
- mMaxProgresstime = 0;
- mEfficiencyIncrease = 0;
- if (mOutputFluids != null && mOutputFluids.length > 0) {
-
- }
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (aBaseMetaTileEntity.isAllowedToWork())
- checkRecipeMulti();
- }
- }
- else {
- //Logger.MACHINE_INFO("8");
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
- || aBaseMetaTileEntity.hasInventoryBeenModified()) {
- Logger.MACHINE_INFO("9");
- // turnCasingActive(mMaxProgresstime > 0);
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- Logger.MACHINE_INFO("10");
- if (checkRecipeMulti()) {
- Logger.MACHINE_INFO("11");
- if (this.mEUStore < this.mLastRecipe.mSpecialValue) {
- Logger.MACHINE_INFO("12");
- mMaxProgresstime = 0;
- // turnCasingActive(false);
- }
- aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true);
- }
- }
- if (mMaxProgresstime <= 0)
- mEfficiency = Math.max(0, mEfficiency - 1000);
- }
- }
- }
- else {
- // turnCasingActive(false);
- Logger.MACHINE_INFO("Bad");
- this.mLastRecipe = null;
- stopMachine();
- }
- }
- Logger.MACHINE_INFO("Good | "+mMaxProgresstime);
- aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
- }
- }
-
- public boolean onRunningTickMulti() {
- if (this.getBaseMetaTileEntity().isServerSide()) {
- if (mEUt < 0) {
- if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
- this.mLastRecipe = null;
- stopMachine();
- Logger.MACHINE_INFO("a1");
- return false;
- }
- }
- if (this.mEUStore <= 0) {
- this.mLastRecipe = null;
- stopMachine();
- Logger.MACHINE_INFO("a2");
- return false;
- }
- }
- return true;
- }
-
- public boolean drainEnergyInput(long aEU) {
- return false;
- }
-
- public boolean addOutput(FluidStack aLiquid) {
- if (aLiquid == null)
- return false;
- FluidStack copiedFluidStack = aLiquid.copy();
- this.mOutputFluid = copiedFluidStack;
- return false;
- }
-
- public void stopMachine() {
- mEUt = 0;
- mEfficiency = 0;
- mProgresstime = 0;
- mMaxProgresstime = 0;
- mEfficiencyIncrease = 0;
- getBaseMetaTileEntity().disableWorking();
- }
-
- @Override
- public boolean isLiquidInput(byte aSide) {
- switch (aSide) {
- case 0:
- return true;
- case 1:
- return true;
- case 2:
- return true;
- case 3:
- return false;
- case 4:
- return false;
- case 5:
- return false;
- default:
- return false;
- }
- }
-
- @Override
- public boolean isLiquidOutput(byte aSide) {
- switch (aSide) {
- case 0:
- return false;
- case 1:
- return false;
- case 2:
- return false;
- case 3:
- return true;
- case 4:
- return true;
- case 5:
- return true;
- default:
- return true;
- }
- }
-
- @Override
- public int fill(FluidStack aFluid, boolean doFill) {
- return super.fill(aFluid, doFill);
- }
-
- @Override
- public FluidStack drain(int maxDrain, boolean doDrain) {
- return super.drain(maxDrain, doDrain);
- }
-
- @Override
- public int getTankPressure() {
- return 500;
- }
-
- @Override
- public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return false;
- }
- else {
- return super.canFill(aSide, aFluid);
- }
- }
-
- @Override
- public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return super.canDrain(aSide, aFluid);
- }
- else {
- return false;
- }
- }
-
- @Override
- public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return 0;
- }
- else {
- return super.fill_default(aSide, aFluid, doFill);
- }
- }
-
- @Override
- public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return super.fill(aSide, aFluid, doFill);
- }
- else {
- return 0;
- }
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return super.drain(aSide, aFluid, doDrain);
- }
- else {
- return null;
- }
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return super.drain(aSide, maxDrain, doDrain);
- }
- else {
- return null;
- }
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return true;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- // TODO Auto-generated method stub
- return super.onRightclick(aBaseMetaTileEntity, aPlayer);
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
- float aY, float aZ) {
- // TODO Auto-generated method stub
- return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- // TODO Auto-generated method stub
- return super.getServerGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- // TODO Auto-generated method stub
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return false;
- }
-
- @Override
- public void onExplosion() {
- // TODO Auto-generated method stub
- super.onExplosion();
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY,
- aZ);
- }
- }
-
+ private boolean mCanProcessRecipe = false;
+ private boolean mCharging = false;
+ private long mChargeConsumed = 0;
+
+ private GT_Recipe mLastRecipe;
+ private long mEUStore;
+ private boolean mRunningOnLoad = false;
+ private boolean mMachine = false;
+ private int mEfficiency, mEfficiencyIncrease, mEfficiencyMax = 0;
+ private int mStartUpCheck = 100, mUpdate = 0;
+ private FluidStack[] mOutputFluids = null;
+
+ public GregtechMetaTileEntity_PocketFusion(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "It's like a midget Ra.", 1, 1, "PotionBrewer.png", "");
+ }
+
+ public GregtechMetaTileEntity_PocketFusion(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Not Very Fast, but not very big either.",
+ "Each side pair in/out puts to different slots.",
+ "Top & Bottom Sides are Outputs.",
+ "Front & Back are Input Plasma 1.",
+ "Sides are Input Plasma 2.",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_PocketFusion(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public int tier() {
+ return this.mTier;
+ }
+
+ public int tierOverclock() {
+ return this.mTier == 6 ? 0 : this.mTier == 7 ? 1 : 2;
+ }
+
+ private GT_RenderedTexture getCasingTexture() {
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return (aFluid.getFluid().getName().contains("plasma")) || (super.isFluidInputAllowed(aFluid));
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ @Override
+ public void abortProcess() {
+ super.abortProcess();
+ }
+
+ long mFusionPoint = 20000000L;
+
+ @Override
+ public int checkRecipe() {
+ Logger.MACHINE_INFO("Recipe Tick 1.");
+ if (!this.mCanProcessRecipe) {
+ Logger.MACHINE_INFO("Recipe Tick 1.1 - Cannot Process Recipe.");
+ if (this.mChargeConsumed < mFusionPoint) {
+ Logger.MACHINE_INFO("Recipe Tick 1.2 - Cannot Ignite Fusion, Charge too low.");
+ this.mCharging = true;
+ this.mCanProcessRecipe = false;
+ if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits((mFusionPoint / 100), false)) {
+ Logger.MACHINE_INFO("Recipe Tick 1.3 - Charging Internal storage. " + (mFusionPoint / 100) + "/"
+ + mFusionPoint);
+ mChargeConsumed += (mFusionPoint / 100);
+ }
+ } else {
+ mChargeConsumed = 0;
+ this.mCharging = false;
+ this.mCanProcessRecipe = true;
+ }
+ } else {
+ Logger.MACHINE_INFO("Recipe Tick 1.1 - Try to Process Recipe.");
+ if (checkRecipeMulti()) {
+ Logger.MACHINE_INFO("Recipe Tick 1.2 - Process Recipe was Successful.");
+ return 2;
+ }
+ }
+ Logger.MACHINE_INFO("Recipe Tick 2. - Process Recipe failed.");
+ return 0;
+ }
+
+ public ArrayList<FluidStack> getStoredFluids() {
+ ArrayList<FluidStack> mList = new ArrayList<FluidStack>();
+ mList.add(this.mFluid);
+ mList.add(this.mFluid2);
+ return mList;
+ }
+
+ public boolean checkRecipeMulti() {
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ int tFluidList_sS = tFluidList.size();
+ for (int i = 0; i < tFluidList_sS - 1; i++) {
+ for (int j = i + 1; j < tFluidList_sS; j++) {
+ if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
+ if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
+ tFluidList.remove(j--);
+ tFluidList_sS = tFluidList.size();
+ } else {
+ tFluidList.remove(i--);
+ tFluidList_sS = tFluidList.size();
+ break;
+ }
+ }
+ }
+ }
+ if (tFluidList.size() > 1) {
+ FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
+ GT_Recipe tRecipe = getRecipeList()
+ .findRecipe(
+ this.getBaseMetaTileEntity(),
+ this.mLastRecipe,
+ false,
+ GT_Values.V[8],
+ tFluids,
+ new ItemStack[] {});
+
+ if (tRecipe == null) {
+ return false;
+ }
+
+ if ((tRecipe == null && !mRunningOnLoad) || (tRecipe != null && maxEUStore() < tRecipe.mSpecialValue)) {
+ this.mLastRecipe = null;
+ Logger.MACHINE_INFO("Just plain bad.");
+ return false;
+ }
+ if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) {
+ this.mLastRecipe = tRecipe;
+ this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue));
+ this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue);
+
+ this.mEfficiencyIncrease = 10000;
+
+ this.mOutputFluids = this.mLastRecipe.mFluidOutputs;
+ mRunningOnLoad = false;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int overclock(int mStartEnergy) {
+ if (tierOverclock() == 1) {
+ return 1;
+ }
+ if (tierOverclock() == 2) {
+ return mStartEnergy < 160000000 ? 2 : 1;
+ }
+ return mStartEnergy < 160000000 ? 4 : mStartEnergy < 320000000 ? 2 : 1;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean doesAutoOutputFluids() {
+ return true;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return true;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 16L;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Long.MAX_VALUE;
+ }
+
+ @Override
+ public void doExplosion(long aExplosionPower) {
+ super.doExplosion(aExplosionPower * 2);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ onRunningTickMulti();
+ if ((aBaseMetaTileEntity.isClientSide())
+ && (aBaseMetaTileEntity.isActive())
+ && (aBaseMetaTileEntity.getFrontFacing() != 1)
+ && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0)
+ && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
+ if (MathUtils.randInt(0, 4) == 4) {
+ final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity
+ .getWorld()
+ .spawnParticle(
+ "magicCrit",
+ (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F),
+ aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F),
+ (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ aBaseMetaTileEntity
+ .getWorld()
+ .spawnParticle(
+ "magicCrit",
+ (aBaseMetaTileEntity.getXCoord() + 0.4F) - (tRandom.nextFloat() * 0.3F),
+ aBaseMetaTileEntity.getYCoord() + 0.2f + (tRandom.nextFloat() * 0.1F),
+ (aBaseMetaTileEntity.getZCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ aBaseMetaTileEntity
+ .getWorld()
+ .spawnParticle(
+ "magicCrit",
+ (aBaseMetaTileEntity.getXCoord() + 0.6F) - (tRandom.nextFloat() * 0.9F),
+ aBaseMetaTileEntity.getYCoord() + 0.4f + (tRandom.nextFloat() * 0.3F),
+ (aBaseMetaTileEntity.getZCoord() + 1.8F) - (tRandom.nextFloat() * 2.6F),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("mCanProcessRecipe", this.mCanProcessRecipe);
+ aNBT.setBoolean("mCharging", this.mCharging);
+ aNBT.setLong("mChargeConsumed", this.mChargeConsumed);
+ aNBT.setInteger("mEfficiency", this.mEfficiency);
+ aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
+ aNBT.setInteger("mEfficiencyMax", this.mEfficiencyMax);
+ aNBT.setInteger("mStartUpCheck", this.mStartUpCheck);
+ aNBT.setInteger("mUpdate", mUpdate);
+ aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease);
+ aNBT.setBoolean("mRunningOnLoad", this.mRunningOnLoad);
+ aNBT.setBoolean("mMachine", this.mMachine);
+ aNBT.setLong("mEUStore", this.mEUStore);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ if (mMaxProgresstime > 0) mRunningOnLoad = true;
+ this.mCanProcessRecipe = aNBT.getBoolean("mCanProcessRecipe");
+ this.mCharging = aNBT.getBoolean("mCharging");
+ this.mChargeConsumed = aNBT.getLong("mChargeConsumed");
+ this.mEfficiency = aNBT.getInteger("mEfficiency");
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mEfficiencyMax = aNBT.getInteger("mEfficiencyMax");
+ this.mStartUpCheck = aNBT.getInteger("mStartUpCheck");
+ this.mUpdate = aNBT.getInteger("mUpdate");
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mRunningOnLoad = aNBT.getBoolean("mRunningOnLoad");
+ this.mMachine = aNBT.getBoolean("mMachine");
+ this.mEUStore = aNBT.getLong("mEUStore");
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public String[] getInfoData() {
+ String tier = tier() == 6 ? "I" : tier() == 7 ? "II" : "III";
+ float plasmaOut = 0;
+ String fusionName = "";
+ int powerRequired = 0;
+ if (this.mLastRecipe != null) {
+ fusionName = this.mLastRecipe.mFluidOutputs[0].getLocalizedName() + " Fusion.";
+ powerRequired = this.mLastRecipe.mEUt;
+ if (this.mLastRecipe.getFluidOutput(0) != null) {
+ plasmaOut = (float) this.mLastRecipe.getFluidOutput(0).amount / (float) this.mLastRecipe.mDuration;
+ }
+ }
+
+ return new String[] {
+ "Fusion Reactor MK " + tier,
+ "EU Required: " + powerRequired + "EU/t",
+ "Stored EU: " + this.getEUVar() + " / " + maxEUStore(),
+ "Plasma Output: " + plasmaOut + "L/t",
+ "Current Recipe: " + fusionName
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab)};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
+ };
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active)
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue)
+ };
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ this.mUpdate = 50;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ // super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isServerSide()) {
+ // Logger.MACHINE_INFO("1");
+ if (mEfficiency < 0) mEfficiency = 0;
+ if (mRunningOnLoad) {
+ Logger.MACHINE_INFO("2");
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ checkRecipeMulti();
+ }
+ if (--mUpdate == 0 || --mStartUpCheck == 0) {
+ Logger.MACHINE_INFO("3");
+ mMachine = true;
+ }
+ if (mStartUpCheck < 0) {
+ // Logger.MACHINE_INFO("4");
+ if (mMachine) {
+ // Logger.MACHINE_INFO("5");
+
+ if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore()) {
+ if (aBaseMetaTileEntity.increaseStoredEnergyUnits(2048 * tierOverclock(), true)) {
+ // Logger.MACHINE_INFO("5.5 A");
+ } else {
+ // Logger.MACHINE_INFO("5.5 B");
+ }
+ }
+ if (this.mEUStore <= 0 && mMaxProgresstime > 0) {
+ Logger.MACHINE_INFO("6");
+ stopMachine();
+ this.mLastRecipe = null;
+ }
+ if (mMaxProgresstime > 0) {
+ Logger.MACHINE_INFO("7");
+ this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true);
+ if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
+ if (mOutputFluids != null)
+ for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack);
+ mEfficiency = Math.max(0, (mEfficiency + mEfficiencyIncrease));
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ if (mOutputFluids != null && mOutputFluids.length > 0) {}
+
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ if (aBaseMetaTileEntity.isAllowedToWork()) checkRecipeMulti();
+ }
+ } else {
+ // Logger.MACHINE_INFO("8");
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ if (aTick % 100 == 0
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
+ || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ Logger.MACHINE_INFO("9");
+ // turnCasingActive(mMaxProgresstime > 0);
+ if (aBaseMetaTileEntity.isAllowedToWork()) {
+ Logger.MACHINE_INFO("10");
+ if (checkRecipeMulti()) {
+ Logger.MACHINE_INFO("11");
+ if (this.mEUStore < this.mLastRecipe.mSpecialValue) {
+ Logger.MACHINE_INFO("12");
+ mMaxProgresstime = 0;
+ // turnCasingActive(false);
+ }
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true);
+ }
+ }
+ if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000);
+ }
+ }
+ } else {
+ // turnCasingActive(false);
+ Logger.MACHINE_INFO("Bad");
+ this.mLastRecipe = null;
+ stopMachine();
+ }
+ }
+ Logger.MACHINE_INFO("Good | " + mMaxProgresstime);
+ aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
+ }
+ }
+
+ public boolean onRunningTickMulti() {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ if (mEUt < 0) {
+ if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
+ this.mLastRecipe = null;
+ stopMachine();
+ Logger.MACHINE_INFO("a1");
+ return false;
+ }
+ }
+ if (this.mEUStore <= 0) {
+ this.mLastRecipe = null;
+ stopMachine();
+ Logger.MACHINE_INFO("a2");
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public boolean drainEnergyInput(long aEU) {
+ return false;
+ }
+
+ public boolean addOutput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ FluidStack copiedFluidStack = aLiquid.copy();
+ this.mOutputFluid = copiedFluidStack;
+ return false;
+ }
+
+ public void stopMachine() {
+ mEUt = 0;
+ mEfficiency = 0;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ getBaseMetaTileEntity().disableWorking();
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ switch (aSide) {
+ case 0:
+ return true;
+ case 1:
+ return true;
+ case 2:
+ return true;
+ case 3:
+ return false;
+ case 4:
+ return false;
+ case 5:
+ return false;
+ default:
+ return false;
+ }
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ switch (aSide) {
+ case 0:
+ return false;
+ case 1:
+ return false;
+ case 2:
+ return false;
+ case 3:
+ return true;
+ case 4:
+ return true;
+ case 5:
+ return true;
+ default:
+ return true;
+ }
+ }
+
+ @Override
+ public int fill(FluidStack aFluid, boolean doFill) {
+ return super.fill(aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return super.drain(maxDrain, doDrain);
+ }
+
+ @Override
+ public int getTankPressure() {
+ return 500;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return false;
+ } else {
+ return super.canFill(aSide, aFluid);
+ }
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return super.canDrain(aSide, aFluid);
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return 0;
+ } else {
+ return super.fill_default(aSide, aFluid, doFill);
+ }
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return super.fill(aSide, aFluid, doFill);
+ } else {
+ return 0;
+ }
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return super.drain(aSide, aFluid, doDrain);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
+ return super.drain(aSide, maxDrain, doDrain);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return true;
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ // TODO Auto-generated method stub
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer);
+ }
+
+ @Override
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ // TODO Auto-generated method stub
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ // TODO Auto-generated method stub
+ return super.getServerGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ // TODO Auto-generated method stub
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ return false;
+ }
+
+ @Override
+ public void onExplosion() {
+ // TODO Auto-generated method stub
+ super.onExplosion();
+ }
+
+ @Override
+ public void startProcess() {
+ this.sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient(
+ (String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java
index f7acc3390d..f9ecc4be18 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java
@@ -14,59 +14,58 @@ import net.minecraftforge.fluids.FluidStack;
public class GregtechMetaTileEntity_ReactorColdTrap extends GT_MetaTileEntity_BasicMachine {
- public GregtechMetaTileEntity_ReactorColdTrap(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1,
- "Just like the Arctic", 2, 9, "Dehydrator.png", "",
- new ITexture[]{
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP)
- }
- );
- }
+ public GregtechMetaTileEntity_ReactorColdTrap(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "Just like the Arctic", 2, 9, "Dehydrator.png", "", new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP)
+ });
+ }
- public GregtechMetaTileEntity_ReactorColdTrap(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 2, 9, aGUIName, aNEIName);
- }
+ public GregtechMetaTileEntity_ReactorColdTrap(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 2, 9, aGUIName, aNEIName);
+ }
- @Override
- public String[] getDescription() {
- return new String[]{this.mDescription, "Does not require ice cubes", CORE.GT_Tooltip};
- }
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, "Does not require ice cubes", CORE.GT_Tooltip};
+ }
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_ReactorColdTrap(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_ReactorColdTrap(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
- @Override
- public boolean allowSelectCircuit() {
- return true;
- }
+ @Override
+ public boolean allowSelectCircuit() {
+ return true;
+ }
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeList() {
- return GTPP_Recipe.GTPP_Recipe_Map.sColdTrapRecipes;
- }
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sColdTrapRecipes;
+ }
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
- }
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
+ && (getRecipeList().containsInput(aStack));
+ }
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return super.isFluidInputAllowed(aFluid);
- }
-
- @Override
- public int getCapacity() {
- return 16000 * Math.max(1, this.mTier);
- }
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return super.isFluidInputAllowed(aFluid);
+ }
+ @Override
+ public int getCapacity() {
+ return 16000 * Math.max(1, this.mTier);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java
index cfe86f37f5..8f8711a7fe 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java
@@ -14,59 +14,69 @@ import net.minecraftforge.fluids.FluidStack;
public class GregtechMetaTileEntity_ReactorProcessingUnit extends GT_MetaTileEntity_BasicMachine {
- public GregtechMetaTileEntity_ReactorProcessingUnit(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1,
- "Processes Nuclear things", 2, 9, "Dehydrator.png", "",
- new ITexture[]{
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE),
- new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP)
- }
- );
- }
+ public GregtechMetaTileEntity_ReactorProcessingUnit(int aID, String aName, String aNameRegional, int aTier) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 1,
+ "Processes Nuclear things",
+ 2,
+ 9,
+ "Dehydrator.png",
+ "",
+ new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE),
+ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP)
+ });
+ }
- public GregtechMetaTileEntity_ReactorProcessingUnit(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 2, 9, aGUIName, aNEIName);
- }
+ public GregtechMetaTileEntity_ReactorProcessingUnit(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 2, 9, aGUIName, aNEIName);
+ }
- @Override
- public String[] getDescription() {
- return new String[]{this.mDescription, CORE.GT_Tooltip};
- }
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, CORE.GT_Tooltip};
+ }
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_ReactorProcessingUnit(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_ReactorProcessingUnit(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
- @Override
- public boolean allowSelectCircuit() {
- return true;
- }
+ @Override
+ public boolean allowSelectCircuit() {
+ return true;
+ }
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeList() {
- return GTPP_Recipe.GTPP_Recipe_Map.sReactorProcessingUnitRecipes;
- }
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sReactorProcessingUnitRecipes;
+ }
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
- }
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
+ && (getRecipeList().containsInput(aStack));
+ }
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return super.isFluidInputAllowed(aFluid);
- }
-
- @Override
- public int getCapacity() {
- return 8000 * Math.max(1, this.mTier);
- }
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return super.isFluidInputAllowed(aFluid);
+ }
+ @Override
+ public int getCapacity() {
+ return 8000 * Math.max(1, this.mTier);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
index 13da9cd868..db74a46f1b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import java.util.*;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -17,6 +15,7 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper;
+import java.util.*;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -25,569 +24,683 @@ import net.minecraft.nbt.NBTTagCompound;
public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
- private boolean mHasBeenMapped = false;
- private int mCurrentDimension = 0;
- public int mMode = 0;
- public boolean mLocked = true;
-
- public GregtechMetaWirelessCharger(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
- }
-
- public GregtechMetaWirelessCharger(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
- super(aName, aTier, aSlotCount, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {this.mDescription,
- "Can be locked to the owner by sneaking with a screwdriver",
- "Can also be locked with a lock upgrade",
- "",
- "3 Modes, Long-Range, Local and Mixed.",
- "Long-Range: Can supply 2A of power to a single player up to "+(GT_Values.V[this.mTier]*4)+"m away.",
- "Local: Can supply several Amps to each player within "+this.mTier*20+"m.",
- "Mixed: Provides both 2A of long range and 1A per player locally.",
- "Mixed mode is more conservative of power and as a result only",
- "Gets half the distances each singular mode gets.",
- CORE.GT_Tooltip
- };
- }
-
- public int getTier(){
- return this.mTier;
- }
-
- public int getMode(){
- return this.mMode;
- }
-
- public int getDimensionID(){
- return this.mCurrentDimension;
- }
-
- public Map<String, UUID> getLocalMap(){
- return this.mLocalChargingMap;
- }
-
- public Map<String, UUID> getLongRangeMap(){
- return this.mWirelessChargingMap;
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)};
- }
-
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)};
- }
-
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
-
- if (aPlayer.isSneaking()) {
- mLocked = !mLocked;
- PlayerUtils.messagePlayer(aPlayer, mLocked ? "Locked to owner." : "Unlocked.");
- return;
- }
-
- mWirelessChargingMap.clear();
- mLocalChargingMap.clear();
- if (!this.getBaseMetaTileEntity().getWorld().playerEntities.isEmpty()){
- for (Object mTempPlayer : this.getBaseMetaTileEntity().getWorld().playerEntities){
- if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP){
- EntityPlayer mTemp = (EntityPlayer) mTempPlayer;
- ChargingHelper.removeValidPlayer(mTemp, this);
- }
- }
- }
-
- if (this.mMode >= 2){
- this.mMode = 0;
- }
- else {
- this.mMode++;
- }
- if (this.mMode == 0){
- PlayerUtils.messagePlayer(aPlayer, "Now in Long-Range Charge Mode.");
- }
- else if (this.mMode == 1){
- PlayerUtils.messagePlayer(aPlayer, "Now in Local Charge Mode.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Now in Mixed Charge Mode.");
- }
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaWirelessCharger(this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
- }
-
- @Override public boolean isSimpleMachine() {return false;}
- @Override public boolean isElectric() {return true;}
- @Override public boolean isValidSlot(final int aIndex) {return true;}
- @Override public boolean isFacingValid(final byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return true;}
- @Override public boolean isEnetOutput() {return false;}
- @Override public boolean isInputFacing(final byte aSide) {return aSide!=this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isOutputFacing(final byte aSide) {return aSide==this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return 0;}
- @Override public long maxEUStore() {return GT_Values.V[this.mTier]*128;}
-
- @Override
- public int getCapacity() {
- return (int) (GT_Values.V[this.mTier]*32);
- }
-
- @Override
- public long maxEUInput() {
- return GT_Values.V[this.mTier];
- }
-
- @Override
- public long maxEUOutput() {
- return 0;
- }
-
- @Override
- public long maxAmperesIn() {
- if (this.mMode == 0){
- return 2;
- }
- else if (this.mMode == 1){
- return this.mLocalChargingMap.size()*8;
- }
- else {
- return ((this.mLocalChargingMap.size()*4)+this.mWirelessChargingMap.size());
- }
- }
-
- @Override
- public long maxAmperesOut() {
- return 0;
- }
- @Override public int rechargerSlotStartIndex() {return 0;}
- @Override public int dechargerSlotStartIndex() {return 0;}
- @Override public int rechargerSlotCount() {return 0;}
- @Override public int dechargerSlotCount() {return 0;}
- @Override public int getProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyStored();}
- @Override public int maxProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyCapacity();}
- @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;}
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide())
- {
- return true;
- }
- return true;
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[] {
- this.getLocalName()};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- return new int[] {};
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(final int p_70301_1_) {
- return null;
- }
-
- @Override
- public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
- return null;
- }
-
- @Override
- public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {
- }
-
- @Override
- public String getInventoryName() {
- return null;
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 0;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
- return false;
- }
-
- @Override
- public void openInventory() {
- }
-
- @Override
- public void closeInventory() {
- }
-
- @Override
- public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
- return false;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setBoolean("mLocked", this.mLocked);
- aNBT.setInteger("mMode", this.mMode);
- aNBT.setInteger("mCurrentDimension", this.mCurrentDimension);
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mLocked = aNBT.getBoolean("mLocked");
- this.mMode = aNBT.getInteger("mMode");
- this.mCurrentDimension = aNBT.getInteger("mCurrentDimension");
- }
-
- @Override
- public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
- super.onFirstTick(aBaseMetaTileEntity);
- }
-
- private Map<String, UUID> mWirelessChargingMap = new HashMap<String, UUID>();
- private Map<String, UUID> mLocalChargingMap = new HashMap<String, UUID>();
-
- private boolean isValidPlayer(EntityPlayer aPlayer) {
- BaseMetaTileEntity aTile = (BaseMetaTileEntity) this.getBaseMetaTileEntity();
- if (mLocked || ( aTile != null && aTile.privateAccess())) {
- if (aPlayer.getUniqueID().equals(getBaseMetaTileEntity().getOwnerUuid())){
- return true;
- }
- else {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (this.getBaseMetaTileEntity().isServerSide()) {
-
- if (this.mCurrentDimension != aBaseMetaTileEntity.getWorld().provider.dimensionId){
- this.mCurrentDimension = aBaseMetaTileEntity.getWorld().provider.dimensionId;
- }
-
- if (!mHasBeenMapped && ChargingHelper.addEntry(getTileEntityPosition(), this)){
- mHasBeenMapped = true;
- }
-
- if (aTick % 20 == 0 && mHasBeenMapped){
- if (!aBaseMetaTileEntity.getWorld().playerEntities.isEmpty()){
- for (Object mTempPlayer : aBaseMetaTileEntity.getWorld().playerEntities){
- if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP){
- EntityPlayer mTemp = (EntityPlayer) mTempPlayer;
-
- if (this.mMode == 1 || this.mMode == 2){
- int tempRange = (this.mMode == 1 ? this.mTier*20 : this.mTier*10);
- if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){
- if (isValidPlayer(mTemp) && !mLocalChargingMap.containsKey(mTemp.getDisplayName())){
- mLocalChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID());
- ChargingHelper.addValidPlayer(mTemp, this);
- //PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m - Local].");
- }
- }
- else {
- if (mLocalChargingMap.containsKey(mTemp.getDisplayName())){
- if (mLocalChargingMap.remove(mTemp.getDisplayName()) != null){
- //PlayerUtils.messagePlayer(mTemp, "You have left charging range. ["+tempRange+"m - Local].");
- ChargingHelper.removeValidPlayer(mTemp, this);
- }
- }
- }
- }
- if (this.mMode == 0 || this.mMode == 2){
- int tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]);
- if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) <= tempRange){
- if (!mWirelessChargingMap.containsKey(mTemp.getDisplayName())){
- if (isValidPlayer(mTemp)) {
- mWirelessChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID());
- ChargingHelper.addValidPlayer(mTemp, this);
- PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m - Long-Range].");
- }
- }
- }
- else {
- if (mWirelessChargingMap.containsKey(mTemp.getDisplayName())){
- if (mWirelessChargingMap.remove(mTemp.getDisplayName()) != null){
- PlayerUtils.messagePlayer(mTemp, "You have left charging range. ["+tempRange+"m - Long Range].");
- ChargingHelper.removeValidPlayer(mTemp, this);
- }
- }
- }
- }
- /*if (this.mMode == 0 || this.mMode == 2){
- int tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]);
- if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){
- if (!mWirelessChargingMap.containsKey(mTemp)){
- mWirelessChargingMap.put(mTemp, mTemp.getPersistentID());
- PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m].");
- ChargingHelper.addValidPlayer(mTemp, this);
- }
- }
- else {
- if (mWirelessChargingMap.containsKey(mTemp)){
- if (mWirelessChargingMap.remove(mTemp) != null){
- PlayerUtils.messagePlayer(mTemp, "You have left charging range. ["+tempRange+"m].");
- ChargingHelper.removeValidPlayer(mTemp, this);
- }
- }
- }
- } */
-
- }
- }
- }
- }
-
-
- }
- }
-
- public BlockPos getTileEntityPosition(){
- return new BlockPos(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld());
- }
-
- public BlockPos getPositionOfEntity(Entity mEntity){
- if (mEntity == null){
- return null;
- }
- return EntityUtils.findBlockPosUnderEntity(mEntity);
- }
-
- public double getDistanceBetweenTwoPositions(BlockPos objectA, BlockPos objectB){
- if (objectA == null || objectB == null){
- return 0f;
- }
- int[] objectArray1 = new int[]{objectA.xPos, objectA.yPos, objectA.zPos};
- int[] objectArray2 = new int[]{objectB.xPos, objectB.yPos, objectB.zPos};
-
- final double distance = Math.sqrt(
- (objectArray2[0]-objectArray1[0])*(objectArray2[0]-objectArray1[0])
- +(objectArray2[1]-objectArray1[1])*(objectArray2[1]-objectArray1[1])
- +(objectArray2[2]-objectArray1[2])*(objectArray2[2]-objectArray1[2]));
- return distance;
- }
-
- @Override
- public void onRemoval() {
-
- ChargingHelper.removeEntry(getTileEntityPosition(), this);
-
- mWirelessChargingMap.clear();
- mLocalChargingMap.clear();
- if (!this.getBaseMetaTileEntity().getWorld().playerEntities.isEmpty()){
- for (Object mTempPlayer : this.getBaseMetaTileEntity().getWorld().playerEntities){
- if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP){
- EntityPlayer mTemp = (EntityPlayer) mTempPlayer;
- ChargingHelper.removeValidPlayer(mTemp, this);
- }
- }
- }
-
-
- super.onRemoval();
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity,
- EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
-
- int tempRange;
-
- if (this.mMode == 0 || this.mMode == 2){
- tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]);
- }
- else {
- tempRange = this.mMode == 1 ? this.mTier*20 : this.mTier*10;
- }
-
- if (this.mMode == 2){
- PlayerUtils.messagePlayer(aPlayer, "Mixed Mode | Local: "+this.mTier*10+"m | Long: "+tempRange+"m");
- PlayerUtils.messagePlayer(aPlayer, "Players with access:");
- for (String name : this.getLocalMap().keySet()) {
- PlayerUtils.messagePlayer(aPlayer, "Local: "+name);
- }
- for (String name : this.getLongRangeMap().keySet()) {
- PlayerUtils.messagePlayer(aPlayer, "Long: "+name);
- }
- }
- else if (this.mMode == 1){
- PlayerUtils.messagePlayer(aPlayer, "Local Mode: "+this.mTier*20+"m");
- PlayerUtils.messagePlayer(aPlayer, "Players with access:");
- for (String name : this.getLocalMap().keySet()) {
- PlayerUtils.messagePlayer(aPlayer, ""+name);
- }
-
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Long-range Mode: "+tempRange+"m");
- PlayerUtils.messagePlayer(aPlayer, "Players with access:");
- for (String name : this.getLongRangeMap().keySet()) {
- PlayerUtils.messagePlayer(aPlayer, ""+name);
- }
- }
-
- return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
- }
-
- @Override
- public void onServerStart() {
- mWirelessChargingMap.clear();
- mLocalChargingMap.clear();
- super.onServerStart();
- }
-
- @Override
- public void onExplosion() {
- ChargingHelper.removeEntry(getTileEntityPosition(), this);
- super.onExplosion();
- }
-
- @Override
- public void doExplosion(long aExplosionPower) {
- ChargingHelper.removeEntry(getTileEntityPosition(), this);
- super.doExplosion(aExplosionPower);
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (!mHasBeenMapped && ChargingHelper.addEntry(getTileEntityPosition(), this)){
- mHasBeenMapped = true;
- }
- }
- super.onPreTick(aBaseMetaTileEntity, aTick);
- }
-
-} \ No newline at end of file
+ private boolean mHasBeenMapped = false;
+ private int mCurrentDimension = 0;
+ public int mMode = 0;
+ public boolean mLocked = true;
+
+ public GregtechMetaWirelessCharger(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
+ }
+
+ public GregtechMetaWirelessCharger(
+ final String aName,
+ final int aTier,
+ final String aDescription,
+ final ITexture[][][] aTextures,
+ final int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Can be locked to the owner by sneaking with a screwdriver",
+ "Can also be locked with a lock upgrade",
+ "",
+ "3 Modes, Long-Range, Local and Mixed.",
+ "Long-Range: Can supply 2A of power to a single player up to " + (GT_Values.V[this.mTier] * 4) + "m away.",
+ "Local: Can supply several Amps to each player within " + this.mTier * 20 + "m.",
+ "Mixed: Provides both 2A of long range and 1A per player locally.",
+ "Mixed mode is more conservative of power and as a result only",
+ "Gets half the distances each singular mode gets.",
+ CORE.GT_Tooltip
+ };
+ }
+
+ public int getTier() {
+ return this.mTier;
+ }
+
+ public int getMode() {
+ return this.mMode;
+ }
+
+ public int getDimensionID() {
+ return this.mCurrentDimension;
+ }
+
+ public Map<String, UUID> getLocalMap() {
+ return this.mLocalChargingMap;
+ }
+
+ public Map<String, UUID> getLongRangeMap() {
+ return this.mWirelessChargingMap;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
+ };
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+
+ if (aPlayer.isSneaking()) {
+ mLocked = !mLocked;
+ PlayerUtils.messagePlayer(aPlayer, mLocked ? "Locked to owner." : "Unlocked.");
+ return;
+ }
+
+ mWirelessChargingMap.clear();
+ mLocalChargingMap.clear();
+ if (!this.getBaseMetaTileEntity().getWorld().playerEntities.isEmpty()) {
+ for (Object mTempPlayer : this.getBaseMetaTileEntity().getWorld().playerEntities) {
+ if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP) {
+ EntityPlayer mTemp = (EntityPlayer) mTempPlayer;
+ ChargingHelper.removeValidPlayer(mTemp, this);
+ }
+ }
+ }
+
+ if (this.mMode >= 2) {
+ this.mMode = 0;
+ } else {
+ this.mMode++;
+ }
+ if (this.mMode == 0) {
+ PlayerUtils.messagePlayer(aPlayer, "Now in Long-Range Charge Mode.");
+ } else if (this.mMode == 1) {
+ PlayerUtils.messagePlayer(aPlayer, "Now in Local Charge Mode.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Now in Mixed Charge Mode.");
+ }
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaWirelessCharger(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return GT_Values.V[this.mTier] * 128;
+ }
+
+ @Override
+ public int getCapacity() {
+ return (int) (GT_Values.V[this.mTier] * 32);
+ }
+
+ @Override
+ public long maxEUInput() {
+ return GT_Values.V[this.mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ if (this.mMode == 0) {
+ return 2;
+ } else if (this.mMode == 1) {
+ return this.mLocalChargingMap.size() * 8;
+ } else {
+ return ((this.mLocalChargingMap.size() * 4) + this.mWirelessChargingMap.size());
+ }
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored();
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[] {this.getLocalName()};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ return new int[] {};
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int p_70301_1_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {}
+
+ @Override
+ public String getInventoryName() {
+ return null;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 0;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
+ return false;
+ }
+
+ @Override
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setBoolean("mLocked", this.mLocked);
+ aNBT.setInteger("mMode", this.mMode);
+ aNBT.setInteger("mCurrentDimension", this.mCurrentDimension);
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mLocked = aNBT.getBoolean("mLocked");
+ this.mMode = aNBT.getInteger("mMode");
+ this.mCurrentDimension = aNBT.getInteger("mCurrentDimension");
+ }
+
+ @Override
+ public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
+ super.onFirstTick(aBaseMetaTileEntity);
+ }
+
+ private Map<String, UUID> mWirelessChargingMap = new HashMap<String, UUID>();
+ private Map<String, UUID> mLocalChargingMap = new HashMap<String, UUID>();
+
+ private boolean isValidPlayer(EntityPlayer aPlayer) {
+ BaseMetaTileEntity aTile = (BaseMetaTileEntity) this.getBaseMetaTileEntity();
+ if (mLocked || (aTile != null && aTile.privateAccess())) {
+ if (aPlayer.getUniqueID().equals(getBaseMetaTileEntity().getOwnerUuid())) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+
+ if (this.mCurrentDimension != aBaseMetaTileEntity.getWorld().provider.dimensionId) {
+ this.mCurrentDimension = aBaseMetaTileEntity.getWorld().provider.dimensionId;
+ }
+
+ if (!mHasBeenMapped && ChargingHelper.addEntry(getTileEntityPosition(), this)) {
+ mHasBeenMapped = true;
+ }
+
+ if (aTick % 20 == 0 && mHasBeenMapped) {
+ if (!aBaseMetaTileEntity.getWorld().playerEntities.isEmpty()) {
+ for (Object mTempPlayer : aBaseMetaTileEntity.getWorld().playerEntities) {
+ if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP) {
+ EntityPlayer mTemp = (EntityPlayer) mTempPlayer;
+
+ if (this.mMode == 1 || this.mMode == 2) {
+ int tempRange = (this.mMode == 1 ? this.mTier * 20 : this.mTier * 10);
+ if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp))
+ < tempRange) {
+ if (isValidPlayer(mTemp)
+ && !mLocalChargingMap.containsKey(mTemp.getDisplayName())) {
+ mLocalChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID());
+ ChargingHelper.addValidPlayer(mTemp, this);
+ // PlayerUtils.messagePlayer(mTemp, "You have entered charging range.
+ // ["+tempRange+"m - Local].");
+ }
+ } else {
+ if (mLocalChargingMap.containsKey(mTemp.getDisplayName())) {
+ if (mLocalChargingMap.remove(mTemp.getDisplayName()) != null) {
+ // PlayerUtils.messagePlayer(mTemp, "You have left charging range.
+ // ["+tempRange+"m - Local].");
+ ChargingHelper.removeValidPlayer(mTemp, this);
+ }
+ }
+ }
+ }
+ if (this.mMode == 0 || this.mMode == 2) {
+ int tempRange = (int)
+ (this.mMode == 0 ? 4 * GT_Values.V[this.mTier] : 2 * GT_Values.V[this.mTier]);
+ if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp))
+ <= tempRange) {
+ if (!mWirelessChargingMap.containsKey(mTemp.getDisplayName())) {
+ if (isValidPlayer(mTemp)) {
+ mWirelessChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID());
+ ChargingHelper.addValidPlayer(mTemp, this);
+ PlayerUtils.messagePlayer(
+ mTemp,
+ "You have entered charging range. [" + tempRange
+ + "m - Long-Range].");
+ }
+ }
+ } else {
+ if (mWirelessChargingMap.containsKey(mTemp.getDisplayName())) {
+ if (mWirelessChargingMap.remove(mTemp.getDisplayName()) != null) {
+ PlayerUtils.messagePlayer(
+ mTemp,
+ "You have left charging range. [" + tempRange + "m - Long Range].");
+ ChargingHelper.removeValidPlayer(mTemp, this);
+ }
+ }
+ }
+ }
+ /*if (this.mMode == 0 || this.mMode == 2){
+ int tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]);
+ if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){
+ if (!mWirelessChargingMap.containsKey(mTemp)){
+ mWirelessChargingMap.put(mTemp, mTemp.getPersistentID());
+ PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m].");
+ ChargingHelper.addValidPlayer(mTemp, this);
+ }
+ }
+ else {
+ if (mWirelessChargingMap.containsKey(mTemp)){
+ if (mWirelessChargingMap.remove(mTemp) != null){
+ PlayerUtils.messagePlayer(mTemp, "You have left charging range. ["+tempRange+"m].");
+ ChargingHelper.removeValidPlayer(mTemp, this);
+ }
+ }
+ }
+ } */
+
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public BlockPos getTileEntityPosition() {
+ return new BlockPos(
+ this.getBaseMetaTileEntity().getXCoord(),
+ this.getBaseMetaTileEntity().getYCoord(),
+ this.getBaseMetaTileEntity().getZCoord(),
+ this.getBaseMetaTileEntity().getWorld());
+ }
+
+ public BlockPos getPositionOfEntity(Entity mEntity) {
+ if (mEntity == null) {
+ return null;
+ }
+ return EntityUtils.findBlockPosUnderEntity(mEntity);
+ }
+
+ public double getDistanceBetweenTwoPositions(BlockPos objectA, BlockPos objectB) {
+ if (objectA == null || objectB == null) {
+ return 0f;
+ }
+ int[] objectArray1 = new int[] {objectA.xPos, objectA.yPos, objectA.zPos};
+ int[] objectArray2 = new int[] {objectB.xPos, objectB.yPos, objectB.zPos};
+
+ final double distance = Math.sqrt((objectArray2[0] - objectArray1[0]) * (objectArray2[0] - objectArray1[0])
+ + (objectArray2[1] - objectArray1[1]) * (objectArray2[1] - objectArray1[1])
+ + (objectArray2[2] - objectArray1[2]) * (objectArray2[2] - objectArray1[2]));
+ return distance;
+ }
+
+ @Override
+ public void onRemoval() {
+
+ ChargingHelper.removeEntry(getTileEntityPosition(), this);
+
+ mWirelessChargingMap.clear();
+ mLocalChargingMap.clear();
+ if (!this.getBaseMetaTileEntity().getWorld().playerEntities.isEmpty()) {
+ for (Object mTempPlayer : this.getBaseMetaTileEntity().getWorld().playerEntities) {
+ if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP) {
+ EntityPlayer mTemp = (EntityPlayer) mTempPlayer;
+ ChargingHelper.removeValidPlayer(mTemp, this);
+ }
+ }
+ }
+
+ super.onRemoval();
+ }
+
+ @Override
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+
+ int tempRange;
+
+ if (this.mMode == 0 || this.mMode == 2) {
+ tempRange = (int) (this.mMode == 0 ? 4 * GT_Values.V[this.mTier] : 2 * GT_Values.V[this.mTier]);
+ } else {
+ tempRange = this.mMode == 1 ? this.mTier * 20 : this.mTier * 10;
+ }
+
+ if (this.mMode == 2) {
+ PlayerUtils.messagePlayer(
+ aPlayer, "Mixed Mode | Local: " + this.mTier * 10 + "m | Long: " + tempRange + "m");
+ PlayerUtils.messagePlayer(aPlayer, "Players with access:");
+ for (String name : this.getLocalMap().keySet()) {
+ PlayerUtils.messagePlayer(aPlayer, "Local: " + name);
+ }
+ for (String name : this.getLongRangeMap().keySet()) {
+ PlayerUtils.messagePlayer(aPlayer, "Long: " + name);
+ }
+ } else if (this.mMode == 1) {
+ PlayerUtils.messagePlayer(aPlayer, "Local Mode: " + this.mTier * 20 + "m");
+ PlayerUtils.messagePlayer(aPlayer, "Players with access:");
+ for (String name : this.getLocalMap().keySet()) {
+ PlayerUtils.messagePlayer(aPlayer, "" + name);
+ }
+
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Long-range Mode: " + tempRange + "m");
+ PlayerUtils.messagePlayer(aPlayer, "Players with access:");
+ for (String name : this.getLongRangeMap().keySet()) {
+ PlayerUtils.messagePlayer(aPlayer, "" + name);
+ }
+ }
+
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
+ }
+
+ @Override
+ public void onServerStart() {
+ mWirelessChargingMap.clear();
+ mLocalChargingMap.clear();
+ super.onServerStart();
+ }
+
+ @Override
+ public void onExplosion() {
+ ChargingHelper.removeEntry(getTileEntityPosition(), this);
+ super.onExplosion();
+ }
+
+ @Override
+ public void doExplosion(long aExplosionPower) {
+ ChargingHelper.removeEntry(getTileEntityPosition(), this);
+ super.doExplosion(aExplosionPower);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (!mHasBeenMapped && ChargingHelper.addEntry(getTileEntityPosition(), this)) {
+ mHasBeenMapped = true;
+ }
+ }
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java
index 89b26eddc7..01cc1ab213 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java
@@ -1,7 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.misc;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -25,568 +29,594 @@ import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_AmazonPackager> implements ISurvivalConstructable {
-
- private long mVoltage;
- private byte mTier;
- private int mCasing;
-
- private ItemStack mSchematicCache;;
- private ItemStack mInputCache;
- private ItemStack mOutputCache;
- private GT_Recipe mCachedRecipe;
-
- private IStructureDefinition<GMTE_AmazonPackager> STRUCTURE_DEFINITION = null;
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GMTE_AmazonPackager(mName);
- }
-
- public GMTE_AmazonPackager(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GMTE_AmazonPackager(String aName) {
- super(aName);
- }
-
- @Override
- public String getMachineType() {
- return "Packager";
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "Generic3By3";
- }
-
- @Override
- public IStructureDefinition<GMTE_AmazonPackager> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GMTE_AmazonPackager>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GMTE_AmazonPackager.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(TAE.getIndexFromPage(2, 9))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 9)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Amazon Warehouse")
- .addInfo("This Multiblock is used for EXTREME packaging requirements")
- .addInfo("Dust Schematics are inserted into the input busses")
- .addInfo("If inserted into the controller, it is shared across all busses")
- .addInfo("1x, 2x, 3x & Other Schematics are to be placed into the controller GUI slot")
- .addInfo("500% faster than using single block machines of the same voltage")
- .addInfo("Only uses 75% of the EU/t normally required")
- .addInfo("Processes 16 items per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front center")
- .addCasingInfo("Supply Depot Casings", 10)
- .addInputBus("Any casing", 1)
- .addOutputBus("Any casing", 1)
- .addEnergyHatch("Any casing", 1)
- .addMaintenanceHatch("Any casing", 1)
- .addMufflerHatch("Any casing", 1)
- .toolTipFinisher("GT++");
- return tt;
- }
-
- private final void initFields() {
- mVoltage = getMaxInputVoltage();
- mTier = (byte) Math.max(1, GT_Utility.getTier(mVoltage));
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.getIndexFromPage(2, 9);
- }
-
-
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes;
- }
-
- private static final FluidStack[] sNoFluids = new FluidStack[] {};
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
-
- //Just the best place to check this~
- initFields();
-
- ArrayList<ItemStack> tItems = getStoredInputs();
- if (this.getGUIItemStack() != null) {
- tItems.add(this.getGUIItemStack());
- }
- ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
- boolean state = checkRecipeGeneric(tItemInputs, sNoFluids, getMaxParallelRecipes(), 75, 500, 10000);
-
-
- if (state) {
- return true;
- }
- else {
- tItems = getStoredInputs();
- AutoMap<ItemStackData> mCompleted = new AutoMap<ItemStackData>();
- AutoMap<ItemStackData> mSchematics = new AutoMap<ItemStackData>();
- for (ItemStack tInputItem : tItems) {
- if (tInputItem != null) {
- if (ItemList.Schematic_1by1.isStackEqual((Object) tInputItem) || ItemList.Schematic_2by2.isStackEqual((Object) tInputItem) || ItemList.Schematic_3by3.isStackEqual((Object) tInputItem)) {
- mSchematics.put(new ItemStackData(tInputItem));
- }
- }
- }
- if (mSchematics.size() > 0) {
- for (ItemStackData g : mSchematics) {
- for (ItemStack tInputItem : tItems) {
- if (tInputItem != null) {
- mCompleted.put(new ItemStackData(tInputItem));
- checkRecipe(tInputItem, g.getStack());
- }
- }
- }
- }
-
- return mCompleted != null && mCompleted.size() > 0;
- }
- }
-
- public boolean checkRecipe(ItemStack inputStack, ItemStack schematicStack) {
- if (GT_Utility.isStackValid((Object) inputStack) && GT_Utility.isStackValid((Object) schematicStack)
- && GT_Utility.getContainerItem(inputStack, true) == null) {
- ItemStack tOutputStack;
- if (ItemList.Schematic_1by1.isStackEqual((Object) schematicStack)&& inputStack.stackSize >= 1) {
- tOutputStack = GT_ModHandler.getRecipeOutput(new ItemStack[]{inputStack});
- if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) {
- final ItemStack input = inputStack;
- --input.stackSize;
- this.mEUt = 32 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
- //this.mMaxProgresstime = 16 / (1 << this.mTier - 1);
- this.mMaxProgresstime = 2;
- this.addOutput(tOutputStack);
- updateSlots();
- return true;
- }
- return false;
- } else if (ItemList.Schematic_2by2.isStackEqual((Object) schematicStack)
- && inputStack.stackSize >= 4) {
- tOutputStack = GT_ModHandler.getRecipeOutput(new ItemStack[]{inputStack,
- inputStack, null, inputStack, inputStack});
- if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) {
- final ItemStack input2 = inputStack;
- input2.stackSize -= 4;
- this.mEUt = 32 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
- //this.mMaxProgresstime = 32 / (1 << this.mTier - 1);
- this.mMaxProgresstime = 4;
- this.addOutput(tOutputStack);
- updateSlots();
- return true;
- }
- return false;
- } else if (ItemList.Schematic_3by3.isStackEqual((Object) schematicStack)
- && inputStack.stackSize >= 9) {
- tOutputStack = GT_ModHandler.getRecipeOutput(new ItemStack[]{inputStack,
- inputStack, inputStack, inputStack, inputStack,
- inputStack, inputStack, inputStack, inputStack});
- if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) {
- final ItemStack input3 = inputStack;
- input3.stackSize -= 9;
- this.mEUt = 32 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
- //this.mMaxProgresstime = 64 / (1 << this.mTier - 1);
- this.mMaxProgresstime = 6;
- this.addOutput(tOutputStack);
- updateSlots();
- return true;
- }
- return false;
- }
- }
- return false;
- }
-
- private ItemStack getSchematic(ItemStack[] aInputs) {
- for (ItemStack aStack : aInputs) {
- if (ItemList.Schematic_Dust.isStackEqual(aStack) || ItemList.Schematic_1by1.isStackEqual(aStack) || ItemList.Schematic_2by2.isStackEqual(aStack) || ItemList.Schematic_3by3.isStackEqual(aStack)) {
- return aStack;
- }
- }
- return null;
- }
-
- private ItemStack getRecipeInput(ItemStack[] aInputs) {
- for (ItemStack aStack : aInputs) {
- if (!ItemList.Schematic_Dust.isStackEqual(aStack) && !ItemList.Schematic_1by1.isStackEqual(aStack) && !ItemList.Schematic_2by2.isStackEqual(aStack) && !ItemList.Schematic_3by3.isStackEqual(aStack)) {
- return aStack;
- }
- }
- return null;
- }
-
- private boolean hasValidCache(ItemStack aStack, ItemStack aSchematic, boolean aClearOnFailure) {
- if (mSchematicCache != null && mInputCache != null && mOutputCache != null && mCachedRecipe != null) {
- if (GT_Utility.areStacksEqual(aStack, mInputCache) && GT_Utility.areStacksEqual(aSchematic, mSchematicCache)) {
- return true;
- }
- }
- // clear cache if it was invalid
- if (aClearOnFailure) {
- mSchematicCache = null;
- mInputCache = null;
- mOutputCache = null;
- mCachedRecipe = null;
- }
- return false;
- }
-
- private void cacheItem(ItemStack aSchematic, ItemStack aInputItem, ItemStack aOutputItem, GT_Recipe aRecipe) {
- mSchematicCache = aSchematic.copy();
- mInputCache = aInputItem.copy();
- mOutputCache = aOutputItem.copy();
- mCachedRecipe = aRecipe;
- }
-
- private GT_Recipe generatePackageRecipe(ItemStack aSchematic, ItemStack aInput) {
- boolean tIsCached = hasValidCache(aInput, aSchematic, true);
- if (tIsCached) {
- ItemStack tOutput = mOutputCache.copy();
- if (tOutput != null) {
- if (mCachedRecipe != null && GT_Utility.areStacksEqual(aInput, mInputCache) && GT_Utility.areStacksEqual(tOutput, mOutputCache)) {
- int aRequiredInputSize = 0;
- if (ItemList.Schematic_Dust.isStackEqual(aSchematic)) {
- if (OrePrefixes.dustTiny.contains(aInput)) {
- aRequiredInputSize = 9;
- }
- if (OrePrefixes.dustSmall.contains(aInput)) {
- aRequiredInputSize = 4;
- }
- if (OrePrefixes.dust.contains(aInput)) {
- aRequiredInputSize = 1;
- }
- }
- if (ItemList.Schematic_1by1.isStackEqual(aSchematic)) {
- aRequiredInputSize = 1;
- }
- if (ItemList.Schematic_2by2.isStackEqual(aSchematic)) {
- aRequiredInputSize = 4;
- }
- if (ItemList.Schematic_3by3.isStackEqual(aSchematic)) {
- aRequiredInputSize = 9;
- }
- if (aInput.stackSize >= aRequiredInputSize) {
- log("Using Cached Recipe. Require: "+aRequiredInputSize+", Found: "+aInput.stackSize);
- return mCachedRecipe;
- }
- else {
- log("Not enough input");
- }
- }
- }
- }
- // We can package this
- GT_Recipe aRecipe = lookupRecipe();
- log("Looking up new recipe");
- if (aRecipe != null) {
- // Cache it
- aInput = aInput != null ? aInput : getRecipeInput(aRecipe.mInputs);
- cacheItem(aSchematic, aInput, aRecipe.mOutputs[0], aRecipe);
- if (hasValidCache(aInput, aSchematic, false)) {
- log("Caching Recipe");
- return aRecipe;
- }
- }
- return null;
- }
-
- private GT_Recipe lookupRecipe() {
- ArrayList<ItemStack> aItems = getStoredInputs();
- if (this.getGUIItemStack() != null) {
- aItems.add(this.getGUIItemStack());
- }
- ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]);
- GT_Recipe tRecipe = findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false, false,
- gregtech.api.enums.GT_Values.V[mTier], sNoFluids, aItemInputs);
-
- if (tRecipe != null) {
- return tRecipe;
- }
- return null;
- }
-
- @Override
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- ItemStack aInput = getRecipeInput(aItemInputs);
- ItemStack aSchematic = getSchematic(aItemInputs);
- GT_Recipe tRecipe = generatePackageRecipe(aSchematic, aInput);
-
- ItemStack[] aRealInputs = new ItemStack[] {aSchematic, aInput};
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, sNoFluids, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- mCachedRecipe = null;
- log("BAD RETURN - 3 - Reset Cached Recipe");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- if (this.hasPerfectOverclock()) this.mMaxProgresstime /= 4;
- else this.mMaxProgresstime /= 2;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
- }
-
- public boolean allowPutStack(final ItemStack aStack, ItemStack schematicStack) {
- //If Schematic Static is not 1x1, 2x2, 3x3
- if (!ItemList.Schematic_1by1.isStackEqual((Object) schematicStack) && !ItemList.Schematic_2by2.isStackEqual((Object) schematicStack) && !ItemList.Schematic_3by3.isStackEqual((Object) schematicStack)) {
- return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack);
- }
- //Something
- if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe((IHasWorldObjectAndCoords) this.getBaseMetaTileEntity(), true, GT_Values.V[this.mTier],
- (FluidStack[]) null, new ItemStack[]{GT_Utility.copyAmount(64L, new Object[]{aStack}), schematicStack}) != null) {
- return true;
- }
- //1x1
- if (ItemList.Schematic_1by1.isStackEqual((Object) schematicStack)
- && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack}) != null) {
- return true;
- }
- //2x2
- if (ItemList.Schematic_2by2.isStackEqual((Object) schematicStack)
- && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack, aStack, null, aStack, aStack}) != null) {
- return true;
- }
- //3x3
- if (ItemList.Schematic_3by3.isStackEqual((Object) schematicStack) && GT_ModHandler.getRecipeOutput(
- new ItemStack[]{aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack}) != null) {
- return true;
- }
- return false;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
- }
-
- @Override
- public int getMaxEfficiency(ItemStack p0) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(ItemStack arg0){
- return CORE.ConfigSwitches.pollutionPerSecondMultiPackager;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (16 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
+public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_AmazonPackager>
+ implements ISurvivalConstructable {
+
+ private long mVoltage;
+ private byte mTier;
+ private int mCasing;
+
+ private ItemStack mSchematicCache;
+ ;
+ private ItemStack mInputCache;
+ private ItemStack mOutputCache;
+ private GT_Recipe mCachedRecipe;
+
+ private IStructureDefinition<GMTE_AmazonPackager> STRUCTURE_DEFINITION = null;
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GMTE_AmazonPackager(mName);
+ }
+
+ public GMTE_AmazonPackager(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GMTE_AmazonPackager(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Packager";
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "Generic3By3";
+ }
+
+ @Override
+ public IStructureDefinition<GMTE_AmazonPackager> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GMTE_AmazonPackager>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GMTE_AmazonPackager.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(TAE.getIndexFromPage(2, 9))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 9))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Amazon Warehouse")
+ .addInfo("This Multiblock is used for EXTREME packaging requirements")
+ .addInfo("Dust Schematics are inserted into the input busses")
+ .addInfo("If inserted into the controller, it is shared across all busses")
+ .addInfo("1x, 2x, 3x & Other Schematics are to be placed into the controller GUI slot")
+ .addInfo("500% faster than using single block machines of the same voltage")
+ .addInfo("Only uses 75% of the EU/t normally required")
+ .addInfo("Processes 16 items per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front center")
+ .addCasingInfo("Supply Depot Casings", 10)
+ .addInputBus("Any casing", 1)
+ .addOutputBus("Any casing", 1)
+ .addEnergyHatch("Any casing", 1)
+ .addMaintenanceHatch("Any casing", 1)
+ .addMufflerHatch("Any casing", 1)
+ .toolTipFinisher("GT++");
+ return tt;
+ }
+
+ private final void initFields() {
+ mVoltage = getMaxInputVoltage();
+ mTier = (byte) Math.max(1, GT_Utility.getTier(mVoltage));
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.getIndexFromPage(2, 9);
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes;
+ }
+
+ private static final FluidStack[] sNoFluids = new FluidStack[] {};
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+
+ // Just the best place to check this~
+ initFields();
+
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ if (this.getGUIItemStack() != null) {
+ tItems.add(this.getGUIItemStack());
+ }
+ ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
+ boolean state = checkRecipeGeneric(tItemInputs, sNoFluids, getMaxParallelRecipes(), 75, 500, 10000);
+
+ if (state) {
+ return true;
+ } else {
+ tItems = getStoredInputs();
+ AutoMap<ItemStackData> mCompleted = new AutoMap<ItemStackData>();
+ AutoMap<ItemStackData> mSchematics = new AutoMap<ItemStackData>();
+ for (ItemStack tInputItem : tItems) {
+ if (tInputItem != null) {
+ if (ItemList.Schematic_1by1.isStackEqual((Object) tInputItem)
+ || ItemList.Schematic_2by2.isStackEqual((Object) tInputItem)
+ || ItemList.Schematic_3by3.isStackEqual((Object) tInputItem)) {
+ mSchematics.put(new ItemStackData(tInputItem));
+ }
+ }
+ }
+ if (mSchematics.size() > 0) {
+ for (ItemStackData g : mSchematics) {
+ for (ItemStack tInputItem : tItems) {
+ if (tInputItem != null) {
+ mCompleted.put(new ItemStackData(tInputItem));
+ checkRecipe(tInputItem, g.getStack());
+ }
+ }
+ }
+ }
+
+ return mCompleted != null && mCompleted.size() > 0;
+ }
+ }
+
+ public boolean checkRecipe(ItemStack inputStack, ItemStack schematicStack) {
+ if (GT_Utility.isStackValid((Object) inputStack)
+ && GT_Utility.isStackValid((Object) schematicStack)
+ && GT_Utility.getContainerItem(inputStack, true) == null) {
+ ItemStack tOutputStack;
+ if (ItemList.Schematic_1by1.isStackEqual((Object) schematicStack) && inputStack.stackSize >= 1) {
+ tOutputStack = GT_ModHandler.getRecipeOutput(new ItemStack[] {inputStack});
+ if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) {
+ final ItemStack input = inputStack;
+ --input.stackSize;
+ this.mEUt = 32 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
+ // this.mMaxProgresstime = 16 / (1 << this.mTier - 1);
+ this.mMaxProgresstime = 2;
+ this.addOutput(tOutputStack);
+ updateSlots();
+ return true;
+ }
+ return false;
+ } else if (ItemList.Schematic_2by2.isStackEqual((Object) schematicStack) && inputStack.stackSize >= 4) {
+ tOutputStack = GT_ModHandler.getRecipeOutput(
+ new ItemStack[] {inputStack, inputStack, null, inputStack, inputStack});
+ if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) {
+ final ItemStack input2 = inputStack;
+ input2.stackSize -= 4;
+ this.mEUt = 32 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
+ // this.mMaxProgresstime = 32 / (1 << this.mTier - 1);
+ this.mMaxProgresstime = 4;
+ this.addOutput(tOutputStack);
+ updateSlots();
+ return true;
+ }
+ return false;
+ } else if (ItemList.Schematic_3by3.isStackEqual((Object) schematicStack) && inputStack.stackSize >= 9) {
+ tOutputStack = GT_ModHandler.getRecipeOutput(new ItemStack[] {
+ inputStack,
+ inputStack,
+ inputStack,
+ inputStack,
+ inputStack,
+ inputStack,
+ inputStack,
+ inputStack,
+ inputStack
+ });
+ if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) {
+ final ItemStack input3 = inputStack;
+ input3.stackSize -= 9;
+ this.mEUt = 32 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
+ // this.mMaxProgresstime = 64 / (1 << this.mTier - 1);
+ this.mMaxProgresstime = 6;
+ this.addOutput(tOutputStack);
+ updateSlots();
+ return true;
+ }
+ return false;
+ }
+ }
+ return false;
+ }
+
+ private ItemStack getSchematic(ItemStack[] aInputs) {
+ for (ItemStack aStack : aInputs) {
+ if (ItemList.Schematic_Dust.isStackEqual(aStack)
+ || ItemList.Schematic_1by1.isStackEqual(aStack)
+ || ItemList.Schematic_2by2.isStackEqual(aStack)
+ || ItemList.Schematic_3by3.isStackEqual(aStack)) {
+ return aStack;
+ }
+ }
+ return null;
+ }
+
+ private ItemStack getRecipeInput(ItemStack[] aInputs) {
+ for (ItemStack aStack : aInputs) {
+ if (!ItemList.Schematic_Dust.isStackEqual(aStack)
+ && !ItemList.Schematic_1by1.isStackEqual(aStack)
+ && !ItemList.Schematic_2by2.isStackEqual(aStack)
+ && !ItemList.Schematic_3by3.isStackEqual(aStack)) {
+ return aStack;
+ }
+ }
+ return null;
+ }
+
+ private boolean hasValidCache(ItemStack aStack, ItemStack aSchematic, boolean aClearOnFailure) {
+ if (mSchematicCache != null && mInputCache != null && mOutputCache != null && mCachedRecipe != null) {
+ if (GT_Utility.areStacksEqual(aStack, mInputCache)
+ && GT_Utility.areStacksEqual(aSchematic, mSchematicCache)) {
+ return true;
+ }
+ }
+ // clear cache if it was invalid
+ if (aClearOnFailure) {
+ mSchematicCache = null;
+ mInputCache = null;
+ mOutputCache = null;
+ mCachedRecipe = null;
+ }
+ return false;
+ }
+
+ private void cacheItem(ItemStack aSchematic, ItemStack aInputItem, ItemStack aOutputItem, GT_Recipe aRecipe) {
+ mSchematicCache = aSchematic.copy();
+ mInputCache = aInputItem.copy();
+ mOutputCache = aOutputItem.copy();
+ mCachedRecipe = aRecipe;
+ }
+
+ private GT_Recipe generatePackageRecipe(ItemStack aSchematic, ItemStack aInput) {
+ boolean tIsCached = hasValidCache(aInput, aSchematic, true);
+ if (tIsCached) {
+ ItemStack tOutput = mOutputCache.copy();
+ if (tOutput != null) {
+ if (mCachedRecipe != null
+ && GT_Utility.areStacksEqual(aInput, mInputCache)
+ && GT_Utility.areStacksEqual(tOutput, mOutputCache)) {
+ int aRequiredInputSize = 0;
+ if (ItemList.Schematic_Dust.isStackEqual(aSchematic)) {
+ if (OrePrefixes.dustTiny.contains(aInput)) {
+ aRequiredInputSize = 9;
+ }
+ if (OrePrefixes.dustSmall.contains(aInput)) {
+ aRequiredInputSize = 4;
+ }
+ if (OrePrefixes.dust.contains(aInput)) {
+ aRequiredInputSize = 1;
+ }
+ }
+ if (ItemList.Schematic_1by1.isStackEqual(aSchematic)) {
+ aRequiredInputSize = 1;
+ }
+ if (ItemList.Schematic_2by2.isStackEqual(aSchematic)) {
+ aRequiredInputSize = 4;
+ }
+ if (ItemList.Schematic_3by3.isStackEqual(aSchematic)) {
+ aRequiredInputSize = 9;
+ }
+ if (aInput.stackSize >= aRequiredInputSize) {
+ log("Using Cached Recipe. Require: " + aRequiredInputSize + ", Found: " + aInput.stackSize);
+ return mCachedRecipe;
+ } else {
+ log("Not enough input");
+ }
+ }
+ }
+ }
+ // We can package this
+ GT_Recipe aRecipe = lookupRecipe();
+ log("Looking up new recipe");
+ if (aRecipe != null) {
+ // Cache it
+ aInput = aInput != null ? aInput : getRecipeInput(aRecipe.mInputs);
+ cacheItem(aSchematic, aInput, aRecipe.mOutputs[0], aRecipe);
+ if (hasValidCache(aInput, aSchematic, false)) {
+ log("Caching Recipe");
+ return aRecipe;
+ }
+ }
+ return null;
+ }
+
+ private GT_Recipe lookupRecipe() {
+ ArrayList<ItemStack> aItems = getStoredInputs();
+ if (this.getGUIItemStack() != null) {
+ aItems.add(this.getGUIItemStack());
+ }
+ ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]);
+ GT_Recipe tRecipe = findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ false,
+ gregtech.api.enums.GT_Values.V[mTier],
+ sNoFluids,
+ aItemInputs);
+
+ if (tRecipe != null) {
+ return tRecipe;
+ }
+ return null;
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ ItemStack aInput = getRecipeInput(aItemInputs);
+ ItemStack aSchematic = getSchematic(aItemInputs);
+ GT_Recipe tRecipe = generatePackageRecipe(aSchematic, aInput);
+
+ ItemStack[] aRealInputs = new ItemStack[] {aSchematic, aInput};
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, sNoFluids, aItemInputs)) {
+ log("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ mCachedRecipe = null;
+ log("BAD RETURN - 3 - Reset Cached Recipe");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ if (this.hasPerfectOverclock()) this.mMaxProgresstime /= 4;
+ else this.mMaxProgresstime /= 2;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ log("GOOD RETURN - 1");
+ return true;
+ }
+
+ public boolean allowPutStack(final ItemStack aStack, ItemStack schematicStack) {
+ // If Schematic Static is not 1x1, 2x2, 3x3
+ if (!ItemList.Schematic_1by1.isStackEqual((Object) schematicStack)
+ && !ItemList.Schematic_2by2.isStackEqual((Object) schematicStack)
+ && !ItemList.Schematic_3by3.isStackEqual((Object) schematicStack)) {
+ return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack);
+ }
+ // Something
+ if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(
+ (IHasWorldObjectAndCoords) this.getBaseMetaTileEntity(),
+ true,
+ GT_Values.V[this.mTier],
+ (FluidStack[]) null,
+ new ItemStack[] {GT_Utility.copyAmount(64L, new Object[] {aStack}), schematicStack})
+ != null) {
+ return true;
+ }
+ // 1x1
+ if (ItemList.Schematic_1by1.isStackEqual((Object) schematicStack)
+ && GT_ModHandler.getRecipeOutput(new ItemStack[] {aStack}) != null) {
+ return true;
+ }
+ // 2x2
+ if (ItemList.Schematic_2by2.isStackEqual((Object) schematicStack)
+ && GT_ModHandler.getRecipeOutput(new ItemStack[] {aStack, aStack, null, aStack, aStack}) != null) {
+ return true;
+ }
+ // 3x3
+ if (ItemList.Schematic_3by3.isStackEqual((Object) schematicStack)
+ && GT_ModHandler.getRecipeOutput(
+ new ItemStack[] {aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack
+ })
+ != null) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack p0) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(ItemStack arg0) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiPackager;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (16 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java
index 769499476c..8b8d12dbd5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java
@@ -2,13 +2,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.misc;
import static gregtech.api.enums.GT_Values.W;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.TAE;
import gregtech.api.interfaces.IIconContainer;
@@ -27,6 +21,10 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
@@ -39,467 +37,480 @@ import net.minecraftforge.common.util.ForgeDirection;
public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<GregtechMTE_TeslaTower> {
- private Block casingBlock;
- private int casingMeta;
- private int frameMeta;
- private int casingTextureIndex;
-
- private ForgeDirection back;
-
- private int xLoc, yLoc, zLoc;
-
- protected int mRange;
-
- /**
- * Machine Mode,
- * {@value false} Attacks all entities,
- * {@value true} Only attacks players.
- */
-
- protected volatile boolean mMode = false;
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMTE_TeslaTower(mName);
- }
-
- public GregtechMTE_TeslaTower(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- initFields();
- }
-
- public GregtechMTE_TeslaTower(String aName) {
- super(aName);
- initFields();
- }
-
- @Override
- public String getMachineType() {
- return "Weaponized Lighting Rod";
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- /*@Override
- public String[] getTooltip() {
- String casings = getCasingBlockItem().get(0).getDisplayName();
- return new String[]{
- "Controller Block for the Tesla Defence Tower Mk3200",
- "Enemies within "+this.mRange+"m are blasted with a high energy plasma.",
- "This uses 5,000,000EU per blast.",
- "Can screwdriver to toggle mode between Players and all Entities.",
- "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)",
- "3x1x3 Base of " + casings,
- "1x3x1 " + casings + " pillar (Center of base)",
- "1x3x1 " + MaterialUtils.getMaterialName(getFrameMaterial()) + " Frame Boxes (Each pillar side and on top)",
- "1x Maintenance Hatch (One of base casings)",
- "1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)"};
- }*/
-
- @Override
- protected final GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Tesla Defence Tower Mk3200")
- .addInfo("Enemies within "+this.mRange+"m are blasted with a high energy plasma.")
- .addInfo("This uses 5,000,000EU per blast.")
- .addInfo("Can screwdriver to toggle mode between Players and all Entities.")
- .addSeparator()
- .beginStructureBlock(1, 7, 1, false)
- .addController("Top Middle")
- .addCasingInfo("Casing", 360)
- .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1)
- .addInputBus("Any 4 dot hint (min 1)", 4)
- .addInputHatch("Any 4 dot hint(min 1)", 4)
- .addOutputHatch("Any 4 dot hint(min 1)", 4)
- .addEnergyHatch("Any 4 dot hint(min 1)", 4)
- .addMaintenanceHatch("Any 4 dot hint(min 1)", 4)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- private final void initFields() {
- casingBlock = ModBlocks.blockCasings2Misc;
- casingMeta = getCasingBlockItem().get(0).getItemDamage();
- casingTextureIndex = getCasingTextureIndex();
- mRange = 50;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return getCasingTextureIndex();
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setBoolean("mMode", this.mMode);
- aNBT.setInteger("mRange", this.mRange);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- this.mMode = aNBT.getBoolean("mMode");
- this.mRange = aNBT.getInteger("mRange");
- super.loadNBTData(aNBT);
- }
-
- private boolean isEnergyEnough() {
- if (this.getEUVar() >= 5000000){
- return true;
- }
- return false;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
-
- if (!isEnergyEnough()) {
- this.mProgresstime = 0;
- this.mMaxProgresstime = 20;
- this.getBaseMetaTileEntity().setActive(false);
- stopMachine();
- }
- else {
- this.mProgresstime = 1;
- this.mMaxProgresstime = 100;
- this.getBaseMetaTileEntity().setActive(true);
-
- }
- return false;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- updateCoordinates();
- //check base layer
- for (int xOff = -1 + back.offsetX; xOff <= 1 + back.offsetX; xOff++) {
- for (int zOff = -1 + back.offsetZ; zOff <= 1 + back.offsetZ; zOff++) {
- if (xOff == 0 && zOff == 0) continue;
-
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xOff, 0, zOff);
- if (!checkCasingBlock(xOff, 0, zOff)
- && !addMaintenanceToMachineList(tTileEntity, casingTextureIndex)
- && !addEnergyInputToMachineList(tTileEntity, casingTextureIndex)){
- Logger.INFO("bad block");
- return false;
- }
- }
- }
- if(!checkHatches()){
- Logger.INFO("bad Hatches");
- return false;
- }
- if (GT_Utility.getTier(getMaxInputVoltage()) < getMinTier()){
- Logger.INFO("bad Voltage");
- return false;
- }
- //check tower
- for (int yOff = 1; yOff < 4; yOff++) {
- if (!checkCasingBlock(back.offsetX, yOff, back.offsetZ)
- || !checkFrameBlock(back.offsetX + 1, yOff, back.offsetZ)
- || !checkFrameBlock(back.offsetX - 1, yOff, back.offsetZ)
- || !checkFrameBlock(back.offsetX, yOff, back.offsetZ + 1)
- || !checkFrameBlock(back.offsetX, yOff, back.offsetZ - 1)
- || !checkFrameBlock(back.offsetX, yOff + 3, back.offsetZ)){
- Logger.INFO("bad frame?");
- return false;
- }
- }
- Logger.INFO("good");
- return true;
- }
-
- private void updateCoordinates() {
- casingTextureIndex = getCasingTextureIndex();
- mRange = 50;
- xLoc = getBaseMetaTileEntity().getXCoord();
- yLoc = getBaseMetaTileEntity().getYCoord();
- zLoc = getBaseMetaTileEntity().getZCoord();
- back = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing());
- }
-
- protected boolean checkCasingBlock(int xOff, int yOff, int zOff) {
- Logger.INFO("Looking For Casing.");
- return checkBlockAndMetaOffset(xOff, yOff, zOff, casingBlock, casingMeta);
- }
- //meta of frame is getTileEntityBaseType; frame should be checked using its drops (possible a high weight operation)
- protected boolean checkFrameBlock(int xOff, int yOff, int zOff) {
- Logger.INFO("Looking For Frame.");
- return checkBlockAndMetaOffset(xOff, yOff, zOff, GregTech_API.sBlockMachines, frameMeta);
- }
-
- protected boolean checkBlockAndMetaOffset(int xOff, int yOff, int zOff, Block block, int meta) {
- return checkBlockAndMeta(xLoc + xOff, yLoc + yOff, zLoc + zOff, block, meta);
- }
-
- private boolean checkBlockAndMeta(int x, int y, int z, Block block, int meta) {
- Logger.INFO("Found: "+getBaseMetaTileEntity().getBlock(x, y, z).getLocalizedName()+" | Meta: "+getBaseMetaTileEntity().getMetaID(x, y, z));
- Logger.INFO("Expected: "+block.getLocalizedName()+" | Meta: "+meta);
- return (meta == W || getBaseMetaTileEntity().getMetaID(x, y, z) == meta)
- && getBaseMetaTileEntity().getBlock(x, y, z) == block;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- protected int getMinTier() {
- return 7;
- }
-
- protected boolean checkHatches() {
- return !mMaintenanceHatches.isEmpty() && !mEnergyHatches.isEmpty();
- }
-
- private Map<Pair<Long, Long>, Entity> mInRange = new HashMap<Pair<Long, Long>, Entity>();
-
- @SuppressWarnings("unchecked")
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- try {
- if (this.getBaseMetaTileEntity().isServerSide()){
- if (this.mEnergyHatches.size() > 0) {
- for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches){
- if (isValidMetaTileEntity(tHatch)) {
- long mHT = tHatch.getBaseMetaTileEntity().getInputVoltage();
- if (tHatch.getEUVar() >= mHT) {
- for (int o=0;o<(tHatch.getEUVar()/mHT);o++){
- //1A
- if (this.getEUVar()<(this.maxEUStore()-mHT)){
- tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mHT, false);
- this.setEUVar(this.getEUVar()+mHT);
- }
- //2A
- if (this.getEUVar()<(this.maxEUStore()-mHT)){
- tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mHT, false);
- this.setEUVar(this.getEUVar()+mHT);
- }
- }
- }
- }
- }
- }
-
- if (aTick % 10 == 0){
- if (this.getEUVar() >= 5000000){
- //Logger.INFO("Can Zap.");
- this.getBaseMetaTileEntity().enableWorking();
- this.getBaseMetaTileEntity().setActive(true);
- if (this.mProgresstime <= 0){
- this.mProgresstime++;
- }
- else if (this.mProgresstime >= 100){
- this.mProgresstime = 0;
- }
- this.mMaxProgresstime = 10000;
- }
- //Logger.INFO("Allowed to be Working? "+this.getBaseMetaTileEntity().isAllowedToWork());
- //Logger.INFO("Working? "+this.getBaseMetaTileEntity().isActive());
- //Logger.INFO("Has Working just been enabled? "+this.getBaseMetaTileEntity().hasWorkJustBeenEnabled());
- }
-
-
- if (aTick % 20 == 0){
- List<Object> o = aBaseMetaTileEntity.getWorld().loadedEntityList;
- //Clean up old entities first
- if (this.mInRange.size() > 0){
- for (Entity j : this.mInRange.values()){
- if (((Entity) j).getDistance(this.xLoc, this.yLoc, this.zLoc) > this.mRange){
- mInRange.remove(new Pair<Long, Long>(((Entity) j).getUniqueID().getMostSignificantBits(), ((Entity) j).getUniqueID().getLeastSignificantBits()), (Entity) j);
- }
- }
- }
- //Add new entities
- if (o.size() > 0){
- for (Object r : o){
- if (r instanceof Entity){
- if (!((Entity) r).getUniqueID().equals(getOwner())){
- if (((Entity) r).isEntityAlive() || r instanceof EntityLiving){
- if (((Entity) r).getDistance(this.xLoc, this.yLoc, this.zLoc) <= this.mRange){
- if (r instanceof EntityItem){
- //Do nothing
- }
- else {
- if (!this.mMode){
- mInRange.put(new Pair<Long, Long>(((Entity) r).getUniqueID().getMostSignificantBits(), ((Entity) r).getUniqueID().getLeastSignificantBits()), (Entity) r);
- }
- else {
- if (r instanceof EntityPlayer){
- mInRange.put(new Pair<Long, Long>(((Entity) r).getUniqueID().getMostSignificantBits(), ((Entity) r).getUniqueID().getLeastSignificantBits()), (Entity) r);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- catch (Throwable r){
-
- }
- super.onPreTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- try {
- if (this.getBaseMetaTileEntity().isServerSide()){
- //Handle Progress Time
- if (this.getEUVar() >= 0 && !this.getBaseMetaTileEntity().isAllowedToWork()){
- this.mProgresstime = 20;
- this.mMaxProgresstime = 40;
- }
- else if (this.getEUVar() >= 0 && this.getBaseMetaTileEntity().isAllowedToWork()){
- this.mProgresstime = 20;
- this.mMaxProgresstime = 40;
- }
-
- if (aTick % 10 == 0){
- if (this.mInRange.size() > 0){
- if (this.getEUVar() >= 5000000){
-
- for (Entity f : mInRange.values()){
- if (f instanceof EntityLiving){
- int j1 = (int) f.posX;
- int l1 = (int) f.posY;
- int k1 = (int) f.posZ;
- World world = aBaseMetaTileEntity.getWorld();
-
- if (f.isEntityAlive() && !f.getUniqueID().equals(getOwner())){
- //if (world.canLightningStrikeAt(j1, l1+1, k1)){
- //if (isEnergyEnough() && world.addWeatherEffect(new EntityTeslaTowerLightning(world, (double)j1, (double)l1, (double)k1))){
- if (isEnergyEnough() && world.addWeatherEffect(new EntityTeslaTowerLightning(world, (double)j1, (double)l1, (double)k1, f, getOwner()))){
- if (f == null || f.isDead || !f.isEntityAlive()){
- this.mInRange.remove(new Pair<Long, Long>(f.getUniqueID().getMostSignificantBits(), f.getUniqueID().getLeastSignificantBits()));
- }
- this.setEUVar(this.getEUVar()-5000000);
- }
- //}
- }
-
- }
- }
- }
- }
- }
- }
- }
- catch (Throwable r){
-
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
-
- protected GregtechItemList getCasingBlockItem() {
- return GregtechItemList.Casing_TeslaTower;
- }
-
- protected int getCasingTextureIndex() {
- return TAE.GTPP_INDEX(30);
- }
-
- public UUID getOwner(){
- return PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName());
- }
-
- @Override
- public boolean isEnetInput() {
- return false;
- }
-
- @Override
- public long maxAmperesIn() {
- return 32;
- }
-
- @Override
- public long maxEUInput() {
- return 131072;
- }
-
- @Override
- public long maxEUStore() {
- return Integer.MAX_VALUE;
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mMode = Utils.invertBoolean(mMode);
- this.mInRange.clear();
- if (mMode){
- PlayerUtils.messagePlayer(aPlayer, "[Tesla Tower] Now only targetting players.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "[Tesla Tower] Targetting all types of entities.");
- }
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 0;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public IStructureDefinition getStructureDefinition() {
- // TODO Auto-generated method stub
- return null;
- }
-
-
+ private Block casingBlock;
+ private int casingMeta;
+ private int frameMeta;
+ private int casingTextureIndex;
+
+ private ForgeDirection back;
+
+ private int xLoc, yLoc, zLoc;
+
+ protected int mRange;
+
+ /**
+ * Machine Mode,
+ * {@value false} Attacks all entities,
+ * {@value true} Only attacks players.
+ */
+ protected volatile boolean mMode = false;
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMTE_TeslaTower(mName);
+ }
+
+ public GregtechMTE_TeslaTower(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ initFields();
+ }
+
+ public GregtechMTE_TeslaTower(String aName) {
+ super(aName);
+ initFields();
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Weaponized Lighting Rod";
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ /*@Override
+ public String[] getTooltip() {
+ String casings = getCasingBlockItem().get(0).getDisplayName();
+ return new String[]{
+ "Controller Block for the Tesla Defence Tower Mk3200",
+ "Enemies within "+this.mRange+"m are blasted with a high energy plasma.",
+ "This uses 5,000,000EU per blast.",
+ "Can screwdriver to toggle mode between Players and all Entities.",
+ "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)",
+ "3x1x3 Base of " + casings,
+ "1x3x1 " + casings + " pillar (Center of base)",
+ "1x3x1 " + MaterialUtils.getMaterialName(getFrameMaterial()) + " Frame Boxes (Each pillar side and on top)",
+ "1x Maintenance Hatch (One of base casings)",
+ "1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)"};
+ }*/
+
+ @Override
+ protected final GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Tesla Defence Tower Mk3200")
+ .addInfo("Enemies within " + this.mRange + "m are blasted with a high energy plasma.")
+ .addInfo("This uses 5,000,000EU per blast.")
+ .addInfo("Can screwdriver to toggle mode between Players and all Entities.")
+ .addSeparator()
+ .beginStructureBlock(1, 7, 1, false)
+ .addController("Top Middle")
+ .addCasingInfo("Casing", 360)
+ .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1)
+ .addInputBus("Any 4 dot hint (min 1)", 4)
+ .addInputHatch("Any 4 dot hint(min 1)", 4)
+ .addOutputHatch("Any 4 dot hint(min 1)", 4)
+ .addEnergyHatch("Any 4 dot hint(min 1)", 4)
+ .addMaintenanceHatch("Any 4 dot hint(min 1)", 4)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ private final void initFields() {
+ casingBlock = ModBlocks.blockCasings2Misc;
+ casingMeta = getCasingBlockItem().get(0).getItemDamage();
+ casingTextureIndex = getCasingTextureIndex();
+ mRange = 50;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return getCasingTextureIndex();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("mMode", this.mMode);
+ aNBT.setInteger("mRange", this.mRange);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mMode = aNBT.getBoolean("mMode");
+ this.mRange = aNBT.getInteger("mRange");
+ super.loadNBTData(aNBT);
+ }
+
+ private boolean isEnergyEnough() {
+ if (this.getEUVar() >= 5000000) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+
+ if (!isEnergyEnough()) {
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 20;
+ this.getBaseMetaTileEntity().setActive(false);
+ stopMachine();
+ } else {
+ this.mProgresstime = 1;
+ this.mMaxProgresstime = 100;
+ this.getBaseMetaTileEntity().setActive(true);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ updateCoordinates();
+ // check base layer
+ for (int xOff = -1 + back.offsetX; xOff <= 1 + back.offsetX; xOff++) {
+ for (int zOff = -1 + back.offsetZ; zOff <= 1 + back.offsetZ; zOff++) {
+ if (xOff == 0 && zOff == 0) continue;
+
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xOff, 0, zOff);
+ if (!checkCasingBlock(xOff, 0, zOff)
+ && !addMaintenanceToMachineList(tTileEntity, casingTextureIndex)
+ && !addEnergyInputToMachineList(tTileEntity, casingTextureIndex)) {
+ Logger.INFO("bad block");
+ return false;
+ }
+ }
+ }
+ if (!checkHatches()) {
+ Logger.INFO("bad Hatches");
+ return false;
+ }
+ if (GT_Utility.getTier(getMaxInputVoltage()) < getMinTier()) {
+ Logger.INFO("bad Voltage");
+ return false;
+ }
+ // check tower
+ for (int yOff = 1; yOff < 4; yOff++) {
+ if (!checkCasingBlock(back.offsetX, yOff, back.offsetZ)
+ || !checkFrameBlock(back.offsetX + 1, yOff, back.offsetZ)
+ || !checkFrameBlock(back.offsetX - 1, yOff, back.offsetZ)
+ || !checkFrameBlock(back.offsetX, yOff, back.offsetZ + 1)
+ || !checkFrameBlock(back.offsetX, yOff, back.offsetZ - 1)
+ || !checkFrameBlock(back.offsetX, yOff + 3, back.offsetZ)) {
+ Logger.INFO("bad frame?");
+ return false;
+ }
+ }
+ Logger.INFO("good");
+ return true;
+ }
+
+ private void updateCoordinates() {
+ casingTextureIndex = getCasingTextureIndex();
+ mRange = 50;
+ xLoc = getBaseMetaTileEntity().getXCoord();
+ yLoc = getBaseMetaTileEntity().getYCoord();
+ zLoc = getBaseMetaTileEntity().getZCoord();
+ back = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing());
+ }
+
+ protected boolean checkCasingBlock(int xOff, int yOff, int zOff) {
+ Logger.INFO("Looking For Casing.");
+ return checkBlockAndMetaOffset(xOff, yOff, zOff, casingBlock, casingMeta);
+ }
+ // meta of frame is getTileEntityBaseType; frame should be checked using its drops (possible a high weight
+ // operation)
+ protected boolean checkFrameBlock(int xOff, int yOff, int zOff) {
+ Logger.INFO("Looking For Frame.");
+ return checkBlockAndMetaOffset(xOff, yOff, zOff, GregTech_API.sBlockMachines, frameMeta);
+ }
+
+ protected boolean checkBlockAndMetaOffset(int xOff, int yOff, int zOff, Block block, int meta) {
+ return checkBlockAndMeta(xLoc + xOff, yLoc + yOff, zLoc + zOff, block, meta);
+ }
+
+ private boolean checkBlockAndMeta(int x, int y, int z, Block block, int meta) {
+ Logger.INFO("Found: " + getBaseMetaTileEntity().getBlock(x, y, z).getLocalizedName() + " | Meta: "
+ + getBaseMetaTileEntity().getMetaID(x, y, z));
+ Logger.INFO("Expected: " + block.getLocalizedName() + " | Meta: " + meta);
+ return (meta == W || getBaseMetaTileEntity().getMetaID(x, y, z) == meta)
+ && getBaseMetaTileEntity().getBlock(x, y, z) == block;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ protected int getMinTier() {
+ return 7;
+ }
+
+ protected boolean checkHatches() {
+ return !mMaintenanceHatches.isEmpty() && !mEnergyHatches.isEmpty();
+ }
+
+ private Map<Pair<Long, Long>, Entity> mInRange = new HashMap<Pair<Long, Long>, Entity>();
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ try {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ if (this.mEnergyHatches.size() > 0) {
+ for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ long mHT = tHatch.getBaseMetaTileEntity().getInputVoltage();
+ if (tHatch.getEUVar() >= mHT) {
+ for (int o = 0; o < (tHatch.getEUVar() / mHT); o++) {
+ // 1A
+ if (this.getEUVar() < (this.maxEUStore() - mHT)) {
+ tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mHT, false);
+ this.setEUVar(this.getEUVar() + mHT);
+ }
+ // 2A
+ if (this.getEUVar() < (this.maxEUStore() - mHT)) {
+ tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mHT, false);
+ this.setEUVar(this.getEUVar() + mHT);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (aTick % 10 == 0) {
+ if (this.getEUVar() >= 5000000) {
+ // Logger.INFO("Can Zap.");
+ this.getBaseMetaTileEntity().enableWorking();
+ this.getBaseMetaTileEntity().setActive(true);
+ if (this.mProgresstime <= 0) {
+ this.mProgresstime++;
+ } else if (this.mProgresstime >= 100) {
+ this.mProgresstime = 0;
+ }
+ this.mMaxProgresstime = 10000;
+ }
+ // Logger.INFO("Allowed to be Working? "+this.getBaseMetaTileEntity().isAllowedToWork());
+ // Logger.INFO("Working? "+this.getBaseMetaTileEntity().isActive());
+ // Logger.INFO("Has Working just been enabled?
+ // "+this.getBaseMetaTileEntity().hasWorkJustBeenEnabled());
+ }
+
+ if (aTick % 20 == 0) {
+ List<Object> o = aBaseMetaTileEntity.getWorld().loadedEntityList;
+ // Clean up old entities first
+ if (this.mInRange.size() > 0) {
+ for (Entity j : this.mInRange.values()) {
+ if (((Entity) j).getDistance(this.xLoc, this.yLoc, this.zLoc) > this.mRange) {
+ mInRange.remove(
+ new Pair<Long, Long>(
+ ((Entity) j).getUniqueID().getMostSignificantBits(),
+ ((Entity) j).getUniqueID().getLeastSignificantBits()),
+ (Entity) j);
+ }
+ }
+ }
+ // Add new entities
+ if (o.size() > 0) {
+ for (Object r : o) {
+ if (r instanceof Entity) {
+ if (!((Entity) r).getUniqueID().equals(getOwner())) {
+ if (((Entity) r).isEntityAlive() || r instanceof EntityLiving) {
+ if (((Entity) r).getDistance(this.xLoc, this.yLoc, this.zLoc) <= this.mRange) {
+ if (r instanceof EntityItem) {
+ // Do nothing
+ } else {
+ if (!this.mMode) {
+ mInRange.put(
+ new Pair<Long, Long>(
+ ((Entity) r)
+ .getUniqueID()
+ .getMostSignificantBits(),
+ ((Entity) r)
+ .getUniqueID()
+ .getLeastSignificantBits()),
+ (Entity) r);
+ } else {
+ if (r instanceof EntityPlayer) {
+ mInRange.put(
+ new Pair<Long, Long>(
+ ((Entity) r)
+ .getUniqueID()
+ .getMostSignificantBits(),
+ ((Entity) r)
+ .getUniqueID()
+ .getLeastSignificantBits()),
+ (Entity) r);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ } catch (Throwable r) {
+
+ }
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ try {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ // Handle Progress Time
+ if (this.getEUVar() >= 0 && !this.getBaseMetaTileEntity().isAllowedToWork()) {
+ this.mProgresstime = 20;
+ this.mMaxProgresstime = 40;
+ } else if (this.getEUVar() >= 0 && this.getBaseMetaTileEntity().isAllowedToWork()) {
+ this.mProgresstime = 20;
+ this.mMaxProgresstime = 40;
+ }
+
+ if (aTick % 10 == 0) {
+ if (this.mInRange.size() > 0) {
+ if (this.getEUVar() >= 5000000) {
+
+ for (Entity f : mInRange.values()) {
+ if (f instanceof EntityLiving) {
+ int j1 = (int) f.posX;
+ int l1 = (int) f.posY;
+ int k1 = (int) f.posZ;
+ World world = aBaseMetaTileEntity.getWorld();
+
+ if (f.isEntityAlive() && !f.getUniqueID().equals(getOwner())) {
+ // if (world.canLightningStrikeAt(j1, l1+1, k1)){
+ // if (isEnergyEnough() && world.addWeatherEffect(new
+ // EntityTeslaTowerLightning(world, (double)j1, (double)l1, (double)k1))){
+ if (isEnergyEnough()
+ && world.addWeatherEffect(new EntityTeslaTowerLightning(
+ world, (double) j1, (double) l1, (double) k1, f, getOwner()))) {
+ if (f == null || f.isDead || !f.isEntityAlive()) {
+ this.mInRange.remove(new Pair<Long, Long>(
+ f.getUniqueID().getMostSignificantBits(),
+ f.getUniqueID().getLeastSignificantBits()));
+ }
+ this.setEUVar(this.getEUVar() - 5000000);
+ }
+ // }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ } catch (Throwable r) {
+
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ protected GregtechItemList getCasingBlockItem() {
+ return GregtechItemList.Casing_TeslaTower;
+ }
+
+ protected int getCasingTextureIndex() {
+ return TAE.GTPP_INDEX(30);
+ }
+
+ public UUID getOwner() {
+ return PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName());
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 32;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return 131072;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mMode = Utils.invertBoolean(mMode);
+ this.mInRange.clear();
+ if (mMode) {
+ PlayerUtils.messagePlayer(aPlayer, "[Tesla Tower] Now only targetting players.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "[Tesla Tower] Targetting all types of entities.");
+ }
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 0;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public IStructureDefinition getStructureDefinition() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java
index 7013986b81..337bf1fd3c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java
@@ -1,7 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofCoil;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -22,373 +27,375 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gregtech.api.util.GT_StructureUtility.ofCoil;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMetaTileEntity_IndustrialAlloySmelter extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialAlloySmelter> implements ISurvivalConstructable {
-
- public static int CASING_TEXTURE_ID;
- private HeatingCoilLevel mHeatingCapacity;
- private int mLevel = 0;
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialAlloySmelter> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialAlloySmelter(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 1);
- }
-
- public GregtechMetaTileEntity_IndustrialAlloySmelter(String aName) {
- super(aName);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 1);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialAlloySmelter(this.mName);
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER;
- }
-
- @Override
- protected int getCasingTextureId() {
- return CASING_TEXTURE_ID;
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerSecond(ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialAlloySmelter;
- }
-
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Alloy Smelter";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Alloy Smelter")
- .addInfo("Gains one parallel per voltage tier")
- .addInfo("Gains one multiplier per coil tier")
- .addInfo("Parallel = Tier * Coil Tier")
- .addInfo("Gains 5% speed bonus per coil tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 5, 3, true)
- .addController("Bottom center")
- .addCasingInfo("Inconel Reinforced Casings", 10)
- .addCasingInfo("Integral Encasement V", 8)
- .addCasingInfo("Heating Coils", 16)
- .addInputBus("Any Inconel Reinforced Casing", 1)
- .addOutputBus("Any Inconel Reinforced Casing", 1)
- .addEnergyHatch("Any Inconel Reinforced Casing", 1)
- .addMaintenanceHatch("Any Inconel Reinforced Casing", 1)
- .addMufflerHatch("Any Inconel Reinforced Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialAlloySmelter> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialAlloySmelter>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"HHH", "H-H", "HHH"},
- {"VVV", "V-V", "VVV"},
- {"HHH", "H-H", "HHH"},
- {"C~C", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialAlloySmelter.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(CASING_TEXTURE_ID)
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1)))
- )
- .addElement(
- 'H',
- ofCoil(
- GregtechMetaTileEntity_IndustrialAlloySmelter::setCoilLevel, GregtechMetaTileEntity_IndustrialAlloySmelter::getCoilLevel
- )
- )
- .addElement(
- 'V',
- ofBlock(
- ModBlocks.blockCasingsTieredGTPP, 4
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName, stackSize, hintsOnly, 1, 4, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mLevel = 0;
- setCoilLevel(HeatingCoilLevel.None);
- return checkPiece(mName, 1, 4, 0) && mCasing >= 10 && getCoilLevel() != HeatingCoilLevel.None && (mLevel = getCoilLevel().getTier() + 1) > 0 && checkHatch();
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (this.mLevel * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- FluidStack[] tFluids = getStoredFluids().toArray(new FluidStack[0]);
- for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
- ArrayList<ItemStack> tInputs = new ArrayList<>();
- if (isValidMetaTileEntity(tBus)) {
- for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) {
- tInputs.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- }
- if (tInputs.size() > 1) {
- ItemStack[] tItems = tInputs.toArray(new ItemStack[0]);
- if (checkRecipeGeneric(tItems, tFluids, getMaxParallelRecipes(), 100, 5 * this.mLevel, 10000)) {
- return true;
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes,
- long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[] {};
- this.mOutputFluids = new FluidStack[] {};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- Logger.WARNING("Running checkRecipeGeneric(0)");
-
- GT_Recipe tRecipe = this.getRecipeMap().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
- Logger.WARNING("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null) {
- Logger.WARNING("BAD RETURN - 1");
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- Logger.WARNING("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- int tHeatCapacityDivTiers = (int) mHeatingCapacity.getHeat() / 900;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
- // Count recipes to do in parallel, consuming input items and fluids and
- // considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- Logger.WARNING("Broke at " + parallelRecipes + ".");
- break;
- }
- Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- Logger.WARNING("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = mLevel * 5;
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
- int rInt = 2;
-
- this.mEUt = (int) Math.max(Math.ceil(tTotalEUt), 1);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= (tHeatCapacityDivTiers >= rInt ? 4 : 2);
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0)
- tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- Logger.WARNING("GOOD RETURN - 1");
- return true;
-
- }
-
- public HeatingCoilLevel getCoilLevel() {
- return mHeatingCapacity;
- }
-
- public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
- mHeatingCapacity = aCoilLevel;
- }
+public class GregtechMetaTileEntity_IndustrialAlloySmelter
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialAlloySmelter>
+ implements ISurvivalConstructable {
+
+ public static int CASING_TEXTURE_ID;
+ private HeatingCoilLevel mHeatingCapacity;
+ private int mLevel = 0;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialAlloySmelter> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialAlloySmelter(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 1);
+ }
+
+ public GregtechMetaTileEntity_IndustrialAlloySmelter(String aName) {
+ super(aName);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 1);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialAlloySmelter(this.mName);
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return CASING_TEXTURE_ID;
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialAlloySmelter;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Alloy Smelter";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Alloy Smelter")
+ .addInfo("Gains one parallel per voltage tier")
+ .addInfo("Gains one multiplier per coil tier")
+ .addInfo("Parallel = Tier * Coil Tier")
+ .addInfo("Gains 5% speed bonus per coil tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 5, 3, true)
+ .addController("Bottom center")
+ .addCasingInfo("Inconel Reinforced Casings", 10)
+ .addCasingInfo("Integral Encasement V", 8)
+ .addCasingInfo("Heating Coils", 16)
+ .addInputBus("Any Inconel Reinforced Casing", 1)
+ .addOutputBus("Any Inconel Reinforced Casing", 1)
+ .addEnergyHatch("Any Inconel Reinforced Casing", 1)
+ .addMaintenanceHatch("Any Inconel Reinforced Casing", 1)
+ .addMufflerHatch("Any Inconel Reinforced Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialAlloySmelter> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialAlloySmelter>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"HHH", "H-H", "HHH"},
+ {"VVV", "V-V", "VVV"},
+ {"HHH", "H-H", "HHH"},
+ {"C~C", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialAlloySmelter.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(CASING_TEXTURE_ID)
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1))))
+ .addElement(
+ 'H',
+ ofCoil(
+ GregtechMetaTileEntity_IndustrialAlloySmelter::setCoilLevel,
+ GregtechMetaTileEntity_IndustrialAlloySmelter::getCoilLevel))
+ .addElement('V', ofBlock(ModBlocks.blockCasingsTieredGTPP, 4))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 4, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mLevel = 0;
+ setCoilLevel(HeatingCoilLevel.None);
+ return checkPiece(mName, 1, 4, 0)
+ && mCasing >= 10
+ && getCoilLevel() != HeatingCoilLevel.None
+ && (mLevel = getCoilLevel().getTier() + 1) > 0
+ && checkHatch();
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (this.mLevel * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ FluidStack[] tFluids = getStoredFluids().toArray(new FluidStack[0]);
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tInputs = new ArrayList<>();
+ if (isValidMetaTileEntity(tBus)) {
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) {
+ tInputs.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ if (tInputs.size() > 1) {
+ ItemStack[] tItems = tInputs.toArray(new ItemStack[0]);
+ if (checkRecipeGeneric(tItems, tFluids, getMaxParallelRecipes(), 100, 5 * this.mLevel, 10000)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ Logger.WARNING("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = this.getRecipeMap()
+ .findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+
+ Logger.WARNING("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ Logger.WARNING("BAD RETURN - 1");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ Logger.WARNING("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ int tHeatCapacityDivTiers = (int) mHeatingCapacity.getHeat() / 900;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+ // Count recipes to do in parallel, consuming input items and fluids and
+ // considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ Logger.WARNING("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ Logger.WARNING("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = mLevel * 5;
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+ int rInt = 2;
+
+ this.mEUt = (int) Math.max(Math.ceil(tTotalEUt), 1);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= (tHeatCapacityDivTiers >= rInt ? 4 : 2);
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ Logger.WARNING("GOOD RETURN - 1");
+ return true;
+ }
+
+ public HeatingCoilLevel getCoilLevel() {
+ return mHeatingCapacity;
+ }
+
+ public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
+ mHeatingCapacity = aCoilLevel;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java
index 79025840ed..9cc6b7fedd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java
@@ -1,5 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -25,280 +30,287 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialArcFurnace extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialArcFurnace> implements ISurvivalConstructable {
-
- //862
- private static final int mCasingTextureID = TAE.getIndexFromPage(3, 3);
- public static String mCasingName = "Tempered Arc Furnace Casing";
- private boolean mPlasmaMode = false;
- private int mSize = 0;
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialArcFurnace> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialArcFurnace(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialArcFurnace(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialArcFurnace(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "(Plasma/Electric) Arc Furnace";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for Industrial Arc Furnace")
- .addInfo("250% faster than using single block machines of the same voltage")
- .addInfo("Processes 8 items per voltage tier * W/L")
- .addInfo("Max Size required to process Plasma recipes")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .addController("Top center")
- .addStructureInfo("Size: nx3xn [WxHxL] (Hollow)")
- .addStructureInfo("n can be 3, 5 or 7")
- .addCasingInfo(mCasingName, 10)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialArcFurnace> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialArcFurnace>builder()
- .addShape(mName + "3", new String[][]{
- {"CCC", "C~C", "CCC"},
- {"CCC", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- })
- .addShape(mName + "5", new String[][]{
- {"CCCCC", "CCCCC", "CC~CC", "CCCCC", "CCCCC"},
- {"CCCCC", "C---C", "C---C", "C---C", "CCCCC"},
- {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"},
- })
- .addShape(mName + "7", new String[][]{
- {"CCCCCCC", "CCCCCCC", "CCCCCCC", "CCC~CCC", "CCCCCCC", "CCCCCCC", "CCCCCCC"},
- {"CCCCCCC", "C-----C", "C-----C", "C-----C", "C-----C", "C-----C", "CCCCCCC"},
- {"CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC"},
- })
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialArcFurnace.class)
- .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 3)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- public void clearHatches() {
- mOutputHatches.clear();
- mInputHatches.clear();
- mOutputBusses.clear();
- mInputBusses.clear();
- mEnergyHatches.clear();
- mMaintenanceHatches.clear();
- mMufflerHatches.clear();
- }
-
- private int getSizeFromHint(ItemStack stackSize) {
- switch (stackSize.stackSize) {
- case 1: return 3;
- case 2: return 5;
- default: return 7;
- }
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- int size = getSizeFromHint(stackSize);
- buildPiece(mName + size, stackSize, hintsOnly, (size - 1) / 2, (size - 1) / 2, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- int size = getSizeFromHint(stackSize);
- return survivialBuildPiece(mName + size, stackSize, (size - 1) / 2, (size - 1) / 2, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mSize = 0;
- if (checkPiece(mName + "3", 1, 1, 0)) {
- mSize = 3;
- return mCasing >= 10 && checkHatch();
- }
- mCasing = 0;
- clearHatches();
- if (checkPiece(mName + "5", 2, 2, 0)) {
- mSize = 5;
- return mCasing >= 10 && checkHatch();
- }
- mCasing = 0;
- clearHatches();
- if (checkPiece(mName + "7", 3, 3, 0)) {
- mSize = 7;
- return mCasing >= 10 && checkHatch();
- }
- return false;
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(207));
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return mCasingTextureID;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialExtruder";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return mPlasmaMode ? GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes : GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return this.checkRecipeGeneric(getMaxParallelRecipes(), 100, 250);
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (this.mSize * 8 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialArcFurnace;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasings4Misc;
- }
-
-
- public byte getCasingMeta() {
- return 3;
- }
-
- public Block getCasingBlock2() {
- return ModBlocks.blockCasings3Misc;
- }
-
-
- public byte getCasingMeta2() {
- return 15;
- }
-
- public byte getCasingTextureIndex() {
- return (byte) mCasingTextureID;
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (this.mSize > 5) {
- this.mPlasmaMode = Utils.invertBoolean(mPlasmaMode);
- if (mPlasmaMode) {
- PlayerUtils.messagePlayer(aPlayer, "["+EnumChatFormatting.RED+"MODE"+EnumChatFormatting.RESET+"] "+EnumChatFormatting.LIGHT_PURPLE+"Plasma"+EnumChatFormatting.RESET);
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "["+EnumChatFormatting.RED+"MODE"+EnumChatFormatting.RESET+"] "+EnumChatFormatting.YELLOW+"Electric"+EnumChatFormatting.RESET);
- }
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "["+EnumChatFormatting.RED+"MODE"+EnumChatFormatting.RESET+"] "+EnumChatFormatting.GRAY+"Cannot change mode, structure not large enough."+EnumChatFormatting.RESET);
- }
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mPlasmaMode", mPlasmaMode);
- aNBT.setInteger("mSize", mSize);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mPlasmaMode = aNBT.getBoolean("mPlasmaMode");
- mSize = aNBT.getInteger("mSize");
- }
-
- @Override
- public void onMachineBlockUpdate() {
- mUpdate = 100;
- }
+public class GregtechMetaTileEntity_IndustrialArcFurnace
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialArcFurnace>
+ implements ISurvivalConstructable {
+
+ // 862
+ private static final int mCasingTextureID = TAE.getIndexFromPage(3, 3);
+ public static String mCasingName = "Tempered Arc Furnace Casing";
+ private boolean mPlasmaMode = false;
+ private int mSize = 0;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialArcFurnace> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialArcFurnace(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialArcFurnace(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialArcFurnace(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "(Plasma/Electric) Arc Furnace";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for Industrial Arc Furnace")
+ .addInfo("250% faster than using single block machines of the same voltage")
+ .addInfo("Processes 8 items per voltage tier * W/L")
+ .addInfo("Max Size required to process Plasma recipes")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .addController("Top center")
+ .addStructureInfo("Size: nx3xn [WxHxL] (Hollow)")
+ .addStructureInfo("n can be 3, 5 or 7")
+ .addCasingInfo(mCasingName, 10)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialArcFurnace> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialArcFurnace>builder()
+ .addShape(mName + "3", new String[][] {
+ {"CCC", "C~C", "CCC"},
+ {"CCC", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ })
+ .addShape(mName + "5", new String[][] {
+ {"CCCCC", "CCCCC", "CC~CC", "CCCCC", "CCCCC"},
+ {"CCCCC", "C---C", "C---C", "C---C", "CCCCC"},
+ {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"},
+ })
+ .addShape(mName + "7", new String[][] {
+ {"CCCCCCC", "CCCCCCC", "CCCCCCC", "CCC~CCC", "CCCCCCC", "CCCCCCC", "CCCCCCC"},
+ {"CCCCCCC", "C-----C", "C-----C", "C-----C", "C-----C", "C-----C", "CCCCCCC"},
+ {"CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC"},
+ })
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialArcFurnace.class)
+ .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 3))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ public void clearHatches() {
+ mOutputHatches.clear();
+ mInputHatches.clear();
+ mOutputBusses.clear();
+ mInputBusses.clear();
+ mEnergyHatches.clear();
+ mMaintenanceHatches.clear();
+ mMufflerHatches.clear();
+ }
+
+ private int getSizeFromHint(ItemStack stackSize) {
+ switch (stackSize.stackSize) {
+ case 1:
+ return 3;
+ case 2:
+ return 5;
+ default:
+ return 7;
+ }
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ int size = getSizeFromHint(stackSize);
+ buildPiece(mName + size, stackSize, hintsOnly, (size - 1) / 2, (size - 1) / 2, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ int size = getSizeFromHint(stackSize);
+ return survivialBuildPiece(
+ mName + size, stackSize, (size - 1) / 2, (size - 1) / 2, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mSize = 0;
+ if (checkPiece(mName + "3", 1, 1, 0)) {
+ mSize = 3;
+ return mCasing >= 10 && checkHatch();
+ }
+ mCasing = 0;
+ clearHatches();
+ if (checkPiece(mName + "5", 2, 2, 0)) {
+ mSize = 5;
+ return mCasing >= 10 && checkHatch();
+ }
+ mCasing = 0;
+ clearHatches();
+ if (checkPiece(mName + "7", 3, 3, 0)) {
+ mSize = 7;
+ return mCasing >= 10 && checkHatch();
+ }
+ return false;
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(207));
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return mCasingTextureID;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialExtruder";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return mPlasmaMode
+ ? GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes
+ : GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return this.checkRecipeGeneric(getMaxParallelRecipes(), 100, 250);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (this.mSize * 8 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ @Override
+ public void startProcess() {
+ this.sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialArcFurnace;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings4Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 3;
+ }
+
+ public Block getCasingBlock2() {
+ return ModBlocks.blockCasings3Misc;
+ }
+
+ public byte getCasingMeta2() {
+ return 15;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) mCasingTextureID;
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (this.mSize > 5) {
+ this.mPlasmaMode = Utils.invertBoolean(mPlasmaMode);
+ if (mPlasmaMode) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "[" + EnumChatFormatting.RED + "MODE" + EnumChatFormatting.RESET + "] "
+ + EnumChatFormatting.LIGHT_PURPLE + "Plasma" + EnumChatFormatting.RESET);
+ } else {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "[" + EnumChatFormatting.RED + "MODE" + EnumChatFormatting.RESET + "] "
+ + EnumChatFormatting.YELLOW + "Electric" + EnumChatFormatting.RESET);
+ }
+ } else {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "[" + EnumChatFormatting.RED + "MODE" + EnumChatFormatting.RESET + "] " + EnumChatFormatting.GRAY
+ + "Cannot change mode, structure not large enough." + EnumChatFormatting.RESET);
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mPlasmaMode", mPlasmaMode);
+ aNBT.setInteger("mSize", mSize);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mPlasmaMode = aNBT.getBoolean("mPlasmaMode");
+ mSize = aNBT.getInteger("mSize");
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ mUpdate = 100;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java
index fd8d895990..346c8804ab 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java
@@ -1,5 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -24,219 +30,211 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialCentrifuge extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCentrifuge> implements ISurvivalConstructable {
-
- private boolean mIsAnimated;
- private static final CustomIcon frontFaceActive = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
- private static final CustomIcon frontFace = new CustomIcon("iconsets/LARGECENTRIFUGE5");
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialCentrifuge> STRUCTURE_DEFINITION = null;
- //public static double recipesComplete = 0;
-
- public GregtechMetaTileEntity_IndustrialCentrifuge(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- mIsAnimated = true;
- }
-
- public GregtechMetaTileEntity_IndustrialCentrifuge(final String aName) {
- super(aName);
- mIsAnimated = true;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialCentrifuge(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Centrifuge";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Centrifuge")
- .addInfo("125% faster than using single block machines of the same voltage")
- .addInfo("Disable animations with a screwdriver")
- .addInfo("Only uses 90% of the EU/t normally required")
- .addInfo("Processes six items per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front Center")
- .addCasingInfo("Centrifuge Casings", 10)
- .addInputBus("Any Casing except front", 1)
- .addOutputBus("Any Casing except front", 1)
- .addInputHatch("Any Casing except front", 1)
- .addOutputHatch("Any Casing except front", 1)
- .addEnergyHatch("Any Casing except front", 1)
- .addMaintenanceHatch("Any Casing except front", 1)
- .addMufflerHatch("Any Casing except front", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialCentrifuge> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCentrifuge>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialCentrifuge.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 0)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- if (usingAnimations()) {
- return frontFaceActive;
- } else {
- return frontFace;
- }
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return frontFace;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(0);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialCentrifuge";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric(6* GT_Utility.getTier(this.getMaxInputVoltage()), 90, 125);
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (6 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 90;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasingsMisc;
- }
-
- public byte getCasingMeta() {
- return 0;
- }
-
- public byte getCasingTextureIndex() {
- return (byte) TAE.GTPP_INDEX(0);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialCentrifuge;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- this.mIsAnimated = !mIsAnimated;
- Logger.INFO("Is Centrifuge animated "+this.mIsAnimated);
- if (this.mIsAnimated) {
- PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture. ");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture. ");
- }
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mIsAnimated", mIsAnimated);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- if (aNBT.hasKey("mIsAnimated")) {
- mIsAnimated = aNBT.getBoolean("mIsAnimated");
- }
- else {
- mIsAnimated = true;
- }
- }
-
- public boolean usingAnimations() {
- //Logger.INFO("Is animated? "+this.mIsAnimated);
- return this.mIsAnimated;
- }
-
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialCentrifuge
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCentrifuge>
+ implements ISurvivalConstructable {
+
+ private boolean mIsAnimated;
+ private static final CustomIcon frontFaceActive = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
+ private static final CustomIcon frontFace = new CustomIcon("iconsets/LARGECENTRIFUGE5");
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialCentrifuge> STRUCTURE_DEFINITION = null;
+ // public static double recipesComplete = 0;
+
+ public GregtechMetaTileEntity_IndustrialCentrifuge(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ mIsAnimated = true;
+ }
+
+ public GregtechMetaTileEntity_IndustrialCentrifuge(final String aName) {
+ super(aName);
+ mIsAnimated = true;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialCentrifuge(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Centrifuge";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Centrifuge")
+ .addInfo("125% faster than using single block machines of the same voltage")
+ .addInfo("Disable animations with a screwdriver")
+ .addInfo("Only uses 90% of the EU/t normally required")
+ .addInfo("Processes six items per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front Center")
+ .addCasingInfo("Centrifuge Casings", 10)
+ .addInputBus("Any Casing except front", 1)
+ .addOutputBus("Any Casing except front", 1)
+ .addInputHatch("Any Casing except front", 1)
+ .addOutputHatch("Any Casing except front", 1)
+ .addEnergyHatch("Any Casing except front", 1)
+ .addMaintenanceHatch("Any Casing except front", 1)
+ .addMufflerHatch("Any Casing except front", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialCentrifuge> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCentrifuge>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialCentrifuge.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 0))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ if (usingAnimations()) {
+ return frontFaceActive;
+ } else {
+ return frontFace;
+ }
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return frontFace;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(0);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialCentrifuge";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(6 * GT_Utility.getTier(this.getMaxInputVoltage()), 90, 125);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (6 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 90;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasingsMisc;
+ }
+
+ public byte getCasingMeta() {
+ return 0;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) TAE.GTPP_INDEX(0);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialCentrifuge;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ this.mIsAnimated = !mIsAnimated;
+ Logger.INFO("Is Centrifuge animated " + this.mIsAnimated);
+ if (this.mIsAnimated) {
+ PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture. ");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture. ");
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mIsAnimated", mIsAnimated);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ if (aNBT.hasKey("mIsAnimated")) {
+ mIsAnimated = aNBT.getBoolean("mIsAnimated");
+ } else {
+ mIsAnimated = true;
+ }
+ }
+
+ public boolean usingAnimations() {
+ // Logger.INFO("Is animated? "+this.mIsAnimated);
+ return this.mIsAnimated;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java
index 8233437748..92fc3cb1c8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java
@@ -1,7 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -19,6 +23,8 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -26,143 +32,137 @@ import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
import team.chisel.carving.Carving;
+public class GregtechMetaTileEntity_IndustrialChisel
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialChisel> implements ISurvivalConstructable {
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMetaTileEntity_IndustrialChisel extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialChisel> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialChisel> STRUCTURE_DEFINITION = null;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialChisel> STRUCTURE_DEFINITION = null;
private ItemStack mInputCache;
private ItemStack mOutputCache;
private GTPP_Recipe mCachedRecipe;
- public GregtechMetaTileEntity_IndustrialChisel(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialChisel(String aName) {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialChisel(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Chisel";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Factory Grade Auto Chisel")
- .addInfo("Target block goes in GUI slot")
- .addInfo("If no target provided, firdt chisel result is used")
- .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 16")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front center")
- .addCasingInfo("Sturdy Printer Casing", 10)
- .addInputBus("Any casing", 1)
- .addOutputBus("Any casing", 1)
- .addEnergyHatch("Any casing", 1)
- .addMaintenanceHatch("Any casing", 1)
- .addMufflerHatch("Any casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialChisel> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialChisel>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialChisel.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(90)
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 5)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return 90;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "ImplosionCompressor";
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
+ public GregtechMetaTileEntity_IndustrialChisel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialChisel(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialChisel(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Chisel";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Factory Grade Auto Chisel")
+ .addInfo("Target block goes in GUI slot")
+ .addInfo("If no target provided, firdt chisel result is used")
+ .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 16")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front center")
+ .addCasingInfo("Sturdy Printer Casing", 10)
+ .addInputBus("Any casing", 1)
+ .addOutputBus("Any casing", 1)
+ .addEnergyHatch("Any casing", 1)
+ .addMaintenanceHatch("Any casing", 1)
+ .addMufflerHatch("Any casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialChisel> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialChisel>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialChisel.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(90)
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 5))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return 90;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "ImplosionCompressor";
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
private boolean hasValidCache(ItemStack aStack, ItemStack aSpecialSlot, boolean aClearOnFailure) {
- if (mInputCache != null && mOutputCache != null && mCachedRecipe != null) {
- if (GT_Utility.areStacksEqual(aStack, mInputCache) && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) {
- return true;
- }
+ if (mInputCache != null && mOutputCache != null && mCachedRecipe != null) {
+ if (GT_Utility.areStacksEqual(aStack, mInputCache)
+ && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) {
+ return true;
+ }
}
// clear cache if it was invalid
if (aClearOnFailure) {
@@ -172,286 +172,284 @@ public class GregtechMetaTileEntity_IndustrialChisel extends GregtechMeta_MultiB
}
return false;
}
-
+
private void cacheItem(ItemStack aInputItem, ItemStack aOutputItem, GTPP_Recipe aRecipe) {
mInputCache = aInputItem.copy();
mOutputCache = aOutputItem.copy();
mCachedRecipe = aRecipe;
}
-
- // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
- private static boolean canBeMadeFrom(ItemStack from, ItemStack to) {
- List<ItemStack> results = getItemsForChiseling(from);
- for (ItemStack s : results) {
- if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) {
- return true;
- }
- }
- return false;
- }
-
- // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
- private static boolean hasChiselResults(ItemStack from) {
- List<ItemStack> results = getItemsForChiseling(from);
- return results.size() > 0;
- }
-
- private static List<ItemStack> getItemsForChiseling(ItemStack aStack){
- return Carving.chisel.getItemsForChiseling(aStack);
- }
-
- private static ItemStack getChiselOutput(ItemStack aInput, ItemStack aTarget) {
- ItemStack tOutput = null;
- if (aTarget != null && canBeMadeFrom(aInput, aTarget)) {
- tOutput = aTarget;
- }
- else if (aTarget != null && !canBeMadeFrom(aInput, aTarget)) {
- tOutput = null;
- }
- else {
- tOutput = getItemsForChiseling(aInput).get(0);
- }
- return tOutput;
- }
-
- private GTPP_Recipe generateChiselRecipe(ItemStack aInput, ItemStack aTarget) {
+
+ // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
+ private static boolean canBeMadeFrom(ItemStack from, ItemStack to) {
+ List<ItemStack> results = getItemsForChiseling(from);
+ for (ItemStack s : results) {
+ if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target
+ private static boolean hasChiselResults(ItemStack from) {
+ List<ItemStack> results = getItemsForChiseling(from);
+ return results.size() > 0;
+ }
+
+ private static List<ItemStack> getItemsForChiseling(ItemStack aStack) {
+ return Carving.chisel.getItemsForChiseling(aStack);
+ }
+
+ private static ItemStack getChiselOutput(ItemStack aInput, ItemStack aTarget) {
+ ItemStack tOutput = null;
+ if (aTarget != null && canBeMadeFrom(aInput, aTarget)) {
+ tOutput = aTarget;
+ } else if (aTarget != null && !canBeMadeFrom(aInput, aTarget)) {
+ tOutput = null;
+ } else {
+ tOutput = getItemsForChiseling(aInput).get(0);
+ }
+ return tOutput;
+ }
+
+ private GTPP_Recipe generateChiselRecipe(ItemStack aInput, ItemStack aTarget) {
boolean tIsCached = hasValidCache(aInput, aTarget, true);
- if (tIsCached || aInput != null && hasChiselResults(aInput)) {
- ItemStack tOutput = tIsCached ? mOutputCache.copy() : getChiselOutput(aInput, aTarget);
- if (tOutput != null) {
- if (mCachedRecipe != null && GT_Utility.areStacksEqual(aInput, mInputCache) && GT_Utility.areStacksEqual(tOutput, mOutputCache)) {
- return mCachedRecipe;
- }
- // We can chisel this
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {ItemUtils.getSimpleStack(aInput, 1)},
- new ItemStack[] {ItemUtils.getSimpleStack(tOutput, 1)},
- null,
- new int[] {10000},
- new FluidStack[] {},
- new FluidStack[] {},
- 20,
- 16,
- 0);
-
- // Cache it
- cacheItem(aInput, tOutput, aRecipe);
- return aRecipe;
- }
- }
- return null;
- }
-
- public boolean checkRecipe(final ItemStack aStack) {
- ArrayList<ItemStack> aItems = this.getStoredInputs();
- if (!aItems.isEmpty()) {
-
- GT_Recipe tRecipe = generateChiselRecipe(aItems.get(0), this.getGUIItemStack());
-
- if (tRecipe == null) {
- log("BAD RETURN - 0");
- return false;
- }
-
- // Based on the Processing Array. A bit overkill, but very flexible.
- ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]);
- FluidStack[] aFluidInputs = new FluidStack[] {};
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- int aMaxParallelRecipes = getMaxParallelRecipes();
- int aEUPercent = getEuDiscountForParallelism();
- int aSpeedBonusPercent = 200;
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(10000) <= tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
- }
-
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (16 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 75;
- }
-
- private static String sChiselSound = null;
-
- private static final String getChiselSound() {
- if (sChiselSound == null) {
- sChiselSound = Carving.chisel.getVariationSound(Blocks.stone, 0);
- }
- return sChiselSound;
- }
-
- @Override
- public String getSound() {
- return getChiselSound();
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerSecond(ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialChisel;
- }
-
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
-} \ No newline at end of file
+ if (tIsCached || aInput != null && hasChiselResults(aInput)) {
+ ItemStack tOutput = tIsCached ? mOutputCache.copy() : getChiselOutput(aInput, aTarget);
+ if (tOutput != null) {
+ if (mCachedRecipe != null
+ && GT_Utility.areStacksEqual(aInput, mInputCache)
+ && GT_Utility.areStacksEqual(tOutput, mOutputCache)) {
+ return mCachedRecipe;
+ }
+ // We can chisel this
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {ItemUtils.getSimpleStack(aInput, 1)},
+ new ItemStack[] {ItemUtils.getSimpleStack(tOutput, 1)},
+ null,
+ new int[] {10000},
+ new FluidStack[] {},
+ new FluidStack[] {},
+ 20,
+ 16,
+ 0);
+
+ // Cache it
+ cacheItem(aInput, tOutput, aRecipe);
+ return aRecipe;
+ }
+ }
+ return null;
+ }
+
+ public boolean checkRecipe(final ItemStack aStack) {
+ ArrayList<ItemStack> aItems = this.getStoredInputs();
+ if (!aItems.isEmpty()) {
+
+ GT_Recipe tRecipe = generateChiselRecipe(aItems.get(0), this.getGUIItemStack());
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 0");
+ return false;
+ }
+
+ // Based on the Processing Array. A bit overkill, but very flexible.
+ ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]);
+ FluidStack[] aFluidInputs = new FluidStack[] {};
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ int aMaxParallelRecipes = getMaxParallelRecipes();
+ int aEUPercent = getEuDiscountForParallelism();
+ int aSpeedBonusPercent = 200;
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ log("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(10000) <= tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ log("GOOD RETURN - 1");
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (16 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 75;
+ }
+
+ private static String sChiselSound = null;
+
+ private static final String getChiselSound() {
+ if (sChiselSound == null) {
+ sChiselSound = Carving.chisel.getVariationSound(Blocks.stone, 0);
+ }
+ return sChiselSound;
+ }
+
+ @Override
+ public String getSound() {
+ return getChiselSound();
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialChisel;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java
index de9701283a..8e826a7fc4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java
@@ -1,5 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -20,226 +27,194 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialCokeOven extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCokeOven> implements ISurvivalConstructable {
-
- private int mLevel = 0;
- private int mCasing;
- private int mCasing1;
- private int mCasing2;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialCokeOven> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialCokeOven(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialCokeOven(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialCokeOven(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Coke Oven";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Processes Logs and Coal into Charcoal and Coal Coke.")
- .addInfo("Controller Block for the Industrial Coke Oven")
- .addInfo("Gain 4% energy discount per voltage tier")
- .addInfo("Process 12x materials with Heat Resistant Casings")
- .addInfo("Or 24x materials with Heat Proof Casings")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front middle at bottom")
- .addCasingInfo("Structural Coke Oven Casings", 8)
- .addCasingInfo("Heat Resistant/Proof Coke Oven Casings", 8)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialCokeOven> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCokeOven>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"HHH", "H-H", "HHH"},
- {"C~C", "CCC", "CCC"},
- }))
- .addShape(mName + "1", transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"aaa", "a-a", "aaa"},
- {"C~C", "CCC", "CCC"},
- }))
- .addShape(mName + "2", transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"bbb", "b-b", "bbb"},
- {"C~C", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialCokeOven.class)
- .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler)
- .casingIndex(TAE.GTPP_INDEX(1))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 1)))
- )
- .addElement(
- 'H',
- ofChain(
- onElementPass(
- x -> ++x.mCasing1,
- ofBlock(
- ModBlocks.blockCasingsMisc, 2
- )
- ),
- onElementPass(
- x -> ++x.mCasing2,
- ofBlock(
- ModBlocks.blockCasingsMisc, 3
- )
- )
- )
- )
- .addElement(
- 'a',
- ofBlock(
- ModBlocks.blockCasingsMisc, 2
- )
- )
- .addElement(
- 'b',
- ofBlock(
- ModBlocks.blockCasingsMisc, 3
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- if (stackSize.stackSize == 1)
- buildPiece(mName + "1" , stackSize, hintsOnly, 1, 2, 0);
- else
- buildPiece(mName + "2" , stackSize, hintsOnly, 1, 2, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- if (stackSize.stackSize == 1)
- return survivialBuildPiece(mName + "1", stackSize, 1, 2, 0, elementBudget, source, actor, false, true);
- else
- return survivialBuildPiece(mName + "2", stackSize, 1, 2, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mCasing1 = 0;
- mCasing2 = 0;
- mLevel = 0;
- if (checkPiece(mName, 1, 2, 0)) {
- if (mCasing1 == 8) mLevel = 1;
- if (mCasing2 == 8) mLevel = 2;
- return mLevel > 0 && mCasing >= 8 && checkHatch();
- }
- return false;
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(207));
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(1);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "CokeOven";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes;
-
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0);
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return this.mLevel * 12;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return (100-(GT_Utility.getTier(this.getMaxInputVoltage())*4));
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialCokeOven;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 24;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
+public class GregtechMetaTileEntity_IndustrialCokeOven
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCokeOven>
+ implements ISurvivalConstructable {
+
+ private int mLevel = 0;
+ private int mCasing;
+ private int mCasing1;
+ private int mCasing2;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialCokeOven> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialCokeOven(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialCokeOven(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialCokeOven(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Coke Oven";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Processes Logs and Coal into Charcoal and Coal Coke.")
+ .addInfo("Controller Block for the Industrial Coke Oven")
+ .addInfo("Gain 4% energy discount per voltage tier")
+ .addInfo("Process 12x materials with Heat Resistant Casings")
+ .addInfo("Or 24x materials with Heat Proof Casings")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front middle at bottom")
+ .addCasingInfo("Structural Coke Oven Casings", 8)
+ .addCasingInfo("Heat Resistant/Proof Coke Oven Casings", 8)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialCokeOven> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCokeOven>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"HHH", "H-H", "HHH"},
+ {"C~C", "CCC", "CCC"},
+ }))
+ .addShape(mName + "1", transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"aaa", "a-a", "aaa"},
+ {"C~C", "CCC", "CCC"},
+ }))
+ .addShape(mName + "2", transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"bbb", "b-b", "bbb"},
+ {"C~C", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialCokeOven.class)
+ .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler)
+ .casingIndex(TAE.GTPP_INDEX(1))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 1))))
+ .addElement(
+ 'H',
+ ofChain(
+ onElementPass(x -> ++x.mCasing1, ofBlock(ModBlocks.blockCasingsMisc, 2)),
+ onElementPass(x -> ++x.mCasing2, ofBlock(ModBlocks.blockCasingsMisc, 3))))
+ .addElement('a', ofBlock(ModBlocks.blockCasingsMisc, 2))
+ .addElement('b', ofBlock(ModBlocks.blockCasingsMisc, 3))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ if (stackSize.stackSize == 1) buildPiece(mName + "1", stackSize, hintsOnly, 1, 2, 0);
+ else buildPiece(mName + "2", stackSize, hintsOnly, 1, 2, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ if (stackSize.stackSize == 1)
+ return survivialBuildPiece(mName + "1", stackSize, 1, 2, 0, elementBudget, source, actor, false, true);
+ else return survivialBuildPiece(mName + "2", stackSize, 1, 2, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mCasing1 = 0;
+ mCasing2 = 0;
+ mLevel = 0;
+ if (checkPiece(mName, 1, 2, 0)) {
+ if (mCasing1 == 8) mLevel = 1;
+ if (mCasing2 == 8) mLevel = 2;
+ return mLevel > 0 && mCasing >= 8 && checkHatch();
+ }
+ return false;
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(207));
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(1);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "CokeOven";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return this.mLevel * 12;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return (100 - (GT_Utility.getTier(this.getMaxInputVoltage()) * 4));
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialCokeOven;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 24;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java
index 089b28a046..ac184e175b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java
@@ -1,5 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -23,199 +29,192 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialCuttingMachine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCuttingMachine> implements ISurvivalConstructable {
-
- private boolean mCuttingMode = true;
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialCuttingMachine> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialCuttingMachine(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialCuttingMachine(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialCuttingMachine(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Cutting Machine / Slicing Machine";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Cutting Factory")
- .addInfo("200% faster than using single block machines of the same voltage")
- .addInfo("Only uses 75% of the EU/t normally required")
- .addInfo("Processes four items per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 5, true)
- .addController("Front Center")
- .addCasingInfo("Cutting Factory Frames", 26)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialCuttingMachine> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCuttingMachine>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC", "CCC", "CCC"},
- {"C~C", "C-C", "C-C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialCuttingMachine.class)
- .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 13)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 26 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(29);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialCuttingMachine";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return mCuttingMode ? GT_Recipe.GT_Recipe_Map.sCutterRecipes : GT_Recipe.GT_Recipe_Map.sSlicerRecipes;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric((4* GT_Utility.getTier(this.getMaxInputVoltage())), 75, 200);
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 75;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialCuttingMachine;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 2;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasings2Misc;
- }
-
-
- public byte getCasingMeta() {
- return 13;
- }
-
-
- public byte getCasingTextureIndex() {
- return (byte) TAE.GTPP_INDEX(29);
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mCuttingMode = Utils.invertBoolean(mCuttingMode);
- String aMode = mCuttingMode ? "Cutting" : "Slicing";
- PlayerUtils.messagePlayer(aPlayer, "Mode: "+aMode);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mCuttingMode", mCuttingMode);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- if (aNBT.hasKey("mCuttingMode")) {
- mCuttingMode = aNBT.getBoolean("mCuttingMode");
- }
- else {
- mCuttingMode = true;
- }
- }
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialCuttingMachine
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCuttingMachine>
+ implements ISurvivalConstructable {
+
+ private boolean mCuttingMode = true;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialCuttingMachine> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialCuttingMachine(
+ final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialCuttingMachine(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialCuttingMachine(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Cutting Machine / Slicing Machine";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Cutting Factory")
+ .addInfo("200% faster than using single block machines of the same voltage")
+ .addInfo("Only uses 75% of the EU/t normally required")
+ .addInfo("Processes four items per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 5, true)
+ .addController("Front Center")
+ .addCasingInfo("Cutting Factory Frames", 26)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialCuttingMachine> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCuttingMachine>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "C-C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialCuttingMachine.class)
+ .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 13))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 26 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(29);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialCuttingMachine";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return mCuttingMode ? GT_Recipe.GT_Recipe_Map.sCutterRecipes : GT_Recipe.GT_Recipe_Map.sSlicerRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric((4 * GT_Utility.getTier(this.getMaxInputVoltage())), 75, 200);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 75;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialCuttingMachine;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings2Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 13;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) TAE.GTPP_INDEX(29);
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mCuttingMode = Utils.invertBoolean(mCuttingMode);
+ String aMode = mCuttingMode ? "Cutting" : "Slicing";
+ PlayerUtils.messagePlayer(aPlayer, "Mode: " + aMode);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mCuttingMode", mCuttingMode);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ if (aNBT.hasKey("mCuttingMode")) {
+ mCuttingMode = aNBT.getBoolean("mCuttingMode");
+ } else {
+ mCuttingMode = true;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java
index e562e2d29d..c1ed59ce2b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java
@@ -1,7 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofCoil;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -23,6 +28,8 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -30,362 +37,363 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gregtech.api.util.GT_StructureUtility.ofCoil;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator> implements ISurvivalConstructable {
-
- private static int CASING_TEXTURE_ID;
- private static String mCasingName = "Vacuum Casing";
- private HeatingCoilLevel mHeatingCapacity;
- private boolean mDehydratorMode = false;
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialDehydrator> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialDehydrator(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10);
- }
-
- public GregtechMetaTileEntity_IndustrialDehydrator(String aName) {
- super(aName);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialDehydrator(mName);
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Factory Grade Vacuum Furnace")
- .addInfo("Can toggle the operation temperature with a Screwdriver")
- .addInfo("All Dehydrator recipes are Low Temp recipes")
- .addInfo("Speed: +120% | EU Usage: 50% | Parallel: 4")
- .addInfo("Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)")
- .addInfo("Each 1800K over the min. Heat Capacity allows for one upgraded overclock")
- .addInfo("Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 5, 3, true)
- .addController("Bottom Center")
- .addCasingInfo(mCasingName, 10)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialDehydrator> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialDehydrator>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"HHH", "H-H", "HHH"},
- {"HHH", "H-H", "HHH"},
- {"HHH", "H-H", "HHH"},
- {"C~C", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialDehydrator.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
- .casingIndex(CASING_TEXTURE_ID)
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 10)))
- )
- .addElement(
- 'H',
- ofCoil(
- GregtechMetaTileEntity_IndustrialDehydrator::setCoilLevel, GregtechMetaTileEntity_IndustrialDehydrator::getCoilLevel
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 4, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 4, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- setCoilLevel(HeatingCoilLevel.None);
- return checkPiece(mName, 1, 4, 0) && mCasing >= 10 && getCoilLevel() != HeatingCoilLevel.None && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return CASING_TEXTURE_ID;
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return mDehydratorMode ? GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes : GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerSecond(ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialDehydrator;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getMachineType() {
- return "Vacuum Furnace / Dehydrator";
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 4;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 50;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "ElectricBlastFurnace";
- }
-
- public boolean checkRecipe(ItemStack aStack) {
- return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 120);
- }
-
- @Override
- public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes,
- long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[] {};
- this.mOutputFluids = new FluidStack[] {};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- Logger.WARNING("Running checkRecipeGeneric(0)");
-
- GT_Recipe tRecipe = this.getRecipeMap().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
- Logger.WARNING("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null || this.mHeatingCapacity.getHeat() < tRecipe.mSpecialValue) {
- Logger.WARNING("BAD RETURN - 1");
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- Logger.WARNING("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- int tHeatCapacityDivTiers = (int) (mHeatingCapacity.getHeat() - tRecipe.mSpecialValue) / 900;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
- // Count recipes to do in parallel, consuming input items and fluids and
- // considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- Logger.WARNING("Broke at " + parallelRecipes + ".");
- break;
- }
- Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- Logger.WARNING("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
- int rInt = 2;
-
- this.mEUt = (int) Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= (tHeatCapacityDivTiers >= rInt ? 4 : 2);
- }
- }
-
- if (tHeatCapacityDivTiers > 0) {
- this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0)
- tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- Logger.WARNING("GOOD RETURN - 1");
- return true;
-
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mDehydratorMode = Utils.invertBoolean(mDehydratorMode);
- String aMode = mDehydratorMode ? "Dehydrator" : "Vacuum Furnace";
- PlayerUtils.messagePlayer(aPlayer, "Mode: "+aMode);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mDehydratorMode", mDehydratorMode);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mDehydratorMode = aNBT.getBoolean("mDehydratorMode");
- }
-
- public HeatingCoilLevel getCoilLevel() {
- return mHeatingCapacity;
- }
-
- public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
- mHeatingCapacity = aCoilLevel;
- }
+public class GregtechMetaTileEntity_IndustrialDehydrator
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator>
+ implements ISurvivalConstructable {
+
+ private static int CASING_TEXTURE_ID;
+ private static String mCasingName = "Vacuum Casing";
+ private HeatingCoilLevel mHeatingCapacity;
+ private boolean mDehydratorMode = false;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialDehydrator> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialDehydrator(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10);
+ }
+
+ public GregtechMetaTileEntity_IndustrialDehydrator(String aName) {
+ super(aName);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialDehydrator(mName);
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Factory Grade Vacuum Furnace")
+ .addInfo("Can toggle the operation temperature with a Screwdriver")
+ .addInfo("All Dehydrator recipes are Low Temp recipes")
+ .addInfo("Speed: +120% | EU Usage: 50% | Parallel: 4")
+ .addInfo("Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)")
+ .addInfo("Each 1800K over the min. Heat Capacity allows for one upgraded overclock")
+ .addInfo("Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 5, 3, true)
+ .addController("Bottom Center")
+ .addCasingInfo(mCasingName, 10)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialDehydrator> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialDehydrator>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"HHH", "H-H", "HHH"},
+ {"HHH", "H-H", "HHH"},
+ {"HHH", "H-H", "HHH"},
+ {"C~C", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialDehydrator.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
+ .casingIndex(CASING_TEXTURE_ID)
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 10))))
+ .addElement(
+ 'H',
+ ofCoil(
+ GregtechMetaTileEntity_IndustrialDehydrator::setCoilLevel,
+ GregtechMetaTileEntity_IndustrialDehydrator::getCoilLevel))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 4, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 4, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ setCoilLevel(HeatingCoilLevel.None);
+ return checkPiece(mName, 1, 4, 0) && mCasing >= 10 && getCoilLevel() != HeatingCoilLevel.None && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return CASING_TEXTURE_ID;
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return mDehydratorMode
+ ? GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes
+ : GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialDehydrator;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Vacuum Furnace / Dehydrator";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 4;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 50;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "ElectricBlastFurnace";
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 120);
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ Logger.WARNING("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = this.getRecipeMap()
+ .findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+
+ Logger.WARNING("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null || this.mHeatingCapacity.getHeat() < tRecipe.mSpecialValue) {
+ Logger.WARNING("BAD RETURN - 1");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ Logger.WARNING("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ int tHeatCapacityDivTiers = (int) (mHeatingCapacity.getHeat() - tRecipe.mSpecialValue) / 900;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+ // Count recipes to do in parallel, consuming input items and fluids and
+ // considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ Logger.WARNING("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ Logger.WARNING("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+ int rInt = 2;
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= (tHeatCapacityDivTiers >= rInt ? 4 : 2);
+ }
+ }
+
+ if (tHeatCapacityDivTiers > 0) {
+ this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ Logger.WARNING("GOOD RETURN - 1");
+ return true;
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mDehydratorMode = Utils.invertBoolean(mDehydratorMode);
+ String aMode = mDehydratorMode ? "Dehydrator" : "Vacuum Furnace";
+ PlayerUtils.messagePlayer(aPlayer, "Mode: " + aMode);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mDehydratorMode", mDehydratorMode);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mDehydratorMode = aNBT.getBoolean("mDehydratorMode");
+ }
+
+ public HeatingCoilLevel getCoilLevel() {
+ return mHeatingCapacity;
+ }
+
+ public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
+ mHeatingCapacity = aCoilLevel;
+ }
}
-
-
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java
index 9f7cbc8859..835b6c6378 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java
@@ -1,5 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -18,161 +24,157 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialElectrolyzer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialElectrolyzer> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialElectrolyzer> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialElectrolyzer(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialElectrolyzer(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialElectrolyzer(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Electrolyzer";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Electrolyzer")
- .addInfo("180% faster than using single block machines of the same voltage")
- .addInfo("Only uses 90% of the EU/t normally required")
- .addInfo("Processes two items per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front Center")
- .addCasingInfo("Electrolyzer Casings", 10)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialElectrolyzer> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialElectrolyzer>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialElectrolyzer.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
- .casingIndex(TAE.GTPP_INDEX(5))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 5)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(5);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialElectrolyzer";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric(2* GT_Utility.getTier(this.getMaxInputVoltage()), 90, 180);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialElectrolyzer;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 2* GT_Utility.getTier(this.getMaxInputVoltage());
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 90;
- }
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialElectrolyzer
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialElectrolyzer>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialElectrolyzer> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialElectrolyzer(
+ final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialElectrolyzer(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialElectrolyzer(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Electrolyzer";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Electrolyzer")
+ .addInfo("180% faster than using single block machines of the same voltage")
+ .addInfo("Only uses 90% of the EU/t normally required")
+ .addInfo("Processes two items per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front Center")
+ .addCasingInfo("Electrolyzer Casings", 10)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialElectrolyzer> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialElectrolyzer>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialElectrolyzer.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
+ .casingIndex(TAE.GTPP_INDEX(5))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 5))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(5);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialElectrolyzer";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(2 * GT_Utility.getTier(this.getMaxInputVoltage()), 90, 180);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialElectrolyzer;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 2 * GT_Utility.getTier(this.getMaxInputVoltage());
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 90;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java
index 4b794506f9..91c232d8fe 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java
@@ -1,6 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -19,213 +23,207 @@ import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialExtruder extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialExtruder> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialExtruder> STRUCTURE_DEFINITION = null;
-
-
- public GregtechMetaTileEntity_IndustrialExtruder(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialExtruder(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialExtruder(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Extruder";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Material Extruder")
- .addInfo("250% faster than using single block machines of the same voltage")
- .addInfo("Processes four items per voltage tier")
- .addInfo("Extrusion Shape for recipe goes in the Input Bus")
- .addInfo("Each Input Bus can have a different shape!")
- .addInfo("You can use several input buses per multiblock")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 5, true)
- .addController("Front Center")
- .addCasingInfo("Inconel Reinforced Casings", 28)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Back Center", 2)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialExtruder> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialExtruder>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC", "CCC", "CCC"},
- {"C~C", "C-C", "C-C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialExtruder.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 28 && checkHatch();
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(203));
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(33);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialExtruder";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sExtruderRecipes;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
- ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
- tBus.mRecipeMap = getRecipeMap();
- if (isValidMetaTileEntity(tBus)) {
- for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
- tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- ItemStack[] inputs = new ItemStack[tBusItems.size()];
- int slot = 0;
- for (ItemStack g : tBusItems) {
- inputs[slot++] = g;
- }
- if (inputs.length > 0) {
- int para = (4* GT_Utility.getTier(this.getMaxInputVoltage()));
- log("Recipe. ["+inputs.length+"]["+para+"]");
- if (checkRecipeGeneric(inputs, new FluidStack[]{}, para, 100, 250, 10000)) {
- log("Recipe 2.");
- return true;
- }
- }
-
- }
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialExtruder;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasings3Misc;
- }
-
- public byte getCasingMeta() {
- return 1;
- }
-
- public byte getCasingTextureIndex() {
- return (byte) TAE.GTPP_INDEX(33);
- }
+public class GregtechMetaTileEntity_IndustrialExtruder
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialExtruder>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialExtruder> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialExtruder(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialExtruder(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialExtruder(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Extruder";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Material Extruder")
+ .addInfo("250% faster than using single block machines of the same voltage")
+ .addInfo("Processes four items per voltage tier")
+ .addInfo("Extrusion Shape for recipe goes in the Input Bus")
+ .addInfo("Each Input Bus can have a different shape!")
+ .addInfo("You can use several input buses per multiblock")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 5, true)
+ .addController("Front Center")
+ .addCasingInfo("Inconel Reinforced Casings", 28)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Back Center", 2)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialExtruder> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialExtruder>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "C-C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialExtruder.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 28 && checkHatch();
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(203));
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(33);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialExtruder";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sExtruderRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
+ tBus.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tBus)) {
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ ItemStack[] inputs = new ItemStack[tBusItems.size()];
+ int slot = 0;
+ for (ItemStack g : tBusItems) {
+ inputs[slot++] = g;
+ }
+ if (inputs.length > 0) {
+ int para = (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ log("Recipe. [" + inputs.length + "][" + para + "]");
+ if (checkRecipeGeneric(inputs, new FluidStack[] {}, para, 100, 250, 10000)) {
+ log("Recipe 2.");
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ @Override
+ public void startProcess() {
+ this.sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialExtruder;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings3Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 1;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) TAE.GTPP_INDEX(33);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java
index 292c42930b..f6d65aafe6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java
@@ -1,5 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -19,197 +25,191 @@ import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialFluidHeater extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFluidHeater> implements ISurvivalConstructable {
-
- private int mCasing1;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialFluidHeater> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialFluidHeater(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialFluidHeater(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialFluidHeater(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Fluid Heater";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Fluid Heater")
- .addInfo("120% faster than using single block machines of the same voltage")
- .addInfo("Only uses 90% of the EU/t normally required")
- .addInfo("Processes eight items per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(5, 6, 5, true)
- .addController("Front Center")
- .addCasingInfo("Top/Bottom layer: Multi-use Casings", 34)
- .addCasingInfo("Middle layers: Thermal Containment Casing", 47)
- .addInputBus("Bottom Layer (optional)", 1)
- .addInputHatch("Bottom Layer", 1)
- .addOutputBus("Top Layer (optional)", 1)
- .addOutputHatch("Top Layer", 1)
- .addEnergyHatch("Any Multi-use Casing", 1)
- .addMaintenanceHatch("Any Multi-use Casing", 1)
- .addMufflerHatch("Any Multi-use Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialFluidHeater> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialFluidHeater>builder()
- .addShape(mName, transpose(new String[][]{
- {" TTT ", "TTTTT", "TTTTT", "TTTTT", " TTT "},
- {" XXX ", "X---X", "X---X", "X---X", " XXX "},
- {" XXX ", "X---X", "X---X", "X---X", " XXX "},
- {" XXX ", "X---X", "X---X", "X---X", " XXX "},
- {" X~X ", "X---X", "X---X", "X---X", " XXX "},
- {" BBB ", "BBBBB", "BBBBB", "BBBBB", " BBB "},
- }))
- .addElement(
- 'B',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class)
- .atLeast(InputBus, InputHatch, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2())))
- )
- .addElement('X', ofBlock(getCasingBlock1(), getCasingMeta1()))
- .addElement(
- 'T',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class)
- .atLeast(OutputBus, OutputHatch, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2())))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 2, 4, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 2, 4, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing1 = 0;
- boolean didBuild = checkPiece(mName, 2, 4, 0);
- log("Built? "+didBuild+", "+mCasing1);
- return didBuild && mCasing1 >= 34 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.getIndexFromPage(0, 1);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialThermalCentrifuge";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 120);
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 90;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialThermalCentrifuge;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock1() {
- return ModBlocks.blockCasings2Misc;
- }
-
- public byte getCasingMeta1() {
- return 11;
- }
-
- public Block getCasingBlock2() {
- return ModBlocks.blockCasings3Misc;
- }
-
- public byte getCasingMeta2() {
- return 2;
- }
-
- public byte getCasingTextureIndex() {
- return (byte) TAE.getIndexFromPage(2, 2);
- }
-
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialFluidHeater
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFluidHeater>
+ implements ISurvivalConstructable {
+
+ private int mCasing1;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialFluidHeater> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialFluidHeater(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialFluidHeater(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialFluidHeater(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Fluid Heater";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Fluid Heater")
+ .addInfo("120% faster than using single block machines of the same voltage")
+ .addInfo("Only uses 90% of the EU/t normally required")
+ .addInfo("Processes eight items per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(5, 6, 5, true)
+ .addController("Front Center")
+ .addCasingInfo("Top/Bottom layer: Multi-use Casings", 34)
+ .addCasingInfo("Middle layers: Thermal Containment Casing", 47)
+ .addInputBus("Bottom Layer (optional)", 1)
+ .addInputHatch("Bottom Layer", 1)
+ .addOutputBus("Top Layer (optional)", 1)
+ .addOutputHatch("Top Layer", 1)
+ .addEnergyHatch("Any Multi-use Casing", 1)
+ .addMaintenanceHatch("Any Multi-use Casing", 1)
+ .addMufflerHatch("Any Multi-use Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialFluidHeater> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialFluidHeater>builder()
+ .addShape(mName, transpose(new String[][] {
+ {" TTT ", "TTTTT", "TTTTT", "TTTTT", " TTT "},
+ {" XXX ", "X---X", "X---X", "X---X", " XXX "},
+ {" XXX ", "X---X", "X---X", "X---X", " XXX "},
+ {" XXX ", "X---X", "X---X", "X---X", " XXX "},
+ {" X~X ", "X---X", "X---X", "X---X", " XXX "},
+ {" BBB ", "BBBBB", "BBBBB", "BBBBB", " BBB "},
+ }))
+ .addElement(
+ 'B',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class)
+ .atLeast(InputBus, InputHatch, Maintenance, Energy, Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2()))))
+ .addElement('X', ofBlock(getCasingBlock1(), getCasingMeta1()))
+ .addElement(
+ 'T',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class)
+ .atLeast(OutputBus, OutputHatch, Maintenance, Energy, Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2()))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 2, 4, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 2, 4, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing1 = 0;
+ boolean didBuild = checkPiece(mName, 2, 4, 0);
+ log("Built? " + didBuild + ", " + mCasing1);
+ return didBuild && mCasing1 >= 34 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.getIndexFromPage(0, 1);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialThermalCentrifuge";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 120);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 90;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialThermalCentrifuge;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ public Block getCasingBlock1() {
+ return ModBlocks.blockCasings2Misc;
+ }
+
+ public byte getCasingMeta1() {
+ return 11;
+ }
+
+ public Block getCasingBlock2() {
+ return ModBlocks.blockCasings3Misc;
+ }
+
+ public byte getCasingMeta2() {
+ return 2;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) TAE.getIndexFromPage(2, 2);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java
index 3fefffda7a..ba31a4753a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java
@@ -1,8 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlocksFlat;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -23,301 +26,304 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlocksFlat;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialForgeHammer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialForgeHammer> implements ISurvivalConstructable {
-
- private int mCasing;
- private int mAnvil;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialForgeHammer> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialForgeHammer(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialForgeHammer(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- setAnvilBlocks();
- return new GregtechMetaTileEntity_IndustrialForgeHammer(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Forge Hammer";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Forge Hammer")
- .addInfo("Speed: +100% | EU Usage: 100% | Parallel: Tier x Anvil Tier x 8")
- .addInfo("T1 - Vanilla Anvil")
- .addInfo("Anvil goes in Middle 3x3x3 Structure");
- if (LoadedMods.Railcraft) {
- tt.addInfo("T2 - Steel Anvil");
- }
- if (LoadedMods.EnderIO) {
- tt.addInfo("T3 - Dark Steel Anvil");
- }
- if (LoadedMods.ThaumicBases) {
- tt.addInfo("T3 - Thaumic Anvil");
- tt.addInfo("T4 - Void Anvil");
- }
- tt.addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front Center")
- .addCasingInfo("Forge Casing", 10)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialForgeHammer> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- Map<Block, Integer> aBlockMap = new HashMap<Block, Integer>();
- aBlockMap.put(sAnvil, 0);
- if (LoadedMods.Railcraft) {
- aBlockMap.put(sSteelAnvil, 0);
- }
- if (LoadedMods.EnderIO) {
- aBlockMap.put(sDarkSteelAnvil, 0);
- }
- if (LoadedMods.ThaumicBases) {
- aBlockMap.put(sThaumiumAnvil, 0);
- aBlockMap.put(sVoidAnvil, 0);
- }
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialForgeHammer>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "CAC", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialForgeHammer.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(TAE.getIndexFromPage(1, 11))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 6)))
- )
- .addElement('A', onElementPass(x -> ++x.mAnvil, ofBlocksFlat(aBlockMap, sAnvil, 0)))
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- setAnvilBlocks();
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- setAnvilBlocks();
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(1);
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.getIndexFromPage(1, 11);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "MaterialPress";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sHammerRecipes;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- Block aAnvil = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (aAnvil != null) {
- int aAnvilTier = getAnvilTier(aAnvil);
- if (aAnvilTier > 0) {
- for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
- ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
- tBus.mRecipeMap = getRecipeMap();
- if (isValidMetaTileEntity(tBus)) {
- for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
- tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- if (checkRecipeGeneric(tBusItems.toArray(new ItemStack[]{}), new FluidStack[]{}, getMaxParallelRecipes() * aAnvilTier, 100, 100, 10000)) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialForgeHammer;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- private static Block sAnvil;
- private static Block sSteelAnvil;
- private static Block sDarkSteelAnvil;
- private static Block sThaumiumAnvil;
- private static Block sVoidAnvil;
-
- private static void setAnvilBlocks() {
- if (sAnvil == null) {
- sAnvil = Blocks.anvil;
- if (LoadedMods.Railcraft) {
- sSteelAnvil = GameRegistry.findBlock("Railcraft", "anvil");
- }
- if (LoadedMods.EnderIO) {
- sDarkSteelAnvil = GameRegistry.findBlock("EnderIO", "blockDarkSteelAnvil");
- }
- if (LoadedMods.ThaumicBases) {
- sThaumiumAnvil = GameRegistry.findBlock("thaumicbases", "thaumicAnvil");
- sVoidAnvil = GameRegistry.findBlock("thaumicbases", "voidAnvil");
- }
- }
- }
-
- public static boolean isBlockAnvil(Block aBlock) {
- setAnvilBlocks();
- if (sAnvil == aBlock) {
- return true;
- }
- if (LoadedMods.Railcraft) {
- if (sSteelAnvil == aBlock) {
- return true;
- }
- }
- if (LoadedMods.EnderIO) {
- if (sDarkSteelAnvil == aBlock) {
- return true;
- }
- }
- if (LoadedMods.ThaumicBases) {
- if (sThaumiumAnvil == aBlock || sVoidAnvil == aBlock) {
- return true;
- }
- }
- return false;
- }
-
- public static int getAnvilTier(Block aBlock) {
- if (isBlockAnvil(aBlock)) {
- if (sAnvil == aBlock) {
- return 1;
- }
- if (LoadedMods.Railcraft) {
- if (sSteelAnvil == aBlock) {
- return 2;
- }
- }
- if (LoadedMods.EnderIO) {
- if (sDarkSteelAnvil == aBlock) {
- return 3;
- }
- }
- if (LoadedMods.ThaumicBases) {
- if (sThaumiumAnvil == aBlock) {
- return 3;
- }
- if (sVoidAnvil == aBlock) {
- return 4;
- }
- }
- }
- return 0;
- }
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- setAnvilBlocks();
- super.onFirstTick(aBaseMetaTileEntity);
- }
-
+public class GregtechMetaTileEntity_IndustrialForgeHammer
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialForgeHammer>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private int mAnvil;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialForgeHammer> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialForgeHammer(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialForgeHammer(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ setAnvilBlocks();
+ return new GregtechMetaTileEntity_IndustrialForgeHammer(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Forge Hammer";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Forge Hammer")
+ .addInfo("Speed: +100% | EU Usage: 100% | Parallel: Tier x Anvil Tier x 8")
+ .addInfo("T1 - Vanilla Anvil")
+ .addInfo("Anvil goes in Middle 3x3x3 Structure");
+ if (LoadedMods.Railcraft) {
+ tt.addInfo("T2 - Steel Anvil");
+ }
+ if (LoadedMods.EnderIO) {
+ tt.addInfo("T3 - Dark Steel Anvil");
+ }
+ if (LoadedMods.ThaumicBases) {
+ tt.addInfo("T3 - Thaumic Anvil");
+ tt.addInfo("T4 - Void Anvil");
+ }
+ tt.addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front Center")
+ .addCasingInfo("Forge Casing", 10)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialForgeHammer> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ Map<Block, Integer> aBlockMap = new HashMap<Block, Integer>();
+ aBlockMap.put(sAnvil, 0);
+ if (LoadedMods.Railcraft) {
+ aBlockMap.put(sSteelAnvil, 0);
+ }
+ if (LoadedMods.EnderIO) {
+ aBlockMap.put(sDarkSteelAnvil, 0);
+ }
+ if (LoadedMods.ThaumicBases) {
+ aBlockMap.put(sThaumiumAnvil, 0);
+ aBlockMap.put(sVoidAnvil, 0);
+ }
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialForgeHammer>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "CAC", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialForgeHammer.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(TAE.getIndexFromPage(1, 11))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 6))))
+ .addElement('A', onElementPass(x -> ++x.mAnvil, ofBlocksFlat(aBlockMap, sAnvil, 0)))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ setAnvilBlocks();
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ setAnvilBlocks();
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(1);
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.getIndexFromPage(1, 11);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "MaterialPress";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sHammerRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ Block aAnvil = this.getBaseMetaTileEntity()
+ .getBlockAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if (aAnvil != null) {
+ int aAnvilTier = getAnvilTier(aAnvil);
+ if (aAnvilTier > 0) {
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
+ tBus.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tBus)) {
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ if (checkRecipeGeneric(
+ tBusItems.toArray(new ItemStack[] {}),
+ new FluidStack[] {},
+ getMaxParallelRecipes() * aAnvilTier,
+ 100,
+ 100,
+ 10000)) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ @Override
+ public void startProcess() {
+ this.sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialForgeHammer;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ private static Block sAnvil;
+ private static Block sSteelAnvil;
+ private static Block sDarkSteelAnvil;
+ private static Block sThaumiumAnvil;
+ private static Block sVoidAnvil;
+
+ private static void setAnvilBlocks() {
+ if (sAnvil == null) {
+ sAnvil = Blocks.anvil;
+ if (LoadedMods.Railcraft) {
+ sSteelAnvil = GameRegistry.findBlock("Railcraft", "anvil");
+ }
+ if (LoadedMods.EnderIO) {
+ sDarkSteelAnvil = GameRegistry.findBlock("EnderIO", "blockDarkSteelAnvil");
+ }
+ if (LoadedMods.ThaumicBases) {
+ sThaumiumAnvil = GameRegistry.findBlock("thaumicbases", "thaumicAnvil");
+ sVoidAnvil = GameRegistry.findBlock("thaumicbases", "voidAnvil");
+ }
+ }
+ }
+
+ public static boolean isBlockAnvil(Block aBlock) {
+ setAnvilBlocks();
+ if (sAnvil == aBlock) {
+ return true;
+ }
+ if (LoadedMods.Railcraft) {
+ if (sSteelAnvil == aBlock) {
+ return true;
+ }
+ }
+ if (LoadedMods.EnderIO) {
+ if (sDarkSteelAnvil == aBlock) {
+ return true;
+ }
+ }
+ if (LoadedMods.ThaumicBases) {
+ if (sThaumiumAnvil == aBlock || sVoidAnvil == aBlock) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static int getAnvilTier(Block aBlock) {
+ if (isBlockAnvil(aBlock)) {
+ if (sAnvil == aBlock) {
+ return 1;
+ }
+ if (LoadedMods.Railcraft) {
+ if (sSteelAnvil == aBlock) {
+ return 2;
+ }
+ }
+ if (LoadedMods.EnderIO) {
+ if (sDarkSteelAnvil == aBlock) {
+ return 3;
+ }
+ }
+ if (LoadedMods.ThaumicBases) {
+ if (sThaumiumAnvil == aBlock) {
+ return 3;
+ }
+ if (sVoidAnvil == aBlock) {
+ return 4;
+ }
+ }
+ }
+ return 0;
+ }
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ setAnvilBlocks();
+ super.onFirstTick(aBaseMetaTileEntity);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java
index 43a1686b2e..b06d416fef 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java
@@ -1,6 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.Random;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -18,255 +23,248 @@ import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.Random;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
+public class GregtechMetaTileEntity_IndustrialMacerator
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMacerator>
+ implements ISurvivalConstructable {
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+ private int mCasing;
+ private int mPerLayer;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialMacerator> STRUCTURE_DEFINITION = null;
-public class GregtechMetaTileEntity_IndustrialMacerator extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMacerator> implements ISurvivalConstructable {
-
- private int mCasing;
- private int mPerLayer;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialMacerator> STRUCTURE_DEFINITION = null;
+ public GregtechMetaTileEntity_IndustrialMacerator(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
- public GregtechMetaTileEntity_IndustrialMacerator(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
+ public GregtechMetaTileEntity_IndustrialMacerator(final String aName) {
+ super(aName);
+ }
- public GregtechMetaTileEntity_IndustrialMacerator(final String aName) {
- super(aName);
- }
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialMacerator(this.mName);
+ }
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialMacerator(this.mName);
- }
+ @Override
+ public String getMachineType() {
+ return "Macerator/Pulverizer";
+ }
- @Override
- public String getMachineType() {
- return "Macerator/Pulverizer";
- }
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Maceration Stack")
+ .addInfo("60% faster than using single block machines of the same voltage")
+ .addInfo("Processes 8*tier materials at a time")
+ .addInfo("ULV = Tier 0, LV = Tier 1, etc.")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 6, 3, true)
+ .addController("Bottom Center")
+ .addCasingInfo("Maceration Stack Casings", 26)
+ .addInputBus("Bottom Casing", 1)
+ .addEnergyHatch("Bottom Casing", 1)
+ .addMaintenanceHatch("Bottom Casing", 1)
+ .addOutputBus("One per layer except bottom layer", 2)
+ .addMufflerHatch("Any Casing", 2)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Maceration Stack")
- .addInfo("60% faster than using single block machines of the same voltage")
- .addInfo("Processes 8*tier materials at a time")
- .addInfo("ULV = Tier 0, LV = Tier 1, etc.")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 6, 3, true)
- .addController("Bottom Center")
- .addCasingInfo("Maceration Stack Casings", 26)
- .addInputBus("Bottom Casing", 1)
- .addEnergyHatch("Bottom Casing", 1)
- .addMaintenanceHatch("Bottom Casing", 1)
- .addOutputBus("One per layer except bottom layer", 2)
- .addMufflerHatch("Any Casing", 2)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialMacerator> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMacerator>builder()
+ .addShape(mName + "top", transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addShape(mName + "mid", transpose(new String[][] {
+ {"CCC", "C-C", "CCC"},
+ }))
+ .addShape(mName + "bottom", transpose(new String[][] {
+ {"B~B", "BBB", "BBB"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class)
+ .atLeast(OutputBus)
+ .shouldReject(t -> t.mPerLayer + 1 == t.mOutputBusses.size())
+ .casingIndex(TAE.GTPP_INDEX(7))
+ .dot(2)
+ .build(),
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class)
+ .atLeast(Energy, Maintenance, Muffler)
+ .shouldReject(t -> t.mPerLayer + 1 == t.mOutputBusses.size())
+ .casingIndex(TAE.GTPP_INDEX(7))
+ .dot(2)
+ .build(),
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 7))))
+ .addElement(
+ 'B',
+ ofChain(
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class)
+ .atLeast(Energy, Maintenance, InputBus)
+ .casingIndex(TAE.GTPP_INDEX(7))
+ .dot(2)
+ .build(),
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 7))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialMacerator> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMacerator>builder()
- .addShape(mName + "top", transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- }))
- .addShape(mName + "mid", transpose(new String[][]{
- {"CCC", "C-C", "CCC"},
- }))
- .addShape(mName + "bottom", transpose(new String[][]{
- {"B~B", "BBB", "BBB"},
- }))
- .addElement(
- 'C',
- ofChain(
- buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class)
- .atLeast(OutputBus)
- .shouldReject(t -> t.mPerLayer + 1 == t.mOutputBusses.size())
- .casingIndex(TAE.GTPP_INDEX(7))
- .dot(2)
- .build(),
- buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class)
- .atLeast(Energy, Maintenance, Muffler)
- .shouldReject(t -> t.mPerLayer + 1 == t.mOutputBusses.size())
- .casingIndex(TAE.GTPP_INDEX(7))
- .dot(2)
- .build(),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasingsMisc, 7
- )
- )
- )
- )
- .addElement(
- 'B',
- ofChain(
- buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class)
- .atLeast(Energy, Maintenance, InputBus)
- .casingIndex(TAE.GTPP_INDEX(7))
- .dot(2)
- .build(),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasingsMisc, 7
- )
- )
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName + "bottom", stackSize, hintsOnly, 1, 0, 0);
+ buildPiece(mName + "mid", stackSize, hintsOnly, 1, 1, 0);
+ buildPiece(mName + "mid", stackSize, hintsOnly, 1, 2, 0);
+ buildPiece(mName + "mid", stackSize, hintsOnly, 1, 3, 0);
+ buildPiece(mName + "mid", stackSize, hintsOnly, 1, 4, 0);
+ buildPiece(mName + "top", stackSize, hintsOnly, 1, 5, 0);
+ }
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName + "bottom", stackSize, hintsOnly, 1, 0, 0);
- buildPiece(mName + "mid", stackSize, hintsOnly, 1, 1, 0);
- buildPiece(mName + "mid", stackSize, hintsOnly, 1, 2, 0);
- buildPiece(mName + "mid", stackSize, hintsOnly, 1, 3, 0);
- buildPiece(mName + "mid", stackSize, hintsOnly, 1, 4, 0);
- buildPiece(mName + "top", stackSize, hintsOnly, 1, 5, 0);
- }
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ int built;
+ built = survivialBuildPiece(mName + "bottom", stackSize, 1, 0, 0, elementBudget, source, actor, false, true);
+ mPerLayer = 0;
+ if (built >= 0) return built;
+ built = survivialBuildPiece(mName + "mid", stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ mPerLayer = 1;
+ if (built >= 0) return built;
+ built = survivialBuildPiece(mName + "mid", stackSize, 1, 2, 0, elementBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ mPerLayer = 2;
+ built = survivialBuildPiece(mName + "mid", stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ mPerLayer = 3;
+ built = survivialBuildPiece(mName + "mid", stackSize, 1, 4, 0, elementBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ return survivialBuildPiece(mName + "top", stackSize, 1, 5, 0, elementBudget, source, actor, false, true);
+ }
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- int built;
- built = survivialBuildPiece(mName + "bottom", stackSize, 1, 0, 0, elementBudget, source, actor, false, true);
- mPerLayer = 0;
- if (built >= 0) return built;
- built = survivialBuildPiece(mName + "mid", stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- mPerLayer = 1;
- if (built >= 0) return built;
- built = survivialBuildPiece(mName + "mid", stackSize, 1, 2, 0, elementBudget, source, actor, false, true);
- if (built >= 0) return built;
- mPerLayer = 2;
- built = survivialBuildPiece(mName + "mid", stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
- if (built >= 0) return built;
- mPerLayer = 3;
- built = survivialBuildPiece(mName + "mid", stackSize, 1, 4, 0, elementBudget, source, actor, false, true);
- if (built >= 0) return built;
- return survivialBuildPiece(mName + "top", stackSize, 1, 5, 0, elementBudget, source, actor, false, true);
- }
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mPerLayer = 0;
+ if (checkPiece(mName + "bottom", 1, 0, 0)) {
+ while (mPerLayer < 4) {
+ if (!checkPiece(mName + "mid", 1, mPerLayer + 1, 0) || mPerLayer + 1 != mOutputBusses.size())
+ return false;
+ mPerLayer++;
+ }
+ return checkPiece(mName + "top", 1, 5, 0) && mOutputBusses.size() == 5 && mCasing >= 26 && checkHatch();
+ }
+ return false;
+ }
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mPerLayer = 0;
- if (checkPiece(mName + "bottom", 1, 0 ,0)) {
- while (mPerLayer < 4) {
- if (!checkPiece(mName + "mid", 1, mPerLayer + 1, 0) ||
- mPerLayer + 1 != mOutputBusses.size()) return false;
- mPerLayer ++;
- }
- return checkPiece(mName + "top", 1, 5, 0) && mOutputBusses.size() == 5 && mCasing >= 26 && checkHatch();
- }
- return false;
- }
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(201));
+ }
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(201));
- }
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_MatterFab_Active;
+ }
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_MatterFab_Active;
- }
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_MatterFab;
+ }
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_MatterFab;
- }
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(7);
+ }
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(7);
- }
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
+ @Override
+ public String getCustomGUIResourceName() {
+ return "MacerationStack";
+ }
- @Override
- public String getCustomGUIResourceName() {
- return "MacerationStack";
- }
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
+ }
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
- }
+ @Override
+ public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if ((aBaseMetaTileEntity.isClientSide())
+ && (aBaseMetaTileEntity.isActive())
+ && (aBaseMetaTileEntity.getFrontFacing() != 1)
+ && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0)
+ && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
+ final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity
+ .getWorld()
+ .spawnParticle(
+ "smoke",
+ (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F),
+ aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F),
+ (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F),
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
- @Override
- public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
- final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
- aBaseMetaTileEntity.getWorld().spawnParticle("smoke", (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F), (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F), 0.0D, 0.0D, 0.0D);
- }
- }
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 60, 7500);
+ }
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 60, 7500);
- }
-
- @Override
- protected boolean doesMachineBoostOutput() {
- return true;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- final long tVoltage = getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- return Math.max(1, 8 * tTier);
- }
+ @Override
+ protected boolean doesMachineBoostOutput() {
+ return true;
+ }
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
+ @Override
+ public int getMaxParallelRecipes() {
+ final long tVoltage = getMaxInputVoltage();
+ final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ return Math.max(1, 8 * tTier);
+ }
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMacerator;
- }
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
- @Override
- public int getAmountOfOutputs() {
- return 16;
- }
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMacerator;
+ }
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
+ @Override
+ public int getAmountOfOutputs() {
+ return 16;
+ }
- @Override
- public boolean isOverclockerUpgradable() {
- return true;
- }
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
-} \ No newline at end of file
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java
index 03a71ea918..356d72ff88 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java
@@ -1,6 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -19,210 +23,198 @@ import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialMixer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMixer> implements ISurvivalConstructable {
-
- public static int CASING_TEXTURE_ID;
- public static String mCasingName = "Multi-Use Casing";
- public static String mCasingName2 = "Titanium Turbine Casing";
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialMixer> STRUCTURE_DEFINITION = null;
-
-
- public GregtechMetaTileEntity_IndustrialMixer(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 2);
- }
-
- public GregtechMetaTileEntity_IndustrialMixer(final String aName) {
- super(aName);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 2);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialMixer(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Mixer";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Mixer")
- .addInfo("250% faster than using single block machines of the same voltage")
- .addInfo("Processes eight recipes per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 4, 3, false)
- .addController("Second Layer Center")
- .addCasingInfo(mCasingName, 16)
- .addCasingInfo(mCasingName2, 2)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialMixer> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMixer>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"CCC", "CMC", "CCC"},
- {"C~C", "CMC", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialMixer.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
- .casingIndex(CASING_TEXTURE_ID)
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2)))
- )
- .addElement(
- 'M',
- ofBlock(
- GregTech_API.sBlockCasings4, 11
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 2, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 2, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 2, 0) && mCasing >= 16 && checkHatch();
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(203));
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return CASING_TEXTURE_ID;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialMixer";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
- ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
- tBus.mRecipeMap = getRecipeMap();
- if (isValidMetaTileEntity(tBus)) {
- for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
- tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- ItemStack[] inputs = new ItemStack[tBusItems.size()];
- int slot = 0;
- for (ItemStack g : tBusItems) {
- inputs[slot++] = g;
- }
- log("Recipe. ["+inputs.length+"]["+getMaxParallelRecipes()+"]");
- FluidStack[] fluid = this.getStoredFluids().toArray(new FluidStack[] {});
- if (checkRecipeGeneric(inputs,fluid , getMaxParallelRecipes(), getEuDiscountForParallelism(), 250, 10000)) {
- log("Recipe 2.");
- return true;
- }
-
- }
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMixer;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
+public class GregtechMetaTileEntity_IndustrialMixer
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMixer> implements ISurvivalConstructable {
+
+ public static int CASING_TEXTURE_ID;
+ public static String mCasingName = "Multi-Use Casing";
+ public static String mCasingName2 = "Titanium Turbine Casing";
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialMixer> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialMixer(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 2);
+ }
+
+ public GregtechMetaTileEntity_IndustrialMixer(final String aName) {
+ super(aName);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 2);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialMixer(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Mixer";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Mixer")
+ .addInfo("250% faster than using single block machines of the same voltage")
+ .addInfo("Processes eight recipes per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 4, 3, false)
+ .addController("Second Layer Center")
+ .addCasingInfo(mCasingName, 16)
+ .addCasingInfo(mCasingName2, 2)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialMixer> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMixer>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"CCC", "CMC", "CCC"},
+ {"C~C", "CMC", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialMixer.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
+ .casingIndex(CASING_TEXTURE_ID)
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2))))
+ .addElement('M', ofBlock(GregTech_API.sBlockCasings4, 11))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 2, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 2, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 2, 0) && mCasing >= 16 && checkHatch();
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(203));
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return CASING_TEXTURE_ID;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialMixer";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
+ tBus.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tBus)) {
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ ItemStack[] inputs = new ItemStack[tBusItems.size()];
+ int slot = 0;
+ for (ItemStack g : tBusItems) {
+ inputs[slot++] = g;
+ }
+ log("Recipe. [" + inputs.length + "][" + getMaxParallelRecipes() + "]");
+ FluidStack[] fluid = this.getStoredFluids().toArray(new FluidStack[] {});
+ if (checkRecipeGeneric(inputs, fluid, getMaxParallelRecipes(), getEuDiscountForParallelism(), 250, 10000)) {
+ log("Recipe 2.");
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ @Override
+ public void startProcess() {
+ this.sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMixer;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java
index d4a505cc2e..dcca512e1a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java
@@ -1,5 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -21,226 +26,224 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialMolecularTransformer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMolecularTransformer> implements ISurvivalConstructable {
-
- private static final int CASING_TEXTURE_ID = 48;
- private int mCasing = 0;
-
- public GregtechMetaTileEntity_IndustrialMolecularTransformer(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialMolecularTransformer(final String aName) {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialMolecularTransformer(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Molecular Transformer";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
-
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Changes the structure of items to produce new ones")
- .addInfo("Maximum 1x of each bus/hatch.")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(7, 7, 7, false)
- .addController("Top Center")
- .addCasingInfo("Robust Tungstensteel Machine Casing", 40)
- .addCasingInfo("Tungstensteel Coils", 16)
- .addCasingInfo("Molecular Containment Casing", 52)
- .addCasingInfo("High Voltage Current Capacitor", 32)
- .addCasingInfo("Particle Containment Casing", 4)
- .addCasingInfo("Resonance Chamber I", 5)
- .addCasingInfo("Modulator I", 4)
- .addInputBus("Any Robust Tungstensteel Machine Casing", 1)
- .addOutputBus("Any Robust Tungstensteel Machine Casing", 1)
- .addEnergyHatch("Any Robust Tungstensteel Machine Casing", 1)
- .addMaintenanceHatch("Any Robust Tungstensteel Machine Casing", 1)
- .addMufflerHatch("Any Robust Tungstensteel Machine Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
-
- private static final String STRUCTURE_PIECE_MAIN = "main";
- private static IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> STRUCTURE_DEFINITION = null;
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMolecularTransformer>builder()
- .addShape(STRUCTURE_PIECE_MAIN, (new String[][]{
- {" ", " ", " xxx ", " x~x ", " xxx ", " ", " "},
- {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "},
- {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "},
- {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "},
- {" t ", " ttxtt ", " tyyyt ", "txyzyxt", " tyyyt ", " ttxtt ", " t "},
- {" c ", " ccecc ", " cxfxc ", "cefefec", " cxfxc ", " ccecc ", " c "},
- {" h ", " hhhhh ", " hhhhh ", "hhhhhhh", " hhhhh ", " hhhhh ", " h "},
- }))
-
- .addElement('x', ofBlock(getCasingBlock(), getCasingMeta()))
- .addElement('y', ofBlock(getCasingBlock(), getCasingMeta2()))
- .addElement('z', ofBlock(getCasingBlock(), getCasingMeta3()))
- .addElement('e', ofBlock(getCasingBlock2(), 0))
- .addElement('f', ofBlock(getCasingBlock2(), 4))
- .addElement('c', ofBlock(getCoilBlock(), 3))
- .addElement('t', ofBlock(getCasingBlock3(), getTungstenCasingMeta()))
- .addElement('h', buildHatchAdder(GregtechMetaTileEntity_IndustrialMolecularTransformer.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock3(), getTungstenCasingMeta())))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 3, 3, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 3, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0);
- if (this.mInputBusses.size() != 1 || this.mOutputBusses.size() != 1 || this.mEnergyHatches.size() != 1) {
- return false;
- }
- // there are 16 slot that only allow casing, so we subtract this from the grand total required
- return aDidBuild && mCasing >= 40 - 16 && checkHatch();
- }
-
- protected static int getCasingTextureIndex() {
- return CASING_TEXTURE_ID;
- }
-
- protected static Block getCasingBlock() {
- return ModBlocks.blockSpecialMultiCasings;
- }
-
- protected static Block getCasingBlock2() {
- return ModBlocks.blockSpecialMultiCasings2;
- }
-
- protected static Block getCasingBlock3() {
- return GregTech_API.sBlockCasings4;
- }
-
- protected static Block getCoilBlock() {
- return GregTech_API.sBlockCasings5;
- }
-
- protected static int getCasingMeta() {
- return 11;
- }
-
- protected static int getCasingMeta2() {
- return 12;
- }
-
- protected static int getCasingMeta3() {
- return 13;
- }
-
- protected static int getTungstenCasingMeta() {
- return 0;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return 44;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe_Map.sMolecularTransformerRecipes;
- }
-
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric();
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiMolecularTransformer;
- }
-
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean isNewExtendedFacingValid(ExtendedFacing alignment) {
- return alignment.getDirection() == ForgeDirection.UP && super.isNewExtendedFacingValid(alignment);
- }
+public class GregtechMetaTileEntity_IndustrialMolecularTransformer
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMolecularTransformer>
+ implements ISurvivalConstructable {
+
+ private static final int CASING_TEXTURE_ID = 48;
+ private int mCasing = 0;
+
+ public GregtechMetaTileEntity_IndustrialMolecularTransformer(
+ final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialMolecularTransformer(final String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialMolecularTransformer(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Molecular Transformer";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Changes the structure of items to produce new ones")
+ .addInfo("Maximum 1x of each bus/hatch.")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(7, 7, 7, false)
+ .addController("Top Center")
+ .addCasingInfo("Robust Tungstensteel Machine Casing", 40)
+ .addCasingInfo("Tungstensteel Coils", 16)
+ .addCasingInfo("Molecular Containment Casing", 52)
+ .addCasingInfo("High Voltage Current Capacitor", 32)
+ .addCasingInfo("Particle Containment Casing", 4)
+ .addCasingInfo("Resonance Chamber I", 5)
+ .addCasingInfo("Modulator I", 4)
+ .addInputBus("Any Robust Tungstensteel Machine Casing", 1)
+ .addOutputBus("Any Robust Tungstensteel Machine Casing", 1)
+ .addEnergyHatch("Any Robust Tungstensteel Machine Casing", 1)
+ .addMaintenanceHatch("Any Robust Tungstensteel Machine Casing", 1)
+ .addMufflerHatch("Any Robust Tungstensteel Machine Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ private static final String STRUCTURE_PIECE_MAIN = "main";
+ private static IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> STRUCTURE_DEFINITION =
+ null;
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMolecularTransformer>builder()
+ .addShape(STRUCTURE_PIECE_MAIN, (new String[][] {
+ {" ", " ", " xxx ", " x~x ", " xxx ", " ", " "},
+ {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "},
+ {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "},
+ {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "},
+ {" t ", " ttxtt ", " tyyyt ", "txyzyxt", " tyyyt ", " ttxtt ", " t "},
+ {" c ", " ccecc ", " cxfxc ", "cefefec", " cxfxc ", " ccecc ", " c "},
+ {" h ", " hhhhh ", " hhhhh ", "hhhhhhh", " hhhhh ", " hhhhh ", " h "},
+ }))
+ .addElement('x', ofBlock(getCasingBlock(), getCasingMeta()))
+ .addElement('y', ofBlock(getCasingBlock(), getCasingMeta2()))
+ .addElement('z', ofBlock(getCasingBlock(), getCasingMeta3()))
+ .addElement('e', ofBlock(getCasingBlock2(), 0))
+ .addElement('f', ofBlock(getCasingBlock2(), 4))
+ .addElement('c', ofBlock(getCoilBlock(), 3))
+ .addElement('t', ofBlock(getCasingBlock3(), getTungstenCasingMeta()))
+ .addElement(
+ 'h',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialMolecularTransformer.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing, ofBlock(getCasingBlock3(), getTungstenCasingMeta()))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 3, 3, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 3, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0);
+ if (this.mInputBusses.size() != 1 || this.mOutputBusses.size() != 1 || this.mEnergyHatches.size() != 1) {
+ return false;
+ }
+ // there are 16 slot that only allow casing, so we subtract this from the grand total required
+ return aDidBuild && mCasing >= 40 - 16 && checkHatch();
+ }
+
+ protected static int getCasingTextureIndex() {
+ return CASING_TEXTURE_ID;
+ }
+
+ protected static Block getCasingBlock() {
+ return ModBlocks.blockSpecialMultiCasings;
+ }
+
+ protected static Block getCasingBlock2() {
+ return ModBlocks.blockSpecialMultiCasings2;
+ }
+
+ protected static Block getCasingBlock3() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ protected static Block getCoilBlock() {
+ return GregTech_API.sBlockCasings5;
+ }
+
+ protected static int getCasingMeta() {
+ return 11;
+ }
+
+ protected static int getCasingMeta2() {
+ return 12;
+ }
+
+ protected static int getCasingMeta3() {
+ return 13;
+ }
+
+ protected static int getTungstenCasingMeta() {
+ return 0;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return 44;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe_Map.sMolecularTransformerRecipes;
+ }
+
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric();
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiMolecularTransformer;
+ }
+
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean isNewExtendedFacingValid(ExtendedFacing alignment) {
+ return alignment.getDirection() == ForgeDirection.UP && super.isNewExtendedFacingValid(alignment);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
index 4fe8848397..f3e54a3f1a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
@@ -1,7 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -21,6 +25,8 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -29,500 +35,493 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMetaTileEntity_IndustrialMultiMachine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMultiMachine> implements ISurvivalConstructable {
-
- protected int mInternalMode = 0;
- protected GT_Recipe[] mLastRecipeExtended = new GT_Recipe[9];
- private static final int MODE_COMPRESSOR = 0;
- private static final int MODE_LATHE = 1;
- private static final int MODE_MAGNETIC = 2;
- private static final int MODE_FERMENTER = 3;
- private static final int MODE_FLUIDEXTRACT = 4;
- private static final int MODE_EXTRACTOR = 5;
- private static final int MODE_LASER = 6;
- private static final int MODE_AUTOCLAVE = 7;
- private static final int MODE_FLUIDSOLIDIFY = 8;
- private static final int[][] MODE_MAP = new int[][] {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}};
- public static final String[] aToolTipNames = new String[9];
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialMultiMachine> STRUCTURE_DEFINITION = null;
-
- static {
- for (int id = 0; id < 9; id++) {
- GT_Recipe.GT_Recipe_Map recipeMap = getRecipeMap(id);
- if (recipeMap != null) {
- String aNEI = GT_LanguageManager.getTranslation(getRecipeMap(id).mNEIName);
- aToolTipNames[id] = aNEI != null ? aNEI : "BAD NEI NAME (Report to Github)";
- }
- }
- }
-
-
- public GregtechMetaTileEntity_IndustrialMultiMachine(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialMultiMachine(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialMultiMachine(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Nine in One";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- String[] aBuiltStrings = new String[3];
- aBuiltStrings[0] = aToolTipNames[0] + ", " + aToolTipNames[1] + ", " + aToolTipNames[2];
- aBuiltStrings[1] = aToolTipNames[3] + ", " + aToolTipNames[4] + ", " + aToolTipNames[5];
- aBuiltStrings[2] = aToolTipNames[6] + ", " + aToolTipNames[7] + ", " + aToolTipNames[8];
-
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Multi-Machine")
- .addInfo("250% faster than using single block machines of the same voltage")
- .addInfo("Only uses 80% of the EU/t normally required")
- .addInfo("Processes two items per voltage tier")
- .addInfo("Machine Type: [A] - " + EnumChatFormatting.YELLOW + aBuiltStrings[0] + EnumChatFormatting.RESET)
- .addInfo("Machine Type: [B] - " + EnumChatFormatting.YELLOW + aBuiltStrings[1] + EnumChatFormatting.RESET)
- .addInfo("Machine Type: [C] - " + EnumChatFormatting.YELLOW + aBuiltStrings[2] + EnumChatFormatting.RESET)
- .addInfo("Read Multi-Machine Manual for extra information")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front Center")
- .addCasingInfo("Multi-Use Casings", 6)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialMultiMachine> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMultiMachine>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialMultiMachine.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
- .casingIndex(getTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 6 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return getTextureIndex();
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "Generic3By3";
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- ArrayList<FluidStack> tFluids = getStoredFluids();
- //Logger.MACHINE_INFO("1");
- for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
- ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
- tBus.mRecipeMap = getRecipeMap();
- //Logger.MACHINE_INFO("2");
- if (isValidMetaTileEntity(tBus)) {
- //Logger.MACHINE_INFO("3");
- for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
- tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
-
- boolean aFoundCircuitInBus = false;
- for (ItemStack aBusItem : tBusItems) {
- if (ItemUtils.isControlCircuit(aBusItem)) {
- aFoundCircuitInBus = true;
- }
- }
- if (!aFoundCircuitInBus) {
- continue;
- }
-
- Object[] tempArray = tFluids.toArray(new FluidStack[] {});
- FluidStack[] properArray;
- properArray = ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray : new FluidStack[] {});
-
- //Logger.MACHINE_INFO("4");
- if (checkRecipeGeneric(tBusItems.toArray(new ItemStack[]{}), properArray,
- (2*GT_Utility.getTier(this.getMaxInputVoltage())), 80, 250, 10000)) return true;
- }
- return false;
-
- //return checkRecipeGeneric(2*GT_Utility.getTier(this.getMaxInputVoltage()), 90, 180);
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (2 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 80;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- if (mInternalMode == 0) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal;
- }
- else if (mInternalMode == 1) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid;
- }
- else { //config 2
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc;
- }
- }
-
- public int getTextureIndex() {
- return TAE.getIndexFromPage(2, 2);
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- private ItemStack getCircuit(ItemStack[] t) {
- for (ItemStack j : t) {
- if (j.getItem() == CI.getNumberedCircuit(0).getItem()) {
- if (j.getItemDamage() >= 20 && j.getItemDamage() <= 22) {
- return j;
- }
- }
- }
- return null;
- }
-
- private final int getCircuitID(ItemStack circuit) {
- int H = circuit.getItemDamage();
- int T = (H == 20 ? 0 : (H == 21 ? 1 : (H == 22 ? 2 : -1)));
- return MODE_MAP[this.mInternalMode][T];
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- private final GT_Recipe.GT_Recipe_Map getRecipeMap(ItemStack circuit) {
- return getRecipeMap(getCircuitID(circuit));
- }
-
- private static final GT_Recipe.GT_Recipe_Map getRecipeMap(int aMode) {
- if (aMode == MODE_COMPRESSOR) {
- return GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
- }
- else if (aMode == MODE_LATHE) {
- return GT_Recipe.GT_Recipe_Map.sLatheRecipes;
- }
- else if (aMode == MODE_MAGNETIC) {
- return GT_Recipe.GT_Recipe_Map.sPolarizerRecipes;
- }
- else if (aMode == MODE_FERMENTER) {
- return GT_Recipe.GT_Recipe_Map.sFermentingRecipes;
- }
- else if (aMode == MODE_FLUIDEXTRACT) {
- return GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes;
- }
- else if (aMode == MODE_EXTRACTOR) {
- return GT_Recipe.GT_Recipe_Map.sExtractorRecipes;
- }
- else if (aMode == MODE_LASER) {
- return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes;
- }
- else if (aMode == MODE_AUTOCLAVE) {
- return GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes;
- }
- else if (aMode == MODE_FLUIDSOLIDIFY) {
- return GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes;
- }
- else {
- return null;
- }
- }
-
- @Override
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
-
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Get Circuit info for this recipe.
- ItemStack tCircuit = getCircuit(aItemInputs);
- int tCircuitID = getCircuitID(tCircuit);
-
- Logger.MACHINE_INFO("Mode: "+tCircuitID);
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
-
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
-
- GT_Recipe.GT_Recipe_Map tRecipeMap = this.getRecipeMap(tCircuit);
- if (tRecipeMap == null)
- return false;
- GT_Recipe tRecipe = tRecipeMap.findRecipe(
- getBaseMetaTileEntity(), this.mLastRecipeExtended[tCircuitID], false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
- // Remember last recipe - an optimization for findRecipe()
- //this.mLastRecipe = tRecipe; //Let's not do this, it's bad.
- //Instead, how about I use a array for types?
- this.mLastRecipeExtended[tCircuitID] = tRecipe;
-
- if (tRecipe == null) {
- Logger.MACHINE_INFO("BAD RETURN - 1|"+tCircuitID);
-
- if (aItemInputs.length > 0) {
- Logger.MACHINE_INFO("Input Items: "+ItemUtils.getArrayStackNames(aItemInputs));
- }
- if (aFluidInputs.length > 0) {
- Logger.MACHINE_INFO("Input Fluids: "+ItemUtils.getFluidArrayStackNames(aFluidInputs));
- }
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- Logger.MACHINE_INFO("BAD RETURN - 2|"+tCircuitID);
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- Logger.WARNING("parallelRecipes: "+parallelRecipes);
- Logger.WARNING("aMaxParallelRecipes: "+aMaxParallelRecipes);
- Logger.WARNING("tTotalEUt: "+tTotalEUt);
- Logger.WARNING("tVoltage: "+tVoltage);
- Logger.WARNING("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- Logger.WARNING("Broke at "+parallelRecipes+".");
- break;
- }
- Logger.WARNING("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- Logger.MACHINE_INFO("BAD RETURN - 3|"+tCircuitID);
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- Logger.MACHINE_INFO("GOOD RETURN - 1|"+tCircuitID);
- return true;
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (mInternalMode < 2) {
- mInternalMode++;
- }
- else {
- mInternalMode = 0;
- }
- String mModeString = (mInternalMode == 0 ? "Metal" : mInternalMode == 1 ? "Fluid" : mInternalMode == 2 ? "Misc." : "null");
- PlayerUtils.messagePlayer(aPlayer, "Multi-Machine is now in "+mModeString+" mode.");
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mInternalMode", mInternalMode);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- this.mInternalMode = aNBT.getInteger("mInternalMode");
- super.loadNBTData(aNBT);
- }
-
-
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialMultiMachine
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMultiMachine>
+ implements ISurvivalConstructable {
+
+ protected int mInternalMode = 0;
+ protected GT_Recipe[] mLastRecipeExtended = new GT_Recipe[9];
+ private static final int MODE_COMPRESSOR = 0;
+ private static final int MODE_LATHE = 1;
+ private static final int MODE_MAGNETIC = 2;
+ private static final int MODE_FERMENTER = 3;
+ private static final int MODE_FLUIDEXTRACT = 4;
+ private static final int MODE_EXTRACTOR = 5;
+ private static final int MODE_LASER = 6;
+ private static final int MODE_AUTOCLAVE = 7;
+ private static final int MODE_FLUIDSOLIDIFY = 8;
+ private static final int[][] MODE_MAP = new int[][] {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}};
+ public static final String[] aToolTipNames = new String[9];
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialMultiMachine> STRUCTURE_DEFINITION = null;
+
+ static {
+ for (int id = 0; id < 9; id++) {
+ GT_Recipe.GT_Recipe_Map recipeMap = getRecipeMap(id);
+ if (recipeMap != null) {
+ String aNEI = GT_LanguageManager.getTranslation(getRecipeMap(id).mNEIName);
+ aToolTipNames[id] = aNEI != null ? aNEI : "BAD NEI NAME (Report to Github)";
+ }
+ }
+ }
+
+ public GregtechMetaTileEntity_IndustrialMultiMachine(
+ final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialMultiMachine(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialMultiMachine(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Nine in One";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ String[] aBuiltStrings = new String[3];
+ aBuiltStrings[0] = aToolTipNames[0] + ", " + aToolTipNames[1] + ", " + aToolTipNames[2];
+ aBuiltStrings[1] = aToolTipNames[3] + ", " + aToolTipNames[4] + ", " + aToolTipNames[5];
+ aBuiltStrings[2] = aToolTipNames[6] + ", " + aToolTipNames[7] + ", " + aToolTipNames[8];
+
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Multi-Machine")
+ .addInfo("250% faster than using single block machines of the same voltage")
+ .addInfo("Only uses 80% of the EU/t normally required")
+ .addInfo("Processes two items per voltage tier")
+ .addInfo("Machine Type: [A] - " + EnumChatFormatting.YELLOW + aBuiltStrings[0]
+ + EnumChatFormatting.RESET)
+ .addInfo("Machine Type: [B] - " + EnumChatFormatting.YELLOW + aBuiltStrings[1]
+ + EnumChatFormatting.RESET)
+ .addInfo("Machine Type: [C] - " + EnumChatFormatting.YELLOW + aBuiltStrings[2]
+ + EnumChatFormatting.RESET)
+ .addInfo("Read Multi-Machine Manual for extra information")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front Center")
+ .addCasingInfo("Multi-Use Casings", 6)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialMultiMachine> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMultiMachine>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialMultiMachine.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
+ .casingIndex(getTextureIndex())
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 6 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return getTextureIndex();
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "Generic3By3";
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ // Logger.MACHINE_INFO("1");
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
+ tBus.mRecipeMap = getRecipeMap();
+ // Logger.MACHINE_INFO("2");
+ if (isValidMetaTileEntity(tBus)) {
+ // Logger.MACHINE_INFO("3");
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+
+ boolean aFoundCircuitInBus = false;
+ for (ItemStack aBusItem : tBusItems) {
+ if (ItemUtils.isControlCircuit(aBusItem)) {
+ aFoundCircuitInBus = true;
+ }
+ }
+ if (!aFoundCircuitInBus) {
+ continue;
+ }
+
+ Object[] tempArray = tFluids.toArray(new FluidStack[] {});
+ FluidStack[] properArray;
+ properArray =
+ ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray : new FluidStack[] {});
+
+ // Logger.MACHINE_INFO("4");
+ if (checkRecipeGeneric(
+ tBusItems.toArray(new ItemStack[] {}),
+ properArray,
+ (2 * GT_Utility.getTier(this.getMaxInputVoltage())),
+ 80,
+ 250,
+ 10000)) return true;
+ }
+ return false;
+
+ // return checkRecipeGeneric(2*GT_Utility.getTier(this.getMaxInputVoltage()), 90, 180);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (2 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 80;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ if (mInternalMode == 0) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal;
+ } else if (mInternalMode == 1) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid;
+ } else { // config 2
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc;
+ }
+ }
+
+ public int getTextureIndex() {
+ return TAE.getIndexFromPage(2, 2);
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ private ItemStack getCircuit(ItemStack[] t) {
+ for (ItemStack j : t) {
+ if (j.getItem() == CI.getNumberedCircuit(0).getItem()) {
+ if (j.getItemDamage() >= 20 && j.getItemDamage() <= 22) {
+ return j;
+ }
+ }
+ }
+ return null;
+ }
+
+ private final int getCircuitID(ItemStack circuit) {
+ int H = circuit.getItemDamage();
+ int T = (H == 20 ? 0 : (H == 21 ? 1 : (H == 22 ? 2 : -1)));
+ return MODE_MAP[this.mInternalMode][T];
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ private final GT_Recipe.GT_Recipe_Map getRecipeMap(ItemStack circuit) {
+ return getRecipeMap(getCircuitID(circuit));
+ }
+
+ private static final GT_Recipe.GT_Recipe_Map getRecipeMap(int aMode) {
+ if (aMode == MODE_COMPRESSOR) {
+ return GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
+ } else if (aMode == MODE_LATHE) {
+ return GT_Recipe.GT_Recipe_Map.sLatheRecipes;
+ } else if (aMode == MODE_MAGNETIC) {
+ return GT_Recipe.GT_Recipe_Map.sPolarizerRecipes;
+ } else if (aMode == MODE_FERMENTER) {
+ return GT_Recipe.GT_Recipe_Map.sFermentingRecipes;
+ } else if (aMode == MODE_FLUIDEXTRACT) {
+ return GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes;
+ } else if (aMode == MODE_EXTRACTOR) {
+ return GT_Recipe.GT_Recipe_Map.sExtractorRecipes;
+ } else if (aMode == MODE_LASER) {
+ return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes;
+ } else if (aMode == MODE_AUTOCLAVE) {
+ return GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes;
+ } else if (aMode == MODE_FLUIDSOLIDIFY) {
+ return GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes;
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Get Circuit info for this recipe.
+ ItemStack tCircuit = getCircuit(aItemInputs);
+ int tCircuitID = getCircuitID(tCircuit);
+
+ Logger.MACHINE_INFO("Mode: " + tCircuitID);
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+
+ GT_Recipe.GT_Recipe_Map tRecipeMap = this.getRecipeMap(tCircuit);
+ if (tRecipeMap == null) return false;
+ GT_Recipe tRecipe = tRecipeMap.findRecipe(
+ getBaseMetaTileEntity(),
+ this.mLastRecipeExtended[tCircuitID],
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+
+ // Remember last recipe - an optimization for findRecipe()
+ // this.mLastRecipe = tRecipe; //Let's not do this, it's bad.
+ // Instead, how about I use a array for types?
+ this.mLastRecipeExtended[tCircuitID] = tRecipe;
+
+ if (tRecipe == null) {
+ Logger.MACHINE_INFO("BAD RETURN - 1|" + tCircuitID);
+
+ if (aItemInputs.length > 0) {
+ Logger.MACHINE_INFO("Input Items: " + ItemUtils.getArrayStackNames(aItemInputs));
+ }
+ if (aFluidInputs.length > 0) {
+ Logger.MACHINE_INFO("Input Fluids: " + ItemUtils.getFluidArrayStackNames(aFluidInputs));
+ }
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ Logger.MACHINE_INFO("BAD RETURN - 2|" + tCircuitID);
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ Logger.WARNING("parallelRecipes: " + parallelRecipes);
+ Logger.WARNING("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ Logger.WARNING("tTotalEUt: " + tTotalEUt);
+ Logger.WARNING("tVoltage: " + tVoltage);
+ Logger.WARNING("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ Logger.WARNING("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ Logger.MACHINE_INFO("BAD RETURN - 3|" + tCircuitID);
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ Logger.MACHINE_INFO("GOOD RETURN - 1|" + tCircuitID);
+ return true;
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (mInternalMode < 2) {
+ mInternalMode++;
+ } else {
+ mInternalMode = 0;
+ }
+ String mModeString =
+ (mInternalMode == 0 ? "Metal" : mInternalMode == 1 ? "Fluid" : mInternalMode == 2 ? "Misc." : "null");
+ PlayerUtils.messagePlayer(aPlayer, "Multi-Machine is now in " + mModeString + " mode.");
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mInternalMode", mInternalMode);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mInternalMode = aNBT.getInteger("mInternalMode");
+ super.loadNBTData(aNBT);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java
index 7f826575cc..a5d009f7b1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java
@@ -1,6 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -20,214 +24,214 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialPlatePress extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialPlatePress> implements ISurvivalConstructable {
-
- private boolean mFormingMode = false;
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialPlatePress> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialPlatePress(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialPlatePress(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialPlatePress(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Bending Machine, Forming Press";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for Advanced Bending & Forming")
- .addInfo("500% faster than using single block machines of the same voltage")
- .addInfo("Processes four items per voltage tier")
- .addInfo("Circuit for recipe goes in the Input Bus")
- .addInfo("Each Input Bus can have a different Circuit/Shape!")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front Center")
- .addCasingInfo("Material Press Machine Casings", 10)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialPlatePress> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialPlatePress>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialPlatePress.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(50)
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 4)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(203);
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return 50;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "MaterialPress";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return mFormingMode ? GT_Recipe.GT_Recipe_Map.sPressRecipes : GT_Recipe.GT_Recipe_Map.sBenderRecipes;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
- ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
- tBus.mRecipeMap = getRecipeMap();
- if (isValidMetaTileEntity(tBus)) {
- for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
- tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
-
- if (checkRecipeGeneric(tBusItems.toArray(new ItemStack[]{}), new FluidStack[]{},
- (4* GT_Utility.getTier(this.getMaxInputVoltage())), 100, 500, 10000)) return true;
- }
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- if (this.mFormingMode) return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialPlatePress_ModeForming;
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialPlatePress_ModeBending;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setBoolean("mFormingMode", mFormingMode);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mFormingMode = aNBT.getBoolean("mFormingMode");
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mFormingMode = Utils.invertBoolean(mFormingMode);
- if (mFormingMode){
- PlayerUtils.messagePlayer(aPlayer, "Now running in Forming Press Mode.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Now running in Bending Mode.");
- }
- }
+public class GregtechMetaTileEntity_IndustrialPlatePress
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialPlatePress>
+ implements ISurvivalConstructable {
+
+ private boolean mFormingMode = false;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialPlatePress> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialPlatePress(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialPlatePress(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialPlatePress(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Bending Machine, Forming Press";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for Advanced Bending & Forming")
+ .addInfo("500% faster than using single block machines of the same voltage")
+ .addInfo("Processes four items per voltage tier")
+ .addInfo("Circuit for recipe goes in the Input Bus")
+ .addInfo("Each Input Bus can have a different Circuit/Shape!")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front Center")
+ .addCasingInfo("Material Press Machine Casings", 10)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialPlatePress> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialPlatePress>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialPlatePress.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(50)
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 4))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(203);
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return 50;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "MaterialPress";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return mFormingMode ? GT_Recipe.GT_Recipe_Map.sPressRecipes : GT_Recipe.GT_Recipe_Map.sBenderRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
+ tBus.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tBus)) {
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+
+ if (checkRecipeGeneric(
+ tBusItems.toArray(new ItemStack[] {}),
+ new FluidStack[] {},
+ (4 * GT_Utility.getTier(this.getMaxInputVoltage())),
+ 100,
+ 500,
+ 10000)) return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ @Override
+ public void startProcess() {
+ this.sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ if (this.mFormingMode) return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialPlatePress_ModeForming;
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialPlatePress_ModeBending;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("mFormingMode", mFormingMode);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mFormingMode = aNBT.getBoolean("mFormingMode");
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mFormingMode = Utils.invertBoolean(mFormingMode);
+ if (mFormingMode) {
+ PlayerUtils.messagePlayer(aPlayer, "Now running in Forming Press Mode.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Now running in Bending Mode.");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java
index 74d0a63aed..bd62bb495f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java
@@ -1,6 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.Random;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -17,201 +21,199 @@ import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.Random;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialSifter extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialSifter> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialSifter> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialSifter(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialSifter(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialSifter(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Sifter";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Sifter")
- .addInfo("400% faster than single-block machines of the same voltage")
- .addInfo("Only uses 75% of the EU/t normally required")
- .addInfo("Processes four items per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(5, 3, 5, false)
- .addController("Bottom Center")
- .addCasingInfo("Sieve Grate", 18)
- .addCasingInfo("Sieve Casings", 35)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing (x4)", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialSifter> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialSifter>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC"},
- {"CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC"},
- {"CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialSifter.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
- .casingIndex(TAE.GTPP_INDEX(21))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 5)))
- )
- .addElement(
- 'M',
- ofBlock(
- ModBlocks.blockCasings2Misc, 6
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 2, 2, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 2, 2, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 2, 2, 0) && mCasing >= 35 && mOutputBusses.size() >= 4 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(21);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialSifter";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sSifterRecipes;
- }
-
- @Override
- public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
- final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
- if (tRandom.nextFloat() > 0.4) return;
-
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
-
- aBaseMetaTileEntity.getWorld().spawnParticle("smoke",
- (aBaseMetaTileEntity.getXCoord() + xDir + 2.1F) - (tRandom.nextFloat() * 3.2F),
- aBaseMetaTileEntity.getYCoord() + 2.5f + (tRandom.nextFloat() * 1.2F),
- (aBaseMetaTileEntity.getZCoord() + zDir + 2.1F) - (tRandom.nextFloat() * 3.2F),
- 0.0, 0.0, 0.0);
-
- }
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric((4* GT_Utility.getTier(this.getMaxInputVoltage())), 75, 400, 10000);
- }
-
- @Override
- protected boolean doesMachineBoostOutput() {
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 75;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialSifter;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 16;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return true;
- }
+public class GregtechMetaTileEntity_IndustrialSifter
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialSifter> implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialSifter> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialSifter(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialSifter(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialSifter(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Sifter";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Sifter")
+ .addInfo("400% faster than single-block machines of the same voltage")
+ .addInfo("Only uses 75% of the EU/t normally required")
+ .addInfo("Processes four items per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(5, 3, 5, false)
+ .addController("Bottom Center")
+ .addCasingInfo("Sieve Grate", 18)
+ .addCasingInfo("Sieve Casings", 35)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing (x4)", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialSifter> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialSifter>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC"},
+ {"CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC"},
+ {"CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialSifter.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
+ .casingIndex(TAE.GTPP_INDEX(21))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 5))))
+ .addElement('M', ofBlock(ModBlocks.blockCasings2Misc, 6))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 2, 2, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 2, 2, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 2, 2, 0) && mCasing >= 35 && mOutputBusses.size() >= 4 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(21);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialSifter";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sSifterRecipes;
+ }
+
+ @Override
+ public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if ((aBaseMetaTileEntity.isClientSide())
+ && (aBaseMetaTileEntity.isActive())
+ && (aBaseMetaTileEntity.getFrontFacing() != 1)
+ && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0)
+ && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
+ final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ if (tRandom.nextFloat() > 0.4) return;
+
+ final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
+ final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
+
+ aBaseMetaTileEntity
+ .getWorld()
+ .spawnParticle(
+ "smoke",
+ (aBaseMetaTileEntity.getXCoord() + xDir + 2.1F) - (tRandom.nextFloat() * 3.2F),
+ aBaseMetaTileEntity.getYCoord() + 2.5f + (tRandom.nextFloat() * 1.2F),
+ (aBaseMetaTileEntity.getZCoord() + zDir + 2.1F) - (tRandom.nextFloat() * 3.2F),
+ 0.0,
+ 0.0,
+ 0.0);
+ }
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric((4 * GT_Utility.getTier(this.getMaxInputVoltage())), 75, 400, 10000);
+ }
+
+ @Override
+ protected boolean doesMachineBoostOutput() {
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 75;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialSifter;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 16;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java
index 5a62c6c335..91698e4a0c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java
@@ -1,30 +1,6 @@
/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-
-import gregtech.api.enums.TAE;
-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.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
public class GregtechMetaTileEntity_IndustrialSinter
extends GT_MetaTileEntity_MultiBlockBase {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java
index 4e4e5009fc..08758e22bb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java
@@ -1,5 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -20,203 +27,173 @@ import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialThermalCentrifuge extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialThermalCentrifuge> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialThermalCentrifuge> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialThermalCentrifuge(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialThermalCentrifuge(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialThermalCentrifuge(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Thermal Centrifuge";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Thermal Centrifuge")
- .addInfo("150% faster than using single block machines of the same voltage")
- .addInfo("Only uses 80% of the EU/t normally required")
- .addInfo("Processes eight items per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 2, 3, false)
- .addController("Front Center")
- .addCasingInfo("Thermal Processing Casings/Noise Hazard Sign Blocks", 8)
- .addInputBus("Bottom Casing", 1)
- .addOutputBus("Bottom Casing", 1)
- .addEnergyHatch("Bottom Casing", 1)
- .addMaintenanceHatch("Bottom Casing", 1)
- .addMufflerHatch("Bottom Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialThermalCentrifuge> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialThermalCentrifuge>builder()
- .addShape(mName, transpose(new String[][]{
- {"X~X", "XXX", "XXX"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- buildHatchAdder(GregtechMetaTileEntity_IndustrialThermalCentrifuge.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .build(),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasings2Misc, 0
- )
- ),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- GregTech_API.sBlockCasings3, 9
- )
- )
- )
- )
- .addElement(
- 'X',
- ofChain(
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasings2Misc, 0
- )
- ),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- GregTech_API.sBlockCasings3, 9
- )
- )
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 0, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 0, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 0, 0) && mCasing >= 8 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return getCasingTextureIndex();
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialThermalCentrifuge";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric((8* GT_Utility.getTier(this.getMaxInputVoltage())), 80, 150);
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 80;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialThermalCentrifuge;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasings2Misc;
- }
-
- public byte getCasingMeta() {
- return 0;
- }
-
- public byte getCasingTextureIndex() {
- return (byte) TAE.GTPP_INDEX(16);
- }
-
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialThermalCentrifuge
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialThermalCentrifuge>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialThermalCentrifuge> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialThermalCentrifuge(
+ final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialThermalCentrifuge(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialThermalCentrifuge(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Thermal Centrifuge";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Thermal Centrifuge")
+ .addInfo("150% faster than using single block machines of the same voltage")
+ .addInfo("Only uses 80% of the EU/t normally required")
+ .addInfo("Processes eight items per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 2, 3, false)
+ .addController("Front Center")
+ .addCasingInfo("Thermal Processing Casings/Noise Hazard Sign Blocks", 8)
+ .addInputBus("Bottom Casing", 1)
+ .addOutputBus("Bottom Casing", 1)
+ .addEnergyHatch("Bottom Casing", 1)
+ .addMaintenanceHatch("Bottom Casing", 1)
+ .addMufflerHatch("Bottom Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialThermalCentrifuge> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialThermalCentrifuge>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"X~X", "XXX", "XXX"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialThermalCentrifuge.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .build(),
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)),
+ onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 9))))
+ .addElement(
+ 'X',
+ ofChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)),
+ onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 9))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 0, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 0, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 0, 0) && mCasing >= 8 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return getCasingTextureIndex();
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialThermalCentrifuge";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric((8 * GT_Utility.getTier(this.getMaxInputVoltage())), 80, 150);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 80;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialThermalCentrifuge;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings2Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 0;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) TAE.GTPP_INDEX(16);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java
index 3f94e4d647..283942ff6d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java
@@ -1,6 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -19,247 +24,244 @@ import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialVacuumFreezer> implements ISurvivalConstructable {
-
- public static int CASING_TEXTURE_ID;
- public static String mCryoFuelName = "Gelid Cryotheum";
- public static String mCasingName = "Advanced Cryogenic Casing";
- public static String mHatchName = "Cryotheum Hatch";
- public static FluidStack mFuelStack;
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialVacuumFreezer> STRUCTURE_DEFINITION = null;
-
- private final ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mCryotheumHatches = new ArrayList<>();
-
-
- public GregtechMetaTileEntity_IndustrialVacuumFreezer(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- mFuelStack = FluidUtils.getFluidStack("cryotheum", 1);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10);
- }
-
- public GregtechMetaTileEntity_IndustrialVacuumFreezer(final String aName) {
- super(aName);
- mFuelStack = FluidUtils.getFluidStack("cryotheum", 1);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10);
- }
-
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return (IMetaTileEntity) new GregtechMetaTileEntity_IndustrialVacuumFreezer(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Vacuum Freezer";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Factory Grade Advanced Vacuum Freezer")
- .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 4")
- .addInfo("Consumes 1L of " + mCryoFuelName + "/t during operation")
- .addInfo("Constructed exactly the same as a normal Vacuum Freezer")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front Center")
- .addCasingInfo(mCasingName, 10)
- .addStructureHint(mHatchName, 1)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialVacuumFreezer> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialVacuumFreezer>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class)
- .adder(GregtechMetaTileEntity_IndustrialVacuumFreezer::addCryotheumHatch)
- .hatchId(967)
- .shouldReject(t -> !t.mCryotheumHatches.isEmpty())
- .casingIndex(CASING_TEXTURE_ID)
- .dot(1)
- .build(),
- buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
- .casingIndex(CASING_TEXTURE_ID)
- .dot(1)
- .build(),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasings3Misc, 10
- )
- )
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mCryotheumHatches.clear();
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
- }
-
- @Override
- public boolean checkHatch() {
- return super.checkHatch() && !mCryotheumHatches.isEmpty();
- }
-
- private boolean addCryotheumHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 967) {
- return addToMachineListInternal(mCryotheumHatches, aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- @Override
- public void updateSlots() {
- for (GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : mCryotheumHatches)
- if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
- super.updateSlots();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return CASING_TEXTURE_ID;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "VacuumFreezer";
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT;
- }
-
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
- }
-
- public boolean checkRecipe(final ItemStack aStack) {
- return this.checkRecipeGeneric(4, 100, 100);
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 4;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialVacuumFreezer;
- }
-
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- private int mGraceTimer = 2;
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- /*if (this.getBaseMetaTileEntity().isActive()) {
- if (!this.depleteInput(mFuelStack.copy())) {
- this.getBaseMetaTileEntity().setActive(false);
- }
- } */
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- if (this.mStartUpCheck < 0) {
- if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
- if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
- if (!this.depleteInputFromRestrictedHatches(this.mCryotheumHatches, 10)) {
- if (mGraceTimer-- == 0) {
- this.causeMaintenanceIssue();
- this.stopMachine();
- mGraceTimer = 2;
- }
- }
- }
- }
- }
- }
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialVacuumFreezer
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialVacuumFreezer>
+ implements ISurvivalConstructable {
+
+ public static int CASING_TEXTURE_ID;
+ public static String mCryoFuelName = "Gelid Cryotheum";
+ public static String mCasingName = "Advanced Cryogenic Casing";
+ public static String mHatchName = "Cryotheum Hatch";
+ public static FluidStack mFuelStack;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialVacuumFreezer> STRUCTURE_DEFINITION = null;
+
+ private final ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mCryotheumHatches = new ArrayList<>();
+
+ public GregtechMetaTileEntity_IndustrialVacuumFreezer(
+ final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ mFuelStack = FluidUtils.getFluidStack("cryotheum", 1);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10);
+ }
+
+ public GregtechMetaTileEntity_IndustrialVacuumFreezer(final String aName) {
+ super(aName);
+ mFuelStack = FluidUtils.getFluidStack("cryotheum", 1);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10);
+ }
+
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return (IMetaTileEntity) new GregtechMetaTileEntity_IndustrialVacuumFreezer(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Vacuum Freezer";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Factory Grade Advanced Vacuum Freezer")
+ .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 4")
+ .addInfo("Consumes 1L of " + mCryoFuelName + "/t during operation")
+ .addInfo("Constructed exactly the same as a normal Vacuum Freezer")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front Center")
+ .addCasingInfo(mCasingName, 10)
+ .addStructureHint(mHatchName, 1)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialVacuumFreezer> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialVacuumFreezer>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class)
+ .adder(GregtechMetaTileEntity_IndustrialVacuumFreezer::addCryotheumHatch)
+ .hatchId(967)
+ .shouldReject(t -> !t.mCryotheumHatches.isEmpty())
+ .casingIndex(CASING_TEXTURE_ID)
+ .dot(1)
+ .build(),
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class)
+ .atLeast(
+ InputBus,
+ OutputBus,
+ Maintenance,
+ Energy,
+ Muffler,
+ InputHatch,
+ OutputHatch)
+ .casingIndex(CASING_TEXTURE_ID)
+ .dot(1)
+ .build(),
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 10))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mCryotheumHatches.clear();
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
+ }
+
+ @Override
+ public boolean checkHatch() {
+ return super.checkHatch() && !mCryotheumHatches.isEmpty();
+ }
+
+ private boolean addCryotheumHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase
+ && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 967) {
+ return addToMachineListInternal(mCryotheumHatches, aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void updateSlots() {
+ for (GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : mCryotheumHatches)
+ if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
+ super.updateSlots();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return CASING_TEXTURE_ID;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "VacuumFreezer";
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT;
+ }
+
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return true;
+ }
+
+ public boolean checkRecipe(final ItemStack aStack) {
+ return this.checkRecipeGeneric(4, 100, 100);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 4;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialVacuumFreezer;
+ }
+
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ private int mGraceTimer = 2;
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ /*if (this.getBaseMetaTileEntity().isActive()) {
+ if (!this.depleteInput(mFuelStack.copy())) {
+ this.getBaseMetaTileEntity().setActive(false);
+ }
+ } */
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ if (this.mStartUpCheck < 0) {
+ if (this.mMaxProgresstime > 0 && this.mProgresstime != 0
+ || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (!this.depleteInputFromRestrictedHatches(this.mCryotheumHatches, 10)) {
+ if (mGraceTimer-- == 0) {
+ this.causeMaintenanceIssue();
+ this.stopMachine();
+ mGraceTimer = 2;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java
index a63ffa36cd..7af022fffc 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java
@@ -1,5 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -31,314 +37,309 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialWashPlant extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWashPlant> implements ISurvivalConstructable {
-
- private int mMode = 0;
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialWashPlant> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialWashPlant(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialWashPlant(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialWashPlant(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Ore Washer, Simple Washer, Chemical Bath";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Wash Plant")
- .addInfo("Can be configured with a screwdriver to also do Simple Washer and process Chemical Bathing")
- .addInfo("400% faster than using single block machines of the same voltage")
- .addInfo("Processes four item per voltage tier")
- .addInfo("Always requires an Input Hatch full of water to refill structure")
- .addInfo("Need to be filled with water.")
- .addInfo("Will automatically fill water from input hatch.")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(5, 3, 7, true)
- .addController("Front Center")
- .addCasingInfo("Wash Plant Casings", 40)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialWashPlant> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWashPlant>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCCCC", "C C", "C C", "C C", "C C", "C C", "CCCCC"},
- {"CC~CC", "C C", "C C", "C C", "C C", "C C", "CCCCC"},
- {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialWashPlant.class)
- .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 2, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 2, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 2, 1, 0) && mCasing >= 40 && checkHatch();
- }
-
- @Override
- protected IAlignmentLimits getInitialAlignmentLimits() {
- // don't rotate a washer, water will flow out.
- return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return getCasingTextureIndex();
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialWashPlant";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return mMode == 0 ? GT_Recipe.GT_Recipe_Map.sOreWasherRecipes : mMode == 1 ? GTPP_Recipe_Map.sSimpleWasherRecipes : GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- if (checkForWater()) {
- return checkRecipeGeneric((4 * GT_Utility.getTier(this.getMaxInputVoltage())), 100, 400);
- }
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (4* GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- if (mMode == 2) return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath;
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWashPlant_ModeWasher;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasings2Misc;
- }
-
-
- public byte getCasingMeta() {
- return 4;
- }
-
-
- public byte getCasingTextureIndex() {
- return (byte) TAE.GTPP_INDEX(11);
- }
-
- public boolean checkForWater() {
-
- //Get Facing direction
- IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
- int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int mCurrentDirectionX;
- int mCurrentDirectionZ;
- int mOffsetX_Lower = 0;
- int mOffsetX_Upper = 0;
- int mOffsetZ_Lower = 0;
- int mOffsetZ_Upper = 0;
-
- if (mDirectionX == 0){
- mCurrentDirectionX = 2;
- mCurrentDirectionZ = 3;
- mOffsetX_Lower = -2;
- mOffsetX_Upper = 2;
- mOffsetZ_Lower = -3;
- mOffsetZ_Upper = 3;
- }
- else {
- mCurrentDirectionX = 3;
- mCurrentDirectionZ = 2;
- mOffsetX_Lower = -3;
- mOffsetX_Upper = 3;
- mOffsetZ_Lower = -2;
- mOffsetZ_Upper = 2;
- }
-
- //if (aBaseMetaTileEntity.fac)
-
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ;
-
- int tAmount = 0;
- for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) {
- for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) {
- for (int h = 0; h < 2; ++h) {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (tBlock == Blocks.air || tBlock == Blocks.flowing_water || tBlock == Blocks.water) {
- if (this.getStoredFluids() != null) {
- for (FluidStack stored : this.getStoredFluids()) {
- if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) {
- if (stored.amount >= 1000) {
- //Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
- stored.amount -= 1000;
- Block fluidUsed = null;
- if (tBlock == Blocks.air || tBlock == Blocks.flowing_water) {
- fluidUsed = Blocks.water;
- }
- if (tBlock == Blocks.water) {
- fluidUsed = BlocksItems.getFluidBlock(InternalName.fluidDistilledWater);
- }
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord() + xDir + i, aBaseMetaTileEntity.getYCoord() + h, aBaseMetaTileEntity.getZCoord() + zDir + j, fluidUsed);
-
-
- }
- }
- }
- }
- }
- if (tBlock == Blocks.water) {
- ++tAmount;
- //Utils.LOG_WARNING("Found Water");
- } else if (tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) {
- ++tAmount;
- ++tAmount;
- //Utils.LOG_WARNING("Found Distilled Water");
- }
- }
- }
- }
-
- boolean isValidWater = tAmount >= 45;
- if (isValidWater){
- Logger.WARNING("Filled structure.");
- }
- else {
- Logger.WARNING("Did not fill structure.");
- }
- return isValidWater;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mMode", mMode);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- if (aNBT.hasKey("mChemicalMode")) {
- boolean aTempMode = aNBT.getBoolean("mChemicalMode");
- if (aTempMode) {
- mMode = 2;
- }
- else {
- mMode = 0;
- }
- aNBT.removeTag("mChemicalMode");
- }
- if (aNBT.hasKey("mMode")) {
- mMode = aNBT.getInteger("mMode");
- }
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mMode++;
- if (mMode > 2) {
- mMode = 0;
- }
- if (mMode == 0){
- PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Ore Washer Mode.");
- }
- else if (mMode == 1){
- PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Simple Washer Mode.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Chemical Bath Mode.");
- }
- }
-
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialWashPlant
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWashPlant>
+ implements ISurvivalConstructable {
+
+ private int mMode = 0;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialWashPlant> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialWashPlant(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialWashPlant(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialWashPlant(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Ore Washer, Simple Washer, Chemical Bath";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Wash Plant")
+ .addInfo("Can be configured with a screwdriver to also do Simple Washer and process Chemical Bathing")
+ .addInfo("400% faster than using single block machines of the same voltage")
+ .addInfo("Processes four item per voltage tier")
+ .addInfo("Always requires an Input Hatch full of water to refill structure")
+ .addInfo("Need to be filled with water.")
+ .addInfo("Will automatically fill water from input hatch.")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(5, 3, 7, true)
+ .addController("Front Center")
+ .addCasingInfo("Wash Plant Casings", 40)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialWashPlant> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWashPlant>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCCCC", "C C", "C C", "C C", "C C", "C C", "CCCCC"},
+ {"CC~CC", "C C", "C C", "C C", "C C", "C C", "CCCCC"},
+ {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialWashPlant.class)
+ .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 2, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 2, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 2, 1, 0) && mCasing >= 40 && checkHatch();
+ }
+
+ @Override
+ protected IAlignmentLimits getInitialAlignmentLimits() {
+ // don't rotate a washer, water will flow out.
+ return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return getCasingTextureIndex();
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialWashPlant";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return mMode == 0
+ ? GT_Recipe.GT_Recipe_Map.sOreWasherRecipes
+ : mMode == 1 ? GTPP_Recipe_Map.sSimpleWasherRecipes : GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ if (checkForWater()) {
+ return checkRecipeGeneric((4 * GT_Utility.getTier(this.getMaxInputVoltage())), 100, 400);
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ if (mMode == 2) return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath;
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWashPlant_ModeWasher;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings2Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 4;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) TAE.GTPP_INDEX(11);
+ }
+
+ public boolean checkForWater() {
+
+ // Get Facing direction
+ IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
+ int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int mCurrentDirectionX;
+ int mCurrentDirectionZ;
+ int mOffsetX_Lower = 0;
+ int mOffsetX_Upper = 0;
+ int mOffsetZ_Lower = 0;
+ int mOffsetZ_Upper = 0;
+
+ if (mDirectionX == 0) {
+ mCurrentDirectionX = 2;
+ mCurrentDirectionZ = 3;
+ mOffsetX_Lower = -2;
+ mOffsetX_Upper = 2;
+ mOffsetZ_Lower = -3;
+ mOffsetZ_Upper = 3;
+ } else {
+ mCurrentDirectionX = 3;
+ mCurrentDirectionZ = 2;
+ mOffsetX_Lower = -3;
+ mOffsetX_Upper = 3;
+ mOffsetZ_Lower = -2;
+ mOffsetZ_Upper = 2;
+ }
+
+ // if (aBaseMetaTileEntity.fac)
+
+ final int xDir =
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX;
+ final int zDir =
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ;
+
+ int tAmount = 0;
+ for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) {
+ for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) {
+ for (int h = 0; h < 2; ++h) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ if (tBlock == Blocks.air || tBlock == Blocks.flowing_water || tBlock == Blocks.water) {
+ if (this.getStoredFluids() != null) {
+ for (FluidStack stored : this.getStoredFluids()) {
+ if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) {
+ if (stored.amount >= 1000) {
+ // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
+ stored.amount -= 1000;
+ Block fluidUsed = null;
+ if (tBlock == Blocks.air || tBlock == Blocks.flowing_water) {
+ fluidUsed = Blocks.water;
+ }
+ if (tBlock == Blocks.water) {
+ fluidUsed = BlocksItems.getFluidBlock(InternalName.fluidDistilledWater);
+ }
+ aBaseMetaTileEntity
+ .getWorld()
+ .setBlock(
+ aBaseMetaTileEntity.getXCoord() + xDir + i,
+ aBaseMetaTileEntity.getYCoord() + h,
+ aBaseMetaTileEntity.getZCoord() + zDir + j,
+ fluidUsed);
+ }
+ }
+ }
+ }
+ }
+ if (tBlock == Blocks.water) {
+ ++tAmount;
+ // Utils.LOG_WARNING("Found Water");
+ } else if (tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) {
+ ++tAmount;
+ ++tAmount;
+ // Utils.LOG_WARNING("Found Distilled Water");
+ }
+ }
+ }
+ }
+
+ boolean isValidWater = tAmount >= 45;
+ if (isValidWater) {
+ Logger.WARNING("Filled structure.");
+ } else {
+ Logger.WARNING("Did not fill structure.");
+ }
+ return isValidWater;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mMode", mMode);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ if (aNBT.hasKey("mChemicalMode")) {
+ boolean aTempMode = aNBT.getBoolean("mChemicalMode");
+ if (aTempMode) {
+ mMode = 2;
+ } else {
+ mMode = 0;
+ }
+ aNBT.removeTag("mChemicalMode");
+ }
+ if (aNBT.hasKey("mMode")) {
+ mMode = aNBT.getInteger("mMode");
+ }
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mMode++;
+ if (mMode > 2) {
+ mMode = 0;
+ }
+ if (mMode == 0) {
+ PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Ore Washer Mode.");
+ } else if (mMode == 1) {
+ PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Simple Washer Mode.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Chemical Bath Mode.");
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java
index c6292020f7..88a0a849dd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java
@@ -1,5 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -20,176 +26,171 @@ import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialWireMill extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWireMill> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialWireMill> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_IndustrialWireMill(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialWireMill(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialWireMill(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Wiremill";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Wire Factory")
- .addInfo("200% faster than using single block machines of the same voltage")
- .addInfo("Only uses 75% of the EU/t normally required")
- .addInfo("Processes four items per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 5, true)
- .addController("Front Center")
- .addCasingInfo("Wire Factory Casings", 32)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialWireMill> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWireMill>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC", "CCC", "CCC"},
- {"C~C", "C-C", "C-C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialWireMill.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 32 && checkHatch();
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(204);
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(6);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "IndustrialWireFactory";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric((4* GT_Utility.getTier(this.getMaxInputVoltage())), 75, 200);
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (4* GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 75;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWireMill;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasingsMisc;
- }
-
- public byte getCasingMeta() {
- return 6;
- }
-
- public byte getCasingTextureIndex() {
- return (byte) TAE.GTPP_INDEX(6);
- }
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialWireMill
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWireMill>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialWireMill> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialWireMill(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialWireMill(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialWireMill(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Wiremill";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Wire Factory")
+ .addInfo("200% faster than using single block machines of the same voltage")
+ .addInfo("Only uses 75% of the EU/t normally required")
+ .addInfo("Processes four items per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 5, true)
+ .addController("Front Center")
+ .addCasingInfo("Wire Factory Casings", 32)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialWireMill> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWireMill>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "C-C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialWireMill.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 32 && checkHatch();
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(204);
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(6);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "IndustrialWireFactory";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric((4 * GT_Utility.getTier(this.getMaxInputVoltage())), 75, 200);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 75;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWireMill;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasingsMisc;
+ }
+
+ public byte getCasingMeta() {
+ return 6;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) TAE.GTPP_INDEX(6);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java
index 5d6904bd46..439ab234cf 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java
@@ -1,12 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -18,386 +11,527 @@ import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_IronBlastFurnace;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_IronBlastFurnace;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
-public class GregtechMetaTileEntity_IronBlastFurnace
-extends MetaTileEntity {
- private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top)};
- private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)};
- private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)};
- public int mMaxProgresstime = 0;
- public int mUpdate = 30;
- public int mProgresstime = 0;
- public boolean mMachine = false;
- public ItemStack mOutputItem1;
- public ItemStack mOutputItem2;
-
- public GregtechMetaTileEntity_IronBlastFurnace(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, 4);
- }
-
- public GregtechMetaTileEntity_IronBlastFurnace(final String aName) {
- super(aName, 4);
- }
-
- @Override
- public String[] getDescription() {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- return new String[]{"Iron is a much better furnace material!",
- "Can be Automated",
- "Multiblock: 3x3x5 hollow with opening on top",
- "Same shape as Bronze/Bricked blast furnace, except one ring of 8 taller.",
- "40 Iron Plated Bricks required",
- };
- }
- else {
- return new String[]{"Sloooowly, Skip the Bronze age, Get some Steel!",
- "Multiblock: 3x3x5 hollow with opening on top",
- "40 Iron Plated Bricks required",
- "----",
- "Even though Iron melts hotter than bronze,",
- "this machine is to help players skip looking",
- "for tin and copper, which are not as common",
- "as Iron is. This machine takes 5x longer than the bronze",
- "blast furnace as a result.",
- "----",
- };
- }
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return aActive ? FACING_ACTIVE : FACING_FRONT;
- }
- return FACING_SIDE;
- }
-
- @Override
- public boolean isSteampowered() {
- return false;
- }
-
- @Override
- public boolean isElectric() {
- return false;
- }
-
- @Override
- public boolean isPneumatic() {
- return false;
- }
-
- @Override
- public boolean isEnetInput() {
- return false;
- }
-
- @Override
- public boolean isEnetOutput() {
- return false;
- }
-
- @Override
- public boolean isInputFacing(final byte aSide) {
- return false;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return false;
- }
-
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public int getProgresstime() {
- return this.mProgresstime;
- }
-
- @Override
- public int maxProgresstime() {
- return this.mMaxProgresstime;
- }
-
- @Override
- public int increaseProgress(final int aProgress) {
- this.mProgresstime += aProgress;
- return this.mMaxProgresstime - this.mProgresstime;
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCoverID) {
- return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID));
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IronBlastFurnace(this.mName);
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mProgresstime", this.mProgresstime);
- aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
- if (this.mOutputItem1 != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItem1.writeToNBT(tNBT);
- aNBT.setTag("mOutputItem1", tNBT);
- }
- if (this.mOutputItem2 != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItem2.writeToNBT(tNBT);
- aNBT.setTag("mOutputItem2", tNBT);
- }
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mUpdate = 30;
- this.mProgresstime = aNBT.getInteger("mProgresstime");
- this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
- this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- private boolean checkMachine() {
- final int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 4; j++) { //This is height
- for (int k = -1; k < 2; k++) {
- if (((xDir + i) != 0) || (j != 0) || ((zDir + k) != 0)) {
- if ((i != 0) || (j == -1) || (k != 0)) {
- if ((this.getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k) != ModBlocks.blockCasingsMisc) || (this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) {
- return false;
- }
- } else if ((!GT_Utility.arrayContains(this.getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[]{Blocks.lava, Blocks.flowing_lava, null})) && (!this.getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
- return false;
- }
- }
- }
- }
- }
- return true;
- }
-
- @Override
- public void onMachineBlockUpdate() {
- this.mUpdate = 30;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) {
- if ((aBaseMetaTileEntity.isClientSide()) &&
- (aBaseMetaTileEntity.isActive())) {
- aBaseMetaTileEntity.getWorld().spawnParticle("cloud", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), 0.0D, 0.3D, 0.0D);
- }
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mUpdate-- == 0) {
- this.mMachine = this.checkMachine();
- }
- if (this.mMachine) {
- if (this.mMaxProgresstime > 0) {
- if (++this.mProgresstime >= this.mMaxProgresstime) {
- this.addOutputProducts();
- this.mOutputItem1 = null;
- this.mOutputItem2 = null;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- try {
- GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel");
- } catch (final Exception e) {
- }
- }
- } else if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.checkRecipe();
- }
- }
- aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
- if (aBaseMetaTileEntity.isActive()) {
- if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
- this.mUpdate = 1;
- }
- if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
- this.mUpdate = 1;
- }
- } else {
- if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
- this.mUpdate = 1;
- }
- if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
- this.mUpdate = 1;
- }
- }
- }
- }
-
- private void addOutputProducts() {
- if (this.mOutputItem1 != null) {
- if (this.mInventory[2] == null) {
- this.mInventory[2] = GT_Utility.copy(new Object[]{this.mOutputItem1});
- } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
- this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
- }
- }
- if (this.mOutputItem2 != null) {
- if (this.mInventory[3] == null) {
- this.mInventory[3] = GT_Utility.copy(new Object[]{this.mOutputItem2});
- } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
- this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
- }
- }
- }
-
- private boolean spaceForOutput(final ItemStack aStack1, final ItemStack aStack2) {
- if (((this.mInventory[2] == null) || (aStack1 == null) || (((this.mInventory[2].stackSize + aStack1.stackSize) <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && (
- (this.mInventory[3] == null) || (aStack2 == null) || (((this.mInventory[3].stackSize + aStack2.stackSize) <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) {
- return true;
- }
- return false;
- }
-
- private int getProperTime(int time) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- return (int) (time/3);
- }
- else {
- return time;
- }
- }
-
- private boolean checkRecipe() {
-
- if (!this.mMachine) {
- return false;
- }
- if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) {
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron"))) {
- if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (this.spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 4*3);
- this.mMaxProgresstime = getProperTime(36000);
- return true;
- }
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (this.spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 2*3);
- this.mMaxProgresstime = getProperTime(4800);
- return true;
- }
- if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (this.spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 9);
- this.getBaseMetaTileEntity().decrStackSize(1, 4*3);
- this.mMaxProgresstime = getProperTime(64800);
- return true;
- }
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) {
- if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (this.spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 2*3);
- this.mMaxProgresstime = getProperTime(3600);
- return true;
- }
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (this.spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 1*3);
- this.mMaxProgresstime = getProperTime(2400);
- return true;
- }
- if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (this.spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 9);
- this.getBaseMetaTileEntity().decrStackSize(1, 2*3);
- this.mMaxProgresstime = getProperTime(32400);
- return true;
- }
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) {
- if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (this.spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 64);
- this.mMaxProgresstime = getProperTime(64800);
- return true;
- }
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (this.spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L)))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 18*3);
- this.mMaxProgresstime = getProperTime(43200);
- return true;
- }
- if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (this.spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 4*3);
- this.mMaxProgresstime = getProperTime(64800);
- return true;
- }
- }
- }
- this.mOutputItem1 = null;
- this.mOutputItem2 = null;
- return false;
- }
-
- @Override
- public boolean isGivingInformation() {
- return false;
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return aIndex > 1;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- if (aIndex < 2) {
- }
- return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]);
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return 0;
- }
+public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity {
+ private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top)};
+ private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)
+ };
+ private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)
+ };
+ public int mMaxProgresstime = 0;
+ public int mUpdate = 30;
+ public int mProgresstime = 0;
+ public boolean mMachine = false;
+ public ItemStack mOutputItem1;
+ public ItemStack mOutputItem2;
+
+ public GregtechMetaTileEntity_IronBlastFurnace(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional, 4);
+ }
+
+ public GregtechMetaTileEntity_IronBlastFurnace(final String aName) {
+ super(aName, 4);
+ }
+
+ @Override
+ public String[] getDescription() {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return new String[] {
+ "Iron is a much better furnace material!",
+ "Can be Automated",
+ "Multiblock: 3x3x5 hollow with opening on top",
+ "Same shape as Bronze/Bricked blast furnace, except one ring of 8 taller.",
+ "40 Iron Plated Bricks required",
+ };
+ } else {
+ return new String[] {
+ "Sloooowly, Skip the Bronze age, Get some Steel!",
+ "Multiblock: 3x3x5 hollow with opening on top",
+ "40 Iron Plated Bricks required",
+ "----",
+ "Even though Iron melts hotter than bronze,",
+ "this machine is to help players skip looking",
+ "for tin and copper, which are not as common",
+ "as Iron is. This machine takes 5x longer than the bronze",
+ "blast furnace as a result.",
+ "----",
+ };
+ }
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return aActive ? FACING_ACTIVE : FACING_FRONT;
+ }
+ return FACING_SIDE;
+ }
+
+ @Override
+ public boolean isSteampowered() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return false;
+ }
+
+ @Override
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return this.mProgresstime;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return this.mMaxProgresstime;
+ }
+
+ @Override
+ public int increaseProgress(final int aProgress) {
+ this.mProgresstime += aProgress;
+ return this.mMaxProgresstime - this.mProgresstime;
+ }
+
+ @Override
+ public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCoverID) {
+ return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover())
+ && (super.allowCoverOnSide(aSide, aCoverID));
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IronBlastFurnace(this.mName);
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setInteger("mProgresstime", this.mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
+ if (this.mOutputItem1 != null) {
+ final NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem1.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem1", tNBT);
+ }
+ if (this.mOutputItem2 != null) {
+ final NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem2.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem2", tNBT);
+ }
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mUpdate = 30;
+ this.mProgresstime = aNBT.getInteger("mProgresstime");
+ this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
+ this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ private boolean checkMachine() {
+ final int xDir =
+ ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX;
+ final int zDir =
+ ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 4; j++) { // This is height
+ for (int k = -1; k < 2; k++) {
+ if (((xDir + i) != 0) || (j != 0) || ((zDir + k) != 0)) {
+ if ((i != 0) || (j == -1) || (k != 0)) {
+ if ((this.getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k)
+ != ModBlocks.blockCasingsMisc)
+ || (this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) {
+ return false;
+ }
+ } else if ((!GT_Utility.arrayContains(
+ this.getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k),
+ new Object[] {Blocks.lava, Blocks.flowing_lava, null}))
+ && (!this.getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ this.mUpdate = 30;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) {
+ if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) {
+ aBaseMetaTileEntity
+ .getWorld()
+ .spawnParticle(
+ "cloud",
+ aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(),
+ aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1),
+ aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(),
+ 0.0D,
+ 0.3D,
+ 0.0D);
+ }
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate-- == 0) {
+ this.mMachine = this.checkMachine();
+ }
+ if (this.mMachine) {
+ if (this.mMaxProgresstime > 0) {
+ if (++this.mProgresstime >= this.mMaxProgresstime) {
+ this.addOutputProducts();
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ try {
+ GT_Mod.instance.achievements.issueAchievement(
+ aBaseMetaTileEntity
+ .getWorld()
+ .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
+ "steel");
+ } catch (final Exception e) {
+ }
+ }
+ } else if (aBaseMetaTileEntity.isAllowedToWork()) {
+ this.checkRecipe();
+ }
+ }
+ aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
+ if (aBaseMetaTileEntity.isActive()) {
+ if (aBaseMetaTileEntity.getAir(
+ aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
+ aBaseMetaTileEntity
+ .getWorld()
+ .setBlock(
+ aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1),
+ Blocks.lava,
+ 1,
+ 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getAir(
+ aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
+ aBaseMetaTileEntity.getYCoord() + 1,
+ aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
+ aBaseMetaTileEntity
+ .getWorld()
+ .setBlock(
+ aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
+ aBaseMetaTileEntity.getYCoord() + 1,
+ aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1),
+ Blocks.lava,
+ 1,
+ 2);
+ this.mUpdate = 1;
+ }
+ } else {
+ if (aBaseMetaTileEntity.getBlock(
+ aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))
+ == Blocks.lava) {
+ aBaseMetaTileEntity
+ .getWorld()
+ .setBlock(
+ aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1),
+ Blocks.air,
+ 0,
+ 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getBlock(
+ aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
+ aBaseMetaTileEntity.getYCoord() + 1,
+ aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))
+ == Blocks.lava) {
+ aBaseMetaTileEntity
+ .getWorld()
+ .setBlock(
+ aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
+ aBaseMetaTileEntity.getYCoord() + 1,
+ aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1),
+ Blocks.air,
+ 0,
+ 2);
+ this.mUpdate = 1;
+ }
+ }
+ }
+ }
+
+ private void addOutputProducts() {
+ if (this.mOutputItem1 != null) {
+ if (this.mInventory[2] == null) {
+ this.mInventory[2] = GT_Utility.copy(new Object[] {this.mOutputItem1});
+ } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
+ this.mInventory[2].stackSize = Math.min(
+ this.mOutputItem1.getMaxStackSize(),
+ this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
+ }
+ }
+ if (this.mOutputItem2 != null) {
+ if (this.mInventory[3] == null) {
+ this.mInventory[3] = GT_Utility.copy(new Object[] {this.mOutputItem2});
+ } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
+ this.mInventory[3].stackSize = Math.min(
+ this.mOutputItem2.getMaxStackSize(),
+ this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
+ }
+ }
+ }
+
+ private boolean spaceForOutput(final ItemStack aStack1, final ItemStack aStack2) {
+ if (((this.mInventory[2] == null)
+ || (aStack1 == null)
+ || (((this.mInventory[2].stackSize + aStack1.stackSize) <= this.mInventory[2].getMaxStackSize())
+ && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1))))
+ && ((this.mInventory[3] == null)
+ || (aStack2 == null)
+ || (((this.mInventory[3].stackSize + aStack2.stackSize) <= this.mInventory[3].getMaxStackSize())
+ && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) {
+ return true;
+ }
+ return false;
+ }
+
+ private int getProperTime(int time) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return (int) (time / 3);
+ } else {
+ return time;
+ }
+ }
+
+ private boolean checkRecipe() {
+
+ if (!this.mMachine) {
+ return false;
+ }
+ if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron"))
+ || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron"))) {
+ if ((this.mInventory[1].getItem() == Items.coal)
+ && (this.mInventory[1].stackSize >= 4)
+ && (this.spaceForOutput(
+ this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L),
+ this.mOutputItem2 =
+ GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) {
+ this.getBaseMetaTileEntity().decrStackSize(0, 1);
+ this.getBaseMetaTileEntity().decrStackSize(1, 4 * 3);
+ this.mMaxProgresstime = getProperTime(36000);
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke"))
+ && (this.mInventory[1].stackSize >= 2)
+ && (this.spaceForOutput(
+ this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L),
+ this.mOutputItem2 =
+ GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) {
+ this.getBaseMetaTileEntity().decrStackSize(0, 1);
+ this.getBaseMetaTileEntity().decrStackSize(1, 2 * 3);
+ this.mMaxProgresstime = getProperTime(4800);
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9)
+ && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal"))
+ || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal")))
+ && (this.mInventory[1].stackSize >= 4)
+ && (this.spaceForOutput(
+ this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
+ this.mOutputItem2 =
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ this.getBaseMetaTileEntity().decrStackSize(0, 9);
+ this.getBaseMetaTileEntity().decrStackSize(1, 4 * 3);
+ this.mMaxProgresstime = getProperTime(64800);
+ return true;
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) {
+ if ((this.mInventory[1].getItem() == Items.coal)
+ && (this.mInventory[1].stackSize >= 2)
+ && (this.spaceForOutput(
+ this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L),
+ this.mOutputItem2 =
+ GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) {
+ this.getBaseMetaTileEntity().decrStackSize(0, 1);
+ this.getBaseMetaTileEntity().decrStackSize(1, 2 * 3);
+ this.mMaxProgresstime = getProperTime(3600);
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke"))
+ && (this.mInventory[1].stackSize >= 1)
+ && (this.spaceForOutput(
+ this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L),
+ this.mOutputItem2 =
+ GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) {
+ this.getBaseMetaTileEntity().decrStackSize(0, 1);
+ this.getBaseMetaTileEntity().decrStackSize(1, 1 * 3);
+ this.mMaxProgresstime = getProperTime(2400);
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9)
+ && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal"))
+ || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal")))
+ && (this.mInventory[1].stackSize >= 2)
+ && (this.spaceForOutput(
+ this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
+ this.mOutputItem2 =
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) {
+ this.getBaseMetaTileEntity().decrStackSize(0, 9);
+ this.getBaseMetaTileEntity().decrStackSize(1, 2 * 3);
+ this.mMaxProgresstime = getProperTime(32400);
+ return true;
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) {
+ if ((this.mInventory[1].getItem() == Items.coal)
+ && (this.mInventory[1].stackSize >= 36)
+ && (this.spaceForOutput(
+ this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
+ this.mOutputItem2 =
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ this.getBaseMetaTileEntity().decrStackSize(0, 1);
+ this.getBaseMetaTileEntity().decrStackSize(1, 64);
+ this.mMaxProgresstime = getProperTime(64800);
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke"))
+ && (this.mInventory[1].stackSize >= 18)
+ && (this.spaceForOutput(
+ this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
+ this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L)))) {
+ this.getBaseMetaTileEntity().decrStackSize(0, 1);
+ this.getBaseMetaTileEntity().decrStackSize(1, 18 * 3);
+ this.mMaxProgresstime = getProperTime(43200);
+ return true;
+ }
+ if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal"))
+ || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal")))
+ && (this.mInventory[1].stackSize >= 4)
+ && (this.spaceForOutput(
+ this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
+ this.mOutputItem2 =
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ this.getBaseMetaTileEntity().decrStackSize(0, 1);
+ this.getBaseMetaTileEntity().decrStackSize(1, 4 * 3);
+ this.mMaxProgresstime = getProperTime(64800);
+ return true;
+ }
+ }
+ }
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ return false;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return false;
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return aIndex > 1;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ if (aIndex < 2) {}
+ return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]);
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java
index 17687ff4c7..49713b3592 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java
@@ -1,8 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -29,6 +33,9 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.GT_MetaTileEntity_Hatch_MillingBalls;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -41,661 +48,648 @@ import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IsaMill> implements ISurvivalConstructable {
-
- protected boolean boostEu = false;
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IsaMill> STRUCTURE_DEFINITION = null;
-
- private static final IIconContainer frontFaceActive = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE5");
- private static final IIconContainer frontFace = new CustomIcon("iconsets/Grinder/GRINDER5");
-
- private final ArrayList<GT_MetaTileEntity_Hatch_MillingBalls> mMillingBallBuses = new ArrayList<GT_MetaTileEntity_Hatch_MillingBalls>();
- private static final DamageSource mIsaMillDamageSource = new DamageSource("gtpp.grinder").setDamageBypassesArmor();
-
- public GregtechMetaTileEntity_IsaMill(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IsaMill(String aName) {
- super(aName);
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Large Grinding Machine")
- .addInfo("Grind ores.")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 7, false)
- .addController("Front Center")
- .addCasingInfo("IsaMill Exterior Casing", 40)
+public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IsaMill>
+ implements ISurvivalConstructable {
+
+ protected boolean boostEu = false;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IsaMill> STRUCTURE_DEFINITION = null;
+
+ private static final IIconContainer frontFaceActive = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE5");
+ private static final IIconContainer frontFace = new CustomIcon("iconsets/Grinder/GRINDER5");
+
+ private final ArrayList<GT_MetaTileEntity_Hatch_MillingBalls> mMillingBallBuses =
+ new ArrayList<GT_MetaTileEntity_Hatch_MillingBalls>();
+ private static final DamageSource mIsaMillDamageSource = new DamageSource("gtpp.grinder").setDamageBypassesArmor();
+
+ public GregtechMetaTileEntity_IsaMill(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IsaMill(String aName) {
+ super(aName);
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Large Grinding Machine")
+ .addInfo("Grind ores.")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 7, false)
+ .addController("Front Center")
+ .addCasingInfo("IsaMill Exterior Casing", 40)
.addOtherStructurePart("IsaMill Gearbox", "5x, Inner Blocks")
.addOtherStructurePart("IsaMill Piping", "8x, ring around controller")
.addStructureInfo("IsaMill Pipings must not be obstructed in front (only air blocks)")
- .addOtherStructurePart("Milling Ball Hatch", "Any Casing")
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IsaMill> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IsaMill>builder()
- .addShape(mName, transpose(new String[][]{
- {"DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC"},
- {"D~D", "CGC", "CGC", "CGC", "CGC", "CGC", "CCC"},
- {"DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- buildHatchAdder(GregtechMetaTileEntity_IsaMill.class)
- .adder(GregtechMetaTileEntity_IsaMill::addMillingBallsHatch)
- .hatchClass(GT_MetaTileEntity_Hatch_MillingBalls.class)
- .shouldReject(t -> !t.mMillingBallBuses.isEmpty())
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .build(),
- buildHatchAdder(GregtechMetaTileEntity_IsaMill.class)
- .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .build(),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- getCasingBlock(), getCasingMeta()
- )
- )
- )
- )
- .addElement(
- 'D',
- ofBlock(
- getIntakeBlock(), getIntakeMeta()
- )
- )
- .addElement(
- 'G',
- ofBlock(
- getGearboxBlock(), getGearboxMeta()
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mMillingBallBuses.clear();
- return checkPiece(mName, 1, 1, 0) && mCasing >= 48 - 8 && checkHatch();
- }
-
- @Override
- public boolean checkHatch() {
- return super.checkHatch() && mMillingBallBuses.size() == 1;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return frontFaceActive;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return frontFace;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(2);
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return getMaxEfficiency(aStack) > 0;
- }
-
- private boolean addMillingBallsHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_MillingBalls) {
- return addToMachineListInternal(mMillingBallBuses, aMetaTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- @Override
- public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
-
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_MillingBalls) {
- log("Found GT_MetaTileEntity_Hatch_MillingBalls");
- return addToMachineListInternal(mMillingBallBuses, aMetaTileEntity, aBaseCasingIndex);
- }
- return super.addToMachineList(aTileEntity, aBaseCasingIndex);
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
- this.mMillingBallBuses.clear();
- }
- }
- if (aTick % 20 == 0) {
- checkForEntities(aBaseMetaTileEntity, aTick);
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- private final AutoMap<BlockPos> mFrontBlockPosCache = new AutoMap<BlockPos>();
-
- public void checkForEntities(IGregTechTileEntity aBaseMetaTileEntity, long aTime) {
-
- if (aTime % 100 == 0) {
- mFrontBlockPosCache.clear();
- }
- if (mFrontBlockPosCache.isEmpty()) {
- byte tSide = aBaseMetaTileEntity.getBackFacing();
- int aTileX = aBaseMetaTileEntity.getXCoord();
- int aTileY = aBaseMetaTileEntity.getYCoord();
- int aTileZ = aBaseMetaTileEntity.getZCoord();
- boolean xFacing = (tSide == 4 || tSide == 5);
- boolean zFacing = (tSide == 2 || tSide == 3);
-
- // Check Casings
- int aDepthOffset = (tSide == 2 || tSide == 4) ? 1 : -1;
- for (int aHorizontalOffset = -1; aHorizontalOffset < 2; aHorizontalOffset++) {
- for (int aVerticalOffset = -1; aVerticalOffset < 2; aVerticalOffset++) {
- int aX = !xFacing ? (aTileX + aHorizontalOffset) : (aTileX + aDepthOffset);
- int aY = aTileY + aVerticalOffset;
- int aZ = !zFacing ? (aTileZ + aHorizontalOffset) : (aTileZ + aDepthOffset);
- mFrontBlockPosCache.add(new BlockPos(aX, aY, aZ, aBaseMetaTileEntity.getWorld()));
- }
- }
- }
-
- AutoMap<EntityLivingBase> aEntities = getEntities(mFrontBlockPosCache, aBaseMetaTileEntity.getWorld());
- if (!aEntities.isEmpty()) {
- for (EntityLivingBase aFoundEntity : aEntities) {
- if (aFoundEntity instanceof EntityPlayer) {
- EntityPlayer aPlayer = (EntityPlayer) aFoundEntity;
- if (PlayerUtils.isCreative(aPlayer) || !PlayerUtils.canTakeDamage(aPlayer)) {
- continue;
- }
- else {
- if (aFoundEntity.getHealth() > 0) {
- EntityUtils.doDamage(aFoundEntity, mIsaMillDamageSource, (int) (aFoundEntity.getMaxHealth() / 5));
- if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) {
- generateParticles(aFoundEntity);
- }
- }
- }
- }
- if (aFoundEntity.getHealth() > 0) {
- EntityUtils.doDamage(aFoundEntity, mIsaMillDamageSource, Math.max(1, (int) (aFoundEntity.getMaxHealth() / 3)));
- if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) {
- generateParticles(aFoundEntity);
- }
- }
- }
- }
- }
-
- private static final AutoMap<EntityLivingBase> getEntities(AutoMap<BlockPos> aPositionsToCheck, World aWorld){
- AutoMap<EntityLivingBase> aEntities = new AutoMap<EntityLivingBase>();
- HashSet<Chunk> aChunksToCheck = new HashSet<Chunk>();
- if (!aPositionsToCheck.isEmpty()) {
- Chunk aLocalChunk;
- for (BlockPos aPos : aPositionsToCheck) {
- aLocalChunk = aWorld.getChunkFromBlockCoords(aPos.xPos, aPos.zPos);
- aChunksToCheck.add(aLocalChunk);
- }
- }
- if (!aChunksToCheck.isEmpty()) {
- AutoMap<EntityLivingBase> aEntitiesFound = new AutoMap<EntityLivingBase>();
- for (Chunk aChunk : aChunksToCheck) {
- if (aChunk.isChunkLoaded) {
- List[] aEntityLists = aChunk.entityLists;
- for (List aEntitySubList : aEntityLists) {
- for (Object aEntity : aEntitySubList) {
- if (aEntity instanceof EntityLivingBase) {
- EntityLivingBase aPlayer = (EntityLivingBase) aEntity;
- aEntitiesFound.add(aPlayer);
- }
- }
- }
- }
- }
- if (!aEntitiesFound.isEmpty()) {
- for (EntityLivingBase aEntity : aEntitiesFound) {
- BlockPos aPlayerPos = EntityUtils.findBlockPosOfEntity(aEntity);
- for (BlockPos aBlockSpaceToCheck : aPositionsToCheck) {
- if (aBlockSpaceToCheck.equals(aPlayerPos)) {
- aEntities.add(aEntity);
- }
- }
- }
- }
- }
- return aEntities;
- }
-
- private static void generateParticles(EntityLivingBase aEntity) {
- BlockPos aPlayerPosBottom = EntityUtils.findBlockPosOfEntity(aEntity);
- BlockPos aPlayerPosTop = aPlayerPosBottom.getUp();
- AutoMap<BlockPos> aEntityPositions = new AutoMap<BlockPos>();
- aEntityPositions.add(aPlayerPosBottom);
- aEntityPositions.add(aPlayerPosTop);
- for (int i = 0; i < 64; i++) {
- BlockPos aEffectPos = aEntityPositions.get(aEntity.height > 1f ? MathUtils.randInt(0, 1) : 0);
- float aOffsetX = MathUtils.randFloat(-0.35f, 0.35f);
- float aOffsetY = MathUtils.randFloat(-0.25f, 0.35f);
- float aOffsetZ = MathUtils.randFloat(-0.35f, 0.35f);
- aEntity.worldObj.spawnParticle("reddust", aEffectPos.xPos + aOffsetX, aEffectPos.yPos + 0.3f + aOffsetY, aEffectPos.zPos + aOffsetZ, 0.0D, 0.0D, 0.0D);
- }
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- return checkRecipeGeneric();
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasings5Misc;
- }
-
- public byte getCasingMeta() {
- return 0;
- }
-
- public Block getIntakeBlock() {
- return ModBlocks.blockCasings5Misc;
- }
-
- public byte getIntakeMeta() {
- return 1;
- }
-
- public Block getGearboxBlock() {
- return ModBlocks.blockCasings5Misc;
- }
-
- public byte getGearboxMeta() {
- return 2;
- }
-
- public byte getCasingTextureIndex() {
- return 66;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IsaMill(this.mName);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 1;
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIsaMill;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- public String[] getExtraInfoData() {
- return new String[]{
- "IsaMill Grinding Machine",
- "Current Efficiency: " + (mEfficiency / 100) + "%",
- getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance"
- };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Grinding Machine";
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- /*
- * Milling Ball Handling
- */
-
- @Override
+ .addOtherStructurePart("Milling Ball Hatch", "Any Casing")
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IsaMill> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IsaMill>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC"},
+ {"D~D", "CGC", "CGC", "CGC", "CGC", "CGC", "CCC"},
+ {"DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ buildHatchAdder(GregtechMetaTileEntity_IsaMill.class)
+ .adder(GregtechMetaTileEntity_IsaMill::addMillingBallsHatch)
+ .hatchClass(GT_MetaTileEntity_Hatch_MillingBalls.class)
+ .shouldReject(t -> !t.mMillingBallBuses.isEmpty())
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .build(),
+ buildHatchAdder(GregtechMetaTileEntity_IsaMill.class)
+ .atLeast(
+ InputBus,
+ OutputBus,
+ InputHatch,
+ OutputHatch,
+ Maintenance,
+ Energy,
+ Muffler)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .build(),
+ onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ .addElement('D', ofBlock(getIntakeBlock(), getIntakeMeta()))
+ .addElement('G', ofBlock(getGearboxBlock(), getGearboxMeta()))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mMillingBallBuses.clear();
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 48 - 8 && checkHatch();
+ }
+
+ @Override
+ public boolean checkHatch() {
+ return super.checkHatch() && mMillingBallBuses.size() == 1;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return frontFaceActive;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return frontFace;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(2);
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return getMaxEfficiency(aStack) > 0;
+ }
+
+ private boolean addMillingBallsHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_MillingBalls) {
+ return addToMachineListInternal(mMillingBallBuses, aMetaTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_MillingBalls) {
+ log("Found GT_MetaTileEntity_Hatch_MillingBalls");
+ return addToMachineListInternal(mMillingBallBuses, aMetaTileEntity, aBaseCasingIndex);
+ }
+ return super.addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
+ this.mMillingBallBuses.clear();
+ }
+ }
+ if (aTick % 20 == 0) {
+ checkForEntities(aBaseMetaTileEntity, aTick);
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ private final AutoMap<BlockPos> mFrontBlockPosCache = new AutoMap<BlockPos>();
+
+ public void checkForEntities(IGregTechTileEntity aBaseMetaTileEntity, long aTime) {
+
+ if (aTime % 100 == 0) {
+ mFrontBlockPosCache.clear();
+ }
+ if (mFrontBlockPosCache.isEmpty()) {
+ byte tSide = aBaseMetaTileEntity.getBackFacing();
+ int aTileX = aBaseMetaTileEntity.getXCoord();
+ int aTileY = aBaseMetaTileEntity.getYCoord();
+ int aTileZ = aBaseMetaTileEntity.getZCoord();
+ boolean xFacing = (tSide == 4 || tSide == 5);
+ boolean zFacing = (tSide == 2 || tSide == 3);
+
+ // Check Casings
+ int aDepthOffset = (tSide == 2 || tSide == 4) ? 1 : -1;
+ for (int aHorizontalOffset = -1; aHorizontalOffset < 2; aHorizontalOffset++) {
+ for (int aVerticalOffset = -1; aVerticalOffset < 2; aVerticalOffset++) {
+ int aX = !xFacing ? (aTileX + aHorizontalOffset) : (aTileX + aDepthOffset);
+ int aY = aTileY + aVerticalOffset;
+ int aZ = !zFacing ? (aTileZ + aHorizontalOffset) : (aTileZ + aDepthOffset);
+ mFrontBlockPosCache.add(new BlockPos(aX, aY, aZ, aBaseMetaTileEntity.getWorld()));
+ }
+ }
+ }
+
+ AutoMap<EntityLivingBase> aEntities = getEntities(mFrontBlockPosCache, aBaseMetaTileEntity.getWorld());
+ if (!aEntities.isEmpty()) {
+ for (EntityLivingBase aFoundEntity : aEntities) {
+ if (aFoundEntity instanceof EntityPlayer) {
+ EntityPlayer aPlayer = (EntityPlayer) aFoundEntity;
+ if (PlayerUtils.isCreative(aPlayer) || !PlayerUtils.canTakeDamage(aPlayer)) {
+ continue;
+ } else {
+ if (aFoundEntity.getHealth() > 0) {
+ EntityUtils.doDamage(
+ aFoundEntity, mIsaMillDamageSource, (int) (aFoundEntity.getMaxHealth() / 5));
+ if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) {
+ generateParticles(aFoundEntity);
+ }
+ }
+ }
+ }
+ if (aFoundEntity.getHealth() > 0) {
+ EntityUtils.doDamage(
+ aFoundEntity, mIsaMillDamageSource, Math.max(1, (int) (aFoundEntity.getMaxHealth() / 3)));
+ if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) {
+ generateParticles(aFoundEntity);
+ }
+ }
+ }
+ }
+ }
+
+ private static final AutoMap<EntityLivingBase> getEntities(AutoMap<BlockPos> aPositionsToCheck, World aWorld) {
+ AutoMap<EntityLivingBase> aEntities = new AutoMap<EntityLivingBase>();
+ HashSet<Chunk> aChunksToCheck = new HashSet<Chunk>();
+ if (!aPositionsToCheck.isEmpty()) {
+ Chunk aLocalChunk;
+ for (BlockPos aPos : aPositionsToCheck) {
+ aLocalChunk = aWorld.getChunkFromBlockCoords(aPos.xPos, aPos.zPos);
+ aChunksToCheck.add(aLocalChunk);
+ }
+ }
+ if (!aChunksToCheck.isEmpty()) {
+ AutoMap<EntityLivingBase> aEntitiesFound = new AutoMap<EntityLivingBase>();
+ for (Chunk aChunk : aChunksToCheck) {
+ if (aChunk.isChunkLoaded) {
+ List[] aEntityLists = aChunk.entityLists;
+ for (List aEntitySubList : aEntityLists) {
+ for (Object aEntity : aEntitySubList) {
+ if (aEntity instanceof EntityLivingBase) {
+ EntityLivingBase aPlayer = (EntityLivingBase) aEntity;
+ aEntitiesFound.add(aPlayer);
+ }
+ }
+ }
+ }
+ }
+ if (!aEntitiesFound.isEmpty()) {
+ for (EntityLivingBase aEntity : aEntitiesFound) {
+ BlockPos aPlayerPos = EntityUtils.findBlockPosOfEntity(aEntity);
+ for (BlockPos aBlockSpaceToCheck : aPositionsToCheck) {
+ if (aBlockSpaceToCheck.equals(aPlayerPos)) {
+ aEntities.add(aEntity);
+ }
+ }
+ }
+ }
+ }
+ return aEntities;
+ }
+
+ private static void generateParticles(EntityLivingBase aEntity) {
+ BlockPos aPlayerPosBottom = EntityUtils.findBlockPosOfEntity(aEntity);
+ BlockPos aPlayerPosTop = aPlayerPosBottom.getUp();
+ AutoMap<BlockPos> aEntityPositions = new AutoMap<BlockPos>();
+ aEntityPositions.add(aPlayerPosBottom);
+ aEntityPositions.add(aPlayerPosTop);
+ for (int i = 0; i < 64; i++) {
+ BlockPos aEffectPos = aEntityPositions.get(aEntity.height > 1f ? MathUtils.randInt(0, 1) : 0);
+ float aOffsetX = MathUtils.randFloat(-0.35f, 0.35f);
+ float aOffsetY = MathUtils.randFloat(-0.25f, 0.35f);
+ float aOffsetZ = MathUtils.randFloat(-0.35f, 0.35f);
+ aEntity.worldObj.spawnParticle(
+ "reddust",
+ aEffectPos.xPos + aOffsetX,
+ aEffectPos.yPos + 0.3f + aOffsetY,
+ aEffectPos.zPos + aOffsetZ,
+ 0.0D,
+ 0.0D,
+ 0.0D);
+ }
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ return checkRecipeGeneric();
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings5Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 0;
+ }
+
+ public Block getIntakeBlock() {
+ return ModBlocks.blockCasings5Misc;
+ }
+
+ public byte getIntakeMeta() {
+ return 1;
+ }
+
+ public Block getGearboxBlock() {
+ return ModBlocks.blockCasings5Misc;
+ }
+
+ public byte getGearboxMeta() {
+ return 2;
+ }
+
+ public byte getCasingTextureIndex() {
+ return 66;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IsaMill(this.mName);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 1;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIsaMill;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ return new String[] {
+ "IsaMill Grinding Machine",
+ "Current Efficiency: " + (mEfficiency / 100) + "%",
+ getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance"
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Grinding Machine";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ /*
+ * Milling Ball Handling
+ */
+
+ @Override
public ArrayList<ItemStack> getStoredInputs() {
- ArrayList<ItemStack> tItems = super.getStoredInputs();
+ ArrayList<ItemStack> tItems = super.getStoredInputs();
for (GT_MetaTileEntity_Hatch_MillingBalls tHatch : mMillingBallBuses) {
tHatch.mRecipeMap = getRecipeMap();
- if (isValidMetaTileEntity(tHatch)) {
- tItems.addAll(tHatch.getContentUsageSlots());
+ if (isValidMetaTileEntity(tHatch)) {
+ tItems.addAll(tHatch.getContentUsageSlots());
+ }
+ }
+ return tItems;
+ }
+
+ public int getMaxBallDurability(ItemStack aStack) {
+ return ItemGenericChemBase.getMaxBallDurability(aStack);
+ }
+
+ private ItemStack findMillingBall(ItemStack[] aItemInputs) {
+ if (mMillingBallBuses.size() != 1) {
+ return null;
+ } else {
+ GT_MetaTileEntity_Hatch_MillingBalls aBus = mMillingBallBuses.get(0);
+ if (aBus != null) {
+ AutoMap<ItemStack> aAvailableItems = aBus.getContentUsageSlots();
+ if (!aAvailableItems.isEmpty()) {
+ for (final ItemStack aInput : aItemInputs) {
+ if (ItemUtils.isMillingBall(aInput)) {
+ for (ItemStack aBall : aAvailableItems) {
+ if (GT_Utility.areStacksEqual(aBall, aInput, true)) {
+ Logger.INFO("Found a valid milling ball to use.");
+ return aBall;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private void damageMillingBall(ItemStack aStack) {
+ if (MathUtils.randFloat(0, 10000000) / 10000000f < (1.2f - (0.2 * 1))) {
+ int damage = getMillingBallDamage(aStack) + 1;
+ log("damage milling ball " + damage);
+ if (damage >= getMaxBallDurability(aStack)) {
+ log("consuming milling ball");
+ aStack.stackSize -= 1;
+ } else {
+ setDamage(aStack, damage);
+ }
+ } else {
+ log("not damaging milling ball");
+ }
+ }
+
+ private int getMillingBallDamage(ItemStack aStack) {
+ return ItemGenericChemBase.getMillingBallDamage(aStack);
+ }
+
+ private void setDamage(ItemStack aStack, int aAmount) {
+ ItemGenericChemBase.setMillingBallDamage(aStack, aAmount);
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ // checks if it has a milling ball with enough durability
+ ItemStack tMillingBallRecipe = findMillingBall(aItemInputs);
+ if (tMillingBallRecipe == null) {
+ log("does not have milling ball");
+ return false;
+ }
+
+ GT_Recipe tRecipe = findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+ log("aEUPercent " + aEUPercent);
+ log("mEUt " + tRecipe.mEUt);
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + 1);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tEnergy: " + tEnergy);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < 1 && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ log("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 4;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
}
}
- return tItems;
- }
-
-
- public int getMaxBallDurability(ItemStack aStack) {
- return ItemGenericChemBase.getMaxBallDurability(aStack);
- }
-
- private ItemStack findMillingBall(ItemStack[] aItemInputs) {
- if (mMillingBallBuses.size() != 1) {
- return null;
- }
- else {
- GT_MetaTileEntity_Hatch_MillingBalls aBus = mMillingBallBuses.get(0);
- if (aBus != null) {
- AutoMap<ItemStack> aAvailableItems = aBus.getContentUsageSlots();
- if (!aAvailableItems.isEmpty()) {
- for (final ItemStack aInput : aItemInputs) {
- if (ItemUtils.isMillingBall(aInput)) {
- for (ItemStack aBall : aAvailableItems) {
- if (GT_Utility.areStacksEqual(aBall, aInput, true)) {
- Logger.INFO("Found a valid milling ball to use.");
- return aBall;
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
-
-
- private void damageMillingBall(ItemStack aStack) {
- if (MathUtils.randFloat(0, 10000000)/10000000f < (1.2f - (0.2 * 1))) {
- int damage = getMillingBallDamage(aStack) + 1;
- log("damage milling ball "+damage);
- if (damage >= getMaxBallDurability(aStack)) {
- log("consuming milling ball");
- aStack.stackSize -= 1;
- }
- else {
- setDamage(aStack,damage);
- }
- }
- else {
- log("not damaging milling ball");
- }
- }
-
- private int getMillingBallDamage(ItemStack aStack) {
- return ItemGenericChemBase.getMillingBallDamage(aStack);
- }
-
- private void setDamage(ItemStack aStack,int aAmount) {
- ItemGenericChemBase.setMillingBallDamage(aStack, aAmount);
- }
-
-
- @Override
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
-
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- // checks if it has a milling ball with enough durability
- ItemStack tMillingBallRecipe = findMillingBall(aItemInputs);
- if (tMillingBallRecipe == null) {
- log("does not have milling ball");
- return false;
- }
-
- GT_Recipe tRecipe = findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
-
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
-
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
- log("aEUPercent "+aEUPercent);
- log("mEUt "+tRecipe.mEUt);
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+1);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tEnergy: "+tEnergy);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < 1 && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 4;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
-
- // Damage Milling ball once all is said and done.
- if (tMillingBallRecipe != null) {
- log("damaging milling ball");
- damageMillingBall(tMillingBallRecipe);
- }
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
- }
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Damage Milling ball once all is said and done.
+ if (tMillingBallRecipe != null) {
+ log("damaging milling ball");
+ damageMillingBall(tMillingBallRecipe);
+ }
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ log("GOOD RETURN - 1");
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java
index 23d28bb3dc..2ca76f5353 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java
@@ -1,7 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
@@ -23,418 +25,447 @@ import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.List;
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.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
-
-public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SpargeTower> implements ISurvivalConstructable {
-
- protected static final String STRUCTURE_PIECE_BASE = "base";
- protected static final String STRUCTURE_PIECE_LAYER = "layer";
- protected static final String STRUCTURE_PIECE_LAYER_HINT = "layerHint";
- protected static final String STRUCTURE_PIECE_TOP_HINT = "topHint";
- private static final IStructureDefinition<GregtechMetaTileEntity_SpargeTower> STRUCTURE_DEFINITION;
-
- static {
- IHatchElement<GregtechMetaTileEntity_SpargeTower> layeredOutputHatch = OutputHatch
- .withCount(GregtechMetaTileEntity_SpargeTower::getCurrentLayerOutputHatchCount)
- .withAdder(GregtechMetaTileEntity_SpargeTower::addLayerOutputHatch);
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SpargeTower>builder()
- .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{
- {"b~b", "bbb", "bbb"},
- }))
- .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{
- {"lll", "lcl", "lll"}
- }))
- .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][]{
- {"lll", "l-l", "lll"}
- }))
- .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][]{
- {"lll", "lll", "lll"}
- }))
- .addElement('b', buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class)
- .atLeast(Energy, InputHatch, InputBus, Maintenance)
- .casingIndex(getCasingIndex())
- .dot(1)
- .buildAndChain(onElementPass(GregtechMetaTileEntity_SpargeTower::onCasingFound, ofBlock(ModBlocks.blockCasings5Misc, 4)))
- )
- .addElement('l', ofChain(
- buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class)
- .atLeast(layeredOutputHatch)
- .casingIndex(getCasingIndex())
- .dot(2)
- .build(),
- ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addEnergyInputToMachineList, getCasingIndex(), 2),
- ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, getCasingIndex(), 2),
- onElementPass(GregtechMetaTileEntity_SpargeTower::onCasingFound, ofBlock(ModBlocks.blockCasings5Misc, 4))
- ))
- .addElement('c', ofChain(
- onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addOutputToMachineList, getCasingIndex(), 3)),
- onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, getCasingIndex(), 3)),
- onElementPass(t -> t.onTopLayerFound(true), ofBlock(ModBlocks.blockCasings5Misc, 4)),
- isAir()
- ))
- .build();
- }
-
- protected final List<List<GT_MetaTileEntity_Hatch_Output>> mOutputHatchesByLayer = new ArrayList<>();
- protected int mHeight;
- protected int mCasing;
- protected boolean mTopLayerFound;
-
- public GregtechMetaTileEntity_SpargeTower(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_SpargeTower(String aName) {
- super(aName);
- }
-
- public static int getCasingIndex() {
- return 68;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_SpargeTower(this.mName);
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Gas Sparge Tower")
- .addInfo("Controller block for the Sparging Tower")
- .addInfo("Fluids are only put out at the correct height")
- .addInfo("The correct height equals the slot number in the NEI recipe")
- .addSeparator()
- .beginStructureBlock(3, 8, 3, true)
- .addController("Front bottom")
- .addOtherStructurePart("Sparge Tower Exterior Casing", "45 (minimum)")
- .addEnergyHatch("Any casing", 1, 2)
- .addMaintenanceHatch("Any casing", 1, 2, 3)
- .addInputHatch("2x Input Hatches (Any bottom layer casing)", 1)
- .addOutputHatch("6x Output Hatches (At least one per layer except bottom layer)", 2, 3)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return getCasingIndex();
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png");
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- if (GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.isEmpty()) {
- generateRecipes();
- }
- return GTPP_Recipe_Map.sSpargeTowerRecipes;
- }
-
- private static boolean generateRecipes() {
- for (GasSpargingRecipe aRecipe : GasSpargingRecipeMap.mRecipes) {
- GTPP_Recipe newRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- null,
- aRecipe.mFluidInputs.clone(),
- new FluidStack[] {},
- aRecipe.mDuration,
- aRecipe.mEUt,
- 0);
- GTPP_Recipe_Map.sSpargeTowerRecipes.add(newRecipe);
- }
- if (GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.isEmpty()) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage));
- FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]);
- if (tFluids.length > 0) {
- Logger.INFO("Found "+tFluids.length+" input fluids. Searching "+GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.size()+" recipes.");
- GT_Recipe tRecipe = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids);
- if (tRecipe != null) {
- Logger.INFO("Found recipe!");
- if (tRecipe.isRecipeInputEqual(true, tFluids)) {
- Logger.INFO("Found recipe that matches!");
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
- this.mLastRecipe = tRecipe;
-
- calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage);
- int aDevProgress = this.mMaxProgresstime / 10;
- this.mMaxProgresstime = Math.max(1, aDevProgress);
- this.mOutputItems = new ItemStack[]{};
- ArrayList<FluidStack> aFluidOutputs = getByproductsOfSparge(tRecipe.mFluidInputs[0], tRecipe.mFluidInputs[1]);
- this.mOutputFluids = (FluidStack[]) aFluidOutputs.toArray(new FluidStack[0]);
- updateSlots();
- Logger.INFO("Done!");
- return true;
- }
- }
- else {
- Logger.INFO("Did not find recipe!");
- }
- }
- this.mEUt = 0;
- this.mEfficiency = 0;
- Logger.INFO("Did not find recipe! (2)");
- return false;
- }
-
- private static ArrayList<FluidStack> getByproductsOfSparge(final FluidStack aSpargeGas, final FluidStack aSpentFuel){
- GasSpargingRecipe aSpargeRecipe = GasSpargingRecipeMap.findRecipe(aSpargeGas, aSpentFuel);
- ArrayList<FluidStack> aOutputGases = new ArrayList<FluidStack>();
- if (aSpargeRecipe == null) {
- Logger.INFO("Did not find sparge recipe!");
- return aOutputGases;
- }
- int aSpargeGasAmount = aSpargeRecipe.mInputGas.amount;
-
- aOutputGases.add(aSpargeRecipe.mOutputSpargedFuel.copy());
- ArrayList<FluidStack> aTempMap = new ArrayList<FluidStack>();
- for (int i=2;i<aSpargeRecipe.mFluidOutputs.length;i++) {
- int aGasAmount = MathUtils.randInt(0, (aSpargeRecipe.mMaxOutputQuantity[i-2]/100));
- FluidStack aOutput = aSpargeRecipe.mFluidOutputs[i].copy();
- aSpargeGasAmount -= aGasAmount;
- FluidStack aSpargeOutput = null;
- if (aGasAmount > 0) {
- aSpargeOutput = new FluidStack(aOutput.getFluid(), aGasAmount);
- }
- aTempMap.add(aSpargeOutput);
- }
- Logger.INFO("Sparge gas left: "+aSpargeGasAmount);
- if (aSpargeGasAmount > 0) {
- aOutputGases.add(new FluidStack(aSpargeRecipe.mInputGas.getFluid(), aSpargeGasAmount));
- }
- //Logger.INFO("Sparge Outputs: "+ItemUtils.getArrayStackNames(aTempMap));
- aOutputGases.addAll(aTempMap);
- Logger.INFO("Sparge output size: "+aOutputGases.size());
- //Logger.INFO("Output of sparging: "+ItemUtils.getArrayStackNames(aOutputGases));
- return aOutputGases;
- }
-
- protected void onCasingFound() {
- mCasing++;
- }
-
- protected void onTopLayerFound(boolean aIsCasing) {
- mTopLayerFound = true;
- if (aIsCasing) {
- onCasingFound();
- }
- }
-
- protected int getCurrentLayerOutputHatchCount() {
- return mOutputHatchesByLayer.size() < mHeight ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size();
- }
-
- protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) {
- Logger.INFO("Bad Output Hatch");
- return false;
- }
- while (mOutputHatchesByLayer.size() < mHeight) {
- mOutputHatchesByLayer.add(new ArrayList<>());
- }
- GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity();
- tHatch.updateTexture(aBaseCasingIndex);
- boolean addedHatch = mOutputHatchesByLayer.get(mHeight - 1).add(tHatch);
- Logger.INFO("Added Hatch: "+addedHatch);
- return addedHatch;
- }
-
- @Override
- protected IAlignmentLimits getInitialAlignmentLimits() {
- // don't rotate a freaking tower, it won't work
- return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_SpargeTower> getStructureDefinition() {
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- // reset
- mOutputHatchesByLayer.forEach(List::clear);
- mHeight = 1;
- mTopLayerFound = false;
- mCasing = 0;
-
- // check base
- if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) {
- Logger.INFO("Bad Base. Height: "+mHeight);
- return false;
- }
-
- // check each layer
- while (mHeight < 8 && checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0) && !mTopLayerFound) {
- if (mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) {
- // layer without output hatch
- Logger.INFO("Height: "+mHeight + " - Missing output on "+(mHeight - 1));
- return false;
- }
- // not top
- mHeight++;
- }
-
- // validate final invariants...
- Logger.INFO("Height: "+mHeight);
- Logger.INFO("Casings: "+mCasing);
- Logger.INFO("Required: "+(7 * mHeight - 5));
- Logger.INFO("Found Top: "+mTopLayerFound);
- return mCasing >= 45 && mTopLayerFound && mMaintenanceHatches.size() == 1;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- protected void addFluidOutputs(FluidStack[] mOutputFluids2) {
- for (int i = 0; i < mOutputFluids2.length && i < mOutputHatchesByLayer.size(); i++) {
- FluidStack tStack = mOutputFluids2[i] != null ? mOutputFluids2[i].copy() : null;
- if (tStack == null) {
- continue;
- }
- if (!dumpFluid(mOutputHatchesByLayer.get(i), tStack, true)) {
- dumpFluid(mOutputHatchesByLayer.get(i), tStack, false);
- }
- }
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 1, 0, 0);
- int tTotalHeight = 8; // min 2 output layer, so at least 1 + 2 height
- for (int i = 1; i < tTotalHeight - 1; i++) {
- buildPiece(STRUCTURE_PIECE_LAYER_HINT, stackSize, hintsOnly, 1, i, 0);
- }
- buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 1, tTotalHeight - 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- mHeight = 0;
- int built = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, elementBudget, source, actor, false, true);
- if (built >= 0) return built;
- int tTotalHeight = 8; // min 2 output layer, so at least 1 + 2 height
- for (int i = 1; i < tTotalHeight - 1; i++) {
- mHeight = i;
- built = survivialBuildPiece(STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, i, 0, elementBudget, source, actor, false, true);
- if (built >= 0) return built;
- }
- mHeight = tTotalHeight - 1;
- return survivialBuildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public String getMachineType() {
- return "Gas Sparger";
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public boolean onPlungerRightClick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
- int aLayerIndex = 0;
- PlayerUtils.messagePlayer(aPlayer, "Trying to clear "+mOutputHatchesByLayer.size()+" layers of output hatches.");
- for (List<GT_MetaTileEntity_Hatch_Output> layer : this.mOutputHatchesByLayer) {
- int aHatchIndex = 0;
- for (GT_MetaTileEntity_Hatch_Output hatch : layer) {
- if (hatch.mFluid != null) {
- PlayerUtils.messagePlayer(aPlayer, "Clearing "+hatch.mFluid.amount+"L of "+hatch.mFluid.getLocalizedName()+" from hatch "+aHatchIndex+" on layer "+aLayerIndex+".");
- hatch.mFluid = null;
- }
- aHatchIndex++;
- }
- aLayerIndex++;
- }
- return aLayerIndex > 0;
- }
+public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SpargeTower>
+ implements ISurvivalConstructable {
+
+ protected static final String STRUCTURE_PIECE_BASE = "base";
+ protected static final String STRUCTURE_PIECE_LAYER = "layer";
+ protected static final String STRUCTURE_PIECE_LAYER_HINT = "layerHint";
+ protected static final String STRUCTURE_PIECE_TOP_HINT = "topHint";
+ private static final IStructureDefinition<GregtechMetaTileEntity_SpargeTower> STRUCTURE_DEFINITION;
+
+ static {
+ IHatchElement<GregtechMetaTileEntity_SpargeTower> layeredOutputHatch = OutputHatch.withCount(
+ GregtechMetaTileEntity_SpargeTower::getCurrentLayerOutputHatchCount)
+ .withAdder(GregtechMetaTileEntity_SpargeTower::addLayerOutputHatch);
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SpargeTower>builder()
+ .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] {
+ {"b~b", "bbb", "bbb"},
+ }))
+ .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] {{"lll", "lcl", "lll"}}))
+ .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] {{"lll", "l-l", "lll"}}))
+ .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] {{"lll", "lll", "lll"}}))
+ .addElement(
+ 'b',
+ buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class)
+ .atLeast(Energy, InputHatch, InputBus, Maintenance)
+ .casingIndex(getCasingIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ GregtechMetaTileEntity_SpargeTower::onCasingFound,
+ ofBlock(ModBlocks.blockCasings5Misc, 4))))
+ .addElement(
+ 'l',
+ ofChain(
+ buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class)
+ .atLeast(layeredOutputHatch)
+ .casingIndex(getCasingIndex())
+ .dot(2)
+ .build(),
+ ofHatchAdder(
+ GregtechMetaTileEntity_SpargeTower::addEnergyInputToMachineList,
+ getCasingIndex(),
+ 2),
+ ofHatchAdder(
+ GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList,
+ getCasingIndex(),
+ 2),
+ onElementPass(
+ GregtechMetaTileEntity_SpargeTower::onCasingFound,
+ ofBlock(ModBlocks.blockCasings5Misc, 4))))
+ .addElement(
+ 'c',
+ ofChain(
+ onElementPass(
+ t -> t.onTopLayerFound(false),
+ ofHatchAdder(
+ GregtechMetaTileEntity_SpargeTower::addOutputToMachineList,
+ getCasingIndex(),
+ 3)),
+ onElementPass(
+ t -> t.onTopLayerFound(false),
+ ofHatchAdder(
+ GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList,
+ getCasingIndex(),
+ 3)),
+ onElementPass(t -> t.onTopLayerFound(true), ofBlock(ModBlocks.blockCasings5Misc, 4)),
+ isAir()))
+ .build();
+ }
+
+ protected final List<List<GT_MetaTileEntity_Hatch_Output>> mOutputHatchesByLayer = new ArrayList<>();
+ protected int mHeight;
+ protected int mCasing;
+ protected boolean mTopLayerFound;
+
+ public GregtechMetaTileEntity_SpargeTower(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_SpargeTower(String aName) {
+ super(aName);
+ }
+
+ public static int getCasingIndex() {
+ return 68;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_SpargeTower(this.mName);
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Gas Sparge Tower")
+ .addInfo("Controller block for the Sparging Tower")
+ .addInfo("Fluids are only put out at the correct height")
+ .addInfo("The correct height equals the slot number in the NEI recipe")
+ .addSeparator()
+ .beginStructureBlock(3, 8, 3, true)
+ .addController("Front bottom")
+ .addOtherStructurePart("Sparge Tower Exterior Casing", "45 (minimum)")
+ .addEnergyHatch("Any casing", 1, 2)
+ .addMaintenanceHatch("Any casing", 1, 2, 3)
+ .addInputHatch("2x Input Hatches (Any bottom layer casing)", 1)
+ .addOutputHatch("6x Output Hatches (At least one per layer except bottom layer)", 2, 3)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return getCasingIndex();
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ if (GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.isEmpty()) {
+ generateRecipes();
+ }
+ return GTPP_Recipe_Map.sSpargeTowerRecipes;
+ }
+
+ private static boolean generateRecipes() {
+ for (GasSpargingRecipe aRecipe : GasSpargingRecipeMap.mRecipes) {
+ GTPP_Recipe newRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ null,
+ aRecipe.mFluidInputs.clone(),
+ new FluidStack[] {},
+ aRecipe.mDuration,
+ aRecipe.mEUt,
+ 0);
+ GTPP_Recipe_Map.sSpargeTowerRecipes.add(newRecipe);
+ }
+ if (GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.isEmpty()) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage));
+ FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]);
+ if (tFluids.length > 0) {
+ Logger.INFO("Found " + tFluids.length + " input fluids. Searching "
+ + GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.size() + " recipes.");
+ GT_Recipe tRecipe = getRecipeMap()
+ .findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids);
+ if (tRecipe != null) {
+ Logger.INFO("Found recipe!");
+ if (tRecipe.isRecipeInputEqual(true, tFluids)) {
+ Logger.INFO("Found recipe that matches!");
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+ this.mLastRecipe = tRecipe;
+
+ calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage);
+ int aDevProgress = this.mMaxProgresstime / 10;
+ this.mMaxProgresstime = Math.max(1, aDevProgress);
+ this.mOutputItems = new ItemStack[] {};
+ ArrayList<FluidStack> aFluidOutputs =
+ getByproductsOfSparge(tRecipe.mFluidInputs[0], tRecipe.mFluidInputs[1]);
+ this.mOutputFluids = (FluidStack[]) aFluidOutputs.toArray(new FluidStack[0]);
+ updateSlots();
+ Logger.INFO("Done!");
+ return true;
+ }
+ } else {
+ Logger.INFO("Did not find recipe!");
+ }
+ }
+ this.mEUt = 0;
+ this.mEfficiency = 0;
+ Logger.INFO("Did not find recipe! (2)");
+ return false;
+ }
+
+ private static ArrayList<FluidStack> getByproductsOfSparge(
+ final FluidStack aSpargeGas, final FluidStack aSpentFuel) {
+ GasSpargingRecipe aSpargeRecipe = GasSpargingRecipeMap.findRecipe(aSpargeGas, aSpentFuel);
+ ArrayList<FluidStack> aOutputGases = new ArrayList<FluidStack>();
+ if (aSpargeRecipe == null) {
+ Logger.INFO("Did not find sparge recipe!");
+ return aOutputGases;
+ }
+ int aSpargeGasAmount = aSpargeRecipe.mInputGas.amount;
+
+ aOutputGases.add(aSpargeRecipe.mOutputSpargedFuel.copy());
+ ArrayList<FluidStack> aTempMap = new ArrayList<FluidStack>();
+ for (int i = 2; i < aSpargeRecipe.mFluidOutputs.length; i++) {
+ int aGasAmount = MathUtils.randInt(0, (aSpargeRecipe.mMaxOutputQuantity[i - 2] / 100));
+ FluidStack aOutput = aSpargeRecipe.mFluidOutputs[i].copy();
+ aSpargeGasAmount -= aGasAmount;
+ FluidStack aSpargeOutput = null;
+ if (aGasAmount > 0) {
+ aSpargeOutput = new FluidStack(aOutput.getFluid(), aGasAmount);
+ }
+ aTempMap.add(aSpargeOutput);
+ }
+ Logger.INFO("Sparge gas left: " + aSpargeGasAmount);
+ if (aSpargeGasAmount > 0) {
+ aOutputGases.add(new FluidStack(aSpargeRecipe.mInputGas.getFluid(), aSpargeGasAmount));
+ }
+ // Logger.INFO("Sparge Outputs: "+ItemUtils.getArrayStackNames(aTempMap));
+ aOutputGases.addAll(aTempMap);
+ Logger.INFO("Sparge output size: " + aOutputGases.size());
+ // Logger.INFO("Output of sparging: "+ItemUtils.getArrayStackNames(aOutputGases));
+ return aOutputGases;
+ }
+
+ protected void onCasingFound() {
+ mCasing++;
+ }
+
+ protected void onTopLayerFound(boolean aIsCasing) {
+ mTopLayerFound = true;
+ if (aIsCasing) {
+ onCasingFound();
+ }
+ }
+
+ protected int getCurrentLayerOutputHatchCount() {
+ return mOutputHatchesByLayer.size() < mHeight
+ ? 0
+ : mOutputHatchesByLayer.get(mHeight - 1).size();
+ }
+
+ protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null
+ || aTileEntity.isDead()
+ || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) {
+ Logger.INFO("Bad Output Hatch");
+ return false;
+ }
+ while (mOutputHatchesByLayer.size() < mHeight) {
+ mOutputHatchesByLayer.add(new ArrayList<>());
+ }
+ GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity();
+ tHatch.updateTexture(aBaseCasingIndex);
+ boolean addedHatch = mOutputHatchesByLayer.get(mHeight - 1).add(tHatch);
+ Logger.INFO("Added Hatch: " + addedHatch);
+ return addedHatch;
+ }
+
+ @Override
+ protected IAlignmentLimits getInitialAlignmentLimits() {
+ // don't rotate a freaking tower, it won't work
+ return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_SpargeTower> getStructureDefinition() {
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ // reset
+ mOutputHatchesByLayer.forEach(List::clear);
+ mHeight = 1;
+ mTopLayerFound = false;
+ mCasing = 0;
+
+ // check base
+ if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) {
+ Logger.INFO("Bad Base. Height: " + mHeight);
+ return false;
+ }
+
+ // check each layer
+ while (mHeight < 8 && checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0) && !mTopLayerFound) {
+ if (mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) {
+ // layer without output hatch
+ Logger.INFO("Height: " + mHeight + " - Missing output on " + (mHeight - 1));
+ return false;
+ }
+ // not top
+ mHeight++;
+ }
+
+ // validate final invariants...
+ Logger.INFO("Height: " + mHeight);
+ Logger.INFO("Casings: " + mCasing);
+ Logger.INFO("Required: " + (7 * mHeight - 5));
+ Logger.INFO("Found Top: " + mTopLayerFound);
+ return mCasing >= 45 && mTopLayerFound && mMaintenanceHatches.size() == 1;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ protected void addFluidOutputs(FluidStack[] mOutputFluids2) {
+ for (int i = 0; i < mOutputFluids2.length && i < mOutputHatchesByLayer.size(); i++) {
+ FluidStack tStack = mOutputFluids2[i] != null ? mOutputFluids2[i].copy() : null;
+ if (tStack == null) {
+ continue;
+ }
+ if (!dumpFluid(mOutputHatchesByLayer.get(i), tStack, true)) {
+ dumpFluid(mOutputHatchesByLayer.get(i), tStack, false);
+ }
+ }
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 1, 0, 0);
+ int tTotalHeight = 8; // min 2 output layer, so at least 1 + 2 height
+ for (int i = 1; i < tTotalHeight - 1; i++) {
+ buildPiece(STRUCTURE_PIECE_LAYER_HINT, stackSize, hintsOnly, 1, i, 0);
+ }
+ buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 1, tTotalHeight - 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ mHeight = 0;
+ int built = survivialBuildPiece(
+ STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, elementBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ int tTotalHeight = 8; // min 2 output layer, so at least 1 + 2 height
+ for (int i = 1; i < tTotalHeight - 1; i++) {
+ mHeight = i;
+ built = survivialBuildPiece(
+ STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, i, 0, elementBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ }
+ mHeight = tTotalHeight - 1;
+ return survivialBuildPiece(
+ STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Gas Sparger";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public boolean onPlungerRightClick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ int aLayerIndex = 0;
+ PlayerUtils.messagePlayer(
+ aPlayer, "Trying to clear " + mOutputHatchesByLayer.size() + " layers of output hatches.");
+ for (List<GT_MetaTileEntity_Hatch_Output> layer : this.mOutputHatchesByLayer) {
+ int aHatchIndex = 0;
+ for (GT_MetaTileEntity_Hatch_Output hatch : layer) {
+ if (hatch.mFluid != null) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "Clearing " + hatch.mFluid.amount + "L of " + hatch.mFluid.getLocalizedName()
+ + " from hatch " + aHatchIndex + " on layer " + aLayerIndex + ".");
+ hatch.mFluid = null;
+ }
+ aHatchIndex++;
+ }
+ aLayerIndex++;
+ }
+ return aLayerIndex > 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java
index be7aa8b98a..70551220ca 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java
@@ -1,9 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced;
-import java.util.ArrayList;
-
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
@@ -23,6 +20,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.LangUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@@ -31,640 +29,666 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_Adv_AssemblyLine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_AssemblyLine> {
-
- public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<GT_MetaTileEntity_Hatch_DataAccess>();
-
- public static String[] mCasingName = new String[5];
- private final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 13);
- private final int META_BaseCasing = 0; //4
- private final int META_ContainmentCasing = 15; //3
- private final int META_Shielding = 13; //1
- private final int META_PipeCasing = 1; //4
- private final int META_IntegralCasing = 6; //0
- private final int META_ContainmentChamberCasing = 2; //4
-
-
- public GregtechMetaTileEntity_Adv_AssemblyLine(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0);
- mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1);
- mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2);
- mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15);
- mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13);
- }
-
- public GregtechMetaTileEntity_Adv_AssemblyLine(String aName) {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_Adv_AssemblyLine(this.mName);
- }
-
- /* public String[] getTooltip() {
- if (mCasingName[0].toLowerCase().contains(".name")) {
- mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0);
- }
- if (mCasingName[1].toLowerCase().contains(".name")) {
- mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1);
- }
- if (mCasingName[2].toLowerCase().contains(".name")) {
- mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2);
- }
- if (mCasingName[3].toLowerCase().contains(".name")) {
- mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15);
- }
- if (mCasingName[4].toLowerCase().contains(".name")) {
- mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13);
- }
- return new String[]{
- "Advanced Integrated Assembly Line"
- };
- }*/
-
- @Override
- protected final GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- private Block getCasing(int casingID) {
- if (casingID == 1) {
- return ModBlocks.blockCasingsMisc;
- }
- else if (casingID == 2) {
- return ModBlocks.blockCasings2Misc;
- }
- else if (casingID == 3) {
- return ModBlocks.blockCasings3Misc;
- }
- else if (casingID == 4) {
- return ModBlocks.blockCasings4Misc;
- }
- else {
- return ModBlocks.blockCasingsTieredGTPP;
- }
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE;
- }
-
- @Override
- protected int getCasingTextureId() {
- return 16;
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "AssemblyLine.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- public boolean checkRecipe(ItemStack aStack) {
- if(GT_Values.D1)System.out.println("Start ALine recipe check");
- ArrayList<ItemStack> tDataStickList = getDataItems(2);
- if (tDataStickList.size() == 0) return false;
- if(GT_Values.D1)System.out.println("Stick accepted, " + tDataStickList.size() + " Data Sticks found");
-
- ItemStack tStack[] = new ItemStack[15];
- FluidStack[] tFluids = new FluidStack[4];
- boolean findRecipe = false;
- nextDS:for (ItemStack tDataStick : tDataStickList){
- NBTTagCompound tTag = tDataStick.getTagCompound();
- if (tTag == null) continue;
- for (int i = 0; i < 15; i++) {
- int count = tTag.getInteger("a"+i);
- if (!tTag.hasKey("" + i) && count <= 0) continue;
- if (mInputBusses.get(i) == null) {
- continue nextDS;
- }
-
- ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
- boolean flag = true;
- if (count > 0) {
- for (int j = 0; j < count; j++) {
- tStack[i] = GT_Utility.loadItem(tTag, "a" + i + ":" + j);
- if (tStack[i] == null) continue;
- if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName());
- if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) {
- flag = false;
- break;
- }
- }
- }
- if (flag) {
- tStack[i] = GT_Utility.loadItem(tTag, "" + i);
- if (tStack[i] == null) {
- flag = false;
- continue;
- }
- if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName());
- if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) {
- flag = false;
- }
- }
- if(GT_Values.D1) System.out.println(i + (flag ? " not accepted" : " accepted"));
- if (flag) continue nextDS;
- }
-
- if(GT_Values.D1)System.out.println("All Items done, start fluid check");
- for (int i = 0; i < 4; i++) {
- if (!tTag.hasKey("f" + i)) continue;
- tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i);
- if (tFluids[i] == null) continue;
- if(GT_Values.D1)System.out.println("Fluid "+i+" "+tFluids[i].getUnlocalizedName());
- if (mInputHatches.get(i) == null) {
- continue nextDS;
- }
- FluidStack fluidInHatch = mInputHatches.get(i).mFluid;
- if (fluidInHatch == null || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) {
- if(GT_Values.D1)System.out.println(i+" not accepted");
- continue nextDS;
- }
- if(GT_Values.D1)System.out.println(i+" accepted");
- }
-
- if(GT_Values.D1)System.out.println("Input accepted, check other values");
- if (!tTag.hasKey("output")) continue;
- mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")};
- if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0]))
- continue;
-
- if (!tTag.hasKey("time")) continue;
- mMaxProgresstime = tTag.getInteger("time");
- if (mMaxProgresstime <= 0) continue;
-
- if (!tTag.hasKey("eu")) continue;
- mEUt = tTag.getInteger("eu");
-
- if(GT_Values.D1)System.out.println("Find avaiable recipe");
- findRecipe = true;
- break;
- }
- if (!findRecipe) return false;
-
- if(GT_Values.D1)System.out.println("All checked start consuming inputs");
- for (int i = 0; i < 15; i++) {
- if (tStack[i] == null) continue;
- ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
- stackInSlot.stackSize -= tStack[i].stackSize;
- }
-
- for (int i = 0; i < 4; i++) {
- if (tFluids[i] == null) continue;
- mInputHatches.get(i).mFluid.amount -= tFluids[i].amount;
- if (mInputHatches.get(i).mFluid.amount <= 0) {
- mInputHatches.get(i).mFluid = null;
- }
- }
- if(GT_Values.D1)System.out.println("Check overclock");
-
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (mEUt <= 16) {
- this.mEUt = (mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- updateSlots();
- if(GT_Values.D1)System.out.println("Recipe sucessfull");
- return true;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 20) {
- GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4;
-
- // Counts for all Casing Types
- int aBaseCasingCount = 0;
- int aContainmentCasingCount = 0;
- int aShieldingCount = 0;
- int aPipeCount = 0;
- int aIntegralCasingCount = 0;
- int aContainmentChamberCount = 0;
-
- // Bottom Layer
- aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, -7, xDir, zDir);
- log("Bottom Layer is Valid. Moving to Layer 1.");
-
- // Layer 1
- aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -6, xDir, zDir);
- aIntegralCasingCount += checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -6, xDir, zDir);
- aContainmentChamberCount += checkContainmentRing(aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -6, xDir, zDir);
- log("Layer 1 is Valid. Moving to Layer 2.");
-
- // Layer 2
- aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -5, xDir, zDir);
- aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -5, xDir, zDir);
- log("Layer 2 is Valid. Moving to Layer 3.");
-
- // Layer 3
- aContainmentCasingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -4, xDir, zDir);
- aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -4, xDir, zDir);
- log("Layer 3 is Valid. Moving to Layer 4.");
-
- // Layer 4
- aContainmentCasingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -3, xDir, zDir);
- aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -3, xDir, zDir);
- log("Layer 4 is Valid. Moving to Layer 5.");
-
- // Layer 5
- aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -2, xDir, zDir);
- aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -2, xDir, zDir);
- log("Layer 5 is Valid. Moving to Layer 6.");
-
- // Layer 6
- aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -1, xDir, zDir);
- aIntegralCasingCount += checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -1, xDir, zDir);
- aContainmentChamberCount += checkContainmentRing(aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -1, xDir, zDir);
- log("Layer 6 is Valid. Moving to Top Layer.");
-
- // Top Layer
- aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, 0, xDir, zDir);
-
- log("Found "+aBaseCasingCount+" "+mCasingName[0]+"s");
- log("Found "+aShieldingCount+" "+mCasingName[4]+"s");
- log("Found "+aPipeCount+" "+mCasingName[1]+"s");
- log("Found "+aContainmentCasingCount+" "+mCasingName[3]+"s");
- log("Found "+aIntegralCasingCount+" "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s");
- log("Found "+aContainmentChamberCount+" "+mCasingName[2]+"s");
-
- // Try mesage player
- String aOwnerName = this.getBaseMetaTileEntity().getOwnerName();
- EntityPlayer aOwner = null;
- if (aOwnerName != null && aOwnerName.length() > 0) {
- aOwner = PlayerUtils.getPlayer(aOwnerName);
- }
-
- if (aShieldingCount != 128) {
- log("Not enough "+mCasingName[4]+"s, require 128.");
- if (aOwner != null) {
- PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[4]+"s, require 128.");
- }
- return false;
- }
- if (aPipeCount != 20) {
- log("Not enough "+mCasingName[1]+"s, require 20.");
- if (aOwner != null) {
- PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[1]+"s, require 20.");
- }
- return false;
- }
- if (aContainmentCasingCount != 64) {
- log("Not enough "+mCasingName[3]+"s, require 64.");
- if (aOwner != null) {
- PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[3]+"s, require 64.");
- }
- return false;
- }
- if (aContainmentChamberCount != 42) {
- log("Not enough "+mCasingName[2]+"s, require 42.");
- if (aOwner != null) {
- PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[2]+"s, require 42.");
- }
- return false;
- }
- if (aBaseCasingCount < 140) {
- log("Not enough "+mCasingName[0]+"s, require 140 at a minimum.");
- if (aOwner != null) {
- PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[0]+"s, require 140 at a minimum.");
- }
- return false;
- }
- if (aIntegralCasingCount != 48) {
- log("Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48.");
- if (aOwner != null) {
- PlayerUtils.messagePlayer(aOwner, "Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48.");
- }
- return false;
- }
- log("LNR Formed.");
- if (aOwner != null) {
- PlayerUtils.messagePlayer(aOwner, "Large Naquadah Reactor has formed successfully.");
- }
- return true;
- }
-
- public boolean addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
- return mDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity);
- }
- return false;
- }
-
- public int checkEntireLayer(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
- int aCasingCount = 0;
- for (int x = -4; x < 5; x++) {
- for (int z = -4; z < 5; z++) {
- int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
- int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
- //Skip the corners
- if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) {
- continue;
- }
- // Skip controller
- if (aY == 0 && x == 0 && z == 0) {
- continue;
- }
-
- Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
- int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
- if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
- aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
- if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
- log("Layer has error. Height: "+aY);
- //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
- return 0;
- }
- }
- }
- return aCasingCount;
- }
-
- public int checkOuterRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
- int aCasingCount = 0;
- for (int x = -4; x < 5; x++) {
- for (int z = -4; z < 5; z++) {
- int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
- int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
- //Skip the corners
- if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) {
- continue;
- }
-
- // If we are on the 5x5 ring, proceed
- if ((x > -4 && x < 4 ) && (z > -4 && z < 4)) {
- if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) {
- //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
- }
- else {
- continue;
- }
- }
-
- Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
- int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
- if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
- aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
- if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
- log("Layer has error. Height: "+aY);
- //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
- return 0;
- }
- }
- }
- return aCasingCount;
- }
- public int checkIntegralRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
- int aCasingCount = 0;
- for (int x = -3; x < 4; x++) {
- for (int z = -3; z < 4; z++) {
- int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
- int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
- //Skip the corners
- if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) {
- continue;
- }
-
- // If we are on the 5x5 ring, proceed
- if ((x > -3 && x < 3 ) && (z > -3 && z < 3)) {
- if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) {
- //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
- }
- else {
- continue;
- }
- }
-
- Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
- int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
- if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
- aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
- if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
- log("Layer has error. Height: "+aY);
- //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
- return 0;
- }
- }
- }
- return aCasingCount;
- }
-
- public int checkPipes(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
- int aCasingCount = 0;
- for (int x = -1; x < 2; x++) {
- for (int z = -1; z < 2; z++) {
- int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
- int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
- //Skip the corners
- if ((x == 1 && z == 1) || (x == -1 && z == -1) || (x == 1 && z == -1) || (x == -1 && z == 1) || (x == 0 && z == 0)) {
- Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
- int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
- if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
- aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
- if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
- log("Pipe has error. Height: "+aY);
- //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
- return 0;
- };
- }
- }
- }
- return aCasingCount;
- }
-
- public int checkContainmentRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
- int aCasingCount = 0;
- for (int x = -2; x < 3; x++) {
- for (int z = -2; z < 3; z++) {
- int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
- int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
- //Skip the corners
- if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) {
- continue;
- }
-
- Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
- int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
- if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
- aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
- if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
- log("Layer has error. Height: "+aY);
- //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
- return 0;
- }
- }
- }
- return aCasingCount;
- }
-
- /**
- * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb
- */
-
- private boolean isCorrectDataItem(ItemStack aStack, int state){
- if ((state & 1) != 0 && ItemList.Circuit_Integrated.isStackEqual(aStack, true, true)) return true;
- if ((state & 2) != 0 && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) return true;
- if ((state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) return true;
- return false;
- }
-
- /**
- * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb
- */
-
- public ArrayList<ItemStack> getDataItems(int state) {
- ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
- if (GT_Utility.isStackValid(mInventory[1]) && isCorrectDataItem(mInventory[1], state)) {
- rList.add(mInventory[1]);
- }
- for (GT_MetaTileEntity_Hatch_DataAccess tHatch : mDataAccessHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null
- && isCorrectDataItem(tHatch.getBaseMetaTileEntity().getStackInSlot(i), state))
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- }
- return rList;
- }
-
- public boolean addDataAccessToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) return false;
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) return false;
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
- return mDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity);
- }
- return false;
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Assembly Line";
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 0;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- // Fix GT bug
- if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
- log("Fixing Bad Facing. (GT Bug)");
- this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
- }
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public IStructureDefinition getStructureDefinition() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean checkMachine(
- IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack
- ) {
- // TODO Auto-generated method stub
- return false;
- }
+public class GregtechMetaTileEntity_Adv_AssemblyLine
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_AssemblyLine> {
+
+ public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches =
+ new ArrayList<GT_MetaTileEntity_Hatch_DataAccess>();
+
+ public static String[] mCasingName = new String[5];
+ private final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 13);
+ private final int META_BaseCasing = 0; // 4
+ private final int META_ContainmentCasing = 15; // 3
+ private final int META_Shielding = 13; // 1
+ private final int META_PipeCasing = 1; // 4
+ private final int META_IntegralCasing = 6; // 0
+ private final int META_ContainmentChamberCasing = 2; // 4
+
+ public GregtechMetaTileEntity_Adv_AssemblyLine(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0);
+ mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1);
+ mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2);
+ mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15);
+ mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13);
+ }
+
+ public GregtechMetaTileEntity_Adv_AssemblyLine(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_Adv_AssemblyLine(this.mName);
+ }
+
+ /* public String[] getTooltip() {
+ if (mCasingName[0].toLowerCase().contains(".name")) {
+ mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0);
+ }
+ if (mCasingName[1].toLowerCase().contains(".name")) {
+ mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1);
+ }
+ if (mCasingName[2].toLowerCase().contains(".name")) {
+ mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2);
+ }
+ if (mCasingName[3].toLowerCase().contains(".name")) {
+ mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15);
+ }
+ if (mCasingName[4].toLowerCase().contains(".name")) {
+ mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13);
+ }
+ return new String[]{
+ "Advanced Integrated Assembly Line"
+ };
+ }*/
+
+ @Override
+ protected final GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType()).toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ private Block getCasing(int casingID) {
+ if (casingID == 1) {
+ return ModBlocks.blockCasingsMisc;
+ } else if (casingID == 2) {
+ return ModBlocks.blockCasings2Misc;
+ } else if (casingID == 3) {
+ return ModBlocks.blockCasings3Misc;
+ } else if (casingID == 4) {
+ return ModBlocks.blockCasings4Misc;
+ } else {
+ return ModBlocks.blockCasingsTieredGTPP;
+ }
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return 16;
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "AssemblyLine.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ if (GT_Values.D1) System.out.println("Start ALine recipe check");
+ ArrayList<ItemStack> tDataStickList = getDataItems(2);
+ if (tDataStickList.size() == 0) return false;
+ if (GT_Values.D1) System.out.println("Stick accepted, " + tDataStickList.size() + " Data Sticks found");
+
+ ItemStack tStack[] = new ItemStack[15];
+ FluidStack[] tFluids = new FluidStack[4];
+ boolean findRecipe = false;
+ nextDS:
+ for (ItemStack tDataStick : tDataStickList) {
+ NBTTagCompound tTag = tDataStick.getTagCompound();
+ if (tTag == null) continue;
+ for (int i = 0; i < 15; i++) {
+ int count = tTag.getInteger("a" + i);
+ if (!tTag.hasKey("" + i) && count <= 0) continue;
+ if (mInputBusses.get(i) == null) {
+ continue nextDS;
+ }
+
+ ItemStack stackInSlot =
+ mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
+ boolean flag = true;
+ if (count > 0) {
+ for (int j = 0; j < count; j++) {
+ tStack[i] = GT_Utility.loadItem(tTag, "a" + i + ":" + j);
+ if (tStack[i] == null) continue;
+ if (GT_Values.D1) System.out.println("Item " + i + " : " + tStack[i].getUnlocalizedName());
+ if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true)
+ && tStack[i].stackSize <= stackInSlot.stackSize) {
+ flag = false;
+ break;
+ }
+ }
+ }
+ if (flag) {
+ tStack[i] = GT_Utility.loadItem(tTag, "" + i);
+ if (tStack[i] == null) {
+ flag = false;
+ continue;
+ }
+ if (GT_Values.D1) System.out.println("Item " + i + " : " + tStack[i].getUnlocalizedName());
+ if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true)
+ && tStack[i].stackSize <= stackInSlot.stackSize) {
+ flag = false;
+ }
+ }
+ if (GT_Values.D1) System.out.println(i + (flag ? " not accepted" : " accepted"));
+ if (flag) continue nextDS;
+ }
+
+ if (GT_Values.D1) System.out.println("All Items done, start fluid check");
+ for (int i = 0; i < 4; i++) {
+ if (!tTag.hasKey("f" + i)) continue;
+ tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i);
+ if (tFluids[i] == null) continue;
+ if (GT_Values.D1) System.out.println("Fluid " + i + " " + tFluids[i].getUnlocalizedName());
+ if (mInputHatches.get(i) == null) {
+ continue nextDS;
+ }
+ FluidStack fluidInHatch = mInputHatches.get(i).mFluid;
+ if (fluidInHatch == null
+ || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true)
+ || fluidInHatch.amount < tFluids[i].amount) {
+ if (GT_Values.D1) System.out.println(i + " not accepted");
+ continue nextDS;
+ }
+ if (GT_Values.D1) System.out.println(i + " accepted");
+ }
+
+ if (GT_Values.D1) System.out.println("Input accepted, check other values");
+ if (!tTag.hasKey("output")) continue;
+ mOutputItems = new ItemStack[] {GT_Utility.loadItem(tTag, "output")};
+ if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0])) continue;
+
+ if (!tTag.hasKey("time")) continue;
+ mMaxProgresstime = tTag.getInteger("time");
+ if (mMaxProgresstime <= 0) continue;
+
+ if (!tTag.hasKey("eu")) continue;
+ mEUt = tTag.getInteger("eu");
+
+ if (GT_Values.D1) System.out.println("Find avaiable recipe");
+ findRecipe = true;
+ break;
+ }
+ if (!findRecipe) return false;
+
+ if (GT_Values.D1) System.out.println("All checked start consuming inputs");
+ for (int i = 0; i < 15; i++) {
+ if (tStack[i] == null) continue;
+ ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
+ stackInSlot.stackSize -= tStack[i].stackSize;
+ }
+
+ for (int i = 0; i < 4; i++) {
+ if (tFluids[i] == null) continue;
+ mInputHatches.get(i).mFluid.amount -= tFluids[i].amount;
+ if (mInputHatches.get(i).mFluid.amount <= 0) {
+ mInputHatches.get(i).mFluid = null;
+ }
+ }
+ if (GT_Values.D1) System.out.println("Check overclock");
+
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (mEUt <= 16) {
+ this.mEUt = (mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = -this.mEUt;
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ updateSlots();
+ if (GT_Values.D1) System.out.println("Recipe sucessfull");
+ return true;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 20) {
+ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4;
+
+ // Counts for all Casing Types
+ int aBaseCasingCount = 0;
+ int aContainmentCasingCount = 0;
+ int aShieldingCount = 0;
+ int aPipeCount = 0;
+ int aIntegralCasingCount = 0;
+ int aContainmentChamberCount = 0;
+
+ // Bottom Layer
+ aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, -7, xDir, zDir);
+ log("Bottom Layer is Valid. Moving to Layer 1.");
+
+ // Layer 1
+ aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -6, xDir, zDir);
+ aIntegralCasingCount +=
+ checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -6, xDir, zDir);
+ aContainmentChamberCount += checkContainmentRing(
+ aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -6, xDir, zDir);
+ log("Layer 1 is Valid. Moving to Layer 2.");
+
+ // Layer 2
+ aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -5, xDir, zDir);
+ aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -5, xDir, zDir);
+ log("Layer 2 is Valid. Moving to Layer 3.");
+
+ // Layer 3
+ aContainmentCasingCount +=
+ checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -4, xDir, zDir);
+ aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -4, xDir, zDir);
+ log("Layer 3 is Valid. Moving to Layer 4.");
+
+ // Layer 4
+ aContainmentCasingCount +=
+ checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -3, xDir, zDir);
+ aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -3, xDir, zDir);
+ log("Layer 4 is Valid. Moving to Layer 5.");
+
+ // Layer 5
+ aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -2, xDir, zDir);
+ aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -2, xDir, zDir);
+ log("Layer 5 is Valid. Moving to Layer 6.");
+
+ // Layer 6
+ aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -1, xDir, zDir);
+ aIntegralCasingCount +=
+ checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -1, xDir, zDir);
+ aContainmentChamberCount += checkContainmentRing(
+ aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -1, xDir, zDir);
+ log("Layer 6 is Valid. Moving to Top Layer.");
+
+ // Top Layer
+ aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, 0, xDir, zDir);
+
+ log("Found " + aBaseCasingCount + " " + mCasingName[0] + "s");
+ log("Found " + aShieldingCount + " " + mCasingName[4] + "s");
+ log("Found " + aPipeCount + " " + mCasingName[1] + "s");
+ log("Found " + aContainmentCasingCount + " " + mCasingName[3] + "s");
+ log("Found " + aIntegralCasingCount + " " + LangUtils.getLocalizedNameOfBlock(getCasing(0), 6) + "s");
+ log("Found " + aContainmentChamberCount + " " + mCasingName[2] + "s");
+
+ // Try mesage player
+ String aOwnerName = this.getBaseMetaTileEntity().getOwnerName();
+ EntityPlayer aOwner = null;
+ if (aOwnerName != null && aOwnerName.length() > 0) {
+ aOwner = PlayerUtils.getPlayer(aOwnerName);
+ }
+
+ if (aShieldingCount != 128) {
+ log("Not enough " + mCasingName[4] + "s, require 128.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough " + mCasingName[4] + "s, require 128.");
+ }
+ return false;
+ }
+ if (aPipeCount != 20) {
+ log("Not enough " + mCasingName[1] + "s, require 20.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough " + mCasingName[1] + "s, require 20.");
+ }
+ return false;
+ }
+ if (aContainmentCasingCount != 64) {
+ log("Not enough " + mCasingName[3] + "s, require 64.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough " + mCasingName[3] + "s, require 64.");
+ }
+ return false;
+ }
+ if (aContainmentChamberCount != 42) {
+ log("Not enough " + mCasingName[2] + "s, require 42.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough " + mCasingName[2] + "s, require 42.");
+ }
+ return false;
+ }
+ if (aBaseCasingCount < 140) {
+ log("Not enough " + mCasingName[0] + "s, require 140 at a minimum.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough " + mCasingName[0] + "s, require 140 at a minimum.");
+ }
+ return false;
+ }
+ if (aIntegralCasingCount != 48) {
+ log("Not enough " + LangUtils.getLocalizedNameOfBlock(getCasing(0), 6) + "s, require 48.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(
+ aOwner, "Not enough " + LangUtils.getLocalizedNameOfBlock(getCasing(0), 6) + "s, require 48.");
+ }
+ return false;
+ }
+ log("LNR Formed.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Large Naquadah Reactor has formed successfully.");
+ }
+ return true;
+ }
+
+ public boolean addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return mDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public int checkEntireLayer(
+ IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -4; x < 5; x++) {
+ for (int z = -4; z < 5; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ // Skip the corners
+ if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) {
+ continue;
+ }
+ // Skip controller
+ if (aY == 0 && x == 0 && z == 0) {
+ continue;
+ }
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity =
+ aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(
+ tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Layer has error. Height: " + aY);
+ // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ return 0;
+ }
+ }
+ }
+ return aCasingCount;
+ }
+
+ public int checkOuterRing(
+ IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -4; x < 5; x++) {
+ for (int z = -4; z < 5; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ // Skip the corners
+ if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) {
+ continue;
+ }
+
+ // If we are on the 5x5 ring, proceed
+ if ((x > -4 && x < 4) && (z > -4 && z < 4)) {
+ if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) {
+ // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta,
+ // 3);
+ } else {
+ continue;
+ }
+ }
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity =
+ aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(
+ tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Layer has error. Height: " + aY);
+ // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ return 0;
+ }
+ }
+ }
+ return aCasingCount;
+ }
+
+ public int checkIntegralRing(
+ IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -3; x < 4; x++) {
+ for (int z = -3; z < 4; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ // Skip the corners
+ if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) {
+ continue;
+ }
+
+ // If we are on the 5x5 ring, proceed
+ if ((x > -3 && x < 3) && (z > -3 && z < 3)) {
+ if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) {
+ // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta,
+ // 3);
+ } else {
+ continue;
+ }
+ }
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity =
+ aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(
+ tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Layer has error. Height: " + aY);
+ // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ return 0;
+ }
+ }
+ }
+ return aCasingCount;
+ }
+
+ public int checkPipes(
+ IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -1; x < 2; x++) {
+ for (int z = -1; z < 2; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ // Skip the corners
+ if ((x == 1 && z == 1)
+ || (x == -1 && z == -1)
+ || (x == 1 && z == -1)
+ || (x == -1 && z == 1)
+ || (x == 0 && z == 0)) {
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity =
+ aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(
+ tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Pipe has error. Height: " + aY);
+ // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta,
+ // 3);
+ return 0;
+ }
+ ;
+ }
+ }
+ }
+ return aCasingCount;
+ }
+
+ public int checkContainmentRing(
+ IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -2; x < 3; x++) {
+ for (int z = -2; z < 3; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ // Skip the corners
+ if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) {
+ continue;
+ }
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity =
+ aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(
+ tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Layer has error. Height: " + aY);
+ // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ return 0;
+ }
+ }
+ }
+ return aCasingCount;
+ }
+
+ /**
+ * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb
+ */
+ private boolean isCorrectDataItem(ItemStack aStack, int state) {
+ if ((state & 1) != 0 && ItemList.Circuit_Integrated.isStackEqual(aStack, true, true)) return true;
+ if ((state & 2) != 0 && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) return true;
+ if ((state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) return true;
+ return false;
+ }
+
+ /**
+ * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb
+ */
+ public ArrayList<ItemStack> getDataItems(int state) {
+ ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ if (GT_Utility.isStackValid(mInventory[1]) && isCorrectDataItem(mInventory[1], state)) {
+ rList.add(mInventory[1]);
+ }
+ for (GT_MetaTileEntity_Hatch_DataAccess tHatch : mDataAccessHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null
+ && isCorrectDataItem(tHatch.getBaseMetaTileEntity().getStackInSlot(i), state))
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ return rList;
+ }
+
+ public boolean addDataAccessToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return mDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Assembly Line";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 0;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ // Fix GT bug
+ if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
+ log("Fixing Bad Facing. (GT Bug)");
+ this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
+ }
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public IStructureDefinition getStructureDefinition() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java
index 8b24bb2d0d..6058d23996 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java
@@ -1,7 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
@@ -26,6 +28,8 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
@@ -33,433 +37,454 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
-
-public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_DistillationTower> implements ISurvivalConstructable {
-
- private Mode mMode = Mode.DistillationTower;
- private boolean mUpgraded = false;
-
- protected static final String STRUCTURE_PIECE_BASE = "base";
- protected static final String STRUCTURE_PIECE_LAYER = "layer";
- protected static final String STRUCTURE_PIECE_LAYER_HINT = "layerHint";
- protected static final String STRUCTURE_PIECE_TOP_HINT = "topHint";
-
- protected final List<List<GT_MetaTileEntity_Hatch_Output>> mOutputHatchesByLayer = new ArrayList<>();
- protected int mHeight;
- protected int mCasing;
- protected boolean mTopLayerFound;
-
- private static IStructureDefinition<GregtechMetaTileEntity_Adv_DistillationTower> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_Adv_DistillationTower(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_Adv_DistillationTower(String aName) {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_Adv_DistillationTower(this.mName);
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_Adv_DistillationTower> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- IHatchElement<GregtechMetaTileEntity_Adv_DistillationTower> layeredOutputHatch = OutputHatch
- .withCount(GregtechMetaTileEntity_Adv_DistillationTower::getCurrentLayerOutputHatchCount)
- .withAdder(GregtechMetaTileEntity_Adv_DistillationTower::addLayerOutputHatch);
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_DistillationTower>builder()
- .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{
- {"b~b", "bbb", "bbb"},
- }))
- .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{
- {"lll", "lcl", "lll"}
- }))
- .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][]{
- {"lll", "l-l", "lll"}
- }))
- .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][]{
- {"ttt", "ttt", "ttt"}
- }))
- .addElement('b', ofChain(
- buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class)
- .atLeast(Energy, OutputBus, InputHatch, InputBus, Maintenance)
- .casingIndex(getCasingTextureId())
- .dot(1)
- .build(),
- ofBlock(GregTech_API.sBlockCasings4, 1)
- ))
- .addElement('l', buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class)
- .atLeast(layeredOutputHatch, Muffler, Energy, Maintenance)
- .casingIndex(getCasingTextureId())
- .dot(2)
- .buildAndChain(GregTech_API.sBlockCasings4, 1)
- )
- .addElement('c', ofChain(
- onElementPass(GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, ofHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower::addMufflerToMachineList, getCasingTextureId(), 3)),
- onElementPass(GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, ofHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower::addOutputToMachineList, getCasingTextureId(), 3)),
- onElementPass(GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, ofHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower::addMaintenanceToMachineList, getCasingTextureId(), 3)),
- onElementPass(GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, ofBlock(GregTech_API.sBlockCasings4, 1)),
- isAir()
- ))
- .addElement('t', buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class)
- .atLeast(layeredOutputHatch, Muffler)
- .casingIndex(getCasingTextureId())
- .dot(2)
- .buildAndChain(GregTech_API.sBlockCasings4, 1)
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
-
- protected int getCurrentLayerOutputHatchCount() {
- return mOutputHatchesByLayer.size() < mHeight ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size();
- }
-
- protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output))
- return false;
- while (mOutputHatchesByLayer.size() < mHeight)
- mOutputHatchesByLayer.add(new ArrayList<>());
- GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity();
- tHatch.updateTexture(aBaseCasingIndex);
- return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch);
- }
-
- protected void onTopLayerFound() {
- mTopLayerFound = true;
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Advanced Distillation Tower")
- .addInfo("Use 15% less energy in distillery mode")
- .addInfo("250%/100% faster in DT/distillery mode")
- .addInfo("Right click the controller with screwdriver to change mode.")
- .addInfo("Max parallel dictated by tower tier and mode")
- .addInfo("DTower Mode: T1=4, T2=12")
- .addInfo("Distilery Mode: Tower Tier * (4*InputTier)")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .addCasingInfo("Clean Stainless Steel Machine Casing", 7)
- .addInputBus("Bottom Casing", 1)
- .addOutputBus("Bottom Casing", 1)
- .addInputHatch("Bottom Casing", 1)
- .addMaintenanceHatch("Bottom Casing", 1)
- .addEnergyHatch("Bottom Casing", 1)
- .addOutputHatch("One per layer except bottom", 2)
- .addMufflerHatch("Top Casing", 3)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 1, 0, 0);
- int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height
- for (int i = 1; i < tTotalHeight - 1; i++) {
- buildPiece(STRUCTURE_PIECE_LAYER_HINT, stackSize, hintsOnly, 1, i, 0);
- }
- buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 1, tTotalHeight - 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- mHeight = 0;
- int built = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, elementBudget, source, actor, false, true);
- if (built >= 0) return built;
- int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height
- for (int i = 1; i < tTotalHeight - 1; i++) {
- mHeight = i;
- built = survivialBuildPiece(STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, i, 0, elementBudget, source, actor, false, true);
- if (built >= 0) return built;
- }
- mHeight = tTotalHeight;
- return survivialBuildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- // reset
- mOutputHatchesByLayer.forEach(List::clear);
- mHeight = 1;
- mTopLayerFound = false;
-
- // check base
- if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0))
- return false;
-
- // check each layer
- while (mHeight < 12) {
- if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) {
- return false;
- }
- if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty())
- // layer without output hatch
- return false;
- if (mTopLayerFound || !mMufflerHatches.isEmpty()) {
- break;
- }
- // not top
- mHeight++;
- }
- return mTopLayerFound && mHeight >= 2 && checkHatch();
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName()+(mUpgraded ? " T2" : ""), "MultiblockDisplay.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return mMode.getRecipeMap();
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- protected IAlignmentLimits getInitialAlignmentLimits() {
- // don't rotate a freaking tower, it won't work
- return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerSecond(ItemStack aStack) {
- if (this.mMode == Mode.Distillery) return CORE.ConfigSwitches.pollutionPerSecondMultiAdvDistillationTower_ModeDistillery;
- return CORE.ConfigSwitches.pollutionPerSecondMultiAdvDistillationTower_ModeDT;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setByte("mMode", (byte) mMode.ordinal());
- aNBT.setBoolean("mUpgraded", mUpgraded);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mMode = Mode.values()[aNBT.getByte("mMode")];
- mUpgraded = aNBT.getBoolean("mUpgraded");
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mMode = mMode.next();
- PlayerUtils.messagePlayer(aPlayer, "Now running in " + mMode + " Mode.");
- }
-
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean addOutput(FluidStack aLiquid) {
- if (aLiquid == null) return false;
- FluidStack copiedFluidStack = aLiquid.copy();
- for (List<GT_MetaTileEntity_Hatch_Output> hatches : mOutputHatchesByLayer) {
- if (dumpFluid(hatches, copiedFluidStack, true))
- return true;
- }
- for (List<GT_MetaTileEntity_Hatch_Output> hatches : mOutputHatchesByLayer) {
- if (dumpFluid(hatches, copiedFluidStack, false))
- return true;
- }
- return false;
- }
-
- @Override
- protected void addFluidOutputs(FluidStack[] mOutputFluids2) {
- if (mMode == Mode.DistillationTower) {
- // dt mode
- for (int i = 0; i < mOutputFluids2.length && i < mOutputHatchesByLayer.size(); i++) {
- FluidStack tStack = mOutputFluids2[i].copy();
- if (!dumpFluid(mOutputHatchesByLayer.get(i), tStack, true))
- dumpFluid(mOutputHatchesByLayer.get(i), tStack, false);
- }
- } else {
- // distillery mode
- for (FluidStack outputFluidStack : mOutputFluids2) {
- addOutput(outputFluidStack);
- }
- }
- }
-
- @Override
- public int canBufferOutputs(ItemStack[] aItemOutputs, FluidStack[] aFluidOutputs, int aParallelRecipes) {
- // do void excess checks
- if (mVoidExcess) return aParallelRecipes;
- // sb mode. no need to check layered outputs
- if (mMode == Mode.Distillery) return super.canBufferOutputs(aItemOutputs, aFluidOutputs, aParallelRecipes);
- // not enough output hatches
- if (mOutputHatchesByLayer.size() < aFluidOutputs.length) {
- log("Not enough output layers for distillation towers");
- return 0;
- }
- // first check if item output can be held. We delegate this to super class since we do not have special item hatches
- aParallelRecipes = super.canBufferOutputs(aItemOutputs, new FluidStack[0], aParallelRecipes);
- if (aParallelRecipes == 0) return 0;
- for (int i = 0; i < aFluidOutputs.length; i++) {
- FluidStack tFluidOutput = aFluidOutputs[i];
- FluidStack tCopied = new FluidStack(tFluidOutput, 0);
- int toFill = tFluidOutput.amount * aParallelRecipes;
- for (GT_MetaTileEntity_Hatch_Output hatch : mOutputHatchesByLayer.get(i)) {
- boolean fluidMatch =
- hatch.isFluidLocked() ?
- tFluidOutput.getFluid().getName().equals(hatch.getLockedFluidName()) :
- hatch.getFluid() == null || hatch.getFluid().isFluidEqual(tFluidOutput);
-
- if (fluidMatch) {
- tCopied.amount = toFill;
- toFill -= hatch.fill(tCopied, false);
- if (toFill == 0)
- // no more current fluid to fill. break out to go to next fluid
- break;
- }
- }
- // use ceil div
- aParallelRecipes -= (toFill + tFluidOutput.amount - 1) / tFluidOutput.amount;
- }
- return aParallelRecipes;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "DistillationTower";
- }
-
- @Override
- public String getMachineType() {
- return "Distillery, Distillation Tower";
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- // Run standard recipe handling for distillery recipes
- if (mMode == Mode.Distillery) {
- return this.checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 100);
- }
- else {
- ItemStack[] inputs = getCompactedInputs();
-
- for (GT_MetaTileEntity_Hatch_Input hatch : mInputHatches) {
- FluidStack tFluid = hatch.getFluid();
- if (tFluid != null) {
- if (checkRecipeGeneric(inputs, new FluidStack[]{tFluid}, getMaxParallelRecipes(), 100, 250, 10000)) {
- return true;
- }
- }
- }
- return false;
- }
- }
-
- @Override
- public int getMaxParallelRecipes() {
- switch (mMode) {
- case DistillationTower:
- return getTierOfTower() == 1 ? 4 : getTierOfTower() == 2 ? 12 : 0;
- case Distillery:
- return getTierOfTower() * (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
- default:
- return 0;
- }
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 15;
- }
-
- private int getTierOfTower() {
- return mUpgraded ? 2 : 1;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER;
- }
-
- @Override
- protected int getCasingTextureId() {
- return 49;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aTick % 20 == 0 && !mUpgraded) {
- ItemStack aGuiStack = this.getGUIItemStack();
- if (aGuiStack != null) {
- if (GT_Utility.areStacksEqual(aGuiStack, GregtechItemList.Distillus_Upgrade_Chip.get(1))) {
- this.mUpgraded = true;
- ItemUtils.depleteStack(aGuiStack);
- }
- }
- }
- }
-
- @Override
- public void setItemNBT(NBTTagCompound aNBT) {
- aNBT.setBoolean("mUpgraded", mUpgraded);
- super.setItemNBT(aNBT);
- }
-
- private enum Mode {
- DistillationTower(GT_Recipe_Map.sDistillationRecipes),
- Distillery(GT_Recipe_Map.sDistilleryRecipes),
- ;
- static final Mode[] VALUES = values();
- private final GT_Recipe_Map recipeMap;
-
- Mode(GT_Recipe_Map recipeMap) {
- this.recipeMap = recipeMap;
- }
-
- public GT_Recipe_Map getRecipeMap() {
- return recipeMap;
- }
-
- public Mode next() {
- return VALUES[ordinal() + 1 % VALUES.length];
- }
- }
-} \ No newline at end of file
+public class GregtechMetaTileEntity_Adv_DistillationTower
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_DistillationTower>
+ implements ISurvivalConstructable {
+
+ private Mode mMode = Mode.DistillationTower;
+ private boolean mUpgraded = false;
+
+ protected static final String STRUCTURE_PIECE_BASE = "base";
+ protected static final String STRUCTURE_PIECE_LAYER = "layer";
+ protected static final String STRUCTURE_PIECE_LAYER_HINT = "layerHint";
+ protected static final String STRUCTURE_PIECE_TOP_HINT = "topHint";
+
+ protected final List<List<GT_MetaTileEntity_Hatch_Output>> mOutputHatchesByLayer = new ArrayList<>();
+ protected int mHeight;
+ protected int mCasing;
+ protected boolean mTopLayerFound;
+
+ private static IStructureDefinition<GregtechMetaTileEntity_Adv_DistillationTower> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_Adv_DistillationTower(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_Adv_DistillationTower(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_Adv_DistillationTower(this.mName);
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_Adv_DistillationTower> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ IHatchElement<GregtechMetaTileEntity_Adv_DistillationTower> layeredOutputHatch = OutputHatch.withCount(
+ GregtechMetaTileEntity_Adv_DistillationTower::getCurrentLayerOutputHatchCount)
+ .withAdder(GregtechMetaTileEntity_Adv_DistillationTower::addLayerOutputHatch);
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_DistillationTower>builder()
+ .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] {
+ {"b~b", "bbb", "bbb"},
+ }))
+ .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] {{"lll", "lcl", "lll"}}))
+ .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] {{"lll", "l-l", "lll"}}))
+ .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] {{"ttt", "ttt", "ttt"}}))
+ .addElement(
+ 'b',
+ ofChain(
+ buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class)
+ .atLeast(Energy, OutputBus, InputHatch, InputBus, Maintenance)
+ .casingIndex(getCasingTextureId())
+ .dot(1)
+ .build(),
+ ofBlock(GregTech_API.sBlockCasings4, 1)))
+ .addElement(
+ 'l',
+ buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class)
+ .atLeast(layeredOutputHatch, Muffler, Energy, Maintenance)
+ .casingIndex(getCasingTextureId())
+ .dot(2)
+ .buildAndChain(GregTech_API.sBlockCasings4, 1))
+ .addElement(
+ 'c',
+ ofChain(
+ onElementPass(
+ GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound,
+ ofHatchAdder(
+ GregtechMetaTileEntity_Adv_DistillationTower
+ ::addMufflerToMachineList,
+ getCasingTextureId(),
+ 3)),
+ onElementPass(
+ GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound,
+ ofHatchAdder(
+ GregtechMetaTileEntity_Adv_DistillationTower
+ ::addOutputToMachineList,
+ getCasingTextureId(),
+ 3)),
+ onElementPass(
+ GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound,
+ ofHatchAdder(
+ GregtechMetaTileEntity_Adv_DistillationTower
+ ::addMaintenanceToMachineList,
+ getCasingTextureId(),
+ 3)),
+ onElementPass(
+ GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound,
+ ofBlock(GregTech_API.sBlockCasings4, 1)),
+ isAir()))
+ .addElement(
+ 't',
+ buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class)
+ .atLeast(layeredOutputHatch, Muffler)
+ .casingIndex(getCasingTextureId())
+ .dot(2)
+ .buildAndChain(GregTech_API.sBlockCasings4, 1))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ protected int getCurrentLayerOutputHatchCount() {
+ return mOutputHatchesByLayer.size() < mHeight
+ ? 0
+ : mOutputHatchesByLayer.get(mHeight - 1).size();
+ }
+
+ protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null
+ || aTileEntity.isDead()
+ || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false;
+ while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>());
+ GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity();
+ tHatch.updateTexture(aBaseCasingIndex);
+ return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch);
+ }
+
+ protected void onTopLayerFound() {
+ mTopLayerFound = true;
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Advanced Distillation Tower")
+ .addInfo("Use 15% less energy in distillery mode")
+ .addInfo("250%/100% faster in DT/distillery mode")
+ .addInfo("Right click the controller with screwdriver to change mode.")
+ .addInfo("Max parallel dictated by tower tier and mode")
+ .addInfo("DTower Mode: T1=4, T2=12")
+ .addInfo("Distilery Mode: Tower Tier * (4*InputTier)")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .addCasingInfo("Clean Stainless Steel Machine Casing", 7)
+ .addInputBus("Bottom Casing", 1)
+ .addOutputBus("Bottom Casing", 1)
+ .addInputHatch("Bottom Casing", 1)
+ .addMaintenanceHatch("Bottom Casing", 1)
+ .addEnergyHatch("Bottom Casing", 1)
+ .addOutputHatch("One per layer except bottom", 2)
+ .addMufflerHatch("Top Casing", 3)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 1, 0, 0);
+ int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height
+ for (int i = 1; i < tTotalHeight - 1; i++) {
+ buildPiece(STRUCTURE_PIECE_LAYER_HINT, stackSize, hintsOnly, 1, i, 0);
+ }
+ buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 1, tTotalHeight - 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ mHeight = 0;
+ int built = survivialBuildPiece(
+ STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, elementBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height
+ for (int i = 1; i < tTotalHeight - 1; i++) {
+ mHeight = i;
+ built = survivialBuildPiece(
+ STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, i, 0, elementBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ }
+ mHeight = tTotalHeight;
+ return survivialBuildPiece(
+ STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ // reset
+ mOutputHatchesByLayer.forEach(List::clear);
+ mHeight = 1;
+ mTopLayerFound = false;
+
+ // check base
+ if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) return false;
+
+ // check each layer
+ while (mHeight < 12) {
+ if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) {
+ return false;
+ }
+ if (mOutputHatchesByLayer.size() < mHeight
+ || mOutputHatchesByLayer.get(mHeight - 1).isEmpty())
+ // layer without output hatch
+ return false;
+ if (mTopLayerFound || !mMufflerHatches.isEmpty()) {
+ break;
+ }
+ // not top
+ mHeight++;
+ }
+ return mTopLayerFound && mHeight >= 2 && checkHatch();
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory,
+ aBaseMetaTileEntity,
+ getLocalName() + (mUpgraded ? " T2" : ""),
+ "MultiblockDisplay.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return mMode.getRecipeMap();
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ protected IAlignmentLimits getInitialAlignmentLimits() {
+ // don't rotate a freaking tower, it won't work
+ return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerSecond(ItemStack aStack) {
+ if (this.mMode == Mode.Distillery)
+ return CORE.ConfigSwitches.pollutionPerSecondMultiAdvDistillationTower_ModeDistillery;
+ return CORE.ConfigSwitches.pollutionPerSecondMultiAdvDistillationTower_ModeDT;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setByte("mMode", (byte) mMode.ordinal());
+ aNBT.setBoolean("mUpgraded", mUpgraded);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mMode = Mode.values()[aNBT.getByte("mMode")];
+ mUpgraded = aNBT.getBoolean("mUpgraded");
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void startProcess() {
+ this.sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mMode = mMode.next();
+ PlayerUtils.messagePlayer(aPlayer, "Now running in " + mMode + " Mode.");
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean addOutput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ FluidStack copiedFluidStack = aLiquid.copy();
+ for (List<GT_MetaTileEntity_Hatch_Output> hatches : mOutputHatchesByLayer) {
+ if (dumpFluid(hatches, copiedFluidStack, true)) return true;
+ }
+ for (List<GT_MetaTileEntity_Hatch_Output> hatches : mOutputHatchesByLayer) {
+ if (dumpFluid(hatches, copiedFluidStack, false)) return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected void addFluidOutputs(FluidStack[] mOutputFluids2) {
+ if (mMode == Mode.DistillationTower) {
+ // dt mode
+ for (int i = 0; i < mOutputFluids2.length && i < mOutputHatchesByLayer.size(); i++) {
+ FluidStack tStack = mOutputFluids2[i].copy();
+ if (!dumpFluid(mOutputHatchesByLayer.get(i), tStack, true))
+ dumpFluid(mOutputHatchesByLayer.get(i), tStack, false);
+ }
+ } else {
+ // distillery mode
+ for (FluidStack outputFluidStack : mOutputFluids2) {
+ addOutput(outputFluidStack);
+ }
+ }
+ }
+
+ @Override
+ public int canBufferOutputs(ItemStack[] aItemOutputs, FluidStack[] aFluidOutputs, int aParallelRecipes) {
+ // do void excess checks
+ if (mVoidExcess) return aParallelRecipes;
+ // sb mode. no need to check layered outputs
+ if (mMode == Mode.Distillery) return super.canBufferOutputs(aItemOutputs, aFluidOutputs, aParallelRecipes);
+ // not enough output hatches
+ if (mOutputHatchesByLayer.size() < aFluidOutputs.length) {
+ log("Not enough output layers for distillation towers");
+ return 0;
+ }
+ // first check if item output can be held. We delegate this to super class since we do not have special item
+ // hatches
+ aParallelRecipes = super.canBufferOutputs(aItemOutputs, new FluidStack[0], aParallelRecipes);
+ if (aParallelRecipes == 0) return 0;
+ for (int i = 0; i < aFluidOutputs.length; i++) {
+ FluidStack tFluidOutput = aFluidOutputs[i];
+ FluidStack tCopied = new FluidStack(tFluidOutput, 0);
+ int toFill = tFluidOutput.amount * aParallelRecipes;
+ for (GT_MetaTileEntity_Hatch_Output hatch : mOutputHatchesByLayer.get(i)) {
+ boolean fluidMatch = hatch.isFluidLocked()
+ ? tFluidOutput.getFluid().getName().equals(hatch.getLockedFluidName())
+ : hatch.getFluid() == null || hatch.getFluid().isFluidEqual(tFluidOutput);
+
+ if (fluidMatch) {
+ tCopied.amount = toFill;
+ toFill -= hatch.fill(tCopied, false);
+ if (toFill == 0)
+ // no more current fluid to fill. break out to go to next fluid
+ break;
+ }
+ }
+ // use ceil div
+ aParallelRecipes -= (toFill + tFluidOutput.amount - 1) / tFluidOutput.amount;
+ }
+ return aParallelRecipes;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "DistillationTower";
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Distillery, Distillation Tower";
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ // Run standard recipe handling for distillery recipes
+ if (mMode == Mode.Distillery) {
+ return this.checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 100);
+ } else {
+ ItemStack[] inputs = getCompactedInputs();
+
+ for (GT_MetaTileEntity_Hatch_Input hatch : mInputHatches) {
+ FluidStack tFluid = hatch.getFluid();
+ if (tFluid != null) {
+ if (checkRecipeGeneric(
+ inputs, new FluidStack[] {tFluid}, getMaxParallelRecipes(), 100, 250, 10000)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ switch (mMode) {
+ case DistillationTower:
+ return getTierOfTower() == 1 ? 4 : getTierOfTower() == 2 ? 12 : 0;
+ case Distillery:
+ return getTierOfTower() * (4 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ default:
+ return 0;
+ }
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 15;
+ }
+
+ private int getTierOfTower() {
+ return mUpgraded ? 2 : 1;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return 49;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (aTick % 20 == 0 && !mUpgraded) {
+ ItemStack aGuiStack = this.getGUIItemStack();
+ if (aGuiStack != null) {
+ if (GT_Utility.areStacksEqual(aGuiStack, GregtechItemList.Distillus_Upgrade_Chip.get(1))) {
+ this.mUpgraded = true;
+ ItemUtils.depleteStack(aGuiStack);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ aNBT.setBoolean("mUpgraded", mUpgraded);
+ super.setItemNBT(aNBT);
+ }
+
+ private enum Mode {
+ DistillationTower(GT_Recipe_Map.sDistillationRecipes),
+ Distillery(GT_Recipe_Map.sDistilleryRecipes),
+ ;
+ static final Mode[] VALUES = values();
+ private final GT_Recipe_Map recipeMap;
+
+ Mode(GT_Recipe_Map recipeMap) {
+ this.recipeMap = recipeMap;
+ }
+
+ public GT_Recipe_Map getRecipeMap() {
+ return recipeMap;
+ }
+
+ public Mode next() {
+ return VALUES[ordinal() + 1 % VALUES.length];
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
index 5c16be3e88..d493b695a6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
@@ -1,7 +1,13 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofCoil;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -19,10 +25,11 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -31,473 +38,473 @@ import net.minecraft.util.ChatComponentTranslation;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gregtech.api.util.GT_StructureUtility.ofCoil;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_EBF> implements ISurvivalConstructable {
-
- public static int CASING_TEXTURE_ID;
- public static String mHotFuelName = "Blazing Pyrotheum";
- public static String mCasingName = "Volcanus Casing";
- public static String mHatchName = "Pyrotheum Hatch";
- private IStructureDefinition<GregtechMetaTileEntity_Adv_EBF> STRUCTURE_DEFINITION = null;
- private int mCasing;
- private final ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mPyrotheumHatches = new ArrayList<>();
-
- private HeatingCoilLevel mHeatingCapacity;
- private boolean isBussesSeparate = false;
-
- public GregtechMetaTileEntity_Adv_EBF(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 11);
- }
-
- public GregtechMetaTileEntity_Adv_EBF(String aName) {
- super(aName);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 11);
- }
-
- @Override
- public String getMachineType() {
- return "Blast Furnace";
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_Adv_EBF(this.mName);
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Factory Grade Advanced Blast Furnace")
- .addInfo("Speed: +120% | EU Usage: 90% | Parallel: 8")
- .addInfo("Consumes 10L of " + mHotFuelName + " per second during operation")
- .addInfo("Constructed exactly the same as a normal EBF")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .addController("Bottom center")
- .addCasingInfo(mCasingName, 9)
- .addInputHatch("Any Casing", 1)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addStructureHint(mHatchName, 1)
- .addEnergyHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_Adv_EBF> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_EBF>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"HHH", "H-H", "HHH"},
- {"HHH", "H-H", "HHH"},
- {"C~C", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class)
- .adder(GregtechMetaTileEntity_Adv_EBF::addPyrotheumHatch)
- .hatchId(968)
- .casingIndex(CASING_TEXTURE_ID)
- .dot(1)
- .build(),
- buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
- .casingIndex(CASING_TEXTURE_ID)
- .dot(1)
- .build(),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasings3Misc, 11
- )
- )
- )
- )
- .addElement(
- 'H',
- ofCoil(
- GregtechMetaTileEntity_Adv_EBF::setCoilLevel, GregtechMetaTileEntity_Adv_EBF::getCoilLevel
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName, stackSize, hintsOnly, 1, 3, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mPyrotheumHatches.clear();
- setCoilLevel(HeatingCoilLevel.None);
- return checkPiece(mName, 1, 3, 0) && mCasing >= 9 && getCoilLevel() != HeatingCoilLevel.None && checkHatch();
- }
-
- @Override
- public boolean checkHatch() {
- return super.checkHatch() || !mPyrotheumHatches.isEmpty();
- }
-
- private boolean addPyrotheumHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 968) {
- return addToMachineListInternal(mPyrotheumHatches, aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- @Override
- public void updateSlots() {
- for (GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : mPyrotheumHatches)
- if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
- super.updateSlots();
- }
-
- private boolean depleteFuel(int aAmount) {
- for (final GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : this.mPyrotheumHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- FluidStack tLiquid = tHatch.getFluid();
- if (tLiquid == null || tLiquid.amount < aAmount) {
- continue;
- }
- tLiquid = tHatch.drain(aAmount, false);
- if (tLiquid != null && tLiquid.amount >= aAmount) {
- tLiquid = tHatch.drain(aAmount, true);
- return tLiquid != null && tLiquid.amount >= aAmount;
- }
- }
- }
- return false;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return CASING_TEXTURE_ID;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "ElectricBlastFurnace";
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sBlastRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- if (isBussesSeparate) {
- FluidStack[] tFluids = getStoredFluids().toArray(new FluidStack[0]);
- for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
- ArrayList<ItemStack> tInputs = new ArrayList<>();
- if (isValidMetaTileEntity(tBus)) {
- for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) {
- tInputs.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- }
- if (tInputs.size() > 0) {
- if (checkRecipeGeneric(tInputs.toArray(new ItemStack[0]), tFluids, 8, 90, 120, 10000)) {
- return true;
- }
- }
- }
- return false;
- } else {
- return checkRecipeGeneric(8, 90, 120);
- }
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerSecond(ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiAdvEBF;
- }
-
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes,
- long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[] {};
- this.mOutputFluids = new FluidStack[] {};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- Logger.WARNING("Running checkRecipeGeneric(0)");
-
- GT_Recipe tRecipe = this.getRecipeMap().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
- Logger.WARNING("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null || this.mHeatingCapacity.getHeat() < tRecipe.mSpecialValue) {
- Logger.WARNING("BAD RETURN - 1");
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- Logger.WARNING("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- int tHeatCapacityDivTiers = (int) (mHeatingCapacity.getHeat() - tRecipe.mSpecialValue) / 900;
- if (tHeatCapacityDivTiers > 0)
- tRecipeEUt = (int) (tRecipeEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
- // Count recipes to do in parallel, consuming input items and fluids and
- // considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- Logger.WARNING("Broke at " + parallelRecipes + ".");
- break;
- }
- Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- Logger.WARNING("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
- int tHalfHeatCapacityDivTiers = tHeatCapacityDivTiers / 2;
-
- this.mEUt = (int) Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- if (tHalfHeatCapacityDivTiers > 0) {
- this.mMaxProgresstime = mMaxProgresstime / 4;
- tHalfHeatCapacityDivTiers--;
- } else {
- this.mMaxProgresstime = mMaxProgresstime / 2;
- }
- if (this.mMaxProgresstime <= 1) {
- break;
- }
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0)
- tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- Logger.WARNING("GOOD RETURN - 1");
- return true;
-
- }
-
- private int mGraceTimer = 2;
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- //Try dry Pyrotheum after all other logic
- if (this.mStartUpCheck < 0) {
- if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
- if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
- if (!this.depleteInputFromRestrictedHatches(this.mPyrotheumHatches, 5)) {
- if (mGraceTimer-- == 0) {
- this.causeMaintenanceIssue();
- this.stopMachine();
- mGraceTimer = 2;
- }
- }
- }
- }
- }
-
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 8;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 90;
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- isBussesSeparate = !isBussesSeparate;
- aPlayer.addChatMessage(new ChatComponentTranslation(isBussesSeparate ? "interaction.separateBusses.enabled" : "interaction.separateBusses.disabled"));
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setBoolean("isBussesSeparate", isBussesSeparate);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- isBussesSeparate = aNBT.getBoolean("isBussesSeparate");
- super.loadNBTData(aNBT);
- }
-
- public HeatingCoilLevel getCoilLevel() {
- return mHeatingCapacity;
- }
-
- public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
- mHeatingCapacity = aCoilLevel;
- }
+public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_EBF>
+ implements ISurvivalConstructable {
+
+ public static int CASING_TEXTURE_ID;
+ public static String mHotFuelName = "Blazing Pyrotheum";
+ public static String mCasingName = "Volcanus Casing";
+ public static String mHatchName = "Pyrotheum Hatch";
+ private IStructureDefinition<GregtechMetaTileEntity_Adv_EBF> STRUCTURE_DEFINITION = null;
+ private int mCasing;
+ private final ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mPyrotheumHatches = new ArrayList<>();
+
+ private HeatingCoilLevel mHeatingCapacity;
+ private boolean isBussesSeparate = false;
+
+ public GregtechMetaTileEntity_Adv_EBF(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 11);
+ }
+
+ public GregtechMetaTileEntity_Adv_EBF(String aName) {
+ super(aName);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 11);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Blast Furnace";
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_Adv_EBF(this.mName);
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Factory Grade Advanced Blast Furnace")
+ .addInfo("Speed: +120% | EU Usage: 90% | Parallel: 8")
+ .addInfo("Consumes 10L of " + mHotFuelName + " per second during operation")
+ .addInfo("Constructed exactly the same as a normal EBF")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .addController("Bottom center")
+ .addCasingInfo(mCasingName, 9)
+ .addInputHatch("Any Casing", 1)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addStructureHint(mHatchName, 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_Adv_EBF> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_EBF>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"HHH", "H-H", "HHH"},
+ {"HHH", "H-H", "HHH"},
+ {"C~C", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class)
+ .adder(GregtechMetaTileEntity_Adv_EBF::addPyrotheumHatch)
+ .hatchId(968)
+ .casingIndex(CASING_TEXTURE_ID)
+ .dot(1)
+ .build(),
+ buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class)
+ .atLeast(
+ InputBus,
+ OutputBus,
+ Maintenance,
+ Energy,
+ Muffler,
+ InputHatch,
+ OutputHatch)
+ .casingIndex(CASING_TEXTURE_ID)
+ .dot(1)
+ .build(),
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 11))))
+ .addElement(
+ 'H',
+ ofCoil(
+ GregtechMetaTileEntity_Adv_EBF::setCoilLevel,
+ GregtechMetaTileEntity_Adv_EBF::getCoilLevel))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 3, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mPyrotheumHatches.clear();
+ setCoilLevel(HeatingCoilLevel.None);
+ return checkPiece(mName, 1, 3, 0) && mCasing >= 9 && getCoilLevel() != HeatingCoilLevel.None && checkHatch();
+ }
+
+ @Override
+ public boolean checkHatch() {
+ return super.checkHatch() || !mPyrotheumHatches.isEmpty();
+ }
+
+ private boolean addPyrotheumHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase
+ && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 968) {
+ return addToMachineListInternal(mPyrotheumHatches, aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void updateSlots() {
+ for (GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : mPyrotheumHatches)
+ if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
+ super.updateSlots();
+ }
+
+ private boolean depleteFuel(int aAmount) {
+ for (final GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : this.mPyrotheumHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ FluidStack tLiquid = tHatch.getFluid();
+ if (tLiquid == null || tLiquid.amount < aAmount) {
+ continue;
+ }
+ tLiquid = tHatch.drain(aAmount, false);
+ if (tLiquid != null && tLiquid.amount >= aAmount) {
+ tLiquid = tHatch.drain(aAmount, true);
+ return tLiquid != null && tLiquid.amount >= aAmount;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return CASING_TEXTURE_ID;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "ElectricBlastFurnace";
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sBlastRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ if (isBussesSeparate) {
+ FluidStack[] tFluids = getStoredFluids().toArray(new FluidStack[0]);
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tInputs = new ArrayList<>();
+ if (isValidMetaTileEntity(tBus)) {
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) {
+ tInputs.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ if (tInputs.size() > 0) {
+ if (checkRecipeGeneric(tInputs.toArray(new ItemStack[0]), tFluids, 8, 90, 120, 10000)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ } else {
+ return checkRecipeGeneric(8, 90, 120);
+ }
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiAdvEBF;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ Logger.WARNING("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = this.getRecipeMap()
+ .findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+
+ Logger.WARNING("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null || this.mHeatingCapacity.getHeat() < tRecipe.mSpecialValue) {
+ Logger.WARNING("BAD RETURN - 1");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ Logger.WARNING("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ int tHeatCapacityDivTiers = (int) (mHeatingCapacity.getHeat() - tRecipe.mSpecialValue) / 900;
+ if (tHeatCapacityDivTiers > 0) tRecipeEUt = (int) (tRecipeEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+ // Count recipes to do in parallel, consuming input items and fluids and
+ // considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ Logger.WARNING("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ Logger.WARNING("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+ int tHalfHeatCapacityDivTiers = tHeatCapacityDivTiers / 2;
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ if (tHalfHeatCapacityDivTiers > 0) {
+ this.mMaxProgresstime = mMaxProgresstime / 4;
+ tHalfHeatCapacityDivTiers--;
+ } else {
+ this.mMaxProgresstime = mMaxProgresstime / 2;
+ }
+ if (this.mMaxProgresstime <= 1) {
+ break;
+ }
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ Logger.WARNING("GOOD RETURN - 1");
+ return true;
+ }
+
+ private int mGraceTimer = 2;
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ // Try dry Pyrotheum after all other logic
+ if (this.mStartUpCheck < 0) {
+ if (this.mMaxProgresstime > 0 && this.mProgresstime != 0
+ || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (!this.depleteInputFromRestrictedHatches(this.mPyrotheumHatches, 5)) {
+ if (mGraceTimer-- == 0) {
+ this.causeMaintenanceIssue();
+ this.stopMachine();
+ mGraceTimer = 2;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 8;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 90;
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ isBussesSeparate = !isBussesSeparate;
+ aPlayer.addChatMessage(new ChatComponentTranslation(
+ isBussesSeparate ? "interaction.separateBusses.enabled" : "interaction.separateBusses.disabled"));
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("isBussesSeparate", isBussesSeparate);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ isBussesSeparate = aNBT.getBoolean("isBussesSeparate");
+ super.loadNBTData(aNBT);
+ }
+
+ public HeatingCoilLevel getCoilLevel() {
+ return mHeatingCapacity;
+ }
+
+ public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
+ mHeatingCapacity = aCoilLevel;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java
index 8aa91fa41a..8df07d8990 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java
@@ -19,16 +19,15 @@ import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-import net.minecraft.block.Block;
-
import java.lang.reflect.Method;
+import net.minecraft.block.Block;
public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_FusionComputer {
- public static final Method mUpdateHatchTexture;
-
- static {
- mUpdateHatchTexture = ReflectionUtils.getMethod(GT_MetaTileEntity_Hatch.class, "updateTexture", int.class);
+ public static final Method mUpdateHatchTexture;
+
+ static {
+ mUpdateHatchTexture = ReflectionUtils.getMethod(GT_MetaTileEntity_Hatch.class, "updateTexture", int.class);
}
public GregtechMetaTileEntity_Adv_Fusion_MK4(int aID, String aName, String aNameRegional) {
@@ -56,7 +55,7 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus
.addStructureInfo("ALL Hatches must be UHV or better")
.toolTipFinisher(CORE.GT_Tooltip_Builder);
return tt;
- }
+ }
@Override
public int tier() {
@@ -69,91 +68,107 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus
}
@Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_Adv_Fusion_MK4(mName);
- }
-
- @Override
- public Block getCasing() {
- return getFusionCoil();
- }
-
- @Override
- public int getCasingMeta() {
- return 12;
- }
-
- @Override
- public Block getFusionCoil() {
- return ModBlocks.blockCasings3Misc;
- }
-
- @Override
- public int getFusionCoilMeta() {
- return 13;
- }
-
- @Override
- public int tierOverclock() {
- return 8;
- }
-
- @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_Adv_Fusion_MK4(mName);
+ }
+
+ @Override
+ public Block getCasing() {
+ return getFusionCoil();
+ }
+
+ @Override
+ public int getCasingMeta() {
+ return 12;
+ }
+
+ @Override
+ public Block getFusionCoil() {
+ return ModBlocks.blockCasings3Misc;
+ }
+
+ @Override
+ public int getFusionCoilMeta() {
+ return 13;
+ }
+
+ @Override
+ public int tierOverclock() {
+ return 8;
+ }
+
+ @Override
public int overclock(int mStartEnergy) {
return (mStartEnergy < 160000000) ? 16 : ((mStartEnergy < 320000000) ? 8 : (mStartEnergy < 640000000) ? 4 : 1);
}
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[]{
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS,
- Dyes.getModulation(-1, Dyes._NULL.mRGBa)),
- TextureFactory.builder().addIcon(this.getIconOverlay()).extFacing().build()};
- } else if (!aActive) {
- return new ITexture[]{
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS,
- Dyes.getModulation(-1, Dyes._NULL.mRGBa))};
- } else {
- return new ITexture[]{
- new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA,
- Dyes.getModulation(-1, Dyes._NULL.mRGBa))};
- }
- }
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)),
+ TextureFactory.builder()
+ .addIcon(this.getIconOverlay())
+ .extFacing()
+ .build()
+ };
+ } else if (!aActive) {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa))
+ };
+ } else {
+ return new ITexture[] {
+ new GT_RenderedTexture(
+ TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA, Dyes.getModulation(-1, Dyes._NULL.mRGBa))
+ };
+ }
+ }
@Override
public ITexture getTextureOverlay() {
- return new GT_RenderedTexture(this.mMaxProgresstime > 0 ? TexturesGtBlock.Casing_Machine_Screen_3 : TexturesGtBlock.Casing_Machine_Screen_1);
- }
-
- public IIconContainer getIconOverlay() {
- return this.mMaxProgresstime > 0 ? TexturesGtBlock.Casing_Machine_Screen_3 : TexturesGtBlock.Casing_Machine_Screen_1;
- }
-
- public boolean turnCasingActive(final boolean status) {
- try {
- if (this.mEnergyHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Energy hatch : this.mEnergyHatches) {
- mUpdateHatchTexture.invoke(hatch, (status ? TAE.getIndexFromPage(2, 14) : 53));
- }
- }
- if (this.mOutputHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Output hatch2 : this.mOutputHatches) {
- mUpdateHatchTexture.invoke(hatch2, (status ? TAE.getIndexFromPage(2, 14) : 53));
- }
- }
- if (this.mInputHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Input hatch3 : this.mInputHatches) {
- mUpdateHatchTexture.invoke(hatch3, (status ? TAE.getIndexFromPage(2, 14) : 53));
- }
- }
- }
- catch (Throwable t) {
- return false;
- }
- return true;
- }
-
+ return new GT_RenderedTexture(
+ this.mMaxProgresstime > 0
+ ? TexturesGtBlock.Casing_Machine_Screen_3
+ : TexturesGtBlock.Casing_Machine_Screen_1);
+ }
+
+ public IIconContainer getIconOverlay() {
+ return this.mMaxProgresstime > 0
+ ? TexturesGtBlock.Casing_Machine_Screen_3
+ : TexturesGtBlock.Casing_Machine_Screen_1;
+ }
+
+ public boolean turnCasingActive(final boolean status) {
+ try {
+ if (this.mEnergyHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Energy hatch : this.mEnergyHatches) {
+ mUpdateHatchTexture.invoke(hatch, (status ? TAE.getIndexFromPage(2, 14) : 53));
+ }
+ }
+ if (this.mOutputHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Output hatch2 : this.mOutputHatches) {
+ mUpdateHatchTexture.invoke(hatch2, (status ? TAE.getIndexFromPage(2, 14) : 53));
+ }
+ }
+ if (this.mInputHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Input hatch3 : this.mInputHatches) {
+ mUpdateHatchTexture.invoke(hatch3, (status ? TAE.getIndexFromPage(2, 14) : 53));
+ }
+ }
+ } catch (Throwable t) {
+ return false;
+ }
+ return true;
+ }
+
@Override
public String[] getInfoData() {
String tier = "IV";
@@ -162,15 +177,15 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus
if (this.mLastRecipe != null) {
powerRequired = this.mLastRecipe.mEUt;
if (this.mLastRecipe.getFluidOutput(0) != null) {
- plasmaOut = (float)this.mLastRecipe.getFluidOutput(0).amount / (float)this.mLastRecipe.mDuration;
+ plasmaOut = (float) this.mLastRecipe.getFluidOutput(0).amount / (float) this.mLastRecipe.mDuration;
}
}
- return new String[]{
- "Fusion Reactor MK "+tier,
- "EU Required: "+powerRequired+"EU/t",
- "Stored EU: "+mEUStore+" / "+maxEUStore(),
- "Plasma Output: "+plasmaOut+"L/t"};
+ return new String[] {
+ "Fusion Reactor MK " + tier,
+ "EU Required: " + powerRequired + "EU/t",
+ "Stored EU: " + mEUStore + " / " + maxEUStore(),
+ "Plasma Output: " + plasmaOut + "L/t"
+ };
}
-
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java
index d568c298ee..002cffb816 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java
@@ -6,7 +6,6 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.TAE;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
@@ -31,55 +30,84 @@ import net.minecraft.util.StatCollector;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_HeatExchanger> {
-
- private static final int CASING_INDEX = TAE.getIndexFromPage(1, 12);
+public class GregtechMetaTileEntity_Adv_HeatExchanger
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_HeatExchanger> {
+
+ private static final int CASING_INDEX = TAE.getIndexFromPage(1, 12);
private static final String STRUCTURE_PIECE_MAIN = "main";
-
- private static final IStructureDefinition<GregtechMetaTileEntity_Adv_HeatExchanger> STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_HeatExchanger>builder()
- .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{
- {" ccc ", "cCCCc", "cCCCc", "cCCCc", " ccc "},
- {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
- {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
- {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
- {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
- {" c~c ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
- {" hhh ", "hHHHh", "hHHHh", "hHHHh", " hhh "},
- {" f f ", "f f", " ", "f f", " f f "},
- {" f f ", "f f", " ", "f f", " f f "},
- }))
- .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15))
- .addElement('f', ofBlock(getFrame(), 0))
- .addElement('C', ofChain(
- ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addColdFluidOutputToMachineList, CASING_INDEX, 2),
- onElementPass(GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, ofBlock(ModBlocks.blockSpecialMultiCasings, 14))
- ))
- .addElement('H', ofChain(
- ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addHotFluidInputToMachineList, CASING_INDEX, 3),
- onElementPass(GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, ofBlock(ModBlocks.blockSpecialMultiCasings, 14))
- ))
- .addElement('h', ofChain(
- ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addInputToMachineList, CASING_INDEX, 1),
- ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addOutputToMachineList, CASING_INDEX, 1),
- ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addMaintenanceToMachineList, CASING_INDEX, 1),
- onElementPass(GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, ofBlock(ModBlocks.blockSpecialMultiCasings, 14))
- ))
- .addElement('c', ofChain(
- onElementPass(GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, ofBlock(ModBlocks.blockSpecialMultiCasings, 14))
- ))
- .build();
- public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25)
+
+ private static final IStructureDefinition<GregtechMetaTileEntity_Adv_HeatExchanger> STRUCTURE_DEFINITION =
+ StructureDefinition.<GregtechMetaTileEntity_Adv_HeatExchanger>builder()
+ .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] {
+ {" ccc ", "cCCCc", "cCCCc", "cCCCc", " ccc "},
+ {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
+ {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
+ {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
+ {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
+ {" c~c ", "cPPPc", "cPPPc", "cPPPc", " ccc "},
+ {" hhh ", "hHHHh", "hHHHh", "hHHHh", " hhh "},
+ {" f f ", "f f", " ", "f f", " f f "},
+ {" f f ", "f f", " ", "f f", " f f "},
+ }))
+ .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15))
+ .addElement('f', ofBlock(getFrame(), 0))
+ .addElement(
+ 'C',
+ ofChain(
+ ofHatchAdder(
+ GregtechMetaTileEntity_Adv_HeatExchanger::addColdFluidOutputToMachineList,
+ CASING_INDEX,
+ 2),
+ onElementPass(
+ GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded,
+ ofBlock(ModBlocks.blockSpecialMultiCasings, 14))))
+ .addElement(
+ 'H',
+ ofChain(
+ ofHatchAdder(
+ GregtechMetaTileEntity_Adv_HeatExchanger::addHotFluidInputToMachineList,
+ CASING_INDEX,
+ 3),
+ onElementPass(
+ GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded,
+ ofBlock(ModBlocks.blockSpecialMultiCasings, 14))))
+ .addElement(
+ 'h',
+ ofChain(
+ ofHatchAdder(
+ GregtechMetaTileEntity_Adv_HeatExchanger::addInputToMachineList,
+ CASING_INDEX,
+ 1),
+ ofHatchAdder(
+ GregtechMetaTileEntity_Adv_HeatExchanger::addOutputToMachineList,
+ CASING_INDEX,
+ 1),
+ ofHatchAdder(
+ GregtechMetaTileEntity_Adv_HeatExchanger::addMaintenanceToMachineList,
+ CASING_INDEX,
+ 1),
+ onElementPass(
+ GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded,
+ ofBlock(ModBlocks.blockSpecialMultiCasings, 14))))
+ .addElement(
+ 'c',
+ ofChain(onElementPass(
+ GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded,
+ ofBlock(ModBlocks.blockSpecialMultiCasings, 14))))
+ .build();
+ public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25)
private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch;
private GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch;
private boolean superheated = false;
- private int superheated_threshold=0;
+ private int superheated_threshold = 0;
private float water;
private int mCasingAmount;
public GregtechMetaTileEntity_Adv_HeatExchanger(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
+
public GregtechMetaTileEntity_Adv_HeatExchanger(String aName) {
super(aName);
}
@@ -143,7 +171,8 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_Multi
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeHeatExchanger.png");
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeHeatExchanger.png");
}
@Override
@@ -158,18 +187,17 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_Multi
@Override
public boolean checkRecipe(ItemStack aStack) {
- if (mInputHotFluidHatch.getFluid() == null)
- return true;
+ if (mInputHotFluidHatch.getFluid() == null) return true;
int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch
// The XL LHE works as fast as 32 regular LHEs. These are the comments from the original LHE,
// with changes where the values needed to change for the 32x speed multiplier
- superheated_threshold = 128000; // default: must have 4000L -> 128000L per second to generate superheated steam
- float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry
+ superheated_threshold = 128000; // default: must have 4000L -> 128000L per second to generate superheated steam
+ float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry
int shs_reduction_per_config = 4800; // reduce threshold 150L -> 4800L per second per circuitry level (1-25)
float steam_output_multiplier = 20f; // default: multiply output by 4 * 10 (boosted x5)
- float penalty = 0.0f; // penalty to apply to output based on circuitry level (1-25).
+ float penalty = 0.0f; // penalty to apply to output based on circuitry level (1-25).
boolean do_lava = false;
// Do we have an integrated circuit with a valid configuration?
@@ -190,15 +218,19 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_Multi
do_lava = true;
} else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) {
steam_output_multiplier /= 2f; // was boosted x2 on top of x5 -> total x10 -> nerf with this code back to 5x
- superheated_threshold /=5f; // 10x smaller since the Hot Things production in reactor is the same.
+ superheated_threshold /= 5f; // 10x smaller since the Hot Things production in reactor is the same.
} else {
// If we're working with neither, fail out
- superheated_threshold=0;
+ superheated_threshold = 0;
return false;
}
- superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method.
- fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second, maximum is 2x SH threshold.
+ superheated = fluidAmountToConsume
+ >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the
+ // onRunningTick method.
+ fluidAmountToConsume = Math.min(
+ fluidAmountToConsume,
+ superheated_threshold * 2); // Don't consume too much hot fluid per second, maximum is 2x SH threshold.
mInputHotFluidHatch.drain(fluidAmountToConsume, true);
this.mMaxProgresstime = 20;
this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency);
@@ -221,24 +253,27 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_Multi
@Override
public boolean onRunningTick(ItemStack aStack) {
if (this.mEUt > 0) {
- int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate.
+ int tGeneratedEU =
+ (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate.
if (tGeneratedEU > 0) {
if (superheated) tGeneratedEU /= 2; // We produce half as much superheated steam if necessary
int distilledConsumed = useWater(tGeneratedEU / 160f); // how much distilled water to consume
- //tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect 1:160 ratio with distilled water consumption
+ // tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect
+ // 1:160 ratio with distilled water consumption
FluidStack distilledStack = GT_ModHandler.getDistilledWater(distilledConsumed);
if (depleteInput(distilledStack)) // Consume the distilled water
{
if (superheated) {
- addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam
+ addOutput(FluidRegistry.getFluidStack(
+ "ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam
} else {
addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam
}
} else {
- GT_Log.exp.println(this.mName+" had no more Distilled water!");
+ GT_Log.exp.println(this.mName + " had no more Distilled water!");
explodeMultiblock(); // Generate crater
}
}
@@ -298,6 +333,7 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_Multi
public int getDamageToComponent(ItemStack aStack) {
return 0;
}
+
@Override
public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
@@ -315,20 +351,26 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_Multi
@Override
public String[] getExtraInfoData() {
- return new String[]{
- StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " +
- EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " +
- EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s",
- StatCollector.translateToLocal("GT5U.multiblock.usage") + " " + StatCollector.translateToLocal("GT5U.LHE.steam") + ": " +
- (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + GT_Utility.formatNumbers(superheated ? -2 * mEUt : -mEUt) + EnumChatFormatting.RESET + " EU/t",
- StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " +
- EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " +
- StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " +
- EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %",
- StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " +
- (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + superheated + EnumChatFormatting.RESET,
- StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " +
- EnumChatFormatting.GREEN + GT_Utility.formatNumbers(superheated_threshold) + EnumChatFormatting.RESET
+ return new String[] {
+ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s",
+ StatCollector.translateToLocal("GT5U.multiblock.usage") + " "
+ + StatCollector.translateToLocal("GT5U.LHE.steam") + ": "
+ + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW)
+ + GT_Utility.formatNumbers(superheated ? -2 * mEUt : -mEUt) + EnumChatFormatting.RESET + " EU/t",
+ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED
+ + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " "
+ + StatCollector.translateToLocal("GT5U.multiblock.efficiency")
+ + ": " + EnumChatFormatting.YELLOW
+ + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %",
+ StatCollector.translateToLocal("GT5U.LHE.superheated") + ": "
+ + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + superheated
+ + EnumChatFormatting.RESET,
+ StatCollector.translateToLocal("GT5U.LHE.superheated") + " "
+ + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(superheated_threshold) + EnumChatFormatting.RESET
};
}
@@ -336,33 +378,38 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_Multi
public void construct(ItemStack stackSize, boolean hintsOnly) {
buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 2, 5, 0);
}
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
- @Override
- public String getMachineType() {
- return "Heat Exchanger";
- }
- @Override
- public int getMaxParallelRecipes() {
- return 0;
- }
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- private static Block sFrame;
-
- public static Block getFrame() {
- if (sFrame == null) {
- sFrame = BlockBaseModular.getMaterialBlock(ALLOY.TALONITE, BlockTypes.FRAME);
- }
- return sFrame;
- }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Heat Exchanger";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 0;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ private static Block sFrame;
+
+ public static Block getFrame() {
+ if (sFrame == null) {
+ sFrame = BlockBaseModular.getMaterialBlock(ALLOY.TALONITE, BlockTypes.FRAME);
+ }
+ return sFrame;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java
index de85c3acdc..6ec4e8ddbe 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java
@@ -6,7 +6,6 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
-
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -18,186 +17,177 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.item.ItemStack;
-public class GregtechMetaTileEntity_Adv_Implosion extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_Implosion> {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_Adv_Implosion> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_Adv_Implosion(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_Adv_Implosion(String aName) {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_Adv_Implosion(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Implosion Compressor";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Factory Grade Advanced Implosion Compressor")
- .addInfo("Speed: +100% | EU Usage: 100% | Parallel: ((Tier/2)+1)")
- .addInfo("Constructed exactly the same as a normal Implosion Compressor")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front center")
- .addCasingInfo("Robust TungstenSteel Casing", 10)
- .addInputBus("Any casing", 1)
- .addOutputBus("Any casing", 1)
- .addEnergyHatch("Any casing", 1)
- .addMaintenanceHatch("Any casing", 1)
- .addMufflerHatch("Any casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_Adv_Implosion> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_Implosion>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- ofHatchAdder(
- GregtechMetaTileEntity_Adv_Implosion::addAdvImplosionList, 48, 1
- ),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- sBlockCasings4, 0
- )
- )
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- public final boolean addAdvImplosionList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return 48;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "ImplosionCompressor";
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sImplosionRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric((GT_Utility.getTier(this.getMaxInputVoltage())/2+1), 100, 100);
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 20) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- @Override
- public String getSound() {
- return (String) GregTech_API.sSoundList.get(Integer.valueOf(5));
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerSecond(ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiAdvImplosion;
- }
-
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (GT_Utility.getTier(this.getMaxInputVoltage())/2+1);
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
-} \ No newline at end of file
+public class GregtechMetaTileEntity_Adv_Implosion
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_Implosion> {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_Adv_Implosion> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_Adv_Implosion(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_Adv_Implosion(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_Adv_Implosion(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Implosion Compressor";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Factory Grade Advanced Implosion Compressor")
+ .addInfo("Speed: +100% | EU Usage: 100% | Parallel: ((Tier/2)+1)")
+ .addInfo("Constructed exactly the same as a normal Implosion Compressor")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front center")
+ .addCasingInfo("Robust TungstenSteel Casing", 10)
+ .addInputBus("Any casing", 1)
+ .addOutputBus("Any casing", 1)
+ .addEnergyHatch("Any casing", 1)
+ .addMaintenanceHatch("Any casing", 1)
+ .addMufflerHatch("Any casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_Adv_Implosion> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_Implosion>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ ofHatchAdder(GregtechMetaTileEntity_Adv_Implosion::addAdvImplosionList, 48, 1),
+ onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings4, 0))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ public final boolean addAdvImplosionList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return 48;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "ImplosionCompressor";
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sImplosionRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric((GT_Utility.getTier(this.getMaxInputVoltage()) / 2 + 1), 100, 100);
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 20) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public String getSound() {
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(5));
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiAdvImplosion;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (GT_Utility.getTier(this.getMaxInputVoltage()) / 2 + 1);
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java
index 3d23523b0a..4b24df6ee7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java
@@ -9,7 +9,6 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -25,139 +24,127 @@ import net.minecraft.item.ItemStack;
public class GregtechMetaTileEntity_SteamCompressor extends GregtechMeta_SteamMultiBase {
- private String mCasingName = "Bronze Plated Bricks";
- private IStructureDefinition<GregtechMetaTileEntity_SteamCompressor> STRUCTURE_DEFINITION = null;
- private int mCasing;
-
- public GregtechMetaTileEntity_SteamCompressor(String aName) {
- super(aName);
- }
-
- public GregtechMetaTileEntity_SteamCompressor(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) {
- return new GregtechMetaTileEntity_SteamCompressor(this.mName);
- }
-
- @Override
- protected GT_RenderedTexture getFrontOverlay() {
- return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR);
- }
-
- @Override
- protected GT_RenderedTexture getFrontOverlayActive() {
- return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE);
- }
-
- @Override
- public String getMachineType() {
- return "Compressor";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Steam Compressor")
- .addInfo("Compresses " + getMaxParallelRecipes() + " things at a time")
- .addSeparator()
- .beginStructureBlock(3, 3, 4, true)
- .addController("Front center")
- .addCasingInfo(mCasingName, 28)
- .addOtherStructurePart(TT_steaminputbus, "Any casing", 1)
- .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1)
- .addOtherStructurePart(TT_steamhatch, "Any casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_SteamCompressor> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamCompressor>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC", "CCC"},
- {"C~C", "C-C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- ofHatchAdder(
- GregtechMetaTileEntity_SteamCompressor::addSteamMultiList, 10, 1
- ),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- sBlockCasings1, 10
- )
- )
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- public final boolean addSteamMultiList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 31040){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- fixAllMaintenanceIssue();
- return checkPiece(mName, 1, 1, 0) && mCasing >= 28;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 8;
- }
-
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
- }
-
- @Override
- public ItemStack[] getOutputItems(GT_Recipe aRecipe) {
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[1];
- for (int h = 0; h < 1; h++) {
- if (aRecipe.getOutput(h) != null) {
- tOutputItems[h] = aRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
- return tOutputItems;
- }
-
- @Override
- public int getOutputCount(ItemStack[] aOutputs) {
- return 1;
- }
-
-
-
+ private String mCasingName = "Bronze Plated Bricks";
+ private IStructureDefinition<GregtechMetaTileEntity_SteamCompressor> STRUCTURE_DEFINITION = null;
+ private int mCasing;
+
+ public GregtechMetaTileEntity_SteamCompressor(String aName) {
+ super(aName);
+ }
+
+ public GregtechMetaTileEntity_SteamCompressor(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) {
+ return new GregtechMetaTileEntity_SteamCompressor(this.mName);
+ }
+
+ @Override
+ protected GT_RenderedTexture getFrontOverlay() {
+ return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR);
+ }
+
+ @Override
+ protected GT_RenderedTexture getFrontOverlayActive() {
+ return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Compressor";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Steam Compressor")
+ .addInfo("Compresses " + getMaxParallelRecipes() + " things at a time")
+ .addSeparator()
+ .beginStructureBlock(3, 3, 4, true)
+ .addController("Front center")
+ .addCasingInfo(mCasingName, 28)
+ .addOtherStructurePart(TT_steaminputbus, "Any casing", 1)
+ .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1)
+ .addOtherStructurePart(TT_steamhatch, "Any casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_SteamCompressor> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamCompressor>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ ofHatchAdder(GregtechMetaTileEntity_SteamCompressor::addSteamMultiList, 10, 1),
+ onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings1, 10))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ public final boolean addSteamMultiList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase
+ && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 31040) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ fixAllMaintenanceIssue();
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 28;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 8;
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
+ }
+
+ @Override
+ public ItemStack[] getOutputItems(GT_Recipe aRecipe) {
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[1];
+ for (int h = 0; h < 1; h++) {
+ if (aRecipe.getOutput(h) != null) {
+ tOutputItems[h] = aRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+ return tOutputItems;
+ }
+
+ @Override
+ public int getOutputCount(ItemStack[] aOutputs) {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java
index 85a58c5ded..5d57d68f41 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java
@@ -24,142 +24,130 @@ import net.minecraft.item.ItemStack;
public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMultiBase {
- private String mCasingName = "Bronze Plated Bricks";
- private IStructureDefinition<GregtechMetaTileEntity_SteamMacerator> STRUCTURE_DEFINITION = null;
- private int mCasing;
-
- public GregtechMetaTileEntity_SteamMacerator(String aName) {
- super(aName);
- }
-
- public GregtechMetaTileEntity_SteamMacerator(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) {
- return new GregtechMetaTileEntity_SteamMacerator(this.mName);
- }
-
- @Override
- protected GT_RenderedTexture getFrontOverlay() {
- return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR);
- }
-
- @Override
- protected GT_RenderedTexture getFrontOverlayActive() {
- return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE);
- }
-
- @Override
- public String getMachineType() {
- return "Macerator";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- if (mCasingName.contains("gt.blockcasings")) {
- mCasingName = ItemList.Casing_BronzePlatedBricks.get(1).getDisplayName();
- }
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Steam Macerator")
- .addInfo("Macerates " + getMaxParallelRecipes() + " ores at a time")
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front center")
- .addCasingInfo(mCasingName, 14)
- .addOtherStructurePart(TT_steaminputbus, "Any casing", 1)
- .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1)
- .addOtherStructurePart(TT_steamhatch, "Any casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_SteamMacerator> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamMacerator>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- ofHatchAdder(
- GregtechMetaTileEntity_SteamMacerator::addSteamMaceratorList, 10, 1
- ),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- sBlockCasings1, 10
- )
- )
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- public final boolean addSteamMaceratorList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 31040){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- fixAllMaintenanceIssue();
- return checkPiece(mName, 1, 1, 0) && mCasing >= 14;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 8;
- }
-
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
- }
-
- @Override
- public ItemStack[] getOutputItems(GT_Recipe aRecipe) {
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[1];
- for (int h = 0; h < 1; h++) {
- if (aRecipe.getOutput(h) != null) {
- tOutputItems[h] = aRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
- return tOutputItems;
- }
-
- @Override
- public int getOutputCount(ItemStack[] aOutputs) {
- return 1;
- }
-
-
-
+ private String mCasingName = "Bronze Plated Bricks";
+ private IStructureDefinition<GregtechMetaTileEntity_SteamMacerator> STRUCTURE_DEFINITION = null;
+ private int mCasing;
+
+ public GregtechMetaTileEntity_SteamMacerator(String aName) {
+ super(aName);
+ }
+
+ public GregtechMetaTileEntity_SteamMacerator(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) {
+ return new GregtechMetaTileEntity_SteamMacerator(this.mName);
+ }
+
+ @Override
+ protected GT_RenderedTexture getFrontOverlay() {
+ return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR);
+ }
+
+ @Override
+ protected GT_RenderedTexture getFrontOverlayActive() {
+ return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Macerator";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ if (mCasingName.contains("gt.blockcasings")) {
+ mCasingName = ItemList.Casing_BronzePlatedBricks.get(1).getDisplayName();
+ }
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Steam Macerator")
+ .addInfo("Macerates " + getMaxParallelRecipes() + " ores at a time")
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front center")
+ .addCasingInfo(mCasingName, 14)
+ .addOtherStructurePart(TT_steaminputbus, "Any casing", 1)
+ .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1)
+ .addOtherStructurePart(TT_steamhatch, "Any casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_SteamMacerator> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamMacerator>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ ofHatchAdder(GregtechMetaTileEntity_SteamMacerator::addSteamMaceratorList, 10, 1),
+ onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings1, 10))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ public final boolean addSteamMaceratorList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase
+ && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 31040) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ fixAllMaintenanceIssue();
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 14;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 8;
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
+ }
+
+ @Override
+ public ItemStack[] getOutputItems(GT_Recipe aRecipe) {
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[1];
+ for (int h = 0; h < 1; h++) {
+ if (aRecipe.getOutput(h) != null) {
+ tOutputItems[h] = aRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+ return tOutputItems;
+ }
+
+ @Override
+ public int getOutputCount(ItemStack[] aOutputs) {
+ return 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java
index 19acd30668..b68880a63a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -26,6 +29,8 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.helpers.CraftingHelper;
import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Utils;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -33,610 +38,612 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity_AutoCrafter> implements ISurvivalConstructable {
-
- private MODE mMachineMode = MODE.ASSEMBLY;
- private byte mTier = 1;
- protected GT_Recipe mLastRecipeToBuffer;
- private int mCasing;
- private IStructureDefinition<GT4Entity_AutoCrafter> STRUCTURE_DEFINITION = null;
-
- /** The crafting matrix inventory (3x3). */
- public CraftingHelper mInventoryCrafter;
-
- public static enum MODE {
- CRAFTING("CIRCUIT", "ASSEMBLY"), ASSEMBLY("CRAFTING", "DISASSEMBLY"), DISASSEMBLY("ASSEMBLY", "CIRCUIT"), CIRCUIT("DISASSEMBLY", "CRAFTING");
-
- private final String lastMode;
- private final String nextMode;
-
- MODE(String previous, String next) {
- this.lastMode = previous;
- this.nextMode = next;
- }
-
- public MODE nextMode() {
- return MODE.valueOf(this.nextMode);
- }
-
- public MODE lastMode() {
- return MODE.valueOf(this.lastMode);
- }
-
- }
-
- public void onRightclick(EntityPlayer aPlayer) {
- }
-
- public GT4Entity_AutoCrafter(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT4Entity_AutoCrafter(String mName) {
- super(mName);
- }
-
- @Override
- public String getMachineType() {
- String sType = "Assembler, Disassembler, "+((CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) ? "Circuit Assembler" : "");
- return sType;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT4Entity_AutoCrafter(this.mName);
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public boolean onRunningTick(ItemStack aStack) {
- return super.onRunningTick(aStack);
- //return true;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiAutoCrafter;
- }
-
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Highly Advanced Autocrafter")
- .addInfo("Right Click with a Screwdriver to change mode")
- .addInfo("200% faster than using single block machines of the same voltage")
- .addInfo("Processes two items per voltage tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front Center")
- .addCasingInfo("Autocrafter Frame", 10)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.getIndexFromPage(0, 10);
- }
-
- @Override
- public IStructureDefinition<GT4Entity_AutoCrafter> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GT4Entity_AutoCrafter>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GT4Entity_AutoCrafter.class)
- .atLeast(InputBus, OutputBus, InputHatch, Maintenance, Energy, Muffler)
- .casingIndex(TAE.getIndexFromPage(0, 10))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- if (checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch()) {
- setTier();
- return true;
- } else return false;
- }
-
- private static GT_Recipe_Map fCircuitMap;
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- if (this.mMachineMode == MODE.ASSEMBLY) {
- return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
- }
- else if (this.mMachineMode == MODE.CIRCUIT && !CORE.GTNH) {
- if (fCircuitMap != null) {
- return fCircuitMap;
- }
- GT_Recipe_Map r;
- try {
- Field f = ReflectionUtils.getField(GT_Recipe.GT_Recipe_Map.class, "sCircuitAssemblerRecipes");
- if (f != null) {
- r = (GT_Recipe_Map) f.get(null);
- if (r != null) {
- fCircuitMap = r;
- return r;
- }
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- else if (this.mMachineMode == MODE.DISASSEMBLY || this.mMachineMode == MODE.CRAFTING) {
- return null;
- }
- return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
- }
-
- private boolean isModernGT = true;
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (isModernGT && !CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- isModernGT = false;
- }
- //5.09 support
- if (isModernGT && !CORE.GTNH) {
- mMachineMode = mMachineMode.nextMode();
- if (mMachineMode == MODE.CRAFTING) {
- PlayerUtils.messagePlayer(aPlayer, "Running the Auto-Crafter in mode: "+EnumChatFormatting.AQUA+"AutoCrafting");
- } else if (mMachineMode == MODE.ASSEMBLY) {
- PlayerUtils.messagePlayer(aPlayer, "Running the Auto-Crafter in mode: "+EnumChatFormatting.GREEN+"Assembly");
- } else if (mMachineMode == MODE.DISASSEMBLY) {
- PlayerUtils.messagePlayer(aPlayer, "Running the Auto-Crafter in mode: "+EnumChatFormatting.RED+"Disassembly");
- } else {
- PlayerUtils.messagePlayer(aPlayer, "Running the Auto-Crafter in mode: "+EnumChatFormatting.YELLOW+"Circuit Assembly");
- }
- }
- //5.08 support
- else {
- if (mMachineMode.nextMode() == MODE.CIRCUIT) {
- mMachineMode = MODE.ASSEMBLY;
- }
- else if (mMachineMode.nextMode() == MODE.CRAFTING) {
- mMachineMode = MODE.ASSEMBLY;
- }
- else {
- mMachineMode = mMachineMode.nextMode();
- }
-
- if (mMachineMode == MODE.CRAFTING) {
- PlayerUtils.messagePlayer(aPlayer, "You are now running the Auto-Crafter in mode: "+EnumChatFormatting.AQUA+"AutoCrafting");
- } else if (mMachineMode == MODE.ASSEMBLY) {
- PlayerUtils.messagePlayer(aPlayer, "You are now running the Auto-Crafter in mode: "+EnumChatFormatting.GREEN+"Assembly");
- } else {
- PlayerUtils.messagePlayer(aPlayer, "You are now running the Auto-Crafter in mode: "+EnumChatFormatting.RED+"Disassembly");
- }
- }
- }
-
-// @Override
-// public boolean checkRecipe(final ItemStack aStack) {
-//
-// final long tVoltage = this.getMaxInputVoltage();
-// final byte tTier = this.mTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-//
-// if (mMachineMode == MODE.DISASSEMBLY) {
-// return doDisassembly();
-// } else if (mMachineMode == MODE.CRAFTING) {
-// return doCrafting(aStack);
-// } else {
-// return super.checkRecipeGeneric(getMaxParallelRecipes(), 100, 200);
-// }
-// }
-
- private void setTier() {
- long tVoltage = getMaxInputVoltage();
- this.mTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- if (mMachineMode == MODE.DISASSEMBLY) {
- return doDisassembly();
- } else if (mMachineMode == MODE.CRAFTING) {
- return doCrafting(aStack);
- } else {
- ArrayList<FluidStack> tFluids = getStoredFluids();
- //Logger.MACHINE_INFO("1");
- for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
- ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
- //Logger.MACHINE_INFO("2");
- if (isValidMetaTileEntity(tBus)) {
- //Logger.MACHINE_INFO("3");
- for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
- tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
-
- Object[] tempArray = tFluids.toArray(new FluidStack[] {});
- FluidStack[] properArray;
- properArray = ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray : new FluidStack[] {});
-
- //Logger.MACHINE_INFO("4");
- if (checkRecipeGeneric(tBusItems.toArray(new ItemStack[]{}), properArray,
- getMaxParallelRecipes(), 100, 200, 10000)) return true;
- }
- return false;
- }
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 2 * (Math.max(1, GT_Utility.getTier(getMaxInputVoltage())));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- public boolean doDisassembly() {
-
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- for (int tInputList_sS = tInputList.size(), i = 0; i < tInputList_sS - 1; ++i) {
- for (int j = i + 1; j < tInputList_sS; ++j) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize < tInputList.get(j).stackSize) {
- tInputList.remove(i--);
- tInputList_sS = tInputList.size();
- break;
- }
- tInputList.remove(j--);
- tInputList_sS = tInputList.size();
- }
- }
- }
- final ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]);
-
- ItemStack inputItem = tInputs[0];
- if (tInputs[0].stackSize <= 0) {
- tInputs[0] = null;
- this.updateSlots();
- }
- int outputSlots = this.mOutputBusses.get(0).getSizeInventory();
-
- if (this.mOutputBusses.size() > 1) {
- outputSlots = 0;
- for (GT_MetaTileEntity_Hatch_OutputBus r : this.mOutputBusses) {
- outputSlots += r.getSizeInventory();
- }
- }
-
- this.mOutputItems = new ItemStack[outputSlots];
- if (inputItem != null && inputItem.stackSize > 0) {
- NBTTagCompound tNBT = inputItem.getTagCompound();
- if (tNBT != null) {
- tNBT = tNBT.getCompoundTag("GT.CraftingComponents");
- if (tNBT != null) {
- this.mEUt = 16 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
- this.mMaxProgresstime = (100 - (8 * this.mTier));
- for (int i = 0; i < this.mOutputItems.length; ++i) {
- if (this.getBaseMetaTileEntity().getRandomNumber(100) < 60 + 12 * this.mTier) {
- this.mOutputItems[i] = GT_Utility.loadItem(tNBT, "Ingredient." + i);
- if (this.mOutputItems[i] != null) {
- this.mMaxProgresstime *= (int) 1.5;
- }
- }
- }
-
- if (this.mTier > 5) {
- this.mMaxProgresstime >>= this.mTier - 5;
- }
- if (this.mEUt > 0)
- this.mEUt = (-this.mEUt);
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- inputItem.stackSize--;
- if (inputItem.stackSize <= 0) {
- tInputs[0] = null;
- }
- this.updateSlots();
- return true;
-
- }
- }
- }
- return false;
- }
-
- private boolean doesCrafterHave9SlotInput() {
- GT_MetaTileEntity_Hatch_InputBus craftingInput = null;
- if (!this.mInputBusses.isEmpty()) {
- for (GT_MetaTileEntity_Hatch_InputBus x : this.mInputBusses) {
- if (x.mInventory.length == 9) {
- craftingInput = x;
- }
- }
- }
- // Return if no input hatch set.
- if (craftingInput == null) {
- Logger.WARNING("Cannot do Auto-Crafting without a 9-slot Input Bus [MV].");
- return false;
-
- } else {
- return true;
- }
- }
-
- private boolean doCrafting(ItemStack aStack) {
- this.mMaxProgresstime = 0;
- return false; // do nothing
- /*
- try {
- // Set Crafting input hatch
- if (!doesCrafterHave9SlotInput()) {
- return false;
- }
-
- // Read stored data from encrypted data stick.
- ItemStack storedData_Output[] = NBTUtils.readItemsFromNBT(aStack, "Output");
- ItemStack storedData_Input[] = NBTUtils.readItemsFromNBT(aStack);
- if (storedData_Output != null && storedData_Input != null) {
- ItemStack loadedData[] = new ItemStack[9];
- if (storedData_Input.length >= 1) {
- int number = 0;
- for (ItemStack a : storedData_Input) {
- if (a.getItem() == ModItems.ZZZ_Empty) {
- // Utils.LOG_WARNING("Allocating free memory into crafting manager slot
- // "+number+".");
- loadedData[number] = null;
- } else {
- // Utils.LOG_WARNING("Downloading "+a.getDisplayName()+" into crafting manager
- // slot "+number+".");
- loadedData[number] = a;
- }
- number++;
- }
- }
-
- // Remove inputs here
- ArrayList<ItemStack> mInputArray = new ArrayList<ItemStack>();
- ItemStack allInputs[];
-
- for (GT_MetaTileEntity_Hatch_InputBus x : this.mInputBusses) {
- if (x.mInventory.length > 0) {
- for (ItemStack r : x.mInventory) {
- if (r != null) {
- mInputArray.add(r);
- }
- }
- }
- }
-
- if (mInputArray.isEmpty()) {
- return false;
- } else {
- List<ItemStack> list = mInputArray;
- allInputs = list.toArray(new ItemStack[list.size()]);
-
- if (allInputs != null && allInputs.length > 0) {
-
- this.mEUt = 8 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
- this.mMaxProgresstime = MathUtils.roundToClosestInt((50 - (5
- * MathUtils.randDouble(((this.mTier - 2) <= 0 ? 1 : (this.mTier - 2)), this.mTier))));
-
- Logger.WARNING("MPT: " + mMaxProgresstime + " | " + mEUt);
- this.getBaseMetaTileEntity().setActive(true);
-
- // Setup some vars
- int counter = 0;
-
- ItemStack toUse[] = new ItemStack[9];
-
- outerloop: for (ItemStack inputItem : loadedData) {
- if (inputItem == null) {
- toUse[counter] = null;
- continue outerloop;
- }
- for (ItemStack r : allInputs) {
- if (r != null) {
- // Utils.LOG_WARNING("Input Bus Inventory Iteration - Found:"
- // +r.getDisplayName()+" | "+allInputs.length);
- if (GT_Utility.areStacksEqual(r, inputItem)) {
- if (this.getBaseMetaTileEntity().isServerSide()) {
- toUse[counter] = inputItem;
- counter++;
- continue outerloop;
- }
-
- }
- }
- }
- counter++;
- }
-
- int mCorrectInputs = 0;
- for (ItemStack isValid : toUse) {
- if (isValid == null || this.depleteInput(isValid)) {
- mCorrectInputs++;
- } else {
- Logger.WARNING("Input in Slot " + mCorrectInputs + " was not valid.");
- }
- }
-
- if (this.mTier > 5) {
- this.mMaxProgresstime >>= this.mTier - 5;
- }
- if (this.mEUt > 0)
- this.mEUt = (-this.mEUt);
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- if (mCorrectInputs == 9) {
- ItemStack mOutputItem = storedData_Output[0];
- NBTUtils.writeItemsToGtCraftingComponents(mOutputItem, loadedData, true);
- this.addOutput(mOutputItem);
- this.updateSlots();
- return true;
- } else {
- return false;
- }
-
- }
- }
- }
- }
- // End Debug
- catch (Throwable t) {
- t.printStackTrace();
- this.mMaxProgresstime = 0;
- }
-
- this.mMaxProgresstime = 0;
- return false;
- */
- }
-
- @Override
- public String[] getExtraInfoData() {
- final String tRunning = (this.mMaxProgresstime > 0 ? "Auto-Crafter running" : "Auto-Crafter stopped");
- final String tMaintainance = (this.getIdealStatus() == this.getRepairStatus() ? "No Maintainance issues"
- : "Needs Maintainance");
- String tSpecialText = "" + (60 + 12 * this.mTier) + "% chance to recover disassembled parts.";
- String tMode;
- if (mMachineMode == MODE.DISASSEMBLY) {
- tMode = "§cDisassembly";
- tSpecialText = "" + (60 + 12 * this.mTier) + "% chance to recover disassembled parts.";
- } else if (mMachineMode == MODE.ASSEMBLY || mMachineMode == MODE.CIRCUIT) {
- tMode = mMachineMode == MODE.ASSEMBLY ? "§aAssembly" : "§eCircuit Assembly";
- if (mLastRecipeToBuffer != null && mLastRecipeToBuffer.mOutputs[0].getDisplayName() != null) {
- tSpecialText = "Currently processing: " + mLastRecipeToBuffer.mOutputs[0].getDisplayName();
- } else {
- tSpecialText = "Currently processing: Nothing";
- }
- } else {
- tMode = "§dAuto-Crafting";
- tSpecialText = "Does Auto-Crafter have 9-slot input bus? " + doesCrafterHave9SlotInput();
- }
-
- return new String[] { "Large Scale Auto-Asesembler v1.01c", tRunning, tMaintainance, "Mode: " + tMode,
- tSpecialText };
- }
-
- private String getMode() {
- return this.mMachineMode.name();
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- String mMode = getMode();
- aNBT.setString("mMode", mMode);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- String modeString = aNBT.getString("mMode");
- MODE newMode = MODE.valueOf(modeString);
- this.mMachineMode = newMode;
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void explodeMultiblock() {
- AC_Helper_Utils.removeCrafter(this);
- super.explodeMultiblock();
- }
-
- @Override
- public void onExplosion() {
- AC_Helper_Utils.removeCrafter(this);
- super.onExplosion();
- }
-
- @Override
- public void onRemoval() {
- AC_Helper_Utils.removeCrafter(this);
- super.onRemoval();
- }
-
- @Override
- public void doExplosion(long aExplosionPower) {
- AC_Helper_Utils.removeCrafter(this);
- super.doExplosion(aExplosionPower);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "Generic3By3";
- }
-
+public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity_AutoCrafter>
+ implements ISurvivalConstructable {
+
+ private MODE mMachineMode = MODE.ASSEMBLY;
+ private byte mTier = 1;
+ protected GT_Recipe mLastRecipeToBuffer;
+ private int mCasing;
+ private IStructureDefinition<GT4Entity_AutoCrafter> STRUCTURE_DEFINITION = null;
+
+ /** The crafting matrix inventory (3x3). */
+ public CraftingHelper mInventoryCrafter;
+
+ public static enum MODE {
+ CRAFTING("CIRCUIT", "ASSEMBLY"),
+ ASSEMBLY("CRAFTING", "DISASSEMBLY"),
+ DISASSEMBLY("ASSEMBLY", "CIRCUIT"),
+ CIRCUIT("DISASSEMBLY", "CRAFTING");
+
+ private final String lastMode;
+ private final String nextMode;
+
+ MODE(String previous, String next) {
+ this.lastMode = previous;
+ this.nextMode = next;
+ }
+
+ public MODE nextMode() {
+ return MODE.valueOf(this.nextMode);
+ }
+
+ public MODE lastMode() {
+ return MODE.valueOf(this.lastMode);
+ }
+ }
+
+ public void onRightclick(EntityPlayer aPlayer) {}
+
+ public GT4Entity_AutoCrafter(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT4Entity_AutoCrafter(String mName) {
+ super(mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ String sType = "Assembler, Disassembler, "
+ + ((CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) ? "Circuit Assembler" : "");
+ return sType;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT4Entity_AutoCrafter(this.mName);
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public boolean onRunningTick(ItemStack aStack) {
+ return super.onRunningTick(aStack);
+ // return true;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiAutoCrafter;
+ }
+
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Highly Advanced Autocrafter")
+ .addInfo("Right Click with a Screwdriver to change mode")
+ .addInfo("200% faster than using single block machines of the same voltage")
+ .addInfo("Processes two items per voltage tier")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front Center")
+ .addCasingInfo("Autocrafter Frame", 10)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.getIndexFromPage(0, 10);
+ }
+
+ @Override
+ public IStructureDefinition<GT4Entity_AutoCrafter> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GT4Entity_AutoCrafter>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GT4Entity_AutoCrafter.class)
+ .atLeast(InputBus, OutputBus, InputHatch, Maintenance, Energy, Muffler)
+ .casingIndex(TAE.getIndexFromPage(0, 10))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ if (checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch()) {
+ setTier();
+ return true;
+ } else return false;
+ }
+
+ private static GT_Recipe_Map fCircuitMap;
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ if (this.mMachineMode == MODE.ASSEMBLY) {
+ return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
+ } else if (this.mMachineMode == MODE.CIRCUIT && !CORE.GTNH) {
+ if (fCircuitMap != null) {
+ return fCircuitMap;
+ }
+ GT_Recipe_Map r;
+ try {
+ Field f = ReflectionUtils.getField(GT_Recipe.GT_Recipe_Map.class, "sCircuitAssemblerRecipes");
+ if (f != null) {
+ r = (GT_Recipe_Map) f.get(null);
+ if (r != null) {
+ fCircuitMap = r;
+ return r;
+ }
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ } else if (this.mMachineMode == MODE.DISASSEMBLY || this.mMachineMode == MODE.CRAFTING) {
+ return null;
+ }
+ return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
+ }
+
+ private boolean isModernGT = true;
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (isModernGT && !CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ isModernGT = false;
+ }
+ // 5.09 support
+ if (isModernGT && !CORE.GTNH) {
+ mMachineMode = mMachineMode.nextMode();
+ if (mMachineMode == MODE.CRAFTING) {
+ PlayerUtils.messagePlayer(
+ aPlayer, "Running the Auto-Crafter in mode: " + EnumChatFormatting.AQUA + "AutoCrafting");
+ } else if (mMachineMode == MODE.ASSEMBLY) {
+ PlayerUtils.messagePlayer(
+ aPlayer, "Running the Auto-Crafter in mode: " + EnumChatFormatting.GREEN + "Assembly");
+ } else if (mMachineMode == MODE.DISASSEMBLY) {
+ PlayerUtils.messagePlayer(
+ aPlayer, "Running the Auto-Crafter in mode: " + EnumChatFormatting.RED + "Disassembly");
+ } else {
+ PlayerUtils.messagePlayer(
+ aPlayer, "Running the Auto-Crafter in mode: " + EnumChatFormatting.YELLOW + "Circuit Assembly");
+ }
+ }
+ // 5.08 support
+ else {
+ if (mMachineMode.nextMode() == MODE.CIRCUIT) {
+ mMachineMode = MODE.ASSEMBLY;
+ } else if (mMachineMode.nextMode() == MODE.CRAFTING) {
+ mMachineMode = MODE.ASSEMBLY;
+ } else {
+ mMachineMode = mMachineMode.nextMode();
+ }
+
+ if (mMachineMode == MODE.CRAFTING) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "You are now running the Auto-Crafter in mode: " + EnumChatFormatting.AQUA + "AutoCrafting");
+ } else if (mMachineMode == MODE.ASSEMBLY) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "You are now running the Auto-Crafter in mode: " + EnumChatFormatting.GREEN + "Assembly");
+ } else {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "You are now running the Auto-Crafter in mode: " + EnumChatFormatting.RED + "Disassembly");
+ }
+ }
+ }
+
+ // @Override
+ // public boolean checkRecipe(final ItemStack aStack) {
+ //
+ // final long tVoltage = this.getMaxInputVoltage();
+ // final byte tTier = this.mTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ //
+ // if (mMachineMode == MODE.DISASSEMBLY) {
+ // return doDisassembly();
+ // } else if (mMachineMode == MODE.CRAFTING) {
+ // return doCrafting(aStack);
+ // } else {
+ // return super.checkRecipeGeneric(getMaxParallelRecipes(), 100, 200);
+ // }
+ // }
+
+ private void setTier() {
+ long tVoltage = getMaxInputVoltage();
+ this.mTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ if (mMachineMode == MODE.DISASSEMBLY) {
+ return doDisassembly();
+ } else if (mMachineMode == MODE.CRAFTING) {
+ return doCrafting(aStack);
+ } else {
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ // Logger.MACHINE_INFO("1");
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
+ // Logger.MACHINE_INFO("2");
+ if (isValidMetaTileEntity(tBus)) {
+ // Logger.MACHINE_INFO("3");
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+
+ Object[] tempArray = tFluids.toArray(new FluidStack[] {});
+ FluidStack[] properArray;
+ properArray =
+ ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray : new FluidStack[] {});
+
+ // Logger.MACHINE_INFO("4");
+ if (checkRecipeGeneric(
+ tBusItems.toArray(new ItemStack[] {}), properArray, getMaxParallelRecipes(), 100, 200, 10000))
+ return true;
+ }
+ return false;
+ }
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 2 * (Math.max(1, GT_Utility.getTier(getMaxInputVoltage())));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ public boolean doDisassembly() {
+
+ final ArrayList<ItemStack> tInputList = this.getStoredInputs();
+ for (int tInputList_sS = tInputList.size(), i = 0; i < tInputList_sS - 1; ++i) {
+ for (int j = i + 1; j < tInputList_sS; ++j) {
+ if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
+ if (tInputList.get(i).stackSize < tInputList.get(j).stackSize) {
+ tInputList.remove(i--);
+ tInputList_sS = tInputList.size();
+ break;
+ }
+ tInputList.remove(j--);
+ tInputList_sS = tInputList.size();
+ }
+ }
+ }
+ final ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]);
+
+ ItemStack inputItem = tInputs[0];
+ if (tInputs[0].stackSize <= 0) {
+ tInputs[0] = null;
+ this.updateSlots();
+ }
+ int outputSlots = this.mOutputBusses.get(0).getSizeInventory();
+
+ if (this.mOutputBusses.size() > 1) {
+ outputSlots = 0;
+ for (GT_MetaTileEntity_Hatch_OutputBus r : this.mOutputBusses) {
+ outputSlots += r.getSizeInventory();
+ }
+ }
+
+ this.mOutputItems = new ItemStack[outputSlots];
+ if (inputItem != null && inputItem.stackSize > 0) {
+ NBTTagCompound tNBT = inputItem.getTagCompound();
+ if (tNBT != null) {
+ tNBT = tNBT.getCompoundTag("GT.CraftingComponents");
+ if (tNBT != null) {
+ this.mEUt = 16 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
+ this.mMaxProgresstime = (100 - (8 * this.mTier));
+ for (int i = 0; i < this.mOutputItems.length; ++i) {
+ if (this.getBaseMetaTileEntity().getRandomNumber(100) < 60 + 12 * this.mTier) {
+ this.mOutputItems[i] = GT_Utility.loadItem(tNBT, "Ingredient." + i);
+ if (this.mOutputItems[i] != null) {
+ this.mMaxProgresstime *= (int) 1.5;
+ }
+ }
+ }
+
+ if (this.mTier > 5) {
+ this.mMaxProgresstime >>= this.mTier - 5;
+ }
+ if (this.mEUt > 0) this.mEUt = (-this.mEUt);
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ inputItem.stackSize--;
+ if (inputItem.stackSize <= 0) {
+ tInputs[0] = null;
+ }
+ this.updateSlots();
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean doesCrafterHave9SlotInput() {
+ GT_MetaTileEntity_Hatch_InputBus craftingInput = null;
+ if (!this.mInputBusses.isEmpty()) {
+ for (GT_MetaTileEntity_Hatch_InputBus x : this.mInputBusses) {
+ if (x.mInventory.length == 9) {
+ craftingInput = x;
+ }
+ }
+ }
+ // Return if no input hatch set.
+ if (craftingInput == null) {
+ Logger.WARNING("Cannot do Auto-Crafting without a 9-slot Input Bus [MV].");
+ return false;
+
+ } else {
+ return true;
+ }
+ }
+
+ private boolean doCrafting(ItemStack aStack) {
+ this.mMaxProgresstime = 0;
+ return false; // do nothing
+ /*
+ try {
+ // Set Crafting input hatch
+ if (!doesCrafterHave9SlotInput()) {
+ return false;
+ }
+
+ // Read stored data from encrypted data stick.
+ ItemStack storedData_Output[] = NBTUtils.readItemsFromNBT(aStack, "Output");
+ ItemStack storedData_Input[] = NBTUtils.readItemsFromNBT(aStack);
+ if (storedData_Output != null && storedData_Input != null) {
+ ItemStack loadedData[] = new ItemStack[9];
+ if (storedData_Input.length >= 1) {
+ int number = 0;
+ for (ItemStack a : storedData_Input) {
+ if (a.getItem() == ModItems.ZZZ_Empty) {
+ // Utils.LOG_WARNING("Allocating free memory into crafting manager slot
+ // "+number+".");
+ loadedData[number] = null;
+ } else {
+ // Utils.LOG_WARNING("Downloading "+a.getDisplayName()+" into crafting manager
+ // slot "+number+".");
+ loadedData[number] = a;
+ }
+ number++;
+ }
+ }
+
+ // Remove inputs here
+ ArrayList<ItemStack> mInputArray = new ArrayList<ItemStack>();
+ ItemStack allInputs[];
+
+ for (GT_MetaTileEntity_Hatch_InputBus x : this.mInputBusses) {
+ if (x.mInventory.length > 0) {
+ for (ItemStack r : x.mInventory) {
+ if (r != null) {
+ mInputArray.add(r);
+ }
+ }
+ }
+ }
+
+ if (mInputArray.isEmpty()) {
+ return false;
+ } else {
+ List<ItemStack> list = mInputArray;
+ allInputs = list.toArray(new ItemStack[list.size()]);
+
+ if (allInputs != null && allInputs.length > 0) {
+
+ this.mEUt = 8 * (1 << this.mTier - 1) * (1 << this.mTier - 1);
+ this.mMaxProgresstime = MathUtils.roundToClosestInt((50 - (5
+ * MathUtils.randDouble(((this.mTier - 2) <= 0 ? 1 : (this.mTier - 2)), this.mTier))));
+
+ Logger.WARNING("MPT: " + mMaxProgresstime + " | " + mEUt);
+ this.getBaseMetaTileEntity().setActive(true);
+
+ // Setup some vars
+ int counter = 0;
+
+ ItemStack toUse[] = new ItemStack[9];
+
+ outerloop: for (ItemStack inputItem : loadedData) {
+ if (inputItem == null) {
+ toUse[counter] = null;
+ continue outerloop;
+ }
+ for (ItemStack r : allInputs) {
+ if (r != null) {
+ // Utils.LOG_WARNING("Input Bus Inventory Iteration - Found:"
+ // +r.getDisplayName()+" | "+allInputs.length);
+ if (GT_Utility.areStacksEqual(r, inputItem)) {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ toUse[counter] = inputItem;
+ counter++;
+ continue outerloop;
+ }
+
+ }
+ }
+ }
+ counter++;
+ }
+
+ int mCorrectInputs = 0;
+ for (ItemStack isValid : toUse) {
+ if (isValid == null || this.depleteInput(isValid)) {
+ mCorrectInputs++;
+ } else {
+ Logger.WARNING("Input in Slot " + mCorrectInputs + " was not valid.");
+ }
+ }
+
+ if (this.mTier > 5) {
+ this.mMaxProgresstime >>= this.mTier - 5;
+ }
+ if (this.mEUt > 0)
+ this.mEUt = (-this.mEUt);
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ if (mCorrectInputs == 9) {
+ ItemStack mOutputItem = storedData_Output[0];
+ NBTUtils.writeItemsToGtCraftingComponents(mOutputItem, loadedData, true);
+ this.addOutput(mOutputItem);
+ this.updateSlots();
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+ }
+ }
+ }
+ // End Debug
+ catch (Throwable t) {
+ t.printStackTrace();
+ this.mMaxProgresstime = 0;
+ }
+
+ this.mMaxProgresstime = 0;
+ return false;
+ */
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ final String tRunning = (this.mMaxProgresstime > 0 ? "Auto-Crafter running" : "Auto-Crafter stopped");
+ final String tMaintainance =
+ (this.getIdealStatus() == this.getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance");
+ String tSpecialText = "" + (60 + 12 * this.mTier) + "% chance to recover disassembled parts.";
+ String tMode;
+ if (mMachineMode == MODE.DISASSEMBLY) {
+ tMode = "§cDisassembly";
+ tSpecialText = "" + (60 + 12 * this.mTier) + "% chance to recover disassembled parts.";
+ } else if (mMachineMode == MODE.ASSEMBLY || mMachineMode == MODE.CIRCUIT) {
+ tMode = mMachineMode == MODE.ASSEMBLY ? "§aAssembly" : "§eCircuit Assembly";
+ if (mLastRecipeToBuffer != null && mLastRecipeToBuffer.mOutputs[0].getDisplayName() != null) {
+ tSpecialText = "Currently processing: " + mLastRecipeToBuffer.mOutputs[0].getDisplayName();
+ } else {
+ tSpecialText = "Currently processing: Nothing";
+ }
+ } else {
+ tMode = "§dAuto-Crafting";
+ tSpecialText = "Does Auto-Crafter have 9-slot input bus? " + doesCrafterHave9SlotInput();
+ }
+
+ return new String[] {
+ "Large Scale Auto-Asesembler v1.01c", tRunning, tMaintainance, "Mode: " + tMode, tSpecialText
+ };
+ }
+
+ private String getMode() {
+ return this.mMachineMode.name();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ String mMode = getMode();
+ aNBT.setString("mMode", mMode);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ String modeString = aNBT.getString("mMode");
+ MODE newMode = MODE.valueOf(modeString);
+ this.mMachineMode = newMode;
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void explodeMultiblock() {
+ AC_Helper_Utils.removeCrafter(this);
+ super.explodeMultiblock();
+ }
+
+ @Override
+ public void onExplosion() {
+ AC_Helper_Utils.removeCrafter(this);
+ super.onExplosion();
+ }
+
+ @Override
+ public void onRemoval() {
+ AC_Helper_Utils.removeCrafter(this);
+ super.onRemoval();
+ }
+
+ @Override
+ public void doExplosion(long aExplosionPower) {
+ AC_Helper_Utils.removeCrafter(this);
+ super.doExplosion(aExplosionPower);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "Generic3By3";
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
index 8f16ea8f83..10f0fc5a5b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
@@ -1,5 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -27,340 +33,341 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Entity_ThermalBoiler> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GT4Entity_ThermalBoiler> STRUCTURE_DEFINITION = null;
- private int mSuperEfficencyIncrease = 0;
-
- public void onRightclick(EntityPlayer aPlayer)
- {
- getBaseMetaTileEntity().openGUI(aPlayer, 158);
- }
-
- public GT4Entity_ThermalBoiler(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT4Entity_ThermalBoiler(String mName) {
- super(mName);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT4Entity_ThermalBoiler(this.mName);
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- @Override
- public String getMachineType() {
- return "Boiler";
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack){
- //log("Trying to damage component.");
- return ItemList.Component_LavaFilter.get(1L).getClass().isInstance(aStack) ? 1 : 0;
- }
-
- private static Item mLavaFilter;
- private static Fluid mLava = null;
- private static Fluid mPahoehoe = null;
- private static Fluid mSolarSaltHot = null;
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- this.mSuperEfficencyIncrease=0;
-
- if (mLavaFilter == null) {
- mLavaFilter = ItemList.Component_LavaFilter.getItem();
- }
- if (mLava == null) {
- mLava = FluidRegistry.LAVA;
- }
- if (mPahoehoe == null) {
- mPahoehoe = FluidUtils.getPahoehoeLava(1).getFluid();
- }
- if (mSolarSaltHot == null) {
- mSolarSaltHot = MISC_MATERIALS.SOLAR_SALT_HOT.getFluid();
- }
-
-
-
- //Try reload new Lava Filter
- if (aStack == null) {
- ItemStack uStack = this.findItemInInventory(mLavaFilter);
- if (uStack != null) {
- this.setGUIItemStack(uStack);
- aStack = this.getGUIItemStack();
- }
- }
-
-
- for (GT_Recipe tRecipe : GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.mRecipeList) {
- FluidStack tFluid = tRecipe.mFluidInputs[0];
- if (tFluid != null) {
-
- if (tFluid.getFluid() == mLava || tFluid.getFluid() == mPahoehoe) {
- if (depleteInput(tFluid)) {
- this.mMaxProgresstime = Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2));
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
-
- int loot_MAXCHANCE = 100000;
- if (mLavaFilter.getClass().isInstance(aStack.getItem())) {
- if ((tRecipe.getOutput(0) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(0))) {
- this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(0) }) };
- }
- if ((tRecipe.getOutput(1) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(1))) {
- this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(1) }) };
- }
- if ((tRecipe.getOutput(2) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(2))) {
- this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(2) }) };
- }
- if ((tRecipe.getOutput(3) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(3))) {
- this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(3) }) };
- }
- if ((tRecipe.getOutput(4) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(4))) {
- this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(4) }) };
- }
- if ((tRecipe.getOutput(5) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(5))) {
- this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(5) }) };
- }
- }
- //Give Obsidian without Lava Filter
- if (tFluid.getFluid() == mLava){
- if ((tRecipe.getOutput(6) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(6))) {
- this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(6) }) };
- }
- }
- return true;
- }
- }
- else if (tFluid.getFluid() == mSolarSaltHot) {
- if (depleteInput(tFluid)) {
- this.mMaxProgresstime = tRecipe.mDuration;
- this.mEfficiency = 10000;
- for (FluidStack aOutput : tRecipe.mFluidOutputs) {
- this.addOutput(FluidUtils.getFluidStack(aOutput, aOutput.amount));
- }
- return true;
- }
- }
- }
- }
- this.mMaxProgresstime = 0;
- this.mEUt = 0;
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public boolean onRunningTick(ItemStack aStack) {
- if (this.mEUt > 0) {
- if(this.mSuperEfficencyIncrease>0){
- this.mEfficiency = Math.min(10000, this.mEfficiency + this.mSuperEfficencyIncrease);
- }
- int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L);
- if (tGeneratedEU > 0) {
- long amount = (tGeneratedEU + 160) / 160;
- if (depleteInput(Materials.Water.getFluid(amount)) || depleteInput(GT_ModHandler.getDistilledWater(amount))) {
- addOutput(GT_ModHandler.getSteam(tGeneratedEU));
- } else {
- explodeMultiblock();
- }
- }
- return true;
- }
- return true;
- }
-
- public int getEUt() {
- return 400;
- }
-
- public int getEfficiencyIncrease() {
- return 12;
- }
-
- int runtimeBoost(int mTime) {
- return mTime * 150 / 100;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(ItemStack aStack)
- {
- return CORE.ConfigSwitches.pollutionPerSecondMultiThermalBoiler;
- }
-
- public int getAmountOfOutputs()
- {
- return 7;
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Thermal Boiler Controller")
- .addInfo("Converts Water & Heat into Steam")
- .addInfo("Consult user manual for more information")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front Center")
- .addCasingInfo("Thermal Containment Casings", 10)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(1);
- }
-
- @Override
- public IStructureDefinition<GT4Entity_ThermalBoiler> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GT4Entity_ThermalBoiler>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GT4Entity_ThermalBoiler.class)
- .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler)
- .casingIndex(TAE.getIndexFromPage(0, 1))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 11)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
- }
-
- public void damageFilter(){
- ItemStack filter = this.mInventory[1];
- if (filter != null){
- if (filter.getItem() instanceof ItemLavaFilter){
-
- long currentUse = ItemLavaFilter.getFilterDamage(filter);
-
- //Remove broken Filter
- if (currentUse >= 100-1){
- this.mInventory[1] = null;
- }
- else {
- //Do Damage
- ItemLavaFilter.setFilterDamage(filter, currentUse+1);
- }
- }
- }
-
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()){
- // Reload Lava Filter
- if (this.getGUIItemStack() == null) {
- if (this.mInputBusses.size() > 0) {
- for (GT_MetaTileEntity_Hatch_InputBus aBus : this.mInputBusses) {
- for (ItemStack aStack : aBus.mInventory) {
- if (aStack != null && aStack.getItem() instanceof ItemLavaFilter) {
- this.setGUIItemStack(aStack);
- }
- }
- }
- }
- }
-
- if (this.mEUt > 0){
- if (aTick % 600L == 0L){
- damageFilter();
- }
- }
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "Generic3By3";
- }
-
+public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Entity_ThermalBoiler>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GT4Entity_ThermalBoiler> STRUCTURE_DEFINITION = null;
+ private int mSuperEfficencyIncrease = 0;
+
+ public void onRightclick(EntityPlayer aPlayer) {
+ getBaseMetaTileEntity().openGUI(aPlayer, 158);
+ }
+
+ public GT4Entity_ThermalBoiler(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT4Entity_ThermalBoiler(String mName) {
+ super(mName);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT4Entity_ThermalBoiler(this.mName);
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Boiler";
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ // log("Trying to damage component.");
+ return ItemList.Component_LavaFilter.get(1L).getClass().isInstance(aStack) ? 1 : 0;
+ }
+
+ private static Item mLavaFilter;
+ private static Fluid mLava = null;
+ private static Fluid mPahoehoe = null;
+ private static Fluid mSolarSaltHot = null;
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ this.mSuperEfficencyIncrease = 0;
+
+ if (mLavaFilter == null) {
+ mLavaFilter = ItemList.Component_LavaFilter.getItem();
+ }
+ if (mLava == null) {
+ mLava = FluidRegistry.LAVA;
+ }
+ if (mPahoehoe == null) {
+ mPahoehoe = FluidUtils.getPahoehoeLava(1).getFluid();
+ }
+ if (mSolarSaltHot == null) {
+ mSolarSaltHot = MISC_MATERIALS.SOLAR_SALT_HOT.getFluid();
+ }
+
+ // Try reload new Lava Filter
+ if (aStack == null) {
+ ItemStack uStack = this.findItemInInventory(mLavaFilter);
+ if (uStack != null) {
+ this.setGUIItemStack(uStack);
+ aStack = this.getGUIItemStack();
+ }
+ }
+
+ for (GT_Recipe tRecipe : GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.mRecipeList) {
+ FluidStack tFluid = tRecipe.mFluidInputs[0];
+ if (tFluid != null) {
+
+ if (tFluid.getFluid() == mLava || tFluid.getFluid() == mPahoehoe) {
+ if (depleteInput(tFluid)) {
+ this.mMaxProgresstime = Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2));
+ this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
+
+ int loot_MAXCHANCE = 100000;
+ if (mLavaFilter.getClass().isInstance(aStack.getItem())) {
+ if ((tRecipe.getOutput(0) != null)
+ && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE)
+ < tRecipe.getOutputChance(0))) {
+ this.mOutputItems =
+ new ItemStack[] {GT_Utility.copy(new Object[] {tRecipe.getOutput(0)})};
+ }
+ if ((tRecipe.getOutput(1) != null)
+ && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE)
+ < tRecipe.getOutputChance(1))) {
+ this.mOutputItems =
+ new ItemStack[] {GT_Utility.copy(new Object[] {tRecipe.getOutput(1)})};
+ }
+ if ((tRecipe.getOutput(2) != null)
+ && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE)
+ < tRecipe.getOutputChance(2))) {
+ this.mOutputItems =
+ new ItemStack[] {GT_Utility.copy(new Object[] {tRecipe.getOutput(2)})};
+ }
+ if ((tRecipe.getOutput(3) != null)
+ && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE)
+ < tRecipe.getOutputChance(3))) {
+ this.mOutputItems =
+ new ItemStack[] {GT_Utility.copy(new Object[] {tRecipe.getOutput(3)})};
+ }
+ if ((tRecipe.getOutput(4) != null)
+ && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE)
+ < tRecipe.getOutputChance(4))) {
+ this.mOutputItems =
+ new ItemStack[] {GT_Utility.copy(new Object[] {tRecipe.getOutput(4)})};
+ }
+ if ((tRecipe.getOutput(5) != null)
+ && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE)
+ < tRecipe.getOutputChance(5))) {
+ this.mOutputItems =
+ new ItemStack[] {GT_Utility.copy(new Object[] {tRecipe.getOutput(5)})};
+ }
+ }
+ // Give Obsidian without Lava Filter
+ if (tFluid.getFluid() == mLava) {
+ if ((tRecipe.getOutput(6) != null)
+ && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE)
+ < tRecipe.getOutputChance(6))) {
+ this.mOutputItems =
+ new ItemStack[] {GT_Utility.copy(new Object[] {tRecipe.getOutput(6)})};
+ }
+ }
+ return true;
+ }
+ } else if (tFluid.getFluid() == mSolarSaltHot) {
+ if (depleteInput(tFluid)) {
+ this.mMaxProgresstime = tRecipe.mDuration;
+ this.mEfficiency = 10000;
+ for (FluidStack aOutput : tRecipe.mFluidOutputs) {
+ this.addOutput(FluidUtils.getFluidStack(aOutput, aOutput.amount));
+ }
+ return true;
+ }
+ }
+ }
+ }
+ this.mMaxProgresstime = 0;
+ this.mEUt = 0;
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public boolean onRunningTick(ItemStack aStack) {
+ if (this.mEUt > 0) {
+ if (this.mSuperEfficencyIncrease > 0) {
+ this.mEfficiency = Math.min(10000, this.mEfficiency + this.mSuperEfficencyIncrease);
+ }
+ int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L);
+ if (tGeneratedEU > 0) {
+ long amount = (tGeneratedEU + 160) / 160;
+ if (depleteInput(Materials.Water.getFluid(amount))
+ || depleteInput(GT_ModHandler.getDistilledWater(amount))) {
+ addOutput(GT_ModHandler.getSteam(tGeneratedEU));
+ } else {
+ explodeMultiblock();
+ }
+ }
+ return true;
+ }
+ return true;
+ }
+
+ public int getEUt() {
+ return 400;
+ }
+
+ public int getEfficiencyIncrease() {
+ return 12;
+ }
+
+ int runtimeBoost(int mTime) {
+ return mTime * 150 / 100;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiThermalBoiler;
+ }
+
+ public int getAmountOfOutputs() {
+ return 7;
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Thermal Boiler Controller")
+ .addInfo("Converts Water & Heat into Steam")
+ .addInfo("Consult user manual for more information")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front Center")
+ .addCasingInfo("Thermal Containment Casings", 10)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(1);
+ }
+
+ @Override
+ public IStructureDefinition<GT4Entity_ThermalBoiler> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GT4Entity_ThermalBoiler>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GT4Entity_ThermalBoiler.class)
+ .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler)
+ .casingIndex(TAE.getIndexFromPage(0, 1))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 11))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch();
+ }
+
+ public void damageFilter() {
+ ItemStack filter = this.mInventory[1];
+ if (filter != null) {
+ if (filter.getItem() instanceof ItemLavaFilter) {
+
+ long currentUse = ItemLavaFilter.getFilterDamage(filter);
+
+ // Remove broken Filter
+ if (currentUse >= 100 - 1) {
+ this.mInventory[1] = null;
+ } else {
+ // Do Damage
+ ItemLavaFilter.setFilterDamage(filter, currentUse + 1);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ // Reload Lava Filter
+ if (this.getGUIItemStack() == null) {
+ if (this.mInputBusses.size() > 0) {
+ for (GT_MetaTileEntity_Hatch_InputBus aBus : this.mInputBusses) {
+ for (ItemStack aStack : aBus.mInventory) {
+ if (aStack != null && aStack.getItem() instanceof ItemLavaFilter) {
+ this.setGUIItemStack(aStack);
+ }
+ }
+ }
+ }
+ }
+
+ if (this.mEUt > 0) {
+ if (aTick % 600L == 0L) {
+ damageFilter();
+ }
+ }
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "Generic3By3";
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java
index e7dbd49621..2a7fa00352 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java
@@ -1,9 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
@@ -28,648 +31,739 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ElementalDataOrbHolder;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase<GregtechMTE_ElementalDuplicator> {
- private final ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder> mReplicatorDataOrbHatches = new ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder>();
- private static final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 3);
- private int mCasing = 0;
-
- public GregtechMTE_ElementalDuplicator(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMTE_ElementalDuplicator(final String aName) {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMTE_ElementalDuplicator(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Replicator";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
-
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Produces Elemental Material from UU Matter")
- .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 8 * Tier")
- .addInfo("Maximum 1x of each bus/hatch.")
- .addInfo("Does not require both Output Hatch & Bus")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(9, 6, 9, true)
- .addController("Top Center")
- .addCasingInfo("Elemental Confinement Shell", 138)
- .addCasingInfo("Matter Fabricator Casing", 24)
- .addCasingInfo("Particle Containment Casing", 24)
- .addCasingInfo("Matter Generation Coil", 24)
- .addCasingInfo("High Voltage Current Capacitor", 20)
- .addCasingInfo("Resonance Chamber III", 24)
- .addCasingInfo("Modulator III", 16)
- .addOtherStructurePart("Data Orb Repository", "1x", 1)
- .addInputHatch("Any 1 dot hint", 1)
- .addOutputBus("Any 1 dot hint", 1)
- .addOutputHatch("Any 1 dot hint", 1)
- .addEnergyHatch("Any 1 dot hint", 1)
- .addMaintenanceHatch("Any 1 dot hint", 1)
- .addMufflerHatch("Any 1 dot hint", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
-
- private static final String STRUCTURE_PIECE_MAIN = "main";
- private IStructureDefinition<GregtechMTE_ElementalDuplicator> STRUCTURE_DEFINITION = null;
-
- @Override
- public IStructureDefinition<GregtechMTE_ElementalDuplicator> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ElementalDuplicator>builder()
-
- // h = Hatch
- // c = Casing
-
- // a = MF Casing 1
- // b = Matter Gen Coil
-
- // d = Current Capacitor
- // e = Particle
-
- // f = Resonance III
- // g = Modulator III
-
- .addShape(STRUCTURE_PIECE_MAIN, (new String[][]{
- {" ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccch~hccc", "ccchhhccc", " ccccccc ", " ccccc ", " ccc "},
- {" cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", " abfgfba ", " abfba ", " cac "},
- {" cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", " e e ", " e e ", " cec "},
- {" cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", " e e ", " e e ", " cec "},
- {" cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", " abfgfba ", " abfba ", " cac "},
- {" ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccchhhccc", "ccchhhccc", " ccccccc ", " ccccc ", " ccc "},
- }))
-
-
- .addElement('a', ofBlock(getCasingBlock4(), getCasingMeta6()))
- .addElement('b', ofBlock(getCasingBlock4(), getCasingMeta7()))
-
- .addElement('d', ofBlock(getCasingBlock2(), getCasingMeta2()))
- .addElement('e', ofBlock(getCasingBlock2(), getCasingMeta3()))
-
- .addElement('f', ofBlock(getCasingBlock3(), getCasingMeta4()))
- .addElement('g', ofBlock(getCasingBlock3(), getCasingMeta5()))
- .addElement('c', lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
- .addElement('h', lazy(t -> ofChain(
- buildHatchAdder(GregtechMTE_ElementalDuplicator.class)
- .atLeast(InputHatch, OutputBus, OutputHatch, Maintenance, Muffler, Energy)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .build()
- ,
- buildHatchAdder(GregtechMTE_ElementalDuplicator.class)
- .hatchClass(GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.class)
- .adder(GregtechMTE_ElementalDuplicator::addDataOrbHatch)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .build()
- ,
- onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))
- )))
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(STRUCTURE_PIECE_MAIN , stackSize, hintsOnly, 4, 4, 0);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 4, 4, 0);
- if (this.mInputHatches.size() != 1 || (this.mOutputBusses.size() != 1 && this.mOutputHatches.size() !=0) || this.mEnergyHatches.size() != 1 || this.mReplicatorDataOrbHatches.size() != 1) {
- return false;
- }
- log("Casings: "+mCasing);
- return aDidBuild && mCasing >= 138 && checkHatch();
- }
-
- protected static int getCasingTextureIndex() {
- return CASING_TEXTURE_ID;
- }
-
- protected static Block getCasingBlock() {
- return ModBlocks.blockCasings5Misc;
- }
-
- protected static Block getCasingBlock2() {
- return ModBlocks.blockSpecialMultiCasings;
- }
-
- protected static Block getCasingBlock3() {
- return ModBlocks.blockSpecialMultiCasings2;
- }
-
- protected static Block getCasingBlock4() {
- return ModBlocks.blockCasingsMisc;
- }
-
- protected static int getCasingMeta() {
- return 3;
- }
-
- protected static int getCasingMeta2() {
- return 12;
- }
-
- protected static int getCasingMeta3() {
- return 13;
- }
-
- protected static int getCasingMeta4() {
- return 2;
- }
-
- protected static int getCasingMeta5() {
- return 6;
- }
-
- protected static int getCasingMeta6() {
- return 9;
- }
-
- protected static int getCasingMeta7() {
- return 8;
- }
-
- private boolean addDataOrbHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) {
- try {
- ((GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) aMetaTileEntity).mRecipeMap = getRecipeMap();
- return addToMachineListInternal(mReplicatorDataOrbHatches, aMetaTileEntity, aBaseCasingIndex);
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
- }
- return false;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return CASING_TEXTURE_ID;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe_Map.sElementalDuplicatorRecipes;
- }
-
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric(getMaxParallelRecipes(), 100, 100);
- }
-
-
- @Override
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- GT_Recipe tRecipe = null;
-
- try {
- log("Checking "+aItemInputs.length+" Data Orbs");
-
- for (int i=0;i<aItemInputs.length;i++) {
- ItemStack aItem = aItemInputs[i];
- log("Found: "+aItem.getDisplayName());
- }
- ItemStack aDataOrbStack = null;
- recipe : for (GT_Recipe nRecipe : this.getRecipeMap().mRecipeList) {
- //log("Checking Recipe for: "+(nRecipe.mOutputs.length > 0 && nRecipe.mOutputs[0] != null ? nRecipe.mOutputs[0].getDisplayName() : nRecipe.mFluidOutputs[0].getLocalizedName()));
- ItemStack aTempStack = getSpecialSlotStack(nRecipe);
- if (aTempStack != null) {
- for (ItemStack aItem : aItemInputs) {
- if (nRecipe.mSpecialItems != null) {
- if (GT_Utility.areStacksEqual(aTempStack, aItem, false)) {
- Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(aTempStack)).mLinkedMaterials.get(0);
- log("Found: "+aTempStack.getDisplayName()+" for "+tMaterial.name());
- aDataOrbStack = aTempStack;
- break recipe;
- }
- }
- }
- }
- }
- if (aDataOrbStack != null) {
- tRecipe = findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aDataOrbStack, aItemInputs);
- if (tRecipe != null) {
- Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(aDataOrbStack)).mLinkedMaterials.get(0);
- log("Found recipe for "+tMaterial.name());
- }
- else {
- log("No Recipe Found");
- }
- }
- else {
- log("Null DO");
- }
-
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
-
-
-
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 4;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
- }
-
-
- @Override
- public int getMaxParallelRecipes() {
- return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiMolecularTransformer;
- }
-
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- // Fix GT bug
- if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
- this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
- }
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
- this.mReplicatorDataOrbHatches.clear();
- }
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public ArrayList<ItemStack> getStoredInputs() {
- ArrayList<ItemStack> tItems = super.getStoredInputs();
- for (GT_MetaTileEntity_Hatch_ElementalDataOrbHolder tHatch : mReplicatorDataOrbHatches) {
- tHatch.mRecipeMap = getRecipeMap();
- if (isValidMetaTileEntity(tHatch)) {
- tItems.addAll(tHatch.getInventory());
- }
- }
- tItems.removeAll(Collections.singleton(null));
- return tItems;
- }
-
- /**
- * 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 aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input
- * @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, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
-
- GT_Recipe_Map mRecipeMap = this.getRecipeMap();
- // No Recipes? Well, nothing to be found then.
- if (mRecipeMap.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 (mRecipeMap.mMinimalInputFluids > 0) {
- if (aFluids == null) return null;
- int tAmount = 0;
- for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++;
- if (tAmount < mRecipeMap.mMinimalInputFluids) return null;
- }
- if (mRecipeMap.mMinimalInputItems > 0) {
- if (aInputs == null) return null;
- int tAmount = 0;
- for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
- if (tAmount < mRecipeMap.mMinimalInputItems) return null;
- }
- }
-
- // Unification happens here in case the Input isn't already unificated.
- if (aNotUnificated) {
- aInputs = GT_OreDictUnificator.getStackArray(true, (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) {
- ItemStack aRecipeSpecial = getSpecialSlotStack(aRecipe);
- if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) {
- return aRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= aRecipe.mEUt ? aRecipe : null;
- }
- }
-
- // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
- if (mRecipeMap.mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
- if (tStack != null) {
- Collection<GT_Recipe> tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack));
- if (tRecipes != null) {
- for (GT_Recipe tRecipe : tRecipes) {
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe);
- if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) {
- return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt ? tRecipe : null;
- }
- }
- tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack, true));
- }
- }
- if (tRecipes != null) {
- for (GT_Recipe tRecipe : tRecipes) {
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe);
- if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) {
- return tRecipe.mEnabled && aVoltage * mRecipeMap.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 (mRecipeMap.mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
- if (aFluid != null) {
- Collection<GT_Recipe>
- tRecipes = mRecipeMap.mRecipeFluidMap.get(aFluid.getFluid());
- if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) {
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe);
- if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) {
- return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt ? tRecipe : null;
- }
- }
- }
- }
-
- // And nothing has been found.
- return null;
- }
-
- public static ItemStack getSpecialSlotStack(GT_Recipe aRecipe) {
- ItemStack aStack = null;
- if (aRecipe.mSpecialItems != null) {
- if (aRecipe.mSpecialItems instanceof ItemStack[]) {
- ItemStack[] aTempStackArray = (ItemStack[]) aRecipe.mSpecialItems;
- aStack = aTempStackArray[0];
- }
- }
- return aStack;
- }
-
- private static boolean areDataOrbsEqual(ItemStack aOrb1, ItemStack aOrb2) {
- if (aOrb1 != null && aOrb2 != null) {
- Materials tMaterial1 = Element.get(Behaviour_DataOrb.getDataName(aOrb1)).mLinkedMaterials.get(0);
- Materials tMaterial2 = Element.get(Behaviour_DataOrb.getDataName(aOrb2)).mLinkedMaterials.get(0);
- if (tMaterial1.equals(tMaterial2)) {
- return true;
- }
- }
-
- return false;
- }
-
+ private final ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder> mReplicatorDataOrbHatches =
+ new ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder>();
+ private static final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 3);
+ private int mCasing = 0;
+
+ public GregtechMTE_ElementalDuplicator(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMTE_ElementalDuplicator(final String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMTE_ElementalDuplicator(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Replicator";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Produces Elemental Material from UU Matter")
+ .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 8 * Tier")
+ .addInfo("Maximum 1x of each bus/hatch.")
+ .addInfo("Does not require both Output Hatch & Bus")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(9, 6, 9, true)
+ .addController("Top Center")
+ .addCasingInfo("Elemental Confinement Shell", 138)
+ .addCasingInfo("Matter Fabricator Casing", 24)
+ .addCasingInfo("Particle Containment Casing", 24)
+ .addCasingInfo("Matter Generation Coil", 24)
+ .addCasingInfo("High Voltage Current Capacitor", 20)
+ .addCasingInfo("Resonance Chamber III", 24)
+ .addCasingInfo("Modulator III", 16)
+ .addOtherStructurePart("Data Orb Repository", "1x", 1)
+ .addInputHatch("Any 1 dot hint", 1)
+ .addOutputBus("Any 1 dot hint", 1)
+ .addOutputHatch("Any 1 dot hint", 1)
+ .addEnergyHatch("Any 1 dot hint", 1)
+ .addMaintenanceHatch("Any 1 dot hint", 1)
+ .addMufflerHatch("Any 1 dot hint", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ private static final String STRUCTURE_PIECE_MAIN = "main";
+ private IStructureDefinition<GregtechMTE_ElementalDuplicator> STRUCTURE_DEFINITION = null;
+
+ @Override
+ public IStructureDefinition<GregtechMTE_ElementalDuplicator> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ElementalDuplicator>builder()
+
+ // h = Hatch
+ // c = Casing
+
+ // a = MF Casing 1
+ // b = Matter Gen Coil
+
+ // d = Current Capacitor
+ // e = Particle
+
+ // f = Resonance III
+ // g = Modulator III
+
+ .addShape(STRUCTURE_PIECE_MAIN, (new String[][] {
+ {
+ " ccc ",
+ " ccccc ",
+ " ccccccc ",
+ "ccchhhccc",
+ "ccch~hccc",
+ "ccchhhccc",
+ " ccccccc ",
+ " ccccc ",
+ " ccc "
+ },
+ {
+ " cac ",
+ " abfba ",
+ " abfgfba ",
+ "cbfgdgfbc",
+ "afgdddgfa",
+ "cbfgdgfbc",
+ " abfgfba ",
+ " abfba ",
+ " cac "
+ },
+ {
+ " cec ",
+ " e e ",
+ " e e ",
+ "c d c",
+ "e ddd e",
+ "c d c",
+ " e e ",
+ " e e ",
+ " cec "
+ },
+ {
+ " cec ",
+ " e e ",
+ " e e ",
+ "c d c",
+ "e ddd e",
+ "c d c",
+ " e e ",
+ " e e ",
+ " cec "
+ },
+ {
+ " cac ",
+ " abfba ",
+ " abfgfba ",
+ "cbfgdgfbc",
+ "afgdddgfa",
+ "cbfgdgfbc",
+ " abfgfba ",
+ " abfba ",
+ " cac "
+ },
+ {
+ " ccc ",
+ " ccccc ",
+ " ccccccc ",
+ "ccchhhccc",
+ "ccchhhccc",
+ "ccchhhccc",
+ " ccccccc ",
+ " ccccc ",
+ " ccc "
+ },
+ }))
+ .addElement('a', ofBlock(getCasingBlock4(), getCasingMeta6()))
+ .addElement('b', ofBlock(getCasingBlock4(), getCasingMeta7()))
+ .addElement('d', ofBlock(getCasingBlock2(), getCasingMeta2()))
+ .addElement('e', ofBlock(getCasingBlock2(), getCasingMeta3()))
+ .addElement('f', ofBlock(getCasingBlock3(), getCasingMeta4()))
+ .addElement('g', ofBlock(getCasingBlock3(), getCasingMeta5()))
+ .addElement(
+ 'c', lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ .addElement(
+ 'h',
+ lazy(t -> ofChain(
+ buildHatchAdder(GregtechMTE_ElementalDuplicator.class)
+ .atLeast(InputHatch, OutputBus, OutputHatch, Maintenance, Muffler, Energy)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .build(),
+ buildHatchAdder(GregtechMTE_ElementalDuplicator.class)
+ .hatchClass(GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.class)
+ .adder(GregtechMTE_ElementalDuplicator::addDataOrbHatch)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .build(),
+ onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 4, 4, 0);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 4, 4, 0);
+ if (this.mInputHatches.size() != 1
+ || (this.mOutputBusses.size() != 1 && this.mOutputHatches.size() != 0)
+ || this.mEnergyHatches.size() != 1
+ || this.mReplicatorDataOrbHatches.size() != 1) {
+ return false;
+ }
+ log("Casings: " + mCasing);
+ return aDidBuild && mCasing >= 138 && checkHatch();
+ }
+
+ protected static int getCasingTextureIndex() {
+ return CASING_TEXTURE_ID;
+ }
+
+ protected static Block getCasingBlock() {
+ return ModBlocks.blockCasings5Misc;
+ }
+
+ protected static Block getCasingBlock2() {
+ return ModBlocks.blockSpecialMultiCasings;
+ }
+
+ protected static Block getCasingBlock3() {
+ return ModBlocks.blockSpecialMultiCasings2;
+ }
+
+ protected static Block getCasingBlock4() {
+ return ModBlocks.blockCasingsMisc;
+ }
+
+ protected static int getCasingMeta() {
+ return 3;
+ }
+
+ protected static int getCasingMeta2() {
+ return 12;
+ }
+
+ protected static int getCasingMeta3() {
+ return 13;
+ }
+
+ protected static int getCasingMeta4() {
+ return 2;
+ }
+
+ protected static int getCasingMeta5() {
+ return 6;
+ }
+
+ protected static int getCasingMeta6() {
+ return 9;
+ }
+
+ protected static int getCasingMeta7() {
+ return 8;
+ }
+
+ private boolean addDataOrbHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) {
+ try {
+ ((GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) aMetaTileEntity).mRecipeMap = getRecipeMap();
+ return addToMachineListInternal(mReplicatorDataOrbHatches, aMetaTileEntity, aBaseCasingIndex);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return CASING_TEXTURE_ID;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe_Map.sElementalDuplicatorRecipes;
+ }
+
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), 100, 100);
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = null;
+
+ try {
+ log("Checking " + aItemInputs.length + " Data Orbs");
+
+ for (int i = 0; i < aItemInputs.length; i++) {
+ ItemStack aItem = aItemInputs[i];
+ log("Found: " + aItem.getDisplayName());
+ }
+ ItemStack aDataOrbStack = null;
+ recipe:
+ for (GT_Recipe nRecipe : this.getRecipeMap().mRecipeList) {
+ // log("Checking Recipe for: "+(nRecipe.mOutputs.length > 0 && nRecipe.mOutputs[0] != null ?
+ // nRecipe.mOutputs[0].getDisplayName() : nRecipe.mFluidOutputs[0].getLocalizedName()));
+ ItemStack aTempStack = getSpecialSlotStack(nRecipe);
+ if (aTempStack != null) {
+ for (ItemStack aItem : aItemInputs) {
+ if (nRecipe.mSpecialItems != null) {
+ if (GT_Utility.areStacksEqual(aTempStack, aItem, false)) {
+ Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(aTempStack))
+ .mLinkedMaterials
+ .get(0);
+ log("Found: " + aTempStack.getDisplayName() + " for " + tMaterial.name());
+ aDataOrbStack = aTempStack;
+ break recipe;
+ }
+ }
+ }
+ }
+ }
+ if (aDataOrbStack != null) {
+ tRecipe = findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aDataOrbStack,
+ aItemInputs);
+ if (tRecipe != null) {
+ Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(aDataOrbStack))
+ .mLinkedMaterials
+ .get(0);
+ log("Found recipe for " + tMaterial.name());
+ } else {
+ log("No Recipe Found");
+ }
+ } else {
+ log("Null DO");
+ }
+
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ log("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 4;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ log("GOOD RETURN - 1");
+ return true;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiMolecularTransformer;
+ }
+
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ // Fix GT bug
+ if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
+ this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
+ this.mReplicatorDataOrbHatches.clear();
+ }
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public ArrayList<ItemStack> getStoredInputs() {
+ ArrayList<ItemStack> tItems = super.getStoredInputs();
+ for (GT_MetaTileEntity_Hatch_ElementalDataOrbHolder tHatch : mReplicatorDataOrbHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ tItems.addAll(tHatch.getInventory());
+ }
+ }
+ tItems.removeAll(Collections.singleton(null));
+ return tItems;
+ }
+
+ /**
+ * 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 aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input
+ * @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,
+ boolean aDontCheckStackSizes,
+ long aVoltage,
+ FluidStack[] aFluids,
+ ItemStack aSpecialSlot,
+ ItemStack... aInputs) {
+
+ GT_Recipe_Map mRecipeMap = this.getRecipeMap();
+ // No Recipes? Well, nothing to be found then.
+ if (mRecipeMap.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 (mRecipeMap.mMinimalInputFluids > 0) {
+ if (aFluids == null) return null;
+ int tAmount = 0;
+ for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++;
+ if (tAmount < mRecipeMap.mMinimalInputFluids) return null;
+ }
+ if (mRecipeMap.mMinimalInputItems > 0) {
+ if (aInputs == null) return null;
+ int tAmount = 0;
+ for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
+ if (tAmount < mRecipeMap.mMinimalInputItems) return null;
+ }
+ }
+
+ // Unification happens here in case the Input isn't already unificated.
+ if (aNotUnificated) {
+ aInputs = GT_OreDictUnificator.getStackArray(true, (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) {
+ ItemStack aRecipeSpecial = getSpecialSlotStack(aRecipe);
+ if (!aRecipe.mFakeRecipe
+ && aRecipe.mCanBeBuffered
+ && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)
+ && GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false)
+ && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) {
+ return aRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= aRecipe.mEUt ? aRecipe : null;
+ }
+ }
+
+ // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
+ if (mRecipeMap.mUsualInputCount > 0 && aInputs != null)
+ for (ItemStack tStack : aInputs)
+ if (tStack != null) {
+ Collection<GT_Recipe> tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) {
+ for (GT_Recipe tRecipe : tRecipes) {
+ if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe);
+ if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false)
+ && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) {
+ return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt
+ ? tRecipe
+ : null;
+ }
+ }
+ tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack, true));
+ }
+ }
+ if (tRecipes != null) {
+ for (GT_Recipe tRecipe : tRecipes) {
+ if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe);
+ if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false)
+ && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) {
+ return tRecipe.mEnabled && aVoltage * mRecipeMap.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 (mRecipeMap.mMinimalInputItems == 0 && aFluids != null)
+ for (FluidStack aFluid : aFluids)
+ if (aFluid != null) {
+ Collection<GT_Recipe> tRecipes = mRecipeMap.mRecipeFluidMap.get(aFluid.getFluid());
+ if (tRecipes != null)
+ for (GT_Recipe tRecipe : tRecipes) {
+ if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe);
+ if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false)
+ && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) {
+ return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt
+ ? tRecipe
+ : null;
+ }
+ }
+ }
+ }
+
+ // And nothing has been found.
+ return null;
+ }
+
+ public static ItemStack getSpecialSlotStack(GT_Recipe aRecipe) {
+ ItemStack aStack = null;
+ if (aRecipe.mSpecialItems != null) {
+ if (aRecipe.mSpecialItems instanceof ItemStack[]) {
+ ItemStack[] aTempStackArray = (ItemStack[]) aRecipe.mSpecialItems;
+ aStack = aTempStackArray[0];
+ }
+ }
+ return aStack;
+ }
+
+ private static boolean areDataOrbsEqual(ItemStack aOrb1, ItemStack aOrb2) {
+ if (aOrb1 != null && aOrb2 != null) {
+ Materials tMaterial1 = Element.get(Behaviour_DataOrb.getDataName(aOrb1))
+ .mLinkedMaterials
+ .get(0);
+ Materials tMaterial2 = Element.get(Behaviour_DataOrb.getDataName(aOrb2))
+ .mLinkedMaterials
+ .get(0);
+ if (tMaterial1.equals(tMaterial2)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java
index 3941d59edb..0d065f6e4b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java
@@ -1,19 +1,6 @@
/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import gregtech.api.enums.TAE;
-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_Hatch_Input;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
public class GregtechMTE_FastNeutronReactor
extends GregtechMeta_MultiBlockBase
@@ -39,7 +26,7 @@ extends GregtechMeta_MultiBlockBase
@Override
public String getCustomGUIResourceName() {
return null;
- }
+ }
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
@@ -70,7 +57,7 @@ extends GregtechMeta_MultiBlockBase
if (processing_Stage_2()) {
if (processing_Stage_3()) {
if (processing_Stage_4()) {
-
+
}
else {
//Stage 4
@@ -88,8 +75,8 @@ extends GregtechMeta_MultiBlockBase
//Stage 1
}
return false;
- }
-
+ }
+
@Override
public int getMaxParallelRecipes() {
return 1;
@@ -104,7 +91,7 @@ extends GregtechMeta_MultiBlockBase
for (GT_MetaTileEntity_Hatch_Input tRecipe : this.mInputHatches) {
if (tRecipe.getFluid() != null){
FluidStack tFluid = FluidUtils.getFluidStack(tRecipe.getFluid(), 200);
- if (tFluid != null) {
+ if (tFluid != null) {
if (tFluid == GT_ModHandler.getDistilledWater(1)) {
if (depleteInput(tFluid)) {
this.mMaxProgresstime = Math.max(1, runtimeBoost(8 * 2));
@@ -112,10 +99,10 @@ extends GregtechMeta_MultiBlockBase
this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
return true;
}
- }
-
+ }
+
}
- }
+ }
}
this.mMaxProgresstime = 0;
this.mEUt = 0;
@@ -150,11 +137,11 @@ extends GregtechMeta_MultiBlockBase
}
return true;
}
-
+
public int getEUt() {
return 0; //Default 400
}
-
+
public int getEfficiencyIncrease() {
return 0; //Default 12
}
@@ -213,7 +200,7 @@ extends GregtechMeta_MultiBlockBase
return true;
}
- public boolean damageFilter(){
+ public boolean damageFilter(){
return false;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java
index d378622b00..61468ce100 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java
@@ -1,8 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -23,6 +25,9 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.helpers.FlotationRecipeHandler;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -30,430 +35,419 @@ import net.minecraftforge.common.util.Constants;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase<GregtechMTE_FrothFlotationCell> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMTE_FrothFlotationCell> STRUCTURE_DEFINITION = null;
-
- public GregtechMTE_FrothFlotationCell(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMTE_FrothFlotationCell(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMTE_FrothFlotationCell(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Flotation Cell";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Process that milled ore!")
- .addInfo("You can only ever process one type of material per controller")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 9, 3, true)
- .addController("Front Center")
- .addCasingInfo("Inconel Reinforced Casing", 68)
- .addCasingInfo("Flotation Casing", 52)
- .addInputBus("Bottom Casing", 1)
- .addInputHatch("Bottom Casing", 1)
- .addOutputHatch("Bottom Casing", 1)
- .addEnergyHatch("Bottom Casing", 1)
- .addMaintenanceHatch("Bottom Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(207));
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.getIndexFromPage(2, 1);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public IStructureDefinition<GregtechMTE_FrothFlotationCell> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_FrothFlotationCell>builder()
- .addShape(mName, new String[][]{
- {" ", " ", " X ", " X~X ", " X ", " ", " "},
- {" ", " F ", " FFF ", " FF FF ", " FFF ", " F ", " "},
- {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
- {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
- {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
- {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
- {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
- {" CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC "},
- {" CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC "},
- })
- .addElement(
- 'C',
- buildHatchAdder(GregtechMTE_FrothFlotationCell.class)
- .atLeast(InputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler)
- .casingIndex(TAE.GTPP_INDEX(1))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1)))
- )
- .addElement(
- 'F',
- ofBlock(
- ModBlocks.blockSpecialMultiCasings, 9
- )
- )
- .addElement(
- 'X',
- ofBlock(
- ModBlocks.blockCasings3Misc, 1
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 3, 3, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 3, 3, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 3, 3, 0) && mCasing >= 68 - 4 && checkHatch();
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiFrothFlotationCell;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- // Fix GT bug
- if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
- log("Fixing Bad Facing. (GT Bug)");
- this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
- }
- }
-
- @Override
- public boolean checkRecipe(ItemStack arg0) {
- return super.checkRecipeGeneric();
- }
-
- @Override
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- GT_Recipe tRecipe = findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
-
- /*
- *
- * Material checks
- * Makes sure we can only ever use one type of material in this flotation cell.
- * We used to depend on Alk's hash, but it's unreliable and user-hostile
- * So we're using unlocalized name of material now.
- *
- */
- Material foundMaterial = FlotationRecipeHandler.getMaterialOfMilledProduct(FlotationRecipeHandler.findMilledStack(tRecipe));
- String foundMaterialName = null;
- if (foundMaterial != null) {
- foundMaterialName = foundMaterial.getUnlocalizedName();
- }
-
- if (foundMaterialName == null) {
- log("Did not find material from Milled Ore.");
- ItemStack milledStack = FlotationRecipeHandler.findMilledStack(tRecipe);
- if (milledStack != null) {
- log("Found stack: " + milledStack.getDisplayName());
- }
- return false;
- }
-
- // Set material locked for this controller
- if (lockedMaterialName == null) {
- lockedMaterialName = foundMaterialName;
- }
-
- // Check material match
- if (!Objects.equals(lockedMaterialName, foundMaterialName)) {
- log("Did not find the correct milled type.");
- log("Found: "+foundMaterialName);
- log("Expected: "+lockedMaterialName);
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 4;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
- }
-
- /*
- * Handle NBT
- */
-
- private String lockedMaterialName = null;
-
- @Override
- public void setItemNBT(NBTTagCompound aNBT) {
- if (lockedMaterialName != null) {
- aNBT.setString("lockedMaterialName", lockedMaterialName);
- }
- super.setItemNBT(aNBT);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- if (lockedMaterialName != null) {
- aNBT.setString("lockedMaterialName", lockedMaterialName);
- }
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- if (aNBT.hasKey("lockedMaterialName", Constants.NBT.TAG_STRING)) {
- lockedMaterialName = aNBT.getString("lockedMaterialName");
- }
- }
-
- @Override
- public String[] getExtraInfoData() {
- return new String[] {
- "Locked material: " + lockedMaterialName
- };
- }
+public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase<GregtechMTE_FrothFlotationCell>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMTE_FrothFlotationCell> STRUCTURE_DEFINITION = null;
+
+ public GregtechMTE_FrothFlotationCell(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMTE_FrothFlotationCell(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMTE_FrothFlotationCell(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Flotation Cell";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Process that milled ore!")
+ .addInfo("You can only ever process one type of material per controller")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 9, 3, true)
+ .addController("Front Center")
+ .addCasingInfo("Inconel Reinforced Casing", 68)
+ .addCasingInfo("Flotation Casing", 52)
+ .addInputBus("Bottom Casing", 1)
+ .addInputHatch("Bottom Casing", 1)
+ .addOutputHatch("Bottom Casing", 1)
+ .addEnergyHatch("Bottom Casing", 1)
+ .addMaintenanceHatch("Bottom Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(207));
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.getIndexFromPage(2, 1);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMTE_FrothFlotationCell> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_FrothFlotationCell>builder()
+ .addShape(mName, new String[][] {
+ {" ", " ", " X ", " X~X ", " X ", " ", " "},
+ {" ", " F ", " FFF ", " FF FF ", " FFF ", " F ", " "},
+ {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
+ {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
+ {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
+ {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
+ {" ", " F ", " F F ", " F F ", " F F ", " F ", " "},
+ {" CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC "},
+ {" CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC "},
+ })
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMTE_FrothFlotationCell.class)
+ .atLeast(InputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler)
+ .casingIndex(TAE.GTPP_INDEX(1))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1))))
+ .addElement('F', ofBlock(ModBlocks.blockSpecialMultiCasings, 9))
+ .addElement('X', ofBlock(ModBlocks.blockCasings3Misc, 1))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 3, 3, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 3, 3, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 3, 3, 0) && mCasing >= 68 - 4 && checkHatch();
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiFrothFlotationCell;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ // Fix GT bug
+ if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
+ log("Fixing Bad Facing. (GT Bug)");
+ this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
+ }
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack arg0) {
+ return super.checkRecipeGeneric();
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
+
+ /*
+ *
+ * Material checks
+ * Makes sure we can only ever use one type of material in this flotation cell.
+ * We used to depend on Alk's hash, but it's unreliable and user-hostile
+ * So we're using unlocalized name of material now.
+ *
+ */
+ Material foundMaterial =
+ FlotationRecipeHandler.getMaterialOfMilledProduct(FlotationRecipeHandler.findMilledStack(tRecipe));
+ String foundMaterialName = null;
+ if (foundMaterial != null) {
+ foundMaterialName = foundMaterial.getUnlocalizedName();
+ }
+
+ if (foundMaterialName == null) {
+ log("Did not find material from Milled Ore.");
+ ItemStack milledStack = FlotationRecipeHandler.findMilledStack(tRecipe);
+ if (milledStack != null) {
+ log("Found stack: " + milledStack.getDisplayName());
+ }
+ return false;
+ }
+
+ // Set material locked for this controller
+ if (lockedMaterialName == null) {
+ lockedMaterialName = foundMaterialName;
+ }
+
+ // Check material match
+ if (!Objects.equals(lockedMaterialName, foundMaterialName)) {
+ log("Did not find the correct milled type.");
+ log("Found: " + foundMaterialName);
+ log("Expected: " + lockedMaterialName);
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ log("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 4;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ log("GOOD RETURN - 1");
+ return true;
+ }
+
+ /*
+ * Handle NBT
+ */
+
+ private String lockedMaterialName = null;
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ if (lockedMaterialName != null) {
+ aNBT.setString("lockedMaterialName", lockedMaterialName);
+ }
+ super.setItemNBT(aNBT);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ if (lockedMaterialName != null) {
+ aNBT.setString("lockedMaterialName", lockedMaterialName);
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ if (aNBT.hasKey("lockedMaterialName", Constants.NBT.TAG_STRING)) {
+ lockedMaterialName = aNBT.getString("lockedMaterialName");
+ }
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ return new String[] {"Locked material: " + lockedMaterialName};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java
index 1ead7edad5..57529d1900 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java
@@ -1,37 +1,12 @@
/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.TAE;
-import gregtech.api.enums.Textures.BlockIcons;
-import gregtech.api.gui.GT_GUIContainer_MultiMachine;
-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_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.util.minecraft.LangUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
public ArrayList<GT_MetaTileEntity_Hatch_Naquadah> mNaqHatches = new ArrayList<GT_MetaTileEntity_Hatch_Naquadah>();
public static String[] mCasingName = new String[5];
- public static String mHatchName = "Naquadah Fuel Hatch";
+ public static String mHatchName = "Naquadah Fuel Hatch";
private final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 13);
private final int META_BaseCasing = 0; //4
@@ -47,7 +22,7 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1);
mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2);
mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15);
- mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13);
+ mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13);
mHatchName = LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969);
}
@@ -74,14 +49,14 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
}
if (mCasingName[4].toLowerCase().contains(".name")) {
mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13);
- }
+ }
if (mHatchName.toLowerCase().contains(".name")) {
mHatchName = LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969);
}
return new String[]{
"Naquadah reacts violently with potassium, ",
"resulting in massive explosions with radioactive potential.",
- "Size: 3x4x12, WxHxL",
+ "Size: 3x4x12, WxHxL",
"Bottom Layer: "+mCasingName[0]+"s, (30x min)",
"Middle Layer: "+mCasingName[2]+"s (10x), with",
" "+mCasingName[3]+"s on either side",
@@ -92,7 +67,7 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
"",
"1x " + mHatchName + " (Any bottom layer casing)",
"1x " + "Maintenance Hatch" + " (Any bottom layer side casing)",
- "1x " + "Energy Hatch" + " (Any top layer casing)",
+ "1x " + "Energy Hatch" + " (Any top layer casing)",
};
}
@@ -126,7 +101,7 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
public boolean checkRecipe(ItemStack aStack) {
return false;
- }
+ }
@Override
public int getMaxParallelRecipes() {
@@ -148,7 +123,7 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
@Override
public String getSound() {
- return (String) GregTech_API.sSoundList.get(Integer.valueOf(212));
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(212));
}
private Block getCasing(int casingID) {
@@ -187,7 +162,7 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
int aShieldingCount = 0;
int aPipeCount = 0;
int aIntegralCasingCount = 0;
- int aContainmentChamberCount = 0;
+ int aContainmentChamberCount = 0;
// Bottom Layer
aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, -7, xDir, zDir);
@@ -241,7 +216,7 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
if (aOwnerName != null && aOwnerName.length() > 0) {
aOwner = PlayerUtils.getPlayer(aOwnerName);
}
-
+
if (aShieldingCount != 128) {
log("Not enough "+mCasingName[4]+"s, require 128.");
if (aOwner != null) {
@@ -283,7 +258,7 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
PlayerUtils.messagePlayer(aOwner, "Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48.");
}
return false;
- }
+ }
log("LNR Formed.");
if (aOwner != null) {
PlayerUtils.messagePlayer(aOwner, "Large Naquadah Reactor has formed successfully.");
@@ -305,7 +280,7 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
return false;
}
}
- }
+ }
public int checkEntireLayer(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
int aCasingCount = 0;
@@ -313,48 +288,48 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
for (int z = -4; z < 5; z++) {
int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
//Skip the corners
if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) {
continue;
- }
+ }
// Skip controller
if (aY == 0 && x == 0 && z == 0) {
continue;
}
-
+
Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
log("Layer has error. Height: "+aY);
//this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
return 0;
}
- }
- }
+ }
+ }
return aCasingCount;
}
- public int checkOuterRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ public int checkOuterRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
int aCasingCount = 0;
for (int x = -4; x < 5; x++) {
for (int z = -4; z < 5; z++) {
int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
//Skip the corners
if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) {
continue;
- }
+ }
// If we are on the 5x5 ring, proceed
- if ((x > -4 && x < 4 ) && (z > -4 && z < 4)) {
+ if ((x > -4 && x < 4 ) && (z > -4 && z < 4)) {
if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) {
- //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
}
else {
continue;
@@ -365,14 +340,14 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
log("Layer has error. Height: "+aY);
//this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
return 0;
}
- }
+ }
}
return aCasingCount;
}
@@ -382,16 +357,16 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
for (int z = -3; z < 4; z++) {
int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
//Skip the corners
if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) {
continue;
- }
+ }
// If we are on the 5x5 ring, proceed
- if ((x > -3 && x < 3 ) && (z > -3 && z < 3)) {
+ if ((x > -3 && x < 3 ) && (z > -3 && z < 3)) {
if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) {
- //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
}
else {
continue;
@@ -402,51 +377,51 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
log("Layer has error. Height: "+aY);
//this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
return 0;
}
- }
+ }
}
return aCasingCount;
}
-
+
public int checkPipes(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
int aCasingCount = 0;
for (int x = -1; x < 2; x++) {
for (int z = -1; z < 2; z++) {
int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
//Skip the corners
if ((x == 1 && z == 1) || (x == -1 && z == -1) || (x == 1 && z == -1) || (x == -1 && z == 1) || (x == 0 && z == 0)) {
Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
log("Pipe has error. Height: "+aY);
//this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
return 0;
};
}
- }
+ }
}
return aCasingCount;
}
-
+
public int checkContainmentRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
int aCasingCount = 0;
for (int x = -2; x < 3; x++) {
for (int z = -2; z < 3; z++) {
int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
- int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
//Skip the corners
if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) {
continue;
@@ -456,14 +431,14 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
aCasingCount++;
- }
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
log("Layer has error. Height: "+aY);
//this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
return 0;
}
- }
+ }
}
return aCasingCount;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java
index 9c2e3289c3..8f0a2802d4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java
@@ -1,37 +1,12 @@
/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
-
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.TAE;
-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_Hatch_Input;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GTPP_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Plasma;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
public long currentVoltage = GT_Values.V[7];
public byte currentTier = 8;
-
+
public void upvolt() {
byte f = currentTier;
if ((f+1) > 10) {
@@ -40,10 +15,10 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
else {
f++;
}
- this.currentTier = f;
+ this.currentTier = f;
updateVoltage();
}
-
+
public void downvolt() {
byte f = currentTier;
if ((f-1) < 8) {
@@ -52,19 +27,19 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
else {
f--;
}
- this.currentTier = f;
+ this.currentTier = f;
updateVoltage();
}
-
+
private long updateVoltage() {
this.currentVoltage = GT_Values.V[this.currentTier-1];
return currentVoltage;
}
-
+
public GregtechMTE_MiniFusionPlant(String aName) {
super(aName);
}
-
+
public GregtechMTE_MiniFusionPlant(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -101,10 +76,10 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
}
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10))};
}
-
+
@Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes;
}
@@ -125,10 +100,10 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
@Override
public String[] getTooltip() {
- return new String[] {
- "Small scale fusion",
+ return new String[] {
+ "Small scale fusion",
"16x slower than using Multiblock of the same voltage",
- //"Input voltage can be changed within the GUI",
+ //"Input voltage can be changed within the GUI",
"Place Input/Output Hatches on sides and bottom",
"Power can only be inserted into the back",
//e"Power can only be extracted from the top",
@@ -155,7 +130,7 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
int tAmount = 0;
ForgeDirection aDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing());
-
+
//Require air in front, I think
if (!aBaseMetaTileEntity.getAirOffset(xDir2, 0, zDir2)) {
Logger.INFO("Did not find air in front");
@@ -168,9 +143,9 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
h, zDir + j);
if (this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(10))) {
- tAmount++;
+ tAmount++;
}
- }
+ }
}
}
}
@@ -181,7 +156,7 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkRecipe(ItemStack arg0) {
-
+
ArrayList tFluidList = this.getStoredFluids();
int tFluidList_sS = tFluidList.size();
@@ -232,10 +207,10 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
//Logger.INFO("Step "+aStep++);
return false;
-
-
-
-
+
+
+
+
//return this.checkRecipeGeneric(this.getMaxParallelRecipes(), getEuDiscountForParallelism(), 0);
}
@@ -268,15 +243,15 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
@Override
public String[] getExtraInfoData() {
- String mode = EnumChatFormatting.BLUE + "" + currentVoltage + EnumChatFormatting.RESET;
- String aOutput = EnumChatFormatting.BLUE + "" + mEUt + EnumChatFormatting.RESET;
+ String mode = EnumChatFormatting.BLUE + "" + currentVoltage + EnumChatFormatting.RESET;
+ String aOutput = EnumChatFormatting.BLUE + "" + mEUt + EnumChatFormatting.RESET;
String storedEnergyText;
if (this.getEUVar() > maxEUStore()) {
storedEnergyText = EnumChatFormatting.RED + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET;
} else {
storedEnergyText = EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET;
}
-
+
return new String[]{
"Stored EU: " + storedEnergyText,
"Capacity: " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.maxEUStore()) + EnumChatFormatting.RESET,
@@ -304,7 +279,7 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
public long getInputTier() {
return (long) GT_Utility.getTier(maxEUInput());
}
-
+
@Override
public boolean isElectric() {
return true;
@@ -374,11 +349,11 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
@Override
public int getPollutionPerTick(ItemStack arg0) {
return 0;
- }
+ }
@Override
public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() {
- GT_MetaTileEntity_Hatch_ControlCore x = new GT_MetaTileEntity_Hatch_ControlCore("", 0, "", null);
+ GT_MetaTileEntity_Hatch_ControlCore x = new GT_MetaTileEntity_Hatch_ControlCore("", 0, "", null);
return (GT_MetaTileEntity_Hatch_ControlCore) x;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java
index de86a097cf..fa8b27dec9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java
@@ -1,6 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.Collection;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.filterByMTETier;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -26,525 +32,531 @@ import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.material.nuclear.NUCLIDE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import java.util.Collection;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gregtech.api.util.GT_StructureUtility.filterByMTETier;
-
-public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<GregtechMTE_NuclearReactor> implements ISurvivalConstructable {
-
- protected int mFuelRemaining = 0;
-
- private int mCasing;
- private IStructureDefinition<GregtechMTE_NuclearReactor> STRUCTURE_DEFINITION = null;
-
-
- public GregtechMTE_NuclearReactor(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMTE_NuclearReactor(final String aName) {
- super(aName);
- }
-
- @Override
- public long maxEUStore() {
- return (640000000L * (Math.min(16, this.mEnergyHatches.size()))) / 16L;
- }
-
- @Override
- public String getMachineType() {
- return "Reactor";
- }
-
- @Override
- public GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes;
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Liquid Fluoride Thorium Reactor.")
- .addInfo("Produces Heat & Energy from Radioactive Beta Decay.")
- .addInfo("Outputs U233 every 10 seconds, on average")
- .addInfo("Input Fluorine and Helium for bonus byproducts")
- .addInfo("Input Li2BeF4 and a molten salt as fuel.")
- .addInfo("LiFBeF2ThF4UF4, LiFBeF2ZrF4UF4 or LiFBeF2ZrF4U235")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(7, 4, 7, true)
- .addController("Bottom Center")
- .addCasingInfo("Hastelloy-N Reactor Casing", 27)
- .addCasingInfo("Zeron-100 Reactor Shielding", 26)
- .addInputHatch("Top or bottom layer edges", 1)
- .addOutputHatch("Top or bottom layer edges", 1)
- .addDynamoHatch("Top or bottom layer edges", 1)
- .addMaintenanceHatch("Top or bottom layer edges", 1)
- .addMufflerHatch("Top 3x3", 2)
- .addStructureInfo("All dynamos must be IV or LuV tier.")
- .addStructureInfo("All other hatches must be IV+ tier.")
- .addStructureInfo("3x Output Hatches, 2x Input Hatches, 4x Dynamo Hatches")
- .addStructureInfo("2x Maintenance Hatches, 4x Mufflers")
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public String[] getExtraInfoData() {
- final String tRunning = (this.mMaxProgresstime>0 ? "Reactor running":"Reactor stopped");
- final String tMaintainance = (this.getIdealStatus() == this.getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance");
-
- return new String[]{
- "Liquid Fluoride Thorium Reactor",
- tRunning,
- tMaintainance,
- "Current Output: "+this.mEUt+" EU/t",
- "Fuel Remaining: "+this.mFuelRemaining+" Litres",
- "Current Efficiency: "+(this.mEfficiency/5)+"%",
- "Current Efficiency (Raw): "+(this.mEfficiency),
- "It requires you to have 100% Efficiency."};
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aStack) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- boolean aWarmedUp = this.mEfficiency == this.getMaxEfficiency(null);
- if (!aBaseMetaTileEntity.isActive() || !aWarmedUp){
- if (aSide == aFacing) {
- if (aActive)
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)),
- TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE).extFacing().build()};
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)),
- TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR).extFacing().build()};
- }
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))};
- }
- else if(aBaseMetaTileEntity.isActive() && aWarmedUp){
- if (aSide == aFacing) {
- if (aActive)
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)),
- TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE).extFacing().build()};
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)),
- TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR).extFacing().build()};
- }
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13))};
- }
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))};
-
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "MatterFabricator";
- }
-
- public final boolean addNuclearReactorEdgeList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo && (((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier >= 5 && ((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier <= 6)){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input && ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier >= 5) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output && ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier >= 5) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- public final boolean addNuclearReactorTopList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 5) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- @Override
- public IStructureDefinition<GregtechMTE_NuclearReactor> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_NuclearReactor>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCCCCCC", "COOOOOC", "COXXXOC", "COXXXOC", "COXXXOC", "COOOOOC", "CCCCCCC"},
- {"GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG"},
- {"GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG"},
- {"CCC~CCC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "CCCCCCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- buildHatchAdder(GregtechMTE_NuclearReactor.class)
- .atLeast(Maintenance)
- .casingIndex(TAE.GTPP_INDEX(12))
- .dot(1)
- .build(),
- buildHatchAdder(GregtechMTE_NuclearReactor.class)
- .atLeast(InputHatch, OutputHatch)
- .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList)
- .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE))
- .casingIndex(TAE.GTPP_INDEX(12))
- .dot(1)
- .build(),
- buildHatchAdder(GregtechMTE_NuclearReactor.class)
- .atLeast(Dynamo)
- .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList)
- .hatchItemFilterAnd(t -> filterByMTETier(5, 6))
- .casingIndex(TAE.GTPP_INDEX(12))
- .dot(1)
- .build(),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasingsMisc, 12
- )
- )
- )
- )
- .addElement(
- 'X',
- buildHatchAdder(GregtechMTE_NuclearReactor.class)
- .atLeast(Muffler)
- .adder(GregtechMTE_NuclearReactor::addNuclearReactorTopList)
- .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE))
- .casingIndex(TAE.GTPP_INDEX(12))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 12)))
- )
- .addElement(
- 'O',
- ofBlock(
- ModBlocks.blockCasingsMisc, 12
- )
- )
- .addElement(
- 'G',
- ofBlock(
- ModBlocks.blockCasingsMisc, 13
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 3, 3, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 3, 3, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- if (checkPiece(mName, 3, 3, 0) && mCasing >= 27) {
- if (mOutputHatches.size() >= 3 && mInputHatches.size() >= 2 && mDynamoHatches.size() == 4 &&
- mMufflerHatches.size() == 4 && mMaintenanceHatches.size() == 2) {
- this.mWrench = true;
- this.mScrewdriver = true;
- this.mSoftHammer = true;
- this.mHardHammer = true;
- this.mSolderingTool = true;
- this.mCrowbar = true;
- this.turnCasingActive(false);
- return true;
- }
- }
- return false;
- }
-
- // Alk's Life Lessons from Greg.
- /*
- [23:41:15] <GregoriusTechneticies> xdir and zdir are x2 and not x3
- [23:41:26] <GregoriusTechneticies> thats you issue
- [23:44:33] <Alkalus> mmm?
- [23:44:49] <Alkalus> Should they be x3?
- [23:44:50] <GregoriusTechneticies> you just do a x2, what is for a 5x5 multiblock
- [23:45:01] <GregoriusTechneticies> x3 is for a 7x7 one
- [23:45:06] <Alkalus> I have no idea what that value does, tbh..
- [23:45:15] <GregoriusTechneticies> its the offset
- [23:45:23] <Alkalus> Debugging checkMachine has been a pain and I usually trash designs that don't work straight up..
- [23:45:28] <GregoriusTechneticies> it determines the horizontal middle of the multiblock
- [23:45:47] <GregoriusTechneticies> which is in your case THREE blocks away from the controller
- [23:45:51] <Alkalus> Ahh
- [23:45:57] <GregoriusTechneticies> and not 2
- [23:46:06] <Alkalus> Noted, thanks :D
- */
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return true;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMTE_NuclearReactor(this.mName);
- }
-
- public boolean turnCasingActive(final boolean status) {
- //TODO
- if (this.mDynamoHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Dynamo hatch : this.mDynamoHatches) {
- hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
- }
- }
- if (this.mMufflerHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Muffler hatch : this.mMufflerHatches) {
- hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
- }
- }
- if (this.mOutputHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) {
- hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
- }
- }
- if (this.mInputHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) {
- hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
- }
- }
- if (this.mMaintenanceHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Maintenance hatch : this.mMaintenanceHatches) {
- hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
- }
- }
- return true;
- }
-
- public FluidStack[] getStoredFluidsAsArray() {
- return getStoredFluids().toArray(new FluidStack[0]);
- }
-
- public int getStoredFuel(GT_Recipe aRecipe) {
- int aFuelStored = 0;
- FluidStack aFuelFluid = null;
- for (FluidStack aFluidInput : aRecipe.mFluidInputs) {
- if (!aFluidInput.getFluid().equals(NUCLIDE.Li2BeF4.getFluid())) {
- aFuelFluid = aFluidInput;
- break;
- }
- }
- if (aFuelFluid != null) {
- for (GT_MetaTileEntity_Hatch_Input aInputHatch : this.mInputHatches) {
- if (aInputHatch.getFluid() != null && aInputHatch.getFluidAmount() > 0) {
- if (aInputHatch.getFluid().isFluidEqual(aFuelFluid)) {
- aFuelStored += aInputHatch.getFluidAmount();
- }
- }
- }
- }
- return aFuelStored;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- // Warm up for 4~ minutes
- Logger.WARNING("Checking LFTR recipes.");
- if (mEfficiency < this.getMaxEfficiency(null)) {
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
- this.mProgresstime = 0;
- this.mMaxProgresstime = 1;
- this.mEfficiencyIncrease = 2;
- Logger.WARNING("Warming Up! "+this.mEfficiency+"/"+this.getMaxEfficiency(null));
- return true;
- }
- Logger.WARNING("Warmed up, checking LFTR recipes.");
-
- final FluidStack[] tFluids = getStoredFluidsAsArray();
- final Collection<GT_Recipe> tRecipeList = getRecipeMap().mRecipeList;
- if(tFluids.length > 0 && tRecipeList != null && tRecipeList.size() > 0) { //Does input hatch have a LFTR fuel?
- Logger.WARNING("Found more than one input fluid and a list of valid recipes.");
- // Find a valid recipe
- GT_Recipe aFuelProcessing = this.findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, 0, tFluids, new ItemStack[] {});
- if (aFuelProcessing == null) {
- Logger.WARNING("Did not find valid recipe for given inputs.");
- return false;
- }
- else {
- Logger.WARNING("Found recipe? "+(aFuelProcessing != null ? "true" : "false"));
- for (FluidStack aFluidInput : aFuelProcessing.mFluidInputs) {
- Logger.WARNING("Using "+aFluidInput.getLocalizedName());
- }
- }
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
- this.mLastRecipe = aFuelProcessing;
- // Deplete Inputs
- if (aFuelProcessing.mFluidInputs.length > 0) {
- for (FluidStack aInputToConsume : aFuelProcessing.mFluidInputs) {
- Logger.WARNING("Depleting "+aInputToConsume.getLocalizedName()+" - "+aInputToConsume.amount+"L");
- this.depleteInput(aInputToConsume);
- }
- }
- // -- Try not to fail after this point - inputs have already been consumed! --
- this.mMaxProgresstime = (int)(aFuelProcessing.mDuration);
- this.mEUt = aFuelProcessing.mSpecialValue * 4;
- Logger.WARNING("Outputting "+this.mEUt+"eu/t");
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- Logger.WARNING("Recipe time: "+this.mMaxProgresstime);
- mFuelRemaining = getStoredFuel(aFuelProcessing); //Record available fuel
-
- this.mOutputFluids = aFuelProcessing.mFluidOutputs.clone();
- updateSlots();
- Logger.WARNING("Recipe Good!");
- return true;
- }
- this.mEUt = 0;
- this.mEfficiency = 0;
- Logger.WARNING("Recipe Bad!");
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public void explodeMultiblock() {
- this.mInventory[1] = null;
- long explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- for (final MetaTileEntity tTileEntity : this.mInputBusses) {
- explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
- }
- for (final MetaTileEntity tTileEntity : this.mOutputBusses) {
- explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
- }
- for (final MetaTileEntity tTileEntity : this.mInputHatches) {
- explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
- }
- for (final MetaTileEntity tTileEntity : this.mOutputHatches) {
- explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
- }
- for (final MetaTileEntity tTileEntity : this.mDynamoHatches) {
- explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
- }
- for (final MetaTileEntity tTileEntity : this.mMufflerHatches) {
- explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
- }
- for (final MetaTileEntity tTileEntity : this.mEnergyHatches) {
- explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
- }
- for (final MetaTileEntity tTileEntity : this.mMaintenanceHatches) {
- explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
- }
- explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
- this.getBaseMetaTileEntity().doExplosion(explodevalue);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.getWorld().isRemote) {
- if (aBaseMetaTileEntity.isActive()){
- // Set casings active if we're warmed up.
- if (this.mEfficiency == this.getMaxEfficiency(null)){
- this.turnCasingActive(true);
- }
- else {
- this.turnCasingActive(false);
- }
- }
- else {
- this.turnCasingActive(false);
- }
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public boolean onRunningTick(ItemStack aStack) {
- // See if we're warmed up.
- if (this.mEfficiency == this.getMaxEfficiency(null)){
- // Try output some Uranium-233
- if (MathUtils.randInt(1, 300) == 1){
- this.addOutput(ELEMENT.getInstance().URANIUM233.getFluidStack(MathUtils.randInt(1, 10)));
- }
-
- }
- return super.onRunningTick(aStack);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mFuelRemaining", this.mFuelRemaining);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- this.mFuelRemaining = aNBT.getInteger("mFuelRemaining");
- super.loadNBTData(aNBT);
- }
-
+public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<GregtechMTE_NuclearReactor>
+ implements ISurvivalConstructable {
+
+ protected int mFuelRemaining = 0;
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMTE_NuclearReactor> STRUCTURE_DEFINITION = null;
+
+ public GregtechMTE_NuclearReactor(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMTE_NuclearReactor(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public long maxEUStore() {
+ return (640000000L * (Math.min(16, this.mEnergyHatches.size()))) / 16L;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Reactor";
+ }
+
+ @Override
+ public GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes;
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Liquid Fluoride Thorium Reactor.")
+ .addInfo("Produces Heat & Energy from Radioactive Beta Decay.")
+ .addInfo("Outputs U233 every 10 seconds, on average")
+ .addInfo("Input Fluorine and Helium for bonus byproducts")
+ .addInfo("Input Li2BeF4 and a molten salt as fuel.")
+ .addInfo("LiFBeF2ThF4UF4, LiFBeF2ZrF4UF4 or LiFBeF2ZrF4U235")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(7, 4, 7, true)
+ .addController("Bottom Center")
+ .addCasingInfo("Hastelloy-N Reactor Casing", 27)
+ .addCasingInfo("Zeron-100 Reactor Shielding", 26)
+ .addInputHatch("Top or bottom layer edges", 1)
+ .addOutputHatch("Top or bottom layer edges", 1)
+ .addDynamoHatch("Top or bottom layer edges", 1)
+ .addMaintenanceHatch("Top or bottom layer edges", 1)
+ .addMufflerHatch("Top 3x3", 2)
+ .addStructureInfo("All dynamos must be IV or LuV tier.")
+ .addStructureInfo("All other hatches must be IV+ tier.")
+ .addStructureInfo("3x Output Hatches, 2x Input Hatches, 4x Dynamo Hatches")
+ .addStructureInfo("2x Maintenance Hatches, 4x Mufflers")
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ final String tRunning = (this.mMaxProgresstime > 0 ? "Reactor running" : "Reactor stopped");
+ final String tMaintainance =
+ (this.getIdealStatus() == this.getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance");
+
+ return new String[] {
+ "Liquid Fluoride Thorium Reactor",
+ tRunning,
+ tMaintainance,
+ "Current Output: " + this.mEUt + " EU/t",
+ "Fuel Remaining: " + this.mFuelRemaining + " Litres",
+ "Current Efficiency: " + (this.mEfficiency / 5) + "%",
+ "Current Efficiency (Raw): " + (this.mEfficiency),
+ "It requires you to have 100% Efficiency."
+ };
+ }
+
+ @Override
+ public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aStack) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ boolean aWarmedUp = this.mEfficiency == this.getMaxEfficiency(null);
+ if (!aBaseMetaTileEntity.isActive() || !aWarmedUp) {
+ if (aSide == aFacing) {
+ if (aActive)
+ return new ITexture[] {
+ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)),
+ TextureFactory.builder()
+ .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE)
+ .extFacing()
+ .build()
+ };
+ return new ITexture[] {
+ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)),
+ TextureFactory.builder()
+ .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR)
+ .extFacing()
+ .build()
+ };
+ }
+ return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))};
+ } else if (aBaseMetaTileEntity.isActive() && aWarmedUp) {
+ if (aSide == aFacing) {
+ if (aActive)
+ return new ITexture[] {
+ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)),
+ TextureFactory.builder()
+ .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE)
+ .extFacing()
+ .build()
+ };
+ return new ITexture[] {
+ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)),
+ TextureFactory.builder()
+ .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR)
+ .extFacing()
+ .build()
+ };
+ }
+ return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13))};
+ }
+ return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))};
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "MatterFabricator";
+ }
+
+ public final boolean addNuclearReactorEdgeList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo
+ && (((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier >= 5
+ && ((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier <= 6)) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input
+ && ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier >= 5) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output
+ && ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier >= 5) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ public final boolean addNuclearReactorTopList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler
+ && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 5) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMTE_NuclearReactor> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_NuclearReactor>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCCCCCC", "COOOOOC", "COXXXOC", "COXXXOC", "COXXXOC", "COOOOOC", "CCCCCCC"},
+ {"GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG"},
+ {"GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG"},
+ {"CCC~CCC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "CCCCCCC"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ buildHatchAdder(GregtechMTE_NuclearReactor.class)
+ .atLeast(Maintenance)
+ .casingIndex(TAE.GTPP_INDEX(12))
+ .dot(1)
+ .build(),
+ buildHatchAdder(GregtechMTE_NuclearReactor.class)
+ .atLeast(InputHatch, OutputHatch)
+ .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList)
+ .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE))
+ .casingIndex(TAE.GTPP_INDEX(12))
+ .dot(1)
+ .build(),
+ buildHatchAdder(GregtechMTE_NuclearReactor.class)
+ .atLeast(Dynamo)
+ .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList)
+ .hatchItemFilterAnd(t -> filterByMTETier(5, 6))
+ .casingIndex(TAE.GTPP_INDEX(12))
+ .dot(1)
+ .build(),
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 12))))
+ .addElement(
+ 'X',
+ buildHatchAdder(GregtechMTE_NuclearReactor.class)
+ .atLeast(Muffler)
+ .adder(GregtechMTE_NuclearReactor::addNuclearReactorTopList)
+ .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE))
+ .casingIndex(TAE.GTPP_INDEX(12))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 12))))
+ .addElement('O', ofBlock(ModBlocks.blockCasingsMisc, 12))
+ .addElement('G', ofBlock(ModBlocks.blockCasingsMisc, 13))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 3, 3, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 3, 3, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ if (checkPiece(mName, 3, 3, 0) && mCasing >= 27) {
+ if (mOutputHatches.size() >= 3
+ && mInputHatches.size() >= 2
+ && mDynamoHatches.size() == 4
+ && mMufflerHatches.size() == 4
+ && mMaintenanceHatches.size() == 2) {
+ this.mWrench = true;
+ this.mScrewdriver = true;
+ this.mSoftHammer = true;
+ this.mHardHammer = true;
+ this.mSolderingTool = true;
+ this.mCrowbar = true;
+ this.turnCasingActive(false);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // Alk's Life Lessons from Greg.
+ /*
+ [23:41:15] <GregoriusTechneticies> xdir and zdir are x2 and not x3
+ [23:41:26] <GregoriusTechneticies> thats you issue
+ [23:44:33] <Alkalus> mmm?
+ [23:44:49] <Alkalus> Should they be x3?
+ [23:44:50] <GregoriusTechneticies> you just do a x2, what is for a 5x5 multiblock
+ [23:45:01] <GregoriusTechneticies> x3 is for a 7x7 one
+ [23:45:06] <Alkalus> I have no idea what that value does, tbh..
+ [23:45:15] <GregoriusTechneticies> its the offset
+ [23:45:23] <Alkalus> Debugging checkMachine has been a pain and I usually trash designs that don't work straight up..
+ [23:45:28] <GregoriusTechneticies> it determines the horizontal middle of the multiblock
+ [23:45:47] <GregoriusTechneticies> which is in your case THREE blocks away from the controller
+ [23:45:51] <Alkalus> Ahh
+ [23:45:57] <GregoriusTechneticies> and not 2
+ [23:46:06] <Alkalus> Noted, thanks :D
+ */
+
+ @Override
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMTE_NuclearReactor(this.mName);
+ }
+
+ public boolean turnCasingActive(final boolean status) {
+ // TODO
+ if (this.mDynamoHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Dynamo hatch : this.mDynamoHatches) {
+ hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
+ }
+ }
+ if (this.mMufflerHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Muffler hatch : this.mMufflerHatches) {
+ hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
+ }
+ }
+ if (this.mOutputHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) {
+ hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
+ }
+ }
+ if (this.mInputHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) {
+ hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
+ }
+ }
+ if (this.mMaintenanceHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Maintenance hatch : this.mMaintenanceHatches) {
+ hatch.mMachineBlock = status ? (byte) TAE.GTPP_INDEX(13) : (byte) TAE.GTPP_INDEX(12);
+ }
+ }
+ return true;
+ }
+
+ public FluidStack[] getStoredFluidsAsArray() {
+ return getStoredFluids().toArray(new FluidStack[0]);
+ }
+
+ public int getStoredFuel(GT_Recipe aRecipe) {
+ int aFuelStored = 0;
+ FluidStack aFuelFluid = null;
+ for (FluidStack aFluidInput : aRecipe.mFluidInputs) {
+ if (!aFluidInput.getFluid().equals(NUCLIDE.Li2BeF4.getFluid())) {
+ aFuelFluid = aFluidInput;
+ break;
+ }
+ }
+ if (aFuelFluid != null) {
+ for (GT_MetaTileEntity_Hatch_Input aInputHatch : this.mInputHatches) {
+ if (aInputHatch.getFluid() != null && aInputHatch.getFluidAmount() > 0) {
+ if (aInputHatch.getFluid().isFluidEqual(aFuelFluid)) {
+ aFuelStored += aInputHatch.getFluidAmount();
+ }
+ }
+ }
+ }
+ return aFuelStored;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ // Warm up for 4~ minutes
+ Logger.WARNING("Checking LFTR recipes.");
+ if (mEfficiency < this.getMaxEfficiency(null)) {
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 1;
+ this.mEfficiencyIncrease = 2;
+ Logger.WARNING("Warming Up! " + this.mEfficiency + "/" + this.getMaxEfficiency(null));
+ return true;
+ }
+ Logger.WARNING("Warmed up, checking LFTR recipes.");
+
+ final FluidStack[] tFluids = getStoredFluidsAsArray();
+ final Collection<GT_Recipe> tRecipeList = getRecipeMap().mRecipeList;
+ if (tFluids.length > 0 && tRecipeList != null && tRecipeList.size() > 0) { // Does input hatch have a LFTR fuel?
+ Logger.WARNING("Found more than one input fluid and a list of valid recipes.");
+ // Find a valid recipe
+ GT_Recipe aFuelProcessing =
+ this.findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, 0, tFluids, new ItemStack[] {});
+ if (aFuelProcessing == null) {
+ Logger.WARNING("Did not find valid recipe for given inputs.");
+ return false;
+ } else {
+ Logger.WARNING("Found recipe? " + (aFuelProcessing != null ? "true" : "false"));
+ for (FluidStack aFluidInput : aFuelProcessing.mFluidInputs) {
+ Logger.WARNING("Using " + aFluidInput.getLocalizedName());
+ }
+ }
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+ this.mLastRecipe = aFuelProcessing;
+ // Deplete Inputs
+ if (aFuelProcessing.mFluidInputs.length > 0) {
+ for (FluidStack aInputToConsume : aFuelProcessing.mFluidInputs) {
+ Logger.WARNING(
+ "Depleting " + aInputToConsume.getLocalizedName() + " - " + aInputToConsume.amount + "L");
+ this.depleteInput(aInputToConsume);
+ }
+ }
+ // -- Try not to fail after this point - inputs have already been consumed! --
+ this.mMaxProgresstime = (int) (aFuelProcessing.mDuration);
+ this.mEUt = aFuelProcessing.mSpecialValue * 4;
+ Logger.WARNING("Outputting " + this.mEUt + "eu/t");
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ Logger.WARNING("Recipe time: " + this.mMaxProgresstime);
+ mFuelRemaining = getStoredFuel(aFuelProcessing); // Record available fuel
+
+ this.mOutputFluids = aFuelProcessing.mFluidOutputs.clone();
+ updateSlots();
+ Logger.WARNING("Recipe Good!");
+ return true;
+ }
+ this.mEUt = 0;
+ this.mEfficiency = 0;
+ Logger.WARNING("Recipe Bad!");
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public void explodeMultiblock() {
+ this.mInventory[1] = null;
+ long explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ for (final MetaTileEntity tTileEntity : this.mInputBusses) {
+ explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
+ }
+ for (final MetaTileEntity tTileEntity : this.mOutputBusses) {
+ explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
+ }
+ for (final MetaTileEntity tTileEntity : this.mInputHatches) {
+ explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
+ }
+ for (final MetaTileEntity tTileEntity : this.mOutputHatches) {
+ explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
+ }
+ for (final MetaTileEntity tTileEntity : this.mDynamoHatches) {
+ explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
+ }
+ for (final MetaTileEntity tTileEntity : this.mMufflerHatches) {
+ explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
+ }
+ for (final MetaTileEntity tTileEntity : this.mEnergyHatches) {
+ explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
+ }
+ for (final MetaTileEntity tTileEntity : this.mMaintenanceHatches) {
+ explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue);
+ }
+ explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L);
+ this.getBaseMetaTileEntity().doExplosion(explodevalue);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.getWorld().isRemote) {
+ if (aBaseMetaTileEntity.isActive()) {
+ // Set casings active if we're warmed up.
+ if (this.mEfficiency == this.getMaxEfficiency(null)) {
+ this.turnCasingActive(true);
+ } else {
+ this.turnCasingActive(false);
+ }
+ } else {
+ this.turnCasingActive(false);
+ }
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public boolean onRunningTick(ItemStack aStack) {
+ // See if we're warmed up.
+ if (this.mEfficiency == this.getMaxEfficiency(null)) {
+ // Try output some Uranium-233
+ if (MathUtils.randInt(1, 300) == 1) {
+ this.addOutput(ELEMENT.getInstance().URANIUM233.getFluidStack(MathUtils.randInt(1, 10)));
+ }
+ }
+ return super.onRunningTick(aStack);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mFuelRemaining", this.mFuelRemaining);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mFuelRemaining = aNBT.getInteger("mFuelRemaining");
+ super.loadNBTData(aNBT);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
index 715ef31871..281885bfd0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
@@ -1,6 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.*;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -18,487 +23,486 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.*;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
-
-public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntityGeneratorArray> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntityGeneratorArray> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntityGeneratorArray(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntityGeneratorArray(String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityGeneratorArray(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Processing Array";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Generator Array")
- .addInfo("Runs supplied generators as if placed in the world")
- .addInfo("Place up to 16 Single Block GT Generators into the Controller")
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front center")
- .addCasingInfo("Robust Tungstensteel Machine Casings", 10)
- .addInputBus("Any casing", 1)
- .addOutputBus("Any casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addDynamoHatch("Any casing", 1)
- .addMaintenanceHatch("Any casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return 48;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "ProcessingArray";
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- this.mMode = getModeFromInventorySlot(this.getGUIItemStack());
- if (this.mMode == MODE_NONE) {
- return null;
- }
- else if (this.mMode == MODE_STEAM) {
- return GTPP_Recipe.GTPP_Recipe_Map.sSteamTurbineFuels;
- }
- else if (this.mMode == MODE_DIESEL) {
- return GT_Recipe.GT_Recipe_Map.sDieselFuels;
- }
- else if (this.mMode == MODE_GAS) {
- return GT_Recipe.GT_Recipe_Map.sTurbineFuels;
- }
- else if (this.mMode == MODE_SEMIFLUID) {
- return GTPP_Recipe.GTPP_Recipe_Map.sSemiFluidLiquidFuels;
- }
- else if (this.mMode == MODE_GEOTHERMAL) {
- return GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels;
- }
- else if (this.mMode == MODE_ROCKETFUEL) {
- return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels;
- }
- else if (this.mMode == MODE_MAGIC_A) {
- return GT_Recipe.GT_Recipe_Map.sMagicFuels;
- }
- else if (this.mMode == MODE_PLASMA) {
- return GT_Recipe.GT_Recipe_Map.sPlasmaFuels;
- }
- else if (this.mMode == MODE_NAQUADAH) {
- return GT_Recipe.GT_Recipe_Map.sFluidNaquadahReactorFuels;
- }
- return null;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- if (aStack != null && aStack.getUnlocalizedName().startsWith("gt.blockmachines.")) {
- return true;
- }
- return false;
- }
-
- protected int fuelConsumption = 0;
- protected int fuelValue = 0;
- protected int fuelRemaining = 0;
- protected boolean boostEu = false;
-
- int mMode = 0;
-
- private final static int MODE_STEAM = 0;
- private final static int MODE_DIESEL = 1;
- private final static int MODE_GAS = 2;
- private final static int MODE_SEMIFLUID = 3;
- private final static int MODE_GEOTHERMAL = 4;
- private final static int MODE_ROCKETFUEL = 5;
- private final static int MODE_MAGIC_A = 6;
- private final static int MODE_MAGIC_B_DISABLED = 7;
- private final static int MODE_PLASMA = 8;
- private final static int MODE_NAQUADAH = 9;
- private final static int MODE_NONE = 100;
-
- private final static int[] ID_STEAM = new int[] {962, 1120, 1121, 1122};
- private final static int[] ID_GAS = new int[] {961, 1115, 1116, 1117};
- private final static int[] ID_DIESEL = new int[] {960, 1110, 1111, 1112};
- private final static int[] ID_SEMIFLUID = new int[] {837, 838, 839};
- private final static int[] ID_GEOTHERMAL = new int[] {830, 831, 832};
- private final static int[] ID_ROCKETFUEL = new int[] {793, 794, 795};
- private final static int[] ID_MAGIC_A = new int[] {1123, 1124, 1125};
- private final static int[] ID_MAGIC_B_DISABLED = new int[] {1127, 1128, 1129, 1130};
- private final static int[] ID_PLASMA = new int[] {1196, 1197, 1198};
- private final static int[] ID_NAQUADAH = new int[] {1190, 1191, 1192};
-
- private static final int getModeFromInventorySlot(ItemStack aStack) {
-
- if (aStack == null) {
- return MODE_NONE;
- }
-
- String aItemStackName = aStack == null ? "" : aStack.getUnlocalizedName();
- //Logger.INFO("Item Name: "+aItemStackName+" ("+aStack.getItemDamage()+")");
- if (aItemStackName.toLowerCase().contains("gt.blockmachines")) {
- for (int g : ID_STEAM) {
- if (aStack.getItemDamage() == g) {
- return MODE_STEAM;
- }
- }
- for (int g : ID_GAS) {
- if (aStack.getItemDamage() == g) {
- return MODE_GAS;
- }
- }
- for (int g : ID_DIESEL) {
- if (aStack.getItemDamage() == g) {
- return MODE_DIESEL;
- }
- }
- for (int g : ID_SEMIFLUID) {
- if (aStack.getItemDamage() == g) {
- return MODE_SEMIFLUID;
- }
- }
- for (int g : ID_GEOTHERMAL) {
- if (aStack.getItemDamage() == g) {
- return MODE_GEOTHERMAL;
- }
- }
- for (int g : ID_ROCKETFUEL) {
- if (aStack.getItemDamage() == g) {
- return MODE_ROCKETFUEL;
- }
- }
- for (int g : ID_MAGIC_A) {
- if (aStack.getItemDamage() == g) {
- return MODE_MAGIC_A;
- }
- }
- for (int g : ID_PLASMA) {
- if (aStack.getItemDamage() == g) {
- return MODE_PLASMA;
- }
- }
- for (int g : ID_NAQUADAH) {
- if (aStack.getItemDamage() == g) {
- return MODE_NAQUADAH;
- }
- }
- }
- return MODE_NONE;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- return false;
-
-/** this.resetRecipeMapForAllInputHatches();
- this.mMode = getModeFromInventorySlot(aStack);
- if (mMode == MODE_NONE) {
- Logger.INFO("Did not find valid generator.");
- return false;
- }
- else {
- Logger.INFO("Changed Mode to "+mMode);
- }
- int aMulti = this.getGUIItemStack() != null ? this.getGUIItemStack().stackSize : 0;
- if (aMulti > 16 || aMulti == 0) {
- return false;
- }
-
-
-
- ArrayList<FluidStack> tFluids = this.getStoredFluids();
-
- Collection<GT_Recipe> tRecipeList = this.getRecipeMap().mRecipeList;
- Logger.INFO("Got Recipe Map");
- if (tFluids.size() > 0 && tRecipeList != null) {
- Logger.INFO("Found Fuels for Map.");
- Iterator<FluidStack> arg3 = tFluids.iterator();
- int aCount = 0;
- while (arg3.hasNext()) {
- FluidStack hatchFluid1 = (FluidStack) arg3.next();
- Logger.INFO("Iterating Fluid Found "+(aCount++)+" | "+hatchFluid1.getLocalizedName());
- Iterator<GT_Recipe> arg5 = tRecipeList.iterator();
-
- int Hatch = 0;
- int totalFuelValue = 0;
- while (arg5.hasNext()) {
- Logger.INFO("Iterating Recipe "+(Hatch++));
- GT_Recipe aFuel = (GT_Recipe) arg5.next();
- FluidStack tLiquid;
- boolean addedFuelOnce = false;
- for (int a = 0; a < aMulti; a++) {
- if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null
- && hatchFluid1.isFluidEqual(tLiquid)) {
- this.fuelConsumption = tLiquid.amount = this.boostEu
- ? 4096 / aFuel.mSpecialValue
- : 2048 / aFuel.mSpecialValue;
- if (this.depleteInput(tLiquid)) {
- Logger.INFO("Depleted Fuel");
- this.boostEu = this.depleteInput(Materials.Oxygen.getGas(2L));
-
-/*if (!tFluids.contains(Materials.Lubricant.getFluid(1L))) {
- Logger.INFO("No Lube.");
- return false;
- }*/
-/**
- if (this.mRuntime % 72 == 0 || this.mRuntime == 0) {
- this.depleteInput(Materials.Lubricant.getFluid(this.boostEu ? 2L : 1L));
- }
- Logger.INFO("ADDING POWER");
- this.fuelRemaining = hatchFluid1.amount;
- totalFuelValue++;
- }
- }
- }
- //Do things after consuming Fuel
- if (totalFuelValue == aMulti) {
- this.fuelValue = aFuel.mSpecialValue*aMulti;
- this.mEUt = this.mEfficiency < 2000 ? 0 : aFuel.mSpecialValue*aMulti;
- this.mProgresstime = aMulti;
- this.mMaxProgresstime = aMulti;
- this.mEfficiencyIncrease = 15*aMulti;
- return true;
- }
- }
- }
- }
-
- this.mEUt = 0;
- this.mEfficiency = 0;
- return false;
- **/
- }
-
- public static ItemStack[] clean(final ItemStack[] v) {
- List<ItemStack> list = new ArrayList<ItemStack>(Arrays.asList(v));
- list.removeAll(Collections.singleton(null));
- return list.toArray(new ItemStack[list.size()]);
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntityGeneratorArray> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntityGeneratorArray>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntityGeneratorArray.class)
- .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Dynamo.or(TTDynamo), Muffler)
- .casingIndex(48)
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings4, 0)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 10;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- /**
- * Code from single blocks
- */
-
- public void tryProcessFuelItems(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a) {
- if (a != null
- && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20L + this.getMinimumStoredEU()
- && GT_Utility.getFluidForFilledItem(a, true) == null) {
- int tFuelValue;
- tFuelValue = this.getFuelValue(a);
- if (tFuelValue > 0) {
- ItemStack tEmptyContainer1 = this.getEmptyContainer(a);
- if (this.addOutput(tEmptyContainer1)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
- this.depleteInput(a);
- PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
- }
- }
- }
- }
-
- public void tryProcessFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick, FluidStack mFluid) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
- int tFuelValue;
- if (mFluid != null) {
- tFuelValue = this.getFuelValue(mFluid);
- int tEmptyContainer = this.consumedFluidPerOperation(mFluid);
- if (tFuelValue > 0 && tEmptyContainer > 0 && mFluid.amount > tEmptyContainer) {
- long tFluidAmountToUse = Math.min((long) (mFluid.amount / tEmptyContainer),
- (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
- if (tFluidAmountToUse > 0L && aBaseMetaTileEntity
- .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) {
- PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
- mFluid.amount = (int) ((long) mFluid.amount
- - tFluidAmountToUse * (long) tEmptyContainer);
- }
- }
- }
-
- //Check items
- }
-
- if (aBaseMetaTileEntity.isServerSide()) {
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
- }
-
- }
-
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return this.getFuelValue(aFluid) > 0;
- }
-
-
- public int consumedFluidPerOperation(FluidStack aLiquid) {
- return 1;
- }
-
- public int getFuelValue(FluidStack aLiquid) {
- if (aLiquid != null && this.getRecipeMap() != null) {
- Collection<GT_Recipe> tRecipeList = this.getRecipeMap().mRecipeList;
- if (tRecipeList != null) {
- Iterator<GT_Recipe> arg3 = tRecipeList.iterator();
-
- while (arg3.hasNext()) {
- GT_Recipe tFuel = (GT_Recipe) arg3.next();
- FluidStack tLiquid;
- if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null
- && aLiquid.isFluidEqual(tLiquid)) {
- return (int) ((long) tFuel.mSpecialValue * (long) this.mEfficiency
- * (long) this.consumedFluidPerOperation(tLiquid) / 100L);
- }
- }
- }
-
- return 0;
- } else {
- return 0;
- }
- }
-
- public int getFuelValue(ItemStack aStack) {
- if (!GT_Utility.isStackInvalid(aStack) && this.getRecipeMap() != null) {
- GT_Recipe tFuel = this.getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE,
- (FluidStack[]) null, new ItemStack[]{aStack});
- return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.mEfficiency / 100L) : 0;
- } else {
- return 0;
- }
- }
-
- public ItemStack getEmptyContainer(ItemStack aStack) {
- if (!GT_Utility.isStackInvalid(aStack) && this.getRecipeMap() != null) {
- GT_Recipe tFuel = this.getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE,
- (FluidStack[]) null, new ItemStack[]{aStack});
- return tFuel != null
- ? GT_Utility.copy(new Object[]{tFuel.getOutput(0)})
- : GT_Utility.getContainerItem(aStack, true);
- } else {
- return null;
- }
- }
-} \ No newline at end of file
+public class GregtechMetaTileEntityGeneratorArray
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntityGeneratorArray> implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntityGeneratorArray> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntityGeneratorArray(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityGeneratorArray(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityGeneratorArray(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Processing Array";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Generator Array")
+ .addInfo("Runs supplied generators as if placed in the world")
+ .addInfo("Place up to 16 Single Block GT Generators into the Controller")
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front center")
+ .addCasingInfo("Robust Tungstensteel Machine Casings", 10)
+ .addInputBus("Any casing", 1)
+ .addOutputBus("Any casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addDynamoHatch("Any casing", 1)
+ .addMaintenanceHatch("Any casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return 48;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "ProcessingArray";
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ this.mMode = getModeFromInventorySlot(this.getGUIItemStack());
+ if (this.mMode == MODE_NONE) {
+ return null;
+ } else if (this.mMode == MODE_STEAM) {
+ return GTPP_Recipe.GTPP_Recipe_Map.sSteamTurbineFuels;
+ } else if (this.mMode == MODE_DIESEL) {
+ return GT_Recipe.GT_Recipe_Map.sDieselFuels;
+ } else if (this.mMode == MODE_GAS) {
+ return GT_Recipe.GT_Recipe_Map.sTurbineFuels;
+ } else if (this.mMode == MODE_SEMIFLUID) {
+ return GTPP_Recipe.GTPP_Recipe_Map.sSemiFluidLiquidFuels;
+ } else if (this.mMode == MODE_GEOTHERMAL) {
+ return GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels;
+ } else if (this.mMode == MODE_ROCKETFUEL) {
+ return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels;
+ } else if (this.mMode == MODE_MAGIC_A) {
+ return GT_Recipe.GT_Recipe_Map.sMagicFuels;
+ } else if (this.mMode == MODE_PLASMA) {
+ return GT_Recipe.GT_Recipe_Map.sPlasmaFuels;
+ } else if (this.mMode == MODE_NAQUADAH) {
+ return GT_Recipe.GT_Recipe_Map.sFluidNaquadahReactorFuels;
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ if (aStack != null && aStack.getUnlocalizedName().startsWith("gt.blockmachines.")) {
+ return true;
+ }
+ return false;
+ }
+
+ protected int fuelConsumption = 0;
+ protected int fuelValue = 0;
+ protected int fuelRemaining = 0;
+ protected boolean boostEu = false;
+
+ int mMode = 0;
+
+ private static final int MODE_STEAM = 0;
+ private static final int MODE_DIESEL = 1;
+ private static final int MODE_GAS = 2;
+ private static final int MODE_SEMIFLUID = 3;
+ private static final int MODE_GEOTHERMAL = 4;
+ private static final int MODE_ROCKETFUEL = 5;
+ private static final int MODE_MAGIC_A = 6;
+ private static final int MODE_MAGIC_B_DISABLED = 7;
+ private static final int MODE_PLASMA = 8;
+ private static final int MODE_NAQUADAH = 9;
+ private static final int MODE_NONE = 100;
+
+ private static final int[] ID_STEAM = new int[] {962, 1120, 1121, 1122};
+ private static final int[] ID_GAS = new int[] {961, 1115, 1116, 1117};
+ private static final int[] ID_DIESEL = new int[] {960, 1110, 1111, 1112};
+ private static final int[] ID_SEMIFLUID = new int[] {837, 838, 839};
+ private static final int[] ID_GEOTHERMAL = new int[] {830, 831, 832};
+ private static final int[] ID_ROCKETFUEL = new int[] {793, 794, 795};
+ private static final int[] ID_MAGIC_A = new int[] {1123, 1124, 1125};
+ private static final int[] ID_MAGIC_B_DISABLED = new int[] {1127, 1128, 1129, 1130};
+ private static final int[] ID_PLASMA = new int[] {1196, 1197, 1198};
+ private static final int[] ID_NAQUADAH = new int[] {1190, 1191, 1192};
+
+ private static final int getModeFromInventorySlot(ItemStack aStack) {
+
+ if (aStack == null) {
+ return MODE_NONE;
+ }
+
+ String aItemStackName = aStack == null ? "" : aStack.getUnlocalizedName();
+ // Logger.INFO("Item Name: "+aItemStackName+" ("+aStack.getItemDamage()+")");
+ if (aItemStackName.toLowerCase().contains("gt.blockmachines")) {
+ for (int g : ID_STEAM) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_STEAM;
+ }
+ }
+ for (int g : ID_GAS) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_GAS;
+ }
+ }
+ for (int g : ID_DIESEL) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_DIESEL;
+ }
+ }
+ for (int g : ID_SEMIFLUID) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_SEMIFLUID;
+ }
+ }
+ for (int g : ID_GEOTHERMAL) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_GEOTHERMAL;
+ }
+ }
+ for (int g : ID_ROCKETFUEL) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_ROCKETFUEL;
+ }
+ }
+ for (int g : ID_MAGIC_A) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_MAGIC_A;
+ }
+ }
+ for (int g : ID_PLASMA) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_PLASMA;
+ }
+ }
+ for (int g : ID_NAQUADAH) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_NAQUADAH;
+ }
+ }
+ }
+ return MODE_NONE;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ return false;
+
+ /** this.resetRecipeMapForAllInputHatches();
+ * this.mMode = getModeFromInventorySlot(aStack);
+ * if (mMode == MODE_NONE) {
+ * Logger.INFO("Did not find valid generator.");
+ * return false;
+ * }
+ * else {
+ * Logger.INFO("Changed Mode to "+mMode);
+ * }
+ * int aMulti = this.getGUIItemStack() != null ? this.getGUIItemStack().stackSize : 0;
+ * if (aMulti > 16 || aMulti == 0) {
+ * return false;
+ * }
+ *
+ *
+ *
+ * ArrayList<FluidStack> tFluids = this.getStoredFluids();
+ *
+ * Collection<GT_Recipe> tRecipeList = this.getRecipeMap().mRecipeList;
+ * Logger.INFO("Got Recipe Map");
+ * if (tFluids.size() > 0 && tRecipeList != null) {
+ * Logger.INFO("Found Fuels for Map.");
+ * Iterator<FluidStack> arg3 = tFluids.iterator();
+ * int aCount = 0;
+ * while (arg3.hasNext()) {
+ * FluidStack hatchFluid1 = (FluidStack) arg3.next();
+ * Logger.INFO("Iterating Fluid Found "+(aCount++)+" | "+hatchFluid1.getLocalizedName());
+ * Iterator<GT_Recipe> arg5 = tRecipeList.iterator();
+ *
+ * int Hatch = 0;
+ * int totalFuelValue = 0;
+ * while (arg5.hasNext()) {
+ * Logger.INFO("Iterating Recipe "+(Hatch++));
+ * GT_Recipe aFuel = (GT_Recipe) arg5.next();
+ * FluidStack tLiquid;
+ * boolean addedFuelOnce = false;
+ * for (int a = 0; a < aMulti; a++) {
+ * if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null
+ * && hatchFluid1.isFluidEqual(tLiquid)) {
+ * this.fuelConsumption = tLiquid.amount = this.boostEu
+ * ? 4096 / aFuel.mSpecialValue
+ * : 2048 / aFuel.mSpecialValue;
+ * if (this.depleteInput(tLiquid)) {
+ * Logger.INFO("Depleted Fuel");
+ * this.boostEu = this.depleteInput(Materials.Oxygen.getGas(2L));
+ *
+ * /*if (!tFluids.contains(Materials.Lubricant.getFluid(1L))) {
+ * Logger.INFO("No Lube.");
+ * return false;
+ * }*/
+ /**
+ * if (this.mRuntime % 72 == 0 || this.mRuntime == 0) {
+ * this.depleteInput(Materials.Lubricant.getFluid(this.boostEu ? 2L : 1L));
+ * }
+ * Logger.INFO("ADDING POWER");
+ * this.fuelRemaining = hatchFluid1.amount;
+ * totalFuelValue++;
+ * }
+ * }
+ * }
+ * //Do things after consuming Fuel
+ * if (totalFuelValue == aMulti) {
+ * this.fuelValue = aFuel.mSpecialValue*aMulti;
+ * this.mEUt = this.mEfficiency < 2000 ? 0 : aFuel.mSpecialValue*aMulti;
+ * this.mProgresstime = aMulti;
+ * this.mMaxProgresstime = aMulti;
+ * this.mEfficiencyIncrease = 15*aMulti;
+ * return true;
+ * }
+ * }
+ * }
+ * }
+ *
+ * this.mEUt = 0;
+ * this.mEfficiency = 0;
+ * return false;
+ **/
+ }
+
+ public static ItemStack[] clean(final ItemStack[] v) {
+ List<ItemStack> list = new ArrayList<ItemStack>(Arrays.asList(v));
+ list.removeAll(Collections.singleton(null));
+ return list.toArray(new ItemStack[list.size()]);
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntityGeneratorArray> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntityGeneratorArray>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntityGeneratorArray.class)
+ .atLeast(
+ InputHatch,
+ OutputHatch,
+ InputBus,
+ OutputBus,
+ Maintenance,
+ Dynamo.or(TTDynamo),
+ Muffler)
+ .casingIndex(48)
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings4, 0))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 10;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ /**
+ * Code from single blocks
+ */
+ public void tryProcessFuelItems(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a) {
+ if (a != null
+ && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20L + this.getMinimumStoredEU()
+ && GT_Utility.getFluidForFilledItem(a, true) == null) {
+ int tFuelValue;
+ tFuelValue = this.getFuelValue(a);
+ if (tFuelValue > 0) {
+ ItemStack tEmptyContainer1 = this.getEmptyContainer(a);
+ if (this.addOutput(tEmptyContainer1)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
+ this.depleteInput(a);
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
+ }
+ }
+ }
+ }
+
+ public void tryProcessFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick, FluidStack mFluid) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
+ int tFuelValue;
+ if (mFluid != null) {
+ tFuelValue = this.getFuelValue(mFluid);
+ int tEmptyContainer = this.consumedFluidPerOperation(mFluid);
+ if (tFuelValue > 0 && tEmptyContainer > 0 && mFluid.amount > tEmptyContainer) {
+ long tFluidAmountToUse = Math.min(
+ (long) (mFluid.amount / tEmptyContainer),
+ (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
+ if (tFluidAmountToUse > 0L
+ && aBaseMetaTileEntity.increaseStoredEnergyUnits(
+ tFluidAmountToUse * (long) tFuelValue, true)) {
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
+ mFluid.amount = (int) ((long) mFluid.amount - tFluidAmountToUse * (long) tEmptyContainer);
+ }
+ }
+ }
+
+ // Check items
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.getUniversalEnergyStored()
+ >= this.maxEUOutput() + this.getMinimumStoredEU());
+ }
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return this.getFuelValue(aFluid) > 0;
+ }
+
+ public int consumedFluidPerOperation(FluidStack aLiquid) {
+ return 1;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid != null && this.getRecipeMap() != null) {
+ Collection<GT_Recipe> tRecipeList = this.getRecipeMap().mRecipeList;
+ if (tRecipeList != null) {
+ Iterator<GT_Recipe> arg3 = tRecipeList.iterator();
+
+ while (arg3.hasNext()) {
+ GT_Recipe tFuel = (GT_Recipe) arg3.next();
+ FluidStack tLiquid;
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null
+ && aLiquid.isFluidEqual(tLiquid)) {
+ return (int) ((long) tFuel.mSpecialValue
+ * (long) this.mEfficiency
+ * (long) this.consumedFluidPerOperation(tLiquid)
+ / 100L);
+ }
+ }
+ }
+
+ return 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ if (!GT_Utility.isStackInvalid(aStack) && this.getRecipeMap() != null) {
+ GT_Recipe tFuel = this.getRecipeMap()
+ .findRecipe(
+ this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] {
+ aStack
+ });
+ return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.mEfficiency / 100L) : 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public ItemStack getEmptyContainer(ItemStack aStack) {
+ if (!GT_Utility.isStackInvalid(aStack) && this.getRecipeMap() != null) {
+ GT_Recipe tFuel = this.getRecipeMap()
+ .findRecipe(
+ this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] {
+ aStack
+ });
+ return tFuel != null
+ ? GT_Utility.copy(new Object[] {tFuel.getOutput(0)})
+ : GT_Utility.getContainerItem(aStack, true);
+ } else {
+ return null;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
index 5c4278a198..2be790ac16 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
@@ -1,9 +1,11 @@
-
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
-import java.util.HashMap;
-import javax.annotation.Nonnull;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTEnergy;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -34,502 +36,578 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.helpers.TreeFarmHelper;
+import java.util.ArrayList;
+import java.util.HashMap;
+import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTEnergy;
-
-public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntityTreeFarm> implements ISurvivalConstructable {
-
- public static int CASING_TEXTURE_ID;
- public static String mCasingName = "Sterile Farm Casing";
-// public static TreeGenerator mTreeData;
- public static HashMap<String, ItemStack> sLogCache = new HashMap<>();
- private static final int TICKS_PER_OPERATION = 100;
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntityTreeFarm> STRUCTURE_DEFINITION = null;
-
- private SAWTOOL mToolType;
- private ItemStack mSapling;
- private ItemStack mWood;
- private float heightModifier = 1.0f;
- private float saplingsModifier = 1.0f;
- private int girthModifier = 1;
-
- public GregtechMetaTileEntityTreeFarm(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(1, 15);
- }
-
- public GregtechMetaTileEntityTreeFarm(final String aName) {
- super(aName);
- CASING_TEXTURE_ID = TAE.getIndexFromPage(1, 15);
- }
-
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityTreeFarm(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Tree Farm";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Converts EU to Logs")
- .addInfo("Eu Usage: 100% | Parallel: 1")
- .addInfo("Requires a Saw or Chainsaw in GUI slot")
- .addInfo("Output multiplier:")
- .addInfo("Saw = 1x")
- .addInfo("Buzzsaw = 2x")
- .addInfo("Chainsaw = 4x")
- .addInfo("Add a sapling in the input bus to select wood type output")
- .addInfo("Tools can also be fed to the controller via input bus")
- .addInfo("The working speed is fixed for 5s")
- .addInfo("Production Formula: (2 * tier^2 - 2 * tier + 5) * 5 * saw boost")
- .addInfo("When fertilizer is insufficient, sapling production reduced to one-tenth")
- .addInfo("Forestry saplings can get increased production")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 3, true)
- .addController("Front center")
- .addCasingInfo("Sterile Farm Casing", 8)
- .addInputBus("Any casing", 1)
- .addOutputBus("Any casing", 1)
- .addEnergyHatch("Any casing", 1)
- .addMaintenanceHatch("Any casing", 1)
- .addMufflerHatch("Any casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return CASING_TEXTURE_ID;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "VacuumFreezer";
- }
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- // is correct part && either not powered tool or have enough power
- if (TreeFarmHelper.isValidForGUI(aStack) && GT_MetaGenerated_Tool.getToolDamage(aStack) < GT_MetaGenerated_Tool.getToolMaxDamage(aStack)) {
- return GT_ModHandler.isElectricItem(aStack) ? GT_ModHandler.canUseElectricItem(aStack, 32) : true;
- }
- return false;
- }
-
- /**
- * Method used to get the boost based on the ordinal of the saw
- * @param sawType type of the saw
- * @return an int corresponding to the boost
- */
- public int getSawBoost(SAWTOOL sawType){
- switch(sawType){
- case SAW:
- return 1;
- case BUZZSAW:
- return 2;
- case CHAINSAW:
- return 4;
- default:
- return 1;
- }
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- if (!isCorrectMachinePart(aStack) && !replaceTool()) return false;
- if (!checkSapling()) return false;
-
- this.mToolType = TreeFarmHelper.isCorrectMachinePart(aStack);
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-
- int aOutputAmount = ((2 * (tTier * tTier)) - (2 * tTier) + 5) * (TICKS_PER_OPERATION / 20) * getSawBoost(mToolType);
- int aFert = hasLiquidFert();
- ItemStack[] toOutput;
-
- if (aFert > 0) { //Sapling
- if (aFert < aOutputAmount) {
- aOutputAmount /= 10;
- }
- int amplifiedOutputAmount = (int) (aOutputAmount * saplingsModifier);
- toOutput = new ItemStack[]{ItemUtils.getSimpleStack(mSapling, amplifiedOutputAmount)};
- } else { //Log
- int amplifiedOutputAmount = (int) (aOutputAmount * heightModifier * girthModifier);
- toOutput = new ItemStack[]{ItemUtils.getSimpleStack(mWood, amplifiedOutputAmount)};
- }
-
- if (canBufferOutputs(toOutput, new FluidStack[]{}, 1) == 0) {
- return false;
- }
-
- if (aFert > 0 && aFert >= aOutputAmount) {
- tryConsumeLiquidFert(aOutputAmount);
- }
-
- this.mOutputItems = toOutput;
-
- this.mMaxProgresstime = TICKS_PER_OPERATION;
- this.mEUt = MaterialUtils.getVoltageForTier(tTier);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.tryDamageTool();
- this.updateSlots();
- return true;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 1, 0) && mCasing >= 8 && checkHatch();
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntityTreeFarm> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntityTreeFarm>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"C~C", "C-C", "CCC"},
- {"CCC", "CCC", "CCC"},
- }))
- .addElement('C', buildHatchAdder(GregtechMetaTileEntityTreeFarm.class)
- .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy.or(TTEnergy), Muffler)
- .casingIndex(CASING_TEXTURE_ID)
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 15)))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiTreeFarm;
- }
-
- @Override
- public int getDamageToComponent(final ItemStack aStack) {
- return MathUtils.balance((int) (75 - ((GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).getMass()))), 5, 120);
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- private boolean tryDamageTool() {
- GT_ModHandler.damageOrDechargeItem(this.mInventory[1], 1, 32, null);
- return replaceTool();
- }
-
- public boolean replaceTool() {
- ItemStack invItem = this.mInventory[1];
- if (isCorrectMachinePart(invItem)) return true;
- else {
- if (invItem != null) {
- this.mInventory[1] = null;
- this.addOutput(invItem);
- }
-
- for (ItemStack aStack : getStoredInputs()) {
- if (isCorrectMachinePart(aStack)) {
- this.mInventory[1] = aStack.copy();
- this.depleteInput(aStack);
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean checkSapling() {
- for (ItemStack uStack : this.getStoredInputs()) {
-
- if (uStack != null) {
- String registryName = Item.itemRegistry.getNameForObject(uStack.getItem());
- ItemStack aWood = sLogCache.get(registryName + ":" + uStack.getItemDamage());
-
- if (aWood != null) {
- this.heightModifier = 1.0f;
- this.saplingsModifier = 1.0f;
- this.girthModifier = 1;
-
- this.mSapling = uStack;
- this.mWood = aWood;
- return true;
- } else {
- if (registryName.equals("Forestry:sapling")) {
-
- ITree tree = TreeManager.treeRoot.getMember(uStack);
-
- this.heightModifier = Math.max(3 * (tree.getGenome().getHeight() - 1), 0) + 1;
- this.saplingsModifier = Math.max(tree.getGenome().getFertility() * 20, 1);
- this.girthModifier = tree.getGenome().getGirth();
- boolean fireproof = ((IAlleleBoolean) tree.getGenome().getChromosomes()[EnumTreeChromosome.FIREPROOF.ordinal()].getActiveAllele()).getValue();
-
- aWood = sLogCache.get(tree.getIdent() + (fireproof ? "fireproof" : ""));
-
- this.mSapling = uStack;
- this.mWood = aWood;
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static void loadMapWoodFromSapling() {
-
- // galaxySpace
- mapSaplingToLog("GalaxySpace:barnardaCsapling:1", GT_ModHandler.getModItem("GalaxySpace", "barnardaClog", 1)); // barnarda c
-
- // minecraft
- mapSaplingToLog("minecraft:sapling:0", new ItemStack(Blocks.log, 1, 0)); // oak
- mapSaplingToLog("minecraft:sapling:1", new ItemStack(Blocks.log, 1, 1)); // spruce
- mapSaplingToLog("minecraft:sapling:2", new ItemStack(Blocks.log, 1, 2)); // birch
- mapSaplingToLog("minecraft:sapling:3", new ItemStack(Blocks.log, 1, 3)); // jungle
- mapSaplingToLog("minecraft:sapling:4", new ItemStack(Blocks.log2, 1, 0)); // acacia
- mapSaplingToLog("minecraft:sapling:5", new ItemStack(Blocks.log2, 1, 1)); // dark oak
-
-
- // ic2
- mapSaplingToLog("IC2:blockRubSapling:0", GT_ModHandler.getModItem("IC2", "blockRubWood", 1)); // rubber
-
- // natura
- mapSaplingToLog("Natura:florasapling:0", GT_ModHandler.getModItem("Natura", "redwood", 1, 1)); // redwood
- mapSaplingToLog("Natura:florasapling:1", GT_ModHandler.getModItem("Natura", "tree", 1, 0)); // eucalyptus
- mapSaplingToLog("Natura:florasapling:2", GT_ModHandler.getModItem("Natura", "tree", 1, 3)); // hopseed
- mapSaplingToLog("Natura:florasapling:3", GT_ModHandler.getModItem("Natura", "tree", 1, 1)); // sakura
- mapSaplingToLog("Natura:florasapling:4", GT_ModHandler.getModItem("Natura", "tree", 1, 2)); // ghostwood
- mapSaplingToLog("Natura:florasapling:5", GT_ModHandler.getModItem("Natura", "bloodwood", 1, 0)); // bloodwood
- mapSaplingToLog("Natura:florasapling:6", GT_ModHandler.getModItem("Natura", "Dark Tree", 1, 0)); // darkwood
- mapSaplingToLog("Natura:florasapling:7", GT_ModHandler.getModItem("Natura", "Dark Tree", 1, 1)); // fusewood
-
- mapSaplingToLog("Natura:Rare Sapling:0", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 0)); // maple
- mapSaplingToLog("Natura:Rare Sapling:1", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 1)); // silverbell
- mapSaplingToLog("Natura:Rare Sapling:2", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 2)); // amaranth
- mapSaplingToLog("Natura:Rare Sapling:3", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 3)); // tigerwood
- mapSaplingToLog("Natura:Rare Sapling:4", GT_ModHandler.getModItem("Natura", "willow", 1, 0)); // willow
-
- // BOP
- mapSaplingToLog("BiomesOPlenty:colorizedSaplings:0", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 0)); // Sacred Oak
- mapSaplingToLog("BiomesOPlenty:colorizedSaplings:1", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 2)); // Mangrove
- mapSaplingToLog("BiomesOPlenty:colorizedSaplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 3)); // Palm
- mapSaplingToLog("BiomesOPlenty:colorizedSaplings:3", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 0)); // Redwood
- mapSaplingToLog("BiomesOPlenty:colorizedSaplings:4", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 1)); // Willow
- mapSaplingToLog("BiomesOPlenty:colorizedSaplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 0)); // Pine
- mapSaplingToLog("BiomesOPlenty:colorizedSaplings:6", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 3)); // Mahogany
- mapSaplingToLog("BiomesOPlenty:saplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "bamboo", 1, 0)); // Bamboo
- mapSaplingToLog("BiomesOPlenty:saplings:3", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 1)); // Magic
- mapSaplingToLog("BiomesOPlenty:saplings:4", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 2)); // Dark
- mapSaplingToLog("BiomesOPlenty:saplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 2)); // Dying/Dead
- mapSaplingToLog("BiomesOPlenty:saplings:6", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 3)); // Fir
- mapSaplingToLog("BiomesOPlenty:saplings:7", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 0)); // Ethereal
- mapSaplingToLog("BiomesOPlenty:saplings:10", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // Pink Cherry
- mapSaplingToLog("BiomesOPlenty:saplings:12", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // White Cherry
- mapSaplingToLog("BiomesOPlenty:saplings:13", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 1)); // Hellbark
- mapSaplingToLog("BiomesOPlenty:saplings:14", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 2)); // Jacaranda
- mapSaplingToLog("minecraft:yellow_flower:0", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant Flower Stem
- mapSaplingToLog("minecraft:red_flower:0", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant Flower Stem
-
- // Witchery
- mapSaplingToLog("witchery:witchsapling:0", GT_ModHandler.getModItem("witchery", "witchlog", 1, 0)); // Rowan
- mapSaplingToLog("witchery:witchsapling:1", GT_ModHandler.getModItem("witchery", "witchlog", 1, 1)); // Alder
- mapSaplingToLog("witchery:witchsapling:2", GT_ModHandler.getModItem("witchery", "witchlog", 1, 2)); // Hawthorn
-
-
- // TConstruct
- mapSaplingToLog("TConstruct:slime.sapling:0", GT_ModHandler.getModItem("TConstruct", "slime.gel", 1)); // green slime blocks
-
- // TaintedMagic
- mapSaplingToLog("TaintedMagic:BlockWarpwoodSapling:0", GT_ModHandler.getModItem("TaintedMagic", "BlockWarpwoodLog", 1)); // warpwood
-
- // Thaumcraft
- mapSaplingToLog("Thaumcraft:blockCustomPlant:0", GT_ModHandler.getModItem("Thaumcraft", "blockMagicalLog", 1, 0)); // greatwood
- mapSaplingToLog("Thaumcraft:blockCustomPlant:1", GT_ModHandler.getModItem("Thaumcraft", "blockMagicalLog", 1, 1)); // silverwood
-
- // gt++
- mapSaplingToLog("miscutils:blockRainforestOakSapling:0", GT_ModHandler.getModItem("miscutils", "blockRainforestOakLog", 1)); // rainforest
- mapSaplingToLog("miscutils:blockPineSapling:0", GT_ModHandler.getModItem("miscutils", "blockPineLogLog", 1)); // pine
-
- // Harvestcraft
- mapSaplingToLog("harvestcraft:pampistachioSapling:0", new ItemStack(Blocks.log, 1, 3)); // Pistachio
- mapSaplingToLog("harvestcraft:pampapayaSapling:0", new ItemStack(Blocks.log, 1, 3)); // Papaya
- mapSaplingToLog("harvestcraft:pammapleSapling:0", GT_ModHandler.getModItem("harvestcraft", "pamMaple", 1)); // Maple
- mapSaplingToLog("harvestcraft:pamappleSapling:0", new ItemStack(Blocks.log, 1, 0)); // Apple
- mapSaplingToLog("harvestcraft:pamdateSapling:0", new ItemStack(Blocks.log, 1, 3)); // Date
- mapSaplingToLog("harvestcraft:pamorangeSapling:0", new ItemStack(Blocks.log, 1, 3)); // Orange
- mapSaplingToLog("harvestcraft:pamdragonfruitSapling:0", new ItemStack(Blocks.log, 1, 3)); // Dragon fruit
- mapSaplingToLog("harvestcraft:pamnutmegSapling:0", new ItemStack(Blocks.log, 1, 0)); // NutMeg
- mapSaplingToLog("harvestcraft:pampaperbarkSapling:0", GT_ModHandler.getModItem("harvestcraft", "pamPaperbark", 1)); // Paperbark
- mapSaplingToLog("harvestcraft:pammangoSapling:0", new ItemStack(Blocks.log, 1, 3)); // Mango
- mapSaplingToLog("harvestcraft:pamavocadoSapling:0", new ItemStack(Blocks.log, 1, 0)); // Avocado
- mapSaplingToLog("harvestcraft:pamchestnutSapling:0", new ItemStack(Blocks.log, 1, 0)); // Chestnut
- mapSaplingToLog("harvestcraft:pampeppercornSapling:0", new ItemStack(Blocks.log, 1, 3)); // Peppercorn
- mapSaplingToLog("harvestcraft:pampecanSapling:0", new ItemStack(Blocks.log, 1, 3)); // Pecan
- mapSaplingToLog("harvestcraft:pamcashewSapling:0", new ItemStack(Blocks.log, 1, 3)); // Cashew
- mapSaplingToLog("harvestcraft:pamfigSapling:0", new ItemStack(Blocks.log, 1, 3)); // Fig
- mapSaplingToLog("harvestcraft:pamoliveSapling:0", new ItemStack(Blocks.log, 1, 3)); // Olive
- mapSaplingToLog("harvestcraft:pamcinnamonSapling:0", GT_ModHandler.getModItem("harvestcraft", "pamCinnamon", 1)); // Cinnamon
- mapSaplingToLog("harvestcraft:pampeachSapling:0", new ItemStack(Blocks.log, 1, 3)); // Peach
- mapSaplingToLog("harvestcraft:pamlemonSapling:0", new ItemStack(Blocks.log, 1, 3)); // Lemon
- mapSaplingToLog("harvestcraft:pamvanillabeanSapling:0", new ItemStack(Blocks.log, 1, 3)); // Vanilla
- mapSaplingToLog("harvestcraft:pamalmondSapling:0", new ItemStack(Blocks.log, 1, 3)); // Almond
- mapSaplingToLog("harvestcraft:pambananaSapling:0", new ItemStack(Blocks.log, 1, 3)); // Banana
- mapSaplingToLog("harvestcraft:pamdurianSapling:0", new ItemStack(Blocks.log, 1, 3)); // Durian
- mapSaplingToLog("harvestcraft:pamplumSapling:0", new ItemStack(Blocks.log, 1, 0)); // Plum
- mapSaplingToLog("harvestcraft:pamlimeSapling:0", new ItemStack(Blocks.log, 1, 3)); // Lime
- mapSaplingToLog("harvestcraft:pampearSapling:0", new ItemStack(Blocks.log, 1, 0)); // Pear
- mapSaplingToLog("harvestcraft:pamgooseberrySapling:0", new ItemStack(Blocks.log, 1, 0)); // Gooseberry
- mapSaplingToLog("harvestcraft:pamcherrySapling:0", new ItemStack(Blocks.log, 1, 0)); // Cherry
- mapSaplingToLog("harvestcraft:pampomegranateSapling:0", new ItemStack(Blocks.log, 1, 3)); // Pomegranate
- mapSaplingToLog("harvestcraft:pamwalnutSapling:0", new ItemStack(Blocks.log, 1, 0)); // Walnut
- mapSaplingToLog("harvestcraft:pampersimmonSapling:0", new ItemStack(Blocks.log, 1, 3)); // Persimmon
- mapSaplingToLog("harvestcraft:pamapricotSapling:0", new ItemStack(Blocks.log, 1, 3)); // Apricot
- mapSaplingToLog("harvestcraft:pamcoconutSapling:0", new ItemStack(Blocks.log, 1, 3)); // Coconut
- mapSaplingToLog("harvestcraft:pamgrapefruitSapling:0", new ItemStack(Blocks.log, 1, 3)); // Grapefruit
- mapSaplingToLog("harvestcraft:pamstarfruitSapling:0", new ItemStack(Blocks.log, 1, 3)); // Starfruit
-
- // Harvest The Nether
- mapSaplingToLog("harvestthenether:netherSapling:0", GT_ModHandler.getModItem("harvestthenether", "netherLog", 1)); // Nether
-
- // The Twilight Forest
- mapSaplingToLog("TwilightForest:tile.TFSapling:0", GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 0)); // Sickly Twilight Oak
- mapSaplingToLog("TwilightForest:tile.TFSapling:1", GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 1)); // Canopy Tree
- mapSaplingToLog("TwilightForest:tile.TFSapling:2", GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 2)); // Twilight Mangrove
- mapSaplingToLog("TwilightForest:tile.TFSapling:3", GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 3)); // Darkwood
- mapSaplingToLog("TwilightForest:tile.TFSapling:4", GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 0)); // Robust Twilight Oad
- mapSaplingToLog("TwilightForest:tile.TFSapling:5", GT_ModHandler.getModItem("TwilightForest", "tile.TFMagicLog", 1, 0)); // Tree of Time
- mapSaplingToLog("TwilightForest:tile.TFSapling:6", GT_ModHandler.getModItem("TwilightForest", "tile.TFMagicLog", 1, 1)); // Tree of Trasformation
- mapSaplingToLog("TwilightForest:tile.TFSapling:7", GT_ModHandler.getModItem("TwilightForest", "tile.TFMagicLog", 1, 2)); // Miner's Tree
- mapSaplingToLog("TwilightForest:tile.TFSapling:8", GT_ModHandler.getModItem("TwilightForest", "tile.TFMagicLog", 1, 3)); // Sorting Tree
- mapSaplingToLog("TwilightForest:tile.TFSapling:9", GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 0)); // Rainbow Oak
-
- // Thaumic Bases
- mapSaplingToLog("thaumicbases:goldenOakSapling:0", new ItemStack(Blocks.log, 1, 0)); // Golden Oak
- mapSaplingToLog("thaumicbases:goldenOakSapling:1", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 0)); // Peaceful
- mapSaplingToLog("thaumicbases:goldenOakSapling:2", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 1)); // Nether
- mapSaplingToLog("thaumicbases:goldenOakSapling:3", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 2)); // Ender
-
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- public static void mapSaplingToLog(String aSapling, ItemStack aLog) {
- ItemStack aSaplingStack = ItemUtils.getItemStackFromFQRN(aSapling, 1);
- if (aSaplingStack != null && aLog != null) {
- sLogCache.put(aSapling, aLog);
- addFakeRecipeToNEI(aSaplingStack, aLog);
- } else {
- Logger.INFO("Unable to add Tree Growth Simulation for " + aSapling);
- }
- }
-
- private static int sRecipeID = 0;
-
- public static boolean addFakeRecipeToNEI(@Nonnull ItemStack aSapling, ItemStack aLog) {
- int aRecipes = GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size();
- Logger.INFO("Adding Tree Growth Simulation for " + aSapling.getDisplayName() + " -> " + (aLog == null ? "NULL" : aLog.getDisplayName()));
- ItemStack[] aOutput = new ItemStack[]{aLog, aSapling};
- String aOutputs = ItemUtils.getArrayStackNames(aOutput);
- Logger.INFO("" + aOutputs);
- GTPP_Recipe_Map.sTreeSimFakeRecipes.addFakeRecipe(
- false,
- new ItemStack[]{aSapling.copy()},
- aOutput,
- null,
- new int[]{10000, 1000},
- new FluidStack[]{FluidUtils.getFluidStack(ModItems.fluidFertBasic, 1)},
- new FluidStack[]{},
- 1,
- sRecipeID++,
- 0);
- return GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size() > aRecipes;
- }
-
- public int hasLiquidFert() {
- ArrayList<FluidStack> aFluids = this.getStoredFluids();
- for (FluidStack aFluid : aFluids) {
- if (aFluid.getFluid().equals(ModItems.fluidFertBasic)) {
- return aFluid.amount;
- }
- }
- return 0;
- }
-
- public boolean tryConsumeLiquidFert(int aFluidAmount) {
- return this.depleteInput(FluidUtils.getFluidStack(ModItems.fluidFertBasic, aFluidAmount));
- }
+public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntityTreeFarm>
+ implements ISurvivalConstructable {
+
+ public static int CASING_TEXTURE_ID;
+ public static String mCasingName = "Sterile Farm Casing";
+ // public static TreeGenerator mTreeData;
+ public static HashMap<String, ItemStack> sLogCache = new HashMap<>();
+ private static final int TICKS_PER_OPERATION = 100;
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntityTreeFarm> STRUCTURE_DEFINITION = null;
+
+ private SAWTOOL mToolType;
+ private ItemStack mSapling;
+ private ItemStack mWood;
+ private float heightModifier = 1.0f;
+ private float saplingsModifier = 1.0f;
+ private int girthModifier = 1;
+
+ public GregtechMetaTileEntityTreeFarm(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(1, 15);
+ }
+
+ public GregtechMetaTileEntityTreeFarm(final String aName) {
+ super(aName);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(1, 15);
+ }
+
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityTreeFarm(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Tree Farm";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Converts EU to Logs")
+ .addInfo("Eu Usage: 100% | Parallel: 1")
+ .addInfo("Requires a Saw or Chainsaw in GUI slot")
+ .addInfo("Output multiplier:")
+ .addInfo("Saw = 1x")
+ .addInfo("Buzzsaw = 2x")
+ .addInfo("Chainsaw = 4x")
+ .addInfo("Add a sapling in the input bus to select wood type output")
+ .addInfo("Tools can also be fed to the controller via input bus")
+ .addInfo("The working speed is fixed for 5s")
+ .addInfo("Production Formula: (2 * tier^2 - 2 * tier + 5) * 5 * saw boost")
+ .addInfo("When fertilizer is insufficient, sapling production reduced to one-tenth")
+ .addInfo("Forestry saplings can get increased production")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 3, true)
+ .addController("Front center")
+ .addCasingInfo("Sterile Farm Casing", 8)
+ .addInputBus("Any casing", 1)
+ .addOutputBus("Any casing", 1)
+ .addEnergyHatch("Any casing", 1)
+ .addMaintenanceHatch("Any casing", 1)
+ .addMufflerHatch("Any casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return CASING_TEXTURE_ID;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "VacuumFreezer";
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ // is correct part && either not powered tool or have enough power
+ if (TreeFarmHelper.isValidForGUI(aStack)
+ && GT_MetaGenerated_Tool.getToolDamage(aStack) < GT_MetaGenerated_Tool.getToolMaxDamage(aStack)) {
+ return GT_ModHandler.isElectricItem(aStack) ? GT_ModHandler.canUseElectricItem(aStack, 32) : true;
+ }
+ return false;
+ }
+
+ /**
+ * Method used to get the boost based on the ordinal of the saw
+ * @param sawType type of the saw
+ * @return an int corresponding to the boost
+ */
+ public int getSawBoost(SAWTOOL sawType) {
+ switch (sawType) {
+ case SAW:
+ return 1;
+ case BUZZSAW:
+ return 2;
+ case CHAINSAW:
+ return 4;
+ default:
+ return 1;
+ }
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ if (!isCorrectMachinePart(aStack) && !replaceTool()) return false;
+ if (!checkSapling()) return false;
+
+ this.mToolType = TreeFarmHelper.isCorrectMachinePart(aStack);
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ int aOutputAmount =
+ ((2 * (tTier * tTier)) - (2 * tTier) + 5) * (TICKS_PER_OPERATION / 20) * getSawBoost(mToolType);
+ int aFert = hasLiquidFert();
+ ItemStack[] toOutput;
+
+ if (aFert > 0) { // Sapling
+ if (aFert < aOutputAmount) {
+ aOutputAmount /= 10;
+ }
+ int amplifiedOutputAmount = (int) (aOutputAmount * saplingsModifier);
+ toOutput = new ItemStack[] {ItemUtils.getSimpleStack(mSapling, amplifiedOutputAmount)};
+ } else { // Log
+ int amplifiedOutputAmount = (int) (aOutputAmount * heightModifier * girthModifier);
+ toOutput = new ItemStack[] {ItemUtils.getSimpleStack(mWood, amplifiedOutputAmount)};
+ }
+
+ if (canBufferOutputs(toOutput, new FluidStack[] {}, 1) == 0) {
+ return false;
+ }
+
+ if (aFert > 0 && aFert >= aOutputAmount) {
+ tryConsumeLiquidFert(aOutputAmount);
+ }
+
+ this.mOutputItems = toOutput;
+
+ this.mMaxProgresstime = TICKS_PER_OPERATION;
+ this.mEUt = MaterialUtils.getVoltageForTier(tTier);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.tryDamageTool();
+ this.updateSlots();
+ return true;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 8 && checkHatch();
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntityTreeFarm> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntityTreeFarm>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"C~C", "C-C", "CCC"},
+ {"CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntityTreeFarm.class)
+ .atLeast(
+ InputHatch,
+ OutputHatch,
+ InputBus,
+ OutputBus,
+ Maintenance,
+ Energy.or(TTEnergy),
+ Muffler)
+ .casingIndex(CASING_TEXTURE_ID)
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 15))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiTreeFarm;
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack aStack) {
+ return MathUtils.balance(
+ (int) (75 - ((GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).getMass()))), 5, 120);
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ private boolean tryDamageTool() {
+ GT_ModHandler.damageOrDechargeItem(this.mInventory[1], 1, 32, null);
+ return replaceTool();
+ }
+
+ public boolean replaceTool() {
+ ItemStack invItem = this.mInventory[1];
+ if (isCorrectMachinePart(invItem)) return true;
+ else {
+ if (invItem != null) {
+ this.mInventory[1] = null;
+ this.addOutput(invItem);
+ }
+
+ for (ItemStack aStack : getStoredInputs()) {
+ if (isCorrectMachinePart(aStack)) {
+ this.mInventory[1] = aStack.copy();
+ this.depleteInput(aStack);
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean checkSapling() {
+ for (ItemStack uStack : this.getStoredInputs()) {
+
+ if (uStack != null) {
+ String registryName = Item.itemRegistry.getNameForObject(uStack.getItem());
+ ItemStack aWood = sLogCache.get(registryName + ":" + uStack.getItemDamage());
+
+ if (aWood != null) {
+ this.heightModifier = 1.0f;
+ this.saplingsModifier = 1.0f;
+ this.girthModifier = 1;
+
+ this.mSapling = uStack;
+ this.mWood = aWood;
+ return true;
+ } else {
+ if (registryName.equals("Forestry:sapling")) {
+
+ ITree tree = TreeManager.treeRoot.getMember(uStack);
+
+ this.heightModifier = Math.max(3 * (tree.getGenome().getHeight() - 1), 0) + 1;
+ this.saplingsModifier = Math.max(tree.getGenome().getFertility() * 20, 1);
+ this.girthModifier = tree.getGenome().getGirth();
+ boolean fireproof = ((IAlleleBoolean) tree.getGenome()
+ .getChromosomes()[EnumTreeChromosome.FIREPROOF.ordinal()]
+ .getActiveAllele())
+ .getValue();
+
+ aWood = sLogCache.get(tree.getIdent() + (fireproof ? "fireproof" : ""));
+
+ this.mSapling = uStack;
+ this.mWood = aWood;
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public static void loadMapWoodFromSapling() {
+
+ // galaxySpace
+ mapSaplingToLog(
+ "GalaxySpace:barnardaCsapling:1",
+ GT_ModHandler.getModItem("GalaxySpace", "barnardaClog", 1)); // barnarda c
+
+ // minecraft
+ mapSaplingToLog("minecraft:sapling:0", new ItemStack(Blocks.log, 1, 0)); // oak
+ mapSaplingToLog("minecraft:sapling:1", new ItemStack(Blocks.log, 1, 1)); // spruce
+ mapSaplingToLog("minecraft:sapling:2", new ItemStack(Blocks.log, 1, 2)); // birch
+ mapSaplingToLog("minecraft:sapling:3", new ItemStack(Blocks.log, 1, 3)); // jungle
+ mapSaplingToLog("minecraft:sapling:4", new ItemStack(Blocks.log2, 1, 0)); // acacia
+ mapSaplingToLog("minecraft:sapling:5", new ItemStack(Blocks.log2, 1, 1)); // dark oak
+
+ // ic2
+ mapSaplingToLog("IC2:blockRubSapling:0", GT_ModHandler.getModItem("IC2", "blockRubWood", 1)); // rubber
+
+ // natura
+ mapSaplingToLog("Natura:florasapling:0", GT_ModHandler.getModItem("Natura", "redwood", 1, 1)); // redwood
+ mapSaplingToLog("Natura:florasapling:1", GT_ModHandler.getModItem("Natura", "tree", 1, 0)); // eucalyptus
+ mapSaplingToLog("Natura:florasapling:2", GT_ModHandler.getModItem("Natura", "tree", 1, 3)); // hopseed
+ mapSaplingToLog("Natura:florasapling:3", GT_ModHandler.getModItem("Natura", "tree", 1, 1)); // sakura
+ mapSaplingToLog("Natura:florasapling:4", GT_ModHandler.getModItem("Natura", "tree", 1, 2)); // ghostwood
+ mapSaplingToLog("Natura:florasapling:5", GT_ModHandler.getModItem("Natura", "bloodwood", 1, 0)); // bloodwood
+ mapSaplingToLog("Natura:florasapling:6", GT_ModHandler.getModItem("Natura", "Dark Tree", 1, 0)); // darkwood
+ mapSaplingToLog("Natura:florasapling:7", GT_ModHandler.getModItem("Natura", "Dark Tree", 1, 1)); // fusewood
+
+ mapSaplingToLog("Natura:Rare Sapling:0", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 0)); // maple
+ mapSaplingToLog("Natura:Rare Sapling:1", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 1)); // silverbell
+ mapSaplingToLog("Natura:Rare Sapling:2", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 2)); // amaranth
+ mapSaplingToLog("Natura:Rare Sapling:3", GT_ModHandler.getModItem("Natura", "Rare Tree", 1, 3)); // tigerwood
+ mapSaplingToLog("Natura:Rare Sapling:4", GT_ModHandler.getModItem("Natura", "willow", 1, 0)); // willow
+
+ // BOP
+ mapSaplingToLog(
+ "BiomesOPlenty:colorizedSaplings:0",
+ GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 0)); // Sacred Oak
+ mapSaplingToLog(
+ "BiomesOPlenty:colorizedSaplings:1",
+ GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 2)); // Mangrove
+ mapSaplingToLog(
+ "BiomesOPlenty:colorizedSaplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 3)); // Palm
+ mapSaplingToLog(
+ "BiomesOPlenty:colorizedSaplings:3",
+ GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 0)); // Redwood
+ mapSaplingToLog(
+ "BiomesOPlenty:colorizedSaplings:4",
+ GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 1)); // Willow
+ mapSaplingToLog(
+ "BiomesOPlenty:colorizedSaplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 0)); // Pine
+ mapSaplingToLog(
+ "BiomesOPlenty:colorizedSaplings:6",
+ GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 3)); // Mahogany
+ mapSaplingToLog(
+ "BiomesOPlenty:saplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "bamboo", 1, 0)); // Bamboo
+ mapSaplingToLog("BiomesOPlenty:saplings:3", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 1)); // Magic
+ mapSaplingToLog("BiomesOPlenty:saplings:4", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 2)); // Dark
+ mapSaplingToLog(
+ "BiomesOPlenty:saplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 2)); // Dying/Dead
+ mapSaplingToLog("BiomesOPlenty:saplings:6", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 3)); // Fir
+ mapSaplingToLog(
+ "BiomesOPlenty:saplings:7", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 0)); // Ethereal
+ mapSaplingToLog(
+ "BiomesOPlenty:saplings:10", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // Pink Cherry
+ mapSaplingToLog(
+ "BiomesOPlenty:saplings:12", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // White Cherry
+ mapSaplingToLog(
+ "BiomesOPlenty:saplings:13", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 1)); // Hellbark
+ mapSaplingToLog(
+ "BiomesOPlenty:saplings:14", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 2)); // Jacaranda
+ mapSaplingToLog(
+ "minecraft:yellow_flower:0",
+ GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant Flower Stem
+ mapSaplingToLog(
+ "minecraft:red_flower:0",
+ GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant Flower Stem
+
+ // Witchery
+ mapSaplingToLog("witchery:witchsapling:0", GT_ModHandler.getModItem("witchery", "witchlog", 1, 0)); // Rowan
+ mapSaplingToLog("witchery:witchsapling:1", GT_ModHandler.getModItem("witchery", "witchlog", 1, 1)); // Alder
+ mapSaplingToLog("witchery:witchsapling:2", GT_ModHandler.getModItem("witchery", "witchlog", 1, 2)); // Hawthorn
+
+ // TConstruct
+ mapSaplingToLog(
+ "TConstruct:slime.sapling:0",
+ GT_ModHandler.getModItem("TConstruct", "slime.gel", 1)); // green slime blocks
+
+ // TaintedMagic
+ mapSaplingToLog(
+ "TaintedMagic:BlockWarpwoodSapling:0",
+ GT_ModHandler.getModItem("TaintedMagic", "BlockWarpwoodLog", 1)); // warpwood
+
+ // Thaumcraft
+ mapSaplingToLog(
+ "Thaumcraft:blockCustomPlant:0",
+ GT_ModHandler.getModItem("Thaumcraft", "blockMagicalLog", 1, 0)); // greatwood
+ mapSaplingToLog(
+ "Thaumcraft:blockCustomPlant:1",
+ GT_ModHandler.getModItem("Thaumcraft", "blockMagicalLog", 1, 1)); // silverwood
+
+ // gt++
+ mapSaplingToLog(
+ "miscutils:blockRainforestOakSapling:0",
+ GT_ModHandler.getModItem("miscutils", "blockRainforestOakLog", 1)); // rainforest
+ mapSaplingToLog(
+ "miscutils:blockPineSapling:0", GT_ModHandler.getModItem("miscutils", "blockPineLogLog", 1)); // pine
+
+ // Harvestcraft
+ mapSaplingToLog("harvestcraft:pampistachioSapling:0", new ItemStack(Blocks.log, 1, 3)); // Pistachio
+ mapSaplingToLog("harvestcraft:pampapayaSapling:0", new ItemStack(Blocks.log, 1, 3)); // Papaya
+ mapSaplingToLog(
+ "harvestcraft:pammapleSapling:0", GT_ModHandler.getModItem("harvestcraft", "pamMaple", 1)); // Maple
+ mapSaplingToLog("harvestcraft:pamappleSapling:0", new ItemStack(Blocks.log, 1, 0)); // Apple
+ mapSaplingToLog("harvestcraft:pamdateSapling:0", new ItemStack(Blocks.log, 1, 3)); // Date
+ mapSaplingToLog("harvestcraft:pamorangeSapling:0", new ItemStack(Blocks.log, 1, 3)); // Orange
+ mapSaplingToLog("harvestcraft:pamdragonfruitSapling:0", new ItemStack(Blocks.log, 1, 3)); // Dragon fruit
+ mapSaplingToLog("harvestcraft:pamnutmegSapling:0", new ItemStack(Blocks.log, 1, 0)); // NutMeg
+ mapSaplingToLog(
+ "harvestcraft:pampaperbarkSapling:0",
+ GT_ModHandler.getModItem("harvestcraft", "pamPaperbark", 1)); // Paperbark
+ mapSaplingToLog("harvestcraft:pammangoSapling:0", new ItemStack(Blocks.log, 1, 3)); // Mango
+ mapSaplingToLog("harvestcraft:pamavocadoSapling:0", new ItemStack(Blocks.log, 1, 0)); // Avocado
+ mapSaplingToLog("harvestcraft:pamchestnutSapling:0", new ItemStack(Blocks.log, 1, 0)); // Chestnut
+ mapSaplingToLog("harvestcraft:pampeppercornSapling:0", new ItemStack(Blocks.log, 1, 3)); // Peppercorn
+ mapSaplingToLog("harvestcraft:pampecanSapling:0", new ItemStack(Blocks.log, 1, 3)); // Pecan
+ mapSaplingToLog("harvestcraft:pamcashewSapling:0", new ItemStack(Blocks.log, 1, 3)); // Cashew
+ mapSaplingToLog("harvestcraft:pamfigSapling:0", new ItemStack(Blocks.log, 1, 3)); // Fig
+ mapSaplingToLog("harvestcraft:pamoliveSapling:0", new ItemStack(Blocks.log, 1, 3)); // Olive
+ mapSaplingToLog(
+ "harvestcraft:pamcinnamonSapling:0",
+ GT_ModHandler.getModItem("harvestcraft", "pamCinnamon", 1)); // Cinnamon
+ mapSaplingToLog("harvestcraft:pampeachSapling:0", new ItemStack(Blocks.log, 1, 3)); // Peach
+ mapSaplingToLog("harvestcraft:pamlemonSapling:0", new ItemStack(Blocks.log, 1, 3)); // Lemon
+ mapSaplingToLog("harvestcraft:pamvanillabeanSapling:0", new ItemStack(Blocks.log, 1, 3)); // Vanilla
+ mapSaplingToLog("harvestcraft:pamalmondSapling:0", new ItemStack(Blocks.log, 1, 3)); // Almond
+ mapSaplingToLog("harvestcraft:pambananaSapling:0", new ItemStack(Blocks.log, 1, 3)); // Banana
+ mapSaplingToLog("harvestcraft:pamdurianSapling:0", new ItemStack(Blocks.log, 1, 3)); // Durian
+ mapSaplingToLog("harvestcraft:pamplumSapling:0", new ItemStack(Blocks.log, 1, 0)); // Plum
+ mapSaplingToLog("harvestcraft:pamlimeSapling:0", new ItemStack(Blocks.log, 1, 3)); // Lime
+ mapSaplingToLog("harvestcraft:pampearSapling:0", new ItemStack(Blocks.log, 1, 0)); // Pear
+ mapSaplingToLog("harvestcraft:pamgooseberrySapling:0", new ItemStack(Blocks.log, 1, 0)); // Gooseberry
+ mapSaplingToLog("harvestcraft:pamcherrySapling:0", new ItemStack(Blocks.log, 1, 0)); // Cherry
+ mapSaplingToLog("harvestcraft:pampomegranateSapling:0", new ItemStack(Blocks.log, 1, 3)); // Pomegranate
+ mapSaplingToLog("harvestcraft:pamwalnutSapling:0", new ItemStack(Blocks.log, 1, 0)); // Walnut
+ mapSaplingToLog("harvestcraft:pampersimmonSapling:0", new ItemStack(Blocks.log, 1, 3)); // Persimmon
+ mapSaplingToLog("harvestcraft:pamapricotSapling:0", new ItemStack(Blocks.log, 1, 3)); // Apricot
+ mapSaplingToLog("harvestcraft:pamcoconutSapling:0", new ItemStack(Blocks.log, 1, 3)); // Coconut
+ mapSaplingToLog("harvestcraft:pamgrapefruitSapling:0", new ItemStack(Blocks.log, 1, 3)); // Grapefruit
+ mapSaplingToLog("harvestcraft:pamstarfruitSapling:0", new ItemStack(Blocks.log, 1, 3)); // Starfruit
+
+ // Harvest The Nether
+ mapSaplingToLog(
+ "harvestthenether:netherSapling:0",
+ GT_ModHandler.getModItem("harvestthenether", "netherLog", 1)); // Nether
+
+ // The Twilight Forest
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:0",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 0)); // Sickly Twilight Oak
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:1",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 1)); // Canopy Tree
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:2",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 2)); // Twilight Mangrove
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:3",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 3)); // Darkwood
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:4",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 0)); // Robust Twilight Oad
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:5",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFMagicLog", 1, 0)); // Tree of Time
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:6",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFMagicLog", 1, 1)); // Tree of Trasformation
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:7",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFMagicLog", 1, 2)); // Miner's Tree
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:8",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFMagicLog", 1, 3)); // Sorting Tree
+ mapSaplingToLog(
+ "TwilightForest:tile.TFSapling:9",
+ GT_ModHandler.getModItem("TwilightForest", "tile.TFLog", 1, 0)); // Rainbow Oak
+
+ // Thaumic Bases
+ mapSaplingToLog("thaumicbases:goldenOakSapling:0", new ItemStack(Blocks.log, 1, 0)); // Golden Oak
+ mapSaplingToLog(
+ "thaumicbases:goldenOakSapling:1",
+ GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 0)); // Peaceful
+ mapSaplingToLog(
+ "thaumicbases:goldenOakSapling:2", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 1)); // Nether
+ mapSaplingToLog(
+ "thaumicbases:goldenOakSapling:3", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 2)); // Ender
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ public static void mapSaplingToLog(String aSapling, ItemStack aLog) {
+ ItemStack aSaplingStack = ItemUtils.getItemStackFromFQRN(aSapling, 1);
+ if (aSaplingStack != null && aLog != null) {
+ sLogCache.put(aSapling, aLog);
+ addFakeRecipeToNEI(aSaplingStack, aLog);
+ } else {
+ Logger.INFO("Unable to add Tree Growth Simulation for " + aSapling);
+ }
+ }
+
+ private static int sRecipeID = 0;
+
+ public static boolean addFakeRecipeToNEI(@Nonnull ItemStack aSapling, ItemStack aLog) {
+ int aRecipes = GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size();
+ Logger.INFO("Adding Tree Growth Simulation for " + aSapling.getDisplayName() + " -> "
+ + (aLog == null ? "NULL" : aLog.getDisplayName()));
+ ItemStack[] aOutput = new ItemStack[] {aLog, aSapling};
+ String aOutputs = ItemUtils.getArrayStackNames(aOutput);
+ Logger.INFO("" + aOutputs);
+ GTPP_Recipe_Map.sTreeSimFakeRecipes.addFakeRecipe(
+ false,
+ new ItemStack[] {aSapling.copy()},
+ aOutput,
+ null,
+ new int[] {10000, 1000},
+ new FluidStack[] {FluidUtils.getFluidStack(ModItems.fluidFertBasic, 1)},
+ new FluidStack[] {},
+ 1,
+ sRecipeID++,
+ 0);
+ return GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size() > aRecipes;
+ }
+
+ public int hasLiquidFert() {
+ ArrayList<FluidStack> aFluids = this.getStoredFluids();
+ for (FluidStack aFluid : aFluids) {
+ if (aFluid.getFluid().equals(ModItems.fluidFertBasic)) {
+ return aFluid.amount;
+ }
+ }
+ return 0;
+ }
+
+ public boolean tryConsumeLiquidFert(int aFluidAmount) {
+ return this.depleteInput(FluidUtils.getFluidStack(ModItems.fluidFertBasic, aFluidAmount));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java
index 8c986db704..6781f130b2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -24,6 +27,8 @@ import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
@@ -32,42 +37,36 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraftforge.fluids.FluidStack;
+public class GregtechMetaTileEntity_AlloyBlastSmelter
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_AlloyBlastSmelter>
+ implements ISurvivalConstructable {
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_AlloyBlastSmelter extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_AlloyBlastSmelter> implements ISurvivalConstructable {
-
- private int mMode = 0;
- private boolean isUsingControllerCircuit = false;
- private boolean isBussesSeparate = false;
- private static Item circuit;
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_AlloyBlastSmelter> STRUCTURE_DEFINITION = null;
-
+ private int mMode = 0;
+ private boolean isUsingControllerCircuit = false;
+ private boolean isBussesSeparate = false;
+ private static Item circuit;
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_AlloyBlastSmelter> STRUCTURE_DEFINITION = null;
- public GregtechMetaTileEntity_AlloyBlastSmelter(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
+ public GregtechMetaTileEntity_AlloyBlastSmelter(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
- public GregtechMetaTileEntity_AlloyBlastSmelter(final String aName) {
- super(aName);
- }
+ public GregtechMetaTileEntity_AlloyBlastSmelter(final String aName) {
+ super(aName);
+ }
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_AlloyBlastSmelter(this.mName);
- }
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_AlloyBlastSmelter(this.mName);
+ }
- @Override
- public String getMachineType() {
- return "Fluid Alloy Cooker";
- }
+ @Override
+ public String getMachineType() {
+ return "Fluid Alloy Cooker";
+ }
- @Override
+ @Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
aNBT.setBoolean("isBussesSeparate", isBussesSeparate);
@@ -79,278 +78,280 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter extends GregtechMeta_Multi
isBussesSeparate = aNBT.getBoolean("isBussesSeparate");
}
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Alloy Blast Smelter")
- .addInfo("20% Faster than the Electric Blast Furnace")
- .addInfo("Allows Complex GT++ alloys to be created")
- .addInfo("Accepts only one Energy Hatch")
- .addInfo("Circuit for recipe goes in the Input Bus or GUI slot")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 4, 3, true)
- .addController("Bottom Center")
- .addCasingInfo("Blast Smelter Casings", 10)
- .addCasingInfo("Blast Smelter Heat Containment Coils", 16)
- .addInputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_AlloyBlastSmelter> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_AlloyBlastSmelter>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"HHH", "H-H", "HHH"},
- {"HHH", "H-H", "HHH"},
- {"C~C", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_AlloyBlastSmelter.class)
- .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler)
- .casingIndex(TAE.GTPP_INDEX(15))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 15)))
- )
- .addElement(
- 'H',
- ofBlock(
- ModBlocks.blockCasingsMisc, 14
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 3, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 1, 3, 0) && mCasing >= 10 && mEnergyHatches.size() == 1 && checkHatch();
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(208));
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(15);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "ElectricBlastFurnace";
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes;
- }
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- if (this.getBaseMetaTileEntity().isServerSide()) {
- //Get Controller Circuit
- if (circuit == null) {
- circuit = CI.getNumberedCircuit(0).getItem();
- }
- if (aStack != null && aStack.getItem() == circuit) {
- this.mMode = aStack.getItemDamage();
- return this.isUsingControllerCircuit = true;
- }
- else {
- if (aStack == null) {
- this.isUsingControllerCircuit = false;
- return true; //Allowed empty
- }
- Logger.WARNING("Not circuit in GUI inputs.");
- return this.isUsingControllerCircuit = false;
- }
- }
- Logger.WARNING("No Circuit, clientside.");
- return this.isUsingControllerCircuit = false;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
-
- if (this.getBaseMetaTileEntity().isServerSide()) {
-
- ArrayList<ItemStack> tInputList = null;
- //Get Controller Circuit
- this.isUsingControllerCircuit = isCorrectMachinePart(aStack);
-
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- ItemStack[] tInputs = null;
- final FluidStack[] tFluids = getCompactedFluids();
- GT_Recipe tRecipe = null;
-
- if (isBussesSeparate) {
- for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
- tInputList = new ArrayList<>();
- tBus.mRecipeMap = getRecipeMap();
-
- if (isValidMetaTileEntity(tBus)) {
- for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) {
- tInputList.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- }
- tInputs = tInputList.toArray(new ItemStack[0]);
- tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if ((tRecipe != null)) {
- break;
- }
- }
- } else {
- tInputList = this.getStoredInputs();
- for (int i = 0; i < (tInputList.size() - 1); i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
- tInputList.remove(j--);
- } else {
- tInputList.remove(i--);
- break;
- }
- }
- }
- }
- tInputs = tInputList.toArray(new ItemStack[0]);
- tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- }
-
- //Validity check
- if ((isUsingControllerCircuit && tInputList.size() < 1) || (!isUsingControllerCircuit && tInputList.size() < 2)) {
- Logger.WARNING("Not enough inputs.");
- return false;
- }
- else if (isUsingControllerCircuit && tInputList.size() >= 1) {
- tInputList.add(CI.getNumberedCircuit(this.mMode));
- }
-
- if (tInputList.size() > 1) {
- if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
- Logger.WARNING("Found some Valid Inputs.");
- this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000));
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = (tRecipe.mEUt * (1 << (tTier - 1)) * (1 << (tTier - 1)));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << (tTier - 1)));
- } else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
- List<ItemStack> tOutPutItems = new ArrayList<ItemStack>();
- for (ItemStack tOut : tRecipe.mOutputs) {
- if (ItemUtils.checkForInvalidItems(tOut)) {
- tOutPutItems.add(tOut);
- }
- }
- if (tOutPutItems.size() > 0)
- this.mOutputItems = tOutPutItems.toArray(new ItemStack[tOutPutItems.size()]);
- this.updateSlots();
- return true;
- }
- }
- }
- Logger.WARNING("Failed to find some Valid Inputs or Clientside.");
- return false;
- }
-
- @Override
- public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- isBussesSeparate = !isBussesSeparate;
- GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate);
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Alloy Blast Smelter")
+ .addInfo("20% Faster than the Electric Blast Furnace")
+ .addInfo("Allows Complex GT++ alloys to be created")
+ .addInfo("Accepts only one Energy Hatch")
+ .addInfo("Circuit for recipe goes in the Input Bus or GUI slot")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 4, 3, true)
+ .addController("Bottom Center")
+ .addCasingInfo("Blast Smelter Casings", 10)
+ .addCasingInfo("Blast Smelter Heat Containment Coils", 16)
+ .addInputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_AlloyBlastSmelter> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_AlloyBlastSmelter>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"HHH", "H-H", "HHH"},
+ {"HHH", "H-H", "HHH"},
+ {"C~C", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_AlloyBlastSmelter.class)
+ .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler)
+ .casingIndex(TAE.GTPP_INDEX(15))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 15))))
+ .addElement('H', ofBlock(ModBlocks.blockCasingsMisc, 14))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 3, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 1, 3, 0) && mCasing >= 10 && mEnergyHatches.size() == 1 && checkHatch();
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(208));
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(15);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "ElectricBlastFurnace";
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ // Get Controller Circuit
+ if (circuit == null) {
+ circuit = CI.getNumberedCircuit(0).getItem();
+ }
+ if (aStack != null && aStack.getItem() == circuit) {
+ this.mMode = aStack.getItemDamage();
+ return this.isUsingControllerCircuit = true;
+ } else {
+ if (aStack == null) {
+ this.isUsingControllerCircuit = false;
+ return true; // Allowed empty
+ }
+ Logger.WARNING("Not circuit in GUI inputs.");
+ return this.isUsingControllerCircuit = false;
+ }
+ }
+ Logger.WARNING("No Circuit, clientside.");
+ return this.isUsingControllerCircuit = false;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+
+ ArrayList<ItemStack> tInputList = null;
+ // Get Controller Circuit
+ this.isUsingControllerCircuit = isCorrectMachinePart(aStack);
+
+ final long tVoltage = this.getMaxInputVoltage();
+ final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ ItemStack[] tInputs = null;
+ final FluidStack[] tFluids = getCompactedFluids();
+ GT_Recipe tRecipe = null;
+
+ if (isBussesSeparate) {
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ tInputList = new ArrayList<>();
+ tBus.mRecipeMap = getRecipeMap();
+
+ if (isValidMetaTileEntity(tBus)) {
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) {
+ tInputList.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ tInputs = tInputList.toArray(new ItemStack[0]);
+ tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(
+ this.getBaseMetaTileEntity(),
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ tFluids,
+ tInputs);
+ if ((tRecipe != null)) {
+ break;
+ }
+ }
+ } else {
+ tInputList = this.getStoredInputs();
+ for (int i = 0; i < (tInputList.size() - 1); i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
+ if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ tInputs = tInputList.toArray(new ItemStack[0]);
+ tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(
+ this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ }
+
+ // Validity check
+ if ((isUsingControllerCircuit && tInputList.size() < 1)
+ || (!isUsingControllerCircuit && tInputList.size() < 2)) {
+ Logger.WARNING("Not enough inputs.");
+ return false;
+ } else if (isUsingControllerCircuit && tInputList.size() >= 1) {
+ tInputList.add(CI.getNumberedCircuit(this.mMode));
+ }
+
+ if (tInputList.size() > 1) {
+ if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ Logger.WARNING("Found some Valid Inputs.");
+ this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000));
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << (tTier - 1)) * (1 << (tTier - 1)));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << (tTier - 1)));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)};
+ List<ItemStack> tOutPutItems = new ArrayList<ItemStack>();
+ for (ItemStack tOut : tRecipe.mOutputs) {
+ if (ItemUtils.checkForInvalidItems(tOut)) {
+ tOutPutItems.add(tOut);
+ }
+ }
+ if (tOutPutItems.size() > 0)
+ this.mOutputItems = tOutPutItems.toArray(new ItemStack[tOutPutItems.size()]);
+ this.updateSlots();
+ return true;
+ }
+ }
+ }
+ Logger.WARNING("Failed to find some Valid Inputs or Clientside.");
+ return false;
+ }
+
+ @Override
+ public boolean onWireCutterRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ isBussesSeparate = !isBussesSeparate;
+ GT_Utility.sendChatToPlayer(
+ aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate);
return true;
}
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiABS;
- }
-
- @Override
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 2;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiABS;
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
index 84553fb02c..ec90d8d71d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
@@ -1,6 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -22,6 +26,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
@@ -29,435 +34,411 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Cyclotron> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_Cyclotron> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_Cyclotron(int aID, String aName, String aNameRegional, int tier) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_Cyclotron(String aName) {
- super(aName);
- }
-
- @Override
- public String getMachineType() {
- return "Particle Accelerator";
- }
-
- public int tier(){
- return 5;
- }
-
- @Override
- public long maxEUStore() {
- return 1800000000L;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return super.getServerGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
- //return new CONTAINER_Cyclotron(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
- //return new GUI_Cyclotron(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), Recipe_GT.Gregtech_Recipe_Map.sCyclotronRecipes.mNEIName);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_Cyclotron(this.mName);
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
- return aSide != getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_Cyclotron> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Cyclotron>builder()
- .addShape(mName, transpose(new String[][]{
- {
- " ",
- " hhh ",
- " hh hh ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " hh hh ",
- " hhh ",
- " ",
- },
- {
- " hhh ",
- " hhccchh ",
- " hcchhhcch ",
- " hchh hhch ",
- " hch hch ",
- " hch hch ",
- "hch hch",
- "hch hch",
- "hch hch",
- " hch hch ",
- " hch hch ",
- " hchh hhch ",
- " hcch~hcch ",
- " hhccchh ",
- " hhh ",
- },
- {
- " ",
- " hhh ",
- " hh hh ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " h h ",
- " hh hh ",
- " hhh ",
- " ",
- }
- }))
- .addElement(
- 'h',
- buildHatchAdder(GregtechMetaTileEntity_Cyclotron.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
- .casingIndex(44)
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))
- )
- .addElement(
- 'c',
- ofBlock(
- getCyclotronCoil(), getCyclotronCoilMeta()
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 7, 1, 12);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 7, 1, 12, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 7, 1, 12) && mCasing >= 40 && checkHatch();
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasings2Misc;
- }
-
- public int getCasingMeta() {
- return 10;
- }
-
- public Block getCyclotronCoil() {
- return ModBlocks.blockCasings2Misc;
- }
-
- public int getCyclotronCoilMeta() {
- return 9;
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Super Magnetic Speed Shooter")
- .addSeparator()
- .addInfo("Particles are accelerated over 186 revolutions to 80% light speed")
- .addInfo("Can produce a continuous beam current of 2.2 mA at 590 MeV")
- .addInfo("Which will be extracted from the Isochronous Cyclotron")
- .addSeparator()
- .addInfo("Consists of the same layout as a Fusion Reactor")
- .addInfo("Any external casing can be a hatch/bus, unlike Fusion")
- .addInfo("Cyclotron Machine Casings around Cyclotron Coil Blocks")
- .addInfo("All Hatches must be IV or better")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .addCasingInfo("Cyclotron Machine Casings", 40)
- .addCasingInfo("Cyclotron Coil", 32)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return getIconOverlay();
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return getIconOverlay();
- }
-
- @Override
- protected int getCasingTextureId() {
- return 44;
- }
-
- public IIconContainer getIconOverlay() {
- if (this.getBaseMetaTileEntity().isActive()){
- return TexturesGtBlock.Overlay_MatterFab_Active_Animated;
- }
- return TexturesGtBlock.Overlay_MatterFab_Animated;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
-
- /*if (CORE.DEVENV) {
- return this.checkRecipeGeneric();
- }*/
- this.fixAllMaintenanceIssue();
-
- //log("Recipe Check.");
- ArrayList<ItemStack> tItemList = getStoredInputs();
- ItemStack[] tItemInputs = tItemList.toArray(new ItemStack[tItemList.size()]);
- ArrayList<FluidStack> tInputList = getStoredFluids();
- FluidStack[] tFluidInputs = tInputList.toArray(new FluidStack[tInputList.size()]);
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-
- GT_Recipe tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.findRecipe(getBaseMetaTileEntity(), false,
- gregtech.api.enums.GT_Values.V[tTier], tFluidInputs, tItemInputs);
- if (tRecipe != null){
- if (tRecipe.isRecipeInputEqual(true, tFluidInputs, tItemInputs)) {
-
- this.mEfficiency = (10000 - ((getIdealStatus() - getRepairStatus()) * 1000));
- this.mEfficiencyIncrease = 10000;
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
-
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- final ItemStack[] outputs = new ItemStack[tRecipe.mOutputs.length];
- for (int i = 0; i < tRecipe.mOutputs.length; i++){
- if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i)){
- Logger.WARNING("Adding a bonus output");
- outputs[i] = tRecipe.getOutput(i);
- }
- else {
- Logger.WARNING("Adding null output");
- outputs[i] = null;
- }
- }
-
- for (ItemStack s : outputs) {
- if (s != null) {
- if (s.getItem() instanceof IonParticles) {
- long aCharge = IonParticles.getChargeState(s);
- if (aCharge == 0) {
- IonParticles.setChargeState(s, MathUtils.getRandomFromArray(new int[] {
- -5, -5,
- -4, -4, -4,
- -3, -3, -3, -3, -3,
- -2, -2, -2, -2, -2, -2, -2,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4,
- 5, 5, 5,
- 6, 6}));
- }
- }
- }
- }
-
- this.mOutputItems = outputs;
- this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)};
- this.updateSlots();
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public boolean onRunningTick(ItemStack aStack) {
- if (this.mOutputBusses.size() > 0) {
- for (GT_MetaTileEntity_Hatch_OutputBus g : this.mOutputBusses) {
- if (g != null) {
- for (ItemStack s : g.mInventory) {
- if (s != null) {
- if (s.getItem() instanceof IonParticles) {
- long aCharge = IonParticles.getChargeState(s);
- if (aCharge == 0) {
- IonParticles.setChargeState(s, MathUtils.getRandomFromArray(new int[] {
- -5, -5,
- -4, -4, -4,
- -3, -3, -3, -3, -3,
- -2, -2, -2, -2, -2, -2, -2,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4,
- 5, 5, 5,
- 6, 6}));
- }
- }
- }
- }
- }
- }
- }
- this.fixAllMaintenanceIssue();
- return super.onRunningTick(aStack);
- }
-
-
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiCyclotron;
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- @Override
- public String[] getExtraInfoData() {
- String tier = tier() == 5 ? "I" : "II";
- float plasmaOut = 0;
- int powerRequired = 0;
- if (this.mLastRecipe != null) {
- powerRequired = this.mLastRecipe.mEUt;
- if (this.mLastRecipe.getFluidOutput(0) != null) {
- plasmaOut = (float)this.mLastRecipe.getFluidOutput(0).amount / (float)this.mLastRecipe.mDuration;
- }
- }
-
- return new String[]{
- "COMET - Compact Cyclotron MK "+tier,
- "EU Required: "+powerRequired+"EU/t",
- "Stored EU: "+this.getEUVar()+" / "+maxEUStore()};
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @SuppressWarnings("deprecation")
- public boolean turnCasingActive(final boolean status) {
- if (this.mEnergyHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Muffler hatch : this.mMufflerHatches) {
- hatch.mMachineBlock = status ? (byte) 44 : (byte) 44;
- }
- }
- if (this.mOutputHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) {
- hatch.mMachineBlock = status ? (byte) 44 : (byte) 44;
- }
- }
- if (this.mInputHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) {
- hatch.mMachineBlock = status ? (byte) 44 : (byte) 44;
- }
- }
- if (this.mMaintenanceHatches != null) {
- for (final GT_MetaTileEntity_Hatch_Maintenance hatch : this.mMaintenanceHatches) {
- hatch.mMachineBlock = status ? (byte) 44 : (byte) 44;
- }
- }
- return true;
- }
-} \ No newline at end of file
+public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Cyclotron>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_Cyclotron> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_Cyclotron(int aID, String aName, String aNameRegional, int tier) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_Cyclotron(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Particle Accelerator";
+ }
+
+ public int tier() {
+ return 5;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 1800000000L;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return super.getServerGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
+ // return new CONTAINER_Cyclotron(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
+ // return new GUI_Cyclotron(aPlayerInventory, aBaseMetaTileEntity, getLocalName(),
+ // Recipe_GT.Gregtech_Recipe_Map.sCyclotronRecipes.mNEIName);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_Cyclotron(this.mName);
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_Cyclotron> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Cyclotron>builder()
+ .addShape(mName, transpose(new String[][] {
+ {
+ " ",
+ " hhh ",
+ " hh hh ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " hh hh ",
+ " hhh ",
+ " ",
+ },
+ {
+ " hhh ",
+ " hhccchh ",
+ " hcchhhcch ",
+ " hchh hhch ",
+ " hch hch ",
+ " hch hch ",
+ "hch hch",
+ "hch hch",
+ "hch hch",
+ " hch hch ",
+ " hch hch ",
+ " hchh hhch ",
+ " hcch~hcch ",
+ " hhccchh ",
+ " hhh ",
+ },
+ {
+ " ",
+ " hhh ",
+ " hh hh ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " h h ",
+ " hh hh ",
+ " hhh ",
+ " ",
+ }
+ }))
+ .addElement(
+ 'h',
+ buildHatchAdder(GregtechMetaTileEntity_Cyclotron.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch)
+ .casingIndex(44)
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ .addElement('c', ofBlock(getCyclotronCoil(), getCyclotronCoilMeta()))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 7, 1, 12);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 7, 1, 12, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 7, 1, 12) && mCasing >= 40 && checkHatch();
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings2Misc;
+ }
+
+ public int getCasingMeta() {
+ return 10;
+ }
+
+ public Block getCyclotronCoil() {
+ return ModBlocks.blockCasings2Misc;
+ }
+
+ public int getCyclotronCoilMeta() {
+ return 9;
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Super Magnetic Speed Shooter")
+ .addSeparator()
+ .addInfo("Particles are accelerated over 186 revolutions to 80% light speed")
+ .addInfo("Can produce a continuous beam current of 2.2 mA at 590 MeV")
+ .addInfo("Which will be extracted from the Isochronous Cyclotron")
+ .addSeparator()
+ .addInfo("Consists of the same layout as a Fusion Reactor")
+ .addInfo("Any external casing can be a hatch/bus, unlike Fusion")
+ .addInfo("Cyclotron Machine Casings around Cyclotron Coil Blocks")
+ .addInfo("All Hatches must be IV or better")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .addCasingInfo("Cyclotron Machine Casings", 40)
+ .addCasingInfo("Cyclotron Coil", 32)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return getIconOverlay();
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return getIconOverlay();
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return 44;
+ }
+
+ public IIconContainer getIconOverlay() {
+ if (this.getBaseMetaTileEntity().isActive()) {
+ return TexturesGtBlock.Overlay_MatterFab_Active_Animated;
+ }
+ return TexturesGtBlock.Overlay_MatterFab_Animated;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+
+ /*if (CORE.DEVENV) {
+ return this.checkRecipeGeneric();
+ }*/
+ this.fixAllMaintenanceIssue();
+
+ // log("Recipe Check.");
+ ArrayList<ItemStack> tItemList = getStoredInputs();
+ ItemStack[] tItemInputs = tItemList.toArray(new ItemStack[tItemList.size()]);
+ ArrayList<FluidStack> tInputList = getStoredFluids();
+ FluidStack[] tFluidInputs = tInputList.toArray(new FluidStack[tInputList.size()]);
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ GT_Recipe tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.findRecipe(
+ getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs, tItemInputs);
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, tFluidInputs, tItemInputs)) {
+
+ this.mEfficiency = (10000 - ((getIdealStatus() - getRepairStatus()) * 1000));
+ this.mEfficiencyIncrease = 10000;
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ final ItemStack[] outputs = new ItemStack[tRecipe.mOutputs.length];
+ for (int i = 0; i < tRecipe.mOutputs.length; i++) {
+ if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i)) {
+ Logger.WARNING("Adding a bonus output");
+ outputs[i] = tRecipe.getOutput(i);
+ } else {
+ Logger.WARNING("Adding null output");
+ outputs[i] = null;
+ }
+ }
+
+ for (ItemStack s : outputs) {
+ if (s != null) {
+ if (s.getItem() instanceof IonParticles) {
+ long aCharge = IonParticles.getChargeState(s);
+ if (aCharge == 0) {
+ IonParticles.setChargeState(s, MathUtils.getRandomFromArray(new int[] {
+ -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1,
+ -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6
+ }));
+ }
+ }
+ }
+ }
+
+ this.mOutputItems = outputs;
+ this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)};
+ this.updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public boolean onRunningTick(ItemStack aStack) {
+ if (this.mOutputBusses.size() > 0) {
+ for (GT_MetaTileEntity_Hatch_OutputBus g : this.mOutputBusses) {
+ if (g != null) {
+ for (ItemStack s : g.mInventory) {
+ if (s != null) {
+ if (s.getItem() instanceof IonParticles) {
+ long aCharge = IonParticles.getChargeState(s);
+ if (aCharge == 0) {
+ IonParticles.setChargeState(s, MathUtils.getRandomFromArray(new int[] {
+ -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1,
+ -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6
+ }));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ this.fixAllMaintenanceIssue();
+ return super.onRunningTick(aStack);
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiCyclotron;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ String tier = tier() == 5 ? "I" : "II";
+ float plasmaOut = 0;
+ int powerRequired = 0;
+ if (this.mLastRecipe != null) {
+ powerRequired = this.mLastRecipe.mEUt;
+ if (this.mLastRecipe.getFluidOutput(0) != null) {
+ plasmaOut = (float) this.mLastRecipe.getFluidOutput(0).amount / (float) this.mLastRecipe.mDuration;
+ }
+ }
+
+ return new String[] {
+ "COMET - Compact Cyclotron MK " + tier,
+ "EU Required: " + powerRequired + "EU/t",
+ "Stored EU: " + this.getEUVar() + " / " + maxEUStore()
+ };
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @SuppressWarnings("deprecation")
+ public boolean turnCasingActive(final boolean status) {
+ if (this.mEnergyHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Muffler hatch : this.mMufflerHatches) {
+ hatch.mMachineBlock = status ? (byte) 44 : (byte) 44;
+ }
+ }
+ if (this.mOutputHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) {
+ hatch.mMachineBlock = status ? (byte) 44 : (byte) 44;
+ }
+ }
+ if (this.mInputHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) {
+ hatch.mMachineBlock = status ? (byte) 44 : (byte) 44;
+ }
+ }
+ if (this.mMaintenanceHatches != null) {
+ for (final GT_MetaTileEntity_Hatch_Maintenance hatch : this.mMaintenanceHatches) {
+ hatch.mMachineBlock = status ? (byte) 44 : (byte) 44;
+ }
+ }
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java
index d8ccaf13ef..5d817d587e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java
@@ -1,8 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
@@ -26,6 +29,9 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import ic2.core.init.BlocksItems;
import ic2.core.init.InternalName;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
@@ -35,578 +41,601 @@ import net.minecraft.util.WeightedRandomFishable;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFishingPond> implements ISurvivalConstructable {
-
- private boolean isUsingControllerCircuit = false;
- private static final Item circuit = CI.getNumberedCircuit(0).getItem();
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialFishingPond> STRUCTURE_DEFINITION = null;
- private static final Class<?> cofhWater;
-
- static {
- cofhWater = ReflectionUtils.getClass("cofh.asmhooks.block.BlockWater");
- }
-
- public GregtechMetaTileEntity_IndustrialFishingPond(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialFishingPond(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialFishingPond(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Fish Trap";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Fishing Pond")
- .addInfo("Can process (Tier + 1) * 2 recipes")
- .addInfo("Put a numbered circuit into the input bus.")
- .addInfo("Circuit 14 for Fish")
- .addInfo("Circuit 15 for Junk")
- .addInfo("Circuit 16 for Treasure")
- .addInfo("Need to be filled with water.")
- .addInfo("Will automatically fill water from input hatch.")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(9, 3, 9, true)
- .addController("Front Center")
- .addCasingInfo("Aquatic Casings", 64)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IAlignmentLimits getInitialAlignmentLimits() {
- // fuck
- return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialFishingPond> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialFishingPond>builder()
- .addShape(mName, transpose(new String[][]{
- {"XXXXXXXXX", "X X", "X X", "X X", "X X", "X X", "X X", "X X", "XXXXXXXXX"},
- {"XXXX~XXXX", "X X", "X X", "X X", "X X", "X X", "X X", "X X", "XXXXXXXXX"},
- {"XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX"},
- }))
- .addElement(
- 'X',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialFishingPond.class)
- .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 4, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 4, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 4, 1, 0) && mCasing >= 64 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER;
- }
-
- @Override
- protected int getCasingTextureId() {
- return getCasingTextureIndex();
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- if (aStack != null) {
- log("Found " + aStack.getDisplayName());
- if (aStack.getItem() == circuit) {
- this.isUsingControllerCircuit = true;
- this.mMode = aStack.getItemDamage();
- log("Found Circuit!");
- } else {
- this.isUsingControllerCircuit = false;
- }
- } else {
- this.isUsingControllerCircuit = false;
- }
- if (!hasGenerateRecipes) {
- log("Generating Recipes.");
- generateRecipes();
- }
- if (hasGenerateRecipes) {
- if (!checkForWater()) {
- return false;
- }
-
- log("Trying to run recipe.");
- ArrayList<ItemStack> tItems = getStoredInputs();
- ArrayList<FluidStack> tFluids = getStoredFluids();
- ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
- FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
-
- if (!isUsingControllerCircuit && tItems.size() == 0) {
- return false;
- }
-
- return checkRecipeGeneric(tItemInputs, tFluidInputs, getMaxParallelRecipes(), 100, 80, 100);
- }
- return true;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (2 * (GT_Utility.getTier(this.getMaxInputVoltage())+1));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialFishingPond;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasings3Misc;
- }
-
- public byte getCasingMeta() {
- return 0;
- }
-
- public int getCasingTextureIndex() {
- return TAE.GTPP_INDEX(32);
- }
-
- public boolean checkForWater() {
-
- // Get Facing direction
- IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
- int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int mCurrentDirectionX;
- int mCurrentDirectionZ;
- int mOffsetX_Lower = 0;
- int mOffsetX_Upper = 0;
- int mOffsetZ_Lower = 0;
- int mOffsetZ_Upper = 0;
-
- mCurrentDirectionX = 4;
- mCurrentDirectionZ = 4;
-
- mOffsetX_Lower = -4;
- mOffsetX_Upper = 4;
- mOffsetZ_Lower = -4;
- mOffsetZ_Upper = 4;
-
- // if (aBaseMetaTileEntity.fac)
-
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX
- * mCurrentDirectionX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ
- * mCurrentDirectionZ;
-
- int tAmount = 0;
- for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) {
- for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) {
- for (int h = 0; h < 2; h++) {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (isNotStaticWater(tBlock, tMeta)) {
- if (this.getStoredFluids() != null) {
- for (FluidStack stored : this.getStoredFluids()) {
- if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) {
- if (stored.amount >= 1000) {
- // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
- stored.amount -= 1000;
- Block fluidUsed = Blocks.water;
- aBaseMetaTileEntity.getWorld().setBlock(
- aBaseMetaTileEntity.getXCoord() + xDir + i,
- aBaseMetaTileEntity.getYCoord() + h,
- aBaseMetaTileEntity.getZCoord() + zDir + j, fluidUsed);
-
- }
- }
- }
- }
- }
- tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- if (tBlock == Blocks.water || tBlock == Blocks.flowing_water) {
- ++tAmount;
- // log("Found Water");
- }
- }
- }
- }
-
- boolean isValidWater = tAmount >= 60;
- if (isValidWater) {
- log("Filled structure.");
- }
- else {
- log("Did not fill structure.");
- }
- return isValidWater;
- }
-
- private boolean isNotStaticWater(Block block, byte meta) {
- return block == Blocks.air
- || block == Blocks.flowing_water
- || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)
- || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0);
- }
-
- private static AutoMap<AutoMap<WeightedRandomFishable>> categories = new AutoMap<AutoMap<WeightedRandomFishable>>();
- private static AutoMap<WeightedRandomFishable> categoryFish = new AutoMap<WeightedRandomFishable>();
- private static AutoMap<WeightedRandomFishable> categoryJunk = new AutoMap<WeightedRandomFishable>();
- private static AutoMap<WeightedRandomFishable> categoryLoot = new AutoMap<WeightedRandomFishable>();
- private static boolean hasGenerateRecipes = false;
- private int mMode = 14;
- private int mMax = 8;
-
- private boolean generateRecipes() {
- if (!hasGenerateRecipes) {
- categories.put(categoryFish);
- categories.put(categoryJunk);
- categories.put(categoryLoot);
- for (WeightedRandomFishable h : FishPondFakeRecipe.fish) {
- categoryFish.put(h);
- }
- for (WeightedRandomFishable h : FishPondFakeRecipe.junk) {
- categoryJunk.put(h);
- }
- for (WeightedRandomFishable h : FishPondFakeRecipe.treasure) {
- categoryLoot.put(h);
- }
- hasGenerateRecipes = true;
- return true;
- } else {
- return true;
- }
- }
-
- private int getCircuit(ItemStack[] t) {
- if (!this.isUsingControllerCircuit) {
- for (ItemStack j : t) {
- if (j.getItem() == CI.getNumberedCircuit(0).getItem()) {
- // Fish
- if (j.getItemDamage() == 14) {
- mMax = 8 + (this.getMaxParallelRecipes() - 2);
- this.mMode = 14;
- break;
- }
- // Junk
- else if (j.getItemDamage() == 15) {
- this.mMode = 15;
- mMax = 4;
- break;
- }
- // Loot
- else if (j.getItemDamage() == 16) {
- this.mMode = 16;
- mMax = 4;
- break;
- } else {
- this.mMode = 0;
- mMax = 0;
- break;
- }
- } else {
- this.mMode = 0;
- mMax = 0;
- break;
- }
- }
- }
- return this.mMode;
- }
-
- // reflection map
- private static Map<WeightedRandomFishable, ItemStack> reflectiveFishMap = new HashMap<WeightedRandomFishable, ItemStack>();
-
- private ItemStack reflectiveFish(WeightedRandomFishable y) {
- if (reflectiveFishMap.containsKey(y)) {
- return reflectiveFishMap.get(y);
- }
- ItemStack t;
- try {
- t = (ItemStack) ReflectionUtils.getField(WeightedRandomFishable.class, "field_150711_b").get(y);
- ItemStack k = ItemUtils.getSimpleStack(t, 1);
- reflectiveFishMap.put(y, k);
- return t;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- return null;
- }
-
- private ItemStack[] generateLoot(int mode) {
- ItemStack[] mFishOutput = new ItemStack[this.mMax];
- if (this.mMode == 14) {
- for (int k = 0; k < this.mMax; k++) {
- if (mFishOutput[k] == null)
- for (WeightedRandomFishable g : categoryFish.values()) {
- if (MathUtils.randInt(0, (65 - getMaxParallelRecipes())) <= 2) {
- ItemStack t = reflectiveFish(g);
- if (t != null) {
- mFishOutput[k] = ItemUtils.getSimpleStack(t, 1);
- }
- }
- }
- }
- } else if (this.mMode == 15) {
- for (int k = 0; k < this.mMax; k++) {
- if (mFishOutput[k] == null)
- for (WeightedRandomFishable g : categoryJunk.values()) {
- if (MathUtils.randInt(0, 100) <= 1) {
- ItemStack t = reflectiveFish(g);
- if (t != null) {
- mFishOutput[k] = ItemUtils.getSimpleStack(t, 1);
- }
- }
- }
- }
- } else if (this.mMode == 16) {
- for (int k = 0; k < this.mMax; k++) {
- if (mFishOutput[k] == null)
- for (WeightedRandomFishable g : categoryLoot.values()) {
- if (MathUtils.randInt(0, 1000) <= 2) {
- ItemStack t = reflectiveFish(g);
- if (t != null) {
- mFishOutput[k] = ItemUtils.getSimpleStack(t, 1);
- }
- }
- }
- }
- } else {
- mFishOutput = null;
- }
- return mFishOutput;
- }
-
- @Override
- public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes,
- long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
-
-
-
- //Control Core to control the Multiblocks behaviour.
- int aControlCoreTier = getControlCoreTier();
-
- //If no core, return false;
- if (aControlCoreTier == 0 && CORE.ConfigSwitches.requireControlCores) {
- log("Invalid/No Control Core");
- return false;
- }
-
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- //Check to see if Voltage Tier > Control Core Tier
- if (tTier > aControlCoreTier && CORE.ConfigSwitches.requireControlCores) {
- return false;
- }
-
- // Based on the Processing Array. A bit overkill, but very flexible.
- getCircuit(aItemInputs);
-
- /*
- * GT_Recipe tRecipe = this.getRecipeMap().findRecipe( getBaseMetaTileEntity(),
- * mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs,
- * aItemInputs);
- */
-
- ItemStack[] mFishOutput = generateLoot(this.mMode);
- mFishOutput = removeNulls(mFishOutput);
- GT_Recipe g = new GTPP_Recipe(true, new ItemStack[] {}, mFishOutput, null, new int[] {}, aFluidInputs, mOutputFluids, 200, 16, 0);
- aMaxParallelRecipes = this.canBufferOutputs(g, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("No Space");
- return false;
- }
-
- log("Mode: " + this.mMode + " | Is loot valid? " + (mFishOutput != null));
-
- int jslot = 0;
- for (ItemStack x : mFishOutput) {
- if (x != null) {
- log(
- "Slot " + jslot + " in mFishOutput contains " + x.stackSize + "x " + x.getDisplayName() + ".");
- } else {
- log("Slot " + jslot + " in mFishOutput was null.");
- }
- jslot++;
- }
-
- // EU discount
- float tRecipeEUt = (8 * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(20 * tTimeFactor * 4);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
-
- //Only Overclock as high as the control circuit.
- byte tTierOld = tTier;
- tTier = CORE.ConfigSwitches.requireControlCores ? (byte) aControlCoreTier : tTierOld;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
-
- log("Recipe Step. [3]");
- // Collect output item types
- ItemStack[] tOutputItems = mFishOutput;
-
- int rslot = 0;
- tOutputItems = removeNulls(mFishOutput);
-
- for (ItemStack x : tOutputItems) {
- if (x != null) {
- log(
- "rSlot " + rslot + " in mFishOutput contains " + x.stackSize + "x " + x.getDisplayName() + ".");
- } else {
- log("rSlot " + rslot + " in mFishOutput was null.");
- }
- rslot++;
- }
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- return true;
- }
-
-} \ No newline at end of file
+public class GregtechMetaTileEntity_IndustrialFishingPond
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFishingPond>
+ implements ISurvivalConstructable {
+
+ private boolean isUsingControllerCircuit = false;
+ private static final Item circuit = CI.getNumberedCircuit(0).getItem();
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialFishingPond> STRUCTURE_DEFINITION = null;
+ private static final Class<?> cofhWater;
+
+ static {
+ cofhWater = ReflectionUtils.getClass("cofh.asmhooks.block.BlockWater");
+ }
+
+ public GregtechMetaTileEntity_IndustrialFishingPond(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialFishingPond(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialFishingPond(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Fish Trap";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Fishing Pond")
+ .addInfo("Can process (Tier + 1) * 2 recipes")
+ .addInfo("Put a numbered circuit into the input bus.")
+ .addInfo("Circuit 14 for Fish")
+ .addInfo("Circuit 15 for Junk")
+ .addInfo("Circuit 16 for Treasure")
+ .addInfo("Need to be filled with water.")
+ .addInfo("Will automatically fill water from input hatch.")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(9, 3, 9, true)
+ .addController("Front Center")
+ .addCasingInfo("Aquatic Casings", 64)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IAlignmentLimits getInitialAlignmentLimits() {
+ // fuck
+ return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialFishingPond> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialFishingPond>builder()
+ .addShape(mName, transpose(new String[][] {
+ {
+ "XXXXXXXXX",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "XXXXXXXXX"
+ },
+ {
+ "XXXX~XXXX",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "XXXXXXXXX"
+ },
+ {
+ "XXXXXXXXX",
+ "XXXXXXXXX",
+ "XXXXXXXXX",
+ "XXXXXXXXX",
+ "XXXXXXXXX",
+ "XXXXXXXXX",
+ "XXXXXXXXX",
+ "XXXXXXXXX",
+ "XXXXXXXXX"
+ },
+ }))
+ .addElement(
+ 'X',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialFishingPond.class)
+ .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 4, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 4, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 4, 1, 0) && mCasing >= 64 && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return getCasingTextureIndex();
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ if (aStack != null) {
+ log("Found " + aStack.getDisplayName());
+ if (aStack.getItem() == circuit) {
+ this.isUsingControllerCircuit = true;
+ this.mMode = aStack.getItemDamage();
+ log("Found Circuit!");
+ } else {
+ this.isUsingControllerCircuit = false;
+ }
+ } else {
+ this.isUsingControllerCircuit = false;
+ }
+ if (!hasGenerateRecipes) {
+ log("Generating Recipes.");
+ generateRecipes();
+ }
+ if (hasGenerateRecipes) {
+ if (!checkForWater()) {
+ return false;
+ }
+
+ log("Trying to run recipe.");
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
+ FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
+
+ if (!isUsingControllerCircuit && tItems.size() == 0) {
+ return false;
+ }
+
+ return checkRecipeGeneric(tItemInputs, tFluidInputs, getMaxParallelRecipes(), 100, 80, 100);
+ }
+ return true;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (2 * (GT_Utility.getTier(this.getMaxInputVoltage()) + 1));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialFishingPond;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings3Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 0;
+ }
+
+ public int getCasingTextureIndex() {
+ return TAE.GTPP_INDEX(32);
+ }
+
+ public boolean checkForWater() {
+
+ // Get Facing direction
+ IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
+ int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int mCurrentDirectionX;
+ int mCurrentDirectionZ;
+ int mOffsetX_Lower = 0;
+ int mOffsetX_Upper = 0;
+ int mOffsetZ_Lower = 0;
+ int mOffsetZ_Upper = 0;
+
+ mCurrentDirectionX = 4;
+ mCurrentDirectionZ = 4;
+
+ mOffsetX_Lower = -4;
+ mOffsetX_Upper = 4;
+ mOffsetZ_Lower = -4;
+ mOffsetZ_Upper = 4;
+
+ // if (aBaseMetaTileEntity.fac)
+
+ final int xDir =
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX;
+ final int zDir =
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ;
+
+ int tAmount = 0;
+ for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) {
+ for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) {
+ for (int h = 0; h < 2; h++) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ if (isNotStaticWater(tBlock, tMeta)) {
+ if (this.getStoredFluids() != null) {
+ for (FluidStack stored : this.getStoredFluids()) {
+ if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) {
+ if (stored.amount >= 1000) {
+ // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
+ stored.amount -= 1000;
+ Block fluidUsed = Blocks.water;
+ aBaseMetaTileEntity
+ .getWorld()
+ .setBlock(
+ aBaseMetaTileEntity.getXCoord() + xDir + i,
+ aBaseMetaTileEntity.getYCoord() + h,
+ aBaseMetaTileEntity.getZCoord() + zDir + j,
+ fluidUsed);
+ }
+ }
+ }
+ }
+ }
+ tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ if (tBlock == Blocks.water || tBlock == Blocks.flowing_water) {
+ ++tAmount;
+ // log("Found Water");
+ }
+ }
+ }
+ }
+
+ boolean isValidWater = tAmount >= 60;
+ if (isValidWater) {
+ log("Filled structure.");
+ } else {
+ log("Did not fill structure.");
+ }
+ return isValidWater;
+ }
+
+ private boolean isNotStaticWater(Block block, byte meta) {
+ return block == Blocks.air
+ || block == Blocks.flowing_water
+ || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)
+ || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0);
+ }
+
+ private static AutoMap<AutoMap<WeightedRandomFishable>> categories = new AutoMap<AutoMap<WeightedRandomFishable>>();
+ private static AutoMap<WeightedRandomFishable> categoryFish = new AutoMap<WeightedRandomFishable>();
+ private static AutoMap<WeightedRandomFishable> categoryJunk = new AutoMap<WeightedRandomFishable>();
+ private static AutoMap<WeightedRandomFishable> categoryLoot = new AutoMap<WeightedRandomFishable>();
+ private static boolean hasGenerateRecipes = false;
+ private int mMode = 14;
+ private int mMax = 8;
+
+ private boolean generateRecipes() {
+ if (!hasGenerateRecipes) {
+ categories.put(categoryFish);
+ categories.put(categoryJunk);
+ categories.put(categoryLoot);
+ for (WeightedRandomFishable h : FishPondFakeRecipe.fish) {
+ categoryFish.put(h);
+ }
+ for (WeightedRandomFishable h : FishPondFakeRecipe.junk) {
+ categoryJunk.put(h);
+ }
+ for (WeightedRandomFishable h : FishPondFakeRecipe.treasure) {
+ categoryLoot.put(h);
+ }
+ hasGenerateRecipes = true;
+ return true;
+ } else {
+ return true;
+ }
+ }
+
+ private int getCircuit(ItemStack[] t) {
+ if (!this.isUsingControllerCircuit) {
+ for (ItemStack j : t) {
+ if (j.getItem() == CI.getNumberedCircuit(0).getItem()) {
+ // Fish
+ if (j.getItemDamage() == 14) {
+ mMax = 8 + (this.getMaxParallelRecipes() - 2);
+ this.mMode = 14;
+ break;
+ }
+ // Junk
+ else if (j.getItemDamage() == 15) {
+ this.mMode = 15;
+ mMax = 4;
+ break;
+ }
+ // Loot
+ else if (j.getItemDamage() == 16) {
+ this.mMode = 16;
+ mMax = 4;
+ break;
+ } else {
+ this.mMode = 0;
+ mMax = 0;
+ break;
+ }
+ } else {
+ this.mMode = 0;
+ mMax = 0;
+ break;
+ }
+ }
+ }
+ return this.mMode;
+ }
+
+ // reflection map
+ private static Map<WeightedRandomFishable, ItemStack> reflectiveFishMap =
+ new HashMap<WeightedRandomFishable, ItemStack>();
+
+ private ItemStack reflectiveFish(WeightedRandomFishable y) {
+ if (reflectiveFishMap.containsKey(y)) {
+ return reflectiveFishMap.get(y);
+ }
+ ItemStack t;
+ try {
+ t = (ItemStack) ReflectionUtils.getField(WeightedRandomFishable.class, "field_150711_b")
+ .get(y);
+ ItemStack k = ItemUtils.getSimpleStack(t, 1);
+ reflectiveFishMap.put(y, k);
+ return t;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ return null;
+ }
+
+ private ItemStack[] generateLoot(int mode) {
+ ItemStack[] mFishOutput = new ItemStack[this.mMax];
+ if (this.mMode == 14) {
+ for (int k = 0; k < this.mMax; k++) {
+ if (mFishOutput[k] == null)
+ for (WeightedRandomFishable g : categoryFish.values()) {
+ if (MathUtils.randInt(0, (65 - getMaxParallelRecipes())) <= 2) {
+ ItemStack t = reflectiveFish(g);
+ if (t != null) {
+ mFishOutput[k] = ItemUtils.getSimpleStack(t, 1);
+ }
+ }
+ }
+ }
+ } else if (this.mMode == 15) {
+ for (int k = 0; k < this.mMax; k++) {
+ if (mFishOutput[k] == null)
+ for (WeightedRandomFishable g : categoryJunk.values()) {
+ if (MathUtils.randInt(0, 100) <= 1) {
+ ItemStack t = reflectiveFish(g);
+ if (t != null) {
+ mFishOutput[k] = ItemUtils.getSimpleStack(t, 1);
+ }
+ }
+ }
+ }
+ } else if (this.mMode == 16) {
+ for (int k = 0; k < this.mMax; k++) {
+ if (mFishOutput[k] == null)
+ for (WeightedRandomFishable g : categoryLoot.values()) {
+ if (MathUtils.randInt(0, 1000) <= 2) {
+ ItemStack t = reflectiveFish(g);
+ if (t != null) {
+ mFishOutput[k] = ItemUtils.getSimpleStack(t, 1);
+ }
+ }
+ }
+ }
+ } else {
+ mFishOutput = null;
+ }
+ return mFishOutput;
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+
+ // Control Core to control the Multiblocks behaviour.
+ int aControlCoreTier = getControlCoreTier();
+
+ // If no core, return false;
+ if (aControlCoreTier == 0 && CORE.ConfigSwitches.requireControlCores) {
+ log("Invalid/No Control Core");
+ return false;
+ }
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ // Check to see if Voltage Tier > Control Core Tier
+ if (tTier > aControlCoreTier && CORE.ConfigSwitches.requireControlCores) {
+ return false;
+ }
+
+ // Based on the Processing Array. A bit overkill, but very flexible.
+ getCircuit(aItemInputs);
+
+ /*
+ * GT_Recipe tRecipe = this.getRecipeMap().findRecipe( getBaseMetaTileEntity(),
+ * mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs,
+ * aItemInputs);
+ */
+
+ ItemStack[] mFishOutput = generateLoot(this.mMode);
+ mFishOutput = removeNulls(mFishOutput);
+ GT_Recipe g = new GTPP_Recipe(
+ true, new ItemStack[] {}, mFishOutput, null, new int[] {}, aFluidInputs, mOutputFluids, 200, 16, 0);
+ aMaxParallelRecipes = this.canBufferOutputs(g, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("No Space");
+ return false;
+ }
+
+ log("Mode: " + this.mMode + " | Is loot valid? " + (mFishOutput != null));
+
+ int jslot = 0;
+ for (ItemStack x : mFishOutput) {
+ if (x != null) {
+ log("Slot " + jslot + " in mFishOutput contains " + x.stackSize + "x " + x.getDisplayName() + ".");
+ } else {
+ log("Slot " + jslot + " in mFishOutput was null.");
+ }
+ jslot++;
+ }
+
+ // EU discount
+ float tRecipeEUt = (8 * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (20 * tTimeFactor * 4);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Only Overclock as high as the control circuit.
+ byte tTierOld = tTier;
+ tTier = CORE.ConfigSwitches.requireControlCores ? (byte) aControlCoreTier : tTierOld;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ log("Recipe Step. [3]");
+ // Collect output item types
+ ItemStack[] tOutputItems = mFishOutput;
+
+ int rslot = 0;
+ tOutputItems = removeNulls(mFishOutput);
+
+ for (ItemStack x : tOutputItems) {
+ if (x != null) {
+ log("rSlot " + rslot + " in mFishOutput contains " + x.stackSize + "x " + x.getDisplayName() + ".");
+ } else {
+ log("rSlot " + rslot + " in mFishOutput was null.");
+ }
+ rslot++;
+ }
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java
index ef30eacc5b..4ea9075ee5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java
@@ -1,8 +1,13 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.enums.GT_Values.E;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -24,6 +29,9 @@ import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -31,501 +39,489 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.enums.GT_Values.E;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialRockBreaker> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> STRUCTURE_DEFINITION = null;
-
-
- public GregtechMetaTileEntity_IndustrialRockBreaker(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_IndustrialRockBreaker(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialRockBreaker(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Rock Breaker";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Industrial Rock Breaker")
- .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 8")
- .addInfo("Circuit goes in the GUI slot")
- .addInfo("1 = cobble, 2 = stone, 3 = obsidian")
- .addInfo("Supply Water/Lava")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 4, 3, true)
- .addController("Bottom Center")
- .addCasingInfo("Thermal Processing Casing", 9)
- .addCasingInfo("Thermal Containment Casing", 16)
- .addInputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialRockBreaker>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCC", "CCC", "CCC"},
- {"HHH", "H-H", "HHH"},
- {"HHH", "H-H", "HHH"},
- {"C~C", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_IndustrialRockBreaker.class)
- .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler)
- .casingIndex(TAE.GTPP_INDEX(16))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)))
- )
- .addElement(
- 'H',
- ofBlock(
- ModBlocks.blockCasings2Misc, 11
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 3, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- boolean aCheckPiece = checkPiece(mName, 1, 3, 0);
- boolean aCasingCount = mCasing >= 9;
- boolean aCheckHatch = checkHatch();
- log(""+aCheckPiece+", "+aCasingCount+", "+aCheckHatch);
- return aCheckPiece && aCasingCount && aCheckHatch;
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(208);
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(16);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public boolean requiresVanillaGtGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "ElectricBlastFurnace";
- }
-
- private static final GT_Recipe_Map sFakeRecipeMap = new GT_Recipe_Map(new HashSet<>(0), "gt.recipe.fakerockbreaker", "Rock Breaker", "smelting", RES_PATH_GUI + "basicmachines/E_Furnace", 1, 1, 0, 0, 1, E, 1, E, true, false);
-
- private static void generateRecipeMap() {
- if (sRecipe_Cobblestone == null || sRecipe_SmoothStone == null || sRecipe_Redstone == null) {
- generateRecipes();
- }
- FluidStack[] aInputFluids = new FluidStack[] {FluidUtils.getWater(1000), FluidUtils.getLava(1000)};
- GT_Recipe aTemp = sRecipe_Cobblestone.copy();
- aTemp.mFluidInputs = aInputFluids;
- sFakeRecipeMap.add(aTemp);
- aTemp = sRecipe_SmoothStone.copy();
- aTemp.mFluidInputs = aInputFluids;
- sFakeRecipeMap.add(aTemp);
- aTemp = sRecipe_Redstone.copy();
- aTemp.mFluidInputs = aInputFluids;
- sFakeRecipeMap.add(aTemp);
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- if (sFakeRecipeMap.mRecipeList.isEmpty()) {
- generateRecipeMap();
- }
- return sFakeRecipeMap;
- }
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
- }
-
- private static GT_Recipe sRecipe_Cobblestone;
- private static GT_Recipe sRecipe_SmoothStone;
- private static GT_Recipe sRecipe_Redstone;
-
- private static final void generateRecipes() {
- sRecipe_Cobblestone = new GTPP_Recipe(
- false,
- new ItemStack[] {
- CI.getNumberedCircuit(1)
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(Blocks.cobblestone)
- },
- null,
- new int[] {10000},
- null,
- null,
- 16,
- 32,
- 0);
- sRecipe_SmoothStone = new GTPP_Recipe(
- false,
- new ItemStack[] {
- CI.getNumberedCircuit(2)
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(Blocks.stone)
- },
- null,
- new int[] {10000},
- null,
- null,
- 16,
- 32,
- 0);
- sRecipe_Redstone = new GTPP_Recipe(
- false,
- new ItemStack[] {
- CI.getNumberedCircuit(3),
- GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L)
- },
- new ItemStack[] {
- ItemUtils.getSimpleStack(Blocks.obsidian)
- },
- null,
- new int[] {10000},
- null,
- null,
- 128,
- 32,
- 0);
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- ArrayList<FluidStack> aFluids = this.getStoredFluids();
- if (!aFluids.isEmpty()) {
- boolean aHasWater = false;
- boolean aHasLava = false;
- for (FluidStack aFluid : aFluids) {
- if (aFluid.getFluid() == FluidRegistry.WATER) {
- aHasWater = true;
- }
- else if (aFluid.getFluid() == FluidRegistry.LAVA) {
- aHasLava = true;
- }
- }
- ArrayList<ItemStack> aItems = this.getStoredInputs();
- boolean aHasRedstone = false;
- if (!aItems.isEmpty()) {
- for (ItemStack aItem : aItems) {
- if (GT_Utility.areStacksEqual(aItem, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) {
- aHasRedstone = true;
- break;
- }
- }
- }
-
- if (!aHasWater || !aHasLava) {
- log("BAD RETURN - 0-1");
- return false;
- }
- ItemStack aGuiCircuit = this.getGUIItemStack();
- if (aGuiCircuit == null || !ItemUtils.isControlCircuit(aGuiCircuit)) {
- log("BAD RETURN - 0-2");
- return false;
- }
-
- if (sRecipe_Cobblestone == null || sRecipe_SmoothStone == null || sRecipe_Redstone == null) {
- generateRecipes();
- }
-
- int aCircuit = aGuiCircuit.getItemDamage();
-
- GT_Recipe tRecipe = null;
- switch (aCircuit) {
- case 1:
- tRecipe = sRecipe_Cobblestone;
- break;
- case 2:
- tRecipe = sRecipe_SmoothStone;
- break;
- case 3:
- if (aHasRedstone) {
- tRecipe = sRecipe_Redstone;
- }
- break;
- }
-
- if (tRecipe == null) {
- log("BAD RETURN - 0-3");
- return false;
- }
-
- // Based on the Processing Array. A bit overkill, but very flexible.
- ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]);
- FluidStack[] aFluidInputs = new FluidStack[] {};
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- int aMaxParallelRecipes = getMaxParallelRecipes();
- int aEUPercent = getEuDiscountForParallelism();
- int aSpeedBonusPercent = 200;
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
-
- if (aItems.size() > 0 && aCircuit == 3) {
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!this.depleteInput(tRecipe.mInputs[1])) {
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
- }
- else if (aCircuit >= 1 && aCircuit <= 2) {
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
- }
-
- log("Broke at "+parallelRecipes+".");
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
- }
-
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 75;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialRockBreaker;
- }
-
- @Override
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 2;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public ArrayList<ItemStack> getStoredInputs() {
- ArrayList<ItemStack> aInputs = super.getStoredInputs();
- if (this.hasSlotInGUI() && this.getGUIItemStack() != null) {
- aInputs.add(this.getGUIItemStack());
- }
- return aInputs;
- }
+public class GregtechMetaTileEntity_IndustrialRockBreaker
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialRockBreaker>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_IndustrialRockBreaker(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_IndustrialRockBreaker(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialRockBreaker(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Rock Breaker";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Industrial Rock Breaker")
+ .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 8")
+ .addInfo("Circuit goes in the GUI slot")
+ .addInfo("1 = cobble, 2 = stone, 3 = obsidian")
+ .addInfo("Supply Water/Lava")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 4, 3, true)
+ .addController("Bottom Center")
+ .addCasingInfo("Thermal Processing Casing", 9)
+ .addCasingInfo("Thermal Containment Casing", 16)
+ .addInputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialRockBreaker>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCC", "CCC", "CCC"},
+ {"HHH", "H-H", "HHH"},
+ {"HHH", "H-H", "HHH"},
+ {"C~C", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_IndustrialRockBreaker.class)
+ .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler)
+ .casingIndex(TAE.GTPP_INDEX(16))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0))))
+ .addElement('H', ofBlock(ModBlocks.blockCasings2Misc, 11))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 3, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 3, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ boolean aCheckPiece = checkPiece(mName, 1, 3, 0);
+ boolean aCasingCount = mCasing >= 9;
+ boolean aCheckHatch = checkHatch();
+ log("" + aCheckPiece + ", " + aCasingCount + ", " + aCheckHatch);
+ return aCheckPiece && aCasingCount && aCheckHatch;
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(208);
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(16);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "ElectricBlastFurnace";
+ }
+
+ private static final GT_Recipe_Map sFakeRecipeMap = new GT_Recipe_Map(
+ new HashSet<>(0),
+ "gt.recipe.fakerockbreaker",
+ "Rock Breaker",
+ "smelting",
+ RES_PATH_GUI + "basicmachines/E_Furnace",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ false);
+
+ private static void generateRecipeMap() {
+ if (sRecipe_Cobblestone == null || sRecipe_SmoothStone == null || sRecipe_Redstone == null) {
+ generateRecipes();
+ }
+ FluidStack[] aInputFluids = new FluidStack[] {FluidUtils.getWater(1000), FluidUtils.getLava(1000)};
+ GT_Recipe aTemp = sRecipe_Cobblestone.copy();
+ aTemp.mFluidInputs = aInputFluids;
+ sFakeRecipeMap.add(aTemp);
+ aTemp = sRecipe_SmoothStone.copy();
+ aTemp.mFluidInputs = aInputFluids;
+ sFakeRecipeMap.add(aTemp);
+ aTemp = sRecipe_Redstone.copy();
+ aTemp.mFluidInputs = aInputFluids;
+ sFakeRecipeMap.add(aTemp);
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ if (sFakeRecipeMap.mRecipeList.isEmpty()) {
+ generateRecipeMap();
+ }
+ return sFakeRecipeMap;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return true;
+ }
+
+ private static GT_Recipe sRecipe_Cobblestone;
+ private static GT_Recipe sRecipe_SmoothStone;
+ private static GT_Recipe sRecipe_Redstone;
+
+ private static final void generateRecipes() {
+ sRecipe_Cobblestone = new GTPP_Recipe(
+ false,
+ new ItemStack[] {CI.getNumberedCircuit(1)},
+ new ItemStack[] {ItemUtils.getSimpleStack(Blocks.cobblestone)},
+ null,
+ new int[] {10000},
+ null,
+ null,
+ 16,
+ 32,
+ 0);
+ sRecipe_SmoothStone = new GTPP_Recipe(
+ false,
+ new ItemStack[] {CI.getNumberedCircuit(2)},
+ new ItemStack[] {ItemUtils.getSimpleStack(Blocks.stone)},
+ null,
+ new int[] {10000},
+ null,
+ null,
+ 16,
+ 32,
+ 0);
+ sRecipe_Redstone = new GTPP_Recipe(
+ false,
+ new ItemStack[] {
+ CI.getNumberedCircuit(3), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L)
+ },
+ new ItemStack[] {ItemUtils.getSimpleStack(Blocks.obsidian)},
+ null,
+ new int[] {10000},
+ null,
+ null,
+ 128,
+ 32,
+ 0);
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ ArrayList<FluidStack> aFluids = this.getStoredFluids();
+ if (!aFluids.isEmpty()) {
+ boolean aHasWater = false;
+ boolean aHasLava = false;
+ for (FluidStack aFluid : aFluids) {
+ if (aFluid.getFluid() == FluidRegistry.WATER) {
+ aHasWater = true;
+ } else if (aFluid.getFluid() == FluidRegistry.LAVA) {
+ aHasLava = true;
+ }
+ }
+ ArrayList<ItemStack> aItems = this.getStoredInputs();
+ boolean aHasRedstone = false;
+ if (!aItems.isEmpty()) {
+ for (ItemStack aItem : aItems) {
+ if (GT_Utility.areStacksEqual(
+ aItem, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) {
+ aHasRedstone = true;
+ break;
+ }
+ }
+ }
+
+ if (!aHasWater || !aHasLava) {
+ log("BAD RETURN - 0-1");
+ return false;
+ }
+ ItemStack aGuiCircuit = this.getGUIItemStack();
+ if (aGuiCircuit == null || !ItemUtils.isControlCircuit(aGuiCircuit)) {
+ log("BAD RETURN - 0-2");
+ return false;
+ }
+
+ if (sRecipe_Cobblestone == null || sRecipe_SmoothStone == null || sRecipe_Redstone == null) {
+ generateRecipes();
+ }
+
+ int aCircuit = aGuiCircuit.getItemDamage();
+
+ GT_Recipe tRecipe = null;
+ switch (aCircuit) {
+ case 1:
+ tRecipe = sRecipe_Cobblestone;
+ break;
+ case 2:
+ tRecipe = sRecipe_SmoothStone;
+ break;
+ case 3:
+ if (aHasRedstone) {
+ tRecipe = sRecipe_Redstone;
+ }
+ break;
+ }
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 0-3");
+ return false;
+ }
+
+ // Based on the Processing Array. A bit overkill, but very flexible.
+ ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]);
+ FluidStack[] aFluidInputs = new FluidStack[] {};
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ int aMaxParallelRecipes = getMaxParallelRecipes();
+ int aEUPercent = getEuDiscountForParallelism();
+ int aSpeedBonusPercent = 200;
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+
+ if (aItems.size() > 0 && aCircuit == 3) {
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage
+ // limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!this.depleteInput(tRecipe.mInputs[1])) {
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+ } else if (aCircuit >= 1 && aCircuit <= 2) {
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+ }
+
+ log("Broke at " + parallelRecipes + ".");
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ log("GOOD RETURN - 1");
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (8 * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 75;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialRockBreaker;
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ArrayList<ItemStack> getStoredInputs() {
+ ArrayList<ItemStack> aInputs = super.getStoredInputs();
+ if (this.hasSlotInGUI() && this.getGUIItemStack() != null) {
+ aInputs.add(this.getGUIItemStack());
+ }
+ return aInputs;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
index 9a6a416357..a37b4301a2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
@@ -1,6 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.AirIntake;
+import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
import com.google.common.collect.ImmutableMap;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
@@ -26,6 +32,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEn
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler_Adv;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
@@ -34,570 +41,564 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.AirIntake;
-import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
-
-public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeRocketEngine> implements ISurvivalConstructable {
- protected int fuelConsumption;
- protected int fuelValue;
- protected int fuelRemaining;
- protected int freeFuelTicks = 0;
- protected int euProduction = 0;
- protected boolean boostEu;
-
- public static String mLubricantName = "Carbon Dioxide";
- public static String mCoolantName = "Liquid Hydrogen";
-
- public static String mCasingName = "Turbodyne Casing";
- public static String mIntakeHatchName = "Tungstensteel Turbine Casing";
- public static String mGearboxName = "Inconel Reinforced Casing";
-
- private static Fluid sAirFluid = null;
- private static FluidStack sAirFluidStack = null;
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_LargeRocketEngine> STRUCTURE_DEFINITION = null;
-
- private final static int CASING_ID = TAE.getIndexFromPage(3, 11);
-
- public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- this.fuelConsumption = 0;
- this.fuelValue = 0;
- this.fuelRemaining = 0;
- this.boostEu = false;
- setAir();
- }
-
- public GregtechMetaTileEntity_LargeRocketEngine(final String aName) {
- super(aName);
- this.fuelConsumption = 0;
- this.fuelValue = 0;
- this.fuelRemaining = 0;
- this.boostEu = false;
- setAir();
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Large Rocket Engine")
- .addInfo("Supply Rocket Fuels and 1000L of " + mLubricantName + " per hour")
- .addInfo("Produces as much energy as you put fuel in, with optional boosting")
- .addInfo("Supply 4L of " + mCoolantName + " per second, per 2100 EU/t to boost")
- .addInfo("Takes 3x the amount of fuel and " + mLubricantName + "to run 3x faster")
- .addInfo("Consumes 2000L/s of air and pollutes 1500 gibbl/s per 16384 eu/t produced")
- .addInfo("If producing more than 18.4k EU/t, fuel will be consumed less efficiently:")
- .addInfo("- 75% of max fuel efficiency at 44k EU/t output energy")
- .addInfo("- 50% of max fuel efficiency at 105k EU/t output energy")
- .addInfo("- 25% of max fuel efficiency at 294k EU/t output energy")
- .addInfo("(These thresholds are 3x higher when boosted)")
- .addInfo("formula: x = input of energy (10K^(1/3)/ x^(1/3)) * (40K^(1/3)/ x^(1/3))")
- .addSeparator()
- .beginStructureBlock(3, 3, 10, false)
- .addController("Front Center")
- .addCasingInfo(mCasingName, 64)
- .addCasingInfo(mGearboxName, 8)
- .addStructureHint("Air Intake Hatch", 1)
- .addInputBus("Side center line", 1)
- .addInputHatch("Side center line", 1)
- .addMaintenanceHatch("Any Block Touching Inconel Reinforced Casing", 1)
- .addDynamoHatch("Top center line", 2)
- .addMufflerHatch("Back Center", 3)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_LargeRocketEngine> getStructureDefinition() {
- if (this.STRUCTURE_DEFINITION == null) {
- this.STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeRocketEngine>builder()
- .addShape(this.mName, transpose(new String[][]{
- {"CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC"},
- {"C~C", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "CMC"},
- {"CCC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CCC"},
- }))
- .addElement('C', ofBlock(getCasingBlock(), getCasingMeta()))
- .addElement('I', ofBlock(getGearboxBlock(), getGearboxMeta()))
- // side
- .addElement('S', buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class)
- .atLeast(ImmutableMap.of(InputBus, 1, InputHatch, 3, Maintenance, 1, AirIntake, 8))
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
- // top
- .addElement('T', buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class)
- .atLeast(ImmutableMap.of(Dynamo.or(TTDynamo), 1, Maintenance, 1, AirIntake, 8))
- .casingIndex(getCasingTextureIndex())
- .dot(2)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
- .addElement('M', Muffler.newAny(getCasingTextureIndex(), 3))
- .build();
- }
- return this.STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(this.mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- this.mCasing = 0;
- this.mTecTechDynamoHatches.clear();
- this.mAllDynamoHatches.clear();
- this.mAirIntakes.clear();
- return checkPiece(this.mName, 1, 1, 0) && this.mCasing >= 64 - 48 && this.mAirIntakes.size() >= 8 && checkHatch();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return CASING_ID;
- }
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return this.getMaxEfficiency(aStack) > 0;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public static void setAir() {
- if (sAirFluidStack == null) {
- sAirFluidStack = FluidUtils.getFluidStack("air", 1);
- }
- if (sAirFluid == null && sAirFluidStack != null) {
- sAirFluid = sAirFluidStack.getFluid();
- }
- }
-
- public int getAir() {
- setAir();
- if (this.mAirIntakes.isEmpty() || this.mAirIntakes.size() <= 0) {
- return 0;
- }
- else {
- int totalAir = 0;
- for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) {
- if (u != null && u.mFluid != null) {
- FluidStack f = u.mFluid;
- if (f.isFluidEqual(sAirFluidStack)) {
- totalAir += f.amount;
- }
- }
- }
- return totalAir;
- }
- }
-
- @Override
- public GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- final ArrayList<FluidStack> tFluids = this.getStoredFluids();
- this.clearRecipeMapForAllInputHatches();
- int aircount = getAir() ;
- int aAirToConsume = this.euProduction/100;
- if (aircount < aAirToConsume) {
- log("Not Enough Air to Run "+aircount);
- return false;
- }
- else {
- int aTotalAir = 0;
- for (GT_MetaTileEntity_Hatch_AirIntake aAirHatch : this.mAirIntakes) {
- if (aAirHatch.mFluid != null) {
- aTotalAir += aAirHatch.getFluidAmount();
- }
- }
- log("Total Air: "+aTotalAir);
- if (aTotalAir >= aAirToConsume) {
- int aSplitAmount = (aAirToConsume / this.mAirIntakes.size());
- if (aSplitAmount > 0) {
- for (GT_MetaTileEntity_Hatch_AirIntake aAirHatch : mAirIntakes) {
- boolean hasIntakeAir = aAirHatch.drain(aSplitAmount, true) != null;
- if (!hasIntakeAir) {
- log("Could not consume Air to run "+aSplitAmount);
- this.freeFuelTicks = 0;
- return false;
- }
- log("Consumed Air to run "+aSplitAmount);
- }
- }
- }
- }
- // reset fuel ticks in case it does not reset when it stops
- if (this.freeFuelTicks != 0 && this.mProgresstime == 0 && this.mEfficiency == 0)
- this.freeFuelTicks = 0;
-
- log("Running "+aircount);
- log("looking at hatch");
-
-
- if (tFluids.size() > 0 && getRecipeMap() != null) {
- FluidStack aCO2 = MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1);
- FluidStack aCO2Fallback = FluidUtils.getWildcardFluidStack("carbondioxide", (this.boostEu ? 3 : 1));
-
-
- boolean aHasCO2 = false;
- for (FluidStack aFluid : tFluids) {
- if (aCO2 != null && aFluid.isFluidEqual(aCO2)) {
- log("Found CO2 (1)");
- aHasCO2 = true;
- break;
- }
- if (aCO2Fallback != null && aFluid.isFluidEqual(aCO2Fallback)) {
- log("Found CO2 (2)");
- aHasCO2 = true;
- break;
- }
- log("Found: "+aFluid.getUnlocalizedName());
- }
- if (aHasCO2) {
- if (this.mRuntime % 72 == 0 || this.mRuntime == 0) {
- if (!consumeCO2()) {
- this.freeFuelTicks = 0;
- log("Bad Return 1");
- return false;
- }
- }
- }
- else {
- this.freeFuelTicks = 0;
- log("Bad Return 2 | "+aHasCO2+" | "+(aCO2 != null)+" | "+(aCO2Fallback != null));
- return false;
- }
- if (this.freeFuelTicks == 0) {
- this.boostEu = consumeLOH();
- }
- for (final FluidStack hatchFluid1 : tFluids) {
- if (hatchFluid1.isFluidEqual(sAirFluidStack)) {
- continue;
- }
- if (this.freeFuelTicks == 0) {
- for (final GT_Recipe aFuel : getRecipeMap().mRecipeList) {
- final FluidStack tLiquid;
- tLiquid = aFuel.mFluidInputs[0];
- if (hatchFluid1.isFluidEqual(tLiquid)) {
- if (!consumeFuel(aFuel,hatchFluid1.amount)) {
- continue;
- }
- this.fuelValue = aFuel.mSpecialValue * 3;
- this.fuelRemaining = hatchFluid1.amount;
- this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]<<1);
- this.mProgresstime = 1;
- this.mMaxProgresstime = 1;
- this.mEfficiencyIncrease = this.euProduction/2000;
- return true;
- }
- }
- }
- else {
- this.mEfficiencyIncrease = this.euProduction/2000;
- this.freeFuelTicks--;
- this.mEUt = (int) ((this.mEfficiency < 1000) ? 0 : GT_Values.V[5]<<1);
- this.mProgresstime = 1;
- this.mMaxProgresstime = 1;
- return true;
- }
- }
- }
- this.mEUt = 0;
- this.mEfficiency = 0;
- this.freeFuelTicks = 0;
- log("Bad Return 3");
- return false;
- }
-
- /**
- * Consumes Fuel if required. Free Fuel Ticks are handled here.
- * @param aFuel
- * @return
- */
- public boolean consumeFuel(GT_Recipe aFuel,int amount) {
- amount *= this.boostEu ? 0.3 : 0.9;
- this.freeFuelTicks = 0;
- int value = aFuel.mSpecialValue * 3;
- int energy = value * amount;
- if (amount < 5)
- return false;
- FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], (this.boostEu ? amount * 3 : amount));
- if (!this.depleteInput(tLiquid)) {
- return false;
- }
- else {
- this.fuelConsumption = this.boostEu ? amount * 3 : amount;
- this.freeFuelTicks = 20;
- setEUProduction(energy);
- return true;
- }
- }
-
- public void setEUProduction(int energy){
- energy /= 20;
- double energyEfficiency;
- double tDivideEnergy = Math.cbrt(energy);
- if (energy > 10000) {
- //cbrt(10 000) /
- energyEfficiency = (21.5443469/tDivideEnergy);
- if (energy >= 40000)
- //cbrt(40 000) /
- energyEfficiency *= (34.19951893/tDivideEnergy);
- energyEfficiency *= energy;
- }
- else {
- energyEfficiency = energy;
- }
- this.euProduction = (int) (energyEfficiency * 1.84);
- if (this.boostEu)
- this.euProduction *= 3;
- }
-
- public boolean consumeCO2() {
- if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) {
- return true;
- }
- else {
- return false;
- }
- }
-
- public boolean consumeLOH() {
- int LOHamount = (3 * this.euProduction)/1000;
- return this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, LOHamount)); //(40 * ((long) euProduction / 10000))
- }
-
- @Override
- public boolean addEnergyOutput(long aEU) {
- if (aEU <= 0) {
- return true;
- }
- if (this.mAllDynamoHatches.size() > 0) {
- return addEnergyOutputMultipleDynamos(aEU, true);
- }
- return false;
- }
-
-
- @Override
- public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) {
- int injected = 0;
- long totalOutput = 0;
- long aFirstVoltageFound = -1;
- boolean aFoundMixedDynamos = false;
- for (GT_MetaTileEntity_Hatch aDynamo : this.mAllDynamoHatches) {
- if( aDynamo == null ) {
- return false;
- }
- if (isValidMetaTileEntity(aDynamo)) {
- long aVoltage = aDynamo.maxEUOutput();
- long aTotal = aDynamo.maxAmperesOut() * aVoltage;
- // Check against voltage to check when hatch mixing
- if (aFirstVoltageFound == -1) {
- aFirstVoltageFound = aVoltage;
- }
- else {
- /**
- * Calcualtes overclocked ness using long integers
- * @param aEUt - recipe EUt
- * @param aDuration - recipe Duration
- * @param mAmperage - should be 1 ?
- */
- //Long time calculation
- if (aFirstVoltageFound != aVoltage) {
- aFoundMixedDynamos = true;
- }
- }
- totalOutput += aTotal;
- }
- }
-
- if (totalOutput < aEU || (aFoundMixedDynamos && !aAllowMixedVoltageDynamos)) {
- explodeMultiblock();
- return false;
- }
-
- long leftToInject;
- //Long EUt calculation
- long aVoltage;
- //Isnt too low EUt check?
- int aAmpsToInject;
- int aRemainder;
-
- //xEUt *= 4;//this is effect of everclocking
- for (GT_MetaTileEntity_Hatch aDynamo : this.mAllDynamoHatches) {
- if (isValidMetaTileEntity(aDynamo)) {
- leftToInject = aEU - injected;
- aVoltage = aDynamo.maxEUOutput();
- aAmpsToInject = (int) (leftToInject / aVoltage);
- aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage));
- long powerGain;
- for (int i = 0; i < Math.min(aDynamo.maxAmperesOut(), aAmpsToInject + 1); i++) {
- if (i == Math.min(aDynamo.maxAmperesOut(), aAmpsToInject)){
- powerGain = aRemainder;
- }else{
- powerGain = aVoltage;
- }
- aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(powerGain, false);
- injected += powerGain;
- }
- }
- }
- return injected > 0;
- }
-
- @Override
- public boolean onRunningTick(ItemStack aStack) {
- if (this.mRuntime%20 == 0) {
- if (this.mMufflerHatches.size() == 1 && this.mMufflerHatches.get(0) instanceof GT_MetaTileEntity_Hatch_Muffler_Adv) {
- GT_MetaTileEntity_Hatch_Muffler_Adv tMuffler = (GT_MetaTileEntity_Hatch_Muffler_Adv) this.mMufflerHatches.get(0);
- if (!tMuffler.hasValidFilter()) {
- ArrayList<ItemStack> tInputs = getStoredInputs();
- for (ItemStack tItem : tInputs) {
- if (tMuffler.isAirFilter(tItem)) {
- tMuffler.mInventory[0] = tItem.copy();
- depleteInput(tItem);
- updateSlots();
- break;
- }
- }
- }
- }
- }
- super.onRunningTick(aStack);
- return true;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockCasings4Misc;
- }
-
- public byte getCasingMeta() {
- return 11;
- }
-
- public Block getGearboxBlock() {
- return ModBlocks.blockCasings3Misc;
- }
-
- public byte getGearboxMeta() {
- return 1;
- }
-
- public byte getCasingTextureIndex() {
- return (byte) CASING_ID;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_LargeRocketEngine(this.mName);
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("freeFuelTicks", this.freeFuelTicks);
- aNBT.setInteger("euProduction", this.euProduction);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.freeFuelTicks = aNBT.getInteger("freeFuelTicks");
- this.euProduction = aNBT.getInteger("euProduction");
- }
-
- @Override
- public int getDamageToComponent(final ItemStack aStack) {
- return 1;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return this.euProduction;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 75 * ( this.euProduction / 10000);
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return true;
- }
-
- @Override
- public String[] getExtraInfoData() {
- return new String[] {
- "Rocket Engine",
- "Current Air: "+getAir(),
- "Current Pollution: " + getPollutionPerTick(null),
- "Time until next fuel consumption: "+this.freeFuelTicks,
- "Current Output: " + this.mEUt * this.mEfficiency / 10000 + " EU/t",
- "Fuel Consumption: " + (this.fuelConsumption) + "L/s",
- "Fuel Value: " + this.fuelValue + " EU/L",
- "Fuel Remaining: " + this.fuelRemaining + " Litres",
- "Current Efficiency: " + this.mEfficiency / 100 + "%",
- (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Rocket Engine";
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
+public class GregtechMetaTileEntity_LargeRocketEngine
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeRocketEngine>
+ implements ISurvivalConstructable {
+ protected int fuelConsumption;
+ protected int fuelValue;
+ protected int fuelRemaining;
+ protected int freeFuelTicks = 0;
+ protected int euProduction = 0;
+ protected boolean boostEu;
+
+ public static String mLubricantName = "Carbon Dioxide";
+ public static String mCoolantName = "Liquid Hydrogen";
+
+ public static String mCasingName = "Turbodyne Casing";
+ public static String mIntakeHatchName = "Tungstensteel Turbine Casing";
+ public static String mGearboxName = "Inconel Reinforced Casing";
+
+ private static Fluid sAirFluid = null;
+ private static FluidStack sAirFluidStack = null;
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_LargeRocketEngine> STRUCTURE_DEFINITION = null;
+
+ private static final int CASING_ID = TAE.getIndexFromPage(3, 11);
+
+ public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ this.fuelConsumption = 0;
+ this.fuelValue = 0;
+ this.fuelRemaining = 0;
+ this.boostEu = false;
+ setAir();
+ }
+
+ public GregtechMetaTileEntity_LargeRocketEngine(final String aName) {
+ super(aName);
+ this.fuelConsumption = 0;
+ this.fuelValue = 0;
+ this.fuelRemaining = 0;
+ this.boostEu = false;
+ setAir();
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Large Rocket Engine")
+ .addInfo("Supply Rocket Fuels and 1000L of " + mLubricantName + " per hour")
+ .addInfo("Produces as much energy as you put fuel in, with optional boosting")
+ .addInfo("Supply 4L of " + mCoolantName + " per second, per 2100 EU/t to boost")
+ .addInfo("Takes 3x the amount of fuel and " + mLubricantName + "to run 3x faster")
+ .addInfo("Consumes 2000L/s of air and pollutes 1500 gibbl/s per 16384 eu/t produced")
+ .addInfo("If producing more than 18.4k EU/t, fuel will be consumed less efficiently:")
+ .addInfo("- 75% of max fuel efficiency at 44k EU/t output energy")
+ .addInfo("- 50% of max fuel efficiency at 105k EU/t output energy")
+ .addInfo("- 25% of max fuel efficiency at 294k EU/t output energy")
+ .addInfo("(These thresholds are 3x higher when boosted)")
+ .addInfo("formula: x = input of energy (10K^(1/3)/ x^(1/3)) * (40K^(1/3)/ x^(1/3))")
+ .addSeparator()
+ .beginStructureBlock(3, 3, 10, false)
+ .addController("Front Center")
+ .addCasingInfo(mCasingName, 64)
+ .addCasingInfo(mGearboxName, 8)
+ .addStructureHint("Air Intake Hatch", 1)
+ .addInputBus("Side center line", 1)
+ .addInputHatch("Side center line", 1)
+ .addMaintenanceHatch("Any Block Touching Inconel Reinforced Casing", 1)
+ .addDynamoHatch("Top center line", 2)
+ .addMufflerHatch("Back Center", 3)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_LargeRocketEngine> getStructureDefinition() {
+ if (this.STRUCTURE_DEFINITION == null) {
+ this.STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeRocketEngine>builder()
+ .addShape(this.mName, transpose(new String[][] {
+ {"CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC"},
+ {"C~C", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "CMC"},
+ {"CCC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CCC"},
+ }))
+ .addElement('C', ofBlock(getCasingBlock(), getCasingMeta()))
+ .addElement('I', ofBlock(getGearboxBlock(), getGearboxMeta()))
+ // side
+ .addElement(
+ 'S',
+ buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class)
+ .atLeast(ImmutableMap.of(InputBus, 1, InputHatch, 3, Maintenance, 1, AirIntake, 8))
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ // top
+ .addElement(
+ 'T',
+ buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class)
+ .atLeast(ImmutableMap.of(Dynamo.or(TTDynamo), 1, Maintenance, 1, AirIntake, 8))
+ .casingIndex(getCasingTextureIndex())
+ .dot(2)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ .addElement('M', Muffler.newAny(getCasingTextureIndex(), 3))
+ .build();
+ }
+ return this.STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(this.mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ this.mCasing = 0;
+ this.mTecTechDynamoHatches.clear();
+ this.mAllDynamoHatches.clear();
+ this.mAirIntakes.clear();
+ return checkPiece(this.mName, 1, 1, 0)
+ && this.mCasing >= 64 - 48
+ && this.mAirIntakes.size() >= 8
+ && checkHatch();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return CASING_ID;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return this.getMaxEfficiency(aStack) > 0;
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public static void setAir() {
+ if (sAirFluidStack == null) {
+ sAirFluidStack = FluidUtils.getFluidStack("air", 1);
+ }
+ if (sAirFluid == null && sAirFluidStack != null) {
+ sAirFluid = sAirFluidStack.getFluid();
+ }
+ }
+
+ public int getAir() {
+ setAir();
+ if (this.mAirIntakes.isEmpty() || this.mAirIntakes.size() <= 0) {
+ return 0;
+ } else {
+ int totalAir = 0;
+ for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) {
+ if (u != null && u.mFluid != null) {
+ FluidStack f = u.mFluid;
+ if (f.isFluidEqual(sAirFluidStack)) {
+ totalAir += f.amount;
+ }
+ }
+ }
+ return totalAir;
+ }
+ }
+
+ @Override
+ public GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ final ArrayList<FluidStack> tFluids = this.getStoredFluids();
+ this.clearRecipeMapForAllInputHatches();
+ int aircount = getAir();
+ int aAirToConsume = this.euProduction / 100;
+ if (aircount < aAirToConsume) {
+ log("Not Enough Air to Run " + aircount);
+ return false;
+ } else {
+ int aTotalAir = 0;
+ for (GT_MetaTileEntity_Hatch_AirIntake aAirHatch : this.mAirIntakes) {
+ if (aAirHatch.mFluid != null) {
+ aTotalAir += aAirHatch.getFluidAmount();
+ }
+ }
+ log("Total Air: " + aTotalAir);
+ if (aTotalAir >= aAirToConsume) {
+ int aSplitAmount = (aAirToConsume / this.mAirIntakes.size());
+ if (aSplitAmount > 0) {
+ for (GT_MetaTileEntity_Hatch_AirIntake aAirHatch : mAirIntakes) {
+ boolean hasIntakeAir = aAirHatch.drain(aSplitAmount, true) != null;
+ if (!hasIntakeAir) {
+ log("Could not consume Air to run " + aSplitAmount);
+ this.freeFuelTicks = 0;
+ return false;
+ }
+ log("Consumed Air to run " + aSplitAmount);
+ }
+ }
+ }
+ }
+ // reset fuel ticks in case it does not reset when it stops
+ if (this.freeFuelTicks != 0 && this.mProgresstime == 0 && this.mEfficiency == 0) this.freeFuelTicks = 0;
+
+ log("Running " + aircount);
+ log("looking at hatch");
+
+ if (tFluids.size() > 0 && getRecipeMap() != null) {
+ FluidStack aCO2 = MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1);
+ FluidStack aCO2Fallback = FluidUtils.getWildcardFluidStack("carbondioxide", (this.boostEu ? 3 : 1));
+
+ boolean aHasCO2 = false;
+ for (FluidStack aFluid : tFluids) {
+ if (aCO2 != null && aFluid.isFluidEqual(aCO2)) {
+ log("Found CO2 (1)");
+ aHasCO2 = true;
+ break;
+ }
+ if (aCO2Fallback != null && aFluid.isFluidEqual(aCO2Fallback)) {
+ log("Found CO2 (2)");
+ aHasCO2 = true;
+ break;
+ }
+ log("Found: " + aFluid.getUnlocalizedName());
+ }
+ if (aHasCO2) {
+ if (this.mRuntime % 72 == 0 || this.mRuntime == 0) {
+ if (!consumeCO2()) {
+ this.freeFuelTicks = 0;
+ log("Bad Return 1");
+ return false;
+ }
+ }
+ } else {
+ this.freeFuelTicks = 0;
+ log("Bad Return 2 | " + aHasCO2 + " | " + (aCO2 != null) + " | " + (aCO2Fallback != null));
+ return false;
+ }
+ if (this.freeFuelTicks == 0) {
+ this.boostEu = consumeLOH();
+ }
+ for (final FluidStack hatchFluid1 : tFluids) {
+ if (hatchFluid1.isFluidEqual(sAirFluidStack)) {
+ continue;
+ }
+ if (this.freeFuelTicks == 0) {
+ for (final GT_Recipe aFuel : getRecipeMap().mRecipeList) {
+ final FluidStack tLiquid;
+ tLiquid = aFuel.mFluidInputs[0];
+ if (hatchFluid1.isFluidEqual(tLiquid)) {
+ if (!consumeFuel(aFuel, hatchFluid1.amount)) {
+ continue;
+ }
+ this.fuelValue = aFuel.mSpecialValue * 3;
+ this.fuelRemaining = hatchFluid1.amount;
+ this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5] << 1);
+ this.mProgresstime = 1;
+ this.mMaxProgresstime = 1;
+ this.mEfficiencyIncrease = this.euProduction / 2000;
+ return true;
+ }
+ }
+ } else {
+ this.mEfficiencyIncrease = this.euProduction / 2000;
+ this.freeFuelTicks--;
+ this.mEUt = (int) ((this.mEfficiency < 1000) ? 0 : GT_Values.V[5] << 1);
+ this.mProgresstime = 1;
+ this.mMaxProgresstime = 1;
+ return true;
+ }
+ }
+ }
+ this.mEUt = 0;
+ this.mEfficiency = 0;
+ this.freeFuelTicks = 0;
+ log("Bad Return 3");
+ return false;
+ }
+
+ /**
+ * Consumes Fuel if required. Free Fuel Ticks are handled here.
+ * @param aFuel
+ * @return
+ */
+ public boolean consumeFuel(GT_Recipe aFuel, int amount) {
+ amount *= this.boostEu ? 0.3 : 0.9;
+ this.freeFuelTicks = 0;
+ int value = aFuel.mSpecialValue * 3;
+ int energy = value * amount;
+ if (amount < 5) return false;
+ FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], (this.boostEu ? amount * 3 : amount));
+ if (!this.depleteInput(tLiquid)) {
+ return false;
+ } else {
+ this.fuelConsumption = this.boostEu ? amount * 3 : amount;
+ this.freeFuelTicks = 20;
+ setEUProduction(energy);
+ return true;
+ }
+ }
+
+ public void setEUProduction(int energy) {
+ energy /= 20;
+ double energyEfficiency;
+ double tDivideEnergy = Math.cbrt(energy);
+ if (energy > 10000) {
+ // cbrt(10 000) /
+ energyEfficiency = (21.5443469 / tDivideEnergy);
+ if (energy >= 40000)
+ // cbrt(40 000) /
+ energyEfficiency *= (34.19951893 / tDivideEnergy);
+ energyEfficiency *= energy;
+ } else {
+ energyEfficiency = energy;
+ }
+ this.euProduction = (int) (energyEfficiency * 1.84);
+ if (this.boostEu) this.euProduction *= 3;
+ }
+
+ public boolean consumeCO2() {
+ if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1))
+ || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean consumeLOH() {
+ int LOHamount = (3 * this.euProduction) / 1000;
+ return this.depleteInput(FluidUtils.getFluidStack(
+ RocketFuels.Liquid_Hydrogen, LOHamount)); // (40 * ((long) euProduction / 10000))
+ }
+
+ @Override
+ public boolean addEnergyOutput(long aEU) {
+ if (aEU <= 0) {
+ return true;
+ }
+ if (this.mAllDynamoHatches.size() > 0) {
+ return addEnergyOutputMultipleDynamos(aEU, true);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) {
+ int injected = 0;
+ long totalOutput = 0;
+ long aFirstVoltageFound = -1;
+ boolean aFoundMixedDynamos = false;
+ for (GT_MetaTileEntity_Hatch aDynamo : this.mAllDynamoHatches) {
+ if (aDynamo == null) {
+ return false;
+ }
+ if (isValidMetaTileEntity(aDynamo)) {
+ long aVoltage = aDynamo.maxEUOutput();
+ long aTotal = aDynamo.maxAmperesOut() * aVoltage;
+ // Check against voltage to check when hatch mixing
+ if (aFirstVoltageFound == -1) {
+ aFirstVoltageFound = aVoltage;
+ } else {
+ /**
+ * Calcualtes overclocked ness using long integers
+ * @param aEUt - recipe EUt
+ * @param aDuration - recipe Duration
+ * @param mAmperage - should be 1 ?
+ */
+ // Long time calculation
+ if (aFirstVoltageFound != aVoltage) {
+ aFoundMixedDynamos = true;
+ }
+ }
+ totalOutput += aTotal;
+ }
+ }
+
+ if (totalOutput < aEU || (aFoundMixedDynamos && !aAllowMixedVoltageDynamos)) {
+ explodeMultiblock();
+ return false;
+ }
+
+ long leftToInject;
+ // Long EUt calculation
+ long aVoltage;
+ // Isnt too low EUt check?
+ int aAmpsToInject;
+ int aRemainder;
+
+ // xEUt *= 4;//this is effect of everclocking
+ for (GT_MetaTileEntity_Hatch aDynamo : this.mAllDynamoHatches) {
+ if (isValidMetaTileEntity(aDynamo)) {
+ leftToInject = aEU - injected;
+ aVoltage = aDynamo.maxEUOutput();
+ aAmpsToInject = (int) (leftToInject / aVoltage);
+ aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage));
+ long powerGain;
+ for (int i = 0; i < Math.min(aDynamo.maxAmperesOut(), aAmpsToInject + 1); i++) {
+ if (i == Math.min(aDynamo.maxAmperesOut(), aAmpsToInject)) {
+ powerGain = aRemainder;
+ } else {
+ powerGain = aVoltage;
+ }
+ aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(powerGain, false);
+ injected += powerGain;
+ }
+ }
+ }
+ return injected > 0;
+ }
+
+ @Override
+ public boolean onRunningTick(ItemStack aStack) {
+ if (this.mRuntime % 20 == 0) {
+ if (this.mMufflerHatches.size() == 1
+ && this.mMufflerHatches.get(0) instanceof GT_MetaTileEntity_Hatch_Muffler_Adv) {
+ GT_MetaTileEntity_Hatch_Muffler_Adv tMuffler =
+ (GT_MetaTileEntity_Hatch_Muffler_Adv) this.mMufflerHatches.get(0);
+ if (!tMuffler.hasValidFilter()) {
+ ArrayList<ItemStack> tInputs = getStoredInputs();
+ for (ItemStack tItem : tInputs) {
+ if (tMuffler.isAirFilter(tItem)) {
+ tMuffler.mInventory[0] = tItem.copy();
+ depleteInput(tItem);
+ updateSlots();
+ break;
+ }
+ }
+ }
+ }
+ }
+ super.onRunningTick(aStack);
+ return true;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings4Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 11;
+ }
+
+ public Block getGearboxBlock() {
+ return ModBlocks.blockCasings3Misc;
+ }
+
+ public byte getGearboxMeta() {
+ return 1;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) CASING_ID;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_LargeRocketEngine(this.mName);
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setInteger("freeFuelTicks", this.freeFuelTicks);
+ aNBT.setInteger("euProduction", this.euProduction);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.freeFuelTicks = aNBT.getInteger("freeFuelTicks");
+ this.euProduction = aNBT.getInteger("euProduction");
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 1;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return this.euProduction;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 75 * (this.euProduction / 10000);
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ return new String[] {
+ "Rocket Engine",
+ "Current Air: " + getAir(),
+ "Current Pollution: " + getPollutionPerTick(null),
+ "Time until next fuel consumption: " + this.freeFuelTicks,
+ "Current Output: " + this.mEUt * this.mEfficiency / 10000 + " EU/t",
+ "Fuel Consumption: " + (this.fuelConsumption) + "L/s",
+ "Fuel Value: " + this.fuelValue + " EU/L",
+ "Fuel Remaining: " + this.fuelRemaining + " Litres",
+ "Current Efficiency: " + this.mEfficiency / 100 + "%",
+ (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance"
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Rocket Engine";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java
index 37d5cb422c..ec3f85014e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java
@@ -1,6 +1,14 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.Dynamo;
+import static gregtech.api.enums.GT_HatchElement.InputHatch;
+import static gregtech.api.enums.GT_HatchElement.Maintenance;
+import static gregtech.api.enums.GT_HatchElement.Muffler;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -22,6 +30,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
@@ -29,337 +38,311 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.Dynamo;
-import static gregtech.api.enums.GT_HatchElement.InputHatch;
-import static gregtech.api.enums.GT_HatchElement.Maintenance;
-import static gregtech.api.enums.GT_HatchElement.Muffler;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
-
-public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeSemifluidGenerator> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_LargeSemifluidGenerator> STRUCTURE_DEFINITION = null;
-
- protected int fuelConsumption = 0;
- protected int fuelValue = 0;
- protected int fuelRemaining = 0;
- protected boolean boostEu = false;
-
- public GregtechMetaTileEntity_LargeSemifluidGenerator(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_LargeSemifluidGenerator(String aName) {
- super(aName);
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Large Semifluid Generator")
- .addInfo("Engine Intake Casings must not be obstructed in front (only air blocks)")
- .addInfo("Supply Semifluid Fuels and 2000L of Lubricant per hour to run.")
- .addInfo("Supply 80L of Oxygen per second to boost output (optional).")
- .addInfo("Default: Produces 2048EU/t at 100% efficiency")
- .addInfo("Boosted: Produces 6144EU/t at 150% efficiency")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 3, 4, false)
- .addController("Front Center")
- .addCasingInfo("Stable Titanium Machine Casing", 16)
- .addCasingInfo("Steel Gear Box Machine Casing", 2)
- .addCasingInfo("Engine Intake Machine Casing", 8)
- .addInputHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .addDynamoHatch("Back Center", 2)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE;
- }
-
- @Override
- protected int getCasingTextureId() {
- return 50;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return getMaxEfficiency(aStack) > 0;
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeDieselEngine.png");
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<FluidStack> tFluids = getStoredFluids();
-
- // Check for lubricant and oxygen first, so we can compute costs ahead of time.
- // This will allow us to check costs without needing to actually try to deplete fluids
- // (wasting earlier fluids in the check if later fluids turn out to be insufficient).
- FluidStack lubricant = Materials.Lubricant.getFluid(0L);
- FluidStack oxygen = Materials.Oxygen.getGas(0L);
- for (FluidStack hatchFluid : tFluids) {
- if (hatchFluid.isFluidEqual(lubricant)) {
- lubricant.amount = Math.max(lubricant.amount, hatchFluid.amount);
- } else if (hatchFluid.isFluidEqual(oxygen)) {
- oxygen.amount = Math.max(oxygen.amount, hatchFluid.amount);
- }
- }
- boostEu = oxygen.amount >= 4L;
- long lubricantCost = boostEu ? 2L : 1L;
- if (lubricant.amount < lubricantCost) {
- return false;
- }
-
- for (FluidStack hatchFluid : tFluids) { //Loops through hatches
- GT_Recipe aFuel = GTPP_Recipe_Map.sSemiFluidLiquidFuels.findFuel(hatchFluid);
- if (aFuel == null) {
- // Not a valid semi-fluid fuel.
- continue;
- }
-
- int newEUt = boostEu ? 4096 : 2048;
- fuelConsumption = newEUt / aFuel.mSpecialValue; //Calc fuel consumption
- FluidStack tLiquid = new FluidStack(hatchFluid.getFluid(), fuelConsumption);
- if(depleteInput(tLiquid)) { //Deplete that amount
- // We checked beforehand, so both of these depletions should succeed.
- // But check the return values anyway just to be safe.
- if (boostEu) {
- if (!depleteInput(Materials.Oxygen.getGas(4L))) {
- return false;
- }
- }
- //Deplete Lubricant. 2000L should = 1 hour of runtime (if baseEU = 2048)
- if(mRuntime % 72 == 0 || mRuntime == 0) {
- if(!depleteInput(Materials.Lubricant.getFluid(lubricantCost))) {
- return false;
- }
- }
-
- fuelValue = aFuel.mSpecialValue;
- fuelRemaining = hatchFluid.amount; //Record available fuel
- this.mEUt = mEfficiency < 2000 ? 0 : newEUt; //Output 0 if startup is less than 20%
- this.mProgresstime = 1;
- this.mMaxProgresstime = 1;
- this.mEfficiencyIncrease = 15;
- return true;
- }
- }
-
- this.mEUt = 0;
- this.mEfficiency = 0;
- return false;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_LargeSemifluidGenerator> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeSemifluidGenerator>builder()
- .addShape(mName, transpose(new String[][]{
- {"III", "CCC", "CCC", "CCC"},
- {"I~I", "CGC", "CGC", "CMC"},
- {"III", "CCC", "CCC", "CCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_LargeSemifluidGenerator.class)
- .atLeast(Muffler, InputHatch, Maintenance)
- .casingIndex(getCasingTextureIndex())
- .dot(1)
- .buildAndChain(onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- getCasingBlock(), getCasingMeta()
- )
- )
- )
- )
- .addElement(
- 'G',
- ofBlock(
- getGearboxBlock(), getGearboxMeta()
- )
- )
- .addElement(
- 'I',
- ofBlock(
- getIntakeBlock(), getIntakeMeta()
- )
- )
- .addElement(
- 'M',
- Dynamo.or(TTDynamo).newAny(getCasingTextureIndex(), 2)
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mDynamoHatches.clear();
- return checkPiece(mName, 1, 1, 0) && mCasing >= 16 && checkHatch();
- }
-
- public final boolean addLargeSemifluidGeneratorList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- public final boolean addLargeSemifluidGeneratorBackList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo || this.isThisHatchMultiDynamo(aTileEntity)){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getCasingMeta() {
- return 2;
- }
-
- public Block getIntakeBlock() {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getIntakeMeta() {
- return 13;
- }
-
- public Block getGearboxBlock() {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getGearboxMeta() {
- return 3;
- }
-
- public byte getCasingTextureIndex() {
- return 50;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_LargeSemifluidGenerator(this.mName);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 1;
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return boostEu ? 15000 : 10000;
- }
-
- @Override
- public int getPollutionPerSecond(ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiLargeSemiFluidGenerator;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return true;
- }
-
- @Override
- public String[] getExtraInfoData() {
- return new String[]{
- "Large Semifluid Generator",
- "Current Output: " + mEUt * mEfficiency / 10000 + " EU/t",
- "Fuel Consumption: " + fuelConsumption + "L/t",
- "Fuel Value: " + fuelValue + " EU/L",
- "Fuel Remaining: " + fuelRemaining + " Litres",
- "Current Efficiency: " + (mEfficiency / 100) + "%",
- getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance"};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Semifluid Generator";
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 0;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
+public class GregtechMetaTileEntity_LargeSemifluidGenerator
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeSemifluidGenerator>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_LargeSemifluidGenerator> STRUCTURE_DEFINITION = null;
+
+ protected int fuelConsumption = 0;
+ protected int fuelValue = 0;
+ protected int fuelRemaining = 0;
+ protected boolean boostEu = false;
+
+ public GregtechMetaTileEntity_LargeSemifluidGenerator(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_LargeSemifluidGenerator(String aName) {
+ super(aName);
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Large Semifluid Generator")
+ .addInfo("Engine Intake Casings must not be obstructed in front (only air blocks)")
+ .addInfo("Supply Semifluid Fuels and 2000L of Lubricant per hour to run.")
+ .addInfo("Supply 80L of Oxygen per second to boost output (optional).")
+ .addInfo("Default: Produces 2048EU/t at 100% efficiency")
+ .addInfo("Boosted: Produces 6144EU/t at 150% efficiency")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 4, false)
+ .addController("Front Center")
+ .addCasingInfo("Stable Titanium Machine Casing", 16)
+ .addCasingInfo("Steel Gear Box Machine Casing", 2)
+ .addCasingInfo("Engine Intake Machine Casing", 8)
+ .addInputHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .addDynamoHatch("Back Center", 2)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return 50;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return getMaxEfficiency(aStack) > 0;
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeDieselEngine.png");
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+
+ // Check for lubricant and oxygen first, so we can compute costs ahead of time.
+ // This will allow us to check costs without needing to actually try to deplete fluids
+ // (wasting earlier fluids in the check if later fluids turn out to be insufficient).
+ FluidStack lubricant = Materials.Lubricant.getFluid(0L);
+ FluidStack oxygen = Materials.Oxygen.getGas(0L);
+ for (FluidStack hatchFluid : tFluids) {
+ if (hatchFluid.isFluidEqual(lubricant)) {
+ lubricant.amount = Math.max(lubricant.amount, hatchFluid.amount);
+ } else if (hatchFluid.isFluidEqual(oxygen)) {
+ oxygen.amount = Math.max(oxygen.amount, hatchFluid.amount);
+ }
+ }
+ boostEu = oxygen.amount >= 4L;
+ long lubricantCost = boostEu ? 2L : 1L;
+ if (lubricant.amount < lubricantCost) {
+ return false;
+ }
+
+ for (FluidStack hatchFluid : tFluids) { // Loops through hatches
+ GT_Recipe aFuel = GTPP_Recipe_Map.sSemiFluidLiquidFuels.findFuel(hatchFluid);
+ if (aFuel == null) {
+ // Not a valid semi-fluid fuel.
+ continue;
+ }
+
+ int newEUt = boostEu ? 4096 : 2048;
+ fuelConsumption = newEUt / aFuel.mSpecialValue; // Calc fuel consumption
+ FluidStack tLiquid = new FluidStack(hatchFluid.getFluid(), fuelConsumption);
+ if (depleteInput(tLiquid)) { // Deplete that amount
+ // We checked beforehand, so both of these depletions should succeed.
+ // But check the return values anyway just to be safe.
+ if (boostEu) {
+ if (!depleteInput(Materials.Oxygen.getGas(4L))) {
+ return false;
+ }
+ }
+ // Deplete Lubricant. 2000L should = 1 hour of runtime (if baseEU = 2048)
+ if (mRuntime % 72 == 0 || mRuntime == 0) {
+ if (!depleteInput(Materials.Lubricant.getFluid(lubricantCost))) {
+ return false;
+ }
+ }
+
+ fuelValue = aFuel.mSpecialValue;
+ fuelRemaining = hatchFluid.amount; // Record available fuel
+ this.mEUt = mEfficiency < 2000 ? 0 : newEUt; // Output 0 if startup is less than 20%
+ this.mProgresstime = 1;
+ this.mMaxProgresstime = 1;
+ this.mEfficiencyIncrease = 15;
+ return true;
+ }
+ }
+
+ this.mEUt = 0;
+ this.mEfficiency = 0;
+ return false;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_LargeSemifluidGenerator> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeSemifluidGenerator>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"III", "CCC", "CCC", "CCC"},
+ {"I~I", "CGC", "CGC", "CMC"},
+ {"III", "CCC", "CCC", "CCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_LargeSemifluidGenerator.class)
+ .atLeast(Muffler, InputHatch, Maintenance)
+ .casingIndex(getCasingTextureIndex())
+ .dot(1)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))
+ .addElement('G', ofBlock(getGearboxBlock(), getGearboxMeta()))
+ .addElement('I', ofBlock(getIntakeBlock(), getIntakeMeta()))
+ .addElement('M', Dynamo.or(TTDynamo).newAny(getCasingTextureIndex(), 2))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mDynamoHatches.clear();
+ return checkPiece(mName, 1, 1, 0) && mCasing >= 16 && checkHatch();
+ }
+
+ public final boolean addLargeSemifluidGeneratorList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ public final boolean addLargeSemifluidGeneratorBackList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo || this.isThisHatchMultiDynamo(aTileEntity)) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getCasingMeta() {
+ return 2;
+ }
+
+ public Block getIntakeBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getIntakeMeta() {
+ return 13;
+ }
+
+ public Block getGearboxBlock() {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getGearboxMeta() {
+ return 3;
+ }
+
+ public byte getCasingTextureIndex() {
+ return 50;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_LargeSemifluidGenerator(this.mName);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 1;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return boostEu ? 15000 : 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiLargeSemiFluidGenerator;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ return new String[] {
+ "Large Semifluid Generator",
+ "Current Output: " + mEUt * mEfficiency / 10000 + " EU/t",
+ "Fuel Consumption: " + fuelConsumption + "L/t",
+ "Fuel Value: " + fuelValue + " EU/L",
+ "Fuel Remaining: " + fuelRemaining + " Litres",
+ "Current Efficiency: " + (mEfficiency / 100) + "%",
+ getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance"
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Semifluid Generator";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 0;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
index f629c27b24..39f2958dfb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
@@ -1,8 +1,11 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -26,6 +29,9 @@ import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MatterFab;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MatterFab;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
@@ -34,648 +40,660 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_MassFabricator> implements ISurvivalConstructable {
-
- public static int sUUAperUUM = 1;
- public static int sUUASpeedBonus = 4;
- public static int sDurationMultiplier = 3200;
-
- public int mMatterProduced = 0;
- public int mScrapProduced = 0;
- public int mAmplifierProduced = 0;
- public int mScrapUsed = 0;
- public int mAmplifierUsed = 0;
-
- public static String mCasingName1 = "Matter Fabricator Casing";
- public static String mCasingName2 = "Containment Casing";
- public static String mCasingName3 = "Matter Generation Coil";
-
- private int mMode = 0;
-
- private final static int MODE_SCRAP = 1;
- private final static int MODE_UU = 0;
-
- public static boolean sRequiresUUA = false;
- private static FluidStack[] mUU = new FluidStack[2];
- private static ItemStack mScrap[] = new ItemStack[2];
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_MassFabricator> STRUCTURE_DEFINITION = null;
-
- public int getAmplifierUsed(){
- return this.mAmplifierUsed;
- }
-
- public int getMatterProduced(){
- return this.mMatterProduced;
- }
-
- public int getScrapProduced(){
- return this.mScrapProduced;
- }
-
- public GregtechMetaTileEntity_MassFabricator(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_MassFabricator(final String aName) {
- super(aName);
- }
-
- @Override
- public String getMachineType() {
- return "Mass Fabricator / Recycler";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Matter Fabricator")
- .addInfo("Speed: +0% | EU Usage: 80%")
- .addInfo("Parallel: Scrap = 64 | UU = 8 * Tier")
- .addInfo("Produces UU-A, UU-M & Scrap")
- .addInfo("Change mode with screwdriver")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(5, 4, 5, true)
- .addController("Front Center")
- .addCasingInfo(mCasingName3, 9)
- .addCasingInfo(mCasingName2, 24)
- .addCasingInfo(mCasingName1, 40)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .addOutputHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .addMaintenanceHatch("Any Casing", 1)
- .addMufflerHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_MatterFab_Active_Animated;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_MatterFab_Animated;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(9);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "MatterFabricator";
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MatterFab(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MatterFabricator.png");
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_MatterFab(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public void onConfigLoad(final GT_Config aConfig) {
- super.onConfigLoad(aConfig);
- sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
- sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
- sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
- sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
- //Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- ArrayList<ItemStack> tItems = getStoredInputs();
- ArrayList<FluidStack> tFluids = getStoredFluids();
- ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
- FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
- init();
- return checkRecipeGeneric(tItemInputs, tFluidInputs, 4, 80, 00, 10000);
- }
-
- public static boolean sInit = false;
-
- public static void init() {
- if (!sInit) {
- if (mScrap[0] == null) {
- mScrap[0] = ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrap"));
- }
- if (mScrap[1] == null) {
- mScrap[1] = ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrapbox"));
- }
- if (mUU[0] == null) {
- mUU[0] = Materials.UUAmplifier.getFluid(100);
- }
- if (mUU[1] == null) {
- mUU[1] = Materials.UUMatter.getFluid(100);
- }
- sInit = true;
- }
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_MassFabricator> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_MassFabricator>builder()
- .addShape(mName, transpose(new String[][]{
- {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"},
- {"CGGGC", "G---G", "G---G", "G---G", "CGGGC"},
- {"CGGGC", "G---G", "G---G", "G---G", "CGGGC"},
- {"CC~CC", "CHHHC", "CHHHC", "CHHHC", "CCCCC"},
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_MassFabricator.class)
- .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler)
- .casingIndex(TAE.GTPP_INDEX(9))
- .dot(1)
- .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 9)))
- )
- .addElement(
- 'H',
- ofBlock(
- ModBlocks.blockCasingsMisc, 8
- )
- )
- .addElement(
- 'G',
- ofBlock(
- ModBlocks.blockCasings3Misc, 15
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 2, 3, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 2, 3, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- return checkPiece(mName, 2, 3, 0) && mCasing >= 40 && checkHatch();
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiMassFabricator;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 10;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_MassFabricator(this.mName);
- }
-
- /**
- * Special Recipe Handling
- */
-
-
- @Override
- public GT_Recipe_Map getRecipeMap() {
- return this.mMode == MODE_SCRAP ? GT_Recipe_Map.sRecyclerRecipes : GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes;
- //return Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes;
- }
-
- @Override
- public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
- if (this.mMode == MODE_SCRAP) {
- return checkRecipeScrap(aItemInputs, aFluidInputs, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll);
- }
- else {
- return checkRecipeUU(aItemInputs, aFluidInputs, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll);
- }
- }
-
- public boolean checkRecipeScrap(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
-
- if (aItemInputs == null || aItemInputs.length <= 0) {
- return false;
- }
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- ItemStack aPotentialOutput = GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(1, aItemInputs[0]), 0);
- GT_Recipe tRecipe = new GTPP_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aItemInputs[0])}, aPotentialOutput == null ? null : new ItemStack[]{aPotentialOutput}, null, new int[]{2000}, null, null, 40, MaterialUtils.getVoltageForTier(1), 0);
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- int parallelRecipes = 0;
- // Count recipes to do in parallel, consuming input items and fluids and
- // considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- break;
- }
- log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ". ");
- tTotalEUt += tRecipeEUt;
- }
- log("Broke at " + parallelRecipes + ".");
- if (parallelRecipes > 0) {
- // -- Try not to fail after this point - inputs have already been
- // consumed! --
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe
- // duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
- this.mEUt = (int) Math.ceil(tTotalEUt);
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- }
- else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 4;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
- tOutputItems = removeNulls(tOutputItems);
- for (ItemStack aOutputStack : tOutputItems) {
- if (aOutputStack != null) {
- mScrapProduced += aOutputStack.stackSize;
- }
- }
- // Sanitize item stack size, splitting any stacks greater than max
- // stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0)
- tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
- // Commit outputs
- this.mOutputItems = tOutputItems;
- updateSlots();
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
- return true;
- }
- return false;
- }
-
- public boolean checkRecipeUU(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
-
-
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- GT_Recipe tRecipe = findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, false, aFluidInputs, aItemInputs)) {
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- log("Broke at "+parallelRecipes+".");
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 4;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
-
- int aMatterProduced = 0;
- int aAmplifierProduced = 0;
- int aScrapUsed = 0;
- int aAmplifierUsed = 0;
-
- for (int i=0; i<parallelRecipes; i++) {
- //Logger.INFO("Trying to bump stats "+i);
- for (ItemStack aInput : tRecipe.mInputs) {
- if (aInput != null && GT_Utility.areStacksEqual(aInput, mScrap[0], true)) {
- aScrapUsed += aInput.stackSize;
- //Logger.INFO("Found Scrap to use.");
- }
- }
- for (FluidStack aInput : tRecipe.mFluidInputs) {
- if (aInput != null && GT_Utility.areFluidsEqual(aInput, mUU[0], true)) {
- aAmplifierUsed += aInput.amount;
- //Logger.INFO("Found UU-A to use.");
- }
- }
- for (FluidStack aOutput : tRecipe.mFluidOutputs) {
- if (aOutput != null && GT_Utility.areFluidsEqual(aOutput, mUU[0], true)) {
- aAmplifierProduced += aOutput.amount;
- //Logger.INFO("Found UU-A as Output.");
- }
- if (aOutput != null && GT_Utility.areFluidsEqual(aOutput, mUU[1], true)) {
- aMatterProduced += aOutput.amount;
- //Logger.INFO("Found UU-M as Output.");
- }
- }
- }
-
- this.mMatterProduced += aMatterProduced;
- this.mAmplifierProduced += aAmplifierProduced;
- this.mScrapUsed += aScrapUsed;
- this.mAmplifierUsed += aAmplifierUsed;
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
-
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
-
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return this.mMode == MODE_SCRAP ? 64 : 8 * (Math.max(1, GT_Utility.getTier(getMaxInputVoltage())));
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 80;
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- int aMode = this.mMode + 1;
- if (aMode > 1) {
- this.mMode = MODE_UU;
- PlayerUtils.messagePlayer(aPlayer, "Mode ["+this.mMode+"]: Matter/AmpliFabricator");
- }
- else if (aMode == 1) {
- this.mMode = MODE_SCRAP;
- PlayerUtils.messagePlayer(aPlayer, "Mode ["+this.mMode+"]: Recycler");
- }
- else {
- this.mMode = MODE_SCRAP;
- PlayerUtils.messagePlayer(aPlayer, "Mode ["+this.mMode+"]: Recycler");
- }
- GT_Recipe_Map r = this.getRecipeMap();
- final Collection<GT_Recipe> x = r.mRecipeList;
- Logger.INFO("Dumping " + r.mUnlocalizedName + " Recipes for Debug. size: "+x.size());
- for (final GT_Recipe newBo : x) {
- Logger.INFO("========================");
- Logger.INFO("Dumping Input: " + ItemUtils.getArrayStackNames(newBo.mInputs));
- Logger.INFO("Dumping Inputs " + ItemUtils.getFluidArrayStackNames(newBo.mFluidInputs));
- Logger.INFO("Dumping Duration: " + newBo.mDuration);
- Logger.INFO("Dumping EU/t: " + newBo.mEUt);
- Logger.INFO("Dumping Output: " + ItemUtils.getArrayStackNames(newBo.mOutputs));
- Logger.INFO("Dumping Output: " + ItemUtils.getFluidArrayStackNames(newBo.mFluidOutputs));
- Logger.INFO("========================");
- }
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mScrapProduced", mScrapProduced);
- aNBT.setInteger("mAmplifierProduced", mAmplifierProduced);
- aNBT.setInteger("mMatterProduced", mMatterProduced);
- aNBT.setInteger("mScrapUsed", mScrapUsed);
- aNBT.setInteger("mAmplifierUsed", mAmplifierUsed);
- aNBT.setInteger("mMode", mMode);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mScrapProduced = aNBT.getInteger("mScrapProduced");
- mAmplifierProduced = aNBT.getInteger("mAmplifierProduced");
- mMatterProduced = aNBT.getInteger("mMatterProduced");
- mScrapUsed = aNBT.getInteger("mScrapUsed");
- mAmplifierUsed = aNBT.getInteger("mAmplifierUsed");
- mMode = aNBT.getInteger("mMode");
- super.loadNBTData(aNBT);
- }
-
-} \ No newline at end of file
+public class GregtechMetaTileEntity_MassFabricator
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_MassFabricator> implements ISurvivalConstructable {
+
+ public static int sUUAperUUM = 1;
+ public static int sUUASpeedBonus = 4;
+ public static int sDurationMultiplier = 3200;
+
+ public int mMatterProduced = 0;
+ public int mScrapProduced = 0;
+ public int mAmplifierProduced = 0;
+ public int mScrapUsed = 0;
+ public int mAmplifierUsed = 0;
+
+ public static String mCasingName1 = "Matter Fabricator Casing";
+ public static String mCasingName2 = "Containment Casing";
+ public static String mCasingName3 = "Matter Generation Coil";
+
+ private int mMode = 0;
+
+ private static final int MODE_SCRAP = 1;
+ private static final int MODE_UU = 0;
+
+ public static boolean sRequiresUUA = false;
+ private static FluidStack[] mUU = new FluidStack[2];
+ private static ItemStack mScrap[] = new ItemStack[2];
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_MassFabricator> STRUCTURE_DEFINITION = null;
+
+ public int getAmplifierUsed() {
+ return this.mAmplifierUsed;
+ }
+
+ public int getMatterProduced() {
+ return this.mMatterProduced;
+ }
+
+ public int getScrapProduced() {
+ return this.mScrapProduced;
+ }
+
+ public GregtechMetaTileEntity_MassFabricator(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_MassFabricator(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Mass Fabricator / Recycler";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Matter Fabricator")
+ .addInfo("Speed: +0% | EU Usage: 80%")
+ .addInfo("Parallel: Scrap = 64 | UU = 8 * Tier")
+ .addInfo("Produces UU-A, UU-M & Scrap")
+ .addInfo("Change mode with screwdriver")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(5, 4, 5, true)
+ .addController("Front Center")
+ .addCasingInfo(mCasingName3, 9)
+ .addCasingInfo(mCasingName2, 24)
+ .addCasingInfo(mCasingName1, 40)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .addOutputHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .addMaintenanceHatch("Any Casing", 1)
+ .addMufflerHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_MatterFab_Active_Animated;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_MatterFab_Animated;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(9);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "MatterFabricator";
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MatterFab(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MatterFabricator.png");
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_MatterFab(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public void onConfigLoad(final GT_Config aConfig) {
+ super.onConfigLoad(aConfig);
+ sDurationMultiplier = aConfig.get(
+ ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
+ sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
+ sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
+ sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
+ // Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
+ FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
+ init();
+ return checkRecipeGeneric(tItemInputs, tFluidInputs, 4, 80, 00, 10000);
+ }
+
+ public static boolean sInit = false;
+
+ public static void init() {
+ if (!sInit) {
+ if (mScrap[0] == null) {
+ mScrap[0] = ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrap"));
+ }
+ if (mScrap[1] == null) {
+ mScrap[1] = ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrapbox"));
+ }
+ if (mUU[0] == null) {
+ mUU[0] = Materials.UUAmplifier.getFluid(100);
+ }
+ if (mUU[1] == null) {
+ mUU[1] = Materials.UUMatter.getFluid(100);
+ }
+ sInit = true;
+ }
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_MassFabricator> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_MassFabricator>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"},
+ {"CGGGC", "G---G", "G---G", "G---G", "CGGGC"},
+ {"CGGGC", "G---G", "G---G", "G---G", "CGGGC"},
+ {"CC~CC", "CHHHC", "CHHHC", "CHHHC", "CCCCC"},
+ }))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_MassFabricator.class)
+ .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler)
+ .casingIndex(TAE.GTPP_INDEX(9))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 9))))
+ .addElement('H', ofBlock(ModBlocks.blockCasingsMisc, 8))
+ .addElement('G', ofBlock(ModBlocks.blockCasings3Misc, 15))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 2, 3, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 2, 3, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ return checkPiece(mName, 2, 3, 0) && mCasing >= 40 && checkHatch();
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiMassFabricator;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 10;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_MassFabricator(this.mName);
+ }
+
+ /**
+ * Special Recipe Handling
+ */
+ @Override
+ public GT_Recipe_Map getRecipeMap() {
+ return this.mMode == MODE_SCRAP
+ ? GT_Recipe_Map.sRecyclerRecipes
+ : GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes;
+ // return Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes;
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+ if (this.mMode == MODE_SCRAP) {
+ return checkRecipeScrap(
+ aItemInputs,
+ aFluidInputs,
+ getMaxParallelRecipes(),
+ getEuDiscountForParallelism(),
+ aSpeedBonusPercent,
+ aOutputChanceRoll);
+ } else {
+ return checkRecipeUU(
+ aItemInputs,
+ aFluidInputs,
+ getMaxParallelRecipes(),
+ getEuDiscountForParallelism(),
+ aSpeedBonusPercent,
+ aOutputChanceRoll);
+ }
+ }
+
+ public boolean checkRecipeScrap(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ int aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+
+ if (aItemInputs == null || aItemInputs.length <= 0) {
+ return false;
+ }
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ ItemStack aPotentialOutput = GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(1, aItemInputs[0]), 0);
+ GT_Recipe tRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {GT_Utility.copyAmount(1, aItemInputs[0])},
+ aPotentialOutput == null ? null : new ItemStack[] {aPotentialOutput},
+ null,
+ new int[] {2000},
+ null,
+ null,
+ 40,
+ MaterialUtils.getVoltageForTier(1),
+ 0);
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ int parallelRecipes = 0;
+ // Count recipes to do in parallel, consuming input items and fluids and
+ // considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ". ");
+ tTotalEUt += tRecipeEUt;
+ }
+ log("Broke at " + parallelRecipes + ".");
+ if (parallelRecipes > 0) {
+ // -- Try not to fail after this point - inputs have already been
+ // consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe
+ // duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 4;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+ tOutputItems = removeNulls(tOutputItems);
+ for (ItemStack aOutputStack : tOutputItems) {
+ if (aOutputStack != null) {
+ mScrapProduced += aOutputStack.stackSize;
+ }
+ }
+ // Sanitize item stack size, splitting any stacks greater than max
+ // stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ updateSlots();
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean checkRecipeUU(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ int aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll) {
+
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ aFluidInputs,
+ aItemInputs);
+
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + aMaxParallelRecipes);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, false, aFluidInputs, aItemInputs)) {
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ log("Broke at " + parallelRecipes + ".");
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 4;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ int aMatterProduced = 0;
+ int aAmplifierProduced = 0;
+ int aScrapUsed = 0;
+ int aAmplifierUsed = 0;
+
+ for (int i = 0; i < parallelRecipes; i++) {
+ // Logger.INFO("Trying to bump stats "+i);
+ for (ItemStack aInput : tRecipe.mInputs) {
+ if (aInput != null && GT_Utility.areStacksEqual(aInput, mScrap[0], true)) {
+ aScrapUsed += aInput.stackSize;
+ // Logger.INFO("Found Scrap to use.");
+ }
+ }
+ for (FluidStack aInput : tRecipe.mFluidInputs) {
+ if (aInput != null && GT_Utility.areFluidsEqual(aInput, mUU[0], true)) {
+ aAmplifierUsed += aInput.amount;
+ // Logger.INFO("Found UU-A to use.");
+ }
+ }
+ for (FluidStack aOutput : tRecipe.mFluidOutputs) {
+ if (aOutput != null && GT_Utility.areFluidsEqual(aOutput, mUU[0], true)) {
+ aAmplifierProduced += aOutput.amount;
+ // Logger.INFO("Found UU-A as Output.");
+ }
+ if (aOutput != null && GT_Utility.areFluidsEqual(aOutput, mUU[1], true)) {
+ aMatterProduced += aOutput.amount;
+ // Logger.INFO("Found UU-M as Output.");
+ }
+ }
+ }
+
+ this.mMatterProduced += aMatterProduced;
+ this.mAmplifierProduced += aAmplifierProduced;
+ this.mScrapUsed += aScrapUsed;
+ this.mAmplifierUsed += aAmplifierUsed;
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ log("GOOD RETURN - 1");
+ return true;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return this.mMode == MODE_SCRAP ? 64 : 8 * (Math.max(1, GT_Utility.getTier(getMaxInputVoltage())));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 80;
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ int aMode = this.mMode + 1;
+ if (aMode > 1) {
+ this.mMode = MODE_UU;
+ PlayerUtils.messagePlayer(aPlayer, "Mode [" + this.mMode + "]: Matter/AmpliFabricator");
+ } else if (aMode == 1) {
+ this.mMode = MODE_SCRAP;
+ PlayerUtils.messagePlayer(aPlayer, "Mode [" + this.mMode + "]: Recycler");
+ } else {
+ this.mMode = MODE_SCRAP;
+ PlayerUtils.messagePlayer(aPlayer, "Mode [" + this.mMode + "]: Recycler");
+ }
+ GT_Recipe_Map r = this.getRecipeMap();
+ final Collection<GT_Recipe> x = r.mRecipeList;
+ Logger.INFO("Dumping " + r.mUnlocalizedName + " Recipes for Debug. size: " + x.size());
+ for (final GT_Recipe newBo : x) {
+ Logger.INFO("========================");
+ Logger.INFO("Dumping Input: " + ItemUtils.getArrayStackNames(newBo.mInputs));
+ Logger.INFO("Dumping Inputs " + ItemUtils.getFluidArrayStackNames(newBo.mFluidInputs));
+ Logger.INFO("Dumping Duration: " + newBo.mDuration);
+ Logger.INFO("Dumping EU/t: " + newBo.mEUt);
+ Logger.INFO("Dumping Output: " + ItemUtils.getArrayStackNames(newBo.mOutputs));
+ Logger.INFO("Dumping Output: " + ItemUtils.getFluidArrayStackNames(newBo.mFluidOutputs));
+ Logger.INFO("========================");
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mScrapProduced", mScrapProduced);
+ aNBT.setInteger("mAmplifierProduced", mAmplifierProduced);
+ aNBT.setInteger("mMatterProduced", mMatterProduced);
+ aNBT.setInteger("mScrapUsed", mScrapUsed);
+ aNBT.setInteger("mAmplifierUsed", mAmplifierUsed);
+ aNBT.setInteger("mMode", mMode);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mScrapProduced = aNBT.getInteger("mScrapProduced");
+ mAmplifierProduced = aNBT.getInteger("mAmplifierProduced");
+ mMatterProduced = aNBT.getInteger("mMatterProduced");
+ mScrapUsed = aNBT.getInteger("mScrapUsed");
+ mAmplifierUsed = aNBT.getInteger("mAmplifierUsed");
+ mMode = aNBT.getInteger("mMode");
+ super.loadNBTData(aNBT);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java
index c404efd1cb..a83f19fa74 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java
@@ -1,5 +1,13 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.filterByMTETier;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -20,240 +28,213 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gregtech.api.util.GT_StructureUtility.filterByMTETier;
-
-public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Refinery> implements ISurvivalConstructable {
-
- private int mCasing;
- private IStructureDefinition<GregtechMetaTileEntity_Refinery> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_Refinery(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_Refinery(final String aName) {
- super(aName);
- }
-
- @Override
- public String getMachineType() {
- return "Fuel Refinery";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Fission Fuel Processing Unit")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(3, 9, 3, false)
- .addController("Bottom Center")
- .addCasingInfo("Hastelloy-X Structural Casing", 7)
- .addCasingInfo("Incoloy-DS Fluid Containment Block", 5)
- .addCasingInfo("Zeron-100 Reactor Shielding", 4)
- .addCasingInfo("Hastelloy-N Sealant Blocks", 17)
- .addInputHatch("Base platform", 1)
- .addOutputHatch("Base platform", 1)
- .addOutputBus("Base platform", 1)
- .addMufflerHatch("Base platform", 1)
- .addMaintenanceHatch("Base platform", 1)
- .addEnergyHatch("Base platform", 1)
- .addStructureInfo("Muffler's Tier must be LuV+")
- .addStructureInfo("4x Input Hatches, 2x Output Hatches, 1x Output Bus")
- .addStructureInfo("1x Muffler, 1x Maintenance Hatch, 1x Energy Hatch")
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER;
- }
-
- @Override
- protected int getCasingTextureId() {
- return TAE.GTPP_INDEX(18);
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return "MatterFabricator";
- }
-
- @Override
- public GT_Recipe_Map getRecipeMap() {
- return GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- //this.resetRecipeMapForAllInputHatches();
- for (GT_MetaTileEntity_Hatch_Input g : this.mInputHatches) {
- g.mRecipeMap = null;
- }
- boolean ab = super.checkRecipeGeneric();
- //Logger.INFO("Did Recipe? "+ab);
- return ab;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 6) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_Refinery> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Refinery>builder()
- .addShape(mName, transpose(new String[][]{
- {" ", " N ", " "},
- {" N ", "NIN", " N "},
- {" N ", "NIN", " N "},
- {" N ", "NIN", " N "},
- {" Z ", "ZIZ", " Z "},
- {" N ", "NIN", " N "},
- {"XXX", "XXX", "XXX"},
- {"X~X", "XXX", "XXX"},
- }))
- .addElement(
- 'X',
- ofChain(
- buildHatchAdder(GregtechMetaTileEntity_Refinery.class)
- .atLeast(Energy, Maintenance, OutputHatch, OutputBus, InputHatch)
- .casingIndex(TAE.GTPP_INDEX(18))
- .dot(1)
- .build(),
- buildHatchAdder(GregtechMetaTileEntity_Refinery.class)
- .atLeast(Muffler)
- .adder(GregtechMetaTileEntity_Refinery::addMufflerToMachineList)
- .hatchItemFilterAnd(t -> filterByMTETier(6, Integer.MAX_VALUE))
- .casingIndex(TAE.GTPP_INDEX(18))
- .dot(1)
- .build(),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasings2Misc, 2
- )
- )
- )
- )
- .addElement(
- 'I',
- ofBlock(
- ModBlocks.blockCasings2Misc, 3
- )
- )
- .addElement(
- 'N',
- ofBlock(
- ModBlocks.blockCasings2Misc, 1
- )
- )
- .addElement(
- 'Z',
- ofBlock(
- ModBlocks.blockCasingsMisc, 13
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 7, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 1, 7, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- if (checkPiece(mName, 1, 7, 0) && mCasing >= 7) {
- if (this.mInputHatches.size() == 4 && this.mOutputHatches.size() == 2 &&
- this.mOutputBusses.size() == 1 && this.mMufflerHatches.size() == 1 &&
- this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() == 1) {
- this.resetRecipeMapForAllInputHatches(this.getRecipeMap());
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiRefinery;
- }
-
- @Override
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- public int getAmountOfOutputs() {
- return 5;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_Refinery(this.mName);
- }
-
+public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Refinery>
+ implements ISurvivalConstructable {
+
+ private int mCasing;
+ private IStructureDefinition<GregtechMetaTileEntity_Refinery> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_Refinery(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_Refinery(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Fuel Refinery";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Fission Fuel Processing Unit")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 9, 3, false)
+ .addController("Bottom Center")
+ .addCasingInfo("Hastelloy-X Structural Casing", 7)
+ .addCasingInfo("Incoloy-DS Fluid Containment Block", 5)
+ .addCasingInfo("Zeron-100 Reactor Shielding", 4)
+ .addCasingInfo("Hastelloy-N Sealant Blocks", 17)
+ .addInputHatch("Base platform", 1)
+ .addOutputHatch("Base platform", 1)
+ .addOutputBus("Base platform", 1)
+ .addMufflerHatch("Base platform", 1)
+ .addMaintenanceHatch("Base platform", 1)
+ .addEnergyHatch("Base platform", 1)
+ .addStructureInfo("Muffler's Tier must be LuV+")
+ .addStructureInfo("4x Input Hatches, 2x Output Hatches, 1x Output Bus")
+ .addStructureInfo("1x Muffler, 1x Maintenance Hatch, 1x Energy Hatch")
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return TAE.GTPP_INDEX(18);
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "MatterFabricator";
+ }
+
+ @Override
+ public GT_Recipe_Map getRecipeMap() {
+ return GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ // this.resetRecipeMapForAllInputHatches();
+ for (GT_MetaTileEntity_Hatch_Input g : this.mInputHatches) {
+ g.mRecipeMap = null;
+ }
+ boolean ab = super.checkRecipeGeneric();
+ // Logger.INFO("Did Recipe? "+ab);
+ return ab;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler
+ && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 6) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_Refinery> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Refinery>builder()
+ .addShape(mName, transpose(new String[][] {
+ {" ", " N ", " "},
+ {" N ", "NIN", " N "},
+ {" N ", "NIN", " N "},
+ {" N ", "NIN", " N "},
+ {" Z ", "ZIZ", " Z "},
+ {" N ", "NIN", " N "},
+ {"XXX", "XXX", "XXX"},
+ {"X~X", "XXX", "XXX"},
+ }))
+ .addElement(
+ 'X',
+ ofChain(
+ buildHatchAdder(GregtechMetaTileEntity_Refinery.class)
+ .atLeast(Energy, Maintenance, OutputHatch, OutputBus, InputHatch)
+ .casingIndex(TAE.GTPP_INDEX(18))
+ .dot(1)
+ .build(),
+ buildHatchAdder(GregtechMetaTileEntity_Refinery.class)
+ .atLeast(Muffler)
+ .adder(GregtechMetaTileEntity_Refinery::addMufflerToMachineList)
+ .hatchItemFilterAnd(t -> filterByMTETier(6, Integer.MAX_VALUE))
+ .casingIndex(TAE.GTPP_INDEX(18))
+ .dot(1)
+ .build(),
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 2))))
+ .addElement('I', ofBlock(ModBlocks.blockCasings2Misc, 3))
+ .addElement('N', ofBlock(ModBlocks.blockCasings2Misc, 1))
+ .addElement('Z', ofBlock(ModBlocks.blockCasingsMisc, 13))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 1, 7, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 1, 7, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ if (checkPiece(mName, 1, 7, 0) && mCasing >= 7) {
+ if (this.mInputHatches.size() == 4
+ && this.mOutputHatches.size() == 2
+ && this.mOutputBusses.size() == 1
+ && this.mMufflerHatches.size() == 1
+ && this.mMaintenanceHatches.size() == 1
+ && this.mEnergyHatches.size() == 1) {
+ this.resetRecipeMapForAllInputHatches(this.getRecipeMap());
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiRefinery;
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 5;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_Refinery(this.mName);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java
index 7d7789b0b6..1a98737700 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java
@@ -1,6 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static gregtech.api.enums.GT_HatchElement.InputHatch;
+import static gregtech.api.enums.GT_HatchElement.Maintenance;
+import static gregtech.api.enums.GT_HatchElement.OutputHatch;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -23,6 +29,7 @@ import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.tileentities.misc.TileEntitySolarHeater;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -32,703 +39,787 @@ import net.minecraft.world.World;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static gregtech.api.enums.GT_HatchElement.InputHatch;
-import static gregtech.api.enums.GT_HatchElement.Maintenance;
-import static gregtech.api.enums.GT_HatchElement.OutputHatch;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-
-public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SolarTower> implements ISurvivalConstructable {
-
- //862
- private static final int mCasingTextureID = TAE.getIndexFromPage(3, 9);
- private int mHeatLevel = 0;
- private int mCasing1;
- private int mCasing2;
- private int mCasing3;
- private int mCasing4;
-
-
- public ArrayList<TileEntitySolarHeater> mSolarHeaters = new ArrayList<TileEntitySolarHeater>();
-
-
- public GregtechMetaTileEntity_SolarTower(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_SolarTower(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_SolarTower(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Solar Tower";
- }
-
- @Override
- protected final GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Contributing Green Energy towards the future")
- .addInfo("Input: "+MISC_MATERIALS.SOLAR_SALT_COLD.getLocalizedName())
- .addInfo("Output: "+MISC_MATERIALS.SOLAR_SALT_HOT.getLocalizedName())
- .addInfo("Surround with rings of Solar Heaters")
- .addInfo("Each ring increases tier")
- .addInfo("1 = 1, 2 = 2, 3 = 4, 4 = 8, 5 = 16")
- .addInfo("Tier decreases heating time and allows more salt to be processed")
- .addSeparator()
- .beginStructureBlock(6, 27, 6, false)
- .addController("Top Middle")
- .addCasingInfo("Structural Solar Casing", 229)
- .addCasingInfo("Thermally Insulated Casing", 60)
- .addCasingInfo("Salt Containment Casing", 66)
- .addCasingInfo("Thermal Containment Casing", 60)
- .addInputHatch("Any 2 dot hint(min 1)", 2)
- .addOutputHatch("Any 2 dot hint(min 1)", 2)
- .addMaintenanceHatch("Any 2 dot hint", 2)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- private static final String STRUCTURE_PIECE_BASE = "base";
- private static final String STRUCTURE_PIECE_TOWER = "tower";
- private static final String STRUCTURE_PIECE_TOP = "top";
-
- private static final String[] STRUCTURE_PIECE_SOLAR_HEATER_RING = {"ring1", "ring2", "ring3", "ring4", "ring5"};
- private static final String SOLAR_HEATER_RING_1 = STRUCTURE_PIECE_SOLAR_HEATER_RING[0];
- private static final String SOLAR_HEATER_RING_2 = STRUCTURE_PIECE_SOLAR_HEATER_RING[1];
- private static final String SOLAR_HEATER_RING_3 = STRUCTURE_PIECE_SOLAR_HEATER_RING[2];
- private static final String SOLAR_HEATER_RING_4 = STRUCTURE_PIECE_SOLAR_HEATER_RING[3];
- private static final String SOLAR_HEATER_RING_5 = STRUCTURE_PIECE_SOLAR_HEATER_RING[4];
-
- private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>>() {
- @Override
- protected IStructureDefinition<GregtechMetaTileEntity_SolarTower> computeValue(Class<?> type) {
- return StructureDefinition.<GregtechMetaTileEntity_SolarTower>builder()
-
- // s = salt
- // c = thermal containment
- // i = thermal insulated
- // t = solar structural
- // h = hatch
- // g = solar heater
-
- .addShape(STRUCTURE_PIECE_TOP, (new String[][]{
- {" ", " ", " ~ ", " ", " "},
- {" ", " s ", " sss ", " s ", " "},
- {" c ", " ccc ", "ccscc", " ccc ", " c "},
- {" c ", " ccc ", "ccscc", " ccc ", " c "},
- {" c ", " ccc ", "ccscc", " ccc ", " c "},
- {" c ", " ccc ", "ccscc", " ccc ", " c "},
- {" c ", " ccc ", "ccscc", " ccc ", " c "},
- }))
- .addShape(STRUCTURE_PIECE_TOWER, (new String[][]{
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- {" i ", "isi", " i "},
- }))
- .addShape(STRUCTURE_PIECE_BASE, (new String[][]{
- {" ", " ", " t ", " ttt ", " ttstt ", " ttssstt ", " ttstt ", " ttt ", " t ", " ", " "},
- {" ", " ", " t ", " ttt ", " tssst ", " ttssstt ", " tssst ", " ttt ", " t ", " ", " "},
- {" ", " t ", " ttt ", " ttttt ", " ttssstt ", " tttsssttt ", " ttssstt ", " ttttt ", " ttt ", " t ", " "},
- {" ", " t ", " ttt ", " ttttt ", " ttssstt ", " tttsssttt ", " ttssstt ", " ttttt ", " ttt ", " t ", " "},
- {" hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "htttsssttth", "htttsssttth", "htttsssttth", " ttttttttt ", " ttttttt ", " ttttt ", " hhh "},
- {" hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "httttttttth", "httttttttth", "httttttttth", " ttttttttt ", " ttttttt ", " ttttt ", " hhh "},
- }))
-
-
- .addShape(SOLAR_HEATER_RING_1, (new String[][]{
- {
- " ggggg ",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- " ggggg ",
- }}))
- .addShape(SOLAR_HEATER_RING_2, (new String[][]{
- {
- " ggggggggg ",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- " ggggggggg ",
- }}))
- .addShape(SOLAR_HEATER_RING_3, (new String[][]{
- {
- " ggggggggggggg ",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- " ggggggggggggg ",
- }}))
- .addShape(SOLAR_HEATER_RING_4, (new String[][]{
- {
- " ggggggggggggggggg ",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- " ggggggggggggggggg ",
- }}))
- .addShape(SOLAR_HEATER_RING_5, (new String[][]{
- {
- " ggggggggggggggggggggg ",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- "g g",
- " g g ",
- " g g ",
- " g g ",
- " g g ",
- " ggggggggggggggggggggg ",
- }}))
-
- .addElement('g', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class)
- .hatchClass(TileEntitySolarHeater.class)
- .adder(GregtechMetaTileEntity_SolarTower::addSolarHeater)
- // use a positive casing index to make adder builder happy
- .casingIndex(1)
- .dot(1)
- .continueIfSuccess()
- .build()))
- .addElement('t', lazy(t -> onElementPass(x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta()))))
- .addElement('i', lazy(t -> onElementPass(x -> ++x.mCasing2, ofBlock(t.getCasingBlock(), t.getCasingMeta2()))))
- .addElement('s', lazy(t -> onElementPass(x -> ++x.mCasing3, ofBlock(t.getCasingBlock(), t.getCasingMeta3()))))
- .addElement('c', lazy(t -> onElementPass(x -> ++x.mCasing4, ofBlock(t.getCasingBlock2(), t.getCasingMeta4()))))
- .addElement('h', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class)
- .atLeast(InputHatch, OutputHatch, Maintenance)
- .casingIndex(t.getCasingTextureIndex())
- .dot(2)
- .buildAndChain(onElementPass(x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta()))))
- )
- .build();
- }
- };
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- resetSolarHeaters();
- this.mMaintenanceHatches.clear();
- this.mInputHatches.clear();
- this.mOutputHatches.clear();
- mCasing1 = 0;
- mCasing2 = 0;
- mCasing3 = 0;
- mCasing4 = 0;
-
- boolean aStructureTop = checkPiece(STRUCTURE_PIECE_TOP, 2, 2, 0);
- log("Top Check: "+aStructureTop);
- boolean aStructureTower = checkPiece(STRUCTURE_PIECE_TOWER, 1, 1, -7);
- log("Tower Check: "+aStructureTower);
- boolean aStructureBase = checkPiece(STRUCTURE_PIECE_BASE, 5, 5, -22);
- log("Base Check: "+aStructureBase);
- boolean aCasingCount1 = mCasing1 >= 229;
- boolean aCasingCount2 = mCasing2 == 60;
- boolean aCasingCount3 = mCasing3 == 66;
- boolean aCasingCount4 = mCasing4 == 60;
- boolean aAllStructure = aStructureTop && aStructureTower && aStructureBase;
- boolean aAllCasings = aCasingCount1 && aCasingCount2 && aCasingCount3 && aCasingCount4;
- if (!aAllCasings || !aAllStructure ||
- mMaintenanceHatches.size() != 1 ||
- mInputHatches.size() < 1 ||
- mOutputHatches.size() < 1
- ) {
- log("Bad Hatches - Solar Heaters: "+mSolarHeaters.size()+
- ", Maint: "+mMaintenanceHatches.size()+
- ", Input Hatches: "+mInputHatches.size()+
- ", Output Hatches: "+mOutputHatches.size()+
- ", Top: "+aStructureTop+
- ", Tower: "+aStructureTower+
- ", Base: "+aStructureBase+
- ", Casing Count: "+aCasingCount1+" | Found: "+mCasing1+
- ", Casing Count: "+aCasingCount2+" | Found: "+mCasing2+
- ", Casing Count: "+aCasingCount3+" | Found: "+mCasing3+
- ", Casing Count: "+aCasingCount4+" | Found: "+mCasing4);
- return false;
- }
- log("Built "+this.getLocalName()+" with "+mCasing1+" Structural Solar casings, "+mCasing2+" Thermally Insulated casings, "+mCasing3+" Salt Containment casings, "+mCasing4+" Thermal Containment casings.");
- return aAllCasings && aAllStructure;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- // Tower
- buildPiece(STRUCTURE_PIECE_TOP, stackSize, hintsOnly, 2, 2, 0);
- buildPiece(STRUCTURE_PIECE_TOWER, stackSize, hintsOnly, 1, 1, -7);
- buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 5, 5, -22);
-
- //Solar Heaters
- if (stackSize.stackSize >= 1) {
- buildPiece(SOLAR_HEATER_RING_1, stackSize, hintsOnly, 7, 7, -27);
- if (stackSize.stackSize >= 2) {
- buildPiece(SOLAR_HEATER_RING_2, stackSize, hintsOnly, 9, 9, -27);
- if (stackSize.stackSize >= 3) {
- buildPiece(SOLAR_HEATER_RING_3, stackSize, hintsOnly, 11, 11, -27);
- if (stackSize.stackSize >= 4) {
- buildPiece(SOLAR_HEATER_RING_4, stackSize, hintsOnly, 13, 13, -27);
- if (stackSize.stackSize >= 5) {
- buildPiece(SOLAR_HEATER_RING_5, stackSize, hintsOnly, 15, 15, -27);
- }
- }
- }
- }
- }
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- int built;
- int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 2);
- // Tower
- built = survivialBuildPiece(STRUCTURE_PIECE_TOP, stackSize, 2, 2, 0, realBudget, source, actor, false, true);
- if (built >= 0) return built;
- built = survivialBuildPiece(STRUCTURE_PIECE_TOWER, stackSize, 1, 1, -7, realBudget, source, actor, false, true);
- if (built >= 0) return built;
- built = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 5, 5, -22, realBudget, source, actor, false, true);
- if (built >= 0) return built;
-
- //Solar Heaters
- if (stackSize.stackSize < 1) return -1;
- built = survivialBuildPiece(SOLAR_HEATER_RING_1, stackSize, 7, 7, -27, realBudget, source, actor, false, true);
- if (built >= 0) return built;
- if (stackSize.stackSize < 2) return -1;
- built = survivialBuildPiece(SOLAR_HEATER_RING_2, stackSize, 9, 9, -27, realBudget, source, actor, false, true);
- if (built >= 0) return built;
- if (stackSize.stackSize < 3) return -1;
- built = survivialBuildPiece(SOLAR_HEATER_RING_3, stackSize, 11, 11, -27, realBudget, source, actor, false, true);
- if (built >= 0) return built;
- if (stackSize.stackSize < 4) return -1;
- built = survivialBuildPiece(SOLAR_HEATER_RING_4, stackSize, 13, 13, -27, realBudget, source, actor, false, true);
- if (built >= 0) return built;
- if (stackSize.stackSize < 5) return -1;
- return survivialBuildPiece(SOLAR_HEATER_RING_5, stackSize, 15, 15, -27, realBudget, source, actor, false, true);
- }
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_SolarTower> getStructureDefinition() {
- return STRUCTURE_DEFINITION.get(getClass());
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(212));
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == 0 || aSide == 1) {
- if (aActive)
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)),
- TextureFactory.builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default_Active).extFacing().build()};
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)),
- TextureFactory.builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default).extFacing().build()};
- }
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))};
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- private int getHeaterTier() {
- int aSolarHeaterCounter = this.mSolarHeaters.size();
- if (aSolarHeaterCounter > 0) {
- if (aSolarHeaterCounter == 36) {
- return 1;
- }
- else if (aSolarHeaterCounter == 88) {
- return 2;
- }
- else if (aSolarHeaterCounter == 156) {
- return 4;
- }
- else if (aSolarHeaterCounter == 240) {
- return 8;
- }
- else if (aSolarHeaterCounter == 340) {
- return 16;
- }
- }
- return 0;
- }
-
- private int getHeaterCountForTier(int aTier) {
- switch (aTier) {
- case 1:
- return 36;
- case 2:
- return 88;
- case 4:
- return 156;
- case 8:
- return 240;
- case 16:
- return 340;
- default:
- return 0;
- }
- }
-
- public boolean getConnectedSolarReflectors(){
-
- this.mSolarHeaters.clear();
- int aRing = 1;
-
- if (this.mSolarHeaters.size() < 36) {
- // 15x15
- boolean aRing1 = checkPiece(SOLAR_HEATER_RING_1, 7, 7, -27);
- if (aRing1) {
- //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
- }
- }
- if (this.mSolarHeaters.size() < 88) {
- // 17x17
- boolean aRing2 = checkPiece(SOLAR_HEATER_RING_2, 9, 9, -27);
- if (aRing2) {
- //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
- }
- }
- if (this.mSolarHeaters.size() < 156) {
- // 19x19
- boolean aRing3 = checkPiece(SOLAR_HEATER_RING_3, 11, 11, -27);
- if (aRing3) {
- //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
- }
- }
- if (this.mSolarHeaters.size() < 240) {
- // 21x21
- boolean aRing4 = checkPiece(SOLAR_HEATER_RING_4, 13, 13, -27);
- if (aRing4) {
- //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
- }
- }
- if (this.mSolarHeaters.size() < 340) {
- // 23x23
- boolean aRing5 = checkPiece(SOLAR_HEATER_RING_5, 15, 15, -27);
- if (aRing5) {
- //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
- }
- }
- return mSolarHeaters.size() > 0;
- }
-
- private boolean addSolarHeater(IGregTechTileEntity aTileEntity, int a) {
- if (aTileEntity == null) {
- return false;
- }
- else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof TileEntitySolarHeater) {
- TileEntitySolarHeater mTile = (TileEntitySolarHeater) aMetaTileEntity;
- if (!mTile.hasSolarTower() && mTile.canSeeSky()) {
- //Logger.INFO("Found Solar Reflector, Injecting Data.");
- mTile.setSolarTower(this);
- return this.mSolarHeaters.add(mTile);
- }
- }
- }
- return false;
- }
-
- private Fluid mColdSalt = null;
- private Fluid mHotSalt = null;
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- this.mEfficiencyIncrease = 10;
- this.mMaxProgresstime = 100;
-
- if (this.mSolarHeaters.isEmpty() || this.mSolarHeaters.size() < 340 || this.getTotalRuntimeInTicks() % 200 == 0) {
- getConnectedSolarReflectors();
- }
-
- int aTier = getHeaterTier();
- int aHeaters = getHeaterCountForTier(aTier);
-
- //Manage Heat every 5s
- //Add Heat First, if sources available
- if (aHeaters > 0) {
- for (int i = 0; i < aHeaters; i++) {
- Math.min((this.mHeatLevel += aTier), 20000);
- }
- }
-
- //Remove Heat, based on time of day
- if (mHeatLevel > 0) {
- if (mHeatLevel > 20000) {
- this.mHeatLevel = 20000;
- }
- }
- World w = this.getBaseMetaTileEntity().getWorld();
- if (w != null) {
- int aRemovalFactor = 0;
- if (w.isDaytime()) {
- aRemovalFactor = 1;
- }
- else {
- aRemovalFactor = 8;
- }
- for (int i = 0; i<MathUtils.randInt((aHeaters/10), aHeaters); i++){
- this.mHeatLevel -= aRemovalFactor;
- }
- }
-
- if (this.mEfficiency == this.getMaxEfficiency(null) && this.mHeatLevel >= 10000) {
- if (mColdSalt == null) {
- mColdSalt = MISC_MATERIALS.SOLAR_SALT_COLD.getFluid();
- }
- if (mHotSalt == null) {
- mHotSalt = MISC_MATERIALS.SOLAR_SALT_HOT.getFluid();
- }
- ArrayList<FluidStack> aFluids = this.getStoredFluids();
- for (FluidStack aFluid : aFluids) {
- if (aFluid.getFluid().equals(mColdSalt)) {
- if (aFluid.amount >= (aTier * 1000)) {
- this.depleteInput(FluidUtils.getFluidStack(mColdSalt, (aTier * 1000)));
- this.addOutput(FluidUtils.getFluidStack(mHotSalt, (aTier * 1000)));
- break;
- }
- }
- }
- }
-
-
- return true;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- public Block getCasingBlock() {
- return ModBlocks.blockSpecialMultiCasings;
- }
-
- public Block getCasingBlock2() {
- return ModBlocks.blockCasings2Misc;
- }
-
- public byte getCasingMeta() {
- return 6;
- }
-
-
- public byte getCasingMeta2() {
- return 8;
- }
-
-
- public byte getCasingMeta3() {
- return 7;
- }
-
- public byte getCasingMeta4() {
- return 11;
- }
-
- public byte getCasingTextureIndex() {
- return (byte) mCasingTextureID;
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
-
-
-
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mHeatLevel", mHeatLevel);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mHeatLevel = aNBT.getInteger("mHeatLevel");
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- // Fix GT bug
- if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
- this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
- }
- }
-
- @Override
- public void onRemoval() {
- resetSolarHeaters();
- super.onRemoval();
- }
-
- private void resetSolarHeaters() {
- for (TileEntitySolarHeater aTile : this.mSolarHeaters) {
- aTile.clearSolarTower();
- }
- this.mSolarHeaters.clear();
- }
-
- @Override
- public String[] getExtraInfoData() {
- return new String[] {
- "Internal Heat Level: "+this.mHeatLevel,
- "Connected Solar Reflectors: "+this.mSolarHeaters.size()
- };
- }
-
+public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SolarTower>
+ implements ISurvivalConstructable {
+
+ // 862
+ private static final int mCasingTextureID = TAE.getIndexFromPage(3, 9);
+ private int mHeatLevel = 0;
+ private int mCasing1;
+ private int mCasing2;
+ private int mCasing3;
+ private int mCasing4;
+
+ public ArrayList<TileEntitySolarHeater> mSolarHeaters = new ArrayList<TileEntitySolarHeater>();
+
+ public GregtechMetaTileEntity_SolarTower(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_SolarTower(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_SolarTower(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Solar Tower";
+ }
+
+ @Override
+ protected final GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Contributing Green Energy towards the future")
+ .addInfo("Input: " + MISC_MATERIALS.SOLAR_SALT_COLD.getLocalizedName())
+ .addInfo("Output: " + MISC_MATERIALS.SOLAR_SALT_HOT.getLocalizedName())
+ .addInfo("Surround with rings of Solar Heaters")
+ .addInfo("Each ring increases tier")
+ .addInfo("1 = 1, 2 = 2, 3 = 4, 4 = 8, 5 = 16")
+ .addInfo("Tier decreases heating time and allows more salt to be processed")
+ .addSeparator()
+ .beginStructureBlock(6, 27, 6, false)
+ .addController("Top Middle")
+ .addCasingInfo("Structural Solar Casing", 229)
+ .addCasingInfo("Thermally Insulated Casing", 60)
+ .addCasingInfo("Salt Containment Casing", 66)
+ .addCasingInfo("Thermal Containment Casing", 60)
+ .addInputHatch("Any 2 dot hint(min 1)", 2)
+ .addOutputHatch("Any 2 dot hint(min 1)", 2)
+ .addMaintenanceHatch("Any 2 dot hint", 2)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ private static final String STRUCTURE_PIECE_BASE = "base";
+ private static final String STRUCTURE_PIECE_TOWER = "tower";
+ private static final String STRUCTURE_PIECE_TOP = "top";
+
+ private static final String[] STRUCTURE_PIECE_SOLAR_HEATER_RING = {"ring1", "ring2", "ring3", "ring4", "ring5"};
+ private static final String SOLAR_HEATER_RING_1 = STRUCTURE_PIECE_SOLAR_HEATER_RING[0];
+ private static final String SOLAR_HEATER_RING_2 = STRUCTURE_PIECE_SOLAR_HEATER_RING[1];
+ private static final String SOLAR_HEATER_RING_3 = STRUCTURE_PIECE_SOLAR_HEATER_RING[2];
+ private static final String SOLAR_HEATER_RING_4 = STRUCTURE_PIECE_SOLAR_HEATER_RING[3];
+ private static final String SOLAR_HEATER_RING_5 = STRUCTURE_PIECE_SOLAR_HEATER_RING[4];
+
+ private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>> STRUCTURE_DEFINITION =
+ new ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>>() {
+ @Override
+ protected IStructureDefinition<GregtechMetaTileEntity_SolarTower> computeValue(Class<?> type) {
+ return StructureDefinition.<GregtechMetaTileEntity_SolarTower>builder()
+
+ // s = salt
+ // c = thermal containment
+ // i = thermal insulated
+ // t = solar structural
+ // h = hatch
+ // g = solar heater
+
+ .addShape(STRUCTURE_PIECE_TOP, (new String[][] {
+ {" ", " ", " ~ ", " ", " "},
+ {" ", " s ", " sss ", " s ", " "},
+ {" c ", " ccc ", "ccscc", " ccc ", " c "},
+ {" c ", " ccc ", "ccscc", " ccc ", " c "},
+ {" c ", " ccc ", "ccscc", " ccc ", " c "},
+ {" c ", " ccc ", "ccscc", " ccc ", " c "},
+ {" c ", " ccc ", "ccscc", " ccc ", " c "},
+ }))
+ .addShape(STRUCTURE_PIECE_TOWER, (new String[][] {
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ {" i ", "isi", " i "},
+ }))
+ .addShape(STRUCTURE_PIECE_BASE, (new String[][] {
+ {
+ " ",
+ " ",
+ " t ",
+ " ttt ",
+ " ttstt ",
+ " ttssstt ",
+ " ttstt ",
+ " ttt ",
+ " t ",
+ " ",
+ " "
+ },
+ {
+ " ",
+ " ",
+ " t ",
+ " ttt ",
+ " tssst ",
+ " ttssstt ",
+ " tssst ",
+ " ttt ",
+ " t ",
+ " ",
+ " "
+ },
+ {
+ " ",
+ " t ",
+ " ttt ",
+ " ttttt ",
+ " ttssstt ",
+ " tttsssttt ",
+ " ttssstt ",
+ " ttttt ",
+ " ttt ",
+ " t ",
+ " "
+ },
+ {
+ " ",
+ " t ",
+ " ttt ",
+ " ttttt ",
+ " ttssstt ",
+ " tttsssttt ",
+ " ttssstt ",
+ " ttttt ",
+ " ttt ",
+ " t ",
+ " "
+ },
+ {
+ " hhh ",
+ " ttttt ",
+ " ttttttt ",
+ " ttttttttt ",
+ "htttsssttth",
+ "htttsssttth",
+ "htttsssttth",
+ " ttttttttt ",
+ " ttttttt ",
+ " ttttt ",
+ " hhh "
+ },
+ {
+ " hhh ",
+ " ttttt ",
+ " ttttttt ",
+ " ttttttttt ",
+ "httttttttth",
+ "httttttttth",
+ "httttttttth",
+ " ttttttttt ",
+ " ttttttt ",
+ " ttttt ",
+ " hhh "
+ },
+ }))
+ .addShape(SOLAR_HEATER_RING_1, (new String[][] {
+ {
+ " ggggg ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " ggggg ",
+ }
+ }))
+ .addShape(SOLAR_HEATER_RING_2, (new String[][] {
+ {
+ " ggggggggg ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " ggggggggg ",
+ }
+ }))
+ .addShape(SOLAR_HEATER_RING_3, (new String[][] {
+ {
+ " ggggggggggggg ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " ggggggggggggg ",
+ }
+ }))
+ .addShape(SOLAR_HEATER_RING_4, (new String[][] {
+ {
+ " ggggggggggggggggg ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " ggggggggggggggggg ",
+ }
+ }))
+ .addShape(SOLAR_HEATER_RING_5, (new String[][] {
+ {
+ " ggggggggggggggggggggg ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ "g g",
+ " g g ",
+ " g g ",
+ " g g ",
+ " g g ",
+ " ggggggggggggggggggggg ",
+ }
+ }))
+ .addElement('g', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class)
+ .hatchClass(TileEntitySolarHeater.class)
+ .adder(GregtechMetaTileEntity_SolarTower::addSolarHeater)
+ // use a positive casing index to make adder builder happy
+ .casingIndex(1)
+ .dot(1)
+ .continueIfSuccess()
+ .build()))
+ .addElement(
+ 't',
+ lazy(t -> onElementPass(
+ x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta()))))
+ .addElement(
+ 'i',
+ lazy(t -> onElementPass(
+ x -> ++x.mCasing2, ofBlock(t.getCasingBlock(), t.getCasingMeta2()))))
+ .addElement(
+ 's',
+ lazy(t -> onElementPass(
+ x -> ++x.mCasing3, ofBlock(t.getCasingBlock(), t.getCasingMeta3()))))
+ .addElement(
+ 'c',
+ lazy(t -> onElementPass(
+ x -> ++x.mCasing4, ofBlock(t.getCasingBlock2(), t.getCasingMeta4()))))
+ .addElement('h', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class)
+ .atLeast(InputHatch, OutputHatch, Maintenance)
+ .casingIndex(t.getCasingTextureIndex())
+ .dot(2)
+ .buildAndChain(onElementPass(
+ x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta())))))
+ .build();
+ }
+ };
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ resetSolarHeaters();
+ this.mMaintenanceHatches.clear();
+ this.mInputHatches.clear();
+ this.mOutputHatches.clear();
+ mCasing1 = 0;
+ mCasing2 = 0;
+ mCasing3 = 0;
+ mCasing4 = 0;
+
+ boolean aStructureTop = checkPiece(STRUCTURE_PIECE_TOP, 2, 2, 0);
+ log("Top Check: " + aStructureTop);
+ boolean aStructureTower = checkPiece(STRUCTURE_PIECE_TOWER, 1, 1, -7);
+ log("Tower Check: " + aStructureTower);
+ boolean aStructureBase = checkPiece(STRUCTURE_PIECE_BASE, 5, 5, -22);
+ log("Base Check: " + aStructureBase);
+ boolean aCasingCount1 = mCasing1 >= 229;
+ boolean aCasingCount2 = mCasing2 == 60;
+ boolean aCasingCount3 = mCasing3 == 66;
+ boolean aCasingCount4 = mCasing4 == 60;
+ boolean aAllStructure = aStructureTop && aStructureTower && aStructureBase;
+ boolean aAllCasings = aCasingCount1 && aCasingCount2 && aCasingCount3 && aCasingCount4;
+ if (!aAllCasings
+ || !aAllStructure
+ || mMaintenanceHatches.size() != 1
+ || mInputHatches.size() < 1
+ || mOutputHatches.size() < 1) {
+ log("Bad Hatches - Solar Heaters: " + mSolarHeaters.size() + ", Maint: "
+ + mMaintenanceHatches.size() + ", Input Hatches: "
+ + mInputHatches.size() + ", Output Hatches: "
+ + mOutputHatches.size() + ", Top: "
+ + aStructureTop + ", Tower: "
+ + aStructureTower + ", Base: "
+ + aStructureBase + ", Casing Count: "
+ + aCasingCount1 + " | Found: " + mCasing1 + ", Casing Count: "
+ + aCasingCount2 + " | Found: " + mCasing2 + ", Casing Count: "
+ + aCasingCount3 + " | Found: " + mCasing3 + ", Casing Count: "
+ + aCasingCount4 + " | Found: " + mCasing4);
+ return false;
+ }
+ log("Built " + this.getLocalName() + " with " + mCasing1 + " Structural Solar casings, " + mCasing2
+ + " Thermally Insulated casings, " + mCasing3 + " Salt Containment casings, " + mCasing4
+ + " Thermal Containment casings.");
+ return aAllCasings && aAllStructure;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ // Tower
+ buildPiece(STRUCTURE_PIECE_TOP, stackSize, hintsOnly, 2, 2, 0);
+ buildPiece(STRUCTURE_PIECE_TOWER, stackSize, hintsOnly, 1, 1, -7);
+ buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 5, 5, -22);
+
+ // Solar Heaters
+ if (stackSize.stackSize >= 1) {
+ buildPiece(SOLAR_HEATER_RING_1, stackSize, hintsOnly, 7, 7, -27);
+ if (stackSize.stackSize >= 2) {
+ buildPiece(SOLAR_HEATER_RING_2, stackSize, hintsOnly, 9, 9, -27);
+ if (stackSize.stackSize >= 3) {
+ buildPiece(SOLAR_HEATER_RING_3, stackSize, hintsOnly, 11, 11, -27);
+ if (stackSize.stackSize >= 4) {
+ buildPiece(SOLAR_HEATER_RING_4, stackSize, hintsOnly, 13, 13, -27);
+ if (stackSize.stackSize >= 5) {
+ buildPiece(SOLAR_HEATER_RING_5, stackSize, hintsOnly, 15, 15, -27);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ int built;
+ int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 2);
+ // Tower
+ built = survivialBuildPiece(STRUCTURE_PIECE_TOP, stackSize, 2, 2, 0, realBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ built = survivialBuildPiece(STRUCTURE_PIECE_TOWER, stackSize, 1, 1, -7, realBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ built = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 5, 5, -22, realBudget, source, actor, false, true);
+ if (built >= 0) return built;
+
+ // Solar Heaters
+ if (stackSize.stackSize < 1) return -1;
+ built = survivialBuildPiece(SOLAR_HEATER_RING_1, stackSize, 7, 7, -27, realBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ if (stackSize.stackSize < 2) return -1;
+ built = survivialBuildPiece(SOLAR_HEATER_RING_2, stackSize, 9, 9, -27, realBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ if (stackSize.stackSize < 3) return -1;
+ built = survivialBuildPiece(
+ SOLAR_HEATER_RING_3, stackSize, 11, 11, -27, realBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ if (stackSize.stackSize < 4) return -1;
+ built = survivialBuildPiece(
+ SOLAR_HEATER_RING_4, stackSize, 13, 13, -27, realBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ if (stackSize.stackSize < 5) return -1;
+ return survivialBuildPiece(SOLAR_HEATER_RING_5, stackSize, 15, 15, -27, realBudget, source, actor, false, true);
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_SolarTower> getStructureDefinition() {
+ return STRUCTURE_DEFINITION.get(getClass());
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(212));
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == 0 || aSide == 1) {
+ if (aActive)
+ return new ITexture[] {
+ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)),
+ TextureFactory.builder()
+ .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default_Active)
+ .extFacing()
+ .build()
+ };
+ return new ITexture[] {
+ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)),
+ TextureFactory.builder()
+ .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default)
+ .extFacing()
+ .build()
+ };
+ }
+ return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))};
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ private int getHeaterTier() {
+ int aSolarHeaterCounter = this.mSolarHeaters.size();
+ if (aSolarHeaterCounter > 0) {
+ if (aSolarHeaterCounter == 36) {
+ return 1;
+ } else if (aSolarHeaterCounter == 88) {
+ return 2;
+ } else if (aSolarHeaterCounter == 156) {
+ return 4;
+ } else if (aSolarHeaterCounter == 240) {
+ return 8;
+ } else if (aSolarHeaterCounter == 340) {
+ return 16;
+ }
+ }
+ return 0;
+ }
+
+ private int getHeaterCountForTier(int aTier) {
+ switch (aTier) {
+ case 1:
+ return 36;
+ case 2:
+ return 88;
+ case 4:
+ return 156;
+ case 8:
+ return 240;
+ case 16:
+ return 340;
+ default:
+ return 0;
+ }
+ }
+
+ public boolean getConnectedSolarReflectors() {
+
+ this.mSolarHeaters.clear();
+ int aRing = 1;
+
+ if (this.mSolarHeaters.size() < 36) {
+ // 15x15
+ boolean aRing1 = checkPiece(SOLAR_HEATER_RING_1, 7, 7, -27);
+ if (aRing1) {
+ // log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
+ }
+ }
+ if (this.mSolarHeaters.size() < 88) {
+ // 17x17
+ boolean aRing2 = checkPiece(SOLAR_HEATER_RING_2, 9, 9, -27);
+ if (aRing2) {
+ // log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
+ }
+ }
+ if (this.mSolarHeaters.size() < 156) {
+ // 19x19
+ boolean aRing3 = checkPiece(SOLAR_HEATER_RING_3, 11, 11, -27);
+ if (aRing3) {
+ // log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
+ }
+ }
+ if (this.mSolarHeaters.size() < 240) {
+ // 21x21
+ boolean aRing4 = checkPiece(SOLAR_HEATER_RING_4, 13, 13, -27);
+ if (aRing4) {
+ // log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
+ }
+ }
+ if (this.mSolarHeaters.size() < 340) {
+ // 23x23
+ boolean aRing5 = checkPiece(SOLAR_HEATER_RING_5, 15, 15, -27);
+ if (aRing5) {
+ // log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size());
+ }
+ }
+ return mSolarHeaters.size() > 0;
+ }
+
+ private boolean addSolarHeater(IGregTechTileEntity aTileEntity, int a) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof TileEntitySolarHeater) {
+ TileEntitySolarHeater mTile = (TileEntitySolarHeater) aMetaTileEntity;
+ if (!mTile.hasSolarTower() && mTile.canSeeSky()) {
+ // Logger.INFO("Found Solar Reflector, Injecting Data.");
+ mTile.setSolarTower(this);
+ return this.mSolarHeaters.add(mTile);
+ }
+ }
+ }
+ return false;
+ }
+
+ private Fluid mColdSalt = null;
+ private Fluid mHotSalt = null;
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ this.mEfficiencyIncrease = 10;
+ this.mMaxProgresstime = 100;
+
+ if (this.mSolarHeaters.isEmpty()
+ || this.mSolarHeaters.size() < 340
+ || this.getTotalRuntimeInTicks() % 200 == 0) {
+ getConnectedSolarReflectors();
+ }
+
+ int aTier = getHeaterTier();
+ int aHeaters = getHeaterCountForTier(aTier);
+
+ // Manage Heat every 5s
+ // Add Heat First, if sources available
+ if (aHeaters > 0) {
+ for (int i = 0; i < aHeaters; i++) {
+ Math.min((this.mHeatLevel += aTier), 20000);
+ }
+ }
+
+ // Remove Heat, based on time of day
+ if (mHeatLevel > 0) {
+ if (mHeatLevel > 20000) {
+ this.mHeatLevel = 20000;
+ }
+ }
+ World w = this.getBaseMetaTileEntity().getWorld();
+ if (w != null) {
+ int aRemovalFactor = 0;
+ if (w.isDaytime()) {
+ aRemovalFactor = 1;
+ } else {
+ aRemovalFactor = 8;
+ }
+ for (int i = 0; i < MathUtils.randInt((aHeaters / 10), aHeaters); i++) {
+ this.mHeatLevel -= aRemovalFactor;
+ }
+ }
+
+ if (this.mEfficiency == this.getMaxEfficiency(null) && this.mHeatLevel >= 10000) {
+ if (mColdSalt == null) {
+ mColdSalt = MISC_MATERIALS.SOLAR_SALT_COLD.getFluid();
+ }
+ if (mHotSalt == null) {
+ mHotSalt = MISC_MATERIALS.SOLAR_SALT_HOT.getFluid();
+ }
+ ArrayList<FluidStack> aFluids = this.getStoredFluids();
+ for (FluidStack aFluid : aFluids) {
+ if (aFluid.getFluid().equals(mColdSalt)) {
+ if (aFluid.amount >= (aTier * 1000)) {
+ this.depleteInput(FluidUtils.getFluidStack(mColdSalt, (aTier * 1000)));
+ this.addOutput(FluidUtils.getFluidStack(mHotSalt, (aTier * 1000)));
+ break;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public void startProcess() {
+ this.sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockSpecialMultiCasings;
+ }
+
+ public Block getCasingBlock2() {
+ return ModBlocks.blockCasings2Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 6;
+ }
+
+ public byte getCasingMeta2() {
+ return 8;
+ }
+
+ public byte getCasingMeta3() {
+ return 7;
+ }
+
+ public byte getCasingMeta4() {
+ return 11;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) mCasingTextureID;
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {}
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mHeatLevel", mHeatLevel);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mHeatLevel = aNBT.getInteger("mHeatLevel");
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ // Fix GT bug
+ if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
+ this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
+ }
+ }
+
+ @Override
+ public void onRemoval() {
+ resetSolarHeaters();
+ super.onRemoval();
+ }
+
+ private void resetSolarHeaters() {
+ for (TileEntitySolarHeater aTile : this.mSolarHeaters) {
+ aTile.clearSolarTower();
+ }
+ this.mSolarHeaters.clear();
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ return new String[] {
+ "Internal Heat Level: " + this.mHeatLevel, "Connected Solar Reflectors: " + this.mSolarHeaters.size()
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java
index 312c58722e..f7e60432c8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java
@@ -1,7 +1,14 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae;
-import java.util.ArrayList;
-import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.InputBus;
+import static gregtech.api.enums.GT_HatchElement.InputHatch;
+import static gregtech.api.enums.GT_HatchElement.OutputBus;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
@@ -28,6 +35,8 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_AlgaeFarm;
import ic2.core.init.BlocksItems;
import ic2.core.init.InternalName;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
@@ -36,469 +45,479 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.InputBus;
-import static gregtech.api.enums.GT_HatchElement.InputHatch;
-import static gregtech.api.enums.GT_HatchElement.OutputBus;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-
-public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<GregtechMTE_AlgaePondBase> implements ISurvivalConstructable {
-
- private int mLevel = -1;
- private int mCasing;
- private IStructureDefinition<GregtechMTE_AlgaePondBase> STRUCTURE_DEFINITION = null;
- private int checkMeta;
- private int minTierOfHatch;
- private static final Class<?> cofhWater;
-
- static {
- cofhWater = ReflectionUtils.getClass("cofh.asmhooks.block.BlockWater");
- }
-
- public GregtechMTE_AlgaePondBase(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMTE_AlgaePondBase(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMTE_AlgaePondBase(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Algae Pond";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Grows Algae!")
- .addInfo("Controller Block for the Algae Farm")
- .addInfo("Provide compost to boost production by one tier")
- .addInfo("Does not require power or maintenance")
- .addInfo("All Machine Casings must be the same tier, this dictates machine speed.")
- .addInfo("All Buses/Hatches must, at least, match the tier of the Casings")
- .addInfo("Fill Input Hatch with Water to fill the inside of the multiblock.")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(9, 3, 9, true)
- .addController("Front Center")
- .addCasingInfo("Machine Casings", 64)
- .addCasingInfo("Sterile Farm Casings", 34)
- .addInputBus("Any Casing", 1)
- .addOutputBus("Any Casing", 1)
- .addInputHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- public void setMeta(int meta) {
- checkMeta = meta;
- }
-
- public int getMeta() {
- return checkMeta;
- }
-
- @Override
- public IStructureDefinition<GregtechMTE_AlgaePondBase> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_AlgaePondBase>builder()
- .addShape(mName, transpose(new String[][]{
- {"XXXXXXXXX", "X X", "X X", "X X", "X X", "X X", "X X", "X X", "XXXXXXXXX"},
- {"XXXXXXXXX", "X X", "X X", "X X", "X X", "X X", "X X", "X X", "XXXXXXXXX"},
- {"CCCC~CCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- buildHatchAdder(GregtechMTE_AlgaePondBase.class)
- .atLeast(InputHatch, InputBus, OutputBus)
- .casingIndex(TAE.getIndexFromPage(1, 15))
- .dot(1)
- .build(),
- onElementPass(
- x -> ++x.mCasing,
- addTieredBlock(
- GregTech_API.sBlockCasings1, GregtechMTE_AlgaePondBase::setMeta, GregtechMTE_AlgaePondBase::getMeta, 10
- )
- )
- )
- )
- .addElement(
- 'X',
- ofBlock(
- ModBlocks.blockCasings2Misc, 15
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 4, 2, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 4, 2, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mLevel = 0;
- checkMeta = 0;
- minTierOfHatch = 100;
- if (checkPiece(mName, 4, 2, 0) && mCasing >= 64 && checkMeta > 0) {
- mLevel = checkMeta - 1;
- return mLevel <= minTierOfHatch;
- }
- return false;
- }
-
- @Override
- protected IAlignmentLimits getInitialAlignmentLimits() {
- // fuck
- return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(207));
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Default;
- }
-
- @Override
- protected int getCasingTextureId() {
- int aID = TAE.getIndexFromPage(1, 15);
- if (mLevel > -1) {
- aID = mLevel;
- }
- return aID;
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 2;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- public boolean checkForWater() {
-
- // Get Facing direction
- IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
- int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int mCurrentDirectionX;
- int mCurrentDirectionZ;
- int mOffsetX_Lower = 0;
- int mOffsetX_Upper = 0;
- int mOffsetZ_Lower = 0;
- int mOffsetZ_Upper = 0;
-
- mCurrentDirectionX = 4;
- mCurrentDirectionZ = 4;
-
- mOffsetX_Lower = -4;
- mOffsetX_Upper = 4;
- mOffsetZ_Lower = -4;
- mOffsetZ_Upper = 4;
-
- // if (aBaseMetaTileEntity.fac)
-
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX
- * mCurrentDirectionX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ
- * mCurrentDirectionZ;
-
- int tAmount = 0;
- for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) {
- for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) {
- for (int h = 0; h < 2; h++) {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (isNotStaticWater(tBlock, tMeta)) {
- if (this.getStoredFluids() != null) {
- for (FluidStack stored : this.getStoredFluids()) {
- if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) {
- if (stored.amount >= 1000) {
- // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
- stored.amount -= 1000;
- Block fluidUsed = Blocks.water;
- aBaseMetaTileEntity.getWorld().setBlock(
- aBaseMetaTileEntity.getXCoord() + xDir + i,
- aBaseMetaTileEntity.getYCoord() + h,
- aBaseMetaTileEntity.getZCoord() + zDir + j, fluidUsed);
-
- }
- }
- }
- }
- }
- tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- if (tBlock == Blocks.water || tBlock == Blocks.flowing_water) {
- ++tAmount;
- // Logger.INFO("Found Water");
- }
- }
- }
- }
-
- boolean isValidWater = tAmount >= 49;
-
- if (isValidWater) {
- Logger.INFO("Filled structure.");
- return true;
- }
- else {
- return false;
- }
- }
-
- private boolean isNotStaticWater(Block block, byte meta) {
- return block == Blocks.air
- || block == Blocks.flowing_water
- || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)
- || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerSecond(final ItemStack aStack) {
- return CORE.ConfigSwitches.pollutionPerSecondMultiAlgaePond;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- this.fixAllMaintenanceIssue();
- // Silly Client Syncing
- if (aBaseMetaTileEntity.isClientSide()) {
- this.mLevel = getCasingTier();
- }
-
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0);
- }
-
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
-
- if (this.mLevel < 0) {
- Logger.INFO("Bad Tier.");
- return false;
- }
-
- if (!checkForWater()) {
- Logger.INFO("Not enough Water.");
- return false;
- }
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- Logger.INFO("Running checkRecipeGeneric(0)");
-
- GT_Recipe tRecipe = RecipeLoader_AlgaeFarm.getTieredRecipeFromCache(this.mLevel, isUsingCompost(aItemInputs));
-
- this.mLastRecipe = tRecipe;
-
- if (tRecipe == null) {
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- return false;
- }
- if (tRecipe.mInputs.length > 0) {
- for (ItemStack aInputToConsume : tRecipe.mInputs) {
- this.depleteInput(aInputToConsume);
- }
- }
-
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
- this.mMaxProgresstime = (int)(tRecipe.mDuration);
- this.mEUt = 0;
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- Logger.INFO("Recipe time: "+this.mMaxProgresstime);
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= aMaxParallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < aMaxParallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- Logger.INFO("GOOD RETURN - 1");
- return true;
-
- }
-
- private boolean isUsingCompost(ItemStack[] aItemInputs) {
- ItemStack aCompost = ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1);
- for (ItemStack i : aItemInputs) {
- if (GT_Utility.areStacksEqual(aCompost, i)) {
- if (i.stackSize >= 8) {
- return true;
- }
- }
- }
- return false;
- }
-
-
- private int getCasingTier() {
- if (this.getBaseMetaTileEntity().getWorld() == null) {
- return 0;
- }
- try {
- Block aInitStructureCheck;
- int aInitStructureCheckMeta;
- IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(xDir, -1, zDir);
- aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir, -1, zDir);
- if (aInitStructureCheck == GregTech_API.sBlockCasings1) {
- return aInitStructureCheckMeta;
- }
- return 0;
- }
- catch (Throwable t) {
- t.printStackTrace();
- return 0;
- }
- }
-
-
-
+public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<GregtechMTE_AlgaePondBase>
+ implements ISurvivalConstructable {
+
+ private int mLevel = -1;
+ private int mCasing;
+ private IStructureDefinition<GregtechMTE_AlgaePondBase> STRUCTURE_DEFINITION = null;
+ private int checkMeta;
+ private int minTierOfHatch;
+ private static final Class<?> cofhWater;
+
+ static {
+ cofhWater = ReflectionUtils.getClass("cofh.asmhooks.block.BlockWater");
+ }
+
+ public GregtechMTE_AlgaePondBase(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMTE_AlgaePondBase(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMTE_AlgaePondBase(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Algae Pond";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Grows Algae!")
+ .addInfo("Controller Block for the Algae Farm")
+ .addInfo("Provide compost to boost production by one tier")
+ .addInfo("Does not require power or maintenance")
+ .addInfo("All Machine Casings must be the same tier, this dictates machine speed.")
+ .addInfo("All Buses/Hatches must, at least, match the tier of the Casings")
+ .addInfo("Fill Input Hatch with Water to fill the inside of the multiblock.")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(9, 3, 9, true)
+ .addController("Front Center")
+ .addCasingInfo("Machine Casings", 64)
+ .addCasingInfo("Sterile Farm Casings", 34)
+ .addInputBus("Any Casing", 1)
+ .addOutputBus("Any Casing", 1)
+ .addInputHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ public void setMeta(int meta) {
+ checkMeta = meta;
+ }
+
+ public int getMeta() {
+ return checkMeta;
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMTE_AlgaePondBase> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_AlgaePondBase>builder()
+ .addShape(mName, transpose(new String[][] {
+ {
+ "XXXXXXXXX",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "XXXXXXXXX"
+ },
+ {
+ "XXXXXXXXX",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "X X",
+ "XXXXXXXXX"
+ },
+ {
+ "CCCC~CCCC",
+ "CCCCCCCCC",
+ "CCCCCCCCC",
+ "CCCCCCCCC",
+ "CCCCCCCCC",
+ "CCCCCCCCC",
+ "CCCCCCCCC",
+ "CCCCCCCCC",
+ "CCCCCCCCC"
+ },
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ buildHatchAdder(GregtechMTE_AlgaePondBase.class)
+ .atLeast(InputHatch, InputBus, OutputBus)
+ .casingIndex(TAE.getIndexFromPage(1, 15))
+ .dot(1)
+ .build(),
+ onElementPass(
+ x -> ++x.mCasing,
+ addTieredBlock(
+ GregTech_API.sBlockCasings1,
+ GregtechMTE_AlgaePondBase::setMeta,
+ GregtechMTE_AlgaePondBase::getMeta,
+ 10))))
+ .addElement('X', ofBlock(ModBlocks.blockCasings2Misc, 15))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 4, 2, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 4, 2, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mLevel = 0;
+ checkMeta = 0;
+ minTierOfHatch = 100;
+ if (checkPiece(mName, 4, 2, 0) && mCasing >= 64 && checkMeta > 0) {
+ mLevel = checkMeta - 1;
+ return mLevel <= minTierOfHatch;
+ }
+ return false;
+ }
+
+ @Override
+ protected IAlignmentLimits getInitialAlignmentLimits() {
+ // fuck
+ return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped();
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(207));
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Default;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ int aID = TAE.getIndexFromPage(1, 15);
+ if (mLevel > -1) {
+ aID = mLevel;
+ }
+ return aID;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 2;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ public boolean checkForWater() {
+
+ // Get Facing direction
+ IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
+ int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int mCurrentDirectionX;
+ int mCurrentDirectionZ;
+ int mOffsetX_Lower = 0;
+ int mOffsetX_Upper = 0;
+ int mOffsetZ_Lower = 0;
+ int mOffsetZ_Upper = 0;
+
+ mCurrentDirectionX = 4;
+ mCurrentDirectionZ = 4;
+
+ mOffsetX_Lower = -4;
+ mOffsetX_Upper = 4;
+ mOffsetZ_Lower = -4;
+ mOffsetZ_Upper = 4;
+
+ // if (aBaseMetaTileEntity.fac)
+
+ final int xDir =
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX;
+ final int zDir =
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ;
+
+ int tAmount = 0;
+ for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) {
+ for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) {
+ for (int h = 0; h < 2; h++) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ if (isNotStaticWater(tBlock, tMeta)) {
+ if (this.getStoredFluids() != null) {
+ for (FluidStack stored : this.getStoredFluids()) {
+ if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) {
+ if (stored.amount >= 1000) {
+ // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
+ stored.amount -= 1000;
+ Block fluidUsed = Blocks.water;
+ aBaseMetaTileEntity
+ .getWorld()
+ .setBlock(
+ aBaseMetaTileEntity.getXCoord() + xDir + i,
+ aBaseMetaTileEntity.getYCoord() + h,
+ aBaseMetaTileEntity.getZCoord() + zDir + j,
+ fluidUsed);
+ }
+ }
+ }
+ }
+ }
+ tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ if (tBlock == Blocks.water || tBlock == Blocks.flowing_water) {
+ ++tAmount;
+ // Logger.INFO("Found Water");
+ }
+ }
+ }
+ }
+
+ boolean isValidWater = tAmount >= 49;
+
+ if (isValidWater) {
+ Logger.INFO("Filled structure.");
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private boolean isNotStaticWater(Block block, byte meta) {
+ return block == Blocks.air
+ || block == Blocks.flowing_water
+ || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)
+ || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerSecond(final ItemStack aStack) {
+ return CORE.ConfigSwitches.pollutionPerSecondMultiAlgaePond;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ this.fixAllMaintenanceIssue();
+ // Silly Client Syncing
+ if (aBaseMetaTileEntity.isClientSide()) {
+ this.mLevel = getCasingTier();
+ }
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0);
+ }
+
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+
+ if (this.mLevel < 0) {
+ Logger.INFO("Bad Tier.");
+ return false;
+ }
+
+ if (!checkForWater()) {
+ Logger.INFO("Not enough Water.");
+ return false;
+ }
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ Logger.INFO("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = RecipeLoader_AlgaeFarm.getTieredRecipeFromCache(this.mLevel, isUsingCompost(aItemInputs));
+
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ return false;
+ }
+ if (tRecipe.mInputs.length > 0) {
+ for (ItemStack aInputToConsume : tRecipe.mInputs) {
+ this.depleteInput(aInputToConsume);
+ }
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ this.mMaxProgresstime = (int) (tRecipe.mDuration);
+ this.mEUt = 0;
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ Logger.INFO("Recipe time: " + this.mMaxProgresstime);
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= aMaxParallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < aMaxParallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ Logger.INFO("GOOD RETURN - 1");
+ return true;
+ }
+
+ private boolean isUsingCompost(ItemStack[] aItemInputs) {
+ ItemStack aCompost = ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1);
+ for (ItemStack i : aItemInputs) {
+ if (GT_Utility.areStacksEqual(aCompost, i)) {
+ if (i.stackSize >= 8) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private int getCasingTier() {
+ if (this.getBaseMetaTileEntity().getWorld() == null) {
+ return 0;
+ }
+ try {
+ Block aInitStructureCheck;
+ int aInitStructureCheckMeta;
+ IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(xDir, -1, zDir);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir, -1, zDir);
+ if (aInitStructureCheck == GregTech_API.sBlockCasings1) {
+ return aInitStructureCheckMeta;
+ }
+ return 0;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return 0;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java
index 018120d614..875c449f2d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java
@@ -1,11 +1,6 @@
/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock;
-import gregtech.api.enums.TAE;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gtPlusPlus.core.material.ALLOY;
-import gtPlusPlus.core.material.Material;
public class GregtechMetaTileEntity_BedrockMiningPlatform1 extends GregtechMetaTileEntity_BedrockMiningPlatformBase {
public GregtechMetaTileEntity_BedrockMiningPlatform1(final int aID, final String aName, final String aNameRegional) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java
index 6b97cb7ee2..f67ecfe87f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java
@@ -1,11 +1,6 @@
/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
-import gtPlusPlus.core.material.ELEMENT;
-import gtPlusPlus.core.material.Material;
public class GregtechMetaTileEntity_BedrockMiningPlatform2 extends GregtechMetaTileEntity_BedrockMiningPlatformBase {
public GregtechMetaTileEntity_BedrockMiningPlatform2(final int aID, final String aName, final String aNameRegional) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java
index b74f2459a3..50c10bab0d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java
@@ -32,653 +32,608 @@ import net.minecraftforge.common.util.ForgeDirection;
public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends GregtechMeta_MultiBlockBase {
- protected double mProductionModifier = 0;
-
-
- private static final ItemStack miningPipe;
- private static final ItemStack miningPipeTip;
-
- private Block casingBlock;
- private int casingMeta;
- // private int frameMeta;
- private int casingTextureIndex;
-
- private ForgeDirection back;
-
- private int xDrill;
- private int yDrill;
- private int zDrill;
-
- private int[] xCenter = new int[5];
- private int[] zCenter = new int[5];
-
- public GregtechMetaTileEntity_BedrockMiningPlatformBase(final int aID, final String aName,
- final String aNameRegional) {
- super(aID, aName, aNameRegional);
- this.initFields();
- }
-
- public GregtechMetaTileEntity_BedrockMiningPlatformBase(final String aName) {
- super(aName);
- this.initFields();
- }
-
- private void initFields() {
- this.casingBlock = this.getCasingBlockItem().getBlock();
- this.casingMeta = this.getCasingBlockItem().get(0L, new Object[0]).getItemDamage();
- this.casingTextureIndex = this.getCasingTextureIndex();
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT;
- }
-
- @Override
- protected int getCasingTextureId() {
- return this.casingTextureIndex;
- }
-
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- "OreDrillingPlant.png");
- }
-
-
- public int getAmountOfOutputs() {
- return 1;
- }
-
- public void saveNBTData(final NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setDouble("mProductionModifier", mProductionModifier);
- }
-
- public void loadNBTData(final NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mProductionModifier = aNBT.getDouble("mProductionModifier");
- }
-
- public boolean checkRecipe(final ItemStack aStack) {
- //this.setElectricityStats();
-
-
- if (true) {
- return false;
- }
-
- boolean[] didWork = new boolean[5];
-
- if (!this.tryConsumeDrillingFluid()) {
- Logger.INFO("No drilling Fluid.");
- return false;
- }
-
- if (MathUtils.isNumberEven((int) this.mProductionModifier)) {
- if (!this.tryConsumePyrotheum()) {
- Logger.INFO("No tryConsumePyrotheum Fluid.");
- return false;
- }
- else {
- mProductionModifier++;
- }
- }
- else {
- if (!this.tryConsumeCryotheum()) {
- Logger.INFO("No tryConsumeCryotheum Fluid.");
- return false;
- }
- else {
- mProductionModifier++;
- }
- }
-
- for (int i = 0; i < 5; i++) {
- process();
- didWork[i] = true;
- }
-
- // Fail recipe handling if one pipe didn't handle properly, to try again
- // next run.
- for (boolean y : didWork) {
- if (!y) {
- Logger.INFO("[Bedrock Miner] Fail [x]");
- return false;
- }
- }
-
- this.mEUt = -8000;
- this.mMaxProgresstime = 1;
- this.mEfficiencyIncrease = 10000;
-
- return true;
- }
-
- private boolean isEnergyEnough() {
- long requiredEnergy = 512L + this.getMaxInputVoltage() * 4L;
- for (final GT_MetaTileEntity_Hatch_Energy energyHatch : this.mEnergyHatches) {
- requiredEnergy -= energyHatch.getEUVar();
- if (requiredEnergy <= 0L) {
- return true;
- }
- }
- return false;
- }
-
- private void setElectricityStats() {
- //this.mEfficiency = this.getCurrentEfficiency((ItemStack) null);
- this.mEfficiencyIncrease = 10000;
- final int overclock = 8 << GT_Utility.getTier(this.getMaxInputVoltage());
- //this.mEUt = -12 * overclock * overclock;
- Logger.INFO("Trying to set EU to "+(12 * overclock * overclock));
- int mCombinedAvgTime = 0;
- for (int g = 0; g < 5; g++) {
- mCombinedAvgTime += this.getBaseProgressTime() / overclock;
- }
- Logger.INFO("Trying to set Max Time to "+(mCombinedAvgTime));
- //this.mMaxProgresstime = (mCombinedAvgTime / 5);
- }
-
- private boolean tryConsumeDrillingFluid() {
- boolean consumed = false;
- boolean g = (this.getBaseMetaTileEntity().getWorld().getTotalWorldTime() % 2 == 0);
- consumed = (g ? tryConsumePyrotheum() : tryConsumeCryotheum());
- if (consumed) {
- //increaseProduction(g ? 2 : 1);
- }
- else {
- //lowerProduction(g ? 5 : 3);
- }
- return consumed;
- }
-
- private boolean tryConsumePyrotheum() {
- return this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 4));
- }
-
- private boolean tryConsumeCryotheum() {
- return this.depleteInput(FluidUtils.getFluidStack("cryotheum", 4));
- }
-
- private void putMiningPipesFromInputsInController() {
- final int maxPipes = 64;
- if (this.isHasMiningPipes(maxPipes)) {
- return;
- }
- ItemStack pipes = this.getStackInSlot(1);
- for (final ItemStack storedItem : this.getStoredInputs()) {
- if (!storedItem.isItemEqual(GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe)) {
- continue;
- }
- if (pipes == null) {
- this.setInventorySlotContents(1,
- GT_Utility.copy(new Object[] { GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe }));
- pipes = this.getStackInSlot(1);
- }
- if (pipes.stackSize == maxPipes) {
- break;
- }
- final int needPipes = maxPipes - pipes.stackSize;
- final int transferPipes = (storedItem.stackSize < needPipes) ? storedItem.stackSize : needPipes;
- final ItemStack itemStack = pipes;
- itemStack.stackSize += transferPipes;
- final ItemStack itemStack2 = storedItem;
- itemStack2.stackSize -= transferPipes;
- }
- this.updateSlots();
- }
-
-
-
- private boolean isHasMiningPipes(final int minCount) {
- final ItemStack pipe = this.getStackInSlot(1);
- return pipe != null && pipe.stackSize > minCount - 1
- && pipe.isItemEqual(GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe);
- }
-
- public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- this.updateCoordinates();
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- int tAmount = 0;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- } else {
-
- Block aCasing = Block.getBlockFromItem(getCasingBlockItem().getItem());
-
- for (int i = -1; i < 2; ++i) {
- for (int j = -1; j < 2; ++j) {
- for (int h = -1; h < 2; ++h) {
- if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
- h, zDir + j);
- Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
-
- if (!this.addToMachineList(tTileEntity, 48)) {
- if (aBlock != aCasing) {
- Logger.INFO("Found Bad Casing");
- return false;
- }
- if (aMeta != 3) {
- Logger.INFO("Found Bad Meta");
- return false;
- }
- }
- ++tAmount;
-
-
-
- /*if (!isValidBlockForStructure(tTileEntity, 48, true, aBlock, aMeta, sBlockCasings4, 0)) {
- Logger.INFO("Bad centrifuge casing");
- return false;
- }*/
-
- }
- }
- }
- }
- return tAmount >= 10;
- }
-
- }
-
- private void updateCoordinates() {
- this.xDrill = this.getBaseMetaTileEntity().getXCoord();
- this.yDrill = this.getBaseMetaTileEntity().getYCoord()-1;
- this.zDrill = this.getBaseMetaTileEntity().getZCoord();
- this.back = ForgeDirection.getOrientation((int) this.getBaseMetaTileEntity().getBackFacing());
-
- // Middle
- this.xCenter[0] = this.xDrill + this.back.offsetX;
- this.zCenter[0] = this.zDrill + this.back.offsetZ;
-
- this.xCenter[1] = xCenter[0] + 1;
- this.zCenter[1] = zCenter[0];
-
- this.xCenter[2] = xCenter[0] - 1;
- this.zCenter[2] = zCenter[0];
-
- this.xCenter[3] = xCenter[0];
- this.zCenter[3] = zCenter[0] + 1;
-
- this.xCenter[4] = xCenter[0];
- this.zCenter[4] = zCenter[0] - 1;
-
- }
-
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
- }
-
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- public int getPollutionPerTick(final ItemStack aStack) {
- return 0;
- }
-
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- protected GregtechItemList getCasingBlockItem() {
- return GregtechItemList.Casing_BedrockMiner;
- }
-
- protected abstract Material getFrameMaterial();
-
- protected abstract int getCasingTextureIndex();
-
- protected abstract int getRadiusInChunks();
-
- protected abstract int getMinTier();
-
- protected abstract int getBaseProgressTime();
-
- protected String[] getDescriptionInternal(final String tierSuffix) {
- final String casings = this.getCasingBlockItem().get(0L, new Object[0]).getDisplayName();
- return new String[] {
- "Controller Block for the Experimental Deep Earth Drilling Platform - MK "
- + ((tierSuffix != null) ? tierSuffix : ""),
- "Size(WxHxD): 3x7x3, Controller (Front middle bottom)", "3x1x3 Base of " + casings,
- "1x3x1 " + casings + " pillar (Center of base)",
- "1x3x1 " + this.getFrameMaterial().getLocalizedName() + " Frame Boxes (Each pillar side and on top)",
- "2x Input Hatch (Any bottom layer casing)",
- "1x Input Bus for mining pipes (Any bottom layer casing; not necessary)",
- "1x Output Bus (Any bottom layer casing)", "1x Maintenance Hatch (Any bottom layer casing)",
- "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)",
- "Radius is " + (this.getRadiusInChunks() << 4) + " blocks",
- "Every tick, this machine altenates betweem consumption of Pyrotheum & Cryotheum",
- "Pyrotheum is used to bore through the Mantle of the world",
- "Cryotheum is used to keep the internal components cool",};
- }
-
- static {
- miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0L);
- miningPipeTip = GT_ModHandler.getIC2Item("miningPipeTip", 0L);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- private AutoMap<ItemStack> mOutputs;
-
- public void process() {
- ItemStack aOutput = generateOutputWithchance();
- if (aOutput != null) {
- this.addOutput(aOutput);
- Logger.INFO("Mined some "+aOutput.getDisplayName());
- }
- this.updateSlots();
- }
-
- public ItemStack generateOutputWithchance() {
- int aChance = MathUtils.randInt(0, 7500);
- if (aChance < 100) {
- return generateOutput();
- }
- else {
- return null;
- }
- }
-
- public ItemStack generateOutput() {
- AutoMap<ItemStack> aData = generateOreForOutput();
- int aMax = aData.size()-1;
- return aData.get(MathUtils.randInt(0, aMax));
- }
-
- /**
- * Here we generate valid ores and also a basic loot set
- */
-
- public AutoMap<ItemStack> generateOreForOutput() {
-
- if (mOutputs != null) {
- return mOutputs;
- }
-
- AutoMap<GT_Worldgen_GT_Ore_Layer> aOverWorldOres = MiningUtils.getOresForDim(0);
- AutoMap<GT_Worldgen_GT_Ore_Layer> aNetherOres = MiningUtils.getOresForDim(-1);
- AutoMap<GT_Worldgen_GT_Ore_Layer> aEndOres = MiningUtils.getOresForDim(1);
-
- AutoMap<ItemStack> aTempMap = new AutoMap<ItemStack>();
- Block tOreBlock = GregTech_API.sBlockOres1;
- Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Initial]");
-
- for (GT_Worldgen_GT_Ore_Layer layer : aOverWorldOres) {
- if (layer.mEnabled) {
- ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1);
- ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1);
- ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1);
- ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1);
- aTempMap.put(aTempOreStack1);
- aTempMap.put(aTempOreStack2);
- aTempMap.put(aTempOreStack3);
- aTempMap.put(aTempOreStack4);
- aTempMap.put(aTempOreStack1);
- aTempMap.put(aTempOreStack2);
- aTempMap.put(aTempOreStack3);
- aTempMap.put(aTempOreStack4);
- aTempMap.put(aTempOreStack1);
- aTempMap.put(aTempOreStack2);
- aTempMap.put(aTempOreStack3);
- aTempMap.put(aTempOreStack4);
- }
- }
- Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Overworld]");
- for (GT_Worldgen_GT_Ore_Layer layer : aNetherOres) {
- if (layer.mEnabled) {
- ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1);
- ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1);
- ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1);
- ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1);
- aTempMap.put(aTempOreStack1);
- aTempMap.put(aTempOreStack2);
- aTempMap.put(aTempOreStack3);
- aTempMap.put(aTempOreStack4);
- aTempMap.put(aTempOreStack1);
- aTempMap.put(aTempOreStack2);
- aTempMap.put(aTempOreStack3);
- aTempMap.put(aTempOreStack4);
- }
- }
- Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Nether]");
- for (GT_Worldgen_GT_Ore_Layer layer : aEndOres) {
- if (layer.mEnabled) {
- ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1);
- ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1);
- ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1);
- ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1);
- aTempMap.put(aTempOreStack1);
- aTempMap.put(aTempOreStack2);
- aTempMap.put(aTempOreStack3);
- aTempMap.put(aTempOreStack4);
- }
- }
- Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [End]");
-
- addOreTypeToMap(ELEMENT.getInstance().IRON, 200, aTempMap);
- addOreTypeToMap(ELEMENT.getInstance().COPPER, 175, aTempMap);
- addOreTypeToMap(ELEMENT.getInstance().TIN, 150, aTempMap);
- addOreTypeToMap(ELEMENT.getInstance().GOLD, 150, aTempMap);
- addOreTypeToMap(ELEMENT.getInstance().SILVER, 110, aTempMap);
- addOreTypeToMap(ELEMENT.getInstance().NICKEL, 40, aTempMap);
- addOreTypeToMap(ELEMENT.getInstance().ZINC, 40, aTempMap);
- addOreTypeToMap(ELEMENT.getInstance().LEAD, 40, aTempMap);
- addOreTypeToMap(ELEMENT.getInstance().ALUMINIUM, 30, aTempMap);
- addOreTypeToMap(ELEMENT.getInstance().THORIUM, 20, aTempMap);
- Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Extra Common Ores]");
-
- AutoMap<Pair<String, Integer>> mMixedOreData = new AutoMap<Pair<String, Integer>>();
- mMixedOreData.put(new Pair<String, Integer>("oreRuby", 30));
- mMixedOreData.put(new Pair<String, Integer>("oreSapphire", 25));
- mMixedOreData.put(new Pair<String, Integer>("oreEmerald", 25));
- mMixedOreData.put(new Pair<String, Integer>("oreLapis", 40));
- mMixedOreData.put(new Pair<String, Integer>("oreRedstone", 40));
-
- if (LoadedMods.Thaumcraft || (OreDictUtils.containsValidEntries("oreAmber") && OreDictUtils.containsValidEntries("oreCinnabar"))) {
- mMixedOreData.put(new Pair<String, Integer>("oreAmber", 20));
- mMixedOreData.put(new Pair<String, Integer>("oreCinnabar", 20));
- }
- if (LoadedMods.Railcraft || OreDictUtils.containsValidEntries("oreSaltpeter")) {
- mMixedOreData.put(new Pair<String, Integer>("oreSaltpeter", 10));
- }
- if (LoadedMods.IndustrialCraft2 || OreDictUtils.containsValidEntries("oreUranium")) {
- mMixedOreData.put(new Pair<String, Integer>("oreUranium", 10));
- }
- if (OreDictUtils.containsValidEntries("oreSulfur")) {
- mMixedOreData.put(new Pair<String, Integer>("oreSulfur", 15));
- }
- if (OreDictUtils.containsValidEntries("oreSilicon")) {
- mMixedOreData.put(new Pair<String, Integer>("oreSilicon", 15));
- }
- if (OreDictUtils.containsValidEntries("oreApatite")) {
- mMixedOreData.put(new Pair<String, Integer>("oreApatite", 25));
- }
-
- mMixedOreData.put(new Pair<String, Integer>("oreFirestone", 2));
- mMixedOreData.put(new Pair<String, Integer>("oreBismuth", 20));
- mMixedOreData.put(new Pair<String, Integer>("oreLithium", 20));
- mMixedOreData.put(new Pair<String, Integer>("oreManganese", 20));
- mMixedOreData.put(new Pair<String, Integer>("oreBeryllium", 20));
- mMixedOreData.put(new Pair<String, Integer>("oreCoal", 75));
- mMixedOreData.put(new Pair<String, Integer>("oreLignite", 75));
- mMixedOreData.put(new Pair<String, Integer>("oreSalt", 15));
- mMixedOreData.put(new Pair<String, Integer>("oreCalcite", 15));
- mMixedOreData.put(new Pair<String, Integer>("oreBauxite", 20));
- mMixedOreData.put(new Pair<String, Integer>("oreAlmandine", 15));
- mMixedOreData.put(new Pair<String, Integer>("oreGraphite", 25));
- mMixedOreData.put(new Pair<String, Integer>("oreGlauconite", 15));
- mMixedOreData.put(new Pair<String, Integer>("orePyrolusite", 15));
- mMixedOreData.put(new Pair<String, Integer>("oreGrossular", 15));
- mMixedOreData.put(new Pair<String, Integer>("oreTantalite", 15));
-
- for (Pair<String, Integer> g : mMixedOreData) {
- for (int i=0; i<g.getValue();i++) {
- aTempMap.put(ItemUtils.getItemStackOfAmountFromOreDict(g.getKey(), 1));
- }
- }
- Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Extra Mixed Ores]");
-
-
- addOreTypeToMap(ELEMENT.STANDALONE.RUNITE, 2, aTempMap);
- addOreTypeToMap(ELEMENT.STANDALONE.GRANITE, 8, aTempMap);
- Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [OSRS Ores]");
-
-
- AutoMap<Material> aMyOreMaterials = new AutoMap<Material>();
- aMyOreMaterials.add(ORES.CROCROITE);
- aMyOreMaterials.add(ORES.GEIKIELITE);
- aMyOreMaterials.add(ORES.NICHROMITE);
- aMyOreMaterials.add(ORES.TITANITE);
- aMyOreMaterials.add(ORES.ZIMBABWEITE);
- aMyOreMaterials.add(ORES.ZIRCONILITE);
- aMyOreMaterials.add(ORES.GADOLINITE_CE);
- aMyOreMaterials.add(ORES.GADOLINITE_Y);
- aMyOreMaterials.add(ORES.LEPERSONNITE);
- aMyOreMaterials.add(ORES.SAMARSKITE_Y);
- aMyOreMaterials.add(ORES.SAMARSKITE_YB);
- aMyOreMaterials.add(ORES.XENOTIME);
- aMyOreMaterials.add(ORES.YTTRIAITE);
- aMyOreMaterials.add(ORES.YTTRIALITE);
- aMyOreMaterials.add(ORES.YTTROCERITE);
- aMyOreMaterials.add(ORES.ZIRCON);
- aMyOreMaterials.add(ORES.POLYCRASE);
- aMyOreMaterials.add(ORES.ZIRCOPHYLLITE);
- aMyOreMaterials.add(ORES.ZIRKELITE);
- aMyOreMaterials.add(ORES.LANTHANITE_LA);
- aMyOreMaterials.add(ORES.LANTHANITE_CE);
- aMyOreMaterials.add(ORES.LANTHANITE_ND);
- aMyOreMaterials.add(ORES.AGARDITE_Y);
- aMyOreMaterials.add(ORES.AGARDITE_CD);
- aMyOreMaterials.add(ORES.AGARDITE_LA);
- aMyOreMaterials.add(ORES.AGARDITE_ND);
- aMyOreMaterials.add(ORES.HIBONITE);
- aMyOreMaterials.add(ORES.CERITE);
- aMyOreMaterials.add(ORES.FLUORCAPHITE);
- aMyOreMaterials.add(ORES.FLORENCITE);
- aMyOreMaterials.add(ORES.CRYOLITE);
- aMyOreMaterials.add(ORES.LAUTARITE);
- aMyOreMaterials.add(ORES.LAFOSSAITE);
- aMyOreMaterials.add(ORES.DEMICHELEITE_BR);
- aMyOreMaterials.add(ORES.COMANCHEITE);
- aMyOreMaterials.add(ORES.PERROUDITE);
- aMyOreMaterials.add(ORES.HONEAITE);
- aMyOreMaterials.add(ORES.ALBURNITE);
- aMyOreMaterials.add(ORES.MIESSIITE);
- aMyOreMaterials.add(ORES.KASHINITE);
- aMyOreMaterials.add(ORES.IRARSITE);
- aMyOreMaterials.add(ORES.RADIOBARITE);
- aMyOreMaterials.add(ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT);
-
- for (Material aOreType : aMyOreMaterials) {
- if (aOreType == ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT || aOreType == ORES.RADIOBARITE) {
- addOreTypeToMap(aOreType, 4, aTempMap);
- }
- else {
- addOreTypeToMap(aOreType, 7, aTempMap);
- }
- }
-
- //Cleanup Map
- Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [GT++]");
- AutoMap<ItemStack> aCleanUp = new AutoMap<ItemStack>();
- for (ItemStack verify : aTempMap) {
- if (!ItemUtils.checkForInvalidItems(verify)) {
- aCleanUp.put(verify);
- }
- }
- Logger.INFO("Cleanup Map contains "+aCleanUp.size()+" values.");
- for (ItemStack remove : aCleanUp) {
- aTempMap.remove(remove);
- }
-
- //Generate Massive Map
- AutoMap<ItemStack> aFinalMap = new AutoMap<ItemStack>();
- for (ItemStack aTempItem : aTempMap) {
- int aTempMulti = MathUtils.randInt(20, 50);
- for (int i=0;i<aTempMulti;i++) {
- aFinalMap.put(aTempItem.copy());
- }
- }
- Logger.INFO("Final Ore Map contains "+aFinalMap.size()+" values.");
- mOutputs = aFinalMap;
- return mOutputs;
- }
-
-
- private static void addOreTypeToMap(Material aMaterial, int aAmount, AutoMap<ItemStack> aMap) {
- for (int i=0; i<aAmount;i++) {
- aMap.add(aMaterial.getOre(1));
- }
- }
-
-
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Miner";
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
-
-
-
-
-
-
-} \ No newline at end of file
+ protected double mProductionModifier = 0;
+
+ private static final ItemStack miningPipe;
+ private static final ItemStack miningPipeTip;
+
+ private Block casingBlock;
+ private int casingMeta;
+ // private int frameMeta;
+ private int casingTextureIndex;
+
+ private ForgeDirection back;
+
+ private int xDrill;
+ private int yDrill;
+ private int zDrill;
+
+ private int[] xCenter = new int[5];
+ private int[] zCenter = new int[5];
+
+ public GregtechMetaTileEntity_BedrockMiningPlatformBase(
+ final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ this.initFields();
+ }
+
+ public GregtechMetaTileEntity_BedrockMiningPlatformBase(final String aName) {
+ super(aName);
+ this.initFields();
+ }
+
+ private void initFields() {
+ this.casingBlock = this.getCasingBlockItem().getBlock();
+ this.casingMeta = this.getCasingBlockItem().get(0L, new Object[0]).getItemDamage();
+ this.casingTextureIndex = this.getCasingTextureIndex();
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return this.casingTextureIndex;
+ }
+
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "OreDrillingPlant.png");
+ }
+
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setDouble("mProductionModifier", mProductionModifier);
+ }
+
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mProductionModifier = aNBT.getDouble("mProductionModifier");
+ }
+
+ public boolean checkRecipe(final ItemStack aStack) {
+ // this.setElectricityStats();
+
+ if (true) {
+ return false;
+ }
+
+ boolean[] didWork = new boolean[5];
+
+ if (!this.tryConsumeDrillingFluid()) {
+ Logger.INFO("No drilling Fluid.");
+ return false;
+ }
+
+ if (MathUtils.isNumberEven((int) this.mProductionModifier)) {
+ if (!this.tryConsumePyrotheum()) {
+ Logger.INFO("No tryConsumePyrotheum Fluid.");
+ return false;
+ } else {
+ mProductionModifier++;
+ }
+ } else {
+ if (!this.tryConsumeCryotheum()) {
+ Logger.INFO("No tryConsumeCryotheum Fluid.");
+ return false;
+ } else {
+ mProductionModifier++;
+ }
+ }
+
+ for (int i = 0; i < 5; i++) {
+ process();
+ didWork[i] = true;
+ }
+
+ // Fail recipe handling if one pipe didn't handle properly, to try again
+ // next run.
+ for (boolean y : didWork) {
+ if (!y) {
+ Logger.INFO("[Bedrock Miner] Fail [x]");
+ return false;
+ }
+ }
+
+ this.mEUt = -8000;
+ this.mMaxProgresstime = 1;
+ this.mEfficiencyIncrease = 10000;
+
+ return true;
+ }
+
+ private boolean isEnergyEnough() {
+ long requiredEnergy = 512L + this.getMaxInputVoltage() * 4L;
+ for (final GT_MetaTileEntity_Hatch_Energy energyHatch : this.mEnergyHatches) {
+ requiredEnergy -= energyHatch.getEUVar();
+ if (requiredEnergy <= 0L) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void setElectricityStats() {
+ // this.mEfficiency = this.getCurrentEfficiency((ItemStack) null);
+ this.mEfficiencyIncrease = 10000;
+ final int overclock = 8 << GT_Utility.getTier(this.getMaxInputVoltage());
+ // this.mEUt = -12 * overclock * overclock;
+ Logger.INFO("Trying to set EU to " + (12 * overclock * overclock));
+ int mCombinedAvgTime = 0;
+ for (int g = 0; g < 5; g++) {
+ mCombinedAvgTime += this.getBaseProgressTime() / overclock;
+ }
+ Logger.INFO("Trying to set Max Time to " + (mCombinedAvgTime));
+ // this.mMaxProgresstime = (mCombinedAvgTime / 5);
+ }
+
+ private boolean tryConsumeDrillingFluid() {
+ boolean consumed = false;
+ boolean g = (this.getBaseMetaTileEntity().getWorld().getTotalWorldTime() % 2 == 0);
+ consumed = (g ? tryConsumePyrotheum() : tryConsumeCryotheum());
+ if (consumed) {
+ // increaseProduction(g ? 2 : 1);
+ } else {
+ // lowerProduction(g ? 5 : 3);
+ }
+ return consumed;
+ }
+
+ private boolean tryConsumePyrotheum() {
+ return this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 4));
+ }
+
+ private boolean tryConsumeCryotheum() {
+ return this.depleteInput(FluidUtils.getFluidStack("cryotheum", 4));
+ }
+
+ private void putMiningPipesFromInputsInController() {
+ final int maxPipes = 64;
+ if (this.isHasMiningPipes(maxPipes)) {
+ return;
+ }
+ ItemStack pipes = this.getStackInSlot(1);
+ for (final ItemStack storedItem : this.getStoredInputs()) {
+ if (!storedItem.isItemEqual(GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe)) {
+ continue;
+ }
+ if (pipes == null) {
+ this.setInventorySlotContents(
+ 1, GT_Utility.copy(new Object[] {GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe}));
+ pipes = this.getStackInSlot(1);
+ }
+ if (pipes.stackSize == maxPipes) {
+ break;
+ }
+ final int needPipes = maxPipes - pipes.stackSize;
+ final int transferPipes = (storedItem.stackSize < needPipes) ? storedItem.stackSize : needPipes;
+ final ItemStack itemStack = pipes;
+ itemStack.stackSize += transferPipes;
+ final ItemStack itemStack2 = storedItem;
+ itemStack2.stackSize -= transferPipes;
+ }
+ this.updateSlots();
+ }
+
+ private boolean isHasMiningPipes(final int minCount) {
+ final ItemStack pipe = this.getStackInSlot(1);
+ return pipe != null
+ && pipe.stackSize > minCount - 1
+ && pipe.isItemEqual(GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe);
+ }
+
+ public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
+ this.updateCoordinates();
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int tAmount = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ } else {
+
+ Block aCasing = Block.getBlockFromItem(getCasingBlockItem().getItem());
+
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity =
+ aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!this.addToMachineList(tTileEntity, 48)) {
+ if (aBlock != aCasing) {
+ Logger.INFO("Found Bad Casing");
+ return false;
+ }
+ if (aMeta != 3) {
+ Logger.INFO("Found Bad Meta");
+ return false;
+ }
+ }
+ ++tAmount;
+
+ /*if (!isValidBlockForStructure(tTileEntity, 48, true, aBlock, aMeta, sBlockCasings4, 0)) {
+ Logger.INFO("Bad centrifuge casing");
+ return false;
+ }*/
+
+ }
+ }
+ }
+ }
+ return tAmount >= 10;
+ }
+ }
+
+ private void updateCoordinates() {
+ this.xDrill = this.getBaseMetaTileEntity().getXCoord();
+ this.yDrill = this.getBaseMetaTileEntity().getYCoord() - 1;
+ this.zDrill = this.getBaseMetaTileEntity().getZCoord();
+ this.back =
+ ForgeDirection.getOrientation((int) this.getBaseMetaTileEntity().getBackFacing());
+
+ // Middle
+ this.xCenter[0] = this.xDrill + this.back.offsetX;
+ this.zCenter[0] = this.zDrill + this.back.offsetZ;
+
+ this.xCenter[1] = xCenter[0] + 1;
+ this.zCenter[1] = zCenter[0];
+
+ this.xCenter[2] = xCenter[0] - 1;
+ this.zCenter[2] = zCenter[0];
+
+ this.xCenter[3] = xCenter[0];
+ this.zCenter[3] = zCenter[0] + 1;
+
+ this.xCenter[4] = xCenter[0];
+ this.zCenter[4] = zCenter[0] - 1;
+ }
+
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return true;
+ }
+
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 0;
+ }
+
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ protected GregtechItemList getCasingBlockItem() {
+ return GregtechItemList.Casing_BedrockMiner;
+ }
+
+ protected abstract Material getFrameMaterial();
+
+ protected abstract int getCasingTextureIndex();
+
+ protected abstract int getRadiusInChunks();
+
+ protected abstract int getMinTier();
+
+ protected abstract int getBaseProgressTime();
+
+ protected String[] getDescriptionInternal(final String tierSuffix) {
+ final String casings = this.getCasingBlockItem().get(0L, new Object[0]).getDisplayName();
+ return new String[] {
+ "Controller Block for the Experimental Deep Earth Drilling Platform - MK "
+ + ((tierSuffix != null) ? tierSuffix : ""),
+ "Size(WxHxD): 3x7x3, Controller (Front middle bottom)",
+ "3x1x3 Base of " + casings,
+ "1x3x1 " + casings + " pillar (Center of base)",
+ "1x3x1 " + this.getFrameMaterial().getLocalizedName() + " Frame Boxes (Each pillar side and on top)",
+ "2x Input Hatch (Any bottom layer casing)",
+ "1x Input Bus for mining pipes (Any bottom layer casing; not necessary)",
+ "1x Output Bus (Any bottom layer casing)",
+ "1x Maintenance Hatch (Any bottom layer casing)",
+ "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)",
+ "Radius is " + (this.getRadiusInChunks() << 4) + " blocks",
+ "Every tick, this machine altenates betweem consumption of Pyrotheum & Cryotheum",
+ "Pyrotheum is used to bore through the Mantle of the world",
+ "Cryotheum is used to keep the internal components cool",
+ };
+ }
+
+ static {
+ miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0L);
+ miningPipeTip = GT_ModHandler.getIC2Item("miningPipeTip", 0L);
+ }
+
+ private AutoMap<ItemStack> mOutputs;
+
+ public void process() {
+ ItemStack aOutput = generateOutputWithchance();
+ if (aOutput != null) {
+ this.addOutput(aOutput);
+ Logger.INFO("Mined some " + aOutput.getDisplayName());
+ }
+ this.updateSlots();
+ }
+
+ public ItemStack generateOutputWithchance() {
+ int aChance = MathUtils.randInt(0, 7500);
+ if (aChance < 100) {
+ return generateOutput();
+ } else {
+ return null;
+ }
+ }
+
+ public ItemStack generateOutput() {
+ AutoMap<ItemStack> aData = generateOreForOutput();
+ int aMax = aData.size() - 1;
+ return aData.get(MathUtils.randInt(0, aMax));
+ }
+
+ /**
+ * Here we generate valid ores and also a basic loot set
+ */
+ public AutoMap<ItemStack> generateOreForOutput() {
+
+ if (mOutputs != null) {
+ return mOutputs;
+ }
+
+ AutoMap<GT_Worldgen_GT_Ore_Layer> aOverWorldOres = MiningUtils.getOresForDim(0);
+ AutoMap<GT_Worldgen_GT_Ore_Layer> aNetherOres = MiningUtils.getOresForDim(-1);
+ AutoMap<GT_Worldgen_GT_Ore_Layer> aEndOres = MiningUtils.getOresForDim(1);
+
+ AutoMap<ItemStack> aTempMap = new AutoMap<ItemStack>();
+ Block tOreBlock = GregTech_API.sBlockOres1;
+ Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Initial]");
+
+ for (GT_Worldgen_GT_Ore_Layer layer : aOverWorldOres) {
+ if (layer.mEnabled) {
+ ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1);
+ ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1);
+ ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1);
+ ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1);
+ aTempMap.put(aTempOreStack1);
+ aTempMap.put(aTempOreStack2);
+ aTempMap.put(aTempOreStack3);
+ aTempMap.put(aTempOreStack4);
+ aTempMap.put(aTempOreStack1);
+ aTempMap.put(aTempOreStack2);
+ aTempMap.put(aTempOreStack3);
+ aTempMap.put(aTempOreStack4);
+ aTempMap.put(aTempOreStack1);
+ aTempMap.put(aTempOreStack2);
+ aTempMap.put(aTempOreStack3);
+ aTempMap.put(aTempOreStack4);
+ }
+ }
+ Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Overworld]");
+ for (GT_Worldgen_GT_Ore_Layer layer : aNetherOres) {
+ if (layer.mEnabled) {
+ ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1);
+ ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1);
+ ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1);
+ ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1);
+ aTempMap.put(aTempOreStack1);
+ aTempMap.put(aTempOreStack2);
+ aTempMap.put(aTempOreStack3);
+ aTempMap.put(aTempOreStack4);
+ aTempMap.put(aTempOreStack1);
+ aTempMap.put(aTempOreStack2);
+ aTempMap.put(aTempOreStack3);
+ aTempMap.put(aTempOreStack4);
+ }
+ }
+ Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Nether]");
+ for (GT_Worldgen_GT_Ore_Layer layer : aEndOres) {
+ if (layer.mEnabled) {
+ ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1);
+ ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1);
+ ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1);
+ ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1);
+ aTempMap.put(aTempOreStack1);
+ aTempMap.put(aTempOreStack2);
+ aTempMap.put(aTempOreStack3);
+ aTempMap.put(aTempOreStack4);
+ }
+ }
+ Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [End]");
+
+ addOreTypeToMap(ELEMENT.getInstance().IRON, 200, aTempMap);
+ addOreTypeToMap(ELEMENT.getInstance().COPPER, 175, aTempMap);
+ addOreTypeToMap(ELEMENT.getInstance().TIN, 150, aTempMap);
+ addOreTypeToMap(ELEMENT.getInstance().GOLD, 150, aTempMap);
+ addOreTypeToMap(ELEMENT.getInstance().SILVER, 110, aTempMap);
+ addOreTypeToMap(ELEMENT.getInstance().NICKEL, 40, aTempMap);
+ addOreTypeToMap(ELEMENT.getInstance().ZINC, 40, aTempMap);
+ addOreTypeToMap(ELEMENT.getInstance().LEAD, 40, aTempMap);
+ addOreTypeToMap(ELEMENT.getInstance().ALUMINIUM, 30, aTempMap);
+ addOreTypeToMap(ELEMENT.getInstance().THORIUM, 20, aTempMap);
+ Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Extra Common Ores]");
+
+ AutoMap<Pair<String, Integer>> mMixedOreData = new AutoMap<Pair<String, Integer>>();
+ mMixedOreData.put(new Pair<String, Integer>("oreRuby", 30));
+ mMixedOreData.put(new Pair<String, Integer>("oreSapphire", 25));
+ mMixedOreData.put(new Pair<String, Integer>("oreEmerald", 25));
+ mMixedOreData.put(new Pair<String, Integer>("oreLapis", 40));
+ mMixedOreData.put(new Pair<String, Integer>("oreRedstone", 40));
+
+ if (LoadedMods.Thaumcraft
+ || (OreDictUtils.containsValidEntries("oreAmber")
+ && OreDictUtils.containsValidEntries("oreCinnabar"))) {
+ mMixedOreData.put(new Pair<String, Integer>("oreAmber", 20));
+ mMixedOreData.put(new Pair<String, Integer>("oreCinnabar", 20));
+ }
+ if (LoadedMods.Railcraft || OreDictUtils.containsValidEntries("oreSaltpeter")) {
+ mMixedOreData.put(new Pair<String, Integer>("oreSaltpeter", 10));
+ }
+ if (LoadedMods.IndustrialCraft2 || OreDictUtils.containsValidEntries("oreUranium")) {
+ mMixedOreData.put(new Pair<String, Integer>("oreUranium", 10));
+ }
+ if (OreDictUtils.containsValidEntries("oreSulfur")) {
+ mMixedOreData.put(new Pair<String, Integer>("oreSulfur", 15));
+ }
+ if (OreDictUtils.containsValidEntries("oreSilicon")) {
+ mMixedOreData.put(new Pair<String, Integer>("oreSilicon", 15));
+ }
+ if (OreDictUtils.containsValidEntries("oreApatite")) {
+ mMixedOreData.put(new Pair<String, Integer>("oreApatite", 25));
+ }
+
+ mMixedOreData.put(new Pair<String, Integer>("oreFirestone", 2));
+ mMixedOreData.put(new Pair<String, Integer>("oreBismuth", 20));
+ mMixedOreData.put(new Pair<String, Integer>("oreLithium", 20));
+ mMixedOreData.put(new Pair<String, Integer>("oreManganese", 20));
+ mMixedOreData.put(new Pair<String, Integer>("oreBeryllium", 20));
+ mMixedOreData.put(new Pair<String, Integer>("oreCoal", 75));
+ mMixedOreData.put(new Pair<String, Integer>("oreLignite", 75));
+ mMixedOreData.put(new Pair<String, Integer>("oreSalt", 15));
+ mMixedOreData.put(new Pair<String, Integer>("oreCalcite", 15));
+ mMixedOreData.put(new Pair<String, Integer>("oreBauxite", 20));
+ mMixedOreData.put(new Pair<String, Integer>("oreAlmandine", 15));
+ mMixedOreData.put(new Pair<String, Integer>("oreGraphite", 25));
+ mMixedOreData.put(new Pair<String, Integer>("oreGlauconite", 15));
+ mMixedOreData.put(new Pair<String, Integer>("orePyrolusite", 15));
+ mMixedOreData.put(new Pair<String, Integer>("oreGrossular", 15));
+ mMixedOreData.put(new Pair<String, Integer>("oreTantalite", 15));
+
+ for (Pair<String, Integer> g : mMixedOreData) {
+ for (int i = 0; i < g.getValue(); i++) {
+ aTempMap.put(ItemUtils.getItemStackOfAmountFromOreDict(g.getKey(), 1));
+ }
+ }
+ Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Extra Mixed Ores]");
+
+ addOreTypeToMap(ELEMENT.STANDALONE.RUNITE, 2, aTempMap);
+ addOreTypeToMap(ELEMENT.STANDALONE.GRANITE, 8, aTempMap);
+ Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [OSRS Ores]");
+
+ AutoMap<Material> aMyOreMaterials = new AutoMap<Material>();
+ aMyOreMaterials.add(ORES.CROCROITE);
+ aMyOreMaterials.add(ORES.GEIKIELITE);
+ aMyOreMaterials.add(ORES.NICHROMITE);
+ aMyOreMaterials.add(ORES.TITANITE);
+ aMyOreMaterials.add(ORES.ZIMBABWEITE);
+ aMyOreMaterials.add(ORES.ZIRCONILITE);
+ aMyOreMaterials.add(ORES.GADOLINITE_CE);
+ aMyOreMaterials.add(ORES.GADOLINITE_Y);
+ aMyOreMaterials.add(ORES.LEPERSONNITE);
+ aMyOreMaterials.add(ORES.SAMARSKITE_Y);
+ aMyOreMaterials.add(ORES.SAMARSKITE_YB);
+ aMyOreMaterials.add(ORES.XENOTIME);
+ aMyOreMaterials.add(ORES.YTTRIAITE);
+ aMyOreMaterials.add(ORES.YTTRIALITE);
+ aMyOreMaterials.add(ORES.YTTROCERITE);
+ aMyOreMaterials.add(ORES.ZIRCON);
+ aMyOreMaterials.add(ORES.POLYCRASE);
+ aMyOreMaterials.add(ORES.ZIRCOPHYLLITE);
+ aMyOreMaterials.add(ORES.ZIRKELITE);
+ aMyOreMaterials.add(ORES.LANTHANITE_LA);
+ aMyOreMaterials.add(ORES.LANTHANITE_CE);
+ aMyOreMaterials.add(ORES.LANTHANITE_ND);
+ aMyOreMaterials.add(ORES.AGARDITE_Y);
+ aMyOreMaterials.add(ORES.AGARDITE_CD);
+ aMyOreMaterials.add(ORES.AGARDITE_LA);
+ aMyOreMaterials.add(ORES.AGARDITE_ND);
+ aMyOreMaterials.add(ORES.HIBONITE);
+ aMyOreMaterials.add(ORES.CERITE);
+ aMyOreMaterials.add(ORES.FLUORCAPHITE);
+ aMyOreMaterials.add(ORES.FLORENCITE);
+ aMyOreMaterials.add(ORES.CRYOLITE);
+ aMyOreMaterials.add(ORES.LAUTARITE);
+ aMyOreMaterials.add(ORES.LAFOSSAITE);
+ aMyOreMaterials.add(ORES.DEMICHELEITE_BR);
+ aMyOreMaterials.add(ORES.COMANCHEITE);
+ aMyOreMaterials.add(ORES.PERROUDITE);
+ aMyOreMaterials.add(ORES.HONEAITE);
+ aMyOreMaterials.add(ORES.ALBURNITE);
+ aMyOreMaterials.add(ORES.MIESSIITE);
+ aMyOreMaterials.add(ORES.KASHINITE);
+ aMyOreMaterials.add(ORES.IRARSITE);
+ aMyOreMaterials.add(ORES.RADIOBARITE);
+ aMyOreMaterials.add(ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT);
+
+ for (Material aOreType : aMyOreMaterials) {
+ if (aOreType == ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT || aOreType == ORES.RADIOBARITE) {
+ addOreTypeToMap(aOreType, 4, aTempMap);
+ } else {
+ addOreTypeToMap(aOreType, 7, aTempMap);
+ }
+ }
+
+ // Cleanup Map
+ Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [GT++]");
+ AutoMap<ItemStack> aCleanUp = new AutoMap<ItemStack>();
+ for (ItemStack verify : aTempMap) {
+ if (!ItemUtils.checkForInvalidItems(verify)) {
+ aCleanUp.put(verify);
+ }
+ }
+ Logger.INFO("Cleanup Map contains " + aCleanUp.size() + " values.");
+ for (ItemStack remove : aCleanUp) {
+ aTempMap.remove(remove);
+ }
+
+ // Generate Massive Map
+ AutoMap<ItemStack> aFinalMap = new AutoMap<ItemStack>();
+ for (ItemStack aTempItem : aTempMap) {
+ int aTempMulti = MathUtils.randInt(20, 50);
+ for (int i = 0; i < aTempMulti; i++) {
+ aFinalMap.put(aTempItem.copy());
+ }
+ }
+ Logger.INFO("Final Ore Map contains " + aFinalMap.size() + " values.");
+ mOutputs = aFinalMap;
+ return mOutputs;
+ }
+
+ private static void addOreTypeToMap(Material aMaterial, int aAmount, AutoMap<ItemStack> aMap) {
+ for (int i = 0; i < aAmount; i++) {
+ aMap.add(aMaterial.getOre(1));
+ }
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Miner";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
index 77916eb9f4..87442949a5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
@@ -1,11 +1,13 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.chemplant;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.filterByMTETier;
+import static gregtech.api.util.GT_StructureUtility.ofCoil;
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
@@ -32,953 +34,995 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.GT_MetaTileEntity_Hatch_Catalysts;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.tuple.Pair;
-
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gregtech.api.util.GT_StructureUtility.filterByMTETier;
-import static gregtech.api.util.GT_StructureUtility.ofCoil;
-import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
-public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<GregtechMTE_ChemicalPlant> implements ISurvivalConstructable {
-
- private int mSolidCasingTier = 0;
- private int mMachineCasingTier = 0;
- private int mPipeCasingTier = 0;
- private int mCoilTier = 0;
- private HeatingCoilLevel checkCoil;
- private int[] checkCasing = new int[8];
- private int checkMachine;
- private int checkPipe;
- private int maxTierOfHatch;
- private int mCasing;
- private IStructureDefinition<GregtechMTE_ChemicalPlant> STRUCTURE_DEFINITION = null;
-
- private final ArrayList<GT_MetaTileEntity_Hatch_Catalysts> mCatalystBuses = new ArrayList<GT_MetaTileEntity_Hatch_Catalysts>();
-
- private static final HashMap<Integer, Triplet<Block, Integer, Integer>> mTieredBlockRegistry = new HashMap<>();
-
- public GregtechMTE_ChemicalPlant(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMTE_ChemicalPlant(final String aName) {
- super(aName);
- }
-
- public static boolean registerMachineCasingForTier(int aTier, Block aBlock, int aMeta, int aCasingTextureID) {
- Triplet<Block, Integer, Integer> aCasingData = new Triplet<Block, Integer, Integer>(aBlock, aMeta, aCasingTextureID);
- if (mTieredBlockRegistry.containsKey(aTier)) {
- CORE.crash("Tried to register a Machine casing for tier "+aTier+" to the Chemical Plant, however this tier already contains one.");
- }
- mTieredBlockRegistry.put(aTier, aCasingData);
- return true;
- }
-
- private static int getCasingTextureIdForTier(int aTier) {
- if (!mTieredBlockRegistry.containsKey(aTier)) {
- return 10;
- }
- int aCasingID = mTieredBlockRegistry.get(aTier).getValue_3();
- //Logger.INFO("Found casing texture ID "+aCasingID+" for tier "+aTier);
- return aCasingID;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMTE_ChemicalPlant(this.mName);
- }
-
- @Override
- public String getMachineType() {
- return "Chemical Plant";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Chemical Plant")
- .addInfo("Heavy Industry, now right at your doorstep!")
- .addInfo("Please read the user manual for more information on construction and usage")
- .addSeparator()
- .addController("Bottom Center")
- .addStructureHint("Catalyst Housing", 1)
- .addInputBus("Bottom Casing", 1)
- .addOutputBus("Bottom Casing", 1)
- .addInputHatch("Bottom Casing", 1)
- .addOutputHatch("Bottom Casing", 1)
- .addEnergyHatch("Bottom Casing", 1)
- .addMaintenanceHatch("Bottom Casing", 1)
- .addSubChannelUsage("casing", "metal machine casing")
- .addSubChannelUsage("machine", "tier machine casing")
- .addSubChannelUsage("coil", "heating coil blocks")
- .addSubChannelUsage("pipe", "pipe casing blocks")
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- public void setMachineMeta(int meta) {
- checkMachine = meta;
- }
-
- public int getMachineMeta() {
- return checkMachine;
- }
-
- public void setPipeMeta(int meta) {
- checkPipe = meta;
- }
-
- public int getPipeMeta() {
- return checkPipe;
- }
-
- public void setCoilMeta(HeatingCoilLevel meta) {
- checkCoil = meta;
- }
-
- public HeatingCoilLevel getCoilMeta() {
- return checkCoil;
- }
-
- public int coilTier(int meta) {
- switch (meta) {
- case 0: return 1;
- case 1: return 2;
- case 2: return 3;
- case 3: return 4;
- case 4: return 5;
- case 5: return 7;
- case 6: return 8;
- case 7: return 10;
- case 8: return 11;
- case 9: return 6;
- case 10: return 9;
- case 11: return 12;
- case 12: return 13;
- case 13: return 14;
- default: return 0;
- }
- }
-
- @Override
- public IStructureDefinition<GregtechMTE_ChemicalPlant> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- IStructureElement<GregtechMTE_ChemicalPlant> allCasingsElement = withChannel(
- "casing",
- ofChain(
- IntStream.range(0, 8)
- .mapToObj(GregtechMTE_ChemicalPlant::ofSolidCasing)
- .collect(Collectors.toList())
- )
- );
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ChemicalPlant>builder()
- .addShape(mName, transpose(new String[][]{
- {"XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX"},
- {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"},
- {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"},
- {"X X", " ", " HHH ", " HHH ", " HHH ", " ", "X X"},
- {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"},
- {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"},
- {"CCC~CCC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CCCCCCC"},
- }))
- .addElement(
- 'C',
- ofChain(
- buildHatchAdder(GregtechMTE_ChemicalPlant.class)
- .atLeast(Maintenance)
- .casingIndex(getCasingTextureID())
- .dot(1)
- .build(),
- buildHatchAdder(GregtechMTE_ChemicalPlant.class)
- .atLeast(InputHatch, OutputHatch, InputBus, OutputBus)
- .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList)
- .hatchItemFilterAnd((t, s) -> filterByMTETier(Integer.MIN_VALUE, s.stackSize >= 10 ? Integer.MAX_VALUE : s.stackSize))
- .casingIndex(getCasingTextureID())
- .dot(1)
- .build(),
- buildHatchAdder(GregtechMTE_ChemicalPlant.class)
- .hatchClass(GT_MetaTileEntity_Hatch_Catalysts.class)
- .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList)
- .casingIndex(getCasingTextureID())
- .dot(1)
- .build(),
- allCasingsElement
- )
- )
- .addElement(
- 'X',
- allCasingsElement
- )
- .addElement(
- 'M',
- withChannel(
- "machine",
- addTieredBlock(
- GregTech_API.sBlockCasings1, GregtechMTE_ChemicalPlant::setMachineMeta, GregtechMTE_ChemicalPlant::getMachineMeta, 10
- )
- )
- )
- .addElement(
- 'H',
- withChannel(
- "coil",
- ofCoil(GregtechMTE_ChemicalPlant::setCoilMeta, GregtechMTE_ChemicalPlant::getCoilMeta)
- )
- )
- .addElement(
- 'P',
- withChannel(
- "pipe",
- addTieredBlock(
- GregTech_API.sBlockCasings2, GregtechMTE_ChemicalPlant::setPipeMeta, GregtechMTE_ChemicalPlant::getPipeMeta, 12, 16
- )
- )
- )
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- private static IStructureElement<GregtechMTE_ChemicalPlant> ofSolidCasing(int aIndex) {
- return new IStructureElement<GregtechMTE_ChemicalPlant>() {
- @Override
- public boolean check(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z) {
- if (check(aIndex, world, x, y, z)) {
- t.checkCasing[aIndex]++;
- t.mCasing++;
- return true;
- }
- else return false;
- }
-
- private boolean check(int aIndex, World world, int x, int y, int z) {
- Block block = world.getBlock(x, y, z);
- int meta = world.getBlockMetadata(x, y, z);
- Block target = mTieredBlockRegistry.get(aIndex).getValue_1();
- int targetMeta = mTieredBlockRegistry.get(aIndex).getValue_2();
- return target.equals(block) && meta == targetMeta;
- }
-
- int getIndex(int size) {
- if (size > 8) size = 8;
- return size - 1;
- }
-
- @Override
- public boolean spawnHint(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, ItemStack trigger) {
- StructureLibAPI.hintParticle(world, x, y, z, mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2());
- return true;
- }
-
- @Override
- public boolean placeBlock(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, ItemStack trigger) {
- return world.setBlock(x, y, z, mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2(), 3);
- }
-
- @Override
- public PlaceResult survivalPlaceBlock(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
- if (check(getIndex(trigger.stackSize), world, x, y, z)) return PlaceResult.SKIP;
- return StructureUtility.survivalPlaceBlock(mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2(), world, x, y, z, s, actor, chatter);
- }
- };
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 3, 6, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- return survivialBuildPiece(mName, stackSize, 3, 6, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- for (int i = 0; i < 8; i++) {
- checkCasing[i] = 0;
- }
- checkPipe = 0;
- checkMachine = 0;
- mSolidCasingTier = 0;
- mMachineCasingTier = 0;
- mPipeCasingTier = 0;
- mCoilTier = 0;
- mCatalystBuses.clear();
- if (checkPiece(mName, 3, 6, 0) && mCasing >= 70) {
- for (int i = 0; i < 8; i++) {
- if (checkCasing[i] == mCasing) {
- mSolidCasingTier = i;
- }
- else if (checkCasing[i] > 0)
- return false;
- }
- mMachineCasingTier = checkMachine - 1;
- mPipeCasingTier = checkPipe - 12;
- mCoilTier = checkCoil.getTier();
- getBaseMetaTileEntity().sendBlockEvent(GregTechTileClientEvents.CHANGE_CUSTOM_DATA, getUpdateData());
- updateHatchTexture();
- return mMachineCasingTier >= 9 || mMachineCasingTier >= maxTierOfHatch;
- }
- return false;
- }
-
- public void updateHatchTexture() {
- for (GT_MetaTileEntity_Hatch h : mCatalystBuses) h.updateTexture(getCasingTextureID());
- for (GT_MetaTileEntity_Hatch h : mInputBusses) h.updateTexture(getCasingTextureID());
- for (GT_MetaTileEntity_Hatch h : mMaintenanceHatches) h.updateTexture(getCasingTextureID());
- for (GT_MetaTileEntity_Hatch h : mEnergyHatches) h.updateTexture(getCasingTextureID());
- for (GT_MetaTileEntity_Hatch h : mOutputBusses) h.updateTexture(getCasingTextureID());
- for (GT_MetaTileEntity_Hatch h : mInputHatches) h.updateTexture(getCasingTextureID());
- for (GT_MetaTileEntity_Hatch h : mOutputHatches) h.updateTexture(getCasingTextureID());
- }
-
- public final boolean addChemicalPlantList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Catalysts){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){
- maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier);
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){
- maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier);
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
- maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier);
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier);
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier);
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- return false;
- }
-
- @Override
- public String getSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(207));
- }
-
- @Override
- protected IIconContainer getActiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
- }
-
- @Override
- protected IIconContainer getInactiveOverlay() {
- return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
- }
-
- @Override
- protected int getCasingTextureId() {
- return getCasingTextureID();
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- if (GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList.size() == 0) {
- generateRecipes();
- }
- return GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT;
- }
-
- public static void generateRecipes() {
- for (GT_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) {
- GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.add(i);
- }
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 2 * getPipeCasingTier();
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 100;
- }
-
- private int getSolidCasingTier() {
- return this.mSolidCasingTier;
- }
-
- private int getMachineCasingTier() {
- return mMachineCasingTier;
- }
-
- private int getPipeCasingTier() {
- return mPipeCasingTier;
- }
-
- private int getCasingTextureID() {
- // Check the Tier Client Side
- int aTier = mSolidCasingTier;
- return getCasingTextureIdForTier(aTier);
- }
-
- public boolean addToMachineList(IGregTechTileEntity aTileEntity) {
- int aMaxTier = getMachineCasingTier();
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_TieredMachineBlock) {
- GT_MetaTileEntity_TieredMachineBlock aMachineBlock = (GT_MetaTileEntity_TieredMachineBlock) aMetaTileEntity;
- int aTileTier = aMachineBlock.mTier;
- if (aTileTier > aMaxTier) {
- log("Hatch tier too high.");
- return false;
- }
- else {
- return addToMachineList(aTileEntity, getCasingTextureID());
- }
- }
- else {
- log("Bad Tile Entity being added to hatch map."); // Shouldn't ever happen, but.. ya know..
- return false;
- }
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mSolidCasingTier", this.mSolidCasingTier);
- aNBT.setInteger("mMachineCasingTier", this.mMachineCasingTier);
- aNBT.setInteger("mPipeCasingTier", this.mPipeCasingTier);
- aNBT.setInteger("mCoilTier", this.mCoilTier);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mSolidCasingTier = aNBT.getInteger("mSolidCasingTier");
- mMachineCasingTier = aNBT.getInteger("mMachineCasingTier");
- mPipeCasingTier = aNBT.getInteger("mPipeCasingTier");
- mCoilTier = aNBT.getInteger("mCoilTier");
- }
-
- @Override
- public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Catalysts) {
- log("Found GT_MetaTileEntity_Hatch_Catalysts");
- return addToMachineListInternal(mCatalystBuses, aMetaTileEntity, aBaseCasingIndex);
- }
- return super.addToMachineList(aTileEntity, aBaseCasingIndex);
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- // Same speed bonus as pyro oven
- public int getSpeedBonus() {
- return 50 * (this.mCoilTier - 1);
- }
-
- public int getMaxCatalystDurability() {
- return 50;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
- this.mCatalystBuses.clear();
- }
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public byte getUpdateData() {
- return (byte) mSolidCasingTier;
- }
-
- @Override
- public void receiveClientEvent(byte aEventID, byte aValue) {
- super.receiveClientEvent(aEventID, aValue);
- if (aEventID == GregTechTileClientEvents.CHANGE_CUSTOM_DATA && (aValue & 0x80) == 0) {
- // received an update data from above method
- // if no &0x80 clause it might catch the noop texture page event
- mSolidCasingTier = aValue;
- }
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), getSpeedBonus());
- }
-
- @Override
- public boolean checkRecipeGeneric(int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
- ArrayList<ItemStack> tItems = getStoredInputs();
- ArrayList<FluidStack> tFluids = getStoredFluids();
- ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
- FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
- return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll);
- }
-
- @Override
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
-
- // Based on the Processing Array. A bit overkill, but very flexible.
-
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- long tEnergy = getMaxInputEnergy();
- log("Running checkRecipeGeneric(0)");
-
- //GT_Recipe tRecipe = findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
- GT_Recipe tRecipe = findRecipe(mLastRecipe, gregtech.api.enums.GT_Values.V[tTier], getSolidCasingTier(), aItemInputs, aFluidInputs);
-
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
-
- // checks if it has a catalyst
- ItemStack tCatalystRecipe = null;
- boolean aDoesRecipeNeedCatalyst = false;
- for (ItemStack aInputItem : tRecipe.mInputs) {
- if (ItemUtils.isCatalyst(aInputItem)) {
- aDoesRecipeNeedCatalyst = true;
- break;
- }
- }
- if (aDoesRecipeNeedCatalyst) {
- tCatalystRecipe = findCatalyst(aItemInputs, tRecipe.mInputs);
- if (tCatalystRecipe == null) {
- log("does not have catalyst");
- return false;
- }
- if (mCatalystBuses.size() != 1) {
- log("does not have correct number of catalyst hatches. (Required 1, found "+mCatalystBuses.size()+")");
- return false;
- }
- }
-
-
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
-
- if (tRecipe.mSpecialValue > this.mSolidCasingTier) {
- log("solid tier is too low");
- return false;
- }
-
- aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
- if (aMaxParallelRecipes == 0) {
- log("BAD RETURN - 2");
- return false;
- }
-
- // checks if it has enough catalyst durability
- ArrayList<ItemStack>tCatalysts = null;
- int tMaxParallelCatalyst = aMaxParallelRecipes;
- if (tCatalystRecipe != null) {
- tCatalysts = new ArrayList<ItemStack>();
- tMaxParallelCatalyst = getCatalysts(aItemInputs, tCatalystRecipe, aMaxParallelRecipes, tCatalysts);
- log("Can process "+tMaxParallelCatalyst+" recipes. If less than "+aMaxParallelRecipes+", catalyst does not have enough durability.");
- }
-
- if (tMaxParallelCatalyst == 0) {
- log("found not enough catalysts");
- return false;
- }
-
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
- log("aEUPercent "+aEUPercent);
- log("mEUt "+tRecipe.mEUt);
-
- int parallelRecipes = 0;
-
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+tMaxParallelCatalyst);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tEnergy: "+tEnergy);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < tMaxParallelCatalyst && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
- }
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
-
-
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
- }
- }
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Damage catalyst once all is said and done.
- if (tCatalystRecipe != null) {
- log("damaging catalyst");
- damageCatalyst(tCatalystRecipe, parallelRecipes);
- }
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
- for (GT_MetaTileEntity_Hatch_Catalysts h : mCatalystBuses) {
- h.updateSlots();
- h.tryFillUsageSlots();
- }
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- log("GOOD RETURN - 1");
- return true;
- }
-
- private static final HashMap<Long, AutoMap<GT_Recipe>> mTieredRecipeMap = new HashMap<Long, AutoMap<GT_Recipe>>();
- private static final AutoMap<GT_Recipe> aTier0Recipes = new AutoMap<GT_Recipe>();
- private static final AutoMap<GT_Recipe> aTier1Recipes = new AutoMap<GT_Recipe>();
- private static final AutoMap<GT_Recipe> aTier2Recipes = new AutoMap<GT_Recipe>();
- private static final AutoMap<GT_Recipe> aTier3Recipes = new AutoMap<GT_Recipe>();
- private static final AutoMap<GT_Recipe> aTier4Recipes = new AutoMap<GT_Recipe>();
- private static final AutoMap<GT_Recipe> aTier5Recipes = new AutoMap<GT_Recipe>();
- private static final AutoMap<GT_Recipe> aTier6Recipes = new AutoMap<GT_Recipe>();
- private static final AutoMap<GT_Recipe> aTier7Recipes = new AutoMap<GT_Recipe>();
- private static boolean mInitRecipeCache = false;
-
- private static void initRecipeCaches() {
- if (!mInitRecipeCache) {
- mTieredRecipeMap.put((long) 0, aTier0Recipes);
- mTieredRecipeMap.put((long) 1, aTier1Recipes);
- mTieredRecipeMap.put((long) 2, aTier2Recipes);
- mTieredRecipeMap.put((long) 3, aTier3Recipes);
- mTieredRecipeMap.put((long) 4, aTier4Recipes);
- mTieredRecipeMap.put((long) 5, aTier5Recipes);
- mTieredRecipeMap.put((long) 6, aTier6Recipes);
- mTieredRecipeMap.put((long) 7, aTier7Recipes);
- for (GT_Recipe aRecipe : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList) {
- if (aRecipe != null) {
- switch (aRecipe.mSpecialValue) {
- case 0:
- aTier0Recipes.add(aRecipe);
- continue;
- case 1:
- aTier1Recipes.add(aRecipe);
- continue;
- case 2:
- aTier2Recipes.add(aRecipe);
- continue;
- case 3:
- aTier3Recipes.add(aRecipe);
- continue;
- case 4:
- aTier4Recipes.add(aRecipe);
- continue;
- case 5:
- aTier5Recipes.add(aRecipe);
- continue;
- case 6:
- aTier6Recipes.add(aRecipe);
- continue;
- case 7:
- aTier7Recipes.add(aRecipe);
- continue;
- }
- }
- }
- mInitRecipeCache = true;
- }
- }
-
- public GT_Recipe findRecipe(final GT_Recipe aRecipe, final long aVoltage, final long aSpecialValue, ItemStack[] aInputs, final FluidStack[] aFluids) {
- if (!mInitRecipeCache) {
- initRecipeCaches();
- }
- if (this.getRecipeMap().mRecipeList.isEmpty()) {
- log("No Recipes in Map to search through.");
- return null;
- }
- else {
- log("Checking tier "+aSpecialValue+" recipes and below. Using Input Voltage of "+aVoltage+"V.");
- log("We have "+aInputs.length+" Items and "+aFluids.length+" Fluids.");
- // Try check the cached recipe first
- if (aRecipe != null) {
- if (aRecipe.isRecipeInputEqual(false, aFluids, aInputs)) {
- if (aRecipe.mEUt <= aVoltage) {
- Logger.INFO("Using cached recipe.");
- return aRecipe;
- }
- }
- }
-
- // Get all recipes for the tier
- AutoMap<AutoMap<GT_Recipe>> aMasterMap = new AutoMap<AutoMap<GT_Recipe>>();
- for (long i=0;i<=aSpecialValue;i++) {
- aMasterMap.add(mTieredRecipeMap.get(i));
- }
- GT_Recipe aFoundRecipe = null;
-
- // Iterate the tiers recipes until we find the one with all inputs matching
- master : for (AutoMap<GT_Recipe> aTieredMap : aMasterMap) {
- for (GT_Recipe aRecipeToCheck : aTieredMap) {
- if (aRecipeToCheck.isRecipeInputEqual(false, aFluids, aInputs)) {
- log("Found recipe with matching inputs!");
- if (aRecipeToCheck.mSpecialValue <= aSpecialValue) {
- if (aRecipeToCheck.mEUt <= aVoltage) {
- aFoundRecipe = aRecipeToCheck;
- break master;
- }
- }
- }
- }
- }
-
- // If we found a recipe, return it
- if (aFoundRecipe != null) {
- log("Found valid recipe.");
- return aFoundRecipe;
- }
- }
- log("Did not find valid recipe.");
- return null;
- }
-
- private int getCatalysts(ItemStack[] aItemInputs, ItemStack aRecipeCatalyst, int aMaxParrallel, ArrayList<ItemStack> aOutPut) {
- int allowedParallel = 0;
- for (final ItemStack aInput : aItemInputs) {
- if (aRecipeCatalyst.isItemEqual(aInput)) {
- int aDurabilityRemaining = getMaxCatalystDurability() - getDamage(aInput);
- return Math.min(aMaxParrallel, aDurabilityRemaining);
- }
- }
- return allowedParallel;
- }
-
- private ItemStack findCatalyst(ItemStack[] aItemInputs, ItemStack[] aRecipeInputs) {
- if (aItemInputs != null) {
- for (final ItemStack aInput : aItemInputs) {
- if (aInput != null) {
- if (ItemUtils.isCatalyst(aInput)) {
- for (ItemStack aRecipeInput : aRecipeInputs) {
- if (GT_Utility.areStacksEqual(aRecipeInput, aInput, true)) {
- return aInput;
- }
- }
- }
- }
- }
- }
- return null;
- }
-
-
- private void damageCatalyst(ItemStack aStack, int parallelRecipes) {
- for (int i=0; i<parallelRecipes; i++){
- // Awakened Draconium Coils with Tungstensteel Pipe Casings (or above) no longer consume catalysts.
- if (this.mCoilTier >= 10 && this.mPipeCasingTier >= 4) {
- log("not consuming catalyst");
- }
- else if (MathUtils.randFloat(0, 10000000)/10000000f < (1.2f - (0.2 * this.mPipeCasingTier))) {
- int damage = getDamage(aStack) + 1;
- log("damage catalyst "+damage);
- if (damage >= getMaxCatalystDurability()) {
- log("consume catalyst");
- addOutput(CI.getEmptyCatalyst(1));
- aStack.stackSize -= 1;
- }
- else {
- log("damaging catalyst");
- setDamage(aStack, damage);
- }
- }
- else {
- log("not consuming catalyst");
- }
- }
- }
-
- private int getDamage(ItemStack aStack) {
- return ItemGenericChemBase.getCatalystDamage(aStack);
- }
-
- private void setDamage(ItemStack aStack,int aAmount) {
- ItemGenericChemBase.setCatalystDamage(aStack, aAmount);
- }
-
- /*
- * Catalyst Handling
- */
- @Override
- public ArrayList<ItemStack> getStoredInputs() {
- ArrayList<ItemStack> tItems = super.getStoredInputs();
- if (this.hasSlotInGUI() && this.getGUIItemStack() != null) {
- tItems.add(this.getGUIItemStack());
- }
- for (GT_MetaTileEntity_Hatch_Catalysts tHatch : mCatalystBuses) {
- tHatch.mRecipeMap = getRecipeMap();
- if (isValidMetaTileEntity(tHatch)) {
- AutoMap<ItemStack> aHatchContent = tHatch.getContentUsageSlots();
- if (!aHatchContent.isEmpty()) {
- tItems.addAll(aHatchContent);
- }
- }
- }
- return tItems;
- }
+public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<GregtechMTE_ChemicalPlant>
+ implements ISurvivalConstructable {
+
+ private int mSolidCasingTier = 0;
+ private int mMachineCasingTier = 0;
+ private int mPipeCasingTier = 0;
+ private int mCoilTier = 0;
+ private HeatingCoilLevel checkCoil;
+ private int[] checkCasing = new int[8];
+ private int checkMachine;
+ private int checkPipe;
+ private int maxTierOfHatch;
+ private int mCasing;
+ private IStructureDefinition<GregtechMTE_ChemicalPlant> STRUCTURE_DEFINITION = null;
+
+ private final ArrayList<GT_MetaTileEntity_Hatch_Catalysts> mCatalystBuses =
+ new ArrayList<GT_MetaTileEntity_Hatch_Catalysts>();
+
+ private static final HashMap<Integer, Triplet<Block, Integer, Integer>> mTieredBlockRegistry = new HashMap<>();
+
+ public GregtechMTE_ChemicalPlant(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMTE_ChemicalPlant(final String aName) {
+ super(aName);
+ }
+
+ public static boolean registerMachineCasingForTier(int aTier, Block aBlock, int aMeta, int aCasingTextureID) {
+ Triplet<Block, Integer, Integer> aCasingData =
+ new Triplet<Block, Integer, Integer>(aBlock, aMeta, aCasingTextureID);
+ if (mTieredBlockRegistry.containsKey(aTier)) {
+ CORE.crash("Tried to register a Machine casing for tier " + aTier
+ + " to the Chemical Plant, however this tier already contains one.");
+ }
+ mTieredBlockRegistry.put(aTier, aCasingData);
+ return true;
+ }
+
+ private static int getCasingTextureIdForTier(int aTier) {
+ if (!mTieredBlockRegistry.containsKey(aTier)) {
+ return 10;
+ }
+ int aCasingID = mTieredBlockRegistry.get(aTier).getValue_3();
+ // Logger.INFO("Found casing texture ID "+aCasingID+" for tier "+aTier);
+ return aCasingID;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMTE_ChemicalPlant(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Chemical Plant";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the Chemical Plant")
+ .addInfo("Heavy Industry, now right at your doorstep!")
+ .addInfo("Please read the user manual for more information on construction and usage")
+ .addSeparator()
+ .addController("Bottom Center")
+ .addStructureHint("Catalyst Housing", 1)
+ .addInputBus("Bottom Casing", 1)
+ .addOutputBus("Bottom Casing", 1)
+ .addInputHatch("Bottom Casing", 1)
+ .addOutputHatch("Bottom Casing", 1)
+ .addEnergyHatch("Bottom Casing", 1)
+ .addMaintenanceHatch("Bottom Casing", 1)
+ .addSubChannelUsage("casing", "metal machine casing")
+ .addSubChannelUsage("machine", "tier machine casing")
+ .addSubChannelUsage("coil", "heating coil blocks")
+ .addSubChannelUsage("pipe", "pipe casing blocks")
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ public void setMachineMeta(int meta) {
+ checkMachine = meta;
+ }
+
+ public int getMachineMeta() {
+ return checkMachine;
+ }
+
+ public void setPipeMeta(int meta) {
+ checkPipe = meta;
+ }
+
+ public int getPipeMeta() {
+ return checkPipe;
+ }
+
+ public void setCoilMeta(HeatingCoilLevel meta) {
+ checkCoil = meta;
+ }
+
+ public HeatingCoilLevel getCoilMeta() {
+ return checkCoil;
+ }
+
+ public int coilTier(int meta) {
+ switch (meta) {
+ case 0:
+ return 1;
+ case 1:
+ return 2;
+ case 2:
+ return 3;
+ case 3:
+ return 4;
+ case 4:
+ return 5;
+ case 5:
+ return 7;
+ case 6:
+ return 8;
+ case 7:
+ return 10;
+ case 8:
+ return 11;
+ case 9:
+ return 6;
+ case 10:
+ return 9;
+ case 11:
+ return 12;
+ case 12:
+ return 13;
+ case 13:
+ return 14;
+ default:
+ return 0;
+ }
+ }
+
+ @Override
+ public IStructureDefinition<GregtechMTE_ChemicalPlant> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ IStructureElement<GregtechMTE_ChemicalPlant> allCasingsElement = withChannel(
+ "casing",
+ ofChain(IntStream.range(0, 8)
+ .mapToObj(GregtechMTE_ChemicalPlant::ofSolidCasing)
+ .collect(Collectors.toList())));
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ChemicalPlant>builder()
+ .addShape(mName, transpose(new String[][] {
+ {"XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX"},
+ {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"},
+ {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"},
+ {"X X", " ", " HHH ", " HHH ", " HHH ", " ", "X X"},
+ {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"},
+ {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"},
+ {"CCC~CCC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CCCCCCC"},
+ }))
+ .addElement(
+ 'C',
+ ofChain(
+ buildHatchAdder(GregtechMTE_ChemicalPlant.class)
+ .atLeast(Maintenance)
+ .casingIndex(getCasingTextureID())
+ .dot(1)
+ .build(),
+ buildHatchAdder(GregtechMTE_ChemicalPlant.class)
+ .atLeast(InputHatch, OutputHatch, InputBus, OutputBus)
+ .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList)
+ .hatchItemFilterAnd((t, s) -> filterByMTETier(
+ Integer.MIN_VALUE,
+ s.stackSize >= 10 ? Integer.MAX_VALUE : s.stackSize))
+ .casingIndex(getCasingTextureID())
+ .dot(1)
+ .build(),
+ buildHatchAdder(GregtechMTE_ChemicalPlant.class)
+ .hatchClass(GT_MetaTileEntity_Hatch_Catalysts.class)
+ .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList)
+ .casingIndex(getCasingTextureID())
+ .dot(1)
+ .build(),
+ allCasingsElement))
+ .addElement('X', allCasingsElement)
+ .addElement(
+ 'M',
+ withChannel(
+ "machine",
+ addTieredBlock(
+ GregTech_API.sBlockCasings1,
+ GregtechMTE_ChemicalPlant::setMachineMeta,
+ GregtechMTE_ChemicalPlant::getMachineMeta,
+ 10)))
+ .addElement(
+ 'H',
+ withChannel(
+ "coil",
+ ofCoil(
+ GregtechMTE_ChemicalPlant::setCoilMeta,
+ GregtechMTE_ChemicalPlant::getCoilMeta)))
+ .addElement(
+ 'P',
+ withChannel(
+ "pipe",
+ addTieredBlock(
+ GregTech_API.sBlockCasings2,
+ GregtechMTE_ChemicalPlant::setPipeMeta,
+ GregtechMTE_ChemicalPlant::getPipeMeta,
+ 12,
+ 16)))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ private static IStructureElement<GregtechMTE_ChemicalPlant> ofSolidCasing(int aIndex) {
+ return new IStructureElement<GregtechMTE_ChemicalPlant>() {
+ @Override
+ public boolean check(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z) {
+ if (check(aIndex, world, x, y, z)) {
+ t.checkCasing[aIndex]++;
+ t.mCasing++;
+ return true;
+ } else return false;
+ }
+
+ private boolean check(int aIndex, World world, int x, int y, int z) {
+ Block block = world.getBlock(x, y, z);
+ int meta = world.getBlockMetadata(x, y, z);
+ Block target = mTieredBlockRegistry.get(aIndex).getValue_1();
+ int targetMeta = mTieredBlockRegistry.get(aIndex).getValue_2();
+ return target.equals(block) && meta == targetMeta;
+ }
+
+ int getIndex(int size) {
+ if (size > 8) size = 8;
+ return size - 1;
+ }
+
+ @Override
+ public boolean spawnHint(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, ItemStack trigger) {
+ StructureLibAPI.hintParticle(
+ world,
+ x,
+ y,
+ z,
+ mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(),
+ mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2());
+ return true;
+ }
+
+ @Override
+ public boolean placeBlock(
+ GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, ItemStack trigger) {
+ return world.setBlock(
+ x,
+ y,
+ z,
+ mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(),
+ mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2(),
+ 3);
+ }
+
+ @Override
+ public PlaceResult survivalPlaceBlock(
+ GregtechMTE_ChemicalPlant t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ IItemSource s,
+ EntityPlayerMP actor,
+ Consumer<IChatComponent> chatter) {
+ if (check(getIndex(trigger.stackSize), world, x, y, z)) return PlaceResult.SKIP;
+ return StructureUtility.survivalPlaceBlock(
+ mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(),
+ mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2(),
+ world,
+ x,
+ y,
+ z,
+ s,
+ actor,
+ chatter);
+ }
+ };
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(mName, stackSize, hintsOnly, 3, 6, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ return survivialBuildPiece(mName, stackSize, 3, 6, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ for (int i = 0; i < 8; i++) {
+ checkCasing[i] = 0;
+ }
+ checkPipe = 0;
+ checkMachine = 0;
+ mSolidCasingTier = 0;
+ mMachineCasingTier = 0;
+ mPipeCasingTier = 0;
+ mCoilTier = 0;
+ mCatalystBuses.clear();
+ if (checkPiece(mName, 3, 6, 0) && mCasing >= 70) {
+ for (int i = 0; i < 8; i++) {
+ if (checkCasing[i] == mCasing) {
+ mSolidCasingTier = i;
+ } else if (checkCasing[i] > 0) return false;
+ }
+ mMachineCasingTier = checkMachine - 1;
+ mPipeCasingTier = checkPipe - 12;
+ mCoilTier = checkCoil.getTier();
+ getBaseMetaTileEntity().sendBlockEvent(GregTechTileClientEvents.CHANGE_CUSTOM_DATA, getUpdateData());
+ updateHatchTexture();
+ return mMachineCasingTier >= 9 || mMachineCasingTier >= maxTierOfHatch;
+ }
+ return false;
+ }
+
+ public void updateHatchTexture() {
+ for (GT_MetaTileEntity_Hatch h : mCatalystBuses) h.updateTexture(getCasingTextureID());
+ for (GT_MetaTileEntity_Hatch h : mInputBusses) h.updateTexture(getCasingTextureID());
+ for (GT_MetaTileEntity_Hatch h : mMaintenanceHatches) h.updateTexture(getCasingTextureID());
+ for (GT_MetaTileEntity_Hatch h : mEnergyHatches) h.updateTexture(getCasingTextureID());
+ for (GT_MetaTileEntity_Hatch h : mOutputBusses) h.updateTexture(getCasingTextureID());
+ for (GT_MetaTileEntity_Hatch h : mInputHatches) h.updateTexture(getCasingTextureID());
+ for (GT_MetaTileEntity_Hatch h : mOutputHatches) h.updateTexture(getCasingTextureID());
+ }
+
+ public final boolean addChemicalPlantList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Catalysts) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier);
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier);
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier);
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier);
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier);
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(207));
+ }
+
+ @Override
+ protected IIconContainer getActiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active;
+ }
+
+ @Override
+ protected IIconContainer getInactiveOverlay() {
+ return TexturesGtBlock.Overlay_Machine_Controller_Advanced;
+ }
+
+ @Override
+ protected int getCasingTextureId() {
+ return getCasingTextureID();
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ if (GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList.size() == 0) {
+ generateRecipes();
+ }
+ return GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT;
+ }
+
+ public static void generateRecipes() {
+ for (GT_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) {
+ GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.add(i);
+ }
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 2 * getPipeCasingTier();
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 100;
+ }
+
+ private int getSolidCasingTier() {
+ return this.mSolidCasingTier;
+ }
+
+ private int getMachineCasingTier() {
+ return mMachineCasingTier;
+ }
+
+ private int getPipeCasingTier() {
+ return mPipeCasingTier;
+ }
+
+ private int getCasingTextureID() {
+ // Check the Tier Client Side
+ int aTier = mSolidCasingTier;
+ return getCasingTextureIdForTier(aTier);
+ }
+
+ public boolean addToMachineList(IGregTechTileEntity aTileEntity) {
+ int aMaxTier = getMachineCasingTier();
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_TieredMachineBlock) {
+ GT_MetaTileEntity_TieredMachineBlock aMachineBlock = (GT_MetaTileEntity_TieredMachineBlock) aMetaTileEntity;
+ int aTileTier = aMachineBlock.mTier;
+ if (aTileTier > aMaxTier) {
+ log("Hatch tier too high.");
+ return false;
+ } else {
+ return addToMachineList(aTileEntity, getCasingTextureID());
+ }
+ } else {
+ log("Bad Tile Entity being added to hatch map."); // Shouldn't ever happen, but.. ya know..
+ return false;
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mSolidCasingTier", this.mSolidCasingTier);
+ aNBT.setInteger("mMachineCasingTier", this.mMachineCasingTier);
+ aNBT.setInteger("mPipeCasingTier", this.mPipeCasingTier);
+ aNBT.setInteger("mCoilTier", this.mCoilTier);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mSolidCasingTier = aNBT.getInteger("mSolidCasingTier");
+ mMachineCasingTier = aNBT.getInteger("mMachineCasingTier");
+ mPipeCasingTier = aNBT.getInteger("mPipeCasingTier");
+ mCoilTier = aNBT.getInteger("mCoilTier");
+ }
+
+ @Override
+ public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Catalysts) {
+ log("Found GT_MetaTileEntity_Hatch_Catalysts");
+ return addToMachineListInternal(mCatalystBuses, aMetaTileEntity, aBaseCasingIndex);
+ }
+ return super.addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ // Same speed bonus as pyro oven
+ public int getSpeedBonus() {
+ return 50 * (this.mCoilTier - 1);
+ }
+
+ public int getMaxCatalystDurability() {
+ return 50;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
+ this.mCatalystBuses.clear();
+ }
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public byte getUpdateData() {
+ return (byte) mSolidCasingTier;
+ }
+
+ @Override
+ public void receiveClientEvent(byte aEventID, byte aValue) {
+ super.receiveClientEvent(aEventID, aValue);
+ if (aEventID == GregTechTileClientEvents.CHANGE_CUSTOM_DATA && (aValue & 0x80) == 0) {
+ // received an update data from above method
+ // if no &0x80 clause it might catch the noop texture page event
+ mSolidCasingTier = aValue;
+ }
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), getSpeedBonus());
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
+ FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
+ return checkRecipeGeneric(
+ tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll);
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
+ log("Running checkRecipeGeneric(0)");
+
+ // GT_Recipe tRecipe = findRecipe(getBaseMetaTileEntity(), mLastRecipe, false,
+ // gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
+ GT_Recipe tRecipe = findRecipe(
+ mLastRecipe, gregtech.api.enums.GT_Values.V[tTier], getSolidCasingTier(), aItemInputs, aFluidInputs);
+
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
+
+ // checks if it has a catalyst
+ ItemStack tCatalystRecipe = null;
+ boolean aDoesRecipeNeedCatalyst = false;
+ for (ItemStack aInputItem : tRecipe.mInputs) {
+ if (ItemUtils.isCatalyst(aInputItem)) {
+ aDoesRecipeNeedCatalyst = true;
+ break;
+ }
+ }
+ if (aDoesRecipeNeedCatalyst) {
+ tCatalystRecipe = findCatalyst(aItemInputs, tRecipe.mInputs);
+ if (tCatalystRecipe == null) {
+ log("does not have catalyst");
+ return false;
+ }
+ if (mCatalystBuses.size() != 1) {
+ log("does not have correct number of catalyst hatches. (Required 1, found " + mCatalystBuses.size()
+ + ")");
+ return false;
+ }
+ }
+
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe.mSpecialValue > this.mSolidCasingTier) {
+ log("solid tier is too low");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ log("BAD RETURN - 2");
+ return false;
+ }
+
+ // checks if it has enough catalyst durability
+ ArrayList<ItemStack> tCatalysts = null;
+ int tMaxParallelCatalyst = aMaxParallelRecipes;
+ if (tCatalystRecipe != null) {
+ tCatalysts = new ArrayList<ItemStack>();
+ tMaxParallelCatalyst = getCatalysts(aItemInputs, tCatalystRecipe, aMaxParallelRecipes, tCatalysts);
+ log("Can process " + tMaxParallelCatalyst + " recipes. If less than " + aMaxParallelRecipes
+ + ", catalyst does not have enough durability.");
+ }
+
+ if (tMaxParallelCatalyst == 0) {
+ log("found not enough catalysts");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+ log("aEUPercent " + aEUPercent);
+ log("mEUt " + tRecipe.mEUt);
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: " + parallelRecipes);
+ log("aMaxParallelRecipes: " + tMaxParallelCatalyst);
+ log("tTotalEUt: " + tTotalEUt);
+ log("tVoltage: " + tVoltage);
+ log("tEnergy: " + tEnergy);
+ log("tRecipeEUt: " + tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < tMaxParallelCatalyst && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ log("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Damage catalyst once all is said and done.
+ if (tCatalystRecipe != null) {
+ log("damaging catalyst");
+ damageCatalyst(tCatalystRecipe, parallelRecipes);
+ }
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+ for (GT_MetaTileEntity_Hatch_Catalysts h : mCatalystBuses) {
+ h.updateSlots();
+ h.tryFillUsageSlots();
+ }
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ log("GOOD RETURN - 1");
+ return true;
+ }
+
+ private static final HashMap<Long, AutoMap<GT_Recipe>> mTieredRecipeMap = new HashMap<Long, AutoMap<GT_Recipe>>();
+ private static final AutoMap<GT_Recipe> aTier0Recipes = new AutoMap<GT_Recipe>();
+ private static final AutoMap<GT_Recipe> aTier1Recipes = new AutoMap<GT_Recipe>();
+ private static final AutoMap<GT_Recipe> aTier2Recipes = new AutoMap<GT_Recipe>();
+ private static final AutoMap<GT_Recipe> aTier3Recipes = new AutoMap<GT_Recipe>();
+ private static final AutoMap<GT_Recipe> aTier4Recipes = new AutoMap<GT_Recipe>();
+ private static final AutoMap<GT_Recipe> aTier5Recipes = new AutoMap<GT_Recipe>();
+ private static final AutoMap<GT_Recipe> aTier6Recipes = new AutoMap<GT_Recipe>();
+ private static final AutoMap<GT_Recipe> aTier7Recipes = new AutoMap<GT_Recipe>();
+ private static boolean mInitRecipeCache = false;
+
+ private static void initRecipeCaches() {
+ if (!mInitRecipeCache) {
+ mTieredRecipeMap.put((long) 0, aTier0Recipes);
+ mTieredRecipeMap.put((long) 1, aTier1Recipes);
+ mTieredRecipeMap.put((long) 2, aTier2Recipes);
+ mTieredRecipeMap.put((long) 3, aTier3Recipes);
+ mTieredRecipeMap.put((long) 4, aTier4Recipes);
+ mTieredRecipeMap.put((long) 5, aTier5Recipes);
+ mTieredRecipeMap.put((long) 6, aTier6Recipes);
+ mTieredRecipeMap.put((long) 7, aTier7Recipes);
+ for (GT_Recipe aRecipe : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList) {
+ if (aRecipe != null) {
+ switch (aRecipe.mSpecialValue) {
+ case 0:
+ aTier0Recipes.add(aRecipe);
+ continue;
+ case 1:
+ aTier1Recipes.add(aRecipe);
+ continue;
+ case 2:
+ aTier2Recipes.add(aRecipe);
+ continue;
+ case 3:
+ aTier3Recipes.add(aRecipe);
+ continue;
+ case 4:
+ aTier4Recipes.add(aRecipe);
+ continue;
+ case 5:
+ aTier5Recipes.add(aRecipe);
+ continue;
+ case 6:
+ aTier6Recipes.add(aRecipe);
+ continue;
+ case 7:
+ aTier7Recipes.add(aRecipe);
+ continue;
+ }
+ }
+ }
+ mInitRecipeCache = true;
+ }
+ }
+
+ public GT_Recipe findRecipe(
+ final GT_Recipe aRecipe,
+ final long aVoltage,
+ final long aSpecialValue,
+ ItemStack[] aInputs,
+ final FluidStack[] aFluids) {
+ if (!mInitRecipeCache) {
+ initRecipeCaches();
+ }
+ if (this.getRecipeMap().mRecipeList.isEmpty()) {
+ log("No Recipes in Map to search through.");
+ return null;
+ } else {
+ log("Checking tier " + aSpecialValue + " recipes and below. Using Input Voltage of " + aVoltage + "V.");
+ log("We have " + aInputs.length + " Items and " + aFluids.length + " Fluids.");
+ // Try check the cached recipe first
+ if (aRecipe != null) {
+ if (aRecipe.isRecipeInputEqual(false, aFluids, aInputs)) {
+ if (aRecipe.mEUt <= aVoltage) {
+ Logger.INFO("Using cached recipe.");
+ return aRecipe;
+ }
+ }
+ }
+
+ // Get all recipes for the tier
+ AutoMap<AutoMap<GT_Recipe>> aMasterMap = new AutoMap<AutoMap<GT_Recipe>>();
+ for (long i = 0; i <= aSpecialValue; i++) {
+ aMasterMap.add(mTieredRecipeMap.get(i));
+ }
+ GT_Recipe aFoundRecipe = null;
+
+ // Iterate the tiers recipes until we find the one with all inputs matching
+ master:
+ for (AutoMap<GT_Recipe> aTieredMap : aMasterMap) {
+ for (GT_Recipe aRecipeToCheck : aTieredMap) {
+ if (aRecipeToCheck.isRecipeInputEqual(false, aFluids, aInputs)) {
+ log("Found recipe with matching inputs!");
+ if (aRecipeToCheck.mSpecialValue <= aSpecialValue) {
+ if (aRecipeToCheck.mEUt <= aVoltage) {
+ aFoundRecipe = aRecipeToCheck;
+ break master;
+ }
+ }
+ }
+ }
+ }
+
+ // If we found a recipe, return it
+ if (aFoundRecipe != null) {
+ log("Found valid recipe.");
+ return aFoundRecipe;
+ }
+ }
+ log("Did not find valid recipe.");
+ return null;
+ }
+
+ private int getCatalysts(
+ ItemStack[] aItemInputs, ItemStack aRecipeCatalyst, int aMaxParrallel, ArrayList<ItemStack> aOutPut) {
+ int allowedParallel = 0;
+ for (final ItemStack aInput : aItemInputs) {
+ if (aRecipeCatalyst.isItemEqual(aInput)) {
+ int aDurabilityRemaining = getMaxCatalystDurability() - getDamage(aInput);
+ return Math.min(aMaxParrallel, aDurabilityRemaining);
+ }
+ }
+ return allowedParallel;
+ }
+
+ private ItemStack findCatalyst(ItemStack[] aItemInputs, ItemStack[] aRecipeInputs) {
+ if (aItemInputs != null) {
+ for (final ItemStack aInput : aItemInputs) {
+ if (aInput != null) {
+ if (ItemUtils.isCatalyst(aInput)) {
+ for (ItemStack aRecipeInput : aRecipeInputs) {
+ if (GT_Utility.areStacksEqual(aRecipeInput, aInput, true)) {
+ return aInput;
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private void damageCatalyst(ItemStack aStack, int parallelRecipes) {
+ for (int i = 0; i < parallelRecipes; i++) {
+ // Awakened Draconium Coils with Tungstensteel Pipe Casings (or above) no longer consume catalysts.
+ if (this.mCoilTier >= 10 && this.mPipeCasingTier >= 4) {
+ log("not consuming catalyst");
+ } else if (MathUtils.randFloat(0, 10000000) / 10000000f < (1.2f - (0.2 * this.mPipeCasingTier))) {
+ int damage = getDamage(aStack) + 1;
+ log("damage catalyst " + damage);
+ if (damage >= getMaxCatalystDurability()) {
+ log("consume catalyst");
+ addOutput(CI.getEmptyCatalyst(1));
+ aStack.stackSize -= 1;
+ } else {
+ log("damaging catalyst");
+ setDamage(aStack, damage);
+ }
+ } else {
+ log("not consuming catalyst");
+ }
+ }
+ }
+
+ private int getDamage(ItemStack aStack) {
+ return ItemGenericChemBase.getCatalystDamage(aStack);
+ }
+
+ private void setDamage(ItemStack aStack, int aAmount) {
+ ItemGenericChemBase.setCatalystDamage(aStack, aAmount);
+ }
+
+ /*
+ * Catalyst Handling
+ */
+ @Override
+ public ArrayList<ItemStack> getStoredInputs() {
+ ArrayList<ItemStack> tItems = super.getStoredInputs();
+ if (this.hasSlotInGUI() && this.getGUIItemStack() != null) {
+ tItems.add(this.getGUIItemStack());
+ }
+ for (GT_MetaTileEntity_Hatch_Catalysts tHatch : mCatalystBuses) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ AutoMap<ItemStack> aHatchContent = tHatch.getContentUsageSlots();
+ if (!aHatchContent.isEmpty()) {
+ tItems.addAll(aHatchContent);
+ }
+ }
+ }
+ return tItems;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java
index c6342827da..68cfc44527 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java
@@ -2,8 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.t
import static gtPlusPlus.core.lib.CORE.RANDOM;
-import java.util.ArrayList;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,6 +9,7 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
+import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
@@ -22,7 +21,6 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin
super(aID, aName, aNameRegional);
}
-
public GT_MTE_LargeTurbine_Gas(String aName) {
super(aName);
}
@@ -42,24 +40,23 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin
return 58;
}
-
- @Override
- protected boolean requiresOutputHatch() {
- return false;
- }
+ @Override
+ protected boolean requiresOutputHatch() {
+ return false;
+ }
@Override
public int getPollutionPerSecond(ItemStack aStack) {
return 4000;
}
-
+
public int getFuelValue(FluidStack aLiquid) {
if (aLiquid == null) {
- return 0;
+ return 0;
}
GT_Recipe tFuel = GT_Recipe_Map.sTurbineFuels.findFuel(aLiquid);
if (tFuel != null) {
- return tFuel.mSpecialValue;
+ return tFuel.mSpecialValue;
}
return 0;
}
@@ -70,9 +67,11 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin
int tEU = 0;
int actualOptimalFlow = 0;
- FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
+ FluidStack firstFuelType = new FluidStack(
+ aFluids.get(0),
+ 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
int fuelValue = getFuelValue(firstFuelType);
- //log("Fuel Value of "+aFluids.get(0).getLocalizedName()+" is "+fuelValue+"eu");
+ // log("Fuel Value of "+aFluids.get(0).getLocalizedName()+" is "+fuelValue+"eu");
if (aOptFlow < fuelValue) {
// turbine too weak and/or fuel too powerful
// at least consume 1L
@@ -86,14 +85,18 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin
actualOptimalFlow = GT_Utility.safeInt((long) aOptFlow / fuelValue);
this.realOptFlow = actualOptimalFlow;
- int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios.
+ int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow
+ * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for
+ // multi-hatch scenarios.
int flow = 0;
int totalFlow = 0;
storedFluid = 0;
for (FluidStack aFluid : aFluids) {
if (aFluid.isFluidEqual(firstFuelType)) {
- flow = Math.min(aFluid.amount, remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow
+ flow = Math.min(
+ aFluid.amount,
+ remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow
depleteInput(new FluidStack(aFluid, flow)); // deplete that amount
this.storedFluid += aFluid.amount;
remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches
@@ -103,11 +106,11 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin
if (totalFlow <= 0) return 0;
tEU = GT_Utility.safeInt((long) totalFlow * fuelValue);
- //log("Total Flow: "+totalFlow);
- //log("Real Optimal Flow: "+actualOptimalFlow);
- //log("Flow: "+flow);
- //log("Remaining Flow: "+remainingFlow);
-
+ // log("Total Flow: "+totalFlow);
+ // log("Real Optimal Flow: "+actualOptimalFlow);
+ // log("Flow: "+flow);
+ // log("Remaining Flow: "+remainingFlow);
+
if (totalFlow == actualOptimalFlow) {
tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L);
} else {
@@ -117,7 +120,6 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin
}
return tEU;
-
}
return 0;
}
@@ -126,7 +128,7 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin
public int getDamageToComponent(ItemStack aStack) {
return (RANDOM.nextInt(4) == 0) ? 0 : 1;
}
-
+
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
@@ -137,34 +139,33 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin
super.loadNBTData(aNBT);
}
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Large Gas Turbine";
- }
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
- @Override
- protected String getTurbineType() {
- return "Gas";
- }
+ @Override
+ public String getMachineType() {
+ return "Large Gas Turbine";
+ }
- @Override
- protected String getCasingName() {
- return "Reinforced Gas Turbine Casing";
- }
+ @Override
+ protected String getTurbineType() {
+ return "Gas";
+ }
- @Override
- protected ITexture getTextureFrontFace() {
- return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS5);
- }
+ @Override
+ protected String getCasingName() {
+ return "Reinforced Gas Turbine Casing";
+ }
- @Override
- protected ITexture getTextureFrontFaceActive() {
- return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5);
- }
+ @Override
+ protected ITexture getTextureFrontFace() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS5);
+ }
+ @Override
+ protected ITexture getTextureFrontFaceActive() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
index 3427b40819..517c32441a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines;
-import java.util.ArrayList;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -9,9 +7,10 @@ import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine;
-import gregtech.api.util.GT_Utility;
+import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
@@ -23,7 +22,6 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
super(aID, aName, aNameRegional);
}
-
public GT_MTE_LargeTurbine_Plasma(String aName) {
super(aName);
}
@@ -43,139 +41,156 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
return 60;
}
- @Override
- protected boolean requiresOutputHatch() {
- return true;
- }
+ @Override
+ protected boolean requiresOutputHatch() {
+ return true;
+ }
@Override
public int getPollutionPerSecond(ItemStack aStack) {
return 0;
}
-
+
public int getFuelValue(FluidStack aLiquid) {
if (aLiquid == null) {
- return 0;
+ return 0;
}
GT_Recipe tFuel = GT_Recipe_Map.sPlasmaFuels.findFuel(aLiquid);
if (tFuel != null) {
- return tFuel.mSpecialValue;
+ return tFuel.mSpecialValue;
}
return 0;
}
- @Override
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
-
- try {
- ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies();
- if (aEmptyTurbineRotorHatches.size() > 0) {
- log("Found "+aEmptyTurbineRotorHatches.size()+" Assemblies without Turbine.");
- hatch : for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) {
- ArrayList<ItemStack> aTurbines = getAllBufferedTurbines();
- for (ItemStack aTurbineItem : aTurbines) {
- if (aTurbineItem == null) {
- continue;
- }
- if (aHatch.insertTurbine(aTurbineItem.copy())) {
- boolean aDidDeplete = depleteTurbineFromStock(aTurbineItem);
- log("Put Turbine into Assembly - "+aDidDeplete);
- continue hatch;
- }
- }
- }
- }
-
- if (getEmptyTurbineAssemblies().size() > 0 || !areAllTurbinesTheSame()) {
- log("BAD RETURN - 1");
- stopMachine();
- return false;
- }
-
- ArrayList<FluidStack> tFluids = getStoredFluids();
-
- if (tFluids.size() > 0) {
- if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()
- || this.getBaseMetaTileEntity().hasInventoryBeenModified()) {
- counter = 0;
- float aTotalBaseEff = 0;
- float aTotalOptimalFlow = 0;
- ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine();
- for (int i = 0; i< getSpeedMultiplier(); i++) {
- if (i == 0) {
- aTotalBaseEff += GT_Utility.safeInt((long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F));
- }
- aTotalOptimalFlow += GT_Utility.safeInt((long) Math.max(Float.MIN_NORMAL,
- ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed
- * 50));
- }
-
- baseEff = MathUtils.roundToClosestInt(aTotalBaseEff);
- optFlow = MathUtils.roundToClosestInt(aTotalOptimalFlow);
- if(optFlow<=0 || baseEff<=0){
- log("Running checkRecipeGeneric(bad-1)");
- stopMachine();//in case the turbine got removed
- return false;
- }
- } else {
- counter++;
- }
- }
-
- // How much the turbine should be producing with this flow
- int newPower = fluidIntoPower(tFluids, optFlow, baseEff);
- int difference = newPower - this.mEUt; // difference between current output and new output
-
- // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick)
- // This is how much the turbine can actually change during this tick
- int maxChangeAllowed = Math.max(200, GT_Utility.safeInt((long) Math.abs(difference) / 5));
-
- if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change
- int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative.
- this.mEUt += change; // Apply the change
- }
- else {
- this.mEUt = newPower;
- }
- if (this.mEUt <= 0) {
- this.mEUt=0;
- this.mEfficiency=0;
- log("Running checkRecipeGeneric(bad-2)");
- return false;
- } else {
- this.mMaxProgresstime = 20;
- this.mEfficiencyIncrease = 200;
- // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here.
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
- //log("GOOD RETURN - Making: "+this.mEUt+" EU/t");
- return true;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- return false;
- }
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+
+ try {
+ ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies();
+ if (aEmptyTurbineRotorHatches.size() > 0) {
+ log("Found " + aEmptyTurbineRotorHatches.size() + " Assemblies without Turbine.");
+ hatch:
+ for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) {
+ ArrayList<ItemStack> aTurbines = getAllBufferedTurbines();
+ for (ItemStack aTurbineItem : aTurbines) {
+ if (aTurbineItem == null) {
+ continue;
+ }
+ if (aHatch.insertTurbine(aTurbineItem.copy())) {
+ boolean aDidDeplete = depleteTurbineFromStock(aTurbineItem);
+ log("Put Turbine into Assembly - " + aDidDeplete);
+ continue hatch;
+ }
+ }
+ }
+ }
+
+ if (getEmptyTurbineAssemblies().size() > 0 || !areAllTurbinesTheSame()) {
+ log("BAD RETURN - 1");
+ stopMachine();
+ return false;
+ }
+
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+
+ if (tFluids.size() > 0) {
+ if (baseEff == 0
+ || optFlow == 0
+ || counter >= 512
+ || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()
+ || this.getBaseMetaTileEntity().hasInventoryBeenModified()) {
+ counter = 0;
+ float aTotalBaseEff = 0;
+ float aTotalOptimalFlow = 0;
+ ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine();
+ for (int i = 0; i < getSpeedMultiplier(); i++) {
+ if (i == 0) {
+ aTotalBaseEff += GT_Utility.safeInt((long)
+ ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack))
+ * 1000F));
+ }
+ aTotalOptimalFlow += GT_Utility.safeInt((long) Math.max(
+ Float.MIN_NORMAL,
+ ((GT_MetaGenerated_Tool) aStack.getItem())
+ .getToolStats(aStack)
+ .getSpeedMultiplier()
+ * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed
+ * 50));
+ }
+
+ baseEff = MathUtils.roundToClosestInt(aTotalBaseEff);
+ optFlow = MathUtils.roundToClosestInt(aTotalOptimalFlow);
+ if (optFlow <= 0 || baseEff <= 0) {
+ log("Running checkRecipeGeneric(bad-1)");
+ stopMachine(); // in case the turbine got removed
+ return false;
+ }
+ } else {
+ counter++;
+ }
+ }
+
+ // How much the turbine should be producing with this flow
+ int newPower = fluidIntoPower(tFluids, optFlow, baseEff);
+ int difference = newPower - this.mEUt; // difference between current output and new output
+
+ // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the
+ // difference in power level (per tick)
+ // This is how much the turbine can actually change during this tick
+ int maxChangeAllowed = Math.max(200, GT_Utility.safeInt((long) Math.abs(difference) / 5));
+
+ if (Math.abs(difference)
+ > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change
+ int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative.
+ this.mEUt += change; // Apply the change
+ } else {
+ this.mEUt = newPower;
+ }
+ if (this.mEUt <= 0) {
+ this.mEUt = 0;
+ this.mEfficiency = 0;
+ log("Running checkRecipeGeneric(bad-2)");
+ return false;
+ } else {
+ this.mMaxProgresstime = 20;
+ this.mEfficiencyIncrease = 200;
+ // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here.
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+ // log("GOOD RETURN - Making: "+this.mEUt+" EU/t");
+ return true;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ return false;
+ }
@Override
int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
if (aFluids.size() >= 1) {
- aOptFlow *= 800;//CHANGED THINGS HERE, check recipe runs once per 20 ticks
+ aOptFlow *= 800; // CHANGED THINGS HERE, check recipe runs once per 20 ticks
int tEU = 0;
int actualOptimalFlow = 0;
- FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
+ FluidStack firstFuelType = new FluidStack(
+ aFluids.get(0),
+ 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
int fuelValue = getFuelValue(firstFuelType);
actualOptimalFlow = GT_Utility.safeInt((long) Math.ceil((double) aOptFlow / (double) fuelValue));
this.realOptFlow = actualOptimalFlow; // For scanner info
- int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios.
+ int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow
+ * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for
+ // multi-hatch scenarios.
int flow = 0;
int totalFlow = 0;
@@ -204,7 +219,7 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
if (totalFlow <= 0) return 0;
tEU = GT_Utility.safeInt((long) ((fuelValue / 20D) * (double) totalFlow));
- //GT_FML_LOGGER.info(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU);
+ // GT_FML_LOGGER.info(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU);
if (totalFlow == actualOptimalFlow) {
tEU = GT_Utility.safeInt((long) (aBaseEff / 10000D * tEU));
@@ -216,7 +231,6 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
}
return tEU;
-
}
return 0;
}
@@ -226,35 +240,33 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
return 1;
}
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Large Plasma Turbine";
- }
-
-
- @Override
- protected String getTurbineType() {
- return "Plasma";
- }
-
- @Override
- protected String getCasingName() {
- return "Reinforced Plasma Turbine Casing";
- }
-
- @Override
- protected ITexture getTextureFrontFace() {
- return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU5);
- }
-
- @Override
- protected ITexture getTextureFrontFaceActive() {
- return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5);
- }
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+ @Override
+ public String getMachineType() {
+ return "Large Plasma Turbine";
+ }
+
+ @Override
+ protected String getTurbineType() {
+ return "Plasma";
+ }
+
+ @Override
+ protected String getCasingName() {
+ return "Reinforced Plasma Turbine Casing";
+ }
+
+ @Override
+ protected ITexture getTextureFrontFace() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU5);
+ }
+
+ @Override
+ protected ITexture getTextureFrontFaceActive() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java
index 2f72b8b54c..248359a80b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines;
-import java.util.ArrayList;
-
import gregtech.GT_Mod;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -12,6 +10,7 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -21,7 +20,7 @@ import net.minecraftforge.fluids.FluidStack;
public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTurbineBase {
public boolean achievement = false;
- private boolean looseFit=false;
+ private boolean looseFit = false;
public GT_MTE_LargeTurbine_SHSteam(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -46,42 +45,44 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu
return 59;
}
- @Override
- protected boolean requiresOutputHatch() {
- return true;
- }
+ @Override
+ protected boolean requiresOutputHatch() {
+ return true;
+ }
@Override
public int getPollutionPerSecond(ItemStack aStack) {
return 0;
}
- @Override
- public int getFuelValue(FluidStack aLiquid) {
- return 0;
- }
+ @Override
+ public int getFuelValue(FluidStack aLiquid) {
+ return 0;
+ }
@Override
int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
- if(looseFit) {
- aOptFlow*=4;
- if(aBaseEff>10000){
- aOptFlow*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f);
- aBaseEff=7500;
- }else if(aBaseEff>7500){
- aOptFlow*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f);
- aBaseEff*=0.75f;
- }else{
- aBaseEff*=0.75f;
+ if (looseFit) {
+ aOptFlow *= 4;
+ if (aBaseEff > 10000) {
+ aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f);
+ aBaseEff = 7500;
+ } else if (aBaseEff > 7500) {
+ aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f);
+ aBaseEff *= 0.75f;
+ } else {
+ aBaseEff *= 0.75f;
}
}
int tEU = 0;
int totalFlow = 0; // Byproducts are based on actual flow
int flow = 0;
- int remainingFlow = MathUtils.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios.
+ int remainingFlow = MathUtils.safeInt((long) (aOptFlow
+ * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for
+ // multi-hatch scenarios.
this.realOptFlow = aOptFlow;
- storedFluid=0;
+ storedFluid = 0;
for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) {
String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i));
if (fluidName.equals("ic2.fluidSuperheatedSteam")) {
@@ -92,25 +93,32 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu
totalFlow += flow; // track total input used
if (!achievement) {
try {
- GT_Mod.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam");
+ GT_Mod.achievements.issueAchievement(
+ this.getBaseMetaTileEntity()
+ .getWorld()
+ .getPlayerEntityByName(
+ this.getBaseMetaTileEntity().getOwnerName()),
+ "efficientsteam");
} catch (Exception e) {
}
achievement = true;
}
- }else if(fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")){
+ } else if (fluidName.equals("fluid.steam")
+ || fluidName.equals("ic2.fluidSteam")
+ || fluidName.equals("fluid.mfr.steam.still.name")) {
depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount));
}
}
- if(totalFlow<=0)return 0;
+ if (totalFlow <= 0) return 0;
tEU = totalFlow;
addOutput(GT_ModHandler.getSteam(totalFlow));
if (totalFlow != aOptFlow) {
- float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float)aOptFlow);
- //if(totalFlow>aOptFlow){efficiency = 1.0f;}
+ float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float) aOptFlow);
+ // if(totalFlow>aOptFlow){efficiency = 1.0f;}
tEU *= efficiency;
- tEU = Math.max(1, MathUtils.safeInt((long)tEU * (long)aBaseEff / 10000L));
+ tEU = Math.max(1, MathUtils.safeInt((long) tEU * (long) aBaseEff / 10000L));
} else {
- tEU = MathUtils.safeInt((long)tEU * (long)aBaseEff / 10000L);
+ tEU = MathUtils.safeInt((long) tEU * (long) aBaseEff / 10000L);
}
return tEU;
@@ -118,75 +126,73 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu
@Override
public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- //Using a screwdriver to change modes should allow for any combination of Slow/Fast and Tight/Loose Mode
- //Whenever there's a mode switch, there will be two messages on the player chat
- //The two messages specify which two modes the turbine is on after the change
- //(Tight/Loose changes on every action, Slow/Fast changes every other action, all pairs are cycled this way)
+ // Using a screwdriver to change modes should allow for any combination of Slow/Fast and Tight/Loose Mode
+ // Whenever there's a mode switch, there will be two messages on the player chat
+ // The two messages specify which two modes the turbine is on after the change
+ // (Tight/Loose changes on every action, Slow/Fast changes every other action, all pairs are cycled this way)
if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
- looseFit^=true;
- GT_Utility.sendChatToPlayer(aPlayer, looseFit ? "Fitting is Loose (Higher Flow)" : "Fitting is Tight (Higher Efficiency)");
+ looseFit ^= true;
+ GT_Utility.sendChatToPlayer(
+ aPlayer, looseFit ? "Fitting is Loose (Higher Flow)" : "Fitting is Tight (Higher Efficiency)");
}
if (looseFit) {
super.onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ);
- }
- else if (mFastMode) {
+ } else if (mFastMode) {
PlayerUtils.messagePlayer(aPlayer, "Running in Fast (48x) Mode.");
- }
- else {
+ } else {
PlayerUtils.messagePlayer(aPlayer, "Running in Slow (16x) Mode.");
}
}
@Override
public int getDamageToComponent(ItemStack aStack) {
- return (looseFit && CORE.RANDOM.nextInt(4)==0)?0:1;
+ return (looseFit && CORE.RANDOM.nextInt(4) == 0) ? 0 : 1;
}
-
+
public boolean isLooseMode() {
- return looseFit;
- }
-
+ return looseFit;
+ }
+
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setBoolean("turbineFitting",looseFit);
+ aNBT.setBoolean("turbineFitting", looseFit);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- looseFit=aNBT.getBoolean("turbineFitting");
+ looseFit = aNBT.getBoolean("turbineFitting");
}
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Large Super-heated Steam Turbine";
- }
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
- @Override
- protected String getTurbineType() {
- return "Super-heated Steam";
- }
+ @Override
+ public String getMachineType() {
+ return "Large Super-heated Steam Turbine";
+ }
- @Override
- protected String getCasingName() {
- return "Reinforced HP Steam Turbine Casing";
- }
+ @Override
+ protected String getTurbineType() {
+ return "Super-heated Steam";
+ }
- @Override
- protected ITexture getTextureFrontFace() {
- return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5);
- }
+ @Override
+ protected String getCasingName() {
+ return "Reinforced HP Steam Turbine Casing";
+ }
- @Override
- protected ITexture getTextureFrontFaceActive() {
- return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5);
- }
+ @Override
+ protected ITexture getTextureFrontFace() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5);
+ }
+ @Override
+ protected ITexture getTextureFrontFaceActive() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java
index 9d5139f0a3..e15f0f3181 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java
@@ -2,8 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.t
import static gtPlusPlus.core.lib.CORE.RANDOM;
-import java.util.ArrayList;
-
import gregtech.GT_Mod;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -13,6 +11,7 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -23,13 +22,12 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb
private float water;
private boolean achievement = false;
- private boolean looseFit=false;
+ private boolean looseFit = false;
public GT_MTE_LargeTurbine_Steam(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
-
public GT_MTE_LargeTurbine_Steam(String aName) {
super(aName);
}
@@ -49,10 +47,10 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb
return 16;
}
- @Override
- protected boolean requiresOutputHatch() {
- return true;
- }
+ @Override
+ protected boolean requiresOutputHatch() {
+ return true;
+ }
@Override
public int getPollutionPerSecond(ItemStack aStack) {
@@ -65,59 +63,70 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb
water = water - usage;
return usage;
}
-
+
public int getFuelValue(FluidStack aLiquid) {
return 0;
}
@Override
int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
- if(looseFit) {
- aOptFlow*=4;
- if(aBaseEff>10000){
- aOptFlow*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f);
- aBaseEff=7500;
- }else if(aBaseEff>7500){
- aOptFlow*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f);
- aBaseEff*=0.75f;
- }else{
- aBaseEff*=0.75f;
+ if (looseFit) {
+ aOptFlow *= 4;
+ if (aBaseEff > 10000) {
+ aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f);
+ aBaseEff = 7500;
+ } else if (aBaseEff > 7500) {
+ aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f);
+ aBaseEff *= 0.75f;
+ } else {
+ aBaseEff *= 0.75f;
}
}
int tEU = 0;
int totalFlow = 0; // Byproducts are based on actual flow
int flow = 0;
- int remainingFlow = MathUtils.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios.
+ int remainingFlow = MathUtils.safeInt((long) (aOptFlow
+ * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for
+ // multi-hatch scenarios.
this.realOptFlow = aOptFlow;
- storedFluid=0;
- for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and track totals.
+ storedFluid = 0;
+ for (int i = 0;
+ i < aFluids.size() && remainingFlow > 0;
+ i++) { // loop through each hatch; extract inputs and track totals.
String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i));
- if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")) {
+ if (fluidName.equals("fluid.steam")
+ || fluidName.equals("ic2.fluidSteam")
+ || fluidName.equals("fluid.mfr.steam.still.name")) {
flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow
depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount
this.storedFluid += aFluids.get(i).amount;
remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches
totalFlow += flow; // track total input used
if (!achievement) {
- GT_Mod.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam");
+ GT_Mod.achievements.issueAchievement(
+ this.getBaseMetaTileEntity()
+ .getWorld()
+ .getPlayerEntityByName(
+ this.getBaseMetaTileEntity().getOwnerName()),
+ "muchsteam");
achievement = true;
}
- }else if(fluidName.equals("ic2.fluidSuperheatedSteam")){
+ } else if (fluidName.equals("ic2.fluidSuperheatedSteam")) {
depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount));
}
}
- if(totalFlow<=0)return 0;
+ if (totalFlow <= 0) return 0;
tEU = totalFlow;
int waterToOutput = useWater(totalFlow / 160.0f);
addOutput(GT_ModHandler.getDistilledWater(waterToOutput));
if (totalFlow != aOptFlow) {
- float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float)aOptFlow);
- //if(totalFlow>aOptFlow){efficiency = 1.0f;}
+ float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float) aOptFlow);
+ // if(totalFlow>aOptFlow){efficiency = 1.0f;}
tEU *= efficiency;
- tEU = Math.max(1, MathUtils.safeInt((long)tEU * (long)aBaseEff / 20000L));
+ tEU = Math.max(1, MathUtils.safeInt((long) tEU * (long) aBaseEff / 20000L));
} else {
- tEU = MathUtils.safeInt((long)tEU * (long)aBaseEff / 20000L);
+ tEU = MathUtils.safeInt((long) tEU * (long) aBaseEff / 20000L);
}
return tEU;
@@ -125,75 +134,73 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb
@Override
public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- //Using a screwdriver to change modes should allow for any combination of Slow/Fast and Tight/Loose Mode
- //Whenever there's a mode switch, there will be two messages on the player chat
- //The two messages specify which two modes the turbine is on after the change
- //(Tight/Loose changes on every action, Slow/Fast changes every other action, all pairs are cycled this way)
+ // Using a screwdriver to change modes should allow for any combination of Slow/Fast and Tight/Loose Mode
+ // Whenever there's a mode switch, there will be two messages on the player chat
+ // The two messages specify which two modes the turbine is on after the change
+ // (Tight/Loose changes on every action, Slow/Fast changes every other action, all pairs are cycled this way)
if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
- looseFit^=true;
- GT_Utility.sendChatToPlayer(aPlayer, looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency");
+ looseFit ^= true;
+ GT_Utility.sendChatToPlayer(
+ aPlayer, looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency");
}
if (looseFit) {
super.onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ);
- }
- else if (mFastMode) {
+ } else if (mFastMode) {
PlayerUtils.messagePlayer(aPlayer, "Running in Fast (48x) Mode.");
- }
- else {
+ } else {
PlayerUtils.messagePlayer(aPlayer, "Running in Slow (16x) Mode.");
}
}
@Override
public int getDamageToComponent(ItemStack aStack) {
- return (looseFit && RANDOM.nextInt(4)==0)?0:1;
+ return (looseFit && RANDOM.nextInt(4) == 0) ? 0 : 1;
}
-
+
public boolean isLooseMode() {
- return looseFit;
- }
-
+ return looseFit;
+ }
+
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setBoolean("turbineFitting",looseFit);
+ aNBT.setBoolean("turbineFitting", looseFit);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- looseFit=aNBT.getBoolean("turbineFitting");
+ looseFit = aNBT.getBoolean("turbineFitting");
}
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public String getMachineType() {
- return "Large Steam Turbine";
- }
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
- @Override
- protected String getTurbineType() {
- return "Steam";
- }
+ @Override
+ public String getMachineType() {
+ return "Large Steam Turbine";
+ }
- @Override
- protected String getCasingName() {
- return "Reinforced Steam Turbine Casing";
- }
+ @Override
+ protected String getTurbineType() {
+ return "Steam";
+ }
- @Override
- protected ITexture getTextureFrontFace() {
- return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5);
- }
+ @Override
+ protected String getCasingName() {
+ return "Reinforced Steam Turbine Casing";
+ }
- @Override
- protected ITexture getTextureFrontFaceActive() {
- return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5);
- }
+ @Override
+ protected ITexture getTextureFrontFace() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5);
+ }
+ @Override
+ protected ITexture getTextureFrontFaceActive() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java
index 70b72bb60d..009b5c8f43 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java
@@ -1,6 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines;
-import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static gregtech.api.enums.GT_HatchElement.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -31,6 +35,7 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -41,764 +46,806 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.fluids.FluidStack;
+public abstract class GregtechMetaTileEntity_LargerTurbineBase
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargerTurbineBase>
+ implements ISurvivalConstructable {
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static gregtech.api.enums.GT_HatchElement.*;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
+ protected int baseEff = 0;
+ protected int optFlow = 0;
+ protected double realOptFlow = 0;
+ protected int storedFluid = 0;
+ protected int counter = 0;
+ protected boolean mFastMode = false;
+ protected double mufflerReduction = 1;
+
+ public ITexture frontFace;
+ public ITexture frontFaceActive;
+
+ public ArrayList<GT_MetaTileEntity_Hatch_Turbine> mTurbineRotorHatches =
+ new ArrayList<GT_MetaTileEntity_Hatch_Turbine>();
+
+ public GregtechMetaTileEntity_LargerTurbineBase(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ frontFace = getTextureFrontFace();
+ frontFaceActive = getTextureFrontFaceActive();
+ }
+
+ public GregtechMetaTileEntity_LargerTurbineBase(String aName) {
+ super(aName);
+ frontFace = getTextureFrontFace();
+ frontFaceActive = getTextureFrontFaceActive();
+ }
+
+ protected abstract ITexture getTextureFrontFace();
+
+ protected abstract ITexture getTextureFrontFaceActive();
+
+ protected abstract String getTurbineType();
+
+ protected abstract String getCasingName();
+
+ protected abstract boolean requiresOutputHatch();
+
+ @Override
+ protected final GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the XL " + getTurbineType() + " Turbine")
+ .addInfo("Runs as fast as 16 Large Turbines of the same type, takes the space of 12")
+ .addInfo("Right-click with screwdriver to enable Fast Mode, to run it even faster")
+ .addInfo("Optimal flow will increase or decrease accordingly on mode switch")
+ .addInfo("Fast Mode increases speed to 48x instead of 16x, with some penalties")
+ .addInfo("Maintenance problems and turbine damage happen 12x as often in Fast Mode")
+ .addInfo("XL Steam Turbines can use Loose Mode with either Slow or Fast Mode")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addInfo("Pollution is 3x higher in Fast Mode")
+ .addSeparator()
+ .beginStructureBlock(7, 9, 7, false)
+ .addController("Top Middle")
+ .addCasingInfo(getCasingName(), 360)
+ .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1)
+ .addInputBus("Any 4 dot hint (min 1)", 4)
+ .addInputHatch("Any 4 dot hint(min 1)", 4);
+ if (requiresOutputHatch()) {
+ tt.addOutputHatch("Any 4 dot hint(min 1)", 4);
+ }
+ tt.addDynamoHatch("Any 4 dot hint(min 1)", 4).addMaintenanceHatch("Any 4 dot hint(min 1)", 4);
+ if (requiresMufflers()) {
+ tt.addMufflerHatch("Any 7 dot hint (x4)", 7);
+ }
+ tt.toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ private static final String STRUCTURE_PIECE_MAIN = "main";
+ private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>>
+ STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>>() {
+ @Override
+ protected IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> computeValue(Class<?> type) {
+ return StructureDefinition.<GregtechMetaTileEntity_LargerTurbineBase>builder()
+ // c = turbine casing
+ // s = turbine shaft
+ // t = turbine housing
+ // h = dynamo/maint
+ // m = muffler
+ .addShape(STRUCTURE_PIECE_MAIN, (new String[][] {
+ {"ccchccc", "ccccccc", "ccmmmcc", "ccm~mcc", "ccmmmcc", "ccccccc", "ccchccc"},
+ {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ }))
+ .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta())))
+ .addElement('s', lazy(t -> ofBlock(t.getCasingBlock(), t.getTurbineShaftMeta())))
+ .addElement('t', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class)
+ .adder(GregtechMetaTileEntity_LargerTurbineBase::addTurbineHatch)
+ .hatchClass(GT_MetaTileEntity_Hatch_Turbine.class)
+ .casingIndex(t.getCasingTextureIndex())
+ .dot(1)
+ .build()))
+ .addElement('h', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class)
+ .atLeast(InputBus, InputHatch, OutputHatch, Dynamo.or(TTDynamo), Maintenance)
+ .casingIndex(t.getCasingTextureIndex())
+ .dot(4)
+ .buildAndChain(t.getCasingBlock(), t.getCasingMeta())))
+ .addElement('m', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class)
+ .atLeast(Muffler)
+ .casingIndex(t.getCasingTextureIndex())
+ .dot(7)
+ .buildAndChain(t.getCasingBlock(), t.getCasingMeta())))
+ .build();
+ }
+ };
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> getStructureDefinition() {
+ return STRUCTURE_DEFINITION.get(getClass());
+ }
+
+ private boolean requiresMufflers() {
+ if (!PollutionUtils.isPollutionEnabled()) {
+ return false;
+ }
+ return getPollutionPerSecond(null) > 0;
+ }
+
+ public final double getMufflerReduction() {
+ double totalReduction = 0;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ totalReduction += ((double) tHatch.calculatePollutionReduction(100)) / 100;
+ }
+ }
+ return totalReduction / 4;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ this.mDynamoHatches.clear();
+ this.mTecTechDynamoHatches.clear();
+ this.mTurbineRotorHatches.clear();
+ this.mMaintenanceHatches.clear();
+ if (requiresMufflers()) {
+ this.mMufflerHatches.clear();
+ }
+ this.mInputBusses.clear();
+ this.mInputHatches.clear();
+ if (requiresOutputHatch()) {
+ this.mOutputHatches.clear();
+ }
+ // we do not check for casing count here. the bare minimal is 372 but we only require 360
+ boolean aStructure = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0);
+ log("Structure Check: " + aStructure);
+ if (mTurbineRotorHatches.size() != 12
+ || mMaintenanceHatches.size() != 1
+ || (mDynamoHatches.size() < 1 && mTecTechDynamoHatches.size() < 1)
+ || (requiresMufflers() && mMufflerHatches.size() != 4)
+ || mInputBusses.size() < 1
+ || mInputHatches.size() < 1
+ || (requiresOutputHatch() && mOutputHatches.size() < 1)) {
+ log("Bad Hatches - Turbine Housings: " + mTurbineRotorHatches.size() + ", Maint: "
+ + mMaintenanceHatches.size() + ", Dynamo: "
+ + mDynamoHatches.size() + ", Muffler: "
+ + mMufflerHatches.size() + ", Input Buses: "
+ + mInputBusses.size() + ", Input Hatches: "
+ + mInputHatches.size() + ", Output Hatches: "
+ + mOutputHatches.size());
+ return false;
+ }
+ mufflerReduction = getMufflerReduction();
+ return aStructure;
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 3, 3, 0);
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 2);
+ return survivialBuildPiece(mName, stackSize, 1, 3, 3, realBudget, source, actor, false, true);
+ }
+
+ public boolean addTurbineHatch(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
+ log("Found GT_MetaTileEntity_Hatch_Turbine");
+ updateTexture(aTileEntity, aBaseCasingIndex);
+ GT_MetaTileEntity_Hatch_Turbine aTurbineHatch = (GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity;
+ IGregTechTileEntity g = this.getBaseMetaTileEntity();
+ if (aTurbineHatch.setController(new BlockPos(g.getXCoord(), g.getYCoord(), g.getZCoord(), g.getWorld()))) {
+ boolean aDidAdd = this.mTurbineRotorHatches.add(aTurbineHatch);
+ Logger.INFO("Injected Controller into Turbine Assembly. Found: " + this.mTurbineRotorHatches.size());
+ return aDidAdd;
+ } else {
+ Logger.INFO("Failed to inject controller into Turbine Assembly Hatch.");
+ }
+ }
+ log("Bad Turbine Housing");
+ return false;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return getMaxEfficiency(aStack) > 0;
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(
+ aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png");
+ }
+
+ public final Block getCasingBlock() {
+ return ModBlocks.blockSpecialMultiCasings;
+ }
+
+ @Override
+ public final boolean hasSlotInGUI() {
+ return true;
+ }
+
+ public abstract int getCasingMeta();
+
+ public byte getTurbineShaftMeta() {
+ return 0;
+ }
+
+ public abstract byte getCasingTextureIndex();
+
+ public abstract int getFuelValue(FluidStack aLiquid);
+
+ public static boolean isValidTurbine(ItemStack aTurbine) {
+ return (aTurbine != null
+ && aTurbine.getItem() instanceof GT_MetaGenerated_Tool
+ && aTurbine.getItemDamage() >= 170
+ && aTurbine.getItemDamage() <= 176);
+ }
+
+ protected ArrayList<ItemStack> getAllBufferedTurbines() {
+ ArrayList<ItemStack> aTurbinesInStorage = new ArrayList<>();
+ for (GT_MetaTileEntity_Hatch_InputBus aBus : this.mInputBusses) {
+ if (isValidMetaTileEntity(aBus)) {
+ for (ItemStack aContent : aBus.mInventory) {
+ if (isValidTurbine(aContent)) {
+ aTurbinesInStorage.add(aContent);
+ }
+ }
+ }
+ }
+ return aTurbinesInStorage;
+ }
+
+ public boolean areAllTurbinesTheSame() {
+ ArrayList<GT_MetaTileEntity_Hatch_Turbine> aTurbineAssemblies = getFullTurbineAssemblies();
+ if (aTurbineAssemblies.size() < 12) {
+ log("Found " + aTurbineAssemblies.size() + ", expected 12.");
+ return false;
+ }
+ AutoMap<Materials> aTurbineMats = new AutoMap<>();
+ AutoMap<Integer> aTurbineSizes = new AutoMap<>();
+ for (GT_MetaTileEntity_Hatch_Turbine aHatch : aTurbineAssemblies) {
+ aTurbineMats.add(GT_MetaGenerated_Tool.getPrimaryMaterial(aHatch.getTurbine()));
+ aTurbineSizes.add(getTurbineSize(aHatch.getTurbine()));
+ }
+ Materials aBaseMat = aTurbineMats.get(0);
+ int aBaseSize = aTurbineSizes.get(0);
+ for (int aSize : aTurbineSizes) {
+ if (aBaseSize != aSize) {
+ return false;
+ }
+ }
+ for (Materials aMat : aTurbineMats) {
+ if (aBaseMat != aMat) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static int getTurbineSize(ItemStack aTurbine) {
+ if (isValidTurbine(aTurbine)) {
+ if (aTurbine.getItemDamage() >= 170 && aTurbine.getItemDamage() < 172) {
+ return 1;
+ } else if (aTurbine.getItemDamage() >= 172 && aTurbine.getItemDamage() < 174) {
+ return 2;
+ } else if (aTurbine.getItemDamage() >= 174 && aTurbine.getItemDamage() < 176) {
+ return 3;
+ } else if (aTurbine.getItemDamage() >= 176 && aTurbine.getItemDamage() < 178) {
+ return 4;
+ }
+ }
+ return 0;
+ }
+
+ public static String getTurbineSizeString(int aSize) {
+ switch (aSize) {
+ case 1:
+ return "Small Turbine";
+ case 2:
+ return "Turbine";
+ case 3:
+ return "Large Turbine";
+ case 4:
+ return "Huge Turbine";
+ default:
+ return "";
+ }
+ }
+
+ protected ArrayList<GT_MetaTileEntity_Hatch_Turbine> getEmptyTurbineAssemblies() {
+ ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches =
+ new ArrayList<GT_MetaTileEntity_Hatch_Turbine>();
+ // log("Checking "+mTurbineRotorHatches.size()+" Assemblies for empties.");
+ for (GT_MetaTileEntity_Hatch_Turbine aTurbineHatch : this.mTurbineRotorHatches) {
+ if (!aTurbineHatch.hasTurbine()) {
+ // log("Found Assembly without Turbine.");
+ aEmptyTurbineRotorHatches.add(aTurbineHatch);
+ }
+ }
+ return aEmptyTurbineRotorHatches;
+ }
+
+ protected ArrayList<GT_MetaTileEntity_Hatch_Turbine> getFullTurbineAssemblies() {
+ ArrayList<GT_MetaTileEntity_Hatch_Turbine> aTurbineRotorHatches =
+ new ArrayList<GT_MetaTileEntity_Hatch_Turbine>();
+ // log("Checking "+mTurbineRotorHatches.size()+" Assemblies for Turbines.");
+ for (GT_MetaTileEntity_Hatch_Turbine aTurbineHatch : this.mTurbineRotorHatches) {
+ if (aTurbineHatch.hasTurbine()) {
+ // log("Found Assembly with Turbine.");
+ aTurbineRotorHatches.add(aTurbineHatch);
+ }
+ }
+ return aTurbineRotorHatches;
+ }
+
+ protected boolean depleteTurbineFromStock(ItemStack aTurbine) {
+ for (GT_MetaTileEntity_Hatch_InputBus aInputBus : this.mInputBusses) {
+ for (int slot = 0; slot < aInputBus.mInventory.length; slot++) {
+ ItemStack aStack = aInputBus.getStackInSlot(slot);
+ if (aStack != null && GT_Utility.areStacksEqual(aStack, aTurbine)) {
+ aInputBus.setInventorySlotContents(slot, null);
+ updateSlots();
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ log("1");
+ return checkRecipeGeneric(
+ new ItemStack[] {}, getStoredFluids().toArray(new FluidStack[] {}), 1, 100, 100, 10000);
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs,
+ FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes,
+ long aEUPercent,
+ int aSpeedBonusPercent,
+ int aOutputChanceRoll,
+ GT_Recipe aRecipe) {
+
+ try {
+ ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies();
+ if (aEmptyTurbineRotorHatches.size() > 0) {
+ log("Found " + aEmptyTurbineRotorHatches.size() + " Assemblies without Turbine.");
+ hatch:
+ for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) {
+ ArrayList<ItemStack> aTurbines = getAllBufferedTurbines();
+ for (ItemStack aTurbineItem : aTurbines) {
+ if (aTurbineItem == null) {
+ continue;
+ }
+ if (aHatch.insertTurbine(aTurbineItem.copy())) {
+ boolean aDidDeplete = depleteTurbineFromStock(aTurbineItem);
+ log("Put Turbine into Assembly - " + aDidDeplete);
+ continue hatch;
+ }
+ }
+ }
+ }
+
+ if (getEmptyTurbineAssemblies().size() > 0 || !areAllTurbinesTheSame()) {
+ log("BAD RETURN - 1");
+ stopMachine();
+ return false;
+ }
+
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+
+ if (tFluids.size() > 0) {
+ if (baseEff == 0
+ || optFlow == 0
+ || counter >= 512
+ || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()
+ || this.getBaseMetaTileEntity().hasInventoryBeenModified()) {
+ counter = 0;
+
+ // log("Running checkRecipeGeneric(1)");
+ float aTotalBaseEff = 0;
+ float aTotalOptimalFlow = 0;
+
+ ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine();
+ for (int i = 0; i < getSpeedMultiplier(); i++) {
+ if (i == 0) {
+ aTotalBaseEff += GT_Utility.safeInt((long)
+ ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack))
+ * 1000F));
+ // log("Bumped base eff to "+aTotalBaseEff);
+ }
+ aTotalOptimalFlow += GT_Utility.safeInt((long) Math.max(
+ Float.MIN_NORMAL,
+ ((GT_MetaGenerated_Tool) aStack.getItem())
+ .getToolStats(aStack)
+ .getSpeedMultiplier()
+ * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed
+ * 50));
+ // log("Bumped base optimal flow to "+aTotalOptimalFlow);
+ }
+
+ // log("Running checkRecipeGeneric(2)");
+ // log("Total base eff: "+aTotalBaseEff);
+ // log("Total base optimal flow: "+aTotalOptimalFlow);
+ baseEff = MathUtils.roundToClosestInt(aTotalBaseEff);
+ optFlow = MathUtils.roundToClosestInt(aTotalOptimalFlow);
+ // log("Total eff: "+baseEff);
+ // log("Total optimal flow: "+optFlow);
+ if (optFlow <= 0 || baseEff <= 0) {
+ log("Running checkRecipeGeneric(bad-1)");
+ stopMachine(); // in case the turbine got removed
+ return false;
+ }
+ } else {
+ counter++;
+ }
+ }
+
+ // log("Total eff: "+baseEff);
+ // log("Total optimal flow: "+optFlow);
+
+ // How much the turbine should be producing with this flow
+ int newPower = fluidIntoPower(tFluids, optFlow, baseEff);
+ // log("Bumped newPower to "+newPower);
+ // log("New Power: "+newPower);
+ int difference = newPower - this.mEUt; // difference between current output and new output
+ // log("diff: "+difference);
+
+ // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the
+ // difference in power level (per tick)
+ // This is how much the turbine can actually change during this tick
+ int maxChangeAllowed = Math.max(10, GT_Utility.safeInt((long) Math.abs(difference) / 100));
+ // log("Max Change Allowed: "+maxChangeAllowed);
+
+ if (Math.abs(difference)
+ > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change
+ int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative.
+ this.mEUt += change; // Apply the change
+ // log("Applied power change.");
+ } else {
+ this.mEUt = newPower;
+ // log("Using same value.");
+ }
+ if (this.mEUt <= 0) {
+ this.mEUt = 0;
+ this.mEfficiency = 0;
+ log("Running checkRecipeGeneric(bad-2)");
+ // stopMachine();
+ return false;
+ } else {
+ this.mMaxProgresstime = 1;
+ this.mEfficiencyIncrease = 10;
+ // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here.
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+ // log("GOOD RETURN - Making: "+this.mEUt+" EU/t");
+ return true;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ return false;
+ }
+
+ public boolean doRandomMaintenanceDamage() {
+ if (getMaxParallelRecipes() == 0 || getRepairStatus() == 0) {
+ stopMachine();
+ return false;
+ }
+ if (mRuntime++ > 1000) {
+ mRuntime = 0;
+
+ if (getBaseMetaTileEntity().getRandomNumber(6000) < getMaintenanceThreshold()) {
+ 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;
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_Turbine aHatch : getFullTurbineAssemblies()) {
+ // This cycle depletes durability from the turbine rotors.
+ // The amount of times it is run depends on turbineDamageMultiplier
+ // In XL turbines, durability loss is around 5.2-5.3x faster than in singles
+ // To compensate for that, the mEU/t scaling is divided by 5 to make it only slightly faster
+ for (int i = 0; i < getTurbineDamageMultiplier(); i++) {
+ aHatch.damageTurbine(mEUt / 5, damageFactorLow, damageFactorHigh);
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (getFullTurbineAssemblies().size());
+ }
+
+ abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff);
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 1;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return this.getMaxParallelRecipes() == 12 ? 10000 : 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ public boolean isLooseMode() {
+ return false;
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ int mPollutionReduction = (int) (100 * mufflerReduction);
+
+ String tRunning = mMaxProgresstime > 0
+ ? EnumChatFormatting.GREEN
+ + StatCollector.translateToLocal("GT5U.turbine.running.true")
+ + EnumChatFormatting.RESET
+ : EnumChatFormatting.RED
+ + StatCollector.translateToLocal("GT5U.turbine.running.false")
+ + EnumChatFormatting.RESET;
+
+ String tMaintainance = getIdealStatus() == getRepairStatus()
+ ? EnumChatFormatting.GREEN
+ + StatCollector.translateToLocal("GT5U.turbine.maintenance.false")
+ + EnumChatFormatting.RESET
+ : EnumChatFormatting.RED
+ + StatCollector.translateToLocal("GT5U.turbine.maintenance.true")
+ + EnumChatFormatting.RESET;
+ int tDura = 0;
+
+ StringBuilder aTurbineDamage = new StringBuilder();
+ for (GT_MetaTileEntity_Hatch_Turbine aHatch : this.getFullTurbineAssemblies()) {
+ ItemStack aTurbine = aHatch.getTurbine();
+ tDura = MathUtils.safeInt((long) (100.0f
+ / GT_MetaGenerated_Tool.getToolMaxDamage(aTurbine)
+ * (GT_MetaGenerated_Tool.getToolDamage(aTurbine))
+ + 1));
+ aTurbineDamage
+ .append(EnumChatFormatting.RED)
+ .append(tDura)
+ .append(EnumChatFormatting.RESET)
+ .append("% | ");
+ }
+
+ long storedEnergy = 0;
+ long maxEnergy = 0;
+ for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
+ }
+ }
+
+ boolean aIsSteam = this.getClass().getName().toLowerCase().contains("steam");
+
+ String[] ret = new String[] {
+ // 8 Lines available for information panels
+ tRunning + ": " + EnumChatFormatting.RED + mEUt + EnumChatFormatting.RESET + " EU/t",
+ tMaintainance,
+ StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + EnumChatFormatting.YELLOW
+ + (mEfficiency / 100F) + EnumChatFormatting.RESET + "%",
+ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN
+ + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW
+ + Long.toString(maxEnergy) + EnumChatFormatting.RESET + " EU",
+ StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW
+ + MathUtils.safeInt((long) realOptFlow) + EnumChatFormatting.RESET + " L/t"
+ + EnumChatFormatting.YELLOW + " ("
+ + (isLooseMode()
+ ? StatCollector.translateToLocal("GT5U.turbine.loose")
+ : StatCollector.translateToLocal("GT5U.turbine.tight"))
+ + ")",
+ StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + EnumChatFormatting.GOLD + storedFluid
+ + EnumChatFormatting.RESET + "L",
+ StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " + aTurbineDamage,
+ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN
+ + mPollutionReduction + EnumChatFormatting.RESET + " %"
+ };
+ if (!aIsSteam)
+ ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW
+ + MathUtils.safeInt((long) realOptFlow) + EnumChatFormatting.RESET + " L/t";
+ return ret;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ public boolean polluteEnvironment(int aPollutionLevel) {
+ if (this.requiresMufflers()) {
+ mPollution += aPollutionLevel * getPollutionMultiplier() * mufflerReduction;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (mPollution >= 10000) {
+ if (PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10000)) {
+ mPollution -= 10000;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+ return mPollution < 10000;
+ }
+ return true;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ // This should not be a hard limit, due to TecTech dynamos
+ if (mFastMode) {
+ return 64;
+ } else {
+ return 16;
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("mFastMode", mFastMode);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mFastMode = aNBT.getBoolean("mFastMode");
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mFastMode = Utils.invertBoolean(mFastMode);
+ if (mFastMode) {
+ PlayerUtils.messagePlayer(aPlayer, "Running in Fast (48x) Mode.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Running in Slow (16x) Mode.");
+ }
+ }
+
+ @Override
+ public final ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1],
+ aFacing == aSide
+ ? getFrontFacingTurbineTexture(aActive)
+ : Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())
+ };
+ }
+
+ protected ITexture getFrontFacingTurbineTexture(boolean isActive) {
+ if (isActive) {
+ return frontFaceActive;
+ }
+ return frontFace;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (mUpdate == 1 || mStartUpCheck == 1) {
+ log("Cleared Rotor Assemblies.");
+ this.mTurbineRotorHatches.clear();
+ }
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (this.maxProgresstime() > 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ enableAllTurbineHatches();
+ }
+ if (this.maxProgresstime() <= 0) {
+ stopMachine();
+ }
+ }
+
+ @Override
+ public void startProcess() {
+ super.startProcess();
+ enableAllTurbineHatches();
+ }
+
+ @Override
+ public void stopMachine() {
+ baseEff = 0;
+ optFlow = 0;
+ disableAllTurbineHatches();
+ super.stopMachine();
+ }
+
+ @Override
+ public void onRemoval() {
+ super.onRemoval();
+ for (GT_MetaTileEntity_Hatch_Turbine h : this.mTurbineRotorHatches) {
+ h.clearController();
+ }
+ disableAllTurbineHatches();
+ this.mTurbineRotorHatches.clear();
+ }
+
+ public void enableAllTurbineHatches() {
+ updateTurbineHatches(this.isMachineRunning());
+ }
+
+ public void disableAllTurbineHatches() {
+ updateTurbineHatches(false);
+ }
+
+ private Long mLastHatchUpdate;
+
+ public int updateTurbineHatches(boolean aState) {
+ int aUpdated = 0;
+ if (mLastHatchUpdate == null) {
+ mLastHatchUpdate = System.currentTimeMillis() / 1000;
+ }
+ if (this.mTurbineRotorHatches.isEmpty() || ((System.currentTimeMillis() / 1000) - mLastHatchUpdate) <= 2) {
+ return 0;
+ }
+ for (GT_MetaTileEntity_Hatch_Turbine h : this.mTurbineRotorHatches) {
+ h.setActive(aState);
+ aUpdated++;
+ }
+
+ mLastHatchUpdate = System.currentTimeMillis() / 1000;
+ return aUpdated;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ // Fix GT bug
+ if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
+ log("Fixing Bad Facing. (GT Bug)");
+ this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
+ }
+ }
-public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargerTurbineBase> implements ISurvivalConstructable {
-
- protected int baseEff = 0;
- protected int optFlow = 0;
- protected double realOptFlow = 0;
- protected int storedFluid = 0;
- protected int counter = 0;
- protected boolean mFastMode = false;
- protected double mufflerReduction = 1;
-
- public ITexture frontFace;
- public ITexture frontFaceActive;
-
-
- public ArrayList<GT_MetaTileEntity_Hatch_Turbine> mTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>();
-
-
- public GregtechMetaTileEntity_LargerTurbineBase(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- frontFace = getTextureFrontFace();
- frontFaceActive = getTextureFrontFaceActive();
-
- }
- public GregtechMetaTileEntity_LargerTurbineBase(String aName) {
- super(aName);
- frontFace = getTextureFrontFace();
- frontFaceActive = getTextureFrontFaceActive();
- }
-
-
- protected abstract ITexture getTextureFrontFace();
-
- protected abstract ITexture getTextureFrontFaceActive();
-
- protected abstract String getTurbineType();
-
- protected abstract String getCasingName();
-
- protected abstract boolean requiresOutputHatch();
-
- @Override
- protected final GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the XL "+getTurbineType()+" Turbine")
- .addInfo("Runs as fast as 16 Large Turbines of the same type, takes the space of 12")
- .addInfo("Right-click with screwdriver to enable Fast Mode, to run it even faster")
- .addInfo("Optimal flow will increase or decrease accordingly on mode switch")
- .addInfo("Fast Mode increases speed to 48x instead of 16x, with some penalties")
- .addInfo("Maintenance problems and turbine damage happen 12x as often in Fast Mode")
- .addInfo("XL Steam Turbines can use Loose Mode with either Slow or Fast Mode")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addInfo("Pollution is 3x higher in Fast Mode")
- .addSeparator()
- .beginStructureBlock(7, 9, 7, false)
- .addController("Top Middle")
- .addCasingInfo(getCasingName(), 360)
- .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1)
- .addInputBus("Any 4 dot hint (min 1)", 4)
- .addInputHatch("Any 4 dot hint(min 1)", 4);
- if (requiresOutputHatch()) {
- tt.addOutputHatch("Any 4 dot hint(min 1)", 4);
- }
- tt.addDynamoHatch("Any 4 dot hint(min 1)", 4)
- .addMaintenanceHatch("Any 4 dot hint(min 1)", 4);
- if (requiresMufflers()) {
- tt.addMufflerHatch("Any 7 dot hint (x4)", 7);
- }
- tt.toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- private static final String STRUCTURE_PIECE_MAIN = "main";
- private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>>() {
- @Override
- protected IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> computeValue(Class<?> type) {
- return StructureDefinition.<GregtechMetaTileEntity_LargerTurbineBase>builder()
- // c = turbine casing
- // s = turbine shaft
- // t = turbine housing
- // h = dynamo/maint
- // m = muffler
- .addShape(STRUCTURE_PIECE_MAIN, (new String[][]{
- {"ccchccc", "ccccccc", "ccmmmcc", "ccm~mcc", "ccmmmcc", "ccccccc", "ccchccc"},
- {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"},
- {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
- {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
- {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"},
- {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
- {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
- {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"},
- {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
- }))
-
- .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta())))
- .addElement('s', lazy(t -> ofBlock(t.getCasingBlock(), t.getTurbineShaftMeta())))
- .addElement('t', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class)
- .adder(GregtechMetaTileEntity_LargerTurbineBase::addTurbineHatch)
- .hatchClass(GT_MetaTileEntity_Hatch_Turbine.class)
- .casingIndex(t.getCasingTextureIndex())
- .dot(1)
- .build()))
- .addElement('h', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class)
- .atLeast(InputBus, InputHatch, OutputHatch, Dynamo.or(TTDynamo), Maintenance)
- .casingIndex(t.getCasingTextureIndex())
- .dot(4)
- .buildAndChain(t.getCasingBlock(), t.getCasingMeta())))
- .addElement('m', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class)
- .atLeast(Muffler)
- .casingIndex(t.getCasingTextureIndex())
- .dot(7)
- .buildAndChain(t.getCasingBlock(), t.getCasingMeta())))
- .build();
- }
- };
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> getStructureDefinition() {
- return STRUCTURE_DEFINITION.get(getClass());
- }
-
- private boolean requiresMufflers() {
- if (!PollutionUtils.isPollutionEnabled()) {
- return false;
- }
- return getPollutionPerSecond(null) > 0;
- }
-
- public final double getMufflerReduction() {
- double totalReduction = 0;
- for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- totalReduction += ((double) tHatch.calculatePollutionReduction(100)) / 100;
- }
- }
- return totalReduction / 4;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- this.mDynamoHatches.clear();
- this.mTecTechDynamoHatches.clear();
- this.mTurbineRotorHatches.clear();
- this.mMaintenanceHatches.clear();
- if (requiresMufflers()) {
- this.mMufflerHatches.clear();
- }
- this.mInputBusses.clear();
- this.mInputHatches.clear();
- if (requiresOutputHatch()) {
- this.mOutputHatches.clear();
- }
- // we do not check for casing count here. the bare minimal is 372 but we only require 360
- boolean aStructure = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0);
- log("Structure Check: "+aStructure);
- if (mTurbineRotorHatches.size() != 12 ||
- mMaintenanceHatches.size() != 1 ||
- (mDynamoHatches.size() < 1 && mTecTechDynamoHatches.size() < 1) ||
- (requiresMufflers() && mMufflerHatches.size() != 4) ||
- mInputBusses.size() < 1 ||
- mInputHatches.size() < 1 ||
- (requiresOutputHatch() && mOutputHatches.size() < 1)
- ) {
- log("Bad Hatches - Turbine Housings: "+mTurbineRotorHatches.size()+
- ", Maint: "+mMaintenanceHatches.size()+
- ", Dynamo: "+mDynamoHatches.size()+
- ", Muffler: "+mMufflerHatches.size()+
- ", Input Buses: "+mInputBusses.size()+
- ", Input Hatches: "+mInputHatches.size()+
- ", Output Hatches: "+mOutputHatches.size());
- return false;
- }
- mufflerReduction = getMufflerReduction();
- return aStructure;
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 3, 3, 0);
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 2);
- return survivialBuildPiece(mName, stackSize, 1, 3, 3, realBudget, source, actor, false, true);
- }
-
- public boolean addTurbineHatch(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
- log("Found GT_MetaTileEntity_Hatch_Turbine");
- updateTexture(aTileEntity, aBaseCasingIndex);
- GT_MetaTileEntity_Hatch_Turbine aTurbineHatch = (GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity;
- IGregTechTileEntity g = this.getBaseMetaTileEntity();
- if (aTurbineHatch.setController(new BlockPos(g.getXCoord(), g.getYCoord(), g.getZCoord(), g.getWorld()))) {
- boolean aDidAdd = this.mTurbineRotorHatches.add(aTurbineHatch);
- Logger.INFO("Injected Controller into Turbine Assembly. Found: "+this.mTurbineRotorHatches.size());
- return aDidAdd;
- }
- else {
- Logger.INFO("Failed to inject controller into Turbine Assembly Hatch.");
- }
- }
- log("Bad Turbine Housing");
- return false;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return getMaxEfficiency(aStack) > 0;
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png");
- }
-
- public final Block getCasingBlock() {
- return ModBlocks.blockSpecialMultiCasings;
- }
-
- @Override
- public final boolean hasSlotInGUI() {
- return true;
- }
-
- public abstract int getCasingMeta();
-
- public byte getTurbineShaftMeta() {
- return 0;
- }
-
- public abstract byte getCasingTextureIndex();
-
- public abstract int getFuelValue(FluidStack aLiquid);
-
- public static boolean isValidTurbine(ItemStack aTurbine) {
- return (aTurbine !=null && aTurbine.getItem() instanceof GT_MetaGenerated_Tool && aTurbine.getItemDamage() >= 170 && aTurbine.getItemDamage() <= 176);
- }
-
- protected ArrayList<ItemStack> getAllBufferedTurbines(){
- ArrayList<ItemStack> aTurbinesInStorage = new ArrayList<>();
- for (GT_MetaTileEntity_Hatch_InputBus aBus: this.mInputBusses) {
- if (isValidMetaTileEntity(aBus)) {
- for (ItemStack aContent : aBus.mInventory) {
- if (isValidTurbine(aContent)) {
- aTurbinesInStorage.add(aContent);
- }
- }
- }
- }
- return aTurbinesInStorage;
- }
-
- public boolean areAllTurbinesTheSame() {
- ArrayList<GT_MetaTileEntity_Hatch_Turbine> aTurbineAssemblies = getFullTurbineAssemblies();
- if (aTurbineAssemblies.size() < 12) {
- log("Found "+aTurbineAssemblies.size()+", expected 12.");
- return false;
- }
- AutoMap<Materials> aTurbineMats = new AutoMap<>();
- AutoMap<Integer> aTurbineSizes = new AutoMap<>();
- for (GT_MetaTileEntity_Hatch_Turbine aHatch : aTurbineAssemblies) {
- aTurbineMats.add(GT_MetaGenerated_Tool.getPrimaryMaterial(aHatch.getTurbine()));
- aTurbineSizes.add(getTurbineSize(aHatch.getTurbine()));
- }
- Materials aBaseMat = aTurbineMats.get(0);
- int aBaseSize = aTurbineSizes.get(0);
- for (int aSize : aTurbineSizes) {
- if (aBaseSize != aSize) {
- return false;
- }
- }
- for (Materials aMat : aTurbineMats) {
- if (aBaseMat != aMat) {
- return false;
- }
- }
- return true;
- }
-
- public static int getTurbineSize(ItemStack aTurbine) {
- if (isValidTurbine(aTurbine)) {
- if (aTurbine.getItemDamage() >= 170 && aTurbine.getItemDamage() < 172) {
- return 1;
- }
- else if (aTurbine.getItemDamage() >= 172 && aTurbine.getItemDamage() < 174) {
- return 2;
- }
- else if (aTurbine.getItemDamage() >= 174 && aTurbine.getItemDamage() < 176) {
- return 3;
- }
- else if (aTurbine.getItemDamage() >= 176 && aTurbine.getItemDamage() < 178) {
- return 4;
- }
- }
- return 0;
- }
-
- public static String getTurbineSizeString(int aSize) {
- switch (aSize) {
- case 1:
- return "Small Turbine";
- case 2:
- return "Turbine";
- case 3:
- return "Large Turbine";
- case 4:
- return "Huge Turbine";
- default:
- return "";
- }
- }
-
- protected ArrayList<GT_MetaTileEntity_Hatch_Turbine> getEmptyTurbineAssemblies() {
- ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>();
- //log("Checking "+mTurbineRotorHatches.size()+" Assemblies for empties.");
- for (GT_MetaTileEntity_Hatch_Turbine aTurbineHatch : this.mTurbineRotorHatches) {
- if (!aTurbineHatch.hasTurbine()) {
- //log("Found Assembly without Turbine.");
- aEmptyTurbineRotorHatches.add(aTurbineHatch);
- }
- }
- return aEmptyTurbineRotorHatches;
- }
-
- protected ArrayList<GT_MetaTileEntity_Hatch_Turbine> getFullTurbineAssemblies() {
- ArrayList<GT_MetaTileEntity_Hatch_Turbine> aTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>();
- //log("Checking "+mTurbineRotorHatches.size()+" Assemblies for Turbines.");
- for (GT_MetaTileEntity_Hatch_Turbine aTurbineHatch : this.mTurbineRotorHatches) {
- if (aTurbineHatch.hasTurbine()) {
- //log("Found Assembly with Turbine.");
- aTurbineRotorHatches.add(aTurbineHatch);
- }
- }
- return aTurbineRotorHatches;
- }
-
- protected boolean depleteTurbineFromStock(ItemStack aTurbine) {
- for (GT_MetaTileEntity_Hatch_InputBus aInputBus : this.mInputBusses) {
- for (int slot = 0; slot < aInputBus.mInventory.length; slot++) {
- ItemStack aStack = aInputBus.getStackInSlot(slot);
- if (aStack != null && GT_Utility.areStacksEqual(aStack, aTurbine)) {
- aInputBus.setInventorySlotContents(slot, null);
- updateSlots();
- return true;
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- log("1");
- return checkRecipeGeneric(new ItemStack[] {}, getStoredFluids().toArray(new FluidStack[] {}), 1, 100, 100, 10000);
- }
-
- @Override
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, long aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
-
- try {
- ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies();
- if (aEmptyTurbineRotorHatches.size() > 0) {
- log("Found "+aEmptyTurbineRotorHatches.size()+" Assemblies without Turbine.");
- hatch : for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) {
- ArrayList<ItemStack> aTurbines = getAllBufferedTurbines();
- for (ItemStack aTurbineItem : aTurbines) {
- if (aTurbineItem == null) {
- continue;
- }
- if (aHatch.insertTurbine(aTurbineItem.copy())) {
- boolean aDidDeplete = depleteTurbineFromStock(aTurbineItem);
- log("Put Turbine into Assembly - "+aDidDeplete);
- continue hatch;
- }
- }
- }
- }
-
- if (getEmptyTurbineAssemblies().size() > 0 || !areAllTurbinesTheSame()) {
- log("BAD RETURN - 1");
- stopMachine();
- return false;
- }
-
- ArrayList<FluidStack> tFluids = getStoredFluids();
-
- if (tFluids.size() > 0) {
- if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()
- || this.getBaseMetaTileEntity().hasInventoryBeenModified()) {
- counter = 0;
-
- //log("Running checkRecipeGeneric(1)");
- float aTotalBaseEff = 0;
- float aTotalOptimalFlow = 0;
-
- ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine();
- for (int i = 0; i< getSpeedMultiplier(); i++) {
- if (i == 0) {
- aTotalBaseEff += GT_Utility.safeInt((long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F));
- //log("Bumped base eff to "+aTotalBaseEff);
- }
- aTotalOptimalFlow += GT_Utility.safeInt((long) Math.max(Float.MIN_NORMAL,
- ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed
- * 50));
- //log("Bumped base optimal flow to "+aTotalOptimalFlow);
- }
-
- //log("Running checkRecipeGeneric(2)");
- //log("Total base eff: "+aTotalBaseEff);
- //log("Total base optimal flow: "+aTotalOptimalFlow);
- baseEff = MathUtils.roundToClosestInt(aTotalBaseEff);
- optFlow = MathUtils.roundToClosestInt(aTotalOptimalFlow);
- //log("Total eff: "+baseEff);
- //log("Total optimal flow: "+optFlow);
- if(optFlow<=0 || baseEff<=0){
- log("Running checkRecipeGeneric(bad-1)");
- stopMachine();//in case the turbine got removed
- return false;
- }
- } else {
- counter++;
- }
- }
-
- //log("Total eff: "+baseEff);
- //log("Total optimal flow: "+optFlow);
-
- // How much the turbine should be producing with this flow
- int newPower = fluidIntoPower(tFluids, optFlow, baseEff);
- //log("Bumped newPower to "+newPower);
- //log("New Power: "+newPower);
- int difference = newPower - this.mEUt; // difference between current output and new output
- //log("diff: "+difference);
-
- // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick)
- // This is how much the turbine can actually change during this tick
- int maxChangeAllowed = Math.max(10, GT_Utility.safeInt((long)Math.abs(difference)/100));
- //log("Max Change Allowed: "+maxChangeAllowed);
-
- if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change
- int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative.
- this.mEUt += change; // Apply the change
- //log("Applied power change.");
- }
- else {
- this.mEUt = newPower;
- //log("Using same value.");
- }
- if (this.mEUt <= 0) {
- this.mEUt=0;
- this.mEfficiency=0;
- log("Running checkRecipeGeneric(bad-2)");
- //stopMachine();
- return false;
- } else {
- this.mMaxProgresstime = 1;
- this.mEfficiencyIncrease = 10;
- // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here.
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
- //log("GOOD RETURN - Making: "+this.mEUt+" EU/t");
- return true;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- return false;
- }
-
- public boolean doRandomMaintenanceDamage() {
- if (getMaxParallelRecipes() == 0 || getRepairStatus() == 0) {
- stopMachine();
- return false;
- }
- if (mRuntime++ > 1000) {
- mRuntime = 0;
-
- if (getBaseMetaTileEntity().getRandomNumber(6000) < getMaintenanceThreshold()) {
- 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;
- }
- }
- for (GT_MetaTileEntity_Hatch_Turbine aHatch : getFullTurbineAssemblies()) {
- // This cycle depletes durability from the turbine rotors.
- // The amount of times it is run depends on turbineDamageMultiplier
- // In XL turbines, durability loss is around 5.2-5.3x faster than in singles
- // To compensate for that, the mEU/t scaling is divided by 5 to make it only slightly faster
- for (int i = 0; i < getTurbineDamageMultiplier(); i++) {
- aHatch.damageTurbine(mEUt / 5, damageFactorLow, damageFactorHigh);
- }
- }
- }
- return true;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return (getFullTurbineAssemblies().size());
- }
-
- abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff);
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 1;
- }
-
- public int getMaxEfficiency(ItemStack aStack) {
- return this.getMaxParallelRecipes() == 12 ? 10000 : 0;
- }
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- public boolean isLooseMode() {
- return false;
- }
-
- @Override
- public String[] getExtraInfoData() {
- int mPollutionReduction=(int) (100 * mufflerReduction);
-
- String tRunning = mMaxProgresstime > 0 ?
- EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.running.true")+EnumChatFormatting.RESET :
- EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.running.false")+EnumChatFormatting.RESET;
-
- String tMaintainance = getIdealStatus() == getRepairStatus() ?
- EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.maintenance.false")+EnumChatFormatting.RESET :
- EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.maintenance.true")+EnumChatFormatting.RESET ;
- int tDura = 0;
-
- StringBuilder aTurbineDamage = new StringBuilder();
- for (GT_MetaTileEntity_Hatch_Turbine aHatch : this.getFullTurbineAssemblies()) {
- ItemStack aTurbine = aHatch.getTurbine();
- tDura = MathUtils.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(aTurbine) * (GT_MetaGenerated_Tool.getToolDamage(aTurbine))+1));
- aTurbineDamage.append(EnumChatFormatting.RED).append(tDura).append(EnumChatFormatting.RESET).append("% | ");
- }
-
- long storedEnergy=0;
- long maxEnergy=0;
- for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU();
- maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity();
- }
- }
-
- boolean aIsSteam = this.getClass().getName().toLowerCase().contains("steam");
-
- String[] ret = new String[]{
- // 8 Lines available for information panels
- tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t",
- tMaintainance,
- StatCollector.translateToLocal("GT5U.turbine.efficiency")+": "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%",
- StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+
- EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU",
- StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" +
- EnumChatFormatting.YELLOW+" ("+(isLooseMode()?StatCollector.translateToLocal("GT5U.turbine.loose"):StatCollector.translateToLocal("GT5U.turbine.tight"))+")",
- StatCollector.translateToLocal("GT5U.turbine.fuel")+": "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L",
- StatCollector.translateToLocal("GT5U.turbine.dmg")+": "+aTurbineDamage,
- StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"
- };
- if (!aIsSteam)
- ret[4]=StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t";
- return ret;
-
-
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
-
- public boolean polluteEnvironment(int aPollutionLevel) {
- if (this.requiresMufflers()) {
- mPollution += aPollutionLevel * getPollutionMultiplier() * mufflerReduction;
- for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- if (mPollution >= 10000) {
- if (PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10000)) {
- mPollution -= 10000;
- }
- } else {
- break;
- }
- }
- }
- return mPollution < 10000;
- }
- return true;
- }
- @Override
- public long maxAmperesOut() {
- // This should not be a hard limit, due to TecTech dynamos
- if (mFastMode) {
- return 64;
- }
- else {
- return 16;
- }
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setBoolean("mFastMode", mFastMode);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mFastMode = aNBT.getBoolean("mFastMode");
- super.loadNBTData(aNBT);
- }
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mFastMode = Utils.invertBoolean(mFastMode);
- if (mFastMode){
- PlayerUtils.messagePlayer(aPlayer, "Running in Fast (48x) Mode.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Running in Slow (16x) Mode.");
- }
- }
-
- @Override
- public final ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? getFrontFacingTurbineTexture(aActive) : Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())};
- }
-
- protected ITexture getFrontFacingTurbineTexture(boolean isActive) {
- if (isActive) {
- return frontFaceActive;
- }
- return frontFace;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (mUpdate == 1 || mStartUpCheck == 1) {
- log("Cleared Rotor Assemblies.");
- this.mTurbineRotorHatches.clear();
- }
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (this.maxProgresstime() > 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
- enableAllTurbineHatches();
- }
- if (this.maxProgresstime() <= 0) {
- stopMachine();
- }
-
- }
- @Override
- public void startProcess() {
- super.startProcess();
- enableAllTurbineHatches();
- }
-
- @Override
- public void stopMachine() {
- baseEff = 0;
- optFlow = 0;
- disableAllTurbineHatches();
- super.stopMachine();
- }
-
- @Override
- public void onRemoval() {
- super.onRemoval();
- for (GT_MetaTileEntity_Hatch_Turbine h : this.mTurbineRotorHatches) {
- h.clearController();
- }
- disableAllTurbineHatches();
- this.mTurbineRotorHatches.clear();
- }
-
- public void enableAllTurbineHatches() {
- updateTurbineHatches(this.isMachineRunning());
- }
-
- public void disableAllTurbineHatches() {
- updateTurbineHatches(false);
- }
-
- private Long mLastHatchUpdate;
- public int updateTurbineHatches(boolean aState) {
- int aUpdated = 0;
- if (mLastHatchUpdate == null) {
- mLastHatchUpdate = System.currentTimeMillis()/1000;
- }
- if (this.mTurbineRotorHatches.isEmpty() || ((System.currentTimeMillis()/1000)-mLastHatchUpdate) <= 2) {
- return 0;
- }
- for (GT_MetaTileEntity_Hatch_Turbine h : this.mTurbineRotorHatches) {
- h.setActive(aState);
- aUpdated++;
- }
-
- mLastHatchUpdate = System.currentTimeMillis()/1000;
- return aUpdated;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- // Fix GT bug
- if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
- log("Fixing Bad Facing. (GT Bug)");
- this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
- }
- }
-
/**
* Called every tick the Machine runs
*/
@@ -810,24 +857,24 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
return false;
}
- @Override
- public boolean addEnergyOutput(long aEU) {
- if (aEU <= 0) {
- return true;
- }
- if (this.mAllDynamoHatches.size() > 0) {
- return addEnergyOutputMultipleDynamos(aEU, true);
- }
- return false;
- }
-
+ @Override
+ public boolean addEnergyOutput(long aEU) {
+ if (aEU <= 0) {
+ return true;
+ }
+ if (this.mAllDynamoHatches.size() > 0) {
+ return addEnergyOutputMultipleDynamos(aEU, true);
+ }
+ return false;
+ }
+
public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) {
int injected = 0;
long totalOutput = 0;
long aFirstVoltageFound = -1;
boolean aFoundMixedDynamos = false;
for (GT_MetaTileEntity_Hatch aDynamo : mAllDynamoHatches) {
- if(aDynamo == null) {
+ if (aDynamo == null) {
return false;
}
if (isValidMetaTileEntity(aDynamo)) {
@@ -836,8 +883,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
// Check against voltage to check when hatch mixing
if (aFirstVoltageFound == -1) {
aFirstVoltageFound = aVoltage;
- }
- else {
+ } else {
if (aFirstVoltageFound != aVoltage) {
aFoundMixedDynamos = true;
}
@@ -857,33 +903,33 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
aVoltage = aDynamo.maxEUOutput();
aAmpsToInject = (int) (leftToInject / aVoltage);
aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage));
- ampsOnCurrentHatch= (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject);
+ ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject);
for (int i = 0; i < ampsOnCurrentHatch; i++) {
aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false);
}
- injected+=aVoltage*ampsOnCurrentHatch;
- if(aRemainder>0 && ampsOnCurrentHatch<aDynamo.maxAmperesOut()){
+ injected += aVoltage * ampsOnCurrentHatch;
+ if (aRemainder > 0 && ampsOnCurrentHatch < aDynamo.maxAmperesOut()) {
aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false);
- injected+=aRemainder;
+ injected += aRemainder;
}
}
}
return injected > 0;
}
- public int getSpeedMultiplier() {
- return mFastMode ? 48 : 16;
- }
+ public int getSpeedMultiplier() {
+ return mFastMode ? 48 : 16;
+ }
- public int getMaintenanceThreshold() {
- return mFastMode ? 12 : 1;
- }
+ public int getMaintenanceThreshold() {
+ return mFastMode ? 12 : 1;
+ }
- public int getPollutionMultiplier() {
- return mFastMode ? 3 : 1;
- }
+ public int getPollutionMultiplier() {
+ return mFastMode ? 3 : 1;
+ }
- public int getTurbineDamageMultiplier() {
- return mFastMode ? 3 : 1;
- }
+ public int getTurbineDamageMultiplier() {
+ return mFastMode ? 3 : 1;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java
index 6ed14eb2a9..4ec9d0347f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java
@@ -1,33 +1,6 @@
/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.TAE;
-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.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-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;
public class GregtechMetaTileEntity_MultiTank
extends GregtechMeta_MultiBlockBase {
@@ -46,7 +19,7 @@ extends GregtechMeta_MultiBlockBase {
public String getMachineType() {
return "Fluid Tank";
}
-
+
@Override
public String[] getExtraInfoData() {
final ArrayList<GT_MetaTileEntity_Hatch_Energy> mTier = this.mEnergyHatches;
@@ -77,545 +50,545 @@ extends GregtechMeta_MultiBlockBase {
super.saveNBTData(aNBT);
*/
/*final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents");
- if (gtCraftingComponentsTag != null){
-
- Utils.LOG_WARNING("Got Crafting Tag");
-
- if (this.internalStorageTank != null){
- Utils.LOG_WARNING("mFluid was not null, Saving TileEntity NBT data.");
-
- gtCraftingComponentsTag.setString("xFluid", this.internalStorageTank.getFluid().getName());
- gtCraftingComponentsTag.setInteger("xAmount", this.internalStorageTank.amount);
- gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage);
-
- aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag);
- }
- else {
- Utils.LOG_WARNING("mFluid was null, Saving TileEntity NBT data.");
- gtCraftingComponentsTag.removeTag("xFluid");
- gtCraftingComponentsTag.removeTag("xAmount");
- gtCraftingComponentsTag.removeTag("xAmountMax");
- gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage);
-
-
- aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag);
- }
- }*//*
-
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- */
-/*final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents");
- String xFluid = null;
- int xAmount = 0;
- if (gtCraftingComponentsTag.hasNoTags()){
- if (this.internalStorageTank != null){
- Utils.LOG_WARNING("mFluid was not null, Creating TileEntity NBT data.");
- gtCraftingComponentsTag.setInteger("xAmount", this.internalStorageTank.amount);
- gtCraftingComponentsTag.setString("xFluid", this.internalStorageTank.getFluid().getName());
- aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag);
- }
- }
- else {
-
- //internalCraftingComponentsTag = gtCraftingComponentsTag.getCompoundTag("backupTag");
-
- if (gtCraftingComponentsTag.hasKey("xFluid")){
- Utils.LOG_WARNING("xFluid was not null, Loading TileEntity NBT data.");
- xFluid = gtCraftingComponentsTag.getString("xFluid");
- }
- if (gtCraftingComponentsTag.hasKey("xAmount")){
- Utils.LOG_WARNING("xAmount was not null, Loading TileEntity NBT data.");
- xAmount = gtCraftingComponentsTag.getInteger("xAmount");
- }
- if ((xFluid != null) && (xAmount != 0)){
- Utils.LOG_WARNING("Setting Internal Tank, loading "+xAmount+"L of "+xFluid);
- this.setInternalTank(xFluid, xAmount);
- }
- }*//*
+if (gtCraftingComponentsTag != null){
- }
-
- private boolean setInternalTank(final String fluidName, final int amount){
- final FluidStack temp = FluidUtils.getFluidStack(fluidName, amount);
- if (temp != null){
- if (this.internalStorageTank == null){
- this.internalStorageTank = temp;
- Logger.WARNING(temp.getFluid().getName()+" Amount: "+temp.amount+"L");
- }
- else{
- Logger.WARNING("Retained Fluid.");
- Logger.WARNING(this.internalStorageTank.getFluid().getName()+" Amxount: "+this.internalStorageTank.amount+"L");
- }
- this.markDirty();
- return true;
- }
- return false;
- }
+ Utils.LOG_WARNING("Got Crafting Tag");
- @Override
- public void onLeftclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- this.tryForceNBTUpdate();
- super.onLeftclick(aBaseMetaTileEntity, aPlayer);
- }
+ if (this.internalStorageTank != null){
+ Utils.LOG_WARNING("mFluid was not null, Saving TileEntity NBT data.");
- @Override
- public boolean onWrenchRightClick(final byte aSide, final byte aWrenchingSide, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ) {
- this.tryForceNBTUpdate();
- return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
- }
+ gtCraftingComponentsTag.setString("xFluid", this.internalStorageTank.getFluid().getName());
+ gtCraftingComponentsTag.setInteger("xAmount", this.internalStorageTank.amount);
+ gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage);
- @Override
- public void onRemoval() {
- this.tryForceNBTUpdate();
- super.onRemoval();
+ aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag);
}
+ else {
+ Utils.LOG_WARNING("mFluid was null, Saving TileEntity NBT data.");
+ gtCraftingComponentsTag.removeTag("xFluid");
+ gtCraftingComponentsTag.removeTag("xAmount");
+ gtCraftingComponentsTag.removeTag("xAmountMax");
+ gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage);
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- if ((this.internalStorageTank != null) && this.internalStorageTank.amount >= this.maximumFluidStorage){
- if (this.internalStorageTank.amount > this.maximumFluidStorage){
- this.internalStorageTank.amount = this.maximumFluidStorage;
- }
- this.stopMachine();
- }
-
- if (this.mInternalSaveClock != 20){
- this.mInternalSaveClock++;
- }
- else {
- this.mInternalSaveClock = 0;
- this.tryForceNBTUpdate();
- }
-
+ aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag);
}
+}*//*
- public GregtechMetaTileEntity_MultiTank(final String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_MultiTank(this.mName);
- }
+ }
- @Override
- public String[] getTooltip() {
- return new String[]{
- "Controller Block for the Multitank",
- "Size: 3xHx3 (Block behind controller must be air)",
- "Structure must be at least 4 blocks tall, maximum 20.",
- "Each casing within the structure adds 128000L storage.",
- "Multitank Exterior Casings (16 at least!)",
- "Controller (front centered)",
- "1x Input hatch",
- "1x Output hatch",
- "1x Energy Hatch",
- };
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ */
+/*final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents");
+String xFluid = null;
+int xAmount = 0;
+if (gtCraftingComponentsTag.hasNoTags()){
+ if (this.internalStorageTank != null){
+ Utils.LOG_WARNING("mFluid was not null, Creating TileEntity NBT data.");
+ gtCraftingComponentsTag.setInteger("xAmount", this.internalStorageTank.amount);
+ gtCraftingComponentsTag.setString("xFluid", this.internalStorageTank.getFluid().getName());
+ aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag);
}
+}
+else {
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Screen_Logo : TexturesGtBlock.Overlay_Machine_Screen_Logo)};
- }
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11))};
- }
+ //internalCraftingComponentsTag = gtCraftingComponentsTag.getCompoundTag("backupTag");
- @Override
- public boolean hasSlotInGUI() {
- return false;
+ if (gtCraftingComponentsTag.hasKey("xFluid")){
+ Utils.LOG_WARNING("xFluid was not null, Loading TileEntity NBT data.");
+ xFluid = gtCraftingComponentsTag.getString("xFluid");
}
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return null;
+ if (gtCraftingComponentsTag.hasKey("xAmount")){
+ Utils.LOG_WARNING("xAmount was not null, Loading TileEntity NBT data.");
+ xAmount = gtCraftingComponentsTag.getInteger("xAmount");
}
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
+ if ((xFluid != null) && (xAmount != 0)){
+ Utils.LOG_WARNING("Setting Internal Tank, loading "+xAmount+"L of "+xFluid);
+ this.setInternalTank(xFluid, xAmount);
}
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
-
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- for (int i = 0; i < (tInputList.size() - 1); i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
- tInputList.remove(j--);
- } else {
- tInputList.remove(i--);
- break;
- }
- }
- }
- }
- final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
-
- final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
- for (int i = 0; i < (tFluidList.size() - 1); i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
- tFluidList.remove(j--);
- } else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
- }
- final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[1]), 0, 1);
-
- if (tFluids.length >= 2){
- Logger.WARNING("Bad");
- return false;
- }
-
- final ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>> rList = new ArrayList<>();
- int slotInputCount = 0;
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- boolean containsFluid = false;
- if (isValidMetaTileEntity(tHatch)) {
- slotInputCount++;
- for (int i=0; i<tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
- if (tHatch.canTankBeEmptied()){containsFluid=true;}
- }
- rList.add(new Pair<>(tHatch, containsFluid));
- }
- }
- if ((tFluids.length <= 0) || (slotInputCount > 1)){
- Logger.WARNING("Bad");
- return false;
- }
-
- Logger.WARNING("Okay - 2");
- if (this.internalStorageTank == null){
- Logger.WARNING("Okay - 3");
- if ((rList.get(0).getKey().mFluid != null) && (rList.get(0).getKey().mFluid.amount > 0)){
- Logger.WARNING("Okay - 4");
- Logger.WARNING("Okay - 1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount */
+}*//*
+
+ }
+
+ private boolean setInternalTank(final String fluidName, final int amount){
+ final FluidStack temp = FluidUtils.getFluidStack(fluidName, amount);
+ if (temp != null){
+ if (this.internalStorageTank == null){
+ this.internalStorageTank = temp;
+ Logger.WARNING(temp.getFluid().getName()+" Amount: "+temp.amount+"L");
+ }
+ else{
+ Logger.WARNING("Retained Fluid.");
+ Logger.WARNING(this.internalStorageTank.getFluid().getName()+" Amxount: "+this.internalStorageTank.amount+"L");
+ }
+ this.markDirty();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void onLeftclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ this.tryForceNBTUpdate();
+ super.onLeftclick(aBaseMetaTileEntity, aPlayer);
+ }
+
+ @Override
+ public boolean onWrenchRightClick(final byte aSide, final byte aWrenchingSide, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ) {
+ this.tryForceNBTUpdate();
+ return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
+ }
+
+ @Override
+ public void onRemoval() {
+ this.tryForceNBTUpdate();
+ super.onRemoval();
+ }
+
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ if ((this.internalStorageTank != null) && this.internalStorageTank.amount >= this.maximumFluidStorage){
+ if (this.internalStorageTank.amount > this.maximumFluidStorage){
+ this.internalStorageTank.amount = this.maximumFluidStorage;
+ }
+ this.stopMachine();
+ }
+
+ if (this.mInternalSaveClock != 20){
+ this.mInternalSaveClock++;
+ }
+ else {
+ this.mInternalSaveClock = 0;
+ this.tryForceNBTUpdate();
+ }
+
+ }
+
+ public GregtechMetaTileEntity_MultiTank(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_MultiTank(this.mName);
+ }
+
+ @Override
+ public String[] getTooltip() {
+ return new String[]{
+ "Controller Block for the Multitank",
+ "Size: 3xHx3 (Block behind controller must be air)",
+ "Structure must be at least 4 blocks tall, maximum 20.",
+ "Each casing within the structure adds 128000L storage.",
+ "Multitank Exterior Casings (16 at least!)",
+ "Controller (front centered)",
+ "1x Input hatch",
+ "1x Output hatch",
+ "1x Energy Hatch",
+ };
+ }
+
+ @Override
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Screen_Logo : TexturesGtBlock.Overlay_Machine_Screen_Logo)};
+ }
+ return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11))};
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+
+ final ArrayList<ItemStack> tInputList = this.getStoredInputs();
+ for (int i = 0; i < (tInputList.size() - 1); i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
+ if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
+ for (int i = 0; i < (tFluidList.size() - 1); i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
+ if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[1]), 0, 1);
+
+ if (tFluids.length >= 2){
+ Logger.WARNING("Bad");
+ return false;
+ }
+
+ final ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>> rList = new ArrayList<>();
+ int slotInputCount = 0;
+ for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
+ boolean containsFluid = false;
+ if (isValidMetaTileEntity(tHatch)) {
+ slotInputCount++;
+ for (int i=0; i<tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
+ if (tHatch.canTankBeEmptied()){containsFluid=true;}
+ }
+ rList.add(new Pair<>(tHatch, containsFluid));
+ }
+ }
+ if ((tFluids.length <= 0) || (slotInputCount > 1)){
+ Logger.WARNING("Bad");
+ return false;
+ }
+
+ Logger.WARNING("Okay - 2");
+ if (this.internalStorageTank == null){
+ Logger.WARNING("Okay - 3");
+ if ((rList.get(0).getKey().mFluid != null) && (rList.get(0).getKey().mFluid.amount > 0)){
+ Logger.WARNING("Okay - 4");
+ Logger.WARNING("Okay - 1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount */
/*+" internalStorageTank:"+internalStorageTank.amount*//*
-);
- final FluidStack tempFluidStack = rList.get(0).getKey().mFluid;
- final Fluid tempFluid = tempFluidStack.getFluid();
- this.internalStorageTank = FluidUtils.getFluidStack(tempFluid.getName(), tempFluidStack.amount);
- rList.get(0).getKey().mFluid.amount = 0;
- Logger.WARNING("Okay - 1.1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount +" internalStorageTank:"+this.internalStorageTank.amount);
- return true;
- }
- Logger.WARNING("No Fluid in hatch.");
- return false;
- }
- else if (this.internalStorageTank.isFluidEqual(rList.get(0).getKey().mFluid)){
- Logger.WARNING("Storing "+rList.get(0).getKey().mFluid.amount+"L");
- Logger.WARNING("Contains "+this.internalStorageTank.amount+"L");
-
-
- int tempAdd = 0;
- tempAdd = rList.get(0).getKey().getFluidAmount();
- rList.get(0).getKey().mFluid = null;
- Logger.WARNING("adding "+tempAdd);
- this.internalStorageTank.amount = this.internalStorageTank.amount + tempAdd;
- Logger.WARNING("Tank now Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+".");
-
-
- //Utils.LOG_WARNING("Tank");
- return true;
- }
- else {
- final FluidStack superTempFluidStack = rList.get(0).getKey().mFluid;
- Logger.WARNING("is input fluid equal to stored fluid? "+(this.internalStorageTank.isFluidEqual(superTempFluidStack)));
- if (superTempFluidStack != null) {
- Logger.WARNING("Input hatch[0] Contains "+superTempFluidStack.amount+"L of "+superTempFluidStack.getFluid().getName()+".");
- }
- Logger.WARNING("Large Multi-Tank Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+".");
-
- if (this.internalStorageTank.amount <= 0){
- Logger.WARNING("Internal Tank is empty, sitting idle.");
- return false;
- }
-
- if ((this.mOutputHatches.get(0).mFluid == null) || this.mOutputHatches.isEmpty() || (this.mOutputHatches.get(0).mFluid.isFluidEqual(this.internalStorageTank) && (this.mOutputHatches.get(0).mFluid.amount < this.mOutputHatches.get(0).getCapacity()))){
- Logger.WARNING("Okay - 3");
- final int tempCurrentStored = this.internalStorageTank.amount;
- int tempResult = 0;
- final int tempHatchSize = this.mOutputHatches.get(0).getCapacity();
- final int tempHatchCurrentHolding = this.mOutputHatches.get(0).getFluidAmount();
- final int tempHatchRemainingSpace = tempHatchSize - tempHatchCurrentHolding;
- final FluidStack tempOutputFluid = this.internalStorageTank;
- if (tempHatchRemainingSpace <= 0){
- return false;
- }
- Logger.WARNING("Okay - 3.1.x"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left.");
-
- if (tempHatchSize >= tempHatchRemainingSpace){
- Logger.WARNING("Okay - 3.1.1"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left.");
-
- int adder;
- if ((tempCurrentStored > 0) && (tempCurrentStored <= tempHatchSize)){
- adder = tempCurrentStored;
- if (adder >= tempHatchRemainingSpace){
- adder = tempHatchRemainingSpace;
- }
- }
- else {
- adder = 0;
- if (tempCurrentStored >= tempHatchRemainingSpace){
- adder = tempHatchRemainingSpace;
- }
- }
-
- tempResult = adder;
- tempOutputFluid.amount = tempResult;
- Logger.WARNING("Okay - 3.1.2"+" result: "+tempResult +" tempCurrentStored: "+tempCurrentStored + " filling output hatch with: "+tempOutputFluid.amount+"L of "+tempOutputFluid.getFluid().getName());
- this.mOutputHatches.get(0).fill(tempOutputFluid, true);
- //mOutputHatches.get(0).mFluid.amount = tempResult;
- this.internalStorageTank.amount = (tempCurrentStored-adder);
- Logger.WARNING("Okay - 3.1.3"+" internalTankStorage: "+this.internalStorageTank.amount +"L | output hatch contains: "+this.mOutputHatches.get(0).mFluid.amount+"L of "+this.mOutputHatches.get(0).mFluid.getFluid().getName());
- */
+ );
+ final FluidStack tempFluidStack = rList.get(0).getKey().mFluid;
+ final Fluid tempFluid = tempFluidStack.getFluid();
+ this.internalStorageTank = FluidUtils.getFluidStack(tempFluid.getName(), tempFluidStack.amount);
+ rList.get(0).getKey().mFluid.amount = 0;
+ Logger.WARNING("Okay - 1.1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount +" internalStorageTank:"+this.internalStorageTank.amount);
+ return true;
+ }
+ Logger.WARNING("No Fluid in hatch.");
+ return false;
+ }
+ else if (this.internalStorageTank.isFluidEqual(rList.get(0).getKey().mFluid)){
+ Logger.WARNING("Storing "+rList.get(0).getKey().mFluid.amount+"L");
+ Logger.WARNING("Contains "+this.internalStorageTank.amount+"L");
+
+
+ int tempAdd = 0;
+ tempAdd = rList.get(0).getKey().getFluidAmount();
+ rList.get(0).getKey().mFluid = null;
+ Logger.WARNING("adding "+tempAdd);
+ this.internalStorageTank.amount = this.internalStorageTank.amount + tempAdd;
+ Logger.WARNING("Tank now Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+".");
+
+
+ //Utils.LOG_WARNING("Tank");
+ return true;
+ }
+ else {
+ final FluidStack superTempFluidStack = rList.get(0).getKey().mFluid;
+ Logger.WARNING("is input fluid equal to stored fluid? "+(this.internalStorageTank.isFluidEqual(superTempFluidStack)));
+ if (superTempFluidStack != null) {
+ Logger.WARNING("Input hatch[0] Contains "+superTempFluidStack.amount+"L of "+superTempFluidStack.getFluid().getName()+".");
+ }
+ Logger.WARNING("Large Multi-Tank Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+".");
+
+ if (this.internalStorageTank.amount <= 0){
+ Logger.WARNING("Internal Tank is empty, sitting idle.");
+ return false;
+ }
+
+ if ((this.mOutputHatches.get(0).mFluid == null) || this.mOutputHatches.isEmpty() || (this.mOutputHatches.get(0).mFluid.isFluidEqual(this.internalStorageTank) && (this.mOutputHatches.get(0).mFluid.amount < this.mOutputHatches.get(0).getCapacity()))){
+ Logger.WARNING("Okay - 3");
+ final int tempCurrentStored = this.internalStorageTank.amount;
+ int tempResult = 0;
+ final int tempHatchSize = this.mOutputHatches.get(0).getCapacity();
+ final int tempHatchCurrentHolding = this.mOutputHatches.get(0).getFluidAmount();
+ final int tempHatchRemainingSpace = tempHatchSize - tempHatchCurrentHolding;
+ final FluidStack tempOutputFluid = this.internalStorageTank;
+ if (tempHatchRemainingSpace <= 0){
+ return false;
+ }
+ Logger.WARNING("Okay - 3.1.x"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left.");
+
+ if (tempHatchSize >= tempHatchRemainingSpace){
+ Logger.WARNING("Okay - 3.1.1"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left.");
+
+ int adder;
+ if ((tempCurrentStored > 0) && (tempCurrentStored <= tempHatchSize)){
+ adder = tempCurrentStored;
+ if (adder >= tempHatchRemainingSpace){
+ adder = tempHatchRemainingSpace;
+ }
+ }
+ else {
+ adder = 0;
+ if (tempCurrentStored >= tempHatchRemainingSpace){
+ adder = tempHatchRemainingSpace;
+ }
+ }
+
+ tempResult = adder;
+ tempOutputFluid.amount = tempResult;
+ Logger.WARNING("Okay - 3.1.2"+" result: "+tempResult +" tempCurrentStored: "+tempCurrentStored + " filling output hatch with: "+tempOutputFluid.amount+"L of "+tempOutputFluid.getFluid().getName());
+ this.mOutputHatches.get(0).fill(tempOutputFluid, true);
+ //mOutputHatches.get(0).mFluid.amount = tempResult;
+ this.internalStorageTank.amount = (tempCurrentStored-adder);
+ Logger.WARNING("Okay - 3.1.3"+" internalTankStorage: "+this.internalStorageTank.amount +"L | output hatch contains: "+this.mOutputHatches.get(0).mFluid.amount+"L of "+this.mOutputHatches.get(0).mFluid.getFluid().getName());
+ */
/*if (internalStorageTank.amount <= 0)
- internalStorageTank = null;*//*
-
- }
- Logger.WARNING("Tank ok.");
- return true;
- }
- }
- //this.getBaseMetaTileEntity().(tFluids[0].amount, true);
- Logger.WARNING("Tank");
- return false;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
+internalStorageTank = null;*//*
+
+ }
+ Logger.WARNING("Tank ok.");
+ return true;
+ }
+ }
+ //this.getBaseMetaTileEntity().(tFluids[0].amount, true);
+ Logger.WARNING("Tank");
+ return false;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
+ final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ Logger.WARNING("Must be hollow.");
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 19; h++) {
+ if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) {
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ if (h < 3){
+ Logger.WARNING("Casing Expected.");
+ return false;
+ }
+ else if (h >= 3){
+ //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
+ }
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 11) {
+ if (h < 3){
+ Logger.WARNING("Wrong Meta.");
+ return false;
+ }
+ else if (h >= 3){
+ //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
+ }
+ }
+ if (h < 3){
+ tAmount++;
+ }
+ else if (h >= 3){
+ if ((aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air) || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){
+ Logger.WARNING("Found air");
+ }
+ else {
+ Logger.WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank.");
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ this.multiblockCasingCount = (short) tAmount;
+ this.maximumFluidStorage = getMaximumTankStorage(tAmount);
+ Logger.INFO("Your Multitank can be 20 blocks tall.");
+ Logger.INFO("Casings Count: "+this.multiblockCasingCount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+this.maximumFluidStorage+"L");
+ this.tryForceNBTUpdate();
+ return tAmount >= 16;
+ }
+
+ */
+/*public int countCasings() {
+ Utils.LOG_INFO("Counting Machine Casings");
+ try{
+ if (this.getBaseMetaTileEntity().getWorld() == null){
+ Utils.LOG_INFO("Tile Entity's world was null for casing count.");
+ return 0;
}
-
- @Override
- public int getEuDiscountForParallelism() {
+ if (this.getBaseMetaTileEntity() == null){
+ Utils.LOG_INFO("Tile Entity was null for casing count.");
return 0;
}
-
- @Override
- public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- Logger.WARNING("Must be hollow.");
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 19; h++) {
- if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- if (h < 3){
- Logger.WARNING("Casing Expected.");
- return false;
- }
- else if (h >= 3){
- //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
- }
+ } catch(NullPointerException r){
+ Utils.LOG_INFO("Null Pointer Exception caught.");
+ return 0;
+ }
+ int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ if (!this.getBaseMetaTileEntity().getAirOffset(xDir, 0, zDir)) {
+ Utils.LOG_INFO("Failed due to air being misplaced.");
+ Utils.LOG_WARNING("Must be hollow.");
+ return 0;
+ }
+ int tAmount = 0;
+ Utils.LOG_INFO("Casing Count set to 0.");
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 19; h++) {
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) {
+ if (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ if (h < 3){
+ Utils.LOG_WARNING("Casing Expected.");
+ return 0;
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 11) {
- if (h < 3){
- Logger.WARNING("Wrong Meta.");
- return false;
- }
- else if (h >= 3){
- //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
- }
+ else if (h >= 3){
+ //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
}
+ }
+ if (this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, h, zDir + j) != 11) {
if (h < 3){
- tAmount++;
+ Utils.LOG_WARNING("Wrong Meta.");
+ return 0;
}
else if (h >= 3){
- if ((aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air) || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){
- Logger.WARNING("Found air");
- }
- else {
- Logger.WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank.");
- tAmount++;
- }
+ //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
}
}
- }
- }
- }
- }
- this.multiblockCasingCount = (short) tAmount;
- this.maximumFluidStorage = getMaximumTankStorage(tAmount);
- Logger.INFO("Your Multitank can be 20 blocks tall.");
- Logger.INFO("Casings Count: "+this.multiblockCasingCount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+this.maximumFluidStorage+"L");
- this.tryForceNBTUpdate();
- return tAmount >= 16;
- }
-
- */
-/*public int countCasings() {
- Utils.LOG_INFO("Counting Machine Casings");
- try{
- if (this.getBaseMetaTileEntity().getWorld() == null){
- Utils.LOG_INFO("Tile Entity's world was null for casing count.");
- return 0;
- }
- if (this.getBaseMetaTileEntity() == null){
- Utils.LOG_INFO("Tile Entity was null for casing count.");
- return 0;
- }
- } catch(NullPointerException r){
- Utils.LOG_INFO("Null Pointer Exception caught.");
- return 0;
- }
- int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ;
- if (!this.getBaseMetaTileEntity().getAirOffset(xDir, 0, zDir)) {
- Utils.LOG_INFO("Failed due to air being misplaced.");
- Utils.LOG_WARNING("Must be hollow.");
- return 0;
- }
- int tAmount = 0;
- Utils.LOG_INFO("Casing Count set to 0.");
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 19; h++) {
- if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
- IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) {
- if (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- if (h < 3){
- Utils.LOG_WARNING("Casing Expected.");
- return 0;
- }
- else if (h >= 3){
- //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
- }
- }
- if (this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, h, zDir + j) != 11) {
- if (h < 3){
- Utils.LOG_WARNING("Wrong Meta.");
- return 0;
- }
- else if (h >= 3){
- //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
- }
+ if (h < 3){
+ tAmount++;
+ }
+ else if (h >= 3){
+ if (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) == Blocks.air || this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){
+ Utils.LOG_WARNING("Found air");
}
- if (h < 3){
+ else {
+ Utils.LOG_WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank.");
tAmount++;
}
- else if (h >= 3){
- if (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) == Blocks.air || this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){
- Utils.LOG_WARNING("Found air");
- }
- else {
- Utils.LOG_WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank.");
- tAmount++;
- }
- }
}
}
}
}
}
- Utils.LOG_INFO("Finished counting.");
- multiblockCasingCount = (short) tAmount;
- //Utils.LOG_INFO("Your Multitank can be 20 blocks tall.");
- Utils.LOG_INFO("Casings Count: "+tAmount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+getMaximumTankStorage(tAmount)+"L");
- return tAmount;
- }*//*
-
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 5;
}
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ Utils.LOG_INFO("Finished counting.");
+ multiblockCasingCount = (short) tAmount;
+ //Utils.LOG_INFO("Your Multitank can be 20 blocks tall.");
+ Utils.LOG_INFO("Casings Count: "+tAmount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+getMaximumTankStorage(tAmount)+"L");
+ return tAmount;
+}*//*
+
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 5;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ private static short getStorageMultiplier(final int casingCount){
+ final int tsm = 1*casingCount;
+ if (tsm <= 0){
+ return 1;
+ }
+ return (short) tsm;
+ }
+
+ private static int getMaximumTankStorage(final int casingCount){
+ final int multiplier = getStorageMultiplier(casingCount);
+ final int tempTankStorageMax = 128000*multiplier;
+ if (tempTankStorageMax <= 0){return 128000;}
+ return tempTankStorageMax;
+ }
+
+ private boolean tryForceNBTUpdate(){
+ */
+/*
+//Block is invalid.
+if ((this == null) || (this.getBaseMetaTileEntity() == null)){
+ Utils.LOG_WARNING("Block was not valid for saving data.");
+ return false;
+}
+
+//Don't need this to run clientside.
+if (!this.getBaseMetaTileEntity().isServerSide()) {
+ return false;
+}
+
+//Internal Tag was not valid.
+try{
+ if (this.internalCraftingComponentsTag == null){
+ Utils.LOG_WARNING("Internal NBT data tag was null.");
return false;
}
+} catch (final NullPointerException x){
+ Utils.LOG_WARNING("Caught null NBT.");
+}
- private static short getStorageMultiplier(final int casingCount){
- final int tsm = 1*casingCount;
- if (tsm <= 0){
- return 1;
- }
- return (short) tsm;
- }
-
- private static int getMaximumTankStorage(final int casingCount){
- final int multiplier = getStorageMultiplier(casingCount);
- final int tempTankStorageMax = 128000*multiplier;
- if (tempTankStorageMax <= 0){return 128000;}
- return tempTankStorageMax;
- }
-
- private boolean tryForceNBTUpdate(){
-*/
-/*
- //Block is invalid.
- if ((this == null) || (this.getBaseMetaTileEntity() == null)){
- Utils.LOG_WARNING("Block was not valid for saving data.");
- return false;
- }
-
- //Don't need this to run clientside.
- if (!this.getBaseMetaTileEntity().isServerSide()) {
- return false;
- }
-
- //Internal Tag was not valid.
- try{
- if (this.internalCraftingComponentsTag == null){
- Utils.LOG_WARNING("Internal NBT data tag was null.");
- return false;
- }
- } catch (final NullPointerException x){
- Utils.LOG_WARNING("Caught null NBT.");
- }
+//Internal tag was valid.
+this.saveNBTData(this.internalCraftingComponentsTag);
- //Internal tag was valid.
- this.saveNBTData(this.internalCraftingComponentsTag);
+//Mark block for update
+int x,y,z = 0;
+x = this.getBaseMetaTileEntity().getXCoord();
+y = this.getBaseMetaTileEntity().getYCoord();
+z = this.getBaseMetaTileEntity().getZCoord();
+this.getBaseMetaTileEntity().getWorld().markBlockForUpdate(x, y, z);
- //Mark block for update
- int x,y,z = 0;
- x = this.getBaseMetaTileEntity().getXCoord();
- y = this.getBaseMetaTileEntity().getYCoord();
- z = this.getBaseMetaTileEntity().getZCoord();
- this.getBaseMetaTileEntity().getWorld().markBlockForUpdate(x, y, z);
+//Mark block dirty, let chunk know it's data has changed and it must be saved to disk. (Albeit slowly)
+this.getBaseMetaTileEntity().markDirty();*//*
- //Mark block dirty, let chunk know it's data has changed and it must be saved to disk. (Albeit slowly)
- this.getBaseMetaTileEntity().markDirty();*//*
-
- return true;
- }
-}*/
+ return true;
+ }
+ }*/
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java
index 57f0b83100..3f62a67101 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java
@@ -1,6 +1,13 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage;
-import java.util.function.Consumer;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
+import static gregtech.api.enums.GT_HatchElement.Dynamo;
+import static gregtech.api.enums.GT_HatchElement.Energy;
+import static gregtech.api.enums.GT_HatchElement.Maintenance;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
+import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
+import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTEnergy;
import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
@@ -31,6 +38,7 @@ import gtPlusPlus.preloader.asm.AsmConfig;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_PowerSubStation;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_PowerSubStation;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import java.util.function.Consumer;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -42,750 +50,767 @@ import net.minecraft.util.IChatComponent;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants.NBT;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
-import static gregtech.api.enums.GT_HatchElement.Dynamo;
-import static gregtech.api.enums.GT_HatchElement.Energy;
-import static gregtech.api.enums.GT_HatchElement.Maintenance;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
-import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
-import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo;
-import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTEnergy;
-
-public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_PowerSubStationController> implements ISurvivalConstructable {
-
- private static enum TopState {
- MayBeTop,
- Top,
- NotTop
- }
- protected long mAverageEuUsage = 0;
- protected final MovingAverageLong mAverageEuAdded = new MovingAverageLong(20);
- protected final MovingAverageLong mAverageEuConsumed = new MovingAverageLong(20);
- protected long mTotalEnergyAdded = 0;
- protected long mTotalEnergyConsumed = 0;
- protected long mTotalEnergyLost = 0;
- protected boolean mIsOutputtingPower = false;
- protected long mBatteryCapacity = 0;
-
- private final int ENERGY_TAX = 5;
-
- private int mCasing;
- private int[] cellCount = new int[6];
- private TopState topState = TopState.MayBeTop;
- private static IStructureDefinition<GregtechMetaTileEntity_PowerSubStationController> STRUCTURE_DEFINITION = null;
-
- public GregtechMetaTileEntity_PowerSubStationController(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_PowerSubStationController(final String aName) {
- super(aName);
- }
-
- @Override
- public String getMachineType() {
- return "Energy Buffer";
- }
-
- @Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType(getMachineType())
- .addInfo("Consumes " + this.ENERGY_TAX + "% of the average voltage of all energy type hatches")
- .addInfo("Does not require maintenance")
- .addInfo("Can be built with variable height between " + (CELL_HEIGHT_MIN + 2) + "-" + (CELL_HEIGHT_MAX + 2) + "")
- .addInfo("Hatches can be placed nearly anywhere")
- .addInfo("HV Energy/Dynamo Hatches are the lowest tier you can use")
- .addInfo("Supports voltages >= UHV using MAX tier components.")
- .addSeparator()
- .addController("Bottom Center")
- .addCasingInfo("Sub-Station External Casings", 10)
- .addDynamoHatch("Any Casing", 1)
- .addEnergyHatch("Any Casing", 1)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
- return tt;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)),
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER)};
- }
- if (aSide == this.getBaseMetaTileEntity().getBackFacing()) {
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)),
- mIsOutputtingPower ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()] : Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()]};
- }
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(23))};
- }
-
- @Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
- public String getCustomGUIResourceName() {
- return null;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- //if (mBatteryCapacity <= 0) return false;
- if (!aBaseMetaTileEntity.isClientSide()) {
- aBaseMetaTileEntity.openGUI(aPlayer);
- }
- return true;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_PowerSubStation(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "Ergon Energy - Sub Station");
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_PowerSubStation(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- private void checkMachineProblem(String msg, int xOff, int yOff, int zOff) {
- final IGregTechTileEntity te = this.getBaseMetaTileEntity();
- final Block tBlock = te.getBlockOffset(xOff, yOff, zOff);
- final byte tMeta = te.getMetaIDOffset(xOff, yOff, zOff);
- String name = tBlock.getLocalizedName();
- String problem = msg + ": (" + xOff + ", " + yOff + ", " + zOff + ") " + name + ":" + tMeta;
- checkMachineProblem(problem);
- }
- private void checkMachineProblem(String msg) {
- if (!AsmConfig.disableAllLogging) {
- Logger.INFO("Power Sub-Station problem: " + msg);
- }
- }
-
- public static int getCellTier(Block aBlock, int aMeta) {
- if (aBlock == ModBlocks.blockCasings2Misc && aMeta == 7) {
- return 4;
- } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 4) {
- return 5;
- } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 5) {
- return 6;
- } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 6) {
- return 7;
- } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 7) {
- return 8;
- } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 8) {
- return 9;
- } else {
- return -1;
- }
- }
-
- public static int getMetaFromTier(int tier) {
- if (tier == 4) return 7;
- if (tier >= 5 && tier <= 9) return tier - 1;
- return 0;
- }
-
- public static Block getBlockFromTier(int tier) {
- switch (tier) {
- case 4: return ModBlocks.blockCasings2Misc;
- case 5: case 6: case 7: case 8: case 9: return ModBlocks.blockCasings3Misc;
- default: return null;
- }
- }
-
- public static int getMaxHatchTier(int aCellTier) {
- switch(aCellTier) {
- case 9:
- return GT_Values.VOLTAGE_NAMES[9].equals("Ultimate High Voltage") ? 15 : 9;
- default:
- if (aCellTier < 4) {
- return 0;
- }
- else {
- return aCellTier;
- }
- }
- }
-
- public static final int CELL_HEIGHT_MAX = 16;
- public static final int CELL_HEIGHT_MIN = 2;
-
- @Override
- public IStructureDefinition<GregtechMetaTileEntity_PowerSubStationController> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_PowerSubStationController>builder()
- .addShape(mName + "bottom", transpose(new String[][]{
- {"CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"}
- }))
- .addShape(mName + "layer", transpose(new String[][]{
- {"CCCCC", "CIIIC", "CIIIC", "CIIIC", "CCCCC"}
- }))
- .addShape(mName + "mid", transpose(new String[][]{
- {"CCCCC", "CHHHC", "CHHHC", "CHHHC", "CCCCC"}
- }))
- .addShape(mName + "top", transpose(new String[][]{
- {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"}
- }))
- .addElement(
- 'C',
- buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class)
- .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance)
- .casingIndex(TAE.GTPP_INDEX(24))
- .dot(1)
- .buildAndChain(
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasings2Misc, 8
- )
- )
- )
- )
- .addElement(
- 'I',
- ofChain(
- onlyIf(
- x -> x.topState != TopState.NotTop,
- onElementPass(
- x -> x.topState = TopState.Top,
- ofHatchAdderOptional(GregtechMetaTileEntity_PowerSubStationController::addPowerSubStationList, TAE.GTPP_INDEX(24), 1, ModBlocks.blockCasings2Misc, 8)
- )
- ),
- onlyIf(
- x -> x.topState != TopState.Top,
- onElementPass(
- x -> x.topState = TopState.NotTop,
- ofChain(
- onElementPass(
- x -> ++x.cellCount[0],
- ofCell(4)
- ),
- onElementPass(
- x -> ++x.cellCount[1],
- ofCell(5)
- ),
- onElementPass(
- x -> ++x.cellCount[2],
- ofCell(6)
- ),
- onElementPass(
- x -> ++x.cellCount[3],
- ofCell(7)
- ),
- onElementPass(
- x -> ++x.cellCount[4],
- ofCell(8)
- ),
- onElementPass(
- x -> ++x.cellCount[5],
- ofCell(9)
- )
- )
- )
- )
- )
- )
- .addElement('H', ofCell(4))
- .build();
- }
- return STRUCTURE_DEFINITION;
- }
-
- public static <T> IStructureElement<T> ofCell(int aIndex) {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block block = world.getBlock(x, y, z);
- int meta = world.getBlockMetadata(x, y, z);
- int tier = getCellTier(block, meta);
- return aIndex == tier;
- }
-
- public int getIndex(int size) {
- if (size > 6) size = 6;
- return size + 3;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- StructureLibAPI.hintParticle(world, x, y, z, getBlockFromTier(getIndex(trigger.stackSize)), getMetaFromTier(getIndex(trigger.stackSize)));
- return true;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return world.setBlock(x, y, z, getBlockFromTier(getIndex(trigger.stackSize)), getMetaFromTier(getIndex(trigger.stackSize)), 3);
- }
-
- @Override
- public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
- Block block = world.getBlock(x, y, z);
- int meta = world.getBlockMetadata(x, y, z);
- int tier = getCellTier(block, meta);
- if (tier >= 0) return PlaceResult.SKIP;
- return StructureUtility.survivalPlaceBlock(getBlockFromTier(getIndex(trigger.stackSize)), getMetaFromTier(getIndex(trigger.stackSize)), world, x, y, z, s, actor, chatter);
- }
- };
- }
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly) {
- int layer = Math.min(stackSize.stackSize + 3, 18);
- log("Layer: "+layer);
- log("Building 0");
- buildPiece(mName + "bottom" , stackSize, hintsOnly, 2, 0, 0);
- log("Built 0");
- for (int i = 1; i < layer - 1; i++) {
- log("Building "+i);
- buildPiece(mName + "mid", stackSize, hintsOnly, 2, i, 0);
- log("Built "+i);
- }
- log("Building "+(layer - 1));
- buildPiece(mName + "top", stackSize, hintsOnly, 2, layer - 1, 0);
- log("Built "+(layer - 1));
- }
-
- @Override
- public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
- if (mMachine) return -1;
- int layer = Math.min(stackSize.stackSize + 3, 18);
- int built;
- built = survivialBuildPiece(mName + "bottom", stackSize, 2, 0, 0, elementBudget, source, actor, false, true);
- if (built >= 0) return built;
- for (int i = 1; i < layer - 1; i++) {
- built = survivialBuildPiece(mName + "mid", stackSize, 2, i, 0, elementBudget, source, actor, false, true);
- if (built >= 0) return built;
- }
- return survivialBuildPiece(mName + "top", stackSize, 2, layer - 1, 0, elementBudget, source, actor, false, true);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
- mEnergyHatches.clear();
- mDynamoHatches.clear();
- mTecTechEnergyHatches.clear();
- mTecTechDynamoHatches.clear();
- mAllEnergyHatches.clear();
- mAllDynamoHatches.clear();
- for (int i = 0; i < 6; i++) {
- cellCount[i] = 0;
- }
- log("Checking 0");
- if (!checkPiece(mName + "bottom", 2, 0, 0)) {
- log("Failed on Layer 0");
- return false;
- }
- log("Pass 0");
- int layer = 1;
- topState = TopState.MayBeTop;
- while (true) {
- if (!checkPiece(mName + "layer", 2, layer, 0))
- return false;
- layer ++;
- if (topState == TopState.Top)
- break; // top found, break out
- topState = TopState.MayBeTop;
- if (layer > 18)
- return false; // too many layers
- }
- int level = 0;
- for (int i = 0; i < 6; i++) {
- if (cellCount[i] != 0) {
- if (level == 0) {
- level = i + 4;
- }
- else {
- return false;
- }
- }
- }
- int tier = getMaxHatchTier(level);
- long volSum = 0;
- for (GT_MetaTileEntity_Hatch hatch : mAllDynamoHatches) {
- if (hatch.mTier > tier || hatch.mTier < 3) {
- return false;
- }
- volSum += (8L << (hatch.mTier * 2));
- }
- for (GT_MetaTileEntity_Hatch hatch : mAllEnergyHatches) {
- if (hatch.mTier > tier || hatch.mTier < 3) {
- return false;
- }
- volSum += (8L << (hatch.mTier * 2));
- }
- mBatteryCapacity = getCapacityFromCellTier(level) * cellCount[level - 4];
- if (mAllEnergyHatches.size() + mAllDynamoHatches.size() > 0) {
- mAverageEuUsage = volSum / (mAllEnergyHatches.size() + mAllDynamoHatches.size());
- }
- else mAverageEuUsage = 0;
- fixAllMaintenanceIssue();
- return true;
- }
-
- public final boolean addPowerSubStationList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- else if (LoadedMods.TecTech) {
- if (isThisHatchMultiDynamo(aMetaTileEntity)) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- } else if (isThisHatchMultiEnergy(aMetaTileEntity)) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
- }
- }
- }
- return false;
- }
-
- // Define storage capacity of smallest cell tier (EV) and compute higher tiers from it
- private static final long CELL_TIER_EV_CAPACITY = 100 * 1000 * 1000;
- private static final long CELL_TIER_MULTIPLIER = 4; // each tier's capacity is this many times the previous tier
-
- public static long getCapacityFromCellTier(int aOverallCellTier) {
- // Use integer math instead of `Math.pow` to avoid range/precision errors
- if (aOverallCellTier < 4) return 0;
- aOverallCellTier -= 4;
- long capacity = CELL_TIER_EV_CAPACITY;
- while (aOverallCellTier > 0) {
- capacity *= CELL_TIER_MULTIPLIER;
- aOverallCellTier--;
- }
- return capacity;
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_PowerSubStationController(this.mName);
- }
-
- //mTotalEnergyAdded
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setLong("mAverageEuUsage", this.mAverageEuUsage);
- this.mAverageEuAdded.write(aNBT, "mAverageEuAdded");
- this.mAverageEuConsumed.write(aNBT, "mAverageEuConsumed");
-
- //Usage Stats
- aNBT.setLong("mTotalEnergyAdded", this.mTotalEnergyAdded);
- aNBT.setLong("mTotalEnergyLost", this.mTotalEnergyLost);
- aNBT.setLong("mTotalEnergyConsumed", this.mTotalEnergyConsumed);
- aNBT.setLong("mTotalRunTime", this.mTotalRunTime);
- aNBT.setBoolean("mIsOutputtingPower", this.mIsOutputtingPower);
- aNBT.setLong("mBatteryCapacity", this.mBatteryCapacity);
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
-
- // Best not to get a long if the Tag Map is holding an int
- if (aNBT.hasKey("mAverageEuUsage")) {
- this.mAverageEuUsage = aNBT.getLong("mAverageEuUsage");
- }
- switch (aNBT.func_150299_b("mAverageEuAdded")) {
- case NBT.TAG_BYTE_ARRAY:
- this.mAverageEuAdded.read(aNBT, "mAverageEuAdded");
- break;
- case NBT.TAG_LONG:
- this.mAverageEuAdded.set(aNBT.getLong("mAverageEuAdded"));
- break;
- }
- switch (aNBT.func_150299_b("mAverageEuConsumed")) {
- case NBT.TAG_BYTE_ARRAY:
- this.mAverageEuConsumed.read(aNBT, "mAverageEuConsumed");
- break;
- case NBT.TAG_LONG:
- this.mAverageEuConsumed.set(aNBT.getLong("mAverageEuConsumed"));
- break;
- }
-
- //Usage Stats
- this.mTotalEnergyAdded = aNBT.getLong("mTotalEnergyAdded");
- this.mTotalEnergyLost = aNBT.getLong("mTotalEnergyLost");
- this.mTotalEnergyConsumed = aNBT.getLong("mTotalEnergyConsumed");
- this.mTotalRunTime = aNBT.getLong("mTotalRunTime");
-
- this.mIsOutputtingPower = aNBT.getBoolean("mIsOutputtingPower");
-
- this.mBatteryCapacity = aNBT.getLong("mBatteryCapacity");
-
- super.loadNBTData(aNBT);
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- this.mProgresstime = 0;
- this.mMaxProgresstime = 200;
- this.mEUt = 0;
- this.mEfficiencyIncrease = 10000;
- this.fixAllMaintenanceIssue();
- return true;
- }
-
- @Override
- public int getMaxParallelRecipes() {
- return 1;
- }
-
- @Override
- public int getEuDiscountForParallelism() {
- return 0;
- }
-
- private long drawEnergyFromHatch(MetaTileEntity aHatch) {
- if (!isValidMetaTileEntity(aHatch)) {
- return 0;
- }
-
- long stored = aHatch.getEUVar();
- long voltage = aHatch.maxEUInput() * aHatch.maxAmperesIn();
-
- if (voltage > stored) {
- return 0;
- }
-
- if (this.getBaseMetaTileEntity().increaseStoredEnergyUnits(voltage, false)) {
- aHatch.setEUVar((stored - voltage));
- this.mTotalEnergyAdded += voltage;
- return voltage;
- }
- return 0;
- }
-
- private long addEnergyToHatch(MetaTileEntity aHatch) {
- if (!isValidMetaTileEntity(aHatch)) {
- return 0;
- }
-
- long voltage = aHatch.maxEUOutput() * aHatch.maxAmperesOut();
-
- if (aHatch.getEUVar() > aHatch.maxEUStore() - voltage) {
- return 0;
- }
-
- if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(voltage, false)) {
- aHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(voltage, false);
- this.mTotalEnergyConsumed+=voltage;
- return voltage;
- }
- return 0;
- }
-
- private long computeEnergyTax() {
- float mTax = mAverageEuUsage * (ENERGY_TAX / 100f);
-
- // Increase tax up to 2x if machine is not fully repaired
- mTax = mTax * (1f + (10000f - mEfficiency) / 10000f);
-
- return MathUtils.roundToClosestLong(mTax);
- }
-
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- this.fixAllMaintenanceIssue();
- }
-
- @Override
- public boolean onRunningTick(ItemStack aStack) {
- // First, decay overcharge (1% of stored energy plus 1000 EU per tick)
- if (this.getEUVar() > this.mBatteryCapacity) {
- long energy = (long) (this.getEUVar() * 0.990f) - 1000;
- this.setEUVar(energy);
- }
-
- // Pay Tax
- long mDecrease = computeEnergyTax();
- this.mTotalEnergyLost += Math.min(mDecrease, this.getEUVar());
- this.setEUVar(Math.max(0, this.getEUVar() - mDecrease));
-
- long aInputAverage = 0;
- long aOutputAverage = 0;
- // Input Power
- for (GT_MetaTileEntity_Hatch THatch : this.mDischargeHatches) {
- aInputAverage += drawEnergyFromHatch(THatch);
- }
- for (GT_MetaTileEntity_Hatch tHatch : this.mAllEnergyHatches) {
- aInputAverage += drawEnergyFromHatch(tHatch);
- }
-
- // Output Power
- for (GT_MetaTileEntity_Hatch THatch : this.mChargeHatches) {
- aOutputAverage += addEnergyToHatch(THatch);
- }
- for (GT_MetaTileEntity_Hatch tHatch : this.mAllDynamoHatches) {
- aOutputAverage += addEnergyToHatch(tHatch);
- }
- // reset progress time
- mProgresstime = 0;
-
- this.mAverageEuAdded.sample(aInputAverage);
- this.mAverageEuConsumed.sample(aOutputAverage);
-
- return true;
-
- }
-
- @Override
- public boolean drainEnergyInput(long aEU) {
- // Not applicable to this machine
- return true;
- }
-
- @Override
- public boolean addEnergyOutput(long aEU) {
- // Not applicable to this machine
- return true;
- }
-
- @Override
- public long maxEUStore() {
- return mBatteryCapacity;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 0;
- }
-
- @Override
- public String[] getExtraInfoData() {
- String mode;
- if (mIsOutputtingPower) {
- mode = EnumChatFormatting.GOLD + "Output" + EnumChatFormatting.RESET;
- } else {
- mode = EnumChatFormatting.BLUE + "Input" + EnumChatFormatting.RESET;
- }
-
- String storedEnergyText;
- if (this.getEUVar() > this.mBatteryCapacity) {
- storedEnergyText = EnumChatFormatting.RED + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET;
- } else {
- storedEnergyText = EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET;
- }
-
- int errorCode = this.getBaseMetaTileEntity().getErrorDisplayID();
- boolean mMaint = (errorCode != 0);
-
- return new String[]{
- "Ergon Energy - District Sub-Station",
- "Stored EU: " + storedEnergyText,
- "Capacity: " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.maxEUStore()) + EnumChatFormatting.RESET,
- "Running Costs: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.computeEnergyTax()) + EnumChatFormatting.RESET + " EU/t",
- "Controller Mode: " + mode,
- "Requires Maintenance: " + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED)+ mMaint + EnumChatFormatting.RESET +" | Code: ["+(!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + errorCode + EnumChatFormatting.RESET +"]",
- "----------------------",
- "Stats for Nerds",
- "Average Input: " + EnumChatFormatting.BLUE + this.mAverageEuAdded + EnumChatFormatting.RESET + " EU",
- "Average Output: " + EnumChatFormatting.GOLD + this.mAverageEuConsumed + EnumChatFormatting.RESET + " EU",
- "Total Input: " + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(this.mTotalEnergyAdded) + EnumChatFormatting.RESET + " EU",
- "Total Output: " + EnumChatFormatting.GOLD + GT_Utility.formatNumbers(this.mTotalEnergyConsumed) + EnumChatFormatting.RESET + " EU",
- "Total Costs: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.mTotalEnergyLost) + EnumChatFormatting.RESET + " EU",
- };
- }
-
- @Override
- public void explodeMultiblock() {
- // TODO Auto-generated method stub
- super.explodeMultiblock();
- }
-
- @Override
- public void doExplosion(long aExplosionPower) {
- // TODO Auto-generated method stub
- super.doExplosion(aExplosionPower);
- }
-
- @Override
- public long getMaxInputVoltage() {
- return 32768;
- }
-
- @Override
- public boolean isElectric() {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return !mIsOutputtingPower;
- }
-
- @Override
- public boolean isEnetOutput() {
- return mIsOutputtingPower;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return (aSide == this.getBaseMetaTileEntity().getBackFacing() && !mIsOutputtingPower);
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return (aSide == this.getBaseMetaTileEntity().getBackFacing() && mIsOutputtingPower);
- }
-
- @Override
- public long maxAmperesIn() {
- return 32;
- }
-
- @Override
- public long maxAmperesOut() {
- return 32;
- }
-
- @Override
- public long maxEUInput() {
- return 32768;
- }
-
- @Override
- public long maxEUOutput() {
- return 32768;
- }
-
- public final long getAverageEuAdded() {
- return this.mAverageEuAdded.get();
- }
-
- public final long getAverageEuConsumed() {
- return this.mAverageEuConsumed.get();
- }
-
- @Override
- public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- mIsOutputtingPower = Utils.invertBoolean(mIsOutputtingPower);
- if (mIsOutputtingPower) {
- PlayerUtils.messagePlayer(aPlayer, "Sub-Station is now outputting power from the controller.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Sub-Station is now inputting power into the controller.");
- }
- }
-
-} \ No newline at end of file
+public class GregtechMetaTileEntity_PowerSubStationController
+ extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_PowerSubStationController>
+ implements ISurvivalConstructable {
+
+ private static enum TopState {
+ MayBeTop,
+ Top,
+ NotTop
+ }
+
+ protected long mAverageEuUsage = 0;
+ protected final MovingAverageLong mAverageEuAdded = new MovingAverageLong(20);
+ protected final MovingAverageLong mAverageEuConsumed = new MovingAverageLong(20);
+ protected long mTotalEnergyAdded = 0;
+ protected long mTotalEnergyConsumed = 0;
+ protected long mTotalEnergyLost = 0;
+ protected boolean mIsOutputtingPower = false;
+ protected long mBatteryCapacity = 0;
+
+ private final int ENERGY_TAX = 5;
+
+ private int mCasing;
+ private int[] cellCount = new int[6];
+ private TopState topState = TopState.MayBeTop;
+ private static IStructureDefinition<GregtechMetaTileEntity_PowerSubStationController> STRUCTURE_DEFINITION = null;
+
+ public GregtechMetaTileEntity_PowerSubStationController(
+ final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_PowerSubStationController(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Energy Buffer";
+ }
+
+ @Override
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Consumes " + this.ENERGY_TAX + "% of the average voltage of all energy type hatches")
+ .addInfo("Does not require maintenance")
+ .addInfo("Can be built with variable height between " + (CELL_HEIGHT_MIN + 2) + "-"
+ + (CELL_HEIGHT_MAX + 2) + "")
+ .addInfo("Hatches can be placed nearly anywhere")
+ .addInfo("HV Energy/Dynamo Hatches are the lowest tier you can use")
+ .addInfo("Supports voltages >= UHV using MAX tier components.")
+ .addSeparator()
+ .addController("Bottom Center")
+ .addCasingInfo("Sub-Station External Casings", 10)
+ .addDynamoHatch("Any Casing", 1)
+ .addEnergyHatch("Any Casing", 1)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[] {
+ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)),
+ new GT_RenderedTexture(
+ aActive
+ ? Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE
+ : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER)
+ };
+ }
+ if (aSide == this.getBaseMetaTileEntity().getBackFacing()) {
+ return new ITexture[] {
+ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)),
+ mIsOutputtingPower
+ ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()]
+ : Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()]
+ };
+ }
+ return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(23))};
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ // if (mBatteryCapacity <= 0) return false;
+ if (!aBaseMetaTileEntity.isClientSide()) {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ }
+ return true;
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_PowerSubStation(
+ aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "Ergon Energy - Sub Station");
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_PowerSubStation(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ private void checkMachineProblem(String msg, int xOff, int yOff, int zOff) {
+ final IGregTechTileEntity te = this.getBaseMetaTileEntity();
+ final Block tBlock = te.getBlockOffset(xOff, yOff, zOff);
+ final byte tMeta = te.getMetaIDOffset(xOff, yOff, zOff);
+ String name = tBlock.getLocalizedName();
+ String problem = msg + ": (" + xOff + ", " + yOff + ", " + zOff + ") " + name + ":" + tMeta;
+ checkMachineProblem(problem);
+ }
+
+ private void checkMachineProblem(String msg) {
+ if (!AsmConfig.disableAllLogging) {
+ Logger.INFO("Power Sub-Station problem: " + msg);
+ }
+ }
+
+ public static int getCellTier(Block aBlock, int aMeta) {
+ if (aBlock == ModBlocks.blockCasings2Misc && aMeta == 7) {
+ return 4;
+ } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 4) {
+ return 5;
+ } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 5) {
+ return 6;
+ } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 6) {
+ return 7;
+ } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 7) {
+ return 8;
+ } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 8) {
+ return 9;
+ } else {
+ return -1;
+ }
+ }
+
+ public static int getMetaFromTier(int tier) {
+ if (tier == 4) return 7;
+ if (tier >= 5 && tier <= 9) return tier - 1;
+ return 0;
+ }
+
+ public static Block getBlockFromTier(int tier) {
+ switch (tier) {
+ case 4:
+ return ModBlocks.blockCasings2Misc;
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ return ModBlocks.blockCasings3Misc;
+ default:
+ return null;
+ }
+ }
+
+ public static int getMaxHatchTier(int aCellTier) {
+ switch (aCellTier) {
+ case 9:
+ return GT_Values.VOLTAGE_NAMES[9].equals("Ultimate High Voltage") ? 15 : 9;
+ default:
+ if (aCellTier < 4) {
+ return 0;
+ } else {
+ return aCellTier;
+ }
+ }
+ }
+
+ public static final int CELL_HEIGHT_MAX = 16;
+ public static final int CELL_HEIGHT_MIN = 2;
+
+ @Override
+ public IStructureDefinition<GregtechMetaTileEntity_PowerSubStationController> getStructureDefinition() {
+ if (STRUCTURE_DEFINITION == null) {
+ STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_PowerSubStationController>builder()
+ .addShape(
+ mName + "bottom", transpose(new String[][] {{"CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"}}))
+ .addShape(
+ mName + "layer", transpose(new String[][] {{"CCCCC", "CIIIC", "CIIIC", "CIIIC", "CCCCC"}}))
+ .addShape(mName + "mid", transpose(new String[][] {{"CCCCC", "CHHHC", "CHHHC", "CHHHC", "CCCCC"}}))
+ .addShape(mName + "top", transpose(new String[][] {{"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"}}))
+ .addElement(
+ 'C',
+ buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class)
+ .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance)
+ .casingIndex(TAE.GTPP_INDEX(24))
+ .dot(1)
+ .buildAndChain(
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8))))
+ .addElement(
+ 'I',
+ ofChain(
+ onlyIf(
+ x -> x.topState != TopState.NotTop,
+ onElementPass(
+ x -> x.topState = TopState.Top,
+ ofHatchAdderOptional(
+ GregtechMetaTileEntity_PowerSubStationController
+ ::addPowerSubStationList,
+ TAE.GTPP_INDEX(24),
+ 1,
+ ModBlocks.blockCasings2Misc,
+ 8))),
+ onlyIf(
+ x -> x.topState != TopState.Top,
+ onElementPass(
+ x -> x.topState = TopState.NotTop,
+ ofChain(
+ onElementPass(x -> ++x.cellCount[0], ofCell(4)),
+ onElementPass(x -> ++x.cellCount[1], ofCell(5)),
+ onElementPass(x -> ++x.cellCount[2], ofCell(6)),
+ onElementPass(x -> ++x.cellCount[3], ofCell(7)),
+ onElementPass(x -> ++x.cellCount[4], ofCell(8)),
+ onElementPass(x -> ++x.cellCount[5], ofCell(9)))))))
+ .addElement('H', ofCell(4))
+ .build();
+ }
+ return STRUCTURE_DEFINITION;
+ }
+
+ public static <T> IStructureElement<T> ofCell(int aIndex) {
+ return new IStructureElement<T>() {
+ @Override
+ public boolean check(T t, World world, int x, int y, int z) {
+ Block block = world.getBlock(x, y, z);
+ int meta = world.getBlockMetadata(x, y, z);
+ int tier = getCellTier(block, meta);
+ return aIndex == tier;
+ }
+
+ public int getIndex(int size) {
+ if (size > 6) size = 6;
+ return size + 3;
+ }
+
+ @Override
+ public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
+ StructureLibAPI.hintParticle(
+ world,
+ x,
+ y,
+ z,
+ getBlockFromTier(getIndex(trigger.stackSize)),
+ getMetaFromTier(getIndex(trigger.stackSize)));
+ return true;
+ }
+
+ @Override
+ public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
+ return world.setBlock(
+ x,
+ y,
+ z,
+ getBlockFromTier(getIndex(trigger.stackSize)),
+ getMetaFromTier(getIndex(trigger.stackSize)),
+ 3);
+ }
+
+ @Override
+ public PlaceResult survivalPlaceBlock(
+ T t,
+ World world,
+ int x,
+ int y,
+ int z,
+ ItemStack trigger,
+ IItemSource s,
+ EntityPlayerMP actor,
+ Consumer<IChatComponent> chatter) {
+ Block block = world.getBlock(x, y, z);
+ int meta = world.getBlockMetadata(x, y, z);
+ int tier = getCellTier(block, meta);
+ if (tier >= 0) return PlaceResult.SKIP;
+ return StructureUtility.survivalPlaceBlock(
+ getBlockFromTier(getIndex(trigger.stackSize)),
+ getMetaFromTier(getIndex(trigger.stackSize)),
+ world,
+ x,
+ y,
+ z,
+ s,
+ actor,
+ chatter);
+ }
+ };
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ int layer = Math.min(stackSize.stackSize + 3, 18);
+ log("Layer: " + layer);
+ log("Building 0");
+ buildPiece(mName + "bottom", stackSize, hintsOnly, 2, 0, 0);
+ log("Built 0");
+ for (int i = 1; i < layer - 1; i++) {
+ log("Building " + i);
+ buildPiece(mName + "mid", stackSize, hintsOnly, 2, i, 0);
+ log("Built " + i);
+ }
+ log("Building " + (layer - 1));
+ buildPiece(mName + "top", stackSize, hintsOnly, 2, layer - 1, 0);
+ log("Built " + (layer - 1));
+ }
+
+ @Override
+ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
+ if (mMachine) return -1;
+ int layer = Math.min(stackSize.stackSize + 3, 18);
+ int built;
+ built = survivialBuildPiece(mName + "bottom", stackSize, 2, 0, 0, elementBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ for (int i = 1; i < layer - 1; i++) {
+ built = survivialBuildPiece(mName + "mid", stackSize, 2, i, 0, elementBudget, source, actor, false, true);
+ if (built >= 0) return built;
+ }
+ return survivialBuildPiece(
+ mName + "top", stackSize, 2, layer - 1, 0, elementBudget, source, actor, false, true);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasing = 0;
+ mEnergyHatches.clear();
+ mDynamoHatches.clear();
+ mTecTechEnergyHatches.clear();
+ mTecTechDynamoHatches.clear();
+ mAllEnergyHatches.clear();
+ mAllDynamoHatches.clear();
+ for (int i = 0; i < 6; i++) {
+ cellCount[i] = 0;
+ }
+ log("Checking 0");
+ if (!checkPiece(mName + "bottom", 2, 0, 0)) {
+ log("Failed on Layer 0");
+ return false;
+ }
+ log("Pass 0");
+ int layer = 1;
+ topState = TopState.MayBeTop;
+ while (true) {
+ if (!checkPiece(mName + "layer", 2, layer, 0)) return false;
+ layer++;
+ if (topState == TopState.Top) break; // top found, break out
+ topState = TopState.MayBeTop;
+ if (layer > 18) return false; // too many layers
+ }
+ int level = 0;
+ for (int i = 0; i < 6; i++) {
+ if (cellCount[i] != 0) {
+ if (level == 0) {
+ level = i + 4;
+ } else {
+ return false;
+ }
+ }
+ }
+ int tier = getMaxHatchTier(level);
+ long volSum = 0;
+ for (GT_MetaTileEntity_Hatch hatch : mAllDynamoHatches) {
+ if (hatch.mTier > tier || hatch.mTier < 3) {
+ return false;
+ }
+ volSum += (8L << (hatch.mTier * 2));
+ }
+ for (GT_MetaTileEntity_Hatch hatch : mAllEnergyHatches) {
+ if (hatch.mTier > tier || hatch.mTier < 3) {
+ return false;
+ }
+ volSum += (8L << (hatch.mTier * 2));
+ }
+ mBatteryCapacity = getCapacityFromCellTier(level) * cellCount[level - 4];
+ if (mAllEnergyHatches.size() + mAllDynamoHatches.size() > 0) {
+ mAverageEuUsage = volSum / (mAllEnergyHatches.size() + mAllDynamoHatches.size());
+ } else mAverageEuUsage = 0;
+ fixAllMaintenanceIssue();
+ return true;
+ }
+
+ public final boolean addPowerSubStationList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (LoadedMods.TecTech) {
+ if (isThisHatchMultiDynamo(aMetaTileEntity)) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ } else if (isThisHatchMultiEnergy(aMetaTileEntity)) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ }
+ return false;
+ }
+
+ // Define storage capacity of smallest cell tier (EV) and compute higher tiers from it
+ private static final long CELL_TIER_EV_CAPACITY = 100 * 1000 * 1000;
+ private static final long CELL_TIER_MULTIPLIER = 4; // each tier's capacity is this many times the previous tier
+
+ public static long getCapacityFromCellTier(int aOverallCellTier) {
+ // Use integer math instead of `Math.pow` to avoid range/precision errors
+ if (aOverallCellTier < 4) return 0;
+ aOverallCellTier -= 4;
+ long capacity = CELL_TIER_EV_CAPACITY;
+ while (aOverallCellTier > 0) {
+ capacity *= CELL_TIER_MULTIPLIER;
+ aOverallCellTier--;
+ }
+ return capacity;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_PowerSubStationController(this.mName);
+ }
+
+ // mTotalEnergyAdded
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setLong("mAverageEuUsage", this.mAverageEuUsage);
+ this.mAverageEuAdded.write(aNBT, "mAverageEuAdded");
+ this.mAverageEuConsumed.write(aNBT, "mAverageEuConsumed");
+
+ // Usage Stats
+ aNBT.setLong("mTotalEnergyAdded", this.mTotalEnergyAdded);
+ aNBT.setLong("mTotalEnergyLost", this.mTotalEnergyLost);
+ aNBT.setLong("mTotalEnergyConsumed", this.mTotalEnergyConsumed);
+ aNBT.setLong("mTotalRunTime", this.mTotalRunTime);
+ aNBT.setBoolean("mIsOutputtingPower", this.mIsOutputtingPower);
+ aNBT.setLong("mBatteryCapacity", this.mBatteryCapacity);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+
+ // Best not to get a long if the Tag Map is holding an int
+ if (aNBT.hasKey("mAverageEuUsage")) {
+ this.mAverageEuUsage = aNBT.getLong("mAverageEuUsage");
+ }
+ switch (aNBT.func_150299_b("mAverageEuAdded")) {
+ case NBT.TAG_BYTE_ARRAY:
+ this.mAverageEuAdded.read(aNBT, "mAverageEuAdded");
+ break;
+ case NBT.TAG_LONG:
+ this.mAverageEuAdded.set(aNBT.getLong("mAverageEuAdded"));
+ break;
+ }
+ switch (aNBT.func_150299_b("mAverageEuConsumed")) {
+ case NBT.TAG_BYTE_ARRAY:
+ this.mAverageEuConsumed.read(aNBT, "mAverageEuConsumed");
+ break;
+ case NBT.TAG_LONG:
+ this.mAverageEuConsumed.set(aNBT.getLong("mAverageEuConsumed"));
+ break;
+ }
+
+ // Usage Stats
+ this.mTotalEnergyAdded = aNBT.getLong("mTotalEnergyAdded");
+ this.mTotalEnergyLost = aNBT.getLong("mTotalEnergyLost");
+ this.mTotalEnergyConsumed = aNBT.getLong("mTotalEnergyConsumed");
+ this.mTotalRunTime = aNBT.getLong("mTotalRunTime");
+
+ this.mIsOutputtingPower = aNBT.getBoolean("mIsOutputtingPower");
+
+ this.mBatteryCapacity = aNBT.getLong("mBatteryCapacity");
+
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 200;
+ this.mEUt = 0;
+ this.mEfficiencyIncrease = 10000;
+ this.fixAllMaintenanceIssue();
+ return true;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ private long drawEnergyFromHatch(MetaTileEntity aHatch) {
+ if (!isValidMetaTileEntity(aHatch)) {
+ return 0;
+ }
+
+ long stored = aHatch.getEUVar();
+ long voltage = aHatch.maxEUInput() * aHatch.maxAmperesIn();
+
+ if (voltage > stored) {
+ return 0;
+ }
+
+ if (this.getBaseMetaTileEntity().increaseStoredEnergyUnits(voltage, false)) {
+ aHatch.setEUVar((stored - voltage));
+ this.mTotalEnergyAdded += voltage;
+ return voltage;
+ }
+ return 0;
+ }
+
+ private long addEnergyToHatch(MetaTileEntity aHatch) {
+ if (!isValidMetaTileEntity(aHatch)) {
+ return 0;
+ }
+
+ long voltage = aHatch.maxEUOutput() * aHatch.maxAmperesOut();
+
+ if (aHatch.getEUVar() > aHatch.maxEUStore() - voltage) {
+ return 0;
+ }
+
+ if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(voltage, false)) {
+ aHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(voltage, false);
+ this.mTotalEnergyConsumed += voltage;
+ return voltage;
+ }
+ return 0;
+ }
+
+ private long computeEnergyTax() {
+ float mTax = mAverageEuUsage * (ENERGY_TAX / 100f);
+
+ // Increase tax up to 2x if machine is not fully repaired
+ mTax = mTax * (1f + (10000f - mEfficiency) / 10000f);
+
+ return MathUtils.roundToClosestLong(mTax);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ this.fixAllMaintenanceIssue();
+ }
+
+ @Override
+ public boolean onRunningTick(ItemStack aStack) {
+ // First, decay overcharge (1% of stored energy plus 1000 EU per tick)
+ if (this.getEUVar() > this.mBatteryCapacity) {
+ long energy = (long) (this.getEUVar() * 0.990f) - 1000;
+ this.setEUVar(energy);
+ }
+
+ // Pay Tax
+ long mDecrease = computeEnergyTax();
+ this.mTotalEnergyLost += Math.min(mDecrease, this.getEUVar());
+ this.setEUVar(Math.max(0, this.getEUVar() - mDecrease));
+
+ long aInputAverage = 0;
+ long aOutputAverage = 0;
+ // Input Power
+ for (GT_MetaTileEntity_Hatch THatch : this.mDischargeHatches) {
+ aInputAverage += drawEnergyFromHatch(THatch);
+ }
+ for (GT_MetaTileEntity_Hatch tHatch : this.mAllEnergyHatches) {
+ aInputAverage += drawEnergyFromHatch(tHatch);
+ }
+
+ // Output Power
+ for (GT_MetaTileEntity_Hatch THatch : this.mChargeHatches) {
+ aOutputAverage += addEnergyToHatch(THatch);
+ }
+ for (GT_MetaTileEntity_Hatch tHatch : this.mAllDynamoHatches) {
+ aOutputAverage += addEnergyToHatch(tHatch);
+ }
+ // reset progress time
+ mProgresstime = 0;
+
+ this.mAverageEuAdded.sample(aInputAverage);
+ this.mAverageEuConsumed.sample(aOutputAverage);
+
+ return true;
+ }
+
+ @Override
+ public boolean drainEnergyInput(long aEU) {
+ // Not applicable to this machine
+ return true;
+ }
+
+ @Override
+ public boolean addEnergyOutput(long aEU) {
+ // Not applicable to this machine
+ return true;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return mBatteryCapacity;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ String mode;
+ if (mIsOutputtingPower) {
+ mode = EnumChatFormatting.GOLD + "Output" + EnumChatFormatting.RESET;
+ } else {
+ mode = EnumChatFormatting.BLUE + "Input" + EnumChatFormatting.RESET;
+ }
+
+ String storedEnergyText;
+ if (this.getEUVar() > this.mBatteryCapacity) {
+ storedEnergyText =
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET;
+ } else {
+ storedEnergyText =
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET;
+ }
+
+ int errorCode = this.getBaseMetaTileEntity().getErrorDisplayID();
+ boolean mMaint = (errorCode != 0);
+
+ return new String[] {
+ "Ergon Energy - District Sub-Station",
+ "Stored EU: " + storedEnergyText,
+ "Capacity: " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.maxEUStore())
+ + EnumChatFormatting.RESET,
+ "Running Costs: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.computeEnergyTax())
+ + EnumChatFormatting.RESET + " EU/t",
+ "Controller Mode: " + mode,
+ "Requires Maintenance: " + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + mMaint
+ + EnumChatFormatting.RESET + " | Code: ["
+ + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + errorCode
+ + EnumChatFormatting.RESET + "]",
+ "----------------------",
+ "Stats for Nerds",
+ "Average Input: " + EnumChatFormatting.BLUE + this.mAverageEuAdded + EnumChatFormatting.RESET + " EU",
+ "Average Output: " + EnumChatFormatting.GOLD + this.mAverageEuConsumed + EnumChatFormatting.RESET + " EU",
+ "Total Input: " + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(this.mTotalEnergyAdded)
+ + EnumChatFormatting.RESET + " EU",
+ "Total Output: " + EnumChatFormatting.GOLD + GT_Utility.formatNumbers(this.mTotalEnergyConsumed)
+ + EnumChatFormatting.RESET + " EU",
+ "Total Costs: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.mTotalEnergyLost)
+ + EnumChatFormatting.RESET + " EU",
+ };
+ }
+
+ @Override
+ public void explodeMultiblock() {
+ // TODO Auto-generated method stub
+ super.explodeMultiblock();
+ }
+
+ @Override
+ public void doExplosion(long aExplosionPower) {
+ // TODO Auto-generated method stub
+ super.doExplosion(aExplosionPower);
+ }
+
+ @Override
+ public long getMaxInputVoltage() {
+ return 32768;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return !mIsOutputtingPower;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return mIsOutputtingPower;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return (aSide == this.getBaseMetaTileEntity().getBackFacing() && !mIsOutputtingPower);
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return (aSide == this.getBaseMetaTileEntity().getBackFacing() && mIsOutputtingPower);
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 32;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 32;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return 32768;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return 32768;
+ }
+
+ public final long getAverageEuAdded() {
+ return this.mAverageEuAdded.get();
+ }
+
+ public final long getAverageEuConsumed() {
+ return this.mAverageEuConsumed.get();
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mIsOutputtingPower = Utils.invertBoolean(mIsOutputtingPower);
+ if (mIsOutputtingPower) {
+ PlayerUtils.messagePlayer(aPlayer, "Sub-Station is now outputting power from the controller.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Sub-Station is now inputting power into the controller.");
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java
index 67999087f3..4a24de7c5a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java
@@ -3,9 +3,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.misc;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes;
-import java.util.ArrayList;
-import java.util.Collections;
-
import Ic2ExpReactorPlanner.SimulationData;
import cpw.mods.fml.common.FMLCommonHandler;
import gregtech.api.GregTech_API;
@@ -26,6 +23,8 @@ import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_GUIContainer_ComputerCube;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description;
import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Simulator;
+import java.util.ArrayList;
+import java.util.Collections;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@@ -37,884 +36,929 @@ import net.minecraft.world.World;
public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank {
- public static int MODE_MAIN = 0;
- public static int MODE_REACTOR_PLANNER = 1;
- public static int MODE_SCANNER = 2;
- public static int MODE_CENTRIFUGE = 3;
- public static int MODE_FUSION = 4;
- public static int MODE_INFO = 5;
- public static int MODE_ELECTROLYZER = 6;
-
- public static boolean mSeedscanner = true;
+ public static int MODE_MAIN = 0;
+ public static int MODE_REACTOR_PLANNER = 1;
+ public static int MODE_SCANNER = 2;
+ public static int MODE_CENTRIFUGE = 3;
+ public static int MODE_FUSION = 4;
+ public static int MODE_INFO = 5;
+ public static int MODE_ELECTROLYZER = 6;
+
+ public static boolean mSeedscanner = true;
+
+ public static boolean mReactorplanner = true;
+
+ public static ArrayList<GT_ItemStack> sReactorList;
+
+ public boolean mStarted = false;
+
+ public int mMode = 0;
+
+ public int mHeat = 0;
+
+ public long mEUOut = 0;
+
+ public int mMaxHeat = 1;
+
+ public long mEU = 0;
+
+ public int mProgress = 0;
+ public int mMaxProgress = 0;
+
+ public int mEUTimer = 0;
+
+ public int mEULast1 = 0;
+
+ public int mEULast2 = 0;
+
+ public int mEULast3 = 0;
+
+ public int mEULast4 = 0;
+
+ public float mHEM = 1.0F, mExplosionStrength = 0.0F;
+
+ public String mFusionOutput = "";
+
+ private boolean mNeedsUpdate;
+
+ private GT_Computercube_Simulator mSimulator;
+
+ public GT_TileEntity_ComputerCube(final int aID, final String aDescription) {
+ super(aID, "computer.cube", "Computer Cube MKII", 5, 114, aDescription);
+ }
+
+ public GT_TileEntity_ComputerCube(final String aName, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 5, 114, aDescription, aTextures);
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ Logger.INFO("CC-Sever ID: " + aID);
+ return new GT_Container_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ Logger.INFO("CC-Client ID: " + aID);
+ return new GT_GUIContainer_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Built in Reactor Planner",
+ "Built in Scanner",
+ "Built in Info-Bank",
+ "Displays Fusion Recipes",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer, mMode);
+ return true;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_TileEntity_ComputerCube(this.mName, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ ItemStack tStack = aPlayer.getCurrentEquippedItem();
+ if (tStack != null && ItemList.Tool_DataOrb.isStackEqual(tStack)) {
+ return false;
+ }
+ return true;
+ }
+
+ public final GT_Computercube_Simulator getSimulator() {
+ return this.mSimulator;
+ }
+
+ public final void setSimulator(GT_Computercube_Simulator mSimulator) {
+ this.mSimulator = mSimulator;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aDirection) {
+ return true;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 4;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return GT_Values.V[4];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return GT_Values.V[5] * 1024;
+ }
+
+ @Override
+ public boolean ownerControl() {
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 114;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return (aIndex > 53 && aIndex < 58);
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ public void saveNuclearReactor() {
+ for (int i = 0; i < 54; i++) {
+ if (this.mInventory[i] == null) {
+ this.mInventory[i + 59] = null;
+ } else {
+ this.mInventory[i + 59] = this.mInventory[i].copy();
+ }
+ }
+ }
+
+ public void loadNuclearReactor() {
+ for (int i = 0; i < 54; i++) {
+ if (this.mInventory[i + 59] == null) {
+ this.mInventory[i] = null;
+ } else {
+ this.mInventory[i] = this.mInventory[i + 59].copy();
+ }
+ }
+ }
+
+ public int getXCoord() {
+ return this.getBaseMetaTileEntity().getXCoord();
+ }
+
+ public int getYCoord() {
+ return this.getBaseMetaTileEntity().getYCoord();
+ }
+
+ public int getZCoord() {
+ return this.getBaseMetaTileEntity().getZCoord();
+ }
+
+ public void reset() {
+ this.mEU = 0;
+ this.mHeat = 0;
+ this.mEUOut = 0;
+ this.mMaxHeat = 10000;
+ this.mHEM = 1.0F;
+ this.mExplosionStrength = 0.0F;
+ this.mProgress = 0;
+ this.mMaxProgress = 0;
+ this.mFusionOutput = "";
+ this.mInventory[113] = null;
+ int i;
+ for (i = 0; i < 54; i++) {
+ this.mInventory[i] = null;
+ this.mInventory[i + 59] = null;
+ }
+ for (i = 54; i < 58; i++) {
+ if (this.mInventory[i] != null) {
+ if (!this.getWorld().isRemote)
+ this.getWorld().spawnEntityInWorld((Entity) new EntityItem(
+ this.getWorld(),
+ this.getXCoord() + 0.5D,
+ this.getYCoord() + 0.5D,
+ this.getZCoord() + 0.5D,
+ this.mInventory[i]));
+ this.mInventory[i] = null;
+ }
+ }
+ }
+
+ public void switchModeForward() {
+ int aTempMode = mMode;
+ aTempMode++;
+ if (aTempMode == MODE_ELECTROLYZER || aTempMode == MODE_CENTRIFUGE) {
+ aTempMode++;
+ }
+ if (aTempMode >= 7) {
+ aTempMode = 0;
+ }
+ mMode = aTempMode;
+ switchMode();
+ }
+
+ public void switchModeBackward() {
+ int aTempMode = mMode;
+ aTempMode--;
+ if (aTempMode == MODE_ELECTROLYZER || aTempMode == MODE_CENTRIFUGE) {
+ aTempMode--;
+ }
+ if (aTempMode < 0) {
+ aTempMode = 6;
+ }
+ mMode = aTempMode;
+ switchMode();
+ }
+
+ private void switchMode() {
+ reset();
+ if (this.mMode == MODE_REACTOR_PLANNER && !mReactorplanner) {
+ switchMode();
+ return;
+ }
+ if (this.mMode == MODE_SCANNER && !mSeedscanner) {
+ switchMode();
+ return;
+ }
+ if (this.mMode == MODE_CENTRIFUGE) {
+ showCentrifugeRecipe(0);
+ }
+ if (this.mMode == MODE_FUSION) {
+ showFusionRecipe(0);
+ }
+ if (this.mMode == MODE_INFO) {
+ showDescription(0);
+ }
+ if (this.mMode == MODE_ELECTROLYZER) {
+ showElectrolyzerRecipe(0);
+ }
+ this.getWorld()
+ .addBlockEvent(
+ this.getXCoord(),
+ this.getYCoord(),
+ this.getZCoord(),
+ GregTech_API.sBlockMachines,
+ 10,
+ this.mMode);
+ this.getWorld()
+ .addBlockEvent(
+ this.getXCoord(),
+ this.getYCoord(),
+ this.getZCoord(),
+ GregTech_API.sBlockMachines,
+ 11,
+ this.mMaxHeat);
+ }
+
+ public void showDescription(int aIndex) {
+ this.mExplosionStrength = 0.0F;
+ if (GT_Computercube_Description.sDescriptions.isEmpty()) {
+ return;
+ }
+ if (aIndex >= GT_Computercube_Description.sDescriptions.size() || aIndex < 0) aIndex = 0;
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[0] == null) {
+ this.mInventory[59] = null;
+ } else {
+ this.mInventory[59] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[0].copy();
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[1] == null) {
+ this.mInventory[60] = null;
+ } else {
+ this.mInventory[60] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[1].copy();
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[2] == null) {
+ this.mInventory[61] = null;
+ } else {
+ this.mInventory[61] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[2].copy();
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[3] == null) {
+ this.mInventory[62] = null;
+ } else {
+ this.mInventory[62] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[3].copy();
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[4] == null) {
+ this.mInventory[63] = null;
+ } else {
+ this.mInventory[63] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[4].copy();
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[5] == null) {
+ this.mInventory[64] = null;
+ } else {
+ this.mInventory[64] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[5].copy();
+ this.mExplosionStrength = 100.0F;
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[6] == null) {
+ this.mInventory[65] = null;
+ } else {
+ this.mInventory[65] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[6].copy();
+ this.mExplosionStrength = 100.0F;
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[7] == null) {
+ this.mInventory[66] = null;
+ } else {
+ this.mInventory[66] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[7].copy();
+ this.mExplosionStrength = 100.0F;
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[8] == null) {
+ this.mInventory[67] = null;
+ } else {
+ this.mInventory[67] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[8].copy();
+ this.mExplosionStrength = 100.0F;
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[9] == null) {
+ this.mInventory[68] = null;
+ } else {
+ this.mInventory[68] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[9].copy();
+ this.mExplosionStrength = 100.0F;
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[10] == null) {
+ this.mInventory[69] = null;
+ } else {
+ this.mInventory[69] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[10].copy();
+ this.mExplosionStrength = 100.0F;
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[11] == null) {
+ this.mInventory[70] = null;
+ } else {
+ this.mInventory[70] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[11].copy();
+ this.mExplosionStrength = 100.0F;
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[12] == null) {
+ this.mInventory[71] = null;
+ } else {
+ this.mInventory[71] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[12].copy();
+ this.mExplosionStrength = 100.0F;
+ }
+ if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[13] == null) {
+ this.mInventory[72] = null;
+ } else {
+ this.mInventory[72] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex))
+ .mStacks[13].copy();
+ this.mExplosionStrength = 100.0F;
+ }
+ this.mMaxHeat = aIndex;
+ this.getWorld()
+ .addBlockEvent(
+ this.getXCoord(),
+ this.getYCoord(),
+ this.getZCoord(),
+ GregTech_API.sBlockMachines,
+ 11,
+ this.mMaxHeat);
+ }
+
+ public void switchDescriptionPageForward() {
+ if (++this.mMaxHeat >= GT_Computercube_Description.sDescriptions.size()) this.mMaxHeat = 0;
+ showDescription(this.mMaxHeat);
+ }
+
+ public void switchDescriptionPageBackward() {
+ if (--this.mMaxHeat < 0) this.mMaxHeat = GT_Computercube_Description.sDescriptions.size() - 1;
+ showDescription(this.mMaxHeat);
+ }
+
+ public void showCentrifugeRecipe(int aIndex) {
+ /*
+ if (aIndex >= GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size() || aIndex < 0)
+ aIndex = 0;
+ GT_Recipe tRecipe = GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.get(aIndex);
+ if (tRecipe != null) {
+ if (tRecipe.mInput1 == null) {
+ this.mInventory[59] = null;
+ }
+ else {
+ this.mInventory[59] = tRecipe.mInput1.copy();
+ }
+ if (tRecipe.mInput2 == null) {
+ this.mInventory[60] = null;
+ }
+ else {
+ this.mInventory[60] = tRecipe.mInput2.copy();
+ }
+ if (tRecipe.mOutput1 == null) {
+ this.mInventory[61] = null;
+ }
+ else {
+ this.mInventory[61] = tRecipe.mOutput1.copy();
+ }
+ if (tRecipe.mOutput2 == null) {
+ this.mInventory[62] = null;
+ }
+ else {
+ this.mInventory[62] = tRecipe.mOutput2.copy();
+ }
+ if (tRecipe.mOutput3 == null) {
+ this.mInventory[63] = null;
+ }
+ else {
+ this.mInventory[63] = tRecipe.mOutput3.copy();
+ }
+ if (tRecipe.mOutput4 == null) {
+ this.mInventory[64] = null;
+ }
+ else {
+ this.mInventory[64] = tRecipe.mOutput4.copy();
+ }
+ this.mEU = tRecipe.mDuration * 5;
+ this.mMaxHeat = aIndex;
+ }
+ this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat);
+ */ }
+
+ public void switchCentrifugePageForward() {
+ if (++this.mMaxHeat >= GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size()) this.mMaxHeat = 0;
+ // showCentrifugeRecipe(this.mMaxHeat);
+ }
+
+ public void switchCentrifugePageBackward() {
+ if (--this.mMaxHeat < 0) this.mMaxHeat = GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size() - 1;
+ // showCentrifugeRecipe(this.mMaxHeat);
+ }
+
+ public void showElectrolyzerRecipe(int aIndex) {
+ /*
+ if (aIndex >= GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size() || aIndex < 0)
+ aIndex = 0;
+ GT_Recipe tRecipe = GT_Recipe_Map.sElectrolyzerRecipes.get(aIndex);
+ if (tRecipe != null) {
+ if (tRecipe.mInput1 == null) {
+ this.mInventory[59] = null;
+ }
+ else {
+ this.mInventory[59] = tRecipe.mInput1.copy();
+ }
+ if (tRecipe.mInput2 == null) {
+ this.mInventory[60] = null;
+ }
+ else {
+ this.mInventory[60] = tRecipe.mInput2.copy();
+ }
+ if (tRecipe.mOutput1 == null) {
+ this.mInventory[61] = null;
+ }
+ else {
+ this.mInventory[61] = tRecipe.mOutput1.copy();
+ }
+ if (tRecipe.mOutput2 == null) {
+ this.mInventory[62] = null;
+ }
+ else {
+ this.mInventory[62] = tRecipe.mOutput2.copy();
+ }
+ if (tRecipe.mOutput3 == null) {
+ this.mInventory[63] = null;
+ }
+ else {
+ this.mInventory[63] = tRecipe.mOutput3.copy();
+ }
+ if (tRecipe.mOutput4 == null) {
+ this.mInventory[64] = null;
+ }
+ else {
+ this.mInventory[64] = tRecipe.mOutput4.copy();
+ }
+ this.mEU = tRecipe.mDuration * tRecipe.mEUt;
+ this.mMaxHeat = aIndex;
+ }
+ this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat);
+ */ }
+
+ public void switchElectrolyzerPageForward() {
+ if (++this.mMaxHeat >= GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size()) this.mMaxHeat = 0;
+ showElectrolyzerRecipe(this.mMaxHeat);
+ }
- public static boolean mReactorplanner = true;
-
- public static ArrayList<GT_ItemStack> sReactorList;
+ public void switchElectrolyzerPageBackward() {
+ if (--this.mMaxHeat < 0) this.mMaxHeat = GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size() - 1;
+ showElectrolyzerRecipe(this.mMaxHeat);
+ }
+
+ public static ArrayList<GT_Recipe> sFusionReactorRecipes = new ArrayList<GT_Recipe>();
+
+ public void showFusionRecipe(int aIndex) {
+
+ if (sFusionReactorRecipes.isEmpty()) {
+ for (GT_Recipe aRecipe : GT_Recipe_Map.sFusionRecipes.mRecipeList) {
+ sFusionReactorRecipes.add(aRecipe);
+ }
+ Collections.sort(sFusionReactorRecipes);
+ }
+
+ if (aIndex >= sFusionReactorRecipes.size() || aIndex < 0) {
+ aIndex = 0;
+ }
+ GT_Recipe tRecipe = sFusionReactorRecipes.get(aIndex);
+ if (tRecipe != null) {
+ if (tRecipe.mFluidInputs[0] == null) {
+ this.mInventory[59] = null;
+ } else {
+ this.mInventory[59] = GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[0], true);
+ }
+ if (tRecipe.mFluidInputs[1] == null) {
+ this.mInventory[60] = null;
+ } else {
+ this.mInventory[60] = GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[1], true);
+ }
+ if (tRecipe.mFluidOutputs[0] == null) {
+ this.mInventory[61] = null;
+ } else {
+ this.mInventory[61] = GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[0], true);
+ }
+ this.mEU = tRecipe.mSpecialValue;
+ this.mEUOut = tRecipe.mEUt;
+ this.mHeat = tRecipe.mDuration;
+ this.mMaxHeat = aIndex;
+ this.mFusionOutput = tRecipe.mFluidOutputs[0].getLocalizedName();
+ }
+ this.getWorld()
+ .addBlockEvent(
+ this.getXCoord(),
+ this.getYCoord(),
+ this.getZCoord(),
+ GregTech_API.sBlockMachines,
+ 11,
+ this.mMaxHeat);
+ }
+
+ public void switchFusionPageForward() {
+ if (++this.mMaxHeat >= sFusionReactorRecipes.size()) this.mMaxHeat = 0;
+ showFusionRecipe(this.mMaxHeat);
+ }
+
+ public void switchFusionPageBackward() {
+ if (--this.mMaxHeat < 0) this.mMaxHeat = sFusionReactorRecipes.size() - 1;
+ showFusionRecipe(this.mMaxHeat);
+ }
+
+ public void switchNuclearReactor() {
+ if (this.mStarted) {
+ stopNuclearReactor();
+ } else {
+ startNuclearReactor();
+ }
+ }
+
+ public void startNuclearReactor() {
+ this.mStarted = true;
+ this.mHeat = 0;
+ this.mEU = 0;
+ mSimulator.simulate();
+ }
+
+ public void stopNuclearReactor() {
+ this.mStarted = false;
+ mSimulator.simulate();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mMode", this.mMode);
+ aNBT.setInteger("mProgress", this.mProgress);
+ aNBT.setInteger("mMaxProgress", this.mMaxProgress);
+ aNBT.setBoolean("mStarted", this.mStarted);
+ int[] aSplitLong1 = MathUtils.splitLongIntoTwoIntegers(mEU);
+ aNBT.setInteger("mEU1", aSplitLong1[0]);
+ aNBT.setInteger("mEU2", aSplitLong1[1]);
+ aNBT.setInteger("mHeat", this.mHeat);
+ int[] aSplitLong2 = MathUtils.splitLongIntoTwoIntegers(mEUOut);
+ aNBT.setInteger("mEUOut1", aSplitLong2[0]);
+ aNBT.setInteger("mEUOut2", aSplitLong2[1]);
+ aNBT.setInteger("mMaxHeat", this.mMaxHeat);
+ aNBT.setFloat("mHEM", this.mHEM);
+ aNBT.setFloat("mExplosionStrength", this.mExplosionStrength);
+ aNBT.setString("mFusionOutput", this.mFusionOutput);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mMode = aNBT.getInteger("mMode");
+ this.mProgress = aNBT.getInteger("mProgress");
+ this.mMaxProgress = aNBT.getInteger("mMaxProgress");
+ this.mStarted = aNBT.getBoolean("mStarted");
+ int partA = aNBT.getInteger("mEU1");
+ int partB = aNBT.getInteger("mEU2");
+ this.mEU = MathUtils.combineTwoIntegersToLong(partA, partB);
+ this.mHeat = aNBT.getInteger("mHeat");
+ partA = aNBT.getInteger("mEUOut1");
+ partB = aNBT.getInteger("mEUOut2");
+ this.mEUOut = MathUtils.combineTwoIntegersToLong(partA, partB);
+ this.mMaxHeat = aNBT.getInteger("mMaxHeat");
+ this.mHEM = aNBT.getFloat("mHEM");
+ this.mExplosionStrength = aNBT.getFloat("mExplosionStrength");
+ this.mFusionOutput = aNBT.getString("mFusionOutput");
+ }
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ super.onFirstTick(aBaseMetaTileEntity);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ if (mSimulator == null) {
+ mSimulator = new GT_Computercube_Simulator(this);
+ }
+ if (this.getBaseMetaTileEntity().isClientSide()) {
+ this.getWorld().markBlockForUpdate(this.getXCoord(), this.getYCoord(), this.getZCoord());
+ this.mNeedsUpdate = false;
+ } else {
+ this.mNeedsUpdate = false;
+ }
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ if (this.mMode == MODE_SCANNER) {
+ /*if (this.mInventory[55] == null) {
+ this.mInventory[55] = this.mInventory[54];
+ this.mInventory[54] = null;
+ }*/
+ if (this.mInventory[57] == null) {
+ this.mInventory[57] = this.mInventory[56];
+ this.mInventory[56] = null;
+ }
+
+ // 54 - 55 || 56 - 57
+ // Do scanny bits
+ if (mSeedscanner && this.mMode == MODE_SCANNER) {
+ /*if (doScan(this.mInventory[55]) == 4) {
+ if ((this.mInventory[57] != null) && (this.mInventory[57].getUnlocalizedName().equals("gt.metaitem.01.32707"))) {
+ GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning");
+ }
+ }*/
+ /*if (this.mEU > 0) {
+ if (!this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mEU, false)) {
+ this.mProgress = 0;
+ }
+ }*/
+ }
+
+ /*if (mSeedscanner && this.mInventory[55] != null && GT_Utility.areStacksEqual(this.mInventory[55], Ic2Items.cropSeed, true) && this.mInventory[55].getTagCompound() != null) {
+ if (this.mInventory[55].getTagCompound().getByte("scan") < 4) {
+ if (this.mProgress >= 100) {
+ this.mInventory[55].getTagCompound().setByte("scan", (byte) 4);
+ this.mProgress = 0;
+ }
+ else if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(100, false)) {
+ this.mProgress++;
+ }
+ }
+ else {
+ this.mProgress = 0;
+ if (this.mInventory[56] == null) {
+ this.mInventory[56] = this.mInventory[55];
+ this.mInventory[55] = null;
+ }
+ }
+ }
+ else {
+ this.mProgress = 0;
+ if (this.mInventory[56] == null) {
+ this.mInventory[56] = this.mInventory[55];
+ this.mInventory[55] = null;
+ }
+ }*/
+ }
+
+ if (this.mMode == MODE_REACTOR_PLANNER
+ && mReactorplanner
+ && this.mSimulator != null
+ && this.mSimulator.simulator != null
+ && this.mSimulator.simulatedReactor != null) {
+ SimulationData aData = this.mSimulator.simulator.getData();
+ if (aData != null && aData.totalReactorTicks > 0 && this.mProgress != aData.totalReactorTicks) {
+ Logger.INFO("Updating Variables");
+ this.mEU = aData.avgEUoutput;
+ this.mEUOut = (aData.totalEUoutput / aData.totalReactorTicks);
+ this.mHeat = aData.avgHUoutput;
+ this.mMaxHeat = aData.maxHUoutput;
+ this.mExplosionStrength = aData.explosionPower;
+ this.mHEM = (float) aData.hullHeating;
+ this.mProgress = aData.totalReactorTicks;
+ }
+ }
+
+ if (aTick % 20L == 0L) {
+ this.getWorld()
+ .addBlockEvent(
+ this.getXCoord(),
+ this.getYCoord(),
+ this.getZCoord(),
+ GregTech_API.sBlockMachines,
+ 10,
+ this.mMode);
+ this.getWorld()
+ .addBlockEvent(
+ this.getXCoord(),
+ this.getYCoord(),
+ this.getZCoord(),
+ GregTech_API.sBlockMachines,
+ 11,
+ this.mMaxHeat);
+ }
+ }
+ }
+
+ @Override
+ public void receiveClientEvent(byte aEventID, byte aValue) {
+ super.receiveClientEvent(aEventID, aValue);
+ if (this.getWorld().isRemote)
+ switch (aEventID) {
+ case 10:
+ this.mNeedsUpdate = true;
+ this.mMode = aValue;
+ break;
+ case 11:
+ this.mMaxHeat = aValue;
+ break;
+ }
+ return;
+ }
+
+ @Override
+ public void onValueUpdate(byte aValue) {
+ super.onValueUpdate(aValue);
+ this.mNeedsUpdate = true;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ super.onMachineBlockUpdate();
+ this.mNeedsUpdate = true;
+ }
+
+ @Override
+ public boolean canInsertItem(int i, ItemStack itemstack, int j) {
+ return (this.mMode == MODE_SCANNER) ? ((i == 54 || i == 55)) : false;
+ }
+
+ @Override
+ public boolean canExtractItem(int i, ItemStack itemstack, int j) {
+ return (this.mMode == MODE_SCANNER) ? ((i == 56 || i == 57)) : false;
+ }
+
+ public World getWorld() {
+ return this.getBaseMetaTileEntity().getWorld();
+ }
+
+ @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;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getSides(i);
+ rTextures[2][i + 1] = this.getSides(i);
+ rTextures[3][i + 1] = this.getSides(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFront(i);
+ rTextures[6][i + 1] = this.getSides(i);
+ rTextures[7][i + 1] = this.getSides(i);
+ rTextures[8][i + 1] = this.getSides(i);
+ rTextures[9][i + 1] = this.getSides(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_3)};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Computer_Cube)};
+ }
+
+ protected static final int DID_NOT_FIND_RECIPE = 0,
+ FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
+ FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
- public boolean mStarted = false;
-
- public int mMode = 0;
-
- public int mHeat = 0;
-
- public long mEUOut = 0;
-
- public int mMaxHeat = 1;
-
- public long mEU = 0;
-
- public int mProgress = 0;
- public int mMaxProgress = 0;
-
- public int mEUTimer = 0;
-
- public int mEULast1 = 0;
-
- public int mEULast2 = 0;
-
- public int mEULast3 = 0;
-
- public int mEULast4 = 0;
-
- public float mHEM = 1.0F, mExplosionStrength = 0.0F;
-
- public String mFusionOutput = "";
-
- private boolean mNeedsUpdate;
-
- private GT_Computercube_Simulator mSimulator;
-
- public GT_TileEntity_ComputerCube(final int aID, final String aDescription) {
- super(aID, "computer.cube", "Computer Cube MKII", 5, 114, aDescription);
- }
-
- public GT_TileEntity_ComputerCube(final String aName, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, 5, 114, aDescription, aTextures);
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- Logger.INFO("CC-Sever ID: "+aID);
- return new GT_Container_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- Logger.INFO("CC-Client ID: "+aID);
- return new GT_GUIContainer_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode);
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- "Built in Reactor Planner",
- "Built in Scanner",
- "Built in Info-Bank",
- "Displays Fusion Recipes",
- CORE.GT_Tooltip};
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer, mMode);
- return true;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_TileEntity_ComputerCube(this.mName, this.mDescription, this.mTextures);
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- ItemStack tStack = aPlayer.getCurrentEquippedItem();
- if (tStack != null && ItemList.Tool_DataOrb.isStackEqual(tStack)) {
- return false;
- }
- return true;
- }
-
- public final GT_Computercube_Simulator getSimulator() {
- return this.mSimulator;
- }
-
- public final void setSimulator(GT_Computercube_Simulator mSimulator) {
- this.mSimulator = mSimulator;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isInputFacing(byte aDirection) {
- return true;
- }
-
- @Override
- public long maxAmperesIn() {
- return 4;
- }
-
- @Override
- public long maxEUInput() {
- return GT_Values.V[4];
- }
-
- @Override
- public long maxEUStore() {
- return GT_Values.V[5] * 1024;
- }
-
- @Override
- public boolean ownerControl() {
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 114;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return (aIndex > 53 && aIndex < 58);
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- public void saveNuclearReactor() {
- for (int i = 0; i < 54; i++) {
- if (this.mInventory[i] == null) {
- this.mInventory[i + 59] = null;
- }
- else {
- this.mInventory[i + 59] = this.mInventory[i].copy();
- }
- }
- }
-
- public void loadNuclearReactor() {
- for (int i = 0; i < 54; i++) {
- if (this.mInventory[i + 59] == null) {
- this.mInventory[i] = null;
- }
- else {
- this.mInventory[i] = this.mInventory[i + 59].copy();
- }
- }
- }
-
- public int getXCoord() {
- return this.getBaseMetaTileEntity().getXCoord();
- }
-
- public int getYCoord() {
- return this.getBaseMetaTileEntity().getYCoord();
- }
-
- public int getZCoord() {
- return this.getBaseMetaTileEntity().getZCoord();
- }
-
- public void reset() {
- this.mEU = 0;
- this.mHeat = 0;
- this.mEUOut = 0;
- this.mMaxHeat = 10000;
- this.mHEM = 1.0F;
- this.mExplosionStrength = 0.0F;
- this.mProgress = 0;
- this.mMaxProgress = 0;
- this.mFusionOutput = "";
- this.mInventory[113] = null;
- int i;
- for (i = 0; i < 54; i++) {
- this.mInventory[i] = null;
- this.mInventory[i + 59] = null;
- }
- for (i = 54; i < 58; i++) {
- if (this.mInventory[i] != null) {
- if (!this.getWorld().isRemote)
- this.getWorld().spawnEntityInWorld((Entity) new EntityItem(this.getWorld(), this.getXCoord() + 0.5D, this.getYCoord() + 0.5D, this.getZCoord() + 0.5D, this.mInventory[i]));
- this.mInventory[i] = null;
- }
- }
- }
-
- public void switchModeForward() {
- int aTempMode = mMode;
- aTempMode++;
- if (aTempMode == MODE_ELECTROLYZER ||aTempMode == MODE_CENTRIFUGE) {
- aTempMode++;
- }
- if (aTempMode >= 7) {
- aTempMode = 0;
- }
- mMode = aTempMode;
- switchMode();
- }
-
- public void switchModeBackward() {
- int aTempMode = mMode;
- aTempMode--;
- if (aTempMode == MODE_ELECTROLYZER ||aTempMode == MODE_CENTRIFUGE) {
- aTempMode--;
- }
- if (aTempMode < 0) {
- aTempMode = 6;
- }
- mMode = aTempMode;
- switchMode();
- }
-
- private void switchMode() {
- reset();
- if (this.mMode == MODE_REACTOR_PLANNER && !mReactorplanner) {
- switchMode();
- return;
- }
- if (this.mMode == MODE_SCANNER && !mSeedscanner) {
- switchMode();
- return;
- }
- if (this.mMode == MODE_CENTRIFUGE) {
- showCentrifugeRecipe(0);
- }
- if (this.mMode == MODE_FUSION) {
- showFusionRecipe(0);
- }
- if (this.mMode == MODE_INFO) {
- showDescription(0);
- }
- if (this.mMode == MODE_ELECTROLYZER) {
- showElectrolyzerRecipe(0);
- }
- this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 10, this.mMode);
- this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat);
- }
-
- public void showDescription(int aIndex) {
- this.mExplosionStrength = 0.0F;
- if (GT_Computercube_Description.sDescriptions.isEmpty()) {
- return;
- }
- if (aIndex >= GT_Computercube_Description.sDescriptions.size() || aIndex < 0)
- aIndex = 0;
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[0] == null) {
- this.mInventory[59] = null;
- }
- else {
- this.mInventory[59] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[0].copy();
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[1] == null) {
- this.mInventory[60] = null;
- }
- else {
- this.mInventory[60] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[1].copy();
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[2] == null) {
- this.mInventory[61] = null;
- }
- else {
- this.mInventory[61] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[2].copy();
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[3] == null) {
- this.mInventory[62] = null;
- }
- else {
- this.mInventory[62] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[3].copy();
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[4] == null) {
- this.mInventory[63] = null;
- }
- else {
- this.mInventory[63] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[4].copy();
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[5] == null) {
- this.mInventory[64] = null;
- }
- else {
- this.mInventory[64] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[5].copy();
- this.mExplosionStrength = 100.0F;
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[6] == null) {
- this.mInventory[65] = null;
- }
- else {
- this.mInventory[65] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[6].copy();
- this.mExplosionStrength = 100.0F;
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[7] == null) {
- this.mInventory[66] = null;
- }
- else {
- this.mInventory[66] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[7].copy();
- this.mExplosionStrength = 100.0F;
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[8] == null) {
- this.mInventory[67] = null;
- }
- else {
- this.mInventory[67] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[8].copy();
- this.mExplosionStrength = 100.0F;
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[9] == null) {
- this.mInventory[68] = null;
- }
- else {
- this.mInventory[68] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[9].copy();
- this.mExplosionStrength = 100.0F;
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[10] == null) {
- this.mInventory[69] = null;
- }
- else {
- this.mInventory[69] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[10].copy();
- this.mExplosionStrength = 100.0F;
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[11] == null) {
- this.mInventory[70] = null;
- }
- else {
- this.mInventory[70] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[11].copy();
- this.mExplosionStrength = 100.0F;
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[12] == null) {
- this.mInventory[71] = null;
- }
- else {
- this.mInventory[71] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[12].copy();
- this.mExplosionStrength = 100.0F;
- }
- if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[13] == null) {
- this.mInventory[72] = null;
- }
- else {
- this.mInventory[72] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[13].copy();
- this.mExplosionStrength = 100.0F;
- }
- this.mMaxHeat = aIndex;
- this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat);
- }
-
- public void switchDescriptionPageForward() {
- if (++this.mMaxHeat >= GT_Computercube_Description.sDescriptions.size())
- this.mMaxHeat = 0;
- showDescription(this.mMaxHeat);
- }
-
- public void switchDescriptionPageBackward() {
- if (--this.mMaxHeat < 0)
- this.mMaxHeat = GT_Computercube_Description.sDescriptions.size() - 1;
- showDescription(this.mMaxHeat);
- }
-
- public void showCentrifugeRecipe(int aIndex) {
- /*
- if (aIndex >= GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size() || aIndex < 0)
- aIndex = 0;
- GT_Recipe tRecipe = GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.get(aIndex);
- if (tRecipe != null) {
- if (tRecipe.mInput1 == null) {
- this.mInventory[59] = null;
- }
- else {
- this.mInventory[59] = tRecipe.mInput1.copy();
- }
- if (tRecipe.mInput2 == null) {
- this.mInventory[60] = null;
- }
- else {
- this.mInventory[60] = tRecipe.mInput2.copy();
- }
- if (tRecipe.mOutput1 == null) {
- this.mInventory[61] = null;
- }
- else {
- this.mInventory[61] = tRecipe.mOutput1.copy();
- }
- if (tRecipe.mOutput2 == null) {
- this.mInventory[62] = null;
- }
- else {
- this.mInventory[62] = tRecipe.mOutput2.copy();
- }
- if (tRecipe.mOutput3 == null) {
- this.mInventory[63] = null;
- }
- else {
- this.mInventory[63] = tRecipe.mOutput3.copy();
- }
- if (tRecipe.mOutput4 == null) {
- this.mInventory[64] = null;
- }
- else {
- this.mInventory[64] = tRecipe.mOutput4.copy();
- }
- this.mEU = tRecipe.mDuration * 5;
- this.mMaxHeat = aIndex;
- }
- this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat);
- */}
-
- public void switchCentrifugePageForward() {
- if (++this.mMaxHeat >= GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size())
- this.mMaxHeat = 0;
- // showCentrifugeRecipe(this.mMaxHeat);
- }
-
- public void switchCentrifugePageBackward() {
- if (--this.mMaxHeat < 0)
- this.mMaxHeat = GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size() - 1;
- // showCentrifugeRecipe(this.mMaxHeat);
- }
-
- public void showElectrolyzerRecipe(int aIndex) {
- /*
- if (aIndex >= GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size() || aIndex < 0)
- aIndex = 0;
- GT_Recipe tRecipe = GT_Recipe_Map.sElectrolyzerRecipes.get(aIndex);
- if (tRecipe != null) {
- if (tRecipe.mInput1 == null) {
- this.mInventory[59] = null;
- }
- else {
- this.mInventory[59] = tRecipe.mInput1.copy();
- }
- if (tRecipe.mInput2 == null) {
- this.mInventory[60] = null;
- }
- else {
- this.mInventory[60] = tRecipe.mInput2.copy();
- }
- if (tRecipe.mOutput1 == null) {
- this.mInventory[61] = null;
- }
- else {
- this.mInventory[61] = tRecipe.mOutput1.copy();
- }
- if (tRecipe.mOutput2 == null) {
- this.mInventory[62] = null;
- }
- else {
- this.mInventory[62] = tRecipe.mOutput2.copy();
- }
- if (tRecipe.mOutput3 == null) {
- this.mInventory[63] = null;
- }
- else {
- this.mInventory[63] = tRecipe.mOutput3.copy();
- }
- if (tRecipe.mOutput4 == null) {
- this.mInventory[64] = null;
- }
- else {
- this.mInventory[64] = tRecipe.mOutput4.copy();
- }
- this.mEU = tRecipe.mDuration * tRecipe.mEUt;
- this.mMaxHeat = aIndex;
- }
- this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat);
- */}
-
- public void switchElectrolyzerPageForward() {
- if (++this.mMaxHeat >= GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size())
- this.mMaxHeat = 0;
- showElectrolyzerRecipe(this.mMaxHeat);
- }
-
- public void switchElectrolyzerPageBackward() {
- if (--this.mMaxHeat < 0)
- this.mMaxHeat = GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size() - 1;
- showElectrolyzerRecipe(this.mMaxHeat);
- }
-
- public static ArrayList<GT_Recipe> sFusionReactorRecipes = new ArrayList<GT_Recipe>();
-
- public void showFusionRecipe(int aIndex) {
-
- if (sFusionReactorRecipes.isEmpty()) {
- for (GT_Recipe aRecipe : GT_Recipe_Map.sFusionRecipes.mRecipeList) {
- sFusionReactorRecipes.add(aRecipe);
- }
- Collections.sort(sFusionReactorRecipes);
- }
-
- if (aIndex >= sFusionReactorRecipes.size() || aIndex < 0) {
- aIndex = 0;
- }
- GT_Recipe tRecipe = sFusionReactorRecipes.get(aIndex);
- if (tRecipe != null) {
- if (tRecipe.mFluidInputs[0] == null) {
- this.mInventory[59] = null;
- }
- else {
- this.mInventory[59] = GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[0], true);
- }
- if (tRecipe.mFluidInputs[1] == null) {
- this.mInventory[60] = null;
- }
- else {
- this.mInventory[60] = GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[1], true);
- }
- if (tRecipe.mFluidOutputs[0] == null) {
- this.mInventory[61] = null;
- }
- else {
- this.mInventory[61] = GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[0], true);
- }
- this.mEU = tRecipe.mSpecialValue;
- this.mEUOut = tRecipe.mEUt;
- this.mHeat = tRecipe.mDuration;
- this.mMaxHeat = aIndex;
- this.mFusionOutput = tRecipe.mFluidOutputs[0].getLocalizedName();
- }
- this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat);
- }
-
- public void switchFusionPageForward() {
- if (++this.mMaxHeat >= sFusionReactorRecipes.size())
- this.mMaxHeat = 0;
- showFusionRecipe(this.mMaxHeat);
- }
-
- public void switchFusionPageBackward() {
- if (--this.mMaxHeat < 0)
- this.mMaxHeat = sFusionReactorRecipes.size() - 1;
- showFusionRecipe(this.mMaxHeat);
- }
-
- public void switchNuclearReactor() {
- if (this.mStarted) {
- stopNuclearReactor();
- }
- else {
- startNuclearReactor();
- }
- }
-
- public void startNuclearReactor() {
- this.mStarted = true;
- this.mHeat = 0;
- this.mEU = 0;
- mSimulator.simulate();
- }
-
- public void stopNuclearReactor() {
- this.mStarted = false;
- mSimulator.simulate();
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mMode", this.mMode);
- aNBT.setInteger("mProgress", this.mProgress);
- aNBT.setInteger("mMaxProgress", this.mMaxProgress);
- aNBT.setBoolean("mStarted", this.mStarted);
- int[] aSplitLong1 = MathUtils.splitLongIntoTwoIntegers(mEU);
- aNBT.setInteger("mEU1", aSplitLong1[0]);
- aNBT.setInteger("mEU2", aSplitLong1[1]);
- aNBT.setInteger("mHeat", this.mHeat);
- int[] aSplitLong2 = MathUtils.splitLongIntoTwoIntegers(mEUOut);
- aNBT.setInteger("mEUOut1", aSplitLong2[0]);
- aNBT.setInteger("mEUOut2", aSplitLong2[1]);
- aNBT.setInteger("mMaxHeat", this.mMaxHeat);
- aNBT.setFloat("mHEM", this.mHEM);
- aNBT.setFloat("mExplosionStrength", this.mExplosionStrength);
- aNBT.setString("mFusionOutput", this.mFusionOutput);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mMode = aNBT.getInteger("mMode");
- this.mProgress = aNBT.getInteger("mProgress");
- this.mMaxProgress = aNBT.getInteger("mMaxProgress");
- this.mStarted = aNBT.getBoolean("mStarted");
- int partA = aNBT.getInteger("mEU1");
- int partB = aNBT.getInteger("mEU2");
- this.mEU = MathUtils.combineTwoIntegersToLong(partA, partB);
- this.mHeat = aNBT.getInteger("mHeat");
- partA = aNBT.getInteger("mEUOut1");
- partB = aNBT.getInteger("mEUOut2");
- this.mEUOut = MathUtils.combineTwoIntegersToLong(partA, partB);
- this.mMaxHeat = aNBT.getInteger("mMaxHeat");
- this.mHEM = aNBT.getFloat("mHEM");
- this.mExplosionStrength = aNBT.getFloat("mExplosionStrength");
- this.mFusionOutput = aNBT.getString("mFusionOutput");
- }
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- super.onFirstTick(aBaseMetaTileEntity);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- if (mSimulator == null) {
- mSimulator = new GT_Computercube_Simulator(this);
- }
- if(this.getBaseMetaTileEntity().isClientSide()) {
- this.getWorld().markBlockForUpdate(this.getXCoord(), this.getYCoord(), this.getZCoord());
- this.mNeedsUpdate = false;
- }
- else {
- this.mNeedsUpdate = false;
- }
- if (this.getBaseMetaTileEntity().isServerSide()) {
- if (this.mMode == MODE_SCANNER) {
- /*if (this.mInventory[55] == null) {
- this.mInventory[55] = this.mInventory[54];
- this.mInventory[54] = null;
- }*/
- if (this.mInventory[57] == null) {
- this.mInventory[57] = this.mInventory[56];
- this.mInventory[56] = null;
- }
-
- // 54 - 55 || 56 - 57
- // Do scanny bits
- if (mSeedscanner && this.mMode == MODE_SCANNER) {
- /*if (doScan(this.mInventory[55]) == 4) {
- if ((this.mInventory[57] != null) && (this.mInventory[57].getUnlocalizedName().equals("gt.metaitem.01.32707"))) {
- GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning");
- }
- }*/
- /*if (this.mEU > 0) {
- if (!this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mEU, false)) {
- this.mProgress = 0;
- }
- }*/
- }
-
- /*if (mSeedscanner && this.mInventory[55] != null && GT_Utility.areStacksEqual(this.mInventory[55], Ic2Items.cropSeed, true) && this.mInventory[55].getTagCompound() != null) {
- if (this.mInventory[55].getTagCompound().getByte("scan") < 4) {
- if (this.mProgress >= 100) {
- this.mInventory[55].getTagCompound().setByte("scan", (byte) 4);
- this.mProgress = 0;
- }
- else if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(100, false)) {
- this.mProgress++;
- }
- }
- else {
- this.mProgress = 0;
- if (this.mInventory[56] == null) {
- this.mInventory[56] = this.mInventory[55];
- this.mInventory[55] = null;
- }
- }
- }
- else {
- this.mProgress = 0;
- if (this.mInventory[56] == null) {
- this.mInventory[56] = this.mInventory[55];
- this.mInventory[55] = null;
- }
- }*/
- }
-
- if (this.mMode == MODE_REACTOR_PLANNER && mReactorplanner && this.mSimulator != null && this.mSimulator.simulator != null && this.mSimulator.simulatedReactor != null) {
- SimulationData aData = this.mSimulator.simulator.getData();
- if (aData != null && aData.totalReactorTicks > 0 && this.mProgress != aData.totalReactorTicks) {
- Logger.INFO("Updating Variables");
- this.mEU = aData.avgEUoutput;
- this.mEUOut = (aData.totalEUoutput / aData.totalReactorTicks);
- this.mHeat = aData.avgHUoutput;
- this.mMaxHeat = aData.maxHUoutput;
- this.mExplosionStrength = aData.explosionPower;
- this.mHEM = (float) aData.hullHeating;
- this.mProgress = aData.totalReactorTicks;
- }
- }
-
- if (aTick % 20L == 0L) {
- this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 10, this.mMode);
- this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat);
- }
- }
- }
-
- @Override
- public void receiveClientEvent(byte aEventID, byte aValue) {
- super.receiveClientEvent(aEventID, aValue);
- if (this.getWorld().isRemote)
- switch (aEventID) {
- case 10 :
- this.mNeedsUpdate = true;
- this.mMode = aValue;
- break;
- case 11 :
- this.mMaxHeat = aValue;
- break;
- }
- return;
- }
-
- @Override
- public void onValueUpdate(byte aValue) {
- super.onValueUpdate(aValue);
- this.mNeedsUpdate = true;
- }
-
- @Override
- public void onMachineBlockUpdate() {
- super.onMachineBlockUpdate();
- this.mNeedsUpdate = true;
- }
-
- @Override
- public boolean canInsertItem(int i, ItemStack itemstack, int j) {
- return (this.mMode == MODE_SCANNER) ? ((i == 54 || i == 55)) : false;
- }
-
- @Override
- public boolean canExtractItem(int i, ItemStack itemstack, int j) {
- return (this.mMode == MODE_SCANNER) ? ((i == 56 || i == 57)) : false;
- }
-
- public World getWorld() {
- return this.getBaseMetaTileEntity().getWorld();
- }
-
- @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;
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getSides(i);
- rTextures[2][i + 1] = this.getSides(i);
- rTextures[3][i + 1] = this.getSides(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFront(i);
- rTextures[6][i + 1] = this.getSides(i);
- rTextures[7][i + 1] = this.getSides(i);
- rTextures[8][i + 1] = this.getSides(i);
- rTextures[9][i + 1] = this.getSides(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_3)};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Computer_Cube)};
- }
-
- protected static final int
- DID_NOT_FIND_RECIPE = 0,
- FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
- FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
-
/**
* Calcualtes overclocked ness using long integers
* @param aEUt - recipe EUt
* @param aDuration - recipe Duration
*/
protected void calculateOverclockedNess(int aEUt, int aDuration) {
- if(mTier==0){
- //Long time calculation
- long xMaxProgresstime = ((long)aDuration)<<1;
- if(xMaxProgresstime>Integer.MAX_VALUE-1){
- //make impossible if too long
- mEU=Integer.MAX_VALUE-1;
- mMaxProgress=Integer.MAX_VALUE-1;
- }else{
- mEU=aEUt>>2;
- mMaxProgress=(int)xMaxProgresstime;
+ if (mTier == 0) {
+ // Long time calculation
+ long xMaxProgresstime = ((long) aDuration) << 1;
+ if (xMaxProgresstime > Integer.MAX_VALUE - 1) {
+ // make impossible if too long
+ mEU = Integer.MAX_VALUE - 1;
+ mMaxProgress = Integer.MAX_VALUE - 1;
+ } else {
+ mEU = aEUt >> 2;
+ mMaxProgress = (int) xMaxProgresstime;
}
- }else{
- //Long EUt calculation
- long xEUt=aEUt;
- //Isnt too low EUt check?
+ } else {
+ // Long EUt calculation
+ long xEUt = aEUt;
+ // Isnt too low EUt check?
long tempEUt = Math.max(xEUt, V[1]);
mMaxProgress = aDuration;
- while (tempEUt <= V[mTier -1] * (long)this.maxAmperesIn()) {
- tempEUt<<=2;//this actually controls overclocking
- //xEUt *= 4;//this is effect of everclocking
- mMaxProgress>>=1;//this is effect of overclocking
- xEUt = mMaxProgress==0 ? xEUt>>1 : xEUt<<2;//U know, if the time is less than 1 tick make the machine use 2x less power
+ while (tempEUt <= V[mTier - 1] * (long) this.maxAmperesIn()) {
+ tempEUt <<= 2; // this actually controls overclocking
+ // xEUt *= 4;//this is effect of everclocking
+ mMaxProgress >>= 1; // this is effect of overclocking
+ xEUt = mMaxProgress == 0
+ ? xEUt >> 1
+ : xEUt << 2; // U know, if the time is less than 1 tick make the machine use 2x less power
}
- if(xEUt>Integer.MAX_VALUE-1){
- mEU = Integer.MAX_VALUE-1;
- mMaxProgress = Integer.MAX_VALUE-1;
- }else{
- mEU = (int)xEUt;
- if(mEU==0)
- mEU = 1;
- if(mMaxProgress==0)
- mMaxProgress = 1;//set time to 1 tick
+ if (xEUt > Integer.MAX_VALUE - 1) {
+ mEU = Integer.MAX_VALUE - 1;
+ mMaxProgress = Integer.MAX_VALUE - 1;
+ } else {
+ mEU = (int) xEUt;
+ if (mEU == 0) mEU = 1;
+ if (mMaxProgress == 0) mMaxProgress = 1; // set time to 1 tick
}
}
}
-
+
public int doScan(ItemStack aInput) {
- if (this.mMode != MODE_SCANNER) {
- return DID_NOT_FIND_RECIPE;
- }
+ if (this.mMode != MODE_SCANNER) {
+ return DID_NOT_FIND_RECIPE;
+ }
ItemStack aStack = aInput;
if (this.mInventory[56] != null) {
return DID_NOT_FIND_RECIPE;
} else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0)) {
-
-
+
if (ItemList.IC2_Crop_Seeds.isStackEqual(aStack, true, true)) {
NBTTagCompound tNBT = aStack.getTagCompound();
if (tNBT == null) {
@@ -923,7 +967,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank {
if (tNBT.getByte("scan") < 4) {
tNBT.setByte("scan", (byte) 4);
calculateOverclockedNess(8, 160);
- //In case recipe is too OP for that machine
+ // In case recipe is too OP for that machine
if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1)
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
} else {
@@ -935,20 +979,24 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank {
this.mInventory[57].setTagCompound(tNBT);
return 2;
}
-
-
+
if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) {
if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) {
aStack.stackSize -= 1;
this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot());
calculateOverclockedNess(30, 512);
- //In case recipe is too OP for that machine
+ // In case recipe is too OP for that machine
if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1)
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
ItemData tData = GT_OreDictUnificator.getAssociation(aStack);
- if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) && (tData.mMaterial.mMaterial.mElement != null) && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) && (tData.mMaterial.mMaterial != Materials.Magic) && (tData.mMaterial.mMaterial.getMass() > 0L)) {
+ if ((tData != null)
+ && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell))
+ && (tData.mMaterial.mMaterial.mElement != null)
+ && (!tData.mMaterial.mMaterial.mElement.mIsIsotope)
+ && (tData.mMaterial.mMaterial != Materials.Magic)
+ && (tData.mMaterial.mMaterial.getMass() > 0L)) {
getSpecialSlot().stackSize -= 1;
aStack.stackSize -= 1;
@@ -956,20 +1004,19 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank {
Behaviour_DataOrb.setDataTitle(this.mInventory[57], "Elemental-Scan");
Behaviour_DataOrb.setDataName(this.mInventory[57], tData.mMaterial.mMaterial.mElement.name());
calculateOverclockedNess(30, GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L));
- //In case recipe is too OP for that machine
+ // In case recipe is too OP for that machine
if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1)
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
}
-
-
+
if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) {
if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) {
aStack.stackSize -= 1;
this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot());
calculateOverclockedNess(30, 128);
- //In case recipe is too OP for that machine
+ // In case recipe is too OP for that machine
if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1)
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
@@ -981,7 +1028,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank {
this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot());
this.mInventory[57].setTagCompound(aStack.getTagCompound());
calculateOverclockedNess(30, 128);
- //In case recipe is too OP for that machine
+ // In case recipe is too OP for that machine
if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1)
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
@@ -991,16 +1038,16 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank {
aStack.stackSize -= 1;
this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot());
- this.mInventory[57].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage()));
+ this.mInventory[57].setTagCompound(GT_Utility.getNBTContainingShort(
+ new NBTTagCompound(), "map_id", (short) aStack.getItemDamage()));
calculateOverclockedNess(30, 128);
- //In case recipe is too OP for that machine
+ // In case recipe is too OP for that machine
if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1)
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
+ }
- }
-
if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true) && aStack != null) {
for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) {
if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)) {
@@ -1014,39 +1061,32 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank {
if (failScanner) {
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
}
-
String s = tRecipe.mOutput.getDisplayName();
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName());
- if (s == null)
- s = tRecipe.mOutput.getDisplayName();
+ if (s == null) s = tRecipe.mOutput.getDisplayName();
}
this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot());
-
// Use Assline Utils
if (GT_AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(this.mInventory[57], tRecipe)) {
- aStack.stackSize -= 1;
+ aStack.stackSize -= 1;
calculateOverclockedNess(30, tRecipe.mResearchTime);
- //In case recipe is too OP for that machine
+ // In case recipe is too OP for that machine
if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1)
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
getSpecialSlot().stackSize -= 1;
return 2;
}
-
}
}
}
-
}
return 0;
}
- private ItemStack getSpecialSlot() {
- return this.mInventory[54];
- }
-
-
+ private ItemStack getSpecialSlot() {
+ return this.mInventory[54];
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java
index 4b73bba6df..cc1592cdaa 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java
@@ -8,341 +8,359 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachi
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_SolarTower;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock {
- public boolean mHasTower = false;
- private GregtechMetaTileEntity_SolarTower mTower = null;
-
- private int mTX, mTY, mTZ;
- private Byte mRequiredFacing;
-
- public TileEntitySolarHeater(final int aID, final String aName, final String aNameRegional, final int aTier,
- final String aDescription, final int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
- }
-
- public TileEntitySolarHeater(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures, final int aSlotCount) {
- super(aName, aTier, aSlotCount, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription,
- "Point me at a Solar Tower",
- CORE.GT_Tooltip };
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) };
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) };
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) };
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) };
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) };
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) };
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) };
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) };
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) };
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) };
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new TileEntitySolarHeater(this.mName, this.mTier, this.mDescription, this.mTextures, 0);
- }
-
- @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 String[] getInfoData() {
- return new String[] {
- this.getLocalName(),
- "Testificate"
- };
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
- return false;
- }
-
- public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
- return false;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- return new int[] {};
- }
-
- @Override
- public int getSizeInventory() {
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(final int p_70301_1_) {
- return null;
- }
-
- @Override
- public long maxEUStore() {
- return 0;
- }
-
- @Override
- public int getCapacity() {
- return 0;
- }
-
- @Override
- public long maxEUInput() {
- return 0;
- }
-
- @Override
- public long maxEUOutput() {
- return 0;
- }
-
- @Override
- public long maxAmperesIn() {
- return 0;
- }
-
- @Override
- public long maxAmperesOut() {
- return 0;
- }
-
- @Override
- public boolean isElectric() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return false;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing >= 2;
- }
-
- @Override
- public boolean isEnetInput() {
- return false;
- }
-
- @Override
- public boolean isEnetOutput() {
- return false;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setBoolean("mHasTower", mHasTower);
- if (mHasTower) {
- aNBT.setInteger("mTX", mTX);
- aNBT.setInteger("mTY", mTY);
- aNBT.setInteger("mTZ", mTZ);
- }
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- this.mHasTower = aNBT.getBoolean("mHasTower");
- if (this.mHasTower) {
- if (aNBT.hasKey("mTX"))
- this.mTX = aNBT.getInteger("mTX");
- if (aNBT.hasKey("mTY"))
- this.mTY = aNBT.getInteger("mTY");
- if (aNBT.hasKey("mTZ"))
- this.mTZ = aNBT.getInteger("mTZ");
- }
- }
-
- @Override
- public long getInputTier() {
- return 0;
- }
-
- @Override
- public long getOutputTier() {
- return 0;
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
- return false;
- }
-
- @Override
- public void onExplosion() {
-
- }
-
- public boolean hasSolarTower() {
- return mHasTower;
- }
-
- public GregtechMetaTileEntity_SolarTower getSolarTower() {
- if (this.mHasTower) {
- return mTower;
- }
- return null;
- }
-
- public boolean canSeeSky() {
- if (this.getBaseMetaTileEntity().getWorld().canBlockSeeTheSky(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord())) {
- return true;
- }
- return false;
- }
-
-
- public boolean setSolarTower(GregtechMetaTileEntity_SolarTower aTowerTile) {
- if (!hasSolarTower()) {
- this.mTX = aTowerTile.getBaseMetaTileEntity().getXCoord();
- this.mTY = (int) aTowerTile.getBaseMetaTileEntity().getYCoord();
- this.mTZ = aTowerTile.getBaseMetaTileEntity().getZCoord();
- this.mHasTower = true;
- this.mTower = aTowerTile;
- return true;
- }
- return false;
- }
-
- public boolean clearSolarTower() {
- if (mHasTower || mRequiredFacing != null || this.mTower != null) {
- this.mTX = 0;
- this.mTY = 0;
- this.mTZ = 0;
- this.mRequiredFacing = null;
- this.mTower = null;
- this.mHasTower = false;
- return true;
- }
- return false;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- }
-
- @Override
- public void onRemoval() {
- super.onRemoval();
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return aSide > 1;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return false;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 0;
- }
-
- @Override
- public void onFacingChange() {
- super.onFacingChange();
- }
-
- @Override
- public void doExplosion(long aExplosionPower) {
-
- }
+ public boolean mHasTower = false;
+ private GregtechMetaTileEntity_SolarTower mTower = null;
+
+ private int mTX, mTY, mTZ;
+ private Byte mRequiredFacing;
+
+ public TileEntitySolarHeater(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
+ }
+
+ public TileEntitySolarHeater(
+ final String aName,
+ final int aTier,
+ final String aDescription,
+ final ITexture[][][] aTextures,
+ final int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, "Point me at a Solar Tower", CORE.GT_Tooltip};
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV)
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top)};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV)
+ };
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV)
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top)};
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV)
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV)
+ };
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new TileEntitySolarHeater(this.mName, this.mTier, this.mDescription, this.mTextures, 0);
+ }
+
+ @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 String[] getInfoData() {
+ return new String[] {this.getLocalName(), "Testificate"};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
+ return false;
+ }
+
+ public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
+ return false;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ return new int[] {};
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int p_70301_1_) {
+ return null;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 0;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 0;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 0;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return aFacing >= 2;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("mHasTower", mHasTower);
+ if (mHasTower) {
+ aNBT.setInteger("mTX", mTX);
+ aNBT.setInteger("mTY", mTY);
+ aNBT.setInteger("mTZ", mTZ);
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mHasTower = aNBT.getBoolean("mHasTower");
+ if (this.mHasTower) {
+ if (aNBT.hasKey("mTX")) this.mTX = aNBT.getInteger("mTX");
+ if (aNBT.hasKey("mTY")) this.mTY = aNBT.getInteger("mTY");
+ if (aNBT.hasKey("mTZ")) this.mTZ = aNBT.getInteger("mTZ");
+ }
+ }
+
+ @Override
+ public long getInputTier() {
+ return 0;
+ }
+
+ @Override
+ public long getOutputTier() {
+ return 0;
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public void onExplosion() {}
+
+ public boolean hasSolarTower() {
+ return mHasTower;
+ }
+
+ public GregtechMetaTileEntity_SolarTower getSolarTower() {
+ if (this.mHasTower) {
+ return mTower;
+ }
+ return null;
+ }
+
+ public boolean canSeeSky() {
+ if (this.getBaseMetaTileEntity()
+ .getWorld()
+ .canBlockSeeTheSky(
+ this.getBaseMetaTileEntity().getXCoord(),
+ this.getBaseMetaTileEntity().getYCoord(),
+ this.getBaseMetaTileEntity().getZCoord())) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean setSolarTower(GregtechMetaTileEntity_SolarTower aTowerTile) {
+ if (!hasSolarTower()) {
+ this.mTX = aTowerTile.getBaseMetaTileEntity().getXCoord();
+ this.mTY = (int) aTowerTile.getBaseMetaTileEntity().getYCoord();
+ this.mTZ = aTowerTile.getBaseMetaTileEntity().getZCoord();
+ this.mHasTower = true;
+ this.mTower = aTowerTile;
+ return true;
+ }
+ return false;
+ }
+
+ public boolean clearSolarTower() {
+ if (mHasTower || mRequiredFacing != null || this.mTower != null) {
+ this.mTX = 0;
+ this.mTY = 0;
+ this.mTZ = 0;
+ this.mRequiredFacing = null;
+ this.mTower = null;
+ this.mHasTower = false;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public void onRemoval() {
+ super.onRemoval();
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public void onFacingChange() {
+ super.onFacingChange();
+ }
+
+ @Override
+ public void doExplosion(long aExplosionPower) {}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java
index 9bb2443683..2f88c6a784 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java
@@ -12,110 +12,128 @@ import net.minecraft.nbt.NBTTagCompound;
public abstract class GT_MetaTileEntity_RedstoneBase extends GT_MetaTileEntity_TieredMachineBlock {
- protected int mOpenerCount;
-
- public GT_MetaTileEntity_RedstoneBase(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_RedstoneBase(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_RedstoneBase(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_RedstoneBase(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public final boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
- return aSide != getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public final boolean isValidSlot(int aIndex) {
- return false;
- }
-
- @Override
- public final boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- @Override
- public final boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public abstract void saveNBTData(NBTTagCompound aNBT);
-
- @Override
- public abstract void loadNBTData(NBTTagCompound aNBT);
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- return false;
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, gregtech.api.interfaces.tileentity.IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, gregtech.api.interfaces.tileentity.IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public final void onOpenGUI() {
- super.onOpenGUI();
- mOpenerCount++;
- }
-
- @Override
- public final void onCloseGUI() {
- super.onCloseGUI();
- mOpenerCount--;
- }
-
- public boolean hasRedstoneSignal() {
- if (getBaseMetaTileEntity().getStrongestRedstone() > 0) {
- return true;
- }
- for (byte i=0;i<6;i++) {
- if (getBaseMetaTileEntity().getOutputRedstoneSignal(i) > 0) {
- return true;
- }
- }
- return false;
- }
-
- @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 String[] getDescription() {
- return new String[]{
- this.mDescription,
- CORE.GT_Tooltip
- };
- }
-
+ protected int mOpenerCount;
+
+ public GT_MetaTileEntity_RedstoneBase(
+ 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_RedstoneBase(
+ 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_RedstoneBase(
+ String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_RedstoneBase(
+ String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public final boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public final boolean isValidSlot(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public final boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public final boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public abstract void saveNBTData(NBTTagCompound aNBT);
+
+ @Override
+ public abstract void loadNBTData(NBTTagCompound aNBT);
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ return false;
+ }
+
+ @Override
+ public Object getServerGUI(
+ int aID,
+ InventoryPlayer aPlayerInventory,
+ gregtech.api.interfaces.tileentity.IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(
+ int aID,
+ InventoryPlayer aPlayerInventory,
+ gregtech.api.interfaces.tileentity.IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public final void onOpenGUI() {
+ super.onOpenGUI();
+ mOpenerCount++;
+ }
+
+ @Override
+ public final void onCloseGUI() {
+ super.onCloseGUI();
+ mOpenerCount--;
+ }
+
+ public boolean hasRedstoneSignal() {
+ if (getBaseMetaTileEntity().getStrongestRedstone() > 0) {
+ return true;
+ }
+ for (byte i = 0; i < 6; i++) {
+ if (getBaseMetaTileEntity().getOutputRedstoneSignal(i) > 0) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @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 String[] getDescription() {
+ return new String[] {this.mDescription, CORE.GT_Tooltip};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java
index 0c0cc44d93..3cf868a998 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java
@@ -12,196 +12,250 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_RedstoneButtonPanel extends GT_MetaTileEntity_RedstoneBase {
-
- public byte mRedstoneStrength = 0, mType = 0, mUpdate = 0;
-
- public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[64];
-
- static {
- for (int i=0;i<64;i++) {
- sIconList[i] = new CustomIcon("TileEntities/gt4/redstone/ButtonPanel/"+i);
- }
- }
-
- public GT_MetaTileEntity_RedstoneButtonPanel(int aID) {
- super(aID, "redstone.button.panel", "Button Panel", 5, 0, "Right-click with Screwdriver to change Button Design");
- }
-
- public GT_MetaTileEntity_RedstoneButtonPanel(final String aName, String aDescription, final ITexture[][][] aTextures) {
- super(aName, 5, 0, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_RedstoneButtonPanel(this.mName, mDescription, this.mTextures);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setByte("mRedstoneStrength", mRedstoneStrength);
- aNBT.setByte("mType", mType);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mRedstoneStrength = aNBT.getByte("mRedstoneStrength");
- mType = aNBT.getByte("mType");
- }
-
- @Override
- public void onValueUpdate(byte aValue) {
- mRedstoneStrength = (byte)(aValue & 15);
- mType = (byte)(aValue >>> 4);
- }
-
- @Override
- public byte getUpdateData() {
- return (byte)((mRedstoneStrength & 15) | (mType << 4));
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
- if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
- if (getBaseMetaTileEntity().isServerSide()) {
- mUpdate = 2;
- switch (mType) {
- case 0: default:
- switch (aSide) {
- case 0: case 1:
- mRedstoneStrength = (byte)((byte)( aX*4) + 4 * (byte)( aZ*4));
- break;
- case 2:
- mRedstoneStrength = (byte)((byte)(4-aX*4) + 4 * (byte)(4-aY*4));
- break;
- case 3:
- mRedstoneStrength = (byte)((byte)( aX*4) + 4 * (byte)(4-aY*4));
- break;
- case 4:
- mRedstoneStrength = (byte)((byte)( aZ*4) + 4 * (byte)(4-aY*4));
- break;
- case 5:
- mRedstoneStrength = (byte)((byte)(4-aZ*4) + 4 * (byte)(4-aY*4));
- break;
- }
- break;
- case 1:
- switch (aSide) {
- case 0: case 1:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)( aX*2) + 2 * (byte)( aZ*2)))));
- break;
- case 2:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)(2-aX*2) + 2 * (byte)(2-aY*2)))));
- break;
- case 3:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)( aX*2) + 2 * (byte)(2-aY*2)))));
- break;
- case 4:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)( aZ*2) + 2 * (byte)(2-aY*2)))));
- break;
- case 5:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)(2-aZ*2) + 2 * (byte)(2-aY*2)))));
- break;
- }
- break;
- case 2:
- switch (aSide) {
- case 0: case 1:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)( aZ*4))));
- break;
- case 2:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)(4-aY*4))));
- break;
- case 3:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)(4-aY*4))));
- break;
- case 4:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)(4-aY*4))));
- break;
- case 5:
- mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)(4-aY*4))));
- break;
- }
- break;
- }
- }
- return true;
- }
- return false;
- }
-
- @Override
+
+ public byte mRedstoneStrength = 0, mType = 0, mUpdate = 0;
+
+ public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[64];
+
+ static {
+ for (int i = 0; i < 64; i++) {
+ sIconList[i] = new CustomIcon("TileEntities/gt4/redstone/ButtonPanel/" + i);
+ }
+ }
+
+ public GT_MetaTileEntity_RedstoneButtonPanel(int aID) {
+ super(
+ aID,
+ "redstone.button.panel",
+ "Button Panel",
+ 5,
+ 0,
+ "Right-click with Screwdriver to change Button Design");
+ }
+
+ public GT_MetaTileEntity_RedstoneButtonPanel(
+ final String aName, String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 5, 0, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_RedstoneButtonPanel(this.mName, mDescription, this.mTextures);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setByte("mRedstoneStrength", mRedstoneStrength);
+ aNBT.setByte("mType", mType);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mRedstoneStrength = aNBT.getByte("mRedstoneStrength");
+ mType = aNBT.getByte("mType");
+ }
+
+ @Override
+ public void onValueUpdate(byte aValue) {
+ mRedstoneStrength = (byte) (aValue & 15);
+ mType = (byte) (aValue >>> 4);
+ }
+
+ @Override
+ public byte getUpdateData() {
+ return (byte) ((mRedstoneStrength & 15) | (mType << 4));
+ }
+
+ @Override
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
+ if (getBaseMetaTileEntity().isServerSide()) {
+ mUpdate = 2;
+ switch (mType) {
+ case 0:
+ default:
+ switch (aSide) {
+ case 0:
+ case 1:
+ mRedstoneStrength = (byte) ((byte) (aX * 4) + 4 * (byte) (aZ * 4));
+ break;
+ case 2:
+ mRedstoneStrength = (byte) ((byte) (4 - aX * 4) + 4 * (byte) (4 - aY * 4));
+ break;
+ case 3:
+ mRedstoneStrength = (byte) ((byte) (aX * 4) + 4 * (byte) (4 - aY * 4));
+ break;
+ case 4:
+ mRedstoneStrength = (byte) ((byte) (aZ * 4) + 4 * (byte) (4 - aY * 4));
+ break;
+ case 5:
+ mRedstoneStrength = (byte) ((byte) (4 - aZ * 4) + 4 * (byte) (4 - aY * 4));
+ break;
+ }
+ break;
+ case 1:
+ switch (aSide) {
+ case 0:
+ case 1:
+ mRedstoneStrength =
+ (byte) (mRedstoneStrength ^ (1 << (((byte) (aX * 2) + 2 * (byte) (aZ * 2)))));
+ break;
+ case 2:
+ mRedstoneStrength = (byte)
+ (mRedstoneStrength ^ (1 << (((byte) (2 - aX * 2) + 2 * (byte) (2 - aY * 2)))));
+ break;
+ case 3:
+ mRedstoneStrength = (byte)
+ (mRedstoneStrength ^ (1 << (((byte) (aX * 2) + 2 * (byte) (2 - aY * 2)))));
+ break;
+ case 4:
+ mRedstoneStrength = (byte)
+ (mRedstoneStrength ^ (1 << (((byte) (aZ * 2) + 2 * (byte) (2 - aY * 2)))));
+ break;
+ case 5:
+ mRedstoneStrength = (byte)
+ (mRedstoneStrength ^ (1 << (((byte) (2 - aZ * 2) + 2 * (byte) (2 - aY * 2)))));
+ break;
+ }
+ break;
+ case 2:
+ switch (aSide) {
+ case 0:
+ case 1:
+ mRedstoneStrength = (byte) (mRedstoneStrength ^ (1 << ((byte) (aZ * 4))));
+ break;
+ case 2:
+ mRedstoneStrength = (byte) (mRedstoneStrength ^ (1 << ((byte) (4 - aY * 4))));
+ break;
+ case 3:
+ mRedstoneStrength = (byte) (mRedstoneStrength ^ (1 << ((byte) (4 - aY * 4))));
+ break;
+ case 4:
+ mRedstoneStrength = (byte) (mRedstoneStrength ^ (1 << ((byte) (4 - aY * 4))));
+ break;
+ case 5:
+ mRedstoneStrength = (byte) (mRedstoneStrength ^ (1 << ((byte) (4 - aY * 4))));
+ break;
+ }
+ break;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (getBaseMetaTileEntity().isServerSide()) {
- getBaseMetaTileEntity().setGenericRedstoneOutput(true);
- if (mUpdate > 0) {
- mUpdate--;
- }
- else if (getBaseMetaTileEntity().isAllowedToWork()) {
- mRedstoneStrength = 0;
- }
- for (byte i = 0; i < 6; i++) {
- getBaseMetaTileEntity().setStrongOutputRedstoneSignal(i, i == getBaseMetaTileEntity().getFrontFacing()?(byte)0:mRedstoneStrength);
- getBaseMetaTileEntity().setInternalOutputRedstoneSignal(i, i == getBaseMetaTileEntity().getFrontFacing()?(byte)0:mRedstoneStrength);
- }
- }
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aSide == getBaseMetaTileEntity().getFrontFacing()) mType=(byte)((mType+1)%3);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getSides(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFront(i);
- rTextures[6][i + 1] = this.getSidesActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(sIconList[mType*16+mRedstoneStrength])};
- }
- return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_Off)};
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_On)};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_Off)};
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_On)};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_Off)};
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_On)};
- }
+ if (getBaseMetaTileEntity().isServerSide()) {
+ getBaseMetaTileEntity().setGenericRedstoneOutput(true);
+ if (mUpdate > 0) {
+ mUpdate--;
+ } else if (getBaseMetaTileEntity().isAllowedToWork()) {
+ mRedstoneStrength = 0;
+ }
+ for (byte i = 0; i < 6; i++) {
+ getBaseMetaTileEntity()
+ .setStrongOutputRedstoneSignal(
+ i, i == getBaseMetaTileEntity().getFrontFacing() ? (byte) 0 : mRedstoneStrength);
+ getBaseMetaTileEntity()
+ .setInternalOutputRedstoneSignal(
+ i, i == getBaseMetaTileEntity().getFrontFacing() ? (byte) 0 : mRedstoneStrength);
+ }
+ }
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 3);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getSides(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFront(i);
+ rTextures[6][i + 1] = this.getSidesActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],
+ new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength])
+ };
+ }
+ return this.mTextures[
+ (aActive || hasRedstoneSignal() ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_Off)
+ };
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_On)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_Off)
+ };
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_On)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_Off)
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_On)
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java
index 379345ec6a..caba805f65 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java
@@ -1,11 +1,7 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.redstone;
-import java.util.*;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.IRedstoneCircuitBlock;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ICoverable;
@@ -17,6 +13,7 @@ import gregtech.api.util.*;
import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_Container_RedstoneCircuitBlock;
import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_GUIContainer_RedstoneCircuitBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.*;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@@ -24,475 +21,482 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
-public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_RedstoneBase implements IRedstoneCircuitBlock {
-
- public int mGate = 0, mGateData[] = new int[]{0, 0, 0, 0, 0, 0, 0, 0};
- public boolean bOutput = true;
-
- public GT_MetaTileEntity_RedstoneCircuitBlock(int aID) {
- super(aID, "redstone.circuit", "Redstone Circuit Block", 1, 5, "Computes Redstone");
- }
-
- public GT_MetaTileEntity_RedstoneCircuitBlock(final String aName, String aDescription, final ITexture[][][] aTextures) {
- super(aName, 1, 5, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_RedstoneCircuitBlock(this.mName, mDescription, this.mTextures);
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_RedstoneCircuitBlock(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_RedstoneCircuitBlock(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public boolean hasSidedRedstoneOutputBehavior() {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return !this.isOutputFacing(aSide);
- }
-
- @Override
- public boolean isElectric() {
- return true;
- }
-
- @Override
- public boolean isPneumatic() {
- return false;
- }
-
- @Override
- public boolean isSteampowered() {
- return false;
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return aSide == this.getOutputFacing();
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 512;
- }
-
- @Override
- public long maxEUInput() {
- return GT_Values.V[1];
- }
-
- @Override
- public long maxEUOutput() {
- return bOutput ? GT_Values.V[1] : 0;
- }
-
- @Override
- public long maxAmperesIn() {
- return 2;
- }
-
- @Override
- public long maxAmperesOut() {
- return 1;
- }
-
- @Override
- public int getSizeInventory() {
- return 5;
- }
-
- @Override
- public long maxEUStore() {
- return GT_Values.V[3] * 1024;
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer, 147);
- return true;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mGate", mGate);
- aNBT.setIntArray("mGateData", mGateData);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mGate = aNBT.getInteger("mGate");
- mGateData = aNBT.getIntArray("mGateData");
- if (mGateData.length != 8)
- mGateData = new int[]{0, 0, 0, 0, 0, 0, 0, 0};
- }
-
- public void switchOutput() {
- bOutput = !bOutput;
- }
-
- public void switchGateForward(boolean aShift) {
- try {
- Set<Integer> tKeys = GregTech_API.sCircuitryBehaviors.keySet();
- ArrayList<Integer> tList = new ArrayList<Integer>();
- tList.addAll(tKeys);
- if (tList.size() <= 0)
- return;
- Collections.sort(tList);
- if (!GregTech_API.sCircuitryBehaviors.containsKey(mGate))
- mGate = tList.get(0);
- int tIndex = Collections.binarySearch(tList, mGate);
- tIndex += aShift ? 16 : 1;
- while (tIndex >= tList.size())
- tIndex -= tList.size();
- mGate = tList.get(tIndex);
- switchGate();
- }
- catch (Throwable e) {
- GT_Log.err.print(e);
- }
- }
-
- public void switchGateBackward(boolean aShift) {
- try {
- Set<Integer> tKeys = GregTech_API.sCircuitryBehaviors.keySet();
- ArrayList<Integer> tList = new ArrayList<Integer>();
- tList.addAll(tKeys);
- if (tList.size() <= 0)
- return;
- Collections.sort(tList);
- if (!GregTech_API.sCircuitryBehaviors.containsKey(mGate))
- mGate = tList.get(0);
- int tIndex = Collections.binarySearch(tList, mGate);
- tIndex -= aShift ? 16 : 1;
- while (tIndex < 0)
- tIndex += tList.size();
- mGate = tList.get(tIndex);
- switchGate();
- }
- catch (Throwable e) {
- GT_Log.err.print(e);
- }
- }
-
- @Override
- public void onFacingChange() {
- resetRedstone();
- }
-
- private void resetRedstone() {
- getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 0, (byte) 0);
- getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 1, (byte) 0);
- getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 2, (byte) 0);
- getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 3, (byte) 0);
- getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 4, (byte) 0);
- getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 5, (byte) 0);
- }
-
- public void changeGateData(int aIndex, int aValue) {
- mGateData[aIndex] += aValue;
- validateGateData();
- }
-
- public void stackGateData(int aIndex, ItemStack aStack) {
- mGateData[aIndex] = GT_Utility.stackToInt(aStack);
- validateGateData();
- }
-
- private void switchGate() {
- resetRedstone();
- for (int i = 0; i < mGateData.length; i++)
- mGateData[i] = 0;
- GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate);
- if (tBehaviour != null)
- try {
- tBehaviour.initParameters(mGateData, this);
- }
- catch (Throwable e) {
- GT_Log.err.print(e);
- }
- validateGateData();
- }
-
- private void validateGateData() {
- GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate);
- if (tBehaviour != null)
- try {
- tBehaviour.validateParameters(mGateData, this);
- }
- catch (Throwable e) {
- GT_Log.err.print(e);
- }
- }
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- super.onFirstTick(aBaseMetaTileEntity);
- getBaseMetaTileEntity().setGenericRedstoneOutput(true);
- validateGateData();
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- getBaseMetaTileEntity().setGenericRedstoneOutput(true);
- if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) {
- mInventory[0] = mInventory[1] = mInventory[2] = mInventory[3] = mInventory[4] = null;
- if (getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()) {
- if (getBaseMetaTileEntity().isActive()) {
- GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate);
- if (tBehaviour != null) {
- try {
- tBehaviour.onTick(mGateData, this);
- if (tBehaviour.displayItemStack(mGateData, this, 0))
- mInventory[1] = getCoverByID(mGateData[0]);
- if (tBehaviour.displayItemStack(mGateData, this, 1))
- mInventory[2] = getCoverByID(mGateData[1]);
- if (tBehaviour.displayItemStack(mGateData, this, 2))
- mInventory[3] = getCoverByID(mGateData[2]);
- if (tBehaviour.displayItemStack(mGateData, this, 3))
- mInventory[4] = getCoverByID(mGateData[3]);
- }
- catch (Throwable e) {
- GT_Log.err.print(e);
- }
- }
- }
- getBaseMetaTileEntity().setErrorDisplayID(0);
- }
- else {
- getBaseMetaTileEntity().setErrorDisplayID(1);
- }
- }
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- //Only Calc server-side
- if (!this.getBaseMetaTileEntity().isServerSide()) {
- return;
- }
- //Emit Redstone
- for (byte i=0;i<6;i++) {
- byte aRedstone = getBaseMetaTileEntity().getOutputRedstoneSignal(i);
- this.getBaseMetaTileEntity().setInternalOutputRedstoneSignal(i, aRedstone);
- }
-
- }
-
- @Override
- public final boolean hasRedstoneSignal() {
- for (byte i=0;i<6;i++) {
- if (getBaseMetaTileEntity().getOutputRedstoneSignal(i) > 0) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean allowGeneralRedstoneOutput() {
- return true;
- }
-
- /** The Item List for Covers */
- public static final Map<Integer, ItemStack> sCoversItems = new HashMap<Integer, ItemStack>();
-
- private static void initCovers() {
- for (GT_ItemStack aKey : GregTech_API.sCovers.keySet()) {
- ItemStack aStack = aKey.toStack().copy();
- if (aStack != null) {
- sCoversItems.put(GT_Utility.stackToInt(aStack), aStack);
- }
- }
- }
-
- public static ItemStack getCoverByID(int aStack) {
- if (sCoversItems.isEmpty()) {
- initCovers();
- }
- return sCoversItems.get(Integer.valueOf(aStack));
- }
-
- @Override
- public byte getOutputFacing() {
- return getBaseMetaTileEntity().getBackFacing();
- }
-
- @Override
- public boolean setRedstone(byte aStrength, byte aSide) {
- if (getOutputRedstone(aSide) != aStrength) {
- if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(1, false)) {
- getBaseMetaTileEntity().setInternalOutputRedstoneSignal(aSide, aStrength);
- getBaseMetaTileEntity().setErrorDisplayID(0);
- return true;
- }
- else {
- getBaseMetaTileEntity().setErrorDisplayID(1);
- return false;
- }
- }
- return false;
- }
-
- /* @Override
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
- if (aSide == getOutputFacing()) {
- if (aSide == 0)
- return aRedstone ? 56 : 54;
- if (aSide == 1)
- return aRedstone ? 53 : 52;
- return aRedstone ? 94 : 93;
- }
- if (aSide == 0)
- return aRedstone ? 60 : 59;
- if (aSide == 1)
- return aRedstone ? 58 : 57;
- return aRedstone ? 62 : 61;
- }*/
-
- @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 byte getOutputRedstone(byte aSide) {
- return getBaseMetaTileEntity().getOutputRedstoneSignal(aSide);
- }
-
- @Override
- public byte getInputRedstone(byte aSide) {
- return getBaseMetaTileEntity().getInternalInputRedstoneSignal(aSide);
- }
-
- @Override
- public Block getBlockAtSide(byte aSide) {
- return getBaseMetaTileEntity().getBlockAtSide(aSide);
- }
-
- @Override
- public byte getMetaIDAtSide(byte aSide) {
- return getBaseMetaTileEntity().getMetaIDAtSide(aSide);
- }
-
- @Override
- public TileEntity getTileEntityAtSide(byte aSide) {
- return getBaseMetaTileEntity().getTileEntityAtSide(aSide);
- }
-
- @Override
- public int getRandom(int aRange) {
- return getBaseMetaTileEntity().getRandomNumber(aRange);
- }
-
- @Override
- public GT_CoverBehavior getCover(byte aSide) {
- return getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide);
- }
-
- @Override
- public int getCoverID(byte aSide) {
- return getBaseMetaTileEntity().getCoverIDAtSide(aSide);
- }
-
- @Override
- public int getCoverVariable(byte aSide) {
- return getBaseMetaTileEntity().getCoverDataAtSide(aSide);
- }
-
- @Override
- public ICoverable getOwnTileEntity() {
- return getBaseMetaTileEntity();
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getSides(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getSidesActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
-
- private GT_RenderedTexture getBase() {
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off)};
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On)};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off), new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red)};
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On), new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone)};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off)};
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On)};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off)};
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On)};
- }
-
+public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_RedstoneBase
+ implements IRedstoneCircuitBlock {
+
+ public int mGate = 0, mGateData[] = new int[] {0, 0, 0, 0, 0, 0, 0, 0};
+ public boolean bOutput = true;
+
+ public GT_MetaTileEntity_RedstoneCircuitBlock(int aID) {
+ super(aID, "redstone.circuit", "Redstone Circuit Block", 1, 5, "Computes Redstone");
+ }
+
+ public GT_MetaTileEntity_RedstoneCircuitBlock(
+ final String aName, String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 1, 5, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_RedstoneCircuitBlock(this.mName, mDescription, this.mTextures);
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_RedstoneCircuitBlock(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_RedstoneCircuitBlock(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public boolean hasSidedRedstoneOutputBehavior() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return !this.isOutputFacing(aSide);
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ @Override
+ public boolean isSteampowered() {
+ return false;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == this.getOutputFacing();
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 512;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return GT_Values.V[1];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return bOutput ? GT_Values.V[1] : 0;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 2;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 1;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 5;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return GT_Values.V[3] * 1024;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer, 147);
+ return true;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mGate", mGate);
+ aNBT.setIntArray("mGateData", mGateData);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mGate = aNBT.getInteger("mGate");
+ mGateData = aNBT.getIntArray("mGateData");
+ if (mGateData.length != 8) mGateData = new int[] {0, 0, 0, 0, 0, 0, 0, 0};
+ }
+
+ public void switchOutput() {
+ bOutput = !bOutput;
+ }
+
+ public void switchGateForward(boolean aShift) {
+ try {
+ Set<Integer> tKeys = GregTech_API.sCircuitryBehaviors.keySet();
+ ArrayList<Integer> tList = new ArrayList<Integer>();
+ tList.addAll(tKeys);
+ if (tList.size() <= 0) return;
+ Collections.sort(tList);
+ if (!GregTech_API.sCircuitryBehaviors.containsKey(mGate)) mGate = tList.get(0);
+ int tIndex = Collections.binarySearch(tList, mGate);
+ tIndex += aShift ? 16 : 1;
+ while (tIndex >= tList.size()) tIndex -= tList.size();
+ mGate = tList.get(tIndex);
+ switchGate();
+ } catch (Throwable e) {
+ GT_Log.err.print(e);
+ }
+ }
+
+ public void switchGateBackward(boolean aShift) {
+ try {
+ Set<Integer> tKeys = GregTech_API.sCircuitryBehaviors.keySet();
+ ArrayList<Integer> tList = new ArrayList<Integer>();
+ tList.addAll(tKeys);
+ if (tList.size() <= 0) return;
+ Collections.sort(tList);
+ if (!GregTech_API.sCircuitryBehaviors.containsKey(mGate)) mGate = tList.get(0);
+ int tIndex = Collections.binarySearch(tList, mGate);
+ tIndex -= aShift ? 16 : 1;
+ while (tIndex < 0) tIndex += tList.size();
+ mGate = tList.get(tIndex);
+ switchGate();
+ } catch (Throwable e) {
+ GT_Log.err.print(e);
+ }
+ }
+
+ @Override
+ public void onFacingChange() {
+ resetRedstone();
+ }
+
+ private void resetRedstone() {
+ getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 0, (byte) 0);
+ getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 1, (byte) 0);
+ getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 2, (byte) 0);
+ getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 3, (byte) 0);
+ getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 4, (byte) 0);
+ getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 5, (byte) 0);
+ }
+
+ public void changeGateData(int aIndex, int aValue) {
+ mGateData[aIndex] += aValue;
+ validateGateData();
+ }
+
+ public void stackGateData(int aIndex, ItemStack aStack) {
+ mGateData[aIndex] = GT_Utility.stackToInt(aStack);
+ validateGateData();
+ }
+
+ private void switchGate() {
+ resetRedstone();
+ for (int i = 0; i < mGateData.length; i++) mGateData[i] = 0;
+ GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate);
+ if (tBehaviour != null)
+ try {
+ tBehaviour.initParameters(mGateData, this);
+ } catch (Throwable e) {
+ GT_Log.err.print(e);
+ }
+ validateGateData();
+ }
+
+ private void validateGateData() {
+ GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate);
+ if (tBehaviour != null)
+ try {
+ tBehaviour.validateParameters(mGateData, this);
+ } catch (Throwable e) {
+ GT_Log.err.print(e);
+ }
+ }
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ super.onFirstTick(aBaseMetaTileEntity);
+ getBaseMetaTileEntity().setGenericRedstoneOutput(true);
+ validateGateData();
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ getBaseMetaTileEntity().setGenericRedstoneOutput(true);
+ if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) {
+ mInventory[0] = mInventory[1] = mInventory[2] = mInventory[3] = mInventory[4] = null;
+ if (getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()) {
+ if (getBaseMetaTileEntity().isActive()) {
+ GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate);
+ if (tBehaviour != null) {
+ try {
+ tBehaviour.onTick(mGateData, this);
+ if (tBehaviour.displayItemStack(mGateData, this, 0))
+ mInventory[1] = getCoverByID(mGateData[0]);
+ if (tBehaviour.displayItemStack(mGateData, this, 1))
+ mInventory[2] = getCoverByID(mGateData[1]);
+ if (tBehaviour.displayItemStack(mGateData, this, 2))
+ mInventory[3] = getCoverByID(mGateData[2]);
+ if (tBehaviour.displayItemStack(mGateData, this, 3))
+ mInventory[4] = getCoverByID(mGateData[3]);
+ } catch (Throwable e) {
+ GT_Log.err.print(e);
+ }
+ }
+ }
+ getBaseMetaTileEntity().setErrorDisplayID(0);
+ } else {
+ getBaseMetaTileEntity().setErrorDisplayID(1);
+ }
+ }
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ // Only Calc server-side
+ if (!this.getBaseMetaTileEntity().isServerSide()) {
+ return;
+ }
+ // Emit Redstone
+ for (byte i = 0; i < 6; i++) {
+ byte aRedstone = getBaseMetaTileEntity().getOutputRedstoneSignal(i);
+ this.getBaseMetaTileEntity().setInternalOutputRedstoneSignal(i, aRedstone);
+ }
+ }
+
+ @Override
+ public final boolean hasRedstoneSignal() {
+ for (byte i = 0; i < 6; i++) {
+ if (getBaseMetaTileEntity().getOutputRedstoneSignal(i) > 0) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean allowGeneralRedstoneOutput() {
+ return true;
+ }
+
+ /** The Item List for Covers */
+ public static final Map<Integer, ItemStack> sCoversItems = new HashMap<Integer, ItemStack>();
+
+ private static void initCovers() {
+ for (GT_ItemStack aKey : GregTech_API.sCovers.keySet()) {
+ ItemStack aStack = aKey.toStack().copy();
+ if (aStack != null) {
+ sCoversItems.put(GT_Utility.stackToInt(aStack), aStack);
+ }
+ }
+ }
+
+ public static ItemStack getCoverByID(int aStack) {
+ if (sCoversItems.isEmpty()) {
+ initCovers();
+ }
+ return sCoversItems.get(Integer.valueOf(aStack));
+ }
+
+ @Override
+ public byte getOutputFacing() {
+ return getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean setRedstone(byte aStrength, byte aSide) {
+ if (getOutputRedstone(aSide) != aStrength) {
+ if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(1, false)) {
+ getBaseMetaTileEntity().setInternalOutputRedstoneSignal(aSide, aStrength);
+ getBaseMetaTileEntity().setErrorDisplayID(0);
+ return true;
+ } else {
+ getBaseMetaTileEntity().setErrorDisplayID(1);
+ return false;
+ }
+ }
+ return false;
+ }
+
+ /* @Override
+ public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
+ if (aSide == getOutputFacing()) {
+ if (aSide == 0)
+ return aRedstone ? 56 : 54;
+ if (aSide == 1)
+ return aRedstone ? 53 : 52;
+ return aRedstone ? 94 : 93;
+ }
+ if (aSide == 0)
+ return aRedstone ? 60 : 59;
+ if (aSide == 1)
+ return aRedstone ? 58 : 57;
+ return aRedstone ? 62 : 61;
+ }*/
+
+ @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 byte getOutputRedstone(byte aSide) {
+ return getBaseMetaTileEntity().getOutputRedstoneSignal(aSide);
+ }
+
+ @Override
+ public byte getInputRedstone(byte aSide) {
+ return getBaseMetaTileEntity().getInternalInputRedstoneSignal(aSide);
+ }
+
+ @Override
+ public Block getBlockAtSide(byte aSide) {
+ return getBaseMetaTileEntity().getBlockAtSide(aSide);
+ }
+
+ @Override
+ public byte getMetaIDAtSide(byte aSide) {
+ return getBaseMetaTileEntity().getMetaIDAtSide(aSide);
+ }
+
+ @Override
+ public TileEntity getTileEntityAtSide(byte aSide) {
+ return getBaseMetaTileEntity().getTileEntityAtSide(aSide);
+ }
+
+ @Override
+ public int getRandom(int aRange) {
+ return getBaseMetaTileEntity().getRandomNumber(aRange);
+ }
+
+ @Override
+ public GT_CoverBehavior getCover(byte aSide) {
+ return getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide);
+ }
+
+ @Override
+ public int getCoverID(byte aSide) {
+ return getBaseMetaTileEntity().getCoverIDAtSide(aSide);
+ }
+
+ @Override
+ public int getCoverVariable(byte aSide) {
+ return getBaseMetaTileEntity().getCoverDataAtSide(aSide);
+ }
+
+ @Override
+ public ICoverable getOwnTileEntity() {
+ return getBaseMetaTileEntity();
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getSides(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getSidesActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive || hasRedstoneSignal() ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ private GT_RenderedTexture getBase() {
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off)};
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On)};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ getBase(),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red)
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ getBase(),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off)};
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On)};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off)};
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On)};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java
index 81517c83b9..dfb844654b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java
@@ -10,66 +10,67 @@ import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_RedstoneLamp extends GT_MetaTileEntity_RedstoneBase {
- public byte mRedstoneStrength = 0, mType = 0;
- public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[2];
-
- static {
- sIconList[0] = new CustomIcon("TileEntities/gt4/redstone/Lamp/off");
- sIconList[1] = new CustomIcon("TileEntities/gt4/redstone/Lamp/on");
- }
-
- public GT_MetaTileEntity_RedstoneLamp(int aID) {
- super(aID, "redstone.lamp", "Redstone Controlled Lamp", 0, 0, "Redstone Controlled Lamp");
- }
+ public byte mRedstoneStrength = 0, mType = 0;
+ public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[2];
+
+ static {
+ sIconList[0] = new CustomIcon("TileEntities/gt4/redstone/Lamp/off");
+ sIconList[1] = new CustomIcon("TileEntities/gt4/redstone/Lamp/on");
+ }
+
+ public GT_MetaTileEntity_RedstoneLamp(int aID) {
+ super(aID, "redstone.lamp", "Redstone Controlled Lamp", 0, 0, "Redstone Controlled Lamp");
+ }
+
+ public GT_MetaTileEntity_RedstoneLamp(final String aName, String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 0, 0, aDescription, aTextures);
+ }
- public GT_MetaTileEntity_RedstoneLamp(final String aName, String aDescription, final ITexture[][][] aTextures) {
- super(aName, 0, 0, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_RedstoneLamp(this.mName, mDescription, this.mTextures);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
-
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
-
- }
-
@Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) {
- getBaseMetaTileEntity().setLightValue(getBaseMetaTileEntity().getStrongestRedstone());
- getBaseMetaTileEntity().setActive(getBaseMetaTileEntity().getStrongestRedstone()>0);
- }
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_RedstoneLamp(this.mName, mDescription, this.mTextures);
}
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getSides(i);
- rTextures[1][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 1 : 0)][aColorIndex + 1];
- }
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {}
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {}
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {new GT_RenderedTexture(sIconList[0])};
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] {new GT_RenderedTexture(sIconList[1])};
- }
-
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) {
+ getBaseMetaTileEntity().setLightValue(getBaseMetaTileEntity().getStrongestRedstone());
+ getBaseMetaTileEntity().setActive(getBaseMetaTileEntity().getStrongestRedstone() > 0);
+ }
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getSides(i);
+ rTextures[1][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[(aActive ? 1 : 0)][aColorIndex + 1];
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(sIconList[0])};
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(sIconList[1])};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java
index 1f65385793..3b07f8b3ff 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java
@@ -1,7 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.redstone;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -14,131 +13,164 @@ import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_RedstoneStrengthDisplay extends GT_MetaTileEntity_RedstoneBase {
- public byte mRedstoneStrength = 0, mType = 0;
- public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[144];
-
- static {
- for (int i=0;i<144;i++) {
- sIconList[i] = new CustomIcon("TileEntities/gt4/redstone/Display/"+i);
- }
- }
-
- public GT_MetaTileEntity_RedstoneStrengthDisplay(int aID, String aUnlocal, String aLocal, String aDescription) {
- super(aID, aUnlocal, aLocal, 5, 0, aDescription);
- }
-
- public GT_MetaTileEntity_RedstoneStrengthDisplay(final String aName, String aDescription, final ITexture[][][] aTextures) {
- super(aName, 5, 0, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_RedstoneStrengthDisplay(this.mName, mDescription, this.mTextures);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setByte("mRedstoneStrength", mRedstoneStrength);
- aNBT.setByte("mType", mType);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mRedstoneStrength = aNBT.getByte("mRedstoneStrength");
- mType = aNBT.getByte("mType");
- }
-
- @Override
- public void onValueUpdate(byte aValue) {
- mRedstoneStrength = (byte) (aValue & 15);
- mType = (byte) (aValue >>> 4);
- }
-
- @Override
- public byte getUpdateData() {
- return (byte) ((mRedstoneStrength & 15) | (mType << 4));
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) {
- mRedstoneStrength = getBaseMetaTileEntity().getStrongestRedstone();
- }
- }
-
- /*@Override
- public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
- if (aSide == 0)
- return aRedstone ? 60 : 59;
- if (aSide == 1)
- return aRedstone ? 58 : 57;
- return aRedstone ? 62 : 61;
- }*/
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aSide == getBaseMetaTileEntity().getFrontFacing())
- mType = (byte) ((mType + 1) % 6);
- }
-
- /*@Override
- public IIcon getTextureIcon(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
- return aSide == aFacing ? sIconList[mType * 16 + mRedstoneStrength] : null;
- }*/
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getSides(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFront(i);
- rTextures[6][i + 1] = this.getSidesActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength])};
- }
- return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off)};
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On)};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off)};
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On)};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off)};
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On)};
- }
-
+ public byte mRedstoneStrength = 0, mType = 0;
+ public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[144];
+
+ static {
+ for (int i = 0; i < 144; i++) {
+ sIconList[i] = new CustomIcon("TileEntities/gt4/redstone/Display/" + i);
+ }
+ }
+
+ public GT_MetaTileEntity_RedstoneStrengthDisplay(int aID, String aUnlocal, String aLocal, String aDescription) {
+ super(aID, aUnlocal, aLocal, 5, 0, aDescription);
+ }
+
+ public GT_MetaTileEntity_RedstoneStrengthDisplay(
+ final String aName, String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 5, 0, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_RedstoneStrengthDisplay(this.mName, mDescription, this.mTextures);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setByte("mRedstoneStrength", mRedstoneStrength);
+ aNBT.setByte("mType", mType);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mRedstoneStrength = aNBT.getByte("mRedstoneStrength");
+ mType = aNBT.getByte("mType");
+ }
+
+ @Override
+ public void onValueUpdate(byte aValue) {
+ mRedstoneStrength = (byte) (aValue & 15);
+ mType = (byte) (aValue >>> 4);
+ }
+
+ @Override
+ public byte getUpdateData() {
+ return (byte) ((mRedstoneStrength & 15) | (mType << 4));
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) {
+ mRedstoneStrength = getBaseMetaTileEntity().getStrongestRedstone();
+ }
+ }
+
+ /*@Override
+ public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
+ if (aSide == 0)
+ return aRedstone ? 60 : 59;
+ if (aSide == 1)
+ return aRedstone ? 58 : 57;
+ return aRedstone ? 62 : 61;
+ }*/
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 6);
+ }
+
+ /*@Override
+ public IIcon getTextureIcon(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) {
+ return aSide == aFacing ? sIconList[mType * 16 + mRedstoneStrength] : null;
+ }*/
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getSides(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFront(i);
+ rTextures[6][i + 1] = this.getSidesActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],
+ new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength])
+ };
+ }
+ return this.mTextures[
+ (aActive || hasRedstoneSignal() ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off)
+ };
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off)
+ };
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off)
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On)
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java
index efa3763370..8945f3f7b5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java
@@ -12,39 +12,54 @@ import net.minecraft.entity.player.EntityPlayer;
public class GT_MetaTileEntity_RedstoneStrengthScale extends GT_MetaTileEntity_RedstoneStrengthDisplay {
- public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[32];
-
- static {
- for (int i=0;i<32;i++) {
- sIconList[i] = new CustomIcon("TileEntities/gt4/redstone/Scale/"+i);
- }
- }
-
- public GT_MetaTileEntity_RedstoneStrengthScale(int aID) {
- super(aID, "redstone.display.scale", "Redstone Scale", "Redstone Strength on a Scale");
- }
-
- public GT_MetaTileEntity_RedstoneStrengthScale(final String aName, String aDescription, final ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_RedstoneStrengthScale(this.mName, mDescription, this.mTextures);
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aSide == getBaseMetaTileEntity().getFrontFacing())
- mType = (byte) ((mType + 1) % 2);
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength])};
- }
- return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
+ public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[32];
+ static {
+ for (int i = 0; i < 32; i++) {
+ sIconList[i] = new CustomIcon("TileEntities/gt4/redstone/Scale/" + i);
+ }
+ }
+
+ public GT_MetaTileEntity_RedstoneStrengthScale(int aID) {
+ super(aID, "redstone.display.scale", "Redstone Scale", "Redstone Strength on a Scale");
+ }
+
+ public GT_MetaTileEntity_RedstoneStrengthScale(
+ final String aName, String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_RedstoneStrengthScale(this.mName, mDescription, this.mTextures);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 2);
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],
+ new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength])
+ };
+ }
+ return this.mTextures[
+ (aActive || hasRedstoneSignal() ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java
index 0b815bfae7..bb9865c8e5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage;
-import java.util.ArrayList;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -17,6 +15,7 @@ import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.gui.workbench.GT_Container_AdvancedWorkbench;
import gtPlusPlus.xmod.gregtech.api.gui.workbench.GT_GUIContainer_AdvancedWorkbench;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -25,527 +24,547 @@ import net.minecraft.nbt.NBTTagList;
public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_BasicTank {
- public boolean mFlushMode = false;
-
- protected String mLocalName;
-
- public GT_MetaTileEntity_AdvancedCraftingTable(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription) {
- super(aID, aName, aNameRegional, aTier, 35, aDescription);
- mLocalName = aNameRegional;
- }
-
- public GT_MetaTileEntity_AdvancedCraftingTable(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, 35, aDescription, aTextures);
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_AdvancedWorkbench(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_AdvancedWorkbench(aPlayerInventory, aBaseMetaTileEntity, mLocalName);
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return true;
- }
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
- @Override
- public boolean isValidSlot(int aIndex) {
- return aIndex < 31 || aIndex > 32;
- }
- @Override
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
- @Override
- public boolean isEnetInput() {
- return isElectric();
- }
- @Override
- public boolean isInputFacing(byte aSide) {
- return true;
- }
- @Override
- public long maxEUInput() {
- return isElectric() ? GT_Values.V[3] : 0;
- }
- @Override
- public long maxEUStore() {
- return isElectric() ? GT_Values.V[3] * 1024 : 0;
- }
-
- @Override
- public boolean isElectric() {
- return isAdvanced();
- }
-
- @Override
- public boolean isPneumatic() {
- return false;
- }
-
- @Override
- public boolean isSteampowered() {
- return false;
- }
-
- @Override
- public long maxAmperesIn() {
- return isElectric() ? 2 : 0;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return isElectric() ? GT_Values.V[3] * 2 : 0;
- }
-
- @Override
- public int getSizeInventory() {
- return 35;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_AdvancedCraftingTable(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- 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 false;
- }
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- public void sortIntoTheInputSlots() {
- for (byte i = 21; i < 30; i++)
- if (mInventory[i] != null) {
- if (mInventory[i].stackSize == 0) {
- mInventory[i] = null;
- }
- if (mInventory[i] != null)
- for (byte j = 0; j < 16; j++) {
- if (GT_Utility.areStacksEqual(
- mInventory[i], mInventory[j]
- )) {
- GT_Utility.moveStackFromSlotAToSlotB(
- getBaseMetaTileEntity(), getBaseMetaTileEntity(), i, j, (byte) 64, (byte) 1, (byte) 64, (byte) 1
- );
- }
- }
- if (mInventory[i] != null)
- for (byte j = 0; j < 16; j++) {
- if (mInventory[j] == null) {
- GT_Utility.moveStackFromSlotAToSlotB(
- getBaseMetaTileEntity(), getBaseMetaTileEntity(), i, j, (byte) 64, (byte) 1, (byte) 64, (byte) 1
- );
- }
- }
- }
- }
-
- private void fillLiquidContainers() {
- for (byte i = 16; i < 21 && mFluid != null; i++) {
- ItemStack tOutput = GT_Utility.fillFluidContainer(mFluid, mInventory[i], false, true);
- if (tOutput != null) {
- if (mInventory[i].stackSize == 1) {
- mFluid.amount -= GT_Utility.getFluidForFilledItem(
- tOutput, true
- ).amount * tOutput.stackSize;
- mInventory[i] = tOutput;
- }
- else
- for (byte j = 16; j < 21; j++) {
- if (mInventory[j] == null || (GT_Utility.areStacksEqual(
- tOutput, mInventory[j]
- ) && mInventory[j].stackSize
- + tOutput.stackSize <= tOutput.getMaxStackSize())) {
- mFluid.amount -= GT_Utility.getFluidForFilledItem(
- tOutput, true
- ).amount * tOutput.stackSize;
- getBaseMetaTileEntity().decrStackSize(i, 1);
- if (mInventory[j] == null) {
- mInventory[j] = tOutput;
- }
- else {
- mInventory[j].stackSize++;
- }
- break;
- }
- }
- if (mFluid != null && mFluid.amount <= 0)
- mFluid = null;
- }
- }
- if (mFluid != null && mFluid.amount <= 0)
- mFluid = null;
- }
-
- public void setBluePrint(ItemStack aStack) {
- if (aStack == null) {
- aStack = mInventory[30];
- Logger.INFO("Using Slot 30 supply.");
- }
- if (mInventory[31] == null || aStack == null || aStack.getItem() == null
- || aStack.getItemDamage() != 0 || aStack.stackSize != 1
- || !(aStack.getItem() instanceof ItemBlueprint)) {
- try {
- Logger.INFO(
- "Could not set Blueprint. Slot 31: "
- + (mInventory[31] != null ? mInventory[31].getDisplayName() : "Null")
- + ", aStack: "+(aStack != null ? aStack.getDisplayName() : "Null")
- + ", Damage: "+(aStack != null ? aStack.getItemDamage() : "Null"));
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- return;
- }
- if (!aStack.getTagCompound().hasKey("Inventory")) {
- NBTTagCompound tNBT = new NBTTagCompound();
- NBTTagList tNBT_ItemList = new NBTTagList();
- for (int i = 0; i < 9; i++) {
- ItemStack tStack = mInventory[i + 21];
- if (tStack != null) {
- NBTTagCompound tag = new NBTTagCompound();
- tag.setByte("Slot", (byte) i);
- tStack.writeToNBT(tag);
- tNBT_ItemList.appendTag(tag);
- }
- }
- tNBT.setTag("Inventory", tNBT_ItemList);
- tNBT.setBoolean("mBlueprint", true);
- tNBT.setInteger("mID", MathUtils.randInt(1, Short.MAX_VALUE));
- tNBT.setString("mName", mInventory[31].getDisplayName());
- aStack.setTagCompound(tNBT);
- Logger.INFO("Set NBT of crafting table to Stack in slot 30.");
- }
- else {
- Logger.INFO("Blueprint already has recipe tags.");
- }
-
- }
-
- public ItemStack getCraftingOutput() {
- if (mInventory[30] != null && mInventory[30].getItem() != null
- && mInventory[30].getItemDamage() == 0
- && mInventory[30].hasTagCompound() && mInventory[30].getItem() instanceof ItemBlueprint) {
- //Logger.INFO("Getting Blueprint Data in slot 30. "+mInventory[30].getDisplayName());
- NBTTagCompound tNBT = mInventory[30].getTagCompound();
- NBTTagList tNBT_ItemList = tNBT.getTagList("Blueprint", 10);
- for (int i = 0; i < tNBT_ItemList.tagCount() && i < 9; i++) {
- NBTTagCompound tag = (NBTTagCompound) tNBT_ItemList.getCompoundTagAt(
- i
- );
- byte slot = tag.getByte("Slot");
- if (slot >= 0 && slot < 9 && mInventory[slot + 21] == null) {
- mInventory[slot + 21] = GT_Utility.loadItem(tag);
- if (mInventory[slot + 21] != null)
- mInventory[slot + 21].stackSize = 0;
- }
- }
- }
- mInventory[31] = GT_ModHandler.getAllRecipeOutput(
- getBaseMetaTileEntity().getWorld(), new ItemStack[]{
- mInventory[21], mInventory[22], mInventory[23],
- mInventory[24], mInventory[25], mInventory[26],
- mInventory[27], mInventory[28], mInventory[29]
- }
- );
- return mInventory[31];
- }
-
- public boolean canDoCraftingOutput() {
- if (mInventory[31] == null)
- return false;
- for (ItemStack tStack : recipeContent()) {
- if (tStack.stackSize > getAmountOf(tStack)) {
- return false;
- }
- }
- return true;
- }
-
- private int getAmountOf(ItemStack aStack) {
- int tAmount = 0;
- for (byte i = 0; i < 30 && tAmount < 9; i++) {
- if (GT_Utility.areStacksOrToolsEqual(aStack, mInventory[i])) {
- tAmount += mInventory[i].stackSize;
- }
- }
- return tAmount;
- }
-
- private ArrayList<ItemStack> recipeContent() {
- ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
- for (byte i = 21; i < 30; i++) {
- if (mInventory[i] != null) {
- boolean temp = false;
- for (byte j = 0; j < tList.size(); j++) {
- if (GT_Utility.areStacksOrToolsEqual(
- mInventory[i], tList.get(j)
- )) {
- tList.get(j).stackSize++;
- temp = true;
- break;
- }
- }
- if (!temp)
- tList.add(GT_Utility.copy(1, mInventory[i]));
- }
- }
- return tList;
- }
-
- public ItemStack consumeMaterials(EntityPlayer aPlayer, ItemStack aHoldStack) {
- if (mInventory[31] == null)
- return aHoldStack;
- if (aHoldStack != null) {
- if (!GT_Utility.areStacksEqual(aHoldStack, mInventory[31]))
- return aHoldStack;
- if (aHoldStack.stackSize
- + mInventory[31].stackSize > aHoldStack.getMaxStackSize())
- return aHoldStack;
- }
- for (byte i = 21; i < 30; i++)
- if (mInventory[i] != null) {
- for (byte j = 0; j <= i; j++) {
- if (j < 21 || j == i) {
- if (GT_Utility.areStacksOrToolsEqual(
- mInventory[i], mInventory[j]
- ) && mInventory[j].stackSize > 0) {
- ItemStack tStack = GT_Utility.getContainerItem(
- mInventory[j], true
- );
- if (tStack == null
- || (tStack.isItemStackDamageable()
- && tStack.getItemDamage() >= tStack.getMaxDamage())) {
- getBaseMetaTileEntity().decrStackSize(j, 1);
- }
- else if (mInventory[j].stackSize == 1) {
- mInventory[j] = tStack;
- }
- else {
- getBaseMetaTileEntity().decrStackSize(j, 1);
- for (byte k = 0; k < 21; k++) {
- if (mInventory[k] == null) {
- mInventory[k] = tStack;
- break;
- }
- else {
- if (GT_Utility.areStacksEqual(
- tStack, mInventory[k]
- )) {
- if (tStack.stackSize
- + mInventory[k].stackSize <= mInventory[k].getMaxStackSize()) {
- mInventory[k].stackSize += tStack.stackSize;
- break;
- }
- }
- }
- }
- }
- break;
- }
- }
- }
- }
- if (aHoldStack == null) {
- aHoldStack = GT_Utility.copy(mInventory[31]);
- aHoldStack.onCrafting(
- getBaseMetaTileEntity().getWorld(), aPlayer, mInventory[31].stackSize
- );
- }
- else {
- aHoldStack.stackSize += mInventory[31].stackSize;
- aHoldStack.onCrafting(
- getBaseMetaTileEntity().getWorld(), aPlayer, mInventory[31].stackSize
- );
- }
-
- fillLiquidContainers();
-
- return aHoldStack;
- }
-
- @Override
- public int rechargerSlotStartIndex() {
- return 16;
- }
-
- @Override
- public int rechargerSlotCount() {
- return 5;
- }
-
- @Override
- public long getOutputTier() {
- return GT_Utility.getTier(getBaseMetaTileEntity().getInputVoltage());
- }
-
- @Override
- public int getCapacity() {
- return 64000;
- }
-
- @Override
- public int getTankPressure() {
- return -100;
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aIndex == 33 || (mFlushMode && aIndex >= 21 && aIndex < 30);
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (aIndex < 16) {
- for (byte i = 0; i < 16; i++)
- if (GT_Utility.areStacksOrToolsEqual(aStack, mInventory[i]))
- return aIndex == i;
- return true;
- }
- return false;
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- getCraftingOutput();
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (getBaseMetaTileEntity().isServerSide()) {
- if (getBaseMetaTileEntity().hasInventoryBeenModified())
- getCraftingOutput();
- fillLiquidContainers();
- if (mFlushMode) {
- mFlushMode = false;
- for (byte i = 21; i < 30; i++) {
- if (mInventory[i] != null) {
- if (mInventory[i].stackSize == 0) {
- mInventory[i] = null;
- }
- else {
- mFlushMode = true;
- break;
- }
- }
- }
- }
- }
- /*if (aTick % 100 == 0) {
- for (int i = 0; i < this.mInventory.length; i++) {
- ItemStack aSlot = mInventory[i];
- Logger.INFO("Slot "+i+" "+(aSlot != null ? "contains "+aSlot.getDisplayName() : "is empty"));
- }
- }*/
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- isAdvanced() ? "For the very large Projects" : "For the smaller Projects",
- "Hold Shift in GUI to see slot usage",
- this.mDescription,
- CORE.GT_Tooltip };
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFront(i);
- rTextures[6][i + 1] = this.getBack(i);
- rTextures[7][i + 1] = this.getBottom(i);
- rTextures[8][i + 1] = this.getTop(i);
- rTextures[9][i + 1] = this.getSides(i);
- }
- return rTextures;
- }
-
- protected boolean isAdvanced() {
- return true;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side)};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side)};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Bottom) : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Bottom)};
- }
-
- public ITexture[] getTop(final byte aColor) {
- if (isAdvanced()) {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Top),
- new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) };
- }
- else {
- return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Top),
- new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Crafting_Overlay) };
- }
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side)};
- }
-
+ public boolean mFlushMode = false;
+
+ protected String mLocalName;
+
+ public GT_MetaTileEntity_AdvancedCraftingTable(
+ final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription) {
+ super(aID, aName, aNameRegional, aTier, 35, aDescription);
+ mLocalName = aNameRegional;
+ }
+
+ public GT_MetaTileEntity_AdvancedCraftingTable(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 35, aDescription, aTextures);
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_AdvancedWorkbench(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_AdvancedWorkbench(aPlayerInventory, aBaseMetaTileEntity, mLocalName);
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return true;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 31 || aIndex > 32;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return isElectric();
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return isElectric() ? GT_Values.V[3] : 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return isElectric() ? GT_Values.V[3] * 1024 : 0;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return isAdvanced();
+ }
+
+ @Override
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ @Override
+ public boolean isSteampowered() {
+ return false;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return isElectric() ? 2 : 0;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return isElectric() ? GT_Values.V[3] * 2 : 0;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 35;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_AdvancedCraftingTable(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ 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 false;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ public void sortIntoTheInputSlots() {
+ for (byte i = 21; i < 30; i++)
+ if (mInventory[i] != null) {
+ if (mInventory[i].stackSize == 0) {
+ mInventory[i] = null;
+ }
+ if (mInventory[i] != null)
+ for (byte j = 0; j < 16; j++) {
+ if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j])) {
+ GT_Utility.moveStackFromSlotAToSlotB(
+ getBaseMetaTileEntity(),
+ getBaseMetaTileEntity(),
+ i,
+ j,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ }
+ }
+ if (mInventory[i] != null)
+ for (byte j = 0; j < 16; j++) {
+ if (mInventory[j] == null) {
+ GT_Utility.moveStackFromSlotAToSlotB(
+ getBaseMetaTileEntity(),
+ getBaseMetaTileEntity(),
+ i,
+ j,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
+ }
+ }
+ }
+ }
+
+ private void fillLiquidContainers() {
+ for (byte i = 16; i < 21 && mFluid != null; i++) {
+ ItemStack tOutput = GT_Utility.fillFluidContainer(mFluid, mInventory[i], false, true);
+ if (tOutput != null) {
+ if (mInventory[i].stackSize == 1) {
+ mFluid.amount -= GT_Utility.getFluidForFilledItem(tOutput, true).amount * tOutput.stackSize;
+ mInventory[i] = tOutput;
+ } else
+ for (byte j = 16; j < 21; j++) {
+ if (mInventory[j] == null
+ || (GT_Utility.areStacksEqual(tOutput, mInventory[j])
+ && mInventory[j].stackSize + tOutput.stackSize <= tOutput.getMaxStackSize())) {
+ mFluid.amount -= GT_Utility.getFluidForFilledItem(tOutput, true).amount * tOutput.stackSize;
+ getBaseMetaTileEntity().decrStackSize(i, 1);
+ if (mInventory[j] == null) {
+ mInventory[j] = tOutput;
+ } else {
+ mInventory[j].stackSize++;
+ }
+ break;
+ }
+ }
+ if (mFluid != null && mFluid.amount <= 0) mFluid = null;
+ }
+ }
+ if (mFluid != null && mFluid.amount <= 0) mFluid = null;
+ }
+
+ public void setBluePrint(ItemStack aStack) {
+ if (aStack == null) {
+ aStack = mInventory[30];
+ Logger.INFO("Using Slot 30 supply.");
+ }
+ if (mInventory[31] == null
+ || aStack == null
+ || aStack.getItem() == null
+ || aStack.getItemDamage() != 0
+ || aStack.stackSize != 1
+ || !(aStack.getItem() instanceof ItemBlueprint)) {
+ try {
+ Logger.INFO("Could not set Blueprint. Slot 31: "
+ + (mInventory[31] != null ? mInventory[31].getDisplayName() : "Null")
+ + ", aStack: " + (aStack != null ? aStack.getDisplayName() : "Null")
+ + ", Damage: " + (aStack != null ? aStack.getItemDamage() : "Null"));
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ return;
+ }
+ if (!aStack.getTagCompound().hasKey("Inventory")) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ NBTTagList tNBT_ItemList = new NBTTagList();
+ for (int i = 0; i < 9; i++) {
+ ItemStack tStack = mInventory[i + 21];
+ if (tStack != null) {
+ NBTTagCompound tag = new NBTTagCompound();
+ tag.setByte("Slot", (byte) i);
+ tStack.writeToNBT(tag);
+ tNBT_ItemList.appendTag(tag);
+ }
+ }
+ tNBT.setTag("Inventory", tNBT_ItemList);
+ tNBT.setBoolean("mBlueprint", true);
+ tNBT.setInteger("mID", MathUtils.randInt(1, Short.MAX_VALUE));
+ tNBT.setString("mName", mInventory[31].getDisplayName());
+ aStack.setTagCompound(tNBT);
+ Logger.INFO("Set NBT of crafting table to Stack in slot 30.");
+ } else {
+ Logger.INFO("Blueprint already has recipe tags.");
+ }
+ }
+
+ public ItemStack getCraftingOutput() {
+ if (mInventory[30] != null
+ && mInventory[30].getItem() != null
+ && mInventory[30].getItemDamage() == 0
+ && mInventory[30].hasTagCompound()
+ && mInventory[30].getItem() instanceof ItemBlueprint) {
+ // Logger.INFO("Getting Blueprint Data in slot 30. "+mInventory[30].getDisplayName());
+ NBTTagCompound tNBT = mInventory[30].getTagCompound();
+ NBTTagList tNBT_ItemList = tNBT.getTagList("Blueprint", 10);
+ for (int i = 0; i < tNBT_ItemList.tagCount() && i < 9; i++) {
+ NBTTagCompound tag = (NBTTagCompound) tNBT_ItemList.getCompoundTagAt(i);
+ byte slot = tag.getByte("Slot");
+ if (slot >= 0 && slot < 9 && mInventory[slot + 21] == null) {
+ mInventory[slot + 21] = GT_Utility.loadItem(tag);
+ if (mInventory[slot + 21] != null) mInventory[slot + 21].stackSize = 0;
+ }
+ }
+ }
+ mInventory[31] =
+ GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), new ItemStack[] {
+ mInventory[21], mInventory[22], mInventory[23],
+ mInventory[24], mInventory[25], mInventory[26],
+ mInventory[27], mInventory[28], mInventory[29]
+ });
+ return mInventory[31];
+ }
+
+ public boolean canDoCraftingOutput() {
+ if (mInventory[31] == null) return false;
+ for (ItemStack tStack : recipeContent()) {
+ if (tStack.stackSize > getAmountOf(tStack)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private int getAmountOf(ItemStack aStack) {
+ int tAmount = 0;
+ for (byte i = 0; i < 30 && tAmount < 9; i++) {
+ if (GT_Utility.areStacksOrToolsEqual(aStack, mInventory[i])) {
+ tAmount += mInventory[i].stackSize;
+ }
+ }
+ return tAmount;
+ }
+
+ private ArrayList<ItemStack> recipeContent() {
+ ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
+ for (byte i = 21; i < 30; i++) {
+ if (mInventory[i] != null) {
+ boolean temp = false;
+ for (byte j = 0; j < tList.size(); j++) {
+ if (GT_Utility.areStacksOrToolsEqual(mInventory[i], tList.get(j))) {
+ tList.get(j).stackSize++;
+ temp = true;
+ break;
+ }
+ }
+ if (!temp) tList.add(GT_Utility.copy(1, mInventory[i]));
+ }
+ }
+ return tList;
+ }
+
+ public ItemStack consumeMaterials(EntityPlayer aPlayer, ItemStack aHoldStack) {
+ if (mInventory[31] == null) return aHoldStack;
+ if (aHoldStack != null) {
+ if (!GT_Utility.areStacksEqual(aHoldStack, mInventory[31])) return aHoldStack;
+ if (aHoldStack.stackSize + mInventory[31].stackSize > aHoldStack.getMaxStackSize()) return aHoldStack;
+ }
+ for (byte i = 21; i < 30; i++)
+ if (mInventory[i] != null) {
+ for (byte j = 0; j <= i; j++) {
+ if (j < 21 || j == i) {
+ if (GT_Utility.areStacksOrToolsEqual(mInventory[i], mInventory[j])
+ && mInventory[j].stackSize > 0) {
+ ItemStack tStack = GT_Utility.getContainerItem(mInventory[j], true);
+ if (tStack == null
+ || (tStack.isItemStackDamageable()
+ && tStack.getItemDamage() >= tStack.getMaxDamage())) {
+ getBaseMetaTileEntity().decrStackSize(j, 1);
+ } else if (mInventory[j].stackSize == 1) {
+ mInventory[j] = tStack;
+ } else {
+ getBaseMetaTileEntity().decrStackSize(j, 1);
+ for (byte k = 0; k < 21; k++) {
+ if (mInventory[k] == null) {
+ mInventory[k] = tStack;
+ break;
+ } else {
+ if (GT_Utility.areStacksEqual(tStack, mInventory[k])) {
+ if (tStack.stackSize + mInventory[k].stackSize
+ <= mInventory[k].getMaxStackSize()) {
+ mInventory[k].stackSize += tStack.stackSize;
+ break;
+ }
+ }
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ if (aHoldStack == null) {
+ aHoldStack = GT_Utility.copy(mInventory[31]);
+ aHoldStack.onCrafting(getBaseMetaTileEntity().getWorld(), aPlayer, mInventory[31].stackSize);
+ } else {
+ aHoldStack.stackSize += mInventory[31].stackSize;
+ aHoldStack.onCrafting(getBaseMetaTileEntity().getWorld(), aPlayer, mInventory[31].stackSize);
+ }
+
+ fillLiquidContainers();
+
+ return aHoldStack;
+ }
+
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 16;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return 5;
+ }
+
+ @Override
+ public long getOutputTier() {
+ return GT_Utility.getTier(getBaseMetaTileEntity().getInputVoltage());
+ }
+
+ @Override
+ public int getCapacity() {
+ return 64000;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return -100;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == 33 || (mFlushMode && aIndex >= 21 && aIndex < 30);
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (aIndex < 16) {
+ for (byte i = 0; i < 16; i++)
+ if (GT_Utility.areStacksOrToolsEqual(aStack, mInventory[i])) return aIndex == i;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ getCraftingOutput();
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (getBaseMetaTileEntity().isServerSide()) {
+ if (getBaseMetaTileEntity().hasInventoryBeenModified()) getCraftingOutput();
+ fillLiquidContainers();
+ if (mFlushMode) {
+ mFlushMode = false;
+ for (byte i = 21; i < 30; i++) {
+ if (mInventory[i] != null) {
+ if (mInventory[i].stackSize == 0) {
+ mInventory[i] = null;
+ } else {
+ mFlushMode = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ /*if (aTick % 100 == 0) {
+ for (int i = 0; i < this.mInventory.length; i++) {
+ ItemStack aSlot = mInventory[i];
+ Logger.INFO("Slot "+i+" "+(aSlot != null ? "contains "+aSlot.getDisplayName() : "is empty"));
+ }
+ }*/
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ isAdvanced() ? "For the very large Projects" : "For the smaller Projects",
+ "Hold Shift in GUI to see slot usage",
+ this.mDescription,
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFront(i);
+ rTextures[6][i + 1] = this.getBack(i);
+ rTextures[7][i + 1] = this.getBottom(i);
+ rTextures[8][i + 1] = this.getTop(i);
+ rTextures[9][i + 1] = this.getSides(i);
+ }
+ return rTextures;
+ }
+
+ protected boolean isAdvanced() {
+ return true;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ isAdvanced()
+ ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side)
+ : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side)
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ isAdvanced()
+ ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side)
+ : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ isAdvanced()
+ ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Bottom)
+ : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Bottom)
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ if (isAdvanced()) {
+ return new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Top),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay)
+ };
+ } else {
+ return new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Top),
+ new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Crafting_Overlay)
+ };
+ }
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ isAdvanced()
+ ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side)
+ : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side)
+ };
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java
index f421d391c0..9e21e51f07 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java
@@ -5,79 +5,82 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_ItemStack;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.workbench.GT_Container_BronzeWorkbench;
import gtPlusPlus.xmod.gregtech.api.gui.workbench.GT_GUIContainer_BronzeWorkbench;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_MetaTileEntity_BronzeCraftingTable extends GT_MetaTileEntity_AdvancedCraftingTable {
-
- public GT_MetaTileEntity_BronzeCraftingTable(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription) {
- super(aID, aName, aNameRegional, aTier, aDescription);
- }
- public GT_MetaTileEntity_BronzeCraftingTable(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_BronzeWorkbench(aPlayerInventory, aBaseMetaTileEntity);
- }
+ public GT_MetaTileEntity_BronzeCraftingTable(
+ final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GT_MetaTileEntity_BronzeCraftingTable(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BronzeWorkbench(aPlayerInventory, aBaseMetaTileEntity, mLocalName);
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return false;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_BronzeCraftingTable(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
- return GregTech_API.getCoverBehavior(aStack.toStack()).isSimpleCover();
- }
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_BronzeWorkbench(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BronzeWorkbench(aPlayerInventory, aBaseMetaTileEntity, mLocalName);
+ }
- @Override
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_BronzeCraftingTable(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return GregTech_API.getCoverBehavior(aStack.toStack()).isSimpleCover();
+ }
+
+ @Override
public int rechargerSlotStartIndex() {
- return 0;
+ return 0;
}
-
- @Override
+
+ @Override
public int rechargerSlotCount() {
- return 0;
+ return 0;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 16000;
+ }
+
+ @Override
+ protected boolean isAdvanced() {
+ return false;
}
-
- @Override
- public int getCapacity() {
- return 16000;
- }
-
- @Override
- protected boolean isAdvanced() {
- return false;
- }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java
index a3c11d486b..1c0e682b62 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java
@@ -1,12 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage;
-import net.minecraft.block.Block;
-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 gregtech.api.GregTech_API;
import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
@@ -16,7 +9,6 @@ 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 gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.lib.CORE;
@@ -24,551 +16,554 @@ import gtPlusPlus.core.util.data.ArrayUtils;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SuperChest;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_SuperChest;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.block.Block;
+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;
public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_TieredMachineBlock {
- /*sides.put(getUp());
- sides.put(getDown());
- sides.put(getXPos());
- sides.put(getXNeg());
- sides.put(getZPos());
- sides.put(getZNeg());*/
-
- public int mItemCount = 0;
- public ItemStack mItemStack = null;
- private final static double mStorageFactor = 2;
-
- //Meta Tile ID
- public final static int mCrateID = 955;
-
- //Sides
- public final static int SIDE_Up = 0;
- public final static int SIDE_Down = 1;
- public final static int SIDE_XPos = 2;
- public final static int SIDE_XNeg = 3;
- public final static int SIDE_ZPos = 4;
- public final static int SIDE_ZNeg = 5;
- public final static int[] SIDES = new int[] {SIDE_Up, SIDE_Down, SIDE_XPos, SIDE_XNeg, SIDE_ZPos, SIDE_ZNeg};
-
- //Neighbour Cache
- private GT_MetaTileEntity_ConnectableCrate[] mNeighbourCache = new GT_MetaTileEntity_ConnectableCrate[6];
- //Cached Crate Location
- private BlockPos mCurrentPos = null;
- //Master Crate Position
- protected BlockPos mMasterCrateLocation = null;
- //Is Master?
- protected boolean mIsMaster = false;
- //Is Connected?
- protected boolean mIsConnected[] = new boolean[] {false, false, false, false, false, false};
- //How many are connected?
- protected int mConnectedCount = 0;
- //Map of connected locations
- protected AutoMap<String> mConnectedCache = new AutoMap<String>();
-
-
- public GT_MetaTileEntity_ConnectableCrate(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3,
- "This Crate stores " + (int) (Math.pow(6.0D, (double) aTier) * mStorageFactor) + " Items", new ITexture[0]);
- }
-
- public GT_MetaTileEntity_ConnectableCrate(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- CORE.GT_Tooltip};
- }
-
- public boolean isSimpleMachine() {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_ConnectableCrate(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public int getOppositeSide(int side) {
- if (side == SIDE_Up) {
- return SIDE_Down;
- }
- else if (side == SIDE_Down) {
- return SIDE_Up;
- }
- else if (side == SIDE_XNeg) {
- return SIDE_XPos;
- }
- else if (side == SIDE_XPos) {
- return SIDE_XNeg;
- }
- else if (side == SIDE_ZNeg) {
- return SIDE_ZPos;
- }
- else {
- return SIDE_ZNeg;
- }
- }
-
- public boolean calculateOwnershipIfConnected() {
- if (mCurrentPos == null) {
- mCurrentPos = new BlockPos(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld());
- }
- AutoMap<BlockPos> n = mCurrentPos.getSurroundingBlocks();
- int p = 0;
- for (BlockPos i : n) {
- if (i != null) {
- if (doesSideContainCrate(p)) {
- GT_MetaTileEntity_ConnectableCrate yu = getCrateAtBlockPos(i);
- if (yu != null) {
- mNeighbourCache[p] = yu;
- }
- }
- }
- p++;
- }
-
- int e4 = 0;
- if (mNeighbourCache.length > 0) {
- for (GT_MetaTileEntity_ConnectableCrate e : mNeighbourCache) {
- this.mConnectedCount = this.mConnectedCache.size();
- if (e != null) {
- //First, we check if this Crate is a Master, if not, continue checking what it is.
- if (this.mIsMaster) {
- //So this other Crate is also a master? Which is more Powerful
- if (e.mIsMaster) {
- //This crate holds more connected, it becomes master now.
- if (this.mConnectedCount > e.mConnectedCount) {
- e.mIsMaster = false;
- e.mMasterCrateLocation = this.mCurrentPos;
- if (!e.mIsConnected[getOppositeSide(e4)]) {
- e.mIsConnected[getOppositeSide(e4)] = true;
- }
- if (!this.mIsConnected[e4]) {
- this.mIsConnected[e4] = true;
- }
- this.mConnectedCache = ArrayUtils.mergeTwoMaps(this.mConnectedCache, e.mConnectedCache);
- continue;
- }
- //Other crate held more connected, it is now master.
- else {
- this.mIsMaster = false;
- this.mMasterCrateLocation = e.mCurrentPos;
- if (!this.mIsConnected[e4]) {
- this.mIsConnected[e4] = true;
- }
- if (!e.mIsConnected[getOppositeSide(e4)]) {
- e.mIsConnected[getOppositeSide(e4)] = true;
- }
- e.mConnectedCache = ArrayUtils.mergeTwoMaps(e.mConnectedCache, this.mConnectedCache);
- //Best wipe our cache of connected blocks then, since they no longer hold value.
- mConnectedCache.clear();
- continue;
- }
- }
- //Other Crate was not a Master, but we are, time to inherit it into our connection hivemind.
- else {
- //It would appear this controller has another master, time to query it.
- if (e.mMasterCrateLocation != null && !e.mMasterCrateLocation.getUniqueIdentifier().equalsIgnoreCase(this.mMasterCrateLocation.getUniqueIdentifier())) {
- GT_MetaTileEntity_ConnectableCrate gM = getCrateAtBlockPos(e.mMasterCrateLocation);
- if (gM != null) {
- //Lets compare controller strengths
- int gM_Owned = gM.mConnectedCount;
- //We are stronger, let's inherit it.
- if (this.mConnectedCount > gM_Owned) {
- e.mIsMaster = false;
- e.mMasterCrateLocation = this.mCurrentPos;
- gM.mIsMaster = false;
- gM.mMasterCrateLocation = this.mCurrentPos;
- if (!e.mIsConnected[getOppositeSide(e4)]) {
- e.mIsConnected[getOppositeSide(e4)] = true;
- }
- if (!this.mIsConnected[e4]) {
- this.mIsConnected[e4] = true;
- }
- this.mConnectedCache = ArrayUtils.mergeTwoMaps(this.mConnectedCache, gM.mConnectedCache);
- continue;
- }
- //We lost, time to submit to a new master crate
- else {
- this.mIsMaster = false;
- this.mMasterCrateLocation = e.mMasterCrateLocation;
- if (!this.mIsConnected[e4]) {
- this.mIsConnected[e4] = true;
- }
- if (!e.mIsConnected[getOppositeSide(e4)]) {
- e.mIsConnected[getOppositeSide(e4)] = true;
- }
- gM.mConnectedCache = ArrayUtils.mergeTwoMaps(gM.mConnectedCache, this.mConnectedCache);
- //Best wipe our cache of connected blocks then, since they no longer hold value.
- mConnectedCache.clear();
- continue;
- }
- }
- else {
- //Could not get the Tile Entity for the Other Master Crate.. Guess I can just ignore this case for now~ TODO
- continue;
- }
- }
- //Either the other crate has no known Master or it is already this crate.
- else {
- //The other crate has no master, time to inherit.
- if (e.mMasterCrateLocation == null || (!e.mIsConnected[getOppositeSide(e4)])) {
- e.mMasterCrateLocation = this.mCurrentPos;
- if (!e.mIsConnected[getOppositeSide(e4)]) {
- e.mIsConnected[getOppositeSide(e4)] = true;
- }
- if (!this.mIsConnected[e4]) {
- this.mIsConnected[e4] = true;
- }
- mConnectedCache.put(e.mCurrentPos.getUniqueIdentifier());
- continue;
- }
- else {
- //Do nothing, we own this Crate already :)
- continue;
- }
-
-
- }
- }
- }
-
- //We are not a Storage Master Crate, into a brave new world we go
- else {
- //Best wipe our cache of connected blocks then, since they no longer hold value.
- mConnectedCache.clear();
-
- //Dang, the other crate is a master, time to get incorporated.
- if (e.mIsMaster) {
- this.mIsMaster = false;
- this.mMasterCrateLocation = e.mCurrentPos;
- this.mIsConnected[e4] = true;
- if (!e.mIsConnected[e4]) {
- e.mIsConnected[e4] = true;
- }
- if (e.mMasterCrateLocation == null) {
- e.mMasterCrateLocation = e.mCurrentPos;
- }
- e.mConnectedCache.put(this.mCurrentPos.getUniqueIdentifier());
- continue;
- }
- //So the Crate we Checked is not a Master, so let's see if it knows where one is
- else {
- //So, this Crate we have found knows about a master
- if (e.mMasterCrateLocation != null) {
- GT_MetaTileEntity_ConnectableCrate gM = getCrateAtBlockPos(e.mMasterCrateLocation);
- //Found the master crate
- if (gM != null) {
- this.mIsMaster = false;
- this.mMasterCrateLocation = e.mMasterCrateLocation;
- if (!this.mIsConnected[e4]) {
- this.mIsConnected[e4] = true;
- }
- if (!e.mIsConnected[getOppositeSide(e4)]) {
- e.mIsConnected[getOppositeSide(e4)] = true;
- }
- gM.mConnectedCache.put(this.mCurrentPos.getUniqueIdentifier());
- continue;
- }
- else {
- //Could not get the Tile Entity for the Other Master Crate.. Guess I can just ignore this case for now~ TODO
- continue;
- }
- }
- //This crate has no master, not going to check if it's connected.
- else {
- this.mIsMaster = true;
- this.mMasterCrateLocation = this.mCurrentPos;
- e.mIsMaster = false;
- e.mMasterCrateLocation = this.mCurrentPos;
- if (!e.mIsConnected[getOppositeSide(e4)]) {
- e.mIsConnected[getOppositeSide(e4)] = true;
- }
- if (!this.mIsConnected[e4]) {
- this.mIsConnected[e4] = true;
- }
- mConnectedCache.put(e.mCurrentPos.getUniqueIdentifier());
- continue;
- }
- }
- }
- }
- e4++;
- }
- return true;
- }
- else {
- return false;
- }
-
-
-
-
- }
-
- public boolean doesSideContainCrate(int side) {
- return checkSideForDataType(0, side);
- }
-
- public boolean isCrateAtSideController(int side) {
- return checkSideForDataType(1, side);
- }
-
- private boolean checkSideForDataType(int aType, int aSide) {
- BlockPos mPosToCheck =
- aSide == SIDE_Up ? mCurrentPos.getUp() :
- aSide == SIDE_Down ? mCurrentPos.getDown() :
- aSide == SIDE_XPos ? mCurrentPos.getXPos() :
- aSide == SIDE_XNeg ? mCurrentPos.getXNeg() :
- aSide == SIDE_ZPos ? mCurrentPos.getZPos() :
- mCurrentPos.getZNeg();
- GT_MetaTileEntity_ConnectableCrate g = getCrateAtBlockPos(mPosToCheck);
- if (g != null) {
- if (aType == 0) {
- return true;
- }
- else {
- if (g.mIsMaster) {
- return true;
- }
- }
- }
- return false;
- }
-
- public GT_MetaTileEntity_ConnectableCrate getCrateAtBlockPos(BlockPos pos) {
- if (pos != null) {
- Block b = pos.getBlockAtPos();
- int m = pos.getMetaAtPos();
- TileEntity t = pos.world.getTileEntity(pos.xPos, pos.yPos, pos.zPos);
- if (b != null && t != null) {
- if (b == GregTech_API.sBlockMachines && m == mCrateID) {
- if (t instanceof IGregTechTileEntity) {
- IGregTechTileEntity g = (IGregTechTileEntity) t;
- final IMetaTileEntity aMetaTileEntity = g.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return null;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_ConnectableCrate) {
- return ((GT_MetaTileEntity_ConnectableCrate) aMetaTileEntity);
-
- }
- }
- }
- }
- }
- return null;
- }
-
-
-
-
-
-
-
-
-
-
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- } else {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_SuperChest(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_SuperChest(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) {
- if (this.getItemCount() <= 0) {
- this.mItemStack = null;
- this.mItemCount = 0;
- }
-
- if (this.mItemStack == null && this.mInventory[0] != null) {
- this.mItemStack = this.mInventory[0].copy();
- }
-
- if (this.mInventory[0] != null && this.mItemCount < this.getMaxItemCount()
- && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) {
- this.mItemCount += this.mInventory[0].stackSize;
- if (this.mItemCount > this.getMaxItemCount()) {
- this.mInventory[0].stackSize = this.mItemCount - this.getMaxItemCount();
- this.mItemCount = this.getMaxItemCount();
- } else {
- this.mInventory[0] = null;
- }
- }
-
- if (this.mInventory[1] == null && this.mItemStack != null) {
- this.mInventory[1] = this.mItemStack.copy();
- this.mInventory[1].stackSize = Math.min(this.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();
- this.mInventory[2].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount);
- } else {
- this.mInventory[2] = null;
- }
- }
-
- }
-
- private int getItemCount() {
- return this.mItemCount;
- }
-
- public void setItemCount(int aCount) {
- this.mItemCount = aCount;
- }
-
- public int getProgresstime() {
- return this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize)
- + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize);
- }
-
- public int maxProgresstime() {
- return this.getMaxItemCount();
- }
-
- public int getMaxItemCount() {
- return (int) (Math.pow(6.0D, (double) this.mTier) * mStorageFactor - 128.0D);
- }
-
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aIndex == 1;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aIndex == 0 && (this.mInventory[0] == null || GT_Utility.areStacksEqual(this.mInventory[0], aStack));
- }
-
- public String[] getInfoData() {
- return this.mItemStack == null
- ? new String[]{"Super Storage Chest", "Stored Items:", "No Items", Integer.toString(0),
- Integer.toString(this.getMaxItemCount())}
- : new String[]{"Super Storage Chest", "Stored Items:", this.mItemStack.getDisplayName(),
- Integer.toString(this.mItemCount), Integer.toString(this.getMaxItemCount())};
- }
-
- public boolean isGivingInformation() {
- return true;
- }
-
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mItemCount", this.mItemCount);
- if (this.mItemStack != null) {
- aNBT.setTag("mItemStack", this.mItemStack.writeToNBT(new NBTTagCompound()));
- }
- aNBT.setString("mMasterCrateLocation", mMasterCrateLocation.getUniqueIdentifier());
- aNBT.setBoolean("mIsMaster", mIsMaster);
- for (int y=0;y<this.mIsConnected.length;y++) {
- aNBT.setBoolean("mIsConnected"+y, mIsConnected[y]);
- }
- aNBT.setInteger("mConnectedCount", mConnectedCount);
- }
-
- 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"));
- }
- if (aNBT.hasKey("mMasterCrateLocation")) {
- this.mMasterCrateLocation = BlockPos.generateBlockPos(aNBT.getString("mMasterCrateLocation"));
- }
- if (aNBT.hasKey("mIsMaster")) {
- this.mIsMaster = aNBT.getBoolean("mIsMaster");
- }
-
- for (int y=0;y<this.mIsConnected.length;y++) {
- if (aNBT.hasKey("mIsConnected"+y)) {
- this.mIsConnected[y] = aNBT.getBoolean("mIsConnected"+y);
- }
- }
-
- if (aNBT.hasKey("mConnectedCount")) {
- this.mConnectedCount = aNBT.getInteger("mConnectedCount");
- }
-
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
- return aBaseMetaTileEntity.getFrontFacing() == 0 && aSide == 4
- ? new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON),
- new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST)}
- : (aSide == aBaseMetaTileEntity.getFrontFacing()
- ? new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON),
- new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST)}
- : new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON)});
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- return new ITexture[0][0][0];
- }
-
- @Override
- public void onExplosion() {
- // TODO Auto-generated method stub
- super.onExplosion();
- }
-
- @Override
- public void onRemoval() {
- // TODO Auto-generated method stub
- super.onRemoval();
- }
-
- @Override
- public void onMachineBlockUpdate() {
- // TODO Auto-generated method stub
- super.onMachineBlockUpdate();
- }
-} \ No newline at end of file
+ /*sides.put(getUp());
+ sides.put(getDown());
+ sides.put(getXPos());
+ sides.put(getXNeg());
+ sides.put(getZPos());
+ sides.put(getZNeg());*/
+
+ public int mItemCount = 0;
+ public ItemStack mItemStack = null;
+ private static final double mStorageFactor = 2;
+
+ // Meta Tile ID
+ public static final int mCrateID = 955;
+
+ // Sides
+ public static final int SIDE_Up = 0;
+ public static final int SIDE_Down = 1;
+ public static final int SIDE_XPos = 2;
+ public static final int SIDE_XNeg = 3;
+ public static final int SIDE_ZPos = 4;
+ public static final int SIDE_ZNeg = 5;
+ public static final int[] SIDES = new int[] {SIDE_Up, SIDE_Down, SIDE_XPos, SIDE_XNeg, SIDE_ZPos, SIDE_ZNeg};
+
+ // Neighbour Cache
+ private GT_MetaTileEntity_ConnectableCrate[] mNeighbourCache = new GT_MetaTileEntity_ConnectableCrate[6];
+ // Cached Crate Location
+ private BlockPos mCurrentPos = null;
+ // Master Crate Position
+ protected BlockPos mMasterCrateLocation = null;
+ // Is Master?
+ protected boolean mIsMaster = false;
+ // Is Connected?
+ protected boolean mIsConnected[] = new boolean[] {false, false, false, false, false, false};
+ // How many are connected?
+ protected int mConnectedCount = 0;
+ // Map of connected locations
+ protected AutoMap<String> mConnectedCache = new AutoMap<String>();
+
+ public GT_MetaTileEntity_ConnectableCrate(int aID, String aName, String aNameRegional, int aTier) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 3,
+ "This Crate stores " + (int) (Math.pow(6.0D, (double) aTier) * mStorageFactor) + " Items",
+ new ITexture[0]);
+ }
+
+ public GT_MetaTileEntity_ConnectableCrate(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, CORE.GT_Tooltip};
+ }
+
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_ConnectableCrate(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public int getOppositeSide(int side) {
+ if (side == SIDE_Up) {
+ return SIDE_Down;
+ } else if (side == SIDE_Down) {
+ return SIDE_Up;
+ } else if (side == SIDE_XNeg) {
+ return SIDE_XPos;
+ } else if (side == SIDE_XPos) {
+ return SIDE_XNeg;
+ } else if (side == SIDE_ZNeg) {
+ return SIDE_ZPos;
+ } else {
+ return SIDE_ZNeg;
+ }
+ }
+
+ public boolean calculateOwnershipIfConnected() {
+ if (mCurrentPos == null) {
+ mCurrentPos = new BlockPos(
+ this.getBaseMetaTileEntity().getXCoord(),
+ this.getBaseMetaTileEntity().getYCoord(),
+ this.getBaseMetaTileEntity().getZCoord(),
+ this.getBaseMetaTileEntity().getWorld());
+ }
+ AutoMap<BlockPos> n = mCurrentPos.getSurroundingBlocks();
+ int p = 0;
+ for (BlockPos i : n) {
+ if (i != null) {
+ if (doesSideContainCrate(p)) {
+ GT_MetaTileEntity_ConnectableCrate yu = getCrateAtBlockPos(i);
+ if (yu != null) {
+ mNeighbourCache[p] = yu;
+ }
+ }
+ }
+ p++;
+ }
+
+ int e4 = 0;
+ if (mNeighbourCache.length > 0) {
+ for (GT_MetaTileEntity_ConnectableCrate e : mNeighbourCache) {
+ this.mConnectedCount = this.mConnectedCache.size();
+ if (e != null) {
+ // First, we check if this Crate is a Master, if not, continue checking what it is.
+ if (this.mIsMaster) {
+ // So this other Crate is also a master? Which is more Powerful
+ if (e.mIsMaster) {
+ // This crate holds more connected, it becomes master now.
+ if (this.mConnectedCount > e.mConnectedCount) {
+ e.mIsMaster = false;
+ e.mMasterCrateLocation = this.mCurrentPos;
+ if (!e.mIsConnected[getOppositeSide(e4)]) {
+ e.mIsConnected[getOppositeSide(e4)] = true;
+ }
+ if (!this.mIsConnected[e4]) {
+ this.mIsConnected[e4] = true;
+ }
+ this.mConnectedCache = ArrayUtils.mergeTwoMaps(this.mConnectedCache, e.mConnectedCache);
+ continue;
+ }
+ // Other crate held more connected, it is now master.
+ else {
+ this.mIsMaster = false;
+ this.mMasterCrateLocation = e.mCurrentPos;
+ if (!this.mIsConnected[e4]) {
+ this.mIsConnected[e4] = true;
+ }
+ if (!e.mIsConnected[getOppositeSide(e4)]) {
+ e.mIsConnected[getOppositeSide(e4)] = true;
+ }
+ e.mConnectedCache = ArrayUtils.mergeTwoMaps(e.mConnectedCache, this.mConnectedCache);
+ // Best wipe our cache of connected blocks then, since they no longer hold value.
+ mConnectedCache.clear();
+ continue;
+ }
+ }
+ // Other Crate was not a Master, but we are, time to inherit it into our connection hivemind.
+ else {
+ // It would appear this controller has another master, time to query it.
+ if (e.mMasterCrateLocation != null
+ && !e.mMasterCrateLocation
+ .getUniqueIdentifier()
+ .equalsIgnoreCase(this.mMasterCrateLocation.getUniqueIdentifier())) {
+ GT_MetaTileEntity_ConnectableCrate gM = getCrateAtBlockPos(e.mMasterCrateLocation);
+ if (gM != null) {
+ // Lets compare controller strengths
+ int gM_Owned = gM.mConnectedCount;
+ // We are stronger, let's inherit it.
+ if (this.mConnectedCount > gM_Owned) {
+ e.mIsMaster = false;
+ e.mMasterCrateLocation = this.mCurrentPos;
+ gM.mIsMaster = false;
+ gM.mMasterCrateLocation = this.mCurrentPos;
+ if (!e.mIsConnected[getOppositeSide(e4)]) {
+ e.mIsConnected[getOppositeSide(e4)] = true;
+ }
+ if (!this.mIsConnected[e4]) {
+ this.mIsConnected[e4] = true;
+ }
+ this.mConnectedCache =
+ ArrayUtils.mergeTwoMaps(this.mConnectedCache, gM.mConnectedCache);
+ continue;
+ }
+ // We lost, time to submit to a new master crate
+ else {
+ this.mIsMaster = false;
+ this.mMasterCrateLocation = e.mMasterCrateLocation;
+ if (!this.mIsConnected[e4]) {
+ this.mIsConnected[e4] = true;
+ }
+ if (!e.mIsConnected[getOppositeSide(e4)]) {
+ e.mIsConnected[getOppositeSide(e4)] = true;
+ }
+ gM.mConnectedCache =
+ ArrayUtils.mergeTwoMaps(gM.mConnectedCache, this.mConnectedCache);
+ // Best wipe our cache of connected blocks then, since they no longer hold
+ // value.
+ mConnectedCache.clear();
+ continue;
+ }
+ } else {
+ // Could not get the Tile Entity for the Other Master Crate.. Guess I can just
+ // ignore this case for now~ TODO
+ continue;
+ }
+ }
+ // Either the other crate has no known Master or it is already this crate.
+ else {
+ // The other crate has no master, time to inherit.
+ if (e.mMasterCrateLocation == null || (!e.mIsConnected[getOppositeSide(e4)])) {
+ e.mMasterCrateLocation = this.mCurrentPos;
+ if (!e.mIsConnected[getOppositeSide(e4)]) {
+ e.mIsConnected[getOppositeSide(e4)] = true;
+ }
+ if (!this.mIsConnected[e4]) {
+ this.mIsConnected[e4] = true;
+ }
+ mConnectedCache.put(e.mCurrentPos.getUniqueIdentifier());
+ continue;
+ } else {
+ // Do nothing, we own this Crate already :)
+ continue;
+ }
+ }
+ }
+ }
+
+ // We are not a Storage Master Crate, into a brave new world we go
+ else {
+ // Best wipe our cache of connected blocks then, since they no longer hold value.
+ mConnectedCache.clear();
+
+ // Dang, the other crate is a master, time to get incorporated.
+ if (e.mIsMaster) {
+ this.mIsMaster = false;
+ this.mMasterCrateLocation = e.mCurrentPos;
+ this.mIsConnected[e4] = true;
+ if (!e.mIsConnected[e4]) {
+ e.mIsConnected[e4] = true;
+ }
+ if (e.mMasterCrateLocation == null) {
+ e.mMasterCrateLocation = e.mCurrentPos;
+ }
+ e.mConnectedCache.put(this.mCurrentPos.getUniqueIdentifier());
+ continue;
+ }
+ // So the Crate we Checked is not a Master, so let's see if it knows where one is
+ else {
+ // So, this Crate we have found knows about a master
+ if (e.mMasterCrateLocation != null) {
+ GT_MetaTileEntity_ConnectableCrate gM = getCrateAtBlockPos(e.mMasterCrateLocation);
+ // Found the master crate
+ if (gM != null) {
+ this.mIsMaster = false;
+ this.mMasterCrateLocation = e.mMasterCrateLocation;
+ if (!this.mIsConnected[e4]) {
+ this.mIsConnected[e4] = true;
+ }
+ if (!e.mIsConnected[getOppositeSide(e4)]) {
+ e.mIsConnected[getOppositeSide(e4)] = true;
+ }
+ gM.mConnectedCache.put(this.mCurrentPos.getUniqueIdentifier());
+ continue;
+ } else {
+ // Could not get the Tile Entity for the Other Master Crate.. Guess I can just
+ // ignore this case for now~ TODO
+ continue;
+ }
+ }
+ // This crate has no master, not going to check if it's connected.
+ else {
+ this.mIsMaster = true;
+ this.mMasterCrateLocation = this.mCurrentPos;
+ e.mIsMaster = false;
+ e.mMasterCrateLocation = this.mCurrentPos;
+ if (!e.mIsConnected[getOppositeSide(e4)]) {
+ e.mIsConnected[getOppositeSide(e4)] = true;
+ }
+ if (!this.mIsConnected[e4]) {
+ this.mIsConnected[e4] = true;
+ }
+ mConnectedCache.put(e.mCurrentPos.getUniqueIdentifier());
+ continue;
+ }
+ }
+ }
+ }
+ e4++;
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean doesSideContainCrate(int side) {
+ return checkSideForDataType(0, side);
+ }
+
+ public boolean isCrateAtSideController(int side) {
+ return checkSideForDataType(1, side);
+ }
+
+ private boolean checkSideForDataType(int aType, int aSide) {
+ BlockPos mPosToCheck = aSide == SIDE_Up
+ ? mCurrentPos.getUp()
+ : aSide == SIDE_Down
+ ? mCurrentPos.getDown()
+ : aSide == SIDE_XPos
+ ? mCurrentPos.getXPos()
+ : aSide == SIDE_XNeg
+ ? mCurrentPos.getXNeg()
+ : aSide == SIDE_ZPos ? mCurrentPos.getZPos() : mCurrentPos.getZNeg();
+ GT_MetaTileEntity_ConnectableCrate g = getCrateAtBlockPos(mPosToCheck);
+ if (g != null) {
+ if (aType == 0) {
+ return true;
+ } else {
+ if (g.mIsMaster) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public GT_MetaTileEntity_ConnectableCrate getCrateAtBlockPos(BlockPos pos) {
+ if (pos != null) {
+ Block b = pos.getBlockAtPos();
+ int m = pos.getMetaAtPos();
+ TileEntity t = pos.world.getTileEntity(pos.xPos, pos.yPos, pos.zPos);
+ if (b != null && t != null) {
+ if (b == GregTech_API.sBlockMachines && m == mCrateID) {
+ if (t instanceof IGregTechTileEntity) {
+ IGregTechTileEntity g = (IGregTechTileEntity) t;
+ final IMetaTileEntity aMetaTileEntity = g.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return null;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_ConnectableCrate) {
+ return ((GT_MetaTileEntity_ConnectableCrate) aMetaTileEntity);
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ } else {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SuperChest(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SuperChest(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (this.getBaseMetaTileEntity().isServerSide()
+ && this.getBaseMetaTileEntity().isAllowedToWork()) {
+ if (this.getItemCount() <= 0) {
+ this.mItemStack = null;
+ this.mItemCount = 0;
+ }
+
+ if (this.mItemStack == null && this.mInventory[0] != null) {
+ this.mItemStack = this.mInventory[0].copy();
+ }
+
+ if (this.mInventory[0] != null
+ && this.mItemCount < this.getMaxItemCount()
+ && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) {
+ this.mItemCount += this.mInventory[0].stackSize;
+ if (this.mItemCount > this.getMaxItemCount()) {
+ this.mInventory[0].stackSize = this.mItemCount - this.getMaxItemCount();
+ this.mItemCount = this.getMaxItemCount();
+ } else {
+ this.mInventory[0] = null;
+ }
+ }
+
+ if (this.mInventory[1] == null && this.mItemStack != null) {
+ this.mInventory[1] = this.mItemStack.copy();
+ this.mInventory[1].stackSize = Math.min(this.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();
+ this.mInventory[2].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount);
+ } else {
+ this.mInventory[2] = null;
+ }
+ }
+ }
+
+ private int getItemCount() {
+ return this.mItemCount;
+ }
+
+ public void setItemCount(int aCount) {
+ this.mItemCount = aCount;
+ }
+
+ public int getProgresstime() {
+ return this.mItemCount
+ + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize)
+ + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize);
+ }
+
+ public int maxProgresstime() {
+ return this.getMaxItemCount();
+ }
+
+ public int getMaxItemCount() {
+ return (int) (Math.pow(6.0D, (double) this.mTier) * mStorageFactor - 128.0D);
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == 1;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == 0 && (this.mInventory[0] == null || GT_Utility.areStacksEqual(this.mInventory[0], aStack));
+ }
+
+ public String[] getInfoData() {
+ return this.mItemStack == null
+ ? new String[] {
+ "Super Storage Chest",
+ "Stored Items:",
+ "No Items",
+ Integer.toString(0),
+ Integer.toString(this.getMaxItemCount())
+ }
+ : new String[] {
+ "Super Storage Chest",
+ "Stored Items:",
+ this.mItemStack.getDisplayName(),
+ Integer.toString(this.mItemCount),
+ Integer.toString(this.getMaxItemCount())
+ };
+ }
+
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mItemCount", this.mItemCount);
+ if (this.mItemStack != null) {
+ aNBT.setTag("mItemStack", this.mItemStack.writeToNBT(new NBTTagCompound()));
+ }
+ aNBT.setString("mMasterCrateLocation", mMasterCrateLocation.getUniqueIdentifier());
+ aNBT.setBoolean("mIsMaster", mIsMaster);
+ for (int y = 0; y < this.mIsConnected.length; y++) {
+ aNBT.setBoolean("mIsConnected" + y, mIsConnected[y]);
+ }
+ aNBT.setInteger("mConnectedCount", mConnectedCount);
+ }
+
+ 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"));
+ }
+ if (aNBT.hasKey("mMasterCrateLocation")) {
+ this.mMasterCrateLocation = BlockPos.generateBlockPos(aNBT.getString("mMasterCrateLocation"));
+ }
+ if (aNBT.hasKey("mIsMaster")) {
+ this.mIsMaster = aNBT.getBoolean("mIsMaster");
+ }
+
+ for (int y = 0; y < this.mIsConnected.length; y++) {
+ if (aNBT.hasKey("mIsConnected" + y)) {
+ this.mIsConnected[y] = aNBT.getBoolean("mIsConnected" + y);
+ }
+ }
+
+ if (aNBT.hasKey("mConnectedCount")) {
+ this.mConnectedCount = aNBT.getInteger("mConnectedCount");
+ }
+ }
+
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ return aBaseMetaTileEntity.getFrontFacing() == 0 && aSide == 4
+ ? new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON),
+ new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST)
+ }
+ : (aSide == aBaseMetaTileEntity.getFrontFacing()
+ ? new ITexture[] {
+ new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON),
+ new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST)
+ }
+ : new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON)});
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return new ITexture[0][0][0];
+ }
+
+ @Override
+ public void onExplosion() {
+ // TODO Auto-generated method stub
+ super.onExplosion();
+ }
+
+ @Override
+ public void onRemoval() {
+ // TODO Auto-generated method stub
+ super.onRemoval();
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ // TODO Auto-generated method stub
+ super.onMachineBlockUpdate();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java
index 951b4223dc..b5dcd8cd73 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -15,185 +10,213 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SuperChest;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_SuperChest;
+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_TieredChest extends GT_MetaTileEntity_TieredMachineBlock {
- public int mItemCount = 0;
- public ItemStack mItemStack = null;
- private final static double mStorageFactor = (270000.0D/16);
-
- public GT_MetaTileEntity_TieredChest(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3,
- "This Chest stores " + (int) (Math.pow(6.0D, (double) aTier) * mStorageFactor) + " Items", new ITexture[0]);
- }
-
- public GT_MetaTileEntity_TieredChest(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- /*public GT_MetaTileEntity_TieredChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }*/
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- CORE.GT_Tooltip};
- }
-
- public boolean isSimpleMachine() {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_TieredChest(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- } else {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_SuperChest(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_SuperChest(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) {
- if (this.getItemCount() <= 0) {
- this.mItemStack = null;
- this.mItemCount = 0;
- }
-
- if (this.mItemStack == null && this.mInventory[0] != null) {
- this.mItemStack = this.mInventory[0].copy();
- }
-
- if (this.mInventory[0] != null && this.mItemCount < this.getMaxItemCount()
- && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) {
- this.mItemCount += this.mInventory[0].stackSize;
- if (this.mItemCount > this.getMaxItemCount()) {
- this.mInventory[0].stackSize = this.mItemCount - this.getMaxItemCount();
- this.mItemCount = this.getMaxItemCount();
- } else {
- this.mInventory[0] = null;
- }
- }
-
- if (this.mInventory[1] == null && this.mItemStack != null) {
- this.mInventory[1] = this.mItemStack.copy();
- this.mInventory[1].stackSize = Math.min(this.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();
- this.mInventory[2].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount);
- } else {
- this.mInventory[2] = null;
- }
- }
-
- }
-
- private int getItemCount() {
- return this.mItemCount;
- }
-
- public void setItemCount(int aCount) {
- this.mItemCount = aCount;
- }
-
- public int getProgresstime() {
- return this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize)
- + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize);
- }
-
- public int maxProgresstime() {
- return this.getMaxItemCount();
- }
-
- public int getMaxItemCount() {
- return (int) (Math.pow(6.0D, (double) this.mTier) * mStorageFactor - 128.0D);
- }
-
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aIndex == 1;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aIndex == 0 && (this.mInventory[0] == null || GT_Utility.areStacksEqual(this.mInventory[0], aStack));
- }
-
- public String[] getInfoData() {
- return this.mItemStack == null
- ? new String[]{"Super Storage Chest", "Stored Items:", "No Items", Integer.toString(0),
- Integer.toString(this.getMaxItemCount())}
- : new String[]{"Super Storage Chest", "Stored Items:", this.mItemStack.getDisplayName(),
- Integer.toString(this.mItemCount), Integer.toString(this.getMaxItemCount())};
- }
-
- public boolean isGivingInformation() {
- return true;
- }
-
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mItemCount", this.mItemCount);
- if (this.mItemStack != null) {
- aNBT.setTag("mItemStack", this.mItemStack.writeToNBT(new NBTTagCompound()));
- }
-
- }
-
- 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"));
- }
-
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
- return aBaseMetaTileEntity.getFrontFacing() == 0 && aSide == 4
- ? new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1],
- new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST)}
- : (aSide == aBaseMetaTileEntity.getFrontFacing()
- ? new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1],
- new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST)}
- : new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]});
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- return new ITexture[0][0][0];
- }
-} \ No newline at end of file
+ public int mItemCount = 0;
+ public ItemStack mItemStack = null;
+ private static final double mStorageFactor = (270000.0D / 16);
+
+ public GT_MetaTileEntity_TieredChest(int aID, String aName, String aNameRegional, int aTier) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 3,
+ "This Chest stores " + (int) (Math.pow(6.0D, (double) aTier) * mStorageFactor) + " Items",
+ new ITexture[0]);
+ }
+
+ public GT_MetaTileEntity_TieredChest(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ /*public GT_MetaTileEntity_TieredChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }*/
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, CORE.GT_Tooltip};
+ }
+
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TieredChest(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ } else {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SuperChest(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SuperChest(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (this.getBaseMetaTileEntity().isServerSide()
+ && this.getBaseMetaTileEntity().isAllowedToWork()) {
+ if (this.getItemCount() <= 0) {
+ this.mItemStack = null;
+ this.mItemCount = 0;
+ }
+
+ if (this.mItemStack == null && this.mInventory[0] != null) {
+ this.mItemStack = this.mInventory[0].copy();
+ }
+
+ if (this.mInventory[0] != null
+ && this.mItemCount < this.getMaxItemCount()
+ && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) {
+ this.mItemCount += this.mInventory[0].stackSize;
+ if (this.mItemCount > this.getMaxItemCount()) {
+ this.mInventory[0].stackSize = this.mItemCount - this.getMaxItemCount();
+ this.mItemCount = this.getMaxItemCount();
+ } else {
+ this.mInventory[0] = null;
+ }
+ }
+
+ if (this.mInventory[1] == null && this.mItemStack != null) {
+ this.mInventory[1] = this.mItemStack.copy();
+ this.mInventory[1].stackSize = Math.min(this.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();
+ this.mInventory[2].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount);
+ } else {
+ this.mInventory[2] = null;
+ }
+ }
+ }
+
+ private int getItemCount() {
+ return this.mItemCount;
+ }
+
+ public void setItemCount(int aCount) {
+ this.mItemCount = aCount;
+ }
+
+ public int getProgresstime() {
+ return this.mItemCount
+ + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize)
+ + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize);
+ }
+
+ public int maxProgresstime() {
+ return this.getMaxItemCount();
+ }
+
+ public int getMaxItemCount() {
+ return (int) (Math.pow(6.0D, (double) this.mTier) * mStorageFactor - 128.0D);
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == 1;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == 0 && (this.mInventory[0] == null || GT_Utility.areStacksEqual(this.mInventory[0], aStack));
+ }
+
+ public String[] getInfoData() {
+ return this.mItemStack == null
+ ? new String[] {
+ "Super Storage Chest",
+ "Stored Items:",
+ "No Items",
+ Integer.toString(0),
+ Integer.toString(this.getMaxItemCount())
+ }
+ : new String[] {
+ "Super Storage Chest",
+ "Stored Items:",
+ this.mItemStack.getDisplayName(),
+ Integer.toString(this.mItemCount),
+ Integer.toString(this.getMaxItemCount())
+ };
+ }
+
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mItemCount", this.mItemCount);
+ if (this.mItemStack != null) {
+ aNBT.setTag("mItemStack", this.mItemStack.writeToNBT(new NBTTagCompound()));
+ }
+ }
+
+ 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"));
+ }
+ }
+
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ return aBaseMetaTileEntity.getFrontFacing() == 0 && aSide == 4
+ ? new ITexture[] {
+ BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1],
+ new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST)
+ }
+ : (aSide == aBaseMetaTileEntity.getFrontFacing()
+ ? new ITexture[] {
+ BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1],
+ new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST)
+ }
+ : new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]});
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return new ITexture[0][0][0];
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
index ef7fe829d4..22537dc5cf 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -10,151 +7,172 @@ 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 gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.preloader.asm.AsmConfig;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank {
- public GT_MetaTileEntity_TieredTank(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid");
- }
-
- public GT_MetaTileEntity_TieredTank(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid", aTextures);
- }
-
- @Override
- public String[] getDescription() {
- String[] aTip;
-
- String aTankPortableness = "portable";
-
- if (this.mFluid == null) {
- aTip = new String[] {this.mDescription, "A "+aTankPortableness+" tank.", CORE.GT_Tooltip};
- }
- else {
- aTip = new String[] {this.mDescription, "A "+aTankPortableness+" tank.", "Fluid: "+mFluid.getLocalizedName()+" "+mFluid.amount+"L", CORE.GT_Tooltip};
- }
- return aTip;
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- return new ITexture[0][0][0];
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return aSide == 1 ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER)};
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @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 String[] getInfoData() {
-
- if (this.mFluid == null) {
- return new String[]{
- GT_Values.VOLTAGE_NAMES[this.mTier]+" Fluid Tank",
- "Stored Fluid:",
- "No Fluid",
- Integer.toString(0) + "L",
- Integer.toString(this.getCapacity()) + "L"};
- }
- return new String[]{
- GT_Values.VOLTAGE_NAMES[this.mTier]+" Fluid Tank",
- "Stored Fluid:",
- this.mFluid.getLocalizedName(),
- Integer.toString(this.mFluid.amount) + "L",
- Integer.toString(this.getCapacity()) + "L"};
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_TieredTank(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public int getCapacity() {
- return (int) (Math.pow(2, this.mTier) * 32000);
- }
-
- @Override
- public int getTankPressure() {
- return 100;
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()){
- //setVars();
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public boolean displaysItemStack() {
- return true;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public void setItemNBT(NBTTagCompound aNBT) {
- if (CORE.NBT_PERSISTENCY_PATCH_APPLIED) {
- if (mFluid != null){
- Logger.WARNING("Setting item fluid nbt");
- aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
- if (aNBT.hasKey("mFluid")) {
- Logger.WARNING("Set mFluid to NBT.");
- }
- }
- }
- }
-
-} \ No newline at end of file
+ public GT_MetaTileEntity_TieredTank(
+ final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid");
+ }
+
+ public GT_MetaTileEntity_TieredTank(
+ final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid", aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ String[] aTip;
+
+ String aTankPortableness = "portable";
+
+ if (this.mFluid == null) {
+ aTip = new String[] {this.mDescription, "A " + aTankPortableness + " tank.", CORE.GT_Tooltip};
+ } else {
+ aTip = new String[] {
+ this.mDescription,
+ "A " + aTankPortableness + " tank.",
+ "Fluid: " + mFluid.getLocalizedName() + " " + mFluid.amount + "L",
+ CORE.GT_Tooltip
+ };
+ }
+ return aTip;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ return new ITexture[0][0][0];
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return aSide == 1
+ ? new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE)
+ }
+ : new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER)
+ };
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @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 String[] getInfoData() {
+
+ if (this.mFluid == null) {
+ return new String[] {
+ GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank",
+ "Stored Fluid:",
+ "No Fluid",
+ Integer.toString(0) + "L",
+ Integer.toString(this.getCapacity()) + "L"
+ };
+ }
+ return new String[] {
+ GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank",
+ "Stored Fluid:",
+ this.mFluid.getLocalizedName(),
+ Integer.toString(this.mFluid.amount) + "L",
+ Integer.toString(this.getCapacity()) + "L"
+ };
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TieredTank(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public int getCapacity() {
+ return (int) (Math.pow(2, this.mTier) * 32000);
+ }
+
+ @Override
+ public int getTankPressure() {
+ return 100;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ // setVars();
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ if (CORE.NBT_PERSISTENCY_PATCH_APPLIED) {
+ if (mFluid != null) {
+ Logger.WARNING("Setting item fluid nbt");
+ aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
+ if (aNBT.hasKey("mFluid")) {
+ Logger.WARNING("Set mFluid to NBT.");
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java
index e18f5d4bfc..775c10666e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java
@@ -24,396 +24,507 @@ import net.minecraft.world.World;
public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity {
- protected byte aCurrentOutputAmperage = 4;
-
- public GregtechMetaEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
- }
-
- public GregtechMetaEnergyBuffer(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
- super(aName, aTier, aSlotCount, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {this.mDescription,
- "Defaults 4A In/Out",
- "Change output Amperage with a screwdriver",
- "Now Portable!",
- CORE.GT_Tooltip};
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) {
- if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) {
- return true;
- }
- return super.allowCoverOnSide(aSide, aCover);
- }
-
- /*
- * MACHINE_STEEL_SIDE
- */
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
- }
-
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
- }
-
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
- }
-
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
- }
-
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)};
- }
-
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
- }
-
-
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
- }
-
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
- }
-
-
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
- }
-
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)};
- }
-
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
- }
-
- /*@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[] { new GT_RenderedTexture(
- Textures.BlockIcons.MACHINE_HEATPROOFCASING) };
- rTextures[1][i + 1] = new ITexture[] {
- new GT_RenderedTexture(
- Textures.BlockIcons.MACHINE_HEATPROOFCASING),
- mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]
- : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
- }
- return rTextures;
- }*/
-
- /*
- * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- * ITexture[][][] rTextures = new ITexture[5][17][]; for (byte i = -1; i <
- * 16; i = (byte) (i + 1)) { ITexture[] tmp0 = { new GT_RenderedTexture(
- * Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i,
- * Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = tmp0; ITexture[] tmp1 = {
- * new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_TOP) };
- * rTextures[1][(i + 1)] = tmp1; ITexture[] tmp2 = { new GT_RenderedTexture(
- * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
- * Dyes._NULL.mRGBa)), new
- * GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[2][(i +
- * 1)] = tmp2; ITexture[] tmp4 = { new GT_RenderedTexture(
- * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
- * Dyes._NULL.mRGBa)), new
- * GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; rTextures[3][(i +
- * 1)] = tmp4; ITexture[] tmp5 = { new GT_RenderedTexture(
- * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
- * Dyes._NULL.mRGBa)), new GT_RenderedTexture(
- * Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; rTextures[4][(i + 1)] = tmp5;
- * } 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(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaEnergyBuffer(this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
- }
-
- @Override public boolean isSimpleMachine() {return false;}
- @Override public boolean isElectric() {return true;}
- @Override public boolean isValidSlot(final int aIndex) {return true;}
- @Override public boolean isFacingValid(final byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return true;}
- @Override public boolean isEnetOutput() {return true;}
- @Override public boolean isInputFacing(final byte aSide) {return aSide!=this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isOutputFacing(final byte aSide) {return aSide==this.getBaseMetaTileEntity().getFrontFacing();}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return V[this.mTier]*2;}
- @Override public long maxEUStore() {return V[this.mTier]*250000;}
-
- @Override
- public long maxEUInput() {
- return V[this.mTier];
- }
-
- @Override
- public long maxEUOutput() {
- return V[this.mTier];
- }
-
- @Override
- public long maxAmperesIn() {
- return aCurrentOutputAmperage;
- }
-
- @Override
- public long maxAmperesOut() {
- return aCurrentOutputAmperage;
- }
- @Override public int rechargerSlotStartIndex() {return 0;}
- @Override public int dechargerSlotStartIndex() {return 0;}
- @Override public int rechargerSlotCount() {return 0;}
- @Override public int dechargerSlotCount() {return 0;}
- @Override public int getProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyStored();}
- @Override public int maxProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyCapacity();}
- @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;}
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage);
- if (CORE.NBT_PERSISTENCY_PATCH_APPLIED) {
- long aEU = this.getBaseMetaTileEntity().getStoredEU();
- if (aEU > 0){
- aNBT.setLong("aStoredEU", aEU);
- if (aNBT.hasKey("aStoredEU")) {
- Logger.WARNING("Set aStoredEU to NBT.");
- }
- }
- }
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- aCurrentOutputAmperage = aNBT.getByte("aCurrentOutputAmperage");
- if (aNBT.hasKey("aStoredEU")) {
- this.setEUVar(aNBT.getLong("aStoredEU"));
- }
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- Logger.WARNING("Right Click on MTE by Player");
- if (aBaseMetaTileEntity.isClientSide())
- {
- return true;
- //aBaseMetaTileEntity.openGUI(aPlayer);
- }
-
- Logger.WARNING("MTE is Client-side");
- this.showEnergy(aPlayer.getEntityWorld(), aPlayer);
- return true;
- }
-
- protected void showEnergy(final World worldIn, final EntityPlayer playerIn){
- final long tempStorage = this.getBaseMetaTileEntity().getStoredEU();
- final double c = ((double) tempStorage / this.maxEUStore()) * 100;
- final double roundOff = Math.round(c * 100.00) / 100.00;
- PlayerUtils.messagePlayer(playerIn, "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at "+V[this.mTier]+"v ("+roundOff+"%)");
- PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut())+"A");
-
- }
- //Utils.LOG_WARNING("Begin Show Energy");
- /*
- *
- //Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" C: "+c);
- Utils.LOG_INFO("getProgressTime: "+getProgresstime());
- Utils.LOG_INFO("maxProgressTime: "+maxProgresstime());
- Utils.LOG_INFO("getMinimumStoredEU: "+getMinimumStoredEU());
- Utils.LOG_INFO("maxEUStore: "+maxEUStore());*/
- /*final long d = (tempStorage * 100L) / maxEUStore();
- Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" D: "+d);
- final double roundOff2 = Math.round(d * 100.00) / 100.00;
- Utils.messagePlayer(playerIn, "Energy: " + tempStorage + " EU at "+V[mTier]+"v ("+roundOff2+"%)");
- Utils.LOG_WARNING("Making new instance of Guihandler");
- GuiHandler block = new GuiHandler();
- Utils.LOG_WARNING("Guihandler.toString(): "+block.toString());
- block.getClientGuiElement(1, playerIn, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);*/
-
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public String[] getInfoData() {
- String cur = GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getStoredEU());
- String max = GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getEUCapacity());
-
- // Right-align current storage with maximum storage
- String fmt = String.format("%%%ds", max.length());
- cur = String.format(fmt, cur);
-
- return new String[] {
- cur+" EU stored",
- max+" EU capacity"};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- return new int[] {};
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(final int p_70301_1_) {
- return null;
- }
-
- @Override
- public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
- return null;
- }
-
- @Override
- public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {
- }
-
- @Override
- public String getInventoryName() {
- return super.getInventoryName();
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 0;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
- return false;
- }
-
- @Override
- public void openInventory() {
- }
-
- @Override
- public void closeInventory() {
- }
-
- @Override
- public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
- return false;
- }
-
- @Override
- public void setItemNBT(NBTTagCompound aNBT) {
- if (CORE.NBT_PERSISTENCY_PATCH_APPLIED) {
- aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage);
- long aEU = this.getBaseMetaTileEntity().getStoredEU();
- if (aEU > 0){
- aNBT.setLong("aStoredEU", aEU);
- if (aNBT.hasKey("aStoredEU")) {
- Logger.WARNING("Set aStoredEU to NBT.");
- }
- }
- }
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- byte aTest = (byte) (aCurrentOutputAmperage + 1);
- if (aTest > 16 || aTest <= 0 ) {
- aTest = 1;
- }
- aCurrentOutputAmperage = aTest;
- PlayerUtils.messagePlayer(aPlayer, "Now handling "+aCurrentOutputAmperage+" Amps.");
- }
-
-
-
-
-
-
-} \ No newline at end of file
+ protected byte aCurrentOutputAmperage = 4;
+
+ public GregtechMetaEnergyBuffer(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final String aDescription,
+ final int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
+ }
+
+ public GregtechMetaEnergyBuffer(
+ final String aName,
+ final int aTier,
+ final String aDescription,
+ final ITexture[][][] aTextures,
+ final int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ this.mDescription,
+ "Defaults 4A In/Out",
+ "Change output Amperage with a screwdriver",
+ "Now Portable!",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) {
+ if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) {
+ return true;
+ }
+ return super.allowCoverOnSide(aSide, aCover);
+ }
+
+ /*
+ * MACHINE_STEEL_SIDE
+ */
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+ return this.mTextures[
+ (aActive ? 5 : 0)
+ + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
+ aColorIndex + 1];
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ };
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
+ };
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
+ };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)
+ };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
+ };
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
+ };
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
+ };
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
+ };
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)
+ };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
+ };
+ }
+
+ /*@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[] { new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_HEATPROOFCASING) };
+ rTextures[1][i + 1] = new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_HEATPROOFCASING),
+ mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]
+ : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ }
+ return rTextures;
+ }*/
+
+ /*
+ * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ * ITexture[][][] rTextures = new ITexture[5][17][]; for (byte i = -1; i <
+ * 16; i = (byte) (i + 1)) { ITexture[] tmp0 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = tmp0; ITexture[] tmp1 = {
+ * new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_TOP) };
+ * rTextures[1][(i + 1)] = tmp1; ITexture[] tmp2 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)), new
+ * GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[2][(i +
+ * 1)] = tmp2; ITexture[] tmp4 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)), new
+ * GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; rTextures[3][(i +
+ * 1)] = tmp4; ITexture[] tmp5 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)), new GT_RenderedTexture(
+ * Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; rTextures[4][(i + 1)] = tmp5;
+ * } 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(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaEnergyBuffer(
+ this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(final byte aSide) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return V[this.mTier] * 2;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[this.mTier] * 250000;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[this.mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[this.mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return aCurrentOutputAmperage;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return aCurrentOutputAmperage;
+ }
+
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int dechargerSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored();
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
+ }
+
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage);
+ if (CORE.NBT_PERSISTENCY_PATCH_APPLIED) {
+ long aEU = this.getBaseMetaTileEntity().getStoredEU();
+ if (aEU > 0) {
+ aNBT.setLong("aStoredEU", aEU);
+ if (aNBT.hasKey("aStoredEU")) {
+ Logger.WARNING("Set aStoredEU to NBT.");
+ }
+ }
+ }
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ aCurrentOutputAmperage = aNBT.getByte("aCurrentOutputAmperage");
+ if (aNBT.hasKey("aStoredEU")) {
+ this.setEUVar(aNBT.getLong("aStoredEU"));
+ }
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ Logger.WARNING("Right Click on MTE by Player");
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ // aBaseMetaTileEntity.openGUI(aPlayer);
+ }
+
+ Logger.WARNING("MTE is Client-side");
+ this.showEnergy(aPlayer.getEntityWorld(), aPlayer);
+ return true;
+ }
+
+ protected void showEnergy(final World worldIn, final EntityPlayer playerIn) {
+ final long tempStorage = this.getBaseMetaTileEntity().getStoredEU();
+ final double c = ((double) tempStorage / this.maxEUStore()) * 100;
+ final double roundOff = Math.round(c * 100.00) / 100.00;
+ PlayerUtils.messagePlayer(
+ playerIn,
+ "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at " + V[this.mTier] + "v (" + roundOff
+ + "%)");
+ PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut()) + "A");
+ }
+ // Utils.LOG_WARNING("Begin Show Energy");
+ /*
+ *
+ //Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" C: "+c);
+ Utils.LOG_INFO("getProgressTime: "+getProgresstime());
+ Utils.LOG_INFO("maxProgressTime: "+maxProgresstime());
+ Utils.LOG_INFO("getMinimumStoredEU: "+getMinimumStoredEU());
+ Utils.LOG_INFO("maxEUStore: "+maxEUStore());*/
+ /*final long d = (tempStorage * 100L) / maxEUStore();
+ Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" D: "+d);
+ final double roundOff2 = Math.round(d * 100.00) / 100.00;
+ Utils.messagePlayer(playerIn, "Energy: " + tempStorage + " EU at "+V[mTier]+"v ("+roundOff2+"%)");
+ Utils.LOG_WARNING("Making new instance of Guihandler");
+ GuiHandler block = new GuiHandler();
+ Utils.LOG_WARNING("Guihandler.toString(): "+block.toString());
+ block.getClientGuiElement(1, playerIn, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);*/
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
+ }
+
+ @Override
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ String cur = GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getStoredEU());
+ String max = GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getEUCapacity());
+
+ // Right-align current storage with maximum storage
+ String fmt = String.format("%%%ds", max.length());
+ cur = String.format(fmt, cur);
+
+ return new String[] {cur + " EU stored", max + " EU capacity"};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ return new int[] {};
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int p_70301_1_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {}
+
+ @Override
+ public String getInventoryName() {
+ return super.getInventoryName();
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 0;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
+ return false;
+ }
+
+ @Override
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
+ return false;
+ }
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ if (CORE.NBT_PERSISTENCY_PATCH_APPLIED) {
+ aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage);
+ long aEU = this.getBaseMetaTileEntity().getStoredEU();
+ if (aEU > 0) {
+ aNBT.setLong("aStoredEU", aEU);
+ if (aNBT.hasKey("aStoredEU")) {
+ Logger.WARNING("Set aStoredEU to NBT.");
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ byte aTest = (byte) (aCurrentOutputAmperage + 1);
+ if (aTest > 16 || aTest <= 0) {
+ aTest = 1;
+ }
+ aCurrentOutputAmperage = aTest;
+ PlayerUtils.messagePlayer(aPlayer, "Now handling " + aCurrentOutputAmperage + " Amps.");
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java
index 63042d4702..064312fae2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java
@@ -1,62 +1,71 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage;
-import net.minecraft.entity.player.InventoryPlayer;
-
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.objects.GT_RenderedTexture;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SafeBlock;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_SafeBlock;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaSafeBlockBase;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GregtechMetaSafeBlock extends GregtechMetaSafeBlockBase {
+
+ public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier) {
+ super(aID, aName, aNameRegional, aTier, 28, "Protecting your items from sticky fingers.");
+ }
+
+ public GregtechMetaSafeBlock(
+ final int aID,
+ final String aName,
+ final String aNameRegional,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
+
+ public GregtechMetaSafeBlock(
+ final String aName,
+ final int aTier,
+ final int aInvSlotCount,
+ final String aDescription,
+ final ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, CORE.GT_Tooltip};
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaSafeBlock(
+ this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.VOID);
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return aIndex < (this.mInventory.length - 1);
+ }
+
+ @Override
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
+ }
-public class GregtechMetaSafeBlock
-extends GregtechMetaSafeBlockBase {
-
- public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, 28, "Protecting your items from sticky fingers.");
- }
-
- public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier, final int aInvSlotCount, final String aDescription) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
- }
-
- public GregtechMetaSafeBlock(final String aName, final int aTier, final int aInvSlotCount, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- CORE.GT_Tooltip};
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaSafeBlock(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
- }
-
- @Override
- public ITexture getOverlayIcon() {
- return new GT_RenderedTexture(Textures.BlockIcons.VOID);
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < (this.mInventory.length - 1);
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
- }
+ @Override
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java
index fb37f33055..1ca167925c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java
@@ -1,9 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage.creative;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -11,95 +7,95 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_TieredChest {
- public GT_MetaTileEntity_InfiniteItemHolder(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier);
- }
-
- public GT_MetaTileEntity_InfiniteItemHolder(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- this.mDescription,
- CORE.GT_Tooltip};
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.getWorld().isRemote) {
- return false;
- }
-
- if (!KeyboardUtils.isShiftKeyDown()) {
- if (this.mItemStack == null) {
- if (aPlayer.getHeldItem() != null) {
- this.mItemStack = aPlayer.getHeldItem().copy();
- this.mItemCount = Short.MAX_VALUE;
- aPlayer.setCurrentItemOrArmor(0, null);
- PlayerUtils.messagePlayer(aPlayer, "Now holding "+this.mItemStack.getDisplayName()+" x"+Short.MAX_VALUE+".");
- return true;
- }
- }
- else {
- if (aPlayer.getHeldItem() == null) {
- aPlayer.entityDropItem(mItemStack, 1);
- this.mItemStack = null;
- this.mItemCount = 0;
- PlayerUtils.messagePlayer(aPlayer, "Emptying.");
- return true;
- }
- }
- }
-
- PlayerUtils.messagePlayer(aPlayer, "Currently holding: "+(this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing")+" x"+this.mItemCount);
- return true;
- //return super.onRightclick(aBaseMetaTileEntity, aPlayer);
- }
-
- @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 void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (mItemStack != null) {
- setItemCount(0);
- }
- super.onPostTick(aBaseMetaTileEntity, aTimer);
- }
-
- @Override
- public void setItemCount(int aCount) {
- super.setItemCount(Short.MAX_VALUE);
- }
-
- @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 false;
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_InfiniteItemHolder(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
-
-
-
-
+ public GT_MetaTileEntity_InfiniteItemHolder(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ }
+
+ public GT_MetaTileEntity_InfiniteItemHolder(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {this.mDescription, CORE.GT_Tooltip};
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.getWorld().isRemote) {
+ return false;
+ }
+
+ if (!KeyboardUtils.isShiftKeyDown()) {
+ if (this.mItemStack == null) {
+ if (aPlayer.getHeldItem() != null) {
+ this.mItemStack = aPlayer.getHeldItem().copy();
+ this.mItemCount = Short.MAX_VALUE;
+ aPlayer.setCurrentItemOrArmor(0, null);
+ PlayerUtils.messagePlayer(
+ aPlayer, "Now holding " + this.mItemStack.getDisplayName() + " x" + Short.MAX_VALUE + ".");
+ return true;
+ }
+ } else {
+ if (aPlayer.getHeldItem() == null) {
+ aPlayer.entityDropItem(mItemStack, 1);
+ this.mItemStack = null;
+ this.mItemCount = 0;
+ PlayerUtils.messagePlayer(aPlayer, "Emptying.");
+ return true;
+ }
+ }
+ }
+
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "Currently holding: " + (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing") + " x"
+ + this.mItemCount);
+ return true;
+ // return super.onRightclick(aBaseMetaTileEntity, aPlayer);
+ }
+
+ @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 void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (mItemStack != null) {
+ setItemCount(0);
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTimer);
+ }
+
+ @Override
+ public void setItemCount(int aCount) {
+ super.setItemCount(Short.MAX_VALUE);
+ }
+
+ @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 false;
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_InfiniteItemHolder(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java
index 43d5cffe82..18e95861b3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -14,346 +9,366 @@ import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric {
- public byte mType = 0;
- public String mOldDesc = "";
- public boolean mLocked = false;
- protected byte mIndex = (byte) MathUtils.randInt(1, 3);
- public static GT_RenderedTexture texBottom = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_bottom"));
- public static GT_RenderedTexture texTop = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_top"));
- public static GT_RenderedTexture texSide = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_side"));
- public static GT_RenderedTexture texSideCabinet = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_side_cabinet"));
-
- public GT4Entity_Shelf(final int aID, final String aName, final String aNameRegional, final String aDescription) {
- super(aID, aName, aNameRegional, 0, aDescription);
- mOldDesc = aDescription;
- }
-
- public GT4Entity_Shelf(final String aName, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, 0, aDescription, aTextures);
- mOldDesc = aDescription;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- public int getInvSize() {
- return 1;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- if (this.getBaseMetaTileEntity().getOwnerName().equalsIgnoreCase(aPlayer.getDisplayName())) {
- return true;
- }
- PlayerUtils.messagePlayer(aPlayer, "This container belongs to "+this.getBaseMetaTileEntity().getOwnerName()+".");
- return false;
- }
-
- @Override
- public boolean ownerControl() {
- return false;
- }
-
- @Override
- public boolean isEnetOutput() {
- return false;
- }
-
- @Override
- public boolean isEnetInput() {
- return false;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public boolean isInputFacing(byte aSide) {
- return false;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aTile, EntityPlayer aPlayer) {
- if (aTile.isClientSide()) {
- return true;
- }
- ItemStack tStack = aPlayer.inventory.getStackInSlot(aPlayer.inventory.currentItem);
- if (tStack == null) {
- if (KeyboardUtils.isCtrlKeyDown()) {
- if (this.mInventory[0] != null) {
- PlayerUtils.messagePlayer(aPlayer, "Contains "+this.mInventory[0].getDisplayName()+" x"+this.mInventory[0].stackSize+".");
- }
- return false;
- }
- else {
- if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) {
- if (!this.mLocked) {
- PlayerUtils.messagePlayer(aPlayer, "Removed "+this.mInventory[0].getDisplayName()+" x"+this.mInventory[0].stackSize+".");
- aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, this.mInventory[0]);
- getBaseMetaTileEntity().setInventorySlotContents(0, null);
- this.mType = 0;
- return true;
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "This container is locked. It belongs to "+aTile.getOwnerName()+".");
- return false;
- }
- }
- return false;
- }
- }
- else if (tStack != null && this.mInventory[0] == null) {
-
- if (KeyboardUtils.isCtrlKeyDown() || GT_MetaGenerated_Tool_01.class.isInstance(tStack.getItem())) {
- return false;
- }
- PlayerUtils.messagePlayer(aPlayer, "Stored "+tStack.getDisplayName()+" x"+tStack.stackSize+".");
- aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null);
- getBaseMetaTileEntity().setInventorySlotContents(0, tStack);
- this.mType = (byte) MathUtils.randInt(1, 3);
- return true;
- }
- else {
- if (this.mInventory[0] == null) {
- this.mType = 0;
- }
- return super.onRightclick(aTile, aPlayer);
- }
- }
-
- @Override
- public void onLeftclick(IGregTechTileEntity aTile,EntityPlayer aPlayer) {
- if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) {
- ItemStack tOutput = GT_Utility.copy(new Object[] { this.mInventory[0] });
- if (!aPlayer.isSneaking()) {
- tOutput.stackSize = 1;
- }
- getBaseMetaTileEntity().decrStackSize(0, tOutput.stackSize);
- EntityItem tEntity = new EntityItem(getBaseMetaTileEntity().getWorld(),
- getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D,
- getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D,
- getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, tOutput);
- tEntity.motionX = 0.0D;
- tEntity.motionY = 0.0D;
- tEntity.motionZ = 0.0D;
- getBaseMetaTileEntity().getWorld().spawnEntityInWorld(tEntity);
- if (this.mInventory[0] == null) {
- this.mType = 0;
- }
- }
- super.onLeftclick(aTile, aPlayer);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT4Entity_Shelf(this.mName, this.mDescription, this.mTextures);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {//mLocked
- aNBT.setInteger("mType", this.mType);
- aNBT.setBoolean("mLocked", this.mLocked);
- aNBT.setByte("mIndex", this.mIndex);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- if (aNBT.hasKey("mIndex")) {
- this.mType = ((byte) aNBT.getInteger("mType"));
- }
- if (aNBT.hasKey("mIndex")) {
- this.mLocked = (aNBT.getBoolean("mLocked"));
- }
- if (aNBT.hasKey("mIndex")) {
- this.mIndex = aNBT.getByte("mIndex");
- }
- }
-
- @Override
- public void onValueUpdate(byte aValue) {
- this.mType = aValue;
- }
-
- @Override
- public byte getUpdateData() {
- return this.mType;
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- mOldDesc,
- "Decorative Item Storage",
- "Right click to store/remove something",
- "Ctrl + Rmb to check contents",
- "Ctrl + Rmb with a screwdriver to lock",
- };
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return 0;
- }
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
- //return aSide != getBaseMetaTileEntity().getFrontFacing();
- return false;
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity p0, int p1, byte p2, ItemStack p3) {
- return true;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity p0, int p1, byte p2, ItemStack p3) {
- return false;
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- ITexture[][][] rTextures = new ITexture[7][17][];
- for (byte i = -1; i < 16; i = (byte) (i + 1)) {
- ITexture[] tmp0 = {this.getBottom((byte) 0)[0]};
- rTextures[0][(i + 1)] = tmp0;
- ITexture[] tmp1 = { this.getTop((byte) 0)[0]};
- rTextures[1][(i + 1)] = tmp1;
- ITexture[] tmp2 = { this.getSides((byte) 0)[0]};
- rTextures[2][(i + 1)] = tmp2;
- ITexture[] tmp4 = {this.getSides((byte) 0)[0]};
- rTextures[3][(i + 1)] = tmp4;
- ITexture[] tmp5 = {this.getSides((byte) 0)[0], getFront((byte) 0)[0]};
- rTextures[4][(i + 1)] = tmp5;
- ITexture[] tmp6 = {this.getSides((byte) 0)[0], getFront((byte) 1)[0]};
- rTextures[5][(i + 1)] = tmp6;
- ITexture[] tmp7 = {this.getSides((byte) 0)[0], getFront((byte) 2)[0]};
- rTextures[6][(i + 1)] = tmp7;
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity,
- final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive,
- final boolean aRedstone) {
-
- ITexture[] tmp = this.mTextures[(aSide >= 2) ? ((aSide != aFacing) ? 2 : ((byte) this.mType == 0 ? 4 : this.mType == 1 || this.mType == 2 ? 5 : this.mType == 3 ? 6 : 0)) : aSide][aColorIndex + 1];
- if (aSide != aFacing && tmp.length == 2) {
- tmp = new ITexture[]{tmp[0]};
- }
- return tmp;
- }
-
- private static GT_RenderedTexture x1 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_FRONT);
- private static GT_RenderedTexture x2 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_PAPER_FRONT);
- private static GT_RenderedTexture x3 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_CANS_FRONT);
-
- public ITexture[] getFrontNormal() {
- return new ITexture[]{x1};
- }
- public ITexture[] getFrontActive() {
- return new ITexture[]{x2};
- }
- public ITexture[] getFrontAlternative() {
- return new ITexture[]{x3};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log)};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFrontNormal();
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- public ITexture[] getFront(byte aColour) {
- if (aColour == 1) {
- return getFrontActive();
- }
- else if (aColour == 2) {
- return getFrontAlternative();
- }
- return getFrontNormal();
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (KeyboardUtils.isCtrlKeyDown()) {
- if (!aPlayer.getDisplayName().equalsIgnoreCase(this.getBaseMetaTileEntity().getOwnerName())) {
- PlayerUtils.messagePlayer(aPlayer, "Container is not yours to lock.");
- }
- else {
- this.mLocked = Utils.invertBoolean(this.mLocked);
- if (this.mLocked) {
- PlayerUtils.messagePlayer(aPlayer, "Container is now locked.");
- }
- else {
- PlayerUtils.messagePlayer(aPlayer, "Container is now unlocked.");
- }
- }
- }
- else {
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- }
- }
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- }
-
+ public byte mType = 0;
+ public String mOldDesc = "";
+ public boolean mLocked = false;
+ protected byte mIndex = (byte) MathUtils.randInt(1, 3);
+ public static GT_RenderedTexture texBottom =
+ new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_bottom"));
+ public static GT_RenderedTexture texTop = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_top"));
+ public static GT_RenderedTexture texSide = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_side"));
+ public static GT_RenderedTexture texSideCabinet =
+ new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_side_cabinet"));
+
+ public GT4Entity_Shelf(final int aID, final String aName, final String aNameRegional, final String aDescription) {
+ super(aID, aName, aNameRegional, 0, aDescription);
+ mOldDesc = aDescription;
+ }
+
+ public GT4Entity_Shelf(final String aName, final String aDescription, final ITexture[][][] aTextures) {
+ super(aName, 0, aDescription, aTextures);
+ mOldDesc = aDescription;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ public int getInvSize() {
+ return 1;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ if (this.getBaseMetaTileEntity().getOwnerName().equalsIgnoreCase(aPlayer.getDisplayName())) {
+ return true;
+ }
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "This container belongs to " + this.getBaseMetaTileEntity().getOwnerName() + ".");
+ return false;
+ }
+
+ @Override
+ public boolean ownerControl() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aTile, EntityPlayer aPlayer) {
+ if (aTile.isClientSide()) {
+ return true;
+ }
+ ItemStack tStack = aPlayer.inventory.getStackInSlot(aPlayer.inventory.currentItem);
+ if (tStack == null) {
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ if (this.mInventory[0] != null) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "Contains " + this.mInventory[0].getDisplayName() + " x" + this.mInventory[0].stackSize
+ + ".");
+ }
+ return false;
+ } else {
+ if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) {
+ if (!this.mLocked) {
+ PlayerUtils.messagePlayer(
+ aPlayer,
+ "Removed " + this.mInventory[0].getDisplayName() + " x" + this.mInventory[0].stackSize
+ + ".");
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, this.mInventory[0]);
+ getBaseMetaTileEntity().setInventorySlotContents(0, null);
+ this.mType = 0;
+ return true;
+ } else {
+ PlayerUtils.messagePlayer(
+ aPlayer, "This container is locked. It belongs to " + aTile.getOwnerName() + ".");
+ return false;
+ }
+ }
+ return false;
+ }
+ } else if (tStack != null && this.mInventory[0] == null) {
+
+ if (KeyboardUtils.isCtrlKeyDown() || GT_MetaGenerated_Tool_01.class.isInstance(tStack.getItem())) {
+ return false;
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Stored " + tStack.getDisplayName() + " x" + tStack.stackSize + ".");
+ aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null);
+ getBaseMetaTileEntity().setInventorySlotContents(0, tStack);
+ this.mType = (byte) MathUtils.randInt(1, 3);
+ return true;
+ } else {
+ if (this.mInventory[0] == null) {
+ this.mType = 0;
+ }
+ return super.onRightclick(aTile, aPlayer);
+ }
+ }
+
+ @Override
+ public void onLeftclick(IGregTechTileEntity aTile, EntityPlayer aPlayer) {
+ if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) {
+ ItemStack tOutput = GT_Utility.copy(new Object[] {this.mInventory[0]});
+ if (!aPlayer.isSneaking()) {
+ tOutput.stackSize = 1;
+ }
+ getBaseMetaTileEntity().decrStackSize(0, tOutput.stackSize);
+ EntityItem tEntity = new EntityItem(
+ getBaseMetaTileEntity().getWorld(),
+ getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D,
+ getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D,
+ getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D,
+ tOutput);
+ tEntity.motionX = 0.0D;
+ tEntity.motionY = 0.0D;
+ tEntity.motionZ = 0.0D;
+ getBaseMetaTileEntity().getWorld().spawnEntityInWorld(tEntity);
+ if (this.mInventory[0] == null) {
+ this.mType = 0;
+ }
+ }
+ super.onLeftclick(aTile, aPlayer);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT4Entity_Shelf(this.mName, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) { // mLocked
+ aNBT.setInteger("mType", this.mType);
+ aNBT.setBoolean("mLocked", this.mLocked);
+ aNBT.setByte("mIndex", this.mIndex);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ if (aNBT.hasKey("mIndex")) {
+ this.mType = ((byte) aNBT.getInteger("mType"));
+ }
+ if (aNBT.hasKey("mIndex")) {
+ this.mLocked = (aNBT.getBoolean("mLocked"));
+ }
+ if (aNBT.hasKey("mIndex")) {
+ this.mIndex = aNBT.getByte("mIndex");
+ }
+ }
+
+ @Override
+ public void onValueUpdate(byte aValue) {
+ this.mType = aValue;
+ }
+
+ @Override
+ public byte getUpdateData() {
+ return this.mType;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ mOldDesc,
+ "Decorative Item Storage",
+ "Right click to store/remove something",
+ "Ctrl + Rmb to check contents",
+ "Ctrl + Rmb with a screwdriver to lock",
+ };
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return 0;
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ // return aSide != getBaseMetaTileEntity().getFrontFacing();
+ return false;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity p0, int p1, byte p2, ItemStack p3) {
+ return true;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity p0, int p1, byte p2, ItemStack p3) {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[7][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ ITexture[] tmp0 = {this.getBottom((byte) 0)[0]};
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 = {this.getTop((byte) 0)[0]};
+ rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 = {this.getSides((byte) 0)[0]};
+ rTextures[2][(i + 1)] = tmp2;
+ ITexture[] tmp4 = {this.getSides((byte) 0)[0]};
+ rTextures[3][(i + 1)] = tmp4;
+ ITexture[] tmp5 = {this.getSides((byte) 0)[0], getFront((byte) 0)[0]};
+ rTextures[4][(i + 1)] = tmp5;
+ ITexture[] tmp6 = {this.getSides((byte) 0)[0], getFront((byte) 1)[0]};
+ rTextures[5][(i + 1)] = tmp6;
+ ITexture[] tmp7 = {this.getSides((byte) 0)[0], getFront((byte) 2)[0]};
+ rTextures[6][(i + 1)] = tmp7;
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(
+ final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide,
+ final byte aFacing,
+ final byte aColorIndex,
+ final boolean aActive,
+ final boolean aRedstone) {
+
+ ITexture[] tmp = this.mTextures[
+ (aSide >= 2)
+ ? ((aSide != aFacing)
+ ? 2
+ : ((byte) this.mType == 0
+ ? 4
+ : this.mType == 1 || this.mType == 2 ? 5 : this.mType == 3 ? 6 : 0))
+ : aSide][
+ aColorIndex + 1];
+ if (aSide != aFacing && tmp.length == 2) {
+ tmp = new ITexture[] {tmp[0]};
+ }
+ return tmp;
+ }
+
+ private static GT_RenderedTexture x1 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_FRONT);
+ private static GT_RenderedTexture x2 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_PAPER_FRONT);
+ private static GT_RenderedTexture x3 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_CANS_FRONT);
+
+ public ITexture[] getFrontNormal() {
+ return new ITexture[] {x1};
+ }
+
+ public ITexture[] getFrontActive() {
+ return new ITexture[] {x2};
+ }
+
+ public ITexture[] getFrontAlternative() {
+ return new ITexture[] {x3};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log)};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return this.getFrontNormal();
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return this.getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return this.getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return this.getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ public ITexture[] getFront(byte aColour) {
+ if (aColour == 1) {
+ return getFrontActive();
+ } else if (aColour == 2) {
+ return getFrontAlternative();
+ }
+ return getFrontNormal();
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ if (!aPlayer.getDisplayName()
+ .equalsIgnoreCase(this.getBaseMetaTileEntity().getOwnerName())) {
+ PlayerUtils.messagePlayer(aPlayer, "Container is not yours to lock.");
+ } else {
+ this.mLocked = Utils.invertBoolean(this.mLocked);
+ if (this.mLocked) {
+ PlayerUtils.messagePlayer(aPlayer, "Container is now locked.");
+ } else {
+ PlayerUtils.messagePlayer(aPlayer, "Container is now unlocked.");
+ }
+ }
+ } else {
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java
index 7dcb76a22e..93361a523f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java
@@ -1,39 +1,38 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving;
-import net.minecraft.entity.player.EntityPlayer;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.EntityPlayer;
public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf {
-
- public GT4Entity_Shelf_Compartment(final int aID, final String aName, final String aNameRegional, final String aDescription) {
- super(aID, aName, aNameRegional, aDescription);
- }
-
- public GT4Entity_Shelf_Compartment(String mName, String mDescriptionArray, ITexture[][][] mTextures) {
- super(mName, mDescriptionArray, mTextures);
- }
+ public GT4Entity_Shelf_Compartment(
+ final int aID, final String aName, final String aNameRegional, final String aDescription) {
+ super(aID, aName, aNameRegional, aDescription);
+ }
+
+ public GT4Entity_Shelf_Compartment(String mName, String mDescriptionArray, ITexture[][][] mTextures) {
+ super(mName, mDescriptionArray, mTextures);
+ }
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT4Entity_Shelf_Compartment(this.mName, this.mDescription, this.mTextures);
- }
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT4Entity_Shelf_Compartment(this.mName, this.mDescription, this.mTextures);
+ }
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
- this.mType = ((byte) ((this.mType + 1) % 16));
- PlayerUtils.messagePlayer(aPlayer, "Set type to "+this.mType+".");
- }
- }
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
+ this.mType = ((byte) ((this.mType + 1) % 16));
+ PlayerUtils.messagePlayer(aPlayer, "Set type to " + this.mType + ".");
+ }
+ }
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{TexturesGtBlock.OVERLAYS_COMPARTMENT_FRONT[this.mType < 16 ? this.mType : 0]};
- }
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {TexturesGtBlock.OVERLAYS_COMPARTMENT_FRONT[this.mType < 16 ? this.mType : 0]};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java
index 2c7186a3ce..c9472e157c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java
@@ -4,42 +4,42 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
-
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf {
- public GT4Entity_Shelf_Desk(final int aID, final String aName, final String aNameRegional, final String aDescription) {
- super(aID, aName, aNameRegional, aDescription);
- }
-
- public GT4Entity_Shelf_Desk(String mName, String mDescriptionArray, ITexture[][][] mTextures) {
- super(mName, mDescriptionArray, mTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT4Entity_Shelf_Desk(this.mName, this.mDescription, this.mTextures);
- }
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0]};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
- }
+ public GT4Entity_Shelf_Desk(
+ final int aID, final String aName, final String aNameRegional, final String aDescription) {
+ super(aID, aName, aNameRegional, aDescription);
+ }
+
+ public GT4Entity_Shelf_Desk(String mName, String mDescriptionArray, ITexture[][][] mTextures) {
+ super(mName, mDescriptionArray, mTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT4Entity_Shelf_Desk(this.mName, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0]};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java
index 93bb7d5bb9..9c4ae3aefa 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java
@@ -1,55 +1,54 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving;
-import net.minecraft.entity.player.EntityPlayer;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.EntityPlayer;
public class GT4Entity_Shelf_FileCabinet extends GT4Entity_Shelf {
- public GT4Entity_Shelf_FileCabinet(final int aID, final String aName, final String aNameRegional, final String aDescription) {
- super(aID, aName, aNameRegional, aDescription);
- }
-
- public GT4Entity_Shelf_FileCabinet(String mName, String mDescriptionArray, ITexture[][][] mTextures) {
- super(mName, mDescriptionArray, mTextures);
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
- this.mType = ((byte) ((this.mType + 1) % 16));
- PlayerUtils.messagePlayer(aPlayer, "Set type to "+this.mType+".");
- }
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT4Entity_Shelf_FileCabinet(this.mName, this.mDescription, this.mTextures);
- }
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0]};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{texSide};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{texBottom};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{texTop};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{texSide};
- }
+ public GT4Entity_Shelf_FileCabinet(
+ final int aID, final String aName, final String aNameRegional, final String aDescription) {
+ super(aID, aName, aNameRegional, aDescription);
+ }
+
+ public GT4Entity_Shelf_FileCabinet(String mName, String mDescriptionArray, ITexture[][][] mTextures) {
+ super(mName, mDescriptionArray, mTextures);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
+ this.mType = ((byte) ((this.mType + 1) % 16));
+ PlayerUtils.messagePlayer(aPlayer, "Set type to " + this.mType + ".");
+ }
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT4Entity_Shelf_FileCabinet(this.mName, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0]};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {texSide};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {texBottom};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {texTop};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {texSide};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java
index 606496501f..17110e691b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java
@@ -6,36 +6,37 @@ import gregtech.api.metatileentity.MetaTileEntity;
public class GT4Entity_Shelf_Iron extends GT4Entity_Shelf {
- public GT4Entity_Shelf_Iron(final int aID, final String aName, final String aNameRegional, final String aDescription) {
- super(aID, aName, aNameRegional, aDescription);
- }
-
- public GT4Entity_Shelf_Iron(String mName, String mDescriptionArray, ITexture[][][] mTextures) {
- super(mName, mDescriptionArray, mTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT4Entity_Shelf_Iron(this.mName, this.mDescription, this.mTextures);
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{texSideCabinet};
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{texSide};
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{texBottom};
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{texTop};
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{texSide};
- }
+ public GT4Entity_Shelf_Iron(
+ final int aID, final String aName, final String aNameRegional, final String aDescription) {
+ super(aID, aName, aNameRegional, aDescription);
+ }
+
+ public GT4Entity_Shelf_Iron(String mName, String mDescriptionArray, ITexture[][][] mTextures) {
+ super(mName, mDescriptionArray, mTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT4Entity_Shelf_Iron(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[] {texSideCabinet};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {texSide};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[] {texBottom};
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[] {texTop};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[] {texSide};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java
index cc17f49d83..03735ad381 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java
@@ -1,266 +1,264 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
-import net.minecraft.nbt.NBTTagCompound;
-
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SuperChest;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_SuperChest;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTBase;
+import net.minecraft.nbt.NBTTagCompound;
public class GT4Entity_Shelf_Large extends GT4Entity_Shelf {
- private final int mSize;
- public int mItemCount;
- public ItemStack mItemStack;
-
-
- public GT4Entity_Shelf_Large(final int aID, final String aName, final String aNameRegional, final String aDescription, final int aSize) {
- super(aID, aName, aNameRegional, aDescription);
- this.mSize = aSize;
- this.mItemCount = 0;
- this.mItemStack = null;
- }
-
- public GT4Entity_Shelf_Large(String mName, String mDescriptionArray, final int aSize, ITexture[][][] mTextures) {
- super(mName, mDescriptionArray, mTextures);
- this.mSize = aSize;
- this.mItemCount = 0;
- this.mItemStack = null;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT4Entity_Shelf_Large(this.mName, this.mDescription, mSize, this.mTextures);
- }
-
- /*@Override
- public int getInvSize() {
- return (mSize > 0 && mSize < 255 ? mSize : 255);
- }*/
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean isDigitalChest() {
- return true;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return true;
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- if (KeyboardUtils.isCtrlKeyDown()) {
- String itemName = (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing.");
- String itemAmount = (this.mItemCount > 0 ? ""+this.mItemCount : "bad");
- String itemMessage = "This container currently holds "+(itemAmount.equalsIgnoreCase("bad") ? "nothing." : itemName+" x"+itemAmount+".");
- PlayerUtils.messagePlayer(aPlayer, itemMessage);
- }
- else {
- aBaseMetaTileEntity.openGUI(aPlayer);
- }
- return true;
- }
-
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_SuperChest(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_SuperChest(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mItemCount", this.mItemCount);
- if (this.mItemStack != null) {
- aNBT.setTag("mItemStack", (NBTBase) this.mItemStack.writeToNBT(new NBTTagCompound()));
- }
- super.saveNBTData(aNBT);
-
- }
-
- @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"));
- }
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void onOpenGUI() {
- super.onOpenGUI();
- }
-
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) {
- if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) {
- try {
- if (this.mInventory[0] != null) {
- this.mType = (byte) this.mIndex;
- }
- else {
- this.mType = 0;
- }
-
- if (this.getItemCount() <= 0) {
- this.mItemStack = null;
- this.mItemCount = 0;
- }
- if (this.mItemStack == null && this.mInventory[0] != null) {
- this.mItemStack = this.mInventory[0].copy();
- }
- if (this.mInventory[0] != null && this.mItemCount < this.getMaxItemCount()
- && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) {
- this.mItemCount += this.mInventory[0].stackSize;
- if (this.mItemCount > this.getMaxItemCount()) {
- this.mInventory[0].stackSize = this.mItemCount - this.getMaxItemCount();
- this.mItemCount = this.getMaxItemCount();
- } else {
- this.mInventory[0] = null;
- }
- }
- if (this.mInventory[1] == null && this.mItemStack != null) {
- this.mInventory[1] = this.mItemStack.copy();
- this.mInventory[1].stackSize = Math.min(this.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) {
- final int tmp = Math.min(this.mItemCount,
- this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize);
- final ItemStack itemStack = this.mInventory[1];
- itemStack.stackSize += tmp;
- this.mItemCount -= tmp;
- }
- if (this.mItemStack != null) {
- this.mInventory[2] = this.mItemStack.copy();
- this.mInventory[2].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount);
- } else {
- this.mInventory[2] = null;
- }
- }
- catch (Throwable t) {
- if (t instanceof ArrayIndexOutOfBoundsException) {
-
- }
- }
- }
- }
-
- private int getItemCount() {
- return this.mItemCount;
- }
-
- public void setItemCount(final int aCount) {
- this.mItemCount = aCount;
- }
-
- public int getProgresstime() {
- try {
- return this.mItemCount + ((this.mInventory[0] == null) ? 0 : this.mInventory[0].stackSize)
- + ((this.mInventory[1] == null) ? 0 : this.mInventory[1].stackSize);
- }
- catch (Throwable t) {
- return 0;
- }
- }
-
- public int maxProgresstime() {
- return this.getMaxItemCount();
- }
-
- public int getMaxItemCount() {
- return this.mSize;
- }
-
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aIndex == 1;
- }
-
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aIndex == 0 && ((this.mInventory[0] == null && this.mItemStack == null) || GT_Utility.areStacksEqual(this.mInventory[0], aStack) || (this.mItemStack != null && GT_Utility.areStacksEqual(this.mItemStack, aStack)));
- }
-
- public String[] getInfoData() {
- if (this.mItemStack == null) {
- return new String[]{
- this.getLocalName(), "No Items Stored", "Free Space: "+Integer.toString(this.getMaxItemCount())};
- }
- return new String[]{
- this.getLocalName(),
- "Storing: "+this.mItemStack.getDisplayName()+" x"+Integer.toString(this.mItemCount),
- "Space Remaining: "+Integer.toString(this.getMaxItemCount()-this.getItemCount())+"/"+Integer.toString(this.getMaxItemCount())};
- }
-
- @Override
- public String[] getDescription() {
- String[] mSuper = super.getDescription();
- String[] desc = new String[mSuper.length+1];
- for (int i=0;i>mSuper.length;i++) {
- desc[i] = mSuper[i];
- }
- desc[desc.length-1] = "Control + Rmb block to check contents";
- return desc;
- }
-
- @Override
- public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
- Logger.INFO("1:"+aIndex);
- if (aIndex == 2) {
- if (ItemStack.areItemStacksEqual(aStack, mItemStack)) {
- return true;
- }
- else {
- if (mItemStack == null) {
- return true;
- }
- return false;
- }
- }
- return super.isItemValidForSlot(aIndex, aStack);
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- Logger.INFO("2:"+aIndex);
- if (aIndex == 0) {
- if (ItemStack.areItemStacksEqual(aStack, mItemStack)) {
- return true;
- }
- else {
- if (mItemStack == null) {
- return true;
- }
- return false;
- }
- }
- return super.canInsertItem(aIndex, aStack, aSide);
- }
-
-
+ private final int mSize;
+ public int mItemCount;
+ public ItemStack mItemStack;
+
+ public GT4Entity_Shelf_Large(
+ final int aID, final String aName, final String aNameRegional, final String aDescription, final int aSize) {
+ super(aID, aName, aNameRegional, aDescription);
+ this.mSize = aSize;
+ this.mItemCount = 0;
+ this.mItemStack = null;
+ }
+
+ public GT4Entity_Shelf_Large(String mName, String mDescriptionArray, final int aSize, ITexture[][][] mTextures) {
+ super(mName, mDescriptionArray, mTextures);
+ this.mSize = aSize;
+ this.mItemCount = 0;
+ this.mItemStack = null;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT4Entity_Shelf_Large(this.mName, this.mDescription, mSize, this.mTextures);
+ }
+
+ /*@Override
+ public int getInvSize() {
+ return (mSize > 0 && mSize < 255 ? mSize : 255);
+ }*/
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean isDigitalChest() {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(final int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ String itemName = (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing.");
+ String itemAmount = (this.mItemCount > 0 ? "" + this.mItemCount : "bad");
+ String itemMessage = "This container currently holds "
+ + (itemAmount.equalsIgnoreCase("bad") ? "nothing." : itemName + " x" + itemAmount + ".");
+ PlayerUtils.messagePlayer(aPlayer, itemMessage);
+ } else {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ }
+ return true;
+ }
+
+ public Object getServerGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SuperChest(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(
+ final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SuperChest(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mItemCount", this.mItemCount);
+ if (this.mItemStack != null) {
+ aNBT.setTag("mItemStack", (NBTBase) this.mItemStack.writeToNBT(new NBTTagCompound()));
+ }
+ super.saveNBTData(aNBT);
+ }
+
+ @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"));
+ }
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void onOpenGUI() {
+ super.onOpenGUI();
+ }
+
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) {
+ if (this.getBaseMetaTileEntity().isServerSide()
+ && this.getBaseMetaTileEntity().isAllowedToWork()) {
+ try {
+ if (this.mInventory[0] != null) {
+ this.mType = (byte) this.mIndex;
+ } else {
+ this.mType = 0;
+ }
+
+ if (this.getItemCount() <= 0) {
+ this.mItemStack = null;
+ this.mItemCount = 0;
+ }
+ if (this.mItemStack == null && this.mInventory[0] != null) {
+ this.mItemStack = this.mInventory[0].copy();
+ }
+ if (this.mInventory[0] != null
+ && this.mItemCount < this.getMaxItemCount()
+ && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) {
+ this.mItemCount += this.mInventory[0].stackSize;
+ if (this.mItemCount > this.getMaxItemCount()) {
+ this.mInventory[0].stackSize = this.mItemCount - this.getMaxItemCount();
+ this.mItemCount = this.getMaxItemCount();
+ } else {
+ this.mInventory[0] = null;
+ }
+ }
+ if (this.mInventory[1] == null && this.mItemStack != null) {
+ this.mInventory[1] = this.mItemStack.copy();
+ this.mInventory[1].stackSize = Math.min(this.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) {
+ final int tmp = Math.min(
+ this.mItemCount, this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize);
+ final ItemStack itemStack = this.mInventory[1];
+ itemStack.stackSize += tmp;
+ this.mItemCount -= tmp;
+ }
+ if (this.mItemStack != null) {
+ this.mInventory[2] = this.mItemStack.copy();
+ this.mInventory[2].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount);
+ } else {
+ this.mInventory[2] = null;
+ }
+ } catch (Throwable t) {
+ if (t instanceof ArrayIndexOutOfBoundsException) {}
+ }
+ }
+ }
+
+ private int getItemCount() {
+ return this.mItemCount;
+ }
+
+ public void setItemCount(final int aCount) {
+ this.mItemCount = aCount;
+ }
+
+ public int getProgresstime() {
+ try {
+ return this.mItemCount
+ + ((this.mInventory[0] == null) ? 0 : this.mInventory[0].stackSize)
+ + ((this.mInventory[1] == null) ? 0 : this.mInventory[1].stackSize);
+ } catch (Throwable t) {
+ return 0;
+ }
+ }
+
+ public int maxProgresstime() {
+ return this.getMaxItemCount();
+ }
+
+ public int getMaxItemCount() {
+ return this.mSize;
+ }
+
+ public boolean allowPullStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return aIndex == 1;
+ }
+
+ public boolean allowPutStack(
+ final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return aIndex == 0
+ && ((this.mInventory[0] == null && this.mItemStack == null)
+ || GT_Utility.areStacksEqual(this.mInventory[0], aStack)
+ || (this.mItemStack != null && GT_Utility.areStacksEqual(this.mItemStack, aStack)));
+ }
+
+ public String[] getInfoData() {
+ if (this.mItemStack == null) {
+ return new String[] {
+ this.getLocalName(), "No Items Stored", "Free Space: " + Integer.toString(this.getMaxItemCount())
+ };
+ }
+ return new String[] {
+ this.getLocalName(),
+ "Storing: " + this.mItemStack.getDisplayName() + " x" + Integer.toString(this.mItemCount),
+ "Space Remaining: " + Integer.toString(this.getMaxItemCount() - this.getItemCount()) + "/"
+ + Integer.toString(this.getMaxItemCount())
+ };
+ }
+
+ @Override
+ public String[] getDescription() {
+ String[] mSuper = super.getDescription();
+ String[] desc = new String[mSuper.length + 1];
+ for (int i = 0; i > mSuper.length; i++) {
+ desc[i] = mSuper[i];
+ }
+ desc[desc.length - 1] = "Control + Rmb block to check contents";
+ return desc;
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ Logger.INFO("1:" + aIndex);
+ if (aIndex == 2) {
+ if (ItemStack.areItemStacksEqual(aStack, mItemStack)) {
+ return true;
+ } else {
+ if (mItemStack == null) {
+ return true;
+ }
+ return false;
+ }
+ }
+ return super.isItemValidForSlot(aIndex, aStack);
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ Logger.INFO("2:" + aIndex);
+ if (aIndex == 0) {
+ if (ItemStack.areItemStacksEqual(aStack, mItemStack)) {
+ return true;
+ } else {
+ if (mItemStack == null) {
+ return true;
+ }
+ return false;
+ }
+ }
+ return super.canInsertItem(aIndex, aStack, aSide);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java
index 27f118e363..e8b72c7ea9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java
@@ -1,19 +1,16 @@
package gtPlusPlus.xmod.gregtech.common.tools;
-import java.util.Arrays;
-import java.util.List;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures.ItemIcons;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.common.items.behaviors.Behaviour_None;
import gregtech.common.tools.GT_Tool;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
-import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Choocher;
+import java.util.Arrays;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -26,174 +23,178 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.event.world.BlockEvent;
-public class TOOL_Gregtech_AngleGrinder
-extends GT_Tool {
-
- public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"});
-
-
- @Override
- public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
- String tName = aEntity.getClass().getName();
- tName = tName.substring(tName.lastIndexOf(".") + 1);
- return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
- }
-
- @Override
- public int getToolDamagePerBlockBreak() {
- return 50;
- }
-
- @Override
- public int getToolDamagePerDropConversion() {
- return 100;
- }
-
- @Override
- public int getToolDamagePerContainerCraft() {
- return 400;
- }
-
- @Override
- public int getToolDamagePerEntityAttack() {
- return 100;
- }
-
- @Override
- public int getBaseQuality() {
- return 0;
- }
-
- @Override
- public float getBaseDamage() {
- return 8.0F;
- }
-
- @Override
- public float getSpeedMultiplier() {
- return 2F;
- }
-
- @Override
- public float getMaxDurabilityMultiplier() {
- return 1.8F;
- }
-
- @Override
- public String getCraftingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(1));
- }
-
- @Override
- public String getEntityHitSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(2));
- }
-
- @Override
- public String getBreakingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(0));
- }
-
- @Override
- public String getMiningSound() {
- return null;
- }
-
- @Override
- public boolean canBlock() {
- return false;
- }
-
- public boolean isWrench(){
- return false;
- }
-
- @Override
- public boolean isCrowbar() {
- return false;
- }
-
- @Override
- public boolean isWeapon() {
- return true;
- }
-
- @Override
- public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
- final String tTool = aBlock.getHarvestTool(aMetaData);
- return (tTool != null) && (tTool.equals("sword") || tTool.equals("file"));
- }
-
-
- @Override
- public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) {
- int rConversions = 0;
- /*GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{new ItemStack(aBlock, 1, aMetaData)});
- if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) {
- for (final ItemStack tDrop : aDrops) {
- tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})});
- if (tRecipe != null) {
- final ItemStack tHammeringOutput = tRecipe.getOutput(0);
- if (tHammeringOutput != null) {
- rConversions += tDrop.stackSize;
- tDrop.stackSize *= tHammeringOutput.stackSize;
- tHammeringOutput.stackSize = tDrop.stackSize;
- GT_Utility.setStack(tDrop, tHammeringOutput);
- }
- }
- }
- } else {
- aDrops.clear();
- aDrops.add(tRecipe.getOutput(0));
- rConversions++;
- }*/
- return rConversions;
- }
-
- @Override
- public ItemStack getBrokenItem(final ItemStack aStack) {
- return null;
- }
-
- public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
- return (IIconContainer) (aIsToolHead
- ? TexturesGtTools.ANGLE_GRINDER
- : ItemIcons.POWER_UNIT_HV);
- }
-
- public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
- return aIsToolHead
- ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa
- : Materials.TungstenSteel.mRGBa;
- }
-
-
-
-
- @Override
- public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
- super.onToolCrafted(aStack, aPlayer);
- aPlayer.triggerAchievement(AchievementList.buildSword);
- try {
- GT_Mod.achievements.issueAchievement(aPlayer, "tools");
- GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
- } catch (final Exception e) {
- }
- }
-
- @Override
- public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
- return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been Ground out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE);
- }
-
- @Override
- public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
- aItem.addItemBehavior(aID, new Behaviour_None());
- }
-
- @Override
- public boolean isGrafter() {
- return false;
- }
-
+public class TOOL_Gregtech_AngleGrinder extends GT_Tool {
+
+ public static final List<String> mEffectiveList =
+ Arrays.asList(new String[] {EntityIronGolem.class.getName(), "EntityTowerGuardian"});
+
+ @Override
+ public float getNormalDamageAgainstEntity(
+ final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
+ String tName = aEntity.getClass().getName();
+ tName = tName.substring(tName.lastIndexOf(".") + 1);
+ return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
+ }
+
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 50;
+ }
+
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 400;
+ }
+
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 100;
+ }
+
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
+
+ @Override
+ public float getBaseDamage() {
+ return 8.0F;
+ }
+
+ @Override
+ public float getSpeedMultiplier() {
+ return 2F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.8F;
+ }
+
+ @Override
+ public String getCraftingSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(1));
+ }
+
+ @Override
+ public String getEntityHitSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(2));
+ }
+
+ @Override
+ public String getBreakingSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ @Override
+ public String getMiningSound() {
+ return null;
+ }
+
+ @Override
+ public boolean canBlock() {
+ return false;
+ }
+
+ public boolean isWrench() {
+ return false;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
+
+ @Override
+ public boolean isWeapon() {
+ return true;
+ }
+
+ @Override
+ public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
+ final String tTool = aBlock.getHarvestTool(aMetaData);
+ return (tTool != null) && (tTool.equals("sword") || tTool.equals("file"));
+ }
+
+ @Override
+ public int convertBlockDrops(
+ final List<ItemStack> aDrops,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final Block aBlock,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final byte aMetaData,
+ final int aFortune,
+ final boolean aSilkTouch,
+ final BlockEvent.HarvestDropsEvent aEvent) {
+ int rConversions = 0;
+ /*GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{new ItemStack(aBlock, 1, aMetaData)});
+ if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) {
+ for (final ItemStack tDrop : aDrops) {
+ tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})});
+ if (tRecipe != null) {
+ final ItemStack tHammeringOutput = tRecipe.getOutput(0);
+ if (tHammeringOutput != null) {
+ rConversions += tDrop.stackSize;
+ tDrop.stackSize *= tHammeringOutput.stackSize;
+ tHammeringOutput.stackSize = tDrop.stackSize;
+ GT_Utility.setStack(tDrop, tHammeringOutput);
+ }
+ }
+ }
+ } else {
+ aDrops.clear();
+ aDrops.add(tRecipe.getOutput(0));
+ rConversions++;
+ }*/
+ return rConversions;
+ }
+
+ @Override
+ public ItemStack getBrokenItem(final ItemStack aStack) {
+ return null;
+ }
+
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
+ return (IIconContainer) (aIsToolHead ? TexturesGtTools.ANGLE_GRINDER : ItemIcons.POWER_UNIT_HV);
+ }
+
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : Materials.TungstenSteel.mRGBa;
+ }
+
+ @Override
+ public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
+ super.onToolCrafted(aStack, aPlayer);
+ aPlayer.triggerAchievement(AchievementList.buildSword);
+ try {
+ GT_Mod.achievements.issueAchievement(aPlayer, "tools");
+ GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
+ } catch (final Exception e) {
+ }
+ }
+
+ @Override
+ public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
+ return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE
+ + " has been Ground out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName()
+ + EnumChatFormatting.WHITE);
+ }
+
+ @Override
+ public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
+ aItem.addItemBehavior(aID, new Behaviour_None());
+ }
+
+ @Override
+ public boolean isGrafter() {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java
index 97f9a43187..db93f8fdd1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.gregtech.common.tools;
+import gregtech.api.GregTech_API;
+import gregtech.api.damagesources.GT_DamageSources;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
@@ -12,169 +15,178 @@ import net.minecraft.stats.AchievementList;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.IChatComponent;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.damagesources.GT_DamageSources;
-
-import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
-import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
import net.minecraftforge.event.world.BlockEvent;
-public abstract class TOOL_Gregtech_Base
-implements Interface_ToolStats {
- public static final Enchantment[] FORTUNE_ENCHANTMENT = {Enchantment.fortune};
- public static final Enchantment[] LOOTING_ENCHANTMENT = {Enchantment.looting};
- public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0];
- public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0];
-
- @Override
- public int getToolDamagePerBlockBreak() {
- return 100;
- }
-
- @Override
- public int getToolDamagePerDropConversion() {
- return 100;
- }
-
- @Override
- public int getToolDamagePerContainerCraft() {
- return 800;
- }
-
- @Override
- public int getToolDamagePerEntityAttack() {
- return 200;
- }
-
- @Override
- public float getSpeedMultiplier() {
- return 1.0F;
- }
-
- @Override
- public float getMaxDurabilityMultiplier() {
- return 1.0F;
- }
-
- @Override
- public int getHurtResistanceTime(final int aOriginalHurtResistance, final Entity aEntity) {
- return aOriginalHurtResistance;
- }
-
- @Override
- public String getMiningSound() {
- return null;
- }
-
- @Override
- public String getCraftingSound() {
- return null;
- }
-
- @Override
- public String getEntityHitSound() {
- return null;
- }
-
- @Override
- public String getBreakingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(0));
- }
-
- @Override
- public int getBaseQuality() {
- return 0;
- }
-
- @Override
- public boolean canBlock() {
- return false;
- }
-
- @Override
- public boolean isCrowbar() {
- return false;
- }
-
- @Override
- public boolean isWrench() {
- return false;
- }
-
- @Override
- public boolean isWeapon() {
- return false;
- }
-
- @Override
- public boolean isRangedWeapon() {
- return false;
- }
-
- @Override
- public boolean isMiningTool() {
- return true;
- }
-
- public boolean isChainsaw(){
- return false;
- }
-
-
- @Override
- public boolean isGrafter(){
- return false;
- }
-
-
- @Override
- public DamageSource getDamageSource(final EntityLivingBase aPlayer, final Entity aEntity) {
- return GT_DamageSources.getCombatDamage((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer, (aEntity instanceof EntityLivingBase) ? this.getDeathMessage(aPlayer, (EntityLivingBase) aEntity) : null);
- }
-
- public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
- return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer).func_151519_b(aEntity);
- }
-
- @Override
- public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) {
- return 0;
- }
-
- @Override
- public ItemStack getBrokenItem(final ItemStack aStack) {
- return null;
- }
-
- @Override
- public Enchantment[] getEnchantments(final ItemStack aStack) {
- return ZERO_ENCHANTMENTS;
- }
-
- @Override
- public int[] getEnchantmentLevels(final ItemStack aStack) {
- return ZERO_ENCHANTMENT_LEVELS;
- }
-
- @Override
- public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
- aPlayer.triggerAchievement(AchievementList.openInventory);
- aPlayer.triggerAchievement(AchievementList.mineWood);
- aPlayer.triggerAchievement(AchievementList.buildWorkBench);
- }
-
- @Override
- public void onStatsAddedToTool(final Gregtech_MetaTool aItem, final int aID) {
- }
-
- @Override
- public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
- return aOriginalDamage;
- }
-
- @Override
- public float getMagicDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
- return aOriginalDamage;
- }
+public abstract class TOOL_Gregtech_Base implements Interface_ToolStats {
+ public static final Enchantment[] FORTUNE_ENCHANTMENT = {Enchantment.fortune};
+ public static final Enchantment[] LOOTING_ENCHANTMENT = {Enchantment.looting};
+ public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0];
+ public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0];
+
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 800;
+ }
+
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 200;
+ }
+
+ @Override
+ public float getSpeedMultiplier() {
+ return 1.0F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.0F;
+ }
+
+ @Override
+ public int getHurtResistanceTime(final int aOriginalHurtResistance, final Entity aEntity) {
+ return aOriginalHurtResistance;
+ }
+
+ @Override
+ public String getMiningSound() {
+ return null;
+ }
+
+ @Override
+ public String getCraftingSound() {
+ return null;
+ }
+
+ @Override
+ public String getEntityHitSound() {
+ return null;
+ }
+
+ @Override
+ public String getBreakingSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
+
+ @Override
+ public boolean canBlock() {
+ return false;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
+
+ @Override
+ public boolean isWrench() {
+ return false;
+ }
+
+ @Override
+ public boolean isWeapon() {
+ return false;
+ }
+
+ @Override
+ public boolean isRangedWeapon() {
+ return false;
+ }
+
+ @Override
+ public boolean isMiningTool() {
+ return true;
+ }
+
+ public boolean isChainsaw() {
+ return false;
+ }
+
+ @Override
+ public boolean isGrafter() {
+ return false;
+ }
+
+ @Override
+ public DamageSource getDamageSource(final EntityLivingBase aPlayer, final Entity aEntity) {
+ return GT_DamageSources.getCombatDamage(
+ (aPlayer instanceof EntityPlayer) ? "player" : "mob",
+ aPlayer,
+ (aEntity instanceof EntityLivingBase)
+ ? this.getDeathMessage(aPlayer, (EntityLivingBase) aEntity)
+ : null);
+ }
+
+ public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
+ return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer)
+ .func_151519_b(aEntity);
+ }
+
+ @Override
+ public int convertBlockDrops(
+ final List<ItemStack> aDrops,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final Block aBlock,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final byte aMetaData,
+ final int aFortune,
+ final boolean aSilkTouch,
+ final BlockEvent.HarvestDropsEvent aEvent) {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getBrokenItem(final ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public Enchantment[] getEnchantments(final ItemStack aStack) {
+ return ZERO_ENCHANTMENTS;
+ }
+
+ @Override
+ public int[] getEnchantmentLevels(final ItemStack aStack) {
+ return ZERO_ENCHANTMENT_LEVELS;
+ }
+
+ @Override
+ public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
+ aPlayer.triggerAchievement(AchievementList.openInventory);
+ aPlayer.triggerAchievement(AchievementList.mineWood);
+ aPlayer.triggerAchievement(AchievementList.buildWorkBench);
+ }
+
+ @Override
+ public void onStatsAddedToTool(final Gregtech_MetaTool aItem, final int aID) {}
+
+ @Override
+ public float getNormalDamageAgainstEntity(
+ final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
+ return aOriginalDamage;
+ }
+
+ @Override
+ public float getMagicDamageAgainstEntity(
+ final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
+ return aOriginalDamage;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java
index 1fd1e8241a..efdf8b18e9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java
@@ -1,8 +1,16 @@
package gtPlusPlus.xmod.gregtech.common.tools;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.tools.GT_Tool;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
+import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Choocher;
import java.util.Arrays;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@@ -15,182 +23,217 @@ import net.minecraft.stats.AchievementList;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
-
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.tools.GT_Tool;
-
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
-import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Choocher;
import net.minecraftforge.event.world.BlockEvent;
-public class TOOL_Gregtech_Choocher
-extends GT_Tool {
-
- public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"});
-
-
- @Override
- public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
- String tName = aEntity.getClass().getName();
- tName = tName.substring(tName.lastIndexOf(".") + 1);
- return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
- }
-
- @Override
- public int getToolDamagePerBlockBreak() {
- return 50;
- }
-
- @Override
- public int getToolDamagePerDropConversion() {
- return 100;
- }
-
- @Override
- public int getToolDamagePerContainerCraft() {
- return 400;
- }
-
- @Override
- public int getToolDamagePerEntityAttack() {
- return 100;
- }
-
- @Override
- public int getBaseQuality() {
- return 0;
- }
-
- @Override
- public float getBaseDamage() {
- return 4.0F;
- }
-
- @Override
- public float getSpeedMultiplier() {
- return 0.85F;
- }
-
- @Override
- public float getMaxDurabilityMultiplier() {
- return 1.2F;
- }
-
- @Override
- public String getCraftingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(1));
- }
-
- @Override
- public String getEntityHitSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(2));
- }
-
- @Override
- public String getBreakingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(0));
- }
-
- @Override
- public String getMiningSound() {
- return null;
- }
-
- @Override
- public boolean canBlock() {
- return true;
- }
-
- public boolean isWrench(){
- return true;
- }
-
- @Override
- public boolean isCrowbar() {
- return false;
- }
-
- @Override
- public boolean isWeapon() {
- return true;
- }
-
- @Override
- public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
- final String tTool = aBlock.getHarvestTool(aMetaData);
- return ((tTool != null) && ((tTool.equals("sword")) || (tTool.equals("wrench")) || (tTool.equals("hammer")) || (tTool.equals("pickaxe")))) || (aBlock.getMaterial() == Material.rock) || (aBlock.getMaterial() == Material.glass) || (aBlock.getMaterial() == Material.piston) || (aBlock == Blocks.hopper) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce) || (GT_Recipe.GT_Recipe_Map.sHammerRecipes.containsInput(new ItemStack(aBlock, 1, aMetaData))) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.wood) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.circuits) || (aBlock.getMaterial() == Material.gourd) || (aBlock.getMaterial() == Material.web) || (aBlock.getMaterial() == Material.cloth) || (aBlock.getMaterial() == Material.carpet) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.cake) || (aBlock.getMaterial() == Material.tnt) || (aBlock.getMaterial() == Material.sponge);
- }
-
- @Override
- public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) {
- int rConversions = 0;
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{new ItemStack(aBlock, 1, aMetaData)});
- if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) {
- for (final ItemStack tDrop : aDrops) {
- tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})});
- if (tRecipe != null) {
- final ItemStack tHammeringOutput = tRecipe.getOutput(0);
- if (tHammeringOutput != null) {
- rConversions += tDrop.stackSize;
- tDrop.stackSize *= tHammeringOutput.stackSize;
- tHammeringOutput.stackSize = tDrop.stackSize;
- GT_Utility.setStack(tDrop, tHammeringOutput);
- }
- }
- }
- } else {
- aDrops.clear();
- aDrops.add(tRecipe.getOutput(0));
- rConversions++;
- }
- return rConversions;
- }
-
- @Override
- public ItemStack getBrokenItem(final ItemStack aStack) {
- return null;
- }
-
- @Override
- public IIconContainer getIcon(final boolean aIsToolHead, final ItemStack aStack) {
- //Utils.LOG_INFO("Texture: "+TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile());
- return TexturesGtTools.SKOOKUM_CHOOCHER;
- }
-
- @Override
- public short[] getRGBa(final boolean aIsToolHead, final ItemStack aStack) {
- return GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa;
- }
-
- @Override
- public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
- super.onToolCrafted(aStack, aPlayer);
- aPlayer.triggerAchievement(AchievementList.buildSword);
- try {
- GT_Mod.achievements.issueAchievement(aPlayer, "tools");
- GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
- } catch (final Exception e) {
- }
- }
-
- @Override
- public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
- return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been Choochered by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE);
- }
-
- @Override
- public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
- aItem.addItemBehavior(aID, new Behaviour_Choocher());
- }
-
- @Override
- public boolean isGrafter() {
- return false;
- }
-
+public class TOOL_Gregtech_Choocher extends GT_Tool {
+
+ public static final List<String> mEffectiveList =
+ Arrays.asList(new String[] {EntityIronGolem.class.getName(), "EntityTowerGuardian"});
+
+ @Override
+ public float getNormalDamageAgainstEntity(
+ final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
+ String tName = aEntity.getClass().getName();
+ tName = tName.substring(tName.lastIndexOf(".") + 1);
+ return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
+ }
+
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 50;
+ }
+
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 400;
+ }
+
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 100;
+ }
+
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
+
+ @Override
+ public float getBaseDamage() {
+ return 4.0F;
+ }
+
+ @Override
+ public float getSpeedMultiplier() {
+ return 0.85F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.2F;
+ }
+
+ @Override
+ public String getCraftingSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(1));
+ }
+
+ @Override
+ public String getEntityHitSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(2));
+ }
+
+ @Override
+ public String getBreakingSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ @Override
+ public String getMiningSound() {
+ return null;
+ }
+
+ @Override
+ public boolean canBlock() {
+ return true;
+ }
+
+ public boolean isWrench() {
+ return true;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
+
+ @Override
+ public boolean isWeapon() {
+ return true;
+ }
+
+ @Override
+ public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
+ final String tTool = aBlock.getHarvestTool(aMetaData);
+ return ((tTool != null)
+ && ((tTool.equals("sword"))
+ || (tTool.equals("wrench"))
+ || (tTool.equals("hammer"))
+ || (tTool.equals("pickaxe"))))
+ || (aBlock.getMaterial() == Material.rock)
+ || (aBlock.getMaterial() == Material.glass)
+ || (aBlock.getMaterial() == Material.piston)
+ || (aBlock == Blocks.hopper)
+ || (aBlock == Blocks.dispenser)
+ || (aBlock == Blocks.dropper)
+ || (aBlock.getMaterial() == Material.ice)
+ || (aBlock.getMaterial() == Material.packedIce)
+ || (GT_Recipe.GT_Recipe_Map.sHammerRecipes.containsInput(new ItemStack(aBlock, 1, aMetaData)))
+ || (aBlock.getMaterial() == Material.sand)
+ || (aBlock.getMaterial() == Material.grass)
+ || (aBlock.getMaterial() == Material.ground)
+ || (aBlock.getMaterial() == Material.snow)
+ || (aBlock.getMaterial() == Material.clay)
+ || (aBlock.getMaterial() == Material.leaves)
+ || (aBlock.getMaterial() == Material.vine)
+ || (aBlock.getMaterial() == Material.wood)
+ || (aBlock.getMaterial() == Material.cactus)
+ || (aBlock.getMaterial() == Material.circuits)
+ || (aBlock.getMaterial() == Material.gourd)
+ || (aBlock.getMaterial() == Material.web)
+ || (aBlock.getMaterial() == Material.cloth)
+ || (aBlock.getMaterial() == Material.carpet)
+ || (aBlock.getMaterial() == Material.plants)
+ || (aBlock.getMaterial() == Material.cake)
+ || (aBlock.getMaterial() == Material.tnt)
+ || (aBlock.getMaterial() == Material.sponge);
+ }
+
+ @Override
+ public int convertBlockDrops(
+ final List<ItemStack> aDrops,
+ final ItemStack aStack,
+ final EntityPlayer aPlayer,
+ final Block aBlock,
+ final int aX,
+ final int aY,
+ final int aZ,
+ final byte aMetaData,
+ final int aFortune,
+ final boolean aSilkTouch,
+ final BlockEvent.HarvestDropsEvent aEvent) {
+ int rConversions = 0;
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(
+ null, true, 2147483647L, null, new ItemStack[] {new ItemStack(aBlock, 1, aMetaData)});
+ if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) {
+ for (final ItemStack tDrop : aDrops) {
+ tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(
+ null, true, 2147483647L, null, new ItemStack[] {GT_Utility.copyAmount(1L, new Object[] {tDrop})
+ });
+ if (tRecipe != null) {
+ final ItemStack tHammeringOutput = tRecipe.getOutput(0);
+ if (tHammeringOutput != null) {
+ rConversions += tDrop.stackSize;
+ tDrop.stackSize *= tHammeringOutput.stackSize;
+ tHammeringOutput.stackSize = tDrop.stackSize;
+ GT_Utility.setStack(tDrop, tHammeringOutput);
+ }
+ }
+ }
+ } else {
+ aDrops.clear();
+ aDrops.add(tRecipe.getOutput(0));
+ rConversions++;
+ }
+ return rConversions;
+ }
+
+ @Override
+ public ItemStack getBrokenItem(final ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public IIconContainer getIcon(final boolean aIsToolHead, final ItemStack aStack) {
+ // Utils.LOG_INFO("Texture: "+TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile());
+ return TexturesGtTools.SKOOKUM_CHOOCHER;
+ }
+
+ @Override
+ public short[] getRGBa(final boolean aIsToolHead, final ItemStack aStack) {
+ return GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa;
+ }
+
+ @Override
+ public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
+ super.onToolCrafted(aStack, aPlayer);
+ aPlayer.triggerAchievement(AchievementList.buildSword);
+ try {
+ GT_Mod.achievements.issueAchievement(aPlayer, "tools");
+ GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
+ } catch (final Exception e) {
+ }
+ }
+
+ @Override
+ public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
+ return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE
+ + " has been Choochered by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName()
+ + EnumChatFormatting.WHITE);
+ }
+
+ @Override
+ public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
+ aItem.addItemBehavior(aID, new Behaviour_Choocher());
+ }
+
+ @Override
+ public boolean isGrafter() {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java
index 7aa7529817..06e429514e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tools;
-import java.util.Arrays;
-import java.util.List;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -12,6 +9,8 @@ import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.common.items.behaviors.Behaviour_None;
import gregtech.common.tools.GT_Tool;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
+import java.util.Arrays;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
@@ -23,170 +22,163 @@ import net.minecraft.stats.AchievementList;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
-import net.minecraftforge.event.world.BlockEvent;
-
-public class TOOL_Gregtech_ElectricButcherKnife
-extends GT_Tool {
-
- public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"});
-
-
- @Override
- public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
- String tName = aEntity.getClass().getName();
- tName = tName.substring(tName.lastIndexOf(".") + 1);
- return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
- }
-
- @Override
- public int getToolDamagePerBlockBreak() {
- return 100;
- }
-
- @Override
- public int getToolDamagePerDropConversion() {
- return 100;
- }
-
- @Override
- public int getToolDamagePerContainerCraft() {
- return 100;
- }
-
- @Override
- public int getToolDamagePerEntityAttack() {
- return 200;
- }
-
- @Override
- public int getBaseQuality() {
- return 0;
- }
-
- @Override
- public float getBaseDamage() {
- return 8.0F;
- }
-
- @Override
- public float getSpeedMultiplier() {
- return 2F;
- }
-
- @Override
- public float getMaxDurabilityMultiplier() {
- return 1.8F;
- }
-
- @Override
- public String getCraftingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(1));
- }
-
- @Override
- public String getEntityHitSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(2));
- }
-
- @Override
- public String getBreakingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(0));
- }
-
- @Override
- public String getMiningSound() {
- return null;
- }
-
- @Override
- public boolean canBlock() {
- return false;
- }
-
- public boolean isWrench(){
- return false;
- }
-
- @Override
- public boolean isCrowbar() {
- return false;
- }
-
- @Override
- public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
- final String tTool = aBlock.getHarvestTool(aMetaData);
- return (tTool != null) && (tTool.equals("sword") || tTool.equals("knife"));
- }
-
- @Override
- public ItemStack getBrokenItem(final ItemStack aStack) {
- return null;
- }
-
- public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
- return (IIconContainer) (aIsToolHead
- ? TexturesGtTools.ELECTRIC_BUTCHER_KNIFE
- : ItemIcons.POWER_UNIT_HV);
- }
-
- public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
- return aIsToolHead
- ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa
- : Materials.RedSteel.mRGBa;
- }
-
-
-
-
- @Override
- public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
- super.onToolCrafted(aStack, aPlayer);
- aPlayer.triggerAchievement(AchievementList.buildSword);
- try {
- GT_Mod.achievements.issueAchievement(aPlayer, "tools");
- GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
- } catch (final Exception e) {
- }
- }
-
- @Override
- public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
- return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been Sliced out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE);
- }
-
- @Override
- public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
- aItem.addItemBehavior(aID, new Behaviour_None());
- }
-
- @Override
- public boolean isGrafter() {
- return false;
- }
-
- @Override
- public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) {
- return aOriginalHurtResistance * 2;
- }
-
- @Override
- public boolean isWeapon() {
- return true;
- }
-
- @Override
- public boolean isMiningTool() {
- return false;
- }
-
- @Override
- public Enchantment[] getEnchantments(ItemStack aStack) {
- return LOOTING_ENCHANTMENT;
- }
-
- @Override
- public int[] getEnchantmentLevels(ItemStack aStack) {
- return new int[]{(4 + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality) / 2};
- }
-
+
+public class TOOL_Gregtech_ElectricButcherKnife extends GT_Tool {
+
+ public static final List<String> mEffectiveList =
+ Arrays.asList(new String[] {EntityIronGolem.class.getName(), "EntityTowerGuardian"});
+
+ @Override
+ public float getNormalDamageAgainstEntity(
+ final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
+ String tName = aEntity.getClass().getName();
+ tName = tName.substring(tName.lastIndexOf(".") + 1);
+ return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
+ }
+
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 200;
+ }
+
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
+
+ @Override
+ public float getBaseDamage() {
+ return 8.0F;
+ }
+
+ @Override
+ public float getSpeedMultiplier() {
+ return 2F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.8F;
+ }
+
+ @Override
+ public String getCraftingSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(1));
+ }
+
+ @Override
+ public String getEntityHitSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(2));
+ }
+
+ @Override
+ public String getBreakingSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ @Override
+ public String getMiningSound() {
+ return null;
+ }
+
+ @Override
+ public boolean canBlock() {
+ return false;
+ }
+
+ public boolean isWrench() {
+ return false;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
+
+ @Override
+ public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
+ final String tTool = aBlock.getHarvestTool(aMetaData);
+ return (tTool != null) && (tTool.equals("sword") || tTool.equals("knife"));
+ }
+
+ @Override
+ public ItemStack getBrokenItem(final ItemStack aStack) {
+ return null;
+ }
+
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
+ return (IIconContainer) (aIsToolHead ? TexturesGtTools.ELECTRIC_BUTCHER_KNIFE : ItemIcons.POWER_UNIT_HV);
+ }
+
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : Materials.RedSteel.mRGBa;
+ }
+
+ @Override
+ public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
+ super.onToolCrafted(aStack, aPlayer);
+ aPlayer.triggerAchievement(AchievementList.buildSword);
+ try {
+ GT_Mod.achievements.issueAchievement(aPlayer, "tools");
+ GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
+ } catch (final Exception e) {
+ }
+ }
+
+ @Override
+ public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
+ return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE
+ + " has been Sliced out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName()
+ + EnumChatFormatting.WHITE);
+ }
+
+ @Override
+ public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
+ aItem.addItemBehavior(aID, new Behaviour_None());
+ }
+
+ @Override
+ public boolean isGrafter() {
+ return false;
+ }
+
+ @Override
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) {
+ return aOriginalHurtResistance * 2;
+ }
+
+ @Override
+ public boolean isWeapon() {
+ return true;
+ }
+
+ @Override
+ public boolean isMiningTool() {
+ return false;
+ }
+
+ @Override
+ public Enchantment[] getEnchantments(ItemStack aStack) {
+ return LOOTING_ENCHANTMENT;
+ }
+
+ @Override
+ public int[] getEnchantmentLevels(ItemStack aStack) {
+ return new int[] {(4 + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality) / 2};
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java
index 395a7c42cb..b1f4385a11 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tools;
-import java.util.Arrays;
-import java.util.List;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -12,6 +9,8 @@ import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.common.tools.GT_Tool;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Electric_Lighter;
+import java.util.Arrays;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -23,144 +22,141 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
-public class TOOL_Gregtech_ElectricLighter
-extends GT_Tool {
-
- public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"});
-
-
- @Override
- public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
- String tName = aEntity.getClass().getName();
- tName = tName.substring(tName.lastIndexOf(".") + 1);
- return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
- }
-
- @Override
- public int getToolDamagePerBlockBreak() {
- return 50;
- }
-
- @Override
- public int getToolDamagePerDropConversion() {
- return 100;
- }
-
- @Override
- public int getToolDamagePerContainerCraft() {
- return 400;
- }
-
- @Override
- public int getToolDamagePerEntityAttack() {
- return 100;
- }
-
- @Override
- public int getBaseQuality() {
- return 0;
- }
-
- @Override
- public float getBaseDamage() {
- return 8.0F;
- }
-
- @Override
- public float getSpeedMultiplier() {
- return 2F;
- }
-
- @Override
- public float getMaxDurabilityMultiplier() {
- return 1.8F;
- }
-
- @Override
- public String getCraftingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(1));
- }
-
- @Override
- public String getEntityHitSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(2));
- }
-
- @Override
- public String getBreakingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(0));
- }
-
- @Override
- public String getMiningSound() {
- return null;
- }
-
- @Override
- public boolean canBlock() {
- return false;
- }
-
- public boolean isWrench(){
- return false;
- }
-
- @Override
- public boolean isCrowbar() {
- return false;
- }
-
- @Override
- public boolean isWeapon() {
- return true;
- }
-
- @Override
- public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
- return false;
- }
-
- @Override
- public ItemStack getBrokenItem(final ItemStack aStack) {
- return null;
- }
-
- public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
- return (IIconContainer) (aIsToolHead
- ? TexturesGtTools.ELECTRIC_LIGHTER
- : ItemIcons.POWER_UNIT_HV);
- }
-
- public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
- return !aIsToolHead
- ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa
- : Materials.Silver.mRGBa;
- }
-
- @Override
- public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
- super.onToolCrafted(aStack, aPlayer);
- aPlayer.triggerAchievement(AchievementList.buildSword);
- try {
- GT_Mod.achievements.issueAchievement(aPlayer, "tools");
- GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
- } catch (final Exception e) {
- }
- }
-
- @Override
- public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
- return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been burnt out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE);
- }
-
- @Override
- public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
- aItem.addItemBehavior(aID, new Behaviour_Electric_Lighter());
- }
-
- @Override
- public boolean isGrafter() {
- return false;
- }
-
+public class TOOL_Gregtech_ElectricLighter extends GT_Tool {
+
+ public static final List<String> mEffectiveList =
+ Arrays.asList(new String[] {EntityIronGolem.class.getName(), "EntityTowerGuardian"});
+
+ @Override
+ public float getNormalDamageAgainstEntity(
+ final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
+ String tName = aEntity.getClass().getName();
+ tName = tName.substring(tName.lastIndexOf(".") + 1);
+ return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
+ }
+
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 50;
+ }
+
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 400;
+ }
+
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 100;
+ }
+
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
+
+ @Override
+ public float getBaseDamage() {
+ return 8.0F;
+ }
+
+ @Override
+ public float getSpeedMultiplier() {
+ return 2F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.8F;
+ }
+
+ @Override
+ public String getCraftingSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(1));
+ }
+
+ @Override
+ public String getEntityHitSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(2));
+ }
+
+ @Override
+ public String getBreakingSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ @Override
+ public String getMiningSound() {
+ return null;
+ }
+
+ @Override
+ public boolean canBlock() {
+ return false;
+ }
+
+ public boolean isWrench() {
+ return false;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
+
+ @Override
+ public boolean isWeapon() {
+ return true;
+ }
+
+ @Override
+ public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
+ return false;
+ }
+
+ @Override
+ public ItemStack getBrokenItem(final ItemStack aStack) {
+ return null;
+ }
+
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
+ return (IIconContainer) (aIsToolHead ? TexturesGtTools.ELECTRIC_LIGHTER : ItemIcons.POWER_UNIT_HV);
+ }
+
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
+ return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : Materials.Silver.mRGBa;
+ }
+
+ @Override
+ public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
+ super.onToolCrafted(aStack, aPlayer);
+ aPlayer.triggerAchievement(AchievementList.buildSword);
+ try {
+ GT_Mod.achievements.issueAchievement(aPlayer, "tools");
+ GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
+ } catch (final Exception e) {
+ }
+ }
+
+ @Override
+ public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
+ return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE
+ + " has been burnt out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName()
+ + EnumChatFormatting.WHITE);
+ }
+
+ @Override
+ public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
+ aItem.addItemBehavior(aID, new Behaviour_Electric_Lighter());
+ }
+
+ @Override
+ public boolean isGrafter() {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java
index 2277ce339f..ae477cd7bb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java
@@ -15,83 +15,76 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
-public class TOOL_Gregtech_ElectricSnips
-extends GT_Tool_WireCutter {
+public class TOOL_Gregtech_ElectricSnips extends GT_Tool_WireCutter {
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 50;
+ }
- @Override
- public int getToolDamagePerBlockBreak() {
- return 50;
- }
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
- @Override
- public int getToolDamagePerDropConversion() {
- return 100;
- }
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 400;
+ }
- @Override
- public int getToolDamagePerContainerCraft() {
- return 400;
- }
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 100;
+ }
- @Override
- public int getToolDamagePerEntityAttack() {
- return 100;
- }
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
- @Override
- public int getBaseQuality() {
- return 0;
- }
+ @Override
+ public float getBaseDamage() {
+ return 4.0F;
+ }
- @Override
- public float getBaseDamage() {
- return 4.0F;
- }
+ @Override
+ public float getSpeedMultiplier() {
+ return 1F;
+ }
- @Override
- public float getSpeedMultiplier() {
- return 1F;
- }
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.4F;
+ }
- @Override
- public float getMaxDurabilityMultiplier() {
- return 1.4F;
- }
+ @Override
+ public ItemStack getBrokenItem(final ItemStack aStack) {
+ return null;
+ }
- @Override
- public ItemStack getBrokenItem(final ItemStack aStack) {
- return null;
- }
-
- public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
- return (IIconContainer) (aIsToolHead
- ? TexturesGtTools.ELECTRIC_SNIPS
- : ItemIcons.POWER_UNIT_MV);
- }
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
+ return (IIconContainer) (aIsToolHead ? TexturesGtTools.ELECTRIC_SNIPS : ItemIcons.POWER_UNIT_MV);
+ }
- public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
- return aIsToolHead
- ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa
- : Materials.TungstenSteel.mRGBa;
- }
-
-
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : Materials.TungstenSteel.mRGBa;
+ }
- @Override
- public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
- super.onToolCrafted(aStack, aPlayer);
- aPlayer.triggerAchievement(AchievementList.buildSword);
- try {
- GT_Mod.achievements.issueAchievement(aPlayer, "tools");
- GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
- } catch (final Exception e) {
- }
- }
+ @Override
+ public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
+ super.onToolCrafted(aStack, aPlayer);
+ aPlayer.triggerAchievement(AchievementList.buildSword);
+ try {
+ GT_Mod.achievements.issueAchievement(aPlayer, "tools");
+ GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
+ } catch (final Exception e) {
+ }
+ }
- @Override
- public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
- return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been Snipped out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE);
- }
-
+ @Override
+ public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
+ return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE
+ + " has been Snipped out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName()
+ + EnumChatFormatting.WHITE);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java
index 4c8707e5e8..894d45ee39 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java
@@ -1,290 +1,279 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.lang.reflect.*;
-import java.util.HashMap;
-import java.util.Map;
-
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.*;
+import java.util.HashMap;
+import java.util.Map;
public class GT_Material_Loader {
- private volatile static GT_Material_Loader instance = new GT_Material_Loader();
- private volatile Object mProxyObject;
- private static AutoMap<Materials> mMaterials = new AutoMap<Materials>();
- private static volatile boolean mHasRun = false;
-
- public synchronized GT_Material_Loader getInstance(){
- return GT_Material_Loader.instance;
- }
-
- public synchronized boolean getRunAbility(){
- return (mHasRun ? false : true);
- }
- public synchronized void setRunAbility(boolean b){
- mHasRun = Utils.invertBoolean(b);
- }
-
- public GT_Material_Loader() {
- if (getRunAbility()){
- //Set Singleton Instance
- instance = this;
-
- //Try Reflectively add ourselves to the GT loader.
- Class mInterface = ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler");
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && mInterface != null){
-
- //Make this class Dynamically implement IMaterialHandler
- if (mProxyObject == null){
- mProxyObject = Proxy.newProxyInstance(
- mInterface.getClassLoader(), new Class[] { mInterface },
- new MaterialHandler(getInstance()));
- }
-
- if (ReflectionUtils.invoke(Materials.class, "add", new Class[]{ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler")}, new Object[]{mProxyObject})){
- Logger.REFLECTION("Successfully invoked add, on the proxied object implementing IMaterialHandler.");
-
-
- Logger.REFLECTION("Examining Proxy to ensure it implements the correct Interface.");
- Class[] i = mProxyObject.getClass().getInterfaces();
- for (int r=0;r<i.length;r++){
- Logger.REFLECTION("Contains "+i[r].getCanonicalName()+".");
- if (i[r] == mInterface){
- Logger.REFLECTION("Found gregtech.api.interfaces.IMaterialHandler. This Proxy is valid.");
- }
- }
- }
- else {
- Logger.REFLECTION("Failed to invoke add, on the proxied object implementing IMaterialHandler.");
- }
- }
- //Materials.add(this);
-
- //Stupid shit running twice, I don't think so.
- setRunAbility(false);
- }
- }
-
- public void onMaterialsInit() {
- Logger.DEBUG_MATERIALS("onMaterialsInit()");
- }
-
- public void onComponentInit() {
- Logger.DEBUG_MATERIALS("onComponentInit()");
- if (!mMaterials.isEmpty()){
- Logger.DEBUG_MATERIALS("Found "+mMaterials.size()+" materials to re-enable.");
- for (Materials M : mMaterials.values()){
- String name = MaterialUtils.getMaterialName(M);
- Logger.DEBUG_MATERIALS("Trying to enable "+name+".");
- boolean success = tryEnableAllComponentsForMaterial(M);
- if (success){
- Logger.DEBUG_MATERIALS("Success! Enabled "+name+".");
- }
- else {
- Logger.DEBUG_MATERIALS("Failure... Did not enable "+name+".");
- }
- }
- }
- }
-
- public void onComponentIteration(Materials aMaterial) {
- Logger.DEBUG_MATERIALS("onComponentIteration()");
- }
-
- public synchronized boolean enableMaterial(Materials m){
- if (mMaterials.setValue(m)){
- Logger.DEBUG_MATERIALS("Added "+MaterialUtils.getMaterialName(m)+" to internal Map.");
- return true;
- }
- Logger.DEBUG_MATERIALS("Failed to add "+MaterialUtils.getMaterialName(m)+" to internal Map.");
- return false;
- }
-
-
-
-
-
-
- /*
- * Static internal handler methods
- */
-
- private static synchronized boolean tryEnableMaterial(Materials mMaterial){
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- return false;
- }
-
- boolean value = ReflectionUtils.setField(mMaterial, "mHasParentMod", true);
- if (value){
- Logger.DEBUG_MATERIALS("Set mHasParentMod true for "+mMaterial.mDefaultLocalName);
- }
- else {
- Logger.DEBUG_MATERIALS("Failed to set mHasParentMod true for "+mMaterial.mDefaultLocalName);
- }
- return value;
- }
-
- private static synchronized boolean tryEnableMaterialPart(OrePrefixes prefix, Materials mMaterial){
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- return false;
- }
- try {
- Method enableComponent = ReflectionUtils.getClass("gregtech.api.enums.OrePrefixes").getDeclaredMethod("enableComponent", Materials.class);
- enableComponent.invoke(prefix, mMaterial);
- Logger.DEBUG_MATERIALS("Enabled "+prefix.name()+" for "+mMaterial.mDefaultLocalName+".");
- return true;
- }
- catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException error) {
- Logger.DEBUG_MATERIALS("Failed to enabled "+prefix.name()+" for "+mMaterial.mDefaultLocalName+". Caught "+error.getCause().toString()+".");
- error.printStackTrace();
- }
- Logger.DEBUG_MATERIALS("Did not enable "+prefix.name()+" for "+mMaterial.mDefaultLocalName+". Report this error to Alkalus on Github.");
- return false;
- }
-
- private static synchronized boolean tryEnableAllComponentsForMaterial(Materials material){
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- return false;
- }
- try {
- tryEnableMaterial(material);
- int mValid = 0;
- for(OrePrefixes ore:OrePrefixes.values()){
- if (tryEnableMaterialPart(ore, material)){
- mValid++;
- }
- }
- if (mValid > 0){
- Logger.DEBUG_MATERIALS("Success - Re-enabled all components for "+MaterialUtils.getMaterialName(material));
- }
- else {
- Logger.DEBUG_MATERIALS("Failure - Did not enable any components for "+MaterialUtils.getMaterialName(material));
- }
- return mValid > 0;
- }
- catch (SecurityException | IllegalArgumentException e) {
- Logger.DEBUG_MATERIALS("Total Failure - Unable to re-enable "+MaterialUtils.getMaterialName(material)+". Most likely an IllegalArgumentException, but small chance it's a SecurityException.");
- return false;
- }
- }
-
-
-
-
-
-
-
-
-
- /**
- * Special Dynamic Interface Class
- */
-
- public class MaterialHandler implements InvocationHandler {
-
- private final Map<String, Method> methods = new HashMap<String, Method>();
- private Object target;
-
- public MaterialHandler(Object target) {
- Logger.REFLECTION("Created a Proxy Interface which implements IMaterialHandler.");
- this.target = target;
- for(Method method: target.getClass().getDeclaredMethods()) {
- Logger.REFLECTION("Adding "+method.getName()+" to internal method map.");
- this.methods.put(method.getName(), method);
- }
- }
-
- @Override
- public Object invoke(Object proxy, Method method, Object[] args)
- throws Throwable {
- long start = System.nanoTime();
- Object result = methods.get(method.getName()).invoke(target, args);
- long elapsed = System.nanoTime() - start;
- Logger.INFO("[Debug] Executed "+method.getName()+" in "+elapsed+" ns");
- return result;
- }
- }
-
-
- /*
- public static class ProxyListener implements java.lang.reflect.InvocationHandler {
-
- public static Object IMaterialHandlerProxy;
-
- ProxyListener(){
-
- Logger.REFLECTION("Failed setting IMaterialHandler Proxy instance.");
- }
-
- //Loading the class at runtime
- public static void main(String[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException {
- Class<?> someInterface = ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler");
- Object instance = Proxy.newProxyInstance(someInterface.getClassLoader(), new Class<?>[]{someInterface}, new InvocationHandler() {
-
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- //Handle the invocations
- if(method.getName().equals("onMaterialsInit")){
- Logger.REFLECTION("Invoked onMaterialsInit() via IMaterialHandler proxy");
- return 1;
- }
- else if(method.getName().equals("onComponentInit")){
- Logger.REFLECTION("Invoked onComponentInit() via IMaterialHandler proxy");
- return 2;
- }
- else if(method.getName().equals("onComponentIteration")){
- Logger.REFLECTION("Invoked onComponentIteration() via IMaterialHandler proxy");
- return 3;
- }
- else {
- return -1;
- }
- }
- });
- System.out.println(instance.getClass().getDeclaredMethod("someMethod", (Class<?>[])null).invoke(instance, new Object[]{}));
- }
-
- private static class MaterialHandler implements InvocationHandler {
- private final Object original;
-
- public MaterialHandler(Object original) {
- this.original = original;
- }
-
- @Override
- public Object invoke(Object proxy, Method method, Object[] args)
- throws IllegalAccessException, IllegalArgumentException,
- InvocationTargetException {
- System.out.println("BEFORE");
- method.invoke(original, args);
- System.out.println("AFTER");
- return null;
- }
- }
-
- public static void init(){
-
- Class<?> someInterface = ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler");
- GT_Material_Loader original = GT_Material_Loader.instance;
- MaterialHandler handler = new MaterialHandler(original);
-
- Object f = Proxy.newProxyInstance(someInterface.getClassLoader(),
- new Class[] { someInterface },
- handler);
-
- f.originalMethod("Hallo");
- }
-
-
-
- }
-
- */
+ private static volatile GT_Material_Loader instance = new GT_Material_Loader();
+ private volatile Object mProxyObject;
+ private static AutoMap<Materials> mMaterials = new AutoMap<Materials>();
+ private static volatile boolean mHasRun = false;
+
+ public synchronized GT_Material_Loader getInstance() {
+ return GT_Material_Loader.instance;
+ }
+
+ public synchronized boolean getRunAbility() {
+ return (mHasRun ? false : true);
+ }
+
+ public synchronized void setRunAbility(boolean b) {
+ mHasRun = Utils.invertBoolean(b);
+ }
+
+ public GT_Material_Loader() {
+ if (getRunAbility()) {
+ // Set Singleton Instance
+ instance = this;
+
+ // Try Reflectively add ourselves to the GT loader.
+ Class mInterface = ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler");
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && mInterface != null) {
+
+ // Make this class Dynamically implement IMaterialHandler
+ if (mProxyObject == null) {
+ mProxyObject = Proxy.newProxyInstance(
+ mInterface.getClassLoader(), new Class[] {mInterface}, new MaterialHandler(getInstance()));
+ }
+
+ if (ReflectionUtils.invoke(
+ Materials.class,
+ "add",
+ new Class[] {ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler")},
+ new Object[] {mProxyObject})) {
+ Logger.REFLECTION("Successfully invoked add, on the proxied object implementing IMaterialHandler.");
+
+ Logger.REFLECTION("Examining Proxy to ensure it implements the correct Interface.");
+ Class[] i = mProxyObject.getClass().getInterfaces();
+ for (int r = 0; r < i.length; r++) {
+ Logger.REFLECTION("Contains " + i[r].getCanonicalName() + ".");
+ if (i[r] == mInterface) {
+ Logger.REFLECTION("Found gregtech.api.interfaces.IMaterialHandler. This Proxy is valid.");
+ }
+ }
+ } else {
+ Logger.REFLECTION("Failed to invoke add, on the proxied object implementing IMaterialHandler.");
+ }
+ }
+ // Materials.add(this);
+
+ // Stupid shit running twice, I don't think so.
+ setRunAbility(false);
+ }
+ }
+
+ public void onMaterialsInit() {
+ Logger.DEBUG_MATERIALS("onMaterialsInit()");
+ }
+
+ public void onComponentInit() {
+ Logger.DEBUG_MATERIALS("onComponentInit()");
+ if (!mMaterials.isEmpty()) {
+ Logger.DEBUG_MATERIALS("Found " + mMaterials.size() + " materials to re-enable.");
+ for (Materials M : mMaterials.values()) {
+ String name = MaterialUtils.getMaterialName(M);
+ Logger.DEBUG_MATERIALS("Trying to enable " + name + ".");
+ boolean success = tryEnableAllComponentsForMaterial(M);
+ if (success) {
+ Logger.DEBUG_MATERIALS("Success! Enabled " + name + ".");
+ } else {
+ Logger.DEBUG_MATERIALS("Failure... Did not enable " + name + ".");
+ }
+ }
+ }
+ }
+
+ public void onComponentIteration(Materials aMaterial) {
+ Logger.DEBUG_MATERIALS("onComponentIteration()");
+ }
+
+ public synchronized boolean enableMaterial(Materials m) {
+ if (mMaterials.setValue(m)) {
+ Logger.DEBUG_MATERIALS("Added " + MaterialUtils.getMaterialName(m) + " to internal Map.");
+ return true;
+ }
+ Logger.DEBUG_MATERIALS("Failed to add " + MaterialUtils.getMaterialName(m) + " to internal Map.");
+ return false;
+ }
+
+ /*
+ * Static internal handler methods
+ */
+
+ private static synchronized boolean tryEnableMaterial(Materials mMaterial) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return false;
+ }
+
+ boolean value = ReflectionUtils.setField(mMaterial, "mHasParentMod", true);
+ if (value) {
+ Logger.DEBUG_MATERIALS("Set mHasParentMod true for " + mMaterial.mDefaultLocalName);
+ } else {
+ Logger.DEBUG_MATERIALS("Failed to set mHasParentMod true for " + mMaterial.mDefaultLocalName);
+ }
+ return value;
+ }
+
+ private static synchronized boolean tryEnableMaterialPart(OrePrefixes prefix, Materials mMaterial) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return false;
+ }
+ try {
+ Method enableComponent = ReflectionUtils.getClass("gregtech.api.enums.OrePrefixes")
+ .getDeclaredMethod("enableComponent", Materials.class);
+ enableComponent.invoke(prefix, mMaterial);
+ Logger.DEBUG_MATERIALS("Enabled " + prefix.name() + " for " + mMaterial.mDefaultLocalName + ".");
+ return true;
+ } catch (IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException
+ | NoSuchMethodException
+ | SecurityException error) {
+ Logger.DEBUG_MATERIALS("Failed to enabled " + prefix.name() + " for " + mMaterial.mDefaultLocalName
+ + ". Caught " + error.getCause().toString() + ".");
+ error.printStackTrace();
+ }
+ Logger.DEBUG_MATERIALS("Did not enable " + prefix.name() + " for " + mMaterial.mDefaultLocalName
+ + ". Report this error to Alkalus on Github.");
+ return false;
+ }
+
+ private static synchronized boolean tryEnableAllComponentsForMaterial(Materials material) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return false;
+ }
+ try {
+ tryEnableMaterial(material);
+ int mValid = 0;
+ for (OrePrefixes ore : OrePrefixes.values()) {
+ if (tryEnableMaterialPart(ore, material)) {
+ mValid++;
+ }
+ }
+ if (mValid > 0) {
+ Logger.DEBUG_MATERIALS(
+ "Success - Re-enabled all components for " + MaterialUtils.getMaterialName(material));
+ } else {
+ Logger.DEBUG_MATERIALS(
+ "Failure - Did not enable any components for " + MaterialUtils.getMaterialName(material));
+ }
+ return mValid > 0;
+ } catch (SecurityException | IllegalArgumentException e) {
+ Logger.DEBUG_MATERIALS("Total Failure - Unable to re-enable " + MaterialUtils.getMaterialName(material)
+ + ". Most likely an IllegalArgumentException, but small chance it's a SecurityException.");
+ return false;
+ }
+ }
+
+ /**
+ * Special Dynamic Interface Class
+ */
+ public class MaterialHandler implements InvocationHandler {
+
+ private final Map<String, Method> methods = new HashMap<String, Method>();
+ private Object target;
+
+ public MaterialHandler(Object target) {
+ Logger.REFLECTION("Created a Proxy Interface which implements IMaterialHandler.");
+ this.target = target;
+ for (Method method : target.getClass().getDeclaredMethods()) {
+ Logger.REFLECTION("Adding " + method.getName() + " to internal method map.");
+ this.methods.put(method.getName(), method);
+ }
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ long start = System.nanoTime();
+ Object result = methods.get(method.getName()).invoke(target, args);
+ long elapsed = System.nanoTime() - start;
+ Logger.INFO("[Debug] Executed " + method.getName() + " in " + elapsed + " ns");
+ return result;
+ }
+ }
+
+ /*
+ public static class ProxyListener implements java.lang.reflect.InvocationHandler {
+
+ public static Object IMaterialHandlerProxy;
+
+ ProxyListener(){
+
+ Logger.REFLECTION("Failed setting IMaterialHandler Proxy instance.");
+ }
+
+ //Loading the class at runtime
+ public static void main(String[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException {
+ Class<?> someInterface = ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler");
+ Object instance = Proxy.newProxyInstance(someInterface.getClassLoader(), new Class<?>[]{someInterface}, new InvocationHandler() {
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ //Handle the invocations
+ if(method.getName().equals("onMaterialsInit")){
+ Logger.REFLECTION("Invoked onMaterialsInit() via IMaterialHandler proxy");
+ return 1;
+ }
+ else if(method.getName().equals("onComponentInit")){
+ Logger.REFLECTION("Invoked onComponentInit() via IMaterialHandler proxy");
+ return 2;
+ }
+ else if(method.getName().equals("onComponentIteration")){
+ Logger.REFLECTION("Invoked onComponentIteration() via IMaterialHandler proxy");
+ return 3;
+ }
+ else {
+ return -1;
+ }
+ }
+ });
+ System.out.println(instance.getClass().getDeclaredMethod("someMethod", (Class<?>[])null).invoke(instance, new Object[]{}));
+ }
+
+ private static class MaterialHandler implements InvocationHandler {
+ private final Object original;
+
+ public MaterialHandler(Object original) {
+ this.original = original;
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws IllegalAccessException, IllegalArgumentException,
+ InvocationTargetException {
+ System.out.println("BEFORE");
+ method.invoke(original, args);
+ System.out.println("AFTER");
+ return null;
+ }
+ }
+
+ public static void init(){
+
+ Class<?> someInterface = ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler");
+ GT_Material_Loader original = GT_Material_Loader.instance;
+ MaterialHandler handler = new MaterialHandler(original);
+
+ Object f = Proxy.newProxyInstance(someInterface.getClassLoader(),
+ new Class[] { someInterface },
+ handler);
+
+ f.originalMethod("Hallo");
+ }
+
+
+
+ }
+
+ */
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
index 724f352975..47257b404f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
@@ -5,20 +5,19 @@ import gtPlusPlus.xmod.gregtech.common.blocks.*;
public class Gregtech_Blocks {
- public static void run(){
-
- //Casing Blocks
- ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks();
- ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2();
- ModBlocks.blockCasings3Misc = new GregtechMetaCasingBlocks3();
- ModBlocks.blockCasings4Misc = new GregtechMetaCasingBlocks4();
- ModBlocks.blockCasings5Misc = new GregtechMetaCasingBlocks5();
+ public static void run() {
- ModBlocks.blockCasingsTieredGTPP = new GregtechMetaTieredCasingBlocks1();
- ModBlocks.blockSpecialMultiCasings = new GregtechMetaSpecialMultiCasings();
- ModBlocks.blockSpecialMultiCasings2 = new GregtechMetaSpecialMultiCasings2();
- ModBlocks.blockCustomMachineCasings = new GregtechMetaSpecialMachineCasings();
- ModBlocks.blockCustomPipeGearCasings = new GregtechMetaCasingBlocksPipeGearbox();
+ // Casing Blocks
+ ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks();
+ ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2();
+ ModBlocks.blockCasings3Misc = new GregtechMetaCasingBlocks3();
+ ModBlocks.blockCasings4Misc = new GregtechMetaCasingBlocks4();
+ ModBlocks.blockCasings5Misc = new GregtechMetaCasingBlocks5();
- }
+ ModBlocks.blockCasingsTieredGTPP = new GregtechMetaTieredCasingBlocks1();
+ ModBlocks.blockSpecialMultiCasings = new GregtechMetaSpecialMultiCasings();
+ ModBlocks.blockSpecialMultiCasings2 = new GregtechMetaSpecialMultiCasings2();
+ ModBlocks.blockCustomMachineCasings = new GregtechMetaSpecialMachineCasings();
+ ModBlocks.blockCustomPipeGearCasings = new GregtechMetaCasingBlocksPipeGearbox();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java
index 51316f024a..f43a255534 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java
@@ -1,4 +1,3 @@
-
package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.GT_Values;
@@ -20,116 +19,132 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import net.minecraft.item.ItemStack;
public class ProcessingAngleGrinder implements Interface_OreRecipeRegistrator, Runnable {
- public ProcessingAngleGrinder() {
- GregtechOrePrefixes.toolAngleGrinder.add(this);
- }
+ public ProcessingAngleGrinder() {
+ GregtechOrePrefixes.toolAngleGrinder.add(this);
+ }
+
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
+ if (aMaterial != Materials.Rubber) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))) {}
+ }
+ }
+ }
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
- if (aMaterial != Materials.Rubber) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
- && (!aMaterial.contains(SubTag.NO_SMASHING))) {
-
- }
- }
- }
- }
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final GT_Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ // TODO Auto-generated method stub
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- // TODO Auto-generated method stub
+ }
- }
+ public void materialsLoops() {
+ final Materials[] i = Materials.values();
+ final int size = i.length;
+ Logger.MATERIALS("Materials to attempt tool gen. with: " + size);
+ int used = 0;
+ Materials aMaterial = null;
+ for (int r = 0; r < size; r++) {
+ aMaterial = i[r];
+ if ((aMaterial != Materials.Stone)
+ && (aMaterial != Materials.Flint)
+ && (aMaterial != Materials.Rubber)
+ && (aMaterial != Materials._NULL)) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))
+ && (!aMaterial.contains(SubTag.TRANSPARENT))
+ && (!aMaterial.contains(SubTag.FLAMMABLE))
+ && (!aMaterial.contains(SubTag.MAGICAL))
+ && (!aMaterial.contains(SubTag.NO_SMELTING))) {
+ Logger.MATERIALS("Generating Angle Grinder from " + MaterialUtils.getMaterialName(aMaterial));
+ // Input 1
- public void materialsLoops() {
- final Materials[] i = Materials.values();
- final int size = i.length;
- Logger.MATERIALS("Materials to attempt tool gen. with: " + size);
- int used = 0;
- Materials aMaterial = null;
- for (int r = 0; r < size; r++) {
- aMaterial = i[r];
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber)
- && (aMaterial != Materials._NULL)) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
- && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT))
- && (!aMaterial.contains(SubTag.FLAMMABLE)) && (!aMaterial.contains(SubTag.MAGICAL))
- && (!aMaterial.contains(SubTag.NO_SMELTING))) {
- Logger.MATERIALS("Generating Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial));
- // Input 1
-
+ final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
+ final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L);
- final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
- final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L);
+ if ((null != plate && longrod != null)) {
+ addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1));
+ addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1));
+ addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1));
+ used++;
+ } else {
+ Logger.MATERIALS(
+ "Unable to generate Angle Grinder from " + MaterialUtils.getMaterialName(aMaterial)
+ + ", Plate or Long Rod may be invalid. Invalid | Plate? " + (plate == null)
+ + " | Rod? " + (longrod == null) + " |");
+ }
+ // GT_ModHandler.addCraftingRecipe(,
+ // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
+ // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ",
+ // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial),
+ // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
+ // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
+ } else {
+ Logger.MATERIALS(
+ "Unable to generate Angle Grinder from " + MaterialUtils.getMaterialName(aMaterial));
+ }
+ } else {
+ Logger.MATERIALS("Unable to generate Angle Grinder from " + MaterialUtils.getMaterialName(aMaterial));
+ }
+ }
- if ((null != plate && longrod != null)) {
- addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1));
- addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1));
- addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1));
- used++;
- } else {
- Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)+", Plate or Long Rod may be invalid. Invalid | Plate? "+(plate == null) +" | Rod? "+(longrod == null)+" |");
- }
- // GT_ModHandler.addCraftingRecipe(,
- // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
- // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ",
- // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial),
- // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
- // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
- } else {
- Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial));
- }
- } else {
- Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial));
- }
+ Logger.INFO("Materials used for tool gen: " + used);
+ }
- }
+ @Override
+ public void run() {
+ Logger.INFO("Generating Angle Grinders for all valid GT Materials.");
+ this.materialsLoops();
+ }
- Logger.INFO("Materials used for tool gen: " + used);
- }
+ public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) {
- @Override
- public void run() {
- Logger.INFO("Generating Angle Grinders for all valid GT Materials.");
- this.materialsLoops();
- }
-
- public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) {
-
- ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
- MetaGeneratedGregtechTools.ANGLE_GRINDER,
- 1,
- aMaterial,
- Materials.Titanium,
- new long[]{aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L});
-
-
+ ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
+ MetaGeneratedGregtechTools.ANGLE_GRINDER, 1, aMaterial, Materials.Titanium, new long[] {
+ aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L
+ });
- long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack);
- if (aDura <= 32000) {
- Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)+", Durability: "+aDura);
- return false;
- }
-
- return GT_ModHandler.addCraftingRecipe(
- aOutputStack,
- RecipeBits.DISMANTLEABLE | RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED,
- new Object[]{
- "SXL",
- "GMG",
- "PBP",
- 'X', ItemList.Component_Grinder_Tungsten.get(1),
- 'M', CI.getElectricMotor(aVoltageTier, 1),
- 'S', OrePrefixes.screw.get(Materials.Titanium),
- 'L', OrePrefixes.stickLong.get(aMaterial),
- 'P', OrePrefixes.plate.get(aMaterial),
- 'G', ELEMENT.STANDALONE.BLACK_METAL.getGear(1),
- 'B', aBattery
- });
-
- }
+ long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack);
+ if (aDura <= 32000) {
+ Logger.MATERIALS("Unable to generate Angle Grinder from " + MaterialUtils.getMaterialName(aMaterial)
+ + ", Durability: " + aDura);
+ return false;
+ }
-} \ No newline at end of file
+ return GT_ModHandler.addCraftingRecipe(
+ aOutputStack,
+ RecipeBits.DISMANTLEABLE | RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED,
+ new Object[] {
+ "SXL",
+ "GMG",
+ "PBP",
+ 'X',
+ ItemList.Component_Grinder_Tungsten.get(1),
+ 'M',
+ CI.getElectricMotor(aVoltageTier, 1),
+ 'S',
+ OrePrefixes.screw.get(Materials.Titanium),
+ 'L',
+ OrePrefixes.stickLong.get(aMaterial),
+ 'P',
+ OrePrefixes.plate.get(aMaterial),
+ 'G',
+ ELEMENT.STANDALONE.BLACK_METAL.getGear(1),
+ 'B',
+ aBattery
+ });
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java
index 9fe9ad7816..43c9d31727 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java
@@ -1,4 +1,3 @@
-
package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.GT_Values;
@@ -6,12 +5,9 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SubTag;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_ModHandler.RecipeBits;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
@@ -22,113 +18,126 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import net.minecraft.item.ItemStack;
public class ProcessingElectricButcherKnife implements Interface_OreRecipeRegistrator, Runnable {
- public ProcessingElectricButcherKnife() {
- GregtechOrePrefixes.toolElectricButcherKnife.add(this);
- }
+ public ProcessingElectricButcherKnife() {
+ GregtechOrePrefixes.toolElectricButcherKnife.add(this);
+ }
+
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
+ if (aMaterial != Materials.Rubber) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))) {}
+ }
+ }
+ }
+
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final GT_Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ // TODO Auto-generated method stub
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
- if (aMaterial != Materials.Rubber) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
- && (!aMaterial.contains(SubTag.NO_SMASHING))) {
-
- }
- }
- }
- }
+ }
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- // TODO Auto-generated method stub
+ public void materialsLoops() {
+ final Materials[] i = Materials.values();
+ final int size = i.length;
+ Logger.MATERIALS("Materials to attempt tool gen. with: " + size);
+ int used = 0;
+ Materials aMaterial = null;
+ for (int r = 0; r < size; r++) {
+ aMaterial = i[r];
+ if ((aMaterial != Materials.Stone)
+ && (aMaterial != Materials.Flint)
+ && (aMaterial != Materials.Rubber)
+ && (aMaterial != Materials._NULL)) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))
+ && (!aMaterial.contains(SubTag.TRANSPARENT))
+ && (!aMaterial.contains(SubTag.FLAMMABLE))
+ && (!aMaterial.contains(SubTag.MAGICAL))
+ && (!aMaterial.contains(SubTag.NO_SMELTING))) {
+ Logger.MATERIALS(
+ "Generating Electric Butcher Knife from " + MaterialUtils.getMaterialName(aMaterial));
+ // Input 1
- }
+ final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
+ final ItemStack screw = GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L);
- public void materialsLoops() {
- final Materials[] i = Materials.values();
- final int size = i.length;
- Logger.MATERIALS("Materials to attempt tool gen. with: " + size);
- int used = 0;
- Materials aMaterial = null;
- for (int r = 0; r < size; r++) {
- aMaterial = i[r];
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber)
- && (aMaterial != Materials._NULL)) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
- && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT))
- && (!aMaterial.contains(SubTag.FLAMMABLE)) && (!aMaterial.contains(SubTag.MAGICAL))
- && (!aMaterial.contains(SubTag.NO_SMELTING))) {
- Logger.MATERIALS("Generating Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial));
- // Input 1
-
+ if ((null != plate) && screw != null) {
+ addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1));
+ addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1));
+ addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1));
+ used++;
+ } else {
+ Logger.MATERIALS("Unable to generate Electric Butcher Knife from "
+ + MaterialUtils.getMaterialName(aMaterial)
+ + ", Plate or Long Rod may be invalid. Invalid | Plate? " + (plate == null) + " | Rod? "
+ + " |");
+ }
+ // GT_ModHandler.addCraftingRecipe(,
+ // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
+ // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ",
+ // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial),
+ // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
+ // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
+ } else {
+ Logger.MATERIALS("Unable to generate Electric Butcher Knife from "
+ + MaterialUtils.getMaterialName(aMaterial));
+ }
+ } else {
+ Logger.MATERIALS(
+ "Unable to generate Electric Butcher Knife from " + MaterialUtils.getMaterialName(aMaterial));
+ }
+ }
- final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
- final ItemStack screw = GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L);
+ Logger.INFO("Materials used for tool gen: " + used);
+ }
- if ((null != plate) && screw != null) {
- addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1));
- addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1));
- addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1));
- used++;
- } else {
- Logger.MATERIALS("Unable to generate Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial)+", Plate or Long Rod may be invalid. Invalid | Plate? "+(plate == null) +" | Rod? "+" |");
- }
- // GT_ModHandler.addCraftingRecipe(,
- // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
- // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ",
- // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial),
- // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
- // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
- } else {
- Logger.MATERIALS("Unable to generate Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial));
- }
- } else {
- Logger.MATERIALS("Unable to generate Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial));
- }
+ @Override
+ public void run() {
+ Logger.INFO("Generating Electric Butcher Knives for all valid GT Materials.");
+ this.materialsLoops();
+ }
- }
+ public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) {
- Logger.INFO("Materials used for tool gen: " + used);
- }
+ ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
+ MetaGeneratedGregtechTools.ELECTRIC_BUTCHER_KNIFE, 1, aMaterial, Materials.Titanium, new long[] {
+ aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L
+ });
- @Override
- public void run() {
- Logger.INFO("Generating Electric Butcher Knives for all valid GT Materials.");
- this.materialsLoops();
- }
-
- public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) {
-
- ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
- MetaGeneratedGregtechTools.ELECTRIC_BUTCHER_KNIFE,
- 1,
- aMaterial,
- Materials.Titanium,
- new long[]{aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L});
-
- ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
- GT_MetaGenerated_Tool_01.BUTCHERYKNIFE,
- 1,
- aMaterial,
- aMaterial,
- null);
+ ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, aMaterial, aMaterial, null);
- long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack);
- if (aDura <= 32000) {
- Logger.MATERIALS("Unable to generate Electric Butcher Knife from "+MaterialUtils.getMaterialName(aMaterial)+", Durability: "+aDura);
- return false;
- }
-
-
-
- return RecipeUtils.addShapedRecipe(
- OrePrefixes.wireFine.get(Materials.Electrum), aInputCutter, OrePrefixes.wireFine.get(Materials.Electrum),
- OrePrefixes.plate.get(aMaterial), CI.getElectricMotor(aVoltageTier, 1), OrePrefixes.plate.get(aMaterial),
- OrePrefixes.screw.get(aMaterial), aBattery, OrePrefixes.screw.get(aMaterial),
- aOutputStack);
-
- }
+ long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack);
+ if (aDura <= 32000) {
+ Logger.MATERIALS("Unable to generate Electric Butcher Knife from "
+ + MaterialUtils.getMaterialName(aMaterial) + ", Durability: " + aDura);
+ return false;
+ }
-} \ No newline at end of file
+ return RecipeUtils.addShapedRecipe(
+ OrePrefixes.wireFine.get(Materials.Electrum),
+ aInputCutter,
+ OrePrefixes.wireFine.get(Materials.Electrum),
+ OrePrefixes.plate.get(aMaterial),
+ CI.getElectricMotor(aVoltageTier, 1),
+ OrePrefixes.plate.get(aMaterial),
+ OrePrefixes.screw.get(aMaterial),
+ aBattery,
+ OrePrefixes.screw.get(aMaterial),
+ aOutputStack);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java
index 5f6c5a0427..5d6e87b204 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java
@@ -1,4 +1,3 @@
-
package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.GT_Values;
@@ -6,8 +5,6 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SubTag;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_ModHandler.RecipeBits;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.api.objects.Logger;
@@ -22,110 +19,124 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import net.minecraft.item.ItemStack;
public class ProcessingElectricLighter implements Interface_OreRecipeRegistrator, Runnable {
- public ProcessingElectricLighter() {
- GregtechOrePrefixes.toolElectricLighter.add(this);
- }
+ public ProcessingElectricLighter() {
+ GregtechOrePrefixes.toolElectricLighter.add(this);
+ }
+
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
+ if (aMaterial != Materials.Rubber) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))) {}
+ }
+ }
+ }
+
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final GT_Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ // TODO Auto-generated method stub
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
- if (aMaterial != Materials.Rubber) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
- && (!aMaterial.contains(SubTag.NO_SMASHING))) {
-
- }
- }
- }
- }
+ }
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- // TODO Auto-generated method stub
+ public void materialsLoops() {
+ final Materials[] i = Materials.values();
+ final int size = i.length;
+ Logger.MATERIALS("Materials to attempt tool gen. with: " + size);
+ int used = 0;
+ Materials aMaterial = null;
+ for (int r = 0; r < size; r++) {
+ aMaterial = i[r];
+ if ((aMaterial != Materials.Stone)
+ && (aMaterial != Materials.Flint)
+ && (aMaterial != Materials.Rubber)
+ && (aMaterial != Materials._NULL)) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))
+ && (!aMaterial.contains(SubTag.TRANSPARENT))
+ && (!aMaterial.contains(SubTag.FLAMMABLE))
+ && (!aMaterial.contains(SubTag.MAGICAL))
+ && (!aMaterial.contains(SubTag.NO_SMELTING))) {
+ Logger.MATERIALS("Generating Electric Lighter from " + MaterialUtils.getMaterialName(aMaterial));
+ // Input 1
- }
+ final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
- public void materialsLoops() {
- final Materials[] i = Materials.values();
- final int size = i.length;
- Logger.MATERIALS("Materials to attempt tool gen. with: " + size);
- int used = 0;
- Materials aMaterial = null;
- for (int r = 0; r < size; r++) {
- aMaterial = i[r];
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber)
- && (aMaterial != Materials._NULL)) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
- && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT))
- && (!aMaterial.contains(SubTag.FLAMMABLE)) && (!aMaterial.contains(SubTag.MAGICAL))
- && (!aMaterial.contains(SubTag.NO_SMELTING))) {
- Logger.MATERIALS("Generating Electric Lighter from "+MaterialUtils.getMaterialName(aMaterial));
- // Input 1
-
+ if ((null != plate)) {
+ addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1));
+ addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1));
+ addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1));
+ used++;
+ } else {
+ Logger.MATERIALS(
+ "Unable to generate Electric Lighter from " + MaterialUtils.getMaterialName(aMaterial)
+ + ", Plate or Long Rod may be invalid. Invalid | Plate? " + (plate == null)
+ + " | Rod? " + " |");
+ }
+ // GT_ModHandler.addCraftingRecipe(,
+ // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
+ // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ",
+ // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial),
+ // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
+ // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
+ } else {
+ Logger.MATERIALS(
+ "Unable to generate Electric Lighter from " + MaterialUtils.getMaterialName(aMaterial));
+ }
+ } else {
+ Logger.MATERIALS(
+ "Unable to generate Electric Lighter from " + MaterialUtils.getMaterialName(aMaterial));
+ }
+ }
- final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
+ Logger.INFO("Materials used for tool gen: " + used);
+ }
- if ((null != plate)) {
- addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1));
- addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1));
- addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1));
- used++;
- } else {
- Logger.MATERIALS("Unable to generate Electric Lighter from "+MaterialUtils.getMaterialName(aMaterial)+", Plate or Long Rod may be invalid. Invalid | Plate? "+(plate == null) +" | Rod? "+" |");
- }
- // GT_ModHandler.addCraftingRecipe(,
- // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
- // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ",
- // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial),
- // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
- // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
- } else {
- Logger.MATERIALS("Unable to generate Electric Lighter from "+MaterialUtils.getMaterialName(aMaterial));
- }
- } else {
- Logger.MATERIALS("Unable to generate Electric Lighter from "+MaterialUtils.getMaterialName(aMaterial));
- }
+ @Override
+ public void run() {
+ Logger.INFO("Generating Electric Lighters for all valid GT Materials.");
+ this.materialsLoops();
+ }
- }
+ public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) {
- Logger.INFO("Materials used for tool gen: " + used);
- }
+ ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
+ MetaGeneratedGregtechTools.ELECTRIC_LIGHTER, 1, aMaterial, Materials.Titanium, new long[] {
+ aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L
+ });
- @Override
- public void run() {
- Logger.INFO("Generating Electric Lighters for all valid GT Materials.");
- this.materialsLoops();
- }
-
- public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) {
-
- ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
- MetaGeneratedGregtechTools.ELECTRIC_LIGHTER,
- 1,
- aMaterial,
- Materials.Titanium,
- new long[]{aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L});
-
- ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
- GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV,
- 1,
- aMaterial,
- aMaterial,
- null);
+ ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, aMaterial, aMaterial, null);
- long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack);
- if (aDura <= 32000) {
- Logger.MATERIALS("Unable to generate Electric Lighter from "+MaterialUtils.getMaterialName(aMaterial)+", Durability: "+aDura);
- return false;
- }
-
- return RecipeUtils.addShapedRecipe(
- OrePrefixes.wireGt04.get(Materials.Gold), aInputCutter, OrePrefixes.wireGt04.get(Materials.Gold),
- ELEMENT.STANDALONE.RUNITE.getPlate(1), CI.getSensor(aVoltageTier, 1), ELEMENT.STANDALONE.RUNITE.getPlate(1),
- OrePrefixes.plate.get(aMaterial), aBattery, OrePrefixes.plate.get(aMaterial),
- aOutputStack);
-
- }
+ long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack);
+ if (aDura <= 32000) {
+ Logger.MATERIALS("Unable to generate Electric Lighter from " + MaterialUtils.getMaterialName(aMaterial)
+ + ", Durability: " + aDura);
+ return false;
+ }
-} \ No newline at end of file
+ return RecipeUtils.addShapedRecipe(
+ OrePrefixes.wireGt04.get(Materials.Gold),
+ aInputCutter,
+ OrePrefixes.wireGt04.get(Materials.Gold),
+ ELEMENT.STANDALONE.RUNITE.getPlate(1),
+ CI.getSensor(aVoltageTier, 1),
+ ELEMENT.STANDALONE.RUNITE.getPlate(1),
+ OrePrefixes.plate.get(aMaterial),
+ aBattery,
+ OrePrefixes.plate.get(aMaterial),
+ aOutputStack);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java
index dfcb7de4f8..9ea8eaf867 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java
@@ -1,4 +1,3 @@
-
package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.GT_Values;
@@ -6,8 +5,6 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SubTag;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_ModHandler.RecipeBits;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.api.objects.Logger;
@@ -22,109 +19,122 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import net.minecraft.item.ItemStack;
public class ProcessingElectricSnips implements Interface_OreRecipeRegistrator, Runnable {
- public ProcessingElectricSnips() {
- GregtechOrePrefixes.toolElectricSnips.add(this);
- }
+ public ProcessingElectricSnips() {
+ GregtechOrePrefixes.toolElectricSnips.add(this);
+ }
+
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
+ if (aMaterial != Materials.Rubber) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))) {}
+ }
+ }
+ }
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
- if (aMaterial != Materials.Rubber) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
- && (!aMaterial.contains(SubTag.NO_SMASHING))) {
-
- }
- }
- }
- }
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final GT_Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ // TODO Auto-generated method stub
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- // TODO Auto-generated method stub
+ }
- }
+ public void materialsLoops() {
+ final Materials[] i = Materials.values();
+ final int size = i.length;
+ Logger.MATERIALS("Materials to attempt tool gen. with: " + size);
+ int used = 0;
+ Materials aMaterial = null;
+ for (int r = 0; r < size; r++) {
+ aMaterial = i[r];
+ if ((aMaterial != Materials.Stone)
+ && (aMaterial != Materials.Flint)
+ && (aMaterial != Materials.Rubber)
+ && (aMaterial != Materials._NULL)) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))
+ && (!aMaterial.contains(SubTag.TRANSPARENT))
+ && (!aMaterial.contains(SubTag.FLAMMABLE))
+ && (!aMaterial.contains(SubTag.MAGICAL))
+ && (!aMaterial.contains(SubTag.NO_SMELTING))) {
+ Logger.MATERIALS("Generating Electric Snips from " + MaterialUtils.getMaterialName(aMaterial));
+ // Input 1
- public void materialsLoops() {
- final Materials[] i = Materials.values();
- final int size = i.length;
- Logger.MATERIALS("Materials to attempt tool gen. with: " + size);
- int used = 0;
- Materials aMaterial = null;
- for (int r = 0; r < size; r++) {
- aMaterial = i[r];
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber)
- && (aMaterial != Materials._NULL)) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY))
- && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT))
- && (!aMaterial.contains(SubTag.FLAMMABLE)) && (!aMaterial.contains(SubTag.MAGICAL))
- && (!aMaterial.contains(SubTag.NO_SMELTING))) {
- Logger.MATERIALS("Generating Electric Snips from "+MaterialUtils.getMaterialName(aMaterial));
- // Input 1
-
+ final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
- final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
+ if ((null != plate)) {
+ addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1));
+ addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1));
+ addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1));
+ used++;
+ } else {
+ Logger.MATERIALS(
+ "Unable to generate Electric Snips from " + MaterialUtils.getMaterialName(aMaterial)
+ + ", Plate or Long Rod may be invalid. Invalid | Plate? " + (plate == null)
+ + " | Rod? " + " |");
+ }
+ // GT_ModHandler.addCraftingRecipe(,
+ // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
+ // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ",
+ // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial),
+ // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
+ // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
+ } else {
+ Logger.MATERIALS(
+ "Unable to generate Electric Snips from " + MaterialUtils.getMaterialName(aMaterial));
+ }
+ } else {
+ Logger.MATERIALS("Unable to generate Electric Snips from " + MaterialUtils.getMaterialName(aMaterial));
+ }
+ }
- if ((null != plate)) {
- addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1));
- addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1));
- addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1));
- used++;
- } else {
- Logger.MATERIALS("Unable to generate Electric Snips from "+MaterialUtils.getMaterialName(aMaterial)+", Plate or Long Rod may be invalid. Invalid | Plate? "+(plate == null) +" | Rod? "+" |");
- }
- // GT_ModHandler.addCraftingRecipe(,
- // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
- // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ",
- // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial),
- // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
- // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
- } else {
- Logger.MATERIALS("Unable to generate Electric Snips from "+MaterialUtils.getMaterialName(aMaterial));
- }
- } else {
- Logger.MATERIALS("Unable to generate Electric Snips from "+MaterialUtils.getMaterialName(aMaterial));
- }
+ Logger.INFO("Materials used for tool gen: " + used);
+ }
- }
+ @Override
+ public void run() {
+ Logger.INFO("Generating Electric Snips for all valid GT Materials.");
+ this.materialsLoops();
+ }
- Logger.INFO("Materials used for tool gen: " + used);
- }
+ public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) {
- @Override
- public void run() {
- Logger.INFO("Generating Electric Snips for all valid GT Materials.");
- this.materialsLoops();
- }
-
- public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) {
-
- ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
- MetaGeneratedGregtechTools.ELECTRIC_SNIPS,
- 1,
- aMaterial,
- Materials.Titanium,
- new long[]{aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L});
-
- ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
- GT_MetaGenerated_Tool_01.WIRECUTTER,
- 1,
- aMaterial,
- aMaterial,
- null);
+ ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
+ MetaGeneratedGregtechTools.ELECTRIC_SNIPS, 1, aMaterial, Materials.Titanium, new long[] {
+ aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L
+ });
- long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack);
- if (aDura <= 32000) {
- Logger.MATERIALS("Unable to generate Electric Snips from "+MaterialUtils.getMaterialName(aMaterial)+", Durability: "+aDura);
- return false;
- }
- return RecipeUtils.addShapedRecipe(
- OrePrefixes.wireFine.get(Materials.Electrum), aInputCutter, OrePrefixes.wireFine.get(Materials.Electrum),
- ELEMENT.STANDALONE.WHITE_METAL.getGear(1), CI.getElectricMotor(aVoltageTier, 1), ELEMENT.STANDALONE.WHITE_METAL.getGear(1),
- OrePrefixes.plate.get(aMaterial), aBattery, OrePrefixes.plate.get(aMaterial),
- aOutputStack);
-
- }
+ ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(
+ GT_MetaGenerated_Tool_01.WIRECUTTER, 1, aMaterial, aMaterial, null);
-} \ No newline at end of file
+ long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack);
+ if (aDura <= 32000) {
+ Logger.MATERIALS("Unable to generate Electric Snips from " + MaterialUtils.getMaterialName(aMaterial)
+ + ", Durability: " + aDura);
+ return false;
+ }
+ return RecipeUtils.addShapedRecipe(
+ OrePrefixes.wireFine.get(Materials.Electrum),
+ aInputCutter,
+ OrePrefixes.wireFine.get(Materials.Electrum),
+ ELEMENT.STANDALONE.WHITE_METAL.getGear(1),
+ CI.getElectricMotor(aVoltageTier, 1),
+ ELEMENT.STANDALONE.WHITE_METAL.getGear(1),
+ OrePrefixes.plate.get(aMaterial),
+ aBattery,
+ OrePrefixes.plate.get(aMaterial),
+ aOutputStack);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java
index e4858f8cd1..a9011ca3bc 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java
@@ -1,92 +1,122 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.*;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
+import net.minecraft.item.ItemStack;
public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrator, Runnable {
- public ProcessingToolHeadChoocher() {
- GregtechOrePrefixes.toolSkookumChoocher.add(this);
- }
-
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) {
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
- if (aMaterial != Materials.Rubber) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))) {
- GT_ModHandler.addCraftingRecipe(MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(16, 1, aMaterial, aMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial)});
- }
- }
- }
- }
-
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix,
- final GT_Materials aMaterial, final String aOreDictName, final String aModName,
- final ItemStack aStack) {
- // TODO Auto-generated method stub
-
- }
-
- public void materialsLoops(){
- final Materials[] i = Materials.values();
- final int size = i.length;
- Logger.WARNING("Materials to attempt tool gen. with: "+size);
- int used = 0;
- Materials aMaterial = null;
- for (int r=0;r<size;r++){
- aMaterial = i[r];
- if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) && (aMaterial != Materials._NULL)) {
- if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))&& (!aMaterial.contains(SubTag.TRANSPARENT))&& (!aMaterial.contains(SubTag.FLAMMABLE))&& (!aMaterial.contains(SubTag.MAGICAL))&& (!aMaterial.contains(SubTag.NO_SMELTING))) {
- Logger.WARNING("Found "+aMaterial.name()+" as a valid Skookum Choocher Material.");
- //Input 1
- final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
- final ItemStack ingot = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L);
- final ItemStack screw = GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L);
- final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L);
- final ItemStack hammerhead = GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial, 1L);
+ public ProcessingToolHeadChoocher() {
+ GregtechOrePrefixes.toolSkookumChoocher.add(this);
+ }
- if ((null != plate) && (null != ingot) && (null != hammerhead) && (null != longrod) && (null != screw)){
- RecipeUtils.addShapedRecipe(
- hammerhead, ToolDictNames.craftingToolScrewdriver.name(), plate,
- ingot, plate, plate,
- longrod, screw, null,
- MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(MetaGeneratedGregtechTools.SKOOKUM_CHOOCHER, 1, aMaterial, null, null));
- used++;
- }
- else {
- Logger.WARNING(""+aMaterial.name()+" could not be used for all input compoenents. [3x"+aMaterial.name()+" plates, 2x"+aMaterial.name()+" ingots, 1x"+aMaterial.name()+" Hard Hammer Head.");
- }
- //GT_ModHandler.addCraftingRecipe(, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ", Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial), Character.valueOf('P'), OrePrefixes.plate.get(aMaterial), Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
- }
- else {
- Logger.WARNING(""+aMaterial.name()+" was not a valid Skookum Choocher Material.");
- }
- }
- else {
- Logger.WARNING(""+aMaterial.name()+" was not a valid Skookum Choocher Material.");
- }
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
+ if (aMaterial != Materials.Rubber) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))) {
+ GT_ModHandler.addCraftingRecipe(
+ MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(16, 1, aMaterial, aMaterial, null),
+ GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {"IhI", "III", " I ", Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial)
+ });
+ }
+ }
+ }
+ }
+ @Override
+ public void registerOre(
+ final GregtechOrePrefixes aPrefix,
+ final GT_Materials aMaterial,
+ final String aOreDictName,
+ final String aModName,
+ final ItemStack aStack) {
+ // TODO Auto-generated method stub
- }
+ }
- Logger.INFO("Materials used for tool gen: "+used);
- }
+ public void materialsLoops() {
+ final Materials[] i = Materials.values();
+ final int size = i.length;
+ Logger.WARNING("Materials to attempt tool gen. with: " + size);
+ int used = 0;
+ Materials aMaterial = null;
+ for (int r = 0; r < size; r++) {
+ aMaterial = i[r];
+ if ((aMaterial != Materials.Stone)
+ && (aMaterial != Materials.Flint)
+ && (aMaterial != Materials.Rubber)
+ && (aMaterial != Materials._NULL)) {
+ if ((!aMaterial.contains(SubTag.WOOD))
+ && (!aMaterial.contains(SubTag.BOUNCY))
+ && (!aMaterial.contains(SubTag.NO_SMASHING))
+ && (!aMaterial.contains(SubTag.TRANSPARENT))
+ && (!aMaterial.contains(SubTag.FLAMMABLE))
+ && (!aMaterial.contains(SubTag.MAGICAL))
+ && (!aMaterial.contains(SubTag.NO_SMELTING))) {
+ Logger.WARNING("Found " + aMaterial.name() + " as a valid Skookum Choocher Material.");
+ // Input 1
+ final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
+ final ItemStack ingot = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L);
+ final ItemStack screw = GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L);
+ final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L);
+ final ItemStack hammerhead = GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial, 1L);
- @Override
- public void run() {
- Logger.INFO("Generating Skookum Choochers of all GT Materials.");
- this.materialsLoops();
- }
+ if ((null != plate)
+ && (null != ingot)
+ && (null != hammerhead)
+ && (null != longrod)
+ && (null != screw)) {
+ RecipeUtils.addShapedRecipe(
+ hammerhead,
+ ToolDictNames.craftingToolScrewdriver.name(),
+ plate,
+ ingot,
+ plate,
+ plate,
+ longrod,
+ screw,
+ null,
+ MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
+ MetaGeneratedGregtechTools.SKOOKUM_CHOOCHER, 1, aMaterial, null, null));
+ used++;
+ } else {
+ Logger.WARNING("" + aMaterial.name() + " could not be used for all input compoenents. [3x"
+ + aMaterial.name() + " plates, 2x" + aMaterial.name() + " ingots, 1x" + aMaterial.name()
+ + " Hard Hammer Head.");
+ }
+ // GT_ModHandler.addCraftingRecipe(, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
+ // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ", Character.valueOf('I'),
+ // OrePrefixes.ingot.get(aMaterial), Character.valueOf('P'), OrePrefixes.plate.get(aMaterial),
+ // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
+ } else {
+ Logger.WARNING("" + aMaterial.name() + " was not a valid Skookum Choocher Material.");
+ }
+ } else {
+ Logger.WARNING("" + aMaterial.name() + " was not a valid Skookum Choocher Material.");
+ }
+ }
+ Logger.INFO("Materials used for tool gen: " + used);
+ }
-} \ No newline at end of file
+ @Override
+ public void run() {
+ Logger.INFO("Generating Skookum Choochers of all GT Materials.");
+ this.materialsLoops();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java
index ae559db232..e1248c0aae 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java
@@ -4,8 +4,6 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechTextures.ItemIcons.CustomIcon;
public class Processing_Textures_Items {
- public static final CustomIcon itemSkookumChoocher = new CustomIcon("iconsets/SKOOKUMCHOOCHER");
- public static final CustomIcon itemElectricPump = new CustomIcon("iconsets/PUMP");
-
+ public static final CustomIcon itemSkookumChoocher = new CustomIcon("iconsets/SKOOKUMCHOOCHER");
+ public static final CustomIcon itemElectricPump = new CustomIcon("iconsets/PUMP");
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java
index 7754d039cf..c2f0d1e623 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java
@@ -1,66 +1,62 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
-
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashSet;
+import java.util.Set;
public class RecipeGen_AlloySmelter extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
-
- public RecipeGen_AlloySmelter(final Material M){
- this.toGenerate = M;
- mRecipeGenMap.add(this);
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate);
- }
-
- private void generateRecipes(final Material material){
- final int tVoltageMultiplier = material.vVoltageMultiplier;
-
-
-
- //Nuggets
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getNugget(1)))
- GT_Values.RA.addAlloySmelterRecipe(
- material.getIngot(1),
- ItemList.Shape_Mold_Nugget.get(0),
- material.getNugget(9),
- (int) Math.max(material.getMass() * 2L, 1L),
- tVoltageMultiplier);
-
- //Gears
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getGear(1)))
- GT_Values.RA.addAlloySmelterRecipe(
- material.getIngot(8),
- ItemList.Shape_Mold_Gear.get(0),
- material.getGear(1),
- (int) Math.max(material.getMass() * 2L, 1L),
- tVoltageMultiplier);
-
- //Ingot
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getNugget(1)))
- GT_Values.RA.addAlloySmelterRecipe(
- material.getNugget(9),
- ItemList.Shape_Mold_Ingot.get(0),
- material.getIngot(1),
- (int) Math.max(material.getMass() * 2L, 1L),
- tVoltageMultiplier);
-
- }
-
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_AlloySmelter(final Material M) {
+ this.toGenerate = M;
+ mRecipeGenMap.add(this);
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate);
+ }
+
+ private void generateRecipes(final Material material) {
+ final int tVoltageMultiplier = material.vVoltageMultiplier;
+
+ // Nuggets
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1))
+ && ItemUtils.checkForInvalidItems(material.getNugget(1)))
+ GT_Values.RA.addAlloySmelterRecipe(
+ material.getIngot(1),
+ ItemList.Shape_Mold_Nugget.get(0),
+ material.getNugget(9),
+ (int) Math.max(material.getMass() * 2L, 1L),
+ tVoltageMultiplier);
+
+ // Gears
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getGear(1)))
+ GT_Values.RA.addAlloySmelterRecipe(
+ material.getIngot(8),
+ ItemList.Shape_Mold_Gear.get(0),
+ material.getGear(1),
+ (int) Math.max(material.getMass() * 2L, 1L),
+ tVoltageMultiplier);
+
+ // Ingot
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1))
+ && ItemUtils.checkForInvalidItems(material.getNugget(1)))
+ GT_Values.RA.addAlloySmelterRecipe(
+ material.getNugget(9),
+ ItemList.Shape_Mold_Ingot.get(0),
+ material.getIngot(1),
+ (int) Math.max(material.getMass() * 2L, 1L),
+ tVoltageMultiplier);
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java
index d7244919d8..90195a15e8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java
@@ -1,81 +1,62 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.GT_Values;
-
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashSet;
+import java.util.Set;
+import net.minecraft.item.ItemStack;
public class RecipeGen_Assembler extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
-
- public RecipeGen_Assembler(final Material M){
- this.toGenerate = M;
- mRecipeGenMap.add(this);
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate);
- }
-
- private void generateRecipes(final Material material){
-
- //Frame Box
- if (ItemUtils.checkForInvalidItems(new ItemStack[] {material.getRod(1), material.getFrameBox(1)}))
- GT_Values.RA.addAssemblerRecipe(
- material.getRod(4),
- ItemUtils.getGregtechCircuit(4),
- material.getFrameBox(1),
- 60,
- material.vVoltageMultiplier);
-
- //Rotor
- if (ItemUtils.checkForInvalidItems(new ItemStack[] {material.getPlate(1), material.getRing(1), material.getRotor(1)}))
- addAssemblerRecipe(
- material.getPlate(4),
- material.getRing(1),
- material.getRotor(1),
- 240,
- material.vVoltageMultiplier);
-
- }
-
- private static void addAssemblerRecipe(final ItemStack input1, final ItemStack input2, final ItemStack output1, final int seconds, final int euCost){
- GT_Values.RA.addAssemblerRecipe(
- input1,
- input2,
- FluidUtils.getFluidStack("molten.solderingalloy", 16),
- output1,
- seconds,
- euCost);
- GT_Values.RA.addAssemblerRecipe(
- input1,
- input2,
- FluidUtils.getFluidStack("molten.tin", 32),
- output1,
- seconds,
- euCost);
- GT_Values.RA.addAssemblerRecipe(
- input1,
- input2,
- FluidUtils.getFluidStack("molten.lead", 48),
- output1,
- seconds,
- euCost);
- }
-
-
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_Assembler(final Material M) {
+ this.toGenerate = M;
+ mRecipeGenMap.add(this);
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate);
+ }
+
+ private void generateRecipes(final Material material) {
+
+ // Frame Box
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {material.getRod(1), material.getFrameBox(1)}))
+ GT_Values.RA.addAssemblerRecipe(
+ material.getRod(4),
+ ItemUtils.getGregtechCircuit(4),
+ material.getFrameBox(1),
+ 60,
+ material.vVoltageMultiplier);
+
+ // Rotor
+ if (ItemUtils.checkForInvalidItems(
+ new ItemStack[] {material.getPlate(1), material.getRing(1), material.getRotor(1)}))
+ addAssemblerRecipe(
+ material.getPlate(4), material.getRing(1), material.getRotor(1), 240, material.vVoltageMultiplier);
+ }
+
+ private static void addAssemblerRecipe(
+ final ItemStack input1,
+ final ItemStack input2,
+ final ItemStack output1,
+ final int seconds,
+ final int euCost) {
+ GT_Values.RA.addAssemblerRecipe(
+ input1, input2, FluidUtils.getFluidStack("molten.solderingalloy", 16), output1, seconds, euCost);
+ GT_Values.RA.addAssemblerRecipe(
+ input1, input2, FluidUtils.getFluidStack("molten.tin", 32), output1, seconds, euCost);
+ GT_Values.RA.addAssemblerRecipe(
+ input1, input2, FluidUtils.getFluidStack("molten.lead", 48), output1, seconds, euCost);
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Base.java
index 7e9153679f..d000889757 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Base.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Base.java
@@ -3,14 +3,13 @@ package gtPlusPlus.xmod.gregtech.loaders;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.core.material.Material;
-public abstract class RecipeGen_Base implements RunnableWithInfo<Material>{
+public abstract class RecipeGen_Base implements RunnableWithInfo<Material> {
- protected Material toGenerate;
- protected boolean disableOptional;
-
- @Override
- public Material getInfoData() {
- return toGenerate;
- }
+ protected Material toGenerate;
+ protected boolean disableOptional;
+ @Override
+ public Material getInfoData() {
+ return toGenerate;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
index c8219155d2..b6b8a3f7ac 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
@@ -1,9 +1,5 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
@@ -19,262 +15,292 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeGen_BlastSmelter extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_BlastSmelter(final Material M) {
+ this.toGenerate = M;
+ mRecipeGenMap.add(this);
+ }
+
+ @Override
+ public void run() {
+ generateARecipe(this.toGenerate);
+ }
- public RecipeGen_BlastSmelter(final Material M){
- this.toGenerate = M;
- mRecipeGenMap.add(this);
- }
+ private void generateARecipe(final Material M) {
- @Override
- public void run() {
- generateARecipe(this.toGenerate);
- }
+ // Add a Blast Smelting Recipe, Let's go!
+ ItemStack tStack;
+ if (null != (tStack = M.getDust(1))) {
- private void generateARecipe(final Material M){
+ final Material[] badMaterials = {
+ FLUORIDES.THORIUM_HEXAFLUORIDE,
+ FLUORIDES.THORIUM_TETRAFLUORIDE,
+ ALLOY.BLOODSTEEL,
+ NUCLIDE.LiFBeF2ThF4UF4,
+ NUCLIDE.LiFBeF2ZrF4UF4,
+ NUCLIDE.LiFBeF2ZrF4U235
+ };
+ for (final Material R : badMaterials) {
+ if (M == R) {
+ return;
+ }
+ }
- //Add a Blast Smelting Recipe, Let's go!
- ItemStack tStack;
- if (null != (tStack = M.getDust(1))) {
+ // Prepare some Variables
+ ItemStack[] components;
+ ArrayList<MaterialStack> tMaterial = new ArrayList<>();
+ int inputStackCount = 0;
+ int fluidAmount = 0;
+ final boolean doTest = true;
+ tMaterial = M.getComposites();
- final Material[] badMaterials = {
- FLUORIDES.THORIUM_HEXAFLUORIDE,
- FLUORIDES.THORIUM_TETRAFLUORIDE,
- ALLOY.BLOODSTEEL,
- NUCLIDE.LiFBeF2ThF4UF4,
- NUCLIDE.LiFBeF2ZrF4UF4,
- NUCLIDE.LiFBeF2ZrF4U235
- };
- for (final Material R : badMaterials){
- if (M == R){
- return;
- }
- }
+ // This Bad boy here is what dictates unique recipes. Fuck life, right?
+ ItemStack circuitGT = ItemUtils.getGregtechCircuit(0);
- //Prepare some Variables
- ItemStack[] components;
- ArrayList<MaterialStack> tMaterial = new ArrayList<>();
- int inputStackCount=0;
- int fluidAmount=0;
- final boolean doTest = true;
- tMaterial = M.getComposites();
+ // Set a duration - OLD
+ /*int duration = 0;
+ if (M.getMeltingPointK() > 150){
+ duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPointK();
+ }
+ else {
+ duration = (int) Math.max(M.getMass() / 50L, 1L) * 150;
+ }*/
- //This Bad boy here is what dictates unique recipes. Fuck life, right?
- ItemStack circuitGT = ItemUtils.getGregtechCircuit(0);
+ long aVoltage = MaterialUtils.getVoltageForTier(M.vTier);
+ // Set a duration - NEW
+ int duration = 120 * M.vTier * 10;
- //Set a duration - OLD
- /*int duration = 0;
- if (M.getMeltingPointK() > 150){
- duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPointK();
- }
- else {
- duration = (int) Math.max(M.getMass() / 50L, 1L) * 150;
- }*/
-
- long aVoltage = MaterialUtils.getVoltageForTier(M.vTier);
-
-
- //Set a duration - NEW
- int duration = 120*M.vTier*10;
+ if (M.vTier <= 4) {
+ duration = 20 * M.vTier * 10;
+ }
- if (M.vTier <= 4){
- duration = 20*M.vTier*10;
- }
+ int mMaterialListSize = 0;
- int mMaterialListSize=0;
-
- int mTotalPartsCounter = M.smallestStackSizeWhenProcessing;
-
- if (M.getComposites() != null){
- for (final gtPlusPlus.core.material.MaterialStack ternkfsdf : M.getComposites()){
- if (ternkfsdf != null) {
- mMaterialListSize++;
- //mTotalPartsCounter += ternkfsdf.getSmallestStackSizes()[0];
- }
- }
- }
- else {
- mMaterialListSize = 1;
- }
+ int mTotalPartsCounter = M.smallestStackSizeWhenProcessing;
- if (duration <= 0){
- final int second = 20;
- duration = 14*second*mMaterialListSize*8;
- }
+ if (M.getComposites() != null) {
+ for (final gtPlusPlus.core.material.MaterialStack ternkfsdf : M.getComposites()) {
+ if (ternkfsdf != null) {
+ mMaterialListSize++;
+ // mTotalPartsCounter += ternkfsdf.getSmallestStackSizes()[0];
+ }
+ }
+ } else {
+ mMaterialListSize = 1;
+ }
- Logger.WARNING("[BAS] Size: "+mMaterialListSize);
+ if (duration <= 0) {
+ final int second = 20;
+ duration = 14 * second * mMaterialListSize * 8;
+ }
+ Logger.WARNING("[BAS] Size: " + mMaterialListSize);
- //Make a simple one Material Materialstack[] and log it for validity.
- circuitGT = ItemUtils.getGregtechCircuit(1);
- final ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, tStack};
- inputStackCount = 1;
- fluidAmount = 144*inputStackCount;
- Logger.WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+". Gives "+fluidAmount+"L of molten metal.");
- for (int das=0;das<tItemStackTest.length;das++){
- if (tItemStackTest[das] != null) {
- Logger.WARNING("[BAS] tMaterial["+das+"]: "+tItemStackTest[das].getDisplayName()+" Meta: "+tItemStackTest[das].getItemDamage()+", Amount: "+tItemStackTest[das].stackSize);
- }
- }
+ // Make a simple one Material Materialstack[] and log it for validity.
+ circuitGT = ItemUtils.getGregtechCircuit(1);
+ final ItemStack[] tItemStackTest = new ItemStack[] {circuitGT, tStack};
+ inputStackCount = 1;
+ fluidAmount = 144 * inputStackCount;
+ Logger.WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for " + M.getLocalizedName() + ". Gives "
+ + fluidAmount + "L of molten metal.");
+ for (int das = 0; das < tItemStackTest.length; das++) {
+ if (tItemStackTest[das] != null) {
+ Logger.WARNING("[BAS] tMaterial[" + das + "]: " + tItemStackTest[das].getDisplayName() + " Meta: "
+ + tItemStackTest[das].getItemDamage() + ", Amount: " + tItemStackTest[das].stackSize);
+ }
+ }
- final boolean hasMoreInputThanACircuit = (tItemStackTest.length > 1);
+ final boolean hasMoreInputThanACircuit = (tItemStackTest.length > 1);
- //Generate Recipes for all singular materials that can be made molten.
- if (hasMoreInputThanACircuit){
- if (M.requiresBlastFurnace()) {
- if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluidStack(fluidAmount), 100, (duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)), (int) aVoltage)){
- Logger.WARNING("[BAS] Success.");
- Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe.");
- /*if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration, 120)){
- Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
- }
- if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/9, 120)){
- Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
- }*/
- /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/4, 120)){
- Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
- }
- if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/9, 120)){
- Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
- }*/
- }
- }
- else {
- Logger.WARNING("[BAS] Failed.");
- }
- }
- else {
- if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluidStack(fluidAmount), 100, duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)/2, (int) aVoltage)){
- Logger.WARNING("[BAS] Success.");
- if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluidStack(144), M.getIngot(1), duration/2, 60)){
- Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe.");
- /*if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration/2, 60)){
- Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
- }
- if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/2/9, 60)){
- Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
- }*/
- /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/2/4, 60)){
- Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
- }
- if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/2/9, 60)){
- Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
- }*/
- }
- }
- else {
- Logger.WARNING("[BAS] Failed.");
- }
- }
+ // Generate Recipes for all singular materials that can be made molten.
+ if (hasMoreInputThanACircuit) {
+ if (M.requiresBlastFurnace()) {
+ if (CORE.RA.addBlastSmelterRecipe(
+ tItemStackTest,
+ M.getFluidStack(fluidAmount),
+ 100,
+ (duration / (mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)),
+ (int) aVoltage)) {
+ Logger.WARNING("[BAS] Success.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe.");
+ /*if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration, 120)){
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ }
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/9, 120)){
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ }*/
+ /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/4, 120)){
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ }
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/9, 120)){
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ }*/
+ }
+ } else {
+ Logger.WARNING("[BAS] Failed.");
+ }
+ } else {
+ if (CORE.RA.addBlastSmelterRecipe(
+ tItemStackTest,
+ M.getFluidStack(fluidAmount),
+ 100,
+ duration / (mTotalPartsCounter > 0 ? mTotalPartsCounter : 1) / 2,
+ (int) aVoltage)) {
+ Logger.WARNING("[BAS] Success.");
+ if (GT_Values.RA.addFluidSolidifierRecipe(
+ ItemList.Shape_Mold_Ingot.get(0), M.getFluidStack(144), M.getIngot(1), duration / 2, 60)) {
+ Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe.");
+ /*if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration/2, 60)){
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ }
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/2/9, 60)){
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ }*/
+ /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/2/4, 60)){
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ }
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/2/9, 60)){
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ }*/
+ }
+ } else {
+ Logger.WARNING("[BAS] Failed.");
+ }
+ }
- if (tMaterial != null){
- //Reset the Variables for compounds if last recipe was a success.
- inputStackCount=0;
-
- //If this Material has some kind of compound list, proceed
- if (mMaterialListSize > 1){
- final gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize];
- circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize);
- //Just double checking
- if (tempStack.length > 1){
+ if (tMaterial != null) {
+ // Reset the Variables for compounds if last recipe was a success.
+ inputStackCount = 0;
- //Builds me a MaterialStack[] from the MaterialList of M.
- int ooo=0;
- for (final gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()){
- if (xMaterial != null){
- if (xMaterial.getStackMaterial() != null){
- Logger.WARNING("[BAS] FOUND: "+xMaterial.getStackMaterial().getLocalizedName());
- Logger.WARNING("[BAS] ADDING: "+xMaterial.getStackMaterial().getLocalizedName());
- }
- tempStack[ooo] = xMaterial;
- }
- ooo++;
- }
+ // If this Material has some kind of compound list, proceed
+ if (mMaterialListSize > 1) {
+ final gtPlusPlus.core.material.MaterialStack[] tempStack =
+ new gtPlusPlus.core.material.MaterialStack[mMaterialListSize];
+ circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize);
+ // Just double checking
+ if (tempStack.length > 1) {
- //Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for the 144L fluid multiplier
- components = new ItemStack[9];
- inputStackCount=0;
- FluidStack componentsFluid = null;
- for (int irc=0;irc<M.getComposites().size();irc++){
- if (M.getComposites().get(irc) != null){
- final int r = (int) M.vSmallestRatio[irc];
- inputStackCount = inputStackCount+r;
- if ((M.getComposites().get(irc).getStackMaterial().getState() != MaterialState.SOLID) || !ItemUtils.checkForInvalidItems(M.getComposites().get(irc).getDustStack(r))){
- final int xr = r;
- if ((xr > 0) && (xr <= 100)){
- final int mathmatics = (r*1000);
- componentsFluid = FluidUtils.getFluidStack(M.getComposites().get(irc).getStackMaterial().getFluidStack(mathmatics), mathmatics);
- }
- }
- else {
- components[irc] = M.getComposites().get(irc).getUnificatedDustStack(r);
- }
- }
- }
+ // Builds me a MaterialStack[] from the MaterialList of M.
+ int ooo = 0;
+ for (final gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()) {
+ if (xMaterial != null) {
+ if (xMaterial.getStackMaterial() != null) {
+ Logger.WARNING("[BAS] FOUND: "
+ + xMaterial.getStackMaterial().getLocalizedName());
+ Logger.WARNING("[BAS] ADDING: "
+ + xMaterial.getStackMaterial().getLocalizedName());
+ }
+ tempStack[ooo] = xMaterial;
+ }
+ ooo++;
+ }
+ // Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for
+ // the 144L fluid multiplier
+ components = new ItemStack[9];
+ inputStackCount = 0;
+ FluidStack componentsFluid = null;
+ for (int irc = 0; irc < M.getComposites().size(); irc++) {
+ if (M.getComposites().get(irc) != null) {
+ final int r = (int) M.vSmallestRatio[irc];
+ inputStackCount = inputStackCount + r;
+ if ((M.getComposites()
+ .get(irc)
+ .getStackMaterial()
+ .getState()
+ != MaterialState.SOLID)
+ || !ItemUtils.checkForInvalidItems(
+ M.getComposites().get(irc).getDustStack(r))) {
+ final int xr = r;
+ if ((xr > 0) && (xr <= 100)) {
+ final int mathmatics = (r * 1000);
+ componentsFluid = FluidUtils.getFluidStack(
+ M.getComposites()
+ .get(irc)
+ .getStackMaterial()
+ .getFluidStack(mathmatics),
+ mathmatics);
+ }
+ } else {
+ components[irc] = M.getComposites().get(irc).getUnificatedDustStack(r);
+ }
+ }
+ }
- //Adds a circuit
- if ((mMaterialListSize < 9) && (mMaterialListSize != 0)){
- final ItemStack[] components_NoCircuit = components;
- //Builds me an ItemStack[] of the materials. - With a circuit
- components = new ItemStack[components_NoCircuit.length+1];
- for (int fr=0;fr<components.length;fr++){
- if (fr==0){
- components[0] = circuitGT;
- }
- else {
- components[fr] = components_NoCircuit[fr-1];
- }
- }
- Logger.WARNING("[BAS] Should have added a circuit. mMaterialListSize: "+mMaterialListSize+" | circuit: "+components[0].getDisplayName());
- }
- else {
- Logger.WARNING("[BAS] Did not add a circuit. mMaterialListSize: "+mMaterialListSize);
- }
+ // Adds a circuit
+ if ((mMaterialListSize < 9) && (mMaterialListSize != 0)) {
+ final ItemStack[] components_NoCircuit = components;
+ // Builds me an ItemStack[] of the materials. - With a circuit
+ components = new ItemStack[components_NoCircuit.length + 1];
+ for (int fr = 0; fr < components.length; fr++) {
+ if (fr == 0) {
+ components[0] = circuitGT;
+ } else {
+ components[fr] = components_NoCircuit[fr - 1];
+ }
+ }
+ Logger.WARNING("[BAS] Should have added a circuit. mMaterialListSize: " + mMaterialListSize
+ + " | circuit: " + components[0].getDisplayName());
+ } else {
+ Logger.WARNING("[BAS] Did not add a circuit. mMaterialListSize: " + mMaterialListSize);
+ }
- //Set Fluid output
- fluidAmount = 144*inputStackCount;
+ // Set Fluid output
+ fluidAmount = 144 * inputStackCount;
- Logger.WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+" using it's compound dusts. This material has "+ inputStackCount+" parts. Gives "+fluidAmount+"L of molten metal.");
- Logger.WARNING("[BAS] tMaterial.length: "+components.length+".");
- for (int das=0;das<components.length;das++){
- if (components[das] != null) {
- Logger.WARNING("[BAS] tMaterial["+das+"]: "+components[das].getDisplayName()+" Meta: "+components[das].getItemDamage()+", Amount: "+components[das].stackSize);
- }
- }
+ Logger.WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for " + M.getLocalizedName()
+ + " using it's compound dusts. This material has " + inputStackCount + " parts. Gives "
+ + fluidAmount + "L of molten metal.");
+ Logger.WARNING("[BAS] tMaterial.length: " + components.length + ".");
+ for (int das = 0; das < components.length; das++) {
+ if (components[das] != null) {
+ Logger.WARNING("[BAS] tMaterial[" + das + "]: " + components[das].getDisplayName()
+ + " Meta: " + components[das].getItemDamage() + ", Amount: "
+ + components[das].stackSize);
+ }
+ }
- //Adds Recipe
- if (M.requiresBlastFurnace()) {
- if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluidStack(fluidAmount), 100, duration, (int) aVoltage)){
- Logger.WARNING("[BAS] Success.");
- }
- else {
- Logger.WARNING("[BAS] Failed.");
- }
- }
- else {
- if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluidStack(fluidAmount), 100, duration, (int) aVoltage/2)){
- Logger.WARNING("[BAS] Success.");
- }
- else {
- Logger.WARNING("[BAS] Failed.");
- }
- }
- }
- }
- }
- else {
- Logger.WARNING("[BAS] doTest: "+doTest+" | tMaterial != null: "+(tMaterial != null));
- }
- }
- }
+ // Adds Recipe
+ if (M.requiresBlastFurnace()) {
+ if (CORE.RA.addBlastSmelterRecipe(
+ components, componentsFluid, M.getFluidStack(fluidAmount), 100, duration, (int)
+ aVoltage)) {
+ Logger.WARNING("[BAS] Success.");
+ } else {
+ Logger.WARNING("[BAS] Failed.");
+ }
+ } else {
+ if (CORE.RA.addBlastSmelterRecipe(
+ components,
+ componentsFluid,
+ M.getFluidStack(fluidAmount),
+ 100,
+ duration,
+ (int) aVoltage / 2)) {
+ Logger.WARNING("[BAS] Success.");
+ } else {
+ Logger.WARNING("[BAS] Failed.");
+ }
+ }
+ }
+ }
+ } else {
+ Logger.WARNING("[BAS] doTest: " + doTest + " | tMaterial != null: " + (tMaterial != null));
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java
index 141e75c8b5..2e47eaf807 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java
@@ -1,153 +1,228 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SubTag;
import gregtech.api.interfaces.IOreRecipeRegistrator;
-import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator {
- private final OrePrefixes[] mSmeltingPrefixes = {
- OrePrefixes.crushed,
- OrePrefixes.ingot,
- OrePrefixes.crushedPurified,
- OrePrefixes.crushedCentrifuged,
- OrePrefixes.dust,
- OrePrefixes.dustPure,
- OrePrefixes.dustImpure,
- OrePrefixes.dustRefined,
- OrePrefixes.dustSmall,
- OrePrefixes.dustTiny
- };
-
- public RecipeGen_BlastSmelterGT_Ex() {
- for (OrePrefixes tPrefix : this.mSmeltingPrefixes) tPrefix.add(this);
- }
-
- @Override
- public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
-
- boolean keepHighTempRecipes = !CORE.GTNH;
-
- switch (aPrefix) {
- case dust:
- ItemStack tDustStack;
- if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600){
- if ((null != (tDustStack = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L))) && (!aMaterial.contains(SubTag.NO_SMELTING))) {
- if (aMaterial.mBlastFurnaceRequired) {
- addBlastRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, null, null, aMaterial.mBlastFurnaceTemp > 1750 ? GT_OreDictUnificator.get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L) : GT_Utility.copyAmount(1L, new Object[]{tDustStack}), null, (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp, 120, aMaterial);
- if (aMaterial.mBlastFurnaceTemp <= 1000) {
- //GT_ModHandler.addRCBlastFurnaceRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_Utility.copyAmount(1L, new Object[]{tDustStack}), aMaterial.mBlastFurnaceTemp);
- }
- }
- }
- }
- case ingot:
- if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600){
- if ((null != (tDustStack = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L))) && (!aMaterial.contains(SubTag.NO_SMELTING))) {
- if (aMaterial.mBlastFurnaceRequired) {
- addBlastRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, null, null, aMaterial.mBlastFurnaceTemp > 1750 ? GT_OreDictUnificator.get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L) : GT_Utility.copyAmount(1L, new Object[]{tDustStack}), null, (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp, 120, aMaterial);
- }
- }
- }
- break;
- case dustSmall:
- if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600){
- if (aMaterial.mBlastFurnaceRequired) {
- addBlastRecipe(GT_Utility.copyAmount(4L, new Object[]{aStack}), null, null, null, aMaterial.mBlastFurnaceTemp > 1750 ? GT_OreDictUnificator.get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), 1L) : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), null, (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp, 120, aMaterial);
- }
- }
- break;
- case dustTiny:
- if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600){
- if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_SMELTING)) {
- if (aMaterial.mBlastFurnaceRequired) {
- addBlastRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), null, null, null, aMaterial.mBlastFurnaceTemp > 1750 ? GT_OreDictUnificator.get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), 1L) : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), null, (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp, 120, aMaterial);
-
- }
- }
- }
- break;
- default:
- if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600){
- if (!aMaterial.contains(SubTag.NO_SMELTING)) {
- if ((aMaterial.mBlastFurnaceRequired) || (aMaterial.mDirectSmelting.mBlastFurnaceRequired)) {
- addBlastRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, null, null, aMaterial.mBlastFurnaceTemp > 1750 ? GT_OreDictUnificator.get(OrePrefixes.ingotHot, aMaterial, GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), 1L) : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L) * aMaterial.mBlastFurnaceTemp, 120, aMaterial);
- //if (aMaterial.mBlastFurnaceTemp <= 1000)
- //GT_ModHandler.addRCBlastFurnaceRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), aMaterial.mBlastFurnaceTemp * 2);
- }
- }
- }
- break;
- }
- }
-
- public boolean addBlastRecipe(ItemStack input1, ItemStack input2,
- FluidStack fluid1, FluidStack fluid2, ItemStack output1,
- ItemStack output2, int time, int euCost, Materials smeltInto) {
-
- //Set up variables.
- ItemStack[] components;
- int count = 0;
-
- if (smeltInto == Materials._NULL){
- //If the material is null then we probably don't want to try.
- return false;
- }
- if (input1 != null && input2 != null){
- count = 2;
- }
- else if (input1 == null && input2 == null){
- //If both inputs are null, then we don't want to try.
- return false;
- }
- else {
- count = 1;
- }
- //Set up input components.
- ItemStack configCircuit = ItemUtils.getGregtechCircuit(count);
- components = new ItemStack[]{configCircuit, input1, input2};
- if (fluid1 != null || fluid2 != null){
- //If it uses an input fluid, we cannot handle this. So let's not try. (Annealed copper for example)
- //return false;
- if (fluid1 != null && fluid2 != null){
- //Cannot handle two input fluids
- return false;
- }
-
- FluidStack mInputfluidstack;
- mInputfluidstack = (fluid1 != null) ? fluid1 : fluid2;
-
- //Try with new handler
- //Add Blast Smelter Recipe.
- return CORE.RA.addBlastSmelterRecipe(
- components,
- mInputfluidstack,
- smeltInto.mSmeltInto.getMolten(144L),
- 100,
- MathUtils.roundToClosestInt(time*0.8),
- euCost); // EU Cost
-
- }
-
- //Add Blast Smelter Recipe.
- return CORE.RA.addBlastSmelterRecipe(
- components,
- smeltInto.mSmeltInto.getMolten(144L),
- 100,
- MathUtils.roundToClosestInt(time*0.8),
- euCost); // EU Cost
-
- }
-
-} \ No newline at end of file
+ private final OrePrefixes[] mSmeltingPrefixes = {
+ OrePrefixes.crushed,
+ OrePrefixes.ingot,
+ OrePrefixes.crushedPurified,
+ OrePrefixes.crushedCentrifuged,
+ OrePrefixes.dust,
+ OrePrefixes.dustPure,
+ OrePrefixes.dustImpure,
+ OrePrefixes.dustRefined,
+ OrePrefixes.dustSmall,
+ OrePrefixes.dustTiny
+ };
+
+ public RecipeGen_BlastSmelterGT_Ex() {
+ for (OrePrefixes tPrefix : this.mSmeltingPrefixes) tPrefix.add(this);
+ }
+
+ @Override
+ public void registerOre(
+ OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+
+ boolean keepHighTempRecipes = !CORE.GTNH;
+
+ switch (aPrefix) {
+ case dust:
+ ItemStack tDustStack;
+ if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600) {
+ if ((null != (tDustStack = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L)))
+ && (!aMaterial.contains(SubTag.NO_SMELTING))) {
+ if (aMaterial.mBlastFurnaceRequired) {
+ addBlastRecipe(
+ GT_Utility.copyAmount(1L, new Object[] {aStack}),
+ null,
+ null,
+ null,
+ aMaterial.mBlastFurnaceTemp > 1750
+ ? GT_OreDictUnificator.get(
+ OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L)
+ : GT_Utility.copyAmount(1L, new Object[] {tDustStack}),
+ null,
+ (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp,
+ 120,
+ aMaterial);
+ if (aMaterial.mBlastFurnaceTemp <= 1000) {
+ // GT_ModHandler.addRCBlastFurnaceRecipe(GT_Utility.copyAmount(1L, new
+ // Object[]{aStack}), GT_Utility.copyAmount(1L, new Object[]{tDustStack}),
+ // aMaterial.mBlastFurnaceTemp);
+ }
+ }
+ }
+ }
+ case ingot:
+ if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600) {
+ if ((null != (tDustStack = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L)))
+ && (!aMaterial.contains(SubTag.NO_SMELTING))) {
+ if (aMaterial.mBlastFurnaceRequired) {
+ addBlastRecipe(
+ GT_Utility.copyAmount(1L, new Object[] {aStack}),
+ null,
+ null,
+ null,
+ aMaterial.mBlastFurnaceTemp > 1750
+ ? GT_OreDictUnificator.get(
+ OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L)
+ : GT_Utility.copyAmount(1L, new Object[] {tDustStack}),
+ null,
+ (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp,
+ 120,
+ aMaterial);
+ }
+ }
+ }
+ break;
+ case dustSmall:
+ if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600) {
+ if (aMaterial.mBlastFurnaceRequired) {
+ addBlastRecipe(
+ GT_Utility.copyAmount(4L, new Object[] {aStack}),
+ null,
+ null,
+ null,
+ aMaterial.mBlastFurnaceTemp > 1750
+ ? GT_OreDictUnificator.get(
+ OrePrefixes.ingotHot,
+ aMaterial.mSmeltInto,
+ GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L),
+ 1L)
+ : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L),
+ null,
+ (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp,
+ 120,
+ aMaterial);
+ }
+ }
+ break;
+ case dustTiny:
+ if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600) {
+ if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_SMELTING)) {
+ if (aMaterial.mBlastFurnaceRequired) {
+ addBlastRecipe(
+ GT_Utility.copyAmount(9L, new Object[] {aStack}),
+ null,
+ null,
+ null,
+ aMaterial.mBlastFurnaceTemp > 1750
+ ? GT_OreDictUnificator.get(
+ OrePrefixes.ingotHot,
+ aMaterial.mSmeltInto,
+ GT_OreDictUnificator.get(
+ OrePrefixes.ingot, aMaterial.mSmeltInto, 1L),
+ 1L)
+ : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L),
+ null,
+ (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp,
+ 120,
+ aMaterial);
+ }
+ }
+ }
+ break;
+ default:
+ if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600) {
+ if (!aMaterial.contains(SubTag.NO_SMELTING)) {
+ if ((aMaterial.mBlastFurnaceRequired) || (aMaterial.mDirectSmelting.mBlastFurnaceRequired)) {
+ addBlastRecipe(
+ GT_Utility.copyAmount(1L, new Object[] {aStack}),
+ null,
+ null,
+ null,
+ aMaterial.mBlastFurnaceTemp > 1750
+ ? GT_OreDictUnificator.get(
+ OrePrefixes.ingotHot,
+ aMaterial,
+ GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L),
+ 1L)
+ : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L),
+ null,
+ (int) Math.max(aMaterial.getMass() / 4L, 1L) * aMaterial.mBlastFurnaceTemp,
+ 120,
+ aMaterial);
+ // if (aMaterial.mBlastFurnaceTemp <= 1000)
+ // GT_ModHandler.addRCBlastFurnaceRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}),
+ // GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), aMaterial.mBlastFurnaceTemp *
+ // 2);
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ public boolean addBlastRecipe(
+ ItemStack input1,
+ ItemStack input2,
+ FluidStack fluid1,
+ FluidStack fluid2,
+ ItemStack output1,
+ ItemStack output2,
+ int time,
+ int euCost,
+ Materials smeltInto) {
+
+ // Set up variables.
+ ItemStack[] components;
+ int count = 0;
+
+ if (smeltInto == Materials._NULL) {
+ // If the material is null then we probably don't want to try.
+ return false;
+ }
+ if (input1 != null && input2 != null) {
+ count = 2;
+ } else if (input1 == null && input2 == null) {
+ // If both inputs are null, then we don't want to try.
+ return false;
+ } else {
+ count = 1;
+ }
+ // Set up input components.
+ ItemStack configCircuit = ItemUtils.getGregtechCircuit(count);
+ components = new ItemStack[] {configCircuit, input1, input2};
+ if (fluid1 != null || fluid2 != null) {
+ // If it uses an input fluid, we cannot handle this. So let's not try. (Annealed copper for example)
+ // return false;
+ if (fluid1 != null && fluid2 != null) {
+ // Cannot handle two input fluids
+ return false;
+ }
+
+ FluidStack mInputfluidstack;
+ mInputfluidstack = (fluid1 != null) ? fluid1 : fluid2;
+
+ // Try with new handler
+ // Add Blast Smelter Recipe.
+ return CORE.RA.addBlastSmelterRecipe(
+ components,
+ mInputfluidstack,
+ smeltInto.mSmeltInto.getMolten(144L),
+ 100,
+ MathUtils.roundToClosestInt(time * 0.8),
+ euCost); // EU Cost
+ }
+
+ // Add Blast Smelter Recipe.
+ return CORE.RA.addBlastSmelterRecipe(
+ components,
+ smeltInto.mSmeltInto.getMolten(144L),
+ 100,
+ MathUtils.roundToClosestInt(time * 0.8),
+ euCost); // EU Cost
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java
index 3ea1eeef62..f9e083a44a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java
@@ -1,7 +1,6 @@
package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.util.*;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.ItemStackData;
import gtPlusPlus.core.lib.CORE;
@@ -9,234 +8,248 @@ import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.oredict.OreDictionary;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
public class RecipeGen_BlastSmelterGT_GTNH {
- private static Map<String, FluidStack> mCachedIngotToFluidRegistry = new HashMap<String, FluidStack>();
- private static Map<String, String> mCachedHotToColdRegistry = new HashMap<String, String>();
-
- private synchronized static void setIngotToFluid(final ItemStackData stack, final FluidStack fluid) {
- if (stack != null && fluid != null) {
- mCachedIngotToFluidRegistry.put(stack.getUniqueDataIdentifier(), fluid);
- }
- }
-
- private synchronized static void setHotToCold(final ItemStackData hot, final ItemStackData cold) {
- if (hot != null && cold != null) {
- mCachedHotToColdRegistry.put(hot.getUniqueDataIdentifier(), cold.getUniqueDataIdentifier());
- }
- }
-
- private synchronized static FluidStack getFluidFromIngot(final ItemStackData ingot) {
- ItemStackData h = ingot;
- if (mCachedIngotToFluidRegistry.containsKey(h.getUniqueDataIdentifier())) {
- Logger.MACHINE_INFO("[ABS] mCachedIngotToFluidRegistry contains Output Ingot.");
- return mCachedIngotToFluidRegistry.get(h.getUniqueDataIdentifier());
- }
- if (mCachedHotToColdRegistry.containsKey(h.getUniqueDataIdentifier())) {
- Logger.MACHINE_INFO("[ABS] mCachedHotToColdRegistry contains Output Ingot.");
- return mCachedIngotToFluidRegistry.get(mCachedHotToColdRegistry.get(h.getUniqueDataIdentifier()));
- }
- Logger.MACHINE_INFO("[ABS] Neither Cache contains Output Ingot.");
- return null;
- }
-
- private static boolean isValid(final ItemStack[] inputs, final ItemStack outputs[], final FluidStack[] fluidIn, final FluidStack fluidOut) {
- if (inputs != null && outputs != null && fluidIn != null && fluidOut != null && inputs.length > 0 && outputs.length > 0) {
- return true;
- }
- return false;
- }
-
- public synchronized static boolean generateGTNHBlastSmelterRecipesFromEBFList() {
-
- //Make a counting object
- int mSuccess = 0;
-
- Logger.INFO("[ABS] Starting recipe generation based on EBF recipe map.");
- Logger.INFO("[ABS] Caching Ingots and their Molten fluid..");
- //First, we make sure that we have a valid recipe map of Ingots/Dusts -> Fluids
- if (GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size() > 0) {
- //So, let's check every recipe
- for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList) {
- ItemStack validInput = null;
- FluidStack validOutput = null;
- //If we the input is an ingot and it and the output are valid, map it to cache.
- if (x.mInputs[0] != null) {
- for(int tag: OreDictionary.getOreIDs(x.mInputs[0])) {
- String oreName = OreDictionary.getOreName(tag).toLowerCase();
- String mType = "dust";
- if (CORE.GTNH) {
- mType = "ingot";
- }
- if(oreName.startsWith(mType) && !oreName.contains("double") && !oreName.contains("triple") && !oreName.contains("quad") && !oreName.contains("quintuple")) {
- validInput = x.mInputs[0];
- }
- }
- }
- if (x.mFluidOutputs[0] != null) {
- validOutput = x.mFluidOutputs[0];
- }
- if (validInput != null && validOutput != null) {
- ItemStackData R = new ItemStackData(validInput);
- setIngotToFluid(R, validOutput);
- Logger.MACHINE_INFO("[ABS][I2F] Cached "+validInput.getDisplayName()+" to "+validOutput.getLocalizedName()+". Stored Under ID of "+R.getUniqueDataIdentifier());
- }
- }
- }
-
- Logger.INFO("[ABS] Caching Ingots and their Hot form...");
- //Second, we make sure that we have a valid recipe map of Hot Ingots -> Cold Ingots
- if (GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList.size() > 0) {
- //So, let's check every recipe
- for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList) {
- ItemStack validInput = null;
- ItemStack validOutput = null;
- //If we the input is an ingot and it and the output are valid, map it to cache.
- if (x.mInputs != null && x.mInputs.length > 0 && x.mInputs[0] != null) {
- validInput = x.mInputs[0];
- }
- if (x.mOutputs != null && x.mOutputs.length > 0 && x.mOutputs[0] != null) {
- validOutput = x.mOutputs[0];
- }
- if (validInput != null && validOutput != null) {
- ItemStackData R1 = new ItemStackData(validInput);
- ItemStackData R2 = new ItemStackData(validOutput);
- setHotToCold(R1, R2);
- Logger.MACHINE_INFO("[ABS][H2C] Cached "+validInput.getDisplayName()+" to "+validOutput.getDisplayName()+". Stored Under ID of "+R1.getUniqueDataIdentifier()+", links to ID "+R2.getUniqueDataIdentifier());
- }
- }
- }
-
- Logger.INFO("[ABS] Generating recipes based on existing EBF recipes.");
- //Okay, so now lets Iterate existing EBF recipes.
- if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size() > 0) {
- for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) {
- if (x == null) {
- continue;
- }
- ItemStack[] inputs, outputs;
- FluidStack[] inputsF;
- int voltage, time, special;
- boolean enabled;
- inputs = x.mInputs.clone();
- outputs = x.mOutputs.clone();
- inputsF = x.mFluidInputs.clone();
- voltage = x.mEUt;
- time = x.mDuration;
- enabled = x.mEnabled;
- special = x.mSpecialValue;
-
- //Check for GTNH, if it's found, continue to next recipe if the Temp is too high.
- if (CORE.GTNH && special > 3600) {
- Logger.MACHINE_INFO("[ABS] Skipping ABS addition for GTNH due to temp.");
- continue;
- }
- else {
- FluidStack mMoltenStack = null;
- int mMoltenCount = 0;
- //If We have a valid Output, let's try use our cached data to get it's molten form.
- if (x.mOutputs != null && x.mOutputs[0] != null) {
- mMoltenCount = x.mOutputs[0].stackSize;
- ItemStackData R = new ItemStackData(x.mOutputs[0]);
- Logger.MACHINE_INFO("[ABS] Found "+x.mOutputs[0].getDisplayName()+" as valid EBF output, finding it's fluid from the cache. We will require "+(144*mMoltenCount)+"L. Looking for ID "+R.getUniqueDataIdentifier());
- FluidStack tempFluid = getFluidFromIngot(R);
- if (tempFluid != null) {
- //Logger.MACHINE_INFO("[ABS] Got Fluid from Cache.");
- mMoltenStack = FluidUtils.getFluidStack(tempFluid, mMoltenCount*144);
- }
- else {
- Logger.MACHINE_INFO("[ABS] Failed to get Fluid from Cache.");
- }
- }
- //If this recipe is enabled and we have a valid molten fluidstack, let's try add this recipe.
- if (enabled && isValid(inputs, outputs, inputsF, mMoltenStack)) {
- // Boolean to decide whether or not to create a new circuit later
- boolean circuitFound = false;
-
- //Build correct input stack
- ArrayList<ItemStack> aTempList = new ArrayList<ItemStack>();
- for (ItemStack recipeItem : inputs) {
- if (ItemUtils.isControlCircuit(recipeItem)) {
- circuitFound = true;
- }
- aTempList.add(recipeItem);
- }
-
- inputs = aTempList.toArray(new ItemStack[aTempList.size()]);
- int inputLength = inputs.length;
- // If no circuit was found, increase array length by 1 to add circuit at newInput[0]
- if (!circuitFound) {
- inputLength++;
- }
-
- ItemStack[] newInput = new ItemStack[inputLength];
-
- int l = 0;
- // If no circuit was found, add a circuit here
- if (!circuitFound) {
- l = 1;
- newInput[0] = CI.getNumberedCircuit(inputs.length);
- }
-
- for (ItemStack y : inputs) {
- newInput[l++] = y;
- }
-
- //Logger.MACHINE_INFO("[ABS] Generating ABS recipe for "+mMoltenStack.getLocalizedName()+".");
- if (CORE.RA.addBlastSmelterRecipe(newInput, (inputsF.length > 0 ? inputsF[0] : null), mMoltenStack, 100, MathUtils.roundToClosestInt(time*0.8), voltage, special)) {
- //Logger.MACHINE_INFO("[ABS] Success.");
- mSuccess++;
- }
- else {
- Logger.MACHINE_INFO("[ABS] Failure.");
- }
- }
- else {
- if (!enabled) {
- Logger.MACHINE_INFO("[ABS] Failure. EBF recipe was not enabled.");
- }
- else {
- Logger.MACHINE_INFO("[ABS] Failure. Invalid Inputs or Outputs.");
- if (inputs == null) {
- Logger.MACHINE_INFO("[ABS] Inputs were not Valid.");
- }
- else {
- Logger.MACHINE_INFO("[ABS] inputs size: "+inputs.length);
- }
- if (outputs == null) {
- Logger.MACHINE_INFO("[ABS] Outputs were not Valid.");
- }
- else {
- Logger.MACHINE_INFO("[ABS] outputs size: "+outputs.length);
- }
- if (inputsF == null) {
- Logger.MACHINE_INFO("[ABS] Input Fluids were not Valid.");
- }
- else {
- Logger.MACHINE_INFO("[ABS] inputsF size: "+inputsF.length);
- }
- if (mMoltenStack == null) {
- Logger.MACHINE_INFO("[ABS] Output Fluid were not Valid.");
- }
- }
- }
- }
- }
- }
- else {
- Logger.MACHINE_INFO("[ABS] Failure. Did not find any EBF recipes to iterate.");
- }
-
- Logger.INFO("[ABS] Processed "+mSuccess+" recipes.");
- return mSuccess > 0;
- }
-
+ private static Map<String, FluidStack> mCachedIngotToFluidRegistry = new HashMap<String, FluidStack>();
+ private static Map<String, String> mCachedHotToColdRegistry = new HashMap<String, String>();
+
+ private static synchronized void setIngotToFluid(final ItemStackData stack, final FluidStack fluid) {
+ if (stack != null && fluid != null) {
+ mCachedIngotToFluidRegistry.put(stack.getUniqueDataIdentifier(), fluid);
+ }
+ }
+
+ private static synchronized void setHotToCold(final ItemStackData hot, final ItemStackData cold) {
+ if (hot != null && cold != null) {
+ mCachedHotToColdRegistry.put(hot.getUniqueDataIdentifier(), cold.getUniqueDataIdentifier());
+ }
+ }
+
+ private static synchronized FluidStack getFluidFromIngot(final ItemStackData ingot) {
+ ItemStackData h = ingot;
+ if (mCachedIngotToFluidRegistry.containsKey(h.getUniqueDataIdentifier())) {
+ Logger.MACHINE_INFO("[ABS] mCachedIngotToFluidRegistry contains Output Ingot.");
+ return mCachedIngotToFluidRegistry.get(h.getUniqueDataIdentifier());
+ }
+ if (mCachedHotToColdRegistry.containsKey(h.getUniqueDataIdentifier())) {
+ Logger.MACHINE_INFO("[ABS] mCachedHotToColdRegistry contains Output Ingot.");
+ return mCachedIngotToFluidRegistry.get(mCachedHotToColdRegistry.get(h.getUniqueDataIdentifier()));
+ }
+ Logger.MACHINE_INFO("[ABS] Neither Cache contains Output Ingot.");
+ return null;
+ }
+
+ private static boolean isValid(
+ final ItemStack[] inputs,
+ final ItemStack outputs[],
+ final FluidStack[] fluidIn,
+ final FluidStack fluidOut) {
+ if (inputs != null
+ && outputs != null
+ && fluidIn != null
+ && fluidOut != null
+ && inputs.length > 0
+ && outputs.length > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ public static synchronized boolean generateGTNHBlastSmelterRecipesFromEBFList() {
+
+ // Make a counting object
+ int mSuccess = 0;
+
+ Logger.INFO("[ABS] Starting recipe generation based on EBF recipe map.");
+ Logger.INFO("[ABS] Caching Ingots and their Molten fluid..");
+ // First, we make sure that we have a valid recipe map of Ingots/Dusts -> Fluids
+ if (GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size() > 0) {
+ // So, let's check every recipe
+ for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList) {
+ ItemStack validInput = null;
+ FluidStack validOutput = null;
+ // If we the input is an ingot and it and the output are valid, map it to cache.
+ if (x.mInputs[0] != null) {
+ for (int tag : OreDictionary.getOreIDs(x.mInputs[0])) {
+ String oreName = OreDictionary.getOreName(tag).toLowerCase();
+ String mType = "dust";
+ if (CORE.GTNH) {
+ mType = "ingot";
+ }
+ if (oreName.startsWith(mType)
+ && !oreName.contains("double")
+ && !oreName.contains("triple")
+ && !oreName.contains("quad")
+ && !oreName.contains("quintuple")) {
+ validInput = x.mInputs[0];
+ }
+ }
+ }
+ if (x.mFluidOutputs[0] != null) {
+ validOutput = x.mFluidOutputs[0];
+ }
+ if (validInput != null && validOutput != null) {
+ ItemStackData R = new ItemStackData(validInput);
+ setIngotToFluid(R, validOutput);
+ Logger.MACHINE_INFO("[ABS][I2F] Cached " + validInput.getDisplayName() + " to "
+ + validOutput.getLocalizedName() + ". Stored Under ID of " + R.getUniqueDataIdentifier());
+ }
+ }
+ }
+
+ Logger.INFO("[ABS] Caching Ingots and their Hot form...");
+ // Second, we make sure that we have a valid recipe map of Hot Ingots -> Cold Ingots
+ if (GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList.size() > 0) {
+ // So, let's check every recipe
+ for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList) {
+ ItemStack validInput = null;
+ ItemStack validOutput = null;
+ // If we the input is an ingot and it and the output are valid, map it to cache.
+ if (x.mInputs != null && x.mInputs.length > 0 && x.mInputs[0] != null) {
+ validInput = x.mInputs[0];
+ }
+ if (x.mOutputs != null && x.mOutputs.length > 0 && x.mOutputs[0] != null) {
+ validOutput = x.mOutputs[0];
+ }
+ if (validInput != null && validOutput != null) {
+ ItemStackData R1 = new ItemStackData(validInput);
+ ItemStackData R2 = new ItemStackData(validOutput);
+ setHotToCold(R1, R2);
+ Logger.MACHINE_INFO("[ABS][H2C] Cached " + validInput.getDisplayName() + " to "
+ + validOutput.getDisplayName() + ". Stored Under ID of " + R1.getUniqueDataIdentifier()
+ + ", links to ID " + R2.getUniqueDataIdentifier());
+ }
+ }
+ }
+
+ Logger.INFO("[ABS] Generating recipes based on existing EBF recipes.");
+ // Okay, so now lets Iterate existing EBF recipes.
+ if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size() > 0) {
+ for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) {
+ if (x == null) {
+ continue;
+ }
+ ItemStack[] inputs, outputs;
+ FluidStack[] inputsF;
+ int voltage, time, special;
+ boolean enabled;
+ inputs = x.mInputs.clone();
+ outputs = x.mOutputs.clone();
+ inputsF = x.mFluidInputs.clone();
+ voltage = x.mEUt;
+ time = x.mDuration;
+ enabled = x.mEnabled;
+ special = x.mSpecialValue;
+
+ // Check for GTNH, if it's found, continue to next recipe if the Temp is too high.
+ if (CORE.GTNH && special > 3600) {
+ Logger.MACHINE_INFO("[ABS] Skipping ABS addition for GTNH due to temp.");
+ continue;
+ } else {
+ FluidStack mMoltenStack = null;
+ int mMoltenCount = 0;
+ // If We have a valid Output, let's try use our cached data to get it's molten form.
+ if (x.mOutputs != null && x.mOutputs[0] != null) {
+ mMoltenCount = x.mOutputs[0].stackSize;
+ ItemStackData R = new ItemStackData(x.mOutputs[0]);
+ Logger.MACHINE_INFO("[ABS] Found " + x.mOutputs[0].getDisplayName()
+ + " as valid EBF output, finding it's fluid from the cache. We will require "
+ + (144 * mMoltenCount) + "L. Looking for ID " + R.getUniqueDataIdentifier());
+ FluidStack tempFluid = getFluidFromIngot(R);
+ if (tempFluid != null) {
+ // Logger.MACHINE_INFO("[ABS] Got Fluid from Cache.");
+ mMoltenStack = FluidUtils.getFluidStack(tempFluid, mMoltenCount * 144);
+ } else {
+ Logger.MACHINE_INFO("[ABS] Failed to get Fluid from Cache.");
+ }
+ }
+ // If this recipe is enabled and we have a valid molten fluidstack, let's try add this recipe.
+ if (enabled && isValid(inputs, outputs, inputsF, mMoltenStack)) {
+ // Boolean to decide whether or not to create a new circuit later
+ boolean circuitFound = false;
+
+ // Build correct input stack
+ ArrayList<ItemStack> aTempList = new ArrayList<ItemStack>();
+ for (ItemStack recipeItem : inputs) {
+ if (ItemUtils.isControlCircuit(recipeItem)) {
+ circuitFound = true;
+ }
+ aTempList.add(recipeItem);
+ }
+
+ inputs = aTempList.toArray(new ItemStack[aTempList.size()]);
+ int inputLength = inputs.length;
+ // If no circuit was found, increase array length by 1 to add circuit at newInput[0]
+ if (!circuitFound) {
+ inputLength++;
+ }
+
+ ItemStack[] newInput = new ItemStack[inputLength];
+
+ int l = 0;
+ // If no circuit was found, add a circuit here
+ if (!circuitFound) {
+ l = 1;
+ newInput[0] = CI.getNumberedCircuit(inputs.length);
+ }
+
+ for (ItemStack y : inputs) {
+ newInput[l++] = y;
+ }
+
+ // Logger.MACHINE_INFO("[ABS] Generating ABS recipe for "+mMoltenStack.getLocalizedName()+".");
+ if (CORE.RA.addBlastSmelterRecipe(
+ newInput,
+ (inputsF.length > 0 ? inputsF[0] : null),
+ mMoltenStack,
+ 100,
+ MathUtils.roundToClosestInt(time * 0.8),
+ voltage,
+ special)) {
+ // Logger.MACHINE_INFO("[ABS] Success.");
+ mSuccess++;
+ } else {
+ Logger.MACHINE_INFO("[ABS] Failure.");
+ }
+ } else {
+ if (!enabled) {
+ Logger.MACHINE_INFO("[ABS] Failure. EBF recipe was not enabled.");
+ } else {
+ Logger.MACHINE_INFO("[ABS] Failure. Invalid Inputs or Outputs.");
+ if (inputs == null) {
+ Logger.MACHINE_INFO("[ABS] Inputs were not Valid.");
+ } else {
+ Logger.MACHINE_INFO("[ABS] inputs size: " + inputs.length);
+ }
+ if (outputs == null) {
+ Logger.MACHINE_INFO("[ABS] Outputs were not Valid.");
+ } else {
+ Logger.MACHINE_INFO("[ABS] outputs size: " + outputs.length);
+ }
+ if (inputsF == null) {
+ Logger.MACHINE_INFO("[ABS] Input Fluids were not Valid.");
+ } else {
+ Logger.MACHINE_INFO("[ABS] inputsF size: " + inputsF.length);
+ }
+ if (mMoltenStack == null) {
+ Logger.MACHINE_INFO("[ABS] Output Fluid were not Valid.");
+ }
+ }
+ }
+ }
+ }
+ } else {
+ Logger.MACHINE_INFO("[ABS] Failure. Did not find any EBF recipes to iterate.");
+ }
+
+ Logger.INFO("[ABS] Processed " + mSuccess + " recipes.");
+ return mSuccess > 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
index 24c8eb488f..d3143b9706 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_ModHandler;
@@ -21,424 +16,428 @@ import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import java.util.HashSet;
+import java.util.Set;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeGen_DustGeneration extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
-
- public RecipeGen_DustGeneration(final Material M){
- this(M, false);
- }
-
- public RecipeGen_DustGeneration(final Material M, final boolean O){
- this.toGenerate = M;
- this.disableOptional = O;
- mRecipeGenMap.add(this);
- final ItemStack normalDust = M.getDust(1);
- final ItemStack smallDust = M.getSmallDust(1);
- final ItemStack tinyDust = M.getTinyDust(1);
- if (tinyDust != null && normalDust != null) {
- if (RecipeUtils.addShapedRecipe(
- tinyDust, tinyDust, tinyDust,
- tinyDust, tinyDust, tinyDust,
- tinyDust, tinyDust, tinyDust,
- normalDust)){
- Logger.INFO("9 Tiny dust to 1 Dust Recipe: "+M.getLocalizedName()+" - Success");
- }
- else {
- Logger.INFO("9 Tiny dust to 1 Dust Recipe: "+M.getLocalizedName()+" - Failed");
- }
-
- if (RecipeUtils.addShapedRecipe(
- normalDust, null, null,
- null, null, null,
- null, null, null,
- M.getTinyDust(9))){
- Logger.INFO("9 Tiny dust from 1 Recipe: "+M.getLocalizedName()+" - Success");
- }
- else {
- Logger.INFO("9 Tiny dust from 1 Recipe: "+M.getLocalizedName()+" - Failed");
- }
- }
-
- if (smallDust != null && normalDust != null) {
- if (RecipeUtils.addShapedRecipe(
- smallDust, smallDust, null,
- smallDust, smallDust, null,
- null, null, null,
- normalDust)){
- Logger.INFO("4 Small dust to 1 Dust Recipe: "+M.getLocalizedName()+" - Success");
- }
- else {
- Logger.INFO("4 Small dust to 1 Dust Recipe: "+M.getLocalizedName()+" - Failed");
- }
- if (RecipeUtils.addShapedRecipe(
- null, normalDust, null,
- null, null, null,
- null, null, null,
- M.getSmallDust(4))){
- Logger.INFO("4 Small dust from 1 Dust Recipe: "+M.getLocalizedName()+" - Success");
- }
- else {
- Logger.INFO("4 Small dust from 1 Dust Recipe: "+M.getLocalizedName()+" - Failed");
- }
- }
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate, this.disableOptional);
- }
-
- private void generateRecipes(final Material material, final boolean disableOptional){
-
- Logger.INFO("Generating Shaped Crafting recipes for "+material.getLocalizedName());
-
- final ItemStack normalDust = material.getDust(1);
- final ItemStack smallDust = material.getSmallDust(1);
- final ItemStack tinyDust = material.getTinyDust(1);
-
- final ItemStack[] inputStacks = material.getMaterialComposites();
- final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
-
- //Macerate blocks back to dusts.
- final ItemStack materialBlock = material.getBlock(1);
- final ItemStack materialFrameBox = material.getFrameBox(1);
-
- if (ItemUtils.checkForInvalidItems(materialBlock)) {
- GT_ModHandler.addPulverisationRecipe(materialBlock, material.getDust(9));
- }
-
- if (ItemUtils.checkForInvalidItems(materialFrameBox)) {
- GT_ModHandler.addPulverisationRecipe(materialFrameBox, material.getDust(2));
- }
-
- if (ItemUtils.checkForInvalidItems(smallDust) && ItemUtils.checkForInvalidItems(tinyDust)) {
- generatePackagerRecipes(material);
- }
-
- ItemStack ingot = material.getIngot(1);
- if (ItemUtils.checkForInvalidItems(normalDust) && ItemUtils.checkForInvalidItems(ingot)) {
- addFurnaceRecipe(material);
- addMacerationRecipe(material);
- }
-
- //Is this a composite?
- if ((inputStacks != null) && !disableOptional){
- //Is this a composite?
- Logger.WARNING("mixer length: "+inputStacks.length);
- if ((inputStacks.length != 0) && (inputStacks.length <= 4)){
- //Log Input items
- Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
- final long[] inputStackSize = material.vSmallestRatio;
- Logger.WARNING("mixer is stacksizeVar null? "+(inputStackSize != null));
- //Is smallest ratio invalid?
- if (inputStackSize != null){
- //set stack sizes on an input ItemStack[]
- for (short x=0;x<inputStacks.length;x++){
- if ((inputStacks[x] != null) && (inputStackSize[x] != 0)){
- inputStacks[x].stackSize = (int) inputStackSize[x];
- }
- }
- //Relog input values, with stack sizes
- Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
-
- //Get us four ItemStacks to input into the mixer
- ItemStack[] input = new ItemStack[4];
-
- input[0] = (inputStacks.length >= 1) ? ((inputStacks[0] == null) ? null : inputStacks[0]) : null;
- input[1] = (inputStacks.length >= 2) ? ((inputStacks[1] == null) ? null : inputStacks[1]) : null;
- input[2] = (inputStacks.length >= 3) ? ((inputStacks[2] == null) ? null : inputStacks[2]) : null;
- input[3] = (inputStacks.length >= 4) ? ((inputStacks[3] == null) ? null : inputStacks[3]) : null;
-
-
- if (inputStacks.length == 1) {
- input[1] = input[0];
- input[0] = CI.getNumberedCircuit(inputStacks.length+10);
- }
- else if (inputStacks.length == 2) {
- input[2] = input[1];
- input[1] = input[0];
- input[0] = CI.getNumberedCircuit(inputStacks.length+10);
-
- }
- else if (inputStacks.length == 3) {
- input[3] = input[2];
- input[2] = input[1];
- input[1] = input[0];
- input[0] = CI.getNumberedCircuit(inputStacks.length+10);
- }
-
-
- /*for (int g = 0; g<4; g++) {
- if(inputStacks.length > g) {
- input[g] = inputStacks[g] != null ? inputStacks[g] : null;
- }
- else {
- input[g] = CI.getNumberedCircuit(g+10);
- break;
- }
- }*/
-
- //Add mixer Recipe
- FluidStack oxygen = GT_Values.NF;
- if (material.getComposites() != null){
- for (final MaterialStack x : material.getComposites()){
- if (!material.getComposites().isEmpty()){
- if (x != null){
- if (x.getStackMaterial() != null){
- if (x.getStackMaterial().getDust(1) == null){
- if (x.getStackMaterial().getState() != MaterialState.SOLID && x.getStackMaterial().getState() != MaterialState.ORE && x.getStackMaterial().getState() != MaterialState.PLASMA){
- oxygen = x.getStackMaterial().getFluidStack(1000);
- break;
- }
- }
- }
- }
- }
- }
- }
-
- input = ItemUtils.cleanItemStackArray(input);
-
- //Add mixer Recipe
- if (GT_Values.RA.addMixerRecipe(
- input[0], input[1],
- input[2], input[3],
- oxygen,
- null,
- outputStacks,
- (int) Math.max(material.getMass() * 2L * 1, 1),
- material.vVoltageMultiplier)) //Was 6, but let's try 2. This makes Potin LV, for example.
- {
- Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- //Add Shapeless recipe for low tier alloys.
- /*if (tVoltageMultiplier <= 30){
- if (RecipeUtils.addShapedGregtechRecipe(inputStacks, outputStacks)){
- Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }*/
- }
- }
- }
-
-
-
-
-
-
- }
-
- public static boolean addMixerRecipe_Standalone(final Material material){
- final ItemStack[] inputStacks = material.getMaterialComposites();
- final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
- //Is this a composite?
- if ((inputStacks != null)){
- //Is this a composite?
- Logger.WARNING("mixer length: "+inputStacks.length);
- if ((inputStacks.length >= 1) && (inputStacks.length <= 4)){
- //Log Input items
- Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
- final long[] inputStackSize = material.vSmallestRatio;
- Logger.WARNING("mixer is stacksizeVar not null? "+(inputStackSize != null));
- //Is smallest ratio invalid?
- if (inputStackSize != null){
- //set stack sizes on an input ItemStack[]
- for (short x=0;x<inputStacks.length;x++){
- if ((inputStacks[x] != null) && (inputStackSize[x] != 0)){
- inputStacks[x].stackSize = (int) inputStackSize[x];
- }
- }
- //Relog input values, with stack sizes
- Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
-
- //Get us four ItemStacks to input into the mixer
- ItemStack input1, input2, input3, input4;
- input1 = inputStacks[0];
- input2 = (inputStacks.length >= 2) ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1]) : null;
- input3 = (inputStacks.length >= 3) ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2]) : null;
- input4 = (inputStacks.length >= 4) ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3]) : null;
-
- if (inputStacks.length == 1) {
- input2 = input1;
- input1 = CI.getNumberedCircuit(20);
- }
- else if (inputStacks.length == 2) {
- input3 = input2;
- input2 = input1;
- input1 = CI.getNumberedCircuit(20);
-
- }
- else if (inputStacks.length == 3) {
- input4 = input3;
- input3 = input2;
- input2 = input1;
- input1 = CI.getNumberedCircuit(20);
- }
-
- //Add mixer Recipe
- FluidStack oxygen = GT_Values.NF;
- if (material.getComposites() != null){
- int compSlot = 0;
- for (final MaterialStack x : material.getComposites()){
- if (!material.getComposites().isEmpty()){
- if (x != null){
- if (x.getStackMaterial() != null){
- if (x.getStackMaterial().getDust(1) == null){
- MaterialState f = x.getStackMaterial().getState();
- if (f == MaterialState.GAS || f == MaterialState.LIQUID || f == MaterialState.PURE_LIQUID || f == MaterialState.PURE_GAS){
- oxygen = x.getStackMaterial().getFluidStack((int) (material.vSmallestRatio[compSlot] * 1000));
- }
- }
- }
- }
- }
- compSlot++;
- }
-
- }
-
- //Add mixer Recipe
- try {
- if (GT_Values.RA.addMixerRecipe(
- input1, input2,
- input3, input4,
- oxygen,
- null,
- outputStacks,
- (int) Math.max(material.getMass() * 2L * 1, 1),
- material.vVoltageMultiplier)) //Was 6, but let's try 2. This makes Potin LV, for example.
- {
- Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success");
- return true;
- }
- else {
- Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
- return false;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
- else {
- Logger.WARNING("inputStackSize == NUll - "+material.getLocalizedName());
- }
- }
- else {
- Logger.WARNING("InputStacks is out range 1-4 - "+material.getLocalizedName());
- }
- }
- else {
- Logger.WARNING("InputStacks == NUll - "+material.getLocalizedName());
- }
- return false;
- }
-
- public static boolean generatePackagerRecipes(Material aMatInfo) {
- AutoMap<Boolean> aResults = new AutoMap<Boolean>();
- //Small Dust
- aResults.put(GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(4L, new Object[]{aMatInfo.getSmallDust(4)}), ItemList.Schematic_Dust.get(0L, new Object[0]), aMatInfo.getDust(1), 100, 4));
- //Tiny Dust
- aResults.put(GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(9L, new Object[]{aMatInfo.getTinyDust(9)}), ItemList.Schematic_Dust.get(0L, new Object[0]), aMatInfo.getDust(1), 100, 4));
-
- for (boolean b : aResults) {
- if (!b) {
- return false;
- }
- }
- return true;
- }
-
- private void addMacerationRecipe(Material aMatInfo){
- try {
- Logger.MATERIALS("Adding Maceration recipe for "+aMatInfo.getLocalizedName()+" Ingot -> Dusts");
- final int chance = (aMatInfo.vTier*10)/MathUtils.randInt(10, 20);
- GT_ModHandler.addPulverisationRecipe(aMatInfo.getIngot(1), aMatInfo.getDust(1), null, chance);
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- private void addFurnaceRecipe(Material aMatInfo){
-
- ItemStack aDust = aMatInfo.getDust(1);
- ItemStack aOutput;
- try {
- if (aMatInfo.requiresBlastFurnace()) {
- aOutput = aMatInfo.getHotIngot(1);
- if (ItemUtils.checkForInvalidItems(aOutput)) {
- if (addBlastFurnaceRecipe(aMatInfo, aDust, null, aOutput, null, aMatInfo.getMeltingPointK())){
- Logger.MATERIALS("Successfully added a blast furnace recipe for "+aMatInfo.getLocalizedName());
- }
- else {
- Logger.MATERIALS("Failed to add a blast furnace recipe for "+aMatInfo.getLocalizedName());
- }
- }
- else {
- Logger.MATERIALS("Failed to add a blast furnace recipe for "+aMatInfo.getLocalizedName());
- }
- }
- else {
- aOutput = aMatInfo.getIngot(1);
- if (ItemUtils.checkForInvalidItems(aOutput)) {
- if (CORE.RA.addSmeltingAndAlloySmeltingRecipe(aDust, aOutput)){
- Logger.MATERIALS("Successfully added a furnace recipe for "+aMatInfo.getLocalizedName());
- }
- else {
- Logger.MATERIALS("Failed to add a furnace recipe for "+aMatInfo.getLocalizedName());
- }
- }
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
-
- }
-
- private boolean addBlastFurnaceRecipe(Material aMatInfo, final ItemStack input1, final ItemStack input2, final ItemStack output1, final ItemStack output2, final int tempRequired){
-
- try {
- int timeTaken = 125*aMatInfo.vTier*10;
-
- if (aMatInfo.vTier <= 4){
- timeTaken = 25*aMatInfo.vTier*10;
- }
- int aSlot = aMatInfo.vTier;
- if (aSlot < 2) {
- aSlot = 2;
- }
- long aVoltage = aMatInfo.vVoltageMultiplier;
-
- return GT_Values.RA.addBlastRecipe(
- input1,
- input2,
- GT_Values.NF, GT_Values.NF,
- output1,
- output2,
- timeTaken,
- (int) aVoltage,
- tempRequired);
- }
- catch (Throwable t) {
- t.printStackTrace();
- return false;
- }
- }
-
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_DustGeneration(final Material M) {
+ this(M, false);
+ }
+
+ public RecipeGen_DustGeneration(final Material M, final boolean O) {
+ this.toGenerate = M;
+ this.disableOptional = O;
+ mRecipeGenMap.add(this);
+ final ItemStack normalDust = M.getDust(1);
+ final ItemStack smallDust = M.getSmallDust(1);
+ final ItemStack tinyDust = M.getTinyDust(1);
+ if (tinyDust != null && normalDust != null) {
+ if (RecipeUtils.addShapedRecipe(
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ tinyDust,
+ normalDust)) {
+ Logger.INFO("9 Tiny dust to 1 Dust Recipe: " + M.getLocalizedName() + " - Success");
+ } else {
+ Logger.INFO("9 Tiny dust to 1 Dust Recipe: " + M.getLocalizedName() + " - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ normalDust, null, null, null, null, null, null, null, null, M.getTinyDust(9))) {
+ Logger.INFO("9 Tiny dust from 1 Recipe: " + M.getLocalizedName() + " - Success");
+ } else {
+ Logger.INFO("9 Tiny dust from 1 Recipe: " + M.getLocalizedName() + " - Failed");
+ }
+ }
+
+ if (smallDust != null && normalDust != null) {
+ if (RecipeUtils.addShapedRecipe(
+ smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, normalDust)) {
+ Logger.INFO("4 Small dust to 1 Dust Recipe: " + M.getLocalizedName() + " - Success");
+ } else {
+ Logger.INFO("4 Small dust to 1 Dust Recipe: " + M.getLocalizedName() + " - Failed");
+ }
+ if (RecipeUtils.addShapedRecipe(
+ null, normalDust, null, null, null, null, null, null, null, M.getSmallDust(4))) {
+ Logger.INFO("4 Small dust from 1 Dust Recipe: " + M.getLocalizedName() + " - Success");
+ } else {
+ Logger.INFO("4 Small dust from 1 Dust Recipe: " + M.getLocalizedName() + " - Failed");
+ }
+ }
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate, this.disableOptional);
+ }
+
+ private void generateRecipes(final Material material, final boolean disableOptional) {
+
+ Logger.INFO("Generating Shaped Crafting recipes for " + material.getLocalizedName());
+
+ final ItemStack normalDust = material.getDust(1);
+ final ItemStack smallDust = material.getSmallDust(1);
+ final ItemStack tinyDust = material.getTinyDust(1);
+
+ final ItemStack[] inputStacks = material.getMaterialComposites();
+ final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
+
+ // Macerate blocks back to dusts.
+ final ItemStack materialBlock = material.getBlock(1);
+ final ItemStack materialFrameBox = material.getFrameBox(1);
+
+ if (ItemUtils.checkForInvalidItems(materialBlock)) {
+ GT_ModHandler.addPulverisationRecipe(materialBlock, material.getDust(9));
+ }
+
+ if (ItemUtils.checkForInvalidItems(materialFrameBox)) {
+ GT_ModHandler.addPulverisationRecipe(materialFrameBox, material.getDust(2));
+ }
+
+ if (ItemUtils.checkForInvalidItems(smallDust) && ItemUtils.checkForInvalidItems(tinyDust)) {
+ generatePackagerRecipes(material);
+ }
+
+ ItemStack ingot = material.getIngot(1);
+ if (ItemUtils.checkForInvalidItems(normalDust) && ItemUtils.checkForInvalidItems(ingot)) {
+ addFurnaceRecipe(material);
+ addMacerationRecipe(material);
+ }
+
+ // Is this a composite?
+ if ((inputStacks != null) && !disableOptional) {
+ // Is this a composite?
+ Logger.WARNING("mixer length: " + inputStacks.length);
+ if ((inputStacks.length != 0) && (inputStacks.length <= 4)) {
+ // Log Input items
+ Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
+ final long[] inputStackSize = material.vSmallestRatio;
+ Logger.WARNING("mixer is stacksizeVar null? " + (inputStackSize != null));
+ // Is smallest ratio invalid?
+ if (inputStackSize != null) {
+ // set stack sizes on an input ItemStack[]
+ for (short x = 0; x < inputStacks.length; x++) {
+ if ((inputStacks[x] != null) && (inputStackSize[x] != 0)) {
+ inputStacks[x].stackSize = (int) inputStackSize[x];
+ }
+ }
+ // Relog input values, with stack sizes
+ Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
+
+ // Get us four ItemStacks to input into the mixer
+ ItemStack[] input = new ItemStack[4];
+
+ input[0] = (inputStacks.length >= 1) ? ((inputStacks[0] == null) ? null : inputStacks[0]) : null;
+ input[1] = (inputStacks.length >= 2) ? ((inputStacks[1] == null) ? null : inputStacks[1]) : null;
+ input[2] = (inputStacks.length >= 3) ? ((inputStacks[2] == null) ? null : inputStacks[2]) : null;
+ input[3] = (inputStacks.length >= 4) ? ((inputStacks[3] == null) ? null : inputStacks[3]) : null;
+
+ if (inputStacks.length == 1) {
+ input[1] = input[0];
+ input[0] = CI.getNumberedCircuit(inputStacks.length + 10);
+ } else if (inputStacks.length == 2) {
+ input[2] = input[1];
+ input[1] = input[0];
+ input[0] = CI.getNumberedCircuit(inputStacks.length + 10);
+
+ } else if (inputStacks.length == 3) {
+ input[3] = input[2];
+ input[2] = input[1];
+ input[1] = input[0];
+ input[0] = CI.getNumberedCircuit(inputStacks.length + 10);
+ }
+
+ /*for (int g = 0; g<4; g++) {
+ if(inputStacks.length > g) {
+ input[g] = inputStacks[g] != null ? inputStacks[g] : null;
+ }
+ else {
+ input[g] = CI.getNumberedCircuit(g+10);
+ break;
+ }
+ }*/
+
+ // Add mixer Recipe
+ FluidStack oxygen = GT_Values.NF;
+ if (material.getComposites() != null) {
+ for (final MaterialStack x : material.getComposites()) {
+ if (!material.getComposites().isEmpty()) {
+ if (x != null) {
+ if (x.getStackMaterial() != null) {
+ if (x.getStackMaterial().getDust(1) == null) {
+ if (x.getStackMaterial().getState() != MaterialState.SOLID
+ && x.getStackMaterial().getState() != MaterialState.ORE
+ && x.getStackMaterial().getState() != MaterialState.PLASMA) {
+ oxygen = x.getStackMaterial().getFluidStack(1000);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ input = ItemUtils.cleanItemStackArray(input);
+
+ // Add mixer Recipe
+ if (GT_Values.RA.addMixerRecipe(
+ input[0],
+ input[1],
+ input[2],
+ input[3],
+ oxygen,
+ null,
+ outputStacks,
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ material.vVoltageMultiplier)) // Was 6, but let's try 2. This makes Potin LV, for example.
+ {
+ Logger.WARNING("Dust Mixer Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Dust Mixer Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Add Shapeless recipe for low tier alloys.
+ /*if (tVoltageMultiplier <= 30){
+ if (RecipeUtils.addShapedGregtechRecipe(inputStacks, outputStacks)){
+ Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed");
+ }
+ }*/
+ }
+ }
+ }
+ }
+
+ public static boolean addMixerRecipe_Standalone(final Material material) {
+ final ItemStack[] inputStacks = material.getMaterialComposites();
+ final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
+ // Is this a composite?
+ if ((inputStacks != null)) {
+ // Is this a composite?
+ Logger.WARNING("mixer length: " + inputStacks.length);
+ if ((inputStacks.length >= 1) && (inputStacks.length <= 4)) {
+ // Log Input items
+ Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
+ final long[] inputStackSize = material.vSmallestRatio;
+ Logger.WARNING("mixer is stacksizeVar not null? " + (inputStackSize != null));
+ // Is smallest ratio invalid?
+ if (inputStackSize != null) {
+ // set stack sizes on an input ItemStack[]
+ for (short x = 0; x < inputStacks.length; x++) {
+ if ((inputStacks[x] != null) && (inputStackSize[x] != 0)) {
+ inputStacks[x].stackSize = (int) inputStackSize[x];
+ }
+ }
+ // Relog input values, with stack sizes
+ Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
+
+ // Get us four ItemStacks to input into the mixer
+ ItemStack input1, input2, input3, input4;
+ input1 = inputStacks[0];
+ input2 = (inputStacks.length >= 2)
+ ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1])
+ : null;
+ input3 = (inputStacks.length >= 3)
+ ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2])
+ : null;
+ input4 = (inputStacks.length >= 4)
+ ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3])
+ : null;
+
+ if (inputStacks.length == 1) {
+ input2 = input1;
+ input1 = CI.getNumberedCircuit(20);
+ } else if (inputStacks.length == 2) {
+ input3 = input2;
+ input2 = input1;
+ input1 = CI.getNumberedCircuit(20);
+
+ } else if (inputStacks.length == 3) {
+ input4 = input3;
+ input3 = input2;
+ input2 = input1;
+ input1 = CI.getNumberedCircuit(20);
+ }
+
+ // Add mixer Recipe
+ FluidStack oxygen = GT_Values.NF;
+ if (material.getComposites() != null) {
+ int compSlot = 0;
+ for (final MaterialStack x : material.getComposites()) {
+ if (!material.getComposites().isEmpty()) {
+ if (x != null) {
+ if (x.getStackMaterial() != null) {
+ if (x.getStackMaterial().getDust(1) == null) {
+ MaterialState f =
+ x.getStackMaterial().getState();
+ if (f == MaterialState.GAS
+ || f == MaterialState.LIQUID
+ || f == MaterialState.PURE_LIQUID
+ || f == MaterialState.PURE_GAS) {
+ oxygen = x.getStackMaterial().getFluidStack((int)
+ (material.vSmallestRatio[compSlot] * 1000));
+ }
+ }
+ }
+ }
+ }
+ compSlot++;
+ }
+ }
+
+ // Add mixer Recipe
+ try {
+ if (GT_Values.RA.addMixerRecipe(
+ input1,
+ input2,
+ input3,
+ input4,
+ oxygen,
+ null,
+ outputStacks,
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ material.vVoltageMultiplier)) // Was 6, but let's try 2. This makes Potin LV, for
+ // example.
+ {
+ Logger.WARNING("Dust Mixer Recipe: " + material.getLocalizedName() + " - Success");
+ return true;
+ } else {
+ Logger.WARNING("Dust Mixer Recipe: " + material.getLocalizedName() + " - Failed");
+ return false;
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ } else {
+ Logger.WARNING("inputStackSize == NUll - " + material.getLocalizedName());
+ }
+ } else {
+ Logger.WARNING("InputStacks is out range 1-4 - " + material.getLocalizedName());
+ }
+ } else {
+ Logger.WARNING("InputStacks == NUll - " + material.getLocalizedName());
+ }
+ return false;
+ }
+
+ public static boolean generatePackagerRecipes(Material aMatInfo) {
+ AutoMap<Boolean> aResults = new AutoMap<Boolean>();
+ // Small Dust
+ aResults.put(GT_Values.RA.addBoxingRecipe(
+ GT_Utility.copyAmount(4L, new Object[] {aMatInfo.getSmallDust(4)}),
+ ItemList.Schematic_Dust.get(0L, new Object[0]),
+ aMatInfo.getDust(1),
+ 100,
+ 4));
+ // Tiny Dust
+ aResults.put(GT_Values.RA.addBoxingRecipe(
+ GT_Utility.copyAmount(9L, new Object[] {aMatInfo.getTinyDust(9)}),
+ ItemList.Schematic_Dust.get(0L, new Object[0]),
+ aMatInfo.getDust(1),
+ 100,
+ 4));
+
+ for (boolean b : aResults) {
+ if (!b) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private void addMacerationRecipe(Material aMatInfo) {
+ try {
+ Logger.MATERIALS("Adding Maceration recipe for " + aMatInfo.getLocalizedName() + " Ingot -> Dusts");
+ final int chance = (aMatInfo.vTier * 10) / MathUtils.randInt(10, 20);
+ GT_ModHandler.addPulverisationRecipe(aMatInfo.getIngot(1), aMatInfo.getDust(1), null, chance);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ private void addFurnaceRecipe(Material aMatInfo) {
+
+ ItemStack aDust = aMatInfo.getDust(1);
+ ItemStack aOutput;
+ try {
+ if (aMatInfo.requiresBlastFurnace()) {
+ aOutput = aMatInfo.getHotIngot(1);
+ if (ItemUtils.checkForInvalidItems(aOutput)) {
+ if (addBlastFurnaceRecipe(aMatInfo, aDust, null, aOutput, null, aMatInfo.getMeltingPointK())) {
+ Logger.MATERIALS(
+ "Successfully added a blast furnace recipe for " + aMatInfo.getLocalizedName());
+ } else {
+ Logger.MATERIALS("Failed to add a blast furnace recipe for " + aMatInfo.getLocalizedName());
+ }
+ } else {
+ Logger.MATERIALS("Failed to add a blast furnace recipe for " + aMatInfo.getLocalizedName());
+ }
+ } else {
+ aOutput = aMatInfo.getIngot(1);
+ if (ItemUtils.checkForInvalidItems(aOutput)) {
+ if (CORE.RA.addSmeltingAndAlloySmeltingRecipe(aDust, aOutput)) {
+ Logger.MATERIALS("Successfully added a furnace recipe for " + aMatInfo.getLocalizedName());
+ } else {
+ Logger.MATERIALS("Failed to add a furnace recipe for " + aMatInfo.getLocalizedName());
+ }
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ private boolean addBlastFurnaceRecipe(
+ Material aMatInfo,
+ final ItemStack input1,
+ final ItemStack input2,
+ final ItemStack output1,
+ final ItemStack output2,
+ final int tempRequired) {
+
+ try {
+ int timeTaken = 125 * aMatInfo.vTier * 10;
+
+ if (aMatInfo.vTier <= 4) {
+ timeTaken = 25 * aMatInfo.vTier * 10;
+ }
+ int aSlot = aMatInfo.vTier;
+ if (aSlot < 2) {
+ aSlot = 2;
+ }
+ long aVoltage = aMatInfo.vVoltageMultiplier;
+
+ return GT_Values.RA.addBlastRecipe(
+ input1,
+ input2,
+ GT_Values.NF,
+ GT_Values.NF,
+ output1,
+ output2,
+ timeTaken,
+ (int) aVoltage,
+ tempRequired);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return false;
+ }
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
index 54e9716520..e675f2758f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
@@ -10,170 +7,154 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashSet;
+import java.util.Set;
import net.minecraft.item.ItemStack;
public class RecipeGen_Extruder extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- private static boolean mRotorShapeEnabled = false;
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- mRotorShapeEnabled = ItemUtils.doesItemListEntryExist("Shape_Extruder_Rotor");
- }
-
- public RecipeGen_Extruder(final Material M){
- this.toGenerate = M;
- mRecipeGenMap.add(this);
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate);
- }
-
- private void generateRecipes(final Material material){
-
- final ItemStack itemIngot = material.getIngot(1);
- final ItemStack itemPlate = material.getPlate(1);
- final ItemStack itemGear = material.getGear(1);
-
- final ItemStack shape_Plate = ItemList.Shape_Extruder_Plate.get(0);
- final ItemStack shape_Ring = ItemList.Shape_Extruder_Ring.get(0);
- final ItemStack shape_Gear = ItemList.Shape_Extruder_Gear.get(0);
- final ItemStack shape_Rod = ItemList.Shape_Extruder_Rod.get(0);
- final ItemStack shape_Bolt = ItemList.Shape_Extruder_Bolt.get(0);
- final ItemStack shape_Block = ItemList.Shape_Extruder_Block.get(0);
- final ItemStack shape_Ingot = ItemList.Shape_Extruder_Ingot.get(0);
-
- Logger.WARNING("Generating Extruder recipes for "+material.getLocalizedName());
-
-
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBlock(1))) {
- //Ingot Recipe
- if (GT_Values.RA.addExtruderRecipe(
- material.getBlock(1),
- shape_Ingot,
- material.getIngot(9),
- (int) Math.max(material.getMass() * 2L * 1, 1),
- material.vVoltageMultiplier)){
- Logger.WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- //Block Recipe
- if (GT_Values.RA.addExtruderRecipe(
- material.getIngot(9),
- shape_Block,
- material.getBlock(1),
- (int) Math.max(material.getMass() * 2L * 1, 1),
- material.vVoltageMultiplier)){
- Logger.WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
-
-
- //Plate Recipe
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1)))
- if (GT_Values.RA.addExtruderRecipe(
- itemIngot,
- shape_Plate,
- itemPlate,
- 10,
- material.vVoltageMultiplier)){
- Logger.WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- //Ring Recipe
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRing(1)))
- if (!material.isRadioactive){
- if (GT_Values.RA.addExtruderRecipe(
- itemIngot,
- shape_Ring,
- material.getRing(4),
- (int) Math.max(material.getMass() * 2L * 1, 1),
- material.vVoltageMultiplier)){
- Logger.WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
-
-
- //Gear Recipe
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getGear(1)))
- if (!material.isRadioactive){
- if (GT_Values.RA.addExtruderRecipe(
- material.getIngot(4),
- shape_Gear,
- itemGear,
- (int) Math.max(material.getMass() * 5L, 1),
- material.vVoltageMultiplier)){
- Logger.WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
-
-
- //Rod Recipe
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRod(1)))
- if (GT_Values.RA.addExtruderRecipe(
- itemIngot,
- shape_Rod,
- material.getRod(2),
- (int) Math.max(material.getMass() * 2L * 1, 1),
- material.vVoltageMultiplier)){
- Logger.WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
-
- //Bolt Recipe
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1)))
- if (!material.isRadioactive){
- if (GT_Values.RA.addExtruderRecipe(
- itemIngot,
- shape_Bolt,
- material.getBolt(8),
- (int) Math.max(material.getMass() * 2L * 1, 1),
- material.vVoltageMultiplier)){
- Logger.WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
-
- //Rotor Recipe
- // Shape_Extruder_Rotor
- if (mRotorShapeEnabled && ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRotor(1)))
- if (GT_Values.RA.addExtruderRecipe(
- material.getIngot(5),
- ItemUtils.getValueOfItemList("Shape_Extruder_Rotor", 0, ItemUtils.getErrorStack(1)),
- material.getRotor(1),
- 200,
- 60)){
- Logger.WARNING("Extruder Rotor Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Extruder Rotor Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
-
-
-
- }
-
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+ private static boolean mRotorShapeEnabled = false;
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ mRotorShapeEnabled = ItemUtils.doesItemListEntryExist("Shape_Extruder_Rotor");
+ }
+
+ public RecipeGen_Extruder(final Material M) {
+ this.toGenerate = M;
+ mRecipeGenMap.add(this);
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate);
+ }
+
+ private void generateRecipes(final Material material) {
+
+ final ItemStack itemIngot = material.getIngot(1);
+ final ItemStack itemPlate = material.getPlate(1);
+ final ItemStack itemGear = material.getGear(1);
+
+ final ItemStack shape_Plate = ItemList.Shape_Extruder_Plate.get(0);
+ final ItemStack shape_Ring = ItemList.Shape_Extruder_Ring.get(0);
+ final ItemStack shape_Gear = ItemList.Shape_Extruder_Gear.get(0);
+ final ItemStack shape_Rod = ItemList.Shape_Extruder_Rod.get(0);
+ final ItemStack shape_Bolt = ItemList.Shape_Extruder_Bolt.get(0);
+ final ItemStack shape_Block = ItemList.Shape_Extruder_Block.get(0);
+ final ItemStack shape_Ingot = ItemList.Shape_Extruder_Ingot.get(0);
+
+ Logger.WARNING("Generating Extruder recipes for " + material.getLocalizedName());
+
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1))
+ && ItemUtils.checkForInvalidItems(material.getBlock(1))) {
+ // Ingot Recipe
+ if (GT_Values.RA.addExtruderRecipe(
+ material.getBlock(1),
+ shape_Ingot,
+ material.getIngot(9),
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Extruder Ingot Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Extruder Ingot Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Block Recipe
+ if (GT_Values.RA.addExtruderRecipe(
+ material.getIngot(9),
+ shape_Block,
+ material.getBlock(1),
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Extruder Block Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Extruder Block Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+
+ // Plate Recipe
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1))
+ && ItemUtils.checkForInvalidItems(material.getPlate(1)))
+ if (GT_Values.RA.addExtruderRecipe(itemIngot, shape_Plate, itemPlate, 10, material.vVoltageMultiplier)) {
+ Logger.WARNING("Extruder Plate Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Extruder Plate Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Ring Recipe
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRing(1)))
+ if (!material.isRadioactive) {
+ if (GT_Values.RA.addExtruderRecipe(
+ itemIngot,
+ shape_Ring,
+ material.getRing(4),
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Extruder Ring Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Extruder Ring Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+
+ // Gear Recipe
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getGear(1)))
+ if (!material.isRadioactive) {
+ if (GT_Values.RA.addExtruderRecipe(
+ material.getIngot(4),
+ shape_Gear,
+ itemGear,
+ (int) Math.max(material.getMass() * 5L, 1),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Extruder Gear Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Extruder Gear Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+
+ // Rod Recipe
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRod(1)))
+ if (GT_Values.RA.addExtruderRecipe(
+ itemIngot,
+ shape_Rod,
+ material.getRod(2),
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Bolt Recipe
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1)))
+ if (!material.isRadioactive) {
+ if (GT_Values.RA.addExtruderRecipe(
+ itemIngot,
+ shape_Bolt,
+ material.getBolt(8),
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Extruder Bolt Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Extruder Bolt Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+
+ // Rotor Recipe
+ // Shape_Extruder_Rotor
+ if (mRotorShapeEnabled
+ && ItemUtils.checkForInvalidItems(material.getIngot(1))
+ && ItemUtils.checkForInvalidItems(material.getRotor(1)))
+ if (GT_Values.RA.addExtruderRecipe(
+ material.getIngot(5),
+ ItemUtils.getValueOfItemList("Shape_Extruder_Rotor", 0, ItemUtils.getErrorStack(1)),
+ material.getRotor(1),
+ 200,
+ 60)) {
+ Logger.WARNING("Extruder Rotor Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Extruder Rotor Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
index 488af954d6..4b1f407809 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
@@ -1,232 +1,253 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-
import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GTPP_Recipe;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.HashSet;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeGen_FluidCanning implements Runnable {
-
- public static void init() {
- FluidCanningRunnableHandler x = new FluidCanningRunnableHandler();
- x.run();
- }
-
- private static class FluidCanningRunnableHandler implements RunnableWithInfo<String> {
-
- @Override
- public void run() {
- mHasRun = true;
- for (RecipeGen_FluidCanning aRecipe : mCache) {
- aRecipe.run();
- }
- }
-
- @Override
- public String getInfoData() {
- return "Fluid Canning Recipes";
- }
- }
-
- private static boolean mHasRun = false;
-
- private static HashSet<RecipeGen_FluidCanning> mCache = new HashSet<RecipeGen_FluidCanning>();
-
- private static void addRunnableToRecipeCache(RecipeGen_FluidCanning r) {
- if (mHasRun) {
- CORE.crash();
- }
- mCache.add(r);
- }
-
- protected boolean disableOptional;
-
- private final GT_Recipe recipe;
- private final boolean isValid;
-
- public boolean valid() {
- return isValid;
- }
- public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid) {
- this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, null, null);
- }
-
- public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, FluidStack aFluidOut) {
- this(aExtracting, aEmpty, aFull, aFluidIn, aFluidOut, null, null);
- }
-
- public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid, Integer aDuration, Integer aEUt) {
- this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, aDuration, aEUt);
- }
-
- // Alternative Constructor
- public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, FluidStack aFluidOut, Integer aDuration, Integer aEUt) {
- ItemStack aInput;
- ItemStack aOutput;
- FluidStack aFluidInput;
- FluidStack aFluidOutput;
-
- // Safety check on the duration
- if (aDuration == null || aDuration <= 0) {
- aDuration = (aFluidIn != null) ? (aFluidIn.amount / 62) : ((aFluidOut != null) ? (aFluidOut.amount / 62) : 10);
- }
-
- // Safety check on the EU
- if (aEUt == null || aEUt <= 0) {
- if (aExtracting) {
- aEUt = 2;
- }
- else {
- aEUt = 1;
- }
- }
-
- // Set Item stacks correctly, invert if extraction recipe.
- if (aExtracting) {
- aInput = aFull;
- aOutput = aEmpty;
- aFluidInput = GT_Values.NF;
- aFluidOutput = aFluidIn;
- }
- else {
- aInput = aEmpty;
- aOutput = aFull;
- aFluidInput = aFluidIn;
- aFluidOutput = aFluidOut != null ? aFluidOut : GT_Values.NF;
- }
-
- //Check validity
-
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- true,
- new ItemStack[] { aInput },
- new ItemStack[] { aOutput },
- null,
- new int[] {10000},
- new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput },
- aDuration,
- aEUt,
- 0);
-
-
- // Check Valid
- boolean aTempValidityCheck = false;
- //Logger.INFO("Validity Check.");
- if (aExtracting) {
- Logger.INFO("Extracting.");
- if (aInput != null && aFluidOutput != null) {
- //Logger.INFO("Pass.");
- aTempValidityCheck = true;
- }
- }
- else {
- //Logger.INFO("Canning.");
- if (aInput != null && aOutput != null && (aFluidInput != null || aFluidOutput != null)) {
- //Logger.INFO("Pass.");
- aTempValidityCheck = true;
- }
- }
-
-
- if (aTempValidityCheck) {
- // Valid Recipe
- recipe = aRecipe;
- disableOptional = aExtracting;
- isValid = true;
- //Logger.INFO("Passed Validity Check. Hash: "+recipe.hashCode());
- //Logger.INFO("Mapped as: "+(disableOptional ? "Extracting" : "Canning"));
- addRunnableToRecipeCache(this);
- }
- else {
- //Logger.INFO("Failed Validity Check.");
- isValid = false;
- disableOptional = aExtracting;
- aRecipe.mEnabled = false;
- aRecipe.mHidden = true;
- recipe = null;
- }
- }
-
- @Override
- public void run() {
- Logger.INFO("Processing Recipe with Hash: "+recipe.hashCode());
- generateRecipes();
- }
-
- private void generateRecipes() {
- if (isValid && recipe != null) {
- //Logger.INFO("Processing "+(disableOptional ? "Extracting" : "Canning")+" Recipe.");
- if (this.disableOptional) {
- addFluidExtractionRecipe(recipe);
- }
- else {
- addFluidCannerRecipe(recipe);
- }
- }
- }
-
- private final boolean addFluidExtractionRecipe(GT_Recipe aRecipe) {
- boolean result = false;
- CORE.crash();
- Logger.INFO("[FE-Debug] "+aRecipe.mFluidOutputs[0].amount+"L of "+aRecipe.mFluidOutputs[0].getLocalizedName()+" fluid extractor from 1 " + aRecipe.mInputs[0].getDisplayName() + " - Success. Time: "+aRecipe.mDuration+", Voltage: "+aRecipe.mEUt);
- int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size();
- int aCount2 = aCount1;
- GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe);
- aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size();
- result = aCount1 > aCount2;
- if (result) {
- //Logger.INFO("[FIND] Added Extraction recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
- }
- else {
- Logger.INFO("[ERROR] Failed adding Extraction recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
- dumpStack();
- }
- return result;
- }
-
- private final boolean addFluidCannerRecipe(GT_Recipe aRecipe) {
- boolean result = false;
- int aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size();
- int aCount2 = aCount1;
- GT_Recipe_Map.sFluidCannerRecipes.addRecipe(aRecipe);
- aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size();
- result = aCount1 > aCount2;
- if (result) {
- //Logger.INFO("[FIND] Added Canning recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
- }
- else {
- Logger.INFO("[ERROR] Failed adding Canning recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
- dumpStack();
- }
- return result;
- }
-
- private void dumpStack() {
- int parents = 2;
- for (int i=0;i<6;i++) {
- Logger.INFO((disableOptional ? "EXTRACTING" : "CANNING")+" DEBUG | "+(i == 0 ? "Called from: " : "Parent: ")+ReflectionUtils.getMethodName(i+parents));
- }
-
- }
-
- private String buildLogString() {
- int solidSize = getMapSize(GT_Recipe_Map.sCannerRecipes);
- int fluidSize = getMapSize(GT_Recipe_Map.sFluidCannerRecipes);
- return (disableOptional ? "EXTRACTING" : "CANNING")+" DEBUG | Solids: "+solidSize+" | Liquids: "+fluidSize+" | ";
- }
-
- private final int getMapSize(GT_Recipe_Map aMap) {
- return aMap.mRecipeList.size();
- }
+ public static void init() {
+ FluidCanningRunnableHandler x = new FluidCanningRunnableHandler();
+ x.run();
+ }
+
+ private static class FluidCanningRunnableHandler implements RunnableWithInfo<String> {
+
+ @Override
+ public void run() {
+ mHasRun = true;
+ for (RecipeGen_FluidCanning aRecipe : mCache) {
+ aRecipe.run();
+ }
+ }
+
+ @Override
+ public String getInfoData() {
+ return "Fluid Canning Recipes";
+ }
+ }
+
+ private static boolean mHasRun = false;
+
+ private static HashSet<RecipeGen_FluidCanning> mCache = new HashSet<RecipeGen_FluidCanning>();
+
+ private static void addRunnableToRecipeCache(RecipeGen_FluidCanning r) {
+ if (mHasRun) {
+ CORE.crash();
+ }
+ mCache.add(r);
+ }
+
+ protected boolean disableOptional;
+
+ private final GT_Recipe recipe;
+ private final boolean isValid;
+
+ public boolean valid() {
+ return isValid;
+ }
+
+ public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid) {
+ this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, null, null);
+ }
+
+ public RecipeGen_FluidCanning(
+ boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, FluidStack aFluidOut) {
+ this(aExtracting, aEmpty, aFull, aFluidIn, aFluidOut, null, null);
+ }
+
+ public RecipeGen_FluidCanning(
+ boolean aExtracting,
+ ItemStack aEmpty,
+ ItemStack aFull,
+ FluidStack aFluid,
+ Integer aDuration,
+ Integer aEUt) {
+ this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, aDuration, aEUt);
+ }
+
+ // Alternative Constructor
+ public RecipeGen_FluidCanning(
+ boolean aExtracting,
+ ItemStack aEmpty,
+ ItemStack aFull,
+ FluidStack aFluidIn,
+ FluidStack aFluidOut,
+ Integer aDuration,
+ Integer aEUt) {
+ ItemStack aInput;
+ ItemStack aOutput;
+ FluidStack aFluidInput;
+ FluidStack aFluidOutput;
+
+ // Safety check on the duration
+ if (aDuration == null || aDuration <= 0) {
+ aDuration =
+ (aFluidIn != null) ? (aFluidIn.amount / 62) : ((aFluidOut != null) ? (aFluidOut.amount / 62) : 10);
+ }
+
+ // Safety check on the EU
+ if (aEUt == null || aEUt <= 0) {
+ if (aExtracting) {
+ aEUt = 2;
+ } else {
+ aEUt = 1;
+ }
+ }
+
+ // Set Item stacks correctly, invert if extraction recipe.
+ if (aExtracting) {
+ aInput = aFull;
+ aOutput = aEmpty;
+ aFluidInput = GT_Values.NF;
+ aFluidOutput = aFluidIn;
+ } else {
+ aInput = aEmpty;
+ aOutput = aFull;
+ aFluidInput = aFluidIn;
+ aFluidOutput = aFluidOut != null ? aFluidOut : GT_Values.NF;
+ }
+
+ // Check validity
+
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ true,
+ new ItemStack[] {aInput},
+ new ItemStack[] {aOutput},
+ null,
+ new int[] {10000},
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ aDuration,
+ aEUt,
+ 0);
+
+ // Check Valid
+ boolean aTempValidityCheck = false;
+ // Logger.INFO("Validity Check.");
+ if (aExtracting) {
+ Logger.INFO("Extracting.");
+ if (aInput != null && aFluidOutput != null) {
+ // Logger.INFO("Pass.");
+ aTempValidityCheck = true;
+ }
+ } else {
+ // Logger.INFO("Canning.");
+ if (aInput != null && aOutput != null && (aFluidInput != null || aFluidOutput != null)) {
+ // Logger.INFO("Pass.");
+ aTempValidityCheck = true;
+ }
+ }
+
+ if (aTempValidityCheck) {
+ // Valid Recipe
+ recipe = aRecipe;
+ disableOptional = aExtracting;
+ isValid = true;
+ // Logger.INFO("Passed Validity Check. Hash: "+recipe.hashCode());
+ // Logger.INFO("Mapped as: "+(disableOptional ? "Extracting" : "Canning"));
+ addRunnableToRecipeCache(this);
+ } else {
+ // Logger.INFO("Failed Validity Check.");
+ isValid = false;
+ disableOptional = aExtracting;
+ aRecipe.mEnabled = false;
+ aRecipe.mHidden = true;
+ recipe = null;
+ }
+ }
+
+ @Override
+ public void run() {
+ Logger.INFO("Processing Recipe with Hash: " + recipe.hashCode());
+ generateRecipes();
+ }
+
+ private void generateRecipes() {
+ if (isValid && recipe != null) {
+ // Logger.INFO("Processing "+(disableOptional ? "Extracting" : "Canning")+" Recipe.");
+ if (this.disableOptional) {
+ addFluidExtractionRecipe(recipe);
+ } else {
+ addFluidCannerRecipe(recipe);
+ }
+ }
+ }
+
+ private final boolean addFluidExtractionRecipe(GT_Recipe aRecipe) {
+ boolean result = false;
+ CORE.crash();
+ Logger.INFO(
+ "[FE-Debug] " + aRecipe.mFluidOutputs[0].amount + "L of " + aRecipe.mFluidOutputs[0].getLocalizedName()
+ + " fluid extractor from 1 " + aRecipe.mInputs[0].getDisplayName() + " - Success. Time: "
+ + aRecipe.mDuration + ", Voltage: " + aRecipe.mEUt);
+ int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size();
+ int aCount2 = aCount1;
+ GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe);
+ aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size();
+ result = aCount1 > aCount2;
+ if (result) {
+ // Logger.INFO("[FIND] Added Extraction recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+",
+ // "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+",
+ // "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+",
+ // "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
+ } else {
+ Logger.INFO("[ERROR] Failed adding Extraction recipe for " + ItemUtils.getArrayStackNames(aRecipe.mInputs)
+ + ", " + ItemUtils.getArrayStackNames(aRecipe.mOutputs) + ", "
+ + ItemUtils.getArrayStackNames(aRecipe.mFluidInputs) + ", "
+ + ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
+ dumpStack();
+ }
+ return result;
+ }
+
+ private final boolean addFluidCannerRecipe(GT_Recipe aRecipe) {
+ boolean result = false;
+ int aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size();
+ int aCount2 = aCount1;
+ GT_Recipe_Map.sFluidCannerRecipes.addRecipe(aRecipe);
+ aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size();
+ result = aCount1 > aCount2;
+ if (result) {
+ // Logger.INFO("[FIND] Added Canning recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+",
+ // "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+",
+ // "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+",
+ // "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
+ } else {
+ Logger.INFO("[ERROR] Failed adding Canning recipe for " + ItemUtils.getArrayStackNames(aRecipe.mInputs)
+ + ", " + ItemUtils.getArrayStackNames(aRecipe.mOutputs) + ", "
+ + ItemUtils.getArrayStackNames(aRecipe.mFluidInputs) + ", "
+ + ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
+ dumpStack();
+ }
+ return result;
+ }
+
+ private void dumpStack() {
+ int parents = 2;
+ for (int i = 0; i < 6; i++) {
+ Logger.INFO((disableOptional ? "EXTRACTING" : "CANNING") + " DEBUG | "
+ + (i == 0 ? "Called from: " : "Parent: ") + ReflectionUtils.getMethodName(i + parents));
+ }
+ }
+
+ private String buildLogString() {
+ int solidSize = getMapSize(GT_Recipe_Map.sCannerRecipes);
+ int fluidSize = getMapSize(GT_Recipe_Map.sFluidCannerRecipes);
+ return (disableOptional ? "EXTRACTING" : "CANNING") + " DEBUG | Solids: " + solidSize + " | Liquids: "
+ + fluidSize + " | ";
+ }
+
+ private final int getMapSize(GT_Recipe_Map aMap) {
+ return aMap.mRecipeList.size();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java
index 0661ea5ea4..50827ae39a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java
@@ -1,240 +1,252 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashSet;
+import java.util.Set;
public class RecipeGen_Fluids extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- private static boolean mRotorShapeEnabled = false;
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- mRotorShapeEnabled = ItemUtils.doesItemListEntryExist("Shape_Extruder_Rotor");
- }
-
- public RecipeGen_Fluids(final Material M) {
- this(M, false);
- }
-
- public RecipeGen_Fluids(final Material M, final boolean dO) {
- this.toGenerate = M;
- this.disableOptional = dO;
- mRecipeGenMap.add(this);
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate, this.disableOptional);
- }
-
- private void generateRecipes(final Material material, final boolean dO) {
-
- if (material == null) {
- return;
- }
-
- // Melting Shapes to fluid
- if (material.getFluidStack(1) != null
- && !material.getFluidStack(1).getUnlocalizedName().toLowerCase().contains("plasma")) {
-
- // Making Shapes from fluid
-
- // Ingot
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)))
- if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), // Item Shape
- material.getFluidStack(144), // Fluid Input
- material.getIngot(1), // output
- 32, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING(
- "144l fluid molder for 1 ingot Recipe: " + material.getLocalizedName() + " - Success");
- } else {
- Logger.WARNING(
- "144l fluid molder for 1 ingot Recipe: " + material.getLocalizedName() + " - Failed");
- }
-
- // Plate
- if (ItemUtils.checkForInvalidItems(material.getPlate(1)))
- if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Plate.get(0), // Item Shape
- material.getFluidStack(144), // Fluid Input
- material.getPlate(1), // output
- 32, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING(
- "144l fluid molder for 1 plate Recipe: " + material.getLocalizedName() + " - Success");
- } else {
- Logger.WARNING(
- "144l fluid molder for 1 plate Recipe: " + material.getLocalizedName() + " - Failed");
- }
-
- // Nugget
- if (ItemUtils.checkForInvalidItems(material.getNugget(1)))
- if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), // Item Shape
- material.getFluidStack(16), // Fluid Input
- material.getNugget(1), // output
- 16, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING(
- "16l fluid molder for 1 nugget Recipe: " + material.getLocalizedName() + " - Success");
- } else {
- Logger.WARNING(
- "16l fluid molder for 1 nugget Recipe: " + material.getLocalizedName() + " - Failed");
- }
-
- // Gears
- if (ItemUtils.checkForInvalidItems(material.getGear(1)))
- if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0), // Item Shape
- material.getFluidStack(576), // Fluid Input
- material.getGear(1), // output
- 128, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING(
- "576l fluid molder for 1 gear Recipe: " + material.getLocalizedName() + " - Success");
- } else {
- Logger.WARNING("576l fluid molder for 1 gear Recipe: " + material.getLocalizedName() + " - Failed");
- }
-
- // Blocks
- if (ItemUtils.checkForInvalidItems(material.getBlock(1)))
- if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), // Item Shape
- material.getFluidStack(144 * 9), // Fluid Input
- material.getBlock(1), // output
- 288, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 block Recipe: " + material.getLocalizedName()
- + " - Success");
- } else {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 block Recipe: " + material.getLocalizedName()
- + " - Failed");
- }
-
- if (CORE.GTNH) {
-
- // GTNH
-
- // Shape_Mold_Rod
- // Shape_Mold_Rod_Long
- // Shape_Mold_Bolt,
- // Shape_Mold_Screw,
- // Shape_Mold_Ring,
-
-
- ItemList mold_Rod = ItemUtils.getValueOfItemList("Shape_Mold_Rod", null);
- ItemList mold_Rod_Long = ItemUtils.getValueOfItemList("Shape_Mold_Rod_Long", null);
- ItemList mold_Bolt = ItemUtils.getValueOfItemList("Shape_Mold_Bolt", null);
- ItemList mold_Screw = ItemUtils.getValueOfItemList("Shape_Mold_Screw", null);
- ItemList mold_Ring = ItemUtils.getValueOfItemList("Shape_Mold_Ring", null);
- ItemList mold_Rotor = ItemUtils.getValueOfItemList("Shape_Mold_Rotor", null);
-
- // Rod
- if (ItemUtils.checkForInvalidItems(material.getRod(1)))
- if (mold_Rod != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Rod.get(0), // Item Shape
- material.getFluidStack(72), // Fluid Input
- material.getRod(1), // output
- 150, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 rod Recipe: " + material.getLocalizedName()
- + " - Success");
- } else {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 rod Recipe: " + material.getLocalizedName()
- + " - Failed");
- }
-
- // Rod Long
- if (ItemUtils.checkForInvalidItems(material.getLongRod(1)))
- if (mold_Rod_Long != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Rod_Long.get(0), // Item
- // Shape
- material.getFluidStack(144), // Fluid Input
- material.getLongRod(1), // output
- 300, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 rod long Recipe: "
- + material.getLocalizedName() + " - Success");
- } else {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 rod long Recipe: "
- + material.getLocalizedName() + " - Failed");
- }
-
- // Bolt
- if (ItemUtils.checkForInvalidItems(material.getBolt(1)))
- if (mold_Bolt != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Bolt.get(0), // Item Shape
- material.getFluidStack(18), // Fluid Input
- material.getBolt(1), // output
- 50, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 bolt Recipe: " + material.getLocalizedName()
- + " - Success");
- } else {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 bolt Recipe: " + material.getLocalizedName()
- + " - Failed");
- }
-
- // Screw
- if (ItemUtils.checkForInvalidItems(material.getScrew(1)))
- if (mold_Screw != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Screw.get(0), // Item Shape
- material.getFluidStack(18), // Fluid Input
- material.getScrew(1), // output
- 50, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 screw Recipe: " + material.getLocalizedName()
- + " - Success");
- } else {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 screw Recipe: " + material.getLocalizedName()
- + " - Failed");
- }
-
- // Ring
- if (ItemUtils.checkForInvalidItems(material.getRing(1)))
- if (mold_Ring != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Ring.get(0), // Item Shape
- material.getFluidStack(36), // Fluid Input
- material.getRing(1), // output
- 100, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 ring Recipe: " + material.getLocalizedName()
- + " - Success");
- } else {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 ring Recipe: " + material.getLocalizedName()
- + " - Failed");
- }
-
- // Rotor
- if (ItemUtils.checkForInvalidItems(material.getRotor(1)))
- if (mold_Rotor != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Rotor.get(0), // Item Shape
- material.getFluidStack(612), // Fluid Input
- material.getRotor(1), // output
- 100, // Duration
- material.vVoltageMultiplier // Eu Tick
- )) {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 rotor Recipe: " + material.getLocalizedName()
- + " - Success");
- } else {
- Logger.WARNING((144 * 9) + "l fluid molder from 1 rotor Recipe: " + material.getLocalizedName()
- + " - Failed");
- }
-
-
- }
- }
- }
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+ private static boolean mRotorShapeEnabled = false;
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ mRotorShapeEnabled = ItemUtils.doesItemListEntryExist("Shape_Extruder_Rotor");
+ }
+
+ public RecipeGen_Fluids(final Material M) {
+ this(M, false);
+ }
+
+ public RecipeGen_Fluids(final Material M, final boolean dO) {
+ this.toGenerate = M;
+ this.disableOptional = dO;
+ mRecipeGenMap.add(this);
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate, this.disableOptional);
+ }
+
+ private void generateRecipes(final Material material, final boolean dO) {
+
+ if (material == null) {
+ return;
+ }
+
+ // Melting Shapes to fluid
+ if (material.getFluidStack(1) != null
+ && !material.getFluidStack(1).getUnlocalizedName().toLowerCase().contains("plasma")) {
+
+ // Making Shapes from fluid
+
+ // Ingot
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1)))
+ if (GT_Values.RA.addFluidSolidifierRecipe(
+ ItemList.Shape_Mold_Ingot.get(0), // Item Shape
+ material.getFluidStack(144), // Fluid Input
+ material.getIngot(1), // output
+ 32, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING(
+ "144l fluid molder for 1 ingot Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING(
+ "144l fluid molder for 1 ingot Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Plate
+ if (ItemUtils.checkForInvalidItems(material.getPlate(1)))
+ if (GT_Values.RA.addFluidSolidifierRecipe(
+ ItemList.Shape_Mold_Plate.get(0), // Item Shape
+ material.getFluidStack(144), // Fluid Input
+ material.getPlate(1), // output
+ 32, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING(
+ "144l fluid molder for 1 plate Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING(
+ "144l fluid molder for 1 plate Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Nugget
+ if (ItemUtils.checkForInvalidItems(material.getNugget(1)))
+ if (GT_Values.RA.addFluidSolidifierRecipe(
+ ItemList.Shape_Mold_Nugget.get(0), // Item Shape
+ material.getFluidStack(16), // Fluid Input
+ material.getNugget(1), // output
+ 16, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING(
+ "16l fluid molder for 1 nugget Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING(
+ "16l fluid molder for 1 nugget Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Gears
+ if (ItemUtils.checkForInvalidItems(material.getGear(1)))
+ if (GT_Values.RA.addFluidSolidifierRecipe(
+ ItemList.Shape_Mold_Gear.get(0), // Item Shape
+ material.getFluidStack(576), // Fluid Input
+ material.getGear(1), // output
+ 128, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING(
+ "576l fluid molder for 1 gear Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("576l fluid molder for 1 gear Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Blocks
+ if (ItemUtils.checkForInvalidItems(material.getBlock(1)))
+ if (GT_Values.RA.addFluidSolidifierRecipe(
+ ItemList.Shape_Mold_Block.get(0), // Item Shape
+ material.getFluidStack(144 * 9), // Fluid Input
+ material.getBlock(1), // output
+ 288, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 block Recipe: " + material.getLocalizedName()
+ + " - Success");
+ } else {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 block Recipe: " + material.getLocalizedName()
+ + " - Failed");
+ }
+
+ if (CORE.GTNH) {
+
+ // GTNH
+
+ // Shape_Mold_Rod
+ // Shape_Mold_Rod_Long
+ // Shape_Mold_Bolt,
+ // Shape_Mold_Screw,
+ // Shape_Mold_Ring,
+
+ ItemList mold_Rod = ItemUtils.getValueOfItemList("Shape_Mold_Rod", null);
+ ItemList mold_Rod_Long = ItemUtils.getValueOfItemList("Shape_Mold_Rod_Long", null);
+ ItemList mold_Bolt = ItemUtils.getValueOfItemList("Shape_Mold_Bolt", null);
+ ItemList mold_Screw = ItemUtils.getValueOfItemList("Shape_Mold_Screw", null);
+ ItemList mold_Ring = ItemUtils.getValueOfItemList("Shape_Mold_Ring", null);
+ ItemList mold_Rotor = ItemUtils.getValueOfItemList("Shape_Mold_Rotor", null);
+
+ // Rod
+ if (ItemUtils.checkForInvalidItems(material.getRod(1)))
+ if (mold_Rod != null
+ && GT_Values.RA.addFluidSolidifierRecipe(
+ mold_Rod.get(0), // Item Shape
+ material.getFluidStack(72), // Fluid Input
+ material.getRod(1), // output
+ 150, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 rod Recipe: " + material.getLocalizedName()
+ + " - Success");
+ } else {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 rod Recipe: " + material.getLocalizedName()
+ + " - Failed");
+ }
+
+ // Rod Long
+ if (ItemUtils.checkForInvalidItems(material.getLongRod(1)))
+ if (mold_Rod_Long != null
+ && GT_Values.RA.addFluidSolidifierRecipe(
+ mold_Rod_Long.get(0), // Item
+ // Shape
+ material.getFluidStack(144), // Fluid Input
+ material.getLongRod(1), // output
+ 300, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 rod long Recipe: "
+ + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 rod long Recipe: "
+ + material.getLocalizedName() + " - Failed");
+ }
+
+ // Bolt
+ if (ItemUtils.checkForInvalidItems(material.getBolt(1)))
+ if (mold_Bolt != null
+ && GT_Values.RA.addFluidSolidifierRecipe(
+ mold_Bolt.get(0), // Item Shape
+ material.getFluidStack(18), // Fluid Input
+ material.getBolt(1), // output
+ 50, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 bolt Recipe: " + material.getLocalizedName()
+ + " - Success");
+ } else {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 bolt Recipe: " + material.getLocalizedName()
+ + " - Failed");
+ }
+
+ // Screw
+ if (ItemUtils.checkForInvalidItems(material.getScrew(1)))
+ if (mold_Screw != null
+ && GT_Values.RA.addFluidSolidifierRecipe(
+ mold_Screw.get(0), // Item Shape
+ material.getFluidStack(18), // Fluid Input
+ material.getScrew(1), // output
+ 50, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 screw Recipe: " + material.getLocalizedName()
+ + " - Success");
+ } else {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 screw Recipe: " + material.getLocalizedName()
+ + " - Failed");
+ }
+
+ // Ring
+ if (ItemUtils.checkForInvalidItems(material.getRing(1)))
+ if (mold_Ring != null
+ && GT_Values.RA.addFluidSolidifierRecipe(
+ mold_Ring.get(0), // Item Shape
+ material.getFluidStack(36), // Fluid Input
+ material.getRing(1), // output
+ 100, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 ring Recipe: " + material.getLocalizedName()
+ + " - Success");
+ } else {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 ring Recipe: " + material.getLocalizedName()
+ + " - Failed");
+ }
+
+ // Rotor
+ if (ItemUtils.checkForInvalidItems(material.getRotor(1)))
+ if (mold_Rotor != null
+ && GT_Values.RA.addFluidSolidifierRecipe(
+ mold_Rotor.get(0), // Item Shape
+ material.getFluidStack(612), // Fluid Input
+ material.getRotor(1), // output
+ 100, // Duration
+ material.vVoltageMultiplier // Eu Tick
+ )) {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 rotor Recipe: " + material.getLocalizedName()
+ + " - Success");
+ } else {
+ Logger.WARNING((144 * 9) + "l fluid molder from 1 rotor Recipe: " + material.getLocalizedName()
+ + " - Failed");
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java
index b285d41652..67819c8699 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java
@@ -1,224 +1,242 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
-import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.nuclear.FLUORIDES;
-import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import java.util.HashSet;
+import java.util.Set;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeGen_Fluorite extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
-
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
-
- public RecipeGen_Fluorite(final Material material){
- this.toGenerate = material;
- mRecipeGenMap.add(this);
-
-
- /**
- * Shaped Crafting
- */
- RecipeUtils.addShapedRecipe(
- CI.craftingToolHammer_Hard, null, null,
- material.getCrushedPurified(1), null, null,
- null, null, null,
- material.getDustPurified(1));
-
- RecipeUtils.addShapedRecipe(
- CI.craftingToolHammer_Hard, null, null,
- material.getCrushed(1), null, null,
- null, null, null,
- material.getDustImpure(1));
-
- RecipeUtils.addShapedRecipe(
- CI.craftingToolHammer_Hard, null, null,
- material.getCrushedCentrifuged(1), null, null,
- null, null, null,
- material.getDust(1));
-
-
-
- final ItemStack normalDust = material.getDust(1);
- final ItemStack smallDust = material.getSmallDust(1);
- final ItemStack tinyDust = material.getTinyDust(1);
-
- if (RecipeUtils.addShapedRecipe(
- tinyDust, tinyDust, tinyDust,
- tinyDust, tinyDust, tinyDust,
- tinyDust, tinyDust, tinyDust,
- normalDust)){
- Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- if (RecipeUtils.addShapedRecipe(
- normalDust, null, null,
- null, null, null,
- null, null, null,
- material.getTinyDust(9))){
- Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- if (RecipeUtils.addShapedRecipe(
- smallDust, smallDust, null,
- smallDust, smallDust, null,
- null, null, null,
- normalDust)){
- Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- if (RecipeUtils.addShapedRecipe(
- null, normalDust, null,
- null, null, null,
- null, null, null,
- material.getSmallDust(4))){
- Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate);
- }
-
- public static void generateRecipes(final Material material){
-
- int tVoltageMultiplier = MaterialUtils.getVoltageForTier(material.vTier);
-
- final ItemStack dustStone = ItemUtils.getItemStackOfAmountFromOreDict("dustStone", 1);
-
-
- ItemStack tinyDustA = FLUORIDES.FLUORITE.getTinyDust(1);
- ItemStack tinyDustB = FLUORIDES.FLUORITE.getTinyDust(1);
- ItemStack matDust = FLUORIDES.FLUORITE.getDust(1);
- ItemStack matDustA = FLUORIDES.FLUORITE.getDust(1);
-
- /**
- * Package
- */
- //Allow ore dusts to be packaged
- if (ItemUtils.checkForInvalidItems(material.getSmallDust(1)) && ItemUtils.checkForInvalidItems(material.getTinyDust(1))) {
- RecipeGen_DustGeneration.generatePackagerRecipes(material);
- }
-
-
- /**
- * Macerate
- */
- //Macerate ore to Crushed
- if (GT_Values.RA.addPulveriserRecipe(material.getOre(1), new ItemStack[]{material.getCrushed(2)}, new int[]{10000}, 20*20, tVoltageMultiplier/2)){
- Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'");
- }
- //Macerate Centrifuged to Pure Dust
- if (GT_Values.RA.addPulveriserRecipe(material.getCrushedCentrifuged(1), new ItemStack[]{matDust, matDustA}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){
- Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'");
- }
- if (GT_ModHandler.addThermalCentrifugeRecipe(material.getCrushedPurified(1), (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), material.getCrushedCentrifuged(1), tinyDustA, dustStone)){
- Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: "+material.getCrushedPurified(1).getDisplayName()+" | Outputs: "+material.getCrushedCentrifuged(1).getDisplayName()+", "+tinyDustA.getDisplayName()+", "+dustStone.getDisplayName()+".");
- }
-
- GT_Values.RA.addChemicalBathRecipe(
- FLUORIDES.FLUORITE.getCrushed(2),
- FluidUtils.getFluidStack("hydrogen", 2000),
- FLUORIDES.FLUORITE.getCrushedPurified(8),
- FLUORIDES.FLUORITE.getDustImpure(4),
- FLUORIDES.FLUORITE.getDustPurified(2),
- new int[] { 10000, 5000, 1000 },
- 30 * 20,
- 240);
-
- /**
- * Forge Hammer
- */
- if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), matDust, 10, tVoltageMultiplier/4)){
- Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'");
- }
-
- /**
- * Centrifuge
- */
- //Purified Dust to Clean
- if (GT_Values.RA.addCentrifugeRecipe(
- material.getDustPurified(1), null,
- null, //In Fluid
- null, //Out Fluid
- matDust, tinyDustA,null,
- null, null,null,
- new int[]{10000, 10000}, //Chances
- (int) Math.max(1L, material.getMass() * 8L), //Time
- tVoltageMultiplier/2)){ //Eu
- Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust");
- }
-
- //Impure Dust to Clean
- if (GT_Values.RA.addCentrifugeRecipe(
- material.getDustImpure(1), null,
- null, //In Fluid
- null, //Out Fluid
- matDust, tinyDustB,null,
- null, null,null,
- new int[]{10000, 10000}, //Chances
- (int) Math.max(1L, material.getMass() * 8L), //Time
- tVoltageMultiplier/2)){ //Eu
- Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust");
- }
-
- // CaF2 + H2SO4 → CaSO4(solid) + 2 HF
- FluidStack aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 16000);
- if (aGregtechHydro == null) {
- aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid", 16000);
- }
-
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(5),
- FLUORIDES.FLUORITE.getDust(37),
- },
- FluidUtils.getFluidStack("sulfuricacid", 8000),
- aGregtechHydro, // Fluid output (slot 2)
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumSulfate", 15),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustGold", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 2)
- },
- new int[] { 10000, 1000, 1000, 3000, 2000 },
- 10 * 60 * 20,
- 240); // EU
-
- }
-
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_Fluorite(final Material material) {
+ this.toGenerate = material;
+ mRecipeGenMap.add(this);
+
+ /**
+ * Shaped Crafting
+ */
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard,
+ null,
+ null,
+ material.getCrushedPurified(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getDustPurified(1));
+
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard,
+ null,
+ null,
+ material.getCrushed(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getDustImpure(1));
+
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard,
+ null,
+ null,
+ material.getCrushedCentrifuged(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getDust(1));
+
+ final ItemStack normalDust = material.getDust(1);
+ final ItemStack smallDust = material.getSmallDust(1);
+ final ItemStack tinyDust = material.getTinyDust(1);
+
+ if (RecipeUtils.addShapedRecipe(
+ tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, normalDust)) {
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ normalDust, null, null, null, null, null, null, null, null, material.getTinyDust(9))) {
+ Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, normalDust)) {
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ null, normalDust, null, null, null, null, null, null, null, material.getSmallDust(4))) {
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate);
+ }
+
+ public static void generateRecipes(final Material material) {
+
+ int tVoltageMultiplier = MaterialUtils.getVoltageForTier(material.vTier);
+
+ final ItemStack dustStone = ItemUtils.getItemStackOfAmountFromOreDict("dustStone", 1);
+
+ ItemStack tinyDustA = FLUORIDES.FLUORITE.getTinyDust(1);
+ ItemStack tinyDustB = FLUORIDES.FLUORITE.getTinyDust(1);
+ ItemStack matDust = FLUORIDES.FLUORITE.getDust(1);
+ ItemStack matDustA = FLUORIDES.FLUORITE.getDust(1);
+
+ /**
+ * Package
+ */
+ // Allow ore dusts to be packaged
+ if (ItemUtils.checkForInvalidItems(material.getSmallDust(1))
+ && ItemUtils.checkForInvalidItems(material.getTinyDust(1))) {
+ RecipeGen_DustGeneration.generatePackagerRecipes(material);
+ }
+
+ /**
+ * Macerate
+ */
+ // Macerate ore to Crushed
+ if (GT_Values.RA.addPulveriserRecipe(
+ material.getOre(1),
+ new ItemStack[] {material.getCrushed(2)},
+ new int[] {10000},
+ 20 * 20,
+ tVoltageMultiplier / 2)) {
+ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'");
+ }
+ // Macerate Centrifuged to Pure Dust
+ if (GT_Values.RA.addPulveriserRecipe(
+ material.getCrushedCentrifuged(1),
+ new ItemStack[] {matDust, matDustA},
+ new int[] {10000, 1000},
+ 20 * 20,
+ tVoltageMultiplier / 2)) {
+ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'");
+ }
+ if (GT_ModHandler.addThermalCentrifugeRecipe(
+ material.getCrushedPurified(1),
+ (int) Math.min(5000L, Math.abs(material.getMass() * 20L)),
+ material.getCrushedCentrifuged(1),
+ tinyDustA,
+ dustStone)) {
+ Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: "
+ + material.getCrushedPurified(1).getDisplayName() + " | Outputs: "
+ + material.getCrushedCentrifuged(1).getDisplayName() + ", " + tinyDustA.getDisplayName() + ", "
+ + dustStone.getDisplayName() + ".");
+ }
+
+ GT_Values.RA.addChemicalBathRecipe(
+ FLUORIDES.FLUORITE.getCrushed(2),
+ FluidUtils.getFluidStack("hydrogen", 2000),
+ FLUORIDES.FLUORITE.getCrushedPurified(8),
+ FLUORIDES.FLUORITE.getDustImpure(4),
+ FLUORIDES.FLUORITE.getDustPurified(2),
+ new int[] {10000, 5000, 1000},
+ 30 * 20,
+ 240);
+
+ /**
+ * Forge Hammer
+ */
+ if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), matDust, 10, tVoltageMultiplier / 4)) {
+ Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'");
+ }
+
+ /**
+ * Centrifuge
+ */
+ // Purified Dust to Clean
+ if (GT_Values.RA.addCentrifugeRecipe(
+ material.getDustPurified(1),
+ null,
+ null, // In Fluid
+ null, // Out Fluid
+ matDust,
+ tinyDustA,
+ null,
+ null,
+ null,
+ null,
+ new int[] {10000, 10000}, // Chances
+ (int) Math.max(1L, material.getMass() * 8L), // Time
+ tVoltageMultiplier / 2)) { // Eu
+ Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust");
+ }
+
+ // Impure Dust to Clean
+ if (GT_Values.RA.addCentrifugeRecipe(
+ material.getDustImpure(1),
+ null,
+ null, // In Fluid
+ null, // Out Fluid
+ matDust,
+ tinyDustB,
+ null,
+ null,
+ null,
+ null,
+ new int[] {10000, 10000}, // Chances
+ (int) Math.max(1L, material.getMass() * 8L), // Time
+ tVoltageMultiplier / 2)) { // Eu
+ Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust");
+ }
+
+ // CaF2 + H2SO4 → CaSO4(solid) + 2 HF
+ FluidStack aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 16000);
+ if (aGregtechHydro == null) {
+ aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid", 16000);
+ }
+
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(5), FLUORIDES.FLUORITE.getDust(37),
+ },
+ FluidUtils.getFluidStack("sulfuricacid", 8000),
+ aGregtechHydro, // Fluid output (slot 2)
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumSulfate", 15),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustGold", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 2)
+ },
+ new int[] {10000, 1000, 1000, 3000, 2000},
+ 10 * 60 * 20,
+ 240); // EU
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java
index 92d7f73ba4..958c97c652 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.enums.GT_Values;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
@@ -15,246 +12,267 @@ import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashSet;
+import java.util.Set;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeGen_MaterialProcessing extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
-
- public RecipeGen_MaterialProcessing(final Material M){
- this(M, false);
- }
-
- public RecipeGen_MaterialProcessing(final Material M, final boolean O){
- this.toGenerate = M;
- this.disableOptional = O;
- mRecipeGenMap.add(this);
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate, this.disableOptional);
- }
-
- private void generateRecipes(final Material material, final boolean disableOptional){
- if (disableOptional) {
- return;
- }
-
- if (material.getMaterialComposites().length > 1){
- Logger.MATERIALS("[Recipe Generator Debug] ["+material.getLocalizedName()+"]");
- final int tVoltageMultiplier = material.vVoltageMultiplier;
- int[] partSizes = new int[99];
- if (material.vSmallestRatio != null) {
- partSizes = new int[material.vSmallestRatio.length];
- for (int hu=0;hu<material.vSmallestRatio.length;hu++){
- partSizes[hu] = (int) material.vSmallestRatio[hu];
- }
- }
- AutoMap<Pair<Integer, Material>> componentMap = new AutoMap<Pair<Integer, Material>>();
- int alnsnfds = 0;
- for (MaterialStack r : material.getComposites()){
- if (r != null){
- componentMap.put(new Pair<Integer, Material>(partSizes[alnsnfds], r.getStackMaterial()));
- }
- alnsnfds++;
- }
-
-
-
-
-
- /**
- * Centrifuge
- */
-
- //Process Dust
- if (componentMap.size() > 0 && componentMap.size() <= 6){
- ItemStack mInternalOutputs[] = new ItemStack[6];
- int mChances[] = new int[6];
- int mCellCount = 0;
-
- int mTotalCount = 0;
-
- int mCounter = 0;
- for (Pair<Integer, Material> f : componentMap){
- if (f.getValue().getState() != MaterialState.SOLID){
- Logger.MATERIALS("[Centrifuge] Found Fluid Component, adding "+f.getKey()+" cells of "+f.getValue().getLocalizedName()+".");
- mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey());
- mCellCount += f.getKey();
- mTotalCount += f.getKey();
- Logger.MATERIALS("[Centrifuge] In total, adding "+mCellCount+" cells for "+material.getLocalizedName()+" processing.");
- }
- else {
- Logger.MATERIALS("[Centrifuge] Found Solid Component, adding "+f.getKey()+" dusts of "+f.getValue().getLocalizedName()+".");
- mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey());
- mTotalCount += f.getKey();
- }
- }
-
- //Build Output Array
- for (int g=0;g<mInternalOutputs.length;g++){
- Logger.MATERIALS("[Centrifuge] Is output["+g+"] valid with a chance? "+(mInternalOutputs[g] != null ? 10000 : 0));
- mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0);
- }
-
- ItemStack emptyCell = null;
- if (mCellCount > 0){
- emptyCell = ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", mCellCount);
- Logger.MATERIALS("[Centrifuge] Recipe now requires "+mCellCount+" empty cells as input.");
- }
-
- ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing);
- if (mainDust != null){
- Logger.MATERIALS("[Centrifuge] Recipe now requires "+material.smallestStackSizeWhenProcessing+"x "+mainDust.getDisplayName()+" as input.");
- }
- else {
- mainDust = material.getDust(mTotalCount);
- Logger.MATERIALS("[Centrifuge] Could not find valid input dust, trying alternative.");
- if (mainDust != null){
- Logger.MATERIALS("[Centrifuge] Recipe now requires "+mTotalCount+"x "+mainDust.getDisplayName()+" as input.");
- }
- else {
- Logger.MATERIALS("[Centrifuge] Could not find valid input dust, exiting.");
- }
- }
-
- for (int j=0;j<mInternalOutputs.length;j++){
- if (mInternalOutputs[j] == null){
- mInternalOutputs[j] = GT_Values.NI;
- Logger.MATERIALS("[Centrifuge] Set slot "+j+" to null.");
- }
- else {
- Logger.MATERIALS("[Centrifuge] Set slot "+j+" to "+mInternalOutputs[j].getDisplayName()+".");
- }
- }
-
- try{
- if (addCentrifgeRecipe(
- mainDust,
- emptyCell, //input 2
- null, //Input fluid 1
- null, //Output fluid 1
- mInternalOutputs[0],
- mInternalOutputs[1],
- mInternalOutputs[2],
- mInternalOutputs[3],
- mInternalOutputs[4],
- mInternalOutputs[5],
- mChances,
- 20*1*(tVoltageMultiplier/10),
- tVoltageMultiplier)){
- Logger.MATERIALS("[Centrifuge] Generated Centrifuge recipe for "+material.getDust(1).getDisplayName());
- }
- else {
- Logger.MATERIALS("[Centrifuge] Failed to generate Centrifuge recipe for "+material.getDust(1).getDisplayName());
- }
- }
- catch(Throwable t){
- t.printStackTrace();
- }
- }
- else if (componentMap.size() > 6 && componentMap.size() <= 9){
- Logger.MATERIALS("[Issue][Electrolyzer] "+material.getLocalizedName()+" is composed of over 6 materials, so an electrolyzer recipe for processing cannot be generated. Trying to create one for the Dehydrator instead.");
-
- ItemStack mInternalOutputs[] = new ItemStack[9];
- int mChances[] = new int[9];
- int mCellCount = 0;
-
- int mTotalCount = 0;
-
- int mCounter = 0;
- for (Pair<Integer, Material> f : componentMap){
- if (f.getValue().getState() != MaterialState.SOLID){
- Logger.MATERIALS("[Dehydrator] Found Fluid Component, adding "+f.getKey()+" cells of "+f.getValue().getLocalizedName()+".");
- mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey());
- mCellCount += f.getKey();
- mTotalCount += f.getKey();
- Logger.MATERIALS("[Dehydrator] In total, adding "+mCellCount+" cells for "+material.getLocalizedName()+" processing.");
- }
- else {
- Logger.MATERIALS("[Dehydrator] Found Solid Component, adding "+f.getKey()+" dusts of "+f.getValue().getLocalizedName()+".");
- mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey());
- mTotalCount += f.getKey();
- }
- }
-
- //Build Output Array
- for (int g=0;g<mInternalOutputs.length;g++){
- Logger.MATERIALS("[Dehydrator] Is output["+g+"] valid with a chance? "+(mInternalOutputs[g] != null ? 10000 : 0));
- mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0);
- }
-
- ItemStack emptyCell = null;
- if (mCellCount > 0){
- emptyCell = CI.emptyCells(mCellCount);
- Logger.MATERIALS("[Dehydrator] Recipe now requires "+mCellCount+" empty cells as input.");
- }
-
- ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing);
- if (mainDust != null){
- Logger.MATERIALS("[Dehydrator] Recipe now requires "+material.smallestStackSizeWhenProcessing+"x "+mainDust.getDisplayName()+" as input.");
- }
- else {
- mainDust = material.getDust(mTotalCount);
- Logger.MATERIALS("[Dehydrator] Could not find valid input dust, trying alternative.");
- if (mainDust != null){
- Logger.MATERIALS("[Dehydrator] Recipe now requires "+mTotalCount+"x "+mainDust.getDisplayName()+" as input.");
- }
- else {
- Logger.MATERIALS("[Dehydrator] Could not find valid input dust, exiting.");
- }
- }
-
- for (int j=0;j<mInternalOutputs.length;j++){
- if (mInternalOutputs[j] == null){
- mInternalOutputs[j] = GT_Values.NI;
- Logger.MATERIALS("[Dehydrator] Set slot "+j+" to null.");
- }
- else {
- Logger.MATERIALS("[Dehydrator] Set slot "+j+" to "+mInternalOutputs[j].getDisplayName()+".");
- }
- }
-
- try{
-
-
- if (CORE.RA.addDehydratorRecipe(
- new ItemStack[]{mainDust, emptyCell},
- null,
- null,
- mInternalOutputs,
- mChances,
- 20*1*(tVoltageMultiplier/10),
- tVoltageMultiplier)){
- Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for "+material.getDust(1).getDisplayName());
- }
- else {
- Logger.MATERIALS("[Dehydrator] Failed to generate Dehydrator recipe for "+material.getDust(1).getDisplayName());
- }
- }
- catch(Throwable t){
- t.printStackTrace();
- }
-
-
- }
-
-
-
-
-
-
-
- }
- }
-
- public static boolean addCentrifgeRecipe(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) {
- return GT_Values.RA.addCentrifugeRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, aChances, aDuration, aEUt);
- }
-
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_MaterialProcessing(final Material M) {
+ this(M, false);
+ }
+
+ public RecipeGen_MaterialProcessing(final Material M, final boolean O) {
+ this.toGenerate = M;
+ this.disableOptional = O;
+ mRecipeGenMap.add(this);
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate, this.disableOptional);
+ }
+
+ private void generateRecipes(final Material material, final boolean disableOptional) {
+ if (disableOptional) {
+ return;
+ }
+
+ if (material.getMaterialComposites().length > 1) {
+ Logger.MATERIALS("[Recipe Generator Debug] [" + material.getLocalizedName() + "]");
+ final int tVoltageMultiplier = material.vVoltageMultiplier;
+ int[] partSizes = new int[99];
+ if (material.vSmallestRatio != null) {
+ partSizes = new int[material.vSmallestRatio.length];
+ for (int hu = 0; hu < material.vSmallestRatio.length; hu++) {
+ partSizes[hu] = (int) material.vSmallestRatio[hu];
+ }
+ }
+ AutoMap<Pair<Integer, Material>> componentMap = new AutoMap<Pair<Integer, Material>>();
+ int alnsnfds = 0;
+ for (MaterialStack r : material.getComposites()) {
+ if (r != null) {
+ componentMap.put(new Pair<Integer, Material>(partSizes[alnsnfds], r.getStackMaterial()));
+ }
+ alnsnfds++;
+ }
+
+ /**
+ * Centrifuge
+ */
+
+ // Process Dust
+ if (componentMap.size() > 0 && componentMap.size() <= 6) {
+ ItemStack mInternalOutputs[] = new ItemStack[6];
+ int mChances[] = new int[6];
+ int mCellCount = 0;
+
+ int mTotalCount = 0;
+
+ int mCounter = 0;
+ for (Pair<Integer, Material> f : componentMap) {
+ if (f.getValue().getState() != MaterialState.SOLID) {
+ Logger.MATERIALS("[Centrifuge] Found Fluid Component, adding " + f.getKey() + " cells of "
+ + f.getValue().getLocalizedName() + ".");
+ mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey());
+ mCellCount += f.getKey();
+ mTotalCount += f.getKey();
+ Logger.MATERIALS("[Centrifuge] In total, adding " + mCellCount + " cells for "
+ + material.getLocalizedName() + " processing.");
+ } else {
+ Logger.MATERIALS("[Centrifuge] Found Solid Component, adding " + f.getKey() + " dusts of "
+ + f.getValue().getLocalizedName() + ".");
+ mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey());
+ mTotalCount += f.getKey();
+ }
+ }
+
+ // Build Output Array
+ for (int g = 0; g < mInternalOutputs.length; g++) {
+ Logger.MATERIALS("[Centrifuge] Is output[" + g + "] valid with a chance? "
+ + (mInternalOutputs[g] != null ? 10000 : 0));
+ mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0);
+ }
+
+ ItemStack emptyCell = null;
+ if (mCellCount > 0) {
+ emptyCell = ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", mCellCount);
+ Logger.MATERIALS("[Centrifuge] Recipe now requires " + mCellCount + " empty cells as input.");
+ }
+
+ ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing);
+ if (mainDust != null) {
+ Logger.MATERIALS("[Centrifuge] Recipe now requires " + material.smallestStackSizeWhenProcessing
+ + "x " + mainDust.getDisplayName() + " as input.");
+ } else {
+ mainDust = material.getDust(mTotalCount);
+ Logger.MATERIALS("[Centrifuge] Could not find valid input dust, trying alternative.");
+ if (mainDust != null) {
+ Logger.MATERIALS("[Centrifuge] Recipe now requires " + mTotalCount + "x "
+ + mainDust.getDisplayName() + " as input.");
+ } else {
+ Logger.MATERIALS("[Centrifuge] Could not find valid input dust, exiting.");
+ }
+ }
+
+ for (int j = 0; j < mInternalOutputs.length; j++) {
+ if (mInternalOutputs[j] == null) {
+ mInternalOutputs[j] = GT_Values.NI;
+ Logger.MATERIALS("[Centrifuge] Set slot " + j + " to null.");
+ } else {
+ Logger.MATERIALS(
+ "[Centrifuge] Set slot " + j + " to " + mInternalOutputs[j].getDisplayName() + ".");
+ }
+ }
+
+ try {
+ if (addCentrifgeRecipe(
+ mainDust,
+ emptyCell, // input 2
+ null, // Input fluid 1
+ null, // Output fluid 1
+ mInternalOutputs[0],
+ mInternalOutputs[1],
+ mInternalOutputs[2],
+ mInternalOutputs[3],
+ mInternalOutputs[4],
+ mInternalOutputs[5],
+ mChances,
+ 20 * 1 * (tVoltageMultiplier / 10),
+ tVoltageMultiplier)) {
+ Logger.MATERIALS("[Centrifuge] Generated Centrifuge recipe for "
+ + material.getDust(1).getDisplayName());
+ } else {
+ Logger.MATERIALS("[Centrifuge] Failed to generate Centrifuge recipe for "
+ + material.getDust(1).getDisplayName());
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ } else if (componentMap.size() > 6 && componentMap.size() <= 9) {
+ Logger.MATERIALS(
+ "[Issue][Electrolyzer] " + material.getLocalizedName()
+ + " is composed of over 6 materials, so an electrolyzer recipe for processing cannot be generated. Trying to create one for the Dehydrator instead.");
+
+ ItemStack mInternalOutputs[] = new ItemStack[9];
+ int mChances[] = new int[9];
+ int mCellCount = 0;
+
+ int mTotalCount = 0;
+
+ int mCounter = 0;
+ for (Pair<Integer, Material> f : componentMap) {
+ if (f.getValue().getState() != MaterialState.SOLID) {
+ Logger.MATERIALS("[Dehydrator] Found Fluid Component, adding " + f.getKey() + " cells of "
+ + f.getValue().getLocalizedName() + ".");
+ mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey());
+ mCellCount += f.getKey();
+ mTotalCount += f.getKey();
+ Logger.MATERIALS("[Dehydrator] In total, adding " + mCellCount + " cells for "
+ + material.getLocalizedName() + " processing.");
+ } else {
+ Logger.MATERIALS("[Dehydrator] Found Solid Component, adding " + f.getKey() + " dusts of "
+ + f.getValue().getLocalizedName() + ".");
+ mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey());
+ mTotalCount += f.getKey();
+ }
+ }
+
+ // Build Output Array
+ for (int g = 0; g < mInternalOutputs.length; g++) {
+ Logger.MATERIALS("[Dehydrator] Is output[" + g + "] valid with a chance? "
+ + (mInternalOutputs[g] != null ? 10000 : 0));
+ mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0);
+ }
+
+ ItemStack emptyCell = null;
+ if (mCellCount > 0) {
+ emptyCell = CI.emptyCells(mCellCount);
+ Logger.MATERIALS("[Dehydrator] Recipe now requires " + mCellCount + " empty cells as input.");
+ }
+
+ ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing);
+ if (mainDust != null) {
+ Logger.MATERIALS("[Dehydrator] Recipe now requires " + material.smallestStackSizeWhenProcessing
+ + "x " + mainDust.getDisplayName() + " as input.");
+ } else {
+ mainDust = material.getDust(mTotalCount);
+ Logger.MATERIALS("[Dehydrator] Could not find valid input dust, trying alternative.");
+ if (mainDust != null) {
+ Logger.MATERIALS("[Dehydrator] Recipe now requires " + mTotalCount + "x "
+ + mainDust.getDisplayName() + " as input.");
+ } else {
+ Logger.MATERIALS("[Dehydrator] Could not find valid input dust, exiting.");
+ }
+ }
+
+ for (int j = 0; j < mInternalOutputs.length; j++) {
+ if (mInternalOutputs[j] == null) {
+ mInternalOutputs[j] = GT_Values.NI;
+ Logger.MATERIALS("[Dehydrator] Set slot " + j + " to null.");
+ } else {
+ Logger.MATERIALS(
+ "[Dehydrator] Set slot " + j + " to " + mInternalOutputs[j].getDisplayName() + ".");
+ }
+ }
+
+ try {
+
+ if (CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {mainDust, emptyCell},
+ null,
+ null,
+ mInternalOutputs,
+ mChances,
+ 20 * 1 * (tVoltageMultiplier / 10),
+ tVoltageMultiplier)) {
+ Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for "
+ + material.getDust(1).getDisplayName());
+ } else {
+ Logger.MATERIALS("[Dehydrator] Failed to generate Dehydrator recipe for "
+ + material.getDust(1).getDisplayName());
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ }
+
+ public static boolean addCentrifgeRecipe(
+ 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) {
+ return GT_Values.RA.addCentrifugeRecipe(
+ aInput1,
+ aInput2,
+ aFluidInput,
+ aFluidOutput,
+ aOutput1,
+ aOutput2,
+ aOutput3,
+ aOutput4,
+ aOutput5,
+ aOutput6,
+ aChances,
+ aDuration,
+ aEUt);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java
index bcf3ef1f9f..b08daa7d9a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java
@@ -1,28 +1,25 @@
package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-
import java.util.HashSet;
import java.util.Set;
public class RecipeGen_MetalRecipe extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
static {
MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
}
- public RecipeGen_MetalRecipe(final Material M){
+ public RecipeGen_MetalRecipe(final Material M) {
this.toGenerate = M;
mRecipeGenMap.add(this);
}
@@ -34,16 +31,13 @@ public class RecipeGen_MetalRecipe extends RecipeGen_Base {
private void generateRecipes(final Material material) {
- Logger.WARNING("Generating Metal recipes for "+material.getLocalizedName());
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBlock(1)))
- if (GT_ModHandler.addCompressionRecipe(
- material.getIngot(9),
- material.getBlock(1)
- )){
- Logger.WARNING("Compress Block Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Compress Block Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("Generating Metal recipes for " + material.getLocalizedName());
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1))
+ && ItemUtils.checkForInvalidItems(material.getBlock(1)))
+ if (GT_ModHandler.addCompressionRecipe(material.getIngot(9), material.getBlock(1))) {
+ Logger.WARNING("Compress Block Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Compress Block Recipe: " + material.getLocalizedName() + " - Failed");
}
if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRod(1)))
@@ -52,11 +46,10 @@ public class RecipeGen_MetalRecipe extends RecipeGen_Base {
material.getRod(1),
material.getSmallDust(2),
(int) Math.max(material.getMass() / 8L, 1L),
- material.vVoltageMultiplier)){
- Logger.WARNING("Lathe Rod Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Lathe Rod Recipe: "+material.getLocalizedName()+" - Failed");
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Lathe Rod Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Lathe Rod Recipe: " + material.getLocalizedName() + " - Failed");
}
if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1)))
@@ -65,84 +58,68 @@ public class RecipeGen_MetalRecipe extends RecipeGen_Base {
material.getBolt(4),
null,
(int) Math.max(material.getMass() * 2L, 1L),
- material.vVoltageMultiplier)){
- Logger.WARNING("Cut Bolt Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Cut Bolt Recipe: "+material.getLocalizedName()+" - Failed");
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Cut Bolt Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Cut Bolt Recipe: " + material.getLocalizedName() + " - Failed");
}
- if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getHotIngot(1)))
+ if (ItemUtils.checkForInvalidItems(material.getIngot(1))
+ && ItemUtils.checkForInvalidItems(material.getHotIngot(1)))
if (CORE.RA.addVacuumFreezerRecipe(
- material.getHotIngot(1),
- material.getIngot(1),
- (int) Math.max(material.getMass() * 3L, 1L),
- material.vVoltageMultiplier)
- ){
- Logger.WARNING("Cool Hot Ingot Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Cool Hot Ingot Recipe: "+material.getLocalizedName()+" - Failed");
+ material.getHotIngot(1),
+ material.getIngot(1),
+ (int) Math.max(material.getMass() * 3L, 1L),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Cool Hot Ingot Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Cool Hot Ingot Recipe: " + material.getLocalizedName() + " - Failed");
}
- if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getLongRod(1))) {
+ if (ItemUtils.checkForInvalidItems(material.getRod(1))
+ && ItemUtils.checkForInvalidItems(material.getLongRod(1))) {
if (GT_Values.RA.addForgeHammerRecipe(
- material.getRod(2),
- material.getLongRod(1),
- (int) Math.max(material.getMass(), 1L),
- 16)){
- Logger.WARNING("Hammer Long Rod Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Hammer Long Rod Recipe: "+material.getLocalizedName()+" - Failed");
+ material.getRod(2), material.getLongRod(1), (int) Math.max(material.getMass(), 1L), 16)) {
+ Logger.WARNING("Hammer Long Rod Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Hammer Long Rod Recipe: " + material.getLocalizedName() + " - Failed");
}
GT_Values.RA.addCutterRecipe(
- material.getLongRod(1),
- material.getRod(2),
- null,
- (int) Math.max(material.getMass(), 1L),
- 4);
+ material.getLongRod(1), material.getRod(2), null, (int) Math.max(material.getMass(), 1L), 4);
}
if (ItemUtils.checkForInvalidItems(material.getBolt(1)) && ItemUtils.checkForInvalidItems(material.getScrew(1)))
if (GT_Values.RA.addLatheRecipe(
- material.getBolt(1),
- material.getScrew(1),
- null,
- (int) Math.max(material.getMass() / 8L, 1L),
- 4)){
- Logger.WARNING("Lathe Screw Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Lathe Screw Recipe: "+material.getLocalizedName()+" - Failed");
+ material.getBolt(1), material.getScrew(1), null, (int) Math.max(material.getMass() / 8L, 1L), 4)) {
+ Logger.WARNING("Lathe Screw Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Lathe Screw Recipe: " + material.getLocalizedName() + " - Failed");
}
-
+
// Fine Wire
- if (ItemUtils.checkForInvalidItems(material.getFineWire(1)) && (ItemUtils.checkForInvalidItems(material.getIngot(1)) || ItemUtils.checkForInvalidItems(material.getWire01(1))))
+ if (ItemUtils.checkForInvalidItems(material.getFineWire(1))
+ && (ItemUtils.checkForInvalidItems(material.getIngot(1))
+ || ItemUtils.checkForInvalidItems(material.getWire01(1))))
if (GT_Values.RA.addWiremillRecipe(
- ItemUtils.checkForInvalidItems(material.getWire01(1)) ? material.getWire01(1) : material.getIngot(1),
- material.getFineWire(ItemUtils.checkForInvalidItems(material.getWire01(1)) ? 4 : 8),
- 100,
- 4)){
- Logger.WARNING("Wiremill Fine Wire Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Wiremill Fine Wire Recipe: "+material.getLocalizedName()+" - Failed");
+ ItemUtils.checkForInvalidItems(material.getWire01(1))
+ ? material.getWire01(1)
+ : material.getIngot(1),
+ material.getFineWire(ItemUtils.checkForInvalidItems(material.getWire01(1)) ? 4 : 8),
+ 100,
+ 4)) {
+ Logger.WARNING("Wiremill Fine Wire Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Wiremill Fine Wire Recipe: " + material.getLocalizedName() + " - Failed");
}
// Fine Wire
- if (ItemUtils.checkForInvalidItems(material.getFineWire(1)) && (ItemUtils.checkForInvalidItems(material.getRod(1))))
- if (GT_Values.RA.addWiremillRecipe(
- material.getRod(1),
- material.getFineWire(4),
- 50,
- 4)){
- Logger.WARNING("Wiremill Fine Wire Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Wiremill Fine Wire Recipe: "+material.getLocalizedName()+" - Failed");
+ if (ItemUtils.checkForInvalidItems(material.getFineWire(1))
+ && (ItemUtils.checkForInvalidItems(material.getRod(1))))
+ if (GT_Values.RA.addWiremillRecipe(material.getRod(1), material.getFineWire(4), 50, 4)) {
+ Logger.WARNING("Wiremill Fine Wire Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Wiremill Fine Wire Recipe: " + material.getLocalizedName() + " - Failed");
}
-
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java
index 1b6e623e91..1b0324545d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java
@@ -9,182 +9,178 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-import java.util.ArrayList;
-
public class RecipeGen_MultisUsingFluidInsteadOfCells {
-
- private static ItemStack mEmptyCell;
- private static AutoMap<ItemStack> mItemsToIgnore = new AutoMap<ItemStack>();
- private static boolean mInit = false;
-
- private static void init() {
- if (!mInit) {
- mInit = true;
- mItemsToIgnore.add(ItemUtils.simpleMetaStack(CI.emptyCells(1).getItem(), 8, 1));
-
-
- }
- }
-
- private static boolean doesItemMatchIgnoringStackSize(ItemStack a, ItemStack b) {
- if (a == null || b == null) {
- return false;
- }
- if (a.getItem() == b.getItem()) {
- if (a.getItemDamage() == b.getItemDamage()) {
- return true;
- }
- }
- return false;
- }
-
- private static boolean isEmptyCell(ItemStack aCell) {
- if (aCell == null) {
- return false;
- }
- if (mEmptyCell == null) {
- mEmptyCell = CI.emptyCells(1);
- }
- if (mEmptyCell != null) {
- ItemStack aTempStack = mEmptyCell.copy();
- aTempStack.stackSize = aCell.stackSize;
- if (GT_Utility.areStacksEqual(aTempStack, aCell)) {
- return true;
- }
- }
- return false;
- }
-
- private synchronized static FluidStack getFluidFromItemStack(final ItemStack ingot) {
- if (ingot == null) {
- return null;
- }
- FluidStack aFluid = GT_Utility.getFluidForFilledItem(ingot, true);
- if (aFluid != null) {
- return aFluid;
- }
- return null;
- }
-
- public synchronized static int generateRecipesNotUsingCells(GT_Recipe_Map aInputs, GTPP_Recipe_Map_Internal aOutputs) {
- init();
- int aRecipesHandled = 0;
- int aInvalidRecipesToConvert = 0;
- int aOriginalCount = aInputs.mRecipeList.size();
-
- recipe : for (GT_Recipe x : aInputs.mRecipeList) {
- if (x != null) {
-
- ItemStack[] aInputItems = x.mInputs.clone();
- ItemStack[] aOutputItems = x.mOutputs.clone();
- FluidStack[] aInputFluids = x.mFluidInputs.clone();
- FluidStack[] aOutputFluids = x.mFluidOutputs.clone();
-
- AutoMap<ItemStack> aInputItemsMap = new AutoMap<ItemStack>();
- AutoMap<ItemStack> aOutputItemsMap = new AutoMap<ItemStack>();
- AutoMap<FluidStack> aInputFluidsMap = new AutoMap<FluidStack>();
- AutoMap<FluidStack> aOutputFluidsMap = new AutoMap<FluidStack>();
-
- // Iterate Inputs, Convert valid items into fluids
- inputs : for (ItemStack aInputStack : aInputItems) {
- FluidStack aFoundFluid = getFluidFromItemStack(aInputStack);
- if (aFoundFluid == null) {
- for (ItemStack aBadStack : mItemsToIgnore) {
- if (doesItemMatchIgnoringStackSize(aInputStack, aBadStack)) {
- continue recipe; // Skip this recipe entirely if we find an item we don't like
- }
- }
- if (!isEmptyCell(aInputStack)) {
- aInputItemsMap.add(aInputStack);
- }
- }
- else {
- aFoundFluid.amount = aFoundFluid.amount * aInputStack.stackSize;
- aInputFluidsMap.add(aFoundFluid);
- }
- }
- // Iterate Outputs, Convert valid items into fluids
- outputs: for (ItemStack aOutputStack : aOutputItems) {
- FluidStack aFoundFluid = getFluidFromItemStack(aOutputStack);
- if (aFoundFluid == null) {
- for (ItemStack aBadStack : mItemsToIgnore) {
- if (doesItemMatchIgnoringStackSize(aOutputStack, aBadStack)) {
- continue recipe; // Skip this recipe entirely if we find an item we don't like
- }
- }
- if (!isEmptyCell(aOutputStack)) {
- aOutputItemsMap.add(aOutputStack);
- }
- }
- else {
- aFoundFluid.amount = aFoundFluid.amount * aOutputStack.stackSize;
- aOutputFluidsMap.add(aFoundFluid);
- }
- }
- // Add Input fluids second
- for (FluidStack aInputFluid : aInputFluids) {
- aInputFluidsMap.add(aInputFluid);
- }
- // Add Output fluids second
- for (FluidStack aOutputFluid : aOutputFluids) {
- aOutputFluidsMap.add(aOutputFluid);
- }
-
- // Make some new Arrays
- ItemStack[] aNewItemInputs = new ItemStack[aInputItemsMap.size()];
- ItemStack[] aNewItemOutputs = new ItemStack[aOutputItemsMap.size()];
- FluidStack[] aNewFluidInputs = new FluidStack[aInputFluidsMap.size()];
- FluidStack[] aNewFluidOutputs = new FluidStack[aOutputFluidsMap.size()];
-
- // Add AutoMap contents to Arrays
- for (int i = 0; i < aInputItemsMap.size(); i++) {
- aNewItemInputs[i] = aInputItemsMap.get(i);
- }
- for (int i = 0; i < aOutputItemsMap.size(); i++) {
- aNewItemOutputs[i] = aOutputItemsMap.get(i);
- }
- for (int i = 0; i < aInputFluidsMap.size(); i++) {
- aNewFluidInputs[i] = aInputFluidsMap.get(i);
- }
- for (int i = 0; i < aOutputFluidsMap.size(); i++) {
- aNewFluidOutputs[i] = aOutputFluidsMap.get(i);
- }
-
- if (!ItemUtils.checkForInvalidItems(aNewItemInputs, aNewItemOutputs)) {
- aInvalidRecipesToConvert++;
- continue recipe; // Skip this recipe entirely if we find an item we don't like
- }
-
- // Add Recipe to map
- GT_Recipe aNewRecipe = new GTPP_Recipe.GTPP_Recipe_Map_MultiNoCell.GTPP_Recipe_MultiNoCell(
- false,
- aNewItemInputs,
- aNewItemOutputs,
- x.mSpecialItems,
- x.mChances,
- aNewFluidInputs,
- aNewFluidOutputs,
- x.mDuration,
- x.mEUt,
- x.mSpecialValue);
- aNewRecipe.owners = new ArrayList<>(x.owners);
- aOutputs.add(aNewRecipe);
- aRecipesHandled++;
- }
- else {
- aInvalidRecipesToConvert++;
- }
- }
-
- Logger.INFO("Generated Recipes for "+aOutputs.mNEIName);
- Logger.INFO("Original Map contains "+aOriginalCount+" recipes.");
- Logger.INFO("Output Map contains "+aRecipesHandled+" recipes.");
- Logger.INFO("There were "+aInvalidRecipesToConvert+" invalid recipes.");
- return aRecipesHandled;
- }
-
+ private static ItemStack mEmptyCell;
+ private static AutoMap<ItemStack> mItemsToIgnore = new AutoMap<ItemStack>();
+ private static boolean mInit = false;
+
+ private static void init() {
+ if (!mInit) {
+ mInit = true;
+ mItemsToIgnore.add(ItemUtils.simpleMetaStack(CI.emptyCells(1).getItem(), 8, 1));
+ }
+ }
+
+ private static boolean doesItemMatchIgnoringStackSize(ItemStack a, ItemStack b) {
+ if (a == null || b == null) {
+ return false;
+ }
+ if (a.getItem() == b.getItem()) {
+ if (a.getItemDamage() == b.getItemDamage()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static boolean isEmptyCell(ItemStack aCell) {
+ if (aCell == null) {
+ return false;
+ }
+ if (mEmptyCell == null) {
+ mEmptyCell = CI.emptyCells(1);
+ }
+ if (mEmptyCell != null) {
+ ItemStack aTempStack = mEmptyCell.copy();
+ aTempStack.stackSize = aCell.stackSize;
+ if (GT_Utility.areStacksEqual(aTempStack, aCell)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static synchronized FluidStack getFluidFromItemStack(final ItemStack ingot) {
+ if (ingot == null) {
+ return null;
+ }
+ FluidStack aFluid = GT_Utility.getFluidForFilledItem(ingot, true);
+ if (aFluid != null) {
+ return aFluid;
+ }
+ return null;
+ }
+
+ public static synchronized int generateRecipesNotUsingCells(
+ GT_Recipe_Map aInputs, GTPP_Recipe_Map_Internal aOutputs) {
+ init();
+ int aRecipesHandled = 0;
+ int aInvalidRecipesToConvert = 0;
+ int aOriginalCount = aInputs.mRecipeList.size();
+
+ recipe:
+ for (GT_Recipe x : aInputs.mRecipeList) {
+ if (x != null) {
+
+ ItemStack[] aInputItems = x.mInputs.clone();
+ ItemStack[] aOutputItems = x.mOutputs.clone();
+ FluidStack[] aInputFluids = x.mFluidInputs.clone();
+ FluidStack[] aOutputFluids = x.mFluidOutputs.clone();
+
+ AutoMap<ItemStack> aInputItemsMap = new AutoMap<ItemStack>();
+ AutoMap<ItemStack> aOutputItemsMap = new AutoMap<ItemStack>();
+ AutoMap<FluidStack> aInputFluidsMap = new AutoMap<FluidStack>();
+ AutoMap<FluidStack> aOutputFluidsMap = new AutoMap<FluidStack>();
+
+ // Iterate Inputs, Convert valid items into fluids
+ inputs:
+ for (ItemStack aInputStack : aInputItems) {
+ FluidStack aFoundFluid = getFluidFromItemStack(aInputStack);
+ if (aFoundFluid == null) {
+ for (ItemStack aBadStack : mItemsToIgnore) {
+ if (doesItemMatchIgnoringStackSize(aInputStack, aBadStack)) {
+ continue recipe; // Skip this recipe entirely if we find an item we don't like
+ }
+ }
+ if (!isEmptyCell(aInputStack)) {
+ aInputItemsMap.add(aInputStack);
+ }
+ } else {
+ aFoundFluid.amount = aFoundFluid.amount * aInputStack.stackSize;
+ aInputFluidsMap.add(aFoundFluid);
+ }
+ }
+ // Iterate Outputs, Convert valid items into fluids
+ outputs:
+ for (ItemStack aOutputStack : aOutputItems) {
+ FluidStack aFoundFluid = getFluidFromItemStack(aOutputStack);
+ if (aFoundFluid == null) {
+ for (ItemStack aBadStack : mItemsToIgnore) {
+ if (doesItemMatchIgnoringStackSize(aOutputStack, aBadStack)) {
+ continue recipe; // Skip this recipe entirely if we find an item we don't like
+ }
+ }
+ if (!isEmptyCell(aOutputStack)) {
+ aOutputItemsMap.add(aOutputStack);
+ }
+ } else {
+ aFoundFluid.amount = aFoundFluid.amount * aOutputStack.stackSize;
+ aOutputFluidsMap.add(aFoundFluid);
+ }
+ }
+ // Add Input fluids second
+ for (FluidStack aInputFluid : aInputFluids) {
+ aInputFluidsMap.add(aInputFluid);
+ }
+ // Add Output fluids second
+ for (FluidStack aOutputFluid : aOutputFluids) {
+ aOutputFluidsMap.add(aOutputFluid);
+ }
+
+ // Make some new Arrays
+ ItemStack[] aNewItemInputs = new ItemStack[aInputItemsMap.size()];
+ ItemStack[] aNewItemOutputs = new ItemStack[aOutputItemsMap.size()];
+ FluidStack[] aNewFluidInputs = new FluidStack[aInputFluidsMap.size()];
+ FluidStack[] aNewFluidOutputs = new FluidStack[aOutputFluidsMap.size()];
+
+ // Add AutoMap contents to Arrays
+ for (int i = 0; i < aInputItemsMap.size(); i++) {
+ aNewItemInputs[i] = aInputItemsMap.get(i);
+ }
+ for (int i = 0; i < aOutputItemsMap.size(); i++) {
+ aNewItemOutputs[i] = aOutputItemsMap.get(i);
+ }
+ for (int i = 0; i < aInputFluidsMap.size(); i++) {
+ aNewFluidInputs[i] = aInputFluidsMap.get(i);
+ }
+ for (int i = 0; i < aOutputFluidsMap.size(); i++) {
+ aNewFluidOutputs[i] = aOutputFluidsMap.get(i);
+ }
+
+ if (!ItemUtils.checkForInvalidItems(aNewItemInputs, aNewItemOutputs)) {
+ aInvalidRecipesToConvert++;
+ continue recipe; // Skip this recipe entirely if we find an item we don't like
+ }
+
+ // Add Recipe to map
+ GT_Recipe aNewRecipe = new GTPP_Recipe.GTPP_Recipe_Map_MultiNoCell.GTPP_Recipe_MultiNoCell(
+ false,
+ aNewItemInputs,
+ aNewItemOutputs,
+ x.mSpecialItems,
+ x.mChances,
+ aNewFluidInputs,
+ aNewFluidOutputs,
+ x.mDuration,
+ x.mEUt,
+ x.mSpecialValue);
+ aNewRecipe.owners = new ArrayList<>(x.owners);
+ aOutputs.add(aNewRecipe);
+ aRecipesHandled++;
+ } else {
+ aInvalidRecipesToConvert++;
+ }
+ }
+
+ Logger.INFO("Generated Recipes for " + aOutputs.mNEIName);
+ Logger.INFO("Original Map contains " + aOriginalCount + " recipes.");
+ Logger.INFO("Output Map contains " + aRecipesHandled + " recipes.");
+ Logger.INFO("There were " + aInvalidRecipesToConvert + " invalid recipes.");
+ return aRecipesHandled;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
index 67620fd7e0..e210ae00ef 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
@@ -1,11 +1,5 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import net.minecraft.item.ItemStack;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
@@ -24,557 +18,641 @@ import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeGen_Ore extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
-
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
-
- public RecipeGen_Ore(final Material M){
- this(M, false);
- }
-
- public RecipeGen_Ore(final Material M, final boolean O){
- this.toGenerate = M;
- this.disableOptional = O;
- mRecipeGenMap.add(this);
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate, this.disableOptional);
- }
-
- private static Material mStone;
-
- private void generateRecipes(final Material material, final boolean disableOptional){
-
- if (mStone == null) {
- mStone = MaterialUtils.generateMaterialFromGtENUM(Materials.Stone);
- }
-
- //if (material.getMaterialComposites().length > 1){
- Logger.MATERIALS("[Recipe Generator Debug] ["+material.getLocalizedName()+"]");
- int tVoltageMultiplier = MaterialUtils.getVoltageForTier(material.vTier);
-
- final ItemStack dustStone = ItemUtils.getItemStackOfAmountFromOreDict("dustStone", 1);
- Material bonusA = null; //Ni
- Material bonusB = null; //Tin
-
- if (material.getComposites().size() >= 1 && material.getComposites().get(0) != null){
- bonusA = material.getComposites().get(0).getStackMaterial();
- }
- else {
- bonusA = material;
- }
-
- boolean allFailed = false;
-
-
- //Setup Bonuses
- ArrayList<Material> aMatComp = new ArrayList<Material>();
- for (Material j : MaterialUtils.getCompoundMaterialsRecursively(material)) {
- aMatComp.add(j);
- }
-
- if (aMatComp.size() < 3) {
- while (aMatComp.size() < 3) {
- aMatComp.add(material);
- }
- }
-
- AutoMap<Material> amJ = new AutoMap<Material>();
- int aIndexCounter = 0;
- for (Material g : aMatComp) {
- if (g.hasSolidForm()) {
- if (getDust(g) != null && getTinyDust(g) != null) {
- amJ.put(g);
- }
- }
- }
-
- if (amJ.size() < 2) {
- if (material.getComposites().size() >= 2 && material.getComposites().get(1) != null){
- bonusB = material.getComposites().get(1).getStackMaterial();
- //If Secondary Output has no solid output, try the third (If it exists)
- if (!bonusB.hasSolidForm() && material.getComposites().size() >= 3 && material.getComposites().get(2) != null) {
- bonusB = material.getComposites().get(2).getStackMaterial();
- //If Third Output has no solid output, try the Fourth (If it exists)
- if (!bonusB.hasSolidForm() && material.getComposites().size() >= 4 && material.getComposites().get(3) != null) {
- bonusB = material.getComposites().get(3).getStackMaterial();
- //If Fourth Output has no solid output, try the Fifth (If it exists)
- if (!bonusB.hasSolidForm() && material.getComposites().size() >= 5 && material.getComposites().get(4) != null) {
- bonusB = material.getComposites().get(4).getStackMaterial();
- //If Fifth Output has no solid output, default out to Stone dust.
- if (!bonusB.hasSolidForm()) {
- allFailed = true;
- bonusB = mStone;
- }
- }
- }
- }
- }
- else {
- allFailed = true;
- }
- }
- else {
- bonusA = amJ.get(0);
- bonusB = amJ.get(1);
- }
-
- //Default out if it's made of fluids or some shit.
- if (bonusA == null) {
- bonusA = tVoltageMultiplier > 100 ? material : mStone;
- }
- //Default out if it's made of fluids or some shit.
- if (allFailed || bonusB == null) {
- bonusB = tVoltageMultiplier > 100 ? material : mStone;
- }
-
- AutoMap<Pair<Integer, Material>> componentMap = new AutoMap<Pair<Integer, Material>>();
- for (MaterialStack r : material.getComposites()){
- if (r != null){
- componentMap.put(new Pair<Integer, Material>(r.getPartsPerOneHundred(), r.getStackMaterial()));
- }
- }
-
- //Need two valid outputs
- if (bonusA == null || bonusB == null || !bonusA.hasSolidForm() || !bonusB.hasSolidForm()) {
- if (bonusA == null) {
- bonusA = mStone;
- }
- if (bonusB == null) {
- bonusB = mStone;
- }
- if (!bonusA.hasSolidForm()) {
- bonusA = mStone;
- }
- if (!bonusB.hasSolidForm()) {
- bonusB = mStone;
- }
- }
-
- ItemStack matDust = getDust(material);
- ItemStack matDustA = getDust(bonusA);
- ItemStack matDustB = getDust(bonusB);
-
- /**
- * Package
- */
- //Allow ore dusts to be packaged
- if (ItemUtils.checkForInvalidItems(material.getSmallDust(1)) && ItemUtils.checkForInvalidItems(material.getTinyDust(1))) {
- RecipeGen_DustGeneration.generatePackagerRecipes(material);
- }
-
-
- /**
- * Macerate
- */
- //Macerate ore to Crushed
- if (GT_Values.RA.addPulveriserRecipe(material.getOre(1), new ItemStack[]{material.getCrushed(2)}, new int[]{10000}, 20*20, tVoltageMultiplier/2)){
- Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'");
- }
- //Macerate Crushed to Impure Dust
- if (GT_Values.RA.addPulveriserRecipe(material.getCrushed(1), new ItemStack[]{material.getDustImpure(1), matDustA}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){
- Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Crushed ore to Impure Dust'");
- }
- //Macerate Washed to Purified Dust
- if (GT_Values.RA.addPulveriserRecipe(material.getCrushedPurified(1), new ItemStack[]{material.getDustPurified(1), matDustA}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){
- Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Washed ore to Purified Dust'");
- }
- //Macerate Centrifuged to Pure Dust
- if (GT_Values.RA.addPulveriserRecipe(material.getCrushedCentrifuged(1), new ItemStack[]{matDust, matDustA}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){
- Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'");
- }
-
- /**
- * Wash
- */
- //Wash into Purified Crushed
- /*if (GT_Values.RA.addOreWasherRecipe(material.getCrushed(1), material.getCrushedPurified(1), bonusA.getTinyDust(1), dustStone, FluidUtils.getWater(1000), 25*20, 16)){
- Logger.MATERIALS("[OreWasher] Added Recipe: 'Wash Crushed ore into Purified Crushed ore'");
- }*/
- //.08 compat method
- if (GT_ModHandler.addOreWasherRecipe(material.getCrushed(1), new int[]{10000, 1111, 10000}, 1000, material.getCrushedPurified(1), matDustA, dustStone)){
- Logger.MATERIALS("[OreWasher] Added Recipe: 'Wash Crushed ore into Purified Crushed ore'");
- }
-
-
-
-
-
- /**
- * Thermal Centrifuge
- */
- /*//Crushed ore to Centrifuged Ore
- if (GT_Values.RA.addThermalCentrifugeRecipe(material.getCrushed(1), material.getCrushedCentrifuged(1), tinyDustB, dustStone, 25*20, 24)){
- Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore'");
- }
- //Washed ore to Centrifuged Ore
- if (GT_Values.RA.addThermalCentrifugeRecipe(material.getCrushedPurified(1), material.getCrushedCentrifuged(1), bonusA.getTinyDust(1), dustStone, 25*20, 24)){
- Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore'");
- }*/
-
- Logger.MATERIALS("material.getCrushed(1): "+(material.getCrushed(1) != null));
- Logger.MATERIALS("material.getCrushedPurified(1): "+(material.getCrushedPurified(1) != null));
-
- Logger.MATERIALS("material.getTinyDust(1): "+(ItemUtils.getItemName(bonusA.getCrushed(1))));
- Logger.MATERIALS("material.getTinyDust(1): "+(ItemUtils.getItemName(bonusB.getCrushed(1))));
-
- try {
- //.08 compat
- if (GT_ModHandler.addThermalCentrifugeRecipe(material.getCrushed(1), new int[]{10000, 1111, 10000}, (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), material.getCrushedCentrifuged(1), matDustB, dustStone)){
- Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore' | Input: "+material.getCrushed(1).getDisplayName()+" | Outputs: "+material.getCrushedCentrifuged(1).getDisplayName()+", "+matDustB.getDisplayName()+", "+dustStone.getDisplayName()+".");
- }
- }
- catch (Throwable t) {}
- try {
- if (GT_ModHandler.addThermalCentrifugeRecipe(material.getCrushedPurified(1), new int[]{10000, 1111, 10000}, (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), material.getCrushedCentrifuged(1), matDustA, dustStone)){
- Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: "+material.getCrushedPurified(1).getDisplayName()+" | Outputs: "+material.getCrushedCentrifuged(1).getDisplayName()+", "+matDustA.getDisplayName()+", "+dustStone.getDisplayName()+".");
- }
- }
- catch (Throwable t) {}
-
-
- /**
- * Forge Hammer
- */
- if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), matDust, 10, tVoltageMultiplier/4)){
- Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'");
- }
- if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedPurified(1), material.getDustPurified(1), 10, tVoltageMultiplier/4)){
- Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Purified to Purified Dust'");
- }
- if (GT_Values.RA.addForgeHammerRecipe(material.getOre(1), material.getCrushed(1), 10, tVoltageMultiplier/4)){
- Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Ore to Crushed'");
- }
-
- /**
- * Centrifuge
- */
- //Purified Dust to Clean
- if (GT_Values.RA.addCentrifugeRecipe(
- material.getDustPurified(1), null,
- null, //In Fluid
- null, //Out Fluid
- matDust, matDustA,null,
- null, null,null,
- new int[]{10000, 1111}, //Chances
- (int) Math.max(1L, material.getMass() * 8L), //Time
- tVoltageMultiplier/2)){ //Eu
- Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust");
- }
-
- //Impure Dust to Clean
- if (GT_Values.RA.addCentrifugeRecipe(
- material.getDustImpure(1), null,
- null, //In Fluid
- null, //Out Fluid
- matDust, matDustB,null,
- null, null,null,
- new int[]{10000, 1111}, //Chances
- (int) Math.max(1L, material.getMass() * 8L), //Time
- tVoltageMultiplier/2)){ //Eu
- Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust");
- }
-
-
- /**
- * Electrolyzer
- */
-
- if (!disableOptional) {
- //Process Dust
- if (componentMap.size() > 0 && componentMap.size() <= 6){
-
- ItemStack mInternalOutputs[] = new ItemStack[6];
- int mChances[] = new int[6];
- int mCellCount = 0;
-
- int mTotalCount = 0;
-
- int mCounter = 0;
- for (Pair<Integer, Material> f : componentMap){
- if (f.getValue().getState() != MaterialState.SOLID){
- Logger.MATERIALS("[Electrolyzer] Found Fluid Component, adding "+f.getKey()+" cells of "+f.getValue().getLocalizedName()+".");
- mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey());
- mCellCount += f.getKey();
- mTotalCount += f.getKey();
- Logger.MATERIALS("[Electrolyzer] In total, adding "+mCellCount+" cells for "+material.getLocalizedName()+" processing.");
- }
- else {
- Logger.MATERIALS("[Electrolyzer] Found Solid Component, adding "+f.getKey()+" dusts of "+f.getValue().getLocalizedName()+".");
- mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey());
- mTotalCount += f.getKey();
- }
- }
-
- //Build Output Array
- for (int g=0;g<mInternalOutputs.length;g++){
- Logger.MATERIALS("[Electrolyzer] Is output["+g+"] valid with a chance? "+(mInternalOutputs[g] != null ? 10000 : 0));
- mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0);
- }
-
- ItemStack emptyCell = null;
- if (mCellCount > 0){
- emptyCell = ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", mCellCount);
- Logger.MATERIALS("[Electrolyzer] Recipe now requires "+mCellCount+" empty cells as input.");
- }
-
- ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing);
- if (mainDust != null){
- Logger.MATERIALS("[Electrolyzer] Recipe now requires "+material.smallestStackSizeWhenProcessing+"x "+mainDust.getDisplayName()+" as input.");
- }
- else {
- mainDust = material.getDust(mTotalCount);
- Logger.MATERIALS("[Electrolyzer] Could not find valid input dust, trying alternative.");
- if (mainDust != null){
- Logger.MATERIALS("[Electrolyzer] Recipe now requires "+mTotalCount+"x "+mainDust.getDisplayName()+" as input.");
- }
- else {
- Logger.MATERIALS("[Electrolyzer] Could not find valid input dust, exiting.");
- }
- }
-
- for (int j=0;j<mInternalOutputs.length;j++){
- if (mInternalOutputs[j] == null){
- mInternalOutputs[j] = GT_Values.NI;
- Logger.MATERIALS("[Electrolyzer] Set slot "+j+" to null.");
- }
- else {
- Logger.MATERIALS("[Electrolyzer] Set slot "+j+" to "+mInternalOutputs[j].getDisplayName()+".");
- }
- }
-
- try{
- if (addElectrolyzerRecipe(
- mainDust,
- emptyCell, //input 2
- null, //Input fluid 1
- null, //Output fluid 1
- mInternalOutputs[0],
- mInternalOutputs[1],
- mInternalOutputs[2],
- mInternalOutputs[3],
- mInternalOutputs[4],
- mInternalOutputs[5],
- mChances,
- (int) Math.max(material.getMass() * 3L * 1, 1),
- tVoltageMultiplier)){
- Logger.MATERIALS("[Electrolyzer] Generated Electrolyzer recipe for "+matDust.getDisplayName());
- }
- else {
- Logger.MATERIALS("[Electrolyzer] Failed to generate Electrolyzer recipe for "+matDust.getDisplayName());
- }
- }
- catch(Throwable t){
- t.printStackTrace();
- }
- }
- else if (componentMap.size() > 6 && componentMap.size() <= 9){
- Logger.MATERIALS("[Issue][Electrolyzer] "+material.getLocalizedName()+" is composed of over 6 materials, so an electrolyzer recipe for processing cannot be generated. Trying to create one for the Dehydrator instead.");
-
- ItemStack mInternalOutputs[] = new ItemStack[9];
- int mChances[] = new int[9];
- int mCellCount = 0;
-
- int mTotalCount = 0;
-
- int mCounter = 0;
- for (Pair<Integer, Material> f : componentMap){
- if (f.getValue().getState() != MaterialState.SOLID && f.getValue().getState() != MaterialState.ORE){
- Logger.MATERIALS("[Dehydrator] Found Fluid Component, adding "+f.getKey()+" cells of "+f.getValue().getLocalizedName()+".");
- mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey());
- mCellCount += f.getKey();
- mTotalCount += f.getKey();
- Logger.MATERIALS("[Dehydrator] In total, adding "+mCellCount+" cells for "+material.getLocalizedName()+" processing.");
- }
- else {
- Logger.MATERIALS("[Dehydrator] Found Solid Component, adding "+f.getKey()+" dusts of "+f.getValue().getLocalizedName()+".");
- mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey());
- mTotalCount += f.getKey();
- }
- }
-
- //Build Output Array
- for (int g=0;g<mInternalOutputs.length;g++){
- Logger.MATERIALS("[Dehydrator] Is output["+g+"] valid with a chance? "+(mInternalOutputs[g] != null ? 10000 : 0));
- mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0);
- }
-
- ItemStack emptyCell = null;
- if (mCellCount > 0){
- emptyCell = ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", mCellCount);
- Logger.MATERIALS("[Dehydrator] Recipe now requires "+mCellCount+" empty cells as input.");
- }
-
- ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing);
- if (mainDust != null){
- Logger.MATERIALS("[Dehydrator] Recipe now requires "+material.smallestStackSizeWhenProcessing+"x "+mainDust.getDisplayName()+" as input.");
- }
- else {
- mainDust = material.getDust(mTotalCount);
- Logger.MATERIALS("[Dehydrator] Could not find valid input dust, trying alternative.");
- if (mainDust != null){
- Logger.MATERIALS("[Dehydrator] Recipe now requires "+mTotalCount+"x "+mainDust.getDisplayName()+" as input.");
- }
- else {
- Logger.MATERIALS("[Dehydrator] Could not find valid input dust, exiting.");
- }
- }
-
- for (int j=0;j<mInternalOutputs.length;j++){
- if (mInternalOutputs[j] == null){
- mInternalOutputs[j] = GT_Values.NI;
- Logger.MATERIALS("[Dehydrator] Set slot "+j+" to null.");
- }
- else {
- Logger.MATERIALS("[Dehydrator] Set slot "+j+" to "+mInternalOutputs[j].getDisplayName()+".");
- }
- }
-
- try{
- if (CORE.RA.addDehydratorRecipe(
- new ItemStack[]{mainDust, emptyCell},
- null,
- null,
- mInternalOutputs,
- mChances,
- (int) Math.max(material.getMass() * 4L * 1, 1),
- tVoltageMultiplier)){
- Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for "+matDust.getDisplayName());
- Logger.MATERIALS("Inputs: "+mainDust.getDisplayName()+" x"+mainDust.stackSize+", "+(emptyCell == null ? "No Cells" : ""+emptyCell.getDisplayName()+" x"+emptyCell.stackSize));
- Logger.MATERIALS("Outputs "+ItemUtils.getArrayStackNames(mInternalOutputs));
- Logger.MATERIALS("Time: "+((int) Math.max(material.getMass() * 4L * 1, 1)));
- Logger.MATERIALS("EU: "+tVoltageMultiplier);
- }
- else {
- Logger.MATERIALS("[Dehydrator] Failed to generate Dehydrator recipe for "+matDust.getDisplayName());
- }
- }
- catch(Throwable t){
- t.printStackTrace();
- }
-
-
- }
- }
-
-
- /**
- * Shaped Crafting
- */
- RecipeUtils.addShapedRecipe(
- CI.craftingToolHammer_Hard, null, null,
- material.getCrushedPurified(1), null, null,
- null, null, null,
- material.getDustPurified(1));
-
- RecipeUtils.addShapedRecipe(
- CI.craftingToolHammer_Hard, null, null,
- material.getCrushed(1), null, null,
- null, null, null,
- material.getDustImpure(1));
-
- RecipeUtils.addShapedRecipe(
- CI.craftingToolHammer_Hard, null, null,
- material.getCrushedCentrifuged(1), null, null,
- null, null, null,
- matDust);
-
-
-
- final ItemStack normalDust = matDust;
- final ItemStack smallDust = material.getSmallDust(1);
- final ItemStack tinyDust = material.getTinyDust(1);
-
- if (RecipeUtils.addShapedRecipe(
- tinyDust, tinyDust, tinyDust,
- tinyDust, tinyDust, tinyDust,
- tinyDust, tinyDust, tinyDust,
- normalDust)){
- Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- if (RecipeUtils.addShapedRecipe(
- normalDust, null, null,
- null, null, null,
- null, null, null,
- material.getTinyDust(9))){
- Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
-
- if (RecipeUtils.addShapedRecipe(
- smallDust, smallDust, null,
- smallDust, smallDust, null,
- null, null, null,
- normalDust)){
- Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
-
- if (RecipeUtils.addShapedRecipe(
- null, normalDust, null,
- null, null, null,
- null, null, null,
- material.getSmallDust(4))){
- Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- //}
- }
-
-
- public static 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) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) {
- Logger.MATERIALS("[Electrolyzer] Either both inputs or outputs are null.");
- return false;
- }
- if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aInput1, aDuration)) <= 0)) {
- Logger.MATERIALS("[Electrolyzer] Fail 1.");
- return false;
- }
- if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aFluidInput.getFluid().getName(), aDuration)) <= 0)) {
- Logger.MATERIALS("[Electrolyzer] Fail 2.");
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6}, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- Logger.MATERIALS("[Electrolyzer] Recipe added.");
- return true;
- }
-
- public static ItemStack getTinyDust(Material m) {
- ItemStack x = m.getTinyDust(1);
- if (x == null) {
- x = mStone.getDust(1);
- }
- return x;
- }
-
- public static ItemStack getDust(Material m) {
- ItemStack x = m.getDust(1);
- if (x == null) {
- x = mStone.getDust(1);
- }
- return x;
- }
-
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_Ore(final Material M) {
+ this(M, false);
+ }
+
+ public RecipeGen_Ore(final Material M, final boolean O) {
+ this.toGenerate = M;
+ this.disableOptional = O;
+ mRecipeGenMap.add(this);
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate, this.disableOptional);
+ }
+
+ private static Material mStone;
+
+ private void generateRecipes(final Material material, final boolean disableOptional) {
+
+ if (mStone == null) {
+ mStone = MaterialUtils.generateMaterialFromGtENUM(Materials.Stone);
+ }
+
+ // if (material.getMaterialComposites().length > 1){
+ Logger.MATERIALS("[Recipe Generator Debug] [" + material.getLocalizedName() + "]");
+ int tVoltageMultiplier = MaterialUtils.getVoltageForTier(material.vTier);
+
+ final ItemStack dustStone = ItemUtils.getItemStackOfAmountFromOreDict("dustStone", 1);
+ Material bonusA = null; // Ni
+ Material bonusB = null; // Tin
+
+ if (material.getComposites().size() >= 1 && material.getComposites().get(0) != null) {
+ bonusA = material.getComposites().get(0).getStackMaterial();
+ } else {
+ bonusA = material;
+ }
+
+ boolean allFailed = false;
+
+ // Setup Bonuses
+ ArrayList<Material> aMatComp = new ArrayList<Material>();
+ for (Material j : MaterialUtils.getCompoundMaterialsRecursively(material)) {
+ aMatComp.add(j);
+ }
+
+ if (aMatComp.size() < 3) {
+ while (aMatComp.size() < 3) {
+ aMatComp.add(material);
+ }
+ }
+
+ AutoMap<Material> amJ = new AutoMap<Material>();
+ int aIndexCounter = 0;
+ for (Material g : aMatComp) {
+ if (g.hasSolidForm()) {
+ if (getDust(g) != null && getTinyDust(g) != null) {
+ amJ.put(g);
+ }
+ }
+ }
+
+ if (amJ.size() < 2) {
+ if (material.getComposites().size() >= 2 && material.getComposites().get(1) != null) {
+ bonusB = material.getComposites().get(1).getStackMaterial();
+ // If Secondary Output has no solid output, try the third (If it exists)
+ if (!bonusB.hasSolidForm()
+ && material.getComposites().size() >= 3
+ && material.getComposites().get(2) != null) {
+ bonusB = material.getComposites().get(2).getStackMaterial();
+ // If Third Output has no solid output, try the Fourth (If it exists)
+ if (!bonusB.hasSolidForm()
+ && material.getComposites().size() >= 4
+ && material.getComposites().get(3) != null) {
+ bonusB = material.getComposites().get(3).getStackMaterial();
+ // If Fourth Output has no solid output, try the Fifth (If it exists)
+ if (!bonusB.hasSolidForm()
+ && material.getComposites().size() >= 5
+ && material.getComposites().get(4) != null) {
+ bonusB = material.getComposites().get(4).getStackMaterial();
+ // If Fifth Output has no solid output, default out to Stone dust.
+ if (!bonusB.hasSolidForm()) {
+ allFailed = true;
+ bonusB = mStone;
+ }
+ }
+ }
+ }
+ } else {
+ allFailed = true;
+ }
+ } else {
+ bonusA = amJ.get(0);
+ bonusB = amJ.get(1);
+ }
+
+ // Default out if it's made of fluids or some shit.
+ if (bonusA == null) {
+ bonusA = tVoltageMultiplier > 100 ? material : mStone;
+ }
+ // Default out if it's made of fluids or some shit.
+ if (allFailed || bonusB == null) {
+ bonusB = tVoltageMultiplier > 100 ? material : mStone;
+ }
+
+ AutoMap<Pair<Integer, Material>> componentMap = new AutoMap<Pair<Integer, Material>>();
+ for (MaterialStack r : material.getComposites()) {
+ if (r != null) {
+ componentMap.put(new Pair<Integer, Material>(r.getPartsPerOneHundred(), r.getStackMaterial()));
+ }
+ }
+
+ // Need two valid outputs
+ if (bonusA == null || bonusB == null || !bonusA.hasSolidForm() || !bonusB.hasSolidForm()) {
+ if (bonusA == null) {
+ bonusA = mStone;
+ }
+ if (bonusB == null) {
+ bonusB = mStone;
+ }
+ if (!bonusA.hasSolidForm()) {
+ bonusA = mStone;
+ }
+ if (!bonusB.hasSolidForm()) {
+ bonusB = mStone;
+ }
+ }
+
+ ItemStack matDust = getDust(material);
+ ItemStack matDustA = getDust(bonusA);
+ ItemStack matDustB = getDust(bonusB);
+
+ /**
+ * Package
+ */
+ // Allow ore dusts to be packaged
+ if (ItemUtils.checkForInvalidItems(material.getSmallDust(1))
+ && ItemUtils.checkForInvalidItems(material.getTinyDust(1))) {
+ RecipeGen_DustGeneration.generatePackagerRecipes(material);
+ }
+
+ /**
+ * Macerate
+ */
+ // Macerate ore to Crushed
+ if (GT_Values.RA.addPulveriserRecipe(
+ material.getOre(1),
+ new ItemStack[] {material.getCrushed(2)},
+ new int[] {10000},
+ 20 * 20,
+ tVoltageMultiplier / 2)) {
+ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'");
+ }
+ // Macerate Crushed to Impure Dust
+ if (GT_Values.RA.addPulveriserRecipe(
+ material.getCrushed(1),
+ new ItemStack[] {material.getDustImpure(1), matDustA},
+ new int[] {10000, 1000},
+ 20 * 20,
+ tVoltageMultiplier / 2)) {
+ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Crushed ore to Impure Dust'");
+ }
+ // Macerate Washed to Purified Dust
+ if (GT_Values.RA.addPulveriserRecipe(
+ material.getCrushedPurified(1),
+ new ItemStack[] {material.getDustPurified(1), matDustA},
+ new int[] {10000, 1000},
+ 20 * 20,
+ tVoltageMultiplier / 2)) {
+ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Washed ore to Purified Dust'");
+ }
+ // Macerate Centrifuged to Pure Dust
+ if (GT_Values.RA.addPulveriserRecipe(
+ material.getCrushedCentrifuged(1),
+ new ItemStack[] {matDust, matDustA},
+ new int[] {10000, 1000},
+ 20 * 20,
+ tVoltageMultiplier / 2)) {
+ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'");
+ }
+
+ /**
+ * Wash
+ */
+ // Wash into Purified Crushed
+ /*if (GT_Values.RA.addOreWasherRecipe(material.getCrushed(1), material.getCrushedPurified(1), bonusA.getTinyDust(1), dustStone, FluidUtils.getWater(1000), 25*20, 16)){
+ Logger.MATERIALS("[OreWasher] Added Recipe: 'Wash Crushed ore into Purified Crushed ore'");
+ }*/
+ // .08 compat method
+ if (GT_ModHandler.addOreWasherRecipe(
+ material.getCrushed(1),
+ new int[] {10000, 1111, 10000},
+ 1000,
+ material.getCrushedPurified(1),
+ matDustA,
+ dustStone)) {
+ Logger.MATERIALS("[OreWasher] Added Recipe: 'Wash Crushed ore into Purified Crushed ore'");
+ }
+
+ /**
+ * Thermal Centrifuge
+ */
+ /*//Crushed ore to Centrifuged Ore
+ if (GT_Values.RA.addThermalCentrifugeRecipe(material.getCrushed(1), material.getCrushedCentrifuged(1), tinyDustB, dustStone, 25*20, 24)){
+ Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore'");
+ }
+ //Washed ore to Centrifuged Ore
+ if (GT_Values.RA.addThermalCentrifugeRecipe(material.getCrushedPurified(1), material.getCrushedCentrifuged(1), bonusA.getTinyDust(1), dustStone, 25*20, 24)){
+ Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore'");
+ }*/
+
+ Logger.MATERIALS("material.getCrushed(1): " + (material.getCrushed(1) != null));
+ Logger.MATERIALS("material.getCrushedPurified(1): " + (material.getCrushedPurified(1) != null));
+
+ Logger.MATERIALS("material.getTinyDust(1): " + (ItemUtils.getItemName(bonusA.getCrushed(1))));
+ Logger.MATERIALS("material.getTinyDust(1): " + (ItemUtils.getItemName(bonusB.getCrushed(1))));
+
+ try {
+ // .08 compat
+ if (GT_ModHandler.addThermalCentrifugeRecipe(
+ material.getCrushed(1),
+ new int[] {10000, 1111, 10000},
+ (int) Math.min(5000L, Math.abs(material.getMass() * 20L)),
+ material.getCrushedCentrifuged(1),
+ matDustB,
+ dustStone)) {
+ Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore' | Input: "
+ + material.getCrushed(1).getDisplayName() + " | Outputs: "
+ + material.getCrushedCentrifuged(1).getDisplayName() + ", " + matDustB.getDisplayName() + ", "
+ + dustStone.getDisplayName() + ".");
+ }
+ } catch (Throwable t) {
+ }
+ try {
+ if (GT_ModHandler.addThermalCentrifugeRecipe(
+ material.getCrushedPurified(1),
+ new int[] {10000, 1111, 10000},
+ (int) Math.min(5000L, Math.abs(material.getMass() * 20L)),
+ material.getCrushedCentrifuged(1),
+ matDustA,
+ dustStone)) {
+ Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: "
+ + material.getCrushedPurified(1).getDisplayName() + " | Outputs: "
+ + material.getCrushedCentrifuged(1).getDisplayName() + ", " + matDustA.getDisplayName() + ", "
+ + dustStone.getDisplayName() + ".");
+ }
+ } catch (Throwable t) {
+ }
+
+ /**
+ * Forge Hammer
+ */
+ if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), matDust, 10, tVoltageMultiplier / 4)) {
+ Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'");
+ }
+ if (GT_Values.RA.addForgeHammerRecipe(
+ material.getCrushedPurified(1), material.getDustPurified(1), 10, tVoltageMultiplier / 4)) {
+ Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Purified to Purified Dust'");
+ }
+ if (GT_Values.RA.addForgeHammerRecipe(material.getOre(1), material.getCrushed(1), 10, tVoltageMultiplier / 4)) {
+ Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Ore to Crushed'");
+ }
+
+ /**
+ * Centrifuge
+ */
+ // Purified Dust to Clean
+ if (GT_Values.RA.addCentrifugeRecipe(
+ material.getDustPurified(1),
+ null,
+ null, // In Fluid
+ null, // Out Fluid
+ matDust,
+ matDustA,
+ null,
+ null,
+ null,
+ null,
+ new int[] {10000, 1111}, // Chances
+ (int) Math.max(1L, material.getMass() * 8L), // Time
+ tVoltageMultiplier / 2)) { // Eu
+ Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust");
+ }
+
+ // Impure Dust to Clean
+ if (GT_Values.RA.addCentrifugeRecipe(
+ material.getDustImpure(1),
+ null,
+ null, // In Fluid
+ null, // Out Fluid
+ matDust,
+ matDustB,
+ null,
+ null,
+ null,
+ null,
+ new int[] {10000, 1111}, // Chances
+ (int) Math.max(1L, material.getMass() * 8L), // Time
+ tVoltageMultiplier / 2)) { // Eu
+ Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust");
+ }
+
+ /**
+ * Electrolyzer
+ */
+ if (!disableOptional) {
+ // Process Dust
+ if (componentMap.size() > 0 && componentMap.size() <= 6) {
+
+ ItemStack mInternalOutputs[] = new ItemStack[6];
+ int mChances[] = new int[6];
+ int mCellCount = 0;
+
+ int mTotalCount = 0;
+
+ int mCounter = 0;
+ for (Pair<Integer, Material> f : componentMap) {
+ if (f.getValue().getState() != MaterialState.SOLID) {
+ Logger.MATERIALS("[Electrolyzer] Found Fluid Component, adding " + f.getKey() + " cells of "
+ + f.getValue().getLocalizedName() + ".");
+ mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey());
+ mCellCount += f.getKey();
+ mTotalCount += f.getKey();
+ Logger.MATERIALS("[Electrolyzer] In total, adding " + mCellCount + " cells for "
+ + material.getLocalizedName() + " processing.");
+ } else {
+ Logger.MATERIALS("[Electrolyzer] Found Solid Component, adding " + f.getKey() + " dusts of "
+ + f.getValue().getLocalizedName() + ".");
+ mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey());
+ mTotalCount += f.getKey();
+ }
+ }
+
+ // Build Output Array
+ for (int g = 0; g < mInternalOutputs.length; g++) {
+ Logger.MATERIALS("[Electrolyzer] Is output[" + g + "] valid with a chance? "
+ + (mInternalOutputs[g] != null ? 10000 : 0));
+ mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0);
+ }
+
+ ItemStack emptyCell = null;
+ if (mCellCount > 0) {
+ emptyCell = ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", mCellCount);
+ Logger.MATERIALS("[Electrolyzer] Recipe now requires " + mCellCount + " empty cells as input.");
+ }
+
+ ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing);
+ if (mainDust != null) {
+ Logger.MATERIALS("[Electrolyzer] Recipe now requires " + material.smallestStackSizeWhenProcessing
+ + "x " + mainDust.getDisplayName() + " as input.");
+ } else {
+ mainDust = material.getDust(mTotalCount);
+ Logger.MATERIALS("[Electrolyzer] Could not find valid input dust, trying alternative.");
+ if (mainDust != null) {
+ Logger.MATERIALS("[Electrolyzer] Recipe now requires " + mTotalCount + "x "
+ + mainDust.getDisplayName() + " as input.");
+ } else {
+ Logger.MATERIALS("[Electrolyzer] Could not find valid input dust, exiting.");
+ }
+ }
+
+ for (int j = 0; j < mInternalOutputs.length; j++) {
+ if (mInternalOutputs[j] == null) {
+ mInternalOutputs[j] = GT_Values.NI;
+ Logger.MATERIALS("[Electrolyzer] Set slot " + j + " to null.");
+ } else {
+ Logger.MATERIALS(
+ "[Electrolyzer] Set slot " + j + " to " + mInternalOutputs[j].getDisplayName() + ".");
+ }
+ }
+
+ try {
+ if (addElectrolyzerRecipe(
+ mainDust,
+ emptyCell, // input 2
+ null, // Input fluid 1
+ null, // Output fluid 1
+ mInternalOutputs[0],
+ mInternalOutputs[1],
+ mInternalOutputs[2],
+ mInternalOutputs[3],
+ mInternalOutputs[4],
+ mInternalOutputs[5],
+ mChances,
+ (int) Math.max(material.getMass() * 3L * 1, 1),
+ tVoltageMultiplier)) {
+ Logger.MATERIALS(
+ "[Electrolyzer] Generated Electrolyzer recipe for " + matDust.getDisplayName());
+ } else {
+ Logger.MATERIALS("[Electrolyzer] Failed to generate Electrolyzer recipe for "
+ + matDust.getDisplayName());
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ } else if (componentMap.size() > 6 && componentMap.size() <= 9) {
+ Logger.MATERIALS(
+ "[Issue][Electrolyzer] " + material.getLocalizedName()
+ + " is composed of over 6 materials, so an electrolyzer recipe for processing cannot be generated. Trying to create one for the Dehydrator instead.");
+
+ ItemStack mInternalOutputs[] = new ItemStack[9];
+ int mChances[] = new int[9];
+ int mCellCount = 0;
+
+ int mTotalCount = 0;
+
+ int mCounter = 0;
+ for (Pair<Integer, Material> f : componentMap) {
+ if (f.getValue().getState() != MaterialState.SOLID
+ && f.getValue().getState() != MaterialState.ORE) {
+ Logger.MATERIALS("[Dehydrator] Found Fluid Component, adding " + f.getKey() + " cells of "
+ + f.getValue().getLocalizedName() + ".");
+ mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey());
+ mCellCount += f.getKey();
+ mTotalCount += f.getKey();
+ Logger.MATERIALS("[Dehydrator] In total, adding " + mCellCount + " cells for "
+ + material.getLocalizedName() + " processing.");
+ } else {
+ Logger.MATERIALS("[Dehydrator] Found Solid Component, adding " + f.getKey() + " dusts of "
+ + f.getValue().getLocalizedName() + ".");
+ mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey());
+ mTotalCount += f.getKey();
+ }
+ }
+
+ // Build Output Array
+ for (int g = 0; g < mInternalOutputs.length; g++) {
+ Logger.MATERIALS("[Dehydrator] Is output[" + g + "] valid with a chance? "
+ + (mInternalOutputs[g] != null ? 10000 : 0));
+ mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0);
+ }
+
+ ItemStack emptyCell = null;
+ if (mCellCount > 0) {
+ emptyCell = ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", mCellCount);
+ Logger.MATERIALS("[Dehydrator] Recipe now requires " + mCellCount + " empty cells as input.");
+ }
+
+ ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing);
+ if (mainDust != null) {
+ Logger.MATERIALS("[Dehydrator] Recipe now requires " + material.smallestStackSizeWhenProcessing
+ + "x " + mainDust.getDisplayName() + " as input.");
+ } else {
+ mainDust = material.getDust(mTotalCount);
+ Logger.MATERIALS("[Dehydrator] Could not find valid input dust, trying alternative.");
+ if (mainDust != null) {
+ Logger.MATERIALS("[Dehydrator] Recipe now requires " + mTotalCount + "x "
+ + mainDust.getDisplayName() + " as input.");
+ } else {
+ Logger.MATERIALS("[Dehydrator] Could not find valid input dust, exiting.");
+ }
+ }
+
+ for (int j = 0; j < mInternalOutputs.length; j++) {
+ if (mInternalOutputs[j] == null) {
+ mInternalOutputs[j] = GT_Values.NI;
+ Logger.MATERIALS("[Dehydrator] Set slot " + j + " to null.");
+ } else {
+ Logger.MATERIALS(
+ "[Dehydrator] Set slot " + j + " to " + mInternalOutputs[j].getDisplayName() + ".");
+ }
+ }
+
+ try {
+ if (CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {mainDust, emptyCell},
+ null,
+ null,
+ mInternalOutputs,
+ mChances,
+ (int) Math.max(material.getMass() * 4L * 1, 1),
+ tVoltageMultiplier)) {
+ Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for " + matDust.getDisplayName());
+ Logger.MATERIALS("Inputs: " + mainDust.getDisplayName() + " x" + mainDust.stackSize + ", "
+ + (emptyCell == null
+ ? "No Cells"
+ : "" + emptyCell.getDisplayName() + " x" + emptyCell.stackSize));
+ Logger.MATERIALS("Outputs " + ItemUtils.getArrayStackNames(mInternalOutputs));
+ Logger.MATERIALS("Time: " + ((int) Math.max(material.getMass() * 4L * 1, 1)));
+ Logger.MATERIALS("EU: " + tVoltageMultiplier);
+ } else {
+ Logger.MATERIALS(
+ "[Dehydrator] Failed to generate Dehydrator recipe for " + matDust.getDisplayName());
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Shaped Crafting
+ */
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard,
+ null,
+ null,
+ material.getCrushedPurified(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getDustPurified(1));
+
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard,
+ null,
+ null,
+ material.getCrushed(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getDustImpure(1));
+
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard,
+ null,
+ null,
+ material.getCrushedCentrifuged(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ matDust);
+
+ final ItemStack normalDust = matDust;
+ final ItemStack smallDust = material.getSmallDust(1);
+ final ItemStack tinyDust = material.getTinyDust(1);
+
+ if (RecipeUtils.addShapedRecipe(
+ tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, normalDust)) {
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ normalDust, null, null, null, null, null, null, null, null, material.getTinyDust(9))) {
+ Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, normalDust)) {
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ null, normalDust, null, null, null, null, null, null, null, material.getSmallDust(4))) {
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // }
+ }
+
+ public static 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) {
+ if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) {
+ Logger.MATERIALS("[Electrolyzer] Either both inputs or outputs are null.");
+ return false;
+ }
+ if ((aInput1 != null)
+ && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aInput1, aDuration)) <= 0)) {
+ Logger.MATERIALS("[Electrolyzer] Fail 1.");
+ return false;
+ }
+ if ((aFluidInput != null)
+ && ((aDuration = GregTech_API.sRecipeFile.get(
+ "electrolyzer", aFluidInput.getFluid().getName(), aDuration))
+ <= 0)) {
+ Logger.MATERIALS("[Electrolyzer] Fail 2.");
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(
+ true,
+ new ItemStack[] {aInput1, aInput2},
+ new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6},
+ null,
+ aChances,
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ aDuration,
+ aEUt,
+ 0);
+ Logger.MATERIALS("[Electrolyzer] Recipe added.");
+ return true;
+ }
+
+ public static ItemStack getTinyDust(Material m) {
+ ItemStack x = m.getTinyDust(1);
+ if (x == null) {
+ x = mStone.getDust(1);
+ }
+ return x;
+ }
+
+ public static ItemStack getDust(Material m) {
+ ItemStack x = m.getDust(1);
+ if (x == null) {
+ x = mStone.getDust(1);
+ }
+ return x;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java
index 7355ac7dc0..bf9ef18720 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
@@ -10,38 +7,46 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashSet;
+import java.util.Set;
import net.minecraft.item.ItemStack;
public class RecipeGen_Plasma extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
-
- public RecipeGen_Plasma(final Material M){
- this.toGenerate = M;
- mRecipeGenMap.add(this);
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate);
- }
-
- private void generateRecipes(final Material material) {
- if (material.getPlasma() != null) {
- // Cool Plasma
- ItemStack aPlasmaCell = material.getPlasmaCell(1);
- ItemStack aCell = material.getCell(1);
- ItemStack aContainerItem = GT_Utility.getFluidForFilledItem(aPlasmaCell, true) == null ? GT_Utility.getContainerItem(aPlasmaCell, true) : CI.emptyCells(1);
- if (ItemUtils.checkForInvalidItems(new ItemStack[] {aPlasmaCell, aContainerItem})){
- GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, aPlasmaCell), aContainerItem, (int) Math.max(1024L, 1024L * material.getMass()), 4);
- }
- if (ItemUtils.checkForInvalidItems(new ItemStack[] {aCell, aPlasmaCell})){
- GT_Values.RA.addVacuumFreezerRecipe(aPlasmaCell, aCell, (int) Math.max(material.getMass() * 2L, 1L));
- }
- }
- }
-
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_Plasma(final Material M) {
+ this.toGenerate = M;
+ mRecipeGenMap.add(this);
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate);
+ }
+
+ private void generateRecipes(final Material material) {
+ if (material.getPlasma() != null) {
+ // Cool Plasma
+ ItemStack aPlasmaCell = material.getPlasmaCell(1);
+ ItemStack aCell = material.getCell(1);
+ ItemStack aContainerItem = GT_Utility.getFluidForFilledItem(aPlasmaCell, true) == null
+ ? GT_Utility.getContainerItem(aPlasmaCell, true)
+ : CI.emptyCells(1);
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aPlasmaCell, aContainerItem})) {
+ GT_Values.RA.addFuel(
+ GT_Utility.copyAmount(1L, aPlasmaCell),
+ aContainerItem,
+ (int) Math.max(1024L, 1024L * material.getMass()),
+ 4);
+ }
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aCell, aPlasmaCell})) {
+ GT_Values.RA.addVacuumFreezerRecipe(aPlasmaCell, aCell, (int) Math.max(material.getMass() * 2L, 1L));
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java
index 6b512f4b3a..d33c1d4ad6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java
@@ -1,170 +1,171 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashSet;
+import java.util.Set;
import net.minecraft.item.ItemStack;
public class RecipeGen_Plates extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
-
- public RecipeGen_Plates(final Material M){
- this.toGenerate = M;
- mRecipeGenMap.add(this);
- }
-
- @Override
- public void run() {
- generateRecipes(this.toGenerate);
- }
-
- private void generateRecipes(final Material material){
-
- final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 60 : 15;
- final ItemStack ingotStackOne = material.getIngot(1);
- final ItemStack ingotStackTwo = material.getIngot(2);
- final ItemStack shape_Mold = ItemList.Shape_Mold_Plate.get(0);
- final ItemStack plate_Single = material.getPlate(1);
- final ItemStack plate_SingleTwo = material.getPlate(2);
- final ItemStack plate_SingleNine = material.getPlate(9);
- final ItemStack plate_Double = material.getPlateDouble(1);
- final ItemStack block = material.getBlock(1);
-
- Logger.WARNING("Generating Plate recipes for "+material.getLocalizedName());
-
- //Forge Hammer
- if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Single))
- if (addForgeHammerRecipe(
- ingotStackTwo,
- plate_Single,
- (int) Math.max(material.getMass(), 1L),
- material.vVoltageMultiplier)){
- Logger.WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Failed");
- }
- //Bender
- if (ItemUtils.checkForInvalidItems(ingotStackOne) && ItemUtils.checkForInvalidItems(plate_Single))
- if (addBenderRecipe(
- ingotStackOne,
- plate_Single,
- (int) Math.max(material.getMass() * 1L, 1L),
- material.vVoltageMultiplier)){
- Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed");
- }
- //Alloy Smelter
- if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Single))
- if (GT_Values.RA.addAlloySmelterRecipe(
- ingotStackTwo,
- shape_Mold,
- plate_Single,
- (int) Math.max(material.getMass() * 2L, 1L),
- material.vVoltageMultiplier)){
- Logger.WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Failed");
- }
- //Cutting Machine
- if (ItemUtils.checkForInvalidItems(block) && ItemUtils.checkForInvalidItems(plate_Single))
- if (GT_Values.RA.addCutterRecipe(
- block,
- null,
- plate_SingleNine,
- (int) Math.max(material.getMass() * 10L, 1L),
- material.vVoltageMultiplier)){
- Logger.WARNING("Cutting Machine Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Cutting Machine Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
-
- //Making Double Plates
- if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Double))
- if (addBenderRecipe(
- ingotStackTwo,
- plate_Double,
- (int) Math.max(material.getMass() * 2L, 1L),
- material.vVoltageMultiplier)){
- Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- if (ItemUtils.checkForInvalidItems(plate_SingleTwo) && ItemUtils.checkForInvalidItems(plate_Double))
- if (addBenderRecipe(
- plate_SingleTwo,
- plate_Double,
- (int) Math.max(material.getMass() * 2L, 1L),
- material.vVoltageMultiplier)){
- Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed");
- }
-
- //Bender
- if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getFoil(1)))
- if (addBenderRecipe(
- material.getPlate(1),
- material.getFoil(4),
- (int) Math.max(material.getMass(), 1L),
- material.vVoltageMultiplier)){
- GregTech_API.registerCover(material.getFoil(1), new GT_RenderedTexture(material.getTextureSet().mTextures[70], material.getRGBA(), false), null);
- Logger.WARNING("Bender Foil Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Bender Foil Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
-
- public static boolean addBenderRecipe(final ItemStack aInput1, final ItemStack aOutput1, int aDuration, final int aEUt) {
- return GT_Values.RA.addBenderRecipe(aInput1, aOutput1, aDuration, aEUt);
- }
-
- public static boolean addExtruderRecipe(final ItemStack aInput, final ItemStack aShape, final ItemStack aOutput, int aDuration, final int aEUt) {
- if ((aInput == null) || (aShape == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public static boolean addForgeHammerRecipe(final ItemStack aInput1, final ItemStack aOutput1, final int aDuration, final int aEUt) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
-
-
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_Plates(final Material M) {
+ this.toGenerate = M;
+ mRecipeGenMap.add(this);
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate);
+ }
+
+ private void generateRecipes(final Material material) {
+
+ final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 60 : 15;
+ final ItemStack ingotStackOne = material.getIngot(1);
+ final ItemStack ingotStackTwo = material.getIngot(2);
+ final ItemStack shape_Mold = ItemList.Shape_Mold_Plate.get(0);
+ final ItemStack plate_Single = material.getPlate(1);
+ final ItemStack plate_SingleTwo = material.getPlate(2);
+ final ItemStack plate_SingleNine = material.getPlate(9);
+ final ItemStack plate_Double = material.getPlateDouble(1);
+ final ItemStack block = material.getBlock(1);
+
+ Logger.WARNING("Generating Plate recipes for " + material.getLocalizedName());
+
+ // Forge Hammer
+ if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Single))
+ if (addForgeHammerRecipe(
+ ingotStackTwo, plate_Single, (int) Math.max(material.getMass(), 1L), material.vVoltageMultiplier)) {
+ Logger.WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ // Bender
+ if (ItemUtils.checkForInvalidItems(ingotStackOne) && ItemUtils.checkForInvalidItems(plate_Single))
+ if (addBenderRecipe(
+ ingotStackOne,
+ plate_Single,
+ (int) Math.max(material.getMass() * 1L, 1L),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ // Alloy Smelter
+ if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Single))
+ if (GT_Values.RA.addAlloySmelterRecipe(
+ ingotStackTwo,
+ shape_Mold,
+ plate_Single,
+ (int) Math.max(material.getMass() * 2L, 1L),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ // Cutting Machine
+ if (ItemUtils.checkForInvalidItems(block) && ItemUtils.checkForInvalidItems(plate_Single))
+ if (GT_Values.RA.addCutterRecipe(
+ block,
+ null,
+ plate_SingleNine,
+ (int) Math.max(material.getMass() * 10L, 1L),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Cutting Machine Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Cutting Machine Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Making Double Plates
+ if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Double))
+ if (addBenderRecipe(
+ ingotStackTwo,
+ plate_Double,
+ (int) Math.max(material.getMass() * 2L, 1L),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ if (ItemUtils.checkForInvalidItems(plate_SingleTwo) && ItemUtils.checkForInvalidItems(plate_Double))
+ if (addBenderRecipe(
+ plate_SingleTwo,
+ plate_Double,
+ (int) Math.max(material.getMass() * 2L, 1L),
+ material.vVoltageMultiplier)) {
+ Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+
+ // Bender
+ if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getFoil(1)))
+ if (addBenderRecipe(
+ material.getPlate(1),
+ material.getFoil(4),
+ (int) Math.max(material.getMass(), 1L),
+ material.vVoltageMultiplier)) {
+ GregTech_API.registerCover(
+ material.getFoil(1),
+ new GT_RenderedTexture(material.getTextureSet().mTextures[70], material.getRGBA(), false),
+ null);
+ Logger.WARNING("Bender Foil Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Bender Foil Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+
+ public static boolean addBenderRecipe(
+ final ItemStack aInput1, final ItemStack aOutput1, int aDuration, final int aEUt) {
+ return GT_Values.RA.addBenderRecipe(aInput1, aOutput1, aDuration, aEUt);
+ }
+
+ public static boolean addExtruderRecipe(
+ final ItemStack aInput, final ItemStack aShape, final ItemStack aOutput, int aDuration, final int aEUt) {
+ if ((aInput == null) || (aShape == null) || (aOutput == null)) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) {
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(
+ true,
+ new ItemStack[] {aInput, aShape},
+ new ItemStack[] {aOutput},
+ null,
+ null,
+ null,
+ aDuration,
+ aEUt,
+ 0);
+ return true;
+ }
+
+ public static boolean addForgeHammerRecipe(
+ final ItemStack aInput1, final ItemStack aOutput1, final int aDuration, final int aEUt) {
+ if ((aInput1 == null) || (aOutput1 == null)) {
+ return false;
+ }
+ if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) {
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(
+ true, new ItemStack[] {aInput1}, new ItemStack[] {aOutput1}, null, null, null, aDuration, aEUt, 0);
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
index ed9203fe34..18391d170f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
@@ -2,16 +2,9 @@ package gtPlusPlus.xmod.gregtech.loaders;
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.Map;
-
-import org.apache.commons.lang3.reflect.FieldUtils;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.SubTag;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
@@ -24,357 +17,402 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.util.ArrayList;
+import java.util.Map;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
+import org.apache.commons.lang3.reflect.FieldUtils;
public class RecipeGen_Recycling implements Runnable {
- public static AutoMap<Runnable> mQueuedRecyclingGenerators = new AutoMap<Runnable>();
-
- public static void executeGenerators() {
- if (mQueuedRecyclingGenerators.size() > 0) {
- for (Runnable R : mQueuedRecyclingGenerators.values()) {
- R.run();
- }
- }
- }
-
- final Material toGenerate;
- public static Map<String, ItemStack> mNameMap;
-
- public RecipeGen_Recycling(final Material M) {
- this.toGenerate = M;
- if (mNameMap == null){
- mNameMap = this.getNameMap();
- }
- mQueuedRecyclingGenerators.put(this);
- }
-
- @Override
- public void run() {
- if (mNameMap != null){
- generateRecipes(this.toGenerate);
- }
- }
-
- public static void generateRecipes(final Material material) {
-
- if (material != null)
- Logger.WARNING("Generating Recycling recipes for " + material.getLocalizedName());
-
- final OrePrefixes[] mValidPrefixesAsString = { OrePrefixes.ingot, OrePrefixes.ingotHot, OrePrefixes.nugget,
- OrePrefixes.plate, OrePrefixes.plateDense, OrePrefixes.plateDouble, OrePrefixes.plateTriple,
- OrePrefixes.plateQuadruple, OrePrefixes.plateQuintuple, OrePrefixes.stick, OrePrefixes.stickLong,
- OrePrefixes.bolt, OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.rotor, OrePrefixes.gearGt,
- OrePrefixes.gearGtSmall, OrePrefixes.gear, OrePrefixes.block, OrePrefixes.cableGt01, OrePrefixes.cableGt02,
- OrePrefixes.cableGt04, OrePrefixes.cableGt08, OrePrefixes.cableGt12, OrePrefixes.wireFine, OrePrefixes.wireGt01,
- OrePrefixes.wireGt02, OrePrefixes.wireGt04, OrePrefixes.wireGt08, OrePrefixes.wireGt12, OrePrefixes.wireGt16,
- OrePrefixes.foil, OrePrefixes.frameGt, OrePrefixes.pipeHuge, OrePrefixes.pipeLarge, OrePrefixes.pipeMedium, OrePrefixes.pipeSmall, OrePrefixes.pipeTiny,
- };
-
- int mSlotIndex = 0;
- Pair<OrePrefixes, ItemStack>[] mValidPairs = new Pair[mValidPrefixesAsString.length];
-
- for (int r=0;r<mValidPairs.length;r++){
- ItemStack temp = getItemStackOfAmountFromOreDictNoBroken(mValidPrefixesAsString[r].name()+Utils.sanitizeString(material.getLocalizedName()), 1);
- if (temp != null){
- mValidPairs[mSlotIndex++] = new Pair<OrePrefixes, ItemStack>(mValidPrefixesAsString[r], temp.copy());
- }
- }
-
- if (mValidPairs.length > 0){
- int validCounter = 0;
- Pair<OrePrefixes, ItemStack>[] temp = mValidPairs;
- for (Pair<OrePrefixes, ItemStack> temp2 : mValidPairs){
- if (temp2 != null){
- Logger.WARNING("Valid: "+temp2.getValue().getDisplayName());
- validCounter++;
- }
- }
- Pair<OrePrefixes, ItemStack> temp3[] = new Pair[validCounter];
- int temp4 = 0;
- for (Pair<OrePrefixes, ItemStack> r : mValidPairs){
- if (r != null){
- temp3[temp4++] = r;
- }
- }
- if (temp3.length > 0){
- mValidPairs = temp3.clone();
- }
- }
-
- if (mValidPrefixesAsString.length >= 1) {
- for (final Pair<OrePrefixes, ItemStack> validPrefix : mValidPairs) {
- try {
-
- if (material == null || validPrefix == null || (material.getState() != MaterialState.SOLID && material.getState() != MaterialState.LIQUID) || validPrefix.getKey() == OrePrefixes.ingotHot) {
- continue;
- }
-
- final ItemStack tempStack = validPrefix.getValue();
- final ItemStack mDust = getDust(material, validPrefix.getKey());
- final Pair<OrePrefixes, ItemStack> mData = getDustData(material, validPrefix.getKey());
- int mFluidAmount = (int) GT_Utility.translateMaterialToFluidAmount(validPrefix.getKey().mMaterialAmount, true);
-
- //Maceration
- if (ItemUtils.checkForInvalidItems(tempStack)) {
- // mValidItems[mSlotIndex++] = tempStack;
- if ((mDust != null) && GT_ModHandler.addPulverisationRecipe(tempStack, mDust)) {
- Logger.WARNING("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle "
- + tempStack.getDisplayName() + " and obtain " + mDust.getDisplayName());
- }
- else {
- Logger.WARNING("Recycle Recipe: " + material.getLocalizedName() + " - Failed");
- if (mDust == null) {
- Logger.WARNING("Invalid Dust output.");
- }
- }
- }
-
- //Arc Furnace
- if (ItemUtils.checkForInvalidItems(tempStack)) {
-
- }
-
- //Fluid Extractor
- if (ItemUtils.checkForInvalidItems(tempStack)) {
- // mValidItems[mSlotIndex++] = tempStack;
-
- int aFluidAmount = (int) ((L * validPrefix.getKey().mMaterialAmount) / (M * tempStack.stackSize));
- int aDuration = (int) Math.max(1, (24 * validPrefix.getKey().mMaterialAmount) / M);
- boolean aGenFluidExtraction = CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluidStack(aFluidAmount), aDuration, material.vVoltageMultiplier);
- if (aGenFluidExtraction/*(mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluidStack(mFluidAmount), 30, material.vVoltageMultiplier)*/) {
- Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle "
- + tempStack.getDisplayName() + " and obtain " + aFluidAmount+"mb of "+material.getFluidStack(1).getLocalizedName()+". Time: "+aDuration+", Voltage: "+material.vVoltageMultiplier);
- }
- else {
- Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Failed");
- if (mDust == null) {
- Logger.WARNING("Invalid Dust output.");
- }
- }
- }
-
- }
- catch (final Throwable t) {
- t.printStackTrace();
- // Utils.LOG_WARNING("Returning Null. Throwable Info:
- // "+t.getMessage());
- // Utils.LOG_WARNING("Throwable Info: "+t.toString());
- // Utils.LOG_WARNING("Throwable Info:
- // "+t.getCause().toString());
- }
-
- }
- }
- }
-
- public static Pair<OrePrefixes, ItemStack> getDustData(final Material aMaterial, final OrePrefixes aPrefix) {
- return getDustData(aMaterial, aPrefix.mMaterialAmount);
- }
-
- public static Pair<OrePrefixes, ItemStack> getDustData(final Material aMaterial, final long aMaterialAmount) {
- ItemStack mDust = null;
- OrePrefixes mPrefix = null;
-
- if (aMaterial == null || aMaterialAmount <= 0) {
- return null;
- }
- if ((((aMaterialAmount % M) == 0) || (aMaterialAmount >= (M * 16)))) {
- mDust = get(OrePrefixes.dust, aMaterial, aMaterialAmount / M);
- mPrefix = OrePrefixes.dust;
- }
- if ((mDust == null) && ((((aMaterialAmount * 4) % M) == 0) || (aMaterialAmount >= (M * 8)))) {
- mDust = get(OrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M);
- mPrefix = OrePrefixes.dustSmall;
- }
- if ((mDust == null) && (((aMaterialAmount * 9) >= M))) {
- mDust = get(OrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M);
- mPrefix = OrePrefixes.dustTiny;
- }
-
- if (mPrefix != null && mDust != null){
- Logger.WARNING("Built valid dust pair.");
- return new Pair<OrePrefixes, ItemStack>(mPrefix, mDust);
- }
- else {
- Logger.WARNING("mPrefix: "+(mPrefix!=null));
- Logger.WARNING("mDust: "+(mDust!=null));
- }
- Logger.WARNING("Failed to build valid dust pair.");
- return null;
- }
-
- public static ItemStack getDust(final Material aMaterial, final OrePrefixes aPrefix) {
- return aMaterial == null ? null : getDust(aMaterial, aPrefix.mMaterialAmount);
- }
-
- public static ItemStack getDust(final Material aMaterial, final long aMaterialAmount) {
- if (aMaterialAmount <= 0) {
- return null;
- }
- ItemStack rStack = null;
- if ((((aMaterialAmount % M) == 0) || (aMaterialAmount >= (M * 16)))) {
- Logger.WARNING("Trying to get a Dust");
- rStack = get(OrePrefixes.dust, aMaterial, aMaterialAmount / M);
- }
- if ((rStack == null) && ((((aMaterialAmount * 4) % M) == 0) || (aMaterialAmount >= (M * 8)))) {
- Logger.WARNING("Trying to get a Small Dust");
- rStack = get(OrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M);
- }
- if ((rStack == null) && (((aMaterialAmount * 9) >= M))) {
- Logger.WARNING("Trying to get a Tiny Dust");
- rStack = get(OrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M);
- }
- return rStack;
- }
-
- public static ItemStack get(final Object aName, final long aAmount) {
- return get(aName, null, aAmount, true, true);
- }
-
- public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount) {
- return get(aName, aReplacement, aAmount, true, true);
- }
-
- public static ItemStack get(final OrePrefixes aPrefix, final Material aMaterial, final long aAmount) {
- return get(aPrefix, aMaterial, null, aAmount);
- }
-
- public static ItemStack get(final OrePrefixes aPrefix, final Material aMaterial, final ItemStack aReplacement,
- final long aAmount) {
- return get(aPrefix.name()+Utils.sanitizeString(aMaterial.getLocalizedName()), aReplacement, aAmount, false, true);
- }
-
- public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount,
- final boolean aMentionPossibleTypos, final boolean aNoInvalidAmounts) {
- if (aNoInvalidAmounts && (aAmount < 1L)) {
- Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0));
- Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1));
- Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(2));
- Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(3));
- Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(4));
- return null;
- }
- if (!mNameMap.containsKey(aName.toString()) && aMentionPossibleTypos) {
- Logger.WARNING("Unknown Key for Unification, Typo? " + aName);
- }
- return GT_Utility.copyAmount(aAmount,
- new Object[] { mNameMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement });
- }
-
- public static ItemStack getFirstOre(final Object aName, final long aAmount) {
- if (GT_Utility.isStringInvalid(aName)) {
- Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0));
- Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1));
- Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(2));
- Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(3));
- Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(4));
- return null;
- }
- final ItemStack tStack = mNameMap.get(aName.toString());
- if (GT_Utility.isStackValid(tStack)) {
- Logger.WARNING("Found valid stack.");
- return GT_Utility.copyAmount(aAmount, new Object[] { tStack });
- }
- return GT_Utility.copyAmount(aAmount, getOres(aName).toArray());
- }
-
- public static ArrayList<ItemStack> getOres(final Object aOreName) {
- final String aName = (aOreName == null) ? "" : aOreName.toString();
- final ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
- if (GT_Utility.isStringValid(aName)) {
- Logger.WARNING("Making a list of all OreDict entries for "+aOreName+".");
- if (rList.addAll(OreDictionary.getOres(aName))){
- Logger.WARNING("Added "+rList.size()+" elements to list.");
- }
- else {
- Logger.WARNING("Failed to Add Collection from oreDictionary, forcing an entry.");
- rList.add(ItemUtils.getItemStackOfAmountFromOreDict((String) aOreName, 1));
- }
- }
- return rList;
- }
-
- @SuppressWarnings("unchecked")
- public Map<String, ItemStack> getNameMap() {
- Map<String, ItemStack> tempMap;
- try {
- tempMap = (Map<String, ItemStack>) FieldUtils.readStaticField(GT_OreDictUnificator.class, "sName2StackMap",
- true);
- if (tempMap != null) {
- Logger.WARNING("Found 'sName2StackMap' in GT_OreDictUnificator.class.");
- return tempMap;
- }
- }
- catch (final IllegalAccessException e) {
- e.printStackTrace();
- }
- Logger.WARNING("Invalid map stored in GT_OreDictUnificator.class, unable to find sName2StackMap field.");
- return null;
- }
-
- public static ItemStack getItemStackOfAmountFromOreDictNoBroken(String oredictName, final int amount) {
-
- try {
-
- if (oredictName.contains("-") || oredictName.contains("_")) {
- oredictName = Utils.sanitizeString(oredictName, new char[] {'-', '_'});
- }
- else {
- oredictName = Utils.sanitizeString(oredictName);
- }
-
- // Adds a check to grab dusts using GT methodology if possible.
- ItemStack returnValue = null;
- if (oredictName.toLowerCase().contains("dust")) {
- final String MaterialName = oredictName.toLowerCase().replace("dust", "");
- final Materials m = Materials.get(MaterialName);
- if (m != null && m != Materials._NULL) {
- returnValue = ItemUtils.getGregtechDust(m, amount);
- if (ItemUtils.checkForInvalidItems(returnValue)) {
- return returnValue;
- }
- }
- }
- if (returnValue == null) {
- returnValue = getItemStackOfAmountFromOreDict(oredictName, amount);
- if (ItemUtils.checkForInvalidItems(returnValue)) {
- return returnValue.copy();
- }
- }
- return null;
- } catch (final Throwable t) {
- return null;
- }
- }
-
- public static ItemStack getItemStackOfAmountFromOreDict(String oredictName, final int amount) {
- String mTemp = oredictName;
-
- // Banned Materials and replacements for GT5.8 compat.
-
- if (oredictName.toLowerCase().contains("ingotclay")) {
- return ItemUtils.getSimpleStack(Items.clay_ball, amount);
- }
-
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- if (oredictName.toLowerCase().contains("rutile")) {
- mTemp = oredictName.replace("Rutile", "Titanium");
- }
- if (oredictName.toLowerCase().contains("vanadiumsteel")) {
- mTemp = oredictName.replace("VanadiumSteel", "StainlessSteel");
- }
- }
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(mTemp);
- if (!oreDictList.isEmpty()) {
- final ItemStack returnValue = oreDictList.get(0).copy();
- returnValue.stackSize = amount;
- return returnValue;
- }
- return null;
- //return getItemStackOfAmountFromOreDictNoBroken(mTemp, amount);
- }
+ public static AutoMap<Runnable> mQueuedRecyclingGenerators = new AutoMap<Runnable>();
+
+ public static void executeGenerators() {
+ if (mQueuedRecyclingGenerators.size() > 0) {
+ for (Runnable R : mQueuedRecyclingGenerators.values()) {
+ R.run();
+ }
+ }
+ }
+
+ final Material toGenerate;
+ public static Map<String, ItemStack> mNameMap;
+
+ public RecipeGen_Recycling(final Material M) {
+ this.toGenerate = M;
+ if (mNameMap == null) {
+ mNameMap = this.getNameMap();
+ }
+ mQueuedRecyclingGenerators.put(this);
+ }
+
+ @Override
+ public void run() {
+ if (mNameMap != null) {
+ generateRecipes(this.toGenerate);
+ }
+ }
+
+ public static void generateRecipes(final Material material) {
+
+ if (material != null) Logger.WARNING("Generating Recycling recipes for " + material.getLocalizedName());
+
+ final OrePrefixes[] mValidPrefixesAsString = {
+ OrePrefixes.ingot,
+ OrePrefixes.ingotHot,
+ OrePrefixes.nugget,
+ OrePrefixes.plate,
+ OrePrefixes.plateDense,
+ OrePrefixes.plateDouble,
+ OrePrefixes.plateTriple,
+ OrePrefixes.plateQuadruple,
+ OrePrefixes.plateQuintuple,
+ OrePrefixes.stick,
+ OrePrefixes.stickLong,
+ OrePrefixes.bolt,
+ OrePrefixes.screw,
+ OrePrefixes.ring,
+ OrePrefixes.rotor,
+ OrePrefixes.gearGt,
+ OrePrefixes.gearGtSmall,
+ OrePrefixes.gear,
+ OrePrefixes.block,
+ OrePrefixes.cableGt01,
+ OrePrefixes.cableGt02,
+ OrePrefixes.cableGt04,
+ OrePrefixes.cableGt08,
+ OrePrefixes.cableGt12,
+ OrePrefixes.wireFine,
+ OrePrefixes.wireGt01,
+ OrePrefixes.wireGt02,
+ OrePrefixes.wireGt04,
+ OrePrefixes.wireGt08,
+ OrePrefixes.wireGt12,
+ OrePrefixes.wireGt16,
+ OrePrefixes.foil,
+ OrePrefixes.frameGt,
+ OrePrefixes.pipeHuge,
+ OrePrefixes.pipeLarge,
+ OrePrefixes.pipeMedium,
+ OrePrefixes.pipeSmall,
+ OrePrefixes.pipeTiny,
+ };
+
+ int mSlotIndex = 0;
+ Pair<OrePrefixes, ItemStack>[] mValidPairs = new Pair[mValidPrefixesAsString.length];
+
+ for (int r = 0; r < mValidPairs.length; r++) {
+ ItemStack temp = getItemStackOfAmountFromOreDictNoBroken(
+ mValidPrefixesAsString[r].name() + Utils.sanitizeString(material.getLocalizedName()), 1);
+ if (temp != null) {
+ mValidPairs[mSlotIndex++] = new Pair<OrePrefixes, ItemStack>(mValidPrefixesAsString[r], temp.copy());
+ }
+ }
+
+ if (mValidPairs.length > 0) {
+ int validCounter = 0;
+ Pair<OrePrefixes, ItemStack>[] temp = mValidPairs;
+ for (Pair<OrePrefixes, ItemStack> temp2 : mValidPairs) {
+ if (temp2 != null) {
+ Logger.WARNING("Valid: " + temp2.getValue().getDisplayName());
+ validCounter++;
+ }
+ }
+ Pair<OrePrefixes, ItemStack> temp3[] = new Pair[validCounter];
+ int temp4 = 0;
+ for (Pair<OrePrefixes, ItemStack> r : mValidPairs) {
+ if (r != null) {
+ temp3[temp4++] = r;
+ }
+ }
+ if (temp3.length > 0) {
+ mValidPairs = temp3.clone();
+ }
+ }
+
+ if (mValidPrefixesAsString.length >= 1) {
+ for (final Pair<OrePrefixes, ItemStack> validPrefix : mValidPairs) {
+ try {
+
+ if (material == null
+ || validPrefix == null
+ || (material.getState() != MaterialState.SOLID
+ && material.getState() != MaterialState.LIQUID)
+ || validPrefix.getKey() == OrePrefixes.ingotHot) {
+ continue;
+ }
+
+ final ItemStack tempStack = validPrefix.getValue();
+ final ItemStack mDust = getDust(material, validPrefix.getKey());
+ final Pair<OrePrefixes, ItemStack> mData = getDustData(material, validPrefix.getKey());
+ int mFluidAmount =
+ (int) GT_Utility.translateMaterialToFluidAmount(validPrefix.getKey().mMaterialAmount, true);
+
+ // Maceration
+ if (ItemUtils.checkForInvalidItems(tempStack)) {
+ // mValidItems[mSlotIndex++] = tempStack;
+ if ((mDust != null) && GT_ModHandler.addPulverisationRecipe(tempStack, mDust)) {
+ Logger.WARNING("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle "
+ + tempStack.getDisplayName() + " and obtain " + mDust.getDisplayName());
+ } else {
+ Logger.WARNING("Recycle Recipe: " + material.getLocalizedName() + " - Failed");
+ if (mDust == null) {
+ Logger.WARNING("Invalid Dust output.");
+ }
+ }
+ }
+
+ // Arc Furnace
+ if (ItemUtils.checkForInvalidItems(tempStack)) {}
+
+ // Fluid Extractor
+ if (ItemUtils.checkForInvalidItems(tempStack)) {
+ // mValidItems[mSlotIndex++] = tempStack;
+
+ int aFluidAmount =
+ (int) ((L * validPrefix.getKey().mMaterialAmount) / (M * tempStack.stackSize));
+ int aDuration = (int) Math.max(1, (24 * validPrefix.getKey().mMaterialAmount) / M);
+ boolean aGenFluidExtraction = CORE.RA.addFluidExtractionRecipe(
+ tempStack,
+ material.getFluidStack(aFluidAmount),
+ aDuration,
+ material.vVoltageMultiplier);
+ if (aGenFluidExtraction /*(mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluidStack(mFluidAmount), 30, material.vVoltageMultiplier)*/) {
+ Logger.WARNING(
+ "Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle "
+ + tempStack.getDisplayName() + " and obtain " + aFluidAmount + "mb of "
+ + material.getFluidStack(1).getLocalizedName() + ". Time: " + aDuration
+ + ", Voltage: " + material.vVoltageMultiplier);
+ } else {
+ Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Failed");
+ if (mDust == null) {
+ Logger.WARNING("Invalid Dust output.");
+ }
+ }
+ }
+
+ } catch (final Throwable t) {
+ t.printStackTrace();
+ // Utils.LOG_WARNING("Returning Null. Throwable Info:
+ // "+t.getMessage());
+ // Utils.LOG_WARNING("Throwable Info: "+t.toString());
+ // Utils.LOG_WARNING("Throwable Info:
+ // "+t.getCause().toString());
+ }
+ }
+ }
+ }
+
+ public static Pair<OrePrefixes, ItemStack> getDustData(final Material aMaterial, final OrePrefixes aPrefix) {
+ return getDustData(aMaterial, aPrefix.mMaterialAmount);
+ }
+
+ public static Pair<OrePrefixes, ItemStack> getDustData(final Material aMaterial, final long aMaterialAmount) {
+ ItemStack mDust = null;
+ OrePrefixes mPrefix = null;
+
+ if (aMaterial == null || aMaterialAmount <= 0) {
+ return null;
+ }
+ if ((((aMaterialAmount % M) == 0) || (aMaterialAmount >= (M * 16)))) {
+ mDust = get(OrePrefixes.dust, aMaterial, aMaterialAmount / M);
+ mPrefix = OrePrefixes.dust;
+ }
+ if ((mDust == null) && ((((aMaterialAmount * 4) % M) == 0) || (aMaterialAmount >= (M * 8)))) {
+ mDust = get(OrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M);
+ mPrefix = OrePrefixes.dustSmall;
+ }
+ if ((mDust == null) && (((aMaterialAmount * 9) >= M))) {
+ mDust = get(OrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M);
+ mPrefix = OrePrefixes.dustTiny;
+ }
+
+ if (mPrefix != null && mDust != null) {
+ Logger.WARNING("Built valid dust pair.");
+ return new Pair<OrePrefixes, ItemStack>(mPrefix, mDust);
+ } else {
+ Logger.WARNING("mPrefix: " + (mPrefix != null));
+ Logger.WARNING("mDust: " + (mDust != null));
+ }
+ Logger.WARNING("Failed to build valid dust pair.");
+ return null;
+ }
+
+ public static ItemStack getDust(final Material aMaterial, final OrePrefixes aPrefix) {
+ return aMaterial == null ? null : getDust(aMaterial, aPrefix.mMaterialAmount);
+ }
+
+ public static ItemStack getDust(final Material aMaterial, final long aMaterialAmount) {
+ if (aMaterialAmount <= 0) {
+ return null;
+ }
+ ItemStack rStack = null;
+ if ((((aMaterialAmount % M) == 0) || (aMaterialAmount >= (M * 16)))) {
+ Logger.WARNING("Trying to get a Dust");
+ rStack = get(OrePrefixes.dust, aMaterial, aMaterialAmount / M);
+ }
+ if ((rStack == null) && ((((aMaterialAmount * 4) % M) == 0) || (aMaterialAmount >= (M * 8)))) {
+ Logger.WARNING("Trying to get a Small Dust");
+ rStack = get(OrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M);
+ }
+ if ((rStack == null) && (((aMaterialAmount * 9) >= M))) {
+ Logger.WARNING("Trying to get a Tiny Dust");
+ rStack = get(OrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M);
+ }
+ return rStack;
+ }
+
+ public static ItemStack get(final Object aName, final long aAmount) {
+ return get(aName, null, aAmount, true, true);
+ }
+
+ public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount) {
+ return get(aName, aReplacement, aAmount, true, true);
+ }
+
+ public static ItemStack get(final OrePrefixes aPrefix, final Material aMaterial, final long aAmount) {
+ return get(aPrefix, aMaterial, null, aAmount);
+ }
+
+ public static ItemStack get(
+ final OrePrefixes aPrefix, final Material aMaterial, final ItemStack aReplacement, final long aAmount) {
+ return get(
+ aPrefix.name() + Utils.sanitizeString(aMaterial.getLocalizedName()),
+ aReplacement,
+ aAmount,
+ false,
+ true);
+ }
+
+ public static ItemStack get(
+ final Object aName,
+ final ItemStack aReplacement,
+ final long aAmount,
+ final boolean aMentionPossibleTypos,
+ final boolean aNoInvalidAmounts) {
+ if (aNoInvalidAmounts && (aAmount < 1L)) {
+ Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0));
+ Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1));
+ Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(2));
+ Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(3));
+ Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(4));
+ return null;
+ }
+ if (!mNameMap.containsKey(aName.toString()) && aMentionPossibleTypos) {
+ Logger.WARNING("Unknown Key for Unification, Typo? " + aName);
+ }
+ return GT_Utility.copyAmount(
+ aAmount, new Object[] {mNameMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement});
+ }
+
+ public static ItemStack getFirstOre(final Object aName, final long aAmount) {
+ if (GT_Utility.isStringInvalid(aName)) {
+ Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0));
+ Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1));
+ Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(2));
+ Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(3));
+ Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(4));
+ return null;
+ }
+ final ItemStack tStack = mNameMap.get(aName.toString());
+ if (GT_Utility.isStackValid(tStack)) {
+ Logger.WARNING("Found valid stack.");
+ return GT_Utility.copyAmount(aAmount, new Object[] {tStack});
+ }
+ return GT_Utility.copyAmount(aAmount, getOres(aName).toArray());
+ }
+
+ public static ArrayList<ItemStack> getOres(final Object aOreName) {
+ final String aName = (aOreName == null) ? "" : aOreName.toString();
+ final ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ if (GT_Utility.isStringValid(aName)) {
+ Logger.WARNING("Making a list of all OreDict entries for " + aOreName + ".");
+ if (rList.addAll(OreDictionary.getOres(aName))) {
+ Logger.WARNING("Added " + rList.size() + " elements to list.");
+ } else {
+ Logger.WARNING("Failed to Add Collection from oreDictionary, forcing an entry.");
+ rList.add(ItemUtils.getItemStackOfAmountFromOreDict((String) aOreName, 1));
+ }
+ }
+ return rList;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map<String, ItemStack> getNameMap() {
+ Map<String, ItemStack> tempMap;
+ try {
+ tempMap = (Map<String, ItemStack>)
+ FieldUtils.readStaticField(GT_OreDictUnificator.class, "sName2StackMap", true);
+ if (tempMap != null) {
+ Logger.WARNING("Found 'sName2StackMap' in GT_OreDictUnificator.class.");
+ return tempMap;
+ }
+ } catch (final IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ Logger.WARNING("Invalid map stored in GT_OreDictUnificator.class, unable to find sName2StackMap field.");
+ return null;
+ }
+
+ public static ItemStack getItemStackOfAmountFromOreDictNoBroken(String oredictName, final int amount) {
+
+ try {
+
+ if (oredictName.contains("-") || oredictName.contains("_")) {
+ oredictName = Utils.sanitizeString(oredictName, new char[] {'-', '_'});
+ } else {
+ oredictName = Utils.sanitizeString(oredictName);
+ }
+
+ // Adds a check to grab dusts using GT methodology if possible.
+ ItemStack returnValue = null;
+ if (oredictName.toLowerCase().contains("dust")) {
+ final String MaterialName = oredictName.toLowerCase().replace("dust", "");
+ final Materials m = Materials.get(MaterialName);
+ if (m != null && m != Materials._NULL) {
+ returnValue = ItemUtils.getGregtechDust(m, amount);
+ if (ItemUtils.checkForInvalidItems(returnValue)) {
+ return returnValue;
+ }
+ }
+ }
+ if (returnValue == null) {
+ returnValue = getItemStackOfAmountFromOreDict(oredictName, amount);
+ if (ItemUtils.checkForInvalidItems(returnValue)) {
+ return returnValue.copy();
+ }
+ }
+ return null;
+ } catch (final Throwable t) {
+ return null;
+ }
+ }
+
+ public static ItemStack getItemStackOfAmountFromOreDict(String oredictName, final int amount) {
+ String mTemp = oredictName;
+
+ // Banned Materials and replacements for GT5.8 compat.
+
+ if (oredictName.toLowerCase().contains("ingotclay")) {
+ return ItemUtils.getSimpleStack(Items.clay_ball, amount);
+ }
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if (oredictName.toLowerCase().contains("rutile")) {
+ mTemp = oredictName.replace("Rutile", "Titanium");
+ }
+ if (oredictName.toLowerCase().contains("vanadiumsteel")) {
+ mTemp = oredictName.replace("VanadiumSteel", "StainlessSteel");
+ }
+ }
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(mTemp);
+ if (!oreDictList.isEmpty()) {
+ final ItemStack returnValue = oreDictList.get(0).copy();
+ returnValue.stackSize = amount;
+ return returnValue;
+ }
+ return null;
+ // return getItemStackOfAmountFromOreDictNoBroken(mTemp, amount);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
index 1a6221b09e..c55cc31525 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.HashSet;
-import java.util.Set;
-
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
@@ -12,282 +9,369 @@ import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import java.util.HashSet;
+import java.util.Set;
import net.minecraft.item.ItemStack;
public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
- }
-
- public RecipeGen_ShapedCrafting(final Material M){
- this.toGenerate = M;
- mRecipeGenMap.add(this);
- }
+ public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- @Override
- public void run() {
- generateRecipes(this.toGenerate);
- }
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
- private void generateRecipes(final Material material){
- Logger.WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO
-
- if (!CORE.GTNH) {
- //Nuggets
- if (ItemUtils.checkForInvalidItems(material.getNugget(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1)))
- GT_ModHandler.addShapelessCraftingRecipe(
- material.getIngot(1),
- new Object[]{
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1)
- });
- }
+ public RecipeGen_ShapedCrafting(final Material M) {
+ this.toGenerate = M;
+ mRecipeGenMap.add(this);
+ }
- //Plates
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate);
+ }
- //Single Plate Shaped/Shapeless
- if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1)))
- if (material.getPlate(1) != null && material.getIngot(1) != null)
- GT_ModHandler.addCraftingRecipe(
- material.getPlate(1),
- gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"h", "B", "I",
- Character.valueOf('I'),
- material.getIngot(1),
- Character.valueOf('B'),
- material.getIngot(1)});
+ private void generateRecipes(final Material material) {
+ Logger.WARNING("Generating Shaped Crafting recipes for " + material.getLocalizedName()); // TODO
- if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1)))
- GT_ModHandler.addShapelessCraftingRecipe(
- material.getPlate(1),
- new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer,
- material.getIngot(1),
- material.getIngot(1)});
+ if (!CORE.GTNH) {
+ // Nuggets
+ if (ItemUtils.checkForInvalidItems(material.getNugget(1))
+ && ItemUtils.checkForInvalidItems(material.getIngot(1)))
+ GT_ModHandler.addShapelessCraftingRecipe(material.getIngot(1), new Object[] {
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1)
+ });
+ }
- //Double Plate Shaped/Shapeless
- if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1)))
- GT_ModHandler.addCraftingRecipe(
- material.getPlateDouble(1),
- gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"I", "B", "h",
- Character.valueOf('I'),
- material.getPlate(1),
- Character.valueOf('B'),
- material.getPlate(1)});
+ // Plates
- if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1)))
- GT_ModHandler.addShapelessCraftingRecipe(
- material.getPlateDouble(1),
- new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer,
- material.getPlate(1),
- material.getPlate(1)});
+ // Single Plate Shaped/Shapeless
+ if (ItemUtils.checkForInvalidItems(material.getPlate(1))
+ && ItemUtils.checkForInvalidItems(material.getIngot(1)))
+ if (material.getPlate(1) != null && material.getIngot(1) != null)
+ GT_ModHandler.addCraftingRecipe(
+ material.getPlate(1),
+ gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS
+ | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "h",
+ "B",
+ "I",
+ Character.valueOf('I'),
+ material.getIngot(1),
+ Character.valueOf('B'),
+ material.getIngot(1)
+ });
- //Ring Recipe
- if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getRing(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) {
- if (CORE.GTNH){
- if (RecipeUtils.addShapedRecipe(
- "craftingToolHardHammer", null, null,
- "craftingToolFile", material.getRod(1), null,
- null, null, null,
- material.getRing(1))){
- Logger.WARNING("GT:NH Ring Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("GT:NH Ring Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
- else {
- if (RecipeUtils.addShapedRecipe(
- "craftingToolHardHammer", null, null,
- null, material.getRod(1), null,
- null, null, null,
- material.getRing(1))){
- Logger.WARNING("Ring Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Ring Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
- }
+ if (ItemUtils.checkForInvalidItems(material.getPlate(1))
+ && ItemUtils.checkForInvalidItems(material.getIngot(1)))
+ GT_ModHandler.addShapelessCraftingRecipe(material.getPlate(1), new Object[] {
+ gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getIngot(1), material.getIngot(1)
+ });
+ // Double Plate Shaped/Shapeless
+ if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1))
+ && ItemUtils.checkForInvalidItems(material.getPlate(1)))
+ GT_ModHandler.addCraftingRecipe(
+ material.getPlateDouble(1),
+ gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS
+ | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "I",
+ "B",
+ "h",
+ Character.valueOf('I'),
+ material.getPlate(1),
+ Character.valueOf('B'),
+ material.getPlate(1)
+ });
- //Framebox Recipe
- if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getFrameBox(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) {
- final ItemStack stackStick = material.getRod(1);
- if (RecipeUtils.addShapedRecipe(
- stackStick, stackStick, stackStick,
- stackStick, "craftingToolWrench", stackStick,
- stackStick, stackStick, stackStick,
- material.getFrameBox(2))){
- Logger.WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
+ if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1))
+ && ItemUtils.checkForInvalidItems(material.getPlate(1)))
+ GT_ModHandler.addShapelessCraftingRecipe(material.getPlateDouble(1), new Object[] {
+ gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getPlate(1), material.getPlate(1)
+ });
+ // Ring Recipe
+ if (!material.isRadioactive
+ && ItemUtils.checkForInvalidItems(material.getRing(1))
+ && ItemUtils.checkForInvalidItems(material.getRod(1))) {
+ if (CORE.GTNH) {
+ if (RecipeUtils.addShapedRecipe(
+ "craftingToolHardHammer",
+ null,
+ null,
+ "craftingToolFile",
+ material.getRod(1),
+ null,
+ null,
+ null,
+ null,
+ material.getRing(1))) {
+ Logger.WARNING("GT:NH Ring Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("GT:NH Ring Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ } else {
+ if (RecipeUtils.addShapedRecipe(
+ "craftingToolHardHammer",
+ null,
+ null,
+ null,
+ material.getRod(1),
+ null,
+ null,
+ null,
+ null,
+ material.getRing(1))) {
+ Logger.WARNING("Ring Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Ring Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+ }
- /*final int tVoltageMultiplier = material.getMeltingPointK() >= 1600 ? 60 : 15;
+ // Framebox Recipe
+ if (!material.isRadioactive
+ && ItemUtils.checkForInvalidItems(material.getFrameBox(1))
+ && ItemUtils.checkForInvalidItems(material.getRod(1))) {
+ final ItemStack stackStick = material.getRod(1);
+ if (RecipeUtils.addShapedRecipe(
+ stackStick,
+ stackStick,
+ stackStick,
+ stackStick,
+ "craftingToolWrench",
+ stackStick,
+ stackStick,
+ stackStick,
+ stackStick,
+ material.getFrameBox(2))) {
+ Logger.WARNING("Framebox Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Framebox Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+ /*final int tVoltageMultiplier = material.getMeltingPointK() >= 1600 ? 60 : 15;
- //Add a shapeless recipe for each dust this way - Compat mode.
- ItemStack[] inputStacks = material.getMaterialComposites();
- ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
- if (inputStacks.length > 0 && tVoltageMultiplier == 15){
- Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
- long[] inputStackSize = material.vSmallestRatio;
- if (inputStackSize != null){
- for (short x=0;x<inputStacks.length;x++){
- if (inputStacks[x] != null && inputStackSize[x] != 0)
- inputStacks[x].stackSize = (int) inputStackSize[x];
- }
- Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
- if (RecipeUtils.buildShapelessRecipe(
- outputStacks,
- inputStacks
- )){
- Utils.LOG_WARNING("Shapeless Crafting Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Utils.LOG_WARNING("Shapeless Crafting Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
- } */
+ //Add a shapeless recipe for each dust this way - Compat mode.
+ ItemStack[] inputStacks = material.getMaterialComposites();
+ ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
+ if (inputStacks.length > 0 && tVoltageMultiplier == 15){
+ Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
+ long[] inputStackSize = material.vSmallestRatio;
+ if (inputStackSize != null){
+ for (short x=0;x<inputStacks.length;x++){
+ if (inputStacks[x] != null && inputStackSize[x] != 0)
+ inputStacks[x].stackSize = (int) inputStackSize[x];
+ }
+ Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
+ if (RecipeUtils.buildShapelessRecipe(
+ outputStacks,
+ inputStacks
+ )){
+ Utils.LOG_WARNING("Shapeless Crafting Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Utils.LOG_WARNING("Shapeless Crafting Recipe: "+material.getLocalizedName()+" - Failed");
+ }
+ }
+ } */
- //Shaped Recipe - Bolts
- if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getBolt(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) {
- if (RecipeUtils.addShapedRecipe(
- "craftingToolSaw", null, null,
- null, material.getRod(1), null,
- null, null, null,
- material.getBolt(2))){
- Logger.WARNING("Bolt Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Bolt Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
-
- //Shaped Recipe - Fine Wire
- if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getFoil(1)) && ItemUtils.checkForInvalidItems(material.getFineWire(1))) {
- if (RecipeUtils.addShapedRecipe(
- material.getFoil(1), CI.craftingToolWireCutter, null,
- null, null, null,
- null, null, null,
- material.getFineWire(1))){
- Logger.WARNING("Fine Wire Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Fine Wire Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
-
- //Shaped Recipe - Foil
- if (ItemUtils.checkForInvalidItems(material.getFoil(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1))) {
- if (RecipeUtils.addShapedRecipe(
- CI.craftingToolHammer_Hard, material.getPlate(1), null,
- null, null, null,
- null, null, null,
- material.getFoil(2))){
- Logger.WARNING("Foil Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Foil Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
+ // Shaped Recipe - Bolts
+ if (!material.isRadioactive
+ && ItemUtils.checkForInvalidItems(material.getBolt(1))
+ && ItemUtils.checkForInvalidItems(material.getRod(1))) {
+ if (RecipeUtils.addShapedRecipe(
+ "craftingToolSaw",
+ null,
+ null,
+ null,
+ material.getRod(1),
+ null,
+ null,
+ null,
+ null,
+ material.getBolt(2))) {
+ Logger.WARNING("Bolt Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Bolt Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+ // Shaped Recipe - Fine Wire
+ if (!material.isRadioactive
+ && ItemUtils.checkForInvalidItems(material.getFoil(1))
+ && ItemUtils.checkForInvalidItems(material.getFineWire(1))) {
+ if (RecipeUtils.addShapedRecipe(
+ material.getFoil(1),
+ CI.craftingToolWireCutter,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getFineWire(1))) {
+ Logger.WARNING("Fine Wire Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Fine Wire Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
- //Shaped Recipe - Ingot to Rod
- if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1)))
- if (RecipeUtils.addShapedRecipe(
- "craftingToolFile", null, null,
- null, material.getIngot(1), null,
- null, null, null,
- material.getRod(1))){
- Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed");
- }
+ // Shaped Recipe - Foil
+ if (ItemUtils.checkForInvalidItems(material.getFoil(1))
+ && ItemUtils.checkForInvalidItems(material.getPlate(1))) {
+ if (RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard,
+ material.getPlate(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getFoil(2))) {
+ Logger.WARNING("Foil Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Foil Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+ // Shaped Recipe - Ingot to Rod
+ if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1)))
+ if (RecipeUtils.addShapedRecipe(
+ "craftingToolFile",
+ null,
+ null,
+ null,
+ material.getIngot(1),
+ null,
+ null,
+ null,
+ null,
+ material.getRod(1))) {
+ Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Failed");
+ }
- //Shaped Recipe - Long Rod to two smalls
- if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getLongRod(1)))
- if (RecipeUtils.addShapedRecipe(
- "craftingToolSaw", null, null,
- material.getLongRod(1), null, null,
- null, null, null,
- material.getRod(2))){
- Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed");
- }
+ // Shaped Recipe - Long Rod to two smalls
+ if (ItemUtils.checkForInvalidItems(material.getRod(1))
+ && ItemUtils.checkForInvalidItems(material.getLongRod(1)))
+ if (RecipeUtils.addShapedRecipe(
+ "craftingToolSaw",
+ null,
+ null,
+ material.getLongRod(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getRod(2))) {
+ Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Failed");
+ }
- //Two small to long rod
- if (ItemUtils.checkForInvalidItems(material.getLongRod(1)) && ItemUtils.checkForInvalidItems(material.getRod(1)))
- if (RecipeUtils.addShapedRecipe(
- material.getRod(1), "craftingToolHardHammer", material.getRod(1),
- null, null, null,
- null, null, null,
- material.getLongRod(1))){
- Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Failed");
- }
+ // Two small to long rod
+ if (ItemUtils.checkForInvalidItems(material.getLongRod(1))
+ && ItemUtils.checkForInvalidItems(material.getRod(1)))
+ if (RecipeUtils.addShapedRecipe(
+ material.getRod(1),
+ "craftingToolHardHammer",
+ material.getRod(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getLongRod(1))) {
+ Logger.WARNING("Long Rod Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Long Rod Recipe: " + material.getLocalizedName() + " - Failed");
+ }
- //Rotor Recipe
- if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getRotor(1)) && ItemUtils.checkForInvalidItems(material.getRing(1)) && !material.isRadioactive && ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getScrew(1))) {
- if (RecipeUtils.addShapedRecipe(
- material.getPlate(1), "craftingToolHardHammer", material.getPlate(1),
- material.getScrew(1), material.getRing(1), "craftingToolFile",
- material.getPlate(1), "craftingToolScrewdriver", material.getPlate(1),
- material.getRotor(1))){
- Logger.WARNING("Rotor Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Rotor Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
+ // Rotor Recipe
+ if (!material.isRadioactive
+ && ItemUtils.checkForInvalidItems(material.getRotor(1))
+ && ItemUtils.checkForInvalidItems(material.getRing(1))
+ && !material.isRadioactive
+ && ItemUtils.checkForInvalidItems(material.getPlate(1))
+ && ItemUtils.checkForInvalidItems(material.getScrew(1))) {
+ if (RecipeUtils.addShapedRecipe(
+ material.getPlate(1),
+ "craftingToolHardHammer",
+ material.getPlate(1),
+ material.getScrew(1),
+ material.getRing(1),
+ "craftingToolFile",
+ material.getPlate(1),
+ "craftingToolScrewdriver",
+ material.getPlate(1),
+ material.getRotor(1))) {
+ Logger.WARNING("Rotor Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Rotor Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
- //Gear Recipe
- if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getGear(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) {
- if (RecipeUtils.addShapedRecipe(
- material.getRod(1), material.getPlate(1), material.getRod(1),
- material.getPlate(1), "craftingToolWrench", material.getPlate(1),
- material.getRod(1), material.getPlate(1), material.getRod(1),
- material.getGear(1))){
- Logger.WARNING("Gear Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Gear Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
+ // Gear Recipe
+ if (!material.isRadioactive
+ && ItemUtils.checkForInvalidItems(material.getGear(1))
+ && ItemUtils.checkForInvalidItems(material.getPlate(1))
+ && ItemUtils.checkForInvalidItems(material.getRod(1))) {
+ if (RecipeUtils.addShapedRecipe(
+ material.getRod(1),
+ material.getPlate(1),
+ material.getRod(1),
+ material.getPlate(1),
+ "craftingToolWrench",
+ material.getPlate(1),
+ material.getRod(1),
+ material.getPlate(1),
+ material.getRod(1),
+ material.getGear(1))) {
+ Logger.WARNING("Gear Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Gear Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
- //Screws
- if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getScrew(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) {
- if (RecipeUtils.addShapedRecipe(
- "craftingToolFile", material.getBolt(1), null,
- material.getBolt(1), null, null,
- null, null, null,
- material.getScrew(1))){
- Logger.WARNING("Screw Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Screw Recipe: "+material.getLocalizedName()+" - Failed");
- }
- }
- }
+ // Screws
+ if (!material.isRadioactive
+ && ItemUtils.checkForInvalidItems(material.getScrew(1))
+ && ItemUtils.checkForInvalidItems(material.getBolt(1))) {
+ if (RecipeUtils.addShapedRecipe(
+ "craftingToolFile",
+ material.getBolt(1),
+ null,
+ material.getBolt(1),
+ null,
+ null,
+ null,
+ null,
+ null,
+ material.getScrew(1))) {
+ Logger.WARNING("Screw Recipe: " + material.getLocalizedName() + " - Success");
+ } else {
+ Logger.WARNING("Screw Recipe: " + material.getLocalizedName() + " - Failed");
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java
index ab4203bca6..5a8306abee 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java
@@ -2,15 +2,12 @@ package gtPlusPlus.xmod.gregtech.loaders.misc;
import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GT_ProcessingArray_Manager;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gtPlusPlus.api.objects.Logger;
public class AddCustomMachineToPA {
- public static void register() {
-
- // Simple Washers
- GT_ProcessingArray_Manager.addRecipeMapToPA("simplewasher.01", GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes);
-
- }
+ public static void register() {
+ // Simple Washers
+ GT_ProcessingArray_Manager.addRecipeMapToPA(
+ "simplewasher.01", GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java
index 351a4cc546..01683e8067 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.loaders.misc;
-import java.util.concurrent.ConcurrentHashMap;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gregtech.GT_Mod;
import gregtech.api.util.GT_Log;
@@ -11,6 +9,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
+import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
@@ -21,160 +20,162 @@ import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
public class AssLineAchievements {
- public static int assReg = -1;
- public static ConcurrentHashMap<String, Achievement> mAchievementMap;
- public static ConcurrentHashMap<String, Boolean> mIssuedAchievementMap;
- public static int adjX = 5;
- public static int adjY = 9;
- private static boolean active = true;
-
- public AssLineAchievements() {
- Logger.INFO(active ? "Loading custom achievement page for Assembly Line recipes."
- : "Achievements are disabled.");
- Utils.registerEvent(this);
- }
-
- private static boolean ready = false;
- private static int recipeTotal = 0;
- private static int recipeCount = 0;
- private static void init() {
- if (!ready) {
- active = GT_Mod.gregtechproxy.mAchievements;
- try {
- recipeTotal = ((GT_Recipe.GT_Recipe_Map) StaticFields59.mAssLineVisualMapNEI.get(null)).mRecipeList.size();
- } catch (IllegalArgumentException | IllegalAccessException e) {
- recipeTotal = 0;
- }
- mAchievementMap = new ConcurrentHashMap<String, Achievement>();
- mIssuedAchievementMap = new ConcurrentHashMap<String, Boolean>();
- ready = true;
- }
-
- }
-
- public static void registerAchievements() {
- if (active && mAchievementMap.size() > 0) {
- AchievementPage.registerAchievementPage(new AchievementPage("GT Assembly Line",
- (Achievement[]) mAchievementMap.values().toArray(new Achievement[mAchievementMap.size()])));
- }
- else if (active) {
- Logger.INFO("Unable to register custom achievement page for Assembly Line recipes.");
- }
- }
-
- public static Achievement registerAssAchievement(GT_Recipe recipe) {
- init();
- String aSafeUnlocalName;
- // Debugging
- if (recipe == null) {
- Logger.INFO(
- "Someone tried to register an achievement for an invalid recipe. Please report this to Alkalus.");
- return null;
- }
- if (recipe.getOutput(0) == null) {
- Logger.INFO(
- "Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
- return null;
- }
- ItemStack aStack = recipe.getOutput(0);
- try {
- aSafeUnlocalName = aStack.getUnlocalizedName();
- } catch (Throwable t) {
- aSafeUnlocalName = ItemUtils.getUnlocalizedItemName(aStack);
- }
-
- Achievement aYouDidSomethingInGT;
- if (mAchievementMap.get(aSafeUnlocalName) == null) {
- assReg++;
- recipeCount++;
- aYouDidSomethingInGT = registerAchievement(aSafeUnlocalName, -(11 + assReg % 5), ((assReg) / 5) - 8,
- recipe.getOutput(0), AchievementList.openInventory, false);
- }
- else {
- aYouDidSomethingInGT = null;
- }
- if (recipeCount >= recipeTotal) {
- Logger.INFO("Critical mass achieved. ["+recipeCount+"]");
- registerAchievements();
- }
-
- return aYouDidSomethingInGT;
- }
-
- public static Achievement registerAchievement(String textId, int x, int y, ItemStack icon,
- Achievement requirement, boolean special) {
- if (!GT_Mod.gregtechproxy.mAchievements) {
- return null;
- }
- Achievement achievement = new Achievement(textId, textId, adjX + x, adjY + y, icon, requirement);
- if (special) {
- achievement.setSpecial();
- }
- achievement.registerStat();
- if (CORE.DEVENV) {
- GT_Log.out.println("achievement." + textId + "=");
- GT_Log.out.println("achievement." + textId + ".desc=");
- }
- mAchievementMap.put(textId, achievement);
- return achievement;
- }
-
- public static void issueAchievement(EntityPlayer entityplayer, String textId) {
- if (entityplayer == null || !GT_Mod.gregtechproxy.mAchievements) {
- return;
- }
-
- entityplayer.triggerAchievement((StatBase) getAchievement(textId));
- }
-
- public static Achievement getAchievement(String textId) {
- if (mAchievementMap.containsKey(textId)) {
- Logger.INFO("Found Achivement: "+textId);
- return (Achievement) mAchievementMap.get(textId);
- }
- return null;
- }
-
- @SubscribeEvent
- public void onItemPickup(EntityItemPickupEvent event) {
- EntityPlayer player = event.entityPlayer;
- ItemStack stack = event.item.getEntityItem();
- String aPickupUnlocalSafe = ItemUtils.getUnlocalizedItemName(stack);
- if (player == null || stack == null) {
- return;
- }
-
- if (StaticFields59.sAssemblylineVisualRecipes == null) {
- return;
- }
-
- Logger.INFO("Trying to check for achievements");
- // Debug scanner unlocks all AL recipes in creative
- if (player.capabilities.isCreativeMode && aPickupUnlocalSafe.equals("gt.metaitem.01.32761")) {
- for (GT_Recipe recipe : StaticFields59.sAssemblylineVisualRecipes.mRecipeList) {
- issueAchievement(player, recipe.getOutput(0).getUnlocalizedName());
- recipe.mHidden = false;
- }
- }
- for (GT_Recipe recipe : StaticFields59.sAssemblylineVisualRecipes.mRecipeList) {
-
- String aSafeUnlocalName;
- if (recipe.getOutput(0) == null) {
- Logger.INFO(
- "Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
- continue;
- }
- ItemStack aStack = recipe.getOutput(0);
- aSafeUnlocalName = ItemUtils.getUnlocalizedItemName(aStack);
- if (aSafeUnlocalName.equals(aPickupUnlocalSafe)) {
- issueAchievement(player, aSafeUnlocalName);
- recipe.mHidden = false;
- Logger.INFO("FOUND: " + aSafeUnlocalName + " | " + aPickupUnlocalSafe);
- }
- else {
- //Logger.INFO(aSafeUnlocalName + " | " + aPickupUnlocalSafe);
- }
- }
- }
+ public static int assReg = -1;
+ public static ConcurrentHashMap<String, Achievement> mAchievementMap;
+ public static ConcurrentHashMap<String, Boolean> mIssuedAchievementMap;
+ public static int adjX = 5;
+ public static int adjY = 9;
+ private static boolean active = true;
+
+ public AssLineAchievements() {
+ Logger.INFO(
+ active ? "Loading custom achievement page for Assembly Line recipes." : "Achievements are disabled.");
+ Utils.registerEvent(this);
+ }
+
+ private static boolean ready = false;
+ private static int recipeTotal = 0;
+ private static int recipeCount = 0;
+
+ private static void init() {
+ if (!ready) {
+ active = GT_Mod.gregtechproxy.mAchievements;
+ try {
+ recipeTotal =
+ ((GT_Recipe.GT_Recipe_Map) StaticFields59.mAssLineVisualMapNEI.get(null)).mRecipeList.size();
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ recipeTotal = 0;
+ }
+ mAchievementMap = new ConcurrentHashMap<String, Achievement>();
+ mIssuedAchievementMap = new ConcurrentHashMap<String, Boolean>();
+ ready = true;
+ }
+ }
+
+ public static void registerAchievements() {
+ if (active && mAchievementMap.size() > 0) {
+ AchievementPage.registerAchievementPage(new AchievementPage("GT Assembly Line", (Achievement[])
+ mAchievementMap.values().toArray(new Achievement[mAchievementMap.size()])));
+ } else if (active) {
+ Logger.INFO("Unable to register custom achievement page for Assembly Line recipes.");
+ }
+ }
+
+ public static Achievement registerAssAchievement(GT_Recipe recipe) {
+ init();
+ String aSafeUnlocalName;
+ // Debugging
+ if (recipe == null) {
+ Logger.INFO(
+ "Someone tried to register an achievement for an invalid recipe. Please report this to Alkalus.");
+ return null;
+ }
+ if (recipe.getOutput(0) == null) {
+ Logger.INFO(
+ "Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
+ return null;
+ }
+ ItemStack aStack = recipe.getOutput(0);
+ try {
+ aSafeUnlocalName = aStack.getUnlocalizedName();
+ } catch (Throwable t) {
+ aSafeUnlocalName = ItemUtils.getUnlocalizedItemName(aStack);
+ }
+
+ Achievement aYouDidSomethingInGT;
+ if (mAchievementMap.get(aSafeUnlocalName) == null) {
+ assReg++;
+ recipeCount++;
+ aYouDidSomethingInGT = registerAchievement(
+ aSafeUnlocalName,
+ -(11 + assReg % 5),
+ ((assReg) / 5) - 8,
+ recipe.getOutput(0),
+ AchievementList.openInventory,
+ false);
+ } else {
+ aYouDidSomethingInGT = null;
+ }
+ if (recipeCount >= recipeTotal) {
+ Logger.INFO("Critical mass achieved. [" + recipeCount + "]");
+ registerAchievements();
+ }
+
+ return aYouDidSomethingInGT;
+ }
+
+ public static Achievement registerAchievement(
+ String textId, int x, int y, ItemStack icon, Achievement requirement, boolean special) {
+ if (!GT_Mod.gregtechproxy.mAchievements) {
+ return null;
+ }
+ Achievement achievement = new Achievement(textId, textId, adjX + x, adjY + y, icon, requirement);
+ if (special) {
+ achievement.setSpecial();
+ }
+ achievement.registerStat();
+ if (CORE.DEVENV) {
+ GT_Log.out.println("achievement." + textId + "=");
+ GT_Log.out.println("achievement." + textId + ".desc=");
+ }
+ mAchievementMap.put(textId, achievement);
+ return achievement;
+ }
+
+ public static void issueAchievement(EntityPlayer entityplayer, String textId) {
+ if (entityplayer == null || !GT_Mod.gregtechproxy.mAchievements) {
+ return;
+ }
+
+ entityplayer.triggerAchievement((StatBase) getAchievement(textId));
+ }
+
+ public static Achievement getAchievement(String textId) {
+ if (mAchievementMap.containsKey(textId)) {
+ Logger.INFO("Found Achivement: " + textId);
+ return (Achievement) mAchievementMap.get(textId);
+ }
+ return null;
+ }
+
+ @SubscribeEvent
+ public void onItemPickup(EntityItemPickupEvent event) {
+ EntityPlayer player = event.entityPlayer;
+ ItemStack stack = event.item.getEntityItem();
+ String aPickupUnlocalSafe = ItemUtils.getUnlocalizedItemName(stack);
+ if (player == null || stack == null) {
+ return;
+ }
+
+ if (StaticFields59.sAssemblylineVisualRecipes == null) {
+ return;
+ }
+
+ Logger.INFO("Trying to check for achievements");
+ // Debug scanner unlocks all AL recipes in creative
+ if (player.capabilities.isCreativeMode && aPickupUnlocalSafe.equals("gt.metaitem.01.32761")) {
+ for (GT_Recipe recipe : StaticFields59.sAssemblylineVisualRecipes.mRecipeList) {
+ issueAchievement(player, recipe.getOutput(0).getUnlocalizedName());
+ recipe.mHidden = false;
+ }
+ }
+ for (GT_Recipe recipe : StaticFields59.sAssemblylineVisualRecipes.mRecipeList) {
+ String aSafeUnlocalName;
+ if (recipe.getOutput(0) == null) {
+ Logger.INFO(
+ "Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus.");
+ continue;
+ }
+ ItemStack aStack = recipe.getOutput(0);
+ aSafeUnlocalName = ItemUtils.getUnlocalizedItemName(aStack);
+ if (aSafeUnlocalName.equals(aPickupUnlocalSafe)) {
+ issueAchievement(player, aSafeUnlocalName);
+ recipe.mHidden = false;
+ Logger.INFO("FOUND: " + aSafeUnlocalName + " | " + aPickupUnlocalSafe);
+ } else {
+ // Logger.INFO(aSafeUnlocalName + " | " + aPickupUnlocalSafe);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java
index add5b512d4..3fec531a12 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java
@@ -1,211 +1,188 @@
package gtPlusPlus.xmod.gregtech.loaders.recipe;
-import java.util.HashMap;
-
import gregtech.api.enums.GT_Values;
-import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GTPP_Recipe;
+import gregtech.api.util.GT_Recipe;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.WeightedCollection;
import gtPlusPlus.core.item.chemistry.AgriculturalChem;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashMap;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeLoader_AlgaeFarm {
- private static final HashMap<Integer, AutoMap<GT_Recipe>> mRecipeCache = new HashMap<Integer, AutoMap<GT_Recipe>>();
- private static final HashMap<Integer, AutoMap<GT_Recipe>> mRecipeCompostCache = new HashMap<Integer, AutoMap<GT_Recipe>>();
-
- public static void generateRecipes() {
- for (int i=0;i<10;i++) {
- getTieredRecipeFromCache(i, false);
- }
- for (int i=0;i<10;i++) {
- getTieredRecipeFromCache(i, true);
- }
- }
-
- public static GT_Recipe getTieredRecipeFromCache(int aTier, boolean aCompost) {
- HashMap<Integer, AutoMap<GT_Recipe>> aMap = aCompost ? mRecipeCompostCache : mRecipeCache;
- String aComp = aCompost ? "(Compost)" : "";
-
- AutoMap<GT_Recipe> aTemp = aMap.get(aTier);
- if (aTemp == null || aTemp.isEmpty()) {
- aTemp = new AutoMap<GT_Recipe>();
- aMap.put(aTier, aTemp);
- Logger.INFO("Tier "+aTier+aComp+" had no recipes, initialising new map.");
- }
- if (aTemp.size() < 500) {
- Logger.INFO("Tier "+aTier+aComp+" has less than 500 recipes, generating "+(500 - aTemp.size())+".");
- for (int i=aTemp.size();i<500;i++) {
- aTemp.put(generateBaseRecipe(aCompost, aTier));
- }
- }
- int aIndex = MathUtils.randInt(0, aTemp.isEmpty() ? 1 : aTemp.size());
- Logger.INFO("Using recipe with index of "+aIndex+". "+aComp);
- return aTemp.get(aIndex);
- }
-
- private static GT_Recipe generateBaseRecipe(boolean aUsingCompost, int aTier) {
-
- // Type Safety
- if (aTier < 0) {
- return null;
- }
-
- WeightedCollection<Float> aOutputTimeMulti = new WeightedCollection<Float>();
- for (int i=100;i> 0;i--) {
- float aValue = 0;
- if (i < 10) {
- aValue = 3f;
- }
- else if (i < 20) {
- aValue = 2f;
- }
- else {
- aValue = 1f;
- }
- aOutputTimeMulti.put(i, aValue);
- }
-
- final int[] aDurations = new int[] {
- 2000,
- 1800,
- 1600,
- 1400,
- 1200,
- 1000,
- 512,
- 256,
- 128,
- 64,
- 32,
- 16,
- 8,
- 4,
- 2,
- 1
- };
-
- ItemStack[] aInputs = new ItemStack[] {};
-
- if (aUsingCompost) {
- // Make it use 4 compost per tier if we have some available
- // Compost consumption maxes out at 1 stack per cycle
- ItemStack aCompost = ItemUtils.getSimpleStack(AgriculturalChem.mCompost, aTier > 1 ? (int) Math.min(64, Math.pow(2, aTier-1)) : 1);
- aInputs = new ItemStack[] {aCompost};
- // Boost Tier by one if using compost so it gets a speed boost
- aTier++;
- }
-
- // We set these elsewhere
- ItemStack[] aOutputs = getOutputsForTier(aTier);
-
- GT_Recipe tRecipe = new GTPP_Recipe(
- false,
- aInputs,
- aOutputs,
- (Object) null,
- new int[] {},
- new FluidStack[] {GT_Values.NF},
- new FluidStack[] {GT_Values.NF},
- (int) (aDurations[aTier] * aOutputTimeMulti.get() / 2), // Time
- 0,
- 0);
-
- tRecipe.mSpecialValue = tRecipe.hashCode();
-
- return tRecipe;
- }
-
- private static ItemStack[] getOutputsForTier(int aTier) {
-
- // Create an Automap to dump contents into
- AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>();
-
-
- // Add loot relevant to tier and also add any from lower tiers.
-
- if (aTier >= 0) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 2));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 4));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2));
- }
- }
-
- if (aTier >= 1) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 4));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4));
- }
- }
- if (aTier >= 2) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 3));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 8));
- }
- }
- if (aTier >= 3) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 1));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 4));
- }
- }
- if (aTier >= 4) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 2));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 3));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 4));
- }
- }
- if (aTier >= 5) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 4));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 2));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 4));
- }
- }
- // Tier 6 is Highest for outputs
- if (aTier >= 6) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 4));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 2));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 8));
- }
- }
-
- // Iterate a special loop at higher tiers to provide more Red/Gold Algae.
- for (int i2=0;i2<20;i2++) {
- if (aTier >= (6+i2)) {
- int aMulti = i2 + 1;
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, aMulti * 4));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, aMulti * 3));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, aMulti * 2));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, aMulti));
- }
- else {
- i2 = 20;
- }
- }
-
-
-
-
- // Map the AutoMap contents to an Itemstack Array.
- ItemStack[] aOutputs = new ItemStack[aOutputMap.size()];
- for (int i=0;i<aOutputMap.size();i++) {
- aOutputs[i] = aOutputMap.get(i);
- }
-
- // Return filled ItemStack Array.
- return aOutputs;
- }
-
+ private static final HashMap<Integer, AutoMap<GT_Recipe>> mRecipeCache = new HashMap<Integer, AutoMap<GT_Recipe>>();
+ private static final HashMap<Integer, AutoMap<GT_Recipe>> mRecipeCompostCache =
+ new HashMap<Integer, AutoMap<GT_Recipe>>();
+
+ public static void generateRecipes() {
+ for (int i = 0; i < 10; i++) {
+ getTieredRecipeFromCache(i, false);
+ }
+ for (int i = 0; i < 10; i++) {
+ getTieredRecipeFromCache(i, true);
+ }
+ }
+
+ public static GT_Recipe getTieredRecipeFromCache(int aTier, boolean aCompost) {
+ HashMap<Integer, AutoMap<GT_Recipe>> aMap = aCompost ? mRecipeCompostCache : mRecipeCache;
+ String aComp = aCompost ? "(Compost)" : "";
+
+ AutoMap<GT_Recipe> aTemp = aMap.get(aTier);
+ if (aTemp == null || aTemp.isEmpty()) {
+ aTemp = new AutoMap<GT_Recipe>();
+ aMap.put(aTier, aTemp);
+ Logger.INFO("Tier " + aTier + aComp + " had no recipes, initialising new map.");
+ }
+ if (aTemp.size() < 500) {
+ Logger.INFO(
+ "Tier " + aTier + aComp + " has less than 500 recipes, generating " + (500 - aTemp.size()) + ".");
+ for (int i = aTemp.size(); i < 500; i++) {
+ aTemp.put(generateBaseRecipe(aCompost, aTier));
+ }
+ }
+ int aIndex = MathUtils.randInt(0, aTemp.isEmpty() ? 1 : aTemp.size());
+ Logger.INFO("Using recipe with index of " + aIndex + ". " + aComp);
+ return aTemp.get(aIndex);
+ }
+
+ private static GT_Recipe generateBaseRecipe(boolean aUsingCompost, int aTier) {
+
+ // Type Safety
+ if (aTier < 0) {
+ return null;
+ }
+
+ WeightedCollection<Float> aOutputTimeMulti = new WeightedCollection<Float>();
+ for (int i = 100; i > 0; i--) {
+ float aValue = 0;
+ if (i < 10) {
+ aValue = 3f;
+ } else if (i < 20) {
+ aValue = 2f;
+ } else {
+ aValue = 1f;
+ }
+ aOutputTimeMulti.put(i, aValue);
+ }
+
+ final int[] aDurations = new int[] {2000, 1800, 1600, 1400, 1200, 1000, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1};
+
+ ItemStack[] aInputs = new ItemStack[] {};
+
+ if (aUsingCompost) {
+ // Make it use 4 compost per tier if we have some available
+ // Compost consumption maxes out at 1 stack per cycle
+ ItemStack aCompost = ItemUtils.getSimpleStack(
+ AgriculturalChem.mCompost, aTier > 1 ? (int) Math.min(64, Math.pow(2, aTier - 1)) : 1);
+ aInputs = new ItemStack[] {aCompost};
+ // Boost Tier by one if using compost so it gets a speed boost
+ aTier++;
+ }
+
+ // We set these elsewhere
+ ItemStack[] aOutputs = getOutputsForTier(aTier);
+
+ GT_Recipe tRecipe = new GTPP_Recipe(
+ false,
+ aInputs,
+ aOutputs,
+ (Object) null,
+ new int[] {},
+ new FluidStack[] {GT_Values.NF},
+ new FluidStack[] {GT_Values.NF},
+ (int) (aDurations[aTier] * aOutputTimeMulti.get() / 2), // Time
+ 0,
+ 0);
+
+ tRecipe.mSpecialValue = tRecipe.hashCode();
+
+ return tRecipe;
+ }
+
+ private static ItemStack[] getOutputsForTier(int aTier) {
+
+ // Create an Automap to dump contents into
+ AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>();
+
+ // Add loot relevant to tier and also add any from lower tiers.
+
+ if (aTier >= 0) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 2));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 4));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2));
+ }
+ }
+
+ if (aTier >= 1) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 4));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4));
+ }
+ }
+ if (aTier >= 2) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 3));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 8));
+ }
+ }
+ if (aTier >= 3) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 1));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 4));
+ }
+ }
+ if (aTier >= 4) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 2));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 3));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 4));
+ }
+ }
+ if (aTier >= 5) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 4));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 2));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 4));
+ }
+ }
+ // Tier 6 is Highest for outputs
+ if (aTier >= 6) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 4));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 2));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 8));
+ }
+ }
+
+ // Iterate a special loop at higher tiers to provide more Red/Gold Algae.
+ for (int i2 = 0; i2 < 20; i2++) {
+ if (aTier >= (6 + i2)) {
+ int aMulti = i2 + 1;
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, aMulti * 4));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, aMulti * 3));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, aMulti * 2));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, aMulti));
+ } else {
+ i2 = 20;
+ }
+ }
+
+ // Map the AutoMap contents to an Itemstack Array.
+ ItemStack[] aOutputs = new ItemStack[aOutputMap.size()];
+ for (int i = 0; i < aOutputMap.size(); i++) {
+ aOutputs[i] = aOutputMap.get(i);
+ }
+
+ // Return filled ItemStack Array.
+ return aOutputs;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java
index 0197142e96..fa13b1d093 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java
@@ -11,12 +11,34 @@ import net.minecraftforge.fluids.FluidStack;
public class RecipeLoader_GTNH {
- public static void generate() {
- GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ball.get(0L), new FluidStack(FluidRegistry.getFluid("ender"), 250), new ItemStack(Items.ender_pearl, 1, 0), 100, 30);
- //MK4
- GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium241.getMolten(144), Materials.Helium.getGas(1000), ELEMENT.getInstance().CURIUM.getFluidStack(144), 96, 98304, 500000000);
- GT_Values.RA.addFusionReactorRecipe(ELEMENT.getInstance().CURIUM.getFluidStack(144), Materials.Helium.getPlasma(144), ELEMENT.getInstance().CALIFORNIUM.getFluidStack(144), 128, 196608, 750000000);
- GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium241.getMolten(144), Materials.Calcium.getPlasma(144), Materials.Flerovium.getMolten(144), 160, 196608, 1000000000);
- }
-
+ public static void generate() {
+ GT_Values.RA.addFluidSolidifierRecipe(
+ ItemList.Shape_Mold_Ball.get(0L),
+ new FluidStack(FluidRegistry.getFluid("ender"), 250),
+ new ItemStack(Items.ender_pearl, 1, 0),
+ 100,
+ 30);
+ // MK4
+ GT_Values.RA.addFusionReactorRecipe(
+ Materials.Plutonium241.getMolten(144),
+ Materials.Helium.getGas(1000),
+ ELEMENT.getInstance().CURIUM.getFluidStack(144),
+ 96,
+ 98304,
+ 500000000);
+ GT_Values.RA.addFusionReactorRecipe(
+ ELEMENT.getInstance().CURIUM.getFluidStack(144),
+ Materials.Helium.getPlasma(144),
+ ELEMENT.getInstance().CALIFORNIUM.getFluidStack(144),
+ 128,
+ 196608,
+ 750000000);
+ GT_Values.RA.addFusionReactorRecipe(
+ Materials.Plutonium241.getMolten(144),
+ Materials.Calcium.getPlasma(144),
+ Materials.Flerovium.getMolten(144),
+ 160,
+ 196608,
+ 1000000000);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GlueLine.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GlueLine.java
index ad047fdb13..a3bfd0806a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GlueLine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GlueLine.java
@@ -40,157 +40,110 @@ public class RecipeLoader_GlueLine {
glueUsageRecipes();
}
-
-
private static void chemicalPlantRecipes() {
- //CO + C3H6O2 = C4H6O3
+ // CO + C3H6O2 = C4H6O3
CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(17),
- ItemUtils.getSimpleStack(GenericChem.mBlueCatalyst, 0)
- },
- new FluidStack[] {
- FluidUtils.getFluidStack("carbonmonoxide", 1000),
- FluidUtils.getFluidStack("methylacetate", 1000),
- },
- new ItemStack[] {
-
- },
+ new ItemStack[] {CI.getNumberedCircuit(17), ItemUtils.getSimpleStack(GenericChem.mBlueCatalyst, 0)},
new FluidStack[] {
- MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000)
+ FluidUtils.getFluidStack("carbonmonoxide", 1000), FluidUtils.getFluidStack("methylacetate", 1000),
},
- 10*20,
+ new ItemStack[] {},
+ new FluidStack[] {MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000)},
+ 10 * 20,
500,
3);
CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(18)
- },
+ new ItemStack[] {CI.getNumberedCircuit(18)},
new FluidStack[] {
- FluidUtils.getFluidStack("aceticacid", 1000),
- FluidUtils.getFluidStack("chlorine", 1000),
- MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000)
- },
- new ItemStack[] {
-
+ FluidUtils.getFluidStack("aceticacid", 1000),
+ FluidUtils.getFluidStack("chlorine", 1000),
+ MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000)
},
+ new ItemStack[] {},
new FluidStack[] {
- MISC_MATERIALS.CHLOROACETIC_MIXTURE.getFluidStack(1000),
- MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(950)
+ MISC_MATERIALS.CHLOROACETIC_MIXTURE.getFluidStack(1000),
+ MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(950)
},
- 150*20,
+ 150 * 20,
1000,
4);
- //Na2CO3 + NaCN + C2H3O2Cl + 2HCl = C3H3NO2 + 3NaCl + CO2 + H2O
+ // Na2CO3 + NaCN + C2H3O2Cl + 2HCl = C3H3NO2 + 3NaCl + CO2 + H2O
CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
- CI.getNumberedCircuit(19),
- ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6),
- MISC_MATERIALS.SODIUM_CYANIDE.getDust(3)
+ CI.getNumberedCircuit(19),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6),
+ MISC_MATERIALS.SODIUM_CYANIDE.getDust(3)
},
new FluidStack[] {
- MISC_MATERIALS.CHLOROACETIC_ACID.getFluidStack(1000),
- FluidUtils.getFluidStack("hydrochloricacid_gt5u", 2000)
+ MISC_MATERIALS.CHLOROACETIC_ACID.getFluidStack(1000),
+ FluidUtils.getFluidStack("hydrochloricacid_gt5u", 2000)
},
- new ItemStack[] {
- MISC_MATERIALS.CYANOACETIC_ACID.getDust(9),
- Materials.Salt.getDust(6)
- },
- new FluidStack[] {
- Materials.CarbonDioxide.getGas(1000),
- GT_ModHandler.getWater(1000)
- },
- 20*20,
+ new ItemStack[] {MISC_MATERIALS.CYANOACETIC_ACID.getDust(9), Materials.Salt.getDust(6)},
+ new FluidStack[] {Materials.CarbonDioxide.getGas(1000), GT_ModHandler.getWater(1000)},
+ 20 * 20,
1000,
4);
- //CuSO4 + 5C3H3NO2 + 5C2H6O = CuSO4·5(H2O) + 5C5H7NO2
+ // CuSO4 + 5C3H3NO2 + 5C2H6O = CuSO4·5(H2O) + 5C5H7NO2
CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
- CI.getNumberedCircuit(20),
- ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 0),
- MISC_MATERIALS.COPPER_SULFATE.getDust(6),
- MISC_MATERIALS.CYANOACETIC_ACID.getDust(45)
- },
- new FluidStack[] {
- Materials.Ethanol.getFluid(5000)
- },
- new ItemStack[] {
- MISC_MATERIALS.COPPER_SULFATE_HYDRATED.getDust(11)
- },
- new FluidStack[] {
- MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(5000)
- },
- 500*20,
+ CI.getNumberedCircuit(20),
+ ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 0),
+ MISC_MATERIALS.COPPER_SULFATE.getDust(6),
+ MISC_MATERIALS.CYANOACETIC_ACID.getDust(45)
+ },
+ new FluidStack[] {Materials.Ethanol.getFluid(5000)},
+ new ItemStack[] {MISC_MATERIALS.COPPER_SULFATE_HYDRATED.getDust(11)},
+ new FluidStack[] {MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(5000)},
+ 500 * 20,
6000,
5);
- //C3H3NO2 + C2H6O = C5H7NO2 + H2O
+ // C3H3NO2 + C2H6O = C5H7NO2 + H2O
CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(21),
- MISC_MATERIALS.CYANOACETIC_ACID.getDust(9)
- },
- new FluidStack[] {
- Materials.Ethanol.getFluid(1000)
- },
- new ItemStack[] {
-
- },
- new FluidStack[] {
- MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(1000)
- },
- 1000*20,
+ new ItemStack[] {CI.getNumberedCircuit(21), MISC_MATERIALS.CYANOACETIC_ACID.getDust(9)},
+ new FluidStack[] {Materials.Ethanol.getFluid(1000)},
+ new ItemStack[] {},
+ new FluidStack[] {MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(1000)},
+ 1000 * 20,
6000,
5);
- BioRecipes.mFormaldehyde = FluidUtils.getFluidStack("fluid.formaldehyde", 1).getFluid();
+ BioRecipes.mFormaldehyde =
+ FluidUtils.getFluidStack("fluid.formaldehyde", 1).getFluid();
CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(22),
- ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 0)
- },
- new FluidStack[] {
- MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(100),
- FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 100)
- },
- new ItemStack[] {
+ new ItemStack[] {CI.getNumberedCircuit(22), ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 0)
},
new FluidStack[] {
- MISC_MATERIALS.CYANOACRYLATE_POLYMER.getFluidStack(100),
- FluidUtils.getWater(1000)
+ MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(100),
+ FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 100)
},
- 10*20,
+ new ItemStack[] {},
+ new FluidStack[] {MISC_MATERIALS.CYANOACRYLATE_POLYMER.getFluidStack(100), FluidUtils.getWater(1000)},
+ 10 * 20,
8000,
5);
- //CH4 + NH3 + 3O = HCN + 3H2O
+ // CH4 + NH3 + 3O = HCN + 3H2O
CORE.RA.addChemicalPlantRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(23),
- ItemUtils.getSimpleStack(GenericChem.mPinkCatalyst, 0)
- },
+ new ItemStack[] {CI.getNumberedCircuit(23), ItemUtils.getSimpleStack(GenericChem.mPinkCatalyst, 0)},
new FluidStack[] {
- FluidUtils.getFluidStack("methane", 2000),
- FluidUtils.getFluidStack("ammonia", 2000),
- FluidUtils.getFluidStack("oxygen", 6000)
- },
- new ItemStack[] {
+ FluidUtils.getFluidStack("methane", 2000),
+ FluidUtils.getFluidStack("ammonia", 2000),
+ FluidUtils.getFluidStack("oxygen", 6000)
},
- new FluidStack[] {
- MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(2000),
- FluidUtils.getWater(6000)
- },
- 10*20,
+ new ItemStack[] {},
+ new FluidStack[] {MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(2000), FluidUtils.getWater(6000)},
+ 10 * 20,
500,
3);
}
private static void chemicalReactorRecipes() {
- //NaOH + HCN = NaCN + H2O
+ // NaOH + HCN = NaCN + H2O
GT_Values.RA.addChemicalRecipe(
CI.getNumberedCircuit(17),
ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 3),
@@ -199,7 +152,7 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.SODIUM_CYANIDE.getDust(3),
10 * 20);
- //CaCO3 + 2HCl = CaCl2 + CO2 + H2O
+ // CaCO3 + 2HCl = CaCl2 + CO2 + H2O
if (LoadedMods.BartWorks) {
GT_Values.RA.addChemicalRecipe(
CI.getNumberedCircuit(18),
@@ -208,8 +161,7 @@ public class RecipeLoader_GlueLine {
Materials.CarbonDioxide.getGas(1000),
ItemUtils.getItemStackFromFQRN("bartworks:gt.bwMetaGenerateddust:63", 3),
5 * 20);
- }
- else {
+ } else {
GT_Values.RA.addChemicalRecipe(
CI.getNumberedCircuit(18),
ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 5),
@@ -219,8 +171,8 @@ public class RecipeLoader_GlueLine {
5 * 20);
}
- //Cu + 2H2SO4 = CuSO4 + SO2 + 2H2O
- //SO2 + 2H2O -> diluted sulfuric acid
+ // Cu + 2H2SO4 = CuSO4 + SO2 + 2H2O
+ // SO2 + 2H2O -> diluted sulfuric acid
GT_Values.RA.addChemicalRecipe(
CI.getNumberedCircuit(19),
ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1),
@@ -232,16 +184,14 @@ public class RecipeLoader_GlueLine {
private static void dehydratorRecipes() {
CORE.RA.addDehydratorRecipe(
- new ItemStack[]{
- MISC_MATERIALS.COPPER_SULFATE_HYDRATED.getDust(11),
+ new ItemStack[] {
+ MISC_MATERIALS.COPPER_SULFATE_HYDRATED.getDust(11),
},
null,
GT_ModHandler.getWater(5000),
- new ItemStack[]{
- MISC_MATERIALS.COPPER_SULFATE.getDust(6)
- },
- new int[]{10000, 10000, 10000},
- 300*20,
+ new ItemStack[] {MISC_MATERIALS.COPPER_SULFATE.getDust(6)},
+ new int[] {10000, 10000, 10000},
+ 300 * 20,
10);
}
@@ -249,9 +199,9 @@ public class RecipeLoader_GlueLine {
GT_Values.RA.addDistillationTowerRecipe(
MISC_MATERIALS.CHLOROACETIC_MIXTURE.getFluidStack(1000),
new FluidStack[] {
- MISC_MATERIALS.CHLOROACETIC_ACID.getFluidStack(100),
- MISC_MATERIALS.DICHLOROACETIC_ACID.getFluidStack(450),
- MISC_MATERIALS.TRICHLOROACETIC_ACID.getFluidStack(450)
+ MISC_MATERIALS.CHLOROACETIC_ACID.getFluidStack(100),
+ MISC_MATERIALS.DICHLOROACETIC_ACID.getFluidStack(450),
+ MISC_MATERIALS.TRICHLOROACETIC_ACID.getFluidStack(450)
},
null,
4 * 20,
@@ -271,7 +221,7 @@ public class RecipeLoader_GlueLine {
null,
null,
null,
- new int[]{10000, 10000, 10000},
+ new int[] {10000, 10000, 10000},
20 * 30,
120);
}
@@ -285,7 +235,6 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(100),
30 * 30,
500);
-
}
private static void mixerRecipes() {
@@ -316,86 +265,79 @@ public class RecipeLoader_GlueLine {
// Braintech Tape recipe, PBI and superglue make 16 tape at once
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
- GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polybenzimidazole, 1L),
- GT_ModHandler.getIC2Item("carbonMesh", 1L),
- CI.getNumberedCircuit(10)
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polybenzimidazole, 1L),
+ GT_ModHandler.getIC2Item("carbonMesh", 1L),
+ CI.getNumberedCircuit(10)
},
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(100),
ItemList.Duct_Tape.get(16L),
120,
- 30
- );
+ 30);
- //Maintenance Hatch recipe, using Braintech Tape
+ // Maintenance Hatch recipe, using Braintech Tape
GT_Values.RA.addAssemblerRecipe(
- new ItemStack[] {
- ItemList.Hull_LV.get(1),
- ItemList.Duct_Tape.get(1),
- CI.getNumberedCircuit(1)
- },
+ new ItemStack[] {ItemList.Hull_LV.get(1), ItemList.Duct_Tape.get(1), CI.getNumberedCircuit(1)},
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(100),
ItemList.Hatch_Maintenance.get(1),
120,
- 30
- );
+ 30);
// Graphene recipes from later wafer tiers, using superglue instead of the bronze age glue
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 64),
- ItemList.Circuit_Silicon_Wafer4.get(2L),
- CI.getNumberedCircuit(2)
+ ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 64),
+ ItemList.Circuit_Silicon_Wafer4.get(2L),
+ CI.getNumberedCircuit(2)
},
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(500),
ItemUtils.getItemStackOfAmountFromOreDict("dustGraphene", 64),
400,
- 30720
- );
+ 30720);
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 64),
- ItemList.Circuit_Silicon_Wafer5.get(1L),
- CI.getNumberedCircuit(2)
+ ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 64),
+ ItemList.Circuit_Silicon_Wafer5.get(1L),
+ CI.getNumberedCircuit(2)
},
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(250),
ItemUtils.getItemStackOfAmountFromOreDict("dustGraphene", 64),
80,
- 122880
- );
+ 122880);
GT_Values.RA.addMixerRecipe(
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sulfur, 1L),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 1L),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 4L),
- GT_Values.NI, GT_Values.NI, GT_Utility.getIntegratedCircuit(1),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Utility.getIntegratedCircuit(1),
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(100),
null,
ItemList.SFMixture.get(32),
1600,
- 16
- );
+ 16);
GT_Values.RA.addMixerRecipe(
ItemList.GelledToluene.get(1),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminium, 1L),
GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Polybenzimidazole, 1L),
- GT_Values.NI, GT_Values.NI, GT_Utility.getIntegratedCircuit(1),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Utility.getIntegratedCircuit(1),
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(100),
null,
ItemList.SFMixture.get(64),
1600,
- 16
- );
+ 16);
GT_Values.RA.addAssemblerRecipe(
- GT_OreDictUnificator.get(OrePrefixes.foil, Materials.PolyvinylChloride,8),
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.PolyvinylChloride, 8),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Paper, 32),
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(200),
- new ItemStack(Items.book,64,0),
+ new ItemStack(Items.book, 64, 0),
32,
- 8
- );
+ 8);
if (LoadedMods.TecTech) {
GT_Values.RA.addAssemblerRecipe(
@@ -404,8 +346,7 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(144),
ItemUtils.getItemStackFromFQRN("gregtech:gt.metaitem.01:32505", 1),
300,
- 7680
- );
+ 7680);
GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.NaquadahAlloy, 2),
@@ -413,8 +354,7 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(288),
ItemUtils.getItemStackFromFQRN("gregtech:gt.metaitem.01:32506", 1),
200,
- 30720
- );
+ 30720);
GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.ElectrumFlux, 2),
@@ -422,8 +362,7 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(576),
ItemUtils.getItemStackFromFQRN("gregtech:gt.metaitem.01:32507", 1),
300,
- 122880
- );
+ 122880);
GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.ElectrumFlux, 2),
@@ -431,8 +370,7 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(1152),
ItemUtils.getItemStackFromFQRN("gregtech:gt.metaitem.01:32561", 1),
100,
- 491520
- );
+ 491520);
GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.ElectrumFlux, 2),
@@ -440,8 +378,7 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(2304),
ItemUtils.getItemStackFromFQRN("gregtech:gt.metaitem.01:32562", 1),
200,
- 1966080
- );
+ 1966080);
GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.ElectrumFlux, 2),
@@ -449,8 +386,7 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(4608),
ItemUtils.getItemStackFromFQRN("gregtech:gt.metaitem.01:32563", 1),
300,
- 1966080
- );
+ 1966080);
GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUHV, 2),
@@ -458,8 +394,7 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(9216),
ItemUtils.getItemStackFromFQRN("gregtech:gt.metaitem.01:32564", 1),
600,
- 1966080
- );
+ 1966080);
GT_Values.RA.addAssemblerRecipe(
GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUHV, 2),
@@ -467,22 +402,20 @@ public class RecipeLoader_GlueLine {
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(18432),
ItemUtils.getItemStackFromFQRN("gregtech:gt.metaitem.01:32565", 1),
1200,
- 1966080
- );
+ 1966080);
}
if (LoadedMods.DreamCraft && LoadedMods.GalacticraftCore) {
GT_Values.RA.addAssemblerRecipe(
- new ItemStack[]{
- ItemUtils.getItemStackFromFQRN("GalacticraftMars:item.itemBasicAsteroids:7", 1),
- GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Titanium, 8),
- ItemUtils.getItemStackFromFQRN("dreamcraft:item.TungstenString", 8),
- CI.getNumberedCircuit(1)
+ new ItemStack[] {
+ ItemUtils.getItemStackFromFQRN("GalacticraftMars:item.itemBasicAsteroids:7", 1),
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Titanium, 8),
+ ItemUtils.getItemStackFromFQRN("dreamcraft:item.TungstenString", 8),
+ CI.getNumberedCircuit(1)
},
MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(576),
ItemUtils.getItemStackFromFQRN("GalaxySpace:item.ThermalClothT2", 1),
600,
- 1024
- );
+ 1024);
}
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java
index de4f7fa49a..0ecc965cb8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java
@@ -2,7 +2,6 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe;
import gregtech.api.enums.Materials;
import gregtech.api.util.GTPP_Recipe;
-import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GasSpargingRecipeMap;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.material.ELEMENT;
@@ -12,158 +11,144 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
-public class RecipeLoader_LFTR {
+public class RecipeLoader_LFTR {
- private static AutoMap<Fluid> mNobleGases;
- private static AutoMap<Fluid> mFluorideGases;
- private static AutoMap<Fluid> mSpargeGases;
+ private static AutoMap<Fluid> mNobleGases;
+ private static AutoMap<Fluid> mFluorideGases;
+ private static AutoMap<Fluid> mSpargeGases;
- private static void configureSparging() {
- if (mSpargeGases == null) {
- mSpargeGases = new AutoMap<Fluid>();
- mSpargeGases.add(Materials.Helium.getGas(1).getFluid());
- mSpargeGases.add(Materials.Fluorine.getGas(1).getFluid());
- }
- if (mNobleGases == null) {
- mNobleGases = new AutoMap<Fluid>();
- mNobleGases.add(mSpargeGases.get(0));
- mNobleGases.add(ELEMENT.getInstance().XENON.getFluid());
- mNobleGases.add(ELEMENT.getInstance().NEON.getFluid());
- mNobleGases.add(ELEMENT.getInstance().ARGON.getFluid());
- mNobleGases.add(ELEMENT.getInstance().KRYPTON.getFluid());
- mNobleGases.add(ELEMENT.getInstance().RADON.getFluid());
- }
- if (mFluorideGases == null) {
- mFluorideGases = new AutoMap<Fluid>();
- mFluorideGases.add(mSpargeGases.get(1));
- mFluorideGases.add(FLUORIDES.LITHIUM_FLUORIDE.getFluid());
- mFluorideGases.add(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE.getFluid());
- mFluorideGases.add(FLUORIDES.TECHNETIUM_HEXAFLUORIDE.getFluid());
- mFluorideGases.add(FLUORIDES.SELENIUM_HEXAFLUORIDE.getFluid());
- mFluorideGases.add(FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid());
- }
- }
+ private static void configureSparging() {
+ if (mSpargeGases == null) {
+ mSpargeGases = new AutoMap<Fluid>();
+ mSpargeGases.add(Materials.Helium.getGas(1).getFluid());
+ mSpargeGases.add(Materials.Fluorine.getGas(1).getFluid());
+ }
+ if (mNobleGases == null) {
+ mNobleGases = new AutoMap<Fluid>();
+ mNobleGases.add(mSpargeGases.get(0));
+ mNobleGases.add(ELEMENT.getInstance().XENON.getFluid());
+ mNobleGases.add(ELEMENT.getInstance().NEON.getFluid());
+ mNobleGases.add(ELEMENT.getInstance().ARGON.getFluid());
+ mNobleGases.add(ELEMENT.getInstance().KRYPTON.getFluid());
+ mNobleGases.add(ELEMENT.getInstance().RADON.getFluid());
+ }
+ if (mFluorideGases == null) {
+ mFluorideGases = new AutoMap<Fluid>();
+ mFluorideGases.add(mSpargeGases.get(1));
+ mFluorideGases.add(FLUORIDES.LITHIUM_FLUORIDE.getFluid());
+ mFluorideGases.add(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE.getFluid());
+ mFluorideGases.add(FLUORIDES.TECHNETIUM_HEXAFLUORIDE.getFluid());
+ mFluorideGases.add(FLUORIDES.SELENIUM_HEXAFLUORIDE.getFluid());
+ mFluorideGases.add(FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid());
+ }
+ }
- public static void generate() {
- // Fli2BeF4 + Thorium TetraFluoride = Uranium233
- //72k Ticks/hr
- //1l/4t = 1000l/hr
- //1l/40t = 1000l/10hr (Probably better) LiFBeF2ThF4UF4
- //1l/20t= 1000l/2.5hr LiFBeF2ZrF4UF4
- //1l/10t= 1000l/2.5hr LiFBeF2ZrF4U235
+ public static void generate() {
+ // Fli2BeF4 + Thorium TetraFluoride = Uranium233
+ // 72k Ticks/hr
+ // 1l/4t = 1000l/hr
+ // 1l/40t = 1000l/10hr (Probably better) LiFBeF2ThF4UF4
+ // 1l/20t= 1000l/2.5hr LiFBeF2ZrF4UF4
+ // 1l/10t= 1000l/2.5hr LiFBeF2ZrF4U235
- configureSparging();
- FluidStack Li2BeF4 = NUCLIDE.Li2BeF4.getFluidStack(200);
+ configureSparging();
+ FluidStack Li2BeF4 = NUCLIDE.Li2BeF4.getFluidStack(200);
- //LiFBeF2ThF4UF4 - T3
- GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(
- false,
- new ItemStack[] {},
- new ItemStack[] {},
- null, new int[] {10000, 10000, 5000, 2500},
- new FluidStack[] {
- NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(100),
- Li2BeF4
- },
- new FluidStack[] {
- NUCLIDE.LiFBeF2UF4FP.getFluidStack(100),
- NUCLIDE.LiFBeF2ThF4.getFluidStack(200),
- FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(20),
- FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10)
- },
- 400 * 20,//time
- 0,//cost
- 8192*4//fuel value
- );
+ // LiFBeF2ThF4UF4 - T3
+ GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(
+ false,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {10000, 10000, 5000, 2500},
+ new FluidStack[] {NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(100), Li2BeF4},
+ new FluidStack[] {
+ NUCLIDE.LiFBeF2UF4FP.getFluidStack(100),
+ NUCLIDE.LiFBeF2ThF4.getFluidStack(200),
+ FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(20),
+ FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10)
+ },
+ 400 * 20, // time
+ 0, // cost
+ 8192 * 4 // fuel value
+ );
- //LiFBeF2ZrF4UF4 - T2
- GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(
- false,
- new ItemStack[] {},
- new ItemStack[] {},
- null, new int[] {10000, 10000, 2500, 1250},
- new FluidStack[] {
- NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(100),
- Li2BeF4
- },
- new FluidStack[] {
- NUCLIDE.LiFBeF2UF4FP.getFluidStack(50),
- NUCLIDE.LiFBeF2ThF4.getFluidStack(100),
- FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10),
- FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(5)
- },
- 400 * 20,//time
- 0,//cost
- 8192//fuel value
- );
+ // LiFBeF2ZrF4UF4 - T2
+ GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(
+ false,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {10000, 10000, 2500, 1250},
+ new FluidStack[] {NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(100), Li2BeF4},
+ new FluidStack[] {
+ NUCLIDE.LiFBeF2UF4FP.getFluidStack(50),
+ NUCLIDE.LiFBeF2ThF4.getFluidStack(100),
+ FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10),
+ FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(5)
+ },
+ 400 * 20, // time
+ 0, // cost
+ 8192 // fuel value
+ );
- //LiFBeF2ZrF4U235 - T1
- GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(
- false,
- new ItemStack[] {},
- new ItemStack[] {},
- null, new int[] {10000, 10000, 1000, 500},
- new FluidStack[] {
- NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(100),
- Li2BeF4
- },
- new FluidStack[] {
- NUCLIDE.LiFBeF2UF4FP.getFluidStack(25),
- NUCLIDE.LiFThF4.getFluidStack(50),
- FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(4),
- FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(2)
- },
- 100 *20,//time
- 0,//cost
- 8192//fuel value
- );
+ // LiFBeF2ZrF4U235 - T1
+ GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(
+ false,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {10000, 10000, 1000, 500},
+ new FluidStack[] {NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(100), Li2BeF4},
+ new FluidStack[] {
+ NUCLIDE.LiFBeF2UF4FP.getFluidStack(25),
+ NUCLIDE.LiFThF4.getFluidStack(50),
+ FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(4),
+ FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(2)
+ },
+ 100 * 20, // time
+ 0, // cost
+ 8192 // fuel value
+ );
- // Sparging NEI Recipes
- GasSpargingRecipeMap.addRecipe(
- new FluidStack(mSpargeGases.get(0), 50),
- NUCLIDE.LiFBeF2UF4FP.getFluidStack(50),
- NUCLIDE.Sparged_LiFBeF2UF4FP.getFluidStack(50),
- new FluidStack[] {
- new FluidStack(mNobleGases.get(1), 10),
- new FluidStack(mNobleGases.get(2), 10),
- new FluidStack(mNobleGases.get(3), 10),
- new FluidStack(mNobleGases.get(4), 10),
- new FluidStack(mNobleGases.get(5), 10)
- },
- new int[] {
- 1000, 1000, 1000, 1000, 1000
- });
+ // Sparging NEI Recipes
+ GasSpargingRecipeMap.addRecipe(
+ new FluidStack(mSpargeGases.get(0), 50),
+ NUCLIDE.LiFBeF2UF4FP.getFluidStack(50),
+ NUCLIDE.Sparged_LiFBeF2UF4FP.getFluidStack(50),
+ new FluidStack[] {
+ new FluidStack(mNobleGases.get(1), 10),
+ new FluidStack(mNobleGases.get(2), 10),
+ new FluidStack(mNobleGases.get(3), 10),
+ new FluidStack(mNobleGases.get(4), 10),
+ new FluidStack(mNobleGases.get(5), 10)
+ },
+ new int[] {1000, 1000, 1000, 1000, 1000});
- GasSpargingRecipeMap.addRecipe(
- new FluidStack(mSpargeGases.get(1), 50),
- NUCLIDE.LiFThF4.getFluidStack(50),
- NUCLIDE.Sparged_LiFThF4.getFluidStack(50),
- new FluidStack[] {
- new FluidStack(mFluorideGases.get(1), 5),
- new FluidStack(mFluorideGases.get(2), 5),
- new FluidStack(mFluorideGases.get(3), 5),
- new FluidStack(mFluorideGases.get(4), 5),
- new FluidStack(mFluorideGases.get(5), 5)
- },
- new int[] {
- 500, 500, 500, 500, 500
- });
+ GasSpargingRecipeMap.addRecipe(
+ new FluidStack(mSpargeGases.get(1), 50),
+ NUCLIDE.LiFThF4.getFluidStack(50),
+ NUCLIDE.Sparged_LiFThF4.getFluidStack(50),
+ new FluidStack[] {
+ new FluidStack(mFluorideGases.get(1), 5),
+ new FluidStack(mFluorideGases.get(2), 5),
+ new FluidStack(mFluorideGases.get(3), 5),
+ new FluidStack(mFluorideGases.get(4), 5),
+ new FluidStack(mFluorideGases.get(5), 5)
+ },
+ new int[] {500, 500, 500, 500, 500});
- GasSpargingRecipeMap.addRecipe(
- new FluidStack(mSpargeGases.get(1), 50),
- NUCLIDE.LiFBeF2ThF4.getFluidStack(50),
- NUCLIDE.Sparged_LiFBeF2ThF4.getFluidStack(50),
- new FluidStack[] {
- new FluidStack(mFluorideGases.get(1), 10),
- new FluidStack(mFluorideGases.get(2), 10),
- new FluidStack(mFluorideGases.get(3), 10),
- new FluidStack(mFluorideGases.get(4), 10),
- new FluidStack(mFluorideGases.get(5), 10)
- },
- new int[] {
- 1000, 1000, 1000, 1000, 1000
- });
-
-
- }
+ GasSpargingRecipeMap.addRecipe(
+ new FluidStack(mSpargeGases.get(1), 50),
+ NUCLIDE.LiFBeF2ThF4.getFluidStack(50),
+ NUCLIDE.Sparged_LiFBeF2ThF4.getFluidStack(50),
+ new FluidStack[] {
+ new FluidStack(mFluorideGases.get(1), 10),
+ new FluidStack(mFluorideGases.get(2), 10),
+ new FluidStack(mFluorideGases.get(3), 10),
+ new FluidStack(mFluorideGases.get(4), 10),
+ new FluidStack(mFluorideGases.get(5), 10)
+ },
+ new int[] {1000, 1000, 1000, 1000, 1000});
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java
index 300cf4e411..28e72cc0b9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java
@@ -1,13 +1,12 @@
package gtPlusPlus.xmod.gregtech.loaders.recipe;
-import cpw.mods.fml.common.Loader;
+
import static advsolar.utils.MTRecipeManager.transformerRecipes;
+
+import advsolar.utils.MTRecipeRecord;
+import cpw.mods.fml.common.Loader;
import gregtech.api.enums.*;
-import gregtech.api.interfaces.IMaterialHandler;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import advsolar.utils.MTRecipeRecord;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
@@ -15,33 +14,63 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils;
public class RecipeLoader_MolecularTransformer {
- public static void run() {
-
- for (int i = 0; i < transformerRecipes.size(); i++) {
- MTRecipeRecord aRecipe = transformerRecipes.get(i);
- int aEU = MaterialUtils.getVoltageForTier(5);
- Logger.INFO("=======================");
- Logger.INFO("Generating GT recipe for Molecular Transformer.");
- Logger.INFO("Input: "+aRecipe.inputStack.getDisplayName()+", Output: "+aRecipe.outputStack.getDisplayName()+", EU/t: "+aEU);
- float aTicks = (float) aRecipe.energyPerOperation / (float) aEU;
- Logger.INFO("Ticks: "+aTicks);
- int aTicksRoundedUp = MathUtils.roundToClosestInt(Math.ceil(aTicks));
- Logger.INFO("Ticks: "+aTicksRoundedUp);
- Logger.INFO("Total EU equal or greater? "+((aTicksRoundedUp * aEU) >= aRecipe.energyPerOperation));
- CORE.RA.addMolecularTransformerRecipe(aRecipe.inputStack, aRecipe.outputStack, aTicksRoundedUp, aEU, 2);
- Logger.INFO("=======================");
- }
-
- transformerRecipes.clear();
- if (Loader.isModLoaded("AdvancedSolarPanel") && Loader.isModLoaded("GalaxySpace")) {
+ public static void run() {
+
+ for (int i = 0; i < transformerRecipes.size(); i++) {
+ MTRecipeRecord aRecipe = transformerRecipes.get(i);
+ int aEU = MaterialUtils.getVoltageForTier(5);
+ Logger.INFO("=======================");
+ Logger.INFO("Generating GT recipe for Molecular Transformer.");
+ Logger.INFO("Input: " + aRecipe.inputStack.getDisplayName() + ", Output: "
+ + aRecipe.outputStack.getDisplayName() + ", EU/t: " + aEU);
+ float aTicks = (float) aRecipe.energyPerOperation / (float) aEU;
+ Logger.INFO("Ticks: " + aTicks);
+ int aTicksRoundedUp = MathUtils.roundToClosestInt(Math.ceil(aTicks));
+ Logger.INFO("Ticks: " + aTicksRoundedUp);
+ Logger.INFO("Total EU equal or greater? " + ((aTicksRoundedUp * aEU) >= aRecipe.energyPerOperation));
+ CORE.RA.addMolecularTransformerRecipe(aRecipe.inputStack, aRecipe.outputStack, aTicksRoundedUp, aEU, 2);
+ Logger.INFO("=======================");
+ }
+
+ transformerRecipes.clear();
+ if (Loader.isModLoaded("AdvancedSolarPanel") && Loader.isModLoaded("GalaxySpace")) {
- CORE.RA.addMolecularTransformerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L),GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),600,1920,2);
- CORE.RA.addMolecularTransformerRecipe(GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 0),GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),150,7680,2);
- CORE.RA.addMolecularTransformerRecipe(GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 1),GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),38,30720,2);
- CORE.RA.addMolecularTransformerRecipe(GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 2),GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),10,122880,2);
- CORE.RA.addMolecularTransformerRecipe(GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 3),GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),3,491520,2);
- CORE.RA.addMolecularTransformerRecipe(GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 4),GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),1,1996080,2);
- }
- }
-
+ CORE.RA.addMolecularTransformerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L),
+ GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),
+ 600,
+ 1920,
+ 2);
+ CORE.RA.addMolecularTransformerRecipe(
+ GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 0),
+ GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),
+ 150,
+ 7680,
+ 2);
+ CORE.RA.addMolecularTransformerRecipe(
+ GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 1),
+ GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),
+ 38,
+ 30720,
+ 2);
+ CORE.RA.addMolecularTransformerRecipe(
+ GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 2),
+ GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),
+ 10,
+ 122880,
+ 2);
+ CORE.RA.addMolecularTransformerRecipe(
+ GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 3),
+ GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),
+ 3,
+ 491520,
+ 2);
+ CORE.RA.addMolecularTransformerRecipe(
+ GT_ModHandler.getModItem("GalaxySpace", "item.GlowstoneDusts", 1L, 4),
+ GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 1L, 9),
+ 1,
+ 1996080,
+ 2);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java
index 5ba1e6d0ca..22ec0a95c5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java
@@ -25,681 +25,638 @@ import net.minecraftforge.fluids.FluidStack;
public class RecipeLoader_Nuclear {
-
-
- public static void generate() {
- createRecipes();
- RecipeLoader_LFTR.generate();
- RecipeLoader_NuclearFuelProcessing.generate();
- }
-
- private static void createRecipes() {
- autoclave();
- blastFurnace();
- centrifugeRecipes();
- chemicalBathRecipes();
- chemicalReactorRecipes();
- dehydratorRecipes();
- electroMagneticSeperator();
- fluidExtractorRecipes();
- fluidHeater();
- macerator();
- mixerRecipes();
- sifter();
- }
-
- private static void autoclave() {
-
- GT_Values.RA.addAutoclaveRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 9),
- FluidUtils.getFluidStack("chlorine", 9 * 4 * 144),
- ItemUtils.getItemStackOfAmountFromOreDict("pelletZirconium", 9),
- 0,
- 120 * 20,
- 30);
-
- }
-
- private static void blastFurnace() {
-
- GT_Values.RA.addBlastRecipe(
- FLUORIDES.LITHIUM_FLUORIDE.getDust(2),
- FLUORIDES.BERYLLIUM_FLUORIDE.getDust(1),
- GT_Values.NF,
- GT_Values.NF,
- NUCLIDE.Li2BeF4.getDust(3),
- null,
- 60 * 20, 2000,
- 3000);
-
- GT_Values.RA.addBlastRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustZrCl4", 1),
- null,
- GT_Values.NF,
- GT_Values.NF,
- ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 1),
- null,
- 60 * 20,
- 340,
- 300);
-
- }
-
-
- private static void centrifugeRecipes() {
-
- //Process Used Fuel Rods for Krypton
-
- //Uranium
- GT_Values.RA.addCentrifugeRecipe(
- CI.getNumberedCircuit(20),
- ItemUtils.getItemStackFromFQRN("IC2:reactorUraniumSimpledepleted", 8),
- GT_Values.NF,
- ELEMENT.getInstance().KRYPTON.getFluidStack(60),
- ItemList.IC2_Fuel_Rod_Empty.get(8),
- ELEMENT.getInstance().URANIUM238.getDust(2),
- ELEMENT.getInstance().URANIUM232.getSmallDust(1),
- ELEMENT.getInstance().URANIUM233.getSmallDust(1),
- ELEMENT.getInstance().URANIUM235.getSmallDust(1),
- ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1),
- new int[] { 0, 0, 1000, 1000, 1000, 500 }, 500 * 20, 4000);
- //Mox
- GT_Values.RA.addCentrifugeRecipe(
- CI.getNumberedCircuit(20),
- ItemUtils.getItemStackFromFQRN("IC2:reactorMOXSimpledepleted", 8),
- GT_Values.NF,
- ELEMENT.getInstance().KRYPTON.getFluidStack(90),
- ItemList.IC2_Fuel_Rod_Empty.get(8),
- ELEMENT.getInstance().PLUTONIUM244.getDust(2),
- ELEMENT.getInstance().PLUTONIUM241.getTinyDust(1),
- ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1),
- ELEMENT.getInstance().PLUTONIUM238.getTinyDust(1),
- ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1),
- new int[] { 0, 0, 500, 500, 500, 500 }, 750 * 20, 4000);
-
- //Thorium
- GT_Values.RA.addCentrifugeRecipe(
- CI.getNumberedCircuit(20),
- ItemList.Depleted_Thorium_1.get(8),
- GT_Values.NF,
- ELEMENT.getInstance().KRYPTON.getFluidStack(30),
- ItemList.IC2_Fuel_Rod_Empty.get(8),
- ELEMENT.getInstance().THORIUM.getDust(2),
- ELEMENT.getInstance().THORIUM232.getDust(1),
- ELEMENT.getInstance().LUTETIUM.getSmallDust(1),
- ELEMENT.getInstance().POLONIUM.getSmallDust(1),
- ELEMENT.getInstance().THALLIUM.getTinyDust(1),
- new int[] { 0, 0, 5000, 5000, 5000, 2500 }, 250 * 20, 4000);
-
- }
-
-
- private static void chemicalBathRecipes() {
-
- int[] chances = {9000, 6000, 3000};
- GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 12),
- FluidUtils.getFluidStack("chlorine", 2400),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 4),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 5),
- chances,
- 30 * 20,
- 480);
-
- chances = new int[]{9000, 3000, 1000};
- GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustRutile", 5),
- FluidUtils.getFluidStack("chlorine", 4000),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTitanium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1),
- chances,
- 30 * 20,
- 1024);
-
- GT_Values.RA.addChemicalBathRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 10),
- FluidUtils.getFluidStack("hydrofluoricacid", 10 * 144),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 10),
- null,
- null,
- new int[] {},
- 90 * 20,
- 500);
-
- }
-
-
- private static void chemicalReactorRecipes() {
-
- ItemStack aGtHydrofluoricAcid = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellHydrofluoricAcid_GT5U", 2);
-
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), // Input
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), // Input
- null, // Fluid Input
- null, // Fluid Output
- ItemUtils.getItemStackOfAmountFromOreDict("dustLi2CO3CaOH2", 10),
- 600 * 20);
-
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 5), // Input
- null, // Input Stack 2
- FluidUtils.getFluidStack("hydrofluoricacid", 5 * 144),
- FluidUtils.getFluidStack("water", 5 * 144), // Fluid Output
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5),
- 600 * 20);
-
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 1), null,
- FluidUtils.getFluidStack("sulfuricacid", 144 * 8),
- FluidUtils.getFluidStack("sulfuriclithium", 144 * 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium7", 1),
- 20 * 20);
-
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 16),
- FluidUtils.getFluidStack("water", 1000),
- FluidUtils.getFluidStack("lithiumhydroxide", 144 * 4),
- CI.emptyCells(1),
- 300 * 20);
-
- // LFTR Fuel Related Compounds
- if (GTNH) {
- // Hydroxide
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- ELEMENT.getInstance().OXYGEN.getCell(1),
- ELEMENT.getInstance().HYDROGEN.getFluidStack(1000),
- MISC_MATERIALS.HYDROXIDE.getFluidStack(2000),
- CI.emptyCells(1),
- GT_Values.NI,
- 8 * 20,
- 30);
- // Beryllium Hydroxide
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- ELEMENT.getInstance().BERYLLIUM.getDust(7),
- MISC_MATERIALS.HYDROXIDE.getFluidStack(1000),
- FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000),
- GT_Values.NI,
- 8 * 20,
- 30);
- // Ammonium Bifluoride
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1),
- MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
- FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000),
- CI.emptyCells(1),
- 20 * 20,
- 30);
- if (aGtHydrofluoricAcid != null) {
- // Ammonium Bifluoride
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- aGtHydrofluoricAcid,
- MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
- FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000),
- CI.emptyCells(2),
- 40 * 20,
- 30);
- }
- // Ammonium
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- ELEMENT.getInstance().HYDROGEN.getCell(1),
- MISC_MATERIALS.AMMONIA.getFluidStack(1000),
- MISC_MATERIALS.AMMONIUM.getFluidStack(2000),
- CI.emptyCells(1),
- GT_Values.NI,
- 20 * 20,
- 30);
- }
-
- if (!GTNH) {
- // Hydroxide
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- ELEMENT.getInstance().OXYGEN.getCell(1),
- ELEMENT.getInstance().HYDROGEN.getFluidStack(1000),
- MISC_MATERIALS.HYDROXIDE.getFluidStack(2000),
- CI.emptyCells(1),
- GT_Values.NI,
- 8 * 20,
- 30);
- // Beryllium Hydroxide
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- ELEMENT.getInstance().BERYLLIUM.getDust(7),
- MISC_MATERIALS.HYDROXIDE.getFluidStack(1000),
- FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000),
- GT_Values.NI,
- 8 * 20,
- 30);
- // Ammonium Bifluoride
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1),
- MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
- FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(3000),
- CI.emptyCells(1),
- 20 * 20,
- 30);
-
- if (aGtHydrofluoricAcid != null) {
- // Ammonium Bifluoride
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- aGtHydrofluoricAcid,
- MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
- FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000),
- CI.emptyCells(2),
- 40 * 20,
- 30);
- }
-
- // Ammonium
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getGregtechCircuit(3),
- ELEMENT.getInstance().HYDROGEN.getCell(1),
- MISC_MATERIALS.AMMONIA.getFluidStack(1000),
- MISC_MATERIALS.AMMONIUM.getFluidStack(2000),
- CI.emptyCells(1),
- GT_Values.NI,
- 20 * 20,
- 30);
- // Ammonia
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 0),
- FluidUtils.getFluidStack("nitrogen", 1000),
- FluidUtils.getFluidStack("ammonia", 1000),
- CI.emptyCells(3),
- 14 * 20);
- }
-
-
- //Technetium
- GT_Values.RA.addChemicalRecipe(
- CI.getNumberedAdvancedCircuit(22),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium99", 1),
- FluidUtils.getFluidStack("sulfuricacid", 1000),
- FluidUtils.getFluidStack("sulfuricacid", 144 * 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium", 1),
- 100 * 20);
-
- // Sodium Hydroxide
- GT_Values.RA.addChemicalRecipe(
- CI.getNumberedBioCircuit(15),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1),
- FluidUtils.getFluidStack("hydrofluoricacid", 500),
- FluidUtils.getWater(1000),
- FLUORIDES.SODIUM_FLUORIDE.getDust(1),
- 60 * 20);
-
- if (FluidUtils.doesFluidExist("hydrofluoricacid_gt5u")) {
- GT_Values.RA.addChemicalRecipe(
- CI.getNumberedBioCircuit(15),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1),
- FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 1000),
- FluidUtils.getWater(1000),
- FLUORIDES.SODIUM_FLUORIDE.getDust(1),
- 60 * 20);
- }
-
- }
-
- private static void dehydratorRecipes() {
-
- // Makes 7-Lithium
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(14),
- ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricLithium", 1)
- },
- FluidUtils.getFluidStack("sulfuriclithium", 440),
- null,
- new ItemStack[] {
- CI.emptyCells(1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 4)
- },
- new int[] {10000, 10000, 10000, 10000, 10000},
- 30 * 20,
- 30);
-
- // Makes Lithium Carbonate
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.emptyCells(12),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLepidolite", 20)
- }, // Item input (Array, up to 2)
- FluidUtils.getFluidStack("sulfuricacid", 10000),
- FluidUtils.getFluidStack("sulfuriclithium", 10000),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 1),
- GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminium, 4),
- ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 10),
- ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), // LithiumCarbonate
- }, // Output Array of Items - Upto 9,
- new int[] { 10000, 10000, 10000, 10000, 10000 },
- 75 * 20, // Time in ticks
- 1000); // EU
-
- // Calcium Hydroxide
- if ((ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1))) || LoadedMods.IHL) {
- //CaO + H2O = Ca(OH)2
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedBioCircuit(20),
- ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 2)
- },
- FluidUtils.getFluidStack("water", 1000),
- null, // Fluid output (slot 2)
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5)
- }, // Output
- new int[] { 10000 },
- 12 * 20, // Time in ticks
- 120); // EU
- }
- else {
- Logger.INFO("[dustCalciumHydroxide] FAILED TO LOAD RECIPE");
- if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1))) {
- Logger.INFO("Could not find dustQuicklime, cannot make dustCalciumHydroxide.");
- }
- else if (!LoadedMods.IHL) {
- Logger.INFO("IHL not loaded.");
- }
- }
-
- // 2 LiOH + CaCO3
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(20),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLi2CO3CaOH2", 5)
- }, // Item
- null, // Fluid input (slot 1)
- null, // Fluid output (slot 2)
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3)
- }, // Output
- new int[] { 10000, 10000 },
- 120 * 20, // Time in ticks
- 1000); // EU
-
- // LiOH Liquid to Dust
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(22)
- },
- FluidUtils.getFluidStack("lithiumhydroxide", 144),
- null,
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 1)
- },
- new int[] { 10000 },
- 1 * 20, // Time in ticks
- 64); // EU
-
- // Zirconium Chloride -> TetraFluoride
- FluidStack aHydrogenChloride = new FluidStack(GenericChem.HydrochloricAcid, 9000);
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(11),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9),
- }, // Item
- FluidUtils.getFluidStack("hydrofluoricacid", 9 * 144),
- aHydrogenChloride,
- new ItemStack[] {
- FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9)
- },
- new int[] { 10000 },
- 120 * 20, // Time in ticks
- 500); // EU
-
- // Zirconium Chloride -> TetraFluoride
- FluidStack aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 1);
- if (aGregtechHydro != null || Utils.getGregtechVersionAsInt() >= 50929) {
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(10),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9)
- },
- FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 18 * 144),
- aHydrogenChloride,
- new ItemStack[] {
- FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9)
- },
- new int[] { 10000 },
- 240 * 20, // Time in ticks
- 500); // EU
- }
-
- // Be(OH)2 + 2 (NH4)HF2 → (NH4)2BeF4 + 2 H2O
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(6),
- FLUORIDES.AMMONIUM_BIFLUORIDE.getCell(4)
- },
- FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000), // Fluid input (slot 1)
- FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE.getFluidStack(6000),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 4)
- },
- new int[] { 10000},
- 32 * 20, // Time in ticks
- 64); // EU
-
- // (NH4)2BeF4 → 2 NH3 + 2 HF + BeF2
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(17),
- CI.emptyCells(5)
- },
- FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE.getFluidStack(5000),
- null,
- new ItemStack[] {
- MISC_MATERIALS.AMMONIA.getCell(2),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2),
- FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1)
- },
- new int[] {10000, 10000, 10000},
- 5 * 60 * 20,
- 120);
-
- }
-
- private static void electroMagneticSeperator() {
-
- // Zirconium
- GT_Values.RA.addElectromagneticSeparatorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedBauxite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustBauxite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallRutile", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("nuggetZirconium", 1),
- new int[] { 10000, 2500, 4000 },
- 20 * 20,
- 24);
-
- // Zircon
- GT_Values.RA.addElectromagneticSeparatorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedMagnetite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1),
- new int[] { 10000, 1250, 2500 },
- 20 * 20,
- 24);
- GT_Values.RA.addElectromagneticSeparatorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1),
- new int[] { 10000, 1250, 2500 },
- 20 * 20,
- 24);
-
- }
-
- private static void fluidExtractorRecipes() {
-
- //FLiBe fuel
- CORE.RA.addFluidExtractionRecipe(
- NUCLIDE.Li2BeF4.getDust(1),
- NUCLIDE.Li2BeF4.getFluidStack(144),
- 100,
- 500);
- //Lithium Fluoride
- CORE.RA.addFluidExtractionRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 1),
- FLUORIDES.LITHIUM_FLUORIDE.getFluidStack(144),
- 100,
- 500);
- //LFTR Fuel 1
- CORE.RA.addFluidExtractionRecipe(
- NUCLIDE.LiFBeF2ZrF4U235.getDust(1),
- NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(144),
- 250,
- 1000);
- CORE.RA.addFluidExtractionRecipe(
- NUCLIDE.LiFBeF2ZrF4UF4.getDust(1),
- NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(144),
- 150,
- 1500);
- CORE.RA.addFluidExtractionRecipe(
- NUCLIDE.LiFBeF2ThF4UF4.getDust(1),
- NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(144),
- 150,
- 2000);
-
- //ZIRCONIUM_TETRAFLUORIDE
- CORE.RA.addFluidExtractionRecipe(
- FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1),
- FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(144),
- 200,
- 512+256);
-
- }
-
- private static void macerator() {
-
- GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("pelletZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZrCl4", 1));
-
- }
-
- private static void mixerRecipes() {
-
- GT_Values.RA.addMixerRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustUranium233", 4),
- ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1),
- null,
- null,
- FluidUtils.getFluidStack("hydrofluoricacid", 5000),
- FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(5000),
- null,
- 3000,
- 500);
-
- }
-
-
- private static void sifter() {
-
- // Zirconium
- GT_Values.RA.addSifterRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIlmenite", 1),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyWroughtIron", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1) },
- new int[] { 5000, 2500, 1000, 1000, 300, 300 },
- 20 * 30,
- 500);
- GT_Values.RA.addSifterRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedTin", 1),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZinc", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) },
- new int[] { 10000, 5000, 1500, 1000, 500, 500 },
- 20 * 30,
- 500);
- GT_Values.RA.addSifterRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyTin", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) },
- new int[] { 10000, 5000, 1500, 1000, 500, 500 },
- 20 * 30,
- 500);
-
- // Radium
- GT_Values.RA.addSifterRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUranium", 1),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLead", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) },
- new int[] { 10000, 5000, 1000, 500, 500, 500 },
- 20 * 30,
- 500);
- GT_Values.RA.addSifterRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUraninite", 1),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustUraninite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyUranium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) },
- new int[] { 10000, 5000, 500, 250, 250, 250 },
- 20 * 30,
- 500);
- GT_Values.RA.addSifterRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPitchblende", 1),
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustPitchblende", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLead", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) },
- new int[] { 10000, 5000, 500, 250, 250, 250 },
- 20 * 30,
- 500);
- }
-
- private static void fluidHeater() {
-
- CORE.RA.addFluidHeaterRecipe(
- FLUORIDES.SODIUM_FLUORIDE.getDust(1),
- null,
- FLUORIDES.SODIUM_FLUORIDE.getFluidStack(144),
- 20 * 30,
- 500);
-
- }
-
+ public static void generate() {
+ createRecipes();
+ RecipeLoader_LFTR.generate();
+ RecipeLoader_NuclearFuelProcessing.generate();
+ }
+
+ private static void createRecipes() {
+ autoclave();
+ blastFurnace();
+ centrifugeRecipes();
+ chemicalBathRecipes();
+ chemicalReactorRecipes();
+ dehydratorRecipes();
+ electroMagneticSeperator();
+ fluidExtractorRecipes();
+ fluidHeater();
+ macerator();
+ mixerRecipes();
+ sifter();
+ }
+
+ private static void autoclave() {
+
+ GT_Values.RA.addAutoclaveRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 9),
+ FluidUtils.getFluidStack("chlorine", 9 * 4 * 144),
+ ItemUtils.getItemStackOfAmountFromOreDict("pelletZirconium", 9),
+ 0,
+ 120 * 20,
+ 30);
+ }
+
+ private static void blastFurnace() {
+
+ GT_Values.RA.addBlastRecipe(
+ FLUORIDES.LITHIUM_FLUORIDE.getDust(2),
+ FLUORIDES.BERYLLIUM_FLUORIDE.getDust(1),
+ GT_Values.NF,
+ GT_Values.NF,
+ NUCLIDE.Li2BeF4.getDust(3),
+ null,
+ 60 * 20,
+ 2000,
+ 3000);
+
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZrCl4", 1),
+ null,
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 1),
+ null,
+ 60 * 20,
+ 340,
+ 300);
+ }
+
+ private static void centrifugeRecipes() {
+
+ // Process Used Fuel Rods for Krypton
+
+ // Uranium
+ GT_Values.RA.addCentrifugeRecipe(
+ CI.getNumberedCircuit(20),
+ ItemUtils.getItemStackFromFQRN("IC2:reactorUraniumSimpledepleted", 8),
+ GT_Values.NF,
+ ELEMENT.getInstance().KRYPTON.getFluidStack(60),
+ ItemList.IC2_Fuel_Rod_Empty.get(8),
+ ELEMENT.getInstance().URANIUM238.getDust(2),
+ ELEMENT.getInstance().URANIUM232.getSmallDust(1),
+ ELEMENT.getInstance().URANIUM233.getSmallDust(1),
+ ELEMENT.getInstance().URANIUM235.getSmallDust(1),
+ ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1),
+ new int[] {0, 0, 1000, 1000, 1000, 500},
+ 500 * 20,
+ 4000);
+ // Mox
+ GT_Values.RA.addCentrifugeRecipe(
+ CI.getNumberedCircuit(20),
+ ItemUtils.getItemStackFromFQRN("IC2:reactorMOXSimpledepleted", 8),
+ GT_Values.NF,
+ ELEMENT.getInstance().KRYPTON.getFluidStack(90),
+ ItemList.IC2_Fuel_Rod_Empty.get(8),
+ ELEMENT.getInstance().PLUTONIUM244.getDust(2),
+ ELEMENT.getInstance().PLUTONIUM241.getTinyDust(1),
+ ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1),
+ ELEMENT.getInstance().PLUTONIUM238.getTinyDust(1),
+ ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1),
+ new int[] {0, 0, 500, 500, 500, 500},
+ 750 * 20,
+ 4000);
+
+ // Thorium
+ GT_Values.RA.addCentrifugeRecipe(
+ CI.getNumberedCircuit(20),
+ ItemList.Depleted_Thorium_1.get(8),
+ GT_Values.NF,
+ ELEMENT.getInstance().KRYPTON.getFluidStack(30),
+ ItemList.IC2_Fuel_Rod_Empty.get(8),
+ ELEMENT.getInstance().THORIUM.getDust(2),
+ ELEMENT.getInstance().THORIUM232.getDust(1),
+ ELEMENT.getInstance().LUTETIUM.getSmallDust(1),
+ ELEMENT.getInstance().POLONIUM.getSmallDust(1),
+ ELEMENT.getInstance().THALLIUM.getTinyDust(1),
+ new int[] {0, 0, 5000, 5000, 5000, 2500},
+ 250 * 20,
+ 4000);
+ }
+
+ private static void chemicalBathRecipes() {
+
+ int[] chances = {9000, 6000, 3000};
+ GT_Values.RA.addChemicalBathRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 12),
+ FluidUtils.getFluidStack("chlorine", 2400),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 5),
+ chances,
+ 30 * 20,
+ 480);
+
+ chances = new int[] {9000, 3000, 1000};
+ GT_Values.RA.addChemicalBathRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRutile", 5),
+ FluidUtils.getFluidStack("chlorine", 4000),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTitanium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1),
+ chances,
+ 30 * 20,
+ 1024);
+
+ GT_Values.RA.addChemicalBathRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 10),
+ FluidUtils.getFluidStack("hydrofluoricacid", 10 * 144),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 10),
+ null,
+ null,
+ new int[] {},
+ 90 * 20,
+ 500);
+ }
+
+ private static void chemicalReactorRecipes() {
+
+ ItemStack aGtHydrofluoricAcid =
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellHydrofluoricAcid_GT5U", 2);
+
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), // Input
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), // Input
+ null, // Fluid Input
+ null, // Fluid Output
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLi2CO3CaOH2", 10),
+ 600 * 20);
+
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 5), // Input
+ null, // Input Stack 2
+ FluidUtils.getFluidStack("hydrofluoricacid", 5 * 144),
+ FluidUtils.getFluidStack("water", 5 * 144), // Fluid Output
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5),
+ 600 * 20);
+
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 1),
+ null,
+ FluidUtils.getFluidStack("sulfuricacid", 144 * 8),
+ FluidUtils.getFluidStack("sulfuriclithium", 144 * 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium7", 1),
+ 20 * 20);
+
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 16),
+ FluidUtils.getFluidStack("water", 1000),
+ FluidUtils.getFluidStack("lithiumhydroxide", 144 * 4),
+ CI.emptyCells(1),
+ 300 * 20);
+
+ // LFTR Fuel Related Compounds
+ if (GTNH) {
+ // Hydroxide
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ELEMENT.getInstance().OXYGEN.getCell(1),
+ ELEMENT.getInstance().HYDROGEN.getFluidStack(1000),
+ MISC_MATERIALS.HYDROXIDE.getFluidStack(2000),
+ CI.emptyCells(1),
+ GT_Values.NI,
+ 8 * 20,
+ 30);
+ // Beryllium Hydroxide
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ELEMENT.getInstance().BERYLLIUM.getDust(7),
+ MISC_MATERIALS.HYDROXIDE.getFluidStack(1000),
+ FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000),
+ GT_Values.NI,
+ 8 * 20,
+ 30);
+ // Ammonium Bifluoride
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1),
+ MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
+ FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000),
+ CI.emptyCells(1),
+ 20 * 20,
+ 30);
+ if (aGtHydrofluoricAcid != null) {
+ // Ammonium Bifluoride
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ aGtHydrofluoricAcid,
+ MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
+ FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000),
+ CI.emptyCells(2),
+ 40 * 20,
+ 30);
+ }
+ // Ammonium
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ELEMENT.getInstance().HYDROGEN.getCell(1),
+ MISC_MATERIALS.AMMONIA.getFluidStack(1000),
+ MISC_MATERIALS.AMMONIUM.getFluidStack(2000),
+ CI.emptyCells(1),
+ GT_Values.NI,
+ 20 * 20,
+ 30);
+ }
+
+ if (!GTNH) {
+ // Hydroxide
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ELEMENT.getInstance().OXYGEN.getCell(1),
+ ELEMENT.getInstance().HYDROGEN.getFluidStack(1000),
+ MISC_MATERIALS.HYDROXIDE.getFluidStack(2000),
+ CI.emptyCells(1),
+ GT_Values.NI,
+ 8 * 20,
+ 30);
+ // Beryllium Hydroxide
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ELEMENT.getInstance().BERYLLIUM.getDust(7),
+ MISC_MATERIALS.HYDROXIDE.getFluidStack(1000),
+ FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000),
+ GT_Values.NI,
+ 8 * 20,
+ 30);
+ // Ammonium Bifluoride
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1),
+ MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
+ FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(3000),
+ CI.emptyCells(1),
+ 20 * 20,
+ 30);
+
+ if (aGtHydrofluoricAcid != null) {
+ // Ammonium Bifluoride
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ aGtHydrofluoricAcid,
+ MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
+ FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000),
+ CI.emptyCells(2),
+ 40 * 20,
+ 30);
+ }
+
+ // Ammonium
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ELEMENT.getInstance().HYDROGEN.getCell(1),
+ MISC_MATERIALS.AMMONIA.getFluidStack(1000),
+ MISC_MATERIALS.AMMONIUM.getFluidStack(2000),
+ CI.emptyCells(1),
+ GT_Values.NI,
+ 20 * 20,
+ 30);
+ // Ammonia
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 0),
+ FluidUtils.getFluidStack("nitrogen", 1000),
+ FluidUtils.getFluidStack("ammonia", 1000),
+ CI.emptyCells(3),
+ 14 * 20);
+ }
+
+ // Technetium
+ GT_Values.RA.addChemicalRecipe(
+ CI.getNumberedAdvancedCircuit(22),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium99", 1),
+ FluidUtils.getFluidStack("sulfuricacid", 1000),
+ FluidUtils.getFluidStack("sulfuricacid", 144 * 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium", 1),
+ 100 * 20);
+
+ // Sodium Hydroxide
+ GT_Values.RA.addChemicalRecipe(
+ CI.getNumberedBioCircuit(15),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1),
+ FluidUtils.getFluidStack("hydrofluoricacid", 500),
+ FluidUtils.getWater(1000),
+ FLUORIDES.SODIUM_FLUORIDE.getDust(1),
+ 60 * 20);
+
+ if (FluidUtils.doesFluidExist("hydrofluoricacid_gt5u")) {
+ GT_Values.RA.addChemicalRecipe(
+ CI.getNumberedBioCircuit(15),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1),
+ FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 1000),
+ FluidUtils.getWater(1000),
+ FLUORIDES.SODIUM_FLUORIDE.getDust(1),
+ 60 * 20);
+ }
+ }
+
+ private static void dehydratorRecipes() {
+
+ // Makes 7-Lithium
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(14),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricLithium", 1)
+ },
+ FluidUtils.getFluidStack("sulfuriclithium", 440),
+ null,
+ new ItemStack[] {
+ CI.emptyCells(1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 4)
+ },
+ new int[] {10000, 10000, 10000, 10000, 10000},
+ 30 * 20,
+ 30);
+
+ // Makes Lithium Carbonate
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.emptyCells(12), ItemUtils.getItemStackOfAmountFromOreDict("dustLepidolite", 20)
+ }, // Item input (Array, up to 2)
+ FluidUtils.getFluidStack("sulfuricacid", 10000),
+ FluidUtils.getFluidStack("sulfuriclithium", 10000),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 1),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminium, 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 10),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), // LithiumCarbonate
+ }, // Output Array of Items - Upto 9,
+ new int[] {10000, 10000, 10000, 10000, 10000},
+ 75 * 20, // Time in ticks
+ 1000); // EU
+
+ // Calcium Hydroxide
+ if ((ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1)))
+ || LoadedMods.IHL) {
+ // CaO + H2O = Ca(OH)2
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(20), ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 2)
+ },
+ FluidUtils.getFluidStack("water", 1000),
+ null, // Fluid output (slot 2)
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5)}, // Output
+ new int[] {10000},
+ 12 * 20, // Time in ticks
+ 120); // EU
+ } else {
+ Logger.INFO("[dustCalciumHydroxide] FAILED TO LOAD RECIPE");
+ if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1))) {
+ Logger.INFO("Could not find dustQuicklime, cannot make dustCalciumHydroxide.");
+ } else if (!LoadedMods.IHL) {
+ Logger.INFO("IHL not loaded.");
+ }
+ }
+
+ // 2 LiOH + CaCO3
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(20), ItemUtils.getItemStackOfAmountFromOreDict("dustLi2CO3CaOH2", 5)
+ }, // Item
+ null, // Fluid input (slot 1)
+ null, // Fluid output (slot 2)
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3)
+ }, // Output
+ new int[] {10000, 10000},
+ 120 * 20, // Time in ticks
+ 1000); // EU
+
+ // LiOH Liquid to Dust
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(22)},
+ FluidUtils.getFluidStack("lithiumhydroxide", 144),
+ null,
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 1)},
+ new int[] {10000},
+ 1 * 20, // Time in ticks
+ 64); // EU
+
+ // Zirconium Chloride -> TetraFluoride
+ FluidStack aHydrogenChloride = new FluidStack(GenericChem.HydrochloricAcid, 9000);
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(11), ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9),
+ }, // Item
+ FluidUtils.getFluidStack("hydrofluoricacid", 9 * 144),
+ aHydrogenChloride,
+ new ItemStack[] {FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9)},
+ new int[] {10000},
+ 120 * 20, // Time in ticks
+ 500); // EU
+
+ // Zirconium Chloride -> TetraFluoride
+ FluidStack aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 1);
+ if (aGregtechHydro != null || Utils.getGregtechVersionAsInt() >= 50929) {
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(10),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9)
+ },
+ FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 18 * 144),
+ aHydrogenChloride,
+ new ItemStack[] {FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9)},
+ new int[] {10000},
+ 240 * 20, // Time in ticks
+ 500); // EU
+ }
+
+ // Be(OH)2 + 2 (NH4)HF2 → (NH4)2BeF4 + 2 H2O
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(6), FLUORIDES.AMMONIUM_BIFLUORIDE.getCell(4)},
+ FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000), // Fluid input (slot 1)
+ FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE.getFluidStack(6000),
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 4)},
+ new int[] {10000},
+ 32 * 20, // Time in ticks
+ 64); // EU
+
+ // (NH4)2BeF4 → 2 NH3 + 2 HF + BeF2
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(17), CI.emptyCells(5)},
+ FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE.getFluidStack(5000),
+ null,
+ new ItemStack[] {
+ MISC_MATERIALS.AMMONIA.getCell(2),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2),
+ FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1)
+ },
+ new int[] {10000, 10000, 10000},
+ 5 * 60 * 20,
+ 120);
+ }
+
+ private static void electroMagneticSeperator() {
+
+ // Zirconium
+ GT_Values.RA.addElectromagneticSeparatorRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedBauxite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustBauxite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallRutile", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("nuggetZirconium", 1),
+ new int[] {10000, 2500, 4000},
+ 20 * 20,
+ 24);
+
+ // Zircon
+ GT_Values.RA.addElectromagneticSeparatorRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedMagnetite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1),
+ new int[] {10000, 1250, 2500},
+ 20 * 20,
+ 24);
+ GT_Values.RA.addElectromagneticSeparatorRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1),
+ new int[] {10000, 1250, 2500},
+ 20 * 20,
+ 24);
+ }
+
+ private static void fluidExtractorRecipes() {
+
+ // FLiBe fuel
+ CORE.RA.addFluidExtractionRecipe(NUCLIDE.Li2BeF4.getDust(1), NUCLIDE.Li2BeF4.getFluidStack(144), 100, 500);
+ // Lithium Fluoride
+ CORE.RA.addFluidExtractionRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 1),
+ FLUORIDES.LITHIUM_FLUORIDE.getFluidStack(144),
+ 100,
+ 500);
+ // LFTR Fuel 1
+ CORE.RA.addFluidExtractionRecipe(
+ NUCLIDE.LiFBeF2ZrF4U235.getDust(1), NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(144), 250, 1000);
+ CORE.RA.addFluidExtractionRecipe(
+ NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(144), 150, 1500);
+ CORE.RA.addFluidExtractionRecipe(
+ NUCLIDE.LiFBeF2ThF4UF4.getDust(1), NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(144), 150, 2000);
+
+ // ZIRCONIUM_TETRAFLUORIDE
+ CORE.RA.addFluidExtractionRecipe(
+ FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1),
+ FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(144),
+ 200,
+ 512 + 256);
+ }
+
+ private static void macerator() {
+
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("pelletZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZrCl4", 1));
+ }
+
+ private static void mixerRecipes() {
+
+ GT_Values.RA.addMixerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustUranium233", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1),
+ null,
+ null,
+ FluidUtils.getFluidStack("hydrofluoricacid", 5000),
+ FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(5000),
+ null,
+ 3000,
+ 500);
+ }
+
+ private static void sifter() {
+
+ // Zirconium
+ GT_Values.RA.addSifterRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIlmenite", 1),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyWroughtIron", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1)
+ },
+ new int[] {5000, 2500, 1000, 1000, 300, 300},
+ 20 * 30,
+ 500);
+ GT_Values.RA.addSifterRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedTin", 1),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZinc", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1)
+ },
+ new int[] {10000, 5000, 1500, 1000, 500, 500},
+ 20 * 30,
+ 500);
+ GT_Values.RA.addSifterRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyTin", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1)
+ },
+ new int[] {10000, 5000, 1500, 1000, 500, 500},
+ 20 * 30,
+ 500);
+
+ // Radium
+ GT_Values.RA.addSifterRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUranium", 1),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLead", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1)
+ },
+ new int[] {10000, 5000, 1000, 500, 500, 500},
+ 20 * 30,
+ 500);
+ GT_Values.RA.addSifterRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUraninite", 1),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustUraninite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyUranium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1)
+ },
+ new int[] {10000, 5000, 500, 250, 250, 250},
+ 20 * 30,
+ 500);
+ GT_Values.RA.addSifterRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPitchblende", 1),
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPitchblende", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLead", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1)
+ },
+ new int[] {10000, 5000, 500, 250, 250, 250},
+ 20 * 30,
+ 500);
+ }
+
+ private static void fluidHeater() {
+
+ CORE.RA.addFluidHeaterRecipe(
+ FLUORIDES.SODIUM_FLUORIDE.getDust(1), null, FLUORIDES.SODIUM_FLUORIDE.getFluidStack(144), 20 * 30, 500);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java
index c2c8c01f45..ae1f019ed4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java
@@ -14,359 +14,338 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-public class RecipeLoader_NuclearFuelProcessing {
-
- public static void generate() {
-
- // Create Fuels
-
- final FluidStack aLithiumFluoride = FLUORIDES.LITHIUM_FLUORIDE.getFluidStack(100);
- final FluidStack aBerylliumFluoride = FLUORIDES.BERYLLIUM_FLUORIDE.getFluidStack(100);
- final FluidStack aThoriumFluoride = FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(100);
- final FluidStack aZirconiumFluoride = FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(100);
- final FluidStack aUraniumTetraFluoride = FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(100);
- final FluidStack aUranium235 = ELEMENT.getInstance().URANIUM235.getFluidStack(1000);
- final FluidStack aLiFBeF2ZrF4U235 = NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(100);
- final FluidStack aLiFBeF2ZrF4UF4 = NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(100);
- final FluidStack aLiFBeF2ThF4UF4 = NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(100);
-
- // 7LiF - BeF2 - ZrF4 - U235 - 590C
- CORE.RA.addFissionFuel(
- FluidUtils.getFluidStack(aLithiumFluoride, 550),
- FluidUtils.getFluidStack(aBerylliumFluoride, 150),
- FluidUtils.getFluidStack(aZirconiumFluoride, 60),
- FluidUtils.getFluidStack(aUranium235, 240),
- null, null, null, null, null, // Extra 5 inputs
- FluidUtils.getFluidStack(aLiFBeF2ZrF4U235, 1000),
- null,
- 90 * 60 * 20, // Duration
- MaterialUtils.getVoltageForTier(4)
- );
-
- // 7LiF - BeF2 - ZrF4 - UF4 - 650C
- CORE.RA.addFissionFuel(
- FluidUtils.getFluidStack(aLithiumFluoride, 600),
- FluidUtils.getFluidStack(aBerylliumFluoride, 250),
- FluidUtils.getFluidStack(aZirconiumFluoride, 80),
- FluidUtils.getFluidStack(aUraniumTetraFluoride, 70),
- null, null, null, null, null, // Extra 5 inputs
- FluidUtils.getFluidStack(aLiFBeF2ZrF4UF4, 1000),
- null,
- 120 * 60 * 20,
- MaterialUtils.getVoltageForTier(5)
- );
-
- // 7liF - BeF2 - ThF4 - UF4 - 566C
- CORE.RA.addFissionFuel(
- FluidUtils.getFluidStack(aLithiumFluoride, 580),
- FluidUtils.getFluidStack(aBerylliumFluoride, 270),
- FluidUtils.getFluidStack(aThoriumFluoride, 80),
- FluidUtils.getFluidStack(aUraniumTetraFluoride, 70),
- null, null, null, null, null, // Extra 5 inputs
- FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000),
- null,
- 150 * 60 * 20, // Duration
- MaterialUtils.getVoltageForTier(5)
- );
-
-
- // Reprocess Fuels
-
-
- // Reactor Blanket step 1 - Fluorination
- CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(17),
- ELEMENT.getInstance().FLUORINE.getCell(6),
- NUCLIDE.LiFThF4.getFluidStack(10000),
- new ItemStack[] {
- CI.emptyCells(5),
- FLUORIDES.LITHIUM_FLUORIDE.getCell(1),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233)
- },
- new int[] {10000, 10000, 500, 500, 500, 250, 250, 250},
- NUCLIDE.UF6F2.getFluidStack(1500),
- 20 * 60 * 10,
- MaterialUtils.getVoltageForTier(5));
- CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(18),
- ELEMENT.getInstance().FLUORINE.getCell(6),
- NUCLIDE.LiFBeF2ThF4.getFluidStack(10000),
- new ItemStack[] {
- CI.emptyCells(4),
- FLUORIDES.LITHIUM_FLUORIDE.getCell(1),
- FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233)
- },
- new int[] {10000, 10000, 10000, 1000, 1000, 1000, 500, 500, 500},
- NUCLIDE.UF6F2.getFluidStack(3000),
- 20 * 60 * 10,
- MaterialUtils.getVoltageForTier(5));
-
- // Reactor Blanket step 1 - Fluorination
- CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(7),
- ELEMENT.getInstance().FLUORINE.getCell(6),
- NUCLIDE.Sparged_LiFThF4.getFluidStack(10000),
- new ItemStack[] {
- CI.emptyCells(4),
- FLUORIDES.LITHIUM_FLUORIDE.getCell(2),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233)
- },
- new int[] {10000, 10000, 1000, 1000, 1000, 1000, 1000, 1000},
- NUCLIDE.UF6F2.getFluidStack(3000),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(5));
- CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(8),
- ELEMENT.getInstance().FLUORINE.getCell(6),
- NUCLIDE.Sparged_LiFBeF2ThF4.getFluidStack(10000),
- new ItemStack[] {
- CI.emptyCells(2),
- FLUORIDES.LITHIUM_FLUORIDE.getCell(2),
- FLUORIDES.BERYLLIUM_FLUORIDE.getCell(2),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
- ItemUtils.getSimpleStack(ModItems.dustProtactinium233)
- },
- new int[] {10000, 10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000},
- NUCLIDE.UF6F2.getFluidStack(6000),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(5));
-
-
- // Reactor Blanket step 2 - Sorption + Cold Trap
- CORE.RA.addColdTrapRecipe(
- 8,
- FLUORIDES.SODIUM_FLUORIDE.getCell(4),
- NUCLIDE.UF6F2.getFluidStack(3000),
- new ItemStack[] {
- ELEMENT.getInstance().FLUORINE.getCell(2),
- FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2),
- ELEMENT.getInstance().URANIUM233.getDust(1),
- ELEMENT.getInstance().URANIUM233.getDust(1),
- ELEMENT.getInstance().URANIUM233.getDust(1)
- },
- new int[] {10000, 10000, 3000, 2000, 1000},
- FLUORIDES.SODIUM_FLUORIDE.getFluidStack(2000),
- 20 * 60 * 10,
- MaterialUtils.getVoltageForTier(3));
-
-
-
-
- // Reactor Core step 0 - Process Burnt Salt
- // Tier 1 Fuel - Gives back FLIBE and breeds U233
- /* CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(1),
- CI.emptyCells(2),
- new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 4000),
- new ItemStack[] {
- FLUORIDES.LITHIUM_FLUORIDE.getCell(1),
- ELEMENT.getInstance().URANIUM233.getCell(1)
- },
- new int[] {10000, 10000},
- NUCLIDE.LiFBeF2.getFluidStack(2000),
- 20 * 60 * 60,
- MaterialUtils.getVoltageForTier(3));*/
-
-
-
- // LiBeF2UF4FP + F2 = LiFBeF2 & UF6F2FP
- // Reactor Core step 1 - Process Burnt Salt
- CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(1),
- ELEMENT.getInstance().FLUORINE.getCell(1),
- NUCLIDE.LiFBeF2UF4FP.getFluidStack(1000),
- new ItemStack[] {
- NUCLIDE.UF6F2FP.getCell(1)
- },
- new int[] {10000},
- FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 1000),
- 20 * 60 * 120,
- MaterialUtils.getVoltageForTier(3));
-
- // LiBeF2UF4FP + F2 = LiFBeF2 & UF6F2FP
- // Reactor Core step 1 - Process Burnt Salt
- CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(1),
- ELEMENT.getInstance().FLUORINE.getCell(3),
- NUCLIDE.Sparged_LiFBeF2UF4FP.getFluidStack(1000),
- new ItemStack[] {
- CI.emptyCells(1),
- NUCLIDE.UF6F2FP.getCell(2)
- },
- new int[] {10000},
- FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 2000),
- 20 * 60 * 60,
- MaterialUtils.getVoltageForTier(3));
-
-
-
- // Reactor Core step 2A - Sorption + Cold Trap
- CORE.RA.addColdTrapRecipe(
- 8,
- FLUORIDES.SODIUM_FLUORIDE.getCell(3),
- NUCLIDE.UF6F2FP.getFluidStack(2000),
- new ItemStack[] {
- ELEMENT.getInstance().FLUORINE.getCell(1),
- FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2),
- ELEMENT.getInstance().PHOSPHORUS.getDust(1),
- ELEMENT.getInstance().PHOSPHORUS.getDust(1),
- ELEMENT.getInstance().PHOSPHORUS.getDust(1),
- ELEMENT.getInstance().PHOSPHORUS.getDust(1),
- ELEMENT.getInstance().PHOSPHORUS.getDust(1),
- ELEMENT.getInstance().PHOSPHORUS.getDust(1),
- ELEMENT.getInstance().PHOSPHORUS.getDust(1)
- },
- new int[] {10000, 10000, 5000, 5000, 5000, 5000, 5000, 5000, 5000},
- FLUORIDES.SODIUM_FLUORIDE.getFluidStack(2000),
- 20 * 60 * 10,
- MaterialUtils.getVoltageForTier(4));
-
-
- // Reactor Core step 2B - Distillation
- GT_Values.RA.addDistillationTowerRecipe(
- FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 1000),
- new FluidStack[] {
- NUCLIDE.LiFBeF2.getFluidStack(250)
- },
- null,
- 120 * 60 * 20,
- MaterialUtils.getVoltageForTier(3));
-
-
- // UF6 -> UF4 reduction
- // UF6 + LiFBeF2 + H2 -> LiFBeF2UF4 + HF
- CORE.RA.addBlastRecipe(
- new ItemStack[] {
- FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(1),
- NUCLIDE.LiFBeF2.getCell(1)
- },
- new FluidStack[] {
- ELEMENT.getInstance().HYDROGEN.getFluidStack(2000)
- },
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2),
- CI.emptyCells(1)
- },
- new FluidStack[] {
- NUCLIDE.LiFBeF2UF4.getFluidStack(3000)
- },
- 20 * 60 * 10,
- MaterialUtils.getVoltageForTier(4),
- 6500);
-
-
-
-
- // LiFBeF2ZrF4U235 - We can't add both ZrF4 and U235 here, so best we leave this disabled.
- /*CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(8),
- NUCLIDE.LiFBeF2UF4.getCell(9),
- ELEMENT.getInstance().URANIUM235.getFluidStack(1000),
- new ItemStack[] {
- CI.emptyCells(9)
- },
- new int[] {10000},
- NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(10000),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(4));*/
-
- // LiFBeF2ZrF4UF4
- /*CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(9),
- NUCLIDE.LiFBeF2UF4.getCell(9),
- FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000),
- new ItemStack[] {
- CI.emptyCells(9)
- },
- new int[] {10000},
- NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(5));
-
- CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(9),
- FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getCell(1),
- NUCLIDE.LiFBeF2UF4.getFluidStack(9000),
- new ItemStack[] {
- CI.emptyCells(1)
- },
- new int[] {10000},
- NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(5));*/
-
- CORE.RA.addFissionFuel(
- FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000),
- NUCLIDE.LiFBeF2UF4.getFluidStack(9000),
- null,
- null,
- null, null, null, null, null,
- NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000),
- null,
- 20 * 60 * 120, // Duration
- MaterialUtils.getVoltageForTier(5)
- );
-
- // LiFBeF2ThF4UF4
- /*CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(10),
- NUCLIDE.LiFBeF2UF4.getCell(9),
- FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000),
- new ItemStack[] {
- CI.emptyCells(9)
- },
- new int[] {10000},
- NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(5));
-
- CORE.RA.addReactorProcessingUnitRecipe(
- CI.getNumberedAdvancedCircuit(10),
- FLUORIDES.THORIUM_TETRAFLUORIDE.getCell(1),
- NUCLIDE.LiFBeF2UF4.getFluidStack(9000),
- new ItemStack[] {
- CI.emptyCells(1)
- },
- new int[] {10000},
- NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000),
- 20 * 60 * 5,
- MaterialUtils.getVoltageForTier(5));*/
-
-
- CORE.RA.addFissionFuel(
- FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000),
- NUCLIDE.LiFBeF2UF4.getFluidStack(9000),
- null,
- null,
- null, null, null, null, null,
- NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000),
- null,
- 20 * 60 * 150, // Duration
- MaterialUtils.getVoltageForTier(5)
- );
-
-
-
-
- }
+public class RecipeLoader_NuclearFuelProcessing {
+
+ public static void generate() {
+
+ // Create Fuels
+
+ final FluidStack aLithiumFluoride = FLUORIDES.LITHIUM_FLUORIDE.getFluidStack(100);
+ final FluidStack aBerylliumFluoride = FLUORIDES.BERYLLIUM_FLUORIDE.getFluidStack(100);
+ final FluidStack aThoriumFluoride = FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(100);
+ final FluidStack aZirconiumFluoride = FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(100);
+ final FluidStack aUraniumTetraFluoride = FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(100);
+ final FluidStack aUranium235 = ELEMENT.getInstance().URANIUM235.getFluidStack(1000);
+ final FluidStack aLiFBeF2ZrF4U235 = NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(100);
+ final FluidStack aLiFBeF2ZrF4UF4 = NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(100);
+ final FluidStack aLiFBeF2ThF4UF4 = NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(100);
+
+ // 7LiF - BeF2 - ZrF4 - U235 - 590C
+ CORE.RA.addFissionFuel(
+ FluidUtils.getFluidStack(aLithiumFluoride, 550),
+ FluidUtils.getFluidStack(aBerylliumFluoride, 150),
+ FluidUtils.getFluidStack(aZirconiumFluoride, 60),
+ FluidUtils.getFluidStack(aUranium235, 240),
+ null,
+ null,
+ null,
+ null,
+ null, // Extra 5 inputs
+ FluidUtils.getFluidStack(aLiFBeF2ZrF4U235, 1000),
+ null,
+ 90 * 60 * 20, // Duration
+ MaterialUtils.getVoltageForTier(4));
+
+ // 7LiF - BeF2 - ZrF4 - UF4 - 650C
+ CORE.RA.addFissionFuel(
+ FluidUtils.getFluidStack(aLithiumFluoride, 600),
+ FluidUtils.getFluidStack(aBerylliumFluoride, 250),
+ FluidUtils.getFluidStack(aZirconiumFluoride, 80),
+ FluidUtils.getFluidStack(aUraniumTetraFluoride, 70),
+ null,
+ null,
+ null,
+ null,
+ null, // Extra 5 inputs
+ FluidUtils.getFluidStack(aLiFBeF2ZrF4UF4, 1000),
+ null,
+ 120 * 60 * 20,
+ MaterialUtils.getVoltageForTier(5));
+
+ // 7liF - BeF2 - ThF4 - UF4 - 566C
+ CORE.RA.addFissionFuel(
+ FluidUtils.getFluidStack(aLithiumFluoride, 580),
+ FluidUtils.getFluidStack(aBerylliumFluoride, 270),
+ FluidUtils.getFluidStack(aThoriumFluoride, 80),
+ FluidUtils.getFluidStack(aUraniumTetraFluoride, 70),
+ null,
+ null,
+ null,
+ null,
+ null, // Extra 5 inputs
+ FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000),
+ null,
+ 150 * 60 * 20, // Duration
+ MaterialUtils.getVoltageForTier(5));
+
+ // Reprocess Fuels
+
+ // Reactor Blanket step 1 - Fluorination
+ CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(17),
+ ELEMENT.getInstance().FLUORINE.getCell(6),
+ NUCLIDE.LiFThF4.getFluidStack(10000),
+ new ItemStack[] {
+ CI.emptyCells(5),
+ FLUORIDES.LITHIUM_FLUORIDE.getCell(1),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233)
+ },
+ new int[] {10000, 10000, 500, 500, 500, 250, 250, 250},
+ NUCLIDE.UF6F2.getFluidStack(1500),
+ 20 * 60 * 10,
+ MaterialUtils.getVoltageForTier(5));
+ CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(18),
+ ELEMENT.getInstance().FLUORINE.getCell(6),
+ NUCLIDE.LiFBeF2ThF4.getFluidStack(10000),
+ new ItemStack[] {
+ CI.emptyCells(4),
+ FLUORIDES.LITHIUM_FLUORIDE.getCell(1),
+ FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233)
+ },
+ new int[] {10000, 10000, 10000, 1000, 1000, 1000, 500, 500, 500},
+ NUCLIDE.UF6F2.getFluidStack(3000),
+ 20 * 60 * 10,
+ MaterialUtils.getVoltageForTier(5));
+
+ // Reactor Blanket step 1 - Fluorination
+ CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(7),
+ ELEMENT.getInstance().FLUORINE.getCell(6),
+ NUCLIDE.Sparged_LiFThF4.getFluidStack(10000),
+ new ItemStack[] {
+ CI.emptyCells(4),
+ FLUORIDES.LITHIUM_FLUORIDE.getCell(2),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233)
+ },
+ new int[] {10000, 10000, 1000, 1000, 1000, 1000, 1000, 1000},
+ NUCLIDE.UF6F2.getFluidStack(3000),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(5));
+ CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(8),
+ ELEMENT.getInstance().FLUORINE.getCell(6),
+ NUCLIDE.Sparged_LiFBeF2ThF4.getFluidStack(10000),
+ new ItemStack[] {
+ CI.emptyCells(2),
+ FLUORIDES.LITHIUM_FLUORIDE.getCell(2),
+ FLUORIDES.BERYLLIUM_FLUORIDE.getCell(2),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233),
+ ItemUtils.getSimpleStack(ModItems.dustProtactinium233)
+ },
+ new int[] {10000, 10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000},
+ NUCLIDE.UF6F2.getFluidStack(6000),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(5));
+
+ // Reactor Blanket step 2 - Sorption + Cold Trap
+ CORE.RA.addColdTrapRecipe(
+ 8,
+ FLUORIDES.SODIUM_FLUORIDE.getCell(4),
+ NUCLIDE.UF6F2.getFluidStack(3000),
+ new ItemStack[] {
+ ELEMENT.getInstance().FLUORINE.getCell(2),
+ FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2),
+ ELEMENT.getInstance().URANIUM233.getDust(1),
+ ELEMENT.getInstance().URANIUM233.getDust(1),
+ ELEMENT.getInstance().URANIUM233.getDust(1)
+ },
+ new int[] {10000, 10000, 3000, 2000, 1000},
+ FLUORIDES.SODIUM_FLUORIDE.getFluidStack(2000),
+ 20 * 60 * 10,
+ MaterialUtils.getVoltageForTier(3));
+
+ // Reactor Core step 0 - Process Burnt Salt
+ // Tier 1 Fuel - Gives back FLIBE and breeds U233
+ /* CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(1),
+ CI.emptyCells(2),
+ new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 4000),
+ new ItemStack[] {
+ FLUORIDES.LITHIUM_FLUORIDE.getCell(1),
+ ELEMENT.getInstance().URANIUM233.getCell(1)
+ },
+ new int[] {10000, 10000},
+ NUCLIDE.LiFBeF2.getFluidStack(2000),
+ 20 * 60 * 60,
+ MaterialUtils.getVoltageForTier(3));*/
+
+ // LiBeF2UF4FP + F2 = LiFBeF2 & UF6F2FP
+ // Reactor Core step 1 - Process Burnt Salt
+ CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(1),
+ ELEMENT.getInstance().FLUORINE.getCell(1),
+ NUCLIDE.LiFBeF2UF4FP.getFluidStack(1000),
+ new ItemStack[] {NUCLIDE.UF6F2FP.getCell(1)},
+ new int[] {10000},
+ FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 1000),
+ 20 * 60 * 120,
+ MaterialUtils.getVoltageForTier(3));
+
+ // LiBeF2UF4FP + F2 = LiFBeF2 & UF6F2FP
+ // Reactor Core step 1 - Process Burnt Salt
+ CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(1),
+ ELEMENT.getInstance().FLUORINE.getCell(3),
+ NUCLIDE.Sparged_LiFBeF2UF4FP.getFluidStack(1000),
+ new ItemStack[] {CI.emptyCells(1), NUCLIDE.UF6F2FP.getCell(2)},
+ new int[] {10000},
+ FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 2000),
+ 20 * 60 * 60,
+ MaterialUtils.getVoltageForTier(3));
+
+ // Reactor Core step 2A - Sorption + Cold Trap
+ CORE.RA.addColdTrapRecipe(
+ 8,
+ FLUORIDES.SODIUM_FLUORIDE.getCell(3),
+ NUCLIDE.UF6F2FP.getFluidStack(2000),
+ new ItemStack[] {
+ ELEMENT.getInstance().FLUORINE.getCell(1),
+ FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2),
+ ELEMENT.getInstance().PHOSPHORUS.getDust(1),
+ ELEMENT.getInstance().PHOSPHORUS.getDust(1),
+ ELEMENT.getInstance().PHOSPHORUS.getDust(1),
+ ELEMENT.getInstance().PHOSPHORUS.getDust(1),
+ ELEMENT.getInstance().PHOSPHORUS.getDust(1),
+ ELEMENT.getInstance().PHOSPHORUS.getDust(1),
+ ELEMENT.getInstance().PHOSPHORUS.getDust(1)
+ },
+ new int[] {10000, 10000, 5000, 5000, 5000, 5000, 5000, 5000, 5000},
+ FLUORIDES.SODIUM_FLUORIDE.getFluidStack(2000),
+ 20 * 60 * 10,
+ MaterialUtils.getVoltageForTier(4));
+
+ // Reactor Core step 2B - Distillation
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 1000),
+ new FluidStack[] {NUCLIDE.LiFBeF2.getFluidStack(250)},
+ null,
+ 120 * 60 * 20,
+ MaterialUtils.getVoltageForTier(3));
+
+ // UF6 -> UF4 reduction
+ // UF6 + LiFBeF2 + H2 -> LiFBeF2UF4 + HF
+ CORE.RA.addBlastRecipe(
+ new ItemStack[] {FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(1), NUCLIDE.LiFBeF2.getCell(1)},
+ new FluidStack[] {ELEMENT.getInstance().HYDROGEN.getFluidStack(2000)},
+ new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2), CI.emptyCells(1)
+ },
+ new FluidStack[] {NUCLIDE.LiFBeF2UF4.getFluidStack(3000)},
+ 20 * 60 * 10,
+ MaterialUtils.getVoltageForTier(4),
+ 6500);
+
+ // LiFBeF2ZrF4U235 - We can't add both ZrF4 and U235 here, so best we leave this disabled.
+ /*CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(8),
+ NUCLIDE.LiFBeF2UF4.getCell(9),
+ ELEMENT.getInstance().URANIUM235.getFluidStack(1000),
+ new ItemStack[] {
+ CI.emptyCells(9)
+ },
+ new int[] {10000},
+ NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(10000),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(4));*/
+
+ // LiFBeF2ZrF4UF4
+ /*CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(9),
+ NUCLIDE.LiFBeF2UF4.getCell(9),
+ FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000),
+ new ItemStack[] {
+ CI.emptyCells(9)
+ },
+ new int[] {10000},
+ NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(5));
+
+ CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(9),
+ FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getCell(1),
+ NUCLIDE.LiFBeF2UF4.getFluidStack(9000),
+ new ItemStack[] {
+ CI.emptyCells(1)
+ },
+ new int[] {10000},
+ NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(5));*/
+
+ CORE.RA.addFissionFuel(
+ FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000),
+ NUCLIDE.LiFBeF2UF4.getFluidStack(9000),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000),
+ null,
+ 20 * 60 * 120, // Duration
+ MaterialUtils.getVoltageForTier(5));
+
+ // LiFBeF2ThF4UF4
+ /*CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(10),
+ NUCLIDE.LiFBeF2UF4.getCell(9),
+ FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000),
+ new ItemStack[] {
+ CI.emptyCells(9)
+ },
+ new int[] {10000},
+ NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(5));
+
+ CORE.RA.addReactorProcessingUnitRecipe(
+ CI.getNumberedAdvancedCircuit(10),
+ FLUORIDES.THORIUM_TETRAFLUORIDE.getCell(1),
+ NUCLIDE.LiFBeF2UF4.getFluidStack(9000),
+ new ItemStack[] {
+ CI.emptyCells(1)
+ },
+ new int[] {10000},
+ NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000),
+ 20 * 60 * 5,
+ MaterialUtils.getVoltageForTier(5));*/
+
+ CORE.RA.addFissionFuel(
+ FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000),
+ NUCLIDE.LiFBeF2UF4.getFluidStack(9000),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000),
+ null,
+ 20 * 60 * 150, // Duration
+ MaterialUtils.getVoltageForTier(5));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
index 73bce2d20c..79363d7cb9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -4,12 +4,6 @@ import static gregtech.GT_Mod.GT_FML_LOGGER;
import static gregtech.api.enums.GT_Values.RA;
import static gtPlusPlus.core.lib.CORE.GTNH;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-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.GT_Values;
@@ -38,1860 +32,2204 @@ import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import gtPlusPlus.xmod.gregtech.common.helpers.FlotationRecipeHandler;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntity_RTG;
import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
- @Override
- public boolean addCokeOvenRecipe(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack aOutput, int aDuration, final int aEUt) {
- try {
- try {
- // RECIPEHANDLER_CokeOven.debug1();
- if (((aInput1 == null) /* && (aFluidInput == null) */)
- || ((aOutput == null) || (aFluidOutput == null))) {
- // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+"
- // aInput2:"+aInput2.toString()+"
- // aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Something was null, returning false");
- return false;
- }
-
- }
- catch (final NullPointerException e) {
- e.getStackTrace();
- }
- try {
- // RECIPEHANDLER_CokeOven.debug2(aInput1, aInput2, aFluidInput,
- // aFluidOutput, aOutput, aDuration, aEUt);
- if ((aOutput != null)
- && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) {
- // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+"
- // aInput2:"+aInput2.toString()+"
- // aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Something was null, returning false");
- return false;
- }
-
- }
- catch (final NullPointerException e) {
- e.getStackTrace();
- }
- try {
- // RECIPEHANDLER_CokeOven.debug3(aInput1, aInput2, aFluidInput,
- // aFluidOutput, aOutput, aDuration, aEUt);
- if ((aFluidOutput == null) || ((aDuration = GregTech_API.sRecipeFile.get("cokeoven",
- aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
- // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+"
- // aInput2:"+aInput2.toString()+"
- // aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Something was null, returning false");
- return false;
- }
-
- }
- catch (final NullPointerException e) {
- e.getStackTrace();
- }
- try {
-
- GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
- true,
- new ItemStack[] { aInput1, aInput2 },
- new ItemStack[] { aOutput },
- null,
- new int[] {},
- new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput },
- Math.max(1, aDuration),
- Math.max(1, aEUt),
- 0);
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size();
- int aSize2 = aSize;
- GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.add(aSpecialRecipe);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size();
-
-
- // RECIPEHANDLER_CokeOven.debug4(aInput1, aInput2, aFluidInput,
- // aFluidOutput, aOutput, aDuration, aEUt);
- /*if (aFluidInput == null && aInput2 != null) {
- GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 },
- new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration,
- aEUt, 0);
- }
- else if (aFluidInput == null && aInput2 == null) {
- GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1 },
- new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration,
- aEUt, 0);
- }
- else {
- GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 },
- new ItemStack[] { aOutput }, null, null, new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0);
- }*/
- // RECIPEHANDLER_CokeOven.debug5(aInput1, aInput2, aFluidInput,
- // aFluidOutput, aOutput, aDuration, aEUt);
-
- return aSize > aSize2;
-
- }
- catch (final NullPointerException e) {
- Logger.WARNING("Something was null, returning false");
- return false;
- }
- }
- catch (final Throwable e) {
- // Logger.WARNING("aInput1:"+aInput1.toString()+"
- // aInput2:"+aInput2.toString()+"
- // aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Failed.");
- e.getStackTrace();
- return false;
- }
- }
-
-
- @Override
- public boolean addCokeOvenRecipe(int aCircuit, ItemStack aInput2, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt) {
- return addCokeOvenRecipe(CI.getNumberedCircuit(aCircuit), aInput2, aFluidInputs, aFluidOutputs, aOutputs, aDuration, aEUt);
- }
-
- @Override
- public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt) {
- GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
- true,
- new ItemStack[] { aInput1, aInput2 },
- aOutputs,
- null,
- new int[] {},
- aFluidInputs,
- aFluidOutputs,
- Math.max(1, aDuration),
- Math.max(1, aEUt),
- 0);
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size();
- GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.add(aSpecialRecipe);
- return GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size() > aSize;
- }
-
- @Override
- public boolean addMatterFabricatorRecipe(final FluidStack aFluidInput, final FluidStack aFluidOutput,
- final int aDuration, final int aEUt) {
- try {
- try {
- // RECIPEHANDLER_MatterFabricator.debug1();
- if (aFluidOutput == null) {
- // Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Something was null, returning false");
- return false;
- }
-
- }
- catch (final NullPointerException e) {
- e.getStackTrace();
- }
- try {
-
- // RECIPEHANDLER_MatterFabricator.debug4(aFluidInput,
- // aFluidOutput, aDuration, aEUt);
- if (aFluidInput == null) {
- // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true,
- // null, new FluidStack[]{aFluidOutput}, aDuration, aEUt,
- // 0);
-
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {},
- new FluidStack[] {aFluidOutput},
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
- }
- else {
- // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true,
- // new FluidStack[]{aFluidInput}, new
- // FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {aFluidInput},
- new FluidStack[] {aFluidOutput},
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
- }
- RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
-
- return true;
-
- }
- catch (final NullPointerException e) {
- return false;
- }
- }
- catch (final Throwable e) {
- // Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Logger.WARNING("Failed.");
- e.getStackTrace();
- return false;
- }
- }
-
- @Override
- public boolean addMatterFabricatorRecipe(final ItemStack aInputStack, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final int aDuration, final int aEUt) {
- try {
- try {
- if ((aFluidOutput == null) || (aInputStack == null)) {
- return false;
- }
- }
- catch (final NullPointerException e) {
- }
- try {
- if (aFluidInput == null) {
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] { aInputStack },
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {},
- new FluidStack[] {aFluidOutput},
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
- }
- else {
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] { aInputStack },
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {aFluidInput},
- new FluidStack[] {aFluidOutput},
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
- }
- RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
- return true;
- }
- catch (final NullPointerException e) {
- return false;
- }
- }
- catch (final Throwable e) {
- return false;
- }
- }
-
- @Override
- public boolean addFuel(final ItemStack aInput1, final ItemStack aOutput1, final int aEU, final int aType) {
- if (aInput1 == null) {
- Logger.WARNING("Fuel Input is Invalid.");
- return false;
- }
- // new GregtechRecipe(aInput1, aOutput1,
- // GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
- return true;
- }
-
- /*
- * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack
- * aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack
- * aOutputFluid, int aDuration, int aEUt) { if ((aItemA == null) || (aItemB
- * == null) || (aOutputItems == null)) { return false; } for (ItemStack
- * tStack : aOutputItems) { if (tStack != null) { if ((aDuration =
- * GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) {
- * return false; }
- * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
- * new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null,
- * aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB,
- * aFluid, aOutputFluid, aOutputItems, aDuration, aEUt); return true; } }
- * return false; }
- * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack
- * aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt) { if ((aItemA
- * == null) || (aItemB == null) || (aOutputItems == null)) { return false; }
- * if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA,
- * aDuration)) <= 0) { return false; }
- * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
- * new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null,
- * aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB,
- * null, null, aOutputItems, aDuration, aEUt); return true; }
- * @Override public boolean addDehydratorRecipe(FluidStack aFluid,
- * FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int
- * aEUt){ if ((aFluid == null) || (aOutputFluid == null || aOutputItems ==
- * null)) { return false; } if ((aDuration =
- * GregTech_API.sRecipeFile.get("dehydrator", aFluid.getUnlocalizedName(),
- * aDuration)) <= 0) { return false; }
- * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
- * null, aOutputItems, null, new FluidStack[]{aFluid}, new
- * FluidStack[]{aOutputFluid}, aDuration, aEUt, 0);
- * RECIPEHANDLER_Dehydrator.debug5(null, null, aFluid, aOutputFluid,
- * aOutputItems, aDuration, aEUt); return true; }
- */
-
- /*@Override
- public boolean addDehydratorRecipe(final ItemStack aInput, final FluidStack aFluid, final ItemStack[] aOutput,
- int aDuration, final int aEUt) {
- Logger.WARNING("Trying to add a Dehydrator recipe.");
- try {
- if ((aInput == null) || (aFluid == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) {
- return false;
- }
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] { aInput },
- aOutput,
- null,
- new int[] {},
- new FluidStack[] { aFluid },
- new FluidStack[] {},
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(aRecipe);
- // RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null,
- // aOutput, aDuration, aEUt);
- return true;
- }
- catch (final NullPointerException e) {
- Logger.WARNING("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- return false;
- }
- }*/
-
- @Override
- public boolean addDehydratorRecipe(final ItemStack[] aInput, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack[] aOutputItems, final int[] aChances, int aDuration,
- final int aEUt) throws IndexOutOfBoundsException {
- Logger.WARNING("Trying to add a Dehydrator recipe.");
- try {
- if (aInput != null && aInput.length > 0) {
- if (aInput[0] != null) {
- Logger.WARNING("Recipe requires input: " + aInput[0].getDisplayName() + " x" + aInput[0].stackSize);
- }
- if (aInput.length > 1) {
- if (aInput[1] != null) {
- Logger.WARNING("Recipe requires input: " + aInput[1].getDisplayName() + " x" + aInput[1].stackSize);
- }
- }
- }
- if (aFluidInput != null) {
- Logger.WARNING("Recipe requires input: " + aFluidInput.getFluid().getName() + " " + aFluidInput.amount
- + "mbs");
- }
- if (((aInput == null || aInput.length == 0) && (aFluidInput == null)) || ((aOutputItems == null || aOutputItems.length == 0) && (aFluidOutput == null))) {
- return false;
- }
- if (aOutputItems != null) {
- Logger.WARNING("Recipe will output: " + ItemUtils.getArrayStackNames(aOutputItems));
- }
- if (aFluidOutput != null) {
- Logger.WARNING("Recipe will output: " + aFluidOutput.getFluid().getName());
- }
-
- GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
- true,
- aInput,
- aOutputItems,
- null,
- aChances,
- new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput },
- Math.max(1, aDuration),
- Math.max(1, aEUt),
- 0);
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.mRecipeList.size();
- int aSize2 = aSize;
- GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.add(aSpecialRecipe);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.mRecipeList.size();
-
- /*if (aInput.length == 1) {
- Logger.WARNING("Dehydrator recipe only has a single input item.");
- GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null,
- aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt,
- 0);
-
- }
- else {
- Logger.WARNING("Dehydrator recipe has two input items.");
- GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null,
- aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt,
- 0);
- }*/
-
- return aSize > aSize2;
- }
- catch (final NullPointerException e) {
- Logger.WARNING("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- return false;
- }
- }
-
- @Override
- public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack aOutput, final int aChance, int aDuration,
- final int aEUt) {
- return addBlastSmelterRecipe(aInput, null, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, 3700);
- }
-
- @Override
- public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput,
- final int aChance, int aDuration, final int aEUt) {
- return addBlastSmelterRecipe(aInput, aInputFluid, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, 3700);
- }
-
- @Override
- public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, ItemStack[] aOutputStack,
- final int aChance[], int aDuration, final int aEUt) {
- return addBlastSmelterRecipe(aInput, aInputFluid, aOutput, aOutputStack, aChance, aDuration, aEUt, 3700);
- }
-
- @Override
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance,
- int aDuration, int aEUt, int aSpecialValue) {
- return addBlastSmelterRecipe(aInput, aInputFluid, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, aSpecialValue);
- }
-
- @Override
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, ItemStack[] aOutputStack, int[] aChance,
- int aDuration, int aEUt, int aSpecialValue) {
- if ((aInput == null) || (aOutput == null)) {
- Logger.WARNING("Fail - Input or Output was null.");
- return false;
- }
-
- if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) {
- aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount);
- }
- if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) {
- aOutput = Materials.PulsatingIron.getMolten(aOutput.amount);
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("blastsmelter", aOutput.getFluid().getName(), aDuration)) <= 0) {
- Logger.WARNING("Recipe did not register.");
- return false;
- }
-
- for (int das = 0; das < aInput.length; das++) {
- if (aInput[das] != null) {
- Logger.WARNING("tMaterial[" + das + "]: " + aInput[das].getDisplayName() + ", Amount: "
- + aInput[das].stackSize);
- }
- }
-
- ArrayUtils.removeNulls(aInput);
- if (aInput.length <= 1) {
- return false;
- }
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size();
- int aSize2 = aSize;
- GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(
- true,
- aInput,
- aOutputStack,
- null,
- aChance,
- new FluidStack[] { aInputFluid },
- new FluidStack[] { aOutput },
- Math.max(1, aDuration),
- Math.max(1, aEUt),
- aSpecialValue);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size();
-
-
- /*GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(true, aInput, aOutputStack, null,
- aChance, new FluidStack[] { aInputFluid }, new FluidStack[] { aOutput }, aDuration, aEUt,
- aSpecialValue);*/
-
- return aSize > aSize2;
- }
-
- @Override
- public boolean addLFTRRecipe(final ItemStack aInput1, final FluidStack aInput2, final ItemStack aOutput1,
- final FluidStack aOutput2, final int aDuration, final int aEUt) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean addLFTRRecipe(final ItemStack aInput1, final ItemStack aInput2, final ItemStack aOutput1,
- final int aDuration, final int aEUt) {
- return false;
- }
-
- @Override
- public boolean addLFTRRecipe(final FluidStack aInput1, final FluidStack aInput2, final FluidStack aOutput1,
- final int aDuration, final int aEUt) {
- if ((aInput1 == null) || (aInput2 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) {
- return false;
- }
- GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(null,
- new FluidStack[] { aInput1, aInput2 }, new FluidStack[] { aOutput1 }, aDuration, aEUt, 16000);
- return true;
- }
-
- @Override
- public boolean addFissionFuel(final FluidStack aInput1, final FluidStack aInput2, final FluidStack aInput3,
- final FluidStack aInput4, final FluidStack aInput5, final FluidStack aInput6, final FluidStack aInput7,
- final FluidStack aInput8, final FluidStack aInput9, final FluidStack aOutput1, final FluidStack aOutput2,
- final int aDuration, final int aEUt) {
- return addFissionFuel(false, aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9, aOutput1, aOutput2, aDuration, aEUt);
- }
-
- @Override
- public boolean addFissionFuel(final boolean aOptimise, final FluidStack aInput1, final FluidStack aInput2, final FluidStack aInput3,
- final FluidStack aInput4, final FluidStack aInput5, final FluidStack aInput6, final FluidStack aInput7,
- final FluidStack aInput8, final FluidStack aInput9, final FluidStack aOutput1, final FluidStack aOutput2,
- final int aDuration, final int aEUt) {
-
- if ((aInput1 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) {
- return false;
- }
- final FluidStack inputs[] = { aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9 };
- final FluidStack outputs[] = { aOutput1, aOutput2 };
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size();
- int aSize2 = aSize;
- GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.addRecipe(
- aOptimise,
- new ItemStack[] {},
- new ItemStack[] {},
- null,
- new int[] {},
- inputs,
- outputs,
- Math.max(1, aDuration),
- Math.max(1, aEUt),
- 0);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size();
-
- if (aSize > aSize2) {
- Logger.INFO("Added Nuclear Fuel Recipe.");
- return true;
- }
- return false;
- }
-
- @Override
- public boolean addCyclotronRecipe(ItemStack aInputs, FluidStack aFluidInput, ItemStack[] aOutputs,
- FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt, int aSpecialValue) {
- return addCyclotronRecipe(new ItemStack[] {aInputs}, aFluidInput, aOutputs, aFluidOutput, aChances, aDuration, aEUt, aSpecialValue);
- }
-
- @Override
- public boolean addCyclotronRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack[] aOutput,
- FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt, int aSpecialValue) {
- if (aOutput == null || aOutput.length < 1 || !ItemUtils.checkForInvalidItems(aOutput)) {
- Logger.INFO("Bad output for Cyclotron Recipe.");
- return false;
- }
-
- GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
- true,
- aInputs,
- aOutput,
- null,
- aChances,
- new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput },
- Math.max(1, aDuration),
- Math.max(1, aEUt),
- aSpecialValue);
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.mRecipeList.size();
- int aSize2 = aSize;
- GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.add(aSpecialRecipe);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.mRecipeList.size();
-
- if (aSize > aSize2) {
- Logger.INFO("Added Cyclotron Recipe.");
- return true;
- }
-
- Logger.INFO("Failed to add Cyclotron Recipe. Output: "+ItemUtils.getArrayStackNames(aOutput));
- return false;
- }
-
- @Override
- public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4,
- FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3,
- ItemStack aOutput4, int aDuration, int aEUt) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) {
- return false;
- }
- GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
- true,
- new ItemStack[] { aInput1, aInput2, aInput3, aInput4 },
- new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 },
- null,
- new int[] {},
- new FluidStack[] { aFluidInput },
- new FluidStack[] { aFluidOutput },
- Math.max(1, aDuration),
- Math.max(1, aEUt),
- 0);
-
- int aSize = GT_Recipe_Map.sMixerRecipes.mRecipeList.size();
- GT_Recipe_Map.sMixerRecipes.add(aSpecialRecipe);
- return GT_Recipe_Map.sMixerRecipes.mRecipeList.size() > aSize;
- }
-
- // Machine Component Assembler
- @Override
- public boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1,
- int aDuration, int aEUt) {
- if (areItemsAndFluidsBothNull(aInputs, new FluidStack[] { aFluidInput })) {
- return false;
- }
- if (aOutput1 == null) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("machinecomponents", aOutput1, aDuration)) <= 0) {
- return false;
- }
- if (GTNH) {
- return false;
- }
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- aInputs,
- new ItemStack[] { aOutput1 },
- null,
- new int[] {},
- new FluidStack[] {aFluidInput},
- new FluidStack[] {},
- aDuration,
- aEUt,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes.addRecipe(aRecipe);
- return true;
- }
-
-
- public boolean addMultiblockCentrifugeRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial){
- if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) {
- return false;
- }
-
- if (!ItemUtils.checkForInvalidItems(aInputs, aOutputs)) {
- Logger.INFO("[Recipe] Error generating Large Centrifuge recipe.");
- Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(aInputs));
- Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(aFluidInputs));
- Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(aOutputs));
- Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs));
- return false;
- }
-
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- aInputs,
- aOutputs,
- null,
- aChances,
- aFluidInputs,
- aFluidOutputs,
- aDuration,
- aEUtick,
- aSpecial);
- GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.addRecipe(aRecipe);
-
- //GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
- return true;
- }
-
- public boolean addMultiblockElectrolyzerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial){
- if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) {
- return false;
- }
- if (!ItemUtils.checkForInvalidItems(aInputs, aOutputs)) {
- Logger.INFO("[Recipe] Error generating Large Electrolyzer recipe.");
- Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(aInputs));
- Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(aFluidInputs));
- Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(aOutputs));
- Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs));
- return false;
- }
-
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- aInputs,
- aOutputs,
- null,
- aChances,
- aFluidInputs,
- aFluidOutputs,
- aDuration,
- aEUtick,
- aSpecial);
- GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.addRecipe(aRecipe);
- //GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
- return true;
- }
-
-
- public boolean addAdvancedFreezerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial) {
- if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) {
- return false;
- }
-
- if (!ItemUtils.checkForInvalidItems(aInputs, aOutputs)) {
- Logger.INFO("[Recipe] Error generating Adv. Vac Freezer recipe.");
- Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(aInputs));
- Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(aFluidInputs));
- Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(aOutputs));
- Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs));
- return false;
- }
-
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- aInputs,
- aOutputs,
- null,
- aChances,
- aFluidInputs,
- aFluidOutputs,
- aDuration,
- aEUtick,
- aSpecial);
- GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.addRecipe(aRecipe);
- /*if (GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial) != null) {
- return true;
- }*/
- return false;
-
- }
-
- public boolean addMultiblockMixerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial){
- if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) {
- return false;
- }
- if (!ItemUtils.checkForInvalidItems(aInputs, aOutputs)) {
- Logger.INFO("[Recipe] Error generating Large Mixer recipe.");
- Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(aInputs));
- Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(aFluidInputs));
- Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(aOutputs));
- Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs));
- return false;
- }
-
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- aInputs,
- aOutputs,
- null,
- aChances,
- aFluidInputs,
- aFluidOutputs,
- aDuration,
- aEUtick,
- aSpecial);
- GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.addRecipe(aRecipe);
- return true;
- }
-
- public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2, ItemStack aOutput, int a1, int a2) {
- if (aInput1 instanceof String || aInput2 instanceof String) {
- int mCompleted = 0;
- if (aInput1 instanceof String && aInput2 instanceof String) {
- List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
- List<ItemStack> x1 = OreDictionary.getOres((String) aInput2, false);
- if (x != null && x.size() > 0 && x1 != null && x1.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- for (ItemStack r1 : x1) {
- r1.stackSize = aAmount2;
- if (GT_Values.RA.addAssemblerRecipe(r, r1, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
- }
- }
- else if (aInput1 instanceof String) {
- List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
- if (x != null && x.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- if (GT_Values.RA.addAssemblerRecipe(r, (ItemStack) aInput2, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
-
- }
- else {
- List<ItemStack> x = OreDictionary.getOres((String) aInput2, false);
- if (x != null && x.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- if (GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, r, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
- }
- return mCompleted > 0;
- }
- else {
- return GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, (ItemStack) aInput2, aOutput, a1, a2);
- }
- }
-
- public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2, FluidStack aInputFluid, ItemStack aOutput, int a1, int a2) {
- if (aInput1 instanceof String || aInput2 instanceof String) {
- int mCompleted = 0;
- if (aInput1 instanceof String && aInput2 instanceof String) {
- List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
- List<ItemStack> x1 = OreDictionary.getOres((String) aInput2, false);
- if (x != null && x.size() > 0 && x1 != null && x1.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- for (ItemStack r1 : x1) {
- r1.stackSize = aAmount2;
- if (GT_Values.RA.addAssemblerRecipe(r, r1, aInputFluid, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
- }
- }
- else if (aInput1 instanceof String) {
- List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
- if (x != null && x.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- if (GT_Values.RA.addAssemblerRecipe(r, (ItemStack) aInput2, aInputFluid, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
-
- }
- else {
- List<ItemStack> x = OreDictionary.getOres((String) aInput2, false);
- if (x != null && x.size() > 0) {
- for (ItemStack r : x) {
- r.stackSize = aAmount1;
- if (GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, r, aInputFluid, aOutput, a1, a2)) {
- mCompleted++;
- }
- }
- }
- }
- return mCompleted > 0;
- }
- else {
- return GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, (ItemStack) aInput2, aInputFluid, aOutput, a1, a2);
- }
- }
-
- /*
- * Reflection Based Recipe Additions with Fallbacks
- */
-
- private static final Method mSixSlotAssembly;
- private static final Method mAssemblyLine;
- private static final Method mScannerTT;
- private static final Method[] mChemicalRecipe = new Method[3];
- private static final Method mLargeChemReactor;
- private static final Method mPyroOven;
-
- static {
-
- //Get GT's RA class;
- Class<? extends IGT_RecipeAdder> clazz = GT_Values.RA.getClass();
-
- mChemicalRecipe[0] = ReflectionUtils.getMethod(clazz, "addChemicalRecipe", ItemStack.class, ItemStack.class, FluidStack.class, FluidStack.class, ItemStack.class, int.class);
-
-
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
- //6 Slot Assembler
- mSixSlotAssembly = ReflectionUtils.getMethod(clazz, "addAssemblerRecipe", ItemStack[].class, FluidStack.class, ItemStack.class, int.class, int.class);
- //Assembly Line
- mAssemblyLine = ReflectionUtils.getMethod(clazz, "addAssemblylineRecipe", ItemStack.class, int.class, ItemStack[].class, FluidStack[].class, ItemStack.class, int.class, int.class);
-
-
- Method T = null;
- if (LoadedMods.TecTech) {
- Class TTRecipeAdder = ReflectionUtils.getClass("com.github.technus.tectech.recipe.TT_recipeAdder");
- if (TTRecipeAdder != null) {
- Method ttTest = ReflectionUtils.getMethod(TTRecipeAdder, "addResearchableAssemblylineRecipe",
- ItemStack.class, int.class, int.class, int.class, int.class, Object[].class,
- FluidStack[].class, ItemStack.class, int.class, int.class);
- if (ttTest != null) {
- T = ttTest;
- }
- else {
- Method[] aDump = TTRecipeAdder.getDeclaredMethods();
- for (Method m : aDump) {
- if (m != null) {
- Logger.INFO("Found "+m.getName()+" | "+m.getModifiers()+" | "+ArrayUtils.toString(m.getParameters(), "EMPTY")+"");
- if (m.getName().toLowerCase().equals("addresearchableassemblylinerecipe")){
- Logger.INFO("Types: "+ArrayUtils.toString(m.getParameterTypes()));
- }
- }
- }
- }
- }
- }
- else {
- T = null;
- }
- mScannerTT = T;
-
- mChemicalRecipe[1] = ReflectionUtils.getMethod(clazz, "addChemicalRecipe", ItemStack.class, ItemStack.class, FluidStack.class, FluidStack.class, ItemStack.class, int.class, int.class);
- mChemicalRecipe[2] = ReflectionUtils.getMethod(clazz, "addChemicalRecipe", ItemStack.class, ItemStack.class, FluidStack.class, FluidStack.class, ItemStack.class, ItemStack.class, int.class);
-
- mLargeChemReactor = ReflectionUtils.getMethod(clazz, "addMultiblockChemicalRecipe", ItemStack[].class, FluidStack[].class, FluidStack[].class, ItemStack[].class, int.class, int.class);
-
- mPyroOven = ReflectionUtils.getMethod(clazz, "addPyrolyseRecipe", ItemStack.class, FluidStack.class, int.class, ItemStack.class, FluidStack.class, int.class, int.class);
-
-
-
- }
- else {
- mSixSlotAssembly = null;
- mAssemblyLine = null;
- mLargeChemReactor = null;
- mScannerTT = null;
- mPyroOven = null;
- }
-
-
- }
-
-
-
-
-
-
- public boolean addSixSlotAssemblingRecipe(ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1, int aDuration, int aEUt) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
- if (mSixSlotAssembly != null) {
- try {
- return (boolean) mSixSlotAssembly.invoke(GT_Values.RA, aInputs, aInputFluid, aOutput1, aDuration, aEUt);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- if (CORE.GTNH) {
- return false;
- }
- }
- }
- }
- return CORE.RA.addComponentMakerRecipe(aInputs, aInputFluid, aOutput1, aDuration, aEUt);
- }
-
- @Override
- public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) {
- if (GTNH)
- return RA.addAssemblylineRecipe(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt);
- if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) {
+ @Override
+ public boolean addCokeOvenRecipe(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack aOutput,
+ int aDuration,
+ final int aEUt) {
+ try {
+ try {
+ // RECIPEHANDLER_CokeOven.debug1();
+ if (((aInput1 == null) /* && (aFluidInput == null) */)
+ || ((aOutput == null) || (aFluidOutput == null))) {
+ // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+"
+ // aInput2:"+aInput2.toString()+"
+ // aFluidInput:"+aFluidInput.toString()+"
+ // aFluidOutput:"+aFluidOutput.toString()+"
+ // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
+ // aEU/t:"+aEUt);
+ Logger.WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (final NullPointerException e) {
+ e.getStackTrace();
+ }
+ try {
+ // RECIPEHANDLER_CokeOven.debug2(aInput1, aInput2, aFluidInput,
+ // aFluidOutput, aOutput, aDuration, aEUt);
+ if ((aOutput != null)
+ && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) {
+ // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+"
+ // aInput2:"+aInput2.toString()+"
+ // aFluidInput:"+aFluidInput.toString()+"
+ // aFluidOutput:"+aFluidOutput.toString()+"
+ // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
+ // aEU/t:"+aEUt);
+ Logger.WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (final NullPointerException e) {
+ e.getStackTrace();
+ }
+ try {
+ // RECIPEHANDLER_CokeOven.debug3(aInput1, aInput2, aFluidInput,
+ // aFluidOutput, aOutput, aDuration, aEUt);
+ if ((aFluidOutput == null)
+ || ((aDuration = GregTech_API.sRecipeFile.get(
+ "cokeoven", aFluidOutput.getFluid().getName(), aDuration))
+ <= 0)) {
+ // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+"
+ // aInput2:"+aInput2.toString()+"
+ // aFluidInput:"+aFluidInput.toString()+"
+ // aFluidOutput:"+aFluidOutput.toString()+"
+ // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
+ // aEU/t:"+aEUt);
+ Logger.WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (final NullPointerException e) {
+ e.getStackTrace();
+ }
+ try {
+
+ GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
+ true,
+ new ItemStack[] {aInput1, aInput2},
+ new ItemStack[] {aOutput},
+ null,
+ new int[] {},
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ Math.max(1, aDuration),
+ Math.max(1, aEUt),
+ 0);
+
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.add(aSpecialRecipe);
+ aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size();
+
+ // RECIPEHANDLER_CokeOven.debug4(aInput1, aInput2, aFluidInput,
+ // aFluidOutput, aOutput, aDuration, aEUt);
+ /*if (aFluidInput == null && aInput2 != null) {
+ GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 },
+ new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration,
+ aEUt, 0);
+ }
+ else if (aFluidInput == null && aInput2 == null) {
+ GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1 },
+ new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration,
+ aEUt, 0);
+ }
+ else {
+ GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 },
+ new ItemStack[] { aOutput }, null, null, new FluidStack[] { aFluidInput },
+ new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0);
+ }*/
+ // RECIPEHANDLER_CokeOven.debug5(aInput1, aInput2, aFluidInput,
+ // aFluidOutput, aOutput, aDuration, aEUt);
+
+ return aSize > aSize2;
+
+ } catch (final NullPointerException e) {
+ Logger.WARNING("Something was null, returning false");
+ return false;
+ }
+ } catch (final Throwable e) {
+ // Logger.WARNING("aInput1:"+aInput1.toString()+"
+ // aInput2:"+aInput2.toString()+"
+ // aFluidInput:"+aFluidInput.toString()+"
+ // aFluidOutput:"+aFluidOutput.toString()+"
+ // aOutput:"+aOutput.toString()+" aDuration:"+aDuration+"
+ // aEU/t:"+aEUt);
+ Logger.WARNING("Failed.");
+ e.getStackTrace();
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addCokeOvenRecipe(
+ int aCircuit,
+ ItemStack aInput2,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int aDuration,
+ int aEUt) {
+ return addCokeOvenRecipe(
+ CI.getNumberedCircuit(aCircuit), aInput2, aFluidInputs, aFluidOutputs, aOutputs, aDuration, aEUt);
+ }
+
+ @Override
+ public boolean addCokeOvenRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int aDuration,
+ int aEUt) {
+ GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
+ true,
+ new ItemStack[] {aInput1, aInput2},
+ aOutputs,
+ null,
+ new int[] {},
+ aFluidInputs,
+ aFluidOutputs,
+ Math.max(1, aDuration),
+ Math.max(1, aEUt),
+ 0);
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size();
+ GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.add(aSpecialRecipe);
+ return GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size() > aSize;
+ }
+
+ @Override
+ public boolean addMatterFabricatorRecipe(
+ final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) {
+ try {
+ try {
+ // RECIPEHANDLER_MatterFabricator.debug1();
+ if (aFluidOutput == null) {
+ // Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+"
+ // aFluidOutput:"+aFluidOutput.toString()+"
+ // aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Logger.WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (final NullPointerException e) {
+ e.getStackTrace();
+ }
+ try {
+
+ // RECIPEHANDLER_MatterFabricator.debug4(aFluidInput,
+ // aFluidOutput, aDuration, aEUt);
+ if (aFluidInput == null) {
+ // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true,
+ // null, new FluidStack[]{aFluidOutput}, aDuration, aEUt,
+ // 0);
+
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {},
+ new FluidStack[] {aFluidOutput},
+ aDuration,
+ aEUt,
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
+ } else {
+ // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true,
+ // new FluidStack[]{aFluidInput}, new
+ // FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ aDuration,
+ aEUt,
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
+ }
+ RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
+
+ return true;
+
+ } catch (final NullPointerException e) {
+ return false;
+ }
+ } catch (final Throwable e) {
+ // Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+"
+ // aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+"
+ // aEU/t:"+aEUt);
+ Logger.WARNING("Failed.");
+ e.getStackTrace();
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addMatterFabricatorRecipe(
+ final ItemStack aInputStack,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final int aDuration,
+ final int aEUt) {
+ try {
+ try {
+ if ((aFluidOutput == null) || (aInputStack == null)) {
+ return false;
+ }
+ } catch (final NullPointerException e) {
+ }
+ try {
+ if (aFluidInput == null) {
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {aInputStack},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {},
+ new FluidStack[] {aFluidOutput},
+ aDuration,
+ aEUt,
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
+ } else {
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {aInputStack},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ aDuration,
+ aEUt,
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe);
+ }
+ RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
+ return true;
+ } catch (final NullPointerException e) {
+ return false;
+ }
+ } catch (final Throwable e) {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addFuel(final ItemStack aInput1, final ItemStack aOutput1, final int aEU, final int aType) {
+ if (aInput1 == null) {
+ Logger.WARNING("Fuel Input is Invalid.");
+ return false;
+ }
+ // new GregtechRecipe(aInput1, aOutput1,
+ // GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
+ return true;
+ }
+
+ /*
+ * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack
+ * aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack
+ * aOutputFluid, int aDuration, int aEUt) { if ((aItemA == null) || (aItemB
+ * == null) || (aOutputItems == null)) { return false; } for (ItemStack
+ * tStack : aOutputItems) { if (tStack != null) { if ((aDuration =
+ * GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) {
+ * return false; }
+ * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
+ * new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null,
+ * aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB,
+ * aFluid, aOutputFluid, aOutputItems, aDuration, aEUt); return true; } }
+ * return false; }
+ * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack
+ * aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt) { if ((aItemA
+ * == null) || (aItemB == null) || (aOutputItems == null)) { return false; }
+ * if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA,
+ * aDuration)) <= 0) { return false; }
+ * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
+ * new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null,
+ * aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB,
+ * null, null, aOutputItems, aDuration, aEUt); return true; }
+ * @Override public boolean addDehydratorRecipe(FluidStack aFluid,
+ * FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int
+ * aEUt){ if ((aFluid == null) || (aOutputFluid == null || aOutputItems ==
+ * null)) { return false; } if ((aDuration =
+ * GregTech_API.sRecipeFile.get("dehydrator", aFluid.getUnlocalizedName(),
+ * aDuration)) <= 0) { return false; }
+ * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
+ * null, aOutputItems, null, new FluidStack[]{aFluid}, new
+ * FluidStack[]{aOutputFluid}, aDuration, aEUt, 0);
+ * RECIPEHANDLER_Dehydrator.debug5(null, null, aFluid, aOutputFluid,
+ * aOutputItems, aDuration, aEUt); return true; }
+ */
+
+ /*@Override
+ public boolean addDehydratorRecipe(final ItemStack aInput, final FluidStack aFluid, final ItemStack[] aOutput,
+ int aDuration, final int aEUt) {
+ Logger.WARNING("Trying to add a Dehydrator recipe.");
+ try {
+ if ((aInput == null) || (aFluid == null) || (aOutput == null)) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) {
+ return false;
+ }
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] { aInput },
+ aOutput,
+ null,
+ new int[] {},
+ new FluidStack[] { aFluid },
+ new FluidStack[] {},
+ aDuration,
+ aEUt,
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(aRecipe);
+ // RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null,
+ // aOutput, aDuration, aEUt);
+ return true;
+ }
+ catch (final NullPointerException e) {
+ Logger.WARNING("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
+ return false;
+ }
+ }*/
+
+ @Override
+ public boolean addDehydratorRecipe(
+ final ItemStack[] aInput,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack[] aOutputItems,
+ final int[] aChances,
+ int aDuration,
+ final int aEUt)
+ throws IndexOutOfBoundsException {
+ Logger.WARNING("Trying to add a Dehydrator recipe.");
+ try {
+ if (aInput != null && aInput.length > 0) {
+ if (aInput[0] != null) {
+ Logger.WARNING("Recipe requires input: " + aInput[0].getDisplayName() + " x" + aInput[0].stackSize);
+ }
+ if (aInput.length > 1) {
+ if (aInput[1] != null) {
+ Logger.WARNING(
+ "Recipe requires input: " + aInput[1].getDisplayName() + " x" + aInput[1].stackSize);
+ }
+ }
+ }
+ if (aFluidInput != null) {
+ Logger.WARNING("Recipe requires input: "
+ + aFluidInput.getFluid().getName() + " " + aFluidInput.amount + "mbs");
+ }
+ if (((aInput == null || aInput.length == 0) && (aFluidInput == null))
+ || ((aOutputItems == null || aOutputItems.length == 0) && (aFluidOutput == null))) {
+ return false;
+ }
+ if (aOutputItems != null) {
+ Logger.WARNING("Recipe will output: " + ItemUtils.getArrayStackNames(aOutputItems));
+ }
+ if (aFluidOutput != null) {
+ Logger.WARNING("Recipe will output: " + aFluidOutput.getFluid().getName());
+ }
+
+ GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
+ true,
+ aInput,
+ aOutputItems,
+ null,
+ aChances,
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ Math.max(1, aDuration),
+ Math.max(1, aEUt),
+ 0);
+
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.add(aSpecialRecipe);
+ aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.mRecipeList.size();
+
+ /*if (aInput.length == 1) {
+ Logger.WARNING("Dehydrator recipe only has a single input item.");
+ GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null,
+ aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt,
+ 0);
+
+ }
+ else {
+ Logger.WARNING("Dehydrator recipe has two input items.");
+ GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null,
+ aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt,
+ 0);
+ }*/
+
+ return aSize > aSize2;
+ } catch (final NullPointerException e) {
+ Logger.WARNING("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addBlastSmelterRecipe(
+ final ItemStack[] aInput, FluidStack aOutput, final int aChance, int aDuration, final int aEUt) {
+ return addBlastSmelterRecipe(
+ aInput, null, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, 3700);
+ }
+
+ @Override
+ public boolean addBlastSmelterRecipe(
+ final ItemStack[] aInput,
+ FluidStack aInputFluid,
+ FluidStack aOutput,
+ final int aChance,
+ int aDuration,
+ final int aEUt) {
+ return addBlastSmelterRecipe(
+ aInput, aInputFluid, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, 3700);
+ }
+
+ @Override
+ public boolean addBlastSmelterRecipe(
+ final ItemStack[] aInput,
+ FluidStack aInputFluid,
+ FluidStack aOutput,
+ ItemStack[] aOutputStack,
+ final int aChance[],
+ int aDuration,
+ final int aEUt) {
+ return addBlastSmelterRecipe(aInput, aInputFluid, aOutput, aOutputStack, aChance, aDuration, aEUt, 3700);
+ }
+
+ @Override
+ public boolean addBlastSmelterRecipe(
+ ItemStack[] aInput,
+ FluidStack aInputFluid,
+ FluidStack aOutput,
+ int aChance,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ return addBlastSmelterRecipe(
+ aInput, aInputFluid, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, aSpecialValue);
+ }
+
+ @Override
+ public boolean addBlastSmelterRecipe(
+ ItemStack[] aInput,
+ FluidStack aInputFluid,
+ FluidStack aOutput,
+ ItemStack[] aOutputStack,
+ int[] aChance,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ if ((aInput == null) || (aOutput == null)) {
+ Logger.WARNING("Fail - Input or Output was null.");
+ return false;
+ }
+
+ if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) {
+ aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount);
+ }
+ if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) {
+ aOutput = Materials.PulsatingIron.getMolten(aOutput.amount);
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get(
+ "blastsmelter", aOutput.getFluid().getName(), aDuration))
+ <= 0) {
+ Logger.WARNING("Recipe did not register.");
+ return false;
+ }
+
+ for (int das = 0; das < aInput.length; das++) {
+ if (aInput[das] != null) {
+ Logger.WARNING("tMaterial[" + das + "]: " + aInput[das].getDisplayName() + ", Amount: "
+ + aInput[das].stackSize);
+ }
+ }
+
+ ArrayUtils.removeNulls(aInput);
+ if (aInput.length <= 1) {
+ return false;
+ }
+
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(
+ true,
+ aInput,
+ aOutputStack,
+ null,
+ aChance,
+ new FluidStack[] {aInputFluid},
+ new FluidStack[] {aOutput},
+ Math.max(1, aDuration),
+ Math.max(1, aEUt),
+ aSpecialValue);
+ aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size();
+
+ /*GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(true, aInput, aOutputStack, null,
+ aChance, new FluidStack[] { aInputFluid }, new FluidStack[] { aOutput }, aDuration, aEUt,
+ aSpecialValue);*/
+
+ return aSize > aSize2;
+ }
+
+ @Override
+ public boolean addLFTRRecipe(
+ final ItemStack aInput1,
+ final FluidStack aInput2,
+ final ItemStack aOutput1,
+ final FluidStack aOutput2,
+ final int aDuration,
+ final int aEUt) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean addLFTRRecipe(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final ItemStack aOutput1,
+ final int aDuration,
+ final int aEUt) {
+ return false;
+ }
+
+ @Override
+ public boolean addLFTRRecipe(
+ final FluidStack aInput1,
+ final FluidStack aInput2,
+ final FluidStack aOutput1,
+ final int aDuration,
+ final int aEUt) {
+ if ((aInput1 == null) || (aInput2 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) {
+ return false;
+ }
+ GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(
+ null, new FluidStack[] {aInput1, aInput2}, new FluidStack[] {aOutput1}, aDuration, aEUt, 16000);
+ return true;
+ }
+
+ @Override
+ public boolean addFissionFuel(
+ final FluidStack aInput1,
+ final FluidStack aInput2,
+ final FluidStack aInput3,
+ final FluidStack aInput4,
+ final FluidStack aInput5,
+ final FluidStack aInput6,
+ final FluidStack aInput7,
+ final FluidStack aInput8,
+ final FluidStack aInput9,
+ final FluidStack aOutput1,
+ final FluidStack aOutput2,
+ final int aDuration,
+ final int aEUt) {
+ return addFissionFuel(
+ false, aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9, aOutput1,
+ aOutput2, aDuration, aEUt);
+ }
+
+ @Override
+ public boolean addFissionFuel(
+ final boolean aOptimise,
+ final FluidStack aInput1,
+ final FluidStack aInput2,
+ final FluidStack aInput3,
+ final FluidStack aInput4,
+ final FluidStack aInput5,
+ final FluidStack aInput6,
+ final FluidStack aInput7,
+ final FluidStack aInput8,
+ final FluidStack aInput9,
+ final FluidStack aOutput1,
+ final FluidStack aOutput2,
+ final int aDuration,
+ final int aEUt) {
+
+ if ((aInput1 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) {
+ return false;
+ }
+ final FluidStack inputs[] = {aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9};
+ final FluidStack outputs[] = {aOutput1, aOutput2};
+
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size();
+ int aSize2 = aSize;
+ GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.addRecipe(
+ aOptimise,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ inputs,
+ outputs,
+ Math.max(1, aDuration),
+ Math.max(1, aEUt),
+ 0);
+ aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size();
+
+ if (aSize > aSize2) {
+ Logger.INFO("Added Nuclear Fuel Recipe.");
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addCyclotronRecipe(
+ ItemStack aInputs,
+ FluidStack aFluidInput,
+ ItemStack[] aOutputs,
+ FluidStack aFluidOutput,
+ int[] aChances,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ return addCyclotronRecipe(
+ new ItemStack[] {aInputs},
+ aFluidInput,
+ aOutputs,
+ aFluidOutput,
+ aChances,
+ aDuration,
+ aEUt,
+ aSpecialValue);
+ }
+
+ @Override
+ public boolean addCyclotronRecipe(
+ ItemStack[] aInputs,
+ FluidStack aFluidInput,
+ ItemStack[] aOutput,
+ FluidStack aFluidOutput,
+ int[] aChances,
+ int aDuration,
+ int aEUt,
+ int aSpecialValue) {
+ if (aOutput == null || aOutput.length < 1 || !ItemUtils.checkForInvalidItems(aOutput)) {
+ Logger.INFO("Bad output for Cyclotron Recipe.");
+ return false;
+ }
+
+ GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
+ true,
+ aInputs,
+ aOutput,
+ null,
+ aChances,
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ Math.max(1, aDuration),
+ Math.max(1, aEUt),
+ aSpecialValue);
+
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.add(aSpecialRecipe);
+ aSize = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.mRecipeList.size();
+
+ if (aSize > aSize2) {
+ Logger.INFO("Added Cyclotron Recipe.");
+ return true;
+ }
+
+ Logger.INFO("Failed to add Cyclotron Recipe. Output: " + ItemUtils.getArrayStackNames(aOutput));
+ return false;
+ }
+
+ @Override
+ public boolean addMixerRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ ItemStack aInput3,
+ ItemStack aInput4,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ ItemStack aOutput4,
+ int aDuration,
+ int aEUt) {
+ if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) {
+ return false;
+ }
+ GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
+ true,
+ new ItemStack[] {aInput1, aInput2, aInput3, aInput4},
+ new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4},
+ null,
+ new int[] {},
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ Math.max(1, aDuration),
+ Math.max(1, aEUt),
+ 0);
+
+ int aSize = GT_Recipe_Map.sMixerRecipes.mRecipeList.size();
+ GT_Recipe_Map.sMixerRecipes.add(aSpecialRecipe);
+ return GT_Recipe_Map.sMixerRecipes.mRecipeList.size() > aSize;
+ }
+
+ // Machine Component Assembler
+ @Override
+ public boolean addComponentMakerRecipe(
+ ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) {
+ if (areItemsAndFluidsBothNull(aInputs, new FluidStack[] {aFluidInput})) {
+ return false;
+ }
+ if (aOutput1 == null) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("machinecomponents", aOutput1, aDuration)) <= 0) {
+ return false;
+ }
+ if (GTNH) {
+ return false;
+ }
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ aInputs,
+ new ItemStack[] {aOutput1},
+ null,
+ new int[] {},
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {},
+ aDuration,
+ aEUt,
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes.addRecipe(aRecipe);
+ return true;
+ }
+
+ public boolean addMultiblockCentrifugeRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ int aDuration,
+ int aEUtick,
+ int aSpecial) {
+ if (areItemsAndFluidsBothNull(aInputs, aFluidInputs)
+ || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)
+ || aEUtick <= 0) {
+ return false;
+ }
+
+ if (!ItemUtils.checkForInvalidItems(aInputs, aOutputs)) {
+ Logger.INFO("[Recipe] Error generating Large Centrifuge recipe.");
+ Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(aInputs));
+ Logger.INFO("Fluid Inputs: " + ItemUtils.getArrayStackNames(aFluidInputs));
+ Logger.INFO("Outputs: " + ItemUtils.getArrayStackNames(aOutputs));
+ Logger.INFO("Fluid Outputs: " + ItemUtils.getArrayStackNames(aFluidOutputs));
+ return false;
+ }
+
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
+ GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.addRecipe(aRecipe);
+
+ // GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes.addRecipe(true, aInputs, aOutputs, null, aChances,
+ // aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
+ return true;
+ }
+
+ public boolean addMultiblockElectrolyzerRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ int aDuration,
+ int aEUtick,
+ int aSpecial) {
+ if (areItemsAndFluidsBothNull(aInputs, aFluidInputs)
+ || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)
+ || aEUtick <= 0) {
+ return false;
+ }
+ if (!ItemUtils.checkForInvalidItems(aInputs, aOutputs)) {
+ Logger.INFO("[Recipe] Error generating Large Electrolyzer recipe.");
+ Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(aInputs));
+ Logger.INFO("Fluid Inputs: " + ItemUtils.getArrayStackNames(aFluidInputs));
+ Logger.INFO("Outputs: " + ItemUtils.getArrayStackNames(aOutputs));
+ Logger.INFO("Fluid Outputs: " + ItemUtils.getArrayStackNames(aFluidOutputs));
+ return false;
+ }
+
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
+ GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.addRecipe(aRecipe);
+ // GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances,
+ // aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
+ return true;
+ }
+
+ public boolean addAdvancedFreezerRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ int aDuration,
+ int aEUtick,
+ int aSpecial) {
+ if (areItemsAndFluidsBothNull(aInputs, aFluidInputs)
+ || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)
+ || aEUtick <= 0) {
+ return false;
+ }
+
+ if (!ItemUtils.checkForInvalidItems(aInputs, aOutputs)) {
+ Logger.INFO("[Recipe] Error generating Adv. Vac Freezer recipe.");
+ Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(aInputs));
+ Logger.INFO("Fluid Inputs: " + ItemUtils.getArrayStackNames(aFluidInputs));
+ Logger.INFO("Outputs: " + ItemUtils.getArrayStackNames(aOutputs));
+ Logger.INFO("Fluid Outputs: " + ItemUtils.getArrayStackNames(aFluidOutputs));
+ return false;
+ }
+
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
+ GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.addRecipe(aRecipe);
+ /*if (GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial) != null) {
+ return true;
+ }*/
+ return false;
+ }
+
+ public boolean addMultiblockMixerRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ int aDuration,
+ int aEUtick,
+ int aSpecial) {
+ if (areItemsAndFluidsBothNull(aInputs, aFluidInputs)
+ || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)
+ || aEUtick <= 0) {
+ return false;
+ }
+ if (!ItemUtils.checkForInvalidItems(aInputs, aOutputs)) {
+ Logger.INFO("[Recipe] Error generating Large Mixer recipe.");
+ Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(aInputs));
+ Logger.INFO("Fluid Inputs: " + ItemUtils.getArrayStackNames(aFluidInputs));
+ Logger.INFO("Outputs: " + ItemUtils.getArrayStackNames(aOutputs));
+ Logger.INFO("Fluid Outputs: " + ItemUtils.getArrayStackNames(aFluidOutputs));
+ return false;
+ }
+
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial);
+ GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.addRecipe(aRecipe);
+ return true;
+ }
+
+ public boolean addAssemblerRecipeWithOreDict(
+ Object aInput1, int aAmount1, Object aInput2, int aAmount2, ItemStack aOutput, int a1, int a2) {
+ if (aInput1 instanceof String || aInput2 instanceof String) {
+ int mCompleted = 0;
+ if (aInput1 instanceof String && aInput2 instanceof String) {
+ List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
+ List<ItemStack> x1 = OreDictionary.getOres((String) aInput2, false);
+ if (x != null && x.size() > 0 && x1 != null && x1.size() > 0) {
+ for (ItemStack r : x) {
+ r.stackSize = aAmount1;
+ for (ItemStack r1 : x1) {
+ r1.stackSize = aAmount2;
+ if (GT_Values.RA.addAssemblerRecipe(r, r1, aOutput, a1, a2)) {
+ mCompleted++;
+ }
+ }
+ }
+ }
+ } else if (aInput1 instanceof String) {
+ List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
+ if (x != null && x.size() > 0) {
+ for (ItemStack r : x) {
+ r.stackSize = aAmount1;
+ if (GT_Values.RA.addAssemblerRecipe(r, (ItemStack) aInput2, aOutput, a1, a2)) {
+ mCompleted++;
+ }
+ }
+ }
+
+ } else {
+ List<ItemStack> x = OreDictionary.getOres((String) aInput2, false);
+ if (x != null && x.size() > 0) {
+ for (ItemStack r : x) {
+ r.stackSize = aAmount1;
+ if (GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, r, aOutput, a1, a2)) {
+ mCompleted++;
+ }
+ }
+ }
+ }
+ return mCompleted > 0;
+ } else {
+ return GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, (ItemStack) aInput2, aOutput, a1, a2);
+ }
+ }
+
+ public boolean addAssemblerRecipeWithOreDict(
+ Object aInput1,
+ int aAmount1,
+ Object aInput2,
+ int aAmount2,
+ FluidStack aInputFluid,
+ ItemStack aOutput,
+ int a1,
+ int a2) {
+ if (aInput1 instanceof String || aInput2 instanceof String) {
+ int mCompleted = 0;
+ if (aInput1 instanceof String && aInput2 instanceof String) {
+ List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
+ List<ItemStack> x1 = OreDictionary.getOres((String) aInput2, false);
+ if (x != null && x.size() > 0 && x1 != null && x1.size() > 0) {
+ for (ItemStack r : x) {
+ r.stackSize = aAmount1;
+ for (ItemStack r1 : x1) {
+ r1.stackSize = aAmount2;
+ if (GT_Values.RA.addAssemblerRecipe(r, r1, aInputFluid, aOutput, a1, a2)) {
+ mCompleted++;
+ }
+ }
+ }
+ }
+ } else if (aInput1 instanceof String) {
+ List<ItemStack> x = OreDictionary.getOres((String) aInput1, false);
+ if (x != null && x.size() > 0) {
+ for (ItemStack r : x) {
+ r.stackSize = aAmount1;
+ if (GT_Values.RA.addAssemblerRecipe(r, (ItemStack) aInput2, aInputFluid, aOutput, a1, a2)) {
+ mCompleted++;
+ }
+ }
+ }
+
+ } else {
+ List<ItemStack> x = OreDictionary.getOres((String) aInput2, false);
+ if (x != null && x.size() > 0) {
+ for (ItemStack r : x) {
+ r.stackSize = aAmount1;
+ if (GT_Values.RA.addAssemblerRecipe((ItemStack) aInput1, r, aInputFluid, aOutput, a1, a2)) {
+ mCompleted++;
+ }
+ }
+ }
+ }
+ return mCompleted > 0;
+ } else {
+ return GT_Values.RA.addAssemblerRecipe(
+ (ItemStack) aInput1, (ItemStack) aInput2, aInputFluid, aOutput, a1, a2);
+ }
+ }
+
+ /*
+ * Reflection Based Recipe Additions with Fallbacks
+ */
+
+ private static final Method mSixSlotAssembly;
+ private static final Method mAssemblyLine;
+ private static final Method mScannerTT;
+ private static final Method[] mChemicalRecipe = new Method[3];
+ private static final Method mLargeChemReactor;
+ private static final Method mPyroOven;
+
+ static {
+
+ // Get GT's RA class;
+ Class<? extends IGT_RecipeAdder> clazz = GT_Values.RA.getClass();
+
+ mChemicalRecipe[0] = ReflectionUtils.getMethod(
+ clazz,
+ "addChemicalRecipe",
+ ItemStack.class,
+ ItemStack.class,
+ FluidStack.class,
+ FluidStack.class,
+ ItemStack.class,
+ int.class);
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
+ // 6 Slot Assembler
+ mSixSlotAssembly = ReflectionUtils.getMethod(
+ clazz,
+ "addAssemblerRecipe",
+ ItemStack[].class,
+ FluidStack.class,
+ ItemStack.class,
+ int.class,
+ int.class);
+ // Assembly Line
+ mAssemblyLine = ReflectionUtils.getMethod(
+ clazz,
+ "addAssemblylineRecipe",
+ ItemStack.class,
+ int.class,
+ ItemStack[].class,
+ FluidStack[].class,
+ ItemStack.class,
+ int.class,
+ int.class);
+
+ Method T = null;
+ if (LoadedMods.TecTech) {
+ Class TTRecipeAdder = ReflectionUtils.getClass("com.github.technus.tectech.recipe.TT_recipeAdder");
+ if (TTRecipeAdder != null) {
+ Method ttTest = ReflectionUtils.getMethod(
+ TTRecipeAdder,
+ "addResearchableAssemblylineRecipe",
+ ItemStack.class,
+ int.class,
+ int.class,
+ int.class,
+ int.class,
+ Object[].class,
+ FluidStack[].class,
+ ItemStack.class,
+ int.class,
+ int.class);
+ if (ttTest != null) {
+ T = ttTest;
+ } else {
+ Method[] aDump = TTRecipeAdder.getDeclaredMethods();
+ for (Method m : aDump) {
+ if (m != null) {
+ Logger.INFO("Found " + m.getName() + " | " + m.getModifiers() + " | "
+ + ArrayUtils.toString(m.getParameters(), "EMPTY") + "");
+ if (m.getName().toLowerCase().equals("addresearchableassemblylinerecipe")) {
+ Logger.INFO("Types: " + ArrayUtils.toString(m.getParameterTypes()));
+ }
+ }
+ }
+ }
+ }
+ } else {
+ T = null;
+ }
+ mScannerTT = T;
+
+ mChemicalRecipe[1] = ReflectionUtils.getMethod(
+ clazz,
+ "addChemicalRecipe",
+ ItemStack.class,
+ ItemStack.class,
+ FluidStack.class,
+ FluidStack.class,
+ ItemStack.class,
+ int.class,
+ int.class);
+ mChemicalRecipe[2] = ReflectionUtils.getMethod(
+ clazz,
+ "addChemicalRecipe",
+ ItemStack.class,
+ ItemStack.class,
+ FluidStack.class,
+ FluidStack.class,
+ ItemStack.class,
+ ItemStack.class,
+ int.class);
+
+ mLargeChemReactor = ReflectionUtils.getMethod(
+ clazz,
+ "addMultiblockChemicalRecipe",
+ ItemStack[].class,
+ FluidStack[].class,
+ FluidStack[].class,
+ ItemStack[].class,
+ int.class,
+ int.class);
+
+ mPyroOven = ReflectionUtils.getMethod(
+ clazz,
+ "addPyrolyseRecipe",
+ ItemStack.class,
+ FluidStack.class,
+ int.class,
+ ItemStack.class,
+ FluidStack.class,
+ int.class,
+ int.class);
+
+ } else {
+ mSixSlotAssembly = null;
+ mAssemblyLine = null;
+ mLargeChemReactor = null;
+ mScannerTT = null;
+ mPyroOven = null;
+ }
+ }
+
+ public boolean addSixSlotAssemblingRecipe(
+ ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1, int aDuration, int aEUt) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
+ if (mSixSlotAssembly != null) {
+ try {
+ return (boolean)
+ mSixSlotAssembly.invoke(GT_Values.RA, aInputs, aInputFluid, aOutput1, aDuration, aEUt);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ if (CORE.GTNH) {
+ return false;
+ }
+ }
+ }
+ }
+ return CORE.RA.addComponentMakerRecipe(aInputs, aInputFluid, aOutput1, aDuration, aEUt);
+ }
+
+ @Override
+ public boolean addAssemblylineRecipe(
+ ItemStack aResearchItem,
+ int aResearchTime,
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack aOutput,
+ int aDuration,
+ int aEUt) {
+ if (GTNH)
+ return RA.addAssemblylineRecipe(
+ aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt);
+ if ((aResearchItem == null)
+ || (aResearchTime <= 0)
+ || (aInputs == null)
+ || (aOutput == null)
+ || aInputs.length > 15
+ || aInputs.length < 4) {
return false;
}
if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) {
return false;
}
- for(ItemStack tItem : aInputs){
- if(tItem==null){
- GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe");
+ for (ItemStack tItem : aInputs) {
+ if (tItem == null) {
+ GT_FML_LOGGER.info("addAssemblingLineRecipe " + aResearchItem.getDisplayName() + " --> "
+ + aOutput.getUnlocalizedName() + " there is some null item in that recipe");
}
}
- GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, -201);
- GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true);
- GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt));
+ GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
+ false,
+ new ItemStack[] {aResearchItem},
+ new ItemStack[] {aOutput},
+ new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])},
+ null,
+ null,
+ aResearchTime,
+ 30,
+ -201);
+ GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(
+ false,
+ aInputs,
+ new ItemStack[] {aOutput},
+ new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])},
+ aFluidInputs,
+ null,
+ aDuration,
+ aEUt,
+ 0,
+ true);
+ GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine(
+ aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt));
return true;
}
@Override
- public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) {
- if (GTNH)
- return RA.addAssemblylineRecipe(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt);
- if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) {
+ public boolean addAssemblylineRecipe(
+ ItemStack aResearchItem,
+ int aResearchTime,
+ Object[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack aOutput,
+ int aDuration,
+ int aEUt) {
+ if (GTNH)
+ return RA.addAssemblylineRecipe(
+ aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt);
+ if ((aResearchItem == null)
+ || (aResearchTime <= 0)
+ || (aInputs == null)
+ || (aOutput == null)
+ || aInputs.length > 15
+ || aInputs.length < 4) {
return false;
}
if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) {
return false;
- }
+ }
ItemStack[] tInputs = new ItemStack[aInputs.length];
ItemStack[][] tAlts = new ItemStack[aInputs.length][];
- for(int i = 0; i < aInputs.length; i++){
- Object obj = aInputs[i];
- if (obj instanceof ItemStack) {
- tInputs[i] = (ItemStack) obj;
- tAlts[i] = null;
- continue;
- } else if (obj instanceof ItemStack[]) {
- ItemStack[] aStacks = (ItemStack[]) obj;
- if (aStacks.length > 0) {
- tInputs[i] = aStacks[0];
- tAlts[i] = (ItemStack[]) Arrays.copyOf(aStacks, aStacks.length);
- continue;
- }
- } else if (obj instanceof Object[]) {
- Object[] objs = (Object[]) obj;
- List<ItemStack> tList;
- if (objs.length >= 2 && !(tList = GT_OreDictUnificator.getOres(objs[0])).isEmpty()) {
- try {
- int tAmount = ((Number) objs[1]).intValue();
- List<ItemStack> uList = new ArrayList<>();
- for (ItemStack tStack : tList) {
- ItemStack uStack = GT_Utility.copyAmount(tAmount, tStack);
- if (GT_Utility.isStackValid(uStack)) {
- uList.add(uStack);
- if (tInputs[i] == null)
- tInputs[i] = uStack;
- }
- }
- tAlts[i] = uList.toArray(new ItemStack[uList.size()]);
- continue;
- } catch (Exception t) {}
- }
- }
- GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe");
- }
- GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, -201);
- GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false,tInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])},aFluidInputs,null,aDuration,aEUt,0,tAlts,true);
- GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, tInputs, aFluidInputs, aOutput, aDuration, aEUt, tAlts));
+ for (int i = 0; i < aInputs.length; i++) {
+ Object obj = aInputs[i];
+ if (obj instanceof ItemStack) {
+ tInputs[i] = (ItemStack) obj;
+ tAlts[i] = null;
+ continue;
+ } else if (obj instanceof ItemStack[]) {
+ ItemStack[] aStacks = (ItemStack[]) obj;
+ if (aStacks.length > 0) {
+ tInputs[i] = aStacks[0];
+ tAlts[i] = (ItemStack[]) Arrays.copyOf(aStacks, aStacks.length);
+ continue;
+ }
+ } else if (obj instanceof Object[]) {
+ Object[] objs = (Object[]) obj;
+ List<ItemStack> tList;
+ if (objs.length >= 2 && !(tList = GT_OreDictUnificator.getOres(objs[0])).isEmpty()) {
+ try {
+ int tAmount = ((Number) objs[1]).intValue();
+ List<ItemStack> uList = new ArrayList<>();
+ for (ItemStack tStack : tList) {
+ ItemStack uStack = GT_Utility.copyAmount(tAmount, tStack);
+ if (GT_Utility.isStackValid(uStack)) {
+ uList.add(uStack);
+ if (tInputs[i] == null) tInputs[i] = uStack;
+ }
+ }
+ tAlts[i] = uList.toArray(new ItemStack[uList.size()]);
+ continue;
+ } catch (Exception t) {
+ }
+ }
+ }
+ GT_FML_LOGGER.info("addAssemblingLineRecipe " + aResearchItem.getDisplayName() + " --> "
+ + aOutput.getUnlocalizedName() + " there is some null item in that recipe");
+ }
+ GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
+ false,
+ new ItemStack[] {aResearchItem},
+ new ItemStack[] {aOutput},
+ new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])},
+ null,
+ null,
+ aResearchTime,
+ 30,
+ -201);
+ GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(
+ false,
+ tInputs,
+ new ItemStack[] {aOutput},
+ new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])},
+ aFluidInputs,
+ null,
+ aDuration,
+ aEUt,
+ 0,
+ tAlts,
+ true);
+ GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine(
+ aResearchItem, aResearchTime, tInputs, aFluidInputs, aOutput, aDuration, aEUt, tAlts));
return true;
- }
-
- private boolean tryAddTecTechScannerRecipe(ItemStack aResearchItem, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int assDuration, int assEUt) {
- if (!LoadedMods.TecTech) {
- return true;
- }
- else {
-
- int compSec = (GT_Utility.getTier(assEUt)+1) * 16;
- int compMax = (GT_Utility.getTier(assEUt)+1) * 10000;
-
- if (mScannerTT != null) {
- try {
- boolean aResult = (boolean) mScannerTT.invoke(null, aResearchItem, compMax, compSec,
- (assEUt/2), 16, aInputs, aFluidInputs, aOutput, assDuration, assEUt);
- Logger.INFO("Added TecTech Scanner Recipe for "+ItemUtils.getItemName(aResearchItem)+"? "+aResult);
- return aResult;
-
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.INFO("Failed to generate TecTech recipe for "+ItemUtils.getItemName(aResearchItem)+", please report this to Alkalus. [Severe]");
- e.printStackTrace();
- }
- }
- }
- return false;
- }
-
-
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, int time, int eu){
- return addChemicalRecipe(input1, input2, inputFluid, outputFluid, output, null, time, eu);
- }
-
- @Override
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, Object object, int time, int eu) {
- try {
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- return (boolean) mChemicalRecipe[0].invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time);
- }
- else {
- return (boolean) mChemicalRecipe[1].invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time, eu);
- }
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- @Override
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, ItemStack output2, int time) {
- try {
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- return (boolean) mChemicalRecipe[0].invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time);
- }
- else {
- return (boolean) mChemicalRecipe[2].invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, output2, time);
- }
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- @Override
- public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, int aCircuit, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, ItemStack output2, int time, int eu) {
- if (aCircuit < 0 || aCircuit > 24) {
- aCircuit = 22;
- }
- GT_Recipe aSpecialRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {input1, input2},
- new ItemStack[] {output, output2},
- CI.getNumberedCircuit(aCircuit),
- new int[] {},
- new FluidStack[] {inputFluid},
- new FluidStack[] {outputFluid},
- time,
- eu,
- 0);
- return GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList.add(aSpecialRecipe);
- }
-
- @Override
- public boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks, FluidStack[] fluidStacks2, ItemStack[] outputs, int time, int eu) {
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mLargeChemReactor == null) {
- return false;
- }
- try {
- return (boolean) mLargeChemReactor.invoke(GT_Values.RA, itemStacks, fluidStacks, fluidStacks2, outputs, time, eu);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
-
-
-
-
-
-
-
-
- private boolean areItemsAndFluidsBothNull(final ItemStack[] items, final FluidStack[] fluids) {
- boolean itemsNull = true;
- if (items != null) {
- for (final ItemStack itemStack : items) {
- if (itemStack != null) {
- itemsNull = false;
- break;
- }
- }
- }
- boolean fluidsNull = true;
- if (fluids != null) {
- for (final FluidStack fluidStack : fluids) {
- if (fluidStack != null) {
- fluidsNull = false;
- break;
- }
- }
- }
- return itemsNull && fluidsNull;
- }
-
- @Override
- public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("compressor", aInput1, aDuration)) <= 0)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sCompressorRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- @Override
- public boolean addBrewingRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden) {
- return addBrewingRecipe(CI.getNumberedCircuit(aCircuit), aInput, aOutput, aTime, aEu, aHidden);
- }
-
- @Override
- public boolean addBrewingRecipe(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden) {
- if ((aIngredient == null) || (aInput == null) || (aOutput == null)) {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) {
- return false;
- }
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe(false, new ItemStack[]{aIngredient}, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aTime, aEu, 0);
- if ((aHidden) && (tRecipe != null)) {
- tRecipe.mHidden = true;
- }
- return true;
- }
-
-
- /**
- * Lets me add recipes for GT 5.08 & 5.09, since someone broke the method headers.
- */
- @Override
- public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput) {
- Method m = StaticFields59.mAddFurnaceRecipe;
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- try {
- return (boolean) m.invoke(null, aDust, aOutput);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
- else {
- try {
- return (boolean) m.invoke(null, aDust, aOutput, true);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
- }
-
- @Override
- public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu) {
-
- boolean aRecipe = RA.addFluidSmelterRecipe(
- GT_Utility.copyAmount(1, input),
- null,
- output,
- 10000,
- aTime,
- aEu,
- false);
- if (aRecipe) {
- Logger.INFO("Added Fluid Extractor Recipe: "
- + input.getDisplayName() + " and obtain "
- + output.amount+"mb of "+output.getLocalizedName()
- +". Time: "+aTime+", Voltage: "
- +aEu);
- }
- return aRecipe;
-
- //return MaterialGenerator.addFluidExtractionRecipe(GT_Values.NI, input, output, aTime, aEu);
- }
-
- @Override
- public boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration, int aEU) {
- boolean aRecipe = RA.addFluidSmelterRecipe(
- GT_Utility.copyAmount(1, aEmpty),
- aRemains,
- aFluid,
- 10000,
- aDuration,
- aEU,
- false);
- return aRecipe;
- //return MaterialGenerator.addFluidExtractionRecipe(aEmpty, aRemains, aFluid, aDuration, aEU);
- }
-
- @Override
- public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn) {
- return MaterialGenerator.addFluidCannerRecipe(aContainer, aFullContainer, rFluidIn, null);
- }
-
- @Override
- public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut) {
- return MaterialGenerator.addFluidCannerRecipe(aContainer, aFullContainer, rFluidIn, rFluidOut);
- }
-
-
- @Override
- public boolean addFluidCannerRecipe(ItemStack aFullContainer, ItemStack container, FluidStack rFluidIn, FluidStack rFluidOut, int aTime, int aEu) {
- return MaterialGenerator.addFluidCannerRecipe(container, aFullContainer, rFluidIn, rFluidOut, aTime, aEu);
- }
-
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInputStackA = first Input (not null, and respects StackSize)
- * @param aInputStackB = second Input (not null, and respects StackSize)
- * @param plasma = Output of the Fusion (can be null, and respects StackSize)
- * @param aOutputChance = chance to output plasma (can be 0)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aEu = The EU generated per Tick (can even be negative!)
- * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- @Override
- public boolean addFusionReactorRecipe(FluidStack aInputStackA, FluidStack aInputStackB, FluidStack plasma,
- int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial) {
- if (aInputStackA == null || aInputStackB == null || plasma == null || aFusionDurationInTicks < 1 || aEu < 1 || aSpecial < 1) {
- return false;
- }
- GTPP_Recipe aFusionCustom = new GTPP_Recipe(
- true,
- null,
- null,
- null,
- new int[] {aOutputChance},
- new FluidStack[]{aInputStackA, aInputStackB},
- new FluidStack[]{plasma},
- aFusionDurationInTicks,
- aEu,
- aSpecial);
- GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(aFusionCustom);
- return true;
- }
-
-
-
-
-
-
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInputStackA = first Input (not null, and respects StackSize)
- * @param aInputStackB = second Input (not null, and respects StackSize)
- * @param plasma = Output of the Fusion (can be null, and respects StackSize)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aEu = The EU generated per Tick (can even be negative!)
- * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- @Override
- public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma,
- int aFusionDurationInTicks, int aEu, int aSpecial) {
- return addFusionReactorRecipe(aInputStackA, aInputStackB, plasma, 10000, aFusionDurationInTicks, aEu, aSpecial);
- }
-
-
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInputStackA = first Input (not null, and respects StackSize)
- * @param aInputStackB = second Input (not null, and respects StackSize)
- * @param plasma = Output of the Fusion (can be null, and respects StackSize)
- * @param aOutputChance = chance to output plasma (can be 0)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aEu = The EU generated per Tick (can even be negative!)
- * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
- */
- @Override
- public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma,
- int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial) {
- if (aInputStackA == null || aInputStackB == null || plasma == null || aFusionDurationInTicks < 1 || aEu < 1 || aSpecial < 1) {
- return false;
- }
- GTPP_Recipe aFusionCustom = new GTPP_Recipe(
- true,
- new ItemStack[]{aInputStackA, aInputStackB},
- null,
- null,
- new int[] {aOutputChance},
- null,
- new FluidStack[]{plasma},
- aFusionDurationInTicks,
- aEu,
- aSpecial);
- GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(aFusionCustom);
- return true;
-
- }
-
- @Override
- public boolean addSemifluidFuel(ItemStack aFuelItem, int aFuelValue) {
- return SemiFluidFuelHandler.addSemiFluidFuel(aFuelItem, aFuelValue);
- }
-
- @Override
- public boolean addSemifluidFuel(FluidStack aFuelItem, int aFuelValue) {
- return SemiFluidFuelHandler.addSemiFluidFuel(aFuelItem, aFuelValue);
- }
-
-
-
-
- @Override
- public boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput,
- ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) {
- if (aInput1 != null && aOutput1 != null) {
- return addVacuumFurnaceRecipe(new ItemStack[] {aInput1, aInput2}, new FluidStack[] {aFluidInput}, new ItemStack[] {aOutput1, aOutput2}, new FluidStack[] {aFluidOutput}, aDuration, aEUt, aLevel);
- }
- else {
- return false;
- }
- }
-
-
- @Override
- public boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aLevel) {
- if (aInputs != null && aOutputs != null) {
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size();
- int aSize2 = aSize;
- GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.addRecipe(
- false,
- aInputs,
- aOutputs,
- null,
- new int[] {},
- aFluidInputs,
- aFluidOutputs,
- aDuration,
- aEUt,
- aLevel);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size();
- return aSize > aSize2;
- } else {
- return false;
- }
- }
-
- @Override
- public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu) {
- // Generate Special Laser Recipe
- GT_Recipe u = new GTPP_Recipe(
- false,
- new ItemStack[] {
- aInput1,
- GregtechItemList.Laser_Lens_WoodsGlass.get(0),
- },
- new ItemStack[] {
- aOutput
- },
- null,
- new int[] {
- 10000
- },
- new FluidStack[] {},
- new FluidStack[] {},
- time,
- (int) eu,
- 0);
- return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.mRecipeList.add(u);
- }
-
- @Override
- public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu) {
- return addUvLaserRecipe(aInput1, aOutput, time, eu);
- }
-
-
- @Override
- public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier) {
- return addChemicalPlantRecipe(aInputs, aInputFluids, aOutputs, aFluidOutputs, new int[] {}, time, eu, aTier);
- }
-
- @Override
- public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int[] aChances, int time, long eu, int aTier) {
-
- if (aInputs.length > 4 || aInputFluids.length > 4 || aOutputs.length > 4 || aFluidOutputs.length > 2) {
- Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(aInputs));
- Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(aInputFluids));
- Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(aOutputs));
- Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs));
- CORE.crash();
- }
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size();
- int aSize2 = aSize;
- GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.addRecipe(
- false,
- aInputs,
- aOutputs,
- null,
- aChances,
- aInputFluids,
- aFluidOutputs,
- time,
- (int) eu,
- aTier);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size();
- return aSize > aSize2;
- }
-
- @Override
- public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat) {
- GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
- false,
- aInputs,
- aOutputs,
- null,
- new int[] {},
- aInputFluids,
- aFluidOutputs,
- time,
- (int) eu,
- aHeat);
-
- int aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
- int aSize2 = aSize;
- GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(aSpecialRecipe);
- aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
- return aSize > aSize2;
-
- }
-
- @Override
- public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt) {
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mPyroOven == null) {
- return false;
- }
- try {
- return (boolean) mPyroOven.invoke(GT_Values.RA, aInput, aFluidInput, intCircuit, aOutput, aFluidOutput, aDuration, aEUt);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
-
- @Override
- public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) {
- if (aInput != null && aOutput != null) {
- if ((aDuration = GregTech_API.sRecipeFile.get("distillery", aOutput.getFluid().getUnlocalizedName(),
- aDuration)) <= 0) {
- return false;
- } else {
- GT_Recipe tRecipe = GT_Recipe_Map.sDistilleryRecipes.addRecipe(true, new ItemStack[]{aCircuit},
- new ItemStack[] {aSolidOutput}, (Object) null, new FluidStack[]{aInput}, new FluidStack[]{aOutput},
- aDuration, aEUt, 0);
- if (aHidden && tRecipe != null) {
- tRecipe.mHidden = true;
- }
- return true;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
- return addExtractorRecipe(aInput, aOutput, 10000, aDuration, aEUt);
- }
-
- @Override
- public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aChance, int aDuration, int aEUt) {
- if (aInput != null && aOutput != null) {
- GT_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {
- aInput.copy()
- },
- new ItemStack[] {
- aOutput.copy()
- },
- null,
- new int[] {aChance},
- null,
- null,
- aDuration,
- aEUt,
- 0);
- int aSize = GT_Recipe_Map.sExtractorRecipes.mRecipeList.size();
- GT_Recipe_Map.sExtractorRecipes.add(aRecipe);
- return GT_Recipe_Map.sExtractorRecipes.mRecipeList.size() > aSize;
- }
- else {
- return false;
- }
- }
-
- @Override
- public boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3) {
- //return GT_Values.RA.addPulveriserRecipe(arg0, arg1, arg2, arg3, arg4)
-
- aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
- aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
- aOutput3 = GT_OreDictUnificator.get(true, aOutput3);
- if ((GT_Utility.isStackInvalid(aInput)) || (GT_Utility.isStackInvalid(aOutput1))) {
- return false;
- }
- if (GT_Utility.getContainerItem(aInput, false) == null) {
-
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, true)) {
- GT_Utility.addSimpleIC2MachineRecipe(aInput, GT_ModHandler.getMaceratorRecipeList(), null,
- new Object[] { aOutput1 });
- }
- GT_Values.RA.addPulveriserRecipe(aInput, new ItemStack[] { aOutput1, aOutput2, aOutput3 },
- new int[] { 10000, 10000, 10000 }, 400, 2);
- }
- return true;
-
- }
-
- @Override
- public boolean addMillingRecipe(Materials aMat, int aEU) {
- return addMillingRecipe(MaterialUtils.generateMaterialFromGtENUM(aMat), aEU);
- }
-
- @Override
- public boolean addMillingRecipe(Material aMat, int aEU) {
-
- ItemStack aOreStack = aMat.getOre(16);
- ItemStack aCrushedStack = aMat.getCrushed(16);
-
- ItemStack aMilledStackOres1 = aMat.getMilled(64);
- ItemStack aMilledStackCrushed1 = aMat.getMilled(32);
- ItemStack aMilledStackOres2 = aMat.getMilled(48);
- ItemStack aMilledStackCrushed2 = aMat.getMilled(16);
-
- ItemStack aMillingBall_Alumina = GregtechItemList.Milling_Ball_Alumina.get(0);
- ItemStack aMillingBall_Soapstone = GregtechItemList.Milling_Ball_Soapstone.get(0);
-
- // Inputs
- ItemStack[] aInputsOre1 = new ItemStack[] {
- CI.getNumberedCircuit(10),
- aOreStack,
- aMillingBall_Alumina
- };
-
- ItemStack[] aInputsOre2 = new ItemStack[] {
- CI.getNumberedCircuit(11),
- aOreStack,
- aMillingBall_Soapstone
- };
-
- ItemStack[] aInputsCrushed1 = new ItemStack[] {
- CI.getNumberedCircuit(10),
- aCrushedStack,
- aMillingBall_Alumina
- };
-
- ItemStack[] aInputsCrushed2 = new ItemStack[] {
- CI.getNumberedCircuit(11),
- aCrushedStack,
- aMillingBall_Soapstone
- };
-
- // Outputs
- ItemStack[] aOutputsOre1 = new ItemStack[] {
- aMilledStackOres1
- };
-
- ItemStack[] aOutputsOre2 = new ItemStack[] {
- aMilledStackOres2
- };
-
- ItemStack[] aOutputsCrushed1 = new ItemStack[] {
- aMilledStackCrushed1
- };
-
- ItemStack[] aOutputsCrushed2 = new ItemStack[] {
- aMilledStackCrushed2
- };
-
- ItemStack[][] aInputArray = new ItemStack[][] {aInputsOre1, aInputsOre2, aInputsCrushed1, aInputsCrushed2};
- ItemStack[][] aOutputArray = new ItemStack[][] {aOutputsOre1, aOutputsOre2, aOutputsCrushed1, aOutputsCrushed2};
- int[] aTime = new int[] {2400, 3000, 1200, 1500};
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mRecipeList.size();
- int aSize2 = aSize;
-
- for (int i=0;i<4;i++) {
- GTPP_Recipe aOreRecipe = new GTPP_Recipe(
- false,
- aInputArray[i],
- aOutputArray[i],
- null,
- new int[] {},
- null,
- null,
- aTime[i],
- aEU,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.add(aOreRecipe);
- }
-
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mRecipeList.size();
- return aSize > aSize2;
- }
-
- @Override
- public boolean addFlotationRecipe(Materials aMat, ItemStack aXanthate, FluidStack[] aInputFluids, FluidStack[] aOutputFluids, int aTime, int aEU) {
- return addFlotationRecipe(MaterialUtils.generateMaterialFromGtENUM(aMat), aXanthate, aInputFluids, aOutputFluids, aTime, aEU);
- }
-
- @Override
- public boolean addFlotationRecipe(Material aMat, ItemStack aXanthate, FluidStack[] aInputFluids, FluidStack[] aOutputFluids, int aTime, int aEU) {
-
- FlotationRecipeHandler.registerOreType(aMat);
-
- int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.mRecipeList.size();
- int aSize2 = aSize;
-
- GT_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {
- ItemUtils.getSimpleStack(aXanthate, 32),
- aMat.getMilled(64),
- aMat.getMilled(64),
- aMat.getMilled(64),
- aMat.getMilled(64),
- },
- new ItemStack[] {
-
- },
- null,
- new int[] {},
- aInputFluids,
- aOutputFluids,
- aTime,
- aEU,
- 0);
-
- GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.add(aRecipe);
- aSize = GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.mRecipeList.size();
-
- return aSize > aSize2;
- }
-
- @Override
- public boolean addpackagerRecipe(ItemStack aRecipeType, ItemStack aSmallDust, ItemStack aTinyDust, ItemStack aOutputStack1) {
- AutoMap<Boolean> aResults = new AutoMap<Boolean>();
- //Dust 1
- aResults.put(GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(4L, new Object[]{aSmallDust}), aRecipeType, aOutputStack1, 100, 4));
- //Dust 2
- aResults.put(GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(9L, new Object[]{aTinyDust}), aRecipeType, aOutputStack1, 100, 4));
- for (boolean b : aResults) {
- if (!b) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage) {
- int aSize1 = GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.mRecipeList.size();
- GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.addRecipe(
- true,
- new ItemStack[]{aFuelPellet},
- new ItemStack[]{},
- null,
- null,
- null,
- 0,
- aVoltage,
- aFuelDays);
- int aSize2 = GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.mRecipeList.size();
-
- if (aSize2 > aSize1) {
- long eu = GregtechMetaTileEntity_RTG.getTotalEUGenerated(GregtechMetaTileEntity_RTG.convertDaysToTicks(aFuelDays), aVoltage);
- GT_MetaTileEntity_Hatch_Energy_RTG.registerPelletForHatch(aFuelPellet, eu);
- return true;
- }
- else {
- return false;
- }
- }
-
-
- @Override
- public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU) {
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {CI.getNumberedAdvancedCircuit(aCircuit), aInput},
- aOutputs,
- null,
- aChances,
- new FluidStack[] {aFluidInput},
- new FluidStack[] {aFluidOutput},
- aTime,
- aEU,
- 0);
-
- int aSize = GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size();
- GTPP_Recipe_Map.sColdTrapRecipes.add(aRecipe);
- return GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size() > aSize;
- }
-
-
- @Override
- public boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU) {
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {aInput1, aInput2},
- aOutputs,
- null,
- aChances,
- new FluidStack[] {aFluidInput},
- new FluidStack[] {aFluidOutput},
- aTime,
- aEU,
- 0);
-
- int aSize = GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size();
- GTPP_Recipe_Map.sReactorProcessingUnitRecipes.add(aRecipe);
- return GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size() > aSize;
- }
-
-
- @Override
- public boolean addFluidHeaterRecipe(ItemStack aInput, FluidStack aFluidInput, FluidStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null && aFluidInput == null) || (aOutput == null)) {
+ }
+
+ private boolean tryAddTecTechScannerRecipe(
+ ItemStack aResearchItem,
+ Object[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack aOutput,
+ int assDuration,
+ int assEUt) {
+ if (!LoadedMods.TecTech) {
+ return true;
+ } else {
+
+ int compSec = (GT_Utility.getTier(assEUt) + 1) * 16;
+ int compMax = (GT_Utility.getTier(assEUt) + 1) * 10000;
+
+ if (mScannerTT != null) {
+ try {
+ boolean aResult = (boolean) mScannerTT.invoke(
+ null,
+ aResearchItem,
+ compMax,
+ compSec,
+ (assEUt / 2),
+ 16,
+ aInputs,
+ aFluidInputs,
+ aOutput,
+ assDuration,
+ assEUt);
+ Logger.INFO("Added TecTech Scanner Recipe for " + ItemUtils.getItemName(aResearchItem) + "? "
+ + aResult);
+ return aResult;
+
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ Logger.INFO("Failed to generate TecTech recipe for " + ItemUtils.getItemName(aResearchItem)
+ + ", please report this to Alkalus. [Severe]");
+ e.printStackTrace();
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean addChemicalRecipe(
+ ItemStack input1,
+ ItemStack input2,
+ FluidStack inputFluid,
+ FluidStack outputFluid,
+ ItemStack output,
+ int time,
+ int eu) {
+ return addChemicalRecipe(input1, input2, inputFluid, outputFluid, output, null, time, eu);
+ }
+
+ @Override
+ public boolean addChemicalRecipe(
+ ItemStack input1,
+ ItemStack input2,
+ FluidStack inputFluid,
+ FluidStack outputFluid,
+ ItemStack output,
+ Object object,
+ int time,
+ int eu) {
+ try {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return (boolean)
+ mChemicalRecipe[0].invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time);
+ } else {
+ return (boolean) mChemicalRecipe[1].invoke(
+ GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time, eu);
+ }
+ } catch (Throwable t) {
return false;
}
- GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes.addRecipe(true, new ItemStack[]{aInput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
+ }
+
+ @Override
+ public boolean addChemicalRecipe(
+ ItemStack input1,
+ ItemStack input2,
+ FluidStack inputFluid,
+ FluidStack outputFluid,
+ ItemStack output,
+ ItemStack output2,
+ int time) {
+ try {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return (boolean)
+ mChemicalRecipe[0].invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time);
+ } else {
+ return (boolean) mChemicalRecipe[2].invoke(
+ GT_Values.RA, input1, input2, inputFluid, outputFluid, output, output2, time);
+ }
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addChemicalRecipe(
+ ItemStack input1,
+ ItemStack input2,
+ int aCircuit,
+ FluidStack inputFluid,
+ FluidStack outputFluid,
+ ItemStack output,
+ ItemStack output2,
+ int time,
+ int eu) {
+ if (aCircuit < 0 || aCircuit > 24) {
+ aCircuit = 22;
+ }
+ GT_Recipe aSpecialRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {input1, input2},
+ new ItemStack[] {output, output2},
+ CI.getNumberedCircuit(aCircuit),
+ new int[] {},
+ new FluidStack[] {inputFluid},
+ new FluidStack[] {outputFluid},
+ time,
+ eu,
+ 0);
+ return GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList.add(aSpecialRecipe);
+ }
+
+ @Override
+ public boolean addMultiblockChemicalRecipe(
+ ItemStack[] itemStacks,
+ FluidStack[] fluidStacks,
+ FluidStack[] fluidStacks2,
+ ItemStack[] outputs,
+ int time,
+ int eu) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mLargeChemReactor == null) {
+ return false;
+ }
+ try {
+ return (boolean)
+ mLargeChemReactor.invoke(GT_Values.RA, itemStacks, fluidStacks, fluidStacks2, outputs, time, eu);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ }
+
+ private boolean areItemsAndFluidsBothNull(final ItemStack[] items, final FluidStack[] fluids) {
+ boolean itemsNull = true;
+ if (items != null) {
+ for (final ItemStack itemStack : items) {
+ if (itemStack != null) {
+ itemsNull = false;
+ break;
+ }
+ }
+ }
+ boolean fluidsNull = true;
+ if (fluids != null) {
+ for (final FluidStack fluidStack : fluids) {
+ if (fluidStack != null) {
+ fluidsNull = false;
+ break;
+ }
+ }
+ }
+ return itemsNull && fluidsNull;
+ }
+
+ @Override
+ public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) {
+ if ((aInput1 == null) || (aOutput1 == null)) {
+ return false;
+ }
+ if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("compressor", aInput1, aDuration)) <= 0)) {
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map.sCompressorRecipes.addRecipe(
+ true, new ItemStack[] {aInput1}, new ItemStack[] {aOutput1}, null, null, null, aDuration, aEUt, 0);
+ return true;
+ }
+
+ @Override
+ public boolean addBrewingRecipe(
+ int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden) {
+ return addBrewingRecipe(CI.getNumberedCircuit(aCircuit), aInput, aOutput, aTime, aEu, aHidden);
+ }
+
+ @Override
+ public boolean addBrewingRecipe(
+ ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden) {
+ if ((aIngredient == null) || (aInput == null) || (aOutput == null)) {
+ return false;
+ }
+ if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) {
+ return false;
+ }
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe(
+ false,
+ new ItemStack[] {aIngredient},
+ null,
+ null,
+ new FluidStack[] {aInput},
+ new FluidStack[] {aOutput},
+ aTime,
+ aEu,
+ 0);
+ if ((aHidden) && (tRecipe != null)) {
+ tRecipe.mHidden = true;
+ }
return true;
}
+ /**
+ * Lets me add recipes for GT 5.08 & 5.09, since someone broke the method headers.
+ */
+ @Override
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput) {
+ Method m = StaticFields59.mAddFurnaceRecipe;
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try {
+ return (boolean) m.invoke(null, aDust, aOutput);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ } else {
+ try {
+ return (boolean) m.invoke(null, aDust, aOutput, true);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ }
+ }
+
+ @Override
+ public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu) {
+
+ boolean aRecipe =
+ RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, input), null, output, 10000, aTime, aEu, false);
+ if (aRecipe) {
+ Logger.INFO("Added Fluid Extractor Recipe: "
+ + input.getDisplayName() + " and obtain "
+ + output.amount + "mb of " + output.getLocalizedName()
+ + ". Time: " + aTime + ", Voltage: "
+ + aEu);
+ }
+ return aRecipe;
+
+ // return MaterialGenerator.addFluidExtractionRecipe(GT_Values.NI, input, output, aTime, aEu);
+ }
+
+ @Override
+ public boolean addFluidExtractionRecipe(
+ ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration, int aEU) {
+ boolean aRecipe = RA.addFluidSmelterRecipe(
+ GT_Utility.copyAmount(1, aEmpty), aRemains, aFluid, 10000, aDuration, aEU, false);
+ return aRecipe;
+ // return MaterialGenerator.addFluidExtractionRecipe(aEmpty, aRemains, aFluid, aDuration, aEU);
+ }
+
+ @Override
+ public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn) {
+ return MaterialGenerator.addFluidCannerRecipe(aContainer, aFullContainer, rFluidIn, null);
+ }
+
+ @Override
+ public boolean addFluidCannerRecipe(
+ ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut) {
+ return MaterialGenerator.addFluidCannerRecipe(aContainer, aFullContainer, rFluidIn, rFluidOut);
+ }
+
+ @Override
+ public boolean addFluidCannerRecipe(
+ ItemStack aFullContainer,
+ ItemStack container,
+ FluidStack rFluidIn,
+ FluidStack rFluidOut,
+ int aTime,
+ int aEu) {
+ return MaterialGenerator.addFluidCannerRecipe(container, aFullContainer, rFluidIn, rFluidOut, aTime, aEu);
+ }
+
+ /**
+ * Adds a Fusion reactor Recipe
+ *
+ * @param aInputStackA = first Input (not null, and respects StackSize)
+ * @param aInputStackB = second Input (not null, and respects StackSize)
+ * @param plasma = Output of the Fusion (can be null, and respects StackSize)
+ * @param aOutputChance = chance to output plasma (can be 0)
+ * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
+ * @param aEu = The EU generated per Tick (can even be negative!)
+ * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
+ */
+ @Override
+ public boolean addFusionReactorRecipe(
+ FluidStack aInputStackA,
+ FluidStack aInputStackB,
+ FluidStack plasma,
+ int aOutputChance,
+ int aFusionDurationInTicks,
+ int aEu,
+ int aSpecial) {
+ if (aInputStackA == null
+ || aInputStackB == null
+ || plasma == null
+ || aFusionDurationInTicks < 1
+ || aEu < 1
+ || aSpecial < 1) {
+ return false;
+ }
+ GTPP_Recipe aFusionCustom = new GTPP_Recipe(
+ true,
+ null,
+ null,
+ null,
+ new int[] {aOutputChance},
+ new FluidStack[] {aInputStackA, aInputStackB},
+ new FluidStack[] {plasma},
+ aFusionDurationInTicks,
+ aEu,
+ aSpecial);
+ GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(aFusionCustom);
+ return true;
+ }
+
+ /**
+ * Adds a Fusion reactor Recipe
+ *
+ * @param aInputStackA = first Input (not null, and respects StackSize)
+ * @param aInputStackB = second Input (not null, and respects StackSize)
+ * @param plasma = Output of the Fusion (can be null, and respects StackSize)
+ * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
+ * @param aEu = The EU generated per Tick (can even be negative!)
+ * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
+ */
+ @Override
+ public boolean addFusionReactorRecipe(
+ ItemStack aInputStackA,
+ ItemStack aInputStackB,
+ FluidStack plasma,
+ int aFusionDurationInTicks,
+ int aEu,
+ int aSpecial) {
+ return addFusionReactorRecipe(aInputStackA, aInputStackB, plasma, 10000, aFusionDurationInTicks, aEu, aSpecial);
+ }
+
+ /**
+ * Adds a Fusion reactor Recipe
+ *
+ * @param aInputStackA = first Input (not null, and respects StackSize)
+ * @param aInputStackB = second Input (not null, and respects StackSize)
+ * @param plasma = Output of the Fusion (can be null, and respects StackSize)
+ * @param aOutputChance = chance to output plasma (can be 0)
+ * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
+ * @param aEu = The EU generated per Tick (can even be negative!)
+ * @param aSpecial = EU needed for heating the Reactor up (must be >= 0)
+ */
+ @Override
+ public boolean addFusionReactorRecipe(
+ ItemStack aInputStackA,
+ ItemStack aInputStackB,
+ FluidStack plasma,
+ int aOutputChance,
+ int aFusionDurationInTicks,
+ int aEu,
+ int aSpecial) {
+ if (aInputStackA == null
+ || aInputStackB == null
+ || plasma == null
+ || aFusionDurationInTicks < 1
+ || aEu < 1
+ || aSpecial < 1) {
+ return false;
+ }
+ GTPP_Recipe aFusionCustom = new GTPP_Recipe(
+ true,
+ new ItemStack[] {aInputStackA, aInputStackB},
+ null,
+ null,
+ new int[] {aOutputChance},
+ null,
+ new FluidStack[] {plasma},
+ aFusionDurationInTicks,
+ aEu,
+ aSpecial);
+ GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(aFusionCustom);
+ return true;
+ }
+
+ @Override
+ public boolean addSemifluidFuel(ItemStack aFuelItem, int aFuelValue) {
+ return SemiFluidFuelHandler.addSemiFluidFuel(aFuelItem, aFuelValue);
+ }
+
+ @Override
+ public boolean addSemifluidFuel(FluidStack aFuelItem, int aFuelValue) {
+ return SemiFluidFuelHandler.addSemiFluidFuel(aFuelItem, aFuelValue);
+ }
+
+ @Override
+ public boolean addVacuumFurnaceRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ int aDuration,
+ int aEUt,
+ int aLevel) {
+ if (aInput1 != null && aOutput1 != null) {
+ return addVacuumFurnaceRecipe(
+ new ItemStack[] {aInput1, aInput2},
+ new FluidStack[] {aFluidInput},
+ new ItemStack[] {aOutput1, aOutput2},
+ new FluidStack[] {aFluidOutput},
+ aDuration,
+ aEUt,
+ aLevel);
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addVacuumFurnaceRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack[] aOutputs,
+ FluidStack[] aFluidOutputs,
+ int aDuration,
+ int aEUt,
+ int aLevel) {
+ if (aInputs != null && aOutputs != null) {
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.addRecipe(
+ false, aInputs, aOutputs, null, new int[] {}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aLevel);
+ aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size();
+ return aSize > aSize2;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu) {
+ // Generate Special Laser Recipe
+ GT_Recipe u = new GTPP_Recipe(
+ false,
+ new ItemStack[] {
+ aInput1, GregtechItemList.Laser_Lens_WoodsGlass.get(0),
+ },
+ new ItemStack[] {aOutput},
+ null,
+ new int[] {10000},
+ new FluidStack[] {},
+ new FluidStack[] {},
+ time,
+ (int) eu,
+ 0);
+ return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.mRecipeList.add(u);
+ }
+
+ @Override
+ public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu) {
+ return addUvLaserRecipe(aInput1, aOutput, time, eu);
+ }
+
+ @Override
+ public boolean addChemicalPlantRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aInputFluids,
+ ItemStack[] aOutputs,
+ FluidStack[] aFluidOutputs,
+ int time,
+ long eu,
+ int aTier) {
+ return addChemicalPlantRecipe(aInputs, aInputFluids, aOutputs, aFluidOutputs, new int[] {}, time, eu, aTier);
+ }
+
+ @Override
+ public boolean addChemicalPlantRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aInputFluids,
+ ItemStack[] aOutputs,
+ FluidStack[] aFluidOutputs,
+ int[] aChances,
+ int time,
+ long eu,
+ int aTier) {
+
+ if (aInputs.length > 4 || aInputFluids.length > 4 || aOutputs.length > 4 || aFluidOutputs.length > 2) {
+ Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(aInputs));
+ Logger.INFO("Fluid Inputs: " + ItemUtils.getArrayStackNames(aInputFluids));
+ Logger.INFO("Outputs: " + ItemUtils.getArrayStackNames(aOutputs));
+ Logger.INFO("Fluid Outputs: " + ItemUtils.getArrayStackNames(aFluidOutputs));
+ CORE.crash();
+ }
+
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.addRecipe(
+ false, aInputs, aOutputs, null, aChances, aInputFluids, aFluidOutputs, time, (int) eu, aTier);
+ aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size();
+ return aSize > aSize2;
+ }
+
+ @Override
+ public boolean addBlastRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aInputFluids,
+ ItemStack[] aOutputs,
+ FluidStack[] aFluidOutputs,
+ int time,
+ long eu,
+ int aHeat) {
+ GTPP_Recipe aSpecialRecipe = new GTPP_Recipe(
+ false, aInputs, aOutputs, null, new int[] {}, aInputFluids, aFluidOutputs, time, (int) eu, aHeat);
+
+ int aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(aSpecialRecipe);
+ aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
+ return aSize > aSize2;
+ }
+
+ @Override
+ public boolean addPyrolyseRecipe(
+ ItemStack aInput,
+ FluidStack aFluidInput,
+ int intCircuit,
+ ItemStack aOutput,
+ FluidStack aFluidOutput,
+ int aDuration,
+ int aEUt) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mPyroOven == null) {
+ return false;
+ }
+ try {
+ return (boolean) mPyroOven.invoke(
+ GT_Values.RA, aInput, aFluidInput, intCircuit, aOutput, aFluidOutput, aDuration, aEUt);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addDistilleryRecipe(
+ ItemStack aCircuit,
+ FluidStack aInput,
+ FluidStack aOutput,
+ ItemStack aSolidOutput,
+ int aDuration,
+ int aEUt,
+ boolean aHidden) {
+ if (aInput != null && aOutput != null) {
+ if ((aDuration = GregTech_API.sRecipeFile.get(
+ "distillery", aOutput.getFluid().getUnlocalizedName(), aDuration))
+ <= 0) {
+ return false;
+ } else {
+ GT_Recipe tRecipe = GT_Recipe_Map.sDistilleryRecipes.addRecipe(
+ true,
+ new ItemStack[] {aCircuit},
+ new ItemStack[] {aSolidOutput},
+ (Object) null,
+ new FluidStack[] {aInput},
+ new FluidStack[] {aOutput},
+ aDuration,
+ aEUt,
+ 0);
+ if (aHidden && tRecipe != null) {
+ tRecipe.mHidden = true;
+ }
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
+ return addExtractorRecipe(aInput, aOutput, 10000, aDuration, aEUt);
+ }
+
+ @Override
+ public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aChance, int aDuration, int aEUt) {
+ if (aInput != null && aOutput != null) {
+ GT_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {aInput.copy()},
+ new ItemStack[] {aOutput.copy()},
+ null,
+ new int[] {aChance},
+ null,
+ null,
+ aDuration,
+ aEUt,
+ 0);
+ int aSize = GT_Recipe_Map.sExtractorRecipes.mRecipeList.size();
+ GT_Recipe_Map.sExtractorRecipes.add(aRecipe);
+ return GT_Recipe_Map.sExtractorRecipes.mRecipeList.size() > aSize;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addPulverisationRecipe(
+ ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3) {
+ // return GT_Values.RA.addPulveriserRecipe(arg0, arg1, arg2, arg3, arg4)
+
+ aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
+ aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
+ aOutput3 = GT_OreDictUnificator.get(true, aOutput3);
+ if ((GT_Utility.isStackInvalid(aInput)) || (GT_Utility.isStackInvalid(aOutput1))) {
+ return false;
+ }
+ if (GT_Utility.getContainerItem(aInput, false) == null) {
+
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, true)) {
+ GT_Utility.addSimpleIC2MachineRecipe(
+ aInput, GT_ModHandler.getMaceratorRecipeList(), null, new Object[] {aOutput1});
+ }
+ GT_Values.RA.addPulveriserRecipe(
+ aInput, new ItemStack[] {aOutput1, aOutput2, aOutput3}, new int[] {10000, 10000, 10000}, 400, 2);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean addMillingRecipe(Materials aMat, int aEU) {
+ return addMillingRecipe(MaterialUtils.generateMaterialFromGtENUM(aMat), aEU);
+ }
+
+ @Override
+ public boolean addMillingRecipe(Material aMat, int aEU) {
+
+ ItemStack aOreStack = aMat.getOre(16);
+ ItemStack aCrushedStack = aMat.getCrushed(16);
+
+ ItemStack aMilledStackOres1 = aMat.getMilled(64);
+ ItemStack aMilledStackCrushed1 = aMat.getMilled(32);
+ ItemStack aMilledStackOres2 = aMat.getMilled(48);
+ ItemStack aMilledStackCrushed2 = aMat.getMilled(16);
+
+ ItemStack aMillingBall_Alumina = GregtechItemList.Milling_Ball_Alumina.get(0);
+ ItemStack aMillingBall_Soapstone = GregtechItemList.Milling_Ball_Soapstone.get(0);
+
+ // Inputs
+ ItemStack[] aInputsOre1 = new ItemStack[] {CI.getNumberedCircuit(10), aOreStack, aMillingBall_Alumina};
+
+ ItemStack[] aInputsOre2 = new ItemStack[] {CI.getNumberedCircuit(11), aOreStack, aMillingBall_Soapstone};
+
+ ItemStack[] aInputsCrushed1 = new ItemStack[] {CI.getNumberedCircuit(10), aCrushedStack, aMillingBall_Alumina};
+
+ ItemStack[] aInputsCrushed2 =
+ new ItemStack[] {CI.getNumberedCircuit(11), aCrushedStack, aMillingBall_Soapstone};
+
+ // Outputs
+ ItemStack[] aOutputsOre1 = new ItemStack[] {aMilledStackOres1};
+
+ ItemStack[] aOutputsOre2 = new ItemStack[] {aMilledStackOres2};
+
+ ItemStack[] aOutputsCrushed1 = new ItemStack[] {aMilledStackCrushed1};
+
+ ItemStack[] aOutputsCrushed2 = new ItemStack[] {aMilledStackCrushed2};
+
+ ItemStack[][] aInputArray = new ItemStack[][] {aInputsOre1, aInputsOre2, aInputsCrushed1, aInputsCrushed2};
+ ItemStack[][] aOutputArray = new ItemStack[][] {aOutputsOre1, aOutputsOre2, aOutputsCrushed1, aOutputsCrushed2};
+ int[] aTime = new int[] {2400, 3000, 1200, 1500};
+
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+
+ for (int i = 0; i < 4; i++) {
+ GTPP_Recipe aOreRecipe = new GTPP_Recipe(
+ false, aInputArray[i], aOutputArray[i], null, new int[] {}, null, null, aTime[i], aEU, 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.add(aOreRecipe);
+ }
+
+ aSize = GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mRecipeList.size();
+ return aSize > aSize2;
+ }
+
+ @Override
+ public boolean addFlotationRecipe(
+ Materials aMat,
+ ItemStack aXanthate,
+ FluidStack[] aInputFluids,
+ FluidStack[] aOutputFluids,
+ int aTime,
+ int aEU) {
+ return addFlotationRecipe(
+ MaterialUtils.generateMaterialFromGtENUM(aMat), aXanthate, aInputFluids, aOutputFluids, aTime, aEU);
+ }
+
+ @Override
+ public boolean addFlotationRecipe(
+ Material aMat,
+ ItemStack aXanthate,
+ FluidStack[] aInputFluids,
+ FluidStack[] aOutputFluids,
+ int aTime,
+ int aEU) {
+
+ FlotationRecipeHandler.registerOreType(aMat);
+
+ int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+
+ GT_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(aXanthate, 32),
+ aMat.getMilled(64),
+ aMat.getMilled(64),
+ aMat.getMilled(64),
+ aMat.getMilled(64),
+ },
+ new ItemStack[] {},
+ null,
+ new int[] {},
+ aInputFluids,
+ aOutputFluids,
+ aTime,
+ aEU,
+ 0);
+
+ GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.add(aRecipe);
+ aSize = GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.mRecipeList.size();
+
+ return aSize > aSize2;
+ }
+
+ @Override
+ public boolean addpackagerRecipe(
+ ItemStack aRecipeType, ItemStack aSmallDust, ItemStack aTinyDust, ItemStack aOutputStack1) {
+ AutoMap<Boolean> aResults = new AutoMap<Boolean>();
+ // Dust 1
+ aResults.put(GT_Values.RA.addBoxingRecipe(
+ GT_Utility.copyAmount(4L, new Object[] {aSmallDust}), aRecipeType, aOutputStack1, 100, 4));
+ // Dust 2
+ aResults.put(GT_Values.RA.addBoxingRecipe(
+ GT_Utility.copyAmount(9L, new Object[] {aTinyDust}), aRecipeType, aOutputStack1, 100, 4));
+ for (boolean b : aResults) {
+ if (!b) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage) {
+ int aSize1 = GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.mRecipeList.size();
+ GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.addRecipe(
+ true, new ItemStack[] {aFuelPellet}, new ItemStack[] {}, null, null, null, 0, aVoltage, aFuelDays);
+ int aSize2 = GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.mRecipeList.size();
+
+ if (aSize2 > aSize1) {
+ long eu = GregtechMetaTileEntity_RTG.getTotalEUGenerated(
+ GregtechMetaTileEntity_RTG.convertDaysToTicks(aFuelDays), aVoltage);
+ GT_MetaTileEntity_Hatch_Energy_RTG.registerPelletForHatch(aFuelPellet, eu);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addColdTrapRecipe(
+ int aCircuit,
+ ItemStack aInput,
+ FluidStack aFluidInput,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ FluidStack aFluidOutput,
+ int aTime,
+ int aEU) {
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {CI.getNumberedAdvancedCircuit(aCircuit), aInput},
+ aOutputs,
+ null,
+ aChances,
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ aTime,
+ aEU,
+ 0);
+
+ int aSize = GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size();
+ GTPP_Recipe_Map.sColdTrapRecipes.add(aRecipe);
+ return GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size() > aSize;
+ }
+
+ @Override
+ public boolean addReactorProcessingUnitRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ ItemStack[] aOutputs,
+ int[] aChances,
+ FluidStack aFluidOutput,
+ int aTime,
+ int aEU) {
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {aInput1, aInput2},
+ aOutputs,
+ null,
+ aChances,
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aFluidOutput},
+ aTime,
+ aEU,
+ 0);
+
+ int aSize = GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size();
+ GTPP_Recipe_Map.sReactorProcessingUnitRecipes.add(aRecipe);
+ return GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size() > aSize;
+ }
+
+ @Override
+ public boolean addFluidHeaterRecipe(
+ ItemStack aInput, FluidStack aFluidInput, FluidStack aOutput, int aDuration, int aEUt) {
+ if ((aInput == null && aFluidInput == null) || (aOutput == null)) {
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes.addRecipe(
+ true,
+ new ItemStack[] {aInput},
+ null,
+ null,
+ new FluidStack[] {aFluidInput},
+ new FluidStack[] {aOutput},
+ aDuration,
+ aEUt,
+ 0);
+ return true;
+ }
@Override
public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
if ((aInput == null) || (aOutput == null)) {
return false;
- }
+ }
GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {aInput},
- new ItemStack[] {aOutput},
- null,
- new int[] {10000},
- new FluidStack[] {},
- new FluidStack[] {},
- aDuration,
- aEUt,
- 0);
-
- int aSize = GT_Recipe_Map.sVacuumRecipes.mRecipeList.size();
- GT_Recipe_Map.sVacuumRecipes.add(aRecipe);
- return GT_Recipe_Map.sVacuumRecipes.mRecipeList.size() > aSize;
- }
-
-
- @Override
- public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] {aInput},
- new ItemStack[] {aOutput},
- null,
- new int[] {10000},
- new FluidStack[] {},
- new FluidStack[] {},
- aDuration,
- aEUt,
- 0);
-
- int aSize = GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size();
- GTPP_Recipe_Map.sMolecularTransformerRecipes.add(aRecipe);
- return GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size() > aSize;
- }
-
-
- @Override
- public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt, int aAmps) {
- return addMolecularTransformerRecipe(aInput, aOutput, aDuration, aEUt);
- }
+ false,
+ new ItemStack[] {aInput},
+ new ItemStack[] {aOutput},
+ null,
+ new int[] {10000},
+ new FluidStack[] {},
+ new FluidStack[] {},
+ aDuration,
+ aEUt,
+ 0);
+
+ int aSize = GT_Recipe_Map.sVacuumRecipes.mRecipeList.size();
+ GT_Recipe_Map.sVacuumRecipes.add(aRecipe);
+ return GT_Recipe_Map.sVacuumRecipes.mRecipeList.size() > aSize;
+ }
+
+ @Override
+ public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
+ if ((aInput == null) || (aOutput == null)) {
+ return false;
+ }
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {aInput},
+ new ItemStack[] {aOutput},
+ null,
+ new int[] {10000},
+ new FluidStack[] {},
+ new FluidStack[] {},
+ aDuration,
+ aEUt,
+ 0);
+
+ int aSize = GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size();
+ GTPP_Recipe_Map.sMolecularTransformerRecipes.add(aRecipe);
+ return GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size() > aSize;
+ }
+
+ @Override
+ public boolean addMolecularTransformerRecipe(
+ ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt, int aAmps) {
+ return addMolecularTransformerRecipe(aInput, aOutput, aDuration, aEUt);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java
index 99e3d5c4d9..271e29d654 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java
@@ -1,7 +1,7 @@
package gtPlusPlus.xmod.gregtech.recipes;
-import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GTPP_Recipe;
+import gregtech.api.util.GT_Recipe;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.ORES;
@@ -11,47 +11,40 @@ import net.minecraftforge.fluids.FluidStack;
public class RecipesToRemove {
- public static void go() {
-
- Logger.INFO("Processing Gregtech recipe maps, removing recipes to suit GT++.");
-
- //Remove Rare Earth Centrifuging
- //1 Rare Earth Dust - 25% chance for small piles of: neodymium, yttrium, lanthanum, cerium, cadmium, and caesium
- //Replaced by advanced sifting recipe.
- GT_Recipe aRareEarthCentrifuging = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe(null, false, 20, new FluidStack[] {}, new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1)});
- if (aRareEarthCentrifuging != null && aRareEarthCentrifuging.mEnabled) {
- aRareEarthCentrifuging.mEnabled = false;
- aRareEarthCentrifuging.mHidden = true;
- GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.remove(aRareEarthCentrifuging);
- //GTPP_Recipe.GT_Recipe_Map_LargeCentrifuge.sMultiblockCentrifugeRecipes.mRecipeList.remove(aRareEarthCentrifuging);
- GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mRecipeList.remove(aRareEarthCentrifuging);
- Logger.INFO("Removed vanilla GT Rare Earth processing.");
- //Set the Chemical Symbol for Rare Earth now that we are giving it custom outputs
- //Best not to set this unless the original recipe is removed.
- /*Materials.RareEarth.mChemicalFormula = "("
- +ELEMENT.getInstance().YTTRIUM.vChemicalSymbol
- +ELEMENT.getInstance().NEODYMIUM.vChemicalSymbol
- +ELEMENT.getInstance().LANTHANUM.vChemicalSymbol
- +ELEMENT.getInstance().CERIUM.vChemicalSymbol
- +ELEMENT.getInstance().CADMIUM.vChemicalSymbol
- +ELEMENT.getInstance().CAESIUM.vChemicalSymbol
- +ELEMENT.getInstance().YTTERBIUM.vChemicalSymbol
- +ELEMENT.getInstance().SAMARIUM.vChemicalSymbol
- +ELEMENT.getInstance().GADOLINIUM.vChemicalSymbol+
- ")";*/
-
- Material[] aLowTierOutputMaterials = new Material[] {
- ORES.GREENOCKITE
- };
-
-
-
-
-
-
-
- }
-
- }
-
+ public static void go() {
+
+ Logger.INFO("Processing Gregtech recipe maps, removing recipes to suit GT++.");
+
+ // Remove Rare Earth Centrifuging
+ // 1 Rare Earth Dust - 25% chance for small piles of: neodymium, yttrium, lanthanum, cerium, cadmium, and
+ // caesium
+ // Replaced by advanced sifting recipe.
+ GT_Recipe aRareEarthCentrifuging = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe(
+ null, false, 20, new FluidStack[] {}, new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1)
+ });
+ if (aRareEarthCentrifuging != null && aRareEarthCentrifuging.mEnabled) {
+ aRareEarthCentrifuging.mEnabled = false;
+ aRareEarthCentrifuging.mHidden = true;
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.remove(aRareEarthCentrifuging);
+ // GTPP_Recipe.GT_Recipe_Map_LargeCentrifuge.sMultiblockCentrifugeRecipes.mRecipeList.remove(aRareEarthCentrifuging);
+ GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mRecipeList.remove(aRareEarthCentrifuging);
+ Logger.INFO("Removed vanilla GT Rare Earth processing.");
+ // Set the Chemical Symbol for Rare Earth now that we are giving it custom outputs
+ // Best not to set this unless the original recipe is removed.
+ /*Materials.RareEarth.mChemicalFormula = "("
+ +ELEMENT.getInstance().YTTRIUM.vChemicalSymbol
+ +ELEMENT.getInstance().NEODYMIUM.vChemicalSymbol
+ +ELEMENT.getInstance().LANTHANUM.vChemicalSymbol
+ +ELEMENT.getInstance().CERIUM.vChemicalSymbol
+ +ELEMENT.getInstance().CADMIUM.vChemicalSymbol
+ +ELEMENT.getInstance().CAESIUM.vChemicalSymbol
+ +ELEMENT.getInstance().YTTERBIUM.vChemicalSymbol
+ +ELEMENT.getInstance().SAMARIUM.vChemicalSymbol
+ +ELEMENT.getInstance().GADOLINIUM.vChemicalSymbol+
+ ")";*/
+
+ Material[] aLowTierOutputMaterials = new Material[] {ORES.GREENOCKITE};
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java
index 15115647ae..43c48232d8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java
@@ -1,20 +1,19 @@
package gtPlusPlus.xmod.gregtech.recipes.machines;
import net.minecraft.item.ItemStack;
-
import net.minecraftforge.fluids.FluidStack;
public class RECIPEHANDLER_AssemblyLine {
- public static boolean addAssemblylineRecipe(
- ItemStack paramItemStack1,
- int paramInt1,
- ItemStack[] paramArrayOfItemStack,
- FluidStack[] paramArrayOfFluidStack,
- ItemStack paramItemStack2,
- int paramInt2, int paramInt3){
-
- return false;
- }
+ public static boolean addAssemblylineRecipe(
+ ItemStack paramItemStack1,
+ int paramInt1,
+ ItemStack[] paramArrayOfItemStack,
+ FluidStack[] paramArrayOfFluidStack,
+ ItemStack paramItemStack2,
+ int paramInt2,
+ int paramInt3) {
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java
index cd06f86ef9..627241cd53 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java
@@ -1,47 +1,90 @@
package gtPlusPlus.xmod.gregtech.recipes.machines;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.api.objects.Logger;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RECIPEHANDLER_CokeOven {
- public static void debug1(){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Walking Through CokeOven Recipe Creation.");
- Logger.WARNING("My name is Ralph and I will be your humble host.");
- }
- public static void debug2(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Taking a step forward.");
- Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
- Logger.WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Passed.");
- }
- public static void debug3(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Taking a step forward.");
- Logger.WARNING("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
- Logger.WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Passed.");
- }
- public static void debug4(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Taking a step forward.");
- Logger.WARNING("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
- Logger.WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Passed.");
- Logger.WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ public static void debug1() {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Walking Through CokeOven Recipe Creation.");
+ Logger.WARNING("My name is Ralph and I will be your humble host.");
+ }
+
+ public static void debug2(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack aOutput,
+ final int aDuration,
+ final int aEUt) {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Taking a step forward.");
+ Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
+ Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
+ + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Logger.WARNING("Passed.");
+ }
+
+ public static void debug3(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack aOutput,
+ final int aDuration,
+ final int aEUt) {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Taking a step forward.");
+ Logger.WARNING(
+ "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
+ Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
+ + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Logger.WARNING("Passed.");
+ }
- }
- public static void debug5(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt){
- Logger.INFO("Successfully added a Coke Oven recipe for: "+aOutput.getDisplayName()+" & "+aFluidOutput.getFluid().getName()+", Using "+aInput1.getDisplayName()+" & "+aInput2.getDisplayName()+" & liquid "+aFluidInput.getFluid().getName()+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- }
+ public static void debug4(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack aOutput,
+ final int aDuration,
+ final int aEUt) {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Taking a step forward.");
+ Logger.WARNING(
+ "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
+ Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
+ + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Logger.WARNING("Passed.");
+ Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
+ + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ }
+ public static void debug5(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack aOutput,
+ final int aDuration,
+ final int aEUt) {
+ Logger.INFO("Successfully added a Coke Oven recipe for: " + aOutput.getDisplayName() + " & "
+ + aFluidOutput.getFluid().getName() + ", Using " + aInput1.getDisplayName() + " & "
+ + aInput2.getDisplayName() + " & liquid "
+ + aFluidInput.getFluid().getName() + ". This takes " + (aDuration / 20) + " seconds for " + aEUt
+ + "eu/t.");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java
index 402d47d3e5..b9f4c11887 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java
@@ -1,82 +1,119 @@
package gtPlusPlus.xmod.gregtech.recipes.machines;
-import net.minecraft.item.ItemStack;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RECIPEHANDLER_Dehydrator {
- public static void debug1(){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Walking Through Chemical Dehydrator Recipe Creation.");
- Logger.WARNING("My name is Willus and I will be your humble host.");
- }
- public static void debug2(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Taking a step forward.");
- Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
- Logger.WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Passed.");
- }
- public static void debug3(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Taking a step forward.");
- Logger.WARNING("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
- Logger.WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Passed.");
- }
- public static void debug4(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Taking a step forward.");
- Logger.WARNING("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
- Logger.WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Passed.");
- Logger.WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ public static void debug1() {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Walking Through Chemical Dehydrator Recipe Creation.");
+ Logger.WARNING("My name is Willus and I will be your humble host.");
+ }
+
+ public static void debug2(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack aOutput,
+ final int aDuration,
+ final int aEUt) {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Taking a step forward.");
+ Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
+ Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
+ + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Logger.WARNING("Passed.");
+ }
+
+ public static void debug3(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack aOutput,
+ final int aDuration,
+ final int aEUt) {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Taking a step forward.");
+ Logger.WARNING(
+ "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
+ Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
+ + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Logger.WARNING("Passed.");
+ }
- }
- public static void debug5(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, final FluidStack aFluidOutput, final ItemStack[] aOutput, final int aDuration, final int aEUt){
+ public static void debug4(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack aOutput,
+ final int aDuration,
+ final int aEUt) {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Taking a step forward.");
+ Logger.WARNING(
+ "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
+ Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
+ + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Logger.WARNING("Passed.");
+ Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
+ + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ }
- String inputAname;
- String inputBname;
- String inputFluidname;
- String outputFluidName;
+ public static void debug5(
+ final ItemStack aInput1,
+ final ItemStack aInput2,
+ final FluidStack aFluidInput,
+ final FluidStack aFluidOutput,
+ final ItemStack[] aOutput,
+ final int aDuration,
+ final int aEUt) {
- if (aInput1 != null){
- inputAname = aInput1.getDisplayName();
- }
- else {
- inputAname = "null";
- }
+ String inputAname;
+ String inputBname;
+ String inputFluidname;
+ String outputFluidName;
- if (aInput2 != null){
- inputBname = aInput2.getDisplayName();
- }
- else {
- inputBname = "null";
- }
+ if (aInput1 != null) {
+ inputAname = aInput1.getDisplayName();
+ } else {
+ inputAname = "null";
+ }
- if (aFluidInput != null){
- inputFluidname = aFluidInput.getFluid().getName();
- }
- else {
- inputFluidname = "null";
- }
+ if (aInput2 != null) {
+ inputBname = aInput2.getDisplayName();
+ } else {
+ inputBname = "null";
+ }
- if (aFluidOutput != null){
- outputFluidName = aFluidOutput.getFluid().getName();
- }
- else {
- outputFluidName = "null";
- }
+ if (aFluidInput != null) {
+ inputFluidname = aFluidInput.getFluid().getName();
+ } else {
+ inputFluidname = "null";
+ }
- Logger.INFO("Successfully added a Chemical Dehydrator recipe for: "+ItemUtils.getArrayStackNames(aOutput)+" & "+outputFluidName+", Using "+inputAname+" & "+inputBname+" & liquid "+inputFluidname+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- }
+ if (aFluidOutput != null) {
+ outputFluidName = aFluidOutput.getFluid().getName();
+ } else {
+ outputFluidName = "null";
+ }
+ Logger.INFO("Successfully added a Chemical Dehydrator recipe for: " + ItemUtils.getArrayStackNames(aOutput)
+ + " & " + outputFluidName + ", Using " + inputAname + " & " + inputBname + " & liquid " + inputFluidname
+ + ". This takes " + (aDuration / 20) + " seconds for " + aEUt + "eu/t.");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java
index df51f1ad77..6523e0a6f6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java
@@ -5,51 +5,64 @@ import net.minecraftforge.fluids.FluidStack;
public class RECIPEHANDLER_MatterFabricator {
- public static void debug1(){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Walking Through Matter Fabrication Recipe Creation.");
- Logger.WARNING("My name is Ralph and I will be your humble host.");
- }
- public static void debug2(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Taking a step forward.");
- Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
- Logger.WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Passed.");
- }
- public static void debug3(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Taking a step forward.");
- Logger.WARNING("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
- Logger.WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Passed.");
- }
- public static void debug4(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt){
- Logger.WARNING("==================================================================================");
- Logger.WARNING("Taking a step forward.");
- Logger.WARNING("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
- Logger.WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
- Logger.WARNING("Passed.");
- Logger.WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
-
- }
- public static void debug5(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt){
- String a = "nothing";
- String b = "";
-
- if (aFluidInput != null){
- a = aFluidInput.getFluid().getName();
- }
- if (aFluidOutput != null){
- b = aFluidOutput.getFluid().getName();
- }
-
- Logger.INFO("Successfully added a Matter Fabrication recipe for: "+b+", Using "+" liquid "+a+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- Logger.WARNING("==================================================================================");
- }
+ public static void debug1() {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Walking Through Matter Fabrication Recipe Creation.");
+ Logger.WARNING("My name is Ralph and I will be your humble host.");
+ }
+ public static void debug2(
+ final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Taking a step forward.");
+ Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
+ Logger.WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Logger.WARNING("Passed.");
+ }
+
+ public static void debug3(
+ final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Taking a step forward.");
+ Logger.WARNING(
+ "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
+ Logger.WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Logger.WARNING("Passed.");
+ }
+
+ public static void debug4(
+ final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) {
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("Taking a step forward.");
+ Logger.WARNING(
+ "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
+ Logger.WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Logger.WARNING("Passed.");
+ Logger.WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
+ + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ }
+
+ public static void debug5(
+ final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) {
+ String a = "nothing";
+ String b = "";
+
+ if (aFluidInput != null) {
+ a = aFluidInput.getFluid().getName();
+ }
+ if (aFluidOutput != null) {
+ b = aFluidOutput.getFluid().getName();
+ }
+
+ Logger.INFO("Successfully added a Matter Fabrication recipe for: " + b + ", Using " + " liquid " + a
+ + ". This takes " + (aDuration / 20) + " seconds for " + aEUt + "eu/t.");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ Logger.WARNING("==================================================================================");
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
index e71e71d6ed..898fe17a52 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
@@ -17,129 +17,176 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving.*;
public class Gregtech4Content {
- // ID Range 828, 829, 833 - 850
+ // ID Range 828, 829, 833 - 850
- public static void run() {
- if (LoadedMods.Gregtech) {
- Logger.INFO("Max MTE: "+GregTech_API.METATILEENTITIES.length+" | "+GregTech_API.MAXIMUM_METATILE_IDS);
- workbenches();
- thermalBoiler();
- multiCrafter();
- tesseracts();
- shelves();
- basic();
- automation();
- redstone();
- computer();
- }
- }
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Max MTE: " + GregTech_API.METATILEENTITIES.length + " | " + GregTech_API.MAXIMUM_METATILE_IDS);
+ workbenches();
+ thermalBoiler();
+ multiCrafter();
+ tesseracts();
+ shelves();
+ basic();
+ automation();
+ redstone();
+ computer();
+ }
+ }
+ private static void computer() {
+ Logger.INFO("Gregtech 4 Content | Registering Computer Cube.");
+ GregtechItemList.Gregtech_Computer_Cube_Machine.set(
+ new GT_TileEntity_ComputerCube(31130, "C-O-M-P-U-T-E-R").getStackForm(1L));
+ }
- private static void computer() {
- Logger.INFO("Gregtech 4 Content | Registering Computer Cube.");
- GregtechItemList.Gregtech_Computer_Cube_Machine.set(new GT_TileEntity_ComputerCube(31130, "C-O-M-P-U-T-E-R").getStackForm(1L));
- }
-
- private static void workbenches() {
- // Gregtech 4 Workbenches
- Logger.INFO("Gregtech 4 Content | Registering Workbenches.");
- GregtechItemList.GT4_Workbench_Bronze.set(new GT_MetaTileEntity_BronzeCraftingTable(31081, "workbench.basic", "Bronze Workbench", 0, "Stores 16000L of fluid").getStackForm(1L));
- GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable(31082, "workbench.advanced", "Advanced Workbench", 3, "Stores 64000L of fluid").getStackForm(1L));
-
- }
-
- private static void redstone() {
- Logger.INFO("Gregtech 4 Content | Registering Redstone Blocks.");
- GregtechItemList.GT4_Redstone_Lamp.set(new GT_MetaTileEntity_RedstoneLamp(31120).getStackForm(1L));
- GregtechItemList.GT4_Redstone_Button_Panel.set(new GT_MetaTileEntity_RedstoneButtonPanel(31121).getStackForm(1L));
- GregtechItemList.GT4_Redstone_Scale.set(new GT_MetaTileEntity_RedstoneStrengthScale(31122).getStackForm(1L));
- GregtechItemList.GT4_Redstone_Display.set(new GT_MetaTileEntity_RedstoneStrengthDisplay(31123, "redstone.display.strength", "Redstone Display", "Displays Redstone Strength").getStackForm(1L));
- GregtechItemList.GT4_Redstone_Circuit.set(new GT_MetaTileEntity_RedstoneCircuitBlock(31124).getStackForm(1L));
-
- }
-
- private static void automation() {
- Logger.INFO("Gregtech 4 Content | Registering Auto Workbenches.");
- GregtechItemList.GT4_Electric_Auto_Workbench_LV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31091, 1, "Automatic crafting machine").getStackForm(1L));
- GregtechItemList.GT4_Electric_Auto_Workbench_MV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31092, 2, "Automatic crafting machine").getStackForm(1L));
- GregtechItemList.GT4_Electric_Auto_Workbench_HV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31093, 3, "Automatic crafting machine").getStackForm(1L));
- GregtechItemList.GT4_Electric_Auto_Workbench_EV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31094, 4, "Automatic crafting machine").getStackForm(1L));
- GregtechItemList.GT4_Electric_Auto_Workbench_IV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31095, 5, "Automatic crafting machine").getStackForm(1L));
- GregtechItemList.GT4_Electric_Auto_Workbench_LuV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31096, 6, "Automatic crafting machine").getStackForm(1L));
- GregtechItemList.GT4_Electric_Auto_Workbench_ZPM.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31097, 7, "Automatic crafting machine").getStackForm(1L));
- GregtechItemList.GT4_Electric_Auto_Workbench_UV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31098, 8, "Automatic crafting machine").getStackForm(1L));
+ private static void workbenches() {
+ // Gregtech 4 Workbenches
+ Logger.INFO("Gregtech 4 Content | Registering Workbenches.");
+ GregtechItemList.GT4_Workbench_Bronze.set(new GT_MetaTileEntity_BronzeCraftingTable(
+ 31081, "workbench.basic", "Bronze Workbench", 0, "Stores 16000L of fluid")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable(
+ 31082, "workbench.advanced", "Advanced Workbench", 3, "Stores 64000L of fluid")
+ .getStackForm(1L));
+ }
- Logger.INFO("Gregtech 4 Content | Registering Inventory Managers.");
- GregtechItemList.GT4_Electric_Inventory_Manager_LV.set(new GT_MetaTileEntity_ElectricInventoryManager(31101, 1, "Manages your inventory and stuff").getStackForm(1L));
- GregtechItemList.GT4_Electric_Inventory_Manager_MV.set(new GT_MetaTileEntity_ElectricInventoryManager(31102, 2, "Manages your inventory and stuff").getStackForm(1L));
- GregtechItemList.GT4_Electric_Inventory_Manager_HV.set(new GT_MetaTileEntity_ElectricInventoryManager(31103, 3, "Manages your inventory and stuff").getStackForm(1L));
- GregtechItemList.GT4_Electric_Inventory_Manager_EV.set(new GT_MetaTileEntity_ElectricInventoryManager(31104, 4, "Manages your inventory and stuff").getStackForm(1L));
- GregtechItemList.GT4_Electric_Inventory_Manager_IV.set(new GT_MetaTileEntity_ElectricInventoryManager(31105, 5, "Manages your inventory and stuff").getStackForm(1L));
- GregtechItemList.GT4_Electric_Inventory_Manager_LuV.set(new GT_MetaTileEntity_ElectricInventoryManager(31106, 6, "Manages your inventory and stuff").getStackForm(1L));
- GregtechItemList.GT4_Electric_Inventory_Manager_ZPM.set(new GT_MetaTileEntity_ElectricInventoryManager(31107, 7, "Manages your inventory and stuff").getStackForm(1L));
- GregtechItemList.GT4_Electric_Inventory_Manager_UV.set(new GT_MetaTileEntity_ElectricInventoryManager(31108, 8, "Manages your inventory and stuff").getStackForm(1L));
- }
-
- private static void basic() {
- Logger.INFO("Gregtech 4 Content | Registering Crop Managers.");
- GregtechItemList.GT4_Crop_Harvester_LV.set(new GT_MetaTileEntity_CropHarvestor(31111, 1, "Harvests the Cropsticks in front of it").getStackForm(1L));
- GregtechItemList.GT4_Crop_Harvester_MV.set(new GT_MetaTileEntity_CropHarvestor(31112, 2, "Harvests the Cropsticks in front of it").getStackForm(1L));
- GregtechItemList.GT4_Crop_Harvester_HV.set(new GT_MetaTileEntity_CropHarvestor(31113, 3, "Harvests the Cropsticks in front of it").getStackForm(1L));
- GregtechItemList.GT4_Crop_Harvester_EV.set(new GT_MetaTileEntity_CropHarvestor(31114, 4, "Harvests the Cropsticks in front of it").getStackForm(1L));
- GregtechItemList.GT4_Crop_Harvester_IV.set(new GT_MetaTileEntity_CropHarvestor(31115, 5, "Harvests the Cropsticks in front of it").getStackForm(1L));
- GregtechItemList.GT4_Crop_Harvester_LuV.set(new GT_MetaTileEntity_CropHarvestor(31116, 6, "Harvests the Cropsticks in front of it").getStackForm(1L));
- GregtechItemList.GT4_Crop_Harvester_ZPM.set(new GT_MetaTileEntity_CropHarvestor(31117, 7, "Harvests the Cropsticks in front of it").getStackForm(1L));
- GregtechItemList.GT4_Crop_Harvester_UV.set(new GT_MetaTileEntity_CropHarvestor(31118, 8, "Harvests the Cropsticks in front of it").getStackForm(1L));
- }
+ private static void redstone() {
+ Logger.INFO("Gregtech 4 Content | Registering Redstone Blocks.");
+ GregtechItemList.GT4_Redstone_Lamp.set(new GT_MetaTileEntity_RedstoneLamp(31120).getStackForm(1L));
+ GregtechItemList.GT4_Redstone_Button_Panel.set(
+ new GT_MetaTileEntity_RedstoneButtonPanel(31121).getStackForm(1L));
+ GregtechItemList.GT4_Redstone_Scale.set(new GT_MetaTileEntity_RedstoneStrengthScale(31122).getStackForm(1L));
+ GregtechItemList.GT4_Redstone_Display.set(new GT_MetaTileEntity_RedstoneStrengthDisplay(
+ 31123, "redstone.display.strength", "Redstone Display", "Displays Redstone Strength")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Redstone_Circuit.set(new GT_MetaTileEntity_RedstoneCircuitBlock(31124).getStackForm(1L));
+ }
- private static void tesseracts() {
- // Gregtech 4 Tesseracts
- Logger.INFO("Gregtech 4 Content | Registering Tesseracts.");
- GregtechItemList.GT4_Tesseract_Generator
- .set(new GT_MetaTileEntity_TesseractGenerator(833, "tesseract.generator", "Tesseract Generator", 4)
- .getStackForm(1L));
- GregtechItemList.GT4_Tesseract_Terminal
- .set(new GT_MetaTileEntity_TesseractTerminal(834, "tesseract.terminal", "Tesseract Terminal", 4)
- .getStackForm(1L));
- }
+ private static void automation() {
+ Logger.INFO("Gregtech 4 Content | Registering Auto Workbenches.");
+ GregtechItemList.GT4_Electric_Auto_Workbench_LV.set(
+ new GT_MetaTileEntity_ElectricAutoWorkbench(31091, 1, "Automatic crafting machine").getStackForm(1L));
+ GregtechItemList.GT4_Electric_Auto_Workbench_MV.set(
+ new GT_MetaTileEntity_ElectricAutoWorkbench(31092, 2, "Automatic crafting machine").getStackForm(1L));
+ GregtechItemList.GT4_Electric_Auto_Workbench_HV.set(
+ new GT_MetaTileEntity_ElectricAutoWorkbench(31093, 3, "Automatic crafting machine").getStackForm(1L));
+ GregtechItemList.GT4_Electric_Auto_Workbench_EV.set(
+ new GT_MetaTileEntity_ElectricAutoWorkbench(31094, 4, "Automatic crafting machine").getStackForm(1L));
+ GregtechItemList.GT4_Electric_Auto_Workbench_IV.set(
+ new GT_MetaTileEntity_ElectricAutoWorkbench(31095, 5, "Automatic crafting machine").getStackForm(1L));
+ GregtechItemList.GT4_Electric_Auto_Workbench_LuV.set(
+ new GT_MetaTileEntity_ElectricAutoWorkbench(31096, 6, "Automatic crafting machine").getStackForm(1L));
+ GregtechItemList.GT4_Electric_Auto_Workbench_ZPM.set(
+ new GT_MetaTileEntity_ElectricAutoWorkbench(31097, 7, "Automatic crafting machine").getStackForm(1L));
+ GregtechItemList.GT4_Electric_Auto_Workbench_UV.set(
+ new GT_MetaTileEntity_ElectricAutoWorkbench(31098, 8, "Automatic crafting machine").getStackForm(1L));
- private static void shelves() {
- // Gregtech 4 Shelves
- Logger.INFO("Gregtech 4 Content | Registering Shelves.");
- GregtechItemList.GT4_Shelf
- .set(new GT4Entity_Shelf(870, "gtplusplus.shelf.wooden", "Wooden Shelf", "Usually used for books")
- .getStackForm(1L));
- GregtechItemList.GT4_Shelf_Iron.set(
- new GT4Entity_Shelf_Iron(871, "gtplusplus.shelf.iron", "Metal Shelf", "A heavy duty shelf")
- .getStackForm(1L));
- GregtechItemList.GT4_Shelf_FileCabinet.set(new GT4Entity_Shelf_FileCabinet(872, "gtplusplus.shelf.filecabinet",
- "File Cabinet", "Could look nice in your office").getStackForm(1L));
- GregtechItemList.GT4_Shelf_Desk.set(
- new GT4Entity_Shelf_Desk(873, "gtplusplus.shelf.desk", "Metal encased Desk", "A place to study")
- .getStackForm(1L));
- GregtechItemList.GT4_Shelf_Compartment.set(new GT4Entity_Shelf_Compartment(874, "gtplusplus.shelf.compartment",
- "Compartment", "Stores Books & Things").getStackForm(1L));
-
- //Custom Storage
- GregtechItemList.GT4_Shelf_Large.set(
- new GT4Entity_Shelf_Large(966, "gtplusplus.shelf.large", "Large Shelf", "A spacious shelf", 2048)
- .getStackForm(1L));
- }
+ Logger.INFO("Gregtech 4 Content | Registering Inventory Managers.");
+ GregtechItemList.GT4_Electric_Inventory_Manager_LV.set(
+ new GT_MetaTileEntity_ElectricInventoryManager(31101, 1, "Manages your inventory and stuff")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Electric_Inventory_Manager_MV.set(
+ new GT_MetaTileEntity_ElectricInventoryManager(31102, 2, "Manages your inventory and stuff")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Electric_Inventory_Manager_HV.set(
+ new GT_MetaTileEntity_ElectricInventoryManager(31103, 3, "Manages your inventory and stuff")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Electric_Inventory_Manager_EV.set(
+ new GT_MetaTileEntity_ElectricInventoryManager(31104, 4, "Manages your inventory and stuff")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Electric_Inventory_Manager_IV.set(
+ new GT_MetaTileEntity_ElectricInventoryManager(31105, 5, "Manages your inventory and stuff")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Electric_Inventory_Manager_LuV.set(
+ new GT_MetaTileEntity_ElectricInventoryManager(31106, 6, "Manages your inventory and stuff")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Electric_Inventory_Manager_ZPM.set(
+ new GT_MetaTileEntity_ElectricInventoryManager(31107, 7, "Manages your inventory and stuff")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Electric_Inventory_Manager_UV.set(
+ new GT_MetaTileEntity_ElectricInventoryManager(31108, 8, "Manages your inventory and stuff")
+ .getStackForm(1L));
+ }
- private static void thermalBoiler() {
- // Gregtech 4 Thermal Boiler
- if (CORE.ConfigSwitches.enableMultiblock_ThermalBoiler){
- Logger.INFO("Gregtech 4 Content | Registering Thermal Boiler.");
- GregtechItemList.GT4_Thermal_Boiler
- .set(new GT4Entity_ThermalBoiler(875, "gtplusplus.thermal.boiler", "Thermal Boiler").getStackForm(1L));
- }
-
- }
+ private static void basic() {
+ Logger.INFO("Gregtech 4 Content | Registering Crop Managers.");
+ GregtechItemList.GT4_Crop_Harvester_LV.set(
+ new GT_MetaTileEntity_CropHarvestor(31111, 1, "Harvests the Cropsticks in front of it")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Crop_Harvester_MV.set(
+ new GT_MetaTileEntity_CropHarvestor(31112, 2, "Harvests the Cropsticks in front of it")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Crop_Harvester_HV.set(
+ new GT_MetaTileEntity_CropHarvestor(31113, 3, "Harvests the Cropsticks in front of it")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Crop_Harvester_EV.set(
+ new GT_MetaTileEntity_CropHarvestor(31114, 4, "Harvests the Cropsticks in front of it")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Crop_Harvester_IV.set(
+ new GT_MetaTileEntity_CropHarvestor(31115, 5, "Harvests the Cropsticks in front of it")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Crop_Harvester_LuV.set(
+ new GT_MetaTileEntity_CropHarvestor(31116, 6, "Harvests the Cropsticks in front of it")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Crop_Harvester_ZPM.set(
+ new GT_MetaTileEntity_CropHarvestor(31117, 7, "Harvests the Cropsticks in front of it")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Crop_Harvester_UV.set(
+ new GT_MetaTileEntity_CropHarvestor(31118, 8, "Harvests the Cropsticks in front of it")
+ .getStackForm(1L));
+ }
- private static void multiCrafter() {
- // Gregtech 4 Multiblock Auto-Crafter
- Logger.INFO("Gregtech 4 Content | Registering Multiblock Crafter.");
- GregtechItemList.GT4_Multi_Crafter.set(
- new GT4Entity_AutoCrafter(876, "gtplusplus.autocrafter.multi", "Large Scale Auto-Assembler v1.01").getStackForm(1L));
- }
+ private static void tesseracts() {
+ // Gregtech 4 Tesseracts
+ Logger.INFO("Gregtech 4 Content | Registering Tesseracts.");
+ GregtechItemList.GT4_Tesseract_Generator.set(
+ new GT_MetaTileEntity_TesseractGenerator(833, "tesseract.generator", "Tesseract Generator", 4)
+ .getStackForm(1L));
+ GregtechItemList.GT4_Tesseract_Terminal.set(
+ new GT_MetaTileEntity_TesseractTerminal(834, "tesseract.terminal", "Tesseract Terminal", 4)
+ .getStackForm(1L));
+ }
+
+ private static void shelves() {
+ // Gregtech 4 Shelves
+ Logger.INFO("Gregtech 4 Content | Registering Shelves.");
+ GregtechItemList.GT4_Shelf.set(
+ new GT4Entity_Shelf(870, "gtplusplus.shelf.wooden", "Wooden Shelf", "Usually used for books")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Shelf_Iron.set(
+ new GT4Entity_Shelf_Iron(871, "gtplusplus.shelf.iron", "Metal Shelf", "A heavy duty shelf")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Shelf_FileCabinet.set(new GT4Entity_Shelf_FileCabinet(
+ 872, "gtplusplus.shelf.filecabinet", "File Cabinet", "Could look nice in your office")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Shelf_Desk.set(
+ new GT4Entity_Shelf_Desk(873, "gtplusplus.shelf.desk", "Metal encased Desk", "A place to study")
+ .getStackForm(1L));
+ GregtechItemList.GT4_Shelf_Compartment.set(new GT4Entity_Shelf_Compartment(
+ 874, "gtplusplus.shelf.compartment", "Compartment", "Stores Books & Things")
+ .getStackForm(1L));
+
+ // Custom Storage
+ GregtechItemList.GT4_Shelf_Large.set(
+ new GT4Entity_Shelf_Large(966, "gtplusplus.shelf.large", "Large Shelf", "A spacious shelf", 2048)
+ .getStackForm(1L));
+ }
+
+ private static void thermalBoiler() {
+ // Gregtech 4 Thermal Boiler
+ if (CORE.ConfigSwitches.enableMultiblock_ThermalBoiler) {
+ Logger.INFO("Gregtech 4 Content | Registering Thermal Boiler.");
+ GregtechItemList.GT4_Thermal_Boiler.set(
+ new GT4Entity_ThermalBoiler(875, "gtplusplus.thermal.boiler", "Thermal Boiler").getStackForm(1L));
+ }
+ }
+
+ private static void multiCrafter() {
+ // Gregtech 4 Multiblock Auto-Crafter
+ Logger.INFO("Gregtech 4 Content | Registering Multiblock Crafter.");
+ GregtechItemList.GT4_Multi_Crafter.set(
+ new GT4Entity_AutoCrafter(876, "gtplusplus.autocrafter.multi", "Large Scale Auto-Assembler v1.01")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java
index d50a8f3924..de8dd983e9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java
@@ -1,12 +1,9 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
@@ -16,89 +13,171 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity_Boiler_HV;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity_Boiler_LV;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity_Boiler_MV;
+import net.minecraft.item.ItemStack;
public class GregtechAdvancedBoilers {
- public static void run() {
- if (LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Advanced Boilers.");
- run1();
- }
- }
-
- private static void run1() {
- // Boilers
- GregtechItemList.Boiler_Advanced_LV
- .set(new GT_MetaTileEntity_Boiler_LV(753, "Advanced Boiler [LV]", 1).getStackForm(1L));
- GregtechItemList.Boiler_Advanced_MV
- .set(new GT_MetaTileEntity_Boiler_MV(754, "Advanced Boiler [MV]", 2).getStackForm(1L));
- GregtechItemList.Boiler_Advanced_HV
- .set(new GT_MetaTileEntity_Boiler_HV(755, "Advanced Boiler [HV]", 3).getStackForm(1L));
-
- ItemStack chassisT1 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1",
- 0, 1);
- ItemStack chassisT2 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1",
- 1, 1);
- ItemStack chassisT3 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1",
- 2, 1);
-
- // Make the Coil in each following recipe a hammer and a Screwdriver.
-
- // Chassis Recipes
- GT_ModHandler.addCraftingRecipe(chassisT1,
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "WCW", "GMG", "WPW", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('P'),
- OrePrefixes.pipeLarge.get(Materials.Bronze), Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Primitive), Character.valueOf('W'),
- OrePrefixes.plate.get(Materials.Lead), Character.valueOf('G'),
- OrePrefixes.pipeSmall.get(Materials.Copper) });
-
- GT_ModHandler.addCraftingRecipe(chassisT2,
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "WCW", "GMG", "WPW", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('P'),
- OrePrefixes.pipeLarge.get(Materials.Steel), Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'),
- OrePrefixes.plate.get(Materials.Steel), Character.valueOf('G'),
- OrePrefixes.pipeSmall.get(Materials.Bronze) });
-
- GT_ModHandler.addCraftingRecipe(chassisT3,
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "WCW", "GMG", "WPW", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('P'),
- OrePrefixes.pipeLarge.get(Materials.StainlessSteel), Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'),
- OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('G'),
- OrePrefixes.pipeSmall.get(Materials.Steel) });
-
- ItemStack pipeTier1 = ItemUtils.getItemStackOfAmountFromOreDict(RECIPES_MachineComponents.pipeTier7, 1);
- ItemStack pipeTier2 = ItemUtils.getItemStackOfAmountFromOreDict(RECIPES_MachineComponents.pipeTier8, 1);
- ItemStack pipeTier3 = ItemUtils.getItemStackOfAmountFromOreDict(RECIPES_MachineComponents.pipeTier9, 1);
-
- // Boiler Recipes
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Boiler_Advanced_LV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "dCw", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('P'),
- pipeTier1, Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic),
- Character.valueOf('W'), chassisT1, Character.valueOf('G'),
- OrePrefixes.gear.get(Materials.Steel) });
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Boiler_Advanced_MV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "dCw", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('P'),
- pipeTier2, Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good),
- Character.valueOf('W'), chassisT2, Character.valueOf('G'), ALLOY.SILICON_CARBIDE.getGear(1) });
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Boiler_Advanced_HV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "dCw", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('P'),
- pipeTier3, Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced),
- Character.valueOf('W'), chassisT3, Character.valueOf('G'), ALLOY.SILICON_CARBIDE.getGear(1) });
-
- }
-
-} \ No newline at end of file
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Advanced Boilers.");
+ run1();
+ }
+ }
+
+ private static void run1() {
+ // Boilers
+ GregtechItemList.Boiler_Advanced_LV.set(
+ new GT_MetaTileEntity_Boiler_LV(753, "Advanced Boiler [LV]", 1).getStackForm(1L));
+ GregtechItemList.Boiler_Advanced_MV.set(
+ new GT_MetaTileEntity_Boiler_MV(754, "Advanced Boiler [MV]", 2).getStackForm(1L));
+ GregtechItemList.Boiler_Advanced_HV.set(
+ new GT_MetaTileEntity_Boiler_HV(755, "Advanced Boiler [HV]", 3).getStackForm(1L));
+
+ ItemStack chassisT1 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1", 0, 1);
+ ItemStack chassisT2 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1", 1, 1);
+ ItemStack chassisT3 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1", 2, 1);
+
+ // Make the Coil in each following recipe a hammer and a Screwdriver.
+
+ // Chassis Recipes
+ GT_ModHandler.addCraftingRecipe(
+ chassisT1,
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WCW",
+ "GMG",
+ "WPW",
+ Character.valueOf('M'),
+ ItemList.Hull_ULV,
+ Character.valueOf('P'),
+ OrePrefixes.pipeLarge.get(Materials.Bronze),
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Primitive),
+ Character.valueOf('W'),
+ OrePrefixes.plate.get(Materials.Lead),
+ Character.valueOf('G'),
+ OrePrefixes.pipeSmall.get(Materials.Copper)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ chassisT2,
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WCW",
+ "GMG",
+ "WPW",
+ Character.valueOf('M'),
+ ItemList.Hull_LV,
+ Character.valueOf('P'),
+ OrePrefixes.pipeLarge.get(Materials.Steel),
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Basic),
+ Character.valueOf('W'),
+ OrePrefixes.plate.get(Materials.Steel),
+ Character.valueOf('G'),
+ OrePrefixes.pipeSmall.get(Materials.Bronze)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ chassisT3,
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WCW",
+ "GMG",
+ "WPW",
+ Character.valueOf('M'),
+ ItemList.Hull_MV,
+ Character.valueOf('P'),
+ OrePrefixes.pipeLarge.get(Materials.StainlessSteel),
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Good),
+ Character.valueOf('W'),
+ OrePrefixes.plate.get(Materials.Aluminium),
+ Character.valueOf('G'),
+ OrePrefixes.pipeSmall.get(Materials.Steel)
+ });
+
+ ItemStack pipeTier1 = ItemUtils.getItemStackOfAmountFromOreDict(RECIPES_MachineComponents.pipeTier7, 1);
+ ItemStack pipeTier2 = ItemUtils.getItemStackOfAmountFromOreDict(RECIPES_MachineComponents.pipeTier8, 1);
+ ItemStack pipeTier3 = ItemUtils.getItemStackOfAmountFromOreDict(RECIPES_MachineComponents.pipeTier9, 1);
+
+ // Boiler Recipes
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Boiler_Advanced_LV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "dCw",
+ "WMW",
+ "GPG",
+ Character.valueOf('M'),
+ ItemList.Hull_LV,
+ Character.valueOf('P'),
+ pipeTier1,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Basic),
+ Character.valueOf('W'),
+ chassisT1,
+ Character.valueOf('G'),
+ OrePrefixes.gear.get(Materials.Steel)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Boiler_Advanced_MV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "dCw",
+ "WMW",
+ "GPG",
+ Character.valueOf('M'),
+ ItemList.Hull_MV,
+ Character.valueOf('P'),
+ pipeTier2,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Good),
+ Character.valueOf('W'),
+ chassisT2,
+ Character.valueOf('G'),
+ ALLOY.SILICON_CARBIDE.getGear(1)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Boiler_Advanced_HV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "dCw",
+ "WMW",
+ "GPG",
+ Character.valueOf('M'),
+ ItemList.Hull_HV,
+ Character.valueOf('P'),
+ pipeTier3,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Advanced),
+ Character.valueOf('W'),
+ chassisT3,
+ Character.valueOf('G'),
+ ALLOY.SILICON_CARBIDE.getGear(1)
+ });
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedMixer.java
index 3cefaa1bf7..731927f170 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedMixer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedMixer.java
@@ -1,132 +1,262 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import java.util.Collection;
-
-import gregtech.api.enums.ItemList;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe;
+import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GTPP_Recipe;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import java.util.Collection;
public class GregtechAdvancedMixer {
- private static int mID = 851;
+ private static int mID = 851;
- public static void run(){
- //generateMixerRecipeMap();
- run1();
- }
-
- private static GT_Recipe_Map map = GT_Recipe.GT_Recipe_Map.sMixerRecipes;
-
- private static boolean generateMixerRecipeMap(){
- if (GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size() == 0){
- GT_Recipe_Map oldMap = GT_Recipe.GT_Recipe_Map.sMixerRecipes;
- GT_Recipe_Map map = GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes;
- final Collection<GT_Recipe> x = oldMap.mRecipeList;
- //Logger.INFO("Generating " + map.mUnlocalizedName + " Recipes.");
- for (final GT_Recipe g : x) {
- GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.add(g);
- }
+ public static void run() {
+ // generateMixerRecipeMap();
+ run1();
+ }
- if (GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size() > 0){
- return true;
- }
- else {
- Logger.INFO("Failed to generate "+ map.mUnlocalizedName +" recipes.");
- return false;
- }
+ private static GT_Recipe_Map map = GT_Recipe.GT_Recipe_Map.sMixerRecipes;
- }
- return true;
- }
+ private static boolean generateMixerRecipeMap() {
+ if (GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size() == 0) {
+ GT_Recipe_Map oldMap = GT_Recipe.GT_Recipe_Map.sMixerRecipes;
+ GT_Recipe_Map map = GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes;
+ final Collection<GT_Recipe> x = oldMap.mRecipeList;
+ // Logger.INFO("Generating " + map.mUnlocalizedName + " Recipes.");
+ for (final GT_Recipe g : x) {
+ GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.add(g);
+ }
- private static void run1(){
- GregtechItemList.Machine_Advanced_LV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(mID++, "advancedmachine.mixer.tier.01",
- "Basic Combiner", 1, "Indeed, It does blend!", map, 4, 4, 32000, 0, 1,
- "MixerAdvanced.png", "", false, false, 0, "MIXER", null
- /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
- ItemList.Machine_LV_Mixer, Character.valueOf('E'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/).getStackForm(1L));
- GregtechItemList.Machine_Advanced_MV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(mID++, "advancedmachine.mixer.tier.02",
- "Advanced Combiner I", 2, "Indeed, It does blend!", map, 4, 4, 32000, 0, 1,
- "MixerAdvanced.png", "", false, false, 0, "MIXER", null
- /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
- ItemList.Machine_MV_Mixer, Character.valueOf('E'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/).getStackForm(1L));
- GregtechItemList.Machine_Advanced_HV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(mID++, "advancedmachine.mixer.tier.03",
- "Advanced Combiner II", 3, "Indeed, It does blend!", map, 4, 4, 32000, 0, 1,
- "MixerAdvanced.png", "", false, false, 0, "MIXER", null
- /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
- ItemList.Machine_HV_Mixer, Character.valueOf('E'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/).getStackForm(1L));
- GregtechItemList.Machine_Advanced_EV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(mID++, "advancedmachine.mixer.tier.04",
- "Super Combiner I", 4, "Indeed, It does blend!", map, 4, 4, 32000, 0, 1,
- "MixerAdvanced.png", "", false, false, 0, "MIXER", null
- /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
- ItemList.Machine_EV_Mixer, Character.valueOf('E'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/).getStackForm(1L));
- GregtechItemList.Machine_Advanced_IV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(mID++, "advancedmachine.mixer.tier.05",
- "Super Combiner II", 5, "Indeed, It does blend!", map, 4, 4, 32000, 0, 1,
- "MixerAdvanced.png", "", false, false, 0, "MIXER", null
- /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
- ItemList.Machine_IV_Mixer, Character.valueOf('E'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/).getStackForm(1L));
+ if (GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size() > 0) {
+ return true;
+ } else {
+ Logger.INFO("Failed to generate " + map.mUnlocalizedName + " recipes.");
+ return false;
+ }
+ }
+ return true;
+ }
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- try {
- GregtechItemList.Machine_Advanced_LuV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(mID++, "advancedmachine.mixer.tier.06",
- "Mega Combiner I", 6, "Indeed, It does blend!", map, 4, 4, 32000, 0, 1,
- "MixerAdvanced.png", "", false, false, 0, "MIXER", null
- /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
- //ItemList.Machine_LuV_Mixer, Character.valueOf('E'),
- ItemList.valueOf("Machine_LuV_Mixer"), Character.valueOf('E'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/).getStackForm(1L));
- GregtechItemList.Machine_Advanced_ZPM_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(mID++, "advancedmachine.mixer.tier.07",
- "Mega Combiner II", 7, "Indeed, It does blend!", map, 4, 4, 32000, 0, 1,
- "MixerAdvanced.png", "", false, false, 0, "MIXER", null
- /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
- //ItemList.Machine_ZPM_Mixer, Character.valueOf('E'),
- ItemList.valueOf("Machine_ZPM_Mixer"), Character.valueOf('E'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/).getStackForm(1L));
- GregtechItemList.Machine_Advanced_UV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(mID++, "advancedmachine.mixer.tier.08",
- "Ultra Combiner I", 8, "Indeed, It does blend!", map, 4, 4, 32000, 0, 1,
- "MixerAdvanced.png", "", false, false, 0, "MIXER", null
- /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
- //ItemList.Machine_UV_Mixer, Character.valueOf('E'),
- ItemList.valueOf("Machine_UV_Mixer"), Character.valueOf('E'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/).getStackForm(1L));
- }
- catch (Throwable t){}
- }
+ private static void run1() {
+ GregtechItemList.Machine_Advanced_LV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ mID++,
+ "advancedmachine.mixer.tier.01",
+ "Basic Combiner",
+ 1,
+ "Indeed, It does blend!",
+ map,
+ 4,
+ 4,
+ 32000,
+ 0,
+ 1,
+ "MixerAdvanced.png",
+ "",
+ false,
+ false,
+ 0,
+ "MIXER",
+ null
+ /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
+ ItemList.Machine_LV_Mixer, Character.valueOf('E'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/ )
+ .getStackForm(1L));
+ GregtechItemList.Machine_Advanced_MV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ mID++,
+ "advancedmachine.mixer.tier.02",
+ "Advanced Combiner I",
+ 2,
+ "Indeed, It does blend!",
+ map,
+ 4,
+ 4,
+ 32000,
+ 0,
+ 1,
+ "MixerAdvanced.png",
+ "",
+ false,
+ false,
+ 0,
+ "MIXER",
+ null
+ /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
+ ItemList.Machine_MV_Mixer, Character.valueOf('E'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/ )
+ .getStackForm(1L));
+ GregtechItemList.Machine_Advanced_HV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ mID++,
+ "advancedmachine.mixer.tier.03",
+ "Advanced Combiner II",
+ 3,
+ "Indeed, It does blend!",
+ map,
+ 4,
+ 4,
+ 32000,
+ 0,
+ 1,
+ "MixerAdvanced.png",
+ "",
+ false,
+ false,
+ 0,
+ "MIXER",
+ null
+ /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
+ ItemList.Machine_HV_Mixer, Character.valueOf('E'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/ )
+ .getStackForm(1L));
+ GregtechItemList.Machine_Advanced_EV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ mID++,
+ "advancedmachine.mixer.tier.04",
+ "Super Combiner I",
+ 4,
+ "Indeed, It does blend!",
+ map,
+ 4,
+ 4,
+ 32000,
+ 0,
+ 1,
+ "MixerAdvanced.png",
+ "",
+ false,
+ false,
+ 0,
+ "MIXER",
+ null
+ /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
+ ItemList.Machine_EV_Mixer, Character.valueOf('E'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/ )
+ .getStackForm(1L));
+ GregtechItemList.Machine_Advanced_IV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ mID++,
+ "advancedmachine.mixer.tier.05",
+ "Super Combiner II",
+ 5,
+ "Indeed, It does blend!",
+ map,
+ 4,
+ 4,
+ 32000,
+ 0,
+ 1,
+ "MixerAdvanced.png",
+ "",
+ false,
+ false,
+ 0,
+ "MIXER",
+ null
+ /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
+ ItemList.Machine_IV_Mixer, Character.valueOf('E'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/ )
+ .getStackForm(1L));
- }
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try {
+ GregtechItemList.Machine_Advanced_LuV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ mID++,
+ "advancedmachine.mixer.tier.06",
+ "Mega Combiner I",
+ 6,
+ "Indeed, It does blend!",
+ map,
+ 4,
+ 4,
+ 32000,
+ 0,
+ 1,
+ "MixerAdvanced.png",
+ "",
+ false,
+ false,
+ 0,
+ "MIXER",
+ null
+ /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
+ //ItemList.Machine_LuV_Mixer, Character.valueOf('E'),
+ ItemList.valueOf("Machine_LuV_Mixer"), Character.valueOf('E'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/ )
+ .getStackForm(1L));
+ GregtechItemList.Machine_Advanced_ZPM_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ mID++,
+ "advancedmachine.mixer.tier.07",
+ "Mega Combiner II",
+ 7,
+ "Indeed, It does blend!",
+ map,
+ 4,
+ 4,
+ 32000,
+ 0,
+ 1,
+ "MixerAdvanced.png",
+ "",
+ false,
+ false,
+ 0,
+ "MIXER",
+ null
+ /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
+ //ItemList.Machine_ZPM_Mixer, Character.valueOf('E'),
+ ItemList.valueOf("Machine_ZPM_Mixer"), Character.valueOf('E'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/ )
+ .getStackForm(1L));
+ GregtechItemList.Machine_Advanced_UV_Mixer.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ mID++,
+ "advancedmachine.mixer.tier.08",
+ "Ultra Combiner I",
+ 8,
+ "Indeed, It does blend!",
+ map,
+ 4,
+ 4,
+ 32000,
+ 0,
+ 1,
+ "MixerAdvanced.png",
+ "",
+ false,
+ false,
+ 0,
+ "MIXER",
+ null
+ /*new Object[] { "GRG", "GEG", "CMC", Character.valueOf('M'),
+ //ItemList.Machine_UV_Mixer, Character.valueOf('E'),
+ ItemList.valueOf("Machine_UV_Mixer"), Character.valueOf('E'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('R'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR, Character.valueOf('C'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, Character.valueOf('G'),
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE }*/ )
+ .getStackForm(1L));
+ } catch (Throwable t) {
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java
index 6ddc971f85..27de5556b2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java
@@ -1,7 +1,6 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.LoadedMods;
@@ -12,44 +11,43 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.ch
public class GregtechAlgaeContent {
- public static void run() {
- if (LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Algae Content.");
- run1();
- }
- }
-
- private static void run1() {
-
- // Algae Pond
- GregtechItemList.AlgaeFarm_Controller.set(new GregtechMTE_AlgaePondBase(997, "algaefarm.controller.tier.single", "Algae Farm").getStackForm(1L));
-
- // Chemical Plant
- GregtechItemList.ChemicalPlant_Controller.set(new GregtechMTE_ChemicalPlant(998, "chemicalplant.controller.tier.single", "ExxonMobil Chemical Plant").getStackForm(1L));
-
- GregtechItemList.Bus_Catalysts.set((new GT_MetaTileEntity_Hatch_Catalysts(31030, "hatch.catalysts", "Catalyst Housing")).getStackForm(1L));
-
-
- int aTier = 0;
- // Bronze
- GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, ModBlocks.blockCustomMachineCasings, 0, 10);
- // Steel
- GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, GregTech_API.sBlockCasings2, 0, 16);
- // Aluminium
- GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, ModBlocks.blockCustomMachineCasings, 1, 17);
- // Stainless
- GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, GregTech_API.sBlockCasings4, 1, 49);
- // Titanium
- GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, GregTech_API.sBlockCasings4, 2, 50);
- // Tungsten
- GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, GregTech_API.sBlockCasings4, 0, 48);
- // Laurenium
- GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, ModBlocks.blockCustomMachineCasings, 2, 84);
- // Botmium
- GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, ModBlocks.blockCustomMachineCasings, 3, 11);
-
-
-
- }
-
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Algae Content.");
+ run1();
+ }
+ }
+
+ private static void run1() {
+
+ // Algae Pond
+ GregtechItemList.AlgaeFarm_Controller.set(
+ new GregtechMTE_AlgaePondBase(997, "algaefarm.controller.tier.single", "Algae Farm").getStackForm(1L));
+
+ // Chemical Plant
+ GregtechItemList.ChemicalPlant_Controller.set(
+ new GregtechMTE_ChemicalPlant(998, "chemicalplant.controller.tier.single", "ExxonMobil Chemical Plant")
+ .getStackForm(1L));
+
+ GregtechItemList.Bus_Catalysts.set(
+ (new GT_MetaTileEntity_Hatch_Catalysts(31030, "hatch.catalysts", "Catalyst Housing")).getStackForm(1L));
+
+ int aTier = 0;
+ // Bronze
+ GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, ModBlocks.blockCustomMachineCasings, 0, 10);
+ // Steel
+ GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, GregTech_API.sBlockCasings2, 0, 16);
+ // Aluminium
+ GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, ModBlocks.blockCustomMachineCasings, 1, 17);
+ // Stainless
+ GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, GregTech_API.sBlockCasings4, 1, 49);
+ // Titanium
+ GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, GregTech_API.sBlockCasings4, 2, 50);
+ // Tungsten
+ GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, GregTech_API.sBlockCasings4, 0, 48);
+ // Laurenium
+ GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, ModBlocks.blockCustomMachineCasings, 2, 84);
+ // Botmium
+ GregtechMTE_ChemicalPlant.registerMachineCasingForTier(aTier++, ModBlocks.blockCustomMachineCasings, 3, 11);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAmazonWarehouse.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAmazonWarehouse.java
index 8adf580011..4c0a32d12a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAmazonWarehouse.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAmazonWarehouse.java
@@ -6,16 +6,17 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.misc.GMTE_Ama
public class GregtechAmazonWarehouse {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Amazon Warehouse Multiblock.");
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Amazon Warehouse Multiblock.");
+ run1();
+ }
+ }
- private static void run1() {
- // Amazon packager multiblock
- GregtechItemList.Amazon_Warehouse_Controller.set(new GMTE_AmazonPackager(942, "amazonprime.controller.tier.single", "Amazon Warehousing Depot.").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Amazon packager multiblock
+ GregtechItemList.Amazon_Warehouse_Controller.set(
+ new GMTE_AmazonPackager(942, "amazonprime.controller.tier.single", "Amazon Warehousing Depot.")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java
index 43a9402be2..62bbb93ffd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java
@@ -1,9 +1,6 @@
/*
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock.GregtechMetaTileEntity_BedrockMiningPlatform1;
public class GregtechBedrockPlatforms {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java
index 339fac0c8f..075784d85d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java
@@ -6,59 +6,148 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DynamoBuffer;
public class GregtechBufferDynamos {
- private static int mID = 899;
- public static void run() {
- run2();
- }
-
- private static final void run2() {
- GregtechItemList.Hatch_Buffer_Dynamo_ULV.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.00", "ULV Dynamo Hatch [Buffered]", 0).getStackForm(1L));
- GregtechItemList.Hatch_Buffer_Dynamo_LV.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.01", "LV Dynamo Hatch [Buffered]", 1).getStackForm(1L));
- GregtechItemList.Hatch_Buffer_Dynamo_MV.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.02", "MV Dynamo Hatch [Buffered]", 2).getStackForm(1L));
- GregtechItemList.Hatch_Buffer_Dynamo_HV.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.03", "HV Dynamo Hatch [Buffered]", 3).getStackForm(1L));
- GregtechItemList.Hatch_Buffer_Dynamo_EV.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.04", "EV Dynamo Hatch [Buffered]", 4).getStackForm(1L));
- GregtechItemList.Hatch_Buffer_Dynamo_IV.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.05", "IV Dynamo Hatch [Buffered]", 5).getStackForm(1L));
- GregtechItemList.Hatch_Buffer_Dynamo_LuV.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.06", "LuV Dynamo Hatch [Buffered]", 6).getStackForm(1L));
- GregtechItemList.Hatch_Buffer_Dynamo_ZPM.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.07", "ZPM Dynamo Hatch [Buffered]", 7).getStackForm(1L));
- GregtechItemList.Hatch_Buffer_Dynamo_UV.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.08", "UV Dynamo Hatch [Buffered]", 8).getStackForm(1L));
- GregtechItemList.Hatch_Buffer_Dynamo_MAX.set(
- new GT_MetaTileEntity_Hatch_DynamoBuffer(mID++, "hatch.dynamo.buffer.tier.09", "UHV Dynamo Hatch [Buffered]", 9).getStackForm(1L));
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_ULV.get(1L, new Object[0]), bitsd,
- new Object[]{"TMC", 'M', ItemList.Hatch_Dynamo_ULV, 'T', CI.getTieredCircuit(0), 'C', OrePrefixes.cableGt04.get((Object) Materials.Lead)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_LV.get(1L, new Object[0]), bitsd,
- new Object[]{"TMC", 'M', ItemList.Hatch_Dynamo_LV, 'T', CI.getTieredCircuit(1), 'C', OrePrefixes.cableGt04.get((Object) Materials.Tin)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_MV.get(1L, new Object[0]), bitsd, new Object[]{"TMC", 'M',
- ItemList.Hatch_Dynamo_MV, 'T', CI.getTieredCircuit(2), 'C', OrePrefixes.cableGt04.get((Object) Materials.AnyCopper)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_HV.get(1L, new Object[0]), bitsd,
- new Object[]{"TMC", 'M', ItemList.Hatch_Dynamo_HV, 'T', CI.getTieredCircuit(3), 'C', OrePrefixes.cableGt04.get((Object) Materials.Gold)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_EV.get(1L, new Object[0]), bitsd, new Object[]{"TMC", 'M',
- ItemList.Hatch_Dynamo_EV, 'T', CI.getTieredCircuit(4), 'C', OrePrefixes.cableGt04.get((Object) Materials.Aluminium)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_IV.get(1L, new Object[0]), bitsd, new Object[]{"TMC", 'M',
- ItemList.Hatch_Dynamo_IV, 'T', CI.getTieredCircuit(5), 'C', OrePrefixes.cableGt04.get((Object) Materials.Tungsten)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_LuV.get(1L, new Object[0]), bitsd, new Object[]{"TMC",
- 'M', ItemList.Hatch_Dynamo_LuV, 'T', CI.getTieredCircuit(6), 'C', OrePrefixes.cableGt04.get((Object) Materials.VanadiumGallium)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_ZPM.get(1L, new Object[0]), bitsd, new Object[]{"TMC",
- 'M', ItemList.Hatch_Dynamo_ZPM, 'T', CI.getTieredCircuit(7), 'C', OrePrefixes.cableGt04.get((Object) Materials.Naquadah)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_UV.get(1L, new Object[0]), bitsd, new Object[]{"TMC", 'M',
- ItemList.Hatch_Dynamo_UV, 'T', CI.getTieredCircuit(8), 'C', OrePrefixes.wireGt12.get((Object) Materials.NaquadahAlloy)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Buffer_Dynamo_MAX.get(1L, new Object[0]), bitsd, new Object[]{"TMC",
- 'M', ItemList.Hatch_Dynamo_MAX, 'T', CI.getTieredCircuit(9), 'C', OrePrefixes.wireGt04.get((Object) Materials.Superconductor)});
- }
-
+ private static int mID = 899;
+
+ public static void run() {
+ run2();
+ }
+
+ private static final void run2() {
+ GregtechItemList.Hatch_Buffer_Dynamo_ULV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.00", "ULV Dynamo Hatch [Buffered]", 0)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Buffer_Dynamo_LV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.01", "LV Dynamo Hatch [Buffered]", 1)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Buffer_Dynamo_MV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.02", "MV Dynamo Hatch [Buffered]", 2)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Buffer_Dynamo_HV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.03", "HV Dynamo Hatch [Buffered]", 3)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Buffer_Dynamo_EV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.04", "EV Dynamo Hatch [Buffered]", 4)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Buffer_Dynamo_IV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.05", "IV Dynamo Hatch [Buffered]", 5)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Buffer_Dynamo_LuV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.06", "LuV Dynamo Hatch [Buffered]", 6)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Buffer_Dynamo_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.07", "ZPM Dynamo Hatch [Buffered]", 7)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Buffer_Dynamo_UV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.08", "UV Dynamo Hatch [Buffered]", 8)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Buffer_Dynamo_MAX.set(new GT_MetaTileEntity_Hatch_DynamoBuffer(
+ mID++, "hatch.dynamo.buffer.tier.09", "UHV Dynamo Hatch [Buffered]", 9)
+ .getStackForm(1L));
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_ULV.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_ULV,
+ 'T',
+ CI.getTieredCircuit(0),
+ 'C',
+ OrePrefixes.cableGt04.get((Object) Materials.Lead)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_LV.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_LV,
+ 'T',
+ CI.getTieredCircuit(1),
+ 'C',
+ OrePrefixes.cableGt04.get((Object) Materials.Tin)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_MV.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_MV,
+ 'T',
+ CI.getTieredCircuit(2),
+ 'C',
+ OrePrefixes.cableGt04.get((Object) Materials.AnyCopper)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_HV.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_HV,
+ 'T',
+ CI.getTieredCircuit(3),
+ 'C',
+ OrePrefixes.cableGt04.get((Object) Materials.Gold)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_EV.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_EV,
+ 'T',
+ CI.getTieredCircuit(4),
+ 'C',
+ OrePrefixes.cableGt04.get((Object) Materials.Aluminium)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_IV.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_IV,
+ 'T',
+ CI.getTieredCircuit(5),
+ 'C',
+ OrePrefixes.cableGt04.get((Object) Materials.Tungsten)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_LuV.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_LuV,
+ 'T',
+ CI.getTieredCircuit(6),
+ 'C',
+ OrePrefixes.cableGt04.get((Object) Materials.VanadiumGallium)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_ZPM.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_ZPM,
+ 'T',
+ CI.getTieredCircuit(7),
+ 'C',
+ OrePrefixes.cableGt04.get((Object) Materials.Naquadah)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_UV.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_UV,
+ 'T',
+ CI.getTieredCircuit(8),
+ 'C',
+ OrePrefixes.wireGt12.get((Object) Materials.NaquadahAlloy)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Buffer_Dynamo_MAX.get(1L, new Object[0]), bitsd, new Object[] {
+ "TMC",
+ 'M',
+ ItemList.Hatch_Dynamo_MAX,
+ 'T',
+ CI.getTieredCircuit(9),
+ 'C',
+ OrePrefixes.wireGt04.get((Object) Materials.Superconductor)
+ });
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java
index 73d29b2174..55a86a80d4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java
@@ -2,531 +2,750 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_ComponentAssemblers;
-import java.util.ArrayList;
-
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.*;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe;
import gregtech.api.util.GTPP_Recipe;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import java.util.ArrayList;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class GregtechComponentAssembler {
- public static void run() {
-
- if (!enableMachine_ComponentAssemblers) {
- return;
- }
-
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- Logger.INFO("Component Assemblers cannot be created in 5.08.33 during the pre-release. Please wait for 1.7.0 release.");
- return;
- }
-
- GregtechItemList.Machine_LV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(985,
- "basicmachine.componentmaker.tier.01", "Basic Component Maker", 1, "Components, Unite!",
- GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false,
- false, 0, "ASSEMBLER",
- new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L));
- GregtechItemList.Machine_MV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(986,
- "basicmachine.componentmaker.tier.02", "Advanced Component Maker", 2, "Components, Unite!",
- GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false,
- false, 0, "ASSEMBLER",
- new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L));
- GregtechItemList.Machine_HV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(987,
- "basicmachine.componentmaker.tier.03", "Advanced Component Maker II", 3, "Components, Unite!",
- GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false,
- false, 0, "ASSEMBLER",
- new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L));
- GregtechItemList.Machine_EV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(988,
- "basicmachine.componentmaker.tier.04", "Advanced Component Maker III", 4, "Components, Unite!",
- GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false,
- false, 0, "ASSEMBLER",
- new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L));
- GregtechItemList.Machine_IV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(989,
- "basicmachine.componentmaker.tier.05", "Advanced Component Maker IV", 5, "Components, Unite!",
- GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false,
- false, 0, "ASSEMBLER",
- new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L));
- GregtechItemList.Machine_LuV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(31012,
- "basicmachine.componentmaker.tier.06", "Advanced Component Maker V", 6, "Components, Unite!",
- GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 24000, 0, 1, "Assembler.png", "", false,
- false, 0, "ASSEMBLER",
- new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L));
- GregtechItemList.Machine_ZPM_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(31013,
- "basicmachine.componentmaker.tier.07", "Advanced Component Maker VI", 7, "Components, Unite!",
- GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 32000, 0, 1, "Assembler.png", "", false,
- false, 0, "ASSEMBLER",
- new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L));
- GregtechItemList.Machine_UV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(31014,
- "basicmachine.componentmaker.tier.08", "Advanced Component Maker VII", 8, "Components, Unite!",
- GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 48000, 0, 1, "Assembler.png", "", false,
- false, 0, "ASSEMBLER",
- new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L));
-
- // Motors
- // addRecipeMotor(0, Materials.Lead, 1, Materials.RedAlloy, 1,
- // Materials.WroughtIron, Materials.IronMagnetic);
- addRecipeMotor(1, Materials.Copper, 1, Materials.Tin, 1, Materials.Iron, Materials.IronMagnetic);
- addRecipeMotor(2, Materials.Copper, 2, Materials.Copper, 1, Materials.Aluminium, Materials.SteelMagnetic);
- addRecipeMotor(3, Materials.Copper, 4, Materials.Gold, 1, Materials.StainlessSteel, Materials.SteelMagnetic);
- addRecipeMotor(4, Materials.Copper, 8, Materials.Aluminium, 1, Materials.Titanium, Materials.NeodymiumMagnetic);
- addRecipeMotor(5, Materials.Copper, 16, Materials.Tungsten, 1, Materials.TungstenSteel,
- Materials.NeodymiumMagnetic);
-
- // Pistons
- // addRecipePiston(0, Materials.Lead, Materials.Lead);
- addRecipePiston(1, Materials.Steel, Materials.Tin);
- addRecipePiston(2, Materials.Aluminium, Materials.Copper);
- addRecipePiston(3, Materials.StainlessSteel, Materials.Gold);
- addRecipePiston(4, Materials.Titanium, Materials.Aluminium);
- addRecipePiston(5, Materials.TungstenSteel, Materials.Tungsten);
-
- // Conveyors
- // addRecipeConveyor(0, Materials.Lead);
- addRecipeConveyor(1, Materials.Tin);
- addRecipeConveyor(2, Materials.Copper);
- addRecipeConveyor(3, Materials.Gold);
- addRecipeConveyor(4, Materials.Aluminium);
- addRecipeConveyor(5, Materials.Tungsten);
-
- // Pumps
- // addRecipePump(0, Materials.Lead, Materials.Lead, Materials.Lead);
- addRecipePump(1, Materials.Tin, Materials.Copper, Materials.Tin);
- addRecipePump(2, Materials.Bronze, Materials.Steel, Materials.Copper);
- addRecipePump(3, Materials.Steel, Materials.StainlessSteel, Materials.Gold);
- addRecipePump(4, Materials.StainlessSteel, Materials.Titanium, Materials.Aluminium);
- addRecipePump(5, Materials.TungstenSteel, Materials.TungstenSteel, Materials.Tungsten);
-
- // Robot Arms
- // addRecipeRobotArm(0, Materials.Lead, Materials.Lead);
- addRecipeRobotArm(1, Materials.Steel, Materials.Tin);
- addRecipeRobotArm(2, Materials.Aluminium, Materials.Copper);
- addRecipeRobotArm(3, Materials.StainlessSteel, Materials.Gold);
- addRecipeRobotArm(4, Materials.Titanium, Materials.Aluminium);
- addRecipeRobotArm(5, Materials.TungstenSteel, Materials.Tungsten);
-
- // Field Generators
- // addRecipeFieldGenerator(0, Materials.Lead);
- addRecipeFieldGenerator(1);
- addRecipeFieldGenerator(2);
- addRecipeFieldGenerator(3);
- addRecipeFieldGenerator(4);
- addRecipeFieldGenerator(5);
-
- // Emitters
- // addRecipeEmitter(0, Materials.Lead, Materials.IronMagnetic);
- addRecipeEmitter(1, Materials.Tin, Materials.Brass, Materials.Quartzite);
- addRecipeEmitter(2, Materials.Copper, Materials.Electrum, Materials.NetherQuartz);
- addRecipeEmitter(3, Materials.Gold, Materials.Chrome, Materials.Emerald);
- addRecipeEmitter(4, Materials.Aluminium, Materials.Platinum, Materials.EnderPearl);
- addRecipeEmitter(5, Materials.Tungsten, Materials.Osmium, Materials.EnderEye);
-
- // Sensors
- // addRecipeSensor(0, Materials.WroughtIron, Materials.IronMagnetic,
- // Materials.Apatite);
- addRecipeSensor(1, Materials.Steel, Materials.Brass, Materials.Quartzite);
- addRecipeSensor(2, Materials.Aluminium, Materials.Electrum, Materials.NetherQuartz);
- addRecipeSensor(3, Materials.StainlessSteel, Materials.Chrome, Materials.Emerald);
- addRecipeSensor(4, Materials.Titanium, Materials.Platinum, Materials.EnderPearl);
- addRecipeSensor(5, Materials.TungstenSteel, Materials.Osmium, Materials.EnderEye);
-
- }
-
- private static boolean addRecipeMotor(int tier, Materials wire, int wirethickness, Materials cable,
- int cablethickness, Materials stick, Materials magstick) {
- try {
- String mWT = "" + wirethickness;
- String mCT = "" + cablethickness;
-
- if (wirethickness < 10) {
- mWT = "0" + wirethickness;
- }
- if (cablethickness < 10) {
- mCT = "0" + cablethickness;
- }
-
- OrePrefixes prefixWire = OrePrefixes.getOrePrefix("wireGt" + mWT);
- OrePrefixes prefixCable = OrePrefixes.getOrePrefix("cableGt" + mCT);
-
- ItemStack wireStack = ItemUtils.getGregtechOreStack(prefixWire, wire, 4);
- ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 2);
- ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 2);
- ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, magstick, 1);
-
- ItemStack Input[] = { wireStack, cableStack, rodStack, magrodStack };
-
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getElectricMotor(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- private static boolean addRecipePiston(int tier, Materials mat, Materials cable) {
- try {
-
- OrePrefixes prefixCable = OrePrefixes.cableGt01;
- ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 2);
- ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, mat, 2);
- ItemStack plateStack = ItemUtils.getGregtechOreStack(OrePrefixes.plate, mat, 3);
- ItemStack gearStack = ItemUtils.getGregtechOreStack(OrePrefixes.gearGtSmall, mat, 1);
- ItemStack motorStack = CI.getElectricMotor(tier, 1);
-
- ItemStack Input[] = { plateStack, cableStack, rodStack, gearStack, motorStack };
-
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getElectricPiston(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- private static boolean addRecipeConveyor(int tier, Materials cable) {
- try {
- OrePrefixes prefixCable = OrePrefixes.cableGt01;
- ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 1);
- ItemStack motorStack = CI.getElectricMotor(tier, 2);
- boolean mAdd[];
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres("plateAnyRubber");
- if (!oreDictList.isEmpty()) {
- int mcount = 0;
- mAdd = new boolean[oreDictList.size()];
- for (ItemStack mRubberType : oreDictList) {
- final ItemStack returnValue = mRubberType.copy();
- returnValue.stackSize = 6;
- ItemStack Input[] = { cableStack, motorStack, returnValue };
- mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getConveyor(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
- int added = 0;
- for (boolean y : mAdd) {
- if (y) {
- added++;
- }
- }
- if (added >= (oreDictList.size() / 2)) {
- return true;
- }
- else {
- return false;
- }
- }
- else {
- ItemStack Input[] = { cableStack, motorStack,
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateRubber", 6) };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getConveyor(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
-
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- private static boolean addRecipePump(int tier, Materials main, Materials pipe, Materials cable) {
- try {
- ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 1);
- ItemStack screwStack = ItemUtils.getGregtechOreStack(OrePrefixes.screw, main, 1);
- ItemStack rotorStack = ItemUtils.getGregtechOreStack(OrePrefixes.rotor, main, 1);
- ItemStack pipeStack = ItemUtils.getGregtechOreStack(OrePrefixes.pipeMedium, pipe, 1);
- ItemStack motorStack = CI.getElectricMotor(tier, 1);
- boolean mAdd[];
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres("ringAnyRubber");
- if (!oreDictList.isEmpty()) {
- int mcount = 0;
- mAdd = new boolean[oreDictList.size()];
- for (ItemStack mRubberType : oreDictList) {
- final ItemStack returnValue = mRubberType.copy();
- returnValue.stackSize = 2;
- ItemStack Input[] = { cableStack, screwStack, rotorStack, pipeStack, motorStack, returnValue };
- mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getElectricPump(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
- int added = 0;
- for (boolean y : mAdd) {
- if (y) {
- added++;
- }
- }
- if (added >= (oreDictList.size() / 2)) {
- return true;
- }
- else {
- return false;
- }
- }
- else {
- ItemStack Input[] = { cableStack, screwStack, rotorStack, pipeStack, motorStack,
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ringRubber", 2) };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getElectricPump(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
-
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- private static boolean addRecipeRobotArm(int tier, Materials stick, Materials cable) {
- try {
- ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 3);
- ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 2);
- ItemStack motorStack = CI.getElectricMotor(tier, 2);
- ItemStack pistonStack = CI.getElectricPiston(tier, 1);
-
- boolean mAdd[];
- final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
- if (oreDictList.length > 0) {
- int mcount = 0, added = 0;
- mAdd = new boolean[oreDictList.length];
- for (ItemStack mCircuitType : oreDictList) {
- final ItemStack returnValue = mCircuitType.copy();
- returnValue.stackSize = 1;
- ItemStack Input[] = { returnValue, cableStack, rodStack, pistonStack, motorStack };
- mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getRobotArm(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
- for (boolean y : mAdd) {
- if (y) {
- added++;
- }
- }
- if (added >= (oreDictList.length / 2)) {
- return true;
- }
- else {
- return false;
- }
- }
- else {
- ItemStack Input[] = { ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1), cableStack, rodStack, pistonStack, motorStack };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getRobotArm(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
-
-
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- private static boolean addRecipeFieldGenerator(int tier) {
- try {
- ItemStack gem;
- String mWT;
- if (tier == 1)
- mWT = "01";
- else if (tier == 2)
- mWT = "02";
- else if (tier == 3)
- mWT = "04";
- else if (tier == 4)
- mWT = "08";
- else if (tier == 5)
- mWT = "16";
- else
- mWT = "01";
-
- ItemStack eyeQuantum = ItemUtils.getValueOfItemList("QuantumEye", 1, ItemUtils.getSimpleStack(Items.ender_eye, 4));
- ItemStack starQuantum = ItemUtils.getValueOfItemList("QuantumStar", 1, ItemUtils.getSimpleStack(Items.nether_star, 4));
-
- if (tier == 1)
- gem = ItemUtils.getSimpleStack(Items.ender_pearl);
- else if (tier == 2)
- gem = ItemUtils.getSimpleStack(Items.ender_eye);
- else if (tier == 3)
- gem = eyeQuantum;
- else if (tier == 4)
- gem = ItemUtils.getSimpleStack(Items.nether_star);
- else if (tier == 5)
- gem = starQuantum;
- else
- gem = ItemUtils.getSimpleStack(Items.ender_pearl);
-
- OrePrefixes prefixWire = OrePrefixes.getOrePrefix("wireGt" + mWT);
- ItemStack wireStack = ItemUtils.getGregtechOreStack(prefixWire, Materials.Osmium, 4);
-
- boolean mAdd[];
- final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
- if (oreDictList.length > 0) {
- int mcount = 0, added = 0;
- mAdd = new boolean[oreDictList.length];
- for (ItemStack mCircuitType : oreDictList) {
- final ItemStack returnValue = mCircuitType.copy();
- returnValue.stackSize = 4;
- ItemStack Input[] = { returnValue, wireStack, gem };
- mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getFieldGenerator(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
- for (boolean y : mAdd) {
- if (y) {
- added++;
- }
- }
- if (added >= (oreDictList.length / 2)) {
- return true;
- }
- else {
- return false;
- }
- }
- else {
- ItemStack Input[] = { ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 4), wireStack, gem };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getFieldGenerator(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
-
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- private static boolean addRecipeEmitter(int tier, Materials cable, Materials stick, Materials gem) {
- try {
- ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 2);
- ItemStack gemstack = ItemUtils.getGregtechOreStack(OrePrefixes.gem, gem, 1);
- ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 4);
-
- boolean mAdd[];
- final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
- if (oreDictList.length > 0) {
- int mcount = 0, added = 0;
- mAdd = new boolean[oreDictList.length];
- for (ItemStack mCircuitType : oreDictList) {
- final ItemStack returnValue = mCircuitType.copy();
- returnValue.stackSize = 2;
- ItemStack Input[] = { returnValue, cableStack, gemstack, magrodStack };
- mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getEmitter(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
- for (boolean y : mAdd) {
- if (y) {
- added++;
- }
- }
- if (added >= (oreDictList.length / 2)) {
- return true;
- }
- else {
- return false;
- }
- }
- else {
- ItemStack Input[] = { ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 2), cableStack, gemstack, magrodStack };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getEmitter(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
-
-
-
- }
- catch (Throwable t) {
- return false;
- }
- }
-
- private static boolean addRecipeSensor(int tier, Materials plate, Materials rod, Materials gem) {
- try {
- ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.plate, plate, 4);
- ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, rod, 1);
- ItemStack gemStack = ItemUtils.getGregtechOreStack(OrePrefixes.gem, gem, 1);
-
- boolean mAdd[];
- final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
- if (oreDictList.length > 0) {
- int mcount = 0, added = 0;
- mAdd = new boolean[oreDictList.length];
- for (ItemStack mCircuitType : oreDictList) {
- final ItemStack returnValue = mCircuitType.copy();
- returnValue.stackSize = 1;
- ItemStack Input[] = { gemStack, cableStack, returnValue, magrodStack };
- mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getSensor(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
- for (boolean y : mAdd) {
- if (y) {
- added++;
- }
- }
- if (added >= (oreDictList.length / 2)) {
- return true;
- }
- else {
- return false;
- }
- }
- else {
- ItemStack Input[] = { gemStack, cableStack, magrodStack, ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1) };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- CI.getSensor(tier, 1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
- }
-
-
- }
- catch (Throwable t) {
- return false;
- }
- }
-
+ public static void run() {
+
+ if (!enableMachine_ComponentAssemblers) {
+ return;
+ }
+
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ Logger.INFO(
+ "Component Assemblers cannot be created in 5.08.33 during the pre-release. Please wait for 1.7.0 release.");
+ return;
+ }
+
+ GregtechItemList.Machine_LV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 985,
+ "basicmachine.componentmaker.tier.01",
+ "Basic Component Maker",
+ 1,
+ "Components, Unite!",
+ GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes,
+ 6,
+ 1,
+ 16000,
+ 0,
+ 1,
+ "Assembler.png",
+ "",
+ false,
+ false,
+ 0,
+ "ASSEMBLER",
+ new Object[] {
+ "ACA",
+ "VMV",
+ "WCW",
+ 'M',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL,
+ 'V',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM,
+ 'A',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON,
+ 'C',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT,
+ 'W',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4
+ })
+ .getStackForm(1L));
+ GregtechItemList.Machine_MV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 986,
+ "basicmachine.componentmaker.tier.02",
+ "Advanced Component Maker",
+ 2,
+ "Components, Unite!",
+ GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes,
+ 6,
+ 1,
+ 16000,
+ 0,
+ 1,
+ "Assembler.png",
+ "",
+ false,
+ false,
+ 0,
+ "ASSEMBLER",
+ new Object[] {
+ "ACA",
+ "VMV",
+ "WCW",
+ 'M',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL,
+ 'V',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM,
+ 'A',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON,
+ 'C',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT,
+ 'W',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4
+ })
+ .getStackForm(1L));
+ GregtechItemList.Machine_HV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 987,
+ "basicmachine.componentmaker.tier.03",
+ "Advanced Component Maker II",
+ 3,
+ "Components, Unite!",
+ GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes,
+ 6,
+ 1,
+ 16000,
+ 0,
+ 1,
+ "Assembler.png",
+ "",
+ false,
+ false,
+ 0,
+ "ASSEMBLER",
+ new Object[] {
+ "ACA",
+ "VMV",
+ "WCW",
+ 'M',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL,
+ 'V',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM,
+ 'A',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON,
+ 'C',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT,
+ 'W',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4
+ })
+ .getStackForm(1L));
+ GregtechItemList.Machine_EV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 988,
+ "basicmachine.componentmaker.tier.04",
+ "Advanced Component Maker III",
+ 4,
+ "Components, Unite!",
+ GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes,
+ 6,
+ 1,
+ 16000,
+ 0,
+ 1,
+ "Assembler.png",
+ "",
+ false,
+ false,
+ 0,
+ "ASSEMBLER",
+ new Object[] {
+ "ACA",
+ "VMV",
+ "WCW",
+ 'M',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL,
+ 'V',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM,
+ 'A',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON,
+ 'C',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT,
+ 'W',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4
+ })
+ .getStackForm(1L));
+ GregtechItemList.Machine_IV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 989,
+ "basicmachine.componentmaker.tier.05",
+ "Advanced Component Maker IV",
+ 5,
+ "Components, Unite!",
+ GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes,
+ 6,
+ 1,
+ 16000,
+ 0,
+ 1,
+ "Assembler.png",
+ "",
+ false,
+ false,
+ 0,
+ "ASSEMBLER",
+ new Object[] {
+ "ACA",
+ "VMV",
+ "WCW",
+ 'M',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL,
+ 'V',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM,
+ 'A',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON,
+ 'C',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT,
+ 'W',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4
+ })
+ .getStackForm(1L));
+ GregtechItemList.Machine_LuV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 31012,
+ "basicmachine.componentmaker.tier.06",
+ "Advanced Component Maker V",
+ 6,
+ "Components, Unite!",
+ GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes,
+ 6,
+ 1,
+ 24000,
+ 0,
+ 1,
+ "Assembler.png",
+ "",
+ false,
+ false,
+ 0,
+ "ASSEMBLER",
+ new Object[] {
+ "ACA",
+ "VMV",
+ "WCW",
+ 'M',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL,
+ 'V',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM,
+ 'A',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON,
+ 'C',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT,
+ 'W',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4
+ })
+ .getStackForm(1L));
+ GregtechItemList.Machine_ZPM_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 31013,
+ "basicmachine.componentmaker.tier.07",
+ "Advanced Component Maker VI",
+ 7,
+ "Components, Unite!",
+ GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes,
+ 6,
+ 1,
+ 32000,
+ 0,
+ 1,
+ "Assembler.png",
+ "",
+ false,
+ false,
+ 0,
+ "ASSEMBLER",
+ new Object[] {
+ "ACA",
+ "VMV",
+ "WCW",
+ 'M',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL,
+ 'V',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM,
+ 'A',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON,
+ 'C',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT,
+ 'W',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4
+ })
+ .getStackForm(1L));
+ GregtechItemList.Machine_UV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 31014,
+ "basicmachine.componentmaker.tier.08",
+ "Advanced Component Maker VII",
+ 8,
+ "Components, Unite!",
+ GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes,
+ 6,
+ 1,
+ 48000,
+ 0,
+ 1,
+ "Assembler.png",
+ "",
+ false,
+ false,
+ 0,
+ "ASSEMBLER",
+ new Object[] {
+ "ACA",
+ "VMV",
+ "WCW",
+ 'M',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL,
+ 'V',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM,
+ 'A',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON,
+ 'C',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT,
+ 'W',
+ GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4
+ })
+ .getStackForm(1L));
+
+ // Motors
+ // addRecipeMotor(0, Materials.Lead, 1, Materials.RedAlloy, 1,
+ // Materials.WroughtIron, Materials.IronMagnetic);
+ addRecipeMotor(1, Materials.Copper, 1, Materials.Tin, 1, Materials.Iron, Materials.IronMagnetic);
+ addRecipeMotor(2, Materials.Copper, 2, Materials.Copper, 1, Materials.Aluminium, Materials.SteelMagnetic);
+ addRecipeMotor(3, Materials.Copper, 4, Materials.Gold, 1, Materials.StainlessSteel, Materials.SteelMagnetic);
+ addRecipeMotor(4, Materials.Copper, 8, Materials.Aluminium, 1, Materials.Titanium, Materials.NeodymiumMagnetic);
+ addRecipeMotor(
+ 5, Materials.Copper, 16, Materials.Tungsten, 1, Materials.TungstenSteel, Materials.NeodymiumMagnetic);
+
+ // Pistons
+ // addRecipePiston(0, Materials.Lead, Materials.Lead);
+ addRecipePiston(1, Materials.Steel, Materials.Tin);
+ addRecipePiston(2, Materials.Aluminium, Materials.Copper);
+ addRecipePiston(3, Materials.StainlessSteel, Materials.Gold);
+ addRecipePiston(4, Materials.Titanium, Materials.Aluminium);
+ addRecipePiston(5, Materials.TungstenSteel, Materials.Tungsten);
+
+ // Conveyors
+ // addRecipeConveyor(0, Materials.Lead);
+ addRecipeConveyor(1, Materials.Tin);
+ addRecipeConveyor(2, Materials.Copper);
+ addRecipeConveyor(3, Materials.Gold);
+ addRecipeConveyor(4, Materials.Aluminium);
+ addRecipeConveyor(5, Materials.Tungsten);
+
+ // Pumps
+ // addRecipePump(0, Materials.Lead, Materials.Lead, Materials.Lead);
+ addRecipePump(1, Materials.Tin, Materials.Copper, Materials.Tin);
+ addRecipePump(2, Materials.Bronze, Materials.Steel, Materials.Copper);
+ addRecipePump(3, Materials.Steel, Materials.StainlessSteel, Materials.Gold);
+ addRecipePump(4, Materials.StainlessSteel, Materials.Titanium, Materials.Aluminium);
+ addRecipePump(5, Materials.TungstenSteel, Materials.TungstenSteel, Materials.Tungsten);
+
+ // Robot Arms
+ // addRecipeRobotArm(0, Materials.Lead, Materials.Lead);
+ addRecipeRobotArm(1, Materials.Steel, Materials.Tin);
+ addRecipeRobotArm(2, Materials.Aluminium, Materials.Copper);
+ addRecipeRobotArm(3, Materials.StainlessSteel, Materials.Gold);
+ addRecipeRobotArm(4, Materials.Titanium, Materials.Aluminium);
+ addRecipeRobotArm(5, Materials.TungstenSteel, Materials.Tungsten);
+
+ // Field Generators
+ // addRecipeFieldGenerator(0, Materials.Lead);
+ addRecipeFieldGenerator(1);
+ addRecipeFieldGenerator(2);
+ addRecipeFieldGenerator(3);
+ addRecipeFieldGenerator(4);
+ addRecipeFieldGenerator(5);
+
+ // Emitters
+ // addRecipeEmitter(0, Materials.Lead, Materials.IronMagnetic);
+ addRecipeEmitter(1, Materials.Tin, Materials.Brass, Materials.Quartzite);
+ addRecipeEmitter(2, Materials.Copper, Materials.Electrum, Materials.NetherQuartz);
+ addRecipeEmitter(3, Materials.Gold, Materials.Chrome, Materials.Emerald);
+ addRecipeEmitter(4, Materials.Aluminium, Materials.Platinum, Materials.EnderPearl);
+ addRecipeEmitter(5, Materials.Tungsten, Materials.Osmium, Materials.EnderEye);
+
+ // Sensors
+ // addRecipeSensor(0, Materials.WroughtIron, Materials.IronMagnetic,
+ // Materials.Apatite);
+ addRecipeSensor(1, Materials.Steel, Materials.Brass, Materials.Quartzite);
+ addRecipeSensor(2, Materials.Aluminium, Materials.Electrum, Materials.NetherQuartz);
+ addRecipeSensor(3, Materials.StainlessSteel, Materials.Chrome, Materials.Emerald);
+ addRecipeSensor(4, Materials.Titanium, Materials.Platinum, Materials.EnderPearl);
+ addRecipeSensor(5, Materials.TungstenSteel, Materials.Osmium, Materials.EnderEye);
+ }
+
+ private static boolean addRecipeMotor(
+ int tier,
+ Materials wire,
+ int wirethickness,
+ Materials cable,
+ int cablethickness,
+ Materials stick,
+ Materials magstick) {
+ try {
+ String mWT = "" + wirethickness;
+ String mCT = "" + cablethickness;
+
+ if (wirethickness < 10) {
+ mWT = "0" + wirethickness;
+ }
+ if (cablethickness < 10) {
+ mCT = "0" + cablethickness;
+ }
+
+ OrePrefixes prefixWire = OrePrefixes.getOrePrefix("wireGt" + mWT);
+ OrePrefixes prefixCable = OrePrefixes.getOrePrefix("cableGt" + mCT);
+
+ ItemStack wireStack = ItemUtils.getGregtechOreStack(prefixWire, wire, 4);
+ ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 2);
+ ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 2);
+ ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, magstick, 1);
+
+ ItemStack Input[] = {wireStack, cableStack, rodStack, magrodStack};
+
+ return CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getElectricMotor(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ private static boolean addRecipePiston(int tier, Materials mat, Materials cable) {
+ try {
+
+ OrePrefixes prefixCable = OrePrefixes.cableGt01;
+ ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 2);
+ ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, mat, 2);
+ ItemStack plateStack = ItemUtils.getGregtechOreStack(OrePrefixes.plate, mat, 3);
+ ItemStack gearStack = ItemUtils.getGregtechOreStack(OrePrefixes.gearGtSmall, mat, 1);
+ ItemStack motorStack = CI.getElectricMotor(tier, 1);
+
+ ItemStack Input[] = {plateStack, cableStack, rodStack, gearStack, motorStack};
+
+ return CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getElectricPiston(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ private static boolean addRecipeConveyor(int tier, Materials cable) {
+ try {
+ OrePrefixes prefixCable = OrePrefixes.cableGt01;
+ ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 1);
+ ItemStack motorStack = CI.getElectricMotor(tier, 2);
+ boolean mAdd[];
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres("plateAnyRubber");
+ if (!oreDictList.isEmpty()) {
+ int mcount = 0;
+ mAdd = new boolean[oreDictList.size()];
+ for (ItemStack mRubberType : oreDictList) {
+ final ItemStack returnValue = mRubberType.copy();
+ returnValue.stackSize = 6;
+ ItemStack Input[] = {cableStack, motorStack, returnValue};
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getConveyor(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ int added = 0;
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.size() / 2)) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ ItemStack Input[] = {
+ cableStack, motorStack, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateRubber", 6)
+ };
+ return CORE.RA.addComponentMakerRecipe(
+ Input, GT_Values.NF, CI.getConveyor(tier, 1), (tier * 40), ((int) GT_Values.V[tier] / 16) * 15);
+ }
+
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ private static boolean addRecipePump(int tier, Materials main, Materials pipe, Materials cable) {
+ try {
+ ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 1);
+ ItemStack screwStack = ItemUtils.getGregtechOreStack(OrePrefixes.screw, main, 1);
+ ItemStack rotorStack = ItemUtils.getGregtechOreStack(OrePrefixes.rotor, main, 1);
+ ItemStack pipeStack = ItemUtils.getGregtechOreStack(OrePrefixes.pipeMedium, pipe, 1);
+ ItemStack motorStack = CI.getElectricMotor(tier, 1);
+ boolean mAdd[];
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres("ringAnyRubber");
+ if (!oreDictList.isEmpty()) {
+ int mcount = 0;
+ mAdd = new boolean[oreDictList.size()];
+ for (ItemStack mRubberType : oreDictList) {
+ final ItemStack returnValue = mRubberType.copy();
+ returnValue.stackSize = 2;
+ ItemStack Input[] = {cableStack, screwStack, rotorStack, pipeStack, motorStack, returnValue};
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getElectricPump(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ int added = 0;
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.size() / 2)) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ ItemStack Input[] = {
+ cableStack,
+ screwStack,
+ rotorStack,
+ pipeStack,
+ motorStack,
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ringRubber", 2)
+ };
+ return CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getElectricPump(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ private static boolean addRecipeRobotArm(int tier, Materials stick, Materials cable) {
+ try {
+ ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 3);
+ ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 2);
+ ItemStack motorStack = CI.getElectricMotor(tier, 2);
+ ItemStack pistonStack = CI.getElectricPiston(tier, 1);
+
+ boolean mAdd[];
+ final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
+ if (oreDictList.length > 0) {
+ int mcount = 0, added = 0;
+ mAdd = new boolean[oreDictList.length];
+ for (ItemStack mCircuitType : oreDictList) {
+ final ItemStack returnValue = mCircuitType.copy();
+ returnValue.stackSize = 1;
+ ItemStack Input[] = {returnValue, cableStack, rodStack, pistonStack, motorStack};
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getRobotArm(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.length / 2)) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ ItemStack Input[] = {
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1),
+ cableStack,
+ rodStack,
+ pistonStack,
+ motorStack
+ };
+ return CORE.RA.addComponentMakerRecipe(
+ Input, GT_Values.NF, CI.getRobotArm(tier, 1), (tier * 40), ((int) GT_Values.V[tier] / 16) * 15);
+ }
+
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ private static boolean addRecipeFieldGenerator(int tier) {
+ try {
+ ItemStack gem;
+ String mWT;
+ if (tier == 1) mWT = "01";
+ else if (tier == 2) mWT = "02";
+ else if (tier == 3) mWT = "04";
+ else if (tier == 4) mWT = "08";
+ else if (tier == 5) mWT = "16";
+ else mWT = "01";
+
+ ItemStack eyeQuantum =
+ ItemUtils.getValueOfItemList("QuantumEye", 1, ItemUtils.getSimpleStack(Items.ender_eye, 4));
+ ItemStack starQuantum =
+ ItemUtils.getValueOfItemList("QuantumStar", 1, ItemUtils.getSimpleStack(Items.nether_star, 4));
+
+ if (tier == 1) gem = ItemUtils.getSimpleStack(Items.ender_pearl);
+ else if (tier == 2) gem = ItemUtils.getSimpleStack(Items.ender_eye);
+ else if (tier == 3) gem = eyeQuantum;
+ else if (tier == 4) gem = ItemUtils.getSimpleStack(Items.nether_star);
+ else if (tier == 5) gem = starQuantum;
+ else gem = ItemUtils.getSimpleStack(Items.ender_pearl);
+
+ OrePrefixes prefixWire = OrePrefixes.getOrePrefix("wireGt" + mWT);
+ ItemStack wireStack = ItemUtils.getGregtechOreStack(prefixWire, Materials.Osmium, 4);
+
+ boolean mAdd[];
+ final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
+ if (oreDictList.length > 0) {
+ int mcount = 0, added = 0;
+ mAdd = new boolean[oreDictList.length];
+ for (ItemStack mCircuitType : oreDictList) {
+ final ItemStack returnValue = mCircuitType.copy();
+ returnValue.stackSize = 4;
+ ItemStack Input[] = {returnValue, wireStack, gem};
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getFieldGenerator(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.length / 2)) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ ItemStack Input[] = {
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 4), wireStack, gem
+ };
+ return CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getFieldGenerator(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ private static boolean addRecipeEmitter(int tier, Materials cable, Materials stick, Materials gem) {
+ try {
+ ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 2);
+ ItemStack gemstack = ItemUtils.getGregtechOreStack(OrePrefixes.gem, gem, 1);
+ ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 4);
+
+ boolean mAdd[];
+ final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
+ if (oreDictList.length > 0) {
+ int mcount = 0, added = 0;
+ mAdd = new boolean[oreDictList.length];
+ for (ItemStack mCircuitType : oreDictList) {
+ final ItemStack returnValue = mCircuitType.copy();
+ returnValue.stackSize = 2;
+ ItemStack Input[] = {returnValue, cableStack, gemstack, magrodStack};
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getEmitter(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.length / 2)) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ ItemStack Input[] = {
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 2),
+ cableStack,
+ gemstack,
+ magrodStack
+ };
+ return CORE.RA.addComponentMakerRecipe(
+ Input, GT_Values.NF, CI.getEmitter(tier, 1), (tier * 40), ((int) GT_Values.V[tier] / 16) * 15);
+ }
+
+ } catch (Throwable t) {
+ return false;
+ }
+ }
+
+ private static boolean addRecipeSensor(int tier, Materials plate, Materials rod, Materials gem) {
+ try {
+ ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.plate, plate, 4);
+ ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, rod, 1);
+ ItemStack gemStack = ItemUtils.getGregtechOreStack(OrePrefixes.gem, gem, 1);
+
+ boolean mAdd[];
+ final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
+ if (oreDictList.length > 0) {
+ int mcount = 0, added = 0;
+ mAdd = new boolean[oreDictList.length];
+ for (ItemStack mCircuitType : oreDictList) {
+ final ItemStack returnValue = mCircuitType.copy();
+ returnValue.stackSize = 1;
+ ItemStack Input[] = {gemStack, cableStack, returnValue, magrodStack};
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(
+ Input,
+ GT_Values.NF,
+ CI.getSensor(tier, 1),
+ (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.length / 2)) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ ItemStack Input[] = {
+ gemStack,
+ cableStack,
+ magrodStack,
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1)
+ };
+ return CORE.RA.addComponentMakerRecipe(
+ Input, GT_Values.NF, CI.getSensor(tier, 1), (tier * 40), ((int) GT_Values.V[tier] / 16) * 15);
+ }
+
+ } catch (Throwable t) {
+ return false;
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
index cfbcf1c7b8..ac96cc4d07 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
@@ -3,10 +3,6 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech;
import static gtPlusPlus.core.lib.CORE.GTNH;
import static gtPlusPlus.core.lib.LoadedMods.Gregtech;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -29,596 +25,1240 @@ import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntityFluid;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntity_Cable;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class GregtechConduits {
- /**
- *
- * The Voltage Tiers. Use this Array instead of the old named Voltage Variables
- * public static final long[] V = new long[] {0=8, 1=32, 2=128, 3=512, 4=2048, 5=8192, 6=32768, 7=131072, 8=524288, 9=Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE};
- *
- */
-
- public static OrePrefixes cableGt16;
- static{
- if(GTNH) {
- try {
- cableGt16=(OrePrefixes) GT_Utility.getField(OrePrefixes.class,"cableGt16").get(null);
- }catch (IllegalAccessException | NullPointerException e){
- e.printStackTrace();
- }
- }
- }
-
- //30000-30999
-
- private static int BaseWireID = 30600;
- private static int BasePipeID = 30700;
- private static int BasePipeHexadecupleID = 30100;
-
-
- public static void run()
- {
- if (Gregtech){
- Logger.INFO("Gregtech5u Content | Registering Custom Cables/Wires/Pipes.");
- if (CORE.ConfigSwitches.enableCustom_Cables) {
- run1();
- }
- if (CORE.ConfigSwitches.enableCustom_Pipes) {
- run2();
- run3();
- }
- }
-
- }
-
- private static void run3() {
-
- if (Utils.getGregtechVersionAsInt() >= 50930) {
- try {
- Class<GT_MetaPipeEntity_Fluid> aPipeEntity = GT_MetaPipeEntity_Fluid.class;
- Constructor<GT_MetaPipeEntity_Fluid> constructor = aPipeEntity.getConstructor(int.class, String.class, String.class, float.class, Materials.class, int.class, int.class, boolean.class, int.class);
- if (constructor != null) {
- Logger.INFO("Generating Hexadecuple pipes.");
- generateFluidMultiPipes(constructor, Materials.Copper, MaterialUtils.getMaterialName(Materials.Copper), "Copper", BasePipeHexadecupleID++, 60, 1000, true);
- generateFluidMultiPipes(constructor, Materials.Bronze, MaterialUtils.getMaterialName(Materials.Bronze), "Bronze", BasePipeHexadecupleID++, 120, 2000, true);
- generateFluidMultiPipes(constructor, Materials.Steel, MaterialUtils.getMaterialName(Materials.Steel), "Steel", BasePipeHexadecupleID++, 240, 2500, true);
- generateFluidMultiPipes(constructor, Materials.StainlessSteel, MaterialUtils.getMaterialName(Materials.StainlessSteel), "Stainless Steel", BasePipeHexadecupleID++, 360, 3000, true);
- generateFluidMultiPipes(constructor, Materials.Titanium, MaterialUtils.getMaterialName(Materials.Titanium), "Titanium", BasePipeHexadecupleID++, 480, 5000, true);
- generateFluidMultiPipes(constructor, Materials.TungstenSteel, MaterialUtils.getMaterialName(Materials.TungstenSteel), "Tungsten Steel", BasePipeHexadecupleID++, 600, 7500, true);
- generateFluidMultiPipes(constructor, Materials.Plastic, MaterialUtils.getMaterialName(Materials.Plastic), "Plastic", BasePipeHexadecupleID++, 360, 350, true);
-
- Materials aPTFE = Materials.get("Polytetrafluoroethylene");
- if (aPTFE != null) {
- generateFluidMultiPipes(constructor, aPTFE, MaterialUtils.getMaterialName(aPTFE), "PTFE", BasePipeHexadecupleID++, 480, 600, true);
- }
- }
- else {
- Logger.INFO("Failed during Hexadecuple pipe generation.");
- }
-
- } catch (NoSuchMethodException | SecurityException e) {
- Logger.INFO("Failed during Hexadecuple pipe generation. [Ecx]");
- e.printStackTrace();
- }
- }
-
-
- //Generate Heat Pipes
- //GregtechItemList.HeatPipe_Tier_1.set(new GT_MetaPipeEntity_Heat(31021, "gtpp.pipe.heat.basic.01", "Lead Heat Pipe (500C)", Materials.Lead, 500).getStackForm(1L));
- //GregtechItemList.HeatPipe_Tier_2.set(new GT_MetaPipeEntity_Heat(31022, "gtpp.pipe.heat.basic.02", "Iron Heat Pipe (500C)", Materials.Iron, 500).getStackForm(1L));
- //GregtechItemList.HeatPipe_Tier_3.set(new GT_MetaPipeEntity_Heat(31023, "gtpp.pipe.heat.basic.03", "Silver Heat Pipe (1500C)", Materials.Silver, 1500).getStackForm(1L));
-
-
-
- }
-
- private static void generateFluidMultiPipes(Constructor<GT_MetaPipeEntity_Fluid> aClazz, Materials aMaterial, String name, String displayName, int startID, int transferRatePerSec, int heatCapacity, boolean gasProof){
- GT_MetaPipeEntity_Fluid aPipe;
- final int transferRatePerTick = transferRatePerSec / 20;
- try {
- aPipe = aClazz.newInstance(startID, "GT_Pipe_" + name + "_Hexadecuple",
- "Hexadecuple " + displayName + " Fluid Pipe", 1.0F, aMaterial, transferRatePerTick, heatCapacity, gasProof,
- 16);
- if (aPipe == null) {
- Logger.INFO("Failed to Generate "+aMaterial+" Hexadecuple pipes.");
- }
- else {
- Logger.INFO("Generated "+aMaterial+" Hexadecuple pipes.");
- GT_OreDictUnificator.registerOre("pipeHexadecuple" + aMaterial, aPipe.getStackForm(1L));
- }
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- Logger.INFO("Failed to Generate "+aMaterial+" Hexadecuple pipes. [Ecx]");
- e.printStackTrace();
- }
- }
-
- private static void run1(){
-
- if (LoadedMods.Big_Reactors){
- wireFactory("Blutonium", 8196, BaseWireID, 8, 32, 2, new short[]{28, 28, 218, 0});
- wireFactory("Cyanite", 512, BaseWireID+15, 2, 16, 4, new short[]{27, 130, 178, 0});
- wireFactory("Yellorium", 2048, BaseWireID+30, 4, 16, 2, new short[]{150, 195, 54, 0});
- }
-
- if (LoadedMods.EnderIO){
- wireFactory("RedstoneAlloy", 32, BaseWireID+45, 0, 2, 1, new short[]{178,34,34, 0});
- }
-
- if(!GTNH) {
- customWireFactory(ALLOY.LEAGRISIUM, 512, BaseWireID + 56, 1, 2, 2);
- customWireFactory(ELEMENT.getInstance().ZIRCONIUM, 128, BaseWireID + 67, 1, 2, 2);
- customWireFactory(ALLOY.HG1223, 32768, BaseWireID + 78, 2, 8, 4);
- customWireFactory(ALLOY.TRINIUM_TITANIUM, 2048, BaseWireID + 89, 1, 2, 16);
- }
-
- // need to go back id because fluid pipes already occupy
- makeCustomWires(ELEMENT.STANDALONE.HYPOGEN, BaseWireID - 15, 0, 0, 8, GT_Values.V[11], false, true);
-
-
- //superConductorFactory(GT_Materials.Superconductor, 524288, 30660, 0, 0, 8);
- if (LoadedMods.Thaumcraft){
- //superConductorFactory(GT_Materials.Void, 512, 30661, 0, 0, 8);
- }
- }
-
- private static void run2(){
- generateNonGTFluidPipes(GT_Materials.Staballoy, ALLOY.STABALLOY, BasePipeID, 12500, 7500, true);
- generateNonGTFluidPipes(GT_Materials.Tantalloy60, ALLOY.TANTALLOY_60, BasePipeID+5, 10000, 4250, true);
- generateNonGTFluidPipes(GT_Materials.Tantalloy61, ALLOY.TANTALLOY_61, BasePipeID+10, 12000, 5800, true);
- if (LoadedMods.Thaumcraft){
- generateNonGTFluidPipes(GT_Materials.Void, null, BasePipeID+15, 1600, 25000, true);
- }
- generateGTFluidPipes(Materials.Europium, BasePipeID+20, 12000, 7500, true);
- generateNonGTFluidPipes(GT_Materials.Potin, ALLOY.POTIN, BasePipeID+25, 500, 2000, true);
- generateNonGTFluidPipes(GT_Materials.MaragingSteel300, ALLOY.MARAGING300, BasePipeID+30, 14000, 2500, true);
- generateNonGTFluidPipes(GT_Materials.MaragingSteel350, ALLOY.MARAGING350, BasePipeID+35, 16000, 2500, true);
- generateNonGTFluidPipes(GT_Materials.Inconel690, ALLOY.INCONEL_690, BasePipeID+40, 15000, 4800, true);
- generateNonGTFluidPipes(GT_Materials.Inconel792, ALLOY.INCONEL_792, BasePipeID+45, 16000, 5500, true);
- generateNonGTFluidPipes(GT_Materials.HastelloyX, ALLOY.HASTELLOY_X, BasePipeID+50, 20000, 4200, true);
-
- generateGTFluidPipes(Materials.Tungsten, BasePipeID+55, 4320, 7200, true);
- if (LoadedMods.EnderIO){
- generateGTFluidPipes(Materials.DarkSteel, BasePipeID+60, 2320, 2750, true);
- }
- generateGTFluidPipes(Materials.Clay, BasePipeID+65, 100, 500, false);
- generateGTFluidPipes(Materials.Lead, BasePipeID+70, 350, 1200, true);
-
- generateNonGTFluidPipes(GT_Materials.TriniumNaquadahCarbonite, ALLOY.TRINIUM_NAQUADAH_CARBON, 30500, 20, 250000, true);
-
- }
-
- private static void wireFactory(final String Material, final int Voltage, final int ID, final long insulatedLoss, final long uninsulatedLoss, final long Amps, final short[] rgb){
- @SuppressWarnings("deprecation")
- final Materials T = Materials.valueOf(Material);
- int V = GT_Utility.getTier(Voltage);
- if (V == -1){
- Logger.ERROR("Failed to set voltage on "+Material+". Invalid voltage of "+Voltage+"V set.");
- Logger.ERROR(Material+" has defaulted to 8v.");
- V=0;
- }
- makeWires(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false, rgb);
- }
-
- @SuppressWarnings("deprecation")
- private static void makeWires(final Materials aMaterial, final int aStartID, final long aLossInsulated, final long aLoss, final long aAmperage, final long aVoltage, final boolean aInsulatable, final boolean aAutoInsulated, final short[] aRGB)
- {
- Logger.WARNING("Gregtech5u Content | Registered "+aMaterial.name() +" as a new material for Wire & Cable.");
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt01, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 0, "wire." + aMaterial.name().toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + " Wire", 0.125F, aMaterial, aLoss, 1L * aAmperage, aVoltage, false, !aAutoInsulated, aRGB).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt02, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 1, "wire." + aMaterial.name().toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + " Wire", 0.25F, aMaterial, aLoss, 2L * aAmperage, aVoltage, false, !aAutoInsulated, aRGB).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt04, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 2, "wire." + aMaterial.name().toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + " Wire", 0.375F, aMaterial, aLoss, 4L * aAmperage, aVoltage, false, !aAutoInsulated, aRGB).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt08, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 3, "wire." + aMaterial.name().toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + " Wire", 0.50F, aMaterial, aLoss, 8L * aAmperage, aVoltage, false, !aAutoInsulated, aRGB).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt12, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 4, "wire." + aMaterial.name().toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + " Wire", GTNH?0.625F:0.75F, aMaterial, aLoss, 12L * aAmperage, aVoltage, false, !aAutoInsulated, aRGB).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt16, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 5, "wire." + aMaterial.name().toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + " Wire", GTNH?0.75F:1.0F, aMaterial, aLoss, 16L * aAmperage, aVoltage, false, !aAutoInsulated, aRGB).getStackForm(1L));
- if (aInsulatable)
- {
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt01, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 6, "cable." + aMaterial.name().toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + " Cable", 0.25F, aMaterial, aLossInsulated, 1L * aAmperage, aVoltage, true, false, aRGB).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt02, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 7, "cable." + aMaterial.name().toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + " Cable", 0.375F, aMaterial, aLossInsulated, 2L * aAmperage, aVoltage, true, false, aRGB).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt04, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 8, "cable." + aMaterial.name().toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + " Cable", 0.5F, aMaterial, aLossInsulated, 4L * aAmperage, aVoltage, true, false, aRGB).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt08, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 9, "cable." + aMaterial.name().toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + " Cable", 0.625F, aMaterial, aLossInsulated, 8L * aAmperage, aVoltage, true, false, aRGB).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt12, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 10, "cable." + aMaterial.name().toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + " Cable", GTNH?0.75F:0.875F, aMaterial, aLossInsulated, 12L * aAmperage, aVoltage, true, false, aRGB).getStackForm(1L));
- if(GTNH){
- GT_OreDictUnificator.registerOre(cableGt16, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 11, "cable." + aMaterial.name().toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + " Cable", 0.875f, aMaterial, aLossInsulated, 16L * aAmperage, aVoltage, true, false, aRGB).getStackForm(1L));
- }
- }
- }
-
- private static void customWireFactory(final Material Material, final int Voltage, final int ID, final long insulatedLoss, final long uninsulatedLoss, final long Amps){
- int V = GT_Utility.getTier(Voltage);
- if (V == -1){
- Logger.ERROR("Failed to set voltage on "+Material+". Invalid voltage of "+Voltage+"V set.");
- Logger.ERROR(Material+" has defaulted to 8v.");
- V=0;
- }
- makeCustomWires(Material, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false);
- }
-
- private static void makeCustomWires(final Material aMaterial, final int aStartID, final long aLossInsulated, final long aLoss, final long aAmperage, final long aVoltage, final boolean aInsulatable, final boolean aAutoInsulated)
- {
- Logger.WARNING("Gregtech5u Content | Registered "+aMaterial.getLocalizedName() +" as a new material for Wire & Cable.");
- registerOre(OrePrefixes.wireGt01, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 0, "wire." + aMaterial.getLocalizedName().toLowerCase() + ".01", "1x " + aMaterial.getLocalizedName() + " Wire", 0.125F, aLoss, 1L * aAmperage, aVoltage, false, !aAutoInsulated, aMaterial.getRGBA()).getStackForm(1L));
- registerOre(OrePrefixes.wireGt02, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 1, "wire." + aMaterial.getLocalizedName().toLowerCase() + ".02", "2x " + aMaterial.getLocalizedName() + " Wire", 0.25F, aLoss, 2L * aAmperage, aVoltage, false, !aAutoInsulated, aMaterial.getRGBA()).getStackForm(1L));
- registerOre(OrePrefixes.wireGt04, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 2, "wire." + aMaterial.getLocalizedName().toLowerCase() + ".04", "4x " + aMaterial.getLocalizedName() + " Wire", 0.375F, aLoss, 4L * aAmperage, aVoltage, false, !aAutoInsulated, aMaterial.getRGBA()).getStackForm(1L));
- registerOre(OrePrefixes.wireGt08, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 3, "wire." + aMaterial.getLocalizedName().toLowerCase() + ".08", "8x " + aMaterial.getLocalizedName() + " Wire", 0.50F, aLoss, 8L * aAmperage, aVoltage, false, !aAutoInsulated, aMaterial.getRGBA()).getStackForm(1L));
- registerOre(OrePrefixes.wireGt12, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 4, "wire." + aMaterial.getLocalizedName().toLowerCase() + ".12", "12x " + aMaterial.getLocalizedName() + " Wire", GTNH?0.625F:0.75F, aLoss, 12L * aAmperage, aVoltage, false, !aAutoInsulated, aMaterial.getRGBA()).getStackForm(1L));
- registerOre(OrePrefixes.wireGt16, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 5, "wire." + aMaterial.getLocalizedName().toLowerCase() + ".16", "16x " + aMaterial.getLocalizedName() + " Wire", GTNH?0.75F:1.0F, aLoss, 16L * aAmperage, aVoltage, false, !aAutoInsulated, aMaterial.getRGBA()).getStackForm(1L));
- if (aInsulatable)
- {
- registerOre(OrePrefixes.cableGt01, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 6, "cable." + aMaterial.getLocalizedName().toLowerCase() + ".01", "1x " + aMaterial.getLocalizedName() + " Cable", 0.25F, aLossInsulated, 1L * aAmperage, aVoltage, true, false, aMaterial.getRGBA()).getStackForm(1L));
- registerOre(OrePrefixes.cableGt02, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 7, "cable." + aMaterial.getLocalizedName().toLowerCase() + ".02", "2x " + aMaterial.getLocalizedName() + " Cable", 0.375F, aLossInsulated, 2L * aAmperage, aVoltage, true, false, aMaterial.getRGBA()).getStackForm(1L));
- registerOre(OrePrefixes.cableGt04, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 8, "cable." + aMaterial.getLocalizedName().toLowerCase() + ".04", "4x " + aMaterial.getLocalizedName() + " Cable", 0.5F, aLossInsulated, 4L * aAmperage, aVoltage, true, false, aMaterial.getRGBA()).getStackForm(1L));
- registerOre(OrePrefixes.cableGt08, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 9, "cable." + aMaterial.getLocalizedName().toLowerCase() + ".08", "8x " + aMaterial.getLocalizedName() + " Cable", 0.625F, aLossInsulated, 8L * aAmperage, aVoltage, true, false, aMaterial.getRGBA()).getStackForm(1L));
- registerOre(OrePrefixes.cableGt12, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 10, "cable." + aMaterial.getLocalizedName().toLowerCase() + ".12", "12x " + aMaterial.getLocalizedName() + " Cable", GTNH?0.75F:0.875F, aLossInsulated, 12L * aAmperage, aVoltage, true, false, aMaterial.getRGBA()).getStackForm(1L));
- if(GTNH){
- registerOre(cableGt16, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 11, "cable." + aMaterial.getLocalizedName().toLowerCase() + ".16", "16x " + aMaterial.getLocalizedName() + " Cable", 0.875f, aLossInsulated, 16L * aAmperage, aVoltage, true, false, aMaterial.getRGBA()).getStackForm(1L));
- }
- }
-
- }
-
- private static void superConductorFactory(final GT_Materials Material, final int Voltage, final int ID, final long insulatedLoss, final long uninsulatedLoss, final long Amps){
- final GT_Materials T = Material;
- int V = 0;
- if (Voltage == 8){
- V = 0;
- }
- else if (Voltage == 32){
- V = 1;
- }
- else if (Voltage == 128){
- V = 2;
- }
- else if (Voltage == 512){
- V = 3;
- }
- else if (Voltage == 2048){
- V = 4;
- }
- else if (Voltage == 8196){
- V = 5;
- }
- else if (Voltage == 32768){
- V = 6;
- }
- else if (Voltage == 131072){
- V = 7;
- }
- else if (Voltage == 524288){
- V = 8;
- }
- else if (Voltage == Integer.MAX_VALUE){
- V = 9;
- }
- else {
- Logger.ERROR("Failed to set voltage on "+Material.name()+". Invalid voltage of "+Voltage+"V set.");
- Logger.ERROR(Material.name()+" has defaulted to 8v.");
- V = 0;
- }
- //makeWires(T, ID, 2L, 4L, 2L, GT_Values.V[V], true, false);
- //makeSuperConductors(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false);
- //makeWires(T, ID, bEC ? 2L : 2L, bEC ? 4L : 4L, 2L, gregtech.api.enums.GT_Values.V[V], true, false);
- }
-
-
- private static void generateGTFluidPipes(final Materials material, final int startID, final int transferRatePerSec, final int heatResistance, final boolean isGasProof){
- final int transferRatePerTick = transferRatePerSec/20;
- final long mass = material.getMass();
- final long voltage = material.mMeltingPoint >= 2800 ? 64 : 16;
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(material), new GT_MetaPipeEntity_Fluid(startID, "GT_Pipe_"+material.mDefaultLocalName+"_Tiny", "Tiny "+material.mDefaultLocalName+" Fluid Pipe", 0.25F, material, transferRatePerTick*2, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(material), new GT_MetaPipeEntity_Fluid(startID+1, "GT_Pipe_"+material.mDefaultLocalName+"_Small", "Small "+material.mDefaultLocalName+" Fluid Pipe", 0.375F, material, transferRatePerTick*4, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(material), new GT_MetaPipeEntity_Fluid(startID+2, "GT_Pipe_"+material.mDefaultLocalName+"", ""+material.mDefaultLocalName+" Fluid Pipe", 0.5F, material, transferRatePerTick*12, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(material), new GT_MetaPipeEntity_Fluid(startID+3, "GT_Pipe_"+material.mDefaultLocalName+"_Large", "Large "+material.mDefaultLocalName+" Fluid Pipe", 0.75F, material, transferRatePerTick*24, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(material), new GT_MetaPipeEntity_Fluid(startID+4, "GT_Pipe_"+material.mDefaultLocalName+"_Huge", "Huge "+material.mDefaultLocalName+" Fluid Pipe", GTNH?0.875F:1.0F, material, transferRatePerTick*48, heatResistance, isGasProof).getStackForm(1L));
- //generatePipeRecipes(material.mDefaultLocalName, mass, voltage);
- }
-
- private static void generateNonGTFluidPipes(final GT_Materials material, final Material myMaterial, final int startID, final int transferRatePerSec, final int heatResistance, final boolean isGasProof){
- final int transferRatePerTick = transferRatePerSec/20;
- long mass;
- if (myMaterial != null){
- mass = myMaterial.getMass();
- }
- else {
- mass = ELEMENT.getInstance().IRON.getMass();
- }
-
- int tVoltageMultiplier = (material.mBlastFurnaceTemp >= 2800) ? 64 : 16;
-
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(material), new GregtechMetaPipeEntityFluid(startID, "GT_Pipe_"+material.mDefaultLocalName+"_Tiny", "Tiny "+material.mDefaultLocalName+" Fluid Pipe", 0.25F, material, transferRatePerTick*2, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(material), new GregtechMetaPipeEntityFluid(startID+1, "GT_Pipe_"+material.mDefaultLocalName+"_Small", "Small "+material.mDefaultLocalName+" Fluid Pipe", 0.375F, material, transferRatePerTick*4, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(material), new GregtechMetaPipeEntityFluid(startID+2, "GT_Pipe_"+material.mDefaultLocalName+"", ""+material.mDefaultLocalName+" Fluid Pipe", 0.5F, material, transferRatePerTick*12, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(material), new GregtechMetaPipeEntityFluid(startID+3, "GT_Pipe_"+material.mDefaultLocalName+"_Large", "Large "+material.mDefaultLocalName+" Fluid Pipe", 0.75F, material, transferRatePerTick*24, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(material), new GregtechMetaPipeEntityFluid(startID+4, "GT_Pipe_"+material.mDefaultLocalName+"_Huge", "Huge "+material.mDefaultLocalName+" Fluid Pipe", GTNH?0.875F:1.0F, material, transferRatePerTick*48, heatResistance, isGasProof).getStackForm(1L));
- //generatePipeRecipes(material.mDefaultLocalName, mass, tVoltageMultiplier);
-
- }
-
- public static void generatePipeRecipes(final String materialName, final long Mass, final long vMulti){
-
- String output = materialName.substring(0, 1).toUpperCase() + materialName.substring(1);
- output = Utils.sanitizeString(output);
-
- if (output.equals("VoidMetal")){
- output = "Void";
- }
-
- Logger.INFO("Generating "+output+" pipes & respective recipes.");
-
- ItemStack pipeIngot = ItemUtils.getItemStackOfAmountFromOreDict("ingot"+output, 1);
- ItemStack pipePlate = ItemUtils.getItemStackOfAmountFromOreDict("plate"+output, 1);
-
- if (pipeIngot == null){
- if (pipePlate != null){
- pipeIngot = pipePlate;
- }
- }
-
- //Check all pipes are not null
- Logger.WARNING("Generated pipeTiny from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 1) != null) ? true : false));
- Logger.WARNING("Generated pipeSmall from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1) != null) ? true : false));
- Logger.WARNING("Generated pipeNormal from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1) != null) ? true : false));
- Logger.WARNING("Generated pipeLarge from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1) != null) ? true : false));
- Logger.WARNING("Generated pipeHuge from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false));
-
- int eut = 120;
- eut = (int) (8 * vMulti);
-
-
- //Add the Three Shaped Recipes First
- RecipeUtils.addShapedRecipe(
- pipePlate, "craftingToolWrench", pipePlate,
- pipePlate, null, pipePlate,
- pipePlate, "craftingToolHardHammer", pipePlate,
- ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 6));
-
- RecipeUtils.addShapedRecipe(
- pipePlate, pipePlate, pipePlate,
- "craftingToolWrench", null, "craftingToolHardHammer",
- pipePlate, pipePlate, pipePlate,
- ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 2));
-
- RecipeUtils.addShapedRecipe(
- pipePlate, "craftingToolHardHammer", pipePlate,
- pipePlate, null, pipePlate,
- pipePlate, "craftingToolWrench", pipePlate,
- ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1));
-
- if (pipeIngot != null && ItemUtils.checkForInvalidItems(pipeIngot)) {
- // 1 Clay Plate = 1 Clay Dust = 2 Clay Ball
- int inputMultiplier = materialName.equals("Clay") ? 2 : 1;
- GT_Values.RA.addExtruderRecipe(
- ItemUtils.getSimpleStack(pipeIngot, 1 * inputMultiplier),
- ItemList.Shape_Extruder_Pipe_Tiny.get(0),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("pipe"+"Tiny"+output, 2),
- 5, eut);
-
- GT_Values.RA.addExtruderRecipe(
- ItemUtils.getSimpleStack(pipeIngot, 1 * inputMultiplier),
- ItemList.Shape_Extruder_Pipe_Small.get(0),
- ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1),
- 10, eut);
-
- GT_Values.RA.addExtruderRecipe(
- ItemUtils.getSimpleStack(pipeIngot, 3 * inputMultiplier),
- ItemList.Shape_Extruder_Pipe_Medium.get(0),
- ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1),
- 1*20, eut);
-
- GT_Values.RA.addExtruderRecipe(
- ItemUtils.getSimpleStack(pipeIngot, 6 * inputMultiplier),
- ItemList.Shape_Extruder_Pipe_Large.get(0),
- ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1),
- 2*20, eut);
-
- GT_Values.RA.addExtruderRecipe(
- ItemUtils.getSimpleStack(pipeIngot, 12 * inputMultiplier),
- ItemList.Shape_Extruder_Pipe_Huge.get(0),
- ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1),
- 4*20, eut);
-
- }
-
- if ((eut < 512) && !output.equals("Void")){
- try {
- final ItemStack pipePlateDouble = ItemUtils.getItemStackOfAmountFromOreDict("plateDouble"+output, 1).copy();
- if (pipePlateDouble != null) {
- RecipeUtils.addShapedRecipe(
- pipePlateDouble, "craftingToolHardHammer", pipePlateDouble,
- pipePlateDouble, null, pipePlateDouble,
- pipePlateDouble, "craftingToolWrench", pipePlateDouble,
- ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1));
- } else {
- Logger.INFO("Failed to add a recipe for "+materialName+" Huge pipes. Double plates probably do not exist.");
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
-
- }
-
- public static boolean registerOre(OrePrefixes aPrefix, Material aMaterial, ItemStack aStack) {
- return registerOre(aPrefix.get(Utils.sanitizeString(aMaterial.getLocalizedName())), 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<ItemStack> tList = GT_OreDictUnificator.getOres(tName);
- for (int i = 0; i < tList.size(); ++i)
- if (GT_Utility.areStacksEqual((ItemStack) tList.get(i), aStack, true))
- return false;
- OreDictionary.registerOre(tName, GT_Utility.copyAmount(1L, new Object[] { aStack }));
- return true;
- }
-
- public static boolean generateWireRecipes(Material aMaterial) {
-
- ItemStack aPlate = aMaterial.getPlate(1);
- ItemStack aIngot = aMaterial.getIngot(1);
- ItemStack aWire01 = aMaterial.getWire01(1);
- ItemStack aWire02 = aMaterial.getWire02(1);
- ItemStack aWire04 = aMaterial.getWire04(1);
- ItemStack aWire08 = aMaterial.getWire08(1);
- ItemStack aWire12 = aMaterial.getWire12(1);
- ItemStack aWire16 = aMaterial.getWire16(1);
- ItemStack aCable01 = aMaterial.getCable01(1);
- ItemStack aCable02 = aMaterial.getCable02(1);
- ItemStack aCable04 = aMaterial.getCable04(1);
- ItemStack aCable08 = aMaterial.getCable08(1);
- ItemStack aCable12 = aMaterial.getCable12(1);
- ItemStack aCable16 = aMaterial.getCable16(1);
-
- // Adds manual crafting recipe
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aPlate, aWire01})) {
- RecipeUtils.addShapedRecipe(aPlate, CI.craftingToolWireCutter, null, null, null, null, null, null, null, aWire01);
- }
-
- // Wire mill
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aIngot, aWire01})) {
- GT_Values.RA.addWiremillRecipe(aIngot, aMaterial.getWire01(2), 5 * 20, 4);
- }
-
- // Extruder
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aIngot, aWire01})) {
- GT_Values.RA.addExtruderRecipe(aIngot, ItemList.Shape_Extruder_Wire.get(0), aMaterial.getWire01(2), 196, 96);
- }
-
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aCable01, aWire01})) {
- GT_Values.RA.addUnboxingRecipe(aCable01, aWire01, null, 100, 8);
- }
-
- // Shapeless Down-Crafting
- // 2x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire02}, aMaterial.getWire01(2));
- }
-
- // 4x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire04})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire04}, aMaterial.getWire01(4));
- }
-
- // 8x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire08})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire08}, aMaterial.getWire01(8));
- }
-
- // 12x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire12})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire12}, aMaterial.getWire01(12));
- }
-
- // 16x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire16})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire16}, aMaterial.getWire01(16));
- }
-
- // 1x -> 2x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire01, aWire01}, aWire02);
- }
-
- // 2x -> 4x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire02, aWire04})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire02, aWire02}, aWire04);
- }
-
- // 4x -> 8x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire04, aWire08})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire04, aWire04}, aWire08);
- }
-
- // 8x -> 12x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire04, aWire08, aWire12})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire04, aWire08}, aWire12);
- }
-
- // 12x -> 16x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire04, aWire12, aWire16})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire04, aWire12}, aWire16);
- }
-
- // 8x -> 16x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire08, aWire16})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire08, aWire08}, aWire16);
- }
-
- // 1x -> 4x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire04})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire01, aWire01, aWire01, aWire01}, aWire04);
- }
-
- // 1x -> 8x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire08})) {
- RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01}, aWire08);
- }
-
- // Wire to Cable
- // 1x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aCable01})) {
- GT_Values.RA.addAssemblerRecipe(aWire01, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 144), aCable01, 100, 8);
- }
-
- // 2x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire02, aCable02})) {
- GT_Values.RA.addAssemblerRecipe(aWire02, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 144), aCable02, 100, 8);
- }
-
- // 4x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire04, aCable04})) {
- GT_Values.RA.addAssemblerRecipe(aWire04, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 288), aCable04, 100, 8);
- }
-
- // 8x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire08, aCable08})) {
- GT_Values.RA.addAssemblerRecipe(aWire08, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 432), aCable08, 100, 8);
- }
-
- // 12x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire12, aCable12})) {
- GT_Values.RA.addAssemblerRecipe(aWire12, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 576), aCable12, 100, 8);
- }
-
- // 16x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire16, aCable16})) {
- GT_Values.RA.addAssemblerRecipe(aWire16, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 720), aCable16, 100, 8);
- }
-
- // Assemble small wires into bigger wires
-
- // 2x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) {
- GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(2), CI.getNumberedCircuit(2), null, aWire02, 100, 8);
- }
-
- // 4x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) {
- GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(4), CI.getNumberedCircuit(4), null, aWire04, 100, 8);
- }
-
- // 8x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) {
- GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(8), CI.getNumberedCircuit(8), null, aWire08, 100, 8);
- }
-
- // 12x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) {
- GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(12), CI.getNumberedCircuit(12), null, aWire12, 100, 8);
- }
-
- // 16x
- if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) {
- GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(16), CI.getNumberedCircuit(16), null, aWire16, 100, 8);
- }
-
- return true;
- }
-} \ No newline at end of file
+ /**
+ *
+ * The Voltage Tiers. Use this Array instead of the old named Voltage Variables
+ * public static final long[] V = new long[] {0=8, 1=32, 2=128, 3=512, 4=2048, 5=8192, 6=32768, 7=131072, 8=524288, 9=Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE};
+ *
+ */
+ public static OrePrefixes cableGt16;
+
+ static {
+ if (GTNH) {
+ try {
+ cableGt16 = (OrePrefixes)
+ GT_Utility.getField(OrePrefixes.class, "cableGt16").get(null);
+ } catch (IllegalAccessException | NullPointerException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ // 30000-30999
+
+ private static int BaseWireID = 30600;
+ private static int BasePipeID = 30700;
+ private static int BasePipeHexadecupleID = 30100;
+
+ public static void run() {
+ if (Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Custom Cables/Wires/Pipes.");
+ if (CORE.ConfigSwitches.enableCustom_Cables) {
+ run1();
+ }
+ if (CORE.ConfigSwitches.enableCustom_Pipes) {
+ run2();
+ run3();
+ }
+ }
+ }
+
+ private static void run3() {
+
+ if (Utils.getGregtechVersionAsInt() >= 50930) {
+ try {
+ Class<GT_MetaPipeEntity_Fluid> aPipeEntity = GT_MetaPipeEntity_Fluid.class;
+ Constructor<GT_MetaPipeEntity_Fluid> constructor = aPipeEntity.getConstructor(
+ int.class,
+ String.class,
+ String.class,
+ float.class,
+ Materials.class,
+ int.class,
+ int.class,
+ boolean.class,
+ int.class);
+ if (constructor != null) {
+ Logger.INFO("Generating Hexadecuple pipes.");
+ generateFluidMultiPipes(
+ constructor,
+ Materials.Copper,
+ MaterialUtils.getMaterialName(Materials.Copper),
+ "Copper",
+ BasePipeHexadecupleID++,
+ 60,
+ 1000,
+ true);
+ generateFluidMultiPipes(
+ constructor,
+ Materials.Bronze,
+ MaterialUtils.getMaterialName(Materials.Bronze),
+ "Bronze",
+ BasePipeHexadecupleID++,
+ 120,
+ 2000,
+ true);
+ generateFluidMultiPipes(
+ constructor,
+ Materials.Steel,
+ MaterialUtils.getMaterialName(Materials.Steel),
+ "Steel",
+ BasePipeHexadecupleID++,
+ 240,
+ 2500,
+ true);
+ generateFluidMultiPipes(
+ constructor,
+ Materials.StainlessSteel,
+ MaterialUtils.getMaterialName(Materials.StainlessSteel),
+ "Stainless Steel",
+ BasePipeHexadecupleID++,
+ 360,
+ 3000,
+ true);
+ generateFluidMultiPipes(
+ constructor,
+ Materials.Titanium,
+ MaterialUtils.getMaterialName(Materials.Titanium),
+ "Titanium",
+ BasePipeHexadecupleID++,
+ 480,
+ 5000,
+ true);
+ generateFluidMultiPipes(
+ constructor,
+ Materials.TungstenSteel,
+ MaterialUtils.getMaterialName(Materials.TungstenSteel),
+ "Tungsten Steel",
+ BasePipeHexadecupleID++,
+ 600,
+ 7500,
+ true);
+ generateFluidMultiPipes(
+ constructor,
+ Materials.Plastic,
+ MaterialUtils.getMaterialName(Materials.Plastic),
+ "Plastic",
+ BasePipeHexadecupleID++,
+ 360,
+ 350,
+ true);
+
+ Materials aPTFE = Materials.get("Polytetrafluoroethylene");
+ if (aPTFE != null) {
+ generateFluidMultiPipes(
+ constructor,
+ aPTFE,
+ MaterialUtils.getMaterialName(aPTFE),
+ "PTFE",
+ BasePipeHexadecupleID++,
+ 480,
+ 600,
+ true);
+ }
+ } else {
+ Logger.INFO("Failed during Hexadecuple pipe generation.");
+ }
+
+ } catch (NoSuchMethodException | SecurityException e) {
+ Logger.INFO("Failed during Hexadecuple pipe generation. [Ecx]");
+ e.printStackTrace();
+ }
+ }
+
+ // Generate Heat Pipes
+ // GregtechItemList.HeatPipe_Tier_1.set(new GT_MetaPipeEntity_Heat(31021, "gtpp.pipe.heat.basic.01", "Lead Heat
+ // Pipe (500C)", Materials.Lead, 500).getStackForm(1L));
+ // GregtechItemList.HeatPipe_Tier_2.set(new GT_MetaPipeEntity_Heat(31022, "gtpp.pipe.heat.basic.02", "Iron Heat
+ // Pipe (500C)", Materials.Iron, 500).getStackForm(1L));
+ // GregtechItemList.HeatPipe_Tier_3.set(new GT_MetaPipeEntity_Heat(31023, "gtpp.pipe.heat.basic.03", "Silver
+ // Heat Pipe (1500C)", Materials.Silver, 1500).getStackForm(1L));
+
+ }
+
+ private static void generateFluidMultiPipes(
+ Constructor<GT_MetaPipeEntity_Fluid> aClazz,
+ Materials aMaterial,
+ String name,
+ String displayName,
+ int startID,
+ int transferRatePerSec,
+ int heatCapacity,
+ boolean gasProof) {
+ GT_MetaPipeEntity_Fluid aPipe;
+ final int transferRatePerTick = transferRatePerSec / 20;
+ try {
+ aPipe = aClazz.newInstance(
+ startID,
+ "GT_Pipe_" + name + "_Hexadecuple",
+ "Hexadecuple " + displayName + " Fluid Pipe",
+ 1.0F,
+ aMaterial,
+ transferRatePerTick,
+ heatCapacity,
+ gasProof,
+ 16);
+ if (aPipe == null) {
+ Logger.INFO("Failed to Generate " + aMaterial + " Hexadecuple pipes.");
+ } else {
+ Logger.INFO("Generated " + aMaterial + " Hexadecuple pipes.");
+ GT_OreDictUnificator.registerOre("pipeHexadecuple" + aMaterial, aPipe.getStackForm(1L));
+ }
+ } catch (InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ Logger.INFO("Failed to Generate " + aMaterial + " Hexadecuple pipes. [Ecx]");
+ e.printStackTrace();
+ }
+ }
+
+ private static void run1() {
+
+ if (LoadedMods.Big_Reactors) {
+ wireFactory("Blutonium", 8196, BaseWireID, 8, 32, 2, new short[] {28, 28, 218, 0});
+ wireFactory("Cyanite", 512, BaseWireID + 15, 2, 16, 4, new short[] {27, 130, 178, 0});
+ wireFactory("Yellorium", 2048, BaseWireID + 30, 4, 16, 2, new short[] {150, 195, 54, 0});
+ }
+
+ if (LoadedMods.EnderIO) {
+ wireFactory("RedstoneAlloy", 32, BaseWireID + 45, 0, 2, 1, new short[] {178, 34, 34, 0});
+ }
+
+ if (!GTNH) {
+ customWireFactory(ALLOY.LEAGRISIUM, 512, BaseWireID + 56, 1, 2, 2);
+ customWireFactory(ELEMENT.getInstance().ZIRCONIUM, 128, BaseWireID + 67, 1, 2, 2);
+ customWireFactory(ALLOY.HG1223, 32768, BaseWireID + 78, 2, 8, 4);
+ customWireFactory(ALLOY.TRINIUM_TITANIUM, 2048, BaseWireID + 89, 1, 2, 16);
+ }
+
+ // need to go back id because fluid pipes already occupy
+ makeCustomWires(ELEMENT.STANDALONE.HYPOGEN, BaseWireID - 15, 0, 0, 8, GT_Values.V[11], false, true);
+
+ // superConductorFactory(GT_Materials.Superconductor, 524288, 30660, 0, 0, 8);
+ if (LoadedMods.Thaumcraft) {
+ // superConductorFactory(GT_Materials.Void, 512, 30661, 0, 0, 8);
+ }
+ }
+
+ private static void run2() {
+ generateNonGTFluidPipes(GT_Materials.Staballoy, ALLOY.STABALLOY, BasePipeID, 12500, 7500, true);
+ generateNonGTFluidPipes(GT_Materials.Tantalloy60, ALLOY.TANTALLOY_60, BasePipeID + 5, 10000, 4250, true);
+ generateNonGTFluidPipes(GT_Materials.Tantalloy61, ALLOY.TANTALLOY_61, BasePipeID + 10, 12000, 5800, true);
+ if (LoadedMods.Thaumcraft) {
+ generateNonGTFluidPipes(GT_Materials.Void, null, BasePipeID + 15, 1600, 25000, true);
+ }
+ generateGTFluidPipes(Materials.Europium, BasePipeID + 20, 12000, 7500, true);
+ generateNonGTFluidPipes(GT_Materials.Potin, ALLOY.POTIN, BasePipeID + 25, 500, 2000, true);
+ generateNonGTFluidPipes(GT_Materials.MaragingSteel300, ALLOY.MARAGING300, BasePipeID + 30, 14000, 2500, true);
+ generateNonGTFluidPipes(GT_Materials.MaragingSteel350, ALLOY.MARAGING350, BasePipeID + 35, 16000, 2500, true);
+ generateNonGTFluidPipes(GT_Materials.Inconel690, ALLOY.INCONEL_690, BasePipeID + 40, 15000, 4800, true);
+ generateNonGTFluidPipes(GT_Materials.Inconel792, ALLOY.INCONEL_792, BasePipeID + 45, 16000, 5500, true);
+ generateNonGTFluidPipes(GT_Materials.HastelloyX, ALLOY.HASTELLOY_X, BasePipeID + 50, 20000, 4200, true);
+
+ generateGTFluidPipes(Materials.Tungsten, BasePipeID + 55, 4320, 7200, true);
+ if (LoadedMods.EnderIO) {
+ generateGTFluidPipes(Materials.DarkSteel, BasePipeID + 60, 2320, 2750, true);
+ }
+ generateGTFluidPipes(Materials.Clay, BasePipeID + 65, 100, 500, false);
+ generateGTFluidPipes(Materials.Lead, BasePipeID + 70, 350, 1200, true);
+
+ generateNonGTFluidPipes(
+ GT_Materials.TriniumNaquadahCarbonite, ALLOY.TRINIUM_NAQUADAH_CARBON, 30500, 20, 250000, true);
+ }
+
+ private static void wireFactory(
+ final String Material,
+ final int Voltage,
+ final int ID,
+ final long insulatedLoss,
+ final long uninsulatedLoss,
+ final long Amps,
+ final short[] rgb) {
+ @SuppressWarnings("deprecation")
+ final Materials T = Materials.valueOf(Material);
+ int V = GT_Utility.getTier(Voltage);
+ if (V == -1) {
+ Logger.ERROR("Failed to set voltage on " + Material + ". Invalid voltage of " + Voltage + "V set.");
+ Logger.ERROR(Material + " has defaulted to 8v.");
+ V = 0;
+ }
+ makeWires(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false, rgb);
+ }
+
+ @SuppressWarnings("deprecation")
+ private static void makeWires(
+ final Materials aMaterial,
+ final int aStartID,
+ final long aLossInsulated,
+ final long aLoss,
+ final long aAmperage,
+ final long aVoltage,
+ final boolean aInsulatable,
+ final boolean aAutoInsulated,
+ final short[] aRGB) {
+ Logger.WARNING("Gregtech5u Content | Registered " + aMaterial.name() + " as a new material for Wire & Cable.");
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.wireGt01,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 0,
+ "wire." + aMaterial.name().toLowerCase() + ".01",
+ "1x " + aMaterial.mDefaultLocalName + " Wire",
+ 0.125F,
+ aMaterial,
+ aLoss,
+ 1L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aRGB)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.wireGt02,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 1,
+ "wire." + aMaterial.name().toLowerCase() + ".02",
+ "2x " + aMaterial.mDefaultLocalName + " Wire",
+ 0.25F,
+ aMaterial,
+ aLoss,
+ 2L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aRGB)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.wireGt04,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 2,
+ "wire." + aMaterial.name().toLowerCase() + ".04",
+ "4x " + aMaterial.mDefaultLocalName + " Wire",
+ 0.375F,
+ aMaterial,
+ aLoss,
+ 4L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aRGB)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.wireGt08,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 3,
+ "wire." + aMaterial.name().toLowerCase() + ".08",
+ "8x " + aMaterial.mDefaultLocalName + " Wire",
+ 0.50F,
+ aMaterial,
+ aLoss,
+ 8L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aRGB)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.wireGt12,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 4,
+ "wire." + aMaterial.name().toLowerCase() + ".12",
+ "12x " + aMaterial.mDefaultLocalName + " Wire",
+ GTNH ? 0.625F : 0.75F,
+ aMaterial,
+ aLoss,
+ 12L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aRGB)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.wireGt16,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 5,
+ "wire." + aMaterial.name().toLowerCase() + ".16",
+ "16x " + aMaterial.mDefaultLocalName + " Wire",
+ GTNH ? 0.75F : 1.0F,
+ aMaterial,
+ aLoss,
+ 16L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aRGB)
+ .getStackForm(1L));
+ if (aInsulatable) {
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.cableGt01,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 6,
+ "cable." + aMaterial.name().toLowerCase() + ".01",
+ "1x " + aMaterial.mDefaultLocalName + " Cable",
+ 0.25F,
+ aMaterial,
+ aLossInsulated,
+ 1L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aRGB)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.cableGt02,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 7,
+ "cable." + aMaterial.name().toLowerCase() + ".02",
+ "2x " + aMaterial.mDefaultLocalName + " Cable",
+ 0.375F,
+ aMaterial,
+ aLossInsulated,
+ 2L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aRGB)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.cableGt04,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 8,
+ "cable." + aMaterial.name().toLowerCase() + ".04",
+ "4x " + aMaterial.mDefaultLocalName + " Cable",
+ 0.5F,
+ aMaterial,
+ aLossInsulated,
+ 4L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aRGB)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.cableGt08,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 9,
+ "cable." + aMaterial.name().toLowerCase() + ".08",
+ "8x " + aMaterial.mDefaultLocalName + " Cable",
+ 0.625F,
+ aMaterial,
+ aLossInsulated,
+ 8L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aRGB)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.cableGt12,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 10,
+ "cable." + aMaterial.name().toLowerCase() + ".12",
+ "12x " + aMaterial.mDefaultLocalName + " Cable",
+ GTNH ? 0.75F : 0.875F,
+ aMaterial,
+ aLossInsulated,
+ 12L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aRGB)
+ .getStackForm(1L));
+ if (GTNH) {
+ GT_OreDictUnificator.registerOre(
+ cableGt16,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 11,
+ "cable." + aMaterial.name().toLowerCase() + ".16",
+ "16x " + aMaterial.mDefaultLocalName + " Cable",
+ 0.875f,
+ aMaterial,
+ aLossInsulated,
+ 16L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aRGB)
+ .getStackForm(1L));
+ }
+ }
+ }
+
+ private static void customWireFactory(
+ final Material Material,
+ final int Voltage,
+ final int ID,
+ final long insulatedLoss,
+ final long uninsulatedLoss,
+ final long Amps) {
+ int V = GT_Utility.getTier(Voltage);
+ if (V == -1) {
+ Logger.ERROR("Failed to set voltage on " + Material + ". Invalid voltage of " + Voltage + "V set.");
+ Logger.ERROR(Material + " has defaulted to 8v.");
+ V = 0;
+ }
+ makeCustomWires(Material, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false);
+ }
+
+ private static void makeCustomWires(
+ final Material aMaterial,
+ final int aStartID,
+ final long aLossInsulated,
+ final long aLoss,
+ final long aAmperage,
+ final long aVoltage,
+ final boolean aInsulatable,
+ final boolean aAutoInsulated) {
+ Logger.WARNING("Gregtech5u Content | Registered " + aMaterial.getLocalizedName()
+ + " as a new material for Wire & Cable.");
+ registerOre(
+ OrePrefixes.wireGt01,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 0,
+ "wire." + aMaterial.getLocalizedName().toLowerCase() + ".01",
+ "1x " + aMaterial.getLocalizedName() + " Wire",
+ 0.125F,
+ aLoss,
+ 1L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ registerOre(
+ OrePrefixes.wireGt02,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 1,
+ "wire." + aMaterial.getLocalizedName().toLowerCase() + ".02",
+ "2x " + aMaterial.getLocalizedName() + " Wire",
+ 0.25F,
+ aLoss,
+ 2L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ registerOre(
+ OrePrefixes.wireGt04,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 2,
+ "wire." + aMaterial.getLocalizedName().toLowerCase() + ".04",
+ "4x " + aMaterial.getLocalizedName() + " Wire",
+ 0.375F,
+ aLoss,
+ 4L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ registerOre(
+ OrePrefixes.wireGt08,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 3,
+ "wire." + aMaterial.getLocalizedName().toLowerCase() + ".08",
+ "8x " + aMaterial.getLocalizedName() + " Wire",
+ 0.50F,
+ aLoss,
+ 8L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ registerOre(
+ OrePrefixes.wireGt12,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 4,
+ "wire." + aMaterial.getLocalizedName().toLowerCase() + ".12",
+ "12x " + aMaterial.getLocalizedName() + " Wire",
+ GTNH ? 0.625F : 0.75F,
+ aLoss,
+ 12L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ registerOre(
+ OrePrefixes.wireGt16,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 5,
+ "wire." + aMaterial.getLocalizedName().toLowerCase() + ".16",
+ "16x " + aMaterial.getLocalizedName() + " Wire",
+ GTNH ? 0.75F : 1.0F,
+ aLoss,
+ 16L * aAmperage,
+ aVoltage,
+ false,
+ !aAutoInsulated,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ if (aInsulatable) {
+ registerOre(
+ OrePrefixes.cableGt01,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 6,
+ "cable." + aMaterial.getLocalizedName().toLowerCase() + ".01",
+ "1x " + aMaterial.getLocalizedName() + " Cable",
+ 0.25F,
+ aLossInsulated,
+ 1L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ registerOre(
+ OrePrefixes.cableGt02,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 7,
+ "cable." + aMaterial.getLocalizedName().toLowerCase() + ".02",
+ "2x " + aMaterial.getLocalizedName() + " Cable",
+ 0.375F,
+ aLossInsulated,
+ 2L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ registerOre(
+ OrePrefixes.cableGt04,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 8,
+ "cable." + aMaterial.getLocalizedName().toLowerCase() + ".04",
+ "4x " + aMaterial.getLocalizedName() + " Cable",
+ 0.5F,
+ aLossInsulated,
+ 4L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ registerOre(
+ OrePrefixes.cableGt08,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 9,
+ "cable." + aMaterial.getLocalizedName().toLowerCase() + ".08",
+ "8x " + aMaterial.getLocalizedName() + " Cable",
+ 0.625F,
+ aLossInsulated,
+ 8L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ registerOre(
+ OrePrefixes.cableGt12,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 10,
+ "cable." + aMaterial.getLocalizedName().toLowerCase() + ".12",
+ "12x " + aMaterial.getLocalizedName() + " Cable",
+ GTNH ? 0.75F : 0.875F,
+ aLossInsulated,
+ 12L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ if (GTNH) {
+ registerOre(
+ cableGt16,
+ aMaterial,
+ new GregtechMetaPipeEntity_Cable(
+ aStartID + 11,
+ "cable." + aMaterial.getLocalizedName().toLowerCase() + ".16",
+ "16x " + aMaterial.getLocalizedName() + " Cable",
+ 0.875f,
+ aLossInsulated,
+ 16L * aAmperage,
+ aVoltage,
+ true,
+ false,
+ aMaterial.getRGBA())
+ .getStackForm(1L));
+ }
+ }
+ }
+
+ private static void superConductorFactory(
+ final GT_Materials Material,
+ final int Voltage,
+ final int ID,
+ final long insulatedLoss,
+ final long uninsulatedLoss,
+ final long Amps) {
+ final GT_Materials T = Material;
+ int V = 0;
+ if (Voltage == 8) {
+ V = 0;
+ } else if (Voltage == 32) {
+ V = 1;
+ } else if (Voltage == 128) {
+ V = 2;
+ } else if (Voltage == 512) {
+ V = 3;
+ } else if (Voltage == 2048) {
+ V = 4;
+ } else if (Voltage == 8196) {
+ V = 5;
+ } else if (Voltage == 32768) {
+ V = 6;
+ } else if (Voltage == 131072) {
+ V = 7;
+ } else if (Voltage == 524288) {
+ V = 8;
+ } else if (Voltage == Integer.MAX_VALUE) {
+ V = 9;
+ } else {
+ Logger.ERROR("Failed to set voltage on " + Material.name() + ". Invalid voltage of " + Voltage + "V set.");
+ Logger.ERROR(Material.name() + " has defaulted to 8v.");
+ V = 0;
+ }
+ // makeWires(T, ID, 2L, 4L, 2L, GT_Values.V[V], true, false);
+ // makeSuperConductors(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false);
+ // makeWires(T, ID, bEC ? 2L : 2L, bEC ? 4L : 4L, 2L, gregtech.api.enums.GT_Values.V[V], true, false);
+ }
+
+ private static void generateGTFluidPipes(
+ final Materials material,
+ final int startID,
+ final int transferRatePerSec,
+ final int heatResistance,
+ final boolean isGasProof) {
+ final int transferRatePerTick = transferRatePerSec / 20;
+ final long mass = material.getMass();
+ final long voltage = material.mMeltingPoint >= 2800 ? 64 : 16;
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeTiny.get(material),
+ new GT_MetaPipeEntity_Fluid(
+ startID,
+ "GT_Pipe_" + material.mDefaultLocalName + "_Tiny",
+ "Tiny " + material.mDefaultLocalName + " Fluid Pipe",
+ 0.25F,
+ material,
+ transferRatePerTick * 2,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeSmall.get(material),
+ new GT_MetaPipeEntity_Fluid(
+ startID + 1,
+ "GT_Pipe_" + material.mDefaultLocalName + "_Small",
+ "Small " + material.mDefaultLocalName + " Fluid Pipe",
+ 0.375F,
+ material,
+ transferRatePerTick * 4,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeMedium.get(material),
+ new GT_MetaPipeEntity_Fluid(
+ startID + 2,
+ "GT_Pipe_" + material.mDefaultLocalName + "",
+ "" + material.mDefaultLocalName + " Fluid Pipe",
+ 0.5F,
+ material,
+ transferRatePerTick * 12,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeLarge.get(material),
+ new GT_MetaPipeEntity_Fluid(
+ startID + 3,
+ "GT_Pipe_" + material.mDefaultLocalName + "_Large",
+ "Large " + material.mDefaultLocalName + " Fluid Pipe",
+ 0.75F,
+ material,
+ transferRatePerTick * 24,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeHuge.get(material),
+ new GT_MetaPipeEntity_Fluid(
+ startID + 4,
+ "GT_Pipe_" + material.mDefaultLocalName + "_Huge",
+ "Huge " + material.mDefaultLocalName + " Fluid Pipe",
+ GTNH ? 0.875F : 1.0F,
+ material,
+ transferRatePerTick * 48,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ // generatePipeRecipes(material.mDefaultLocalName, mass, voltage);
+ }
+
+ private static void generateNonGTFluidPipes(
+ final GT_Materials material,
+ final Material myMaterial,
+ final int startID,
+ final int transferRatePerSec,
+ final int heatResistance,
+ final boolean isGasProof) {
+ final int transferRatePerTick = transferRatePerSec / 20;
+ long mass;
+ if (myMaterial != null) {
+ mass = myMaterial.getMass();
+ } else {
+ mass = ELEMENT.getInstance().IRON.getMass();
+ }
+
+ int tVoltageMultiplier = (material.mBlastFurnaceTemp >= 2800) ? 64 : 16;
+
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeTiny.get(material),
+ new GregtechMetaPipeEntityFluid(
+ startID,
+ "GT_Pipe_" + material.mDefaultLocalName + "_Tiny",
+ "Tiny " + material.mDefaultLocalName + " Fluid Pipe",
+ 0.25F,
+ material,
+ transferRatePerTick * 2,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeSmall.get(material),
+ new GregtechMetaPipeEntityFluid(
+ startID + 1,
+ "GT_Pipe_" + material.mDefaultLocalName + "_Small",
+ "Small " + material.mDefaultLocalName + " Fluid Pipe",
+ 0.375F,
+ material,
+ transferRatePerTick * 4,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeMedium.get(material),
+ new GregtechMetaPipeEntityFluid(
+ startID + 2,
+ "GT_Pipe_" + material.mDefaultLocalName + "",
+ "" + material.mDefaultLocalName + " Fluid Pipe",
+ 0.5F,
+ material,
+ transferRatePerTick * 12,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeLarge.get(material),
+ new GregtechMetaPipeEntityFluid(
+ startID + 3,
+ "GT_Pipe_" + material.mDefaultLocalName + "_Large",
+ "Large " + material.mDefaultLocalName + " Fluid Pipe",
+ 0.75F,
+ material,
+ transferRatePerTick * 24,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ GT_OreDictUnificator.registerOre(
+ OrePrefixes.pipeHuge.get(material),
+ new GregtechMetaPipeEntityFluid(
+ startID + 4,
+ "GT_Pipe_" + material.mDefaultLocalName + "_Huge",
+ "Huge " + material.mDefaultLocalName + " Fluid Pipe",
+ GTNH ? 0.875F : 1.0F,
+ material,
+ transferRatePerTick * 48,
+ heatResistance,
+ isGasProof)
+ .getStackForm(1L));
+ // generatePipeRecipes(material.mDefaultLocalName, mass, tVoltageMultiplier);
+
+ }
+
+ public static void generatePipeRecipes(final String materialName, final long Mass, final long vMulti) {
+
+ String output = materialName.substring(0, 1).toUpperCase() + materialName.substring(1);
+ output = Utils.sanitizeString(output);
+
+ if (output.equals("VoidMetal")) {
+ output = "Void";
+ }
+
+ Logger.INFO("Generating " + output + " pipes & respective recipes.");
+
+ ItemStack pipeIngot = ItemUtils.getItemStackOfAmountFromOreDict("ingot" + output, 1);
+ ItemStack pipePlate = ItemUtils.getItemStackOfAmountFromOreDict("plate" + output, 1);
+
+ if (pipeIngot == null) {
+ if (pipePlate != null) {
+ pipeIngot = pipePlate;
+ }
+ }
+
+ // Check all pipes are not null
+ Logger.WARNING("Generated pipeTiny from " + materialName + "? "
+ + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Tiny" + output, 1) != null) ? true : false));
+ Logger.WARNING("Generated pipeSmall from " + materialName + "? "
+ + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 1) != null) ? true : false));
+ Logger.WARNING("Generated pipeNormal from " + materialName + "? "
+ + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 1) != null) ? true : false));
+ Logger.WARNING("Generated pipeLarge from " + materialName + "? "
+ + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1) != null) ? true : false));
+ Logger.WARNING("Generated pipeHuge from " + materialName + "? "
+ + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1) != null) ? true : false));
+
+ int eut = 120;
+ eut = (int) (8 * vMulti);
+
+ // Add the Three Shaped Recipes First
+ RecipeUtils.addShapedRecipe(
+ pipePlate,
+ "craftingToolWrench",
+ pipePlate,
+ pipePlate,
+ null,
+ pipePlate,
+ pipePlate,
+ "craftingToolHardHammer",
+ pipePlate,
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 6));
+
+ RecipeUtils.addShapedRecipe(
+ pipePlate,
+ pipePlate,
+ pipePlate,
+ "craftingToolWrench",
+ null,
+ "craftingToolHardHammer",
+ pipePlate,
+ pipePlate,
+ pipePlate,
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 2));
+
+ RecipeUtils.addShapedRecipe(
+ pipePlate,
+ "craftingToolHardHammer",
+ pipePlate,
+ pipePlate,
+ null,
+ pipePlate,
+ pipePlate,
+ "craftingToolWrench",
+ pipePlate,
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1));
+
+ if (pipeIngot != null && ItemUtils.checkForInvalidItems(pipeIngot)) {
+ // 1 Clay Plate = 1 Clay Dust = 2 Clay Ball
+ int inputMultiplier = materialName.equals("Clay") ? 2 : 1;
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 1 * inputMultiplier),
+ ItemList.Shape_Extruder_Pipe_Tiny.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("pipe" + "Tiny" + output, 2),
+ 5,
+ eut);
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 1 * inputMultiplier),
+ ItemList.Shape_Extruder_Pipe_Small.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 1),
+ 10,
+ eut);
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 3 * inputMultiplier),
+ ItemList.Shape_Extruder_Pipe_Medium.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 1),
+ 1 * 20,
+ eut);
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 6 * inputMultiplier),
+ ItemList.Shape_Extruder_Pipe_Large.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1),
+ 2 * 20,
+ eut);
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 12 * inputMultiplier),
+ ItemList.Shape_Extruder_Pipe_Huge.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1),
+ 4 * 20,
+ eut);
+ }
+
+ if ((eut < 512) && !output.equals("Void")) {
+ try {
+ final ItemStack pipePlateDouble = ItemUtils.getItemStackOfAmountFromOreDict("plateDouble" + output, 1)
+ .copy();
+ if (pipePlateDouble != null) {
+ RecipeUtils.addShapedRecipe(
+ pipePlateDouble,
+ "craftingToolHardHammer",
+ pipePlateDouble,
+ pipePlateDouble,
+ null,
+ pipePlateDouble,
+ pipePlateDouble,
+ "craftingToolWrench",
+ pipePlateDouble,
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1));
+ } else {
+ Logger.INFO("Failed to add a recipe for " + materialName
+ + " Huge pipes. Double plates probably do not exist.");
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+
+ public static boolean registerOre(OrePrefixes aPrefix, Material aMaterial, ItemStack aStack) {
+ return registerOre(aPrefix.get(Utils.sanitizeString(aMaterial.getLocalizedName())), 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<ItemStack> tList = GT_OreDictUnificator.getOres(tName);
+ for (int i = 0; i < tList.size(); ++i)
+ if (GT_Utility.areStacksEqual((ItemStack) tList.get(i), aStack, true)) return false;
+ OreDictionary.registerOre(tName, GT_Utility.copyAmount(1L, new Object[] {aStack}));
+ return true;
+ }
+
+ public static boolean generateWireRecipes(Material aMaterial) {
+
+ ItemStack aPlate = aMaterial.getPlate(1);
+ ItemStack aIngot = aMaterial.getIngot(1);
+ ItemStack aWire01 = aMaterial.getWire01(1);
+ ItemStack aWire02 = aMaterial.getWire02(1);
+ ItemStack aWire04 = aMaterial.getWire04(1);
+ ItemStack aWire08 = aMaterial.getWire08(1);
+ ItemStack aWire12 = aMaterial.getWire12(1);
+ ItemStack aWire16 = aMaterial.getWire16(1);
+ ItemStack aCable01 = aMaterial.getCable01(1);
+ ItemStack aCable02 = aMaterial.getCable02(1);
+ ItemStack aCable04 = aMaterial.getCable04(1);
+ ItemStack aCable08 = aMaterial.getCable08(1);
+ ItemStack aCable12 = aMaterial.getCable12(1);
+ ItemStack aCable16 = aMaterial.getCable16(1);
+
+ // Adds manual crafting recipe
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aPlate, aWire01})) {
+ RecipeUtils.addShapedRecipe(
+ aPlate, CI.craftingToolWireCutter, null, null, null, null, null, null, null, aWire01);
+ }
+
+ // Wire mill
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aIngot, aWire01})) {
+ GT_Values.RA.addWiremillRecipe(aIngot, aMaterial.getWire01(2), 5 * 20, 4);
+ }
+
+ // Extruder
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aIngot, aWire01})) {
+ GT_Values.RA.addExtruderRecipe(
+ aIngot, ItemList.Shape_Extruder_Wire.get(0), aMaterial.getWire01(2), 196, 96);
+ }
+
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aCable01, aWire01})) {
+ GT_Values.RA.addUnboxingRecipe(aCable01, aWire01, null, 100, 8);
+ }
+
+ // Shapeless Down-Crafting
+ // 2x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire02}, aMaterial.getWire01(2));
+ }
+
+ // 4x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire04})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire04}, aMaterial.getWire01(4));
+ }
+
+ // 8x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire08})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire08}, aMaterial.getWire01(8));
+ }
+
+ // 12x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire12})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire12}, aMaterial.getWire01(12));
+ }
+
+ // 16x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire16})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire16}, aMaterial.getWire01(16));
+ }
+
+ // 1x -> 2x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire01, aWire01}, aWire02);
+ }
+
+ // 2x -> 4x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire02, aWire04})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire02, aWire02}, aWire04);
+ }
+
+ // 4x -> 8x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire04, aWire08})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire04, aWire04}, aWire08);
+ }
+
+ // 8x -> 12x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire04, aWire08, aWire12})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire04, aWire08}, aWire12);
+ }
+
+ // 12x -> 16x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire04, aWire12, aWire16})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire04, aWire12}, aWire16);
+ }
+
+ // 8x -> 16x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire08, aWire16})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire08, aWire08}, aWire16);
+ }
+
+ // 1x -> 4x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire04})) {
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire01, aWire01, aWire01, aWire01}, aWire04);
+ }
+
+ // 1x -> 8x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire08})) {
+ RecipeUtils.addShapelessGregtechRecipe(
+ new ItemStack[] {aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01}, aWire08);
+ }
+
+ // Wire to Cable
+ // 1x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aCable01})) {
+ GT_Values.RA.addAssemblerRecipe(
+ aWire01,
+ CI.getNumberedCircuit(24),
+ FluidUtils.getFluidStack("molten.rubber", 144),
+ aCable01,
+ 100,
+ 8);
+ }
+
+ // 2x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire02, aCable02})) {
+ GT_Values.RA.addAssemblerRecipe(
+ aWire02,
+ CI.getNumberedCircuit(24),
+ FluidUtils.getFluidStack("molten.rubber", 144),
+ aCable02,
+ 100,
+ 8);
+ }
+
+ // 4x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire04, aCable04})) {
+ GT_Values.RA.addAssemblerRecipe(
+ aWire04,
+ CI.getNumberedCircuit(24),
+ FluidUtils.getFluidStack("molten.rubber", 288),
+ aCable04,
+ 100,
+ 8);
+ }
+
+ // 8x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire08, aCable08})) {
+ GT_Values.RA.addAssemblerRecipe(
+ aWire08,
+ CI.getNumberedCircuit(24),
+ FluidUtils.getFluidStack("molten.rubber", 432),
+ aCable08,
+ 100,
+ 8);
+ }
+
+ // 12x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire12, aCable12})) {
+ GT_Values.RA.addAssemblerRecipe(
+ aWire12,
+ CI.getNumberedCircuit(24),
+ FluidUtils.getFluidStack("molten.rubber", 576),
+ aCable12,
+ 100,
+ 8);
+ }
+
+ // 16x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire16, aCable16})) {
+ GT_Values.RA.addAssemblerRecipe(
+ aWire16,
+ CI.getNumberedCircuit(24),
+ FluidUtils.getFluidStack("molten.rubber", 720),
+ aCable16,
+ 100,
+ 8);
+ }
+
+ // Assemble small wires into bigger wires
+
+ // 2x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) {
+ GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(2), CI.getNumberedCircuit(2), null, aWire02, 100, 8);
+ }
+
+ // 4x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) {
+ GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(4), CI.getNumberedCircuit(4), null, aWire04, 100, 8);
+ }
+
+ // 8x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) {
+ GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(8), CI.getNumberedCircuit(8), null, aWire08, 100, 8);
+ }
+
+ // 12x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) {
+ GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(12), CI.getNumberedCircuit(12), null, aWire12, 100, 8);
+ }
+
+ // 16x
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) {
+ GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(16), CI.getNumberedCircuit(16), null, aWire16, 100, 8);
+ }
+
+ return true;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java
index 3d2ca0b2bd..e261b2f01a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java
@@ -4,218 +4,225 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.*;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase;
-import java.lang.reflect.Constructor;
-
public class GregtechCustomHatches {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Custom Fluid Hatches.");
- run1();
- if (PollutionUtils.isPollutionEnabled()) {
- run2();
- }
- run3();
- run4();
- }
- }
-
- private static void run1() {
-
- GregtechItemList.Hatch_Input_Cryotheum
- .set(new GT_MetaTileEntity_Hatch_CustomFluidBase(FluidUtils.getFluidStack("cryotheum", 1).getFluid(), // Fluid
- // to
- // resitrct
- // hatch
- // to
- 128000, // Capacity
- 967, // ID
- "hatch.cryotheum.input.tier.00", // unlocal name
- "Cryotheum Cooling Hatch" // Local name
- ).getStackForm(1L));
-
- GregtechItemList.Hatch_Input_Pyrotheum
- .set(new GT_MetaTileEntity_Hatch_CustomFluidBase(FluidUtils.getFluidStack("pyrotheum", 1).getFluid(), // Fluid
- // to
- // resitrct
- // hatch
- // to
- 128000, // Capacity
- 968, // ID
- "hatch.pyrotheum.input.tier.00", // unlocal name
- "Pyrotheum Heating Vent" // Local name
- ).getStackForm(1L));
-
- GregtechItemList.Hatch_Input_Naquadah.set(new GT_MetaTileEntity_Hatch_Naquadah(969, // ID
- "hatch.naquadah.input.tier.00", // unlocal name
- "Naquadah Reactor Input hatch" // Local name
- ).getStackForm(1L));
-
-
- GregtechItemList.Hatch_Input_TurbineHousing.set(new GT_MetaTileEntity_Hatch_TurbineProvider(31025, // ID
- "hatch.turbine.input.tier.00", // unlocal name
- "Turbine Housing", // Local name
- 8
- ).getStackForm(1L));
-
- // Multiblock Control Core Bus
- GregtechItemList.Hatch_Control_Core.set((new GT_MetaTileEntity_Hatch_ControlCore(30020, "hatch.control.adv", "Control Core Module", 1)).getStackForm(1L));
-
- // Multiblock Air Intake Hatch
- GregtechItemList.Hatch_Air_Intake.set(new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5).getStackForm(1L));
- GregtechItemList.Hatch_Air_Intake_Extreme.set(new GT_MetaTileEntity_Hatch_AirIntake_Extreme(31070, "hatch.air.intake.tier.01", "Extreme Air Intake Hatch", 6).getStackForm(1L));
-
- // Multiblock Reservoir Hatch
- GregtechItemList.Hatch_Reservoir.set(new GT_MetaTileEntity_Hatch_Reservoir(31071, "hatch.water.intake.tier.00", "Reservoir Hatch", 6).getStackForm(1L));
-
-
- // Steam Hatch
- GregtechItemList.Hatch_Input_Steam
- .set(new GT_MetaTileEntity_Hatch_CustomFluidBase(FluidUtils.getSteam(1).getFluid(), // Fluid
- // to
- // resitrct
- // hatch
- // to
- 64000, // Capacity
- 31040, // ID
- "hatch.steam.input.tier.00", // unlocal name
- "Steam Hatch" // Local name
- ).getStackForm(1L));
-
-
-
-
-
- }
-
- private static void run2() {
- GregtechItemList.Hatch_Muffler_Adv_LV
- .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30001, "hatch.muffler.adv.tier.01", "Advanced Muffler Hatch (LV)", 1))
- .getStackForm(1L));
- GregtechItemList.Hatch_Muffler_Adv_MV
- .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30002, "hatch.muffler.adv.tier.02", "Advanced Muffler Hatch (MV)", 2))
- .getStackForm(1L));
- GregtechItemList.Hatch_Muffler_Adv_HV
- .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30003, "hatch.muffler.adv.tier.03", "Advanced Muffler Hatch (HV)", 3))
- .getStackForm(1L));
- GregtechItemList.Hatch_Muffler_Adv_EV
- .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30004, "hatch.muffler.adv.tier.04", "Advanced Muffler Hatch (EV)", 4))
- .getStackForm(1L));
- GregtechItemList.Hatch_Muffler_Adv_IV
- .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30005, "hatch.muffler.adv.tier.05", "Advanced Muffler Hatch (IV)", 5))
- .getStackForm(1L));
- GregtechItemList.Hatch_Muffler_Adv_LuV
- .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30006, "hatch.muffler.adv.tier.06", "Advanced Muffler Hatch (LuV)", 6))
- .getStackForm(1L));
- GregtechItemList.Hatch_Muffler_Adv_ZPM
- .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30007, "hatch.muffler.adv.tier.07", "Advanced Muffler Hatch (ZPM)", 7))
- .getStackForm(1L));
- GregtechItemList.Hatch_Muffler_Adv_UV
- .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30008, "hatch.muffler.adv.tier.08", "Advanced Muffler Hatch (UV)", 8))
- .getStackForm(1L));
- GregtechItemList.Hatch_Muffler_Adv_MAX
- .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30009, "hatch.muffler.adv.tier.09", "Advanced Muffler Hatch (MAX)", 9))
- .getStackForm(1L));
- }
-
- private static void run3() {
- /*
- * Super Input Busses
- */
-
- int aStartID = 30021;
-
- GregtechItemList.Hatch_SuperBus_Input_ULV
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.00", "Super Bus (I) (ULV)", 0))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Input_LV
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.01", "Super Bus (I) (LV)", 1))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Input_MV
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.02", "Super Bus (I) (MV)", 2))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Input_HV
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.03", "Super Bus (I) (HV)", 3))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Input_EV
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.04", "Super Bus (I) (EV)", 4))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Input_IV
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.05", "Super Bus (I) (IV)", 5))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Input_LuV
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.06", "Super Bus (I) (LuV)", 6))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Input_ZPM
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.07", "Super Bus (I) (ZPM)", 7))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Input_UV
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.08", "Super Bus (I) (UV)", 8))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Input_MAX
- .set(((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.09", "Super Bus (I) (MAX)", 9))
- .getStackForm(1L));
-
- /*
- * Super Output Busses
- */
-
- GregtechItemList.Hatch_SuperBus_Output_ULV
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.00", "Super Bus (O) (ULV)", 0))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Output_LV
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.01", "Super Bus (O) (LV)", 1))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Output_MV
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.02", "Super Bus (O) (MV)", 2))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Output_HV
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.03", "Super Bus (O) (HV)", 3))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Output_EV
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.04", "Super Bus (O) (EV)", 4))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Output_IV
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.05", "Super Bus (O) (IV)", 5))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Output_LuV
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.06", "Super Bus (O) (LuV)", 6))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Output_ZPM
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.07", "Super Bus (O) (ZPM)", 7))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Output_UV
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.08", "Super Bus (O) (UV)", 8))
- .getStackForm(1L));
- GregtechItemList.Hatch_SuperBus_Output_MAX
- .set(((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.09", "Super Bus (O) (MAX)", 9))
- .getStackForm(1L));
- }
-
- private static GT_MetaTileEntity_SuperBus_Input makeInputBus(int id, String unlocalizedName, String localizedName, int tier) {
- return new GT_MetaTileEntity_SuperBus_Input(id, unlocalizedName, localizedName, tier);
- }
-
- private static GT_MetaTileEntity_SuperBus_Output makeOutputBus(int id, String unlocalizedName, String localizedName, int tier) {
- return new GT_MetaTileEntity_SuperBus_Output(id, unlocalizedName, localizedName, tier);
- }
-
- private static void run4() {
- int aID = 31060;
- //41, "hatch.energy.tier.01", "LV Energy Hatch", 1
- GT_MetaTileEntity_Hatch_Energy_RTG aHatch1 = new GT_MetaTileEntity_Hatch_Energy_RTG(aID++, "hatch.energy.rtg.tier.01", "RTG Power Unit [LV]", 1, 9);
- GT_MetaTileEntity_Hatch_Energy_RTG aHatch2 = new GT_MetaTileEntity_Hatch_Energy_RTG(aID++, "hatch.energy.rtg.tier.02", "RTG Power Unit [MV]", 2, 9);
- GT_MetaTileEntity_Hatch_Energy_RTG aHatch3 = new GT_MetaTileEntity_Hatch_Energy_RTG(aID++, "hatch.energy.rtg.tier.03", "RTG Power Unit [HV]", 3, 9);
-
- GregtechItemList.Hatch_RTG_LV.set(aHatch1.getStackForm(1L));
- GregtechItemList.Hatch_RTG_MV.set(aHatch2.getStackForm(1L));
- GregtechItemList.Hatch_RTG_HV.set(aHatch3.getStackForm(1L));
-
- }
-
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Custom Fluid Hatches.");
+ run1();
+ if (PollutionUtils.isPollutionEnabled()) {
+ run2();
+ }
+ run3();
+ run4();
+ }
+ }
+
+ private static void run1() {
+
+ GregtechItemList.Hatch_Input_Cryotheum.set(new GT_MetaTileEntity_Hatch_CustomFluidBase(
+ FluidUtils.getFluidStack("cryotheum", 1).getFluid(), // Fluid
+ // to
+ // resitrct
+ // hatch
+ // to
+ 128000, // Capacity
+ 967, // ID
+ "hatch.cryotheum.input.tier.00", // unlocal name
+ "Cryotheum Cooling Hatch" // Local name
+ )
+ .getStackForm(1L));
+
+ GregtechItemList.Hatch_Input_Pyrotheum.set(new GT_MetaTileEntity_Hatch_CustomFluidBase(
+ FluidUtils.getFluidStack("pyrotheum", 1).getFluid(), // Fluid
+ // to
+ // resitrct
+ // hatch
+ // to
+ 128000, // Capacity
+ 968, // ID
+ "hatch.pyrotheum.input.tier.00", // unlocal name
+ "Pyrotheum Heating Vent" // Local name
+ )
+ .getStackForm(1L));
+
+ GregtechItemList.Hatch_Input_Naquadah.set(new GT_MetaTileEntity_Hatch_Naquadah(
+ 969, // ID
+ "hatch.naquadah.input.tier.00", // unlocal name
+ "Naquadah Reactor Input hatch" // Local name
+ )
+ .getStackForm(1L));
+
+ GregtechItemList.Hatch_Input_TurbineHousing.set(new GT_MetaTileEntity_Hatch_TurbineProvider(
+ 31025, // ID
+ "hatch.turbine.input.tier.00", // unlocal name
+ "Turbine Housing", // Local name
+ 8)
+ .getStackForm(1L));
+
+ // Multiblock Control Core Bus
+ GregtechItemList.Hatch_Control_Core.set(
+ (new GT_MetaTileEntity_Hatch_ControlCore(30020, "hatch.control.adv", "Control Core Module", 1))
+ .getStackForm(1L));
+
+ // Multiblock Air Intake Hatch
+ GregtechItemList.Hatch_Air_Intake.set(
+ new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Air_Intake_Extreme.set(new GT_MetaTileEntity_Hatch_AirIntake_Extreme(
+ 31070, "hatch.air.intake.tier.01", "Extreme Air Intake Hatch", 6)
+ .getStackForm(1L));
+
+ // Multiblock Reservoir Hatch
+ GregtechItemList.Hatch_Reservoir.set(
+ new GT_MetaTileEntity_Hatch_Reservoir(31071, "hatch.water.intake.tier.00", "Reservoir Hatch", 6)
+ .getStackForm(1L));
+
+ // Steam Hatch
+ GregtechItemList.Hatch_Input_Steam.set(new GT_MetaTileEntity_Hatch_CustomFluidBase(
+ FluidUtils.getSteam(1).getFluid(), // Fluid
+ // to
+ // resitrct
+ // hatch
+ // to
+ 64000, // Capacity
+ 31040, // ID
+ "hatch.steam.input.tier.00", // unlocal name
+ "Steam Hatch" // Local name
+ )
+ .getStackForm(1L));
+ }
+
+ private static void run2() {
+ GregtechItemList.Hatch_Muffler_Adv_LV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ 30001, "hatch.muffler.adv.tier.01", "Advanced Muffler Hatch (LV)", 1))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Muffler_Adv_MV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ 30002, "hatch.muffler.adv.tier.02", "Advanced Muffler Hatch (MV)", 2))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Muffler_Adv_HV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ 30003, "hatch.muffler.adv.tier.03", "Advanced Muffler Hatch (HV)", 3))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Muffler_Adv_EV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ 30004, "hatch.muffler.adv.tier.04", "Advanced Muffler Hatch (EV)", 4))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Muffler_Adv_IV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ 30005, "hatch.muffler.adv.tier.05", "Advanced Muffler Hatch (IV)", 5))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Muffler_Adv_LuV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ 30006, "hatch.muffler.adv.tier.06", "Advanced Muffler Hatch (LuV)", 6))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Muffler_Adv_ZPM.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ 30007, "hatch.muffler.adv.tier.07", "Advanced Muffler Hatch (ZPM)", 7))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Muffler_Adv_UV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ 30008, "hatch.muffler.adv.tier.08", "Advanced Muffler Hatch (UV)", 8))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Muffler_Adv_MAX.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(
+ 30009, "hatch.muffler.adv.tier.09", "Advanced Muffler Hatch (MAX)", 9))
+ .getStackForm(1L));
+ }
+
+ private static void run3() {
+ /*
+ * Super Input Busses
+ */
+
+ int aStartID = 30021;
+
+ GregtechItemList.Hatch_SuperBus_Input_ULV.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.00", "Super Bus (I) (ULV)", 0))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Input_LV.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.01", "Super Bus (I) (LV)", 1))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Input_MV.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.02", "Super Bus (I) (MV)", 2))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Input_HV.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.03", "Super Bus (I) (HV)", 3))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Input_EV.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.04", "Super Bus (I) (EV)", 4))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Input_IV.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.05", "Super Bus (I) (IV)", 5))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Input_LuV.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.06", "Super Bus (I) (LuV)", 6))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Input_ZPM.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.07", "Super Bus (I) (ZPM)", 7))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Input_UV.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.08", "Super Bus (I) (UV)", 8))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Input_MAX.set(
+ ((IMetaTileEntity) makeInputBus(aStartID++, "hatch.superbus.input.tier.09", "Super Bus (I) (MAX)", 9))
+ .getStackForm(1L));
+
+ /*
+ * Super Output Busses
+ */
+
+ GregtechItemList.Hatch_SuperBus_Output_ULV.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.00", "Super Bus (O) (ULV)", 0))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Output_LV.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.01", "Super Bus (O) (LV)", 1))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Output_MV.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.02", "Super Bus (O) (MV)", 2))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Output_HV.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.03", "Super Bus (O) (HV)", 3))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Output_EV.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.04", "Super Bus (O) (EV)", 4))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Output_IV.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.05", "Super Bus (O) (IV)", 5))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Output_LuV.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.06", "Super Bus (O) (LuV)", 6))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Output_ZPM.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.07", "Super Bus (O) (ZPM)", 7))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Output_UV.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.08", "Super Bus (O) (UV)", 8))
+ .getStackForm(1L));
+ GregtechItemList.Hatch_SuperBus_Output_MAX.set(
+ ((IMetaTileEntity) makeOutputBus(aStartID++, "hatch.superbus.output.tier.09", "Super Bus (O) (MAX)", 9))
+ .getStackForm(1L));
+ }
+
+ private static GT_MetaTileEntity_SuperBus_Input makeInputBus(
+ int id, String unlocalizedName, String localizedName, int tier) {
+ return new GT_MetaTileEntity_SuperBus_Input(id, unlocalizedName, localizedName, tier);
+ }
+
+ private static GT_MetaTileEntity_SuperBus_Output makeOutputBus(
+ int id, String unlocalizedName, String localizedName, int tier) {
+ return new GT_MetaTileEntity_SuperBus_Output(id, unlocalizedName, localizedName, tier);
+ }
+
+ private static void run4() {
+ int aID = 31060;
+ // 41, "hatch.energy.tier.01", "LV Energy Hatch", 1
+ GT_MetaTileEntity_Hatch_Energy_RTG aHatch1 =
+ new GT_MetaTileEntity_Hatch_Energy_RTG(aID++, "hatch.energy.rtg.tier.01", "RTG Power Unit [LV]", 1, 9);
+ GT_MetaTileEntity_Hatch_Energy_RTG aHatch2 =
+ new GT_MetaTileEntity_Hatch_Energy_RTG(aID++, "hatch.energy.rtg.tier.02", "RTG Power Unit [MV]", 2, 9);
+ GT_MetaTileEntity_Hatch_Energy_RTG aHatch3 =
+ new GT_MetaTileEntity_Hatch_Energy_RTG(aID++, "hatch.energy.rtg.tier.03", "RTG Power Unit [HV]", 3, 9);
+
+ GregtechItemList.Hatch_RTG_LV.set(aHatch1.getStackForm(1L));
+ GregtechItemList.Hatch_RTG_MV.set(aHatch2.getStackForm(1L));
+ GregtechItemList.Hatch_RTG_HV.set(aHatch3.getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCyclotron.java
index e095ed4cbe..7312bae5f7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCyclotron.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCyclotron.java
@@ -6,17 +6,16 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechCyclotron {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering COMET Cyclotron.");
- run1();
- }
- }
-
- private static void run1() {
- GregtechItemList.COMET_Cyclotron
- .set(new GregtechMetaTileEntity_Cyclotron(828, "cyclotron.tier.single", "COMET - Compact Cyclotron", 6)
- .getStackForm(1L));
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering COMET Cyclotron.");
+ run1();
+ }
+ }
+ private static void run1() {
+ GregtechItemList.COMET_Cyclotron.set(
+ new GregtechMetaTileEntity_Cyclotron(828, "cyclotron.tier.single", "COMET - Compact Cyclotron", 6)
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
index a8b5aea0e6..6dba10bb98 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
@@ -17,177 +17,259 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
import net.minecraft.item.ItemStack;
public class GregtechDehydrator {
- public static void run() {
- if (LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Chemical Dehydrators.");
- if (CORE.ConfigSwitches.enableMachine_Dehydrators) {
- run1();
- }
- }
-
- }
-
- private static void run1() {
-
- /*
- *
- * 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) {
- *
- */
-
- //Basic
- GregtechItemList.GT_Dehydrator_MV
- .set(new GT_MetaTileEntity_Dehydrator(
- 911,
- "machine.dehydrator.tier.00",
- "Basic Dehydrator I",
- 2,
- "This dehydrates your Grapes into Raisins.",
- 16000)
- .getStackForm(1L));
-
- GregtechItemList.GT_Dehydrator_HV
- .set(new GT_MetaTileEntity_Dehydrator(
- 912,
- "machine.dehydrator.tier.01",
- "Basic Dehydrator II",
- 3,
- "This dehydrates your Grapes into Raisins.",
- 32000)
- .getStackForm(1L));
-
-
- //Chemical
-
- GregtechItemList.GT_Dehydrator_EV
- .set(new GT_MetaTileEntity_Dehydrator(
- 813,
- "advancedmachine.dehydrator.tier.01",
- "Chemical Dehydrator I",
- 4,
- "A hangover is the way your body reacts to dehydration.",
- 48000)
- .getStackForm(1L));
-
- GregtechItemList.GT_Dehydrator_IV
- .set(new GT_MetaTileEntity_Dehydrator(
- 814,
- "advancedmachine.dehydrator.tier.02",
- "Chemical Dehydrator II",
- 5,
- "A hangover is the way your body reacts to dehydration.",
- 48000)
- .getStackForm(1L));
-
- GregtechItemList.GT_Dehydrator_LuV
- .set(new GT_MetaTileEntity_Dehydrator(
- 815,
- "advancedmachine.dehydrator.tier.03",
- "Chemical Dehydrator III",
- 6,
- "You could probably make space icecream with this..",
- 64000)
- .getStackForm(1L));
-
- GregtechItemList.GT_Dehydrator_ZPM
- .set(new GT_MetaTileEntity_Dehydrator(
- 816,
- "advancedmachine.dehydrator.tier.04",
- "Chemical Dehydrator IV",
- 7,
- "You can definitely make space icecream with this..",
- 64000)
- .getStackForm(1L));
-
- //Advanced
- GregtechItemList.Controller_Vacuum_Furnace.set(new GregtechMetaTileEntity_IndustrialDehydrator(995, "multimachine.adv.vacuumfurnace", "Utupu-Tanuri").getStackForm(1L));
-
-
- ItemStack coilWire1 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire", "coilWire1", 0,
- 4);
- ItemStack coilWire2 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:1", "coilWire2", 1,
- 4);
- ItemStack coilWire3 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:2", "coilWire3", 2,
- 4);
- ItemStack coilWire4 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:3", "coilWire4", 3,
- 4);
- ItemStack coilT1 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil", "coil1", 0, 1);
- ItemStack coilT2 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil:1", "coil2", 1, 1);
- ItemStack coilT3 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil:2", "coil3", 2, 1);
- ItemStack coilT4 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil:3", "coil4", 3, 1);
- ItemStack spoolT1 = ItemUtils.getItemStackOfAmountFromOreDict("pipeMediumBronze", 1);
- ItemStack spoolT2 = ItemUtils.getItemStackOfAmountFromOreDict("pipeMediumSteel", 1);
- ItemStack spoolT3 = ItemUtils.getItemStackOfAmountFromOreDict("pipeMediumStainlessSteel", 1);
- ItemStack spoolT4 = ItemUtils.getItemStackOfAmountFromOreDict("pipeMediumTitanium", 1);
-
- // Make some coils by wrapping wire around a spool.
- GT_Values.RA.addAssemblerRecipe(coilWire1, spoolT1, coilT1, 8 * 20, 120);
- GT_Values.RA.addAssemblerRecipe(coilWire2, spoolT2, coilT2, 8 * 20, 240);
- GT_Values.RA.addAssemblerRecipe(coilWire3, spoolT3, coilT3, 8 * 20, 480);
- GT_Values.RA.addAssemblerRecipe(coilWire4, spoolT4, coilT4, 8 * 20, 960);
-
- // Add recipes for the Dehydrators.
-
- //Basic
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Dehydrator_MV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('P'),
- ItemList.Robot_Arm_MV, Character.valueOf('E'), OrePrefixes.wireFine.get(Materials.RedAlloy), Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'),
- OrePrefixes.cableGt04.get(Materials.Copper), Character.valueOf('G'),
- OrePrefixes.gearGt.get(Materials.Steel) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Dehydrator_HV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('P'),
- ItemList.Robot_Arm_HV, Character.valueOf('E'), OrePrefixes.wireFine.get(Materials.Electrum), Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'),
- OrePrefixes.cableGt04.get(Materials.Silver), Character.valueOf('G'),
- ALLOY.POTIN.getGear(1) });
-
- //Chemical
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Dehydrator_EV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'),
- ItemList.Robot_Arm_EV, Character.valueOf('E'), coilT1, Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Data), Character.valueOf('W'),
- OrePrefixes.cableGt04.get(Materials.Aluminium), Character.valueOf('G'),
- ALLOY.TUMBAGA.getGear(1) });
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Dehydrator_IV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'),
- ItemList.Robot_Arm_IV, Character.valueOf('E'), coilT2, Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'),
- OrePrefixes.cableGt04.get(Materials.Tungsten), Character.valueOf('G'),
- ALLOY.INCONEL_690.getGear(1) });
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Dehydrator_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'),
- CI.robotArm_LuV, Character.valueOf('E'), coilT3, Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Master), Character.valueOf('W'),
- OrePrefixes.cableGt04.get(Materials.Naquadah), Character.valueOf('G'),
- ALLOY.HASTELLOY_N.getGear(1) });
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Dehydrator_ZPM.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('P'),
- CI.robotArm_ZPM, Character.valueOf('E'), coilT4, Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'),
- OrePrefixes.cableGt04.get(Materials.Osmium), Character.valueOf('G'),
- ALLOY.ZERON_100.getGear(1) });
-
- }
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Chemical Dehydrators.");
+ if (CORE.ConfigSwitches.enableMachine_Dehydrators) {
+ run1();
+ }
+ }
+ }
+
+ private static void run1() {
+
+ /*
+ *
+ * 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) {
+ *
+ */
+
+ // Basic
+ GregtechItemList.GT_Dehydrator_MV.set(new GT_MetaTileEntity_Dehydrator(
+ 911,
+ "machine.dehydrator.tier.00",
+ "Basic Dehydrator I",
+ 2,
+ "This dehydrates your Grapes into Raisins.",
+ 16000)
+ .getStackForm(1L));
+
+ GregtechItemList.GT_Dehydrator_HV.set(new GT_MetaTileEntity_Dehydrator(
+ 912,
+ "machine.dehydrator.tier.01",
+ "Basic Dehydrator II",
+ 3,
+ "This dehydrates your Grapes into Raisins.",
+ 32000)
+ .getStackForm(1L));
+
+ // Chemical
+
+ GregtechItemList.GT_Dehydrator_EV.set(new GT_MetaTileEntity_Dehydrator(
+ 813,
+ "advancedmachine.dehydrator.tier.01",
+ "Chemical Dehydrator I",
+ 4,
+ "A hangover is the way your body reacts to dehydration.",
+ 48000)
+ .getStackForm(1L));
+
+ GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_Dehydrator(
+ 814,
+ "advancedmachine.dehydrator.tier.02",
+ "Chemical Dehydrator II",
+ 5,
+ "A hangover is the way your body reacts to dehydration.",
+ 48000)
+ .getStackForm(1L));
+
+ GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_Dehydrator(
+ 815,
+ "advancedmachine.dehydrator.tier.03",
+ "Chemical Dehydrator III",
+ 6,
+ "You could probably make space icecream with this..",
+ 64000)
+ .getStackForm(1L));
+
+ GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_Dehydrator(
+ 816,
+ "advancedmachine.dehydrator.tier.04",
+ "Chemical Dehydrator IV",
+ 7,
+ "You can definitely make space icecream with this..",
+ 64000)
+ .getStackForm(1L));
+
+ // Advanced
+ GregtechItemList.Controller_Vacuum_Furnace.set(
+ new GregtechMetaTileEntity_IndustrialDehydrator(995, "multimachine.adv.vacuumfurnace", "Utupu-Tanuri")
+ .getStackForm(1L));
+
+ ItemStack coilWire1 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire", "coilWire1", 0, 4);
+ ItemStack coilWire2 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:1", "coilWire2", 1, 4);
+ ItemStack coilWire3 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:2", "coilWire3", 2, 4);
+ ItemStack coilWire4 =
+ ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:3", "coilWire4", 3, 4);
+ ItemStack coilT1 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil", "coil1", 0, 1);
+ ItemStack coilT2 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil:1", "coil2", 1, 1);
+ ItemStack coilT3 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil:2", "coil3", 2, 1);
+ ItemStack coilT4 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil:3", "coil4", 3, 1);
+ ItemStack spoolT1 = ItemUtils.getItemStackOfAmountFromOreDict("pipeMediumBronze", 1);
+ ItemStack spoolT2 = ItemUtils.getItemStackOfAmountFromOreDict("pipeMediumSteel", 1);
+ ItemStack spoolT3 = ItemUtils.getItemStackOfAmountFromOreDict("pipeMediumStainlessSteel", 1);
+ ItemStack spoolT4 = ItemUtils.getItemStackOfAmountFromOreDict("pipeMediumTitanium", 1);
+
+ // Make some coils by wrapping wire around a spool.
+ GT_Values.RA.addAssemblerRecipe(coilWire1, spoolT1, coilT1, 8 * 20, 120);
+ GT_Values.RA.addAssemblerRecipe(coilWire2, spoolT2, coilT2, 8 * 20, 240);
+ GT_Values.RA.addAssemblerRecipe(coilWire3, spoolT3, coilT3, 8 * 20, 480);
+ GT_Values.RA.addAssemblerRecipe(coilWire4, spoolT4, coilT4, 8 * 20, 960);
+
+ // Add recipes for the Dehydrators.
+
+ // Basic
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Dehydrator_MV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "ECE",
+ "WMW",
+ "GPG",
+ Character.valueOf('M'),
+ ItemList.Hull_MV,
+ Character.valueOf('P'),
+ ItemList.Robot_Arm_MV,
+ Character.valueOf('E'),
+ OrePrefixes.wireFine.get(Materials.RedAlloy),
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Good),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt04.get(Materials.Copper),
+ Character.valueOf('G'),
+ OrePrefixes.gearGt.get(Materials.Steel)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Dehydrator_HV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "ECE",
+ "WMW",
+ "GPG",
+ Character.valueOf('M'),
+ ItemList.Hull_HV,
+ Character.valueOf('P'),
+ ItemList.Robot_Arm_HV,
+ Character.valueOf('E'),
+ OrePrefixes.wireFine.get(Materials.Electrum),
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Advanced),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt04.get(Materials.Silver),
+ Character.valueOf('G'),
+ ALLOY.POTIN.getGear(1)
+ });
+
+ // Chemical
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Dehydrator_EV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "ECE",
+ "WMW",
+ "GPG",
+ Character.valueOf('M'),
+ ItemList.Hull_EV,
+ Character.valueOf('P'),
+ ItemList.Robot_Arm_EV,
+ Character.valueOf('E'),
+ coilT1,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Data),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt04.get(Materials.Aluminium),
+ Character.valueOf('G'),
+ ALLOY.TUMBAGA.getGear(1)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Dehydrator_IV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "ECE",
+ "WMW",
+ "GPG",
+ Character.valueOf('M'),
+ ItemList.Hull_IV,
+ Character.valueOf('P'),
+ ItemList.Robot_Arm_IV,
+ Character.valueOf('E'),
+ coilT2,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Elite),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt04.get(Materials.Tungsten),
+ Character.valueOf('G'),
+ ALLOY.INCONEL_690.getGear(1)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Dehydrator_LuV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "ECE",
+ "WMW",
+ "GPG",
+ Character.valueOf('M'),
+ ItemList.Hull_LuV,
+ Character.valueOf('P'),
+ CI.robotArm_LuV,
+ Character.valueOf('E'),
+ coilT3,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Master),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt04.get(Materials.Naquadah),
+ Character.valueOf('G'),
+ ALLOY.HASTELLOY_N.getGear(1)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Dehydrator_ZPM.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "ECE",
+ "WMW",
+ "GPG",
+ Character.valueOf('M'),
+ ItemList.Hull_ZPM,
+ Character.valueOf('P'),
+ CI.robotArm_ZPM,
+ Character.valueOf('E'),
+ coilT4,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Ultimate),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt04.get(Materials.Osmium),
+ Character.valueOf('G'),
+ ALLOY.ZERON_100.getGear(1)
+ });
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
index e82fade029..1eed50db26 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
@@ -4,7 +4,6 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
@@ -14,81 +13,241 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.creative.GregtechMetaCreativeEnergyBuffer;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer;
-public class GregtechEnergyBuffer
-{
-
- //Misc Items
- //public static Item itemBufferCore;
-
- public static void run()
- {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
- Logger.INFO("Gregtech5u Content | Registering Energy Buffer Blocks.");
- run1();
- }
- }
-
- private static void run1()
- {
-
- //itemBufferCore = new Item().setUnlocalizedName("itemBufferCore").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemBufferCore");
-
- //Registry
- //GameRegistry.registerItem(itemBufferCore, "itemBufferCore");
- //LanguageRegistry.addName(itemBufferCore, "Buffer Core");
- //OreDictionary.registerOre("itemBufferCore", itemBufferCore);
-
-
- //Energy Buffers
- GregtechItemList.Energy_Buffer_1by1_ULV.set(new GregtechMetaEnergyBuffer(770, "energybuffer.tier.00", "Ultra Low Voltage Energy Buffer", 0, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_LV.set(new GregtechMetaEnergyBuffer(771, "energybuffer.tier.01", "Low Voltage Energy Buffer", 1, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_MV.set(new GregtechMetaEnergyBuffer(772, "energybuffer.tier.02", "Medium Voltage Energy Buffer", 2, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_HV.set(new GregtechMetaEnergyBuffer(773, "energybuffer.tier.03", "High Voltage Energy Buffer", 3, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_EV.set(new GregtechMetaEnergyBuffer(774, "energybuffer.tier.04", "Extreme Voltage Energy Buffer", 4, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_IV.set(new GregtechMetaEnergyBuffer(775, "energybuffer.tier.05", "Insane Voltage Energy Buffer", 5, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_LuV.set(new GregtechMetaEnergyBuffer(776, "energybuffer.tier.06", "Ludicrous Voltage Energy Buffer", 6, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_ZPM.set(new GregtechMetaEnergyBuffer(777, "energybuffer.tier.07", "ZPM Voltage Energy Buffer", 7, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_UV.set(new GregtechMetaEnergyBuffer(778, "energybuffer.tier.08", "Ultimate Voltage Energy Buffer", 8, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_MAX.set(new GregtechMetaEnergyBuffer(779, "energybuffer.tier.09", "MAX Voltage Energy Buffer", 9, "", 1).getStackForm(1L));
- // Creative Buffer Has Special ID
- GregtechItemList.Energy_Buffer_CREATIVE
- .set(new GregtechMetaCreativeEnergyBuffer(750,
- "energybuffer.tier.xx",
- "512V Creative Energy Buffer", 3, "", 0)
- .getStackForm(1L));
-
- if (LoadedMods.CoFHCore && CORE.ConfigSwitches.enableMachine_RF_Convetor) {
- // RF Convertor Buffer Has Special ID
- GregtechItemList.Energy_Buffer_RF_Convertor
- .set(new GT_MetaTileEntity_RfConvertor(31022,
- "energybuffer.rf.tier.01",
- "RF Energy Convertor", 3, "", 0)
- .getStackForm(1L));
- }
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_ULV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Lead), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Tin), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.AnyCopper), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Gold), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Aluminium), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Tungsten), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_LuV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_ZPM.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_UV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Superconductor), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- /*GT_ModHandler.addCraftingRecipe(
- GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE
- | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE
- | GT_ModHandler.RecipeBits.BUFFERED, new Object[] {
- "WTW", "WMW", Character.valueOf('M'),
- ItemList.Hull_MAX, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Superconductor),
- Character.valueOf('T'), GregtechOreDictNames.buffer_core });*/
-
-
-
-
- }
+public class GregtechEnergyBuffer {
+
+ // Misc Items
+ // public static Item itemBufferCore;
+
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Energy Buffer Blocks.");
+ run1();
+ }
+ }
+
+ private static void run1() {
+
+ // itemBufferCore = new
+ // Item().setUnlocalizedName("itemBufferCore").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemBufferCore");
+
+ // Registry
+ // GameRegistry.registerItem(itemBufferCore, "itemBufferCore");
+ // LanguageRegistry.addName(itemBufferCore, "Buffer Core");
+ // OreDictionary.registerOre("itemBufferCore", itemBufferCore);
+
+ // Energy Buffers
+ GregtechItemList.Energy_Buffer_1by1_ULV.set(
+ new GregtechMetaEnergyBuffer(770, "energybuffer.tier.00", "Ultra Low Voltage Energy Buffer", 0, "", 1)
+ .getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_LV.set(
+ new GregtechMetaEnergyBuffer(771, "energybuffer.tier.01", "Low Voltage Energy Buffer", 1, "", 1)
+ .getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_MV.set(
+ new GregtechMetaEnergyBuffer(772, "energybuffer.tier.02", "Medium Voltage Energy Buffer", 2, "", 1)
+ .getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_HV.set(
+ new GregtechMetaEnergyBuffer(773, "energybuffer.tier.03", "High Voltage Energy Buffer", 3, "", 1)
+ .getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_EV.set(
+ new GregtechMetaEnergyBuffer(774, "energybuffer.tier.04", "Extreme Voltage Energy Buffer", 4, "", 1)
+ .getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_IV.set(
+ new GregtechMetaEnergyBuffer(775, "energybuffer.tier.05", "Insane Voltage Energy Buffer", 5, "", 1)
+ .getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_LuV.set(
+ new GregtechMetaEnergyBuffer(776, "energybuffer.tier.06", "Ludicrous Voltage Energy Buffer", 6, "", 1)
+ .getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_ZPM.set(
+ new GregtechMetaEnergyBuffer(777, "energybuffer.tier.07", "ZPM Voltage Energy Buffer", 7, "", 1)
+ .getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_UV.set(
+ new GregtechMetaEnergyBuffer(778, "energybuffer.tier.08", "Ultimate Voltage Energy Buffer", 8, "", 1)
+ .getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_MAX.set(
+ new GregtechMetaEnergyBuffer(779, "energybuffer.tier.09", "MAX Voltage Energy Buffer", 9, "", 1)
+ .getStackForm(1L));
+ // Creative Buffer Has Special ID
+ GregtechItemList.Energy_Buffer_CREATIVE.set(new GregtechMetaCreativeEnergyBuffer(
+ 750, "energybuffer.tier.xx", "512V Creative Energy Buffer", 3, "", 0)
+ .getStackForm(1L));
+
+ if (LoadedMods.CoFHCore && CORE.ConfigSwitches.enableMachine_RF_Convetor) {
+ // RF Convertor Buffer Has Special ID
+ GregtechItemList.Energy_Buffer_RF_Convertor.set(
+ new GT_MetaTileEntity_RfConvertor(31022, "energybuffer.rf.tier.01", "RF Energy Convertor", 3, "", 0)
+ .getStackForm(1L));
+ }
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_ULV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_ULV,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Lead),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_LV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_LV,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Tin),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_MV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_MV,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.AnyCopper),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_HV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_HV,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Gold),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_EV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_EV,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Aluminium),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_IV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_IV,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Tungsten),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_LuV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_LuV,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Osmium),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_ZPM.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_ZPM,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Osmium),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_UV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_UV,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Osmium),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "WTW",
+ "WMW",
+ Character.valueOf('M'),
+ ItemList.Hull_MAX,
+ Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Superconductor),
+ Character.valueOf('T'),
+ GregtechOreDictNames.buffer_core
+ });
+ /*GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED, new Object[] {
+ "WTW", "WMW", Character.valueOf('M'),
+ ItemList.Hull_MAX, Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Superconductor),
+ Character.valueOf('T'), GregtechOreDictNames.buffer_core });*/
+
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java
index 67c54a7699..f07091e481 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java
@@ -12,24 +12,32 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.ad
public class GregtechFactoryGradeReplacementMultis {
- public static void run() {
- run1();
- }
+ public static void run() {
+ run1();
+ }
- private static void run1() {
- Logger.INFO("Gregtech 5 Content | Registering Advanced GT Multiblock replacements.");
- GregtechItemList.Machine_Adv_BlastFurnace.set(new GregtechMetaTileEntity_Adv_EBF(963, "multimachine.adv.blastfurnace", "Volcanus").getStackForm(1L));
- GregtechItemList.Machine_Adv_ImplosionCompressor.set(new GregtechMetaTileEntity_Adv_Implosion(964, "multimachine.adv.implosioncompressor", "Density^2").getStackForm(1L));
- GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer(910, "multimachine.adv.industrialfreezer", "Cryogenic Freezer").getStackForm(1L));
- GregtechItemList.FusionComputer_UV2.set(new GregtechMetaTileEntity_Adv_Fusion_MK4(965, "fusioncomputer.tier.09", "FusionTech MK IV").getStackForm(1L));
-
-
- //31021
- GregtechItemList.Machine_Adv_DistillationTower.set(new GregtechMetaTileEntity_Adv_DistillationTower(31021, "multimachine.adv.distillationtower", "Dangote Distillus").getStackForm(1L));
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- GregtechItemList.Machine_Adv_AssemblyLine.set(new GregtechMetaTileEntity_Adv_AssemblyLine(31024, "multimachine.adv.assemblyline", "Compound Fabricator").getStackForm(1L));
- }
-
- }
+ private static void run1() {
+ Logger.INFO("Gregtech 5 Content | Registering Advanced GT Multiblock replacements.");
+ GregtechItemList.Machine_Adv_BlastFurnace.set(
+ new GregtechMetaTileEntity_Adv_EBF(963, "multimachine.adv.blastfurnace", "Volcanus").getStackForm(1L));
+ GregtechItemList.Machine_Adv_ImplosionCompressor.set(
+ new GregtechMetaTileEntity_Adv_Implosion(964, "multimachine.adv.implosioncompressor", "Density^2")
+ .getStackForm(1L));
+ GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer(
+ 910, "multimachine.adv.industrialfreezer", "Cryogenic Freezer")
+ .getStackForm(1L));
+ GregtechItemList.FusionComputer_UV2.set(
+ new GregtechMetaTileEntity_Adv_Fusion_MK4(965, "fusioncomputer.tier.09", "FusionTech MK IV")
+ .getStackForm(1L));
+ // 31021
+ GregtechItemList.Machine_Adv_DistillationTower.set(new GregtechMetaTileEntity_Adv_DistillationTower(
+ 31021, "multimachine.adv.distillationtower", "Dangote Distillus")
+ .getStackForm(1L));
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ GregtechItemList.Machine_Adv_AssemblyLine.set(new GregtechMetaTileEntity_Adv_AssemblyLine(
+ 31024, "multimachine.adv.assemblyline", "Compound Fabricator")
+ .getStackForm(1L));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java
index 86146640fd..81420275da 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java
@@ -1,25 +1,22 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor;
-
public class GregtechFluidReactor {
- public static void run() {
-
- /*
- * GregtechItemList.FluidReactor_LV .set(new
- * GregtechMetaTileEntity_ChemicalReactor(31021, "chemicalplant.01.tier.01",
- * "Chemical Plant I", 1) .getStackForm(1L)); GregtechItemList.FluidReactor_HV
- * .set(new GregtechMetaTileEntity_ChemicalReactor(31022,
- * "chemicalplant.01.tier.02", "Chemical Plant II", 3) .getStackForm(1L));
- * GregtechItemList.FluidReactor_IV .set(new
- * GregtechMetaTileEntity_ChemicalReactor(31023, "chemicalplant.01.tier.03",
- * "Chemical Plant III", 5) .getStackForm(1L));
- * GregtechItemList.FluidReactor_ZPM .set(new
- * GregtechMetaTileEntity_ChemicalReactor(31024, "chemicalplant.01.tier.04",
- * "Chemical Plant IV", 7) .getStackForm(1L));
- */
-
- }
+ public static void run() {
+
+ /*
+ * GregtechItemList.FluidReactor_LV .set(new
+ * GregtechMetaTileEntity_ChemicalReactor(31021, "chemicalplant.01.tier.01",
+ * "Chemical Plant I", 1) .getStackForm(1L)); GregtechItemList.FluidReactor_HV
+ * .set(new GregtechMetaTileEntity_ChemicalReactor(31022,
+ * "chemicalplant.01.tier.02", "Chemical Plant II", 3) .getStackForm(1L));
+ * GregtechItemList.FluidReactor_IV .set(new
+ * GregtechMetaTileEntity_ChemicalReactor(31023, "chemicalplant.01.tier.03",
+ * "Chemical Plant III", 5) .getStackForm(1L));
+ * GregtechItemList.FluidReactor_ZPM .set(new
+ * GregtechMetaTileEntity_ChemicalReactor(31024, "chemicalplant.01.tier.04",
+ * "Chemical Plant IV", 7) .getStackForm(1L));
+ */
+
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java
index 1663c9ada4..f93f6e165a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java
@@ -1,5 +1,7 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
+import static gtPlusPlus.core.recipe.common.CI.bitsd;
+
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -9,18 +11,70 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV.GT_MetaTileEn
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV.GT_MetaTileEntity_ULV_GasTurbine;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV.GT_MetaTileEntity_ULV_SteamTurbine;
-import static gtPlusPlus.core.recipe.common.CI.bitsd;
-
public class GregtechGeneratorsULV {
- public static void run(){
-
- GregtechItemList.Generator_Diesel_ULV.set(new GT_MetaTileEntity_ULV_CombustionGenerator(960, "basicgenerator.diesel.tier.00", "Simple Combustion Generator", 0).getStackForm(1L));
- GregtechItemList.Generator_Gas_Turbine_ULV.set(new GT_MetaTileEntity_ULV_GasTurbine(961, "basicgenerator.gas.tier.00", "Simple Gas Turbine", 0).getStackForm(1L));
- GregtechItemList.Generator_Steam_Turbine_ULV.set(new GT_MetaTileEntity_ULV_SteamTurbine(962, "basicgenerator.steam.tier.00", "Simple Steam Turbine", 0).getStackForm(1L));
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Diesel_ULV.get(1L, new Object[0]), bitsd, new Object[]{"PCP", "EME", "GWG", 'M', ItemList.Hull_ULV, 'P', GregtechItemList.Electric_Piston_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'G', OrePrefixes.gearGt.get(Materials.Bronze)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Gas_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[]{"CRC", "RMR", "EWE", 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Steam_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[]{"PCP", "RMR", "EWE", 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'P', OrePrefixes.pipeMedium.get(Materials.Copper)});
-
- }
-} \ No newline at end of file
+ public static void run() {
+
+ GregtechItemList.Generator_Diesel_ULV.set(new GT_MetaTileEntity_ULV_CombustionGenerator(
+ 960, "basicgenerator.diesel.tier.00", "Simple Combustion Generator", 0)
+ .getStackForm(1L));
+ GregtechItemList.Generator_Gas_Turbine_ULV.set(
+ new GT_MetaTileEntity_ULV_GasTurbine(961, "basicgenerator.gas.tier.00", "Simple Gas Turbine", 0)
+ .getStackForm(1L));
+ GregtechItemList.Generator_Steam_Turbine_ULV.set(
+ new GT_MetaTileEntity_ULV_SteamTurbine(962, "basicgenerator.steam.tier.00", "Simple Steam Turbine", 0)
+ .getStackForm(1L));
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Generator_Diesel_ULV.get(1L, new Object[0]), bitsd, new Object[] {
+ "PCP",
+ "EME",
+ "GWG",
+ 'M',
+ ItemList.Hull_ULV,
+ 'P',
+ GregtechItemList.Electric_Piston_ULV,
+ 'E',
+ GregtechItemList.Electric_Motor_ULV,
+ 'C',
+ OrePrefixes.circuit.get(Materials.Primitive),
+ 'W',
+ OrePrefixes.cableGt01.get(Materials.RedAlloy),
+ 'G',
+ OrePrefixes.gearGt.get(Materials.Bronze)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Generator_Gas_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[] {
+ "CRC",
+ "RMR",
+ "EWE",
+ 'M',
+ ItemList.Hull_ULV,
+ 'E',
+ GregtechItemList.Electric_Motor_ULV,
+ 'R',
+ OrePrefixes.rotor.get(Materials.Tin),
+ 'C',
+ OrePrefixes.circuit.get(Materials.Primitive),
+ 'W',
+ OrePrefixes.cableGt01.get(Materials.RedAlloy)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Generator_Steam_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[] {
+ "PCP",
+ "RMR",
+ "EWE",
+ 'M',
+ ItemList.Hull_ULV,
+ 'E',
+ GregtechItemList.Electric_Motor_ULV,
+ 'R',
+ OrePrefixes.rotor.get(Materials.Tin),
+ 'C',
+ OrePrefixes.circuit.get(Materials.Primitive),
+ 'W',
+ OrePrefixes.cableGt01.get(Materials.RedAlloy),
+ 'P',
+ OrePrefixes.pipeMedium.get(Materials.Copper)
+ });
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java
index 2e7e96dd2f..cb8dfaf0c1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java
@@ -1,12 +1,9 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
@@ -14,55 +11,102 @@ import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntityGeothermalGenerator;
+import net.minecraft.item.ItemStack;
public class GregtechGeothermalThermalGenerator {
- public static void run() {
- if (LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Geothermal Engines.");
- if (CORE.ConfigSwitches.enableMachine_GeothermalEngines) {
- run1();
- }
- }
-
- }
-
- private static void run1() {
- GregtechItemList.Geothermal_Engine_EV.set(new GregtechMetaTileEntityGeothermalGenerator(830,
- "advancedgenerator.geothermalFuel.tier.01", "Basic Geothermal Engine", 4).getStackForm(1L));
- GregtechItemList.Geothermal_Engine_IV.set(new GregtechMetaTileEntityGeothermalGenerator(831,
- "advancedgenerator.geothermalFuel.tier.02", "Turbo Geothermal Engine", 5).getStackForm(1L));
- GregtechItemList.Geothermal_Engine_LuV.set(new GregtechMetaTileEntityGeothermalGenerator(832,
- "advancedgenerator.geothermalFuel.tier.03", "Vulcan Geothermal Engine", 6).getStackForm(1L));
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Geothermal Engines.");
+ if (CORE.ConfigSwitches.enableMachine_GeothermalEngines) {
+ run1();
+ }
+ }
+ }
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Geothermal_Engine_EV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'),
- ItemList.Electric_Piston_EV, Character.valueOf('E'), ItemList.Electric_Motor_EV,
- Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'),
- OrePrefixes.cableGt04.get(Materials.Aluminium), Character.valueOf('G'),
- ALLOY.TANTALLOY_61.getGear(1) });
+ private static void run1() {
+ GregtechItemList.Geothermal_Engine_EV.set(new GregtechMetaTileEntityGeothermalGenerator(
+ 830, "advancedgenerator.geothermalFuel.tier.01", "Basic Geothermal Engine", 4)
+ .getStackForm(1L));
+ GregtechItemList.Geothermal_Engine_IV.set(new GregtechMetaTileEntityGeothermalGenerator(
+ 831, "advancedgenerator.geothermalFuel.tier.02", "Turbo Geothermal Engine", 5)
+ .getStackForm(1L));
+ GregtechItemList.Geothermal_Engine_LuV.set(new GregtechMetaTileEntityGeothermalGenerator(
+ 832, "advancedgenerator.geothermalFuel.tier.03", "Vulcan Geothermal Engine", 6)
+ .getStackForm(1L));
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Geothermal_Engine_IV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'),
- ItemList.Electric_Piston_IV, Character.valueOf('E'), ItemList.Electric_Motor_IV,
- Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Superconductor),
- Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Platinum), Character.valueOf('G'),
- ALLOY.STELLITE.getGear(1) });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Geothermal_Engine_EV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CEC",
+ "GMG",
+ "PWP",
+ Character.valueOf('M'),
+ ItemList.Hull_EV,
+ Character.valueOf('P'),
+ ItemList.Electric_Piston_EV,
+ Character.valueOf('E'),
+ ItemList.Electric_Motor_EV,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Ultimate),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt04.get(Materials.Aluminium),
+ Character.valueOf('G'),
+ ALLOY.TANTALLOY_61.getGear(1)
+ });
- final ItemStack INGREDIENT_1 = CI.electricPiston_LuV;
- final ItemStack INGREDIENT_2 = CI.electricMotor_LuV;
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Geothermal_Engine_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'),
- INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Infinite), Character.valueOf('W'),
- OrePrefixes.cableGt04.get(Materials.Tungsten), Character.valueOf('G'),
- ALLOY.ZERON_100.getGear(1) });
- }
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Geothermal_Engine_IV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CEC",
+ "GMG",
+ "PWP",
+ Character.valueOf('M'),
+ ItemList.Hull_IV,
+ Character.valueOf('P'),
+ ItemList.Electric_Piston_IV,
+ Character.valueOf('E'),
+ ItemList.Electric_Motor_IV,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Superconductor),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt04.get(Materials.Platinum),
+ Character.valueOf('G'),
+ ALLOY.STELLITE.getGear(1)
+ });
+ final ItemStack INGREDIENT_1 = CI.electricPiston_LuV;
+ final ItemStack INGREDIENT_2 = CI.electricMotor_LuV;
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Geothermal_Engine_LuV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CEC",
+ "GMG",
+ "PWP",
+ Character.valueOf('M'),
+ ItemList.Hull_LuV,
+ Character.valueOf('P'),
+ INGREDIENT_1,
+ Character.valueOf('E'),
+ INGREDIENT_2,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Infinite),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt04.get(Materials.Tungsten),
+ Character.valueOf('G'),
+ ALLOY.ZERON_100.getGear(1)
+ });
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java
index 9d1ef9a033..316a22ef1d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java
@@ -15,144 +15,352 @@ import net.minecraft.item.ItemStack;
public class GregtechHiAmpTransformer {
-
- public static void run(){
-
- long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED;
- int mID = 877;
-
- String mHammerName = "Hammer";
-
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
- mHammerName = "Mallet";
- }
-
- GregtechItemList.Transformer_HA_LV_ULV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.00",
- "ULV Hi-Amp Transformer", 0, "LV -> ULV (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- GregtechItemList.Transformer_HA_MV_LV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.01",
- "LV Hi-Amp Transformer", 1, "MV -> LV (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- GregtechItemList.Transformer_HA_HV_MV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.02",
- "MV Hi-Amp Transformer", 2, "HV -> MV (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- GregtechItemList.Transformer_HA_EV_HV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.03",
- "HV Hi-Amp Transformer", 3, "EV -> HV (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- GregtechItemList.Transformer_HA_IV_EV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.04",
- "EV Hi-Amp Transformer", 4, "IV -> EV (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- GregtechItemList.Transformer_HA_LuV_IV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.05",
- "IV Hi-Amp Transformer", 5, "LuV -> IV (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- GregtechItemList.Transformer_HA_ZPM_LuV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.06",
- "LuV Hi-Amp Transformer", 6, "ZPM -> LuV (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- GregtechItemList.Transformer_HA_UV_ZPM.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.07",
- "ZPM Hi-Amp Transformer", 7, "UV -> ZPM (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- if (!GTNH) {
- GregtechItemList.Transformer_HA_MAX_UV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.08",
- "UV Hi-Amp Transformer", 8, "Any Voltage -> UV (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- } else {
- GregtechItemList.Transformer_HA_MAX_UV.set(new GregtechMetaTransformerHiAmp(mID++, "transformer.ha.tier.08",
- "UV Hi-Amp Transformer", 8, "UHV -> UV (Use Soft "+mHammerName+" to invert)").getStackForm(1L));
- }
- ItemStack mItem_1;
- ItemStack mItem_2;
- ItemStack mItem_3;
-
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- mItem_1 = ItemUtils.simpleMetaStack(ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 3, 1);
- mItem_2 = ItemUtils.simpleMetaStack(ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 4, 1);
- mItem_3 = ItemUtils.simpleMetaStack(ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 5, 1);
- }
- else {
- mItem_1 = ItemList.Circuit_Elite.get(1);
- mItem_2 = ItemList.Circuit_Master.get(1);
- mItem_3 = ItemList.Circuit_Ultimate.get(1);
- }
-
- if(!GTNH){
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_LV_ULV.get(1L, new Object[0]), bitsd,
- new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Tin), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Lead) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_MV_LV.get(1L, new Object[0]), bitsd,
- new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Copper), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Tin) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_HV_MV.get(1L, new Object[0]), bitsd,
- new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Gold), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.AnnealedCopper) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_EV_HV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Aluminium), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Gold), Character.valueOf('K'),
- ItemList.Casing_Coil_Cupronickel });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_IV_EV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Tungsten), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Aluminium), Character.valueOf('K'),
- ItemList.Casing_Coil_Kanthal });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_LuV_IV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.VanadiumGallium), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Tungsten), Character.valueOf('K'),
- ItemList.Casing_Coil_Nichrome });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_ZPM_LuV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Naquadah), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.VanadiumGallium), Character.valueOf('K'),
- mItem_1 });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_UV_ZPM.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('C'),
- OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Naquadah), Character.valueOf('K'),
- mItem_2 });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_MAX_UV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('C'),
- OrePrefixes.wireGt01.get(Materials.Bedrockium), Character.valueOf('B'),
- OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), Character.valueOf('K'),
- mItem_3 });
- }else{
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_LV_ULV.get(1L, new Object[0]), bitsd,
- new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Transformer_LV_ULV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Tin), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Lead) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_MV_LV.get(1L, new Object[0]), bitsd,
- new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Transformer_MV_LV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.AnyCopper), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Tin) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_HV_MV.get(1L, new Object[0]), bitsd,
- new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Transformer_HV_MV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Gold), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.AnyCopper) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_EV_HV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_EV_HV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Aluminium), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Gold), Character.valueOf('K'),
- ItemList.Casing_Coil_Cupronickel });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_IV_EV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_IV_EV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Tungsten), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Aluminium), Character.valueOf('K'),
- ItemList.Casing_Coil_Kanthal });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_LuV_IV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_LuV_IV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.VanadiumGallium), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Tungsten), Character.valueOf('K'),
- ItemList.Casing_Coil_Nichrome });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_ZPM_LuV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_ZPM_LuV, Character.valueOf('C'),
- OrePrefixes.wireGt16.get(Materials.Naquadah), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.VanadiumGallium), Character.valueOf('K'),
- mItem_1 });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_UV_ZPM.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_UV_ZPM, Character.valueOf('C'),
- OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), Character.valueOf('B'),
- OrePrefixes.wireGt16.get(Materials.Naquadah), Character.valueOf('K'),
- mItem_2 });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Transformer_HA_MAX_UV.get(1L, new Object[0]), bitsd,
- new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_MAX_UV, Character.valueOf('C'),
- OrePrefixes.wireGt01.get(Materials.Bedrockium), Character.valueOf('B'),
- OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), Character.valueOf('K'),
- mItem_3 });
- }
- }
-
+ public static void run() {
+
+ long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED;
+ int mID = 877;
+
+ String mHammerName = "Hammer";
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) {
+ mHammerName = "Mallet";
+ }
+
+ GregtechItemList.Transformer_HA_LV_ULV.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.00",
+ "ULV Hi-Amp Transformer",
+ 0,
+ "LV -> ULV (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ GregtechItemList.Transformer_HA_MV_LV.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.01",
+ "LV Hi-Amp Transformer",
+ 1,
+ "MV -> LV (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ GregtechItemList.Transformer_HA_HV_MV.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.02",
+ "MV Hi-Amp Transformer",
+ 2,
+ "HV -> MV (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ GregtechItemList.Transformer_HA_EV_HV.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.03",
+ "HV Hi-Amp Transformer",
+ 3,
+ "EV -> HV (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ GregtechItemList.Transformer_HA_IV_EV.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.04",
+ "EV Hi-Amp Transformer",
+ 4,
+ "IV -> EV (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ GregtechItemList.Transformer_HA_LuV_IV.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.05",
+ "IV Hi-Amp Transformer",
+ 5,
+ "LuV -> IV (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ GregtechItemList.Transformer_HA_ZPM_LuV.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.06",
+ "LuV Hi-Amp Transformer",
+ 6,
+ "ZPM -> LuV (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ GregtechItemList.Transformer_HA_UV_ZPM.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.07",
+ "ZPM Hi-Amp Transformer",
+ 7,
+ "UV -> ZPM (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ if (!GTNH) {
+ GregtechItemList.Transformer_HA_MAX_UV.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.08",
+ "UV Hi-Amp Transformer",
+ 8,
+ "Any Voltage -> UV (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ } else {
+ GregtechItemList.Transformer_HA_MAX_UV.set(new GregtechMetaTransformerHiAmp(
+ mID++,
+ "transformer.ha.tier.08",
+ "UV Hi-Amp Transformer",
+ 8,
+ "UHV -> UV (Use Soft " + mHammerName + " to invert)")
+ .getStackForm(1L));
+ }
+ ItemStack mItem_1;
+ ItemStack mItem_2;
+ ItemStack mItem_3;
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ mItem_1 = ItemUtils.simpleMetaStack(
+ ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 3, 1);
+ mItem_2 = ItemUtils.simpleMetaStack(
+ ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 4, 1);
+ mItem_3 = ItemUtils.simpleMetaStack(
+ ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 5, 1);
+ } else {
+ mItem_1 = ItemList.Circuit_Elite.get(1);
+ mItem_2 = ItemList.Circuit_Master.get(1);
+ mItem_3 = ItemList.Circuit_Ultimate.get(1);
+ }
+
+ if (!GTNH) {
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_LV_ULV.get(1L, new Object[0]), bitsd, new Object[] {
+ " BB",
+ "CM ",
+ " BB",
+ Character.valueOf('M'),
+ ItemList.Hull_ULV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Tin),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Lead)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_MV_LV.get(1L, new Object[0]), bitsd, new Object[] {
+ " BB",
+ "CM ",
+ " BB",
+ Character.valueOf('M'),
+ ItemList.Hull_LV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Copper),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Tin)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_HV_MV.get(1L, new Object[0]), bitsd, new Object[] {
+ " BB",
+ "CM ",
+ " BB",
+ Character.valueOf('M'),
+ ItemList.Hull_MV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Gold),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.AnnealedCopper)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_EV_HV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Hull_HV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Aluminium),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Gold),
+ Character.valueOf('K'),
+ ItemList.Casing_Coil_Cupronickel
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_IV_EV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Hull_EV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Tungsten),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Aluminium),
+ Character.valueOf('K'),
+ ItemList.Casing_Coil_Kanthal
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_LuV_IV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Hull_IV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.VanadiumGallium),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Tungsten),
+ Character.valueOf('K'),
+ ItemList.Casing_Coil_Nichrome
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_ZPM_LuV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Hull_LuV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Naquadah),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.VanadiumGallium),
+ Character.valueOf('K'),
+ mItem_1
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_UV_ZPM.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Hull_ZPM,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt04.get(Materials.NaquadahAlloy),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Naquadah),
+ Character.valueOf('K'),
+ mItem_2
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_MAX_UV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Hull_UV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt01.get(Materials.Bedrockium),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt04.get(Materials.NaquadahAlloy),
+ Character.valueOf('K'),
+ mItem_3
+ });
+ } else {
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_LV_ULV.get(1L, new Object[0]), bitsd, new Object[] {
+ " BB",
+ "CM ",
+ " BB",
+ Character.valueOf('M'),
+ ItemList.Transformer_LV_ULV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Tin),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Lead)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_MV_LV.get(1L, new Object[0]), bitsd, new Object[] {
+ " BB",
+ "CM ",
+ " BB",
+ Character.valueOf('M'),
+ ItemList.Transformer_MV_LV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.AnyCopper),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Tin)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_HV_MV.get(1L, new Object[0]), bitsd, new Object[] {
+ " BB",
+ "CM ",
+ " BB",
+ Character.valueOf('M'),
+ ItemList.Transformer_HV_MV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Gold),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.AnyCopper)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_EV_HV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Transformer_EV_HV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Aluminium),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Gold),
+ Character.valueOf('K'),
+ ItemList.Casing_Coil_Cupronickel
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_IV_EV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Transformer_IV_EV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Tungsten),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Aluminium),
+ Character.valueOf('K'),
+ ItemList.Casing_Coil_Kanthal
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_LuV_IV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Transformer_LuV_IV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.VanadiumGallium),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Tungsten),
+ Character.valueOf('K'),
+ ItemList.Casing_Coil_Nichrome
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_ZPM_LuV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Transformer_ZPM_LuV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt16.get(Materials.Naquadah),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.VanadiumGallium),
+ Character.valueOf('K'),
+ mItem_1
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_UV_ZPM.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Transformer_UV_ZPM,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt04.get(Materials.NaquadahAlloy),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt16.get(Materials.Naquadah),
+ Character.valueOf('K'),
+ mItem_2
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Transformer_HA_MAX_UV.get(1L, new Object[0]), bitsd, new Object[] {
+ "KBB",
+ "CM ",
+ "KBB",
+ Character.valueOf('M'),
+ ItemList.Transformer_MAX_UV,
+ Character.valueOf('C'),
+ OrePrefixes.wireGt01.get(Materials.Bedrockium),
+ Character.valueOf('B'),
+ OrePrefixes.wireGt04.get(Materials.NaquadahAlloy),
+ Character.valueOf('K'),
+ mItem_3
+ });
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java
index 6587e3a253..a115160b51 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java
@@ -6,17 +6,16 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialAlloySmelter {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Alloy Smelter Multiblock.");
- run1();
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Alloy Smelter Multiblock.");
+ run1();
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Industrial_AlloySmelter.set(new GregtechMetaTileEntity_IndustrialAlloySmelter(31023,
- "industrialalloysmelter.controller.tier.single", "Zyngen").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ GregtechItemList.Industrial_AlloySmelter.set(new GregtechMetaTileEntity_IndustrialAlloySmelter(
+ 31023, "industrialalloysmelter.controller.tier.single", "Zyngen")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialArcFurnace.java
index fb8f69e865..e6afc8f352 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialArcFurnace.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialArcFurnace.java
@@ -6,17 +6,17 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialArcFurnace {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Arc Furnace Multiblock.");
- run1();
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Arc Furnace Multiblock.");
+ run1();
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Arc Furnace Multiblock
- GregtechItemList.Industrial_Arc_Furnace.set(new GregtechMetaTileEntity_IndustrialArcFurnace(862, "industrialarcfurnace.controller.tier.single", "High Current Industrial Arc Furnace").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Industrial Arc Furnace Multiblock
+ GregtechItemList.Industrial_Arc_Furnace.set(new GregtechMetaTileEntity_IndustrialArcFurnace(
+ 862, "industrialarcfurnace.controller.tier.single", "High Current Industrial Arc Furnace")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java
index 15c2d9b238..2b524610b0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java
@@ -7,20 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechIndustrialBlastSmelter {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Alloy Blast Smelter Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_AlloyBlastSmelter) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Alloy Blast Smelter Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_AlloyBlastSmelter) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Alloy Blast Smelter Multiblock
- GregtechItemList.Industrial_AlloyBlastSmelter.set(new GregtechMetaTileEntity_AlloyBlastSmelter(810,
- "industrialsalloyamelter.controller.tier.single", "Alloy Blast Smelter").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Industrial Alloy Blast Smelter Multiblock
+ GregtechItemList.Industrial_AlloyBlastSmelter.set(new GregtechMetaTileEntity_AlloyBlastSmelter(
+ 810, "industrialsalloyamelter.controller.tier.single", "Alloy Blast Smelter")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java
index dfbe7304ef..2a346a26c9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java
@@ -7,20 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialCentrifuge {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Centrifuge Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialCentrifuge) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Centrifuge Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialCentrifuge) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Centrifuge Multiblock
- GregtechItemList.Industrial_Centrifuge.set(new GregtechMetaTileEntity_IndustrialCentrifuge(790,
- "industrialcentrifuge.controller.tier.single", "Industrial Centrifuge").getStackForm(1L));
-
- }
+ private static void run1() {
+ // Industrial Centrifuge Multiblock
+ GregtechItemList.Industrial_Centrifuge.set(new GregtechMetaTileEntity_IndustrialCentrifuge(
+ 790, "industrialcentrifuge.controller.tier.single", "Industrial Centrifuge")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java
index 2027e6b190..5d5c4e43e1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java
@@ -6,20 +6,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialChisel {
- public static void run() {
- GregtechItemList.GT_Chisel_LV.set(new GregtechMetaTileEntity_AutoChisel(31066,
- "chisel.tier.01", "Basic Auto-Chisel", 1).getStackForm(1L));
- GregtechItemList.GT_Chisel_MV.set(new GregtechMetaTileEntity_AutoChisel(31067,
- "chisel.tier.02", "Advanced Auto-Chisel", 2).getStackForm(1L));
- GregtechItemList.GT_Chisel_HV.set(new GregtechMetaTileEntity_AutoChisel(31068,
- "chisel.tier.03", "Precision Auto-Chisel", 3).getStackForm(1L));
-
- GregtechItemList.Controller_IndustrialAutoChisel.set(
- new GregtechMetaTileEntity_IndustrialChisel(31069,
- "multimachine.adv.chisel",
- "Industrial 3D Copying Machine").getStackForm(1L));
+ public static void run() {
+ GregtechItemList.GT_Chisel_LV.set(
+ new GregtechMetaTileEntity_AutoChisel(31066, "chisel.tier.01", "Basic Auto-Chisel", 1)
+ .getStackForm(1L));
+ GregtechItemList.GT_Chisel_MV.set(
+ new GregtechMetaTileEntity_AutoChisel(31067, "chisel.tier.02", "Advanced Auto-Chisel", 2)
+ .getStackForm(1L));
+ GregtechItemList.GT_Chisel_HV.set(
+ new GregtechMetaTileEntity_AutoChisel(31068, "chisel.tier.03", "Precision Auto-Chisel", 3)
+ .getStackForm(1L));
-
- }
-
+ GregtechItemList.Controller_IndustrialAutoChisel.set(new GregtechMetaTileEntity_IndustrialChisel(
+ 31069, "multimachine.adv.chisel", "Industrial 3D Copying Machine")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java
index 7afc73709a..578e4cd3fe 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java
@@ -7,20 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialCokeOven {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Coke Oven Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialCokeOven) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Coke Oven Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialCokeOven) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Centrifuge Multiblock
- GregtechItemList.Industrial_CokeOven.set(new GregtechMetaTileEntity_IndustrialCokeOven(791,
- "industrialcokeoven.controller.tier.single", "Industrial Coke Oven").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Industrial Centrifuge Multiblock
+ GregtechItemList.Industrial_CokeOven.set(new GregtechMetaTileEntity_IndustrialCokeOven(
+ 791, "industrialcokeoven.controller.tier.single", "Industrial Coke Oven")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java
index f6133f6bf3..118fa05099 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java
@@ -7,19 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialCuttingFactory {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Cutting Factory Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialCuttingMachine) {
- run1();
- }
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Cutting Factory Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialCuttingMachine) {
+ run1();
+ }
+ }
+ }
- private static void run1() {
- // Industrial Wire Factory Multiblock
- GregtechItemList.Industrial_CuttingFactoryController.set(new GregtechMetaTileEntity_IndustrialCuttingMachine(992,
- "industrialcuttingmachine.controller.tier.01", "Cutting Factory Controller").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Industrial Wire Factory Multiblock
+ GregtechItemList.Industrial_CuttingFactoryController.set(new GregtechMetaTileEntity_IndustrialCuttingMachine(
+ 992, "industrialcuttingmachine.controller.tier.01", "Cutting Factory Controller")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java
index 10d7510625..89f6f62ef9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java
@@ -7,20 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialElectrolyzer {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Electrolyzer Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialElectrolyzer) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Electrolyzer Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialElectrolyzer) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Electrolyzer Multiblock
- GregtechItemList.Industrial_Electrolyzer.set(new GregtechMetaTileEntity_IndustrialElectrolyzer(796,
- "industrialelectrolyzer.controller.tier.single", "Industrial Electrolyzer").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_Electrolyzer.set(new GregtechMetaTileEntity_IndustrialElectrolyzer(
+ 796, "industrialelectrolyzer.controller.tier.single", "Industrial Electrolyzer")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java
index 9301844071..705d5f02e9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java
@@ -7,14 +7,15 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechIndustrialElementDuplicator {
- public static void run(){
+ public static void run() {
- Logger.INFO("Gregtech5u Content | Registering Elemental Duplicator Multiblock.");
-
- GregtechItemList.Controller_ElementalDuplicator.set(new GregtechMTE_ElementalDuplicator(31050, "gtpp.multimachine.replicator", "Elemental Duplicator").getStackForm(1L));
- GregtechItemList.Hatch_Input_Elemental_Duplicator.set(new GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(31051, "hatch.input_bus.elementalorbholder", "Data Orb Repository", 7).getStackForm(1L));
-
- }
-
-}
+ Logger.INFO("Gregtech5u Content | Registering Elemental Duplicator Multiblock.");
+ GregtechItemList.Controller_ElementalDuplicator.set(
+ new GregtechMTE_ElementalDuplicator(31050, "gtpp.multimachine.replicator", "Elemental Duplicator")
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Input_Elemental_Duplicator.set(new GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(
+ 31051, "hatch.input_bus.elementalorbholder", "Data Orb Repository", 7)
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialExtruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialExtruder.java
index 51b2f4b0d5..40396ded0b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialExtruder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialExtruder.java
@@ -7,20 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialExtruder {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Extrusion Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialExtrudingMachine) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Extrusion Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialExtrudingMachine) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Presser Multiblock
- GregtechItemList.Industrial_Extruder.set(new GregtechMetaTileEntity_IndustrialExtruder(859,
- "industrialextruder.controller.tier.single", "Industrial Extrusion Machine").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Industrial Presser Multiblock
+ GregtechItemList.Industrial_Extruder.set(new GregtechMetaTileEntity_IndustrialExtruder(
+ 859, "industrialextruder.controller.tier.single", "Industrial Extrusion Machine")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFishPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFishPond.java
index 681256a385..b37216b343 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFishPond.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFishPond.java
@@ -6,19 +6,18 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechIndustrialFishPond {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Fishing Pond Multiblock.");
- //if (CORE.ConfigSwitches.enableMultiblock_IndustrialWashPlant) {
- run1();
- //}
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Fishing Pond Multiblock.");
+ // if (CORE.ConfigSwitches.enableMultiblock_IndustrialWashPlant) {
+ run1();
+ // }
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Industrial_FishingPond.set(new GregtechMetaTileEntity_IndustrialFishingPond(829,
- "industrial.fishpond.controller.tier.single", "Zhuhai - Fishing Port").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ GregtechItemList.Industrial_FishingPond.set(new GregtechMetaTileEntity_IndustrialFishingPond(
+ 829, "industrial.fishpond.controller.tier.single", "Zhuhai - Fishing Port")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java
index b32917482d..a1eb79b5b1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java
@@ -6,17 +6,16 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialFluidHeater {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Thermal Centrifuge Multiblock.");
- run1();
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Thermal Centrifuge Multiblock.");
+ run1();
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Controller_IndustrialFluidHeater.set(new GregtechMetaTileEntity_IndustrialFluidHeater(31077,
- "industrialfluidheater.controller.tier.single", "Thermic Heating Device").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ GregtechItemList.Controller_IndustrialFluidHeater.set(new GregtechMetaTileEntity_IndustrialFluidHeater(
+ 31077, "industrialfluidheater.controller.tier.single", "Thermic Heating Device")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java
index 6e13934a8d..2064d15c2b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java
@@ -6,17 +6,16 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialForgeHammer {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Forge Hammer Multiblock.");
- run1();
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Forge Hammer Multiblock.");
+ run1();
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Controller_IndustrialForgeHammer.set(new GregtechMetaTileEntity_IndustrialForgeHammer(31075,
- "industrialhammer.controller.tier.single", "Industrial Sledgehammer").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ GregtechItemList.Controller_IndustrialForgeHammer.set(new GregtechMetaTileEntity_IndustrialForgeHammer(
+ 31075, "industrialhammer.controller.tier.single", "Industrial Sledgehammer")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java
index 0b6dcb1b94..29568c32cc 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java
@@ -7,20 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechIndustrialFuelRefinery {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Fuel Processing and Refinery Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_NuclearFuelRefinery) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Fuel Processing and Refinery Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_NuclearFuelRefinery) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Maceration Stack Multiblock
- GregtechItemList.Industrial_FuelRefinery.set(new GregtechMetaTileEntity_Refinery(835,
- "industrialrefinery.controller.tier.single", "Reactor Fuel Processing Plant").getStackForm(1L));
-
- }
+ private static void run1() {
+ // Industrial Maceration Stack Multiblock
+ GregtechItemList.Industrial_FuelRefinery.set(new GregtechMetaTileEntity_Refinery(
+ 835, "industrialrefinery.controller.tier.single", "Reactor Fuel Processing Plant")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java
index 9bdcf231d0..e9ad7309d3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java
@@ -6,21 +6,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechIndustrialGeneratorArray {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Generator Array Multiblock.");
- //if (CORE.ConfigSwitches.enableMultiblock_IndustrialSifter) { // TODO
- run1();
- //}
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Generator Array Multiblock.");
+ // if (CORE.ConfigSwitches.enableMultiblock_IndustrialSifter) { // TODO
+ run1();
+ // }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Maceration Stack Multiblock
- GregtechItemList.Generator_Array_Controller.set(new GregtechMetaTileEntityGeneratorArray(
- 990,
- "generatorarray.controller.tier.01",
- "Large Generator Array").getStackForm(1L));
- }
+ private static void run1() {
+ // Industrial Maceration Stack Multiblock
+ GregtechItemList.Generator_Array_Controller.set(new GregtechMetaTileEntityGeneratorArray(
+ 990, "generatorarray.controller.tier.01", "Large Generator Array")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java
index c67296fc53..6ceb0cc089 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java
@@ -7,20 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialMacerator {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Maceration Stack Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialMacerationStack) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Maceration Stack Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialMacerationStack) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Maceration Stack Multiblock
- GregtechItemList.Industrial_MacerationStack.set(new GregtechMetaTileEntity_IndustrialMacerator(797,
- "industrialmacerator.controller.tier.single", "Maceration Stack Controller").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Industrial Maceration Stack Multiblock
+ GregtechItemList.Industrial_MacerationStack.set(new GregtechMetaTileEntity_IndustrialMacerator(
+ 797, "industrialmacerator.controller.tier.single", "Maceration Stack Controller")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java
index 13e6d26fb9..6133919b30 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java
@@ -2,9 +2,8 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
-import gregtech.api.util.GT_Recipe;
-import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Massfabricator;
import gregtech.api.util.GTPP_Recipe;
+import gregtech.api.util.GT_Recipe;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
@@ -16,127 +15,124 @@ import net.minecraftforge.fluids.FluidStack;
public class GregtechIndustrialMassFabricator {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Matter Fabricator Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_MatterFabricator) {
- generateRecipes();
- run1();
- }
- }
-
- }
-
- private static void run1() {
- // Industrial Matter Fabricator Multiblock
- GregtechItemList.Industrial_MassFab.set(new GregtechMetaTileEntity_MassFabricator(799,
- "industrialmassfab.controller.tier.single", "Matter Fabrication CPU").getStackForm(1L));
- }
-
- private static void generateRecipes() {
-
- //Generate Scrap->UUA Recipes
-
-
-
- //Basic UUA1
- GT_Recipe UUA_From_Scrap = new GTPP_Recipe(
- false,
- new ItemStack[] {CI.getNumberedCircuit(9), ItemUtils.getSimpleStack(getScrapPile(), 9)},
- new ItemStack[] {GT_Values.NI},
- null, null,
- new FluidStack[] {GT_Values.NF},
- new FluidStack[] {Materials.UUAmplifier.getFluid(1)},
- 9*20,
- 32,
- 0);
- //Basic UUA2
- GT_Recipe UUA_From_ScrapBoxes = new GTPP_Recipe(
- false,
- new ItemStack[] {CI.getNumberedCircuit(19), ItemUtils.getSimpleStack(getScrapBox(), 1)},
- new ItemStack[] {GT_Values.NI},
- null, null,
- new FluidStack[] {GT_Values.NF},
- new FluidStack[] {Materials.UUAmplifier.getFluid(1)},
- 9*20,
- 32,
- 0);
-
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(UUA_From_Scrap);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(UUA_From_ScrapBoxes);
-
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- //Basic UUM
- GT_Recipe generateUUM = new GTPP_Recipe(
- false,
- new ItemStack[] {CI.getNumberedCircuit(1)},
- new ItemStack[] {GT_Values.NI},
- null, null,
- new FluidStack[] {GT_Values.NF},
- new FluidStack[] {Materials.UUMatter.getFluid(1)},
- 160*20,
- 32,
- 0);
-
- //Basic UUM
- GT_Recipe generateUUMFromUUA = new GTPP_Recipe(
- false,
- new ItemStack[] {CI.getNumberedCircuit(2)},
- new ItemStack[] {GT_Values.NI},
- null, null,
- new FluidStack[] {Materials.UUAmplifier.getFluid(1)},
- new FluidStack[] {Materials.UUMatter.getFluid(1)},
- 40*20,
- 32,
- 0);
-
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA);
- }
- else {
- //Basic UUM
- GT_Recipe generateUUM_LV = new GTPP_Recipe(
- false,
- new ItemStack[] {CI.getNumberedCircuit(1)},
- new ItemStack[] {GT_Values.NI},
- null, null,
- new FluidStack[] {GT_Values.NF},
- new FluidStack[] {Materials.UUMatter.getFluid(1)},
- 160*20,
- 256,
- 0);
-
- //Basic UUM
- GT_Recipe generateUUMFromUUA_LV = new GTPP_Recipe(
- false,
- new ItemStack[] {CI.getNumberedCircuit(2)},
- new ItemStack[] {GT_Values.NI},
- null, null,
- new FluidStack[] {Materials.UUAmplifier.getFluid(1)},
- new FluidStack[] {Materials.UUMatter.getFluid(1)},
- 40*20,
- 256,
- 0);
-
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_LV);
- GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_LV);
-
- }
-
- Logger.INFO("Generated "+GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.mRecipeList.size()+" Matter Fabricator recipes.");
-
-
-
-
- }
-
-
-
- public static ItemStack getScrapPile() {
- return ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrap"));
- }
- public static ItemStack getScrapBox() {
- return ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrapbox"));
- }
-
-} \ No newline at end of file
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Matter Fabricator Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_MatterFabricator) {
+ generateRecipes();
+ run1();
+ }
+ }
+ }
+
+ private static void run1() {
+ // Industrial Matter Fabricator Multiblock
+ GregtechItemList.Industrial_MassFab.set(new GregtechMetaTileEntity_MassFabricator(
+ 799, "industrialmassfab.controller.tier.single", "Matter Fabrication CPU")
+ .getStackForm(1L));
+ }
+
+ private static void generateRecipes() {
+
+ // Generate Scrap->UUA Recipes
+
+ // Basic UUA1
+ GT_Recipe UUA_From_Scrap = new GTPP_Recipe(
+ false,
+ new ItemStack[] {CI.getNumberedCircuit(9), ItemUtils.getSimpleStack(getScrapPile(), 9)},
+ new ItemStack[] {GT_Values.NI},
+ null,
+ null,
+ new FluidStack[] {GT_Values.NF},
+ new FluidStack[] {Materials.UUAmplifier.getFluid(1)},
+ 9 * 20,
+ 32,
+ 0);
+ // Basic UUA2
+ GT_Recipe UUA_From_ScrapBoxes = new GTPP_Recipe(
+ false,
+ new ItemStack[] {CI.getNumberedCircuit(19), ItemUtils.getSimpleStack(getScrapBox(), 1)},
+ new ItemStack[] {GT_Values.NI},
+ null,
+ null,
+ new FluidStack[] {GT_Values.NF},
+ new FluidStack[] {Materials.UUAmplifier.getFluid(1)},
+ 9 * 20,
+ 32,
+ 0);
+
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(UUA_From_Scrap);
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(UUA_From_ScrapBoxes);
+
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ // Basic UUM
+ GT_Recipe generateUUM = new GTPP_Recipe(
+ false,
+ new ItemStack[] {CI.getNumberedCircuit(1)},
+ new ItemStack[] {GT_Values.NI},
+ null,
+ null,
+ new FluidStack[] {GT_Values.NF},
+ new FluidStack[] {Materials.UUMatter.getFluid(1)},
+ 160 * 20,
+ 32,
+ 0);
+
+ // Basic UUM
+ GT_Recipe generateUUMFromUUA = new GTPP_Recipe(
+ false,
+ new ItemStack[] {CI.getNumberedCircuit(2)},
+ new ItemStack[] {GT_Values.NI},
+ null,
+ null,
+ new FluidStack[] {Materials.UUAmplifier.getFluid(1)},
+ new FluidStack[] {Materials.UUMatter.getFluid(1)},
+ 40 * 20,
+ 32,
+ 0);
+
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM);
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA);
+ } else {
+ // Basic UUM
+ GT_Recipe generateUUM_LV = new GTPP_Recipe(
+ false,
+ new ItemStack[] {CI.getNumberedCircuit(1)},
+ new ItemStack[] {GT_Values.NI},
+ null,
+ null,
+ new FluidStack[] {GT_Values.NF},
+ new FluidStack[] {Materials.UUMatter.getFluid(1)},
+ 160 * 20,
+ 256,
+ 0);
+
+ // Basic UUM
+ GT_Recipe generateUUMFromUUA_LV = new GTPP_Recipe(
+ false,
+ new ItemStack[] {CI.getNumberedCircuit(2)},
+ new ItemStack[] {GT_Values.NI},
+ null,
+ null,
+ new FluidStack[] {Materials.UUAmplifier.getFluid(1)},
+ new FluidStack[] {Materials.UUMatter.getFluid(1)},
+ 40 * 20,
+ 256,
+ 0);
+
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_LV);
+ GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_LV);
+ }
+
+ Logger.INFO("Generated " + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.mRecipeList.size()
+ + " Matter Fabricator recipes.");
+ }
+
+ public static ItemStack getScrapPile() {
+ return ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrap"));
+ }
+
+ public static ItemStack getScrapBox() {
+ return ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrapbox"));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMixer.java
index 9c8673682c..aaa39c906d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMixer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMixer.java
@@ -7,21 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialMixer {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Mixer Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialPlatePress) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Mixer Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialPlatePress) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Mixer Multiblock
- GregtechItemList.Industrial_Mixer.set(new GregtechMetaTileEntity_IndustrialMixer(811,
- "industrialmixer.controller.tier.single", "Industrial Mixing Machine").getStackForm(1L));
-
- }
-
+ private static void run1() {
+ // Industrial Mixer Multiblock
+ GregtechItemList.Industrial_Mixer.set(new GregtechMetaTileEntity_IndustrialMixer(
+ 811, "industrialmixer.controller.tier.single", "Industrial Mixing Machine")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiMachine.java
index 40d6c12f0b..06b18b3d7b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiMachine.java
@@ -7,19 +7,18 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialMultiMachine {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Multi-Machine Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialMultiMachine) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Multi-Machine Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialMultiMachine) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Industrial_MultiMachine.set(new GregtechMetaTileEntity_IndustrialMultiMachine(860,
- "industrialmultimachine.controller.tier.single", "Large Processing Factory").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ GregtechItemList.Industrial_MultiMachine.set(new GregtechMetaTileEntity_IndustrialMultiMachine(
+ 860, "industrialmultimachine.controller.tier.single", "Large Processing Factory")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java
index 1d723784ac..f9662cfa0c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java
@@ -1,10 +1,6 @@
/*
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_MultiTank;
public class GregtechIndustrialMultiTank {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java
index ecf1e73675..2f73addbbd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java
@@ -7,20 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialPlatePress {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Press Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialPlatePress) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Press Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialPlatePress) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Industrial Presser Multiblock
- GregtechItemList.Industrial_PlatePress.set(new GregtechMetaTileEntity_IndustrialPlatePress(792,
- "industrialbender.controller.tier.single", "Industrial Material Press").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Industrial Presser Multiblock
+ GregtechItemList.Industrial_PlatePress.set(new GregtechMetaTileEntity_IndustrialPlatePress(
+ 792, "industrialbender.controller.tier.single", "Industrial Material Press")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java
index 562693ee3e..c490ef2b81 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java
@@ -5,9 +5,9 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechIndustrialRockBreaker {
- public static void run() {
- GregtechItemList.Controller_IndustrialRockBreaker.set(new GregtechMetaTileEntity_IndustrialRockBreaker(31065,
- "industrialrockcrusher.controller.tier.single", "Boldarnator").getStackForm(1L));
- }
-
+ public static void run() {
+ GregtechItemList.Controller_IndustrialRockBreaker.set(new GregtechMetaTileEntity_IndustrialRockBreaker(
+ 31065, "industrialrockcrusher.controller.tier.single", "Boldarnator")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java
index 8fa4cb6cb1..c474b5f6c0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java
@@ -7,19 +7,18 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialSifter {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Sifter Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialSifter) { // TODO
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Sifter Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialSifter) { // TODO
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Industrial_Sifter.set(new GregtechMetaTileEntity_IndustrialSifter(840,
- "industrialsifter.controller.tier.single", "Large Sifter Control Block").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ GregtechItemList.Industrial_Sifter.set(new GregtechMetaTileEntity_IndustrialSifter(
+ 840, "industrialsifter.controller.tier.single", "Large Sifter Control Block")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialThermalCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialThermalCentrifuge.java
index 01c04b4668..00552d9f3a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialThermalCentrifuge.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialThermalCentrifuge.java
@@ -7,19 +7,18 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialThermalCentrifuge {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Thermal Centrifuge Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialThermalCentrifuge) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Thermal Centrifuge Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialThermalCentrifuge) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Industrial_ThermalCentrifuge.set(new GregtechMetaTileEntity_IndustrialThermalCentrifuge(849,
- "industrialthermalcentrifuge.controller.tier.single", "Large Thermal Refinery").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ GregtechItemList.Industrial_ThermalCentrifuge.set(new GregtechMetaTileEntity_IndustrialThermalCentrifuge(
+ 849, "industrialthermalcentrifuge.controller.tier.single", "Large Thermal Refinery")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialTreeFarm.java
index 11c4f4dae8..43902f883a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialTreeFarm.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialTreeFarm.java
@@ -1,4 +1,3 @@
-
package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gtPlusPlus.api.objects.Logger;
@@ -8,20 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechIndustrialTreeFarm {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer) {
- Logger.INFO("Gregtech5u Content | Registering Tree Farm Multiblock.");
- run1();
- }
- }
-
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer) {
+ Logger.INFO("Gregtech5u Content | Registering Tree Farm Multiblock.");
+ run1();
+ }
+ }
+ }
- private static void run1() {
- GregtechItemList.Industrial_TreeFarm
- .set(new GregtechMetaTileEntityTreeFarm(836, "treefarm.controller.tier.single", "Tree Growth Simulator")
- .getStackForm(1L));
- GregtechMetaTileEntityTreeFarm.loadMapWoodFromSapling();
- }
+ private static void run1() {
+ GregtechItemList.Industrial_TreeFarm.set(
+ new GregtechMetaTileEntityTreeFarm(836, "treefarm.controller.tier.single", "Tree Growth Simulator")
+ .getStackForm(1L));
+ GregtechMetaTileEntityTreeFarm.loadMapWoodFromSapling();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWashPlant.java
index f66ebca60e..e1d48b3395 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWashPlant.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWashPlant.java
@@ -7,19 +7,18 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialWashPlant {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Wash Plant Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialWashPlant) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Wash Plant Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialWashPlant) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Industrial_WashPlant.set(new GregtechMetaTileEntity_IndustrialWashPlant(850,
- "industrialwashplant.controller.tier.single", "Ore Washing Plant").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ GregtechItemList.Industrial_WashPlant.set(new GregtechMetaTileEntity_IndustrialWashPlant(
+ 850, "industrialwashplant.controller.tier.single", "Ore Washing Plant")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java
index 6d575991bd..456b55bf7b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java
@@ -7,19 +7,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIndustrialWiremill {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Wire Factory Multiblock.");
- if (CORE.ConfigSwitches.enableMultiblock_IndustrialWireMill) {
- run1();
- }
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Wire Factory Multiblock.");
+ if (CORE.ConfigSwitches.enableMultiblock_IndustrialWireMill) {
+ run1();
+ }
+ }
+ }
- private static void run1() {
- // Industrial Wire Factory Multiblock
- GregtechItemList.Industrial_WireFactory.set(new GregtechMetaTileEntity_IndustrialWireMill(798,
- "industrialwiremill.controller.tier.single", "Wire Factory Controller").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // Industrial Wire Factory Multiblock
+ GregtechItemList.Industrial_WireFactory.set(new GregtechMetaTileEntity_IndustrialWireMill(
+ 798, "industrialwiremill.controller.tier.single", "Wire Factory Controller")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java
index 1bcd0f3300..5a7b082dd5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java
@@ -7,18 +7,18 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechIronBlastFurnace {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Iron Blast Furnace.");
- if (CORE.ConfigSwitches.enableMultiblock_IronBlastFurnace) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Iron Blast Furnace.");
+ if (CORE.ConfigSwitches.enableMultiblock_IronBlastFurnace) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Machine_Iron_BlastFurnace.set(new GregtechMetaTileEntity_IronBlastFurnace(768,
- "ironmachine.blastfurnace", "Iron Plated Blast Furnace").getStackForm(1L));
- }
+ private static void run1() {
+ GregtechItemList.Machine_Iron_BlastFurnace.set(new GregtechMetaTileEntity_IronBlastFurnace(
+ 768, "ironmachine.blastfurnace", "Iron Plated Blast Furnace")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java
index 19c361be93..9154a608a3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIsaMill.java
@@ -8,16 +8,19 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechIsaMill {
- public static void run(){
+ public static void run() {
- Logger.INFO("Gregtech5u Content | Registering Milling Content.");
-
- GregtechItemList.Controller_IsaMill.set(new GregtechMetaTileEntity_IsaMill(31027, "gtpp.multimachine.isamill", "IsaMill Grinding Machine").getStackForm(1L));
- GregtechItemList.Controller_Flotation_Cell.set(new GregtechMTE_FrothFlotationCell(31028, "gtpp.multimachine.flotationcell", "Flotation Cell Regulator").getStackForm(1L));
+ Logger.INFO("Gregtech5u Content | Registering Milling Content.");
- // Milling Ball Bus
- GregtechItemList.Bus_Milling_Balls.set((new GT_MetaTileEntity_Hatch_MillingBalls(31029, "hatch.milling", "Ball Housing")).getStackForm(1L));
-
- }
-
+ GregtechItemList.Controller_IsaMill.set(
+ new GregtechMetaTileEntity_IsaMill(31027, "gtpp.multimachine.isamill", "IsaMill Grinding Machine")
+ .getStackForm(1L));
+ GregtechItemList.Controller_Flotation_Cell.set(
+ new GregtechMTE_FrothFlotationCell(31028, "gtpp.multimachine.flotationcell", "Flotation Cell Regulator")
+ .getStackForm(1L));
+
+ // Milling Ball Bus
+ GregtechItemList.Bus_Milling_Balls.set(
+ (new GT_MetaTileEntity_Hatch_MillingBalls(31029, "hatch.milling", "Ball Housing")).getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java
index cef60ba712..5515b63f56 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java
@@ -10,27 +10,37 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechLFTR {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Liquid Fluorine Thorium Reactor [LFTR].");
- if (CORE.ConfigSwitches.enableMultiblock_LiquidFluorideThoriumReactor) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Liquid Fluorine Thorium Reactor [LFTR].");
+ if (CORE.ConfigSwitches.enableMultiblock_LiquidFluorideThoriumReactor) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // LFTR
- GregtechItemList.ThoriumReactor.set(new GregtechMTE_NuclearReactor(751, "lftr.controller.single", "Thorium Reactor [LFTR]").getStackForm(1L));
- // Reactor Processing Units
- GregtechItemList.ReactorProcessingUnit_IV.set(new GregtechMetaTileEntity_ReactorProcessingUnit(31031, "rpu.tier.01", "Reactor Processing Unit I", 5).getStackForm(1L));
- GregtechItemList.ReactorProcessingUnit_ZPM.set(new GregtechMetaTileEntity_ReactorProcessingUnit(31032, "rpu.tier.02", "Reactor Processing Unit II", 7).getStackForm(1L));
- // Cold Traps
- GregtechItemList.ColdTrap_IV.set(new GregtechMetaTileEntity_ReactorColdTrap(31033, "coldtrap.tier.01", "Cold Trap I", 5).getStackForm(1L));
- GregtechItemList.ColdTrap_ZPM.set(new GregtechMetaTileEntity_ReactorColdTrap(31034, "coldtrap.tier.02", "Cold Trap II", 7).getStackForm(1L));
- // Sparge Tower
- GregtechItemList.Controller_Sparge_Tower.set(new GregtechMetaTileEntity_SpargeTower(31035, "sparge.controller.single", "Sparge Tower Controller").getStackForm(1L));
-
- }
+ private static void run1() {
+ // LFTR
+ GregtechItemList.ThoriumReactor.set(
+ new GregtechMTE_NuclearReactor(751, "lftr.controller.single", "Thorium Reactor [LFTR]")
+ .getStackForm(1L));
+ // Reactor Processing Units
+ GregtechItemList.ReactorProcessingUnit_IV.set(
+ new GregtechMetaTileEntity_ReactorProcessingUnit(31031, "rpu.tier.01", "Reactor Processing Unit I", 5)
+ .getStackForm(1L));
+ GregtechItemList.ReactorProcessingUnit_ZPM.set(
+ new GregtechMetaTileEntity_ReactorProcessingUnit(31032, "rpu.tier.02", "Reactor Processing Unit II", 7)
+ .getStackForm(1L));
+ // Cold Traps
+ GregtechItemList.ColdTrap_IV.set(
+ new GregtechMetaTileEntity_ReactorColdTrap(31033, "coldtrap.tier.01", "Cold Trap I", 5)
+ .getStackForm(1L));
+ GregtechItemList.ColdTrap_ZPM.set(
+ new GregtechMetaTileEntity_ReactorColdTrap(31034, "coldtrap.tier.02", "Cold Trap II", 7)
+ .getStackForm(1L));
+ // Sparge Tower
+ GregtechItemList.Controller_Sparge_Tower.set(
+ new GregtechMetaTileEntity_SpargeTower(31035, "sparge.controller.single", "Sparge Tower Controller")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java
index 0b3d90a079..bad00131ee 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java
@@ -11,20 +11,30 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.tu
public class GregtechLargeTurbinesAndHeatExchanger {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Larger Turbines & Extra Large Heat Exchanger.");
- run1();
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Larger Turbines & Extra Large Heat Exchanger.");
+ run1();
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Large_Steam_Turbine.set(new GT_MTE_LargeTurbine_Steam(865, "multimachine.largerturbine", "XL Turbo Steam Turbine").getStackForm(1L));
- GregtechItemList.Large_HPSteam_Turbine.set(new GT_MTE_LargeTurbine_SHSteam(866, "multimachine.largerhpturbine", "XL Turbo HP Steam Turbine").getStackForm(1L));
- GregtechItemList.Large_Gas_Turbine.set(new GT_MTE_LargeTurbine_Gas(31073, "multimachine.largergasturbine", "XL Turbo Gas Turbine").getStackForm(1L));
- GregtechItemList.Large_Plasma_Turbine.set(new GT_MTE_LargeTurbine_Plasma(31074, "multimachine.largerplasmaturbine", "XL Turbo Plasma Turbine").getStackForm(1L));
- GregtechItemList.Hatch_Turbine_Rotor.set(new GT_MetaTileEntity_Hatch_Turbine(30010, "hatch.turbine", "Rotor Assembly", 8).getStackForm(1L));
- GregtechItemList.XL_HeatExchanger.set(new GregtechMetaTileEntity_Adv_HeatExchanger(31079, "multimachine.reallybigheatexchanger", "Whakawhiti Wera XL").getStackForm(1L));
- }
+ private static void run1() {
+ GregtechItemList.Large_Steam_Turbine.set(
+ new GT_MTE_LargeTurbine_Steam(865, "multimachine.largerturbine", "XL Turbo Steam Turbine")
+ .getStackForm(1L));
+ GregtechItemList.Large_HPSteam_Turbine.set(
+ new GT_MTE_LargeTurbine_SHSteam(866, "multimachine.largerhpturbine", "XL Turbo HP Steam Turbine")
+ .getStackForm(1L));
+ GregtechItemList.Large_Gas_Turbine.set(
+ new GT_MTE_LargeTurbine_Gas(31073, "multimachine.largergasturbine", "XL Turbo Gas Turbine")
+ .getStackForm(1L));
+ GregtechItemList.Large_Plasma_Turbine.set(
+ new GT_MTE_LargeTurbine_Plasma(31074, "multimachine.largerplasmaturbine", "XL Turbo Plasma Turbine")
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Turbine_Rotor.set(
+ new GT_MetaTileEntity_Hatch_Turbine(30010, "hatch.turbine", "Rotor Assembly", 8).getStackForm(1L));
+ GregtechItemList.XL_HeatExchanger.set(new GregtechMetaTileEntity_Adv_HeatExchanger(
+ 31079, "multimachine.reallybigheatexchanger", "Whakawhiti Wera XL")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java
index aea40c564c..dead66b933 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java
@@ -1,12 +1,6 @@
/*
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GTPP_Recipe;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Plasma;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_MiniFusionPlant;
public class GregtechMiniRaFusion {
@@ -14,14 +8,14 @@ public class GregtechMiniRaFusion {
// Register the Simple Fusion Entity.
GregtechItemList.Miniature_Fusion.set(new GregtechMTE_MiniFusionPlant(31015, "gtplusplus.fusion.single", "Helium Prime").getStackForm(1L));
GregtechItemList.Plasma_Tank.set(new GT_MetaTileEntity_Hatch_Plasma(31016, "gtplusplus.tank.plasma", "Plasma Tank").getStackForm(1L));
-
+
}
-
- public static boolean generateSlowFusionrecipes() {
+
+ public static boolean generateSlowFusionrecipes() {
for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sFusionRecipes.mRecipeList){
if (x.mEnabled) {
GT_Recipe y = x.copy();
- y.mDuration *= 16;
+ y.mDuration *= 16;
long z = y.mEUt * 4;
if (z > Integer.MAX_VALUE) {
y.mEnabled = false;
@@ -39,7 +33,7 @@ public class GregtechMiniRaFusion {
}
return false;
}
-
-
+
+
}
*/
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java
index 4a0a0dc1b2..1e024389fe 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java
@@ -6,17 +6,16 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.Gr
public class GregtechMolecularTransformer {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Molecular Transformer Multiblock.");
- run1();
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Molecular Transformer Multiblock.");
+ run1();
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Controller_MolecularTransformer.set(new GregtechMetaTileEntity_IndustrialMolecularTransformer(31072,
- "moleculartransformer.controller.tier.single", "Molecular Transformer").getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ GregtechItemList.Controller_MolecularTransformer.set(new GregtechMetaTileEntity_IndustrialMolecularTransformer(
+ 31072, "moleculartransformer.controller.tier.single", "Molecular Transformer")
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java
index e2c63c77da..db124f510a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java
@@ -1,9 +1,6 @@
/*
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_LargeNaqReactor;
public class GregtechNaqReactor {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java
index 6095413150..63eb34e97f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java
@@ -1,182 +1,248 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.commons.lang3.reflect.FieldUtils;
-
-import net.minecraft.item.ItemStack;
-
import gregtech.GT_Mod;
import gregtech.api.enums.*;
import gregtech.api.objects.MaterialStack;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
+import org.apache.commons.lang3.reflect.FieldUtils;
public class GregtechNitroDieselFix {
- @SuppressWarnings("unchecked")
- public static void run(){
- if (CORE.ConfigSwitches.enableNitroFix){
- Logger.INFO("Gregtech5u Content | Attempting to Fix Nitro-Diesel production.");
- try {
- int mSub = Utils.getGregtechSubVersion();
- if (mSub != 0){
- if (mSub >= 30){
- Class mb = ReflectionUtils.getClass("gregtech.api.enums.MaterialBuilder");
- Object df = mb.getConstructor(int.class, TextureSet.class, String.class).newInstance(975, TextureSet.SET_FLUID, "Nitro-Diesel [Old]");
- if (mb.isInstance(df)){
-
- Logger.INFO("[Nitro] Created new instance of Material builder, for Nitro fix.");
-
- //Get Methods
- Method addFluid = mb.getDeclaredMethod("addFluid");
- Method addCell = mb.getDeclaredMethod("addCell");
- Method setColour = mb.getDeclaredMethod("setColor", Dyes.class);
- Method setFuelPower = mb.getDeclaredMethod("setFuelPower", int.class);
- Method setMaterials = mb.getDeclaredMethod("setMaterialList", List.class);
- Method setTemp = mb.getDeclaredMethod("setLiquidTemperature", int.class);
- Method setRGB = mb.getDeclaredMethod("setRGB", int.class, int.class, int.class);
- Method construct = mb.getDeclaredMethod("constructMaterial");
- Logger.INFO("[Nitro] Got internal methods for setting fields.");
-
- //Invoke the methods
- addFluid.invoke(df);
- addCell.invoke(df);
- setColour.invoke(df, Dyes.dyeLime);
- setFuelPower.invoke(df, 512000);
- setMaterials.invoke(df, Arrays.asList(new MaterialStack(Materials.Glyceryl, 1), new MaterialStack(Materials.Fuel, 4)));
- setTemp.invoke(df, 295);
- setRGB.invoke(df, 200, 255, 0);
- Materials mNitroFix = (Materials) construct.invoke(df);
- Logger.INFO("[Nitro] Invoked 8 method calls successfully.");
-
- GT_Mod.gregtechproxy.addFluid("NitroFuel_Old", "Nitro Diesel [Old]", mNitroFix, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, mNitroFix, 1L), ItemUtils.getEmptyCell(), 1000);
- Logger.INFO("[Nitro] Added a fluid.");
-
-
- /**
- * Reflectively get all the values to maintain 5.08.xx compat
- */
-
-
- GT_Recipe_Map recipeMapMultiblockChemReactor;
- recipeMapMultiblockChemReactor = (GT_Recipe_Map) FieldUtils.getDeclaredField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes", true).get(null);
-
-
-
- /**
- * Do Recipe Stuff
- */
-
- //Set up some Variables
- final Collection<GT_Recipe> xSingle = GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList;
- final Collection<GT_Recipe> xMulti = recipeMapMultiblockChemReactor.mRecipeList;
- final FluidStack mNitroStack = Materials.NitroFuel.getFluid(1000);
- GT_Recipe toRemoveSingle[] = new GT_Recipe[99];
- GT_Recipe toRemoveMulti[] = new GT_Recipe[99];
- int mIndexSingle = 0;
- int mIndexMulti = 0;
-
- //Iterate Single Block recipes for Nitro production.
- for (GT_Recipe rnd : xSingle){
- for (FluidStack mOutputFluid : rnd.mFluidOutputs){
- if (mOutputFluid.isFluidEqual(mNitroStack)){
- toRemoveSingle[mIndexSingle++] = rnd;
- }
- }
- }
- Logger.INFO("[Nitro] Found "+mIndexSingle+" single block Chemical Reactor recipes to remove.");
-
- //Iterate Multi Block recipes for Nitro production.
- for (GT_Recipe rnd : xMulti){
- for (FluidStack mOutputFluid : rnd.mFluidOutputs){
- if (mOutputFluid.isFluidEqual(mNitroStack)){
- toRemoveMulti[mIndexMulti++] = rnd;
- }
- }
- }
- Logger.INFO("[Nitro] Found "+mIndexMulti+" multi block Chemical Reactor recipes to remove.");
-
- //Remove Single Block recipes found.
- int mRemovedSingle = 0;
- int mRemovedMulti = 0;
- for (GT_Recipe single : toRemoveSingle){
- if (GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(single)){
- mRemovedSingle++;
- }
- }
- Logger.INFO("[Nitro] Removed "+mRemovedSingle+" single block Chemical Reactor recipes.");
-
- //Remove Multi Block recipes found.
- for (GT_Recipe multi : toRemoveMulti){
- if (recipeMapMultiblockChemReactor.mRecipeList.remove(multi)){
- mRemovedMulti++;
- }
- }
- Logger.INFO("[Nitro] Removed "+mRemovedMulti+" multi block Chemical Reactor recipes.");
-
- Materials mGlycerol = Materials.valueOf("Glycerol");
- Materials mLightFuel = Materials.valueOf("LightFuel");
-
- //Build a New Recipe set
- Materials mFuels[] = {mLightFuel, Materials.Fuel};
- for (Materials fuel : mFuels){
- boolean didAdd[] = new boolean[3];
- Logger.INFO("[Nitro] Getting ready to add back in the old nitro-diesel recipe to the mixer, using "+fuel.mDefaultLocalName+" as the fuel input.");
- didAdd[0] = GT_Values.RA.addMixerRecipe(getCells(fuel, 4), getCells(mGlycerol, 1), GT_Values.NI, GT_Values.NI, GT_Values.NF, GT_Values.NF, getCells(mNitroFix, 5), 20, 30);
- didAdd[1] = GT_Values.RA.addMixerRecipe(getCells(fuel, 4), GT_Values.NI, GT_Values.NI, GT_Values.NI, mGlycerol.getFluid(1000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(4L), 20, 30);
- didAdd[2] = GT_Values.RA.addMixerRecipe(getCells(mGlycerol, 1), GT_Values.NI,GT_Values.NI,GT_Values.NI, fuel.getFluid(4000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(1L), 20, 30);
- Logger.INFO("[Nitro] Did the recipes add? 1: "+didAdd[0]+" | 2: "+didAdd[1]+" | 3: "+didAdd[2]);
- }
-
- for (Materials fuel : mFuels){
- boolean didAdd[] = new boolean[3];
- Logger.INFO("[Nitro] Getting ready to add back in the old nitro-diesel recipe to the chemical reactors, using "+fuel.mDefaultLocalName+" as the fuel input.");
- didAdd[0] = GT_Values.RA.addChemicalRecipe(getCells(fuel, 4), getCells(mGlycerol, 1), GT_Values.NF, GT_Values.NF, getCells(mNitroFix, 5), 20);
- didAdd[1] = GT_Values.RA.addChemicalRecipe(getCells(fuel, 4), GT_Values.NI, mGlycerol.getFluid(1000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(4L), 20);
- didAdd[2] = GT_Values.RA.addChemicalRecipe(getCells(mGlycerol, 1), GT_Values.NI, fuel.getFluid(4000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(1L), 20);
- Logger.INFO("[Nitro] Did the recipes add? 1: "+didAdd[0]+" | 2: "+didAdd[1]+" | 3: "+didAdd[2]);
- }
-
- Logger.INFO("[Nitro] Getting ready to add back in the old glycerol recipe!");
- GT_Values.RA.addChemicalRecipe(getCells(Materials.Nitrogen, 1), getDust(Materials.Carbon, 1), Materials.Water.getFluid(2000L), mGlycerol.getFluid(3000L), ItemList.Cell_Empty.get(1), 3000);
- Logger.INFO("[Nitro] Added recipes.");
-
- }
- }
- }
- }
- catch (IllegalArgumentException | IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
- Logger.INFO("[Nitro] ================ Error ================");
- e.printStackTrace();
- Logger.INFO("[Nitro] ================ Error ================");
- }
- }
- }
-
-
- public static ItemStack getCells(Materials mat, int amount){
- String mName = MaterialUtils.getMaterialName(mat);
- return ItemUtils.getItemStackOfAmountFromOreDict("cell"+mName, amount);
- }
-
- public static ItemStack getDust(Materials mat, int amount){
- String mName = MaterialUtils.getMaterialName(mat);
- return ItemUtils.getItemStackOfAmountFromOreDict("dust"+mName, amount);
- }
-
-
+ @SuppressWarnings("unchecked")
+ public static void run() {
+ if (CORE.ConfigSwitches.enableNitroFix) {
+ Logger.INFO("Gregtech5u Content | Attempting to Fix Nitro-Diesel production.");
+ try {
+ int mSub = Utils.getGregtechSubVersion();
+ if (mSub != 0) {
+ if (mSub >= 30) {
+ Class mb = ReflectionUtils.getClass("gregtech.api.enums.MaterialBuilder");
+ Object df = mb.getConstructor(int.class, TextureSet.class, String.class)
+ .newInstance(975, TextureSet.SET_FLUID, "Nitro-Diesel [Old]");
+ if (mb.isInstance(df)) {
+
+ Logger.INFO("[Nitro] Created new instance of Material builder, for Nitro fix.");
+
+ // Get Methods
+ Method addFluid = mb.getDeclaredMethod("addFluid");
+ Method addCell = mb.getDeclaredMethod("addCell");
+ Method setColour = mb.getDeclaredMethod("setColor", Dyes.class);
+ Method setFuelPower = mb.getDeclaredMethod("setFuelPower", int.class);
+ Method setMaterials = mb.getDeclaredMethod("setMaterialList", List.class);
+ Method setTemp = mb.getDeclaredMethod("setLiquidTemperature", int.class);
+ Method setRGB = mb.getDeclaredMethod("setRGB", int.class, int.class, int.class);
+ Method construct = mb.getDeclaredMethod("constructMaterial");
+ Logger.INFO("[Nitro] Got internal methods for setting fields.");
+
+ // Invoke the methods
+ addFluid.invoke(df);
+ addCell.invoke(df);
+ setColour.invoke(df, Dyes.dyeLime);
+ setFuelPower.invoke(df, 512000);
+ setMaterials.invoke(
+ df,
+ Arrays.asList(
+ new MaterialStack(Materials.Glyceryl, 1),
+ new MaterialStack(Materials.Fuel, 4)));
+ setTemp.invoke(df, 295);
+ setRGB.invoke(df, 200, 255, 0);
+ Materials mNitroFix = (Materials) construct.invoke(df);
+ Logger.INFO("[Nitro] Invoked 8 method calls successfully.");
+
+ GT_Mod.gregtechproxy.addFluid(
+ "NitroFuel_Old",
+ "Nitro Diesel [Old]",
+ mNitroFix,
+ 1,
+ 295,
+ GT_OreDictUnificator.get(OrePrefixes.cell, mNitroFix, 1L),
+ ItemUtils.getEmptyCell(),
+ 1000);
+ Logger.INFO("[Nitro] Added a fluid.");
+
+ /**
+ * Reflectively get all the values to maintain 5.08.xx compat
+ */
+ GT_Recipe_Map recipeMapMultiblockChemReactor;
+ recipeMapMultiblockChemReactor = (GT_Recipe_Map)
+ FieldUtils.getDeclaredField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes", true)
+ .get(null);
+
+ /**
+ * Do Recipe Stuff
+ */
+
+ // Set up some Variables
+ final Collection<GT_Recipe> xSingle = GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList;
+ final Collection<GT_Recipe> xMulti = recipeMapMultiblockChemReactor.mRecipeList;
+ final FluidStack mNitroStack = Materials.NitroFuel.getFluid(1000);
+ GT_Recipe toRemoveSingle[] = new GT_Recipe[99];
+ GT_Recipe toRemoveMulti[] = new GT_Recipe[99];
+ int mIndexSingle = 0;
+ int mIndexMulti = 0;
+
+ // Iterate Single Block recipes for Nitro production.
+ for (GT_Recipe rnd : xSingle) {
+ for (FluidStack mOutputFluid : rnd.mFluidOutputs) {
+ if (mOutputFluid.isFluidEqual(mNitroStack)) {
+ toRemoveSingle[mIndexSingle++] = rnd;
+ }
+ }
+ }
+ Logger.INFO("[Nitro] Found " + mIndexSingle
+ + " single block Chemical Reactor recipes to remove.");
+
+ // Iterate Multi Block recipes for Nitro production.
+ for (GT_Recipe rnd : xMulti) {
+ for (FluidStack mOutputFluid : rnd.mFluidOutputs) {
+ if (mOutputFluid.isFluidEqual(mNitroStack)) {
+ toRemoveMulti[mIndexMulti++] = rnd;
+ }
+ }
+ }
+ Logger.INFO("[Nitro] Found " + mIndexMulti
+ + " multi block Chemical Reactor recipes to remove.");
+
+ // Remove Single Block recipes found.
+ int mRemovedSingle = 0;
+ int mRemovedMulti = 0;
+ for (GT_Recipe single : toRemoveSingle) {
+ if (GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(single)) {
+ mRemovedSingle++;
+ }
+ }
+ Logger.INFO(
+ "[Nitro] Removed " + mRemovedSingle + " single block Chemical Reactor recipes.");
+
+ // Remove Multi Block recipes found.
+ for (GT_Recipe multi : toRemoveMulti) {
+ if (recipeMapMultiblockChemReactor.mRecipeList.remove(multi)) {
+ mRemovedMulti++;
+ }
+ }
+ Logger.INFO("[Nitro] Removed " + mRemovedMulti + " multi block Chemical Reactor recipes.");
+
+ Materials mGlycerol = Materials.valueOf("Glycerol");
+ Materials mLightFuel = Materials.valueOf("LightFuel");
+
+ // Build a New Recipe set
+ Materials mFuels[] = {mLightFuel, Materials.Fuel};
+ for (Materials fuel : mFuels) {
+ boolean didAdd[] = new boolean[3];
+ Logger.INFO(
+ "[Nitro] Getting ready to add back in the old nitro-diesel recipe to the mixer, using "
+ + fuel.mDefaultLocalName + " as the fuel input.");
+ didAdd[0] = GT_Values.RA.addMixerRecipe(
+ getCells(fuel, 4),
+ getCells(mGlycerol, 1),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NF,
+ GT_Values.NF,
+ getCells(mNitroFix, 5),
+ 20,
+ 30);
+ didAdd[1] = GT_Values.RA.addMixerRecipe(
+ getCells(fuel, 4),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ mGlycerol.getFluid(1000L),
+ mNitroFix.getFluid(5000L),
+ ItemList.Cell_Empty.get(4L),
+ 20,
+ 30);
+ didAdd[2] = GT_Values.RA.addMixerRecipe(
+ getCells(mGlycerol, 1),
+ GT_Values.NI,
+ GT_Values.NI,
+ GT_Values.NI,
+ fuel.getFluid(4000L),
+ mNitroFix.getFluid(5000L),
+ ItemList.Cell_Empty.get(1L),
+ 20,
+ 30);
+ Logger.INFO("[Nitro] Did the recipes add? 1: " + didAdd[0] + " | 2: " + didAdd[1]
+ + " | 3: " + didAdd[2]);
+ }
+
+ for (Materials fuel : mFuels) {
+ boolean didAdd[] = new boolean[3];
+ Logger.INFO(
+ "[Nitro] Getting ready to add back in the old nitro-diesel recipe to the chemical reactors, using "
+ + fuel.mDefaultLocalName + " as the fuel input.");
+ didAdd[0] = GT_Values.RA.addChemicalRecipe(
+ getCells(fuel, 4),
+ getCells(mGlycerol, 1),
+ GT_Values.NF,
+ GT_Values.NF,
+ getCells(mNitroFix, 5),
+ 20);
+ didAdd[1] = GT_Values.RA.addChemicalRecipe(
+ getCells(fuel, 4),
+ GT_Values.NI,
+ mGlycerol.getFluid(1000L),
+ mNitroFix.getFluid(5000L),
+ ItemList.Cell_Empty.get(4L),
+ 20);
+ didAdd[2] = GT_Values.RA.addChemicalRecipe(
+ getCells(mGlycerol, 1),
+ GT_Values.NI,
+ fuel.getFluid(4000L),
+ mNitroFix.getFluid(5000L),
+ ItemList.Cell_Empty.get(1L),
+ 20);
+ Logger.INFO("[Nitro] Did the recipes add? 1: " + didAdd[0] + " | 2: " + didAdd[1]
+ + " | 3: " + didAdd[2]);
+ }
+
+ Logger.INFO("[Nitro] Getting ready to add back in the old glycerol recipe!");
+ GT_Values.RA.addChemicalRecipe(
+ getCells(Materials.Nitrogen, 1),
+ getDust(Materials.Carbon, 1),
+ Materials.Water.getFluid(2000L),
+ mGlycerol.getFluid(3000L),
+ ItemList.Cell_Empty.get(1),
+ 3000);
+ Logger.INFO("[Nitro] Added recipes.");
+ }
+ }
+ }
+ } catch (IllegalArgumentException
+ | IllegalAccessException
+ | InstantiationException
+ | InvocationTargetException
+ | NoSuchMethodException
+ | SecurityException e) {
+ Logger.INFO("[Nitro] ================ Error ================");
+ e.printStackTrace();
+ Logger.INFO("[Nitro] ================ Error ================");
+ }
+ }
+ }
+
+ public static ItemStack getCells(Materials mat, int amount) {
+ String mName = MaterialUtils.getMaterialName(mat);
+ return ItemUtils.getItemStackOfAmountFromOreDict("cell" + mName, amount);
+ }
+
+ public static ItemStack getDust(Materials mat, int amount) {
+ String mName = MaterialUtils.getMaterialName(mat);
+ return ItemUtils.getItemStackOfAmountFromOreDict("dust" + mName, amount);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java
index c470243822..9b5968657f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java
@@ -10,48 +10,60 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaP
public class GregtechPollutionDevices {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- if (PollutionUtils.isPollutionEnabled()) {
- Logger.INFO("Gregtech5u Content | Registering Anti-Pollution Devices.");
- run1();
- }
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ if (PollutionUtils.isPollutionEnabled()) {
+ Logger.INFO("Gregtech5u Content | Registering Anti-Pollution Devices.");
+ run1();
+ }
+ }
+ }
- private static void run1() {
- if (CORE.ConfigSwitches.enableMachine_Pollution){
- // 759
- GregtechItemList.Pollution_Detector.set(
- new GregtechMetaPollutionDetector(756, "pollutiondetector.01.tier.single", "Pollution Detection Device",
- 0, "Tells you if you're living in Gwalior yet.", 0).getStackForm(1L));
- GregtechItemList.Pollution_Creator.set(new GregtechMetaPollutionCreator(951, "pollutioncreator.01.tier.single",
- "Smog Device", 4, "Polluting the skies.", 0).getStackForm(1L));
-
- GregtechItemList.Pollution_Cleaner_ULV.set(new GregtechMetaAtmosphericReconditioner(757,
- "pollutioncleaner.01.tier.single", "Pollution Scrubber", 0).getStackForm(1L));
- GregtechItemList.Pollution_Cleaner_LV.set(new GregtechMetaAtmosphericReconditioner(758,
- "pollutioncleaner.02.tier.single", "Upgraded Pollution Scrubber", 1).getStackForm(1L));
- GregtechItemList.Pollution_Cleaner_MV.set(new GregtechMetaAtmosphericReconditioner(759,
- "pollutioncleaner.03.tier.single", "Advanced Pollution Scrubber", 2).getStackForm(1L));
- GregtechItemList.Pollution_Cleaner_HV.set(new GregtechMetaAtmosphericReconditioner(760,
- "pollutioncleaner.04.tier.single", "Precision Pollution Scrubber", 3).getStackForm(1L));
- GregtechItemList.Pollution_Cleaner_EV.set(new GregtechMetaAtmosphericReconditioner(761,
- "pollutioncleaner.05.tier.single", "Air Recycler", 4).getStackForm(1L));
- GregtechItemList.Pollution_Cleaner_IV.set(new GregtechMetaAtmosphericReconditioner(762,
- "pollutioncleaner.06.tier.single", "Upgraded Air Recycler", 5).getStackForm(1L));
- GregtechItemList.Pollution_Cleaner_LuV.set(new GregtechMetaAtmosphericReconditioner(763,
- "pollutioncleaner.07.tier.single", "Advanced Air Recycler", 6).getStackForm(1L));
- GregtechItemList.Pollution_Cleaner_ZPM.set(new GregtechMetaAtmosphericReconditioner(764,
- "pollutioncleaner.08.tier.single", "Precision Air Recycler", 7).getStackForm(1L));
- GregtechItemList.Pollution_Cleaner_UV.set(new GregtechMetaAtmosphericReconditioner(765,
- "pollutioncleaner.09.tier.single", "Atmospheric Cleaner", 8).getStackForm(1L));
- GregtechItemList.Pollution_Cleaner_MAX.set(new GregtechMetaAtmosphericReconditioner(766,
- "pollutioncleaner.10.tier.single", "Biosphere Cleanser", 9).getStackForm(1L));
- }
-
-
-
- }
+ private static void run1() {
+ if (CORE.ConfigSwitches.enableMachine_Pollution) {
+ // 759
+ GregtechItemList.Pollution_Detector.set(new GregtechMetaPollutionDetector(
+ 756,
+ "pollutiondetector.01.tier.single",
+ "Pollution Detection Device",
+ 0,
+ "Tells you if you're living in Gwalior yet.",
+ 0)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Creator.set(new GregtechMetaPollutionCreator(
+ 951, "pollutioncreator.01.tier.single", "Smog Device", 4, "Polluting the skies.", 0)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_ULV.set(new GregtechMetaAtmosphericReconditioner(
+ 757, "pollutioncleaner.01.tier.single", "Pollution Scrubber", 0)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_LV.set(new GregtechMetaAtmosphericReconditioner(
+ 758, "pollutioncleaner.02.tier.single", "Upgraded Pollution Scrubber", 1)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_MV.set(new GregtechMetaAtmosphericReconditioner(
+ 759, "pollutioncleaner.03.tier.single", "Advanced Pollution Scrubber", 2)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_HV.set(new GregtechMetaAtmosphericReconditioner(
+ 760, "pollutioncleaner.04.tier.single", "Precision Pollution Scrubber", 3)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_EV.set(
+ new GregtechMetaAtmosphericReconditioner(761, "pollutioncleaner.05.tier.single", "Air Recycler", 4)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_IV.set(new GregtechMetaAtmosphericReconditioner(
+ 762, "pollutioncleaner.06.tier.single", "Upgraded Air Recycler", 5)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_LuV.set(new GregtechMetaAtmosphericReconditioner(
+ 763, "pollutioncleaner.07.tier.single", "Advanced Air Recycler", 6)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_ZPM.set(new GregtechMetaAtmosphericReconditioner(
+ 764, "pollutioncleaner.08.tier.single", "Precision Air Recycler", 7)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_UV.set(new GregtechMetaAtmosphericReconditioner(
+ 765, "pollutioncleaner.09.tier.single", "Atmospheric Cleaner", 8)
+ .getStackForm(1L));
+ GregtechItemList.Pollution_Cleaner_MAX.set(new GregtechMetaAtmosphericReconditioner(
+ 766, "pollutioncleaner.10.tier.single", "Biosphere Cleanser", 9)
+ .getStackForm(1L));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java
index 7a71707f24..d1d6dd5f04 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java
@@ -7,37 +7,45 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEn
public class GregtechPowerBreakers {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Power Breakers.");
- run1();
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Power Breakers.");
+ run1();
+ }
+ }
- }
-
- private static void run1() {
- //30200
- int aStartID = 30400;
- GregtechItemList.BreakerBox_ULV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.00",
- "Ultra Low Voltage Breaker Box", 0, "", 16)).getStackForm(1L));
- GregtechItemList.BreakerBox_LV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.01",
- "Low Voltage Breaker Box", 1, "", 16)).getStackForm(1L));
- GregtechItemList.BreakerBox_MV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.02",
- "Medium Voltage Breaker Box", 2, "", 16)).getStackForm(1L));
- GregtechItemList.BreakerBox_HV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.03",
- "High Voltage Breaker Box", 3, "", 16)).getStackForm(1L));
- GregtechItemList.BreakerBox_EV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.04",
- "Extreme Voltage Breaker Box", 4, "", 16)).getStackForm(1L));
- GregtechItemList.BreakerBox_IV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.05",
- "Insane Voltage Breaker Box", 5, "", 16)).getStackForm(1L));
- GregtechItemList.BreakerBox_LuV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.06",
- "Ludicrous Voltage Breaker Box", 6, "", 16)).getStackForm(1L));
- GregtechItemList.BreakerBox_ZPM.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.07",
- "ZPM Voltage Breaker Box", 7, "", 16)).getStackForm(1L));
- GregtechItemList.BreakerBox_UV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.08",
- "Ultimate Voltage Breaker Box", 8, "", 16)).getStackForm(1L));
- GregtechItemList.BreakerBox_MAX.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.09",
- GT_Values.VN[9]+" Breaker Box", 9, "", 16)).getStackForm(1L));
-
- }
-} \ No newline at end of file
+ private static void run1() {
+ // 30200
+ int aStartID = 30400;
+ GregtechItemList.BreakerBox_ULV.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.00", "Ultra Low Voltage Breaker Box", 0, "", 16))
+ .getStackForm(1L));
+ GregtechItemList.BreakerBox_LV.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.01", "Low Voltage Breaker Box", 1, "", 16))
+ .getStackForm(1L));
+ GregtechItemList.BreakerBox_MV.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.02", "Medium Voltage Breaker Box", 2, "", 16))
+ .getStackForm(1L));
+ GregtechItemList.BreakerBox_HV.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.03", "High Voltage Breaker Box", 3, "", 16))
+ .getStackForm(1L));
+ GregtechItemList.BreakerBox_EV.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.04", "Extreme Voltage Breaker Box", 4, "", 16))
+ .getStackForm(1L));
+ GregtechItemList.BreakerBox_IV.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.05", "Insane Voltage Breaker Box", 5, "", 16))
+ .getStackForm(1L));
+ GregtechItemList.BreakerBox_LuV.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.06", "Ludicrous Voltage Breaker Box", 6, "", 16))
+ .getStackForm(1L));
+ GregtechItemList.BreakerBox_ZPM.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.07", "ZPM Voltage Breaker Box", 7, "", 16))
+ .getStackForm(1L));
+ GregtechItemList.BreakerBox_UV.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.08", "Ultimate Voltage Breaker Box", 8, "", 16))
+ .getStackForm(1L));
+ GregtechItemList.BreakerBox_MAX.set((new GT_MetaTileEntity_BasicBreaker(
+ aStartID++, "breaker.tier.09", GT_Values.VN[9] + " Breaker Box", 9, "", 16))
+ .getStackForm(1L));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java
index 9e94d633f6..17d89686a6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java
@@ -2,7 +2,6 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
@@ -13,31 +12,50 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.Gregt
public class GregtechPowerSubStation {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Power Substation Node.");
- if (CORE.ConfigSwitches.enableMultiblock_PowerSubstation) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Power Substation Node.");
+ if (CORE.ConfigSwitches.enableMultiblock_PowerSubstation) {
+ run1();
+ }
+ }
+ }
- }
+ private static void run1() {
+ // Steam Condensors
+ GregtechItemList.PowerSubStation.set(new GregtechMetaTileEntity_PowerSubStationController(
+ 812, "substation.01.input.single", "Power Station Control Node")
+ .getStackForm(1L));
+ int tID = 886;
+ GregtechItemList.Hatch_Input_Battery_MV.set(
+ new GT_MetaTileEntity_Hatch_InputBattery(tID++, "hatch.input_battery.tier.00", "Charging Bus (MV)", 2)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Input_Battery_EV.set(
+ new GT_MetaTileEntity_Hatch_InputBattery(tID++, "hatch.input_battery.tier.01", "Charging Bus (EV)", 4)
+ .getStackForm(1L));
- private static void run1() {
- // Steam Condensors
- GregtechItemList.PowerSubStation.set(new GregtechMetaTileEntity_PowerSubStationController(812,
- "substation.01.input.single", "Power Station Control Node").getStackForm(1L));
- int tID = 886;
- GregtechItemList.Hatch_Input_Battery_MV.set(new GT_MetaTileEntity_Hatch_InputBattery(tID++, "hatch.input_battery.tier.00", "Charging Bus (MV)", 2).getStackForm(1L));
- GregtechItemList.Hatch_Input_Battery_EV.set(new GT_MetaTileEntity_Hatch_InputBattery(tID++, "hatch.input_battery.tier.01", "Charging Bus (EV)", 4).getStackForm(1L));
+ GregtechItemList.Hatch_Output_Battery_MV.set(new GT_MetaTileEntity_Hatch_OutputBattery(
+ tID++, "hatch.output_battery.tier.00", "Discharging Bus (MV)", 2)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Output_Battery_EV.set(new GT_MetaTileEntity_Hatch_OutputBattery(
+ tID++, "hatch.output_battery.tier.01", "Discharging Bus (EV)", 4)
+ .getStackForm(1L));
- GregtechItemList.Hatch_Output_Battery_MV.set(new GT_MetaTileEntity_Hatch_OutputBattery(tID++, "hatch.output_battery.tier.00", "Discharging Bus (MV)", 2).getStackForm(1L));
- GregtechItemList.Hatch_Output_Battery_EV.set(new GT_MetaTileEntity_Hatch_OutputBattery(tID++, "hatch.output_battery.tier.01", "Discharging Bus (EV)", 4).getStackForm(1L));
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Input_Battery_MV.get(1L, new Object[0]), CI.bitsd, new Object[]{"C", "M", 'M', ItemList.Hull_MV, 'C', ItemList.Battery_Buffer_2by2_MV});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Input_Battery_EV.get(1L, new Object[0]), CI.bitsd, new Object[]{"C", "M", 'M', ItemList.Hull_EV, 'C', ItemList.Battery_Buffer_4by4_EV});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Output_Battery_MV.get(1L, new Object[0]), CI.bitsd, new Object[]{"M", "C", 'M', ItemList.Hull_MV, 'C', ItemList.Battery_Buffer_2by2_MV});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Output_Battery_EV.get(1L, new Object[0]), CI.bitsd, new Object[]{"M", "C", 'M', ItemList.Hull_EV, 'C', ItemList.Battery_Buffer_4by4_EV});
-
- }
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Input_Battery_MV.get(1L, new Object[0]),
+ CI.bitsd,
+ new Object[] {"C", "M", 'M', ItemList.Hull_MV, 'C', ItemList.Battery_Buffer_2by2_MV});
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Input_Battery_EV.get(1L, new Object[0]),
+ CI.bitsd,
+ new Object[] {"C", "M", 'M', ItemList.Hull_EV, 'C', ItemList.Battery_Buffer_4by4_EV});
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Output_Battery_MV.get(1L, new Object[0]),
+ CI.bitsd,
+ new Object[] {"M", "C", 'M', ItemList.Hull_MV, 'C', ItemList.Battery_Buffer_2by2_MV});
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Hatch_Output_Battery_EV.get(1L, new Object[0]),
+ CI.bitsd,
+ new Object[] {"M", "C", 'M', ItemList.Hull_EV, 'C', ItemList.Battery_Buffer_4by4_EV});
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java
index a7332657ce..91902396d9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java
@@ -6,17 +6,16 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileE
public class GregtechRTG {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering RTG.");
- run1();
- }
- }
-
- private static void run1() {
- GregtechItemList.RTG.set(
- new GregtechMetaTileEntity_RTG(869, "basicgenerator.rtg.tier.01", "Radioisotope Thermoelectric Generator", 3)
- .getStackForm(1L));
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering RTG.");
+ run1();
+ }
+ }
+ private static void run1() {
+ GregtechItemList.RTG.set(new GregtechMetaTileEntity_RTG(
+ 869, "basicgenerator.rtg.tier.01", "Radioisotope Thermoelectric Generator", 3)
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
index 5a7d3a50d7..bc50a23a77 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
@@ -1,12 +1,9 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
@@ -16,113 +13,215 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntityRocketFuelGenerator;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_LargeRocketEngine;
+import net.minecraft.item.ItemStack;
public class GregtechRocketFuelGenerator {
- public static void run() {
- if (LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Industrial Rocket Engines.");
- if (CORE.ConfigSwitches.enableMachine_RocketEngines) {
- run1();
- }
- }
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Rocket Engines.");
+ if (CORE.ConfigSwitches.enableMachine_RocketEngines) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- GregtechItemList.Controller_RocketEngine.set(
- new GregtechMetaTileEntity_LargeRocketEngine(996, "gtpp.multimachine.rocketengine", "Rocketdyne F-1A Engine").getStackForm(1L));
-
-
- ItemList aDieselEngine = ItemUtils.getValueOfItemList("Machine_Multi_DieselEngine", ItemList.Machine_Multi_LargeBoiler_TungstenSteel);
-
- GT_ModHandler.addCraftingRecipe(
- GregtechItemList.Controller_RocketEngine.get(1L),
- CI.bitsd,
- new Object[]{
- "PCP", "EME", "GWG",
- 'M', aDieselEngine,
- 'P', ItemList.Electric_Piston_IV,
- 'E', ItemList.Field_Generator_EV,
- 'C', OrePrefixes.circuit.get(Materials.Master),
- 'W', OrePrefixes.cableGt08.get(Materials.Platinum),
- 'G', ALLOY.MARAGING350.getGear(1)});
-
- GT_ModHandler.addCraftingRecipe(
- GregtechItemList.Casing_RocketEngine.get(1L),
- CI.bitsd,
- new Object[]{
- "PhP", "RFR", "PWP",
- 'R', OrePrefixes.pipeLarge.get(Materials.TungstenSteel),
- 'F', ItemList.Casing_RobustTungstenSteel,
- 'P', ALLOY.NITINOL_60.getGear(1)});
+ private static void run1() {
+ GregtechItemList.Controller_RocketEngine.set(new GregtechMetaTileEntity_LargeRocketEngine(
+ 996, "gtpp.multimachine.rocketengine", "Rocketdyne F-1A Engine")
+ .getStackForm(1L));
- GregtechItemList.Rocket_Engine_EV.set(new GregtechMetaTileEntityRocketFuelGenerator(793,
- "advancedgenerator.rocketFuel.tier.01", "Basic Rocket Engine", 4).getStackForm(1L));
- GregtechItemList.Rocket_Engine_IV.set(new GregtechMetaTileEntityRocketFuelGenerator(794,
- "advancedgenerator.rocketFuel.tier.02", "Advanced Rocket Engine", 5).getStackForm(1L));
- GregtechItemList.Rocket_Engine_LuV.set(new GregtechMetaTileEntityRocketFuelGenerator(795,
- "advancedgenerator.rocketFuel.tier.03", "Turbo Rocket Engine", 6).getStackForm(1L));
- if (!CORE.GTNH) {
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'),
- ItemList.Electric_Piston_EV, Character.valueOf('E'), ItemList.Electric_Motor_EV,
- Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'),
- OrePrefixes.cableGt02.get(Materials.Aluminium), Character.valueOf('G'),
- ALLOY.TANTALLOY_61.getGear(1)});
+ ItemList aDieselEngine = ItemUtils.getValueOfItemList(
+ "Machine_Multi_DieselEngine", ItemList.Machine_Multi_LargeBoiler_TungstenSteel);
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'),
- ItemList.Electric_Piston_IV, Character.valueOf('E'), ItemList.Electric_Motor_IV,
- Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Superconductor),
- Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Platinum), Character.valueOf('G'),
- ALLOY.STELLITE.getGear(1)});
- }
- if (CORE.GTNH) {
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'),
- ItemList.Electric_Piston_EV, Character.valueOf('E'), ItemList.Electric_Motor_EV,
- Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'),
- OrePrefixes.cableGt02.get(Materials.Aluminium), Character.valueOf('G'),
- ALLOY.TANTALLOY_61.getGear(1)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Controller_RocketEngine.get(1L), CI.bitsd, new Object[] {
+ "PCP",
+ "EME",
+ "GWG",
+ 'M',
+ aDieselEngine,
+ 'P',
+ ItemList.Electric_Piston_IV,
+ 'E',
+ ItemList.Field_Generator_EV,
+ 'C',
+ OrePrefixes.circuit.get(Materials.Master),
+ 'W',
+ OrePrefixes.cableGt08.get(Materials.Platinum),
+ 'G',
+ ALLOY.MARAGING350.getGear(1)
+ });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'),
- ItemList.Electric_Piston_IV, Character.valueOf('E'), ItemList.Electric_Motor_IV,
- Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Master),
- Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Platinum), Character.valueOf('G'),
- ALLOY.STELLITE.getGear(1)});
- }
- final ItemStack INGREDIENT_1 = CI.electricPiston_LuV;
- final ItemStack INGREDIENT_2 = CI.electricMotor_LuV;
- if (!CORE.GTNH) {
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'),
- INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Infinite), Character.valueOf('W'),
- OrePrefixes.cableGt02.get(Materials.Tungsten), Character.valueOf('G'),
- ALLOY.ZERON_100.getGear(1)});
- }
- if (CORE.GTNH) {
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'),
- INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'),
- OrePrefixes.cableGt02.get(Materials.Tungsten), Character.valueOf('G'),
- ALLOY.ZERON_100.getGear(1)});
- }
- }
-}
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Casing_RocketEngine.get(1L), CI.bitsd, new Object[] {
+ "PhP",
+ "RFR",
+ "PWP",
+ 'R',
+ OrePrefixes.pipeLarge.get(Materials.TungstenSteel),
+ 'F',
+ ItemList.Casing_RobustTungstenSteel,
+ 'P',
+ ALLOY.NITINOL_60.getGear(1)
+ });
+
+ GregtechItemList.Rocket_Engine_EV.set(new GregtechMetaTileEntityRocketFuelGenerator(
+ 793, "advancedgenerator.rocketFuel.tier.01", "Basic Rocket Engine", 4)
+ .getStackForm(1L));
+ GregtechItemList.Rocket_Engine_IV.set(new GregtechMetaTileEntityRocketFuelGenerator(
+ 794, "advancedgenerator.rocketFuel.tier.02", "Advanced Rocket Engine", 5)
+ .getStackForm(1L));
+ GregtechItemList.Rocket_Engine_LuV.set(new GregtechMetaTileEntityRocketFuelGenerator(
+ 795, "advancedgenerator.rocketFuel.tier.03", "Turbo Rocket Engine", 6)
+ .getStackForm(1L));
+ if (!CORE.GTNH) {
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "PCP",
+ "EME",
+ "GWG",
+ Character.valueOf('M'),
+ ItemList.Hull_EV,
+ Character.valueOf('P'),
+ ItemList.Electric_Piston_EV,
+ Character.valueOf('E'),
+ ItemList.Electric_Motor_EV,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Ultimate),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt02.get(Materials.Aluminium),
+ Character.valueOf('G'),
+ ALLOY.TANTALLOY_61.getGear(1)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "PCP",
+ "EME",
+ "GWG",
+ Character.valueOf('M'),
+ ItemList.Hull_IV,
+ Character.valueOf('P'),
+ ItemList.Electric_Piston_IV,
+ Character.valueOf('E'),
+ ItemList.Electric_Motor_IV,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Superconductor),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt02.get(Materials.Platinum),
+ Character.valueOf('G'),
+ ALLOY.STELLITE.getGear(1)
+ });
+ }
+ if (CORE.GTNH) {
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "PCP",
+ "EME",
+ "GWG",
+ Character.valueOf('M'),
+ ItemList.Hull_EV,
+ Character.valueOf('P'),
+ ItemList.Electric_Piston_EV,
+ Character.valueOf('E'),
+ ItemList.Electric_Motor_EV,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Elite),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt02.get(Materials.Aluminium),
+ Character.valueOf('G'),
+ ALLOY.TANTALLOY_61.getGear(1)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "PCP",
+ "EME",
+ "GWG",
+ Character.valueOf('M'),
+ ItemList.Hull_IV,
+ Character.valueOf('P'),
+ ItemList.Electric_Piston_IV,
+ Character.valueOf('E'),
+ ItemList.Electric_Motor_IV,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Master),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt02.get(Materials.Platinum),
+ Character.valueOf('G'),
+ ALLOY.STELLITE.getGear(1)
+ });
+ }
+ final ItemStack INGREDIENT_1 = CI.electricPiston_LuV;
+ final ItemStack INGREDIENT_2 = CI.electricMotor_LuV;
+ if (!CORE.GTNH) {
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Rocket_Engine_LuV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "PCP",
+ "EME",
+ "GWG",
+ Character.valueOf('M'),
+ ItemList.Hull_LuV,
+ Character.valueOf('P'),
+ INGREDIENT_1,
+ Character.valueOf('E'),
+ INGREDIENT_2,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Infinite),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt02.get(Materials.Tungsten),
+ Character.valueOf('G'),
+ ALLOY.ZERON_100.getGear(1)
+ });
+ }
+ if (CORE.GTNH) {
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Rocket_Engine_LuV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "PCP",
+ "EME",
+ "GWG",
+ Character.valueOf('M'),
+ ItemList.Hull_LuV,
+ Character.valueOf('P'),
+ INGREDIENT_1,
+ Character.valueOf('E'),
+ INGREDIENT_2,
+ Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Ultimate),
+ Character.valueOf('W'),
+ OrePrefixes.cableGt02.get(Materials.Tungsten),
+ Character.valueOf('G'),
+ ALLOY.ZERON_100.getGear(1)
+ });
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java
index 124b5d114d..60b7d5a8cc 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java
@@ -2,117 +2,234 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gregtech.api.enums.*;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaSafeBlock;
public class GregtechSafeBlock {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Lockable Safe Blocks.");
- if (CORE.ConfigSwitches.enableMachine_Safes) {
- run1();
- }
- }
-
- }
-
- private static void run1() {
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Lockable Safe Blocks.");
+ if (CORE.ConfigSwitches.enableMachine_Safes) {
+ run1();
+ }
+ }
+ }
- GregtechItemList.GT_Safe_ULV
- .set(new GregtechMetaSafeBlock(780, "protection.playersafe.tier.00", "Ultra Low Voltage Player Safe", 0)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_LV
- .set(new GregtechMetaSafeBlock(781, "protection.playersafe.tier.01", "Low Voltage Player Safe", 1)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_MV
- .set(new GregtechMetaSafeBlock(782, "protection.playersafe.tier.02", "Medium Voltage Player Safe", 2)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_HV
- .set(new GregtechMetaSafeBlock(783, "protection.playersafe.tier.03", "High Voltage Player Safe", 3)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_EV
- .set(new GregtechMetaSafeBlock(784, "protection.playersafe.tier.04", "Extreme Voltage Player Safe", 4)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_IV
- .set(new GregtechMetaSafeBlock(785, "protection.playersafe.tier.05", "Insane Voltage Player Safe", 5)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_LuV
- .set(new GregtechMetaSafeBlock(786, "protection.playersafe.tier.06", "Ludicrous Voltage Player Safe", 6)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_ZPM
- .set(new GregtechMetaSafeBlock(787, "protection.playersafe.tier.07", "ZPM Voltage Player Safe", 7)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_UV
- .set(new GregtechMetaSafeBlock(788, "protection.playersafe.tier.08", "Ultimate Voltage Player Safe", 8)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_MAX
- .set(new GregtechMetaSafeBlock(789, "protection.playersafe.tier.09", "MAX Voltage Player Safe", 9)
- .getStackForm(1L));
+ private static void run1() {
- // To-Do Change Recipes
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_ULV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_LV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Good) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_MV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Good) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_HV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_EV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Elite) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_IV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Master) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Master) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_ZPM.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Master) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_UV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Master), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Superconductor) });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_MAX.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('V'),
- OrePrefixes.circuit.get(Materials.Master), Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Infinite) });
+ GregtechItemList.GT_Safe_ULV.set(
+ new GregtechMetaSafeBlock(780, "protection.playersafe.tier.00", "Ultra Low Voltage Player Safe", 0)
+ .getStackForm(1L));
+ GregtechItemList.GT_Safe_LV.set(
+ new GregtechMetaSafeBlock(781, "protection.playersafe.tier.01", "Low Voltage Player Safe", 1)
+ .getStackForm(1L));
+ GregtechItemList.GT_Safe_MV.set(
+ new GregtechMetaSafeBlock(782, "protection.playersafe.tier.02", "Medium Voltage Player Safe", 2)
+ .getStackForm(1L));
+ GregtechItemList.GT_Safe_HV.set(
+ new GregtechMetaSafeBlock(783, "protection.playersafe.tier.03", "High Voltage Player Safe", 3)
+ .getStackForm(1L));
+ GregtechItemList.GT_Safe_EV.set(
+ new GregtechMetaSafeBlock(784, "protection.playersafe.tier.04", "Extreme Voltage Player Safe", 4)
+ .getStackForm(1L));
+ GregtechItemList.GT_Safe_IV.set(
+ new GregtechMetaSafeBlock(785, "protection.playersafe.tier.05", "Insane Voltage Player Safe", 5)
+ .getStackForm(1L));
+ GregtechItemList.GT_Safe_LuV.set(
+ new GregtechMetaSafeBlock(786, "protection.playersafe.tier.06", "Ludicrous Voltage Player Safe", 6)
+ .getStackForm(1L));
+ GregtechItemList.GT_Safe_ZPM.set(
+ new GregtechMetaSafeBlock(787, "protection.playersafe.tier.07", "ZPM Voltage Player Safe", 7)
+ .getStackForm(1L));
+ GregtechItemList.GT_Safe_UV.set(
+ new GregtechMetaSafeBlock(788, "protection.playersafe.tier.08", "Ultimate Voltage Player Safe", 8)
+ .getStackForm(1L));
+ GregtechItemList.GT_Safe_MAX.set(
+ new GregtechMetaSafeBlock(789, "protection.playersafe.tier.09", "MAX Voltage Player Safe", 9)
+ .getStackForm(1L));
- }
+ // To-Do Change Recipes
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_ULV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_ULV,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Basic),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Basic)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_LV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_LV,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Basic),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Good)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_MV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_MV,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Good),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Good)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_HV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_HV,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Good),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Advanced)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_EV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_EV,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Advanced),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Elite)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_IV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_IV,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Advanced),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Master)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_LuV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_LuV,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Elite),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Master)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_ZPM.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_ZPM,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Elite),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Master)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_UV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_UV,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Master),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Superconductor)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.GT_Safe_MAX.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "CMV",
+ " X ",
+ Character.valueOf('M'),
+ ItemList.Hull_MAX,
+ Character.valueOf('V'),
+ OrePrefixes.circuit.get(Materials.Master),
+ Character.valueOf('C'),
+ OreDictNames.craftingChest,
+ Character.valueOf('X'),
+ OrePrefixes.circuit.get(Materials.Infinite)
+ });
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSemiFluidgenerators.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSemiFluidgenerators.java
index 6b38415db1..b98f193df0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSemiFluidgenerators.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSemiFluidgenerators.java
@@ -6,15 +6,18 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr
public class GregtechSemiFluidgenerators {
- public static void run(){
- GregtechItemList.Generator_SemiFluid_LV.set(new GT_MetaTileEntity_SemiFluidGenerator(837, "basicgenerator.semifluid.tier.01",
- "Basic Semi-Fluid Generator", 1).getStackForm(1L));
- GregtechItemList.Generator_SemiFluid_MV.set(new GT_MetaTileEntity_SemiFluidGenerator(838, "basicgenerator.semifluid.tier.02",
- "Advanced Semi-Fluid Generator", 2).getStackForm(1L));
- GregtechItemList.Generator_SemiFluid_HV.set(new GT_MetaTileEntity_SemiFluidGenerator(839, "basicgenerator.semifluid.tier.03",
- "Turbo Semi-Fluid Generator", 3).getStackForm(1L));
- GregtechItemList.Controller_LargeSemifluidGenerator.set(new GregtechMetaTileEntity_LargeSemifluidGenerator(31026, "gtpp.multimachine.semifluidgenerator", "Large Semifluid Burner").getStackForm(1L));
-
- }
-
+ public static void run() {
+ GregtechItemList.Generator_SemiFluid_LV.set(new GT_MetaTileEntity_SemiFluidGenerator(
+ 837, "basicgenerator.semifluid.tier.01", "Basic Semi-Fluid Generator", 1)
+ .getStackForm(1L));
+ GregtechItemList.Generator_SemiFluid_MV.set(new GT_MetaTileEntity_SemiFluidGenerator(
+ 838, "basicgenerator.semifluid.tier.02", "Advanced Semi-Fluid Generator", 2)
+ .getStackForm(1L));
+ GregtechItemList.Generator_SemiFluid_HV.set(new GT_MetaTileEntity_SemiFluidGenerator(
+ 839, "basicgenerator.semifluid.tier.03", "Turbo Semi-Fluid Generator", 3)
+ .getStackForm(1L));
+ GregtechItemList.Controller_LargeSemifluidGenerator.set(new GregtechMetaTileEntity_LargeSemifluidGenerator(
+ 31026, "gtpp.multimachine.semifluidgenerator", "Large Semifluid Burner")
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java
index d2087b22f4..124c7731ee 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java
@@ -1,109 +1,110 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
-import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GTPP_Recipe;
-
+import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_BasicWasher;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class GregtechSimpleWasher {
- public static void run() {
- if (CORE.ConfigSwitches.enableMachine_SimpleWasher){
- generateDirtyDustRecipes();
- generateDirtyCrushedRecipes();
- // Register the Simple Washer Entity.
- GregtechItemList.SimpleDustWasher_ULV
- .set(new GregtechMetaTileEntity_BasicWasher(767, "simplewasher.01.tier.01", "Simple Washer I", 0)
- .getStackForm(1L));
-
- //People want them in higher tiers apparently
- GregtechItemList.SimpleDustWasher_MV
- .set(new GregtechMetaTileEntity_BasicWasher(31017, "simplewasher.01.tier.02", "Simple Washer II", 2)
- .getStackForm(1L));
- GregtechItemList.SimpleDustWasher_EV
- .set(new GregtechMetaTileEntity_BasicWasher(31018, "simplewasher.01.tier.03", "Simple Washer III", 4)
- .getStackForm(1L));
- GregtechItemList.SimpleDustWasher_LuV
- .set(new GregtechMetaTileEntity_BasicWasher(31019, "simplewasher.01.tier.04", "Simple Washer IV", 6)
- .getStackForm(1L));
- GregtechItemList.SimpleDustWasher_UV
- .set(new GregtechMetaTileEntity_BasicWasher(31020, "simplewasher.01.tier.05", "Simple Washer V", 8)
- .getStackForm(1L));
- }
- }
+ public static void run() {
+ if (CORE.ConfigSwitches.enableMachine_SimpleWasher) {
+ generateDirtyDustRecipes();
+ generateDirtyCrushedRecipes();
+ // Register the Simple Washer Entity.
+ GregtechItemList.SimpleDustWasher_ULV.set(
+ new GregtechMetaTileEntity_BasicWasher(767, "simplewasher.01.tier.01", "Simple Washer I", 0)
+ .getStackForm(1L));
+
+ // People want them in higher tiers apparently
+ GregtechItemList.SimpleDustWasher_MV.set(
+ new GregtechMetaTileEntity_BasicWasher(31017, "simplewasher.01.tier.02", "Simple Washer II", 2)
+ .getStackForm(1L));
+ GregtechItemList.SimpleDustWasher_EV.set(
+ new GregtechMetaTileEntity_BasicWasher(31018, "simplewasher.01.tier.03", "Simple Washer III", 4)
+ .getStackForm(1L));
+ GregtechItemList.SimpleDustWasher_LuV.set(
+ new GregtechMetaTileEntity_BasicWasher(31019, "simplewasher.01.tier.04", "Simple Washer IV", 6)
+ .getStackForm(1L));
+ GregtechItemList.SimpleDustWasher_UV.set(
+ new GregtechMetaTileEntity_BasicWasher(31020, "simplewasher.01.tier.05", "Simple Washer V", 8)
+ .getStackForm(1L));
+ }
+ }
+
+ private static boolean generateDirtyDustRecipes() {
+ boolean disablePlat = CORE.GTNH;
+ int mRecipeCount = 0;
+ // Generate Recipe Map for the Dust Washer.
+ ItemStack dustClean;
+ ItemStack dustDirty;
+ for (Materials v : Materials.values()) {
+ if (disablePlat) {
+ if (v == Materials.Platinum
+ || v == Materials.Osmium
+ || v == Materials.Iridium
+ || v == Materials.Palladium) {
+ continue;
+ }
+ }
+
+ dustClean = GT_OreDictUnificator.get(OrePrefixes.dust, v, 1L);
+ dustDirty = GT_OreDictUnificator.get(OrePrefixes.dustImpure, v, 1L);
+ if (dustClean != null && dustDirty != null) {
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {dustDirty},
+ new ItemStack[] {dustClean},
+ null,
+ new int[] {},
+ new FluidStack[] {FluidUtils.getFluidStack("water", 100)},
+ new FluidStack[] {},
+ 5,
+ 8,
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.addRecipe(aRecipe);
+ }
+ }
- private static boolean generateDirtyDustRecipes(){
- boolean disablePlat = CORE.GTNH;
- int mRecipeCount = 0;
- // Generate Recipe Map for the Dust Washer.
- ItemStack dustClean;
- ItemStack dustDirty;
- for (Materials v : Materials.values()) {
- if (disablePlat) {
- if (v == Materials.Platinum || v == Materials.Osmium || v == Materials.Iridium || v == Materials.Palladium) {
- continue;
- }
- }
-
- dustClean = GT_OreDictUnificator.get(OrePrefixes.dust, v, 1L);
- dustDirty = GT_OreDictUnificator.get(OrePrefixes.dustImpure, v, 1L);
- if (dustClean != null && dustDirty != null) {
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] { dustDirty },
- new ItemStack[] { dustClean },
- null,
- new int[] {},
- new FluidStack[] { FluidUtils.getFluidStack("water", 100) },
- new FluidStack[] {},
- 5,
- 8,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.addRecipe(aRecipe);
- }
- }
-
- if (GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size() > mRecipeCount){
- return true;
- }
- return false;
- }
+ if (GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size() > mRecipeCount) {
+ return true;
+ }
+ return false;
+ }
- private static boolean generateDirtyCrushedRecipes(){
- int mRecipeCount = GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size();
- // Generate Recipe Map for the Dust Washer.
- ItemStack crushedClean;
- ItemStack crushedDirty;
- for (Materials v : Materials.values()) {
- crushedClean = GT_OreDictUnificator.get(OrePrefixes.crushedPurified, v, 1L);
- crushedDirty = GT_OreDictUnificator.get(OrePrefixes.crushed, v, 1L);
- if (crushedClean != null && crushedDirty != null) {
- GTPP_Recipe aRecipe = new GTPP_Recipe(
- false,
- new ItemStack[] { crushedDirty },
- new ItemStack[] { crushedClean },
- null,
- new int[] {},
- new FluidStack[] { FluidUtils.getFluidStack("water", 100) },
- new FluidStack[] {},
- 5,
- 8,
- 0);
- GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.addRecipe(aRecipe);
- }
- }
+ private static boolean generateDirtyCrushedRecipes() {
+ int mRecipeCount = GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size();
+ // Generate Recipe Map for the Dust Washer.
+ ItemStack crushedClean;
+ ItemStack crushedDirty;
+ for (Materials v : Materials.values()) {
+ crushedClean = GT_OreDictUnificator.get(OrePrefixes.crushedPurified, v, 1L);
+ crushedDirty = GT_OreDictUnificator.get(OrePrefixes.crushed, v, 1L);
+ if (crushedClean != null && crushedDirty != null) {
+ GTPP_Recipe aRecipe = new GTPP_Recipe(
+ false,
+ new ItemStack[] {crushedDirty},
+ new ItemStack[] {crushedClean},
+ null,
+ new int[] {},
+ new FluidStack[] {FluidUtils.getFluidStack("water", 100)},
+ new FluidStack[] {},
+ 5,
+ 8,
+ 0);
+ GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.addRecipe(aRecipe);
+ }
+ }
- if (GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size() > mRecipeCount){
- return true;
- }
- return false;
- }
+ if (GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size() > mRecipeCount) {
+ return true;
+ }
+ return false;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java
index 45f78d660b..5004984f0e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java
@@ -8,42 +8,46 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntitySolarGenerator;
public class GregtechSolarGenerators {
- public static void run() {
- if (LoadedMods.Gregtech && ConfigSwitches.enableMachine_SolarGenerators) {
- Logger.INFO("Gregtech5u Content | Registering Solar Generator Blocks.");
- if (CORE.ConfigSwitches.enableMachine_SolarGenerators) {
- run1();
- }
- }
+ public static void run() {
+ if (LoadedMods.Gregtech && ConfigSwitches.enableMachine_SolarGenerators) {
+ Logger.INFO("Gregtech5u Content | Registering Solar Generator Blocks.");
+ if (CORE.ConfigSwitches.enableMachine_SolarGenerators) {
+ run1();
+ }
+ }
+ }
- }
+ private static void run1() {
- private static void run1() {
-
- GregtechItemList.GT_Solar_ULV.set(new GregtechMetaTileEntitySolarGenerator(800, "sunabsorber.tier.00",
- "Ultra Low Voltage Solar Generator", 0).getStackForm(1L));
- GregtechItemList.GT_Solar_LV.set(
- new GregtechMetaTileEntitySolarGenerator(801, "sunabsorber.tier.01", "Low Voltage Solar Generator", 1)
- .getStackForm(1L));
- GregtechItemList.GT_Solar_MV.set(new GregtechMetaTileEntitySolarGenerator(802, "sunabsorber.tier.02",
- "Medium Voltage Solar Generator", 2).getStackForm(1L));
- GregtechItemList.GT_Solar_HV.set(
- new GregtechMetaTileEntitySolarGenerator(803, "sunabsorber.tier.03", "High Voltage Solar Generator", 3)
- .getStackForm(1L));
- GregtechItemList.GT_Solar_EV.set(new GregtechMetaTileEntitySolarGenerator(804, "sunabsorber.tier.04",
- "Extreme Voltage Solar Generator", 4).getStackForm(1L));
- GregtechItemList.GT_Solar_IV.set(new GregtechMetaTileEntitySolarGenerator(805, "sunabsorber.tier.05",
- "Insane Voltage Solar Generator", 5).getStackForm(1L));
- GregtechItemList.GT_Solar_LuV.set(new GregtechMetaTileEntitySolarGenerator(806, "sunabsorber.tier.06",
- "Ludicrous Voltage Solar Generator", 6).getStackForm(1L));
- GregtechItemList.GT_Solar_ZPM.set(
- new GregtechMetaTileEntitySolarGenerator(807, "sunabsorber.tier.07", "ZPM Voltage Solar Generator", 7)
- .getStackForm(1L));
- GregtechItemList.GT_Solar_UV.set(new GregtechMetaTileEntitySolarGenerator(808, "sunabsorber.tier.08",
- "Ultimate Voltage Solar Generator", 8).getStackForm(1L));
- GregtechItemList.GT_Solar_MAX.set(
- new GregtechMetaTileEntitySolarGenerator(809, "sunabsorber.tier.09", "MAX Voltage Solar Generator", 9)
- .getStackForm(1L));
-
- }
+ GregtechItemList.GT_Solar_ULV.set(new GregtechMetaTileEntitySolarGenerator(
+ 800, "sunabsorber.tier.00", "Ultra Low Voltage Solar Generator", 0)
+ .getStackForm(1L));
+ GregtechItemList.GT_Solar_LV.set(
+ new GregtechMetaTileEntitySolarGenerator(801, "sunabsorber.tier.01", "Low Voltage Solar Generator", 1)
+ .getStackForm(1L));
+ GregtechItemList.GT_Solar_MV.set(new GregtechMetaTileEntitySolarGenerator(
+ 802, "sunabsorber.tier.02", "Medium Voltage Solar Generator", 2)
+ .getStackForm(1L));
+ GregtechItemList.GT_Solar_HV.set(
+ new GregtechMetaTileEntitySolarGenerator(803, "sunabsorber.tier.03", "High Voltage Solar Generator", 3)
+ .getStackForm(1L));
+ GregtechItemList.GT_Solar_EV.set(new GregtechMetaTileEntitySolarGenerator(
+ 804, "sunabsorber.tier.04", "Extreme Voltage Solar Generator", 4)
+ .getStackForm(1L));
+ GregtechItemList.GT_Solar_IV.set(new GregtechMetaTileEntitySolarGenerator(
+ 805, "sunabsorber.tier.05", "Insane Voltage Solar Generator", 5)
+ .getStackForm(1L));
+ GregtechItemList.GT_Solar_LuV.set(new GregtechMetaTileEntitySolarGenerator(
+ 806, "sunabsorber.tier.06", "Ludicrous Voltage Solar Generator", 6)
+ .getStackForm(1L));
+ GregtechItemList.GT_Solar_ZPM.set(
+ new GregtechMetaTileEntitySolarGenerator(807, "sunabsorber.tier.07", "ZPM Voltage Solar Generator", 7)
+ .getStackForm(1L));
+ GregtechItemList.GT_Solar_UV.set(new GregtechMetaTileEntitySolarGenerator(
+ 808, "sunabsorber.tier.08", "Ultimate Voltage Solar Generator", 8)
+ .getStackForm(1L));
+ GregtechItemList.GT_Solar_MAX.set(
+ new GregtechMetaTileEntitySolarGenerator(809, "sunabsorber.tier.09", "MAX Voltage Solar Generator", 9)
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java
index aeb937e78b..fdb2ea8830 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java
@@ -10,37 +10,38 @@ import net.minecraftforge.fluids.FluidStack;
public class GregtechSolarTower {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Solar Tower.");
- run1();
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Solar Tower.");
+ run1();
+ }
+ }
- }
+ private static void run1() {
+ // Solar Tower
+ GregtechItemList.Industrial_Solar_Tower.set(
+ new GregtechMetaTileEntity_SolarTower(863, "solartower.controller.tier.single", "Solar Tower")
+ .getStackForm(1L));
+ GregtechItemList.Solar_Tower_Reflector.set(new TileEntitySolarHeater(
+ 864,
+ "solarreflector.simple.single",
+ "Solar Reflector",
+ 8,
+ "Part of the Clean Green energy movement",
+ 0)
+ .getStackForm(1L));
- private static void run1() {
- // Solar Tower
- GregtechItemList.Industrial_Solar_Tower.set(new GregtechMetaTileEntity_SolarTower(863, "solartower.controller.tier.single", "Solar Tower").getStackForm(1L));
- GregtechItemList.Solar_Tower_Reflector.set(
- new TileEntitySolarHeater(
- 864,
- "solarreflector.simple.single",
- "Solar Reflector",
- 8,
- "Part of the Clean Green energy movement",
- 0).getStackForm(1L));
-
- // NEI recipe
- GTPP_Recipe.GTPP_Recipe_Map.sSolarTowerRecipes.addRecipe(
- false,
- null,
- null,
- null,
- null,
- new FluidStack[] {MISC_MATERIALS.SOLAR_SALT_COLD.getFluidStack(1000)},
- new FluidStack[] {MISC_MATERIALS.SOLAR_SALT_HOT.getFluidStack(1000)},
- 0,
- 0,
- 0);
- }
+ // NEI recipe
+ GTPP_Recipe.GTPP_Recipe_Map.sSolarTowerRecipes.addRecipe(
+ false,
+ null,
+ null,
+ null,
+ null,
+ new FluidStack[] {MISC_MATERIALS.SOLAR_SALT_COLD.getFluidStack(1000)},
+ new FluidStack[] {MISC_MATERIALS.SOLAR_SALT_HOT.getFluidStack(1000)},
+ 0,
+ 0,
+ 0);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java
index 60e6b31936..8caa859f61 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java
@@ -7,20 +7,18 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaC
public class GregtechSteamCondenser {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Steam Condensor.");
- if (CORE.ConfigSwitches.enableMachine_SteamConverter) {
- run1();
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Steam Condensor.");
+ if (CORE.ConfigSwitches.enableMachine_SteamConverter) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- // Steam Condensors
- GregtechItemList.Condensor_MAX.set(
- new GregtechMetaCondensor(769, "steamcondensor.01.tier.single", "Steam Condensor").getStackForm(1L));
-
- }
+ private static void run1() {
+ // Steam Condensors
+ GregtechItemList.Condensor_MAX.set(
+ new GregtechMetaCondensor(769, "steamcondensor.01.tier.single", "Steam Condensor").getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java
index 271396ad5b..c6008c6b5c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java
@@ -9,16 +9,22 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.st
public class GregtechSteamMultis {
- public static void run(){
+ public static void run() {
- Logger.INFO("Gregtech5u Content | Registering Steam Multiblocks.");
-
- GregtechItemList.Controller_SteamMaceratorMulti.set(new GregtechMetaTileEntity_SteamMacerator(31041, "gtpp.multimachine.steam.macerator", "Steam Grinder").getStackForm(1L));
- GregtechItemList.Controller_SteamCompressorMulti.set(new GregtechMetaTileEntity_SteamCompressor(31078, "gtpp.multimachine.steam.compressor", "Steam Squasher").getStackForm(1L));
-
- GregtechItemList.Hatch_Input_Bus_Steam.set(new GT_MetaTileEntity_Hatch_Steam_BusInput(31046, "hatch.input_bus.tier.steam", "Input Bus (Steam)", 0).getStackForm(1L));
- GregtechItemList.Hatch_Output_Bus_Steam.set(new GT_MetaTileEntity_Hatch_Steam_BusOutput(31047, "hatch.output_bus.tier.steam", "Output Bus (Steam)", 0).getStackForm(1L));
-
- }
-
+ Logger.INFO("Gregtech5u Content | Registering Steam Multiblocks.");
+
+ GregtechItemList.Controller_SteamMaceratorMulti.set(
+ new GregtechMetaTileEntity_SteamMacerator(31041, "gtpp.multimachine.steam.macerator", "Steam Grinder")
+ .getStackForm(1L));
+ GregtechItemList.Controller_SteamCompressorMulti.set(new GregtechMetaTileEntity_SteamCompressor(
+ 31078, "gtpp.multimachine.steam.compressor", "Steam Squasher")
+ .getStackForm(1L));
+
+ GregtechItemList.Hatch_Input_Bus_Steam.set(
+ new GT_MetaTileEntity_Hatch_Steam_BusInput(31046, "hatch.input_bus.tier.steam", "Input Bus (Steam)", 0)
+ .getStackForm(1L));
+ GregtechItemList.Hatch_Output_Bus_Steam.set(new GT_MetaTileEntity_Hatch_Steam_BusOutput(
+ 31047, "hatch.output_bus.tier.steam", "Output Bus (Steam)", 0)
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java
index 5027e2d6e8..5c99d2b4b7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java
@@ -14,60 +14,120 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_Ti
public class GregtechSuperChests {
- public static void run() {
- int mId = 946;
-
- String aSuffix = "";
- if (CORE.GTNH) {
- aSuffix = " [Disabled]";
- }
-
- GregtechItemList.Super_Chest_LV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.01", "Super Chest I"+aSuffix, 1)).getStackForm(1L));
- GregtechItemList.Super_Chest_MV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.02", "Super Chest II"+aSuffix, 2)).getStackForm(1L));
- GregtechItemList.Super_Chest_HV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.03", "Super Chest III"+aSuffix, 3)).getStackForm(1L));
- GregtechItemList.Super_Chest_EV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.04", "Super Chest IV"+aSuffix, 4)).getStackForm(1L));
- GregtechItemList.Super_Chest_IV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.05", "Super Chest V"+aSuffix, 5)).getStackForm(1L));
-
- // Do not add Recipes for GTNH, hide them from NEI instead.
- if (CORE.GTNH) {
- ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_LV.get(1L));
- ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_MV.get(1L));
- ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_HV.get(1L));
- ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_EV.get(1L));
- ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_IV.get(1L));
- }
- else {
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_LV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_LV, Character.valueOf('D'),
- OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('P'),
- OrePrefixes.plate.get(Materials.Invar)});
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_MV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_MV, Character.valueOf('D'), OrePrefixes.circuit.get(Materials.Good),
- Character.valueOf('P'), OrePrefixes.plate.get(Materials.Aluminium)});
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_HV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_HV, Character.valueOf('D'), OrePrefixes.circuit.get(Materials.Advanced),
- Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel)});
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_EV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_EV, Character.valueOf('D'), OrePrefixes.circuit.get(Materials.Data),
- Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium)});
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_IV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_IV, Character.valueOf('D'),
- OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('P'),
- OrePrefixes.plate.get(Materials.Tungsten)});
- }
-
- //Test Thing
- GregtechItemList.CrateStorage.set((new GT_MetaTileEntity_ConnectableCrate(GT_MetaTileEntity_ConnectableCrate.mCrateID, "crate.tier.01", "Interconnecting Storage Crate", 0)).getStackForm(1L));
-
- }
+ public static void run() {
+ int mId = 946;
+ String aSuffix = "";
+ if (CORE.GTNH) {
+ aSuffix = " [Disabled]";
+ }
+
+ GregtechItemList.Super_Chest_LV.set(
+ (new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.01", "Super Chest I" + aSuffix, 1))
+ .getStackForm(1L));
+ GregtechItemList.Super_Chest_MV.set(
+ (new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.02", "Super Chest II" + aSuffix, 2))
+ .getStackForm(1L));
+ GregtechItemList.Super_Chest_HV.set(
+ (new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.03", "Super Chest III" + aSuffix, 3))
+ .getStackForm(1L));
+ GregtechItemList.Super_Chest_EV.set(
+ (new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.04", "Super Chest IV" + aSuffix, 4))
+ .getStackForm(1L));
+ GregtechItemList.Super_Chest_IV.set(
+ (new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.05", "Super Chest V" + aSuffix, 5))
+ .getStackForm(1L));
+
+ // Do not add Recipes for GTNH, hide them from NEI instead.
+ if (CORE.GTNH) {
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_LV.get(1L));
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_MV.get(1L));
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_HV.get(1L));
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_EV.get(1L));
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_IV.get(1L));
+ } else {
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Super_Chest_LV.get(1L, new Object[0]), bitsd, new Object[] {
+ "DPD",
+ "PMP",
+ "DGD",
+ Character.valueOf('M'),
+ ItemList.Hull_LV,
+ Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_LV,
+ Character.valueOf('D'),
+ OrePrefixes.circuit.get(Materials.Basic),
+ Character.valueOf('P'),
+ OrePrefixes.plate.get(Materials.Invar)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Super_Chest_MV.get(1L, new Object[0]), bitsd, new Object[] {
+ "DPD",
+ "PMP",
+ "DGD",
+ Character.valueOf('M'),
+ ItemList.Hull_MV,
+ Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_MV,
+ Character.valueOf('D'),
+ OrePrefixes.circuit.get(Materials.Good),
+ Character.valueOf('P'),
+ OrePrefixes.plate.get(Materials.Aluminium)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Super_Chest_HV.get(1L, new Object[0]), bitsd, new Object[] {
+ "DPD",
+ "PMP",
+ "DGD",
+ Character.valueOf('M'),
+ ItemList.Hull_HV,
+ Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_HV,
+ Character.valueOf('D'),
+ OrePrefixes.circuit.get(Materials.Advanced),
+ Character.valueOf('P'),
+ OrePrefixes.plate.get(Materials.StainlessSteel)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Super_Chest_EV.get(1L, new Object[0]), bitsd, new Object[] {
+ "DPD",
+ "PMP",
+ "DGD",
+ Character.valueOf('M'),
+ ItemList.Hull_EV,
+ Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_EV,
+ Character.valueOf('D'),
+ OrePrefixes.circuit.get(Materials.Data),
+ Character.valueOf('P'),
+ OrePrefixes.plate.get(Materials.Titanium)
+ });
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Super_Chest_IV.get(1L, new Object[0]), bitsd, new Object[] {
+ "DPD",
+ "PMP",
+ "DGD",
+ Character.valueOf('M'),
+ ItemList.Hull_IV,
+ Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_IV,
+ Character.valueOf('D'),
+ OrePrefixes.circuit.get(Materials.Elite),
+ Character.valueOf('P'),
+ OrePrefixes.plate.get(Materials.Tungsten)
+ });
+ }
+
+ // Test Thing
+ GregtechItemList.CrateStorage.set((new GT_MetaTileEntity_ConnectableCrate(
+ GT_MetaTileEntity_ConnectableCrate.mCrateID,
+ "crate.tier.01",
+ "Interconnecting Storage Crate",
+ 0))
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java
index 1376f4313d..cdeb6859c7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java
@@ -2,18 +2,17 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech;
public class GregtechSuperConductionPoint {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- //Utils.LOG_INFO("Gregtech5u Content | Registering Super Conductor Input Node.");
- run1();
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ // Utils.LOG_INFO("Gregtech5u Content | Registering Super Conductor Input Node.");
+ run1();
+ }
+ }
- }
+ private static void run1() {
+ // Steam Condensors
+ // GregtechItemList.SuperConductorInputNode.set(new GregtechMetaTileEntitySuperCondensor(811,
+ // "superconductor.01.input.single", "Power Phase Shifting Station", 8).getStackForm(1L));
- private static void run1() {
- // Steam Condensors
- //GregtechItemList.SuperConductorInputNode.set(new GregtechMetaTileEntitySuperCondensor(811,
- // "superconductor.01.input.single", "Power Phase Shifting Station", 8).getStackForm(1L));
-
- }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java
index 5023e80543..910c0964a2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java
@@ -6,10 +6,9 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.misc.Gregtech
public class GregtechTeslaTower {
- public static void run() {
- Logger.INFO("Gregtech5u Content | Registering Tesla Tower.");
- GregtechItemList.TelsaTower.set(new GregtechMTE_TeslaTower(984, "multimachine.telsatower", "Tesla's Last Testament").getStackForm(1));
-
- }
-
+ public static void run() {
+ Logger.INFO("Gregtech5u Content | Registering Tesla Tower.");
+ GregtechItemList.TelsaTower.set(
+ new GregtechMTE_TeslaTower(984, "multimachine.telsatower", "Tesla's Last Testament").getStackForm(1));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java
index 398d2caf01..728d23ed24 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java
@@ -7,20 +7,17 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaP
public class GregtechThaumcraftDevices {
- public static void run() {
- if (LoadedMods.Gregtech && LoadedMods.Thaumcraft) {
- Logger.INFO("Gregtech5u Content | Registering Thaumcraft content.");
- run1();
- }
- }
-
- private static void run1() {
- //956-960
- GregtechItemList.Thaumcraft_Researcher.set(new GregtechMetaPollutionCreator(956, "thaumcraft.gtpp.machine.01",
- "Arcane Researcher", 5, "Thinking for you.", 0).getStackForm(1L));
-
-
-
- }
-
+ public static void run() {
+ if (LoadedMods.Gregtech && LoadedMods.Thaumcraft) {
+ Logger.INFO("Gregtech5u Content | Registering Thaumcraft content.");
+ run1();
+ }
+ }
+
+ private static void run1() {
+ // 956-960
+ GregtechItemList.Thaumcraft_Researcher.set(new GregtechMetaPollutionCreator(
+ 956, "thaumcraft.gtpp.machine.01", "Arcane Researcher", 5, "Thinking for you.", 0)
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java
index 23c9f7e666..41ea0c3d26 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java
@@ -1,7 +1,6 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gregtech.api.enums.ItemList;
-
import gregtech.api.util.GT_Recipe;
import gregtech.common.tileentities.automation.GT_MetaTileEntity_SuperBuffer;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
@@ -10,127 +9,229 @@ import net.minecraft.item.ItemStack;
public class GregtechThreadedBuffers {
- public static void run() {
- run2();
- }
-
- private static void run2() {
-
- GregtechItemList.Infinite_Item_Chest.set((new GT_MetaTileEntity_InfiniteItemHolder(31010, "infinite.chest.tier.01", "Infinite Item Chest", 1)).getStackForm(1L));
+ public static void run() {
+ run2();
+ }
+
+ private static void run2() {
+
+ GregtechItemList.Infinite_Item_Chest.set(
+ (new GT_MetaTileEntity_InfiniteItemHolder(31010, "infinite.chest.tier.01", "Infinite Item Chest", 1))
+ .getStackForm(1L));
- /*
- * This file used to contain registration and recipes for GT++ threaded super buffers. Those have now been
- * deprecated and replaced by the original GT super buffers.
- *
- * To avoid breaking existing bases, we've assigned the threaded super buffer metadata IDs to a copy of the GT
- * super buffers, with a deprecation notice attached. We've also provided disassembler recipes that are the
- * reverse of the original crafting recipes, allowing players to reclaim their original materials as well as
- * convert the deprecated threaded super buffer metadata ID item back to the original GT super buffer metadata
- * ID item.
- */
+ /*
+ * This file used to contain registration and recipes for GT++ threaded super buffers. Those have now been
+ * deprecated and replaced by the original GT super buffers.
+ *
+ * To avoid breaking existing bases, we've assigned the threaded super buffer metadata IDs to a copy of the GT
+ * super buffers, with a deprecation notice attached. We've also provided disassembler recipes that are the
+ * reverse of the original crafting recipes, allowing players to reclaim their original materials as well as
+ * convert the deprecated threaded super buffer metadata ID item back to the original GT super buffer metadata
+ * ID item.
+ */
- final String deprecationNotice = "**DEPRECATED - Drop in disassembler!** ";
- GregtechItemList.Automation_Threaded_SuperBuffer_ULV.set((new GT_MetaTileEntity_SuperBuffer(31000, "automation.superbuffer.tier.00.deprecated", deprecationNotice + "Ultra Low Voltage Super Buffer", 0)).getStackForm(1L));
- GregtechItemList.Automation_Threaded_SuperBuffer_LV.set((new GT_MetaTileEntity_SuperBuffer(31001, "automation.superbuffer.tier.01.deprecated", deprecationNotice + "Low Voltage Super Buffer", 1)).getStackForm(1L));
- GregtechItemList.Automation_Threaded_SuperBuffer_MV.set((new GT_MetaTileEntity_SuperBuffer(31002, "automation.superbuffer.tier.02.deprecated", deprecationNotice + "Medium Voltage Super Buffer", 2)).getStackForm(1L));
- GregtechItemList.Automation_Threaded_SuperBuffer_HV.set((new GT_MetaTileEntity_SuperBuffer(31003, "automation.superbuffer.tier.03.deprecated", deprecationNotice + "High Voltage Super Buffer", 3)).getStackForm(1L));
- GregtechItemList.Automation_Threaded_SuperBuffer_EV.set((new GT_MetaTileEntity_SuperBuffer(31004, "automation.superbuffer.tier.04.deprecated", deprecationNotice + "Extreme Voltage Super Buffer", 4)).getStackForm(1L));
- GregtechItemList.Automation_Threaded_SuperBuffer_IV.set((new GT_MetaTileEntity_SuperBuffer(31005, "automation.superbuffer.tier.05.deprecated", deprecationNotice + "Insane Voltage Super Buffer", 5)).getStackForm(1L));
- GregtechItemList.Automation_Threaded_SuperBuffer_LuV.set((new GT_MetaTileEntity_SuperBuffer(31006, "automation.superbuffer.tier.06.deprecated", deprecationNotice + "Ludicrous Voltage Super Buffer", 6)).getStackForm(1L));
- GregtechItemList.Automation_Threaded_SuperBuffer_ZPM.set((new GT_MetaTileEntity_SuperBuffer(31007, "automation.superbuffer.tier.07.deprecated", deprecationNotice + "ZPM Voltage Super Buffer", 7)).getStackForm(1L));
- GregtechItemList.Automation_Threaded_SuperBuffer_UV.set((new GT_MetaTileEntity_SuperBuffer(31008, "automation.superbuffer.tier.08.deprecated", deprecationNotice + "Ultimate Voltage Super Buffer", 8)).getStackForm(1L));
- GregtechItemList.Automation_Threaded_SuperBuffer_MAX.set((new GT_MetaTileEntity_SuperBuffer(31009, "automation.superbuffer.tier.09.deprecated", deprecationNotice + "Highly Ultimate Voltage Super Buffer", 9)).getStackForm(1L));
+ final String deprecationNotice = "**DEPRECATED - Drop in disassembler!** ";
+ GregtechItemList.Automation_Threaded_SuperBuffer_ULV.set((new GT_MetaTileEntity_SuperBuffer(
+ 31000,
+ "automation.superbuffer.tier.00.deprecated",
+ deprecationNotice + "Ultra Low Voltage Super Buffer",
+ 0))
+ .getStackForm(1L));
+ GregtechItemList.Automation_Threaded_SuperBuffer_LV.set((new GT_MetaTileEntity_SuperBuffer(
+ 31001,
+ "automation.superbuffer.tier.01.deprecated",
+ deprecationNotice + "Low Voltage Super Buffer",
+ 1))
+ .getStackForm(1L));
+ GregtechItemList.Automation_Threaded_SuperBuffer_MV.set((new GT_MetaTileEntity_SuperBuffer(
+ 31002,
+ "automation.superbuffer.tier.02.deprecated",
+ deprecationNotice + "Medium Voltage Super Buffer",
+ 2))
+ .getStackForm(1L));
+ GregtechItemList.Automation_Threaded_SuperBuffer_HV.set((new GT_MetaTileEntity_SuperBuffer(
+ 31003,
+ "automation.superbuffer.tier.03.deprecated",
+ deprecationNotice + "High Voltage Super Buffer",
+ 3))
+ .getStackForm(1L));
+ GregtechItemList.Automation_Threaded_SuperBuffer_EV.set((new GT_MetaTileEntity_SuperBuffer(
+ 31004,
+ "automation.superbuffer.tier.04.deprecated",
+ deprecationNotice + "Extreme Voltage Super Buffer",
+ 4))
+ .getStackForm(1L));
+ GregtechItemList.Automation_Threaded_SuperBuffer_IV.set((new GT_MetaTileEntity_SuperBuffer(
+ 31005,
+ "automation.superbuffer.tier.05.deprecated",
+ deprecationNotice + "Insane Voltage Super Buffer",
+ 5))
+ .getStackForm(1L));
+ GregtechItemList.Automation_Threaded_SuperBuffer_LuV.set((new GT_MetaTileEntity_SuperBuffer(
+ 31006,
+ "automation.superbuffer.tier.06.deprecated",
+ deprecationNotice + "Ludicrous Voltage Super Buffer",
+ 6))
+ .getStackForm(1L));
+ GregtechItemList.Automation_Threaded_SuperBuffer_ZPM.set((new GT_MetaTileEntity_SuperBuffer(
+ 31007,
+ "automation.superbuffer.tier.07.deprecated",
+ deprecationNotice + "ZPM Voltage Super Buffer",
+ 7))
+ .getStackForm(1L));
+ GregtechItemList.Automation_Threaded_SuperBuffer_UV.set((new GT_MetaTileEntity_SuperBuffer(
+ 31008,
+ "automation.superbuffer.tier.08.deprecated",
+ deprecationNotice + "Ultimate Voltage Super Buffer",
+ 8))
+ .getStackForm(1L));
+ GregtechItemList.Automation_Threaded_SuperBuffer_MAX.set((new GT_MetaTileEntity_SuperBuffer(
+ 31009,
+ "automation.superbuffer.tier.09.deprecated",
+ deprecationNotice + "Highly Ultimate Voltage Super Buffer",
+ 9))
+ .getStackForm(1L));
- // These recipes are all 1 sec @ 32 EU/t
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_ULV.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_ULV.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- ItemList.Conveyor_Module_LV.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_LV.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_LV.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- ItemList.Conveyor_Module_LV.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_MV.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_MV.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- ItemList.Conveyor_Module_MV.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_HV.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_HV.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- ItemList.Conveyor_Module_HV.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_EV.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_EV.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- ItemList.Conveyor_Module_EV.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_IV.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_IV.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- ItemList.Conveyor_Module_IV.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_LuV.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_LuV.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- ItemList.Conveyor_Module_LuV.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_ZPM.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_ZPM.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- ItemList.Conveyor_Module_ZPM.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_UV.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_UV.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- ItemList.Conveyor_Module_UV.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
- true,
- new ItemStack[]{ GregtechItemList.Automation_Threaded_SuperBuffer_MAX.get(1L, new Object[0]) },
- new ItemStack[]{
- ItemList.Automation_SuperBuffer_MAX.get(1L, new Object[0]),
- ItemList.Tool_DataOrb.get(1L, new Object[0]),
- GregtechItemList.Conveyor_Module_MAX.get(1L, new Object[0]),
- },
- null, null, null, 20, 32, -100);
- }
+ // These recipes are all 1 sec @ 32 EU/t
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_ULV.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_ULV.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ ItemList.Conveyor_Module_LV.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_LV.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_LV.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ ItemList.Conveyor_Module_LV.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_MV.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_MV.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ ItemList.Conveyor_Module_MV.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_HV.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_HV.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ ItemList.Conveyor_Module_HV.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_EV.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_EV.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ ItemList.Conveyor_Module_EV.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_IV.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_IV.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ ItemList.Conveyor_Module_IV.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_LuV.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_LuV.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ ItemList.Conveyor_Module_LuV.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_ZPM.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_ZPM.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ ItemList.Conveyor_Module_ZPM.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_UV.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_UV.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ ItemList.Conveyor_Module_UV.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe(
+ true,
+ new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_MAX.get(1L, new Object[0])},
+ new ItemStack[] {
+ ItemList.Automation_SuperBuffer_MAX.get(1L, new Object[0]),
+ ItemList.Tool_DataOrb.get(1L, new Object[0]),
+ GregtechItemList.Conveyor_Module_MAX.get(1L, new Object[0]),
+ },
+ null,
+ null,
+ null,
+ 20,
+ 32,
+ -100);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java
index bbfd568e54..525b3f6110 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java
@@ -6,23 +6,23 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntityChunkLoader;
public class GregtechTieredChunkloaders {
- public static void run() {
- if (LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Chunk Loaders.");
- run1();
- }
- }
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Chunk Loaders.");
+ run1();
+ }
+ }
- private static void run1() {
- int ID = 943;
- GregtechItemList.GT_Chunkloader_HV
- .set(new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.01", "Chunkloader MK I", 3)
- .getStackForm(1L));
- GregtechItemList.GT_Chunkloader_IV
- .set(new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.02", "Chunkloader MK II", 5)
- .getStackForm(1L));
- GregtechItemList.GT_Chunkloader_ZPM
- .set(new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.03", "Chunkloader MK III", 7)
- .getStackForm(1L));
- }
+ private static void run1() {
+ int ID = 943;
+ GregtechItemList.GT_Chunkloader_HV.set(
+ new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.01", "Chunkloader MK I", 3)
+ .getStackForm(1L));
+ GregtechItemList.GT_Chunkloader_IV.set(
+ new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.02", "Chunkloader MK II", 5)
+ .getStackForm(1L));
+ GregtechItemList.GT_Chunkloader_ZPM.set(
+ new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.03", "Chunkloader MK III", 7)
+ .getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java
index 2a4a2b9f85..88984ac0c1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java
@@ -7,52 +7,51 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredTank;
public class GregtechTieredFluidTanks {
- public static void run() {
- if (LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Portable Fluid Tanks.");
- if (CORE.ConfigSwitches.enableMachine_FluidTanks) {
- run1();
- }
- }
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Portable Fluid Tanks.");
+ if (CORE.ConfigSwitches.enableMachine_FluidTanks) {
+ run1();
+ }
+ }
+ }
- }
-
- private static void run1() {
- int ID = 817;
- if (CORE.GTNH) {
- Logger.INFO("Only loading ULV-IV tier tanks for New Horizons Modpack.");
- }
- GregtechItemList.GT_FluidTank_ULV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.00", "Ultra Low Voltage Fluid Tank", 0)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_LV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.01", "Low Voltage Fluid Tank", 1)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_MV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.02", "Medium Voltage Fluid Tank", 2)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_HV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.03", "High Voltage Fluid Tank", 3)
- .getStackForm(1L));
- if (!CORE.GTNH) {
- GregtechItemList.GT_FluidTank_EV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.04", "Extreme Voltage Fluid Tank", 4)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_IV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.05", "Insane Voltage Fluid Tank", 5)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_LuV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.06", "Ludicrous Voltage Fluid Tank", 6)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_ZPM
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.07", "ZPM Voltage Fluid Tank", 7)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_UV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.08", "Ultimate Voltage Fluid Tank", 8)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_MAX
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.09", "MAX Voltage Fluid Tank", 9)
- .getStackForm(1L));
- }
- }
+ private static void run1() {
+ int ID = 817;
+ if (CORE.GTNH) {
+ Logger.INFO("Only loading ULV-IV tier tanks for New Horizons Modpack.");
+ }
+ GregtechItemList.GT_FluidTank_ULV.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.00", "Ultra Low Voltage Fluid Tank", 0)
+ .getStackForm(1L));
+ GregtechItemList.GT_FluidTank_LV.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.01", "Low Voltage Fluid Tank", 1)
+ .getStackForm(1L));
+ GregtechItemList.GT_FluidTank_MV.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.02", "Medium Voltage Fluid Tank", 2)
+ .getStackForm(1L));
+ GregtechItemList.GT_FluidTank_HV.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.03", "High Voltage Fluid Tank", 3)
+ .getStackForm(1L));
+ if (!CORE.GTNH) {
+ GregtechItemList.GT_FluidTank_EV.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.04", "Extreme Voltage Fluid Tank", 4)
+ .getStackForm(1L));
+ GregtechItemList.GT_FluidTank_IV.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.05", "Insane Voltage Fluid Tank", 5)
+ .getStackForm(1L));
+ GregtechItemList.GT_FluidTank_LuV.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.06", "Ludicrous Voltage Fluid Tank", 6)
+ .getStackForm(1L));
+ GregtechItemList.GT_FluidTank_ZPM.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.07", "ZPM Voltage Fluid Tank", 7)
+ .getStackForm(1L));
+ GregtechItemList.GT_FluidTank_UV.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.08", "Ultimate Voltage Fluid Tank", 8)
+ .getStackForm(1L));
+ GregtechItemList.GT_FluidTank_MAX.set(
+ new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.09", "MAX Voltage Fluid Tank", 9)
+ .getStackForm(1L));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTreeFarmerTE.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTreeFarmerTE.java
index 07139da024..38ef3e6b77 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTreeFarmerTE.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTreeFarmerTE.java
@@ -6,17 +6,17 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaTreeFarmerStructural;
public class GregtechTreeFarmerTE {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Tree Farmer Structural Block.");
- if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer) {
- run1();
- }
- }
- }
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Tree Farmer Structural Block.");
+ if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer) {
+ run1();
+ }
+ }
+ }
- private static void run1() {
- GregtechItemList.TreeFarmer_Structural.set(
- new GregtechMetaTreeFarmerStructural(752, "treefarmer.structural", "Farm Keeper", 0).getStackForm(1L));
- }
+ private static void run1() {
+ GregtechItemList.TreeFarmer_Structural.set(
+ new GregtechMetaTreeFarmerStructural(752, "treefarmer.structural", "Farm Keeper", 0).getStackForm(1L));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java
index ca90724400..fb14dad78f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java
@@ -1,7 +1,6 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
@@ -10,39 +9,91 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaW
public class GregtechWirelessChargers {
+ public static void run() {
- public static void run(){
-
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Wireless Chargers.");
-
-
- long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED;
- int mID = 890;
-
- Utils.registerEvent(new ChargingHelper());
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Wireless Chargers.");
- GregtechItemList.Charger_LV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.01.tier.single",
- "Wireless Charger MK I", 1, "Hopefully won't give you cancer.", 0).getStackForm(1L));
- GregtechItemList.Charger_MV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.02.tier.single",
- "Wireless Charger MK II", 2, "Hopefully won't give you cancer.", 0).getStackForm(1L));
- GregtechItemList.Charger_HV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.03.tier.single",
- "Wireless Charger MK III", 3, "Hopefully won't give you cancer.", 0).getStackForm(1L));
- GregtechItemList.Charger_EV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.04.tier.single",
- "Wireless Charger MK IV", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L));
- GregtechItemList.Charger_IV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.05.tier.single",
- "Wireless Charger MK V", 5, "Hopefully won't give you cancer.", 0).getStackForm(1L));
- GregtechItemList.Charger_LuV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.06.tier.single",
- "Wireless Charger MK VI", 6, "Hopefully won't give you cancer.", 0).getStackForm(1L));
- GregtechItemList.Charger_ZPM.set(new GregtechMetaWirelessCharger(mID++, "wificharger.07.tier.single",
- "Wireless Charger MK VII", 7, "Hopefully won't give you cancer.", 0).getStackForm(1L));
- GregtechItemList.Charger_UV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.08.tier.single",
- "Wireless Charger MK VIII", 8, "Hopefully won't give you cancer.", 0).getStackForm(1L));
- GregtechItemList.Charger_MAX.set(new GregtechMetaWirelessCharger(mID++, "wificharger.09.tier.single",
- "Wireless Charger MK IX", 9, "Hopefully won't give you cancer.", 0).getStackForm(1L));
+ long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED;
+ int mID = 890;
- }
- }
+ Utils.registerEvent(new ChargingHelper());
+ GregtechItemList.Charger_LV.set(new GregtechMetaWirelessCharger(
+ mID++,
+ "wificharger.01.tier.single",
+ "Wireless Charger MK I",
+ 1,
+ "Hopefully won't give you cancer.",
+ 0)
+ .getStackForm(1L));
+ GregtechItemList.Charger_MV.set(new GregtechMetaWirelessCharger(
+ mID++,
+ "wificharger.02.tier.single",
+ "Wireless Charger MK II",
+ 2,
+ "Hopefully won't give you cancer.",
+ 0)
+ .getStackForm(1L));
+ GregtechItemList.Charger_HV.set(new GregtechMetaWirelessCharger(
+ mID++,
+ "wificharger.03.tier.single",
+ "Wireless Charger MK III",
+ 3,
+ "Hopefully won't give you cancer.",
+ 0)
+ .getStackForm(1L));
+ GregtechItemList.Charger_EV.set(new GregtechMetaWirelessCharger(
+ mID++,
+ "wificharger.04.tier.single",
+ "Wireless Charger MK IV",
+ 4,
+ "Hopefully won't give you cancer.",
+ 0)
+ .getStackForm(1L));
+ GregtechItemList.Charger_IV.set(new GregtechMetaWirelessCharger(
+ mID++,
+ "wificharger.05.tier.single",
+ "Wireless Charger MK V",
+ 5,
+ "Hopefully won't give you cancer.",
+ 0)
+ .getStackForm(1L));
+ GregtechItemList.Charger_LuV.set(new GregtechMetaWirelessCharger(
+ mID++,
+ "wificharger.06.tier.single",
+ "Wireless Charger MK VI",
+ 6,
+ "Hopefully won't give you cancer.",
+ 0)
+ .getStackForm(1L));
+ GregtechItemList.Charger_ZPM.set(new GregtechMetaWirelessCharger(
+ mID++,
+ "wificharger.07.tier.single",
+ "Wireless Charger MK VII",
+ 7,
+ "Hopefully won't give you cancer.",
+ 0)
+ .getStackForm(1L));
+ GregtechItemList.Charger_UV.set(new GregtechMetaWirelessCharger(
+ mID++,
+ "wificharger.08.tier.single",
+ "Wireless Charger MK VIII",
+ 8,
+ "Hopefully won't give you cancer.",
+ 0)
+ .getStackForm(1L));
+ GregtechItemList.Charger_MAX.set(new GregtechMetaWirelessCharger(
+ mID++,
+ "wificharger.09.tier.single",
+ "Wireless Charger MK IX",
+ 9,
+ "Hopefully won't give you cancer.",
+ 0)
+ .getStackForm(1L));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/NewHorizonsAccelerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/NewHorizonsAccelerator.java
index d5b95a61bf..ceeed5128d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/NewHorizonsAccelerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/NewHorizonsAccelerator.java
@@ -2,7 +2,6 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
@@ -11,89 +10,231 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEn
public class NewHorizonsAccelerator {
- public static void run() {
- if (LoadedMods.Gregtech && !CORE.GTNH) {
- Logger.INFO("New Horizons Content | Registering World Accelerators.");
- if (CORE.ConfigSwitches.enableMachine_WorldAccelerators) {
- run1();
- }
- }
-
- }
-
- private static void run1() {
- GregtechItemList.AcceleratorLV.set(new GT_MetaTileEntity_WorldAccelerator(841,
- "basicmachine.accelerator.tier.01", "Basic World Accelerator", 1).getStackForm(1L));
- GregtechItemList.AcceleratorMV.set(new GT_MetaTileEntity_WorldAccelerator(842,
- "basicmachine.accelerator.tier.02", "Advanced World Accelerator", 2).getStackForm(1L));
- GregtechItemList.AcceleratorHV.set(new GT_MetaTileEntity_WorldAccelerator(843,
- "basicmachine.accelerator.tier.03", "Advanced World Accelerator II", 3).getStackForm(1L));
- GregtechItemList.AcceleratorEV.set(new GT_MetaTileEntity_WorldAccelerator(844,
- "basicmachine.accelerator.tier.04", "Advanced World Accelerator III", 4).getStackForm(1L));
- GregtechItemList.AcceleratorIV.set(new GT_MetaTileEntity_WorldAccelerator(845,
- "basicmachine.accelerator.tier.05", "Advanced World Accelerator IV", 5).getStackForm(1L));
- GregtechItemList.AcceleratorLuV.set(new GT_MetaTileEntity_WorldAccelerator(846,
- "basicmachine.accelerator.tier.06", "Elite World Accelerator", 6).getStackForm(1L));
- GregtechItemList.AcceleratorZPM.set(new GT_MetaTileEntity_WorldAccelerator(847,
- "basicmachine.accelerator.tier.07", "Elite World Accelerator II", 7).getStackForm(1L));
- GregtechItemList.AcceleratorUV.set(new GT_MetaTileEntity_WorldAccelerator(848,
- "basicmachine.accelerator.tier.08", "Ultimate Time Anomaly", 8).getStackForm(1L));
+ public static void run() {
+ if (LoadedMods.Gregtech && !CORE.GTNH) {
+ Logger.INFO("New Horizons Content | Registering World Accelerators.");
+ if (CORE.ConfigSwitches.enableMachine_WorldAccelerators) {
+ run1();
+ }
+ }
+ }
- GT_ModHandler.addCraftingRecipe(GregtechItemList.AcceleratorLV.get(1L),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_LV, 'M', ItemList.Electric_Motor_LV, 'P',
- ItemList.Electric_Pump_LV, 'B', ItemList.Hull_LV, 'C', ItemList.Conveyor_Module_LV, 'I',
- ItemList.Electric_Piston_LV });
+ private static void run1() {
+ GregtechItemList.AcceleratorLV.set(new GT_MetaTileEntity_WorldAccelerator(
+ 841, "basicmachine.accelerator.tier.01", "Basic World Accelerator", 1)
+ .getStackForm(1L));
+ GregtechItemList.AcceleratorMV.set(new GT_MetaTileEntity_WorldAccelerator(
+ 842, "basicmachine.accelerator.tier.02", "Advanced World Accelerator", 2)
+ .getStackForm(1L));
+ GregtechItemList.AcceleratorHV.set(new GT_MetaTileEntity_WorldAccelerator(
+ 843, "basicmachine.accelerator.tier.03", "Advanced World Accelerator II", 3)
+ .getStackForm(1L));
+ GregtechItemList.AcceleratorEV.set(new GT_MetaTileEntity_WorldAccelerator(
+ 844, "basicmachine.accelerator.tier.04", "Advanced World Accelerator III", 4)
+ .getStackForm(1L));
+ GregtechItemList.AcceleratorIV.set(new GT_MetaTileEntity_WorldAccelerator(
+ 845, "basicmachine.accelerator.tier.05", "Advanced World Accelerator IV", 5)
+ .getStackForm(1L));
+ GregtechItemList.AcceleratorLuV.set(new GT_MetaTileEntity_WorldAccelerator(
+ 846, "basicmachine.accelerator.tier.06", "Elite World Accelerator", 6)
+ .getStackForm(1L));
+ GregtechItemList.AcceleratorZPM.set(new GT_MetaTileEntity_WorldAccelerator(
+ 847, "basicmachine.accelerator.tier.07", "Elite World Accelerator II", 7)
+ .getStackForm(1L));
+ GregtechItemList.AcceleratorUV.set(new GT_MetaTileEntity_WorldAccelerator(
+ 848, "basicmachine.accelerator.tier.08", "Ultimate Time Anomaly", 8)
+ .getStackForm(1L));
- GT_ModHandler.addCraftingRecipe(GregtechItemList.AcceleratorMV.get(1L),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_MV, 'M', ItemList.Electric_Motor_MV, 'P',
- ItemList.Electric_Pump_MV, 'B', ItemList.Hull_MV, 'C', ItemList.Conveyor_Module_MV, 'I',
- ItemList.Electric_Piston_MV });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.AcceleratorLV.get(1L),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "RMR",
+ "PBC",
+ "IMI",
+ 'R',
+ ItemList.Robot_Arm_LV,
+ 'M',
+ ItemList.Electric_Motor_LV,
+ 'P',
+ ItemList.Electric_Pump_LV,
+ 'B',
+ ItemList.Hull_LV,
+ 'C',
+ ItemList.Conveyor_Module_LV,
+ 'I',
+ ItemList.Electric_Piston_LV
+ });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.AcceleratorHV.get(1L),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_HV, 'M', ItemList.Electric_Motor_HV, 'P',
- ItemList.Electric_Pump_HV, 'B', ItemList.Hull_HV, 'C', ItemList.Conveyor_Module_HV, 'I',
- ItemList.Electric_Piston_HV });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.AcceleratorMV.get(1L),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "RMR",
+ "PBC",
+ "IMI",
+ 'R',
+ ItemList.Robot_Arm_MV,
+ 'M',
+ ItemList.Electric_Motor_MV,
+ 'P',
+ ItemList.Electric_Pump_MV,
+ 'B',
+ ItemList.Hull_MV,
+ 'C',
+ ItemList.Conveyor_Module_MV,
+ 'I',
+ ItemList.Electric_Piston_MV
+ });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.AcceleratorEV.get(1L),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_EV, 'M', ItemList.Electric_Motor_EV, 'P',
- ItemList.Electric_Pump_EV, 'B', ItemList.Hull_EV, 'C', ItemList.Conveyor_Module_EV, 'I',
- ItemList.Electric_Piston_EV });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.AcceleratorHV.get(1L),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "RMR",
+ "PBC",
+ "IMI",
+ 'R',
+ ItemList.Robot_Arm_HV,
+ 'M',
+ ItemList.Electric_Motor_HV,
+ 'P',
+ ItemList.Electric_Pump_HV,
+ 'B',
+ ItemList.Hull_HV,
+ 'C',
+ ItemList.Conveyor_Module_HV,
+ 'I',
+ ItemList.Electric_Piston_HV
+ });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.AcceleratorIV.get(1L),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_IV, 'M', ItemList.Electric_Motor_IV, 'P',
- ItemList.Electric_Pump_IV, 'B', ItemList.Hull_IV, 'C', ItemList.Conveyor_Module_IV, 'I',
- ItemList.Electric_Piston_IV });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.AcceleratorEV.get(1L),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "RMR",
+ "PBC",
+ "IMI",
+ 'R',
+ ItemList.Robot_Arm_EV,
+ 'M',
+ ItemList.Electric_Motor_EV,
+ 'P',
+ ItemList.Electric_Pump_EV,
+ 'B',
+ ItemList.Hull_EV,
+ 'C',
+ ItemList.Conveyor_Module_EV,
+ 'I',
+ ItemList.Electric_Piston_EV
+ });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.AcceleratorLuV.get(1L),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_LuV, 'M', ItemList.Electric_Motor_LuV, 'P',
- ItemList.Electric_Pump_LuV, 'B', ItemList.Hull_LuV, 'C', ItemList.Conveyor_Module_LuV, 'I',
- ItemList.Electric_Piston_LuV });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.AcceleratorIV.get(1L),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "RMR",
+ "PBC",
+ "IMI",
+ 'R',
+ ItemList.Robot_Arm_IV,
+ 'M',
+ ItemList.Electric_Motor_IV,
+ 'P',
+ ItemList.Electric_Pump_IV,
+ 'B',
+ ItemList.Hull_IV,
+ 'C',
+ ItemList.Conveyor_Module_IV,
+ 'I',
+ ItemList.Electric_Piston_IV
+ });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.AcceleratorZPM.get(1L),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_ZPM, 'M', ItemList.Electric_Motor_ZPM, 'P',
- ItemList.Electric_Pump_ZPM, 'B', ItemList.Hull_ZPM, 'C', ItemList.Conveyor_Module_ZPM, 'I',
- ItemList.Electric_Piston_ZPM });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.AcceleratorLuV.get(1L),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "RMR",
+ "PBC",
+ "IMI",
+ 'R',
+ ItemList.Robot_Arm_LuV,
+ 'M',
+ ItemList.Electric_Motor_LuV,
+ 'P',
+ ItemList.Electric_Pump_LuV,
+ 'B',
+ ItemList.Hull_LuV,
+ 'C',
+ ItemList.Conveyor_Module_LuV,
+ 'I',
+ ItemList.Electric_Piston_LuV
+ });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.AcceleratorUV.get(1L),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_UV, 'M', ItemList.Electric_Motor_UV, 'P',
- ItemList.Electric_Pump_UV, 'B', ItemList.Hull_UV, 'C', ItemList.Conveyor_Module_UV, 'I',
- ItemList.Electric_Piston_UV });
- }
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.AcceleratorZPM.get(1L),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "RMR",
+ "PBC",
+ "IMI",
+ 'R',
+ ItemList.Robot_Arm_ZPM,
+ 'M',
+ ItemList.Electric_Motor_ZPM,
+ 'P',
+ ItemList.Electric_Pump_ZPM,
+ 'B',
+ ItemList.Hull_ZPM,
+ 'C',
+ ItemList.Conveyor_Module_ZPM,
+ 'I',
+ ItemList.Electric_Piston_ZPM
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.AcceleratorUV.get(1L),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {
+ "RMR",
+ "PBC",
+ "IMI",
+ 'R',
+ ItemList.Robot_Arm_UV,
+ 'M',
+ ItemList.Electric_Motor_UV,
+ 'P',
+ ItemList.Electric_Pump_UV,
+ 'B',
+ ItemList.Hull_UV,
+ 'C',
+ ItemList.Conveyor_Module_UV,
+ 'I',
+ ItemList.Electric_Piston_UV
+ });
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java b/src/main/java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
index d2f85e5daa..6dc79aa906 100644
--- a/src/main/java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
+++ b/src/main/java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
@@ -4,23 +4,18 @@ import gtPlusPlus.core.lib.LoadedMods;
public class HANDLER_GC {
+ // Run me during Pre-Init
+ public static void preInit() {
+ if (LoadedMods.Growthcraft) {
+ // Register_Booze.preInit();
+ }
+ }
- //Run me during Pre-Init
- public static void preInit(){
- if (LoadedMods.Growthcraft){
- //Register_Booze.preInit();
- }
- }
-
- public static void init(){
- if (LoadedMods.Growthcraft){
- }
- }
-
- public static void postInit(){
- if (LoadedMods.Growthcraft){
-
- }
- }
+ public static void init() {
+ if (LoadedMods.Growthcraft) {}
+ }
+ public static void postInit() {
+ if (LoadedMods.Growthcraft) {}
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java b/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
index a54fe8c1e3..2a86b80d00 100644
--- a/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.growthcraft.fishtrap;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.api.objects.Logger;
@@ -11,222 +8,221 @@ import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import net.minecraft.item.ItemStack;
public class FishTrapHandler {
- private static final String[] fishTypes = {"fish", "junk", "treasure"};
- private static Object mFishingRegistry;
- private static Growthcraft_Old mHandler;
-
- public static Object getFishingRegistry(){
- if (mFishingRegistry != null){
- return mFishingRegistry;
- }
- else {
- return setFishTrapRegistry();
- }
- }
-
- private final static Object setFishTrapRegistry(){
- Class mFishingRegistryClass;
- try {
- mFishingRegistryClass = ReflectionUtils.getClass("growthcraft.api.fishtrap.FishTrapRegistry");
- final Method mFishingRegistryMethod = mFishingRegistryClass.getDeclaredMethod("getInstance");
- mFishingRegistry = mFishingRegistryMethod.invoke(null);
- if (mFishingRegistry != null){
- return mFishingRegistry;
- }
- }
- catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- return null;
- }
-
- protected static void addFish(final String lootType, final ItemStack lootStack, final int lootChance){
-
- if (mFishingRegistry == null){
- setFishTrapRegistry();
- }
- if (mHandler == null){
- mHandler = new Growthcraft_Old();
- }
-
- final String GCVersion = LoadedMods.getModVersion("Growthcraft");
- final String[] versionString = GCVersion.split("//.");
-
- if (LoadedMods.getModVersion("Growthcraft").contains("2.3.1") || versionString[1].equals("3")){
- if (lootType.equals(fishTypes[0])){
- mHandler.addTrapFish(lootStack, lootChance);
- Logger.INFO("Added "+lootStack.getDisplayName()+" as an extra Fish for Growthcraft Fishtraps.");
- }
- else if (lootType.equals(fishTypes[1])){
- mHandler.addTrapJunk(lootStack, lootChance);
- Logger.INFO("Added "+lootStack.getDisplayName()+" as extra Junk for Growthcraft Fishtraps.");
- }
- else if (lootType.equals(fishTypes[2])){
- mHandler.addTrapTreasure(lootStack, lootChance);
- Logger.INFO("Added "+lootStack.getDisplayName()+" as extra Treasure for Growthcraft Fishtraps.");
- }
- else {
- return;
- }
- }/*
- else if (LoadedMods.getModVersion("Growthcraft").contains("2.7.2")){
- if (lootType.equals(fishTypes[0])){
- Growthcraft_New.addTrapFish(lootStack, lootChance);
- Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as an extra Fish for Growthcraft Fishtraps.");
- }
- else if (lootType.equals(fishTypes[1])){
- Growthcraft_New.addTrapJunk(lootStack, lootChance);
- Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Junk for Growthcraft Fishtraps.");
- }
- else if (lootType.equals(fishTypes[2])){
- Growthcraft_New.addTrapTreasure(lootStack, lootChance);
- Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Treasure for Growthcraft Fishtraps.");
- }
- else {
- return;
- }
- }*/
-
- else {
- Logger.INFO("Extra Fish loot for Growthcraft Fishtraps disabled. Found V."+LoadedMods.getModVersion("Growthcraft"));
- }
-
- }
- //FishTrapHandler.pamsHarvestCraftCompat();
- final static String prefix = "food";
- final static String suffix = "raw";
- final static String seaweed = "cropSeaweed";
- final static String greenheartFish = "foodGreenheartfish";
- private static final String[] harvestcraftFish = {
- "Anchovy", "Bass", "Calamari", "Carp", "Catfish", "Charr", "Clam", "Crab", "Crayfish", "Eel", "Frog", "Grouper", "Herring",
- "Jellyfish", "Mudfish", "Octopus", "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walley"};
- public static void pamsHarvestCraftCompat(){
- for (int i = 0; i < harvestcraftFish.length; i++){
- final String itemName = prefix+harvestcraftFish[i]+suffix;
- final int lootChance = getLootChance(harvestcraftFish[i]);
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(itemName, 1) != null){
- //addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1), lootChance);
- addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
- addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
- addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
- }
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(greenheartFish, 1) != null){
- //addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1), getLootChance(greenheartFish));
- addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1));
- addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1));
- addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1));
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(seaweed, 1) != null){
- //addFish("junk", ItemUtils.getItemStackOfAmountFromOreDict(seaweed, 1), getLootChance(seaweed));
- }
- }
-
- private static int getLootChance(final String name){
- if (name.equals(harvestcraftFish[0])){
- return 20;
- }
- else if (name.equals(harvestcraftFish[1])){
- return 10;
- }
- else if (name.equals(harvestcraftFish[2])){
- return 15;
- }
- else if (name.equals(harvestcraftFish[3])){
- return 55;
- }
- else if (name.equals(harvestcraftFish[4])){
- return 5;
- }
- else if (name.equals(harvestcraftFish[5])){
- return 8;
- }
- else if (name.equals(harvestcraftFish[6])){
- return 11;
- }
- else if (name.equals(harvestcraftFish[7])){
- return 11;
- }
- else if (name.equals(harvestcraftFish[8])){
- return 15;
- }
- else if (name.equals(harvestcraftFish[9])){
- return 1;
- }
- else if (name.equals(harvestcraftFish[10])){
- return 5;
- }
- else if (name.equals(harvestcraftFish[11])){
- return 10;
- }
- else if (name.equals(harvestcraftFish[12])){
- return 25;
- }
- else if (name.equals(harvestcraftFish[13])){
- return 15;
- }
- else if (name.equals(harvestcraftFish[14])){
- return 20;
- } //"Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye"};
- else if (name.equals(harvestcraftFish[15])){
- return 22;
- }
- else if (name.equals(harvestcraftFish[16])){
- return 10;
- }
- else if (name.equals(harvestcraftFish[17])){
- return 35;
- }
- else if (name.equals(harvestcraftFish[18])){
- return 3;
- }
- else if (name.equals(harvestcraftFish[19])){
- return 20;
- }
- else if (name.equals(harvestcraftFish[20])){
- return 4;
- }
- else if (name.equals(harvestcraftFish[21])){
- return 40;
- }
- else if (name.equals(harvestcraftFish[22])){
- return 30;
- }
- else if (name.equals(harvestcraftFish[23])){
- return 5;
- }
- else if (name.equals(harvestcraftFish[24])){
- return 8;
- }
- else {
- return 25;
- }
- }
-
- private static void addGregtechCentrifugeRecipe(final ItemStack input){
- if (LoadedMods.Gregtech){
- GT_Values.RA.addCentrifugeRecipe(input, null, null, FluidUtils.getFluidStack("methane", 96), null, null, null, null, null, null, null, 19*20, 5);
- }
- }
-
- private static void addGregtechMaceratorRecipe(final ItemStack input){
- if (LoadedMods.Gregtech){
- GT_ModHandler.addPulverisationRecipe(input, ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBone", 1), 0);
- }
- }
-
- private static void addGregtechFluidRecipe(final ItemStack input){
- if (LoadedMods.Gregtech){
- if (CORE.GTNH) {
- CORE.RA.addFluidExtractionRecipe(input, FluidUtils.getFluidStack("fishoil", 50), 16, 4);
- }
- else {
- CORE.RA.addFluidExtractionRecipe(input, FluidUtils.getFluidStack("fishoil", 4), 16, 4); //4eu/t total eu used = 64 so time = 64/4
- }
- }
- }
-
+ private static final String[] fishTypes = {"fish", "junk", "treasure"};
+ private static Object mFishingRegistry;
+ private static Growthcraft_Old mHandler;
+
+ public static Object getFishingRegistry() {
+ if (mFishingRegistry != null) {
+ return mFishingRegistry;
+ } else {
+ return setFishTrapRegistry();
+ }
+ }
+
+ private static final Object setFishTrapRegistry() {
+ Class mFishingRegistryClass;
+ try {
+ mFishingRegistryClass = ReflectionUtils.getClass("growthcraft.api.fishtrap.FishTrapRegistry");
+ final Method mFishingRegistryMethod = mFishingRegistryClass.getDeclaredMethod("getInstance");
+ mFishingRegistry = mFishingRegistryMethod.invoke(null);
+ if (mFishingRegistry != null) {
+ return mFishingRegistry;
+ }
+ } catch (NoSuchMethodException
+ | SecurityException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ }
+ return null;
+ }
+
+ protected static void addFish(final String lootType, final ItemStack lootStack, final int lootChance) {
+
+ if (mFishingRegistry == null) {
+ setFishTrapRegistry();
+ }
+ if (mHandler == null) {
+ mHandler = new Growthcraft_Old();
+ }
+
+ final String GCVersion = LoadedMods.getModVersion("Growthcraft");
+ final String[] versionString = GCVersion.split("//.");
+
+ if (LoadedMods.getModVersion("Growthcraft").contains("2.3.1") || versionString[1].equals("3")) {
+ if (lootType.equals(fishTypes[0])) {
+ mHandler.addTrapFish(lootStack, lootChance);
+ Logger.INFO("Added " + lootStack.getDisplayName() + " as an extra Fish for Growthcraft Fishtraps.");
+ } else if (lootType.equals(fishTypes[1])) {
+ mHandler.addTrapJunk(lootStack, lootChance);
+ Logger.INFO("Added " + lootStack.getDisplayName() + " as extra Junk for Growthcraft Fishtraps.");
+ } else if (lootType.equals(fishTypes[2])) {
+ mHandler.addTrapTreasure(lootStack, lootChance);
+ Logger.INFO("Added " + lootStack.getDisplayName() + " as extra Treasure for Growthcraft Fishtraps.");
+ } else {
+ return;
+ }
+ } /*
+ else if (LoadedMods.getModVersion("Growthcraft").contains("2.7.2")){
+ if (lootType.equals(fishTypes[0])){
+ Growthcraft_New.addTrapFish(lootStack, lootChance);
+ Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as an extra Fish for Growthcraft Fishtraps.");
+ }
+ else if (lootType.equals(fishTypes[1])){
+ Growthcraft_New.addTrapJunk(lootStack, lootChance);
+ Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Junk for Growthcraft Fishtraps.");
+ }
+ else if (lootType.equals(fishTypes[2])){
+ Growthcraft_New.addTrapTreasure(lootStack, lootChance);
+ Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Treasure for Growthcraft Fishtraps.");
+ }
+ else {
+ return;
+ }
+ }*/ else {
+ Logger.INFO("Extra Fish loot for Growthcraft Fishtraps disabled. Found V."
+ + LoadedMods.getModVersion("Growthcraft"));
+ }
+ }
+ // FishTrapHandler.pamsHarvestCraftCompat();
+ static final String prefix = "food";
+ static final String suffix = "raw";
+ static final String seaweed = "cropSeaweed";
+ static final String greenheartFish = "foodGreenheartfish";
+ private static final String[] harvestcraftFish = {
+ "Anchovy", "Bass", "Calamari", "Carp", "Catfish", "Charr", "Clam", "Crab", "Crayfish", "Eel", "Frog", "Grouper",
+ "Herring",
+ "Jellyfish", "Mudfish", "Octopus", "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna",
+ "Turtle", "Walley"
+ };
+
+ public static void pamsHarvestCraftCompat() {
+ for (int i = 0; i < harvestcraftFish.length; i++) {
+ final String itemName = prefix + harvestcraftFish[i] + suffix;
+ final int lootChance = getLootChance(harvestcraftFish[i]);
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(itemName, 1) != null) {
+ // addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1), lootChance);
+ addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
+ addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
+ addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
+ }
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(greenheartFish, 1) != null) {
+ // addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1),
+ // getLootChance(greenheartFish));
+ addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1));
+ addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1));
+ addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1));
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(seaweed, 1) != null) {
+ // addFish("junk", ItemUtils.getItemStackOfAmountFromOreDict(seaweed, 1), getLootChance(seaweed));
+ }
+ }
+
+ private static int getLootChance(final String name) {
+ if (name.equals(harvestcraftFish[0])) {
+ return 20;
+ } else if (name.equals(harvestcraftFish[1])) {
+ return 10;
+ } else if (name.equals(harvestcraftFish[2])) {
+ return 15;
+ } else if (name.equals(harvestcraftFish[3])) {
+ return 55;
+ } else if (name.equals(harvestcraftFish[4])) {
+ return 5;
+ } else if (name.equals(harvestcraftFish[5])) {
+ return 8;
+ } else if (name.equals(harvestcraftFish[6])) {
+ return 11;
+ } else if (name.equals(harvestcraftFish[7])) {
+ return 11;
+ } else if (name.equals(harvestcraftFish[8])) {
+ return 15;
+ } else if (name.equals(harvestcraftFish[9])) {
+ return 1;
+ } else if (name.equals(harvestcraftFish[10])) {
+ return 5;
+ } else if (name.equals(harvestcraftFish[11])) {
+ return 10;
+ } else if (name.equals(harvestcraftFish[12])) {
+ return 25;
+ } else if (name.equals(harvestcraftFish[13])) {
+ return 15;
+ } else if (name.equals(harvestcraftFish[14])) {
+ return 20;
+ } // "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye"};
+ else if (name.equals(harvestcraftFish[15])) {
+ return 22;
+ } else if (name.equals(harvestcraftFish[16])) {
+ return 10;
+ } else if (name.equals(harvestcraftFish[17])) {
+ return 35;
+ } else if (name.equals(harvestcraftFish[18])) {
+ return 3;
+ } else if (name.equals(harvestcraftFish[19])) {
+ return 20;
+ } else if (name.equals(harvestcraftFish[20])) {
+ return 4;
+ } else if (name.equals(harvestcraftFish[21])) {
+ return 40;
+ } else if (name.equals(harvestcraftFish[22])) {
+ return 30;
+ } else if (name.equals(harvestcraftFish[23])) {
+ return 5;
+ } else if (name.equals(harvestcraftFish[24])) {
+ return 8;
+ } else {
+ return 25;
+ }
+ }
+
+ private static void addGregtechCentrifugeRecipe(final ItemStack input) {
+ if (LoadedMods.Gregtech) {
+ GT_Values.RA.addCentrifugeRecipe(
+ input,
+ null,
+ null,
+ FluidUtils.getFluidStack("methane", 96),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ 19 * 20,
+ 5);
+ }
+ }
+
+ private static void addGregtechMaceratorRecipe(final ItemStack input) {
+ if (LoadedMods.Gregtech) {
+ GT_ModHandler.addPulverisationRecipe(
+ input,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBone", 1),
+ 0);
+ }
+ }
+
+ private static void addGregtechFluidRecipe(final ItemStack input) {
+ if (LoadedMods.Gregtech) {
+ if (CORE.GTNH) {
+ CORE.RA.addFluidExtractionRecipe(input, FluidUtils.getFluidStack("fishoil", 50), 16, 4);
+ } else {
+ CORE.RA.addFluidExtractionRecipe(
+ input,
+ FluidUtils.getFluidStack("fishoil", 4),
+ 16,
+ 4); // 4eu/t total eu used = 64 so time = 64/4
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_New.java b/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_New.java
index 41fec179b5..dd8e6debc7 100644
--- a/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_New.java
+++ b/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_New.java
@@ -3,84 +3,87 @@ package gtPlusPlus.xmod.growthcraft.fishtrap;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-
import net.minecraft.item.ItemStack;
public class Growthcraft_New {
- Method addTrapJunk;
- Method addTrapTreasure;
- Method addTrapFish;
- Object FishTrapRegistryO;
-
- public Growthcraft_New(){
- setFishTrapRegistry();
- }
-
- void setFishTrapRegistry(){
- try {
- Class<?> FishTrapRegistryClass = Class.forName("gtPlusPlus.xmod.growthcraft.fishtrap.FishTrapHandler.mFishingRegistry");
- Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
- if (FishTrapRegistryClass.isInstance(FishTrapHandler.getFishingRegistry())){
- addTrapJunk = FishTrapRegistryClass.getDeclaredMethod("addTrapJunk", FishTrapEntry);
- addTrapTreasure = FishTrapRegistryClass.getDeclaredMethod("addTrapTreasure", FishTrapEntry);
- addTrapFish = FishTrapRegistryClass.getDeclaredMethod("addTrapFish", FishTrapEntry);
- FishTrapRegistryO = FishTrapHandler.getFishingRegistry();
- }
- }
- catch (ClassNotFoundException | NoSuchMethodException | SecurityException e) {
- e.printStackTrace();
- }
- }
-
- private Object createFishTrapEntry(ItemStack loot, int chance){
- try {
- Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
- Object o = FishTrapEntry.getConstructor(ItemStack.class, int.class);
- if (FishTrapEntry != null){
- Constructor[] constructors = FishTrapEntry.getDeclaredConstructors();
- constructors[0].setAccessible(true);
- Object x = constructors[0].newInstance(loot, chance);
- if (x != null){
- return x;
- }
- }
- }
- catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
-
- return null;
- }
-
- private boolean invoke(Method m, ItemStack o, int p){
- try {
- Object I = createFishTrapEntry(o, p);
- m.invoke(FishTrapRegistryO, I);
- return true;
- }
- catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
- return false;
- }
+ Method addTrapJunk;
+ Method addTrapTreasure;
+ Method addTrapFish;
+ Object FishTrapRegistryO;
+
+ public Growthcraft_New() {
+ setFishTrapRegistry();
+ }
+
+ void setFishTrapRegistry() {
+ try {
+ Class<?> FishTrapRegistryClass =
+ Class.forName("gtPlusPlus.xmod.growthcraft.fishtrap.FishTrapHandler.mFishingRegistry");
+ Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
+ if (FishTrapRegistryClass.isInstance(FishTrapHandler.getFishingRegistry())) {
+ addTrapJunk = FishTrapRegistryClass.getDeclaredMethod("addTrapJunk", FishTrapEntry);
+ addTrapTreasure = FishTrapRegistryClass.getDeclaredMethod("addTrapTreasure", FishTrapEntry);
+ addTrapFish = FishTrapRegistryClass.getDeclaredMethod("addTrapFish", FishTrapEntry);
+ FishTrapRegistryO = FishTrapHandler.getFishingRegistry();
+ }
+ } catch (ClassNotFoundException | NoSuchMethodException | SecurityException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private Object createFishTrapEntry(ItemStack loot, int chance) {
+ try {
+ Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
+ Object o = FishTrapEntry.getConstructor(ItemStack.class, int.class);
+ if (FishTrapEntry != null) {
+ Constructor[] constructors = FishTrapEntry.getDeclaredConstructors();
+ constructors[0].setAccessible(true);
+ Object x = constructors[0].newInstance(loot, chance);
+ if (x != null) {
+ return x;
+ }
+ }
+ } catch (ClassNotFoundException
+ | NoSuchMethodException
+ | SecurityException
+ | InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ }
- public void addTrapJunk(final ItemStack loot, final int lootChance){
- //FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance));
- if (addTrapJunk != null){
- invoke(addTrapJunk, loot, lootChance);
- }
+ return null;
+ }
- }
+ private boolean invoke(Method m, ItemStack o, int p) {
+ try {
+ Object I = createFishTrapEntry(o, p);
+ m.invoke(FishTrapRegistryO, I);
+ return true;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ return false;
+ }
- public void addTrapTreasure(final ItemStack loot, final int lootChance){
- //FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance));
- if (addTrapTreasure != null){
- invoke(addTrapTreasure, loot, lootChance);
- }
- }
+ public void addTrapJunk(final ItemStack loot, final int lootChance) {
+ // FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance));
+ if (addTrapJunk != null) {
+ invoke(addTrapJunk, loot, lootChance);
+ }
+ }
- public void addTrapFish(final ItemStack loot, final int lootChance){
- //FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance));
- if (addTrapFish != null){
- invoke(addTrapFish, loot, lootChance);
- }
- }
+ public void addTrapTreasure(final ItemStack loot, final int lootChance) {
+ // FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance));
+ if (addTrapTreasure != null) {
+ invoke(addTrapTreasure, loot, lootChance);
+ }
+ }
+ public void addTrapFish(final ItemStack loot, final int lootChance) {
+ // FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance));
+ if (addTrapFish != null) {
+ invoke(addTrapFish, loot, lootChance);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java b/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
index ab11c062e0..76a025667b 100644
--- a/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
+++ b/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
@@ -3,84 +3,87 @@ package gtPlusPlus.xmod.growthcraft.fishtrap;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-
import net.minecraft.item.ItemStack;
public class Growthcraft_Old {
- Method addTrapJunk;
- Method addTrapTreasure;
- Method addTrapFish;
- Object FishTrapRegistryO;
-
- public Growthcraft_Old(){
- setFishTrapRegistry();
- }
-
- void setFishTrapRegistry(){
- try {
- Class<?> FishTrapRegistryClass = Class.forName("gtPlusPlus.xmod.growthcraft.fishtrap.FishTrapHandler.mFishingRegistry");
- Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
- if (FishTrapRegistryClass.isInstance(FishTrapHandler.getFishingRegistry())){
- addTrapJunk = FishTrapRegistryClass.getDeclaredMethod("addTrapJunk", FishTrapEntry);
- addTrapTreasure = FishTrapRegistryClass.getDeclaredMethod("addTrapTreasure", FishTrapEntry);
- addTrapFish = FishTrapRegistryClass.getDeclaredMethod("addTrapFish", FishTrapEntry);
- FishTrapRegistryO = FishTrapHandler.getFishingRegistry();
- }
- }
- catch (ClassNotFoundException | NoSuchMethodException | SecurityException e) {
- e.printStackTrace();
- }
- }
-
- private Object createFishTrapEntry(ItemStack loot, int chance){
- try {
- Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
- Object o = FishTrapEntry.getConstructor(ItemStack.class, int.class);
- if (FishTrapEntry != null){
- Constructor[] constructors = FishTrapEntry.getDeclaredConstructors();
- constructors[0].setAccessible(true);
- Object x = constructors[0].newInstance(loot, chance);
- if (x != null){
- return x;
- }
- }
- }
- catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
-
- return null;
- }
-
- private boolean invoke(Method m, ItemStack o, int p){
- try {
- Object I = createFishTrapEntry(o, p);
- m.invoke(FishTrapRegistryO, I);
- return true;
- }
- catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
- return false;
- }
+ Method addTrapJunk;
+ Method addTrapTreasure;
+ Method addTrapFish;
+ Object FishTrapRegistryO;
+
+ public Growthcraft_Old() {
+ setFishTrapRegistry();
+ }
+
+ void setFishTrapRegistry() {
+ try {
+ Class<?> FishTrapRegistryClass =
+ Class.forName("gtPlusPlus.xmod.growthcraft.fishtrap.FishTrapHandler.mFishingRegistry");
+ Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
+ if (FishTrapRegistryClass.isInstance(FishTrapHandler.getFishingRegistry())) {
+ addTrapJunk = FishTrapRegistryClass.getDeclaredMethod("addTrapJunk", FishTrapEntry);
+ addTrapTreasure = FishTrapRegistryClass.getDeclaredMethod("addTrapTreasure", FishTrapEntry);
+ addTrapFish = FishTrapRegistryClass.getDeclaredMethod("addTrapFish", FishTrapEntry);
+ FishTrapRegistryO = FishTrapHandler.getFishingRegistry();
+ }
+ } catch (ClassNotFoundException | NoSuchMethodException | SecurityException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private Object createFishTrapEntry(ItemStack loot, int chance) {
+ try {
+ Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
+ Object o = FishTrapEntry.getConstructor(ItemStack.class, int.class);
+ if (FishTrapEntry != null) {
+ Constructor[] constructors = FishTrapEntry.getDeclaredConstructors();
+ constructors[0].setAccessible(true);
+ Object x = constructors[0].newInstance(loot, chance);
+ if (x != null) {
+ return x;
+ }
+ }
+ } catch (ClassNotFoundException
+ | NoSuchMethodException
+ | SecurityException
+ | InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ }
- public void addTrapJunk(final ItemStack loot, final int lootChance){
- //FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance));
- if (addTrapJunk != null){
- invoke(addTrapJunk, loot, lootChance);
- }
+ return null;
+ }
- }
+ private boolean invoke(Method m, ItemStack o, int p) {
+ try {
+ Object I = createFishTrapEntry(o, p);
+ m.invoke(FishTrapRegistryO, I);
+ return true;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ return false;
+ }
- public void addTrapTreasure(final ItemStack loot, final int lootChance){
- //FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance));
- if (addTrapTreasure != null){
- invoke(addTrapTreasure, loot, lootChance);
- }
- }
+ public void addTrapJunk(final ItemStack loot, final int lootChance) {
+ // FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance));
+ if (addTrapJunk != null) {
+ invoke(addTrapJunk, loot, lootChance);
+ }
+ }
- public void addTrapFish(final ItemStack loot, final int lootChance){
- //FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance));
- if (addTrapFish != null){
- invoke(addTrapFish, loot, lootChance);
- }
- }
+ public void addTrapTreasure(final ItemStack loot, final int lootChance) {
+ // FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance));
+ if (addTrapTreasure != null) {
+ invoke(addTrapTreasure, loot, lootChance);
+ }
+ }
+ public void addTrapFish(final ItemStack loot, final int lootChance) {
+ // FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance));
+ if (addTrapFish != null) {
+ invoke(addTrapFish, loot, lootChance);
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/CustomInternalName.java b/src/main/java/gtPlusPlus/xmod/ic2/CustomInternalName.java
index a349d7f86e..6ac8a86504 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/CustomInternalName.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/CustomInternalName.java
@@ -5,18 +5,18 @@ import net.minecraftforge.common.util.EnumHelper;
public class CustomInternalName {
- public static InternalName aHazmatHelmetEx;
- public static InternalName aHazmatChestEx;
- public static InternalName aHazmatLegsEx;
- public static InternalName aHazmatBootsEx;
-
- public static void init() {
- aHazmatHelmetEx = EnumHelper.addEnum(InternalName.class, "itemArmorHazmatHelmetEx", new Class[] {}, new Object[] {});
- aHazmatChestEx = EnumHelper.addEnum(InternalName.class, "itemArmorHazmatChestplateEx", new Class[] {}, new Object[] {});
- aHazmatLegsEx = EnumHelper.addEnum(InternalName.class, "itemArmorHazmatLeggingsEx", new Class[] {}, new Object[] {});
- aHazmatBootsEx = EnumHelper.addEnum(InternalName.class, "itemArmorRubBootsEx", new Class[] {}, new Object[] {});
- }
+ public static InternalName aHazmatHelmetEx;
+ public static InternalName aHazmatChestEx;
+ public static InternalName aHazmatLegsEx;
+ public static InternalName aHazmatBootsEx;
-
-
+ public static void init() {
+ aHazmatHelmetEx =
+ EnumHelper.addEnum(InternalName.class, "itemArmorHazmatHelmetEx", new Class[] {}, new Object[] {});
+ aHazmatChestEx =
+ EnumHelper.addEnum(InternalName.class, "itemArmorHazmatChestplateEx", new Class[] {}, new Object[] {});
+ aHazmatLegsEx =
+ EnumHelper.addEnum(InternalName.class, "itemArmorHazmatLeggingsEx", new Class[] {}, new Object[] {});
+ aHazmatBootsEx = EnumHelper.addEnum(InternalName.class, "itemArmorRubBootsEx", new Class[] {}, new Object[] {});
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java b/src/main/java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java
index bb97132ab4..66b9d9aabe 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java
@@ -4,25 +4,22 @@ import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.xmod.ic2.item.IC2_Items;
import gtPlusPlus.xmod.ic2.recipe.RECIPE_IC2;
-public class HANDLER_IC2{
+public class HANDLER_IC2 {
- public static void preInit() {
- if (LoadedMods.IndustrialCraft2){
- IC2_Items.register();
- //new BlockRTG(InternalName.beer);
- }
- }
+ public static void preInit() {
+ if (LoadedMods.IndustrialCraft2) {
+ IC2_Items.register();
+ // new BlockRTG(InternalName.beer);
+ }
+ }
- public static void init() {
- if (LoadedMods.IndustrialCraft2){
-
- }
- }
-
- public static void postInit() {
- if (LoadedMods.IndustrialCraft2){
- RECIPE_IC2.initRecipes();
- }
- }
+ public static void init() {
+ if (LoadedMods.IndustrialCraft2) {}
+ }
+ public static void postInit() {
+ if (LoadedMods.IndustrialCraft2) {
+ RECIPE_IC2.initRecipes();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java b/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java
index 2a1b5ab44d..03a2606f71 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java
@@ -1,23 +1,8 @@
package gtPlusPlus.xmod.ic2.block.RTGGenerator;
-import java.util.List;
-import java.util.Random;
-
-import org.apache.commons.lang3.mutable.MutableObject;
-
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.block.material.Material;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.EnumRarity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.xmod.ic2.block.kieticgenerator.tileentity.TileEntityKineticWindGenerator;
import gtPlusPlus.xmod.ic2.item.IC2_Items;
@@ -28,181 +13,186 @@ import ic2.core.block.BlockMultiID;
import ic2.core.block.TileEntityBlock;
import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric;
import ic2.core.init.InternalName;
+import java.util.List;
+import java.util.Random;
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import org.apache.commons.lang3.mutable.MutableObject;
-public class BlockRTG
-extends BlockMultiID
-{
- public BlockRTG(final InternalName internalName1)
- {
- super(internalName1, Material.iron, ItemGenerators.class);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setHardness(3.0F);
- this.setStepSound(soundTypeMetal);
-
- IC2_Items.blockRTG = new ItemStack(this, 1, 0);
- IC2_Items.blockKineticGenerator = new ItemStack(this, 1, 1);
-
- GameRegistry.registerTileEntity(TileEntityRTG.class, "RTG Mach II");
- GameRegistry.registerTileEntity(TileEntityKineticWindGenerator.class, "Wind Ripper Mach II");
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void getSubBlocks(final Item j, final CreativeTabs tabs, final List itemList) {
- final Item item = Item.getItemFromBlock(this);
- if (!item.getHasSubtypes()) {
- itemList.add(new ItemStack(this));
- } else {
- for (int i = 0; i < 16; i++)
- {
- final ItemStack is = new ItemStack(this, 1, i);
- if (is.getItem().getUnlocalizedName(is) == null) {
- break;
- }
- itemList.add(is);
- }
- }
- }
-
-
- @Override
- public String getTextureFolder(final int id)
- {
- return "generator";
- }
-
- @Override
- public int damageDropped(final int meta)
- {
- switch (meta)
- {
- case 2:
- return 2;
- }
- return 0;
- }
-
- @Override
- public Class<? extends TileEntity> getTeClass(final int meta, final MutableObject<Class<?>[]> ctorArgTypes, final MutableObject<Object[]> ctorArgs)
- {
- try
- {
- switch (meta)
- {
- case 0:
- return TileEntityRTG.class;
- case 1:
- return TileEntityKineticWindGenerator.class;
- }
- }
- catch (final Exception e)
- {
- throw new RuntimeException(e);
- }
- return null;
- }
-
- /*
- *
- * {
- case 0:
- return TileEntityGenerator.class;
- case 1:
- return TileEntityGeoGenerator.class;
- case 2:
- return TileEntityWaterGenerator.class;
- case 3:
- return TileEntitySolarGenerator.class;
- case 4:
- return TileEntityWindGenerator.class;
- case 5:
- return TileEntityNuclearReactorElectric.class;
- case 6:
- return TileEntityRTGenerator.class;
- case 7:
- return TileEntitySemifluidGenerator.class;
- case 8:
- return TileEntityStirlingGenerator.class;
- case 9:
- return TileEntityKineticGenerator.class;
- }
- *
- * (non-Javadoc)
- * @see net.minecraft.block.Block#randomDisplayTick(net.minecraft.world.World, int, int, int, java.util.Random)
- */
-
- @Override
- public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random random)
- {
- if (!IC2.platform.isRendering()) {
- return;
- }
- final int meta = world.getBlockMetadata(x, y, z);
- if ((meta == 0) && (this.isActive(world, x, y, z)))
- {
- final TileEntityBlock te = (TileEntityBlock)this.getOwnTe(world, x, y, z);
- if (te == null) {
- return;
- }
- final int l = te.getFacing();
- final float f = x + 0.5F;
- final float f1 = y + 0.0F + ((random.nextFloat() * 6.0F) / 16.0F);
- final float f2 = z + 0.5F;
- final float f3 = 0.52F;
- final float f4 = (random.nextFloat() * 0.6F) - 0.3F;
- switch (l)
- {
- case 4:
- world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
- break;
- case 5:
- world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
- break;
- case 2:
- world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
- break;
- case 3:
- world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
- }
- }
- else if (meta == 5)
- {
- final TileEntityNuclearReactorElectric te = (TileEntityNuclearReactorElectric)this.getOwnTe(world, x, y, z);
- if (te == null) {
- return;
- }
- int puffs = te.heat / 1000;
- if (puffs <= 0) {
- return;
- }
- puffs = world.rand.nextInt(puffs);
- for (int n = 0; n < puffs; n++) {
- world.spawnParticle("smoke", x + random.nextFloat(), y + 0.95F, z + random.nextFloat(), 0.0D, 0.0D, 0.0D);
- }
- puffs -= world.rand.nextInt(4) + 3;
- for (int n = 0; n < puffs; n++) {
- world.spawnParticle("flame", x + random.nextFloat(), y + 1.0F, z + random.nextFloat(), 0.0D, 0.0D, 0.0D);
- }
- }
- }
-
- @Override
- public boolean onBlockActivated(final World world, final int i, final int j, final int k, final EntityPlayer entityplayer, final int side, final float a, final float b, final float c)
- {
- if ((entityplayer.getCurrentEquippedItem() != null) && (entityplayer.getCurrentEquippedItem().isItemEqual(Ic2Items.reactorChamber))) {
- return false;
- }
- return super.onBlockActivated(world, i, j, k, entityplayer, side, a, b, c);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack stack)
- {
- return stack.getItemDamage() == 5 ? EnumRarity.uncommon : EnumRarity.common;
- }
+public class BlockRTG extends BlockMultiID {
+ public BlockRTG(final InternalName internalName1) {
+ super(internalName1, Material.iron, ItemGenerators.class);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setHardness(3.0F);
+ this.setStepSound(soundTypeMetal);
+
+ IC2_Items.blockRTG = new ItemStack(this, 1, 0);
+ IC2_Items.blockKineticGenerator = new ItemStack(this, 1, 1);
+
+ GameRegistry.registerTileEntity(TileEntityRTG.class, "RTG Mach II");
+ GameRegistry.registerTileEntity(TileEntityKineticWindGenerator.class, "Wind Ripper Mach II");
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public void getSubBlocks(final Item j, final CreativeTabs tabs, final List itemList) {
+ final Item item = Item.getItemFromBlock(this);
+ if (!item.getHasSubtypes()) {
+ itemList.add(new ItemStack(this));
+ } else {
+ for (int i = 0; i < 16; i++) {
+ final ItemStack is = new ItemStack(this, 1, i);
+ if (is.getItem().getUnlocalizedName(is) == null) {
+ break;
+ }
+ itemList.add(is);
+ }
+ }
+ }
+
+ @Override
+ public String getTextureFolder(final int id) {
+ return "generator";
+ }
+
+ @Override
+ public int damageDropped(final int meta) {
+ switch (meta) {
+ case 2:
+ return 2;
+ }
+ return 0;
+ }
+
+ @Override
+ public Class<? extends TileEntity> getTeClass(
+ final int meta, final MutableObject<Class<?>[]> ctorArgTypes, final MutableObject<Object[]> ctorArgs) {
+ try {
+ switch (meta) {
+ case 0:
+ return TileEntityRTG.class;
+ case 1:
+ return TileEntityKineticWindGenerator.class;
+ }
+ } catch (final Exception e) {
+ throw new RuntimeException(e);
+ }
+ return null;
+ }
+
+ /*
+ *
+ * {
+ case 0:
+ return TileEntityGenerator.class;
+ case 1:
+ return TileEntityGeoGenerator.class;
+ case 2:
+ return TileEntityWaterGenerator.class;
+ case 3:
+ return TileEntitySolarGenerator.class;
+ case 4:
+ return TileEntityWindGenerator.class;
+ case 5:
+ return TileEntityNuclearReactorElectric.class;
+ case 6:
+ return TileEntityRTGenerator.class;
+ case 7:
+ return TileEntitySemifluidGenerator.class;
+ case 8:
+ return TileEntityStirlingGenerator.class;
+ case 9:
+ return TileEntityKineticGenerator.class;
+ }
+ *
+ * (non-Javadoc)
+ * @see net.minecraft.block.Block#randomDisplayTick(net.minecraft.world.World, int, int, int, java.util.Random)
+ */
+
+ @Override
+ public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random random) {
+ if (!IC2.platform.isRendering()) {
+ return;
+ }
+ final int meta = world.getBlockMetadata(x, y, z);
+ if ((meta == 0) && (this.isActive(world, x, y, z))) {
+ final TileEntityBlock te = (TileEntityBlock) this.getOwnTe(world, x, y, z);
+ if (te == null) {
+ return;
+ }
+ final int l = te.getFacing();
+ final float f = x + 0.5F;
+ final float f1 = y + 0.0F + ((random.nextFloat() * 6.0F) / 16.0F);
+ final float f2 = z + 0.5F;
+ final float f3 = 0.52F;
+ final float f4 = (random.nextFloat() * 0.6F) - 0.3F;
+ switch (l) {
+ case 4:
+ world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
+ break;
+ case 5:
+ world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
+ break;
+ case 2:
+ world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
+ break;
+ case 3:
+ world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
+ }
+ } else if (meta == 5) {
+ final TileEntityNuclearReactorElectric te =
+ (TileEntityNuclearReactorElectric) this.getOwnTe(world, x, y, z);
+ if (te == null) {
+ return;
+ }
+ int puffs = te.heat / 1000;
+ if (puffs <= 0) {
+ return;
+ }
+ puffs = world.rand.nextInt(puffs);
+ for (int n = 0; n < puffs; n++) {
+ world.spawnParticle(
+ "smoke", x + random.nextFloat(), y + 0.95F, z + random.nextFloat(), 0.0D, 0.0D, 0.0D);
+ }
+ puffs -= world.rand.nextInt(4) + 3;
+ for (int n = 0; n < puffs; n++) {
+ world.spawnParticle(
+ "flame", x + random.nextFloat(), y + 1.0F, z + random.nextFloat(), 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int i,
+ final int j,
+ final int k,
+ final EntityPlayer entityplayer,
+ final int side,
+ final float a,
+ final float b,
+ final float c) {
+ if ((entityplayer.getCurrentEquippedItem() != null)
+ && (entityplayer.getCurrentEquippedItem().isItemEqual(Ic2Items.reactorChamber))) {
+ return false;
+ }
+ return super.onBlockActivated(world, i, j, k, entityplayer, side, a, b, c);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack stack) {
+ return stack.getItemDamage() == 5 ? EnumRarity.uncommon : EnumRarity.common;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java b/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java
index aa50243914..19602273c3 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java
@@ -2,11 +2,6 @@ package gtPlusPlus.xmod.ic2.block.RTGGenerator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-
import gtPlusPlus.xmod.ic2.block.RTGGenerator.gui.CONTAINER_RTG;
import gtPlusPlus.xmod.ic2.block.RTGGenerator.gui.GUI_RTG;
import ic2.core.ContainerBase;
@@ -14,75 +9,65 @@ import ic2.core.Ic2Items;
import ic2.core.block.generator.tileentity.TileEntityRTGenerator;
import ic2.core.block.invslot.InvSlotConsumable;
import ic2.core.block.invslot.InvSlotConsumableId;
+import net.minecraft.client.gui.GuiScreen;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
-public class TileEntityRTG
-extends TileEntityRTGenerator
-{
- public final InvSlotConsumable fuelSlot;
-
- public TileEntityRTG()
- {
- this.fuelSlot = new InvSlotConsumableId(this, "fuelSlot", 0, 12, new Item[] { Ic2Items.RTGPellets.getItem() });
- }
-
- @Override
- public int gaugeFuelScaled(final int i)
- {
- return i;
- }
+public class TileEntityRTG extends TileEntityRTGenerator {
+ public final InvSlotConsumable fuelSlot;
- @Override
- public boolean gainEnergy()
- {
- int counter = 0;
- for (int i = 0; i < this.fuelSlot.size(); i++) {
- if (this.fuelSlot.get(i) != null) {
- counter++;
- }
- }
- if (counter == 0) {
- return false;
- }
- this.storage += (int)Math.pow(2.0D, counter - 1);
- return true;
- }
+ public TileEntityRTG() {
+ this.fuelSlot = new InvSlotConsumableId(this, "fuelSlot", 0, 12, new Item[] {Ic2Items.RTGPellets.getItem()});
+ }
- @Override
- public boolean gainFuel()
- {
- return false;
- }
+ @Override
+ public int gaugeFuelScaled(final int i) {
+ return i;
+ }
- @Override
- public boolean needsFuel()
- {
- return true;
- }
+ @Override
+ public boolean gainEnergy() {
+ int counter = 0;
+ for (int i = 0; i < this.fuelSlot.size(); i++) {
+ if (this.fuelSlot.get(i) != null) {
+ counter++;
+ }
+ }
+ if (counter == 0) {
+ return false;
+ }
+ this.storage += (int) Math.pow(2.0D, counter - 1);
+ return true;
+ }
- @Override
- public String getInventoryName()
- {
- return "RTG";
- }
+ @Override
+ public boolean gainFuel() {
+ return false;
+ }
- @Override
- public ContainerBase<TileEntityRTGenerator> getGuiContainer(final EntityPlayer entityPlayer)
- {
- return new CONTAINER_RTG(entityPlayer, this);
- }
+ @Override
+ public boolean needsFuel() {
+ return true;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public GuiScreen getGui(final EntityPlayer entityPlayer, final boolean isAdmin)
- {
- return new GUI_RTG(new CONTAINER_RTG(entityPlayer, this));
- }
+ @Override
+ public String getInventoryName() {
+ return "RTG";
+ }
- @Override
- public boolean delayActiveUpdate()
- {
- return true;
- }
+ @Override
+ public ContainerBase<TileEntityRTGenerator> getGuiContainer(final EntityPlayer entityPlayer) {
+ return new CONTAINER_RTG(entityPlayer, this);
+ }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public GuiScreen getGui(final EntityPlayer entityPlayer, final boolean isAdmin) {
+ return new GUI_RTG(new CONTAINER_RTG(entityPlayer, this));
+ }
+ @Override
+ public boolean delayActiveUpdate() {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java b/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java
index 0afe47c983..9ac5476ed9 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java
@@ -1,37 +1,31 @@
package gtPlusPlus.xmod.ic2.block.RTGGenerator.gui;
-import java.util.List;
-
-import net.minecraft.entity.player.EntityPlayer;
-
import gtPlusPlus.xmod.ic2.block.RTGGenerator.TileEntityRTG;
import ic2.core.block.generator.container.ContainerRTGenerator;
import ic2.core.slot.SlotInvSlot;
+import java.util.List;
+import net.minecraft.entity.player.EntityPlayer;
-public class CONTAINER_RTG
-extends ContainerRTGenerator
-{
- public CONTAINER_RTG(final EntityPlayer entityPlayer, final TileEntityRTG tileEntity1)
- {
- super(entityPlayer, tileEntity1);
- for (int i = 0; i < 4; i++) {
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i * 18), 18));
- }
- for (int i = 4; i < 8; i++) {
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + ((i - 4) * 18), 36));
- }
- for (int i = 8; i < 12; i++) {
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + ((i - 8) * 18), 54));
- }
- }
+public class CONTAINER_RTG extends ContainerRTGenerator {
+ public CONTAINER_RTG(final EntityPlayer entityPlayer, final TileEntityRTG tileEntity1) {
+ super(entityPlayer, tileEntity1);
+ for (int i = 0; i < 4; i++) {
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i * 18), 18));
+ }
+ for (int i = 4; i < 8; i++) {
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + ((i - 4) * 18), 36));
+ }
+ for (int i = 8; i < 12; i++) {
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + ((i - 8) * 18), 54));
+ }
+ }
- @Override
- public List<String> getNetworkedFields()
- {
- final List<String> ret = super.getNetworkedFields();
+ @Override
+ public List<String> getNetworkedFields() {
+ final List<String> ret = super.getNetworkedFields();
- ret.add("storage");
+ ret.add("storage");
- return ret;
- }
+ return ret;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java b/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
index c6e09a78d1..913d456553 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
@@ -1,52 +1,55 @@
package gtPlusPlus.xmod.ic2.block.RTGGenerator.gui;
-import org.lwjgl.opengl.GL11;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.StatCollector;
-
import gtPlusPlus.xmod.ic2.block.RTGGenerator.TileEntityRTG;
import ic2.core.IC2;
import ic2.core.block.generator.gui.GuiRTGenerator;
import ic2.core.util.GuiTooltipHelper;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
-public class GUI_RTG
-extends GuiRTGenerator
-{
- public CONTAINER_RTG container;
-
- public GUI_RTG(final CONTAINER_RTG container1)
- {
- super(container1);
-
- this.container = container1;
- this.name = "RTG Mach II";
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2)
- {
- this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 4, 4210752);
-
- GuiTooltipHelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop, StatCollector.translateToLocalFormatted("ic2.generic.text.bufferEU", new Object[] { Double.valueOf(((TileEntityRTG)this.container.base).storage) }), 117, 38, 150, 48);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int x, final int y)
- {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(background);
- final int j = (this.width - this.xSize) / 2;
- final int k = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
-
- final int i1 = ((TileEntityRTG)this.container.base).gaugeStorageScaled(31);
- this.drawTexturedModalRect(j + 119, k + 40, 179, 3, i1, 8);
- }
-
- private static final ResourceLocation background = new ResourceLocation(IC2.textureDomain, "textures/gui/GUIRTGenerator.png");
+public class GUI_RTG extends GuiRTGenerator {
+ public CONTAINER_RTG container;
+
+ public GUI_RTG(final CONTAINER_RTG container1) {
+ super(container1);
+
+ this.container = container1;
+ this.name = "RTG Mach II";
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(
+ this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 4, 4210752);
+
+ GuiTooltipHelper.drawAreaTooltip(
+ par1 - this.guiLeft,
+ par2 - this.guiTop,
+ StatCollector.translateToLocalFormatted(
+ "ic2.generic.text.bufferEU",
+ new Object[] {Double.valueOf(((TileEntityRTG) this.container.base).storage)}),
+ 117,
+ 38,
+ 150,
+ 48);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int x, final int y) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(background);
+ final int j = (this.width - this.xSize) / 2;
+ final int k = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
+
+ final int i1 = ((TileEntityRTG) this.container.base).gaugeStorageScaled(31);
+ this.drawTexturedModalRect(j + 119, k + 40, 179, 3, i1, 8);
+ }
+
+ private static final ResourceLocation background =
+ new ResourceLocation(IC2.textureDomain, "textures/gui/GUIRTGenerator.png");
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java
index 95e785d1a1..4f9a2ccab1 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java
@@ -1,77 +1,72 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator;
-import org.apache.commons.lang3.mutable.MutableObject;
-
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import ic2.core.block.BlockMultiID;
import ic2.core.block.kineticgenerator.tileentity.TileEntityManualKineticGenerator;
import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator;
import ic2.core.init.InternalName;
import ic2.core.item.block.ItemKineticGenerator;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import org.apache.commons.lang3.mutable.MutableObject;
-public class IC2_BlockKineticGenerator
-extends BlockMultiID
-{
- public IC2_BlockKineticGenerator(final InternalName internalName1)
- {
- super(internalName1, Material.iron, ItemKineticGenerator.class);
-
- this.setHardness(3.0F);
- this.setStepSound(Block.soundTypeMetal);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
+public class IC2_BlockKineticGenerator extends BlockMultiID {
+ public IC2_BlockKineticGenerator(final InternalName internalName1) {
+ super(internalName1, Material.iron, ItemKineticGenerator.class);
- GameRegistry.registerTileEntity(TileEntityWindKineticGenerator.class, "Advanced Kinetic Wind Generator");
+ this.setHardness(3.0F);
+ this.setStepSound(Block.soundTypeMetal);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
+ GameRegistry.registerTileEntity(TileEntityWindKineticGenerator.class, "Advanced Kinetic Wind Generator");
+ }
- @Override
- public String getTextureFolder(final int id)
- {
- return "kineticgenerator";
- }
+ @Override
+ public String getTextureFolder(final int id) {
+ return "kineticgenerator";
+ }
- @Override
- public int damageDropped(final int meta)
- {
- return meta;
- }
+ @Override
+ public int damageDropped(final int meta) {
+ return meta;
+ }
- @Override
- public Class<? extends TileEntity> getTeClass(final int meta, final MutableObject<Class<?>[]> ctorArgTypes, final MutableObject<Object[]> ctorArgs)
- {
- try
- {
- switch (meta)
- {
- case 0:
- return TileEntityWindKineticGenerator.class;
- }
- }
- catch (final Exception e)
- {
- e.printStackTrace();
- }
- return null;
- }
+ @Override
+ public Class<? extends TileEntity> getTeClass(
+ final int meta, final MutableObject<Class<?>[]> ctorArgTypes, final MutableObject<Object[]> ctorArgs) {
+ try {
+ switch (meta) {
+ case 0:
+ return TileEntityWindKineticGenerator.class;
+ }
+ } catch (final Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer entityPlayer, final int side, final float a, final float b, final float c)
- {
- if (entityPlayer.isSneaking()) {
- return false;
- }
- final TileEntity te = this.getOwnTe(world, x, y, z);
- if ((te != null) && ((te instanceof TileEntityManualKineticGenerator))) {
- return ((TileEntityManualKineticGenerator)te).playerKlicked(entityPlayer);
- }
- return super.onBlockActivated(world, x, y, z, entityPlayer, side, a, b, c);
- }
+ @Override
+ public boolean onBlockActivated(
+ final World world,
+ final int x,
+ final int y,
+ final int z,
+ final EntityPlayer entityPlayer,
+ final int side,
+ final float a,
+ final float b,
+ final float c) {
+ if (entityPlayer.isSneaking()) {
+ return false;
+ }
+ final TileEntity te = this.getOwnTe(world, x, y, z);
+ if ((te != null) && ((te instanceof TileEntityManualKineticGenerator))) {
+ return ((TileEntityManualKineticGenerator) te).playerKlicked(entityPlayer);
+ }
+ return super.onBlockActivated(world, x, y, z, entityPlayer, side, a, b, c);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java
index 2c4c2e1d16..6b851e2666 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java
@@ -1,48 +1,40 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator;
+import ic2.core.block.TileEntityBlock;
import java.io.DataInput;
import java.io.IOException;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
-import ic2.core.block.TileEntityBlock;
-
-public abstract class IC2_TEComponent
-{
- protected final TileEntityBlock parent;
+public abstract class IC2_TEComponent {
+ protected final TileEntityBlock parent;
- public IC2_TEComponent(final TileEntityBlock parent)
- {
- this.parent = parent;
- }
+ public IC2_TEComponent(final TileEntityBlock parent) {
+ this.parent = parent;
+ }
- public abstract String getDefaultName();
+ public abstract String getDefaultName();
- public void readFromNbt(final NBTTagCompound nbt) {}
+ public void readFromNbt(final NBTTagCompound nbt) {}
- public NBTTagCompound writeToNbt()
- {
- return null;
- }
+ public NBTTagCompound writeToNbt() {
+ return null;
+ }
- public void onLoaded() {}
+ public void onLoaded() {}
- public void onUnloaded() {}
+ public void onUnloaded() {}
- public void onNeighborUpdate(final Block srcBlock) {}
+ public void onNeighborUpdate(final Block srcBlock) {}
- public void onContainerUpdate(final String name, final EntityPlayerMP player) {}
+ public void onContainerUpdate(final String name, final EntityPlayerMP player) {}
- public void onNetworkUpdate(final DataInput is)
- throws IOException
- {}
+ public void onNetworkUpdate(final DataInput is) throws IOException {}
- public boolean enableWorldTick()
- {
- return false;
- }
+ public boolean enableWorldTick() {
+ return false;
+ }
- public void onWorldTick() {}
+ public void onWorldTick() {}
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java
index 2a5b4dc9ae..6bc79849c3 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java
@@ -1,28 +1,23 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator.container;
-import java.util.List;
-
-import net.minecraft.entity.player.EntityPlayer;
-
import ic2.core.ContainerFullInv;
import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator;
import ic2.core.slot.SlotInvSlot;
+import java.util.List;
+import net.minecraft.entity.player.EntityPlayer;
-public class ContainerKineticWindgenerator
-extends ContainerFullInv<TileEntityWindKineticGenerator>
-{
- public ContainerKineticWindgenerator(final EntityPlayer entityPlayer, final TileEntityWindKineticGenerator tileEntity1)
- {
- super(entityPlayer, tileEntity1, 166);
+public class ContainerKineticWindgenerator extends ContainerFullInv<TileEntityWindKineticGenerator> {
+ public ContainerKineticWindgenerator(
+ final EntityPlayer entityPlayer, final TileEntityWindKineticGenerator tileEntity1) {
+ super(entityPlayer, tileEntity1, 166);
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.rotorSlot, 0, 80, 26));
- }
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.rotorSlot, 0, 80, 26));
+ }
- @Override
- public List<String> getNetworkedFields()
- {
- final List<String> ret = super.getNetworkedFields();
- ret.add("windStrength");
- return ret;
- }
+ @Override
+ public List<String> getNetworkedFields() {
+ final List<String> ret = super.getNetworkedFields();
+ ret.add("windStrength");
+ return ret;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/IC2_ContainerBase.java b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/IC2_ContainerBase.java
index 740991c5d3..b432bf4e15 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/IC2_ContainerBase.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/IC2_ContainerBase.java
@@ -1,5 +1,3 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator.container;
-public class IC2_ContainerBase {
-
-}
+public class IC2_ContainerBase {}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java
index 44053ed2e0..27d4f014bb 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java
@@ -1,78 +1,87 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator.gui;
-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;
-
import ic2.core.IC2;
import ic2.core.block.kineticgenerator.container.ContainerWindKineticGenerator;
import ic2.core.util.GuiTooltipHelper;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
-public class GuiKineticWindGenerator
-extends GuiContainer
-{
- public ContainerWindKineticGenerator container;
- public String name;
+public class GuiKineticWindGenerator extends GuiContainer {
+ public ContainerWindKineticGenerator container;
+ public String name;
- public GuiKineticWindGenerator(final ContainerWindKineticGenerator container1)
- {
- super(container1);
+ public GuiKineticWindGenerator(final ContainerWindKineticGenerator container1) {
+ super(container1);
- this.container = container1;
- this.name = StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.name");
- }
+ this.container = container1;
+ this.name = StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.name");
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2)
- {
- this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 4210752);
- if (this.container.base.checkrotor())
- {
- if (!this.container.base.rotorspace())
- {
- this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 20, 52, 2157374);
- }
- else if ((this.container.base.checkrotor()) && (!this.container.base.guiisminWindStrength()))
- {
- this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374);
- this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak2"), 24, 69, 2157374);
- }
- else
- {
- this.fontRendererObj.drawString(StatCollector.translateToLocalFormatted("ic2.WindKineticGenerator.gui.output", new Object[] { Integer.valueOf(this.container.base.getKuOutput()) }), 55, 52, 2157374);
- this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 70, 2157374);
- if (this.container.base.guiisoverload())
- {
- GuiTooltipHelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop, StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), 44, 20, 79, 45);
- GuiTooltipHelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop, StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload2"), 102, 20, 131, 45);
- }
- }
- }
- else {
- this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374);
- }
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(
+ this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 4210752);
+ if (this.container.base.checkrotor()) {
+ if (!this.container.base.rotorspace()) {
+ this.fontRendererObj.drawString(
+ StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 20, 52, 2157374);
+ } else if ((this.container.base.checkrotor()) && (!this.container.base.guiisminWindStrength())) {
+ this.fontRendererObj.drawString(
+ StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374);
+ this.fontRendererObj.drawString(
+ StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak2"), 24, 69, 2157374);
+ } else {
+ this.fontRendererObj.drawString(
+ StatCollector.translateToLocalFormatted(
+ "ic2.WindKineticGenerator.gui.output",
+ new Object[] {Integer.valueOf(this.container.base.getKuOutput())}),
+ 55,
+ 52,
+ 2157374);
+ this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 70, 2157374);
+ if (this.container.base.guiisoverload()) {
+ GuiTooltipHelper.drawAreaTooltip(
+ par1 - this.guiLeft,
+ par2 - this.guiTop,
+ StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"),
+ 44,
+ 20,
+ 79,
+ 45);
+ GuiTooltipHelper.drawAreaTooltip(
+ par1 - this.guiLeft,
+ par2 - this.guiTop,
+ StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload2"),
+ 102,
+ 20,
+ 131,
+ 45);
+ }
+ }
+ } else {
+ this.fontRendererObj.drawString(
+ StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374);
+ }
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int x, final int y)
- {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(background);
- final int j = (this.width - this.xSize) / 2;
- final int k = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
- if ((this.container.base.guiisoverload()) && (this.container.base.checkrotor()))
- {
- this.drawTexturedModalRect(j + 44, k + 20, 176, 0, 30, 26);
- this.drawTexturedModalRect(j + 102, k + 20, 176, 0, 30, 26);
- }
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int x, final int y) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(background);
+ final int j = (this.width - this.xSize) / 2;
+ final int k = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
+ if ((this.container.base.guiisoverload()) && (this.container.base.checkrotor())) {
+ this.drawTexturedModalRect(j + 44, k + 20, 176, 0, 30, 26);
+ this.drawTexturedModalRect(j + 102, k + 20, 176, 0, 30, 26);
+ }
+ }
- private static final ResourceLocation background = new ResourceLocation(IC2.textureDomain, "textures/gui/GUIWindKineticGenerator.png");
+ private static final ResourceLocation background =
+ new ResourceLocation(IC2.textureDomain, "textures/gui/GUIWindKineticGenerator.png");
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java
index a2c39cb17b..1f9ebcc8bd 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java
@@ -1,19 +1,7 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator.tileentity;
-import java.util.List;
-import java.util.Vector;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.block.Block;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.ChunkCache;
-
import ic2.api.energy.tile.IKineticSource;
import ic2.api.item.IKineticRotor;
import ic2.api.item.IKineticRotor.GearboxType;
@@ -23,367 +11,336 @@ import ic2.core.block.kineticgenerator.container.ContainerWindKineticGenerator;
import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator;
import ic2.core.util.Util;
+import java.util.List;
+import java.util.Vector;
+import net.minecraft.block.Block;
+import net.minecraft.client.gui.GuiScreen;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.ChunkCache;
import net.minecraftforge.common.util.ForgeDirection;
-public class TileEntityKineticWindGenerator
-extends TileEntityWindKineticGenerator
-implements IKineticSource, IHasGui
-{
- public final InvSlotConsumableKineticRotor rotorSlot;
- private double windStrength;
- private int obstructedCrossSection;
- private int crossSection;
- private int updateTicker;
- private float rotationSpeed;
- private static final double efficiencyRollOffExponent = 2.0D;
- private static final int nominalRotationPeriod = 500;
-
- public TileEntityKineticWindGenerator()
- {
- this.updateTicker = IC2.random.nextInt(this.getTickRate());
- this.rotorSlot = new InvSlotConsumableKineticRotor(this, "rotorslot", 0, null, 1, null, GearboxType.WIND);
- }
-
-
- public void update2Entity()
- {
- super.updateEntity();
-
- assert (IC2.platform.isSimulating());
- if ((this.updateTicker++ % this.getTickRate()) != 0) {
- return;
- }
- boolean needsInvUpdate = false;
- if (!this.rotorSlot.isEmpty())
- {
- if (this.checkSpace(1, true) == 0)
- {
- if (this.getActive() != true) {
- this.setActive(true);
- }
- needsInvUpdate = true;
- }
- else
- {
- if (this.getActive()) {
- this.setActive(false);
- }
- needsInvUpdate = true;
- }
- }
- else
- {
- if (this.getActive()) {
- this.setActive(false);
- }
- needsInvUpdate = true;
- }
- if (this.getActive())
- {
- this.crossSection = (((this.getRotorDiameter() / 2) * 2 * 2) + 1);
-
- this.crossSection *= this.crossSection;
- this.obstructedCrossSection = this.checkSpace(this.getRotorDiameter() * 3, false);
- if ((this.obstructedCrossSection > 0) && (this.obstructedCrossSection <= ((this.getRotorDiameter() + 1) / 2))) {
- this.obstructedCrossSection = 0;
- } else if (this.obstructedCrossSection < 0) {
- this.obstructedCrossSection = this.crossSection;
- }
- this.windStrength = this.calcWindStrength();
-
- final float speed = (float)Util.limit((this.windStrength - this.getMinWindStrength()) / this.getMaxWindStrength(), 0.0D, 2.0D);
-
-
- this.setRotationSpeed(speed*2);
- if (this.windStrength >= this.getMinWindStrength()) {
- if (this.windStrength <= this.getMaxWindStrength()) {
- this.rotorSlot.damage(1, false);
- } else {
- this.rotorSlot.damage(4, false);
- }
- }
- }
- }
-
-
-
- @Override
- public List<String> getNetworkedFields()
- {
- final List<String> ret = new Vector<>(1);
-
- ret.add("rotationSpeed");
- ret.add("rotorSlot");
- ret.addAll(super.getNetworkedFields());
-
- return ret;
- }
-
- @Override
- public ContainerBase<TileEntityWindKineticGenerator> getGuiContainer(final EntityPlayer entityPlayer)
- {
- return new ContainerWindKineticGenerator(entityPlayer, this);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public GuiScreen getGui(final EntityPlayer entityPlayer, final boolean isAdmin)
- {
- return new GuiWindKineticGenerator(new ContainerWindKineticGenerator(entityPlayer, this));
- }
-
- @Override
- public boolean facingMatchesDirection(final ForgeDirection direction)
- {
- return direction.ordinal() == this.getFacing();
- }
-
- @Override
- public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side)
- {
- if ((side == 0) || (side == 1)) {
- return false;
- }
- return this.getFacing() != side;
- }
-
- @Override
- public void setFacing(final short side)
- {
- super.setFacing(side);
- }
-
- public boolean enableUpdateEntity()
- {
- return IC2.platform.isSimulating();
- }
-
- @Override
- public String getRotorhealth()
- {
- if (!this.rotorSlot.isEmpty()) {
- return StatCollector.translateToLocalFormatted("ic2.WindKineticGenerator.gui.rotorhealth", new Object[] { Integer.valueOf((int)(100.0F - ((this.rotorSlot.get().getItemDamage() / this.rotorSlot.get().getMaxDamage()) * 100.0F))) });
- }
- return "";
- }
-
- @Override
- public int maxrequestkineticenergyTick(final ForgeDirection directionFrom)
- {
- return this.getKuOutput();
- }
-
- @Override
- public int requestkineticenergy(final ForgeDirection directionFrom, final int requestkineticenergy)
- {
- if (this.facingMatchesDirection(directionFrom.getOpposite())) {
- return Math.min(requestkineticenergy, this.getKuOutput());
- }
- return 0;
- }
-
- @Override
- public String getInventoryName()
- {
- return "Advanced Kinetic Wind Generator";
- }
-
- @Override
- public void onGuiClosed(final EntityPlayer entityPlayer) {}
-
- @Override
- public boolean shouldRenderInPass(final int pass)
- {
- return pass == 0;
- }
-
- @Override
- public int checkSpace(int length, final boolean onlyrotor)
- {
- int box = this.getRotorDiameter() / 2;
- int lentemp = 0;
- if (onlyrotor)
- {
- length = 1;
- lentemp = length + 1;
- }
- if (!onlyrotor) {
- box *= 2;
- }
- final ForgeDirection fwdDir = ForgeDirection.VALID_DIRECTIONS[this.getFacing()];
- final ForgeDirection rightDir = fwdDir.getRotation(ForgeDirection.DOWN);
-
- final int xMaxDist = Math.abs((length * fwdDir.offsetX) + (box * rightDir.offsetX));
-
- final int zMaxDist = Math.abs((length * fwdDir.offsetZ) + (box * rightDir.offsetZ));
-
-
- final ChunkCache chunkCache = new ChunkCache(this.worldObj, this.xCoord - xMaxDist, this.yCoord - box, this.zCoord - zMaxDist, this.xCoord + xMaxDist, this.yCoord + box, this.zCoord + zMaxDist, 0);
-
-
-
- int ret = 0;
- for (int up = -box; up <= box; up++)
- {
- final int y = this.yCoord + up;
- for (int right = -box; right <= box; right++)
- {
- boolean occupied = false;
- for (int fwd = lentemp - length; fwd <= length; fwd++)
- {
- final int x = this.xCoord + (fwd * fwdDir.offsetX) + (right * rightDir.offsetX);
-
- final int z = this.zCoord + (fwd * fwdDir.offsetZ) + (right * rightDir.offsetZ);
-
-
- assert (Math.abs(x - this.xCoord) <= xMaxDist);
- assert (Math.abs(z - this.zCoord) <= zMaxDist);
-
- final Block block = chunkCache.getBlock(x, y, z);
- if (!block.isAir(chunkCache, x, y, z))
- {
- occupied = true;
- if (((up != 0) || (right != 0) || (fwd != 0)) && ((chunkCache.getTileEntity(x, y, z) instanceof TileEntityKineticWindGenerator)) && (!onlyrotor)) {
- return -1;
- }
- }
- }
- if (occupied) {
- ret++;
- }
- }
- }
- return ret;
- }
-
- @Override
- public boolean checkrotor()
- {
- return !this.rotorSlot.isEmpty();
- }
-
- @Override
- public boolean rotorspace()
- {
- return this.checkSpace(1, true) == 0;
- }
-
- private void setRotationSpeed(final float speed)
- {
- if (this.rotationSpeed != speed)
- {
- this.rotationSpeed = speed;
- IC2.network.get().updateTileEntityField(this, "rotationSpeed");
- }
- }
-
- @Override
- public int getTickRate()
- {
- return 32;
- }
-
- @Override
- public double calcWindStrength()
- {
- double windStr = WorldData.get(this.worldObj).windSim.getWindAt(this.yCoord);
-
- windStr *= (1.0D - Math.pow(this.obstructedCrossSection / this.crossSection, 2.0D));
-
-
- return Math.max(0.0D, windStr);
- }
-
- @Override
- public float getAngle()
- {
- if (this.rotationSpeed > 0.0F)
- {
- final long period = (long) (5.0E+008F / this.rotationSpeed);
-
-
- return ((float)(System.nanoTime() % period) / (float)period) * 360.0F;
- }
- return 0.0F;
- }
-
- @Override
- public float getefficiency()
- {
- final ItemStack stack = this.rotorSlot.get();
- if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
- return (float) (((IKineticRotor)stack.getItem()).getEfficiency(stack)*1.5);
- }
- return 0.0F;
- }
-
- @Override
- public int getMinWindStrength()
- {
- final ItemStack stack = this.rotorSlot.get();
- if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
- return ((IKineticRotor)stack.getItem()).getMinWindStrength(stack)/2;
- }
- return 0;
- }
-
- @Override
- public int getMaxWindStrength()
- {
- final ItemStack stack = this.rotorSlot.get();
- if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
- return ((IKineticRotor)stack.getItem()).getMaxWindStrength(stack)*2;
- }
- return 0;
- }
-
- @Override
- public int getRotorDiameter()
- {
- final ItemStack stack = this.rotorSlot.get();
- if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
- return ((IKineticRotor)stack.getItem()).getDiameter(stack)/2;
- }
- return 0;
- }
-
- @Override
- public ResourceLocation getRotorRenderTexture()
- {
- final ItemStack stack = this.rotorSlot.get();
- if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
- return ((IKineticRotor)stack.getItem()).getRotorRenderTexture(stack);
- }
- return new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorWoodmodel.png");
- }
-
- @Override
- public boolean guiisoverload()
- {
- if (this.windStrength > this.getMaxWindStrength()) {
- return true;
- }
- return false;
- }
-
- @Override
- public boolean guiisminWindStrength()
- {
- return this.windStrength >= this.getMinWindStrength();
- }
-
- @Override
- public int getKuOutput()
- {
- if ((this.windStrength >= this.getMinWindStrength()) && (this.getActive())) {
- return (int)(this.windStrength * 50.0D * this.getefficiency());
- }
- return 0;
- }
-
- @Override
- public int getWindStrength()
- {
- return (int)this.windStrength;
- }
+public class TileEntityKineticWindGenerator extends TileEntityWindKineticGenerator implements IKineticSource, IHasGui {
+ public final InvSlotConsumableKineticRotor rotorSlot;
+ private double windStrength;
+ private int obstructedCrossSection;
+ private int crossSection;
+ private int updateTicker;
+ private float rotationSpeed;
+ private static final double efficiencyRollOffExponent = 2.0D;
+ private static final int nominalRotationPeriod = 500;
+
+ public TileEntityKineticWindGenerator() {
+ this.updateTicker = IC2.random.nextInt(this.getTickRate());
+ this.rotorSlot = new InvSlotConsumableKineticRotor(this, "rotorslot", 0, null, 1, null, GearboxType.WIND);
+ }
+
+ public void update2Entity() {
+ super.updateEntity();
+
+ assert (IC2.platform.isSimulating());
+ if ((this.updateTicker++ % this.getTickRate()) != 0) {
+ return;
+ }
+ boolean needsInvUpdate = false;
+ if (!this.rotorSlot.isEmpty()) {
+ if (this.checkSpace(1, true) == 0) {
+ if (this.getActive() != true) {
+ this.setActive(true);
+ }
+ needsInvUpdate = true;
+ } else {
+ if (this.getActive()) {
+ this.setActive(false);
+ }
+ needsInvUpdate = true;
+ }
+ } else {
+ if (this.getActive()) {
+ this.setActive(false);
+ }
+ needsInvUpdate = true;
+ }
+ if (this.getActive()) {
+ this.crossSection = (((this.getRotorDiameter() / 2) * 2 * 2) + 1);
+
+ this.crossSection *= this.crossSection;
+ this.obstructedCrossSection = this.checkSpace(this.getRotorDiameter() * 3, false);
+ if ((this.obstructedCrossSection > 0)
+ && (this.obstructedCrossSection <= ((this.getRotorDiameter() + 1) / 2))) {
+ this.obstructedCrossSection = 0;
+ } else if (this.obstructedCrossSection < 0) {
+ this.obstructedCrossSection = this.crossSection;
+ }
+ this.windStrength = this.calcWindStrength();
+
+ final float speed = (float)
+ Util.limit((this.windStrength - this.getMinWindStrength()) / this.getMaxWindStrength(), 0.0D, 2.0D);
+
+ this.setRotationSpeed(speed * 2);
+ if (this.windStrength >= this.getMinWindStrength()) {
+ if (this.windStrength <= this.getMaxWindStrength()) {
+ this.rotorSlot.damage(1, false);
+ } else {
+ this.rotorSlot.damage(4, false);
+ }
+ }
+ }
+ }
+
+ @Override
+ public List<String> getNetworkedFields() {
+ final List<String> ret = new Vector<>(1);
+
+ ret.add("rotationSpeed");
+ ret.add("rotorSlot");
+ ret.addAll(super.getNetworkedFields());
+
+ return ret;
+ }
+
+ @Override
+ public ContainerBase<TileEntityWindKineticGenerator> getGuiContainer(final EntityPlayer entityPlayer) {
+ return new ContainerWindKineticGenerator(entityPlayer, this);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public GuiScreen getGui(final EntityPlayer entityPlayer, final boolean isAdmin) {
+ return new GuiWindKineticGenerator(new ContainerWindKineticGenerator(entityPlayer, this));
+ }
+
+ @Override
+ public boolean facingMatchesDirection(final ForgeDirection direction) {
+ return direction.ordinal() == this.getFacing();
+ }
+
+ @Override
+ public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side) {
+ if ((side == 0) || (side == 1)) {
+ return false;
+ }
+ return this.getFacing() != side;
+ }
+
+ @Override
+ public void setFacing(final short side) {
+ super.setFacing(side);
+ }
+
+ public boolean enableUpdateEntity() {
+ return IC2.platform.isSimulating();
+ }
+
+ @Override
+ public String getRotorhealth() {
+ if (!this.rotorSlot.isEmpty()) {
+ return StatCollector.translateToLocalFormatted("ic2.WindKineticGenerator.gui.rotorhealth", new Object[] {
+ Integer.valueOf((int) (100.0F
+ - ((this.rotorSlot.get().getItemDamage()
+ / this.rotorSlot.get().getMaxDamage())
+ * 100.0F)))
+ });
+ }
+ return "";
+ }
+
+ @Override
+ public int maxrequestkineticenergyTick(final ForgeDirection directionFrom) {
+ return this.getKuOutput();
+ }
+
+ @Override
+ public int requestkineticenergy(final ForgeDirection directionFrom, final int requestkineticenergy) {
+ if (this.facingMatchesDirection(directionFrom.getOpposite())) {
+ return Math.min(requestkineticenergy, this.getKuOutput());
+ }
+ return 0;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return "Advanced Kinetic Wind Generator";
+ }
+
+ @Override
+ public void onGuiClosed(final EntityPlayer entityPlayer) {}
+
+ @Override
+ public boolean shouldRenderInPass(final int pass) {
+ return pass == 0;
+ }
+
+ @Override
+ public int checkSpace(int length, final boolean onlyrotor) {
+ int box = this.getRotorDiameter() / 2;
+ int lentemp = 0;
+ if (onlyrotor) {
+ length = 1;
+ lentemp = length + 1;
+ }
+ if (!onlyrotor) {
+ box *= 2;
+ }
+ final ForgeDirection fwdDir = ForgeDirection.VALID_DIRECTIONS[this.getFacing()];
+ final ForgeDirection rightDir = fwdDir.getRotation(ForgeDirection.DOWN);
+
+ final int xMaxDist = Math.abs((length * fwdDir.offsetX) + (box * rightDir.offsetX));
+
+ final int zMaxDist = Math.abs((length * fwdDir.offsetZ) + (box * rightDir.offsetZ));
+
+ final ChunkCache chunkCache = new ChunkCache(
+ this.worldObj,
+ this.xCoord - xMaxDist,
+ this.yCoord - box,
+ this.zCoord - zMaxDist,
+ this.xCoord + xMaxDist,
+ this.yCoord + box,
+ this.zCoord + zMaxDist,
+ 0);
+
+ int ret = 0;
+ for (int up = -box; up <= box; up++) {
+ final int y = this.yCoord + up;
+ for (int right = -box; right <= box; right++) {
+ boolean occupied = false;
+ for (int fwd = lentemp - length; fwd <= length; fwd++) {
+ final int x = this.xCoord + (fwd * fwdDir.offsetX) + (right * rightDir.offsetX);
+
+ final int z = this.zCoord + (fwd * fwdDir.offsetZ) + (right * rightDir.offsetZ);
+
+ assert (Math.abs(x - this.xCoord) <= xMaxDist);
+ assert (Math.abs(z - this.zCoord) <= zMaxDist);
+
+ final Block block = chunkCache.getBlock(x, y, z);
+ if (!block.isAir(chunkCache, x, y, z)) {
+ occupied = true;
+ if (((up != 0) || (right != 0) || (fwd != 0))
+ && ((chunkCache.getTileEntity(x, y, z) instanceof TileEntityKineticWindGenerator))
+ && (!onlyrotor)) {
+ return -1;
+ }
+ }
+ }
+ if (occupied) {
+ ret++;
+ }
+ }
+ }
+ return ret;
+ }
+
+ @Override
+ public boolean checkrotor() {
+ return !this.rotorSlot.isEmpty();
+ }
+
+ @Override
+ public boolean rotorspace() {
+ return this.checkSpace(1, true) == 0;
+ }
+
+ private void setRotationSpeed(final float speed) {
+ if (this.rotationSpeed != speed) {
+ this.rotationSpeed = speed;
+ IC2.network.get().updateTileEntityField(this, "rotationSpeed");
+ }
+ }
+
+ @Override
+ public int getTickRate() {
+ return 32;
+ }
+
+ @Override
+ public double calcWindStrength() {
+ double windStr = WorldData.get(this.worldObj).windSim.getWindAt(this.yCoord);
+
+ windStr *= (1.0D - Math.pow(this.obstructedCrossSection / this.crossSection, 2.0D));
+
+ return Math.max(0.0D, windStr);
+ }
+
+ @Override
+ public float getAngle() {
+ if (this.rotationSpeed > 0.0F) {
+ final long period = (long) (5.0E+008F / this.rotationSpeed);
+
+ return ((float) (System.nanoTime() % period) / (float) period) * 360.0F;
+ }
+ return 0.0F;
+ }
+
+ @Override
+ public float getefficiency() {
+ final ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return (float) (((IKineticRotor) stack.getItem()).getEfficiency(stack) * 1.5);
+ }
+ return 0.0F;
+ }
+
+ @Override
+ public int getMinWindStrength() {
+ final ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return ((IKineticRotor) stack.getItem()).getMinWindStrength(stack) / 2;
+ }
+ return 0;
+ }
+
+ @Override
+ public int getMaxWindStrength() {
+ final ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return ((IKineticRotor) stack.getItem()).getMaxWindStrength(stack) * 2;
+ }
+ return 0;
+ }
+
+ @Override
+ public int getRotorDiameter() {
+ final ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return ((IKineticRotor) stack.getItem()).getDiameter(stack) / 2;
+ }
+ return 0;
+ }
+
+ @Override
+ public ResourceLocation getRotorRenderTexture() {
+ final ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return ((IKineticRotor) stack.getItem()).getRotorRenderTexture(stack);
+ }
+ return new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorWoodmodel.png");
+ }
+
+ @Override
+ public boolean guiisoverload() {
+ if (this.windStrength > this.getMaxWindStrength()) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean guiisminWindStrength() {
+ return this.windStrength >= this.getMinWindStrength();
+ }
+
+ @Override
+ public int getKuOutput() {
+ if ((this.windStrength >= this.getMinWindStrength()) && (this.getActive())) {
+ return (int) (this.windStrength * 50.0D * this.getefficiency());
+ }
+ return 0;
+ }
+
+ @Override
+ public int getWindStrength() {
+ return (int) this.windStrength;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java b/src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java
index 92d711101b..441e910f50 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java
@@ -1,16 +1,14 @@
package gtPlusPlus.xmod.ic2.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 gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.util.Utils;
import ic2.api.item.IKineticRotor;
import ic2.core.IC2;
import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator;
import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
+import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
@@ -22,255 +20,229 @@ import net.minecraft.util.StatCollector;
public class CustomKineticRotor extends Item implements IKineticRotor {
- private final int mTier;
-
- @SideOnly(Side.CLIENT)
- private IIcon[] mTextures;
-
- private static final String[] mRegistrationNames = new String[] {
- "itemwoodrotor", "itemironrotor", "itemsteelrotor", "itemwcarbonrotor"
- };
-
- private static final String[] mUnlocalNames = new String[] {
- "itemEnergeticRotor",
- "itemTungstenSteelRotor",
- "itemVibrantRotor",
- "itemIridiumRotor",
- "itemMagnaliumRotor",
- "itemUltimetRotor",
- };
- private static final int[] mMaxDurability = new int[] {
- 512000, 809600, 1600000, 3200000
- };
- private static final int[] mRadius = new int[] {
- 9, 11, 13, 15
- };
- private static final float[] mEfficiency = new float[] {
- 0.9f, 1.0f, 1.2f, 1.5f
- };
- private static final int[] mMinWindStrength = new int[] {
- 12, 14, 16, 18
- };
- private static final int[] mMaxWindStrength = new int[] {
- 80, 120, 160, 320
- };
-
- private static final ResourceLocation[] mResourceLocations = new ResourceLocation[] {
- new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png"),
- new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png"),
- new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png"),
- new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png"),
- new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png"),
- new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png"),
- };
-
- private final int maxWindStrength;
- private final int minWindStrength;
- private final int radius;
- private final float efficiency;
- private final ResourceLocation renderTexture;
-
- public CustomKineticRotor(int aTier) {
- mTier = aTier;
- this.setMaxStackSize(1);
- // Handle Differences if EIO is not loaded
- if (!LoadedMods.EnderIO && (aTier == 0 || aTier == 2)) {
- this.renderTexture = mResourceLocations[(aTier == 0 ? 4 : 5)];
- this.setUnlocalizedName(mUnlocalNames[(aTier == 0 ? 4 : 5)]);
- }
- else {
- this.renderTexture = mResourceLocations[aTier];
- this.setUnlocalizedName(mUnlocalNames[aTier]);
- }
- this.setMaxDamage(mMaxDurability[aTier]);
- this.radius = mRadius[aTier];
- this.efficiency = mEfficiency[aTier];
- this.minWindStrength = mMinWindStrength[aTier];
- this.maxWindStrength = mMaxWindStrength[aTier];
- this.setNoRepair();
- this.setCreativeTab(IC2.tabIC2);
- GameRegistry.registerItem(this, mRegistrationNames[aTier]);
- }
-
- @Override
- public void setDamage(final ItemStack stack, final int damage) {
- if (mTier < 3) {
- super.setDamage(stack, damage);
- }
- }
-
- @Override
- public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
-
- info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[]{this.minWindStrength, this.maxWindStrength}));
-
- GearboxType type = null;
- if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) {
- type = GearboxType.WATER;
- }
- else if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) {
- type = GearboxType.WIND;
- }
-
- if (type != null) {
- info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)));
- }
-
- }
-
- @Override
- public int getDiameter(final ItemStack stack)
- {
- return this.radius;
- }
-
- @Override
- public ResourceLocation getRotorRenderTexture(final ItemStack stack)
- {
- return this.renderTexture;
- }
-
- @Override
- public float getEfficiency(final ItemStack stack)
- {
- return this.efficiency;
- }
-
- @Override
- public int getMinWindStrength(final ItemStack stack)
- {
- return this.minWindStrength;
- }
-
- @Override
- public int getMaxWindStrength(final ItemStack stack)
- {
- return this.maxWindStrength;
- }
-
- @Override
- public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type){
- return (type == IKineticRotor.GearboxType.WIND) || (type == IKineticRotor.GearboxType.WATER);
- }
-
- public String getUnlocalizedName() {
- return "ic2." + super.getUnlocalizedName().substring(5);
- }
-
- public String getUnlocalizedName(ItemStack itemStack) {
- return this.getUnlocalizedName();
- }
-
- public String getItemStackDisplayName(ItemStack itemStack) {
- return StatCollector.translateToLocal(this.getUnlocalizedName(itemStack));
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return mTier < 3;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamage(int meta) {
- if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
- if (mTier == 0) {
- return mTextures[4];
- }
- else {
- return mTextures[5];
- }
- }
- else {
- return mTextures[mTier];
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIconIndex(ItemStack aIndex) {
- if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
- if (mTier == 0) {
- return mTextures[4];
- }
- else {
- return mTextures[5];
- }
- }
- else {
- return mTextures[mTier];
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamageForRenderPass(int aDmg, int aPass) {
- if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
- if (mTier == 0) {
- return mTextures[4];
- }
- else {
- return mTextures[5];
- }
- }
- else {
- return mTextures[mTier];
- }
- }
-
- @Override
- protected String getIconString() {
- return super.getIconString();
- }
-
- @Override
- public int getDisplayDamage(ItemStack stack) {
- return super.getDisplayDamage(stack);
- }
-
- @Override
- public double getDurabilityForDisplay(ItemStack stack) {
- return super.getDurabilityForDisplay(stack);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
- if (mTier == 0) {
- return mTextures[4];
- }
- else {
- return mTextures[5];
- }
- }
- else {
- return mTextures[mTier];
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(ItemStack stack, int pass) {
- if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
- if (mTier == 0) {
- return mTextures[4];
- }
- else {
- return mTextures[5];
- }
- }
- else {
- return mTextures[mTier];
- }
- }
-
- @Override
- public void registerIcons(IIconRegister iconRegister) {
- int aIndex = 0;
- mTextures = new IIcon[6];
- for (String y : mUnlocalNames) {
- mTextures[aIndex++] = iconRegister.registerIcon(IC2.textureDomain + ":" + "rotors/" + y);
- }
- }
-} \ No newline at end of file
+ private final int mTier;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon[] mTextures;
+
+ private static final String[] mRegistrationNames =
+ new String[] {"itemwoodrotor", "itemironrotor", "itemsteelrotor", "itemwcarbonrotor"};
+
+ private static final String[] mUnlocalNames = new String[] {
+ "itemEnergeticRotor",
+ "itemTungstenSteelRotor",
+ "itemVibrantRotor",
+ "itemIridiumRotor",
+ "itemMagnaliumRotor",
+ "itemUltimetRotor",
+ };
+ private static final int[] mMaxDurability = new int[] {512000, 809600, 1600000, 3200000};
+ private static final int[] mRadius = new int[] {9, 11, 13, 15};
+ private static final float[] mEfficiency = new float[] {0.9f, 1.0f, 1.2f, 1.5f};
+ private static final int[] mMinWindStrength = new int[] {12, 14, 16, 18};
+ private static final int[] mMaxWindStrength = new int[] {80, 120, 160, 320};
+
+ private static final ResourceLocation[] mResourceLocations = new ResourceLocation[] {
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png"),
+ };
+
+ private final int maxWindStrength;
+ private final int minWindStrength;
+ private final int radius;
+ private final float efficiency;
+ private final ResourceLocation renderTexture;
+
+ public CustomKineticRotor(int aTier) {
+ mTier = aTier;
+ this.setMaxStackSize(1);
+ // Handle Differences if EIO is not loaded
+ if (!LoadedMods.EnderIO && (aTier == 0 || aTier == 2)) {
+ this.renderTexture = mResourceLocations[(aTier == 0 ? 4 : 5)];
+ this.setUnlocalizedName(mUnlocalNames[(aTier == 0 ? 4 : 5)]);
+ } else {
+ this.renderTexture = mResourceLocations[aTier];
+ this.setUnlocalizedName(mUnlocalNames[aTier]);
+ }
+ this.setMaxDamage(mMaxDurability[aTier]);
+ this.radius = mRadius[aTier];
+ this.efficiency = mEfficiency[aTier];
+ this.minWindStrength = mMinWindStrength[aTier];
+ this.maxWindStrength = mMaxWindStrength[aTier];
+ this.setNoRepair();
+ this.setCreativeTab(IC2.tabIC2);
+ GameRegistry.registerItem(this, mRegistrationNames[aTier]);
+ }
+
+ @Override
+ public void setDamage(final ItemStack stack, final int damage) {
+ if (mTier < 3) {
+ super.setDamage(stack, damage);
+ }
+ }
+
+ @Override
+ public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
+
+ info.add(StatCollector.translateToLocalFormatted(
+ "ic2.itemrotor.wind.info", new Object[] {this.minWindStrength, this.maxWindStrength}));
+
+ GearboxType type = null;
+ if (Minecraft.getMinecraft().currentScreen != null
+ && Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) {
+ type = GearboxType.WATER;
+ } else if (Minecraft.getMinecraft().currentScreen != null
+ && Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) {
+ type = GearboxType.WIND;
+ }
+
+ if (type != null) {
+ info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)));
+ }
+ }
+
+ @Override
+ public int getDiameter(final ItemStack stack) {
+ return this.radius;
+ }
+
+ @Override
+ public ResourceLocation getRotorRenderTexture(final ItemStack stack) {
+ return this.renderTexture;
+ }
+
+ @Override
+ public float getEfficiency(final ItemStack stack) {
+ return this.efficiency;
+ }
+
+ @Override
+ public int getMinWindStrength(final ItemStack stack) {
+ return this.minWindStrength;
+ }
+
+ @Override
+ public int getMaxWindStrength(final ItemStack stack) {
+ return this.maxWindStrength;
+ }
+
+ @Override
+ public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type) {
+ return (type == IKineticRotor.GearboxType.WIND) || (type == IKineticRotor.GearboxType.WATER);
+ }
+
+ public String getUnlocalizedName() {
+ return "ic2." + super.getUnlocalizedName().substring(5);
+ }
+
+ public String getUnlocalizedName(ItemStack itemStack) {
+ return this.getUnlocalizedName();
+ }
+
+ public String getItemStackDisplayName(ItemStack itemStack) {
+ return StatCollector.translateToLocal(this.getUnlocalizedName(itemStack));
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return mTier < 3;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int meta) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ } else {
+ return mTextures[5];
+ }
+ } else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconIndex(ItemStack aIndex) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ } else {
+ return mTextures[5];
+ }
+ } else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamageForRenderPass(int aDmg, int aPass) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ } else {
+ return mTextures[5];
+ }
+ } else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ protected String getIconString() {
+ return super.getIconString();
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return super.getDisplayDamage(stack);
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ return super.getDurabilityForDisplay(stack);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ } else {
+ return mTextures[5];
+ }
+ } else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(ItemStack stack, int pass) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ } else {
+ return mTextures[5];
+ }
+ } else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ public void registerIcons(IIconRegister iconRegister) {
+ int aIndex = 0;
+ mTextures = new IIcon[6];
+ for (String y : mUnlocalNames) {
+ mTextures[aIndex++] = iconRegister.registerIcon(IC2.textureDomain + ":" + "rotors/" + y);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java b/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java
index bd1ad91588..2dd7274c7b 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java
@@ -1,43 +1,34 @@
package gtPlusPlus.xmod.ic2.item;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.CoreItem;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.CoreItem;
-
-public class IC2_ItemGradual
-extends CoreItem
-{
- public IC2_ItemGradual(final String internalName)
- {
- super(internalName, AddToCreativeTab.tabMachines, 1, 10000, "", EnumRarity.uncommon);
- this.setNoRepair();
- }
-
- @Override
- public boolean isDamaged(final ItemStack stack)
- {
- return this.getDamage(stack) > 1;
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack)
- {
- return true;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item item, final CreativeTabs tabs, final List itemList)
- {
- itemList.add(new ItemStack(this, 1, 1));
- }
+public class IC2_ItemGradual extends CoreItem {
+ public IC2_ItemGradual(final String internalName) {
+ super(internalName, AddToCreativeTab.tabMachines, 1, 10000, "", EnumRarity.uncommon);
+ this.setNoRepair();
+ }
+
+ @Override
+ public boolean isDamaged(final ItemStack stack) {
+ return this.getDamage(stack) > 1;
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return true;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(final Item item, final CreativeTabs tabs, final List itemList) {
+ itemList.add(new ItemStack(this, 1, 1));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java b/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java
index 3ccb2cb0ee..2e4b82cfd2 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java
@@ -1,54 +1,45 @@
package gtPlusPlus.xmod.ic2.item;
+import ic2.api.item.ICustomDamageItem;
+import ic2.core.util.StackUtil;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import ic2.api.item.ICustomDamageItem;
-import ic2.core.util.StackUtil;
-
-public class IC2_ItemGradualInteger
-extends IC2_ItemGradual
-implements ICustomDamageItem
-{
- private final int maxDmg;
-
- public IC2_ItemGradualInteger(final String internalName, final int maxdmg)
- {
- super(internalName);
-
- this.maxDmg = maxdmg;
- }
-
- @Override
- public int getCustomDamage(final ItemStack stack)
- {
- final NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
- return nbt.getInteger("advDmg");
- }
-
- @Override
- public int getMaxCustomDamage(final ItemStack stack)
- {
- return this.maxDmg;
- }
-
- @Override
- public void setCustomDamage(final ItemStack stack, final int damage)
- {
- final NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
- nbt.setInteger("advDmg", 0);
-
- final int maxStackDamage = stack.getMaxDamage();
- if (maxStackDamage > 2) {
- //stack.setItemDamage(1 + (int)Util.map(damage, this.maxDmg, maxStackDamage - 2));
- }
- }
-
- @Override
- public boolean applyCustomDamage(final ItemStack stack, final int damage, final EntityLivingBase src)
- {
- this.setCustomDamage(stack, this.getCustomDamage(stack) + damage);
- return true;
- }
+public class IC2_ItemGradualInteger extends IC2_ItemGradual implements ICustomDamageItem {
+ private final int maxDmg;
+
+ public IC2_ItemGradualInteger(final String internalName, final int maxdmg) {
+ super(internalName);
+
+ this.maxDmg = maxdmg;
+ }
+
+ @Override
+ public int getCustomDamage(final ItemStack stack) {
+ final NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
+ return nbt.getInteger("advDmg");
+ }
+
+ @Override
+ public int getMaxCustomDamage(final ItemStack stack) {
+ return this.maxDmg;
+ }
+
+ @Override
+ public void setCustomDamage(final ItemStack stack, final int damage) {
+ final NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
+ nbt.setInteger("advDmg", 0);
+
+ final int maxStackDamage = stack.getMaxDamage();
+ if (maxStackDamage > 2) {
+ // stack.setItemDamage(1 + (int)Util.map(damage, this.maxDmg, maxStackDamage - 2));
+ }
+ }
+
+ @Override
+ public boolean applyCustomDamage(final ItemStack stack, final int damage, final EntityLivingBase src) {
+ this.setCustomDamage(stack, this.getCustomDamage(stack) + damage);
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java b/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java
index 897e831b73..2e11b11b2f 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java
@@ -3,104 +3,93 @@ package gtPlusPlus.xmod.ic2.item;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-
-public class IC2_ItemIC2
-extends Item
-{
- public IC2_ItemIC2(final String internalName)
- {
- this.setUnlocalizedName(internalName);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setTextureName(CORE.MODID + ":" + internalName);
-
- GameRegistry.registerItem(this, internalName);
- }
-
- public String getTextureFolder()
- {
- return null;
- }
+public class IC2_ItemIC2 extends Item {
+ public IC2_ItemIC2(final String internalName) {
+ this.setUnlocalizedName(internalName);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setTextureName(CORE.MODID + ":" + internalName);
- /* public String getTextureName(int index)
- {
- if ((!this.hasSubtypes) && (index > 0)) {
- return null;
+ GameRegistry.registerItem(this, internalName);
}
- String name = getUnlocalizedName(new ItemStack(this, 1, index));
- if ((name != null) && (name.length() > 4)) {
- return name.substring(4);
+
+ public String getTextureFolder() {
+ return null;
}
- return name;
- }
- @Override
-@SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister iconRegister)
- {
- int indexCount = 0;
- while (getTextureName(indexCount) != null)
- {
- indexCount++;
- if (indexCount > 32767) {
- throw new RuntimeException("More Item Icons than actually possible @ " + getUnlocalizedName());
+ /* public String getTextureName(int index)
+ {
+ if ((!this.hasSubtypes) && (index > 0)) {
+ return null;
+ }
+ String name = getUnlocalizedName(new ItemStack(this, 1, index));
+ if ((name != null) && (name.length() > 4)) {
+ return name.substring(4);
+ }
+ return name;
}
- }
- this.textures = new IIcon[indexCount];
- for (int index = 0; index < indexCount; index++) {
- this.textures[index] = iconRegister.registerIcon(CORE.MODID + ":" + getUnlocalizedName());
- }
- }
- @Override
-@SideOnly(Side.CLIENT)
- public IIcon getIconFromDamage(int meta)
- {
- if (meta < this.textures.length) {
- return this.textures[meta];
- }
- return this.textures.length < 1 ? null : this.textures[0];
- }*/
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ int indexCount = 0;
+ while (getTextureName(indexCount) != null)
+ {
+ indexCount++;
+ if (indexCount > 32767) {
+ throw new RuntimeException("More Item Icons than actually possible @ " + getUnlocalizedName());
+ }
+ }
+ this.textures = new IIcon[indexCount];
+ for (int index = 0; index < indexCount; index++) {
+ this.textures[index] = iconRegister.registerIcon(CORE.MODID + ":" + getUnlocalizedName());
+ }
+ }
- @Override
- public String getUnlocalizedName()
- {
- return super.getUnlocalizedName();
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int meta)
+ {
+ if (meta < this.textures.length) {
+ return this.textures[meta];
+ }
+ return this.textures.length < 1 ? null : this.textures[0];
+ }*/
- @Override
- public String getUnlocalizedName(final ItemStack itemStack)
- {
- return this.getUnlocalizedName();
- }
+ @Override
+ public String getUnlocalizedName() {
+ return super.getUnlocalizedName();
+ }
- @Override
- public String getItemStackDisplayName(final ItemStack itemStack)
- {
- return StatCollector.translateToLocal(this.getUnlocalizedName(itemStack));
- }
+ @Override
+ public String getUnlocalizedName(final ItemStack itemStack) {
+ return this.getUnlocalizedName();
+ }
- public IC2_ItemIC2 setRarity(final int aRarity)
- {
- this.rarity = aRarity;
- return this;
- }
+ @Override
+ public String getItemStackDisplayName(final ItemStack itemStack) {
+ return StatCollector.translateToLocal(this.getUnlocalizedName(itemStack));
+ }
+
+ public IC2_ItemIC2 setRarity(final int aRarity) {
+ this.rarity = aRarity;
+ return this;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack stack)
- {
- return EnumRarity.values()[this.rarity];
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(final ItemStack stack) {
+ return EnumRarity.values()[this.rarity];
+ }
- private int rarity = 0;
- protected IIcon[] textures;
+ private int rarity = 0;
+ protected IIcon[] textures;
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_Items.java b/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
index 8c8b2ea7ad..df83bce648 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
@@ -8,53 +8,62 @@ import net.minecraft.item.ItemStack;
public class IC2_Items {
- public static ItemStack rotor_Material_1; //Energetic Alloy
- public static ItemStack rotor_Material_2; //TungstenSteel
- public static ItemStack rotor_Material_3; //Vibrant Alloy
- public static ItemStack rotor_Material_4; //Iridium
-
- public static ItemStack rotor_Blade_Material_1;
- public static ItemStack rotor_Blade_Material_2;
- public static ItemStack rotor_Blade_Material_3;
- public static ItemStack rotor_Blade_Material_4;
-
- public static ItemStack shaft_Material_1; //Energetic Alloy
- public static ItemStack shaft_Material_2; //TungstenSteel
- public static ItemStack shaft_Material_3; //Vibrant Alloy
- public static ItemStack shaft_Material_4; //Iridium
-
- public static ItemStack blockRTG;
- public static ItemStack blockKineticGenerator;
-
- private static final String[] mData1 = new String[] {"itemEnergeticRotorBlade", "itemMagnaliumRotorBlade"};
- private static final String[] mData2 = new String[] {"itemEnergeticShaft", "itemMagnaliumShaft"};
- private static final String[] mData3 = new String[] {"itemVibrantRotorBlade", "itemUltimetRotorBlade"};
- private static final String[] mData4 = new String[] {"itemVibrantShaft", "itemUltimetShaft"};
-
-
- public static void register(){
-
- int aIndexEIO = (LoadedMods.EnderIO ? 0 : 1);
-
- // Rotor Blades
- rotor_Blade_Material_1 = new ItemStack (new CoreItem(mData1[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Blade_Material_3 = new ItemStack (new CoreItem(mData3[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
-
- // Rotor Shafts
- shaft_Material_1 = new ItemStack (new CoreItem(mData2[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_3 = new ItemStack (new CoreItem(mData4[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
-
- // Rotors
- rotor_Material_1 = new ItemStack (new CustomKineticRotor(0));
- rotor_Material_2 = new ItemStack (new CustomKineticRotor(1));
- rotor_Material_3 = new ItemStack (new CustomKineticRotor(2));
- rotor_Material_4 = new ItemStack (new CustomKineticRotor(3));
-
- ItemArmorHazmatEx.init();
-
- }
+ public static ItemStack rotor_Material_1; // Energetic Alloy
+ public static ItemStack rotor_Material_2; // TungstenSteel
+ public static ItemStack rotor_Material_3; // Vibrant Alloy
+ public static ItemStack rotor_Material_4; // Iridium
+
+ public static ItemStack rotor_Blade_Material_1;
+ public static ItemStack rotor_Blade_Material_2;
+ public static ItemStack rotor_Blade_Material_3;
+ public static ItemStack rotor_Blade_Material_4;
+
+ public static ItemStack shaft_Material_1; // Energetic Alloy
+ public static ItemStack shaft_Material_2; // TungstenSteel
+ public static ItemStack shaft_Material_3; // Vibrant Alloy
+ public static ItemStack shaft_Material_4; // Iridium
+
+ public static ItemStack blockRTG;
+ public static ItemStack blockKineticGenerator;
+
+ private static final String[] mData1 = new String[] {"itemEnergeticRotorBlade", "itemMagnaliumRotorBlade"};
+ private static final String[] mData2 = new String[] {"itemEnergeticShaft", "itemMagnaliumShaft"};
+ private static final String[] mData3 = new String[] {"itemVibrantRotorBlade", "itemUltimetRotorBlade"};
+ private static final String[] mData4 = new String[] {"itemVibrantShaft", "itemUltimetShaft"};
+
+ public static void register() {
+
+ int aIndexEIO = (LoadedMods.EnderIO ? 0 : 1);
+
+ // Rotor Blades
+ rotor_Blade_Material_1 = new ItemStack(new CoreItem(
+ mData1[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Blade_Material_2 = new ItemStack(new CoreItem(
+ "itemTungstenSteelRotorBlade",
+ AddToCreativeTab.tabMachines,
+ 16,
+ "A part for an advanced Kinetic Rotor"));
+ rotor_Blade_Material_3 = new ItemStack(new CoreItem(
+ mData3[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Blade_Material_4 = new ItemStack(new CoreItem(
+ "itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+
+ // Rotor Shafts
+ shaft_Material_1 = new ItemStack(new CoreItem(
+ mData2[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_2 = new ItemStack(new CoreItem(
+ "itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_3 = new ItemStack(new CoreItem(
+ mData4[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_4 = new ItemStack(new CoreItem(
+ "itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+
+ // Rotors
+ rotor_Material_1 = new ItemStack(new CustomKineticRotor(0));
+ rotor_Material_2 = new ItemStack(new CustomKineticRotor(1));
+ rotor_Material_3 = new ItemStack(new CustomKineticRotor(2));
+ rotor_Material_4 = new ItemStack(new CustomKineticRotor(3));
+
+ ItemArmorHazmatEx.init();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java b/src/main/java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java
index 0df2c8d7f1..c0b6fd5427 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java
@@ -1,55 +1,48 @@
package gtPlusPlus.xmod.ic2.item;
+import ic2.core.item.block.ItemBlockIC2;
import java.util.List;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-import ic2.core.item.block.ItemBlockIC2;
-
-public class ItemGenerators
-extends ItemBlockIC2
-{
- public ItemGenerators(final Block block)
- {
- super(block);
-
- this.setMaxDamage(0);
- this.setHasSubtypes(true);
- }
-
- @Override
- public int getMetadata(final int i)
- {
- return i;
- }
-
- @Override
- public String getUnlocalizedName(final ItemStack itemstack)
- {
- final int meta = itemstack.getItemDamage();
- switch (meta)
- {
- case 0:
- return "ic2.blockRTGenerator2";
- case 1:
- return "ic2.blockKineticGenerator2";
- }
- return null;
- }
-
- @Override
- public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b)
- {
- final int meta = itemStack.getItemDamage();
- switch (meta)
- {
- case 0:
- info.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerOutput") + " 1-32 EU/t " + StatCollector.translateToLocal("ic2.item.tooltip.max")); break;
- case 1:
- info.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerOutput") + " 1-512 EU/t " + StatCollector.translateToLocal("ic2.item.tooltip.max"));
- }
- }
+public class ItemGenerators extends ItemBlockIC2 {
+ public ItemGenerators(final Block block) {
+ super(block);
+
+ this.setMaxDamage(0);
+ this.setHasSubtypes(true);
+ }
+
+ @Override
+ public int getMetadata(final int i) {
+ return i;
+ }
+
+ @Override
+ public String getUnlocalizedName(final ItemStack itemstack) {
+ final int meta = itemstack.getItemDamage();
+ switch (meta) {
+ case 0:
+ return "ic2.blockRTGenerator2";
+ case 1:
+ return "ic2.blockKineticGenerator2";
+ }
+ return null;
+ }
+
+ @Override
+ public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
+ final int meta = itemStack.getItemDamage();
+ switch (meta) {
+ case 0:
+ info.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerOutput") + " 1-32 EU/t "
+ + StatCollector.translateToLocal("ic2.item.tooltip.max"));
+ break;
+ case 1:
+ info.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerOutput") + " 1-512 EU/t "
+ + StatCollector.translateToLocal("ic2.item.tooltip.max"));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/RotorBase.java b/src/main/java/gtPlusPlus/xmod/ic2/item/RotorBase.java
index b9f9ab68ef..4a3e1280c1 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/RotorBase.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/RotorBase.java
@@ -1,100 +1,97 @@
package gtPlusPlus.xmod.ic2.item;
+import ic2.api.item.IKineticRotor;
+import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator;
+import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
+import ic2.core.init.InternalName;
+import ic2.core.item.resources.ItemWindRotor;
import java.util.List;
-
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
-import ic2.api.item.IKineticRotor;
-import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator;
-import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
-import ic2.core.init.InternalName;
-import ic2.core.item.resources.ItemWindRotor;
-
-public class RotorBase extends ItemWindRotor{
-
- private final int maxWindStrength;
- private final int minWindStrength;
- private final int radius;
- private final float efficiency;
- private final ResourceLocation renderTexture;
- private final boolean water;
-
- public RotorBase(final InternalName internalName, final int Radius, final int durability, final float efficiency, final int minWindStrength, final int maxWindStrength, final ResourceLocation RenderTexture)
- {
- super(internalName, Radius, durability, efficiency, minWindStrength, maxWindStrength, RenderTexture);
-
-
-
- this.setMaxStackSize(1);
- this.setMaxDamage(durability);
-
- this.radius = Radius;
- this.efficiency = efficiency;
- this.renderTexture = RenderTexture;
- this.minWindStrength = minWindStrength;
- this.maxWindStrength = maxWindStrength;
- this.water = true;
- }
-
- @Override
- public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b)
- {
- info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[] { Integer.valueOf(this.minWindStrength), Integer.valueOf(this.maxWindStrength) }));
- IKineticRotor.GearboxType type = null;
- if ((Minecraft.getMinecraft().currentScreen != null) && ((Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator))) {
- type = IKineticRotor.GearboxType.WATER;
- } else if ((Minecraft.getMinecraft().currentScreen != null) && ((Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator))) {
- type = IKineticRotor.GearboxType.WIND;
- }
- if (type != null) {
- //info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + isAcceptedType(itemStack, type)));
- }
- }
-
- @Override
- public String getTextureFolder()
- {
- return "rotors";
- }
-
- @Override
- public int getDiameter(final ItemStack stack)
- {
- return this.radius;
- }
-
- @Override
- public ResourceLocation getRotorRenderTexture(final ItemStack stack)
- {
- return this.renderTexture;
- }
-
- @Override
- public float getEfficiency(final ItemStack stack)
- {
- return this.efficiency;
- }
-
- @Override
- public int getMinWindStrength(final ItemStack stack)
- {
- return this.minWindStrength;
- }
-
- @Override
- public int getMaxWindStrength(final ItemStack stack)
- {
- return this.maxWindStrength;
- }
-
- @Override
- public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type)
- {
- return (type == IKineticRotor.GearboxType.WIND) || (this.water);
- }
+public class RotorBase extends ItemWindRotor {
+
+ private final int maxWindStrength;
+ private final int minWindStrength;
+ private final int radius;
+ private final float efficiency;
+ private final ResourceLocation renderTexture;
+ private final boolean water;
+
+ public RotorBase(
+ final InternalName internalName,
+ final int Radius,
+ final int durability,
+ final float efficiency,
+ final int minWindStrength,
+ final int maxWindStrength,
+ final ResourceLocation RenderTexture) {
+ super(internalName, Radius, durability, efficiency, minWindStrength, maxWindStrength, RenderTexture);
+
+ this.setMaxStackSize(1);
+ this.setMaxDamage(durability);
+
+ this.radius = Radius;
+ this.efficiency = efficiency;
+ this.renderTexture = RenderTexture;
+ this.minWindStrength = minWindStrength;
+ this.maxWindStrength = maxWindStrength;
+ this.water = true;
+ }
+
+ @Override
+ public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
+ info.add(StatCollector.translateToLocalFormatted(
+ "ic2.itemrotor.wind.info",
+ new Object[] {Integer.valueOf(this.minWindStrength), Integer.valueOf(this.maxWindStrength)}));
+ IKineticRotor.GearboxType type = null;
+ if ((Minecraft.getMinecraft().currentScreen != null)
+ && ((Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator))) {
+ type = IKineticRotor.GearboxType.WATER;
+ } else if ((Minecraft.getMinecraft().currentScreen != null)
+ && ((Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator))) {
+ type = IKineticRotor.GearboxType.WIND;
+ }
+ if (type != null) {
+ // info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + isAcceptedType(itemStack, type)));
+ }
+ }
+
+ @Override
+ public String getTextureFolder() {
+ return "rotors";
+ }
+
+ @Override
+ public int getDiameter(final ItemStack stack) {
+ return this.radius;
+ }
+
+ @Override
+ public ResourceLocation getRotorRenderTexture(final ItemStack stack) {
+ return this.renderTexture;
+ }
+
+ @Override
+ public float getEfficiency(final ItemStack stack) {
+ return this.efficiency;
+ }
+
+ @Override
+ public int getMinWindStrength(final ItemStack stack) {
+ return this.minWindStrength;
+ }
+
+ @Override
+ public int getMaxWindStrength(final ItemStack stack) {
+ return this.maxWindStrength;
+ }
+
+ @Override
+ public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type) {
+ return (type == IKineticRotor.GearboxType.WIND) || (this.water);
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/RotorIridium.java b/src/main/java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
index b9dffbd371..46495fb965 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
@@ -1,7 +1,11 @@
package gtPlusPlus.xmod.ic2.item;
+import ic2.api.item.IKineticRotor;
+import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator;
+import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
+import ic2.core.init.InternalName;
+import ic2.core.util.StackUtil;
import java.util.List;
-
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -10,118 +14,108 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
-import ic2.api.item.IKineticRotor;
-import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator;
-import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
-import ic2.core.init.InternalName;
-import ic2.core.util.StackUtil;
-
-public class RotorIridium extends RotorBase{
-
- private final int maxWindStrength;
- private final int minWindStrength;
- private final int radius;
- private final float efficiency;
- private final ResourceLocation renderTexture;
- private final boolean water;
-
- public RotorIridium(final InternalName internalName, final int Radius, final int durability, final float efficiency, final int minWindStrength, final int maxWindStrength, final ResourceLocation RenderTexture)
- {
- super(internalName, Radius, durability, efficiency, minWindStrength, maxWindStrength, RenderTexture);
-
-
-
- this.setMaxStackSize(1);
- this.setMaxDamage(Integer.MAX_VALUE);
-
- this.radius = Radius;
- this.efficiency = efficiency;
- this.renderTexture = RenderTexture;
- this.minWindStrength = minWindStrength;
- this.maxWindStrength = maxWindStrength;
- this.water = (internalName != InternalName.itemwoodrotor);
- }
-
- @Override
- public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b)
- {
- info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[] { Integer.valueOf(this.minWindStrength), Integer.valueOf(this.maxWindStrength) }));
- IKineticRotor.GearboxType type = null;
- if ((Minecraft.getMinecraft().currentScreen != null) && ((Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator))) {
- type = IKineticRotor.GearboxType.WATER;
- } else if ((Minecraft.getMinecraft().currentScreen != null) && ((Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator))) {
- type = IKineticRotor.GearboxType.WIND;
- }
- if (type != null) {
- //info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + isAcceptedType(itemStack, type)));
- }
- }
-
- @Override
- public String getTextureFolder()
- {
- return "rotors";
- }
-
- @Override
- public int getDiameter(final ItemStack stack)
- {
- return this.radius;
- }
-
- @Override
- public ResourceLocation getRotorRenderTexture(final ItemStack stack)
- {
- return this.renderTexture;
- }
-
- @Override
- public float getEfficiency(final ItemStack stack)
- {
- return this.efficiency;
- }
-
- @Override
- public int getMinWindStrength(final ItemStack stack)
- {
- return this.minWindStrength;
- }
-
- @Override
- public int getMaxWindStrength(final ItemStack stack)
- {
- return this.maxWindStrength;
- }
-
- @Override
- public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type)
- {
- return (type == IKineticRotor.GearboxType.WIND) || (this.water);
- }
-
-
- @Override
- public void setCustomDamage(final ItemStack stack, final int damage)
- {
- final NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
- nbt.setInteger("advDmg", 0);
-
- final int maxStackDamage = stack.getMaxDamage();
- if (maxStackDamage > 2) {
- //stack.setItemDamage(1 + (int)Util.map(damage, this.maxDmg, maxStackDamage - 2));
- }
- }
-
- @Override
- public boolean applyCustomDamage(final ItemStack stack, final int damage, final EntityLivingBase src)
- {
- this.setCustomDamage(stack, this.getCustomDamage(stack) + damage);
- return true;
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
+public class RotorIridium extends RotorBase {
+
+ private final int maxWindStrength;
+ private final int minWindStrength;
+ private final int radius;
+ private final float efficiency;
+ private final ResourceLocation renderTexture;
+ private final boolean water;
+
+ public RotorIridium(
+ final InternalName internalName,
+ final int Radius,
+ final int durability,
+ final float efficiency,
+ final int minWindStrength,
+ final int maxWindStrength,
+ final ResourceLocation RenderTexture) {
+ super(internalName, Radius, durability, efficiency, minWindStrength, maxWindStrength, RenderTexture);
+
+ this.setMaxStackSize(1);
+ this.setMaxDamage(Integer.MAX_VALUE);
+
+ this.radius = Radius;
+ this.efficiency = efficiency;
+ this.renderTexture = RenderTexture;
+ this.minWindStrength = minWindStrength;
+ this.maxWindStrength = maxWindStrength;
+ this.water = (internalName != InternalName.itemwoodrotor);
+ }
+
+ @Override
+ public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
+ info.add(StatCollector.translateToLocalFormatted(
+ "ic2.itemrotor.wind.info",
+ new Object[] {Integer.valueOf(this.minWindStrength), Integer.valueOf(this.maxWindStrength)}));
+ IKineticRotor.GearboxType type = null;
+ if ((Minecraft.getMinecraft().currentScreen != null)
+ && ((Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator))) {
+ type = IKineticRotor.GearboxType.WATER;
+ } else if ((Minecraft.getMinecraft().currentScreen != null)
+ && ((Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator))) {
+ type = IKineticRotor.GearboxType.WIND;
+ }
+ if (type != null) {
+ // info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + isAcceptedType(itemStack, type)));
+ }
+ }
+
+ @Override
+ public String getTextureFolder() {
+ return "rotors";
+ }
+
+ @Override
+ public int getDiameter(final ItemStack stack) {
+ return this.radius;
+ }
+
+ @Override
+ public ResourceLocation getRotorRenderTexture(final ItemStack stack) {
+ return this.renderTexture;
+ }
+
+ @Override
+ public float getEfficiency(final ItemStack stack) {
+ return this.efficiency;
+ }
+
+ @Override
+ public int getMinWindStrength(final ItemStack stack) {
+ return this.minWindStrength;
+ }
+
+ @Override
+ public int getMaxWindStrength(final ItemStack stack) {
+ return this.maxWindStrength;
+ }
+
+ @Override
+ public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type) {
+ return (type == IKineticRotor.GearboxType.WIND) || (this.water);
+ }
+
+ @Override
+ public void setCustomDamage(final ItemStack stack, final int damage) {
+ final NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
+ nbt.setInteger("advDmg", 0);
+
+ final int maxStackDamage = stack.getMaxDamage();
+ if (maxStackDamage > 2) {
+ // stack.setItemDamage(1 + (int)Util.map(damage, this.maxDmg, maxStackDamage - 2));
+ }
+ }
+
+ @Override
+ public boolean applyCustomDamage(final ItemStack stack, final int damage, final EntityLivingBase src) {
+ this.setCustomDamage(stack, this.getCustomDamage(stack) + damage);
+ return true;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/item/reactor/IC2_FuelRod_Base.java b/src/main/java/gtPlusPlus/xmod/ic2/item/reactor/IC2_FuelRod_Base.java
index 01151024c4..f8d9a6eaa5 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/item/reactor/IC2_FuelRod_Base.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/item/reactor/IC2_FuelRod_Base.java
@@ -6,47 +6,46 @@ import net.minecraft.item.ItemStack;
public class IC2_FuelRod_Base implements IReactorComponent {
- @Override
- public void processChamber(IReactor var1, ItemStack var2, int var3, int var4, boolean var5) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean acceptUraniumPulse(IReactor var1, ItemStack var2, ItemStack var3, int var4, int var5, int var6,
- int var7, boolean var8) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean canStoreHeat(IReactor var1, ItemStack var2, int var3, int var4) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public int getMaxHeat(IReactor var1, ItemStack var2, int var3, int var4) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public int getCurrentHeat(IReactor var1, ItemStack var2, int var3, int var4) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public int alterHeat(IReactor var1, ItemStack var2, int var3, int var4, int var5) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public float influenceExplosion(IReactor var1, ItemStack var2) {
- // TODO Auto-generated method stub
- return 0;
- }
-
+ @Override
+ public void processChamber(IReactor var1, ItemStack var2, int var3, int var4, boolean var5) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean acceptUraniumPulse(
+ IReactor var1, ItemStack var2, ItemStack var3, int var4, int var5, int var6, int var7, boolean var8) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean canStoreHeat(IReactor var1, ItemStack var2, int var3, int var4) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public int getMaxHeat(IReactor var1, ItemStack var2, int var3, int var4) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getCurrentHeat(IReactor var1, ItemStack var2, int var3, int var4) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int alterHeat(IReactor var1, ItemStack var2, int var3, int var4, int var5) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public float influenceExplosion(IReactor var1, ItemStack var2) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java b/src/main/java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java
index 1b090cc51a..c7555d4fc1 100644
--- a/src/main/java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java
+++ b/src/main/java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java
@@ -2,14 +2,10 @@ package gtPlusPlus.xmod.ic2.recipe;
import static gtPlusPlus.core.recipe.RECIPES_Tools.*;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.*;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
@@ -22,305 +18,508 @@ import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.ic2.item.IC2_Items;
import ic2.core.Ic2Items;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
public class RECIPE_IC2 {
- public static String plate_T1 = "plateEnergeticAlloy";
- public static String plate_T2 = "plateTungstenSteel";
- public static String plate_T3 = "plateVibrantAlloy";
- public static String plate_T4 = "plateAlloyIridium";
-
- public static ItemStack block_T1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.EnergeticAlloy, 1L);
- public static ItemStack block_T2 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.TungstenSteel, 1L);
- public static ItemStack block_T3 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.VibrantAlloy, 1L);
- public static ItemStack block_T4 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iridium, 1L);
-
- public static ItemStack shaft_block_T1 = GT_OreDictUnificator.get(OrePrefixes.block, Materials.EnergeticAlloy, 1L);
- public static ItemStack shaft_block_T2 = GT_OreDictUnificator.get(OrePrefixes.block, Materials.TungstenSteel, 1L);
- public static ItemStack shaft_block_T3 = GT_OreDictUnificator.get(OrePrefixes.block, Materials.VibrantAlloy, 1L);
- public static ItemStack shaft_block_T4 = GT_OreDictUnificator.get(OrePrefixes.block, Materials.Iridium, 1L);
-
- public static String ingot_T1 = "ingotEnergeticAlloy";
- public static String ingot_T2 = "ingotTungstenSteel";
- public static String ingot_T3 = "ingotVibrantAlloy";
- public static String ingot_T4 = "ingotIridium";
-
- public static String ring_T1 = "ringStainlessSteel";
- public static String ring_T2 = "ringTungstenSteel";
- public static String ring_T3 = "ringChrome";
- public static String ring_T4 = "ringOsmiridium";
-
-
- private static ItemStack rotor_blade_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_1.getItem());
- private static ItemStack rotor_blade_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_2.getItem());
- private static ItemStack rotor_blade_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_3.getItem());
- private static ItemStack rotor_blade_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_4.getItem());
-
- private static ItemStack shaft_T1 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_1.getItem());
- private static ItemStack shaft_T2 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_2.getItem());
- private static ItemStack shaft_T3 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_3.getItem());
- private static ItemStack shaft_T4 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_4.getItem());
-
- private static ItemStack rotor_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_1.getItem());
- private static ItemStack rotor_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_2.getItem());
- private static ItemStack rotor_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_3.getItem());
- private static ItemStack rotor_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_4.getItem());
-
- private static boolean checkForEnderIO(){
- if(!LoadedMods.EnderIO){
- plate_T1 = "plateMagnalium";
- plate_T2 = "plateTungstenSteel";
- plate_T3 = "plateUltimet";
- plate_T4 = "plateAlloyIridium";
-
- block_T1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Magnalium, 1L);
- block_T2 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.TungstenSteel, 1L);
- block_T3 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Ultimet, 1L);
- block_T4 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iridium, 1L);
-
- ingot_T1 = "ingotMagnalium";
- ingot_T2 = "ingotTungstenSteel";
- ingot_T3 = "ingotUltimet";
- ingot_T4 = "ingotIridium";
- return true;
- }
- return false;
- }
-
- public static void initRecipes() {
-
- checkForEnderIO();
- addAdvancedHazmat();
-
- if (!CORE.GTNH) {
- //Rotor Blade Recipes
-
- RecipeUtils.addShapedRecipe(
- plate_T1, ingot_T1, plate_T1,
- plate_T1, ingot_T1, plate_T1,
- plate_T1, ingot_T1, plate_T1,
- rotor_blade_T1);
-
- RecipeUtils.addShapedRecipe(
- plate_T2, ingot_T2, plate_T2,
- plate_T2, ingot_T2, plate_T2,
- plate_T2, ingot_T2, plate_T2,
- rotor_blade_T2);
-
- RecipeUtils.addShapedRecipe(
- plate_T3, ingot_T3, plate_T3,
- plate_T3, ingot_T3, plate_T3,
- plate_T3, ingot_T3, plate_T3,
- rotor_blade_T3);
-
- RecipeUtils.addShapedRecipe(
- plate_T4, ingot_T4, plate_T4,
- plate_T4, ingot_T4, plate_T4,
- plate_T4, ingot_T4, plate_T4,
- rotor_blade_T4);
- }
- if (CORE.GTNH) {
-
- RecipeUtils.addShapedRecipe(
- plate_T1, plate_T1, plate_T1,
- plate_T1, ring_T1, plate_T1,
- plate_T1, plate_T1, plate_T1,
- rotor_blade_T1);
-
- RecipeUtils.addShapedRecipe(
- plate_T2, plate_T2, plate_T2,
- plate_T2, ring_T2, plate_T2,
- plate_T2, plate_T2, plate_T2,
- rotor_blade_T2);
-
- RecipeUtils.addShapedRecipe(
- plate_T3, plate_T3, plate_T3,
- plate_T3, ring_T3, plate_T3,
- plate_T3, plate_T3, plate_T3,
- rotor_blade_T3);
-
- RecipeUtils.addShapedRecipe(
- plate_T4, plate_T4, plate_T4,
- plate_T4, ring_T4, plate_T4,
- plate_T4, plate_T4, plate_T4,
- rotor_blade_T4);
-
- }
-
- //Shaft Extruder Recipe
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod, Character.valueOf('X'), OrePrefixes.plate.get(Materials.DarkSteel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.DarkSteel)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod, Character.valueOf('X'), OrePrefixes.plate.get(Materials.TungstenSteel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.TungstenSteel)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod, Character.valueOf('X'), OrePrefixes.plate.get(Materials.Molybdenum), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Molybdenum)});
- Logger.INFO("Added recipe item for GT5 Extruder: Shaft Shape");
-
-
- //Custm Recipes for Iron and Steel
- ItemStack mShaftIron = ItemList.IC2_ShaftIron.get(1);
- ItemStack mShaftSteel = ItemList.IC2_ShaftSteel.get(1);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iron, 1L)), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), mShaftIron, 32*20, 120);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(1L, GT_OreDictUnificator.get(OrePrefixes.block, Materials.Iron, 1L)), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), mShaftIron, 32*20, 120);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.WroughtIron, 1L)), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), mShaftIron, 32*20, 120);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(1L, GT_OreDictUnificator.get(OrePrefixes.block, Materials.WroughtIron, 1L)), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), mShaftIron, 32*20, 120);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L)), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), mShaftSteel, 64*20, 120);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(1L, GT_OreDictUnificator.get(OrePrefixes.block, Materials.Steel, 1L)), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), mShaftSteel, 64*20, 120);
-
-
- //Shaft Recipes
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, block_T1), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T1, 2560, 250);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(1L, shaft_block_T1), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T1, 2560, 250);
- if (LoadedMods.EnderIO || CORE.GTNH) {
- Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Energetic]");
- } else {
- Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Magnalium]");
- }
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, block_T2), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T2, 5120, 500);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(1L, shaft_block_T2), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T2, 5120, 500);
-
- Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [TungstenSteel]");
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, block_T3), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T3, 10240, 2000);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(1L, shaft_block_T3), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T3, 10240, 2000);
- if (LoadedMods.EnderIO || CORE.GTNH) {
- Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Vibrant]");
- } else {
- Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Ultimet]");
- }
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, block_T4), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T4, 20480, 4000);
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(1L, shaft_block_T4), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T4, 20480, 4000);
- Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Iridium]");
-
- if (!CORE.GTNH) {
- //Rotor Recipes
- RecipeUtils.addShapedRecipe(
- null, rotor_blade_T1, null,
- rotor_blade_T1, shaft_T1, rotor_blade_T1,
- null, rotor_blade_T1, null,
- rotor_T1);
-
- RecipeUtils.addShapedRecipe(
- null, rotor_blade_T2, null,
- rotor_blade_T2, shaft_T2, rotor_blade_T2,
- null, rotor_blade_T2, null,
- rotor_T2);
-
- RecipeUtils.addShapedRecipe(
- null, rotor_blade_T3, null,
- rotor_blade_T3, shaft_T3, rotor_blade_T3,
- null, rotor_blade_T3, null,
- rotor_T3);
-
- RecipeUtils.addShapedRecipe(
- null, rotor_blade_T4, null,
- rotor_blade_T4, shaft_T4, rotor_blade_T4,
- null, rotor_blade_T4, null,
- rotor_T4);
-
- }
- if (CORE.GTNH) {
- RecipeUtils.addShapedRecipe(
- shaft_T1, rotor_blade_T1, craftingToolHardHammer,
- rotor_blade_T1, ring_T1, rotor_blade_T1,
- craftingToolWrench, rotor_blade_T1, shaft_T1,
- rotor_T1);
-
- RecipeUtils.addShapedRecipe(
- shaft_T2, rotor_blade_T2, craftingToolHardHammer,
- rotor_blade_T2, ring_T2, rotor_blade_T2,
- craftingToolWrench, rotor_blade_T2, shaft_T2,
- rotor_T2);
-
- RecipeUtils.addShapedRecipe(
- shaft_T3, rotor_blade_T3, craftingToolHardHammer,
- rotor_blade_T3, ring_T3, rotor_blade_T3,
- craftingToolWrench, rotor_blade_T3, shaft_T3,
- rotor_T3);
-
- RecipeUtils.addShapedRecipe(
- shaft_T4, rotor_blade_T4, craftingToolHardHammer,
- rotor_blade_T4, ring_T4, rotor_blade_T4,
- craftingToolWrench, rotor_blade_T4, shaft_T4,
- rotor_T4);
- }
-
-
- }
-
- private static void addAdvancedHazmat() {
-
- ItemStack[] aBasicHazmatPieces = new ItemStack[] {
- Ic2Items.hazmatHelmet.copy(),
- Ic2Items.hazmatChestplate.copy(),
- Ic2Items.hazmatLeggings.copy(),
- Ic2Items.hazmatBoots.copy()
- };
-
- Material aRubber = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubber);
- ItemStack aYellowWool = ItemUtils.getSimpleStack(Blocks.wool, 4, 1);
- ItemStack aBlackWool = ItemUtils.getSimpleStack(Blocks.wool, 15, 1);
- ItemStack aCoilIC2 = Ic2Items.coil;
- ItemStack aPlateCobalt = CI.getTieredComponentOfMaterial(Materials.Cobalt, OrePrefixes.plate, 1);
- ItemStack aGearSmallSteel = CI.getTieredComponentOfMaterial(Materials.Steel, OrePrefixes.gearGtSmall, 1);
- ItemStack aGearSmallAluminium = CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.gearGtSmall, 1);
- ItemStack aGearPotin = ALLOY.TUMBAGA.getGear(1);
- ItemStack aGearSiliconCarbide = ALLOY.SILICON_CARBIDE.getGear(1);
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(2),
- aBasicHazmatPieces[0],
- ItemUtils.getSimpleStack(aYellowWool,16),
- ItemUtils.getSimpleStack(aPlateCobalt, 4),
- ItemUtils.getSimpleStack(aCoilIC2, 8),
- ItemUtils.getSimpleStack(aGearSmallAluminium, 4),
- },
- aRubber.getFluidStack(144 * 4),
- GregtechItemList.Armour_Hazmat_Advanced_Helmet.get(1),
- 30 * 20,
- MaterialUtils.getVoltageForTier(2));
-
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(2),
- aBasicHazmatPieces[1],
- ItemUtils.getSimpleStack(aYellowWool, 64),
- ItemUtils.getSimpleStack(aCoilIC2, 32),
- ItemUtils.getSimpleStack(aPlateCobalt, 16),
- ItemUtils.getSimpleStack(aGearSiliconCarbide, 8),
- },
- aRubber.getFluidStack(144 * 10),
- GregtechItemList.Armour_Hazmat_Advanced_Chest.get(1),
- 90 * 20,
- MaterialUtils.getVoltageForTier(2));
-
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(2),
- aBasicHazmatPieces[2],
- ItemUtils.getSimpleStack(aYellowWool, 32),
- ItemUtils.getSimpleStack(aCoilIC2, 16),
- ItemUtils.getSimpleStack(aPlateCobalt, 8),
- ItemUtils.getSimpleStack(aGearSiliconCarbide, 4),
- },
- aRubber.getFluidStack(144 * 8),
- GregtechItemList.Armour_Hazmat_Advanced_Legs.get(1),
- 75 * 20,
- MaterialUtils.getVoltageForTier(2));
-
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] {
- CI.getNumberedAdvancedCircuit(2),
- aBasicHazmatPieces[3],
- ItemUtils.getSimpleStack(aBlackWool, 16),
- ItemUtils.getSimpleStack(aCoilIC2, 6),
- ItemUtils.getSimpleStack(aGearSmallSteel, 8),
- ItemUtils.getSimpleStack(aGearPotin, 4),
- },
- aRubber.getFluidStack(144 * 6),
- GregtechItemList.Armour_Hazmat_Advanced_Boots.get(1),
- 45 * 20,
- MaterialUtils.getVoltageForTier(2));
-
- }
+ public static String plate_T1 = "plateEnergeticAlloy";
+ public static String plate_T2 = "plateTungstenSteel";
+ public static String plate_T3 = "plateVibrantAlloy";
+ public static String plate_T4 = "plateAlloyIridium";
+
+ public static ItemStack block_T1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.EnergeticAlloy, 1L);
+ public static ItemStack block_T2 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.TungstenSteel, 1L);
+ public static ItemStack block_T3 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.VibrantAlloy, 1L);
+ public static ItemStack block_T4 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iridium, 1L);
+
+ public static ItemStack shaft_block_T1 = GT_OreDictUnificator.get(OrePrefixes.block, Materials.EnergeticAlloy, 1L);
+ public static ItemStack shaft_block_T2 = GT_OreDictUnificator.get(OrePrefixes.block, Materials.TungstenSteel, 1L);
+ public static ItemStack shaft_block_T3 = GT_OreDictUnificator.get(OrePrefixes.block, Materials.VibrantAlloy, 1L);
+ public static ItemStack shaft_block_T4 = GT_OreDictUnificator.get(OrePrefixes.block, Materials.Iridium, 1L);
+
+ public static String ingot_T1 = "ingotEnergeticAlloy";
+ public static String ingot_T2 = "ingotTungstenSteel";
+ public static String ingot_T3 = "ingotVibrantAlloy";
+ public static String ingot_T4 = "ingotIridium";
+
+ public static String ring_T1 = "ringStainlessSteel";
+ public static String ring_T2 = "ringTungstenSteel";
+ public static String ring_T3 = "ringChrome";
+ public static String ring_T4 = "ringOsmiridium";
+
+ private static ItemStack rotor_blade_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_1.getItem());
+ private static ItemStack rotor_blade_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_2.getItem());
+ private static ItemStack rotor_blade_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_3.getItem());
+ private static ItemStack rotor_blade_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_4.getItem());
+
+ private static ItemStack shaft_T1 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_1.getItem());
+ private static ItemStack shaft_T2 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_2.getItem());
+ private static ItemStack shaft_T3 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_3.getItem());
+ private static ItemStack shaft_T4 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_4.getItem());
+
+ private static ItemStack rotor_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_1.getItem());
+ private static ItemStack rotor_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_2.getItem());
+ private static ItemStack rotor_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_3.getItem());
+ private static ItemStack rotor_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_4.getItem());
+
+ private static boolean checkForEnderIO() {
+ if (!LoadedMods.EnderIO) {
+ plate_T1 = "plateMagnalium";
+ plate_T2 = "plateTungstenSteel";
+ plate_T3 = "plateUltimet";
+ plate_T4 = "plateAlloyIridium";
+
+ block_T1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Magnalium, 1L);
+ block_T2 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.TungstenSteel, 1L);
+ block_T3 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Ultimet, 1L);
+ block_T4 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iridium, 1L);
+
+ ingot_T1 = "ingotMagnalium";
+ ingot_T2 = "ingotTungstenSteel";
+ ingot_T3 = "ingotUltimet";
+ ingot_T4 = "ingotIridium";
+ return true;
+ }
+ return false;
+ }
+
+ public static void initRecipes() {
+
+ checkForEnderIO();
+ addAdvancedHazmat();
+
+ if (!CORE.GTNH) {
+ // Rotor Blade Recipes
+
+ RecipeUtils.addShapedRecipe(
+ plate_T1,
+ ingot_T1,
+ plate_T1,
+ plate_T1,
+ ingot_T1,
+ plate_T1,
+ plate_T1,
+ ingot_T1,
+ plate_T1,
+ rotor_blade_T1);
+
+ RecipeUtils.addShapedRecipe(
+ plate_T2,
+ ingot_T2,
+ plate_T2,
+ plate_T2,
+ ingot_T2,
+ plate_T2,
+ plate_T2,
+ ingot_T2,
+ plate_T2,
+ rotor_blade_T2);
+
+ RecipeUtils.addShapedRecipe(
+ plate_T3,
+ ingot_T3,
+ plate_T3,
+ plate_T3,
+ ingot_T3,
+ plate_T3,
+ plate_T3,
+ ingot_T3,
+ plate_T3,
+ rotor_blade_T3);
+
+ RecipeUtils.addShapedRecipe(
+ plate_T4,
+ ingot_T4,
+ plate_T4,
+ plate_T4,
+ ingot_T4,
+ plate_T4,
+ plate_T4,
+ ingot_T4,
+ plate_T4,
+ rotor_blade_T4);
+ }
+ if (CORE.GTNH) {
+
+ RecipeUtils.addShapedRecipe(
+ plate_T1,
+ plate_T1,
+ plate_T1,
+ plate_T1,
+ ring_T1,
+ plate_T1,
+ plate_T1,
+ plate_T1,
+ plate_T1,
+ rotor_blade_T1);
+
+ RecipeUtils.addShapedRecipe(
+ plate_T2,
+ plate_T2,
+ plate_T2,
+ plate_T2,
+ ring_T2,
+ plate_T2,
+ plate_T2,
+ plate_T2,
+ plate_T2,
+ rotor_blade_T2);
+
+ RecipeUtils.addShapedRecipe(
+ plate_T3,
+ plate_T3,
+ plate_T3,
+ plate_T3,
+ ring_T3,
+ plate_T3,
+ plate_T3,
+ plate_T3,
+ plate_T3,
+ rotor_blade_T3);
+
+ RecipeUtils.addShapedRecipe(
+ plate_T4,
+ plate_T4,
+ plate_T4,
+ plate_T4,
+ ring_T4,
+ plate_T4,
+ plate_T4,
+ plate_T4,
+ plate_T4,
+ rotor_blade_T4);
+ }
+
+ // Shaft Extruder Recipe
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.BUFFERED
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE,
+ new Object[] {
+ "hXS",
+ "XPX",
+ "fXd",
+ Character.valueOf('P'),
+ ItemList.Shape_Extruder_Rod,
+ Character.valueOf('X'),
+ OrePrefixes.plate.get(Materials.DarkSteel),
+ Character.valueOf('S'),
+ OrePrefixes.screw.get(Materials.DarkSteel)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.BUFFERED
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE,
+ new Object[] {
+ "hXS",
+ "XPX",
+ "fXd",
+ Character.valueOf('P'),
+ ItemList.Shape_Extruder_Rod,
+ Character.valueOf('X'),
+ OrePrefixes.plate.get(Materials.TungstenSteel),
+ Character.valueOf('S'),
+ OrePrefixes.screw.get(Materials.TungstenSteel)
+ });
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.BUFFERED
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE,
+ new Object[] {
+ "hXS",
+ "XPX",
+ "fXd",
+ Character.valueOf('P'),
+ ItemList.Shape_Extruder_Rod,
+ Character.valueOf('X'),
+ OrePrefixes.plate.get(Materials.Molybdenum),
+ Character.valueOf('S'),
+ OrePrefixes.screw.get(Materials.Molybdenum)
+ });
+ Logger.INFO("Added recipe item for GT5 Extruder: Shaft Shape");
+
+ // Custm Recipes for Iron and Steel
+ ItemStack mShaftIron = ItemList.IC2_ShaftIron.get(1);
+ ItemStack mShaftSteel = ItemList.IC2_ShaftSteel.get(1);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(9L, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iron, 1L)),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ mShaftIron,
+ 32 * 20,
+ 120);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(1L, GT_OreDictUnificator.get(OrePrefixes.block, Materials.Iron, 1L)),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ mShaftIron,
+ 32 * 20,
+ 120);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(9L, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.WroughtIron, 1L)),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ mShaftIron,
+ 32 * 20,
+ 120);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(1L, GT_OreDictUnificator.get(OrePrefixes.block, Materials.WroughtIron, 1L)),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ mShaftIron,
+ 32 * 20,
+ 120);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(9L, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L)),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ mShaftSteel,
+ 64 * 20,
+ 120);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(1L, GT_OreDictUnificator.get(OrePrefixes.block, Materials.Steel, 1L)),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ mShaftSteel,
+ 64 * 20,
+ 120);
+
+ // Shaft Recipes
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(9L, block_T1),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ shaft_T1,
+ 2560,
+ 250);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(1L, shaft_block_T1),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ shaft_T1,
+ 2560,
+ 250);
+ if (LoadedMods.EnderIO || CORE.GTNH) {
+ Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Energetic]");
+ } else {
+ Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Magnalium]");
+ }
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(9L, block_T2),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ shaft_T2,
+ 5120,
+ 500);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(1L, shaft_block_T2),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ shaft_T2,
+ 5120,
+ 500);
+
+ Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [TungstenSteel]");
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(9L, block_T3),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ shaft_T3,
+ 10240,
+ 2000);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(1L, shaft_block_T3),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ shaft_T3,
+ 10240,
+ 2000);
+ if (LoadedMods.EnderIO || CORE.GTNH) {
+ Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Vibrant]");
+ } else {
+ Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Ultimet]");
+ }
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(9L, block_T4),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ shaft_T4,
+ 20480,
+ 4000);
+ GT_Values.RA.addExtruderRecipe(
+ GT_Utility.copyAmount(1L, shaft_block_T4),
+ GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]),
+ shaft_T4,
+ 20480,
+ 4000);
+ Logger.INFO("Added recipe for GT5 Extruder: Windmill Shaft [Iridium]");
+
+ if (!CORE.GTNH) {
+ // Rotor Recipes
+ RecipeUtils.addShapedRecipe(
+ null,
+ rotor_blade_T1,
+ null,
+ rotor_blade_T1,
+ shaft_T1,
+ rotor_blade_T1,
+ null,
+ rotor_blade_T1,
+ null,
+ rotor_T1);
+
+ RecipeUtils.addShapedRecipe(
+ null,
+ rotor_blade_T2,
+ null,
+ rotor_blade_T2,
+ shaft_T2,
+ rotor_blade_T2,
+ null,
+ rotor_blade_T2,
+ null,
+ rotor_T2);
+
+ RecipeUtils.addShapedRecipe(
+ null,
+ rotor_blade_T3,
+ null,
+ rotor_blade_T3,
+ shaft_T3,
+ rotor_blade_T3,
+ null,
+ rotor_blade_T3,
+ null,
+ rotor_T3);
+
+ RecipeUtils.addShapedRecipe(
+ null,
+ rotor_blade_T4,
+ null,
+ rotor_blade_T4,
+ shaft_T4,
+ rotor_blade_T4,
+ null,
+ rotor_blade_T4,
+ null,
+ rotor_T4);
+ }
+ if (CORE.GTNH) {
+ RecipeUtils.addShapedRecipe(
+ shaft_T1,
+ rotor_blade_T1,
+ craftingToolHardHammer,
+ rotor_blade_T1,
+ ring_T1,
+ rotor_blade_T1,
+ craftingToolWrench,
+ rotor_blade_T1,
+ shaft_T1,
+ rotor_T1);
+
+ RecipeUtils.addShapedRecipe(
+ shaft_T2,
+ rotor_blade_T2,
+ craftingToolHardHammer,
+ rotor_blade_T2,
+ ring_T2,
+ rotor_blade_T2,
+ craftingToolWrench,
+ rotor_blade_T2,
+ shaft_T2,
+ rotor_T2);
+
+ RecipeUtils.addShapedRecipe(
+ shaft_T3,
+ rotor_blade_T3,
+ craftingToolHardHammer,
+ rotor_blade_T3,
+ ring_T3,
+ rotor_blade_T3,
+ craftingToolWrench,
+ rotor_blade_T3,
+ shaft_T3,
+ rotor_T3);
+
+ RecipeUtils.addShapedRecipe(
+ shaft_T4,
+ rotor_blade_T4,
+ craftingToolHardHammer,
+ rotor_blade_T4,
+ ring_T4,
+ rotor_blade_T4,
+ craftingToolWrench,
+ rotor_blade_T4,
+ shaft_T4,
+ rotor_T4);
+ }
+ }
+
+ private static void addAdvancedHazmat() {
+
+ ItemStack[] aBasicHazmatPieces = new ItemStack[] {
+ Ic2Items.hazmatHelmet.copy(),
+ Ic2Items.hazmatChestplate.copy(),
+ Ic2Items.hazmatLeggings.copy(),
+ Ic2Items.hazmatBoots.copy()
+ };
+
+ Material aRubber = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubber);
+ ItemStack aYellowWool = ItemUtils.getSimpleStack(Blocks.wool, 4, 1);
+ ItemStack aBlackWool = ItemUtils.getSimpleStack(Blocks.wool, 15, 1);
+ ItemStack aCoilIC2 = Ic2Items.coil;
+ ItemStack aPlateCobalt = CI.getTieredComponentOfMaterial(Materials.Cobalt, OrePrefixes.plate, 1);
+ ItemStack aGearSmallSteel = CI.getTieredComponentOfMaterial(Materials.Steel, OrePrefixes.gearGtSmall, 1);
+ ItemStack aGearSmallAluminium =
+ CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.gearGtSmall, 1);
+ ItemStack aGearPotin = ALLOY.TUMBAGA.getGear(1);
+ ItemStack aGearSiliconCarbide = ALLOY.SILICON_CARBIDE.getGear(1);
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(2),
+ aBasicHazmatPieces[0],
+ ItemUtils.getSimpleStack(aYellowWool, 16),
+ ItemUtils.getSimpleStack(aPlateCobalt, 4),
+ ItemUtils.getSimpleStack(aCoilIC2, 8),
+ ItemUtils.getSimpleStack(aGearSmallAluminium, 4),
+ },
+ aRubber.getFluidStack(144 * 4),
+ GregtechItemList.Armour_Hazmat_Advanced_Helmet.get(1),
+ 30 * 20,
+ MaterialUtils.getVoltageForTier(2));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(2),
+ aBasicHazmatPieces[1],
+ ItemUtils.getSimpleStack(aYellowWool, 64),
+ ItemUtils.getSimpleStack(aCoilIC2, 32),
+ ItemUtils.getSimpleStack(aPlateCobalt, 16),
+ ItemUtils.getSimpleStack(aGearSiliconCarbide, 8),
+ },
+ aRubber.getFluidStack(144 * 10),
+ GregtechItemList.Armour_Hazmat_Advanced_Chest.get(1),
+ 90 * 20,
+ MaterialUtils.getVoltageForTier(2));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(2),
+ aBasicHazmatPieces[2],
+ ItemUtils.getSimpleStack(aYellowWool, 32),
+ ItemUtils.getSimpleStack(aCoilIC2, 16),
+ ItemUtils.getSimpleStack(aPlateCobalt, 8),
+ ItemUtils.getSimpleStack(aGearSiliconCarbide, 4),
+ },
+ aRubber.getFluidStack(144 * 8),
+ GregtechItemList.Armour_Hazmat_Advanced_Legs.get(1),
+ 75 * 20,
+ MaterialUtils.getVoltageForTier(2));
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(2),
+ aBasicHazmatPieces[3],
+ ItemUtils.getSimpleStack(aBlackWool, 16),
+ ItemUtils.getSimpleStack(aCoilIC2, 6),
+ ItemUtils.getSimpleStack(aGearSmallSteel, 8),
+ ItemUtils.getSimpleStack(aGearPotin, 4),
+ },
+ aRubber.getFluidStack(144 * 6),
+ GregtechItemList.Armour_Hazmat_Advanced_Boots.get(1),
+ 45 * 20,
+ MaterialUtils.getVoltageForTier(2));
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java b/src/main/java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java
index 9073f2ec7f..a2b2c83de0 100644
--- a/src/main/java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java
+++ b/src/main/java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java
@@ -1,277 +1,412 @@
package gtPlusPlus.xmod.mekanism;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.util.GT_ModHandler;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.NBTUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
public class HANDLER_Mekanism {
- public static void preInit(){
- if (LoadedMods.Mekanism){
-
- }
- }
-
- public static void init(){
- if (LoadedMods.Mekanism){
-
- }
- }
+ public static void preInit() {
+ if (LoadedMods.Mekanism) {}
+ }
- public static void postInit(){
- if (LoadedMods.Mekanism && !LoadedMods.RedTech){
+ public static void init() {
+ if (LoadedMods.Mekanism) {}
+ }
- Logger.INFO("Performing GT recipe balance for Mek. now that it's Osmium is useless.");
+ public static void postInit() {
+ if (LoadedMods.Mekanism && !LoadedMods.RedTech) {
- //Steel Casing
- final ItemStack tSteelCasing = ItemUtils.simpleMetaStack("Mekanism:BasicBlock:8", 8, 1);
- addNewRecipe(
- "plateSteel", "blockGlass", "plateSteel",
- "blockGlass", "plateStainlessSteel", "blockGlass",
- "plateSteel", "blockGlass", "plateSteel",
- tSteelCasing);
+ Logger.INFO("Performing GT recipe balance for Mek. now that it's Osmium is useless.");
- //Energy Storage
- final ItemStack tAdvancedEnergyCube = ItemUtils.simpleMetaStack("Mekanism:EnergyCube", 0, 1).copy();
- NBTUtils.setString(tAdvancedEnergyCube, "tier", "Advanced");
- final ItemStack tBasicEnergyCube = ItemUtils.simpleMetaStack("Mekanism:EnergyCube", 0, 1).copy();
- NBTUtils.setString(tBasicEnergyCube, "tier", "Basic");
+ // Steel Casing
+ final ItemStack tSteelCasing = ItemUtils.simpleMetaStack("Mekanism:BasicBlock:8", 8, 1);
+ addNewRecipe(
+ "plateSteel",
+ "blockGlass",
+ "plateSteel",
+ "blockGlass",
+ "plateStainlessSteel",
+ "blockGlass",
+ "plateSteel",
+ "blockGlass",
+ "plateSteel",
+ tSteelCasing);
- //Gas tanks
- final ItemStack tBasicGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy();
- NBTUtils.setInteger(tBasicGasTank, "tier", 0);
- final ItemStack tAdvancedGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy();
- NBTUtils.setInteger(tAdvancedGasTank, "tier", 1);
- final ItemStack tEliteGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy();
- NBTUtils.setInteger(tEliteGasTank, "tier", 2);
- final ItemStack tMasterGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy();
- NBTUtils.setInteger(tMasterGasTank, "tier", 3);
+ // Energy Storage
+ final ItemStack tAdvancedEnergyCube =
+ ItemUtils.simpleMetaStack("Mekanism:EnergyCube", 0, 1).copy();
+ NBTUtils.setString(tAdvancedEnergyCube, "tier", "Advanced");
+ final ItemStack tBasicEnergyCube =
+ ItemUtils.simpleMetaStack("Mekanism:EnergyCube", 0, 1).copy();
+ NBTUtils.setString(tBasicEnergyCube, "tier", "Basic");
- //Machines that use Osmium
- final ItemStack tMachineBlock_Basic = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:5", 5, 1);
- final ItemStack tMachineBlock = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:6", 6, 1);
+ // Gas tanks
+ final ItemStack tBasicGasTank =
+ ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy();
+ NBTUtils.setInteger(tBasicGasTank, "tier", 0);
+ final ItemStack tAdvancedGasTank =
+ ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy();
+ NBTUtils.setInteger(tAdvancedGasTank, "tier", 1);
+ final ItemStack tEliteGasTank =
+ ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy();
+ NBTUtils.setInteger(tEliteGasTank, "tier", 2);
+ final ItemStack tMasterGasTank =
+ ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy();
+ NBTUtils.setInteger(tMasterGasTank, "tier", 3);
- //Smelting
- final ItemStack tMachineBlock_0_Basic = tMachineBlock_Basic.copy();
- NBTUtils.setInteger(tMachineBlock_0_Basic, "recipeType", 0);
- final ItemStack tMachineBlock_0 = tMachineBlock.copy();
- NBTUtils.setInteger(tMachineBlock_0, "recipeType", 0);
- //Enriching
- final ItemStack tMachineBlock_1_Basic = tMachineBlock_Basic.copy();
- NBTUtils.setInteger(tMachineBlock_1_Basic, "recipeType", 1);
- final ItemStack tMachineBlock_1 = tMachineBlock.copy();
- NBTUtils.setInteger(tMachineBlock_1, "recipeType", 1);
- //Crushing
- final ItemStack tMachineBlock_2_Basic = tMachineBlock_Basic.copy();
- NBTUtils.setInteger(tMachineBlock_2_Basic, "recipeType", 2);
- final ItemStack tMachineBlock_2 = tMachineBlock.copy();
- NBTUtils.setInteger(tMachineBlock_2, "recipeType", 2);
- //Compressing
- final ItemStack tMachineBlock_3_Basic = tMachineBlock_Basic.copy();
- NBTUtils.setInteger(tMachineBlock_3_Basic, "recipeType", 3);
- final ItemStack tMachineBlock_3 = tMachineBlock.copy();
- NBTUtils.setInteger(tMachineBlock_3, "recipeType", 3);
- //Combining
- final ItemStack tMachineBlock_4_Basic = tMachineBlock_Basic.copy();
- NBTUtils.setInteger(tMachineBlock_4_Basic, "recipeType", 4);
- final ItemStack tMachineBlock_4 = tMachineBlock.copy();
- NBTUtils.setInteger(tMachineBlock_4, "recipeType", 4);
- //Purifying
- final ItemStack tMachineBlock_5_Basic = tMachineBlock_Basic.copy();
- NBTUtils.setInteger(tMachineBlock_5_Basic, "recipeType", 5);
- final ItemStack tMachineBlock_5 = tMachineBlock.copy();
- NBTUtils.setInteger(tMachineBlock_5, "recipeType", 5);
- //Injecting
- final ItemStack tMachineBlock_6_Basic = tMachineBlock_Basic.copy();
- NBTUtils.setInteger(tMachineBlock_6_Basic, "recipeType", 6);
- final ItemStack tMachineBlock_6 = tMachineBlock.copy();
- NBTUtils.setInteger(tMachineBlock_6, "recipeType", 6);
- //Infusing
- final ItemStack tMachineBlock_7_Basic = tMachineBlock_Basic.copy();
- NBTUtils.setInteger(tMachineBlock_7_Basic, "recipeType", 7);
- final ItemStack tMachineBlock_7 = tMachineBlock.copy();
- NBTUtils.setInteger(tMachineBlock_7, "recipeType", 7);
+ // Machines that use Osmium
+ final ItemStack tMachineBlock_Basic = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:5", 5, 1);
+ final ItemStack tMachineBlock = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:6", 6, 1);
- //Infuser
- final ItemStack tMachineBlock_8 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:8", 8, 1);
- //Purification
- final ItemStack tMachineBlock_9 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:9", 9, 1);
- //Pump
- final ItemStack tMachineBlock_12 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:12", 12, 1);
+ // Smelting
+ final ItemStack tMachineBlock_0_Basic = tMachineBlock_Basic.copy();
+ NBTUtils.setInteger(tMachineBlock_0_Basic, "recipeType", 0);
+ final ItemStack tMachineBlock_0 = tMachineBlock.copy();
+ NBTUtils.setInteger(tMachineBlock_0, "recipeType", 0);
+ // Enriching
+ final ItemStack tMachineBlock_1_Basic = tMachineBlock_Basic.copy();
+ NBTUtils.setInteger(tMachineBlock_1_Basic, "recipeType", 1);
+ final ItemStack tMachineBlock_1 = tMachineBlock.copy();
+ NBTUtils.setInteger(tMachineBlock_1, "recipeType", 1);
+ // Crushing
+ final ItemStack tMachineBlock_2_Basic = tMachineBlock_Basic.copy();
+ NBTUtils.setInteger(tMachineBlock_2_Basic, "recipeType", 2);
+ final ItemStack tMachineBlock_2 = tMachineBlock.copy();
+ NBTUtils.setInteger(tMachineBlock_2, "recipeType", 2);
+ // Compressing
+ final ItemStack tMachineBlock_3_Basic = tMachineBlock_Basic.copy();
+ NBTUtils.setInteger(tMachineBlock_3_Basic, "recipeType", 3);
+ final ItemStack tMachineBlock_3 = tMachineBlock.copy();
+ NBTUtils.setInteger(tMachineBlock_3, "recipeType", 3);
+ // Combining
+ final ItemStack tMachineBlock_4_Basic = tMachineBlock_Basic.copy();
+ NBTUtils.setInteger(tMachineBlock_4_Basic, "recipeType", 4);
+ final ItemStack tMachineBlock_4 = tMachineBlock.copy();
+ NBTUtils.setInteger(tMachineBlock_4, "recipeType", 4);
+ // Purifying
+ final ItemStack tMachineBlock_5_Basic = tMachineBlock_Basic.copy();
+ NBTUtils.setInteger(tMachineBlock_5_Basic, "recipeType", 5);
+ final ItemStack tMachineBlock_5 = tMachineBlock.copy();
+ NBTUtils.setInteger(tMachineBlock_5, "recipeType", 5);
+ // Injecting
+ final ItemStack tMachineBlock_6_Basic = tMachineBlock_Basic.copy();
+ NBTUtils.setInteger(tMachineBlock_6_Basic, "recipeType", 6);
+ final ItemStack tMachineBlock_6 = tMachineBlock.copy();
+ NBTUtils.setInteger(tMachineBlock_6, "recipeType", 6);
+ // Infusing
+ final ItemStack tMachineBlock_7_Basic = tMachineBlock_Basic.copy();
+ NBTUtils.setInteger(tMachineBlock_7_Basic, "recipeType", 7);
+ final ItemStack tMachineBlock_7 = tMachineBlock.copy();
+ NBTUtils.setInteger(tMachineBlock_7, "recipeType", 7);
- //<Mekanism:ElectrolyticCore>
- final ItemStack tItem_1 = ItemUtils.simpleMetaStack("Mekanism:ElectrolyticCore", 0, 1);
- //<Mekanism:FactoryInstaller:1>
- final ItemStack tItem_2 = ItemUtils.simpleMetaStack("Mekanism:FactoryInstaller:1", 1, 1);
- //<Mekanism:SpeedUpgrade>
- final ItemStack tItem_3 = ItemUtils.simpleMetaStack("Mekanism:SpeedUpgrade", 0, 1);
+ // Infuser
+ final ItemStack tMachineBlock_8 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:8", 8, 1);
+ // Purification
+ final ItemStack tMachineBlock_9 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:9", 9, 1);
+ // Pump
+ final ItemStack tMachineBlock_12 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:12", 12, 1);
- //MiscItems
- final String tAdvancedAlloy = "alloyAdvanced";
- final String tCircuitAdvanced = "circuitAdvanced";
- final ItemStack tMekBatterySimple = ItemUtils.simpleMetaStack("Mekanism:EnergyTablet", 0, 1);
+ // <Mekanism:ElectrolyticCore>
+ final ItemStack tItem_1 = ItemUtils.simpleMetaStack("Mekanism:ElectrolyticCore", 0, 1);
+ // <Mekanism:FactoryInstaller:1>
+ final ItemStack tItem_2 = ItemUtils.simpleMetaStack("Mekanism:FactoryInstaller:1", 1, 1);
+ // <Mekanism:SpeedUpgrade>
+ final ItemStack tItem_3 = ItemUtils.simpleMetaStack("Mekanism:SpeedUpgrade", 0, 1);
- //Items
- addNewRecipe(
- tAdvancedAlloy, "plateTitanium", tAdvancedAlloy,
- "dustIron", tAdvancedAlloy, "dustGold",
- tAdvancedAlloy, "plateTitanium", tAdvancedAlloy,
- tItem_1);
- addNewRecipe(
- tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy,
- "plateStainlessSteel", "plankWood", "plateStainlessSteel",
- tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy,
- tItem_2);
- addNewRecipe(
- null, "blockGlass", null,
- tAdvancedAlloy, "plateTungsten", tAdvancedAlloy,
- null, "blockGlass", null,
- tItem_3);
+ // MiscItems
+ final String tAdvancedAlloy = "alloyAdvanced";
+ final String tCircuitAdvanced = "circuitAdvanced";
+ final ItemStack tMekBatterySimple = ItemUtils.simpleMetaStack("Mekanism:EnergyTablet", 0, 1);
- //Power Storage
- addNewRecipe(
- tAdvancedAlloy, tMekBatterySimple, tAdvancedAlloy,
- "plateAluminium", tBasicEnergyCube, "plateAluminium",
- tAdvancedAlloy, tMekBatterySimple, tAdvancedAlloy,
- tAdvancedEnergyCube);
+ // Items
+ addNewRecipe(
+ tAdvancedAlloy,
+ "plateTitanium",
+ tAdvancedAlloy,
+ "dustIron",
+ tAdvancedAlloy,
+ "dustGold",
+ tAdvancedAlloy,
+ "plateTitanium",
+ tAdvancedAlloy,
+ tItem_1);
+ addNewRecipe(
+ tAdvancedAlloy,
+ "circuitAdvanced",
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ "plankWood",
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ "circuitAdvanced",
+ tAdvancedAlloy,
+ tItem_2);
+ addNewRecipe(
+ null,
+ "blockGlass",
+ null,
+ tAdvancedAlloy,
+ "plateTungsten",
+ tAdvancedAlloy,
+ null,
+ "blockGlass",
+ null,
+ tItem_3);
- //Blocks
- addNewRecipe(
- "plateSteel", "craftingFurnace", "plateSteel",
- "plateRedstone", "platePlatinum", "plateRedstone",
- "plateSteel", "craftingFurnace", "plateSteel",
- tMachineBlock_8);
- addNewRecipe(
- tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy,
- "plateTitanium", ItemUtils.simpleMetaStack("Mekanism:MachineBlock", 0, 1), "plateTitanium",
- tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy,
- tMachineBlock_9);
- addNewRecipe(
- null, ItemUtils.getSimpleStack(Items.bucket), null,
- tAdvancedAlloy, tSteelCasing, tAdvancedAlloy,
- "plateStainlessSteel", "plateStainlessSteel", "plateStainlessSteel",
- tMachineBlock_12);
+ // Power Storage
+ addNewRecipe(
+ tAdvancedAlloy,
+ tMekBatterySimple,
+ tAdvancedAlloy,
+ "plateAluminium",
+ tBasicEnergyCube,
+ "plateAluminium",
+ tAdvancedAlloy,
+ tMekBatterySimple,
+ tAdvancedAlloy,
+ tAdvancedEnergyCube);
- //Machines
- addNewRecipe(
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- "plateStainlessSteel", tMachineBlock_0_Basic, "plateStainlessSteel",
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- tMachineBlock_0);
- addNewRecipe(
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- "plateStainlessSteel", tMachineBlock_1_Basic, "plateStainlessSteel",
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- tMachineBlock_1);
- addNewRecipe(
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- "plateStainlessSteel", tMachineBlock_2_Basic, "plateStainlessSteel",
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- tMachineBlock_2);
- addNewRecipe(
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- "plateStainlessSteel", tMachineBlock_3_Basic, "plateStainlessSteel",
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- tMachineBlock_3);
- addNewRecipe(
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- "plateStainlessSteel", tMachineBlock_4_Basic, "plateStainlessSteel",
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- tMachineBlock_4);
- addNewRecipe(
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- "plateStainlessSteel", tMachineBlock_5_Basic, "plateStainlessSteel",
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- tMachineBlock_5);
- addNewRecipe(
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- "plateStainlessSteel", tMachineBlock_6_Basic, "plateStainlessSteel",
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- tMachineBlock_6);
- addNewRecipe(
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- "plateStainlessSteel", tMachineBlock_7_Basic, "plateStainlessSteel",
- tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,
- tMachineBlock_7);
+ // Blocks
+ addNewRecipe(
+ "plateSteel",
+ "craftingFurnace",
+ "plateSteel",
+ "plateRedstone",
+ "platePlatinum",
+ "plateRedstone",
+ "plateSteel",
+ "craftingFurnace",
+ "plateSteel",
+ tMachineBlock_8);
+ addNewRecipe(
+ tAdvancedAlloy,
+ "circuitAdvanced",
+ tAdvancedAlloy,
+ "plateTitanium",
+ ItemUtils.simpleMetaStack("Mekanism:MachineBlock", 0, 1),
+ "plateTitanium",
+ tAdvancedAlloy,
+ "circuitAdvanced",
+ tAdvancedAlloy,
+ tMachineBlock_9);
+ addNewRecipe(
+ null,
+ ItemUtils.getSimpleStack(Items.bucket),
+ null,
+ tAdvancedAlloy,
+ tSteelCasing,
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ "plateStainlessSteel",
+ "plateStainlessSteel",
+ tMachineBlock_12);
- //Gas Tanks
- addNewRecipe(
- "plateRedstone", "plateAluminium", "plateRedstone",
- "plateAluminium", null, "plateAluminium",
- "plateRedstone", "plateAluminium", "plateRedstone",
- tBasicGasTank);
- addNewRecipe(
- tAdvancedAlloy, "plateStainlessSteel", tAdvancedAlloy,
- "plateStainlessSteel", tBasicGasTank, "plateStainlessSteel",
- tAdvancedAlloy, "plateStainlessSteel", tAdvancedAlloy,
- tAdvancedGasTank);
- addNewRecipe(
- "alloyElite", "plateTitanium", "alloyElite",
- "plateTitanium", tAdvancedGasTank, "plateTitanium",
- "alloyElite", "plateTitanium", "alloyElite",
- tEliteGasTank);
- addNewRecipe(
- "alloyUltimate", "plateTungsten", "alloyUltimate",
- "plateTungsten", tEliteGasTank, "plateTungsten",
- "alloyUltimate", "plateTungsten", "alloyUltimate",
- tMasterGasTank);
- }
- }
+ // Machines
+ addNewRecipe(
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tMachineBlock_0_Basic,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ tMachineBlock_0);
+ addNewRecipe(
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tMachineBlock_1_Basic,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ tMachineBlock_1);
+ addNewRecipe(
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tMachineBlock_2_Basic,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ tMachineBlock_2);
+ addNewRecipe(
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tMachineBlock_3_Basic,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ tMachineBlock_3);
+ addNewRecipe(
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tMachineBlock_4_Basic,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ tMachineBlock_4);
+ addNewRecipe(
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tMachineBlock_5_Basic,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ tMachineBlock_5);
+ addNewRecipe(
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tMachineBlock_6_Basic,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ tMachineBlock_6);
+ addNewRecipe(
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tMachineBlock_7_Basic,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ tCircuitAdvanced,
+ tAdvancedAlloy,
+ tMachineBlock_7);
- private static boolean addNewRecipe(
- final Object InputItem1, final Object InputItem2, final Object InputItem3,
- final Object InputItem4, final Object InputItem5, final Object InputItem6,
- final Object InputItem7, final Object InputItem8, final Object InputItem9,
- final ItemStack OutputItem){
+ // Gas Tanks
+ addNewRecipe(
+ "plateRedstone",
+ "plateAluminium",
+ "plateRedstone",
+ "plateAluminium",
+ null,
+ "plateAluminium",
+ "plateRedstone",
+ "plateAluminium",
+ "plateRedstone",
+ tBasicGasTank);
+ addNewRecipe(
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tBasicGasTank,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ "plateStainlessSteel",
+ tAdvancedAlloy,
+ tAdvancedGasTank);
+ addNewRecipe(
+ "alloyElite",
+ "plateTitanium",
+ "alloyElite",
+ "plateTitanium",
+ tAdvancedGasTank,
+ "plateTitanium",
+ "alloyElite",
+ "plateTitanium",
+ "alloyElite",
+ tEliteGasTank);
+ addNewRecipe(
+ "alloyUltimate",
+ "plateTungsten",
+ "alloyUltimate",
+ "plateTungsten",
+ tEliteGasTank,
+ "plateTungsten",
+ "alloyUltimate",
+ "plateTungsten",
+ "alloyUltimate",
+ tMasterGasTank);
+ }
+ }
- /*if (removeRecipe(OutputItem)){
- return RecipeUtils.recipeBuilder(
- InputItem1, InputItem2, InputItem3,
- InputItem4, InputItem5, InputItem6,
- InputItem7, InputItem8, InputItem9,
- OutputItem);
- }*/
+ private static boolean addNewRecipe(
+ final Object InputItem1,
+ final Object InputItem2,
+ final Object InputItem3,
+ final Object InputItem4,
+ final Object InputItem5,
+ final Object InputItem6,
+ final Object InputItem7,
+ final Object InputItem8,
+ final Object InputItem9,
+ final ItemStack OutputItem) {
- removeRecipe(OutputItem);
- return RecipeUtils.recipeBuilder(
- InputItem1, InputItem2, InputItem3,
- InputItem4, InputItem5, InputItem6,
- InputItem7, InputItem8, InputItem9,
- OutputItem);
- }
+ /*if (removeRecipe(OutputItem)){
+ return RecipeUtils.recipeBuilder(
+ InputItem1, InputItem2, InputItem3,
+ InputItem4, InputItem5, InputItem6,
+ InputItem7, InputItem8, InputItem9,
+ OutputItem);
+ }*/
- private static boolean removeRecipe(final ItemStack item){
- Class<?> mekUtils;
- boolean removed = false;
- try {
- mekUtils = Class.forName("mekanism.common.util.RecipeUtils");
- if (mekUtils != null){
- final Method mRemoveRecipe = mekUtils.getDeclaredMethod("removeRecipes", ItemStack.class);
- if (mRemoveRecipe != null){
- removed = (boolean) mRemoveRecipe.invoke(null, item);
- if (!removed) {
- removed = (boolean) mRemoveRecipe.invoke(mekUtils, item);
- }
- }
- }
- } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- Logger.INFO("[Mek] Failed to use the built-in recipe remover from Mekanism.");
- }
- if (!removed){
- removed = GT_ModHandler.removeRecipeByOutput(item);
- }
- Logger.INFO("[Mek] Successfully removed the recipe for "+item.getDisplayName()+".");
- return removed;
- }
+ removeRecipe(OutputItem);
+ return RecipeUtils.recipeBuilder(
+ InputItem1,
+ InputItem2,
+ InputItem3,
+ InputItem4,
+ InputItem5,
+ InputItem6,
+ InputItem7,
+ InputItem8,
+ InputItem9,
+ OutputItem);
+ }
+ private static boolean removeRecipe(final ItemStack item) {
+ Class<?> mekUtils;
+ boolean removed = false;
+ try {
+ mekUtils = Class.forName("mekanism.common.util.RecipeUtils");
+ if (mekUtils != null) {
+ final Method mRemoveRecipe = mekUtils.getDeclaredMethod("removeRecipes", ItemStack.class);
+ if (mRemoveRecipe != null) {
+ removed = (boolean) mRemoveRecipe.invoke(null, item);
+ if (!removed) {
+ removed = (boolean) mRemoveRecipe.invoke(mekUtils, item);
+ }
+ }
+ }
+ } catch (ClassNotFoundException
+ | NoSuchMethodException
+ | SecurityException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ Logger.INFO("[Mek] Failed to use the built-in recipe remover from Mekanism.");
+ }
+ if (!removed) {
+ removed = GT_ModHandler.removeRecipeByOutput(item);
+ }
+ Logger.INFO("[Mek] Successfully removed the recipe for " + item.getDisplayName() + ".");
+ return removed;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ob/GliderHandler.java b/src/main/java/gtPlusPlus/xmod/ob/GliderHandler.java
index a190511b02..bb079c42c1 100644
--- a/src/main/java/gtPlusPlus/xmod/ob/GliderHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/ob/GliderHandler.java
@@ -1,127 +1,119 @@
package gtPlusPlus.xmod.ob;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
+import org.apache.commons.lang3.StringUtils;
public class GliderHandler {
- private static final AutoMap<Integer> mDimensionalBlacklist = new AutoMap<Integer>();
-
- @SubscribeEvent
- public void onItemUsageEx(final PlayerInteractEvent event) {
- if (event != null && event.entityPlayer != null) {
-
- if (event.action != Action.RIGHT_CLICK_BLOCK && event.action != Action.RIGHT_CLICK_AIR) {
- Logger.WARNING("[OpenBlocks] Wrong type of PlayerInteractEvent, skipping.");
- }
- if (event.entityPlayer.worldObj.isRemote) {
- return;
- }
-
- ItemStack aItem = PlayerUtils.getItemStackInPlayersHand(event.entityPlayer);
- if (ItemUtils.checkForInvalidItems(aItem)) {
- Class aItemGliderClass = ReflectionUtils.getClass("openblocks.common.item.ItemHangGlider");
- if (aItemGliderClass.isInstance(aItem.getItem())) {
- if (!canPlayerGlideInThisDimension(event.entityPlayer)){
- event.setCanceled(true);
- PlayerUtils.messagePlayer(event.entityPlayer, "Glider is blacklisted in this dimension.");
- Logger.WARNING("[OpenBlocks] "+event.entityPlayer.getCommandSenderName()+" tried to use glider in dimension "+event.entityPlayer.getEntityWorld().provider.dimensionId+".");
- }
- else {
- Logger.WARNING("[OpenBlocks] "+event.entityPlayer.getCommandSenderName()+" used glider in dimension "+event.entityPlayer.getEntityWorld().provider.dimensionId+".");
- }
- }
- else {
- Logger.WARNING("[OpenBlocks] Item was not a glider.");
- }
- }
- else {
- Logger.WARNING("[OpenBlocks] Bad Item in player hand.");
- }
- }
- else {
- Logger.WARNING("[OpenBlocks] Bad event or player.");
- }
-
+ private static final AutoMap<Integer> mDimensionalBlacklist = new AutoMap<Integer>();
- }
+ @SubscribeEvent
+ public void onItemUsageEx(final PlayerInteractEvent event) {
+ if (event != null && event.entityPlayer != null) {
- private static final boolean canPlayerGlideInThisDimension(EntityPlayer aPlayer) {
- World aWorld = aPlayer.worldObj;
- if (aWorld == null) {
- return false;
- }
- else {
- if (aWorld.provider == null) {
- return false;
- }
- else {
- int aDimID = aWorld.provider.dimensionId;
- for (int i : mDimensionalBlacklist) {
- if (i == aDimID) {
- return false;
- }
- }
- }
- }
- return true;
- }
+ if (event.action != Action.RIGHT_CLICK_BLOCK && event.action != Action.RIGHT_CLICK_AIR) {
+ Logger.WARNING("[OpenBlocks] Wrong type of PlayerInteractEvent, skipping.");
+ }
+ if (event.entityPlayer.worldObj.isRemote) {
+ return;
+ }
- static final void populateBlacklist() {
- if (!mDimensionalBlacklist.isEmpty()) {
- return;
- }
- File aBlacklist = gtPlusPlus.core.util.data.FileUtils.getFile("config/GTplusplus/", "GliderBlacklist", "cfg");
- List<String> lines = new ArrayList<String>();
- try {
- lines = org.apache.commons.io.FileUtils.readLines(aBlacklist, "utf-8");
- } catch (IOException e) {
- e.printStackTrace();
- }
- if (lines.isEmpty()) {
- FileWriter fw;
- try {
- String aInfoTip = "# Add one dimension ID per line. Lines with a # are comments and are ignored.";
- fw = new FileWriter(aBlacklist);
- fw.write(aInfoTip);
- fw.close();
- lines.add(aInfoTip);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- if (!lines.isEmpty()) {
- for (String s : lines) {
- if (s != null && !s.equals("") && !s.contains("#")) {
- s = StringUtils.remove(s, " ");
- s = StringUtils.trim(s);
- s = StringUtils.remove(s, ",");
- Integer g = Integer.decode(s);
- if (g != null) {
- mDimensionalBlacklist.add(g);
- Logger.INFO("[OpenBlocks] Added Dimension with ID '"+g+"' to Blacklist for Glider.");
- }
- }
- }
- }
- }
+ ItemStack aItem = PlayerUtils.getItemStackInPlayersHand(event.entityPlayer);
+ if (ItemUtils.checkForInvalidItems(aItem)) {
+ Class aItemGliderClass = ReflectionUtils.getClass("openblocks.common.item.ItemHangGlider");
+ if (aItemGliderClass.isInstance(aItem.getItem())) {
+ if (!canPlayerGlideInThisDimension(event.entityPlayer)) {
+ event.setCanceled(true);
+ PlayerUtils.messagePlayer(event.entityPlayer, "Glider is blacklisted in this dimension.");
+ Logger.WARNING("[OpenBlocks] " + event.entityPlayer.getCommandSenderName()
+ + " tried to use glider in dimension "
+ + event.entityPlayer.getEntityWorld().provider.dimensionId + ".");
+ } else {
+ Logger.WARNING("[OpenBlocks] " + event.entityPlayer.getCommandSenderName()
+ + " used glider in dimension "
+ + event.entityPlayer.getEntityWorld().provider.dimensionId + ".");
+ }
+ } else {
+ Logger.WARNING("[OpenBlocks] Item was not a glider.");
+ }
+ } else {
+ Logger.WARNING("[OpenBlocks] Bad Item in player hand.");
+ }
+ } else {
+ Logger.WARNING("[OpenBlocks] Bad event or player.");
+ }
+ }
+ private static final boolean canPlayerGlideInThisDimension(EntityPlayer aPlayer) {
+ World aWorld = aPlayer.worldObj;
+ if (aWorld == null) {
+ return false;
+ } else {
+ if (aWorld.provider == null) {
+ return false;
+ } else {
+ int aDimID = aWorld.provider.dimensionId;
+ for (int i : mDimensionalBlacklist) {
+ if (i == aDimID) {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+ }
+ static final void populateBlacklist() {
+ if (!mDimensionalBlacklist.isEmpty()) {
+ return;
+ }
+ File aBlacklist = gtPlusPlus.core.util.data.FileUtils.getFile("config/GTplusplus/", "GliderBlacklist", "cfg");
+ List<String> lines = new ArrayList<String>();
+ try {
+ lines = org.apache.commons.io.FileUtils.readLines(aBlacklist, "utf-8");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (lines.isEmpty()) {
+ FileWriter fw;
+ try {
+ String aInfoTip = "# Add one dimension ID per line. Lines with a # are comments and are ignored.";
+ fw = new FileWriter(aBlacklist);
+ fw.write(aInfoTip);
+ fw.close();
+ lines.add(aInfoTip);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if (!lines.isEmpty()) {
+ for (String s : lines) {
+ if (s != null && !s.equals("") && !s.contains("#")) {
+ s = StringUtils.remove(s, " ");
+ s = StringUtils.trim(s);
+ s = StringUtils.remove(s, ",");
+ Integer g = Integer.decode(s);
+ if (g != null) {
+ mDimensionalBlacklist.add(g);
+ Logger.INFO("[OpenBlocks] Added Dimension with ID '" + g + "' to Blacklist for Glider.");
+ }
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java b/src/main/java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java
index c1b678f5ee..065b28c7e7 100644
--- a/src/main/java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java
+++ b/src/main/java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java
@@ -1,38 +1,23 @@
package gtPlusPlus.xmod.ob;
-import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
-
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.item.base.BaseItemBurnable;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.xmod.railcraft.utils.RailcraftUtils;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
public class HANDLER_OpenBlocks {
- public static void preInit() {
- if (LoadedMods.OpenBlocks) {
-
- }
- }
-
- public static void init() {
- if (LoadedMods.OpenBlocks) {
- GliderHandler.populateBlacklist();
- }
- }
+ public static void preInit() {
+ if (LoadedMods.OpenBlocks) {}
+ }
- public static void postInit() {
- if (LoadedMods.OpenBlocks) {
- Utils.registerEvent(new GliderHandler());
- }
- }
+ public static void init() {
+ if (LoadedMods.OpenBlocks) {
+ GliderHandler.populateBlacklist();
+ }
+ }
+ public static void postInit() {
+ if (LoadedMods.OpenBlocks) {
+ Utils.registerEvent(new GliderHandler());
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/ob/SprinklerHandler.java b/src/main/java/gtPlusPlus/xmod/ob/SprinklerHandler.java
index 85f8ded290..7478d51dec 100644
--- a/src/main/java/gtPlusPlus/xmod/ob/SprinklerHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/ob/SprinklerHandler.java
@@ -1,12 +1,10 @@
package gtPlusPlus.xmod.ob;
-import java.util.HashMap;
-
import com.google.common.base.Objects;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.HashMap;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
@@ -17,50 +15,47 @@ import net.minecraft.item.ItemStack;
*/
public class SprinklerHandler {
+ private static final HashMap<Integer, ItemStack> mValidFerts = new HashMap<Integer, ItemStack>();
+
+ /**
+ * @return - A valid {@link Map} of all Fertilizers for the OB Sprinkler.
+ */
+ public static HashMap<Integer, ItemStack> getValidFerts() {
+ return mValidFerts;
+ }
+
+ /**
+ * @param aFert - An {@link ItemStack} which is to be registered for OB Sprinklers.
+ */
+ public static void registerSprinklerFertilizer(ItemStack aFert) {
+ int aHash = Objects.hashCode(aFert.getItem(), aFert.getItemDamage());
+ if (!mValidFerts.containsKey(aHash)) {
+ Logger.INFO("Registering " + aFert.getDisplayName() + " as OB Sprinkler Fertilizer.");
+ mValidFerts.put(aHash, aFert.copy());
+ }
+ }
+
+ public static void registerModFerts() {
+ ItemStack f;
- private static final HashMap<Integer, ItemStack> mValidFerts = new HashMap<Integer, ItemStack>();
-
- /**
- * @return - A valid {@link Map} of all Fertilizers for the OB Sprinkler.
- */
- public static HashMap<Integer, ItemStack> getValidFerts() {
- return mValidFerts;
- }
-
- /**
- * @param aFert - An {@link ItemStack} which is to be registered for OB Sprinklers.
- */
- public static void registerSprinklerFertilizer(ItemStack aFert) {
- int aHash = Objects.hashCode(aFert.getItem(), aFert.getItemDamage());
- if (!mValidFerts.containsKey(aHash)) {
- Logger.INFO("Registering "+aFert.getDisplayName()+" as OB Sprinkler Fertilizer.");
- mValidFerts.put(aHash, aFert.copy());
- }
- }
-
- public static void registerModFerts() {
- ItemStack f;
+ f = new ItemStack(Items.dye, 1, 15);
+ SprinklerHandler.registerSprinklerFertilizer(f);
- f = new ItemStack(Items.dye, 1, 15);
- SprinklerHandler.registerSprinklerFertilizer(f);
-
- if (LoadedMods.Forestry) {
- f = ItemUtils.getCorrectStacktype("Forestry:fertilizerBio", 1);
- if (f != null) {
- registerSprinklerFertilizer(f);
- }
- f = ItemUtils.getCorrectStacktype("Forestry:fertilizerCompound", 1);
- if (f != null) {
- registerSprinklerFertilizer(f);
- }
- }
- if (LoadedMods.IndustrialCraft2) {
- f = ItemUtils.getCorrectStacktype("IC2:itemFertilizer", 1);
- if (f != null) {
- registerSprinklerFertilizer(f);
- }
-
- }
- }
-
+ if (LoadedMods.Forestry) {
+ f = ItemUtils.getCorrectStacktype("Forestry:fertilizerBio", 1);
+ if (f != null) {
+ registerSprinklerFertilizer(f);
+ }
+ f = ItemUtils.getCorrectStacktype("Forestry:fertilizerCompound", 1);
+ if (f != null) {
+ registerSprinklerFertilizer(f);
+ }
+ }
+ if (LoadedMods.IndustrialCraft2) {
+ f = ItemUtils.getCorrectStacktype("IC2:itemFertilizer", 1);
+ if (f != null) {
+ registerSprinklerFertilizer(f);
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/railcraft/HANDLER_Railcraft.java b/src/main/java/gtPlusPlus/xmod/railcraft/HANDLER_Railcraft.java
index 0e79cd1894..e5611444ea 100644
--- a/src/main/java/gtPlusPlus/xmod/railcraft/HANDLER_Railcraft.java
+++ b/src/main/java/gtPlusPlus/xmod/railcraft/HANDLER_Railcraft.java
@@ -20,95 +20,171 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class HANDLER_Railcraft {
-
-
- public static void preInit() {
- if (LoadedMods.Railcraft) {
-
- }
-
- //Register Custom Coal Coke
- ModItems.itemCoalCoke = new BaseItemBurnable("itemCoalCoke", "Coking Coal", tabMisc, 64, 0, "Used for metallurgy.", "fuelCoke", 3200, 0).setTextureName(CORE.MODID + ":burnables/itemCoalCoke");
-
- //Add in things that once existed in 1.5.2
- ModItems.itemCactusCharcoal = new BaseItemBurnable("itemCactusCharcoal", "Cactus Charcoal", tabMisc, 64, 0, "Used for smelting.", "fuelCactusCharcoal", 400, 0).setTextureName(CORE.MODID + ":burnables/itemCactusCharcoal");
- ModItems.itemSugarCharcoal = new BaseItemBurnable("itemSugarCharcoal", "Sugar Charcoal", tabMisc, 64, 0, "Used for smelting.", "fuelSugarCharcoal", 400, 0).setTextureName(CORE.MODID + ":burnables/itemSugarCharcoal");
- ModItems.itemCactusCoke = new BaseItemBurnable("itemCactusCoke", "Cactus Coke", tabMisc, 64, 0, "Used for smelting.", "fuelCactusCoke", 800, 0).setTextureName(CORE.MODID + ":burnables/itemCactusCoke");
- ModItems.itemSugarCoke = new BaseItemBurnable("itemSugarCoke", "Sugar Coke", tabMisc, 64, 0, "Used for smelting.", "fuelSugarCoke", 800, 0).setTextureName(CORE.MODID + ":burnables/itemSugarCoke");
+ public static void preInit() {
+ if (LoadedMods.Railcraft) {}
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemCactusCharcoal), "itemCharcoalCactus");
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemCactusCoke), "itemCokeCactus");
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemSugarCharcoal), "itemCharcoalSugar");
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemSugarCoke), "itemCokeSugar");
-
- }
+ // Register Custom Coal Coke
+ ModItems.itemCoalCoke = new BaseItemBurnable(
+ "itemCoalCoke", "Coking Coal", tabMisc, 64, 0, "Used for metallurgy.", "fuelCoke", 3200, 0)
+ .setTextureName(CORE.MODID + ":burnables/itemCoalCoke");
- public static void init() {
- if (LoadedMods.Railcraft) {
-
- }
- }
+ // Add in things that once existed in 1.5.2
+ ModItems.itemCactusCharcoal = new BaseItemBurnable(
+ "itemCactusCharcoal",
+ "Cactus Charcoal",
+ tabMisc,
+ 64,
+ 0,
+ "Used for smelting.",
+ "fuelCactusCharcoal",
+ 400,
+ 0)
+ .setTextureName(CORE.MODID + ":burnables/itemCactusCharcoal");
+ ModItems.itemSugarCharcoal = new BaseItemBurnable(
+ "itemSugarCharcoal",
+ "Sugar Charcoal",
+ tabMisc,
+ 64,
+ 0,
+ "Used for smelting.",
+ "fuelSugarCharcoal",
+ 400,
+ 0)
+ .setTextureName(CORE.MODID + ":burnables/itemSugarCharcoal");
+ ModItems.itemCactusCoke = new BaseItemBurnable(
+ "itemCactusCoke", "Cactus Coke", tabMisc, 64, 0, "Used for smelting.", "fuelCactusCoke", 800, 0)
+ .setTextureName(CORE.MODID + ":burnables/itemCactusCoke");
+ ModItems.itemSugarCoke = new BaseItemBurnable(
+ "itemSugarCoke", "Sugar Coke", tabMisc, 64, 0, "Used for smelting.", "fuelSugarCoke", 800, 0)
+ .setTextureName(CORE.MODID + ":burnables/itemSugarCoke");
- public static void postInit() {
- if (LoadedMods.Railcraft) {
-
- }
- generateCokeOvenRecipes();
- }
-
-
- private static void generateCokeOvenRecipes() {
- ItemStack[] aInputs1 = new ItemStack[] {
- ItemUtils.getSimpleStack(Blocks.cactus),
- ItemUtils.getSimpleStack(Items.reeds)
- };
- ItemStack[] aInputs2 = new ItemStack[] {
- ItemUtils.getSimpleStack(ModItems.itemCactusCharcoal),
- ItemUtils.getSimpleStack(ModItems.itemSugarCharcoal)
- };
- ItemStack[] aOutputs = new ItemStack[] {
- ItemUtils.getSimpleStack(ModItems.itemCactusCoke),
- ItemUtils.getSimpleStack(ModItems.itemSugarCoke)
- };
- for (int i=0;i<aOutputs.length;i++) {
- // Recipes for the Charcoals and Cokes, outputting either Creosote or Charcoal Byproducts depending on the fluid input
- CORE.RA.addCokeOvenRecipe(aInputs1[i], CI.getNumberedCircuit(3), null, FluidUtils.getFluidStack("creosote", 100), aInputs2[i], 20, 16);
- CORE.RA.addCokeOvenRecipe(aInputs1[i], CI.getNumberedCircuit(4), FluidUtils.getFluidStack("nitrogen", 100), FluidUtils.getFluidStack("charcoal_byproducts", 200), aInputs2[i], 10, 16);
- CORE.RA.addCokeOvenRecipe(aInputs2[i], CI.getNumberedCircuit(3), null, FluidUtils.getFluidStack("creosote", 200), aOutputs[i], 40, 16);
- CORE.RA.addCokeOvenRecipe(aInputs2[i], CI.getNumberedCircuit(4), FluidUtils.getFluidStack("nitrogen", 50), FluidUtils.getFluidStack("charcoal_byproducts", 100), aOutputs[i], 20, 16);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemCactusCharcoal), "itemCharcoalCactus");
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemCactusCoke), "itemCokeCactus");
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemSugarCharcoal), "itemCharcoalSugar");
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemSugarCoke), "itemCokeSugar");
+ }
- // Generate Wood Tar and Wood Gas from these Cokes
- CORE.RA.addCokeOvenRecipe(aOutputs[i], CI.getNumberedCircuit(5), FluidUtils.getFluidStack("steam", 100), Materials.WoodTar.getFluid(200) , Materials.Ash.getDustSmall(1), 60, 240);
- CORE.RA.addCokeOvenRecipe(aOutputs[i], CI.getNumberedCircuit(6), FluidUtils.getFluidStack("steam", 100), Materials.WoodGas.getFluid(300) , Materials.Ash.getDustSmall(1), 60, 240);
+ public static void init() {
+ if (LoadedMods.Railcraft) {}
+ }
- // Fluid Extracting the Charcoals for Wood Tar
- GT_Values.RA.addFluidExtractionRecipe(aInputs2[i], GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 1L), Materials.WoodTar.getFluid(50L), 1000, 30, 16);
+ public static void postInit() {
+ if (LoadedMods.Railcraft) {}
- // Processing the Charcoals with Oxygen to get CO and CO2
- // C + O = CO
- GT_Values.RA.addChemicalRecipe(aInputs2[i], GT_Utility.getIntegratedCircuit(1), Materials.Oxygen.getGas(500), Materials.CarbonMonoxide.getGas(500), Materials.Ash.getDustTiny(1), 80, 8);
- // C + 2O = CO2
- GT_Values.RA.addChemicalRecipe(aInputs2[i], GT_Utility.getIntegratedCircuit(2), Materials.Oxygen.getGas(2000), Materials.CarbonDioxide.getGas(1000), Materials.Ash.getDustTiny(1), 40, 8);
+ generateCokeOvenRecipes();
+ }
- }
- if (LoadedMods.Railcraft) {
- for (int i=0;i<aOutputs.length;i++) {
- RailcraftUtils.addCokeOvenRecipe(aInputs1[i], true, true, aInputs2[i], FluidUtils.getFluidStack("creosote", 30), 500);
- }
- for (int i=0;i<aOutputs.length;i++) {
- RailcraftUtils.addCokeOvenRecipe(aInputs2[i], true, true, aOutputs[i], FluidUtils.getFluidStack("creosote", 30), 500);
- }
-
- if(LoadedMods.DreamCraft){
- for (int i=0;i<aOutputs.length;i++) {
- RailcraftUtils.addAdvancedCokeOvenRecipe(aInputs1[i], true, true, aInputs2[i], 20);
- }
- for (int i=0;i<aOutputs.length;i++) {
- RailcraftUtils.addAdvancedCokeOvenRecipe(aInputs2[i], true, true, aInputs2[i], 20);
- }
- }
- }
- }
+ private static void generateCokeOvenRecipes() {
+ ItemStack[] aInputs1 =
+ new ItemStack[] {ItemUtils.getSimpleStack(Blocks.cactus), ItemUtils.getSimpleStack(Items.reeds)};
+ ItemStack[] aInputs2 = new ItemStack[] {
+ ItemUtils.getSimpleStack(ModItems.itemCactusCharcoal), ItemUtils.getSimpleStack(ModItems.itemSugarCharcoal)
+ };
+ ItemStack[] aOutputs = new ItemStack[] {
+ ItemUtils.getSimpleStack(ModItems.itemCactusCoke), ItemUtils.getSimpleStack(ModItems.itemSugarCoke)
+ };
+ for (int i = 0; i < aOutputs.length; i++) {
+ // Recipes for the Charcoals and Cokes, outputting either Creosote or Charcoal Byproducts depending on the
+ // fluid input
+ CORE.RA.addCokeOvenRecipe(
+ aInputs1[i],
+ CI.getNumberedCircuit(3),
+ null,
+ FluidUtils.getFluidStack("creosote", 100),
+ aInputs2[i],
+ 20,
+ 16);
+ CORE.RA.addCokeOvenRecipe(
+ aInputs1[i],
+ CI.getNumberedCircuit(4),
+ FluidUtils.getFluidStack("nitrogen", 100),
+ FluidUtils.getFluidStack("charcoal_byproducts", 200),
+ aInputs2[i],
+ 10,
+ 16);
+ CORE.RA.addCokeOvenRecipe(
+ aInputs2[i],
+ CI.getNumberedCircuit(3),
+ null,
+ FluidUtils.getFluidStack("creosote", 200),
+ aOutputs[i],
+ 40,
+ 16);
+ CORE.RA.addCokeOvenRecipe(
+ aInputs2[i],
+ CI.getNumberedCircuit(4),
+ FluidUtils.getFluidStack("nitrogen", 50),
+ FluidUtils.getFluidStack("charcoal_byproducts", 100),
+ aOutputs[i],
+ 20,
+ 16);
+ // Generate Wood Tar and Wood Gas from these Cokes
+ CORE.RA.addCokeOvenRecipe(
+ aOutputs[i],
+ CI.getNumberedCircuit(5),
+ FluidUtils.getFluidStack("steam", 100),
+ Materials.WoodTar.getFluid(200),
+ Materials.Ash.getDustSmall(1),
+ 60,
+ 240);
+ CORE.RA.addCokeOvenRecipe(
+ aOutputs[i],
+ CI.getNumberedCircuit(6),
+ FluidUtils.getFluidStack("steam", 100),
+ Materials.WoodGas.getFluid(300),
+ Materials.Ash.getDustSmall(1),
+ 60,
+ 240);
+
+ // Fluid Extracting the Charcoals for Wood Tar
+ GT_Values.RA.addFluidExtractionRecipe(
+ aInputs2[i],
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 1L),
+ Materials.WoodTar.getFluid(50L),
+ 1000,
+ 30,
+ 16);
+
+ // Processing the Charcoals with Oxygen to get CO and CO2
+ // C + O = CO
+ GT_Values.RA.addChemicalRecipe(
+ aInputs2[i],
+ GT_Utility.getIntegratedCircuit(1),
+ Materials.Oxygen.getGas(500),
+ Materials.CarbonMonoxide.getGas(500),
+ Materials.Ash.getDustTiny(1),
+ 80,
+ 8);
+ // C + 2O = CO2
+ GT_Values.RA.addChemicalRecipe(
+ aInputs2[i],
+ GT_Utility.getIntegratedCircuit(2),
+ Materials.Oxygen.getGas(2000),
+ Materials.CarbonDioxide.getGas(1000),
+ Materials.Ash.getDustTiny(1),
+ 40,
+ 8);
+ }
+ if (LoadedMods.Railcraft) {
+ for (int i = 0; i < aOutputs.length; i++) {
+ RailcraftUtils.addCokeOvenRecipe(
+ aInputs1[i], true, true, aInputs2[i], FluidUtils.getFluidStack("creosote", 30), 500);
+ }
+ for (int i = 0; i < aOutputs.length; i++) {
+ RailcraftUtils.addCokeOvenRecipe(
+ aInputs2[i], true, true, aOutputs[i], FluidUtils.getFluidStack("creosote", 30), 500);
+ }
+
+ if (LoadedMods.DreamCraft) {
+ for (int i = 0; i < aOutputs.length; i++) {
+ RailcraftUtils.addAdvancedCokeOvenRecipe(aInputs1[i], true, true, aInputs2[i], 20);
+ }
+ for (int i = 0; i < aOutputs.length; i++) {
+ RailcraftUtils.addAdvancedCokeOvenRecipe(aInputs2[i], true, true, aInputs2[i], 20);
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/railcraft/utils/RailcraftUtils.java b/src/main/java/gtPlusPlus/xmod/railcraft/utils/RailcraftUtils.java
index 8b3510f3da..07a9fda03c 100644
--- a/src/main/java/gtPlusPlus/xmod/railcraft/utils/RailcraftUtils.java
+++ b/src/main/java/gtPlusPlus/xmod/railcraft/utils/RailcraftUtils.java
@@ -7,12 +7,18 @@ import net.minecraftforge.fluids.FluidStack;
public class RailcraftUtils {
- public static void addCokeOvenRecipe(ItemStack input, boolean matchDamage, boolean matchNBT, ItemStack output, FluidStack fluidOutput, int cookTime) {
- CokeOvenCraftingManager.getInstance().addRecipe(input, matchDamage, matchNBT, output, fluidOutput, cookTime);
- }
+ public static void addCokeOvenRecipe(
+ ItemStack input,
+ boolean matchDamage,
+ boolean matchNBT,
+ ItemStack output,
+ FluidStack fluidOutput,
+ int cookTime) {
+ CokeOvenCraftingManager.getInstance().addRecipe(input, matchDamage, matchNBT, output, fluidOutput, cookTime);
+ }
- public static void addAdvancedCokeOvenRecipe(ItemStack input, boolean matchDamage, boolean matchNBT, ItemStack output, int cookTime) {
- BlastFurnaceCraftingManager.getInstance().addRecipe(input, matchDamage, matchNBT, cookTime, output);
- }
-
+ public static void addAdvancedCokeOvenRecipe(
+ ItemStack input, boolean matchDamage, boolean matchNBT, ItemStack output, int cookTime) {
+ BlastFurnaceCraftingManager.getInstance().addRecipe(input, matchDamage, matchNBT, cookTime, output);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java b/src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java
index 7ebb4c7b1f..4e6317fe21 100644
--- a/src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java
+++ b/src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java
@@ -5,22 +5,17 @@ import gtPlusPlus.xmod.reliquary.util.ReliquaryRecipeHandler;
public class HANDLER_Reliquary {
- public static void preInit() {
- if (LoadedMods.Reliquary) {
-
- }
- }
-
- public static void init() {
- if (LoadedMods.Reliquary) {
-
- }
- }
-
- public static void postInit() {
- if (LoadedMods.Reliquary) {
- ReliquaryRecipeHandler.gregifyDefaultRecipes();
- }
- }
-
+ public static void preInit() {
+ if (LoadedMods.Reliquary) {}
+ }
+
+ public static void init() {
+ if (LoadedMods.Reliquary) {}
+ }
+
+ public static void postInit() {
+ if (LoadedMods.Reliquary) {
+ ReliquaryRecipeHandler.gregifyDefaultRecipes();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java b/src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java
index d1fb67a7d3..27505892d1 100644
--- a/src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java
+++ b/src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java
@@ -1,10 +1,9 @@
package gtPlusPlus.xmod.reliquary.item;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
@@ -12,149 +11,149 @@ import net.minecraft.item.ItemStack;
public class ReliquaryItems {
- private static Class<?> CLASS_MAIN = ReflectionUtils.getClass("xreliquary.Reliquary");
- private static Field FIELD_CONTENT = ReflectionUtils.getField(CLASS_MAIN, "CONTENT");
- private static Object OBJECT_CONTENT = ReflectionUtils.getFieldValue(FIELD_CONTENT);
- private static Method METHOD_GETITEM = ReflectionUtils.getMethod(OBJECT_CONTENT, "getItem", new Class[] {String.class});
-
- public static Item getItem(String name) {
- try {
- return (Item) METHOD_GETITEM.invoke(OBJECT_CONTENT, name);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- return null;
- }
-
- public static ItemStack emptyVoidTear() {
- return new ItemStack(getItem("void_tear_empty"), 1, 0);
- }
-
- public static ItemStack glowingWater() {
- return new ItemStack(getItem("glowing_water"));
- }
-
- public static ItemStack emptyVial() {
- return new ItemStack(getItem("potion"), 1, 0);
- }
-
- public static ItemStack emperorChalice() {
- return new ItemStack(getItem("emperor_chalice"));
- }
-
- public static ItemStack infernalChalice() {
- return new ItemStack(getItem("infernal_chalice"));
- }
-
- public static ItemStack witherSkull() {
- return new ItemStack(Items.skull, 1, 1);
- }
-
- public static ItemStack roseBush() {
- return new ItemStack(Blocks.double_plant, 1, 4);
- }
-
- public static ItemStack blackWool() {
- return new ItemStack(Blocks.wool, 1, 15);
- }
-
- public static ItemStack lapis() {
- return new ItemStack(Items.dye, 1, 4);
- }
-
- public static ItemStack gunPart(int i, int m) {
- return new ItemStack(getItem("gun_part"), i, m);
- }
-
- public static ItemStack magazine(int m) {
- return magazine(1, m);
- }
-
- public static ItemStack magazine(int i, int m) {
- return new ItemStack(getItem("magazine"), i, m);
- }
-
- public static ItemStack bullet(int m) {
- return bullet(1, m);
- }
-
- public static ItemStack bullet(int i, int m) {
- return new ItemStack(getItem("bullet"), i, m);
- }
-
- public static ItemStack ingredient(int m) {
- return new ItemStack(getItem("mob_ingredient"), 1, m);
- }
-
- public static ItemStack enderHeart() {
- return ingredient(11);
- }
-
- public static ItemStack creeperGland() {
- return ingredient(3);
- }
-
- public static ItemStack slimePearl() {
- return ingredient(4);
- }
-
- public static ItemStack batWing() {
- return ingredient(5);
- }
-
- public static ItemStack ribBone() {
- return ingredient(0);
- }
-
- public static ItemStack witherRib() {
- return ingredient(1);
- }
-
- public static ItemStack stormEye() {
- return ingredient(8);
- }
-
- public static ItemStack fertileEssence() {
- return ingredient(9);
- }
-
- public static ItemStack frozenCore() {
- return ingredient(10);
- }
-
- public static ItemStack moltenCore() {
- return ingredient(7);
- }
-
- public static ItemStack zombieHeart() {
- return ingredient(6);
- }
-
- public static ItemStack infernalClaw() {
- return ingredient(13);
- }
-
- public static ItemStack shellFragment() {
- return ingredient(14);
- }
-
- public static ItemStack squidBeak() {
- return ingredient(12);
- }
-
- public static ItemStack spiderFangs() {
- return ingredient(2);
- }
+ private static Class<?> CLASS_MAIN = ReflectionUtils.getClass("xreliquary.Reliquary");
+ private static Field FIELD_CONTENT = ReflectionUtils.getField(CLASS_MAIN, "CONTENT");
+ private static Object OBJECT_CONTENT = ReflectionUtils.getFieldValue(FIELD_CONTENT);
+ private static Method METHOD_GETITEM =
+ ReflectionUtils.getMethod(OBJECT_CONTENT, "getItem", new Class[] {String.class});
+
+ public static Item getItem(String name) {
+ try {
+ return (Item) METHOD_GETITEM.invoke(OBJECT_CONTENT, name);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ return null;
+ }
+
+ public static ItemStack emptyVoidTear() {
+ return new ItemStack(getItem("void_tear_empty"), 1, 0);
+ }
+
+ public static ItemStack glowingWater() {
+ return new ItemStack(getItem("glowing_water"));
+ }
+
+ public static ItemStack emptyVial() {
+ return new ItemStack(getItem("potion"), 1, 0);
+ }
+
+ public static ItemStack emperorChalice() {
+ return new ItemStack(getItem("emperor_chalice"));
+ }
+
+ public static ItemStack infernalChalice() {
+ return new ItemStack(getItem("infernal_chalice"));
+ }
+
+ public static ItemStack witherSkull() {
+ return new ItemStack(Items.skull, 1, 1);
+ }
+
+ public static ItemStack roseBush() {
+ return new ItemStack(Blocks.double_plant, 1, 4);
+ }
+
+ public static ItemStack blackWool() {
+ return new ItemStack(Blocks.wool, 1, 15);
+ }
+
+ public static ItemStack lapis() {
+ return new ItemStack(Items.dye, 1, 4);
+ }
+
+ public static ItemStack gunPart(int i, int m) {
+ return new ItemStack(getItem("gun_part"), i, m);
+ }
+
+ public static ItemStack magazine(int m) {
+ return magazine(1, m);
+ }
+
+ public static ItemStack magazine(int i, int m) {
+ return new ItemStack(getItem("magazine"), i, m);
+ }
+
+ public static ItemStack bullet(int m) {
+ return bullet(1, m);
+ }
+
+ public static ItemStack bullet(int i, int m) {
+ return new ItemStack(getItem("bullet"), i, m);
+ }
+
+ public static ItemStack ingredient(int m) {
+ return new ItemStack(getItem("mob_ingredient"), 1, m);
+ }
+
+ public static ItemStack enderHeart() {
+ return ingredient(11);
+ }
+
+ public static ItemStack creeperGland() {
+ return ingredient(3);
+ }
+
+ public static ItemStack slimePearl() {
+ return ingredient(4);
+ }
+
+ public static ItemStack batWing() {
+ return ingredient(5);
+ }
+
+ public static ItemStack ribBone() {
+ return ingredient(0);
+ }
+
+ public static ItemStack witherRib() {
+ return ingredient(1);
+ }
+
+ public static ItemStack stormEye() {
+ return ingredient(8);
+ }
+
+ public static ItemStack fertileEssence() {
+ return ingredient(9);
+ }
+
+ public static ItemStack frozenCore() {
+ return ingredient(10);
+ }
+
+ public static ItemStack moltenCore() {
+ return ingredient(7);
+ }
+
+ public static ItemStack zombieHeart() {
+ return ingredient(6);
+ }
+
+ public static ItemStack infernalClaw() {
+ return ingredient(13);
+ }
+
+ public static ItemStack shellFragment() {
+ return ingredient(14);
+ }
+
+ public static ItemStack squidBeak() {
+ return ingredient(12);
+ }
- public static ItemStack heartPearl(int m) {
- return new ItemStack(getItem("heart_pearl"), 1, m);
- }
+ public static ItemStack spiderFangs() {
+ return ingredient(2);
+ }
- public static ItemStack nianZhu(int m) {
- return new ItemStack(getItem("heart_zhu"), 1, m);
- }
+ public static ItemStack heartPearl(int m) {
+ return new ItemStack(getItem("heart_pearl"), 1, m);
+ }
- public static ItemStack emptyVoidSatchel() {
- return new ItemStack(getItem("void_tear_empty"), 1, 0);
- }
+ public static ItemStack nianZhu(int m) {
+ return new ItemStack(getItem("heart_zhu"), 1, m);
+ }
+ public static ItemStack emptyVoidSatchel() {
+ return new ItemStack(getItem("void_tear_empty"), 1, 0);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java b/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
index 6086b74ec4..1418a8d086 100644
--- a/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
@@ -1,47 +1,52 @@
package gtPlusPlus.xmod.reliquary.util;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
-
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.ItemStack;
public class AlkahestRecipeWrapper {
- public ItemStack item = null;
- public int yield = 0;
- public int cost = 0;
- public String dictionaryName = null;
+ public ItemStack item = null;
+ public int yield = 0;
+ public int cost = 0;
+ public String dictionaryName = null;
+
+ public AlkahestRecipeWrapper(ItemStack par1, int par2, int par3) {
+ this.item = par1;
+ this.yield = par2;
+ this.cost = par3;
+ }
- public AlkahestRecipeWrapper(ItemStack par1, int par2, int par3) {
- this.item = par1;
- this.yield = par2;
- this.cost = par3;
- }
+ public AlkahestRecipeWrapper(String par1, int par2, int par3) {
+ this.dictionaryName = par1;
+ this.yield = par2;
+ this.cost = par3;
+ }
- public AlkahestRecipeWrapper(String par1, int par2, int par3) {
- this.dictionaryName = par1;
- this.yield = par2;
- this.cost = par3;
- }
+ public Object getOriginalRecipe() {
+ try {
+ Constructor<?> o;
+ if (dictionaryName == null) {
+ o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe")
+ .getConstructor(ItemStack.class, int.class, int.class);
+ } else {
+ o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe")
+ .getConstructor(String.class, int.class, int.class);
+ }
- public Object getOriginalRecipe() {
- try {
- Constructor<?> o;
- if (dictionaryName == null) {
- o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe").getConstructor(ItemStack.class, int.class, int.class);
- }
- else {
- o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe").getConstructor(String.class, int.class, int.class);
- }
-
- Object r = o.newInstance(dictionaryName == null ? item : dictionaryName, yield, cost);
- if (r != null) {
- return r;
- }
+ Object r = o.newInstance(dictionaryName == null ? item : dictionaryName, yield, cost);
+ if (r != null) {
+ return r;
+ }
- } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- // oops
- }
- return null;
- }
-} \ No newline at end of file
+ } catch (NoSuchMethodException
+ | SecurityException
+ | InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ // oops
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java b/src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java
index 1133e67fe6..c0f19fecbc 100644
--- a/src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java
@@ -16,41 +16,57 @@ import net.minecraft.item.ItemStack;
public class ReliquaryRecipeHandler {
- public static boolean removeAlkahestRecipe(ItemStack aOutput) {
- return false;
- }
-
- public static boolean addAlkahestRecipe(ItemStack[] aInputs, ItemStack aOutput) {
- if (aInputs == null || aInputs.length <= 0 || aInputs.length > 9) {
- return false;
- }
- return false;
- }
-
- public static void gregifyDefaultRecipes() {
- Logger.INFO("Gregifying Reliquary recipes.");
- if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.glowingWater())) {
- Logger.INFO("Removing recipe for Glowing Water.");
- }
- if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.emptyVoidTear())) {
- Logger.INFO("Removing recipe for Empty Void Tears.");
- }
- if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.emperorChalice())) {
- Logger.INFO("Removing recipe for the Emperor Chalice.");
- }
- if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.infernalChalice())) {
- Logger.INFO("Removing recipe for the Infernal Chalice.");
- }
- Logger.INFO("Finished removing original recipes.");
-
- // Add new recipes
- if (CORE.RA.addChemicalRecipe(ALLOY.ENERGYCRYSTAL.getDust(4), ReliquaryItems.emptyVial(), FluidUtils.getHotWater(2000), null, ReliquaryItems.glowingWater(), 20 * 30, 500)) {
- Logger.INFO("Added new recipe for Glowing Water.");
- }
- if (CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.simpleMetaStack(Items.ender_eye, 0, 32), CI.getFieldGenerator(5, GTNH ? 8 : 4), CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 8), CI.getEmitter(3, 20)}, FluidUtils.getUUM(50), ReliquaryItems.emptyVoidTear(), 20 * 2000, 2000)){
- Logger.INFO("Added new recipe for Empty Void Tears.");
- }
- Logger.INFO("Finished adding new recipes.");
-
- }
+ public static boolean removeAlkahestRecipe(ItemStack aOutput) {
+ return false;
+ }
+
+ public static boolean addAlkahestRecipe(ItemStack[] aInputs, ItemStack aOutput) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs.length > 9) {
+ return false;
+ }
+ return false;
+ }
+
+ public static void gregifyDefaultRecipes() {
+ Logger.INFO("Gregifying Reliquary recipes.");
+ if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.glowingWater())) {
+ Logger.INFO("Removing recipe for Glowing Water.");
+ }
+ if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.emptyVoidTear())) {
+ Logger.INFO("Removing recipe for Empty Void Tears.");
+ }
+ if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.emperorChalice())) {
+ Logger.INFO("Removing recipe for the Emperor Chalice.");
+ }
+ if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.infernalChalice())) {
+ Logger.INFO("Removing recipe for the Infernal Chalice.");
+ }
+ Logger.INFO("Finished removing original recipes.");
+
+ // Add new recipes
+ if (CORE.RA.addChemicalRecipe(
+ ALLOY.ENERGYCRYSTAL.getDust(4),
+ ReliquaryItems.emptyVial(),
+ FluidUtils.getHotWater(2000),
+ null,
+ ReliquaryItems.glowingWater(),
+ 20 * 30,
+ 500)) {
+ Logger.INFO("Added new recipe for Glowing Water.");
+ }
+ if (CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.simpleMetaStack(Items.ender_eye, 0, 32),
+ CI.getFieldGenerator(5, GTNH ? 8 : 4),
+ CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 8),
+ CI.getEmitter(3, 20)
+ },
+ FluidUtils.getUUM(50),
+ ReliquaryItems.emptyVoidTear(),
+ 20 * 2000,
+ 2000)) {
+ Logger.INFO("Added new recipe for Empty Void Tears.");
+ }
+ Logger.INFO("Finished adding new recipes.");
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/sc2/HANDLER_SC2.java b/src/main/java/gtPlusPlus/xmod/sc2/HANDLER_SC2.java
index f39a69dfbc..0f249b29e8 100644
--- a/src/main/java/gtPlusPlus/xmod/sc2/HANDLER_SC2.java
+++ b/src/main/java/gtPlusPlus/xmod/sc2/HANDLER_SC2.java
@@ -5,17 +5,13 @@ import vswe.stevescarts.ModuleData.GppModuleData;
public class HANDLER_SC2 {
- public synchronized static void preInit() {
- if (LoadedMods.StevesCarts){
- GppModuleData.loadGpp();
- }
- }
-
- public static void init(){
- }
-
- public static void postInit(){
- }
+ public static synchronized void preInit() {
+ if (LoadedMods.StevesCarts) {
+ GppModuleData.loadGpp();
+ }
+ }
+ public static void init() {}
+ public static void postInit() {}
}
diff --git a/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java b/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java
index dfaec8b703..762697b419 100644
--- a/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java
+++ b/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java
@@ -1,117 +1,111 @@
package gtPlusPlus.xmod.sc2.modules;
-import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import static net.minecraft.init.Blocks.farmland;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.lang.reflect.Field;
-
import net.minecraft.block.Block;
import net.minecraft.block.BlockCrops;
import net.minecraft.item.Item;
import net.minecraft.item.ItemSeeds;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-
import vswe.stevescarts.Carts.MinecartModular;
-import vswe.stevescarts.Modules.ICropModule;
import vswe.stevescarts.Modules.Addons.ModuleAddon;
+import vswe.stevescarts.Modules.ICropModule;
public class ModuleExoticSeeds extends ModuleAddon implements ICropModule {
- public ModuleExoticSeeds(MinecartModular cart) {
- super(cart);
- }
-
- private synchronized Block getBlockFromItemSeeds(ItemStack seed) {
- try {
-
- Item seedItem = seed.getItem();
- if (!(seedItem instanceof ItemSeeds)) return null;
-
- Block cropBlock = (Block) ReflectionUtils.getField(ItemSeeds.class, "field_150925_a").get(seedItem);
-
- return cropBlock;
- } catch (Throwable t) {
-
- }
- return null;
- }
-
- @Override
- public boolean isSeedValid(ItemStack seed) {
- return getBlockFromItemSeeds(seed) != null;
- }
-
- @Override
- public Block getCropFromSeed(ItemStack seed) {
- return getBlockFromItemSeeds(seed);
- }
-
- @Override
- public boolean isReadyToHarvest(int x, int y, int z) {
- World world = getCart().worldObj;
- Block b = world.getBlock(x, y, z);
- int m = world.getBlockMetadata(x, y, z);
-
- //If Forestry is loaded, let's make this upgrade convert farmland to Humus.
- /*if (LoadedMods.Forestry) {
- Block mFarmLand = world.getBlock(x, y-1, z);
- if (mFarmLand == farmland) {
- Block h = tryGetHumus();
- if (h != farmland) {
- world.setBlock(x, y-1, z, h);
- }
- }
- }*/
-
-
- return b instanceof BlockCrops && m == 7;
- }
-
-
-
- /**
- * Static Class & Block References for Forestry content.
- * Stops Forestry being a hard requirement for this feature without having to make @Optional annotations.
- */
-
- private static Class<?> mForestryHumusBlockClass;
- private static Class<?> mForestryBlockRegistryCoreClass;
- private static Block mForestryHumusBlock;
-
- private synchronized Block tryGetHumus() {
- if (!LoadedMods.Forestry) {
- return farmland;
- }
- else {
- if (mForestryHumusBlockClass == null || mForestryHumusBlock == null) {
- try {
- mForestryHumusBlockClass = ReflectionUtils.getClass("forestry.plugins.PluginCore");
- Field blocks = ReflectionUtils.getField(mForestryHumusBlockClass, "blocks");
- if (blocks != null) {
- Object blockRegistryCoreObject = blocks.get(null);
- mForestryBlockRegistryCoreClass = ReflectionUtils.getClass("forestry.core.blocks.BlockRegistryCore");
- if (mForestryBlockRegistryCoreClass != null && blockRegistryCoreObject != null) {
- Field soil = ReflectionUtils.getField(mForestryBlockRegistryCoreClass, "soil");
- if (soil != null) {
- Block testHumus = (Block) soil.get(blockRegistryCoreObject);
- if (testHumus != null) {
- mForestryHumusBlock = testHumus;
- }
- }
- }
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
- if (mForestryHumusBlock != null) {
- return mForestryHumusBlock;
- }
- }
- return farmland;
- }
-
-} \ No newline at end of file
+ public ModuleExoticSeeds(MinecartModular cart) {
+ super(cart);
+ }
+
+ private synchronized Block getBlockFromItemSeeds(ItemStack seed) {
+ try {
+
+ Item seedItem = seed.getItem();
+ if (!(seedItem instanceof ItemSeeds)) return null;
+
+ Block cropBlock = (Block)
+ ReflectionUtils.getField(ItemSeeds.class, "field_150925_a").get(seedItem);
+
+ return cropBlock;
+ } catch (Throwable t) {
+
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isSeedValid(ItemStack seed) {
+ return getBlockFromItemSeeds(seed) != null;
+ }
+
+ @Override
+ public Block getCropFromSeed(ItemStack seed) {
+ return getBlockFromItemSeeds(seed);
+ }
+
+ @Override
+ public boolean isReadyToHarvest(int x, int y, int z) {
+ World world = getCart().worldObj;
+ Block b = world.getBlock(x, y, z);
+ int m = world.getBlockMetadata(x, y, z);
+
+ // If Forestry is loaded, let's make this upgrade convert farmland to Humus.
+ /*if (LoadedMods.Forestry) {
+ Block mFarmLand = world.getBlock(x, y-1, z);
+ if (mFarmLand == farmland) {
+ Block h = tryGetHumus();
+ if (h != farmland) {
+ world.setBlock(x, y-1, z, h);
+ }
+ }
+ }*/
+
+ return b instanceof BlockCrops && m == 7;
+ }
+
+ /**
+ * Static Class & Block References for Forestry content.
+ * Stops Forestry being a hard requirement for this feature without having to make @Optional annotations.
+ */
+ private static Class<?> mForestryHumusBlockClass;
+
+ private static Class<?> mForestryBlockRegistryCoreClass;
+ private static Block mForestryHumusBlock;
+
+ private synchronized Block tryGetHumus() {
+ if (!LoadedMods.Forestry) {
+ return farmland;
+ } else {
+ if (mForestryHumusBlockClass == null || mForestryHumusBlock == null) {
+ try {
+ mForestryHumusBlockClass = ReflectionUtils.getClass("forestry.plugins.PluginCore");
+ Field blocks = ReflectionUtils.getField(mForestryHumusBlockClass, "blocks");
+ if (blocks != null) {
+ Object blockRegistryCoreObject = blocks.get(null);
+ mForestryBlockRegistryCoreClass =
+ ReflectionUtils.getClass("forestry.core.blocks.BlockRegistryCore");
+ if (mForestryBlockRegistryCoreClass != null && blockRegistryCoreObject != null) {
+ Field soil = ReflectionUtils.getField(mForestryBlockRegistryCoreClass, "soil");
+ if (soil != null) {
+ Block testHumus = (Block) soil.get(blockRegistryCoreObject);
+ if (testHumus != null) {
+ mForestryHumusBlock = testHumus;
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ if (mForestryHumusBlock != null) {
+ return mForestryHumusBlock;
+ }
+ }
+ return farmland;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/sol/HANDLER_SpiceOfLife.java b/src/main/java/gtPlusPlus/xmod/sol/HANDLER_SpiceOfLife.java
index 11cc5da89c..784cbc7683 100644
--- a/src/main/java/gtPlusPlus/xmod/sol/HANDLER_SpiceOfLife.java
+++ b/src/main/java/gtPlusPlus/xmod/sol/HANDLER_SpiceOfLife.java
@@ -1,61 +1,53 @@
package gtPlusPlus.xmod.sol;
-import java.lang.reflect.Constructor;
-
import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Constructor;
import net.minecraft.item.Item;
public class HANDLER_SpiceOfLife {
- public static final void preInit() {
- if (LoadedMods.SpiceOfLife) {
- //Add a new Lunch Box with a reasonable amount of slots
- tryRegisterNewLunchBox("foodcrate", 12);
- }
- }
-
- public static final void init() {
- if (LoadedMods.SpiceOfLife) {
-
- }
- }
-
- public static final void postInit() {
- if (LoadedMods.SpiceOfLife) {
-
- }
- }
-
- private static boolean tryRegisterNewLunchBox(String aItemName, int aSlots) {
- Item aNewBox = getNewLunchBox(aItemName, aSlots);
- if (aNewBox != null) {
- GameRegistry.registerItem(aNewBox, aItemName);
- Logger.INFO("[Spice of Life] Registered "+aItemName+" as a new food container.");
- return true;
- }
- return false;
- }
-
- private static Item getNewLunchBox(String aItemName, int aSlots) {
- Class aItemFoodContainer = ReflectionUtils.getClass("squeek.spiceoflife.items.ItemFoodContainer");
- if (aItemFoodContainer != null) {
- Constructor aItemFoodContainerConstructor = ReflectionUtils.getConstructor(aItemFoodContainer, new Class[] {String.class, int.class});
- if (aItemFoodContainerConstructor != null) {
- Object aNewObject = ReflectionUtils.createNewInstanceFromConstructor(aItemFoodContainerConstructor, new Object[] {aItemName, aSlots});
- if (aNewObject instanceof Item) {
- Item aNewInstance = (Item) aNewObject;
- return aNewInstance;
- }
- }
- }
- return null;
- }
-
-
-
-
-
+ public static final void preInit() {
+ if (LoadedMods.SpiceOfLife) {
+ // Add a new Lunch Box with a reasonable amount of slots
+ tryRegisterNewLunchBox("foodcrate", 12);
+ }
+ }
+
+ public static final void init() {
+ if (LoadedMods.SpiceOfLife) {}
+ }
+
+ public static final void postInit() {
+ if (LoadedMods.SpiceOfLife) {}
+ }
+
+ private static boolean tryRegisterNewLunchBox(String aItemName, int aSlots) {
+ Item aNewBox = getNewLunchBox(aItemName, aSlots);
+ if (aNewBox != null) {
+ GameRegistry.registerItem(aNewBox, aItemName);
+ Logger.INFO("[Spice of Life] Registered " + aItemName + " as a new food container.");
+ return true;
+ }
+ return false;
+ }
+
+ private static Item getNewLunchBox(String aItemName, int aSlots) {
+ Class aItemFoodContainer = ReflectionUtils.getClass("squeek.spiceoflife.items.ItemFoodContainer");
+ if (aItemFoodContainer != null) {
+ Constructor aItemFoodContainerConstructor =
+ ReflectionUtils.getConstructor(aItemFoodContainer, new Class[] {String.class, int.class});
+ if (aItemFoodContainerConstructor != null) {
+ Object aNewObject = ReflectionUtils.createNewInstanceFromConstructor(
+ aItemFoodContainerConstructor, new Object[] {aItemName, aSlots});
+ if (aNewObject instanceof Item) {
+ Item aNewInstance = (Item) aNewObject;
+ return aNewInstance;
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/HANDLER_Thaumcraft.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/HANDLER_Thaumcraft.java
index b1353cc481..bbda74449b 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/HANDLER_Thaumcraft.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/HANDLER_Thaumcraft.java
@@ -10,50 +10,51 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-public class HANDLER_Thaumcraft {
-
- public static GTPP_AspectCompat sThaumcraftCompat;
- public static Item mResearchNotes;
- public static final AutoMap<Pair<ItemStack, GTPP_AspectStack[]>> sItemsToGetAspects = new AutoMap<Pair<ItemStack, GTPP_AspectStack[]>>();
-
- public static void preInit(){
- if (LoadedMods.Thaumcraft){
- }
- }
-
- public static void init(){
- if (LoadedMods.Thaumcraft){
- try {
- mResearchNotes = (Item) ReflectionUtils.getField(ReflectionUtils.getClass("thaumcraft.common.config.ConfigItems"), "itemResearchNotes").get(null);
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
- mResearchNotes = Items.paper;
- }
- }
- }
-
- public static void postInit(){
- if (LoadedMods.Thaumcraft){
- //Add Custom Aspects
-
-
- //sThaumcraftCompat = (IThaumcraftCompat) GT_Utility.callConstructor("gtPlusPlus.xmod.thaumcraft.aspect.GTPP_AspectCompat", 0, null, GT_Values.D1, new Object[0]);
- //sThaumcraftCompat = new GTPP_AspectCompat();
-
- /*if (!sItemsToGetAspects.isEmpty() && false) {
- for (Pair<ItemStack, GTPP_AspectStack[]> j : sItemsToGetAspects) {
- if (j .getKey() != null && (j.getValue() != null && j.getValue().length > 0)) {
- List<GTPP_AspectStack> list = Arrays.asList(j.getValue());
- if (ThaumcraftUtils.registerThaumcraftAspectsToItem(j.getKey(), list, true)) {
- Logger.WARNING("[Aspect] Successfully added Aspects to "+j.getKey().getDisplayName()+".");
- }
- else {
- Logger.WARNING("[Aspect] Failed adding Aspects to "+j.getKey().getDisplayName()+".");
- }
- }
- }
- }*/
- }
- }
-
+public class HANDLER_Thaumcraft {
+
+ public static GTPP_AspectCompat sThaumcraftCompat;
+ public static Item mResearchNotes;
+ public static final AutoMap<Pair<ItemStack, GTPP_AspectStack[]>> sItemsToGetAspects =
+ new AutoMap<Pair<ItemStack, GTPP_AspectStack[]>>();
+
+ public static void preInit() {
+ if (LoadedMods.Thaumcraft) {}
+ }
+
+ public static void init() {
+ if (LoadedMods.Thaumcraft) {
+ try {
+ mResearchNotes = (Item) ReflectionUtils.getField(
+ ReflectionUtils.getClass("thaumcraft.common.config.ConfigItems"), "itemResearchNotes")
+ .get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ mResearchNotes = Items.paper;
+ }
+ }
+ }
+
+ public static void postInit() {
+ if (LoadedMods.Thaumcraft) {
+ // Add Custom Aspects
+
+ // sThaumcraftCompat = (IThaumcraftCompat)
+ // GT_Utility.callConstructor("gtPlusPlus.xmod.thaumcraft.aspect.GTPP_AspectCompat", 0, null, GT_Values.D1,
+ // new Object[0]);
+ // sThaumcraftCompat = new GTPP_AspectCompat();
+
+ /*if (!sItemsToGetAspects.isEmpty() && false) {
+ for (Pair<ItemStack, GTPP_AspectStack[]> j : sItemsToGetAspects) {
+ if (j .getKey() != null && (j.getValue() != null && j.getValue().length > 0)) {
+ List<GTPP_AspectStack> list = Arrays.asList(j.getValue());
+ if (ThaumcraftUtils.registerThaumcraftAspectsToItem(j.getKey(), list, true)) {
+ Logger.WARNING("[Aspect] Successfully added Aspects to "+j.getKey().getDisplayName()+".");
+ }
+ else {
+ Logger.WARNING("[Aspect] Failed adding Aspects to "+j.getKey().getDisplayName()+".");
+ }
+ }
+ }
+ }*/
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectCompat.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectCompat.java
index 56ad95c5e3..c3d256a132 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectCompat.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectCompat.java
@@ -1,11 +1,5 @@
package gtPlusPlus.xmod.thaumcraft.aspect;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-
import gregtech.api.enums.TC_Aspects;
import gregtech.common.GT_ThaumcraftCompat;
import gtPlusPlus.api.objects.Logger;
@@ -13,188 +7,167 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_AspectList_Wrapper;
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
import net.minecraft.util.ResourceLocation;
public class GTPP_AspectCompat {
-
- public static volatile Method m = null;
-
- private static HashMap<String, TC_Aspect_Wrapper> mAspectCache = new LinkedHashMap<String, TC_Aspect_Wrapper>();
-
- public static TC_Aspect_Wrapper ASPECT_BALANCE;
- public static TC_Aspect_Wrapper ASPECT_LUST;
- public static TC_Aspect_Wrapper ASPECT_STARBOUND;
- public static TC_Aspect_Wrapper ASPECT_TOXIC;
- public static TC_Aspect_Wrapper ASPECT_HEAVEN;
-
-
-/* TC_Aspects.AER.mAspect = Aspect.AIR;
- TC_Aspects.ALIENIS.mAspect = Aspect.ELDRITCH;
- TC_Aspects.AQUA.mAspect = Aspect.WATER;
- TC_Aspects.ARBOR.mAspect = Aspect.TREE;
- TC_Aspects.AURAM.mAspect = Aspect.AURA;
- TC_Aspects.BESTIA.mAspect = Aspect.BEAST;
- TC_Aspects.COGNITIO.mAspect = Aspect.MIND;
- TC_Aspects.CORPUS.mAspect = Aspect.FLESH;
- TC_Aspects.EXANIMIS.mAspect = Aspect.UNDEAD;
- TC_Aspects.FABRICO.mAspect = Aspect.CRAFT;
- TC_Aspects.FAMES.mAspect = Aspect.HUNGER;
- TC_Aspects.GELUM.mAspect = Aspect.COLD;
- TC_Aspects.GRANUM.mAspect = Aspect.PLANT;
- TC_Aspects.HERBA.mAspect = Aspect.PLANT;
- TC_Aspects.HUMANUS.mAspect = Aspect.MAN;
- TC_Aspects.IGNIS.mAspect = Aspect.FIRE;
- TC_Aspects.INSTRUMENTUM.mAspect = Aspect.TOOL;
- TC_Aspects.ITER.mAspect = Aspect.TRAVEL;
- TC_Aspects.LIMUS.mAspect = Aspect.SLIME;
- TC_Aspects.LUCRUM.mAspect = Aspect.GREED;
- TC_Aspects.LUX.mAspect = Aspect.LIGHT;
- TC_Aspects.MACHINA.mAspect = Aspect.MECHANISM;
- TC_Aspects.MESSIS.mAspect = Aspect.CROP;
- TC_Aspects.METALLUM.mAspect = Aspect.METAL;
- TC_Aspects.METO.mAspect = Aspect.HARVEST;
- TC_Aspects.MORTUUS.mAspect = Aspect.DEATH;
- TC_Aspects.MOTUS.mAspect = Aspect.MOTION;
- TC_Aspects.ORDO.mAspect = Aspect.ORDER;
- TC_Aspects.PANNUS.mAspect = Aspect.CLOTH;
- TC_Aspects.PERDITIO.mAspect = Aspect.ENTROPY;
- TC_Aspects.PERFODIO.mAspect = Aspect.MINE;
- TC_Aspects.PERMUTATIO.mAspect = Aspect.EXCHANGE;
- TC_Aspects.POTENTIA.mAspect = Aspect.ENERGY;
- TC_Aspects.PRAECANTATIO.mAspect = Aspect.MAGIC;
- TC_Aspects.SANO.mAspect = Aspect.HEAL;
- TC_Aspects.SENSUS.mAspect = Aspect.SENSES;
- TC_Aspects.SPIRITUS.mAspect = Aspect.SOUL;
- TC_Aspects.TELUM.mAspect = Aspect.WEAPON;
- TC_Aspects.TERRA.mAspect = Aspect.EARTH;
- TC_Aspects.TEMPESTAS.mAspect = Aspect.WEATHER;
- TC_Aspects.TENEBRAE.mAspect = Aspect.DARKNESS;
- TC_Aspects.TUTAMEN.mAspect = Aspect.ARMOR;
- TC_Aspects.VACUOS.mAspect = Aspect.VOID;
- TC_Aspects.VENENUM.mAspect = Aspect.POISON;
- TC_Aspects.VICTUS.mAspect = Aspect.LIFE;
- TC_Aspects.VINCULUM.mAspect = Aspect.TRAP;
- TC_Aspects.VITIUM.mAspect = Aspect.TAINT;
- TC_Aspects.VITREUS.mAspect = Aspect.CRYSTAL;
- TC_Aspects.VOLATUS.mAspect = Aspect.FLIGHT;*/
-
-
- public GTPP_AspectCompat() {
-
-
- // Generate all existing Aspects as TC_Aspects
- LinkedHashMap<String, Object> h = TC_Aspect_Wrapper.getVanillaAspectList();
- for (String g : h.keySet()) {
- Object aBaseAspect = h.get(g);
- if (aBaseAspect != null && TC_Aspect_Wrapper.isObjectAnAspect(aBaseAspect)) {
- TC_Aspect_Wrapper aS = TC_Aspect_Wrapper.getAspect(g);
- if (aS != null) {
- mAspectCache.put(g, aS);
- continue;
- }
- }
- }
-
-
-
-
- // Custom Aspects
- ASPECT_BALANCE =
- new TC_Aspect_Wrapper(
- "Sagrausten",
- Utils.rgbtoHexValue(125, 125, 125),
- new TC_Aspect_Wrapper[]{
- ASPECT_STARBOUND,
- get(TC_Aspects.RADIO)
- },
- new ResourceLocation(CORE.MODID+":textures/aspects/" + "Sagrausten.png"),
- false,
- 1,
- "Ancient Knowledge");
+ public static volatile Method m = null;
+
+ private static HashMap<String, TC_Aspect_Wrapper> mAspectCache = new LinkedHashMap<String, TC_Aspect_Wrapper>();
+
+ public static TC_Aspect_Wrapper ASPECT_BALANCE;
+ public static TC_Aspect_Wrapper ASPECT_LUST;
+ public static TC_Aspect_Wrapper ASPECT_STARBOUND;
+ public static TC_Aspect_Wrapper ASPECT_TOXIC;
+ public static TC_Aspect_Wrapper ASPECT_HEAVEN;
+
+ /* TC_Aspects.AER.mAspect = Aspect.AIR;
+ TC_Aspects.ALIENIS.mAspect = Aspect.ELDRITCH;
+ TC_Aspects.AQUA.mAspect = Aspect.WATER;
+ TC_Aspects.ARBOR.mAspect = Aspect.TREE;
+ TC_Aspects.AURAM.mAspect = Aspect.AURA;
+ TC_Aspects.BESTIA.mAspect = Aspect.BEAST;
+ TC_Aspects.COGNITIO.mAspect = Aspect.MIND;
+ TC_Aspects.CORPUS.mAspect = Aspect.FLESH;
+ TC_Aspects.EXANIMIS.mAspect = Aspect.UNDEAD;
+ TC_Aspects.FABRICO.mAspect = Aspect.CRAFT;
+ TC_Aspects.FAMES.mAspect = Aspect.HUNGER;
+ TC_Aspects.GELUM.mAspect = Aspect.COLD;
+ TC_Aspects.GRANUM.mAspect = Aspect.PLANT;
+ TC_Aspects.HERBA.mAspect = Aspect.PLANT;
+ TC_Aspects.HUMANUS.mAspect = Aspect.MAN;
+ TC_Aspects.IGNIS.mAspect = Aspect.FIRE;
+ TC_Aspects.INSTRUMENTUM.mAspect = Aspect.TOOL;
+ TC_Aspects.ITER.mAspect = Aspect.TRAVEL;
+ TC_Aspects.LIMUS.mAspect = Aspect.SLIME;
+ TC_Aspects.LUCRUM.mAspect = Aspect.GREED;
+ TC_Aspects.LUX.mAspect = Aspect.LIGHT;
+ TC_Aspects.MACHINA.mAspect = Aspect.MECHANISM;
+ TC_Aspects.MESSIS.mAspect = Aspect.CROP;
+ TC_Aspects.METALLUM.mAspect = Aspect.METAL;
+ TC_Aspects.METO.mAspect = Aspect.HARVEST;
+ TC_Aspects.MORTUUS.mAspect = Aspect.DEATH;
+ TC_Aspects.MOTUS.mAspect = Aspect.MOTION;
+ TC_Aspects.ORDO.mAspect = Aspect.ORDER;
+ TC_Aspects.PANNUS.mAspect = Aspect.CLOTH;
+ TC_Aspects.PERDITIO.mAspect = Aspect.ENTROPY;
+ TC_Aspects.PERFODIO.mAspect = Aspect.MINE;
+ TC_Aspects.PERMUTATIO.mAspect = Aspect.EXCHANGE;
+ TC_Aspects.POTENTIA.mAspect = Aspect.ENERGY;
+ TC_Aspects.PRAECANTATIO.mAspect = Aspect.MAGIC;
+ TC_Aspects.SANO.mAspect = Aspect.HEAL;
+ TC_Aspects.SENSUS.mAspect = Aspect.SENSES;
+ TC_Aspects.SPIRITUS.mAspect = Aspect.SOUL;
+ TC_Aspects.TELUM.mAspect = Aspect.WEAPON;
+ TC_Aspects.TERRA.mAspect = Aspect.EARTH;
+ TC_Aspects.TEMPESTAS.mAspect = Aspect.WEATHER;
+ TC_Aspects.TENEBRAE.mAspect = Aspect.DARKNESS;
+ TC_Aspects.TUTAMEN.mAspect = Aspect.ARMOR;
+ TC_Aspects.VACUOS.mAspect = Aspect.VOID;
+ TC_Aspects.VENENUM.mAspect = Aspect.POISON;
+ TC_Aspects.VICTUS.mAspect = Aspect.LIFE;
+ TC_Aspects.VINCULUM.mAspect = Aspect.TRAP;
+ TC_Aspects.VITIUM.mAspect = Aspect.TAINT;
+ TC_Aspects.VITREUS.mAspect = Aspect.CRYSTAL;
+ TC_Aspects.VOLATUS.mAspect = Aspect.FLIGHT;*/
+
+ public GTPP_AspectCompat() {
+
+ // Generate all existing Aspects as TC_Aspects
+ LinkedHashMap<String, Object> h = TC_Aspect_Wrapper.getVanillaAspectList();
+ for (String g : h.keySet()) {
+ Object aBaseAspect = h.get(g);
+ if (aBaseAspect != null && TC_Aspect_Wrapper.isObjectAnAspect(aBaseAspect)) {
+ TC_Aspect_Wrapper aS = TC_Aspect_Wrapper.getAspect(g);
+ if (aS != null) {
+ mAspectCache.put(g, aS);
+ continue;
+ }
+ }
+ }
+
+ // Custom Aspects
+ ASPECT_BALANCE = new TC_Aspect_Wrapper(
+ "Sagrausten",
+ Utils.rgbtoHexValue(125, 125, 125),
+ new TC_Aspect_Wrapper[] {ASPECT_STARBOUND, get(TC_Aspects.RADIO)},
+ new ResourceLocation(CORE.MODID + ":textures/aspects/" + "Sagrausten.png"),
+ false,
+ 1,
+ "Ancient Knowledge");
- ASPECT_LUST =
- new TC_Aspect_Wrapper(
- "Slusium",
- Utils.rgbtoHexValue(175, 125, 25),
- new TC_Aspect_Wrapper[]{
- ASPECT_BALANCE,
- get(TC_Aspects.NEBRISUM)
- },
- new ResourceLocation(CORE.MODID+":textures/aspects/" + "Slusium.png"),
- false,
- 1,
- "Warped Thoughts");
+ ASPECT_LUST = new TC_Aspect_Wrapper(
+ "Slusium",
+ Utils.rgbtoHexValue(175, 125, 25),
+ new TC_Aspect_Wrapper[] {ASPECT_BALANCE, get(TC_Aspects.NEBRISUM)},
+ new ResourceLocation(CORE.MODID + ":textures/aspects/" + "Slusium.png"),
+ false,
+ 1,
+ "Warped Thoughts");
- ASPECT_STARBOUND =
- new TC_Aspect_Wrapper(
- "Xenil",
- Utils.rgbtoHexValue(25, 25, 25),
- new TC_Aspect_Wrapper[]{
- get(TC_Aspects.MAGNETO),
- get(TC_Aspects.RADIO)},
- new ResourceLocation(CORE.MODID+":textures/aspects/" + "Xenil.png"),
- false,
- 1,
- "A beginning to something new");
+ ASPECT_STARBOUND = new TC_Aspect_Wrapper(
+ "Xenil",
+ Utils.rgbtoHexValue(25, 25, 25),
+ new TC_Aspect_Wrapper[] {get(TC_Aspects.MAGNETO), get(TC_Aspects.RADIO)},
+ new ResourceLocation(CORE.MODID + ":textures/aspects/" + "Xenil.png"),
+ false,
+ 1,
+ "A beginning to something new");
- ASPECT_TOXIC =
- new TC_Aspect_Wrapper(
- "Xablum",
- Utils.rgbtoHexValue(25, 185, 25),
- new TC_Aspect_Wrapper[]{
- ASPECT_STARBOUND,
- ASPECT_LUST
- },
- new ResourceLocation(CORE.MODID+":textures/aspects/" + "Xablum.png"),
- false,
- 1,
- "Insanity");
+ ASPECT_TOXIC = new TC_Aspect_Wrapper(
+ "Xablum",
+ Utils.rgbtoHexValue(25, 185, 25),
+ new TC_Aspect_Wrapper[] {ASPECT_STARBOUND, ASPECT_LUST},
+ new ResourceLocation(CORE.MODID + ":textures/aspects/" + "Xablum.png"),
+ false,
+ 1,
+ "Insanity");
- ASPECT_HEAVEN =
- new TC_Aspect_Wrapper(
- "Zetralt",
- Utils.rgbtoHexValue(225, 225, 225),
- new TC_Aspect_Wrapper[]{
- get(TC_Aspects.AURAM),
- ASPECT_TOXIC
- },
- new ResourceLocation(CORE.MODID+":textures/aspects/" + "Zetralt.png"),
- false,
- 1,
- "Control, Respect, Glory");
-
-
- }
-
- private TC_Aspect_Wrapper get(TC_Aspects aGtObjects) {
- try {
- return TC_Aspect_Wrapper.generate(aGtObjects.mAspect);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- return null;
- }
- }
+ ASPECT_HEAVEN = new TC_Aspect_Wrapper(
+ "Zetralt",
+ Utils.rgbtoHexValue(225, 225, 225),
+ new TC_Aspect_Wrapper[] {get(TC_Aspects.AURAM), ASPECT_TOXIC},
+ new ResourceLocation(CORE.MODID + ":textures/aspects/" + "Zetralt.png"),
+ false,
+ 1,
+ "Control, Respect, Glory");
+ }
- public static synchronized final TC_AspectList_Wrapper getTC_AspectList_Wrapper(final List<GTPP_AspectStack> aAspects) {
- TC_AspectList_Wrapper o = null;
- try {
- if (m == null || (m != null && !m.isAccessible())) {
- m = GT_ThaumcraftCompat.class.getDeclaredMethod("getTC_AspectList_Wrapper", List.class);
- m.setAccessible(true);
- }
- if (m != null) {
- o = (TC_AspectList_Wrapper) m.invoke(null, aAspects);
- }
- }
- catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- if (o == null) {
- Logger.REFLECTION("[Aspect] Did not retrieve valid aspect list from reflective invocation.");
- }
- return o;
- }
+ private TC_Aspect_Wrapper get(TC_Aspects aGtObjects) {
+ try {
+ return TC_Aspect_Wrapper.generate(aGtObjects.mAspect);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
-
-} \ No newline at end of file
+ public static final synchronized TC_AspectList_Wrapper getTC_AspectList_Wrapper(
+ final List<GTPP_AspectStack> aAspects) {
+ TC_AspectList_Wrapper o = null;
+ try {
+ if (m == null || (m != null && !m.isAccessible())) {
+ m = GT_ThaumcraftCompat.class.getDeclaredMethod("getTC_AspectList_Wrapper", List.class);
+ m.setAccessible(true);
+ }
+ if (m != null) {
+ o = (TC_AspectList_Wrapper) m.invoke(null, aAspects);
+ }
+ } catch (NoSuchMethodException
+ | SecurityException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ if (o == null) {
+ Logger.REFLECTION("[Aspect] Did not retrieve valid aspect list from reflective invocation.");
+ }
+ return o;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectStack.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectStack.java
index 23e9035f40..e48bd64e53 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectStack.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectStack.java
@@ -4,12 +4,11 @@ import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper;
public class GTPP_AspectStack {
- public final TC_Aspect_Wrapper mAspect;
- public final int mAmount;
-
- public GTPP_AspectStack(TC_Aspect_Wrapper aAspect, int aAmount) {
- mAspect = aAspect;
- mAmount= aAmount;
- }
+ public final TC_Aspect_Wrapper mAspect;
+ public final int mAmount;
+ public GTPP_AspectStack(TC_Aspect_Wrapper aAspect, int aAmount) {
+ mAspect = aAspect;
+ mAmount = aAmount;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/commands/CommandDumpAspects.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/commands/CommandDumpAspects.java
index dda5a62b27..6f1d53bc33 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/commands/CommandDumpAspects.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/commands/CommandDumpAspects.java
@@ -2,89 +2,90 @@ package gtPlusPlus.xmod.thaumcraft.commands;
import static gtPlusPlus.core.util.minecraft.PlayerUtils.messagePlayer;
-import java.util.ArrayList;
-import java.util.List;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.commands.CommandUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.thaumcraft.objects.ThreadAspectScanner;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
public class CommandDumpAspects implements ICommand {
- private final List<String> aliases;
- public static long mLastScanTime = System.currentTimeMillis();
-
- public CommandDumpAspects() {
- this.aliases = new ArrayList<>();
- this.aliases.add("DA");
- this.aliases.add("da");
- this.aliases.add("dumpaspects");
- this.aliases.add("dumptc");
- Logger.INFO("Registered Aspect Dump Command.");
- }
+ private final List<String> aliases;
+ public static long mLastScanTime = System.currentTimeMillis();
- @Override
- public int compareTo(final Object o) {
- return 0;
- }
+ public CommandDumpAspects() {
+ this.aliases = new ArrayList<>();
+ this.aliases.add("DA");
+ this.aliases.add("da");
+ this.aliases.add("dumpaspects");
+ this.aliases.add("dumptc");
+ Logger.INFO("Registered Aspect Dump Command.");
+ }
- @Override
- public String getCommandName() {
- return "DumpAspects";
- }
+ @Override
+ public int compareTo(final Object o) {
+ return 0;
+ }
- @Override
- public String getCommandUsage(final ICommandSender var1) {
- return "/DumpAspects";
- }
+ @Override
+ public String getCommandName() {
+ return "DumpAspects";
+ }
- @Override
- public List<String> getCommandAliases() {
- return this.aliases;
- }
+ @Override
+ public String getCommandUsage(final ICommandSender var1) {
+ return "/DumpAspects";
+ }
- @Override
- public void processCommand(final ICommandSender S, final String[] argString) {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- final long T = System.currentTimeMillis();
- final long D = T - mLastScanTime;
- final int Z = (int) (D / 1000);
- if (Z >= 30) {
- // Lets process this in the Background on a new Thread.
- Thread t = createNewThread();
- messagePlayer(P, "Beginning to dump information about all items/blocks & their aspects to file.");
- messagePlayer(P, "Please do not close your game during this process, you will be notified upon completion.");
- t.start();
- } else {
- messagePlayer(P, "Your last run of DA was less than 30 seconds ago, please wait " + (30 - Z)
- + " seconds before trying again.");
- }
- }
+ @Override
+ public List<String> getCommandAliases() {
+ return this.aliases;
+ }
- @Override
- public boolean canCommandSenderUseCommand(final ICommandSender var1) {
- final EntityPlayer P = CommandUtils.getPlayer(var1);
- if (P == null || !PlayerUtils.isPlayerOP(P)) {
- return false;
- }
- return true;
- }
+ @Override
+ public void processCommand(final ICommandSender S, final String[] argString) {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ final long T = System.currentTimeMillis();
+ final long D = T - mLastScanTime;
+ final int Z = (int) (D / 1000);
+ if (Z >= 30) {
+ // Lets process this in the Background on a new Thread.
+ Thread t = createNewThread();
+ messagePlayer(P, "Beginning to dump information about all items/blocks & their aspects to file.");
+ messagePlayer(
+ P, "Please do not close your game during this process, you will be notified upon completion.");
+ t.start();
+ } else {
+ messagePlayer(
+ P,
+ "Your last run of DA was less than 30 seconds ago, please wait " + (30 - Z)
+ + " seconds before trying again.");
+ }
+ }
- @Override
- public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2) {
- return null;
- }
+ @Override
+ public boolean canCommandSenderUseCommand(final ICommandSender var1) {
+ final EntityPlayer P = CommandUtils.getPlayer(var1);
+ if (P == null || !PlayerUtils.isPlayerOP(P)) {
+ return false;
+ }
+ return true;
+ }
- @Override
- public boolean isUsernameIndex(final String[] var1, final int var2) {
- return false;
- }
+ @Override
+ public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2) {
+ return null;
+ }
- private static Thread createNewThread() {
- return new ThreadAspectScanner();
- }
+ @Override
+ public boolean isUsernameIndex(final String[] var1, final int var2) {
+ return false;
+ }
-} \ No newline at end of file
+ private static Thread createNewThread() {
+ return new ThreadAspectScanner();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java
index fdcf7b8498..896c68aa3a 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java
@@ -1,13 +1,5 @@
package gtPlusPlus.xmod.thaumcraft.objects;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
@@ -15,144 +7,150 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.data.FileUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.thaumcraft.commands.CommandDumpAspects;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class ThreadAspectScanner extends Thread {
- public static boolean mDoWeScan = false;
- private static final Map<String, AutoMap<ItemStack>> mAllGameContent = new HashMap<String, AutoMap<ItemStack>>();
- public final File mAspectCacheFile;
-
- public ThreadAspectScanner() {
- mAspectCacheFile = FileUtils.getFile("config/GTplusplus", "AspectInfo", "txt");
- mDoWeScan = true;
- }
+ public static boolean mDoWeScan = false;
+ private static final Map<String, AutoMap<ItemStack>> mAllGameContent = new HashMap<String, AutoMap<ItemStack>>();
+ public final File mAspectCacheFile;
- private void tryCacheObject(ItemStack aStack) {
- if (aStack == null) {
- return;
- }
- String nameKey;
- try {
- nameKey = ItemUtils.getUnlocalizedItemName(aStack);
- } catch (NullPointerException n) {
- try {
- nameKey = Utils.sanitizeString(aStack.getDisplayName().toLowerCase());
- } catch (NullPointerException n2) {
- try {
- nameKey = aStack.getItem().getUnlocalizedName();
- } catch (NullPointerException n3) {
- nameKey = "BadItemsGalore";
- }
- }
- }
- AutoMap<ItemStack> m = new AutoMap<ItemStack>();
- if (mAllGameContent.containsKey(nameKey)) {
- m = mAllGameContent.get(nameKey);
- }
- m.put(aStack);
- mAllGameContent.put(nameKey, m);
- }
+ public ThreadAspectScanner() {
+ mAspectCacheFile = FileUtils.getFile("config/GTplusplus", "AspectInfo", "txt");
+ mDoWeScan = true;
+ }
- @SuppressWarnings({ "rawtypes" })
- @Override
- public void run() {
- if (mDoWeScan) {
- Iterator iterator;
- Logger.INFO("Finding Blocks and Items to scan for Aspect data.");
- long mBlocksCounter = 0;
- long mItemsCounter = 0;
+ private void tryCacheObject(ItemStack aStack) {
+ if (aStack == null) {
+ return;
+ }
+ String nameKey;
+ try {
+ nameKey = ItemUtils.getUnlocalizedItemName(aStack);
+ } catch (NullPointerException n) {
+ try {
+ nameKey = Utils.sanitizeString(aStack.getDisplayName().toLowerCase());
+ } catch (NullPointerException n2) {
+ try {
+ nameKey = aStack.getItem().getUnlocalizedName();
+ } catch (NullPointerException n3) {
+ nameKey = "BadItemsGalore";
+ }
+ }
+ }
+ AutoMap<ItemStack> m = new AutoMap<ItemStack>();
+ if (mAllGameContent.containsKey(nameKey)) {
+ m = mAllGameContent.get(nameKey);
+ }
+ m.put(aStack);
+ mAllGameContent.put(nameKey, m);
+ }
- // First, find blocks
- iterator = Block.blockRegistry.getKeys().iterator();
- while (iterator.hasNext()) {
- String s = (String) iterator.next();
- Block block = (Block) Block.blockRegistry.getObject(s);
- if (block != null) {
- tryCacheObject(ItemUtils.getSimpleStack(block));
- mBlocksCounter++;
- }
- }
- Logger.INFO("Completed Block Scan. Counted "+mBlocksCounter);
+ @SuppressWarnings({"rawtypes"})
+ @Override
+ public void run() {
+ if (mDoWeScan) {
+ Iterator iterator;
+ Logger.INFO("Finding Blocks and Items to scan for Aspect data.");
+ long mBlocksCounter = 0;
+ long mItemsCounter = 0;
- // Second Find items, Skipping things that exist.
- iterator = Item.itemRegistry.getKeys().iterator();
- while (iterator.hasNext()) {
- String s = (String) iterator.next();
- Item item = (Item) Item.itemRegistry.getObject(s);
- if (item != null) {
- if (item.getHasSubtypes()) {
- List q1 = new ArrayList();
- item.getSubItems(item, item.getCreativeTab(), q1);
- if (q1 != null && q1.size() > 0) {
- for (int e = 0; e < q1.size(); e++) {
- ItemStack check = ItemUtils.simpleMetaStack(item, e, 1);
- if (check != null) {
- tryCacheObject(check);
- mItemsCounter++;
- }
- }
- } else {
- tryCacheObject(ItemUtils.getSimpleStack(item));
- mItemsCounter++;
- }
- } else {
- tryCacheObject(ItemUtils.getSimpleStack(item));
- mItemsCounter++;
- }
- }
- }
- Logger.INFO("Completed Item Scan. Counted "+mItemsCounter);
+ // First, find blocks
+ iterator = Block.blockRegistry.getKeys().iterator();
+ while (iterator.hasNext()) {
+ String s = (String) iterator.next();
+ Block block = (Block) Block.blockRegistry.getObject(s);
+ if (block != null) {
+ tryCacheObject(ItemUtils.getSimpleStack(block));
+ mBlocksCounter++;
+ }
+ }
+ Logger.INFO("Completed Block Scan. Counted " + mBlocksCounter);
- Set<String> y = mAllGameContent.keySet();
- Logger.INFO("Beginning iteration of "+y.size()+" itemstacks for aspect information.");
+ // Second Find items, Skipping things that exist.
+ iterator = Item.itemRegistry.getKeys().iterator();
+ while (iterator.hasNext()) {
+ String s = (String) iterator.next();
+ Item item = (Item) Item.itemRegistry.getObject(s);
+ if (item != null) {
+ if (item.getHasSubtypes()) {
+ List q1 = new ArrayList();
+ item.getSubItems(item, item.getCreativeTab(), q1);
+ if (q1 != null && q1.size() > 0) {
+ for (int e = 0; e < q1.size(); e++) {
+ ItemStack check = ItemUtils.simpleMetaStack(item, e, 1);
+ if (check != null) {
+ tryCacheObject(check);
+ mItemsCounter++;
+ }
+ }
+ } else {
+ tryCacheObject(ItemUtils.getSimpleStack(item));
+ mItemsCounter++;
+ }
+ } else {
+ tryCacheObject(ItemUtils.getSimpleStack(item));
+ mItemsCounter++;
+ }
+ }
+ }
+ Logger.INFO("Completed Item Scan. Counted " + mItemsCounter);
- for (String key : y) {
- //Logger.INFO("Looking for key: "+key);
- if (mAllGameContent.containsKey(key)) {
- AutoMap<ItemStack> group = mAllGameContent.get(key);
- if (group == null || group.size() <= 0) {
- continue;
- }
- for (ItemStack stack : group) {
- thaumcraft.api.aspects.AspectList a = thaumcraft.common.lib.crafting.ThaumcraftCraftingManager
- .getObjectTags(stack);
- if (a == null) {
- continue;
- } else {
- AutoMap<Pair<String, Integer>> aspectPairs = new AutoMap<Pair<String, Integer>>();
- for (thaumcraft.api.aspects.Aspect c : a.getAspectsSortedAmount()) {
- if (c != null) {
- aspectPairs.put(new Pair<String, Integer>(c.getName(), a.getAmount(c)));
- }
- }
- try {
- List<String> mList = new ArrayList<String>();
- mList.add(stack.getDisplayName() + " | Meta: " + stack.getItemDamage()
- + " | Unlocal: " + stack.getUnlocalizedName());
- for (Pair<String, Integer> r : aspectPairs) {
- if (r != null) {
- mList.add(r.getKey() + " x" + r.getValue());
- }
- }
- mList.add("");
- if (mAspectCacheFile != null && mList.size() >= 3) {
- FileUtils.appendListToFile(mAspectCacheFile, mList);
- }
- }
- catch (Throwable t) {
- Logger.INFO("Error while iterating one item. "+t);
- }
- }
- }
- }
- }
- Logger.INFO("Completed Aspect Iteration. AspectInfo.txt is now available to process in the GTplusplus configuration folder.");
- CommandDumpAspects.mLastScanTime = System.currentTimeMillis();
- }
- return;
- }
+ Set<String> y = mAllGameContent.keySet();
+ Logger.INFO("Beginning iteration of " + y.size() + " itemstacks for aspect information.");
+ for (String key : y) {
+ // Logger.INFO("Looking for key: "+key);
+ if (mAllGameContent.containsKey(key)) {
+ AutoMap<ItemStack> group = mAllGameContent.get(key);
+ if (group == null || group.size() <= 0) {
+ continue;
+ }
+ for (ItemStack stack : group) {
+ thaumcraft.api.aspects.AspectList a =
+ thaumcraft.common.lib.crafting.ThaumcraftCraftingManager.getObjectTags(stack);
+ if (a == null) {
+ continue;
+ } else {
+ AutoMap<Pair<String, Integer>> aspectPairs = new AutoMap<Pair<String, Integer>>();
+ for (thaumcraft.api.aspects.Aspect c : a.getAspectsSortedAmount()) {
+ if (c != null) {
+ aspectPairs.put(new Pair<String, Integer>(c.getName(), a.getAmount(c)));
+ }
+ }
+ try {
+ List<String> mList = new ArrayList<String>();
+ mList.add(stack.getDisplayName() + " | Meta: " + stack.getItemDamage() + " | Unlocal: "
+ + stack.getUnlocalizedName());
+ for (Pair<String, Integer> r : aspectPairs) {
+ if (r != null) {
+ mList.add(r.getKey() + " x" + r.getValue());
+ }
+ }
+ mList.add("");
+ if (mAspectCacheFile != null && mList.size() >= 3) {
+ FileUtils.appendListToFile(mAspectCacheFile, mList);
+ }
+ } catch (Throwable t) {
+ Logger.INFO("Error while iterating one item. " + t);
+ }
+ }
+ }
+ }
+ }
+ Logger.INFO(
+ "Completed Aspect Iteration. AspectInfo.txt is now available to process in the GTplusplus configuration folder.");
+ CommandDumpAspects.mLastScanTime = System.currentTimeMillis();
+ }
+ return;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_AspectList_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_AspectList_Wrapper.java
index 9df38ca384..346d0d3c8b 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_AspectList_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_AspectList_Wrapper.java
@@ -4,37 +4,29 @@ import net.minecraft.item.ItemStack;
public class TC_AspectList_Wrapper {
+ // thaumcraft.api.aspects.Aspect;
+ // thaumcraft.api.aspects.AspectList;
- //thaumcraft.api.aspects.Aspect;
- //thaumcraft.api.aspects.AspectList;
-
- public TC_AspectList_Wrapper() {
-
- }
-
- public TC_AspectList_Wrapper(ItemStack stack) {
-
- }
-
- public TC_AspectList_Wrapper(Object invoke) {
- // TODO Auto-generated constructor stub
- }
-
- public int size() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public Object getVanillaAspectList() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void add(TC_Aspect_Wrapper mAspect, int mAmount) {
- // TODO Auto-generated method stub
-
- }
-
-
-
+ public TC_AspectList_Wrapper() {}
+
+ public TC_AspectList_Wrapper(ItemStack stack) {}
+
+ public TC_AspectList_Wrapper(Object invoke) {
+ // TODO Auto-generated constructor stub
+ }
+
+ public int size() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public Object getVanillaAspectList() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void add(TC_Aspect_Wrapper mAspect, int mAmount) {
+ // TODO Auto-generated method stub
+
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_Aspect_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_Aspect_Wrapper.java
index fda0fd27c5..6847fcfe69 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_Aspect_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/aspect/TC_Aspect_Wrapper.java
@@ -1,18 +1,17 @@
package gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect;
-import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
import gregtech.api.enums.TC_Aspects;
import gregtech.api.util.GT_LanguageManager;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.thaumcraft.util.ThaumcraftUtils;
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.LinkedHashMap;
+import java.util.Map;
import net.minecraft.util.ResourceLocation;
/**
@@ -23,305 +22,300 @@ import net.minecraft.util.ResourceLocation;
*/
public class TC_Aspect_Wrapper {
- private static Class mClass_Aspect;
- private static Field mField_Aspects;
-
- private final String tag;
- private final TC_Aspect_Wrapper[] components;
- private final int color;
- private String chatcolor;
- private final ResourceLocation image;
- private final int blend;
-
- public final Object mAspect;
-
- /**
- * May be null, but links back to the TC_Aspects class from GT for convinience.
- */
- public final TC_Aspects mGtEnumField;
-
-
-
-
- /**
- * Statically set the Class objects
- */
- static {
- mClass_Aspect = ReflectionUtils.getClass("thaumcraft.api.aspects.Aspect");
- }
-
- /**
- * Gets the total aspect list from Thaumcraft, which should contain all other registered aspects.
- * @return - A LinkedHashMap(String, Aspect);
- */
- public static LinkedHashMap<String, Object> getVanillaAspectList() {
- try {
- if (mField_Aspects == null) {
- mField_Aspects = ReflectionUtils.getField(mClass_Aspect, "aspects");
- }
- return (LinkedHashMap<String, Object>) mField_Aspects.get(null);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- Logger.REFLECTION("Failed configuring TC Aspect compatibility.");
- return new LinkedHashMap<String, Object>();
- }
- }
-
- public static Object getVanillaAspectObject(String aAspectName) {
- return getVanillaAspectList().get(aAspectName);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /**
- * Vanilla Aspect Constructor
- * @param tag - Aspect Name
- * @param color
- * @param chatcolor
- * @param blend
- */
- public TC_Aspect_Wrapper(String tag, int color, String chatcolor, int blend, String aTooltip) {
- this(tag, color, (TC_Aspect_Wrapper[]) null, blend, aTooltip);
- this.chatcolor = chatcolor;
- }
+ private static Class mClass_Aspect;
+ private static Field mField_Aspects;
+
+ private final String tag;
+ private final TC_Aspect_Wrapper[] components;
+ private final int color;
+ private String chatcolor;
+ private final ResourceLocation image;
+ private final int blend;
+
+ public final Object mAspect;
+
+ /**
+ * May be null, but links back to the TC_Aspects class from GT for convinience.
+ */
+ public final TC_Aspects mGtEnumField;
+
+ /**
+ * Statically set the Class objects
+ */
+ static {
+ mClass_Aspect = ReflectionUtils.getClass("thaumcraft.api.aspects.Aspect");
+ }
+
+ /**
+ * Gets the total aspect list from Thaumcraft, which should contain all other registered aspects.
+ * @return - A LinkedHashMap(String, Aspect);
+ */
+ public static LinkedHashMap<String, Object> getVanillaAspectList() {
+ try {
+ if (mField_Aspects == null) {
+ mField_Aspects = ReflectionUtils.getField(mClass_Aspect, "aspects");
+ }
+ return (LinkedHashMap<String, Object>) mField_Aspects.get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ Logger.REFLECTION("Failed configuring TC Aspect compatibility.");
+ return new LinkedHashMap<String, Object>();
+ }
+ }
+
+ public static Object getVanillaAspectObject(String aAspectName) {
+ return getVanillaAspectList().get(aAspectName);
+ }
+
+ /**
+ * Vanilla Aspect Constructor
+ * @param tag - Aspect Name
+ * @param color
+ * @param chatcolor
+ * @param blend
+ */
+ public TC_Aspect_Wrapper(String tag, int color, String chatcolor, int blend, String aTooltip) {
+ this(tag, color, (TC_Aspect_Wrapper[]) null, blend, aTooltip);
+ this.chatcolor = chatcolor;
+ }
+
+ /**
+ *
+ * Vanilla Aspect Constructor
+ * @param tag - Aspect Name
+ * @param color
+ * @param components
+ */
+ public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components, String aTooltip) {
+ this(tag, color, components, false, 1, aTooltip);
+ }
+
+ /**
+ *
+ * Vanilla Aspect Constructor
+ * @param tag - Aspect Name
+ * @param color
+ * @param components
+ * @param blend
+ */
+ public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components, int blend, String aTooltip) {
+ this(tag, color, components, false, blend, aTooltip);
+ }
+
+ /**
+ *
+ * Vanilla Aspect Constructor
+ * @param tag - Aspect Name
+ * @param color
+ * @param components
+ * @param image
+ * @param blend
+ */
+ public TC_Aspect_Wrapper(
+ String tag, int color, TC_Aspect_Wrapper[] components, boolean vanilla, int blend, String aTooltip) {
+ this(
+ tag,
+ color,
+ components,
+ vanilla
+ ? new ResourceLocation("thaumcraft", "textures/aspects/" + tag.toLowerCase() + ".png")
+ : new ResourceLocation(CORE.MODID, "textures/aspects/" + tag.toLowerCase() + ".png"),
+ vanilla,
+ blend,
+ aTooltip);
+ }
+
+ private static int aInternalAspectIDAllocation = 1;
+
+ public TC_Aspect_Wrapper(
+ String tag,
+ int color,
+ TC_Aspect_Wrapper[] components,
+ ResourceLocation image,
+ boolean vanilla,
+ int blend,
+ String aTooltip) {
+ if (components == null) {
+ components = new TC_Aspect_Wrapper[] {};
+ }
+ // String aTag = vanilla ? tag.toLowerCase() : "custom"+(aInternalAspectIDAllocation++);
+ String aTag = tag.toLowerCase();
+ if (getAspectList().containsKey(tag.toLowerCase())) {
+ this.tag = aTag;
+ this.components = components;
+ this.color = color;
+ this.image = image;
+ this.blend = blend;
+ this.mAspect = null;
+ this.mGtEnumField = null;
+ } else {
+ this.tag = aTag;
+ this.components = components;
+ this.color = color;
+ this.image = image;
+ this.blend = blend;
+ this.mAspect = vanilla ? getVanillaAspectObject(this.tag) : this.generateTcAspect();
+
+ // Set GT Type if exists
+ TC_Aspects y = null;
+ for (TC_Aspects e : TC_Aspects.values()) {
+ try {
+ String gtTag = ThaumcraftUtils.getTagFromAspectObject(e.mAspect);
+ if (gtTag != null) {
+ if (gtTag.equals(this.tag)) {
+ y = e;
+ break;
+ }
+ }
+ } catch (IllegalArgumentException e1) {
+ e1.printStackTrace();
+ }
+ }
+ this.mGtEnumField = y;
+ mInternalAspectCache.put(this.tag, this);
+ // Double link custom Aspects, but internalise names using custom# instead
+ if (!vanilla) {
+ mInternalAspectCache.put("custom" + (aInternalAspectIDAllocation++), this);
+ GT_LanguageManager.addStringLocalization("tc.aspect." + aTag, aTooltip);
+ }
+ Logger.INFO("[Thaumcraft++] Adding support for Aspect: " + tag);
+ }
+ }
+
+ /**
+ * Generates a TC_Aspect from an object, presummed to be a TC Aspect.
+ * @param aBaseAspect - The TC Aspect to generate from.
+ * @return
+ * @throws IllegalArgumentException
+ * @throws IllegalAccessException
+ */
+ @SuppressWarnings("unused")
+ public static TC_Aspect_Wrapper generate(Object aBaseAspect) {
+ try {
+ Field aTagF = ReflectionUtils.getField(mClass_Aspect, "tag");
+ if (aTagF == null) {
+ return null;
+ }
+ String aTafB = (String) aTagF.get(aBaseAspect);
+ if (aTafB == null) {
+ return null;
+ }
+ String aTag = aTafB.toLowerCase();
+ if (aTag != null && getAspectList().containsKey(aTag.toLowerCase())) {
+ return getAspect(aTag);
+ } else {
+ TC_Aspect_Wrapper aTemp = new TC_Aspect_Wrapper(
+ aTag,
+ (int) ReflectionUtils.getField(mClass_Aspect, "color").get(aBaseAspect),
+ generateAspectArrayInternal(
+ ReflectionUtils.getField(mClass_Aspect, "components"), (aBaseAspect)),
+ (ResourceLocation)
+ ReflectionUtils.getField(mClass_Aspect, "image").get(aBaseAspect),
+ true,
+ (int) ReflectionUtils.getField(mClass_Aspect, "blend").get(aBaseAspect),
+ "");
+ if (aTemp != null) {
+ aTemp.chatcolor = (String)
+ ReflectionUtils.getField(mClass_Aspect, "chatcolor").get(aBaseAspect);
+ return aTemp;
+ } else {
+ return null;
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * Internal Map containing all the TC_Aspects.
+ */
+ private static Map<String, TC_Aspect_Wrapper> mInternalAspectCache = new LinkedHashMap<String, TC_Aspect_Wrapper>();
+
+ /**
+ * Public getter for all TC_Aspects
+ * @param aAspectName - Aspect Name
+ * @return - A GT++ Aspect wrapper or null. (TC_Aspect)
+ */
+ public static TC_Aspect_Wrapper getAspect(String aAspectName) {
+ String aName = aAspectName.toLowerCase();
+ TC_Aspect_Wrapper g = mInternalAspectCache.get(aName);
+ if (g != null) {
+ return g;
+ } else {
+ try {
+ TC_Aspect_Wrapper aTemp = generate(getVanillaAspectList().get(aName));
+ if (aTemp != null) {
+ mInternalAspectCache.put(aName, aTemp);
+ return aTemp;
+ }
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+
+ public static Map<String, TC_Aspect_Wrapper> getAspectList() {
+ return mInternalAspectCache;
+ }
- /**
- *
- * Vanilla Aspect Constructor
- * @param tag - Aspect Name
- * @param color
- * @param components
- */
- public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components, String aTooltip) {
- this(tag, color, components, false, 1, aTooltip);
- }
+ private static TC_Aspect_Wrapper[] generateAspectArrayInternal(Field aField, Object aInstance) {
+ // thaumcraft.api.aspects.Aspect.Aspect()
+ Object[] components;
+ TC_Aspect_Wrapper[] aAspectArray;
+ try {
+ components = (Object[]) aField.get(aInstance);
+ aAspectArray = new TC_Aspect_Wrapper[components == null ? 0 : components.length];
+ if (aAspectArray.length > 0) {
+ int i = 0;
+ for (Object g : components) {
+ aAspectArray[i] = getAspect((String)
+ ReflectionUtils.getField(mClass_Aspect, "tag").get(g));
+ i++;
+ }
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ aAspectArray = new TC_Aspect_Wrapper[0];
+ }
+ return aAspectArray;
+ }
- /**
- *
- * Vanilla Aspect Constructor
- * @param tag - Aspect Name
- * @param color
- * @param components
- * @param blend
- */
- public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components, int blend, String aTooltip) {
- this(tag, color, components, false, blend, aTooltip);
- }
-
-
- /**
- *
- * Vanilla Aspect Constructor
- * @param tag - Aspect Name
- * @param color
- * @param components
- * @param image
- * @param blend
- */
- public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components, boolean vanilla, int blend, String aTooltip) {
- this(tag, color, components, vanilla ? new ResourceLocation("thaumcraft", "textures/aspects/" + tag.toLowerCase() + ".png") : new ResourceLocation(CORE.MODID, "textures/aspects/" + tag.toLowerCase() + ".png"), vanilla, blend, aTooltip);
- }
-
- private static int aInternalAspectIDAllocation = 1;
+ /**
+ * Tasty code to generate TC Aspects reflectively.
+ * @return
+ */
+ public Object generateTcAspect() {
+ try {
+ // thaumcraft.api.aspects.Aspect.Aspect()
+ Object aAspectArray = (Object[]) Array.newInstance(mClass_Aspect, 0);
+ if (components.length > 0) {
+ aAspectArray = (Object[]) Array.newInstance(mClass_Aspect, components.length);
+ int i = 0;
+ for (TC_Aspect_Wrapper g : components) {
+ if (g != null && g.mAspect != null) ((Object[]) aAspectArray)[i++] = g.mAspect;
+ }
+ }
+ Constructor constructor = mClass_Aspect.getConstructor(
+ String.class, int.class, aAspectArray.getClass(), ResourceLocation.class, int.class);
+ Object myObject = constructor.newInstance(tag, color, aAspectArray, image, blend);
- public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components, ResourceLocation image, boolean vanilla, int blend, String aTooltip) {
- if (components == null) {
- components = new TC_Aspect_Wrapper[] {};
- }
- //String aTag = vanilla ? tag.toLowerCase() : "custom"+(aInternalAspectIDAllocation++);
- String aTag = tag.toLowerCase();
- if (getAspectList().containsKey(tag.toLowerCase())) {
- this.tag = aTag;
- this.components = components;
- this.color = color;
- this.image = image;
- this.blend = blend;
- this.mAspect = null;
- this.mGtEnumField = null;
- } else {
- this.tag = aTag;
- this.components = components;
- this.color = color;
- this.image = image;
- this.blend = blend;
- this.mAspect = vanilla ? getVanillaAspectObject(this.tag) : this.generateTcAspect();
-
- // Set GT Type if exists
- TC_Aspects y = null;
- for (TC_Aspects e : TC_Aspects.values()) {
- try {
- String gtTag = ThaumcraftUtils.getTagFromAspectObject(e.mAspect);
- if (gtTag != null) {
- if (gtTag.equals(this.tag)) {
- y = e;
- break;
- }
- }
- } catch (IllegalArgumentException e1) {
- e1.printStackTrace();
- }
- }
- this.mGtEnumField = y;
- mInternalAspectCache.put(this.tag, this);
- // Double link custom Aspects, but internalise names using custom# instead
- if (!vanilla) {
- mInternalAspectCache.put("custom"+(aInternalAspectIDAllocation++), this);
- GT_LanguageManager.addStringLocalization("tc.aspect."+aTag, aTooltip);
- }
- Logger.INFO("[Thaumcraft++] Adding support for Aspect: "+tag);
- }
- }
-
-
-
- /**
- * Generates a TC_Aspect from an object, presummed to be a TC Aspect.
- * @param aBaseAspect - The TC Aspect to generate from.
- * @return
- * @throws IllegalArgumentException
- * @throws IllegalAccessException
- */
- @SuppressWarnings("unused")
- public static TC_Aspect_Wrapper generate(Object aBaseAspect) {
- try {
- Field aTagF = ReflectionUtils.getField(mClass_Aspect, "tag");
- if (aTagF == null) {
- return null;
- }
- String aTafB = (String) aTagF.get(aBaseAspect);
- if (aTafB == null) {
- return null;
- }
- String aTag = aTafB.toLowerCase();
- if (aTag != null && getAspectList().containsKey(aTag.toLowerCase())) {
- return getAspect(aTag);
- } else {
- TC_Aspect_Wrapper aTemp = new TC_Aspect_Wrapper(
- aTag,
- (int) ReflectionUtils.getField(mClass_Aspect, "color").get(aBaseAspect),
- generateAspectArrayInternal(ReflectionUtils.getField(mClass_Aspect, "components"), (aBaseAspect)),
- (ResourceLocation) ReflectionUtils.getField(mClass_Aspect, "image").get(aBaseAspect),
- true,
- (int) ReflectionUtils.getField(mClass_Aspect, "blend").get(aBaseAspect),
- ""
- );
- if (aTemp != null) {
- aTemp.chatcolor = (String) ReflectionUtils.getField(mClass_Aspect, "chatcolor").get(aBaseAspect);
- return aTemp;
- }
- else {
- return null;
- }
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- return null;
- }
- }
-
-
- /**
- * Internal Map containing all the TC_Aspects.
- */
- private static Map<String, TC_Aspect_Wrapper> mInternalAspectCache = new LinkedHashMap<String, TC_Aspect_Wrapper>();
-
- /**
- * Public getter for all TC_Aspects
- * @param aAspectName - Aspect Name
- * @return - A GT++ Aspect wrapper or null. (TC_Aspect)
- */
- public static TC_Aspect_Wrapper getAspect(String aAspectName) {
- String aName = aAspectName.toLowerCase();
- TC_Aspect_Wrapper g = mInternalAspectCache.get(aName);
- if (g != null) {
- return g;
- }
- else {
- try {
- TC_Aspect_Wrapper aTemp = generate(getVanillaAspectList().get(aName));
- if (aTemp != null) {
- mInternalAspectCache.put(aName, aTemp);
- return aTemp;
- }
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- }
- }
- return null;
- }
-
- public static Map<String, TC_Aspect_Wrapper> getAspectList(){
- return mInternalAspectCache;
- }
-
-
- private static TC_Aspect_Wrapper[] generateAspectArrayInternal(Field aField, Object aInstance) {
- //thaumcraft.api.aspects.Aspect.Aspect()
- Object[] components;
- TC_Aspect_Wrapper[] aAspectArray;
- try {
- components = (Object[]) aField.get(aInstance);
- aAspectArray = new TC_Aspect_Wrapper[components == null ? 0 : components.length];
- if (aAspectArray.length > 0) {
- int i = 0;
- for (Object g : components) {
- aAspectArray[i] = getAspect((String) ReflectionUtils.getField(mClass_Aspect, "tag").get(g));
- i++;
- }
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {
- e.printStackTrace();
- aAspectArray = new TC_Aspect_Wrapper[0];
- }
- return aAspectArray;
- }
+ // Set chat colour
+ if (chatcolor != null && chatcolor.length() > 0) {
+ Method setChatColour = ReflectionUtils.getMethod(mClass_Aspect, "setChatcolor", String.class);
+ if (setChatColour != null) {
+ setChatColour.invoke(myObject, chatcolor);
+ }
+ }
+ return myObject;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return null;
+ }
+ }
- /**
- * Tasty code to generate TC Aspects reflectively.
- * @return
- */
- public Object generateTcAspect() {
- try {
- //thaumcraft.api.aspects.Aspect.Aspect()
- Object aAspectArray = (Object[]) Array.newInstance(mClass_Aspect, 0);
- if (components.length > 0) {
- aAspectArray = (Object[]) Array.newInstance(mClass_Aspect, components.length);
- int i = 0;
- for (TC_Aspect_Wrapper g : components) {
- if (g != null && g.mAspect != null)
- ((Object[]) aAspectArray)[i++] = g.mAspect;
- }
- }
- Constructor constructor = mClass_Aspect.getConstructor(String.class, int.class, aAspectArray.getClass(), ResourceLocation.class, int.class);
- Object myObject = constructor.newInstance(tag, color, aAspectArray, image, blend);
-
- //Set chat colour
- if (chatcolor != null && chatcolor.length() > 0) {
- Method setChatColour = ReflectionUtils.getMethod(mClass_Aspect, "setChatcolor", String.class);
- if (setChatColour != null) {
- setChatColour.invoke(myObject, chatcolor);
- }
- }
- return myObject;
- } catch (Throwable t) {
- t.printStackTrace();
- return null;
- }
- }
-
- public static boolean isObjectAnAspect(Object aAspect) {
- return mClass_Aspect.isInstance(aAspect);
- }
-
+ public static boolean isObjectAnAspect(Object aAspect) {
+ return mClass_Aspect.isInstance(aAspect);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/Base_Recipe_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/Base_Recipe_Wrapper.java
index 914144445c..8a173e2b0a 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/Base_Recipe_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/Base_Recipe_Wrapper.java
@@ -4,7 +4,7 @@ import net.minecraft.item.ItemStack;
public interface Base_Recipe_Wrapper {
- public abstract ItemStack getRecipeOutput();
+ public abstract ItemStack getRecipeOutput();
- public abstract ItemStack getRecipeInput();
+ public abstract ItemStack getRecipeInput();
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_CrucibleRecipe_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_CrucibleRecipe_Wrapper.java
index 8ee4e7011d..004c18955c 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_CrucibleRecipe_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_CrucibleRecipe_Wrapper.java
@@ -4,16 +4,15 @@ import net.minecraft.item.ItemStack;
public class TC_CrucibleRecipe_Wrapper implements Base_Recipe_Wrapper {
- @Override
- public ItemStack getRecipeInput() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ItemStack getRecipeOutput() {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public ItemStack getRecipeInput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ public ItemStack getRecipeOutput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_IArcaneRecipe_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_IArcaneRecipe_Wrapper.java
index fede079f7b..8276af9f0e 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_IArcaneRecipe_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_IArcaneRecipe_Wrapper.java
@@ -4,16 +4,15 @@ import net.minecraft.item.ItemStack;
public class TC_IArcaneRecipe_Wrapper implements Base_Recipe_Wrapper {
- @Override
- public ItemStack getRecipeInput() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ItemStack getRecipeOutput() {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public ItemStack getRecipeInput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ public ItemStack getRecipeOutput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionEnchantmentRecipe_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionEnchantmentRecipe_Wrapper.java
index b52fa0e6a7..9431978ca0 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionEnchantmentRecipe_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionEnchantmentRecipe_Wrapper.java
@@ -4,16 +4,15 @@ import net.minecraft.item.ItemStack;
public class TC_InfusionEnchantmentRecipe_Wrapper implements Base_Recipe_Wrapper {
- @Override
- public ItemStack getRecipeInput() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ItemStack getRecipeOutput() {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public ItemStack getRecipeInput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ public ItemStack getRecipeOutput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionRecipe_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionRecipe_Wrapper.java
index a0c539f937..0338644949 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionRecipe_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionRecipe_Wrapper.java
@@ -4,16 +4,15 @@ import net.minecraft.item.ItemStack;
public class TC_InfusionRecipe_Wrapper implements Base_Recipe_Wrapper {
- @Override
- public ItemStack getRecipeInput() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ItemStack getRecipeOutput() {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public ItemStack getRecipeInput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ public ItemStack getRecipeOutput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_PageType_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_PageType_Wrapper.java
index d6c7f66988..3a06ac1b90 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_PageType_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_PageType_Wrapper.java
@@ -2,16 +2,15 @@ package gtPlusPlus.xmod.thaumcraft.objects.wrapper.research;
public class TC_PageType_Wrapper {
- public static final TC_PageType_Wrapper TEXT = null;
- public static final TC_PageType_Wrapper TEXT_CONCEALED = null;
- public static final TC_PageType_Wrapper NORMAL_CRAFTING = null;
- public static final TC_PageType_Wrapper ARCANE_CRAFTING = null;
- public static final TC_PageType_Wrapper CRUCIBLE_CRAFTING = null;
- public static final TC_PageType_Wrapper INFUSION_CRAFTING = null;
- public static final TC_PageType_Wrapper COMPOUND_CRAFTING = null;
- public static final TC_PageType_Wrapper SMELTING = null;
- public static final TC_PageType_Wrapper INFUSION_ENCHANTMENT = null;
- public static final TC_PageType_Wrapper IMAGE = null;
- public static final TC_PageType_Wrapper ASPECTS = null;
-
+ public static final TC_PageType_Wrapper TEXT = null;
+ public static final TC_PageType_Wrapper TEXT_CONCEALED = null;
+ public static final TC_PageType_Wrapper NORMAL_CRAFTING = null;
+ public static final TC_PageType_Wrapper ARCANE_CRAFTING = null;
+ public static final TC_PageType_Wrapper CRUCIBLE_CRAFTING = null;
+ public static final TC_PageType_Wrapper INFUSION_CRAFTING = null;
+ public static final TC_PageType_Wrapper COMPOUND_CRAFTING = null;
+ public static final TC_PageType_Wrapper SMELTING = null;
+ public static final TC_PageType_Wrapper INFUSION_ENCHANTMENT = null;
+ public static final TC_PageType_Wrapper IMAGE = null;
+ public static final TC_PageType_Wrapper ASPECTS = null;
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategories_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategories_Wrapper.java
index 93869cb8d8..0130ca3b96 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategories_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategories_Wrapper.java
@@ -6,84 +6,83 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
-
import org.apache.logging.log4j.Level;
public class TC_ResearchCategories_Wrapper {
-
- public static LinkedHashMap<String, TC_ResearchCategoryList_Wrapper> researchCategories = new LinkedHashMap<String, TC_ResearchCategoryList_Wrapper>();
-
- public static TC_ResearchCategoryList_Wrapper getResearchList(String key) {
- return (TC_ResearchCategoryList_Wrapper) researchCategories.get(key);
- }
-
- public static String getCategoryName(String key) {
- return StatCollector.translateToLocal("tc.research_category." + key);
- }
-
- public static TC_ResearchItem_Wrapper getResearch(String key) {
- Collection rc = researchCategories.values();
- Iterator i$ = rc.iterator();
-
- while (i$.hasNext()) {
- Object cat = i$.next();
- Collection rl = ((TC_ResearchCategoryList_Wrapper) cat).research.values();
- Iterator i$1 = rl.iterator();
-
- while (i$1.hasNext()) {
- Object ri = i$1.next();
- if (((TC_ResearchItem_Wrapper) ri).key.equals(key)) {
- return (TC_ResearchItem_Wrapper) ri;
- }
- }
- }
-
- return null;
- }
-
- public static void registerCategory(String key, ResourceLocation icon, ResourceLocation background) {
- if (getResearchList(key) == null) {
- TC_ResearchCategoryList_Wrapper rl = new TC_ResearchCategoryList_Wrapper(icon, background);
- researchCategories.put(key, rl);
- }
-
- }
-
- public static void addResearch(TC_ResearchItem_Wrapper ri) {
- TC_ResearchCategoryList_Wrapper rl = getResearchList(ri.category);
- if (rl != null && !rl.research.containsKey(ri.key)) {
- if (!ri.isVirtual()) {
- Iterator i$ = rl.research.values().iterator();
-
- while (i$.hasNext()) {
- TC_ResearchItem_Wrapper rr = (TC_ResearchItem_Wrapper) i$.next();
- if (rr.displayColumn == ri.displayColumn && rr.displayRow == ri.displayRow) {
- FMLLog.log(Level.FATAL,
- "[Thaumcraft] Research [" + ri.getName()
- + "] not added as it overlaps with existing research [" + rr.getName() + "]",
- new Object[0]);
- return;
- }
- }
- }
-
- rl.research.put(ri.key, ri);
- if (ri.displayColumn < rl.minDisplayColumn) {
- rl.minDisplayColumn = ri.displayColumn;
- }
-
- if (ri.displayRow < rl.minDisplayRow) {
- rl.minDisplayRow = ri.displayRow;
- }
-
- if (ri.displayColumn > rl.maxDisplayColumn) {
- rl.maxDisplayColumn = ri.displayColumn;
- }
-
- if (ri.displayRow > rl.maxDisplayRow) {
- rl.maxDisplayRow = ri.displayRow;
- }
- }
-
- }
-} \ No newline at end of file
+
+ public static LinkedHashMap<String, TC_ResearchCategoryList_Wrapper> researchCategories =
+ new LinkedHashMap<String, TC_ResearchCategoryList_Wrapper>();
+
+ public static TC_ResearchCategoryList_Wrapper getResearchList(String key) {
+ return (TC_ResearchCategoryList_Wrapper) researchCategories.get(key);
+ }
+
+ public static String getCategoryName(String key) {
+ return StatCollector.translateToLocal("tc.research_category." + key);
+ }
+
+ public static TC_ResearchItem_Wrapper getResearch(String key) {
+ Collection rc = researchCategories.values();
+ Iterator i$ = rc.iterator();
+
+ while (i$.hasNext()) {
+ Object cat = i$.next();
+ Collection rl = ((TC_ResearchCategoryList_Wrapper) cat).research.values();
+ Iterator i$1 = rl.iterator();
+
+ while (i$1.hasNext()) {
+ Object ri = i$1.next();
+ if (((TC_ResearchItem_Wrapper) ri).key.equals(key)) {
+ return (TC_ResearchItem_Wrapper) ri;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public static void registerCategory(String key, ResourceLocation icon, ResourceLocation background) {
+ if (getResearchList(key) == null) {
+ TC_ResearchCategoryList_Wrapper rl = new TC_ResearchCategoryList_Wrapper(icon, background);
+ researchCategories.put(key, rl);
+ }
+ }
+
+ public static void addResearch(TC_ResearchItem_Wrapper ri) {
+ TC_ResearchCategoryList_Wrapper rl = getResearchList(ri.category);
+ if (rl != null && !rl.research.containsKey(ri.key)) {
+ if (!ri.isVirtual()) {
+ Iterator i$ = rl.research.values().iterator();
+
+ while (i$.hasNext()) {
+ TC_ResearchItem_Wrapper rr = (TC_ResearchItem_Wrapper) i$.next();
+ if (rr.displayColumn == ri.displayColumn && rr.displayRow == ri.displayRow) {
+ FMLLog.log(
+ Level.FATAL,
+ "[Thaumcraft] Research [" + ri.getName()
+ + "] not added as it overlaps with existing research [" + rr.getName() + "]",
+ new Object[0]);
+ return;
+ }
+ }
+ }
+
+ rl.research.put(ri.key, ri);
+ if (ri.displayColumn < rl.minDisplayColumn) {
+ rl.minDisplayColumn = ri.displayColumn;
+ }
+
+ if (ri.displayRow < rl.minDisplayRow) {
+ rl.minDisplayRow = ri.displayRow;
+ }
+
+ if (ri.displayColumn > rl.maxDisplayColumn) {
+ rl.maxDisplayColumn = ri.displayColumn;
+ }
+
+ if (ri.displayRow > rl.maxDisplayRow) {
+ rl.maxDisplayRow = ri.displayRow;
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategoryList_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategoryList_Wrapper.java
index 3e6f5b78f2..08c69cdca5 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategoryList_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategoryList_Wrapper.java
@@ -2,20 +2,19 @@ package gtPlusPlus.xmod.thaumcraft.objects.wrapper.research;
import java.util.HashMap;
import java.util.Map;
-
import net.minecraft.util.ResourceLocation;
public class TC_ResearchCategoryList_Wrapper {
- public int minDisplayColumn;
- public int minDisplayRow;
- public int maxDisplayColumn;
- public int maxDisplayRow;
- public ResourceLocation icon;
- public ResourceLocation background;
- public Map<String, TC_ResearchItem_Wrapper> research = new HashMap<String, TC_ResearchItem_Wrapper>();
+ public int minDisplayColumn;
+ public int minDisplayRow;
+ public int maxDisplayColumn;
+ public int maxDisplayRow;
+ public ResourceLocation icon;
+ public ResourceLocation background;
+ public Map<String, TC_ResearchItem_Wrapper> research = new HashMap<String, TC_ResearchItem_Wrapper>();
- public TC_ResearchCategoryList_Wrapper(ResourceLocation icon, ResourceLocation background) {
- this.icon = icon;
- this.background = background;
- }
+ public TC_ResearchCategoryList_Wrapper(ResourceLocation icon, ResourceLocation background) {
+ this.icon = icon;
+ this.background = background;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchItem_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchItem_Wrapper.java
index 6372cc0371..be0ae26e61 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchItem_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchItem_Wrapper.java
@@ -9,238 +9,242 @@ import net.minecraft.util.StatCollector;
public class TC_ResearchItem_Wrapper {
- public final String key;
- public final String category;
- public final TC_AspectList_Wrapper tags;
- public String[] parents = null;
- public String[] parentsHidden = null;
- public String[] siblings = null;
- public final int displayColumn;
- public final int displayRow;
- public final ItemStack icon_item;
- public final ResourceLocation icon_resource;
- private int complexity;
- private boolean isSpecial;
- private boolean isSecondary;
- private boolean isRound;
- private boolean isStub;
- private boolean isVirtual;
- private boolean isConcealed;
- private boolean isHidden;
- private boolean isLost;
- private boolean isAutoUnlock;
- private ItemStack[] itemTriggers;
- private String[] entityTriggers;
- private TC_Aspect_Wrapper[] aspectTriggers;
- private Object[] pages = null;
-
- public TC_ResearchItem_Wrapper(String key, String category) {
- this.key = key;
- this.category = category;
- this.tags = new TC_AspectList_Wrapper();
- this.icon_resource = null;
- this.icon_item = null;
- this.displayColumn = 0;
- this.displayRow = 0;
- this.setVirtual();
- }
-
- public TC_ResearchItem_Wrapper(String key, String category, TC_AspectList_Wrapper tags, int col, int row, int complex,
- ResourceLocation icon) {
- this.key = key;
- this.category = category;
- this.tags = tags;
- this.icon_resource = icon;
- this.icon_item = null;
- this.displayColumn = col;
- this.displayRow = row;
- this.complexity = complex;
- if (this.complexity < 1) {
- this.complexity = 1;
- }
-
- if (this.complexity > 3) {
- this.complexity = 3;
- }
-
- }
-
- public TC_ResearchItem_Wrapper(String key, String category, TC_AspectList_Wrapper tags, int col, int row, int complex, ItemStack icon) {
- this.key = key;
- this.category = category;
- this.tags = tags;
- this.icon_item = icon;
- this.icon_resource = null;
- this.displayColumn = col;
- this.displayRow = row;
- this.complexity = complex;
- if (this.complexity < 1) {
- this.complexity = 1;
- }
-
- if (this.complexity > 3) {
- this.complexity = 3;
- }
-
- }
-
- public TC_ResearchItem_Wrapper setSpecial() {
- this.isSpecial = true;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setStub() {
- this.isStub = true;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setLost() {
- this.isLost = true;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setConcealed() {
- this.isConcealed = true;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setHidden() {
- this.isHidden = true;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setVirtual() {
- this.isVirtual = true;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setParents(String... par) {
- this.parents = par;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setParentsHidden(String... par) {
- this.parentsHidden = par;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setSiblings(String... sib) {
- this.siblings = sib;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setPages(Object... par) {
- this.pages = par;
- return this;
- }
-
- public Object[] getPages() {
- return this.pages;
- }
-
- public TC_ResearchItem_Wrapper setItemTriggers(ItemStack... par) {
- this.itemTriggers = par;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setEntityTriggers(String... par) {
- this.entityTriggers = par;
- return this;
- }
-
- public TC_ResearchItem_Wrapper setAspectTriggers(TC_Aspect_Wrapper... par) {
- this.aspectTriggers = par;
- return this;
- }
-
- public ItemStack[] getItemTriggers() {
- return this.itemTriggers;
- }
-
- public String[] getEntityTriggers() {
- return this.entityTriggers;
- }
-
- public TC_Aspect_Wrapper[] getAspectTriggers() {
- return this.aspectTriggers;
- }
-
- public TC_ResearchItem_Wrapper registerResearchItem() {
- ThaumcraftUtils.addResearch(this);
- return this;
- }
-
- public String getName() {
- return StatCollector.translateToLocal("tc.research_name." + this.key);
- }
-
- public String getText() {
- return StatCollector.translateToLocal("tc.research_text." + this.key);
- }
-
- public boolean isSpecial() {
- return this.isSpecial;
- }
-
- public boolean isStub() {
- return this.isStub;
- }
-
- public boolean isLost() {
- return this.isLost;
- }
-
- public boolean isConcealed() {
- return this.isConcealed;
- }
-
- public boolean isHidden() {
- return this.isHidden;
- }
-
- public boolean isVirtual() {
- return this.isVirtual;
- }
-
- public boolean isAutoUnlock() {
- return this.isAutoUnlock;
- }
-
- public TC_ResearchItem_Wrapper setAutoUnlock() {
- this.isAutoUnlock = true;
- return this;
- }
-
- public boolean isRound() {
- return this.isRound;
- }
-
- public TC_ResearchItem_Wrapper setRound() {
- this.isRound = true;
- return this;
- }
-
- public boolean isSecondary() {
- return this.isSecondary;
- }
-
- public TC_ResearchItem_Wrapper setSecondary() {
- this.isSecondary = true;
- return this;
- }
-
- public int getComplexity() {
- return this.complexity;
- }
-
- public TC_ResearchItem_Wrapper setComplexity(int complexity) {
- this.complexity = complexity;
- return this;
- }
-
- public TC_Aspect_Wrapper getResearchPrimaryTag() {
- //TODO
- return null;
- }
-
+ public final String key;
+ public final String category;
+ public final TC_AspectList_Wrapper tags;
+ public String[] parents = null;
+ public String[] parentsHidden = null;
+ public String[] siblings = null;
+ public final int displayColumn;
+ public final int displayRow;
+ public final ItemStack icon_item;
+ public final ResourceLocation icon_resource;
+ private int complexity;
+ private boolean isSpecial;
+ private boolean isSecondary;
+ private boolean isRound;
+ private boolean isStub;
+ private boolean isVirtual;
+ private boolean isConcealed;
+ private boolean isHidden;
+ private boolean isLost;
+ private boolean isAutoUnlock;
+ private ItemStack[] itemTriggers;
+ private String[] entityTriggers;
+ private TC_Aspect_Wrapper[] aspectTriggers;
+ private Object[] pages = null;
+
+ public TC_ResearchItem_Wrapper(String key, String category) {
+ this.key = key;
+ this.category = category;
+ this.tags = new TC_AspectList_Wrapper();
+ this.icon_resource = null;
+ this.icon_item = null;
+ this.displayColumn = 0;
+ this.displayRow = 0;
+ this.setVirtual();
+ }
+
+ public TC_ResearchItem_Wrapper(
+ String key,
+ String category,
+ TC_AspectList_Wrapper tags,
+ int col,
+ int row,
+ int complex,
+ ResourceLocation icon) {
+ this.key = key;
+ this.category = category;
+ this.tags = tags;
+ this.icon_resource = icon;
+ this.icon_item = null;
+ this.displayColumn = col;
+ this.displayRow = row;
+ this.complexity = complex;
+ if (this.complexity < 1) {
+ this.complexity = 1;
+ }
+
+ if (this.complexity > 3) {
+ this.complexity = 3;
+ }
+ }
+
+ public TC_ResearchItem_Wrapper(
+ String key, String category, TC_AspectList_Wrapper tags, int col, int row, int complex, ItemStack icon) {
+ this.key = key;
+ this.category = category;
+ this.tags = tags;
+ this.icon_item = icon;
+ this.icon_resource = null;
+ this.displayColumn = col;
+ this.displayRow = row;
+ this.complexity = complex;
+ if (this.complexity < 1) {
+ this.complexity = 1;
+ }
+
+ if (this.complexity > 3) {
+ this.complexity = 3;
+ }
+ }
+
+ public TC_ResearchItem_Wrapper setSpecial() {
+ this.isSpecial = true;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setStub() {
+ this.isStub = true;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setLost() {
+ this.isLost = true;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setConcealed() {
+ this.isConcealed = true;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setHidden() {
+ this.isHidden = true;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setVirtual() {
+ this.isVirtual = true;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setParents(String... par) {
+ this.parents = par;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setParentsHidden(String... par) {
+ this.parentsHidden = par;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setSiblings(String... sib) {
+ this.siblings = sib;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setPages(Object... par) {
+ this.pages = par;
+ return this;
+ }
+
+ public Object[] getPages() {
+ return this.pages;
+ }
+
+ public TC_ResearchItem_Wrapper setItemTriggers(ItemStack... par) {
+ this.itemTriggers = par;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setEntityTriggers(String... par) {
+ this.entityTriggers = par;
+ return this;
+ }
+
+ public TC_ResearchItem_Wrapper setAspectTriggers(TC_Aspect_Wrapper... par) {
+ this.aspectTriggers = par;
+ return this;
+ }
+
+ public ItemStack[] getItemTriggers() {
+ return this.itemTriggers;
+ }
+
+ public String[] getEntityTriggers() {
+ return this.entityTriggers;
+ }
+
+ public TC_Aspect_Wrapper[] getAspectTriggers() {
+ return this.aspectTriggers;
+ }
+
+ public TC_ResearchItem_Wrapper registerResearchItem() {
+ ThaumcraftUtils.addResearch(this);
+ return this;
+ }
+
+ public String getName() {
+ return StatCollector.translateToLocal("tc.research_name." + this.key);
+ }
+
+ public String getText() {
+ return StatCollector.translateToLocal("tc.research_text." + this.key);
+ }
+
+ public boolean isSpecial() {
+ return this.isSpecial;
+ }
+
+ public boolean isStub() {
+ return this.isStub;
+ }
+
+ public boolean isLost() {
+ return this.isLost;
+ }
+
+ public boolean isConcealed() {
+ return this.isConcealed;
+ }
+
+ public boolean isHidden() {
+ return this.isHidden;
+ }
+
+ public boolean isVirtual() {
+ return this.isVirtual;
+ }
+
+ public boolean isAutoUnlock() {
+ return this.isAutoUnlock;
+ }
+
+ public TC_ResearchItem_Wrapper setAutoUnlock() {
+ this.isAutoUnlock = true;
+ return this;
+ }
+
+ public boolean isRound() {
+ return this.isRound;
+ }
+
+ public TC_ResearchItem_Wrapper setRound() {
+ this.isRound = true;
+ return this;
+ }
+
+ public boolean isSecondary() {
+ return this.isSecondary;
+ }
+
+ public TC_ResearchItem_Wrapper setSecondary() {
+ this.isSecondary = true;
+ return this;
+ }
+
+ public int getComplexity() {
+ return this.complexity;
+ }
+
+ public TC_ResearchItem_Wrapper setComplexity(int complexity) {
+ this.complexity = complexity;
+ return this;
+ }
+
+ public TC_Aspect_Wrapper getResearchPrimaryTag() {
+ // TODO
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchNoteData_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchNoteData_Wrapper.java
index 5adf0150d9..df8d21bbaa 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchNoteData_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchNoteData_Wrapper.java
@@ -2,13 +2,12 @@ package gtPlusPlus.xmod.thaumcraft.objects.wrapper.research;
public class TC_ResearchNoteData_Wrapper {
- public TC_ResearchNoteData_Wrapper(Object researchNoteData) {
- // TODO Auto-generated constructor stub
- }
-
- public Object getResearchNoteData() {
- // TODO Auto-generated method stub
- return null;
- }
-
+ public TC_ResearchNoteData_Wrapper(Object researchNoteData) {
+ // TODO Auto-generated constructor stub
+ }
+
+ public Object getResearchNoteData() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchPage_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchPage_Wrapper.java
index 998f37bf8c..83ddd106a5 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchPage_Wrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchPage_Wrapper.java
@@ -1,12 +1,11 @@
package gtPlusPlus.xmod.thaumcraft.objects.wrapper.research;
-import java.util.List;
-
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_AspectList_Wrapper;
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_CrucibleRecipe_Wrapper;
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_IArcaneRecipe_Wrapper;
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_InfusionEnchantmentRecipe_Wrapper;
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_InfusionRecipe_Wrapper;
+import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.item.crafting.IRecipe;
@@ -14,215 +13,214 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
public class TC_ResearchPage_Wrapper {
- public TC_PageType_Wrapper type;
- public String text;
- public String research;
- public ResourceLocation image;
- public TC_AspectList_Wrapper aspects;
- public Object recipe;
- public ItemStack recipeOutput;
-
- public TC_ResearchPage_Wrapper(String text) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = text;
- }
-
- public TC_ResearchPage_Wrapper(String research, String text) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.TEXT_CONCEALED;
- this.research = research;
- this.text = text;
- }
-
- public TC_ResearchPage_Wrapper(IRecipe recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.NORMAL_CRAFTING;
- this.recipe = recipe;
- this.recipeOutput = recipe.getRecipeOutput();
- }
-
- public TC_ResearchPage_Wrapper(IRecipe[] recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.NORMAL_CRAFTING;
- this.recipe = recipe;
- }
-
- public TC_ResearchPage_Wrapper(TC_IArcaneRecipe_Wrapper[] recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.ARCANE_CRAFTING;
- this.recipe = recipe;
- }
-
- public TC_ResearchPage_Wrapper(TC_CrucibleRecipe_Wrapper[] recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.CRUCIBLE_CRAFTING;
- this.recipe = recipe;
- }
-
- public TC_ResearchPage_Wrapper(TC_InfusionRecipe_Wrapper[] recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.INFUSION_CRAFTING;
- this.recipe = recipe;
- }
-
- public TC_ResearchPage_Wrapper(List recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.COMPOUND_CRAFTING;
- this.recipe = recipe;
- }
-
- public TC_ResearchPage_Wrapper(TC_IArcaneRecipe_Wrapper recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.ARCANE_CRAFTING;
- this.recipe = recipe;
- this.recipeOutput = recipe.getRecipeOutput();
- }
-
- public TC_ResearchPage_Wrapper(TC_CrucibleRecipe_Wrapper recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.CRUCIBLE_CRAFTING;
- this.recipe = recipe;
- this.recipeOutput = recipe.getRecipeOutput();
- }
-
- public TC_ResearchPage_Wrapper(ItemStack input) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.SMELTING;
- this.recipe = input;
- this.recipeOutput = FurnaceRecipes.smelting().getSmeltingResult(input);
- }
-
- public TC_ResearchPage_Wrapper(TC_InfusionRecipe_Wrapper recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.INFUSION_CRAFTING;
- this.recipe = recipe;
- if (recipe.getRecipeOutput() instanceof ItemStack) {
- this.recipeOutput = (ItemStack) recipe.getRecipeOutput();
- } else {
- this.recipeOutput = recipe.getRecipeInput();
- }
-
- }
-
- public TC_ResearchPage_Wrapper(TC_InfusionEnchantmentRecipe_Wrapper recipe) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.INFUSION_ENCHANTMENT;
- this.recipe = recipe;
- }
-
- public TC_ResearchPage_Wrapper(ResourceLocation image, String caption) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.IMAGE;
- this.image = image;
- this.text = caption;
- }
-
- public TC_ResearchPage_Wrapper(TC_AspectList_Wrapper as) {
- this.type = TC_PageType_Wrapper.TEXT;
- this.text = null;
- this.research = null;
- this.image = null;
- this.aspects = null;
- this.recipe = null;
- this.recipeOutput = null;
- this.type = TC_PageType_Wrapper.ASPECTS;
- this.aspects = as;
- }
-
- public String getTranslatedText() {
- String ret = "";
- if (this.text != null) {
- ret = StatCollector.translateToLocal(this.text);
- if (ret.isEmpty()) {
- ret = this.text;
- }
- }
-
- return ret;
- }
-} \ No newline at end of file
+ public TC_PageType_Wrapper type;
+ public String text;
+ public String research;
+ public ResourceLocation image;
+ public TC_AspectList_Wrapper aspects;
+ public Object recipe;
+ public ItemStack recipeOutput;
+
+ public TC_ResearchPage_Wrapper(String text) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = text;
+ }
+
+ public TC_ResearchPage_Wrapper(String research, String text) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.TEXT_CONCEALED;
+ this.research = research;
+ this.text = text;
+ }
+
+ public TC_ResearchPage_Wrapper(IRecipe recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.NORMAL_CRAFTING;
+ this.recipe = recipe;
+ this.recipeOutput = recipe.getRecipeOutput();
+ }
+
+ public TC_ResearchPage_Wrapper(IRecipe[] recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.NORMAL_CRAFTING;
+ this.recipe = recipe;
+ }
+
+ public TC_ResearchPage_Wrapper(TC_IArcaneRecipe_Wrapper[] recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.ARCANE_CRAFTING;
+ this.recipe = recipe;
+ }
+
+ public TC_ResearchPage_Wrapper(TC_CrucibleRecipe_Wrapper[] recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.CRUCIBLE_CRAFTING;
+ this.recipe = recipe;
+ }
+
+ public TC_ResearchPage_Wrapper(TC_InfusionRecipe_Wrapper[] recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.INFUSION_CRAFTING;
+ this.recipe = recipe;
+ }
+
+ public TC_ResearchPage_Wrapper(List recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.COMPOUND_CRAFTING;
+ this.recipe = recipe;
+ }
+
+ public TC_ResearchPage_Wrapper(TC_IArcaneRecipe_Wrapper recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.ARCANE_CRAFTING;
+ this.recipe = recipe;
+ this.recipeOutput = recipe.getRecipeOutput();
+ }
+
+ public TC_ResearchPage_Wrapper(TC_CrucibleRecipe_Wrapper recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.CRUCIBLE_CRAFTING;
+ this.recipe = recipe;
+ this.recipeOutput = recipe.getRecipeOutput();
+ }
+
+ public TC_ResearchPage_Wrapper(ItemStack input) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.SMELTING;
+ this.recipe = input;
+ this.recipeOutput = FurnaceRecipes.smelting().getSmeltingResult(input);
+ }
+
+ public TC_ResearchPage_Wrapper(TC_InfusionRecipe_Wrapper recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.INFUSION_CRAFTING;
+ this.recipe = recipe;
+ if (recipe.getRecipeOutput() instanceof ItemStack) {
+ this.recipeOutput = (ItemStack) recipe.getRecipeOutput();
+ } else {
+ this.recipeOutput = recipe.getRecipeInput();
+ }
+ }
+
+ public TC_ResearchPage_Wrapper(TC_InfusionEnchantmentRecipe_Wrapper recipe) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.INFUSION_ENCHANTMENT;
+ this.recipe = recipe;
+ }
+
+ public TC_ResearchPage_Wrapper(ResourceLocation image, String caption) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.IMAGE;
+ this.image = image;
+ this.text = caption;
+ }
+
+ public TC_ResearchPage_Wrapper(TC_AspectList_Wrapper as) {
+ this.type = TC_PageType_Wrapper.TEXT;
+ this.text = null;
+ this.research = null;
+ this.image = null;
+ this.aspects = null;
+ this.recipe = null;
+ this.recipeOutput = null;
+ this.type = TC_PageType_Wrapper.ASPECTS;
+ this.aspects = as;
+ }
+
+ public String getTranslatedText() {
+ String ret = "";
+ if (this.text != null) {
+ ret = StatCollector.translateToLocal(this.text);
+ if (ret.isEmpty()) {
+ ret = this.text;
+ }
+ }
+
+ return ret;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java
index 4f1006693e..8489a4d50e 100644
--- a/src/main/java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java
+++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java
@@ -2,13 +2,6 @@ package gtPlusPlus.xmod.thaumcraft.util;
import static gtPlusPlus.xmod.thaumcraft.HANDLER_Thaumcraft.sItemsToGetAspects;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.TC_Aspects;
@@ -30,6 +23,12 @@ import gtPlusPlus.xmod.thaumcraft.objects.wrapper.research.TC_ResearchCategoryLi
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.research.TC_ResearchItem_Wrapper;
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.research.TC_ResearchNoteData_Wrapper;
import gtPlusPlus.xmod.thaumcraft.objects.wrapper.research.TC_ResearchPage_Wrapper;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
@@ -37,428 +36,472 @@ import net.minecraft.world.World;
public class ThaumcraftUtils {
-
- private static Class<?> mClass_Aspect;
- private static Field mField_Aspects;
-
- static {
- mClass_Aspect = ReflectionUtils.getClass("thaumcraft.api.aspects.Aspect");
- if (mClass_Aspect != null) {
- Field aTagF = ReflectionUtils.getField(mClass_Aspect, "tag");
- if (aTagF != null) {
- mField_Aspects = aTagF;
- }
- }
- }
-
- public static boolean addAspectToItem(ItemStack item, TC_Aspect_Wrapper aspect, int amount) {
- return addAspectToItem(item, new TC_Aspect_Wrapper[] {aspect}, new Integer[] {amount});
-
- }
-
- public static boolean addAspectToItem(ItemStack item, TC_Aspect_Wrapper[] aspect, Integer[] amounts) {
- GTPP_AspectStack[] aspects = new GTPP_AspectStack[aspect.length];
- for (int g=0;g<aspect.length;g++) {
- if (amounts[g] != null && amounts[g] > 0) {
- //aspects[g] = new GTPP_AspectStack(aspect[g], amounts[g]);
- }
- }
- Pair<ItemStack, GTPP_AspectStack[]> k = new Pair<ItemStack, GTPP_AspectStack[]>(item, aspects);
- int mSizeA = sItemsToGetAspects.size();
- sItemsToGetAspects.put(k);
- if (sItemsToGetAspects.size() > mSizeA) {
- Logger.MATERIALS("[Aspect] Successfully queued an ItemStack for Aspect addition.");
- return true;
- }
- Logger.MATERIALS("[Aspect] Failed to queue an ItemStack for Aspect addition.");
- //Logger.INFO("[Aspect] ");
- return false;
- }
-
-
- public static TC_Aspect_Wrapper getAspect(String name) {
- return TC_Aspect_Wrapper.getAspect(name);
- }
-
- public static TC_Aspects getEnumAspect(String name) {
- TC_Aspect_Wrapper r = getAspect(name);
- return r.mGtEnumField;
- }
-
-
-
- public static Object addResearch(String aResearch, String aName, String aText, String[] aParentResearches, String aCategory, ItemStack aIcon, int aComplexity, int aType, int aX, int aY, List<GTPP_AspectStack> aAspects, ItemStack[] aResearchTriggers, Object[] aPages) {
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.researches, aResearch, true)) {
- return null;
- }
- TC_ResearchCategoryList_Wrapper tCategory = TC_ResearchCategories_Wrapper.getResearchList(aCategory);
- if (tCategory == null) {
- return null;
- }
- for (Iterator<TC_ResearchItem_Wrapper> i$ = tCategory.research.values().iterator(); i$.hasNext(); ) {
- TC_ResearchItem_Wrapper tResearch = (TC_ResearchItem_Wrapper) i$.next();
- if ((tResearch.displayColumn == aX) && (tResearch.displayRow == aY)) {
- aX += (aX > 0 ? 5 : -5);
- aY += (aY > 0 ? 5 : -5);
- }
- }
- TC_ResearchItem_Wrapper rResearch = new TC_ResearchItem_Wrapper(aResearch, aCategory, getAspectList_Ex(aAspects), aX, aY, aComplexity, aIcon);
- ArrayList<Object> tPages = new ArrayList<Object>(aPages.length);
- GT_LanguageManager.addStringLocalization("tc.research_name." + aResearch, aName);
- GT_LanguageManager.addStringLocalization("tc.research_text." + aResearch, "[GT++] " + aText);
- for (Object tPage : aPages) {
- if ((tPage instanceof String)) {
- tPages.add(new TC_ResearchPage_Wrapper((String) tPage));
- } else if ((tPage instanceof IRecipe)) {
- tPages.add(new TC_ResearchPage_Wrapper((IRecipe) tPage));
- }
- else if ((tPage instanceof TC_IArcaneRecipe_Wrapper)) {
- tPages.add(new TC_ResearchPage_Wrapper((TC_IArcaneRecipe_Wrapper) tPage));
- } else if ((tPage instanceof TC_CrucibleRecipe_Wrapper)) {
- tPages.add(new TC_ResearchPage_Wrapper((TC_CrucibleRecipe_Wrapper) tPage));
- } else if ((tPage instanceof TC_InfusionRecipe_Wrapper)) {
- tPages.add(new TC_ResearchPage_Wrapper((TC_InfusionRecipe_Wrapper) tPage));
- } else if ((tPage instanceof TC_InfusionEnchantmentRecipe_Wrapper)) {
- tPages.add(new TC_ResearchPage_Wrapper((TC_InfusionEnchantmentRecipe_Wrapper) tPage));
- }
- }
- if ((aType & 0x40) != 0) {
- rResearch.setAutoUnlock();
- }
- if ((aType & 0x1) != 0) {
- rResearch.setSecondary();
- }
- if ((aType & 0x20) != 0) {
- rResearch.setSpecial();
- }
- if ((aType & 0x8) != 0) {
- rResearch.setVirtual();
- }
- if ((aType & 0x4) != 0) {
- rResearch.setHidden();
- }
- if ((aType & 0x10) != 0) {
- rResearch.setRound();
- }
- if ((aType & 0x2) != 0) {
- rResearch.setStub();
- }
- if (aParentResearches != null) {
- ArrayList<String> tParentResearches = new ArrayList<String>();
- for (String tParent : aParentResearches) {
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.researches, aResearch, true)) {
- tParentResearches.add(tParent);
- }
- }
- if (tParentResearches.size() > 0) {
- rResearch.setParents((String[]) tParentResearches.toArray(new String[tParentResearches.size()]));
- rResearch.setConcealed();
- }
- }
- if (aResearchTriggers != null) {
- rResearch.setItemTriggers(aResearchTriggers);
- rResearch.setHidden();
- }
-
- Object[] aVarArgs = (TC_ResearchPage_Wrapper[]) tPages.toArray(new TC_ResearchPage_Wrapper[tPages.size()]);
- rResearch.setPages(aVarArgs);
- return rResearch.registerResearchItem();
- }
-
-
- public static Object addCrucibleRecipe(final String aResearch, final Object aInput, final ItemStack aOutput,
- final List<GTPP_AspectStack> aAspects) {
- if (GT_Utility.isStringInvalid((Object) aResearch) || aInput == null || aOutput == null || aAspects == null
- || aAspects.isEmpty()) {
- return null;
- }
- return addCrucibleRecipe(aResearch, GT_Utility.copy(new Object[]{aOutput}),
- (aInput instanceof ItemStack || aInput instanceof ArrayList) ? aInput : aInput.toString(),
- getAspectList_Ex(aAspects));
- }
-
- public static Object addInfusionRecipe(final String aResearch, final ItemStack aMainInput, final ItemStack[] aSideInputs,
- final ItemStack aOutput, final int aInstability, final List<GTPP_AspectStack> aAspects) {
- if (GT_Utility.isStringInvalid((Object) aResearch) || aMainInput == null || aSideInputs == null
- || aOutput == null || aAspects == null || aAspects.isEmpty()) {
- return null;
- }
- return addInfusionCraftingRecipe(aResearch, (Object) GT_Utility.copy(new Object[]{aOutput}),
- aInstability, getAspectList_Ex(aAspects), aMainInput, aSideInputs);
- }
-
- public static boolean registerThaumcraftAspectsToItem(final ItemStack aExampleStack,
- final List<GTPP_AspectStack> aAspects, final String aOreDict) {
- if (aAspects.isEmpty()) {
- return false;
- }
- registerObjectTag(aOreDict, getAspectList_Ex(aAspects));
- return true;
- }
-
- public static boolean registerThaumcraftAspectsToItem(final ItemStack aStack,
- final List<GTPP_AspectStack> aAspects, final boolean aAdditive) {
- try {
- if (aAspects.isEmpty()) {
- return false;
- }
- TC_AspectList_Wrapper h = getAspectList_Ex(aAspects);
- if (aAdditive && (h != null && h.size() > 0)) {
- registerComplexObjectTag(aStack, getAspectList_Ex(aAspects));
- return true;
- }
- else {
- Logger.MATERIALS("[Aspect] Failed adding aspects to "+aStack.getDisplayName()+".");
- }
- final TC_AspectList_Wrapper tAlreadyRegisteredAspects = getObjectAspects(aStack);
- if (tAlreadyRegisteredAspects == null || tAlreadyRegisteredAspects.size() <= 0) {
- registerObjectTag(aStack, getAspectList_Ex(aAspects));
- }
- return true;
- }
- catch (Throwable t) {
- Logger.MATERIALS("[Aspect] Failed adding aspects to "+aStack.getDisplayName()+".");
- t.printStackTrace();
- return false;
- }
- }
-
-
- private static final Class<?> mClass_ThaumcraftApi;
- private static final Class<?> mClass_ThaumcraftApiHelper;
- private static final Class<?> mClass_AspectList;
- private static final Class<?> mClass_ResearchManager;
- private static final Method mMethod_registerObjectTag1;
- private static final Method mMethod_registerObjectTag2;
- private static final Method mMethod_registerComplexObjectTag;
- private static final Method mMethod_addInfusionCraftingRecipe;
- private static final Method mMethod_addCrucibleRecipe;
- private static final Method mMethod_getObjectAspects;
- private static final Method mMethod_updateData;
- private static final Method mMethod_getData;
-
- private static final Field mField_PortholeBlacklist;
- static {
- /*
- * Classes
- */
- mClass_ThaumcraftApi = ReflectionUtils.getClass("thaumcraft.api.ThaumcraftApi");
- mClass_ThaumcraftApiHelper = ReflectionUtils.getClass("thaumcraft.api.ThaumcraftApiHelper");
- mClass_AspectList = ReflectionUtils.getClass("thaumcraft.api.aspects.AspectList");
- mClass_ResearchManager = ReflectionUtils.getClass("thaumcraft.common.lib.research.ResearchManager");
-
- /*
- * Methods
- */
- mMethod_registerObjectTag1 = ReflectionUtils.getMethod(mClass_ThaumcraftApi, "registerObjectTag",
- ItemStack.class, mClass_AspectList);
-
- mMethod_registerObjectTag2 = ReflectionUtils.getMethod(mClass_ThaumcraftApi, "registerObjectTag", String.class,
- mClass_AspectList);
-
- mMethod_registerComplexObjectTag = ReflectionUtils.getMethod(mClass_ThaumcraftApi, "registerComplexObjectTag",
- ItemStack.class, mClass_AspectList);
-
- mMethod_addInfusionCraftingRecipe = ReflectionUtils.getMethod(mClass_ThaumcraftApi, "addInfusionCraftingRecipe",
- String.class, Object.class, int.class, mClass_AspectList, ItemStack.class, ItemStack[].class);
-
- mMethod_addCrucibleRecipe = ReflectionUtils.getMethod(mClass_ThaumcraftApi, "addCrucibleRecipe", String.class,
- ItemStack.class, Object.class, mClass_AspectList);
-
-
- mMethod_getObjectAspects = ReflectionUtils.getMethod(mClass_ThaumcraftApiHelper, "getObjectAspects", ItemStack.class);
-
-
- mMethod_updateData = ReflectionUtils.getMethod(mClass_ResearchManager, "updateData", ItemStack.class, ReflectionUtils.getClass("thaumcraft.common.lib.research.ResearchNoteData"));
- mMethod_getData = ReflectionUtils.getMethod(mClass_ResearchManager, "getData", ItemStack.class);
-
- /*
- * Fields
- */
- mField_PortholeBlacklist = ReflectionUtils.getField(mClass_ThaumcraftApi, "portableHoleBlackList");
-
- }
-
- public static void registerObjectTag(ItemStack aStack, TC_AspectList_Wrapper aAspectList) {
- try {
- mMethod_registerObjectTag1.invoke(null, aStack, aAspectList.getVanillaAspectList());
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- }
-
- public static void registerObjectTag(String aOreDict, TC_AspectList_Wrapper aAspectList) {
- try {
- mMethod_registerObjectTag2.invoke(null, aOreDict, aAspectList.getVanillaAspectList());
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- }
-
- public static void registerComplexObjectTag(ItemStack aStack, TC_AspectList_Wrapper aAspectList) {
- try {
- mMethod_registerComplexObjectTag.invoke(null, aStack, aAspectList.getVanillaAspectList());
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- }
-
-
- public static TC_AspectList_Wrapper getObjectAspects(ItemStack aStack) {
- try {
- return new TC_AspectList_Wrapper(mMethod_getObjectAspects.invoke(null, aStack));
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- return null;
- }
-
-
-
- public static Object addCrucibleRecipe(String aResearch, ItemStack copy, Object aOutput,
- TC_AspectList_Wrapper aAspectList) {
- try {
- return mMethod_addCrucibleRecipe.invoke(null, aResearch, copy, aOutput, aAspectList);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static Object addInfusionCraftingRecipe(String aResearch, Object copy, int aInstability,
- TC_AspectList_Wrapper aAspectList, ItemStack aMainInput, ItemStack[] aSideInputs) {
- try {
- return mMethod_addInfusionCraftingRecipe.invoke(null, aResearch, copy, aInstability, aAspectList, aMainInput, aSideInputs);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- return null;
- }
-
-
- public static boolean registerPortholeBlacklistedBlock(final Block aBlock) {
- try {
- ((ArrayList<Block>) mField_PortholeBlacklist.get(null)).add(aBlock);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- e.printStackTrace();
- return false;
- }
- return true;
- }
-
-
- public static String getTagFromAspectObject(Object aAspect) {
- try {
- if (mClass_Aspect == null || mField_Aspects == null) {
- return null;
- }
- String aTafB = (String) mField_Aspects.get(aAspect);
- if (aTafB == null) {
- return null;
- }
- String aTag = aTafB.toLowerCase();
- return aTag;
- } catch (IllegalArgumentException | IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- return "error";
- }
- }
-
-
- public static void updateResearchNote(ItemStack a, TC_ResearchNoteData_Wrapper b) {
- //updateData(a, b.getResearchNoteData());
- try {
- mMethod_updateData.invoke(a, b.getResearchNoteData());
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- }
-
- public static Object getResearchNoteData(ItemStack a) {
- //getData(a);
- try {
- return mMethod_getData.invoke(a);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static boolean isItemResearchNotes(ItemStack aStack) {
- if (aStack != null && aStack.getItem() == HANDLER_Thaumcraft.mResearchNotes && HANDLER_Thaumcraft.mResearchNotes.getClass().isInstance(aStack.getItem())) {
- return true;
- }
- return false;
- }
-
- public static boolean isItemStackValidResearchNotes(ItemStack aStack) {
- if (isItemResearchNotes(aStack) && aStack.getItemDamage() < 64) {
- return true;
- }
- return false;
- }
-
- public static TC_ResearchNoteData_Wrapper gatherResults(ItemStack note) {
- TC_ResearchNoteData_Wrapper research = null;
- if (isItemResearchNotes(note)) {
- research = new TC_ResearchNoteData_Wrapper(getResearchNoteData(note));
- }
- return research;
- }
-
- public static void placeAspectIntoResearchNote(ItemStack note, World aWorld, final int q, final int r, final TC_Aspect_Wrapper aspect) {
- /*TC_ResearchNoteData_Wrapper data = gatherResults(note);
- String mGTPP = CORE.gameProfile.getName();
- EntityPlayer player = CORE.getFakePlayer(aWorld);
-
- if (isItemResearchNotes(note) && data != null && note.getItemDamage() < 64) {
- final boolean r2 = ResearchManager.isResearchComplete(mGTPP, "RESEARCHER1");
- final boolean r3 = ResearchManager.isResearchComplete(mGTPP, "RESEARCHER2");
- final HexUtils.Hex hex = new HexUtils.Hex(q, r);
- ResearchManager.HexEntry he = null;
- if (aspect != null) {
- he = new ResearchManager.HexEntry(aspect, 2);
- if (r3 && aWorld.rand.nextFloat() < 0.1f) {
- aWorld.playSoundAtEntity((Entity) player, "random.orb", 0.2f, 0.9f + player.worldObj.rand.nextFloat() * 0.2f);
- }
- } else {
- final float f = aWorld.rand.nextFloat();
- if (data.hexEntries.get(hex.toString()).aspect != null
- && ((r2 && f < 0.25f) || (r3 && f < 0.5f))) {
- aWorld.playSoundAtEntity((Entity) player, "random.orb", 0.2f,
- 0.9f + player.worldObj.rand.nextFloat() * 0.2f);
- ResearchManager.scheduleSave(player);
- }
- he = new ResearchManager.HexEntry((Aspect) null, 0);
- }
- data.hexEntries.put(hex.toString(), he);
- data.hexes.put(hex.toString(), hex);
- updateResearchNote(note, data);
- if (!aWorld.isRemote && ResearchManager.checkResearchCompletion(note, data, player.getCommandSenderName())) {
- note.setItemDamage(64);
- }
- }*/
- }
-
- public static void completeResearchNote(World aWorld, ItemStack aStack) {
- if (!aWorld.isRemote) {
- if (isItemResearchNotes(aStack)) {
- aStack.setItemDamage(64);
- }
- }
- }
-
- public static synchronized final TC_AspectList_Wrapper getAspectList_Ex(final List<GTPP_AspectStack> aAspects) {
- final TC_AspectList_Wrapper rAspects = new TC_AspectList_Wrapper();
- for (final GTPP_AspectStack tAspect : aAspects) {
- rAspects.add(tAspect.mAspect, tAspect.mAmount);
- }
- return rAspects;
- }
-
- public static void addResearch(TC_ResearchItem_Wrapper tc_ResearchItem_Wrapper) {
- // TODO Auto-generated method stub
-
- }
+ private static Class<?> mClass_Aspect;
+ private static Field mField_Aspects;
+
+ static {
+ mClass_Aspect = ReflectionUtils.getClass("thaumcraft.api.aspects.Aspect");
+ if (mClass_Aspect != null) {
+ Field aTagF = ReflectionUtils.getField(mClass_Aspect, "tag");
+ if (aTagF != null) {
+ mField_Aspects = aTagF;
+ }
+ }
+ }
+
+ public static boolean addAspectToItem(ItemStack item, TC_Aspect_Wrapper aspect, int amount) {
+ return addAspectToItem(item, new TC_Aspect_Wrapper[] {aspect}, new Integer[] {amount});
+ }
+
+ public static boolean addAspectToItem(ItemStack item, TC_Aspect_Wrapper[] aspect, Integer[] amounts) {
+ GTPP_AspectStack[] aspects = new GTPP_AspectStack[aspect.length];
+ for (int g = 0; g < aspect.length; g++) {
+ if (amounts[g] != null && amounts[g] > 0) {
+ // aspects[g] = new GTPP_AspectStack(aspect[g], amounts[g]);
+ }
+ }
+ Pair<ItemStack, GTPP_AspectStack[]> k = new Pair<ItemStack, GTPP_AspectStack[]>(item, aspects);
+ int mSizeA = sItemsToGetAspects.size();
+ sItemsToGetAspects.put(k);
+ if (sItemsToGetAspects.size() > mSizeA) {
+ Logger.MATERIALS("[Aspect] Successfully queued an ItemStack for Aspect addition.");
+ return true;
+ }
+ Logger.MATERIALS("[Aspect] Failed to queue an ItemStack for Aspect addition.");
+ // Logger.INFO("[Aspect] ");
+ return false;
+ }
+
+ public static TC_Aspect_Wrapper getAspect(String name) {
+ return TC_Aspect_Wrapper.getAspect(name);
+ }
+
+ public static TC_Aspects getEnumAspect(String name) {
+ TC_Aspect_Wrapper r = getAspect(name);
+ return r.mGtEnumField;
+ }
+
+ public static Object addResearch(
+ String aResearch,
+ String aName,
+ String aText,
+ String[] aParentResearches,
+ String aCategory,
+ ItemStack aIcon,
+ int aComplexity,
+ int aType,
+ int aX,
+ int aY,
+ List<GTPP_AspectStack> aAspects,
+ ItemStack[] aResearchTriggers,
+ Object[] aPages) {
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.researches, aResearch, true)) {
+ return null;
+ }
+ TC_ResearchCategoryList_Wrapper tCategory = TC_ResearchCategories_Wrapper.getResearchList(aCategory);
+ if (tCategory == null) {
+ return null;
+ }
+ for (Iterator<TC_ResearchItem_Wrapper> i$ = tCategory.research.values().iterator(); i$.hasNext(); ) {
+ TC_ResearchItem_Wrapper tResearch = (TC_ResearchItem_Wrapper) i$.next();
+ if ((tResearch.displayColumn == aX) && (tResearch.displayRow == aY)) {
+ aX += (aX > 0 ? 5 : -5);
+ aY += (aY > 0 ? 5 : -5);
+ }
+ }
+ TC_ResearchItem_Wrapper rResearch = new TC_ResearchItem_Wrapper(
+ aResearch, aCategory, getAspectList_Ex(aAspects), aX, aY, aComplexity, aIcon);
+ ArrayList<Object> tPages = new ArrayList<Object>(aPages.length);
+ GT_LanguageManager.addStringLocalization("tc.research_name." + aResearch, aName);
+ GT_LanguageManager.addStringLocalization("tc.research_text." + aResearch, "[GT++] " + aText);
+ for (Object tPage : aPages) {
+ if ((tPage instanceof String)) {
+ tPages.add(new TC_ResearchPage_Wrapper((String) tPage));
+ } else if ((tPage instanceof IRecipe)) {
+ tPages.add(new TC_ResearchPage_Wrapper((IRecipe) tPage));
+ } else if ((tPage instanceof TC_IArcaneRecipe_Wrapper)) {
+ tPages.add(new TC_ResearchPage_Wrapper((TC_IArcaneRecipe_Wrapper) tPage));
+ } else if ((tPage instanceof TC_CrucibleRecipe_Wrapper)) {
+ tPages.add(new TC_ResearchPage_Wrapper((TC_CrucibleRecipe_Wrapper) tPage));
+ } else if ((tPage instanceof TC_InfusionRecipe_Wrapper)) {
+ tPages.add(new TC_ResearchPage_Wrapper((TC_InfusionRecipe_Wrapper) tPage));
+ } else if ((tPage instanceof TC_InfusionEnchantmentRecipe_Wrapper)) {
+ tPages.add(new TC_ResearchPage_Wrapper((TC_InfusionEnchantmentRecipe_Wrapper) tPage));
+ }
+ }
+ if ((aType & 0x40) != 0) {
+ rResearch.setAutoUnlock();
+ }
+ if ((aType & 0x1) != 0) {
+ rResearch.setSecondary();
+ }
+ if ((aType & 0x20) != 0) {
+ rResearch.setSpecial();
+ }
+ if ((aType & 0x8) != 0) {
+ rResearch.setVirtual();
+ }
+ if ((aType & 0x4) != 0) {
+ rResearch.setHidden();
+ }
+ if ((aType & 0x10) != 0) {
+ rResearch.setRound();
+ }
+ if ((aType & 0x2) != 0) {
+ rResearch.setStub();
+ }
+ if (aParentResearches != null) {
+ ArrayList<String> tParentResearches = new ArrayList<String>();
+ for (String tParent : aParentResearches) {
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.researches, aResearch, true)) {
+ tParentResearches.add(tParent);
+ }
+ }
+ if (tParentResearches.size() > 0) {
+ rResearch.setParents((String[]) tParentResearches.toArray(new String[tParentResearches.size()]));
+ rResearch.setConcealed();
+ }
+ }
+ if (aResearchTriggers != null) {
+ rResearch.setItemTriggers(aResearchTriggers);
+ rResearch.setHidden();
+ }
+
+ Object[] aVarArgs = (TC_ResearchPage_Wrapper[]) tPages.toArray(new TC_ResearchPage_Wrapper[tPages.size()]);
+ rResearch.setPages(aVarArgs);
+ return rResearch.registerResearchItem();
+ }
+
+ public static Object addCrucibleRecipe(
+ final String aResearch,
+ final Object aInput,
+ final ItemStack aOutput,
+ final List<GTPP_AspectStack> aAspects) {
+ if (GT_Utility.isStringInvalid((Object) aResearch)
+ || aInput == null
+ || aOutput == null
+ || aAspects == null
+ || aAspects.isEmpty()) {
+ return null;
+ }
+ return addCrucibleRecipe(
+ aResearch,
+ GT_Utility.copy(new Object[] {aOutput}),
+ (aInput instanceof ItemStack || aInput instanceof ArrayList) ? aInput : aInput.toString(),
+ getAspectList_Ex(aAspects));
+ }
+
+ public static Object addInfusionRecipe(
+ final String aResearch,
+ final ItemStack aMainInput,
+ final ItemStack[] aSideInputs,
+ final ItemStack aOutput,
+ final int aInstability,
+ final List<GTPP_AspectStack> aAspects) {
+ if (GT_Utility.isStringInvalid((Object) aResearch)
+ || aMainInput == null
+ || aSideInputs == null
+ || aOutput == null
+ || aAspects == null
+ || aAspects.isEmpty()) {
+ return null;
+ }
+ return addInfusionCraftingRecipe(
+ aResearch,
+ (Object) GT_Utility.copy(new Object[] {aOutput}),
+ aInstability,
+ getAspectList_Ex(aAspects),
+ aMainInput,
+ aSideInputs);
+ }
+
+ public static boolean registerThaumcraftAspectsToItem(
+ final ItemStack aExampleStack, final List<GTPP_AspectStack> aAspects, final String aOreDict) {
+ if (aAspects.isEmpty()) {
+ return false;
+ }
+ registerObjectTag(aOreDict, getAspectList_Ex(aAspects));
+ return true;
+ }
+
+ public static boolean registerThaumcraftAspectsToItem(
+ final ItemStack aStack, final List<GTPP_AspectStack> aAspects, final boolean aAdditive) {
+ try {
+ if (aAspects.isEmpty()) {
+ return false;
+ }
+ TC_AspectList_Wrapper h = getAspectList_Ex(aAspects);
+ if (aAdditive && (h != null && h.size() > 0)) {
+ registerComplexObjectTag(aStack, getAspectList_Ex(aAspects));
+ return true;
+ } else {
+ Logger.MATERIALS("[Aspect] Failed adding aspects to " + aStack.getDisplayName() + ".");
+ }
+ final TC_AspectList_Wrapper tAlreadyRegisteredAspects = getObjectAspects(aStack);
+ if (tAlreadyRegisteredAspects == null || tAlreadyRegisteredAspects.size() <= 0) {
+ registerObjectTag(aStack, getAspectList_Ex(aAspects));
+ }
+ return true;
+ } catch (Throwable t) {
+ Logger.MATERIALS("[Aspect] Failed adding aspects to " + aStack.getDisplayName() + ".");
+ t.printStackTrace();
+ return false;
+ }
+ }
+
+ private static final Class<?> mClass_ThaumcraftApi;
+ private static final Class<?> mClass_ThaumcraftApiHelper;
+ private static final Class<?> mClass_AspectList;
+ private static final Class<?> mClass_ResearchManager;
+ private static final Method mMethod_registerObjectTag1;
+ private static final Method mMethod_registerObjectTag2;
+ private static final Method mMethod_registerComplexObjectTag;
+ private static final Method mMethod_addInfusionCraftingRecipe;
+ private static final Method mMethod_addCrucibleRecipe;
+ private static final Method mMethod_getObjectAspects;
+ private static final Method mMethod_updateData;
+ private static final Method mMethod_getData;
+
+ private static final Field mField_PortholeBlacklist;
+
+ static {
+ /*
+ * Classes
+ */
+ mClass_ThaumcraftApi = ReflectionUtils.getClass("thaumcraft.api.ThaumcraftApi");
+ mClass_ThaumcraftApiHelper = ReflectionUtils.getClass("thaumcraft.api.ThaumcraftApiHelper");
+ mClass_AspectList = ReflectionUtils.getClass("thaumcraft.api.aspects.AspectList");
+ mClass_ResearchManager = ReflectionUtils.getClass("thaumcraft.common.lib.research.ResearchManager");
+
+ /*
+ * Methods
+ */
+ mMethod_registerObjectTag1 = ReflectionUtils.getMethod(
+ mClass_ThaumcraftApi, "registerObjectTag", ItemStack.class, mClass_AspectList);
+
+ mMethod_registerObjectTag2 =
+ ReflectionUtils.getMethod(mClass_ThaumcraftApi, "registerObjectTag", String.class, mClass_AspectList);
+
+ mMethod_registerComplexObjectTag = ReflectionUtils.getMethod(
+ mClass_ThaumcraftApi, "registerComplexObjectTag", ItemStack.class, mClass_AspectList);
+
+ mMethod_addInfusionCraftingRecipe = ReflectionUtils.getMethod(
+ mClass_ThaumcraftApi,
+ "addInfusionCraftingRecipe",
+ String.class,
+ Object.class,
+ int.class,
+ mClass_AspectList,
+ ItemStack.class,
+ ItemStack[].class);
+
+ mMethod_addCrucibleRecipe = ReflectionUtils.getMethod(
+ mClass_ThaumcraftApi,
+ "addCrucibleRecipe",
+ String.class,
+ ItemStack.class,
+ Object.class,
+ mClass_AspectList);
+
+ mMethod_getObjectAspects =
+ ReflectionUtils.getMethod(mClass_ThaumcraftApiHelper, "getObjectAspects", ItemStack.class);
+
+ mMethod_updateData = ReflectionUtils.getMethod(
+ mClass_ResearchManager,
+ "updateData",
+ ItemStack.class,
+ ReflectionUtils.getClass("thaumcraft.common.lib.research.ResearchNoteData"));
+ mMethod_getData = ReflectionUtils.getMethod(mClass_ResearchManager, "getData", ItemStack.class);
+
+ /*
+ * Fields
+ */
+ mField_PortholeBlacklist = ReflectionUtils.getField(mClass_ThaumcraftApi, "portableHoleBlackList");
+ }
+
+ public static void registerObjectTag(ItemStack aStack, TC_AspectList_Wrapper aAspectList) {
+ try {
+ mMethod_registerObjectTag1.invoke(null, aStack, aAspectList.getVanillaAspectList());
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void registerObjectTag(String aOreDict, TC_AspectList_Wrapper aAspectList) {
+ try {
+ mMethod_registerObjectTag2.invoke(null, aOreDict, aAspectList.getVanillaAspectList());
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void registerComplexObjectTag(ItemStack aStack, TC_AspectList_Wrapper aAspectList) {
+ try {
+ mMethod_registerComplexObjectTag.invoke(null, aStack, aAspectList.getVanillaAspectList());
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static TC_AspectList_Wrapper getObjectAspects(ItemStack aStack) {
+ try {
+ return new TC_AspectList_Wrapper(mMethod_getObjectAspects.invoke(null, aStack));
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static Object addCrucibleRecipe(
+ String aResearch, ItemStack copy, Object aOutput, TC_AspectList_Wrapper aAspectList) {
+ try {
+ return mMethod_addCrucibleRecipe.invoke(null, aResearch, copy, aOutput, aAspectList);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static Object addInfusionCraftingRecipe(
+ String aResearch,
+ Object copy,
+ int aInstability,
+ TC_AspectList_Wrapper aAspectList,
+ ItemStack aMainInput,
+ ItemStack[] aSideInputs) {
+ try {
+ return mMethod_addInfusionCraftingRecipe.invoke(
+ null, aResearch, copy, aInstability, aAspectList, aMainInput, aSideInputs);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static boolean registerPortholeBlacklistedBlock(final Block aBlock) {
+ try {
+ ((ArrayList<Block>) mField_PortholeBlacklist.get(null)).add(aBlock);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ return false;
+ }
+ return true;
+ }
+
+ public static String getTagFromAspectObject(Object aAspect) {
+ try {
+ if (mClass_Aspect == null || mField_Aspects == null) {
+ return null;
+ }
+ String aTafB = (String) mField_Aspects.get(aAspect);
+ if (aTafB == null) {
+ return null;
+ }
+ String aTag = aTafB.toLowerCase();
+ return aTag;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return "error";
+ }
+ }
+
+ public static void updateResearchNote(ItemStack a, TC_ResearchNoteData_Wrapper b) {
+ // updateData(a, b.getResearchNoteData());
+ try {
+ mMethod_updateData.invoke(a, b.getResearchNoteData());
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static Object getResearchNoteData(ItemStack a) {
+ // getData(a);
+ try {
+ return mMethod_getData.invoke(a);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static boolean isItemResearchNotes(ItemStack aStack) {
+ if (aStack != null
+ && aStack.getItem() == HANDLER_Thaumcraft.mResearchNotes
+ && HANDLER_Thaumcraft.mResearchNotes.getClass().isInstance(aStack.getItem())) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isItemStackValidResearchNotes(ItemStack aStack) {
+ if (isItemResearchNotes(aStack) && aStack.getItemDamage() < 64) {
+ return true;
+ }
+ return false;
+ }
+
+ public static TC_ResearchNoteData_Wrapper gatherResults(ItemStack note) {
+ TC_ResearchNoteData_Wrapper research = null;
+ if (isItemResearchNotes(note)) {
+ research = new TC_ResearchNoteData_Wrapper(getResearchNoteData(note));
+ }
+ return research;
+ }
+
+ public static void placeAspectIntoResearchNote(
+ ItemStack note, World aWorld, final int q, final int r, final TC_Aspect_Wrapper aspect) {
+ /*TC_ResearchNoteData_Wrapper data = gatherResults(note);
+ String mGTPP = CORE.gameProfile.getName();
+ EntityPlayer player = CORE.getFakePlayer(aWorld);
+
+ if (isItemResearchNotes(note) && data != null && note.getItemDamage() < 64) {
+ final boolean r2 = ResearchManager.isResearchComplete(mGTPP, "RESEARCHER1");
+ final boolean r3 = ResearchManager.isResearchComplete(mGTPP, "RESEARCHER2");
+ final HexUtils.Hex hex = new HexUtils.Hex(q, r);
+ ResearchManager.HexEntry he = null;
+ if (aspect != null) {
+ he = new ResearchManager.HexEntry(aspect, 2);
+ if (r3 && aWorld.rand.nextFloat() < 0.1f) {
+ aWorld.playSoundAtEntity((Entity) player, "random.orb", 0.2f, 0.9f + player.worldObj.rand.nextFloat() * 0.2f);
+ }
+ } else {
+ final float f = aWorld.rand.nextFloat();
+ if (data.hexEntries.get(hex.toString()).aspect != null
+ && ((r2 && f < 0.25f) || (r3 && f < 0.5f))) {
+ aWorld.playSoundAtEntity((Entity) player, "random.orb", 0.2f,
+ 0.9f + player.worldObj.rand.nextFloat() * 0.2f);
+ ResearchManager.scheduleSave(player);
+ }
+ he = new ResearchManager.HexEntry((Aspect) null, 0);
+ }
+ data.hexEntries.put(hex.toString(), he);
+ data.hexes.put(hex.toString(), hex);
+ updateResearchNote(note, data);
+ if (!aWorld.isRemote && ResearchManager.checkResearchCompletion(note, data, player.getCommandSenderName())) {
+ note.setItemDamage(64);
+ }
+ }*/
+ }
+
+ public static void completeResearchNote(World aWorld, ItemStack aStack) {
+ if (!aWorld.isRemote) {
+ if (isItemResearchNotes(aStack)) {
+ aStack.setItemDamage(64);
+ }
+ }
+ }
+
+ public static final synchronized TC_AspectList_Wrapper getAspectList_Ex(final List<GTPP_AspectStack> aAspects) {
+ final TC_AspectList_Wrapper rAspects = new TC_AspectList_Wrapper();
+ for (final GTPP_AspectStack tAspect : aAspects) {
+ rAspects.add(tAspect.mAspect, tAspect.mAmount);
+ }
+ return rAspects;
+ }
+
+ public static void addResearch(TC_ResearchItem_Wrapper tc_ResearchItem_Wrapper) {
+ // TODO Auto-generated method stub
+
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java
index fe9a82c6b5..0ad922942b 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java
@@ -7,37 +7,37 @@ import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
import gtPlusPlus.xmod.thermalfoundation.item.TF_Items;
import gtPlusPlus.xmod.thermalfoundation.recipe.TF_Gregtech_Recipes;
-public class HANDLER_TF{
+public class HANDLER_TF {
- public static void preInit(){
- if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation){
- TF_Fluids.preInit();
- TF_Items.preInit();
- TF_Blocks.preInit();
- if (LoadedMods.Gregtech){
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- //mGregMatLoader.enableMaterial(Materials.Enderium);
- }
- }
- }
- }
+ public static void preInit() {
+ if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation) {
+ TF_Fluids.preInit();
+ TF_Items.preInit();
+ TF_Blocks.preInit();
+ if (LoadedMods.Gregtech) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ // mGregMatLoader.enableMaterial(Materials.Enderium);
+ }
+ }
+ }
+ }
- public static void init(){
- if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation){
- TF_Fluids.init();
- TF_Blocks.init();
- TF_Items.init();
- }
- }
+ public static void init() {
+ if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation) {
+ TF_Fluids.init();
+ TF_Blocks.init();
+ TF_Items.init();
+ }
+ }
- public static void postInit(){
- if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation){
- TF_Fluids.postInit();
- TF_Items.postInit();
- TF_Blocks.postInit();
- if(LoadedMods.Gregtech){
- TF_Gregtech_Recipes.run();
- }
- }
- }
+ public static void postInit() {
+ if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation) {
+ TF_Fluids.postInit();
+ TF_Items.postInit();
+ TF_Blocks.postInit();
+ if (LoadedMods.Gregtech) {
+ TF_Gregtech_Recipes.run();
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java
index a0480e907e..2118df699a 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java
@@ -1,9 +1,13 @@
package gtPlusPlus.xmod.thermalfoundation.block;
-import java.util.Random;
-
+import cofh.core.fluid.BlockFluidInteractive;
+import cofh.lib.util.BlockWrapper;
+import cofh.lib.util.helpers.DamageHelper;
+import cofh.lib.util.helpers.ServerHelper;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
@@ -16,176 +20,169 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-
-import cofh.core.fluid.BlockFluidInteractive;
-import cofh.lib.util.BlockWrapper;
-import cofh.lib.util.helpers.DamageHelper;
-import cofh.lib.util.helpers.ServerHelper;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
import net.minecraftforge.common.util.ForgeDirection;
-public class TF_Block_Fluid_Cryotheum
-extends BlockFluidInteractive
-{
- Random random = new Random();
- public static final int LEVELS = 5;
- public static final Material materialFluidCryotheum = new MaterialLiquid(MapColor.iceColor);
- private static boolean enableSourceFall = true;
- private static boolean effect = true;
-
- public TF_Block_Fluid_Cryotheum()
- {
- super(CORE.MODID, TF_Fluids.fluidCryotheum, materialFluidCryotheum, "cryotheum");
- this.setQuantaPerBlock(5);
- this.setTickRate(15);
-
- this.setHardness(1000.0F);
- this.setLightOpacity(1);
- this.setParticleColor(0.15F, 0.7F, 1.0F);
- }
-
- @Override
- public boolean preInit()
- {
- GameRegistry.registerBlock(this, "FluidCryotheum");
-
- this.addInteraction(Blocks.grass, Blocks.dirt);
- this.addInteraction(Blocks.water, 0, Blocks.ice);
- this.addInteraction(Blocks.water, Blocks.snow);
- this.addInteraction(Blocks.flowing_water, 0, Blocks.ice);
- this.addInteraction(Blocks.flowing_water, Blocks.snow);
- this.addInteraction(Blocks.lava, 0, Blocks.obsidian);
- this.addInteraction(Blocks.lava, Blocks.stone);
- this.addInteraction(Blocks.flowing_lava, 0, Blocks.obsidian);
- this.addInteraction(Blocks.flowing_lava, Blocks.stone);
- this.addInteraction(Blocks.leaves, Blocks.air);
- this.addInteraction(Blocks.tallgrass, Blocks.air);
- this.addInteraction(Blocks.fire, Blocks.air);
- //addInteraction(TFBlocks.blockFluidGlowstone, 0, Blocks.glowstone);
-
- final String str1 = "Fluid.Cryotheum";
- String str2 = "Enable this for Fluid Cryotheum to be worse than lava, except cold.";
- effect = true;
-
- str2 = "Enable this for Fluid Cryotheum Source blocks to gradually fall downwards.";
- enableSourceFall = true;
-
- return true;
- }
-
- @Override
- public void onEntityCollidedWithBlock(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3, final Entity paramEntity)
- {
- paramEntity.extinguish();
- if (!effect) {
- return;
- }
- if ((paramEntity.motionY < -0.05D) || (paramEntity.motionY > 0.05D)) {
- paramEntity.motionY *= 0.05D;
- }
- if ((paramEntity.motionZ < -0.05D) || (paramEntity.motionZ > 0.05D)) {
- paramEntity.motionZ *= 0.05D;
- }
- if ((paramEntity.motionX < -0.05D) || (paramEntity.motionX > 0.05D)) {
- paramEntity.motionX *= 0.05D;
- }
- if (ServerHelper.isClientWorld(paramWorld)) {
- return;
- }
- if ((paramWorld.getTotalWorldTime() % 8L) != 0L) {
- return;
- }
- if (((paramEntity instanceof EntityZombie)) || ((paramEntity instanceof EntityCreeper)))
- {
- final EntitySnowman localEntitySnowman = new EntitySnowman(paramWorld);
- localEntitySnowman.setLocationAndAngles(paramEntity.posX, paramEntity.posY, paramEntity.posZ, paramEntity.rotationYaw, paramEntity.rotationPitch);
- paramWorld.spawnEntityInWorld(localEntitySnowman);
-
- paramEntity.setDead();
- }
- else if (/*((paramEntity instanceof EntityBlizz)) ||*/((paramEntity instanceof EntitySnowman)))
- {
- ((EntityLivingBase)paramEntity).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120, 0));
- ((EntityLivingBase)paramEntity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 120, 0));
- }
- else if ((paramEntity instanceof EntityBlaze))
- {
- paramEntity.attackEntityFrom(DamageHelper.cryotheum, 10.0F);
- }
- else
- {
- final boolean bool = paramEntity.velocityChanged;
- paramEntity.attackEntityFrom(DamageHelper.cryotheum, 2.0F);
- paramEntity.velocityChanged = bool;
- }
- }
-
- @Override
- public int getLightValue(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, final int paramInt3)
- {
- return TF_Fluids.fluidCryotheum.getLuminosity();
- }
-
- @Override
- public void updateTick(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3, final Random paramRandom)
- {
- if (effect) {
- this.checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
- }
- if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0))
- {
- final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
- final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
- if ((localBlock == this) && (i != 0))
- {
- paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
- paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
- return;
- }
- }
- super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
- }
-
- protected void checkForInteraction(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3)
- {
- if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
- return;
- }
- int i = paramInt1;
- int j = paramInt2;
- int k = paramInt3;
- for (int m = 0; m < 6; m++)
- {
- i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
- j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
- k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
-
- this.interactWithBlock(paramWorld, i, j, k);
- }
- this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
- this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
- this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
- this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
- }
-
- protected void interactWithBlock(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3)
- {
- final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
- if ((localBlock == Blocks.air) || (localBlock == this)) {
- return;
- }
- final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
- if (this.hasInteraction(localBlock, i))
- {
- final BlockWrapper localBlockWrapper = this.getInteraction(localBlock, i);
- paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3);
- }
- else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3)))
- {
- paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.snow_layer, 0, 3);
- }
- }
-
- protected void triggerInteractionEffects(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3) {}
+public class TF_Block_Fluid_Cryotheum extends BlockFluidInteractive {
+ Random random = new Random();
+ public static final int LEVELS = 5;
+ public static final Material materialFluidCryotheum = new MaterialLiquid(MapColor.iceColor);
+ private static boolean enableSourceFall = true;
+ private static boolean effect = true;
+
+ public TF_Block_Fluid_Cryotheum() {
+ super(CORE.MODID, TF_Fluids.fluidCryotheum, materialFluidCryotheum, "cryotheum");
+ this.setQuantaPerBlock(5);
+ this.setTickRate(15);
+
+ this.setHardness(1000.0F);
+ this.setLightOpacity(1);
+ this.setParticleColor(0.15F, 0.7F, 1.0F);
+ }
+
+ @Override
+ public boolean preInit() {
+ GameRegistry.registerBlock(this, "FluidCryotheum");
+
+ this.addInteraction(Blocks.grass, Blocks.dirt);
+ this.addInteraction(Blocks.water, 0, Blocks.ice);
+ this.addInteraction(Blocks.water, Blocks.snow);
+ this.addInteraction(Blocks.flowing_water, 0, Blocks.ice);
+ this.addInteraction(Blocks.flowing_water, Blocks.snow);
+ this.addInteraction(Blocks.lava, 0, Blocks.obsidian);
+ this.addInteraction(Blocks.lava, Blocks.stone);
+ this.addInteraction(Blocks.flowing_lava, 0, Blocks.obsidian);
+ this.addInteraction(Blocks.flowing_lava, Blocks.stone);
+ this.addInteraction(Blocks.leaves, Blocks.air);
+ this.addInteraction(Blocks.tallgrass, Blocks.air);
+ this.addInteraction(Blocks.fire, Blocks.air);
+ // addInteraction(TFBlocks.blockFluidGlowstone, 0, Blocks.glowstone);
+
+ final String str1 = "Fluid.Cryotheum";
+ String str2 = "Enable this for Fluid Cryotheum to be worse than lava, except cold.";
+ effect = true;
+
+ str2 = "Enable this for Fluid Cryotheum Source blocks to gradually fall downwards.";
+ enableSourceFall = true;
+
+ return true;
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(
+ final World paramWorld,
+ final int paramInt1,
+ final int paramInt2,
+ final int paramInt3,
+ final Entity paramEntity) {
+ paramEntity.extinguish();
+ if (!effect) {
+ return;
+ }
+ if ((paramEntity.motionY < -0.05D) || (paramEntity.motionY > 0.05D)) {
+ paramEntity.motionY *= 0.05D;
+ }
+ if ((paramEntity.motionZ < -0.05D) || (paramEntity.motionZ > 0.05D)) {
+ paramEntity.motionZ *= 0.05D;
+ }
+ if ((paramEntity.motionX < -0.05D) || (paramEntity.motionX > 0.05D)) {
+ paramEntity.motionX *= 0.05D;
+ }
+ if (ServerHelper.isClientWorld(paramWorld)) {
+ return;
+ }
+ if ((paramWorld.getTotalWorldTime() % 8L) != 0L) {
+ return;
+ }
+ if (((paramEntity instanceof EntityZombie)) || ((paramEntity instanceof EntityCreeper))) {
+ final EntitySnowman localEntitySnowman = new EntitySnowman(paramWorld);
+ localEntitySnowman.setLocationAndAngles(
+ paramEntity.posX,
+ paramEntity.posY,
+ paramEntity.posZ,
+ paramEntity.rotationYaw,
+ paramEntity.rotationPitch);
+ paramWorld.spawnEntityInWorld(localEntitySnowman);
+
+ paramEntity.setDead();
+ } else if (
+ /*((paramEntity instanceof EntityBlizz)) ||*/ ((paramEntity instanceof EntitySnowman))) {
+ ((EntityLivingBase) paramEntity).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120, 0));
+ ((EntityLivingBase) paramEntity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 120, 0));
+ } else if ((paramEntity instanceof EntityBlaze)) {
+ paramEntity.attackEntityFrom(DamageHelper.cryotheum, 10.0F);
+ } else {
+ final boolean bool = paramEntity.velocityChanged;
+ paramEntity.attackEntityFrom(DamageHelper.cryotheum, 2.0F);
+ paramEntity.velocityChanged = bool;
+ }
+ }
+
+ @Override
+ public int getLightValue(
+ final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, final int paramInt3) {
+ return TF_Fluids.fluidCryotheum.getLuminosity();
+ }
+
+ @Override
+ public void updateTick(
+ final World paramWorld,
+ final int paramInt1,
+ final int paramInt2,
+ final int paramInt3,
+ final Random paramRandom) {
+ if (effect) {
+ this.checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
+ }
+ if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0)) {
+ final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ if ((localBlock == this) && (i != 0)) {
+ paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
+ paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
+ return;
+ }
+ }
+ super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
+ }
+
+ protected void checkForInteraction(
+ final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3) {
+ if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
+ return;
+ }
+ int i = paramInt1;
+ int j = paramInt2;
+ int k = paramInt3;
+ for (int m = 0; m < 6; m++) {
+ i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
+ j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
+ k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
+
+ this.interactWithBlock(paramWorld, i, j, k);
+ }
+ this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
+ this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
+ this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
+ this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
+ }
+
+ protected void interactWithBlock(
+ final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3) {
+ final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
+ if ((localBlock == Blocks.air) || (localBlock == this)) {
+ return;
+ }
+ final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
+ if (this.hasInteraction(localBlock, i)) {
+ final BlockWrapper localBlockWrapper = this.getInteraction(localBlock, i);
+ paramWorld.setBlock(
+ paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3);
+ } else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP))
+ && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3))) {
+ paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.snow_layer, 0, 3);
+ }
+ }
+
+ protected void triggerInteractionEffects(
+ final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3) {}
}
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Ender.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Ender.java
index 513fe51fd9..5b2894c0fc 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Ender.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Ender.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.thermalfoundation.block;
+import cofh.core.fluid.BlockFluidCoFHBase;
+import cofh.core.util.CoreUtils;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialLiquid;
@@ -9,60 +12,49 @@ import net.minecraft.entity.Entity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import cofh.core.fluid.BlockFluidCoFHBase;
-import cofh.core.util.CoreUtils;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
+public class TF_Block_Fluid_Ender extends BlockFluidCoFHBase {
+ public static final int LEVELS = 4;
+ public static final Material materialFluidEnder = new MaterialLiquid(MapColor.greenColor);
+ private static boolean effect = true;
-public class TF_Block_Fluid_Ender
- extends BlockFluidCoFHBase
-{
- public static final int LEVELS = 4;
- public static final Material materialFluidEnder = new MaterialLiquid(MapColor.greenColor);
- private static boolean effect = true;
-
- public TF_Block_Fluid_Ender()
- {
- super(CORE.MODID, TF_Fluids.fluidEnder, materialFluidEnder, "ender");
- setQuantaPerBlock(4);
- setTickRate(20);
-
- setHardness(2000.0F);
- setLightOpacity(7);
- setParticleColor(0.05F, 0.2F, 0.2F);
- }
-
- @Override
-public boolean preInit()
- {
- GameRegistry.registerBlock(this, "FluidEnder");
-
- String str1 = "Fluid.Ender";
- String str2 = "Enable this for Fluid Ender to randomly teleport entities on contact.";
-
- return true;
- }
-
- @Override
-public void onEntityCollidedWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Entity paramEntity)
- {
- if ((!effect) || (paramWorld.isRemote)) {
- return;
+ public TF_Block_Fluid_Ender() {
+ super(CORE.MODID, TF_Fluids.fluidEnder, materialFluidEnder, "ender");
+ setQuantaPerBlock(4);
+ setTickRate(20);
+
+ setHardness(2000.0F);
+ setLightOpacity(7);
+ setParticleColor(0.05F, 0.2F, 0.2F);
+ }
+
+ @Override
+ public boolean preInit() {
+ GameRegistry.registerBlock(this, "FluidEnder");
+
+ String str1 = "Fluid.Ender";
+ String str2 = "Enable this for Fluid Ender to randomly teleport entities on contact.";
+
+ return true;
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(
+ World paramWorld, int paramInt1, int paramInt2, int paramInt3, Entity paramEntity) {
+ if ((!effect) || (paramWorld.isRemote)) {
+ return;
+ }
+ if (paramWorld.getTotalWorldTime() % 8L == 0L) {
+ int i = paramInt1 - 8 + paramWorld.rand.nextInt(17);
+ int j = paramInt2 + paramWorld.rand.nextInt(8);
+ int k = paramInt3 - 8 + paramWorld.rand.nextInt(17);
+ if (!paramWorld.getBlock(i, j, k).getMaterial().isSolid()) {
+ CoreUtils.teleportEntityTo(paramEntity, i, j, k);
+ }
+ }
}
- if (paramWorld.getTotalWorldTime() % 8L == 0L)
- {
- int i = paramInt1 - 8 + paramWorld.rand.nextInt(17);
- int j = paramInt2 + paramWorld.rand.nextInt(8);
- int k = paramInt3 - 8 + paramWorld.rand.nextInt(17);
- if (!paramWorld.getBlock(i, j, k).getMaterial().isSolid()) {
- CoreUtils.teleportEntityTo(paramEntity, i, j, k);
- }
+
+ @Override
+ public int getLightValue(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3) {
+ return TF_Fluids.fluidEnder.getLuminosity();
}
- }
-
- @Override
-public int getLightValue(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3)
- {
- return TF_Fluids.fluidEnder.getLuminosity();
- }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java
index 5444e8d5ad..637fefb2ea 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java
@@ -1,9 +1,12 @@
package gtPlusPlus.xmod.thermalfoundation.block;
-import java.util.Random;
-
+import cofh.core.fluid.BlockFluidInteractive;
+import cofh.lib.util.BlockWrapper;
+import cofh.lib.util.helpers.ServerHelper;
import cpw.mods.fml.common.registry.GameRegistry;
-
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
+import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
@@ -14,178 +17,201 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-
-import cofh.core.fluid.BlockFluidInteractive;
-import cofh.lib.util.BlockWrapper;
-import cofh.lib.util.helpers.ServerHelper;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
import net.minecraftforge.common.util.ForgeDirection;
-public class TF_Block_Fluid_Pyrotheum
-extends BlockFluidInteractive
-{
- Random random = new Random();
- public static final int LEVELS = 5;
- public static final Material materialFluidPyrotheum = new MaterialLiquid(MapColor.tntColor);
- private static boolean effect = true;
- private static boolean enableSourceFall = true;
-
- public TF_Block_Fluid_Pyrotheum()
- {
- super(CORE.MODID, TF_Fluids.fluidPyrotheum, Material.lava, "pyrotheum");
- this.setQuantaPerBlock(5);
- this.setTickRate(10);
-
- this.setHardness(1000.0F);
- this.setLightOpacity(1);
- this.setParticleColor(1.0F, 0.7F, 0.15F);
- }
-
- @Override
- public boolean preInit()
- {
- GameRegistry.registerBlock(this, "FluidPyrotheum");
-
- this.addInteraction(Blocks.cobblestone, Blocks.stone);
- this.addInteraction(Blocks.grass, Blocks.dirt);
- this.addInteraction(Blocks.sand, Blocks.glass);
- this.addInteraction(Blocks.water, Blocks.stone);
- this.addInteraction(Blocks.flowing_water, Blocks.stone);
- this.addInteraction(Blocks.clay, Blocks.hardened_clay);
- this.addInteraction(Blocks.ice, Blocks.stone);
- this.addInteraction(Blocks.snow, Blocks.air);
- this.addInteraction(Blocks.snow_layer, Blocks.air);
- for (int i = 0; i < 8; i++) {
- this.addInteraction(Blocks.stone_stairs, i, Blocks.stone_brick_stairs, i);
- }
- final String str1 = "Fluid.Pyrotheum";
- String str2 = "Enable this for Fluid Pyrotheum to be worse than lava.";
- effect = true;
-
- str2 = "Enable this for Fluid Pyrotheum Source blocks to gradually fall downwards.";
- enableSourceFall = true;
-
- return true;
- }
-
- @Override
- public void onEntityCollidedWithBlock(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3, final Entity paramEntity)
- {
- if (!effect) {
- return;
- }
- if (ServerHelper.isClientWorld(paramWorld)) {
- return;
- }
- if (!(paramEntity instanceof EntityPlayer)) {
- if ((paramEntity instanceof EntityCreeper))
- {
- paramWorld.createExplosion(paramEntity, paramEntity.posX, paramEntity.posY, paramEntity.posZ, 6.0F, paramEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
- paramEntity.setDead();
- }
- }
- }
-
- @Override
- public int getLightValue(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, final int paramInt3)
- {
- return TF_Fluids.fluidPyrotheum.getLuminosity();
- }
-
- @Override
- public int getFireSpreadSpeed(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, final int paramInt3, final ForgeDirection paramForgeDirection)
- {
- return effect ? 800 : 0;
- }
-
- @Override
- public int getFlammability(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, final int paramInt3, final ForgeDirection paramForgeDirection)
- {
- return 0;
- }
-
- @Override
- public boolean isFlammable(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, final int paramInt3, final ForgeDirection paramForgeDirection)
- {
- return (effect) && (paramForgeDirection.ordinal() > ForgeDirection.UP.ordinal()) && (paramIBlockAccess.getBlock(paramInt1, paramInt2 - 1, paramInt3) != this);
- }
-
- @Override
- public boolean isFireSource(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3, final ForgeDirection paramForgeDirection)
- {
- return effect;
- }
-
- @Override
- public void updateTick(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3, final Random paramRandom)
- {
- if (effect) {
- this.checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
- }
- if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0))
- {
- final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
- final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
- if (((localBlock == this) && (i != 0)) || (localBlock.isFlammable(paramWorld, paramInt1, paramInt2 + this.densityDir, paramInt3, ForgeDirection.UP)))
- {
- paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
- paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
- return;
- }
- }
- super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
- }
-
- protected void checkForInteraction(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3)
- {
- if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
- return;
- }
- int i = paramInt1;
- int j = paramInt2;
- int k = paramInt3;
- for (int m = 0; m < 6; m++)
- {
- i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
- j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
- k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
-
- this.interactWithBlock(paramWorld, i, j, k);
- }
- this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
- this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
- this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
- this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
- }
-
- protected void interactWithBlock(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3)
- {
- final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
- if ((localBlock == Blocks.air) || (localBlock == this)) {
- return;
- }
- final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
- if (this.hasInteraction(localBlock, i))
- {
- final BlockWrapper localBlockWrapper = this.getInteraction(localBlock, i);
- paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3);
- this.triggerInteractionEffects(paramWorld, paramInt1, paramInt2, paramInt3);
- }
- else if (localBlock.isFlammable(paramWorld, paramInt1, paramInt2, paramInt3, ForgeDirection.UP))
- {
- paramWorld.setBlock(paramInt1, paramInt2, paramInt3, Blocks.fire);
- }
- else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3)))
- {
- paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.fire, 0, 3);
- }
- }
-
- protected void triggerInteractionEffects(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3)
- {
- if (this.random.nextInt(16) == 0) {
- paramWorld.playSoundEffect(paramInt1 + 0.5F, paramInt2 + 0.5F, paramInt3 + 0.5F, "random.fizz", 0.5F, 2.2F + ((paramWorld.rand.nextFloat() - paramWorld.rand.nextFloat()) * 0.8F));
- }
- }
+public class TF_Block_Fluid_Pyrotheum extends BlockFluidInteractive {
+ Random random = new Random();
+ public static final int LEVELS = 5;
+ public static final Material materialFluidPyrotheum = new MaterialLiquid(MapColor.tntColor);
+ private static boolean effect = true;
+ private static boolean enableSourceFall = true;
+
+ public TF_Block_Fluid_Pyrotheum() {
+ super(CORE.MODID, TF_Fluids.fluidPyrotheum, Material.lava, "pyrotheum");
+ this.setQuantaPerBlock(5);
+ this.setTickRate(10);
+
+ this.setHardness(1000.0F);
+ this.setLightOpacity(1);
+ this.setParticleColor(1.0F, 0.7F, 0.15F);
+ }
+
+ @Override
+ public boolean preInit() {
+ GameRegistry.registerBlock(this, "FluidPyrotheum");
+
+ this.addInteraction(Blocks.cobblestone, Blocks.stone);
+ this.addInteraction(Blocks.grass, Blocks.dirt);
+ this.addInteraction(Blocks.sand, Blocks.glass);
+ this.addInteraction(Blocks.water, Blocks.stone);
+ this.addInteraction(Blocks.flowing_water, Blocks.stone);
+ this.addInteraction(Blocks.clay, Blocks.hardened_clay);
+ this.addInteraction(Blocks.ice, Blocks.stone);
+ this.addInteraction(Blocks.snow, Blocks.air);
+ this.addInteraction(Blocks.snow_layer, Blocks.air);
+ for (int i = 0; i < 8; i++) {
+ this.addInteraction(Blocks.stone_stairs, i, Blocks.stone_brick_stairs, i);
+ }
+ final String str1 = "Fluid.Pyrotheum";
+ String str2 = "Enable this for Fluid Pyrotheum to be worse than lava.";
+ effect = true;
+
+ str2 = "Enable this for Fluid Pyrotheum Source blocks to gradually fall downwards.";
+ enableSourceFall = true;
+
+ return true;
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(
+ final World paramWorld,
+ final int paramInt1,
+ final int paramInt2,
+ final int paramInt3,
+ final Entity paramEntity) {
+ if (!effect) {
+ return;
+ }
+ if (ServerHelper.isClientWorld(paramWorld)) {
+ return;
+ }
+ if (!(paramEntity instanceof EntityPlayer)) {
+ if ((paramEntity instanceof EntityCreeper)) {
+ paramWorld.createExplosion(
+ paramEntity,
+ paramEntity.posX,
+ paramEntity.posY,
+ paramEntity.posZ,
+ 6.0F,
+ paramEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
+ paramEntity.setDead();
+ }
+ }
+ }
+
+ @Override
+ public int getLightValue(
+ final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, final int paramInt3) {
+ return TF_Fluids.fluidPyrotheum.getLuminosity();
+ }
+
+ @Override
+ public int getFireSpreadSpeed(
+ final IBlockAccess paramIBlockAccess,
+ final int paramInt1,
+ final int paramInt2,
+ final int paramInt3,
+ final ForgeDirection paramForgeDirection) {
+ return effect ? 800 : 0;
+ }
+
+ @Override
+ public int getFlammability(
+ final IBlockAccess paramIBlockAccess,
+ final int paramInt1,
+ final int paramInt2,
+ final int paramInt3,
+ final ForgeDirection paramForgeDirection) {
+ return 0;
+ }
+
+ @Override
+ public boolean isFlammable(
+ final IBlockAccess paramIBlockAccess,
+ final int paramInt1,
+ final int paramInt2,
+ final int paramInt3,
+ final ForgeDirection paramForgeDirection) {
+ return (effect)
+ && (paramForgeDirection.ordinal() > ForgeDirection.UP.ordinal())
+ && (paramIBlockAccess.getBlock(paramInt1, paramInt2 - 1, paramInt3) != this);
+ }
+
+ @Override
+ public boolean isFireSource(
+ final World paramWorld,
+ final int paramInt1,
+ final int paramInt2,
+ final int paramInt3,
+ final ForgeDirection paramForgeDirection) {
+ return effect;
+ }
+
+ @Override
+ public void updateTick(
+ final World paramWorld,
+ final int paramInt1,
+ final int paramInt2,
+ final int paramInt3,
+ final Random paramRandom) {
+ if (effect) {
+ this.checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
+ }
+ if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0)) {
+ final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ if (((localBlock == this) && (i != 0))
+ || (localBlock.isFlammable(
+ paramWorld, paramInt1, paramInt2 + this.densityDir, paramInt3, ForgeDirection.UP))) {
+ paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
+ paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
+ return;
+ }
+ }
+ super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
+ }
+
+ protected void checkForInteraction(
+ final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3) {
+ if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
+ return;
+ }
+ int i = paramInt1;
+ int j = paramInt2;
+ int k = paramInt3;
+ for (int m = 0; m < 6; m++) {
+ i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
+ j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
+ k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
+
+ this.interactWithBlock(paramWorld, i, j, k);
+ }
+ this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
+ this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
+ this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
+ this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
+ }
+
+ protected void interactWithBlock(
+ final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3) {
+ final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
+ if ((localBlock == Blocks.air) || (localBlock == this)) {
+ return;
+ }
+ final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
+ if (this.hasInteraction(localBlock, i)) {
+ final BlockWrapper localBlockWrapper = this.getInteraction(localBlock, i);
+ paramWorld.setBlock(
+ paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3);
+ this.triggerInteractionEffects(paramWorld, paramInt1, paramInt2, paramInt3);
+ } else if (localBlock.isFlammable(paramWorld, paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) {
+ paramWorld.setBlock(paramInt1, paramInt2, paramInt3, Blocks.fire);
+ } else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP))
+ && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3))) {
+ paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.fire, 0, 3);
+ }
+ }
+
+ protected void triggerInteractionEffects(
+ final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3) {
+ if (this.random.nextInt(16) == 0) {
+ paramWorld.playSoundEffect(
+ paramInt1 + 0.5F,
+ paramInt2 + 0.5F,
+ paramInt3 + 0.5F,
+ "random.fizz",
+ 0.5F,
+ 2.2F + ((paramWorld.rand.nextFloat() - paramWorld.rand.nextFloat()) * 0.8F));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java
index 6b56262b1a..38fed4c137 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java
@@ -2,28 +2,22 @@ package gtPlusPlus.xmod.thermalfoundation.block;
import cofh.core.fluid.BlockFluidCoFHBase;
-public class TF_Blocks
-{
+public class TF_Blocks {
- public static BlockFluidCoFHBase blockFluidPyrotheum;
- public static BlockFluidCoFHBase blockFluidCryotheum;
- public static BlockFluidCoFHBase blockFluidEnder;
+ public static BlockFluidCoFHBase blockFluidPyrotheum;
+ public static BlockFluidCoFHBase blockFluidCryotheum;
+ public static BlockFluidCoFHBase blockFluidEnder;
+ public static void preInit() {
+ blockFluidPyrotheum = new TF_Block_Fluid_Pyrotheum();
+ blockFluidCryotheum = new TF_Block_Fluid_Cryotheum();
+ blockFluidEnder = new TF_Block_Fluid_Ender();
+ blockFluidPyrotheum.preInit();
+ blockFluidCryotheum.preInit();
+ blockFluidEnder.preInit();
+ }
- public static void preInit()
- {
- blockFluidPyrotheum = new TF_Block_Fluid_Pyrotheum();
- blockFluidCryotheum = new TF_Block_Fluid_Cryotheum();
- blockFluidEnder = new TF_Block_Fluid_Ender();
- blockFluidPyrotheum.preInit();
- blockFluidCryotheum.preInit();
- blockFluidEnder.preInit();
- }
+ public static void init() {}
- public static void init() {}
-
- public static void postInit()
- {
-
- }
+ public static void postInit() {}
}
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
index 6ebae64384..bd4467c7b0 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
@@ -1,79 +1,85 @@
package gtPlusPlus.xmod.thermalfoundation.fluid;
-import net.minecraft.block.BlockDispenser;
-import net.minecraft.init.Items;
-import net.minecraft.item.EnumRarity;
-
import cofh.core.util.fluid.DispenserEmptyBucketHandler;
import cofh.core.util.fluid.DispenserFilledBucketHandler;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.xmod.thermalfoundation.item.TF_Items;
+import net.minecraft.block.BlockDispenser;
+import net.minecraft.init.Items;
+import net.minecraft.item.EnumRarity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
-public class TF_Fluids
-{
- public static Fluid fluidPyrotheum;
- public static Fluid fluidCryotheum;
- public static Fluid fluidEnder;
+public class TF_Fluids {
+ public static Fluid fluidPyrotheum;
+ public static Fluid fluidCryotheum;
+ public static Fluid fluidEnder;
+
+ public static void preInit() {
+ if (!LoadedMods.ThermalFoundation) {
+ Logger.INFO("Adding in our own versions of Thermal Foundation Fluids - Non-GT");
+ final Fluid pyrotheum = FluidRegistry.getFluid("pyrotheum");
+ final Fluid cryotheum = FluidRegistry.getFluid("cryotheum");
+ final Fluid ender = FluidRegistry.getFluid("ender");
- public static void preInit()
- {
- if (!LoadedMods.ThermalFoundation){
- Logger.INFO("Adding in our own versions of Thermal Foundation Fluids - Non-GT");
- final Fluid pyrotheum = FluidRegistry.getFluid("pyrotheum");
- final Fluid cryotheum = FluidRegistry.getFluid("cryotheum");
- final Fluid ender = FluidRegistry.getFluid("ender");
+ if (pyrotheum == null) {
+ Logger.INFO("Registering Blazing Pyrotheum as it does not exist.");
+ fluidPyrotheum = new Fluid("pyrotheum")
+ .setLuminosity(15)
+ .setDensity(2000)
+ .setViscosity(1200)
+ .setTemperature(4000)
+ .setRarity(EnumRarity.rare);
+ registerFluid(fluidPyrotheum, "pyrotheum");
+ } else {
+ Logger.INFO("Registering Blazing Pyrotheum as it is an already existing Fluid.");
+ fluidPyrotheum = pyrotheum;
+ }
+ if (cryotheum == null) {
+ Logger.INFO("Registering Gelid Cryotheum as it does not exist.");
+ fluidCryotheum = new Fluid("cryotheum")
+ .setLuminosity(0)
+ .setDensity(4000)
+ .setViscosity(3000)
+ .setTemperature(50)
+ .setRarity(EnumRarity.rare);
+ registerFluid(fluidCryotheum, "cryotheum");
+ } else {
+ Logger.INFO("Registering Gelid Cryotheum as it is an already existing Fluid.");
+ fluidCryotheum = cryotheum;
+ }
- if (pyrotheum == null){
- Logger.INFO("Registering Blazing Pyrotheum as it does not exist.");
- fluidPyrotheum = new Fluid("pyrotheum").setLuminosity(15).setDensity(2000).setViscosity(1200).setTemperature(4000).setRarity(EnumRarity.rare);
- registerFluid(fluidPyrotheum, "pyrotheum");
- }
- else {
- Logger.INFO("Registering Blazing Pyrotheum as it is an already existing Fluid.");
- fluidPyrotheum = pyrotheum;
- }
- if (cryotheum == null){
- Logger.INFO("Registering Gelid Cryotheum as it does not exist.");
- fluidCryotheum = new Fluid("cryotheum").setLuminosity(0).setDensity(4000).setViscosity(3000).setTemperature(50).setRarity(EnumRarity.rare);
- registerFluid(fluidCryotheum, "cryotheum");
- }
- else {
- Logger.INFO("Registering Gelid Cryotheum as it is an already existing Fluid.");
- fluidCryotheum = cryotheum;
- }
-
- if (ender == null){
- Logger.INFO("Registering Resonant Ender as it does not exist.");
- fluidEnder = new Fluid("ender").setLuminosity(3).setDensity(4000).setViscosity(3000).setTemperature(300).setRarity(EnumRarity.uncommon);
- registerFluid(fluidEnder, "ender");
- }
- else {
- Logger.INFO("Registering Resonant Ender as it is an already existing Fluid.");
- fluidEnder = ender;
- }
- }
- else {
- Logger.INFO("Thermal Foundation is already loaded, no need to add our own Cryotheum/Pyrotheum.");
- }
- }
+ if (ender == null) {
+ Logger.INFO("Registering Resonant Ender as it does not exist.");
+ fluidEnder = new Fluid("ender")
+ .setLuminosity(3)
+ .setDensity(4000)
+ .setViscosity(3000)
+ .setTemperature(300)
+ .setRarity(EnumRarity.uncommon);
+ registerFluid(fluidEnder, "ender");
+ } else {
+ Logger.INFO("Registering Resonant Ender as it is an already existing Fluid.");
+ fluidEnder = ender;
+ }
+ } else {
+ Logger.INFO("Thermal Foundation is already loaded, no need to add our own Cryotheum/Pyrotheum.");
+ }
+ }
- public static void init() {}
+ public static void init() {}
- public static void postInit() {}
+ public static void postInit() {}
- public static void registerFluid(final Fluid paramFluid, final String paramString)
- {
- if (!FluidRegistry.isFluidRegistered(paramString)) {
- FluidRegistry.registerFluid(paramFluid);
- }
- }
+ public static void registerFluid(final Fluid paramFluid, final String paramString) {
+ if (!FluidRegistry.isFluidRegistered(paramString)) {
+ FluidRegistry.registerFluid(paramFluid);
+ }
+ }
- public static void registerDispenserHandlers()
- {
- BlockDispenser.dispenseBehaviorRegistry.putObject(TF_Items.itemBucket, new DispenserFilledBucketHandler());
- BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new DispenserEmptyBucketHandler());
- }
+ public static void registerDispenserHandlers() {
+ BlockDispenser.dispenseBehaviorRegistry.putObject(TF_Items.itemBucket, new DispenserFilledBucketHandler());
+ BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new DispenserEmptyBucketHandler());
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java
index a628b9c5b6..2ed0f07f36 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.thermalfoundation.item;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-
-import gregtech.api.enums.GT_Values;
-
import cofh.core.item.ItemBase;
import cofh.core.item.ItemBucket;
import cofh.core.util.energy.FurnaceFuelHandler;
@@ -16,73 +11,79 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.thermalfoundation.block.TF_Blocks;
import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidContainerRegistry;
public class TF_Items {
- public static ItemBase itemMaterial;
- public static ItemStack rodBlizz;
- public static ItemStack dustBlizz;
- public static ItemStack dustPyrotheum;
- public static ItemStack dustCryotheum;
- public static ItemBucket itemBucket;
- public static ItemStack bucketPyrotheum;
- public static ItemStack bucketCryotheum;
- public static ItemStack bucketEnder;
-
- public static ItemStack itemDustBlizz;
- public static ItemStack itemDustPyrotheum;
- public static ItemStack itemDustCryotheum;
- public static ItemStack itemRodBlizz;
-
- public static void preInit(){
-
-
- itemBucket = (ItemBucket)new ItemBucket("MiscUtils").setUnlocalizedName("bucket").setCreativeTab(AddToCreativeTab.tabMisc);
- itemMaterial = (ItemBase)new ItemBase("MiscUtils").setUnlocalizedName("material").setCreativeTab(AddToCreativeTab.tabMisc);
-
-
- bucketPyrotheum = itemBucket.addOreDictItem(1, "bucketPyrotheum");
- bucketCryotheum = itemBucket.addOreDictItem(2, "bucketCryotheum");
- bucketEnder = itemBucket.addOreDictItem(3, "bucketEnder", 1);
- rodBlizz = itemMaterial.addOreDictItem(1, "rodBlizz");
- dustBlizz = itemMaterial.addOreDictItem(2, "dustBlizz");
- dustPyrotheum = itemMaterial.addOreDictItem(3, "dustPyrotheum");
- dustCryotheum = itemMaterial.addOreDictItem(4, "dustCryotheum");
-
- if (ReflectionUtils.doesClassExist("cofh.core.util.energy.FurnaceFuelHandler")){
- FurnaceFuelHandler.registerFuel(dustPyrotheum, 2400); //cofh.core.util.energy.FurnaceFuelHandler.registerFuel(ItemStack, int)
- }
-
- ItemUtils.addItemToOreDictionary(rodBlizz, "stickBlizz");
-
- itemRodBlizz = ItemUtils.simpleMetaStack(itemMaterial, 1, 1);
- itemDustBlizz = ItemUtils.simpleMetaStack(itemMaterial, 2, 1);
- itemDustPyrotheum = ItemUtils.simpleMetaStack(itemMaterial, 3, 1);
- itemDustCryotheum = ItemUtils.simpleMetaStack(itemMaterial, 4, 1);
-
-
-
- }
-
- public static void init(){
-
- BucketHandler.registerBucket(TF_Blocks.blockFluidPyrotheum, 0, bucketPyrotheum);
- BucketHandler.registerBucket(TF_Blocks.blockFluidCryotheum, 0, bucketCryotheum);
- BucketHandler.registerBucket(TF_Blocks.blockFluidEnder, 0, bucketEnder);
- FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidPyrotheum, bucketPyrotheum, FluidContainerRegistry.EMPTY_BUCKET);
- FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidCryotheum, bucketCryotheum, FluidContainerRegistry.EMPTY_BUCKET);
- FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidEnder, bucketEnder, FluidContainerRegistry.EMPTY_BUCKET);
-
-
- }
-
- public static void postInit(){
- if (!CORE.GTNH) {
- ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustPyrotheum, 1), new Object[] { "dustCoal", "dustSulfur", "dustRedstone", "dustBlaze" }));
- ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustCryotheum, 1), new Object[] { Items.snowball, "dustSaltpeter", "dustRedstone", "dustBlizz" }));
- ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustCryotheum, 1), new Object[] { Items.snowball, "dustNitor", "dustRedstone", "dustBlizz" }));
- }
- }
-
+ public static ItemBase itemMaterial;
+ public static ItemStack rodBlizz;
+ public static ItemStack dustBlizz;
+ public static ItemStack dustPyrotheum;
+ public static ItemStack dustCryotheum;
+ public static ItemBucket itemBucket;
+ public static ItemStack bucketPyrotheum;
+ public static ItemStack bucketCryotheum;
+ public static ItemStack bucketEnder;
+
+ public static ItemStack itemDustBlizz;
+ public static ItemStack itemDustPyrotheum;
+ public static ItemStack itemDustCryotheum;
+ public static ItemStack itemRodBlizz;
+
+ public static void preInit() {
+
+ itemBucket = (ItemBucket)
+ new ItemBucket("MiscUtils").setUnlocalizedName("bucket").setCreativeTab(AddToCreativeTab.tabMisc);
+ itemMaterial = (ItemBase)
+ new ItemBase("MiscUtils").setUnlocalizedName("material").setCreativeTab(AddToCreativeTab.tabMisc);
+
+ bucketPyrotheum = itemBucket.addOreDictItem(1, "bucketPyrotheum");
+ bucketCryotheum = itemBucket.addOreDictItem(2, "bucketCryotheum");
+ bucketEnder = itemBucket.addOreDictItem(3, "bucketEnder", 1);
+ rodBlizz = itemMaterial.addOreDictItem(1, "rodBlizz");
+ dustBlizz = itemMaterial.addOreDictItem(2, "dustBlizz");
+ dustPyrotheum = itemMaterial.addOreDictItem(3, "dustPyrotheum");
+ dustCryotheum = itemMaterial.addOreDictItem(4, "dustCryotheum");
+
+ if (ReflectionUtils.doesClassExist("cofh.core.util.energy.FurnaceFuelHandler")) {
+ FurnaceFuelHandler.registerFuel(
+ dustPyrotheum, 2400); // cofh.core.util.energy.FurnaceFuelHandler.registerFuel(ItemStack, int)
+ }
+
+ ItemUtils.addItemToOreDictionary(rodBlizz, "stickBlizz");
+
+ itemRodBlizz = ItemUtils.simpleMetaStack(itemMaterial, 1, 1);
+ itemDustBlizz = ItemUtils.simpleMetaStack(itemMaterial, 2, 1);
+ itemDustPyrotheum = ItemUtils.simpleMetaStack(itemMaterial, 3, 1);
+ itemDustCryotheum = ItemUtils.simpleMetaStack(itemMaterial, 4, 1);
+ }
+
+ public static void init() {
+
+ BucketHandler.registerBucket(TF_Blocks.blockFluidPyrotheum, 0, bucketPyrotheum);
+ BucketHandler.registerBucket(TF_Blocks.blockFluidCryotheum, 0, bucketCryotheum);
+ BucketHandler.registerBucket(TF_Blocks.blockFluidEnder, 0, bucketEnder);
+ FluidContainerRegistry.registerFluidContainer(
+ TF_Fluids.fluidPyrotheum, bucketPyrotheum, FluidContainerRegistry.EMPTY_BUCKET);
+ FluidContainerRegistry.registerFluidContainer(
+ TF_Fluids.fluidCryotheum, bucketCryotheum, FluidContainerRegistry.EMPTY_BUCKET);
+ FluidContainerRegistry.registerFluidContainer(
+ TF_Fluids.fluidEnder, bucketEnder, FluidContainerRegistry.EMPTY_BUCKET);
+ }
+
+ public static void postInit() {
+ if (!CORE.GTNH) {
+ ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(
+ ItemHelper.cloneStack(dustPyrotheum, 1),
+ new Object[] {"dustCoal", "dustSulfur", "dustRedstone", "dustBlaze"}));
+ ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(
+ ItemHelper.cloneStack(dustCryotheum, 1),
+ new Object[] {Items.snowball, "dustSaltpeter", "dustRedstone", "dustBlizz"}));
+ ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(
+ ItemHelper.cloneStack(dustCryotheum, 1),
+ new Object[] {Items.snowball, "dustNitor", "dustRedstone", "dustBlizz"}));
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/main/java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
index 85485b5565..5391df38f1 100644
--- a/src/main/java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
+++ b/src/main/java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
@@ -1,101 +1,103 @@
package gtPlusPlus.xmod.thermalfoundation.recipe;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-
+import cofh.lib.util.helpers.ItemHelper;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
-
-import cofh.lib.util.helpers.ItemHelper;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.xmod.thermalfoundation.item.TF_Items;
-import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class TF_Gregtech_Recipes {
- public static void run(){
- start();
- }
+ public static void run() {
+ start();
+ }
+
+ private static void start() {
+ // Get Items to work with
+ final ItemStack dust_Cryotheum = ItemUtils.getItemStackOfAmountFromOreDict("dustCryotheum", 1);
+ final ItemStack dust_Pyrotheum = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Pyrotheum, 1L);
+ final ItemStack dust_Blizz = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 1);
+ final ItemStack dust_Blizz3 = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 3);
+ final ItemStack rod_Blizz = ItemUtils.getItemStackOfAmountFromOreDict("stickBlizz", 1);
- private static void start(){
- //Get Items to work with
- final ItemStack dust_Cryotheum = ItemUtils.getItemStackOfAmountFromOreDict("dustCryotheum", 1);
- final ItemStack dust_Pyrotheum = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Pyrotheum, 1L);
- final ItemStack dust_Blizz = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 1);
- final ItemStack dust_Blizz3 = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 3);
- final ItemStack rod_Blizz = ItemUtils.getItemStackOfAmountFromOreDict("stickBlizz", 1);
-
- final FluidStack moltenBlaze = getFluidStack("molten.blaze", 1440);
+ final FluidStack moltenBlaze = getFluidStack("molten.blaze", 1440);
- //Gelid Cryotheum
- GT_Values.RA.addChemicalBathRecipe((GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)), getFluidStack("cryotheum", 144), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null, 400, 30);
+ // Gelid Cryotheum
+ GT_Values.RA.addChemicalBathRecipe(
+ (GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)),
+ getFluidStack("cryotheum", 144),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L),
+ GT_Values.NI,
+ GT_Values.NI,
+ null,
+ 400,
+ 30);
- //Blizz Powder
- GT_Values.RA.addChemicalBathRecipe(new ItemStack(Items.snowball, 4), moltenBlaze, dust_Blizz, GT_Values.NI, GT_Values.NI, null, 400, 240);
+ // Blizz Powder
+ GT_Values.RA.addChemicalBathRecipe(
+ new ItemStack(Items.snowball, 4), moltenBlaze, dust_Blizz, GT_Values.NI, GT_Values.NI, null, 400, 240);
- //Blizz Rod
- GT_Values.RA.addVacuumFreezerRecipe(new ItemStack(Items.blaze_rod), rod_Blizz, (int) Math.max((Materials.Blaze.getMass()*4) * 3L, 1L));
- GT_ModHandler.addPulverisationRecipe(rod_Blizz, dust_Blizz3, new ItemStack(Items.snowball, 1), 50, false);
+ // Blizz Rod
+ GT_Values.RA.addVacuumFreezerRecipe(
+ new ItemStack(Items.blaze_rod), rod_Blizz, (int) Math.max((Materials.Blaze.getMass() * 4) * 3L, 1L));
+ GT_ModHandler.addPulverisationRecipe(rod_Blizz, dust_Blizz3, new ItemStack(Items.snowball, 1), 50, false);
- ItemStack dustCoal = ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 1);
- ItemStack dustSulfur = ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1);
- ItemStack dustRedstone = ItemUtils.getItemStackOfAmountFromOreDict("dustRedstone", 1);
- ItemStack dustBlaze = ItemUtils.getItemStackOfAmountFromOreDict("dustBlaze", 1);
- ItemStack dustSaltpeter = ItemUtils.getItemStackOfAmountFromOreDict("dustSaltpeter", 1);
- ItemStack dustSnow = ItemUtils.getItemStackOfAmountFromOreDict("dustSnow", 1);
- ItemStack dustBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 1);
- ItemStack dustNiter = ItemUtils.getItemStackOfAmountFromOreDict("dustNiter", 1);
-
- if (ItemUtils.checkForInvalidItems(new ItemStack[] {dustCoal, dustSulfur, dustRedstone, dustBlaze})) {
- GT_Values.RA.addMixerRecipe(
- dustCoal,
- dustSulfur,
- dustRedstone,
- dustBlaze, //Input
- null, //F in
- null, //F out
- ItemHelper.cloneStack(dust_Pyrotheum, 1), //Output
- 20*8,
- 120);
- }
+ ItemStack dustCoal = ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 1);
+ ItemStack dustSulfur = ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1);
+ ItemStack dustRedstone = ItemUtils.getItemStackOfAmountFromOreDict("dustRedstone", 1);
+ ItemStack dustBlaze = ItemUtils.getItemStackOfAmountFromOreDict("dustBlaze", 1);
+ ItemStack dustSaltpeter = ItemUtils.getItemStackOfAmountFromOreDict("dustSaltpeter", 1);
+ ItemStack dustSnow = ItemUtils.getItemStackOfAmountFromOreDict("dustSnow", 1);
+ ItemStack dustBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 1);
+ ItemStack dustNiter = ItemUtils.getItemStackOfAmountFromOreDict("dustNiter", 1);
- if (ItemUtils.checkForInvalidItems(new ItemStack[] {dustSaltpeter, dustSnow, dustRedstone, dustBlizz})) {
- GT_Values.RA.addMixerRecipe(
- dustSaltpeter,
- dustSnow,
- dustRedstone,
- dustBlizz, //Input
- null, //F in
- null, //F out
- ItemHelper.cloneStack(dust_Cryotheum, 1), //Output
- 20*8,
- 120);
- }
-
- if (ItemUtils.checkForInvalidItems(new ItemStack[] {dustNiter, dustSnow, dustRedstone, dustBlizz})) {
- GT_Values.RA.addMixerRecipe(
- dustNiter,
- dustSnow,
- dustRedstone,
- dustBlizz, //Input
- null, //F in
- null, //F out
- ItemHelper.cloneStack(dust_Cryotheum, 1), //Output
- 20*8,
- 120);
- }
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {dustCoal, dustSulfur, dustRedstone, dustBlaze})) {
+ GT_Values.RA.addMixerRecipe(
+ dustCoal,
+ dustSulfur,
+ dustRedstone,
+ dustBlaze, // Input
+ null, // F in
+ null, // F out
+ ItemHelper.cloneStack(dust_Pyrotheum, 1), // Output
+ 20 * 8,
+ 120);
+ }
- }
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {dustSaltpeter, dustSnow, dustRedstone, dustBlizz})) {
+ GT_Values.RA.addMixerRecipe(
+ dustSaltpeter,
+ dustSnow,
+ dustRedstone,
+ dustBlizz, // Input
+ null, // F in
+ null, // F out
+ ItemHelper.cloneStack(dust_Cryotheum, 1), // Output
+ 20 * 8,
+ 120);
+ }
- private static FluidStack getFluidStack(final String fluidName, final int amount){
- return FluidUtils.getFluidStack(fluidName, amount);
- }
+ if (ItemUtils.checkForInvalidItems(new ItemStack[] {dustNiter, dustSnow, dustRedstone, dustBlizz})) {
+ GT_Values.RA.addMixerRecipe(
+ dustNiter,
+ dustSnow,
+ dustRedstone,
+ dustBlizz, // Input
+ null, // F in
+ null, // F out
+ ItemHelper.cloneStack(dust_Cryotheum, 1), // Output
+ 20 * 8,
+ 120);
+ }
+ }
+ private static FluidStack getFluidStack(final String fluidName, final int amount) {
+ return FluidUtils.getFluidStack(fluidName, amount);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java b/src/main/java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java
index 4a3f9cd504..25fa989551 100644
--- a/src/main/java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java
+++ b/src/main/java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.tinkers;
-import java.lang.reflect.Field;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.LoadedMods;
@@ -9,97 +7,94 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.tinkers.material.BaseTinkersMaterial;
import gtPlusPlus.xmod.tinkers.util.TinkersDryingRecipe;
import gtPlusPlus.xmod.tinkers.util.TinkersUtils;
+import java.lang.reflect.Field;
import net.minecraft.block.Block;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
public class HANDLER_Tinkers {
- public static AutoMap<BaseTinkersMaterial> mTinkerMaterials = new AutoMap<BaseTinkersMaterial>();
-
- public static final void preInit() {
- if (LoadedMods.TiCon) {
-
- }
- }
+ public static AutoMap<BaseTinkersMaterial> mTinkerMaterials = new AutoMap<BaseTinkersMaterial>();
- public static final void init() {
- if (LoadedMods.TiCon) {
+ public static final void preInit() {
+ if (LoadedMods.TiCon) {}
+ }
- }
- }
+ public static final void init() {
+ if (LoadedMods.TiCon) {}
+ }
- public static final void postInit() {
- if (LoadedMods.TiCon) {
+ public static final void postInit() {
+ if (LoadedMods.TiCon) {
- Fluid pyrotheumFluid = FluidRegistry.getFluid("pyrotheum");
- if (pyrotheumFluid != null) {
- //Enable Pyrotheum as Fuel for the Smeltery
- TinkersUtils.addSmelteryFuel(pyrotheumFluid, 5000, 70); // pyrotheum lasts 3.5 seconds per 15 mb
- }
+ Fluid pyrotheumFluid = FluidRegistry.getFluid("pyrotheum");
+ if (pyrotheumFluid != null) {
+ // Enable Pyrotheum as Fuel for the Smeltery
+ TinkersUtils.addSmelteryFuel(pyrotheumFluid, 5000, 70); // pyrotheum lasts 3.5 seconds per 15 mb
+ }
- //Generate Drying Rack recipes
- TinkersDryingRecipe.generateAllDryingRecipes();
-
- for (BaseTinkersMaterial y : mTinkerMaterials) {
- //y.generate();
- }
+ // Generate Drying Rack recipes
+ TinkersDryingRecipe.generateAllDryingRecipes();
- Class aTinkersSmeltery = ReflectionUtils.getClass("tconstruct.smeltery.TinkerSmeltery");
- AutoMap<Fluid> aTweakedFluids = new AutoMap<Fluid>();
- if (aTinkersSmeltery != null) {
- try {
- Logger.INFO("Manipulating the light levels of fluids in TiCon. Molten 'metals' in world are now very luminescent!");
- Field aFluidArrayField = ReflectionUtils.getField(aTinkersSmeltery, "fluids");
- Field aBlockArrayField = ReflectionUtils.getField(aTinkersSmeltery, "fluidBlocks");
- Fluid[] aTiconFluids = (Fluid[]) aFluidArrayField.get(null);
- Block[] aTiconFluidBlocks = (Block[]) aBlockArrayField.get(null);
- if (aTiconFluids != null && aTiconFluidBlocks != null) {
- for (Fluid a : aTiconFluids) {
- if (a == null) {
- continue;
- } else {
- if (a.getLuminosity() <= 15) {
- //if (a.getTemperature() >= 500) {
- a.setLuminosity(16);
- aTweakedFluids.put(a);
- //}
- } else {
- aTweakedFluids.put(a);
- continue;
- }
- }
- }
- for (Block a : aTiconFluidBlocks) {
- if (a == null) {
- continue;
- } else {
- Fluid f = FluidRegistry.lookupFluidForBlock(a);
- boolean isHot = false;
- if (f != null && f.getTemperature() >= 500) {
- if (f.getLuminosity() <= 16 && !aTweakedFluids.containsValue(f)) {
- f.setLuminosity(16);
- }
- isHot = true;
- }
- if (a.getLightValue() <= 16f) {
- if (isHot) {
- a.setLightLevel(16f);
- } else {
- if (a.getLightValue() <= 16f) {
- a.setLightLevel(16f);
- }
- }
- } else {
- continue;
- }
- }
- }
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- }
- }
+ for (BaseTinkersMaterial y : mTinkerMaterials) {
+ // y.generate();
+ }
+ Class aTinkersSmeltery = ReflectionUtils.getClass("tconstruct.smeltery.TinkerSmeltery");
+ AutoMap<Fluid> aTweakedFluids = new AutoMap<Fluid>();
+ if (aTinkersSmeltery != null) {
+ try {
+ Logger.INFO(
+ "Manipulating the light levels of fluids in TiCon. Molten 'metals' in world are now very luminescent!");
+ Field aFluidArrayField = ReflectionUtils.getField(aTinkersSmeltery, "fluids");
+ Field aBlockArrayField = ReflectionUtils.getField(aTinkersSmeltery, "fluidBlocks");
+ Fluid[] aTiconFluids = (Fluid[]) aFluidArrayField.get(null);
+ Block[] aTiconFluidBlocks = (Block[]) aBlockArrayField.get(null);
+ if (aTiconFluids != null && aTiconFluidBlocks != null) {
+ for (Fluid a : aTiconFluids) {
+ if (a == null) {
+ continue;
+ } else {
+ if (a.getLuminosity() <= 15) {
+ // if (a.getTemperature() >= 500) {
+ a.setLuminosity(16);
+ aTweakedFluids.put(a);
+ // }
+ } else {
+ aTweakedFluids.put(a);
+ continue;
+ }
+ }
+ }
+ for (Block a : aTiconFluidBlocks) {
+ if (a == null) {
+ continue;
+ } else {
+ Fluid f = FluidRegistry.lookupFluidForBlock(a);
+ boolean isHot = false;
+ if (f != null && f.getTemperature() >= 500) {
+ if (f.getLuminosity() <= 16 && !aTweakedFluids.containsValue(f)) {
+ f.setLuminosity(16);
+ }
+ isHot = true;
+ }
+ if (a.getLightValue() <= 16f) {
+ if (isHot) {
+ a.setLightLevel(16f);
+ } else {
+ if (a.getLightValue() <= 16f) {
+ a.setLightLevel(16f);
+ }
+ }
+ } else {
+ continue;
+ }
+ }
+ }
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java b/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java
index 0d2c79db08..6aa2fe8931 100644
--- a/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java
+++ b/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java
@@ -2,14 +2,13 @@ package gtPlusPlus.xmod.tinkers.material;
import static gtPlusPlus.core.util.math.MathUtils.safeCast_LongToInt;
-import java.util.HashMap;
-
import cpw.mods.fml.common.event.FMLInterModComms;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.tinkers.HANDLER_Tinkers;
import gtPlusPlus.xmod.tinkers.util.TinkersUtils;
+import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -17,258 +16,220 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.Fluid;
public class BaseTinkersMaterial {
-
-
-
- private static HashMap<String, Integer> aInternalMaterialIdMap = new HashMap<String, Integer>();
- private static int aNextFreeID;
-
- public final String mLocalName;
-
- private final String mUnlocalName;
- private final int mID;
- private final Material mMaterial;
-
- static {
- aNextFreeID = (Short.MAX_VALUE/2)+420;
- }
-
- public BaseTinkersMaterial(Material aMaterial) {
- mLocalName = aMaterial.getLocalizedName();
- mUnlocalName = "material.gtpp."+Utils.sanitizeString(mLocalName);
- mMaterial = aMaterial;
- mID = aNextFreeID++;
- Logger.INFO("[TiCon] Assigning ID "+mID+" to "+mLocalName+".");
- aInternalMaterialIdMap.put(mUnlocalName, mID);
- HANDLER_Tinkers.mTinkerMaterials.put(this);
- }
-
- public String getUnlocalName() {
- return mUnlocalName;
- }
-
- private static int calcDurability(Material aMaterial) {
- return safeCast_LongToInt(aMaterial.vDurability);
- }
-
- private static int calcMiningSpeed(Material aMaterial) {
- return (aMaterial.vHarvestLevel * 2)+aMaterial.vTier;
- }
-
- private static int calcHarvestLevel(Material aMaterial) {
- return aMaterial.vHarvestLevel;
- }
-
- private static int calcAttack(Material aMaterial) {
- return aMaterial.vHarvestLevel+aMaterial.vTier+aMaterial.vRadiationLevel;
- }
-
- private static float calcHandleModifier(Material aMaterial) {
- return 1f;
- }
-
- private static int calcReinforced(Material aMaterial) {
- return aMaterial.getMeltingPointC()/3600;
- }
-
- private static int calcBowProjectileSpeed(Material aMaterial) {
- return aMaterial.vHarvestLevel+2;
- }
-
- private static int calcBowDrawSpeed(Material aMaterial) {
- return aMaterial.vHarvestLevel+8;
- }
-
- private static float calcProjectileMass(Material aMaterial) {
- return (aMaterial.getMeltingPointC()/1800)*0.1f;
- }
-
- private static float calcProjectileFragility(Material aMaterial) {
- return 0f;
- }
-
- private static String calcStyle(Material aMaterial) {
- String aReturn = "" + EnumChatFormatting.WHITE;
- int aTemp = aMaterial.getMeltingPointC();
- if (aTemp < 3600) {
- aReturn = "" + EnumChatFormatting.WHITE;
- }
- else if (aTemp >= 3600) {
- aReturn = "" + EnumChatFormatting.YELLOW;
- }
- else if (aTemp >= (3600*2)) {
- aReturn = "" + EnumChatFormatting.GREEN;
- }
- else if (aTemp >= (3600*3)) {
- aReturn = "" + EnumChatFormatting.RED;
- }
- else if (aTemp >= (3600*4)) {
- aReturn = "" + EnumChatFormatting.DARK_RED;
- }
- else {
- aReturn = "" + EnumChatFormatting.GOLD;
- }
- return aReturn;
- }
-
- private static int calcColour(Material aMaterial) {
- return aMaterial.getRgbAsHex();
- }
-
- public Object generateToolMaterial(Material aMaterial) {
- int level, dura, speed, dmg, reinf, primColour;
- float handle, stonebound;
- level = calcHarvestLevel(aMaterial);
- dura = calcDurability(aMaterial);
- speed = calcMiningSpeed(aMaterial);
- dmg = calcAttack(aMaterial);
- reinf = calcReinforced(aMaterial);
- primColour = calcColour(aMaterial);
- handle = calcHandleModifier(aMaterial);
- //stonebound = calcHarvestLevel(aMaterial);
- stonebound = 0;
- return TinkersUtils.generateToolMaterial(aMaterial.getLocalizedName(), aMaterial.getUnlocalizedName(), level, dura, speed, dmg, handle, reinf, stonebound, calcStyle(aMaterial), primColour);
- }
-
- public void generate() {
-
- Logger.INFO("[TiCon] Trying to generate Material: "+mLocalName);
- int id = mID;
- if (id > 0) {
-
- //Object aTinkersCustomMaterial = generateToolMaterial(mMaterial);
- //Logger.INFO("[TiCon] Created Material: "+mLocalName);
-
- //TinkersUtils.addToolMaterial(id, aTinkersCustomMaterial);
- //TinkersUtils.addDefaultToolPartMaterial(id);
- //TinkersUtils.addBowMaterial(id, calcBowDrawSpeed(mMaterial), 1.0F);
- //TinkersUtils.addArrowMaterial(id, calcProjectileMass(mMaterial), calcProjectileFragility(mMaterial));
-
- NBTTagCompound tag = new NBTTagCompound();
- tag.setInteger("Id", id);
- tag.setString("Name", mUnlocalName);
- tag.setString("localizationString", mLocalName);
- tag.setInteger("Durability", calcDurability(mMaterial)); // 97
- tag.setInteger("MiningSpeed", calcMiningSpeed(mMaterial)); // 150
- tag.setInteger("HarvestLevel", calcHarvestLevel(mMaterial)); // 1
- tag.setInteger("Attack", calcAttack(mMaterial)); // 0
- tag.setFloat("HandleModifier", calcHandleModifier(mMaterial)); // 1.0f
- tag.setInteger("Reinforced", calcReinforced(mMaterial)); // 0
- tag.setFloat("Bow_ProjectileSpeed", calcBowProjectileSpeed(mMaterial)); // 3.0f
- tag.setInteger("Bow_DrawSpeed", calcBowDrawSpeed(mMaterial)); // 18
- tag.setFloat("Projectile_Mass", calcProjectileMass(mMaterial)); // 0.69f
- tag.setFloat("Projectile_Fragility", calcProjectileFragility(mMaterial)); // 0.2f
- tag.setString("Style", calcStyle(mMaterial));
- tag.setInteger("Color", calcColour(mMaterial));
-
-
- boolean generate = generateRecipes(mMaterial, id);
-
- if (generate) {
- Logger.INFO("[TiCon] Sending IMC: addMaterial - "+mLocalName+".");
- FMLInterModComms.sendMessage("TConstruct", "addMaterial", tag);
-
- ItemStack itemstack = mMaterial.getIngot(1);
- tag = new NBTTagCompound();
- tag.setInteger("MaterialId", id);
- NBTTagCompound item = new NBTTagCompound();
- itemstack.writeToNBT(item);
- tag.setTag("Item", item);
- tag.setInteger("Value", 2); // What is value for?
-
- Logger.INFO("[TiCon] Sending IMC: addPartBuilderMaterial - "+mLocalName+".");
- FMLInterModComms.sendMessage("TConstruct", "addPartBuilderMaterial", tag);
-
- tag = new NBTTagCompound();
- tag.setInteger("MaterialId", id);
- tag.setInteger("Value", 2); // What is value for?
- item = new NBTTagCompound();
- itemstack.writeToNBT(item);
- tag.setTag("Item", item);
-
- Logger.INFO("[TiCon] Sending IMC: addMaterialItem - "+mLocalName+".");
- FMLInterModComms.sendMessage("TConstruct", "addMaterialItem", tag);
- }
-
-
- }
-
- }
-
- private boolean generateRecipes(Material aMaterial, int aID) {
-
- Block aMatBlock;
- Integer aMelt;
- Fluid aFluid;
-
- try {
- aMatBlock = aMaterial.getBlock();
- aMelt = aMaterial.getMeltingPointC();
- aFluid = aMaterial.getFluidStack(0).getFluid();
- }
- catch (Throwable t) {
- return false;
- }
-
- if (aMatBlock == null || aMelt == null || aFluid == null) {
- return false;
- }
-
-
- //Smeltery.addMelting(new ItemStack(ExtraUtils.unstableIngot, 1, 0), ExtraUtils.decorative1, 5, 850, aMaterial.getFluid(72));
- TinkersUtils.registerFluidType(mLocalName, aMatBlock, 0, aMelt, aFluid, true);
- TinkersUtils.addMelting(aMaterial.getBlock(1), aMatBlock, 0, aMelt, aMaterial.getFluidStack(144*9));
- TinkersUtils.addMelting(aMaterial.getIngot(1), aMatBlock, 0, aMelt, aMaterial.getFluidStack(144));
- if (aMelt <= 3600) {
- ItemStack ingotcast = TinkersUtils.getPattern(1);
- TinkersUtils.addBasinRecipe(aMaterial.getBlock(1),
- aMaterial.getFluidStack(144*9), (ItemStack) null, true, 100);
- TinkersUtils.addCastingTableRecipe(aMaterial.getIngot(1),
- aMaterial.getFluidStack(144), ingotcast, false, 50);
- }
-
- boolean extended = TinkersUtils.generateCastingRecipes(aMaterial, aID);
-
-
-
-
-
-
- //TConstructRegistry.getBasinCasting().addCastingRecipe(new ItemStack(ExtraUtils.decorative1, 1, 5), new FluidStack(unstable, 1296), (ItemStack)null, true, 100);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return true;
- }
-
-
-
-
-
-
-
+
+ private static HashMap<String, Integer> aInternalMaterialIdMap = new HashMap<String, Integer>();
+ private static int aNextFreeID;
+
+ public final String mLocalName;
+
+ private final String mUnlocalName;
+ private final int mID;
+ private final Material mMaterial;
+
+ static {
+ aNextFreeID = (Short.MAX_VALUE / 2) + 420;
+ }
+
+ public BaseTinkersMaterial(Material aMaterial) {
+ mLocalName = aMaterial.getLocalizedName();
+ mUnlocalName = "material.gtpp." + Utils.sanitizeString(mLocalName);
+ mMaterial = aMaterial;
+ mID = aNextFreeID++;
+ Logger.INFO("[TiCon] Assigning ID " + mID + " to " + mLocalName + ".");
+ aInternalMaterialIdMap.put(mUnlocalName, mID);
+ HANDLER_Tinkers.mTinkerMaterials.put(this);
+ }
+
+ public String getUnlocalName() {
+ return mUnlocalName;
+ }
+
+ private static int calcDurability(Material aMaterial) {
+ return safeCast_LongToInt(aMaterial.vDurability);
+ }
+
+ private static int calcMiningSpeed(Material aMaterial) {
+ return (aMaterial.vHarvestLevel * 2) + aMaterial.vTier;
+ }
+
+ private static int calcHarvestLevel(Material aMaterial) {
+ return aMaterial.vHarvestLevel;
+ }
+
+ private static int calcAttack(Material aMaterial) {
+ return aMaterial.vHarvestLevel + aMaterial.vTier + aMaterial.vRadiationLevel;
+ }
+
+ private static float calcHandleModifier(Material aMaterial) {
+ return 1f;
+ }
+
+ private static int calcReinforced(Material aMaterial) {
+ return aMaterial.getMeltingPointC() / 3600;
+ }
+
+ private static int calcBowProjectileSpeed(Material aMaterial) {
+ return aMaterial.vHarvestLevel + 2;
+ }
+
+ private static int calcBowDrawSpeed(Material aMaterial) {
+ return aMaterial.vHarvestLevel + 8;
+ }
+
+ private static float calcProjectileMass(Material aMaterial) {
+ return (aMaterial.getMeltingPointC() / 1800) * 0.1f;
+ }
+
+ private static float calcProjectileFragility(Material aMaterial) {
+ return 0f;
+ }
+
+ private static String calcStyle(Material aMaterial) {
+ String aReturn = "" + EnumChatFormatting.WHITE;
+ int aTemp = aMaterial.getMeltingPointC();
+ if (aTemp < 3600) {
+ aReturn = "" + EnumChatFormatting.WHITE;
+ } else if (aTemp >= 3600) {
+ aReturn = "" + EnumChatFormatting.YELLOW;
+ } else if (aTemp >= (3600 * 2)) {
+ aReturn = "" + EnumChatFormatting.GREEN;
+ } else if (aTemp >= (3600 * 3)) {
+ aReturn = "" + EnumChatFormatting.RED;
+ } else if (aTemp >= (3600 * 4)) {
+ aReturn = "" + EnumChatFormatting.DARK_RED;
+ } else {
+ aReturn = "" + EnumChatFormatting.GOLD;
+ }
+ return aReturn;
+ }
+
+ private static int calcColour(Material aMaterial) {
+ return aMaterial.getRgbAsHex();
+ }
+
+ public Object generateToolMaterial(Material aMaterial) {
+ int level, dura, speed, dmg, reinf, primColour;
+ float handle, stonebound;
+ level = calcHarvestLevel(aMaterial);
+ dura = calcDurability(aMaterial);
+ speed = calcMiningSpeed(aMaterial);
+ dmg = calcAttack(aMaterial);
+ reinf = calcReinforced(aMaterial);
+ primColour = calcColour(aMaterial);
+ handle = calcHandleModifier(aMaterial);
+ // stonebound = calcHarvestLevel(aMaterial);
+ stonebound = 0;
+ return TinkersUtils.generateToolMaterial(
+ aMaterial.getLocalizedName(),
+ aMaterial.getUnlocalizedName(),
+ level,
+ dura,
+ speed,
+ dmg,
+ handle,
+ reinf,
+ stonebound,
+ calcStyle(aMaterial),
+ primColour);
+ }
+
+ public void generate() {
+
+ Logger.INFO("[TiCon] Trying to generate Material: " + mLocalName);
+ int id = mID;
+ if (id > 0) {
+
+ // Object aTinkersCustomMaterial = generateToolMaterial(mMaterial);
+ // Logger.INFO("[TiCon] Created Material: "+mLocalName);
+
+ // TinkersUtils.addToolMaterial(id, aTinkersCustomMaterial);
+ // TinkersUtils.addDefaultToolPartMaterial(id);
+ // TinkersUtils.addBowMaterial(id, calcBowDrawSpeed(mMaterial), 1.0F);
+ // TinkersUtils.addArrowMaterial(id, calcProjectileMass(mMaterial), calcProjectileFragility(mMaterial));
+
+ NBTTagCompound tag = new NBTTagCompound();
+ tag.setInteger("Id", id);
+ tag.setString("Name", mUnlocalName);
+ tag.setString("localizationString", mLocalName);
+ tag.setInteger("Durability", calcDurability(mMaterial)); // 97
+ tag.setInteger("MiningSpeed", calcMiningSpeed(mMaterial)); // 150
+ tag.setInteger("HarvestLevel", calcHarvestLevel(mMaterial)); // 1
+ tag.setInteger("Attack", calcAttack(mMaterial)); // 0
+ tag.setFloat("HandleModifier", calcHandleModifier(mMaterial)); // 1.0f
+ tag.setInteger("Reinforced", calcReinforced(mMaterial)); // 0
+ tag.setFloat("Bow_ProjectileSpeed", calcBowProjectileSpeed(mMaterial)); // 3.0f
+ tag.setInteger("Bow_DrawSpeed", calcBowDrawSpeed(mMaterial)); // 18
+ tag.setFloat("Projectile_Mass", calcProjectileMass(mMaterial)); // 0.69f
+ tag.setFloat("Projectile_Fragility", calcProjectileFragility(mMaterial)); // 0.2f
+ tag.setString("Style", calcStyle(mMaterial));
+ tag.setInteger("Color", calcColour(mMaterial));
+
+ boolean generate = generateRecipes(mMaterial, id);
+
+ if (generate) {
+ Logger.INFO("[TiCon] Sending IMC: addMaterial - " + mLocalName + ".");
+ FMLInterModComms.sendMessage("TConstruct", "addMaterial", tag);
+
+ ItemStack itemstack = mMaterial.getIngot(1);
+ tag = new NBTTagCompound();
+ tag.setInteger("MaterialId", id);
+ NBTTagCompound item = new NBTTagCompound();
+ itemstack.writeToNBT(item);
+ tag.setTag("Item", item);
+ tag.setInteger("Value", 2); // What is value for?
+
+ Logger.INFO("[TiCon] Sending IMC: addPartBuilderMaterial - " + mLocalName + ".");
+ FMLInterModComms.sendMessage("TConstruct", "addPartBuilderMaterial", tag);
+
+ tag = new NBTTagCompound();
+ tag.setInteger("MaterialId", id);
+ tag.setInteger("Value", 2); // What is value for?
+ item = new NBTTagCompound();
+ itemstack.writeToNBT(item);
+ tag.setTag("Item", item);
+
+ Logger.INFO("[TiCon] Sending IMC: addMaterialItem - " + mLocalName + ".");
+ FMLInterModComms.sendMessage("TConstruct", "addMaterialItem", tag);
+ }
+ }
+ }
+
+ private boolean generateRecipes(Material aMaterial, int aID) {
+
+ Block aMatBlock;
+ Integer aMelt;
+ Fluid aFluid;
+
+ try {
+ aMatBlock = aMaterial.getBlock();
+ aMelt = aMaterial.getMeltingPointC();
+ aFluid = aMaterial.getFluidStack(0).getFluid();
+ } catch (Throwable t) {
+ return false;
+ }
+
+ if (aMatBlock == null || aMelt == null || aFluid == null) {
+ return false;
+ }
+
+ // Smeltery.addMelting(new ItemStack(ExtraUtils.unstableIngot, 1, 0), ExtraUtils.decorative1, 5, 850,
+ // aMaterial.getFluid(72));
+ TinkersUtils.registerFluidType(mLocalName, aMatBlock, 0, aMelt, aFluid, true);
+ TinkersUtils.addMelting(aMaterial.getBlock(1), aMatBlock, 0, aMelt, aMaterial.getFluidStack(144 * 9));
+ TinkersUtils.addMelting(aMaterial.getIngot(1), aMatBlock, 0, aMelt, aMaterial.getFluidStack(144));
+ if (aMelt <= 3600) {
+ ItemStack ingotcast = TinkersUtils.getPattern(1);
+ TinkersUtils.addBasinRecipe(
+ aMaterial.getBlock(1), aMaterial.getFluidStack(144 * 9), (ItemStack) null, true, 100);
+ TinkersUtils.addCastingTableRecipe(
+ aMaterial.getIngot(1), aMaterial.getFluidStack(144), ingotcast, false, 50);
+ }
+
+ boolean extended = TinkersUtils.generateCastingRecipes(aMaterial, aID);
+
+ // TConstructRegistry.getBasinCasting().addCastingRecipe(new ItemStack(ExtraUtils.decorative1, 1, 5), new
+ // FluidStack(unstable, 1296), (ItemStack)null, true, 100);
+
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java b/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java
index 8bc7ffef29..301302033e 100644
--- a/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java
+++ b/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java
@@ -1,9 +1,5 @@
package gtPlusPlus.xmod.tinkers.util;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-
import gregtech.api.enums.GT_Values;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -11,110 +7,113 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class TinkersDryingRecipe {
-
+
public static AutoMap<TinkersDryingRecipe> recipes = new AutoMap<TinkersDryingRecipe>();
- public final int time;
- public final ItemStack input;
- public final ItemStack result;
-
- public static void generateAllDryingRecipes() {
- List<?> aRecipes = TinkersUtils.getDryingRecipes();
- if (aRecipes != null && aRecipes.size() > 0) {
- for (Object o : aRecipes) {
- Logger.INFO("Trying to generate recipe using object of type "+o.getClass().getSimpleName());
- generateFromTinkersRecipeObject(o);
- }
- }
- else {
- Logger.INFO("Error generating Drying recipes, map was either null or empty. Null? "+(aRecipes != null)+", Size: "+aRecipes.size());
- }
- if (!recipes.isEmpty()) {
- Logger.INFO("Adding "+recipes.size()+" drying rack recipes to the dehydrator.");
- for (TinkersDryingRecipe r : recipes) {
- CORE.RA.addDehydratorRecipe(
- new ItemStack[] {
- CI.getNumberedCircuit(16),
- r.input
- },
- GT_Values.NF,
- GT_Values.NF,
- new ItemStack[] {r.result},
- new int[] {},
- r.time/10,
- 30);
- }
- }
- }
+ public final int time;
+ public final ItemStack input;
+ public final ItemStack result;
+
+ public static void generateAllDryingRecipes() {
+ List<?> aRecipes = TinkersUtils.getDryingRecipes();
+ if (aRecipes != null && aRecipes.size() > 0) {
+ for (Object o : aRecipes) {
+ Logger.INFO("Trying to generate recipe using object of type "
+ + o.getClass().getSimpleName());
+ generateFromTinkersRecipeObject(o);
+ }
+ } else {
+ Logger.INFO("Error generating Drying recipes, map was either null or empty. Null? " + (aRecipes != null)
+ + ", Size: " + aRecipes.size());
+ }
+ if (!recipes.isEmpty()) {
+ Logger.INFO("Adding " + recipes.size() + " drying rack recipes to the dehydrator.");
+ for (TinkersDryingRecipe r : recipes) {
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {CI.getNumberedCircuit(16), r.input},
+ GT_Values.NF,
+ GT_Values.NF,
+ new ItemStack[] {r.result},
+ new int[] {},
+ r.time / 10,
+ 30);
+ }
+ }
+ }
- public static TinkersDryingRecipe generateFromTinkersRecipeObject(Object o) {
- Field aTime;
- Field aInput;
- Field aOutput;
- Class aTinkerClass = ReflectionUtils.getClass("tconstruct.library.crafting.DryingRackRecipes.DryingRecipe");//o.getClass();
- if (aTinkerClass == null || !LoadedMods.TiCon) {
- Logger.INFO("Error generating Drying Recipe, could not find class. Exists? "+ReflectionUtils.doesClassExist("tconstruct.library.crafting.DryingRackRecipes.DryingRecipe"));
- Class clazz = ReflectionUtils.getClass("tconstruct.library.crafting.DryingRackRecipes");
- Class[] y = clazz.getDeclaredClasses();
- if (y == null || y.length <= 0) {
- Logger.INFO("No hidden inner classes.");
- return null;
- }
- else {
- boolean found = false;
- for (Class h : y) {
- Logger.INFO("Found hidden inner class: "+h.getCanonicalName());
- if (h.getSimpleName().toLowerCase().equals("dryingrecipe")) {
- Logger.INFO("Found correct recipe. Caching at correct location.");
- ReflectionUtils.mCachedClasses.put("tconstruct.library.crafting.DryingRackRecipes.DryingRecipe", h);
- aTinkerClass = h;
- found = true;
- break;
- }
- }
- if (!found) {
- return null;
- }
- }
- }
- aTime = ReflectionUtils.getField(aTinkerClass, "time");
- aInput = ReflectionUtils.getField(aTinkerClass, "input");
- aOutput = ReflectionUtils.getField(aTinkerClass, "result");
- try {
- int time_internal = aTime.getInt(o);
- ItemStack input_internal = (ItemStack) aInput.get(o);
- ItemStack result_internal = (ItemStack) aOutput.get(o);
- return new TinkersDryingRecipe(input_internal, time_internal, result_internal);
- } catch (Throwable b) {
- b.printStackTrace();
- }
- return null;
- }
+ public static TinkersDryingRecipe generateFromTinkersRecipeObject(Object o) {
+ Field aTime;
+ Field aInput;
+ Field aOutput;
+ Class aTinkerClass =
+ ReflectionUtils.getClass("tconstruct.library.crafting.DryingRackRecipes.DryingRecipe"); // o.getClass();
+ if (aTinkerClass == null || !LoadedMods.TiCon) {
+ Logger.INFO("Error generating Drying Recipe, could not find class. Exists? "
+ + ReflectionUtils.doesClassExist("tconstruct.library.crafting.DryingRackRecipes.DryingRecipe"));
+ Class clazz = ReflectionUtils.getClass("tconstruct.library.crafting.DryingRackRecipes");
+ Class[] y = clazz.getDeclaredClasses();
+ if (y == null || y.length <= 0) {
+ Logger.INFO("No hidden inner classes.");
+ return null;
+ } else {
+ boolean found = false;
+ for (Class h : y) {
+ Logger.INFO("Found hidden inner class: " + h.getCanonicalName());
+ if (h.getSimpleName().toLowerCase().equals("dryingrecipe")) {
+ Logger.INFO("Found correct recipe. Caching at correct location.");
+ ReflectionUtils.mCachedClasses.put(
+ "tconstruct.library.crafting.DryingRackRecipes.DryingRecipe", h);
+ aTinkerClass = h;
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ return null;
+ }
+ }
+ }
+ aTime = ReflectionUtils.getField(aTinkerClass, "time");
+ aInput = ReflectionUtils.getField(aTinkerClass, "input");
+ aOutput = ReflectionUtils.getField(aTinkerClass, "result");
+ try {
+ int time_internal = aTime.getInt(o);
+ ItemStack input_internal = (ItemStack) aInput.get(o);
+ ItemStack result_internal = (ItemStack) aOutput.get(o);
+ return new TinkersDryingRecipe(input_internal, time_internal, result_internal);
+ } catch (Throwable b) {
+ b.printStackTrace();
+ }
+ return null;
+ }
- public TinkersDryingRecipe(final ItemStack input, final int time, final ItemStack result) {
- this.time = time;
- this.input = input;
- this.result = result;
- Logger.INFO("Generating Drying Recipe. Input: "+input.getDisplayName()+", Output: "+result.getDisplayName());
- recipes.add(this);
- }
+ public TinkersDryingRecipe(final ItemStack input, final int time, final ItemStack result) {
+ this.time = time;
+ this.input = input;
+ this.result = result;
+ Logger.INFO(
+ "Generating Drying Recipe. Input: " + input.getDisplayName() + ", Output: " + result.getDisplayName());
+ recipes.add(this);
+ }
- public boolean matches(ItemStack input) {
- if (input.hasTagCompound()) {
- input = input.copy();
- input.getTagCompound().removeTag("frypanKill");
- if (input.getTagCompound().hasNoTags()) {
- input.setTagCompound((NBTTagCompound) null);
- }
- }
- return ItemStack.areItemStacksEqual(this.input, input);
- }
+ public boolean matches(ItemStack input) {
+ if (input.hasTagCompound()) {
+ input = input.copy();
+ input.getTagCompound().removeTag("frypanKill");
+ if (input.getTagCompound().hasNoTags()) {
+ input.setTagCompound((NBTTagCompound) null);
+ }
+ }
+ return ItemStack.areItemStacksEqual(this.input, input);
+ }
- public ItemStack getResult() {
- return this.result.copy();
- }
+ public ItemStack getResult() {
+ return this.result.copy();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java b/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java
index cf3284bfae..2446eea9f1 100644
--- a/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java
+++ b/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java
@@ -1,5 +1,12 @@
package gtPlusPlus.xmod.tinkers.util;
+import gregtech.api.enums.Materials;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@@ -10,14 +17,6 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
-
-import gregtech.api.enums.Materials;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -26,519 +25,565 @@ import net.minecraftforge.fluids.FluidStack;
public class TinkersUtils {
- private static final Class<?> mClass_Smeltery;
- private static final Class<?> mClass_TConstructRegistry;
- private static final Class<?> mClass_ToolMaterial;
- private static final Class<?> mClass_IPattern;
- private static final Class<?> mClass_DynamicToolPart;
- private static final Class<?> mClass_FluidType;
- private static final Class<?> mClass_CastingRecipe;
- private static final Class<?> mClass_TinkerSmeltery;
-
- private static final Field mField_MoltenIronFluid;
-
- private static final Method mMethod_getFluidType;
- private static final Method mMethod_getCastingRecipes;
-
- private static Object mSmelteryInstance;
- private static Object mTinkersRegistryInstance;
-
- private static final HashMap<String, Method> mMethodCache = new LinkedHashMap<String, Method>();
-
-
- static {
- mClass_Smeltery = ReflectionUtils.getClass("tconstruct.library.crafting.Smeltery");
- mClass_TConstructRegistry = ReflectionUtils.getClass("tconstruct.library.TConstructRegistry");
-
- mClass_ToolMaterial = ReflectionUtils.getClass("tconstruct.library.tools.ToolMaterial");
- mClass_IPattern = ReflectionUtils.getClass("tconstruct.library.util.IPattern");
- mClass_DynamicToolPart = ReflectionUtils.getClass("tconstruct.library.tools.DynamicToolPart");
- mClass_FluidType = ReflectionUtils.getClass("tconstruct.library.crafting.FluidType");
- mClass_CastingRecipe = ReflectionUtils.getClass("tconstruct.library.crafting.CastingRecipe");
- mClass_TinkerSmeltery = ReflectionUtils.getClass("tconstruct.smeltery.TinkerSmeltery");
-
- mField_MoltenIronFluid = ReflectionUtils.getField(mClass_TinkerSmeltery, "moltenIronFluid");
-
- mMethod_getFluidType = ReflectionUtils.getMethod(mClass_FluidType, "getFluidType", String.class);
- mMethod_getCastingRecipes = ReflectionUtils.getMethod(getCastingInstance(0), "getCastingRecipes", new Class[] {});
- }
-
-
- /**
- *
- * @param aSwitch - The Registry to return
- */
- private static void setTiConDataInstance() {
- if (!LoadedMods.TiCon) {
- return;
- } else {
- if (mSmelteryInstance == null) {
- if (mClass_Smeltery != null) {
- try {
- mSmelteryInstance = ReflectionUtils.getField(mClass_Smeltery, "instance").get(null);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- }
- if (mTinkersRegistryInstance == null) {
- if (mClass_TConstructRegistry != null) {
- try {
- mTinkersRegistryInstance = ReflectionUtils.getField(mClass_TConstructRegistry, "instance").get(null);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- }
- }
- }
-
- public static final boolean isTiConFirstInOD() {
- if (LoadedMods.TiCon) {
- try {
- return (boolean) ReflectionUtils.getField(ReflectionUtils.getClass("PHConstruct"), "tconComesFirst").get(null);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- return false;
- }
-
- public static final boolean stopTiconLoadingFirst() {
- if (isTiConFirstInOD()) {
- try {
- ReflectionUtils.setFinalFieldValue(ReflectionUtils.getClass("PHConstruct"), "tconComesFirst", false);
- if ((boolean) ReflectionUtils.getField(ReflectionUtils.getClass("PHConstruct"), "tconComesFirst").get(null) == false) {
- return true;
- }
- //Did not work, let's see where TiCon uses this and prevent it.
- else {
- ItemUtils.getNonTinkersDust("", 1);
- }
- }
- catch (Exception e) {}
- }
- return false;
- }
-
- /**
- * Add a new fluid as a valid Smeltery fuel.
- * @param fluid The fluid.
- * @param power The temperature of the fluid. This also influences the melting speed. Lava is 1000.
- * @param duration How long one "portion" of liquid fuels the smeltery. Lava is 10.
- */
- public static void addSmelteryFuel (Fluid fluid, int power, int duration){
- setTiConDataInstance();
- ReflectionUtils.invokeVoid(mSmelteryInstance, "addSmelteryFuel", new Class[] {Fluid.class, int.class, int.class}, new Object[] {fluid, power, duration});
- }
-
- /**
- * Returns true if the liquid is a valid smeltery fuel.
- */
- public static boolean isSmelteryFuel (Fluid fluid){
- setTiConDataInstance();
- return ReflectionUtils.invoke(mSmelteryInstance, "isSmelteryFuel", new Class[] {Fluid.class}, new Object[] {fluid});
- }
-
- /**
- * Returns the power of a smeltery fuel or 0 if it's not a fuel.
- */
- public static int getFuelPower (Fluid fluid){
- setTiConDataInstance();
- return (int) ReflectionUtils.invokeNonBool(mSmelteryInstance, "getFuelPower", new Class[] {Fluid.class}, new Object[] {fluid});
- }
-
- /**
- * Returns the duration of a smeltery fuel or 0 if it's not a fuel.
- */
- public static int getFuelDuration (Fluid fluid){
- setTiConDataInstance();
- return (int) ReflectionUtils.invokeNonBool(mSmelteryInstance, "getFuelDuration", new Class[] {Fluid.class}, new Object[] {fluid});
- }
-
-
-
-
-
-
-
- public static boolean registerFluidType(String name, Block block, int meta, int baseTemperature, Fluid fluid, boolean isToolpart) {
- if (mMethodCache.get("registerFluidType") == null) {
- Method m = ReflectionUtils.getMethod(ReflectionUtils.getClass("tconstruct.library.crafting.FluidType"), "registerFluidType", String.class, Block.class, int.class, int.class, Fluid.class, boolean.class);
- mMethodCache.put("registerFluidType", m);
- }
- try {
- mMethodCache.get("registerFluidType").invoke(null, name, block, meta, baseTemperature, fluid, isToolpart);
- return true;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
-
-
-
-
-
-
-
-
- public static boolean addBaseMeltingRecipes(Material aMaterial) {
- return addMelting(aMaterial.getBlock(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluidStack(144*9)) &&
- addMelting(aMaterial.getIngot(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluidStack(144));
- }
-
- public static boolean addMelting(ItemStack input, Block block, int metadata, int temperature, FluidStack liquid) {
- if (mMethodCache.get("addMelting") == null) {
- Method m = ReflectionUtils.getMethod(mClass_Smeltery, "addMelting", ItemStack.class, Block.class, int.class, int.class, FluidStack.class);
- mMethodCache.put("addMelting", m);
- }
- try {
- mMethodCache.get("addMelting").invoke(null, input, block, metadata, temperature, liquid);
- return true;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
-
- public static boolean addMelting(Object type, ItemStack input, int temperatureDifference, int fluidAmount) {
- if (mMethodCache.get("addMelting") == null) {
- Method m = ReflectionUtils.getMethod(mClass_Smeltery, "addMelting", mClass_FluidType, ItemStack.class, int.class, int.class);
- mMethodCache.put("addMelting", m);
- }
- try {
- mMethodCache.get("addMelting").invoke(null, type, input, temperatureDifference, fluidAmount);
- return true;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
-
-
-
-
-
-
-
-
-
-
-
- public static boolean addBaseBasinRecipes(Material aMaterial) {
- return addBasinRecipe(aMaterial.getBlock(1), aMaterial.getFluidStack(144*9), (ItemStack) null, true, 100);
- }
-
- public static boolean addBasinRecipe(ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay) {
- if (mMethodCache.get("addBasinRecipe") == null) {
- Method m = ReflectionUtils.getMethod(ReflectionUtils.getClass("tconstruct.library.crafting.LiquidCasting"), "addCastingRecipe", ItemStack.class, FluidStack.class, ItemStack.class, boolean.class, int.class);
- mMethodCache.put("addBasinRecipe", m);
- }
- try {
- mMethodCache.get("addBasinRecipe").invoke(getCastingInstance(0), output, metal, cast, consume, delay);
- return true;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
-
-
-
-
-
-
-
- public static boolean addBaseCastingRecipes(Material aMaterial) {
- ItemStack ingotcast = getPattern(1);
- return addCastingTableRecipe(aMaterial.getIngot(1), aMaterial.getFluidStack(144), ingotcast, false, 50);
- }
-
- public static boolean addCastingTableRecipe(ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay) {
- if (mMethodCache.get("addCastingTableRecipe") == null) {
- Method m = ReflectionUtils.getMethod(ReflectionUtils.getClass("tconstruct.library.crafting.LiquidCasting"), "addCastingRecipe", ItemStack.class, FluidStack.class, ItemStack.class, boolean.class, int.class);
- mMethodCache.put("addCastingTableRecipe", m);
- }
- try {
- mMethodCache.get("addCastingTableRecipe").invoke(getCastingInstance(1), output, metal, cast, consume, delay);
- return true;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return false;
- }
- }
-
-
-
-
-
-
-
- /**
- * 0 For Table, 1 For Basin.
- * @param aType - Casting Type
- * @return - The casting instance.
- */
- public static Object getCastingInstance(int aType) {
-
- setTiConDataInstance();
-
- Method m = null;
- if (aType == 0) {
- m = ReflectionUtils.getMethod(mTinkersRegistryInstance, "getTableCasting", new Class[] {});
- //return ReflectionUtils.invokeVoid(getTiConDataInstance(1), "getTableCasting", new Class[] {}, new Object[] {});
- }
- else if (aType == 1) {
- m = ReflectionUtils.getMethod(mTinkersRegistryInstance, "getBasinCasting", new Class[] {});
- //return ReflectionUtils.invokeVoid(getTiConDataInstance(1), "getBasinCasting", new Class[] {}, new Object[] {});
- }
- else {
- //return null;
- }
-
- if (m != null) {
- try {
- return m.invoke(mTinkersRegistryInstance, new Object[] {});
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- }
- return null;
- }
-
-
- private static Item mTinkerMetalPattern;
- public static ItemStack getPattern(int aType) {
- if (mTinkerMetalPattern == null) {
- Field m = ReflectionUtils.getField(mClass_TinkerSmeltery, "metalPattern");
- if (m != null) {
- try {
- mTinkerMetalPattern = (Item) m.get(null);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- }
- }
- }
- if (mTinkerMetalPattern != null) {
- ItemStack ingotCast = new ItemStack(mTinkerMetalPattern, aType, 0);
- return ingotCast;
- }
- return ItemUtils.getErrorStack(1, "Bad Tinkers Pattern");
- }
-
- private static AutoMap<?> mDryingRackRecipes;
-
- public static List<?> getDryingRecipes(){
- if (mDryingRackRecipes != null) {
- return mDryingRackRecipes;
- }
- AutoMap<Object> aData = new AutoMap<Object>();
- int aCount = 0;
- try {
- ArrayList<?> recipes = (ArrayList<?>) ReflectionUtils.getField(ReflectionUtils.getClass("tconstruct.library.crafting.DryingRackRecipes"), "recipes").get(null);
- if (recipes != null) {
- for (Object o : recipes) {
- aData.put(o);
- aCount++;
- }
- Logger.INFO("Found "+aCount+" Tinkers drying rack recipes.");
- }
- else {
- Logger.INFO("Failed to find any Tinkers drying rack recipes.");
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {
- Logger.INFO("Failed to find any Tinkers drying rack recipes.");
- }
- mDryingRackRecipes = aData;
- return aData;
- }
-
- /**
- * Generates Tinkers {@link ToolMaterial}'s reflectively.
- * @param name
- * @param localizationString
- * @param level
- * @param durability
- * @param speed
- * @param damage
- * @param handle
- * @param reinforced
- * @param stonebound
- * @param style
- * @param primaryColor
- * @return
- */
- public static Object generateToolMaterial(String name, String localizationString, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, int primaryColor) {
- try {
- Constructor<?> constructor = mClass_ToolMaterial.getConstructor(String.class, String.class, int.class, int.class, int.class, int.class, float.class, int.class, float.class, String.class, int.class);
- Object myObject = constructor.newInstance(name, localizationString, level, durability, speed, damage, handle, reinforced, stonebound, style, primaryColor);
- return myObject;
- } catch (Throwable t) {
- t.printStackTrace();
- return null;
- }
- }
-
-
-
-
-
-
-
-
-
-
-
- public static void addToolMaterial(int id, Object aToolMaterial) {
- if (mMethodCache.get("addToolMaterial") == null) {
- Method m = ReflectionUtils.getMethod(mClass_TConstructRegistry, "addtoolMaterial", int.class, mClass_ToolMaterial);
- mMethodCache.put("addToolMaterial", m);
- }
- try {
- mMethodCache.get("addToolMaterial").invoke(mClass_TConstructRegistry, id, aToolMaterial);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-
- }
- }
-
- public static void addDefaultToolPartMaterial(int id) {
- if (mMethodCache.get("addDefaultToolPartMaterial") == null) {
- Method m = ReflectionUtils.getMethod(mClass_TConstructRegistry, "addDefaultToolPartMaterial", int.class);
- mMethodCache.put("addDefaultToolPartMaterial", m);
- }
- try {
- mMethodCache.get("addDefaultToolPartMaterial").invoke(mClass_TConstructRegistry, id);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- }
-
- public static void addBowMaterial(int id, int drawspeed, float maxSpeed) {
- if (mMethodCache.get("addBowMaterial") == null) {
- Method m = ReflectionUtils.getMethod(mClass_TConstructRegistry, "addBowMaterial", int.class, int.class, float.class);
- mMethodCache.put("addBowMaterial", m);
- }
- try {
- mMethodCache.get("addBowMaterial").invoke(mClass_TConstructRegistry, id, drawspeed, maxSpeed);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- }
-
- public static void addArrowMaterial(int id, float mass, float fragility) {
- if (mMethodCache.get("addArrowMaterial") == null) {
- Method m = ReflectionUtils.getMethod(mClass_TConstructRegistry, "addArrowMaterial", int.class, float.class, float.class);
- mMethodCache.put("addArrowMaterial", m);
- }
- try {
- mMethodCache.get("addArrowMaterial").invoke(mClass_TConstructRegistry, id, mass, fragility);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- }
-
- public static List<?> getTableCastingRecipes(){
- Object aCastingTableHandlerInstance = getCastingInstance(0);
- List<?> aTemp;
- try {
- aTemp = (List<?>) mMethod_getCastingRecipes.invoke(aCastingTableHandlerInstance, new Object[] {});
- return aTemp;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- return new ArrayList<Object>();
- }
-
- public static boolean generateCastingRecipes(Material aMaterial, int aID) {
-
- List<CastingRecipeHandler> newRecipies = new LinkedList<CastingRecipeHandler>();
-
-
- Iterator<?> iterator1 = getTableCastingRecipes().iterator();
- Fluid aMoltenIron = null;
- if (aMoltenIron == null) {
- try {
- aMoltenIron = (Fluid) mField_MoltenIronFluid.get(null);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- e.printStackTrace();
- aMoltenIron = Materials.Iron.getMolten(0).getFluid();
- }
- }
- while (iterator1.hasNext()) {
- CastingRecipeHandler recipe = new CastingRecipeHandler(iterator1.next());
- if (recipe == null || !recipe.valid) {
- continue;
- }
- try {
- if (recipe.castingMetal.getFluid() == aMoltenIron && recipe.cast != null
- && mClass_IPattern.isInstance(recipe.cast.getItem()) && mClass_DynamicToolPart.isInstance(recipe.getResult().getItem())) {
- newRecipies.add(recipe);
- }
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- return false;
- }
- }
-
-
- Object ft;
- try {
- ft = mMethod_getFluidType.invoke(null, aMaterial.getLocalizedName());
- Iterator<CastingRecipeHandler> iterator2 = newRecipies.iterator();
- while (iterator2.hasNext()) {
- CastingRecipeHandler recipe = new CastingRecipeHandler(iterator2.next());
- if (!recipe.valid){
- continue;
- }
- //CastingRecipe recipe = (CastingRecipe) i$.next();
- ItemStack output = recipe.getResult().copy();
- output.setItemDamage(aID);
- FluidStack liquid2 = new FluidStack(aMaterial.getFluidStack(0).getFluid(), recipe.castingMetal.amount);
- addCastingTableRecipe(output, liquid2, recipe.cast, recipe.consumeCast, recipe.coolTime);
- addMelting(ft, output, 0, liquid2.amount / 2);
- }
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- return false;
- }
-
- return true;
- }
-
- private static class CastingRecipeHandler {
-
- public ItemStack output;
- public FluidStack castingMetal;
- public ItemStack cast;
- public boolean consumeCast;
- public int coolTime;
-
- public boolean valid;
-
- public CastingRecipeHandler(Object aCastingRecipe) {
- if (mClass_CastingRecipe.isInstance(aCastingRecipe)) {
- try {
- Field aF_output = ReflectionUtils.getField(mClass_CastingRecipe, "output");
- Field aF_castingMetal = ReflectionUtils.getField(mClass_CastingRecipe, "castingMetal");
- Field aF_cast = ReflectionUtils.getField(mClass_CastingRecipe, "cast");
- Field aF_consumeCast = ReflectionUtils.getField(mClass_CastingRecipe, "consumeCast");
- Field aF_coolTime = ReflectionUtils.getField(mClass_CastingRecipe, "coolTime");
-
- output = (ItemStack) aF_output.get(aCastingRecipe);
- castingMetal = (FluidStack) aF_castingMetal.get(aCastingRecipe);
- cast = (ItemStack) aF_cast.get(aCastingRecipe);
- consumeCast = (boolean) aF_consumeCast.get(aCastingRecipe);
- coolTime = (int) aF_coolTime.get(aCastingRecipe);
- valid = true;
- }
- catch (Throwable t) {
- t.printStackTrace();
- valid = false;
- }
- }
- else {
- valid = false;
- }
- }
-
- public boolean matches(FluidStack metal, ItemStack inputCast) {
- return this.castingMetal.isFluidEqual(metal) && (this.cast != null && this.cast.getItemDamage() == 32767
- && inputCast.getItem() == this.cast.getItem() || ItemStack.areItemStacksEqual(this.cast, inputCast));
- }
-
- public ItemStack getResult() {
- return this.output.copy();
- }
-
- }
+ private static final Class<?> mClass_Smeltery;
+ private static final Class<?> mClass_TConstructRegistry;
+ private static final Class<?> mClass_ToolMaterial;
+ private static final Class<?> mClass_IPattern;
+ private static final Class<?> mClass_DynamicToolPart;
+ private static final Class<?> mClass_FluidType;
+ private static final Class<?> mClass_CastingRecipe;
+ private static final Class<?> mClass_TinkerSmeltery;
+
+ private static final Field mField_MoltenIronFluid;
+
+ private static final Method mMethod_getFluidType;
+ private static final Method mMethod_getCastingRecipes;
+
+ private static Object mSmelteryInstance;
+ private static Object mTinkersRegistryInstance;
+
+ private static final HashMap<String, Method> mMethodCache = new LinkedHashMap<String, Method>();
+
+ static {
+ mClass_Smeltery = ReflectionUtils.getClass("tconstruct.library.crafting.Smeltery");
+ mClass_TConstructRegistry = ReflectionUtils.getClass("tconstruct.library.TConstructRegistry");
+
+ mClass_ToolMaterial = ReflectionUtils.getClass("tconstruct.library.tools.ToolMaterial");
+ mClass_IPattern = ReflectionUtils.getClass("tconstruct.library.util.IPattern");
+ mClass_DynamicToolPart = ReflectionUtils.getClass("tconstruct.library.tools.DynamicToolPart");
+ mClass_FluidType = ReflectionUtils.getClass("tconstruct.library.crafting.FluidType");
+ mClass_CastingRecipe = ReflectionUtils.getClass("tconstruct.library.crafting.CastingRecipe");
+ mClass_TinkerSmeltery = ReflectionUtils.getClass("tconstruct.smeltery.TinkerSmeltery");
+
+ mField_MoltenIronFluid = ReflectionUtils.getField(mClass_TinkerSmeltery, "moltenIronFluid");
+
+ mMethod_getFluidType = ReflectionUtils.getMethod(mClass_FluidType, "getFluidType", String.class);
+ mMethod_getCastingRecipes =
+ ReflectionUtils.getMethod(getCastingInstance(0), "getCastingRecipes", new Class[] {});
+ }
+
+ /**
+ *
+ * @param aSwitch - The Registry to return
+ */
+ private static void setTiConDataInstance() {
+ if (!LoadedMods.TiCon) {
+ return;
+ } else {
+ if (mSmelteryInstance == null) {
+ if (mClass_Smeltery != null) {
+ try {
+ mSmelteryInstance = ReflectionUtils.getField(mClass_Smeltery, "instance")
+ .get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ }
+ if (mTinkersRegistryInstance == null) {
+ if (mClass_TConstructRegistry != null) {
+ try {
+ mTinkersRegistryInstance = ReflectionUtils.getField(mClass_TConstructRegistry, "instance")
+ .get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ }
+ }
+ }
+
+ public static final boolean isTiConFirstInOD() {
+ if (LoadedMods.TiCon) {
+ try {
+ return (boolean) ReflectionUtils.getField(ReflectionUtils.getClass("PHConstruct"), "tconComesFirst")
+ .get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ return false;
+ }
+
+ public static final boolean stopTiconLoadingFirst() {
+ if (isTiConFirstInOD()) {
+ try {
+ ReflectionUtils.setFinalFieldValue(ReflectionUtils.getClass("PHConstruct"), "tconComesFirst", false);
+ if ((boolean) ReflectionUtils.getField(ReflectionUtils.getClass("PHConstruct"), "tconComesFirst")
+ .get(null)
+ == false) {
+ return true;
+ }
+ // Did not work, let's see where TiCon uses this and prevent it.
+ else {
+ ItemUtils.getNonTinkersDust("", 1);
+ }
+ } catch (Exception e) {
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Add a new fluid as a valid Smeltery fuel.
+ * @param fluid The fluid.
+ * @param power The temperature of the fluid. This also influences the melting speed. Lava is 1000.
+ * @param duration How long one "portion" of liquid fuels the smeltery. Lava is 10.
+ */
+ public static void addSmelteryFuel(Fluid fluid, int power, int duration) {
+ setTiConDataInstance();
+ ReflectionUtils.invokeVoid(
+ mSmelteryInstance, "addSmelteryFuel", new Class[] {Fluid.class, int.class, int.class}, new Object[] {
+ fluid, power, duration
+ });
+ }
+
+ /**
+ * Returns true if the liquid is a valid smeltery fuel.
+ */
+ public static boolean isSmelteryFuel(Fluid fluid) {
+ setTiConDataInstance();
+ return ReflectionUtils.invoke(
+ mSmelteryInstance, "isSmelteryFuel", new Class[] {Fluid.class}, new Object[] {fluid});
+ }
+
+ /**
+ * Returns the power of a smeltery fuel or 0 if it's not a fuel.
+ */
+ public static int getFuelPower(Fluid fluid) {
+ setTiConDataInstance();
+ return (int) ReflectionUtils.invokeNonBool(
+ mSmelteryInstance, "getFuelPower", new Class[] {Fluid.class}, new Object[] {fluid});
+ }
+
+ /**
+ * Returns the duration of a smeltery fuel or 0 if it's not a fuel.
+ */
+ public static int getFuelDuration(Fluid fluid) {
+ setTiConDataInstance();
+ return (int) ReflectionUtils.invokeNonBool(
+ mSmelteryInstance, "getFuelDuration", new Class[] {Fluid.class}, new Object[] {fluid});
+ }
+
+ public static boolean registerFluidType(
+ String name, Block block, int meta, int baseTemperature, Fluid fluid, boolean isToolpart) {
+ if (mMethodCache.get("registerFluidType") == null) {
+ Method m = ReflectionUtils.getMethod(
+ ReflectionUtils.getClass("tconstruct.library.crafting.FluidType"),
+ "registerFluidType",
+ String.class,
+ Block.class,
+ int.class,
+ int.class,
+ Fluid.class,
+ boolean.class);
+ mMethodCache.put("registerFluidType", m);
+ }
+ try {
+ mMethodCache.get("registerFluidType").invoke(null, name, block, meta, baseTemperature, fluid, isToolpart);
+ return true;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ }
+
+ public static boolean addBaseMeltingRecipes(Material aMaterial) {
+ return addMelting(
+ aMaterial.getBlock(1),
+ aMaterial.getBlock(),
+ 0,
+ aMaterial.getMeltingPointC(),
+ aMaterial.getFluidStack(144 * 9))
+ && addMelting(
+ aMaterial.getIngot(1),
+ aMaterial.getBlock(),
+ 0,
+ aMaterial.getMeltingPointC(),
+ aMaterial.getFluidStack(144));
+ }
+
+ public static boolean addMelting(ItemStack input, Block block, int metadata, int temperature, FluidStack liquid) {
+ if (mMethodCache.get("addMelting") == null) {
+ Method m = ReflectionUtils.getMethod(
+ mClass_Smeltery,
+ "addMelting",
+ ItemStack.class,
+ Block.class,
+ int.class,
+ int.class,
+ FluidStack.class);
+ mMethodCache.put("addMelting", m);
+ }
+ try {
+ mMethodCache.get("addMelting").invoke(null, input, block, metadata, temperature, liquid);
+ return true;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ }
+
+ public static boolean addMelting(Object type, ItemStack input, int temperatureDifference, int fluidAmount) {
+ if (mMethodCache.get("addMelting") == null) {
+ Method m = ReflectionUtils.getMethod(
+ mClass_Smeltery, "addMelting", mClass_FluidType, ItemStack.class, int.class, int.class);
+ mMethodCache.put("addMelting", m);
+ }
+ try {
+ mMethodCache.get("addMelting").invoke(null, type, input, temperatureDifference, fluidAmount);
+ return true;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ }
+
+ public static boolean addBaseBasinRecipes(Material aMaterial) {
+ return addBasinRecipe(aMaterial.getBlock(1), aMaterial.getFluidStack(144 * 9), (ItemStack) null, true, 100);
+ }
+
+ public static boolean addBasinRecipe(
+ ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay) {
+ if (mMethodCache.get("addBasinRecipe") == null) {
+ Method m = ReflectionUtils.getMethod(
+ ReflectionUtils.getClass("tconstruct.library.crafting.LiquidCasting"),
+ "addCastingRecipe",
+ ItemStack.class,
+ FluidStack.class,
+ ItemStack.class,
+ boolean.class,
+ int.class);
+ mMethodCache.put("addBasinRecipe", m);
+ }
+ try {
+ mMethodCache.get("addBasinRecipe").invoke(getCastingInstance(0), output, metal, cast, consume, delay);
+ return true;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ }
+
+ public static boolean addBaseCastingRecipes(Material aMaterial) {
+ ItemStack ingotcast = getPattern(1);
+ return addCastingTableRecipe(aMaterial.getIngot(1), aMaterial.getFluidStack(144), ingotcast, false, 50);
+ }
+
+ public static boolean addCastingTableRecipe(
+ ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay) {
+ if (mMethodCache.get("addCastingTableRecipe") == null) {
+ Method m = ReflectionUtils.getMethod(
+ ReflectionUtils.getClass("tconstruct.library.crafting.LiquidCasting"),
+ "addCastingRecipe",
+ ItemStack.class,
+ FluidStack.class,
+ ItemStack.class,
+ boolean.class,
+ int.class);
+ mMethodCache.put("addCastingTableRecipe", m);
+ }
+ try {
+ mMethodCache
+ .get("addCastingTableRecipe")
+ .invoke(getCastingInstance(1), output, metal, cast, consume, delay);
+ return true;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ }
+
+ /**
+ * 0 For Table, 1 For Basin.
+ * @param aType - Casting Type
+ * @return - The casting instance.
+ */
+ public static Object getCastingInstance(int aType) {
+
+ setTiConDataInstance();
+
+ Method m = null;
+ if (aType == 0) {
+ m = ReflectionUtils.getMethod(mTinkersRegistryInstance, "getTableCasting", new Class[] {});
+ // return ReflectionUtils.invokeVoid(getTiConDataInstance(1), "getTableCasting", new Class[] {}, new
+ // Object[] {});
+ } else if (aType == 1) {
+ m = ReflectionUtils.getMethod(mTinkersRegistryInstance, "getBasinCasting", new Class[] {});
+ // return ReflectionUtils.invokeVoid(getTiConDataInstance(1), "getBasinCasting", new Class[] {}, new
+ // Object[] {});
+ } else {
+ // return null;
+ }
+
+ if (m != null) {
+ try {
+ return m.invoke(mTinkersRegistryInstance, new Object[] {});
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+
+ private static Item mTinkerMetalPattern;
+
+ public static ItemStack getPattern(int aType) {
+ if (mTinkerMetalPattern == null) {
+ Field m = ReflectionUtils.getField(mClass_TinkerSmeltery, "metalPattern");
+ if (m != null) {
+ try {
+ mTinkerMetalPattern = (Item) m.get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ }
+ }
+ if (mTinkerMetalPattern != null) {
+ ItemStack ingotCast = new ItemStack(mTinkerMetalPattern, aType, 0);
+ return ingotCast;
+ }
+ return ItemUtils.getErrorStack(1, "Bad Tinkers Pattern");
+ }
+
+ private static AutoMap<?> mDryingRackRecipes;
+
+ public static List<?> getDryingRecipes() {
+ if (mDryingRackRecipes != null) {
+ return mDryingRackRecipes;
+ }
+ AutoMap<Object> aData = new AutoMap<Object>();
+ int aCount = 0;
+ try {
+ ArrayList<?> recipes = (ArrayList<?>) ReflectionUtils.getField(
+ ReflectionUtils.getClass("tconstruct.library.crafting.DryingRackRecipes"), "recipes")
+ .get(null);
+ if (recipes != null) {
+ for (Object o : recipes) {
+ aData.put(o);
+ aCount++;
+ }
+ Logger.INFO("Found " + aCount + " Tinkers drying rack recipes.");
+ } else {
+ Logger.INFO("Failed to find any Tinkers drying rack recipes.");
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ Logger.INFO("Failed to find any Tinkers drying rack recipes.");
+ }
+ mDryingRackRecipes = aData;
+ return aData;
+ }
+
+ /**
+ * Generates Tinkers {@link ToolMaterial}'s reflectively.
+ * @param name
+ * @param localizationString
+ * @param level
+ * @param durability
+ * @param speed
+ * @param damage
+ * @param handle
+ * @param reinforced
+ * @param stonebound
+ * @param style
+ * @param primaryColor
+ * @return
+ */
+ public static Object generateToolMaterial(
+ String name,
+ String localizationString,
+ int level,
+ int durability,
+ int speed,
+ int damage,
+ float handle,
+ int reinforced,
+ float stonebound,
+ String style,
+ int primaryColor) {
+ try {
+ Constructor<?> constructor = mClass_ToolMaterial.getConstructor(
+ String.class,
+ String.class,
+ int.class,
+ int.class,
+ int.class,
+ int.class,
+ float.class,
+ int.class,
+ float.class,
+ String.class,
+ int.class);
+ Object myObject = constructor.newInstance(
+ name,
+ localizationString,
+ level,
+ durability,
+ speed,
+ damage,
+ handle,
+ reinforced,
+ stonebound,
+ style,
+ primaryColor);
+ return myObject;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return null;
+ }
+ }
+
+ public static void addToolMaterial(int id, Object aToolMaterial) {
+ if (mMethodCache.get("addToolMaterial") == null) {
+ Method m = ReflectionUtils.getMethod(
+ mClass_TConstructRegistry, "addtoolMaterial", int.class, mClass_ToolMaterial);
+ mMethodCache.put("addToolMaterial", m);
+ }
+ try {
+ mMethodCache.get("addToolMaterial").invoke(mClass_TConstructRegistry, id, aToolMaterial);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+
+ }
+ }
+
+ public static void addDefaultToolPartMaterial(int id) {
+ if (mMethodCache.get("addDefaultToolPartMaterial") == null) {
+ Method m = ReflectionUtils.getMethod(mClass_TConstructRegistry, "addDefaultToolPartMaterial", int.class);
+ mMethodCache.put("addDefaultToolPartMaterial", m);
+ }
+ try {
+ mMethodCache.get("addDefaultToolPartMaterial").invoke(mClass_TConstructRegistry, id);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+
+ public static void addBowMaterial(int id, int drawspeed, float maxSpeed) {
+ if (mMethodCache.get("addBowMaterial") == null) {
+ Method m = ReflectionUtils.getMethod(
+ mClass_TConstructRegistry, "addBowMaterial", int.class, int.class, float.class);
+ mMethodCache.put("addBowMaterial", m);
+ }
+ try {
+ mMethodCache.get("addBowMaterial").invoke(mClass_TConstructRegistry, id, drawspeed, maxSpeed);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+
+ public static void addArrowMaterial(int id, float mass, float fragility) {
+ if (mMethodCache.get("addArrowMaterial") == null) {
+ Method m = ReflectionUtils.getMethod(
+ mClass_TConstructRegistry, "addArrowMaterial", int.class, float.class, float.class);
+ mMethodCache.put("addArrowMaterial", m);
+ }
+ try {
+ mMethodCache.get("addArrowMaterial").invoke(mClass_TConstructRegistry, id, mass, fragility);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+
+ public static List<?> getTableCastingRecipes() {
+ Object aCastingTableHandlerInstance = getCastingInstance(0);
+ List<?> aTemp;
+ try {
+ aTemp = (List<?>) mMethod_getCastingRecipes.invoke(aCastingTableHandlerInstance, new Object[] {});
+ return aTemp;
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return new ArrayList<Object>();
+ }
+
+ public static boolean generateCastingRecipes(Material aMaterial, int aID) {
+
+ List<CastingRecipeHandler> newRecipies = new LinkedList<CastingRecipeHandler>();
+
+ Iterator<?> iterator1 = getTableCastingRecipes().iterator();
+ Fluid aMoltenIron = null;
+ if (aMoltenIron == null) {
+ try {
+ aMoltenIron = (Fluid) mField_MoltenIronFluid.get(null);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ aMoltenIron = Materials.Iron.getMolten(0).getFluid();
+ }
+ }
+ while (iterator1.hasNext()) {
+ CastingRecipeHandler recipe = new CastingRecipeHandler(iterator1.next());
+ if (recipe == null || !recipe.valid) {
+ continue;
+ }
+ try {
+ if (recipe.castingMetal.getFluid() == aMoltenIron
+ && recipe.cast != null
+ && mClass_IPattern.isInstance(recipe.cast.getItem())
+ && mClass_DynamicToolPart.isInstance(recipe.getResult().getItem())) {
+ newRecipies.add(recipe);
+ }
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ Object ft;
+ try {
+ ft = mMethod_getFluidType.invoke(null, aMaterial.getLocalizedName());
+ Iterator<CastingRecipeHandler> iterator2 = newRecipies.iterator();
+ while (iterator2.hasNext()) {
+ CastingRecipeHandler recipe = new CastingRecipeHandler(iterator2.next());
+ if (!recipe.valid) {
+ continue;
+ }
+ // CastingRecipe recipe = (CastingRecipe) i$.next();
+ ItemStack output = recipe.getResult().copy();
+ output.setItemDamage(aID);
+ FluidStack liquid2 = new FluidStack(aMaterial.getFluidStack(0).getFluid(), recipe.castingMetal.amount);
+ addCastingTableRecipe(output, liquid2, recipe.cast, recipe.consumeCast, recipe.coolTime);
+ addMelting(ft, output, 0, liquid2.amount / 2);
+ }
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ return false;
+ }
+
+ return true;
+ }
+
+ private static class CastingRecipeHandler {
+
+ public ItemStack output;
+ public FluidStack castingMetal;
+ public ItemStack cast;
+ public boolean consumeCast;
+ public int coolTime;
+
+ public boolean valid;
+
+ public CastingRecipeHandler(Object aCastingRecipe) {
+ if (mClass_CastingRecipe.isInstance(aCastingRecipe)) {
+ try {
+ Field aF_output = ReflectionUtils.getField(mClass_CastingRecipe, "output");
+ Field aF_castingMetal = ReflectionUtils.getField(mClass_CastingRecipe, "castingMetal");
+ Field aF_cast = ReflectionUtils.getField(mClass_CastingRecipe, "cast");
+ Field aF_consumeCast = ReflectionUtils.getField(mClass_CastingRecipe, "consumeCast");
+ Field aF_coolTime = ReflectionUtils.getField(mClass_CastingRecipe, "coolTime");
+
+ output = (ItemStack) aF_output.get(aCastingRecipe);
+ castingMetal = (FluidStack) aF_castingMetal.get(aCastingRecipe);
+ cast = (ItemStack) aF_cast.get(aCastingRecipe);
+ consumeCast = (boolean) aF_consumeCast.get(aCastingRecipe);
+ coolTime = (int) aF_coolTime.get(aCastingRecipe);
+ valid = true;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ valid = false;
+ }
+ } else {
+ valid = false;
+ }
+ }
+
+ public boolean matches(FluidStack metal, ItemStack inputCast) {
+ return this.castingMetal.isFluidEqual(metal)
+ && (this.cast != null
+ && this.cast.getItemDamage() == 32767
+ && inputCast.getItem() == this.cast.getItem()
+ || ItemStack.areItemStacksEqual(this.cast, inputCast));
+ }
+ public ItemStack getResult() {
+ return this.output.copy();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/witchery/WitchUtils.java b/src/main/java/gtPlusPlus/xmod/witchery/WitchUtils.java
index 35f9f4bbe8..b1e01eab7f 100644
--- a/src/main/java/gtPlusPlus/xmod/witchery/WitchUtils.java
+++ b/src/main/java/gtPlusPlus/xmod/witchery/WitchUtils.java
@@ -1,13 +1,11 @@
package gtPlusPlus.xmod.witchery;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-
import com.mojang.authlib.GameProfile;
-
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
@@ -15,85 +13,90 @@ import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.oredict.OreDictionary;
public class WitchUtils {
-
- private static final GameProfile NORMAL_MINER_PROFILE;
- private static final GameProfile KOBOLDITE_MINER_PROFILE;
-
- static {
- Field a1 = null, a2 = null;
- GameProfile b1 = null, b2 = null;
- if (LoadedMods.Witchery) {
- try {
- a1 = getField("com.emoniph.witchery.entity.ai.EntityAIDigBlocks", "NORMAL_MINER_PROFILE");
- a2 = getField("com.emoniph.witchery.entity.ai.EntityAIDigBlocks", "KOBOLDITE_MINER_PROFILE");
- b1 = (GameProfile) a1.get(null);
- b2 = (GameProfile) a2.get(null);
- }
- catch (Throwable t) {
- }
- }
- NORMAL_MINER_PROFILE = b1;
- KOBOLDITE_MINER_PROFILE = b2;
- }
-
- //com.emoniph.witchery.entity.ai.EntityAIDigBlocks.onHarvestDrops(EntityPlayer, HarvestDropsEvent)
- public static void onHarvestDrops(final EntityPlayer harvester, final BlockEvent.HarvestDropsEvent event) {
+ private static final GameProfile NORMAL_MINER_PROFILE;
+ private static final GameProfile KOBOLDITE_MINER_PROFILE;
- if (LoadedMods.Witchery) {
+ static {
+ Field a1 = null, a2 = null;
+ GameProfile b1 = null, b2 = null;
+ if (LoadedMods.Witchery) {
+ try {
+ a1 = getField("com.emoniph.witchery.entity.ai.EntityAIDigBlocks", "NORMAL_MINER_PROFILE");
+ a2 = getField("com.emoniph.witchery.entity.ai.EntityAIDigBlocks", "KOBOLDITE_MINER_PROFILE");
+ b1 = (GameProfile) a1.get(null);
+ b2 = (GameProfile) a2.get(null);
+ } catch (Throwable t) {
+ }
+ }
+ NORMAL_MINER_PROFILE = b1;
+ KOBOLDITE_MINER_PROFILE = b2;
+ }
- if (harvester != null && !harvester.worldObj.isRemote && !event.isCanceled() && (isEqual(harvester.getGameProfile(), KOBOLDITE_MINER_PROFILE) || isEqual(harvester.getGameProfile(), NORMAL_MINER_PROFILE))) {
- final boolean hasKobolditePick = isEqual(harvester.getGameProfile(), KOBOLDITE_MINER_PROFILE);
- final ArrayList<ItemStack> newDrops = new ArrayList<ItemStack>();
- double kobolditeChance = hasKobolditePick ? 0.02 : 0.01;
- for (final ItemStack drop : event.drops) {
- final int[] oreIDs = OreDictionary.getOreIDs(drop);
- boolean addOriginal = true;
- if (oreIDs.length > 0) {
- final String oreName = OreDictionary.getOreName(oreIDs[0]);
- if (oreName != null && oreName.startsWith("ore")) {
- final ItemStack smeltedDrop = FurnaceRecipes.smelting().getSmeltingResult(drop);
- if (smeltedDrop != null && hasKobolditePick && harvester.worldObj.rand.nextDouble() < 0.5) {
- addOriginal = false;
- newDrops.add(smeltedDrop.copy());
- newDrops.add(smeltedDrop.copy());
- if (harvester.worldObj.rand.nextDouble() < 0.25) {
- newDrops.add(smeltedDrop.copy());
- }
- }
- kobolditeChance = (hasKobolditePick ? 0.08 : 0.05);
- }
- }
- if (addOriginal) {
- newDrops.add(drop);
- }
- }
- event.drops.clear();
- for (final ItemStack newDrop : newDrops) {
- event.drops.add(newDrop);
- }
- if (kobolditeChance > 0.0 && harvester.worldObj.rand.nextDouble() < kobolditeChance) {
- event.drops.add(ALLOY.KOBOLDITE.getDust(1));
- }
- }
- }
+ // com.emoniph.witchery.entity.ai.EntityAIDigBlocks.onHarvestDrops(EntityPlayer, HarvestDropsEvent)
+ public static void onHarvestDrops(final EntityPlayer harvester, final BlockEvent.HarvestDropsEvent event) {
- }
+ if (LoadedMods.Witchery) {
- public static Field getField(String aClassName, String aFieldName) {
- Class c;
- c = ReflectionUtils.getClass(aClassName);
- if (c != null) {
- Field f = ReflectionUtils.getField(c, aFieldName);
- if (f != null) {
- return f;
- }
- }
- return null;
- }
+ if (harvester != null
+ && !harvester.worldObj.isRemote
+ && !event.isCanceled()
+ && (isEqual(harvester.getGameProfile(), KOBOLDITE_MINER_PROFILE)
+ || isEqual(harvester.getGameProfile(), NORMAL_MINER_PROFILE))) {
+ final boolean hasKobolditePick = isEqual(harvester.getGameProfile(), KOBOLDITE_MINER_PROFILE);
+ final ArrayList<ItemStack> newDrops = new ArrayList<ItemStack>();
+ double kobolditeChance = hasKobolditePick ? 0.02 : 0.01;
+ for (final ItemStack drop : event.drops) {
+ final int[] oreIDs = OreDictionary.getOreIDs(drop);
+ boolean addOriginal = true;
+ if (oreIDs.length > 0) {
+ final String oreName = OreDictionary.getOreName(oreIDs[0]);
+ if (oreName != null && oreName.startsWith("ore")) {
+ final ItemStack smeltedDrop =
+ FurnaceRecipes.smelting().getSmeltingResult(drop);
+ if (smeltedDrop != null && hasKobolditePick && harvester.worldObj.rand.nextDouble() < 0.5) {
+ addOriginal = false;
+ newDrops.add(smeltedDrop.copy());
+ newDrops.add(smeltedDrop.copy());
+ if (harvester.worldObj.rand.nextDouble() < 0.25) {
+ newDrops.add(smeltedDrop.copy());
+ }
+ }
+ kobolditeChance = (hasKobolditePick ? 0.08 : 0.05);
+ }
+ }
+ if (addOriginal) {
+ newDrops.add(drop);
+ }
+ }
+ event.drops.clear();
+ for (final ItemStack newDrop : newDrops) {
+ event.drops.add(newDrop);
+ }
+ if (kobolditeChance > 0.0 && harvester.worldObj.rand.nextDouble() < kobolditeChance) {
+ event.drops.add(ALLOY.KOBOLDITE.getDust(1));
+ }
+ }
+ }
+ }
- public static boolean isEqual(final GameProfile a, final GameProfile b) {
- return a != null && b != null && a.getId() != null && b.getId() != null && a.getId().equals(b.getId());
- }
+ public static Field getField(String aClassName, String aFieldName) {
+ Class c;
+ c = ReflectionUtils.getClass(aClassName);
+ if (c != null) {
+ Field f = ReflectionUtils.getField(c, aFieldName);
+ if (f != null) {
+ return f;
+ }
+ }
+ return null;
+ }
+ public static boolean isEqual(final GameProfile a, final GameProfile b) {
+ return a != null
+ && b != null
+ && a.getId() != null
+ && b.getId() != null
+ && a.getId().equals(b.getId());
+ }
}
diff --git a/src/main/java/vswe/stevescarts/ModuleData/GppModuleData.java b/src/main/java/vswe/stevescarts/ModuleData/GppModuleData.java
index eb8a8f319f..6d3596f2b1 100644
--- a/src/main/java/vswe/stevescarts/ModuleData/GppModuleData.java
+++ b/src/main/java/vswe/stevescarts/ModuleData/GppModuleData.java
@@ -1,10 +1,9 @@
package vswe.stevescarts.ModuleData;
-import java.util.ArrayList;
-import java.util.HashMap;
-
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.sc2.modules.ModuleExoticSeeds;
+import java.util.ArrayList;
+import java.util.HashMap;
import net.minecraft.init.Items;
import vswe.stevescarts.Helpers.ComponentTypes;
import vswe.stevescarts.Items.ModItems;
@@ -12,38 +11,36 @@ import vswe.stevescarts.Modules.ModuleBase;
public class GppModuleData extends ModuleData {
- static byte ID_ExoticSeedAddon = 105;
- public static ArrayList<ModuleData> moduleListCustom = new ArrayList<>();
-
- public GppModuleData(int id, String name, Class<? extends ModuleBase> moduleClass, int modularCost) {
- super(id, name, moduleClass, modularCost);
- }
+ static byte ID_ExoticSeedAddon = 105;
+ public static ArrayList<ModuleData> moduleListCustom = new ArrayList<>();
- @SuppressWarnings("unchecked")
- public static void loadGpp() {
- try {
- HashMap<Byte, ModuleData> moduleList =
- (HashMap<Byte, ModuleData>) (ReflectionUtils.getField(ModuleData.class, "moduleList").get(ModuleData.class));
- ModuleData netherWartModule = moduleList.get((byte)58);
+ public GppModuleData(int id, String name, Class<? extends ModuleBase> moduleClass, int modularCost) {
+ super(id, name, moduleClass, modularCost);
+ }
- ModuleDataGroup farmerGroup = netherWartModule.getRequirement().get(0);
+ @SuppressWarnings("unchecked")
+ public static void loadGpp() {
+ try {
+ HashMap<Byte, ModuleData> moduleList = (HashMap<Byte, ModuleData>)
+ (ReflectionUtils.getField(ModuleData.class, "moduleList").get(ModuleData.class));
+ ModuleData netherWartModule = moduleList.get((byte) 58);
- ModuleData exoticSeedModule =
- new ModuleData(ID_ExoticSeedAddon, "Crop: Exotic Seeds", ModuleExoticSeeds.class, 20).addRequirement(farmerGroup)
- .addRecipe(new Object[][]{{Items.wheat_seeds},
- {ComponentTypes.EMPTY_DISK.getItemStack()}
- });
+ ModuleDataGroup farmerGroup = netherWartModule.getRequirement().get(0);
- moduleListCustom.add(exoticSeedModule);
+ ModuleData exoticSeedModule = new ModuleData(
+ ID_ExoticSeedAddon, "Crop: Exotic Seeds", ModuleExoticSeeds.class, 20)
+ .addRequirement(farmerGroup)
+ .addRecipe(new Object[][] {{Items.wheat_seeds}, {ComponentTypes.EMPTY_DISK.getItemStack()}});
- HashMap<Byte, Boolean> validModules =
- (HashMap<Byte, Boolean>) (ReflectionUtils.getField(ModItems.class, "validModules").get(ModItems.class));
+ moduleListCustom.add(exoticSeedModule);
- validModules.put(ID_ExoticSeedAddon, true);
+ HashMap<Byte, Boolean> validModules = (HashMap<Byte, Boolean>)
+ (ReflectionUtils.getField(ModItems.class, "validModules").get(ModItems.class));
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
+ validModules.put(ID_ExoticSeedAddon, true);
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
}